Built motion from commit ef9bfea2.|2.6.1
authorAndrea Amorese <andrea.amorese@xenialab.it>
Fri, 4 Feb 2022 14:10:06 +0000 (15:10 +0100)
committerAndrea Amorese <andrea.amorese@xenialab.it>
Fri, 4 Feb 2022 14:10:06 +0000 (15:10 +0100)
1187 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/authActiveDirectory/authActiveDirectory.controller.js
server/api/authActiveDirectory/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.events.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/client-side-logs.js
server/api/cloudProvider/cloudProvider.attributes.js
server/api/cloudProvider/cloudProvider.controller.js
server/api/cloudProvider/cloudProvider.model.js
server/api/cloudProvider/cloudProvider.oauth.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.events.js
server/api/mailSubstatus/mailSubstatus.model.js
server/api/mailSubstatus/mailSubstatus.rpc.js
server/api/mailTransferReport/index.js
server/api/mailTransferReport/mailTransferReport.attributes.js
server/api/mailTransferReport/mailTransferReport.controller.js
server/api/mailTransferReport/mailTransferReport.model.js
server/api/mailTransferReport/mailTransferReport.rpc.js
server/api/memberReport/index.js
server/api/memberReport/memberReport.attributes.js
server/api/memberReport/memberReport.controller.js
server/api/memberReport/memberReport.model.js
server/api/memberReport/memberReport.rpc.js
server/api/migration/index.js
server/api/migration/migration.attributes.js
server/api/migration/migration.controller.js
server/api/migration/migration.model.js
server/api/migration/migration.rpc.js
server/api/network/index.js
server/api/network/network.attributes.js
server/api/network/network.controller.js
server/api/network/network.model.js
server/api/network/network.rpc.js
server/api/openchannelAccount/index.js
server/api/openchannelAccount/openchannelAccount.attributes.js
server/api/openchannelAccount/openchannelAccount.controller.js
server/api/openchannelAccount/openchannelAccount.events.js
server/api/openchannelAccount/openchannelAccount.model.js
server/api/openchannelAccount/openchannelAccount.rpc.js
server/api/openchannelAccount/openchannelAccount.socket.js
server/api/openchannelApplication/index.js
server/api/openchannelApplication/openchannelApplication.attributes.js
server/api/openchannelApplication/openchannelApplication.controller.js
server/api/openchannelApplication/openchannelApplication.model.js
server/api/openchannelApplication/openchannelApplication.rpc.js
server/api/openchannelInteraction/index.js
server/api/openchannelInteraction/openchannelInteraction.attributes.js
server/api/openchannelInteraction/openchannelInteraction.controller.js
server/api/openchannelInteraction/openchannelInteraction.events.js
server/api/openchannelInteraction/openchannelInteraction.model.js
server/api/openchannelInteraction/openchannelInteraction.rpc.js
server/api/openchannelInteraction/openchannelInteraction.socket.js
server/api/openchannelMessage/index.js
server/api/openchannelMessage/openchannelMessage.attributes.js
server/api/openchannelMessage/openchannelMessage.controller.js
server/api/openchannelMessage/openchannelMessage.events.js
server/api/openchannelMessage/openchannelMessage.model.js
server/api/openchannelMessage/openchannelMessage.rpc.js
server/api/openchannelMessage/openchannelMessage.socket.js
server/api/openchannelQueue/index.js
server/api/openchannelQueue/openchannelQueue.attributes.js
server/api/openchannelQueue/openchannelQueue.controller.js
server/api/openchannelQueue/openchannelQueue.events.js
server/api/openchannelQueue/openchannelQueue.model.js
server/api/openchannelQueue/openchannelQueue.rpc.js
server/api/openchannelQueue/openchannelQueue.socket.js
server/api/openchannelQueueReport/index.js
server/api/openchannelQueueReport/openchannelQueueReport.attributes.js
server/api/openchannelQueueReport/openchannelQueueReport.controller.js
server/api/openchannelQueueReport/openchannelQueueReport.model.js
server/api/openchannelQueueReport/openchannelQueueReport.rpc.js
server/api/openchannelTransferReport/index.js
server/api/openchannelTransferReport/openchannelTransferReport.attributes.js
server/api/openchannelTransferReport/openchannelTransferReport.controller.js
server/api/openchannelTransferReport/openchannelTransferReport.model.js
server/api/openchannelTransferReport/openchannelTransferReport.rpc.js
server/api/pause/index.js
server/api/pause/pause.attributes.js
server/api/pause/pause.controller.js
server/api/pause/pause.model.js
server/api/pause/pause.rpc.js
server/api/plugin/index.js
server/api/plugin/plugin.attributes.js
server/api/plugin/plugin.controller.js
server/api/plugin/plugin.events.js
server/api/plugin/plugin.model.js
server/api/plugin/plugin.rpc.js
server/api/plugin/plugin.socket.js
server/api/pm2/index.js
server/api/pm2/pm2.controller.js
server/api/realtime/index.js
server/api/realtime/realtime.controller.js
server/api/reportAgentPreview/index.js
server/api/reportAgentPreview/reportAgentPreview.attributes.js
server/api/reportAgentPreview/reportAgentPreview.model.js
server/api/reportAgentPreview/reportAgentPreview.rpc.js
server/api/rpc/index.js
server/api/rpc/rpc.controller.js
server/api/schedule/index.js
server/api/schedule/schedule.attributes.js
server/api/schedule/schedule.controller.js
server/api/schedule/schedule.model.js
server/api/schedule/schedule.rpc.js
server/api/screenRecording/index.js
server/api/screenRecording/screenRecording.attributes.js
server/api/screenRecording/screenRecording.controller.js
server/api/screenRecording/screenRecording.model.js
server/api/screenRecording/screenRecording.rpc.js
server/api/setting/index.js
server/api/setting/setting.attributes.js
server/api/setting/setting.controller.js
server/api/setting/setting.model.js
server/api/setting/setting.rpc.js
server/api/smsAccount/index.js
server/api/smsAccount/smsAccount.attributes.js
server/api/smsAccount/smsAccount.controller.js
server/api/smsAccount/smsAccount.events.js
server/api/smsAccount/smsAccount.model.js
server/api/smsAccount/smsAccount.rpc.js
server/api/smsAccount/smsAccount.socket.js
server/api/smsApplication/index.js
server/api/smsApplication/smsApplication.attributes.js
server/api/smsApplication/smsApplication.controller.js
server/api/smsApplication/smsApplication.model.js
server/api/smsApplication/smsApplication.rpc.js
server/api/smsInteraction/index.js
server/api/smsInteraction/smsInteraction.attributes.js
server/api/smsInteraction/smsInteraction.controller.js
server/api/smsInteraction/smsInteraction.events.js
server/api/smsInteraction/smsInteraction.model.js
server/api/smsInteraction/smsInteraction.rpc.js
server/api/smsInteraction/smsInteraction.socket.js
server/api/smsMessage/index.js
server/api/smsMessage/smsMessage.attributes.js
server/api/smsMessage/smsMessage.controller.js
server/api/smsMessage/smsMessage.events.js
server/api/smsMessage/smsMessage.model.js
server/api/smsMessage/smsMessage.rpc.js
server/api/smsMessage/smsMessage.socket.js
server/api/smsQueue/index.js
server/api/smsQueue/smsQueue.attributes.js
server/api/smsQueue/smsQueue.controller.js
server/api/smsQueue/smsQueue.events.js
server/api/smsQueue/smsQueue.model.js
server/api/smsQueue/smsQueue.rpc.js
server/api/smsQueue/smsQueue.socket.js
server/api/smsQueueReport/index.js
server/api/smsQueueReport/smsQueueReport.attributes.js
server/api/smsQueueReport/smsQueueReport.controller.js
server/api/smsQueueReport/smsQueueReport.model.js
server/api/smsQueueReport/smsQueueReport.rpc.js
server/api/smsTransferReport/index.js
server/api/smsTransferReport/smsTransferReport.attributes.js
server/api/smsTransferReport/smsTransferReport.controller.js
server/api/smsTransferReport/smsTransferReport.model.js
server/api/smsTransferReport/smsTransferReport.rpc.js
server/api/sound/index.js
server/api/sound/sound.attributes.js
server/api/sound/sound.controller.js
server/api/sound/sound.model.js
server/api/sound/sound.rpc.js
server/api/squareMessage/index.js
server/api/squareMessage/squareMessage.attributes.js
server/api/squareMessage/squareMessage.controller.js
server/api/squareMessage/squareMessage.model.js
server/api/squareMessage/squareMessage.rpc.js
server/api/squareOdbc/index.js
server/api/squareOdbc/squareOdbc.attributes.js
server/api/squareOdbc/squareOdbc.controller.js
server/api/squareOdbc/squareOdbc.model.js
server/api/squareOdbc/squareOdbc.rpc.js
server/api/squareProject/index.js
server/api/squareProject/squareProject.attributes.js
server/api/squareProject/squareProject.controller.js
server/api/squareProject/squareProject.events.js
server/api/squareProject/squareProject.model.js
server/api/squareProject/squareProject.rpc.js
server/api/squareProject/squareProject.socket.js
server/api/squareRecording/index.js
server/api/squareRecording/squareRecording.attributes.js
server/api/squareRecording/squareRecording.controller.js
server/api/squareRecording/squareRecording.model.js
server/api/squareRecording/squareRecording.rpc.js
server/api/squareReport/index.js
server/api/squareReport/squareReport.attributes.js
server/api/squareReport/squareReport.controller.js
server/api/squareReport/squareReport.model.js
server/api/squareReport/squareReport.rpc.js
server/api/squareReportDetail/index.js
server/api/squareReportDetail/squareReportDetail.attributes.js
server/api/squareReportDetail/squareReportDetail.controller.js
server/api/squareReportDetail/squareReportDetail.model.js
server/api/squareReportDetail/squareReportDetail.rpc.js
server/api/system/index.js
server/api/system/system.controller.js
server/api/tag/index.js
server/api/tag/tag.attributes.js
server/api/tag/tag.controller.js
server/api/tag/tag.model.js
server/api/tag/tag.rpc.js
server/api/team/index.js
server/api/team/team.attributes.js
server/api/team/team.controller.js
server/api/team/team.events.js
server/api/team/team.model.js
server/api/team/team.rpc.js
server/api/team/team.socket.js
server/api/teamVoicePrefix/teamVoicePrefix.attributes.js
server/api/teamVoicePrefix/teamVoicePrefix.model.js
server/api/teamVoiceQueue/index.js
server/api/teamVoiceQueue/teamVoiceQueue.attributes.js
server/api/teamVoiceQueue/teamVoiceQueue.model.js
server/api/teamVoiceQueue/teamVoiceQueue.rpc.js
server/api/template/index.js
server/api/template/template.attributes.js
server/api/template/template.controller.js
server/api/template/template.model.js
server/api/template/template.rpc.js
server/api/trigger/index.js
server/api/trigger/trigger.attributes.js
server/api/trigger/trigger.controller.js
server/api/trigger/trigger.model.js
server/api/trigger/trigger.rpc.js
server/api/trunk/index.js
server/api/trunk/trunk.attributes.js
server/api/trunk/trunk.controller.js
server/api/trunk/trunk.model.js
server/api/trunk/trunk.rpc.js
server/api/user-setting/index.js
server/api/user-setting/user-setting.attributes.js
server/api/user-setting/user-setting.controller.js
server/api/user-setting/user-setting.events.js
server/api/user-setting/user-setting.model.js
server/api/user-setting/user-setting.socket.js
server/api/user/index.js
server/api/user/user.attributes.js
server/api/user/user.controller.js
server/api/user/user.events.js
server/api/user/user.model.js
server/api/user/user.rpc.js
server/api/user/user.socket.js
server/api/userChatQueue/index.js
server/api/userChatQueue/userChatQueue.attributes.js
server/api/userChatQueue/userChatQueue.model.js
server/api/userChatQueue/userChatQueue.rpc.js
server/api/userFaxQueue/index.js
server/api/userFaxQueue/userFaxQueue.attributes.js
server/api/userFaxQueue/userFaxQueue.model.js
server/api/userFaxQueue/userFaxQueue.rpc.js
server/api/userMailQueue/index.js
server/api/userMailQueue/userMailQueue.attributes.js
server/api/userMailQueue/userMailQueue.model.js
server/api/userMailQueue/userMailQueue.rpc.js
server/api/userNotification/index.js
server/api/userNotification/userNotification.attributes.js
server/api/userNotification/userNotification.controller.js
server/api/userNotification/userNotification.events.js
server/api/userNotification/userNotification.model.js
server/api/userNotification/userNotification.rpc.js
server/api/userNotification/userNotification.socket.js
server/api/userOpenchannelQueue/index.js
server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js
server/api/userOpenchannelQueue/userOpenchannelQueue.model.js
server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js
server/api/userProfile/index.js
server/api/userProfile/userProfile.attributes.js
server/api/userProfile/userProfile.controller.js
server/api/userProfile/userProfile.events.js
server/api/userProfile/userProfile.model.js
server/api/userProfile/userProfile.rpc.js
server/api/userProfile/userProfile.socket.js
server/api/userProfileResource/index.js
server/api/userProfileResource/userProfileResource.attributes.js
server/api/userProfileResource/userProfileResource.controller.js
server/api/userProfileResource/userProfileResource.model.js
server/api/userProfileResource/userProfileResource.rpc.js
server/api/userProfileSection/index.js
server/api/userProfileSection/userProfileSection.attributes.js
server/api/userProfileSection/userProfileSection.controller.js
server/api/userProfileSection/userProfileSection.model.js
server/api/userProfileSection/userProfileSection.rpc.js
server/api/userSmsQueue/index.js
server/api/userSmsQueue/userSmsQueue.attributes.js
server/api/userSmsQueue/userSmsQueue.model.js
server/api/userSmsQueue/userSmsQueue.rpc.js
server/api/userVoicePrefix/userVoicePrefix.attributes.js
server/api/userVoicePrefix/userVoicePrefix.model.js
server/api/userVoiceQueue/index.js
server/api/userVoiceQueue/userVoiceQueue.attributes.js
server/api/userVoiceQueue/userVoiceQueue.model.js
server/api/userVoiceQueue/userVoiceQueue.rpc.js
server/api/userVoiceQueueRt/index.js
server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js
server/api/userVoiceQueueRt/userVoiceQueueRt.events.js
server/api/userVoiceQueueRt/userVoiceQueueRt.model.js
server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js
server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js
server/api/userWhatsappQueue/index.js
server/api/userWhatsappQueue/userWhatsappQueue.attributes.js
server/api/userWhatsappQueue/userWhatsappQueue.model.js
server/api/userWhatsappQueue/userWhatsappQueue.rpc.js
server/api/variable/index.js
server/api/variable/variable.attributes.js
server/api/variable/variable.controller.js
server/api/variable/variable.model.js
server/api/variable/variable.rpc.js
server/api/version/index.js
server/api/version/version.controller.js
server/api/voiceAgentReport/index.js
server/api/voiceAgentReport/voiceAgentReport.attributes.js
server/api/voiceAgentReport/voiceAgentReport.controller.js
server/api/voiceAgentReport/voiceAgentReport.model.js
server/api/voiceAgentReport/voiceAgentReport.rpc.js
server/api/voiceCallReport/index.js
server/api/voiceCallReport/voiceCallReport.attributes.js
server/api/voiceCallReport/voiceCallReport.controller.js
server/api/voiceCallReport/voiceCallReport.model.js
server/api/voiceCallReport/voiceCallReport.rpc.js
server/api/voiceChanSpy/index.js
server/api/voiceChanSpy/voiceChanSpy.attributes.js
server/api/voiceChanSpy/voiceChanSpy.controller.js
server/api/voiceChanSpy/voiceChanSpy.model.js
server/api/voiceChanSpy/voiceChanSpy.rpc.js
server/api/voiceContext/index.js
server/api/voiceContext/voiceContext.attributes.js
server/api/voiceContext/voiceContext.controller.js
server/api/voiceContext/voiceContext.model.js
server/api/voiceContext/voiceContext.rpc.js
server/api/voiceDialReport/index.js
server/api/voiceDialReport/voiceDialReport.attributes.js
server/api/voiceDialReport/voiceDialReport.controller.js
server/api/voiceDialReport/voiceDialReport.model.js
server/api/voiceDialReport/voiceDialReport.rpc.js
server/api/voiceExtension/index.js
server/api/voiceExtension/voiceExtension.attributes.js
server/api/voiceExtension/voiceExtension.controller.js
server/api/voiceExtension/voiceExtension.events.js
server/api/voiceExtension/voiceExtension.model.js
server/api/voiceExtension/voiceExtension.rpc.js
server/api/voiceExtension/voiceExtension.socket.js
server/api/voiceMail/index.js
server/api/voiceMail/voiceMail.attributes.js
server/api/voiceMail/voiceMail.controller.js
server/api/voiceMail/voiceMail.model.js
server/api/voiceMail/voiceMail.rpc.js
server/api/voiceMailMessage/index.js
server/api/voiceMailMessage/voiceMailMessage.attributes.js
server/api/voiceMailMessage/voiceMailMessage.controller.js
server/api/voiceMailMessage/voiceMailMessage.model.js
server/api/voiceMailMessage/voiceMailMessage.rpc.js
server/api/voiceMusicOnHold/index.js
server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js
server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js
server/api/voiceMusicOnHold/voiceMusicOnHold.model.js
server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js
server/api/voicePrefix/index.js
server/api/voicePrefix/voicePrefix.attributes.js
server/api/voicePrefix/voicePrefix.controller.js
server/api/voicePrefix/voicePrefix.events.js
server/api/voicePrefix/voicePrefix.model.js
server/api/voicePrefix/voicePrefix.rpc.js
server/api/voicePrefix/voicePrefix.socket.js
server/api/voiceQueue/index.js
server/api/voiceQueue/voiceQueue.attributes.js
server/api/voiceQueue/voiceQueue.controller.js
server/api/voiceQueue/voiceQueue.events.js
server/api/voiceQueue/voiceQueue.model.js
server/api/voiceQueue/voiceQueue.rpc.js
server/api/voiceQueue/voiceQueue.socket.js
server/api/voiceQueueReport/index.js
server/api/voiceQueueReport/voiceQueueReport.attributes.js
server/api/voiceQueueReport/voiceQueueReport.controller.js
server/api/voiceQueueReport/voiceQueueReport.events.js
server/api/voiceQueueReport/voiceQueueReport.model.js
server/api/voiceQueueReport/voiceQueueReport.rpc.js
server/api/voiceQueueReport/voiceQueueReport.socket.js
server/api/voiceQueuesLog/index.js
server/api/voiceQueuesLog/voiceQueuesLog.attributes.js
server/api/voiceQueuesLog/voiceQueuesLog.controller.js
server/api/voiceQueuesLog/voiceQueuesLog.model.js
server/api/voiceQueuesLog/voiceQueuesLog.rpc.js
server/api/voiceRecording/index.js
server/api/voiceRecording/voiceRecording.attributes.js
server/api/voiceRecording/voiceRecording.controller.js
server/api/voiceRecording/voiceRecording.model.js
server/api/voiceRecording/voiceRecording.rpc.js
server/api/voiceTransferReport/index.js
server/api/voiceTransferReport/voiceTransferReport.attributes.js
server/api/voiceTransferReport/voiceTransferReport.controller.js
server/api/voiceTransferReport/voiceTransferReport.model.js
server/api/voiceTransferReport/voiceTransferReport.rpc.js
server/api/webbar/index.js
server/api/webbar/webbar.controller.js
server/api/whatsappAccount/index.js
server/api/whatsappAccount/whatsappAccount.attributes.js
server/api/whatsappAccount/whatsappAccount.controller.js
server/api/whatsappAccount/whatsappAccount.events.js
server/api/whatsappAccount/whatsappAccount.model.js
server/api/whatsappAccount/whatsappAccount.rpc.js
server/api/whatsappAccount/whatsappAccount.socket.js
server/api/whatsappApplication/index.js
server/api/whatsappApplication/whatsappApplication.attributes.js
server/api/whatsappApplication/whatsappApplication.controller.js
server/api/whatsappApplication/whatsappApplication.model.js
server/api/whatsappApplication/whatsappApplication.rpc.js
server/api/whatsappInteraction/index.js
server/api/whatsappInteraction/whatsappInteraction.attributes.js
server/api/whatsappInteraction/whatsappInteraction.controller.js
server/api/whatsappInteraction/whatsappInteraction.events.js
server/api/whatsappInteraction/whatsappInteraction.model.js
server/api/whatsappInteraction/whatsappInteraction.rpc.js
server/api/whatsappInteraction/whatsappInteraction.socket.js
server/api/whatsappMessage/index.js
server/api/whatsappMessage/whatsappMessage.attributes.js
server/api/whatsappMessage/whatsappMessage.controller.js
server/api/whatsappMessage/whatsappMessage.events.js
server/api/whatsappMessage/whatsappMessage.model.js
server/api/whatsappMessage/whatsappMessage.rpc.js
server/api/whatsappMessage/whatsappMessage.socket.js
server/api/whatsappQueue/index.js
server/api/whatsappQueue/whatsappQueue.attributes.js
server/api/whatsappQueue/whatsappQueue.controller.js
server/api/whatsappQueue/whatsappQueue.events.js
server/api/whatsappQueue/whatsappQueue.model.js
server/api/whatsappQueue/whatsappQueue.rpc.js
server/api/whatsappQueue/whatsappQueue.socket.js
server/api/whatsappQueueReport/index.js
server/api/whatsappQueueReport/whatsappQueueReport.attributes.js
server/api/whatsappQueueReport/whatsappQueueReport.controller.js
server/api/whatsappQueueReport/whatsappQueueReport.model.js
server/api/whatsappQueueReport/whatsappQueueReport.rpc.js
server/api/whatsappTransferReport/index.js
server/api/whatsappTransferReport/whatsappTransferReport.attributes.js
server/api/whatsappTransferReport/whatsappTransferReport.controller.js
server/api/whatsappTransferReport/whatsappTransferReport.model.js
server/api/whatsappTransferReport/whatsappTransferReport.rpc.js
server/app.js
server/components/auth/service.js
server/components/encryptor/index.js
server/components/export/csv.js
server/components/export/pdf.js
server/components/export/xlsx.js
server/components/extensions/rewrite.js
server/components/import/cm/csv.js
server/components/import/cm/csv2.js
server/components/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/cloud-provider.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/tvox.js
server/services/routing/server/applications/utils.js
server/services/routing/server/index.js
server/services/routing/server/interval.js
server/services/xdr/agents.controller.js
server/services/xdr/calls.controller.js
server/services/xdr/core.controller.js
server/services/xdr/dials.controller.js
server/services/xdr/index.js
server/services/xdr/members.controller.js
server/services/xdr/queues.controller.js
server/services/xdr/recordings.controller.js
server/services/xdr/transfers.controller.js
server/services/xdr/utils.js
server/utils/client-side-logger.js
server/utils/loggers.js
server/utils/mask-sensitive-data.js
server/utils/safe-template.js

index a69b2e3..edbaf27 100644 (file)
@@ -17,7 +17,7 @@ define({
   "apidoc": "0.3.0",
   "generator": {
     "name": "apidoc",
-    "time": "2022-02-04T11:23:24.128Z",
+    "time": "2022-02-04T13:58:14.265Z",
     "url": "http://apidocjs.com",
     "version": "0.24.0"
   }
index dd6e8ef..5af4ef6 100644 (file)
@@ -17,7 +17,7 @@
   "apidoc": "0.3.0",
   "generator": {
     "name": "apidoc",
-    "time": "2022-02-04T11:23:24.128Z",
+    "time": "2022-02-04T13:58:14.265Z",
     "url": "http://apidocjs.com",
     "version": "0.24.0"
   }
index 72277b3..0324f05 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x728f=['urlForward[body]','VIRTUAL','getDataValue','action','STRING','contactManager','motionbar','jscripty','urlForward','bot','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT'];(function(_0x5576cc,_0xd2cef5){var _0x40f468=function(_0x56fde6){while(--_0x56fde6){_0x5576cc['push'](_0x5576cc['shift']());}};_0x40f468(++_0xd2cef5);}(_0x728f,0x67));var _0xf728=function(_0x127b52,_0x5ef4e4){_0x127b52=_0x127b52-0x0;var _0x49025b=_0x728f[_0x127b52];return _0x49025b;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xf728('0x0')],'get':function(_0x299348){return this[_0xf728('0x1')](_0xf728('0x2'));}},'action':{'type':Sequelize[_0xf728('0x3')],'allowNull':![],'validate':{'isIn':{'args':[[_0xf728('0x4'),'integration',_0xf728('0x5'),_0xf728('0x6'),_0xf728('0x7'),'browser',_0xf728('0x8'),'script']],'msg':_0xf728('0x9')}},'comment':_0xf728('0x9')},'data1':{'type':Sequelize[_0xf728('0x3')](0x1000),'comment':_0xf728('0xa')},'data2':{'type':Sequelize[_0xf728('0x3')](0x1000),'comment':_0xf728('0xb')},'data3':{'type':Sequelize[_0xf728('0x3')](0x1000),'comment':'contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]'},'data4':{'type':Sequelize[_0xf728('0x3')](0x1000),'comments':_0xf728('0xc')},'data5':{'type':Sequelize['STRING'](0x1000),'comments':_0xf728('0xd')},'data6':{'type':Sequelize[_0xf728('0x3')],'comments':_0xf728('0xe')},'data7':{'type':Sequelize[_0xf728('0xf')],'comments':_0xf728('0x10')}};
\ No newline at end of file
+var _0x7697=['urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','VIRTUAL','STRING','integration','jscripty'];(function(_0x18e2f3,_0xfea2ca){var _0x1ef3cb=function(_0x6bb00d){while(--_0x6bb00d){_0x18e2f3['push'](_0x18e2f3['shift']());}};_0x1ef3cb(++_0xfea2ca);}(_0x7697,0x10c));var _0x7769=function(_0x2d8d69,_0x8e47ff){_0x2d8d69=_0x2d8d69-0x0;var _0x39ae22=_0x7697[_0x2d8d69];return _0x39ae22;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x7769('0x0')],'get':function(_0x5307cc){return this['getDataValue']('action');}},'action':{'type':Sequelize[_0x7769('0x1')],'allowNull':![],'validate':{'isIn':{'args':[['contactManager',_0x7769('0x2'),'motionbar',_0x7769('0x3'),_0x7769('0x4'),_0x7769('0x5'),_0x7769('0x6'),_0x7769('0x7')]],'msg':_0x7769('0x8')}},'comment':_0x7769('0x8')},'data1':{'type':Sequelize[_0x7769('0x1')](0x1000),'comment':_0x7769('0x9')},'data2':{'type':Sequelize[_0x7769('0x1')](0x1000),'comment':_0x7769('0xa')},'data3':{'type':Sequelize[_0x7769('0x1')](0x1000),'comment':'contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]'},'data4':{'type':Sequelize[_0x7769('0x1')](0x1000),'comments':_0x7769('0xb')},'data5':{'type':Sequelize['STRING'](0x1000),'comments':_0x7769('0xc')},'data6':{'type':Sequelize[_0x7769('0x1')],'comments':_0x7769('0xd')},'data7':{'type':Sequelize[_0x7769('0xe')],'comments':_0x7769('0xf')}};
\ No newline at end of file
index f9411f7..49f9a8b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1255=['rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','Content-Range','json','apply','save','update','then','destroy','error','stack','name','send','Action','find','params','body','catch','eml-format'];(function(_0x1c8e95,_0x2cca4a){var _0x4e1e2d=function(_0x2d3901){while(--_0x2d3901){_0x1c8e95['push'](_0x1c8e95['shift']());}};_0x4e1e2d(++_0x2cca4a);}(_0x1255,0x89));var _0x5125=function(_0x233ca7,_0x335e9f){_0x233ca7=_0x233ca7-0x0;var _0x31728b=_0x1255[_0x233ca7];return _0x31728b;};'use strict';var emlformat=require(_0x5125('0x0'));var rimraf=require(_0x5125('0x1'));var zipdir=require(_0x5125('0x2'));var jsonpatch=require(_0x5125('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5125('0x4'));var Mustache=require(_0x5125('0x5'));var util=require(_0x5125('0x6'));var path=require(_0x5125('0x7'));var sox=require(_0x5125('0x8'));var csv=require(_0x5125('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5125('0xa'));var _=require(_0x5125('0xb'));var squel=require(_0x5125('0xc'));var crypto=require(_0x5125('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x5125('0xe'));var toCsv=require(_0x5125('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x5125('0xf'));var authService=require(_0x5125('0x10'));var qs=require(_0x5125('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5125('0x12'));var logger=require(_0x5125('0x13'))(_0x5125('0x14'));var utils=require('../../config/utils');var config=require(_0x5125('0x15'));var licenseUtil=require(_0x5125('0x16'));var db=require(_0x5125('0x17'))['db'];function respondWithStatusCode(_0x27284c,_0x37da6b){_0x37da6b=_0x37da6b||0xcc;return function(_0x130c40){if(_0x130c40){return _0x27284c[_0x5125('0x18')](_0x37da6b);}return _0x27284c[_0x5125('0x19')](_0x37da6b)[_0x5125('0x1a')]();};}function respondWithResult(_0x46a83a,_0x3c5598){_0x3c5598=_0x3c5598||0xc8;return function(_0x3c6bea){if(_0x3c6bea){return _0x46a83a[_0x5125('0x19')](_0x3c5598)['json'](_0x3c6bea);}};}function respondWithFilteredResult(_0x12c836,_0x10f143){return function(_0x403096){if(_0x403096){var _0x40b6e6=typeof _0x10f143[_0x5125('0x1b')]===_0x5125('0x1c')&&typeof _0x10f143['limit']===_0x5125('0x1c');var _0x38816d=_0x403096[_0x5125('0x1d')];var _0x1cb8f7=_0x40b6e6?0x0:_0x10f143[_0x5125('0x1b')];var _0x3fce46=_0x40b6e6?_0x403096['count']:_0x10f143[_0x5125('0x1b')]+_0x10f143['limit'];var _0x5657f8;if(_0x3fce46>=_0x38816d){_0x3fce46=_0x38816d;_0x5657f8=0xc8;}else{_0x5657f8=0xce;}_0x12c836['status'](_0x5657f8);return _0x12c836['set'](_0x5125('0x1e'),_0x1cb8f7+'-'+_0x3fce46+'/'+_0x38816d)[_0x5125('0x1f')](_0x403096);}return null;};}function patchUpdates(_0x4e6183){return function(_0x53c45e){try{jsonpatch[_0x5125('0x20')](_0x53c45e,_0x4e6183,!![]);}catch(_0x46621a){return BPromise['reject'](_0x46621a);}return _0x53c45e[_0x5125('0x21')]();};}function saveUpdates(_0x1beb11,_0x5c9d88){return function(_0x2d028a){if(_0x2d028a){return _0x2d028a[_0x5125('0x22')](_0x1beb11)[_0x5125('0x23')](function(_0x50d2ae){return _0x50d2ae;});}return null;};}function removeEntity(_0x39e84c,_0x4472a5){return function(_0x2911c9){if(_0x2911c9){return _0x2911c9[_0x5125('0x24')]()[_0x5125('0x23')](function(){_0x39e84c[_0x5125('0x19')](0xcc)[_0x5125('0x1a')]();});}};}function handleEntityNotFound(_0x327c1b,_0x5f4a31){return function(_0x5b8276){if(!_0x5b8276){_0x327c1b[_0x5125('0x18')](0x194);}return _0x5b8276;};}function handleError(_0x289369,_0x9c5890){_0x9c5890=_0x9c5890||0x1f4;return function(_0xd69bf7){logger[_0x5125('0x25')](_0xd69bf7[_0x5125('0x26')]);if(_0xd69bf7[_0x5125('0x27')]){delete _0xd69bf7[_0x5125('0x27')];}_0x289369[_0x5125('0x19')](_0x9c5890)[_0x5125('0x28')](_0xd69bf7);};}exports[_0x5125('0x22')]=function(_0x4afb8f,_0x52e8bb){if(_0x4afb8f['body']['id']){delete _0x4afb8f['body']['id'];}return db[_0x5125('0x29')][_0x5125('0x2a')]({'where':{'id':_0x4afb8f[_0x5125('0x2b')]['id']}})[_0x5125('0x23')](handleEntityNotFound(_0x52e8bb,null))['then'](saveUpdates(_0x4afb8f[_0x5125('0x2c')],null))[_0x5125('0x23')](respondWithResult(_0x52e8bb,null))['catch'](handleError(_0x52e8bb,null));};exports['destroy']=function(_0x5e27ad,_0x4f1b91){return db[_0x5125('0x29')][_0x5125('0x2a')]({'where':{'id':_0x5e27ad[_0x5125('0x2b')]['id']}})[_0x5125('0x23')](handleEntityNotFound(_0x4f1b91,null))[_0x5125('0x23')](removeEntity(_0x4f1b91,null))[_0x5125('0x2d')](handleError(_0x4f1b91,null));};
\ No newline at end of file
+var _0xf4be=['../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','error','stack','name','send','body','Action','find','then','destroy','params','catch','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse'];(function(_0x3a0def,_0x142b55){var _0x52f735=function(_0xf3c9e6){while(--_0xf3c9e6){_0x3a0def['push'](_0x3a0def['shift']());}};_0x52f735(++_0x142b55);}(_0xf4be,0x1c4));var _0xef4b=function(_0x30442,_0x4ef11e){_0x30442=_0x30442-0x0;var _0x2c8a82=_0xf4be[_0x30442];return _0x2c8a82;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xef4b('0x0'));var zipdir=require(_0xef4b('0x1'));var jsonpatch=require(_0xef4b('0x2'));var rp=require(_0xef4b('0x3'));var moment=require(_0xef4b('0x4'));var BPromise=require(_0xef4b('0x5'));var Mustache=require(_0xef4b('0x6'));var util=require(_0xef4b('0x7'));var path=require(_0xef4b('0x8'));var sox=require(_0xef4b('0x9'));var csv=require(_0xef4b('0xa'));var ejs=require(_0xef4b('0xb'));var fs=require('fs');var fs_extra=require(_0xef4b('0xc'));var _=require('lodash');var squel=require(_0xef4b('0xd'));var crypto=require(_0xef4b('0xe'));var jsforce=require(_0xef4b('0xf'));var deskjs=require(_0xef4b('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xef4b('0x11'));var Redis=require('ioredis');var authService=require(_0xef4b('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xef4b('0x13'));var logger=require(_0xef4b('0x14'))('api');var utils=require(_0xef4b('0x15'));var config=require(_0xef4b('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xef4b('0x17'))['db'];function respondWithStatusCode(_0x207ff7,_0x17a7a6){_0x17a7a6=_0x17a7a6||0xcc;return function(_0x1a6da9){if(_0x1a6da9){return _0x207ff7['sendStatus'](_0x17a7a6);}return _0x207ff7[_0xef4b('0x18')](_0x17a7a6)[_0xef4b('0x19')]();};}function respondWithResult(_0x7f18,_0xeb6654){_0xeb6654=_0xeb6654||0xc8;return function(_0x1d80ec){if(_0x1d80ec){return _0x7f18['status'](_0xeb6654)[_0xef4b('0x1a')](_0x1d80ec);}};}function respondWithFilteredResult(_0x3557c7,_0x2d42bc){return function(_0x316fd3){if(_0x316fd3){var _0x1197f6=typeof _0x2d42bc[_0xef4b('0x1b')]===_0xef4b('0x1c')&&typeof _0x2d42bc[_0xef4b('0x1d')]===_0xef4b('0x1c');var _0x350984=_0x316fd3[_0xef4b('0x1e')];var _0x4f426e=_0x1197f6?0x0:_0x2d42bc['offset'];var _0x267330=_0x1197f6?_0x316fd3[_0xef4b('0x1e')]:_0x2d42bc['offset']+_0x2d42bc['limit'];var _0x410812;if(_0x267330>=_0x350984){_0x267330=_0x350984;_0x410812=0xc8;}else{_0x410812=0xce;}_0x3557c7[_0xef4b('0x18')](_0x410812);return _0x3557c7[_0xef4b('0x1f')](_0xef4b('0x20'),_0x4f426e+'-'+_0x267330+'/'+_0x350984)['json'](_0x316fd3);}return null;};}function patchUpdates(_0x1e0331){return function(_0x5126ae){try{jsonpatch['apply'](_0x5126ae,_0x1e0331,!![]);}catch(_0x150375){return BPromise[_0xef4b('0x21')](_0x150375);}return _0x5126ae[_0xef4b('0x22')]();};}function saveUpdates(_0x458d5e,_0x18d58d){return function(_0x864257){if(_0x864257){return _0x864257[_0xef4b('0x23')](_0x458d5e)['then'](function(_0x244311){return _0x244311;});}return null;};}function removeEntity(_0x1a2743,_0x101f26){return function(_0x4cb046){if(_0x4cb046){return _0x4cb046['destroy']()['then'](function(){_0x1a2743[_0xef4b('0x18')](0xcc)[_0xef4b('0x19')]();});}};}function handleEntityNotFound(_0x3595e0,_0x3bcb60){return function(_0x3be3cd){if(!_0x3be3cd){_0x3595e0['sendStatus'](0x194);}return _0x3be3cd;};}function handleError(_0x122dc8,_0x1ffd55){_0x1ffd55=_0x1ffd55||0x1f4;return function(_0x103627){logger[_0xef4b('0x24')](_0x103627[_0xef4b('0x25')]);if(_0x103627[_0xef4b('0x26')]){delete _0x103627[_0xef4b('0x26')];}_0x122dc8[_0xef4b('0x18')](_0x1ffd55)[_0xef4b('0x27')](_0x103627);};}exports[_0xef4b('0x23')]=function(_0x2fb4f1,_0x1d81e6){if(_0x2fb4f1[_0xef4b('0x28')]['id']){delete _0x2fb4f1[_0xef4b('0x28')]['id'];}return db[_0xef4b('0x29')][_0xef4b('0x2a')]({'where':{'id':_0x2fb4f1['params']['id']}})[_0xef4b('0x2b')](handleEntityNotFound(_0x1d81e6,null))['then'](saveUpdates(_0x2fb4f1['body'],null))[_0xef4b('0x2b')](respondWithResult(_0x1d81e6,null))['catch'](handleError(_0x1d81e6,null));};exports[_0xef4b('0x2c')]=function(_0x23cadb,_0x2077b7){return db[_0xef4b('0x29')][_0xef4b('0x2a')]({'where':{'id':_0x23cadb[_0xef4b('0x2d')]['id']}})['then'](handleEntityNotFound(_0x2077b7,null))[_0xef4b('0x2b')](removeEntity(_0x2077b7,null))[_0xef4b('0x2e')](handleError(_0x2077b7,null));};
\ No newline at end of file
index 792bfd8..19b690b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x559a=['../../config/environment','./action.attributes','exports','define','Action','tools_actions','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf'];(function(_0x2bc191,_0x3443ec){var _0x1ec55c=function(_0x1b812d){while(--_0x1b812d){_0x2bc191['push'](_0x2bc191['shift']());}};_0x1ec55c(++_0x3443ec);}(_0x559a,0xe3));var _0xa559=function(_0x52a041,_0x1fff86){_0x52a041=_0x52a041-0x0;var _0x31c35e=_0x559a[_0x52a041];return _0x31c35e;};'use strict';var _=require(_0xa559('0x0'));var util=require(_0xa559('0x1'));var logger=require(_0xa559('0x2'))(_0xa559('0x3'));var moment=require('moment');var BPromise=require(_0xa559('0x4'));var rp=require(_0xa559('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa559('0x6'));var config=require(_0xa559('0x7'));var attributes=require(_0xa559('0x8'));module[_0xa559('0x9')]=function(_0x42eae7,_0x1d2953){return _0x42eae7[_0xa559('0xa')](_0xa559('0xb'),attributes,{'tableName':_0xa559('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xdfe9=['moment','bluebird','request-promise','path','../../config/environment','./action.attributes','exports','define','Action','tools_actions','util','../../config/logger'];(function(_0x1d878b,_0x41ebb6){var _0x477347=function(_0x562be3){while(--_0x562be3){_0x1d878b['push'](_0x1d878b['shift']());}};_0x477347(++_0x41ebb6);}(_0xdfe9,0x14e));var _0x9dfe=function(_0x368618,_0x307064){_0x368618=_0x368618-0x0;var _0xf5fbec=_0xdfe9[_0x368618];return _0xf5fbec;};'use strict';var _=require('lodash');var util=require(_0x9dfe('0x0'));var logger=require(_0x9dfe('0x1'))('api');var moment=require(_0x9dfe('0x2'));var BPromise=require(_0x9dfe('0x3'));var rp=require(_0x9dfe('0x4'));var fs=require('fs');var path=require(_0x9dfe('0x5'));var rimraf=require('rimraf');var config=require(_0x9dfe('0x6'));var attributes=require(_0x9dfe('0x7'));module[_0x9dfe('0x8')]=function(_0x899faf,_0x532c31){return _0x899faf[_0x9dfe('0x9')](_0x9dfe('0xa'),attributes,{'tableName':_0x9dfe('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 59159db..ad1aac3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['info','Action,\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(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x7a54,0x106));var _0x47a5=function(_0x539b10,_0x3c2d7b){_0x539b10=_0x539b10-0x0;var _0x360716=_0x7a54[_0x539b10];return _0x360716;};'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')]('Action,\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 _0x326f=['info','Action,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x1b3e7f,_0x2c307f){var _0x257f4b=function(_0x2eba4c){while(--_0x2eba4c){_0x1b3e7f['push'](_0x1b3e7f['shift']());}};_0x257f4b(++_0x2c307f);}(_0x326f,0xd1));var _0xf326=function(_0x28fc58,_0x37bc3a){_0x28fc58=_0x28fc58-0x0;var _0x185ada=_0x326f[_0x28fc58];return _0x185ada;};'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')]('Action,\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')]('Action,\x20%s,\x20%s',_0x3851eb,_0x34128e);_0x515bfa(_0x34128e);});});}
\ No newline at end of file
index 6afb03a..aaa99f5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2a7c=['exports','multer','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./action.controller','put','/:id','isAuthenticated','delete','destroy'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x2a7c,0x105));var _0xc2a7=function(_0x9c12f3,_0x1721ab){_0x9c12f3=_0x9c12f3-0x0;var _0x10f68b=_0x2a7c[_0x9c12f3];return _0x10f68b;};'use strict';var multer=require(_0xc2a7('0x0'));var util=require('util');var path=require(_0xc2a7('0x1'));var timeout=require(_0xc2a7('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xc2a7('0x3'));var auth=require(_0xc2a7('0x4'));var interaction=require(_0xc2a7('0x5'));var config=require('../../config/environment');var controller=require(_0xc2a7('0x6'));router[_0xc2a7('0x7')](_0xc2a7('0x8'),auth[_0xc2a7('0x9')](),controller['update']);router[_0xc2a7('0xa')](_0xc2a7('0x8'),auth[_0xc2a7('0x9')](),controller[_0xc2a7('0xb')]);module[_0xc2a7('0xc')]=router;
\ No newline at end of file
+var _0x762f=['../../config/environment','./action.controller','isAuthenticated','update','delete','/:id','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service'];(function(_0x114da9,_0xd91064){var _0x2d64f0=function(_0x128064){while(--_0x128064){_0x114da9['push'](_0x114da9['shift']());}};_0x2d64f0(++_0xd91064);}(_0x762f,0x161));var _0xf762=function(_0x59b104,_0x3efcd1){_0x59b104=_0x59b104-0x0;var _0x115b85=_0x762f[_0x59b104];return _0x115b85;};'use strict';var multer=require(_0xf762('0x0'));var util=require(_0xf762('0x1'));var path=require(_0xf762('0x2'));var timeout=require('connect-timeout');var express=require(_0xf762('0x3'));var router=express[_0xf762('0x4')]();var fs_extra=require(_0xf762('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xf762('0x6'));var config=require(_0xf762('0x7'));var controller=require(_0xf762('0x8'));router['put']('/:id',auth[_0xf762('0x9')](),controller[_0xf762('0xa')]);router[_0xf762('0xb')](_0xf762('0xc'),auth[_0xf762('0x9')](),controller[_0xf762('0xd')]);module[_0xf762('0xe')]=router;
\ No newline at end of file
index 5ca1128..3c8ce18 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeec6=['STRING','TEXT','sequelize','exports'];(function(_0x27e624,_0x20a70f){var _0x2960a0=function(_0x50be87){while(--_0x50be87){_0x27e624['push'](_0x27e624['shift']());}};_0x2960a0(++_0x20a70f);}(_0xeec6,0x1c2));var _0x6eec=function(_0xd1b4d7,_0x28b2c1){_0xd1b4d7=_0xd1b4d7-0x0;var _0x3002ec=_0xeec6[_0xd1b4d7];return _0x3002ec;};'use strict';var Sequelize=require(_0x6eec('0x0'));module[_0x6eec('0x1')]={'name':{'type':Sequelize[_0x6eec('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x6eec('0x2')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0x6eec('0x2')]},'conditions':{'type':Sequelize[_0x6eec('0x3')]},'joins':{'type':Sequelize[_0x6eec('0x3')]}};
\ No newline at end of file
+var _0xac9d=['TEXT','sequelize','exports','STRING'];(function(_0x1fa274,_0x27a51f){var _0x5601e0=function(_0x146c2c){while(--_0x146c2c){_0x1fa274['push'](_0x1fa274['shift']());}};_0x5601e0(++_0x27a51f);}(_0xac9d,0x14d));var _0xdac9=function(_0x54f7c0,_0x27af83){_0x54f7c0=_0x54f7c0-0x0;var _0x245d03=_0xac9d[_0x54f7c0];return _0x245d03;};'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 e2a5bd2..65e0e49 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe7f8=['show','params','includeAll','create','body','user','get','role','Reports','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','preview','join','left_join','right_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20EMPTY','rules','operator','group','field','condition','value','getFields','ValidationErrorItem','AnalyticMetric','findAll','keyBy','select','from','table','replace','function','format','groupBy','order','orderBy','DESC','alias','joins','parse','includes','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','debug','Limited\x20Query:','toString','sequelize','SELECT','cross_join','MIN(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','IS\x20NOT\x20NULL','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','MetricId','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','run','runReport','IS\x20NULL','IS\x20NOT\x20EMPTY','clone','QueryTypes','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','CustomReports','UserProfileResource','stack','name','send','index','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','sort','pick','filter','where','merge','options','AnalyticCustomReport','include','rows','catch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe7f8,0x1b3));var _0x8e7f=function(_0x354fa5,_0x1c78f4){_0x354fa5=_0x354fa5-0x0;var _0x2da545=_0xe7f8[_0x354fa5];return _0x2da545;};'use strict';var emlformat=require(_0x8e7f('0x0'));var rimraf=require(_0x8e7f('0x1'));var zipdir=require(_0x8e7f('0x2'));var jsonpatch=require(_0x8e7f('0x3'));var rp=require(_0x8e7f('0x4'));var moment=require(_0x8e7f('0x5'));var BPromise=require(_0x8e7f('0x6'));var Mustache=require(_0x8e7f('0x7'));var util=require('util');var path=require(_0x8e7f('0x8'));var sox=require(_0x8e7f('0x9'));var csv=require('to-csv');var ejs=require(_0x8e7f('0xa'));var fs=require('fs');var fs_extra=require(_0x8e7f('0xb'));var _=require(_0x8e7f('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x8e7f('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x8e7f('0xe'));var querystring=require(_0x8e7f('0xf'));var Papa=require('papaparse');var Redis=require(_0x8e7f('0x10'));var authService=require(_0x8e7f('0x11'));var qs=require(_0x8e7f('0x12'));var as=require(_0x8e7f('0x13'));var hardwareService=require(_0x8e7f('0x14'));var logger=require('../../config/logger')(_0x8e7f('0x15'));var utils=require(_0x8e7f('0x16'));var config=require(_0x8e7f('0x17'));var licenseUtil=require(_0x8e7f('0x18'));var db=require('../../mysqldb')['db'];var dbH=require(_0x8e7f('0x19'))[_0x8e7f('0x1a')];function respondWithStatusCode(_0x377fc9,_0x3b6229){_0x3b6229=_0x3b6229||0xcc;return function(_0x46188a){if(_0x46188a){return _0x377fc9[_0x8e7f('0x1b')](_0x3b6229);}return _0x377fc9['status'](_0x3b6229)[_0x8e7f('0x1c')]();};}function respondWithResult(_0x57b6a4,_0x5e6f97){_0x5e6f97=_0x5e6f97||0xc8;return function(_0x1c6b7c){if(_0x1c6b7c){return _0x57b6a4[_0x8e7f('0x1d')](_0x5e6f97)[_0x8e7f('0x1e')](_0x1c6b7c);}};}function respondWithFilteredResult(_0x29c973,_0x24ca19){return function(_0xde89cd){if(_0xde89cd){var _0x1983f6=typeof _0x24ca19[_0x8e7f('0x1f')]===_0x8e7f('0x20')&&typeof _0x24ca19[_0x8e7f('0x21')]===_0x8e7f('0x20');var _0x45c384=_0xde89cd[_0x8e7f('0x22')];var _0x105963=_0x1983f6?0x0:_0x24ca19[_0x8e7f('0x1f')];var _0x470ad4=_0x1983f6?_0xde89cd[_0x8e7f('0x22')]:_0x24ca19['offset']+_0x24ca19[_0x8e7f('0x21')];var _0x51a459;if(_0x470ad4>=_0x45c384){_0x470ad4=_0x45c384;_0x51a459=0xc8;}else{_0x51a459=0xce;}_0x29c973[_0x8e7f('0x1d')](_0x51a459);return _0x29c973[_0x8e7f('0x23')](_0x8e7f('0x24'),_0x105963+'-'+_0x470ad4+'/'+_0x45c384)[_0x8e7f('0x1e')](_0xde89cd);}return null;};}function patchUpdates(_0x3d27a6){return function(_0x1fb732){try{jsonpatch['apply'](_0x1fb732,_0x3d27a6,!![]);}catch(_0x208fb8){return BPromise[_0x8e7f('0x25')](_0x208fb8);}return _0x1fb732['save']();};}function saveUpdates(_0x36dcf6,_0x1b8d06){return function(_0x25ad2d){if(_0x25ad2d){return _0x25ad2d[_0x8e7f('0x26')](_0x36dcf6)[_0x8e7f('0x27')](function(_0x14e322){return _0x14e322;});}return null;};}function removeEntity(_0x22d764,_0x2571fe){return function(_0xb4829f){if(_0xb4829f){return _0xb4829f[_0x8e7f('0x28')]()[_0x8e7f('0x27')](function(){var _0x304fc3=_0xb4829f['get']({'plain':!![]});var _0x4ef107=_0x8e7f('0x29');return db[_0x8e7f('0x2a')]['destroy']({'where':{'type':_0x4ef107,'resourceId':_0x304fc3['id']}})[_0x8e7f('0x27')](function(){return _0xb4829f;});})[_0x8e7f('0x27')](function(){_0x22d764[_0x8e7f('0x1d')](0xcc)[_0x8e7f('0x1c')]();});}};}function handleEntityNotFound(_0x503519,_0xf7ae){return function(_0x3b1b99){if(!_0x3b1b99){_0x503519[_0x8e7f('0x1b')](0x194);}return _0x3b1b99;};}function handleError(_0x5eeef6,_0x57aae7){_0x57aae7=_0x57aae7||0x1f4;return function(_0x3aaa62){logger['error'](_0x3aaa62[_0x8e7f('0x2b')]);if(_0x3aaa62[_0x8e7f('0x2c')]){delete _0x3aaa62[_0x8e7f('0x2c')];}_0x5eeef6[_0x8e7f('0x1d')](_0x57aae7)[_0x8e7f('0x2d')](_0x3aaa62);};}exports[_0x8e7f('0x2e')]=function(_0x193f2b,_0xda752f){var _0x23a610={},_0x24b2a6={},_0x34ff3d={'count':0x0,'rows':[]};var _0x3ebc00=_[_0x8e7f('0x2f')](db['AnalyticCustomReport']['rawAttributes'],function(_0x17b349){return{'name':_0x17b349[_0x8e7f('0x30')],'type':_0x17b349[_0x8e7f('0x31')][_0x8e7f('0x32')]};});_0x24b2a6[_0x8e7f('0x33')]=_[_0x8e7f('0x2f')](_0x3ebc00,_0x8e7f('0x2c'));_0x24b2a6[_0x8e7f('0x34')]=_[_0x8e7f('0x35')](_0x193f2b[_0x8e7f('0x34')]);_0x24b2a6[_0x8e7f('0x36')]=_[_0x8e7f('0x37')](_0x24b2a6[_0x8e7f('0x33')],_0x24b2a6[_0x8e7f('0x34')]);_0x23a610[_0x8e7f('0x38')]=_['intersection'](_0x24b2a6[_0x8e7f('0x33')],qs['fields'](_0x193f2b[_0x8e7f('0x34')][_0x8e7f('0x39')]));_0x23a610[_0x8e7f('0x38')]=_0x23a610['attributes'][_0x8e7f('0x3a')]?_0x23a610[_0x8e7f('0x38')]:_0x24b2a6[_0x8e7f('0x33')];if(!_0x193f2b['query']['hasOwnProperty']('nolimit')){_0x23a610[_0x8e7f('0x21')]=qs[_0x8e7f('0x21')](_0x193f2b['query'][_0x8e7f('0x21')]);_0x23a610['offset']=qs[_0x8e7f('0x1f')](_0x193f2b['query'][_0x8e7f('0x1f')]);}_0x23a610['order']=qs[_0x8e7f('0x3b')](_0x193f2b[_0x8e7f('0x34')]['sort']);_0x23a610['where']=qs[_0x8e7f('0x36')](_[_0x8e7f('0x3c')](_0x193f2b[_0x8e7f('0x34')],_0x24b2a6[_0x8e7f('0x36')]),_0x3ebc00);if(_0x193f2b[_0x8e7f('0x34')][_0x8e7f('0x3d')]){_0x23a610[_0x8e7f('0x3e')]=_[_0x8e7f('0x3f')](_0x23a610[_0x8e7f('0x3e')],{'$or':_[_0x8e7f('0x2f')](_0x3ebc00,function(_0x228c44){if(_0x228c44[_0x8e7f('0x31')]!=='VIRTUAL'){var _0x171cee={};_0x171cee[_0x228c44['name']]={'$like':'%'+_0x193f2b['query'][_0x8e7f('0x3d')]+'%'};return _0x171cee;}})});}_0x23a610=_[_0x8e7f('0x3f')]({},_0x23a610,_0x193f2b[_0x8e7f('0x40')]);var _0x2737e0={'where':_0x23a610[_0x8e7f('0x3e')]};return db[_0x8e7f('0x41')]['count'](_0x2737e0)[_0x8e7f('0x27')](function(_0x320257){_0x34ff3d[_0x8e7f('0x22')]=_0x320257;if(_0x193f2b['query']['includeAll']){_0x23a610[_0x8e7f('0x42')]=[{'all':!![]}];}return db[_0x8e7f('0x41')]['findAll'](_0x23a610);})[_0x8e7f('0x27')](function(_0x221268){_0x34ff3d[_0x8e7f('0x43')]=_0x221268;return _0x34ff3d;})[_0x8e7f('0x27')](respondWithFilteredResult(_0xda752f,_0x23a610))[_0x8e7f('0x44')](handleError(_0xda752f,null));};exports[_0x8e7f('0x45')]=function(_0x14781f,_0x5b651e){var _0x7c8560={'raw':![],'where':{'id':_0x14781f[_0x8e7f('0x46')]['id']}},_0x21f77d={};_0x21f77d[_0x8e7f('0x33')]=_[_0x8e7f('0x35')](db['AnalyticCustomReport']['rawAttributes']);_0x21f77d[_0x8e7f('0x34')]=_[_0x8e7f('0x35')](_0x14781f['query']);_0x21f77d[_0x8e7f('0x36')]=_[_0x8e7f('0x37')](_0x21f77d['model'],_0x21f77d[_0x8e7f('0x34')]);_0x7c8560[_0x8e7f('0x38')]=_[_0x8e7f('0x37')](_0x21f77d[_0x8e7f('0x33')],qs['fields'](_0x14781f[_0x8e7f('0x34')][_0x8e7f('0x39')]));_0x7c8560[_0x8e7f('0x38')]=_0x7c8560[_0x8e7f('0x38')][_0x8e7f('0x3a')]?_0x7c8560['attributes']:_0x21f77d[_0x8e7f('0x33')];if(_0x14781f['query'][_0x8e7f('0x47')]){_0x7c8560[_0x8e7f('0x42')]=[{'all':!![]}];}_0x7c8560=_[_0x8e7f('0x3f')]({},_0x7c8560,_0x14781f[_0x8e7f('0x40')]);return db[_0x8e7f('0x41')]['find'](_0x7c8560)[_0x8e7f('0x27')](handleEntityNotFound(_0x5b651e,null))[_0x8e7f('0x27')](respondWithResult(_0x5b651e,null))[_0x8e7f('0x44')](handleError(_0x5b651e,null));};exports['create']=function(_0x1aeba0,_0x38ba9){return db['AnalyticCustomReport'][_0x8e7f('0x48')](_0x1aeba0[_0x8e7f('0x49')],{})[_0x8e7f('0x27')](function(_0x1e80fa){var _0x5b81c3=_0x1aeba0[_0x8e7f('0x4a')][_0x8e7f('0x4b')]({'plain':!![]});if(!_0x5b81c3)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5b81c3[_0x8e7f('0x4c')]===_0x8e7f('0x4a')){var _0x31b914=_0x1e80fa[_0x8e7f('0x4b')]({'plain':!![]});var _0x57ff11=_0x8e7f('0x4d');return db[_0x8e7f('0x4e')]['find']({'where':{'name':_0x57ff11,'userProfileId':_0x5b81c3['userProfileId']},'raw':!![]})['then'](function(_0x5f234b){if(_0x5f234b&&_0x5f234b[_0x8e7f('0x4f')]===0x0){return db[_0x8e7f('0x2a')][_0x8e7f('0x48')]({'name':_0x31b914[_0x8e7f('0x2c')],'resourceId':_0x31b914['id'],'type':'CustomReports','sectionId':_0x5f234b['id']},{})[_0x8e7f('0x27')](function(){return _0x1e80fa;});}else{return _0x1e80fa;}})[_0x8e7f('0x44')](function(_0x225e13){logger['error'](_0x8e7f('0x50'),_0x225e13);throw _0x225e13;});}return _0x1e80fa;})['then'](respondWithResult(_0x38ba9,0xc9))['catch'](handleError(_0x38ba9,null));};exports['update']=function(_0x180e9d,_0xf28830){if(_0x180e9d['body']['id']){delete _0x180e9d['body']['id'];}return db[_0x8e7f('0x41')]['find']({'where':{'id':_0x180e9d[_0x8e7f('0x46')]['id']}})[_0x8e7f('0x27')](handleEntityNotFound(_0xf28830,null))[_0x8e7f('0x27')](saveUpdates(_0x180e9d[_0x8e7f('0x49')],null))[_0x8e7f('0x27')](respondWithResult(_0xf28830,null))[_0x8e7f('0x44')](handleError(_0xf28830,null));};exports[_0x8e7f('0x28')]=function(_0x3a71ab,_0x240fc8){return db[_0x8e7f('0x41')][_0x8e7f('0x51')]({'where':{'id':_0x3a71ab[_0x8e7f('0x46')]['id']}})[_0x8e7f('0x27')](handleEntityNotFound(_0x240fc8,null))['then'](removeEntity(_0x240fc8,null))[_0x8e7f('0x44')](handleError(_0x240fc8,null));};exports[_0x8e7f('0x52')]=function(_0x1650a3,_0x886fae){var _0x47e35d=0xa;var _0x1d02ae=[_0x8e7f('0x53'),_0x8e7f('0x54'),_0x8e7f('0x55'),'cross_join'];var _0x2d98db={'SUM':_0x8e7f('0x56'),'COUNT':_0x8e7f('0x57'),'COUNT DISTINCT':_0x8e7f('0x58'),'MAX':_0x8e7f('0x59'),'MIN':'MIN(%s)','AVG':_0x8e7f('0x5a'),'GROUP_CONCAT':_0x8e7f('0x5b'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x8e7f('0x5c')};var _0x188cc9={'SEC_TO_TIME':_0x8e7f('0x5d'),'DATE':_0x8e7f('0x5e'),'HOUR':_0x8e7f('0x5f'),'ROUND':_0x8e7f('0x60'),'UNIX_TIMESTAMP':_0x8e7f('0x61')};var _0x1292a6=function(_0x128d30){return!_['includes'](['IS\x20NULL','IS\x20NOT\x20NULL',_0x8e7f('0x62'),'IS\x20NOT\x20EMPTY'],_0x128d30);};var _0x3921dd=function(_0xed2ba6){if(!_0xed2ba6||!_0xed2ba6['rules']['length']){return'';}for(var _0x3b81b0='(',_0x56f18d=0x0;_0x56f18d<_0xed2ba6[_0x8e7f('0x63')][_0x8e7f('0x3a')];_0x56f18d+=0x1){_0x56f18d>0x0&&(_0x3b81b0+='\x20'+_0xed2ba6[_0x8e7f('0x64')]+'\x20');_0x3b81b0+=_0xed2ba6['rules'][_0x56f18d][_0x8e7f('0x65')]?_0x3921dd(_0xed2ba6[_0x8e7f('0x63')][_0x56f18d][_0x8e7f('0x65')]):_0xed2ba6[_0x8e7f('0x63')][_0x56f18d][_0x8e7f('0x66')]+'\x20'+_0xed2ba6[_0x8e7f('0x63')][_0x56f18d][_0x8e7f('0x67')]+(_0x1292a6(_0xed2ba6['rules'][_0x56f18d][_0x8e7f('0x67')])?'\x20'+_0xed2ba6[_0x8e7f('0x63')][_0x56f18d][_0x8e7f('0x68')]:'');}return _0x3b81b0+')';};var _0x407ed0={'where':{'id':_0x1650a3[_0x8e7f('0x46')]['id']}},_0x5321bc,_0x52f0da,_0x2ec222,_0x2e087a,_0x500279;_0x407ed0=_[_0x8e7f('0x3f')]({},_0x407ed0,_0x1650a3['options']);return db[_0x8e7f('0x41')][_0x8e7f('0x51')](_0x407ed0)[_0x8e7f('0x27')](function(_0x28300a){if(_0x28300a){_0x5321bc=_0x28300a;return _0x28300a[_0x8e7f('0x69')]();}return null;})[_0x8e7f('0x27')](function(_0x4a708c){if(_0x4a708c){if(!_0x4a708c[_0x8e7f('0x3a')]){throw new db['Sequelize'][(_0x8e7f('0x6a'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x52f0da=_0x4a708c;return db[_0x8e7f('0x6b')][_0x8e7f('0x6c')]({'raw':!![]});}return null;})[_0x8e7f('0x27')](function(_0x1f761d){if(_0x1f761d){_0x2ec222=_[_0x8e7f('0x6d')](_0x1f761d,'id');var _0x1ce7d9;var _0x5d41d4=squel[_0x8e7f('0x6e')]();_0x5d41d4[_0x8e7f('0x6f')](_0x5321bc[_0x8e7f('0x70')]);for(var _0x420d61=0x0;_0x420d61<_0x52f0da[_0x8e7f('0x3a')];_0x420d61+=0x1){_0x1ce7d9=_0x52f0da[_0x420d61]['MetricId']?_0x2ec222[_0x52f0da[_0x420d61]['MetricId']]['metric']:_0x52f0da[_0x420d61][_0x8e7f('0x66')];_0x1ce7d9=_0x52f0da[_0x420d61]['function']?_[_0x8e7f('0x71')](_0x2d98db[_0x52f0da[_0x420d61][_0x8e7f('0x72')]],'%s',_0x1ce7d9):_0x1ce7d9;_0x1ce7d9=_0x52f0da[_0x420d61][_0x8e7f('0x73')]?_[_0x8e7f('0x71')](_0x188cc9[_0x52f0da[_0x420d61][_0x8e7f('0x73')]],'%s',_0x1ce7d9):_0x1ce7d9;if(_0x52f0da[_0x420d61][_0x8e7f('0x74')]){_0x5d41d4[_0x8e7f('0x65')](_0x1ce7d9);}_0x52f0da[_0x420d61]['orderBy']&&_0x5d41d4[_0x8e7f('0x75')](_0x1ce7d9,_0x52f0da[_0x420d61][_0x8e7f('0x76')]===_0x8e7f('0x77')?![]:!![]);_0x5d41d4[_0x8e7f('0x66')](_0x1ce7d9,_0x52f0da[_0x420d61][_0x8e7f('0x78')]||_0x1ce7d9);}if(_0x5321bc[_0x8e7f('0x79')]){_0x5321bc['joins']=JSON[_0x8e7f('0x7a')](_0x5321bc['joins']);for(var _0xb13094=0x0;_0xb13094<_0x5321bc[_0x8e7f('0x79')]['length'];_0xb13094+=0x1){if(_0x5321bc[_0x8e7f('0x79')][_0xb13094][_0x8e7f('0x31')]&&_[_0x8e7f('0x7b')](_0x1d02ae,_0x5321bc[_0x8e7f('0x79')][_0xb13094]['type'])&&_0x5321bc[_0x8e7f('0x79')][_0xb13094][_0x8e7f('0x7c')]&&_0x5321bc[_0x8e7f('0x79')][_0xb13094][_0x8e7f('0x7d')]&&_0x5321bc['joins'][_0xb13094][_0x8e7f('0x7e')]){_0x5d41d4[_0x5321bc[_0x8e7f('0x79')][_0xb13094][_0x8e7f('0x31')]](_0x5321bc[_0x8e7f('0x79')][_0xb13094][_0x8e7f('0x7d')],null,util[_0x8e7f('0x73')](_0x8e7f('0x7f'),_0x5321bc[_0x8e7f('0x70')],_0x5321bc[_0x8e7f('0x79')][_0xb13094][_0x8e7f('0x7c')],_0x5321bc['joins'][_0xb13094][_0x8e7f('0x7d')],_0x5321bc[_0x8e7f('0x79')][_0xb13094][_0x8e7f('0x7e')]));}}}if(_0x5321bc[_0x8e7f('0x80')]){_0x5321bc[_0x8e7f('0x80')]=JSON[_0x8e7f('0x7a')](_0x5321bc[_0x8e7f('0x80')]);_0x5d41d4[_0x8e7f('0x3e')](_0x3921dd(_0x5321bc[_0x8e7f('0x80')]['group']));}_0x500279=_0x5d41d4['clone']();_0x5d41d4[_0x8e7f('0x21')](_0x47e35d);_0x5d41d4[_0x8e7f('0x1f')](0x0);logger[_0x8e7f('0x81')](_0x8e7f('0x82'),_0x5d41d4[_0x8e7f('0x83')]());return dbH[_0x8e7f('0x84')][_0x8e7f('0x34')](_0x5d41d4['toString'](),{'type':dbH[_0x8e7f('0x84')]['QueryTypes'][_0x8e7f('0x85')]});}})[_0x8e7f('0x27')](respondWithResult(_0x886fae,null))['catch'](handleError(_0x886fae,null));};function runReport(_0x5e78dc,_0xd0b3e4,_0x400f81){var _0x1de3c4=_0xd0b3e4[_0x8e7f('0x2c')];var _0x5c6cb7=0xa;var _0x101b43=[_0x8e7f('0x53'),'left_join',_0x8e7f('0x55'),_0x8e7f('0x86')];var _0x5cc2f5={'SUM':'SUM(%s)','COUNT':_0x8e7f('0x57'),'COUNT DISTINCT':_0x8e7f('0x58'),'MAX':_0x8e7f('0x59'),'MIN':_0x8e7f('0x87'),'AVG':_0x8e7f('0x5a'),'GROUP_CONCAT':_0x8e7f('0x5b'),'GROUP_CONCAT ASC':_0x8e7f('0x88'),'GROUP_CONCAT DESC':_0x8e7f('0x5c')};var _0x5b2b3d={'SEC_TO_TIME':_0x8e7f('0x5d'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0x8e7f('0x60'),'UNIX_TIMESTAMP':_0x8e7f('0x61')};var _0x54fb42=function(_0x5b519b){return!_['includes'](['IS\x20NULL',_0x8e7f('0x89'),_0x8e7f('0x62'),'IS\x20NOT\x20EMPTY'],_0x5b519b);};var _0x4f7388=function(_0x4989cb){if(!_0x4989cb||!_0x4989cb['rules'][_0x8e7f('0x3a')]){return'';}for(var _0x1ccb0d='(',_0x14e7d3=0x0;_0x14e7d3<_0x4989cb['rules'][_0x8e7f('0x3a')];_0x14e7d3+=0x1){_0x14e7d3>0x0&&(_0x1ccb0d+='\x20'+_0x4989cb[_0x8e7f('0x64')]+'\x20');_0x1ccb0d+=_0x4989cb[_0x8e7f('0x63')][_0x14e7d3][_0x8e7f('0x65')]?_0x4f7388(_0x4989cb[_0x8e7f('0x63')][_0x14e7d3][_0x8e7f('0x65')]):_0x4989cb[_0x8e7f('0x63')][_0x14e7d3][_0x8e7f('0x66')]+'\x20'+_0x4989cb[_0x8e7f('0x63')][_0x14e7d3][_0x8e7f('0x67')]+(_0x54fb42(_0x4989cb['rules'][_0x14e7d3][_0x8e7f('0x67')])?'\x20'+_0x4989cb[_0x8e7f('0x63')][_0x14e7d3][_0x8e7f('0x68')]:'');}return _0x1ccb0d+')';};var _0x4cd40e={'where':{'id':_0x5e78dc['id']}},_0x4557e6,_0x172fcf,_0x1a51ee,_0x35621c,_0x3cbaf6;_0x4cd40e=_[_0x8e7f('0x3f')]({},_0x4cd40e,_0x400f81);return db[_0x8e7f('0x41')][_0x8e7f('0x51')](_0x4cd40e)[_0x8e7f('0x27')](function(_0x52162e){if(_0x52162e){_0x4557e6=_0x52162e;return _0x52162e[_0x8e7f('0x69')]();}return null;})[_0x8e7f('0x27')](function(_0xcae4b5){if(_0xcae4b5){if(!_0xcae4b5[_0x8e7f('0x3a')]){throw new db[(_0x8e7f('0x8a'))]['ValidationErrorItem'](_0x8e7f('0x8b'),0x193);}_0x172fcf=_0xcae4b5;return db[_0x8e7f('0x6b')]['findAll']({'raw':!![]});}return null;})[_0x8e7f('0x27')](function(_0x5b873d){if(_0x5b873d){_0x1a51ee=_[_0x8e7f('0x6d')](_0x5b873d,'id');var _0x4fdc1a;var _0x3b2be7=squel[_0x8e7f('0x6e')]();_0x3b2be7[_0x8e7f('0x6f')](_0x4557e6[_0x8e7f('0x70')]);for(var _0x4a130c=0x0;_0x4a130c<_0x172fcf['length'];_0x4a130c+=0x1){_0x4fdc1a=_0x172fcf[_0x4a130c]['MetricId']?_0x1a51ee[_0x172fcf[_0x4a130c][_0x8e7f('0x8c')]]['metric']:_0x172fcf[_0x4a130c][_0x8e7f('0x66')];_0x4fdc1a=_0x172fcf[_0x4a130c][_0x8e7f('0x72')]?_[_0x8e7f('0x71')](_0x5cc2f5[_0x172fcf[_0x4a130c][_0x8e7f('0x72')]],'%s',_0x4fdc1a):_0x4fdc1a;_0x4fdc1a=_0x172fcf[_0x4a130c]['format']?_[_0x8e7f('0x71')](_0x5b2b3d[_0x172fcf[_0x4a130c][_0x8e7f('0x73')]],'%s',_0x4fdc1a):_0x4fdc1a;if(_0x172fcf[_0x4a130c][_0x8e7f('0x74')]){_0x3b2be7[_0x8e7f('0x65')](_0x4fdc1a);}_0x172fcf[_0x4a130c]['orderBy']&&_0x3b2be7['order'](_0x4fdc1a,_0x172fcf[_0x4a130c][_0x8e7f('0x76')]==='DESC'?![]:!![]);_0x3b2be7[_0x8e7f('0x66')](_0x4fdc1a,_0x172fcf[_0x4a130c][_0x8e7f('0x78')]||_0x4fdc1a);}if(_0x4557e6[_0x8e7f('0x79')]){_0x4557e6[_0x8e7f('0x79')]=JSON[_0x8e7f('0x7a')](_0x4557e6['joins']);for(var _0x5098fa=0x0;_0x5098fa<_0x4557e6['joins'][_0x8e7f('0x3a')];_0x5098fa+=0x1){if(_0x4557e6[_0x8e7f('0x79')][_0x5098fa]['type']&&_[_0x8e7f('0x7b')](_0x101b43,_0x4557e6[_0x8e7f('0x79')][_0x5098fa]['type'])&&_0x4557e6[_0x8e7f('0x79')][_0x5098fa][_0x8e7f('0x7c')]&&_0x4557e6[_0x8e7f('0x79')][_0x5098fa][_0x8e7f('0x7d')]&&_0x4557e6[_0x8e7f('0x79')][_0x5098fa][_0x8e7f('0x7e')]){_0x3b2be7[_0x4557e6['joins'][_0x5098fa][_0x8e7f('0x31')]](_0x4557e6[_0x8e7f('0x79')][_0x5098fa][_0x8e7f('0x7d')],null,util['format'](_0x8e7f('0x7f'),_0x4557e6['table'],_0x4557e6[_0x8e7f('0x79')][_0x5098fa][_0x8e7f('0x7c')],_0x4557e6[_0x8e7f('0x79')][_0x5098fa][_0x8e7f('0x7d')],_0x4557e6['joins'][_0x5098fa]['foreignKey']));}}}if(_0x4557e6[_0x8e7f('0x80')]){_0x4557e6['conditions']=JSON[_0x8e7f('0x7a')](_0x4557e6[_0x8e7f('0x80')]);_0x3b2be7[_0x8e7f('0x3e')](_0x4f7388(_0x4557e6['conditions'][_0x8e7f('0x65')]));}_0x3cbaf6=_0x3b2be7['clone']();_0x3b2be7['limit'](_0x5c6cb7);_0x3b2be7[_0x8e7f('0x1f')](0x0);return;}})['then'](function(){if(_0xd0b3e4[_0x8e7f('0x8d')]===_0x8e7f('0x8e')){return null;}var _0x5a9b04=_[_0x8e7f('0x3f')](_0xd0b3e4,{'name':_0xd0b3e4[_0x8e7f('0x8f')]||_0xd0b3e4[_0x8e7f('0x2c')]||_0x4557e6['name'],'basename':_0x1de3c4,'savename':util[_0x8e7f('0x73')](_0x8e7f('0x90'),_0xd0b3e4[_0x8e7f('0x2c')]||_0x4557e6['name'],require(_0x8e7f('0x91'))[_0x8e7f('0x92')](0x4),_0xd0b3e4[_0x8e7f('0x8d')]||_0x8e7f('0x93')),'reportId':_0x4557e6['id'],'reportType':'custom'});return db[_0x8e7f('0x94')]['create'](_0x5a9b04,{'raw':!![]});})[_0x8e7f('0x27')](function(_0x2a3046){if(_0x4557e6[_0x8e7f('0x70')]===_0x8e7f('0x95')){_0x3cbaf6[_0x8e7f('0x3e')](_0x4557e6[_0x8e7f('0x70')]+_0x8e7f('0x96'),_0xd0b3e4[_0x8e7f('0x97')],_0xd0b3e4[_0x8e7f('0x98')]);}else{_0x3cbaf6[_0x8e7f('0x3e')](_0x4557e6['table']+_0x8e7f('0x99'),_0xd0b3e4['startDate'],_0xd0b3e4[_0x8e7f('0x98')]);}if(_0x2a3046){logger['info'](_0x8e7f('0x9a'),_0x3cbaf6[_0x8e7f('0x83')]());require(_0x8e7f('0x9b'))[_0x8e7f('0x9c')](path['join'](__dirname,_0x8e7f('0x9d'),_0x2a3046['output']),[_0x2a3046['id'],_0x3cbaf6[_0x8e7f('0x83')](),path[_0x8e7f('0x53')](__dirname,_0x8e7f('0x9e'),_0x2a3046[_0x8e7f('0x9f')]),_0x1de3c4]);return _0x2a3046;}else{var _0x19a8ab=squel[_0x8e7f('0x6e')]();_0x19a8ab[_0x8e7f('0x6f')]('('+_0x3cbaf6[_0x8e7f('0x83')]()+')',_0x8e7f('0xa0'));_0x19a8ab[_0x8e7f('0x66')](_0x8e7f('0xa1'),_0x8e7f('0x22'));_0x3cbaf6[_0x8e7f('0x21')](_0xd0b3e4[_0x8e7f('0x21')]||_0x5c6cb7);_0x3cbaf6[_0x8e7f('0x1f')](_0xd0b3e4[_0x8e7f('0x1f')]||0x0);return dbH['sequelize'][_0x8e7f('0x34')](_0x19a8ab[_0x8e7f('0x83')](),{'type':dbH[_0x8e7f('0x84')]['QueryTypes'][_0x8e7f('0x85')]})[_0x8e7f('0x27')](function(_0x193312){if(!_0x193312[_0x8e7f('0x3a')]){_0x35621c=0x0;}else{_0x35621c=_0x193312[0x0][_0x8e7f('0x22')]||0x0;}return dbH[_0x8e7f('0x84')][_0x8e7f('0x34')](_0x3cbaf6[_0x8e7f('0x83')](),{'type':dbH[_0x8e7f('0x84')]['QueryTypes'][_0x8e7f('0x85')]});})[_0x8e7f('0x27')](function(_0x2ae5c3){return{'rows':_0x2ae5c3||[],'count':_0x35621c};});}});}exports[_0x8e7f('0xa2')]=function(_0x35d0c0,_0xdec254){return runReport(_0x35d0c0[_0x8e7f('0x46')],_0x35d0c0[_0x8e7f('0x34')],_0x35d0c0[_0x8e7f('0x40')])['then'](respondWithResult(_0xdec254,null))[_0x8e7f('0x44')](handleError(_0xdec254,null));};exports[_0x8e7f('0xa3')]=runReport;exports[_0x8e7f('0x34')]=function(_0x569586,_0x153a4f){var _0x4a9397=0xa;var _0x503d9f=['join',_0x8e7f('0x54'),'right_join','cross_join'];var _0x2bcbdd={'SUM':_0x8e7f('0x56'),'COUNT':_0x8e7f('0x57'),'COUNT DISTINCT':_0x8e7f('0x58'),'MAX':'MAX(%s)','MIN':_0x8e7f('0x87'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x8e7f('0x5b'),'GROUP_CONCAT ASC':_0x8e7f('0x88'),'GROUP_CONCAT DESC':_0x8e7f('0x5c')};var _0x416ad5={'SEC_TO_TIME':_0x8e7f('0x5d'),'DATE':'DATE(%s)','HOUR':_0x8e7f('0x5f'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x3b3380=function(_0x5d0503){return!_[_0x8e7f('0x7b')]([_0x8e7f('0xa4'),_0x8e7f('0x89'),_0x8e7f('0x62'),_0x8e7f('0xa5')],_0x5d0503);};var _0x498378=function(_0x2726c8){if(!_0x2726c8||!_0x2726c8[_0x8e7f('0x63')][_0x8e7f('0x3a')]){return'';}for(var _0xae084c='(',_0x564a08=0x0;_0x564a08<_0x2726c8['rules'][_0x8e7f('0x3a')];_0x564a08+=0x1){_0x564a08>0x0&&(_0xae084c+='\x20'+_0x2726c8[_0x8e7f('0x64')]+'\x20');_0xae084c+=_0x2726c8[_0x8e7f('0x63')][_0x564a08][_0x8e7f('0x65')]?_0x498378(_0x2726c8[_0x8e7f('0x63')][_0x564a08][_0x8e7f('0x65')]):_0x2726c8[_0x8e7f('0x63')][_0x564a08][_0x8e7f('0x66')]+'\x20'+_0x2726c8[_0x8e7f('0x63')][_0x564a08][_0x8e7f('0x67')]+(_0x3b3380(_0x2726c8[_0x8e7f('0x63')][_0x564a08][_0x8e7f('0x67')])?'\x20'+_0x2726c8[_0x8e7f('0x63')][_0x564a08][_0x8e7f('0x68')]:'');}return _0xae084c+')';};var _0x59c57d={'where':{'id':_0x569586['params']['id']}},_0x54c400,_0x109832,_0x2ad5ba,_0x4ca6d4,_0x517f71;_0x59c57d=_[_0x8e7f('0x3f')]({},_0x59c57d,_0x569586[_0x8e7f('0x40')]);return db[_0x8e7f('0x41')][_0x8e7f('0x51')](_0x59c57d)[_0x8e7f('0x27')](function(_0x2025c5){if(_0x2025c5){_0x54c400=_0x2025c5;return _0x2025c5[_0x8e7f('0x69')]();}return null;})[_0x8e7f('0x27')](function(_0x2d9053){if(_0x2d9053){if(!_0x2d9053[_0x8e7f('0x3a')]){throw new db[(_0x8e7f('0x8a'))][(_0x8e7f('0x6a'))](_0x8e7f('0x8b'),0x193);}_0x109832=_0x2d9053;return db[_0x8e7f('0x6b')][_0x8e7f('0x6c')]({'raw':!![]});}return null;})[_0x8e7f('0x27')](function(_0x2164b0){if(_0x2164b0){_0x2ad5ba=_[_0x8e7f('0x6d')](_0x2164b0,'id');var _0x3d31d6;var _0x52450c=squel[_0x8e7f('0x6e')]();_0x52450c['from'](_0x54c400[_0x8e7f('0x70')]);for(var _0x31e7fa=0x0;_0x31e7fa<_0x109832[_0x8e7f('0x3a')];_0x31e7fa+=0x1){_0x3d31d6=_0x109832[_0x31e7fa][_0x8e7f('0x8c')]?_0x2ad5ba[_0x109832[_0x31e7fa][_0x8e7f('0x8c')]]['metric']:_0x109832[_0x31e7fa]['field'];_0x3d31d6=_0x109832[_0x31e7fa][_0x8e7f('0x72')]?_[_0x8e7f('0x71')](_0x2bcbdd[_0x109832[_0x31e7fa][_0x8e7f('0x72')]],'%s',_0x3d31d6):_0x3d31d6;_0x3d31d6=_0x109832[_0x31e7fa]['format']?_['replace'](_0x416ad5[_0x109832[_0x31e7fa][_0x8e7f('0x73')]],'%s',_0x3d31d6):_0x3d31d6;if(_0x109832[_0x31e7fa]['groupBy']){_0x52450c[_0x8e7f('0x65')](_0x3d31d6);}_0x109832[_0x31e7fa][_0x8e7f('0x76')]&&_0x52450c['order'](_0x3d31d6,_0x109832[_0x31e7fa]['orderBy']===_0x8e7f('0x77')?![]:!![]);_0x52450c[_0x8e7f('0x66')](_0x3d31d6,_0x109832[_0x31e7fa][_0x8e7f('0x78')]||_0x3d31d6);}if(_0x54c400[_0x8e7f('0x79')]){_0x54c400[_0x8e7f('0x79')]=JSON['parse'](_0x54c400[_0x8e7f('0x79')]);for(var _0x2f8003=0x0;_0x2f8003<_0x54c400['joins'][_0x8e7f('0x3a')];_0x2f8003+=0x1){if(_0x54c400[_0x8e7f('0x79')][_0x2f8003][_0x8e7f('0x31')]&&_['includes'](_0x503d9f,_0x54c400[_0x8e7f('0x79')][_0x2f8003][_0x8e7f('0x31')])&&_0x54c400[_0x8e7f('0x79')][_0x2f8003][_0x8e7f('0x7c')]&&_0x54c400['joins'][_0x2f8003]['foreignTable']&&_0x54c400[_0x8e7f('0x79')][_0x2f8003][_0x8e7f('0x7e')]){_0x52450c[_0x54c400[_0x8e7f('0x79')][_0x2f8003][_0x8e7f('0x31')]](_0x54c400[_0x8e7f('0x79')][_0x2f8003][_0x8e7f('0x7d')],null,util[_0x8e7f('0x73')](_0x8e7f('0x7f'),_0x54c400['table'],_0x54c400[_0x8e7f('0x79')][_0x2f8003]['parentKey'],_0x54c400[_0x8e7f('0x79')][_0x2f8003][_0x8e7f('0x7d')],_0x54c400[_0x8e7f('0x79')][_0x2f8003][_0x8e7f('0x7e')]));}}}if(_0x54c400[_0x8e7f('0x80')]){_0x54c400[_0x8e7f('0x80')]=JSON['parse'](_0x54c400[_0x8e7f('0x80')]);_0x52450c['where'](_0x498378(_0x54c400[_0x8e7f('0x80')][_0x8e7f('0x65')]));}_0x517f71=_0x52450c[_0x8e7f('0xa6')]();_0x52450c['limit'](_0x4a9397);_0x52450c['offset'](0x0);logger['debug']('Limited\x20Query:',_0x52450c[_0x8e7f('0x83')]());return dbH[_0x8e7f('0x84')][_0x8e7f('0x34')](_0x52450c[_0x8e7f('0x83')](),{'type':dbH[_0x8e7f('0x84')][_0x8e7f('0xa7')][_0x8e7f('0x85')]});}})[_0x8e7f('0x27')](function(){return{'sql':_0x517f71[_0x8e7f('0x83')]()};})[_0x8e7f('0x27')](respondWithResult(_0x153a4f,null))['catch'](handleError(_0x153a4f,null));};
\ No newline at end of file
+var _0xadf4=['replace','format','orderBy','DESC','alias','joins','parse','type','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','table','conditions','debug','Limited\x20Query:','toString','SELECT','COUNT(%s)','MAX(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20NULL','value','getFields','keyBy','groupBy','foreignKey','clone','output','web','fullPath','%s-%s.%s','randomstring','csv','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','fork','savename','countTable','COUNT(*)','sequelize','QueryTypes','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','dbH','sendStatus','end','json','undefined','limit','count','offset','status','set','Content-Range','apply','reject','save','update','then','destroy','get','CustomReports','error','stack','name','send','rawAttributes','fieldName','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','map','filter','AnalyticCustomReport','includeAll','include','findAll','rows','show','params','keys','options','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','select','from','MetricId','metric','function'];(function(_0x201fc4,_0x50d5f3){var _0x5a3a8e=function(_0x34e2c0){while(--_0x34e2c0){_0x201fc4['push'](_0x201fc4['shift']());}};_0x5a3a8e(++_0x50d5f3);}(_0xadf4,0xd4));var _0x4adf=function(_0x503ffd,_0x8ecde){_0x503ffd=_0x503ffd-0x0;var _0x160437=_0xadf4[_0x503ffd];return _0x160437;};'use strict';var emlformat=require(_0x4adf('0x0'));var rimraf=require(_0x4adf('0x1'));var zipdir=require(_0x4adf('0x2'));var jsonpatch=require(_0x4adf('0x3'));var rp=require(_0x4adf('0x4'));var moment=require('moment');var BPromise=require(_0x4adf('0x5'));var Mustache=require(_0x4adf('0x6'));var util=require(_0x4adf('0x7'));var path=require(_0x4adf('0x8'));var sox=require(_0x4adf('0x9'));var csv=require(_0x4adf('0xa'));var ejs=require(_0x4adf('0xb'));var fs=require('fs');var fs_extra=require(_0x4adf('0xc'));var _=require('lodash');var squel=require(_0x4adf('0xd'));var crypto=require(_0x4adf('0xe'));var jsforce=require(_0x4adf('0xf'));var deskjs=require(_0x4adf('0x10'));var toCsv=require(_0x4adf('0xa'));var querystring=require(_0x4adf('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x4adf('0x12'));var qs=require(_0x4adf('0x13'));var as=require(_0x4adf('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4adf('0x15'))(_0x4adf('0x16'));var utils=require(_0x4adf('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x4adf('0x18'));var db=require(_0x4adf('0x19'))['db'];var dbH=require('../../mysqldb')[_0x4adf('0x1a')];function respondWithStatusCode(_0x2cb20c,_0x17d051){_0x17d051=_0x17d051||0xcc;return function(_0x216f58){if(_0x216f58){return _0x2cb20c[_0x4adf('0x1b')](_0x17d051);}return _0x2cb20c['status'](_0x17d051)[_0x4adf('0x1c')]();};}function respondWithResult(_0x38ae51,_0x4104e1){_0x4104e1=_0x4104e1||0xc8;return function(_0x45b7b4){if(_0x45b7b4){return _0x38ae51['status'](_0x4104e1)[_0x4adf('0x1d')](_0x45b7b4);}};}function respondWithFilteredResult(_0x45b161,_0x397e2e){return function(_0x1c0885){if(_0x1c0885){var _0x7ad56b=typeof _0x397e2e['offset']===_0x4adf('0x1e')&&typeof _0x397e2e[_0x4adf('0x1f')]===_0x4adf('0x1e');var _0x560179=_0x1c0885[_0x4adf('0x20')];var _0x400feb=_0x7ad56b?0x0:_0x397e2e['offset'];var _0x4e6241=_0x7ad56b?_0x1c0885[_0x4adf('0x20')]:_0x397e2e[_0x4adf('0x21')]+_0x397e2e['limit'];var _0x5b186b;if(_0x4e6241>=_0x560179){_0x4e6241=_0x560179;_0x5b186b=0xc8;}else{_0x5b186b=0xce;}_0x45b161[_0x4adf('0x22')](_0x5b186b);return _0x45b161[_0x4adf('0x23')](_0x4adf('0x24'),_0x400feb+'-'+_0x4e6241+'/'+_0x560179)[_0x4adf('0x1d')](_0x1c0885);}return null;};}function patchUpdates(_0x3bfc3d){return function(_0x4b2f73){try{jsonpatch[_0x4adf('0x25')](_0x4b2f73,_0x3bfc3d,!![]);}catch(_0x30bcc1){return BPromise[_0x4adf('0x26')](_0x30bcc1);}return _0x4b2f73[_0x4adf('0x27')]();};}function saveUpdates(_0x455bb1,_0x2b9fa0){return function(_0xcb2a77){if(_0xcb2a77){return _0xcb2a77[_0x4adf('0x28')](_0x455bb1)[_0x4adf('0x29')](function(_0x5be2c6){return _0x5be2c6;});}return null;};}function removeEntity(_0x3081ca,_0x1ba54a){return function(_0xe23096){if(_0xe23096){return _0xe23096[_0x4adf('0x2a')]()[_0x4adf('0x29')](function(){var _0x282705=_0xe23096[_0x4adf('0x2b')]({'plain':!![]});var _0x5d09a1=_0x4adf('0x2c');return db['UserProfileResource'][_0x4adf('0x2a')]({'where':{'type':_0x5d09a1,'resourceId':_0x282705['id']}})[_0x4adf('0x29')](function(){return _0xe23096;});})[_0x4adf('0x29')](function(){_0x3081ca[_0x4adf('0x22')](0xcc)[_0x4adf('0x1c')]();});}};}function handleEntityNotFound(_0x1e6b83,_0x1772f1){return function(_0x1579b2){if(!_0x1579b2){_0x1e6b83[_0x4adf('0x1b')](0x194);}return _0x1579b2;};}function handleError(_0x3dacb3,_0x1acfb9){_0x1acfb9=_0x1acfb9||0x1f4;return function(_0xde3030){logger[_0x4adf('0x2d')](_0xde3030[_0x4adf('0x2e')]);if(_0xde3030[_0x4adf('0x2f')]){delete _0xde3030['name'];}_0x3dacb3[_0x4adf('0x22')](_0x1acfb9)[_0x4adf('0x30')](_0xde3030);};}exports['index']=function(_0x5222c1,_0x1f6353){var _0x238ae8={},_0x91228f={},_0x5b2420={'count':0x0,'rows':[]};var _0x420ddc=_['map'](db['AnalyticCustomReport'][_0x4adf('0x31')],function(_0x5dd93d){return{'name':_0x5dd93d[_0x4adf('0x32')],'type':_0x5dd93d['type'][_0x4adf('0x33')]};});_0x91228f['model']=_['map'](_0x420ddc,_0x4adf('0x2f'));_0x91228f[_0x4adf('0x34')]=_['keys'](_0x5222c1[_0x4adf('0x34')]);_0x91228f[_0x4adf('0x35')]=_[_0x4adf('0x36')](_0x91228f[_0x4adf('0x37')],_0x91228f[_0x4adf('0x34')]);_0x238ae8[_0x4adf('0x38')]=_['intersection'](_0x91228f[_0x4adf('0x37')],qs[_0x4adf('0x39')](_0x5222c1[_0x4adf('0x34')][_0x4adf('0x39')]));_0x238ae8[_0x4adf('0x38')]=_0x238ae8[_0x4adf('0x38')][_0x4adf('0x3a')]?_0x238ae8[_0x4adf('0x38')]:_0x91228f[_0x4adf('0x37')];if(!_0x5222c1['query'][_0x4adf('0x3b')]('nolimit')){_0x238ae8['limit']=qs[_0x4adf('0x1f')](_0x5222c1['query'][_0x4adf('0x1f')]);_0x238ae8[_0x4adf('0x21')]=qs['offset'](_0x5222c1[_0x4adf('0x34')][_0x4adf('0x21')]);}_0x238ae8[_0x4adf('0x3c')]=qs[_0x4adf('0x3d')](_0x5222c1[_0x4adf('0x34')][_0x4adf('0x3d')]);_0x238ae8[_0x4adf('0x3e')]=qs[_0x4adf('0x35')](_[_0x4adf('0x3f')](_0x5222c1[_0x4adf('0x34')],_0x91228f[_0x4adf('0x35')]),_0x420ddc);if(_0x5222c1['query']['filter']){_0x238ae8[_0x4adf('0x3e')]=_[_0x4adf('0x40')](_0x238ae8[_0x4adf('0x3e')],{'$or':_[_0x4adf('0x41')](_0x420ddc,function(_0x35ec37){if(_0x35ec37['type']!=='VIRTUAL'){var _0xc3f0ec={};_0xc3f0ec[_0x35ec37['name']]={'$like':'%'+_0x5222c1[_0x4adf('0x34')][_0x4adf('0x42')]+'%'};return _0xc3f0ec;}})});}_0x238ae8=_[_0x4adf('0x40')]({},_0x238ae8,_0x5222c1['options']);var _0x290ed7={'where':_0x238ae8['where']};return db[_0x4adf('0x43')][_0x4adf('0x20')](_0x290ed7)[_0x4adf('0x29')](function(_0x31c31d){_0x5b2420['count']=_0x31c31d;if(_0x5222c1[_0x4adf('0x34')][_0x4adf('0x44')]){_0x238ae8[_0x4adf('0x45')]=[{'all':!![]}];}return db[_0x4adf('0x43')][_0x4adf('0x46')](_0x238ae8);})[_0x4adf('0x29')](function(_0x324844){_0x5b2420[_0x4adf('0x47')]=_0x324844;return _0x5b2420;})[_0x4adf('0x29')](respondWithFilteredResult(_0x1f6353,_0x238ae8))['catch'](handleError(_0x1f6353,null));};exports[_0x4adf('0x48')]=function(_0x3d59ab,_0x45756a){var _0x1af777={'raw':![],'where':{'id':_0x3d59ab[_0x4adf('0x49')]['id']}},_0x1293c7={};_0x1293c7[_0x4adf('0x37')]=_[_0x4adf('0x4a')](db[_0x4adf('0x43')][_0x4adf('0x31')]);_0x1293c7[_0x4adf('0x34')]=_[_0x4adf('0x4a')](_0x3d59ab[_0x4adf('0x34')]);_0x1293c7['filters']=_[_0x4adf('0x36')](_0x1293c7[_0x4adf('0x37')],_0x1293c7['query']);_0x1af777['attributes']=_[_0x4adf('0x36')](_0x1293c7[_0x4adf('0x37')],qs[_0x4adf('0x39')](_0x3d59ab[_0x4adf('0x34')][_0x4adf('0x39')]));_0x1af777[_0x4adf('0x38')]=_0x1af777[_0x4adf('0x38')][_0x4adf('0x3a')]?_0x1af777[_0x4adf('0x38')]:_0x1293c7[_0x4adf('0x37')];if(_0x3d59ab[_0x4adf('0x34')][_0x4adf('0x44')]){_0x1af777[_0x4adf('0x45')]=[{'all':!![]}];}_0x1af777=_[_0x4adf('0x40')]({},_0x1af777,_0x3d59ab[_0x4adf('0x4b')]);return db[_0x4adf('0x43')]['find'](_0x1af777)['then'](handleEntityNotFound(_0x45756a,null))[_0x4adf('0x29')](respondWithResult(_0x45756a,null))[_0x4adf('0x4c')](handleError(_0x45756a,null));};exports[_0x4adf('0x4d')]=function(_0x44c898,_0xd1cbfc){return db['AnalyticCustomReport'][_0x4adf('0x4d')](_0x44c898[_0x4adf('0x4e')],{})[_0x4adf('0x29')](function(_0x2fe1a7){var _0x47afc9=_0x44c898[_0x4adf('0x4f')][_0x4adf('0x2b')]({'plain':!![]});if(!_0x47afc9)throw new Error(_0x4adf('0x50'));if(_0x47afc9[_0x4adf('0x51')]===_0x4adf('0x4f')){var _0x11152e=_0x2fe1a7[_0x4adf('0x2b')]({'plain':!![]});var _0x156ccd='Reports';return db[_0x4adf('0x52')][_0x4adf('0x53')]({'where':{'name':_0x156ccd,'userProfileId':_0x47afc9[_0x4adf('0x54')]},'raw':!![]})[_0x4adf('0x29')](function(_0x3ed8d8){if(_0x3ed8d8&&_0x3ed8d8[_0x4adf('0x55')]===0x0){return db['UserProfileResource'][_0x4adf('0x4d')]({'name':_0x11152e[_0x4adf('0x2f')],'resourceId':_0x11152e['id'],'type':_0x4adf('0x2c'),'sectionId':_0x3ed8d8['id']},{})[_0x4adf('0x29')](function(){return _0x2fe1a7;});}else{return _0x2fe1a7;}})[_0x4adf('0x4c')](function(_0x8ea99a){logger[_0x4adf('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x8ea99a);throw _0x8ea99a;});}return _0x2fe1a7;})['then'](respondWithResult(_0xd1cbfc,0xc9))[_0x4adf('0x4c')](handleError(_0xd1cbfc,null));};exports[_0x4adf('0x28')]=function(_0x4f88fd,_0x2dc67e){if(_0x4f88fd[_0x4adf('0x4e')]['id']){delete _0x4f88fd[_0x4adf('0x4e')]['id'];}return db['AnalyticCustomReport'][_0x4adf('0x53')]({'where':{'id':_0x4f88fd[_0x4adf('0x49')]['id']}})[_0x4adf('0x29')](handleEntityNotFound(_0x2dc67e,null))[_0x4adf('0x29')](saveUpdates(_0x4f88fd[_0x4adf('0x4e')],null))[_0x4adf('0x29')](respondWithResult(_0x2dc67e,null))[_0x4adf('0x4c')](handleError(_0x2dc67e,null));};exports['destroy']=function(_0xd75aa3,_0x483be5){return db[_0x4adf('0x43')][_0x4adf('0x53')]({'where':{'id':_0xd75aa3[_0x4adf('0x49')]['id']}})[_0x4adf('0x29')](handleEntityNotFound(_0x483be5,null))[_0x4adf('0x29')](removeEntity(_0x483be5,null))[_0x4adf('0x4c')](handleError(_0x483be5,null));};exports[_0x4adf('0x56')]=function(_0xee28fd,_0x2f3150){var _0x26224c=0xa;var _0x2931a9=[_0x4adf('0x57'),_0x4adf('0x58'),_0x4adf('0x59'),_0x4adf('0x5a')];var _0x5b1846={'SUM':_0x4adf('0x5b'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x4adf('0x5c'),'MAX':'MAX(%s)','MIN':_0x4adf('0x5d'),'AVG':_0x4adf('0x5e'),'GROUP_CONCAT':_0x4adf('0x5f'),'GROUP_CONCAT ASC':_0x4adf('0x60'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x32f5d7={'SEC_TO_TIME':_0x4adf('0x61'),'DATE':_0x4adf('0x62'),'HOUR':_0x4adf('0x63'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x545fc2=function(_0x3699bb){return!_[_0x4adf('0x64')]([_0x4adf('0x65'),'IS\x20NOT\x20NULL',_0x4adf('0x66'),_0x4adf('0x67')],_0x3699bb);};var _0x4bd318=function(_0x2b33ac){if(!_0x2b33ac||!_0x2b33ac[_0x4adf('0x68')][_0x4adf('0x3a')]){return'';}for(var _0x174eab='(',_0x24a497=0x0;_0x24a497<_0x2b33ac[_0x4adf('0x68')][_0x4adf('0x3a')];_0x24a497+=0x1){_0x24a497>0x0&&(_0x174eab+='\x20'+_0x2b33ac[_0x4adf('0x69')]+'\x20');_0x174eab+=_0x2b33ac['rules'][_0x24a497]['group']?_0x4bd318(_0x2b33ac[_0x4adf('0x68')][_0x24a497][_0x4adf('0x6a')]):_0x2b33ac[_0x4adf('0x68')][_0x24a497][_0x4adf('0x6b')]+'\x20'+_0x2b33ac['rules'][_0x24a497][_0x4adf('0x6c')]+(_0x545fc2(_0x2b33ac[_0x4adf('0x68')][_0x24a497][_0x4adf('0x6c')])?'\x20'+_0x2b33ac['rules'][_0x24a497]['value']:'');}return _0x174eab+')';};var _0x4d1903={'where':{'id':_0xee28fd[_0x4adf('0x49')]['id']}},_0x472f58,_0x3ec440,_0x4ee0af,_0x1c2892,_0x34f6e6;_0x4d1903=_[_0x4adf('0x40')]({},_0x4d1903,_0xee28fd['options']);return db[_0x4adf('0x43')]['find'](_0x4d1903)[_0x4adf('0x29')](function(_0x2805cf){if(_0x2805cf){_0x472f58=_0x2805cf;return _0x2805cf['getFields']();}return null;})[_0x4adf('0x29')](function(_0x4f561a){if(_0x4f561a){if(!_0x4f561a[_0x4adf('0x3a')]){throw new db[(_0x4adf('0x6d'))][(_0x4adf('0x6e'))](_0x4adf('0x6f'),0x193);}_0x3ec440=_0x4f561a;return db[_0x4adf('0x70')][_0x4adf('0x46')]({'raw':!![]});}return null;})['then'](function(_0x26b91e){if(_0x26b91e){_0x4ee0af=_['keyBy'](_0x26b91e,'id');var _0x261fd9;var _0x41221b=squel[_0x4adf('0x71')]();_0x41221b[_0x4adf('0x72')](_0x472f58['table']);for(var _0x5b23dd=0x0;_0x5b23dd<_0x3ec440['length'];_0x5b23dd+=0x1){_0x261fd9=_0x3ec440[_0x5b23dd][_0x4adf('0x73')]?_0x4ee0af[_0x3ec440[_0x5b23dd][_0x4adf('0x73')]][_0x4adf('0x74')]:_0x3ec440[_0x5b23dd][_0x4adf('0x6b')];_0x261fd9=_0x3ec440[_0x5b23dd][_0x4adf('0x75')]?_[_0x4adf('0x76')](_0x5b1846[_0x3ec440[_0x5b23dd]['function']],'%s',_0x261fd9):_0x261fd9;_0x261fd9=_0x3ec440[_0x5b23dd][_0x4adf('0x77')]?_[_0x4adf('0x76')](_0x32f5d7[_0x3ec440[_0x5b23dd][_0x4adf('0x77')]],'%s',_0x261fd9):_0x261fd9;if(_0x3ec440[_0x5b23dd]['groupBy']){_0x41221b[_0x4adf('0x6a')](_0x261fd9);}_0x3ec440[_0x5b23dd][_0x4adf('0x78')]&&_0x41221b[_0x4adf('0x3c')](_0x261fd9,_0x3ec440[_0x5b23dd][_0x4adf('0x78')]===_0x4adf('0x79')?![]:!![]);_0x41221b['field'](_0x261fd9,_0x3ec440[_0x5b23dd][_0x4adf('0x7a')]||_0x261fd9);}if(_0x472f58[_0x4adf('0x7b')]){_0x472f58[_0x4adf('0x7b')]=JSON[_0x4adf('0x7c')](_0x472f58[_0x4adf('0x7b')]);for(var _0x4be794=0x0;_0x4be794<_0x472f58[_0x4adf('0x7b')][_0x4adf('0x3a')];_0x4be794+=0x1){if(_0x472f58[_0x4adf('0x7b')][_0x4be794][_0x4adf('0x7d')]&&_['includes'](_0x2931a9,_0x472f58[_0x4adf('0x7b')][_0x4be794][_0x4adf('0x7d')])&&_0x472f58[_0x4adf('0x7b')][_0x4be794][_0x4adf('0x7e')]&&_0x472f58['joins'][_0x4be794][_0x4adf('0x7f')]&&_0x472f58['joins'][_0x4be794]['foreignKey']){_0x41221b[_0x472f58[_0x4adf('0x7b')][_0x4be794]['type']](_0x472f58[_0x4adf('0x7b')][_0x4be794]['foreignTable'],null,util[_0x4adf('0x77')](_0x4adf('0x80'),_0x472f58[_0x4adf('0x81')],_0x472f58['joins'][_0x4be794][_0x4adf('0x7e')],_0x472f58[_0x4adf('0x7b')][_0x4be794][_0x4adf('0x7f')],_0x472f58[_0x4adf('0x7b')][_0x4be794]['foreignKey']));}}}if(_0x472f58[_0x4adf('0x82')]){_0x472f58[_0x4adf('0x82')]=JSON[_0x4adf('0x7c')](_0x472f58[_0x4adf('0x82')]);_0x41221b['where'](_0x4bd318(_0x472f58['conditions'][_0x4adf('0x6a')]));}_0x34f6e6=_0x41221b['clone']();_0x41221b['limit'](_0x26224c);_0x41221b[_0x4adf('0x21')](0x0);logger[_0x4adf('0x83')](_0x4adf('0x84'),_0x41221b['toString']());return dbH['sequelize']['query'](_0x41221b[_0x4adf('0x85')](),{'type':dbH['sequelize']['QueryTypes'][_0x4adf('0x86')]});}})[_0x4adf('0x29')](respondWithResult(_0x2f3150,null))[_0x4adf('0x4c')](handleError(_0x2f3150,null));};function runReport(_0x408363,_0x574f6c,_0x3a82b7){var _0xc59a20=_0x574f6c[_0x4adf('0x2f')];var _0x41b3e4=0xa;var _0x4e620b=[_0x4adf('0x57'),'left_join',_0x4adf('0x59'),_0x4adf('0x5a')];var _0x4b4b79={'SUM':_0x4adf('0x5b'),'COUNT':_0x4adf('0x87'),'COUNT DISTINCT':_0x4adf('0x5c'),'MAX':_0x4adf('0x88'),'MIN':'MIN(%s)','AVG':_0x4adf('0x5e'),'GROUP_CONCAT':_0x4adf('0x5f'),'GROUP_CONCAT ASC':_0x4adf('0x60'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x16b916={'SEC_TO_TIME':_0x4adf('0x61'),'DATE':_0x4adf('0x62'),'HOUR':_0x4adf('0x63'),'ROUND':_0x4adf('0x89'),'UNIX_TIMESTAMP':_0x4adf('0x8a')};var _0x5b6be0=function(_0x575be8){return!_['includes']([_0x4adf('0x65'),_0x4adf('0x8b'),_0x4adf('0x66'),'IS\x20NOT\x20EMPTY'],_0x575be8);};var _0x5efc93=function(_0xdc823b){if(!_0xdc823b||!_0xdc823b[_0x4adf('0x68')]['length']){return'';}for(var _0x5567de='(',_0x1759e2=0x0;_0x1759e2<_0xdc823b[_0x4adf('0x68')][_0x4adf('0x3a')];_0x1759e2+=0x1){_0x1759e2>0x0&&(_0x5567de+='\x20'+_0xdc823b[_0x4adf('0x69')]+'\x20');_0x5567de+=_0xdc823b[_0x4adf('0x68')][_0x1759e2][_0x4adf('0x6a')]?_0x5efc93(_0xdc823b[_0x4adf('0x68')][_0x1759e2][_0x4adf('0x6a')]):_0xdc823b[_0x4adf('0x68')][_0x1759e2][_0x4adf('0x6b')]+'\x20'+_0xdc823b[_0x4adf('0x68')][_0x1759e2]['condition']+(_0x5b6be0(_0xdc823b[_0x4adf('0x68')][_0x1759e2][_0x4adf('0x6c')])?'\x20'+_0xdc823b[_0x4adf('0x68')][_0x1759e2][_0x4adf('0x8c')]:'');}return _0x5567de+')';};var _0x2c0ba3={'where':{'id':_0x408363['id']}},_0xa61d4,_0x4b51a6,_0x10a504,_0x386c16,_0x55f01c;_0x2c0ba3=_[_0x4adf('0x40')]({},_0x2c0ba3,_0x3a82b7);return db['AnalyticCustomReport'][_0x4adf('0x53')](_0x2c0ba3)[_0x4adf('0x29')](function(_0x55c2de){if(_0x55c2de){_0xa61d4=_0x55c2de;return _0x55c2de[_0x4adf('0x8d')]();}return null;})['then'](function(_0x251e5f){if(_0x251e5f){if(!_0x251e5f[_0x4adf('0x3a')]){throw new db[(_0x4adf('0x6d'))][(_0x4adf('0x6e'))](_0x4adf('0x6f'),0x193);}_0x4b51a6=_0x251e5f;return db[_0x4adf('0x70')][_0x4adf('0x46')]({'raw':!![]});}return null;})[_0x4adf('0x29')](function(_0x44aad3){if(_0x44aad3){_0x10a504=_[_0x4adf('0x8e')](_0x44aad3,'id');var _0x48206d;var _0x3a690f=squel['select']();_0x3a690f[_0x4adf('0x72')](_0xa61d4[_0x4adf('0x81')]);for(var _0x3c5811=0x0;_0x3c5811<_0x4b51a6[_0x4adf('0x3a')];_0x3c5811+=0x1){_0x48206d=_0x4b51a6[_0x3c5811][_0x4adf('0x73')]?_0x10a504[_0x4b51a6[_0x3c5811][_0x4adf('0x73')]]['metric']:_0x4b51a6[_0x3c5811]['field'];_0x48206d=_0x4b51a6[_0x3c5811][_0x4adf('0x75')]?_[_0x4adf('0x76')](_0x4b4b79[_0x4b51a6[_0x3c5811][_0x4adf('0x75')]],'%s',_0x48206d):_0x48206d;_0x48206d=_0x4b51a6[_0x3c5811][_0x4adf('0x77')]?_[_0x4adf('0x76')](_0x16b916[_0x4b51a6[_0x3c5811][_0x4adf('0x77')]],'%s',_0x48206d):_0x48206d;if(_0x4b51a6[_0x3c5811][_0x4adf('0x8f')]){_0x3a690f[_0x4adf('0x6a')](_0x48206d);}_0x4b51a6[_0x3c5811][_0x4adf('0x78')]&&_0x3a690f[_0x4adf('0x3c')](_0x48206d,_0x4b51a6[_0x3c5811][_0x4adf('0x78')]===_0x4adf('0x79')?![]:!![]);_0x3a690f[_0x4adf('0x6b')](_0x48206d,_0x4b51a6[_0x3c5811]['alias']||_0x48206d);}if(_0xa61d4[_0x4adf('0x7b')]){_0xa61d4[_0x4adf('0x7b')]=JSON[_0x4adf('0x7c')](_0xa61d4['joins']);for(var _0x41375a=0x0;_0x41375a<_0xa61d4['joins']['length'];_0x41375a+=0x1){if(_0xa61d4[_0x4adf('0x7b')][_0x41375a][_0x4adf('0x7d')]&&_[_0x4adf('0x64')](_0x4e620b,_0xa61d4[_0x4adf('0x7b')][_0x41375a][_0x4adf('0x7d')])&&_0xa61d4['joins'][_0x41375a][_0x4adf('0x7e')]&&_0xa61d4[_0x4adf('0x7b')][_0x41375a]['foreignTable']&&_0xa61d4[_0x4adf('0x7b')][_0x41375a][_0x4adf('0x90')]){_0x3a690f[_0xa61d4['joins'][_0x41375a]['type']](_0xa61d4[_0x4adf('0x7b')][_0x41375a][_0x4adf('0x7f')],null,util[_0x4adf('0x77')](_0x4adf('0x80'),_0xa61d4[_0x4adf('0x81')],_0xa61d4['joins'][_0x41375a][_0x4adf('0x7e')],_0xa61d4[_0x4adf('0x7b')][_0x41375a][_0x4adf('0x7f')],_0xa61d4['joins'][_0x41375a]['foreignKey']));}}}if(_0xa61d4['conditions']){_0xa61d4[_0x4adf('0x82')]=JSON[_0x4adf('0x7c')](_0xa61d4['conditions']);_0x3a690f[_0x4adf('0x3e')](_0x5efc93(_0xa61d4[_0x4adf('0x82')][_0x4adf('0x6a')]));}_0x55f01c=_0x3a690f[_0x4adf('0x91')]();_0x3a690f[_0x4adf('0x1f')](_0x41b3e4);_0x3a690f[_0x4adf('0x21')](0x0);return;}})[_0x4adf('0x29')](function(){if(_0x574f6c[_0x4adf('0x92')]===_0x4adf('0x93')){return null;}var _0x43fbad=_[_0x4adf('0x40')](_0x574f6c,{'name':_0x574f6c[_0x4adf('0x94')]||_0x574f6c[_0x4adf('0x2f')]||_0xa61d4[_0x4adf('0x2f')],'basename':_0xc59a20,'savename':util[_0x4adf('0x77')](_0x4adf('0x95'),_0x574f6c[_0x4adf('0x2f')]||_0xa61d4[_0x4adf('0x2f')],require(_0x4adf('0x96'))['generate'](0x4),_0x574f6c[_0x4adf('0x92')]||_0x4adf('0x97')),'reportId':_0xa61d4['id'],'reportType':'custom'});return db[_0x4adf('0x98')][_0x4adf('0x4d')](_0x43fbad,{'raw':!![]});})[_0x4adf('0x29')](function(_0x228298){if(_0xa61d4[_0x4adf('0x81')]===_0x4adf('0x99')){_0x55f01c[_0x4adf('0x3e')](_0xa61d4[_0x4adf('0x81')]+_0x4adf('0x9a'),_0x574f6c[_0x4adf('0x9b')],_0x574f6c['endDate']);}else{_0x55f01c[_0x4adf('0x3e')](_0xa61d4[_0x4adf('0x81')]+_0x4adf('0x9c'),_0x574f6c[_0x4adf('0x9b')],_0x574f6c['endDate']);}if(_0x228298){logger[_0x4adf('0x9d')](_0x4adf('0x9e'),_0x55f01c[_0x4adf('0x85')]());require('child_process')[_0x4adf('0x9f')](path[_0x4adf('0x57')](__dirname,'../../components/export/',_0x228298[_0x4adf('0x92')]),[_0x228298['id'],_0x55f01c[_0x4adf('0x85')](),path[_0x4adf('0x57')](__dirname,'../../files/reports',_0x228298[_0x4adf('0xa0')]),_0xc59a20]);return _0x228298;}else{var _0x22dcac=squel[_0x4adf('0x71')]();_0x22dcac['from']('('+_0x55f01c[_0x4adf('0x85')]()+')',_0x4adf('0xa1'));_0x22dcac[_0x4adf('0x6b')](_0x4adf('0xa2'),_0x4adf('0x20'));_0x55f01c[_0x4adf('0x1f')](_0x574f6c[_0x4adf('0x1f')]||_0x41b3e4);_0x55f01c['offset'](_0x574f6c['offset']||0x0);return dbH[_0x4adf('0xa3')]['query'](_0x22dcac[_0x4adf('0x85')](),{'type':dbH[_0x4adf('0xa3')][_0x4adf('0xa4')][_0x4adf('0x86')]})['then'](function(_0x2d2edc){if(!_0x2d2edc['length']){_0x386c16=0x0;}else{_0x386c16=_0x2d2edc[0x0][_0x4adf('0x20')]||0x0;}return dbH[_0x4adf('0xa3')]['query'](_0x55f01c[_0x4adf('0x85')](),{'type':dbH[_0x4adf('0xa3')][_0x4adf('0xa4')][_0x4adf('0x86')]});})[_0x4adf('0x29')](function(_0x5bb9fd){return{'rows':_0x5bb9fd||[],'count':_0x386c16};});}});}exports['run']=function(_0x142b21,_0x25f7af){return runReport(_0x142b21[_0x4adf('0x49')],_0x142b21[_0x4adf('0x34')],_0x142b21[_0x4adf('0x4b')])[_0x4adf('0x29')](respondWithResult(_0x25f7af,null))[_0x4adf('0x4c')](handleError(_0x25f7af,null));};exports['runReport']=runReport;exports[_0x4adf('0x34')]=function(_0x1df2bd,_0x3f0a8f){var _0x1e8a45=0xa;var _0x453ddc=[_0x4adf('0x57'),_0x4adf('0x58'),_0x4adf('0x59'),_0x4adf('0x5a')];var _0x32d61d={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x4adf('0x5c'),'MAX':'MAX(%s)','MIN':_0x4adf('0x5d'),'AVG':_0x4adf('0x5e'),'GROUP_CONCAT':_0x4adf('0x5f'),'GROUP_CONCAT ASC':_0x4adf('0x60'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x2b21f1={'SEC_TO_TIME':_0x4adf('0x61'),'DATE':_0x4adf('0x62'),'HOUR':'HOUR(%s)','ROUND':_0x4adf('0x89'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x2dfc0d=function(_0x1988fb){return!_[_0x4adf('0x64')]([_0x4adf('0x65'),'IS\x20NOT\x20NULL',_0x4adf('0x66'),_0x4adf('0x67')],_0x1988fb);};var _0x5ee4c1=function(_0x2cdf3e){if(!_0x2cdf3e||!_0x2cdf3e['rules'][_0x4adf('0x3a')]){return'';}for(var _0x448307='(',_0x3dc371=0x0;_0x3dc371<_0x2cdf3e[_0x4adf('0x68')]['length'];_0x3dc371+=0x1){_0x3dc371>0x0&&(_0x448307+='\x20'+_0x2cdf3e[_0x4adf('0x69')]+'\x20');_0x448307+=_0x2cdf3e[_0x4adf('0x68')][_0x3dc371][_0x4adf('0x6a')]?_0x5ee4c1(_0x2cdf3e[_0x4adf('0x68')][_0x3dc371][_0x4adf('0x6a')]):_0x2cdf3e[_0x4adf('0x68')][_0x3dc371][_0x4adf('0x6b')]+'\x20'+_0x2cdf3e[_0x4adf('0x68')][_0x3dc371][_0x4adf('0x6c')]+(_0x2dfc0d(_0x2cdf3e[_0x4adf('0x68')][_0x3dc371][_0x4adf('0x6c')])?'\x20'+_0x2cdf3e['rules'][_0x3dc371]['value']:'');}return _0x448307+')';};var _0x137c16={'where':{'id':_0x1df2bd['params']['id']}},_0x38180e,_0x325716,_0x4b7d30,_0x277393,_0x5adb2b;_0x137c16=_[_0x4adf('0x40')]({},_0x137c16,_0x1df2bd['options']);return db[_0x4adf('0x43')][_0x4adf('0x53')](_0x137c16)[_0x4adf('0x29')](function(_0x683e3){if(_0x683e3){_0x38180e=_0x683e3;return _0x683e3[_0x4adf('0x8d')]();}return null;})['then'](function(_0x4f981b){if(_0x4f981b){if(!_0x4f981b['length']){throw new db[(_0x4adf('0x6d'))][(_0x4adf('0x6e'))](_0x4adf('0x6f'),0x193);}_0x325716=_0x4f981b;return db['AnalyticMetric'][_0x4adf('0x46')]({'raw':!![]});}return null;})[_0x4adf('0x29')](function(_0x3857fa){if(_0x3857fa){_0x4b7d30=_[_0x4adf('0x8e')](_0x3857fa,'id');var _0x52d7c8;var _0x3dc731=squel[_0x4adf('0x71')]();_0x3dc731[_0x4adf('0x72')](_0x38180e[_0x4adf('0x81')]);for(var _0x57f3a5=0x0;_0x57f3a5<_0x325716[_0x4adf('0x3a')];_0x57f3a5+=0x1){_0x52d7c8=_0x325716[_0x57f3a5][_0x4adf('0x73')]?_0x4b7d30[_0x325716[_0x57f3a5]['MetricId']][_0x4adf('0x74')]:_0x325716[_0x57f3a5][_0x4adf('0x6b')];_0x52d7c8=_0x325716[_0x57f3a5][_0x4adf('0x75')]?_[_0x4adf('0x76')](_0x32d61d[_0x325716[_0x57f3a5][_0x4adf('0x75')]],'%s',_0x52d7c8):_0x52d7c8;_0x52d7c8=_0x325716[_0x57f3a5][_0x4adf('0x77')]?_[_0x4adf('0x76')](_0x2b21f1[_0x325716[_0x57f3a5]['format']],'%s',_0x52d7c8):_0x52d7c8;if(_0x325716[_0x57f3a5][_0x4adf('0x8f')]){_0x3dc731['group'](_0x52d7c8);}_0x325716[_0x57f3a5][_0x4adf('0x78')]&&_0x3dc731[_0x4adf('0x3c')](_0x52d7c8,_0x325716[_0x57f3a5][_0x4adf('0x78')]===_0x4adf('0x79')?![]:!![]);_0x3dc731[_0x4adf('0x6b')](_0x52d7c8,_0x325716[_0x57f3a5]['alias']||_0x52d7c8);}if(_0x38180e[_0x4adf('0x7b')]){_0x38180e['joins']=JSON[_0x4adf('0x7c')](_0x38180e['joins']);for(var _0x1ead2f=0x0;_0x1ead2f<_0x38180e['joins'][_0x4adf('0x3a')];_0x1ead2f+=0x1){if(_0x38180e[_0x4adf('0x7b')][_0x1ead2f][_0x4adf('0x7d')]&&_['includes'](_0x453ddc,_0x38180e[_0x4adf('0x7b')][_0x1ead2f][_0x4adf('0x7d')])&&_0x38180e[_0x4adf('0x7b')][_0x1ead2f][_0x4adf('0x7e')]&&_0x38180e[_0x4adf('0x7b')][_0x1ead2f]['foreignTable']&&_0x38180e['joins'][_0x1ead2f]['foreignKey']){_0x3dc731[_0x38180e[_0x4adf('0x7b')][_0x1ead2f]['type']](_0x38180e[_0x4adf('0x7b')][_0x1ead2f][_0x4adf('0x7f')],null,util[_0x4adf('0x77')](_0x4adf('0x80'),_0x38180e[_0x4adf('0x81')],_0x38180e['joins'][_0x1ead2f][_0x4adf('0x7e')],_0x38180e[_0x4adf('0x7b')][_0x1ead2f]['foreignTable'],_0x38180e[_0x4adf('0x7b')][_0x1ead2f]['foreignKey']));}}}if(_0x38180e[_0x4adf('0x82')]){_0x38180e[_0x4adf('0x82')]=JSON['parse'](_0x38180e[_0x4adf('0x82')]);_0x3dc731['where'](_0x5ee4c1(_0x38180e[_0x4adf('0x82')][_0x4adf('0x6a')]));}_0x5adb2b=_0x3dc731[_0x4adf('0x91')]();_0x3dc731[_0x4adf('0x1f')](_0x1e8a45);_0x3dc731[_0x4adf('0x21')](0x0);logger[_0x4adf('0x83')](_0x4adf('0x84'),_0x3dc731[_0x4adf('0x85')]());return dbH[_0x4adf('0xa3')]['query'](_0x3dc731[_0x4adf('0x85')](),{'type':dbH[_0x4adf('0xa3')]['QueryTypes'][_0x4adf('0x86')]});}})[_0x4adf('0x29')](function(){return{'sql':_0x5adb2b[_0x4adf('0x85')]()};})[_0x4adf('0x29')](respondWithResult(_0x3f0a8f,null))['catch'](handleError(_0x3f0a8f,null));};
\ No newline at end of file
index 730de48..330adf9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4563=['path','rimraf','./analyticCustomReport.attributes','define','lodash','util','api','moment','bluebird','request-promise'];(function(_0xadd56c,_0xe92a4c){var _0x3e9d9e=function(_0x4a8efe){while(--_0x4a8efe){_0xadd56c['push'](_0xadd56c['shift']());}};_0x3e9d9e(++_0xe92a4c);}(_0x4563,0x194));var _0x3456=function(_0x5c6129,_0x51a4dc){_0x5c6129=_0x5c6129-0x0;var _0x496f35=_0x4563[_0x5c6129];return _0x496f35;};'use strict';var _=require(_0x3456('0x0'));var util=require(_0x3456('0x1'));var logger=require('../../config/logger')(_0x3456('0x2'));var moment=require(_0x3456('0x3'));var BPromise=require(_0x3456('0x4'));var rp=require(_0x3456('0x5'));var fs=require('fs');var path=require(_0x3456('0x6'));var rimraf=require(_0x3456('0x7'));var config=require('../../config/environment');var attributes=require(_0x3456('0x8'));module['exports']=function(_0x20c657,_0x467ab2){return _0x20c657[_0x3456('0x9')]('AnalyticCustomReport',attributes,{'tableName':'analytics_custom_reports','paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xedd2=['analytics_custom_reports','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','define'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xedd2,0x1c3));var _0x2edd=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0xedd2[_0x8c43de];return _0xa6591b;};'use strict';var _=require(_0x2edd('0x0'));var util=require(_0x2edd('0x1'));var logger=require(_0x2edd('0x2'))(_0x2edd('0x3'));var moment=require('moment');var BPromise=require(_0x2edd('0x4'));var rp=require(_0x2edd('0x5'));var fs=require('fs');var path=require(_0x2edd('0x6'));var rimraf=require('rimraf');var config=require(_0x2edd('0x7'));var attributes=require('./analyticCustomReport.attributes');module['exports']=function(_0x26ed37,_0x558b0f){return _0x26ed37[_0x2edd('0x8')]('AnalyticCustomReport',attributes,{'tableName':_0x2edd('0x9'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 54d5298..10b79a7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x295b=['ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','error','message','result','lodash','util','moment','bluebird'];(function(_0x42c47d,_0x339ceb){var _0xc5ac8d=function(_0x5a19d4){while(--_0x5a19d4){_0x42c47d['push'](_0x42c47d['shift']());}};_0xc5ac8d(++_0x339ceb);}(_0x295b,0xa7));var _0xb295=function(_0x2aea9e,_0x1f587f){_0x2aea9e=_0x2aea9e-0x0;var _0x430b92=_0x295b[_0x2aea9e];return _0x430b92;};'use strict';var _=require(_0xb295('0x0'));var util=require(_0xb295('0x1'));var moment=require(_0xb295('0x2'));var BPromise=require(_0xb295('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb295('0x4'));var db=require(_0xb295('0x5'))['db'];var utils=require(_0xb295('0x6'));var logger=require('../../config/logger')(_0xb295('0x7'));var config=require('../../config/environment');var jayson=require(_0xb295('0x8'));var client=jayson[_0xb295('0x9')][_0xb295('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1eb083,_0x5e5204,_0x37426b){return new BPromise(function(_0xf5b224,_0x406aa1){return client[_0xb295('0xb')](_0x1eb083,_0x37426b)[_0xb295('0xc')](function(_0x538ec4){logger[_0xb295('0xd')](_0xb295('0xe'),_0x5e5204,_0xb295('0xf'));logger['debug']('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x5e5204,_0xb295('0xf'),JSON['stringify'](_0x538ec4));if(_0x538ec4['error']){if(_0x538ec4['error']['code']===0x1f4){logger['error'](_0xb295('0xe'),_0x5e5204,_0x538ec4[_0xb295('0x10')][_0xb295('0x11')]);return _0x406aa1(_0x538ec4[_0xb295('0x10')][_0xb295('0x11')]);}logger[_0xb295('0x10')]('AnalyticCustomReport,\x20%s,\x20%s',_0x5e5204,_0x538ec4[_0xb295('0x10')][_0xb295('0x11')]);return _0xf5b224(_0x538ec4['error'][_0xb295('0x11')]);}else{logger['info'](_0xb295('0xe'),_0x5e5204,_0xb295('0xf'));_0xf5b224(_0x538ec4[_0xb295('0x12')]['message']);}})['catch'](function(_0x230980){logger[_0xb295('0x10')]('AnalyticCustomReport,\x20%s,\x20%s',_0x5e5204,_0x230980);_0x406aa1(_0x230980);});});}
\ No newline at end of file
+var _0x9d4e=['error','code','message','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s'];(function(_0x5b2167,_0x250a30){var _0x58c756=function(_0x1ddc4f){while(--_0x1ddc4f){_0x5b2167['push'](_0x5b2167['shift']());}};_0x58c756(++_0x250a30);}(_0x9d4e,0x16c));var _0xe9d4=function(_0xafcda6,_0x2817b9){_0xafcda6=_0xafcda6-0x0;var _0x2f00c5=_0x9d4e[_0xafcda6];return _0x2f00c5;};'use strict';var _=require(_0xe9d4('0x0'));var util=require('util');var moment=require(_0xe9d4('0x1'));var BPromise=require('bluebird');var rs=require(_0xe9d4('0x2'));var fs=require('fs');var Redis=require(_0xe9d4('0x3'));var db=require(_0xe9d4('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xe9d4('0x5'))(_0xe9d4('0x6'));var config=require('../../config/environment');var jayson=require(_0xe9d4('0x7'));var client=jayson['client'][_0xe9d4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1b235c,_0x397343,_0x51202f){return new BPromise(function(_0x42bdc4,_0x20fa6b){return client[_0xe9d4('0x9')](_0x1b235c,_0x51202f)[_0xe9d4('0xa')](function(_0x1c2493){logger[_0xe9d4('0xb')](_0xe9d4('0xc'),_0x397343,_0xe9d4('0xd'));logger[_0xe9d4('0xe')](_0xe9d4('0xf'),_0x397343,_0xe9d4('0xd'),JSON['stringify'](_0x1c2493));if(_0x1c2493['error']){if(_0x1c2493[_0xe9d4('0x10')][_0xe9d4('0x11')]===0x1f4){logger[_0xe9d4('0x10')]('AnalyticCustomReport,\x20%s,\x20%s',_0x397343,_0x1c2493[_0xe9d4('0x10')]['message']);return _0x20fa6b(_0x1c2493[_0xe9d4('0x10')][_0xe9d4('0x12')]);}logger[_0xe9d4('0x10')]('AnalyticCustomReport,\x20%s,\x20%s',_0x397343,_0x1c2493['error'][_0xe9d4('0x12')]);return _0x42bdc4(_0x1c2493[_0xe9d4('0x10')][_0xe9d4('0x12')]);}else{logger['info'](_0xe9d4('0xc'),_0x397343,_0xe9d4('0xd'));_0x42bdc4(_0x1c2493['result'][_0xe9d4('0x12')]);}})['catch'](function(_0x74fedd){logger[_0xe9d4('0x10')](_0xe9d4('0xc'),_0x397343,_0x74fedd);_0x20fa6b(_0x74fedd);});});}
\ No newline at end of file
index db15dda..b4855bc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd202=['update','delete','destroy','exports','multer','util','path','express','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','preview','run','post','create','put'];(function(_0x305539,_0x12eeb3){var _0x95a048=function(_0x3b50b0){while(--_0x3b50b0){_0x305539['push'](_0x305539['shift']());}};_0x95a048(++_0x12eeb3);}(_0xd202,0xe0));var _0x2d20=function(_0x4b2436,_0x452299){_0x4b2436=_0x4b2436-0x0;var _0x4f5ab2=_0xd202[_0x4b2436];return _0x4f5ab2;};'use strict';var multer=require(_0x2d20('0x0'));var util=require(_0x2d20('0x1'));var path=require(_0x2d20('0x2'));var timeout=require('connect-timeout');var express=require(_0x2d20('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x2d20('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x2d20('0x5'));var controller=require('./analyticCustomReport.controller');router[_0x2d20('0x6')]('/',auth[_0x2d20('0x7')](),controller[_0x2d20('0x8')]);router['get'](_0x2d20('0x9'),auth['isAuthenticated'](),controller[_0x2d20('0xa')]);router['get']('/:id/preview',auth['isAuthenticated'](),controller[_0x2d20('0xb')]);router['get']('/:id/run',auth[_0x2d20('0x7')](),controller[_0x2d20('0xc')]);router[_0x2d20('0x6')]('/:id/query',auth[_0x2d20('0x7')](),controller['query']);router[_0x2d20('0xd')]('/',auth['isAuthenticated'](),controller[_0x2d20('0xe')]);router[_0x2d20('0xf')](_0x2d20('0x9'),auth[_0x2d20('0x7')](),controller[_0x2d20('0x10')]);router[_0x2d20('0x11')](_0x2d20('0x9'),auth[_0x2d20('0x7')](),controller[_0x2d20('0x12')]);module[_0x2d20('0x13')]=router;
\ No newline at end of file
+var _0xa31d=['get','isAuthenticated','index','preview','/:id/run','run','/:id/query','query','post','create','/:id','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x1ad53d,_0x3067eb){var _0x57df8d=function(_0x2e1ac3){while(--_0x2e1ac3){_0x1ad53d['push'](_0x1ad53d['shift']());}};_0x57df8d(++_0x3067eb);}(_0xa31d,0xcf));var _0xda31=function(_0x57d13b,_0x52d8cb){_0x57d13b=_0x57d13b-0x0;var _0x467696=_0xa31d[_0x57d13b];return _0x467696;};'use strict';var multer=require(_0xda31('0x0'));var util=require(_0xda31('0x1'));var path=require(_0xda31('0x2'));var timeout=require('connect-timeout');var express=require(_0xda31('0x3'));var router=express[_0xda31('0x4')]();var fs_extra=require(_0xda31('0x5'));var auth=require(_0xda31('0x6'));var interaction=require(_0xda31('0x7'));var config=require(_0xda31('0x8'));var controller=require('./analyticCustomReport.controller');router[_0xda31('0x9')]('/',auth[_0xda31('0xa')](),controller[_0xda31('0xb')]);router[_0xda31('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xda31('0x9')]('/:id/preview',auth['isAuthenticated'](),controller[_0xda31('0xc')]);router[_0xda31('0x9')](_0xda31('0xd'),auth[_0xda31('0xa')](),controller[_0xda31('0xe')]);router[_0xda31('0x9')](_0xda31('0xf'),auth[_0xda31('0xa')](),controller[_0xda31('0x10')]);router[_0xda31('0x11')]('/',auth['isAuthenticated'](),controller[_0xda31('0x12')]);router['put'](_0xda31('0x13'),auth[_0xda31('0xa')](),controller[_0xda31('0x14')]);router[_0xda31('0x15')]('/:id',auth[_0xda31('0xa')](),controller[_0xda31('0x16')]);module[_0xda31('0x17')]=router;
\ No newline at end of file
index 3fd62ad..656d356 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xafc4=['sequelize','STRING','TEXT'];(function(_0x503ffd,_0x8ecde){var _0x160437=function(_0x2d45dd){while(--_0x2d45dd){_0x503ffd['push'](_0x503ffd['shift']());}};_0x160437(++_0x8ecde);}(_0xafc4,0x69));var _0x4afc=function(_0xafbc31,_0x4c57f6){_0xafbc31=_0xafbc31-0x0;var _0x1eca30=_0xafc4[_0xafbc31];return _0x1eca30;};'use strict';var Sequelize=require(_0x4afc('0x0'));module['exports']={'name':{'type':Sequelize[_0x4afc('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x4afc('0x1')]},'table':{'type':Sequelize[_0x4afc('0x1')]},'conditions':{'type':Sequelize[_0x4afc('0x2')]},'joins':{'type':Sequelize[_0x4afc('0x2')]}};
\ No newline at end of file
+var _0x7217=['sequelize','STRING','TEXT'];(function(_0x504ad9,_0x2dec3e){var _0x4aacf9=function(_0x3fec23){while(--_0x3fec23){_0x504ad9['push'](_0x504ad9['shift']());}};_0x4aacf9(++_0x2dec3e);}(_0x7217,0x19e));var _0x7721=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0x7217[_0x134c2e];return _0x2825db;};'use strict';var Sequelize=require(_0x7721('0x0'));module['exports']={'name':{'type':Sequelize[_0x7721('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x7721('0x1')]},'parent':{'type':Sequelize[_0x7721('0x1')]},'table':{'type':Sequelize[_0x7721('0x1')]},'conditions':{'type':Sequelize[_0x7721('0x2')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
index 294b673..8328b6e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1967=['conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','SUM(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','IS\x20NOT\x20NULL','table','web','%s-%s.%s','randomstring','output','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','runReport','select','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','update','then','destroy','get','stack','name','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','findAll','rows','show','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','DefaultReports','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','join','left_join','right_join','cross_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','from','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','foreignTable','%s.%s\x20=\x20%s.%s','parentKey','foreignKey'];(function(_0x4ef397,_0x2717fb){var _0x23d5da=function(_0x22f045){while(--_0x22f045){_0x4ef397['push'](_0x4ef397['shift']());}};_0x23d5da(++_0x2717fb);}(_0x1967,0x173));var _0x7196=function(_0xafb016,_0x2f4a44){_0xafb016=_0xafb016-0x0;var _0x1a6fa6=_0x1967[_0xafb016];return _0x1a6fa6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7196('0x0'));var zipdir=require(_0x7196('0x1'));var jsonpatch=require(_0x7196('0x2'));var rp=require(_0x7196('0x3'));var moment=require(_0x7196('0x4'));var BPromise=require(_0x7196('0x5'));var Mustache=require(_0x7196('0x6'));var util=require(_0x7196('0x7'));var path=require(_0x7196('0x8'));var sox=require(_0x7196('0x9'));var csv=require('to-csv');var ejs=require(_0x7196('0xa'));var fs=require('fs');var fs_extra=require(_0x7196('0xb'));var _=require(_0x7196('0xc'));var squel=require(_0x7196('0xd'));var crypto=require(_0x7196('0xe'));var jsforce=require(_0x7196('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x7196('0x10'));var querystring=require(_0x7196('0x11'));var Papa=require(_0x7196('0x12'));var Redis=require(_0x7196('0x13'));var authService=require(_0x7196('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7196('0x15'));var logger=require(_0x7196('0x16'))(_0x7196('0x17'));var utils=require(_0x7196('0x18'));var config=require(_0x7196('0x19'));var licenseUtil=require(_0x7196('0x1a'));var db=require(_0x7196('0x1b'))['db'];var dbH=require(_0x7196('0x1b'))[_0x7196('0x1c')];function respondWithStatusCode(_0xba707b,_0x154101){_0x154101=_0x154101||0xcc;return function(_0x4e8c4c){if(_0x4e8c4c){return _0xba707b[_0x7196('0x1d')](_0x154101);}return _0xba707b[_0x7196('0x1e')](_0x154101)[_0x7196('0x1f')]();};}function respondWithResult(_0xf098c1,_0x511aa1){_0x511aa1=_0x511aa1||0xc8;return function(_0x31c778){if(_0x31c778){return _0xf098c1['status'](_0x511aa1)[_0x7196('0x20')](_0x31c778);}};}function respondWithFilteredResult(_0x2590a6,_0xf7e97){return function(_0x3ed1ad){if(_0x3ed1ad){var _0x12dce7=typeof _0xf7e97[_0x7196('0x21')]===_0x7196('0x22')&&typeof _0xf7e97[_0x7196('0x23')]===_0x7196('0x22');var _0x32fe2b=_0x3ed1ad[_0x7196('0x24')];var _0x5b716a=_0x12dce7?0x0:_0xf7e97['offset'];var _0x448f13=_0x12dce7?_0x3ed1ad[_0x7196('0x24')]:_0xf7e97[_0x7196('0x21')]+_0xf7e97['limit'];var _0x39b944;if(_0x448f13>=_0x32fe2b){_0x448f13=_0x32fe2b;_0x39b944=0xc8;}else{_0x39b944=0xce;}_0x2590a6['status'](_0x39b944);return _0x2590a6['set'](_0x7196('0x25'),_0x5b716a+'-'+_0x448f13+'/'+_0x32fe2b)[_0x7196('0x20')](_0x3ed1ad);}return null;};}function patchUpdates(_0x8dee9d){return function(_0x4ddf78){try{jsonpatch['apply'](_0x4ddf78,_0x8dee9d,!![]);}catch(_0x38d291){return BPromise[_0x7196('0x26')](_0x38d291);}return _0x4ddf78['save']();};}function saveUpdates(_0x18649b,_0x27ff84){return function(_0x6e22e5){if(_0x6e22e5){return _0x6e22e5[_0x7196('0x27')](_0x18649b)[_0x7196('0x28')](function(_0x549f34){return _0x549f34;});}return null;};}function removeEntity(_0x3f8178,_0x520d01){return function(_0x3ce9a0){if(_0x3ce9a0){return _0x3ce9a0[_0x7196('0x29')]()[_0x7196('0x28')](function(){var _0xa69810=_0x3ce9a0[_0x7196('0x2a')]({'plain':!![]});var _0x43f6a2='DefaultReports';return db['UserProfileResource'][_0x7196('0x29')]({'where':{'type':_0x43f6a2,'resourceId':_0xa69810['id']}})[_0x7196('0x28')](function(){return _0x3ce9a0;});})[_0x7196('0x28')](function(){_0x3f8178['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x41cfd2,_0x162cfc){return function(_0x675e64){if(!_0x675e64){_0x41cfd2['sendStatus'](0x194);}return _0x675e64;};}function handleError(_0x35eef9,_0x4ecea1){_0x4ecea1=_0x4ecea1||0x1f4;return function(_0x4fd339){logger['error'](_0x4fd339[_0x7196('0x2b')]);if(_0x4fd339[_0x7196('0x2c')]){delete _0x4fd339[_0x7196('0x2c')];}_0x35eef9['status'](_0x4ecea1)[_0x7196('0x2d')](_0x4fd339);};}exports[_0x7196('0x2e')]=function(_0x2f9583,_0xf999e9){var _0x50c386={},_0x39710d={},_0x429160={'count':0x0,'rows':[]};var _0xd07f22=_[_0x7196('0x2f')](db[_0x7196('0x30')][_0x7196('0x31')],function(_0x15c5f0){return{'name':_0x15c5f0[_0x7196('0x32')],'type':_0x15c5f0[_0x7196('0x33')][_0x7196('0x34')]};});_0x39710d[_0x7196('0x35')]=_['map'](_0xd07f22,_0x7196('0x2c'));_0x39710d['query']=_[_0x7196('0x36')](_0x2f9583['query']);_0x39710d[_0x7196('0x37')]=_[_0x7196('0x38')](_0x39710d['model'],_0x39710d[_0x7196('0x39')]);_0x50c386[_0x7196('0x3a')]=_[_0x7196('0x38')](_0x39710d[_0x7196('0x35')],qs[_0x7196('0x3b')](_0x2f9583['query'][_0x7196('0x3b')]));_0x50c386[_0x7196('0x3a')]=_0x50c386[_0x7196('0x3a')][_0x7196('0x3c')]?_0x50c386[_0x7196('0x3a')]:_0x39710d[_0x7196('0x35')];if(!_0x2f9583['query'][_0x7196('0x3d')](_0x7196('0x3e'))){_0x50c386[_0x7196('0x23')]=qs['limit'](_0x2f9583[_0x7196('0x39')][_0x7196('0x23')]);_0x50c386[_0x7196('0x21')]=qs[_0x7196('0x21')](_0x2f9583[_0x7196('0x39')][_0x7196('0x21')]);}_0x50c386[_0x7196('0x3f')]=qs[_0x7196('0x40')](_0x2f9583[_0x7196('0x39')][_0x7196('0x40')]);_0x50c386['where']=qs[_0x7196('0x37')](_[_0x7196('0x41')](_0x2f9583['query'],_0x39710d[_0x7196('0x37')]),_0xd07f22);if(_0x2f9583['query']['filter']){_0x50c386[_0x7196('0x42')]=_[_0x7196('0x43')](_0x50c386['where'],{'$or':_['map'](_0xd07f22,function(_0x1bad95){if(_0x1bad95[_0x7196('0x33')]!==_0x7196('0x44')){var _0x4c2341={};_0x4c2341[_0x1bad95[_0x7196('0x2c')]]={'$like':'%'+_0x2f9583[_0x7196('0x39')][_0x7196('0x45')]+'%'};return _0x4c2341;}})});}_0x50c386=_[_0x7196('0x43')]({},_0x50c386,_0x2f9583[_0x7196('0x46')]);var _0x428d76={'where':_0x50c386[_0x7196('0x42')]};return db[_0x7196('0x30')]['count'](_0x428d76)[_0x7196('0x28')](function(_0xa852e1){_0x429160['count']=_0xa852e1;if(_0x2f9583[_0x7196('0x39')][_0x7196('0x47')]){_0x50c386['include']=[{'all':!![]}];}return db[_0x7196('0x30')][_0x7196('0x48')](_0x50c386);})[_0x7196('0x28')](function(_0x5749e2){_0x429160[_0x7196('0x49')]=_0x5749e2;return _0x429160;})[_0x7196('0x28')](respondWithFilteredResult(_0xf999e9,_0x50c386))['catch'](handleError(_0xf999e9,null));};exports[_0x7196('0x4a')]=function(_0x1a7052,_0x4f0c6c){var _0x335e6f={'raw':!![],'where':{'id':_0x1a7052['params']['id']}},_0x53a5e6={};_0x53a5e6['model']=_['keys'](db['AnalyticDefaultReport'][_0x7196('0x31')]);_0x53a5e6['query']=_[_0x7196('0x36')](_0x1a7052[_0x7196('0x39')]);_0x53a5e6[_0x7196('0x37')]=_[_0x7196('0x38')](_0x53a5e6['model'],_0x53a5e6[_0x7196('0x39')]);_0x335e6f['attributes']=_[_0x7196('0x38')](_0x53a5e6[_0x7196('0x35')],qs[_0x7196('0x3b')](_0x1a7052['query'][_0x7196('0x3b')]));_0x335e6f[_0x7196('0x3a')]=_0x335e6f[_0x7196('0x3a')]['length']?_0x335e6f['attributes']:_0x53a5e6[_0x7196('0x35')];if(_0x1a7052['query'][_0x7196('0x47')]){_0x335e6f['include']=[{'all':!![]}];}_0x335e6f=_['merge']({},_0x335e6f,_0x1a7052[_0x7196('0x46')]);return db['AnalyticDefaultReport']['find'](_0x335e6f)['then'](handleEntityNotFound(_0x4f0c6c,null))[_0x7196('0x28')](respondWithResult(_0x4f0c6c,null))['catch'](handleError(_0x4f0c6c,null));};exports['create']=function(_0x28591e,_0x182c8b){return db[_0x7196('0x30')][_0x7196('0x4b')](_0x28591e['body'],{})[_0x7196('0x28')](function(_0x564688){var _0x36844f=_0x28591e[_0x7196('0x4c')]['get']({'plain':!![]});if(!_0x36844f)throw new Error(_0x7196('0x4d'));if(_0x36844f[_0x7196('0x4e')]===_0x7196('0x4c')){var _0x4fa18f=_0x564688[_0x7196('0x2a')]({'plain':!![]});var _0x5d51aa=_0x7196('0x4f');return db[_0x7196('0x50')][_0x7196('0x51')]({'where':{'name':_0x5d51aa,'userProfileId':_0x36844f[_0x7196('0x52')]},'raw':!![]})[_0x7196('0x28')](function(_0x19733a){if(_0x19733a&&_0x19733a[_0x7196('0x53')]===0x0){return db[_0x7196('0x54')]['create']({'name':_0x4fa18f['name'],'resourceId':_0x4fa18f['id'],'type':_0x7196('0x55'),'sectionId':_0x19733a['id']},{})[_0x7196('0x28')](function(){return _0x564688;});}else{return _0x564688;}})[_0x7196('0x56')](function(_0xe4b032){logger['error'](_0x7196('0x57'),_0xe4b032);throw _0xe4b032;});}return _0x564688;})[_0x7196('0x28')](respondWithResult(_0x182c8b,0xc9))[_0x7196('0x56')](handleError(_0x182c8b,null));};exports[_0x7196('0x27')]=function(_0x9fcfd4,_0x3177c2){if(_0x9fcfd4[_0x7196('0x58')]['id']){delete _0x9fcfd4[_0x7196('0x58')]['id'];}return db[_0x7196('0x30')][_0x7196('0x51')]({'where':{'id':_0x9fcfd4[_0x7196('0x59')]['id']}})['then'](handleEntityNotFound(_0x3177c2,null))[_0x7196('0x28')](saveUpdates(_0x9fcfd4[_0x7196('0x58')],null))[_0x7196('0x28')](respondWithResult(_0x3177c2,null))['catch'](handleError(_0x3177c2,null));};exports[_0x7196('0x29')]=function(_0x5ca1ca,_0x34407d){return db[_0x7196('0x30')][_0x7196('0x51')]({'where':{'id':_0x5ca1ca[_0x7196('0x59')]['id']}})[_0x7196('0x28')](handleEntityNotFound(_0x34407d,null))['then'](removeEntity(_0x34407d,null))[_0x7196('0x56')](handleError(_0x34407d,null));};exports['preview']=function(_0x4be36d,_0x5b9824){var _0x1bc358=0xa;var _0x3be180=[_0x7196('0x5a'),_0x7196('0x5b'),_0x7196('0x5c'),_0x7196('0x5d')];var _0x2d8b3d={'SUM':'SUM(%s)','COUNT':_0x7196('0x5e'),'COUNT DISTINCT':_0x7196('0x5f'),'MAX':_0x7196('0x60'),'MIN':_0x7196('0x61'),'AVG':_0x7196('0x62'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x7196('0x63')};var _0x1c7eb2={'SEC_TO_TIME':_0x7196('0x64'),'DATE':_0x7196('0x65'),'HOUR':_0x7196('0x66'),'ROUND':_0x7196('0x67'),'UNIX_TIMESTAMP':_0x7196('0x68')};var _0x43ee13=function(_0x13e9d0){return!_[_0x7196('0x69')]([_0x7196('0x6a'),'IS\x20NOT\x20NULL',_0x7196('0x6b'),_0x7196('0x6c')],_0x13e9d0);};var _0x27d5d7=function(_0x33f43b){if(!_0x33f43b||!_0x33f43b['rules'][_0x7196('0x3c')]){return'';}for(var _0x204c3a='(',_0x1f3acc=0x0;_0x1f3acc<_0x33f43b[_0x7196('0x6d')][_0x7196('0x3c')];_0x1f3acc+=0x1){_0x1f3acc>0x0&&(_0x204c3a+='\x20'+_0x33f43b[_0x7196('0x6e')]+'\x20');_0x204c3a+=_0x33f43b[_0x7196('0x6d')][_0x1f3acc]['group']?_0x27d5d7(_0x33f43b[_0x7196('0x6d')][_0x1f3acc][_0x7196('0x6f')]):_0x33f43b[_0x7196('0x6d')][_0x1f3acc][_0x7196('0x70')]+'\x20'+_0x33f43b['rules'][_0x1f3acc][_0x7196('0x71')]+(_0x43ee13(_0x33f43b[_0x7196('0x6d')][_0x1f3acc][_0x7196('0x71')])?'\x20'+_0x33f43b[_0x7196('0x6d')][_0x1f3acc][_0x7196('0x72')]:'');}return _0x204c3a+')';};var _0x37c6be={'where':{'id':_0x4be36d['params']['id']}},_0x57065,_0x517dfb,_0x56b2eb,_0x56955e,_0x72f6f1;_0x37c6be=_[_0x7196('0x43')]({},_0x37c6be,_0x4be36d[_0x7196('0x46')]);return db[_0x7196('0x30')][_0x7196('0x51')](_0x37c6be)[_0x7196('0x28')](function(_0x30d44f){if(_0x30d44f){_0x57065=_0x30d44f;return _0x30d44f[_0x7196('0x73')]();}return null;})[_0x7196('0x28')](function(_0x3881a5){if(_0x3881a5){if(!_0x3881a5['length']){throw new db['Sequelize'][(_0x7196('0x74'))](_0x7196('0x75'),0x193);}_0x517dfb=_0x3881a5;return db[_0x7196('0x76')][_0x7196('0x48')]({'raw':!![]});}return null;})[_0x7196('0x28')](function(_0x45e21f){if(_0x45e21f){_0x56b2eb=_[_0x7196('0x77')](_0x45e21f,'id');var _0x2f36f8;var _0x4cc5e3=squel['select']();_0x4cc5e3[_0x7196('0x78')](_0x57065['table']);for(var _0x30d114=0x0;_0x30d114<_0x517dfb['length'];_0x30d114+=0x1){_0x2f36f8=_0x517dfb[_0x30d114][_0x7196('0x79')]?_0x56b2eb[_0x517dfb[_0x30d114][_0x7196('0x79')]][_0x7196('0x7a')]:_0x517dfb[_0x30d114][_0x7196('0x70')];_0x2f36f8=_0x517dfb[_0x30d114]['function']?_['replace'](_0x2d8b3d[_0x517dfb[_0x30d114][_0x7196('0x7b')]],'%s',_0x2f36f8):_0x2f36f8;_0x2f36f8=_0x517dfb[_0x30d114]['format']?_[_0x7196('0x7c')](_0x1c7eb2[_0x517dfb[_0x30d114][_0x7196('0x7d')]],'%s',_0x2f36f8):_0x2f36f8;if(_0x517dfb[_0x30d114][_0x7196('0x7e')]){_0x4cc5e3[_0x7196('0x6f')](_0x2f36f8);}_0x517dfb[_0x30d114][_0x7196('0x7f')]&&_0x4cc5e3[_0x7196('0x3f')](_0x2f36f8,_0x517dfb[_0x30d114]['orderBy']===_0x7196('0x80')?![]:!![]);_0x4cc5e3[_0x7196('0x70')](_0x2f36f8,_0x517dfb[_0x30d114][_0x7196('0x81')]||_0x2f36f8);}if(_0x57065[_0x7196('0x82')]){_0x57065[_0x7196('0x82')]=JSON[_0x7196('0x83')](_0x57065[_0x7196('0x82')]);for(var _0x473c0e=0x0;_0x473c0e<_0x57065[_0x7196('0x82')][_0x7196('0x3c')];_0x473c0e+=0x1){if(_0x57065[_0x7196('0x82')][_0x473c0e][_0x7196('0x33')]&&_['includes'](_0x3be180,_0x57065[_0x7196('0x82')][_0x473c0e][_0x7196('0x33')])&&_0x57065['joins'][_0x473c0e]['parentKey']&&_0x57065[_0x7196('0x82')][_0x473c0e][_0x7196('0x84')]&&_0x57065[_0x7196('0x82')][_0x473c0e]['foreignKey']){_0x4cc5e3[_0x57065[_0x7196('0x82')][_0x473c0e]['type']](_0x57065[_0x7196('0x82')][_0x473c0e][_0x7196('0x84')],null,util['format'](_0x7196('0x85'),_0x57065['table'],_0x57065['joins'][_0x473c0e][_0x7196('0x86')],_0x57065[_0x7196('0x82')][_0x473c0e][_0x7196('0x84')],_0x57065['joins'][_0x473c0e][_0x7196('0x87')]));}}}if(_0x57065['conditions']){_0x57065[_0x7196('0x88')]=JSON[_0x7196('0x83')](_0x57065[_0x7196('0x88')]);_0x4cc5e3[_0x7196('0x42')](_0x27d5d7(_0x57065[_0x7196('0x88')]['group']));}_0x72f6f1=_0x4cc5e3[_0x7196('0x89')]();_0x4cc5e3[_0x7196('0x23')](_0x1bc358);_0x4cc5e3[_0x7196('0x21')](0x0);logger[_0x7196('0x8a')](_0x7196('0x8b'),_0x4cc5e3[_0x7196('0x8c')]());return dbH[_0x7196('0x8d')][_0x7196('0x39')](_0x4cc5e3['toString'](),{'type':dbH[_0x7196('0x8d')][_0x7196('0x8e')][_0x7196('0x8f')]});}})[_0x7196('0x28')](respondWithResult(_0x5b9824,null))['catch'](handleError(_0x5b9824,null));};function runReport(_0x1364f5,_0x2cb53c,_0x4fe2cb){var _0x2e4807=_0x2cb53c['name'];var _0xd6d8cf=0xa;var _0x5318c1=[_0x7196('0x5a'),_0x7196('0x5b'),'right_join',_0x7196('0x5d')];var _0x2b52c0={'SUM':_0x7196('0x90'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x7196('0x60'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x7196('0x91'),'GROUP_CONCAT ASC':_0x7196('0x92'),'GROUP_CONCAT DESC':_0x7196('0x63')};var _0x509c4a={'SEC_TO_TIME':_0x7196('0x64'),'DATE':_0x7196('0x65'),'HOUR':_0x7196('0x66'),'ROUND':_0x7196('0x67'),'UNIX_TIMESTAMP':_0x7196('0x68')};var _0x26048c=function(_0x1a4d17){return!_[_0x7196('0x69')]([_0x7196('0x6a'),_0x7196('0x93'),_0x7196('0x6b'),'IS\x20NOT\x20EMPTY'],_0x1a4d17);};var _0x5acff1=function(_0x32ab6c){if(!_0x32ab6c||!_0x32ab6c['rules']['length']){return'';}for(var _0x2bfdc4='(',_0x1604fa=0x0;_0x1604fa<_0x32ab6c[_0x7196('0x6d')][_0x7196('0x3c')];_0x1604fa+=0x1){_0x1604fa>0x0&&(_0x2bfdc4+='\x20'+_0x32ab6c['operator']+'\x20');_0x2bfdc4+=_0x32ab6c['rules'][_0x1604fa][_0x7196('0x6f')]?_0x5acff1(_0x32ab6c[_0x7196('0x6d')][_0x1604fa][_0x7196('0x6f')]):_0x32ab6c[_0x7196('0x6d')][_0x1604fa]['field']+'\x20'+_0x32ab6c[_0x7196('0x6d')][_0x1604fa]['condition']+(_0x26048c(_0x32ab6c['rules'][_0x1604fa][_0x7196('0x71')])?'\x20'+_0x32ab6c[_0x7196('0x6d')][_0x1604fa][_0x7196('0x72')]:'');}return _0x2bfdc4+')';};var _0x494418={'where':{'id':_0x1364f5['id']}},_0x400aa5,_0x40d4c3,_0x1824e2,_0x30c54b,_0x10712f;_0x494418=_[_0x7196('0x43')]({},_0x494418,_0x4fe2cb);return db[_0x7196('0x30')][_0x7196('0x51')](_0x494418)['then'](function(_0x9bd2ea){if(_0x9bd2ea){_0x400aa5=_0x9bd2ea;return _0x9bd2ea[_0x7196('0x73')]();}return null;})[_0x7196('0x28')](function(_0x408760){if(_0x408760){if(!_0x408760[_0x7196('0x3c')]){throw new db['Sequelize'][(_0x7196('0x74'))](_0x7196('0x75'),0x193);}_0x40d4c3=_0x408760;return db[_0x7196('0x76')]['findAll']({'raw':!![]});}return null;})[_0x7196('0x28')](function(_0x4b98de){if(_0x4b98de){_0x1824e2=_['keyBy'](_0x4b98de,'id');var _0x1dcf93;var _0x25d323=squel['select']();_0x25d323[_0x7196('0x78')](_0x400aa5[_0x7196('0x94')]);for(var _0x48ceda=0x0;_0x48ceda<_0x40d4c3[_0x7196('0x3c')];_0x48ceda+=0x1){_0x1dcf93=_0x40d4c3[_0x48ceda][_0x7196('0x79')]?_0x1824e2[_0x40d4c3[_0x48ceda][_0x7196('0x79')]][_0x7196('0x7a')]:_0x40d4c3[_0x48ceda][_0x7196('0x70')];_0x1dcf93=_0x40d4c3[_0x48ceda][_0x7196('0x7b')]?_['replace'](_0x2b52c0[_0x40d4c3[_0x48ceda][_0x7196('0x7b')]],'%s',_0x1dcf93):_0x1dcf93;_0x1dcf93=_0x40d4c3[_0x48ceda][_0x7196('0x7d')]?_[_0x7196('0x7c')](_0x509c4a[_0x40d4c3[_0x48ceda]['format']],'%s',_0x1dcf93):_0x1dcf93;if(_0x40d4c3[_0x48ceda]['groupBy']){_0x25d323['group'](_0x1dcf93);}_0x40d4c3[_0x48ceda][_0x7196('0x7f')]&&_0x25d323[_0x7196('0x3f')](_0x1dcf93,_0x40d4c3[_0x48ceda][_0x7196('0x7f')]==='DESC'?![]:!![]);_0x25d323[_0x7196('0x70')](_0x1dcf93,_0x40d4c3[_0x48ceda]['alias']||_0x1dcf93);}if(_0x400aa5[_0x7196('0x82')]){_0x400aa5['joins']=JSON[_0x7196('0x83')](_0x400aa5[_0x7196('0x82')]);for(var _0x33d5bf=0x0;_0x33d5bf<_0x400aa5[_0x7196('0x82')][_0x7196('0x3c')];_0x33d5bf+=0x1){if(_0x400aa5[_0x7196('0x82')][_0x33d5bf][_0x7196('0x33')]&&_['includes'](_0x5318c1,_0x400aa5[_0x7196('0x82')][_0x33d5bf]['type'])&&_0x400aa5['joins'][_0x33d5bf]['parentKey']&&_0x400aa5['joins'][_0x33d5bf]['foreignTable']&&_0x400aa5[_0x7196('0x82')][_0x33d5bf][_0x7196('0x87')]){_0x25d323[_0x400aa5[_0x7196('0x82')][_0x33d5bf]['type']](_0x400aa5[_0x7196('0x82')][_0x33d5bf]['foreignTable'],null,util['format']('%s.%s\x20=\x20%s.%s',_0x400aa5[_0x7196('0x94')],_0x400aa5['joins'][_0x33d5bf][_0x7196('0x86')],_0x400aa5[_0x7196('0x82')][_0x33d5bf][_0x7196('0x84')],_0x400aa5[_0x7196('0x82')][_0x33d5bf][_0x7196('0x87')]));}}}if(_0x400aa5[_0x7196('0x88')]){_0x400aa5[_0x7196('0x88')]=JSON[_0x7196('0x83')](_0x400aa5['conditions']);_0x25d323[_0x7196('0x42')](_0x5acff1(_0x400aa5[_0x7196('0x88')][_0x7196('0x6f')]));}_0x10712f=_0x25d323['clone']();_0x25d323[_0x7196('0x23')](_0xd6d8cf);_0x25d323[_0x7196('0x21')](0x0);return;}})[_0x7196('0x28')](function(){if(_0x2cb53c['output']===_0x7196('0x95')){return null;}var _0x46a563=_[_0x7196('0x43')](_0x2cb53c,{'name':_0x2cb53c['fullPath']||_0x2cb53c[_0x7196('0x2c')]||_0x400aa5[_0x7196('0x2c')],'basename':_0x2e4807,'savename':util['format'](_0x7196('0x96'),_0x2cb53c['name']||_0x400aa5[_0x7196('0x2c')],require(_0x7196('0x97'))['generate'](0x4),_0x2cb53c[_0x7196('0x98')]||'csv'),'reportId':_0x400aa5['id'],'reportType':_0x7196('0x99')});return db[_0x7196('0x9a')][_0x7196('0x4b')](_0x46a563,{'raw':!![]});})['then'](function(_0xd9619d){if(_0x400aa5[_0x7196('0x94')]===_0x7196('0x9b')){_0x10712f[_0x7196('0x42')](_0x400aa5['table']+_0x7196('0x9c'),_0x2cb53c[_0x7196('0x9d')],_0x2cb53c[_0x7196('0x9e')]);}else{_0x10712f['where'](_0x400aa5['table']+_0x7196('0x9f'),_0x2cb53c[_0x7196('0x9d')],_0x2cb53c[_0x7196('0x9e')]);}if(_0xd9619d){logger[_0x7196('0xa0')]('Run\x20Query:',_0x10712f[_0x7196('0x8c')]());require('child_process')[_0x7196('0xa1')](path['join'](__dirname,_0x7196('0xa2'),_0xd9619d[_0x7196('0x98')]),[_0xd9619d['id'],_0x10712f[_0x7196('0x8c')](),path[_0x7196('0x5a')](__dirname,_0x7196('0xa3'),_0xd9619d[_0x7196('0xa4')]),_0x2e4807]);return _0xd9619d;}else{var _0x342fb1=squel['select']();_0x342fb1[_0x7196('0x78')]('('+_0x10712f[_0x7196('0x8c')]()+')',_0x7196('0xa5'));_0x342fb1[_0x7196('0x70')](_0x7196('0xa6'),_0x7196('0x24'));_0x10712f[_0x7196('0x23')](_0x2cb53c[_0x7196('0x23')]||_0xd6d8cf);_0x10712f['offset'](_0x2cb53c[_0x7196('0x21')]||0x0);return dbH[_0x7196('0x8d')]['query'](_0x342fb1[_0x7196('0x8c')](),{'type':dbH[_0x7196('0x8d')]['QueryTypes'][_0x7196('0x8f')]})[_0x7196('0x28')](function(_0xdf1ede){if(!_0xdf1ede[_0x7196('0x3c')]){_0x30c54b=0x0;}else{_0x30c54b=_0xdf1ede[0x0]['count']||0x0;}return dbH['sequelize'][_0x7196('0x39')](_0x10712f['toString'](),{'type':dbH[_0x7196('0x8d')][_0x7196('0x8e')][_0x7196('0x8f')]});})[_0x7196('0x28')](function(_0x2df80a){return{'rows':_0x2df80a||[],'count':_0x30c54b};});}});}exports['run']=function(_0x392e74,_0x17ba6d){return runReport(_0x392e74[_0x7196('0x59')],_0x392e74[_0x7196('0x39')],_0x392e74[_0x7196('0x46')])[_0x7196('0x28')](respondWithResult(_0x17ba6d,null))[_0x7196('0x56')](handleError(_0x17ba6d,null));};exports[_0x7196('0xa7')]=runReport;exports[_0x7196('0x39')]=function(_0x5a3c87,_0x58fb86){var _0x51da79=0xa;var _0x144613=[_0x7196('0x5a'),_0x7196('0x5b'),_0x7196('0x5c'),_0x7196('0x5d')];var _0x9055af={'SUM':_0x7196('0x90'),'COUNT':_0x7196('0x5e'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x7196('0x91'),'GROUP_CONCAT ASC':_0x7196('0x92'),'GROUP_CONCAT DESC':_0x7196('0x63')};var _0xab9595={'SEC_TO_TIME':_0x7196('0x64'),'DATE':_0x7196('0x65'),'HOUR':'HOUR(%s)','ROUND':_0x7196('0x67'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x5236a0=function(_0x520fe8){return!_['includes'](['IS\x20NULL',_0x7196('0x93'),'IS\x20EMPTY',_0x7196('0x6c')],_0x520fe8);};var _0x425a57=function(_0x302728){if(!_0x302728||!_0x302728[_0x7196('0x6d')][_0x7196('0x3c')]){return'';}for(var _0x14492e='(',_0x58df43=0x0;_0x58df43<_0x302728[_0x7196('0x6d')][_0x7196('0x3c')];_0x58df43+=0x1){_0x58df43>0x0&&(_0x14492e+='\x20'+_0x302728[_0x7196('0x6e')]+'\x20');_0x14492e+=_0x302728['rules'][_0x58df43][_0x7196('0x6f')]?_0x425a57(_0x302728[_0x7196('0x6d')][_0x58df43][_0x7196('0x6f')]):_0x302728['rules'][_0x58df43]['field']+'\x20'+_0x302728[_0x7196('0x6d')][_0x58df43][_0x7196('0x71')]+(_0x5236a0(_0x302728[_0x7196('0x6d')][_0x58df43][_0x7196('0x71')])?'\x20'+_0x302728[_0x7196('0x6d')][_0x58df43][_0x7196('0x72')]:'');}return _0x14492e+')';};var _0x1a8a5a={'where':{'id':_0x5a3c87[_0x7196('0x59')]['id']}},_0x2944e5,_0x3f9385,_0xbd94ef,_0x5d2a56,_0x2fb552;_0x1a8a5a=_['merge']({},_0x1a8a5a,_0x5a3c87[_0x7196('0x46')]);return db[_0x7196('0x30')]['find'](_0x1a8a5a)[_0x7196('0x28')](function(_0x386259){if(_0x386259){_0x2944e5=_0x386259;return _0x386259[_0x7196('0x73')]();}return null;})[_0x7196('0x28')](function(_0x1e7a64){if(_0x1e7a64){if(!_0x1e7a64[_0x7196('0x3c')]){throw new db['Sequelize']['ValidationErrorItem'](_0x7196('0x75'),0x193);}_0x3f9385=_0x1e7a64;return db['AnalyticMetric'][_0x7196('0x48')]({'raw':!![]});}return null;})[_0x7196('0x28')](function(_0x30db09){if(_0x30db09){_0xbd94ef=_['keyBy'](_0x30db09,'id');var _0x4729e1;var _0x66e1e6=squel[_0x7196('0xa8')]();_0x66e1e6[_0x7196('0x78')](_0x2944e5[_0x7196('0x94')]);for(var _0x1e2105=0x0;_0x1e2105<_0x3f9385[_0x7196('0x3c')];_0x1e2105+=0x1){_0x4729e1=_0x3f9385[_0x1e2105][_0x7196('0x79')]?_0xbd94ef[_0x3f9385[_0x1e2105][_0x7196('0x79')]]['metric']:_0x3f9385[_0x1e2105][_0x7196('0x70')];_0x4729e1=_0x3f9385[_0x1e2105][_0x7196('0x7b')]?_[_0x7196('0x7c')](_0x9055af[_0x3f9385[_0x1e2105][_0x7196('0x7b')]],'%s',_0x4729e1):_0x4729e1;_0x4729e1=_0x3f9385[_0x1e2105][_0x7196('0x7d')]?_[_0x7196('0x7c')](_0xab9595[_0x3f9385[_0x1e2105]['format']],'%s',_0x4729e1):_0x4729e1;if(_0x3f9385[_0x1e2105][_0x7196('0x7e')]){_0x66e1e6['group'](_0x4729e1);}_0x3f9385[_0x1e2105][_0x7196('0x7f')]&&_0x66e1e6[_0x7196('0x3f')](_0x4729e1,_0x3f9385[_0x1e2105][_0x7196('0x7f')]==='DESC'?![]:!![]);_0x66e1e6['field'](_0x4729e1,_0x3f9385[_0x1e2105][_0x7196('0x81')]||_0x4729e1);}if(_0x2944e5[_0x7196('0x82')]){_0x2944e5[_0x7196('0x82')]=JSON[_0x7196('0x83')](_0x2944e5[_0x7196('0x82')]);for(var _0x220315=0x0;_0x220315<_0x2944e5[_0x7196('0x82')][_0x7196('0x3c')];_0x220315+=0x1){if(_0x2944e5['joins'][_0x220315][_0x7196('0x33')]&&_[_0x7196('0x69')](_0x144613,_0x2944e5['joins'][_0x220315][_0x7196('0x33')])&&_0x2944e5[_0x7196('0x82')][_0x220315][_0x7196('0x86')]&&_0x2944e5['joins'][_0x220315][_0x7196('0x84')]&&_0x2944e5[_0x7196('0x82')][_0x220315][_0x7196('0x87')]){_0x66e1e6[_0x2944e5[_0x7196('0x82')][_0x220315][_0x7196('0x33')]](_0x2944e5['joins'][_0x220315]['foreignTable'],null,util[_0x7196('0x7d')](_0x7196('0x85'),_0x2944e5[_0x7196('0x94')],_0x2944e5[_0x7196('0x82')][_0x220315][_0x7196('0x86')],_0x2944e5[_0x7196('0x82')][_0x220315]['foreignTable'],_0x2944e5[_0x7196('0x82')][_0x220315][_0x7196('0x87')]));}}}if(_0x2944e5[_0x7196('0x88')]){_0x2944e5[_0x7196('0x88')]=JSON['parse'](_0x2944e5[_0x7196('0x88')]);_0x66e1e6[_0x7196('0x42')](_0x425a57(_0x2944e5[_0x7196('0x88')][_0x7196('0x6f')]));}_0x2fb552=_0x66e1e6[_0x7196('0x89')]();_0x66e1e6[_0x7196('0x23')](_0x51da79);_0x66e1e6[_0x7196('0x21')](0x0);logger[_0x7196('0x8a')](_0x7196('0x8b'),_0x66e1e6[_0x7196('0x8c')]());return dbH[_0x7196('0x8d')][_0x7196('0x39')](_0x66e1e6['toString'](),{'type':dbH[_0x7196('0x8d')]['QueryTypes'][_0x7196('0x8f')]});}})['then'](function(){return{'sql':_0x2fb552[_0x7196('0x8c')]()};})['then'](respondWithResult(_0x58fb86,null))[_0x7196('0x56')](handleError(_0x58fb86,null));};
\ No newline at end of file
+var _0x53ec=['IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','value','getFields','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','keyBy','select','from','table','MetricId','metric','function','format','replace','orderBy','DESC','alias','joins','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','parse','clone','debug','Limited\x20Query:','sequelize','toString','QueryTypes','right_join','SUM(%s)','COUNT(DISTINCT\x20%s)','GROUP_CONCAT(%s)','HOUR(%s)','ROUND(%s)','condition','Sequelize','groupBy','foreignKey','output','fullPath','%s-%s.%s','randomstring','generate','csv','default','AnalyticExtractedReport','cdr','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../files/reports','savename','countTable','COUNT(*)','SELECT','runReport','cross_join','COUNT(%s)','MIN(%s)','ValidationErrorItem','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','dbH','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','get','DefaultReports','UserProfileResource','error','stack','name','send','index','map','rawAttributes','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','filter','merge','type','include','AnalyticDefaultReport','params','includeAll','options','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','catch','preview','join','left_join','MAX(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','UNIX_TIMESTAMP(%s)','includes'];(function(_0x5f3dfb,_0xef3847){var _0x2e1a49=function(_0x29aec1){while(--_0x29aec1){_0x5f3dfb['push'](_0x5f3dfb['shift']());}};_0x2e1a49(++_0xef3847);}(_0x53ec,0x192));var _0xc53e=function(_0x1e76e8,_0x41ec55){_0x1e76e8=_0x1e76e8-0x0;var _0x2d7a1f=_0x53ec[_0x1e76e8];return _0x2d7a1f;};'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'];var dbH=require(_0xc53e('0x17'))[_0xc53e('0x18')];function respondWithStatusCode(_0x56f0e5,_0x4e74c9){_0x4e74c9=_0x4e74c9||0xcc;return function(_0x1c06cd){if(_0x1c06cd){return _0x56f0e5[_0xc53e('0x19')](_0x4e74c9);}return _0x56f0e5[_0xc53e('0x1a')](_0x4e74c9)[_0xc53e('0x1b')]();};}function respondWithResult(_0x358ef3,_0x382e87){_0x382e87=_0x382e87||0xc8;return function(_0x3dc2fa){if(_0x3dc2fa){return _0x358ef3[_0xc53e('0x1a')](_0x382e87)[_0xc53e('0x1c')](_0x3dc2fa);}};}function respondWithFilteredResult(_0x2ad6eb,_0x5b0a88){return function(_0x8a522e){if(_0x8a522e){var _0x191567=typeof _0x5b0a88[_0xc53e('0x1d')]===_0xc53e('0x1e')&&typeof _0x5b0a88[_0xc53e('0x1f')]===_0xc53e('0x1e');var _0x164016=_0x8a522e[_0xc53e('0x20')];var _0x3b550e=_0x191567?0x0:_0x5b0a88['offset'];var _0x546fab=_0x191567?_0x8a522e[_0xc53e('0x20')]:_0x5b0a88[_0xc53e('0x1d')]+_0x5b0a88[_0xc53e('0x1f')];var _0x2e85df;if(_0x546fab>=_0x164016){_0x546fab=_0x164016;_0x2e85df=0xc8;}else{_0x2e85df=0xce;}_0x2ad6eb[_0xc53e('0x1a')](_0x2e85df);return _0x2ad6eb[_0xc53e('0x21')](_0xc53e('0x22'),_0x3b550e+'-'+_0x546fab+'/'+_0x164016)[_0xc53e('0x1c')](_0x8a522e);}return null;};}function patchUpdates(_0x364c80){return function(_0x401af6){try{jsonpatch[_0xc53e('0x23')](_0x401af6,_0x364c80,!![]);}catch(_0x44fd93){return BPromise[_0xc53e('0x24')](_0x44fd93);}return _0x401af6['save']();};}function saveUpdates(_0x47cfdd,_0x531ede){return function(_0x4f4304){if(_0x4f4304){return _0x4f4304[_0xc53e('0x25')](_0x47cfdd)[_0xc53e('0x26')](function(_0x4015c8){return _0x4015c8;});}return null;};}function removeEntity(_0x180811,_0x5009e1){return function(_0x5e5377){if(_0x5e5377){return _0x5e5377[_0xc53e('0x27')]()['then'](function(){var _0x1ae55e=_0x5e5377[_0xc53e('0x28')]({'plain':!![]});var _0x443179=_0xc53e('0x29');return db[_0xc53e('0x2a')]['destroy']({'where':{'type':_0x443179,'resourceId':_0x1ae55e['id']}})[_0xc53e('0x26')](function(){return _0x5e5377;});})['then'](function(){_0x180811['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c5056,_0x57a1f5){return function(_0x28240a){if(!_0x28240a){_0x3c5056['sendStatus'](0x194);}return _0x28240a;};}function handleError(_0x24a77e,_0x5112d2){_0x5112d2=_0x5112d2||0x1f4;return function(_0x5ce216){logger[_0xc53e('0x2b')](_0x5ce216[_0xc53e('0x2c')]);if(_0x5ce216[_0xc53e('0x2d')]){delete _0x5ce216[_0xc53e('0x2d')];}_0x24a77e[_0xc53e('0x1a')](_0x5112d2)[_0xc53e('0x2e')](_0x5ce216);};}exports[_0xc53e('0x2f')]=function(_0x2a2ca9,_0x4ace0b){var _0x437893={},_0x311835={},_0x2d36c0={'count':0x0,'rows':[]};var _0x56206b=_[_0xc53e('0x30')](db['AnalyticDefaultReport'][_0xc53e('0x31')],function(_0x2467f4){return{'name':_0x2467f4['fieldName'],'type':_0x2467f4['type'][_0xc53e('0x32')]};});_0x311835[_0xc53e('0x33')]=_[_0xc53e('0x30')](_0x56206b,_0xc53e('0x2d'));_0x311835[_0xc53e('0x34')]=_[_0xc53e('0x35')](_0x2a2ca9[_0xc53e('0x34')]);_0x311835[_0xc53e('0x36')]=_['intersection'](_0x311835[_0xc53e('0x33')],_0x311835[_0xc53e('0x34')]);_0x437893[_0xc53e('0x37')]=_[_0xc53e('0x38')](_0x311835[_0xc53e('0x33')],qs[_0xc53e('0x39')](_0x2a2ca9[_0xc53e('0x34')][_0xc53e('0x39')]));_0x437893[_0xc53e('0x37')]=_0x437893['attributes'][_0xc53e('0x3a')]?_0x437893['attributes']:_0x311835[_0xc53e('0x33')];if(!_0x2a2ca9[_0xc53e('0x34')]['hasOwnProperty'](_0xc53e('0x3b'))){_0x437893[_0xc53e('0x1f')]=qs[_0xc53e('0x1f')](_0x2a2ca9['query'][_0xc53e('0x1f')]);_0x437893[_0xc53e('0x1d')]=qs[_0xc53e('0x1d')](_0x2a2ca9[_0xc53e('0x34')][_0xc53e('0x1d')]);}_0x437893[_0xc53e('0x3c')]=qs[_0xc53e('0x3d')](_0x2a2ca9['query'][_0xc53e('0x3d')]);_0x437893[_0xc53e('0x3e')]=qs[_0xc53e('0x36')](_['pick'](_0x2a2ca9[_0xc53e('0x34')],_0x311835['filters']),_0x56206b);if(_0x2a2ca9[_0xc53e('0x34')][_0xc53e('0x3f')]){_0x437893[_0xc53e('0x3e')]=_[_0xc53e('0x40')](_0x437893[_0xc53e('0x3e')],{'$or':_['map'](_0x56206b,function(_0x3dda55){if(_0x3dda55[_0xc53e('0x41')]!=='VIRTUAL'){var _0x5b7354={};_0x5b7354[_0x3dda55['name']]={'$like':'%'+_0x2a2ca9['query'][_0xc53e('0x3f')]+'%'};return _0x5b7354;}})});}_0x437893=_[_0xc53e('0x40')]({},_0x437893,_0x2a2ca9['options']);var _0x460ee6={'where':_0x437893['where']};return db['AnalyticDefaultReport']['count'](_0x460ee6)[_0xc53e('0x26')](function(_0x4ba96f){_0x2d36c0['count']=_0x4ba96f;if(_0x2a2ca9[_0xc53e('0x34')]['includeAll']){_0x437893[_0xc53e('0x42')]=[{'all':!![]}];}return db[_0xc53e('0x43')]['findAll'](_0x437893);})[_0xc53e('0x26')](function(_0x3a4ebc){_0x2d36c0['rows']=_0x3a4ebc;return _0x2d36c0;})[_0xc53e('0x26')](respondWithFilteredResult(_0x4ace0b,_0x437893))['catch'](handleError(_0x4ace0b,null));};exports['show']=function(_0x481e6d,_0x4efee5){var _0x887d78={'raw':!![],'where':{'id':_0x481e6d[_0xc53e('0x44')]['id']}},_0x17b586={};_0x17b586['model']=_[_0xc53e('0x35')](db[_0xc53e('0x43')]['rawAttributes']);_0x17b586['query']=_[_0xc53e('0x35')](_0x481e6d[_0xc53e('0x34')]);_0x17b586[_0xc53e('0x36')]=_['intersection'](_0x17b586[_0xc53e('0x33')],_0x17b586[_0xc53e('0x34')]);_0x887d78[_0xc53e('0x37')]=_[_0xc53e('0x38')](_0x17b586[_0xc53e('0x33')],qs[_0xc53e('0x39')](_0x481e6d[_0xc53e('0x34')]['fields']));_0x887d78[_0xc53e('0x37')]=_0x887d78[_0xc53e('0x37')][_0xc53e('0x3a')]?_0x887d78['attributes']:_0x17b586[_0xc53e('0x33')];if(_0x481e6d[_0xc53e('0x34')][_0xc53e('0x45')]){_0x887d78[_0xc53e('0x42')]=[{'all':!![]}];}_0x887d78=_[_0xc53e('0x40')]({},_0x887d78,_0x481e6d[_0xc53e('0x46')]);return db['AnalyticDefaultReport'][_0xc53e('0x47')](_0x887d78)[_0xc53e('0x26')](handleEntityNotFound(_0x4efee5,null))[_0xc53e('0x26')](respondWithResult(_0x4efee5,null))['catch'](handleError(_0x4efee5,null));};exports[_0xc53e('0x48')]=function(_0x1d2491,_0x1eeb65){return db[_0xc53e('0x43')][_0xc53e('0x48')](_0x1d2491[_0xc53e('0x49')],{})[_0xc53e('0x26')](function(_0x2ba2b4){var _0x34de2d=_0x1d2491[_0xc53e('0x4a')]['get']({'plain':!![]});if(!_0x34de2d)throw new Error(_0xc53e('0x4b'));if(_0x34de2d[_0xc53e('0x4c')]===_0xc53e('0x4a')){var _0x3d74ac=_0x2ba2b4[_0xc53e('0x28')]({'plain':!![]});var _0x52dac7='Reports';return db[_0xc53e('0x4d')]['find']({'where':{'name':_0x52dac7,'userProfileId':_0x34de2d[_0xc53e('0x4e')]},'raw':!![]})['then'](function(_0x3a49a4){if(_0x3a49a4&&_0x3a49a4[_0xc53e('0x4f')]===0x0){return db[_0xc53e('0x2a')]['create']({'name':_0x3d74ac[_0xc53e('0x2d')],'resourceId':_0x3d74ac['id'],'type':_0xc53e('0x29'),'sectionId':_0x3a49a4['id']},{})[_0xc53e('0x26')](function(){return _0x2ba2b4;});}else{return _0x2ba2b4;}})['catch'](function(_0x2f7df2){logger['error'](_0xc53e('0x50'),_0x2f7df2);throw _0x2f7df2;});}return _0x2ba2b4;})[_0xc53e('0x26')](respondWithResult(_0x1eeb65,0xc9))['catch'](handleError(_0x1eeb65,null));};exports[_0xc53e('0x25')]=function(_0x1515ea,_0x5bba72){if(_0x1515ea[_0xc53e('0x49')]['id']){delete _0x1515ea[_0xc53e('0x49')]['id'];}return db[_0xc53e('0x43')][_0xc53e('0x47')]({'where':{'id':_0x1515ea[_0xc53e('0x44')]['id']}})[_0xc53e('0x26')](handleEntityNotFound(_0x5bba72,null))[_0xc53e('0x26')](saveUpdates(_0x1515ea[_0xc53e('0x49')],null))[_0xc53e('0x26')](respondWithResult(_0x5bba72,null))[_0xc53e('0x51')](handleError(_0x5bba72,null));};exports[_0xc53e('0x27')]=function(_0x47dd5a,_0x8364f6){return db['AnalyticDefaultReport'][_0xc53e('0x47')]({'where':{'id':_0x47dd5a['params']['id']}})[_0xc53e('0x26')](handleEntityNotFound(_0x8364f6,null))[_0xc53e('0x26')](removeEntity(_0x8364f6,null))['catch'](handleError(_0x8364f6,null));};exports[_0xc53e('0x52')]=function(_0x7f0bc0,_0x9c0112){var _0x432a91=0xa;var _0x53083b=[_0xc53e('0x53'),_0xc53e('0x54'),'right_join','cross_join'];var _0x3c0aa1={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xc53e('0x55'),'MIN':'MIN(%s)','AVG':_0xc53e('0x56'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xc53e('0x57'),'GROUP_CONCAT DESC':_0xc53e('0x58')};var _0x5fcd58={'SEC_TO_TIME':_0xc53e('0x59'),'DATE':_0xc53e('0x5a'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xc53e('0x5b')};var _0x37b091=function(_0x31e22b){return!_[_0xc53e('0x5c')]([_0xc53e('0x5d'),_0xc53e('0x5e'),_0xc53e('0x5f'),_0xc53e('0x60')],_0x31e22b);};var _0x13bf71=function(_0x16d8a1){if(!_0x16d8a1||!_0x16d8a1[_0xc53e('0x61')][_0xc53e('0x3a')]){return'';}for(var _0xdc0e49='(',_0x520738=0x0;_0x520738<_0x16d8a1[_0xc53e('0x61')]['length'];_0x520738+=0x1){_0x520738>0x0&&(_0xdc0e49+='\x20'+_0x16d8a1[_0xc53e('0x62')]+'\x20');_0xdc0e49+=_0x16d8a1[_0xc53e('0x61')][_0x520738][_0xc53e('0x63')]?_0x13bf71(_0x16d8a1[_0xc53e('0x61')][_0x520738][_0xc53e('0x63')]):_0x16d8a1[_0xc53e('0x61')][_0x520738][_0xc53e('0x64')]+'\x20'+_0x16d8a1[_0xc53e('0x61')][_0x520738]['condition']+(_0x37b091(_0x16d8a1['rules'][_0x520738]['condition'])?'\x20'+_0x16d8a1[_0xc53e('0x61')][_0x520738][_0xc53e('0x65')]:'');}return _0xdc0e49+')';};var _0x37ac78={'where':{'id':_0x7f0bc0['params']['id']}},_0x25e4b6,_0x247d99,_0x160ca3,_0x3581ab,_0x5a9596;_0x37ac78=_['merge']({},_0x37ac78,_0x7f0bc0[_0xc53e('0x46')]);return db[_0xc53e('0x43')]['find'](_0x37ac78)[_0xc53e('0x26')](function(_0x235a6b){if(_0x235a6b){_0x25e4b6=_0x235a6b;return _0x235a6b[_0xc53e('0x66')]();}return null;})[_0xc53e('0x26')](function(_0x22829b){if(_0x22829b){if(!_0x22829b[_0xc53e('0x3a')]){throw new db['Sequelize']['ValidationErrorItem'](_0xc53e('0x67'),0x193);}_0x247d99=_0x22829b;return db[_0xc53e('0x68')][_0xc53e('0x69')]({'raw':!![]});}return null;})[_0xc53e('0x26')](function(_0x29ee08){if(_0x29ee08){_0x160ca3=_[_0xc53e('0x6a')](_0x29ee08,'id');var _0x5a1a4b;var _0x2b6734=squel[_0xc53e('0x6b')]();_0x2b6734[_0xc53e('0x6c')](_0x25e4b6[_0xc53e('0x6d')]);for(var _0x4d2609=0x0;_0x4d2609<_0x247d99[_0xc53e('0x3a')];_0x4d2609+=0x1){_0x5a1a4b=_0x247d99[_0x4d2609][_0xc53e('0x6e')]?_0x160ca3[_0x247d99[_0x4d2609][_0xc53e('0x6e')]][_0xc53e('0x6f')]:_0x247d99[_0x4d2609][_0xc53e('0x64')];_0x5a1a4b=_0x247d99[_0x4d2609][_0xc53e('0x70')]?_['replace'](_0x3c0aa1[_0x247d99[_0x4d2609][_0xc53e('0x70')]],'%s',_0x5a1a4b):_0x5a1a4b;_0x5a1a4b=_0x247d99[_0x4d2609][_0xc53e('0x71')]?_[_0xc53e('0x72')](_0x5fcd58[_0x247d99[_0x4d2609][_0xc53e('0x71')]],'%s',_0x5a1a4b):_0x5a1a4b;if(_0x247d99[_0x4d2609]['groupBy']){_0x2b6734['group'](_0x5a1a4b);}_0x247d99[_0x4d2609][_0xc53e('0x73')]&&_0x2b6734[_0xc53e('0x3c')](_0x5a1a4b,_0x247d99[_0x4d2609][_0xc53e('0x73')]===_0xc53e('0x74')?![]:!![]);_0x2b6734['field'](_0x5a1a4b,_0x247d99[_0x4d2609][_0xc53e('0x75')]||_0x5a1a4b);}if(_0x25e4b6['joins']){_0x25e4b6[_0xc53e('0x76')]=JSON['parse'](_0x25e4b6[_0xc53e('0x76')]);for(var _0x4e128a=0x0;_0x4e128a<_0x25e4b6[_0xc53e('0x76')][_0xc53e('0x3a')];_0x4e128a+=0x1){if(_0x25e4b6['joins'][_0x4e128a][_0xc53e('0x41')]&&_[_0xc53e('0x5c')](_0x53083b,_0x25e4b6['joins'][_0x4e128a]['type'])&&_0x25e4b6[_0xc53e('0x76')][_0x4e128a][_0xc53e('0x77')]&&_0x25e4b6['joins'][_0x4e128a]['foreignTable']&&_0x25e4b6[_0xc53e('0x76')][_0x4e128a]['foreignKey']){_0x2b6734[_0x25e4b6[_0xc53e('0x76')][_0x4e128a]['type']](_0x25e4b6[_0xc53e('0x76')][_0x4e128a][_0xc53e('0x78')],null,util[_0xc53e('0x71')](_0xc53e('0x79'),_0x25e4b6[_0xc53e('0x6d')],_0x25e4b6[_0xc53e('0x76')][_0x4e128a][_0xc53e('0x77')],_0x25e4b6[_0xc53e('0x76')][_0x4e128a][_0xc53e('0x78')],_0x25e4b6[_0xc53e('0x76')][_0x4e128a]['foreignKey']));}}}if(_0x25e4b6[_0xc53e('0x7a')]){_0x25e4b6['conditions']=JSON[_0xc53e('0x7b')](_0x25e4b6[_0xc53e('0x7a')]);_0x2b6734[_0xc53e('0x3e')](_0x13bf71(_0x25e4b6[_0xc53e('0x7a')][_0xc53e('0x63')]));}_0x5a9596=_0x2b6734[_0xc53e('0x7c')]();_0x2b6734[_0xc53e('0x1f')](_0x432a91);_0x2b6734[_0xc53e('0x1d')](0x0);logger[_0xc53e('0x7d')](_0xc53e('0x7e'),_0x2b6734['toString']());return dbH[_0xc53e('0x7f')]['query'](_0x2b6734[_0xc53e('0x80')](),{'type':dbH[_0xc53e('0x7f')][_0xc53e('0x81')]['SELECT']});}})[_0xc53e('0x26')](respondWithResult(_0x9c0112,null))[_0xc53e('0x51')](handleError(_0x9c0112,null));};function runReport(_0x381652,_0xec3738,_0x3a84a2){var _0x508671=_0xec3738[_0xc53e('0x2d')];var _0x48e337=0xa;var _0x56c66f=[_0xc53e('0x53'),_0xc53e('0x54'),_0xc53e('0x82'),'cross_join'];var _0x35b6dc={'SUM':_0xc53e('0x83'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xc53e('0x84'),'MAX':_0xc53e('0x55'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0xc53e('0x85'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xc53e('0x58')};var _0x3d2636={'SEC_TO_TIME':_0xc53e('0x59'),'DATE':'DATE(%s)','HOUR':_0xc53e('0x86'),'ROUND':_0xc53e('0x87'),'UNIX_TIMESTAMP':_0xc53e('0x5b')};var _0x4c8112=function(_0x1a8ae4){return!_[_0xc53e('0x5c')]([_0xc53e('0x5d'),_0xc53e('0x5e'),_0xc53e('0x5f'),'IS\x20NOT\x20EMPTY'],_0x1a8ae4);};var _0x3dac82=function(_0x325287){if(!_0x325287||!_0x325287[_0xc53e('0x61')][_0xc53e('0x3a')]){return'';}for(var _0xe6a976='(',_0x4102bc=0x0;_0x4102bc<_0x325287[_0xc53e('0x61')][_0xc53e('0x3a')];_0x4102bc+=0x1){_0x4102bc>0x0&&(_0xe6a976+='\x20'+_0x325287[_0xc53e('0x62')]+'\x20');_0xe6a976+=_0x325287['rules'][_0x4102bc][_0xc53e('0x63')]?_0x3dac82(_0x325287[_0xc53e('0x61')][_0x4102bc][_0xc53e('0x63')]):_0x325287[_0xc53e('0x61')][_0x4102bc][_0xc53e('0x64')]+'\x20'+_0x325287[_0xc53e('0x61')][_0x4102bc][_0xc53e('0x88')]+(_0x4c8112(_0x325287[_0xc53e('0x61')][_0x4102bc][_0xc53e('0x88')])?'\x20'+_0x325287['rules'][_0x4102bc][_0xc53e('0x65')]:'');}return _0xe6a976+')';};var _0x190509={'where':{'id':_0x381652['id']}},_0x110e32,_0x2135d4,_0x4bbf8a,_0x31b06d,_0x21fc8d;_0x190509=_[_0xc53e('0x40')]({},_0x190509,_0x3a84a2);return db[_0xc53e('0x43')]['find'](_0x190509)[_0xc53e('0x26')](function(_0x138870){if(_0x138870){_0x110e32=_0x138870;return _0x138870[_0xc53e('0x66')]();}return null;})[_0xc53e('0x26')](function(_0x621e78){if(_0x621e78){if(!_0x621e78[_0xc53e('0x3a')]){throw new db[(_0xc53e('0x89'))]['ValidationErrorItem'](_0xc53e('0x67'),0x193);}_0x2135d4=_0x621e78;return db['AnalyticMetric'][_0xc53e('0x69')]({'raw':!![]});}return null;})[_0xc53e('0x26')](function(_0x3fe278){if(_0x3fe278){_0x4bbf8a=_['keyBy'](_0x3fe278,'id');var _0x7c56eb;var _0x36dffe=squel[_0xc53e('0x6b')]();_0x36dffe['from'](_0x110e32[_0xc53e('0x6d')]);for(var _0xedb93a=0x0;_0xedb93a<_0x2135d4[_0xc53e('0x3a')];_0xedb93a+=0x1){_0x7c56eb=_0x2135d4[_0xedb93a]['MetricId']?_0x4bbf8a[_0x2135d4[_0xedb93a][_0xc53e('0x6e')]][_0xc53e('0x6f')]:_0x2135d4[_0xedb93a][_0xc53e('0x64')];_0x7c56eb=_0x2135d4[_0xedb93a][_0xc53e('0x70')]?_[_0xc53e('0x72')](_0x35b6dc[_0x2135d4[_0xedb93a]['function']],'%s',_0x7c56eb):_0x7c56eb;_0x7c56eb=_0x2135d4[_0xedb93a]['format']?_['replace'](_0x3d2636[_0x2135d4[_0xedb93a][_0xc53e('0x71')]],'%s',_0x7c56eb):_0x7c56eb;if(_0x2135d4[_0xedb93a][_0xc53e('0x8a')]){_0x36dffe[_0xc53e('0x63')](_0x7c56eb);}_0x2135d4[_0xedb93a][_0xc53e('0x73')]&&_0x36dffe['order'](_0x7c56eb,_0x2135d4[_0xedb93a][_0xc53e('0x73')]==='DESC'?![]:!![]);_0x36dffe[_0xc53e('0x64')](_0x7c56eb,_0x2135d4[_0xedb93a][_0xc53e('0x75')]||_0x7c56eb);}if(_0x110e32[_0xc53e('0x76')]){_0x110e32[_0xc53e('0x76')]=JSON['parse'](_0x110e32[_0xc53e('0x76')]);for(var _0xc23eef=0x0;_0xc23eef<_0x110e32[_0xc53e('0x76')][_0xc53e('0x3a')];_0xc23eef+=0x1){if(_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x41')]&&_[_0xc53e('0x5c')](_0x56c66f,_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x41')])&&_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x77')]&&_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x78')]&&_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x8b')]){_0x36dffe[_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x41')]](_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x78')],null,util[_0xc53e('0x71')](_0xc53e('0x79'),_0x110e32[_0xc53e('0x6d')],_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x77')],_0x110e32[_0xc53e('0x76')][_0xc23eef]['foreignTable'],_0x110e32[_0xc53e('0x76')][_0xc23eef]['foreignKey']));}}}if(_0x110e32[_0xc53e('0x7a')]){_0x110e32[_0xc53e('0x7a')]=JSON['parse'](_0x110e32[_0xc53e('0x7a')]);_0x36dffe[_0xc53e('0x3e')](_0x3dac82(_0x110e32[_0xc53e('0x7a')][_0xc53e('0x63')]));}_0x21fc8d=_0x36dffe[_0xc53e('0x7c')]();_0x36dffe[_0xc53e('0x1f')](_0x48e337);_0x36dffe[_0xc53e('0x1d')](0x0);return;}})[_0xc53e('0x26')](function(){if(_0xec3738[_0xc53e('0x8c')]==='web'){return null;}var _0x37c8e6=_['merge'](_0xec3738,{'name':_0xec3738[_0xc53e('0x8d')]||_0xec3738[_0xc53e('0x2d')]||_0x110e32[_0xc53e('0x2d')],'basename':_0x508671,'savename':util[_0xc53e('0x71')](_0xc53e('0x8e'),_0xec3738[_0xc53e('0x2d')]||_0x110e32[_0xc53e('0x2d')],require(_0xc53e('0x8f'))[_0xc53e('0x90')](0x4),_0xec3738[_0xc53e('0x8c')]||_0xc53e('0x91')),'reportId':_0x110e32['id'],'reportType':_0xc53e('0x92')});return db[_0xc53e('0x93')]['create'](_0x37c8e6,{'raw':!![]});})[_0xc53e('0x26')](function(_0x575ef5){if(_0x110e32[_0xc53e('0x6d')]===_0xc53e('0x94')){_0x21fc8d[_0xc53e('0x3e')](_0x110e32[_0xc53e('0x6d')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0xec3738['startDate'],_0xec3738[_0xc53e('0x95')]);}else{_0x21fc8d[_0xc53e('0x3e')](_0x110e32[_0xc53e('0x6d')]+_0xc53e('0x96'),_0xec3738['startDate'],_0xec3738['endDate']);}if(_0x575ef5){logger[_0xc53e('0x97')](_0xc53e('0x98'),_0x21fc8d[_0xc53e('0x80')]());require(_0xc53e('0x99'))[_0xc53e('0x9a')](path[_0xc53e('0x53')](__dirname,'../../components/export/',_0x575ef5[_0xc53e('0x8c')]),[_0x575ef5['id'],_0x21fc8d[_0xc53e('0x80')](),path[_0xc53e('0x53')](__dirname,_0xc53e('0x9b'),_0x575ef5[_0xc53e('0x9c')]),_0x508671]);return _0x575ef5;}else{var _0x4f527e=squel[_0xc53e('0x6b')]();_0x4f527e[_0xc53e('0x6c')]('('+_0x21fc8d[_0xc53e('0x80')]()+')',_0xc53e('0x9d'));_0x4f527e[_0xc53e('0x64')](_0xc53e('0x9e'),_0xc53e('0x20'));_0x21fc8d[_0xc53e('0x1f')](_0xec3738[_0xc53e('0x1f')]||_0x48e337);_0x21fc8d[_0xc53e('0x1d')](_0xec3738[_0xc53e('0x1d')]||0x0);return dbH[_0xc53e('0x7f')][_0xc53e('0x34')](_0x4f527e['toString'](),{'type':dbH[_0xc53e('0x7f')][_0xc53e('0x81')]['SELECT']})[_0xc53e('0x26')](function(_0x4ee56b){if(!_0x4ee56b['length']){_0x31b06d=0x0;}else{_0x31b06d=_0x4ee56b[0x0][_0xc53e('0x20')]||0x0;}return dbH['sequelize'][_0xc53e('0x34')](_0x21fc8d['toString'](),{'type':dbH[_0xc53e('0x7f')]['QueryTypes'][_0xc53e('0x9f')]});})[_0xc53e('0x26')](function(_0x10ad32){return{'rows':_0x10ad32||[],'count':_0x31b06d};});}});}exports['run']=function(_0xf3f34a,_0x5dd87e){return runReport(_0xf3f34a[_0xc53e('0x44')],_0xf3f34a[_0xc53e('0x34')],_0xf3f34a[_0xc53e('0x46')])[_0xc53e('0x26')](respondWithResult(_0x5dd87e,null))[_0xc53e('0x51')](handleError(_0x5dd87e,null));};exports[_0xc53e('0xa0')]=runReport;exports[_0xc53e('0x34')]=function(_0x265292,_0x2c776c){var _0x383f22=0xa;var _0x51f2a4=['join',_0xc53e('0x54'),'right_join',_0xc53e('0xa1')];var _0xbc960={'SUM':_0xc53e('0x83'),'COUNT':_0xc53e('0xa2'),'COUNT DISTINCT':_0xc53e('0x84'),'MAX':_0xc53e('0x55'),'MIN':_0xc53e('0xa3'),'AVG':_0xc53e('0x56'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xc53e('0x57'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x34cb12={'SEC_TO_TIME':_0xc53e('0x59'),'DATE':_0xc53e('0x5a'),'HOUR':_0xc53e('0x86'),'ROUND':_0xc53e('0x87'),'UNIX_TIMESTAMP':_0xc53e('0x5b')};var _0x227e0c=function(_0x4c0802){return!_[_0xc53e('0x5c')]([_0xc53e('0x5d'),_0xc53e('0x5e'),_0xc53e('0x5f'),_0xc53e('0x60')],_0x4c0802);};var _0x590fb6=function(_0x15d269){if(!_0x15d269||!_0x15d269[_0xc53e('0x61')]['length']){return'';}for(var _0x5253b1='(',_0x208c17=0x0;_0x208c17<_0x15d269['rules'][_0xc53e('0x3a')];_0x208c17+=0x1){_0x208c17>0x0&&(_0x5253b1+='\x20'+_0x15d269[_0xc53e('0x62')]+'\x20');_0x5253b1+=_0x15d269['rules'][_0x208c17]['group']?_0x590fb6(_0x15d269[_0xc53e('0x61')][_0x208c17]['group']):_0x15d269[_0xc53e('0x61')][_0x208c17]['field']+'\x20'+_0x15d269[_0xc53e('0x61')][_0x208c17][_0xc53e('0x88')]+(_0x227e0c(_0x15d269[_0xc53e('0x61')][_0x208c17][_0xc53e('0x88')])?'\x20'+_0x15d269[_0xc53e('0x61')][_0x208c17]['value']:'');}return _0x5253b1+')';};var _0x2f5d22={'where':{'id':_0x265292[_0xc53e('0x44')]['id']}},_0x478e57,_0x5e427a,_0x3e666b,_0x365a98,_0x375d8b;_0x2f5d22=_[_0xc53e('0x40')]({},_0x2f5d22,_0x265292[_0xc53e('0x46')]);return db[_0xc53e('0x43')][_0xc53e('0x47')](_0x2f5d22)[_0xc53e('0x26')](function(_0x3b778b){if(_0x3b778b){_0x478e57=_0x3b778b;return _0x3b778b[_0xc53e('0x66')]();}return null;})[_0xc53e('0x26')](function(_0x55581a){if(_0x55581a){if(!_0x55581a[_0xc53e('0x3a')]){throw new db[(_0xc53e('0x89'))][(_0xc53e('0xa4'))](_0xc53e('0x67'),0x193);}_0x5e427a=_0x55581a;return db[_0xc53e('0x68')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x34c717){if(_0x34c717){_0x3e666b=_[_0xc53e('0x6a')](_0x34c717,'id');var _0x2718fe;var _0x15014e=squel[_0xc53e('0x6b')]();_0x15014e[_0xc53e('0x6c')](_0x478e57[_0xc53e('0x6d')]);for(var _0x2d80f5=0x0;_0x2d80f5<_0x5e427a[_0xc53e('0x3a')];_0x2d80f5+=0x1){_0x2718fe=_0x5e427a[_0x2d80f5][_0xc53e('0x6e')]?_0x3e666b[_0x5e427a[_0x2d80f5][_0xc53e('0x6e')]][_0xc53e('0x6f')]:_0x5e427a[_0x2d80f5][_0xc53e('0x64')];_0x2718fe=_0x5e427a[_0x2d80f5]['function']?_[_0xc53e('0x72')](_0xbc960[_0x5e427a[_0x2d80f5][_0xc53e('0x70')]],'%s',_0x2718fe):_0x2718fe;_0x2718fe=_0x5e427a[_0x2d80f5]['format']?_[_0xc53e('0x72')](_0x34cb12[_0x5e427a[_0x2d80f5][_0xc53e('0x71')]],'%s',_0x2718fe):_0x2718fe;if(_0x5e427a[_0x2d80f5][_0xc53e('0x8a')]){_0x15014e['group'](_0x2718fe);}_0x5e427a[_0x2d80f5]['orderBy']&&_0x15014e[_0xc53e('0x3c')](_0x2718fe,_0x5e427a[_0x2d80f5][_0xc53e('0x73')]===_0xc53e('0x74')?![]:!![]);_0x15014e[_0xc53e('0x64')](_0x2718fe,_0x5e427a[_0x2d80f5]['alias']||_0x2718fe);}if(_0x478e57[_0xc53e('0x76')]){_0x478e57[_0xc53e('0x76')]=JSON[_0xc53e('0x7b')](_0x478e57['joins']);for(var _0x48d301=0x0;_0x48d301<_0x478e57[_0xc53e('0x76')][_0xc53e('0x3a')];_0x48d301+=0x1){if(_0x478e57[_0xc53e('0x76')][_0x48d301]['type']&&_[_0xc53e('0x5c')](_0x51f2a4,_0x478e57[_0xc53e('0x76')][_0x48d301]['type'])&&_0x478e57[_0xc53e('0x76')][_0x48d301][_0xc53e('0x77')]&&_0x478e57[_0xc53e('0x76')][_0x48d301][_0xc53e('0x78')]&&_0x478e57[_0xc53e('0x76')][_0x48d301]['foreignKey']){_0x15014e[_0x478e57[_0xc53e('0x76')][_0x48d301][_0xc53e('0x41')]](_0x478e57[_0xc53e('0x76')][_0x48d301]['foreignTable'],null,util['format'](_0xc53e('0x79'),_0x478e57[_0xc53e('0x6d')],_0x478e57[_0xc53e('0x76')][_0x48d301][_0xc53e('0x77')],_0x478e57[_0xc53e('0x76')][_0x48d301]['foreignTable'],_0x478e57[_0xc53e('0x76')][_0x48d301]['foreignKey']));}}}if(_0x478e57[_0xc53e('0x7a')]){_0x478e57[_0xc53e('0x7a')]=JSON[_0xc53e('0x7b')](_0x478e57[_0xc53e('0x7a')]);_0x15014e[_0xc53e('0x3e')](_0x590fb6(_0x478e57[_0xc53e('0x7a')][_0xc53e('0x63')]));}_0x375d8b=_0x15014e[_0xc53e('0x7c')]();_0x15014e[_0xc53e('0x1f')](_0x383f22);_0x15014e['offset'](0x0);logger[_0xc53e('0x7d')](_0xc53e('0x7e'),_0x15014e[_0xc53e('0x80')]());return dbH[_0xc53e('0x7f')][_0xc53e('0x34')](_0x15014e[_0xc53e('0x80')](),{'type':dbH['sequelize'][_0xc53e('0x81')][_0xc53e('0x9f')]});}})[_0xc53e('0x26')](function(){return{'sql':_0x375d8b[_0xc53e('0x80')]()};})[_0xc53e('0x26')](respondWithResult(_0x2c776c,null))[_0xc53e('0x51')](handleError(_0x2c776c,null));};
\ No newline at end of file
index 042449a..b4caf85 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeb6a=['bluebird','path','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','analytics_default_reports','lodash','util','moment'];(function(_0x14720a,_0x256276){var _0x28f027=function(_0x4e9dd9){while(--_0x4e9dd9){_0x14720a['push'](_0x14720a['shift']());}};_0x28f027(++_0x256276);}(_0xeb6a,0x1a1));var _0xaeb6=function(_0x37e52e,_0x26c1be){_0x37e52e=_0x37e52e-0x0;var _0x527954=_0xeb6a[_0x37e52e];return _0x527954;};'use strict';var _=require(_0xaeb6('0x0'));var util=require(_0xaeb6('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xaeb6('0x2'));var BPromise=require(_0xaeb6('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xaeb6('0x4'));var rimraf=require(_0xaeb6('0x5'));var config=require(_0xaeb6('0x6'));var attributes=require(_0xaeb6('0x7'));module[_0xaeb6('0x8')]=function(_0x27d267,_0xcabb5f){return _0x27d267[_0xaeb6('0x9')](_0xaeb6('0xa'),attributes,{'tableName':_0xaeb6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3719=['path','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','define','analytics_default_reports','lodash','api','moment','bluebird','request-promise'];(function(_0x1240be,_0x4a000d){var _0x3b59d0=function(_0x3aa5b8){while(--_0x3aa5b8){_0x1240be['push'](_0x1240be['shift']());}};_0x3b59d0(++_0x4a000d);}(_0x3719,0xeb));var _0x9371=function(_0x4cda78,_0x35e3fd){_0x4cda78=_0x4cda78-0x0;var _0x17e662=_0x3719[_0x4cda78];return _0x17e662;};'use strict';var _=require(_0x9371('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x9371('0x1'));var moment=require(_0x9371('0x2'));var BPromise=require(_0x9371('0x3'));var rp=require(_0x9371('0x4'));var fs=require('fs');var path=require(_0x9371('0x5'));var rimraf=require(_0x9371('0x6'));var config=require(_0x9371('0x7'));var attributes=require(_0x9371('0x8'));module[_0x9371('0x9')]=function(_0x590ddb,_0x35e3fb){return _0x590ddb[_0x9371('0xa')]('AnalyticDefaultReport',attributes,{'tableName':_0x9371('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index b00d7c1..50a0728 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb232=['rpc','../../config/environment','jayson/promise','request','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x588011,_0x5e9d11){var _0x3b3773=function(_0x4cca54){while(--_0x4cca54){_0x588011['push'](_0x588011['shift']());}};_0x3b3773(++_0x5e9d11);}(_0xb232,0x1c3));var _0x2b23=function(_0x3005d5,_0xf588c7){_0x3005d5=_0x3005d5-0x0;var _0x547c7e=_0xb232[_0x3005d5];return _0x547c7e;};'use strict';var _=require(_0x2b23('0x0'));var util=require(_0x2b23('0x1'));var moment=require(_0x2b23('0x2'));var BPromise=require(_0x2b23('0x3'));var rs=require(_0x2b23('0x4'));var fs=require('fs');var Redis=require(_0x2b23('0x5'));var db=require(_0x2b23('0x6'))['db'];var utils=require(_0x2b23('0x7'));var logger=require(_0x2b23('0x8'))(_0x2b23('0x9'));var config=require(_0x2b23('0xa'));var jayson=require(_0x2b23('0xb'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x11bc51,_0x3f2fc7,_0x302ea1){return new BPromise(function(_0x56c2cd,_0x21a4bd){return client[_0x2b23('0xc')](_0x11bc51,_0x302ea1)['then'](function(_0x20f66b){logger['info'](_0x2b23('0xd'),_0x3f2fc7,_0x2b23('0xe'));logger[_0x2b23('0xf')](_0x2b23('0x10'),_0x3f2fc7,_0x2b23('0xe'),JSON[_0x2b23('0x11')](_0x20f66b));if(_0x20f66b['error']){if(_0x20f66b[_0x2b23('0x12')][_0x2b23('0x13')]===0x1f4){logger[_0x2b23('0x12')](_0x2b23('0xd'),_0x3f2fc7,_0x20f66b[_0x2b23('0x12')]['message']);return _0x21a4bd(_0x20f66b[_0x2b23('0x12')][_0x2b23('0x14')]);}logger[_0x2b23('0x12')](_0x2b23('0xd'),_0x3f2fc7,_0x20f66b[_0x2b23('0x12')][_0x2b23('0x14')]);return _0x56c2cd(_0x20f66b[_0x2b23('0x12')][_0x2b23('0x14')]);}else{logger['info'](_0x2b23('0xd'),_0x3f2fc7,_0x2b23('0xe'));_0x56c2cd(_0x20f66b[_0x2b23('0x15')][_0x2b23('0x14')]);}})[_0x2b23('0x16')](function(_0x21ec85){logger[_0x2b23('0x12')](_0x2b23('0xd'),_0x3f2fc7,_0x21ec85);_0x21a4bd(_0x21ec85);});});}
\ No newline at end of file
+var _0x8a76=['../../config/environment','client','http','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x26ba1b,_0x275f28){var _0xb0d3f1=function(_0x57ef8f){while(--_0x57ef8f){_0x26ba1b['push'](_0x26ba1b['shift']());}};_0xb0d3f1(++_0x275f28);}(_0x8a76,0x92));var _0x68a7=function(_0x13fab8,_0x40c642){_0x13fab8=_0x13fab8-0x0;var _0x112129=_0x8a76[_0x13fab8];return _0x112129;};'use strict';var _=require(_0x68a7('0x0'));var util=require('util');var moment=require(_0x68a7('0x1'));var BPromise=require(_0x68a7('0x2'));var rs=require(_0x68a7('0x3'));var fs=require('fs');var Redis=require(_0x68a7('0x4'));var db=require(_0x68a7('0x5'))['db'];var utils=require(_0x68a7('0x6'));var logger=require(_0x68a7('0x7'))('rpc');var config=require(_0x68a7('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x68a7('0x9')][_0x68a7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1fb442,_0x17c3ed,_0x1aaeac){return new BPromise(function(_0x5d431e,_0xc93778){return client[_0x68a7('0xb')](_0x1fb442,_0x1aaeac)[_0x68a7('0xc')](function(_0x33094c){logger[_0x68a7('0xd')](_0x68a7('0xe'),_0x17c3ed,'request\x20sent');logger[_0x68a7('0xf')](_0x68a7('0x10'),_0x17c3ed,_0x68a7('0x11'),JSON[_0x68a7('0x12')](_0x33094c));if(_0x33094c['error']){if(_0x33094c['error']['code']===0x1f4){logger[_0x68a7('0x13')](_0x68a7('0xe'),_0x17c3ed,_0x33094c[_0x68a7('0x13')]['message']);return _0xc93778(_0x33094c['error'][_0x68a7('0x14')]);}logger[_0x68a7('0x13')](_0x68a7('0xe'),_0x17c3ed,_0x33094c[_0x68a7('0x13')]['message']);return _0x5d431e(_0x33094c['error'][_0x68a7('0x14')]);}else{logger[_0x68a7('0xd')](_0x68a7('0xe'),_0x17c3ed,_0x68a7('0x11'));_0x5d431e(_0x33094c['result']['message']);}})[_0x68a7('0x15')](function(_0x206795){logger[_0x68a7('0x13')](_0x68a7('0xe'),_0x17c3ed,_0x206795);_0xc93778(_0x206795);});});}
\ No newline at end of file
index be51d38..2753ba3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb145=['/:id','show','/:id/preview','preview','run','/:id/query','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticDefaultReport.controller','get','isAuthenticated','index'];(function(_0x2f3263,_0x271612){var _0x59f249=function(_0x225d49){while(--_0x225d49){_0x2f3263['push'](_0x2f3263['shift']());}};_0x59f249(++_0x271612);}(_0xb145,0xa3));var _0x5b14=function(_0x26ab8e,_0x225df0){_0x26ab8e=_0x26ab8e-0x0;var _0x3eac4e=_0xb145[_0x26ab8e];return _0x3eac4e;};'use strict';var multer=require('multer');var util=require(_0x5b14('0x0'));var path=require(_0x5b14('0x1'));var timeout=require(_0x5b14('0x2'));var express=require(_0x5b14('0x3'));var router=express[_0x5b14('0x4')]();var fs_extra=require(_0x5b14('0x5'));var auth=require(_0x5b14('0x6'));var interaction=require(_0x5b14('0x7'));var config=require('../../config/environment');var controller=require(_0x5b14('0x8'));router[_0x5b14('0x9')]('/',auth[_0x5b14('0xa')](),controller[_0x5b14('0xb')]);router['get'](_0x5b14('0xc'),auth[_0x5b14('0xa')](),controller[_0x5b14('0xd')]);router[_0x5b14('0x9')](_0x5b14('0xe'),auth['isAuthenticated'](),controller[_0x5b14('0xf')]);router[_0x5b14('0x9')]('/:id/run',auth[_0x5b14('0xa')](),controller[_0x5b14('0x10')]);router[_0x5b14('0x9')](_0x5b14('0x11'),auth[_0x5b14('0xa')](),controller['query']);router[_0x5b14('0x12')]('/',auth['isAuthenticated'](),controller[_0x5b14('0x13')]);router[_0x5b14('0x14')](_0x5b14('0xc'),auth[_0x5b14('0xa')](),controller[_0x5b14('0x15')]);router[_0x5b14('0x16')]('/:id',auth[_0x5b14('0xa')](),controller[_0x5b14('0x17')]);module[_0x5b14('0x18')]=router;
\ No newline at end of file
+var _0x2d95=['../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview','preview','run','/:id/query','query','create','put','delete','destroy','exports','multer','path','express','Router','fs-extra'];(function(_0xa4c503,_0x5ae5c2){var _0x32716d=function(_0x5e1103){while(--_0x5e1103){_0xa4c503['push'](_0xa4c503['shift']());}};_0x32716d(++_0x5ae5c2);}(_0x2d95,0xca));var _0x52d9=function(_0x353a32,_0x5779d4){_0x353a32=_0x353a32-0x0;var _0x1c6aab=_0x2d95[_0x353a32];return _0x1c6aab;};'use strict';var multer=require(_0x52d9('0x0'));var util=require('util');var path=require(_0x52d9('0x1'));var timeout=require('connect-timeout');var express=require(_0x52d9('0x2'));var router=express[_0x52d9('0x3')]();var fs_extra=require(_0x52d9('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x52d9('0x5'));var config=require(_0x52d9('0x6'));var controller=require(_0x52d9('0x7'));router[_0x52d9('0x8')]('/',auth[_0x52d9('0x9')](),controller[_0x52d9('0xa')]);router[_0x52d9('0x8')](_0x52d9('0xb'),auth[_0x52d9('0x9')](),controller[_0x52d9('0xc')]);router[_0x52d9('0x8')](_0x52d9('0xd'),auth[_0x52d9('0x9')](),controller[_0x52d9('0xe')]);router['get']('/:id/run',auth['isAuthenticated'](),controller[_0x52d9('0xf')]);router[_0x52d9('0x8')](_0x52d9('0x10'),auth[_0x52d9('0x9')](),controller[_0x52d9('0x11')]);router['post']('/',auth[_0x52d9('0x9')](),controller[_0x52d9('0x12')]);router[_0x52d9('0x13')](_0x52d9('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x52d9('0x14')](_0x52d9('0xb'),auth[_0x52d9('0x9')](),controller[_0x52d9('0x15')]);module[_0x52d9('0x16')]=router;
\ No newline at end of file
index d1a8546..4b99899 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe92f=['Loading','manual','INTEGER','UNSIGNED','moment','exports','STRING','ENUM','csv','xlsx'];(function(_0x74f2e1,_0x139340){var _0x2b832a=function(_0x52af91){while(--_0x52af91){_0x74f2e1['push'](_0x74f2e1['shift']());}};_0x2b832a(++_0x139340);}(_0xe92f,0x126));var _0xfe92=function(_0x3624a7,_0x53946c){_0x3624a7=_0x3624a7-0x0;var _0x11a6e4=_0xe92f[_0x3624a7];return _0x11a6e4;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xfe92('0x0'));module[_0xfe92('0x1')]={'name':{'type':Sequelize[_0xfe92('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0xfe92('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0xfe92('0x3')](_0xfe92('0x4'),'pdf',_0xfe92('0x5')),'allowNull':![],'defaultValue':_0xfe92('0x4')},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize['STRING'],'defaultValue':_0xfe92('0x6')},'type':{'type':Sequelize['ENUM']('manual','scheduled'),'allowNull':![],'defaultValue':_0xfe92('0x7')},'reportId':{'type':Sequelize[_0xfe92('0x8')](0xb)[_0xfe92('0x9')]},'reportType':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xadaf=['scheduled','INTEGER','UNSIGNED','exports','STRING','ENUM','csv','pdf','xlsx','DATE','Loading'];(function(_0x2cdebc,_0x437797){var _0x306326=function(_0x4529d5){while(--_0x4529d5){_0x2cdebc['push'](_0x2cdebc['shift']());}};_0x306326(++_0x437797);}(_0xadaf,0x179));var _0xfada=function(_0x4b328a,_0x3be393){_0x4b328a=_0x4b328a-0x0;var _0x4ce14d=_0xadaf[_0x4b328a];return _0x4ce14d;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0xfada('0x0')]={'name':{'type':Sequelize[_0xfada('0x1')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0xfada('0x2')](_0xfada('0x3'),_0xfada('0x4'),_0xfada('0x5')),'allowNull':![],'defaultValue':_0xfada('0x3')},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize[_0xfada('0x6')]},'status':{'type':Sequelize[_0xfada('0x1')],'defaultValue':_0xfada('0x7')},'type':{'type':Sequelize['ENUM']('manual',_0xfada('0x8')),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize[_0xfada('0x9')](0xb)[_0xfada('0xa')]},'reportType':{'type':Sequelize['STRING']}};
\ No newline at end of file
index afcd937..12c94c0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4cc1=['options','includeAll','include','rows','catch','length','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','find','params','download','basename','savename','output','root','server/files/reports','Sequelize','ValidationError','exists','join','format','%s.%s','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','count','set','Content-Range','apply','save','then','destroy','get','ExtractedReports','UserProfileResource','end','error','stack','name','send','index','map','AnalyticExtractedReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','merge'];(function(_0x1d7e5a,_0x1a9680){var _0x29a3be=function(_0x4618c1){while(--_0x4618c1){_0x1d7e5a['push'](_0x1d7e5a['shift']());}};_0x29a3be(++_0x1a9680);}(_0x4cc1,0x196));var _0x14cc=function(_0x54813d,_0x101c1f){_0x54813d=_0x54813d-0x0;var _0x561eea=_0x4cc1[_0x54813d];return _0x561eea;};'use strict';var emlformat=require(_0x14cc('0x0'));var rimraf=require(_0x14cc('0x1'));var zipdir=require(_0x14cc('0x2'));var jsonpatch=require(_0x14cc('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x14cc('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x14cc('0x5'));var sox=require(_0x14cc('0x6'));var csv=require(_0x14cc('0x7'));var ejs=require(_0x14cc('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x14cc('0x9'));var squel=require(_0x14cc('0xa'));var crypto=require(_0x14cc('0xb'));var jsforce=require(_0x14cc('0xc'));var deskjs=require(_0x14cc('0xd'));var toCsv=require(_0x14cc('0x7'));var querystring=require('querystring');var Papa=require(_0x14cc('0xe'));var Redis=require(_0x14cc('0xf'));var authService=require(_0x14cc('0x10'));var qs=require(_0x14cc('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x14cc('0x12'));var logger=require(_0x14cc('0x13'))(_0x14cc('0x14'));var utils=require(_0x14cc('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x14cc('0x16'));var db=require(_0x14cc('0x17'))['db'];function respondWithStatusCode(_0x5ac9c3,_0x16cd3c){_0x16cd3c=_0x16cd3c||0xcc;return function(_0xd84bed){if(_0xd84bed){return _0x5ac9c3[_0x14cc('0x18')](_0x16cd3c);}return _0x5ac9c3[_0x14cc('0x19')](_0x16cd3c)['end']();};}function respondWithResult(_0x156832,_0x768534){_0x768534=_0x768534||0xc8;return function(_0x26028b){if(_0x26028b){return _0x156832[_0x14cc('0x19')](_0x768534)[_0x14cc('0x1a')](_0x26028b);}};}function respondWithFilteredResult(_0x33aa5e,_0x4fac10){return function(_0x392976){if(_0x392976){var _0x3ca904=typeof _0x4fac10[_0x14cc('0x1b')]==='undefined'&&typeof _0x4fac10[_0x14cc('0x1c')]==='undefined';var _0x2a389c=_0x392976['count'];var _0x16636c=_0x3ca904?0x0:_0x4fac10[_0x14cc('0x1b')];var _0x5c4ea0=_0x3ca904?_0x392976[_0x14cc('0x1d')]:_0x4fac10[_0x14cc('0x1b')]+_0x4fac10['limit'];var _0x51ed82;if(_0x5c4ea0>=_0x2a389c){_0x5c4ea0=_0x2a389c;_0x51ed82=0xc8;}else{_0x51ed82=0xce;}_0x33aa5e[_0x14cc('0x19')](_0x51ed82);return _0x33aa5e[_0x14cc('0x1e')](_0x14cc('0x1f'),_0x16636c+'-'+_0x5c4ea0+'/'+_0x2a389c)[_0x14cc('0x1a')](_0x392976);}return null;};}function patchUpdates(_0x367b77){return function(_0x3b53bd){try{jsonpatch[_0x14cc('0x20')](_0x3b53bd,_0x367b77,!![]);}catch(_0x4db871){return BPromise['reject'](_0x4db871);}return _0x3b53bd[_0x14cc('0x21')]();};}function saveUpdates(_0x10f95f,_0x31151f){return function(_0x583af9){if(_0x583af9){return _0x583af9['update'](_0x10f95f)[_0x14cc('0x22')](function(_0x1e4243){return _0x1e4243;});}return null;};}function removeEntity(_0x4d17e1,_0x3df23c){return function(_0x5db9da){if(_0x5db9da){return _0x5db9da[_0x14cc('0x23')]()['then'](function(){var _0xae60db=_0x5db9da[_0x14cc('0x24')]({'plain':!![]});var _0x40e2a1=_0x14cc('0x25');return db[_0x14cc('0x26')][_0x14cc('0x23')]({'where':{'type':_0x40e2a1,'resourceId':_0xae60db['id']}})[_0x14cc('0x22')](function(){return _0x5db9da;});})[_0x14cc('0x22')](function(){_0x4d17e1['status'](0xcc)[_0x14cc('0x27')]();});}};}function handleEntityNotFound(_0x2b1d41,_0x5ecf13){return function(_0x2ae3ce){if(!_0x2ae3ce){_0x2b1d41['sendStatus'](0x194);}return _0x2ae3ce;};}function handleError(_0x4c74d3,_0x4ea0e3){_0x4ea0e3=_0x4ea0e3||0x1f4;return function(_0x2add39){logger[_0x14cc('0x28')](_0x2add39[_0x14cc('0x29')]);if(_0x2add39[_0x14cc('0x2a')]){delete _0x2add39[_0x14cc('0x2a')];}_0x4c74d3['status'](_0x4ea0e3)[_0x14cc('0x2b')](_0x2add39);};}exports[_0x14cc('0x2c')]=function(_0x46d0ac,_0x1bbabb){var _0x4d308e={},_0x4c6b69={},_0x486316={'count':0x0,'rows':[]};var _0x101d95=_[_0x14cc('0x2d')](db[_0x14cc('0x2e')][_0x14cc('0x2f')],function(_0x138567){return{'name':_0x138567['fieldName'],'type':_0x138567[_0x14cc('0x30')][_0x14cc('0x31')]};});_0x4c6b69[_0x14cc('0x32')]=_['map'](_0x101d95,'name');_0x4c6b69[_0x14cc('0x33')]=_[_0x14cc('0x34')](_0x46d0ac['query']);_0x4c6b69[_0x14cc('0x35')]=_[_0x14cc('0x36')](_0x4c6b69['model'],_0x4c6b69[_0x14cc('0x33')]);_0x4d308e[_0x14cc('0x37')]=_[_0x14cc('0x36')](_0x4c6b69[_0x14cc('0x32')],qs['fields'](_0x46d0ac[_0x14cc('0x33')][_0x14cc('0x38')]));_0x4d308e[_0x14cc('0x37')]=_0x4d308e[_0x14cc('0x37')]['length']?_0x4d308e[_0x14cc('0x37')]:_0x4c6b69[_0x14cc('0x32')];if(!_0x46d0ac[_0x14cc('0x33')]['hasOwnProperty'](_0x14cc('0x39'))){_0x4d308e[_0x14cc('0x1c')]=qs[_0x14cc('0x1c')](_0x46d0ac[_0x14cc('0x33')][_0x14cc('0x1c')]);_0x4d308e[_0x14cc('0x1b')]=qs[_0x14cc('0x1b')](_0x46d0ac[_0x14cc('0x33')][_0x14cc('0x1b')]);}_0x4d308e[_0x14cc('0x3a')]=qs['sort'](_0x46d0ac[_0x14cc('0x33')][_0x14cc('0x3b')]);_0x4d308e[_0x14cc('0x3c')]=qs['filters'](_[_0x14cc('0x3d')](_0x46d0ac['query'],_0x4c6b69[_0x14cc('0x35')]),_0x101d95);if(_0x46d0ac['query'][_0x14cc('0x3e')]){_0x4d308e['where']=_['merge'](_0x4d308e['where'],{'$or':_[_0x14cc('0x2d')](_0x101d95,function(_0x50f2db){if(_0x50f2db[_0x14cc('0x30')]!=='VIRTUAL'){var _0x44eee2={};_0x44eee2[_0x50f2db['name']]={'$like':'%'+_0x46d0ac[_0x14cc('0x33')][_0x14cc('0x3e')]+'%'};return _0x44eee2;}})});}_0x4d308e=_[_0x14cc('0x3f')]({},_0x4d308e,_0x46d0ac[_0x14cc('0x40')]);var _0x438a6e={'where':_0x4d308e[_0x14cc('0x3c')]};return db[_0x14cc('0x2e')][_0x14cc('0x1d')](_0x438a6e)[_0x14cc('0x22')](function(_0x51995e){_0x486316[_0x14cc('0x1d')]=_0x51995e;if(_0x46d0ac['query'][_0x14cc('0x41')]){_0x4d308e[_0x14cc('0x42')]=[{'all':!![]}];}return db[_0x14cc('0x2e')]['findAll'](_0x4d308e);})[_0x14cc('0x22')](function(_0x5ca270){_0x486316[_0x14cc('0x43')]=_0x5ca270;return _0x486316;})[_0x14cc('0x22')](respondWithFilteredResult(_0x1bbabb,_0x4d308e))[_0x14cc('0x44')](handleError(_0x1bbabb,null));};exports['show']=function(_0x94eb87,_0x486ddb){var _0x443b28={'raw':!![],'where':{'id':_0x94eb87['params']['id']}},_0x5f1e7c={};_0x5f1e7c[_0x14cc('0x32')]=_[_0x14cc('0x34')](db[_0x14cc('0x2e')][_0x14cc('0x2f')]);_0x5f1e7c[_0x14cc('0x33')]=_[_0x14cc('0x34')](_0x94eb87[_0x14cc('0x33')]);_0x5f1e7c[_0x14cc('0x35')]=_['intersection'](_0x5f1e7c[_0x14cc('0x32')],_0x5f1e7c[_0x14cc('0x33')]);_0x443b28[_0x14cc('0x37')]=_[_0x14cc('0x36')](_0x5f1e7c[_0x14cc('0x32')],qs[_0x14cc('0x38')](_0x94eb87[_0x14cc('0x33')]['fields']));_0x443b28[_0x14cc('0x37')]=_0x443b28[_0x14cc('0x37')][_0x14cc('0x45')]?_0x443b28[_0x14cc('0x37')]:_0x5f1e7c[_0x14cc('0x32')];if(_0x94eb87[_0x14cc('0x33')][_0x14cc('0x41')]){_0x443b28[_0x14cc('0x42')]=[{'all':!![]}];}_0x443b28=_['merge']({},_0x443b28,_0x94eb87['options']);return db[_0x14cc('0x2e')]['find'](_0x443b28)[_0x14cc('0x22')](handleEntityNotFound(_0x486ddb,null))['then'](respondWithResult(_0x486ddb,null))[_0x14cc('0x44')](handleError(_0x486ddb,null));};exports['create']=function(_0x34fa5b,_0x4f3550){return db['AnalyticExtractedReport'][_0x14cc('0x46')](_0x34fa5b[_0x14cc('0x47')],{})[_0x14cc('0x22')](function(_0x333f8c){var _0x2a2bdb=_0x34fa5b[_0x14cc('0x48')][_0x14cc('0x24')]({'plain':!![]});if(!_0x2a2bdb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2a2bdb[_0x14cc('0x49')]===_0x14cc('0x48')){var _0x3d8e6a=_0x333f8c[_0x14cc('0x24')]({'plain':!![]});var _0x3d966c=_0x14cc('0x25');return db[_0x14cc('0x4a')]['find']({'where':{'name':_0x3d966c,'userProfileId':_0x2a2bdb[_0x14cc('0x4b')]},'raw':!![]})[_0x14cc('0x22')](function(_0x5ad8ba){if(_0x5ad8ba&&_0x5ad8ba[_0x14cc('0x4c')]===0x0){return db[_0x14cc('0x26')][_0x14cc('0x46')]({'name':_0x3d8e6a[_0x14cc('0x2a')],'resourceId':_0x3d8e6a['id'],'type':_0x5ad8ba[_0x14cc('0x2a')],'sectionId':_0x5ad8ba['id']},{})[_0x14cc('0x22')](function(){return _0x333f8c;});}else{return _0x333f8c;}})['catch'](function(_0x4e9892){logger['error'](_0x14cc('0x4d'),_0x4e9892);throw _0x4e9892;});}return _0x333f8c;})[_0x14cc('0x22')](respondWithResult(_0x4f3550,0xc9))[_0x14cc('0x44')](handleError(_0x4f3550,null));};exports[_0x14cc('0x4e')]=function(_0x3c76c4,_0x54f1c0){if(_0x3c76c4[_0x14cc('0x47')]['id']){delete _0x3c76c4['body']['id'];}return db['AnalyticExtractedReport']['find']({'where':{'id':_0x3c76c4['params']['id']}})[_0x14cc('0x22')](handleEntityNotFound(_0x54f1c0,null))[_0x14cc('0x22')](saveUpdates(_0x3c76c4[_0x14cc('0x47')],null))['then'](respondWithResult(_0x54f1c0,null))[_0x14cc('0x44')](handleError(_0x54f1c0,null));};exports['destroy']=function(_0x3ca781,_0x3cad5c){return db[_0x14cc('0x2e')][_0x14cc('0x4f')]({'where':{'id':_0x3ca781[_0x14cc('0x50')]['id']}})[_0x14cc('0x22')](handleEntityNotFound(_0x3cad5c,null))[_0x14cc('0x22')](removeEntity(_0x3cad5c,null))['catch'](handleError(_0x3cad5c,null));};exports[_0x14cc('0x51')]=function(_0x15b2ee,_0x4b12a1,_0x54df43){return db[_0x14cc('0x2e')][_0x14cc('0x4f')]({'where':{'id':_0x15b2ee[_0x14cc('0x50')]['id']},'attributes':[_0x14cc('0x2a'),_0x14cc('0x52'),_0x14cc('0x53'),_0x14cc('0x54')],'raw':!![]})[_0x14cc('0x22')](handleEntityNotFound(_0x4b12a1,null))['then'](function(_0x2cc4eb){if(_0x2cc4eb){if(!fs['existsSync'](path['join'](config[_0x14cc('0x55')],_0x14cc('0x56'),_0x2cc4eb[_0x14cc('0x53')]))){throw new db[(_0x14cc('0x57'))][(_0x14cc('0x58'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x15b2ee[_0x14cc('0x33')][_0x14cc('0x59')]){return _0x4b12a1[_0x14cc('0x18')](0xc8);}return _0x4b12a1[_0x14cc('0x51')](path[_0x14cc('0x5a')](config[_0x14cc('0x55')],_0x14cc('0x56'),_0x2cc4eb[_0x14cc('0x53')]),util[_0x14cc('0x5b')](_0x14cc('0x5c'),_0x2cc4eb[_0x14cc('0x52')]||_0x2cc4eb[_0x14cc('0x2a')],_0x2cc4eb[_0x14cc('0x54')][_0x14cc('0x5d')]()));}})[_0x14cc('0x44')](handleError(_0x4b12a1,null));};
\ No newline at end of file
+var _0xb266=['savename','output','existsSync','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','join','root','format','%s.%s','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','status','end','offset','undefined','limit','count','json','apply','save','update','then','destroy','get','ExtractedReports','UserProfileResource','sendStatus','stack','name','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','key','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','filter','include','rows','show','params','keys','includeAll','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','catch','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','basename'];(function(_0x82a071,_0x252266){var _0x15dda9=function(_0x3f73b0){while(--_0x3f73b0){_0x82a071['push'](_0x82a071['shift']());}};_0x15dda9(++_0x252266);}(_0xb266,0x139));var _0x6b26=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xb266[_0x122ef9];return _0x42fba0;};'use strict';var emlformat=require(_0x6b26('0x0'));var rimraf=require(_0x6b26('0x1'));var zipdir=require(_0x6b26('0x2'));var jsonpatch=require(_0x6b26('0x3'));var rp=require(_0x6b26('0x4'));var moment=require(_0x6b26('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x6b26('0x6'));var util=require('util');var path=require(_0x6b26('0x7'));var sox=require(_0x6b26('0x8'));var csv=require(_0x6b26('0x9'));var ejs=require(_0x6b26('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6b26('0xb'));var squel=require(_0x6b26('0xc'));var crypto=require(_0x6b26('0xd'));var jsforce=require(_0x6b26('0xe'));var deskjs=require(_0x6b26('0xf'));var toCsv=require('to-csv');var querystring=require(_0x6b26('0x10'));var Papa=require(_0x6b26('0x11'));var Redis=require(_0x6b26('0x12'));var authService=require(_0x6b26('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x6b26('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6b26('0x15'))(_0x6b26('0x16'));var utils=require(_0x6b26('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x6b26('0x18'))['db'];function respondWithStatusCode(_0x12e585,_0x2c9e72){_0x2c9e72=_0x2c9e72||0xcc;return function(_0x1ccf5e){if(_0x1ccf5e){return _0x12e585['sendStatus'](_0x2c9e72);}return _0x12e585[_0x6b26('0x19')](_0x2c9e72)[_0x6b26('0x1a')]();};}function respondWithResult(_0x328e32,_0x112b1b){_0x112b1b=_0x112b1b||0xc8;return function(_0x33b728){if(_0x33b728){return _0x328e32[_0x6b26('0x19')](_0x112b1b)['json'](_0x33b728);}};}function respondWithFilteredResult(_0x52bd45,_0x4bb838){return function(_0x4c7bb0){if(_0x4c7bb0){var _0x4a8c63=typeof _0x4bb838[_0x6b26('0x1b')]===_0x6b26('0x1c')&&typeof _0x4bb838[_0x6b26('0x1d')]===_0x6b26('0x1c');var _0x733615=_0x4c7bb0[_0x6b26('0x1e')];var _0x255b59=_0x4a8c63?0x0:_0x4bb838['offset'];var _0x56dd5d=_0x4a8c63?_0x4c7bb0[_0x6b26('0x1e')]:_0x4bb838['offset']+_0x4bb838[_0x6b26('0x1d')];var _0x4b4748;if(_0x56dd5d>=_0x733615){_0x56dd5d=_0x733615;_0x4b4748=0xc8;}else{_0x4b4748=0xce;}_0x52bd45[_0x6b26('0x19')](_0x4b4748);return _0x52bd45['set']('Content-Range',_0x255b59+'-'+_0x56dd5d+'/'+_0x733615)[_0x6b26('0x1f')](_0x4c7bb0);}return null;};}function patchUpdates(_0x3c4384){return function(_0x488f82){try{jsonpatch[_0x6b26('0x20')](_0x488f82,_0x3c4384,!![]);}catch(_0x24b94d){return BPromise['reject'](_0x24b94d);}return _0x488f82[_0x6b26('0x21')]();};}function saveUpdates(_0x39f0f3,_0x5caa6d){return function(_0x59266c){if(_0x59266c){return _0x59266c[_0x6b26('0x22')](_0x39f0f3)[_0x6b26('0x23')](function(_0x543504){return _0x543504;});}return null;};}function removeEntity(_0x164a9d,_0x194ac0){return function(_0x494c10){if(_0x494c10){return _0x494c10[_0x6b26('0x24')]()['then'](function(){var _0xc408ac=_0x494c10[_0x6b26('0x25')]({'plain':!![]});var _0x21c3c0=_0x6b26('0x26');return db[_0x6b26('0x27')][_0x6b26('0x24')]({'where':{'type':_0x21c3c0,'resourceId':_0xc408ac['id']}})[_0x6b26('0x23')](function(){return _0x494c10;});})[_0x6b26('0x23')](function(){_0x164a9d[_0x6b26('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x221677,_0x260238){return function(_0x3af961){if(!_0x3af961){_0x221677[_0x6b26('0x28')](0x194);}return _0x3af961;};}function handleError(_0x322808,_0x16aea6){_0x16aea6=_0x16aea6||0x1f4;return function(_0x1ab6d9){logger['error'](_0x1ab6d9[_0x6b26('0x29')]);if(_0x1ab6d9[_0x6b26('0x2a')]){delete _0x1ab6d9[_0x6b26('0x2a')];}_0x322808[_0x6b26('0x19')](_0x16aea6)[_0x6b26('0x2b')](_0x1ab6d9);};}exports[_0x6b26('0x2c')]=function(_0x11a3d0,_0x4f792a){var _0x50cdbf={},_0x39fa46={},_0x10295e={'count':0x0,'rows':[]};var _0xf02513=_[_0x6b26('0x2d')](db[_0x6b26('0x2e')][_0x6b26('0x2f')],function(_0x85cc87){return{'name':_0x85cc87[_0x6b26('0x30')],'type':_0x85cc87['type'][_0x6b26('0x31')]};});_0x39fa46['model']=_['map'](_0xf02513,'name');_0x39fa46[_0x6b26('0x32')]=_['keys'](_0x11a3d0[_0x6b26('0x32')]);_0x39fa46[_0x6b26('0x33')]=_['intersection'](_0x39fa46[_0x6b26('0x34')],_0x39fa46[_0x6b26('0x32')]);_0x50cdbf[_0x6b26('0x35')]=_[_0x6b26('0x36')](_0x39fa46[_0x6b26('0x34')],qs[_0x6b26('0x37')](_0x11a3d0[_0x6b26('0x32')][_0x6b26('0x37')]));_0x50cdbf[_0x6b26('0x35')]=_0x50cdbf[_0x6b26('0x35')][_0x6b26('0x38')]?_0x50cdbf[_0x6b26('0x35')]:_0x39fa46['model'];if(!_0x11a3d0['query'][_0x6b26('0x39')](_0x6b26('0x3a'))){_0x50cdbf['limit']=qs['limit'](_0x11a3d0[_0x6b26('0x32')][_0x6b26('0x1d')]);_0x50cdbf[_0x6b26('0x1b')]=qs[_0x6b26('0x1b')](_0x11a3d0['query']['offset']);}_0x50cdbf[_0x6b26('0x3b')]=qs[_0x6b26('0x3c')](_0x11a3d0['query']['sort']);_0x50cdbf[_0x6b26('0x3d')]=qs[_0x6b26('0x33')](_[_0x6b26('0x3e')](_0x11a3d0[_0x6b26('0x32')],_0x39fa46[_0x6b26('0x33')]),_0xf02513);if(_0x11a3d0['query']['filter']){_0x50cdbf[_0x6b26('0x3d')]=_[_0x6b26('0x3f')](_0x50cdbf[_0x6b26('0x3d')],{'$or':_[_0x6b26('0x2d')](_0xf02513,function(_0xbac530){if(_0xbac530[_0x6b26('0x40')]!=='VIRTUAL'){var _0x237506={};_0x237506[_0xbac530['name']]={'$like':'%'+_0x11a3d0[_0x6b26('0x32')][_0x6b26('0x41')]+'%'};return _0x237506;}})});}_0x50cdbf=_['merge']({},_0x50cdbf,_0x11a3d0['options']);var _0x33ce38={'where':_0x50cdbf[_0x6b26('0x3d')]};return db[_0x6b26('0x2e')][_0x6b26('0x1e')](_0x33ce38)[_0x6b26('0x23')](function(_0xca35b3){_0x10295e[_0x6b26('0x1e')]=_0xca35b3;if(_0x11a3d0['query']['includeAll']){_0x50cdbf[_0x6b26('0x42')]=[{'all':!![]}];}return db[_0x6b26('0x2e')]['findAll'](_0x50cdbf);})[_0x6b26('0x23')](function(_0x258f62){_0x10295e[_0x6b26('0x43')]=_0x258f62;return _0x10295e;})[_0x6b26('0x23')](respondWithFilteredResult(_0x4f792a,_0x50cdbf))['catch'](handleError(_0x4f792a,null));};exports[_0x6b26('0x44')]=function(_0x183685,_0x585d3e){var _0x103f34={'raw':!![],'where':{'id':_0x183685[_0x6b26('0x45')]['id']}},_0x4fec27={};_0x4fec27['model']=_[_0x6b26('0x46')](db[_0x6b26('0x2e')][_0x6b26('0x2f')]);_0x4fec27[_0x6b26('0x32')]=_[_0x6b26('0x46')](_0x183685[_0x6b26('0x32')]);_0x4fec27[_0x6b26('0x33')]=_[_0x6b26('0x36')](_0x4fec27[_0x6b26('0x34')],_0x4fec27[_0x6b26('0x32')]);_0x103f34[_0x6b26('0x35')]=_[_0x6b26('0x36')](_0x4fec27[_0x6b26('0x34')],qs[_0x6b26('0x37')](_0x183685[_0x6b26('0x32')]['fields']));_0x103f34[_0x6b26('0x35')]=_0x103f34[_0x6b26('0x35')]['length']?_0x103f34[_0x6b26('0x35')]:_0x4fec27[_0x6b26('0x34')];if(_0x183685[_0x6b26('0x32')][_0x6b26('0x47')]){_0x103f34['include']=[{'all':!![]}];}_0x103f34=_[_0x6b26('0x3f')]({},_0x103f34,_0x183685[_0x6b26('0x48')]);return db['AnalyticExtractedReport'][_0x6b26('0x49')](_0x103f34)[_0x6b26('0x23')](handleEntityNotFound(_0x585d3e,null))[_0x6b26('0x23')](respondWithResult(_0x585d3e,null))['catch'](handleError(_0x585d3e,null));};exports[_0x6b26('0x4a')]=function(_0x4db989,_0x2379d0){return db[_0x6b26('0x2e')][_0x6b26('0x4a')](_0x4db989[_0x6b26('0x4b')],{})['then'](function(_0x445c25){var _0x321308=_0x4db989[_0x6b26('0x4c')]['get']({'plain':!![]});if(!_0x321308)throw new Error(_0x6b26('0x4d'));if(_0x321308[_0x6b26('0x4e')]===_0x6b26('0x4c')){var _0x3eebd4=_0x445c25[_0x6b26('0x25')]({'plain':!![]});var _0x122ab2=_0x6b26('0x26');return db[_0x6b26('0x4f')][_0x6b26('0x49')]({'where':{'name':_0x122ab2,'userProfileId':_0x321308[_0x6b26('0x50')]},'raw':!![]})['then'](function(_0x13c71c){if(_0x13c71c&&_0x13c71c[_0x6b26('0x51')]===0x0){return db[_0x6b26('0x27')][_0x6b26('0x4a')]({'name':_0x3eebd4['name'],'resourceId':_0x3eebd4['id'],'type':_0x13c71c[_0x6b26('0x2a')],'sectionId':_0x13c71c['id']},{})['then'](function(){return _0x445c25;});}else{return _0x445c25;}})[_0x6b26('0x52')](function(_0xf2dd1d){logger[_0x6b26('0x53')](_0x6b26('0x54'),_0xf2dd1d);throw _0xf2dd1d;});}return _0x445c25;})[_0x6b26('0x23')](respondWithResult(_0x2379d0,0xc9))[_0x6b26('0x52')](handleError(_0x2379d0,null));};exports[_0x6b26('0x22')]=function(_0x32eaea,_0x29f649){if(_0x32eaea[_0x6b26('0x4b')]['id']){delete _0x32eaea[_0x6b26('0x4b')]['id'];}return db[_0x6b26('0x2e')][_0x6b26('0x49')]({'where':{'id':_0x32eaea['params']['id']}})[_0x6b26('0x23')](handleEntityNotFound(_0x29f649,null))['then'](saveUpdates(_0x32eaea[_0x6b26('0x4b')],null))[_0x6b26('0x23')](respondWithResult(_0x29f649,null))[_0x6b26('0x52')](handleError(_0x29f649,null));};exports[_0x6b26('0x24')]=function(_0x3d7c6d,_0x14f606){return db['AnalyticExtractedReport'][_0x6b26('0x49')]({'where':{'id':_0x3d7c6d[_0x6b26('0x45')]['id']}})['then'](handleEntityNotFound(_0x14f606,null))[_0x6b26('0x23')](removeEntity(_0x14f606,null))[_0x6b26('0x52')](handleError(_0x14f606,null));};exports[_0x6b26('0x55')]=function(_0x159369,_0x15855d,_0x3f4806){return db[_0x6b26('0x2e')][_0x6b26('0x49')]({'where':{'id':_0x159369[_0x6b26('0x45')]['id']},'attributes':[_0x6b26('0x2a'),_0x6b26('0x56'),_0x6b26('0x57'),_0x6b26('0x58')],'raw':!![]})[_0x6b26('0x23')](handleEntityNotFound(_0x15855d,null))['then'](function(_0x2e67dd){if(_0x2e67dd){if(!fs[_0x6b26('0x59')](path['join'](config['root'],_0x6b26('0x5a'),_0x2e67dd[_0x6b26('0x57')]))){throw new db[(_0x6b26('0x5b'))][(_0x6b26('0x5c'))](_0x6b26('0x5d'));}if(_0x159369['query'][_0x6b26('0x5e')]){return _0x15855d[_0x6b26('0x28')](0xc8);}return _0x15855d[_0x6b26('0x55')](path[_0x6b26('0x5f')](config[_0x6b26('0x60')],_0x6b26('0x5a'),_0x2e67dd[_0x6b26('0x57')]),util[_0x6b26('0x61')](_0x6b26('0x62'),_0x2e67dd['basename']||_0x2e67dd['name'],_0x2e67dd[_0x6b26('0x58')][_0x6b26('0x63')]()));}})[_0x6b26('0x52')](handleError(_0x15855d,null));};
\ No newline at end of file
index 67161e0..31ad0a4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x703f=['exports','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment'];(function(_0x1dc1ea,_0x44ab67){var _0x44e0e2=function(_0x415548){while(--_0x415548){_0x1dc1ea['push'](_0x1dc1ea['shift']());}};_0x44e0e2(++_0x44ab67);}(_0x703f,0x13c));var _0xf703=function(_0x1d59c1,_0x52bc80){_0x1d59c1=_0x1d59c1-0x0;var _0x3f4681=_0x703f[_0x1d59c1];return _0x3f4681;};'use strict';var _=require(_0xf703('0x0'));var util=require(_0xf703('0x1'));var logger=require(_0xf703('0x2'))(_0xf703('0x3'));var moment=require('moment');var BPromise=require(_0xf703('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf703('0x5'));var rimraf=require(_0xf703('0x6'));var config=require(_0xf703('0x7'));var attributes=require('./analyticExtractedReport.attributes');module[_0xf703('0x8')]=function(_0x1c90d4,_0xc7d461){return _0x1c90d4[_0xf703('0x9')](_0xf703('0xa'),attributes,{'tableName':_0xf703('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd1a7=['lodash','../../config/logger','api','moment','request-promise','path','rimraf','./analyticExtractedReport.attributes','define','AnalyticExtractedReport','analytics_extracted_reports'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xd1a7,0x113));var _0x7d1a=function(_0x316458,_0x588d62){_0x316458=_0x316458-0x0;var _0x213445=_0xd1a7[_0x316458];return _0x213445;};'use strict';var _=require(_0x7d1a('0x0'));var util=require('util');var logger=require(_0x7d1a('0x1'))(_0x7d1a('0x2'));var moment=require(_0x7d1a('0x3'));var BPromise=require('bluebird');var rp=require(_0x7d1a('0x4'));var fs=require('fs');var path=require(_0x7d1a('0x5'));var rimraf=require(_0x7d1a('0x6'));var config=require('../../config/environment');var attributes=require(_0x7d1a('0x7'));module['exports']=function(_0x448b69,_0x1035b3){return _0x448b69[_0x7d1a('0x8')](_0x7d1a('0x9'),attributes,{'tableName':_0x7d1a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index fcb6e81..da8fe09 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd291=['error','code','message','info','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xd291,0x1af));var _0x1d29=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xd291[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x1d29('0x0'));var util=require(_0x1d29('0x1'));var moment=require('moment');var BPromise=require(_0x1d29('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1d29('0x3'));var db=require(_0x1d29('0x4'))['db'];var utils=require(_0x1d29('0x5'));var logger=require(_0x1d29('0x6'))(_0x1d29('0x7'));var config=require(_0x1d29('0x8'));var jayson=require(_0x1d29('0x9'));var client=jayson[_0x1d29('0xa')][_0x1d29('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x24123f,_0x530254,_0x5856ad){return new BPromise(function(_0x1ca0b6,_0x25ef3d){return client[_0x1d29('0xc')](_0x24123f,_0x5856ad)[_0x1d29('0xd')](function(_0x1c023c){logger['info'](_0x1d29('0xe'),_0x530254,_0x1d29('0xf'));logger[_0x1d29('0x10')](_0x1d29('0x11'),_0x530254,_0x1d29('0xf'),JSON[_0x1d29('0x12')](_0x1c023c));if(_0x1c023c[_0x1d29('0x13')]){if(_0x1c023c[_0x1d29('0x13')][_0x1d29('0x14')]===0x1f4){logger[_0x1d29('0x13')](_0x1d29('0xe'),_0x530254,_0x1c023c[_0x1d29('0x13')][_0x1d29('0x15')]);return _0x25ef3d(_0x1c023c[_0x1d29('0x13')][_0x1d29('0x15')]);}logger[_0x1d29('0x13')](_0x1d29('0xe'),_0x530254,_0x1c023c['error'][_0x1d29('0x15')]);return _0x1ca0b6(_0x1c023c[_0x1d29('0x13')][_0x1d29('0x15')]);}else{logger[_0x1d29('0x16')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x530254,_0x1d29('0xf'));_0x1ca0b6(_0x1c023c[_0x1d29('0x17')][_0x1d29('0x15')]);}})[_0x1d29('0x18')](function(_0x31bec5){logger['error'](_0x1d29('0xe'),_0x530254,_0x31bec5);_0x25ef3d(_0x31bec5);});});}
\ No newline at end of file
+var _0x43c2=['AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info'];(function(_0x245fd8,_0x4f5262){var _0x5958a8=function(_0x42166e){while(--_0x42166e){_0x245fd8['push'](_0x245fd8['shift']());}};_0x5958a8(++_0x4f5262);}(_0x43c2,0x1a1));var _0x243c=function(_0x31ee74,_0x3f055b){_0x31ee74=_0x31ee74-0x0;var _0xe904ee=_0x43c2[_0x31ee74];return _0xe904ee;};'use strict';var _=require(_0x243c('0x0'));var util=require(_0x243c('0x1'));var moment=require(_0x243c('0x2'));var BPromise=require(_0x243c('0x3'));var rs=require(_0x243c('0x4'));var fs=require('fs');var Redis=require(_0x243c('0x5'));var db=require(_0x243c('0x6'))['db'];var utils=require(_0x243c('0x7'));var logger=require(_0x243c('0x8'))(_0x243c('0x9'));var config=require(_0x243c('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x243c('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1de96c,_0x45ef59,_0x211fe){return new BPromise(function(_0x57f579,_0x16b16b){return client[_0x243c('0xc')](_0x1de96c,_0x211fe)[_0x243c('0xd')](function(_0x58c50f){logger['info']('AnalyticExtractedReport,\x20%s,\x20%s',_0x45ef59,'request\x20sent');logger[_0x243c('0xe')](_0x243c('0xf'),_0x45ef59,'request\x20sent',JSON[_0x243c('0x10')](_0x58c50f));if(_0x58c50f[_0x243c('0x11')]){if(_0x58c50f[_0x243c('0x11')]['code']===0x1f4){logger[_0x243c('0x11')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x45ef59,_0x58c50f[_0x243c('0x11')]['message']);return _0x16b16b(_0x58c50f['error']['message']);}logger[_0x243c('0x11')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x45ef59,_0x58c50f[_0x243c('0x11')][_0x243c('0x12')]);return _0x57f579(_0x58c50f['error']['message']);}else{logger[_0x243c('0x13')](_0x243c('0x14'),_0x45ef59,_0x243c('0x15'));_0x57f579(_0x58c50f[_0x243c('0x16')][_0x243c('0x12')]);}})['catch'](function(_0x26d996){logger['error'](_0x243c('0x14'),_0x45ef59,_0x26d996);_0x16b16b(_0x26d996);});});}
\ No newline at end of file
index 27f8e85..aeeae1b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5c99=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','/:id/download','post','create','destroy','exports'];(function(_0x35d77b,_0x4e353d){var _0x292c58=function(_0x187162){while(--_0x187162){_0x35d77b['push'](_0x35d77b['shift']());}};_0x292c58(++_0x4e353d);}(_0x5c99,0x17c));var _0x95c9=function(_0x776414,_0x10d2de){_0x776414=_0x776414-0x0;var _0x7ec5f6=_0x5c99[_0x776414];return _0x7ec5f6;};'use strict';var multer=require(_0x95c9('0x0'));var util=require(_0x95c9('0x1'));var path=require(_0x95c9('0x2'));var timeout=require(_0x95c9('0x3'));var express=require(_0x95c9('0x4'));var router=express[_0x95c9('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x95c9('0x6'));var interaction=require(_0x95c9('0x7'));var config=require(_0x95c9('0x8'));var controller=require('./analyticExtractedReport.controller');router[_0x95c9('0x9')]('/',auth['isAuthenticated'](),controller[_0x95c9('0xa')]);router[_0x95c9('0x9')](_0x95c9('0xb'),auth[_0x95c9('0xc')](),controller[_0x95c9('0xd')]);router['get'](_0x95c9('0xe'),auth[_0x95c9('0xc')](),controller['download']);router[_0x95c9('0xf')]('/',auth[_0x95c9('0xc')](),controller[_0x95c9('0x10')]);router['put'](_0x95c9('0xb'),auth[_0x95c9('0xc')](),controller['update']);router['delete'](_0x95c9('0xb'),auth[_0x95c9('0xc')](),controller[_0x95c9('0x11')]);module[_0x95c9('0x12')]=router;
\ No newline at end of file
+var _0x97eb=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/download','download','post','create','update','delete','exports','multer','util','path','express','Router'];(function(_0x52d4ab,_0x5d7cdf){var _0x170deb=function(_0x38aaf5){while(--_0x38aaf5){_0x52d4ab['push'](_0x52d4ab['shift']());}};_0x170deb(++_0x5d7cdf);}(_0x97eb,0x1f3));var _0xb97e=function(_0x94f78d,_0x2a0822){_0x94f78d=_0x94f78d-0x0;var _0x4f0d4b=_0x97eb[_0x94f78d];return _0x4f0d4b;};'use strict';var multer=require(_0xb97e('0x0'));var util=require(_0xb97e('0x1'));var path=require(_0xb97e('0x2'));var timeout=require('connect-timeout');var express=require(_0xb97e('0x3'));var router=express[_0xb97e('0x4')]();var fs_extra=require(_0xb97e('0x5'));var auth=require(_0xb97e('0x6'));var interaction=require(_0xb97e('0x7'));var config=require(_0xb97e('0x8'));var controller=require('./analyticExtractedReport.controller');router[_0xb97e('0x9')]('/',auth[_0xb97e('0xa')](),controller[_0xb97e('0xb')]);router[_0xb97e('0x9')](_0xb97e('0xc'),auth['isAuthenticated'](),controller[_0xb97e('0xd')]);router[_0xb97e('0x9')](_0xb97e('0xe'),auth[_0xb97e('0xa')](),controller[_0xb97e('0xf')]);router[_0xb97e('0x10')]('/',auth[_0xb97e('0xa')](),controller[_0xb97e('0x11')]);router['put'](_0xb97e('0xc'),auth['isAuthenticated'](),controller[_0xb97e('0x12')]);router[_0xb97e('0x13')](_0xb97e('0xc'),auth[_0xb97e('0xa')](),controller['destroy']);module[_0xb97e('0x14')]=router;
\ No newline at end of file
index 1dfdb4e..6a75a6e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x443c=['exports','TEXT','STRING','BOOLEAN','sequelize'];(function(_0x2dea24,_0x2fc021){var _0x309d58=function(_0x2eb89f){while(--_0x2eb89f){_0x2dea24['push'](_0x2dea24['shift']());}};_0x309d58(++_0x2fc021);}(_0x443c,0x11c));var _0xc443=function(_0x1e03e4,_0x362f76){_0x1e03e4=_0x1e03e4-0x0;var _0x4a887e=_0x443c[_0x1e03e4];return _0x4a887e;};'use strict';var Sequelize=require(_0xc443('0x0'));module[_0xc443('0x1')]={'field':{'type':Sequelize[_0xc443('0x2')]},'alias':{'type':Sequelize[_0xc443('0x3')]},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0xc443('0x3')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize[_0xc443('0x4')],'defaultValue':![]}};
\ No newline at end of file
+var _0x79c5=['exports','TEXT','STRING','BOOLEAN'];(function(_0x223e3d,_0x584f24){var _0x414d57=function(_0x1604a5){while(--_0x1604a5){_0x223e3d['push'](_0x223e3d['shift']());}};_0x414d57(++_0x584f24);}(_0x79c5,0xdc));var _0x579c=function(_0xf2e13d,_0x424179){_0xf2e13d=_0xf2e13d-0x0;var _0x26e9a1=_0x79c5[_0xf2e13d];return _0x26e9a1;};'use strict';var Sequelize=require('sequelize');module[_0x579c('0x0')]={'field':{'type':Sequelize[_0x579c('0x1')]},'alias':{'type':Sequelize[_0x579c('0x2')]},'function':{'type':Sequelize[_0x579c('0x2')]},'format':{'type':Sequelize[_0x579c('0x2')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x579c('0x2')]},'custom':{'type':Sequelize[_0x579c('0x3')],'defaultValue':![]}};
\ No newline at end of file
index cc2ef71..cba53d7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd08a=['findOne','sequelize','transaction','CustomReportId','findAll','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','crypto','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','error','stack','name','send','index','map','AnalyticFieldReport','rawAttributes','fieldName','type','key','model','filters','query','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','options','includeAll','include','rows','catch','show','params','keys','intersection','find','create','bulkCreate','body','bulkDestroy','ids','addFields'];(function(_0x1dcac4,_0x1896f6){var _0x486fc1=function(_0x2cb7e6){while(--_0x2cb7e6){_0x1dcac4['push'](_0x1dcac4['shift']());}};_0x486fc1(++_0x1896f6);}(_0xd08a,0xf8));var _0xad08=function(_0x37ac34,_0x2db651){_0x37ac34=_0x37ac34-0x0;var _0x2cfbce=_0xd08a[_0x37ac34];return _0x2cfbce;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xad08('0x0'));var jsonpatch=require(_0xad08('0x1'));var rp=require(_0xad08('0x2'));var moment=require(_0xad08('0x3'));var BPromise=require(_0xad08('0x4'));var Mustache=require(_0xad08('0x5'));var util=require(_0xad08('0x6'));var path=require(_0xad08('0x7'));var sox=require(_0xad08('0x8'));var csv=require('to-csv');var ejs=require(_0xad08('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xad08('0xa'));var jsforce=require(_0xad08('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xad08('0xc'));var querystring=require('querystring');var Papa=require(_0xad08('0xd'));var Redis=require(_0xad08('0xe'));var authService=require(_0xad08('0xf'));var qs=require(_0xad08('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xad08('0x11'));var logger=require(_0xad08('0x12'))(_0xad08('0x13'));var utils=require(_0xad08('0x14'));var config=require(_0xad08('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xad08('0x16'))['db'];function respondWithStatusCode(_0x495bff,_0x3f34f3){_0x3f34f3=_0x3f34f3||0xcc;return function(_0x149e89){if(_0x149e89){return _0x495bff['sendStatus'](_0x3f34f3);}return _0x495bff[_0xad08('0x17')](_0x3f34f3)[_0xad08('0x18')]();};}function respondWithResult(_0x1c452b,_0x17f870){_0x17f870=_0x17f870||0xc8;return function(_0x17097e){if(_0x17097e){return _0x1c452b[_0xad08('0x17')](_0x17f870)[_0xad08('0x19')](_0x17097e);}};}function respondWithFilteredResult(_0x5374fd,_0x588c59){return function(_0x1d74fc){if(_0x1d74fc){var _0x28983e=typeof _0x588c59[_0xad08('0x1a')]===_0xad08('0x1b')&&typeof _0x588c59[_0xad08('0x1c')]===_0xad08('0x1b');var _0x4dc891=_0x1d74fc[_0xad08('0x1d')];var _0x37bd5a=_0x28983e?0x0:_0x588c59[_0xad08('0x1a')];var _0x272d7d=_0x28983e?_0x1d74fc[_0xad08('0x1d')]:_0x588c59[_0xad08('0x1a')]+_0x588c59[_0xad08('0x1c')];var _0x4a0d0f;if(_0x272d7d>=_0x4dc891){_0x272d7d=_0x4dc891;_0x4a0d0f=0xc8;}else{_0x4a0d0f=0xce;}_0x5374fd[_0xad08('0x17')](_0x4a0d0f);return _0x5374fd[_0xad08('0x1e')](_0xad08('0x1f'),_0x37bd5a+'-'+_0x272d7d+'/'+_0x4dc891)['json'](_0x1d74fc);}return null;};}function patchUpdates(_0x370318){return function(_0xb524fb){try{jsonpatch[_0xad08('0x20')](_0xb524fb,_0x370318,!![]);}catch(_0x12e59a){return BPromise['reject'](_0x12e59a);}return _0xb524fb['save']();};}function saveUpdates(_0x1c210e,_0x2a4790){return function(_0x2161de){if(_0x2161de){return _0x2161de[_0xad08('0x21')](_0x1c210e)[_0xad08('0x22')](function(_0x5e8ee1){return _0x5e8ee1;});}return null;};}function removeEntity(_0x3275a0,_0x53896e){return function(_0x59a217){if(_0x59a217){return _0x59a217[_0xad08('0x23')]()[_0xad08('0x22')](function(){_0x3275a0[_0xad08('0x17')](0xcc)[_0xad08('0x18')]();});}};}function handleEntityNotFound(_0x4a3810,_0x1b36ed){return function(_0x508709){if(!_0x508709){_0x4a3810['sendStatus'](0x194);}return _0x508709;};}function handleError(_0x5bbc46,_0x2392ae){_0x2392ae=_0x2392ae||0x1f4;return function(_0x26d537){logger[_0xad08('0x24')](_0x26d537[_0xad08('0x25')]);if(_0x26d537[_0xad08('0x26')]){delete _0x26d537[_0xad08('0x26')];}_0x5bbc46[_0xad08('0x17')](_0x2392ae)[_0xad08('0x27')](_0x26d537);};}exports[_0xad08('0x28')]=function(_0x575159,_0x59a0e6){var _0x3ae57c={},_0x5a92ce={},_0x158086={'count':0x0,'rows':[]};var _0x47c495=_[_0xad08('0x29')](db[_0xad08('0x2a')][_0xad08('0x2b')],function(_0x1581dd){return{'name':_0x1581dd[_0xad08('0x2c')],'type':_0x1581dd[_0xad08('0x2d')][_0xad08('0x2e')]};});_0x5a92ce[_0xad08('0x2f')]=_[_0xad08('0x29')](_0x47c495,_0xad08('0x26'));_0x5a92ce['query']=_['keys'](_0x575159['query']);_0x5a92ce[_0xad08('0x30')]=_['intersection'](_0x5a92ce[_0xad08('0x2f')],_0x5a92ce[_0xad08('0x31')]);_0x3ae57c['attributes']=_['intersection'](_0x5a92ce[_0xad08('0x2f')],qs['fields'](_0x575159[_0xad08('0x31')][_0xad08('0x32')]));_0x3ae57c['attributes']=_0x3ae57c[_0xad08('0x33')][_0xad08('0x34')]?_0x3ae57c[_0xad08('0x33')]:_0x5a92ce[_0xad08('0x2f')];if(!_0x575159[_0xad08('0x31')][_0xad08('0x35')](_0xad08('0x36'))){_0x3ae57c[_0xad08('0x1c')]=qs[_0xad08('0x1c')](_0x575159[_0xad08('0x31')][_0xad08('0x1c')]);_0x3ae57c[_0xad08('0x1a')]=qs[_0xad08('0x1a')](_0x575159[_0xad08('0x31')][_0xad08('0x1a')]);}_0x3ae57c['order']=qs[_0xad08('0x37')](_0x575159[_0xad08('0x31')][_0xad08('0x37')]);_0x3ae57c[_0xad08('0x38')]=qs['filters'](_[_0xad08('0x39')](_0x575159[_0xad08('0x31')],_0x5a92ce[_0xad08('0x30')]),_0x47c495);if(_0x575159['query'][_0xad08('0x3a')]){_0x3ae57c[_0xad08('0x38')]=_['merge'](_0x3ae57c[_0xad08('0x38')],{'$or':_[_0xad08('0x29')](_0x47c495,function(_0x591f8d){if(_0x591f8d[_0xad08('0x2d')]!==_0xad08('0x3b')){var _0x40fb21={};_0x40fb21[_0x591f8d[_0xad08('0x26')]]={'$like':'%'+_0x575159[_0xad08('0x31')][_0xad08('0x3a')]+'%'};return _0x40fb21;}})});}_0x3ae57c=_['merge']({},_0x3ae57c,_0x575159[_0xad08('0x3c')]);var _0x17e4b7={'where':_0x3ae57c[_0xad08('0x38')]};return db['AnalyticFieldReport'][_0xad08('0x1d')](_0x17e4b7)['then'](function(_0x267bc4){_0x158086[_0xad08('0x1d')]=_0x267bc4;if(_0x575159[_0xad08('0x31')][_0xad08('0x3d')]){_0x3ae57c[_0xad08('0x3e')]=[{'all':!![]}];}return db['AnalyticFieldReport']['findAll'](_0x3ae57c);})[_0xad08('0x22')](function(_0x2ad55e){_0x158086[_0xad08('0x3f')]=_0x2ad55e;return _0x158086;})[_0xad08('0x22')](respondWithFilteredResult(_0x59a0e6,_0x3ae57c))[_0xad08('0x40')](handleError(_0x59a0e6,null));};exports[_0xad08('0x41')]=function(_0x5b8ff1,_0x3075bb){var _0x5646fd={'raw':![],'where':{'id':_0x5b8ff1[_0xad08('0x42')]['id']}},_0x2f60b8={};_0x2f60b8[_0xad08('0x2f')]=_[_0xad08('0x43')](db[_0xad08('0x2a')][_0xad08('0x2b')]);_0x2f60b8[_0xad08('0x31')]=_[_0xad08('0x43')](_0x5b8ff1['query']);_0x2f60b8[_0xad08('0x30')]=_['intersection'](_0x2f60b8[_0xad08('0x2f')],_0x2f60b8[_0xad08('0x31')]);_0x5646fd['attributes']=_[_0xad08('0x44')](_0x2f60b8[_0xad08('0x2f')],qs[_0xad08('0x32')](_0x5b8ff1['query'][_0xad08('0x32')]));_0x5646fd[_0xad08('0x33')]=_0x5646fd[_0xad08('0x33')][_0xad08('0x34')]?_0x5646fd[_0xad08('0x33')]:_0x2f60b8[_0xad08('0x2f')];if(_0x5b8ff1[_0xad08('0x31')][_0xad08('0x3d')]){_0x5646fd['include']=[{'all':!![]}];}_0x5646fd=_['merge']({},_0x5646fd,_0x5b8ff1['options']);return db[_0xad08('0x2a')][_0xad08('0x45')](_0x5646fd)[_0xad08('0x22')](handleEntityNotFound(_0x3075bb,null))[_0xad08('0x22')](respondWithResult(_0x3075bb,null))[_0xad08('0x40')](handleError(_0x3075bb,null));};exports['create']=function(_0x5a44e5,_0x2ae7ed){return db[_0xad08('0x2a')][_0xad08('0x46')](_0x5a44e5['body'],{})[_0xad08('0x22')](respondWithResult(_0x2ae7ed,0xc9))[_0xad08('0x40')](handleError(_0x2ae7ed,null));};exports[_0xad08('0x47')]=function(_0x5c32cd,_0x412068){return db[_0xad08('0x2a')][_0xad08('0x47')](_0x5c32cd['body'],{'raw':![],'individualHooks':!![]})[_0xad08('0x22')](respondWithResult(_0x412068,0xc9))[_0xad08('0x40')](handleError(_0x412068,null));};exports[_0xad08('0x21')]=function(_0x202f66,_0x1d5567){if(_0x202f66[_0xad08('0x48')]['id']){delete _0x202f66['body']['id'];}return db[_0xad08('0x2a')][_0xad08('0x45')]({'where':{'id':_0x202f66[_0xad08('0x42')]['id']}})[_0xad08('0x22')](handleEntityNotFound(_0x1d5567,null))[_0xad08('0x22')](saveUpdates(_0x202f66[_0xad08('0x48')],null))[_0xad08('0x22')](respondWithResult(_0x1d5567,null))[_0xad08('0x40')](handleError(_0x1d5567,null));};exports[_0xad08('0x23')]=function(_0x597706,_0x53a550){return db[_0xad08('0x2a')][_0xad08('0x45')]({'where':{'id':_0x597706['params']['id']}})[_0xad08('0x22')](handleEntityNotFound(_0x53a550,null))[_0xad08('0x22')](removeEntity(_0x53a550,null))[_0xad08('0x40')](handleError(_0x53a550,null));};exports[_0xad08('0x49')]=function(_0x100f9a,_0x4a20ff){return db[_0xad08('0x2a')][_0xad08('0x23')]({'where':{'id':_0x100f9a[_0xad08('0x31')][_0xad08('0x4a')]||[]},'raw':![],'individualHooks':!![]})[_0xad08('0x22')](respondWithResult(_0x4a20ff,0xcc))[_0xad08('0x40')](handleError(_0x4a20ff,null));};exports[_0xad08('0x4b')]=function(_0x32a3e2,_0x26225f,_0x184189){return db['AnalyticCustomReport'][_0xad08('0x4c')]({'where':{'id':_0x32a3e2[_0xad08('0x42')]['id']}})['then'](handleEntityNotFound(_0x26225f,null))[_0xad08('0x22')](function(_0x30b7af){if(_0x30b7af){return db[_0xad08('0x4d')][_0xad08('0x4e')](function(_0x4f0793){return db[_0xad08('0x2a')][_0xad08('0x23')]({'where':{'CustomReportId':_0x32a3e2[_0xad08('0x42')]['id']},'transaction':_0x4f0793})['then'](function(_0x222352){var _0x197016=_[_0xad08('0x29')](_0x32a3e2[_0xad08('0x48')],function(_0x1644f){delete _0x1644f['id'];_0x1644f[_0xad08('0x4f')]=_0x32a3e2['params']['id'];return _0x1644f;});return db[_0xad08('0x2a')][_0xad08('0x47')](_0x197016,{'transaction':_0x4f0793});});})['then'](function(){return db[_0xad08('0x2a')][_0xad08('0x50')]({'where':{'CustomReportId':_0x32a3e2[_0xad08('0x42')]['id']}});});}})['then'](respondWithResult(_0x26225f,null))[_0xad08('0x40')](handleError(_0x26225f,null));};
\ No newline at end of file
+var _0xb90d=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','status','json','undefined','limit','count','offset','set','apply','reject','update','destroy','then','end','name','send','index','map','AnalyticFieldReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','include','findAll','rows','catch','show','params','includeAll','body','bulkCreate','find','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','transaction','CustomReportId','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis'];(function(_0x4220d3,_0x4341e0){var _0x3dba53=function(_0xb9c7e3){while(--_0xb9c7e3){_0x4220d3['push'](_0x4220d3['shift']());}};_0x3dba53(++_0x4341e0);}(_0xb90d,0x17a));var _0xdb90=function(_0x52a505,_0x5dec98){_0x52a505=_0x52a505-0x0;var _0x1fc95e=_0xb90d[_0x52a505];return _0x1fc95e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdb90('0x0'));var zipdir=require(_0xdb90('0x1'));var jsonpatch=require(_0xdb90('0x2'));var rp=require(_0xdb90('0x3'));var moment=require(_0xdb90('0x4'));var BPromise=require(_0xdb90('0x5'));var Mustache=require('mustache');var util=require(_0xdb90('0x6'));var path=require(_0xdb90('0x7'));var sox=require(_0xdb90('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdb90('0x9'));var _=require(_0xdb90('0xa'));var squel=require(_0xdb90('0xb'));var crypto=require(_0xdb90('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xdb90('0xd'));var toCsv=require(_0xdb90('0xe'));var querystring=require(_0xdb90('0xf'));var Papa=require('papaparse');var Redis=require(_0xdb90('0x10'));var authService=require(_0xdb90('0x11'));var qs=require(_0xdb90('0x12'));var as=require(_0xdb90('0x13'));var hardwareService=require(_0xdb90('0x14'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xdb90('0x15'));var licenseUtil=require(_0xdb90('0x16'));var db=require(_0xdb90('0x17'))['db'];function respondWithStatusCode(_0xb5ea64,_0xdc179e){_0xdc179e=_0xdc179e||0xcc;return function(_0x113659){if(_0x113659){return _0xb5ea64['sendStatus'](_0xdc179e);}return _0xb5ea64['status'](_0xdc179e)['end']();};}function respondWithResult(_0x511592,_0x569d40){_0x569d40=_0x569d40||0xc8;return function(_0x5eb6ef){if(_0x5eb6ef){return _0x511592[_0xdb90('0x18')](_0x569d40)[_0xdb90('0x19')](_0x5eb6ef);}};}function respondWithFilteredResult(_0x5b93b1,_0x19b02e){return function(_0x1cde0d){if(_0x1cde0d){var _0x4db002=typeof _0x19b02e['offset']===_0xdb90('0x1a')&&typeof _0x19b02e[_0xdb90('0x1b')]===_0xdb90('0x1a');var _0x5101e9=_0x1cde0d[_0xdb90('0x1c')];var _0x13f6df=_0x4db002?0x0:_0x19b02e[_0xdb90('0x1d')];var _0x44d4d4=_0x4db002?_0x1cde0d[_0xdb90('0x1c')]:_0x19b02e[_0xdb90('0x1d')]+_0x19b02e[_0xdb90('0x1b')];var _0x1838ed;if(_0x44d4d4>=_0x5101e9){_0x44d4d4=_0x5101e9;_0x1838ed=0xc8;}else{_0x1838ed=0xce;}_0x5b93b1[_0xdb90('0x18')](_0x1838ed);return _0x5b93b1[_0xdb90('0x1e')]('Content-Range',_0x13f6df+'-'+_0x44d4d4+'/'+_0x5101e9)['json'](_0x1cde0d);}return null;};}function patchUpdates(_0x4110c7){return function(_0x1c2dbe){try{jsonpatch[_0xdb90('0x1f')](_0x1c2dbe,_0x4110c7,!![]);}catch(_0x13f84d){return BPromise[_0xdb90('0x20')](_0x13f84d);}return _0x1c2dbe['save']();};}function saveUpdates(_0x31f9df,_0x922395){return function(_0x590e6a){if(_0x590e6a){return _0x590e6a[_0xdb90('0x21')](_0x31f9df)['then'](function(_0x185b08){return _0x185b08;});}return null;};}function removeEntity(_0x2fdb1b,_0x1fe5ab){return function(_0x463199){if(_0x463199){return _0x463199[_0xdb90('0x22')]()[_0xdb90('0x23')](function(){_0x2fdb1b[_0xdb90('0x18')](0xcc)[_0xdb90('0x24')]();});}};}function handleEntityNotFound(_0x1ef44a,_0x1fed39){return function(_0x64268c){if(!_0x64268c){_0x1ef44a['sendStatus'](0x194);}return _0x64268c;};}function handleError(_0x1a27c3,_0xedb1a6){_0xedb1a6=_0xedb1a6||0x1f4;return function(_0x3fcafd){logger['error'](_0x3fcafd['stack']);if(_0x3fcafd[_0xdb90('0x25')]){delete _0x3fcafd[_0xdb90('0x25')];}_0x1a27c3[_0xdb90('0x18')](_0xedb1a6)[_0xdb90('0x26')](_0x3fcafd);};}exports[_0xdb90('0x27')]=function(_0x321efc,_0x46f743){var _0x67aebc={},_0x554d8f={},_0x3c8671={'count':0x0,'rows':[]};var _0x204f8a=_[_0xdb90('0x28')](db[_0xdb90('0x29')][_0xdb90('0x2a')],function(_0x66ecd3){return{'name':_0x66ecd3[_0xdb90('0x2b')],'type':_0x66ecd3[_0xdb90('0x2c')][_0xdb90('0x2d')]};});_0x554d8f[_0xdb90('0x2e')]=_[_0xdb90('0x28')](_0x204f8a,_0xdb90('0x25'));_0x554d8f[_0xdb90('0x2f')]=_[_0xdb90('0x30')](_0x321efc['query']);_0x554d8f[_0xdb90('0x31')]=_[_0xdb90('0x32')](_0x554d8f[_0xdb90('0x2e')],_0x554d8f[_0xdb90('0x2f')]);_0x67aebc[_0xdb90('0x33')]=_[_0xdb90('0x32')](_0x554d8f[_0xdb90('0x2e')],qs[_0xdb90('0x34')](_0x321efc[_0xdb90('0x2f')][_0xdb90('0x34')]));_0x67aebc['attributes']=_0x67aebc[_0xdb90('0x33')][_0xdb90('0x35')]?_0x67aebc['attributes']:_0x554d8f[_0xdb90('0x2e')];if(!_0x321efc[_0xdb90('0x2f')][_0xdb90('0x36')](_0xdb90('0x37'))){_0x67aebc[_0xdb90('0x1b')]=qs['limit'](_0x321efc[_0xdb90('0x2f')][_0xdb90('0x1b')]);_0x67aebc[_0xdb90('0x1d')]=qs['offset'](_0x321efc[_0xdb90('0x2f')][_0xdb90('0x1d')]);}_0x67aebc['order']=qs[_0xdb90('0x38')](_0x321efc[_0xdb90('0x2f')][_0xdb90('0x38')]);_0x67aebc[_0xdb90('0x39')]=qs['filters'](_[_0xdb90('0x3a')](_0x321efc[_0xdb90('0x2f')],_0x554d8f['filters']),_0x204f8a);if(_0x321efc['query'][_0xdb90('0x3b')]){_0x67aebc[_0xdb90('0x39')]=_[_0xdb90('0x3c')](_0x67aebc[_0xdb90('0x39')],{'$or':_['map'](_0x204f8a,function(_0x13ae1b){if(_0x13ae1b['type']!=='VIRTUAL'){var _0x5676db={};_0x5676db[_0x13ae1b[_0xdb90('0x25')]]={'$like':'%'+_0x321efc[_0xdb90('0x2f')][_0xdb90('0x3b')]+'%'};return _0x5676db;}})});}_0x67aebc=_[_0xdb90('0x3c')]({},_0x67aebc,_0x321efc[_0xdb90('0x3d')]);var _0x57ba6b={'where':_0x67aebc[_0xdb90('0x39')]};return db['AnalyticFieldReport'][_0xdb90('0x1c')](_0x57ba6b)[_0xdb90('0x23')](function(_0x5afca9){_0x3c8671['count']=_0x5afca9;if(_0x321efc[_0xdb90('0x2f')]['includeAll']){_0x67aebc[_0xdb90('0x3e')]=[{'all':!![]}];}return db[_0xdb90('0x29')][_0xdb90('0x3f')](_0x67aebc);})['then'](function(_0x300d70){_0x3c8671[_0xdb90('0x40')]=_0x300d70;return _0x3c8671;})['then'](respondWithFilteredResult(_0x46f743,_0x67aebc))[_0xdb90('0x41')](handleError(_0x46f743,null));};exports[_0xdb90('0x42')]=function(_0x2eec66,_0x68e9e5){var _0x1e2e7f={'raw':![],'where':{'id':_0x2eec66[_0xdb90('0x43')]['id']}},_0x284342={};_0x284342[_0xdb90('0x2e')]=_['keys'](db[_0xdb90('0x29')]['rawAttributes']);_0x284342['query']=_['keys'](_0x2eec66[_0xdb90('0x2f')]);_0x284342['filters']=_['intersection'](_0x284342[_0xdb90('0x2e')],_0x284342[_0xdb90('0x2f')]);_0x1e2e7f[_0xdb90('0x33')]=_[_0xdb90('0x32')](_0x284342['model'],qs[_0xdb90('0x34')](_0x2eec66[_0xdb90('0x2f')][_0xdb90('0x34')]));_0x1e2e7f[_0xdb90('0x33')]=_0x1e2e7f[_0xdb90('0x33')][_0xdb90('0x35')]?_0x1e2e7f[_0xdb90('0x33')]:_0x284342[_0xdb90('0x2e')];if(_0x2eec66[_0xdb90('0x2f')][_0xdb90('0x44')]){_0x1e2e7f[_0xdb90('0x3e')]=[{'all':!![]}];}_0x1e2e7f=_[_0xdb90('0x3c')]({},_0x1e2e7f,_0x2eec66[_0xdb90('0x3d')]);return db['AnalyticFieldReport']['find'](_0x1e2e7f)['then'](handleEntityNotFound(_0x68e9e5,null))['then'](respondWithResult(_0x68e9e5,null))[_0xdb90('0x41')](handleError(_0x68e9e5,null));};exports['create']=function(_0x56fef9,_0x4ba023){return db[_0xdb90('0x29')]['create'](_0x56fef9[_0xdb90('0x45')],{})[_0xdb90('0x23')](respondWithResult(_0x4ba023,0xc9))[_0xdb90('0x41')](handleError(_0x4ba023,null));};exports[_0xdb90('0x46')]=function(_0x16888b,_0x21c540){return db[_0xdb90('0x29')][_0xdb90('0x46')](_0x16888b['body'],{'raw':![],'individualHooks':!![]})[_0xdb90('0x23')](respondWithResult(_0x21c540,0xc9))[_0xdb90('0x41')](handleError(_0x21c540,null));};exports['update']=function(_0x58ca62,_0x133d8b){if(_0x58ca62[_0xdb90('0x45')]['id']){delete _0x58ca62[_0xdb90('0x45')]['id'];}return db['AnalyticFieldReport'][_0xdb90('0x47')]({'where':{'id':_0x58ca62[_0xdb90('0x43')]['id']}})[_0xdb90('0x23')](handleEntityNotFound(_0x133d8b,null))[_0xdb90('0x23')](saveUpdates(_0x58ca62[_0xdb90('0x45')],null))[_0xdb90('0x23')](respondWithResult(_0x133d8b,null))[_0xdb90('0x41')](handleError(_0x133d8b,null));};exports[_0xdb90('0x22')]=function(_0x3ed260,_0x507d6e){return db[_0xdb90('0x29')][_0xdb90('0x47')]({'where':{'id':_0x3ed260['params']['id']}})['then'](handleEntityNotFound(_0x507d6e,null))['then'](removeEntity(_0x507d6e,null))[_0xdb90('0x41')](handleError(_0x507d6e,null));};exports[_0xdb90('0x48')]=function(_0x54237b,_0x57b8f4){return db[_0xdb90('0x29')][_0xdb90('0x22')]({'where':{'id':_0x54237b[_0xdb90('0x2f')][_0xdb90('0x49')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x57b8f4,0xcc))[_0xdb90('0x41')](handleError(_0x57b8f4,null));};exports[_0xdb90('0x4a')]=function(_0x507138,_0x5e7dd1,_0x37210d){return db[_0xdb90('0x4b')][_0xdb90('0x4c')]({'where':{'id':_0x507138[_0xdb90('0x43')]['id']}})[_0xdb90('0x23')](handleEntityNotFound(_0x5e7dd1,null))[_0xdb90('0x23')](function(_0x510edd){if(_0x510edd){return db['sequelize'][_0xdb90('0x4d')](function(_0x2f51d4){return db['AnalyticFieldReport'][_0xdb90('0x22')]({'where':{'CustomReportId':_0x507138[_0xdb90('0x43')]['id']},'transaction':_0x2f51d4})[_0xdb90('0x23')](function(_0x255166){var _0x5acf12=_[_0xdb90('0x28')](_0x507138['body'],function(_0x323dbb){delete _0x323dbb['id'];_0x323dbb[_0xdb90('0x4e')]=_0x507138[_0xdb90('0x43')]['id'];return _0x323dbb;});return db[_0xdb90('0x29')][_0xdb90('0x46')](_0x5acf12,{'transaction':_0x2f51d4});});})['then'](function(){return db['AnalyticFieldReport'][_0xdb90('0x3f')]({'where':{'CustomReportId':_0x507138[_0xdb90('0x43')]['id']}});});}})[_0xdb90('0x23')](respondWithResult(_0x5e7dd1,null))[_0xdb90('0x41')](handleError(_0x5e7dd1,null));};
\ No newline at end of file
index a3fe2dc..afddcd6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x193a=['analytics_report_fields','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define'];(function(_0x235501,_0x13031d){var _0x745218=function(_0x3e37e8){while(--_0x3e37e8){_0x235501['push'](_0x235501['shift']());}};_0x745218(++_0x13031d);}(_0x193a,0xd9));var _0xa193=function(_0x1e836c,_0x2da665){_0x1e836c=_0x1e836c-0x0;var _0x195f47=_0x193a[_0x1e836c];return _0x195f47;};'use strict';var _=require(_0xa193('0x0'));var util=require(_0xa193('0x1'));var logger=require(_0xa193('0x2'))(_0xa193('0x3'));var moment=require(_0xa193('0x4'));var BPromise=require(_0xa193('0x5'));var rp=require(_0xa193('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa193('0x7'));var config=require(_0xa193('0x8'));var attributes=require('./analyticFieldReport.attributes');module[_0xa193('0x9')]=function(_0xba6b9e,_0x2190b4){return _0xba6b9e[_0xa193('0xa')]('AnalyticFieldReport',attributes,{'tableName':_0xa193('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7a89=['./analyticFieldReport.attributes','exports','AnalyticFieldReport','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x375da7,_0x18765c){var _0x324c46=function(_0x56f5f0){while(--_0x56f5f0){_0x375da7['push'](_0x375da7['shift']());}};_0x324c46(++_0x18765c);}(_0x7a89,0x13b));var _0x97a8=function(_0x1ee351,_0x54261b){_0x1ee351=_0x1ee351-0x0;var _0x245aaf=_0x7a89[_0x1ee351];return _0x245aaf;};'use strict';var _=require(_0x97a8('0x0'));var util=require(_0x97a8('0x1'));var logger=require('../../config/logger')(_0x97a8('0x2'));var moment=require(_0x97a8('0x3'));var BPromise=require(_0x97a8('0x4'));var rp=require(_0x97a8('0x5'));var fs=require('fs');var path=require(_0x97a8('0x6'));var rimraf=require(_0x97a8('0x7'));var config=require(_0x97a8('0x8'));var attributes=require(_0x97a8('0x9'));module[_0x97a8('0xa')]=function(_0xd64f3c,_0x5685f8){return _0xd64f3c['define'](_0x97a8('0xb'),attributes,{'tableName':'analytics_report_fields','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index f1b6b4b..3e86861 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbd7b=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','randomstring','ioredis'];(function(_0x133277,_0xb1d6b2){var _0x5b4a22=function(_0x484c26){while(--_0x484c26){_0x133277['push'](_0x133277['shift']());}};_0x5b4a22(++_0xb1d6b2);}(_0xbd7b,0x17b));var _0xbbd7=function(_0xb347b9,_0x3c4105){_0xb347b9=_0xb347b9-0x0;var _0x40091b=_0xbd7b[_0xb347b9];return _0x40091b;};'use strict';var _=require(_0xbbd7('0x0'));var util=require(_0xbbd7('0x1'));var moment=require(_0xbbd7('0x2'));var BPromise=require('bluebird');var rs=require(_0xbbd7('0x3'));var fs=require('fs');var Redis=require(_0xbbd7('0x4'));var db=require(_0xbbd7('0x5'))['db'];var utils=require(_0xbbd7('0x6'));var logger=require(_0xbbd7('0x7'))(_0xbbd7('0x8'));var config=require('../../config/environment');var jayson=require(_0xbbd7('0x9'));var client=jayson[_0xbbd7('0xa')][_0xbbd7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x68fc99,_0x3a3012,_0x115ce3){return new BPromise(function(_0x235b1b,_0x40187b){return client[_0xbbd7('0xc')](_0x68fc99,_0x115ce3)[_0xbbd7('0xd')](function(_0x3e6ae1){logger[_0xbbd7('0xe')](_0xbbd7('0xf'),_0x3a3012,_0xbbd7('0x10'));logger[_0xbbd7('0x11')](_0xbbd7('0x12'),_0x3a3012,_0xbbd7('0x10'),JSON[_0xbbd7('0x13')](_0x3e6ae1));if(_0x3e6ae1['error']){if(_0x3e6ae1[_0xbbd7('0x14')]['code']===0x1f4){logger['error'](_0xbbd7('0xf'),_0x3a3012,_0x3e6ae1[_0xbbd7('0x14')][_0xbbd7('0x15')]);return _0x40187b(_0x3e6ae1[_0xbbd7('0x14')]['message']);}logger[_0xbbd7('0x14')](_0xbbd7('0xf'),_0x3a3012,_0x3e6ae1[_0xbbd7('0x14')][_0xbbd7('0x15')]);return _0x235b1b(_0x3e6ae1[_0xbbd7('0x14')][_0xbbd7('0x15')]);}else{logger[_0xbbd7('0xe')](_0xbbd7('0xf'),_0x3a3012,_0xbbd7('0x10'));_0x235b1b(_0x3e6ae1[_0xbbd7('0x16')][_0xbbd7('0x15')]);}})[_0xbbd7('0x17')](function(_0x5b2fde){logger[_0xbbd7('0x14')]('AnalyticFieldReport,\x20%s,\x20%s',_0x3a3012,_0x5b2fde);_0x40187b(_0x5b2fde);});});}
\ No newline at end of file
+var _0x3611=['http','then','AnalyticFieldReport,\x20%s,\x20%s','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x39e283,_0x247e6b){var _0x7de89f=function(_0x2f8c50){while(--_0x2f8c50){_0x39e283['push'](_0x39e283['shift']());}};_0x7de89f(++_0x247e6b);}(_0x3611,0xbc));var _0x1361=function(_0x3409ec,_0x1bb946){_0x3409ec=_0x3409ec-0x0;var _0x11a522=_0x3611[_0x3409ec];return _0x11a522;};'use strict';var _=require(_0x1361('0x0'));var util=require('util');var moment=require(_0x1361('0x1'));var BPromise=require(_0x1361('0x2'));var rs=require(_0x1361('0x3'));var fs=require('fs');var Redis=require(_0x1361('0x4'));var db=require(_0x1361('0x5'))['db'];var utils=require(_0x1361('0x6'));var logger=require(_0x1361('0x7'))(_0x1361('0x8'));var config=require(_0x1361('0x9'));var jayson=require(_0x1361('0xa'));var client=jayson[_0x1361('0xb')][_0x1361('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x6198b4,_0x560214,_0x2b2e22){return new BPromise(function(_0x36a5da,_0x58d67b){return client['request'](_0x6198b4,_0x2b2e22)[_0x1361('0xd')](function(_0x1e854f){logger['info'](_0x1361('0xe'),_0x560214,'request\x20sent');logger[_0x1361('0xf')](_0x1361('0x10'),_0x560214,_0x1361('0x11'),JSON[_0x1361('0x12')](_0x1e854f));if(_0x1e854f[_0x1361('0x13')]){if(_0x1e854f[_0x1361('0x13')][_0x1361('0x14')]===0x1f4){logger[_0x1361('0x13')](_0x1361('0xe'),_0x560214,_0x1e854f['error']['message']);return _0x58d67b(_0x1e854f['error'][_0x1361('0x15')]);}logger[_0x1361('0x13')](_0x1361('0xe'),_0x560214,_0x1e854f['error'][_0x1361('0x15')]);return _0x36a5da(_0x1e854f[_0x1361('0x13')][_0x1361('0x15')]);}else{logger[_0x1361('0x16')](_0x1361('0xe'),_0x560214,_0x1361('0x11'));_0x36a5da(_0x1e854f[_0x1361('0x17')]['message']);}})[_0x1361('0x18')](function(_0x1c93be){logger['error'](_0x1361('0xe'),_0x560214,_0x1c93be);_0x58d67b(_0x1c93be);});});}
\ No newline at end of file
index db4df04..c046005 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(_0x4d0cc8,_0x2787ac){var _0x49faef=function(_0x26ba10){while(--_0x26ba10){_0x4d0cc8['push'](_0x4d0cc8['shift']());}};_0x49faef(++_0x2787ac);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0xa9e0[_0x3ce3c];return _0x55a2c9;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0a9e('0xb')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xb')](_0x0a9e('0xf'),auth['isAuthenticated'](),controller['addFields']);router['put']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x14')]);module[_0x0a9e('0x15')]=router;
\ No newline at end of file
+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(_0x7f162d,_0x190ff5){var _0x2d58d8=function(_0x5a93cf){while(--_0x5a93cf){_0x7f162d['push'](_0x7f162d['shift']());}};_0x2d58d8(++_0x190ff5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xa9e0[_0x24237f];return _0x48298e;};'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 d4d5473..f5bbcb0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf69c=['name','TEXT','sequelize','exports','STRING'];(function(_0x3df30a,_0x469c8a){var _0x1ad138=function(_0x3c6d2a){while(--_0x3c6d2a){_0x3df30a['push'](_0x3df30a['shift']());}};_0x1ad138(++_0x469c8a);}(_0xf69c,0x1e2));var _0xcf69=function(_0x47d4fc,_0x51d987){_0x47d4fc=_0x47d4fc-0x0;var _0x3f3027=_0xf69c[_0x47d4fc];return _0x3f3027;};'use strict';var Sequelize=require(_0xcf69('0x0'));module[_0xcf69('0x1')]={'name':{'type':Sequelize[_0xcf69('0x2')],'allowNull':![],'unique':_0xcf69('0x3')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0xcf69('0x4')]},'description':{'type':Sequelize[_0xcf69('0x2')]}};
\ No newline at end of file
+var _0x7980=['TEXT','sequelize','exports','name','STRING'];(function(_0x4d83ef,_0x49c76e){var _0x495f4f=function(_0x970086){while(--_0x970086){_0x4d83ef['push'](_0x4d83ef['shift']());}};_0x495f4f(++_0x49c76e);}(_0x7980,0x123));var _0x0798=function(_0x16e01a,_0x3621ad){_0x16e01a=_0x16e01a-0x0;var _0x287045=_0x7980[_0x16e01a];return _0x287045;};'use strict';var Sequelize=require(_0x0798('0x0'));module[_0x0798('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x0798('0x2')},'table':{'type':Sequelize[_0x0798('0x3')]},'metric':{'type':Sequelize[_0x0798('0x4')]},'description':{'type':Sequelize[_0x0798('0x3')]}};
\ No newline at end of file
index bf8a0f1..557a502 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7da7=['model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','pick','merge','options','where','AnalyticMetric','includeAll','include','findAll','rows','catch','params','keys','length','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','moment','bluebird','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','limit','json','apply','reject','update','then','destroy','get','Metrics','UserProfileResource','end','name','send','index','map','rawAttributes','fieldName','type','key'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x7da7,0x10d));var _0x77da=function(_0x2d486b,_0x5f213c){_0x2d486b=_0x2d486b-0x0;var _0x4291d1=_0x7da7[_0x2d486b];return _0x4291d1;};'use strict';var emlformat=require(_0x77da('0x0'));var rimraf=require(_0x77da('0x1'));var zipdir=require(_0x77da('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x77da('0x3'));var BPromise=require(_0x77da('0x4'));var Mustache=require('mustache');var util=require(_0x77da('0x5'));var path=require(_0x77da('0x6'));var sox=require('sox');var csv=require(_0x77da('0x7'));var ejs=require(_0x77da('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x77da('0x9'));var squel=require('squel');var crypto=require(_0x77da('0xa'));var jsforce=require(_0x77da('0xb'));var deskjs=require(_0x77da('0xc'));var toCsv=require(_0x77da('0x7'));var querystring=require(_0x77da('0xd'));var Papa=require('papaparse');var Redis=require(_0x77da('0xe'));var authService=require(_0x77da('0xf'));var qs=require(_0x77da('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x77da('0x11'));var logger=require(_0x77da('0x12'))(_0x77da('0x13'));var utils=require(_0x77da('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x77da('0x15'));var db=require(_0x77da('0x16'))['db'];function respondWithStatusCode(_0x2acc65,_0x5d6e2f){_0x5d6e2f=_0x5d6e2f||0xcc;return function(_0x4a7748){if(_0x4a7748){return _0x2acc65[_0x77da('0x17')](_0x5d6e2f);}return _0x2acc65[_0x77da('0x18')](_0x5d6e2f)['end']();};}function respondWithResult(_0x3b0ff2,_0x369df0){_0x369df0=_0x369df0||0xc8;return function(_0x355719){if(_0x355719){return _0x3b0ff2[_0x77da('0x18')](_0x369df0)['json'](_0x355719);}};}function respondWithFilteredResult(_0x2172d0,_0x4e130c){return function(_0x29cd7b){if(_0x29cd7b){var _0x366443=typeof _0x4e130c[_0x77da('0x19')]===_0x77da('0x1a')&&typeof _0x4e130c['limit']==='undefined';var _0x514016=_0x29cd7b['count'];var _0x103e46=_0x366443?0x0:_0x4e130c[_0x77da('0x19')];var _0x289887=_0x366443?_0x29cd7b[_0x77da('0x1b')]:_0x4e130c[_0x77da('0x19')]+_0x4e130c[_0x77da('0x1c')];var _0x1d325c;if(_0x289887>=_0x514016){_0x289887=_0x514016;_0x1d325c=0xc8;}else{_0x1d325c=0xce;}_0x2172d0[_0x77da('0x18')](_0x1d325c);return _0x2172d0['set']('Content-Range',_0x103e46+'-'+_0x289887+'/'+_0x514016)[_0x77da('0x1d')](_0x29cd7b);}return null;};}function patchUpdates(_0x4d1512){return function(_0x507979){try{jsonpatch[_0x77da('0x1e')](_0x507979,_0x4d1512,!![]);}catch(_0x304a2b){return BPromise[_0x77da('0x1f')](_0x304a2b);}return _0x507979['save']();};}function saveUpdates(_0x58270c,_0x3e6cfe){return function(_0x58f6c1){if(_0x58f6c1){return _0x58f6c1[_0x77da('0x20')](_0x58270c)[_0x77da('0x21')](function(_0xc52f0e){return _0xc52f0e;});}return null;};}function removeEntity(_0x27b6c7,_0x10399a){return function(_0x270318){if(_0x270318){return _0x270318[_0x77da('0x22')]()['then'](function(){var _0x4885ec=_0x270318[_0x77da('0x23')]({'plain':!![]});var _0x2d009f=_0x77da('0x24');return db[_0x77da('0x25')]['destroy']({'where':{'type':_0x2d009f,'resourceId':_0x4885ec['id']}})[_0x77da('0x21')](function(){return _0x270318;});})[_0x77da('0x21')](function(){_0x27b6c7[_0x77da('0x18')](0xcc)[_0x77da('0x26')]();});}};}function handleEntityNotFound(_0x446ae7,_0x5997b6){return function(_0xce24b8){if(!_0xce24b8){_0x446ae7[_0x77da('0x17')](0x194);}return _0xce24b8;};}function handleError(_0x1f2279,_0x2913f7){_0x2913f7=_0x2913f7||0x1f4;return function(_0x496ecd){logger['error'](_0x496ecd['stack']);if(_0x496ecd[_0x77da('0x27')]){delete _0x496ecd[_0x77da('0x27')];}_0x1f2279[_0x77da('0x18')](_0x2913f7)[_0x77da('0x28')](_0x496ecd);};}exports[_0x77da('0x29')]=function(_0x4eeb99,_0x350b4e){var _0x26f5a0={},_0x356bfb={},_0x1d381b={'count':0x0,'rows':[]};var _0x1e7853=_[_0x77da('0x2a')](db['AnalyticMetric'][_0x77da('0x2b')],function(_0x228851){return{'name':_0x228851[_0x77da('0x2c')],'type':_0x228851[_0x77da('0x2d')][_0x77da('0x2e')]};});_0x356bfb[_0x77da('0x2f')]=_[_0x77da('0x2a')](_0x1e7853,_0x77da('0x27'));_0x356bfb['query']=_['keys'](_0x4eeb99[_0x77da('0x30')]);_0x356bfb[_0x77da('0x31')]=_['intersection'](_0x356bfb[_0x77da('0x2f')],_0x356bfb[_0x77da('0x30')]);_0x26f5a0[_0x77da('0x32')]=_[_0x77da('0x33')](_0x356bfb[_0x77da('0x2f')],qs[_0x77da('0x34')](_0x4eeb99[_0x77da('0x30')]['fields']));_0x26f5a0[_0x77da('0x32')]=_0x26f5a0['attributes']['length']?_0x26f5a0['attributes']:_0x356bfb[_0x77da('0x2f')];if(!_0x4eeb99['query'][_0x77da('0x35')](_0x77da('0x36'))){_0x26f5a0[_0x77da('0x1c')]=qs[_0x77da('0x1c')](_0x4eeb99[_0x77da('0x30')][_0x77da('0x1c')]);_0x26f5a0[_0x77da('0x19')]=qs['offset'](_0x4eeb99[_0x77da('0x30')][_0x77da('0x19')]);}_0x26f5a0[_0x77da('0x37')]=qs[_0x77da('0x38')](_0x4eeb99[_0x77da('0x30')][_0x77da('0x38')]);_0x26f5a0['where']=qs[_0x77da('0x31')](_[_0x77da('0x39')](_0x4eeb99[_0x77da('0x30')],_0x356bfb['filters']),_0x1e7853);if(_0x4eeb99[_0x77da('0x30')]['filter']){_0x26f5a0['where']=_['merge'](_0x26f5a0['where'],{'$or':_[_0x77da('0x2a')](_0x1e7853,function(_0x1adba5){if(_0x1adba5[_0x77da('0x2d')]!=='VIRTUAL'){var _0x21d337={};_0x21d337[_0x1adba5['name']]={'$like':'%'+_0x4eeb99[_0x77da('0x30')]['filter']+'%'};return _0x21d337;}})});}_0x26f5a0=_[_0x77da('0x3a')]({},_0x26f5a0,_0x4eeb99[_0x77da('0x3b')]);var _0x290667={'where':_0x26f5a0[_0x77da('0x3c')]};return db[_0x77da('0x3d')]['count'](_0x290667)[_0x77da('0x21')](function(_0x1f48bd){_0x1d381b[_0x77da('0x1b')]=_0x1f48bd;if(_0x4eeb99[_0x77da('0x30')][_0x77da('0x3e')]){_0x26f5a0[_0x77da('0x3f')]=[{'all':!![]}];}return db['AnalyticMetric'][_0x77da('0x40')](_0x26f5a0);})[_0x77da('0x21')](function(_0x21de41){_0x1d381b[_0x77da('0x41')]=_0x21de41;return _0x1d381b;})[_0x77da('0x21')](respondWithFilteredResult(_0x350b4e,_0x26f5a0))[_0x77da('0x42')](handleError(_0x350b4e,null));};exports['show']=function(_0x10957b,_0x5abcd9){var _0x1ae806={'raw':!![],'where':{'id':_0x10957b[_0x77da('0x43')]['id']}},_0x373fb2={};_0x373fb2['model']=_[_0x77da('0x44')](db[_0x77da('0x3d')][_0x77da('0x2b')]);_0x373fb2[_0x77da('0x30')]=_[_0x77da('0x44')](_0x10957b[_0x77da('0x30')]);_0x373fb2[_0x77da('0x31')]=_[_0x77da('0x33')](_0x373fb2[_0x77da('0x2f')],_0x373fb2['query']);_0x1ae806[_0x77da('0x32')]=_[_0x77da('0x33')](_0x373fb2[_0x77da('0x2f')],qs[_0x77da('0x34')](_0x10957b[_0x77da('0x30')][_0x77da('0x34')]));_0x1ae806['attributes']=_0x1ae806['attributes'][_0x77da('0x45')]?_0x1ae806[_0x77da('0x32')]:_0x373fb2[_0x77da('0x2f')];if(_0x10957b[_0x77da('0x30')][_0x77da('0x3e')]){_0x1ae806[_0x77da('0x3f')]=[{'all':!![]}];}_0x1ae806=_['merge']({},_0x1ae806,_0x10957b[_0x77da('0x3b')]);return db[_0x77da('0x3d')][_0x77da('0x46')](_0x1ae806)[_0x77da('0x21')](handleEntityNotFound(_0x5abcd9,null))['then'](respondWithResult(_0x5abcd9,null))[_0x77da('0x42')](handleError(_0x5abcd9,null));};exports['create']=function(_0x518fd5,_0x36263b){return db[_0x77da('0x3d')][_0x77da('0x47')](_0x518fd5[_0x77da('0x48')],{})['then'](function(_0x16bf4b){var _0x1e36ee=_0x518fd5['user'][_0x77da('0x23')]({'plain':!![]});if(!_0x1e36ee)throw new Error(_0x77da('0x49'));if(_0x1e36ee['role']===_0x77da('0x4a')){var _0x3aaf5b=_0x16bf4b[_0x77da('0x23')]({'plain':!![]});var _0xef2496=_0x77da('0x24');return db[_0x77da('0x4b')][_0x77da('0x46')]({'where':{'name':_0xef2496,'userProfileId':_0x1e36ee[_0x77da('0x4c')]},'raw':!![]})[_0x77da('0x21')](function(_0x3a34a8){if(_0x3a34a8&&_0x3a34a8['autoAssociation']===0x0){return db[_0x77da('0x25')]['create']({'name':_0x3aaf5b[_0x77da('0x27')],'resourceId':_0x3aaf5b['id'],'type':_0x3a34a8[_0x77da('0x27')],'sectionId':_0x3a34a8['id']},{})[_0x77da('0x21')](function(){return _0x16bf4b;});}else{return _0x16bf4b;}})[_0x77da('0x42')](function(_0x374179){logger[_0x77da('0x4d')](_0x77da('0x4e'),_0x374179);throw _0x374179;});}return _0x16bf4b;})['then'](respondWithResult(_0x36263b,0xc9))[_0x77da('0x42')](handleError(_0x36263b,null));};exports[_0x77da('0x20')]=function(_0x1a7115,_0x353be9){if(_0x1a7115['body']['id']){delete _0x1a7115[_0x77da('0x48')]['id'];}return db[_0x77da('0x3d')][_0x77da('0x46')]({'where':{'id':_0x1a7115['params']['id']}})['then'](handleEntityNotFound(_0x353be9,null))[_0x77da('0x21')](saveUpdates(_0x1a7115[_0x77da('0x48')],null))[_0x77da('0x21')](respondWithResult(_0x353be9,null))[_0x77da('0x42')](handleError(_0x353be9,null));};exports[_0x77da('0x22')]=function(_0x528a32,_0x50437b){return db[_0x77da('0x3d')][_0x77da('0x46')]({'where':{'id':_0x528a32['params']['id']}})[_0x77da('0x21')](handleEntityNotFound(_0x50437b,null))[_0x77da('0x21')](removeEntity(_0x50437b,null))[_0x77da('0x42')](handleError(_0x50437b,null));};
\ No newline at end of file
+var _0xd6d6=['includeAll','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','update','then','destroy','get','Metrics','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','merge','where','VIRTUAL','options','include','AnalyticMetric','rows','show'];(function(_0x2ac083,_0x1c4617){var _0x567a7c=function(_0x37eb78){while(--_0x37eb78){_0x2ac083['push'](_0x2ac083['shift']());}};_0x567a7c(++_0x1c4617);}(_0xd6d6,0xbe));var _0x6d6d=function(_0x5472dc,_0x3ba0cf){_0x5472dc=_0x5472dc-0x0;var _0x729862=_0xd6d6[_0x5472dc];return _0x729862;};'use strict';var emlformat=require(_0x6d6d('0x0'));var rimraf=require(_0x6d6d('0x1'));var zipdir=require(_0x6d6d('0x2'));var jsonpatch=require(_0x6d6d('0x3'));var rp=require('request-promise');var moment=require(_0x6d6d('0x4'));var BPromise=require(_0x6d6d('0x5'));var Mustache=require(_0x6d6d('0x6'));var util=require(_0x6d6d('0x7'));var path=require(_0x6d6d('0x8'));var sox=require(_0x6d6d('0x9'));var csv=require(_0x6d6d('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6d6d('0xb'));var _=require(_0x6d6d('0xc'));var squel=require(_0x6d6d('0xd'));var crypto=require(_0x6d6d('0xe'));var jsforce=require(_0x6d6d('0xf'));var deskjs=require(_0x6d6d('0x10'));var toCsv=require(_0x6d6d('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x6d6d('0x11'));var authService=require(_0x6d6d('0x12'));var qs=require(_0x6d6d('0x13'));var as=require(_0x6d6d('0x14'));var hardwareService=require(_0x6d6d('0x15'));var logger=require('../../config/logger')(_0x6d6d('0x16'));var utils=require(_0x6d6d('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x6d6d('0x18'))['db'];function respondWithStatusCode(_0x32146d,_0xe61c36){_0xe61c36=_0xe61c36||0xcc;return function(_0x3f8542){if(_0x3f8542){return _0x32146d[_0x6d6d('0x19')](_0xe61c36);}return _0x32146d[_0x6d6d('0x1a')](_0xe61c36)[_0x6d6d('0x1b')]();};}function respondWithResult(_0x2cb2dd,_0x5f4154){_0x5f4154=_0x5f4154||0xc8;return function(_0xd09ea7){if(_0xd09ea7){return _0x2cb2dd[_0x6d6d('0x1a')](_0x5f4154)[_0x6d6d('0x1c')](_0xd09ea7);}};}function respondWithFilteredResult(_0xa3b05d,_0x29cbd8){return function(_0x5d80c0){if(_0x5d80c0){var _0x2e6fdb=typeof _0x29cbd8['offset']===_0x6d6d('0x1d')&&typeof _0x29cbd8[_0x6d6d('0x1e')]===_0x6d6d('0x1d');var _0x4bb3d1=_0x5d80c0['count'];var _0x9e1e18=_0x2e6fdb?0x0:_0x29cbd8[_0x6d6d('0x1f')];var _0x2b59d4=_0x2e6fdb?_0x5d80c0[_0x6d6d('0x20')]:_0x29cbd8['offset']+_0x29cbd8['limit'];var _0x474873;if(_0x2b59d4>=_0x4bb3d1){_0x2b59d4=_0x4bb3d1;_0x474873=0xc8;}else{_0x474873=0xce;}_0xa3b05d['status'](_0x474873);return _0xa3b05d[_0x6d6d('0x21')](_0x6d6d('0x22'),_0x9e1e18+'-'+_0x2b59d4+'/'+_0x4bb3d1)[_0x6d6d('0x1c')](_0x5d80c0);}return null;};}function patchUpdates(_0x450352){return function(_0x40d35b){try{jsonpatch[_0x6d6d('0x23')](_0x40d35b,_0x450352,!![]);}catch(_0x164c67){return BPromise[_0x6d6d('0x24')](_0x164c67);}return _0x40d35b[_0x6d6d('0x25')]();};}function saveUpdates(_0x6f64e3,_0x24b10d){return function(_0x6e58e3){if(_0x6e58e3){return _0x6e58e3[_0x6d6d('0x26')](_0x6f64e3)[_0x6d6d('0x27')](function(_0x1f7f88){return _0x1f7f88;});}return null;};}function removeEntity(_0x25a02e,_0xced622){return function(_0x583b10){if(_0x583b10){return _0x583b10[_0x6d6d('0x28')]()[_0x6d6d('0x27')](function(){var _0x99f7d6=_0x583b10[_0x6d6d('0x29')]({'plain':!![]});var _0xf0df7f=_0x6d6d('0x2a');return db['UserProfileResource'][_0x6d6d('0x28')]({'where':{'type':_0xf0df7f,'resourceId':_0x99f7d6['id']}})[_0x6d6d('0x27')](function(){return _0x583b10;});})[_0x6d6d('0x27')](function(){_0x25a02e[_0x6d6d('0x1a')](0xcc)[_0x6d6d('0x1b')]();});}};}function handleEntityNotFound(_0x408f98,_0x3641fc){return function(_0x4a57a1){if(!_0x4a57a1){_0x408f98[_0x6d6d('0x19')](0x194);}return _0x4a57a1;};}function handleError(_0x9595d8,_0x51bd68){_0x51bd68=_0x51bd68||0x1f4;return function(_0x553645){logger[_0x6d6d('0x2b')](_0x553645[_0x6d6d('0x2c')]);if(_0x553645[_0x6d6d('0x2d')]){delete _0x553645['name'];}_0x9595d8[_0x6d6d('0x1a')](_0x51bd68)[_0x6d6d('0x2e')](_0x553645);};}exports[_0x6d6d('0x2f')]=function(_0x1c8340,_0x64d1f7){var _0x428c17={},_0xdda3f2={},_0x359cfd={'count':0x0,'rows':[]};var _0x6c4741=_[_0x6d6d('0x30')](db['AnalyticMetric'][_0x6d6d('0x31')],function(_0x4f1fc5){return{'name':_0x4f1fc5[_0x6d6d('0x32')],'type':_0x4f1fc5[_0x6d6d('0x33')][_0x6d6d('0x34')]};});_0xdda3f2[_0x6d6d('0x35')]=_['map'](_0x6c4741,_0x6d6d('0x2d'));_0xdda3f2['query']=_[_0x6d6d('0x36')](_0x1c8340[_0x6d6d('0x37')]);_0xdda3f2['filters']=_[_0x6d6d('0x38')](_0xdda3f2[_0x6d6d('0x35')],_0xdda3f2[_0x6d6d('0x37')]);_0x428c17[_0x6d6d('0x39')]=_[_0x6d6d('0x38')](_0xdda3f2[_0x6d6d('0x35')],qs[_0x6d6d('0x3a')](_0x1c8340[_0x6d6d('0x37')][_0x6d6d('0x3a')]));_0x428c17[_0x6d6d('0x39')]=_0x428c17[_0x6d6d('0x39')][_0x6d6d('0x3b')]?_0x428c17[_0x6d6d('0x39')]:_0xdda3f2[_0x6d6d('0x35')];if(!_0x1c8340['query'][_0x6d6d('0x3c')](_0x6d6d('0x3d'))){_0x428c17[_0x6d6d('0x1e')]=qs[_0x6d6d('0x1e')](_0x1c8340['query']['limit']);_0x428c17[_0x6d6d('0x1f')]=qs[_0x6d6d('0x1f')](_0x1c8340[_0x6d6d('0x37')]['offset']);}_0x428c17[_0x6d6d('0x3e')]=qs[_0x6d6d('0x3f')](_0x1c8340[_0x6d6d('0x37')][_0x6d6d('0x3f')]);_0x428c17['where']=qs['filters'](_['pick'](_0x1c8340[_0x6d6d('0x37')],_0xdda3f2[_0x6d6d('0x40')]),_0x6c4741);if(_0x1c8340[_0x6d6d('0x37')][_0x6d6d('0x41')]){_0x428c17['where']=_[_0x6d6d('0x42')](_0x428c17[_0x6d6d('0x43')],{'$or':_[_0x6d6d('0x30')](_0x6c4741,function(_0x3c6d23){if(_0x3c6d23[_0x6d6d('0x33')]!==_0x6d6d('0x44')){var _0x4b457d={};_0x4b457d[_0x3c6d23[_0x6d6d('0x2d')]]={'$like':'%'+_0x1c8340[_0x6d6d('0x37')][_0x6d6d('0x41')]+'%'};return _0x4b457d;}})});}_0x428c17=_[_0x6d6d('0x42')]({},_0x428c17,_0x1c8340[_0x6d6d('0x45')]);var _0x3e27b7={'where':_0x428c17[_0x6d6d('0x43')]};return db['AnalyticMetric'][_0x6d6d('0x20')](_0x3e27b7)[_0x6d6d('0x27')](function(_0x16e177){_0x359cfd[_0x6d6d('0x20')]=_0x16e177;if(_0x1c8340[_0x6d6d('0x37')]['includeAll']){_0x428c17[_0x6d6d('0x46')]=[{'all':!![]}];}return db[_0x6d6d('0x47')]['findAll'](_0x428c17);})[_0x6d6d('0x27')](function(_0x50dc17){_0x359cfd[_0x6d6d('0x48')]=_0x50dc17;return _0x359cfd;})[_0x6d6d('0x27')](respondWithFilteredResult(_0x64d1f7,_0x428c17))['catch'](handleError(_0x64d1f7,null));};exports[_0x6d6d('0x49')]=function(_0x3324ec,_0x252cbe){var _0x4041f3={'raw':!![],'where':{'id':_0x3324ec['params']['id']}},_0xf7ea0d={};_0xf7ea0d['model']=_[_0x6d6d('0x36')](db['AnalyticMetric']['rawAttributes']);_0xf7ea0d[_0x6d6d('0x37')]=_[_0x6d6d('0x36')](_0x3324ec[_0x6d6d('0x37')]);_0xf7ea0d['filters']=_[_0x6d6d('0x38')](_0xf7ea0d['model'],_0xf7ea0d[_0x6d6d('0x37')]);_0x4041f3[_0x6d6d('0x39')]=_[_0x6d6d('0x38')](_0xf7ea0d[_0x6d6d('0x35')],qs[_0x6d6d('0x3a')](_0x3324ec[_0x6d6d('0x37')][_0x6d6d('0x3a')]));_0x4041f3['attributes']=_0x4041f3[_0x6d6d('0x39')][_0x6d6d('0x3b')]?_0x4041f3[_0x6d6d('0x39')]:_0xf7ea0d[_0x6d6d('0x35')];if(_0x3324ec[_0x6d6d('0x37')][_0x6d6d('0x4a')]){_0x4041f3[_0x6d6d('0x46')]=[{'all':!![]}];}_0x4041f3=_[_0x6d6d('0x42')]({},_0x4041f3,_0x3324ec[_0x6d6d('0x45')]);return db['AnalyticMetric']['find'](_0x4041f3)[_0x6d6d('0x27')](handleEntityNotFound(_0x252cbe,null))[_0x6d6d('0x27')](respondWithResult(_0x252cbe,null))[_0x6d6d('0x4b')](handleError(_0x252cbe,null));};exports[_0x6d6d('0x4c')]=function(_0xe2a20e,_0x492834){return db[_0x6d6d('0x47')][_0x6d6d('0x4c')](_0xe2a20e[_0x6d6d('0x4d')],{})[_0x6d6d('0x27')](function(_0x2ee917){var _0x23c2db=_0xe2a20e[_0x6d6d('0x4e')][_0x6d6d('0x29')]({'plain':!![]});if(!_0x23c2db)throw new Error(_0x6d6d('0x4f'));if(_0x23c2db[_0x6d6d('0x50')]===_0x6d6d('0x4e')){var _0x175e26=_0x2ee917['get']({'plain':!![]});var _0x190786=_0x6d6d('0x2a');return db[_0x6d6d('0x51')][_0x6d6d('0x52')]({'where':{'name':_0x190786,'userProfileId':_0x23c2db[_0x6d6d('0x53')]},'raw':!![]})['then'](function(_0x38c307){if(_0x38c307&&_0x38c307[_0x6d6d('0x54')]===0x0){return db[_0x6d6d('0x55')]['create']({'name':_0x175e26['name'],'resourceId':_0x175e26['id'],'type':_0x38c307[_0x6d6d('0x2d')],'sectionId':_0x38c307['id']},{})['then'](function(){return _0x2ee917;});}else{return _0x2ee917;}})[_0x6d6d('0x4b')](function(_0x995fe2){logger[_0x6d6d('0x2b')](_0x6d6d('0x56'),_0x995fe2);throw _0x995fe2;});}return _0x2ee917;})[_0x6d6d('0x27')](respondWithResult(_0x492834,0xc9))[_0x6d6d('0x4b')](handleError(_0x492834,null));};exports[_0x6d6d('0x26')]=function(_0x26c23a,_0x1a8f33){if(_0x26c23a[_0x6d6d('0x4d')]['id']){delete _0x26c23a['body']['id'];}return db[_0x6d6d('0x47')][_0x6d6d('0x52')]({'where':{'id':_0x26c23a[_0x6d6d('0x57')]['id']}})[_0x6d6d('0x27')](handleEntityNotFound(_0x1a8f33,null))[_0x6d6d('0x27')](saveUpdates(_0x26c23a[_0x6d6d('0x4d')],null))[_0x6d6d('0x27')](respondWithResult(_0x1a8f33,null))['catch'](handleError(_0x1a8f33,null));};exports['destroy']=function(_0x3ad9b0,_0x122865){return db['AnalyticMetric'][_0x6d6d('0x52')]({'where':{'id':_0x3ad9b0[_0x6d6d('0x57')]['id']}})[_0x6d6d('0x27')](handleEntityNotFound(_0x122865,null))[_0x6d6d('0x27')](removeEntity(_0x122865,null))[_0x6d6d('0x4b')](handleError(_0x122865,null));};
\ No newline at end of file
index 49c618d..75f43cb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc43c=['./analyticMetric.attributes','exports','define','AnalyticMetric','analytics_metrics','lodash','util','../../config/logger','request-promise'];(function(_0x2d8434,_0x43d781){var _0x26b9e4=function(_0x54f5b8){while(--_0x54f5b8){_0x2d8434['push'](_0x2d8434['shift']());}};_0x26b9e4(++_0x43d781);}(_0xc43c,0xd4));var _0xcc43=function(_0x17f90b,_0x55cc6e){_0x17f90b=_0x17f90b-0x0;var _0x4eeba2=_0xc43c[_0x17f90b];return _0x4eeba2;};'use strict';var _=require(_0xcc43('0x0'));var util=require(_0xcc43('0x1'));var logger=require(_0xcc43('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xcc43('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xcc43('0x4'));module[_0xcc43('0x5')]=function(_0x13d329,_0x5e818f){return _0x13d329[_0xcc43('0x6')](_0xcc43('0x7'),attributes,{'tableName':_0xcc43('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x723e=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticMetric.attributes','define','AnalyticMetric','analytics_metrics'];(function(_0x4e7413,_0x5dffb1){var _0x11b6de=function(_0xd6721b){while(--_0xd6721b){_0x4e7413['push'](_0x4e7413['shift']());}};_0x11b6de(++_0x5dffb1);}(_0x723e,0x179));var _0xe723=function(_0x27817b,_0x2f7e80){_0x27817b=_0x27817b-0x0;var _0x11692c=_0x723e[_0x27817b];return _0x11692c;};'use strict';var _=require('lodash');var util=require(_0xe723('0x0'));var logger=require(_0xe723('0x1'))(_0xe723('0x2'));var moment=require(_0xe723('0x3'));var BPromise=require(_0xe723('0x4'));var rp=require(_0xe723('0x5'));var fs=require('fs');var path=require(_0xe723('0x6'));var rimraf=require(_0xe723('0x7'));var config=require(_0xe723('0x8'));var attributes=require(_0xe723('0x9'));module['exports']=function(_0x32d689,_0x20c13b){return _0x32d689[_0xe723('0xa')](_0xe723('0xb'),attributes,{'tableName':_0xe723('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 4a4141d..13d1319 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x30c8=['debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http','request','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent'];(function(_0x4c794a,_0x5e1056){var _0x4d9858=function(_0x1a588a){while(--_0x1a588a){_0x4c794a['push'](_0x4c794a['shift']());}};_0x4d9858(++_0x5e1056);}(_0x30c8,0x86));var _0x830c=function(_0x183f90,_0x3bd6ac){_0x183f90=_0x183f90-0x0;var _0x456fcf=_0x30c8[_0x183f90];return _0x456fcf;};'use strict';var _=require(_0x830c('0x0'));var util=require('util');var moment=require(_0x830c('0x1'));var BPromise=require(_0x830c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x830c('0x3'));var db=require(_0x830c('0x4'))['db'];var utils=require(_0x830c('0x5'));var logger=require('../../config/logger')(_0x830c('0x6'));var config=require('../../config/environment');var jayson=require(_0x830c('0x7'));var client=jayson['client'][_0x830c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1490a3,_0x2d11cd,_0x1ca147){return new BPromise(function(_0x524cd9,_0x22674b){return client[_0x830c('0x9')](_0x1490a3,_0x1ca147)['then'](function(_0x237205){logger[_0x830c('0xa')](_0x830c('0xb'),_0x2d11cd,_0x830c('0xc'));logger[_0x830c('0xd')](_0x830c('0xe'),_0x2d11cd,_0x830c('0xc'),JSON[_0x830c('0xf')](_0x237205));if(_0x237205[_0x830c('0x10')]){if(_0x237205[_0x830c('0x10')][_0x830c('0x11')]===0x1f4){logger[_0x830c('0x10')]('AnalyticMetric,\x20%s,\x20%s',_0x2d11cd,_0x237205[_0x830c('0x10')]['message']);return _0x22674b(_0x237205[_0x830c('0x10')]['message']);}logger['error'](_0x830c('0xb'),_0x2d11cd,_0x237205['error'][_0x830c('0x12')]);return _0x524cd9(_0x237205[_0x830c('0x10')][_0x830c('0x12')]);}else{logger[_0x830c('0xa')](_0x830c('0xb'),_0x2d11cd,_0x830c('0xc'));_0x524cd9(_0x237205[_0x830c('0x13')]['message']);}})[_0x830c('0x14')](function(_0xcd68d4){logger['error']('AnalyticMetric,\x20%s,\x20%s',_0x2d11cd,_0xcd68d4);_0x22674b(_0xcd68d4);});});}
\ No newline at end of file
+var _0x16a9=['then','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request'];(function(_0x3c2b2e,_0x3e6e53){var _0x27a338=function(_0x40d29d){while(--_0x40d29d){_0x3c2b2e['push'](_0x3c2b2e['shift']());}};_0x27a338(++_0x3e6e53);}(_0x16a9,0x107));var _0x916a=function(_0x218422,_0x367e3c){_0x218422=_0x218422-0x0;var _0x2fc5a5=_0x16a9[_0x218422];return _0x2fc5a5;};'use strict';var _=require(_0x916a('0x0'));var util=require('util');var moment=require(_0x916a('0x1'));var BPromise=require(_0x916a('0x2'));var rs=require(_0x916a('0x3'));var fs=require('fs');var Redis=require(_0x916a('0x4'));var db=require(_0x916a('0x5'))['db'];var utils=require(_0x916a('0x6'));var logger=require(_0x916a('0x7'))('rpc');var config=require(_0x916a('0x8'));var jayson=require(_0x916a('0x9'));var client=jayson[_0x916a('0xa')][_0x916a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x410c75,_0x3256d3,_0x27ca04){return new BPromise(function(_0x2e66b3,_0xbe274a){return client[_0x916a('0xc')](_0x410c75,_0x27ca04)[_0x916a('0xd')](function(_0x5df37a){logger['info'](_0x916a('0xe'),_0x3256d3,_0x916a('0xf'));logger[_0x916a('0x10')](_0x916a('0x11'),_0x3256d3,'request\x20sent',JSON[_0x916a('0x12')](_0x5df37a));if(_0x5df37a[_0x916a('0x13')]){if(_0x5df37a['error']['code']===0x1f4){logger[_0x916a('0x13')]('AnalyticMetric,\x20%s,\x20%s',_0x3256d3,_0x5df37a[_0x916a('0x13')][_0x916a('0x14')]);return _0xbe274a(_0x5df37a['error'][_0x916a('0x14')]);}logger[_0x916a('0x13')](_0x916a('0xe'),_0x3256d3,_0x5df37a['error'][_0x916a('0x14')]);return _0x2e66b3(_0x5df37a[_0x916a('0x13')]['message']);}else{logger[_0x916a('0x15')](_0x916a('0xe'),_0x3256d3,_0x916a('0xf'));_0x2e66b3(_0x5df37a[_0x916a('0x16')][_0x916a('0x14')]);}})['catch'](function(_0x428433){logger[_0x916a('0x13')]('AnalyticMetric,\x20%s,\x20%s',_0x3256d3,_0x428433);_0xbe274a(_0x428433);});});}
\ No newline at end of file
index cb8b00e..ba6b976 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9879=['./analyticMetric.controller','get','isAuthenticated','show','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x9e5ff5,_0xce6382){var _0x58ac51=function(_0x4d0ed8){while(--_0x4d0ed8){_0x9e5ff5['push'](_0x9e5ff5['shift']());}};_0x58ac51(++_0xce6382);}(_0x9879,0x98));var _0x9987=function(_0x4ceef7,_0x526d8e){_0x4ceef7=_0x4ceef7-0x0;var _0x385b02=_0x9879[_0x4ceef7];return _0x385b02;};'use strict';var multer=require(_0x9987('0x0'));var util=require(_0x9987('0x1'));var path=require(_0x9987('0x2'));var timeout=require('connect-timeout');var express=require(_0x9987('0x3'));var router=express['Router']();var fs_extra=require(_0x9987('0x4'));var auth=require(_0x9987('0x5'));var interaction=require(_0x9987('0x6'));var config=require(_0x9987('0x7'));var controller=require(_0x9987('0x8'));router[_0x9987('0x9')]('/',auth[_0x9987('0xa')](),controller['index']);router[_0x9987('0x9')]('/:id',auth[_0x9987('0xa')](),controller[_0x9987('0xb')]);router[_0x9987('0xc')]('/',auth[_0x9987('0xa')](),controller[_0x9987('0xd')]);router[_0x9987('0xe')](_0x9987('0xf'),auth[_0x9987('0xa')](),controller[_0x9987('0x10')]);router[_0x9987('0x11')](_0x9987('0xf'),auth[_0x9987('0xa')](),controller[_0x9987('0x12')]);module[_0x9987('0x13')]=router;
\ No newline at end of file
+var _0xdf98=['isAuthenticated','index','/:id','show','create','update','delete','destroy','exports','multer','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdf98,0xcf));var _0x8df9=function(_0x10e653,_0x59f1cc){_0x10e653=_0x10e653-0x0;var _0x328dfd=_0xdf98[_0x10e653];return _0x328dfd;};'use strict';var multer=require(_0x8df9('0x0'));var util=require('util');var path=require(_0x8df9('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x8df9('0x2')]();var fs_extra=require(_0x8df9('0x3'));var auth=require(_0x8df9('0x4'));var interaction=require(_0x8df9('0x5'));var config=require(_0x8df9('0x6'));var controller=require(_0x8df9('0x7'));router[_0x8df9('0x8')]('/',auth[_0x8df9('0x9')](),controller[_0x8df9('0xa')]);router['get'](_0x8df9('0xb'),auth[_0x8df9('0x9')](),controller[_0x8df9('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x8df9('0xd')]);router['put'](_0x8df9('0xb'),auth[_0x8df9('0x9')](),controller[_0x8df9('0xe')]);router[_0x8df9('0xf')](_0x8df9('0xb'),auth[_0x8df9('0x9')](),controller[_0x8df9('0x10')]);module[_0x8df9('0x11')]=router;
\ No newline at end of file
index a5059bd..69a30cb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe578=['sequelize','exports','TEXT'];(function(_0x22dcaa,_0x7e9f63){var _0x1d991b=function(_0x179ef9){while(--_0x179ef9){_0x22dcaa['push'](_0x22dcaa['shift']());}};_0x1d991b(++_0x7e9f63);}(_0xe578,0xd5));var _0x8e57=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe578[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x8e57('0x0'));module[_0x8e57('0x1')]={'tree':{'type':Sequelize[_0x8e57('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0xce0a=['TEXT','sequelize'];(function(_0x2d6498,_0x16b741){var _0x5398a8=function(_0x104458){while(--_0x104458){_0x2d6498['push'](_0x2d6498['shift']());}};_0x5398a8(++_0x16b741);}(_0xce0a,0xc1));var _0xace0=function(_0x2a1e2d,_0x195473){_0x2a1e2d=_0x2a1e2d-0x0;var _0x32b8cc=_0xce0a[_0x2a1e2d];return _0x32b8cc;};'use strict';var Sequelize=require(_0xace0('0x0'));module['exports']={'tree':{'type':Sequelize[_0xace0('0x1')],'allowNull':![]}};
\ No newline at end of file
index 1ed8b8a..88448a6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0935=['VIRTUAL','options','includeAll','findAll','catch','include','find','create','body','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','update','then','destroy','error','stack','name','send','index','AnalyticTreeReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','map'];(function(_0x403987,_0x38e1f8){var _0x4b900f=function(_0x21f5b8){while(--_0x21f5b8){_0x403987['push'](_0x403987['shift']());}};_0x4b900f(++_0x38e1f8);}(_0x0935,0x16d));var _0x5093=function(_0x410a16,_0x2f9f5f){_0x410a16=_0x410a16-0x0;var _0x21199a=_0x0935[_0x410a16];return _0x21199a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5093('0x0'));var zipdir=require(_0x5093('0x1'));var jsonpatch=require(_0x5093('0x2'));var rp=require(_0x5093('0x3'));var moment=require(_0x5093('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x5093('0x5'));var util=require(_0x5093('0x6'));var path=require(_0x5093('0x7'));var sox=require('sox');var csv=require(_0x5093('0x8'));var ejs=require(_0x5093('0x9'));var fs=require('fs');var fs_extra=require(_0x5093('0xa'));var _=require(_0x5093('0xb'));var squel=require(_0x5093('0xc'));var crypto=require(_0x5093('0xd'));var jsforce=require(_0x5093('0xe'));var deskjs=require(_0x5093('0xf'));var toCsv=require(_0x5093('0x8'));var querystring=require('querystring');var Papa=require(_0x5093('0x10'));var Redis=require(_0x5093('0x11'));var authService=require(_0x5093('0x12'));var qs=require(_0x5093('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5093('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x5093('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x5093('0x16'))['db'];function respondWithStatusCode(_0x3df08a,_0x4f2f09){_0x4f2f09=_0x4f2f09||0xcc;return function(_0xdeefd1){if(_0xdeefd1){return _0x3df08a[_0x5093('0x17')](_0x4f2f09);}return _0x3df08a[_0x5093('0x18')](_0x4f2f09)[_0x5093('0x19')]();};}function respondWithResult(_0x2a3f85,_0x3576c7){_0x3576c7=_0x3576c7||0xc8;return function(_0xff92c9){if(_0xff92c9){return _0x2a3f85[_0x5093('0x18')](_0x3576c7)['json'](_0xff92c9);}};}function respondWithFilteredResult(_0x1588cb,_0x1a5025){return function(_0x255072){if(_0x255072){var _0x389de3=typeof _0x1a5025[_0x5093('0x1a')]===_0x5093('0x1b')&&typeof _0x1a5025[_0x5093('0x1c')]===_0x5093('0x1b');var _0x570d2f=_0x255072[_0x5093('0x1d')];var _0x298fa4=_0x389de3?0x0:_0x1a5025[_0x5093('0x1a')];var _0x57a9ff=_0x389de3?_0x255072[_0x5093('0x1d')]:_0x1a5025[_0x5093('0x1a')]+_0x1a5025[_0x5093('0x1c')];var _0x284a77;if(_0x57a9ff>=_0x570d2f){_0x57a9ff=_0x570d2f;_0x284a77=0xc8;}else{_0x284a77=0xce;}_0x1588cb[_0x5093('0x18')](_0x284a77);return _0x1588cb['set'](_0x5093('0x1e'),_0x298fa4+'-'+_0x57a9ff+'/'+_0x570d2f)[_0x5093('0x1f')](_0x255072);}return null;};}function patchUpdates(_0x4be9f1){return function(_0x1b6570){try{jsonpatch[_0x5093('0x20')](_0x1b6570,_0x4be9f1,!![]);}catch(_0x24a0de){return BPromise[_0x5093('0x21')](_0x24a0de);}return _0x1b6570['save']();};}function saveUpdates(_0x50eb3a,_0xff069f){return function(_0xee40fd){if(_0xee40fd){return _0xee40fd[_0x5093('0x22')](_0x50eb3a)[_0x5093('0x23')](function(_0x4a515b){return _0x4a515b;});}return null;};}function removeEntity(_0x2e6dda,_0x374c3d){return function(_0x3a70c6){if(_0x3a70c6){return _0x3a70c6[_0x5093('0x24')]()[_0x5093('0x23')](function(){_0x2e6dda['status'](0xcc)[_0x5093('0x19')]();});}};}function handleEntityNotFound(_0x46b13f,_0x390a72){return function(_0x3de267){if(!_0x3de267){_0x46b13f[_0x5093('0x17')](0x194);}return _0x3de267;};}function handleError(_0x8853d9,_0x23808a){_0x23808a=_0x23808a||0x1f4;return function(_0x9928ac){logger[_0x5093('0x25')](_0x9928ac[_0x5093('0x26')]);if(_0x9928ac[_0x5093('0x27')]){delete _0x9928ac[_0x5093('0x27')];}_0x8853d9[_0x5093('0x18')](_0x23808a)[_0x5093('0x28')](_0x9928ac);};}exports[_0x5093('0x29')]=function(_0x2fde7b,_0x1edb29){var _0x4af1b5={},_0x145ea2={},_0x2eb5dd={'count':0x0,'rows':[]};var _0x55a3f5=_['map'](db[_0x5093('0x2a')][_0x5093('0x2b')],function(_0x4f9163){return{'name':_0x4f9163['fieldName'],'type':_0x4f9163[_0x5093('0x2c')][_0x5093('0x2d')]};});_0x145ea2[_0x5093('0x2e')]=_['map'](_0x55a3f5,_0x5093('0x27'));_0x145ea2[_0x5093('0x2f')]=_[_0x5093('0x30')](_0x2fde7b[_0x5093('0x2f')]);_0x145ea2[_0x5093('0x31')]=_[_0x5093('0x32')](_0x145ea2['model'],_0x145ea2[_0x5093('0x2f')]);_0x4af1b5[_0x5093('0x33')]=_[_0x5093('0x32')](_0x145ea2[_0x5093('0x2e')],qs[_0x5093('0x34')](_0x2fde7b[_0x5093('0x2f')][_0x5093('0x34')]));_0x4af1b5['attributes']=_0x4af1b5['attributes'][_0x5093('0x35')]?_0x4af1b5[_0x5093('0x33')]:_0x145ea2[_0x5093('0x2e')];if(!_0x2fde7b[_0x5093('0x2f')]['hasOwnProperty'](_0x5093('0x36'))){_0x4af1b5[_0x5093('0x1c')]=qs[_0x5093('0x1c')](_0x2fde7b['query']['limit']);_0x4af1b5[_0x5093('0x1a')]=qs[_0x5093('0x1a')](_0x2fde7b[_0x5093('0x2f')]['offset']);}_0x4af1b5[_0x5093('0x37')]=qs[_0x5093('0x38')](_0x2fde7b['query'][_0x5093('0x38')]);_0x4af1b5[_0x5093('0x39')]=qs[_0x5093('0x31')](_['pick'](_0x2fde7b[_0x5093('0x2f')],_0x145ea2[_0x5093('0x31')]),_0x55a3f5);if(_0x2fde7b[_0x5093('0x2f')][_0x5093('0x3a')]){_0x4af1b5[_0x5093('0x39')]=_[_0x5093('0x3b')](_0x4af1b5[_0x5093('0x39')],{'$or':_[_0x5093('0x3c')](_0x55a3f5,function(_0x3c1e0c){if(_0x3c1e0c[_0x5093('0x2c')]!==_0x5093('0x3d')){var _0xa83df7={};_0xa83df7[_0x3c1e0c[_0x5093('0x27')]]={'$like':'%'+_0x2fde7b['query'][_0x5093('0x3a')]+'%'};return _0xa83df7;}})});}_0x4af1b5=_['merge']({},_0x4af1b5,_0x2fde7b[_0x5093('0x3e')]);var _0x31795c={'where':_0x4af1b5[_0x5093('0x39')]};return db[_0x5093('0x2a')]['count'](_0x31795c)[_0x5093('0x23')](function(_0xf92349){_0x2eb5dd[_0x5093('0x1d')]=_0xf92349;if(_0x2fde7b[_0x5093('0x2f')][_0x5093('0x3f')]){_0x4af1b5['include']=[{'all':!![]}];}return db[_0x5093('0x2a')][_0x5093('0x40')](_0x4af1b5);})[_0x5093('0x23')](function(_0x1d823b){_0x2eb5dd['rows']=_0x1d823b;return _0x2eb5dd;})[_0x5093('0x23')](respondWithFilteredResult(_0x1edb29,_0x4af1b5))[_0x5093('0x41')](handleError(_0x1edb29,null));};exports['show']=function(_0x535898,_0x2ca3ea){var _0x1f1bec={'raw':!![],'where':{'id':_0x535898['params']['id']}},_0x1387e6={};_0x1387e6['model']=_[_0x5093('0x30')](db[_0x5093('0x2a')][_0x5093('0x2b')]);_0x1387e6['query']=_['keys'](_0x535898[_0x5093('0x2f')]);_0x1387e6['filters']=_[_0x5093('0x32')](_0x1387e6[_0x5093('0x2e')],_0x1387e6[_0x5093('0x2f')]);_0x1f1bec['attributes']=_[_0x5093('0x32')](_0x1387e6['model'],qs[_0x5093('0x34')](_0x535898['query'][_0x5093('0x34')]));_0x1f1bec[_0x5093('0x33')]=_0x1f1bec[_0x5093('0x33')][_0x5093('0x35')]?_0x1f1bec[_0x5093('0x33')]:_0x1387e6[_0x5093('0x2e')];if(_0x535898[_0x5093('0x2f')]['includeAll']){_0x1f1bec[_0x5093('0x42')]=[{'all':!![]}];}_0x1f1bec=_[_0x5093('0x3b')]({},_0x1f1bec,_0x535898[_0x5093('0x3e')]);return db['AnalyticTreeReport'][_0x5093('0x43')](_0x1f1bec)['then'](handleEntityNotFound(_0x2ca3ea,null))[_0x5093('0x23')](respondWithResult(_0x2ca3ea,null))[_0x5093('0x41')](handleError(_0x2ca3ea,null));};exports['create']=function(_0x6f94a,_0x7bb1ab){return db[_0x5093('0x2a')][_0x5093('0x44')](_0x6f94a[_0x5093('0x45')],{})[_0x5093('0x23')](respondWithResult(_0x7bb1ab,0xc9))[_0x5093('0x41')](handleError(_0x7bb1ab,null));};exports[_0x5093('0x22')]=function(_0x4fd6a9,_0x1712d2){if(_0x4fd6a9[_0x5093('0x45')]['id']){delete _0x4fd6a9[_0x5093('0x45')]['id'];}return db[_0x5093('0x2a')][_0x5093('0x43')]({'where':{'id':_0x4fd6a9[_0x5093('0x46')]['id']}})['then'](handleEntityNotFound(_0x1712d2,null))[_0x5093('0x23')](saveUpdates(_0x4fd6a9[_0x5093('0x45')],null))[_0x5093('0x23')](respondWithResult(_0x1712d2,null))[_0x5093('0x41')](handleError(_0x1712d2,null));};exports['destroy']=function(_0x21b60c,_0x30aab0){return db[_0x5093('0x2a')][_0x5093('0x43')]({'where':{'id':_0x21b60c[_0x5093('0x46')]['id']}})[_0x5093('0x23')](handleEntityNotFound(_0x30aab0,null))[_0x5093('0x23')](removeEntity(_0x30aab0,null))[_0x5093('0x41')](handleError(_0x30aab0,null));};
\ No newline at end of file
+var _0xfb75=['../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','set','Content-Range','apply','save','update','then','destroy','error','stack','send','map','AnalyticTreeReport','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','merge','VIRTUAL','name','filter','options','include','findAll','catch','show','params','includeAll','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware'];(function(_0x177225,_0x2476b5){var _0x5d6a65=function(_0x3b98f1){while(--_0x3b98f1){_0x177225['push'](_0x177225['shift']());}};_0x5d6a65(++_0x2476b5);}(_0xfb75,0x1f3));var _0x5fb7=function(_0x448d4f,_0x1d4201){_0x448d4f=_0x448d4f-0x0;var _0x156d90=_0xfb75[_0x448d4f];return _0x156d90;};'use strict';var emlformat=require(_0x5fb7('0x0'));var rimraf=require(_0x5fb7('0x1'));var zipdir=require(_0x5fb7('0x2'));var jsonpatch=require(_0x5fb7('0x3'));var rp=require(_0x5fb7('0x4'));var moment=require(_0x5fb7('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x5fb7('0x6'));var util=require(_0x5fb7('0x7'));var path=require(_0x5fb7('0x8'));var sox=require(_0x5fb7('0x9'));var csv=require(_0x5fb7('0xa'));var ejs=require(_0x5fb7('0xb'));var fs=require('fs');var fs_extra=require(_0x5fb7('0xc'));var _=require(_0x5fb7('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x5fb7('0xe'));var Redis=require(_0x5fb7('0xf'));var authService=require(_0x5fb7('0x10'));var qs=require(_0x5fb7('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5fb7('0x12'));var logger=require(_0x5fb7('0x13'))(_0x5fb7('0x14'));var utils=require('../../config/utils');var config=require(_0x5fb7('0x15'));var licenseUtil=require(_0x5fb7('0x16'));var db=require(_0x5fb7('0x17'))['db'];function respondWithStatusCode(_0x18641f,_0xeea3e4){_0xeea3e4=_0xeea3e4||0xcc;return function(_0xf002e1){if(_0xf002e1){return _0x18641f[_0x5fb7('0x18')](_0xeea3e4);}return _0x18641f['status'](_0xeea3e4)['end']();};}function respondWithResult(_0x1d3e62,_0xa86ecb){_0xa86ecb=_0xa86ecb||0xc8;return function(_0x3e1a9d){if(_0x3e1a9d){return _0x1d3e62[_0x5fb7('0x19')](_0xa86ecb)[_0x5fb7('0x1a')](_0x3e1a9d);}};}function respondWithFilteredResult(_0x1aac89,_0x5d6a6e){return function(_0x543b31){if(_0x543b31){var _0x2ee629=typeof _0x5d6a6e[_0x5fb7('0x1b')]===_0x5fb7('0x1c')&&typeof _0x5d6a6e['limit']===_0x5fb7('0x1c');var _0x4cd2f5=_0x543b31[_0x5fb7('0x1d')];var _0x21f698=_0x2ee629?0x0:_0x5d6a6e['offset'];var _0x251b28=_0x2ee629?_0x543b31['count']:_0x5d6a6e[_0x5fb7('0x1b')]+_0x5d6a6e['limit'];var _0x955a7f;if(_0x251b28>=_0x4cd2f5){_0x251b28=_0x4cd2f5;_0x955a7f=0xc8;}else{_0x955a7f=0xce;}_0x1aac89[_0x5fb7('0x19')](_0x955a7f);return _0x1aac89[_0x5fb7('0x1e')](_0x5fb7('0x1f'),_0x21f698+'-'+_0x251b28+'/'+_0x4cd2f5)[_0x5fb7('0x1a')](_0x543b31);}return null;};}function patchUpdates(_0x3a4192){return function(_0x83591b){try{jsonpatch[_0x5fb7('0x20')](_0x83591b,_0x3a4192,!![]);}catch(_0x31abe1){return BPromise['reject'](_0x31abe1);}return _0x83591b[_0x5fb7('0x21')]();};}function saveUpdates(_0x54cc12,_0x23bbfb){return function(_0x1c45e4){if(_0x1c45e4){return _0x1c45e4[_0x5fb7('0x22')](_0x54cc12)[_0x5fb7('0x23')](function(_0xe4e96f){return _0xe4e96f;});}return null;};}function removeEntity(_0x52c9ba,_0x3cbc33){return function(_0x7026b2){if(_0x7026b2){return _0x7026b2[_0x5fb7('0x24')]()['then'](function(){_0x52c9ba[_0x5fb7('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x41e7e9,_0x4de460){return function(_0x285bd6){if(!_0x285bd6){_0x41e7e9[_0x5fb7('0x18')](0x194);}return _0x285bd6;};}function handleError(_0x284054,_0x245f97){_0x245f97=_0x245f97||0x1f4;return function(_0xb11f33){logger[_0x5fb7('0x25')](_0xb11f33[_0x5fb7('0x26')]);if(_0xb11f33['name']){delete _0xb11f33['name'];}_0x284054[_0x5fb7('0x19')](_0x245f97)[_0x5fb7('0x27')](_0xb11f33);};}exports['index']=function(_0x2dcbae,_0x2c3e39){var _0x1d6447={},_0x4e62ff={},_0x4247f5={'count':0x0,'rows':[]};var _0x1e91f1=_[_0x5fb7('0x28')](db[_0x5fb7('0x29')][_0x5fb7('0x2a')],function(_0x445f09){return{'name':_0x445f09[_0x5fb7('0x2b')],'type':_0x445f09[_0x5fb7('0x2c')][_0x5fb7('0x2d')]};});_0x4e62ff[_0x5fb7('0x2e')]=_[_0x5fb7('0x28')](_0x1e91f1,'name');_0x4e62ff['query']=_[_0x5fb7('0x2f')](_0x2dcbae[_0x5fb7('0x30')]);_0x4e62ff['filters']=_[_0x5fb7('0x31')](_0x4e62ff[_0x5fb7('0x2e')],_0x4e62ff['query']);_0x1d6447[_0x5fb7('0x32')]=_[_0x5fb7('0x31')](_0x4e62ff[_0x5fb7('0x2e')],qs[_0x5fb7('0x33')](_0x2dcbae['query'][_0x5fb7('0x33')]));_0x1d6447[_0x5fb7('0x32')]=_0x1d6447[_0x5fb7('0x32')]['length']?_0x1d6447[_0x5fb7('0x32')]:_0x4e62ff[_0x5fb7('0x2e')];if(!_0x2dcbae['query'][_0x5fb7('0x34')](_0x5fb7('0x35'))){_0x1d6447[_0x5fb7('0x36')]=qs['limit'](_0x2dcbae[_0x5fb7('0x30')]['limit']);_0x1d6447[_0x5fb7('0x1b')]=qs[_0x5fb7('0x1b')](_0x2dcbae[_0x5fb7('0x30')]['offset']);}_0x1d6447[_0x5fb7('0x37')]=qs['sort'](_0x2dcbae[_0x5fb7('0x30')][_0x5fb7('0x38')]);_0x1d6447[_0x5fb7('0x39')]=qs[_0x5fb7('0x3a')](_[_0x5fb7('0x3b')](_0x2dcbae['query'],_0x4e62ff[_0x5fb7('0x3a')]),_0x1e91f1);if(_0x2dcbae[_0x5fb7('0x30')]['filter']){_0x1d6447[_0x5fb7('0x39')]=_[_0x5fb7('0x3c')](_0x1d6447[_0x5fb7('0x39')],{'$or':_[_0x5fb7('0x28')](_0x1e91f1,function(_0x1a04c6){if(_0x1a04c6[_0x5fb7('0x2c')]!==_0x5fb7('0x3d')){var _0x3efb47={};_0x3efb47[_0x1a04c6[_0x5fb7('0x3e')]]={'$like':'%'+_0x2dcbae[_0x5fb7('0x30')][_0x5fb7('0x3f')]+'%'};return _0x3efb47;}})});}_0x1d6447=_['merge']({},_0x1d6447,_0x2dcbae[_0x5fb7('0x40')]);var _0x320704={'where':_0x1d6447[_0x5fb7('0x39')]};return db[_0x5fb7('0x29')][_0x5fb7('0x1d')](_0x320704)[_0x5fb7('0x23')](function(_0x171120){_0x4247f5[_0x5fb7('0x1d')]=_0x171120;if(_0x2dcbae[_0x5fb7('0x30')]['includeAll']){_0x1d6447[_0x5fb7('0x41')]=[{'all':!![]}];}return db['AnalyticTreeReport'][_0x5fb7('0x42')](_0x1d6447);})[_0x5fb7('0x23')](function(_0x24e2b5){_0x4247f5['rows']=_0x24e2b5;return _0x4247f5;})[_0x5fb7('0x23')](respondWithFilteredResult(_0x2c3e39,_0x1d6447))[_0x5fb7('0x43')](handleError(_0x2c3e39,null));};exports[_0x5fb7('0x44')]=function(_0xa5d8af,_0x34b278){var _0xec72f={'raw':!![],'where':{'id':_0xa5d8af[_0x5fb7('0x45')]['id']}},_0x51dad3={};_0x51dad3[_0x5fb7('0x2e')]=_['keys'](db['AnalyticTreeReport'][_0x5fb7('0x2a')]);_0x51dad3['query']=_[_0x5fb7('0x2f')](_0xa5d8af[_0x5fb7('0x30')]);_0x51dad3[_0x5fb7('0x3a')]=_[_0x5fb7('0x31')](_0x51dad3[_0x5fb7('0x2e')],_0x51dad3[_0x5fb7('0x30')]);_0xec72f['attributes']=_['intersection'](_0x51dad3[_0x5fb7('0x2e')],qs['fields'](_0xa5d8af['query']['fields']));_0xec72f[_0x5fb7('0x32')]=_0xec72f[_0x5fb7('0x32')]['length']?_0xec72f['attributes']:_0x51dad3['model'];if(_0xa5d8af['query'][_0x5fb7('0x46')]){_0xec72f[_0x5fb7('0x41')]=[{'all':!![]}];}_0xec72f=_[_0x5fb7('0x3c')]({},_0xec72f,_0xa5d8af[_0x5fb7('0x40')]);return db[_0x5fb7('0x29')][_0x5fb7('0x47')](_0xec72f)[_0x5fb7('0x23')](handleEntityNotFound(_0x34b278,null))[_0x5fb7('0x23')](respondWithResult(_0x34b278,null))[_0x5fb7('0x43')](handleError(_0x34b278,null));};exports[_0x5fb7('0x48')]=function(_0x1edf63,_0x5078b4){return db[_0x5fb7('0x29')][_0x5fb7('0x48')](_0x1edf63[_0x5fb7('0x49')],{})[_0x5fb7('0x23')](respondWithResult(_0x5078b4,0xc9))['catch'](handleError(_0x5078b4,null));};exports[_0x5fb7('0x22')]=function(_0x277df3,_0xcb5e17){if(_0x277df3[_0x5fb7('0x49')]['id']){delete _0x277df3[_0x5fb7('0x49')]['id'];}return db[_0x5fb7('0x29')][_0x5fb7('0x47')]({'where':{'id':_0x277df3[_0x5fb7('0x45')]['id']}})['then'](handleEntityNotFound(_0xcb5e17,null))['then'](saveUpdates(_0x277df3['body'],null))[_0x5fb7('0x23')](respondWithResult(_0xcb5e17,null))[_0x5fb7('0x43')](handleError(_0xcb5e17,null));};exports[_0x5fb7('0x24')]=function(_0x4cebca,_0x188d8b){return db[_0x5fb7('0x29')]['find']({'where':{'id':_0x4cebca[_0x5fb7('0x45')]['id']}})[_0x5fb7('0x23')](handleEntityNotFound(_0x188d8b,null))[_0x5fb7('0x23')](removeEntity(_0x188d8b,null))[_0x5fb7('0x43')](handleError(_0x188d8b,null));};
\ No newline at end of file
index 1efc10e..3443de4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xed3b=['../../config/environment','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','analytics_report_trees','lodash','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x836465,_0x5442ae){var _0x2150ea=function(_0x4f4bc2){while(--_0x4f4bc2){_0x836465['push'](_0x836465['shift']());}};_0x2150ea(++_0x5442ae);}(_0xed3b,0x68));var _0xbed3=function(_0xab4668,_0x2419f3){_0xab4668=_0xab4668-0x0;var _0x19410d=_0xed3b[_0xab4668];return _0x19410d;};'use strict';var _=require(_0xbed3('0x0'));var util=require(_0xbed3('0x1'));var logger=require('../../config/logger')(_0xbed3('0x2'));var moment=require(_0xbed3('0x3'));var BPromise=require(_0xbed3('0x4'));var rp=require(_0xbed3('0x5'));var fs=require('fs');var path=require(_0xbed3('0x6'));var rimraf=require(_0xbed3('0x7'));var config=require(_0xbed3('0x8'));var attributes=require(_0xbed3('0x9'));module[_0xbed3('0xa')]=function(_0x502b34,_0x2243e8){return _0x502b34[_0xbed3('0xb')](_0xbed3('0xc'),attributes,{'tableName':_0xbed3('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa7b0=['analytics_report_trees','lodash','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./analyticTreeReport.attributes','AnalyticTreeReport'];(function(_0x35fccf,_0x3cad3b){var _0x58831a=function(_0x59faa4){while(--_0x59faa4){_0x35fccf['push'](_0x35fccf['shift']());}};_0x58831a(++_0x3cad3b);}(_0xa7b0,0xa1));var _0x0a7b=function(_0x49beea,_0x47add1){_0x49beea=_0x49beea-0x0;var _0x27693a=_0xa7b0[_0x49beea];return _0x27693a;};'use strict';var _=require(_0x0a7b('0x0'));var util=require('util');var logger=require(_0x0a7b('0x1'))(_0x0a7b('0x2'));var moment=require('moment');var BPromise=require(_0x0a7b('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a7b('0x4'));var rimraf=require(_0x0a7b('0x5'));var config=require(_0x0a7b('0x6'));var attributes=require(_0x0a7b('0x7'));module['exports']=function(_0x3a59a5,_0x9df57f){return _0x3a59a5['define'](_0x0a7b('0x8'),attributes,{'tableName':_0x0a7b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index a2f2211..99c1642 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xadb5=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x5bb9ac,_0x417c09){var _0x38fd65=function(_0x17b739){while(--_0x17b739){_0x5bb9ac['push'](_0x5bb9ac['shift']());}};_0x38fd65(++_0x417c09);}(_0xadb5,0xad));var _0x5adb=function(_0x41e1ed,_0x336b60){_0x41e1ed=_0x41e1ed-0x0;var _0x34c3d7=_0xadb5[_0x41e1ed];return _0x34c3d7;};'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
+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(_0xc352bd,_0x312795){var _0x10e333=function(_0x9fc6bd){while(--_0x9fc6bd){_0xc352bd['push'](_0xc352bd['shift']());}};_0x10e333(++_0x312795);}(_0xadb5,0xad));var _0x5adb=function(_0x28813c,_0xce074e){_0x28813c=_0x28813c-0x0;var _0x4cd4bb=_0xadb5[_0x28813c];return _0x4cd4bb;};'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 a8505c9..54fcec6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaf09=['/:id','show','delete','destroy','exports','util','express','Router','fs-extra','../../components/auth/service','../../config/environment','./analyticTreeReport.controller','isAuthenticated','index'];(function(_0x3fcab0,_0x5874eb){var _0x1fa5de=function(_0x1ceb06){while(--_0x1ceb06){_0x3fcab0['push'](_0x3fcab0['shift']());}};_0x1fa5de(++_0x5874eb);}(_0xaf09,0x10f));var _0x9af0=function(_0x16de68,_0x33d7ff){_0x16de68=_0x16de68-0x0;var _0x1c277e=_0xaf09[_0x16de68];return _0x1c277e;};'use strict';var multer=require('multer');var util=require(_0x9af0('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x9af0('0x1'));var router=express[_0x9af0('0x2')]();var fs_extra=require(_0x9af0('0x3'));var auth=require(_0x9af0('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x9af0('0x5'));var controller=require(_0x9af0('0x6'));router['get']('/',auth[_0x9af0('0x7')](),controller[_0x9af0('0x8')]);router['get'](_0x9af0('0x9'),auth[_0x9af0('0x7')](),controller[_0x9af0('0xa')]);router['post']('/',auth[_0x9af0('0x7')](),controller['create']);router['put'](_0x9af0('0x9'),auth[_0x9af0('0x7')](),controller['update']);router[_0x9af0('0xb')]('/:id',auth[_0x9af0('0x7')](),controller[_0x9af0('0xc')]);module[_0x9af0('0xd')]=router;
\ No newline at end of file
+var _0x2ad4=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','isAuthenticated','index','/:id','post','create','put','delete','destroy'];(function(_0x5d1566,_0x3fed4b){var _0x3441a2=function(_0x57c3fe){while(--_0x57c3fe){_0x5d1566['push'](_0x5d1566['shift']());}};_0x3441a2(++_0x3fed4b);}(_0x2ad4,0x12d));var _0x42ad=function(_0x2de81b,_0x322f1d){_0x2de81b=_0x2de81b-0x0;var _0x3df553=_0x2ad4[_0x2de81b];return _0x3df553;};'use strict';var multer=require(_0x42ad('0x0'));var util=require(_0x42ad('0x1'));var path=require(_0x42ad('0x2'));var timeout=require(_0x42ad('0x3'));var express=require(_0x42ad('0x4'));var router=express[_0x42ad('0x5')]();var fs_extra=require(_0x42ad('0x6'));var auth=require(_0x42ad('0x7'));var interaction=require(_0x42ad('0x8'));var config=require(_0x42ad('0x9'));var controller=require(_0x42ad('0xa'));router['get']('/',auth[_0x42ad('0xb')](),controller[_0x42ad('0xc')]);router['get'](_0x42ad('0xd'),auth[_0x42ad('0xb')](),controller['show']);router[_0x42ad('0xe')]('/',auth['isAuthenticated'](),controller[_0x42ad('0xf')]);router[_0x42ad('0x10')](_0x42ad('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x42ad('0x11')](_0x42ad('0xd'),auth[_0x42ad('0xb')](),controller[_0x42ad('0x12')]);module[_0x42ad('0x13')]=router;
\ No newline at end of file
index 6cbbe82..0d242d7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5636=['sequelize','exports'];(function(_0x5abdef,_0x5ac510){var _0x1c2c1c=function(_0x3032a2){while(--_0x3032a2){_0x5abdef['push'](_0x5abdef['shift']());}};_0x1c2c1c(++_0x5ac510);}(_0x5636,0x102));var _0x6563=function(_0x53c82d,_0x12eaba){_0x53c82d=_0x53c82d-0x0;var _0x300e93=_0x5636[_0x53c82d];return _0x300e93;};'use strict';var Sequelize=require(_0x6563('0x0'));module[_0x6563('0x1')]={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x56e6=['exports','STRING','sequelize'];(function(_0x36140c,_0x5190e7){var _0x128ddd=function(_0x1be27b){while(--_0x1be27b){_0x36140c['push'](_0x36140c['shift']());}};_0x128ddd(++_0x5190e7);}(_0x56e6,0x6b));var _0x656e=function(_0x5476c8,_0x12cc06){_0x5476c8=_0x5476c8-0x0;var _0x4e3bac=_0x56e6[_0x5476c8];return _0x4e3bac;};'use strict';var Sequelize=require(_0x656e('0x0'));module[_0x656e('0x1')]={'name':{'type':Sequelize[_0x656e('0x2')]},'basename':{'type':Sequelize[_0x656e('0x2')]},'type':{'type':Sequelize[_0x656e('0x2')]}};
\ No newline at end of file
index 9c75ddb..9722e8c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xea2a=['fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','save','update','then','destroy','stack','name','send','index','map','Attachment','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filters','filter','VIRTUAL','merge','options','includeAll','catch','show','params','include','find','clone','get','omit','createdAt','updatedAt','body','create','file','originalname','basename','filename','findOne','ChatOfflineMessageId','join','server/files/attachments/','offline-chat/','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xea2a,0xa7));var _0xaea2=function(_0x3496bb,_0x53ab1b){_0x3496bb=_0x3496bb-0x0;var _0x41aa58=_0xea2a[_0x3496bb];return _0x41aa58;};'use strict';var emlformat=require(_0xaea2('0x0'));var rimraf=require(_0xaea2('0x1'));var zipdir=require(_0xaea2('0x2'));var jsonpatch=require(_0xaea2('0x3'));var rp=require(_0xaea2('0x4'));var moment=require(_0xaea2('0x5'));var BPromise=require(_0xaea2('0x6'));var Mustache=require(_0xaea2('0x7'));var util=require(_0xaea2('0x8'));var path=require(_0xaea2('0x9'));var sox=require(_0xaea2('0xa'));var csv=require(_0xaea2('0xb'));var ejs=require(_0xaea2('0xc'));var fs=require('fs');var fs_extra=require(_0xaea2('0xd'));var _=require('lodash');var squel=require(_0xaea2('0xe'));var crypto=require(_0xaea2('0xf'));var jsforce=require(_0xaea2('0x10'));var deskjs=require(_0xaea2('0x11'));var toCsv=require(_0xaea2('0xb'));var querystring=require(_0xaea2('0x12'));var Papa=require(_0xaea2('0x13'));var Redis=require(_0xaea2('0x14'));var authService=require('../../components/auth/service');var qs=require(_0xaea2('0x15'));var as=require(_0xaea2('0x16'));var hardwareService=require(_0xaea2('0x17'));var logger=require('../../config/logger')(_0xaea2('0x18'));var utils=require('../../config/utils');var config=require(_0xaea2('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xaea2('0x1a'))['db'];function respondWithStatusCode(_0x167ba7,_0x4986b1){_0x4986b1=_0x4986b1||0xcc;return function(_0x2a6815){if(_0x2a6815){return _0x167ba7[_0xaea2('0x1b')](_0x4986b1);}return _0x167ba7[_0xaea2('0x1c')](_0x4986b1)[_0xaea2('0x1d')]();};}function respondWithResult(_0x27ba2d,_0x68d596){_0x68d596=_0x68d596||0xc8;return function(_0x54a280){if(_0x54a280){return _0x27ba2d[_0xaea2('0x1c')](_0x68d596)['json'](_0x54a280);}};}function respondWithFilteredResult(_0x3354c0,_0x3509de){return function(_0x33b614){if(_0x33b614){var _0x3ddf50=typeof _0x3509de[_0xaea2('0x1e')]===_0xaea2('0x1f')&&typeof _0x3509de[_0xaea2('0x20')]==='undefined';var _0x5a4ebf=_0x33b614['count'];var _0x43c367=_0x3ddf50?0x0:_0x3509de[_0xaea2('0x1e')];var _0x2b0734=_0x3ddf50?_0x33b614[_0xaea2('0x21')]:_0x3509de[_0xaea2('0x1e')]+_0x3509de['limit'];var _0xb104d3;if(_0x2b0734>=_0x5a4ebf){_0x2b0734=_0x5a4ebf;_0xb104d3=0xc8;}else{_0xb104d3=0xce;}_0x3354c0[_0xaea2('0x1c')](_0xb104d3);return _0x3354c0[_0xaea2('0x22')]('Content-Range',_0x43c367+'-'+_0x2b0734+'/'+_0x5a4ebf)[_0xaea2('0x23')](_0x33b614);}return null;};}function patchUpdates(_0x4f4a72){return function(_0x19863b){try{jsonpatch[_0xaea2('0x24')](_0x19863b,_0x4f4a72,!![]);}catch(_0x5b3e6f){return BPromise[_0xaea2('0x25')](_0x5b3e6f);}return _0x19863b[_0xaea2('0x26')]();};}function saveUpdates(_0x14a1f4,_0x4b12c0){return function(_0x5160a9){if(_0x5160a9){return _0x5160a9[_0xaea2('0x27')](_0x14a1f4)[_0xaea2('0x28')](function(_0x228f7f){return _0x228f7f;});}return null;};}function removeEntity(_0x333091,_0x36bfda){return function(_0x5b3bea){if(_0x5b3bea){return _0x5b3bea[_0xaea2('0x29')]()[_0xaea2('0x28')](function(){_0x333091['status'](0xcc)[_0xaea2('0x1d')]();});}};}function handleEntityNotFound(_0xf0df98,_0x43375e){return function(_0x2ffe73){if(!_0x2ffe73){_0xf0df98[_0xaea2('0x1b')](0x194);}return _0x2ffe73;};}function handleError(_0x467812,_0x148622){_0x148622=_0x148622||0x1f4;return function(_0x437be6){logger['error'](_0x437be6[_0xaea2('0x2a')]);if(_0x437be6[_0xaea2('0x2b')]){delete _0x437be6[_0xaea2('0x2b')];}_0x467812[_0xaea2('0x1c')](_0x148622)[_0xaea2('0x2c')](_0x437be6);};}exports[_0xaea2('0x2d')]=function(_0xc2c58f,_0x468f26){var _0x1dffd1={},_0x2b5bc4={},_0x36a077={'count':0x0,'rows':[]};var _0x348549=_[_0xaea2('0x2e')](db[_0xaea2('0x2f')][_0xaea2('0x30')],function(_0x37197b){return{'name':_0x37197b[_0xaea2('0x31')],'type':_0x37197b[_0xaea2('0x32')][_0xaea2('0x33')]};});_0x2b5bc4[_0xaea2('0x34')]=_[_0xaea2('0x2e')](_0x348549,_0xaea2('0x2b'));_0x2b5bc4[_0xaea2('0x35')]=_[_0xaea2('0x36')](_0xc2c58f['query']);_0x2b5bc4['filters']=_[_0xaea2('0x37')](_0x2b5bc4[_0xaea2('0x34')],_0x2b5bc4[_0xaea2('0x35')]);_0x1dffd1[_0xaea2('0x38')]=_['intersection'](_0x2b5bc4['model'],qs['fields'](_0xc2c58f[_0xaea2('0x35')][_0xaea2('0x39')]));_0x1dffd1[_0xaea2('0x38')]=_0x1dffd1[_0xaea2('0x38')][_0xaea2('0x3a')]?_0x1dffd1['attributes']:_0x2b5bc4[_0xaea2('0x34')];if(!_0xc2c58f[_0xaea2('0x35')]['hasOwnProperty'](_0xaea2('0x3b'))){_0x1dffd1['limit']=qs[_0xaea2('0x20')](_0xc2c58f[_0xaea2('0x35')][_0xaea2('0x20')]);_0x1dffd1['offset']=qs[_0xaea2('0x1e')](_0xc2c58f[_0xaea2('0x35')][_0xaea2('0x1e')]);}_0x1dffd1[_0xaea2('0x3c')]=qs[_0xaea2('0x3d')](_0xc2c58f[_0xaea2('0x35')][_0xaea2('0x3d')]);_0x1dffd1[_0xaea2('0x3e')]=qs[_0xaea2('0x3f')](_['pick'](_0xc2c58f[_0xaea2('0x35')],_0x2b5bc4['filters']),_0x348549);if(_0xc2c58f[_0xaea2('0x35')][_0xaea2('0x40')]){_0x1dffd1[_0xaea2('0x3e')]=_['merge'](_0x1dffd1[_0xaea2('0x3e')],{'$or':_[_0xaea2('0x2e')](_0x348549,function(_0x25f824){if(_0x25f824[_0xaea2('0x32')]!==_0xaea2('0x41')){var _0x12d8b1={};_0x12d8b1[_0x25f824[_0xaea2('0x2b')]]={'$like':'%'+_0xc2c58f[_0xaea2('0x35')][_0xaea2('0x40')]+'%'};return _0x12d8b1;}})});}_0x1dffd1=_[_0xaea2('0x42')]({},_0x1dffd1,_0xc2c58f[_0xaea2('0x43')]);var _0x15af3c={'where':_0x1dffd1[_0xaea2('0x3e')]};return db[_0xaea2('0x2f')][_0xaea2('0x21')](_0x15af3c)[_0xaea2('0x28')](function(_0x182734){_0x36a077[_0xaea2('0x21')]=_0x182734;if(_0xc2c58f[_0xaea2('0x35')][_0xaea2('0x44')]){_0x1dffd1['include']=[{'all':!![]}];}return db['Attachment']['findAll'](_0x1dffd1);})[_0xaea2('0x28')](function(_0xb51ab4){_0x36a077['rows']=_0xb51ab4;return _0x36a077;})[_0xaea2('0x28')](respondWithFilteredResult(_0x468f26,_0x1dffd1))[_0xaea2('0x45')](handleError(_0x468f26,null));};exports[_0xaea2('0x46')]=function(_0x5b7f54,_0x11eddf){var _0x3ba52c={'raw':!![],'where':{'id':_0x5b7f54[_0xaea2('0x47')]['id']}},_0x4ebb60={};_0x4ebb60[_0xaea2('0x34')]=_[_0xaea2('0x36')](db[_0xaea2('0x2f')][_0xaea2('0x30')]);_0x4ebb60['query']=_[_0xaea2('0x36')](_0x5b7f54[_0xaea2('0x35')]);_0x4ebb60['filters']=_[_0xaea2('0x37')](_0x4ebb60[_0xaea2('0x34')],_0x4ebb60[_0xaea2('0x35')]);_0x3ba52c['attributes']=_[_0xaea2('0x37')](_0x4ebb60[_0xaea2('0x34')],qs[_0xaea2('0x39')](_0x5b7f54['query'][_0xaea2('0x39')]));_0x3ba52c['attributes']=_0x3ba52c['attributes'][_0xaea2('0x3a')]?_0x3ba52c['attributes']:_0x4ebb60[_0xaea2('0x34')];if(_0x5b7f54[_0xaea2('0x35')]['includeAll']){_0x3ba52c[_0xaea2('0x48')]=[{'all':!![]}];}_0x3ba52c=_['merge']({},_0x3ba52c,_0x5b7f54[_0xaea2('0x43')]);return db[_0xaea2('0x2f')][_0xaea2('0x49')](_0x3ba52c)[_0xaea2('0x28')](handleEntityNotFound(_0x11eddf,null))[_0xaea2('0x28')](respondWithResult(_0x11eddf,null))[_0xaea2('0x45')](handleError(_0x11eddf,null));};exports[_0xaea2('0x4a')]=function(_0x5edcc6,_0x173b90){var _0x160843={'where':{'id':_0x5edcc6['params']['id']}},_0x4a8aa8={};_0x4a8aa8[_0xaea2('0x34')]=_[_0xaea2('0x36')](db[_0xaea2('0x2f')][_0xaea2('0x30')]);_0x160843[_0xaea2('0x38')]=_[_0xaea2('0x37')](_0x4a8aa8['model'],qs[_0xaea2('0x39')](_0x5edcc6[_0xaea2('0x35')][_0xaea2('0x39')]));_0x160843[_0xaea2('0x38')]=_0x160843[_0xaea2('0x38')][_0xaea2('0x3a')]?_0x160843[_0xaea2('0x38')]:_0x4a8aa8[_0xaea2('0x34')];if(_0x5edcc6['query'][_0xaea2('0x44')]){_0x160843[_0xaea2('0x48')]=[{'all':!![]}];}_0x160843=_[_0xaea2('0x42')]({},_0x160843,_0x5edcc6[_0xaea2('0x43')]);return db[_0xaea2('0x2f')][_0xaea2('0x49')](_0x160843)[_0xaea2('0x28')](handleEntityNotFound(_0x173b90,null))[_0xaea2('0x28')](function(_0x28557d){if(_0x28557d){var _0xf0c395=_0x28557d[_0xaea2('0x4b')]({'plain':!![]});_0xf0c395=qs[_0xaea2('0x4c')](_0xf0c395,['id',_0xaea2('0x4d'),_0xaea2('0x4e')]);_0x5edcc6[_0xaea2('0x4f')]=_[_0xaea2('0x4c')](_0x5edcc6['body'],['id',_0xaea2('0x4d'),_0xaea2('0x4e')]);return db['Attachment']['create'](_['merge'](_0xf0c395,_0x5edcc6[_0xaea2('0x4f')]),{'include':_0x5edcc6[_0xaea2('0x35')][_0xaea2('0x44')]?[{'all':!![]}]:undefined});}})[_0xaea2('0x28')](respondWithResult(_0x173b90,0xc9))[_0xaea2('0x45')](handleError(_0x173b90,null));};exports[_0xaea2('0x27')]=function(_0xe1bc15,_0x3fcce4){if(_0xe1bc15[_0xaea2('0x4f')]['id']){delete _0xe1bc15[_0xaea2('0x4f')]['id'];}return db[_0xaea2('0x2f')][_0xaea2('0x49')]({'where':{'id':_0xe1bc15['params']['id']}})[_0xaea2('0x28')](handleEntityNotFound(_0x3fcce4,null))[_0xaea2('0x28')](saveUpdates(_0xe1bc15[_0xaea2('0x4f')],null))[_0xaea2('0x28')](respondWithResult(_0x3fcce4,null))[_0xaea2('0x45')](handleError(_0x3fcce4,null));};exports['destroy']=function(_0xd5382f,_0x590010){return db[_0xaea2('0x2f')][_0xaea2('0x49')]({'where':{'id':_0xd5382f[_0xaea2('0x47')]['id']}})['then'](handleEntityNotFound(_0x590010,null))[_0xaea2('0x28')](removeEntity(_0x590010,null))[_0xaea2('0x45')](handleError(_0x590010,null));};exports[_0xaea2('0x50')]=function(_0x351717,_0x2a35ce,_0xa890f7){_0x351717['body'][_0xaea2('0x2b')]=_0x351717[_0xaea2('0x51')][_0xaea2('0x52')];_0x351717[_0xaea2('0x4f')][_0xaea2('0x53')]=_0x351717[_0xaea2('0x51')][_0xaea2('0x54')];_0x351717[_0xaea2('0x4f')][_0xaea2('0x32')]=_0x351717[_0xaea2('0x51')]['mimetype'];return db[_0xaea2('0x2f')]['create'](_0x351717[_0xaea2('0x4f')])[_0xaea2('0x28')](respondWithResult(_0x2a35ce,0xc9))[_0xaea2('0x45')](handleError(_0x2a35ce,null));};exports['download']=function(_0x44b425,_0x370d0f,_0x41a61a){return db['Attachment'][_0xaea2('0x55')]({'where':{'id':_0x44b425[_0xaea2('0x47')]['id']},'raw':!![]})[_0xaea2('0x28')](handleEntityNotFound(_0x370d0f,null))[_0xaea2('0x28')](function(_0x1af4e9){if(_0x1af4e9){var _0x4642a8=_0x1af4e9[_0xaea2('0x56')]!==null;var _0x4b0808=path[_0xaea2('0x57')](config['root'],_0xaea2('0x58'));if(_0x4642a8){_0x4b0808=path[_0xaea2('0x57')](_0x4b0808,_0xaea2('0x59'));}var _0x43083a=path['join'](_0x4b0808,_0x1af4e9[_0xaea2('0x53')]);return _0x370d0f['download'](_0x43083a);}})[_0xaea2('0x45')](handleError(_0x370d0f,null));};
\ No newline at end of file
+var _0xfec7=['body','omit','updatedAt','create','update','file','originalname','basename','mimetype','findOne','join','root','server/files/attachments/','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined','limit','offset','count','set','Content-Range','apply','reject','then','destroy','end','error','stack','name','send','index','map','Attachment','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','type','options','include','findAll','rows','catch','show','params','keys','rawAttributes','includeAll','clone','find','get','createdAt'];(function(_0x4c7935,_0x4a53fb){var _0x30651d=function(_0x12f35f){while(--_0x12f35f){_0x4c7935['push'](_0x4c7935['shift']());}};_0x30651d(++_0x4a53fb);}(_0xfec7,0x112));var _0x7fec=function(_0x58b84b,_0x1a464b){_0x58b84b=_0x58b84b-0x0;var _0x43d902=_0xfec7[_0x58b84b];return _0x43d902;};'use strict';var emlformat=require(_0x7fec('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7fec('0x1'));var jsonpatch=require(_0x7fec('0x2'));var rp=require(_0x7fec('0x3'));var moment=require(_0x7fec('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x7fec('0x5'));var util=require(_0x7fec('0x6'));var path=require('path');var sox=require(_0x7fec('0x7'));var csv=require(_0x7fec('0x8'));var ejs=require(_0x7fec('0x9'));var fs=require('fs');var fs_extra=require(_0x7fec('0xa'));var _=require(_0x7fec('0xb'));var squel=require(_0x7fec('0xc'));var crypto=require('crypto');var jsforce=require(_0x7fec('0xd'));var deskjs=require(_0x7fec('0xe'));var toCsv=require(_0x7fec('0x8'));var querystring=require(_0x7fec('0xf'));var Papa=require(_0x7fec('0x10'));var Redis=require(_0x7fec('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x7fec('0x12'));var as=require(_0x7fec('0x13'));var hardwareService=require(_0x7fec('0x14'));var logger=require(_0x7fec('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x7fec('0x16'));var licenseUtil=require(_0x7fec('0x17'));var db=require(_0x7fec('0x18'))['db'];function respondWithStatusCode(_0xca6401,_0x209f2b){_0x209f2b=_0x209f2b||0xcc;return function(_0x17bc19){if(_0x17bc19){return _0xca6401[_0x7fec('0x19')](_0x209f2b);}return _0xca6401[_0x7fec('0x1a')](_0x209f2b)['end']();};}function respondWithResult(_0xdd3dd4,_0x577151){_0x577151=_0x577151||0xc8;return function(_0x507092){if(_0x507092){return _0xdd3dd4[_0x7fec('0x1a')](_0x577151)['json'](_0x507092);}};}function respondWithFilteredResult(_0x43bac2,_0x2a1b56){return function(_0x42c8ca){if(_0x42c8ca){var _0xfa167e=typeof _0x2a1b56['offset']===_0x7fec('0x1b')&&typeof _0x2a1b56[_0x7fec('0x1c')]===_0x7fec('0x1b');var _0x1cc59a=_0x42c8ca['count'];var _0x26c355=_0xfa167e?0x0:_0x2a1b56[_0x7fec('0x1d')];var _0x4ad22e=_0xfa167e?_0x42c8ca[_0x7fec('0x1e')]:_0x2a1b56[_0x7fec('0x1d')]+_0x2a1b56[_0x7fec('0x1c')];var _0x5e7dea;if(_0x4ad22e>=_0x1cc59a){_0x4ad22e=_0x1cc59a;_0x5e7dea=0xc8;}else{_0x5e7dea=0xce;}_0x43bac2[_0x7fec('0x1a')](_0x5e7dea);return _0x43bac2[_0x7fec('0x1f')](_0x7fec('0x20'),_0x26c355+'-'+_0x4ad22e+'/'+_0x1cc59a)['json'](_0x42c8ca);}return null;};}function patchUpdates(_0x31497d){return function(_0x3c5d8e){try{jsonpatch[_0x7fec('0x21')](_0x3c5d8e,_0x31497d,!![]);}catch(_0xcc8a86){return BPromise[_0x7fec('0x22')](_0xcc8a86);}return _0x3c5d8e['save']();};}function saveUpdates(_0x14e54d,_0x3c5cfe){return function(_0x1ba84b){if(_0x1ba84b){return _0x1ba84b['update'](_0x14e54d)[_0x7fec('0x23')](function(_0x551ef1){return _0x551ef1;});}return null;};}function removeEntity(_0x3ca971,_0x2fb33a){return function(_0x100f24){if(_0x100f24){return _0x100f24[_0x7fec('0x24')]()[_0x7fec('0x23')](function(){_0x3ca971[_0x7fec('0x1a')](0xcc)[_0x7fec('0x25')]();});}};}function handleEntityNotFound(_0x469529,_0x535f57){return function(_0x3df643){if(!_0x3df643){_0x469529[_0x7fec('0x19')](0x194);}return _0x3df643;};}function handleError(_0x498c5e,_0x284124){_0x284124=_0x284124||0x1f4;return function(_0x178974){logger[_0x7fec('0x26')](_0x178974[_0x7fec('0x27')]);if(_0x178974['name']){delete _0x178974[_0x7fec('0x28')];}_0x498c5e[_0x7fec('0x1a')](_0x284124)[_0x7fec('0x29')](_0x178974);};}exports[_0x7fec('0x2a')]=function(_0x28b491,_0x5dc91a){var _0x5a7097={},_0x2e0b79={},_0x9b8427={'count':0x0,'rows':[]};var _0x4129f6=_[_0x7fec('0x2b')](db[_0x7fec('0x2c')]['rawAttributes'],function(_0x1bfa3e){return{'name':_0x1bfa3e['fieldName'],'type':_0x1bfa3e['type']['key']};});_0x2e0b79[_0x7fec('0x2d')]=_[_0x7fec('0x2b')](_0x4129f6,_0x7fec('0x28'));_0x2e0b79[_0x7fec('0x2e')]=_['keys'](_0x28b491[_0x7fec('0x2e')]);_0x2e0b79['filters']=_[_0x7fec('0x2f')](_0x2e0b79[_0x7fec('0x2d')],_0x2e0b79[_0x7fec('0x2e')]);_0x5a7097[_0x7fec('0x30')]=_[_0x7fec('0x2f')](_0x2e0b79[_0x7fec('0x2d')],qs['fields'](_0x28b491['query'][_0x7fec('0x31')]));_0x5a7097[_0x7fec('0x30')]=_0x5a7097[_0x7fec('0x30')][_0x7fec('0x32')]?_0x5a7097[_0x7fec('0x30')]:_0x2e0b79['model'];if(!_0x28b491['query'][_0x7fec('0x33')](_0x7fec('0x34'))){_0x5a7097[_0x7fec('0x1c')]=qs['limit'](_0x28b491[_0x7fec('0x2e')][_0x7fec('0x1c')]);_0x5a7097[_0x7fec('0x1d')]=qs[_0x7fec('0x1d')](_0x28b491[_0x7fec('0x2e')][_0x7fec('0x1d')]);}_0x5a7097[_0x7fec('0x35')]=qs[_0x7fec('0x36')](_0x28b491[_0x7fec('0x2e')][_0x7fec('0x36')]);_0x5a7097[_0x7fec('0x37')]=qs['filters'](_['pick'](_0x28b491[_0x7fec('0x2e')],_0x2e0b79[_0x7fec('0x38')]),_0x4129f6);if(_0x28b491['query'][_0x7fec('0x39')]){_0x5a7097['where']=_[_0x7fec('0x3a')](_0x5a7097[_0x7fec('0x37')],{'$or':_[_0x7fec('0x2b')](_0x4129f6,function(_0x251960){if(_0x251960[_0x7fec('0x3b')]!=='VIRTUAL'){var _0x41a1a4={};_0x41a1a4[_0x251960[_0x7fec('0x28')]]={'$like':'%'+_0x28b491[_0x7fec('0x2e')]['filter']+'%'};return _0x41a1a4;}})});}_0x5a7097=_['merge']({},_0x5a7097,_0x28b491[_0x7fec('0x3c')]);var _0x2b5b61={'where':_0x5a7097[_0x7fec('0x37')]};return db[_0x7fec('0x2c')]['count'](_0x2b5b61)[_0x7fec('0x23')](function(_0x185537){_0x9b8427[_0x7fec('0x1e')]=_0x185537;if(_0x28b491['query']['includeAll']){_0x5a7097[_0x7fec('0x3d')]=[{'all':!![]}];}return db[_0x7fec('0x2c')][_0x7fec('0x3e')](_0x5a7097);})[_0x7fec('0x23')](function(_0x3759cd){_0x9b8427[_0x7fec('0x3f')]=_0x3759cd;return _0x9b8427;})[_0x7fec('0x23')](respondWithFilteredResult(_0x5dc91a,_0x5a7097))[_0x7fec('0x40')](handleError(_0x5dc91a,null));};exports[_0x7fec('0x41')]=function(_0x553118,_0x2969ff){var _0x5573e7={'raw':!![],'where':{'id':_0x553118[_0x7fec('0x42')]['id']}},_0x9fdc4b={};_0x9fdc4b[_0x7fec('0x2d')]=_[_0x7fec('0x43')](db[_0x7fec('0x2c')][_0x7fec('0x44')]);_0x9fdc4b[_0x7fec('0x2e')]=_[_0x7fec('0x43')](_0x553118[_0x7fec('0x2e')]);_0x9fdc4b[_0x7fec('0x38')]=_['intersection'](_0x9fdc4b[_0x7fec('0x2d')],_0x9fdc4b[_0x7fec('0x2e')]);_0x5573e7['attributes']=_[_0x7fec('0x2f')](_0x9fdc4b[_0x7fec('0x2d')],qs[_0x7fec('0x31')](_0x553118['query']['fields']));_0x5573e7[_0x7fec('0x30')]=_0x5573e7[_0x7fec('0x30')][_0x7fec('0x32')]?_0x5573e7[_0x7fec('0x30')]:_0x9fdc4b[_0x7fec('0x2d')];if(_0x553118[_0x7fec('0x2e')][_0x7fec('0x45')]){_0x5573e7['include']=[{'all':!![]}];}_0x5573e7=_[_0x7fec('0x3a')]({},_0x5573e7,_0x553118[_0x7fec('0x3c')]);return db[_0x7fec('0x2c')]['find'](_0x5573e7)[_0x7fec('0x23')](handleEntityNotFound(_0x2969ff,null))[_0x7fec('0x23')](respondWithResult(_0x2969ff,null))[_0x7fec('0x40')](handleError(_0x2969ff,null));};exports[_0x7fec('0x46')]=function(_0x24262b,_0x1c83cc){var _0x17ce0b={'where':{'id':_0x24262b[_0x7fec('0x42')]['id']}},_0x54b4a3={};_0x54b4a3[_0x7fec('0x2d')]=_[_0x7fec('0x43')](db[_0x7fec('0x2c')][_0x7fec('0x44')]);_0x17ce0b[_0x7fec('0x30')]=_['intersection'](_0x54b4a3[_0x7fec('0x2d')],qs['fields'](_0x24262b['query'][_0x7fec('0x31')]));_0x17ce0b['attributes']=_0x17ce0b[_0x7fec('0x30')][_0x7fec('0x32')]?_0x17ce0b['attributes']:_0x54b4a3[_0x7fec('0x2d')];if(_0x24262b[_0x7fec('0x2e')][_0x7fec('0x45')]){_0x17ce0b[_0x7fec('0x3d')]=[{'all':!![]}];}_0x17ce0b=_[_0x7fec('0x3a')]({},_0x17ce0b,_0x24262b[_0x7fec('0x3c')]);return db['Attachment'][_0x7fec('0x47')](_0x17ce0b)[_0x7fec('0x23')](handleEntityNotFound(_0x1c83cc,null))['then'](function(_0x31ab72){if(_0x31ab72){var _0x143470=_0x31ab72[_0x7fec('0x48')]({'plain':!![]});_0x143470=qs['omit'](_0x143470,['id',_0x7fec('0x49'),'updatedAt']);_0x24262b[_0x7fec('0x4a')]=_[_0x7fec('0x4b')](_0x24262b[_0x7fec('0x4a')],['id',_0x7fec('0x49'),_0x7fec('0x4c')]);return db[_0x7fec('0x2c')][_0x7fec('0x4d')](_[_0x7fec('0x3a')](_0x143470,_0x24262b[_0x7fec('0x4a')]),{'include':_0x24262b[_0x7fec('0x2e')][_0x7fec('0x45')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x1c83cc,0xc9))['catch'](handleError(_0x1c83cc,null));};exports[_0x7fec('0x4e')]=function(_0x5a2dd9,_0x42cd6e){if(_0x5a2dd9[_0x7fec('0x4a')]['id']){delete _0x5a2dd9[_0x7fec('0x4a')]['id'];}return db[_0x7fec('0x2c')]['find']({'where':{'id':_0x5a2dd9[_0x7fec('0x42')]['id']}})[_0x7fec('0x23')](handleEntityNotFound(_0x42cd6e,null))[_0x7fec('0x23')](saveUpdates(_0x5a2dd9[_0x7fec('0x4a')],null))[_0x7fec('0x23')](respondWithResult(_0x42cd6e,null))['catch'](handleError(_0x42cd6e,null));};exports['destroy']=function(_0x5eeb57,_0x3e1165){return db[_0x7fec('0x2c')][_0x7fec('0x47')]({'where':{'id':_0x5eeb57[_0x7fec('0x42')]['id']}})[_0x7fec('0x23')](handleEntityNotFound(_0x3e1165,null))['then'](removeEntity(_0x3e1165,null))[_0x7fec('0x40')](handleError(_0x3e1165,null));};exports['create']=function(_0x15d539,_0x1abfe7,_0x452a81){_0x15d539[_0x7fec('0x4a')][_0x7fec('0x28')]=_0x15d539[_0x7fec('0x4f')][_0x7fec('0x50')];_0x15d539[_0x7fec('0x4a')][_0x7fec('0x51')]=_0x15d539['file']['filename'];_0x15d539['body'][_0x7fec('0x3b')]=_0x15d539['file'][_0x7fec('0x52')];return db[_0x7fec('0x2c')][_0x7fec('0x4d')](_0x15d539[_0x7fec('0x4a')])[_0x7fec('0x23')](respondWithResult(_0x1abfe7,0xc9))['catch'](handleError(_0x1abfe7,null));};exports['download']=function(_0x11361e,_0x1961f2,_0xda181b){return db[_0x7fec('0x2c')][_0x7fec('0x53')]({'where':{'id':_0x11361e['params']['id']},'raw':!![]})['then'](handleEntityNotFound(_0x1961f2,null))[_0x7fec('0x23')](function(_0x4ec5cb){if(_0x4ec5cb){var _0x373fe9=_0x4ec5cb['ChatOfflineMessageId']!==null;var _0x48e613=path[_0x7fec('0x54')](config[_0x7fec('0x55')],_0x7fec('0x56'));if(_0x373fe9){_0x48e613=path[_0x7fec('0x54')](_0x48e613,'offline-chat/');}var _0x59fe57=path[_0x7fec('0x54')](_0x48e613,_0x4ec5cb[_0x7fec('0x51')]);return _0x1961f2['download'](_0x59fe57);}})[_0x7fec('0x40')](handleError(_0x1961f2,null));};
\ No newline at end of file
index 0942a10..5c63111 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa064=['../../config/environment','define','Attachment','attachments','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa064,0x126));var _0x4a06=function(_0x3727a9,_0x1c2edb){_0x3727a9=_0x3727a9-0x0;var _0xa16806=_0xa064[_0x3727a9];return _0xa16806;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x4a06('0x0'));var moment=require(_0x4a06('0x1'));var BPromise=require(_0x4a06('0x2'));var rp=require(_0x4a06('0x3'));var fs=require('fs');var path=require(_0x4a06('0x4'));var rimraf=require(_0x4a06('0x5'));var config=require(_0x4a06('0x6'));var attributes=require('./attachment.attributes');module['exports']=function(_0x1188bf,_0x512050){return _0x1188bf[_0x4a06('0x7')](_0x4a06('0x8'),attributes,{'tableName':_0x4a06('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6d1c=['rimraf','../../config/environment','./attachment.attributes','exports','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x126026,_0x19498c){var _0x57de09=function(_0x526589){while(--_0x526589){_0x126026['push'](_0x126026['shift']());}};_0x57de09(++_0x19498c);}(_0x6d1c,0x185));var _0xc6d1=function(_0x27bd2c,_0x24bd98){_0x27bd2c=_0x27bd2c-0x0;var _0x3784ea=_0x6d1c[_0x27bd2c];return _0x3784ea;};'use strict';var _=require(_0xc6d1('0x0'));var util=require('util');var logger=require(_0xc6d1('0x1'))(_0xc6d1('0x2'));var moment=require(_0xc6d1('0x3'));var BPromise=require(_0xc6d1('0x4'));var rp=require(_0xc6d1('0x5'));var fs=require('fs');var path=require(_0xc6d1('0x6'));var rimraf=require(_0xc6d1('0x7'));var config=require(_0xc6d1('0x8'));var attributes=require(_0xc6d1('0x9'));module[_0xc6d1('0xa')]=function(_0x553757,_0x2f13d3){return _0x553757['define']('Attachment',attributes,{'tableName':'attachments','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index d8e316e..f2c8d5d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x89c4=['then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateAttachment','Attachment','create','body','options','raw','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0x89c4,0x82));var _0x489c=function(_0x38b55b,_0x240023){_0x38b55b=_0x38b55b-0x0;var _0x1cefe2=_0x89c4[_0x38b55b];return _0x1cefe2;};'use strict';var _=require(_0x489c('0x0'));var util=require(_0x489c('0x1'));var moment=require('moment');var BPromise=require(_0x489c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x489c('0x3'))['db'];var utils=require(_0x489c('0x4'));var logger=require(_0x489c('0x5'))(_0x489c('0x6'));var config=require(_0x489c('0x7'));var jayson=require(_0x489c('0x8'));var client=jayson[_0x489c('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xe5e402,_0x476dfe,_0x122c44){return new BPromise(function(_0xceb82c,_0x5a301e){return client['request'](_0xe5e402,_0x122c44)[_0x489c('0xa')](function(_0x54ea10){logger[_0x489c('0xb')](_0x489c('0xc'),_0x476dfe,_0x489c('0xd'));logger[_0x489c('0xe')](_0x489c('0xf'),_0x476dfe,_0x489c('0xd'),JSON[_0x489c('0x10')](_0x54ea10));if(_0x54ea10[_0x489c('0x11')]){if(_0x54ea10['error'][_0x489c('0x12')]===0x1f4){logger['error'](_0x489c('0xc'),_0x476dfe,_0x54ea10['error']['message']);return _0x5a301e(_0x54ea10[_0x489c('0x11')]['message']);}logger[_0x489c('0x11')]('Attachment,\x20%s,\x20%s',_0x476dfe,_0x54ea10[_0x489c('0x11')][_0x489c('0x13')]);return _0xceb82c(_0x54ea10['error'][_0x489c('0x13')]);}else{logger[_0x489c('0xb')]('Attachment,\x20%s,\x20%s',_0x476dfe,'request\x20sent');_0xceb82c(_0x54ea10[_0x489c('0x14')]['message']);}})[_0x489c('0x15')](function(_0x2e89c4){logger[_0x489c('0x11')](_0x489c('0xc'),_0x476dfe,_0x2e89c4);_0x5a301e(_0x2e89c4);});});}exports[_0x489c('0x16')]=function(_0x4519ce){var _0x44972a=this;return new Promise(function(_0x431782,_0xa91de){return db[_0x489c('0x17')][_0x489c('0x18')](_0x4519ce[_0x489c('0x19')],{'raw':_0x4519ce[_0x489c('0x1a')]?_0x4519ce[_0x489c('0x1a')][_0x489c('0x1b')]===undefined?!![]:![]:!![]})[_0x489c('0xa')](function(_0x14677b){logger[_0x489c('0xb')]('CreateAttachment',_0x4519ce);logger[_0x489c('0xe')](_0x489c('0x16'),_0x4519ce,JSON[_0x489c('0x10')](_0x14677b));_0x431782(_0x14677b);})[_0x489c('0x15')](function(_0x18cf8b){logger['error'](_0x489c('0x16'),_0x18cf8b[_0x489c('0x13')],_0x4519ce);_0xa91de(_0x44972a[_0x489c('0x11')](0x1f4,_0x18cf8b['message']));});});};
\ No newline at end of file
+var _0x39cb=['message','result','catch','CreateAttachment','Attachment','create','body','options','raw','debug','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Attachment,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Attachment,\x20%s,\x20%s'];(function(_0x3835f0,_0x415627){var _0x1d727a=function(_0x122ff2){while(--_0x122ff2){_0x3835f0['push'](_0x3835f0['shift']());}};_0x1d727a(++_0x415627);}(_0x39cb,0x1bd));var _0xb39c=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x39cb[_0x4b369d];return _0x571a98;};'use strict';var _=require('lodash');var util=require(_0xb39c('0x0'));var moment=require(_0xb39c('0x1'));var BPromise=require('bluebird');var rs=require(_0xb39c('0x2'));var fs=require('fs');var Redis=require(_0xb39c('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xb39c('0x4'));var logger=require(_0xb39c('0x5'))(_0xb39c('0x6'));var config=require(_0xb39c('0x7'));var jayson=require(_0xb39c('0x8'));var client=jayson['client'][_0xb39c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2fc868,_0x40112f,_0x3f2fbe){return new BPromise(function(_0x47d6d7,_0x5ae14a){return client[_0xb39c('0xa')](_0x2fc868,_0x3f2fbe)[_0xb39c('0xb')](function(_0x3ffb94){logger[_0xb39c('0xc')]('Attachment,\x20%s,\x20%s',_0x40112f,'request\x20sent');logger['debug'](_0xb39c('0xd'),_0x40112f,_0xb39c('0xe'),JSON[_0xb39c('0xf')](_0x3ffb94));if(_0x3ffb94[_0xb39c('0x10')]){if(_0x3ffb94[_0xb39c('0x10')][_0xb39c('0x11')]===0x1f4){logger[_0xb39c('0x10')](_0xb39c('0x12'),_0x40112f,_0x3ffb94['error'][_0xb39c('0x13')]);return _0x5ae14a(_0x3ffb94[_0xb39c('0x10')][_0xb39c('0x13')]);}logger['error'](_0xb39c('0x12'),_0x40112f,_0x3ffb94[_0xb39c('0x10')][_0xb39c('0x13')]);return _0x47d6d7(_0x3ffb94[_0xb39c('0x10')][_0xb39c('0x13')]);}else{logger[_0xb39c('0xc')](_0xb39c('0x12'),_0x40112f,'request\x20sent');_0x47d6d7(_0x3ffb94[_0xb39c('0x14')][_0xb39c('0x13')]);}})[_0xb39c('0x15')](function(_0x1c2c5f){logger[_0xb39c('0x10')](_0xb39c('0x12'),_0x40112f,_0x1c2c5f);_0x5ae14a(_0x1c2c5f);});});}exports[_0xb39c('0x16')]=function(_0x4e02cf){var _0x35dade=this;return new Promise(function(_0x2eeae6,_0x559ad6){return db[_0xb39c('0x17')][_0xb39c('0x18')](_0x4e02cf[_0xb39c('0x19')],{'raw':_0x4e02cf[_0xb39c('0x1a')]?_0x4e02cf['options'][_0xb39c('0x1b')]===undefined?!![]:![]:!![]})[_0xb39c('0xb')](function(_0x5e4a0b){logger[_0xb39c('0xc')](_0xb39c('0x16'),_0x4e02cf);logger[_0xb39c('0x1c')]('CreateAttachment',_0x4e02cf,JSON['stringify'](_0x5e4a0b));_0x2eeae6(_0x5e4a0b);})[_0xb39c('0x15')](function(_0x1a5b9d){logger[_0xb39c('0x10')]('CreateAttachment',_0x1a5b9d[_0xb39c('0x13')],_0x4e02cf);_0x559ad6(_0x35dade[_0xb39c('0x10')](0x1f4,_0x1a5b9d[_0xb39c('0x13')]));});});};
\ No newline at end of file
index f6bc6cb..5897bf5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-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(_0x1b64be,_0x4ae2c4){var _0x19bfca=function(_0x3928bb){while(--_0x3928bb){_0x1b64be['push'](_0x1b64be['shift']());}};_0x19bfca(++_0x4ae2c4);}(_0x2032,0xd9));var _0x2203=function(_0x1044be,_0x5c324d){_0x1044be=_0x1044be-0x0;var _0x2ac3ab=_0x2032[_0x1044be];return _0x2ac3ab;};'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
+var _0xadb5=['root','format','%s-%s','originalname','replace','file','put','update','delete','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/download','download','post','/:id/clone'];(function(_0xf6b163,_0x520e2e){var _0x55fc52=function(_0x55e0de){while(--_0x55e0de){_0xf6b163['push'](_0xf6b163['shift']());}};_0x55fc52(++_0x520e2e);}(_0xadb5,0xad));var _0x5adb=function(_0x30c1c4,_0x4f9952){_0x30c1c4=_0x30c1c4-0x0;var _0x41ddf8=_0xadb5[_0x30c1c4];return _0x41ddf8;};'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('./attachment.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')](_0x5adb('0xf'),auth[_0x5adb('0x8')](),controller['clone']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1a8f66,_0x1ea238,_0x82e67e){_0x82e67e(null,path['join'](config[_0x5adb('0x10')],'server/files/attachments/'));},'filename':function(_0x2a0b70,_0x5433bf,_0x8cfcc6){_0x8cfcc6(null,util[_0x5adb('0x11')](_0x5adb('0x12'),Date['now'](),_0x5433bf[_0x5adb('0x13')][_0x5adb('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x5adb('0xe')]('/',upload['single'](_0x5adb('0x15')),controller['create']);router[_0x5adb('0x16')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x17')]);router[_0x5adb('0x18')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x19')]);module[_0x5adb('0x1a')]=router;
\ No newline at end of file
index faec0b0..f968162 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x034c=['Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','findOne','adSsoEnabled','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','disabled','blocked','blockedAt','user','agent','domain','blockDuration','minutes','clearBlockUser','getLicense','catch','send','message','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','User','passport-local','Strategy','moment','bluebird','util','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','api','undefined','activedirectory','baseDN','authenticate','error'];(function(_0x55af0d,_0x5db5c9){var _0x245085=function(_0x39d897){while(--_0x39d897){_0x55af0d['push'](_0x55af0d['shift']());}};_0x245085(++_0x5db5c9);}(_0x034c,0xf2));var _0xc034=function(_0x13126c,_0x12afb6){_0x13126c=_0x13126c-0x0;var _0x56736b=_0x034c[_0x13126c];return _0x56736b;};'use strict';var passport=require('passport');var LocalStrategy=require(_0xc034('0x0'))[_0xc034('0x1')];var moment=require(_0xc034('0x2'));var ActiveDirectory=require('activedirectory2');var BPromise=require(_0xc034('0x3'));var util=require(_0xc034('0x4'));var db=require(_0xc034('0x5'))['db'];var authService=require(_0xc034('0x6'));var utils=require(_0xc034('0x7'));var config=require(_0xc034('0x8'));var logger=require(_0xc034('0x9'))(_0xc034('0xa'));function isActiveDirectoryConfigured(_0x5ce7f7){var _0x34b109=![];if(typeof _0x5ce7f7['activedirectory']!==_0xc034('0xb')){_0x34b109=_0x5ce7f7[_0xc034('0xc')][_0xc034('0xd')]&&_0x5ce7f7[_0xc034('0xc')]['url']&&_0x5ce7f7[_0xc034('0xc')]['domain'];}return _0x34b109;}function adAuthenticate(_0x2ae3e9,_0x216313,_0x374ff0){return new BPromise(function(_0x2271e3,_0x1b143f){try{var _0x3e8012=new ActiveDirectory(_0x2ae3e9);_0x3e8012[_0xc034('0xe')](_0x216313,_0x374ff0,function(_0x32eec3,_0x5c4025){if(_0x32eec3){logger[_0xc034('0xf')]('Error\x20authenticate\x20%s:\x20%s',_0x216313,util['inspect'](_0x32eec3,{'showHidden':![],'depth':null}));_0x1b143f(_0xc034('0x10'));}else if(!_0x5c4025){logger[_0xc034('0xf')]('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0x216313);_0x1b143f('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x2271e3(_0x5c4025);}});}catch(_0x30e476){_0x1b143f(_0x30e476);}});}function ActiveDirectoryAuthenticate(_0x579203,_0x220ca7,_0x33b1b1,_0x2387cd){var _0x17922,_0x2d3589;if(!isActiveDirectoryConfigured(config)){logger[_0xc034('0xf')](_0xc034('0x11'),_0x220ca7);return _0x2387cd(null,![],{'message':_0xc034('0x10')});}return db['Setting'][_0xc034('0x12')]({'where':{'id':0x1},'attributes':[_0xc034('0x13'),'blockDuration'],'raw':!![]})[_0xc034('0x14')](function(_0x2607dc){_0x17922=_0x2607dc;if(!_0x17922[_0xc034('0x13')]){logger['error'](_0xc034('0x15'),_0x220ca7);throw new Error(_0xc034('0x10'));}return _0x579203[_0xc034('0x12')]({'logging':!![],'attributes':['id',_0xc034('0x16'),_0xc034('0x17'),'salt','role',_0xc034('0x18'),_0xc034('0x19'),_0xc034('0x1a'),'online'],'where':{'name':_0x220ca7,'role':{'$or':['admin',_0xc034('0x1b'),_0xc034('0x1c')]},'adSsoEnabled':!![]}});})[_0xc034('0x14')](function(_0x276050){if(!_0x276050||_0x276050&&_0x276050[_0xc034('0x16')]!==_0x220ca7){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}_0x2d3589=_0x276050;var _0x56b04a=_0x2d3589[_0xc034('0x16')]+'@'+config['activedirectory'][_0xc034('0x1d')];return adAuthenticate(config[_0xc034('0xc')],_0x56b04a,_0x33b1b1);})[_0xc034('0x14')](function(_0x42f262){if(_0x2d3589[_0xc034('0x18')]){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}if(_0x17922[_0xc034('0x1e')]>0x0){if(_0x2d3589[_0xc034('0x19')]){if(moment(_0x2d3589[_0xc034('0x1a')])['add'](_0x17922['blockDuration'],_0xc034('0x1f'))>moment()){throw new Error(_0xc034('0x10'));}return utils[_0xc034('0x20')](_0x2d3589,0x0,![],null)[_0xc034('0x14')](function(){return utils[_0xc034('0x21')](_0x2d3589);})[_0xc034('0x14')](function(){return _0x2387cd(null,_0x2d3589);});}else{return utils[_0xc034('0x21')](_0x2d3589)[_0xc034('0x14')](function(){return _0x2387cd(null,_0x2d3589);});}}else{return utils[_0xc034('0x21')](_0x2d3589)[_0xc034('0x14')](function(){return _0x2387cd(null,_0x2d3589);});}})[_0xc034('0x22')](function(_0xeee741){return _0x2387cd(null,![],_0xeee741);});}function handleError(_0x2e16c3,_0x332181,_0x55b173){return _0x2e16c3['status'](_0x332181||0x1f4)[_0xc034('0x23')]({'message':_0x55b173?_0x55b173[_0xc034('0x24')]||_0x55b173:''});}exports['login']=function(_0x1d663f,_0x3ca5ad,_0x21c196){passport[_0xc034('0xe')](_0xc034('0x25'),function(_0xb249b,_0x4fbc44,_0x59bd30){var _0x3b4377=_0xb249b||_0x59bd30;if(_0x3b4377){return handleError(_0x3ca5ad,0x191,_0x3b4377);}if(!_0x4fbc44){return handleError(_0x3ca5ad,0x194,{'message':_0xc034('0x26')});}else{var _0x5ad91d={'payload':{'id':_0x4fbc44['id'],'role':_0x4fbc44['role']},'options':{'expiresIn':0x15180}};return authService[_0xc034('0x27')](_0x5ad91d)[_0xc034('0x14')](function(_0x4def1a){_0x3ca5ad[_0xc034('0x28')]({'id':_0x4fbc44['id'],'token':_0x4def1a,'statusCall':'','isAlreadyLogged':_0x4fbc44[_0xc034('0x29')]});});}})(_0x1d663f,_0x3ca5ad,_0x21c196);};passport['use'](_0xc034('0x25'),new LocalStrategy({'usernameField':_0xc034('0x16'),'passwordField':'password'},function(_0x18d7f6,_0x5b2fb9,_0x2dd624){return ActiveDirectoryAuthenticate(db[_0xc034('0x2a')],_0x18d7f6,_0x5b2fb9,_0x2dd624);}));
\ No newline at end of file
+var _0x07b8=['clearBlockUser','getLicense','status','send','message','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','password','passport','Strategy','moment','activedirectory2','bluebird','util','../../mysqldb','../../components/auth/service','../../config/environment','../../config/logger','api','activedirectory','undefined','baseDN','url','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','error','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','salt','role','disabled','blockedAt','online','user','agent','name','domain'];(function(_0xd6ccdc,_0x23b167){var _0x1eac6d=function(_0x198a14){while(--_0x198a14){_0xd6ccdc['push'](_0xd6ccdc['shift']());}};_0x1eac6d(++_0x23b167);}(_0x07b8,0x183));var _0x807b=function(_0x255caf,_0x2f893b){_0x255caf=_0x255caf-0x0;var _0x25e862=_0x07b8[_0x255caf];return _0x25e862;};'use strict';var passport=require(_0x807b('0x0'));var LocalStrategy=require('passport-local')[_0x807b('0x1')];var moment=require(_0x807b('0x2'));var ActiveDirectory=require(_0x807b('0x3'));var BPromise=require(_0x807b('0x4'));var util=require(_0x807b('0x5'));var db=require(_0x807b('0x6'))['db'];var authService=require(_0x807b('0x7'));var utils=require('../../config/utils');var config=require(_0x807b('0x8'));var logger=require(_0x807b('0x9'))(_0x807b('0xa'));function isActiveDirectoryConfigured(_0x550aa5){var _0x20cbe6=![];if(typeof _0x550aa5[_0x807b('0xb')]!==_0x807b('0xc')){_0x20cbe6=_0x550aa5[_0x807b('0xb')][_0x807b('0xd')]&&_0x550aa5[_0x807b('0xb')][_0x807b('0xe')]&&_0x550aa5[_0x807b('0xb')]['domain'];}return _0x20cbe6;}function adAuthenticate(_0x7d8ad1,_0x271b12,_0xb7deab){return new BPromise(function(_0x3c1a74,_0x288c6d){try{var _0x30efed=new ActiveDirectory(_0x7d8ad1);_0x30efed['authenticate'](_0x271b12,_0xb7deab,function(_0x80025c,_0x5edc00){if(_0x80025c){logger['error']('Error\x20authenticate\x20%s:\x20%s',_0x271b12,util[_0x807b('0xf')](_0x80025c,{'showHidden':![],'depth':null}));_0x288c6d(_0x807b('0x10'));}else if(!_0x5edc00){logger[_0x807b('0x11')]('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0x271b12);_0x288c6d(_0x807b('0x10'));}else{_0x3c1a74(_0x5edc00);}});}catch(_0x240fa0){_0x288c6d(_0x240fa0);}});}function ActiveDirectoryAuthenticate(_0x4137d9,_0x577452,_0x578859,_0x111122){var _0x2a193c,_0x547b69;if(!isActiveDirectoryConfigured(config)){logger[_0x807b('0x11')](_0x807b('0x12'),_0x577452);return _0x111122(null,![],{'message':_0x807b('0x10')});}return db[_0x807b('0x13')][_0x807b('0x14')]({'where':{'id':0x1},'attributes':['adSsoEnabled',_0x807b('0x15')],'raw':!![]})[_0x807b('0x16')](function(_0x39be02){_0x2a193c=_0x39be02;if(!_0x2a193c['adSsoEnabled']){logger[_0x807b('0x11')](_0x807b('0x17'),_0x577452);throw new Error(_0x807b('0x10'));}return _0x4137d9['findOne']({'logging':!![],'attributes':['id','name','password',_0x807b('0x18'),_0x807b('0x19'),_0x807b('0x1a'),'blocked',_0x807b('0x1b'),_0x807b('0x1c')],'where':{'name':_0x577452,'role':{'$or':['admin',_0x807b('0x1d'),_0x807b('0x1e')]},'adSsoEnabled':!![]}});})[_0x807b('0x16')](function(_0xc0fc0d){if(!_0xc0fc0d||_0xc0fc0d&&_0xc0fc0d[_0x807b('0x1f')]!==_0x577452){throw new Error(_0x807b('0x10'));}_0x547b69=_0xc0fc0d;var _0x399cbd=_0x547b69[_0x807b('0x1f')]+'@'+config['activedirectory'][_0x807b('0x20')];return adAuthenticate(config[_0x807b('0xb')],_0x399cbd,_0x578859);})[_0x807b('0x16')](function(_0x4eca2c){if(_0x547b69[_0x807b('0x1a')]){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}if(_0x2a193c[_0x807b('0x15')]>0x0){if(_0x547b69['blocked']){if(moment(_0x547b69[_0x807b('0x1b')])['add'](_0x2a193c[_0x807b('0x15')],'minutes')>moment()){throw new Error(_0x807b('0x10'));}return utils[_0x807b('0x21')](_0x547b69,0x0,![],null)['then'](function(){return utils[_0x807b('0x22')](_0x547b69);})[_0x807b('0x16')](function(){return _0x111122(null,_0x547b69);});}else{return utils[_0x807b('0x22')](_0x547b69)[_0x807b('0x16')](function(){return _0x111122(null,_0x547b69);});}}else{return utils[_0x807b('0x22')](_0x547b69)[_0x807b('0x16')](function(){return _0x111122(null,_0x547b69);});}})['catch'](function(_0x3d6889){return _0x111122(null,![],_0x3d6889);});}function handleError(_0x2931f1,_0x3d4e3a,_0x43817d){return _0x2931f1[_0x807b('0x23')](_0x3d4e3a||0x1f4)[_0x807b('0x24')]({'message':_0x43817d?_0x43817d[_0x807b('0x25')]||_0x43817d:''});}exports[_0x807b('0x26')]=function(_0x57ed4b,_0x574891,_0x5ec5a7){passport['authenticate'](_0x807b('0x27'),function(_0x5569b9,_0x1a6de4,_0x52f8a8){var _0x1c2677=_0x5569b9||_0x52f8a8;if(_0x1c2677){return handleError(_0x574891,0x191,_0x1c2677);}if(!_0x1a6de4){return handleError(_0x574891,0x194,{'message':_0x807b('0x28')});}else{var _0x5ee722={'payload':{'id':_0x1a6de4['id'],'role':_0x1a6de4['role']},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x5ee722)['then'](function(_0x158f6a){_0x574891['json']({'id':_0x1a6de4['id'],'token':_0x158f6a,'statusCall':'','isAlreadyLogged':_0x1a6de4[_0x807b('0x1c')]});});}})(_0x57ed4b,_0x574891,_0x5ec5a7);};passport['use'](_0x807b('0x27'),new LocalStrategy({'usernameField':_0x807b('0x1f'),'passwordField':_0x807b('0x29')},function(_0x44df6b,_0x1e3176,_0xbd5052){return ActiveDirectoryAuthenticate(db['User'],_0x44df6b,_0x1e3176,_0xbd5052);}));
\ No newline at end of file
index 8dc1543..fc7c453 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x80b7=['./authActiveDirectory.controller','post','login','exports','express','Router'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x80b7,0x1b4));var _0x780b=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x80b7[_0x321bb2];return _0x9c12ed;};'use strict';var express=require(_0x780b('0x0'));var router=express[_0x780b('0x1')]();var controller=require(_0x780b('0x2'));router[_0x780b('0x3')]('/',controller[_0x780b('0x4')]);module[_0x780b('0x5')]=router;
\ No newline at end of file
+var _0xcc1b=['exports','express','Router','./authActiveDirectory.controller','post','login'];(function(_0x1ea092,_0x448c9e){var _0xd259ea=function(_0x2f059f){while(--_0x2f059f){_0x1ea092['push'](_0x1ea092['shift']());}};_0xd259ea(++_0x448c9e);}(_0xcc1b,0xfd));var _0xbcc1=function(_0x32a337,_0x5a776){_0x32a337=_0x32a337-0x0;var _0x23730f=_0xcc1b[_0x32a337];return _0x23730f;};'use strict';var express=require(_0xbcc1('0x0'));var router=express[_0xbcc1('0x1')]();var controller=require(_0xbcc1('0x2'));router[_0xbcc1('0x3')]('/',controller[_0xbcc1('0x4')]);module[_0xbcc1('0x5')]=router;
\ No newline at end of file
index 8530b5d..7d2105c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0x7a54,0x106));var _0x47a5=function(_0x339cfb,_0xe0335b){_0x339cfb=_0x339cfb-0x0;var _0x1e6df0=_0x7a54[_0x339cfb];return _0x1e6df0;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});}));
\ No newline at end of file
+var _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x38a7ac,_0x45514b){var _0x53061a=function(_0x1d2469){while(--_0x1d2469){_0x38a7ac['push'](_0x38a7ac['shift']());}};_0x53061a(++_0x45514b);}(_0x7a54,0x106));var _0x47a5=function(_0x463d05,_0x48fafe){_0x463d05=_0x463d05-0x0;var _0x2d4014=_0x7a54[_0x463d05];return _0x2d4014;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});}));
\ No newline at end of file
index d80e6da..fac00a4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6aa4=['/callback','callback','isMiddleware','setTokenCookie','exports','express','passport','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','login'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6aa4,0x12e));var _0x46aa=function(_0x3797a7,_0x23263b){_0x3797a7=_0x3797a7-0x0;var _0x2b38c1=_0x6aa4[_0x3797a7];return _0x2b38c1;};'use strict';var express=require(_0x46aa('0x0'));var passport=require(_0x46aa('0x1'));var router=express['Router']();var controller=require(_0x46aa('0x2'));var userController=require(_0x46aa('0x3'));var authService=require(_0x46aa('0x4'));router['get']('/',controller[_0x46aa('0x5')]);router['get'](_0x46aa('0x6'),controller[_0x46aa('0x7')],authService[_0x46aa('0x8')],userController['login'],authService[_0x46aa('0x9')]);module[_0x46aa('0xa')]=router;
\ No newline at end of file
+var _0x66ad=['exports','express','passport','./authGoogle.controller','../user/user.controller.js','get','/callback','callback','login'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x66ad,0x12a));var _0xd66a=function(_0x102147,_0x170d81){_0x102147=_0x102147-0x0;var _0x5e2d52=_0x66ad[_0x102147];return _0x5e2d52;};'use strict';var express=require(_0xd66a('0x0'));var passport=require(_0xd66a('0x1'));var router=express['Router']();var controller=require(_0xd66a('0x2'));var userController=require(_0xd66a('0x3'));var authService=require('../../components/auth/service');router[_0xd66a('0x4')]('/',controller['login']);router[_0xd66a('0x4')](_0xd66a('0x5'),controller[_0xd66a('0x6')],authService['isMiddleware'],userController[_0xd66a('0x7')],authService['setTokenCookie']);module[_0xd66a('0x8')]=router;
\ No newline at end of file
index 95cb3e8..85984b1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x905c=['http','Setting','findOne','blockDuration','then','name','password','salt','role','disabled','blocked','blockedAt','admin','agent','loginAttempts','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','allowedLoginAttempts','add','minutes','clearBlockUser','getLicense','catch','MailAccount','email','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','\x22%s\x22\x20<%s>','user','request','SendMail','error','format','message','status','authenticate','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','online','body','Email\x20parameter\x20is\x20missing','trim','toLowerCase','find','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','send','Reset\x20Email\x20sent!','reset','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','validatePasswordPattern','previousPasswords','validatePasswordHistory','passwordHistoryLimit','use','local-login','passport','Strategy','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','client'];(function(_0x41fd75,_0x26c6c3){var _0x11c35b=function(_0x125999){while(--_0x125999){_0x41fd75['push'](_0x41fd75['shift']());}};_0x11c35b(++_0x26c6c3);}(_0x905c,0x13a));var _0xc905=function(_0x2c8f13,_0x51a3d4){_0x2c8f13=_0x2c8f13-0x0;var _0x4ae53a=_0x905c[_0x2c8f13];return _0x4ae53a;};'use strict';var util=require('util');var passport=require(_0xc905('0x0'));var LocalStrategy=require('passport-local')[_0xc905('0x1')];var jayson=require(_0xc905('0x2'));var _=require(_0xc905('0x3'));var rs=require(_0xc905('0x4'));var moment=require(_0xc905('0x5'));var db=require(_0xc905('0x6'))['db'];var authService=require(_0xc905('0x7'));var utils=require(_0xc905('0x8'));var client=jayson[_0xc905('0x9')][_0xc905('0xa')]({'port':0x232b});function localAuthenticate(_0x1e6bc4,_0x5531d9,_0x12fdb1,_0x43c215){var _0x184280,_0x62ea72;return db[_0xc905('0xb')][_0xc905('0xc')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xc905('0xd')],'raw':!![]})[_0xc905('0xe')](function(_0x2dc6ca){_0x184280=_0x2dc6ca;return _0x1e6bc4['findOne']({'attributes':['id',_0xc905('0xf'),_0xc905('0x10'),_0xc905('0x11'),_0xc905('0x12'),_0xc905('0x13'),_0xc905('0x14'),_0xc905('0x15'),'loginAttempts'],'where':{'name':_0x5531d9,'role':{'$or':[_0xc905('0x16'),'user',_0xc905('0x17')]}}});})[_0xc905('0xe')](function(_0x15c6c8){if(!_0x15c6c8||_0x15c6c8&&_0x15c6c8[_0xc905('0xf')]!==_0x5531d9){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x62ea72=_0x15c6c8;return _0x62ea72;}})[_0xc905('0xe')](function(){_0x62ea72['authenticate'](_0x12fdb1,function(_0x35a822,_0x1d7700){var _0x3d8a85=_0x62ea72[_0xc905('0x18')]+0x1;if(_0x35a822){return _0x43c215(_0x35a822);}else if(!_0x1d7700){if(_0x62ea72[_0xc905('0x13')]){return _0x43c215(null,![],{'message':_0xc905('0x19')});}else if(_0x184280[_0xc905('0x1a')]>0x0){if(_0x62ea72[_0xc905('0x14')]){if(_0x184280[_0xc905('0xd')]>0x0){if(moment(_0x62ea72[_0xc905('0x15')])[_0xc905('0x1b')](_0x184280[_0xc905('0xd')],_0xc905('0x1c'))>moment()){return _0x43c215(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0xc905('0x1d')](_0x62ea72,_0x3d8a85,![],null)[_0xc905('0xe')](function(){return _0x43c215(null,![],{'message':_0xc905('0x19')});});}}else{return _0x43c215(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x3d8a85>=_0x184280[_0xc905('0x1a')]){return utils[_0xc905('0x1d')](_0x62ea72,0x0,!![],moment())[_0xc905('0xe')](function(){return _0x43c215(null,![],{'message':_0xc905('0x19')});});}else{return utils['clearBlockUser'](_0x62ea72,_0x3d8a85,![],null)[_0xc905('0xe')](function(){return _0x43c215(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x43c215(null,![],{'message':_0xc905('0x19')});}}else{if(_0x62ea72[_0xc905('0x13')]){return _0x43c215(null,![],{'message':_0xc905('0x19')});}else if(_0x184280['allowedLoginAttempts']>0x0){if(_0x62ea72[_0xc905('0x14')]){if(_0x184280[_0xc905('0xd')]>0x0){if(moment(_0x62ea72[_0xc905('0x15')])[_0xc905('0x1b')](_0x184280['blockDuration'],'minutes')>moment()){return _0x43c215(null,![],{'message':_0xc905('0x19')});}else{return utils[_0xc905('0x1d')](_0x62ea72,0x0,![],null)[_0xc905('0xe')](function(){return utils['getLicense'](_0x62ea72);})['then'](function(){return _0x43c215(null,_0x62ea72);});}}else{return _0x43c215(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils['clearBlockUser'](_0x62ea72,0x0,![],null)[_0xc905('0xe')](function(){return utils[_0xc905('0x1e')](_0x62ea72);})[_0xc905('0xe')](function(){return _0x43c215(null,_0x62ea72);})[_0xc905('0x1f')](function(_0x3ba864){return _0x43c215(null,![],_0x3ba864);});}}else{if(_0x62ea72[_0xc905('0x14')]){return _0x43c215(null,![],{'message':_0xc905('0x19')});}else{return utils[_0xc905('0x1e')](_0x62ea72)[_0xc905('0xe')](function(){return _0x43c215(null,_0x62ea72);});}}}});})[_0xc905('0x1f')](function(_0x661e35){return _0x43c215(null,![],_0x661e35);});}function sendServiceMail(_0x5c3bb7){return db[_0xc905('0x20')]['find']({'where':{'service':!![]},'attributes':['id','name',_0xc905('0x21')],'include':[{'model':db['MailServerOut'],'as':_0xc905('0x22'),'include':[{'model':db['CloudProvider'],'as':_0xc905('0x23')}]}]})[_0xc905('0xe')](function(_0x566274){if(!_0x566274){throw new Error(_0xc905('0x24'));}var _0x39a54f=_0x566274[_0xc905('0x25')]();var _0x102541={'account':_0x39a54f,'message':_[_0xc905('0x26')]({'from':util['format'](_0xc905('0x27'),_0x566274[_0xc905('0xf')],_0x566274['email']||_0x566274[_0xc905('0x22')][_0xc905('0x28')])},_0x5c3bb7)};return client[_0xc905('0x29')](_0xc905('0x2a'),_0x102541);})[_0xc905('0xe')](function(_0x1fba73){if(_0x1fba73[_0xc905('0x2b')]){throw new Error(util[_0xc905('0x2c')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x1fba73[_0xc905('0x2b')][_0xc905('0x2d')]||JSON['stringify'](_0x1fba73[_0xc905('0x2b')])));}return!![];});}function handleError(_0x27cb1c,_0x54b2d1,_0x18e3f2){return _0x27cb1c[_0xc905('0x2e')](_0x54b2d1||0x1f4)['send']({'message':_0x18e3f2?_0x18e3f2['message']||_0x18e3f2:''});}exports['login']=function(_0x54c9f0,_0xfc8d9c,_0x25b676){passport[_0xc905('0x2f')]('local-login',function(_0x19769b,_0x4919cb,_0x377d07){var _0x5aac77=_0x19769b||_0x377d07;if(_0x5aac77){return handleError(_0xfc8d9c,0x191,_0x5aac77);}if(!_0x4919cb){return handleError(_0xfc8d9c,0x194,{'message':_0xc905('0x30')});}else{var _0xbd8ea2={'payload':{'id':_0x4919cb['id'],'role':_0x4919cb['role']},'options':{'expiresIn':0x15180}};return authService['signToken'](_0xbd8ea2)['then'](function(_0x2b1cba){_0xfc8d9c[_0xc905('0x31')]({'id':_0x4919cb['id'],'token':_0x2b1cba,'statusCall':'','isAlreadyLogged':_0x4919cb[_0xc905('0x32')]});});}})(_0x54c9f0,_0xfc8d9c,_0x25b676);};exports['forgot']=function(_0x24a05c,_0x4f2752){if(!_0x24a05c[_0xc905('0x33')][_0xc905('0x21')]){return handleError(_0x4f2752,0x1f4,{'message':_0xc905('0x34')});}var _0x329666=rs['generate']();_0x24a05c[_0xc905('0x33')][_0xc905('0x21')]=_0x24a05c['body']['email'][_0xc905('0x35')]()[_0xc905('0x36')]();var _0x307c16;return db[_0xc905('0xb')][_0xc905('0xc')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xc905('0xd')],'raw':!![]})['then'](function(_0x556d9a){_0x307c16=_0x556d9a;return db['User'][_0xc905('0x37')]({'where':{'email':_0x24a05c[_0xc905('0x33')][_0xc905('0x21')]}});})[_0xc905('0xe')](function(_0x48e955){if(!_0x48e955){throw new Error(_0xc905('0x38'));}if(_0x48e955['disabled']){throw new Error(_0xc905('0x39'));}if(_0x48e955[_0xc905('0x14')]){if(moment(_0x48e955[_0xc905('0x15')])[_0xc905('0x1b')](_0x307c16['blockDuration'],'minutes')>moment()){throw new Error(_0xc905('0x3a'));}else{_0x48e955['blocked']=![];_0x48e955[_0xc905('0x15')]=null;}}_0x48e955[_0xc905('0x3b')]=_0x329666;_0x48e955[_0xc905('0x3c')]=Date[_0xc905('0x3d')]()+0x36ee80;return _0x48e955[_0xc905('0x3e')]();})['then'](function(){return sendServiceMail({'to':_0x24a05c[_0xc905('0x33')][_0xc905('0x21')],'subject':_0xc905('0x3f'),'text':_0xc905('0x40')+_0xc905('0x41')+_0xc905('0x42')+_0x24a05c['headers']['host']+_0xc905('0x43')+_0x329666+'\x0a\x0a'+_0xc905('0x44')});})['then'](function(){_0x4f2752['status'](0xc8)[_0xc905('0x45')]({'message':_0xc905('0x46')});})[_0xc905('0x1f')](function(_0x396170){return handleError(_0x4f2752,0x1f4,_0x396170);});};exports[_0xc905('0x47')]=function(_0x379664,_0x1e2df6){return db['User'][_0xc905('0x37')]({'where':{'resetPasswordToken':_0x379664['params']['token'],'resetPasswordExpires':{'$gt':Date[_0xc905('0x3d')]()}}})['then'](function(_0x15dfba){if(!_0x15dfba){throw new Error(_0xc905('0x48'));}return db[_0xc905('0xb')][_0xc905('0xc')]({'attributes':['id',_0xc905('0x49'),_0xc905('0x4a'),'passwordHistoryLimit']})[_0xc905('0xe')](function(_0x506bf9){if(_0x506bf9[_0xc905('0x49')])authService[_0xc905('0x4b')](_0x379664[_0xc905('0x33')]['password']);if(!_0x506bf9[_0xc905('0x4a')]||!_0x15dfba[_0xc905('0x4c')])return _0x15dfba;authService[_0xc905('0x4d')](_0x379664[_0xc905('0x33')]['password'],_0x15dfba[_0xc905('0x4c')],_0x506bf9[_0xc905('0x4e')]);return _0x15dfba;})[_0xc905('0xe')](function(){_0x15dfba[_0xc905('0x10')]=_0x379664[_0xc905('0x33')][_0xc905('0x10')];_0x15dfba[_0xc905('0x3b')]=null;_0x15dfba[_0xc905('0x3c')]=null;return _0x15dfba[_0xc905('0x3e')]();});})[_0xc905('0xe')](function(){_0x1e2df6[_0xc905('0x2e')](0xc8)[_0xc905('0x45')]({'message':'Password\x20reset!'});})['catch'](function(_0x230fc6){return handleError(_0x1e2df6,0x1f4,_0x230fc6);});};passport[_0xc905('0x4f')](_0xc905('0x50'),new LocalStrategy({'usernameField':_0xc905('0xf'),'passwordField':_0xc905('0x10')},function(_0x223eef,_0x39ba50,_0x5d7078){return localAuthenticate(db['User'],_0x223eef,_0x39ba50,_0x5d7078);}));
\ No newline at end of file
+var _0x9cac=['minutes','clearBlockUser','blocked','getLicense','catch','find','email','Smtp','CloudProvider','\x22%s\x22\x20<%s>','request','error','format','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','status','message','local-login','signToken','json','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','save','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','send','Reset\x20Email\x20sent!','reset','User','now','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','previousPasswords','password','Password\x20reset!','use','util','passport','Strategy','lodash','randomstring','../../mysqldb','../../config/utils','client','Setting','findOne','allowedLoginAttempts','then','salt','blockedAt','loginAttempts','admin','user','agent','name','authenticate','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','add'];(function(_0x1d39f6,_0x146f4a){var _0x3dbd7a=function(_0x4486f2){while(--_0x4486f2){_0x1d39f6['push'](_0x1d39f6['shift']());}};_0x3dbd7a(++_0x146f4a);}(_0x9cac,0x82));var _0xc9ca=function(_0x515062,_0x3610b1){_0x515062=_0x515062-0x0;var _0x5cc7f3=_0x9cac[_0x515062];return _0x5cc7f3;};'use strict';var util=require(_0xc9ca('0x0'));var passport=require(_0xc9ca('0x1'));var LocalStrategy=require('passport-local')[_0xc9ca('0x2')];var jayson=require('jayson/promise');var _=require(_0xc9ca('0x3'));var rs=require(_0xc9ca('0x4'));var moment=require('moment');var db=require(_0xc9ca('0x5'))['db'];var authService=require('../../components/auth/service');var utils=require(_0xc9ca('0x6'));var client=jayson[_0xc9ca('0x7')]['http']({'port':0x232b});function localAuthenticate(_0x43754a,_0x325659,_0x52426f,_0x457b91){var _0x1ba25b,_0x5335a9;return db[_0xc9ca('0x8')][_0xc9ca('0x9')]({'where':{'id':0x1},'attributes':[_0xc9ca('0xa'),'blockDuration'],'raw':!![]})[_0xc9ca('0xb')](function(_0x88ac31){_0x1ba25b=_0x88ac31;return _0x43754a[_0xc9ca('0x9')]({'attributes':['id','name','password',_0xc9ca('0xc'),'role','disabled','blocked',_0xc9ca('0xd'),_0xc9ca('0xe')],'where':{'name':_0x325659,'role':{'$or':[_0xc9ca('0xf'),_0xc9ca('0x10'),_0xc9ca('0x11')]}}});})['then'](function(_0xdcd2c8){if(!_0xdcd2c8||_0xdcd2c8&&_0xdcd2c8[_0xc9ca('0x12')]!==_0x325659){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x5335a9=_0xdcd2c8;return _0x5335a9;}})['then'](function(){_0x5335a9[_0xc9ca('0x13')](_0x52426f,function(_0x3e20c5,_0x59db1a){var _0x2b88ad=_0x5335a9[_0xc9ca('0xe')]+0x1;if(_0x3e20c5){return _0x457b91(_0x3e20c5);}else if(!_0x59db1a){if(_0x5335a9[_0xc9ca('0x14')]){return _0x457b91(null,![],{'message':_0xc9ca('0x15')});}else if(_0x1ba25b[_0xc9ca('0xa')]>0x0){if(_0x5335a9['blocked']){if(_0x1ba25b[_0xc9ca('0x16')]>0x0){if(moment(_0x5335a9[_0xc9ca('0xd')])[_0xc9ca('0x17')](_0x1ba25b['blockDuration'],_0xc9ca('0x18'))>moment()){return _0x457b91(null,![],{'message':_0xc9ca('0x15')});}else{return utils[_0xc9ca('0x19')](_0x5335a9,_0x2b88ad,![],null)[_0xc9ca('0xb')](function(){return _0x457b91(null,![],{'message':_0xc9ca('0x15')});});}}else{return _0x457b91(null,![],{'message':_0xc9ca('0x15')});}}else{if(_0x2b88ad>=_0x1ba25b['allowedLoginAttempts']){return utils[_0xc9ca('0x19')](_0x5335a9,0x0,!![],moment())[_0xc9ca('0xb')](function(){return _0x457b91(null,![],{'message':_0xc9ca('0x15')});});}else{return utils[_0xc9ca('0x19')](_0x5335a9,_0x2b88ad,![],null)[_0xc9ca('0xb')](function(){return _0x457b91(null,![],{'message':_0xc9ca('0x15')});});}}}else{return _0x457b91(null,![],{'message':_0xc9ca('0x15')});}}else{if(_0x5335a9[_0xc9ca('0x14')]){return _0x457b91(null,![],{'message':_0xc9ca('0x15')});}else if(_0x1ba25b[_0xc9ca('0xa')]>0x0){if(_0x5335a9[_0xc9ca('0x1a')]){if(_0x1ba25b[_0xc9ca('0x16')]>0x0){if(moment(_0x5335a9['blockedAt'])[_0xc9ca('0x17')](_0x1ba25b[_0xc9ca('0x16')],_0xc9ca('0x18'))>moment()){return _0x457b91(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['clearBlockUser'](_0x5335a9,0x0,![],null)[_0xc9ca('0xb')](function(){return utils[_0xc9ca('0x1b')](_0x5335a9);})[_0xc9ca('0xb')](function(){return _0x457b91(null,_0x5335a9);});}}else{return _0x457b91(null,![],{'message':_0xc9ca('0x15')});}}else{return utils[_0xc9ca('0x19')](_0x5335a9,0x0,![],null)[_0xc9ca('0xb')](function(){return utils[_0xc9ca('0x1b')](_0x5335a9);})[_0xc9ca('0xb')](function(){return _0x457b91(null,_0x5335a9);})[_0xc9ca('0x1c')](function(_0x3ca059){return _0x457b91(null,![],_0x3ca059);});}}else{if(_0x5335a9[_0xc9ca('0x1a')]){return _0x457b91(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0xc9ca('0x1b')](_0x5335a9)[_0xc9ca('0xb')](function(){return _0x457b91(null,_0x5335a9);});}}}});})[_0xc9ca('0x1c')](function(_0x3c66e6){return _0x457b91(null,![],_0x3c66e6);});}function sendServiceMail(_0x3008bb){return db['MailAccount'][_0xc9ca('0x1d')]({'where':{'service':!![]},'attributes':['id',_0xc9ca('0x12'),_0xc9ca('0x1e')],'include':[{'model':db['MailServerOut'],'as':_0xc9ca('0x1f'),'include':[{'model':db['CloudProvider'],'as':_0xc9ca('0x20')}]}]})[_0xc9ca('0xb')](function(_0x2d0d1d){if(!_0x2d0d1d){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x5d2b62=_0x2d0d1d['getSmtpOptions']();var _0x493a92={'account':_0x5d2b62,'message':_['merge']({'from':util['format'](_0xc9ca('0x21'),_0x2d0d1d[_0xc9ca('0x12')],_0x2d0d1d[_0xc9ca('0x1e')]||_0x2d0d1d[_0xc9ca('0x1f')][_0xc9ca('0x10')])},_0x3008bb)};return client[_0xc9ca('0x22')]('SendMail',_0x493a92);})['then'](function(_0x39a944){if(_0x39a944[_0xc9ca('0x23')]){throw new Error(util[_0xc9ca('0x24')](_0xc9ca('0x25'),_0x39a944['error']['message']||JSON['stringify'](_0x39a944[_0xc9ca('0x23')])));}return!![];});}function handleError(_0x429274,_0x2a1bc2,_0x1be8e3){return _0x429274[_0xc9ca('0x26')](_0x2a1bc2||0x1f4)['send']({'message':_0x1be8e3?_0x1be8e3[_0xc9ca('0x27')]||_0x1be8e3:''});}exports['login']=function(_0x1ec555,_0x1651a8,_0x68d056){passport['authenticate'](_0xc9ca('0x28'),function(_0x245b31,_0xb10a4c,_0x5e8a42){var _0xddd9fe=_0x245b31||_0x5e8a42;if(_0xddd9fe){return handleError(_0x1651a8,0x191,_0xddd9fe);}if(!_0xb10a4c){return handleError(_0x1651a8,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x4329c3={'payload':{'id':_0xb10a4c['id'],'role':_0xb10a4c['role']},'options':{'expiresIn':0x15180}};return authService[_0xc9ca('0x29')](_0x4329c3)['then'](function(_0x260b7e){_0x1651a8[_0xc9ca('0x2a')]({'id':_0xb10a4c['id'],'token':_0x260b7e,'statusCall':'','isAlreadyLogged':_0xb10a4c[_0xc9ca('0x2b')]});});}})(_0x1ec555,_0x1651a8,_0x68d056);};exports[_0xc9ca('0x2c')]=function(_0x10f5a2,_0x504c6a){if(!_0x10f5a2[_0xc9ca('0x2d')][_0xc9ca('0x1e')]){return handleError(_0x504c6a,0x1f4,{'message':_0xc9ca('0x2e')});}var _0x1cff62=rs[_0xc9ca('0x2f')]();_0x10f5a2[_0xc9ca('0x2d')][_0xc9ca('0x1e')]=_0x10f5a2['body'][_0xc9ca('0x1e')][_0xc9ca('0x30')]()[_0xc9ca('0x31')]();var _0x5aefa4;return db[_0xc9ca('0x8')]['findOne']({'where':{'id':0x1},'attributes':[_0xc9ca('0xa'),_0xc9ca('0x16')],'raw':!![]})[_0xc9ca('0xb')](function(_0x1ad888){_0x5aefa4=_0x1ad888;return db['User'][_0xc9ca('0x1d')]({'where':{'email':_0x10f5a2['body']['email']}});})[_0xc9ca('0xb')](function(_0x5593fa){if(!_0x5593fa){throw new Error(_0xc9ca('0x32'));}if(_0x5593fa[_0xc9ca('0x14')]){throw new Error(_0xc9ca('0x33'));}if(_0x5593fa[_0xc9ca('0x1a')]){if(moment(_0x5593fa[_0xc9ca('0xd')])['add'](_0x5aefa4[_0xc9ca('0x16')],_0xc9ca('0x18'))>moment()){throw new Error(_0xc9ca('0x34'));}else{_0x5593fa[_0xc9ca('0x1a')]=![];_0x5593fa[_0xc9ca('0xd')]=null;}}_0x5593fa[_0xc9ca('0x35')]=_0x1cff62;_0x5593fa[_0xc9ca('0x36')]=Date['now']()+0x36ee80;return _0x5593fa[_0xc9ca('0x37')]();})['then'](function(){return sendServiceMail({'to':_0x10f5a2[_0xc9ca('0x2d')][_0xc9ca('0x1e')],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0xc9ca('0x38')+_0xc9ca('0x39')+_0xc9ca('0x3a')+_0x10f5a2[_0xc9ca('0x3b')][_0xc9ca('0x3c')]+_0xc9ca('0x3d')+_0x1cff62+'\x0a\x0a'+_0xc9ca('0x3e')});})[_0xc9ca('0xb')](function(){_0x504c6a[_0xc9ca('0x26')](0xc8)[_0xc9ca('0x3f')]({'message':_0xc9ca('0x40')});})[_0xc9ca('0x1c')](function(_0x5177f5){return handleError(_0x504c6a,0x1f4,_0x5177f5);});};exports[_0xc9ca('0x41')]=function(_0x402450,_0x5b5dfd){return db[_0xc9ca('0x42')]['find']({'where':{'resetPasswordToken':_0x402450['params']['token'],'resetPasswordExpires':{'$gt':Date[_0xc9ca('0x43')]()}}})[_0xc9ca('0xb')](function(_0x1a348a){if(!_0x1a348a){throw new Error(_0xc9ca('0x44'));}return db[_0xc9ca('0x8')]['findOne']({'attributes':['id',_0xc9ca('0x45'),_0xc9ca('0x46'),_0xc9ca('0x47')]})[_0xc9ca('0xb')](function(_0x4dfb05){if(_0x4dfb05['securePassword'])authService[_0xc9ca('0x48')](_0x402450['body']['password']);if(!_0x4dfb05[_0xc9ca('0x46')]||!_0x1a348a[_0xc9ca('0x49')])return _0x1a348a;authService['validatePasswordHistory'](_0x402450[_0xc9ca('0x2d')][_0xc9ca('0x4a')],_0x1a348a['previousPasswords'],_0x4dfb05[_0xc9ca('0x47')]);return _0x1a348a;})[_0xc9ca('0xb')](function(){_0x1a348a['password']=_0x402450[_0xc9ca('0x2d')]['password'];_0x1a348a[_0xc9ca('0x35')]=null;_0x1a348a['resetPasswordExpires']=null;return _0x1a348a[_0xc9ca('0x37')]();});})[_0xc9ca('0xb')](function(){_0x5b5dfd[_0xc9ca('0x26')](0xc8)[_0xc9ca('0x3f')]({'message':_0xc9ca('0x4b')});})[_0xc9ca('0x1c')](function(_0xec4065){return handleError(_0x5b5dfd,0x1f4,_0xec4065);});};passport[_0xc9ca('0x4c')](_0xc9ca('0x28'),new LocalStrategy({'usernameField':'name','passwordField':_0xc9ca('0x4a')},function(_0x3d3bf7,_0x45fec7,_0x2a7f0a){return localAuthenticate(db[_0xc9ca('0x42')],_0x3d3bf7,_0x45fec7,_0x2a7f0a);}));
\ No newline at end of file
index b48e693..3277724 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4f3b=['./authLocal.controller','post','login','forgot','/reset/:token','express','Router'];(function(_0x50daa4,_0x3c336d){var _0x389935=function(_0x292d12){while(--_0x292d12){_0x50daa4['push'](_0x50daa4['shift']());}};_0x389935(++_0x3c336d);}(_0x4f3b,0xa6));var _0xb4f3=function(_0x1ed116,_0x23bc80){_0x1ed116=_0x1ed116-0x0;var _0x574066=_0x4f3b[_0x1ed116];return _0x574066;};'use strict';var express=require(_0xb4f3('0x0'));var router=express[_0xb4f3('0x1')]();var controller=require(_0xb4f3('0x2'));router[_0xb4f3('0x3')]('/',controller[_0xb4f3('0x4')]);router[_0xb4f3('0x3')]('/forgot',controller[_0xb4f3('0x5')]);router[_0xb4f3('0x3')](_0xb4f3('0x6'),controller['reset']);module['exports']=router;
\ No newline at end of file
+var _0xbea4=['exports','express','login','post','/forgot','/reset/:token'];(function(_0x519663,_0x3dcd48){var _0x5009e0=function(_0x3f6053){while(--_0x3f6053){_0x519663['push'](_0x519663['shift']());}};_0x5009e0(++_0x3dcd48);}(_0xbea4,0xf1));var _0x4bea=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xbea4[_0x4fc9e6];return _0x551d28;};'use strict';var express=require(_0x4bea('0x0'));var router=express['Router']();var controller=require('./authLocal.controller');router['post']('/',controller[_0x4bea('0x1')]);router[_0x4bea('0x2')](_0x4bea('0x3'),controller['forgot']);router[_0x4bea('0x2')](_0x4bea('0x4'),controller['reset']);module[_0x4bea('0x5')]=router;
\ No newline at end of file
index da217c1..468b884 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa830=['exports','STRING','INTEGER','sequelize'];(function(_0x21bb9c,_0x3d75dc){var _0x51f2a2=function(_0x122eb3){while(--_0x122eb3){_0x21bb9c['push'](_0x21bb9c['shift']());}};_0x51f2a2(++_0x3d75dc);}(_0xa830,0xbb));var _0x0a83=function(_0x470d17,_0x32e508){_0x470d17=_0x470d17-0x0;var _0xd6558d=_0xa830[_0x470d17];return _0xd6558d;};'use strict';var Sequelize=require(_0x0a83('0x0'));module[_0x0a83('0x1')]={'name':{'type':Sequelize[_0x0a83('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x0a83('0x2')]},'description':{'type':Sequelize[_0x0a83('0x2')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0x0a83('0x3')],'defaultValue':0xa}};
\ No newline at end of file
+var _0x6d33=['sequelize','exports','STRING','BOOLEAN','INTEGER'];(function(_0x26d6d9,_0x431cb8){var _0x1b4875=function(_0x41111f){while(--_0x41111f){_0x26d6d9['push'](_0x26d6d9['shift']());}};_0x1b4875(++_0x431cb8);}(_0x6d33,0x82));var _0x36d3=function(_0x263a74,_0xc31414){_0x263a74=_0x263a74-0x0;var _0x2aa86c=_0x6d33[_0x263a74];return _0x2aa86c;};'use strict';var Sequelize=require(_0x36d3('0x0'));module[_0x36d3('0x1')]={'name':{'type':Sequelize[_0x36d3('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x36d3('0x2')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x36d3('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x36d3('0x4')],'defaultValue':0xa}};
\ No newline at end of file
index 851b786..66235e0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0b54=['nolimit','order','sort','pick','where','merge','options','includeAll','include','rows','catch','show','params','intersection','length','find','create','body','addConditions','Condition','ids','getConditions','findOne','filter','hasOwnProperty','addActions','getActions','Action','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','Automation','rawAttributes','fieldName','type','key','model','query','keys','filters','fields','attributes'];(function(_0x44afb1,_0x46d299){var _0x450252=function(_0x185f2a){while(--_0x185f2a){_0x44afb1['push'](_0x44afb1['shift']());}};_0x450252(++_0x46d299);}(_0x0b54,0x11b));var _0x40b5=function(_0x166742,_0x55520c){_0x166742=_0x166742-0x0;var _0xb7814a=_0x0b54[_0x166742];return _0xb7814a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x40b5('0x0'));var zipdir=require(_0x40b5('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x40b5('0x2'));var moment=require(_0x40b5('0x3'));var BPromise=require(_0x40b5('0x4'));var Mustache=require(_0x40b5('0x5'));var util=require(_0x40b5('0x6'));var path=require(_0x40b5('0x7'));var sox=require('sox');var csv=require(_0x40b5('0x8'));var ejs=require(_0x40b5('0x9'));var fs=require('fs');var fs_extra=require(_0x40b5('0xa'));var _=require(_0x40b5('0xb'));var squel=require(_0x40b5('0xc'));var crypto=require(_0x40b5('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x40b5('0xe'));var toCsv=require(_0x40b5('0x8'));var querystring=require(_0x40b5('0xf'));var Papa=require('papaparse');var Redis=require(_0x40b5('0x10'));var authService=require(_0x40b5('0x11'));var qs=require(_0x40b5('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x40b5('0x13'));var logger=require(_0x40b5('0x14'))('api');var utils=require(_0x40b5('0x15'));var config=require(_0x40b5('0x16'));var licenseUtil=require(_0x40b5('0x17'));var db=require(_0x40b5('0x18'))['db'];function respondWithStatusCode(_0x3b52e4,_0x1d5bff){_0x1d5bff=_0x1d5bff||0xcc;return function(_0x44e38a){if(_0x44e38a){return _0x3b52e4[_0x40b5('0x19')](_0x1d5bff);}return _0x3b52e4[_0x40b5('0x1a')](_0x1d5bff)[_0x40b5('0x1b')]();};}function respondWithResult(_0x312658,_0x290e62){_0x290e62=_0x290e62||0xc8;return function(_0x179741){if(_0x179741){return _0x312658[_0x40b5('0x1a')](_0x290e62)[_0x40b5('0x1c')](_0x179741);}};}function respondWithFilteredResult(_0x4f14de,_0x25c6e1){return function(_0x315124){if(_0x315124){var _0x1f9339=typeof _0x25c6e1[_0x40b5('0x1d')]===_0x40b5('0x1e')&&typeof _0x25c6e1[_0x40b5('0x1f')]===_0x40b5('0x1e');var _0x40d34d=_0x315124['count'];var _0x3e735a=_0x1f9339?0x0:_0x25c6e1[_0x40b5('0x1d')];var _0xc98446=_0x1f9339?_0x315124[_0x40b5('0x20')]:_0x25c6e1[_0x40b5('0x1d')]+_0x25c6e1[_0x40b5('0x1f')];var _0x215451;if(_0xc98446>=_0x40d34d){_0xc98446=_0x40d34d;_0x215451=0xc8;}else{_0x215451=0xce;}_0x4f14de['status'](_0x215451);return _0x4f14de[_0x40b5('0x21')](_0x40b5('0x22'),_0x3e735a+'-'+_0xc98446+'/'+_0x40d34d)['json'](_0x315124);}return null;};}function patchUpdates(_0x4e55a7){return function(_0x3fe024){try{jsonpatch[_0x40b5('0x23')](_0x3fe024,_0x4e55a7,!![]);}catch(_0x23578d){return BPromise[_0x40b5('0x24')](_0x23578d);}return _0x3fe024['save']();};}function saveUpdates(_0x2ee085,_0x35ff79){return function(_0x15eef7){if(_0x15eef7){return _0x15eef7[_0x40b5('0x25')](_0x2ee085)[_0x40b5('0x26')](function(_0x4e1bf5){return _0x4e1bf5;});}return null;};}function removeEntity(_0x46d86a,_0x19582c){return function(_0x524993){if(_0x524993){return _0x524993[_0x40b5('0x27')]()[_0x40b5('0x26')](function(){_0x46d86a['status'](0xcc)[_0x40b5('0x1b')]();});}};}function handleEntityNotFound(_0x501150,_0x5f5a65){return function(_0x446d53){if(!_0x446d53){_0x501150[_0x40b5('0x19')](0x194);}return _0x446d53;};}function handleError(_0x50d681,_0x5469a8){_0x5469a8=_0x5469a8||0x1f4;return function(_0x49894e){logger[_0x40b5('0x28')](_0x49894e[_0x40b5('0x29')]);if(_0x49894e['name']){delete _0x49894e[_0x40b5('0x2a')];}_0x50d681['status'](_0x5469a8)[_0x40b5('0x2b')](_0x49894e);};}exports[_0x40b5('0x2c')]=function(_0x6821d1,_0x5cc153){var _0x5ebd16={},_0xb7aace={},_0x1d90ad={'count':0x0,'rows':[]};var _0x3b9011=_[_0x40b5('0x2d')](db[_0x40b5('0x2e')][_0x40b5('0x2f')],function(_0x2a2f21){return{'name':_0x2a2f21[_0x40b5('0x30')],'type':_0x2a2f21[_0x40b5('0x31')][_0x40b5('0x32')]};});_0xb7aace[_0x40b5('0x33')]=_[_0x40b5('0x2d')](_0x3b9011,'name');_0xb7aace[_0x40b5('0x34')]=_[_0x40b5('0x35')](_0x6821d1[_0x40b5('0x34')]);_0xb7aace[_0x40b5('0x36')]=_['intersection'](_0xb7aace[_0x40b5('0x33')],_0xb7aace[_0x40b5('0x34')]);_0x5ebd16['attributes']=_['intersection'](_0xb7aace['model'],qs[_0x40b5('0x37')](_0x6821d1['query']['fields']));_0x5ebd16[_0x40b5('0x38')]=_0x5ebd16[_0x40b5('0x38')]['length']?_0x5ebd16['attributes']:_0xb7aace['model'];if(!_0x6821d1['query']['hasOwnProperty'](_0x40b5('0x39'))){_0x5ebd16[_0x40b5('0x1f')]=qs[_0x40b5('0x1f')](_0x6821d1[_0x40b5('0x34')][_0x40b5('0x1f')]);_0x5ebd16[_0x40b5('0x1d')]=qs['offset'](_0x6821d1[_0x40b5('0x34')]['offset']);}_0x5ebd16[_0x40b5('0x3a')]=qs['sort'](_0x6821d1[_0x40b5('0x34')][_0x40b5('0x3b')]);_0x5ebd16['where']=qs[_0x40b5('0x36')](_[_0x40b5('0x3c')](_0x6821d1[_0x40b5('0x34')],_0xb7aace[_0x40b5('0x36')]),_0x3b9011);if(_0x6821d1[_0x40b5('0x34')]['filter']){_0x5ebd16[_0x40b5('0x3d')]=_[_0x40b5('0x3e')](_0x5ebd16[_0x40b5('0x3d')],{'$or':_[_0x40b5('0x2d')](_0x3b9011,function(_0xaa3b11){if(_0xaa3b11[_0x40b5('0x31')]!=='VIRTUAL'){var _0x1afc24={};_0x1afc24[_0xaa3b11['name']]={'$like':'%'+_0x6821d1['query']['filter']+'%'};return _0x1afc24;}})});}_0x5ebd16=_[_0x40b5('0x3e')]({},_0x5ebd16,_0x6821d1[_0x40b5('0x3f')]);var _0x54161d={'where':_0x5ebd16[_0x40b5('0x3d')]};return db['Automation'][_0x40b5('0x20')](_0x54161d)[_0x40b5('0x26')](function(_0x1757e9){_0x1d90ad[_0x40b5('0x20')]=_0x1757e9;if(_0x6821d1[_0x40b5('0x34')][_0x40b5('0x40')]){_0x5ebd16[_0x40b5('0x41')]=[{'all':!![]}];}return db[_0x40b5('0x2e')]['findAll'](_0x5ebd16);})['then'](function(_0xcdc996){_0x1d90ad[_0x40b5('0x42')]=_0xcdc996;return _0x1d90ad;})[_0x40b5('0x26')](respondWithFilteredResult(_0x5cc153,_0x5ebd16))[_0x40b5('0x43')](handleError(_0x5cc153,null));};exports[_0x40b5('0x44')]=function(_0x4a691a,_0x359f51){var _0x556e40={'raw':![],'where':{'id':_0x4a691a[_0x40b5('0x45')]['id']}},_0x5cab5c={};_0x5cab5c['model']=_[_0x40b5('0x35')](db['Automation'][_0x40b5('0x2f')]);_0x5cab5c[_0x40b5('0x34')]=_[_0x40b5('0x35')](_0x4a691a['query']);_0x5cab5c[_0x40b5('0x36')]=_[_0x40b5('0x46')](_0x5cab5c['model'],_0x5cab5c[_0x40b5('0x34')]);_0x556e40['attributes']=_[_0x40b5('0x46')](_0x5cab5c[_0x40b5('0x33')],qs[_0x40b5('0x37')](_0x4a691a[_0x40b5('0x34')]['fields']));_0x556e40['attributes']=_0x556e40['attributes'][_0x40b5('0x47')]?_0x556e40[_0x40b5('0x38')]:_0x5cab5c[_0x40b5('0x33')];if(_0x4a691a[_0x40b5('0x34')][_0x40b5('0x40')]){_0x556e40[_0x40b5('0x41')]=[{'all':!![]}];}_0x556e40=_[_0x40b5('0x3e')]({},_0x556e40,_0x4a691a[_0x40b5('0x3f')]);return db[_0x40b5('0x2e')][_0x40b5('0x48')](_0x556e40)[_0x40b5('0x26')](handleEntityNotFound(_0x359f51,null))[_0x40b5('0x26')](respondWithResult(_0x359f51,null))['catch'](handleError(_0x359f51,null));};exports[_0x40b5('0x49')]=function(_0x2884be,_0x27e082){return db[_0x40b5('0x2e')][_0x40b5('0x49')](_0x2884be[_0x40b5('0x4a')],{})['then'](respondWithResult(_0x27e082,0xc9))['catch'](handleError(_0x27e082,null));};exports[_0x40b5('0x25')]=function(_0x1a42c2,_0x2fa794){if(_0x1a42c2[_0x40b5('0x4a')]['id']){delete _0x1a42c2['body']['id'];}return db[_0x40b5('0x2e')][_0x40b5('0x48')]({'where':{'id':_0x1a42c2['params']['id']}})[_0x40b5('0x26')](handleEntityNotFound(_0x2fa794,null))[_0x40b5('0x26')](saveUpdates(_0x1a42c2[_0x40b5('0x4a')],null))[_0x40b5('0x26')](respondWithResult(_0x2fa794,null))[_0x40b5('0x43')](handleError(_0x2fa794,null));};exports[_0x40b5('0x27')]=function(_0x1d3571,_0x55fa75){return db[_0x40b5('0x2e')]['find']({'where':{'id':_0x1d3571['params']['id']}})[_0x40b5('0x26')](handleEntityNotFound(_0x55fa75,null))[_0x40b5('0x26')](removeEntity(_0x55fa75,null))['catch'](handleError(_0x55fa75,null));};exports[_0x40b5('0x4b')]=function(_0x38aa6f,_0x3c0a6d,_0x9a7447){return db[_0x40b5('0x4c')][_0x40b5('0x48')]({'where':{'id':_0x38aa6f[_0x40b5('0x45')]['id']}})[_0x40b5('0x26')](handleEntityNotFound(_0x3c0a6d,null))[_0x40b5('0x26')](function(_0x49aca7){if(_0x49aca7){return _0x49aca7[_0x40b5('0x4b')](_0x38aa6f[_0x40b5('0x4a')][_0x40b5('0x4d')],_['omit'](_0x38aa6f[_0x40b5('0x4a')],[_0x40b5('0x4d'),'id'])||{});}})[_0x40b5('0x26')](respondWithResult(_0x3c0a6d,null))[_0x40b5('0x43')](handleError(_0x3c0a6d,null));};exports[_0x40b5('0x4e')]=function(_0x4d15f1,_0xf402ff,_0x411d3e){var _0x3735d4={};var _0x284291={};var _0x343483;var _0x4b2080;return db[_0x40b5('0x2e')][_0x40b5('0x4f')]({'where':{'id':_0x4d15f1[_0x40b5('0x45')]['id']}})[_0x40b5('0x26')](handleEntityNotFound(_0xf402ff,null))[_0x40b5('0x26')](function(_0x1f14a3){if(_0x1f14a3){_0x343483=_0x1f14a3;_0x284291['model']=_[_0x40b5('0x35')](db[_0x40b5('0x4c')]['rawAttributes']);_0x284291['query']=_[_0x40b5('0x35')](_0x4d15f1[_0x40b5('0x34')]);_0x284291[_0x40b5('0x36')]=_[_0x40b5('0x46')](_0x284291[_0x40b5('0x33')],_0x284291['query']);_0x3735d4[_0x40b5('0x38')]=_['intersection'](_0x284291[_0x40b5('0x33')],qs['fields'](_0x4d15f1[_0x40b5('0x34')][_0x40b5('0x37')]));_0x3735d4[_0x40b5('0x38')]=_0x3735d4[_0x40b5('0x38')][_0x40b5('0x47')]?_0x3735d4[_0x40b5('0x38')]:_0x284291[_0x40b5('0x33')];_0x3735d4['order']=qs[_0x40b5('0x3b')](_0x4d15f1['query'][_0x40b5('0x3b')]);_0x3735d4[_0x40b5('0x3d')]=qs[_0x40b5('0x36')](_['pick'](_0x4d15f1[_0x40b5('0x34')],_0x284291[_0x40b5('0x36')]));if(_0x4d15f1[_0x40b5('0x34')][_0x40b5('0x50')]){_0x3735d4[_0x40b5('0x3d')]=_[_0x40b5('0x3e')](_0x3735d4['where'],{'$or':_['map'](_0x3735d4[_0x40b5('0x38')],function(_0x4cc76b){var _0x303da6={};_0x303da6[_0x4cc76b]={'$like':'%'+_0x4d15f1[_0x40b5('0x34')][_0x40b5('0x50')]+'%'};return _0x303da6;})});}_0x3735d4=_[_0x40b5('0x3e')]({},_0x3735d4,_0x4d15f1['options']);return _0x343483['getConditions'](_0x3735d4);}})['then'](function(_0x3c1130){if(_0x3c1130){_0x4b2080=_0x3c1130['length'];if(!_0x4d15f1[_0x40b5('0x34')][_0x40b5('0x51')](_0x40b5('0x39'))){_0x3735d4[_0x40b5('0x1f')]=qs[_0x40b5('0x1f')](_0x4d15f1[_0x40b5('0x34')][_0x40b5('0x1f')]);_0x3735d4[_0x40b5('0x1d')]=qs[_0x40b5('0x1d')](_0x4d15f1[_0x40b5('0x34')][_0x40b5('0x1d')]);}return _0x343483[_0x40b5('0x4e')](_0x3735d4);}})['then'](function(_0x1cea2e){if(_0x1cea2e){return _0x1cea2e?{'count':_0x4b2080,'rows':_0x1cea2e}:null;}})[_0x40b5('0x26')](respondWithResult(_0xf402ff,null))['catch'](handleError(_0xf402ff,null));};exports[_0x40b5('0x52')]=function(_0x26831c,_0x222410,_0x2352d0){return db['Action'][_0x40b5('0x48')]({'where':{'id':_0x26831c['params']['id']}})[_0x40b5('0x26')](handleEntityNotFound(_0x222410,null))['then'](function(_0x370225){if(_0x370225){return _0x370225[_0x40b5('0x52')](_0x26831c[_0x40b5('0x4a')][_0x40b5('0x4d')],_['omit'](_0x26831c[_0x40b5('0x4a')],['ids','id'])||{});}})[_0x40b5('0x26')](respondWithResult(_0x222410,null))[_0x40b5('0x43')](handleError(_0x222410,null));};exports[_0x40b5('0x53')]=function(_0x209646,_0x4cb395,_0x3d93dc){var _0x3835a4={};var _0x35e607={};var _0x46db84;var _0x5a7610;return db[_0x40b5('0x2e')][_0x40b5('0x4f')]({'where':{'id':_0x209646['params']['id']}})['then'](handleEntityNotFound(_0x4cb395,null))[_0x40b5('0x26')](function(_0x59af8e){if(_0x59af8e){_0x46db84=_0x59af8e;_0x35e607['model']=_['keys'](db[_0x40b5('0x54')]['rawAttributes']);_0x35e607[_0x40b5('0x34')]=_[_0x40b5('0x35')](_0x209646[_0x40b5('0x34')]);_0x35e607[_0x40b5('0x36')]=_['intersection'](_0x35e607[_0x40b5('0x33')],_0x35e607[_0x40b5('0x34')]);_0x3835a4['attributes']=_['intersection'](_0x35e607[_0x40b5('0x33')],qs[_0x40b5('0x37')](_0x209646[_0x40b5('0x34')][_0x40b5('0x37')]));_0x3835a4[_0x40b5('0x38')]=_0x3835a4[_0x40b5('0x38')]['length']?_0x3835a4['attributes']:_0x35e607['model'];_0x3835a4[_0x40b5('0x3a')]=qs[_0x40b5('0x3b')](_0x209646[_0x40b5('0x34')][_0x40b5('0x3b')]);_0x3835a4[_0x40b5('0x3d')]=qs[_0x40b5('0x36')](_[_0x40b5('0x3c')](_0x209646[_0x40b5('0x34')],_0x35e607[_0x40b5('0x36')]));if(_0x209646[_0x40b5('0x34')][_0x40b5('0x50')]){_0x3835a4[_0x40b5('0x3d')]=_[_0x40b5('0x3e')](_0x3835a4['where'],{'$or':_[_0x40b5('0x2d')](_0x3835a4['attributes'],function(_0x5b2940){var _0x5ac201={};_0x5ac201[_0x5b2940]={'$like':'%'+_0x209646[_0x40b5('0x34')]['filter']+'%'};return _0x5ac201;})});}_0x3835a4=_[_0x40b5('0x3e')]({},_0x3835a4,_0x209646['options']);return _0x46db84[_0x40b5('0x53')](_0x3835a4);}})[_0x40b5('0x26')](function(_0x228cd6){if(_0x228cd6){_0x5a7610=_0x228cd6['length'];if(!_0x209646[_0x40b5('0x34')][_0x40b5('0x51')](_0x40b5('0x39'))){_0x3835a4[_0x40b5('0x1f')]=qs[_0x40b5('0x1f')](_0x209646[_0x40b5('0x34')][_0x40b5('0x1f')]);_0x3835a4[_0x40b5('0x1d')]=qs[_0x40b5('0x1d')](_0x209646[_0x40b5('0x34')]['offset']);}return _0x46db84[_0x40b5('0x53')](_0x3835a4);}})[_0x40b5('0x26')](function(_0x502f3d){if(_0x502f3d){return _0x502f3d?{'count':_0x5a7610,'rows':_0x502f3d}:null;}})['then'](respondWithResult(_0x4cb395,null))[_0x40b5('0x43')](handleError(_0x4cb395,null));};
\ No newline at end of file
+var _0xc4b5=['jsforce','desk.js','to-csv','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','then','destroy','error','name','send','index','Automation','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','merge','type','filter','includeAll','include','findAll','rows','catch','show','params','options','create','body','find','Condition','ids','omit','getConditions','findOne','hasOwnProperty','addActions','getActions','Action','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto'];(function(_0x220900,_0x5b1eeb){var _0x5e143c=function(_0x230886){while(--_0x230886){_0x220900['push'](_0x220900['shift']());}};_0x5e143c(++_0x5b1eeb);}(_0xc4b5,0xf7));var _0x5c4b=function(_0xa9b530,_0xb439e3){_0xa9b530=_0xa9b530-0x0;var _0x5d21e5=_0xc4b5[_0xa9b530];return _0x5d21e5;};'use strict';var emlformat=require(_0x5c4b('0x0'));var rimraf=require(_0x5c4b('0x1'));var zipdir=require(_0x5c4b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5c4b('0x3'));var moment=require(_0x5c4b('0x4'));var BPromise=require(_0x5c4b('0x5'));var Mustache=require(_0x5c4b('0x6'));var util=require(_0x5c4b('0x7'));var path=require(_0x5c4b('0x8'));var sox=require(_0x5c4b('0x9'));var csv=require('to-csv');var ejs=require(_0x5c4b('0xa'));var fs=require('fs');var fs_extra=require(_0x5c4b('0xb'));var _=require('lodash');var squel=require(_0x5c4b('0xc'));var crypto=require(_0x5c4b('0xd'));var jsforce=require(_0x5c4b('0xe'));var deskjs=require(_0x5c4b('0xf'));var toCsv=require(_0x5c4b('0x10'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x5c4b('0x11'));var qs=require(_0x5c4b('0x12'));var as=require(_0x5c4b('0x13'));var hardwareService=require(_0x5c4b('0x14'));var logger=require(_0x5c4b('0x15'))(_0x5c4b('0x16'));var utils=require(_0x5c4b('0x17'));var config=require(_0x5c4b('0x18'));var licenseUtil=require(_0x5c4b('0x19'));var db=require(_0x5c4b('0x1a'))['db'];function respondWithStatusCode(_0x46e246,_0xf379b4){_0xf379b4=_0xf379b4||0xcc;return function(_0x201a47){if(_0x201a47){return _0x46e246[_0x5c4b('0x1b')](_0xf379b4);}return _0x46e246[_0x5c4b('0x1c')](_0xf379b4)[_0x5c4b('0x1d')]();};}function respondWithResult(_0x17df64,_0x21c9ef){_0x21c9ef=_0x21c9ef||0xc8;return function(_0x303a47){if(_0x303a47){return _0x17df64[_0x5c4b('0x1c')](_0x21c9ef)['json'](_0x303a47);}};}function respondWithFilteredResult(_0x236ef0,_0x260ef5){return function(_0x190fee){if(_0x190fee){var _0xbed3d5=typeof _0x260ef5['offset']===_0x5c4b('0x1e')&&typeof _0x260ef5[_0x5c4b('0x1f')]===_0x5c4b('0x1e');var _0x2e2726=_0x190fee[_0x5c4b('0x20')];var _0x30a27f=_0xbed3d5?0x0:_0x260ef5[_0x5c4b('0x21')];var _0xf0e71f=_0xbed3d5?_0x190fee['count']:_0x260ef5[_0x5c4b('0x21')]+_0x260ef5[_0x5c4b('0x1f')];var _0x3c576e;if(_0xf0e71f>=_0x2e2726){_0xf0e71f=_0x2e2726;_0x3c576e=0xc8;}else{_0x3c576e=0xce;}_0x236ef0[_0x5c4b('0x1c')](_0x3c576e);return _0x236ef0[_0x5c4b('0x22')](_0x5c4b('0x23'),_0x30a27f+'-'+_0xf0e71f+'/'+_0x2e2726)[_0x5c4b('0x24')](_0x190fee);}return null;};}function patchUpdates(_0x350ab4){return function(_0x499cde){try{jsonpatch[_0x5c4b('0x25')](_0x499cde,_0x350ab4,!![]);}catch(_0x331b5b){return BPromise[_0x5c4b('0x26')](_0x331b5b);}return _0x499cde[_0x5c4b('0x27')]();};}function saveUpdates(_0x15ba64,_0x323ff1){return function(_0x1ddfa7){if(_0x1ddfa7){return _0x1ddfa7['update'](_0x15ba64)[_0x5c4b('0x28')](function(_0x25a31c){return _0x25a31c;});}return null;};}function removeEntity(_0x10b7d6,_0x37bd49){return function(_0x13ba35){if(_0x13ba35){return _0x13ba35[_0x5c4b('0x29')]()['then'](function(){_0x10b7d6[_0x5c4b('0x1c')](0xcc)[_0x5c4b('0x1d')]();});}};}function handleEntityNotFound(_0x431eae,_0x1d1f54){return function(_0x4da10a){if(!_0x4da10a){_0x431eae[_0x5c4b('0x1b')](0x194);}return _0x4da10a;};}function handleError(_0x49756f,_0x118306){_0x118306=_0x118306||0x1f4;return function(_0x3c7d68){logger[_0x5c4b('0x2a')](_0x3c7d68['stack']);if(_0x3c7d68[_0x5c4b('0x2b')]){delete _0x3c7d68[_0x5c4b('0x2b')];}_0x49756f['status'](_0x118306)[_0x5c4b('0x2c')](_0x3c7d68);};}exports[_0x5c4b('0x2d')]=function(_0x1e8086,_0x4706f5){var _0x494c3b={},_0x9ae907={},_0x343b66={'count':0x0,'rows':[]};var _0x59b80f=_['map'](db[_0x5c4b('0x2e')][_0x5c4b('0x2f')],function(_0x11521c){return{'name':_0x11521c[_0x5c4b('0x30')],'type':_0x11521c['type'][_0x5c4b('0x31')]};});_0x9ae907[_0x5c4b('0x32')]=_[_0x5c4b('0x33')](_0x59b80f,_0x5c4b('0x2b'));_0x9ae907[_0x5c4b('0x34')]=_[_0x5c4b('0x35')](_0x1e8086[_0x5c4b('0x34')]);_0x9ae907[_0x5c4b('0x36')]=_[_0x5c4b('0x37')](_0x9ae907['model'],_0x9ae907[_0x5c4b('0x34')]);_0x494c3b['attributes']=_['intersection'](_0x9ae907['model'],qs[_0x5c4b('0x38')](_0x1e8086[_0x5c4b('0x34')][_0x5c4b('0x38')]));_0x494c3b[_0x5c4b('0x39')]=_0x494c3b['attributes'][_0x5c4b('0x3a')]?_0x494c3b[_0x5c4b('0x39')]:_0x9ae907['model'];if(!_0x1e8086[_0x5c4b('0x34')]['hasOwnProperty'](_0x5c4b('0x3b'))){_0x494c3b['limit']=qs[_0x5c4b('0x1f')](_0x1e8086[_0x5c4b('0x34')]['limit']);_0x494c3b[_0x5c4b('0x21')]=qs[_0x5c4b('0x21')](_0x1e8086['query'][_0x5c4b('0x21')]);}_0x494c3b[_0x5c4b('0x3c')]=qs['sort'](_0x1e8086['query'][_0x5c4b('0x3d')]);_0x494c3b[_0x5c4b('0x3e')]=qs['filters'](_[_0x5c4b('0x3f')](_0x1e8086['query'],_0x9ae907[_0x5c4b('0x36')]),_0x59b80f);if(_0x1e8086[_0x5c4b('0x34')]['filter']){_0x494c3b[_0x5c4b('0x3e')]=_[_0x5c4b('0x40')](_0x494c3b[_0x5c4b('0x3e')],{'$or':_['map'](_0x59b80f,function(_0x1c336b){if(_0x1c336b[_0x5c4b('0x41')]!=='VIRTUAL'){var _0x47da97={};_0x47da97[_0x1c336b[_0x5c4b('0x2b')]]={'$like':'%'+_0x1e8086[_0x5c4b('0x34')][_0x5c4b('0x42')]+'%'};return _0x47da97;}})});}_0x494c3b=_['merge']({},_0x494c3b,_0x1e8086['options']);var _0x5b0381={'where':_0x494c3b[_0x5c4b('0x3e')]};return db[_0x5c4b('0x2e')][_0x5c4b('0x20')](_0x5b0381)[_0x5c4b('0x28')](function(_0x36cb2c){_0x343b66[_0x5c4b('0x20')]=_0x36cb2c;if(_0x1e8086['query'][_0x5c4b('0x43')]){_0x494c3b[_0x5c4b('0x44')]=[{'all':!![]}];}return db['Automation'][_0x5c4b('0x45')](_0x494c3b);})[_0x5c4b('0x28')](function(_0x510055){_0x343b66[_0x5c4b('0x46')]=_0x510055;return _0x343b66;})[_0x5c4b('0x28')](respondWithFilteredResult(_0x4706f5,_0x494c3b))[_0x5c4b('0x47')](handleError(_0x4706f5,null));};exports[_0x5c4b('0x48')]=function(_0x605704,_0x34f214){var _0x32ad7b={'raw':![],'where':{'id':_0x605704[_0x5c4b('0x49')]['id']}},_0x33e3cb={};_0x33e3cb[_0x5c4b('0x32')]=_['keys'](db[_0x5c4b('0x2e')][_0x5c4b('0x2f')]);_0x33e3cb['query']=_[_0x5c4b('0x35')](_0x605704[_0x5c4b('0x34')]);_0x33e3cb['filters']=_[_0x5c4b('0x37')](_0x33e3cb[_0x5c4b('0x32')],_0x33e3cb[_0x5c4b('0x34')]);_0x32ad7b[_0x5c4b('0x39')]=_['intersection'](_0x33e3cb['model'],qs[_0x5c4b('0x38')](_0x605704[_0x5c4b('0x34')]['fields']));_0x32ad7b[_0x5c4b('0x39')]=_0x32ad7b[_0x5c4b('0x39')][_0x5c4b('0x3a')]?_0x32ad7b['attributes']:_0x33e3cb[_0x5c4b('0x32')];if(_0x605704[_0x5c4b('0x34')][_0x5c4b('0x43')]){_0x32ad7b[_0x5c4b('0x44')]=[{'all':!![]}];}_0x32ad7b=_[_0x5c4b('0x40')]({},_0x32ad7b,_0x605704[_0x5c4b('0x4a')]);return db['Automation']['find'](_0x32ad7b)['then'](handleEntityNotFound(_0x34f214,null))[_0x5c4b('0x28')](respondWithResult(_0x34f214,null))[_0x5c4b('0x47')](handleError(_0x34f214,null));};exports[_0x5c4b('0x4b')]=function(_0x193277,_0x3ad117){return db[_0x5c4b('0x2e')][_0x5c4b('0x4b')](_0x193277[_0x5c4b('0x4c')],{})[_0x5c4b('0x28')](respondWithResult(_0x3ad117,0xc9))[_0x5c4b('0x47')](handleError(_0x3ad117,null));};exports['update']=function(_0x3a1587,_0x7d5756){if(_0x3a1587[_0x5c4b('0x4c')]['id']){delete _0x3a1587['body']['id'];}return db[_0x5c4b('0x2e')][_0x5c4b('0x4d')]({'where':{'id':_0x3a1587[_0x5c4b('0x49')]['id']}})[_0x5c4b('0x28')](handleEntityNotFound(_0x7d5756,null))[_0x5c4b('0x28')](saveUpdates(_0x3a1587[_0x5c4b('0x4c')],null))[_0x5c4b('0x28')](respondWithResult(_0x7d5756,null))[_0x5c4b('0x47')](handleError(_0x7d5756,null));};exports[_0x5c4b('0x29')]=function(_0x241801,_0x26c0c9){return db[_0x5c4b('0x2e')][_0x5c4b('0x4d')]({'where':{'id':_0x241801[_0x5c4b('0x49')]['id']}})[_0x5c4b('0x28')](handleEntityNotFound(_0x26c0c9,null))[_0x5c4b('0x28')](removeEntity(_0x26c0c9,null))[_0x5c4b('0x47')](handleError(_0x26c0c9,null));};exports['addConditions']=function(_0x20be87,_0x1c0133,_0x9f4561){return db[_0x5c4b('0x4e')]['find']({'where':{'id':_0x20be87[_0x5c4b('0x49')]['id']}})['then'](handleEntityNotFound(_0x1c0133,null))[_0x5c4b('0x28')](function(_0x382f35){if(_0x382f35){return _0x382f35['addConditions'](_0x20be87['body'][_0x5c4b('0x4f')],_[_0x5c4b('0x50')](_0x20be87[_0x5c4b('0x4c')],['ids','id'])||{});}})['then'](respondWithResult(_0x1c0133,null))['catch'](handleError(_0x1c0133,null));};exports[_0x5c4b('0x51')]=function(_0x34f068,_0xa90c8f,_0x72ebc5){var _0x4380d1={};var _0x5462fc={};var _0x2a467b;var _0x1a9817;return db['Automation'][_0x5c4b('0x52')]({'where':{'id':_0x34f068[_0x5c4b('0x49')]['id']}})[_0x5c4b('0x28')](handleEntityNotFound(_0xa90c8f,null))[_0x5c4b('0x28')](function(_0x4f71ad){if(_0x4f71ad){_0x2a467b=_0x4f71ad;_0x5462fc['model']=_[_0x5c4b('0x35')](db['Condition'][_0x5c4b('0x2f')]);_0x5462fc[_0x5c4b('0x34')]=_[_0x5c4b('0x35')](_0x34f068[_0x5c4b('0x34')]);_0x5462fc[_0x5c4b('0x36')]=_[_0x5c4b('0x37')](_0x5462fc['model'],_0x5462fc[_0x5c4b('0x34')]);_0x4380d1[_0x5c4b('0x39')]=_[_0x5c4b('0x37')](_0x5462fc[_0x5c4b('0x32')],qs[_0x5c4b('0x38')](_0x34f068[_0x5c4b('0x34')][_0x5c4b('0x38')]));_0x4380d1[_0x5c4b('0x39')]=_0x4380d1[_0x5c4b('0x39')][_0x5c4b('0x3a')]?_0x4380d1[_0x5c4b('0x39')]:_0x5462fc[_0x5c4b('0x32')];_0x4380d1[_0x5c4b('0x3c')]=qs[_0x5c4b('0x3d')](_0x34f068[_0x5c4b('0x34')][_0x5c4b('0x3d')]);_0x4380d1[_0x5c4b('0x3e')]=qs[_0x5c4b('0x36')](_['pick'](_0x34f068[_0x5c4b('0x34')],_0x5462fc[_0x5c4b('0x36')]));if(_0x34f068[_0x5c4b('0x34')][_0x5c4b('0x42')]){_0x4380d1[_0x5c4b('0x3e')]=_[_0x5c4b('0x40')](_0x4380d1[_0x5c4b('0x3e')],{'$or':_[_0x5c4b('0x33')](_0x4380d1[_0x5c4b('0x39')],function(_0x3bac64){var _0x12eb39={};_0x12eb39[_0x3bac64]={'$like':'%'+_0x34f068[_0x5c4b('0x34')][_0x5c4b('0x42')]+'%'};return _0x12eb39;})});}_0x4380d1=_['merge']({},_0x4380d1,_0x34f068['options']);return _0x2a467b[_0x5c4b('0x51')](_0x4380d1);}})[_0x5c4b('0x28')](function(_0x1cd444){if(_0x1cd444){_0x1a9817=_0x1cd444['length'];if(!_0x34f068[_0x5c4b('0x34')][_0x5c4b('0x53')](_0x5c4b('0x3b'))){_0x4380d1[_0x5c4b('0x1f')]=qs[_0x5c4b('0x1f')](_0x34f068[_0x5c4b('0x34')][_0x5c4b('0x1f')]);_0x4380d1[_0x5c4b('0x21')]=qs['offset'](_0x34f068[_0x5c4b('0x34')]['offset']);}return _0x2a467b[_0x5c4b('0x51')](_0x4380d1);}})[_0x5c4b('0x28')](function(_0x201af9){if(_0x201af9){return _0x201af9?{'count':_0x1a9817,'rows':_0x201af9}:null;}})[_0x5c4b('0x28')](respondWithResult(_0xa90c8f,null))[_0x5c4b('0x47')](handleError(_0xa90c8f,null));};exports[_0x5c4b('0x54')]=function(_0x5a6639,_0x58b56d,_0x2fbed6){return db['Action']['find']({'where':{'id':_0x5a6639[_0x5c4b('0x49')]['id']}})[_0x5c4b('0x28')](handleEntityNotFound(_0x58b56d,null))[_0x5c4b('0x28')](function(_0x5addda){if(_0x5addda){return _0x5addda['addActions'](_0x5a6639[_0x5c4b('0x4c')][_0x5c4b('0x4f')],_[_0x5c4b('0x50')](_0x5a6639[_0x5c4b('0x4c')],[_0x5c4b('0x4f'),'id'])||{});}})[_0x5c4b('0x28')](respondWithResult(_0x58b56d,null))[_0x5c4b('0x47')](handleError(_0x58b56d,null));};exports[_0x5c4b('0x55')]=function(_0x4bb7b8,_0x43b073,_0x4daeb8){var _0x60a490={};var _0x2b7137={};var _0x241c39;var _0xa60f53;return db[_0x5c4b('0x2e')][_0x5c4b('0x52')]({'where':{'id':_0x4bb7b8[_0x5c4b('0x49')]['id']}})[_0x5c4b('0x28')](handleEntityNotFound(_0x43b073,null))[_0x5c4b('0x28')](function(_0x4775b1){if(_0x4775b1){_0x241c39=_0x4775b1;_0x2b7137[_0x5c4b('0x32')]=_[_0x5c4b('0x35')](db[_0x5c4b('0x56')]['rawAttributes']);_0x2b7137[_0x5c4b('0x34')]=_[_0x5c4b('0x35')](_0x4bb7b8[_0x5c4b('0x34')]);_0x2b7137[_0x5c4b('0x36')]=_[_0x5c4b('0x37')](_0x2b7137[_0x5c4b('0x32')],_0x2b7137['query']);_0x60a490[_0x5c4b('0x39')]=_[_0x5c4b('0x37')](_0x2b7137[_0x5c4b('0x32')],qs[_0x5c4b('0x38')](_0x4bb7b8[_0x5c4b('0x34')][_0x5c4b('0x38')]));_0x60a490[_0x5c4b('0x39')]=_0x60a490[_0x5c4b('0x39')][_0x5c4b('0x3a')]?_0x60a490[_0x5c4b('0x39')]:_0x2b7137[_0x5c4b('0x32')];_0x60a490['order']=qs[_0x5c4b('0x3d')](_0x4bb7b8[_0x5c4b('0x34')][_0x5c4b('0x3d')]);_0x60a490[_0x5c4b('0x3e')]=qs[_0x5c4b('0x36')](_[_0x5c4b('0x3f')](_0x4bb7b8[_0x5c4b('0x34')],_0x2b7137[_0x5c4b('0x36')]));if(_0x4bb7b8[_0x5c4b('0x34')][_0x5c4b('0x42')]){_0x60a490[_0x5c4b('0x3e')]=_[_0x5c4b('0x40')](_0x60a490[_0x5c4b('0x3e')],{'$or':_[_0x5c4b('0x33')](_0x60a490[_0x5c4b('0x39')],function(_0x5cc85e){var _0x23a8e2={};_0x23a8e2[_0x5cc85e]={'$like':'%'+_0x4bb7b8[_0x5c4b('0x34')]['filter']+'%'};return _0x23a8e2;})});}_0x60a490=_[_0x5c4b('0x40')]({},_0x60a490,_0x4bb7b8[_0x5c4b('0x4a')]);return _0x241c39['getActions'](_0x60a490);}})[_0x5c4b('0x28')](function(_0x565e2f){if(_0x565e2f){_0xa60f53=_0x565e2f[_0x5c4b('0x3a')];if(!_0x4bb7b8[_0x5c4b('0x34')][_0x5c4b('0x53')](_0x5c4b('0x3b'))){_0x60a490[_0x5c4b('0x1f')]=qs[_0x5c4b('0x1f')](_0x4bb7b8[_0x5c4b('0x34')]['limit']);_0x60a490[_0x5c4b('0x21')]=qs[_0x5c4b('0x21')](_0x4bb7b8[_0x5c4b('0x34')]['offset']);}return _0x241c39[_0x5c4b('0x55')](_0x60a490);}})['then'](function(_0x3194f1){if(_0x3194f1){return _0x3194f1?{'count':_0xa60f53,'rows':_0x3194f1}:null;}})[_0x5c4b('0x28')](respondWithResult(_0x43b073,null))['catch'](handleError(_0x43b073,null));};
\ No newline at end of file
index 32b30e6..2c55ff4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6150=['bluebird','path','rimraf','../../config/environment','define','tools_automations','lodash','util','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6150,0x84));var _0x0615=function(_0x30c77f,_0x44693d){_0x30c77f=_0x30c77f-0x0;var _0x1d97a7=_0x6150[_0x30c77f];return _0x1d97a7;};'use strict';var _=require(_0x0615('0x0'));var util=require(_0x0615('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x0615('0x2'));var BPromise=require(_0x0615('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0615('0x4'));var rimraf=require(_0x0615('0x5'));var config=require(_0x0615('0x6'));var attributes=require('./automation.attributes');module['exports']=function(_0x24c347,_0x4fc441){return _0x24c347[_0x0615('0x7')]('Automation',attributes,{'tableName':_0x0615('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x23c0=['./automation.attributes','exports','Automation','util','api','bluebird','rimraf','../../config/environment'];(function(_0x246371,_0x3ca7e0){var _0x1da5b5=function(_0x37f80b){while(--_0x37f80b){_0x246371['push'](_0x246371['shift']());}};_0x1da5b5(++_0x3ca7e0);}(_0x23c0,0x1c3));var _0x023c=function(_0x463e5b,_0x52feee){_0x463e5b=_0x463e5b-0x0;var _0x1b5e35=_0x23c0[_0x463e5b];return _0x1b5e35;};'use strict';var _=require('lodash');var util=require(_0x023c('0x0'));var logger=require('../../config/logger')(_0x023c('0x1'));var moment=require('moment');var BPromise=require(_0x023c('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x023c('0x3'));var config=require(_0x023c('0x4'));var attributes=require(_0x023c('0x5'));module[_0x023c('0x6')]=function(_0x47f354,_0x2b17ea){return _0x47f354['define'](_0x023c('0x7'),attributes,{'tableName':'tools_automations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 1018420..e9af981 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0954=['Automation,\x20%s,\x20%s','debug','Automation,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','request','info'];(function(_0x849e7c,_0x34014e){var _0x11722f=function(_0x1a3fa3){while(--_0x1a3fa3){_0x849e7c['push'](_0x849e7c['shift']());}};_0x11722f(++_0x34014e);}(_0x0954,0x135));var _0x4095=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0x0954[_0xea8947];return _0x2455e9;};'use strict';var _=require(_0x4095('0x0'));var util=require('util');var moment=require(_0x4095('0x1'));var BPromise=require(_0x4095('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4095('0x3'));var db=require(_0x4095('0x4'))['db'];var utils=require(_0x4095('0x5'));var logger=require(_0x4095('0x6'))(_0x4095('0x7'));var config=require(_0x4095('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x14b440,_0x352c8f,_0x1cf027){return new BPromise(function(_0x1440af,_0x24adfd){return client[_0x4095('0x9')](_0x14b440,_0x1cf027)['then'](function(_0x158dc7){logger[_0x4095('0xa')](_0x4095('0xb'),_0x352c8f,'request\x20sent');logger[_0x4095('0xc')](_0x4095('0xd'),_0x352c8f,_0x4095('0xe'),JSON['stringify'](_0x158dc7));if(_0x158dc7[_0x4095('0xf')]){if(_0x158dc7['error'][_0x4095('0x10')]===0x1f4){logger['error'](_0x4095('0xb'),_0x352c8f,_0x158dc7[_0x4095('0xf')][_0x4095('0x11')]);return _0x24adfd(_0x158dc7['error']['message']);}logger[_0x4095('0xf')](_0x4095('0xb'),_0x352c8f,_0x158dc7[_0x4095('0xf')][_0x4095('0x11')]);return _0x1440af(_0x158dc7['error']['message']);}else{logger[_0x4095('0xa')](_0x4095('0xb'),_0x352c8f,_0x4095('0xe'));_0x1440af(_0x158dc7[_0x4095('0x12')][_0x4095('0x11')]);}})[_0x4095('0x13')](function(_0x50c8c0){logger['error'](_0x4095('0xb'),_0x352c8f,_0x50c8c0);_0x24adfd(_0x50c8c0);});});}
\ No newline at end of file
+var _0x8f1a=['debug','error','code','Automation,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','request','then','info','request\x20sent'];(function(_0x35c12c,_0x378ba0){var _0x2bab3a=function(_0x43eeb2){while(--_0x43eeb2){_0x35c12c['push'](_0x35c12c['shift']());}};_0x2bab3a(++_0x378ba0);}(_0x8f1a,0xcd));var _0xa8f1=function(_0x51f537,_0x5a2b9b){_0x51f537=_0x51f537-0x0;var _0x4b3920=_0x8f1a[_0x51f537];return _0x4b3920;};'use strict';var _=require(_0xa8f1('0x0'));var util=require(_0xa8f1('0x1'));var moment=require(_0xa8f1('0x2'));var BPromise=require(_0xa8f1('0x3'));var rs=require(_0xa8f1('0x4'));var fs=require('fs');var Redis=require(_0xa8f1('0x5'));var db=require(_0xa8f1('0x6'))['db'];var utils=require(_0xa8f1('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xa8f1('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xa8f1('0x9')][_0xa8f1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4c2920,_0x43c3ed,_0x13f210){return new BPromise(function(_0xcc8a38,_0x36b58b){return client[_0xa8f1('0xb')](_0x4c2920,_0x13f210)[_0xa8f1('0xc')](function(_0x1a23a0){logger[_0xa8f1('0xd')]('Automation,\x20%s,\x20%s',_0x43c3ed,_0xa8f1('0xe'));logger[_0xa8f1('0xf')]('Automation,\x20%s,\x20%s,\x20%s',_0x43c3ed,_0xa8f1('0xe'),JSON['stringify'](_0x1a23a0));if(_0x1a23a0[_0xa8f1('0x10')]){if(_0x1a23a0[_0xa8f1('0x10')][_0xa8f1('0x11')]===0x1f4){logger['error'](_0xa8f1('0x12'),_0x43c3ed,_0x1a23a0[_0xa8f1('0x10')][_0xa8f1('0x13')]);return _0x36b58b(_0x1a23a0[_0xa8f1('0x10')][_0xa8f1('0x13')]);}logger['error'](_0xa8f1('0x12'),_0x43c3ed,_0x1a23a0['error'][_0xa8f1('0x13')]);return _0xcc8a38(_0x1a23a0[_0xa8f1('0x10')]['message']);}else{logger['info'](_0xa8f1('0x12'),_0x43c3ed,_0xa8f1('0xe'));_0xcc8a38(_0x1a23a0[_0xa8f1('0x14')][_0xa8f1('0x13')]);}})[_0xa8f1('0x15')](function(_0x15bfad){logger[_0xa8f1('0x10')](_0xa8f1('0x12'),_0x43c3ed,_0x15bfad);_0x36b58b(_0x15bfad);});});}
\ No newline at end of file
index 480956b..538e8ee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x82f5=['getConditions','getActions','post','create','addConditions','/:id/actions','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','index','/:id','show','/:id/conditions'];(function(_0x55eae9,_0x609612){var _0x1db073=function(_0x32f0ff){while(--_0x32f0ff){_0x55eae9['push'](_0x55eae9['shift']());}};_0x1db073(++_0x609612);}(_0x82f5,0x15d));var _0x582f=function(_0x4168ba,_0x544a68){_0x4168ba=_0x4168ba-0x0;var _0x314cd5=_0x82f5[_0x4168ba];return _0x314cd5;};'use strict';var multer=require(_0x582f('0x0'));var util=require(_0x582f('0x1'));var path=require(_0x582f('0x2'));var timeout=require(_0x582f('0x3'));var express=require(_0x582f('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x582f('0x5'));var interaction=require(_0x582f('0x6'));var config=require(_0x582f('0x7'));var controller=require(_0x582f('0x8'));router[_0x582f('0x9')]('/',auth[_0x582f('0xa')](),controller[_0x582f('0xb')]);router['get'](_0x582f('0xc'),auth['isAuthenticated'](),controller[_0x582f('0xd')]);router[_0x582f('0x9')](_0x582f('0xe'),auth['isAuthenticated'](),controller[_0x582f('0xf')]);router[_0x582f('0x9')]('/:id/actions',auth[_0x582f('0xa')](),controller[_0x582f('0x10')]);router[_0x582f('0x11')]('/',auth[_0x582f('0xa')](),controller[_0x582f('0x12')]);router['post']('/:id/conditions',auth[_0x582f('0xa')](),controller[_0x582f('0x13')]);router[_0x582f('0x11')](_0x582f('0x14'),auth[_0x582f('0xa')](),controller['addActions']);router[_0x582f('0x15')](_0x582f('0xc'),auth['isAuthenticated'](),controller[_0x582f('0x16')]);router[_0x582f('0x17')](_0x582f('0xc'),auth[_0x582f('0xa')](),controller[_0x582f('0x18')]);module[_0x582f('0x19')]=router;
\ No newline at end of file
+var _0x430e=['Router','fs-extra','../../components/auth/service','../../config/environment','./automation.controller','get','isAuthenticated','/:id','show','getConditions','/:id/actions','post','create','/:id/conditions','addConditions','addActions','put','update','delete','destroy','exports','util','path','express'];(function(_0x26b7f7,_0x1533fe){var _0x199e66=function(_0x14357e){while(--_0x14357e){_0x26b7f7['push'](_0x26b7f7['shift']());}};_0x199e66(++_0x1533fe);}(_0x430e,0x105));var _0xe430=function(_0x2fb356,_0x567092){_0x2fb356=_0x2fb356-0x0;var _0x27fb4b=_0x430e[_0x2fb356];return _0x27fb4b;};'use strict';var multer=require('multer');var util=require(_0xe430('0x0'));var path=require(_0xe430('0x1'));var timeout=require('connect-timeout');var express=require(_0xe430('0x2'));var router=express[_0xe430('0x3')]();var fs_extra=require(_0xe430('0x4'));var auth=require(_0xe430('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xe430('0x6'));var controller=require(_0xe430('0x7'));router[_0xe430('0x8')]('/',auth[_0xe430('0x9')](),controller['index']);router[_0xe430('0x8')](_0xe430('0xa'),auth[_0xe430('0x9')](),controller[_0xe430('0xb')]);router[_0xe430('0x8')]('/:id/conditions',auth[_0xe430('0x9')](),controller[_0xe430('0xc')]);router[_0xe430('0x8')](_0xe430('0xd'),auth[_0xe430('0x9')](),controller['getActions']);router[_0xe430('0xe')]('/',auth[_0xe430('0x9')](),controller[_0xe430('0xf')]);router[_0xe430('0xe')](_0xe430('0x10'),auth['isAuthenticated'](),controller[_0xe430('0x11')]);router['post']('/:id/actions',auth[_0xe430('0x9')](),controller[_0xe430('0x12')]);router[_0xe430('0x13')](_0xe430('0xa'),auth[_0xe430('0x9')](),controller[_0xe430('0x14')]);router[_0xe430('0x15')]('/:id',auth[_0xe430('0x9')](),controller[_0xe430('0x16')]);module[_0xe430('0x17')]=router;
\ No newline at end of file
index 98d0463..8ecaa85 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb2af=['always','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','name','ivr','BOOLEAN','Active/Disactive\x20Campaign','UNSIGNED','Max\x20200\x20calls.','INTEGER','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','ENUM','onlyIfOpen'];(function(_0x2d194b,_0x28fa16){var _0x53c88d=function(_0x213ff5){while(--_0x213ff5){_0x2d194b['push'](_0x2d194b['shift']());}};_0x53c88d(++_0x28fa16);}(_0xb2af,0xd2));var _0xfb2a=function(_0x876d6d,_0xd557c){_0x876d6d=_0x876d6d-0x0;var _0x5d5a43=_0xb2af[_0x876d6d];return _0x5d5a43;};'use strict';var Sequelize=require(_0xfb2a('0x0'));module[_0xfb2a('0x1')]={'name':{'type':Sequelize[_0xfb2a('0x2')],'unique':_0xfb2a('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0xfb2a('0x4')),'allowNull':![],'defaultValue':_0xfb2a('0x4')},'description':{'type':Sequelize[_0xfb2a('0x2')]},'active':{'type':Sequelize[_0xfb2a('0x5')],'defaultValue':0x0,'comment':_0xfb2a('0x6')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0xfb2a('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xfb2a('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0xfb2a('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0xfb2a('0x9')](0x3)[_0xfb2a('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xfb2a('0xa')},'dialCongestionMaxRetry':{'type':Sequelize[_0xfb2a('0x9')](0x3)[_0xfb2a('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xfb2a('0xb')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xfb2a('0x9')](0x5)[_0xfb2a('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xfb2a('0xc')},'dialBusyMaxRetry':{'type':Sequelize[_0xfb2a('0x9')](0x3)[_0xfb2a('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xfb2a('0xd')},'dialBusyRetryFrequency':{'type':Sequelize[_0xfb2a('0x9')](0x5)[_0xfb2a('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xfb2a('0xe')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xfb2a('0x9')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xfb2a('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xfb2a('0xf')},'dialGlobalMaxRetry':{'type':Sequelize[_0xfb2a('0x9')](0x3)[_0xfb2a('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0xfb2a('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0xfb2a('0x10')]('always','never',_0xfb2a('0x11')),'defaultValue':_0xfb2a('0x12')},'dialAMDActive':{'type':Sequelize[_0xfb2a('0x5')],'defaultValue':0x0,'comment':_0xfb2a('0x13')},'dialAMDInitialSilence':{'type':Sequelize[_0xfb2a('0x9')](0x9)[_0xfb2a('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xfb2a('0x14')},'dialAMDGreeting':{'type':Sequelize[_0xfb2a('0x9')](0x9)[_0xfb2a('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xfb2a('0x9')](0x9)[_0xfb2a('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xfb2a('0x15')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xfb2a('0x9')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xfb2a('0x16')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0xfb2a('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xfb2a('0x17')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xfb2a('0x9')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xfb2a('0x18')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xfb2a('0x9')](0x5)[_0xfb2a('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xfb2a('0x19')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xfb2a('0x9')](0x9)[_0xfb2a('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xfb2a('0x1a')},'dialOrderByScheduledAt':{'type':Sequelize[_0xfb2a('0x10')](_0xfb2a('0x1b'),_0xfb2a('0x1c')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0xfb2a('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0xfb2a('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xfb2a('0x1d')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0xfb2a('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xfb2a('0x1e')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xfb2a('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xfb2a('0x1f')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xfb2a('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xfb2a('0x20')},'dialDropMaxRetry':{'type':Sequelize[_0xfb2a('0x9')](0x3)[_0xfb2a('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xfb2a('0x21')},'dialDropRetryFrequency':{'type':Sequelize[_0xfb2a('0x9')](0x5)[_0xfb2a('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xfb2a('0x22')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xfb2a('0x9')](0x3)[_0xfb2a('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xfb2a('0x9')](0x5)[_0xfb2a('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xfb2a('0x23')},'dialMachineMaxRetry':{'type':Sequelize[_0xfb2a('0x9')](0x3)[_0xfb2a('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xfb2a('0x24')},'dialMachineRetryFrequency':{'type':Sequelize[_0xfb2a('0x9')](0x5)[_0xfb2a('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xfb2a('0x9')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xfb2a('0x9')](0x5)[_0xfb2a('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xfb2a('0x25')}};
\ No newline at end of file
+var _0xef6d=['07:00-22:00,*,*,*','ENUM','never','onlyIfOpen','always','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','ivr','BOOLEAN','Active/Disactive\x20Campaign','UNSIGNED','Max\x20200\x20calls.','INTEGER','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'];(function(_0x29f96d,_0x35e5b6){var _0x223056=function(_0x1c2a43){while(--_0x1c2a43){_0x29f96d['push'](_0x29f96d['shift']());}};_0x223056(++_0x35e5b6);}(_0xef6d,0x1df));var _0xdef6=function(_0x4e75bf,_0x3b7e84){_0x4e75bf=_0x4e75bf-0x0;var _0x1e8f3e=_0xef6d[_0x4e75bf];return _0x1e8f3e;};'use strict';var Sequelize=require(_0xdef6('0x0'));module[_0xdef6('0x1')]={'name':{'type':Sequelize[_0xdef6('0x2')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0xdef6('0x3')),'allowNull':![],'defaultValue':_0xdef6('0x3')},'description':{'type':Sequelize[_0xdef6('0x2')]},'active':{'type':Sequelize[_0xdef6('0x4')],'defaultValue':0x0,'comment':_0xdef6('0x5')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0xdef6('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xdef6('0x7')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xdef6('0x2')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0xdef6('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize[_0xdef6('0x8')](0x3)[_0xdef6('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xdef6('0x9')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xdef6('0x8')](0x5)[_0xdef6('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdef6('0xa')},'dialBusyMaxRetry':{'type':Sequelize[_0xdef6('0x8')](0x3)[_0xdef6('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xdef6('0xb')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xdef6('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xdef6('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0xdef6('0xc')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xdef6('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdef6('0xd')},'dialGlobalMaxRetry':{'type':Sequelize[_0xdef6('0x8')](0x3)[_0xdef6('0x6')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xdef6('0xe')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xdef6('0x2')],'defaultValue':_0xdef6('0xf')},'dialCheckDuplicateType':{'type':Sequelize[_0xdef6('0x10')]('always',_0xdef6('0x11'),_0xdef6('0x12')),'defaultValue':_0xdef6('0x13')},'dialAMDActive':{'type':Sequelize[_0xdef6('0x4')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xdef6('0x14')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xdef6('0x15')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xdef6('0x8')](0x9)[_0xdef6('0x6')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0xdef6('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0xdef6('0x8')](0x9)[_0xdef6('0x6')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xdef6('0x8')](0x9)[_0xdef6('0x6')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xdef6('0x16')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xdef6('0x8')](0x9)[_0xdef6('0x6')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xdef6('0x17')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xdef6('0x8')](0x5)[_0xdef6('0x6')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xdef6('0x18')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xdef6('0x8')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xdef6('0x19')},'dialOrderByScheduledAt':{'type':Sequelize[_0xdef6('0x10')](_0xdef6('0x1a'),_0xdef6('0x1b')),'defaultValue':_0xdef6('0x1a')},'dialPrefix':{'type':Sequelize[_0xdef6('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xdef6('0x8')](0x3)[_0xdef6('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xdef6('0x1c')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0xdef6('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xdef6('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xdef6('0x8')](0x5)[_0xdef6('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdef6('0x1d')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xdef6('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xdef6('0x1e')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xdef6('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdef6('0x1f')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xdef6('0x8')](0x3)[_0xdef6('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xdef6('0x20')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xdef6('0x8')](0x5)[_0xdef6('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdef6('0x21')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xdef6('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xdef6('0x22')},'dialMachineRetryFrequency':{'type':Sequelize[_0xdef6('0x8')](0x5)[_0xdef6('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdef6('0x23')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xdef6('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xdef6('0x24')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xdef6('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdef6('0x25')}};
\ No newline at end of file
index 07bf36b..1911a27 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6e90=['sort','filters','pick','filter','where','merge','type','VIRTUAL','Campaign','includeAll','findAll','rows','catch','show','params','include','options','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','createdAt','updatedAt','omit','create','error','update','getHoppers','CmHopper','nolimit','CampaignId','getHopperHistories','findOne','CmHopperHistory','order','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','format','YYYY-MM-DD\x20HH:mm:ss','ids','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ListId','field','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','CmListId','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','select','COALESCE(calleridnum,\x27\x27)','CampaignId\x20=\x20?','onlyIfOpen','ContactId','COALESCE(phone,\x27\x27)','NOW()','ListId\x20=\x20?','cm_hopper_additional_phones','cmHopperId','h.id','ci.item','ci.OrderBY','cm_contact_has_items','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','sequelize','all','removeLists','getBlackLists','addBlackLists','spread','cm_hopper_black','push','removeBlackLists','eml-format','rimraf','zip-dir','request-promise','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/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','destroy','then','get','IvrCampaigns','UserProfileResource','stack','name','send','index','map','rawAttributes','fieldName','key','model','keys','query','intersection','fields','attributes','length','hasOwnProperty'];(function(_0x3c51d4,_0x36ba53){var _0x53c45f=function(_0x3d6683){while(--_0x3d6683){_0x3c51d4['push'](_0x3c51d4['shift']());}};_0x53c45f(++_0x36ba53);}(_0x6e90,0xf5));var _0x06e9=function(_0x4071a3,_0x3f18e5){_0x4071a3=_0x4071a3-0x0;var _0x310280=_0x6e90[_0x4071a3];return _0x310280;};'use strict';var emlformat=require(_0x06e9('0x0'));var rimraf=require(_0x06e9('0x1'));var zipdir=require(_0x06e9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x06e9('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x06e9('0x4'));var util=require(_0x06e9('0x5'));var path=require(_0x06e9('0x6'));var sox=require(_0x06e9('0x7'));var csv=require(_0x06e9('0x8'));var ejs=require(_0x06e9('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x06e9('0xa'));var squel=require(_0x06e9('0xb'));var crypto=require(_0x06e9('0xc'));var jsforce=require(_0x06e9('0xd'));var deskjs=require(_0x06e9('0xe'));var toCsv=require(_0x06e9('0x8'));var querystring=require(_0x06e9('0xf'));var Papa=require(_0x06e9('0x10'));var Redis=require(_0x06e9('0x11'));var authService=require(_0x06e9('0x12'));var qs=require(_0x06e9('0x13'));var as=require(_0x06e9('0x14'));var hardwareService=require(_0x06e9('0x15'));var logger=require(_0x06e9('0x16'))(_0x06e9('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x06e9('0x18'));var db=require(_0x06e9('0x19'))['db'];function respondWithStatusCode(_0x3eea8d,_0xf8100a){_0xf8100a=_0xf8100a||0xcc;return function(_0x1d1e2b){if(_0x1d1e2b){return _0x3eea8d[_0x06e9('0x1a')](_0xf8100a);}return _0x3eea8d['status'](_0xf8100a)[_0x06e9('0x1b')]();};}function respondWithResult(_0x3783bd,_0x215c94){_0x215c94=_0x215c94||0xc8;return function(_0x365f2c){if(_0x365f2c){return _0x3783bd[_0x06e9('0x1c')](_0x215c94)[_0x06e9('0x1d')](_0x365f2c);}};}function respondWithFilteredResult(_0xf808b6,_0x1855b8){return function(_0x27c3b5){if(_0x27c3b5){var _0x309b7d=typeof _0x1855b8[_0x06e9('0x1e')]==='undefined'&&typeof _0x1855b8['limit']===_0x06e9('0x1f');var _0xf42c19=_0x27c3b5[_0x06e9('0x20')];var _0x54167b=_0x309b7d?0x0:_0x1855b8[_0x06e9('0x1e')];var _0x22cc1e=_0x309b7d?_0x27c3b5['count']:_0x1855b8[_0x06e9('0x1e')]+_0x1855b8[_0x06e9('0x21')];var _0x4aa3dc;if(_0x22cc1e>=_0xf42c19){_0x22cc1e=_0xf42c19;_0x4aa3dc=0xc8;}else{_0x4aa3dc=0xce;}_0xf808b6['status'](_0x4aa3dc);return _0xf808b6[_0x06e9('0x22')](_0x06e9('0x23'),_0x54167b+'-'+_0x22cc1e+'/'+_0xf42c19)[_0x06e9('0x1d')](_0x27c3b5);}return null;};}function patchUpdates(_0x3d6d4f){return function(_0x5568b5){try{jsonpatch['apply'](_0x5568b5,_0x3d6d4f,!![]);}catch(_0x4fe4f1){return BPromise[_0x06e9('0x24')](_0x4fe4f1);}return _0x5568b5[_0x06e9('0x25')]();};}function saveUpdates(_0x19b3e1,_0x5264b9){return function(_0x2d27c5){if(_0x2d27c5){return _0x2d27c5['update'](_0x19b3e1)['then'](function(_0x1862bd){return _0x1862bd;});}return null;};}function removeEntity(_0x3a6936,_0x533fd8){return function(_0x4aced4){if(_0x4aced4){return _0x4aced4[_0x06e9('0x26')]()[_0x06e9('0x27')](function(){var _0x13f5ce=_0x4aced4[_0x06e9('0x28')]({'plain':!![]});var _0x58f4be=_0x06e9('0x29');return db[_0x06e9('0x2a')][_0x06e9('0x26')]({'where':{'type':_0x58f4be,'resourceId':_0x13f5ce['id']}})[_0x06e9('0x27')](function(){return _0x4aced4;});})['then'](function(){_0x3a6936[_0x06e9('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0xdaf290,_0x426a29){return function(_0x1f685){if(!_0x1f685){_0xdaf290[_0x06e9('0x1a')](0x194);}return _0x1f685;};}function handleError(_0x5b9317,_0x3c3f39){_0x3c3f39=_0x3c3f39||0x1f4;return function(_0x13a981){logger['error'](_0x13a981[_0x06e9('0x2b')]);if(_0x13a981['name']){delete _0x13a981[_0x06e9('0x2c')];}_0x5b9317[_0x06e9('0x1c')](_0x3c3f39)[_0x06e9('0x2d')](_0x13a981);};}exports[_0x06e9('0x2e')]=function(_0x4d1b10,_0x490377){var _0x355858={},_0x574bbf={},_0x346296={'count':0x0,'rows':[]};var _0x5936e8=_[_0x06e9('0x2f')](db['Campaign'][_0x06e9('0x30')],function(_0x544f2c){return{'name':_0x544f2c[_0x06e9('0x31')],'type':_0x544f2c['type'][_0x06e9('0x32')]};});_0x574bbf[_0x06e9('0x33')]=_[_0x06e9('0x2f')](_0x5936e8,_0x06e9('0x2c'));_0x574bbf['query']=_[_0x06e9('0x34')](_0x4d1b10[_0x06e9('0x35')]);_0x574bbf['filters']=_[_0x06e9('0x36')](_0x574bbf[_0x06e9('0x33')],_0x574bbf[_0x06e9('0x35')]);_0x355858['attributes']=_[_0x06e9('0x36')](_0x574bbf['model'],qs[_0x06e9('0x37')](_0x4d1b10['query'][_0x06e9('0x37')]));_0x355858[_0x06e9('0x38')]=_0x355858[_0x06e9('0x38')][_0x06e9('0x39')]?_0x355858['attributes']:_0x574bbf['model'];if(!_0x4d1b10[_0x06e9('0x35')][_0x06e9('0x3a')]('nolimit')){_0x355858[_0x06e9('0x21')]=qs[_0x06e9('0x21')](_0x4d1b10['query'][_0x06e9('0x21')]);_0x355858[_0x06e9('0x1e')]=qs['offset'](_0x4d1b10['query']['offset']);}_0x355858['order']=qs[_0x06e9('0x3b')](_0x4d1b10[_0x06e9('0x35')][_0x06e9('0x3b')]);_0x355858['where']=qs[_0x06e9('0x3c')](_[_0x06e9('0x3d')](_0x4d1b10['query'],_0x574bbf[_0x06e9('0x3c')]),_0x5936e8);if(_0x4d1b10['query'][_0x06e9('0x3e')]){_0x355858[_0x06e9('0x3f')]=_[_0x06e9('0x40')](_0x355858[_0x06e9('0x3f')],{'$or':_[_0x06e9('0x2f')](_0x5936e8,function(_0x4e1085){if(_0x4e1085[_0x06e9('0x41')]!==_0x06e9('0x42')){var _0x21cfdf={};_0x21cfdf[_0x4e1085['name']]={'$like':'%'+_0x4d1b10['query'][_0x06e9('0x3e')]+'%'};return _0x21cfdf;}})});}_0x355858=_[_0x06e9('0x40')]({},_0x355858,_0x4d1b10['options']);var _0x27f304={'where':_0x355858[_0x06e9('0x3f')]};return db[_0x06e9('0x43')][_0x06e9('0x20')](_0x27f304)['then'](function(_0x1b5b10){_0x346296[_0x06e9('0x20')]=_0x1b5b10;if(_0x4d1b10[_0x06e9('0x35')][_0x06e9('0x44')]){_0x355858['include']=[{'all':!![]}];}return db[_0x06e9('0x43')][_0x06e9('0x45')](_0x355858);})[_0x06e9('0x27')](function(_0x42bdbf){_0x346296[_0x06e9('0x46')]=_0x42bdbf;return _0x346296;})[_0x06e9('0x27')](respondWithFilteredResult(_0x490377,_0x355858))[_0x06e9('0x47')](handleError(_0x490377,null));};exports[_0x06e9('0x48')]=function(_0x59dd17,_0x6b41dd){var _0x178b0f={'raw':![],'where':{'id':_0x59dd17[_0x06e9('0x49')]['id']}},_0x43e06b={};_0x43e06b['model']=_[_0x06e9('0x34')](db[_0x06e9('0x43')][_0x06e9('0x30')]);_0x43e06b[_0x06e9('0x35')]=_[_0x06e9('0x34')](_0x59dd17['query']);_0x43e06b['filters']=_[_0x06e9('0x36')](_0x43e06b['model'],_0x43e06b[_0x06e9('0x35')]);_0x178b0f[_0x06e9('0x38')]=_[_0x06e9('0x36')](_0x43e06b[_0x06e9('0x33')],qs['fields'](_0x59dd17[_0x06e9('0x35')][_0x06e9('0x37')]));_0x178b0f['attributes']=_0x178b0f['attributes'][_0x06e9('0x39')]?_0x178b0f[_0x06e9('0x38')]:_0x43e06b[_0x06e9('0x33')];if(_0x59dd17[_0x06e9('0x35')][_0x06e9('0x44')]){_0x178b0f[_0x06e9('0x4a')]=[{'all':!![]}];}_0x178b0f=_[_0x06e9('0x40')]({},_0x178b0f,_0x59dd17[_0x06e9('0x4b')]);return db[_0x06e9('0x43')]['find'](_0x178b0f)[_0x06e9('0x27')](handleEntityNotFound(_0x6b41dd,null))['then'](respondWithResult(_0x6b41dd,null))[_0x06e9('0x47')](handleError(_0x6b41dd,null));};exports['create']=function(_0x587609,_0x33bfc5){return db[_0x06e9('0x43')]['create'](_0x587609[_0x06e9('0x4c')],{})['then'](function(_0x59a4bc){var _0x17ef2c=_0x587609['user'][_0x06e9('0x28')]({'plain':!![]});if(!_0x17ef2c)throw new Error(_0x06e9('0x4d'));if(_0x17ef2c[_0x06e9('0x4e')]===_0x06e9('0x4f')){var _0x50af90=_0x59a4bc[_0x06e9('0x28')]({'plain':!![]});var _0x2a39a5=_0x06e9('0x29');return db[_0x06e9('0x50')][_0x06e9('0x51')]({'where':{'name':_0x2a39a5,'userProfileId':_0x17ef2c[_0x06e9('0x52')]},'raw':!![]})['then'](function(_0xd05d6c){if(_0xd05d6c&&_0xd05d6c[_0x06e9('0x53')]===0x0){return db[_0x06e9('0x2a')]['create']({'name':_0x50af90[_0x06e9('0x2c')],'resourceId':_0x50af90['id'],'type':_0xd05d6c[_0x06e9('0x2c')],'sectionId':_0xd05d6c['id']},{})[_0x06e9('0x27')](function(){return _0x59a4bc;});}else{return _0x59a4bc;}})[_0x06e9('0x47')](function(_0x90ae69){logger['error'](_0x06e9('0x54'),_0x90ae69);throw _0x90ae69;});}return _0x59a4bc;})['then'](respondWithResult(_0x33bfc5,0xc9))[_0x06e9('0x47')](handleError(_0x33bfc5,null));};exports[_0x06e9('0x55')]=function(_0x49f60d,_0x56ef80){var _0x587b6a={'where':{'id':_0x49f60d[_0x06e9('0x49')]['id']}},_0xb73d5c={};_0xb73d5c['model']=_[_0x06e9('0x34')](db[_0x06e9('0x43')]['rawAttributes']);_0x587b6a['attributes']=_[_0x06e9('0x36')](_0xb73d5c[_0x06e9('0x33')],qs['fields'](_0x49f60d[_0x06e9('0x35')]['fields']));_0x587b6a['attributes']=_0x587b6a['attributes']['length']?_0x587b6a['attributes']:_0xb73d5c['model'];if(_0x49f60d[_0x06e9('0x35')][_0x06e9('0x44')]){_0x587b6a[_0x06e9('0x4a')]=[{'all':!![]}];}_0x587b6a=_[_0x06e9('0x40')]({},_0x587b6a,_0x49f60d[_0x06e9('0x4b')]);return db[_0x06e9('0x43')][_0x06e9('0x51')](_0x587b6a)[_0x06e9('0x27')](handleEntityNotFound(_0x56ef80,null))[_0x06e9('0x27')](function(_0x513c39){if(_0x513c39){var _0x1d25bd=_0x513c39[_0x06e9('0x28')]({'plain':!![]});_0x1d25bd=qs['omit'](_0x1d25bd,['id',_0x06e9('0x56'),_0x06e9('0x57')]);_0x49f60d[_0x06e9('0x4c')]=_[_0x06e9('0x58')](_0x49f60d['body'],['id',_0x06e9('0x56'),'updatedAt']);return db[_0x06e9('0x43')][_0x06e9('0x59')](_[_0x06e9('0x40')](_0x1d25bd,_0x49f60d[_0x06e9('0x4c')]),{'include':_0x49f60d[_0x06e9('0x35')][_0x06e9('0x44')]?[{'all':!![]}]:undefined})['then'](function(_0x1d29e7){var _0x944bb3=_0x49f60d[_0x06e9('0x4f')]['get']({'plain':!![]});if(!_0x944bb3)throw new Error(_0x06e9('0x4d'));if(_0x944bb3[_0x06e9('0x4e')]==='user'){var _0x482c83=_0x1d29e7[_0x06e9('0x28')]({'plain':!![]});var _0x2a2605='IvrCampaigns';return db[_0x06e9('0x50')][_0x06e9('0x51')]({'where':{'name':_0x2a2605,'userProfileId':_0x944bb3[_0x06e9('0x52')]},'raw':!![]})['then'](function(_0x11ffe5){if(_0x11ffe5&&_0x11ffe5[_0x06e9('0x53')]===0x0){return db[_0x06e9('0x2a')][_0x06e9('0x59')]({'name':_0x482c83[_0x06e9('0x2c')],'resourceId':_0x482c83['id'],'type':_0x11ffe5[_0x06e9('0x2c')],'sectionId':_0x11ffe5['id']},{})[_0x06e9('0x27')](function(){return _0x1d29e7;});}else{return _0x1d29e7;}})[_0x06e9('0x47')](function(_0x5414d4){logger[_0x06e9('0x5a')](_0x06e9('0x54'),_0x5414d4);throw _0x5414d4;});}return _0x1d29e7;});}})['then'](respondWithResult(_0x56ef80,0xc9))['catch'](handleError(_0x56ef80,null));};exports[_0x06e9('0x5b')]=function(_0x26ac58,_0x45bf8a){if(_0x26ac58[_0x06e9('0x4c')]['id']){delete _0x26ac58[_0x06e9('0x4c')]['id'];}return db[_0x06e9('0x43')][_0x06e9('0x51')]({'where':{'id':_0x26ac58[_0x06e9('0x49')]['id']}})[_0x06e9('0x27')](handleEntityNotFound(_0x45bf8a,null))['then'](saveUpdates(_0x26ac58[_0x06e9('0x4c')],null))[_0x06e9('0x27')](respondWithResult(_0x45bf8a,null))[_0x06e9('0x47')](handleError(_0x45bf8a,null));};exports[_0x06e9('0x26')]=function(_0x14b897,_0xca7886){return db[_0x06e9('0x43')][_0x06e9('0x51')]({'where':{'id':_0x14b897[_0x06e9('0x49')]['id']}})[_0x06e9('0x27')](handleEntityNotFound(_0xca7886,null))[_0x06e9('0x27')](removeEntity(_0xca7886,null))[_0x06e9('0x47')](handleError(_0xca7886,null));};exports[_0x06e9('0x5c')]=function(_0x2d5d36,_0x3afdff,_0x16a3df){var _0x463268={'raw':!![],'where':{}};var _0x2f319b={};var _0x3635ed={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x2d5d36[_0x06e9('0x49')]['id']}})['then'](handleEntityNotFound(_0x3afdff,null))[_0x06e9('0x27')](function(_0x396a2d){if(_0x396a2d){_0x2f319b[_0x06e9('0x33')]=_[_0x06e9('0x34')](db[_0x06e9('0x5d')][_0x06e9('0x30')]);_0x2f319b['query']=_[_0x06e9('0x34')](_0x2d5d36[_0x06e9('0x35')]);_0x2f319b[_0x06e9('0x3c')]=_['intersection'](_0x2f319b[_0x06e9('0x33')],_0x2f319b['query']);_0x463268['attributes']=_[_0x06e9('0x36')](_0x2f319b['model'],qs[_0x06e9('0x37')](_0x2d5d36[_0x06e9('0x35')]['fields']));_0x463268[_0x06e9('0x38')]=_0x463268[_0x06e9('0x38')][_0x06e9('0x39')]?_0x463268[_0x06e9('0x38')]:_0x2f319b[_0x06e9('0x33')];if(!_0x2d5d36[_0x06e9('0x35')]['hasOwnProperty'](_0x06e9('0x5e'))){_0x463268[_0x06e9('0x21')]=qs['limit'](_0x2d5d36[_0x06e9('0x35')][_0x06e9('0x21')]);_0x463268[_0x06e9('0x1e')]=qs[_0x06e9('0x1e')](_0x2d5d36[_0x06e9('0x35')]['offset']);}_0x463268['order']=qs['sort'](_0x2d5d36[_0x06e9('0x35')][_0x06e9('0x3b')]);_0x463268[_0x06e9('0x3f')]=qs[_0x06e9('0x3c')](_[_0x06e9('0x3d')](_0x2d5d36[_0x06e9('0x35')],_0x2f319b['filters']));_0x463268[_0x06e9('0x3f')][_0x06e9('0x5f')]=_0x396a2d['id'];if(_0x2d5d36['query'][_0x06e9('0x3e')]){_0x463268['where']=_[_0x06e9('0x40')](_0x463268['where'],{'$or':_[_0x06e9('0x2f')](_0x463268['attributes'],function(_0x307a93){var _0x130746={};_0x130746[_0x307a93]={'$like':'%'+_0x2d5d36[_0x06e9('0x35')]['filter']+'%'};return _0x130746;})});}_0x463268=_[_0x06e9('0x40')]({},_0x463268,_0x2d5d36[_0x06e9('0x4b')]);return db[_0x06e9('0x5d')][_0x06e9('0x20')]({'where':_0x463268['where']})[_0x06e9('0x27')](function(_0x35d8af){_0x3635ed['count']=_0x35d8af;if(_0x2d5d36[_0x06e9('0x35')][_0x06e9('0x44')]){_0x463268[_0x06e9('0x4a')]=[{'all':!![]}];}return db['CmHopper'][_0x06e9('0x45')](_0x463268);})['then'](function(_0x10b752){_0x3635ed[_0x06e9('0x46')]=_0x10b752;return _0x3635ed;});}})[_0x06e9('0x27')](respondWithFilteredResult(_0x3afdff,_0x463268))[_0x06e9('0x47')](handleError(_0x3afdff,null));};exports[_0x06e9('0x60')]=function(_0x34b35f,_0x233cba,_0x2aaff5){var _0x56383e={'raw':!![],'where':{}};var _0x15d5f0={};var _0x3c677f={'count':0x0,'rows':[]};return db[_0x06e9('0x43')][_0x06e9('0x61')]({'where':{'id':_0x34b35f[_0x06e9('0x49')]['id']}})[_0x06e9('0x27')](handleEntityNotFound(_0x233cba,null))[_0x06e9('0x27')](function(_0x191756){if(_0x191756){_0x15d5f0[_0x06e9('0x33')]=_[_0x06e9('0x34')](db[_0x06e9('0x62')][_0x06e9('0x30')]);_0x15d5f0[_0x06e9('0x35')]=_[_0x06e9('0x34')](_0x34b35f['query']);_0x15d5f0['filters']=_[_0x06e9('0x36')](_0x15d5f0['model'],_0x15d5f0[_0x06e9('0x35')]);_0x56383e[_0x06e9('0x38')]=_['intersection'](_0x15d5f0['model'],qs[_0x06e9('0x37')](_0x34b35f[_0x06e9('0x35')]['fields']));_0x56383e[_0x06e9('0x38')]=_0x56383e[_0x06e9('0x38')]['length']?_0x56383e['attributes']:_0x15d5f0[_0x06e9('0x33')];if(!_0x34b35f[_0x06e9('0x35')]['hasOwnProperty'](_0x06e9('0x5e'))){_0x56383e[_0x06e9('0x21')]=qs[_0x06e9('0x21')](_0x34b35f[_0x06e9('0x35')][_0x06e9('0x21')]);_0x56383e[_0x06e9('0x1e')]=qs['offset'](_0x34b35f[_0x06e9('0x35')][_0x06e9('0x1e')]);}_0x56383e[_0x06e9('0x63')]=qs[_0x06e9('0x3b')](_0x34b35f[_0x06e9('0x35')]['sort']);_0x56383e[_0x06e9('0x3f')]=qs['filters'](_['pick'](_0x34b35f['query'],_0x15d5f0[_0x06e9('0x3c')]));_0x56383e['where'][_0x06e9('0x5f')]=_0x191756['id'];if(_0x34b35f[_0x06e9('0x35')]['filter']){_0x56383e[_0x06e9('0x3f')]=_['merge'](_0x56383e[_0x06e9('0x3f')],{'$or':_[_0x06e9('0x2f')](_0x56383e[_0x06e9('0x38')],function(_0x277733){var _0x245075={};_0x245075[_0x277733]={'$like':'%'+_0x34b35f[_0x06e9('0x35')]['filter']+'%'};return _0x245075;})});}_0x56383e=_[_0x06e9('0x40')]({},_0x56383e,_0x34b35f[_0x06e9('0x4b')]);return db[_0x06e9('0x62')][_0x06e9('0x20')]({'where':_0x56383e[_0x06e9('0x3f')]})['then'](function(_0x3630e5){_0x3c677f['count']=_0x3630e5;if(_0x34b35f[_0x06e9('0x35')][_0x06e9('0x44')]){_0x56383e[_0x06e9('0x4a')]=[{'all':!![]}];}return db[_0x06e9('0x62')][_0x06e9('0x45')](_0x56383e);})['then'](function(_0x1b44b3){_0x3c677f[_0x06e9('0x46')]=_0x1b44b3;return _0x3c677f;});}})[_0x06e9('0x27')](respondWithFilteredResult(_0x233cba,_0x56383e))['catch'](handleError(_0x233cba,null));};exports['getHopperFinals']=function(_0x3b253,_0x5a8dd0,_0x389b5a){var _0x35ab45={'raw':!![],'where':{}};var _0x267180={};var _0xbbd819={'count':0x0,'rows':[]};return db[_0x06e9('0x43')][_0x06e9('0x61')]({'where':{'id':_0x3b253[_0x06e9('0x49')]['id']}})[_0x06e9('0x27')](handleEntityNotFound(_0x5a8dd0,null))[_0x06e9('0x27')](function(_0x5960c4){if(_0x5960c4){_0x267180['model']=_['keys'](db[_0x06e9('0x64')]['rawAttributes']);_0x267180[_0x06e9('0x35')]=_[_0x06e9('0x34')](_0x3b253[_0x06e9('0x35')]);_0x267180[_0x06e9('0x3c')]=_[_0x06e9('0x36')](_0x267180['model'],_0x267180[_0x06e9('0x35')]);_0x35ab45[_0x06e9('0x38')]=_[_0x06e9('0x36')](_0x267180[_0x06e9('0x33')],qs[_0x06e9('0x37')](_0x3b253['query'][_0x06e9('0x37')]));_0x35ab45[_0x06e9('0x38')]=_0x35ab45[_0x06e9('0x38')][_0x06e9('0x39')]?_0x35ab45[_0x06e9('0x38')]:_0x267180[_0x06e9('0x33')];if(!_0x3b253[_0x06e9('0x35')]['hasOwnProperty'](_0x06e9('0x5e'))){_0x35ab45[_0x06e9('0x21')]=qs[_0x06e9('0x21')](_0x3b253[_0x06e9('0x35')][_0x06e9('0x21')]);_0x35ab45['offset']=qs['offset'](_0x3b253[_0x06e9('0x35')][_0x06e9('0x1e')]);}_0x35ab45[_0x06e9('0x63')]=qs[_0x06e9('0x3b')](_0x3b253['query'][_0x06e9('0x3b')]);_0x35ab45['where']=qs[_0x06e9('0x3c')](_[_0x06e9('0x3d')](_0x3b253[_0x06e9('0x35')],_0x267180[_0x06e9('0x3c')]));_0x35ab45[_0x06e9('0x3f')][_0x06e9('0x5f')]=_0x5960c4['id'];if(_0x3b253['query']['filter']){_0x35ab45[_0x06e9('0x3f')]=_['merge'](_0x35ab45[_0x06e9('0x3f')],{'$or':_['map'](_0x35ab45[_0x06e9('0x38')],function(_0x2cbac4){var _0x2fbe15={};_0x2fbe15[_0x2cbac4]={'$like':'%'+_0x3b253[_0x06e9('0x35')]['filter']+'%'};return _0x2fbe15;})});}_0x35ab45=_[_0x06e9('0x40')]({},_0x35ab45,_0x3b253[_0x06e9('0x4b')]);return db[_0x06e9('0x64')][_0x06e9('0x20')]({'where':_0x35ab45[_0x06e9('0x3f')]})[_0x06e9('0x27')](function(_0x480877){_0xbbd819[_0x06e9('0x20')]=_0x480877;if(_0x3b253[_0x06e9('0x35')][_0x06e9('0x44')]){_0x35ab45[_0x06e9('0x4a')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x06e9('0x45')](_0x35ab45);})[_0x06e9('0x27')](function(_0x2d3ec6){_0xbbd819[_0x06e9('0x46')]=_0x2d3ec6;return _0xbbd819;});}})['then'](respondWithFilteredResult(_0x5a8dd0,_0x35ab45))[_0x06e9('0x47')](handleError(_0x5a8dd0,null));};exports[_0x06e9('0x65')]=function(_0x30adef,_0x4b545e,_0x175b9d){var _0x12a326={'raw':!![],'where':{}};var _0xc0eb3f={};var _0x4feadb={'count':0x0,'rows':[]};return db[_0x06e9('0x43')]['findOne']({'where':{'id':_0x30adef[_0x06e9('0x49')]['id']}})['then'](handleEntityNotFound(_0x4b545e,null))['then'](function(_0x2d86e0){if(_0x2d86e0){_0xc0eb3f['model']=_[_0x06e9('0x34')](db[_0x06e9('0x66')][_0x06e9('0x30')]);_0xc0eb3f['query']=_[_0x06e9('0x34')](_0x30adef['query']);_0xc0eb3f[_0x06e9('0x3c')]=_[_0x06e9('0x36')](_0xc0eb3f[_0x06e9('0x33')],_0xc0eb3f[_0x06e9('0x35')]);_0x12a326[_0x06e9('0x38')]=_[_0x06e9('0x36')](_0xc0eb3f[_0x06e9('0x33')],qs[_0x06e9('0x37')](_0x30adef['query'][_0x06e9('0x37')]));_0x12a326['attributes']=_0x12a326[_0x06e9('0x38')]['length']?_0x12a326[_0x06e9('0x38')]:_0xc0eb3f[_0x06e9('0x33')];if(!_0x30adef[_0x06e9('0x35')][_0x06e9('0x3a')](_0x06e9('0x5e'))){_0x12a326['limit']=qs[_0x06e9('0x21')](_0x30adef[_0x06e9('0x35')][_0x06e9('0x21')]);_0x12a326[_0x06e9('0x1e')]=qs[_0x06e9('0x1e')](_0x30adef[_0x06e9('0x35')]['offset']);}_0x12a326[_0x06e9('0x63')]=qs[_0x06e9('0x3b')](_0x30adef[_0x06e9('0x35')][_0x06e9('0x3b')]);_0x12a326[_0x06e9('0x3f')]=qs[_0x06e9('0x3c')](_[_0x06e9('0x3d')](_0x30adef[_0x06e9('0x35')],_0xc0eb3f[_0x06e9('0x3c')]));_0x12a326[_0x06e9('0x3f')][_0x06e9('0x5f')]=_0x2d86e0['id'];if(_0x30adef['query'][_0x06e9('0x3e')]){_0x12a326['where']=_['merge'](_0x12a326['where'],{'$or':_[_0x06e9('0x2f')](_0x12a326['attributes'],function(_0x1d2e0c){var _0x469519={};_0x469519[_0x1d2e0c]={'$like':'%'+_0x30adef['query'][_0x06e9('0x3e')]+'%'};return _0x469519;})});}_0x12a326=_[_0x06e9('0x40')]({},_0x12a326,_0x30adef['options']);return db[_0x06e9('0x66')][_0x06e9('0x20')]({'where':_0x12a326['where']})['then'](function(_0x286d66){_0x4feadb['count']=_0x286d66;if(_0x30adef['query'][_0x06e9('0x44')]){_0x12a326['include']=[{'all':!![]}];}return db[_0x06e9('0x66')][_0x06e9('0x45')](_0x12a326);})[_0x06e9('0x27')](function(_0x309da2){_0x4feadb['rows']=_0x309da2;return _0x4feadb;});}})['then'](respondWithFilteredResult(_0x4b545e,_0x12a326))[_0x06e9('0x47')](handleError(_0x4b545e,null));};exports[_0x06e9('0x67')]=function(_0x476a0b,_0x9038c5,_0xfb1b08){var _0x1f3b06={};var _0x27ace2={};var _0x18152f;var _0x42bff2;return db['Campaign']['findOne']({'where':{'id':_0x476a0b[_0x06e9('0x49')]['id']}})[_0x06e9('0x27')](handleEntityNotFound(_0x9038c5,null))[_0x06e9('0x27')](function(_0x38dff2){if(_0x38dff2){_0x18152f=_0x38dff2;_0x27ace2[_0x06e9('0x33')]=_['keys'](db[_0x06e9('0x68')]['rawAttributes']);_0x27ace2[_0x06e9('0x35')]=_[_0x06e9('0x34')](_0x476a0b[_0x06e9('0x35')]);_0x27ace2[_0x06e9('0x3c')]=_[_0x06e9('0x36')](_0x27ace2[_0x06e9('0x33')],_0x27ace2[_0x06e9('0x35')]);_0x1f3b06[_0x06e9('0x38')]=_[_0x06e9('0x36')](_0x27ace2[_0x06e9('0x33')],qs[_0x06e9('0x37')](_0x476a0b[_0x06e9('0x35')][_0x06e9('0x37')]));_0x1f3b06[_0x06e9('0x38')]=_0x1f3b06[_0x06e9('0x38')][_0x06e9('0x39')]?_0x1f3b06[_0x06e9('0x38')]:_0x27ace2['model'];_0x1f3b06[_0x06e9('0x63')]=qs[_0x06e9('0x3b')](_0x476a0b[_0x06e9('0x35')]['sort']);_0x1f3b06['where']=qs[_0x06e9('0x3c')](_[_0x06e9('0x3d')](_0x476a0b[_0x06e9('0x35')],_0x27ace2[_0x06e9('0x3c')]));if(_0x476a0b[_0x06e9('0x35')][_0x06e9('0x3e')]){_0x1f3b06[_0x06e9('0x3f')]=_[_0x06e9('0x40')](_0x1f3b06[_0x06e9('0x3f')],{'$or':_[_0x06e9('0x2f')](_0x1f3b06[_0x06e9('0x38')],function(_0x406b90){var _0x5bcedf={};_0x5bcedf[_0x406b90]={'$like':'%'+_0x476a0b[_0x06e9('0x35')]['filter']+'%'};return _0x5bcedf;})});}_0x1f3b06=_[_0x06e9('0x40')]({},_0x1f3b06,_0x476a0b[_0x06e9('0x4b')]);return _0x18152f[_0x06e9('0x67')](_0x1f3b06);}})[_0x06e9('0x27')](function(_0x302dbf){if(_0x302dbf){_0x42bff2=_0x302dbf['length'];if(!_0x476a0b[_0x06e9('0x35')]['hasOwnProperty'](_0x06e9('0x5e'))){_0x1f3b06[_0x06e9('0x21')]=qs['limit'](_0x476a0b[_0x06e9('0x35')][_0x06e9('0x21')]);_0x1f3b06[_0x06e9('0x1e')]=qs['offset'](_0x476a0b[_0x06e9('0x35')][_0x06e9('0x1e')]);}return _0x18152f[_0x06e9('0x67')](_0x1f3b06);}})[_0x06e9('0x27')](function(_0x572378){if(_0x572378){return _0x572378?{'count':_0x42bff2,'rows':_0x572378}:null;}})[_0x06e9('0x27')](respondWithResult(_0x9038c5,null))['catch'](handleError(_0x9038c5,null));};exports[_0x06e9('0x69')]=function(_0x4b98c6,_0x395c93,_0x3e05fb){var _0x3652c6,_0x44776b;var _0x41877c=[];var _0x150c1b=moment()[_0x06e9('0x6a')](_0x06e9('0x6b'));return db['Campaign'][_0x06e9('0x51')]({'where':{'id':_0x4b98c6[_0x06e9('0x49')]['id']}})['then'](handleEntityNotFound(_0x395c93,null))[_0x06e9('0x27')](function(_0x28a8d4){if(_0x28a8d4){_0x44776b=_0x28a8d4;return _0x28a8d4['addLists'](_0x4b98c6[_0x06e9('0x4c')][_0x06e9('0x6c')],_[_0x06e9('0x58')](_0x4b98c6[_0x06e9('0x4c')],[_0x06e9('0x6c'),'id'])||{});}return null;})['spread'](function(_0x23bd8e){var _0x498413;var _0x2682b2;_0x3652c6=_0x23bd8e||[];var _0x3941a8=[];if(_0x23bd8e){for(var _0x596e3d=0x0;_0x596e3d<_0x23bd8e[_0x06e9('0x39')];_0x596e3d+=0x1){var _0x5c0a96=_0x23bd8e[_0x596e3d]['get']({'plain':!![]});_0x44776b['dialCheckDuplicateType']=_0x4b98c6[_0x06e9('0x4c')][_0x06e9('0x6d')]?_0x4b98c6['body'][_0x06e9('0x6d')]:_0x44776b[_0x06e9('0x6d')];switch(_0x44776b['dialCheckDuplicateType']){case _0x06e9('0x6e'):_0x498413=squel[_0x06e9('0x6f')]()[_0x06e9('0x70')](_0x06e9('0x71'))[_0x06e9('0x72')]([_0x06e9('0x73'),_0x06e9('0x74'),'ContactId',_0x06e9('0x75'),_0x06e9('0x5f'),_0x06e9('0x56'),'updatedAt'],squel['select']()['field']('phone','phone')[_0x06e9('0x76')]('NOW()',_0x06e9('0x74'))[_0x06e9('0x76')]('id','ContactId')[_0x06e9('0x76')](_0x5c0a96['CmListId'][_0x06e9('0x77')](),_0x06e9('0x75'))[_0x06e9('0x76')](_0x4b98c6['params']['id']['toString'](),_0x06e9('0x5f'))[_0x06e9('0x76')]('\x27'+_0x150c1b+'\x27',_0x06e9('0x56'))[_0x06e9('0x76')]('\x27'+_0x150c1b+'\x27',_0x06e9('0x57'))[_0x06e9('0x78')](_0x06e9('0x79'))['where'](_0x06e9('0x7a'))[_0x06e9('0x3f')]('ListId\x20=\x20?',_0x5c0a96[_0x06e9('0x7b')][_0x06e9('0x77')]())[_0x06e9('0x3f')](_0x06e9('0x7c'))[_0x06e9('0x3f')](_0x06e9('0x7d'),squel[_0x06e9('0x7e')]()[_0x06e9('0x76')](_0x06e9('0x7f'))[_0x06e9('0x78')]('cm_hopper_final')[_0x06e9('0x3f')](_0x06e9('0x80'),_0x4b98c6[_0x06e9('0x49')]['id'][_0x06e9('0x77')]()))[_0x06e9('0x3f')](_0x06e9('0x7d'),squel[_0x06e9('0x7e')]()[_0x06e9('0x76')]('COALESCE(phone,\x27\x27)')[_0x06e9('0x78')](_0x06e9('0x71'))['where'](_0x06e9('0x80'),_0x4b98c6[_0x06e9('0x49')]['id'][_0x06e9('0x77')]())))[_0x06e9('0x77')]();break;case _0x06e9('0x81'):_0x498413=squel['insert']()[_0x06e9('0x70')](_0x06e9('0x71'))[_0x06e9('0x72')]([_0x06e9('0x73'),_0x06e9('0x74'),_0x06e9('0x82'),_0x06e9('0x75'),'CampaignId',_0x06e9('0x56'),_0x06e9('0x57')],squel[_0x06e9('0x7e')]()[_0x06e9('0x76')]('phone',_0x06e9('0x73'))[_0x06e9('0x76')]('NOW()',_0x06e9('0x74'))[_0x06e9('0x76')]('id','ContactId')[_0x06e9('0x76')](_0x5c0a96[_0x06e9('0x7b')][_0x06e9('0x77')](),_0x06e9('0x75'))['field'](_0x4b98c6[_0x06e9('0x49')]['id']['toString'](),'CampaignId')[_0x06e9('0x76')]('\x27'+_0x150c1b+'\x27','createdAt')[_0x06e9('0x76')]('\x27'+_0x150c1b+'\x27','updatedAt')[_0x06e9('0x78')](_0x06e9('0x79'))['where'](_0x06e9('0x7a'))[_0x06e9('0x3f')]('ListId\x20=\x20?',_0x5c0a96['CmListId'][_0x06e9('0x77')]())[_0x06e9('0x3f')](_0x06e9('0x7c'))[_0x06e9('0x3f')](_0x06e9('0x7d'),squel[_0x06e9('0x7e')]()[_0x06e9('0x76')](_0x06e9('0x83'))['from']('cm_hopper')[_0x06e9('0x3f')](_0x06e9('0x80'),_0x4b98c6[_0x06e9('0x49')]['id'][_0x06e9('0x77')]())))[_0x06e9('0x77')]();break;default:_0x498413=squel['insert']()[_0x06e9('0x70')](_0x06e9('0x71'))[_0x06e9('0x72')]([_0x06e9('0x73'),'scheduledAt','ContactId','ListId',_0x06e9('0x5f'),_0x06e9('0x56'),_0x06e9('0x57')],squel[_0x06e9('0x7e')]()[_0x06e9('0x76')](_0x06e9('0x73'),_0x06e9('0x73'))['field'](_0x06e9('0x84'),_0x06e9('0x74'))[_0x06e9('0x76')]('id',_0x06e9('0x82'))[_0x06e9('0x76')](_0x5c0a96['CmListId'][_0x06e9('0x77')](),_0x06e9('0x75'))[_0x06e9('0x76')](_0x4b98c6[_0x06e9('0x49')]['id'][_0x06e9('0x77')](),_0x06e9('0x5f'))['field']('\x27'+_0x150c1b+'\x27','createdAt')[_0x06e9('0x76')]('\x27'+_0x150c1b+'\x27',_0x06e9('0x57'))[_0x06e9('0x78')](_0x06e9('0x79'))[_0x06e9('0x3f')](_0x06e9('0x7a'))[_0x06e9('0x3f')](_0x06e9('0x85'),_0x5c0a96[_0x06e9('0x7b')]['toString']())[_0x06e9('0x3f')](_0x06e9('0x7c')))[_0x06e9('0x77')]();}_0x2682b2=squel[_0x06e9('0x6f')]()[_0x06e9('0x70')](_0x06e9('0x86'))[_0x06e9('0x72')]([_0x06e9('0x87'),_0x06e9('0x74'),_0x06e9('0x73'),'OrderBy','createdAt',_0x06e9('0x57')],squel['select']()[_0x06e9('0x76')](_0x06e9('0x88'),'id')[_0x06e9('0x76')]('NOW()',_0x06e9('0x74'))[_0x06e9('0x76')](_0x06e9('0x89'),_0x06e9('0x73'))[_0x06e9('0x76')](_0x06e9('0x8a'),'OrderBy')[_0x06e9('0x76')]('\x27'+_0x150c1b+'\x27','createdAt')['field']('\x27'+_0x150c1b+'\x27','updatedAt')[_0x06e9('0x78')](_0x06e9('0x8b'),'ci')['join'](_0x06e9('0x71'),'h','h.ContactId\x20=\x20ci.CmContactId')[_0x06e9('0x3f')](_0x06e9('0x8c'),_0x5c0a96[_0x06e9('0x7b')][_0x06e9('0x77')]())['where'](_0x06e9('0x8d'),_0x4b98c6['params']['id'][_0x06e9('0x77')]())['where'](_0x06e9('0x8e'),_0x150c1b))[_0x06e9('0x77')]();_0x3941a8['push'](db[_0x06e9('0x8f')][_0x06e9('0x35')](_0x498413));_0x41877c['push'](db[_0x06e9('0x8f')][_0x06e9('0x35')](_0x2682b2));}return BPromise[_0x06e9('0x90')](_0x3941a8);}})['then'](function(){return BPromise[_0x06e9('0x90')](_0x41877c);})['then'](function(){return _0x3652c6;})[_0x06e9('0x27')](respondWithResult(_0x395c93,null))[_0x06e9('0x47')](handleError(_0x395c93,null));};exports['removeLists']=function(_0x4045a1,_0x1f9b56,_0x5f0176){return db[_0x06e9('0x43')][_0x06e9('0x51')]({'where':{'id':_0x4045a1[_0x06e9('0x49')]['id']}})[_0x06e9('0x27')](handleEntityNotFound(_0x1f9b56,null))[_0x06e9('0x27')](function(_0x548fe3){if(_0x548fe3){return _0x548fe3[_0x06e9('0x91')](_0x4045a1[_0x06e9('0x35')][_0x06e9('0x6c')]);}})[_0x06e9('0x27')](function(_0x8b14f2){if(_0x8b14f2){return db['CmHopper']['destroy']({'where':{'ListId':_0x4045a1[_0x06e9('0x35')][_0x06e9('0x6c')],'CampaignId':_0x4045a1[_0x06e9('0x49')]['id']}})['then'](function(){return _0x8b14f2;});}})[_0x06e9('0x27')](respondWithStatusCode(_0x1f9b56,null))['catch'](handleError(_0x1f9b56,null));};exports[_0x06e9('0x92')]=function(_0x1b578b,_0x4a6cad,_0x5a7e90){var _0x362b88={};var _0x212685={};var _0x66b793;var _0x502530;return db[_0x06e9('0x43')][_0x06e9('0x61')]({'where':{'id':_0x1b578b[_0x06e9('0x49')]['id']}})[_0x06e9('0x27')](handleEntityNotFound(_0x4a6cad,null))[_0x06e9('0x27')](function(_0x455a65){if(_0x455a65){_0x66b793=_0x455a65;_0x212685[_0x06e9('0x33')]=_[_0x06e9('0x34')](db['CmList']['rawAttributes']);_0x212685[_0x06e9('0x35')]=_[_0x06e9('0x34')](_0x1b578b['query']);_0x212685[_0x06e9('0x3c')]=_['intersection'](_0x212685[_0x06e9('0x33')],_0x212685[_0x06e9('0x35')]);_0x362b88[_0x06e9('0x38')]=_['intersection'](_0x212685[_0x06e9('0x33')],qs[_0x06e9('0x37')](_0x1b578b[_0x06e9('0x35')][_0x06e9('0x37')]));_0x362b88[_0x06e9('0x38')]=_0x362b88[_0x06e9('0x38')][_0x06e9('0x39')]?_0x362b88[_0x06e9('0x38')]:_0x212685[_0x06e9('0x33')];_0x362b88[_0x06e9('0x63')]=qs[_0x06e9('0x3b')](_0x1b578b[_0x06e9('0x35')][_0x06e9('0x3b')]);_0x362b88[_0x06e9('0x3f')]=qs[_0x06e9('0x3c')](_[_0x06e9('0x3d')](_0x1b578b[_0x06e9('0x35')],_0x212685[_0x06e9('0x3c')]));if(_0x1b578b[_0x06e9('0x35')][_0x06e9('0x3e')]){_0x362b88['where']=_[_0x06e9('0x40')](_0x362b88['where'],{'$or':_['map'](_0x362b88[_0x06e9('0x38')],function(_0x3e8265){var _0xb07c20={};_0xb07c20[_0x3e8265]={'$like':'%'+_0x1b578b[_0x06e9('0x35')][_0x06e9('0x3e')]+'%'};return _0xb07c20;})});}_0x362b88=_['merge']({},_0x362b88,_0x1b578b[_0x06e9('0x4b')]);return _0x66b793[_0x06e9('0x92')](_0x362b88);}})['then'](function(_0x548d3b){if(_0x548d3b){_0x502530=_0x548d3b['length'];if(!_0x1b578b[_0x06e9('0x35')][_0x06e9('0x3a')](_0x06e9('0x5e'))){_0x362b88[_0x06e9('0x21')]=qs['limit'](_0x1b578b[_0x06e9('0x35')][_0x06e9('0x21')]);_0x362b88[_0x06e9('0x1e')]=qs['offset'](_0x1b578b['query'][_0x06e9('0x1e')]);}return _0x66b793[_0x06e9('0x92')](_0x362b88);}})[_0x06e9('0x27')](function(_0x1c63b4){if(_0x1c63b4){return _0x1c63b4?{'count':_0x502530,'rows':_0x1c63b4}:null;}})[_0x06e9('0x27')](respondWithResult(_0x4a6cad,null))[_0x06e9('0x47')](handleError(_0x4a6cad,null));};exports[_0x06e9('0x93')]=function(_0x295e22,_0x5882a8,_0x5e34c6){var _0x2ee274,_0x4b40d2;var _0x2a6b09=[];var _0x12472f=moment()[_0x06e9('0x6a')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0x06e9('0x43')][_0x06e9('0x51')]({'where':{'id':_0x295e22[_0x06e9('0x49')]['id']}})[_0x06e9('0x27')](handleEntityNotFound(_0x5882a8,null))[_0x06e9('0x27')](function(_0x466aac){if(_0x466aac){_0x4b40d2=_0x466aac;return _0x466aac[_0x06e9('0x93')](_0x295e22['body'][_0x06e9('0x6c')],_['omit'](_0x295e22[_0x06e9('0x4c')],[_0x06e9('0x6c'),'id'])||{});}return null;})[_0x06e9('0x94')](function(_0x4530b0){var _0x25967b;var _0x295342;_0x2ee274=_0x4530b0||[];var _0x199ff1=[];if(_0x4530b0){for(var _0x58a95f=0x0;_0x58a95f<_0x4530b0[_0x06e9('0x39')];_0x58a95f+=0x1){var _0x313e6c=_0x4530b0[_0x58a95f][_0x06e9('0x28')]({'plain':!![]});_0x25967b=squel[_0x06e9('0x6f')]()[_0x06e9('0x70')](_0x06e9('0x95'))['fromQuery']([_0x06e9('0x73'),_0x06e9('0x82'),_0x06e9('0x75'),'CampaignId',_0x06e9('0x56'),_0x06e9('0x57')],squel[_0x06e9('0x7e')]()[_0x06e9('0x76')](_0x06e9('0x73'),_0x06e9('0x73'))[_0x06e9('0x76')]('id','ContactId')[_0x06e9('0x76')](_0x313e6c['CmListId']['toString'](),'ListId')[_0x06e9('0x76')](_0x295e22['params']['id']['toString'](),_0x06e9('0x5f'))['field'](_0x06e9('0x84'),_0x06e9('0x56'))[_0x06e9('0x76')](_0x06e9('0x84'),_0x06e9('0x57'))[_0x06e9('0x78')](_0x06e9('0x79'))[_0x06e9('0x3f')](_0x06e9('0x7a'))[_0x06e9('0x3f')]('ListId\x20=\x20?',_0x313e6c['CmListId'][_0x06e9('0x77')]())[_0x06e9('0x3f')](_0x06e9('0x7c')))[_0x06e9('0x77')]();_0x199ff1[_0x06e9('0x96')](db[_0x06e9('0x8f')][_0x06e9('0x35')](_0x25967b));}return BPromise[_0x06e9('0x90')](_0x199ff1);}})[_0x06e9('0x27')](function(){return _0x2ee274;})['then'](respondWithResult(_0x5882a8,null))[_0x06e9('0x47')](handleError(_0x5882a8,null));};exports[_0x06e9('0x97')]=function(_0xe0aa86,_0x2176a5,_0x1ca3eb){return db['Campaign']['find']({'where':{'id':_0xe0aa86['params']['id']}})['then'](handleEntityNotFound(_0x2176a5,null))['then'](function(_0x3f115b){if(_0x3f115b){return _0x3f115b[_0x06e9('0x97')](_0xe0aa86['query'][_0x06e9('0x6c')]);}})[_0x06e9('0x27')](function(_0x4af149){if(_0x4af149){return db[_0x06e9('0x66')][_0x06e9('0x26')]({'where':{'ListId':_0xe0aa86[_0x06e9('0x35')][_0x06e9('0x6c')],'CampaignId':_0xe0aa86[_0x06e9('0x49')]['id']}})['then'](function(){return _0x4af149;});}})[_0x06e9('0x27')](respondWithStatusCode(_0x2176a5,null))[_0x06e9('0x47')](handleError(_0x2176a5,null));};
\ No newline at end of file
+var _0x16d1=['attributes','fields','order','sort','where','pick','filter','merge','type','options','includeAll','include','findAll','rows','show','params','length','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','body','userProfileId','getHoppers','findOne','CmHopper','hasOwnProperty','nolimit','CampaignId','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','ids','dialCheckDuplicateType','insert','into','cm_hopper','fromQuery','phone','ContactId','ListId','select','field','NOW()','scheduledAt','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','CampaignId\x20=\x20?','onlyIfOpen','COALESCE(phone,\x27\x27)','cm_hopper_additional_phones','cmHopperId','OrderBy','h.id','ci.item','ci.OrderBY','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','format','YYYY-MM-DD\x20HH:mm:ss','spread','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','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/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','get','IvrCampaigns','sendStatus','error','stack','name','send','index','map','Campaign','rawAttributes','fieldName','key','keys','query','filters','intersection','model'];(function(_0x4cf2bb,_0xc26020){var _0x44e779=function(_0x371446){while(--_0x371446){_0x4cf2bb['push'](_0x4cf2bb['shift']());}};_0x44e779(++_0xc26020);}(_0x16d1,0xf7));var _0x116d=function(_0x259aab,_0x3c2b69){_0x259aab=_0x259aab-0x0;var _0x2824b1=_0x16d1[_0x259aab];return _0x2824b1;};'use strict';var emlformat=require(_0x116d('0x0'));var rimraf=require(_0x116d('0x1'));var zipdir=require(_0x116d('0x2'));var jsonpatch=require(_0x116d('0x3'));var rp=require(_0x116d('0x4'));var moment=require('moment');var BPromise=require(_0x116d('0x5'));var Mustache=require('mustache');var util=require(_0x116d('0x6'));var path=require(_0x116d('0x7'));var sox=require(_0x116d('0x8'));var csv=require('to-csv');var ejs=require(_0x116d('0x9'));var fs=require('fs');var fs_extra=require(_0x116d('0xa'));var _=require(_0x116d('0xb'));var squel=require('squel');var crypto=require(_0x116d('0xc'));var jsforce=require(_0x116d('0xd'));var deskjs=require(_0x116d('0xe'));var toCsv=require(_0x116d('0xf'));var querystring=require(_0x116d('0x10'));var Papa=require(_0x116d('0x11'));var Redis=require(_0x116d('0x12'));var authService=require(_0x116d('0x13'));var qs=require(_0x116d('0x14'));var as=require(_0x116d('0x15'));var hardwareService=require(_0x116d('0x16'));var logger=require(_0x116d('0x17'))(_0x116d('0x18'));var utils=require(_0x116d('0x19'));var config=require(_0x116d('0x1a'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4471cd,_0x51c4a5){_0x51c4a5=_0x51c4a5||0xcc;return function(_0x17ef0b){if(_0x17ef0b){return _0x4471cd['sendStatus'](_0x51c4a5);}return _0x4471cd[_0x116d('0x1b')](_0x51c4a5)[_0x116d('0x1c')]();};}function respondWithResult(_0x3e40db,_0x2df82e){_0x2df82e=_0x2df82e||0xc8;return function(_0x239502){if(_0x239502){return _0x3e40db[_0x116d('0x1b')](_0x2df82e)[_0x116d('0x1d')](_0x239502);}};}function respondWithFilteredResult(_0x431381,_0x5d3f12){return function(_0x79c787){if(_0x79c787){var _0x4d323b=typeof _0x5d3f12[_0x116d('0x1e')]===_0x116d('0x1f')&&typeof _0x5d3f12[_0x116d('0x20')]===_0x116d('0x1f');var _0x503d43=_0x79c787[_0x116d('0x21')];var _0x16f75d=_0x4d323b?0x0:_0x5d3f12[_0x116d('0x1e')];var _0x527211=_0x4d323b?_0x79c787[_0x116d('0x21')]:_0x5d3f12['offset']+_0x5d3f12[_0x116d('0x20')];var _0x4e783d;if(_0x527211>=_0x503d43){_0x527211=_0x503d43;_0x4e783d=0xc8;}else{_0x4e783d=0xce;}_0x431381['status'](_0x4e783d);return _0x431381['set'](_0x116d('0x22'),_0x16f75d+'-'+_0x527211+'/'+_0x503d43)[_0x116d('0x1d')](_0x79c787);}return null;};}function patchUpdates(_0x466928){return function(_0x1177f6){try{jsonpatch[_0x116d('0x23')](_0x1177f6,_0x466928,!![]);}catch(_0x5aaf80){return BPromise[_0x116d('0x24')](_0x5aaf80);}return _0x1177f6[_0x116d('0x25')]();};}function saveUpdates(_0x36da9a,_0x4dae8c){return function(_0x3eef37){if(_0x3eef37){return _0x3eef37[_0x116d('0x26')](_0x36da9a)[_0x116d('0x27')](function(_0x4db1ee){return _0x4db1ee;});}return null;};}function removeEntity(_0x3dc071,_0x50f05c){return function(_0x4b7268){if(_0x4b7268){return _0x4b7268[_0x116d('0x28')]()['then'](function(){var _0x5a90bd=_0x4b7268[_0x116d('0x29')]({'plain':!![]});var _0x25b9b9=_0x116d('0x2a');return db['UserProfileResource'][_0x116d('0x28')]({'where':{'type':_0x25b9b9,'resourceId':_0x5a90bd['id']}})[_0x116d('0x27')](function(){return _0x4b7268;});})['then'](function(){_0x3dc071[_0x116d('0x1b')](0xcc)[_0x116d('0x1c')]();});}};}function handleEntityNotFound(_0x519588,_0x464b16){return function(_0x14ae6f){if(!_0x14ae6f){_0x519588[_0x116d('0x2b')](0x194);}return _0x14ae6f;};}function handleError(_0x2024b3,_0x27b0f7){_0x27b0f7=_0x27b0f7||0x1f4;return function(_0x59618c){logger[_0x116d('0x2c')](_0x59618c[_0x116d('0x2d')]);if(_0x59618c[_0x116d('0x2e')]){delete _0x59618c[_0x116d('0x2e')];}_0x2024b3['status'](_0x27b0f7)[_0x116d('0x2f')](_0x59618c);};}exports[_0x116d('0x30')]=function(_0x324f3c,_0x4c3509){var _0xf9abe2={},_0x4918e0={},_0x27e1e0={'count':0x0,'rows':[]};var _0x3fa09e=_[_0x116d('0x31')](db[_0x116d('0x32')][_0x116d('0x33')],function(_0x279f2){return{'name':_0x279f2[_0x116d('0x34')],'type':_0x279f2['type'][_0x116d('0x35')]};});_0x4918e0['model']=_[_0x116d('0x31')](_0x3fa09e,_0x116d('0x2e'));_0x4918e0['query']=_[_0x116d('0x36')](_0x324f3c[_0x116d('0x37')]);_0x4918e0[_0x116d('0x38')]=_[_0x116d('0x39')](_0x4918e0[_0x116d('0x3a')],_0x4918e0[_0x116d('0x37')]);_0xf9abe2[_0x116d('0x3b')]=_['intersection'](_0x4918e0[_0x116d('0x3a')],qs['fields'](_0x324f3c[_0x116d('0x37')][_0x116d('0x3c')]));_0xf9abe2[_0x116d('0x3b')]=_0xf9abe2[_0x116d('0x3b')]['length']?_0xf9abe2[_0x116d('0x3b')]:_0x4918e0[_0x116d('0x3a')];if(!_0x324f3c[_0x116d('0x37')]['hasOwnProperty']('nolimit')){_0xf9abe2[_0x116d('0x20')]=qs[_0x116d('0x20')](_0x324f3c[_0x116d('0x37')][_0x116d('0x20')]);_0xf9abe2[_0x116d('0x1e')]=qs[_0x116d('0x1e')](_0x324f3c['query'][_0x116d('0x1e')]);}_0xf9abe2[_0x116d('0x3d')]=qs[_0x116d('0x3e')](_0x324f3c[_0x116d('0x37')][_0x116d('0x3e')]);_0xf9abe2[_0x116d('0x3f')]=qs[_0x116d('0x38')](_[_0x116d('0x40')](_0x324f3c[_0x116d('0x37')],_0x4918e0[_0x116d('0x38')]),_0x3fa09e);if(_0x324f3c['query'][_0x116d('0x41')]){_0xf9abe2[_0x116d('0x3f')]=_[_0x116d('0x42')](_0xf9abe2[_0x116d('0x3f')],{'$or':_[_0x116d('0x31')](_0x3fa09e,function(_0x2b8138){if(_0x2b8138[_0x116d('0x43')]!=='VIRTUAL'){var _0x2716c1={};_0x2716c1[_0x2b8138[_0x116d('0x2e')]]={'$like':'%'+_0x324f3c[_0x116d('0x37')]['filter']+'%'};return _0x2716c1;}})});}_0xf9abe2=_[_0x116d('0x42')]({},_0xf9abe2,_0x324f3c[_0x116d('0x44')]);var _0x152cd2={'where':_0xf9abe2['where']};return db[_0x116d('0x32')][_0x116d('0x21')](_0x152cd2)[_0x116d('0x27')](function(_0x446870){_0x27e1e0[_0x116d('0x21')]=_0x446870;if(_0x324f3c[_0x116d('0x37')][_0x116d('0x45')]){_0xf9abe2[_0x116d('0x46')]=[{'all':!![]}];}return db[_0x116d('0x32')][_0x116d('0x47')](_0xf9abe2);})[_0x116d('0x27')](function(_0x4fc6d8){_0x27e1e0[_0x116d('0x48')]=_0x4fc6d8;return _0x27e1e0;})[_0x116d('0x27')](respondWithFilteredResult(_0x4c3509,_0xf9abe2))['catch'](handleError(_0x4c3509,null));};exports[_0x116d('0x49')]=function(_0x3df272,_0x22eed2){var _0x5f30c9={'raw':![],'where':{'id':_0x3df272[_0x116d('0x4a')]['id']}},_0x50f72e={};_0x50f72e[_0x116d('0x3a')]=_[_0x116d('0x36')](db[_0x116d('0x32')]['rawAttributes']);_0x50f72e[_0x116d('0x37')]=_[_0x116d('0x36')](_0x3df272[_0x116d('0x37')]);_0x50f72e[_0x116d('0x38')]=_['intersection'](_0x50f72e[_0x116d('0x3a')],_0x50f72e[_0x116d('0x37')]);_0x5f30c9[_0x116d('0x3b')]=_['intersection'](_0x50f72e[_0x116d('0x3a')],qs[_0x116d('0x3c')](_0x3df272[_0x116d('0x37')][_0x116d('0x3c')]));_0x5f30c9[_0x116d('0x3b')]=_0x5f30c9[_0x116d('0x3b')][_0x116d('0x4b')]?_0x5f30c9[_0x116d('0x3b')]:_0x50f72e[_0x116d('0x3a')];if(_0x3df272[_0x116d('0x37')]['includeAll']){_0x5f30c9[_0x116d('0x46')]=[{'all':!![]}];}_0x5f30c9=_[_0x116d('0x42')]({},_0x5f30c9,_0x3df272[_0x116d('0x44')]);return db[_0x116d('0x32')][_0x116d('0x4c')](_0x5f30c9)[_0x116d('0x27')](handleEntityNotFound(_0x22eed2,null))[_0x116d('0x27')](respondWithResult(_0x22eed2,null))[_0x116d('0x4d')](handleError(_0x22eed2,null));};exports[_0x116d('0x4e')]=function(_0x397154,_0x2f2690){return db[_0x116d('0x32')][_0x116d('0x4e')](_0x397154['body'],{})[_0x116d('0x27')](function(_0x586d27){var _0xe5917f=_0x397154[_0x116d('0x4f')]['get']({'plain':!![]});if(!_0xe5917f)throw new Error(_0x116d('0x50'));if(_0xe5917f[_0x116d('0x51')]===_0x116d('0x4f')){var _0x5420ff=_0x586d27[_0x116d('0x29')]({'plain':!![]});var _0x2291bb=_0x116d('0x2a');return db[_0x116d('0x52')]['find']({'where':{'name':_0x2291bb,'userProfileId':_0xe5917f['userProfileId']},'raw':!![]})[_0x116d('0x27')](function(_0x20ddf3){if(_0x20ddf3&&_0x20ddf3[_0x116d('0x53')]===0x0){return db[_0x116d('0x54')][_0x116d('0x4e')]({'name':_0x5420ff['name'],'resourceId':_0x5420ff['id'],'type':_0x20ddf3[_0x116d('0x2e')],'sectionId':_0x20ddf3['id']},{})[_0x116d('0x27')](function(){return _0x586d27;});}else{return _0x586d27;}})[_0x116d('0x4d')](function(_0x1eba28){logger[_0x116d('0x2c')](_0x116d('0x55'),_0x1eba28);throw _0x1eba28;});}return _0x586d27;})['then'](respondWithResult(_0x2f2690,0xc9))[_0x116d('0x4d')](handleError(_0x2f2690,null));};exports[_0x116d('0x56')]=function(_0x5e988a,_0x3c8299){var _0x517d85={'where':{'id':_0x5e988a[_0x116d('0x4a')]['id']}},_0xf505cc={};_0xf505cc[_0x116d('0x3a')]=_[_0x116d('0x36')](db[_0x116d('0x32')][_0x116d('0x33')]);_0x517d85[_0x116d('0x3b')]=_[_0x116d('0x39')](_0xf505cc[_0x116d('0x3a')],qs[_0x116d('0x3c')](_0x5e988a[_0x116d('0x37')]['fields']));_0x517d85[_0x116d('0x3b')]=_0x517d85['attributes'][_0x116d('0x4b')]?_0x517d85[_0x116d('0x3b')]:_0xf505cc['model'];if(_0x5e988a['query'][_0x116d('0x45')]){_0x517d85['include']=[{'all':!![]}];}_0x517d85=_['merge']({},_0x517d85,_0x5e988a[_0x116d('0x44')]);return db[_0x116d('0x32')][_0x116d('0x4c')](_0x517d85)[_0x116d('0x27')](handleEntityNotFound(_0x3c8299,null))[_0x116d('0x27')](function(_0x288144){if(_0x288144){var _0x1d033d=_0x288144['get']({'plain':!![]});_0x1d033d=qs[_0x116d('0x57')](_0x1d033d,['id',_0x116d('0x58'),_0x116d('0x59')]);_0x5e988a[_0x116d('0x5a')]=_['omit'](_0x5e988a[_0x116d('0x5a')],['id','createdAt',_0x116d('0x59')]);return db[_0x116d('0x32')][_0x116d('0x4e')](_[_0x116d('0x42')](_0x1d033d,_0x5e988a[_0x116d('0x5a')]),{'include':_0x5e988a['query'][_0x116d('0x45')]?[{'all':!![]}]:undefined})[_0x116d('0x27')](function(_0xe7d18b){var _0xad15b6=_0x5e988a[_0x116d('0x4f')][_0x116d('0x29')]({'plain':!![]});if(!_0xad15b6)throw new Error(_0x116d('0x50'));if(_0xad15b6['role']==='user'){var _0x42fb07=_0xe7d18b[_0x116d('0x29')]({'plain':!![]});var _0x3d510e=_0x116d('0x2a');return db['UserProfileSection'][_0x116d('0x4c')]({'where':{'name':_0x3d510e,'userProfileId':_0xad15b6[_0x116d('0x5b')]},'raw':!![]})['then'](function(_0x5bf417){if(_0x5bf417&&_0x5bf417['autoAssociation']===0x0){return db['UserProfileResource'][_0x116d('0x4e')]({'name':_0x42fb07[_0x116d('0x2e')],'resourceId':_0x42fb07['id'],'type':_0x5bf417[_0x116d('0x2e')],'sectionId':_0x5bf417['id']},{})['then'](function(){return _0xe7d18b;});}else{return _0xe7d18b;}})[_0x116d('0x4d')](function(_0x1a6014){logger['error'](_0x116d('0x55'),_0x1a6014);throw _0x1a6014;});}return _0xe7d18b;});}})[_0x116d('0x27')](respondWithResult(_0x3c8299,0xc9))[_0x116d('0x4d')](handleError(_0x3c8299,null));};exports[_0x116d('0x26')]=function(_0xaf50cf,_0x3d28b6){if(_0xaf50cf[_0x116d('0x5a')]['id']){delete _0xaf50cf[_0x116d('0x5a')]['id'];}return db['Campaign']['find']({'where':{'id':_0xaf50cf['params']['id']}})[_0x116d('0x27')](handleEntityNotFound(_0x3d28b6,null))['then'](saveUpdates(_0xaf50cf['body'],null))[_0x116d('0x27')](respondWithResult(_0x3d28b6,null))[_0x116d('0x4d')](handleError(_0x3d28b6,null));};exports[_0x116d('0x28')]=function(_0x3bb363,_0x5265b7){return db[_0x116d('0x32')][_0x116d('0x4c')]({'where':{'id':_0x3bb363[_0x116d('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5265b7,null))[_0x116d('0x27')](removeEntity(_0x5265b7,null))[_0x116d('0x4d')](handleError(_0x5265b7,null));};exports[_0x116d('0x5c')]=function(_0x418773,_0x1e2117,_0x28d201){var _0x32fa2c={'raw':!![],'where':{}};var _0x44453b={};var _0x5472ef={'count':0x0,'rows':[]};return db[_0x116d('0x32')][_0x116d('0x5d')]({'where':{'id':_0x418773[_0x116d('0x4a')]['id']}})[_0x116d('0x27')](handleEntityNotFound(_0x1e2117,null))[_0x116d('0x27')](function(_0x56dbcf){if(_0x56dbcf){_0x44453b[_0x116d('0x3a')]=_[_0x116d('0x36')](db[_0x116d('0x5e')]['rawAttributes']);_0x44453b[_0x116d('0x37')]=_['keys'](_0x418773[_0x116d('0x37')]);_0x44453b['filters']=_['intersection'](_0x44453b[_0x116d('0x3a')],_0x44453b[_0x116d('0x37')]);_0x32fa2c['attributes']=_[_0x116d('0x39')](_0x44453b['model'],qs[_0x116d('0x3c')](_0x418773[_0x116d('0x37')][_0x116d('0x3c')]));_0x32fa2c[_0x116d('0x3b')]=_0x32fa2c[_0x116d('0x3b')][_0x116d('0x4b')]?_0x32fa2c[_0x116d('0x3b')]:_0x44453b[_0x116d('0x3a')];if(!_0x418773[_0x116d('0x37')][_0x116d('0x5f')](_0x116d('0x60'))){_0x32fa2c[_0x116d('0x20')]=qs[_0x116d('0x20')](_0x418773[_0x116d('0x37')]['limit']);_0x32fa2c['offset']=qs[_0x116d('0x1e')](_0x418773[_0x116d('0x37')]['offset']);}_0x32fa2c[_0x116d('0x3d')]=qs[_0x116d('0x3e')](_0x418773[_0x116d('0x37')]['sort']);_0x32fa2c[_0x116d('0x3f')]=qs[_0x116d('0x38')](_[_0x116d('0x40')](_0x418773[_0x116d('0x37')],_0x44453b[_0x116d('0x38')]));_0x32fa2c[_0x116d('0x3f')][_0x116d('0x61')]=_0x56dbcf['id'];if(_0x418773[_0x116d('0x37')][_0x116d('0x41')]){_0x32fa2c[_0x116d('0x3f')]=_[_0x116d('0x42')](_0x32fa2c[_0x116d('0x3f')],{'$or':_['map'](_0x32fa2c[_0x116d('0x3b')],function(_0x1b093a){var _0x8da400={};_0x8da400[_0x1b093a]={'$like':'%'+_0x418773[_0x116d('0x37')][_0x116d('0x41')]+'%'};return _0x8da400;})});}_0x32fa2c=_[_0x116d('0x42')]({},_0x32fa2c,_0x418773[_0x116d('0x44')]);return db[_0x116d('0x5e')]['count']({'where':_0x32fa2c['where']})['then'](function(_0x485fd7){_0x5472ef['count']=_0x485fd7;if(_0x418773[_0x116d('0x37')][_0x116d('0x45')]){_0x32fa2c[_0x116d('0x46')]=[{'all':!![]}];}return db['CmHopper'][_0x116d('0x47')](_0x32fa2c);})[_0x116d('0x27')](function(_0x443d52){_0x5472ef[_0x116d('0x48')]=_0x443d52;return _0x5472ef;});}})['then'](respondWithFilteredResult(_0x1e2117,_0x32fa2c))[_0x116d('0x4d')](handleError(_0x1e2117,null));};exports[_0x116d('0x62')]=function(_0x2317ed,_0x3775e7,_0x2f1266){var _0x2f0b6a={'raw':!![],'where':{}};var _0x4a5a60={};var _0x4deff2={'count':0x0,'rows':[]};return db[_0x116d('0x32')][_0x116d('0x5d')]({'where':{'id':_0x2317ed[_0x116d('0x4a')]['id']}})[_0x116d('0x27')](handleEntityNotFound(_0x3775e7,null))['then'](function(_0x536c61){if(_0x536c61){_0x4a5a60[_0x116d('0x3a')]=_['keys'](db[_0x116d('0x63')]['rawAttributes']);_0x4a5a60[_0x116d('0x37')]=_[_0x116d('0x36')](_0x2317ed[_0x116d('0x37')]);_0x4a5a60['filters']=_['intersection'](_0x4a5a60['model'],_0x4a5a60[_0x116d('0x37')]);_0x2f0b6a[_0x116d('0x3b')]=_[_0x116d('0x39')](_0x4a5a60[_0x116d('0x3a')],qs[_0x116d('0x3c')](_0x2317ed[_0x116d('0x37')]['fields']));_0x2f0b6a['attributes']=_0x2f0b6a[_0x116d('0x3b')][_0x116d('0x4b')]?_0x2f0b6a[_0x116d('0x3b')]:_0x4a5a60[_0x116d('0x3a')];if(!_0x2317ed['query'][_0x116d('0x5f')](_0x116d('0x60'))){_0x2f0b6a[_0x116d('0x20')]=qs[_0x116d('0x20')](_0x2317ed[_0x116d('0x37')][_0x116d('0x20')]);_0x2f0b6a[_0x116d('0x1e')]=qs[_0x116d('0x1e')](_0x2317ed[_0x116d('0x37')][_0x116d('0x1e')]);}_0x2f0b6a[_0x116d('0x3d')]=qs[_0x116d('0x3e')](_0x2317ed[_0x116d('0x37')][_0x116d('0x3e')]);_0x2f0b6a[_0x116d('0x3f')]=qs['filters'](_[_0x116d('0x40')](_0x2317ed['query'],_0x4a5a60[_0x116d('0x38')]));_0x2f0b6a[_0x116d('0x3f')]['CampaignId']=_0x536c61['id'];if(_0x2317ed[_0x116d('0x37')]['filter']){_0x2f0b6a[_0x116d('0x3f')]=_[_0x116d('0x42')](_0x2f0b6a[_0x116d('0x3f')],{'$or':_['map'](_0x2f0b6a[_0x116d('0x3b')],function(_0x2dd027){var _0x24b9a8={};_0x24b9a8[_0x2dd027]={'$like':'%'+_0x2317ed[_0x116d('0x37')][_0x116d('0x41')]+'%'};return _0x24b9a8;})});}_0x2f0b6a=_[_0x116d('0x42')]({},_0x2f0b6a,_0x2317ed[_0x116d('0x44')]);return db[_0x116d('0x63')]['count']({'where':_0x2f0b6a['where']})[_0x116d('0x27')](function(_0x496997){_0x4deff2[_0x116d('0x21')]=_0x496997;if(_0x2317ed[_0x116d('0x37')][_0x116d('0x45')]){_0x2f0b6a['include']=[{'all':!![]}];}return db[_0x116d('0x63')][_0x116d('0x47')](_0x2f0b6a);})['then'](function(_0x47d8d2){_0x4deff2[_0x116d('0x48')]=_0x47d8d2;return _0x4deff2;});}})[_0x116d('0x27')](respondWithFilteredResult(_0x3775e7,_0x2f0b6a))[_0x116d('0x4d')](handleError(_0x3775e7,null));};exports[_0x116d('0x64')]=function(_0x2db20f,_0x150136,_0x278b7d){var _0x26d354={'raw':!![],'where':{}};var _0x3048c1={};var _0x3e1903={'count':0x0,'rows':[]};return db[_0x116d('0x32')][_0x116d('0x5d')]({'where':{'id':_0x2db20f[_0x116d('0x4a')]['id']}})[_0x116d('0x27')](handleEntityNotFound(_0x150136,null))[_0x116d('0x27')](function(_0x39f0e8){if(_0x39f0e8){_0x3048c1[_0x116d('0x3a')]=_[_0x116d('0x36')](db['CmHopperFinal'][_0x116d('0x33')]);_0x3048c1['query']=_[_0x116d('0x36')](_0x2db20f['query']);_0x3048c1[_0x116d('0x38')]=_[_0x116d('0x39')](_0x3048c1['model'],_0x3048c1[_0x116d('0x37')]);_0x26d354['attributes']=_[_0x116d('0x39')](_0x3048c1[_0x116d('0x3a')],qs[_0x116d('0x3c')](_0x2db20f['query'][_0x116d('0x3c')]));_0x26d354[_0x116d('0x3b')]=_0x26d354[_0x116d('0x3b')][_0x116d('0x4b')]?_0x26d354[_0x116d('0x3b')]:_0x3048c1[_0x116d('0x3a')];if(!_0x2db20f['query'][_0x116d('0x5f')](_0x116d('0x60'))){_0x26d354[_0x116d('0x20')]=qs[_0x116d('0x20')](_0x2db20f[_0x116d('0x37')]['limit']);_0x26d354[_0x116d('0x1e')]=qs['offset'](_0x2db20f[_0x116d('0x37')][_0x116d('0x1e')]);}_0x26d354[_0x116d('0x3d')]=qs['sort'](_0x2db20f[_0x116d('0x37')][_0x116d('0x3e')]);_0x26d354['where']=qs[_0x116d('0x38')](_[_0x116d('0x40')](_0x2db20f[_0x116d('0x37')],_0x3048c1[_0x116d('0x38')]));_0x26d354[_0x116d('0x3f')]['CampaignId']=_0x39f0e8['id'];if(_0x2db20f['query']['filter']){_0x26d354['where']=_[_0x116d('0x42')](_0x26d354[_0x116d('0x3f')],{'$or':_[_0x116d('0x31')](_0x26d354[_0x116d('0x3b')],function(_0x38c38a){var _0x27483e={};_0x27483e[_0x38c38a]={'$like':'%'+_0x2db20f[_0x116d('0x37')][_0x116d('0x41')]+'%'};return _0x27483e;})});}_0x26d354=_['merge']({},_0x26d354,_0x2db20f[_0x116d('0x44')]);return db[_0x116d('0x65')]['count']({'where':_0x26d354[_0x116d('0x3f')]})[_0x116d('0x27')](function(_0x2e6a9b){_0x3e1903['count']=_0x2e6a9b;if(_0x2db20f[_0x116d('0x37')][_0x116d('0x45')]){_0x26d354[_0x116d('0x46')]=[{'all':!![]}];}return db[_0x116d('0x65')][_0x116d('0x47')](_0x26d354);})[_0x116d('0x27')](function(_0x57a4e6){_0x3e1903[_0x116d('0x48')]=_0x57a4e6;return _0x3e1903;});}})[_0x116d('0x27')](respondWithFilteredResult(_0x150136,_0x26d354))['catch'](handleError(_0x150136,null));};exports[_0x116d('0x66')]=function(_0x18085e,_0x3587aa,_0x4388c0){var _0x4979ed={'raw':!![],'where':{}};var _0x3e2953={};var _0x52c2a9={'count':0x0,'rows':[]};return db[_0x116d('0x32')][_0x116d('0x5d')]({'where':{'id':_0x18085e[_0x116d('0x4a')]['id']}})[_0x116d('0x27')](handleEntityNotFound(_0x3587aa,null))['then'](function(_0x57b469){if(_0x57b469){_0x3e2953[_0x116d('0x3a')]=_['keys'](db[_0x116d('0x67')][_0x116d('0x33')]);_0x3e2953['query']=_[_0x116d('0x36')](_0x18085e['query']);_0x3e2953[_0x116d('0x38')]=_['intersection'](_0x3e2953['model'],_0x3e2953[_0x116d('0x37')]);_0x4979ed[_0x116d('0x3b')]=_['intersection'](_0x3e2953[_0x116d('0x3a')],qs[_0x116d('0x3c')](_0x18085e['query'][_0x116d('0x3c')]));_0x4979ed[_0x116d('0x3b')]=_0x4979ed['attributes'][_0x116d('0x4b')]?_0x4979ed['attributes']:_0x3e2953[_0x116d('0x3a')];if(!_0x18085e[_0x116d('0x37')][_0x116d('0x5f')](_0x116d('0x60'))){_0x4979ed[_0x116d('0x20')]=qs[_0x116d('0x20')](_0x18085e[_0x116d('0x37')][_0x116d('0x20')]);_0x4979ed[_0x116d('0x1e')]=qs[_0x116d('0x1e')](_0x18085e[_0x116d('0x37')]['offset']);}_0x4979ed[_0x116d('0x3d')]=qs[_0x116d('0x3e')](_0x18085e[_0x116d('0x37')][_0x116d('0x3e')]);_0x4979ed['where']=qs[_0x116d('0x38')](_[_0x116d('0x40')](_0x18085e['query'],_0x3e2953[_0x116d('0x38')]));_0x4979ed[_0x116d('0x3f')][_0x116d('0x61')]=_0x57b469['id'];if(_0x18085e[_0x116d('0x37')][_0x116d('0x41')]){_0x4979ed[_0x116d('0x3f')]=_[_0x116d('0x42')](_0x4979ed[_0x116d('0x3f')],{'$or':_[_0x116d('0x31')](_0x4979ed[_0x116d('0x3b')],function(_0x4d68e3){var _0x580ad5={};_0x580ad5[_0x4d68e3]={'$like':'%'+_0x18085e[_0x116d('0x37')]['filter']+'%'};return _0x580ad5;})});}_0x4979ed=_['merge']({},_0x4979ed,_0x18085e[_0x116d('0x44')]);return db['CmHopperBlack'][_0x116d('0x21')]({'where':_0x4979ed[_0x116d('0x3f')]})[_0x116d('0x27')](function(_0xd9e310){_0x52c2a9[_0x116d('0x21')]=_0xd9e310;if(_0x18085e[_0x116d('0x37')][_0x116d('0x45')]){_0x4979ed[_0x116d('0x46')]=[{'all':!![]}];}return db[_0x116d('0x67')][_0x116d('0x47')](_0x4979ed);})[_0x116d('0x27')](function(_0x3d45c4){_0x52c2a9[_0x116d('0x48')]=_0x3d45c4;return _0x52c2a9;});}})[_0x116d('0x27')](respondWithFilteredResult(_0x3587aa,_0x4979ed))['catch'](handleError(_0x3587aa,null));};exports[_0x116d('0x68')]=function(_0x16214f,_0x44009a,_0x55c06d){var _0x5befd5={};var _0x5e6e50={};var _0xae0b19;var _0x4a6f2e;return db[_0x116d('0x32')]['findOne']({'where':{'id':_0x16214f[_0x116d('0x4a')]['id']}})[_0x116d('0x27')](handleEntityNotFound(_0x44009a,null))['then'](function(_0x5dfe6f){if(_0x5dfe6f){_0xae0b19=_0x5dfe6f;_0x5e6e50[_0x116d('0x3a')]=_[_0x116d('0x36')](db[_0x116d('0x69')]['rawAttributes']);_0x5e6e50[_0x116d('0x37')]=_['keys'](_0x16214f[_0x116d('0x37')]);_0x5e6e50['filters']=_[_0x116d('0x39')](_0x5e6e50[_0x116d('0x3a')],_0x5e6e50[_0x116d('0x37')]);_0x5befd5[_0x116d('0x3b')]=_[_0x116d('0x39')](_0x5e6e50[_0x116d('0x3a')],qs['fields'](_0x16214f[_0x116d('0x37')]['fields']));_0x5befd5[_0x116d('0x3b')]=_0x5befd5[_0x116d('0x3b')]['length']?_0x5befd5[_0x116d('0x3b')]:_0x5e6e50[_0x116d('0x3a')];_0x5befd5[_0x116d('0x3d')]=qs['sort'](_0x16214f[_0x116d('0x37')][_0x116d('0x3e')]);_0x5befd5[_0x116d('0x3f')]=qs['filters'](_[_0x116d('0x40')](_0x16214f[_0x116d('0x37')],_0x5e6e50['filters']));if(_0x16214f[_0x116d('0x37')][_0x116d('0x41')]){_0x5befd5['where']=_[_0x116d('0x42')](_0x5befd5[_0x116d('0x3f')],{'$or':_[_0x116d('0x31')](_0x5befd5[_0x116d('0x3b')],function(_0x7b15b2){var _0xa5dbcf={};_0xa5dbcf[_0x7b15b2]={'$like':'%'+_0x16214f['query'][_0x116d('0x41')]+'%'};return _0xa5dbcf;})});}_0x5befd5=_['merge']({},_0x5befd5,_0x16214f[_0x116d('0x44')]);return _0xae0b19['getLists'](_0x5befd5);}})[_0x116d('0x27')](function(_0x27c5a7){if(_0x27c5a7){_0x4a6f2e=_0x27c5a7['length'];if(!_0x16214f[_0x116d('0x37')][_0x116d('0x5f')]('nolimit')){_0x5befd5['limit']=qs[_0x116d('0x20')](_0x16214f[_0x116d('0x37')][_0x116d('0x20')]);_0x5befd5['offset']=qs[_0x116d('0x1e')](_0x16214f[_0x116d('0x37')]['offset']);}return _0xae0b19['getLists'](_0x5befd5);}})['then'](function(_0x4b3b11){if(_0x4b3b11){return _0x4b3b11?{'count':_0x4a6f2e,'rows':_0x4b3b11}:null;}})[_0x116d('0x27')](respondWithResult(_0x44009a,null))[_0x116d('0x4d')](handleError(_0x44009a,null));};exports['addLists']=function(_0x66cbcd,_0x188b5f,_0x4cc913){var _0x10bc73,_0x53a8e9;var _0x3e05dc=[];var _0x1b08a9=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');return db[_0x116d('0x32')][_0x116d('0x4c')]({'where':{'id':_0x66cbcd['params']['id']}})[_0x116d('0x27')](handleEntityNotFound(_0x188b5f,null))[_0x116d('0x27')](function(_0x14d3ba){if(_0x14d3ba){_0x53a8e9=_0x14d3ba;return _0x14d3ba[_0x116d('0x6a')](_0x66cbcd[_0x116d('0x5a')][_0x116d('0x6b')],_[_0x116d('0x57')](_0x66cbcd['body'],[_0x116d('0x6b'),'id'])||{});}return null;})['spread'](function(_0x28e5ae){var _0x5a37e3;var _0x4d2bbf;_0x10bc73=_0x28e5ae||[];var _0x5df04d=[];if(_0x28e5ae){for(var _0xb712c4=0x0;_0xb712c4<_0x28e5ae['length'];_0xb712c4+=0x1){var _0x20309a=_0x28e5ae[_0xb712c4]['get']({'plain':!![]});_0x53a8e9['dialCheckDuplicateType']=_0x66cbcd[_0x116d('0x5a')][_0x116d('0x6c')]?_0x66cbcd[_0x116d('0x5a')]['dialCheckDuplicateType']:_0x53a8e9['dialCheckDuplicateType'];switch(_0x53a8e9[_0x116d('0x6c')]){case'always':_0x5a37e3=squel[_0x116d('0x6d')]()[_0x116d('0x6e')](_0x116d('0x6f'))[_0x116d('0x70')]([_0x116d('0x71'),'scheduledAt',_0x116d('0x72'),_0x116d('0x73'),_0x116d('0x61'),_0x116d('0x58'),'updatedAt'],squel[_0x116d('0x74')]()['field'](_0x116d('0x71'),_0x116d('0x71'))[_0x116d('0x75')](_0x116d('0x76'),_0x116d('0x77'))[_0x116d('0x75')]('id',_0x116d('0x72'))[_0x116d('0x75')](_0x20309a[_0x116d('0x78')]['toString'](),_0x116d('0x73'))[_0x116d('0x75')](_0x66cbcd[_0x116d('0x4a')]['id'][_0x116d('0x79')](),'CampaignId')[_0x116d('0x75')]('\x27'+_0x1b08a9+'\x27','createdAt')[_0x116d('0x75')]('\x27'+_0x1b08a9+'\x27',_0x116d('0x59'))[_0x116d('0x7a')](_0x116d('0x7b'))[_0x116d('0x3f')](_0x116d('0x7c'))[_0x116d('0x3f')](_0x116d('0x7d'),_0x20309a['CmListId']['toString']())[_0x116d('0x3f')](_0x116d('0x7e'))[_0x116d('0x3f')](_0x116d('0x7f'),squel[_0x116d('0x74')]()[_0x116d('0x75')](_0x116d('0x80'))[_0x116d('0x7a')](_0x116d('0x81'))[_0x116d('0x3f')](_0x116d('0x82'),_0x66cbcd[_0x116d('0x4a')]['id'][_0x116d('0x79')]()))[_0x116d('0x3f')](_0x116d('0x7f'),squel['select']()[_0x116d('0x75')]('COALESCE(phone,\x27\x27)')['from']('cm_hopper')['where'](_0x116d('0x82'),_0x66cbcd[_0x116d('0x4a')]['id'][_0x116d('0x79')]())))[_0x116d('0x79')]();break;case _0x116d('0x83'):_0x5a37e3=squel[_0x116d('0x6d')]()[_0x116d('0x6e')]('cm_hopper')[_0x116d('0x70')]([_0x116d('0x71'),_0x116d('0x77'),_0x116d('0x72'),_0x116d('0x73'),'CampaignId',_0x116d('0x58'),_0x116d('0x59')],squel['select']()[_0x116d('0x75')](_0x116d('0x71'),_0x116d('0x71'))[_0x116d('0x75')](_0x116d('0x76'),'scheduledAt')[_0x116d('0x75')]('id',_0x116d('0x72'))[_0x116d('0x75')](_0x20309a[_0x116d('0x78')][_0x116d('0x79')](),_0x116d('0x73'))[_0x116d('0x75')](_0x66cbcd[_0x116d('0x4a')]['id'][_0x116d('0x79')](),_0x116d('0x61'))[_0x116d('0x75')]('\x27'+_0x1b08a9+'\x27',_0x116d('0x58'))['field']('\x27'+_0x1b08a9+'\x27',_0x116d('0x59'))[_0x116d('0x7a')]('cm_contacts')['where']('deletedAt\x20IS\x20NULL')['where']('ListId\x20=\x20?',_0x20309a['CmListId']['toString']())[_0x116d('0x3f')](_0x116d('0x7e'))['where'](_0x116d('0x7f'),squel[_0x116d('0x74')]()[_0x116d('0x75')](_0x116d('0x84'))[_0x116d('0x7a')]('cm_hopper')['where'](_0x116d('0x82'),_0x66cbcd[_0x116d('0x4a')]['id'][_0x116d('0x79')]())))[_0x116d('0x79')]();break;default:_0x5a37e3=squel[_0x116d('0x6d')]()[_0x116d('0x6e')]('cm_hopper')[_0x116d('0x70')]([_0x116d('0x71'),_0x116d('0x77'),'ContactId','ListId',_0x116d('0x61'),_0x116d('0x58'),'updatedAt'],squel[_0x116d('0x74')]()[_0x116d('0x75')]('phone',_0x116d('0x71'))[_0x116d('0x75')](_0x116d('0x76'),_0x116d('0x77'))[_0x116d('0x75')]('id','ContactId')[_0x116d('0x75')](_0x20309a[_0x116d('0x78')][_0x116d('0x79')](),_0x116d('0x73'))[_0x116d('0x75')](_0x66cbcd['params']['id'][_0x116d('0x79')](),_0x116d('0x61'))[_0x116d('0x75')]('\x27'+_0x1b08a9+'\x27',_0x116d('0x58'))[_0x116d('0x75')]('\x27'+_0x1b08a9+'\x27','updatedAt')['from'](_0x116d('0x7b'))[_0x116d('0x3f')]('deletedAt\x20IS\x20NULL')[_0x116d('0x3f')](_0x116d('0x7d'),_0x20309a['CmListId'][_0x116d('0x79')]())[_0x116d('0x3f')](_0x116d('0x7e')))[_0x116d('0x79')]();}_0x4d2bbf=squel[_0x116d('0x6d')]()[_0x116d('0x6e')](_0x116d('0x85'))[_0x116d('0x70')]([_0x116d('0x86'),'scheduledAt',_0x116d('0x71'),_0x116d('0x87'),'createdAt','updatedAt'],squel['select']()[_0x116d('0x75')](_0x116d('0x88'),'id')[_0x116d('0x75')](_0x116d('0x76'),_0x116d('0x77'))[_0x116d('0x75')](_0x116d('0x89'),'phone')[_0x116d('0x75')](_0x116d('0x8a'),'OrderBy')['field']('\x27'+_0x1b08a9+'\x27',_0x116d('0x58'))[_0x116d('0x75')]('\x27'+_0x1b08a9+'\x27','updatedAt')['from']('cm_contact_has_items','ci')['join'](_0x116d('0x6f'),'h',_0x116d('0x8b'))[_0x116d('0x3f')](_0x116d('0x8c'),_0x20309a[_0x116d('0x78')][_0x116d('0x79')]())['where'](_0x116d('0x8d'),_0x66cbcd[_0x116d('0x4a')]['id']['toString']())[_0x116d('0x3f')]('h.createdAt\x20=\x20?',_0x1b08a9))[_0x116d('0x79')]();_0x5df04d[_0x116d('0x8e')](db[_0x116d('0x8f')][_0x116d('0x37')](_0x5a37e3));_0x3e05dc['push'](db[_0x116d('0x8f')][_0x116d('0x37')](_0x4d2bbf));}return BPromise[_0x116d('0x90')](_0x5df04d);}})[_0x116d('0x27')](function(){return BPromise[_0x116d('0x90')](_0x3e05dc);})[_0x116d('0x27')](function(){return _0x10bc73;})[_0x116d('0x27')](respondWithResult(_0x188b5f,null))['catch'](handleError(_0x188b5f,null));};exports[_0x116d('0x91')]=function(_0x2a440b,_0xb25df5,_0x3a10fd){return db['Campaign'][_0x116d('0x4c')]({'where':{'id':_0x2a440b[_0x116d('0x4a')]['id']}})[_0x116d('0x27')](handleEntityNotFound(_0xb25df5,null))[_0x116d('0x27')](function(_0x395bb4){if(_0x395bb4){return _0x395bb4[_0x116d('0x91')](_0x2a440b[_0x116d('0x37')]['ids']);}})['then'](function(_0x2c26cf){if(_0x2c26cf){return db[_0x116d('0x5e')][_0x116d('0x28')]({'where':{'ListId':_0x2a440b['query'][_0x116d('0x6b')],'CampaignId':_0x2a440b[_0x116d('0x4a')]['id']}})[_0x116d('0x27')](function(){return _0x2c26cf;});}})[_0x116d('0x27')](respondWithStatusCode(_0xb25df5,null))['catch'](handleError(_0xb25df5,null));};exports[_0x116d('0x92')]=function(_0x51a6f1,_0x215665,_0x492165){var _0xf3b2c2={};var _0x21bc9b={};var _0xa321ab;var _0x229d9e;return db[_0x116d('0x32')][_0x116d('0x5d')]({'where':{'id':_0x51a6f1[_0x116d('0x4a')]['id']}})[_0x116d('0x27')](handleEntityNotFound(_0x215665,null))['then'](function(_0x10647d){if(_0x10647d){_0xa321ab=_0x10647d;_0x21bc9b[_0x116d('0x3a')]=_['keys'](db[_0x116d('0x69')][_0x116d('0x33')]);_0x21bc9b[_0x116d('0x37')]=_['keys'](_0x51a6f1[_0x116d('0x37')]);_0x21bc9b['filters']=_['intersection'](_0x21bc9b[_0x116d('0x3a')],_0x21bc9b[_0x116d('0x37')]);_0xf3b2c2[_0x116d('0x3b')]=_[_0x116d('0x39')](_0x21bc9b[_0x116d('0x3a')],qs[_0x116d('0x3c')](_0x51a6f1['query'][_0x116d('0x3c')]));_0xf3b2c2[_0x116d('0x3b')]=_0xf3b2c2[_0x116d('0x3b')]['length']?_0xf3b2c2[_0x116d('0x3b')]:_0x21bc9b[_0x116d('0x3a')];_0xf3b2c2['order']=qs[_0x116d('0x3e')](_0x51a6f1[_0x116d('0x37')][_0x116d('0x3e')]);_0xf3b2c2[_0x116d('0x3f')]=qs['filters'](_[_0x116d('0x40')](_0x51a6f1['query'],_0x21bc9b[_0x116d('0x38')]));if(_0x51a6f1[_0x116d('0x37')][_0x116d('0x41')]){_0xf3b2c2[_0x116d('0x3f')]=_[_0x116d('0x42')](_0xf3b2c2[_0x116d('0x3f')],{'$or':_[_0x116d('0x31')](_0xf3b2c2[_0x116d('0x3b')],function(_0x2b0eff){var _0x42f61f={};_0x42f61f[_0x2b0eff]={'$like':'%'+_0x51a6f1[_0x116d('0x37')]['filter']+'%'};return _0x42f61f;})});}_0xf3b2c2=_[_0x116d('0x42')]({},_0xf3b2c2,_0x51a6f1[_0x116d('0x44')]);return _0xa321ab[_0x116d('0x92')](_0xf3b2c2);}})[_0x116d('0x27')](function(_0x4f9357){if(_0x4f9357){_0x229d9e=_0x4f9357[_0x116d('0x4b')];if(!_0x51a6f1[_0x116d('0x37')]['hasOwnProperty'](_0x116d('0x60'))){_0xf3b2c2[_0x116d('0x20')]=qs[_0x116d('0x20')](_0x51a6f1[_0x116d('0x37')]['limit']);_0xf3b2c2[_0x116d('0x1e')]=qs['offset'](_0x51a6f1[_0x116d('0x37')][_0x116d('0x1e')]);}return _0xa321ab[_0x116d('0x92')](_0xf3b2c2);}})[_0x116d('0x27')](function(_0x4c3a5b){if(_0x4c3a5b){return _0x4c3a5b?{'count':_0x229d9e,'rows':_0x4c3a5b}:null;}})[_0x116d('0x27')](respondWithResult(_0x215665,null))[_0x116d('0x4d')](handleError(_0x215665,null));};exports[_0x116d('0x93')]=function(_0x48046d,_0x52efa5,_0x323cf3){var _0x52bd60,_0x28436e;var _0x193b2e=[];var _0x5dbf4a=moment()[_0x116d('0x94')](_0x116d('0x95'));return db[_0x116d('0x32')]['find']({'where':{'id':_0x48046d[_0x116d('0x4a')]['id']}})[_0x116d('0x27')](handleEntityNotFound(_0x52efa5,null))[_0x116d('0x27')](function(_0x57d8e1){if(_0x57d8e1){_0x28436e=_0x57d8e1;return _0x57d8e1[_0x116d('0x93')](_0x48046d[_0x116d('0x5a')]['ids'],_[_0x116d('0x57')](_0x48046d[_0x116d('0x5a')],[_0x116d('0x6b'),'id'])||{});}return null;})[_0x116d('0x96')](function(_0x164563){var _0x16f66f;var _0x2e4351;_0x52bd60=_0x164563||[];var _0x8e5c3a=[];if(_0x164563){for(var _0x41c52f=0x0;_0x41c52f<_0x164563[_0x116d('0x4b')];_0x41c52f+=0x1){var _0x1272db=_0x164563[_0x41c52f][_0x116d('0x29')]({'plain':!![]});_0x16f66f=squel[_0x116d('0x6d')]()[_0x116d('0x6e')](_0x116d('0x97'))[_0x116d('0x70')](['phone','ContactId',_0x116d('0x73'),_0x116d('0x61'),_0x116d('0x58'),_0x116d('0x59')],squel[_0x116d('0x74')]()[_0x116d('0x75')]('phone',_0x116d('0x71'))[_0x116d('0x75')]('id',_0x116d('0x72'))[_0x116d('0x75')](_0x1272db['CmListId'][_0x116d('0x79')](),_0x116d('0x73'))[_0x116d('0x75')](_0x48046d[_0x116d('0x4a')]['id']['toString'](),_0x116d('0x61'))['field'](_0x116d('0x76'),_0x116d('0x58'))[_0x116d('0x75')](_0x116d('0x76'),_0x116d('0x59'))[_0x116d('0x7a')](_0x116d('0x7b'))[_0x116d('0x3f')](_0x116d('0x7c'))[_0x116d('0x3f')]('ListId\x20=\x20?',_0x1272db[_0x116d('0x78')][_0x116d('0x79')]())['where'](_0x116d('0x7e')))[_0x116d('0x79')]();_0x8e5c3a[_0x116d('0x8e')](db['sequelize'][_0x116d('0x37')](_0x16f66f));}return BPromise[_0x116d('0x90')](_0x8e5c3a);}})[_0x116d('0x27')](function(){return _0x52bd60;})['then'](respondWithResult(_0x52efa5,null))[_0x116d('0x4d')](handleError(_0x52efa5,null));};exports['removeBlackLists']=function(_0x33d394,_0x371097,_0x3156d9){return db[_0x116d('0x32')][_0x116d('0x4c')]({'where':{'id':_0x33d394['params']['id']}})[_0x116d('0x27')](handleEntityNotFound(_0x371097,null))[_0x116d('0x27')](function(_0x32a566){if(_0x32a566){return _0x32a566[_0x116d('0x98')](_0x33d394[_0x116d('0x37')][_0x116d('0x6b')]);}})[_0x116d('0x27')](function(_0x4841e8){if(_0x4841e8){return db[_0x116d('0x67')][_0x116d('0x28')]({'where':{'ListId':_0x33d394[_0x116d('0x37')]['ids'],'CampaignId':_0x33d394['params']['id']}})[_0x116d('0x27')](function(){return _0x4841e8;});}})[_0x116d('0x27')](respondWithStatusCode(_0x371097,null))[_0x116d('0x4d')](handleError(_0x371097,null));};
\ No newline at end of file
index c8a4953..ba543f6 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(_0x5dc1cb,_0x1dd487){var _0x5df13f=function(_0x20a271){while(--_0x20a271){_0x5dc1cb['push'](_0x5dc1cb['shift']());}};_0x5df13f(++_0x1dd487);}(_0x7a54,0x106));var _0x47a5=function(_0x4eed6c,_0x55c573){_0x4eed6c=_0x4eed6c-0x0;var _0x37ec5d=_0x7a54[_0x4eed6c];return _0x37ec5d;};'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(_0xdb9db5,_0x16cb80){var _0x35c68f=function(_0x26117c){while(--_0x26117c){_0xdb9db5['push'](_0xdb9db5['shift']());}};_0x35c68f(++_0x16cb80);}(_0x7a54,0x106));var _0x47a5=function(_0x2822ff,_0x115d25){_0x2822ff=_0x2822ff-0x0;var _0x38a45f=_0x7a54[_0x2822ff];return _0x38a45f;};'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 3ada73f..9dfcc48 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4849=['catch','GetCampaign','Campaign','findAll','options','attributes','limit','include','model','map','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','then','info','Campaign,\x20%s,\x20%s','debug','Campaign,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x39d6f1,_0x1a160c){var _0x2b4bb1=function(_0x45a04f){while(--_0x45a04f){_0x39d6f1['push'](_0x39d6f1['shift']());}};_0x2b4bb1(++_0x1a160c);}(_0x4849,0x86));var _0x9484=function(_0x30f85e,_0x479e45){_0x30f85e=_0x30f85e-0x0;var _0x11189d=_0x4849[_0x30f85e];return _0x11189d;};'use strict';var _=require(_0x9484('0x0'));var util=require(_0x9484('0x1'));var moment=require('moment');var BPromise=require(_0x9484('0x2'));var rs=require(_0x9484('0x3'));var fs=require('fs');var Redis=require(_0x9484('0x4'));var db=require(_0x9484('0x5'))['db'];var utils=require(_0x9484('0x6'));var logger=require(_0x9484('0x7'))(_0x9484('0x8'));var config=require('../../config/environment');var jayson=require(_0x9484('0x9'));var client=jayson[_0x9484('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1ed772,_0x163a82,_0x3cdf53){return new BPromise(function(_0x387fb5,_0x2433e2){return client['request'](_0x1ed772,_0x3cdf53)[_0x9484('0xb')](function(_0x1bea3b){logger[_0x9484('0xc')](_0x9484('0xd'),_0x163a82,'request\x20sent');logger[_0x9484('0xe')](_0x9484('0xf'),_0x163a82,_0x9484('0x10'),JSON[_0x9484('0x11')](_0x1bea3b));if(_0x1bea3b[_0x9484('0x12')]){if(_0x1bea3b[_0x9484('0x12')][_0x9484('0x13')]===0x1f4){logger['error'](_0x9484('0xd'),_0x163a82,_0x1bea3b[_0x9484('0x12')]['message']);return _0x2433e2(_0x1bea3b['error'][_0x9484('0x14')]);}logger[_0x9484('0x12')](_0x9484('0xd'),_0x163a82,_0x1bea3b[_0x9484('0x12')][_0x9484('0x14')]);return _0x387fb5(_0x1bea3b[_0x9484('0x12')][_0x9484('0x14')]);}else{logger[_0x9484('0xc')](_0x9484('0xd'),_0x163a82,_0x9484('0x10'));_0x387fb5(_0x1bea3b['result'][_0x9484('0x14')]);}})[_0x9484('0x15')](function(_0x58dab8){logger[_0x9484('0x12')](_0x9484('0xd'),_0x163a82,_0x58dab8);_0x2433e2(_0x58dab8);});});}exports[_0x9484('0x16')]=function(_0x44dce6){var _0x13585d=this;return new Promise(function(_0x515320,_0x228bbc){return db[_0x9484('0x17')][_0x9484('0x18')]({'raw':_0x44dce6[_0x9484('0x19')]?_0x44dce6[_0x9484('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x44dce6[_0x9484('0x19')]?_0x44dce6[_0x9484('0x19')]['where']||null:null,'attributes':_0x44dce6[_0x9484('0x19')]?_0x44dce6['options'][_0x9484('0x1a')]||null:null,'limit':_0x44dce6[_0x9484('0x19')]?_0x44dce6[_0x9484('0x19')][_0x9484('0x1b')]||null:null,'include':_0x44dce6[_0x9484('0x19')]?_0x44dce6[_0x9484('0x19')][_0x9484('0x1c')]?_['map'](_0x44dce6['options']['include'],function(_0x5b4143){return{'model':db[_0x5b4143[_0x9484('0x1d')]],'as':_0x5b4143['as'],'attributes':_0x5b4143[_0x9484('0x1a')],'include':_0x5b4143[_0x9484('0x1c')]?_[_0x9484('0x1e')](_0x5b4143[_0x9484('0x1c')],function(_0xec2e98){return{'model':db[_0xec2e98['model']],'as':_0xec2e98['as'],'attributes':_0xec2e98[_0x9484('0x1a')],'include':_0xec2e98['include']?_['map'](_0xec2e98['include'],function(_0x11d5dc){return{'model':db[_0x11d5dc[_0x9484('0x1d')]],'as':_0x11d5dc['as'],'attributes':_0x11d5dc[_0x9484('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x9484('0xb')](function(_0x4de9d7){logger[_0x9484('0xc')](_0x9484('0x16'),_0x44dce6);logger[_0x9484('0xe')]('GetCampaign',_0x44dce6,JSON['stringify'](_0x4de9d7));_0x515320(_0x4de9d7);})['catch'](function(_0x1cd898){logger[_0x9484('0x12')](_0x9484('0x16'),_0x1cd898['message'],_0x44dce6);_0x228bbc(_0x13585d[_0x9484('0x12')](0x1f4,_0x1cd898[_0x9484('0x14')]));});});};
\ No newline at end of file
+var _0x0269=['moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','then','info','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','Campaign,\x20%s,\x20%s','message','result','catch','GetCampaign','Campaign','findAll','options','where','attributes','limit','include','model','map','lodash'];(function(_0x52666e,_0x5b3776){var _0x515330=function(_0x29cd4f){while(--_0x29cd4f){_0x52666e['push'](_0x52666e['shift']());}};_0x515330(++_0x5b3776);}(_0x0269,0x135));var _0x9026=function(_0x37bca8,_0x2fb3ac){_0x37bca8=_0x37bca8-0x0;var _0x40eb58=_0x0269[_0x37bca8];return _0x40eb58;};'use strict';var _=require(_0x9026('0x0'));var util=require('util');var moment=require(_0x9026('0x1'));var BPromise=require('bluebird');var rs=require(_0x9026('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9026('0x3'))['db'];var utils=require(_0x9026('0x4'));var logger=require(_0x9026('0x5'))(_0x9026('0x6'));var config=require('../../config/environment');var jayson=require(_0x9026('0x7'));var client=jayson[_0x9026('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x540056,_0x97c0c3,_0x1a212f){return new BPromise(function(_0x1149ad,_0xd97c29){return client['request'](_0x540056,_0x1a212f)[_0x9026('0x9')](function(_0x1a238a){logger[_0x9026('0xa')]('Campaign,\x20%s,\x20%s',_0x97c0c3,_0x9026('0xb'));logger[_0x9026('0xc')](_0x9026('0xd'),_0x97c0c3,'request\x20sent',JSON[_0x9026('0xe')](_0x1a238a));if(_0x1a238a['error']){if(_0x1a238a[_0x9026('0xf')][_0x9026('0x10')]===0x1f4){logger[_0x9026('0xf')](_0x9026('0x11'),_0x97c0c3,_0x1a238a[_0x9026('0xf')][_0x9026('0x12')]);return _0xd97c29(_0x1a238a[_0x9026('0xf')]['message']);}logger[_0x9026('0xf')]('Campaign,\x20%s,\x20%s',_0x97c0c3,_0x1a238a[_0x9026('0xf')][_0x9026('0x12')]);return _0x1149ad(_0x1a238a[_0x9026('0xf')][_0x9026('0x12')]);}else{logger[_0x9026('0xa')](_0x9026('0x11'),_0x97c0c3,_0x9026('0xb'));_0x1149ad(_0x1a238a[_0x9026('0x13')]['message']);}})[_0x9026('0x14')](function(_0x2b9834){logger['error'](_0x9026('0x11'),_0x97c0c3,_0x2b9834);_0xd97c29(_0x2b9834);});});}exports[_0x9026('0x15')]=function(_0x15b3ab){var _0x4e37d0=this;return new Promise(function(_0x1d1613,_0x3e57f7){return db[_0x9026('0x16')][_0x9026('0x17')]({'raw':_0x15b3ab['options']?_0x15b3ab[_0x9026('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x15b3ab[_0x9026('0x18')]?_0x15b3ab['options'][_0x9026('0x19')]||null:null,'attributes':_0x15b3ab[_0x9026('0x18')]?_0x15b3ab[_0x9026('0x18')][_0x9026('0x1a')]||null:null,'limit':_0x15b3ab[_0x9026('0x18')]?_0x15b3ab[_0x9026('0x18')][_0x9026('0x1b')]||null:null,'include':_0x15b3ab[_0x9026('0x18')]?_0x15b3ab[_0x9026('0x18')]['include']?_['map'](_0x15b3ab[_0x9026('0x18')][_0x9026('0x1c')],function(_0x2968fb){return{'model':db[_0x2968fb[_0x9026('0x1d')]],'as':_0x2968fb['as'],'attributes':_0x2968fb[_0x9026('0x1a')],'include':_0x2968fb[_0x9026('0x1c')]?_[_0x9026('0x1e')](_0x2968fb[_0x9026('0x1c')],function(_0x775596){return{'model':db[_0x775596[_0x9026('0x1d')]],'as':_0x775596['as'],'attributes':_0x775596[_0x9026('0x1a')],'include':_0x775596[_0x9026('0x1c')]?_[_0x9026('0x1e')](_0x775596[_0x9026('0x1c')],function(_0x28dba4){return{'model':db[_0x28dba4[_0x9026('0x1d')]],'as':_0x28dba4['as'],'attributes':_0x28dba4[_0x9026('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x9026('0x9')](function(_0x2fae98){logger['info'](_0x9026('0x15'),_0x15b3ab);logger[_0x9026('0xc')](_0x9026('0x15'),_0x15b3ab,JSON[_0x9026('0xe')](_0x2fae98));_0x1d1613(_0x2fae98);})[_0x9026('0x14')](function(_0x3cead8){logger[_0x9026('0xf')](_0x9026('0x15'),_0x3cead8[_0x9026('0x12')],_0x15b3ab);_0x3e57f7(_0x4e37d0[_0x9026('0xf')](0x1f4,_0x3cead8[_0x9026('0x12')]));});});};
\ No newline at end of file
index 0c8a3bf..d9a00b8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xec9a=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','getLists','getBlackLists','post','create','clone','/:id/lists','addLists','/:id/blacklists','addBlackLists','put','delete','destroy','removeLists','exports','multer','util'];(function(_0x5bbb0a,_0x34b481){var _0x443e82=function(_0x4fbd29){while(--_0x4fbd29){_0x5bbb0a['push'](_0x5bbb0a['shift']());}};_0x443e82(++_0x34b481);}(_0xec9a,0x196));var _0xaec9=function(_0x109c8b,_0x1867ed){_0x109c8b=_0x109c8b-0x0;var _0x9324=_0xec9a[_0x109c8b];return _0x9324;};'use strict';var multer=require(_0xaec9('0x0'));var util=require(_0xaec9('0x1'));var path=require('path');var timeout=require(_0xaec9('0x2'));var express=require('express');var router=express[_0xaec9('0x3')]();var fs_extra=require(_0xaec9('0x4'));var auth=require(_0xaec9('0x5'));var interaction=require(_0xaec9('0x6'));var config=require(_0xaec9('0x7'));var controller=require(_0xaec9('0x8'));router[_0xaec9('0x9')]('/',auth[_0xaec9('0xa')](),controller['index']);router[_0xaec9('0x9')](_0xaec9('0xb'),auth[_0xaec9('0xa')](),controller[_0xaec9('0xc')]);router[_0xaec9('0x9')](_0xaec9('0xd'),auth[_0xaec9('0xa')](),controller[_0xaec9('0xe')]);router['get'](_0xaec9('0xf'),auth[_0xaec9('0xa')](),controller['getHopperHistories']);router[_0xaec9('0x9')](_0xaec9('0x10'),auth[_0xaec9('0xa')](),controller[_0xaec9('0x11')]);router['get'](_0xaec9('0x12'),auth[_0xaec9('0xa')](),controller[_0xaec9('0x13')]);router[_0xaec9('0x9')]('/:id/lists',auth[_0xaec9('0xa')](),controller[_0xaec9('0x14')]);router['get']('/:id/blacklists',auth[_0xaec9('0xa')](),controller[_0xaec9('0x15')]);router[_0xaec9('0x16')]('/',auth[_0xaec9('0xa')](),controller[_0xaec9('0x17')]);router['post']('/:id/clone',auth[_0xaec9('0xa')](),controller[_0xaec9('0x18')]);router[_0xaec9('0x16')](_0xaec9('0x19'),auth[_0xaec9('0xa')](),controller[_0xaec9('0x1a')]);router[_0xaec9('0x16')](_0xaec9('0x1b'),auth[_0xaec9('0xa')](),controller[_0xaec9('0x1c')]);router[_0xaec9('0x1d')](_0xaec9('0xb'),auth['isAuthenticated'](),controller['update']);router[_0xaec9('0x1e')](_0xaec9('0xb'),auth[_0xaec9('0xa')](),controller[_0xaec9('0x1f')]);router['delete'](_0xaec9('0x19'),auth[_0xaec9('0xa')](),controller[_0xaec9('0x20')]);router[_0xaec9('0x1e')](_0xaec9('0x1b'),auth[_0xaec9('0xa')](),controller['removeBlackLists']);module[_0xaec9('0x21')]=router;
\ No newline at end of file
+var _0x28ff=['getHopperFinals','getHopperBlacks','/:id/lists','getLists','post','/:id/clone','clone','addLists','/:id/blacklists','addBlackLists','put','delete','removeLists','removeBlackLists','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./campaign.controller','index','get','/:id','isAuthenticated','show','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals'];(function(_0x516b5d,_0x5a0ee0){var _0x28be8e=function(_0x3573c2){while(--_0x3573c2){_0x516b5d['push'](_0x516b5d['shift']());}};_0x28be8e(++_0x5a0ee0);}(_0x28ff,0x138));var _0xf28f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x28ff[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0xf28f('0x0'));var path=require(_0xf28f('0x1'));var timeout=require(_0xf28f('0x2'));var express=require(_0xf28f('0x3'));var router=express[_0xf28f('0x4')]();var fs_extra=require(_0xf28f('0x5'));var auth=require(_0xf28f('0x6'));var interaction=require(_0xf28f('0x7'));var config=require('../../config/environment');var controller=require(_0xf28f('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xf28f('0x9')]);router[_0xf28f('0xa')](_0xf28f('0xb'),auth[_0xf28f('0xc')](),controller[_0xf28f('0xd')]);router[_0xf28f('0xa')](_0xf28f('0xe'),auth[_0xf28f('0xc')](),controller[_0xf28f('0xf')]);router[_0xf28f('0xa')](_0xf28f('0x10'),auth['isAuthenticated'](),controller['getHopperHistories']);router[_0xf28f('0xa')](_0xf28f('0x11'),auth['isAuthenticated'](),controller[_0xf28f('0x12')]);router[_0xf28f('0xa')]('/:id/hopper_black',auth[_0xf28f('0xc')](),controller[_0xf28f('0x13')]);router['get'](_0xf28f('0x14'),auth[_0xf28f('0xc')](),controller[_0xf28f('0x15')]);router['get']('/:id/blacklists',auth[_0xf28f('0xc')](),controller['getBlackLists']);router[_0xf28f('0x16')]('/',auth['isAuthenticated'](),controller['create']);router[_0xf28f('0x16')](_0xf28f('0x17'),auth['isAuthenticated'](),controller[_0xf28f('0x18')]);router[_0xf28f('0x16')](_0xf28f('0x14'),auth[_0xf28f('0xc')](),controller[_0xf28f('0x19')]);router[_0xf28f('0x16')](_0xf28f('0x1a'),auth[_0xf28f('0xc')](),controller[_0xf28f('0x1b')]);router[_0xf28f('0x1c')](_0xf28f('0xb'),auth[_0xf28f('0xc')](),controller['update']);router[_0xf28f('0x1d')](_0xf28f('0xb'),auth['isAuthenticated'](),controller['destroy']);router[_0xf28f('0x1d')](_0xf28f('0x14'),auth[_0xf28f('0xc')](),controller[_0xf28f('0x1e')]);router['delete'](_0xf28f('0x1a'),auth['isAuthenticated'](),controller[_0xf28f('0x1f')]);module[_0xf28f('0x20')]=router;
\ No newline at end of file
index da403b3..d22604d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9156=['STRING','TEXT','VIRTUAL','exports'];(function(_0x474bc0,_0x26989c){var _0x4b24cf=function(_0x4be866){while(--_0x4be866){_0x474bc0['push'](_0x474bc0['shift']());}};_0x4b24cf(++_0x26989c);}(_0x9156,0x7f));var _0x6915=function(_0x3ee026,_0x5dbab7){_0x3ee026=_0x3ee026-0x0;var _0x5da522=_0x9156[_0x3ee026];return _0x5da522;};'use strict';var Sequelize=require('sequelize');module[_0x6915('0x0')]={'key':{'type':Sequelize[_0x6915('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0x6915('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x6915('0x3')],'get':function(){return this['getDataValue']('key');}}};
\ No newline at end of file
+var _0x57b2=['key','sequelize','STRING','TEXT','getDataValue'];(function(_0x8e7fb0,_0x3453c1){var _0x2d20b9=function(_0x3075a8){while(--_0x3075a8){_0x8e7fb0['push'](_0x8e7fb0['shift']());}};_0x2d20b9(++_0x3453c1);}(_0x57b2,0x150));var _0x257b=function(_0x2ba5d2,_0x14ef5c){_0x2ba5d2=_0x2ba5d2-0x0;var _0x5d9933=_0x57b2[_0x2ba5d2];return _0x5d9933;};'use strict';var Sequelize=require(_0x257b('0x0'));module['exports']={'key':{'type':Sequelize[_0x257b('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0x257b('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x257b('0x1')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x257b('0x3')](_0x257b('0x4'));}}};
\ No newline at end of file
index b8768ff..8807730 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa352=['status','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','get','UserProfileResource','destroy','end','error','stack','name','send','index','CannedAnswer','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','includeAll','findAll','rows','show','params','length','options','find','catch','update','body','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','The\x20inserted\x20key\x20already\x20exists.','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','CannedAnswers','userProfileId','autoAssociation','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','sendStatus'];(function(_0x4a7228,_0x38a45e){var _0x91b7a3=function(_0x60cd55){while(--_0x60cd55){_0x4a7228['push'](_0x4a7228['shift']());}};_0x91b7a3(++_0x38a45e);}(_0xa352,0x9a));var _0x2a35=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0xa352[_0x4ea69d];return _0x5318e0;};'use strict';var emlformat=require(_0x2a35('0x0'));var rimraf=require(_0x2a35('0x1'));var zipdir=require(_0x2a35('0x2'));var jsonpatch=require(_0x2a35('0x3'));var rp=require(_0x2a35('0x4'));var moment=require(_0x2a35('0x5'));var BPromise=require(_0x2a35('0x6'));var Mustache=require(_0x2a35('0x7'));var util=require(_0x2a35('0x8'));var path=require('path');var sox=require(_0x2a35('0x9'));var csv=require('to-csv');var ejs=require(_0x2a35('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x2a35('0xb'));var crypto=require('crypto');var jsforce=require(_0x2a35('0xc'));var deskjs=require(_0x2a35('0xd'));var toCsv=require(_0x2a35('0xe'));var querystring=require('querystring');var Papa=require(_0x2a35('0xf'));var Redis=require(_0x2a35('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x2a35('0x11'));var as=require(_0x2a35('0x12'));var hardwareService=require(_0x2a35('0x13'));var logger=require('../../config/logger')(_0x2a35('0x14'));var utils=require(_0x2a35('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x2a35('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x521958,_0x39a837){_0x39a837=_0x39a837||0xcc;return function(_0x5ed7e9){if(_0x5ed7e9){return _0x521958[_0x2a35('0x17')](_0x39a837);}return _0x521958[_0x2a35('0x18')](_0x39a837)['end']();};}function respondWithResult(_0x278367,_0x3ccab0){_0x3ccab0=_0x3ccab0||0xc8;return function(_0x59d90d){if(_0x59d90d){return _0x278367[_0x2a35('0x18')](_0x3ccab0)[_0x2a35('0x19')](_0x59d90d);}};}function respondWithFilteredResult(_0xfdf2a8,_0x59400d){return function(_0x584ade){if(_0x584ade){var _0x580532=typeof _0x59400d[_0x2a35('0x1a')]===_0x2a35('0x1b')&&typeof _0x59400d[_0x2a35('0x1c')]===_0x2a35('0x1b');var _0x44d3eb=_0x584ade[_0x2a35('0x1d')];var _0x38a2de=_0x580532?0x0:_0x59400d[_0x2a35('0x1a')];var _0x143d87=_0x580532?_0x584ade[_0x2a35('0x1d')]:_0x59400d[_0x2a35('0x1a')]+_0x59400d[_0x2a35('0x1c')];var _0x36009b;if(_0x143d87>=_0x44d3eb){_0x143d87=_0x44d3eb;_0x36009b=0xc8;}else{_0x36009b=0xce;}_0xfdf2a8[_0x2a35('0x18')](_0x36009b);return _0xfdf2a8[_0x2a35('0x1e')](_0x2a35('0x1f'),_0x38a2de+'-'+_0x143d87+'/'+_0x44d3eb)['json'](_0x584ade);}return null;};}function patchUpdates(_0x1d7f3d){return function(_0xbd1cb5){try{jsonpatch['apply'](_0xbd1cb5,_0x1d7f3d,!![]);}catch(_0x420a84){return BPromise[_0x2a35('0x20')](_0x420a84);}return _0xbd1cb5[_0x2a35('0x21')]();};}function saveUpdates(_0x355e44,_0x595523){return function(_0x4019c5){if(_0x4019c5){return _0x4019c5['update'](_0x355e44)[_0x2a35('0x22')](function(_0x2165a4){return _0x2165a4;});}return null;};}function removeEntity(_0x3d56c1,_0x4dba2b){return function(_0x4a8374){if(_0x4a8374){return _0x4a8374['destroy']()[_0x2a35('0x22')](function(){var _0x19ef50=_0x4a8374[_0x2a35('0x23')]({'plain':!![]});var _0x3645f7='CannedAnswers';return db[_0x2a35('0x24')][_0x2a35('0x25')]({'where':{'type':_0x3645f7,'resourceId':_0x19ef50['id']}})[_0x2a35('0x22')](function(){return _0x4a8374;});})[_0x2a35('0x22')](function(){_0x3d56c1[_0x2a35('0x18')](0xcc)[_0x2a35('0x26')]();});}};}function handleEntityNotFound(_0x562d57,_0xa6bb30){return function(_0x49da8c){if(!_0x49da8c){_0x562d57['sendStatus'](0x194);}return _0x49da8c;};}function handleError(_0x5ecc9e,_0xef5c8b){_0xef5c8b=_0xef5c8b||0x1f4;return function(_0x581fb7){logger[_0x2a35('0x27')](_0x581fb7[_0x2a35('0x28')]);if(_0x581fb7[_0x2a35('0x29')]){delete _0x581fb7[_0x2a35('0x29')];}_0x5ecc9e[_0x2a35('0x18')](_0xef5c8b)[_0x2a35('0x2a')](_0x581fb7);};}exports[_0x2a35('0x2b')]=function(_0x1988cb,_0x182a14){var _0x3168e6={},_0x3f8758={},_0x39de9b={'count':0x0,'rows':[]};var _0x32a189=_['map'](db[_0x2a35('0x2c')][_0x2a35('0x2d')],function(_0x52ce4c){return{'name':_0x52ce4c[_0x2a35('0x2e')],'type':_0x52ce4c[_0x2a35('0x2f')][_0x2a35('0x30')]};});_0x3f8758[_0x2a35('0x31')]=_[_0x2a35('0x32')](_0x32a189,_0x2a35('0x29'));_0x3f8758[_0x2a35('0x33')]=_[_0x2a35('0x34')](_0x1988cb[_0x2a35('0x33')]);_0x3f8758[_0x2a35('0x35')]=_[_0x2a35('0x36')](_0x3f8758[_0x2a35('0x31')],_0x3f8758[_0x2a35('0x33')]);_0x3168e6[_0x2a35('0x37')]=_[_0x2a35('0x36')](_0x3f8758['model'],qs[_0x2a35('0x38')](_0x1988cb[_0x2a35('0x33')]['fields']));_0x3168e6['attributes']=_0x3168e6['attributes']['length']?_0x3168e6[_0x2a35('0x37')]:_0x3f8758[_0x2a35('0x31')];if(!_0x1988cb[_0x2a35('0x33')][_0x2a35('0x39')](_0x2a35('0x3a'))){_0x3168e6[_0x2a35('0x1c')]=qs['limit'](_0x1988cb[_0x2a35('0x33')][_0x2a35('0x1c')]);_0x3168e6[_0x2a35('0x1a')]=qs[_0x2a35('0x1a')](_0x1988cb[_0x2a35('0x33')][_0x2a35('0x1a')]);}_0x3168e6[_0x2a35('0x3b')]=qs[_0x2a35('0x3c')](_0x1988cb['query'][_0x2a35('0x3c')]);_0x3168e6[_0x2a35('0x3d')]=qs[_0x2a35('0x35')](_[_0x2a35('0x3e')](_0x1988cb[_0x2a35('0x33')],_0x3f8758[_0x2a35('0x35')]),_0x32a189);if(_0x1988cb[_0x2a35('0x33')]['filter']){_0x3168e6[_0x2a35('0x3d')]=_[_0x2a35('0x3f')](_0x3168e6[_0x2a35('0x3d')],{'$or':[{'key':{'$like':'%'+_0x1988cb['query'][_0x2a35('0x40')]+'%'}},{'value':{'$like':'%'+_0x1988cb[_0x2a35('0x33')][_0x2a35('0x40')]+'%'}}]});}_0x3168e6=_[_0x2a35('0x3f')]({},_0x3168e6,_0x1988cb['options']);var _0x4b3e40={'where':_0x3168e6[_0x2a35('0x3d')]};return db[_0x2a35('0x2c')][_0x2a35('0x1d')](_0x4b3e40)[_0x2a35('0x22')](function(_0x3981c5){_0x39de9b[_0x2a35('0x1d')]=_0x3981c5;if(_0x1988cb[_0x2a35('0x33')][_0x2a35('0x41')]){_0x3168e6['include']=[{'all':!![]}];}return db[_0x2a35('0x2c')][_0x2a35('0x42')](_0x3168e6);})[_0x2a35('0x22')](function(_0x5df4e6){_0x39de9b[_0x2a35('0x43')]=_0x5df4e6;return _0x39de9b;})[_0x2a35('0x22')](respondWithFilteredResult(_0x182a14,_0x3168e6))['catch'](handleError(_0x182a14,null));};exports[_0x2a35('0x44')]=function(_0x4007ea,_0x174ce1){var _0x1f09e9={'raw':!![],'where':{'id':_0x4007ea[_0x2a35('0x45')]['id']}},_0x41d0f4={};_0x41d0f4['model']=_['keys'](db[_0x2a35('0x2c')][_0x2a35('0x2d')]);_0x41d0f4[_0x2a35('0x33')]=_[_0x2a35('0x34')](_0x4007ea[_0x2a35('0x33')]);_0x41d0f4[_0x2a35('0x35')]=_[_0x2a35('0x36')](_0x41d0f4[_0x2a35('0x31')],_0x41d0f4['query']);_0x1f09e9[_0x2a35('0x37')]=_[_0x2a35('0x36')](_0x41d0f4['model'],qs['fields'](_0x4007ea['query']['fields']));_0x1f09e9[_0x2a35('0x37')]=_0x1f09e9[_0x2a35('0x37')][_0x2a35('0x46')]?_0x1f09e9['attributes']:_0x41d0f4[_0x2a35('0x31')];if(_0x4007ea[_0x2a35('0x33')][_0x2a35('0x41')]){_0x1f09e9['include']=[{'all':!![]}];}_0x1f09e9=_[_0x2a35('0x3f')]({},_0x1f09e9,_0x4007ea[_0x2a35('0x47')]);return db[_0x2a35('0x2c')][_0x2a35('0x48')](_0x1f09e9)[_0x2a35('0x22')](handleEntityNotFound(_0x174ce1,null))[_0x2a35('0x22')](respondWithResult(_0x174ce1,null))[_0x2a35('0x49')](handleError(_0x174ce1,null));};exports[_0x2a35('0x4a')]=function(_0x3a2ecd,_0x2bf8df){if(_0x3a2ecd['body']['id']){delete _0x3a2ecd[_0x2a35('0x4b')]['id'];}return db[_0x2a35('0x2c')][_0x2a35('0x48')]({'where':{'id':_0x3a2ecd[_0x2a35('0x45')]['id']}})[_0x2a35('0x22')](handleEntityNotFound(_0x2bf8df,null))[_0x2a35('0x22')](saveUpdates(_0x3a2ecd['body'],null))[_0x2a35('0x22')](respondWithResult(_0x2bf8df,null))['catch'](handleError(_0x2bf8df,null));};exports[_0x2a35('0x25')]=function(_0x26455f,_0x1cc5ac){return db['CannedAnswer'][_0x2a35('0x48')]({'where':{'id':_0x26455f[_0x2a35('0x45')]['id']}})[_0x2a35('0x22')](handleEntityNotFound(_0x1cc5ac,null))['then'](removeEntity(_0x1cc5ac,null))[_0x2a35('0x49')](handleError(_0x1cc5ac,null));};exports['create']=function(_0x15d43d,_0x5221c1){var _0xb91a76={'key':_0x15d43d['body'][_0x2a35('0x30')]};if(_0x15d43d[_0x2a35('0x4b')][_0x2a35('0x4c')]){_0xb91a76[_0x2a35('0x4c')]=_0x15d43d[_0x2a35('0x4b')][_0x2a35('0x4c')];}else if(_0x15d43d[_0x2a35('0x4b')][_0x2a35('0x4d')]){_0xb91a76[_0x2a35('0x4d')]=_0x15d43d[_0x2a35('0x4b')][_0x2a35('0x4d')];}else if(_0x15d43d[_0x2a35('0x4b')][_0x2a35('0x4e')]){_0xb91a76[_0x2a35('0x4e')]=_0x15d43d['body']['OpenchannelAccountId'];}else if(_0x15d43d[_0x2a35('0x4b')]['ChatWebsiteId']){_0xb91a76[_0x2a35('0x4f')]=_0x15d43d[_0x2a35('0x4b')]['ChatWebsiteId'];}return db[_0x2a35('0x2c')]['find']({'where':_0xb91a76})[_0x2a35('0x22')](function(_0x1319c9){if(_0x1319c9){throw new db['Sequelize']['ValidationError'](_0x2a35('0x50'));}return db[_0x2a35('0x2c')][_0x2a35('0x51')](_0x15d43d['body']);})[_0x2a35('0x22')](function(_0x3947ee){var _0x27f973=_0x15d43d[_0x2a35('0x52')][_0x2a35('0x23')]({'plain':!![]});if(!_0x27f973)throw new Error(_0x2a35('0x53'));if(_0x27f973[_0x2a35('0x54')]===_0x2a35('0x52')){var _0x44d672=_0x3947ee[_0x2a35('0x23')]({'plain':!![]});return db[_0x2a35('0x55')][_0x2a35('0x48')]({'where':{'name':_0x2a35('0x56'),'userProfileId':_0x27f973[_0x2a35('0x57')]},'raw':!![]})[_0x2a35('0x22')](function(_0x37fa75){if(_0x37fa75&&_0x37fa75[_0x2a35('0x58')]===0x0){return db[_0x2a35('0x24')]['create']({'name':_0x44d672['name'],'resourceId':_0x44d672['id'],'type':_0x37fa75[_0x2a35('0x29')],'sectionId':_0x37fa75['id']},{})['then'](function(){return _0x3947ee;});}else{return _0x3947ee;}})[_0x2a35('0x49')](function(_0x3f32d5){logger[_0x2a35('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3f32d5);throw _0x3f32d5;});}return _0x3947ee;})[_0x2a35('0x22')](respondWithResult(_0x5221c1,0xc9))[_0x2a35('0x49')](handleError(_0x5221c1,null));};
\ No newline at end of file
+var _0xa986=['mustache','path','to-csv','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','get','CannedAnswers','UserProfileResource','error','name','send','index','CannedAnswer','rawAttributes','fieldName','type','key','model','map','query','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filters','filter','merge','includeAll','findAll','rows','catch','show','params','keys','length','options','find','body','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','request-promise','bluebird'];(function(_0x59416f,_0x24068d){var _0x5cd23a=function(_0x5174f7){while(--_0x5174f7){_0x59416f['push'](_0x59416f['shift']());}};_0x5cd23a(++_0x24068d);}(_0xa986,0x1ee));var _0x6a98=function(_0x4342b4,_0x157ddf){_0x4342b4=_0x4342b4-0x0;var _0x13e947=_0xa986[_0x4342b4];return _0x13e947;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6a98('0x0'));var zipdir=require(_0x6a98('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6a98('0x2'));var moment=require('moment');var BPromise=require(_0x6a98('0x3'));var Mustache=require(_0x6a98('0x4'));var util=require('util');var path=require(_0x6a98('0x5'));var sox=require('sox');var csv=require(_0x6a98('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6a98('0x7'));var squel=require(_0x6a98('0x8'));var crypto=require('crypto');var jsforce=require(_0x6a98('0x9'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6a98('0xa'));var Papa=require(_0x6a98('0xb'));var Redis=require('ioredis');var authService=require(_0x6a98('0xc'));var qs=require('../../components/parsers/qs');var as=require(_0x6a98('0xd'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6a98('0xe'))(_0x6a98('0xf'));var utils=require(_0x6a98('0x10'));var config=require(_0x6a98('0x11'));var licenseUtil=require('../../config/license/util');var db=require(_0x6a98('0x12'))['db'];function respondWithStatusCode(_0xe97200,_0x15013a){_0x15013a=_0x15013a||0xcc;return function(_0x53ae3d){if(_0x53ae3d){return _0xe97200[_0x6a98('0x13')](_0x15013a);}return _0xe97200[_0x6a98('0x14')](_0x15013a)[_0x6a98('0x15')]();};}function respondWithResult(_0x356100,_0x3b2faf){_0x3b2faf=_0x3b2faf||0xc8;return function(_0x416eac){if(_0x416eac){return _0x356100[_0x6a98('0x14')](_0x3b2faf)[_0x6a98('0x16')](_0x416eac);}};}function respondWithFilteredResult(_0x233241,_0x5ea882){return function(_0x101fc0){if(_0x101fc0){var _0x4b61d5=typeof _0x5ea882[_0x6a98('0x17')]===_0x6a98('0x18')&&typeof _0x5ea882[_0x6a98('0x19')]===_0x6a98('0x18');var _0x52177=_0x101fc0[_0x6a98('0x1a')];var _0x3b290a=_0x4b61d5?0x0:_0x5ea882[_0x6a98('0x17')];var _0x1e8de9=_0x4b61d5?_0x101fc0['count']:_0x5ea882[_0x6a98('0x17')]+_0x5ea882[_0x6a98('0x19')];var _0x3d3fef;if(_0x1e8de9>=_0x52177){_0x1e8de9=_0x52177;_0x3d3fef=0xc8;}else{_0x3d3fef=0xce;}_0x233241[_0x6a98('0x14')](_0x3d3fef);return _0x233241[_0x6a98('0x1b')]('Content-Range',_0x3b290a+'-'+_0x1e8de9+'/'+_0x52177)[_0x6a98('0x16')](_0x101fc0);}return null;};}function patchUpdates(_0x43fd58){return function(_0x193b2a){try{jsonpatch[_0x6a98('0x1c')](_0x193b2a,_0x43fd58,!![]);}catch(_0x351dff){return BPromise[_0x6a98('0x1d')](_0x351dff);}return _0x193b2a[_0x6a98('0x1e')]();};}function saveUpdates(_0x5777af,_0x4ca9f4){return function(_0x4427de){if(_0x4427de){return _0x4427de[_0x6a98('0x1f')](_0x5777af)[_0x6a98('0x20')](function(_0x114c3b){return _0x114c3b;});}return null;};}function removeEntity(_0x128f47,_0x292233){return function(_0x5ef0fd){if(_0x5ef0fd){return _0x5ef0fd[_0x6a98('0x21')]()[_0x6a98('0x20')](function(){var _0x19ec84=_0x5ef0fd[_0x6a98('0x22')]({'plain':!![]});var _0x4ad6f3=_0x6a98('0x23');return db[_0x6a98('0x24')][_0x6a98('0x21')]({'where':{'type':_0x4ad6f3,'resourceId':_0x19ec84['id']}})[_0x6a98('0x20')](function(){return _0x5ef0fd;});})[_0x6a98('0x20')](function(){_0x128f47[_0x6a98('0x14')](0xcc)[_0x6a98('0x15')]();});}};}function handleEntityNotFound(_0x188734,_0x5b5b1f){return function(_0x2184bb){if(!_0x2184bb){_0x188734[_0x6a98('0x13')](0x194);}return _0x2184bb;};}function handleError(_0x2f6dd6,_0x51f158){_0x51f158=_0x51f158||0x1f4;return function(_0x1ef0c3){logger[_0x6a98('0x25')](_0x1ef0c3['stack']);if(_0x1ef0c3[_0x6a98('0x26')]){delete _0x1ef0c3['name'];}_0x2f6dd6[_0x6a98('0x14')](_0x51f158)[_0x6a98('0x27')](_0x1ef0c3);};}exports[_0x6a98('0x28')]=function(_0x7ad977,_0x23e24c){var _0xdaa70={},_0x3b387f={},_0x16b108={'count':0x0,'rows':[]};var _0x57896a=_['map'](db[_0x6a98('0x29')][_0x6a98('0x2a')],function(_0x5f0a8c){return{'name':_0x5f0a8c[_0x6a98('0x2b')],'type':_0x5f0a8c[_0x6a98('0x2c')][_0x6a98('0x2d')]};});_0x3b387f[_0x6a98('0x2e')]=_[_0x6a98('0x2f')](_0x57896a,_0x6a98('0x26'));_0x3b387f[_0x6a98('0x30')]=_['keys'](_0x7ad977[_0x6a98('0x30')]);_0x3b387f['filters']=_[_0x6a98('0x31')](_0x3b387f[_0x6a98('0x2e')],_0x3b387f[_0x6a98('0x30')]);_0xdaa70[_0x6a98('0x32')]=_[_0x6a98('0x31')](_0x3b387f[_0x6a98('0x2e')],qs[_0x6a98('0x33')](_0x7ad977[_0x6a98('0x30')]['fields']));_0xdaa70['attributes']=_0xdaa70['attributes']['length']?_0xdaa70[_0x6a98('0x32')]:_0x3b387f['model'];if(!_0x7ad977[_0x6a98('0x30')][_0x6a98('0x34')]('nolimit')){_0xdaa70[_0x6a98('0x19')]=qs['limit'](_0x7ad977[_0x6a98('0x30')]['limit']);_0xdaa70[_0x6a98('0x17')]=qs[_0x6a98('0x17')](_0x7ad977[_0x6a98('0x30')][_0x6a98('0x17')]);}_0xdaa70[_0x6a98('0x35')]=qs['sort'](_0x7ad977[_0x6a98('0x30')][_0x6a98('0x36')]);_0xdaa70[_0x6a98('0x37')]=qs['filters'](_[_0x6a98('0x38')](_0x7ad977['query'],_0x3b387f[_0x6a98('0x39')]),_0x57896a);if(_0x7ad977[_0x6a98('0x30')][_0x6a98('0x3a')]){_0xdaa70['where']=_['merge'](_0xdaa70[_0x6a98('0x37')],{'$or':[{'key':{'$like':'%'+_0x7ad977[_0x6a98('0x30')][_0x6a98('0x3a')]+'%'}},{'value':{'$like':'%'+_0x7ad977[_0x6a98('0x30')][_0x6a98('0x3a')]+'%'}}]});}_0xdaa70=_[_0x6a98('0x3b')]({},_0xdaa70,_0x7ad977['options']);var _0x3698ef={'where':_0xdaa70[_0x6a98('0x37')]};return db[_0x6a98('0x29')][_0x6a98('0x1a')](_0x3698ef)[_0x6a98('0x20')](function(_0x2cca33){_0x16b108[_0x6a98('0x1a')]=_0x2cca33;if(_0x7ad977[_0x6a98('0x30')][_0x6a98('0x3c')]){_0xdaa70['include']=[{'all':!![]}];}return db[_0x6a98('0x29')][_0x6a98('0x3d')](_0xdaa70);})[_0x6a98('0x20')](function(_0x47b33c){_0x16b108[_0x6a98('0x3e')]=_0x47b33c;return _0x16b108;})[_0x6a98('0x20')](respondWithFilteredResult(_0x23e24c,_0xdaa70))[_0x6a98('0x3f')](handleError(_0x23e24c,null));};exports[_0x6a98('0x40')]=function(_0xc6e39c,_0x1df41f){var _0x4fe5b7={'raw':!![],'where':{'id':_0xc6e39c[_0x6a98('0x41')]['id']}},_0x1328f6={};_0x1328f6['model']=_[_0x6a98('0x42')](db[_0x6a98('0x29')][_0x6a98('0x2a')]);_0x1328f6['query']=_[_0x6a98('0x42')](_0xc6e39c[_0x6a98('0x30')]);_0x1328f6[_0x6a98('0x39')]=_[_0x6a98('0x31')](_0x1328f6['model'],_0x1328f6['query']);_0x4fe5b7[_0x6a98('0x32')]=_[_0x6a98('0x31')](_0x1328f6[_0x6a98('0x2e')],qs[_0x6a98('0x33')](_0xc6e39c['query']['fields']));_0x4fe5b7['attributes']=_0x4fe5b7['attributes'][_0x6a98('0x43')]?_0x4fe5b7[_0x6a98('0x32')]:_0x1328f6[_0x6a98('0x2e')];if(_0xc6e39c[_0x6a98('0x30')][_0x6a98('0x3c')]){_0x4fe5b7['include']=[{'all':!![]}];}_0x4fe5b7=_['merge']({},_0x4fe5b7,_0xc6e39c[_0x6a98('0x44')]);return db[_0x6a98('0x29')][_0x6a98('0x45')](_0x4fe5b7)['then'](handleEntityNotFound(_0x1df41f,null))['then'](respondWithResult(_0x1df41f,null))[_0x6a98('0x3f')](handleError(_0x1df41f,null));};exports[_0x6a98('0x1f')]=function(_0x1b45bc,_0x212056){if(_0x1b45bc[_0x6a98('0x46')]['id']){delete _0x1b45bc[_0x6a98('0x46')]['id'];}return db['CannedAnswer'][_0x6a98('0x45')]({'where':{'id':_0x1b45bc['params']['id']}})[_0x6a98('0x20')](handleEntityNotFound(_0x212056,null))[_0x6a98('0x20')](saveUpdates(_0x1b45bc['body'],null))[_0x6a98('0x20')](respondWithResult(_0x212056,null))[_0x6a98('0x3f')](handleError(_0x212056,null));};exports[_0x6a98('0x21')]=function(_0x2aef2b,_0x5c636d){return db[_0x6a98('0x29')][_0x6a98('0x45')]({'where':{'id':_0x2aef2b[_0x6a98('0x41')]['id']}})['then'](handleEntityNotFound(_0x5c636d,null))[_0x6a98('0x20')](removeEntity(_0x5c636d,null))[_0x6a98('0x3f')](handleError(_0x5c636d,null));};exports['create']=function(_0x1a0505,_0x25b8ac){var _0x1f7a4b={'key':_0x1a0505[_0x6a98('0x46')][_0x6a98('0x2d')]};if(_0x1a0505[_0x6a98('0x46')][_0x6a98('0x47')]){_0x1f7a4b[_0x6a98('0x47')]=_0x1a0505[_0x6a98('0x46')]['MailAccountId'];}else if(_0x1a0505['body'][_0x6a98('0x48')]){_0x1f7a4b[_0x6a98('0x48')]=_0x1a0505[_0x6a98('0x46')][_0x6a98('0x48')];}else if(_0x1a0505[_0x6a98('0x46')][_0x6a98('0x49')]){_0x1f7a4b['OpenchannelAccountId']=_0x1a0505[_0x6a98('0x46')][_0x6a98('0x49')];}else if(_0x1a0505['body'][_0x6a98('0x4a')]){_0x1f7a4b['ChatWebsiteId']=_0x1a0505[_0x6a98('0x46')][_0x6a98('0x4a')];}return db[_0x6a98('0x29')]['find']({'where':_0x1f7a4b})[_0x6a98('0x20')](function(_0x3d3c1f){if(_0x3d3c1f){throw new db[(_0x6a98('0x4b'))][(_0x6a98('0x4c'))](_0x6a98('0x4d'));}return db[_0x6a98('0x29')]['create'](_0x1a0505[_0x6a98('0x46')]);})['then'](function(_0xca9153){var _0x2fd526=_0x1a0505[_0x6a98('0x4e')]['get']({'plain':!![]});if(!_0x2fd526)throw new Error(_0x6a98('0x4f'));if(_0x2fd526['role']==='user'){var _0x32440b=_0xca9153[_0x6a98('0x22')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':'CannedAnswers','userProfileId':_0x2fd526[_0x6a98('0x50')]},'raw':!![]})[_0x6a98('0x20')](function(_0x460009){if(_0x460009&&_0x460009['autoAssociation']===0x0){return db['UserProfileResource'][_0x6a98('0x51')]({'name':_0x32440b[_0x6a98('0x26')],'resourceId':_0x32440b['id'],'type':_0x460009[_0x6a98('0x26')],'sectionId':_0x460009['id']},{})[_0x6a98('0x20')](function(){return _0xca9153;});}else{return _0xca9153;}})['catch'](function(_0x36d39e){logger[_0x6a98('0x25')](_0x6a98('0x52'),_0x36d39e);throw _0x36d39e;});}return _0xca9153;})[_0x6a98('0x20')](respondWithResult(_0x25b8ac,0xc9))[_0x6a98('0x3f')](handleError(_0x25b8ac,null));};
\ No newline at end of file
index de12153..cf85ecb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1e06=['../../config/logger','bluebird','path','rimraf','../../config/environment','./cannedAnswer.attributes','exports','define','CannedAnswer','tools_canned_answers','utf8mb4','lodash','util'];(function(_0x56f6e3,_0x58c45c){var _0x2b27ad=function(_0x332a1f){while(--_0x332a1f){_0x56f6e3['push'](_0x56f6e3['shift']());}};_0x2b27ad(++_0x58c45c);}(_0x1e06,0x73));var _0x61e0=function(_0x282c12,_0x189c40){_0x282c12=_0x282c12-0x0;var _0x3f61e7=_0x1e06[_0x282c12];return _0x3f61e7;};'use strict';var _=require(_0x61e0('0x0'));var util=require(_0x61e0('0x1'));var logger=require(_0x61e0('0x2'))('api');var moment=require('moment');var BPromise=require(_0x61e0('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x61e0('0x4'));var rimraf=require(_0x61e0('0x5'));var config=require(_0x61e0('0x6'));var attributes=require(_0x61e0('0x7'));module[_0x61e0('0x8')]=function(_0x30f7d9,_0x37b341){return _0x30f7d9[_0x61e0('0x9')](_0x61e0('0xa'),attributes,{'tableName':_0x61e0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x61e0('0xc'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x9d3f=['utf8mb4','utf8mb4_unicode_ci','util','api','moment','bluebird','rimraf','../../config/environment','./cannedAnswer.attributes','define','CannedAnswer','tools_canned_answers'];(function(_0x1e814b,_0x4262ac){var _0x13456c=function(_0x205d42){while(--_0x205d42){_0x1e814b['push'](_0x1e814b['shift']());}};_0x13456c(++_0x4262ac);}(_0x9d3f,0x18e));var _0xf9d3=function(_0x17d011,_0x441407){_0x17d011=_0x17d011-0x0;var _0x4c754a=_0x9d3f[_0x17d011];return _0x4c754a;};'use strict';var _=require('lodash');var util=require(_0xf9d3('0x0'));var logger=require('../../config/logger')(_0xf9d3('0x1'));var moment=require(_0xf9d3('0x2'));var BPromise=require(_0xf9d3('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xf9d3('0x4'));var config=require(_0xf9d3('0x5'));var attributes=require(_0xf9d3('0x6'));module['exports']=function(_0x29d4ef,_0x273ef5){return _0x29d4ef[_0xf9d3('0x7')](_0xf9d3('0x8'),attributes,{'tableName':_0xf9d3('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf9d3('0xa'),'collate':_0xf9d3('0xb')});};
\ No newline at end of file
index da44496..14852d4 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(_0x1670c7,_0x39d84a){var _0x279b10=function(_0x5d65a8){while(--_0x5d65a8){_0x1670c7['push'](_0x1670c7['shift']());}};_0x279b10(++_0x39d84a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0xa9e0[_0x32d457];return _0x338386;};'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(_0xe431fd,_0x437ce0){var _0x80aee5=function(_0x3bb191){while(--_0x3bb191){_0xe431fd['push'](_0xe431fd['shift']());}};_0x80aee5(++_0x437ce0);}(_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
index bf8267f..20dfc0d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2c84=['express','Router','fs-extra','../../components/auth/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','path'];(function(_0x12399e,_0x124066){var _0x3f0dab=function(_0x453dd7){while(--_0x453dd7){_0x12399e['push'](_0x12399e['shift']());}};_0x3f0dab(++_0x124066);}(_0x2c84,0x76));var _0x42c8=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x2c84[_0x432682];return _0x463d05;};'use strict';var multer=require(_0x42c8('0x0'));var util=require('util');var path=require(_0x42c8('0x1'));var timeout=require('connect-timeout');var express=require(_0x42c8('0x2'));var router=express[_0x42c8('0x3')]();var fs_extra=require(_0x42c8('0x4'));var auth=require(_0x42c8('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x42c8('0x6'));var controller=require(_0x42c8('0x7'));router[_0x42c8('0x8')]('/',auth[_0x42c8('0x9')](),controller[_0x42c8('0xa')]);router['get'](_0x42c8('0xb'),auth['isAuthenticated'](),controller[_0x42c8('0xc')]);router[_0x42c8('0xd')]('/',auth['isAuthenticated'](),controller[_0x42c8('0xe')]);router[_0x42c8('0xf')]('/:id',auth[_0x42c8('0x9')](),controller[_0x42c8('0x10')]);router[_0x42c8('0x11')](_0x42c8('0xb'),auth[_0x42c8('0x9')](),controller[_0x42c8('0x12')]);module[_0x42c8('0x13')]=router;
\ No newline at end of file
+var _0x74b7=['index','/:id','show','update','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated'];(function(_0x2157fe,_0x4f7ac4){var _0x55a8ef=function(_0x2ef1dc){while(--_0x2ef1dc){_0x2157fe['push'](_0x2157fe['shift']());}};_0x55a8ef(++_0x4f7ac4);}(_0x74b7,0x174));var _0x774b=function(_0x1eb7d4,_0x11bbf7){_0x1eb7d4=_0x1eb7d4-0x0;var _0xce6879=_0x74b7[_0x1eb7d4];return _0xce6879;};'use strict';var multer=require(_0x774b('0x0'));var util=require(_0x774b('0x1'));var path=require(_0x774b('0x2'));var timeout=require(_0x774b('0x3'));var express=require('express');var router=express[_0x774b('0x4')]();var fs_extra=require(_0x774b('0x5'));var auth=require(_0x774b('0x6'));var interaction=require(_0x774b('0x7'));var config=require(_0x774b('0x8'));var controller=require(_0x774b('0x9'));router[_0x774b('0xa')]('/',auth[_0x774b('0xb')](),controller[_0x774b('0xc')]);router[_0x774b('0xa')](_0x774b('0xd'),auth[_0x774b('0xb')](),controller[_0x774b('0xe')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x774b('0xd'),auth[_0x774b('0xb')](),controller[_0x774b('0xf')]);router['delete'](_0x774b('0xd'),auth[_0x774b('0xb')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 33b6df0..9bad500 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe50e=['sequelize','STRING','INTEGER'];(function(_0x4f764a,_0x314898){var _0xab6e7=function(_0x45006a){while(--_0x45006a){_0x4f764a['push'](_0x4f764a['shift']());}};_0xab6e7(++_0x314898);}(_0xe50e,0xf9));var _0xee50=function(_0x548500,_0x25424b){_0x548500=_0x548500-0x0;var _0x4df2d7=_0xe50e[_0x548500];return _0x4df2d7;};'use strict';var Sequelize=require(_0xee50('0x0'));module['exports']={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize[_0xee50('0x1')]},'src':{'type':Sequelize[_0xee50('0x1')]},'dst':{'type':Sequelize[_0xee50('0x1')]},'dcontext':{'type':Sequelize[_0xee50('0x1')]},'channel':{'type':Sequelize[_0xee50('0x1')]},'dstchannel':{'type':Sequelize[_0xee50('0x1')]},'lastapp':{'type':Sequelize[_0xee50('0x1')]},'lastdata':{'type':Sequelize[_0xee50('0x1')]},'duration':{'type':Sequelize[_0xee50('0x2')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xee50('0x2')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xee50('0x1')]},'amaflags':{'type':Sequelize[_0xee50('0x2')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xee50('0x1')]},'userfield':{'type':Sequelize[_0xee50('0x1')]},'uniqueid':{'type':Sequelize[_0xee50('0x1')]},'linkedid':{'type':Sequelize[_0xee50('0x1')]},'sequence':{'type':Sequelize[_0xee50('0x1')]},'peeraccount':{'type':Sequelize[_0xee50('0x1')]},'type':{'type':Sequelize[_0xee50('0x1')]},'tag':{'type':Sequelize[_0xee50('0x1')]}};
\ No newline at end of file
+var _0x18e0=['STRING','INTEGER','exports','1970-01-01\x2000:00:01'];(function(_0xd33936,_0x1ffe76){var _0x899e0a=function(_0x3129c1){while(--_0x3129c1){_0xd33936['push'](_0xd33936['shift']());}};_0x899e0a(++_0x1ffe76);}(_0x18e0,0xa2));var _0x018e=function(_0x368fb9,_0x1a9895){_0x368fb9=_0x368fb9-0x0;var _0x4892fb=_0x18e0[_0x368fb9];return _0x4892fb;};'use strict';var Sequelize=require('sequelize');module[_0x018e('0x0')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0x018e('0x1')},'clid':{'type':Sequelize[_0x018e('0x2')]},'src':{'type':Sequelize[_0x018e('0x2')]},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize[_0x018e('0x2')]},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize[_0x018e('0x2')]},'lastdata':{'type':Sequelize[_0x018e('0x2')]},'duration':{'type':Sequelize[_0x018e('0x3')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x018e('0x3')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x018e('0x2')]},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x018e('0x2')]},'linkedid':{'type':Sequelize[_0x018e('0x2')]},'sequence':{'type':Sequelize[_0x018e('0x2')]},'peeraccount':{'type':Sequelize[_0x018e('0x2')]},'type':{'type':Sequelize[_0x018e('0x2')]},'tag':{'type':Sequelize[_0x018e('0x2')]}};
\ No newline at end of file
index 607c408..da97343 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x24ca=['squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','destroy','then','error','send','index','map','Cdr','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','name','merge','options','includeAll','include','findAll','show','params','length','find','catch','create','update','body','describe','eml-format','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv'];(function(_0x49fad7,_0x1e4cf0){var _0x248e94=function(_0x5f28d3){while(--_0x5f28d3){_0x49fad7['push'](_0x49fad7['shift']());}};_0x248e94(++_0x1e4cf0);}(_0x24ca,0x8c));var _0xa24c=function(_0x264545,_0x214037){_0x264545=_0x264545-0x0;var _0x114d10=_0x24ca[_0x264545];return _0x114d10;};'use strict';var emlformat=require(_0xa24c('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xa24c('0x1'));var rp=require('request-promise');var moment=require(_0xa24c('0x2'));var BPromise=require(_0xa24c('0x3'));var Mustache=require(_0xa24c('0x4'));var util=require('util');var path=require(_0xa24c('0x5'));var sox=require(_0xa24c('0x6'));var csv=require(_0xa24c('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xa24c('0x8'));var crypto=require(_0xa24c('0x9'));var jsforce=require(_0xa24c('0xa'));var deskjs=require(_0xa24c('0xb'));var toCsv=require(_0xa24c('0x7'));var querystring=require(_0xa24c('0xc'));var Papa=require('papaparse');var Redis=require(_0xa24c('0xd'));var authService=require(_0xa24c('0xe'));var qs=require(_0xa24c('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xa24c('0x10'))(_0xa24c('0x11'));var utils=require(_0xa24c('0x12'));var config=require(_0xa24c('0x13'));var licenseUtil=require(_0xa24c('0x14'));var db=require(_0xa24c('0x15'))['db'];function respondWithStatusCode(_0x566313,_0x5bb631){_0x5bb631=_0x5bb631||0xcc;return function(_0x4907f6){if(_0x4907f6){return _0x566313[_0xa24c('0x16')](_0x5bb631);}return _0x566313[_0xa24c('0x17')](_0x5bb631)[_0xa24c('0x18')]();};}function respondWithResult(_0x9fe9e3,_0x4351a8){_0x4351a8=_0x4351a8||0xc8;return function(_0x4971af){if(_0x4971af){return _0x9fe9e3[_0xa24c('0x17')](_0x4351a8)['json'](_0x4971af);}};}function respondWithFilteredResult(_0x493bcb,_0x588acf){return function(_0x2e8dc9){if(_0x2e8dc9){var _0x2a4270=typeof _0x588acf[_0xa24c('0x19')]===_0xa24c('0x1a')&&typeof _0x588acf[_0xa24c('0x1b')]===_0xa24c('0x1a');var _0x2197da=_0x2e8dc9[_0xa24c('0x1c')];var _0x14f0aa=_0x2a4270?0x0:_0x588acf[_0xa24c('0x19')];var _0x1970fc=_0x2a4270?_0x2e8dc9[_0xa24c('0x1c')]:_0x588acf[_0xa24c('0x19')]+_0x588acf[_0xa24c('0x1b')];var _0x5276b6;if(_0x1970fc>=_0x2197da){_0x1970fc=_0x2197da;_0x5276b6=0xc8;}else{_0x5276b6=0xce;}_0x493bcb[_0xa24c('0x17')](_0x5276b6);return _0x493bcb['set'](_0xa24c('0x1d'),_0x14f0aa+'-'+_0x1970fc+'/'+_0x2197da)[_0xa24c('0x1e')](_0x2e8dc9);}return null;};}function patchUpdates(_0x8c3949){return function(_0x37e20e){try{jsonpatch[_0xa24c('0x1f')](_0x37e20e,_0x8c3949,!![]);}catch(_0x416dea){return BPromise[_0xa24c('0x20')](_0x416dea);}return _0x37e20e[_0xa24c('0x21')]();};}function saveUpdates(_0xba710,_0x2ec5ad){return function(_0x2b471a){if(_0x2b471a){return _0x2b471a['update'](_0xba710)['then'](function(_0x10fa25){return _0x10fa25;});}return null;};}function removeEntity(_0xdd32a8,_0x316a68){return function(_0x1a04ff){if(_0x1a04ff){return _0x1a04ff[_0xa24c('0x22')]()[_0xa24c('0x23')](function(){_0xdd32a8[_0xa24c('0x17')](0xcc)[_0xa24c('0x18')]();});}};}function handleEntityNotFound(_0x304d6c,_0x4dc3dc){return function(_0x2290e1){if(!_0x2290e1){_0x304d6c['sendStatus'](0x194);}return _0x2290e1;};}function handleError(_0x1f347b,_0x256fbc){_0x256fbc=_0x256fbc||0x1f4;return function(_0x471421){logger[_0xa24c('0x24')](_0x471421['stack']);if(_0x471421['name']){delete _0x471421['name'];}_0x1f347b['status'](_0x256fbc)[_0xa24c('0x25')](_0x471421);};}exports[_0xa24c('0x26')]=function(_0xab6197,_0x1cdee4){var _0x37cbd3={},_0x5361d4={},_0x5c8113={'count':0x0,'rows':[]};var _0x33c208=_[_0xa24c('0x27')](db[_0xa24c('0x28')][_0xa24c('0x29')],function(_0x4566dc){return{'name':_0x4566dc[_0xa24c('0x2a')],'type':_0x4566dc[_0xa24c('0x2b')][_0xa24c('0x2c')]};});_0x5361d4[_0xa24c('0x2d')]=_[_0xa24c('0x27')](_0x33c208,'name');_0x5361d4[_0xa24c('0x2e')]=_[_0xa24c('0x2f')](_0xab6197['query']);_0x5361d4[_0xa24c('0x30')]=_[_0xa24c('0x31')](_0x5361d4[_0xa24c('0x2d')],_0x5361d4[_0xa24c('0x2e')]);_0x37cbd3[_0xa24c('0x32')]=_[_0xa24c('0x31')](_0x5361d4[_0xa24c('0x2d')],qs[_0xa24c('0x33')](_0xab6197[_0xa24c('0x2e')][_0xa24c('0x33')]));_0x37cbd3['attributes']=_0x37cbd3['attributes']['length']?_0x37cbd3[_0xa24c('0x32')]:_0x5361d4['model'];if(!_0xab6197[_0xa24c('0x2e')][_0xa24c('0x34')](_0xa24c('0x35'))){_0x37cbd3['limit']=qs[_0xa24c('0x1b')](_0xab6197[_0xa24c('0x2e')][_0xa24c('0x1b')]);_0x37cbd3['offset']=qs[_0xa24c('0x19')](_0xab6197[_0xa24c('0x2e')]['offset']);}_0x37cbd3[_0xa24c('0x36')]=qs[_0xa24c('0x37')](_0xab6197[_0xa24c('0x2e')]['sort']);_0x37cbd3[_0xa24c('0x38')]=qs[_0xa24c('0x30')](_[_0xa24c('0x39')](_0xab6197[_0xa24c('0x2e')],_0x5361d4[_0xa24c('0x30')]),_0x33c208);if(_0xab6197['query'][_0xa24c('0x3a')]){_0x37cbd3[_0xa24c('0x38')]=_['merge'](_0x37cbd3[_0xa24c('0x38')],{'$or':_[_0xa24c('0x27')](_0x33c208,function(_0x2417d9){if(_0x2417d9['type']!=='VIRTUAL'){var _0x1f7535={};_0x1f7535[_0x2417d9[_0xa24c('0x3b')]]={'$like':'%'+_0xab6197[_0xa24c('0x2e')][_0xa24c('0x3a')]+'%'};return _0x1f7535;}})});}_0x37cbd3=_[_0xa24c('0x3c')]({},_0x37cbd3,_0xab6197[_0xa24c('0x3d')]);var _0x54ea40={'where':_0x37cbd3[_0xa24c('0x38')]};return db[_0xa24c('0x28')][_0xa24c('0x1c')](_0x54ea40)[_0xa24c('0x23')](function(_0x5f3cd4){_0x5c8113[_0xa24c('0x1c')]=_0x5f3cd4;if(_0xab6197[_0xa24c('0x2e')][_0xa24c('0x3e')]){_0x37cbd3[_0xa24c('0x3f')]=[{'all':!![]}];}return db[_0xa24c('0x28')][_0xa24c('0x40')](_0x37cbd3);})[_0xa24c('0x23')](function(_0x54939b){_0x5c8113['rows']=_0x54939b;return _0x5c8113;})[_0xa24c('0x23')](respondWithFilteredResult(_0x1cdee4,_0x37cbd3))['catch'](handleError(_0x1cdee4,null));};exports[_0xa24c('0x41')]=function(_0x4fae76,_0x32e151){var _0x214627={'raw':!![],'where':{'id':_0x4fae76[_0xa24c('0x42')]['id']}},_0x37372d={};_0x37372d[_0xa24c('0x2d')]=_[_0xa24c('0x2f')](db[_0xa24c('0x28')][_0xa24c('0x29')]);_0x37372d[_0xa24c('0x2e')]=_[_0xa24c('0x2f')](_0x4fae76[_0xa24c('0x2e')]);_0x37372d[_0xa24c('0x30')]=_[_0xa24c('0x31')](_0x37372d[_0xa24c('0x2d')],_0x37372d[_0xa24c('0x2e')]);_0x214627[_0xa24c('0x32')]=_['intersection'](_0x37372d[_0xa24c('0x2d')],qs[_0xa24c('0x33')](_0x4fae76[_0xa24c('0x2e')]['fields']));_0x214627[_0xa24c('0x32')]=_0x214627[_0xa24c('0x32')][_0xa24c('0x43')]?_0x214627[_0xa24c('0x32')]:_0x37372d['model'];if(_0x4fae76[_0xa24c('0x2e')][_0xa24c('0x3e')]){_0x214627[_0xa24c('0x3f')]=[{'all':!![]}];}_0x214627=_[_0xa24c('0x3c')]({},_0x214627,_0x4fae76[_0xa24c('0x3d')]);return db[_0xa24c('0x28')][_0xa24c('0x44')](_0x214627)[_0xa24c('0x23')](handleEntityNotFound(_0x32e151,null))[_0xa24c('0x23')](respondWithResult(_0x32e151,null))[_0xa24c('0x45')](handleError(_0x32e151,null));};exports[_0xa24c('0x46')]=function(_0xeac74f,_0x261c41){return db['Cdr'][_0xa24c('0x46')](_0xeac74f['body'],{})[_0xa24c('0x23')](respondWithResult(_0x261c41,0xc9))[_0xa24c('0x45')](handleError(_0x261c41,null));};exports[_0xa24c('0x47')]=function(_0x1641b8,_0xd4761e){if(_0x1641b8[_0xa24c('0x48')]['id']){delete _0x1641b8[_0xa24c('0x48')]['id'];}return db[_0xa24c('0x28')][_0xa24c('0x44')]({'where':{'id':_0x1641b8[_0xa24c('0x42')]['id']}})[_0xa24c('0x23')](handleEntityNotFound(_0xd4761e,null))[_0xa24c('0x23')](saveUpdates(_0x1641b8[_0xa24c('0x48')],null))['then'](respondWithResult(_0xd4761e,null))[_0xa24c('0x45')](handleError(_0xd4761e,null));};exports[_0xa24c('0x22')]=function(_0x3875fb,_0x456181){return db['Cdr'][_0xa24c('0x44')]({'where':{'id':_0x3875fb[_0xa24c('0x42')]['id']}})[_0xa24c('0x23')](handleEntityNotFound(_0x456181,null))['then'](removeEntity(_0x456181,null))['catch'](handleError(_0x456181,null));};exports[_0xa24c('0x49')]=function(_0x1c8980,_0x4992ee){return db[_0xa24c('0x28')][_0xa24c('0x49')]()['then'](respondWithResult(_0x4992ee,null))[_0xa24c('0x45')](handleError(_0x4992ee,null));};
\ No newline at end of file
+var _0xafdd=['pick','filter','merge','type','VIRTUAL','options','Cdr','includeAll','findAll','rows','catch','show','params','rawAttributes','intersection','include','find','create','body','update','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','ioredis','../../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','Content-Range','apply','reject','save','then','destroy','end','error','stack','name','send','fieldName','model','map','query','keys','filters','attributes','fields','hasOwnProperty','nolimit','sort','where'];(function(_0x37c22c,_0x28a70d){var _0x119d79=function(_0x243a13){while(--_0x243a13){_0x37c22c['push'](_0x37c22c['shift']());}};_0x119d79(++_0x28a70d);}(_0xafdd,0x19a));var _0xdafd=function(_0x28e5b3,_0x33c91d){_0x28e5b3=_0x28e5b3-0x0;var _0x24d7d5=_0xafdd[_0x28e5b3];return _0x24d7d5;};'use strict';var emlformat=require(_0xdafd('0x0'));var rimraf=require(_0xdafd('0x1'));var zipdir=require(_0xdafd('0x2'));var jsonpatch=require(_0xdafd('0x3'));var rp=require(_0xdafd('0x4'));var moment=require(_0xdafd('0x5'));var BPromise=require(_0xdafd('0x6'));var Mustache=require(_0xdafd('0x7'));var util=require('util');var path=require(_0xdafd('0x8'));var sox=require(_0xdafd('0x9'));var csv=require(_0xdafd('0xa'));var ejs=require(_0xdafd('0xb'));var fs=require('fs');var fs_extra=require(_0xdafd('0xc'));var _=require(_0xdafd('0xd'));var squel=require(_0xdafd('0xe'));var crypto=require('crypto');var jsforce=require(_0xdafd('0xf'));var deskjs=require(_0xdafd('0x10'));var toCsv=require(_0xdafd('0xa'));var querystring=require('querystring');var Papa=require(_0xdafd('0x11'));var Redis=require(_0xdafd('0x12'));var authService=require(_0xdafd('0x13'));var qs=require(_0xdafd('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdafd('0x15'));var logger=require(_0xdafd('0x16'))(_0xdafd('0x17'));var utils=require(_0xdafd('0x18'));var config=require(_0xdafd('0x19'));var licenseUtil=require(_0xdafd('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x166176,_0x594f47){_0x594f47=_0x594f47||0xcc;return function(_0x553508){if(_0x553508){return _0x166176[_0xdafd('0x1b')](_0x594f47);}return _0x166176[_0xdafd('0x1c')](_0x594f47)['end']();};}function respondWithResult(_0x43a716,_0x490382){_0x490382=_0x490382||0xc8;return function(_0x4b09da){if(_0x4b09da){return _0x43a716[_0xdafd('0x1c')](_0x490382)[_0xdafd('0x1d')](_0x4b09da);}};}function respondWithFilteredResult(_0x583b1d,_0x267bfc){return function(_0x186379){if(_0x186379){var _0x496515=typeof _0x267bfc[_0xdafd('0x1e')]===_0xdafd('0x1f')&&typeof _0x267bfc[_0xdafd('0x20')]==='undefined';var _0xb382ca=_0x186379[_0xdafd('0x21')];var _0x4fc3a4=_0x496515?0x0:_0x267bfc['offset'];var _0x2569b2=_0x496515?_0x186379['count']:_0x267bfc[_0xdafd('0x1e')]+_0x267bfc[_0xdafd('0x20')];var _0x1e64d3;if(_0x2569b2>=_0xb382ca){_0x2569b2=_0xb382ca;_0x1e64d3=0xc8;}else{_0x1e64d3=0xce;}_0x583b1d[_0xdafd('0x1c')](_0x1e64d3);return _0x583b1d[_0xdafd('0x22')](_0xdafd('0x23'),_0x4fc3a4+'-'+_0x2569b2+'/'+_0xb382ca)[_0xdafd('0x1d')](_0x186379);}return null;};}function patchUpdates(_0x42e0f9){return function(_0x8480a8){try{jsonpatch[_0xdafd('0x24')](_0x8480a8,_0x42e0f9,!![]);}catch(_0xee767e){return BPromise[_0xdafd('0x25')](_0xee767e);}return _0x8480a8[_0xdafd('0x26')]();};}function saveUpdates(_0xf4a521,_0x491d96){return function(_0x230495){if(_0x230495){return _0x230495['update'](_0xf4a521)[_0xdafd('0x27')](function(_0x5e96cc){return _0x5e96cc;});}return null;};}function removeEntity(_0x439bbf,_0x35ef78){return function(_0x7f10f6){if(_0x7f10f6){return _0x7f10f6[_0xdafd('0x28')]()[_0xdafd('0x27')](function(){_0x439bbf[_0xdafd('0x1c')](0xcc)[_0xdafd('0x29')]();});}};}function handleEntityNotFound(_0x30cba9,_0x3846dd){return function(_0x5cd11d){if(!_0x5cd11d){_0x30cba9[_0xdafd('0x1b')](0x194);}return _0x5cd11d;};}function handleError(_0x2ab575,_0x18554c){_0x18554c=_0x18554c||0x1f4;return function(_0x1feb5b){logger[_0xdafd('0x2a')](_0x1feb5b[_0xdafd('0x2b')]);if(_0x1feb5b[_0xdafd('0x2c')]){delete _0x1feb5b[_0xdafd('0x2c')];}_0x2ab575[_0xdafd('0x1c')](_0x18554c)[_0xdafd('0x2d')](_0x1feb5b);};}exports['index']=function(_0x243182,_0x14626b){var _0x13ab81={},_0x249743={},_0x21edb6={'count':0x0,'rows':[]};var _0x324f0f=_['map'](db['Cdr']['rawAttributes'],function(_0xcca4f){return{'name':_0xcca4f[_0xdafd('0x2e')],'type':_0xcca4f['type']['key']};});_0x249743[_0xdafd('0x2f')]=_[_0xdafd('0x30')](_0x324f0f,_0xdafd('0x2c'));_0x249743[_0xdafd('0x31')]=_[_0xdafd('0x32')](_0x243182[_0xdafd('0x31')]);_0x249743[_0xdafd('0x33')]=_['intersection'](_0x249743[_0xdafd('0x2f')],_0x249743[_0xdafd('0x31')]);_0x13ab81[_0xdafd('0x34')]=_['intersection'](_0x249743[_0xdafd('0x2f')],qs[_0xdafd('0x35')](_0x243182['query'][_0xdafd('0x35')]));_0x13ab81[_0xdafd('0x34')]=_0x13ab81[_0xdafd('0x34')]['length']?_0x13ab81[_0xdafd('0x34')]:_0x249743[_0xdafd('0x2f')];if(!_0x243182[_0xdafd('0x31')][_0xdafd('0x36')](_0xdafd('0x37'))){_0x13ab81[_0xdafd('0x20')]=qs[_0xdafd('0x20')](_0x243182['query'][_0xdafd('0x20')]);_0x13ab81[_0xdafd('0x1e')]=qs[_0xdafd('0x1e')](_0x243182[_0xdafd('0x31')][_0xdafd('0x1e')]);}_0x13ab81['order']=qs[_0xdafd('0x38')](_0x243182[_0xdafd('0x31')]['sort']);_0x13ab81[_0xdafd('0x39')]=qs[_0xdafd('0x33')](_[_0xdafd('0x3a')](_0x243182[_0xdafd('0x31')],_0x249743[_0xdafd('0x33')]),_0x324f0f);if(_0x243182[_0xdafd('0x31')][_0xdafd('0x3b')]){_0x13ab81[_0xdafd('0x39')]=_[_0xdafd('0x3c')](_0x13ab81[_0xdafd('0x39')],{'$or':_[_0xdafd('0x30')](_0x324f0f,function(_0x245163){if(_0x245163[_0xdafd('0x3d')]!==_0xdafd('0x3e')){var _0xb1e264={};_0xb1e264[_0x245163[_0xdafd('0x2c')]]={'$like':'%'+_0x243182[_0xdafd('0x31')][_0xdafd('0x3b')]+'%'};return _0xb1e264;}})});}_0x13ab81=_[_0xdafd('0x3c')]({},_0x13ab81,_0x243182[_0xdafd('0x3f')]);var _0x3f25c2={'where':_0x13ab81[_0xdafd('0x39')]};return db[_0xdafd('0x40')][_0xdafd('0x21')](_0x3f25c2)[_0xdafd('0x27')](function(_0x21d43d){_0x21edb6['count']=_0x21d43d;if(_0x243182['query'][_0xdafd('0x41')]){_0x13ab81['include']=[{'all':!![]}];}return db[_0xdafd('0x40')][_0xdafd('0x42')](_0x13ab81);})['then'](function(_0x4b463c){_0x21edb6[_0xdafd('0x43')]=_0x4b463c;return _0x21edb6;})[_0xdafd('0x27')](respondWithFilteredResult(_0x14626b,_0x13ab81))[_0xdafd('0x44')](handleError(_0x14626b,null));};exports[_0xdafd('0x45')]=function(_0xbc5159,_0x184a59){var _0x3a3a14={'raw':!![],'where':{'id':_0xbc5159[_0xdafd('0x46')]['id']}},_0x2417f8={};_0x2417f8['model']=_['keys'](db[_0xdafd('0x40')][_0xdafd('0x47')]);_0x2417f8[_0xdafd('0x31')]=_[_0xdafd('0x32')](_0xbc5159[_0xdafd('0x31')]);_0x2417f8[_0xdafd('0x33')]=_[_0xdafd('0x48')](_0x2417f8[_0xdafd('0x2f')],_0x2417f8[_0xdafd('0x31')]);_0x3a3a14[_0xdafd('0x34')]=_[_0xdafd('0x48')](_0x2417f8[_0xdafd('0x2f')],qs[_0xdafd('0x35')](_0xbc5159['query'][_0xdafd('0x35')]));_0x3a3a14['attributes']=_0x3a3a14[_0xdafd('0x34')]['length']?_0x3a3a14[_0xdafd('0x34')]:_0x2417f8[_0xdafd('0x2f')];if(_0xbc5159[_0xdafd('0x31')][_0xdafd('0x41')]){_0x3a3a14[_0xdafd('0x49')]=[{'all':!![]}];}_0x3a3a14=_[_0xdafd('0x3c')]({},_0x3a3a14,_0xbc5159['options']);return db[_0xdafd('0x40')][_0xdafd('0x4a')](_0x3a3a14)[_0xdafd('0x27')](handleEntityNotFound(_0x184a59,null))[_0xdafd('0x27')](respondWithResult(_0x184a59,null))[_0xdafd('0x44')](handleError(_0x184a59,null));};exports['create']=function(_0x48cc85,_0x189d61){return db[_0xdafd('0x40')][_0xdafd('0x4b')](_0x48cc85[_0xdafd('0x4c')],{})[_0xdafd('0x27')](respondWithResult(_0x189d61,0xc9))[_0xdafd('0x44')](handleError(_0x189d61,null));};exports[_0xdafd('0x4d')]=function(_0x2f5e4c,_0x2ae4cd){if(_0x2f5e4c['body']['id']){delete _0x2f5e4c[_0xdafd('0x4c')]['id'];}return db[_0xdafd('0x40')][_0xdafd('0x4a')]({'where':{'id':_0x2f5e4c[_0xdafd('0x46')]['id']}})['then'](handleEntityNotFound(_0x2ae4cd,null))[_0xdafd('0x27')](saveUpdates(_0x2f5e4c[_0xdafd('0x4c')],null))[_0xdafd('0x27')](respondWithResult(_0x2ae4cd,null))[_0xdafd('0x44')](handleError(_0x2ae4cd,null));};exports[_0xdafd('0x28')]=function(_0x4b6fbb,_0x5af1a8){return db[_0xdafd('0x40')][_0xdafd('0x4a')]({'where':{'id':_0x4b6fbb['params']['id']}})['then'](handleEntityNotFound(_0x5af1a8,null))[_0xdafd('0x27')](removeEntity(_0x5af1a8,null))[_0xdafd('0x44')](handleError(_0x5af1a8,null));};exports['describe']=function(_0x2dde06,_0x5dc9a0){return db[_0xdafd('0x40')]['describe']()['then'](respondWithResult(_0x5dc9a0,null))[_0xdafd('0x44')](handleError(_0x5dc9a0,null));};
\ No newline at end of file
index 12fdb77..ff7f640 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x57dec1,_0x256a77){var _0x2fd5f8=function(_0x3dfbfc){while(--_0x3dfbfc){_0x57dec1['push'](_0x57dec1['shift']());}};_0x2fd5f8(++_0x256a77);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x5bb2d8,_0x47a1db){var _0x19dc01=function(_0x205c45){while(--_0x205c45){_0x5bb2d8['push'](_0x5bb2d8['shift']());}};_0x19dc01(++_0x47a1db);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});};
\ No newline at end of file
index 6f84291..94c134c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb700=['result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','error','message','info'];(function(_0x37b546,_0x8c85de){var _0x24a3b5=function(_0x337bc5){while(--_0x337bc5){_0x37b546['push'](_0x37b546['shift']());}};_0x24a3b5(++_0x8c85de);}(_0xb700,0x7f));var _0x0b70=function(_0xe84805,_0x2702d9){_0xe84805=_0xe84805-0x0;var _0x398efd=_0xb700[_0xe84805];return _0x398efd;};'use strict';var _=require(_0x0b70('0x0'));var util=require(_0x0b70('0x1'));var moment=require('moment');var BPromise=require(_0x0b70('0x2'));var rs=require(_0x0b70('0x3'));var fs=require('fs');var Redis=require(_0x0b70('0x4'));var db=require(_0x0b70('0x5'))['db'];var utils=require(_0x0b70('0x6'));var logger=require(_0x0b70('0x7'))('rpc');var config=require(_0x0b70('0x8'));var jayson=require(_0x0b70('0x9'));var client=jayson[_0x0b70('0xa')][_0x0b70('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x55422e,_0x28fcf1,_0x69b509){return new BPromise(function(_0x4105d9,_0x15d8ba){return client['request'](_0x55422e,_0x69b509)[_0x0b70('0xc')](function(_0x1883fa){logger['info'](_0x0b70('0xd'),_0x28fcf1,_0x0b70('0xe'));logger[_0x0b70('0xf')](_0x0b70('0x10'),_0x28fcf1,'request\x20sent',JSON['stringify'](_0x1883fa));if(_0x1883fa['error']){if(_0x1883fa[_0x0b70('0x11')]['code']===0x1f4){logger[_0x0b70('0x11')](_0x0b70('0xd'),_0x28fcf1,_0x1883fa[_0x0b70('0x11')][_0x0b70('0x12')]);return _0x15d8ba(_0x1883fa[_0x0b70('0x11')]['message']);}logger['error'](_0x0b70('0xd'),_0x28fcf1,_0x1883fa[_0x0b70('0x11')]['message']);return _0x4105d9(_0x1883fa[_0x0b70('0x11')][_0x0b70('0x12')]);}else{logger[_0x0b70('0x13')]('Cdr,\x20%s,\x20%s',_0x28fcf1,'request\x20sent');_0x4105d9(_0x1883fa[_0x0b70('0x14')][_0x0b70('0x12')]);}})['catch'](function(_0x5ccc0e){logger['error'](_0x0b70('0xd'),_0x28fcf1,_0x5ccc0e);_0x15d8ba(_0x5ccc0e);});});}
\ No newline at end of file
+var _0x90ea=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Cdr,\x20%s,\x20%s','debug','request\x20sent','code','error','message','info','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x45d55e,_0x2fede3){var _0x29812a=function(_0x3c6830){while(--_0x3c6830){_0x45d55e['push'](_0x45d55e['shift']());}};_0x29812a(++_0x2fede3);}(_0x90ea,0xa3));var _0xa90e=function(_0x17fba1,_0x4533c1){_0x17fba1=_0x17fba1-0x0;var _0x5d95b1=_0x90ea[_0x17fba1];return _0x5d95b1;};'use strict';var _=require('lodash');var util=require(_0xa90e('0x0'));var moment=require('moment');var BPromise=require(_0xa90e('0x1'));var rs=require(_0xa90e('0x2'));var fs=require('fs');var Redis=require(_0xa90e('0x3'));var db=require(_0xa90e('0x4'))['db'];var utils=require(_0xa90e('0x5'));var logger=require(_0xa90e('0x6'))(_0xa90e('0x7'));var config=require(_0xa90e('0x8'));var jayson=require(_0xa90e('0x9'));var client=jayson[_0xa90e('0xa')][_0xa90e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1b2176,_0x2feb65,_0x4dece6){return new BPromise(function(_0xc2d625,_0x278c34){return client[_0xa90e('0xc')](_0x1b2176,_0x4dece6)[_0xa90e('0xd')](function(_0x30388a){logger['info'](_0xa90e('0xe'),_0x2feb65,'request\x20sent');logger[_0xa90e('0xf')]('Cdr,\x20%s,\x20%s,\x20%s',_0x2feb65,_0xa90e('0x10'),JSON['stringify'](_0x30388a));if(_0x30388a['error']){if(_0x30388a['error'][_0xa90e('0x11')]===0x1f4){logger[_0xa90e('0x12')](_0xa90e('0xe'),_0x2feb65,_0x30388a[_0xa90e('0x12')][_0xa90e('0x13')]);return _0x278c34(_0x30388a['error'][_0xa90e('0x13')]);}logger[_0xa90e('0x12')](_0xa90e('0xe'),_0x2feb65,_0x30388a['error']['message']);return _0xc2d625(_0x30388a['error'][_0xa90e('0x13')]);}else{logger[_0xa90e('0x14')]('Cdr,\x20%s,\x20%s',_0x2feb65,_0xa90e('0x10'));_0xc2d625(_0x30388a['result'][_0xa90e('0x13')]);}})['catch'](function(_0x44f8ec){logger[_0xa90e('0x12')](_0xa90e('0xe'),_0x2feb65,_0x44f8ec);_0x278c34(_0x44f8ec);});});}
\ No newline at end of file
index 962dfdb..4cd0360 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x5e4e54,_0x22683c){var _0x20b557=function(_0x59d565){while(--_0x59d565){_0x5e4e54['push'](_0x5e4e54['shift']());}};_0x20b557(++_0x22683c);}(_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('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router;
\ No newline at end of file
+var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x54bc96,_0x20cb68){var _0x4685b9=function(_0x41f797){while(--_0x41f797){_0x54bc96['push'](_0x54bc96['shift']());}};_0x4685b9(++_0x20cb68);}(_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'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router;
\ No newline at end of file
index d53db4c..13ccae6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x039c=['STRING','noop','*,*,*,*','INTEGER'];(function(_0x37b3b9,_0x16e2c8){var _0x5bbcc8=function(_0x3b6c90){while(--_0x3b6c90){_0x37b3b9['push'](_0x37b3b9['shift']());}};_0x5bbcc8(++_0x16e2c8);}(_0x039c,0x67));var _0xc039=function(_0x2cee93,_0x4e9f10){_0x2cee93=_0x2cee93-0x0;var _0x36023e=_0x039c[_0x2cee93];return _0x36023e;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0xc039('0x0')],'allowNull':![]},'app':{'type':Sequelize[_0xc039('0x1')],'allowNull':![],'defaultValue':_0xc039('0x2')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xc039('0x1')]},'interval':{'type':Sequelize[_0xc039('0x1')],'defaultValue':_0xc039('0x3')}};
\ No newline at end of file
+var _0x64a6=['TEXT','STRING','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x557c42,_0x13d1b1){var _0x2c56f9=function(_0x1055c1){while(--_0x1055c1){_0x557c42['push'](_0x557c42['shift']());}};_0x2c56f9(++_0x13d1b1);}(_0x64a6,0x183));var _0x664a=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x64a6[_0x2c91e9];return _0x13f0ff;};'use strict';var Sequelize=require(_0x664a('0x0'));module[_0x664a('0x1')]={'priority':{'type':Sequelize[_0x664a('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x664a('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x664a('0x4')],'defaultValue':_0x664a('0x5')}};
\ No newline at end of file
index 19ad873..fbc88ba 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9e0d=['sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','status','json','undefined','limit','count','offset','set','apply','reject','save','then','destroy','end','sendStatus','error','stack','name','send','show','model','keys','rawAttributes','query','filters','intersection','attributes','fields','length','include','merge','options','ChatApplication','find','catch','update','body','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path'];(function(_0x15ab85,_0x5a07e6){var _0x228f01=function(_0x10f9af){while(--_0x10f9af){_0x15ab85['push'](_0x15ab85['shift']());}};_0x228f01(++_0x5a07e6);}(_0x9e0d,0xf7));var _0xd9e0=function(_0x3a017e,_0x8b2e9d){_0x3a017e=_0x3a017e-0x0;var _0xf1802d=_0x9e0d[_0x3a017e];return _0xf1802d;};'use strict';var emlformat=require(_0xd9e0('0x0'));var rimraf=require(_0xd9e0('0x1'));var zipdir=require(_0xd9e0('0x2'));var jsonpatch=require(_0xd9e0('0x3'));var rp=require('request-promise');var moment=require(_0xd9e0('0x4'));var BPromise=require(_0xd9e0('0x5'));var Mustache=require(_0xd9e0('0x6'));var util=require(_0xd9e0('0x7'));var path=require(_0xd9e0('0x8'));var sox=require(_0xd9e0('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd9e0('0xa'));var _=require(_0xd9e0('0xb'));var squel=require(_0xd9e0('0xc'));var crypto=require(_0xd9e0('0xd'));var jsforce=require(_0xd9e0('0xe'));var deskjs=require(_0xd9e0('0xf'));var toCsv=require('to-csv');var querystring=require(_0xd9e0('0x10'));var Papa=require(_0xd9e0('0x11'));var Redis=require(_0xd9e0('0x12'));var authService=require(_0xd9e0('0x13'));var qs=require(_0xd9e0('0x14'));var as=require(_0xd9e0('0x15'));var hardwareService=require(_0xd9e0('0x16'));var logger=require('../../config/logger')(_0xd9e0('0x17'));var utils=require(_0xd9e0('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xd9e0('0x19'));var db=require(_0xd9e0('0x1a'))['db'];function respondWithStatusCode(_0x418d84,_0x1fb454){_0x1fb454=_0x1fb454||0xcc;return function(_0x18fdf2){if(_0x18fdf2){return _0x418d84['sendStatus'](_0x1fb454);}return _0x418d84[_0xd9e0('0x1b')](_0x1fb454)['end']();};}function respondWithResult(_0x2f311c,_0x55c704){_0x55c704=_0x55c704||0xc8;return function(_0x24d361){if(_0x24d361){return _0x2f311c[_0xd9e0('0x1b')](_0x55c704)[_0xd9e0('0x1c')](_0x24d361);}};}function respondWithFilteredResult(_0x18301b,_0x3e4c5d){return function(_0x4da900){if(_0x4da900){var _0x58d44c=typeof _0x3e4c5d['offset']===_0xd9e0('0x1d')&&typeof _0x3e4c5d[_0xd9e0('0x1e')]===_0xd9e0('0x1d');var _0x1cdcb6=_0x4da900['count'];var _0x209c04=_0x58d44c?0x0:_0x3e4c5d['offset'];var _0x483b74=_0x58d44c?_0x4da900[_0xd9e0('0x1f')]:_0x3e4c5d[_0xd9e0('0x20')]+_0x3e4c5d['limit'];var _0x5ac8f5;if(_0x483b74>=_0x1cdcb6){_0x483b74=_0x1cdcb6;_0x5ac8f5=0xc8;}else{_0x5ac8f5=0xce;}_0x18301b[_0xd9e0('0x1b')](_0x5ac8f5);return _0x18301b[_0xd9e0('0x21')]('Content-Range',_0x209c04+'-'+_0x483b74+'/'+_0x1cdcb6)[_0xd9e0('0x1c')](_0x4da900);}return null;};}function patchUpdates(_0x4cc3c9){return function(_0xd3d455){try{jsonpatch[_0xd9e0('0x22')](_0xd3d455,_0x4cc3c9,!![]);}catch(_0x67f69f){return BPromise[_0xd9e0('0x23')](_0x67f69f);}return _0xd3d455[_0xd9e0('0x24')]();};}function saveUpdates(_0x5711a1,_0x19534a){return function(_0x333233){if(_0x333233){return _0x333233['update'](_0x5711a1)[_0xd9e0('0x25')](function(_0x124ca7){return _0x124ca7;});}return null;};}function removeEntity(_0x5d4549,_0x357bd9){return function(_0x5e17d4){if(_0x5e17d4){return _0x5e17d4[_0xd9e0('0x26')]()[_0xd9e0('0x25')](function(){_0x5d4549['status'](0xcc)[_0xd9e0('0x27')]();});}};}function handleEntityNotFound(_0x53cf67,_0x554aeb){return function(_0x50f57d){if(!_0x50f57d){_0x53cf67[_0xd9e0('0x28')](0x194);}return _0x50f57d;};}function handleError(_0x21c796,_0x7065c6){_0x7065c6=_0x7065c6||0x1f4;return function(_0x1c36df){logger[_0xd9e0('0x29')](_0x1c36df[_0xd9e0('0x2a')]);if(_0x1c36df[_0xd9e0('0x2b')]){delete _0x1c36df['name'];}_0x21c796[_0xd9e0('0x1b')](_0x7065c6)[_0xd9e0('0x2c')](_0x1c36df);};}exports[_0xd9e0('0x2d')]=function(_0x17a899,_0x2738e9){var _0x4f5367={'raw':!![],'where':{'id':_0x17a899['params']['id']}},_0x4b4f7d={};_0x4b4f7d[_0xd9e0('0x2e')]=_[_0xd9e0('0x2f')](db['ChatApplication'][_0xd9e0('0x30')]);_0x4b4f7d[_0xd9e0('0x31')]=_[_0xd9e0('0x2f')](_0x17a899[_0xd9e0('0x31')]);_0x4b4f7d[_0xd9e0('0x32')]=_[_0xd9e0('0x33')](_0x4b4f7d[_0xd9e0('0x2e')],_0x4b4f7d['query']);_0x4f5367[_0xd9e0('0x34')]=_[_0xd9e0('0x33')](_0x4b4f7d[_0xd9e0('0x2e')],qs[_0xd9e0('0x35')](_0x17a899[_0xd9e0('0x31')][_0xd9e0('0x35')]));_0x4f5367[_0xd9e0('0x34')]=_0x4f5367[_0xd9e0('0x34')][_0xd9e0('0x36')]?_0x4f5367[_0xd9e0('0x34')]:_0x4b4f7d[_0xd9e0('0x2e')];if(_0x17a899[_0xd9e0('0x31')]['includeAll']){_0x4f5367[_0xd9e0('0x37')]=[{'all':!![]}];}_0x4f5367=_[_0xd9e0('0x38')]({},_0x4f5367,_0x17a899[_0xd9e0('0x39')]);return db[_0xd9e0('0x3a')][_0xd9e0('0x3b')](_0x4f5367)['then'](handleEntityNotFound(_0x2738e9,null))[_0xd9e0('0x25')](respondWithResult(_0x2738e9,null))[_0xd9e0('0x3c')](handleError(_0x2738e9,null));};exports[_0xd9e0('0x3d')]=function(_0x23901a,_0x588f8c){if(_0x23901a[_0xd9e0('0x3e')]['id']){delete _0x23901a['body']['id'];}return db[_0xd9e0('0x3a')][_0xd9e0('0x3b')]({'where':{'id':_0x23901a[_0xd9e0('0x3f')]['id']}})[_0xd9e0('0x25')](handleEntityNotFound(_0x588f8c,null))[_0xd9e0('0x25')](saveUpdates(_0x23901a[_0xd9e0('0x3e')],null))[_0xd9e0('0x25')](respondWithResult(_0x588f8c,null))[_0xd9e0('0x3c')](handleError(_0x588f8c,null));};exports[_0xd9e0('0x26')]=function(_0x5065f7,_0x318679){return db[_0xd9e0('0x3a')][_0xd9e0('0x3b')]({'where':{'id':_0x5065f7[_0xd9e0('0x3f')]['id']}})['then'](handleEntityNotFound(_0x318679,null))[_0xd9e0('0x25')](removeEntity(_0x318679,null))[_0xd9e0('0x3c')](handleError(_0x318679,null));};
\ No newline at end of file
+var _0x4627=['Content-Range','json','apply','reject','save','then','end','sendStatus','name','send','show','params','model','keys','ChatApplication','rawAttributes','query','filters','attributes','intersection','fields','length','includeAll','merge','find','catch','update','body','destroy','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','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','offset','undefined','count'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x4627,0x115));var _0x7462=function(_0x45bf86,_0x75586e){_0x45bf86=_0x45bf86-0x0;var _0x1f02b7=_0x4627[_0x45bf86];return _0x1f02b7;};'use strict';var emlformat=require(_0x7462('0x0'));var rimraf=require(_0x7462('0x1'));var zipdir=require(_0x7462('0x2'));var jsonpatch=require(_0x7462('0x3'));var rp=require(_0x7462('0x4'));var moment=require(_0x7462('0x5'));var BPromise=require(_0x7462('0x6'));var Mustache=require(_0x7462('0x7'));var util=require(_0x7462('0x8'));var path=require(_0x7462('0x9'));var sox=require(_0x7462('0xa'));var csv=require(_0x7462('0xb'));var ejs=require(_0x7462('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7462('0xd'));var squel=require(_0x7462('0xe'));var crypto=require(_0x7462('0xf'));var jsforce=require(_0x7462('0x10'));var deskjs=require(_0x7462('0x11'));var toCsv=require(_0x7462('0xb'));var querystring=require(_0x7462('0x12'));var Papa=require(_0x7462('0x13'));var Redis=require(_0x7462('0x14'));var authService=require(_0x7462('0x15'));var qs=require(_0x7462('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x7462('0x17'))(_0x7462('0x18'));var utils=require(_0x7462('0x19'));var config=require(_0x7462('0x1a'));var licenseUtil=require(_0x7462('0x1b'));var db=require(_0x7462('0x1c'))['db'];function respondWithStatusCode(_0x31bf84,_0x4e313a){_0x4e313a=_0x4e313a||0xcc;return function(_0x5cb363){if(_0x5cb363){return _0x31bf84['sendStatus'](_0x4e313a);}return _0x31bf84[_0x7462('0x1d')](_0x4e313a)['end']();};}function respondWithResult(_0x1ba7e5,_0x461bd2){_0x461bd2=_0x461bd2||0xc8;return function(_0x368f45){if(_0x368f45){return _0x1ba7e5[_0x7462('0x1d')](_0x461bd2)['json'](_0x368f45);}};}function respondWithFilteredResult(_0x27b8f5,_0x4913ff){return function(_0x36b008){if(_0x36b008){var _0x42ed50=typeof _0x4913ff[_0x7462('0x1e')]===_0x7462('0x1f')&&typeof _0x4913ff['limit']===_0x7462('0x1f');var _0x56ed70=_0x36b008[_0x7462('0x20')];var _0x216eba=_0x42ed50?0x0:_0x4913ff[_0x7462('0x1e')];var _0x26e25f=_0x42ed50?_0x36b008['count']:_0x4913ff[_0x7462('0x1e')]+_0x4913ff['limit'];var _0x85341c;if(_0x26e25f>=_0x56ed70){_0x26e25f=_0x56ed70;_0x85341c=0xc8;}else{_0x85341c=0xce;}_0x27b8f5[_0x7462('0x1d')](_0x85341c);return _0x27b8f5['set'](_0x7462('0x21'),_0x216eba+'-'+_0x26e25f+'/'+_0x56ed70)[_0x7462('0x22')](_0x36b008);}return null;};}function patchUpdates(_0x4d0e60){return function(_0x25a44a){try{jsonpatch[_0x7462('0x23')](_0x25a44a,_0x4d0e60,!![]);}catch(_0x2e9a25){return BPromise[_0x7462('0x24')](_0x2e9a25);}return _0x25a44a[_0x7462('0x25')]();};}function saveUpdates(_0x4404eb,_0x32da06){return function(_0x3c9616){if(_0x3c9616){return _0x3c9616['update'](_0x4404eb)[_0x7462('0x26')](function(_0x52460e){return _0x52460e;});}return null;};}function removeEntity(_0x185934,_0x11caf5){return function(_0x290715){if(_0x290715){return _0x290715['destroy']()[_0x7462('0x26')](function(){_0x185934['status'](0xcc)[_0x7462('0x27')]();});}};}function handleEntityNotFound(_0x5473d1,_0x5759fa){return function(_0x29992b){if(!_0x29992b){_0x5473d1[_0x7462('0x28')](0x194);}return _0x29992b;};}function handleError(_0x51d9d9,_0x5575fc){_0x5575fc=_0x5575fc||0x1f4;return function(_0x554d21){logger['error'](_0x554d21['stack']);if(_0x554d21[_0x7462('0x29')]){delete _0x554d21[_0x7462('0x29')];}_0x51d9d9['status'](_0x5575fc)[_0x7462('0x2a')](_0x554d21);};}exports[_0x7462('0x2b')]=function(_0x3a3313,_0x10a673){var _0x4948c9={'raw':!![],'where':{'id':_0x3a3313[_0x7462('0x2c')]['id']}},_0x1f279b={};_0x1f279b[_0x7462('0x2d')]=_[_0x7462('0x2e')](db[_0x7462('0x2f')][_0x7462('0x30')]);_0x1f279b[_0x7462('0x31')]=_[_0x7462('0x2e')](_0x3a3313[_0x7462('0x31')]);_0x1f279b[_0x7462('0x32')]=_['intersection'](_0x1f279b[_0x7462('0x2d')],_0x1f279b['query']);_0x4948c9[_0x7462('0x33')]=_[_0x7462('0x34')](_0x1f279b[_0x7462('0x2d')],qs[_0x7462('0x35')](_0x3a3313['query'][_0x7462('0x35')]));_0x4948c9[_0x7462('0x33')]=_0x4948c9[_0x7462('0x33')][_0x7462('0x36')]?_0x4948c9[_0x7462('0x33')]:_0x1f279b[_0x7462('0x2d')];if(_0x3a3313['query'][_0x7462('0x37')]){_0x4948c9['include']=[{'all':!![]}];}_0x4948c9=_[_0x7462('0x38')]({},_0x4948c9,_0x3a3313['options']);return db[_0x7462('0x2f')][_0x7462('0x39')](_0x4948c9)['then'](handleEntityNotFound(_0x10a673,null))[_0x7462('0x26')](respondWithResult(_0x10a673,null))[_0x7462('0x3a')](handleError(_0x10a673,null));};exports[_0x7462('0x3b')]=function(_0x1f713b,_0x469a7e){if(_0x1f713b[_0x7462('0x3c')]['id']){delete _0x1f713b[_0x7462('0x3c')]['id'];}return db[_0x7462('0x2f')][_0x7462('0x39')]({'where':{'id':_0x1f713b[_0x7462('0x2c')]['id']}})[_0x7462('0x26')](handleEntityNotFound(_0x469a7e,null))[_0x7462('0x26')](saveUpdates(_0x1f713b[_0x7462('0x3c')],null))[_0x7462('0x26')](respondWithResult(_0x469a7e,null))['catch'](handleError(_0x469a7e,null));};exports[_0x7462('0x3d')]=function(_0x92edff,_0xb65b90){return db[_0x7462('0x2f')]['find']({'where':{'id':_0x92edff[_0x7462('0x2c')]['id']}})[_0x7462('0x26')](handleEntityNotFound(_0xb65b90,null))[_0x7462('0x26')](removeEntity(_0xb65b90,null))[_0x7462('0x3a')](handleError(_0xb65b90,null));};
\ No newline at end of file
index 28ad467..1eee96a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa251=['../../config/logger','api','bluebird','request-promise','path','rimraf','./chatApplication.attributes','exports','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x2e6181,_0x2f2146){var _0x25f0ef=function(_0x43078e){while(--_0x43078e){_0x2e6181['push'](_0x2e6181['shift']());}};_0x25f0ef(++_0x2f2146);}(_0xa251,0x1de));var _0x1a25=function(_0x404634,_0x56ed3f){_0x404634=_0x404634-0x0;var _0x524e06=_0xa251[_0x404634];return _0x524e06;};'use strict';var _=require(_0x1a25('0x0'));var util=require(_0x1a25('0x1'));var logger=require(_0x1a25('0x2'))(_0x1a25('0x3'));var moment=require('moment');var BPromise=require(_0x1a25('0x4'));var rp=require(_0x1a25('0x5'));var fs=require('fs');var path=require(_0x1a25('0x6'));var rimraf=require(_0x1a25('0x7'));var config=require('../../config/environment');var attributes=require(_0x1a25('0x8'));module[_0x1a25('0x9')]=function(_0x106d02,_0x1c2a7a){return _0x106d02['define']('ChatApplication',attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1a25('0xa'),'collate':_0x1a25('0xb')});};
\ No newline at end of file
+var _0x848d=['./chatApplication.attributes','exports','define','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment'];(function(_0x36a66a,_0x3ea9fc){var _0x5aaefd=function(_0x200838){while(--_0x200838){_0x36a66a['push'](_0x36a66a['shift']());}};_0x5aaefd(++_0x3ea9fc);}(_0x848d,0x1d5));var _0xd848=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x848d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd848('0x0'));var util=require(_0xd848('0x1'));var logger=require(_0xd848('0x2'))('api');var moment=require('moment');var BPromise=require(_0xd848('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd848('0x4'));var rimraf=require(_0xd848('0x5'));var config=require(_0xd848('0x6'));var attributes=require(_0xd848('0x7'));module[_0xd848('0x8')]=function(_0x11c998,_0x3c4d1b){return _0x11c998[_0xd848('0x9')](_0xd848('0xa'),attributes,{'tableName':_0xd848('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd848('0xc'),'collate':_0xd848('0xd')});};
\ No newline at end of file
index 0ab06e9..3d7c125 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5a5b=['ChatApplication,\x20%s,\x20%s,\x20%s','code','error','ChatApplication,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','then','info','request\x20sent','debug'];(function(_0x5363a3,_0x3c6310){var _0x4cd0c6=function(_0x3d7747){while(--_0x3d7747){_0x5363a3['push'](_0x5363a3['shift']());}};_0x4cd0c6(++_0x3c6310);}(_0x5a5b,0x118));var _0xb5a5=function(_0x23f8ed,_0x3fcc5e){_0x23f8ed=_0x23f8ed-0x0;var _0x2872a6=_0x5a5b[_0x23f8ed];return _0x2872a6;};'use strict';var _=require(_0xb5a5('0x0'));var util=require(_0xb5a5('0x1'));var moment=require('moment');var BPromise=require(_0xb5a5('0x2'));var rs=require(_0xb5a5('0x3'));var fs=require('fs');var Redis=require(_0xb5a5('0x4'));var db=require(_0xb5a5('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xb5a5('0x6'));var config=require(_0xb5a5('0x7'));var jayson=require(_0xb5a5('0x8'));var client=jayson[_0xb5a5('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x33ea98,_0x336235,_0x1d05d5){return new BPromise(function(_0x2e00ee,_0x11100e){return client['request'](_0x33ea98,_0x1d05d5)[_0xb5a5('0xa')](function(_0x23f05d){logger[_0xb5a5('0xb')]('ChatApplication,\x20%s,\x20%s',_0x336235,_0xb5a5('0xc'));logger[_0xb5a5('0xd')](_0xb5a5('0xe'),_0x336235,'request\x20sent',JSON['stringify'](_0x23f05d));if(_0x23f05d['error']){if(_0x23f05d['error'][_0xb5a5('0xf')]===0x1f4){logger[_0xb5a5('0x10')](_0xb5a5('0x11'),_0x336235,_0x23f05d[_0xb5a5('0x10')][_0xb5a5('0x12')]);return _0x11100e(_0x23f05d[_0xb5a5('0x10')][_0xb5a5('0x12')]);}logger['error'](_0xb5a5('0x11'),_0x336235,_0x23f05d['error']['message']);return _0x2e00ee(_0x23f05d[_0xb5a5('0x10')][_0xb5a5('0x12')]);}else{logger[_0xb5a5('0xb')]('ChatApplication,\x20%s,\x20%s',_0x336235,_0xb5a5('0xc'));_0x2e00ee(_0x23f05d[_0xb5a5('0x13')][_0xb5a5('0x12')]);}})[_0xb5a5('0x14')](function(_0x369a2c){logger['error'](_0xb5a5('0x11'),_0x336235,_0x369a2c);_0x11100e(_0x369a2c);});});}
\ No newline at end of file
+var _0xc337=['result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','error','message','info'];(function(_0x57541b,_0x4d54a4){var _0x39d2ef=function(_0x3b7910){while(--_0x3b7910){_0x57541b['push'](_0x57541b['shift']());}};_0x39d2ef(++_0x4d54a4);}(_0xc337,0x167));var _0x7c33=function(_0xb4aa18,_0x37b8ef){_0xb4aa18=_0xb4aa18-0x0;var _0x2b704a=_0xc337[_0xb4aa18];return _0x2b704a;};'use strict';var _=require(_0x7c33('0x0'));var util=require(_0x7c33('0x1'));var moment=require(_0x7c33('0x2'));var BPromise=require(_0x7c33('0x3'));var rs=require(_0x7c33('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7c33('0x5'))['db'];var utils=require(_0x7c33('0x6'));var logger=require(_0x7c33('0x7'))('rpc');var config=require(_0x7c33('0x8'));var jayson=require(_0x7c33('0x9'));var client=jayson['client'][_0x7c33('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1222de,_0x2634ec,_0x3d5151){return new BPromise(function(_0x320c28,_0x3da34c){return client[_0x7c33('0xb')](_0x1222de,_0x3d5151)['then'](function(_0x4af7e1){logger['info'](_0x7c33('0xc'),_0x2634ec,_0x7c33('0xd'));logger[_0x7c33('0xe')](_0x7c33('0xf'),_0x2634ec,_0x7c33('0xd'),JSON['stringify'](_0x4af7e1));if(_0x4af7e1['error']){if(_0x4af7e1['error']['code']===0x1f4){logger[_0x7c33('0x10')](_0x7c33('0xc'),_0x2634ec,_0x4af7e1[_0x7c33('0x10')][_0x7c33('0x11')]);return _0x3da34c(_0x4af7e1[_0x7c33('0x10')][_0x7c33('0x11')]);}logger[_0x7c33('0x10')](_0x7c33('0xc'),_0x2634ec,_0x4af7e1[_0x7c33('0x10')]['message']);return _0x320c28(_0x4af7e1[_0x7c33('0x10')][_0x7c33('0x11')]);}else{logger[_0x7c33('0x12')](_0x7c33('0xc'),_0x2634ec,_0x7c33('0xd'));_0x320c28(_0x4af7e1[_0x7c33('0x13')][_0x7c33('0x11')]);}})[_0x7c33('0x14')](function(_0x42b2bf){logger[_0x7c33('0x10')](_0x7c33('0xc'),_0x2634ec,_0x42b2bf);_0x3da34c(_0x42b2bf);});});}
\ No newline at end of file
index d4e7652..f952abd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0b71=['get','isAuthenticated','put','/:id','delete','destroy','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment'];(function(_0x3d4777,_0xd17068){var _0x3e8a60=function(_0x552a1a){while(--_0x552a1a){_0x3d4777['push'](_0x3d4777['shift']());}};_0x3e8a60(++_0xd17068);}(_0x0b71,0x199));var _0x10b7=function(_0x251d9c,_0x580977){_0x251d9c=_0x251d9c-0x0;var _0x16ae64=_0x0b71[_0x251d9c];return _0x16ae64;};'use strict';var multer=require(_0x10b7('0x0'));var util=require(_0x10b7('0x1'));var path=require(_0x10b7('0x2'));var timeout=require(_0x10b7('0x3'));var express=require(_0x10b7('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x10b7('0x5'));var config=require(_0x10b7('0x6'));var controller=require('./chatApplication.controller');router[_0x10b7('0x7')]('/:id',auth[_0x10b7('0x8')](),controller['show']);router[_0x10b7('0x9')](_0x10b7('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x10b7('0xb')]('/:id',auth[_0x10b7('0x8')](),controller[_0x10b7('0xc')]);module['exports']=router;
\ No newline at end of file
+var _0x268c=['../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','/:id','show','put','isAuthenticated','update','exports','multer','util','path','connect-timeout','Router','fs-extra'];(function(_0x3e5197,_0x409cb1){var _0x410b01=function(_0x43b2dd){while(--_0x43b2dd){_0x3e5197['push'](_0x3e5197['shift']());}};_0x410b01(++_0x409cb1);}(_0x268c,0x13d));var _0xc268=function(_0x315aea,_0x318a80){_0x315aea=_0x315aea-0x0;var _0x4a4bdb=_0x268c[_0x315aea];return _0x4a4bdb;};'use strict';var multer=require(_0xc268('0x0'));var util=require(_0xc268('0x1'));var path=require(_0xc268('0x2'));var timeout=require(_0xc268('0x3'));var express=require('express');var router=express[_0xc268('0x4')]();var fs_extra=require(_0xc268('0x5'));var auth=require(_0xc268('0x6'));var interaction=require(_0xc268('0x7'));var config=require(_0xc268('0x8'));var controller=require(_0xc268('0x9'));router[_0xc268('0xa')](_0xc268('0xb'),auth['isAuthenticated'](),controller[_0xc268('0xc')]);router[_0xc268('0xd')]('/:id',auth[_0xc268('0xe')](),controller[_0xc268('0xf')]);router['delete'](_0xc268('0xb'),auth[_0xc268('0xe')](),controller['destroy']);module[_0xc268('0x10')]=router;
\ No newline at end of file
index 36ace70..d9a47d8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x238d=['sequelize','exports','STRING'];(function(_0x2fc113,_0x45ec6e){var _0x5144ce=function(_0x47fd29){while(--_0x47fd29){_0x2fc113['push'](_0x2fc113['shift']());}};_0x5144ce(++_0x45ec6e);}(_0x238d,0x123));var _0xd238=function(_0x11c780,_0x25b547){_0x11c780=_0x11c780-0x0;var _0x44c830=_0x238d[_0x11c780];return _0x44c830;};'use strict';var Sequelize=require(_0xd238('0x0'));module[_0xd238('0x1')]={'name':{'type':Sequelize[_0xd238('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xd238('0x2')]},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
+var _0x2b0a=['sequelize','exports','STRING'];(function(_0x10673f,_0x5f1781){var _0x36ce1c=function(_0x1d88d6){while(--_0x1d88d6){_0x10673f['push'](_0x10673f['shift']());}};_0x36ce1c(++_0x5f1781);}(_0x2b0a,0x84));var _0xa2b0=function(_0x4f7cba,_0x570c91){_0x4f7cba=_0x4f7cba-0x0;var _0x3fb190=_0x2b0a[_0x4f7cba];return _0x3fb190;};'use strict';var Sequelize=require(_0xa2b0('0x0'));module[_0xa2b0('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xa2b0('0x2')]},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
index dd96d64..1c5f723 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa8f6=['lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatGroup.socket','register','sendStatus','status','end','offset','undefined','count','limit','set','json','apply','reject','update','then','destroy','stack','name','index','map','fieldName','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','ChatGroup','includeAll','findAll','rows','catch','show','params','rawAttributes','length','create','body','find','toInteger','addMembers','omit','getMembers','findOne','User','removeMembers','ids','ChatGroupId','getMessages','ChatInternalMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs'];(function(_0x269cbf,_0x36f17b){var _0x51b582=function(_0x49dad2){while(--_0x49dad2){_0x269cbf['push'](_0x269cbf['shift']());}};_0x51b582(++_0x36f17b);}(_0xa8f6,0x1bd));var _0x6a8f=function(_0x1e5cef,_0x418f4c){_0x1e5cef=_0x1e5cef-0x0;var _0x346535=_0xa8f6[_0x1e5cef];return _0x346535;};'use strict';var emlformat=require(_0x6a8f('0x0'));var rimraf=require(_0x6a8f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6a8f('0x2'));var rp=require('request-promise');var moment=require(_0x6a8f('0x3'));var BPromise=require(_0x6a8f('0x4'));var Mustache=require('mustache');var util=require(_0x6a8f('0x5'));var path=require(_0x6a8f('0x6'));var sox=require(_0x6a8f('0x7'));var csv=require(_0x6a8f('0x8'));var ejs=require(_0x6a8f('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6a8f('0xa'));var squel=require(_0x6a8f('0xb'));var crypto=require(_0x6a8f('0xc'));var jsforce=require(_0x6a8f('0xd'));var deskjs=require(_0x6a8f('0xe'));var toCsv=require(_0x6a8f('0x8'));var querystring=require(_0x6a8f('0xf'));var Papa=require(_0x6a8f('0x10'));var Redis=require(_0x6a8f('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x6a8f('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6a8f('0x13'));var utils=require(_0x6a8f('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x6a8f('0x15'));var db=require(_0x6a8f('0x16'))['db'];config[_0x6a8f('0x17')]=_[_0x6a8f('0x18')](config[_0x6a8f('0x17')],{'host':_0x6a8f('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x6a8f('0x1a'))[_0x6a8f('0x1b')](socket);function respondWithStatusCode(_0x45eda5,_0x4631d6){_0x4631d6=_0x4631d6||0xcc;return function(_0x4ddecf){if(_0x4ddecf){return _0x45eda5[_0x6a8f('0x1c')](_0x4631d6);}return _0x45eda5[_0x6a8f('0x1d')](_0x4631d6)[_0x6a8f('0x1e')]();};}function respondWithResult(_0x242135,_0x9be1e6){_0x9be1e6=_0x9be1e6||0xc8;return function(_0x4632f1){if(_0x4632f1){return _0x242135[_0x6a8f('0x1d')](_0x9be1e6)['json'](_0x4632f1);}};}function respondWithFilteredResult(_0x251481,_0x2511ad){return function(_0x1b98b9){if(_0x1b98b9){var _0xf453b3=typeof _0x2511ad[_0x6a8f('0x1f')]==='undefined'&&typeof _0x2511ad['limit']===_0x6a8f('0x20');var _0x187e34=_0x1b98b9[_0x6a8f('0x21')];var _0x26201a=_0xf453b3?0x0:_0x2511ad[_0x6a8f('0x1f')];var _0x442784=_0xf453b3?_0x1b98b9[_0x6a8f('0x21')]:_0x2511ad[_0x6a8f('0x1f')]+_0x2511ad[_0x6a8f('0x22')];var _0x550fbe;if(_0x442784>=_0x187e34){_0x442784=_0x187e34;_0x550fbe=0xc8;}else{_0x550fbe=0xce;}_0x251481['status'](_0x550fbe);return _0x251481[_0x6a8f('0x23')]('Content-Range',_0x26201a+'-'+_0x442784+'/'+_0x187e34)[_0x6a8f('0x24')](_0x1b98b9);}return null;};}function patchUpdates(_0x26f7f4){return function(_0x50d239){try{jsonpatch[_0x6a8f('0x25')](_0x50d239,_0x26f7f4,!![]);}catch(_0xec2909){return BPromise[_0x6a8f('0x26')](_0xec2909);}return _0x50d239['save']();};}function saveUpdates(_0x464059,_0x4965d5){return function(_0x464f42){if(_0x464f42){return _0x464f42[_0x6a8f('0x27')](_0x464059)[_0x6a8f('0x28')](function(_0x2baf17){return _0x2baf17;});}return null;};}function removeEntity(_0x3127b0,_0x511849){return function(_0xde1c40){if(_0xde1c40){return _0xde1c40[_0x6a8f('0x29')]()[_0x6a8f('0x28')](function(){_0x3127b0[_0x6a8f('0x1d')](0xcc)[_0x6a8f('0x1e')]();});}};}function handleEntityNotFound(_0x53e36d,_0x339172){return function(_0x3f08a1){if(!_0x3f08a1){_0x53e36d[_0x6a8f('0x1c')](0x194);}return _0x3f08a1;};}function handleError(_0x9b1713,_0x2ecd0c){_0x2ecd0c=_0x2ecd0c||0x1f4;return function(_0x50c32c){logger['error'](_0x50c32c[_0x6a8f('0x2a')]);if(_0x50c32c[_0x6a8f('0x2b')]){delete _0x50c32c[_0x6a8f('0x2b')];}_0x9b1713['status'](_0x2ecd0c)['send'](_0x50c32c);};}exports[_0x6a8f('0x2c')]=function(_0x390b49,_0x4bddd9){var _0x3f3e89={},_0x373140={},_0x12aabe={'count':0x0,'rows':[]};var _0x4a341d=_[_0x6a8f('0x2d')](db['ChatGroup']['rawAttributes'],function(_0x1522be){return{'name':_0x1522be[_0x6a8f('0x2e')],'type':_0x1522be['type']['key']};});_0x373140[_0x6a8f('0x2f')]=_[_0x6a8f('0x2d')](_0x4a341d,_0x6a8f('0x2b'));_0x373140[_0x6a8f('0x30')]=_[_0x6a8f('0x31')](_0x390b49[_0x6a8f('0x30')]);_0x373140[_0x6a8f('0x32')]=_[_0x6a8f('0x33')](_0x373140['model'],_0x373140[_0x6a8f('0x30')]);_0x3f3e89[_0x6a8f('0x34')]=_[_0x6a8f('0x33')](_0x373140[_0x6a8f('0x2f')],qs[_0x6a8f('0x35')](_0x390b49[_0x6a8f('0x30')][_0x6a8f('0x35')]));_0x3f3e89[_0x6a8f('0x34')]=_0x3f3e89[_0x6a8f('0x34')]['length']?_0x3f3e89[_0x6a8f('0x34')]:_0x373140[_0x6a8f('0x2f')];if(!_0x390b49['query'][_0x6a8f('0x36')](_0x6a8f('0x37'))){_0x3f3e89[_0x6a8f('0x22')]=qs[_0x6a8f('0x22')](_0x390b49[_0x6a8f('0x30')][_0x6a8f('0x22')]);_0x3f3e89[_0x6a8f('0x1f')]=qs['offset'](_0x390b49[_0x6a8f('0x30')][_0x6a8f('0x1f')]);}_0x3f3e89[_0x6a8f('0x38')]=qs[_0x6a8f('0x39')](_0x390b49['query'][_0x6a8f('0x39')]);_0x3f3e89[_0x6a8f('0x3a')]=qs[_0x6a8f('0x32')](_[_0x6a8f('0x3b')](_0x390b49['query'],_0x373140[_0x6a8f('0x32')]),_0x4a341d);if(_0x390b49[_0x6a8f('0x30')][_0x6a8f('0x3c')]){_0x3f3e89[_0x6a8f('0x3a')]=_[_0x6a8f('0x3d')](_0x3f3e89['where'],{'$or':_[_0x6a8f('0x2d')](_0x4a341d,function(_0x72d3f9){if(_0x72d3f9['type']!==_0x6a8f('0x3e')){var _0x44cbdd={};_0x44cbdd[_0x72d3f9[_0x6a8f('0x2b')]]={'$like':'%'+_0x390b49[_0x6a8f('0x30')][_0x6a8f('0x3c')]+'%'};return _0x44cbdd;}})});}_0x3f3e89=_[_0x6a8f('0x3d')]({},_0x3f3e89,_0x390b49[_0x6a8f('0x3f')]);var _0x318daf={'where':_0x3f3e89[_0x6a8f('0x3a')]};return db[_0x6a8f('0x40')][_0x6a8f('0x21')](_0x318daf)[_0x6a8f('0x28')](function(_0x416544){_0x12aabe[_0x6a8f('0x21')]=_0x416544;if(_0x390b49[_0x6a8f('0x30')][_0x6a8f('0x41')]){_0x3f3e89['include']=[{'all':!![]}];}return db['ChatGroup'][_0x6a8f('0x42')](_0x3f3e89);})[_0x6a8f('0x28')](function(_0x52a420){_0x12aabe[_0x6a8f('0x43')]=_0x52a420;return _0x12aabe;})[_0x6a8f('0x28')](respondWithFilteredResult(_0x4bddd9,_0x3f3e89))[_0x6a8f('0x44')](handleError(_0x4bddd9,null));};exports[_0x6a8f('0x45')]=function(_0x38abc6,_0x357b58){var _0x44370c={'raw':!![],'where':{'id':_0x38abc6[_0x6a8f('0x46')]['id']}},_0x4350ad={};_0x4350ad[_0x6a8f('0x2f')]=_[_0x6a8f('0x31')](db[_0x6a8f('0x40')][_0x6a8f('0x47')]);_0x4350ad[_0x6a8f('0x30')]=_['keys'](_0x38abc6[_0x6a8f('0x30')]);_0x4350ad['filters']=_[_0x6a8f('0x33')](_0x4350ad[_0x6a8f('0x2f')],_0x4350ad[_0x6a8f('0x30')]);_0x44370c['attributes']=_[_0x6a8f('0x33')](_0x4350ad[_0x6a8f('0x2f')],qs[_0x6a8f('0x35')](_0x38abc6['query']['fields']));_0x44370c[_0x6a8f('0x34')]=_0x44370c[_0x6a8f('0x34')][_0x6a8f('0x48')]?_0x44370c[_0x6a8f('0x34')]:_0x4350ad[_0x6a8f('0x2f')];if(_0x38abc6[_0x6a8f('0x30')][_0x6a8f('0x41')]){_0x44370c['include']=[{'all':!![]}];}_0x44370c=_[_0x6a8f('0x3d')]({},_0x44370c,_0x38abc6[_0x6a8f('0x3f')]);return db['ChatGroup']['find'](_0x44370c)[_0x6a8f('0x28')](handleEntityNotFound(_0x357b58,null))[_0x6a8f('0x28')](respondWithResult(_0x357b58,null))['catch'](handleError(_0x357b58,null));};exports['create']=function(_0x478c01,_0x1e9b27){return db[_0x6a8f('0x40')][_0x6a8f('0x49')](_0x478c01['body'],{})['then'](respondWithResult(_0x1e9b27,0xc9))[_0x6a8f('0x44')](handleError(_0x1e9b27,null));};exports[_0x6a8f('0x27')]=function(_0x2f6c67,_0x119fb7){if(_0x2f6c67[_0x6a8f('0x4a')]['id']){delete _0x2f6c67[_0x6a8f('0x4a')]['id'];}return db[_0x6a8f('0x40')][_0x6a8f('0x4b')]({'where':{'id':_0x2f6c67[_0x6a8f('0x46')]['id']}})[_0x6a8f('0x28')](handleEntityNotFound(_0x119fb7,null))['then'](saveUpdates(_0x2f6c67[_0x6a8f('0x4a')],null))[_0x6a8f('0x28')](respondWithResult(_0x119fb7,null))[_0x6a8f('0x44')](handleError(_0x119fb7,null));};exports['destroy']=function(_0x3ff8d4,_0xf43437){return db[_0x6a8f('0x40')][_0x6a8f('0x4b')]({'where':{'id':_0x3ff8d4[_0x6a8f('0x46')]['id']}})[_0x6a8f('0x28')](handleEntityNotFound(_0xf43437,null))[_0x6a8f('0x28')](removeEntity(_0xf43437,null))[_0x6a8f('0x44')](handleError(_0xf43437,null));};exports['describe']=function(_0x20c6ca,_0x885e63){return db[_0x6a8f('0x40')]['describe']()[_0x6a8f('0x28')](respondWithResult(_0x885e63,null))[_0x6a8f('0x44')](handleError(_0x885e63,null));};exports['getUnread']=function(_0x72dfc4,_0xe63a57,_0x65a233){return db['ChatInternalMessage']['count']({'where':{'ChatGroupId':_0x72dfc4[_0x6a8f('0x46')]['id'],'ToId':_0x72dfc4['user']['id'],'read':![]}})[_0x6a8f('0x28')](function(_0x560efb){return{'id':_[_0x6a8f('0x4c')](_0x72dfc4[_0x6a8f('0x46')]['id']),'count':_0x560efb};})[_0x6a8f('0x28')](respondWithResult(_0xe63a57,null))['catch'](handleError(_0xe63a57,null));};exports[_0x6a8f('0x4d')]=function(_0x47ad74,_0x2a2057,_0x1fd0fa){return db[_0x6a8f('0x40')]['find']({'where':{'id':_0x47ad74[_0x6a8f('0x46')]['id']}})['then'](handleEntityNotFound(_0x2a2057,null))[_0x6a8f('0x28')](function(_0x220a41){if(_0x220a41){return _0x220a41[_0x6a8f('0x4d')](_0x47ad74[_0x6a8f('0x4a')]['ids'],_[_0x6a8f('0x4e')](_0x47ad74[_0x6a8f('0x4a')],['ids','id'])||{});}})[_0x6a8f('0x28')](respondWithResult(_0x2a2057,null))[_0x6a8f('0x44')](handleError(_0x2a2057,null));};exports[_0x6a8f('0x4f')]=function(_0x46cb06,_0x3a9da1,_0x3624bf){var _0x31a10f={};var _0x27490f={};var _0x1652ee;var _0x113e9d;return db['ChatGroup'][_0x6a8f('0x50')]({'where':{'id':_0x46cb06[_0x6a8f('0x46')]['id']}})[_0x6a8f('0x28')](handleEntityNotFound(_0x3a9da1,null))[_0x6a8f('0x28')](function(_0x32f373){if(_0x32f373){_0x1652ee=_0x32f373;_0x27490f['model']=_[_0x6a8f('0x31')](db[_0x6a8f('0x51')]['rawAttributes']);_0x27490f['query']=_[_0x6a8f('0x31')](_0x46cb06[_0x6a8f('0x30')]);_0x27490f['filters']=_['intersection'](_0x27490f[_0x6a8f('0x2f')],_0x27490f[_0x6a8f('0x30')]);_0x31a10f[_0x6a8f('0x34')]=_['intersection'](_0x27490f[_0x6a8f('0x2f')],qs[_0x6a8f('0x35')](_0x46cb06[_0x6a8f('0x30')][_0x6a8f('0x35')]));_0x31a10f[_0x6a8f('0x34')]=_0x31a10f[_0x6a8f('0x34')][_0x6a8f('0x48')]?_0x31a10f[_0x6a8f('0x34')]:_0x27490f[_0x6a8f('0x2f')];_0x31a10f['order']=qs['sort'](_0x46cb06[_0x6a8f('0x30')]['sort']);_0x31a10f[_0x6a8f('0x3a')]=qs[_0x6a8f('0x32')](_[_0x6a8f('0x3b')](_0x46cb06[_0x6a8f('0x30')],_0x27490f['filters']));if(_0x46cb06[_0x6a8f('0x30')][_0x6a8f('0x3c')]){_0x31a10f[_0x6a8f('0x3a')]=_['merge'](_0x31a10f[_0x6a8f('0x3a')],{'$or':_[_0x6a8f('0x2d')](_0x31a10f['attributes'],function(_0x45adfd){var _0xfbc053={};_0xfbc053[_0x45adfd]={'$like':'%'+_0x46cb06[_0x6a8f('0x30')][_0x6a8f('0x3c')]+'%'};return _0xfbc053;})});}_0x31a10f=_[_0x6a8f('0x3d')]({},_0x31a10f,_0x46cb06[_0x6a8f('0x3f')]);return _0x1652ee[_0x6a8f('0x4f')](_0x31a10f);}})[_0x6a8f('0x28')](function(_0x161798){if(_0x161798){_0x113e9d=_0x161798[_0x6a8f('0x48')];if(!_0x46cb06[_0x6a8f('0x30')][_0x6a8f('0x36')](_0x6a8f('0x37'))){_0x31a10f[_0x6a8f('0x22')]=qs[_0x6a8f('0x22')](_0x46cb06[_0x6a8f('0x30')][_0x6a8f('0x22')]);_0x31a10f[_0x6a8f('0x1f')]=qs['offset'](_0x46cb06[_0x6a8f('0x30')][_0x6a8f('0x1f')]);}return _0x1652ee[_0x6a8f('0x4f')](_0x31a10f);}})[_0x6a8f('0x28')](function(_0x32b818){if(_0x32b818){return _0x32b818?{'count':_0x113e9d,'rows':_0x32b818}:null;}})['then'](respondWithResult(_0x3a9da1,null))[_0x6a8f('0x44')](handleError(_0x3a9da1,null));};exports[_0x6a8f('0x52')]=function(_0x319d0d,_0x19acca,_0x243596){return db[_0x6a8f('0x40')][_0x6a8f('0x4b')]({'where':{'id':_0x319d0d[_0x6a8f('0x46')]['id']}})[_0x6a8f('0x28')](handleEntityNotFound(_0x19acca,null))[_0x6a8f('0x28')](function(_0x4f9da9){if(_0x4f9da9){return _0x4f9da9[_0x6a8f('0x52')](_0x319d0d[_0x6a8f('0x30')][_0x6a8f('0x53')]);}})[_0x6a8f('0x28')](respondWithStatusCode(_0x19acca,null))[_0x6a8f('0x44')](handleError(_0x19acca,null));};exports['addMessage']=function(_0x326385,_0x2b9bb1,_0x549220){if(_0x326385['body']['id']){delete _0x326385[_0x6a8f('0x4a')]['id'];}return db[_0x6a8f('0x40')]['find']({'where':{'id':_0x326385[_0x6a8f('0x46')]['id']}})['then'](handleEntityNotFound(_0x2b9bb1,null))['then'](function(_0x58cf85){if(_0x58cf85){_0x326385[_0x6a8f('0x4a')][_0x6a8f('0x54')]=_0x58cf85['id'];return db['ChatInternalMessage'][_0x6a8f('0x49')](_0x326385[_0x6a8f('0x4a')]);}})[_0x6a8f('0x28')](respondWithResult(_0x2b9bb1,null))[_0x6a8f('0x44')](handleError(_0x2b9bb1,null));};exports[_0x6a8f('0x55')]=function(_0x268362,_0x8b7b97,_0x42c81b){var _0xb2f394={};var _0x424f1c={};var _0x1d7b0f;var _0x3b3dee;return db[_0x6a8f('0x40')]['findOne']({'where':{'id':_0x268362[_0x6a8f('0x46')]['id']}})[_0x6a8f('0x28')](handleEntityNotFound(_0x8b7b97,null))[_0x6a8f('0x28')](function(_0x10b062){if(_0x10b062){_0x1d7b0f=_0x10b062;_0x424f1c[_0x6a8f('0x2f')]=_[_0x6a8f('0x31')](db[_0x6a8f('0x56')][_0x6a8f('0x47')]);_0x424f1c['query']=_['keys'](_0x268362[_0x6a8f('0x30')]);_0x424f1c[_0x6a8f('0x32')]=_[_0x6a8f('0x33')](_0x424f1c[_0x6a8f('0x2f')],_0x424f1c[_0x6a8f('0x30')]);_0xb2f394[_0x6a8f('0x34')]=_[_0x6a8f('0x33')](_0x424f1c[_0x6a8f('0x2f')],qs[_0x6a8f('0x35')](_0x268362[_0x6a8f('0x30')][_0x6a8f('0x35')]));_0xb2f394[_0x6a8f('0x34')]=_0xb2f394[_0x6a8f('0x34')][_0x6a8f('0x48')]?_0xb2f394[_0x6a8f('0x34')]:_0x424f1c[_0x6a8f('0x2f')];_0xb2f394[_0x6a8f('0x38')]=qs['sort'](_0x268362[_0x6a8f('0x30')][_0x6a8f('0x39')]);_0xb2f394[_0x6a8f('0x3a')]=qs[_0x6a8f('0x32')](_[_0x6a8f('0x3b')](_0x268362[_0x6a8f('0x30')],_0x424f1c['filters']));if(_0x268362[_0x6a8f('0x30')]['filter']){_0xb2f394[_0x6a8f('0x3a')]=_[_0x6a8f('0x3d')](_0xb2f394['where'],{'$or':_[_0x6a8f('0x2d')](_0xb2f394['attributes'],function(_0x3a21f5){var _0xe95743={};_0xe95743[_0x3a21f5]={'$like':'%'+_0x268362['query'][_0x6a8f('0x3c')]+'%'};return _0xe95743;})});}if(_0x268362['query'][_0x6a8f('0x57')]){var _0x323308=_0x268362[_0x6a8f('0x30')][_0x6a8f('0x57')][_0x6a8f('0x58')](',');var _0x5109c6={};_0x5109c6[_0x323308[0x0]]={'$gte':moment(_0x323308[0x1])[_0x6a8f('0x59')](_0x6a8f('0x5a'))};_0xb2f394[_0x6a8f('0x3a')]=_['merge'](_0xb2f394[_0x6a8f('0x3a')],_0x5109c6);}_0xb2f394=_['merge']({},_0xb2f394,_0x268362[_0x6a8f('0x3f')]);return _0x1d7b0f[_0x6a8f('0x55')](_0xb2f394);}})[_0x6a8f('0x28')](function(_0x5a39dd){if(_0x5a39dd){_0x3b3dee=_0x5a39dd[_0x6a8f('0x48')];if(!_0x268362[_0x6a8f('0x30')][_0x6a8f('0x36')](_0x6a8f('0x37'))){_0xb2f394[_0x6a8f('0x22')]=qs[_0x6a8f('0x22')](_0x268362[_0x6a8f('0x30')]['limit']);_0xb2f394[_0x6a8f('0x1f')]=qs[_0x6a8f('0x1f')](_0x268362['query'][_0x6a8f('0x1f')]);}return _0x1d7b0f[_0x6a8f('0x55')](_0xb2f394);}})[_0x6a8f('0x28')](function(_0x54bbe1){if(_0x54bbe1){return _0x54bbe1?{'count':_0x3b3dee,'rows':_0x54bbe1}:null;}})[_0x6a8f('0x28')](respondWithResult(_0x8b7b97,null))[_0x6a8f('0x44')](handleError(_0x8b7b97,null));};
\ No newline at end of file
+var _0x4aca=['moment','bluebird','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','status','json','offset','undefined','count','limit','apply','reject','update','then','destroy','end','error','name','index','map','rawAttributes','fieldName','key','model','query','keys','filters','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','type','options','includeAll','ChatGroup','findAll','rows','catch','params','intersection','create','body','find','describe','getUnread','user','toInteger','addMembers','ids','getMembers','User','hasOwnProperty','removeMembers','addMessage','ChatGroupId','ChatInternalMessage','$gte','split','format','getMessages','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x5ea94c,_0x19937b){var _0xededd7=function(_0x27d10e){while(--_0x27d10e){_0x5ea94c['push'](_0x5ea94c['shift']());}};_0xededd7(++_0x19937b);}(_0x4aca,0x164));var _0xa4ac=function(_0x4f9d00,_0x47eeca){_0x4f9d00=_0x4f9d00-0x0;var _0x32aca1=_0x4aca[_0x4f9d00];return _0x32aca1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa4ac('0x0'));var zipdir=require(_0xa4ac('0x1'));var jsonpatch=require(_0xa4ac('0x2'));var rp=require(_0xa4ac('0x3'));var moment=require(_0xa4ac('0x4'));var BPromise=require(_0xa4ac('0x5'));var Mustache=require('mustache');var util=require(_0xa4ac('0x6'));var path=require('path');var sox=require(_0xa4ac('0x7'));var csv=require(_0xa4ac('0x8'));var ejs=require(_0xa4ac('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa4ac('0xa'));var squel=require('squel');var crypto=require(_0xa4ac('0xb'));var jsforce=require(_0xa4ac('0xc'));var deskjs=require(_0xa4ac('0xd'));var toCsv=require(_0xa4ac('0x8'));var querystring=require('querystring');var Papa=require(_0xa4ac('0xe'));var Redis=require('ioredis');var authService=require(_0xa4ac('0xf'));var qs=require(_0xa4ac('0x10'));var as=require(_0xa4ac('0x11'));var hardwareService=require(_0xa4ac('0x12'));var logger=require(_0xa4ac('0x13'))(_0xa4ac('0x14'));var utils=require(_0xa4ac('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xa4ac('0x16'))['db'];config[_0xa4ac('0x17')]=_[_0xa4ac('0x18')](config[_0xa4ac('0x17')],{'host':_0xa4ac('0x19'),'port':0x18eb});var socket=require(_0xa4ac('0x1a'))(new Redis(config[_0xa4ac('0x17')]));require(_0xa4ac('0x1b'))['register'](socket);function respondWithStatusCode(_0x1a6d11,_0x578860){_0x578860=_0x578860||0xcc;return function(_0xc23219){if(_0xc23219){return _0x1a6d11['sendStatus'](_0x578860);}return _0x1a6d11[_0xa4ac('0x1c')](_0x578860)['end']();};}function respondWithResult(_0x25fb05,_0x27d0cd){_0x27d0cd=_0x27d0cd||0xc8;return function(_0x254121){if(_0x254121){return _0x25fb05[_0xa4ac('0x1c')](_0x27d0cd)[_0xa4ac('0x1d')](_0x254121);}};}function respondWithFilteredResult(_0x38d690,_0x505c33){return function(_0x540b4a){if(_0x540b4a){var _0x1c9aff=typeof _0x505c33[_0xa4ac('0x1e')]===_0xa4ac('0x1f')&&typeof _0x505c33['limit']===_0xa4ac('0x1f');var _0x4d47b9=_0x540b4a[_0xa4ac('0x20')];var _0x58aa1c=_0x1c9aff?0x0:_0x505c33[_0xa4ac('0x1e')];var _0xf1235c=_0x1c9aff?_0x540b4a[_0xa4ac('0x20')]:_0x505c33[_0xa4ac('0x1e')]+_0x505c33[_0xa4ac('0x21')];var _0x5e3e8a;if(_0xf1235c>=_0x4d47b9){_0xf1235c=_0x4d47b9;_0x5e3e8a=0xc8;}else{_0x5e3e8a=0xce;}_0x38d690[_0xa4ac('0x1c')](_0x5e3e8a);return _0x38d690['set']('Content-Range',_0x58aa1c+'-'+_0xf1235c+'/'+_0x4d47b9)[_0xa4ac('0x1d')](_0x540b4a);}return null;};}function patchUpdates(_0x4e11ac){return function(_0x1f6ff2){try{jsonpatch[_0xa4ac('0x22')](_0x1f6ff2,_0x4e11ac,!![]);}catch(_0x1e14a0){return BPromise[_0xa4ac('0x23')](_0x1e14a0);}return _0x1f6ff2['save']();};}function saveUpdates(_0x5363f7,_0x5d7ff8){return function(_0x40b09d){if(_0x40b09d){return _0x40b09d[_0xa4ac('0x24')](_0x5363f7)[_0xa4ac('0x25')](function(_0x378b83){return _0x378b83;});}return null;};}function removeEntity(_0x46f9b,_0x21b6b5){return function(_0x8ad001){if(_0x8ad001){return _0x8ad001[_0xa4ac('0x26')]()[_0xa4ac('0x25')](function(){_0x46f9b[_0xa4ac('0x1c')](0xcc)[_0xa4ac('0x27')]();});}};}function handleEntityNotFound(_0x544db3,_0x5c1256){return function(_0x5ae549){if(!_0x5ae549){_0x544db3['sendStatus'](0x194);}return _0x5ae549;};}function handleError(_0x1f6564,_0x3b0a29){_0x3b0a29=_0x3b0a29||0x1f4;return function(_0x4181c2){logger[_0xa4ac('0x28')](_0x4181c2['stack']);if(_0x4181c2[_0xa4ac('0x29')]){delete _0x4181c2['name'];}_0x1f6564['status'](_0x3b0a29)['send'](_0x4181c2);};}exports[_0xa4ac('0x2a')]=function(_0x32c823,_0x4cf8fc){var _0x57f6b8={},_0x426c58={},_0x1d2951={'count':0x0,'rows':[]};var _0x2ff75a=_[_0xa4ac('0x2b')](db['ChatGroup'][_0xa4ac('0x2c')],function(_0x45ffe7){return{'name':_0x45ffe7[_0xa4ac('0x2d')],'type':_0x45ffe7['type'][_0xa4ac('0x2e')]};});_0x426c58[_0xa4ac('0x2f')]=_[_0xa4ac('0x2b')](_0x2ff75a,_0xa4ac('0x29'));_0x426c58[_0xa4ac('0x30')]=_[_0xa4ac('0x31')](_0x32c823['query']);_0x426c58[_0xa4ac('0x32')]=_['intersection'](_0x426c58[_0xa4ac('0x2f')],_0x426c58[_0xa4ac('0x30')]);_0x57f6b8[_0xa4ac('0x33')]=_['intersection'](_0x426c58[_0xa4ac('0x2f')],qs['fields'](_0x32c823[_0xa4ac('0x30')][_0xa4ac('0x34')]));_0x57f6b8[_0xa4ac('0x33')]=_0x57f6b8[_0xa4ac('0x33')][_0xa4ac('0x35')]?_0x57f6b8[_0xa4ac('0x33')]:_0x426c58['model'];if(!_0x32c823[_0xa4ac('0x30')]['hasOwnProperty'](_0xa4ac('0x36'))){_0x57f6b8[_0xa4ac('0x21')]=qs[_0xa4ac('0x21')](_0x32c823[_0xa4ac('0x30')]['limit']);_0x57f6b8[_0xa4ac('0x1e')]=qs[_0xa4ac('0x1e')](_0x32c823[_0xa4ac('0x30')][_0xa4ac('0x1e')]);}_0x57f6b8[_0xa4ac('0x37')]=qs[_0xa4ac('0x38')](_0x32c823[_0xa4ac('0x30')][_0xa4ac('0x38')]);_0x57f6b8['where']=qs[_0xa4ac('0x32')](_[_0xa4ac('0x39')](_0x32c823['query'],_0x426c58['filters']),_0x2ff75a);if(_0x32c823[_0xa4ac('0x30')][_0xa4ac('0x3a')]){_0x57f6b8[_0xa4ac('0x3b')]=_[_0xa4ac('0x3c')](_0x57f6b8['where'],{'$or':_[_0xa4ac('0x2b')](_0x2ff75a,function(_0x23ebd5){if(_0x23ebd5[_0xa4ac('0x3d')]!=='VIRTUAL'){var _0x5b9ecc={};_0x5b9ecc[_0x23ebd5[_0xa4ac('0x29')]]={'$like':'%'+_0x32c823[_0xa4ac('0x30')]['filter']+'%'};return _0x5b9ecc;}})});}_0x57f6b8=_[_0xa4ac('0x3c')]({},_0x57f6b8,_0x32c823[_0xa4ac('0x3e')]);var _0x4afb16={'where':_0x57f6b8[_0xa4ac('0x3b')]};return db['ChatGroup'][_0xa4ac('0x20')](_0x4afb16)['then'](function(_0x3492b6){_0x1d2951['count']=_0x3492b6;if(_0x32c823[_0xa4ac('0x30')][_0xa4ac('0x3f')]){_0x57f6b8['include']=[{'all':!![]}];}return db[_0xa4ac('0x40')][_0xa4ac('0x41')](_0x57f6b8);})['then'](function(_0x489226){_0x1d2951[_0xa4ac('0x42')]=_0x489226;return _0x1d2951;})[_0xa4ac('0x25')](respondWithFilteredResult(_0x4cf8fc,_0x57f6b8))[_0xa4ac('0x43')](handleError(_0x4cf8fc,null));};exports['show']=function(_0x2109d7,_0x155ca0){var _0x2be022={'raw':!![],'where':{'id':_0x2109d7[_0xa4ac('0x44')]['id']}},_0x353fd1={};_0x353fd1[_0xa4ac('0x2f')]=_['keys'](db[_0xa4ac('0x40')][_0xa4ac('0x2c')]);_0x353fd1['query']=_['keys'](_0x2109d7['query']);_0x353fd1[_0xa4ac('0x32')]=_[_0xa4ac('0x45')](_0x353fd1[_0xa4ac('0x2f')],_0x353fd1['query']);_0x2be022[_0xa4ac('0x33')]=_['intersection'](_0x353fd1['model'],qs[_0xa4ac('0x34')](_0x2109d7[_0xa4ac('0x30')][_0xa4ac('0x34')]));_0x2be022['attributes']=_0x2be022['attributes']['length']?_0x2be022[_0xa4ac('0x33')]:_0x353fd1[_0xa4ac('0x2f')];if(_0x2109d7[_0xa4ac('0x30')][_0xa4ac('0x3f')]){_0x2be022['include']=[{'all':!![]}];}_0x2be022=_[_0xa4ac('0x3c')]({},_0x2be022,_0x2109d7[_0xa4ac('0x3e')]);return db[_0xa4ac('0x40')]['find'](_0x2be022)[_0xa4ac('0x25')](handleEntityNotFound(_0x155ca0,null))[_0xa4ac('0x25')](respondWithResult(_0x155ca0,null))[_0xa4ac('0x43')](handleError(_0x155ca0,null));};exports[_0xa4ac('0x46')]=function(_0x2abfa7,_0x2579c1){return db[_0xa4ac('0x40')]['create'](_0x2abfa7[_0xa4ac('0x47')],{})[_0xa4ac('0x25')](respondWithResult(_0x2579c1,0xc9))[_0xa4ac('0x43')](handleError(_0x2579c1,null));};exports['update']=function(_0x2859e0,_0x5109b7){if(_0x2859e0['body']['id']){delete _0x2859e0['body']['id'];}return db[_0xa4ac('0x40')][_0xa4ac('0x48')]({'where':{'id':_0x2859e0['params']['id']}})['then'](handleEntityNotFound(_0x5109b7,null))['then'](saveUpdates(_0x2859e0[_0xa4ac('0x47')],null))[_0xa4ac('0x25')](respondWithResult(_0x5109b7,null))[_0xa4ac('0x43')](handleError(_0x5109b7,null));};exports[_0xa4ac('0x26')]=function(_0x4ee4e1,_0x39178){return db[_0xa4ac('0x40')][_0xa4ac('0x48')]({'where':{'id':_0x4ee4e1[_0xa4ac('0x44')]['id']}})['then'](handleEntityNotFound(_0x39178,null))[_0xa4ac('0x25')](removeEntity(_0x39178,null))[_0xa4ac('0x43')](handleError(_0x39178,null));};exports[_0xa4ac('0x49')]=function(_0xddb0b6,_0x93f93b){return db['ChatGroup']['describe']()[_0xa4ac('0x25')](respondWithResult(_0x93f93b,null))[_0xa4ac('0x43')](handleError(_0x93f93b,null));};exports[_0xa4ac('0x4a')]=function(_0x3c44f2,_0x5f1f2e,_0x3fabed){return db['ChatInternalMessage']['count']({'where':{'ChatGroupId':_0x3c44f2[_0xa4ac('0x44')]['id'],'ToId':_0x3c44f2[_0xa4ac('0x4b')]['id'],'read':![]}})[_0xa4ac('0x25')](function(_0x4ee9bf){return{'id':_[_0xa4ac('0x4c')](_0x3c44f2[_0xa4ac('0x44')]['id']),'count':_0x4ee9bf};})[_0xa4ac('0x25')](respondWithResult(_0x5f1f2e,null))[_0xa4ac('0x43')](handleError(_0x5f1f2e,null));};exports[_0xa4ac('0x4d')]=function(_0x43d8f3,_0x238a5f,_0x3c4bad){return db[_0xa4ac('0x40')][_0xa4ac('0x48')]({'where':{'id':_0x43d8f3[_0xa4ac('0x44')]['id']}})['then'](handleEntityNotFound(_0x238a5f,null))[_0xa4ac('0x25')](function(_0x364e3e){if(_0x364e3e){return _0x364e3e[_0xa4ac('0x4d')](_0x43d8f3['body'][_0xa4ac('0x4e')],_['omit'](_0x43d8f3['body'],['ids','id'])||{});}})['then'](respondWithResult(_0x238a5f,null))['catch'](handleError(_0x238a5f,null));};exports[_0xa4ac('0x4f')]=function(_0x5e690,_0x292622,_0x2f5df4){var _0x274017={};var _0x560558={};var _0x2787b1;var _0x27be1e;return db[_0xa4ac('0x40')]['findOne']({'where':{'id':_0x5e690['params']['id']}})[_0xa4ac('0x25')](handleEntityNotFound(_0x292622,null))[_0xa4ac('0x25')](function(_0x454cac){if(_0x454cac){_0x2787b1=_0x454cac;_0x560558[_0xa4ac('0x2f')]=_[_0xa4ac('0x31')](db[_0xa4ac('0x50')]['rawAttributes']);_0x560558[_0xa4ac('0x30')]=_['keys'](_0x5e690[_0xa4ac('0x30')]);_0x560558[_0xa4ac('0x32')]=_[_0xa4ac('0x45')](_0x560558[_0xa4ac('0x2f')],_0x560558[_0xa4ac('0x30')]);_0x274017[_0xa4ac('0x33')]=_['intersection'](_0x560558[_0xa4ac('0x2f')],qs[_0xa4ac('0x34')](_0x5e690[_0xa4ac('0x30')][_0xa4ac('0x34')]));_0x274017[_0xa4ac('0x33')]=_0x274017['attributes'][_0xa4ac('0x35')]?_0x274017[_0xa4ac('0x33')]:_0x560558['model'];_0x274017[_0xa4ac('0x37')]=qs[_0xa4ac('0x38')](_0x5e690[_0xa4ac('0x30')][_0xa4ac('0x38')]);_0x274017[_0xa4ac('0x3b')]=qs['filters'](_[_0xa4ac('0x39')](_0x5e690[_0xa4ac('0x30')],_0x560558['filters']));if(_0x5e690[_0xa4ac('0x30')][_0xa4ac('0x3a')]){_0x274017[_0xa4ac('0x3b')]=_[_0xa4ac('0x3c')](_0x274017[_0xa4ac('0x3b')],{'$or':_[_0xa4ac('0x2b')](_0x274017[_0xa4ac('0x33')],function(_0x4c8bca){var _0xffc38={};_0xffc38[_0x4c8bca]={'$like':'%'+_0x5e690[_0xa4ac('0x30')][_0xa4ac('0x3a')]+'%'};return _0xffc38;})});}_0x274017=_[_0xa4ac('0x3c')]({},_0x274017,_0x5e690[_0xa4ac('0x3e')]);return _0x2787b1[_0xa4ac('0x4f')](_0x274017);}})[_0xa4ac('0x25')](function(_0x58dfee){if(_0x58dfee){_0x27be1e=_0x58dfee['length'];if(!_0x5e690[_0xa4ac('0x30')][_0xa4ac('0x51')](_0xa4ac('0x36'))){_0x274017[_0xa4ac('0x21')]=qs[_0xa4ac('0x21')](_0x5e690[_0xa4ac('0x30')][_0xa4ac('0x21')]);_0x274017['offset']=qs[_0xa4ac('0x1e')](_0x5e690[_0xa4ac('0x30')][_0xa4ac('0x1e')]);}return _0x2787b1[_0xa4ac('0x4f')](_0x274017);}})['then'](function(_0x475794){if(_0x475794){return _0x475794?{'count':_0x27be1e,'rows':_0x475794}:null;}})[_0xa4ac('0x25')](respondWithResult(_0x292622,null))[_0xa4ac('0x43')](handleError(_0x292622,null));};exports[_0xa4ac('0x52')]=function(_0x289b9b,_0x28ba0a,_0x4b9226){return db['ChatGroup'][_0xa4ac('0x48')]({'where':{'id':_0x289b9b['params']['id']}})[_0xa4ac('0x25')](handleEntityNotFound(_0x28ba0a,null))[_0xa4ac('0x25')](function(_0x2a8105){if(_0x2a8105){return _0x2a8105[_0xa4ac('0x52')](_0x289b9b[_0xa4ac('0x30')]['ids']);}})[_0xa4ac('0x25')](respondWithStatusCode(_0x28ba0a,null))[_0xa4ac('0x43')](handleError(_0x28ba0a,null));};exports[_0xa4ac('0x53')]=function(_0x5d598f,_0x46bebd,_0x27ef86){if(_0x5d598f[_0xa4ac('0x47')]['id']){delete _0x5d598f[_0xa4ac('0x47')]['id'];}return db[_0xa4ac('0x40')]['find']({'where':{'id':_0x5d598f[_0xa4ac('0x44')]['id']}})[_0xa4ac('0x25')](handleEntityNotFound(_0x46bebd,null))[_0xa4ac('0x25')](function(_0x1d2c82){if(_0x1d2c82){_0x5d598f['body'][_0xa4ac('0x54')]=_0x1d2c82['id'];return db[_0xa4ac('0x55')][_0xa4ac('0x46')](_0x5d598f[_0xa4ac('0x47')]);}})[_0xa4ac('0x25')](respondWithResult(_0x46bebd,null))[_0xa4ac('0x43')](handleError(_0x46bebd,null));};exports['getMessages']=function(_0x4d3cda,_0x3c0887,_0x284008){var _0x50d559={};var _0x25be8f={};var _0x51462c;var _0x34e403;return db[_0xa4ac('0x40')]['findOne']({'where':{'id':_0x4d3cda[_0xa4ac('0x44')]['id']}})[_0xa4ac('0x25')](handleEntityNotFound(_0x3c0887,null))[_0xa4ac('0x25')](function(_0x51b9d2){if(_0x51b9d2){_0x51462c=_0x51b9d2;_0x25be8f[_0xa4ac('0x2f')]=_[_0xa4ac('0x31')](db[_0xa4ac('0x55')][_0xa4ac('0x2c')]);_0x25be8f[_0xa4ac('0x30')]=_['keys'](_0x4d3cda[_0xa4ac('0x30')]);_0x25be8f['filters']=_['intersection'](_0x25be8f['model'],_0x25be8f['query']);_0x50d559[_0xa4ac('0x33')]=_['intersection'](_0x25be8f[_0xa4ac('0x2f')],qs[_0xa4ac('0x34')](_0x4d3cda['query'][_0xa4ac('0x34')]));_0x50d559[_0xa4ac('0x33')]=_0x50d559[_0xa4ac('0x33')][_0xa4ac('0x35')]?_0x50d559['attributes']:_0x25be8f['model'];_0x50d559[_0xa4ac('0x37')]=qs[_0xa4ac('0x38')](_0x4d3cda[_0xa4ac('0x30')][_0xa4ac('0x38')]);_0x50d559[_0xa4ac('0x3b')]=qs[_0xa4ac('0x32')](_['pick'](_0x4d3cda[_0xa4ac('0x30')],_0x25be8f[_0xa4ac('0x32')]));if(_0x4d3cda[_0xa4ac('0x30')]['filter']){_0x50d559[_0xa4ac('0x3b')]=_[_0xa4ac('0x3c')](_0x50d559['where'],{'$or':_[_0xa4ac('0x2b')](_0x50d559[_0xa4ac('0x33')],function(_0x2a12e6){var _0x2a8703={};_0x2a8703[_0x2a12e6]={'$like':'%'+_0x4d3cda[_0xa4ac('0x30')][_0xa4ac('0x3a')]+'%'};return _0x2a8703;})});}if(_0x4d3cda[_0xa4ac('0x30')][_0xa4ac('0x56')]){var _0x226676=_0x4d3cda[_0xa4ac('0x30')][_0xa4ac('0x56')][_0xa4ac('0x57')](',');var _0xba6d10={};_0xba6d10[_0x226676[0x0]]={'$gte':moment(_0x226676[0x1])[_0xa4ac('0x58')]('YYYY-MM-DD\x20HH:mm:ss')};_0x50d559[_0xa4ac('0x3b')]=_[_0xa4ac('0x3c')](_0x50d559[_0xa4ac('0x3b')],_0xba6d10);}_0x50d559=_[_0xa4ac('0x3c')]({},_0x50d559,_0x4d3cda[_0xa4ac('0x3e')]);return _0x51462c[_0xa4ac('0x59')](_0x50d559);}})[_0xa4ac('0x25')](function(_0x49216e){if(_0x49216e){_0x34e403=_0x49216e[_0xa4ac('0x35')];if(!_0x4d3cda[_0xa4ac('0x30')][_0xa4ac('0x51')](_0xa4ac('0x36'))){_0x50d559[_0xa4ac('0x21')]=qs[_0xa4ac('0x21')](_0x4d3cda[_0xa4ac('0x30')][_0xa4ac('0x21')]);_0x50d559[_0xa4ac('0x1e')]=qs[_0xa4ac('0x1e')](_0x4d3cda['query'][_0xa4ac('0x1e')]);}return _0x51462c['getMessages'](_0x50d559);}})[_0xa4ac('0x25')](function(_0x3ab1e0){if(_0x3ab1e0){return _0x3ab1e0?{'count':_0x34e403,'rows':_0x3ab1e0}:null;}})[_0xa4ac('0x25')](respondWithResult(_0x3c0887,null))[_0xa4ac('0x43')](handleError(_0x3c0887,null));};
\ No newline at end of file
index 7280fba..17e7aee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7d14=['save','update','remove','emit','events','../../mysqldb','setMaxListeners'];(function(_0x3dbc20,_0x2fe008){var _0x1141cb=function(_0x288aae){while(--_0x288aae){_0x3dbc20['push'](_0x3dbc20['shift']());}};_0x1141cb(++_0x2fe008);}(_0x7d14,0x6d));var _0x47d1=function(_0x80544e,_0x37a3f3){_0x80544e=_0x80544e-0x0;var _0x4f9b90=_0x7d14[_0x80544e];return _0x4f9b90;};'use strict';var EventEmitter=require(_0x47d1('0x0'));var ChatGroup=require(_0x47d1('0x1'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x47d1('0x2')](0x0);var events={'afterCreate':_0x47d1('0x3'),'afterUpdate':_0x47d1('0x4'),'afterDestroy':_0x47d1('0x5')};function emitEvent(_0x5723fc){return function(_0x37d8f2,_0x33fe33,_0x8f3654){ChatGroupEvents[_0x47d1('0x6')](_0x5723fc+':'+_0x37d8f2['id'],_0x37d8f2);ChatGroupEvents[_0x47d1('0x6')](_0x5723fc,_0x37d8f2);_0x8f3654(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module['exports']=ChatGroupEvents;
\ No newline at end of file
+var _0xd709=['emit','hasOwnProperty','hook','exports','ChatGroup','setMaxListeners','update','remove'];(function(_0x9f78b9,_0x1b4ab3){var _0x2262e5=function(_0x20990f){while(--_0x20990f){_0x9f78b9['push'](_0x9f78b9['shift']());}};_0x2262e5(++_0x1b4ab3);}(_0xd709,0x104));var _0x9d70=function(_0x404bbf,_0x4e6a0a){_0x404bbf=_0x404bbf-0x0;var _0x52a7dc=_0xd709[_0x404bbf];return _0x52a7dc;};'use strict';var EventEmitter=require('events');var ChatGroup=require('../../mysqldb')['db'][_0x9d70('0x0')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x9d70('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x9d70('0x2'),'afterDestroy':_0x9d70('0x3')};function emitEvent(_0x4bdb69){return function(_0x587d75,_0x294a79,_0x391db5){ChatGroupEvents[_0x9d70('0x4')](_0x4bdb69+':'+_0x587d75['id'],_0x587d75);ChatGroupEvents[_0x9d70('0x4')](_0x4bdb69,_0x587d75);_0x391db5(null);};}for(var e in events){if(events[_0x9d70('0x5')](e)){var event=events[e];ChatGroup[_0x9d70('0x6')](e,emitEvent(event));}}module[_0x9d70('0x7')]=ChatGroupEvents;
\ No newline at end of file
index a669d75..f062e99 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd570=['ChatGroup','chat_groups','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./chatGroup.attributes','exports','define'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0xd570,0x1d0));var _0x0d57=function(_0x517a3f,_0x3521c5){_0x517a3f=_0x517a3f-0x0;var _0x25497b=_0xd570[_0x517a3f];return _0x25497b;};'use strict';var _=require(_0x0d57('0x0'));var util=require(_0x0d57('0x1'));var logger=require(_0x0d57('0x2'))(_0x0d57('0x3'));var moment=require('moment');var BPromise=require(_0x0d57('0x4'));var rp=require(_0x0d57('0x5'));var fs=require('fs');var path=require(_0x0d57('0x6'));var rimraf=require(_0x0d57('0x7'));var config=require(_0x0d57('0x8'));var attributes=require(_0x0d57('0x9'));module[_0x0d57('0xa')]=function(_0x53e1b1,_0x452a94){return _0x53e1b1[_0x0d57('0xb')](_0x0d57('0xc'),attributes,{'tableName':_0x0d57('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x12f8=['bluebird','path','../../config/environment','./chatGroup.attributes','exports','define','ChatGroup','chat_groups','lodash','util','api','moment'];(function(_0xca9e2,_0x350f76){var _0x145f56=function(_0x7f3b77){while(--_0x7f3b77){_0xca9e2['push'](_0xca9e2['shift']());}};_0x145f56(++_0x350f76);}(_0x12f8,0xec));var _0x812f=function(_0x1539ad,_0x2794de){_0x1539ad=_0x1539ad-0x0;var _0xc91daf=_0x12f8[_0x1539ad];return _0xc91daf;};'use strict';var _=require(_0x812f('0x0'));var util=require(_0x812f('0x1'));var logger=require('../../config/logger')(_0x812f('0x2'));var moment=require(_0x812f('0x3'));var BPromise=require(_0x812f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x812f('0x5'));var rimraf=require('rimraf');var config=require(_0x812f('0x6'));var attributes=require(_0x812f('0x7'));module[_0x812f('0x8')]=function(_0x20b80b,_0x4622e4){return _0x20b80b[_0x812f('0x9')](_0x812f('0xa'),attributes,{'tableName':_0x812f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 7ff2c1c..4bdcb94 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8758=['ChatGroup,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','localhost','./chatGroup.socket','request','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x4b13ce,_0x339cb0){var _0x427d4b=function(_0x26aaad){while(--_0x26aaad){_0x4b13ce['push'](_0x4b13ce['shift']());}};_0x427d4b(++_0x339cb0);}(_0x8758,0x1b8));var _0x8875=function(_0x1856a7,_0x3d6bec){_0x1856a7=_0x1856a7-0x0;var _0xa0d4f=_0x8758[_0x1856a7];return _0xa0d4f;};'use strict';var _=require(_0x8875('0x0'));var util=require(_0x8875('0x1'));var moment=require('moment');var BPromise=require(_0x8875('0x2'));var rs=require(_0x8875('0x3'));var fs=require('fs');var Redis=require(_0x8875('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x8875('0x5'));var logger=require(_0x8875('0x6'))(_0x8875('0x7'));var config=require(_0x8875('0x8'));var jayson=require(_0x8875('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x8875('0xa')]=_['defaults'](config[_0x8875('0xa')],{'host':_0x8875('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8875('0xa')]));require(_0x8875('0xc'))['register'](socket);function respondWithRpcPromise(_0xab0840,_0x5496c8,_0x4f3ad5){return new BPromise(function(_0x6adc25,_0x40d139){return client[_0x8875('0xd')](_0xab0840,_0x4f3ad5)['then'](function(_0x968393){logger['info']('ChatGroup,\x20%s,\x20%s',_0x5496c8,_0x8875('0xe'));logger[_0x8875('0xf')](_0x8875('0x10'),_0x5496c8,_0x8875('0xe'),JSON[_0x8875('0x11')](_0x968393));if(_0x968393['error']){if(_0x968393[_0x8875('0x12')]['code']===0x1f4){logger[_0x8875('0x12')]('ChatGroup,\x20%s,\x20%s',_0x5496c8,_0x968393[_0x8875('0x12')][_0x8875('0x13')]);return _0x40d139(_0x968393['error'][_0x8875('0x13')]);}logger[_0x8875('0x12')]('ChatGroup,\x20%s,\x20%s',_0x5496c8,_0x968393['error'][_0x8875('0x13')]);return _0x6adc25(_0x968393[_0x8875('0x12')]['message']);}else{logger['info'](_0x8875('0x14'),_0x5496c8,'request\x20sent');_0x6adc25(_0x968393[_0x8875('0x15')]['message']);}})[_0x8875('0x16')](function(_0x1cc2a8){logger[_0x8875('0x12')](_0x8875('0x14'),_0x5496c8,_0x1cc2a8);_0x40d139(_0x1cc2a8);});});}
\ No newline at end of file
+var _0xaeaf=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','./chatGroup.socket','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util'];(function(_0x419893,_0x1aab65){var _0x542714=function(_0x53efb1){while(--_0x53efb1){_0x419893['push'](_0x419893['shift']());}};_0x542714(++_0x1aab65);}(_0xaeaf,0x14e));var _0xfaea=function(_0x311e77,_0x49a459){_0x311e77=_0x311e77-0x0;var _0x559c54=_0xaeaf[_0x311e77];return _0x559c54;};'use strict';var _=require(_0xfaea('0x0'));var util=require(_0xfaea('0x1'));var moment=require(_0xfaea('0x2'));var BPromise=require(_0xfaea('0x3'));var rs=require(_0xfaea('0x4'));var fs=require('fs');var Redis=require(_0xfaea('0x5'));var db=require(_0xfaea('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xfaea('0x7'))(_0xfaea('0x8'));var config=require(_0xfaea('0x9'));var jayson=require(_0xfaea('0xa'));var client=jayson['client'][_0xfaea('0xb')]({'port':0x232a});config[_0xfaea('0xc')]=_[_0xfaea('0xd')](config[_0xfaea('0xc')],{'host':_0xfaea('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfaea('0xc')]));require(_0xfaea('0xf'))['register'](socket);function respondWithRpcPromise(_0x191039,_0x3c1f4d,_0x2462f5){return new BPromise(function(_0x5078b6,_0x116379){return client[_0xfaea('0x10')](_0x191039,_0x2462f5)[_0xfaea('0x11')](function(_0x5c4746){logger[_0xfaea('0x12')](_0xfaea('0x13'),_0x3c1f4d,_0xfaea('0x14'));logger[_0xfaea('0x15')](_0xfaea('0x16'),_0x3c1f4d,'request\x20sent',JSON[_0xfaea('0x17')](_0x5c4746));if(_0x5c4746['error']){if(_0x5c4746[_0xfaea('0x18')]['code']===0x1f4){logger[_0xfaea('0x18')](_0xfaea('0x13'),_0x3c1f4d,_0x5c4746['error'][_0xfaea('0x19')]);return _0x116379(_0x5c4746[_0xfaea('0x18')][_0xfaea('0x19')]);}logger[_0xfaea('0x18')](_0xfaea('0x13'),_0x3c1f4d,_0x5c4746['error']['message']);return _0x5078b6(_0x5c4746[_0xfaea('0x18')][_0xfaea('0x19')]);}else{logger[_0xfaea('0x12')](_0xfaea('0x13'),_0x3c1f4d,_0xfaea('0x14'));_0x5078b6(_0x5c4746[_0xfaea('0x1a')][_0xfaea('0x19')]);}})[_0xfaea('0x1b')](function(_0x328924){logger[_0xfaea('0x18')]('ChatGroup,\x20%s,\x20%s',_0x3c1f4d,_0x328924);_0x116379(_0x328924);});});}
\ No newline at end of file
index 63106d3..74efbcb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4c8d=['chatGroup:','./chatGroup.events','remove','update','emit','removeListener','register','length'];(function(_0x24ae03,_0x334660){var _0x38a29e=function(_0x25e64b){while(--_0x25e64b){_0x24ae03['push'](_0x24ae03['shift']());}};_0x38a29e(++_0x334660);}(_0x4c8d,0xf9));var _0xd4c8=function(_0x6ff6c1,_0x2777bf){_0x6ff6c1=_0x6ff6c1-0x0;var _0x20b599=_0x4c8d[_0x6ff6c1];return _0x20b599;};'use strict';var ChatGroupEvents=require(_0xd4c8('0x0'));var events=['save',_0xd4c8('0x1'),_0xd4c8('0x2')];function createListener(_0x207298,_0x26b550){return function(_0x5b73ac){_0x26b550[_0xd4c8('0x3')](_0x207298,_0x5b73ac);};}function removeListener(_0x10c8f7,_0x380a0e){return function(){ChatGroupEvents[_0xd4c8('0x4')](_0x10c8f7,_0x380a0e);};}exports[_0xd4c8('0x5')]=function(_0x1274d3){for(var _0x44f7b3=0x0,_0x30bafc=events[_0xd4c8('0x6')];_0x44f7b3<_0x30bafc;_0x44f7b3++){var _0x4de03e=events[_0x44f7b3];var _0x15e6e7=createListener(_0xd4c8('0x7')+_0x4de03e,_0x1274d3);ChatGroupEvents['on'](_0x4de03e,_0x15e6e7);}};
\ No newline at end of file
+var _0xe6b9=['./chatGroup.events','update','emit','removeListener','register','chatGroup:'];(function(_0x14f814,_0x1e4ffa){var _0x351e4d=function(_0x3a3342){while(--_0x3a3342){_0x14f814['push'](_0x14f814['shift']());}};_0x351e4d(++_0x1e4ffa);}(_0xe6b9,0x144));var _0x9e6b=function(_0x413b4d,_0xa3459c){_0x413b4d=_0x413b4d-0x0;var _0x8b810a=_0xe6b9[_0x413b4d];return _0x8b810a;};'use strict';var ChatGroupEvents=require(_0x9e6b('0x0'));var events=['save','remove',_0x9e6b('0x1')];function createListener(_0x3aba29,_0x369d3c){return function(_0x517a60){_0x369d3c[_0x9e6b('0x2')](_0x3aba29,_0x517a60);};}function removeListener(_0x2e6f0d,_0xf0ed5a){return function(){ChatGroupEvents[_0x9e6b('0x3')](_0x2e6f0d,_0xf0ed5a);};}exports[_0x9e6b('0x4')]=function(_0x57df67){for(var _0x499403=0x0,_0x2f5899=events['length'];_0x499403<_0x2f5899;_0x499403++){var _0x5df622=events[_0x499403];var _0xe6a057=createListener(_0x9e6b('0x5')+_0x5df622,_0x57df67);ChatGroupEvents['on'](_0x5df622,_0xe6a057);}};
\ No newline at end of file
index b0eed18..f6e1b82 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa0f8=['get','isAuthenticated','index','/describe','describe','/:id','show','/:id/unread','getUnread','getMembers','getMessages','create','post','/:id/members','addMembers','/:id/messages','addMessage','put','update','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller'];(function(_0x4d6d3d,_0x3600f9){var _0x45e62d=function(_0x56a25b){while(--_0x56a25b){_0x4d6d3d['push'](_0x4d6d3d['shift']());}};_0x45e62d(++_0x3600f9);}(_0xa0f8,0x1a9));var _0x8a0f=function(_0x2b8077,_0x453634){_0x2b8077=_0x2b8077-0x0;var _0x308091=_0xa0f8[_0x2b8077];return _0x308091;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x8a0f('0x0'));var timeout=require(_0x8a0f('0x1'));var express=require(_0x8a0f('0x2'));var router=express[_0x8a0f('0x3')]();var fs_extra=require(_0x8a0f('0x4'));var auth=require(_0x8a0f('0x5'));var interaction=require(_0x8a0f('0x6'));var config=require(_0x8a0f('0x7'));var controller=require(_0x8a0f('0x8'));router[_0x8a0f('0x9')]('/',auth[_0x8a0f('0xa')](),controller[_0x8a0f('0xb')]);router[_0x8a0f('0x9')](_0x8a0f('0xc'),auth[_0x8a0f('0xa')](),controller[_0x8a0f('0xd')]);router[_0x8a0f('0x9')](_0x8a0f('0xe'),auth[_0x8a0f('0xa')](),controller[_0x8a0f('0xf')]);router[_0x8a0f('0x9')](_0x8a0f('0x10'),auth[_0x8a0f('0xa')](),controller[_0x8a0f('0x11')]);router[_0x8a0f('0x9')]('/:id/members',auth[_0x8a0f('0xa')](),controller[_0x8a0f('0x12')]);router[_0x8a0f('0x9')]('/:id/messages',auth[_0x8a0f('0xa')](),controller[_0x8a0f('0x13')]);router['post']('/',auth[_0x8a0f('0xa')](),controller[_0x8a0f('0x14')]);router[_0x8a0f('0x15')](_0x8a0f('0x16'),auth[_0x8a0f('0xa')](),controller[_0x8a0f('0x17')]);router[_0x8a0f('0x15')](_0x8a0f('0x18'),auth[_0x8a0f('0xa')](),controller[_0x8a0f('0x19')]);router[_0x8a0f('0x1a')](_0x8a0f('0xe'),auth[_0x8a0f('0xa')](),controller[_0x8a0f('0x1b')]);router[_0x8a0f('0x1c')](_0x8a0f('0xe'),auth[_0x8a0f('0xa')](),controller[_0x8a0f('0x1d')]);router[_0x8a0f('0x1c')]('/:id/members',auth[_0x8a0f('0xa')](),controller['removeMembers']);module[_0x8a0f('0x1e')]=router;
\ No newline at end of file
+var _0xae91=['index','/describe','describe','show','getUnread','getMembers','/:id/messages','getMessages','post','create','/:id/members','addMembers','put','/:id','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x148fa9,_0x5232a7){var _0x5c87da=function(_0x5c1323){while(--_0x5c1323){_0x148fa9['push'](_0x148fa9['shift']());}};_0x5c87da(++_0x5232a7);}(_0xae91,0xd5));var _0x1ae9=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xae91[_0x3947c9];return _0x2e7871;};'use strict';var multer=require(_0x1ae9('0x0'));var util=require(_0x1ae9('0x1'));var path=require(_0x1ae9('0x2'));var timeout=require(_0x1ae9('0x3'));var express=require(_0x1ae9('0x4'));var router=express[_0x1ae9('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x1ae9('0x6'));var interaction=require(_0x1ae9('0x7'));var config=require(_0x1ae9('0x8'));var controller=require('./chatGroup.controller');router[_0x1ae9('0x9')]('/',auth[_0x1ae9('0xa')](),controller[_0x1ae9('0xb')]);router[_0x1ae9('0x9')](_0x1ae9('0xc'),auth[_0x1ae9('0xa')](),controller[_0x1ae9('0xd')]);router['get']('/:id',auth[_0x1ae9('0xa')](),controller[_0x1ae9('0xe')]);router[_0x1ae9('0x9')]('/:id/unread',auth['isAuthenticated'](),controller[_0x1ae9('0xf')]);router[_0x1ae9('0x9')]('/:id/members',auth[_0x1ae9('0xa')](),controller[_0x1ae9('0x10')]);router[_0x1ae9('0x9')](_0x1ae9('0x11'),auth[_0x1ae9('0xa')](),controller[_0x1ae9('0x12')]);router[_0x1ae9('0x13')]('/',auth[_0x1ae9('0xa')](),controller[_0x1ae9('0x14')]);router['post'](_0x1ae9('0x15'),auth['isAuthenticated'](),controller[_0x1ae9('0x16')]);router[_0x1ae9('0x13')]('/:id/messages',auth['isAuthenticated'](),controller['addMessage']);router[_0x1ae9('0x17')](_0x1ae9('0x18'),auth[_0x1ae9('0xa')](),controller[_0x1ae9('0x19')]);router[_0x1ae9('0x1a')]('/:id',auth[_0x1ae9('0xa')](),controller[_0x1ae9('0x1b')]);router[_0x1ae9('0x1a')](_0x1ae9('0x15'),auth[_0x1ae9('0xa')](),controller['removeMembers']);module['exports']=router;
\ No newline at end of file
index 81dad6e..655553d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8caf=['INTEGER','ENUM','star','thumb','TEXT','STRING','DATE','long','out','exports','BOOLEAN'];(function(_0x3a8bcc,_0x303a01){var _0x24e335=function(_0x159711){while(--_0x159711){_0x3a8bcc['push'](_0x3a8bcc['shift']());}};_0x24e335(++_0x303a01);}(_0x8caf,0x1ab));var _0xf8ca=function(_0x3d2438,_0x2e7922){_0x3d2438=_0x3d2438-0x0;var _0xd18de5=_0x8caf[_0x3d2438];return _0xd18de5;};'use strict';var Sequelize=require('sequelize');module[_0xf8ca('0x0')]={'closed':{'type':Sequelize[_0xf8ca('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xf8ca('0x2')]},'ratingType':{'type':Sequelize[_0xf8ca('0x3')](_0xf8ca('0x4'),_0xf8ca('0x5')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize[_0xf8ca('0x6')]},'pathTranscript':{'type':Sequelize[_0xf8ca('0x6')]},'mailTranscript':{'type':Sequelize[_0xf8ca('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xf8ca('0x8')]},'disposition':{'type':Sequelize[_0xf8ca('0x7')]},'secondDisposition':{'type':Sequelize[_0xf8ca('0x7')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xf8ca('0x7')]},'browserName':{'type':Sequelize[_0xf8ca('0x7')]},'browserVersion':{'type':Sequelize[_0xf8ca('0x7')]},'osName':{'type':Sequelize[_0xf8ca('0x7')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0xf8ca('0x7')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0xf8ca('0x6')]},'customerIp':{'type':Sequelize[_0xf8ca('0x7')]},'formData':{'type':Sequelize[_0xf8ca('0x6')](_0xf8ca('0x9'))},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize[_0xf8ca('0x8')]},'lastMsgDirection':{'type':Sequelize[_0xf8ca('0x3')]('in',_0xf8ca('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xf8ca('0x7')]},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize[_0xf8ca('0x6')]},'autoreplyExecuted':{'type':Sequelize[_0xf8ca('0x1')],'defaultValue':![]}};
\ No newline at end of file
+var _0xaf4c=['long','DATE','out','exports','BOOLEAN','ENUM','star','thumb','TEXT','STRING'];(function(_0x5e2976,_0x2cc1ec){var _0x5979c9=function(_0x21c481){while(--_0x21c481){_0x5e2976['push'](_0x5e2976['shift']());}};_0x5979c9(++_0x2cc1ec);}(_0xaf4c,0x1ed));var _0xcaf4=function(_0x303e1c,_0x34b41e){_0x303e1c=_0x303e1c-0x0;var _0x2ea37f=_0xaf4c[_0x303e1c];return _0x2ea37f;};'use strict';var Sequelize=require('sequelize');module[_0xcaf4('0x0')]={'closed':{'type':Sequelize[_0xcaf4('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0xcaf4('0x2')](_0xcaf4('0x3'),_0xcaf4('0x4')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize[_0xcaf4('0x5')]},'pathTranscript':{'type':Sequelize[_0xcaf4('0x5')]},'mailTranscript':{'type':Sequelize[_0xcaf4('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xcaf4('0x6')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xcaf4('0x6')]},'note':{'type':Sequelize[_0xcaf4('0x6')]},'browserName':{'type':Sequelize[_0xcaf4('0x6')]},'browserVersion':{'type':Sequelize[_0xcaf4('0x6')]},'osName':{'type':Sequelize[_0xcaf4('0x6')]},'osVersion':{'type':Sequelize[_0xcaf4('0x6')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize[_0xcaf4('0x6')]},'referer':{'type':Sequelize[_0xcaf4('0x5')]},'customerIp':{'type':Sequelize[_0xcaf4('0x6')]},'formData':{'type':Sequelize[_0xcaf4('0x5')](_0xcaf4('0x7'))},'read1stAt':{'type':Sequelize[_0xcaf4('0x8')]},'lastMsgAt':{'type':Sequelize[_0xcaf4('0x8')]},'lastMsgDirection':{'type':Sequelize[_0xcaf4('0x2')]('in',_0xcaf4('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0xcaf4('0x6')]},'vidaooSessionId':{'type':Sequelize[_0xcaf4('0x5')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
index eb34b71..8f6c00b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa8a8=['map','fullname','TagIds','Tags','push','talking','answered','unmanaged','abandoned','total','closed','waiting','disposition','UserId','ChatInteraction','rawAttributes','fieldName','type','key','model','name','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','from','u.id','ui.ChatInteractionId','left_join','users','u.id\x20=\x20ui.UserId','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_messages','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','conditions','find','unreadMessages','value','having','Contact','operator','$substring','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','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?','text','some','compact','isEmpty','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','isNumeric','i.id','QueryTypes','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','t.id\x20IN\x20?','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','sequelize','count','keyBy','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','c.firstName','Contact.firstName','c.lastName','c.email','c.phone','Contact.phone','c.mobile','c.fax','Contact.fax','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','toString','ui.ChatInteractionId\x20IN\x20?','groupBy','all','rows','show','includeAll','options','create','params','destroy','describe','createVidaooSession','findOne','vidaooApiKey','vidaooTopic','vidaooNote','vidaooMetadata','vidaooEscalation','POST','follow','metadata','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','join_url','out','updateAttributes','customUpdate','CmContact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','Interaction\x20already\x20assigned','AbandonInteraction','attachmentUpload','file','originalname','basename','mimetype','attachmentDownload','Unauthorized','Attachment','attachId','join','root','server/files/attachments/','download','server/files/chat/upload/','transcript-%s.txt','now','Messages','agentAlias','customer','format','%s%d','Visitor','agentIdentifier','website_alias','System','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','secret','MailAccount','Smtp','CloudProvider','getSmtpOptions','SendMail','sendMail','mailTranscript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','ChatMessage','ChatInteractionId','YYYY-MM-DD\x20HH:mm:ss','include','getMyMessages','findAll','setTags','chatInteractionTags:save','removeTags','server','attachments','transcript-%d-%s.zip','firstName','lastName','ChatWebsite','Account','Owner','mkdirSync','Chat','N.A.','closedAt','browserName','referer','customerPort','existsSync','createReadStream','pipe','createWriteStream','renderFile','views','downloadInteraction.ejs','transcript-','createPdfFromHTML','err','rimraf','zip-dir','request-promise','moment','mustache','util','path','ejs','lodash','squel','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','./chatInteraction.socket','jayson/promise','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','undefined','limit','offset','set','update','stack','render','merge','body','contact','agent','interaction','account','Users'];(function(_0x3130c7,_0x3e1c27){var _0x4c2a82=function(_0x54c292){while(--_0x54c292){_0x3130c7['push'](_0x3130c7['shift']());}};_0x4c2a82(++_0x3e1c27);}(_0xa8a8,0xec));var _0x8a8a=function(_0x4ea5df,_0x5ea887){_0x4ea5df=_0x4ea5df-0x0;var _0xb2cdd9=_0xa8a8[_0x4ea5df];return _0xb2cdd9;};'use strict';var rimraf=require(_0x8a8a('0x0'));var zipdir=require(_0x8a8a('0x1'));var rp=require(_0x8a8a('0x2'));var moment=require(_0x8a8a('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x8a8a('0x4'));var util=require(_0x8a8a('0x5'));var path=require(_0x8a8a('0x6'));var ejs=require(_0x8a8a('0x7'));var fs=require('fs');var _=require(_0x8a8a('0x8'));var squel=require(_0x8a8a('0x9'));var Redis=require(_0x8a8a('0xa'));var qs=require(_0x8a8a('0xb'));var as=require(_0x8a8a('0xc'));var pdf=require(_0x8a8a('0xd'));var logger=require(_0x8a8a('0xe'))(_0x8a8a('0xf'));var config=require(_0x8a8a('0x10'));var db=require(_0x8a8a('0x11'))['db'];config[_0x8a8a('0x12')]=_['defaults'](config['redis'],{'host':_0x8a8a('0x13'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8a8a('0x12')]));require(_0x8a8a('0x14'))['register'](socket);var jayson=require(_0x8a8a('0x15'));var client=jayson[_0x8a8a('0x16')][_0x8a8a('0x17')]({'port':0x232b});var client9004=jayson['client'][_0x8a8a('0x17')]({'port':0x232c});function respondWithRpcPromise(_0x42fab7,_0x330796,_0x234481,_0x4a1b91){return new BPromise(function(_0x23febf,_0x4e5d74){var _0x25e1d5=_0x4a1b91||client;return _0x25e1d5[_0x8a8a('0x18')](_0x42fab7,_0x234481)[_0x8a8a('0x19')](function(_0x2f6e33){logger[_0x8a8a('0x1a')](_0x8a8a('0x1b'),_0x330796,_0x8a8a('0x1c'));logger['debug'](_0x8a8a('0x1d'),_0x330796,'request\x20sent',JSON[_0x8a8a('0x1e')](_0x2f6e33));if(_0x2f6e33[_0x8a8a('0x1f')]){if(_0x2f6e33[_0x8a8a('0x1f')][_0x8a8a('0x20')]===0x1f4){logger[_0x8a8a('0x1f')]('ChatInteraction,\x20%s,\x20%s',_0x330796,_0x2f6e33[_0x8a8a('0x1f')][_0x8a8a('0x21')]);return _0x4e5d74(_0x2f6e33[_0x8a8a('0x1f')][_0x8a8a('0x21')]);}logger[_0x8a8a('0x1f')](_0x8a8a('0x1b'),_0x330796,_0x2f6e33['error']['message']);return _0x23febf(_0x2f6e33['error']['message']);}else{logger['info'](_0x8a8a('0x1b'),_0x330796,_0x8a8a('0x1c'));_0x23febf(_0x2f6e33[_0x8a8a('0x22')][_0x8a8a('0x21')]);}})[_0x8a8a('0x23')](function(_0x2f6af2){logger[_0x8a8a('0x1f')](_0x8a8a('0x1b'),_0x330796,_0x2f6af2);_0x4e5d74(_0x2f6af2);});});}function respondWithStatusCode(_0x25d5d4,_0x2deecb){_0x2deecb=_0x2deecb||0xcc;return function(_0xb9db78){if(_0xb9db78){return _0x25d5d4[_0x8a8a('0x24')](_0x2deecb);}return _0x25d5d4[_0x8a8a('0x25')](_0x2deecb)[_0x8a8a('0x26')]();};}function respondWithResult(_0x442c00,_0x545a38){_0x545a38=_0x545a38||0xc8;return function(_0x3c096f){if(_0x3c096f){return _0x442c00[_0x8a8a('0x25')](_0x545a38)[_0x8a8a('0x27')](_0x3c096f);}};}function respondWithFilteredResult(_0x7662e,_0x36e6d4){return function(_0x251315){if(_0x251315){var _0x3aa46d=typeof _0x36e6d4['offset']===_0x8a8a('0x28')&&typeof _0x36e6d4[_0x8a8a('0x29')]===_0x8a8a('0x28');var _0x54ff7e=_0x251315['count'];var _0x2dafcd=_0x3aa46d?0x0:_0x36e6d4[_0x8a8a('0x2a')];var _0x5c70bd=_0x3aa46d?_0x251315['count']:_0x36e6d4['offset']+_0x36e6d4[_0x8a8a('0x29')];var _0x5c7e58;if(_0x5c70bd>=_0x54ff7e){_0x5c70bd=_0x54ff7e;_0x5c7e58=0xc8;}else{_0x5c7e58=0xce;}_0x7662e[_0x8a8a('0x25')](_0x5c7e58);return _0x7662e[_0x8a8a('0x2b')]('Content-Range',_0x2dafcd+'-'+_0x5c70bd+'/'+_0x54ff7e)[_0x8a8a('0x27')](_0x251315);}return null;};}function saveUpdates(_0x2c8f27){return function(_0x250852){if(_0x250852){return _0x250852[_0x8a8a('0x2c')](_0x2c8f27)[_0x8a8a('0x19')](function(_0x3d6594){return _0x3d6594;});}return null;};}function removeEntity(_0x3e73b1){return function(_0x2a2917){if(_0x2a2917){return _0x2a2917['destroy']()['then'](function(){_0x3e73b1['status'](0xcc)[_0x8a8a('0x26')]();});}};}function handleEntityNotFound(_0x3bf77d){return function(_0x5f301e){if(!_0x5f301e){_0x3bf77d[_0x8a8a('0x24')](0x194);}return _0x5f301e;};}function handleError(_0x304e83,_0x481e92){_0x481e92=_0x481e92||0x1f4;return function(_0x3abab2){logger[_0x8a8a('0x1f')](_0x3abab2[_0x8a8a('0x2d')]);if(_0x3abab2['name']){delete _0x3abab2['name'];}_0x304e83[_0x8a8a('0x25')](_0x481e92)['send'](_0x3abab2);};}function getMustacheRender(_0x2a3198,_0x3a4aa6){return Mustache[_0x8a8a('0x2e')](_0x2a3198,_[_0x8a8a('0x2f')](_0x3a4aa6[_0x8a8a('0x30')],{'contact':_0x3a4aa6[_0x8a8a('0x31')],'message':_0x3a4aa6[_0x8a8a('0x21')],'agent':_0x3a4aa6[_0x8a8a('0x32')],'interaction':_0x3a4aa6[_0x8a8a('0x33')],'account':_0x3a4aa6[_0x8a8a('0x34')]}))||'';}function getInteractionUsers(_0x27de26,_0x45ddb4){return new BPromise(function(_0x17a36c,_0x37e644){try{if(_0x45ddb4[_0x27de26['id']]){_0x27de26[_0x8a8a('0x35')]=_[_0x8a8a('0x36')](_0x45ddb4[_0x27de26['id']],function(_0x8e3017){return{'id':_0x8e3017['id'],'fullname':_0x8e3017[_0x8a8a('0x37')]};});}}catch(_0x4c8003){_0x37e644(_0x4c8003);}_0x17a36c(_0x27de26);});}function getInteractionTags(_0x4cc605,_0x53da01){return new BPromise(function(_0x34db33,_0x9e0128){try{if(_0x4cc605[_0x8a8a('0x38')]){_0x4cc605[_0x8a8a('0x39')]=[];_0x4cc605[_0x8a8a('0x38')]['split'](',')['forEach'](function(_0x8d8481){_0x4cc605['Tags'][_0x8a8a('0x3a')](_0x53da01[_0x8d8481]);});}delete _0x4cc605['TagIds'];}catch(_0x52811b){_0x9e0128(_0x52811b);}_0x34db33(_0x4cc605);});}function updateChatInteraction(_0x1b33eb,_0x1ac761,_0x285e2c){return new BPromise(function(_0x19d41d,_0x31307c){return getInteractionUsers(_0x1b33eb,_0x285e2c)[_0x8a8a('0x19')](function(_0x20584a){return getInteractionTags(_0x20584a,_0x1ac761);})['then'](function(_0x40d509){return getStateInteraction(_0x40d509);})[_0x8a8a('0x19')](function(_0x46edea){_0x19d41d(_0x46edea);})['catch'](function(_0x3a4662){_0x31307c(_0x3a4662);});});}function getStateInteraction(_0x323f89){return new BPromise(function(_0x3f845e){_0x323f89['waiting']=0x0;_0x323f89[_0x8a8a('0x3b')]=0x0;_0x323f89[_0x8a8a('0x3c')]=0x0;_0x323f89[_0x8a8a('0x3d')]=0x0;_0x323f89[_0x8a8a('0x3e')]=0x0;_0x323f89[_0x8a8a('0x3f')]=0x0;if(!_0x323f89[_0x8a8a('0x40')]&&!_0x323f89['UserId']){_0x323f89['waiting']+=0x1;}if(!_0x323f89[_0x8a8a('0x40')]&&_0x323f89['UserId']){_0x323f89[_0x8a8a('0x3b')]+=0x1;if(_0x323f89[_0x8a8a('0x41')]){_0x323f89['waiting']-=0x1;}}if(_0x323f89['closed']&&_0x323f89[_0x8a8a('0x42')]===_0x8a8a('0x3e')){_0x323f89[_0x8a8a('0x3e')]+=0x1;if(_0x323f89[_0x8a8a('0x41')]){_0x323f89['waiting']-=0x1;}}else if(_0x323f89[_0x8a8a('0x40')]&&!_0x323f89['UserId']&&_0x323f89[_0x8a8a('0x42')]){_0x323f89[_0x8a8a('0x3d')]+=0x1;if(_0x323f89['waiting']){_0x323f89[_0x8a8a('0x41')]-=0x1;}}else if(_0x323f89[_0x8a8a('0x40')]&&_0x323f89[_0x8a8a('0x43')]){_0x323f89['answered']+=0x1;if(_0x323f89[_0x8a8a('0x3b')]){_0x323f89[_0x8a8a('0x3b')]-=0x1;}}_0x323f89[_0x8a8a('0x3f')]+=0x1;_0x3f845e(_0x323f89);});}exports['index']=function(_0x5466d4,_0x44aed3){var _0x1eb8bf={},_0x1b842a={},_0x5c6c98={'count':0x0,'rows':[]};var _0x18449b=_[_0x8a8a('0x36')](db[_0x8a8a('0x44')][_0x8a8a('0x45')],function(_0x2d4c11){return{'name':_0x2d4c11[_0x8a8a('0x46')],'type':_0x2d4c11[_0x8a8a('0x47')][_0x8a8a('0x48')]};});_0x1b842a[_0x8a8a('0x49')]=_[_0x8a8a('0x36')](_0x18449b,_0x8a8a('0x4a'));_0x1b842a['query']=_[_0x8a8a('0x4b')](_0x5466d4[_0x8a8a('0x4c')]);_0x1b842a[_0x8a8a('0x4d')]=_[_0x8a8a('0x4e')](_0x1b842a[_0x8a8a('0x49')],_0x1b842a[_0x8a8a('0x4c')]);_0x1eb8bf['attributes']=_[_0x8a8a('0x4e')](_0x1b842a[_0x8a8a('0x49')],qs[_0x8a8a('0x4f')](_0x5466d4[_0x8a8a('0x4c')]['fields']));_0x1eb8bf[_0x8a8a('0x50')]=_0x1eb8bf[_0x8a8a('0x50')][_0x8a8a('0x51')]?_0x1eb8bf['attributes']:_0x1b842a['model'];if(!_0x5466d4[_0x8a8a('0x4c')][_0x8a8a('0x52')](_0x8a8a('0x53'))){_0x1eb8bf[_0x8a8a('0x29')]=qs[_0x8a8a('0x29')](_0x5466d4[_0x8a8a('0x4c')][_0x8a8a('0x29')]);_0x1eb8bf[_0x8a8a('0x2a')]=qs[_0x8a8a('0x2a')](_0x5466d4['query']['offset']);}_0x1eb8bf[_0x8a8a('0x54')]=qs[_0x8a8a('0x55')](_0x5466d4['query']['sort']);_0x1eb8bf[_0x8a8a('0x56')]=qs['filters'](_[_0x8a8a('0x57')](_0x5466d4['query'],_0x1b842a[_0x8a8a('0x4d')]),_0x18449b);var _0xa2b8a1=[];var _0x339be6=squel[_0x8a8a('0x58')]()[_0x8a8a('0x59')]('id')[_0x8a8a('0x59')](_0x8a8a('0x4a'))[_0x8a8a('0x59')](_0x8a8a('0x5a'))[_0x8a8a('0x5b')]('tools_tags');var _0x329bfb=squel[_0x8a8a('0x58')]()[_0x8a8a('0x59')](_0x8a8a('0x5c'))[_0x8a8a('0x59')]('u.fullname')[_0x8a8a('0x59')](_0x8a8a('0x5d'))['from']('user_has_chat_interactions','ui')[_0x8a8a('0x5e')](_0x8a8a('0x5f'),'u',_0x8a8a('0x60'));var _0x2ba3bf=squel[_0x8a8a('0x58')]()[_0x8a8a('0x5b')]('chat_interactions','i')['left_join']('cm_contacts','c',_0x8a8a('0x61'))['left_join'](_0x8a8a('0x5f'),'o',_0x8a8a('0x62'))['left_join'](_0x8a8a('0x63'),'a',_0x8a8a('0x64'))[_0x8a8a('0x5e')](_0x8a8a('0x65'),'me','me.ChatInteractionId\x20=\x20i.id')[_0x8a8a('0x5e')]('chat_interaction_has_tags','it',_0x8a8a('0x66'))[_0x8a8a('0x5e')]('tools_tags','t',_0x8a8a('0x67'));var _0x101543=squel[_0x8a8a('0x68')]();var _0x183015=[];var _0x50b5c5=squel[_0x8a8a('0x68')]();var _0x37a9bb;if(_0x5466d4[_0x8a8a('0x4c')]['search']){_0x37a9bb=as['parseSearch'](_0x5466d4[_0x8a8a('0x4c')]['search']);var _0x5a34a6=_0x37a9bb['sqlOperator'];for(var _0x395564=0x0;_0x395564<_0x37a9bb[_0x8a8a('0x69')]['length'];_0x395564++){var _0x3f9377=_0x37a9bb['conditions'][_0x395564];var _0x4aa202='i';var _0x142ba6=_[_0x8a8a('0x6a')](_0x18449b,['name',_0x3f9377[_0x8a8a('0x59')]]);if(!_0x142ba6){switch(_0x3f9377[_0x8a8a('0x59')]){case _0x8a8a('0x6b'):if(_0x3f9377[_0x8a8a('0x6c')]==0x1){_0x2ba3bf[_0x8a8a('0x6d')]('`'+_0x3f9377[_0x8a8a('0x59')]+'`\x20=\x200');}else{_0x2ba3bf[_0x8a8a('0x6d')]('`'+_0x3f9377[_0x8a8a('0x59')]+'`\x20>\x200');}break;case _0x8a8a('0x6e'):if(_0x3f9377[_0x8a8a('0x6f')]===_0x8a8a('0x70')){if(_0x3f9377[_0x8a8a('0x6c')][_0x8a8a('0x71')]('\x20')[_0x8a8a('0x51')]>0x1){_0x101543[_0x5a34a6](_0x8a8a('0x72'),qs[_0x8a8a('0x73')](_0x3f9377[_0x8a8a('0x6c')]),null);}else{var _0x176ad3='%'+_0x3f9377['value']+'%';_0x101543[_0x5a34a6](_0x8a8a('0x74'),_0x176ad3,_0x176ad3,_0x176ad3);}}else{_0x142ba6=_[_0x8a8a('0x6a')](_0x18449b,['name',_0x8a8a('0x75')]);_0x3f9377[_0x8a8a('0x59')]=_0x8a8a('0x75');_0x33f5c8=as[_0x8a8a('0x76')](_0x4aa202,_0x142ba6[_0x8a8a('0x47')],_0x3f9377);_0x101543[_0x5a34a6](_0x33f5c8['text'],_0x33f5c8[_0x8a8a('0x6c')][_0x8a8a('0x77')],_0x33f5c8[_0x8a8a('0x6c')][_0x8a8a('0x26')]);}break;case _0x8a8a('0x78'):var _0x224ec2=_0x3f9377[_0x8a8a('0x6c')]['split'](',')[_0x8a8a('0x36')](function(_0x260a6b){return Number(_0x260a6b);});_0x224ec2[_0x8a8a('0x79')](function(_0x50a069){_0x50b5c5['or'](_0x8a8a('0x7a'),'%,'+_0x50a069+',%');});_0x183015=_['union'](_0x183015,_0x224ec2);break;case _0x8a8a('0x7b'):if(_0x3f9377[_0x8a8a('0x6f')]==='$substring'){_0x101543[_0x5a34a6](_0x8a8a('0x7c'),'%'+_0x3f9377[_0x8a8a('0x6c')]+'%',null);}else{_0x142ba6=_[_0x8a8a('0x6a')](_0x18449b,[_0x8a8a('0x4a'),_0x8a8a('0x43')]);_0x3f9377[_0x8a8a('0x59')]=_0x8a8a('0x43');_0x33f5c8=as[_0x8a8a('0x76')](_0x4aa202,_0x142ba6[_0x8a8a('0x47')],_0x3f9377);_0x101543[_0x5a34a6](_0x33f5c8[_0x8a8a('0x7d')],_0x33f5c8[_0x8a8a('0x6c')][_0x8a8a('0x77')],_0x33f5c8[_0x8a8a('0x6c')][_0x8a8a('0x26')]);}break;case _0x8a8a('0x30'):_0x33f5c8=as[_0x8a8a('0x76')]('me',null,_0x3f9377);_0x101543[_0x5a34a6](_0x33f5c8[_0x8a8a('0x7d')],_0x33f5c8[_0x8a8a('0x6c')]['start'],_0x33f5c8[_0x8a8a('0x6c')]['end']);break;}}else{var _0x33f5c8=as[_0x8a8a('0x76')](_0x4aa202,_0x142ba6[_0x8a8a('0x47')],_0x3f9377);_0x101543[_0x5a34a6](_0x33f5c8['text'],_0x33f5c8['value'][_0x8a8a('0x77')],_0x33f5c8[_0x8a8a('0x6c')][_0x8a8a('0x26')]);}}}else{var _0x4b3db2=_(_0x5466d4['query'])[_0x8a8a('0x4b')]()[_0x8a8a('0x36')](function(_0x46a556){return _[_0x8a8a('0x7e')](_0x18449b,[_0x8a8a('0x4a'),_0x46a556])?_0x46a556:undefined;})[_0x8a8a('0x7f')]()[_0x8a8a('0x6c')]();if(!_[_0x8a8a('0x80')](_0x4b3db2)){_0x4b3db2['forEach'](function(_0x38d6ab){if(_0x38d6ab===_0x8a8a('0x81')){_0x2ba3bf['where'](_0x8a8a('0x82'),[][_0x8a8a('0x83')](_0x5466d4[_0x8a8a('0x4c')][_0x38d6ab]));}else if(_0x38d6ab===_0x8a8a('0x84')){var _0x309725=JSON[_0x8a8a('0x85')](_0x5466d4['query'][_0x38d6ab])[_0x8a8a('0x86')];var _0x15ba84=JSON[_0x8a8a('0x85')](_0x5466d4[_0x8a8a('0x4c')][_0x38d6ab])[_0x8a8a('0x87')];_0x2ba3bf['where'](_0x8a8a('0x88'),_0x309725,_0x15ba84);}else{if(_0x5466d4[_0x8a8a('0x4c')][_0x38d6ab]===_0x8a8a('0x89')){_0x2ba3bf[_0x8a8a('0x56')]('i.'+_0x38d6ab+_0x8a8a('0x8a'));}else{_0x2ba3bf[_0x8a8a('0x56')]('i.'+_0x38d6ab+_0x8a8a('0x8b'),_0x5466d4[_0x8a8a('0x4c')][_0x38d6ab]);}}});}if(_0x5466d4[_0x8a8a('0x4c')][_0x8a8a('0x8c')]){if(_0x5466d4['query'][_0x8a8a('0x8c')]==0x1){_0x2ba3bf[_0x8a8a('0x6d')](_0x8a8a('0x8d'));}else{_0x2ba3bf[_0x8a8a('0x6d')](_0x8a8a('0x8e'));}}if(_0x5466d4['query']['tag']){_0x183015=_[_0x8a8a('0x8f')](_0x5466d4[_0x8a8a('0x4c')][_0x8a8a('0x90')])?_0x5466d4['query'][_0x8a8a('0x90')]:new Array(_0x5466d4[_0x8a8a('0x4c')][_0x8a8a('0x90')]);_0x183015[_0x8a8a('0x79')](function(_0x5675ec){_0x50b5c5['or'](_0x8a8a('0x7a'),'%,'+_0x5675ec+',%');});}if(_0x5466d4[_0x8a8a('0x4c')][_0x8a8a('0x91')]){var _0x5cee89=_0x5466d4['query']['filter'][_0x8a8a('0x92')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x8a8a('0x93')](_0x5cee89)){_0x101543['or']('i.id\x20LIKE\x20?',_0x5cee89+'%');}else{_0x101543['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x8a8a('0x73')](_0x5cee89))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x5cee89+'%');}}}_0x2ba3bf['where'](_0x101543);_0x2ba3bf['group'](_0x8a8a('0x94'));var _0x49aa1b={'type':db['Sequelize'][_0x8a8a('0x95')]['SELECT'],'raw':!![]};var _0x376c22=_0x2ba3bf['clone']();_0x376c22[_0x8a8a('0x59')](_0x8a8a('0x94'));_0x376c22[_0x8a8a('0x59')](_0x8a8a('0x96'),'unreadMessages');if(_0x1eb8bf[_0x8a8a('0x54')]){_0x1eb8bf[_0x8a8a('0x54')]['forEach'](function(_0x395bdd){var _0xf3cf32=_0x395bdd[0x0]===_0x8a8a('0x97')?_0x395bdd[0x0]:'i.'+_0x395bdd[0x0];_0x2ba3bf[_0x8a8a('0x54')](_0xf3cf32,_0x395bdd[0x1]==='DESC'?![]:!![]);});}if(!_['isEmpty'](_0x183015)){_0x2ba3bf[_0x8a8a('0x6d')](_0x50b5c5);_0x376c22[_0x8a8a('0x56')](_0x8a8a('0x98'),_0x183015);}BPromise['resolve']()[_0x8a8a('0x19')](function(){if(!_0x37a9bb){if(_0x5466d4[_0x8a8a('0x4c')][_0x8a8a('0x81')])return;_0x376c22['where'](_0x8a8a('0x99'));_0x2ba3bf[_0x8a8a('0x56')](_0x8a8a('0x99'));return;}if(_0x5466d4[_0x8a8a('0x9a')][_0x8a8a('0x9b')]!=='agent')return;return _0x5466d4[_0x8a8a('0x9a')][_0x8a8a('0x9c')]({'attributes':['id'],'raw':!![]})[_0x8a8a('0x19')](function(_0x161c44){if(_[_0x8a8a('0x80')](_0x161c44)){_0x376c22[_0x8a8a('0x56')](_0x8a8a('0x9d'));_0x2ba3bf['where']('i.ChatWebsiteId\x20IS\x20NULL');}else{_0x376c22[_0x8a8a('0x56')](_0x8a8a('0x82'),_[_0x8a8a('0x36')](_0x161c44,'id'));_0x2ba3bf['where'](_0x8a8a('0x82'),_[_0x8a8a('0x36')](_0x161c44,'id'));}});})[_0x8a8a('0x19')](function(){if(_0x5466d4[_0x8a8a('0x9a')][_0x8a8a('0x9b')]===_0x8a8a('0x32')&&!_0x37a9bb&&!_0x5466d4[_0x8a8a('0x4c')][_0x8a8a('0x81')])return[];return db[_0x8a8a('0x9e')][_0x8a8a('0x4c')](_0x376c22['toString'](),_0x49aa1b);})[_0x8a8a('0x19')](function(_0x2b21c0){_0x5c6c98[_0x8a8a('0x9f')]=_0x2b21c0['length'];if(_0x5c6c98[_0x8a8a('0x9f')]===0x0)return[];return db[_0x8a8a('0x9e')][_0x8a8a('0x4c')](_0x339be6['toString'](),_0x49aa1b)['then'](function(_0x1f409b){_0xa2b8a1=_[_0x8a8a('0xa0')](_0x1f409b,'id');_0x49aa1b=_[_0x8a8a('0x2f')](_0x49aa1b,{'model':db[_0x8a8a('0x44')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x5466d4['query'][_0x8a8a('0x4f')]){_0x1eb8bf[_0x8a8a('0x50')][_0x8a8a('0x79')](function(_0xa23098){_0x2ba3bf['field']('i.'+_0xa23098);});}else{_0x2ba3bf['field'](_0x8a8a('0x96'),_0x8a8a('0x6b'));_0x2ba3bf[_0x8a8a('0x59')]('a.key',_0x8a8a('0xa1'));_0x2ba3bf[_0x8a8a('0x59')](_0x8a8a('0xa2'),_0x8a8a('0xa3'));_0x2ba3bf[_0x8a8a('0x59')]('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',_0x8a8a('0x97'));_0x2ba3bf['field'](_0x8a8a('0xa4'));_0x2ba3bf[_0x8a8a('0x59')](_0x8a8a('0xa5'),_0x8a8a('0xa6'));_0x2ba3bf[_0x8a8a('0x59')](_0x8a8a('0xa7'),'Contact.lastName');_0x2ba3bf[_0x8a8a('0x59')](_0x8a8a('0xa8'),'Contact.email');_0x2ba3bf['field'](_0x8a8a('0xa9'),_0x8a8a('0xaa'));_0x2ba3bf['field'](_0x8a8a('0xab'),'Contact.mobile');_0x2ba3bf['field'](_0x8a8a('0xac'),_0x8a8a('0xad'));_0x2ba3bf[_0x8a8a('0x59')]('o.fullname',_0x8a8a('0xae'));_0x2ba3bf[_0x8a8a('0x59')](_0x8a8a('0xaf'),_0x8a8a('0xb0'));_0x2ba3bf[_0x8a8a('0x59')](_0x8a8a('0xb1'),'TagIds');}if(_0x1eb8bf['limit'])_0x2ba3bf['limit'](_0x1eb8bf[_0x8a8a('0x29')]);if(_0x1eb8bf[_0x8a8a('0x2a')])_0x2ba3bf[_0x8a8a('0x2a')](_0x1eb8bf[_0x8a8a('0x2a')]);return db[_0x8a8a('0x9e')][_0x8a8a('0x4c')](_0x2ba3bf[_0x8a8a('0xb2')](),_0x49aa1b);})[_0x8a8a('0x19')](function(_0x3afd87){if(_0x3afd87['length']>0x0)_0x329bfb[_0x8a8a('0x56')](_0x8a8a('0xb3'),_[_0x8a8a('0x36')](_0x3afd87,'id'));return db[_0x8a8a('0x9e')][_0x8a8a('0x4c')](_0x329bfb[_0x8a8a('0xb2')](),_0x49aa1b)['then'](function(_0x563e90){var _0x5b3092=_[_0x8a8a('0xb4')](_0x563e90,'ChatInteractionId');var _0x2fab56=[];_0x3afd87['forEach'](function(_0x227dde){_0x2fab56['push'](updateChatInteraction(_0x227dde,_0xa2b8a1,_0x5b3092));});return BPromise[_0x8a8a('0xb5')](_0x2fab56);});});})[_0x8a8a('0x19')](function(_0x5e8094){_0x5c6c98[_0x8a8a('0xb6')]=_0x5e8094;return _0x5c6c98;})['then'](respondWithFilteredResult(_0x44aed3,_0x1eb8bf))['catch'](handleError(_0x44aed3,null));};exports[_0x8a8a('0xb7')]=function(_0x4a1658,_0x32fa90){var _0x4d6119={'raw':![],'where':{'id':_0x4a1658['params']['id']}},_0x17f681={};_0x17f681[_0x8a8a('0x49')]=_[_0x8a8a('0x4b')](db[_0x8a8a('0x44')][_0x8a8a('0x45')]);_0x17f681['query']=_[_0x8a8a('0x4b')](_0x4a1658[_0x8a8a('0x4c')]);_0x17f681[_0x8a8a('0x4d')]=_[_0x8a8a('0x4e')](_0x17f681['model'],_0x17f681[_0x8a8a('0x4c')]);_0x4d6119[_0x8a8a('0x50')]=_[_0x8a8a('0x4e')](_0x17f681['model'],qs[_0x8a8a('0x4f')](_0x4a1658[_0x8a8a('0x4c')][_0x8a8a('0x4f')]));_0x4d6119[_0x8a8a('0x50')]=_0x4d6119[_0x8a8a('0x50')]['length']?_0x4d6119['attributes']:_0x17f681[_0x8a8a('0x49')];if(_0x4a1658[_0x8a8a('0x4c')][_0x8a8a('0xb8')]){_0x4d6119['include']=[{'all':!![]}];}_0x4d6119=_[_0x8a8a('0x2f')]({},_0x4d6119,_0x4a1658[_0x8a8a('0xb9')]);return db['ChatInteraction']['find'](_0x4d6119)[_0x8a8a('0x19')](handleEntityNotFound(_0x32fa90,null))[_0x8a8a('0x19')](respondWithResult(_0x32fa90,null))[_0x8a8a('0x23')](handleError(_0x32fa90,null));};exports['create']=function(_0x32921f,_0x2f3aa6){return db['ChatInteraction'][_0x8a8a('0xba')](_0x32921f[_0x8a8a('0x30')],{})['then'](respondWithResult(_0x2f3aa6,0xc9))[_0x8a8a('0x23')](handleError(_0x2f3aa6,null));};exports['update']=function(_0x1e35ac,_0x16a4a8){if(_0x1e35ac['body']['id']){delete _0x1e35ac[_0x8a8a('0x30')]['id'];}return db[_0x8a8a('0x44')]['find']({'where':{'id':_0x1e35ac[_0x8a8a('0xbb')]['id']}})['then'](handleEntityNotFound(_0x16a4a8,null))[_0x8a8a('0x19')](saveUpdates(_0x1e35ac[_0x8a8a('0x30')],null))['then'](respondWithResult(_0x16a4a8,null))[_0x8a8a('0x23')](handleError(_0x16a4a8,null));};exports[_0x8a8a('0xbc')]=function(_0x33935b,_0x52ffa0){return db[_0x8a8a('0x44')]['find']({'where':{'id':_0x33935b[_0x8a8a('0xbb')]['id']}})[_0x8a8a('0x19')](handleEntityNotFound(_0x52ffa0,null))[_0x8a8a('0x19')](removeEntity(_0x52ffa0,null))[_0x8a8a('0x23')](handleError(_0x52ffa0,null));};exports[_0x8a8a('0xbd')]=function(_0x54ad37,_0x19d4f6){return db[_0x8a8a('0x44')]['describe']()[_0x8a8a('0x19')](respondWithResult(_0x19d4f6,null))[_0x8a8a('0x23')](handleError(_0x19d4f6,null));};exports[_0x8a8a('0xbe')]=function(_0x5b22b6,_0x586dbd){var _0x35d9e2=_0x5b22b6[_0x8a8a('0xbb')]['id'];var _0x279002;var _0x7504b2;var _0x461430;return db[_0x8a8a('0x44')][_0x8a8a('0xbf')]({'where':{'id':_0x35d9e2}})['then'](function(_0x496f08){_0x279002=_0x496f08;return db['ChatWebsite'][_0x8a8a('0xbf')]({'where':{'id':_0x496f08[_0x8a8a('0x81')]},'attributes':['id',_0x8a8a('0xc0'),'vidaooEscalation',_0x8a8a('0xc1'),_0x8a8a('0xc2'),_0x8a8a('0xc3')],'raw':!![]});})[_0x8a8a('0x19')](function(_0x3154ee){if(_0x3154ee&&_0x3154ee['vidaooApiKey']&&_0x3154ee[_0x8a8a('0xc4')]){_0x7504b2=_0x3154ee;var _0xde7f73={'interaction':{'id':_0x35d9e2},'agent':{'id':_0x5b22b6[_0x8a8a('0x9a')]['id'],'name':_0x5b22b6['user'][_0x8a8a('0x4a')],'fullname':_0x5b22b6[_0x8a8a('0x9a')][_0x8a8a('0x37')],'email':_0x5b22b6['user']['email']},'contact':_0x5b22b6[_0x8a8a('0x30')][_0x8a8a('0x31')],'account':_0x5b22b6[_0x8a8a('0x30')]['account']};var _0x2fed73={'rejectUnauthorized':![],'method':_0x8a8a('0xc5'),'url':'https://api-vidaoo.xcally.com/api/v1/meetings','headers':{'X-APIKEY':_0x3154ee[_0x8a8a('0xc0')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x5b22b6[_0x8a8a('0x9a')]['email']],'buttons':null,'topic':_0x7504b2[_0x8a8a('0xc1')],'note':_['isNull'](_0x7504b2['vidaooNote'])?null:getMustacheRender(_0x7504b2[_0x8a8a('0xc2')],_0xde7f73),'metadata':null},'redirect':_0x8a8a('0xc6'),'json':!![]};try{if(!_['isNull'](_0x7504b2['vidaooMetadata'])){var _0x591ca2=getMustacheRender(_0x7504b2[_0x8a8a('0xc3')],_0xde7f73);var _0x55bec7=JSON['parse'](_0x591ca2);_0x2fed73[_0x8a8a('0x30')][_0x8a8a('0xc7')]=_0x55bec7;}}catch(_0x58ac24){throw new db[(_0x8a8a('0xc8'))][(_0x8a8a('0xc9'))](_0x8a8a('0xca'));}return rp(_0x2fed73);}else{throw new db[(_0x8a8a('0xc8'))][(_0x8a8a('0xc9'))]('Error\x20in\x20Vidaoo\x20configuration');}})[_0x8a8a('0x19')](function(_0x4930ad){_0x461430=_0x4930ad;if(_0x461430['id']){var _0x3ae28a={'body':_0x461430[_0x8a8a('0xcb')],'ChatWebsiteId':_0x7504b2['id'],'ChatInteractionId':_0x279002['id'],'direction':_0x8a8a('0xcc'),'UserId':_0x5b22b6[_0x8a8a('0x9a')]['id']};return db['ChatMessage']['create'](_0x3ae28a,{});}else{throw new db[(_0x8a8a('0xc8'))][(_0x8a8a('0xc9'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0x8a8a('0x19')](function(){return _0x279002[_0x8a8a('0xcd')]({'vidaooSessionId':_0x461430['id']});})['then'](respondWithResult(_0x586dbd,null))[_0x8a8a('0x23')](handleError(_0x586dbd,null));};exports[_0x8a8a('0xce')]=function(_0x14cd8d,_0x4be66d){if(_0x14cd8d['body']['id']){delete _0x14cd8d[_0x8a8a('0x30')]['id'];}return db['ChatInteraction'][_0x8a8a('0x6a')]({'where':{'id':_0x14cd8d['params']['id']},'include':[{'model':db[_0x8a8a('0xcf')],'as':'Contact'}]})['then'](handleEntityNotFound(_0x4be66d,null))['then'](saveUpdates(_0x14cd8d['body'],null))[_0x8a8a('0x19')](respondWithResult(_0x4be66d,null))[_0x8a8a('0x23')](handleError(_0x4be66d,null));};exports[_0x8a8a('0xd0')]=function(_0x5d955f,_0x32eb6b){if(_0x5d955f[_0x8a8a('0x30')]['id']){delete _0x5d955f[_0x8a8a('0x30')]['id'];}return db[_0x8a8a('0x44')][_0x8a8a('0x6a')]({'where':{'id':_0x5d955f[_0x8a8a('0xbb')]['id']}})[_0x8a8a('0x19')](function(_0x586686){if(!_0x586686){logger['error'](_0x8a8a('0xd1'),_0x8a8a('0xd0'),0x194,_0x8a8a('0xd2'));_0x32eb6b['sendStatus'](0x194);}else{if(_0x586686[_0x8a8a('0x43')]){throw new db[(_0x8a8a('0xc8'))][(_0x8a8a('0xc9'))](_0x8a8a('0xd3'));}}return _0x586686;})['then'](function(_0x5023d7){if(_0x5023d7){return _0x5023d7[_0x8a8a('0x2c')]({'closed':_0x5d955f[_0x8a8a('0x30')][_0x8a8a('0x40')],'disposition':_0x5d955f[_0x8a8a('0x30')][_0x8a8a('0x42')]})[_0x8a8a('0x19')](function(_0x40a76d){return _0x40a76d;});}})[_0x8a8a('0x19')](function(){return respondWithRpcPromise(_0x8a8a('0xd4'),_0x8a8a('0xd0'),_0x5d955f[_0x8a8a('0x30')],client9004);})['then'](respondWithResult(_0x32eb6b,null))[_0x8a8a('0x23')](handleError(_0x32eb6b,null));};exports[_0x8a8a('0xd5')]=function(_0xe30557,_0x37815b){_0xe30557[_0x8a8a('0x30')][_0x8a8a('0x4a')]=_0xe30557[_0x8a8a('0xd6')][_0x8a8a('0xd7')];_0xe30557[_0x8a8a('0x30')][_0x8a8a('0xd8')]=_0xe30557[_0x8a8a('0xd6')]['filename'];_0xe30557[_0x8a8a('0x30')][_0x8a8a('0x47')]=_0xe30557[_0x8a8a('0xd6')][_0x8a8a('0xd9')];return db['Attachment'][_0x8a8a('0xba')](_0xe30557[_0x8a8a('0x30')])[_0x8a8a('0x19')](respondWithResult(_0x37815b,0xc9))[_0x8a8a('0x23')](handleError(_0x37815b,null));};exports[_0x8a8a('0xda')]=function(_0x419998,_0x59ed64){return db[_0x8a8a('0x44')][_0x8a8a('0xbf')]({'where':{'id':_0x419998[_0x8a8a('0xbb')]['id']},'raw':!![]})[_0x8a8a('0x19')](handleEntityNotFound(_0x59ed64,null))[_0x8a8a('0x19')](function(_0x17e607){if(_0x17e607){if(_0x17e607[_0x8a8a('0x40')]){return _0x59ed64[_0x8a8a('0x25')](0x193)['json']({'status':0x193,'message':_0x8a8a('0xdb')});}return db[_0x8a8a('0xdc')][_0x8a8a('0xbf')]({'where':{'id':_0x419998[_0x8a8a('0x4c')][_0x8a8a('0xdd')]},'raw':!![]})[_0x8a8a('0x19')](handleEntityNotFound(_0x59ed64,null));}})[_0x8a8a('0x19')](function(_0xc79caa){if(_0xc79caa){var _0x3a2fa1=_0xc79caa['ChatOfflineMessageId']!==null;var _0x6f8834=path[_0x8a8a('0xde')](config[_0x8a8a('0xdf')],_0x8a8a('0xe0'));if(_0x3a2fa1){_0x6f8834=path[_0x8a8a('0xde')](_0x6f8834,'offline-chat/');}var _0xa5a1bc=path[_0x8a8a('0xde')](_0x6f8834,_0xc79caa[_0x8a8a('0xd8')]);return _0x59ed64[_0x8a8a('0xe1')](_0xa5a1bc);}})[_0x8a8a('0x23')](handleError(_0x59ed64,null));};exports['close']=function(_0x4dbb00,_0x57c44c){var _0x2b8cf5=null;var _0x3074a2=null;var _0x24a0e0=null;if(_0x4dbb00[_0x8a8a('0x30')]['id']){delete _0x4dbb00[_0x8a8a('0x30')]['id'];}if(_0x4dbb00[_0x8a8a('0x30')]['mailTranscript']){_0x24a0e0=path[_0x8a8a('0xde')](config[_0x8a8a('0xdf')],_0x8a8a('0xe2'),util['format'](_0x8a8a('0xe3'),Date[_0x8a8a('0xe4')]()));_0x4dbb00[_0x8a8a('0x30')]['pathTranscript']=_0x24a0e0;}return db[_0x8a8a('0x44')][_0x8a8a('0x6a')]({'where':{'id':_0x4dbb00['params']['id']},'include':[{'model':db['ChatMessage'],'as':_0x8a8a('0xe5'),'include':[{'model':db['User'],'as':'User'}]}]})['then'](handleEntityNotFound(_0x57c44c,null))[_0x8a8a('0x19')](saveUpdates(_0x4dbb00[_0x8a8a('0x30')],null))[_0x8a8a('0x19')](function(_0x20bc23){if(_0x20bc23){_0x2b8cf5=_0x20bc23;return db['ChatWebsite'][_0x8a8a('0x6a')]({'where':{'id':_0x2b8cf5['ChatWebsiteId']}});}})[_0x8a8a('0x19')](function(_0x419eef){if(_0x419eef){_0x3074a2=_0x419eef;return db['CmContact'][_0x8a8a('0x6a')]({'where':{'id':_0x2b8cf5[_0x8a8a('0x75')]}});}})['then'](function(_0x3b3c55){if(_0x3b3c55){if(_0x24a0e0){var _0x14cc59=null;for(var _0x5e9e59=0x1;_0x5e9e59<_0x2b8cf5[_0x8a8a('0xe5')][_0x8a8a('0x51')];++_0x5e9e59){_0x14cc59=_0x2b8cf5[_0x8a8a('0xe5')][_0x5e9e59];var _0x5ac2e2=_0x14cc59[_0x8a8a('0x43')]?util['format']('%s%d',_0x3074a2[_0x8a8a('0xe6')],_0x14cc59[_0x8a8a('0x43')]):'System';var _0x25a514=_0x4dbb00[_0x8a8a('0x30')][_0x8a8a('0xe7')]||util[_0x8a8a('0xe8')](_0x8a8a('0xe9'),_0x8a8a('0xea'),_0x14cc59[_0x8a8a('0x75')]);switch(_0x3074a2[_0x8a8a('0xeb')]){case _0x8a8a('0xec'):_0x5ac2e2=_0x14cc59[_0x8a8a('0x43')]?util[_0x8a8a('0xe8')](_0x8a8a('0xe9'),_0x3074a2[_0x8a8a('0xe6')],_0x14cc59['UserId']):_0x8a8a('0xed');break;case _0x8a8a('0xee'):_0x5ac2e2=_0x14cc59[_0x8a8a('0x43')]?_0x14cc59['User'][_0x8a8a('0xef')]||_0x14cc59[_0x8a8a('0x7b')][_0x8a8a('0x37')]:_0x8a8a('0xed');break;case _0x8a8a('0xf0'):_0x5ac2e2=_0x14cc59[_0x8a8a('0x43')]?_0x14cc59[_0x8a8a('0x7b')][_0x8a8a('0x37')]:_0x8a8a('0xed');break;default:_0x5ac2e2=_0x14cc59[_0x8a8a('0x43')]?util[_0x8a8a('0xe8')]('%s%d',_0x3074a2[_0x8a8a('0xe6')],_0x14cc59[_0x8a8a('0x43')]):_0x8a8a('0xed');}var _0x22d259=util[_0x8a8a('0xe8')](_0x8a8a('0xf1'),moment(_0x14cc59[_0x8a8a('0x84')])['format'](_0x8a8a('0xf2')),_0x14cc59[_0x8a8a('0xf3')]==='in'?_0x25a514:_0x5ac2e2,_0x14cc59['body']);if(!_0x14cc59[_0x8a8a('0xf4')]){fs['appendFileSync'](_0x24a0e0,_0x22d259);}}return db[_0x8a8a('0xf5')][_0x8a8a('0xbf')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0x8a8a('0xf6'),'raw':!![],'include':[{'model':db[_0x8a8a('0xf7')],'as':'CloudProvider','raw':!![]}]}]});}}})[_0x8a8a('0x19')](function(_0x7e29e1){if(!_0x7e29e1||!_0x7e29e1['Smtp']||!_0x4dbb00[_0x8a8a('0x30')])return _0x2b8cf5;var _0x4b106f=_0x7e29e1[_0x8a8a('0xf8')]();return respondWithRpcPromise(_0x8a8a('0xf9'),_0x8a8a('0xfa'),{'account':_0x4b106f,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0x7e29e1[_0x8a8a('0x4a')],_0x7e29e1['email']||_0x7e29e1[_0x8a8a('0xf6')]['user']),'to':_0x4dbb00['body'][_0x8a8a('0xfb')],'subject':'Mail\x20Transcript','text':util['format'](_0x8a8a('0xfc'),_0x4dbb00[_0x8a8a('0x30')][_0x8a8a('0xfb')]),'attachments':[{'path':_0x24a0e0}]}})[_0x8a8a('0x19')](function(){return _0x2b8cf5;})[_0x8a8a('0x23')](function(_0x4cb1da){logger[_0x8a8a('0x1f')](_0x4cb1da);});})[_0x8a8a('0x19')](respondWithStatusCode(_0x57c44c,0xc8))[_0x8a8a('0x23')](handleError(_0x57c44c,null));};exports['addMessage']=function(_0x3e63d4,_0x5de5ae){return db['ChatMessage']['find']({'where':{'id':_0x3e63d4[_0x8a8a('0xbb')]['id']}})['then'](handleEntityNotFound(_0x5de5ae,null))['then'](function(_0x484cc6){if(_0x484cc6){return _0x484cc6[_0x8a8a('0xfd')](_0x3e63d4[_0x8a8a('0x30')][_0x8a8a('0xfe')],_[_0x8a8a('0xff')](_0x3e63d4['body'],[_0x8a8a('0xfe'),'id'])||{});}})[_0x8a8a('0x19')](respondWithResult(_0x5de5ae,null))[_0x8a8a('0x23')](handleError(_0x5de5ae,null));};exports['getMessages']=function(_0x186c2c,_0x55148e){var _0x50315b={'raw':![],'where':{}};var _0x40c9cb={};var _0x2b4119={'count':0x0,'rows':[]};return db[_0x8a8a('0x44')][_0x8a8a('0xbf')]({'where':{'id':_0x186c2c[_0x8a8a('0xbb')]['id']}})['then'](handleEntityNotFound(_0x55148e,null))[_0x8a8a('0x19')](function(_0x33e008){if(_0x33e008){_0x40c9cb[_0x8a8a('0x49')]=_[_0x8a8a('0x4b')](db[_0x8a8a('0x100')][_0x8a8a('0x45')]);_0x40c9cb[_0x8a8a('0x4c')]=_[_0x8a8a('0x4b')](_0x186c2c[_0x8a8a('0x4c')]);_0x40c9cb['filters']=_[_0x8a8a('0x4e')](_0x40c9cb['model'],_0x40c9cb[_0x8a8a('0x4c')]);_0x50315b[_0x8a8a('0x50')]=_['intersection'](_0x40c9cb['model'],qs[_0x8a8a('0x4f')](_0x186c2c[_0x8a8a('0x4c')][_0x8a8a('0x4f')]));_0x50315b[_0x8a8a('0x50')]=_0x50315b[_0x8a8a('0x50')][_0x8a8a('0x51')]?_0x50315b[_0x8a8a('0x50')]:_0x40c9cb[_0x8a8a('0x49')];if(!_0x186c2c[_0x8a8a('0x4c')][_0x8a8a('0x52')](_0x8a8a('0x53'))){_0x50315b[_0x8a8a('0x29')]=qs[_0x8a8a('0x29')](_0x186c2c['query'][_0x8a8a('0x29')]);_0x50315b[_0x8a8a('0x2a')]=qs[_0x8a8a('0x2a')](_0x186c2c[_0x8a8a('0x4c')][_0x8a8a('0x2a')]);}_0x50315b[_0x8a8a('0x54')]=qs[_0x8a8a('0x55')](_0x186c2c[_0x8a8a('0x4c')][_0x8a8a('0x55')]);_0x50315b[_0x8a8a('0x56')]=qs[_0x8a8a('0x4d')](_[_0x8a8a('0x57')](_0x186c2c[_0x8a8a('0x4c')],_0x40c9cb[_0x8a8a('0x4d')]));_0x50315b[_0x8a8a('0x56')][_0x8a8a('0x101')]=_0x33e008['id'];if(_0x186c2c[_0x8a8a('0x4c')][_0x8a8a('0x91')]){_0x50315b[_0x8a8a('0x56')]=_[_0x8a8a('0x2f')](_0x50315b[_0x8a8a('0x56')],{'$or':_[_0x8a8a('0x36')](_0x50315b[_0x8a8a('0x50')],function(_0x433051){var _0x3f064c={};_0x3f064c[_0x433051]={'$like':'%'+_0x186c2c[_0x8a8a('0x4c')][_0x8a8a('0x91')]+'%'};return _0x3f064c;})});}if(_0x186c2c[_0x8a8a('0x4c')][_0x8a8a('0x86')]){var _0x36baf8=_0x186c2c[_0x8a8a('0x4c')]['$gte']['split'](',');var _0x1af0b6={};_0x1af0b6[_0x36baf8[0x0]]={'$gte':moment(_0x36baf8[0x1])['format'](_0x8a8a('0x102'))};_0x50315b[_0x8a8a('0x56')]=_[_0x8a8a('0x2f')](_0x50315b[_0x8a8a('0x56')],_0x1af0b6);}_0x50315b=_['merge']({},_0x50315b,_0x186c2c[_0x8a8a('0xb9')]);return db[_0x8a8a('0x100')][_0x8a8a('0x9f')]({'where':_0x50315b[_0x8a8a('0x56')]})[_0x8a8a('0x19')](function(_0x204dde){_0x2b4119[_0x8a8a('0x9f')]=_0x204dde;if(_0x186c2c[_0x8a8a('0x4c')][_0x8a8a('0xb8')]){_0x50315b[_0x8a8a('0x103')]=[{'all':!![]}];}return db[_0x8a8a('0x100')]['findAll'](_0x50315b);})[_0x8a8a('0x19')](function(_0x25b624){_0x2b4119[_0x8a8a('0xb6')]=_0x25b624;return _0x2b4119;});}})[_0x8a8a('0x19')](respondWithFilteredResult(_0x55148e,_0x50315b))[_0x8a8a('0x23')](handleError(_0x55148e,null));};exports[_0x8a8a('0x104')]=function(_0x413ab7,_0x32cc2a){var _0x1e8490={'where':{}},_0x159761={},_0xe16caf={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x8a8a('0xbf')]({'where':{'id':_0x413ab7[_0x8a8a('0xbb')]['id']}})[_0x8a8a('0x19')](handleEntityNotFound(_0x32cc2a,null))[_0x8a8a('0x19')](function(_0x2847bd){if(_0x2847bd){_0x159761['model']=_['keys'](db[_0x8a8a('0x100')][_0x8a8a('0x45')]);_0x159761[_0x8a8a('0x4c')]=_[_0x8a8a('0x4b')](_0x413ab7[_0x8a8a('0x4c')]);_0x159761['filters']=_[_0x8a8a('0x4e')](_0x159761[_0x8a8a('0x49')],_0x159761[_0x8a8a('0x4c')]);_0x1e8490[_0x8a8a('0x50')]=_[_0x8a8a('0x4e')](_0x159761[_0x8a8a('0x49')],qs[_0x8a8a('0x4f')](_0x413ab7['query'][_0x8a8a('0x4f')]));_0x1e8490[_0x8a8a('0x50')]=_0x1e8490[_0x8a8a('0x50')][_0x8a8a('0x51')]?_0x1e8490[_0x8a8a('0x50')]:_0x159761[_0x8a8a('0x49')];if(!_0x413ab7[_0x8a8a('0x4c')][_0x8a8a('0x52')](_0x8a8a('0x53'))){_0x1e8490[_0x8a8a('0x29')]=qs[_0x8a8a('0x29')](_0x413ab7['query'][_0x8a8a('0x29')]);_0x1e8490[_0x8a8a('0x2a')]=qs[_0x8a8a('0x2a')](_0x413ab7[_0x8a8a('0x4c')][_0x8a8a('0x2a')]);}_0x1e8490['order']=qs['sort'](_0x413ab7[_0x8a8a('0x4c')][_0x8a8a('0x55')]);_0x1e8490['where']=qs[_0x8a8a('0x4d')](_[_0x8a8a('0x57')](_0x413ab7['query'],_0x159761[_0x8a8a('0x4d')]));_0x1e8490[_0x8a8a('0x56')][_0x8a8a('0x101')]=_0x2847bd['id'];if(_0x413ab7[_0x8a8a('0x4c')]['filter']){_0x1e8490[_0x8a8a('0x56')]=_[_0x8a8a('0x2f')](_0x1e8490[_0x8a8a('0x56')],{'$or':_[_0x8a8a('0x36')](_0x1e8490['attributes'],function(_0x453a30){var _0x34ac37={};_0x34ac37[_0x453a30]={'$like':'%'+_0x413ab7['query'][_0x8a8a('0x91')]+'%'};return _0x34ac37;})});}_0x1e8490[_0x8a8a('0x56')][_0x8a8a('0xf4')]=![];if(_0x413ab7[_0x8a8a('0x4c')]['id']){_0x1e8490[_0x8a8a('0x56')]['id']={'$gt':_0x413ab7[_0x8a8a('0x4c')]['id']};}_0x1e8490=_[_0x8a8a('0x2f')]({},_0x1e8490,_0x413ab7[_0x8a8a('0xb9')]);return db[_0x8a8a('0x100')][_0x8a8a('0x9f')]({'where':_0x1e8490[_0x8a8a('0x56')]})[_0x8a8a('0x19')](function(_0x50536f){_0xe16caf[_0x8a8a('0x9f')]=_0x50536f;_0x1e8490['include']=[];if(_0x413ab7[_0x8a8a('0x4c')]['includeAgent']){_0x1e8490[_0x8a8a('0x103')][_0x8a8a('0x3a')]({'model':db[_0x8a8a('0x7b')],'as':_0x8a8a('0x7b'),'attributes':['id','fullname',_0x8a8a('0xef')]});}if(_0x413ab7['query'][_0x8a8a('0xb8')]){_0x1e8490[_0x8a8a('0x103')]=[{'all':!![]}];}return db[_0x8a8a('0x100')][_0x8a8a('0x105')](_0x1e8490);})[_0x8a8a('0x19')](function(_0x1a7bff){_0xe16caf[_0x8a8a('0xb6')]=_0x1a7bff;return _0xe16caf;});}})[_0x8a8a('0x19')](respondWithFilteredResult(_0x32cc2a,_0x1e8490))['catch'](handleError(_0x32cc2a,null));};exports['addTags']=function(_0x2deb61,_0x268a78){return db[_0x8a8a('0x44')][_0x8a8a('0x6a')]({'where':{'id':_0x2deb61[_0x8a8a('0xbb')]['id']}})[_0x8a8a('0x19')](handleEntityNotFound(_0x268a78,null))[_0x8a8a('0x19')](function(_0x6812b2){if(_0x6812b2){return _0x6812b2[_0x8a8a('0x106')](_0x2deb61[_0x8a8a('0x30')]['ids'],_['omit'](_0x2deb61[_0x8a8a('0x30')],[_0x8a8a('0xfe'),'id'])||{})['spread'](function(){return db[_0x8a8a('0x78')][_0x8a8a('0x105')]({'attributes':['id',_0x8a8a('0x4a'),'color'],'where':{'id':_0x2deb61[_0x8a8a('0x30')][_0x8a8a('0xfe')]}});})[_0x8a8a('0x19')](function(_0x5a88c4){socket['emit'](_0x8a8a('0x107'),{'id':Number(_0x2deb61[_0x8a8a('0xbb')]['id']),'tags':_0x5a88c4||[]});return{'id':Number(_0x2deb61[_0x8a8a('0xbb')]['id']),'tags':_0x5a88c4||[]};});}})[_0x8a8a('0x19')](respondWithResult(_0x268a78,null))[_0x8a8a('0x23')](handleError(_0x268a78,null));};exports[_0x8a8a('0x108')]=function(_0x17c85c,_0x49b219){return db['ChatInteraction'][_0x8a8a('0x6a')]({'where':{'id':_0x17c85c[_0x8a8a('0xbb')]['id']}})['then'](handleEntityNotFound(_0x49b219,null))[_0x8a8a('0x19')](function(_0x5a177b){if(_0x5a177b){return _0x5a177b['removeTags'](_0x17c85c['query'][_0x8a8a('0xfe')]);}})[_0x8a8a('0x19')](respondWithStatusCode(_0x49b219,null))[_0x8a8a('0x23')](handleError(_0x49b219,null));};exports[_0x8a8a('0xe1')]=function(_0xcfd82f,_0x3a49c0){var _0x52328d=moment()['unix']()['toString']();var _0x192040=path[_0x8a8a('0xde')](config[_0x8a8a('0xdf')],'server','files','tmp');var _0x3ce207=path['join'](config[_0x8a8a('0xdf')],_0x8a8a('0x109'),'files',_0x8a8a('0x10a'));var _0x52c858=path['join'](_0x192040,_0x52328d);var _0x19c612=util[_0x8a8a('0xe8')](_0x8a8a('0x10b'),_0xcfd82f['params']['id'],_0x52328d);var _0x29e6d0=path[_0x8a8a('0xde')](_0x192040,_0x19c612);var _0x517c95=[];_0x517c95[_0x8a8a('0x3a')]({'model':db[_0x8a8a('0x7b')],'as':_0x8a8a('0x7b'),'attributes':['id',_0x8a8a('0x37')],'raw':!![]});_0x517c95[_0x8a8a('0x3a')]({'model':db[_0x8a8a('0xcf')],'as':'Contact','attributes':['id',_0x8a8a('0x10c'),_0x8a8a('0x10d')],'raw':!![]});if(_0xcfd82f[_0x8a8a('0x4c')][_0x8a8a('0x10a')]){_0x517c95[_0x8a8a('0x3a')]({'model':db['Attachment'],'as':_0x8a8a('0xdc'),'raw':!![]});}var _0x55737e=[{'model':db[_0x8a8a('0x100')],'as':_0x8a8a('0xe5'),'attributes':['id',_0x8a8a('0x30'),_0x8a8a('0x84'),_0x8a8a('0xf3'),_0x8a8a('0xf4'),'read'],'include':_0x517c95}];_0x55737e['push']({'model':db[_0x8a8a('0x10e')],'as':_0x8a8a('0x10f'),'attributes':['id',_0x8a8a('0x4a')]});_0x55737e[_0x8a8a('0x3a')]({'model':db[_0x8a8a('0x7b')],'as':_0x8a8a('0x110'),'attributes':['id',_0x8a8a('0x37')]});return db[_0x8a8a('0x44')][_0x8a8a('0x6a')]({'where':{'id':_0xcfd82f[_0x8a8a('0xbb')]['id']},'include':_0x55737e})[_0x8a8a('0x19')](handleEntityNotFound(_0x3a49c0,null))[_0x8a8a('0x19')](function(_0x49525c){if(_0x49525c){var _0x2f5897=_0x49525c['get']({'plain':!![]});fs[_0x8a8a('0x111')](_0x52c858);var _0x1d7a76={'channel':_0x8a8a('0x112'),'account':_0x2f5897[_0x8a8a('0x10f')][_0x8a8a('0x4a')],'agent':_0x2f5897[_0x8a8a('0x110')]?_0x2f5897[_0x8a8a('0x110')]['fullname']:_0x8a8a('0x113'),'createdAt':moment(_0x2f5897['createdAt'])[_0x8a8a('0xe8')]('YYYY-MM-DD\x20HH:mm:ss')[_0x8a8a('0xb2')](),'closedAt':_0x2f5897[_0x8a8a('0x40')]?moment(_0x2f5897[_0x8a8a('0x114')])[_0x8a8a('0xe8')]('YYYY-MM-DD\x20HH:mm:ss')['toString']():'','disposition':_0x2f5897[_0x8a8a('0x42')],'chatInfo':{'browser':_0x2f5897[_0x8a8a('0x115')],'os':_0x2f5897['osName'],'referer':_0x2f5897[_0x8a8a('0x116')],'customerIp':_0x2f5897['customerIp'],'customerPort':_0x2f5897['customerPort']?_0x2f5897[_0x8a8a('0x117')]:_0x8a8a('0x113')},'messages':_(_0x2f5897[_0x8a8a('0xe5')])['tail']()[_0x8a8a('0x91')]({'secret':![]})[_0x8a8a('0x36')](function(_0x2e34e6){if(_0x2e34e6['Attachment']){var _0x1be060=path[_0x8a8a('0xde')](_0x3ce207,_0x2e34e6['Attachment']['basename']);if(fs[_0x8a8a('0x118')](_0x1be060)){fs[_0x8a8a('0x119')](_0x1be060)[_0x8a8a('0x11a')](fs[_0x8a8a('0x11b')](path[_0x8a8a('0xde')](_0x52c858,_0x2e34e6['Attachment'][_0x8a8a('0xd8')])));}}return{'date':moment(_0x2e34e6['createdAt'])['format'](_0x8a8a('0x102'))[_0x8a8a('0xb2')](),'sender':_0x2e34e6[_0x8a8a('0xf3')]===_0x8a8a('0xcc')?_0x2e34e6[_0x8a8a('0x7b')]?_0x2e34e6[_0x8a8a('0x7b')]['fullname']:_0x8a8a('0xed'):_0x2e34e6[_0x8a8a('0x6e')][_0x8a8a('0x10c')]+(_0x2e34e6[_0x8a8a('0x6e')][_0x8a8a('0x10d')]?'\x20'+_0x2e34e6['Contact'][_0x8a8a('0x10d')]:''),'body':_0x2e34e6['Attachment']?_0x2e34e6[_0x8a8a('0xdc')]['basename']:_0x2e34e6['body'],'direction':_0x2e34e6[_0x8a8a('0xf3')]===_0x8a8a('0xcc')?'A':'C','secret':_0x2e34e6[_0x8a8a('0xf4')],'read':_0x2e34e6['read'],'attachment':_0x2e34e6[_0x8a8a('0xdc')]};})['value']()};return ejs[_0x8a8a('0x11c')](path[_0x8a8a('0xde')](config[_0x8a8a('0xdf')],_0x8a8a('0x109'),_0x8a8a('0x11d'),_0x8a8a('0x11e')),{'interaction':_0x1d7a76})[_0x8a8a('0x19')](function(_0x44dd5c){var _0x3d5bf0=path[_0x8a8a('0xde')](_0x52c858,_0x8a8a('0x11f')+_0x2f5897['id']+'-'+_0x52328d+'.pdf');var _0x5bfe3b={'path':_0x3d5bf0,'channel':_0x8a8a('0x112'),'interactionId':_0x2f5897['id']};return pdf[_0x8a8a('0x120')](_0x44dd5c,_0x5bfe3b);})[_0x8a8a('0x19')](function(){return new Promise(function(_0x50b445,_0x5738e4){zipdir(_0x52c858,{'saveTo':_0x29e6d0},function(_0x1b602b,_0xccfb49){if(_0x1b602b)return _0x5738e4(_0x1b602b);return _0x50b445(_0xccfb49);});})['then'](function(){return new BPromise(function(_0x4bb67b,_0x839b37){rimraf(_0x52c858,function(_0xb08e40){if(_0xb08e40)_0x839b37(_0xb08e40);return _0x4bb67b();});});})['then'](function(){return _0x3a49c0['download'](_0x29e6d0,_0x19c612,function(_0x19d186){if(_0x19d186){logger['error'](_0x8a8a('0x121'),_0x19d186);}else{fs['unlinkSync'](_0x29e6d0);}});});});}else{return _0x3a49c0[_0x8a8a('0x24')](0xc8);}})['catch'](handleError(_0x3a49c0,null));};
\ No newline at end of file
+var _0x9c44=['join','root','server/files/attachments/','offline-chat/','download','close','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','Messages','ChatWebsite','CmContact','%s%d','agentAlias','System','Visitor','agentIdentifier','website_alias','agent_alias','alias','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','secret','appendFileSync','MailServerOut','Smtp','CloudProvider','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','hasOwnProperty','YYYY-MM-DD\x20HH:mm:ss','findAll','options','addTags','spread','emit','removeTags','unix','server','tmp','files','attachments','transcript-%d-%s.zip','firstName','lastName','direction','Account','Owner','get','mkdirSync','Chat','closedAt','browserName','osName','referer','customerIp','customerPort','tail','existsSync','createReadStream','createWriteStream','renderFile','views','downloadInteraction.ejs','.pdf','createPdfFromHTML','err','unlinkSync','sendStatus','request-promise','moment','bluebird','mustache','util','path','squel','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/logger','api','../../mysqldb','redis','defaults','./chatInteraction.socket','jayson/promise','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','status','end','json','offset','undefined','count','limit','set','Content-Range','update','name','send','merge','body','contact','interaction','account','Users','map','TagIds','split','forEach','Tags','push','waiting','talking','answered','unmanaged','abandoned','total','UserId','closed','disposition','index','ChatInteraction','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','select','field','tools_tags','u.id','u.fullname','ui.ChatInteractionId','from','user_has_chat_interactions','left_join','users','u.id\x20=\x20ui.UserId','chat_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','chat_websites','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','parseSearch','conditions','find','unreadMessages','value','`\x20=\x200','having','Contact','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','operator','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','text','start','some','compact','isEmpty','ChatWebsiteId','$gte','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','Sequelize','SELECT','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','t.id\x20IN\x20?','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','agent','i.ChatWebsiteId\x20IS\x20NULL','i.ChatWebsiteId\x20IN\x20?','sequelize','toString','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.*','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','o.internal','Owner.internal','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','all','rows','show','params','includeAll','include','destroy','describe','createVidaooSession','findOne','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','vidaooApiKey','fullname','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','metadata','Error\x20in\x20conversion\x20vidaooMetadata','out','ChatMessage','create','ValidationError','updateAttributes','abandon','AbandonInteraction','file','originalname','basename','filename','Attachment','attachmentDownload','Unauthorized','ChatOfflineMessageId'];(function(_0x26462c,_0xd20a35){var _0x509a42=function(_0x1b22c9){while(--_0x1b22c9){_0x26462c['push'](_0x26462c['shift']());}};_0x509a42(++_0xd20a35);}(_0x9c44,0x178));var _0x49c4=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0x9c44[_0x1694f5];return _0x5b4321;};'use strict';var rimraf=require('rimraf');var zipdir=require('zip-dir');var rp=require(_0x49c4('0x0'));var moment=require(_0x49c4('0x1'));var BPromise=require(_0x49c4('0x2'));var Mustache=require(_0x49c4('0x3'));var util=require(_0x49c4('0x4'));var path=require(_0x49c4('0x5'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x49c4('0x6'));var Redis=require('ioredis');var qs=require(_0x49c4('0x7'));var as=require(_0x49c4('0x8'));var pdf=require(_0x49c4('0x9'));var logger=require(_0x49c4('0xa'))(_0x49c4('0xb'));var config=require('../../config/environment');var db=require(_0x49c4('0xc'))['db'];config[_0x49c4('0xd')]=_[_0x49c4('0xe')](config[_0x49c4('0xd')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x49c4('0xd')]));require(_0x49c4('0xf'))['register'](socket);var jayson=require(_0x49c4('0x10'));var client=jayson[_0x49c4('0x11')]['http']({'port':0x232b});var client9004=jayson['client'][_0x49c4('0x12')]({'port':0x232c});function respondWithRpcPromise(_0x6d1b08,_0x5487cd,_0x7df3a9,_0x403bfb){return new BPromise(function(_0x5f2fd9,_0x1909fe){var _0x280996=_0x403bfb||client;return _0x280996[_0x49c4('0x13')](_0x6d1b08,_0x7df3a9)[_0x49c4('0x14')](function(_0x12777c){logger[_0x49c4('0x15')](_0x49c4('0x16'),_0x5487cd,_0x49c4('0x17'));logger['debug'](_0x49c4('0x18'),_0x5487cd,_0x49c4('0x17'),JSON[_0x49c4('0x19')](_0x12777c));if(_0x12777c[_0x49c4('0x1a')]){if(_0x12777c[_0x49c4('0x1a')]['code']===0x1f4){logger[_0x49c4('0x1a')](_0x49c4('0x16'),_0x5487cd,_0x12777c['error']['message']);return _0x1909fe(_0x12777c[_0x49c4('0x1a')][_0x49c4('0x1b')]);}logger[_0x49c4('0x1a')]('ChatInteraction,\x20%s,\x20%s',_0x5487cd,_0x12777c[_0x49c4('0x1a')]['message']);return _0x5f2fd9(_0x12777c[_0x49c4('0x1a')][_0x49c4('0x1b')]);}else{logger[_0x49c4('0x15')](_0x49c4('0x16'),_0x5487cd,_0x49c4('0x17'));_0x5f2fd9(_0x12777c[_0x49c4('0x1c')][_0x49c4('0x1b')]);}})[_0x49c4('0x1d')](function(_0x2197d2){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x5487cd,_0x2197d2);_0x1909fe(_0x2197d2);});});}function respondWithStatusCode(_0x57f502,_0x1c99b1){_0x1c99b1=_0x1c99b1||0xcc;return function(_0x4f0b62){if(_0x4f0b62){return _0x57f502['sendStatus'](_0x1c99b1);}return _0x57f502[_0x49c4('0x1e')](_0x1c99b1)[_0x49c4('0x1f')]();};}function respondWithResult(_0x26c640,_0xd335e4){_0xd335e4=_0xd335e4||0xc8;return function(_0x4811c4){if(_0x4811c4){return _0x26c640['status'](_0xd335e4)[_0x49c4('0x20')](_0x4811c4);}};}function respondWithFilteredResult(_0x9cb797,_0x565423){return function(_0x207358){if(_0x207358){var _0x43e014=typeof _0x565423[_0x49c4('0x21')]===_0x49c4('0x22')&&typeof _0x565423['limit']==='undefined';var _0x449960=_0x207358['count'];var _0x3800b7=_0x43e014?0x0:_0x565423[_0x49c4('0x21')];var _0x3f1708=_0x43e014?_0x207358[_0x49c4('0x23')]:_0x565423['offset']+_0x565423[_0x49c4('0x24')];var _0x2b2793;if(_0x3f1708>=_0x449960){_0x3f1708=_0x449960;_0x2b2793=0xc8;}else{_0x2b2793=0xce;}_0x9cb797[_0x49c4('0x1e')](_0x2b2793);return _0x9cb797[_0x49c4('0x25')](_0x49c4('0x26'),_0x3800b7+'-'+_0x3f1708+'/'+_0x449960)[_0x49c4('0x20')](_0x207358);}return null;};}function saveUpdates(_0x26ba17){return function(_0x427b26){if(_0x427b26){return _0x427b26[_0x49c4('0x27')](_0x26ba17)[_0x49c4('0x14')](function(_0x46f7ea){return _0x46f7ea;});}return null;};}function removeEntity(_0x4ea6ea){return function(_0x4f4495){if(_0x4f4495){return _0x4f4495['destroy']()[_0x49c4('0x14')](function(){_0x4ea6ea[_0x49c4('0x1e')](0xcc)[_0x49c4('0x1f')]();});}};}function handleEntityNotFound(_0x27e467){return function(_0x28eb47){if(!_0x28eb47){_0x27e467['sendStatus'](0x194);}return _0x28eb47;};}function handleError(_0x38ad77,_0x116eb4){_0x116eb4=_0x116eb4||0x1f4;return function(_0x2e7a69){logger[_0x49c4('0x1a')](_0x2e7a69['stack']);if(_0x2e7a69['name']){delete _0x2e7a69[_0x49c4('0x28')];}_0x38ad77[_0x49c4('0x1e')](_0x116eb4)[_0x49c4('0x29')](_0x2e7a69);};}function getMustacheRender(_0x13b3b4,_0xd38540){return Mustache['render'](_0x13b3b4,_[_0x49c4('0x2a')](_0xd38540[_0x49c4('0x2b')],{'contact':_0xd38540[_0x49c4('0x2c')],'message':_0xd38540['message'],'agent':_0xd38540['agent'],'interaction':_0xd38540[_0x49c4('0x2d')],'account':_0xd38540[_0x49c4('0x2e')]}))||'';}function getInteractionUsers(_0x3bec0a,_0x1238c0){return new BPromise(function(_0x2b45a1,_0x2cf897){try{if(_0x1238c0[_0x3bec0a['id']]){_0x3bec0a[_0x49c4('0x2f')]=_[_0x49c4('0x30')](_0x1238c0[_0x3bec0a['id']],function(_0x3209cd){return{'id':_0x3209cd['id'],'fullname':_0x3209cd['fullname']};});}}catch(_0x2d34ca){_0x2cf897(_0x2d34ca);}_0x2b45a1(_0x3bec0a);});}function getInteractionTags(_0x5b96df,_0xdda586){return new BPromise(function(_0x349791,_0x2625a6){try{if(_0x5b96df[_0x49c4('0x31')]){_0x5b96df['Tags']=[];_0x5b96df[_0x49c4('0x31')][_0x49c4('0x32')](',')[_0x49c4('0x33')](function(_0x4e913a){_0x5b96df[_0x49c4('0x34')][_0x49c4('0x35')](_0xdda586[_0x4e913a]);});}delete _0x5b96df[_0x49c4('0x31')];}catch(_0x5e5366){_0x2625a6(_0x5e5366);}_0x349791(_0x5b96df);});}function updateChatInteraction(_0x1ba7a0,_0x24c177,_0x143916){return new BPromise(function(_0x2ba76a,_0x70e552){return getInteractionUsers(_0x1ba7a0,_0x143916)[_0x49c4('0x14')](function(_0x1e506a){return getInteractionTags(_0x1e506a,_0x24c177);})['then'](function(_0x2d2510){return getStateInteraction(_0x2d2510);})[_0x49c4('0x14')](function(_0x32b172){_0x2ba76a(_0x32b172);})[_0x49c4('0x1d')](function(_0x41ad28){_0x70e552(_0x41ad28);});});}function getStateInteraction(_0x29dd5d){return new BPromise(function(_0x1be62d){_0x29dd5d[_0x49c4('0x36')]=0x0;_0x29dd5d[_0x49c4('0x37')]=0x0;_0x29dd5d[_0x49c4('0x38')]=0x0;_0x29dd5d[_0x49c4('0x39')]=0x0;_0x29dd5d[_0x49c4('0x3a')]=0x0;_0x29dd5d[_0x49c4('0x3b')]=0x0;if(!_0x29dd5d['closed']&&!_0x29dd5d[_0x49c4('0x3c')]){_0x29dd5d['waiting']+=0x1;}if(!_0x29dd5d[_0x49c4('0x3d')]&&_0x29dd5d[_0x49c4('0x3c')]){_0x29dd5d[_0x49c4('0x37')]+=0x1;if(_0x29dd5d[_0x49c4('0x36')]){_0x29dd5d[_0x49c4('0x36')]-=0x1;}}if(_0x29dd5d[_0x49c4('0x3d')]&&_0x29dd5d['disposition']==='abandoned'){_0x29dd5d[_0x49c4('0x3a')]+=0x1;if(_0x29dd5d[_0x49c4('0x36')]){_0x29dd5d[_0x49c4('0x36')]-=0x1;}}else if(_0x29dd5d[_0x49c4('0x3d')]&&!_0x29dd5d['UserId']&&_0x29dd5d[_0x49c4('0x3e')]){_0x29dd5d[_0x49c4('0x39')]+=0x1;if(_0x29dd5d[_0x49c4('0x36')]){_0x29dd5d[_0x49c4('0x36')]-=0x1;}}else if(_0x29dd5d[_0x49c4('0x3d')]&&_0x29dd5d[_0x49c4('0x3c')]){_0x29dd5d[_0x49c4('0x38')]+=0x1;if(_0x29dd5d[_0x49c4('0x37')]){_0x29dd5d[_0x49c4('0x37')]-=0x1;}}_0x29dd5d['total']+=0x1;_0x1be62d(_0x29dd5d);});}exports[_0x49c4('0x3f')]=function(_0x4d27d0,_0x33696e){var _0x628423={},_0x301def={},_0x258abe={'count':0x0,'rows':[]};var _0x2d93d8=_['map'](db[_0x49c4('0x40')][_0x49c4('0x41')],function(_0x384862){return{'name':_0x384862[_0x49c4('0x42')],'type':_0x384862[_0x49c4('0x43')][_0x49c4('0x44')]};});_0x301def[_0x49c4('0x45')]=_['map'](_0x2d93d8,_0x49c4('0x28'));_0x301def['query']=_[_0x49c4('0x46')](_0x4d27d0[_0x49c4('0x47')]);_0x301def[_0x49c4('0x48')]=_[_0x49c4('0x49')](_0x301def[_0x49c4('0x45')],_0x301def[_0x49c4('0x47')]);_0x628423[_0x49c4('0x4a')]=_['intersection'](_0x301def[_0x49c4('0x45')],qs[_0x49c4('0x4b')](_0x4d27d0['query'][_0x49c4('0x4b')]));_0x628423[_0x49c4('0x4a')]=_0x628423[_0x49c4('0x4a')][_0x49c4('0x4c')]?_0x628423['attributes']:_0x301def['model'];if(!_0x4d27d0[_0x49c4('0x47')]['hasOwnProperty'](_0x49c4('0x4d'))){_0x628423[_0x49c4('0x24')]=qs[_0x49c4('0x24')](_0x4d27d0[_0x49c4('0x47')][_0x49c4('0x24')]);_0x628423[_0x49c4('0x21')]=qs[_0x49c4('0x21')](_0x4d27d0['query'][_0x49c4('0x21')]);}_0x628423[_0x49c4('0x4e')]=qs[_0x49c4('0x4f')](_0x4d27d0[_0x49c4('0x47')][_0x49c4('0x4f')]);_0x628423[_0x49c4('0x50')]=qs[_0x49c4('0x48')](_[_0x49c4('0x51')](_0x4d27d0[_0x49c4('0x47')],_0x301def[_0x49c4('0x48')]),_0x2d93d8);var _0x5b822f=[];var _0x5e63f0=squel[_0x49c4('0x52')]()[_0x49c4('0x53')]('id')['field']('name')[_0x49c4('0x53')]('color')['from'](_0x49c4('0x54'));var _0x4081a5=squel[_0x49c4('0x52')]()[_0x49c4('0x53')](_0x49c4('0x55'))[_0x49c4('0x53')](_0x49c4('0x56'))['field'](_0x49c4('0x57'))[_0x49c4('0x58')](_0x49c4('0x59'),'ui')[_0x49c4('0x5a')](_0x49c4('0x5b'),'u',_0x49c4('0x5c'));var _0x5d24f3=squel['select']()[_0x49c4('0x58')](_0x49c4('0x5d'),'i')[_0x49c4('0x5a')](_0x49c4('0x5e'),'c',_0x49c4('0x5f'))[_0x49c4('0x5a')](_0x49c4('0x5b'),'o','o.id\x20=\x20i.UserId')[_0x49c4('0x5a')](_0x49c4('0x60'),'a','a.id\x20=\x20i.ChatWebsiteId')[_0x49c4('0x5a')]('chat_messages','me',_0x49c4('0x61'))[_0x49c4('0x5a')](_0x49c4('0x62'),'it',_0x49c4('0x63'))[_0x49c4('0x5a')](_0x49c4('0x54'),'t',_0x49c4('0x64'));var _0x2f520f=squel['expr']();var _0x3894e0=[];var _0x27b9c2=squel['expr']();var _0x10dec7;if(_0x4d27d0[_0x49c4('0x47')]['search']){_0x10dec7=as[_0x49c4('0x65')](_0x4d27d0[_0x49c4('0x47')]['search']);var _0x4dc54d=_0x10dec7['sqlOperator'];for(var _0x513879=0x0;_0x513879<_0x10dec7[_0x49c4('0x66')]['length'];_0x513879++){var _0xb20a5d=_0x10dec7[_0x49c4('0x66')][_0x513879];var _0x515240='i';var _0x679134=_[_0x49c4('0x67')](_0x2d93d8,['name',_0xb20a5d[_0x49c4('0x53')]]);if(!_0x679134){switch(_0xb20a5d[_0x49c4('0x53')]){case _0x49c4('0x68'):if(_0xb20a5d[_0x49c4('0x69')]==0x1){_0x5d24f3['having']('`'+_0xb20a5d[_0x49c4('0x53')]+_0x49c4('0x6a'));}else{_0x5d24f3[_0x49c4('0x6b')]('`'+_0xb20a5d[_0x49c4('0x53')]+'`\x20>\x200');}break;case _0x49c4('0x6c'):if(_0xb20a5d['operator']==='$substring'){if(_0xb20a5d['value']['split']('\x20')[_0x49c4('0x4c')]>0x1){_0x2f520f[_0x4dc54d](_0x49c4('0x6d'),qs[_0x49c4('0x6e')](_0xb20a5d[_0x49c4('0x69')]),null);}else{var _0x5b056e='%'+_0xb20a5d['value']+'%';_0x2f520f[_0x4dc54d](_0x49c4('0x6f'),_0x5b056e,_0x5b056e,_0x5b056e);}}else{_0x679134=_[_0x49c4('0x67')](_0x2d93d8,[_0x49c4('0x28'),_0x49c4('0x70')]);_0xb20a5d[_0x49c4('0x53')]=_0x49c4('0x70');_0x191afb=as[_0x49c4('0x71')](_0x515240,_0x679134[_0x49c4('0x43')],_0xb20a5d);_0x2f520f[_0x4dc54d](_0x191afb['text'],_0x191afb[_0x49c4('0x69')]['start'],_0x191afb[_0x49c4('0x69')][_0x49c4('0x1f')]);}break;case _0x49c4('0x72'):var _0x1ea1b4=_0xb20a5d[_0x49c4('0x69')][_0x49c4('0x32')](',')[_0x49c4('0x30')](function(_0x3feb0b){return Number(_0x3feb0b);});_0x1ea1b4[_0x49c4('0x33')](function(_0x1743d0){_0x27b9c2['or'](_0x49c4('0x73'),'%,'+_0x1743d0+',%');});_0x3894e0=_[_0x49c4('0x74')](_0x3894e0,_0x1ea1b4);break;case _0x49c4('0x75'):if(_0xb20a5d[_0x49c4('0x76')]===_0x49c4('0x77')){_0x2f520f[_0x4dc54d](_0x49c4('0x78'),'%'+_0xb20a5d[_0x49c4('0x69')]+'%',null);}else{_0x679134=_[_0x49c4('0x67')](_0x2d93d8,['name','UserId']);_0xb20a5d[_0x49c4('0x53')]=_0x49c4('0x3c');_0x191afb=as['buildExpression'](_0x515240,_0x679134[_0x49c4('0x43')],_0xb20a5d);_0x2f520f[_0x4dc54d](_0x191afb[_0x49c4('0x79')],_0x191afb[_0x49c4('0x69')][_0x49c4('0x7a')],_0x191afb['value']['end']);}break;case'body':_0x191afb=as[_0x49c4('0x71')]('me',null,_0xb20a5d);_0x2f520f[_0x4dc54d](_0x191afb[_0x49c4('0x79')],_0x191afb[_0x49c4('0x69')][_0x49c4('0x7a')],_0x191afb[_0x49c4('0x69')][_0x49c4('0x1f')]);break;}}else{var _0x191afb=as[_0x49c4('0x71')](_0x515240,_0x679134[_0x49c4('0x43')],_0xb20a5d);_0x2f520f[_0x4dc54d](_0x191afb['text'],_0x191afb[_0x49c4('0x69')][_0x49c4('0x7a')],_0x191afb[_0x49c4('0x69')]['end']);}}}else{var _0x4448b9=_(_0x4d27d0[_0x49c4('0x47')])[_0x49c4('0x46')]()[_0x49c4('0x30')](function(_0x1f25be){return _[_0x49c4('0x7b')](_0x2d93d8,[_0x49c4('0x28'),_0x1f25be])?_0x1f25be:undefined;})[_0x49c4('0x7c')]()['value']();if(!_[_0x49c4('0x7d')](_0x4448b9)){_0x4448b9[_0x49c4('0x33')](function(_0x85540f){if(_0x85540f===_0x49c4('0x7e')){_0x5d24f3[_0x49c4('0x50')]('i.ChatWebsiteId\x20IN\x20?',[]['concat'](_0x4d27d0[_0x49c4('0x47')][_0x85540f]));}else if(_0x85540f==='createdAt'){var _0x34cf49=JSON['parse'](_0x4d27d0[_0x49c4('0x47')][_0x85540f])[_0x49c4('0x7f')];var _0x3b03dd=JSON[_0x49c4('0x80')](_0x4d27d0['query'][_0x85540f])[_0x49c4('0x81')];_0x5d24f3[_0x49c4('0x50')](_0x49c4('0x82'),_0x34cf49,_0x3b03dd);}else{if(_0x4d27d0[_0x49c4('0x47')][_0x85540f]===_0x49c4('0x83')){_0x5d24f3[_0x49c4('0x50')]('i.'+_0x85540f+_0x49c4('0x84'));}else{_0x5d24f3[_0x49c4('0x50')]('i.'+_0x85540f+_0x49c4('0x85'),_0x4d27d0[_0x49c4('0x47')][_0x85540f]);}}});}if(_0x4d27d0['query'][_0x49c4('0x86')]){if(_0x4d27d0[_0x49c4('0x47')]['read']==0x1){_0x5d24f3[_0x49c4('0x6b')]('`unreadMessages`\x20=\x200');}else{_0x5d24f3[_0x49c4('0x6b')](_0x49c4('0x87'));}}if(_0x4d27d0[_0x49c4('0x47')][_0x49c4('0x88')]){_0x3894e0=_[_0x49c4('0x89')](_0x4d27d0['query'][_0x49c4('0x88')])?_0x4d27d0[_0x49c4('0x47')]['tag']:new Array(_0x4d27d0[_0x49c4('0x47')][_0x49c4('0x88')]);_0x3894e0['forEach'](function(_0xbd12b9){_0x27b9c2['or'](_0x49c4('0x73'),'%,'+_0xbd12b9+',%');});}if(_0x4d27d0['query'][_0x49c4('0x8a')]){var _0x993d00=_0x4d27d0[_0x49c4('0x47')][_0x49c4('0x8a')]['replace']('\x5c','\x5c\x5c')[_0x49c4('0x8b')](/'/g,'\x27\x27');if(qs[_0x49c4('0x8c')](_0x993d00)){_0x2f520f['or']('i.id\x20LIKE\x20?',_0x993d00+'%');}else{_0x2f520f['or'](_0x49c4('0x8d'),qs['getFullTextValue'](_0x993d00))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x993d00+'%');}}}_0x5d24f3[_0x49c4('0x50')](_0x2f520f);_0x5d24f3['group']('i.id');var _0x39cacf={'type':db[_0x49c4('0x8e')]['QueryTypes'][_0x49c4('0x8f')],'raw':!![]};var _0x5c3509=_0x5d24f3['clone']();_0x5c3509['field'](_0x49c4('0x90'));_0x5c3509[_0x49c4('0x53')](_0x49c4('0x91'),_0x49c4('0x68'));if(_0x628423['order']){_0x628423['order'][_0x49c4('0x33')](function(_0x48705c){var _0x2c560e=_0x48705c[0x0]==='contactName'?_0x48705c[0x0]:'i.'+_0x48705c[0x0];_0x5d24f3[_0x49c4('0x4e')](_0x2c560e,_0x48705c[0x1]===_0x49c4('0x92')?![]:!![]);});}if(!_[_0x49c4('0x7d')](_0x3894e0)){_0x5d24f3[_0x49c4('0x6b')](_0x27b9c2);_0x5c3509[_0x49c4('0x50')](_0x49c4('0x93'),_0x3894e0);}BPromise[_0x49c4('0x94')]()['then'](function(){if(!_0x10dec7){if(_0x4d27d0[_0x49c4('0x47')][_0x49c4('0x7e')])return;_0x5c3509[_0x49c4('0x50')](_0x49c4('0x95'));_0x5d24f3[_0x49c4('0x50')]('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');return;}if(_0x4d27d0[_0x49c4('0x96')][_0x49c4('0x97')]!==_0x49c4('0x98'))return;return _0x4d27d0['user']['getChatWebsites']({'attributes':['id'],'raw':!![]})[_0x49c4('0x14')](function(_0x27b31d){if(_[_0x49c4('0x7d')](_0x27b31d)){_0x5c3509[_0x49c4('0x50')](_0x49c4('0x99'));_0x5d24f3['where'](_0x49c4('0x99'));}else{_0x5c3509[_0x49c4('0x50')](_0x49c4('0x9a'),_[_0x49c4('0x30')](_0x27b31d,'id'));_0x5d24f3['where']('i.ChatWebsiteId\x20IN\x20?',_[_0x49c4('0x30')](_0x27b31d,'id'));}});})[_0x49c4('0x14')](function(){if(_0x4d27d0[_0x49c4('0x96')][_0x49c4('0x97')]===_0x49c4('0x98')&&!_0x10dec7&&!_0x4d27d0['query'][_0x49c4('0x7e')])return[];return db[_0x49c4('0x9b')][_0x49c4('0x47')](_0x5c3509[_0x49c4('0x9c')](),_0x39cacf);})[_0x49c4('0x14')](function(_0x8f37e5){_0x258abe['count']=_0x8f37e5[_0x49c4('0x4c')];if(_0x258abe[_0x49c4('0x23')]===0x0)return[];return db[_0x49c4('0x9b')][_0x49c4('0x47')](_0x5e63f0['toString'](),_0x39cacf)['then'](function(_0xa96f53){_0x5b822f=_['keyBy'](_0xa96f53,'id');_0x39cacf=_[_0x49c4('0x2a')](_0x39cacf,{'model':db['ChatInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x4d27d0[_0x49c4('0x47')][_0x49c4('0x4b')]){_0x628423[_0x49c4('0x4a')][_0x49c4('0x33')](function(_0x4eebc9){_0x5d24f3['field']('i.'+_0x4eebc9);});}else{_0x5d24f3[_0x49c4('0x53')](_0x49c4('0x91'),_0x49c4('0x68'));_0x5d24f3['field']('a.key',_0x49c4('0x9d'));_0x5d24f3['field']('a.mandatoryDisposition',_0x49c4('0x9e'));_0x5d24f3['field'](_0x49c4('0x9f'),_0x49c4('0xa0'));_0x5d24f3['field'](_0x49c4('0xa1'));_0x5d24f3[_0x49c4('0x53')]('c.firstName','Contact.firstName');_0x5d24f3[_0x49c4('0x53')]('c.lastName',_0x49c4('0xa2'));_0x5d24f3[_0x49c4('0x53')](_0x49c4('0xa3'),_0x49c4('0xa4'));_0x5d24f3[_0x49c4('0x53')](_0x49c4('0xa5'),_0x49c4('0xa6'));_0x5d24f3['field'](_0x49c4('0xa7'),_0x49c4('0xa8'));_0x5d24f3[_0x49c4('0x53')](_0x49c4('0xa9'),_0x49c4('0xaa'));_0x5d24f3['field'](_0x49c4('0xab'),'Owner.fullname');_0x5d24f3[_0x49c4('0x53')](_0x49c4('0xac'),_0x49c4('0xad'));_0x5d24f3[_0x49c4('0x53')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x49c4('0x31'));}if(_0x628423[_0x49c4('0x24')])_0x5d24f3[_0x49c4('0x24')](_0x628423[_0x49c4('0x24')]);if(_0x628423[_0x49c4('0x21')])_0x5d24f3[_0x49c4('0x21')](_0x628423['offset']);return db[_0x49c4('0x9b')]['query'](_0x5d24f3[_0x49c4('0x9c')](),_0x39cacf);})[_0x49c4('0x14')](function(_0x1db53d){if(_0x1db53d[_0x49c4('0x4c')]>0x0)_0x4081a5['where'](_0x49c4('0xae'),_[_0x49c4('0x30')](_0x1db53d,'id'));return db['sequelize'][_0x49c4('0x47')](_0x4081a5[_0x49c4('0x9c')](),_0x39cacf)['then'](function(_0x562f47){var _0x25f1c7=_[_0x49c4('0xaf')](_0x562f47,_0x49c4('0xb0'));var _0x1aa3a3=[];_0x1db53d[_0x49c4('0x33')](function(_0x15e403){_0x1aa3a3[_0x49c4('0x35')](updateChatInteraction(_0x15e403,_0x5b822f,_0x25f1c7));});return BPromise[_0x49c4('0xb1')](_0x1aa3a3);});});})[_0x49c4('0x14')](function(_0x117c64){_0x258abe[_0x49c4('0xb2')]=_0x117c64;return _0x258abe;})['then'](respondWithFilteredResult(_0x33696e,_0x628423))['catch'](handleError(_0x33696e,null));};exports[_0x49c4('0xb3')]=function(_0x1e286e,_0xccdf6d){var _0x5be042={'raw':![],'where':{'id':_0x1e286e[_0x49c4('0xb4')]['id']}},_0x1276bf={};_0x1276bf['model']=_[_0x49c4('0x46')](db['ChatInteraction'][_0x49c4('0x41')]);_0x1276bf[_0x49c4('0x47')]=_[_0x49c4('0x46')](_0x1e286e[_0x49c4('0x47')]);_0x1276bf['filters']=_[_0x49c4('0x49')](_0x1276bf[_0x49c4('0x45')],_0x1276bf[_0x49c4('0x47')]);_0x5be042[_0x49c4('0x4a')]=_[_0x49c4('0x49')](_0x1276bf['model'],qs['fields'](_0x1e286e['query'][_0x49c4('0x4b')]));_0x5be042[_0x49c4('0x4a')]=_0x5be042[_0x49c4('0x4a')][_0x49c4('0x4c')]?_0x5be042[_0x49c4('0x4a')]:_0x1276bf['model'];if(_0x1e286e[_0x49c4('0x47')][_0x49c4('0xb5')]){_0x5be042[_0x49c4('0xb6')]=[{'all':!![]}];}_0x5be042=_[_0x49c4('0x2a')]({},_0x5be042,_0x1e286e['options']);return db[_0x49c4('0x40')][_0x49c4('0x67')](_0x5be042)[_0x49c4('0x14')](handleEntityNotFound(_0xccdf6d,null))[_0x49c4('0x14')](respondWithResult(_0xccdf6d,null))[_0x49c4('0x1d')](handleError(_0xccdf6d,null));};exports['create']=function(_0x1d9e1a,_0x9b622d){return db[_0x49c4('0x40')]['create'](_0x1d9e1a[_0x49c4('0x2b')],{})[_0x49c4('0x14')](respondWithResult(_0x9b622d,0xc9))[_0x49c4('0x1d')](handleError(_0x9b622d,null));};exports['update']=function(_0x97f579,_0x491231){if(_0x97f579['body']['id']){delete _0x97f579[_0x49c4('0x2b')]['id'];}return db[_0x49c4('0x40')]['find']({'where':{'id':_0x97f579[_0x49c4('0xb4')]['id']}})[_0x49c4('0x14')](handleEntityNotFound(_0x491231,null))[_0x49c4('0x14')](saveUpdates(_0x97f579[_0x49c4('0x2b')],null))[_0x49c4('0x14')](respondWithResult(_0x491231,null))[_0x49c4('0x1d')](handleError(_0x491231,null));};exports[_0x49c4('0xb7')]=function(_0x219133,_0x59dbef){return db['ChatInteraction'][_0x49c4('0x67')]({'where':{'id':_0x219133[_0x49c4('0xb4')]['id']}})[_0x49c4('0x14')](handleEntityNotFound(_0x59dbef,null))['then'](removeEntity(_0x59dbef,null))['catch'](handleError(_0x59dbef,null));};exports[_0x49c4('0xb8')]=function(_0x3222ec,_0xd979f7){return db[_0x49c4('0x40')][_0x49c4('0xb8')]()[_0x49c4('0x14')](respondWithResult(_0xd979f7,null))[_0x49c4('0x1d')](handleError(_0xd979f7,null));};exports[_0x49c4('0xb9')]=function(_0x318008,_0x1e2dd3){var _0xa42e74=_0x318008[_0x49c4('0xb4')]['id'];var _0x352b67;var _0xbfb25b;var _0x4cc855;return db[_0x49c4('0x40')][_0x49c4('0xba')]({'where':{'id':_0xa42e74}})[_0x49c4('0x14')](function(_0x318aaf){_0x352b67=_0x318aaf;return db['ChatWebsite']['findOne']({'where':{'id':_0x318aaf[_0x49c4('0x7e')]},'attributes':['id','vidaooApiKey',_0x49c4('0xbb'),_0x49c4('0xbc'),_0x49c4('0xbd'),_0x49c4('0xbe')],'raw':!![]});})[_0x49c4('0x14')](function(_0x45a2ef){if(_0x45a2ef&&_0x45a2ef[_0x49c4('0xbf')]&&_0x45a2ef[_0x49c4('0xbb')]){_0xbfb25b=_0x45a2ef;var _0x31ba95={'interaction':{'id':_0xa42e74},'agent':{'id':_0x318008[_0x49c4('0x96')]['id'],'name':_0x318008[_0x49c4('0x96')][_0x49c4('0x28')],'fullname':_0x318008['user'][_0x49c4('0xc0')],'email':_0x318008[_0x49c4('0x96')][_0x49c4('0xc1')]},'contact':_0x318008['body'][_0x49c4('0x2c')],'account':_0x318008['body'][_0x49c4('0x2e')]};var _0x82925={'rejectUnauthorized':![],'method':_0x49c4('0xc2'),'url':_0x49c4('0xc3'),'headers':{'X-APIKEY':_0x45a2ef['vidaooApiKey']},'body':{'duration':null,'scheduledAt':null,'participants':[_0x318008[_0x49c4('0x96')]['email']],'buttons':null,'topic':_0xbfb25b['vidaooTopic'],'note':_[_0x49c4('0xc4')](_0xbfb25b[_0x49c4('0xbd')])?null:getMustacheRender(_0xbfb25b[_0x49c4('0xbd')],_0x31ba95),'metadata':null},'redirect':'follow','json':!![]};try{if(!_['isNull'](_0xbfb25b[_0x49c4('0xbe')])){var _0x1221de=getMustacheRender(_0xbfb25b[_0x49c4('0xbe')],_0x31ba95);var _0x330512=JSON[_0x49c4('0x80')](_0x1221de);_0x82925[_0x49c4('0x2b')][_0x49c4('0xc5')]=_0x330512;}}catch(_0x19f30b){throw new db[(_0x49c4('0x8e'))]['ValidationError'](_0x49c4('0xc6'));}return rp(_0x82925);}else{throw new db[(_0x49c4('0x8e'))]['ValidationError']('Error\x20in\x20Vidaoo\x20configuration');}})[_0x49c4('0x14')](function(_0x4d5481){_0x4cc855=_0x4d5481;if(_0x4cc855['id']){var _0xefec38={'body':_0x4cc855['join_url'],'ChatWebsiteId':_0xbfb25b['id'],'ChatInteractionId':_0x352b67['id'],'direction':_0x49c4('0xc7'),'UserId':_0x318008['user']['id']};return db[_0x49c4('0xc8')][_0x49c4('0xc9')](_0xefec38,{});}else{throw new db[(_0x49c4('0x8e'))][(_0x49c4('0xca'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})['then'](function(){return _0x352b67[_0x49c4('0xcb')]({'vidaooSessionId':_0x4cc855['id']});})[_0x49c4('0x14')](respondWithResult(_0x1e2dd3,null))[_0x49c4('0x1d')](handleError(_0x1e2dd3,null));};exports['customUpdate']=function(_0x367d3d,_0x1814c4){if(_0x367d3d['body']['id']){delete _0x367d3d['body']['id'];}return db[_0x49c4('0x40')][_0x49c4('0x67')]({'where':{'id':_0x367d3d[_0x49c4('0xb4')]['id']},'include':[{'model':db['CmContact'],'as':_0x49c4('0x6c')}]})[_0x49c4('0x14')](handleEntityNotFound(_0x1814c4,null))[_0x49c4('0x14')](saveUpdates(_0x367d3d[_0x49c4('0x2b')],null))['then'](respondWithResult(_0x1814c4,null))[_0x49c4('0x1d')](handleError(_0x1814c4,null));};exports['abandon']=function(_0x4d0a28,_0xf5f718){if(_0x4d0a28[_0x49c4('0x2b')]['id']){delete _0x4d0a28[_0x49c4('0x2b')]['id'];}return db[_0x49c4('0x40')]['find']({'where':{'id':_0x4d0a28[_0x49c4('0xb4')]['id']}})[_0x49c4('0x14')](function(_0xa6f48){if(!_0xa6f48){logger[_0x49c4('0x1a')]('abandonInteraction,\x20%s,\x20%s,\x20%s',_0x49c4('0xcc'),0x194,'entity\x20not\x20found');_0xf5f718['sendStatus'](0x194);}else{if(_0xa6f48[_0x49c4('0x3c')]){throw new db[(_0x49c4('0x8e'))][(_0x49c4('0xca'))]('Interaction\x20already\x20assigned');}}return _0xa6f48;})[_0x49c4('0x14')](function(_0x4a874a){if(_0x4a874a){return _0x4a874a[_0x49c4('0x27')]({'closed':_0x4d0a28[_0x49c4('0x2b')][_0x49c4('0x3d')],'disposition':_0x4d0a28[_0x49c4('0x2b')][_0x49c4('0x3e')]})[_0x49c4('0x14')](function(_0x2b31ac){return _0x2b31ac;});}})['then'](function(){return respondWithRpcPromise(_0x49c4('0xcd'),_0x49c4('0xcc'),_0x4d0a28[_0x49c4('0x2b')],client9004);})[_0x49c4('0x14')](respondWithResult(_0xf5f718,null))['catch'](handleError(_0xf5f718,null));};exports['attachmentUpload']=function(_0x4c15ff,_0x2d4f8a){_0x4c15ff[_0x49c4('0x2b')][_0x49c4('0x28')]=_0x4c15ff[_0x49c4('0xce')][_0x49c4('0xcf')];_0x4c15ff[_0x49c4('0x2b')][_0x49c4('0xd0')]=_0x4c15ff['file'][_0x49c4('0xd1')];_0x4c15ff[_0x49c4('0x2b')]['type']=_0x4c15ff['file']['mimetype'];return db[_0x49c4('0xd2')][_0x49c4('0xc9')](_0x4c15ff[_0x49c4('0x2b')])[_0x49c4('0x14')](respondWithResult(_0x2d4f8a,0xc9))[_0x49c4('0x1d')](handleError(_0x2d4f8a,null));};exports[_0x49c4('0xd3')]=function(_0x2f36c6,_0x5039fc){return db[_0x49c4('0x40')][_0x49c4('0xba')]({'where':{'id':_0x2f36c6[_0x49c4('0xb4')]['id']},'raw':!![]})[_0x49c4('0x14')](handleEntityNotFound(_0x5039fc,null))['then'](function(_0x3440ad){if(_0x3440ad){if(_0x3440ad[_0x49c4('0x3d')]){return _0x5039fc[_0x49c4('0x1e')](0x193)[_0x49c4('0x20')]({'status':0x193,'message':_0x49c4('0xd4')});}return db['Attachment'][_0x49c4('0xba')]({'where':{'id':_0x2f36c6['query']['attachId']},'raw':!![]})[_0x49c4('0x14')](handleEntityNotFound(_0x5039fc,null));}})[_0x49c4('0x14')](function(_0x113beb){if(_0x113beb){var _0x35289f=_0x113beb[_0x49c4('0xd5')]!==null;var _0x5b9591=path[_0x49c4('0xd6')](config[_0x49c4('0xd7')],_0x49c4('0xd8'));if(_0x35289f){_0x5b9591=path['join'](_0x5b9591,_0x49c4('0xd9'));}var _0x45c34a=path['join'](_0x5b9591,_0x113beb[_0x49c4('0xd0')]);return _0x5039fc[_0x49c4('0xda')](_0x45c34a);}})[_0x49c4('0x1d')](handleError(_0x5039fc,null));};exports[_0x49c4('0xdb')]=function(_0x2ef538,_0x163128){var _0x1679ca=null;var _0x4b0114=null;var _0x261d61=null;if(_0x2ef538[_0x49c4('0x2b')]['id']){delete _0x2ef538[_0x49c4('0x2b')]['id'];}if(_0x2ef538[_0x49c4('0x2b')][_0x49c4('0xdc')]){_0x261d61=path['join'](config[_0x49c4('0xd7')],_0x49c4('0xdd'),util[_0x49c4('0xde')](_0x49c4('0xdf'),Date[_0x49c4('0xe0')]()));_0x2ef538['body'][_0x49c4('0xe1')]=_0x261d61;}return db[_0x49c4('0x40')][_0x49c4('0x67')]({'where':{'id':_0x2ef538[_0x49c4('0xb4')]['id']},'include':[{'model':db[_0x49c4('0xc8')],'as':_0x49c4('0xe2'),'include':[{'model':db[_0x49c4('0x75')],'as':_0x49c4('0x75')}]}]})[_0x49c4('0x14')](handleEntityNotFound(_0x163128,null))[_0x49c4('0x14')](saveUpdates(_0x2ef538['body'],null))[_0x49c4('0x14')](function(_0x1b6966){if(_0x1b6966){_0x1679ca=_0x1b6966;return db[_0x49c4('0xe3')][_0x49c4('0x67')]({'where':{'id':_0x1679ca[_0x49c4('0x7e')]}});}})['then'](function(_0x501786){if(_0x501786){_0x4b0114=_0x501786;return db[_0x49c4('0xe4')][_0x49c4('0x67')]({'where':{'id':_0x1679ca[_0x49c4('0x70')]}});}})[_0x49c4('0x14')](function(_0xd87f7e){if(_0xd87f7e){if(_0x261d61){var _0x25d2a1=null;for(var _0x58d24f=0x1;_0x58d24f<_0x1679ca[_0x49c4('0xe2')][_0x49c4('0x4c')];++_0x58d24f){_0x25d2a1=_0x1679ca['Messages'][_0x58d24f];var _0x386595=_0x25d2a1['UserId']?util[_0x49c4('0xde')](_0x49c4('0xe5'),_0x4b0114[_0x49c4('0xe6')],_0x25d2a1['UserId']):_0x49c4('0xe7');var _0x4f431e=_0x2ef538[_0x49c4('0x2b')]['customer']||util['format'](_0x49c4('0xe5'),_0x49c4('0xe8'),_0x25d2a1[_0x49c4('0x70')]);switch(_0x4b0114[_0x49c4('0xe9')]){case _0x49c4('0xea'):_0x386595=_0x25d2a1[_0x49c4('0x3c')]?util['format']('%s%d',_0x4b0114[_0x49c4('0xe6')],_0x25d2a1[_0x49c4('0x3c')]):_0x49c4('0xe7');break;case _0x49c4('0xeb'):_0x386595=_0x25d2a1[_0x49c4('0x3c')]?_0x25d2a1[_0x49c4('0x75')][_0x49c4('0xec')]||_0x25d2a1['User']['fullname']:'System';break;case'agent_fullname':_0x386595=_0x25d2a1[_0x49c4('0x3c')]?_0x25d2a1['User'][_0x49c4('0xc0')]:_0x49c4('0xe7');break;default:_0x386595=_0x25d2a1[_0x49c4('0x3c')]?util['format']('%s%d',_0x4b0114[_0x49c4('0xe6')],_0x25d2a1[_0x49c4('0x3c')]):'System';}var _0x4323ec=util[_0x49c4('0xde')](_0x49c4('0xed'),moment(_0x25d2a1[_0x49c4('0xee')])[_0x49c4('0xde')](_0x49c4('0xef')),_0x25d2a1['direction']==='in'?_0x4f431e:_0x386595,_0x25d2a1[_0x49c4('0x2b')]);if(!_0x25d2a1[_0x49c4('0xf0')]){fs[_0x49c4('0xf1')](_0x261d61,_0x4323ec);}}return db['MailAccount'][_0x49c4('0xba')]({'where':{'service':!![]},'include':[{'model':db[_0x49c4('0xf2')],'as':_0x49c4('0xf3'),'raw':!![],'include':[{'model':db[_0x49c4('0xf4')],'as':_0x49c4('0xf4'),'raw':!![]}]}]});}}})[_0x49c4('0x14')](function(_0x82c4bf){if(!_0x82c4bf||!_0x82c4bf[_0x49c4('0xf3')]||!_0x2ef538['body'])return _0x1679ca;var _0x2fc500=_0x82c4bf[_0x49c4('0xf5')]();return respondWithRpcPromise(_0x49c4('0xf6'),_0x49c4('0xf7'),{'account':_0x2fc500,'message':{'from':util[_0x49c4('0xde')](_0x49c4('0xf8'),_0x82c4bf['name'],_0x82c4bf[_0x49c4('0xc1')]||_0x82c4bf[_0x49c4('0xf3')][_0x49c4('0x96')]),'to':_0x2ef538[_0x49c4('0x2b')][_0x49c4('0xdc')],'subject':_0x49c4('0xf9'),'text':util[_0x49c4('0xde')](_0x49c4('0xfa'),_0x2ef538[_0x49c4('0x2b')][_0x49c4('0xdc')]),'attachments':[{'path':_0x261d61}]}})[_0x49c4('0x14')](function(){return _0x1679ca;})[_0x49c4('0x1d')](function(_0x471e28){logger[_0x49c4('0x1a')](_0x471e28);});})['then'](respondWithStatusCode(_0x163128,0xc8))['catch'](handleError(_0x163128,null));};exports[_0x49c4('0xfb')]=function(_0x3b6fd2,_0x4c07b3){return db['ChatMessage'][_0x49c4('0x67')]({'where':{'id':_0x3b6fd2['params']['id']}})[_0x49c4('0x14')](handleEntityNotFound(_0x4c07b3,null))[_0x49c4('0x14')](function(_0x1ac2c0){if(_0x1ac2c0){return _0x1ac2c0[_0x49c4('0xfb')](_0x3b6fd2[_0x49c4('0x2b')][_0x49c4('0xfc')],_[_0x49c4('0xfd')](_0x3b6fd2[_0x49c4('0x2b')],['ids','id'])||{});}})[_0x49c4('0x14')](respondWithResult(_0x4c07b3,null))[_0x49c4('0x1d')](handleError(_0x4c07b3,null));};exports[_0x49c4('0xfe')]=function(_0xd2ee5e,_0x201909){var _0x5b2cc8={'raw':![],'where':{}};var _0x2bfa4f={};var _0x2b507f={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x49c4('0xba')]({'where':{'id':_0xd2ee5e[_0x49c4('0xb4')]['id']}})['then'](handleEntityNotFound(_0x201909,null))[_0x49c4('0x14')](function(_0x3119a5){if(_0x3119a5){_0x2bfa4f[_0x49c4('0x45')]=_['keys'](db[_0x49c4('0xc8')][_0x49c4('0x41')]);_0x2bfa4f[_0x49c4('0x47')]=_[_0x49c4('0x46')](_0xd2ee5e['query']);_0x2bfa4f[_0x49c4('0x48')]=_['intersection'](_0x2bfa4f[_0x49c4('0x45')],_0x2bfa4f[_0x49c4('0x47')]);_0x5b2cc8[_0x49c4('0x4a')]=_[_0x49c4('0x49')](_0x2bfa4f['model'],qs[_0x49c4('0x4b')](_0xd2ee5e[_0x49c4('0x47')][_0x49c4('0x4b')]));_0x5b2cc8[_0x49c4('0x4a')]=_0x5b2cc8[_0x49c4('0x4a')][_0x49c4('0x4c')]?_0x5b2cc8['attributes']:_0x2bfa4f['model'];if(!_0xd2ee5e[_0x49c4('0x47')][_0x49c4('0xff')](_0x49c4('0x4d'))){_0x5b2cc8[_0x49c4('0x24')]=qs[_0x49c4('0x24')](_0xd2ee5e[_0x49c4('0x47')][_0x49c4('0x24')]);_0x5b2cc8[_0x49c4('0x21')]=qs[_0x49c4('0x21')](_0xd2ee5e[_0x49c4('0x47')][_0x49c4('0x21')]);}_0x5b2cc8[_0x49c4('0x4e')]=qs['sort'](_0xd2ee5e[_0x49c4('0x47')][_0x49c4('0x4f')]);_0x5b2cc8['where']=qs[_0x49c4('0x48')](_['pick'](_0xd2ee5e[_0x49c4('0x47')],_0x2bfa4f[_0x49c4('0x48')]));_0x5b2cc8['where'][_0x49c4('0xb0')]=_0x3119a5['id'];if(_0xd2ee5e[_0x49c4('0x47')][_0x49c4('0x8a')]){_0x5b2cc8[_0x49c4('0x50')]=_[_0x49c4('0x2a')](_0x5b2cc8['where'],{'$or':_[_0x49c4('0x30')](_0x5b2cc8['attributes'],function(_0x1c74ce){var _0x216896={};_0x216896[_0x1c74ce]={'$like':'%'+_0xd2ee5e[_0x49c4('0x47')]['filter']+'%'};return _0x216896;})});}if(_0xd2ee5e[_0x49c4('0x47')][_0x49c4('0x7f')]){var _0x37ec56=_0xd2ee5e['query']['$gte'][_0x49c4('0x32')](',');var _0x590586={};_0x590586[_0x37ec56[0x0]]={'$gte':moment(_0x37ec56[0x1])[_0x49c4('0xde')](_0x49c4('0x100'))};_0x5b2cc8[_0x49c4('0x50')]=_[_0x49c4('0x2a')](_0x5b2cc8['where'],_0x590586);}_0x5b2cc8=_['merge']({},_0x5b2cc8,_0xd2ee5e['options']);return db[_0x49c4('0xc8')][_0x49c4('0x23')]({'where':_0x5b2cc8[_0x49c4('0x50')]})[_0x49c4('0x14')](function(_0x5255f7){_0x2b507f[_0x49c4('0x23')]=_0x5255f7;if(_0xd2ee5e[_0x49c4('0x47')][_0x49c4('0xb5')]){_0x5b2cc8[_0x49c4('0xb6')]=[{'all':!![]}];}return db[_0x49c4('0xc8')][_0x49c4('0x101')](_0x5b2cc8);})[_0x49c4('0x14')](function(_0x1d2931){_0x2b507f[_0x49c4('0xb2')]=_0x1d2931;return _0x2b507f;});}})[_0x49c4('0x14')](respondWithFilteredResult(_0x201909,_0x5b2cc8))[_0x49c4('0x1d')](handleError(_0x201909,null));};exports['getMyMessages']=function(_0x16e808,_0x514446){var _0x3308c4={'where':{}},_0x3683d7={},_0x4feb6f={'count':0x0,'rows':[]};return db[_0x49c4('0x40')]['findOne']({'where':{'id':_0x16e808[_0x49c4('0xb4')]['id']}})['then'](handleEntityNotFound(_0x514446,null))['then'](function(_0x577ae6){if(_0x577ae6){_0x3683d7[_0x49c4('0x45')]=_[_0x49c4('0x46')](db[_0x49c4('0xc8')]['rawAttributes']);_0x3683d7[_0x49c4('0x47')]=_['keys'](_0x16e808[_0x49c4('0x47')]);_0x3683d7[_0x49c4('0x48')]=_[_0x49c4('0x49')](_0x3683d7['model'],_0x3683d7[_0x49c4('0x47')]);_0x3308c4[_0x49c4('0x4a')]=_[_0x49c4('0x49')](_0x3683d7[_0x49c4('0x45')],qs[_0x49c4('0x4b')](_0x16e808['query'][_0x49c4('0x4b')]));_0x3308c4[_0x49c4('0x4a')]=_0x3308c4[_0x49c4('0x4a')][_0x49c4('0x4c')]?_0x3308c4['attributes']:_0x3683d7['model'];if(!_0x16e808[_0x49c4('0x47')][_0x49c4('0xff')]('nolimit')){_0x3308c4[_0x49c4('0x24')]=qs[_0x49c4('0x24')](_0x16e808[_0x49c4('0x47')][_0x49c4('0x24')]);_0x3308c4['offset']=qs[_0x49c4('0x21')](_0x16e808[_0x49c4('0x47')]['offset']);}_0x3308c4['order']=qs[_0x49c4('0x4f')](_0x16e808[_0x49c4('0x47')][_0x49c4('0x4f')]);_0x3308c4[_0x49c4('0x50')]=qs[_0x49c4('0x48')](_['pick'](_0x16e808[_0x49c4('0x47')],_0x3683d7['filters']));_0x3308c4[_0x49c4('0x50')][_0x49c4('0xb0')]=_0x577ae6['id'];if(_0x16e808[_0x49c4('0x47')][_0x49c4('0x8a')]){_0x3308c4['where']=_['merge'](_0x3308c4['where'],{'$or':_[_0x49c4('0x30')](_0x3308c4[_0x49c4('0x4a')],function(_0x14d5ca){var _0x2cb936={};_0x2cb936[_0x14d5ca]={'$like':'%'+_0x16e808['query']['filter']+'%'};return _0x2cb936;})});}_0x3308c4[_0x49c4('0x50')]['secret']=![];if(_0x16e808[_0x49c4('0x47')]['id']){_0x3308c4[_0x49c4('0x50')]['id']={'$gt':_0x16e808['query']['id']};}_0x3308c4=_[_0x49c4('0x2a')]({},_0x3308c4,_0x16e808[_0x49c4('0x102')]);return db[_0x49c4('0xc8')]['count']({'where':_0x3308c4[_0x49c4('0x50')]})[_0x49c4('0x14')](function(_0x1a5755){_0x4feb6f['count']=_0x1a5755;_0x3308c4[_0x49c4('0xb6')]=[];if(_0x16e808[_0x49c4('0x47')]['includeAgent']){_0x3308c4[_0x49c4('0xb6')][_0x49c4('0x35')]({'model':db['User'],'as':_0x49c4('0x75'),'attributes':['id',_0x49c4('0xc0'),_0x49c4('0xec')]});}if(_0x16e808[_0x49c4('0x47')][_0x49c4('0xb5')]){_0x3308c4['include']=[{'all':!![]}];}return db[_0x49c4('0xc8')][_0x49c4('0x101')](_0x3308c4);})['then'](function(_0x5a4b35){_0x4feb6f[_0x49c4('0xb2')]=_0x5a4b35;return _0x4feb6f;});}})[_0x49c4('0x14')](respondWithFilteredResult(_0x514446,_0x3308c4))['catch'](handleError(_0x514446,null));};exports[_0x49c4('0x103')]=function(_0x55bb71,_0x4059b0){return db[_0x49c4('0x40')]['find']({'where':{'id':_0x55bb71[_0x49c4('0xb4')]['id']}})['then'](handleEntityNotFound(_0x4059b0,null))[_0x49c4('0x14')](function(_0x17ab2c){if(_0x17ab2c){return _0x17ab2c['setTags'](_0x55bb71[_0x49c4('0x2b')][_0x49c4('0xfc')],_['omit'](_0x55bb71['body'],[_0x49c4('0xfc'),'id'])||{})[_0x49c4('0x104')](function(){return db[_0x49c4('0x72')][_0x49c4('0x101')]({'attributes':['id',_0x49c4('0x28'),'color'],'where':{'id':_0x55bb71[_0x49c4('0x2b')][_0x49c4('0xfc')]}});})[_0x49c4('0x14')](function(_0xd62ca){socket[_0x49c4('0x105')]('chatInteractionTags:save',{'id':Number(_0x55bb71[_0x49c4('0xb4')]['id']),'tags':_0xd62ca||[]});return{'id':Number(_0x55bb71[_0x49c4('0xb4')]['id']),'tags':_0xd62ca||[]};});}})[_0x49c4('0x14')](respondWithResult(_0x4059b0,null))[_0x49c4('0x1d')](handleError(_0x4059b0,null));};exports[_0x49c4('0x106')]=function(_0x39abbf,_0x3de5d8){return db[_0x49c4('0x40')]['find']({'where':{'id':_0x39abbf[_0x49c4('0xb4')]['id']}})[_0x49c4('0x14')](handleEntityNotFound(_0x3de5d8,null))[_0x49c4('0x14')](function(_0x5a4b4c){if(_0x5a4b4c){return _0x5a4b4c['removeTags'](_0x39abbf[_0x49c4('0x47')]['ids']);}})[_0x49c4('0x14')](respondWithStatusCode(_0x3de5d8,null))[_0x49c4('0x1d')](handleError(_0x3de5d8,null));};exports[_0x49c4('0xda')]=function(_0x3f0e74,_0x55f423){var _0x3ce0f9=moment()[_0x49c4('0x107')]()[_0x49c4('0x9c')]();var _0x156a4f=path['join'](config[_0x49c4('0xd7')],_0x49c4('0x108'),'files',_0x49c4('0x109'));var _0x22005f=path[_0x49c4('0xd6')](config[_0x49c4('0xd7')],_0x49c4('0x108'),_0x49c4('0x10a'),_0x49c4('0x10b'));var _0x1d3b1a=path['join'](_0x156a4f,_0x3ce0f9);var _0x4eb6ba=util['format'](_0x49c4('0x10c'),_0x3f0e74[_0x49c4('0xb4')]['id'],_0x3ce0f9);var _0x418ead=path[_0x49c4('0xd6')](_0x156a4f,_0x4eb6ba);var _0x39ff8b=[];_0x39ff8b['push']({'model':db[_0x49c4('0x75')],'as':_0x49c4('0x75'),'attributes':['id',_0x49c4('0xc0')],'raw':!![]});_0x39ff8b[_0x49c4('0x35')]({'model':db['CmContact'],'as':'Contact','attributes':['id',_0x49c4('0x10d'),_0x49c4('0x10e')],'raw':!![]});if(_0x3f0e74[_0x49c4('0x47')][_0x49c4('0x10b')]){_0x39ff8b[_0x49c4('0x35')]({'model':db[_0x49c4('0xd2')],'as':'Attachment','raw':!![]});}var _0x58a5c9=[{'model':db[_0x49c4('0xc8')],'as':_0x49c4('0xe2'),'attributes':['id',_0x49c4('0x2b'),_0x49c4('0xee'),_0x49c4('0x10f'),'secret',_0x49c4('0x86')],'include':_0x39ff8b}];_0x58a5c9[_0x49c4('0x35')]({'model':db[_0x49c4('0xe3')],'as':_0x49c4('0x110'),'attributes':['id',_0x49c4('0x28')]});_0x58a5c9[_0x49c4('0x35')]({'model':db[_0x49c4('0x75')],'as':_0x49c4('0x111'),'attributes':['id',_0x49c4('0xc0')]});return db['ChatInteraction'][_0x49c4('0x67')]({'where':{'id':_0x3f0e74[_0x49c4('0xb4')]['id']},'include':_0x58a5c9})[_0x49c4('0x14')](handleEntityNotFound(_0x55f423,null))[_0x49c4('0x14')](function(_0xe5bb64){if(_0xe5bb64){var _0x5e5ca3=_0xe5bb64[_0x49c4('0x112')]({'plain':!![]});fs[_0x49c4('0x113')](_0x1d3b1a);var _0x485c2d={'channel':_0x49c4('0x114'),'account':_0x5e5ca3['Account'][_0x49c4('0x28')],'agent':_0x5e5ca3['Owner']?_0x5e5ca3[_0x49c4('0x111')][_0x49c4('0xc0')]:'N.A.','createdAt':moment(_0x5e5ca3[_0x49c4('0xee')])['format'](_0x49c4('0x100'))[_0x49c4('0x9c')](),'closedAt':_0x5e5ca3[_0x49c4('0x3d')]?moment(_0x5e5ca3[_0x49c4('0x115')])[_0x49c4('0xde')]('YYYY-MM-DD\x20HH:mm:ss')[_0x49c4('0x9c')]():'','disposition':_0x5e5ca3[_0x49c4('0x3e')],'chatInfo':{'browser':_0x5e5ca3[_0x49c4('0x116')],'os':_0x5e5ca3[_0x49c4('0x117')],'referer':_0x5e5ca3[_0x49c4('0x118')],'customerIp':_0x5e5ca3[_0x49c4('0x119')],'customerPort':_0x5e5ca3[_0x49c4('0x11a')]?_0x5e5ca3[_0x49c4('0x11a')]:'N.A.'},'messages':_(_0x5e5ca3[_0x49c4('0xe2')])[_0x49c4('0x11b')]()[_0x49c4('0x8a')]({'secret':![]})[_0x49c4('0x30')](function(_0x341528){if(_0x341528[_0x49c4('0xd2')]){var _0x2a0ef8=path[_0x49c4('0xd6')](_0x22005f,_0x341528[_0x49c4('0xd2')][_0x49c4('0xd0')]);if(fs[_0x49c4('0x11c')](_0x2a0ef8)){fs[_0x49c4('0x11d')](_0x2a0ef8)['pipe'](fs[_0x49c4('0x11e')](path['join'](_0x1d3b1a,_0x341528[_0x49c4('0xd2')][_0x49c4('0xd0')])));}}return{'date':moment(_0x341528[_0x49c4('0xee')])[_0x49c4('0xde')](_0x49c4('0x100'))[_0x49c4('0x9c')](),'sender':_0x341528[_0x49c4('0x10f')]===_0x49c4('0xc7')?_0x341528[_0x49c4('0x75')]?_0x341528[_0x49c4('0x75')][_0x49c4('0xc0')]:_0x49c4('0xe7'):_0x341528[_0x49c4('0x6c')][_0x49c4('0x10d')]+(_0x341528[_0x49c4('0x6c')]['lastName']?'\x20'+_0x341528[_0x49c4('0x6c')][_0x49c4('0x10e')]:''),'body':_0x341528['Attachment']?_0x341528[_0x49c4('0xd2')]['basename']:_0x341528[_0x49c4('0x2b')],'direction':_0x341528[_0x49c4('0x10f')]===_0x49c4('0xc7')?'A':'C','secret':_0x341528[_0x49c4('0xf0')],'read':_0x341528[_0x49c4('0x86')],'attachment':_0x341528['Attachment']};})['value']()};return ejs[_0x49c4('0x11f')](path[_0x49c4('0xd6')](config[_0x49c4('0xd7')],'server',_0x49c4('0x120'),_0x49c4('0x121')),{'interaction':_0x485c2d})['then'](function(_0x6a1d66){var _0x563f95=path['join'](_0x1d3b1a,'transcript-'+_0x5e5ca3['id']+'-'+_0x3ce0f9+_0x49c4('0x122'));var _0x442210={'path':_0x563f95,'channel':_0x49c4('0x114'),'interactionId':_0x5e5ca3['id']};return pdf[_0x49c4('0x123')](_0x6a1d66,_0x442210);})[_0x49c4('0x14')](function(){return new Promise(function(_0x547d37,_0x223fa2){zipdir(_0x1d3b1a,{'saveTo':_0x418ead},function(_0x147d5e,_0x29674d){if(_0x147d5e)return _0x223fa2(_0x147d5e);return _0x547d37(_0x29674d);});})['then'](function(){return new BPromise(function(_0x17b015,_0x724d15){rimraf(_0x1d3b1a,function(_0x3350da){if(_0x3350da)_0x724d15(_0x3350da);return _0x17b015();});});})[_0x49c4('0x14')](function(){return _0x55f423[_0x49c4('0xda')](_0x418ead,_0x4eb6ba,function(_0x146c6e){if(_0x146c6e){logger[_0x49c4('0x1a')](_0x49c4('0x124'),_0x146c6e);}else{fs[_0x49c4('0x125')](_0x418ead);}});});});}else{return _0x55f423[_0x49c4('0x126')](0xc8);}})[_0x49c4('0x1d')](handleError(_0x55f423,null));};
\ No newline at end of file
index ab9638e..cbbd6c3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4d38=['exports','ChatInteraction','ChatMessage','setMaxListeners','save','update','remove','getUsers','then','Users','map','setDataValue','unreadMessages','emit','hook'];(function(_0xc0e064,_0x130563){var _0x1748fe=function(_0x102f58){while(--_0x102f58){_0xc0e064['push'](_0xc0e064['shift']());}};_0x1748fe(++_0x130563);}(_0x4d38,0x15a));var _0x84d3=function(_0x38854e,_0x23cbc9){_0x38854e=_0x38854e-0x0;var _0x3f8415=_0x4d38[_0x38854e];return _0x3f8415;};'use strict';var EventEmitter=require('events');var ChatInteraction=require('../../mysqldb')['db'][_0x84d3('0x0')];var ChatMessage=require('../../mysqldb')['db'][_0x84d3('0x1')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x84d3('0x2')](0x0);var events={'afterCreate':_0x84d3('0x3'),'afterUpdate':_0x84d3('0x4'),'afterDestroy':_0x84d3('0x5')};function emitEvent(_0x3e49f3){return function(_0x31e5cc,_0x18e553,_0x3186f9){_0x31e5cc[_0x84d3('0x6')]({'attributes':['id'],'raw':!![]})[_0x84d3('0x7')](function(_0x4950eb){_0x31e5cc['setDataValue'](_0x84d3('0x8'),_0x4950eb[_0x84d3('0x9')](function(_0x2ba877){return{'id':_0x2ba877['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x31e5cc['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x3c7da){_0x31e5cc[_0x84d3('0xa')](_0x84d3('0xb'),_0x3c7da['length']);ChatInteractionEvents[_0x84d3('0xc')](_0x3e49f3+':'+_0x31e5cc['id'],_0x31e5cc);ChatInteractionEvents[_0x84d3('0xc')](_0x3e49f3,_0x31e5cc);_0x3186f9(null);})['catch'](_0x3186f9(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction[_0x84d3('0xd')](e,emitEvent(event));}}module[_0x84d3('0xe')]=ChatInteractionEvents;
\ No newline at end of file
+var _0x76b2=['Users','map','findAll','then','unreadMessages','emit','hasOwnProperty','exports','ChatInteraction','../../mysqldb','ChatMessage','setMaxListeners','save','remove','getUsers','setDataValue'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x76b2,0xa8));var _0x276b=function(_0x176b6c,_0x1c8db3){_0x176b6c=_0x176b6c-0x0;var _0x24aa00=_0x76b2[_0x176b6c];return _0x24aa00;};'use strict';var EventEmitter=require('events');var ChatInteraction=require('../../mysqldb')['db'][_0x276b('0x0')];var ChatMessage=require(_0x276b('0x1'))['db'][_0x276b('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x276b('0x3')](0x0);var events={'afterCreate':_0x276b('0x4'),'afterUpdate':'update','afterDestroy':_0x276b('0x5')};function emitEvent(_0x2e61ff){return function(_0x1d66f4,_0x407ac7,_0x3fb4aa){_0x1d66f4[_0x276b('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0x1d14a3){_0x1d66f4[_0x276b('0x7')](_0x276b('0x8'),_0x1d14a3[_0x276b('0x9')](function(_0x283b06){return{'id':_0x283b06['id']};}));return ChatMessage[_0x276b('0xa')]({'where':{'ChatInteractionId':_0x1d66f4['id'],'direction':'in','read':![]},'raw':!![]});})[_0x276b('0xb')](function(_0x553cda){_0x1d66f4[_0x276b('0x7')](_0x276b('0xc'),_0x553cda['length']);ChatInteractionEvents[_0x276b('0xd')](_0x2e61ff+':'+_0x1d66f4['id'],_0x1d66f4);ChatInteractionEvents['emit'](_0x2e61ff,_0x1d66f4);_0x3fb4aa(null);})['catch'](_0x3fb4aa(null));};}for(var e in events){if(events[_0x276b('0xe')](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0x276b('0xf')]=ChatInteractionEvents;
\ No newline at end of file
index 53c637d..67ea4b7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xda29=['changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','exports','define'];(function(_0x735cfe,_0x483598){var _0x530e22=function(_0x5587c0){while(--_0x5587c0){_0x735cfe['push'](_0x735cfe['shift']());}};_0x530e22(++_0x483598);}(_0xda29,0x148));var _0x9da2=function(_0x47aa64,_0xfb8a07){_0x47aa64=_0x47aa64-0x0;var _0x549c7a=_0xda29[_0x47aa64];return _0x549c7a;};'use strict';var _=require(_0x9da2('0x0'));var util=require('util');var logger=require(_0x9da2('0x1'))(_0x9da2('0x2'));var moment=require(_0x9da2('0x3'));var BPromise=require(_0x9da2('0x4'));var rp=require(_0x9da2('0x5'));var fs=require('fs');var path=require(_0x9da2('0x6'));var rimraf=require(_0x9da2('0x7'));var config=require(_0x9da2('0x8'));var attributes=require(_0x9da2('0x9'));module[_0x9da2('0xa')]=function(_0x64cf7,_0x5506a1){return _0x64cf7[_0x9da2('0xb')]('ChatInteraction',attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x236057,_0x5422ae,_0xa2c3d6){if(_0x236057[_0x9da2('0xc')](_0x9da2('0xd'))){_0x236057['closedAt']=moment()[_0x9da2('0xe')](_0x9da2('0xf'));}_0xa2c3d6(null,_0x236057);}},'charset':_0x9da2('0x10'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0xe8af=['define','ChatInteraction','chat_interactions','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./chatInteraction.attributes'];(function(_0x12a554,_0x3d7ef8){var _0x244ba0=function(_0x5eb5ff){while(--_0x5eb5ff){_0x12a554['push'](_0x12a554['shift']());}};_0x244ba0(++_0x3d7ef8);}(_0xe8af,0x1a1));var _0xfe8a=function(_0x359bbe,_0x5b7fcc){_0x359bbe=_0x359bbe-0x0;var _0x1b3353=_0xe8af[_0x359bbe];return _0x1b3353;};'use strict';var _=require('lodash');var util=require(_0xfe8a('0x0'));var logger=require(_0xfe8a('0x1'))(_0xfe8a('0x2'));var moment=require(_0xfe8a('0x3'));var BPromise=require('bluebird');var rp=require(_0xfe8a('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfe8a('0x5'));var config=require(_0xfe8a('0x6'));var attributes=require(_0xfe8a('0x7'));module['exports']=function(_0x66c5a6,_0x3aeb4f){return _0x66c5a6[_0xfe8a('0x8')](_0xfe8a('0x9'),attributes,{'tableName':_0xfe8a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x234da0,_0x2e3f3d,_0x28bb3b){if(_0x234da0['changed'](_0xfe8a('0xb'))){_0x234da0[_0xfe8a('0xc')]=moment()[_0xfe8a('0xd')](_0xfe8a('0xe'));}_0x28bb3b(null,_0x234da0);}},'charset':_0xfe8a('0xf'),'collate':_0xfe8a('0x10')});};
\ No newline at end of file
index 94e666d..63c8e6c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x17a4=['ids','spread','AddTags','lodash','moment','bluebird','randomstring','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','./chatInteraction.socket','register','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateChatInteraction','ChatInteraction','body','options','raw','where','attributes','limit','AddTagsToChatInteraction','find','addTags'];(function(_0x3d18af,_0x5b4fa0){var _0x2ef919=function(_0x3c26d6){while(--_0x3c26d6){_0x3d18af['push'](_0x3d18af['shift']());}};_0x2ef919(++_0x5b4fa0);}(_0x17a4,0x1bb));var _0x417a=function(_0xb725be,_0x45bd01){_0xb725be=_0xb725be-0x0;var _0x2f2424=_0x17a4[_0xb725be];return _0x2f2424;};'use strict';var _=require(_0x417a('0x0'));var util=require('util');var moment=require(_0x417a('0x1'));var BPromise=require(_0x417a('0x2'));var rs=require(_0x417a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x417a('0x4'))('rpc');var config=require(_0x417a('0x5'));var jayson=require(_0x417a('0x6'));var client=jayson[_0x417a('0x7')]['http']({'port':0x232a});config[_0x417a('0x8')]=_[_0x417a('0x9')](config[_0x417a('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x417a('0xa'))(new Redis(config[_0x417a('0x8')]));require(_0x417a('0xb'))[_0x417a('0xc')](socket);function respondWithRpcPromise(_0x159f68,_0xfaddc,_0x862792){return new BPromise(function(_0x5760f0,_0x2e7114){return client[_0x417a('0xd')](_0x159f68,_0x862792)[_0x417a('0xe')](function(_0xfbbc9a){logger[_0x417a('0xf')](_0x417a('0x10'),_0xfaddc,_0x417a('0x11'));logger[_0x417a('0x12')](_0x417a('0x13'),_0xfaddc,'request\x20sent',JSON[_0x417a('0x14')](_0xfbbc9a));if(_0xfbbc9a['error']){if(_0xfbbc9a[_0x417a('0x15')][_0x417a('0x16')]===0x1f4){logger[_0x417a('0x15')]('ChatInteraction,\x20%s,\x20%s',_0xfaddc,_0xfbbc9a['error']['message']);return _0x2e7114(_0xfbbc9a[_0x417a('0x15')][_0x417a('0x17')]);}logger[_0x417a('0x15')](_0x417a('0x10'),_0xfaddc,_0xfbbc9a[_0x417a('0x15')][_0x417a('0x17')]);return _0x5760f0(_0xfbbc9a[_0x417a('0x15')][_0x417a('0x17')]);}else{logger[_0x417a('0xf')](_0x417a('0x10'),_0xfaddc,_0x417a('0x11'));_0x5760f0(_0xfbbc9a[_0x417a('0x18')][_0x417a('0x17')]);}})[_0x417a('0x19')](function(_0x577b8a){logger[_0x417a('0x15')]('ChatInteraction,\x20%s,\x20%s',_0xfaddc,_0x577b8a);_0x2e7114(_0x577b8a);});});}exports[_0x417a('0x1a')]=function(_0x5b8a8e){var _0x3a5412=this;return new Promise(function(_0x406113,_0x162f20){return db[_0x417a('0x1b')]['update'](_0x5b8a8e[_0x417a('0x1c')],{'raw':_0x5b8a8e[_0x417a('0x1d')]?_0x5b8a8e[_0x417a('0x1d')][_0x417a('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5b8a8e[_0x417a('0x1d')]?_0x5b8a8e['options'][_0x417a('0x1f')]||null:null,'attributes':_0x5b8a8e[_0x417a('0x1d')]?_0x5b8a8e[_0x417a('0x1d')][_0x417a('0x20')]||null:null,'limit':_0x5b8a8e[_0x417a('0x1d')]?_0x5b8a8e[_0x417a('0x1d')][_0x417a('0x21')]||null:null})[_0x417a('0xe')](function(_0x11827f){logger[_0x417a('0xf')]('UpdateChatInteraction',_0x5b8a8e);logger[_0x417a('0x12')](_0x417a('0x1a'),_0x5b8a8e,JSON[_0x417a('0x14')](_0x11827f));_0x406113(_0x11827f);})[_0x417a('0x19')](function(_0x49784f){logger[_0x417a('0x15')](_0x417a('0x1a'),_0x49784f['message'],_0x5b8a8e);_0x162f20(_0x3a5412[_0x417a('0x15')](0x1f4,_0x49784f[_0x417a('0x17')]));});});};exports[_0x417a('0x22')]=function(_0x38c420){return new Promise(function(_0x382b5b,_0x235cf6){return db[_0x417a('0x1b')][_0x417a('0x23')]({'where':_0x38c420[_0x417a('0x1d')]?_0x38c420[_0x417a('0x1d')]['where']||null:null})['then'](function(_0x436fc6){if(_0x436fc6){return _0x436fc6[_0x417a('0x24')](_0x38c420[_0x417a('0x1c')][_0x417a('0x25')],_['omit'](_0x38c420['body'],[_0x417a('0x25'),'id'])||{});}})[_0x417a('0x26')](function(_0x125a4c){logger['info'](_0x417a('0x27'),_0x38c420);logger[_0x417a('0x12')](_0x417a('0x27'),_0x38c420,JSON[_0x417a('0x14')](_0x125a4c));_0x382b5b(_0x125a4c);})['catch'](function(_0x13f8cf){logger[_0x417a('0x15')](_0x417a('0x27'),_0x13f8cf[_0x417a('0x17')],_0x38c420);_0x235cf6(_this[_0x417a('0x15')](0x1f4,_0x13f8cf['message']));});});};
\ No newline at end of file
+var _0x7df8=['then','debug','UpdateChatInteraction','find','ids','omit','AddTags','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','localhost','socket.io-emitter','redis','./chatInteraction.socket','register','request','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','ChatInteraction','body','options','where','limit'];(function(_0x189b1d,_0x1df005){var _0x3d8ab0=function(_0x59a27f){while(--_0x59a27f){_0x189b1d['push'](_0x189b1d['shift']());}};_0x3d8ab0(++_0x1df005);}(_0x7df8,0x1f1));var _0x87df=function(_0x73302,_0x49d341){_0x73302=_0x73302-0x0;var _0x1e65b9=_0x7df8[_0x73302];return _0x1e65b9;};'use strict';var _=require(_0x87df('0x0'));var util=require(_0x87df('0x1'));var moment=require(_0x87df('0x2'));var BPromise=require(_0x87df('0x3'));var rs=require(_0x87df('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x87df('0x5'))['db'];var utils=require(_0x87df('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x87df('0x7'));var jayson=require(_0x87df('0x8'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0x87df('0x9'),'port':0x18eb});var socket=require(_0x87df('0xa'))(new Redis(config[_0x87df('0xb')]));require(_0x87df('0xc'))[_0x87df('0xd')](socket);function respondWithRpcPromise(_0x3a0a2e,_0x11354a,_0x1a9735){return new BPromise(function(_0x36956d,_0x2d8ad9){return client[_0x87df('0xe')](_0x3a0a2e,_0x1a9735)['then'](function(_0x75aaff){logger[_0x87df('0xf')](_0x87df('0x10'),_0x11354a,_0x87df('0x11'));logger['debug'](_0x87df('0x12'),_0x11354a,'request\x20sent',JSON[_0x87df('0x13')](_0x75aaff));if(_0x75aaff[_0x87df('0x14')]){if(_0x75aaff['error']['code']===0x1f4){logger[_0x87df('0x14')](_0x87df('0x10'),_0x11354a,_0x75aaff[_0x87df('0x14')]['message']);return _0x2d8ad9(_0x75aaff[_0x87df('0x14')][_0x87df('0x15')]);}logger['error'](_0x87df('0x10'),_0x11354a,_0x75aaff[_0x87df('0x14')][_0x87df('0x15')]);return _0x36956d(_0x75aaff[_0x87df('0x14')][_0x87df('0x15')]);}else{logger[_0x87df('0xf')]('ChatInteraction,\x20%s,\x20%s',_0x11354a,_0x87df('0x11'));_0x36956d(_0x75aaff['result'][_0x87df('0x15')]);}})[_0x87df('0x16')](function(_0x23ff95){logger[_0x87df('0x14')](_0x87df('0x10'),_0x11354a,_0x23ff95);_0x2d8ad9(_0x23ff95);});});}exports['UpdateChatInteraction']=function(_0x2c83a0){var _0x25edb5=this;return new Promise(function(_0x390553,_0x35061c){return db[_0x87df('0x17')]['update'](_0x2c83a0[_0x87df('0x18')],{'raw':_0x2c83a0[_0x87df('0x19')]?_0x2c83a0[_0x87df('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2c83a0[_0x87df('0x19')]?_0x2c83a0[_0x87df('0x19')][_0x87df('0x1a')]||null:null,'attributes':_0x2c83a0['options']?_0x2c83a0[_0x87df('0x19')]['attributes']||null:null,'limit':_0x2c83a0['options']?_0x2c83a0['options'][_0x87df('0x1b')]||null:null})[_0x87df('0x1c')](function(_0x388097){logger['info']('UpdateChatInteraction',_0x2c83a0);logger[_0x87df('0x1d')](_0x87df('0x1e'),_0x2c83a0,JSON[_0x87df('0x13')](_0x388097));_0x390553(_0x388097);})[_0x87df('0x16')](function(_0x3a91c3){logger['error'](_0x87df('0x1e'),_0x3a91c3[_0x87df('0x15')],_0x2c83a0);_0x35061c(_0x25edb5['error'](0x1f4,_0x3a91c3[_0x87df('0x15')]));});});};exports['AddTagsToChatInteraction']=function(_0x2a5cd7){return new Promise(function(_0x598291,_0x479659){return db[_0x87df('0x17')][_0x87df('0x1f')]({'where':_0x2a5cd7[_0x87df('0x19')]?_0x2a5cd7[_0x87df('0x19')][_0x87df('0x1a')]||null:null})[_0x87df('0x1c')](function(_0x2094d9){if(_0x2094d9){return _0x2094d9['addTags'](_0x2a5cd7[_0x87df('0x18')][_0x87df('0x20')],_[_0x87df('0x21')](_0x2a5cd7[_0x87df('0x18')],['ids','id'])||{});}})['spread'](function(_0x20183d){logger[_0x87df('0xf')]('AddTags',_0x2a5cd7);logger['debug'](_0x87df('0x22'),_0x2a5cd7,JSON[_0x87df('0x13')](_0x20183d));_0x598291(_0x20183d);})[_0x87df('0x16')](function(_0x49b330){logger[_0x87df('0x14')](_0x87df('0x22'),_0x49b330['message'],_0x2a5cd7);_0x479659(_this['error'](0x1f4,_0x49b330[_0x87df('0x15')]));});});};
\ No newline at end of file
index f8d3a64..a573f48 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xac22=['chatInteraction:','./chatInteraction.events','save','remove','update','emit','removeListener','register','length'];(function(_0x424800,_0x173bce){var _0x13e2f4=function(_0x550915){while(--_0x550915){_0x424800['push'](_0x424800['shift']());}};_0x13e2f4(++_0x173bce);}(_0xac22,0x172));var _0x2ac2=function(_0x37043b,_0x3131df){_0x37043b=_0x37043b-0x0;var _0x50b0c0=_0xac22[_0x37043b];return _0x50b0c0;};'use strict';var ChatInteractionEvents=require(_0x2ac2('0x0'));var events=[_0x2ac2('0x1'),_0x2ac2('0x2'),_0x2ac2('0x3')];function createListener(_0x5afe32,_0x373b25){return function(_0x2a13c6){_0x373b25[_0x2ac2('0x4')](_0x5afe32,_0x2a13c6);};}function removeListener(_0x3a109d,_0x13902c){return function(){ChatInteractionEvents[_0x2ac2('0x5')](_0x3a109d,_0x13902c);};}exports[_0x2ac2('0x6')]=function(_0x57c3c3){for(var _0x385015=0x0,_0xb9cc0b=events[_0x2ac2('0x7')];_0x385015<_0xb9cc0b;_0x385015++){var _0x44b2eb=events[_0x385015];var _0x1439de=createListener(_0x2ac2('0x8')+_0x44b2eb,_0x57c3c3);ChatInteractionEvents['on'](_0x44b2eb,_0x1439de);}};
\ No newline at end of file
+var _0x1b15=['register','length','chatInteraction:','./chatInteraction.events','save','remove','emit'];(function(_0x58db4e,_0x439d8d){var _0x40139a=function(_0x34cae4){while(--_0x34cae4){_0x58db4e['push'](_0x58db4e['shift']());}};_0x40139a(++_0x439d8d);}(_0x1b15,0x81));var _0x51b1=function(_0x5a4040,_0x10f3b0){_0x5a4040=_0x5a4040-0x0;var _0x122652=_0x1b15[_0x5a4040];return _0x122652;};'use strict';var ChatInteractionEvents=require(_0x51b1('0x0'));var events=[_0x51b1('0x1'),_0x51b1('0x2'),'update'];function createListener(_0x285f42,_0x77f306){return function(_0x638cc1){_0x77f306[_0x51b1('0x3')](_0x285f42,_0x638cc1);};}function removeListener(_0x30f3f9,_0x3c7805){return function(){ChatInteractionEvents['removeListener'](_0x30f3f9,_0x3c7805);};}exports[_0x51b1('0x4')]=function(_0x52f185){for(var _0x16d0a4=0x0,_0x46b3ea=events[_0x51b1('0x5')];_0x16d0a4<_0x46b3ea;_0x16d0a4++){var _0xe69605=events[_0x16d0a4];var _0x37d594=createListener(_0x51b1('0x6')+_0xe69605,_0x52f185);ChatInteractionEvents['on'](_0xe69605,_0x37d594);}};
\ No newline at end of file
index 3b3b56a..a8d0e4a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe606=['index','/describe','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','/:id/download','download','post','create','/:id/vidaoo','createVidaooSession','diskStorage','join','format','%s-%s','now','replace','single','file','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','chatinteraction:update','update','put','customUpdate','/:id/abandon','abandon','delete','chatinteraction:destroy','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated'];(function(_0x2fb7ce,_0x4be2fa){var _0x9ccd5a=function(_0x3d2d2f){while(--_0x3d2d2f){_0x2fb7ce['push'](_0x2fb7ce['shift']());}};_0x9ccd5a(++_0x4be2fa);}(_0xe606,0x93));var _0x6e60=function(_0x193868,_0xa30942){_0x193868=_0x193868-0x0;var _0x419415=_0xe606[_0x193868];return _0x419415;};'use strict';var multer=require(_0x6e60('0x0'));var util=require('util');var path=require(_0x6e60('0x1'));var timeout=require(_0x6e60('0x2'));var express=require(_0x6e60('0x3'));var router=express[_0x6e60('0x4')]();var fs_extra=require(_0x6e60('0x5'));var auth=require(_0x6e60('0x6'));var interaction=require(_0x6e60('0x7'));var config=require(_0x6e60('0x8'));var controller=require(_0x6e60('0x9'));router[_0x6e60('0xa')]('/',auth[_0x6e60('0xb')](),controller[_0x6e60('0xc')]);router[_0x6e60('0xa')](_0x6e60('0xd'),auth[_0x6e60('0xb')](),controller[_0x6e60('0xe')]);router[_0x6e60('0xa')](_0x6e60('0xf'),auth[_0x6e60('0x10')](),controller[_0x6e60('0x11')]);router['get'](_0x6e60('0x12'),auth[_0x6e60('0x10')](),controller[_0x6e60('0x13')]);router[_0x6e60('0xa')](_0x6e60('0x14'),auth[_0x6e60('0xb')](),controller[_0x6e60('0x15')]);router[_0x6e60('0xa')](_0x6e60('0x16'),auth[_0x6e60('0x10')](),controller['getMyMessages']);router[_0x6e60('0xa')](_0x6e60('0x17'),auth[_0x6e60('0xb')](),controller[_0x6e60('0x18')]);router[_0x6e60('0x19')]('/',auth[_0x6e60('0xb')](),controller[_0x6e60('0x1a')]);router[_0x6e60('0x19')](_0x6e60('0x1b'),auth[_0x6e60('0xb')](),controller[_0x6e60('0x1c')]);var upload=multer({'storage':multer[_0x6e60('0x1d')]({'destination':function(_0x3e7a7f,_0x3a2208,_0x287308){_0x287308(null,path[_0x6e60('0x1e')](config['root'],'server/files/attachments/'));},'filename':function(_0x2d510c,_0x384132,_0x49b1c8){_0x49b1c8(null,util[_0x6e60('0x1f')](_0x6e60('0x20'),Date[_0x6e60('0x21')](),_0x384132['originalname'][_0x6e60('0x22')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x6e60('0x19')]('/:id/attachment_upload',upload[_0x6e60('0x23')](_0x6e60('0x24')),controller['attachmentUpload']);router[_0x6e60('0x19')]('/:id/messages',auth[_0x6e60('0x10')](),controller[_0x6e60('0x25')]);router['post'](_0x6e60('0x26'),auth['isAuthenticated'](),interaction[_0x6e60('0x27')](_0x6e60('0x28'),_0x6e60('0x29')),controller[_0x6e60('0x2a')]);router['put'](_0x6e60('0xf'),auth[_0x6e60('0xb')](),interaction['tracked']('chat',_0x6e60('0x2b')),controller[_0x6e60('0x2c')]);router[_0x6e60('0x2d')]('/:id/custom_update',controller[_0x6e60('0x2e')]);router[_0x6e60('0x2d')](_0x6e60('0x2f'),auth[_0x6e60('0x10')](),controller[_0x6e60('0x30')]);router[_0x6e60('0x2d')]('/:id/close',controller['close']);router[_0x6e60('0x31')](_0x6e60('0xf'),auth[_0x6e60('0xb')](),interaction[_0x6e60('0x27')](_0x6e60('0x28'),_0x6e60('0x32')),controller[_0x6e60('0x33')]);router['delete']('/:id/tags',auth[_0x6e60('0xb')](),controller['removeTags']);module[_0x6e60('0x34')]=router;
\ No newline at end of file
+var _0x55fd=['describe','/:id','isChatInteractionAuthorized','show','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','/:id/download','download','create','post','/:id/vidaoo','createVidaooSession','diskStorage','join','root','server/files/attachments/','format','%s-%s','now','replace','/:id/attachment_upload','single','file','attachmentUpload','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags','put','chatinteraction:update','update','/:id/custom_update','customUpdate','abandon','/:id/close','close','delete','chatinteraction:destroy','removeTags','multer','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','index','get','isAuthenticated'];(function(_0xc93fcf,_0x2db4fe){var _0x182f27=function(_0x26fd4b){while(--_0x26fd4b){_0xc93fcf['push'](_0xc93fcf['shift']());}};_0x182f27(++_0x2db4fe);}(_0x55fd,0x1ca));var _0xd55f=function(_0xdc37a1,_0x53ebb9){_0xdc37a1=_0xdc37a1-0x0;var _0x99b4fe=_0x55fd[_0xdc37a1];return _0x99b4fe;};'use strict';var multer=require(_0xd55f('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xd55f('0x1'));var router=express['Router']();var fs_extra=require(_0xd55f('0x2'));var auth=require(_0xd55f('0x3'));var interaction=require(_0xd55f('0x4'));var config=require(_0xd55f('0x5'));var controller=require(_0xd55f('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0xd55f('0x7')]);router[_0xd55f('0x8')]('/describe',auth[_0xd55f('0x9')](),controller[_0xd55f('0xa')]);router[_0xd55f('0x8')](_0xd55f('0xb'),auth[_0xd55f('0xc')](),controller[_0xd55f('0xd')]);router[_0xd55f('0x8')]('/:id/attachment_download',auth[_0xd55f('0xc')](),controller[_0xd55f('0xe')]);router[_0xd55f('0x8')](_0xd55f('0xf'),auth[_0xd55f('0x9')](),controller[_0xd55f('0x10')]);router['get'](_0xd55f('0x11'),auth[_0xd55f('0xc')](),controller['getMyMessages']);router[_0xd55f('0x8')](_0xd55f('0x12'),auth[_0xd55f('0x9')](),controller[_0xd55f('0x13')]);router['post']('/',auth[_0xd55f('0x9')](),controller[_0xd55f('0x14')]);router[_0xd55f('0x15')](_0xd55f('0x16'),auth[_0xd55f('0x9')](),controller[_0xd55f('0x17')]);var upload=multer({'storage':multer[_0xd55f('0x18')]({'destination':function(_0x24c030,_0x17d205,_0x1fb575){_0x1fb575(null,path[_0xd55f('0x19')](config[_0xd55f('0x1a')],_0xd55f('0x1b')));},'filename':function(_0x214eeb,_0x54c040,_0x22ba8e){_0x22ba8e(null,util[_0xd55f('0x1c')](_0xd55f('0x1d'),Date[_0xd55f('0x1e')](),_0x54c040['originalname'][_0xd55f('0x1f')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0xd55f('0x20'),upload[_0xd55f('0x21')](_0xd55f('0x22')),controller[_0xd55f('0x23')]);router[_0xd55f('0x15')](_0xd55f('0xf'),auth['isChatInteractionAuthorized'](),controller[_0xd55f('0x24')]);router[_0xd55f('0x15')](_0xd55f('0x25'),auth[_0xd55f('0x9')](),interaction[_0xd55f('0x26')](_0xd55f('0x27'),_0xd55f('0x28')),controller['addTags']);router[_0xd55f('0x29')]('/:id',auth['isAuthenticated'](),interaction['tracked'](_0xd55f('0x27'),_0xd55f('0x2a')),controller[_0xd55f('0x2b')]);router[_0xd55f('0x29')](_0xd55f('0x2c'),controller[_0xd55f('0x2d')]);router[_0xd55f('0x29')]('/:id/abandon',auth[_0xd55f('0xc')](),controller[_0xd55f('0x2e')]);router[_0xd55f('0x29')](_0xd55f('0x2f'),controller[_0xd55f('0x30')]);router[_0xd55f('0x31')](_0xd55f('0xb'),auth[_0xd55f('0x9')](),interaction[_0xd55f('0x26')]('chat',_0xd55f('0x32')),controller['destroy']);router[_0xd55f('0x31')]('/:id/tags',auth['isAuthenticated'](),controller[_0xd55f('0x33')]);module['exports']=router;
\ No newline at end of file
index 137f2e3..ae9973f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7e1b=['medium','INTEGER','sequelize','exports','TEXT'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x7e1b,0x124));var _0xb7e1=function(_0x2f45ea,_0x15c656){_0x2f45ea=_0x2f45ea-0x0;var _0x485a84=_0x7e1b[_0x2f45ea];return _0x485a84;};'use strict';var Sequelize=require(_0xb7e1('0x0'));module[_0xb7e1('0x1')]={'body':{'type':Sequelize[_0xb7e1('0x2')](_0xb7e1('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xb7e1('0x4')]}};
\ No newline at end of file
+var _0x4c84=['sequelize','TEXT','medium'];(function(_0x29be19,_0x1f63c5){var _0x212385=function(_0x389450){while(--_0x389450){_0x29be19['push'](_0x29be19['shift']());}};_0x212385(++_0x1f63c5);}(_0x4c84,0xe4));var _0x44c8=function(_0x3fab48,_0x1d55ea){_0x3fab48=_0x3fab48-0x0;var _0x11dd8d=_0x4c84[_0x3fab48];return _0x11dd8d;};'use strict';var Sequelize=require(_0x44c8('0x0'));module['exports']={'body':{'type':Sequelize[_0x44c8('0x1')](_0x44c8('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
index d074e59..f4d26ff 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xee9d=['sendStatus','end','status','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','destroy','then','error','stack','send','index','ChatInternalMessage','rawAttributes','fieldName','type','key','model','map','name','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','rows','catch','show','params','find','create','body','update','describe','messages','createdAt','lastMessage','lastMessageAt','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','findAll','agent','admin','user','role','userpic','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','push','ToId','read','all','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register'];(function(_0x82b791,_0x31f657){var _0x27c356=function(_0x1e3ba4){while(--_0x1e3ba4){_0x82b791['push'](_0x82b791['shift']());}};_0x27c356(++_0x31f657);}(_0xee9d,0xce));var _0xdee9=function(_0xcc86cb,_0x117504){_0xcc86cb=_0xcc86cb-0x0;var _0xabf3ae=_0xee9d[_0xcc86cb];return _0xabf3ae;};'use strict';var emlformat=require(_0xdee9('0x0'));var rimraf=require(_0xdee9('0x1'));var zipdir=require(_0xdee9('0x2'));var jsonpatch=require(_0xdee9('0x3'));var rp=require('request-promise');var moment=require(_0xdee9('0x4'));var BPromise=require(_0xdee9('0x5'));var Mustache=require(_0xdee9('0x6'));var util=require(_0xdee9('0x7'));var path=require(_0xdee9('0x8'));var sox=require(_0xdee9('0x9'));var csv=require(_0xdee9('0xa'));var ejs=require(_0xdee9('0xb'));var fs=require('fs');var fs_extra=require(_0xdee9('0xc'));var _=require(_0xdee9('0xd'));var squel=require(_0xdee9('0xe'));var crypto=require(_0xdee9('0xf'));var jsforce=require(_0xdee9('0x10'));var deskjs=require(_0xdee9('0x11'));var toCsv=require(_0xdee9('0xa'));var querystring=require(_0xdee9('0x12'));var Papa=require(_0xdee9('0x13'));var Redis=require(_0xdee9('0x14'));var authService=require('../../components/auth/service');var qs=require(_0xdee9('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xdee9('0x16'));var utils=require(_0xdee9('0x17'));var config=require(_0xdee9('0x18'));var licenseUtil=require(_0xdee9('0x19'));var db=require('../../mysqldb')['db'];config[_0xdee9('0x1a')]=_[_0xdee9('0x1b')](config[_0xdee9('0x1a')],{'host':_0xdee9('0x1c'),'port':0x18eb});var socket=require(_0xdee9('0x1d'))(new Redis(config[_0xdee9('0x1a')]));require(_0xdee9('0x1e'))[_0xdee9('0x1f')](socket);function respondWithStatusCode(_0x50ecbd,_0x5c9b74){_0x5c9b74=_0x5c9b74||0xcc;return function(_0x5b5d94){if(_0x5b5d94){return _0x50ecbd[_0xdee9('0x20')](_0x5c9b74);}return _0x50ecbd['status'](_0x5c9b74)[_0xdee9('0x21')]();};}function respondWithResult(_0x5561e0,_0x2691f9){_0x2691f9=_0x2691f9||0xc8;return function(_0x5820f8){if(_0x5820f8){return _0x5561e0[_0xdee9('0x22')](_0x2691f9)['json'](_0x5820f8);}};}function respondWithFilteredResult(_0x50373b,_0x4a2733){return function(_0x4fa948){if(_0x4fa948){var _0x1f6499=typeof _0x4a2733[_0xdee9('0x23')]===_0xdee9('0x24')&&typeof _0x4a2733['limit']===_0xdee9('0x24');var _0x84fe7a=_0x4fa948[_0xdee9('0x25')];var _0x44f45d=_0x1f6499?0x0:_0x4a2733[_0xdee9('0x23')];var _0x1ffa39=_0x1f6499?_0x4fa948[_0xdee9('0x25')]:_0x4a2733[_0xdee9('0x23')]+_0x4a2733[_0xdee9('0x26')];var _0x5635f2;if(_0x1ffa39>=_0x84fe7a){_0x1ffa39=_0x84fe7a;_0x5635f2=0xc8;}else{_0x5635f2=0xce;}_0x50373b[_0xdee9('0x22')](_0x5635f2);return _0x50373b[_0xdee9('0x27')](_0xdee9('0x28'),_0x44f45d+'-'+_0x1ffa39+'/'+_0x84fe7a)[_0xdee9('0x29')](_0x4fa948);}return null;};}function patchUpdates(_0x59395c){return function(_0x51c0ae){try{jsonpatch[_0xdee9('0x2a')](_0x51c0ae,_0x59395c,!![]);}catch(_0x501775){return BPromise[_0xdee9('0x2b')](_0x501775);}return _0x51c0ae[_0xdee9('0x2c')]();};}function saveUpdates(_0x33e844,_0x3eeb36){return function(_0x485f50){if(_0x485f50){return _0x485f50['update'](_0x33e844)['then'](function(_0x44822b){return _0x44822b;});}return null;};}function removeEntity(_0xe45236,_0x34bd17){return function(_0x2b1688){if(_0x2b1688){return _0x2b1688[_0xdee9('0x2d')]()[_0xdee9('0x2e')](function(){_0xe45236[_0xdee9('0x22')](0xcc)[_0xdee9('0x21')]();});}};}function handleEntityNotFound(_0x27e00b,_0x3e15d5){return function(_0x2e246){if(!_0x2e246){_0x27e00b[_0xdee9('0x20')](0x194);}return _0x2e246;};}function handleError(_0x3e3d5a,_0x5e774e){_0x5e774e=_0x5e774e||0x1f4;return function(_0xe1c244){logger[_0xdee9('0x2f')](_0xe1c244[_0xdee9('0x30')]);if(_0xe1c244['name']){delete _0xe1c244['name'];}_0x3e3d5a[_0xdee9('0x22')](_0x5e774e)[_0xdee9('0x31')](_0xe1c244);};}exports[_0xdee9('0x32')]=function(_0x18398a,_0x4e2950){var _0x486a2b={},_0x5dc61b={},_0x1187b8={'count':0x0,'rows':[]};var _0x1de5b1=_['map'](db[_0xdee9('0x33')][_0xdee9('0x34')],function(_0x2ebe93){return{'name':_0x2ebe93[_0xdee9('0x35')],'type':_0x2ebe93[_0xdee9('0x36')][_0xdee9('0x37')]};});_0x5dc61b[_0xdee9('0x38')]=_[_0xdee9('0x39')](_0x1de5b1,_0xdee9('0x3a'));_0x5dc61b['query']=_[_0xdee9('0x3b')](_0x18398a[_0xdee9('0x3c')]);_0x5dc61b[_0xdee9('0x3d')]=_[_0xdee9('0x3e')](_0x5dc61b['model'],_0x5dc61b[_0xdee9('0x3c')]);_0x486a2b[_0xdee9('0x3f')]=_[_0xdee9('0x3e')](_0x5dc61b[_0xdee9('0x38')],qs['fields'](_0x18398a[_0xdee9('0x3c')][_0xdee9('0x40')]));_0x486a2b[_0xdee9('0x3f')]=_0x486a2b[_0xdee9('0x3f')][_0xdee9('0x41')]?_0x486a2b[_0xdee9('0x3f')]:_0x5dc61b['model'];if(!_0x18398a['query'][_0xdee9('0x42')](_0xdee9('0x43'))){_0x486a2b[_0xdee9('0x26')]=qs[_0xdee9('0x26')](_0x18398a['query'][_0xdee9('0x26')]);_0x486a2b[_0xdee9('0x23')]=qs[_0xdee9('0x23')](_0x18398a['query'][_0xdee9('0x23')]);}_0x486a2b[_0xdee9('0x44')]=qs[_0xdee9('0x45')](_0x18398a[_0xdee9('0x3c')]['sort']);_0x486a2b[_0xdee9('0x46')]=qs[_0xdee9('0x3d')](_[_0xdee9('0x47')](_0x18398a[_0xdee9('0x3c')],_0x5dc61b[_0xdee9('0x3d')]),_0x1de5b1);if(_0x18398a[_0xdee9('0x3c')]['filter']){_0x486a2b[_0xdee9('0x46')]=_[_0xdee9('0x48')](_0x486a2b[_0xdee9('0x46')],{'$or':_['map'](_0x1de5b1,function(_0x3fafa4){if(_0x3fafa4[_0xdee9('0x36')]!==_0xdee9('0x49')){var _0x536031={};_0x536031[_0x3fafa4[_0xdee9('0x3a')]]={'$like':'%'+_0x18398a['query'][_0xdee9('0x4a')]+'%'};return _0x536031;}})});}_0x486a2b=_[_0xdee9('0x48')]({},_0x486a2b,_0x18398a[_0xdee9('0x4b')]);var _0x5dbb90={'where':_0x486a2b['where']};return db[_0xdee9('0x33')][_0xdee9('0x25')](_0x5dbb90)[_0xdee9('0x2e')](function(_0x3f66ae){_0x1187b8[_0xdee9('0x25')]=_0x3f66ae;if(_0x18398a[_0xdee9('0x3c')][_0xdee9('0x4c')]){_0x486a2b['include']=[{'all':!![]}];}return db[_0xdee9('0x33')]['findAll'](_0x486a2b);})[_0xdee9('0x2e')](function(_0x30778c){_0x1187b8[_0xdee9('0x4d')]=_0x30778c;return _0x1187b8;})[_0xdee9('0x2e')](respondWithFilteredResult(_0x4e2950,_0x486a2b))[_0xdee9('0x4e')](handleError(_0x4e2950,null));};exports[_0xdee9('0x4f')]=function(_0x593a08,_0x4352c8){var _0x112ffd={'raw':!![],'where':{'id':_0x593a08[_0xdee9('0x50')]['id']}},_0x4fdb88={};_0x4fdb88[_0xdee9('0x38')]=_[_0xdee9('0x3b')](db[_0xdee9('0x33')][_0xdee9('0x34')]);_0x4fdb88['query']=_[_0xdee9('0x3b')](_0x593a08[_0xdee9('0x3c')]);_0x4fdb88[_0xdee9('0x3d')]=_[_0xdee9('0x3e')](_0x4fdb88['model'],_0x4fdb88[_0xdee9('0x3c')]);_0x112ffd[_0xdee9('0x3f')]=_[_0xdee9('0x3e')](_0x4fdb88['model'],qs['fields'](_0x593a08[_0xdee9('0x3c')][_0xdee9('0x40')]));_0x112ffd['attributes']=_0x112ffd['attributes'][_0xdee9('0x41')]?_0x112ffd[_0xdee9('0x3f')]:_0x4fdb88[_0xdee9('0x38')];if(_0x593a08[_0xdee9('0x3c')][_0xdee9('0x4c')]){_0x112ffd['include']=[{'all':!![]}];}_0x112ffd=_[_0xdee9('0x48')]({},_0x112ffd,_0x593a08[_0xdee9('0x4b')]);return db[_0xdee9('0x33')][_0xdee9('0x51')](_0x112ffd)[_0xdee9('0x2e')](handleEntityNotFound(_0x4352c8,null))[_0xdee9('0x2e')](respondWithResult(_0x4352c8,null))[_0xdee9('0x4e')](handleError(_0x4352c8,null));};exports[_0xdee9('0x52')]=function(_0x40d4f8,_0x5581ac){return db[_0xdee9('0x33')]['create'](_0x40d4f8[_0xdee9('0x53')],{})[_0xdee9('0x2e')](respondWithResult(_0x5581ac,0xc9))[_0xdee9('0x4e')](handleError(_0x5581ac,null));};exports[_0xdee9('0x54')]=function(_0xe0e48c,_0x30e0ca){if(_0xe0e48c['body']['id']){delete _0xe0e48c[_0xdee9('0x53')]['id'];}return db[_0xdee9('0x33')][_0xdee9('0x51')]({'where':{'id':_0xe0e48c[_0xdee9('0x50')]['id']}})['then'](handleEntityNotFound(_0x30e0ca,null))[_0xdee9('0x2e')](saveUpdates(_0xe0e48c[_0xdee9('0x53')],null))[_0xdee9('0x2e')](respondWithResult(_0x30e0ca,null))['catch'](handleError(_0x30e0ca,null));};exports[_0xdee9('0x2d')]=function(_0xd6856c,_0x5e2749){return db['ChatInternalMessage'][_0xdee9('0x51')]({'where':{'id':_0xd6856c[_0xdee9('0x50')]['id']}})[_0xdee9('0x2e')](handleEntityNotFound(_0x5e2749,null))[_0xdee9('0x2e')](removeEntity(_0x5e2749,null))[_0xdee9('0x4e')](handleError(_0x5e2749,null));};exports[_0xdee9('0x55')]=function(_0x728393,_0x64eb8c){return db['ChatInternalMessage'][_0xdee9('0x55')]()[_0xdee9('0x2e')](respondWithResult(_0x64eb8c,null))[_0xdee9('0x4e')](handleError(_0x64eb8c,null));};function wrapUser(_0x27cde3){return function(_0x1142aa){var _0x4b6495=_0x27cde3['get']({'plain':!![]});_0x4b6495[_0xdee9('0x56')]=[];if(_0x1142aa){_0x4b6495['lastMessageAt']=_0x1142aa[_0xdee9('0x57')];_0x4b6495[_0xdee9('0x58')]=_0x1142aa;}else{_0x4b6495[_0xdee9('0x59')]=moment(0x0)[_0xdee9('0x5a')](_0xdee9('0x5b'));_0x4b6495['lastMessage']={};}return _0x4b6495;};}exports[_0xdee9('0x5c')]=function(_0x5116fe,_0x564839,_0x48b3b1){var _0x28f6d5=[];return db[_0xdee9('0x5d')][_0xdee9('0x5e')]({'where':{'role':[_0xdee9('0x5f'),_0xdee9('0x60'),_0xdee9('0x61')]},'attributes':['id','fullname',_0xdee9('0x3a'),_0xdee9('0x62'),_0xdee9('0x63'),'internal',_0xdee9('0x64'),_0xdee9('0x65'),_0xdee9('0x66'),_0xdee9('0x67')],'order':qs[_0xdee9('0x45')](_0xdee9('0x68')),'include':[{'model':db[_0xdee9('0x69')],'as':_0xdee9('0x6a'),'attributes':['id',_0xdee9('0x3a'),'type'],'through':{'attributes':[]}}]})[_0xdee9('0x2e')](function(_0x5812c0){if(_0x5812c0){var _0x59eae1=_0x5116fe[_0xdee9('0x61')][_0xdee9('0x6b')]({'plain':!![]});if(!_0x59eae1)throw new Error(_0xdee9('0x6c'));if(_0x59eae1[_0xdee9('0x62')]===_0xdee9('0x61')){return db[_0xdee9('0x6d')]['find']({'where':{'name':_0xdee9('0x6e'),'userProfileId':_0x59eae1[_0xdee9('0x6f')]},'raw':!![]})['then'](function(_0x56be79){if(_0x56be79){if(_0x56be79[_0xdee9('0x70')]===0x0){return db[_0xdee9('0x71')][_0xdee9('0x5e')]({'where':{'sectionId':_0x56be79['id']},'raw':!![]})['then'](function(_0xede05f){var _0x344fa2=[];if(_[_0xdee9('0x72')](_0xede05f)){_0x344fa2=_[_0xdee9('0x4a')](_0x5812c0,function(_0x18f3d2){if(_0x18f3d2[_0xdee9('0x62')]!==_0xdee9('0x5f')){return _0x18f3d2;}});return _0x344fa2;}else{for(var _0xdf08da=0x0;_0xdf08da<_0x5812c0['length'];_0xdf08da++){var _0x737cc7=_0x5812c0[_0xdf08da];if(_0x737cc7[_0xdee9('0x62')]==='agent'){var _0x44409f=_['find'](_0xede05f,function(_0x58fa69){return _0x58fa69['resourceId']===_0x737cc7['id'];});if(_0x44409f)_0x344fa2[_0xdee9('0x73')](_0x737cc7);}else{_0x344fa2[_0xdee9('0x73')](_0x737cc7);}}return _0x344fa2;}});}else{return _0x5812c0;}}else{var _0x557977=_['filter'](_0x5812c0,function(_0x43559e){if(_0x43559e['role']!==_0xdee9('0x5f')){return _0x43559e;}});return _0x557977;}});}else{return _0x5812c0;}}})[_0xdee9('0x2e')](function(_0x47dcc6){var _0x4d5338=[];if(_0x47dcc6){_0x28f6d5=_0x47dcc6;for(var _0x3b4d72=0x0;_0x3b4d72<_0x47dcc6[_0xdee9('0x41')];_0x3b4d72+=0x1){_0x28f6d5[_0x3b4d72]['messages']=[];_0x4d5338['push'](db[_0xdee9('0x33')][_0xdee9('0x51')]({'where':{'FromId':[_0x5116fe['user']['id'],_0x47dcc6[_0x3b4d72]['id']],'ToId':[_0x5116fe[_0xdee9('0x61')]['id'],_0x47dcc6[_0x3b4d72]['id']],'ChatGroupId':null},'attributes':['id',_0xdee9('0x57'),'FromId',_0xdee9('0x74'),_0xdee9('0x75'),_0xdee9('0x53')],'order':qs[_0xdee9('0x45')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0xdee9('0x2e')](wrapUser(_0x47dcc6[_0x3b4d72])));}return BPromise[_0xdee9('0x76')](_0x4d5338);}return[];})['then'](function(_0x25d13a){return{'rows':_0x25d13a,'count':_0x25d13a['length']};})['then'](respondWithResult(_0x564839,null))[_0xdee9('0x4e')](handleError(_0x564839,null));};
\ No newline at end of file
+var _0xe83e=['attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','filter','options','includeAll','include','findAll','rows','catch','params','find','create','body','destroy','describe','get','messages','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','admin','user','fullname','userpic','internal','online','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','role','Agents','userProfileId','UserProfileResource','isEmpty','resourceId','push','FromId','ToId','read','all','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','redis','register','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','update','then','error','stack','name','send','index','map','ChatInternalMessage','rawAttributes','type','key','query','keys','filters','intersection','model'];(function(_0x4bacd2,_0x465d39){var _0x312fe7=function(_0x5916c7){while(--_0x5916c7){_0x4bacd2['push'](_0x4bacd2['shift']());}};_0x312fe7(++_0x465d39);}(_0xe83e,0x180));var _0xee83=function(_0x245500,_0x3ece34){_0x245500=_0x245500-0x0;var _0x3d934c=_0xe83e[_0x245500];return _0x3d934c;};'use strict';var emlformat=require(_0xee83('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xee83('0x1'));var jsonpatch=require(_0xee83('0x2'));var rp=require(_0xee83('0x3'));var moment=require('moment');var BPromise=require(_0xee83('0x4'));var Mustache=require(_0xee83('0x5'));var util=require('util');var path=require(_0xee83('0x6'));var sox=require('sox');var csv=require(_0xee83('0x7'));var ejs=require(_0xee83('0x8'));var fs=require('fs');var fs_extra=require(_0xee83('0x9'));var _=require('lodash');var squel=require(_0xee83('0xa'));var crypto=require(_0xee83('0xb'));var jsforce=require(_0xee83('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xee83('0xd'));var Papa=require(_0xee83('0xe'));var Redis=require(_0xee83('0xf'));var authService=require(_0xee83('0x10'));var qs=require(_0xee83('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xee83('0x12'))(_0xee83('0x13'));var utils=require(_0xee83('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xee83('0x15'));var db=require(_0xee83('0x16'))['db'];config['redis']=_[_0xee83('0x17')](config['redis'],{'host':_0xee83('0x18'),'port':0x18eb});var socket=require(_0xee83('0x19'))(new Redis(config[_0xee83('0x1a')]));require('./chatInternalMessage.socket')[_0xee83('0x1b')](socket);function respondWithStatusCode(_0x454712,_0x1c3f45){_0x1c3f45=_0x1c3f45||0xcc;return function(_0x405c58){if(_0x405c58){return _0x454712[_0xee83('0x1c')](_0x1c3f45);}return _0x454712[_0xee83('0x1d')](_0x1c3f45)[_0xee83('0x1e')]();};}function respondWithResult(_0x474b25,_0x4ab994){_0x4ab994=_0x4ab994||0xc8;return function(_0x4c04ad){if(_0x4c04ad){return _0x474b25[_0xee83('0x1d')](_0x4ab994)[_0xee83('0x1f')](_0x4c04ad);}};}function respondWithFilteredResult(_0x1a647f,_0x19e9d4){return function(_0x7f12c0){if(_0x7f12c0){var _0x54ac2e=typeof _0x19e9d4['offset']===_0xee83('0x20')&&typeof _0x19e9d4[_0xee83('0x21')]===_0xee83('0x20');var _0xded38f=_0x7f12c0[_0xee83('0x22')];var _0x2538d3=_0x54ac2e?0x0:_0x19e9d4['offset'];var _0x10ccbc=_0x54ac2e?_0x7f12c0[_0xee83('0x22')]:_0x19e9d4[_0xee83('0x23')]+_0x19e9d4[_0xee83('0x21')];var _0x21a834;if(_0x10ccbc>=_0xded38f){_0x10ccbc=_0xded38f;_0x21a834=0xc8;}else{_0x21a834=0xce;}_0x1a647f['status'](_0x21a834);return _0x1a647f[_0xee83('0x24')](_0xee83('0x25'),_0x2538d3+'-'+_0x10ccbc+'/'+_0xded38f)[_0xee83('0x1f')](_0x7f12c0);}return null;};}function patchUpdates(_0x37a710){return function(_0x569e84){try{jsonpatch[_0xee83('0x26')](_0x569e84,_0x37a710,!![]);}catch(_0x1cd001){return BPromise['reject'](_0x1cd001);}return _0x569e84['save']();};}function saveUpdates(_0x2d2c12,_0xffce18){return function(_0x3f9406){if(_0x3f9406){return _0x3f9406[_0xee83('0x27')](_0x2d2c12)[_0xee83('0x28')](function(_0x53c7b2){return _0x53c7b2;});}return null;};}function removeEntity(_0x1cb295,_0x343bef){return function(_0x4fcae2){if(_0x4fcae2){return _0x4fcae2['destroy']()[_0xee83('0x28')](function(){_0x1cb295[_0xee83('0x1d')](0xcc)[_0xee83('0x1e')]();});}};}function handleEntityNotFound(_0x1c98f5,_0x220936){return function(_0x293848){if(!_0x293848){_0x1c98f5[_0xee83('0x1c')](0x194);}return _0x293848;};}function handleError(_0x14a189,_0x3a1d){_0x3a1d=_0x3a1d||0x1f4;return function(_0x58cf36){logger[_0xee83('0x29')](_0x58cf36[_0xee83('0x2a')]);if(_0x58cf36[_0xee83('0x2b')]){delete _0x58cf36[_0xee83('0x2b')];}_0x14a189[_0xee83('0x1d')](_0x3a1d)[_0xee83('0x2c')](_0x58cf36);};}exports[_0xee83('0x2d')]=function(_0x453d7a,_0x1cf2da){var _0x4c6197={},_0x24bf0b={},_0x4cc5ee={'count':0x0,'rows':[]};var _0x4f0314=_[_0xee83('0x2e')](db[_0xee83('0x2f')][_0xee83('0x30')],function(_0x26b004){return{'name':_0x26b004['fieldName'],'type':_0x26b004[_0xee83('0x31')][_0xee83('0x32')]};});_0x24bf0b['model']=_[_0xee83('0x2e')](_0x4f0314,_0xee83('0x2b'));_0x24bf0b[_0xee83('0x33')]=_[_0xee83('0x34')](_0x453d7a[_0xee83('0x33')]);_0x24bf0b[_0xee83('0x35')]=_[_0xee83('0x36')](_0x24bf0b[_0xee83('0x37')],_0x24bf0b[_0xee83('0x33')]);_0x4c6197[_0xee83('0x38')]=_[_0xee83('0x36')](_0x24bf0b[_0xee83('0x37')],qs[_0xee83('0x39')](_0x453d7a[_0xee83('0x33')][_0xee83('0x39')]));_0x4c6197[_0xee83('0x38')]=_0x4c6197['attributes'][_0xee83('0x3a')]?_0x4c6197['attributes']:_0x24bf0b['model'];if(!_0x453d7a[_0xee83('0x33')][_0xee83('0x3b')](_0xee83('0x3c'))){_0x4c6197[_0xee83('0x21')]=qs[_0xee83('0x21')](_0x453d7a['query'][_0xee83('0x21')]);_0x4c6197[_0xee83('0x23')]=qs['offset'](_0x453d7a[_0xee83('0x33')][_0xee83('0x23')]);}_0x4c6197[_0xee83('0x3d')]=qs[_0xee83('0x3e')](_0x453d7a['query'][_0xee83('0x3e')]);_0x4c6197[_0xee83('0x3f')]=qs[_0xee83('0x35')](_['pick'](_0x453d7a[_0xee83('0x33')],_0x24bf0b[_0xee83('0x35')]),_0x4f0314);if(_0x453d7a['query']['filter']){_0x4c6197[_0xee83('0x3f')]=_[_0xee83('0x40')](_0x4c6197[_0xee83('0x3f')],{'$or':_[_0xee83('0x2e')](_0x4f0314,function(_0x75d624){if(_0x75d624[_0xee83('0x31')]!=='VIRTUAL'){var _0x4567b0={};_0x4567b0[_0x75d624[_0xee83('0x2b')]]={'$like':'%'+_0x453d7a[_0xee83('0x33')][_0xee83('0x41')]+'%'};return _0x4567b0;}})});}_0x4c6197=_['merge']({},_0x4c6197,_0x453d7a[_0xee83('0x42')]);var _0x1e6808={'where':_0x4c6197['where']};return db[_0xee83('0x2f')][_0xee83('0x22')](_0x1e6808)[_0xee83('0x28')](function(_0x2eddfa){_0x4cc5ee['count']=_0x2eddfa;if(_0x453d7a[_0xee83('0x33')][_0xee83('0x43')]){_0x4c6197[_0xee83('0x44')]=[{'all':!![]}];}return db['ChatInternalMessage'][_0xee83('0x45')](_0x4c6197);})[_0xee83('0x28')](function(_0x1734f3){_0x4cc5ee[_0xee83('0x46')]=_0x1734f3;return _0x4cc5ee;})['then'](respondWithFilteredResult(_0x1cf2da,_0x4c6197))[_0xee83('0x47')](handleError(_0x1cf2da,null));};exports['show']=function(_0x486588,_0x5d13f8){var _0x230136={'raw':!![],'where':{'id':_0x486588[_0xee83('0x48')]['id']}},_0x1d0dd5={};_0x1d0dd5['model']=_['keys'](db[_0xee83('0x2f')][_0xee83('0x30')]);_0x1d0dd5[_0xee83('0x33')]=_[_0xee83('0x34')](_0x486588[_0xee83('0x33')]);_0x1d0dd5[_0xee83('0x35')]=_[_0xee83('0x36')](_0x1d0dd5[_0xee83('0x37')],_0x1d0dd5['query']);_0x230136['attributes']=_[_0xee83('0x36')](_0x1d0dd5[_0xee83('0x37')],qs['fields'](_0x486588[_0xee83('0x33')]['fields']));_0x230136[_0xee83('0x38')]=_0x230136[_0xee83('0x38')][_0xee83('0x3a')]?_0x230136[_0xee83('0x38')]:_0x1d0dd5['model'];if(_0x486588[_0xee83('0x33')][_0xee83('0x43')]){_0x230136[_0xee83('0x44')]=[{'all':!![]}];}_0x230136=_[_0xee83('0x40')]({},_0x230136,_0x486588[_0xee83('0x42')]);return db['ChatInternalMessage'][_0xee83('0x49')](_0x230136)[_0xee83('0x28')](handleEntityNotFound(_0x5d13f8,null))[_0xee83('0x28')](respondWithResult(_0x5d13f8,null))[_0xee83('0x47')](handleError(_0x5d13f8,null));};exports['create']=function(_0x5ee57c,_0x1d2efc){return db[_0xee83('0x2f')][_0xee83('0x4a')](_0x5ee57c[_0xee83('0x4b')],{})[_0xee83('0x28')](respondWithResult(_0x1d2efc,0xc9))[_0xee83('0x47')](handleError(_0x1d2efc,null));};exports[_0xee83('0x27')]=function(_0x1c490c,_0x5b1fd2){if(_0x1c490c[_0xee83('0x4b')]['id']){delete _0x1c490c[_0xee83('0x4b')]['id'];}return db[_0xee83('0x2f')][_0xee83('0x49')]({'where':{'id':_0x1c490c['params']['id']}})[_0xee83('0x28')](handleEntityNotFound(_0x5b1fd2,null))[_0xee83('0x28')](saveUpdates(_0x1c490c[_0xee83('0x4b')],null))[_0xee83('0x28')](respondWithResult(_0x5b1fd2,null))['catch'](handleError(_0x5b1fd2,null));};exports[_0xee83('0x4c')]=function(_0x4e6604,_0x5ce878){return db[_0xee83('0x2f')][_0xee83('0x49')]({'where':{'id':_0x4e6604[_0xee83('0x48')]['id']}})['then'](handleEntityNotFound(_0x5ce878,null))[_0xee83('0x28')](removeEntity(_0x5ce878,null))[_0xee83('0x47')](handleError(_0x5ce878,null));};exports[_0xee83('0x4d')]=function(_0x360c58,_0x1f0cef){return db['ChatInternalMessage']['describe']()[_0xee83('0x28')](respondWithResult(_0x1f0cef,null))['catch'](handleError(_0x1f0cef,null));};function wrapUser(_0x126448){return function(_0x5e6b38){var _0x2fbc97=_0x126448[_0xee83('0x4e')]({'plain':!![]});_0x2fbc97[_0xee83('0x4f')]=[];if(_0x5e6b38){_0x2fbc97[_0xee83('0x50')]=_0x5e6b38[_0xee83('0x51')];_0x2fbc97[_0xee83('0x52')]=_0x5e6b38;}else{_0x2fbc97[_0xee83('0x50')]=moment(0x0)[_0xee83('0x53')](_0xee83('0x54'));_0x2fbc97['lastMessage']={};}return _0x2fbc97;};}exports[_0xee83('0x55')]=function(_0x24cba2,_0x580445,_0x593cee){var _0x2c5c7d=[];return db[_0xee83('0x56')]['findAll']({'where':{'role':[_0xee83('0x57'),_0xee83('0x58'),_0xee83('0x59')]},'attributes':['id',_0xee83('0x5a'),_0xee83('0x2b'),'role',_0xee83('0x5b'),_0xee83('0x5c'),_0xee83('0x5d'),'lastLoginAt',_0xee83('0x5e'),_0xee83('0x5f')],'order':qs['sort'](_0xee83('0x60')),'include':[{'model':db[_0xee83('0x61')],'as':_0xee83('0x62'),'attributes':['id',_0xee83('0x2b'),_0xee83('0x31')],'through':{'attributes':[]}}]})['then'](function(_0x495500){if(_0x495500){var _0x52bd87=_0x24cba2[_0xee83('0x59')]['get']({'plain':!![]});if(!_0x52bd87)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x52bd87[_0xee83('0x63')]===_0xee83('0x59')){return db['UserProfileSection'][_0xee83('0x49')]({'where':{'name':_0xee83('0x64'),'userProfileId':_0x52bd87[_0xee83('0x65')]},'raw':!![]})[_0xee83('0x28')](function(_0x9812fb){if(_0x9812fb){if(_0x9812fb['autoAssociation']===0x0){return db[_0xee83('0x66')][_0xee83('0x45')]({'where':{'sectionId':_0x9812fb['id']},'raw':!![]})[_0xee83('0x28')](function(_0x47f6fe){var _0x3833b4=[];if(_[_0xee83('0x67')](_0x47f6fe)){_0x3833b4=_['filter'](_0x495500,function(_0x2a7412){if(_0x2a7412['role']!==_0xee83('0x57')){return _0x2a7412;}});return _0x3833b4;}else{for(var _0x1598be=0x0;_0x1598be<_0x495500['length'];_0x1598be++){var _0x1583cc=_0x495500[_0x1598be];if(_0x1583cc['role']===_0xee83('0x57')){var _0x4e68bc=_[_0xee83('0x49')](_0x47f6fe,function(_0x1fdc02){return _0x1fdc02[_0xee83('0x68')]===_0x1583cc['id'];});if(_0x4e68bc)_0x3833b4[_0xee83('0x69')](_0x1583cc);}else{_0x3833b4['push'](_0x1583cc);}}return _0x3833b4;}});}else{return _0x495500;}}else{var _0x852979=_[_0xee83('0x41')](_0x495500,function(_0x3c370a){if(_0x3c370a[_0xee83('0x63')]!==_0xee83('0x57')){return _0x3c370a;}});return _0x852979;}});}else{return _0x495500;}}})['then'](function(_0x20b137){var _0x37b380=[];if(_0x20b137){_0x2c5c7d=_0x20b137;for(var _0x3204d7=0x0;_0x3204d7<_0x20b137[_0xee83('0x3a')];_0x3204d7+=0x1){_0x2c5c7d[_0x3204d7]['messages']=[];_0x37b380['push'](db[_0xee83('0x2f')][_0xee83('0x49')]({'where':{'FromId':[_0x24cba2[_0xee83('0x59')]['id'],_0x20b137[_0x3204d7]['id']],'ToId':[_0x24cba2[_0xee83('0x59')]['id'],_0x20b137[_0x3204d7]['id']],'ChatGroupId':null},'attributes':['id',_0xee83('0x51'),_0xee83('0x6a'),_0xee83('0x6b'),_0xee83('0x6c'),'body'],'order':qs[_0xee83('0x3e')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0xee83('0x28')](wrapUser(_0x20b137[_0x3204d7])));}return BPromise[_0xee83('0x6d')](_0x37b380);}return[];})[_0xee83('0x28')](function(_0xcb12d9){return{'rows':_0xcb12d9,'count':_0xcb12d9[_0xee83('0x3a')]};})[_0xee83('0x28')](respondWithResult(_0x580445,null))['catch'](handleError(_0x580445,null));};
\ No newline at end of file
index 08fa5e5..17f92d2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf401=['emit','hasOwnProperty','exports','../../mysqldb','ChatInternalMessage','update','remove'];(function(_0x942090,_0x400630){var _0x2abd03=function(_0x132066){while(--_0x132066){_0x942090['push'](_0x942090['shift']());}};_0x2abd03(++_0x400630);}(_0xf401,0xe3));var _0x1f40=function(_0x51f371,_0x876a24){_0x51f371=_0x51f371-0x0;var _0x11188e=_0xf401[_0x51f371];return _0x11188e;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0x1f40('0x0'))['db'][_0x1f40('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x1f40('0x2'),'afterDestroy':_0x1f40('0x3')};function emitEvent(_0x59fbf1){return function(_0x31dde1,_0x373ecc,_0x2159bb){ChatInternalMessageEvents[_0x1f40('0x4')](_0x59fbf1+':'+_0x31dde1['id'],_0x31dde1);ChatInternalMessageEvents[_0x1f40('0x4')](_0x59fbf1,_0x31dde1);_0x2159bb(null);};}for(var e in events){if(events[_0x1f40('0x5')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0x1f40('0x6')]=ChatInternalMessageEvents;
\ No newline at end of file
+var _0x5d2e=['events','ChatInternalMessage','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports'];(function(_0x3e0bb2,_0x400cd6){var _0x476100=function(_0x315174){while(--_0x315174){_0x3e0bb2['push'](_0x3e0bb2['shift']());}};_0x476100(++_0x400cd6);}(_0x5d2e,0x120));var _0xe5d2=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0x5d2e[_0x1d1779];return _0x2377e9;};'use strict';var EventEmitter=require(_0xe5d2('0x0'));var ChatInternalMessage=require('../../mysqldb')['db'][_0xe5d2('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xe5d2('0x2')](0x0);var events={'afterCreate':_0xe5d2('0x3'),'afterUpdate':'update','afterDestroy':_0xe5d2('0x4')};function emitEvent(_0x57c20a){return function(_0x17c2d2,_0x253eff,_0x159287){ChatInternalMessageEvents[_0xe5d2('0x5')](_0x57c20a+':'+_0x17c2d2['id'],_0x17c2d2);ChatInternalMessageEvents[_0xe5d2('0x5')](_0x57c20a,_0x17c2d2);_0x159287(null);};}for(var e in events){if(events[_0xe5d2('0x6')](e)){var event=events[e];ChatInternalMessage[_0xe5d2('0x7')](e,emitEvent(event));}}module[_0xe5d2('0x8')]=ChatInternalMessageEvents;
\ No newline at end of file
index b03cf70..187f4bb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x60be=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','ChatInternalMessage','chat_internal_messages','lodash','util','../../config/logger'];(function(_0x25bca6,_0xe415ea){var _0x3f8d02=function(_0x3e581b){while(--_0x3e581b){_0x25bca6['push'](_0x25bca6['shift']());}};_0x3f8d02(++_0xe415ea);}(_0x60be,0x142));var _0xe60b=function(_0x1fd28b,_0x7f3a39){_0x1fd28b=_0x1fd28b-0x0;var _0x71d5a1=_0x60be[_0x1fd28b];return _0x71d5a1;};'use strict';var _=require(_0xe60b('0x0'));var util=require(_0xe60b('0x1'));var logger=require(_0xe60b('0x2'))(_0xe60b('0x3'));var moment=require(_0xe60b('0x4'));var BPromise=require(_0xe60b('0x5'));var rp=require(_0xe60b('0x6'));var fs=require('fs');var path=require(_0xe60b('0x7'));var rimraf=require(_0xe60b('0x8'));var config=require(_0xe60b('0x9'));var attributes=require('./chatInternalMessage.attributes');module['exports']=function(_0x2575ad,_0xb1d8be){return _0x2575ad[_0xe60b('0xa')](_0xe60b('0xb'),attributes,{'tableName':_0xe60b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x2a78=['../../config/environment','./chatInternalMessage.attributes','exports','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','util','api','moment','request-promise','path','rimraf'];(function(_0x15168f,_0xcd139b){var _0x484b3d=function(_0x156419){while(--_0x156419){_0x15168f['push'](_0x15168f['shift']());}};_0x484b3d(++_0xcd139b);}(_0x2a78,0xd7));var _0x82a7=function(_0x301979,_0x1127b6){_0x301979=_0x301979-0x0;var _0xafa18d=_0x2a78[_0x301979];return _0xafa18d;};'use strict';var _=require('lodash');var util=require(_0x82a7('0x0'));var logger=require('../../config/logger')(_0x82a7('0x1'));var moment=require(_0x82a7('0x2'));var BPromise=require('bluebird');var rp=require(_0x82a7('0x3'));var fs=require('fs');var path=require(_0x82a7('0x4'));var rimraf=require(_0x82a7('0x5'));var config=require(_0x82a7('0x6'));var attributes=require(_0x82a7('0x7'));module[_0x82a7('0x8')]=function(_0x1d04b7,_0x395832){return _0x1d04b7['define'](_0x82a7('0x9'),attributes,{'tableName':_0x82a7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x82a7('0xb'),'collate':_0x82a7('0xc')});};
\ No newline at end of file
index d9b738a..078fbb0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7d28=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','register','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','lodash','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0xbbf250,_0x4cfddb){var _0x4e3bc2=function(_0x5668a6){while(--_0x5668a6){_0xbbf250['push'](_0xbbf250['shift']());}};_0x4e3bc2(++_0x4cfddb);}(_0x7d28,0x73));var _0x87d2=function(_0x9086df,_0x3a8a7b){_0x9086df=_0x9086df-0x0;var _0x9b0bfc=_0x7d28[_0x9086df];return _0x9b0bfc;};'use strict';var _=require(_0x87d2('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x87d2('0x1'));var rs=require(_0x87d2('0x2'));var fs=require('fs');var Redis=require(_0x87d2('0x3'));var db=require(_0x87d2('0x4'))['db'];var utils=require(_0x87d2('0x5'));var logger=require(_0x87d2('0x6'))(_0x87d2('0x7'));var config=require(_0x87d2('0x8'));var jayson=require(_0x87d2('0x9'));var client=jayson[_0x87d2('0xa')][_0x87d2('0xb')]({'port':0x232a});config['redis']=_[_0x87d2('0xc')](config[_0x87d2('0xd')],{'host':_0x87d2('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x87d2('0xd')]));require('./chatInternalMessage.socket')[_0x87d2('0xf')](socket);function respondWithRpcPromise(_0x35c66d,_0x121481,_0x37ca4e){return new BPromise(function(_0x199374,_0x3032c9){return client['request'](_0x35c66d,_0x37ca4e)['then'](function(_0x56523c){logger[_0x87d2('0x10')](_0x87d2('0x11'),_0x121481,_0x87d2('0x12'));logger[_0x87d2('0x13')]('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x121481,_0x87d2('0x12'),JSON['stringify'](_0x56523c));if(_0x56523c[_0x87d2('0x14')]){if(_0x56523c[_0x87d2('0x14')][_0x87d2('0x15')]===0x1f4){logger[_0x87d2('0x14')]('ChatInternalMessage,\x20%s,\x20%s',_0x121481,_0x56523c['error'][_0x87d2('0x16')]);return _0x3032c9(_0x56523c[_0x87d2('0x14')]['message']);}logger[_0x87d2('0x14')](_0x87d2('0x11'),_0x121481,_0x56523c['error'][_0x87d2('0x16')]);return _0x199374(_0x56523c[_0x87d2('0x14')][_0x87d2('0x16')]);}else{logger[_0x87d2('0x10')](_0x87d2('0x11'),_0x121481,'request\x20sent');_0x199374(_0x56523c[_0x87d2('0x17')]['message']);}})['catch'](function(_0x46e523){logger[_0x87d2('0x14')]('ChatInternalMessage,\x20%s,\x20%s',_0x121481,_0x46e523);_0x3032c9(_0x46e523);});});}
\ No newline at end of file
+var _0xf5a7=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','register','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','bluebird','randomstring','ioredis'];(function(_0x499056,_0x29efc4){var _0x37feb6=function(_0x1edcd1){while(--_0x1edcd1){_0x499056['push'](_0x499056['shift']());}};_0x37feb6(++_0x29efc4);}(_0xf5a7,0x133));var _0x7f5a=function(_0x26fa3a,_0x530f65){_0x26fa3a=_0x26fa3a-0x0;var _0x494b57=_0xf5a7[_0x26fa3a];return _0x494b57;};'use strict';var _=require(_0x7f5a('0x0'));var util=require(_0x7f5a('0x1'));var moment=require('moment');var BPromise=require(_0x7f5a('0x2'));var rs=require(_0x7f5a('0x3'));var fs=require('fs');var Redis=require(_0x7f5a('0x4'));var db=require(_0x7f5a('0x5'))['db'];var utils=require(_0x7f5a('0x6'));var logger=require(_0x7f5a('0x7'))(_0x7f5a('0x8'));var config=require(_0x7f5a('0x9'));var jayson=require(_0x7f5a('0xa'));var client=jayson['client'][_0x7f5a('0xb')]({'port':0x232a});config[_0x7f5a('0xc')]=_['defaults'](config[_0x7f5a('0xc')],{'host':_0x7f5a('0xd'),'port':0x18eb});var socket=require(_0x7f5a('0xe'))(new Redis(config['redis']));require('./chatInternalMessage.socket')[_0x7f5a('0xf')](socket);function respondWithRpcPromise(_0x43a45c,_0x570faa,_0x47cba6){return new BPromise(function(_0x438daa,_0x3bf4bd){return client['request'](_0x43a45c,_0x47cba6)['then'](function(_0x43b061){logger[_0x7f5a('0x10')](_0x7f5a('0x11'),_0x570faa,_0x7f5a('0x12'));logger[_0x7f5a('0x13')](_0x7f5a('0x14'),_0x570faa,'request\x20sent',JSON[_0x7f5a('0x15')](_0x43b061));if(_0x43b061[_0x7f5a('0x16')]){if(_0x43b061[_0x7f5a('0x16')][_0x7f5a('0x17')]===0x1f4){logger[_0x7f5a('0x16')](_0x7f5a('0x11'),_0x570faa,_0x43b061[_0x7f5a('0x16')][_0x7f5a('0x18')]);return _0x3bf4bd(_0x43b061['error'][_0x7f5a('0x18')]);}logger[_0x7f5a('0x16')]('ChatInternalMessage,\x20%s,\x20%s',_0x570faa,_0x43b061[_0x7f5a('0x16')][_0x7f5a('0x18')]);return _0x438daa(_0x43b061[_0x7f5a('0x16')][_0x7f5a('0x18')]);}else{logger['info'](_0x7f5a('0x11'),_0x570faa,_0x7f5a('0x12'));_0x438daa(_0x43b061[_0x7f5a('0x19')][_0x7f5a('0x18')]);}})['catch'](function(_0x45d387){logger[_0x7f5a('0x16')]('ChatInternalMessage,\x20%s,\x20%s',_0x570faa,_0x45d387);_0x3bf4bd(_0x45d387);});});}
\ No newline at end of file
index 2be215a..9d529e7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6717=['removeListener','register','length','chatInternalMessage:','emit'];(function(_0x210cc1,_0x10d2d6){var _0x46bda=function(_0x344ac3){while(--_0x344ac3){_0x210cc1['push'](_0x210cc1['shift']());}};_0x46bda(++_0x10d2d6);}(_0x6717,0xea));var _0x7671=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6717[_0x3dd15e];return _0x231fd0;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=['save','remove','update'];function createListener(_0x56c639,_0x4823dc){return function(_0x4faec9){_0x4823dc[_0x7671('0x0')](_0x56c639,_0x4faec9);};}function removeListener(_0x2bd1d5,_0x45c73c){return function(){ChatInternalMessageEvents[_0x7671('0x1')](_0x2bd1d5,_0x45c73c);};}exports[_0x7671('0x2')]=function(_0x474696){for(var _0x4f1717=0x0,_0x2a6989=events[_0x7671('0x3')];_0x4f1717<_0x2a6989;_0x4f1717++){var _0x2a6da0=events[_0x4f1717];var _0x19972b=createListener(_0x7671('0x4')+_0x2a6da0,_0x474696);ChatInternalMessageEvents['on'](_0x2a6da0,_0x19972b);}};
\ No newline at end of file
+var _0x4266=['chatInternalMessage:','./chatInternalMessage.events','save','remove','update','emit','removeListener'];(function(_0x603235,_0x27c57a){var _0x32b3c6=function(_0x38d305){while(--_0x38d305){_0x603235['push'](_0x603235['shift']());}};_0x32b3c6(++_0x27c57a);}(_0x4266,0x8d));var _0x6426=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x4266[_0x19e35c];return _0x3e1fe8;};'use strict';var ChatInternalMessageEvents=require(_0x6426('0x0'));var events=[_0x6426('0x1'),_0x6426('0x2'),_0x6426('0x3')];function createListener(_0x4efbba,_0x4692bb){return function(_0x59a9c8){_0x4692bb[_0x6426('0x4')](_0x4efbba,_0x59a9c8);};}function removeListener(_0x1df96a,_0x225dce){return function(){ChatInternalMessageEvents[_0x6426('0x5')](_0x1df96a,_0x225dce);};}exports['register']=function(_0x14b9b6){for(var _0x5795e8=0x0,_0x4b572b=events['length'];_0x5795e8<_0x4b572b;_0x5795e8++){var _0x41bc62=events[_0x5795e8];var _0x14deac=createListener(_0x6426('0x6')+_0x41bc62,_0x14b9b6);ChatInternalMessageEvents['on'](_0x41bc62,_0x14deac);}};
\ No newline at end of file
index 0ac71d9..42b315a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb468=['create','put','update','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','index','/describe','describe','getUsers','/:id','show','post'];(function(_0x467e0d,_0x724800){var _0x2902c3=function(_0x30d4da){while(--_0x30d4da){_0x467e0d['push'](_0x467e0d['shift']());}};_0x2902c3(++_0x724800);}(_0xb468,0x1e8));var _0x8b46=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0xb468[_0x3e5086];return _0xfeb102;};'use strict';var multer=require(_0x8b46('0x0'));var util=require(_0x8b46('0x1'));var path=require(_0x8b46('0x2'));var timeout=require(_0x8b46('0x3'));var express=require(_0x8b46('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x8b46('0x5'));var interaction=require(_0x8b46('0x6'));var config=require(_0x8b46('0x7'));var controller=require(_0x8b46('0x8'));router[_0x8b46('0x9')]('/',auth[_0x8b46('0xa')](),controller[_0x8b46('0xb')]);router['get'](_0x8b46('0xc'),auth['isAuthenticated'](),controller[_0x8b46('0xd')]);router[_0x8b46('0x9')]('/users',auth[_0x8b46('0xa')](),controller[_0x8b46('0xe')]);router[_0x8b46('0x9')](_0x8b46('0xf'),auth[_0x8b46('0xa')](),controller[_0x8b46('0x10')]);router[_0x8b46('0x11')]('/',auth[_0x8b46('0xa')](),controller[_0x8b46('0x12')]);router[_0x8b46('0x13')](_0x8b46('0xf'),controller[_0x8b46('0x14')]);router['delete']('/:id',auth[_0x8b46('0xa')](),controller['destroy']);module[_0x8b46('0x15')]=router;
\ No newline at end of file
+var _0xf95c=['/:id','put','update','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','index','/describe','isAuthenticated','describe','/users','getUsers'];(function(_0xd0e3b7,_0x5d0d4b){var _0x4ff0b3=function(_0x572b7b){while(--_0x572b7b){_0xd0e3b7['push'](_0xd0e3b7['shift']());}};_0x4ff0b3(++_0x5d0d4b);}(_0xf95c,0x10e));var _0xcf95=function(_0x4aaf83,_0x2aaedb){_0x4aaf83=_0x4aaf83-0x0;var _0x49fb97=_0xf95c[_0x4aaf83];return _0x49fb97;};'use strict';var multer=require('multer');var util=require(_0xcf95('0x0'));var path=require(_0xcf95('0x1'));var timeout=require(_0xcf95('0x2'));var express=require('express');var router=express[_0xcf95('0x3')]();var fs_extra=require(_0xcf95('0x4'));var auth=require(_0xcf95('0x5'));var interaction=require(_0xcf95('0x6'));var config=require(_0xcf95('0x7'));var controller=require(_0xcf95('0x8'));router[_0xcf95('0x9')]('/',auth['isAuthenticated'](),controller[_0xcf95('0xa')]);router[_0xcf95('0x9')](_0xcf95('0xb'),auth[_0xcf95('0xc')](),controller[_0xcf95('0xd')]);router[_0xcf95('0x9')](_0xcf95('0xe'),auth[_0xcf95('0xc')](),controller[_0xcf95('0xf')]);router[_0xcf95('0x9')](_0xcf95('0x10'),auth[_0xcf95('0xc')](),controller['show']);router['post']('/',auth[_0xcf95('0xc')](),controller['create']);router[_0xcf95('0x11')](_0xcf95('0x10'),controller[_0xcf95('0x12')]);router[_0xcf95('0x13')](_0xcf95('0x10'),auth[_0xcf95('0xc')](),controller[_0xcf95('0x14')]);module[_0xcf95('0x15')]=router;
\ No newline at end of file
index 45a0fca..21e3c5d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x58a4=['DATE','STRING','sequelize','exports','TEXT','medium','BOOLEAN','ENUM','out'];(function(_0x20a5a4,_0x4bc4c6){var _0x5c7441=function(_0x2cc652){while(--_0x2cc652){_0x20a5a4['push'](_0x20a5a4['shift']());}};_0x5c7441(++_0x4bc4c6);}(_0x58a4,0xbf));var _0x458a=function(_0x3f0c06,_0x3d0ecf){_0x3f0c06=_0x3f0c06-0x0;var _0x507d9f=_0x58a4[_0x3f0c06];return _0x507d9f;};'use strict';var Sequelize=require(_0x458a('0x0'));module[_0x458a('0x1')]={'body':{'type':Sequelize[_0x458a('0x2')](_0x458a('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x458a('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0x458a('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x458a('0x5')]('in',_0x458a('0x6')),'defaultValue':_0x458a('0x6'),'allowNull':![]},'readAt':{'type':Sequelize[_0x458a('0x7')]},'providerName':{'type':Sequelize[_0x458a('0x8')]},'providerResponse':{'type':Sequelize[_0x458a('0x2')]}};
\ No newline at end of file
+var _0xdac7=['exports','BOOLEAN','ENUM','out','sequelize'];(function(_0x537348,_0x1b9186){var _0x41ca46=function(_0x31c782){while(--_0x31c782){_0x537348['push'](_0x537348['shift']());}};_0x41ca46(++_0x1b9186);}(_0xdac7,0x180));var _0x7dac=function(_0x2975ff,_0x5267be){_0x2975ff=_0x2975ff-0x0;var _0x7ac006=_0xdac7[_0x2975ff];return _0x7ac006;};'use strict';var Sequelize=require(_0x7dac('0x0'));module[_0x7dac('0x1')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x7dac('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x7dac('0x3')]('in',_0x7dac('0x4')),'defaultValue':_0x7dac('0x4'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize['TEXT']}};
\ No newline at end of file
index dc091df..04ca2ff 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb2b0=['stack','name','send','map','ChatMessage','rawAttributes','fieldName','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','merge','type','VIRTUAL','filter','options','include','findAll','rows','params','find','create','body','describe','../../config/logger','chat-interactions','chat','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','get','ChatInteraction','isNil','format','interaction','info','user','role','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','QueryTypes','SELECT','fullname','agent','manual','interface','channel','motionChannel','event','accept','EventManager','acceptmessage','parse','formData','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','ContactId','Sequelize','User','email','internal','SIP/%s','rejectmessage','rimraf','zip-dir','request-promise','moment','mustache','util','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','http','client','request','then','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','ChatMessage,\x20%s,\x20%s','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy'];(function(_0x40da2b,_0x4c8c73){var _0x122eb5=function(_0x2fc5f3){while(--_0x2fc5f3){_0x40da2b['push'](_0x40da2b['shift']());}};_0x122eb5(++_0x4c8c73);}(_0xb2b0,0xc6));var _0x0b2b=function(_0xee05ad,_0xe1ea6a){_0xee05ad=_0xee05ad-0x0;var _0x2feea7=_0xb2b0[_0xee05ad];return _0x2feea7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0b2b('0x0'));var zipdir=require(_0x0b2b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0b2b('0x2'));var moment=require(_0x0b2b('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0b2b('0x4'));var util=require(_0x0b2b('0x5'));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('fs-extra');var _=require(_0x0b2b('0x6'));var squel=require(_0x0b2b('0x7'));var crypto=require(_0x0b2b('0x8'));var jsforce=require(_0x0b2b('0x9'));var deskjs=require(_0x0b2b('0xa'));var toCsv=require(_0x0b2b('0xb'));var querystring=require(_0x0b2b('0xc'));var Papa=require('papaparse');var Redis=require(_0x0b2b('0xd'));var authService=require(_0x0b2b('0xe'));var qs=require(_0x0b2b('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0b2b('0x10'));var logger=require('../../config/logger')(_0x0b2b('0x11'));var utils=require(_0x0b2b('0x12'));var config=require(_0x0b2b('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x0b2b('0x14'))['db'];config[_0x0b2b('0x15')]=_['defaults'](config[_0x0b2b('0x15')],{'host':_0x0b2b('0x16'),'port':0x18eb});var socket=require(_0x0b2b('0x17'))(new Redis(config[_0x0b2b('0x15')]));require('./chatMessage.socket')['register'](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x0b2b('0x18')]({'port':0x232c});var client9002=jayson[_0x0b2b('0x19')][_0x0b2b('0x18')]({'port':0x232a});function respondWithRpcPromise(_0x3095db,_0x34738e,_0x107db8,_0x3e5d15){return new BPromise(function(_0x26a449,_0x1a0581){var _0x48c030=_0x3e5d15||client;return _0x48c030[_0x0b2b('0x1a')](_0x3095db,_0x107db8)[_0x0b2b('0x1b')](function(_0x22d927){logger['info']('ChatMessage,\x20%s,\x20%s',_0x34738e,'request\x20sent');logger['debug'](_0x0b2b('0x1c'),_0x34738e,_0x0b2b('0x1d'),JSON[_0x0b2b('0x1e')](_0x22d927));if(_0x22d927[_0x0b2b('0x1f')]){if(_0x22d927['error'][_0x0b2b('0x20')]===0x1f4){logger[_0x0b2b('0x1f')]('ChatMessage,\x20%s,\x20%s',_0x34738e,_0x22d927[_0x0b2b('0x1f')][_0x0b2b('0x21')]);return _0x1a0581(_0x22d927[_0x0b2b('0x1f')][_0x0b2b('0x21')]);}logger[_0x0b2b('0x1f')]('ChatMessage,\x20%s,\x20%s',_0x34738e,_0x22d927[_0x0b2b('0x1f')][_0x0b2b('0x21')]);return _0x26a449(_0x22d927[_0x0b2b('0x1f')][_0x0b2b('0x21')]);}else{logger['info'](_0x0b2b('0x22'),_0x34738e,_0x0b2b('0x1d'));_0x26a449(_0x22d927['result'][_0x0b2b('0x21')]);}})[_0x0b2b('0x23')](function(_0xefdf5){logger['error'](_0x0b2b('0x22'),_0x34738e,_0xefdf5);_0x1a0581(_0xefdf5);});});}function respondWithStatusCode(_0x45eafa,_0x4e6eac){_0x4e6eac=_0x4e6eac||0xcc;return function(_0x1e6026){if(_0x1e6026){return _0x45eafa[_0x0b2b('0x24')](_0x4e6eac);}return _0x45eafa[_0x0b2b('0x25')](_0x4e6eac)[_0x0b2b('0x26')]();};}function respondWithResult(_0x1ad121,_0xa41d26){_0xa41d26=_0xa41d26||0xc8;return function(_0x2f57f0){if(_0x2f57f0){return _0x1ad121[_0x0b2b('0x25')](_0xa41d26)[_0x0b2b('0x27')](_0x2f57f0);}};}function respondWithFilteredResult(_0x1e202e,_0x3cfe33){return function(_0x2e3b08){if(_0x2e3b08){var _0x56f4f1=typeof _0x3cfe33[_0x0b2b('0x28')]===_0x0b2b('0x29')&&typeof _0x3cfe33[_0x0b2b('0x2a')]==='undefined';var _0x23b720=_0x2e3b08[_0x0b2b('0x2b')];var _0xfd0c4c=_0x56f4f1?0x0:_0x3cfe33[_0x0b2b('0x28')];var _0x3e940f=_0x56f4f1?_0x2e3b08[_0x0b2b('0x2b')]:_0x3cfe33['offset']+_0x3cfe33[_0x0b2b('0x2a')];var _0x109977;if(_0x3e940f>=_0x23b720){_0x3e940f=_0x23b720;_0x109977=0xc8;}else{_0x109977=0xce;}_0x1e202e[_0x0b2b('0x25')](_0x109977);return _0x1e202e[_0x0b2b('0x2c')](_0x0b2b('0x2d'),_0xfd0c4c+'-'+_0x3e940f+'/'+_0x23b720)[_0x0b2b('0x27')](_0x2e3b08);}return null;};}function patchUpdates(_0x1059b4){return function(_0x208740){try{jsonpatch[_0x0b2b('0x2e')](_0x208740,_0x1059b4,!![]);}catch(_0x2bebdf){return BPromise[_0x0b2b('0x2f')](_0x2bebdf);}return _0x208740['save']();};}function saveUpdates(_0x22a42f,_0x481c97){return function(_0x4bc0cf){if(_0x4bc0cf){return _0x4bc0cf[_0x0b2b('0x30')](_0x22a42f)[_0x0b2b('0x1b')](function(_0x38d911){return _0x38d911;});}return null;};}function removeEntity(_0x40a6c8,_0x41d1c8){return function(_0x2be2c1){if(_0x2be2c1){return _0x2be2c1[_0x0b2b('0x31')]()['then'](function(){_0x40a6c8[_0x0b2b('0x25')](0xcc)[_0x0b2b('0x26')]();});}};}function handleEntityNotFound(_0x354ed8,_0x7ae2e8){return function(_0x3bf13d){if(!_0x3bf13d){_0x354ed8[_0x0b2b('0x24')](0x194);}return _0x3bf13d;};}function handleError(_0x2cdc9c,_0x4ce28b){_0x4ce28b=_0x4ce28b||0x1f4;return function(_0xfe1ba){logger['error'](_0xfe1ba[_0x0b2b('0x32')]);if(_0xfe1ba['name']){delete _0xfe1ba[_0x0b2b('0x33')];}_0x2cdc9c['status'](_0x4ce28b)[_0x0b2b('0x34')](_0xfe1ba);};}exports['index']=function(_0xad748c,_0x34fadc){var _0x4708aa={},_0x4f7ba5={},_0x43a570={'count':0x0,'rows':[]};var _0x247703=_[_0x0b2b('0x35')](db[_0x0b2b('0x36')][_0x0b2b('0x37')],function(_0x3e3015){return{'name':_0x3e3015[_0x0b2b('0x38')],'type':_0x3e3015['type'][_0x0b2b('0x39')]};});_0x4f7ba5[_0x0b2b('0x3a')]=_['map'](_0x247703,_0x0b2b('0x33'));_0x4f7ba5['query']=_[_0x0b2b('0x3b')](_0xad748c[_0x0b2b('0x3c')]);_0x4f7ba5[_0x0b2b('0x3d')]=_[_0x0b2b('0x3e')](_0x4f7ba5[_0x0b2b('0x3a')],_0x4f7ba5['query']);_0x4708aa['attributes']=_[_0x0b2b('0x3e')](_0x4f7ba5[_0x0b2b('0x3a')],qs[_0x0b2b('0x3f')](_0xad748c[_0x0b2b('0x3c')][_0x0b2b('0x3f')]));_0x4708aa['attributes']=_0x4708aa[_0x0b2b('0x40')][_0x0b2b('0x41')]?_0x4708aa[_0x0b2b('0x40')]:_0x4f7ba5[_0x0b2b('0x3a')];if(!_0xad748c[_0x0b2b('0x3c')][_0x0b2b('0x42')]('nolimit')){_0x4708aa[_0x0b2b('0x2a')]=qs[_0x0b2b('0x2a')](_0xad748c[_0x0b2b('0x3c')][_0x0b2b('0x2a')]);_0x4708aa[_0x0b2b('0x28')]=qs['offset'](_0xad748c[_0x0b2b('0x3c')][_0x0b2b('0x28')]);}_0x4708aa[_0x0b2b('0x43')]=qs['sort'](_0xad748c[_0x0b2b('0x3c')][_0x0b2b('0x44')]);_0x4708aa[_0x0b2b('0x45')]=qs[_0x0b2b('0x3d')](_['pick'](_0xad748c[_0x0b2b('0x3c')],_0x4f7ba5[_0x0b2b('0x3d')]),_0x247703);if(_0xad748c['query']['filter']){_0x4708aa['where']=_[_0x0b2b('0x46')](_0x4708aa[_0x0b2b('0x45')],{'$or':_[_0x0b2b('0x35')](_0x247703,function(_0x332608){if(_0x332608[_0x0b2b('0x47')]!==_0x0b2b('0x48')){var _0x56225d={};_0x56225d[_0x332608[_0x0b2b('0x33')]]={'$like':'%'+_0xad748c[_0x0b2b('0x3c')][_0x0b2b('0x49')]+'%'};return _0x56225d;}})});}_0x4708aa=_[_0x0b2b('0x46')]({},_0x4708aa,_0xad748c[_0x0b2b('0x4a')]);var _0x5e1757={'where':_0x4708aa[_0x0b2b('0x45')]};return db[_0x0b2b('0x36')]['count'](_0x5e1757)[_0x0b2b('0x1b')](function(_0x5cdde8){_0x43a570[_0x0b2b('0x2b')]=_0x5cdde8;if(_0xad748c[_0x0b2b('0x3c')]['includeAll']){_0x4708aa[_0x0b2b('0x4b')]=[{'all':!![]}];}return db[_0x0b2b('0x36')][_0x0b2b('0x4c')](_0x4708aa);})[_0x0b2b('0x1b')](function(_0x54be30){_0x43a570[_0x0b2b('0x4d')]=_0x54be30;return _0x43a570;})[_0x0b2b('0x1b')](respondWithFilteredResult(_0x34fadc,_0x4708aa))['catch'](handleError(_0x34fadc,null));};exports['show']=function(_0x338a64,_0x2038a9){var _0xa23457={'raw':!![],'where':{'id':_0x338a64[_0x0b2b('0x4e')]['id']}},_0x95aedc={};_0x95aedc[_0x0b2b('0x3a')]=_[_0x0b2b('0x3b')](db[_0x0b2b('0x36')][_0x0b2b('0x37')]);_0x95aedc[_0x0b2b('0x3c')]=_[_0x0b2b('0x3b')](_0x338a64[_0x0b2b('0x3c')]);_0x95aedc['filters']=_[_0x0b2b('0x3e')](_0x95aedc['model'],_0x95aedc[_0x0b2b('0x3c')]);_0xa23457[_0x0b2b('0x40')]=_[_0x0b2b('0x3e')](_0x95aedc[_0x0b2b('0x3a')],qs[_0x0b2b('0x3f')](_0x338a64[_0x0b2b('0x3c')][_0x0b2b('0x3f')]));_0xa23457[_0x0b2b('0x40')]=_0xa23457[_0x0b2b('0x40')][_0x0b2b('0x41')]?_0xa23457[_0x0b2b('0x40')]:_0x95aedc['model'];if(_0x338a64[_0x0b2b('0x3c')]['includeAll']){_0xa23457['include']=[{'all':!![]}];}_0xa23457=_[_0x0b2b('0x46')]({},_0xa23457,_0x338a64[_0x0b2b('0x4a')]);return db[_0x0b2b('0x36')][_0x0b2b('0x4f')](_0xa23457)[_0x0b2b('0x1b')](handleEntityNotFound(_0x2038a9,null))[_0x0b2b('0x1b')](respondWithResult(_0x2038a9,null))[_0x0b2b('0x23')](handleError(_0x2038a9,null));};exports[_0x0b2b('0x50')]=function(_0x3949c7,_0x5e5db6){return db[_0x0b2b('0x36')]['create'](_0x3949c7[_0x0b2b('0x51')],{})['then'](respondWithResult(_0x5e5db6,0xc9))[_0x0b2b('0x23')](handleError(_0x5e5db6,null));};exports[_0x0b2b('0x30')]=function(_0x529075,_0x22fd8e){if(_0x529075[_0x0b2b('0x51')]['id']){delete _0x529075['body']['id'];}return db['ChatMessage'][_0x0b2b('0x4f')]({'where':{'id':_0x529075['params']['id']}})[_0x0b2b('0x1b')](handleEntityNotFound(_0x22fd8e,null))[_0x0b2b('0x1b')](saveUpdates(_0x529075['body'],null))['then'](respondWithResult(_0x22fd8e,null))['catch'](handleError(_0x22fd8e,null));};exports[_0x0b2b('0x31')]=function(_0x18b160,_0x538a3a){return db[_0x0b2b('0x36')][_0x0b2b('0x4f')]({'where':{'id':_0x18b160['params']['id']}})[_0x0b2b('0x1b')](handleEntityNotFound(_0x538a3a,null))[_0x0b2b('0x1b')](removeEntity(_0x538a3a,null))[_0x0b2b('0x23')](handleError(_0x538a3a,null));};exports[_0x0b2b('0x52')]=function(_0x2b613b,_0x2984ad){return db[_0x0b2b('0x36')][_0x0b2b('0x52')]()[_0x0b2b('0x1b')](respondWithResult(_0x2984ad,null))[_0x0b2b('0x23')](handleError(_0x2984ad,null));};var interaction_log=require(_0x0b2b('0x53'))(_0x0b2b('0x54'));exports['accept']=function(_0x2e0ce3,_0x298548,_0x5c69dc){var _0x1226d9={'agent':{},'channel':_0x0b2b('0x55')};if(_0x2e0ce3[_0x0b2b('0x51')]['id']){delete _0x2e0ce3['body']['id'];}_0x2e0ce3['body']['read']=!![];_0x2e0ce3[_0x0b2b('0x51')][_0x0b2b('0x56')]=moment()['format'](_0x0b2b('0x57'));_0x2e0ce3['body']['UserId']=_0x2e0ce3[_0x0b2b('0x51')][_0x0b2b('0x58')]||_0x2e0ce3['user']['id'];_0x1226d9['agent']['id']=_0x2e0ce3[_0x0b2b('0x51')][_0x0b2b('0x58')];return db['ChatMessage'][_0x0b2b('0x4f')]({'where':{'id':_0x2e0ce3['params']['id'],'UserId':null}})[_0x0b2b('0x1b')](handleEntityNotFound(_0x298548,null))[_0x0b2b('0x1b')](saveUpdates(_0x2e0ce3['body'],null))[_0x0b2b('0x1b')](function(_0x248412){if(_0x248412){_0x1226d9[_0x0b2b('0x21')]=_0x248412[_0x0b2b('0x59')]({'plain':!![]});return db[_0x0b2b('0x5a')][_0x0b2b('0x4f')]({'where':{'id':_0x248412['ChatInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x298548,null))[_0x0b2b('0x1b')](function(_0x4d463d){if(_0x4d463d){return _0x4d463d[_0x0b2b('0x30')]({'UserId':_0x2e0ce3[_0x0b2b('0x51')]['UserId'],'read1stAt':_[_0x0b2b('0x5b')](_0x4d463d['read1stAt'])?moment()[_0x0b2b('0x5c')](_0x0b2b('0x57')):undefined});}return null;})[_0x0b2b('0x1b')](function(_0x25b635){if(_0x25b635){_0x1226d9[_0x0b2b('0x5d')]=_0x25b635[_0x0b2b('0x59')]({'plain':!![]});interaction_log[_0x0b2b('0x5e')]('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2e0ce3['user']['id'],_0x2e0ce3[_0x0b2b('0x5f')]['name'],_0x2e0ce3[_0x0b2b('0x5f')][_0x0b2b('0x60')],_0x1226d9['interaction']['id'],_0x2e0ce3[_0x0b2b('0x51')]?JSON['stringify'](_0x2e0ce3[_0x0b2b('0x51')]):_0x0b2b('0x61'));return respondWithRpcPromise('AcceptMessage',_0x0b2b('0x62'),_0x1226d9);}return null;})['then'](function(_0x35e11a){var _0x18d6d2=_0x0b2b('0x63')+_0x35e11a[_0x0b2b('0x21')]['ContactId'];return db[_0x0b2b('0x64')][_0x0b2b('0x3c')](_0x18d6d2,{'type':db['Sequelize'][_0x0b2b('0x65')][_0x0b2b('0x66')],'raw':!![]})[_0x0b2b('0x1b')](function(_0x377d80){return _0x377d80;});})[_0x0b2b('0x1b')](function(_0x7ceb65){if(_0x7ceb65){_0x1226d9[_0x0b2b('0x21')]['contact']=_0x7ceb65[0x0];if(!_0x2e0ce3['body']['UserId'])return;return db['User'][_0x0b2b('0x4f')]({'where':{'id':_0x2e0ce3[_0x0b2b('0x51')][_0x0b2b('0x58')],'role':'agent'},'attributes':['id','name',_0x0b2b('0x67'),'email','internal'],'raw':!![]});}return null;})[_0x0b2b('0x1b')](function(_0x10116d){if(!_0x10116d)return null;_0x1226d9['message'][_0x0b2b('0x68')]=_0x10116d;return _0x1226d9;})[_0x0b2b('0x1b')](function(_0x2a072b){if(_0x2a072b){if(_0x2e0ce3['body'][_0x0b2b('0x69')]){_0x1226d9[_0x0b2b('0x21')][_0x0b2b('0x6a')]=util['format']('SIP/%s',_0x2e0ce3['user']['name']);_0x1226d9['message'][_0x0b2b('0x6b')]=_0x1226d9[_0x0b2b('0x6b')];_0x1226d9[_0x0b2b('0x21')][_0x0b2b('0x6c')]=_0x1226d9[_0x0b2b('0x6b')];_0x1226d9[_0x0b2b('0x21')][_0x0b2b('0x6d')]=_0x0b2b('0x6e');return respondWithRpcPromise(_0x0b2b('0x6f'),_0x0b2b('0x6f'),{'event':_0x0b2b('0x70'),'message':_['merge'](_0x1226d9[_0x0b2b('0x21')],JSON[_0x0b2b('0x71')](_0x1226d9[_0x0b2b('0x5d')][_0x0b2b('0x72')]))},client9002)[_0x0b2b('0x1b')](function(){return _0x1226d9;});}return _0x1226d9;}return null;})[_0x0b2b('0x1b')](respondWithResult(_0x298548,null))[_0x0b2b('0x23')](handleError(_0x298548,null));};var interaction_log=require(_0x0b2b('0x53'))(_0x0b2b('0x54'));exports[_0x0b2b('0x2f')]=function(_0x9510de,_0x5c7361,_0x22bbc0){var _0x1313d6={'agent':{},'channel':'chat'};if(_0x9510de[_0x0b2b('0x51')]['id']){delete _0x9510de[_0x0b2b('0x51')]['id'];}_0x9510de[_0x0b2b('0x51')][_0x0b2b('0x58')]=_0x9510de[_0x0b2b('0x51')][_0x0b2b('0x58')]||_0x9510de[_0x0b2b('0x5f')]['id'];_0x1313d6[_0x0b2b('0x68')]['id']=_0x9510de[_0x0b2b('0x51')][_0x0b2b('0x58')];return db[_0x0b2b('0x36')]['find']({'where':{'id':_0x9510de['params']['id'],'UserId':null}})[_0x0b2b('0x1b')](handleEntityNotFound(_0x5c7361,null))[_0x0b2b('0x1b')](function(_0x545416){if(_0x545416){_0x1313d6[_0x0b2b('0x21')]=_0x545416[_0x0b2b('0x59')]({'plain':!![]});return db['ChatInteraction'][_0x0b2b('0x4f')]({'where':{'id':_0x545416['ChatInteractionId']}});}return null;})[_0x0b2b('0x1b')](handleEntityNotFound(_0x5c7361,null))[_0x0b2b('0x1b')](function(_0x2f14c4){if(_0x2f14c4){_0x1313d6[_0x0b2b('0x5d')]=_0x2f14c4[_0x0b2b('0x59')]({'plain':!![]});interaction_log[_0x0b2b('0x5e')](_0x0b2b('0x73'),_0x9510de[_0x0b2b('0x5f')]['id'],_0x9510de[_0x0b2b('0x5f')]['name'],_0x9510de['user']['role'],_0x1313d6[_0x0b2b('0x5d')]['id'],_0x9510de[_0x0b2b('0x51')]?JSON['stringify'](_0x9510de[_0x0b2b('0x51')]):_0x0b2b('0x61'));return respondWithRpcPromise('RejectMessage',_0x0b2b('0x74'),_0x1313d6);}return null;})[_0x0b2b('0x1b')](function(_0x1d6d5f){var _0x15c633=_0x0b2b('0x63')+_0x1d6d5f[_0x0b2b('0x21')][_0x0b2b('0x75')];return db['sequelize'][_0x0b2b('0x3c')](_0x15c633,{'type':db[_0x0b2b('0x76')][_0x0b2b('0x65')][_0x0b2b('0x66')],'raw':!![]})[_0x0b2b('0x1b')](function(_0x53ed1e){return _0x53ed1e;});})['then'](function(_0x8ea34a){if(_0x8ea34a){_0x1313d6[_0x0b2b('0x21')]['contact']=_0x8ea34a[0x0];if(!_0x9510de[_0x0b2b('0x51')]['UserId'])return;return db[_0x0b2b('0x77')][_0x0b2b('0x4f')]({'where':{'id':_0x9510de['body'][_0x0b2b('0x58')],'role':_0x0b2b('0x68')},'attributes':['id',_0x0b2b('0x33'),_0x0b2b('0x67'),_0x0b2b('0x78'),_0x0b2b('0x79')],'raw':!![]});}return null;})['then'](function(_0x5b5a1d){if(!_0x5b5a1d)return null;_0x1313d6[_0x0b2b('0x21')]['agent']=_0x5b5a1d;return _0x1313d6;})[_0x0b2b('0x1b')](function(_0x5778f8){if(_0x5778f8){_0x5778f8[_0x0b2b('0x21')][_0x0b2b('0x6a')]=util[_0x0b2b('0x5c')](_0x0b2b('0x7a'),_0x9510de[_0x0b2b('0x5f')][_0x0b2b('0x33')]);_0x5778f8[_0x0b2b('0x21')][_0x0b2b('0x6b')]=_0x1313d6[_0x0b2b('0x6b')];_0x5778f8[_0x0b2b('0x21')]['motionChannel']=_0x1313d6[_0x0b2b('0x6b')];_0x5778f8['message'][_0x0b2b('0x6d')]=_0x0b2b('0x2f');respondWithRpcPromise(_0x0b2b('0x6f'),'EventManager',{'event':_0x0b2b('0x7b'),'message':_[_0x0b2b('0x46')](_0x1313d6[_0x0b2b('0x21')],JSON[_0x0b2b('0x71')](_0x1313d6[_0x0b2b('0x5d')]['formData']))},client9002);return _0x1313d6;}return null;})[_0x0b2b('0x1b')](respondWithResult(_0x5c7361,null))[_0x0b2b('0x23')](handleError(_0x5c7361,null));};
\ No newline at end of file
+var _0xd0ed=['sequelize','Sequelize','SELECT','contact','User','fullname','internal','agent','manual','interface','format','channel','motionChannel','event','EventManager','acceptmessage','merge','interaction','formData','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','QueryTypes','SIP/%s','rejectmessage','parse','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','path','sox','ejs','fs-extra','lodash','squel','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','request','then','ChatMessage,\x20%s,\x20%s','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','destroy','send','map','ChatMessage','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','options','includeAll','findAll','rows','show','params','include','find','create','body','describe','chat-interactions','accept','chat','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','ChatInteraction','ChatInteractionId','isNil','info','name','null','AcceptMessage','acceptMessage','ContactId'];(function(_0x1b06ae,_0x3db6f1){var _0x5f4972=function(_0x3b5bbc){while(--_0x3b5bbc){_0x1b06ae['push'](_0x1b06ae['shift']());}};_0x5f4972(++_0x3db6f1);}(_0xd0ed,0x127));var _0xdd0e=function(_0x1a4d43,_0x28b32c){_0x1a4d43=_0x1a4d43-0x0;var _0x3650e0=_0xd0ed[_0x1a4d43];return _0x3650e0;};'use strict';var emlformat=require(_0xdd0e('0x0'));var rimraf=require(_0xdd0e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdd0e('0x2'));var rp=require(_0xdd0e('0x3'));var moment=require(_0xdd0e('0x4'));var BPromise=require(_0xdd0e('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xdd0e('0x6'));var sox=require(_0xdd0e('0x7'));var csv=require('to-csv');var ejs=require(_0xdd0e('0x8'));var fs=require('fs');var fs_extra=require(_0xdd0e('0x9'));var _=require(_0xdd0e('0xa'));var squel=require(_0xdd0e('0xb'));var crypto=require('crypto');var jsforce=require(_0xdd0e('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xdd0e('0xd'));var querystring=require(_0xdd0e('0xe'));var Papa=require('papaparse');var Redis=require(_0xdd0e('0xf'));var authService=require(_0xdd0e('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdd0e('0x11'));var logger=require(_0xdd0e('0x12'))(_0xdd0e('0x13'));var utils=require(_0xdd0e('0x14'));var config=require(_0xdd0e('0x15'));var licenseUtil=require(_0xdd0e('0x16'));var db=require(_0xdd0e('0x17'))['db'];config[_0xdd0e('0x18')]=_['defaults'](config[_0xdd0e('0x18')],{'host':_0xdd0e('0x19'),'port':0x18eb});var socket=require(_0xdd0e('0x1a'))(new Redis(config['redis']));require(_0xdd0e('0x1b'))[_0xdd0e('0x1c')](socket);var jayson=require(_0xdd0e('0x1d'));var client=jayson[_0xdd0e('0x1e')][_0xdd0e('0x1f')]({'port':0x232c});var client9002=jayson[_0xdd0e('0x1e')][_0xdd0e('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x1af92e,_0x481ba6,_0x88a694,_0xa614e4){return new BPromise(function(_0x4aff71,_0x34591a){var _0x4cf1e4=_0xa614e4||client;return _0x4cf1e4[_0xdd0e('0x20')](_0x1af92e,_0x88a694)[_0xdd0e('0x21')](function(_0x432628){logger['info'](_0xdd0e('0x22'),_0x481ba6,'request\x20sent');logger[_0xdd0e('0x23')](_0xdd0e('0x24'),_0x481ba6,_0xdd0e('0x25'),JSON[_0xdd0e('0x26')](_0x432628));if(_0x432628[_0xdd0e('0x27')]){if(_0x432628[_0xdd0e('0x27')][_0xdd0e('0x28')]===0x1f4){logger['error'](_0xdd0e('0x22'),_0x481ba6,_0x432628[_0xdd0e('0x27')][_0xdd0e('0x29')]);return _0x34591a(_0x432628['error']['message']);}logger[_0xdd0e('0x27')](_0xdd0e('0x22'),_0x481ba6,_0x432628[_0xdd0e('0x27')]['message']);return _0x4aff71(_0x432628[_0xdd0e('0x27')]['message']);}else{logger['info'](_0xdd0e('0x22'),_0x481ba6,'request\x20sent');_0x4aff71(_0x432628['result']['message']);}})[_0xdd0e('0x2a')](function(_0x28f1ec){logger['error'](_0xdd0e('0x22'),_0x481ba6,_0x28f1ec);_0x34591a(_0x28f1ec);});});}function respondWithStatusCode(_0x4aac55,_0x46df22){_0x46df22=_0x46df22||0xcc;return function(_0x158112){if(_0x158112){return _0x4aac55[_0xdd0e('0x2b')](_0x46df22);}return _0x4aac55[_0xdd0e('0x2c')](_0x46df22)[_0xdd0e('0x2d')]();};}function respondWithResult(_0x382542,_0x3ee425){_0x3ee425=_0x3ee425||0xc8;return function(_0x356226){if(_0x356226){return _0x382542[_0xdd0e('0x2c')](_0x3ee425)[_0xdd0e('0x2e')](_0x356226);}};}function respondWithFilteredResult(_0x29110a,_0x1ace7e){return function(_0x427378){if(_0x427378){var _0x3fbfc7=typeof _0x1ace7e[_0xdd0e('0x2f')]==='undefined'&&typeof _0x1ace7e[_0xdd0e('0x30')]===_0xdd0e('0x31');var _0x17b94f=_0x427378[_0xdd0e('0x32')];var _0x4dc077=_0x3fbfc7?0x0:_0x1ace7e[_0xdd0e('0x2f')];var _0x22370a=_0x3fbfc7?_0x427378[_0xdd0e('0x32')]:_0x1ace7e[_0xdd0e('0x2f')]+_0x1ace7e['limit'];var _0x2042b4;if(_0x22370a>=_0x17b94f){_0x22370a=_0x17b94f;_0x2042b4=0xc8;}else{_0x2042b4=0xce;}_0x29110a[_0xdd0e('0x2c')](_0x2042b4);return _0x29110a[_0xdd0e('0x33')](_0xdd0e('0x34'),_0x4dc077+'-'+_0x22370a+'/'+_0x17b94f)[_0xdd0e('0x2e')](_0x427378);}return null;};}function patchUpdates(_0x155e9b){return function(_0xb5a236){try{jsonpatch['apply'](_0xb5a236,_0x155e9b,!![]);}catch(_0x1b2710){return BPromise[_0xdd0e('0x35')](_0x1b2710);}return _0xb5a236[_0xdd0e('0x36')]();};}function saveUpdates(_0x445289,_0x1392b0){return function(_0x28a33a){if(_0x28a33a){return _0x28a33a[_0xdd0e('0x37')](_0x445289)['then'](function(_0x2e8ddb){return _0x2e8ddb;});}return null;};}function removeEntity(_0x2248e1,_0x14c00f){return function(_0x2f8436){if(_0x2f8436){return _0x2f8436[_0xdd0e('0x38')]()[_0xdd0e('0x21')](function(){_0x2248e1['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x57b0b5,_0x4c4564){return function(_0x36cf27){if(!_0x36cf27){_0x57b0b5[_0xdd0e('0x2b')](0x194);}return _0x36cf27;};}function handleError(_0xe8b6f,_0x3e08f0){_0x3e08f0=_0x3e08f0||0x1f4;return function(_0x507240){logger[_0xdd0e('0x27')](_0x507240['stack']);if(_0x507240['name']){delete _0x507240['name'];}_0xe8b6f[_0xdd0e('0x2c')](_0x3e08f0)[_0xdd0e('0x39')](_0x507240);};}exports['index']=function(_0x5c3a7e,_0x5b01ec){var _0x25a9a1={},_0x562610={},_0x58c3db={'count':0x0,'rows':[]};var _0xf0134c=_[_0xdd0e('0x3a')](db[_0xdd0e('0x3b')][_0xdd0e('0x3c')],function(_0x741e6e){return{'name':_0x741e6e[_0xdd0e('0x3d')],'type':_0x741e6e[_0xdd0e('0x3e')][_0xdd0e('0x3f')]};});_0x562610[_0xdd0e('0x40')]=_[_0xdd0e('0x3a')](_0xf0134c,'name');_0x562610[_0xdd0e('0x41')]=_[_0xdd0e('0x42')](_0x5c3a7e[_0xdd0e('0x41')]);_0x562610['filters']=_[_0xdd0e('0x43')](_0x562610['model'],_0x562610[_0xdd0e('0x41')]);_0x25a9a1[_0xdd0e('0x44')]=_['intersection'](_0x562610['model'],qs[_0xdd0e('0x45')](_0x5c3a7e['query'][_0xdd0e('0x45')]));_0x25a9a1[_0xdd0e('0x44')]=_0x25a9a1['attributes'][_0xdd0e('0x46')]?_0x25a9a1['attributes']:_0x562610[_0xdd0e('0x40')];if(!_0x5c3a7e[_0xdd0e('0x41')][_0xdd0e('0x47')](_0xdd0e('0x48'))){_0x25a9a1[_0xdd0e('0x30')]=qs[_0xdd0e('0x30')](_0x5c3a7e[_0xdd0e('0x41')][_0xdd0e('0x30')]);_0x25a9a1[_0xdd0e('0x2f')]=qs[_0xdd0e('0x2f')](_0x5c3a7e['query'][_0xdd0e('0x2f')]);}_0x25a9a1[_0xdd0e('0x49')]=qs[_0xdd0e('0x4a')](_0x5c3a7e[_0xdd0e('0x41')][_0xdd0e('0x4a')]);_0x25a9a1[_0xdd0e('0x4b')]=qs[_0xdd0e('0x4c')](_[_0xdd0e('0x4d')](_0x5c3a7e[_0xdd0e('0x41')],_0x562610[_0xdd0e('0x4c')]),_0xf0134c);if(_0x5c3a7e['query'][_0xdd0e('0x4e')]){_0x25a9a1[_0xdd0e('0x4b')]=_['merge'](_0x25a9a1[_0xdd0e('0x4b')],{'$or':_[_0xdd0e('0x3a')](_0xf0134c,function(_0x36f2c5){if(_0x36f2c5['type']!==_0xdd0e('0x4f')){var _0x4b03ce={};_0x4b03ce[_0x36f2c5['name']]={'$like':'%'+_0x5c3a7e[_0xdd0e('0x41')][_0xdd0e('0x4e')]+'%'};return _0x4b03ce;}})});}_0x25a9a1=_['merge']({},_0x25a9a1,_0x5c3a7e[_0xdd0e('0x50')]);var _0x10a72c={'where':_0x25a9a1[_0xdd0e('0x4b')]};return db[_0xdd0e('0x3b')]['count'](_0x10a72c)['then'](function(_0x5352a6){_0x58c3db[_0xdd0e('0x32')]=_0x5352a6;if(_0x5c3a7e[_0xdd0e('0x41')][_0xdd0e('0x51')]){_0x25a9a1['include']=[{'all':!![]}];}return db['ChatMessage'][_0xdd0e('0x52')](_0x25a9a1);})['then'](function(_0x40cd35){_0x58c3db[_0xdd0e('0x53')]=_0x40cd35;return _0x58c3db;})['then'](respondWithFilteredResult(_0x5b01ec,_0x25a9a1))[_0xdd0e('0x2a')](handleError(_0x5b01ec,null));};exports[_0xdd0e('0x54')]=function(_0x4a4ebc,_0x55b6d0){var _0x384cab={'raw':!![],'where':{'id':_0x4a4ebc[_0xdd0e('0x55')]['id']}},_0x207694={};_0x207694[_0xdd0e('0x40')]=_[_0xdd0e('0x42')](db['ChatMessage'][_0xdd0e('0x3c')]);_0x207694[_0xdd0e('0x41')]=_[_0xdd0e('0x42')](_0x4a4ebc[_0xdd0e('0x41')]);_0x207694[_0xdd0e('0x4c')]=_[_0xdd0e('0x43')](_0x207694[_0xdd0e('0x40')],_0x207694[_0xdd0e('0x41')]);_0x384cab[_0xdd0e('0x44')]=_[_0xdd0e('0x43')](_0x207694['model'],qs[_0xdd0e('0x45')](_0x4a4ebc[_0xdd0e('0x41')][_0xdd0e('0x45')]));_0x384cab['attributes']=_0x384cab['attributes'][_0xdd0e('0x46')]?_0x384cab[_0xdd0e('0x44')]:_0x207694[_0xdd0e('0x40')];if(_0x4a4ebc[_0xdd0e('0x41')][_0xdd0e('0x51')]){_0x384cab[_0xdd0e('0x56')]=[{'all':!![]}];}_0x384cab=_['merge']({},_0x384cab,_0x4a4ebc[_0xdd0e('0x50')]);return db['ChatMessage'][_0xdd0e('0x57')](_0x384cab)[_0xdd0e('0x21')](handleEntityNotFound(_0x55b6d0,null))['then'](respondWithResult(_0x55b6d0,null))[_0xdd0e('0x2a')](handleError(_0x55b6d0,null));};exports[_0xdd0e('0x58')]=function(_0x635bc1,_0x250680){return db['ChatMessage'][_0xdd0e('0x58')](_0x635bc1[_0xdd0e('0x59')],{})['then'](respondWithResult(_0x250680,0xc9))[_0xdd0e('0x2a')](handleError(_0x250680,null));};exports[_0xdd0e('0x37')]=function(_0x595772,_0x228cbc){if(_0x595772[_0xdd0e('0x59')]['id']){delete _0x595772[_0xdd0e('0x59')]['id'];}return db['ChatMessage'][_0xdd0e('0x57')]({'where':{'id':_0x595772[_0xdd0e('0x55')]['id']}})[_0xdd0e('0x21')](handleEntityNotFound(_0x228cbc,null))[_0xdd0e('0x21')](saveUpdates(_0x595772['body'],null))[_0xdd0e('0x21')](respondWithResult(_0x228cbc,null))[_0xdd0e('0x2a')](handleError(_0x228cbc,null));};exports[_0xdd0e('0x38')]=function(_0x2a5a88,_0x29c6bb){return db[_0xdd0e('0x3b')]['find']({'where':{'id':_0x2a5a88['params']['id']}})[_0xdd0e('0x21')](handleEntityNotFound(_0x29c6bb,null))[_0xdd0e('0x21')](removeEntity(_0x29c6bb,null))[_0xdd0e('0x2a')](handleError(_0x29c6bb,null));};exports[_0xdd0e('0x5a')]=function(_0xfe4137,_0x25aaf9){return db[_0xdd0e('0x3b')][_0xdd0e('0x5a')]()[_0xdd0e('0x21')](respondWithResult(_0x25aaf9,null))[_0xdd0e('0x2a')](handleError(_0x25aaf9,null));};var interaction_log=require(_0xdd0e('0x12'))(_0xdd0e('0x5b'));exports[_0xdd0e('0x5c')]=function(_0x21c0ed,_0x4d71d3,_0x13887d){var _0x33cba3={'agent':{},'channel':_0xdd0e('0x5d')};if(_0x21c0ed[_0xdd0e('0x59')]['id']){delete _0x21c0ed[_0xdd0e('0x59')]['id'];}_0x21c0ed[_0xdd0e('0x59')]['read']=!![];_0x21c0ed[_0xdd0e('0x59')]['readAt']=moment()['format'](_0xdd0e('0x5e'));_0x21c0ed[_0xdd0e('0x59')][_0xdd0e('0x5f')]=_0x21c0ed['body']['UserId']||_0x21c0ed[_0xdd0e('0x60')]['id'];_0x33cba3['agent']['id']=_0x21c0ed[_0xdd0e('0x59')]['UserId'];return db['ChatMessage'][_0xdd0e('0x57')]({'where':{'id':_0x21c0ed[_0xdd0e('0x55')]['id'],'UserId':null}})[_0xdd0e('0x21')](handleEntityNotFound(_0x4d71d3,null))[_0xdd0e('0x21')](saveUpdates(_0x21c0ed['body'],null))[_0xdd0e('0x21')](function(_0x53d8d7){if(_0x53d8d7){_0x33cba3['message']=_0x53d8d7[_0xdd0e('0x61')]({'plain':!![]});return db[_0xdd0e('0x62')][_0xdd0e('0x57')]({'where':{'id':_0x53d8d7[_0xdd0e('0x63')]}});}return null;})['then'](handleEntityNotFound(_0x4d71d3,null))[_0xdd0e('0x21')](function(_0x1979c6){if(_0x1979c6){return _0x1979c6[_0xdd0e('0x37')]({'UserId':_0x21c0ed['body'][_0xdd0e('0x5f')],'read1stAt':_[_0xdd0e('0x64')](_0x1979c6['read1stAt'])?moment()['format'](_0xdd0e('0x5e')):undefined});}return null;})[_0xdd0e('0x21')](function(_0x56f7cd){if(_0x56f7cd){_0x33cba3['interaction']=_0x56f7cd[_0xdd0e('0x61')]({'plain':!![]});interaction_log[_0xdd0e('0x65')]('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x21c0ed['user']['id'],_0x21c0ed[_0xdd0e('0x60')][_0xdd0e('0x66')],_0x21c0ed[_0xdd0e('0x60')]['role'],_0x33cba3['interaction']['id'],_0x21c0ed[_0xdd0e('0x59')]?JSON[_0xdd0e('0x26')](_0x21c0ed['body']):_0xdd0e('0x67'));return respondWithRpcPromise(_0xdd0e('0x68'),_0xdd0e('0x69'),_0x33cba3);}return null;})[_0xdd0e('0x21')](function(_0x2c6f9c){var _0x41179f='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x2c6f9c[_0xdd0e('0x29')][_0xdd0e('0x6a')];return db[_0xdd0e('0x6b')][_0xdd0e('0x41')](_0x41179f,{'type':db[_0xdd0e('0x6c')]['QueryTypes'][_0xdd0e('0x6d')],'raw':!![]})[_0xdd0e('0x21')](function(_0xe77d27){return _0xe77d27;});})[_0xdd0e('0x21')](function(_0x29227b){if(_0x29227b){_0x33cba3[_0xdd0e('0x29')][_0xdd0e('0x6e')]=_0x29227b[0x0];if(!_0x21c0ed[_0xdd0e('0x59')][_0xdd0e('0x5f')])return;return db[_0xdd0e('0x6f')][_0xdd0e('0x57')]({'where':{'id':_0x21c0ed[_0xdd0e('0x59')][_0xdd0e('0x5f')],'role':'agent'},'attributes':['id',_0xdd0e('0x66'),_0xdd0e('0x70'),'email',_0xdd0e('0x71')],'raw':!![]});}return null;})['then'](function(_0x51c27c){if(!_0x51c27c)return null;_0x33cba3[_0xdd0e('0x29')][_0xdd0e('0x72')]=_0x51c27c;return _0x33cba3;})['then'](function(_0x3264e3){if(_0x3264e3){if(_0x21c0ed[_0xdd0e('0x59')][_0xdd0e('0x73')]){_0x33cba3[_0xdd0e('0x29')][_0xdd0e('0x74')]=util[_0xdd0e('0x75')]('SIP/%s',_0x21c0ed[_0xdd0e('0x60')]['name']);_0x33cba3['message'][_0xdd0e('0x76')]=_0x33cba3[_0xdd0e('0x76')];_0x33cba3[_0xdd0e('0x29')][_0xdd0e('0x77')]=_0x33cba3[_0xdd0e('0x76')];_0x33cba3[_0xdd0e('0x29')][_0xdd0e('0x78')]=_0xdd0e('0x5c');return respondWithRpcPromise(_0xdd0e('0x79'),_0xdd0e('0x79'),{'event':_0xdd0e('0x7a'),'message':_[_0xdd0e('0x7b')](_0x33cba3[_0xdd0e('0x29')],JSON['parse'](_0x33cba3[_0xdd0e('0x7c')][_0xdd0e('0x7d')]))},client9002)['then'](function(){return _0x33cba3;});}return _0x33cba3;}return null;})[_0xdd0e('0x21')](respondWithResult(_0x4d71d3,null))[_0xdd0e('0x2a')](handleError(_0x4d71d3,null));};var interaction_log=require(_0xdd0e('0x12'))(_0xdd0e('0x5b'));exports['reject']=function(_0x34408b,_0x4e0fad,_0x181e3e){var _0x1b787e={'agent':{},'channel':_0xdd0e('0x5d')};if(_0x34408b[_0xdd0e('0x59')]['id']){delete _0x34408b[_0xdd0e('0x59')]['id'];}_0x34408b[_0xdd0e('0x59')][_0xdd0e('0x5f')]=_0x34408b[_0xdd0e('0x59')]['UserId']||_0x34408b[_0xdd0e('0x60')]['id'];_0x1b787e[_0xdd0e('0x72')]['id']=_0x34408b[_0xdd0e('0x59')][_0xdd0e('0x5f')];return db[_0xdd0e('0x3b')]['find']({'where':{'id':_0x34408b[_0xdd0e('0x55')]['id'],'UserId':null}})[_0xdd0e('0x21')](handleEntityNotFound(_0x4e0fad,null))[_0xdd0e('0x21')](function(_0x4709c1){if(_0x4709c1){_0x1b787e[_0xdd0e('0x29')]=_0x4709c1['get']({'plain':!![]});return db[_0xdd0e('0x62')][_0xdd0e('0x57')]({'where':{'id':_0x4709c1[_0xdd0e('0x63')]}});}return null;})[_0xdd0e('0x21')](handleEntityNotFound(_0x4e0fad,null))[_0xdd0e('0x21')](function(_0x1cbafa){if(_0x1cbafa){_0x1b787e[_0xdd0e('0x7c')]=_0x1cbafa['get']({'plain':!![]});interaction_log['info'](_0xdd0e('0x7e'),_0x34408b[_0xdd0e('0x60')]['id'],_0x34408b['user'][_0xdd0e('0x66')],_0x34408b[_0xdd0e('0x60')][_0xdd0e('0x7f')],_0x1b787e[_0xdd0e('0x7c')]['id'],_0x34408b[_0xdd0e('0x59')]?JSON[_0xdd0e('0x26')](_0x34408b[_0xdd0e('0x59')]):_0xdd0e('0x67'));return respondWithRpcPromise(_0xdd0e('0x80'),'rejectMessage',_0x1b787e);}return null;})[_0xdd0e('0x21')](function(_0x87bfa4){var _0x22d510=_0xdd0e('0x81')+_0x87bfa4['message']['ContactId'];return db[_0xdd0e('0x6b')][_0xdd0e('0x41')](_0x22d510,{'type':db[_0xdd0e('0x6c')][_0xdd0e('0x82')][_0xdd0e('0x6d')],'raw':!![]})[_0xdd0e('0x21')](function(_0x380d64){return _0x380d64;});})[_0xdd0e('0x21')](function(_0x309ee8){if(_0x309ee8){_0x1b787e[_0xdd0e('0x29')][_0xdd0e('0x6e')]=_0x309ee8[0x0];if(!_0x34408b['body'][_0xdd0e('0x5f')])return;return db[_0xdd0e('0x6f')][_0xdd0e('0x57')]({'where':{'id':_0x34408b[_0xdd0e('0x59')][_0xdd0e('0x5f')],'role':'agent'},'attributes':['id','name','fullname','email','internal'],'raw':!![]});}return null;})[_0xdd0e('0x21')](function(_0x455d05){if(!_0x455d05)return null;_0x1b787e[_0xdd0e('0x29')]['agent']=_0x455d05;return _0x1b787e;})[_0xdd0e('0x21')](function(_0x361b28){if(_0x361b28){_0x361b28['message'][_0xdd0e('0x74')]=util[_0xdd0e('0x75')](_0xdd0e('0x83'),_0x34408b['user']['name']);_0x361b28[_0xdd0e('0x29')][_0xdd0e('0x76')]=_0x1b787e[_0xdd0e('0x76')];_0x361b28['message'][_0xdd0e('0x77')]=_0x1b787e[_0xdd0e('0x76')];_0x361b28[_0xdd0e('0x29')]['event']='reject';respondWithRpcPromise(_0xdd0e('0x79'),'EventManager',{'event':_0xdd0e('0x84'),'message':_[_0xdd0e('0x7b')](_0x1b787e['message'],JSON[_0xdd0e('0x85')](_0x1b787e['interaction'][_0xdd0e('0x7d')]))},client9002);return _0x1b787e;}return null;})['then'](respondWithResult(_0x4e0fad,null))['catch'](handleError(_0x4e0fad,null));};
\ No newline at end of file
index 7e4f2ae..28b0689 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf826=['update','emit','hasOwnProperty','hook','../../mysqldb','setMaxListeners','save'];(function(_0x2f3be8,_0x78f0c0){var _0x5c054a=function(_0x77a4ff){while(--_0x77a4ff){_0x2f3be8['push'](_0x2f3be8['shift']());}};_0x5c054a(++_0x78f0c0);}(_0xf826,0x19a));var _0x6f82=function(_0xd3d5c3,_0x42d2af){_0xd3d5c3=_0xd3d5c3-0x0;var _0x29a808=_0xf826[_0xd3d5c3];return _0x29a808;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0x6f82('0x0'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x6f82('0x1')](0x0);var events={'afterCreate':_0x6f82('0x2'),'afterUpdate':_0x6f82('0x3'),'afterDestroy':'remove'};function emitEvent(_0x1ff1e0){return function(_0x270e76,_0x4c04fe,_0x4cd86d){ChatMessageEvents[_0x6f82('0x4')](_0x1ff1e0+':'+_0x270e76['id'],_0x270e76);ChatMessageEvents['emit'](_0x1ff1e0,_0x270e76);_0x4cd86d(null);};}for(var e in events){if(events[_0x6f82('0x5')](e)){var event=events[e];ChatMessage[_0x6f82('0x6')](e,emitEvent(event));}}module['exports']=ChatMessageEvents;
\ No newline at end of file
+var _0x8456=['ChatMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x4ddc7a,_0x5b6cb8){var _0x4547c1=function(_0x3739e7){while(--_0x3739e7){_0x4ddc7a['push'](_0x4ddc7a['shift']());}};_0x4547c1(++_0x5b6cb8);}(_0x8456,0x9e));var _0x6845=function(_0x2bdd0e,_0x16948d){_0x2bdd0e=_0x2bdd0e-0x0;var _0x317ebd=_0x8456[_0x2bdd0e];return _0x317ebd;};'use strict';var EventEmitter=require(_0x6845('0x0'));var ChatMessage=require(_0x6845('0x1'))['db'][_0x6845('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x6845('0x3')](0x0);var events={'afterCreate':_0x6845('0x4'),'afterUpdate':_0x6845('0x5'),'afterDestroy':_0x6845('0x6')};function emitEvent(_0x5dd97e){return function(_0x2c47c0,_0x13f2ad,_0x3f7e4a){ChatMessageEvents[_0x6845('0x7')](_0x5dd97e+':'+_0x2c47c0['id'],_0x2c47c0);ChatMessageEvents[_0x6845('0x7')](_0x5dd97e,_0x2c47c0);_0x3f7e4a(null);};}for(var e in events){if(events[_0x6845('0x8')](e)){var event=events[e];ChatMessage[_0x6845('0x9')](e,emitEvent(event));}}module['exports']=ChatMessageEvents;
\ No newline at end of file
index a802644..10691e3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf963=['rimraf','../../config/environment','./chatMessage.attributes','exports','define','ChatMessage','body','FULLTEXT','models','get','toLowerCase','out','secret','UserId','findOne','then','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','moment','request-promise','path'];(function(_0x4b350a,_0x5cf71f){var _0x387e19=function(_0x59e66b){while(--_0x59e66b){_0x4b350a['push'](_0x4b350a['shift']());}};_0x387e19(++_0x5cf71f);}(_0xf963,0x133));var _0x3f96=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0xf963[_0x13e741];return _0x3f8bb3;};'use strict';var _=require('lodash');var util=require(_0x3f96('0x0'));var logger=require(_0x3f96('0x1'))('api');var moment=require(_0x3f96('0x2'));var BPromise=require('bluebird');var rp=require(_0x3f96('0x3'));var fs=require('fs');var path=require(_0x3f96('0x4'));var rimraf=require(_0x3f96('0x5'));var config=require(_0x3f96('0x6'));var attributes=require(_0x3f96('0x7'));module[_0x3f96('0x8')]=function(_0x38e583,_0x20d21c){return _0x38e583[_0x3f96('0x9')](_0x3f96('0xa'),attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':[_0x3f96('0xb')],'type':_0x3f96('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0xa3b8e,_0x3983ef,_0x56fc8b){var _0x98d5ea=_0x38e583[_0x3f96('0xd')];var _0x5b0cf0=_0xa3b8e[_0x3f96('0xe')]({'plain':!![]});if(_0x5b0cf0['direction'][_0x3f96('0xf')]()==='in'||_0x5b0cf0['direction']['toLowerCase']()===_0x3f96('0x10')&&!_0x5b0cf0[_0x3f96('0x11')]&&!_['isNil'](_0x5b0cf0[_0x3f96('0x12')])){_0x98d5ea['ChatInteraction'][_0x3f96('0x13')]({'where':{'id':_0x5b0cf0['ChatInteractionId']}})[_0x3f96('0x14')](function(_0x443dc8){if(_0x443dc8){_0x443dc8['update']({'lastMsgAt':_0x5b0cf0[_0x3f96('0x15')],'lastMsgDirection':_0x5b0cf0['direction'][_0x3f96('0xf')]()});}})[_0x3f96('0x16')](function(_0x24cb30){console[_0x3f96('0x17')](_0x24cb30);});}_0x56fc8b();}},'charset':_0x3f96('0x18'),'collate':_0x3f96('0x19')});};
\ No newline at end of file
+var _0x3c6d=['ChatInteraction','findOne','then','update','createdAt','catch','utf8mb4','utf8mb4_unicode_ci','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','chat_messages','fti_chat_messages','body','FULLTEXT','models','get','toLowerCase','direction','out','secret','isNil'];(function(_0x26aafa,_0x100c92){var _0x13b20e=function(_0x3f6216){while(--_0x3f6216){_0x26aafa['push'](_0x26aafa['shift']());}};_0x13b20e(++_0x100c92);}(_0x3c6d,0x190));var _0xd3c6=function(_0x10beb5,_0x3758b8){_0x10beb5=_0x10beb5-0x0;var _0x361364=_0x3c6d[_0x10beb5];return _0x361364;};'use strict';var _=require(_0xd3c6('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xd3c6('0x1'));var moment=require(_0xd3c6('0x2'));var BPromise=require(_0xd3c6('0x3'));var rp=require(_0xd3c6('0x4'));var fs=require('fs');var path=require(_0xd3c6('0x5'));var rimraf=require(_0xd3c6('0x6'));var config=require(_0xd3c6('0x7'));var attributes=require('./chatMessage.attributes');module['exports']=function(_0x4523d4,_0x4a1c95){return _0x4523d4[_0xd3c6('0x8')]('ChatMessage',attributes,{'tableName':_0xd3c6('0x9'),'paranoid':![],'indexes':[{'name':_0xd3c6('0xa'),'fields':[_0xd3c6('0xb')],'type':_0xd3c6('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x6492c9,_0x1f1ce7,_0x316ab5){var _0x2d6b68=_0x4523d4[_0xd3c6('0xd')];var _0x185b28=_0x6492c9[_0xd3c6('0xe')]({'plain':!![]});if(_0x185b28['direction'][_0xd3c6('0xf')]()==='in'||_0x185b28[_0xd3c6('0x10')][_0xd3c6('0xf')]()===_0xd3c6('0x11')&&!_0x185b28[_0xd3c6('0x12')]&&!_[_0xd3c6('0x13')](_0x185b28['UserId'])){_0x2d6b68[_0xd3c6('0x14')][_0xd3c6('0x15')]({'where':{'id':_0x185b28['ChatInteractionId']}})[_0xd3c6('0x16')](function(_0x1c45dc){if(_0x1c45dc){_0x1c45dc[_0xd3c6('0x17')]({'lastMsgAt':_0x185b28[_0xd3c6('0x18')],'lastMsgDirection':_0x185b28[_0xd3c6('0x10')][_0xd3c6('0xf')]()});}})[_0xd3c6('0x19')](function(_0x1b8653){console['error'](_0x1b8653);});}_0x316ab5();}},'charset':_0xd3c6('0x1a'),'collate':_0xd3c6('0x1b')});};
\ No newline at end of file
index 90a6a33..e9238ad 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7d3a=['create','body','options','CreateChatMessage','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./chatMessage.socket','register','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x2c7900,_0x44f3b6){var _0x35c02f=function(_0x343749){while(--_0x343749){_0x2c7900['push'](_0x2c7900['shift']());}};_0x35c02f(++_0x44f3b6);}(_0x7d3a,0x17a));var _0xa7d3=function(_0x435fda,_0xf6b683){_0x435fda=_0x435fda-0x0;var _0x28c3df=_0x7d3a[_0x435fda];return _0x28c3df;};'use strict';var _=require(_0xa7d3('0x0'));var util=require(_0xa7d3('0x1'));var moment=require(_0xa7d3('0x2'));var BPromise=require('bluebird');var rs=require(_0xa7d3('0x3'));var fs=require('fs');var Redis=require(_0xa7d3('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa7d3('0x5'));var logger=require(_0xa7d3('0x6'))('rpc');var config=require(_0xa7d3('0x7'));var jayson=require(_0xa7d3('0x8'));var client=jayson[_0xa7d3('0x9')][_0xa7d3('0xa')]({'port':0x232a});config['redis']=_[_0xa7d3('0xb')](config[_0xa7d3('0xc')],{'host':_0xa7d3('0xd'),'port':0x18eb});var socket=require(_0xa7d3('0xe'))(new Redis(config[_0xa7d3('0xc')]));require(_0xa7d3('0xf'))[_0xa7d3('0x10')](socket);function respondWithRpcPromise(_0x426d0f,_0x2470d3,_0x31989e){return new BPromise(function(_0x5a4903,_0x2527e9){return client[_0xa7d3('0x11')](_0x426d0f,_0x31989e)[_0xa7d3('0x12')](function(_0x5899d9){logger[_0xa7d3('0x13')](_0xa7d3('0x14'),_0x2470d3,_0xa7d3('0x15'));logger[_0xa7d3('0x16')](_0xa7d3('0x17'),_0x2470d3,_0xa7d3('0x15'),JSON[_0xa7d3('0x18')](_0x5899d9));if(_0x5899d9[_0xa7d3('0x19')]){if(_0x5899d9[_0xa7d3('0x19')][_0xa7d3('0x1a')]===0x1f4){logger[_0xa7d3('0x19')](_0xa7d3('0x14'),_0x2470d3,_0x5899d9[_0xa7d3('0x19')][_0xa7d3('0x1b')]);return _0x2527e9(_0x5899d9[_0xa7d3('0x19')]['message']);}logger['error']('ChatMessage,\x20%s,\x20%s',_0x2470d3,_0x5899d9[_0xa7d3('0x19')][_0xa7d3('0x1b')]);return _0x5a4903(_0x5899d9['error'][_0xa7d3('0x1b')]);}else{logger[_0xa7d3('0x13')](_0xa7d3('0x14'),_0x2470d3,_0xa7d3('0x15'));_0x5a4903(_0x5899d9[_0xa7d3('0x1c')][_0xa7d3('0x1b')]);}})[_0xa7d3('0x1d')](function(_0x44f664){logger[_0xa7d3('0x19')](_0xa7d3('0x14'),_0x2470d3,_0x44f664);_0x2527e9(_0x44f664);});});}exports['CreateChatMessage']=function(_0x25236d){var _0x15eb02=this;return new Promise(function(_0x3b6590,_0x421ce4){return db['ChatMessage'][_0xa7d3('0x1e')](_0x25236d[_0xa7d3('0x1f')],{'raw':_0x25236d[_0xa7d3('0x20')]?_0x25236d[_0xa7d3('0x20')]['raw']===undefined?!![]:![]:!![]})[_0xa7d3('0x12')](function(_0x123cc4){logger[_0xa7d3('0x13')](_0xa7d3('0x21'),_0x25236d);logger[_0xa7d3('0x16')](_0xa7d3('0x21'),_0x25236d,JSON[_0xa7d3('0x18')](_0x123cc4));_0x3b6590(_0x123cc4);})[_0xa7d3('0x1d')](function(_0x5b26b7){logger[_0xa7d3('0x19')](_0xa7d3('0x21'),_0x5b26b7[_0xa7d3('0x1b')],_0x25236d);_0x421ce4(_0x15eb02[_0xa7d3('0x19')](0x1f4,_0x5b26b7['message']));});});};
\ No newline at end of file
+var _0xec28=['CreateChatMessage','ChatMessage','create','body','options','raw','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','request','then','info','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','ChatMessage,\x20%s,\x20%s','catch'];(function(_0x4e7c73,_0x44dc00){var _0x3da080=function(_0x587a6b){while(--_0x587a6b){_0x4e7c73['push'](_0x4e7c73['shift']());}};_0x3da080(++_0x44dc00);}(_0xec28,0x14a));var _0x8ec2=function(_0x5ac791,_0x504d37){_0x5ac791=_0x5ac791-0x0;var _0x9e3a19=_0xec28[_0x5ac791];return _0x9e3a19;};'use strict';var _=require(_0x8ec2('0x0'));var util=require(_0x8ec2('0x1'));var moment=require('moment');var BPromise=require(_0x8ec2('0x2'));var rs=require(_0x8ec2('0x3'));var fs=require('fs');var Redis=require(_0x8ec2('0x4'));var db=require(_0x8ec2('0x5'))['db'];var utils=require(_0x8ec2('0x6'));var logger=require(_0x8ec2('0x7'))(_0x8ec2('0x8'));var config=require(_0x8ec2('0x9'));var jayson=require(_0x8ec2('0xa'));var client=jayson[_0x8ec2('0xb')][_0x8ec2('0xc')]({'port':0x232a});config[_0x8ec2('0xd')]=_[_0x8ec2('0xe')](config[_0x8ec2('0xd')],{'host':_0x8ec2('0xf'),'port':0x18eb});var socket=require(_0x8ec2('0x10'))(new Redis(config[_0x8ec2('0xd')]));require(_0x8ec2('0x11'))[_0x8ec2('0x12')](socket);function respondWithRpcPromise(_0x51fd43,_0x437b3e,_0x4cb148){return new BPromise(function(_0x179825,_0x3b02ce){return client[_0x8ec2('0x13')](_0x51fd43,_0x4cb148)[_0x8ec2('0x14')](function(_0x34c39e){logger[_0x8ec2('0x15')]('ChatMessage,\x20%s,\x20%s',_0x437b3e,_0x8ec2('0x16'));logger[_0x8ec2('0x17')](_0x8ec2('0x18'),_0x437b3e,_0x8ec2('0x16'),JSON[_0x8ec2('0x19')](_0x34c39e));if(_0x34c39e[_0x8ec2('0x1a')]){if(_0x34c39e['error']['code']===0x1f4){logger[_0x8ec2('0x1a')]('ChatMessage,\x20%s,\x20%s',_0x437b3e,_0x34c39e[_0x8ec2('0x1a')]['message']);return _0x3b02ce(_0x34c39e[_0x8ec2('0x1a')][_0x8ec2('0x1b')]);}logger[_0x8ec2('0x1a')](_0x8ec2('0x1c'),_0x437b3e,_0x34c39e['error'][_0x8ec2('0x1b')]);return _0x179825(_0x34c39e[_0x8ec2('0x1a')][_0x8ec2('0x1b')]);}else{logger[_0x8ec2('0x15')](_0x8ec2('0x1c'),_0x437b3e,'request\x20sent');_0x179825(_0x34c39e['result'][_0x8ec2('0x1b')]);}})[_0x8ec2('0x1d')](function(_0x4cc094){logger[_0x8ec2('0x1a')](_0x8ec2('0x1c'),_0x437b3e,_0x4cc094);_0x3b02ce(_0x4cc094);});});}exports[_0x8ec2('0x1e')]=function(_0x1e7381){var _0xc922cf=this;return new Promise(function(_0x148367,_0x5ed09a){return db[_0x8ec2('0x1f')][_0x8ec2('0x20')](_0x1e7381[_0x8ec2('0x21')],{'raw':_0x1e7381[_0x8ec2('0x22')]?_0x1e7381[_0x8ec2('0x22')][_0x8ec2('0x23')]===undefined?!![]:![]:!![]})[_0x8ec2('0x14')](function(_0x87ac84){logger['info'](_0x8ec2('0x1e'),_0x1e7381);logger[_0x8ec2('0x17')](_0x8ec2('0x1e'),_0x1e7381,JSON[_0x8ec2('0x19')](_0x87ac84));_0x148367(_0x87ac84);})[_0x8ec2('0x1d')](function(_0x4d72b3){logger[_0x8ec2('0x1a')](_0x8ec2('0x1e'),_0x4d72b3[_0x8ec2('0x1b')],_0x1e7381);_0x5ed09a(_0xc922cf[_0x8ec2('0x1a')](0x1f4,_0x4d72b3[_0x8ec2('0x1b')]));});});};
\ No newline at end of file
index 6c3e619..7bbff99 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x38d3=['save','update','emit','removeListener','register','length','chatMessage:','./chatMessage.events'];(function(_0xf0bcac,_0x531755){var _0x4e4c65=function(_0x35a77a){while(--_0x35a77a){_0xf0bcac['push'](_0xf0bcac['shift']());}};_0x4e4c65(++_0x531755);}(_0x38d3,0x1a7));var _0x338d=function(_0x42f009,_0x5e27b1){_0x42f009=_0x42f009-0x0;var _0x22a1e0=_0x38d3[_0x42f009];return _0x22a1e0;};'use strict';var ChatMessageEvents=require(_0x338d('0x0'));var events=[_0x338d('0x1'),'remove',_0x338d('0x2')];function createListener(_0x338ef5,_0x22c076){return function(_0x43ebf7){_0x22c076[_0x338d('0x3')](_0x338ef5,_0x43ebf7);};}function removeListener(_0x1c47c6,_0x2b867){return function(){ChatMessageEvents[_0x338d('0x4')](_0x1c47c6,_0x2b867);};}exports[_0x338d('0x5')]=function(_0x4e32b4){for(var _0x2a056d=0x0,_0x2012c3=events[_0x338d('0x6')];_0x2a056d<_0x2012c3;_0x2a056d++){var _0x2b7aab=events[_0x2a056d];var _0x60eaa1=createListener(_0x338d('0x7')+_0x2b7aab,_0x4e32b4);ChatMessageEvents['on'](_0x2b7aab,_0x60eaa1);}};
\ No newline at end of file
+var _0x2975=['update','removeListener','register','length','chatMessage:','save','remove'];(function(_0x667ff8,_0x59e7df){var _0x2ddfc7=function(_0x5a4a46){while(--_0x5a4a46){_0x667ff8['push'](_0x667ff8['shift']());}};_0x2ddfc7(++_0x59e7df);}(_0x2975,0x1c5));var _0x5297=function(_0x382609,_0x1d2fa2){_0x382609=_0x382609-0x0;var _0x5a6ae5=_0x2975[_0x382609];return _0x5a6ae5;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0x5297('0x0'),_0x5297('0x1'),_0x5297('0x2')];function createListener(_0x1a511b,_0x115e60){return function(_0x178801){_0x115e60['emit'](_0x1a511b,_0x178801);};}function removeListener(_0x56371f,_0x5e9de3){return function(){ChatMessageEvents[_0x5297('0x3')](_0x56371f,_0x5e9de3);};}exports[_0x5297('0x4')]=function(_0x11a43d){for(var _0x3da9c6=0x0,_0x4d1d2c=events[_0x5297('0x5')];_0x3da9c6<_0x4d1d2c;_0x3da9c6++){var _0x1b72a7=events[_0x3da9c6];var _0x4f12b0=createListener(_0x5297('0x6')+_0x1b72a7,_0x11a43d);ChatMessageEvents['on'](_0x1b72a7,_0x4f12b0);}};
\ No newline at end of file
index 2663ffe..8f8ec4c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf7b4=['../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','isAuthenticated','index','get','show','post','tracked','chat','put','/:id','update','/:id/accept','accept','/:id/reject','delete','destroy','exports','multer','util','path','express','fs-extra'];(function(_0x1ab82e,_0x4c95e2){var _0x37acd2=function(_0x54dd37){while(--_0x54dd37){_0x1ab82e['push'](_0x1ab82e['shift']());}};_0x37acd2(++_0x4c95e2);}(_0xf7b4,0x1ef));var _0x4f7b=function(_0x4452ea,_0x305536){_0x4452ea=_0x4452ea-0x0;var _0x49e391=_0xf7b4[_0x4452ea];return _0x49e391;};'use strict';var multer=require(_0x4f7b('0x0'));var util=require(_0x4f7b('0x1'));var path=require(_0x4f7b('0x2'));var timeout=require('connect-timeout');var express=require(_0x4f7b('0x3'));var router=express['Router']();var fs_extra=require(_0x4f7b('0x4'));var auth=require(_0x4f7b('0x5'));var interaction=require(_0x4f7b('0x6'));var config=require(_0x4f7b('0x7'));var controller=require(_0x4f7b('0x8'));router['get']('/',auth[_0x4f7b('0x9')](),controller[_0x4f7b('0xa')]);router[_0x4f7b('0xb')]('/describe',auth[_0x4f7b('0x9')](),controller['describe']);router[_0x4f7b('0xb')]('/:id',auth[_0x4f7b('0x9')](),controller[_0x4f7b('0xc')]);router[_0x4f7b('0xd')]('/',auth['isAuthenticated'](),interaction[_0x4f7b('0xe')](_0x4f7b('0xf'),'chatmessage:create'),controller['create']);router[_0x4f7b('0x10')](_0x4f7b('0x11'),controller[_0x4f7b('0x12')]);router[_0x4f7b('0x10')](_0x4f7b('0x13'),auth[_0x4f7b('0x9')](),controller[_0x4f7b('0x14')]);router[_0x4f7b('0x10')](_0x4f7b('0x15'),auth[_0x4f7b('0x9')](),controller['reject']);router[_0x4f7b('0x16')](_0x4f7b('0x11'),auth[_0x4f7b('0x9')](),controller[_0x4f7b('0x17')]);module[_0x4f7b('0x18')]=router;
\ No newline at end of file
+var _0x8f15=['destroy','exports','multer','util','path','express','../../components/interaction/service','./chatMessage.controller','get','isAuthenticated','index','/describe','describe','show','tracked','chatmessage:create','put','/:id','update','/:id/accept','accept'];(function(_0x5b54c8,_0x952a7){var _0x50339a=function(_0x3b04d7){while(--_0x3b04d7){_0x5b54c8['push'](_0x5b54c8['shift']());}};_0x50339a(++_0x952a7);}(_0x8f15,0xd4));var _0x58f1=function(_0x36a92a,_0x519210){_0x36a92a=_0x36a92a-0x0;var _0x539e72=_0x8f15[_0x36a92a];return _0x539e72;};'use strict';var multer=require(_0x58f1('0x0'));var util=require(_0x58f1('0x1'));var path=require(_0x58f1('0x2'));var timeout=require('connect-timeout');var express=require(_0x58f1('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x58f1('0x4'));var config=require('../../config/environment');var controller=require(_0x58f1('0x5'));router[_0x58f1('0x6')]('/',auth[_0x58f1('0x7')](),controller[_0x58f1('0x8')]);router[_0x58f1('0x6')](_0x58f1('0x9'),auth['isAuthenticated'](),controller[_0x58f1('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x58f1('0xb')]);router['post']('/',auth[_0x58f1('0x7')](),interaction[_0x58f1('0xc')]('chat',_0x58f1('0xd')),controller['create']);router[_0x58f1('0xe')](_0x58f1('0xf'),controller[_0x58f1('0x10')]);router[_0x58f1('0xe')](_0x58f1('0x11'),auth['isAuthenticated'](),controller[_0x58f1('0x12')]);router[_0x58f1('0xe')]('/:id/reject',auth[_0x58f1('0x7')](),controller['reject']);router['delete'](_0x58f1('0xf'),auth['isAuthenticated'](),controller[_0x58f1('0x13')]);module[_0x58f1('0x14')]=router;
\ No newline at end of file
index b983fa0..c1ab779 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0b0e=['medium','sequelize','TEXT'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x0b0e,0x187));var _0xe0b0=function(_0x248fc8,_0x121ebf){_0x248fc8=_0x248fc8-0x0;var _0x1ec5d1=_0x0b0e[_0x248fc8];return _0x1ec5d1;};'use strict';var Sequelize=require(_0xe0b0('0x0'));module['exports']={'body':{'type':Sequelize[_0xe0b0('0x1')]('medium'),'allowNull':![]},'plainBody':{'type':Sequelize[_0xe0b0('0x1')](_0xe0b0('0x2')),'allowNull':![]}};
\ No newline at end of file
+var _0xadb5=['medium','TEXT','exports'];(function(_0x2681de,_0x2f0760){var _0x565a4b=function(_0x126b4b){while(--_0x126b4b){_0x2681de['push'](_0x2681de['shift']());}};_0x565a4b(++_0x2f0760);}(_0xadb5,0xad));var _0x5adb=function(_0x49ca88,_0x4a5082){_0x49ca88=_0x49ca88-0x0;var _0x16f46d=_0xadb5[_0x49ca88];return _0x16f46d;};'use strict';var Sequelize=require('sequelize');module[_0x5adb('0x0')]={'body':{'type':Sequelize['TEXT'](_0x5adb('0x1')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x5adb('0x2')](_0x5adb('0x1')),'allowNull':![]}};
\ No newline at end of file
index 0d1b5ca..094e011 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x424a9a,_0x2dd9af){var _0xa7831c=function(_0x512534){while(--_0x512534){_0x424a9a['push'](_0x424a9a['shift']());}};_0xa7831c(++_0x2dd9af);}(_0x7a54,0x106));var _0x47a5=function(_0x5e1aac,_0x54d27b){_0x5e1aac=_0x5e1aac-0x0;var _0x573143=_0x7a54[_0x5e1aac];return _0x573143;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));};
\ No newline at end of file
+var _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(_0x424a9a,_0x2dd9af){var _0xa7831c=function(_0x512534){while(--_0x512534){_0x424a9a['push'](_0x424a9a['shift']());}};_0xa7831c(++_0x2dd9af);}(_0x7a54,0x106));var _0x47a5=function(_0x21d0c4,_0x1798cb){_0x21d0c4=_0x21d0c4-0x0;var _0x4a7389=_0x7a54[_0x21d0c4];return _0x4a7389;};'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 6276699..5ba2c23 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7b27=['ChatOfflineMessage','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x3be115,_0x28b2c3){var _0x2d9bed=function(_0x2075b5){while(--_0x2075b5){_0x3be115['push'](_0x3be115['shift']());}};_0x2d9bed(++_0x28b2c3);}(_0x7b27,0x12a));var _0x77b2=function(_0x33055c,_0xa858b5){_0x33055c=_0x33055c-0x0;var _0x27d777=_0x7b27[_0x33055c];return _0x27d777;};'use strict';var EventEmitter=require(_0x77b2('0x0'));var ChatOfflineMessage=require(_0x77b2('0x1'))['db'][_0x77b2('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x77b2('0x3'),'afterUpdate':_0x77b2('0x4'),'afterDestroy':_0x77b2('0x5')};function emitEvent(_0x550126){return function(_0x490fd8,_0x504e3e,_0x4222a0){ChatOfflineMessageEvents['emit'](_0x550126+':'+_0x490fd8['id'],_0x490fd8);ChatOfflineMessageEvents[_0x77b2('0x6')](_0x550126,_0x490fd8);_0x4222a0(null);};}for(var e in events){if(events[_0x77b2('0x7')](e)){var event=events[e];ChatOfflineMessage[_0x77b2('0x8')](e,emitEvent(event));}}module[_0x77b2('0x9')]=ChatOfflineMessageEvents;
\ No newline at end of file
+var _0x6217=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatOfflineMessage','setMaxListeners','save','update','remove'];(function(_0x52e66b,_0x1413cf){var _0x3dc151=function(_0x566945){while(--_0x566945){_0x52e66b['push'](_0x52e66b['shift']());}};_0x3dc151(++_0x1413cf);}(_0x6217,0x1bc));var _0x7621=function(_0xa990b7,_0x26c527){_0xa990b7=_0xa990b7-0x0;var _0x52c99c=_0x6217[_0xa990b7];return _0x52c99c;};'use strict';var EventEmitter=require(_0x7621('0x0'));var ChatOfflineMessage=require(_0x7621('0x1'))['db'][_0x7621('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x7621('0x3')](0x0);var events={'afterCreate':_0x7621('0x4'),'afterUpdate':_0x7621('0x5'),'afterDestroy':_0x7621('0x6')};function emitEvent(_0x5051bc){return function(_0x4c36b9,_0x3fc5be,_0x21a300){ChatOfflineMessageEvents[_0x7621('0x7')](_0x5051bc+':'+_0x4c36b9['id'],_0x4c36b9);ChatOfflineMessageEvents[_0x7621('0x7')](_0x5051bc,_0x4c36b9);_0x21a300(null);};}for(var e in events){if(events[_0x7621('0x8')](e)){var event=events[e];ChatOfflineMessage[_0x7621('0x9')](e,emitEvent(event));}}module[_0x7621('0xa')]=ChatOfflineMessageEvents;
\ No newline at end of file
index 89da61a..4e30152 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3a8d=['ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','./chatOfflineMessage.attributes','exports'];(function(_0x5ef161,_0x27d16c){var _0x1c6e9e=function(_0x8fc2a6){while(--_0x8fc2a6){_0x5ef161['push'](_0x5ef161['shift']());}};_0x1c6e9e(++_0x27d16c);}(_0x3a8d,0x16c));var _0xd3a8=function(_0x127a60,_0x37f33a){_0x127a60=_0x127a60-0x0;var _0xc1f6a3=_0x3a8d[_0x127a60];return _0xc1f6a3;};'use strict';var attributes=require(_0xd3a8('0x0'));module[_0xd3a8('0x1')]=function(_0x51ebe7){return _0x51ebe7['define'](_0xd3a8('0x2'),attributes,{'tableName':_0xd3a8('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd3a8('0x4'),'collate':_0xd3a8('0x5')});};
\ No newline at end of file
+var _0x8f57=['define','chat_offline_messages','utf8mb4','./chatOfflineMessage.attributes','exports'];(function(_0x4ba160,_0x249ba7){var _0x57196b=function(_0x364b5b){while(--_0x364b5b){_0x4ba160['push'](_0x4ba160['shift']());}};_0x57196b(++_0x249ba7);}(_0x8f57,0xa8));var _0x78f5=function(_0x4bcbc2,_0x46cbff){_0x4bcbc2=_0x4bcbc2-0x0;var _0xe5b888=_0x8f57[_0x4bcbc2];return _0xe5b888;};'use strict';var attributes=require(_0x78f5('0x0'));module[_0x78f5('0x1')]=function(_0x41c1a5){return _0x41c1a5[_0x78f5('0x2')]('ChatOfflineMessage',attributes,{'tableName':_0x78f5('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x78f5('0x4'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
index 7fadccb..5a270d2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcfa1=['catch','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcfa1,0xbe));var _0x1cfa=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcfa1[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x1cfa('0x0'));var util=require('util');var moment=require(_0x1cfa('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1cfa('0x2'));var db=require(_0x1cfa('0x3'))['db'];var utils=require(_0x1cfa('0x4'));var logger=require(_0x1cfa('0x5'))(_0x1cfa('0x6'));var config=require('../../config/environment');var jayson=require(_0x1cfa('0x7'));var client=jayson[_0x1cfa('0x8')][_0x1cfa('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5b62b7,_0x574566,_0x596bd9){return new BPromise(function(_0x2c60b2,_0x47b83b){return client[_0x1cfa('0xa')](_0x5b62b7,_0x596bd9)[_0x1cfa('0xb')](function(_0x450def){logger['info'](_0x1cfa('0xc'),_0x574566,'request\x20sent');logger['debug']('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x574566,_0x1cfa('0xd'),JSON[_0x1cfa('0xe')](_0x450def));if(_0x450def[_0x1cfa('0xf')]){if(_0x450def[_0x1cfa('0xf')][_0x1cfa('0x10')]===0x1f4){logger['error'](_0x1cfa('0xc'),_0x574566,_0x450def[_0x1cfa('0xf')][_0x1cfa('0x11')]);return _0x47b83b(_0x450def[_0x1cfa('0xf')][_0x1cfa('0x11')]);}logger[_0x1cfa('0xf')](_0x1cfa('0xc'),_0x574566,_0x450def[_0x1cfa('0xf')][_0x1cfa('0x11')]);return _0x2c60b2(_0x450def['error']['message']);}else{logger[_0x1cfa('0x12')](_0x1cfa('0xc'),_0x574566,'request\x20sent');_0x2c60b2(_0x450def[_0x1cfa('0x13')][_0x1cfa('0x11')]);}})[_0x1cfa('0x14')](function(_0x4a7701){logger[_0x1cfa('0xf')](_0x1cfa('0xc'),_0x574566,_0x4a7701);_0x47b83b(_0x4a7701);});});}
\ No newline at end of file
+var _0xa0d6=['message','result','lodash','util','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code'];(function(_0x416939,_0x5e8347){var _0x10b649=function(_0xaf7094){while(--_0xaf7094){_0x416939['push'](_0x416939['shift']());}};_0x10b649(++_0x5e8347);}(_0xa0d6,0x1f0));var _0x6a0d=function(_0x1e5ad6,_0x34417a){_0x1e5ad6=_0x1e5ad6-0x0;var _0x5bc0d3=_0xa0d6[_0x1e5ad6];return _0x5bc0d3;};'use strict';var _=require(_0x6a0d('0x0'));var util=require(_0x6a0d('0x1'));var moment=require('moment');var BPromise=require(_0x6a0d('0x2'));var rs=require(_0x6a0d('0x3'));var fs=require('fs');var Redis=require(_0x6a0d('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x6a0d('0x5'));var config=require(_0x6a0d('0x6'));var jayson=require(_0x6a0d('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x172d9a,_0x53d72d,_0x123a87){return new BPromise(function(_0x1f7595,_0x205615){return client[_0x6a0d('0x8')](_0x172d9a,_0x123a87)[_0x6a0d('0x9')](function(_0x39aa65){logger[_0x6a0d('0xa')](_0x6a0d('0xb'),_0x53d72d,'request\x20sent');logger[_0x6a0d('0xc')](_0x6a0d('0xd'),_0x53d72d,_0x6a0d('0xe'),JSON['stringify'](_0x39aa65));if(_0x39aa65['error']){if(_0x39aa65[_0x6a0d('0xf')][_0x6a0d('0x10')]===0x1f4){logger[_0x6a0d('0xf')](_0x6a0d('0xb'),_0x53d72d,_0x39aa65['error'][_0x6a0d('0x11')]);return _0x205615(_0x39aa65[_0x6a0d('0xf')][_0x6a0d('0x11')]);}logger[_0x6a0d('0xf')](_0x6a0d('0xb'),_0x53d72d,_0x39aa65[_0x6a0d('0xf')][_0x6a0d('0x11')]);return _0x1f7595(_0x39aa65['error'][_0x6a0d('0x11')]);}else{logger['info'](_0x6a0d('0xb'),_0x53d72d,'request\x20sent');_0x1f7595(_0x39aa65[_0x6a0d('0x12')][_0x6a0d('0x11')]);}})['catch'](function(_0x5f5d6d){logger[_0x6a0d('0xf')](_0x6a0d('0xb'),_0x53d72d,_0x5f5d6d);_0x205615(_0x5f5d6d);});});}
\ No newline at end of file
index d852c43..2129bb0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc142=['util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatOfflineMessage.controller','get','isAuthenticated','index','/describe','describe','post','create','/:id','delete','exports'];(function(_0x172df9,_0x2c9c2f){var _0x5d5ad1=function(_0x4f14f5){while(--_0x4f14f5){_0x172df9['push'](_0x172df9['shift']());}};_0x5d5ad1(++_0x2c9c2f);}(_0xc142,0x10e));var _0x2c14=function(_0x11ce46,_0x177a85){_0x11ce46=_0x11ce46-0x0;var _0x368a1e=_0xc142[_0x11ce46];return _0x368a1e;};'use strict';var multer=require('multer');var util=require(_0x2c14('0x0'));var path=require(_0x2c14('0x1'));var timeout=require('connect-timeout');var express=require(_0x2c14('0x2'));var router=express[_0x2c14('0x3')]();var fs_extra=require(_0x2c14('0x4'));var auth=require(_0x2c14('0x5'));var interaction=require(_0x2c14('0x6'));var config=require('../../config/environment');var controller=require(_0x2c14('0x7'));router[_0x2c14('0x8')]('/',auth[_0x2c14('0x9')](),controller[_0x2c14('0xa')]);router[_0x2c14('0x8')](_0x2c14('0xb'),auth[_0x2c14('0x9')](),controller[_0x2c14('0xc')]);router[_0x2c14('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x2c14('0xd')]('/',auth[_0x2c14('0x9')](),controller[_0x2c14('0xe')]);router['put'](_0x2c14('0xf'),auth['isAuthenticated'](),controller['update']);router[_0x2c14('0x10')](_0x2c14('0xf'),auth[_0x2c14('0x9')](),controller['destroy']);module[_0x2c14('0x11')]=router;
\ No newline at end of file
+var _0xb406=['../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xb406,0x197));var _0x6b40=function(_0xb20e64,_0x5cd27d){_0xb20e64=_0xb20e64-0x0;var _0x5efca5=_0xb406[_0xb20e64];return _0x5efca5;};'use strict';var multer=require(_0x6b40('0x0'));var util=require('util');var path=require(_0x6b40('0x1'));var timeout=require(_0x6b40('0x2'));var express=require(_0x6b40('0x3'));var router=express[_0x6b40('0x4')]();var fs_extra=require(_0x6b40('0x5'));var auth=require(_0x6b40('0x6'));var interaction=require(_0x6b40('0x7'));var config=require(_0x6b40('0x8'));var controller=require(_0x6b40('0x9'));router[_0x6b40('0xa')]('/',auth[_0x6b40('0xb')](),controller[_0x6b40('0xc')]);router[_0x6b40('0xa')](_0x6b40('0xd'),auth['isAuthenticated'](),controller[_0x6b40('0xe')]);router['get'](_0x6b40('0xf'),auth[_0x6b40('0xb')](),controller[_0x6b40('0x10')]);router[_0x6b40('0x11')]('/',auth[_0x6b40('0xb')](),controller[_0x6b40('0x12')]);router['put']('/:id',auth[_0x6b40('0xb')](),controller[_0x6b40('0x13')]);router[_0x6b40('0x14')]('/:id',auth[_0x6b40('0xb')](),controller[_0x6b40('0x15')]);module[_0x6b40('0x16')]=router;
\ No newline at end of file
index 6844103..7fd7017 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x58b7=['INTEGER','sequelize','exports','STRING','mouseOver'];(function(_0x1c3ae6,_0x1385bb){var _0x54811c=function(_0x183950){while(--_0x183950){_0x1c3ae6['push'](_0x1c3ae6['shift']());}};_0x54811c(++_0x1385bb);}(_0x58b7,0xb0));var _0x758b=function(_0x1549dc,_0x371c41){_0x1549dc=_0x1549dc-0x0;var _0x39beb8=_0x58b7[_0x1549dc];return _0x39beb8;};'use strict';var Sequelize=require(_0x758b('0x0'));module[_0x758b('0x1')]={'name':{'type':Sequelize[_0x758b('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x758b('0x3'),'timeout'),'defaultValue':'mouseOver'},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x758b('0x4')]}};
\ No newline at end of file
+var _0x280a=['ENUM','mouseOver','timeout','sequelize','exports','STRING'];(function(_0x29be47,_0xf5e31b){var _0x595d1b=function(_0x343b49){while(--_0x343b49){_0x29be47['push'](_0x29be47['shift']());}};_0x595d1b(++_0xf5e31b);}(_0x280a,0xab));var _0xa280=function(_0x92724b,_0x18e7d6){_0x92724b=_0x92724b-0x0;var _0x12e4f5=_0x280a[_0x92724b];return _0x12e4f5;};'use strict';var Sequelize=require(_0xa280('0x0'));module[_0xa280('0x1')]={'name':{'type':Sequelize[_0xa280('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xa280('0x3')](_0xa280('0x4'),_0xa280('0x5')),'defaultValue':_0xa280('0x4')},'selector':{'type':Sequelize[_0xa280('0x2')]},'timeout':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
index e85ebc8..ced2eb3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x032e=['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','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','error','name','send','params','rawAttributes','query','keys','intersection','model','attributes','fields','length','includeAll','merge','ChatProactiveAction','find','catch','create','body','destroy','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox'];(function(_0x4e5650,_0x2bf847){var _0x1e096c=function(_0x169928){while(--_0x169928){_0x4e5650['push'](_0x4e5650['shift']());}};_0x1e096c(++_0x2bf847);}(_0x032e,0x124));var _0xe032=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0x032e[_0x3054be];return _0x3df150;};'use strict';var emlformat=require(_0xe032('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe032('0x1'));var jsonpatch=require(_0xe032('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xe032('0x3'));var Mustache=require(_0xe032('0x4'));var util=require(_0xe032('0x5'));var path=require(_0xe032('0x6'));var sox=require(_0xe032('0x7'));var csv=require(_0xe032('0x8'));var ejs=require(_0xe032('0x9'));var fs=require('fs');var fs_extra=require(_0xe032('0xa'));var _=require(_0xe032('0xb'));var squel=require(_0xe032('0xc'));var crypto=require(_0xe032('0xd'));var jsforce=require(_0xe032('0xe'));var deskjs=require(_0xe032('0xf'));var toCsv=require(_0xe032('0x8'));var querystring=require(_0xe032('0x10'));var Papa=require(_0xe032('0x11'));var Redis=require(_0xe032('0x12'));var authService=require(_0xe032('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xe032('0x14'));var hardwareService=require(_0xe032('0x15'));var logger=require(_0xe032('0x16'))(_0xe032('0x17'));var utils=require(_0xe032('0x18'));var config=require(_0xe032('0x19'));var licenseUtil=require(_0xe032('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x646979,_0x266d71){_0x266d71=_0x266d71||0xcc;return function(_0x28c2b6){if(_0x28c2b6){return _0x646979[_0xe032('0x1b')](_0x266d71);}return _0x646979['status'](_0x266d71)[_0xe032('0x1c')]();};}function respondWithResult(_0x2e267b,_0x176547){_0x176547=_0x176547||0xc8;return function(_0x422e96){if(_0x422e96){return _0x2e267b[_0xe032('0x1d')](_0x176547)[_0xe032('0x1e')](_0x422e96);}};}function respondWithFilteredResult(_0x2bf528,_0x4da5b7){return function(_0x231c35){if(_0x231c35){var _0x749018=typeof _0x4da5b7[_0xe032('0x1f')]===_0xe032('0x20')&&typeof _0x4da5b7[_0xe032('0x21')]===_0xe032('0x20');var _0x4cdab3=_0x231c35[_0xe032('0x22')];var _0x25cedb=_0x749018?0x0:_0x4da5b7[_0xe032('0x1f')];var _0x41d2a5=_0x749018?_0x231c35[_0xe032('0x22')]:_0x4da5b7['offset']+_0x4da5b7['limit'];var _0x484e6c;if(_0x41d2a5>=_0x4cdab3){_0x41d2a5=_0x4cdab3;_0x484e6c=0xc8;}else{_0x484e6c=0xce;}_0x2bf528[_0xe032('0x1d')](_0x484e6c);return _0x2bf528['set'](_0xe032('0x23'),_0x25cedb+'-'+_0x41d2a5+'/'+_0x4cdab3)[_0xe032('0x1e')](_0x231c35);}return null;};}function patchUpdates(_0x3f0257){return function(_0x2aa342){try{jsonpatch[_0xe032('0x24')](_0x2aa342,_0x3f0257,!![]);}catch(_0x256f71){return BPromise[_0xe032('0x25')](_0x256f71);}return _0x2aa342['save']();};}function saveUpdates(_0x32f8b6,_0x866c81){return function(_0x232e8f){if(_0x232e8f){return _0x232e8f[_0xe032('0x26')](_0x32f8b6)[_0xe032('0x27')](function(_0x33d89a){return _0x33d89a;});}return null;};}function removeEntity(_0x22831a,_0xe89aa7){return function(_0x499da5){if(_0x499da5){return _0x499da5['destroy']()['then'](function(){_0x22831a[_0xe032('0x1d')](0xcc)[_0xe032('0x1c')]();});}};}function handleEntityNotFound(_0x302559,_0x2a56e5){return function(_0x2bfe8f){if(!_0x2bfe8f){_0x302559[_0xe032('0x1b')](0x194);}return _0x2bfe8f;};}function handleError(_0x36ece7,_0x2b6ffa){_0x2b6ffa=_0x2b6ffa||0x1f4;return function(_0x4dcbf1){logger[_0xe032('0x28')](_0x4dcbf1['stack']);if(_0x4dcbf1[_0xe032('0x29')]){delete _0x4dcbf1[_0xe032('0x29')];}_0x36ece7[_0xe032('0x1d')](_0x2b6ffa)[_0xe032('0x2a')](_0x4dcbf1);};}exports['show']=function(_0x5573e4,_0x3e2575){var _0x38e7ea={'raw':!![],'where':{'id':_0x5573e4[_0xe032('0x2b')]['id']}},_0x469290={};_0x469290['model']=_['keys'](db['ChatProactiveAction'][_0xe032('0x2c')]);_0x469290[_0xe032('0x2d')]=_[_0xe032('0x2e')](_0x5573e4[_0xe032('0x2d')]);_0x469290['filters']=_[_0xe032('0x2f')](_0x469290[_0xe032('0x30')],_0x469290[_0xe032('0x2d')]);_0x38e7ea[_0xe032('0x31')]=_[_0xe032('0x2f')](_0x469290['model'],qs[_0xe032('0x32')](_0x5573e4[_0xe032('0x2d')][_0xe032('0x32')]));_0x38e7ea[_0xe032('0x31')]=_0x38e7ea['attributes'][_0xe032('0x33')]?_0x38e7ea['attributes']:_0x469290[_0xe032('0x30')];if(_0x5573e4['query'][_0xe032('0x34')]){_0x38e7ea['include']=[{'all':!![]}];}_0x38e7ea=_[_0xe032('0x35')]({},_0x38e7ea,_0x5573e4['options']);return db[_0xe032('0x36')][_0xe032('0x37')](_0x38e7ea)['then'](handleEntityNotFound(_0x3e2575,null))[_0xe032('0x27')](respondWithResult(_0x3e2575,null))[_0xe032('0x38')](handleError(_0x3e2575,null));};exports[_0xe032('0x39')]=function(_0x2620d2,_0x4e222c){return db[_0xe032('0x36')]['create'](_0x2620d2[_0xe032('0x3a')],{})[_0xe032('0x27')](respondWithResult(_0x4e222c,0xc9))['catch'](handleError(_0x4e222c,null));};exports[_0xe032('0x26')]=function(_0x23b790,_0x4a4447){if(_0x23b790[_0xe032('0x3a')]['id']){delete _0x23b790[_0xe032('0x3a')]['id'];}return db[_0xe032('0x36')][_0xe032('0x37')]({'where':{'id':_0x23b790[_0xe032('0x2b')]['id']}})[_0xe032('0x27')](handleEntityNotFound(_0x4a4447,null))[_0xe032('0x27')](saveUpdates(_0x23b790[_0xe032('0x3a')],null))[_0xe032('0x27')](respondWithResult(_0x4a4447,null))[_0xe032('0x38')](handleError(_0x4a4447,null));};exports[_0xe032('0x3b')]=function(_0x432d39,_0x30571c){return db[_0xe032('0x36')][_0xe032('0x37')]({'where':{'id':_0x432d39[_0xe032('0x2b')]['id']}})[_0xe032('0x27')](handleEntityNotFound(_0x30571c,null))['then'](removeEntity(_0x30571c,null))[_0xe032('0x38')](handleError(_0x30571c,null));};
\ No newline at end of file
+var _0x8781=['limit','count','Content-Range','apply','reject','update','then','destroy','end','error','stack','name','send','show','model','keys','query','filters','intersection','attributes','fields','includeAll','include','find','catch','ChatProactiveAction','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','json','offset','undefined'];(function(_0x3342ee,_0x2dd43e){var _0x11d861=function(_0x3e64b0){while(--_0x3e64b0){_0x3342ee['push'](_0x3342ee['shift']());}};_0x11d861(++_0x2dd43e);}(_0x8781,0x1c8));var _0x1878=function(_0x24b55c,_0x163e62){_0x24b55c=_0x24b55c-0x0;var _0x1f034e=_0x8781[_0x24b55c];return _0x1f034e;};'use strict';var emlformat=require(_0x1878('0x0'));var rimraf=require(_0x1878('0x1'));var zipdir=require(_0x1878('0x2'));var jsonpatch=require(_0x1878('0x3'));var rp=require(_0x1878('0x4'));var moment=require(_0x1878('0x5'));var BPromise=require(_0x1878('0x6'));var Mustache=require('mustache');var util=require(_0x1878('0x7'));var path=require(_0x1878('0x8'));var sox=require(_0x1878('0x9'));var csv=require(_0x1878('0xa'));var ejs=require(_0x1878('0xb'));var fs=require('fs');var fs_extra=require(_0x1878('0xc'));var _=require('lodash');var squel=require(_0x1878('0xd'));var crypto=require(_0x1878('0xe'));var jsforce=require(_0x1878('0xf'));var deskjs=require(_0x1878('0x10'));var toCsv=require(_0x1878('0xa'));var querystring=require(_0x1878('0x11'));var Papa=require(_0x1878('0x12'));var Redis=require(_0x1878('0x13'));var authService=require(_0x1878('0x14'));var qs=require(_0x1878('0x15'));var as=require(_0x1878('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1878('0x17'))(_0x1878('0x18'));var utils=require(_0x1878('0x19'));var config=require(_0x1878('0x1a'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4272ab,_0x1ed9f0){_0x1ed9f0=_0x1ed9f0||0xcc;return function(_0x181e51){if(_0x181e51){return _0x4272ab[_0x1878('0x1b')](_0x1ed9f0);}return _0x4272ab['status'](_0x1ed9f0)['end']();};}function respondWithResult(_0x19ffaa,_0x396f3a){_0x396f3a=_0x396f3a||0xc8;return function(_0x49d3a1){if(_0x49d3a1){return _0x19ffaa[_0x1878('0x1c')](_0x396f3a)[_0x1878('0x1d')](_0x49d3a1);}};}function respondWithFilteredResult(_0xb324ba,_0x4a5ba9){return function(_0x562902){if(_0x562902){var _0x13e16d=typeof _0x4a5ba9[_0x1878('0x1e')]===_0x1878('0x1f')&&typeof _0x4a5ba9[_0x1878('0x20')]===_0x1878('0x1f');var _0x430e64=_0x562902[_0x1878('0x21')];var _0x1642b3=_0x13e16d?0x0:_0x4a5ba9[_0x1878('0x1e')];var _0x2b8492=_0x13e16d?_0x562902[_0x1878('0x21')]:_0x4a5ba9['offset']+_0x4a5ba9['limit'];var _0xf80c60;if(_0x2b8492>=_0x430e64){_0x2b8492=_0x430e64;_0xf80c60=0xc8;}else{_0xf80c60=0xce;}_0xb324ba[_0x1878('0x1c')](_0xf80c60);return _0xb324ba['set'](_0x1878('0x22'),_0x1642b3+'-'+_0x2b8492+'/'+_0x430e64)[_0x1878('0x1d')](_0x562902);}return null;};}function patchUpdates(_0x1fae20){return function(_0x387f5){try{jsonpatch[_0x1878('0x23')](_0x387f5,_0x1fae20,!![]);}catch(_0x4dc6f1){return BPromise[_0x1878('0x24')](_0x4dc6f1);}return _0x387f5['save']();};}function saveUpdates(_0x1c2b5d,_0x45e2b6){return function(_0x2bc65b){if(_0x2bc65b){return _0x2bc65b[_0x1878('0x25')](_0x1c2b5d)[_0x1878('0x26')](function(_0x524e68){return _0x524e68;});}return null;};}function removeEntity(_0x461905,_0x10ce95){return function(_0x215e59){if(_0x215e59){return _0x215e59[_0x1878('0x27')]()[_0x1878('0x26')](function(){_0x461905[_0x1878('0x1c')](0xcc)[_0x1878('0x28')]();});}};}function handleEntityNotFound(_0x4e114d,_0x122c65){return function(_0x10ab5c){if(!_0x10ab5c){_0x4e114d[_0x1878('0x1b')](0x194);}return _0x10ab5c;};}function handleError(_0xb191d0,_0x46f5b7){_0x46f5b7=_0x46f5b7||0x1f4;return function(_0x57580b){logger[_0x1878('0x29')](_0x57580b[_0x1878('0x2a')]);if(_0x57580b[_0x1878('0x2b')]){delete _0x57580b[_0x1878('0x2b')];}_0xb191d0['status'](_0x46f5b7)[_0x1878('0x2c')](_0x57580b);};}exports[_0x1878('0x2d')]=function(_0x13fb40,_0x31b2ba){var _0x1eda2b={'raw':!![],'where':{'id':_0x13fb40['params']['id']}},_0x45e3db={};_0x45e3db[_0x1878('0x2e')]=_[_0x1878('0x2f')](db['ChatProactiveAction']['rawAttributes']);_0x45e3db[_0x1878('0x30')]=_['keys'](_0x13fb40['query']);_0x45e3db[_0x1878('0x31')]=_[_0x1878('0x32')](_0x45e3db[_0x1878('0x2e')],_0x45e3db['query']);_0x1eda2b[_0x1878('0x33')]=_[_0x1878('0x32')](_0x45e3db[_0x1878('0x2e')],qs[_0x1878('0x34')](_0x13fb40['query'][_0x1878('0x34')]));_0x1eda2b[_0x1878('0x33')]=_0x1eda2b[_0x1878('0x33')]['length']?_0x1eda2b['attributes']:_0x45e3db[_0x1878('0x2e')];if(_0x13fb40['query'][_0x1878('0x35')]){_0x1eda2b[_0x1878('0x36')]=[{'all':!![]}];}_0x1eda2b=_['merge']({},_0x1eda2b,_0x13fb40['options']);return db['ChatProactiveAction'][_0x1878('0x37')](_0x1eda2b)[_0x1878('0x26')](handleEntityNotFound(_0x31b2ba,null))[_0x1878('0x26')](respondWithResult(_0x31b2ba,null))[_0x1878('0x38')](handleError(_0x31b2ba,null));};exports['create']=function(_0xcd00c2,_0x4ca033){return db[_0x1878('0x39')][_0x1878('0x3a')](_0xcd00c2['body'],{})[_0x1878('0x26')](respondWithResult(_0x4ca033,0xc9))[_0x1878('0x38')](handleError(_0x4ca033,null));};exports['update']=function(_0xd589dc,_0x4086ea){if(_0xd589dc['body']['id']){delete _0xd589dc[_0x1878('0x3b')]['id'];}return db['ChatProactiveAction']['find']({'where':{'id':_0xd589dc[_0x1878('0x3c')]['id']}})[_0x1878('0x26')](handleEntityNotFound(_0x4086ea,null))['then'](saveUpdates(_0xd589dc[_0x1878('0x3b')],null))[_0x1878('0x26')](respondWithResult(_0x4086ea,null))[_0x1878('0x38')](handleError(_0x4086ea,null));};exports[_0x1878('0x27')]=function(_0x5cbdfe,_0x41e778){return db[_0x1878('0x39')][_0x1878('0x37')]({'where':{'id':_0x5cbdfe['params']['id']}})['then'](handleEntityNotFound(_0x41e778,null))[_0x1878('0x26')](removeEntity(_0x41e778,null))[_0x1878('0x38')](handleError(_0x41e778,null));};
\ No newline at end of file
index 6f56a8e..796ca6b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x646c=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','chat_proactive_actions','../../config/logger'];(function(_0x1cb581,_0x58507b){var _0xbd2a2=function(_0x152df2){while(--_0x152df2){_0x1cb581['push'](_0x1cb581['shift']());}};_0xbd2a2(++_0x58507b);}(_0x646c,0xf6));var _0xc646=function(_0x1b6186,_0x1ec7f2){_0x1b6186=_0x1b6186-0x0;var _0x186121=_0x646c[_0x1b6186];return _0x186121;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xc646('0x0'))(_0xc646('0x1'));var moment=require(_0xc646('0x2'));var BPromise=require(_0xc646('0x3'));var rp=require(_0xc646('0x4'));var fs=require('fs');var path=require(_0xc646('0x5'));var rimraf=require(_0xc646('0x6'));var config=require(_0xc646('0x7'));var attributes=require(_0xc646('0x8'));module[_0xc646('0x9')]=function(_0x187702,_0x41fd6f){return _0x187702[_0xc646('0xa')](_0xc646('0xb'),attributes,{'tableName':_0xc646('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x45dd=['api','moment','bluebird','path','rimraf','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','chat_proactive_actions','lodash','../../config/logger'];(function(_0x57172c,_0x1df512){var _0x38e8a4=function(_0x1bc9a5){while(--_0x1bc9a5){_0x57172c['push'](_0x57172c['shift']());}};_0x38e8a4(++_0x1df512);}(_0x45dd,0x172));var _0xd45d=function(_0x343d34,_0x2efaa0){_0x343d34=_0x343d34-0x0;var _0x12acc3=_0x45dd[_0x343d34];return _0x12acc3;};'use strict';var _=require(_0xd45d('0x0'));var util=require('util');var logger=require(_0xd45d('0x1'))(_0xd45d('0x2'));var moment=require(_0xd45d('0x3'));var BPromise=require(_0xd45d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd45d('0x5'));var rimraf=require(_0xd45d('0x6'));var config=require('../../config/environment');var attributes=require(_0xd45d('0x7'));module[_0xd45d('0x8')]=function(_0x17fecc,_0x20af6a){return _0x17fecc[_0xd45d('0x9')](_0xd45d('0xa'),attributes,{'tableName':_0xd45d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 6908e35..a2fab5d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2769=['request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','error','code','ChatProactiveAction,\x20%s,\x20%s','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info'];(function(_0xd1c39b,_0x16f0c6){var _0x58f5bc=function(_0x412cf3){while(--_0x412cf3){_0xd1c39b['push'](_0xd1c39b['shift']());}};_0x58f5bc(++_0x16f0c6);}(_0x2769,0xcf));var _0x9276=function(_0x5e7ed5,_0x1ec933){_0x5e7ed5=_0x5e7ed5-0x0;var _0x3e1460=_0x2769[_0x5e7ed5];return _0x3e1460;};'use strict';var _=require('lodash');var util=require(_0x9276('0x0'));var moment=require('moment');var BPromise=require(_0x9276('0x1'));var rs=require(_0x9276('0x2'));var fs=require('fs');var Redis=require(_0x9276('0x3'));var db=require(_0x9276('0x4'))['db'];var utils=require(_0x9276('0x5'));var logger=require(_0x9276('0x6'))('rpc');var config=require(_0x9276('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x9276('0x8')][_0x9276('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5d3baf,_0xd854d5,_0x19e660){return new BPromise(function(_0x277236,_0x552f72){return client[_0x9276('0xa')](_0x5d3baf,_0x19e660)[_0x9276('0xb')](function(_0x32fa31){logger[_0x9276('0xc')]('ChatProactiveAction,\x20%s,\x20%s',_0xd854d5,_0x9276('0xd'));logger[_0x9276('0xe')](_0x9276('0xf'),_0xd854d5,_0x9276('0xd'),JSON['stringify'](_0x32fa31));if(_0x32fa31[_0x9276('0x10')]){if(_0x32fa31[_0x9276('0x10')][_0x9276('0x11')]===0x1f4){logger[_0x9276('0x10')](_0x9276('0x12'),_0xd854d5,_0x32fa31['error'][_0x9276('0x13')]);return _0x552f72(_0x32fa31[_0x9276('0x10')]['message']);}logger[_0x9276('0x10')]('ChatProactiveAction,\x20%s,\x20%s',_0xd854d5,_0x32fa31[_0x9276('0x10')][_0x9276('0x13')]);return _0x277236(_0x32fa31[_0x9276('0x10')]['message']);}else{logger['info']('ChatProactiveAction,\x20%s,\x20%s',_0xd854d5,'request\x20sent');_0x277236(_0x32fa31[_0x9276('0x14')][_0x9276('0x13')]);}})[_0x9276('0x15')](function(_0x570252){logger[_0x9276('0x10')](_0x9276('0x12'),_0xd854d5,_0x570252);_0x552f72(_0x570252);});});}
\ No newline at end of file
+var _0xdceb=['client','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x1fd675,_0x165dfe){var _0x16b554=function(_0x5761ff){while(--_0x5761ff){_0x1fd675['push'](_0x1fd675['shift']());}};_0x16b554(++_0x165dfe);}(_0xdceb,0x160));var _0xbdce=function(_0x34fa5c,_0x44c7a7){_0x34fa5c=_0x34fa5c-0x0;var _0x590357=_0xdceb[_0x34fa5c];return _0x590357;};'use strict';var _=require('lodash');var util=require(_0xbdce('0x0'));var moment=require('moment');var BPromise=require(_0xbdce('0x1'));var rs=require(_0xbdce('0x2'));var fs=require('fs');var Redis=require(_0xbdce('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbdce('0x4'));var logger=require(_0xbdce('0x5'))('rpc');var config=require(_0xbdce('0x6'));var jayson=require(_0xbdce('0x7'));var client=jayson[_0xbdce('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x155cc6,_0x311e09,_0x3c7791){return new BPromise(function(_0x2af993,_0x662f1d){return client['request'](_0x155cc6,_0x3c7791)[_0xbdce('0x9')](function(_0x280e9d){logger[_0xbdce('0xa')](_0xbdce('0xb'),_0x311e09,_0xbdce('0xc'));logger[_0xbdce('0xd')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x311e09,_0xbdce('0xc'),JSON[_0xbdce('0xe')](_0x280e9d));if(_0x280e9d[_0xbdce('0xf')]){if(_0x280e9d['error'][_0xbdce('0x10')]===0x1f4){logger[_0xbdce('0xf')](_0xbdce('0xb'),_0x311e09,_0x280e9d[_0xbdce('0xf')][_0xbdce('0x11')]);return _0x662f1d(_0x280e9d[_0xbdce('0xf')][_0xbdce('0x11')]);}logger[_0xbdce('0xf')]('ChatProactiveAction,\x20%s,\x20%s',_0x311e09,_0x280e9d[_0xbdce('0xf')][_0xbdce('0x11')]);return _0x2af993(_0x280e9d[_0xbdce('0xf')][_0xbdce('0x11')]);}else{logger[_0xbdce('0xa')](_0xbdce('0xb'),_0x311e09,_0xbdce('0xc'));_0x2af993(_0x280e9d[_0xbdce('0x12')][_0xbdce('0x11')]);}})[_0xbdce('0x13')](function(_0xa1fbc5){logger[_0xbdce('0xf')](_0xbdce('0xb'),_0x311e09,_0xa1fbc5);_0x662f1d(_0xa1fbc5);});});}
\ No newline at end of file
index b60cbe6..13b63e8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xae24=['destroy','exports','multer','path','express','Router','../../components/interaction/service','./chatProactiveAction.controller','get','/:id','isAuthenticated','show','post','put','update','delete'];(function(_0x401f2e,_0x119d0d){var _0x4ef876=function(_0x5bb365){while(--_0x5bb365){_0x401f2e['push'](_0x401f2e['shift']());}};_0x4ef876(++_0x119d0d);}(_0xae24,0x182));var _0x4ae2=function(_0x488202,_0x624b77){_0x488202=_0x488202-0x0;var _0x31523b=_0xae24[_0x488202];return _0x31523b;};'use strict';var multer=require(_0x4ae2('0x0'));var util=require('util');var path=require(_0x4ae2('0x1'));var timeout=require('connect-timeout');var express=require(_0x4ae2('0x2'));var router=express[_0x4ae2('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x4ae2('0x4'));var config=require('../../config/environment');var controller=require(_0x4ae2('0x5'));router[_0x4ae2('0x6')](_0x4ae2('0x7'),auth[_0x4ae2('0x8')](),controller[_0x4ae2('0x9')]);router[_0x4ae2('0xa')]('/',auth['isAuthenticated'](),controller['create']);router[_0x4ae2('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x4ae2('0xc')]);router[_0x4ae2('0xd')]('/:id',auth[_0x4ae2('0x8')](),controller[_0x4ae2('0xe')]);module[_0x4ae2('0xf')]=router;
\ No newline at end of file
+var _0x2bd8=['multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatProactiveAction.controller','get','/:id','show','post','isAuthenticated','create','exports'];(function(_0x298ed3,_0x4ab5e1){var _0x5aad28=function(_0x168687){while(--_0x168687){_0x298ed3['push'](_0x298ed3['shift']());}};_0x5aad28(++_0x4ab5e1);}(_0x2bd8,0x130));var _0x82bd=function(_0x25e703,_0x433147){_0x25e703=_0x25e703-0x0;var _0x534a40=_0x2bd8[_0x25e703];return _0x534a40;};'use strict';var multer=require(_0x82bd('0x0'));var util=require('util');var path=require(_0x82bd('0x1'));var timeout=require(_0x82bd('0x2'));var express=require(_0x82bd('0x3'));var router=express[_0x82bd('0x4')]();var fs_extra=require(_0x82bd('0x5'));var auth=require(_0x82bd('0x6'));var interaction=require(_0x82bd('0x7'));var config=require('../../config/environment');var controller=require(_0x82bd('0x8'));router[_0x82bd('0x9')](_0x82bd('0xa'),auth['isAuthenticated'](),controller[_0x82bd('0xb')]);router[_0x82bd('0xc')]('/',auth[_0x82bd('0xd')](),controller[_0x82bd('0xe')]);router['put'](_0x82bd('0xa'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x82bd('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x82bd('0xf')]=router;
\ No newline at end of file
index fb206e9..477b6b2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x908c=['STRING','name','INTEGER','rrmemory','beepall','sequelize','exports'];(function(_0x487b0c,_0x14ff74){var _0x1adbdc=function(_0x2e7b9d){while(--_0x2e7b9d){_0x487b0c['push'](_0x487b0c['shift']());}};_0x1adbdc(++_0x14ff74);}(_0x908c,0xbb));var _0xc908=function(_0xc4d029,_0x514de7){_0xc4d029=_0xc4d029-0x0;var _0x1fa5ac=_0x908c[_0xc4d029];return _0x1fa5ac;};'use strict';var Sequelize=require(_0xc908('0x0'));module[_0xc908('0x1')]={'name':{'type':Sequelize[_0xc908('0x2')],'unique':_0xc908('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xc908('0x2')]},'timeout':{'type':Sequelize[_0xc908('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xc908('0x5'),_0xc908('0x6'),'roundrobin')}};
\ No newline at end of file
+var _0xb7b8=['STRING','name','ENUM','rrmemory','beepall','roundrobin'];(function(_0x58fcb4,_0xca5a33){var _0x53bfe1=function(_0x1289e6){while(--_0x1289e6){_0x58fcb4['push'](_0x58fcb4['shift']());}};_0x53bfe1(++_0xca5a33);}(_0xb7b8,0x1d4));var _0x8b7b=function(_0x5d3a2b,_0x2f3586){_0x5d3a2b=_0x5d3a2b-0x0;var _0x226126=_0xb7b8[_0x5d3a2b];return _0x226126;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x8b7b('0x0')],'unique':_0x8b7b('0x1'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x8b7b('0x2')](_0x8b7b('0x3'),_0x8b7b('0x4'),_0x8b7b('0x5'))}};
\ No newline at end of file
index e57cc40..b8c81e9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xde89=['describe','getMembers','params','UserChatQueue','nolimit','User','findAndCountAll','agent','updatedAt','createdAt','format','SIP','chatPause','findOne','Team','order','getTeams','addTeams','ids','Agents','online','interface','flatMap','sequelize','transaction','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','select','field','from','team_has_chat_queues','join','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','TeamId','union','value','userChatQueue:remove','addAgents','omit','spread','removeAgents','isArray','getAgents','eml-format','rimraf','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./chatQueue.socket','register','jayson/promise','client','http','request','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','status','end','json','offset','undefined','limit','count','apply','save','then','destroy','get','ChatQueues','UserProfileResource','sendStatus','name','send','index','map','ChatQueue','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','sort','where','pick','filter','merge','options','includeAll','findAll','rows','show','length','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update'];(function(_0x139a3c,_0x4fc883){var _0x2b375b=function(_0x525dbf){while(--_0x525dbf){_0x139a3c['push'](_0x139a3c['shift']());}};_0x2b375b(++_0x4fc883);}(_0xde89,0x156));var _0x9de8=function(_0x2cc569,_0x4e9568){_0x2cc569=_0x2cc569-0x0;var _0x1bfc2e=_0xde89[_0x2cc569];return _0x1bfc2e;};'use strict';var emlformat=require(_0x9de8('0x0'));var rimraf=require(_0x9de8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x9de8('0x2'));var Mustache=require(_0x9de8('0x3'));var util=require('util');var path=require(_0x9de8('0x4'));var sox=require(_0x9de8('0x5'));var csv=require(_0x9de8('0x6'));var ejs=require(_0x9de8('0x7'));var fs=require('fs');var fs_extra=require(_0x9de8('0x8'));var _=require('lodash');var squel=require(_0x9de8('0x9'));var crypto=require(_0x9de8('0xa'));var jsforce=require(_0x9de8('0xb'));var deskjs=require(_0x9de8('0xc'));var toCsv=require(_0x9de8('0x6'));var querystring=require('querystring');var Papa=require(_0x9de8('0xd'));var Redis=require(_0x9de8('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x9de8('0xf'));var hardwareService=require(_0x9de8('0x10'));var logger=require(_0x9de8('0x11'))(_0x9de8('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x9de8('0x13'));var db=require(_0x9de8('0x14'))['db'];config[_0x9de8('0x15')]=_[_0x9de8('0x16')](config[_0x9de8('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0x9de8('0x17'))(new Redis(config['redis']));require(_0x9de8('0x18'))[_0x9de8('0x19')](socket);var jayson=require(_0x9de8('0x1a'));var client=jayson[_0x9de8('0x1b')][_0x9de8('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x32447c,_0x5ba223,_0x57a303,_0x6c33ad){return new BPromise(function(_0x41af96,_0x1932d1){var _0x25f2c3=_0x6c33ad||client;return _0x25f2c3[_0x9de8('0x1d')](_0x32447c,_0x57a303)['then'](function(_0x7374a){logger['info'](_0x9de8('0x1e'),_0x5ba223,_0x9de8('0x1f'));logger['debug'](_0x9de8('0x20'),_0x5ba223,_0x9de8('0x1f'),JSON[_0x9de8('0x21')](_0x7374a));if(_0x7374a[_0x9de8('0x22')]){if(_0x7374a['error'][_0x9de8('0x23')]===0x1f4){logger[_0x9de8('0x22')](_0x9de8('0x1e'),_0x5ba223,_0x7374a[_0x9de8('0x22')]['message']);return _0x1932d1(_0x7374a[_0x9de8('0x22')][_0x9de8('0x24')]);}logger[_0x9de8('0x22')](_0x9de8('0x1e'),_0x5ba223,_0x7374a[_0x9de8('0x22')]['message']);return _0x41af96(_0x7374a[_0x9de8('0x22')][_0x9de8('0x24')]);}else{logger[_0x9de8('0x25')](_0x9de8('0x1e'),_0x5ba223,_0x9de8('0x1f'));_0x41af96(_0x7374a[_0x9de8('0x26')]['message']);}})[_0x9de8('0x27')](function(_0x531ada){logger[_0x9de8('0x22')](_0x9de8('0x1e'),_0x5ba223,_0x531ada);_0x1932d1(_0x531ada);});});}function respondWithStatusCode(_0x220d9c,_0x39b168){_0x39b168=_0x39b168||0xcc;return function(_0x553f96){if(_0x553f96){return _0x220d9c['sendStatus'](_0x39b168);}return _0x220d9c[_0x9de8('0x28')](_0x39b168)[_0x9de8('0x29')]();};}function respondWithResult(_0x5c666f,_0x13ca93){_0x13ca93=_0x13ca93||0xc8;return function(_0x4bdb19){if(_0x4bdb19){return _0x5c666f[_0x9de8('0x28')](_0x13ca93)[_0x9de8('0x2a')](_0x4bdb19);}};}function respondWithFilteredResult(_0x35b809,_0x41722b){return function(_0x1beb17){if(_0x1beb17){var _0x4bd8f6=typeof _0x41722b[_0x9de8('0x2b')]===_0x9de8('0x2c')&&typeof _0x41722b[_0x9de8('0x2d')]===_0x9de8('0x2c');var _0x2aaafa=_0x1beb17[_0x9de8('0x2e')];var _0x1c2aed=_0x4bd8f6?0x0:_0x41722b['offset'];var _0x41619e=_0x4bd8f6?_0x1beb17[_0x9de8('0x2e')]:_0x41722b['offset']+_0x41722b[_0x9de8('0x2d')];var _0x1da7ed;if(_0x41619e>=_0x2aaafa){_0x41619e=_0x2aaafa;_0x1da7ed=0xc8;}else{_0x1da7ed=0xce;}_0x35b809[_0x9de8('0x28')](_0x1da7ed);return _0x35b809['set']('Content-Range',_0x1c2aed+'-'+_0x41619e+'/'+_0x2aaafa)[_0x9de8('0x2a')](_0x1beb17);}return null;};}function patchUpdates(_0x3f02b0){return function(_0x552716){try{jsonpatch[_0x9de8('0x2f')](_0x552716,_0x3f02b0,!![]);}catch(_0x4bdf10){return BPromise['reject'](_0x4bdf10);}return _0x552716[_0x9de8('0x30')]();};}function saveUpdates(_0xa1d8b6,_0x32ede4){return function(_0x2be8be){if(_0x2be8be){return _0x2be8be['update'](_0xa1d8b6)[_0x9de8('0x31')](function(_0x55a122){return _0x55a122;});}return null;};}function removeEntity(_0x1437a2,_0x13f5a8){return function(_0x36a3be){if(_0x36a3be){return _0x36a3be[_0x9de8('0x32')]()[_0x9de8('0x31')](function(){var _0x4a1b3c=_0x36a3be[_0x9de8('0x33')]({'plain':!![]});var _0x4e8b8f=_0x9de8('0x34');return db[_0x9de8('0x35')][_0x9de8('0x32')]({'where':{'type':_0x4e8b8f,'resourceId':_0x4a1b3c['id']}})[_0x9de8('0x31')](function(){return _0x36a3be;});})[_0x9de8('0x31')](function(){_0x1437a2['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2978cd,_0x1c3b31){return function(_0x41eac7){if(!_0x41eac7){_0x2978cd[_0x9de8('0x36')](0x194);}return _0x41eac7;};}function handleError(_0x4d503c,_0x54eab2){_0x54eab2=_0x54eab2||0x1f4;return function(_0x81f38d){logger[_0x9de8('0x22')](_0x81f38d['stack']);if(_0x81f38d[_0x9de8('0x37')]){delete _0x81f38d[_0x9de8('0x37')];}_0x4d503c[_0x9de8('0x28')](_0x54eab2)[_0x9de8('0x38')](_0x81f38d);};}exports[_0x9de8('0x39')]=function(_0x125a23,_0x393647){var _0x576e70={},_0x20c45d={},_0x4b0a36={'count':0x0,'rows':[]};var _0x4752d7=_[_0x9de8('0x3a')](db[_0x9de8('0x3b')][_0x9de8('0x3c')],function(_0x550917){return{'name':_0x550917['fieldName'],'type':_0x550917[_0x9de8('0x3d')][_0x9de8('0x3e')]};});_0x20c45d[_0x9de8('0x3f')]=_['map'](_0x4752d7,'name');_0x20c45d[_0x9de8('0x40')]=_[_0x9de8('0x41')](_0x125a23[_0x9de8('0x40')]);_0x20c45d[_0x9de8('0x42')]=_['intersection'](_0x20c45d[_0x9de8('0x3f')],_0x20c45d[_0x9de8('0x40')]);_0x576e70[_0x9de8('0x43')]=_[_0x9de8('0x44')](_0x20c45d['model'],qs['fields'](_0x125a23['query'][_0x9de8('0x45')]));_0x576e70[_0x9de8('0x43')]=_0x576e70['attributes']['length']?_0x576e70[_0x9de8('0x43')]:_0x20c45d[_0x9de8('0x3f')];if(!_0x125a23[_0x9de8('0x40')][_0x9de8('0x46')]('nolimit')){_0x576e70[_0x9de8('0x2d')]=qs['limit'](_0x125a23['query'][_0x9de8('0x2d')]);_0x576e70['offset']=qs[_0x9de8('0x2b')](_0x125a23[_0x9de8('0x40')][_0x9de8('0x2b')]);}_0x576e70['order']=qs['sort'](_0x125a23[_0x9de8('0x40')][_0x9de8('0x47')]);_0x576e70[_0x9de8('0x48')]=qs['filters'](_[_0x9de8('0x49')](_0x125a23[_0x9de8('0x40')],_0x20c45d[_0x9de8('0x42')]),_0x4752d7);if(_0x125a23[_0x9de8('0x40')][_0x9de8('0x4a')]){_0x576e70['where']=_[_0x9de8('0x4b')](_0x576e70['where'],{'$or':_[_0x9de8('0x3a')](_0x4752d7,function(_0x9d22ee){if(_0x9d22ee['type']!=='VIRTUAL'){var _0x17bc39={};_0x17bc39[_0x9d22ee['name']]={'$like':'%'+_0x125a23[_0x9de8('0x40')][_0x9de8('0x4a')]+'%'};return _0x17bc39;}})});}_0x576e70=_['merge']({},_0x576e70,_0x125a23[_0x9de8('0x4c')]);var _0x4bacd1={'where':_0x576e70[_0x9de8('0x48')]};return db[_0x9de8('0x3b')]['count'](_0x4bacd1)[_0x9de8('0x31')](function(_0x578ad1){_0x4b0a36['count']=_0x578ad1;if(_0x125a23[_0x9de8('0x40')][_0x9de8('0x4d')]){_0x576e70['include']=[{'all':!![]}];}return db[_0x9de8('0x3b')][_0x9de8('0x4e')](_0x576e70);})[_0x9de8('0x31')](function(_0x2c3ae7){_0x4b0a36[_0x9de8('0x4f')]=_0x2c3ae7;return _0x4b0a36;})[_0x9de8('0x31')](respondWithFilteredResult(_0x393647,_0x576e70))[_0x9de8('0x27')](handleError(_0x393647,null));};exports[_0x9de8('0x50')]=function(_0x3818e6,_0x451beb){var _0xd15d19={'raw':!![],'where':{'id':_0x3818e6['params']['id']}},_0x1d3f2e={};_0x1d3f2e['model']=_[_0x9de8('0x41')](db[_0x9de8('0x3b')][_0x9de8('0x3c')]);_0x1d3f2e[_0x9de8('0x40')]=_['keys'](_0x3818e6[_0x9de8('0x40')]);_0x1d3f2e['filters']=_[_0x9de8('0x44')](_0x1d3f2e[_0x9de8('0x3f')],_0x1d3f2e['query']);_0xd15d19[_0x9de8('0x43')]=_[_0x9de8('0x44')](_0x1d3f2e[_0x9de8('0x3f')],qs[_0x9de8('0x45')](_0x3818e6[_0x9de8('0x40')]['fields']));_0xd15d19['attributes']=_0xd15d19[_0x9de8('0x43')][_0x9de8('0x51')]?_0xd15d19[_0x9de8('0x43')]:_0x1d3f2e[_0x9de8('0x3f')];if(_0x3818e6['query']['includeAll']){_0xd15d19[_0x9de8('0x52')]=[{'all':!![]}];}_0xd15d19=_['merge']({},_0xd15d19,_0x3818e6[_0x9de8('0x4c')]);return db[_0x9de8('0x3b')][_0x9de8('0x53')](_0xd15d19)[_0x9de8('0x31')](handleEntityNotFound(_0x451beb,null))[_0x9de8('0x31')](respondWithResult(_0x451beb,null))[_0x9de8('0x27')](handleError(_0x451beb,null));};exports[_0x9de8('0x54')]=function(_0x4d2277,_0x2ec732){return db[_0x9de8('0x3b')][_0x9de8('0x54')](_0x4d2277[_0x9de8('0x55')],{})[_0x9de8('0x31')](function(_0x2f8fd0){var _0x495585=_0x4d2277[_0x9de8('0x56')]['get']({'plain':!![]});if(!_0x495585)throw new Error(_0x9de8('0x57'));if(_0x495585[_0x9de8('0x58')]===_0x9de8('0x56')){var _0x3fd2c9=_0x2f8fd0[_0x9de8('0x33')]({'plain':!![]});var _0x1536f2=_0x9de8('0x34');return db[_0x9de8('0x59')][_0x9de8('0x53')]({'where':{'name':_0x1536f2,'userProfileId':_0x495585[_0x9de8('0x5a')]},'raw':!![]})[_0x9de8('0x31')](function(_0x116166){if(_0x116166&&_0x116166['autoAssociation']===0x0){return db[_0x9de8('0x35')]['create']({'name':_0x3fd2c9[_0x9de8('0x37')],'resourceId':_0x3fd2c9['id'],'type':_0x116166[_0x9de8('0x37')],'sectionId':_0x116166['id']},{})['then'](function(){return _0x2f8fd0;});}else{return _0x2f8fd0;}})[_0x9de8('0x27')](function(_0x5c6b48){logger[_0x9de8('0x22')](_0x9de8('0x5b'),_0x5c6b48);throw _0x5c6b48;});}return _0x2f8fd0;})['then'](respondWithResult(_0x2ec732,0xc9))['catch'](handleError(_0x2ec732,null));};exports[_0x9de8('0x5c')]=function(_0x217f50,_0x4f00a3){if(_0x217f50['body']['id']){delete _0x217f50[_0x9de8('0x55')]['id'];}return db['ChatQueue'][_0x9de8('0x53')]({'where':{'id':_0x217f50['params']['id']}})['then'](handleEntityNotFound(_0x4f00a3,null))[_0x9de8('0x31')](saveUpdates(_0x217f50[_0x9de8('0x55')],null))[_0x9de8('0x31')](respondWithResult(_0x4f00a3,null))[_0x9de8('0x27')](handleError(_0x4f00a3,null));};exports[_0x9de8('0x32')]=function(_0x51b233,_0x5d10c1){return db['ChatQueue'][_0x9de8('0x53')]({'where':{'id':_0x51b233['params']['id']}})['then'](handleEntityNotFound(_0x5d10c1,null))[_0x9de8('0x31')](removeEntity(_0x5d10c1,null))['catch'](handleError(_0x5d10c1,null));};exports['describe']=function(_0x5a1ea2,_0xe18ee2){return db[_0x9de8('0x3b')][_0x9de8('0x5d')]()[_0x9de8('0x31')](respondWithResult(_0xe18ee2,null))[_0x9de8('0x27')](handleError(_0xe18ee2,null));};exports[_0x9de8('0x5e')]=function(_0x3d383a,_0x30b7d8,_0x3bb569){var _0x529fcb={'raw':!![],'where':{}},_0x3f1c27={},_0x1b264a;return db[_0x9de8('0x3b')]['findOne']({'where':{'id':_0x3d383a[_0x9de8('0x5f')]['id']}})[_0x9de8('0x31')](handleEntityNotFound(_0x30b7d8,null))[_0x9de8('0x31')](function(_0x5c51ad){if(_0x5c51ad){_0x1b264a=_0x5c51ad[_0x9de8('0x33')]({'plain':!![]});_0x3f1c27['model']=_['keys'](db[_0x9de8('0x60')][_0x9de8('0x3c')]);_0x3f1c27[_0x9de8('0x40')]=_[_0x9de8('0x41')](_0x3d383a[_0x9de8('0x40')]);_0x3f1c27[_0x9de8('0x42')]=_['intersection'](_0x3f1c27[_0x9de8('0x3f')],_0x3f1c27[_0x9de8('0x40')]);_0x529fcb[_0x9de8('0x43')]=_[_0x9de8('0x44')](_0x3f1c27[_0x9de8('0x3f')],qs['fields'](_0x3d383a['query']['fields']));_0x529fcb[_0x9de8('0x43')]=_0x529fcb['attributes'][_0x9de8('0x51')]?_0x529fcb[_0x9de8('0x43')]:_0x3f1c27[_0x9de8('0x3f')];if(!_0x3d383a[_0x9de8('0x40')][_0x9de8('0x46')](_0x9de8('0x61'))){_0x529fcb[_0x9de8('0x2d')]=qs[_0x9de8('0x2d')](_0x3d383a['query'][_0x9de8('0x2d')]);_0x529fcb['offset']=qs[_0x9de8('0x2b')](_0x3d383a[_0x9de8('0x40')]['offset']);}_0x529fcb['order']=qs[_0x9de8('0x47')](_0x3d383a[_0x9de8('0x40')]['sort']);_0x529fcb[_0x9de8('0x48')]=qs['filters'](_[_0x9de8('0x49')](_0x3d383a['query'],_0x3f1c27[_0x9de8('0x42')]));_0x529fcb[_0x9de8('0x48')]['ChatQueueId']=_0x5c51ad['id'];if(_0x3d383a['query']['filter']){_0x529fcb[_0x9de8('0x48')]=_[_0x9de8('0x4b')](_0x529fcb[_0x9de8('0x48')],{'$or':_[_0x9de8('0x3a')](_0x529fcb[_0x9de8('0x43')],function(_0x2c5203){var _0x29a8c0={};_0x29a8c0[_0x2c5203]={'$like':'%'+_0x3d383a['query'][_0x9de8('0x4a')]+'%'};return _0x29a8c0;})});}_0x529fcb=_[_0x9de8('0x4b')]({},_0x529fcb,_0x3d383a['options']);return db[_0x9de8('0x60')]['findAll'](_0x529fcb);}})[_0x9de8('0x31')](function(_0x48eda3){if(_0x48eda3){return db[_0x9de8('0x62')][_0x9de8('0x63')]({'where':{'id':_['map'](_0x48eda3,'UserId'),'role':_0x9de8('0x64')},'attributes':['id',_0x9de8('0x37'),'chatPause',_0x9de8('0x65'),_0x9de8('0x66')]});}})[_0x9de8('0x31')](function(_0x2376d8){if(_0x2376d8){return{'count':_0x2376d8[_0x9de8('0x2e')],'rows':_[_0x9de8('0x3a')](_0x2376d8[_0x9de8('0x4f')],function(_0x4356b1){return{'membername':_0x4356b1['name'],'UserId':_0x4356b1['id'],'queue_name':_0x1b264a[_0x9de8('0x37')],'ChatQueueId':_0x1b264a['id'],'interface':util[_0x9de8('0x67')]('%s/%s',_0x9de8('0x68'),_0x4356b1[_0x9de8('0x37')]),'penalty':0x0,'paused':_0x4356b1[_0x9de8('0x69')],'createdAt':_0x4356b1['createdAt'],'updatedAt':_0x4356b1[_0x9de8('0x65')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x30b7d8,_0x529fcb))[_0x9de8('0x27')](handleError(_0x30b7d8,null));};exports['getTeams']=function(_0x184b5e,_0x58cf06,_0x4a694a){var _0x2e5a51={};var _0x1a763d={};var _0x639965;var _0x92d293;return db[_0x9de8('0x3b')][_0x9de8('0x6a')]({'where':{'id':_0x184b5e[_0x9de8('0x5f')]['id']}})[_0x9de8('0x31')](handleEntityNotFound(_0x58cf06,null))[_0x9de8('0x31')](function(_0x39507){if(_0x39507){_0x639965=_0x39507;_0x1a763d[_0x9de8('0x3f')]=_['keys'](db[_0x9de8('0x6b')][_0x9de8('0x3c')]);_0x1a763d[_0x9de8('0x40')]=_['keys'](_0x184b5e[_0x9de8('0x40')]);_0x1a763d[_0x9de8('0x42')]=_['intersection'](_0x1a763d['model'],_0x1a763d[_0x9de8('0x40')]);_0x2e5a51[_0x9de8('0x43')]=_[_0x9de8('0x44')](_0x1a763d['model'],qs[_0x9de8('0x45')](_0x184b5e[_0x9de8('0x40')]['fields']));_0x2e5a51['attributes']=_0x2e5a51[_0x9de8('0x43')][_0x9de8('0x51')]?_0x2e5a51['attributes']:_0x1a763d[_0x9de8('0x3f')];_0x2e5a51[_0x9de8('0x6c')]=qs[_0x9de8('0x47')](_0x184b5e[_0x9de8('0x40')][_0x9de8('0x47')]);_0x2e5a51['where']=qs['filters'](_[_0x9de8('0x49')](_0x184b5e[_0x9de8('0x40')],_0x1a763d[_0x9de8('0x42')]));if(_0x184b5e['query'][_0x9de8('0x4a')]){_0x2e5a51[_0x9de8('0x48')]=_['merge'](_0x2e5a51[_0x9de8('0x48')],{'$or':_['map'](_0x2e5a51['attributes'],function(_0x445d78){var _0x27f1b5={};_0x27f1b5[_0x445d78]={'$like':'%'+_0x184b5e['query'][_0x9de8('0x4a')]+'%'};return _0x27f1b5;})});}_0x2e5a51=_[_0x9de8('0x4b')]({},_0x2e5a51,_0x184b5e[_0x9de8('0x4c')]);return _0x639965[_0x9de8('0x6d')](_0x2e5a51);}})[_0x9de8('0x31')](function(_0xb124e8){if(_0xb124e8){_0x92d293=_0xb124e8['length'];if(!_0x184b5e['query'][_0x9de8('0x46')](_0x9de8('0x61'))){_0x2e5a51[_0x9de8('0x2d')]=qs[_0x9de8('0x2d')](_0x184b5e['query'][_0x9de8('0x2d')]);_0x2e5a51[_0x9de8('0x2b')]=qs[_0x9de8('0x2b')](_0x184b5e[_0x9de8('0x40')][_0x9de8('0x2b')]);}return _0x639965[_0x9de8('0x6d')](_0x2e5a51);}})[_0x9de8('0x31')](function(_0x13f928){if(_0x13f928){return _0x13f928?{'count':_0x92d293,'rows':_0x13f928}:null;}})[_0x9de8('0x31')](respondWithResult(_0x58cf06,null))[_0x9de8('0x27')](handleError(_0x58cf06,null));};exports[_0x9de8('0x6e')]=function(_0x51db3d,_0x886900,_0x5716c5){var _0x2b8789=_0x51db3d[_0x9de8('0x55')][_0x9de8('0x6f')];return db['Team'][_0x9de8('0x4e')]({'where':{'id':_0x2b8789},'attributes':['id'],'include':[{'model':db['User'],'as':_0x9de8('0x70'),'attributes':['id',_0x9de8('0x37'),_0x9de8('0x71'),'voicePause',_0x9de8('0x72')],'raw':!![]}]})['then'](function(_0x142f11){if(_0x142f11){var _0x42d2cf=_[_0x9de8('0x73')](_0x142f11,function(_0x3e451d){var _0x2e00e6=_0x3e451d[_0x9de8('0x33')]({'plain':!![]});return _0x2e00e6[_0x9de8('0x70')];});return db['ChatQueue'][_0x9de8('0x53')]({'where':{'id':_0x51db3d[_0x9de8('0x5f')]['id']}})[_0x9de8('0x31')](function(_0x20aee7){return db[_0x9de8('0x74')][_0x9de8('0x75')](function(_0x520a2f){return _0x20aee7['addTeams'](_0x2b8789,{'transaction':_0x520a2f})['then'](function(){return BPromise['each'](_0x42d2cf,function(_0x59bb77){return db[_0x9de8('0x60')][_0x9de8('0x76')]({'where':{'UserId':_0x59bb77['id'],'ChatQueueId':_0x51db3d[_0x9de8('0x5f')]['id']},'transaction':_0x520a2f});});})['then'](function(){_0x42d2cf[_0x9de8('0x77')](function(_0x41400f){socket[_0x9de8('0x78')](_0x9de8('0x79'),{'UserId':_0x41400f['id'],'ChatQueueId':_0x20aee7['id']});});});});});}})['then'](respondWithStatusCode(_0x886900,null))[_0x9de8('0x27')](handleError(_0x886900,null));};exports[_0x9de8('0x7a')]=function(_0x1896fc,_0x31708b,_0xde4478){return db[_0x9de8('0x6b')][_0x9de8('0x4e')]({'where':{'id':_0x1896fc['query'][_0x9de8('0x6f')]},'attributes':['id'],'include':[{'model':db[_0x9de8('0x62')],'as':_0x9de8('0x70'),'attributes':['id'],'raw':!![]}]})[_0x9de8('0x31')](handleEntityNotFound(_0x31708b,null))[_0x9de8('0x31')](function(_0x4fdfdd){var _0x309b27=_['map'](_0x4fdfdd,'id');var _0x1ba31d=[];var _0x467cda=[];var _0x36c7e6=squel[_0x9de8('0x7b')]();_0x36c7e6[_0x9de8('0x7c')]('tq.TeamId')[_0x9de8('0x7d')](_0x9de8('0x7e'),'tq')[_0x9de8('0x7f')]('user_has_teams','ut',_0x9de8('0x80'))['where'](_0x9de8('0x81'),_0x1896fc[_0x9de8('0x5f')]['id']);for(var _0x4cb16f=0x0;_0x4cb16f<_0x4fdfdd[_0x9de8('0x51')];_0x4cb16f+=0x1){let _0x1825bf=_0x4fdfdd[_0x4cb16f];for(var _0x5a081b=0x0;_0x5a081b<_0x1825bf[_0x9de8('0x70')][_0x9de8('0x51')];_0x5a081b+=0x1){let _0x1c2ea0=_0x1825bf[_0x9de8('0x70')][_0x5a081b];var _0x310a60=_0x36c7e6['clone']();_0x310a60[_0x9de8('0x48')](_0x9de8('0x82'),_0x1c2ea0['id']);_0x467cda[_0x9de8('0x83')](db[_0x9de8('0x74')][_0x9de8('0x40')](_0x310a60[_0x9de8('0x84')](),{'type':db['sequelize'][_0x9de8('0x85')]['SELECT']})[_0x9de8('0x31')](function(_0x2f39a8){if(_0x2f39a8['length']===0x1){return _0x1c2ea0['id'];}else{var _0x41c177=_[_0x9de8('0x86')](_[_0x9de8('0x3a')](_0x2f39a8,_0x9de8('0x87')),function(_0x57eba1){return _['includes'](_0x309b27,_0x57eba1);});if(_0x41c177){return _0x1c2ea0['id'];}}}));}}return BPromise['all'](_0x467cda)['then'](function(_0x5515b3){_0x1ba31d=_(_0x1ba31d)[_0x9de8('0x88')](_0x5515b3)['compact']()[_0x9de8('0x89')]();return db[_0x9de8('0x3b')][_0x9de8('0x53')]({'where':{'id':_0x1896fc[_0x9de8('0x5f')]['id']}})['then'](function(_0x31c9a9){return db[_0x9de8('0x74')][_0x9de8('0x75')](function(_0x21c048){return _0x31c9a9[_0x9de8('0x7a')](_0x1896fc[_0x9de8('0x40')][_0x9de8('0x6f')],{'transaction':_0x21c048})[_0x9de8('0x31')](function(){if(!_['isEmpty'](_0x1ba31d)){return _0x31c9a9['removeAgents'](_0x1ba31d,{'transaction':_0x21c048});}})[_0x9de8('0x31')](function(){_0x1ba31d['forEach'](function(_0x8faaf5){socket[_0x9de8('0x78')](_0x9de8('0x8a'),{'UserId':_0x8faaf5,'ChatQueueId':_0x31c9a9['id']});});});});});});})[_0x9de8('0x31')](respondWithStatusCode(_0x31708b,null))[_0x9de8('0x27')](handleError(_0x31708b,null));};exports[_0x9de8('0x8b')]=function(_0x552fd3,_0x1ce651,_0x3af5c8){return db[_0x9de8('0x3b')][_0x9de8('0x53')]({'where':{'id':_0x552fd3['params']['id']}})[_0x9de8('0x31')](handleEntityNotFound(_0x1ce651,null))[_0x9de8('0x31')](function(_0x5ea688){if(_0x5ea688){return _0x5ea688['addAgents'](_0x552fd3[_0x9de8('0x55')]['ids'],_[_0x9de8('0x8c')](_0x552fd3['body'],[_0x9de8('0x6f'),'id'])||{})[_0x9de8('0x8d')](function(_0x23d657){for(var _0x2e3826=0x0;_0x2e3826<_0x552fd3[_0x9de8('0x55')][_0x9de8('0x6f')][_0x9de8('0x51')];_0x2e3826+=0x1){socket[_0x9de8('0x78')]('userChatQueue:save',{'UserId':Number(_0x552fd3[_0x9de8('0x55')]['ids'][_0x2e3826]),'ChatQueueId':Number(_0x552fd3[_0x9de8('0x5f')]['id'])});}return _0x23d657;});}})[_0x9de8('0x31')](respondWithResult(_0x1ce651,null))['catch'](handleError(_0x1ce651,null));};exports[_0x9de8('0x8e')]=function(_0x46dbec,_0x5d85e6,_0x594581){return db[_0x9de8('0x3b')][_0x9de8('0x53')]({'where':{'id':_0x46dbec[_0x9de8('0x5f')]['id']}})[_0x9de8('0x31')](handleEntityNotFound(_0x5d85e6,null))[_0x9de8('0x31')](function(_0x56b25d){if(_0x56b25d){return _0x56b25d[_0x9de8('0x8e')](_0x46dbec['query'][_0x9de8('0x6f')])[_0x9de8('0x31')](function(){if(_[_0x9de8('0x8f')](_0x46dbec['query'][_0x9de8('0x6f')])){for(var _0x1f5d69=0x0;_0x1f5d69<_0x46dbec[_0x9de8('0x40')]['ids'][_0x9de8('0x51')];_0x1f5d69+=0x1){socket[_0x9de8('0x78')](_0x9de8('0x8a'),{'UserId':Number(_0x46dbec[_0x9de8('0x40')][_0x9de8('0x6f')][_0x1f5d69]),'ChatQueueId':Number(_0x46dbec[_0x9de8('0x5f')]['id'])});}}else{socket[_0x9de8('0x78')](_0x9de8('0x8a'),{'UserId':Number(_0x46dbec[_0x9de8('0x40')][_0x9de8('0x6f')]),'ChatQueueId':Number(_0x46dbec[_0x9de8('0x5f')]['id'])});}});}})[_0x9de8('0x31')](respondWithStatusCode(_0x5d85e6,null))[_0x9de8('0x27')](handleError(_0x5d85e6,null));};exports[_0x9de8('0x90')]=function(_0x4011a7,_0x596296,_0x13ba96){var _0x47a592={};var _0x42b55b={};var _0x46bb59;var _0x5f4523;return db[_0x9de8('0x3b')]['findOne']({'where':{'id':_0x4011a7['params']['id']}})[_0x9de8('0x31')](handleEntityNotFound(_0x596296,null))[_0x9de8('0x31')](function(_0x17d5bc){if(_0x17d5bc){_0x46bb59=_0x17d5bc;_0x42b55b[_0x9de8('0x3f')]=_[_0x9de8('0x41')](db['User'][_0x9de8('0x3c')]);_0x42b55b[_0x9de8('0x40')]=_[_0x9de8('0x41')](_0x4011a7[_0x9de8('0x40')]);_0x42b55b[_0x9de8('0x42')]=_[_0x9de8('0x44')](_0x42b55b['model'],_0x42b55b[_0x9de8('0x40')]);_0x47a592[_0x9de8('0x43')]=_[_0x9de8('0x44')](_0x42b55b[_0x9de8('0x3f')],qs[_0x9de8('0x45')](_0x4011a7[_0x9de8('0x40')][_0x9de8('0x45')]));_0x47a592[_0x9de8('0x43')]=_0x47a592['attributes'][_0x9de8('0x51')]?_0x47a592['attributes']:_0x42b55b[_0x9de8('0x3f')];_0x47a592[_0x9de8('0x6c')]=qs['sort'](_0x4011a7['query']['sort']);_0x47a592[_0x9de8('0x48')]=qs[_0x9de8('0x42')](_[_0x9de8('0x49')](_0x4011a7['query'],_0x42b55b['filters']));if(_0x4011a7[_0x9de8('0x40')]['filter']){_0x47a592[_0x9de8('0x48')]=_[_0x9de8('0x4b')](_0x47a592[_0x9de8('0x48')],{'$or':_[_0x9de8('0x3a')](_0x47a592[_0x9de8('0x43')],function(_0x3f6709){var _0x313daf={};_0x313daf[_0x3f6709]={'$like':'%'+_0x4011a7[_0x9de8('0x40')][_0x9de8('0x4a')]+'%'};return _0x313daf;})});}_0x47a592=_[_0x9de8('0x4b')]({},_0x47a592,_0x4011a7[_0x9de8('0x4c')]);return _0x46bb59[_0x9de8('0x90')](_0x47a592);}})['then'](function(_0x5f14d4){if(_0x5f14d4){_0x5f4523=_0x5f14d4[_0x9de8('0x51')];if(!_0x4011a7[_0x9de8('0x40')][_0x9de8('0x46')](_0x9de8('0x61'))){_0x47a592[_0x9de8('0x2d')]=qs[_0x9de8('0x2d')](_0x4011a7['query'][_0x9de8('0x2d')]);_0x47a592['offset']=qs[_0x9de8('0x2b')](_0x4011a7[_0x9de8('0x40')][_0x9de8('0x2b')]);}return _0x46bb59[_0x9de8('0x90')](_0x47a592);}})[_0x9de8('0x31')](function(_0x500e4d){if(_0x500e4d){return _0x500e4d?{'count':_0x5f4523,'rows':_0x500e4d}:null;}})['then'](respondWithResult(_0x596296,null))['catch'](handleError(_0x596296,null));};
\ No newline at end of file
+var _0x2f87=['then','info','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatQueue,\x20%s,\x20%s','result','catch','sendStatus','status','offset','undefined','limit','count','set','json','apply','reject','update','UserProfileResource','destroy','end','stack','name','send','fieldName','type','key','model','map','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','filter','merge','where','VIRTUAL','options','ChatQueue','includeAll','include','params','keys','rawAttributes','find','create','body','get','role','ChatQueues','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','UserChatQueue','nolimit','pick','ChatQueueId','User','findAndCountAll','UserId','updatedAt','rows','format','SIP','chatPause','createdAt','findOne','getTeams','addTeams','findAll','Agents','voicePause','interface','transaction','each','findOrCreate','forEach','emit','userChatQueue:save','Team','ids','select','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','SELECT','TeamId','includes','all','union','value','removeTeams','isEmpty','removeAgents','addAgents','omit','userChatQueue:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','jayson/promise','client','http','request'];(function(_0x484e36,_0x4482d8){var _0xafc85d=function(_0xaba9c8){while(--_0xaba9c8){_0x484e36['push'](_0x484e36['shift']());}};_0xafc85d(++_0x4482d8);}(_0x2f87,0x10c));var _0x72f8=function(_0x49762c,_0x59b975){_0x49762c=_0x49762c-0x0;var _0x2462cb=_0x2f87[_0x49762c];return _0x2462cb;};'use strict';var emlformat=require(_0x72f8('0x0'));var rimraf=require(_0x72f8('0x1'));var zipdir=require(_0x72f8('0x2'));var jsonpatch=require(_0x72f8('0x3'));var rp=require('request-promise');var moment=require(_0x72f8('0x4'));var BPromise=require(_0x72f8('0x5'));var Mustache=require(_0x72f8('0x6'));var util=require(_0x72f8('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x72f8('0x8'));var ejs=require(_0x72f8('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x72f8('0xa'));var squel=require(_0x72f8('0xb'));var crypto=require(_0x72f8('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x72f8('0xd'));var toCsv=require(_0x72f8('0x8'));var querystring=require(_0x72f8('0xe'));var Papa=require(_0x72f8('0xf'));var Redis=require(_0x72f8('0x10'));var authService=require(_0x72f8('0x11'));var qs=require(_0x72f8('0x12'));var as=require(_0x72f8('0x13'));var hardwareService=require(_0x72f8('0x14'));var logger=require(_0x72f8('0x15'))(_0x72f8('0x16'));var utils=require(_0x72f8('0x17'));var config=require(_0x72f8('0x18'));var licenseUtil=require(_0x72f8('0x19'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x72f8('0x1a')],{'host':_0x72f8('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x72f8('0x1a')]));require('./chatQueue.socket')['register'](socket);var jayson=require(_0x72f8('0x1c'));var client=jayson[_0x72f8('0x1d')][_0x72f8('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x3bdd56,_0xf507e1,_0x409c94,_0x23400f){return new BPromise(function(_0x51d61e,_0x2e5a20){var _0x36ffbd=_0x23400f||client;return _0x36ffbd[_0x72f8('0x1f')](_0x3bdd56,_0x409c94)[_0x72f8('0x20')](function(_0x57a777){logger[_0x72f8('0x21')]('ChatQueue,\x20%s,\x20%s',_0xf507e1,_0x72f8('0x22'));logger['debug'](_0x72f8('0x23'),_0xf507e1,'request\x20sent',JSON[_0x72f8('0x24')](_0x57a777));if(_0x57a777[_0x72f8('0x25')]){if(_0x57a777[_0x72f8('0x25')][_0x72f8('0x26')]===0x1f4){logger[_0x72f8('0x25')]('ChatQueue,\x20%s,\x20%s',_0xf507e1,_0x57a777['error'][_0x72f8('0x27')]);return _0x2e5a20(_0x57a777[_0x72f8('0x25')][_0x72f8('0x27')]);}logger[_0x72f8('0x25')](_0x72f8('0x28'),_0xf507e1,_0x57a777[_0x72f8('0x25')][_0x72f8('0x27')]);return _0x51d61e(_0x57a777[_0x72f8('0x25')]['message']);}else{logger[_0x72f8('0x21')](_0x72f8('0x28'),_0xf507e1,'request\x20sent');_0x51d61e(_0x57a777[_0x72f8('0x29')][_0x72f8('0x27')]);}})[_0x72f8('0x2a')](function(_0x473253){logger[_0x72f8('0x25')]('ChatQueue,\x20%s,\x20%s',_0xf507e1,_0x473253);_0x2e5a20(_0x473253);});});}function respondWithStatusCode(_0x2c7509,_0x5712a3){_0x5712a3=_0x5712a3||0xcc;return function(_0x530a08){if(_0x530a08){return _0x2c7509[_0x72f8('0x2b')](_0x5712a3);}return _0x2c7509[_0x72f8('0x2c')](_0x5712a3)['end']();};}function respondWithResult(_0x185847,_0x303662){_0x303662=_0x303662||0xc8;return function(_0x2b12f2){if(_0x2b12f2){return _0x185847[_0x72f8('0x2c')](_0x303662)['json'](_0x2b12f2);}};}function respondWithFilteredResult(_0x2633e6,_0x323795){return function(_0x210628){if(_0x210628){var _0x384b0a=typeof _0x323795[_0x72f8('0x2d')]===_0x72f8('0x2e')&&typeof _0x323795[_0x72f8('0x2f')]==='undefined';var _0x419be6=_0x210628['count'];var _0x33f3b8=_0x384b0a?0x0:_0x323795[_0x72f8('0x2d')];var _0xf06103=_0x384b0a?_0x210628[_0x72f8('0x30')]:_0x323795[_0x72f8('0x2d')]+_0x323795[_0x72f8('0x2f')];var _0x1ab95e;if(_0xf06103>=_0x419be6){_0xf06103=_0x419be6;_0x1ab95e=0xc8;}else{_0x1ab95e=0xce;}_0x2633e6[_0x72f8('0x2c')](_0x1ab95e);return _0x2633e6[_0x72f8('0x31')]('Content-Range',_0x33f3b8+'-'+_0xf06103+'/'+_0x419be6)[_0x72f8('0x32')](_0x210628);}return null;};}function patchUpdates(_0x25720f){return function(_0x14798a){try{jsonpatch[_0x72f8('0x33')](_0x14798a,_0x25720f,!![]);}catch(_0xa02fce){return BPromise[_0x72f8('0x34')](_0xa02fce);}return _0x14798a['save']();};}function saveUpdates(_0x2f29fe,_0x29082b){return function(_0x22e3d2){if(_0x22e3d2){return _0x22e3d2[_0x72f8('0x35')](_0x2f29fe)[_0x72f8('0x20')](function(_0x4e6a52){return _0x4e6a52;});}return null;};}function removeEntity(_0x1b41e7,_0x122017){return function(_0x2f9cc2){if(_0x2f9cc2){return _0x2f9cc2['destroy']()[_0x72f8('0x20')](function(){var _0x59e5ee=_0x2f9cc2['get']({'plain':!![]});var _0x1b7653='ChatQueues';return db[_0x72f8('0x36')][_0x72f8('0x37')]({'where':{'type':_0x1b7653,'resourceId':_0x59e5ee['id']}})[_0x72f8('0x20')](function(){return _0x2f9cc2;});})[_0x72f8('0x20')](function(){_0x1b41e7[_0x72f8('0x2c')](0xcc)[_0x72f8('0x38')]();});}};}function handleEntityNotFound(_0x527af4,_0x5ca29a){return function(_0x183ac4){if(!_0x183ac4){_0x527af4[_0x72f8('0x2b')](0x194);}return _0x183ac4;};}function handleError(_0x2a37a9,_0x2d606b){_0x2d606b=_0x2d606b||0x1f4;return function(_0x680cc5){logger[_0x72f8('0x25')](_0x680cc5[_0x72f8('0x39')]);if(_0x680cc5[_0x72f8('0x3a')]){delete _0x680cc5[_0x72f8('0x3a')];}_0x2a37a9[_0x72f8('0x2c')](_0x2d606b)[_0x72f8('0x3b')](_0x680cc5);};}exports['index']=function(_0x7a1dc8,_0x22aa94){var _0x70efc7={},_0x4d5a69={},_0x3a2c8b={'count':0x0,'rows':[]};var _0x144c1f=_['map'](db['ChatQueue']['rawAttributes'],function(_0x39550f){return{'name':_0x39550f[_0x72f8('0x3c')],'type':_0x39550f[_0x72f8('0x3d')][_0x72f8('0x3e')]};});_0x4d5a69[_0x72f8('0x3f')]=_[_0x72f8('0x40')](_0x144c1f,_0x72f8('0x3a'));_0x4d5a69[_0x72f8('0x41')]=_['keys'](_0x7a1dc8[_0x72f8('0x41')]);_0x4d5a69[_0x72f8('0x42')]=_[_0x72f8('0x43')](_0x4d5a69['model'],_0x4d5a69[_0x72f8('0x41')]);_0x70efc7['attributes']=_[_0x72f8('0x43')](_0x4d5a69[_0x72f8('0x3f')],qs[_0x72f8('0x44')](_0x7a1dc8['query'][_0x72f8('0x44')]));_0x70efc7['attributes']=_0x70efc7[_0x72f8('0x45')][_0x72f8('0x46')]?_0x70efc7[_0x72f8('0x45')]:_0x4d5a69[_0x72f8('0x3f')];if(!_0x7a1dc8['query'][_0x72f8('0x47')]('nolimit')){_0x70efc7[_0x72f8('0x2f')]=qs[_0x72f8('0x2f')](_0x7a1dc8[_0x72f8('0x41')]['limit']);_0x70efc7['offset']=qs[_0x72f8('0x2d')](_0x7a1dc8['query'][_0x72f8('0x2d')]);}_0x70efc7[_0x72f8('0x48')]=qs[_0x72f8('0x49')](_0x7a1dc8['query']['sort']);_0x70efc7['where']=qs['filters'](_['pick'](_0x7a1dc8[_0x72f8('0x41')],_0x4d5a69[_0x72f8('0x42')]),_0x144c1f);if(_0x7a1dc8['query'][_0x72f8('0x4a')]){_0x70efc7['where']=_[_0x72f8('0x4b')](_0x70efc7[_0x72f8('0x4c')],{'$or':_[_0x72f8('0x40')](_0x144c1f,function(_0x407aa7){if(_0x407aa7[_0x72f8('0x3d')]!==_0x72f8('0x4d')){var _0x122a95={};_0x122a95[_0x407aa7[_0x72f8('0x3a')]]={'$like':'%'+_0x7a1dc8['query'][_0x72f8('0x4a')]+'%'};return _0x122a95;}})});}_0x70efc7=_[_0x72f8('0x4b')]({},_0x70efc7,_0x7a1dc8[_0x72f8('0x4e')]);var _0x39a85f={'where':_0x70efc7[_0x72f8('0x4c')]};return db[_0x72f8('0x4f')][_0x72f8('0x30')](_0x39a85f)[_0x72f8('0x20')](function(_0x5c2539){_0x3a2c8b['count']=_0x5c2539;if(_0x7a1dc8['query'][_0x72f8('0x50')]){_0x70efc7[_0x72f8('0x51')]=[{'all':!![]}];}return db['ChatQueue']['findAll'](_0x70efc7);})[_0x72f8('0x20')](function(_0x2a98df){_0x3a2c8b['rows']=_0x2a98df;return _0x3a2c8b;})[_0x72f8('0x20')](respondWithFilteredResult(_0x22aa94,_0x70efc7))['catch'](handleError(_0x22aa94,null));};exports['show']=function(_0x434e33,_0xa2f10){var _0x1ab20b={'raw':!![],'where':{'id':_0x434e33[_0x72f8('0x52')]['id']}},_0x1e1d7d={};_0x1e1d7d[_0x72f8('0x3f')]=_[_0x72f8('0x53')](db[_0x72f8('0x4f')][_0x72f8('0x54')]);_0x1e1d7d[_0x72f8('0x41')]=_[_0x72f8('0x53')](_0x434e33[_0x72f8('0x41')]);_0x1e1d7d[_0x72f8('0x42')]=_[_0x72f8('0x43')](_0x1e1d7d[_0x72f8('0x3f')],_0x1e1d7d[_0x72f8('0x41')]);_0x1ab20b[_0x72f8('0x45')]=_[_0x72f8('0x43')](_0x1e1d7d[_0x72f8('0x3f')],qs[_0x72f8('0x44')](_0x434e33[_0x72f8('0x41')]['fields']));_0x1ab20b[_0x72f8('0x45')]=_0x1ab20b[_0x72f8('0x45')][_0x72f8('0x46')]?_0x1ab20b['attributes']:_0x1e1d7d['model'];if(_0x434e33[_0x72f8('0x41')]['includeAll']){_0x1ab20b[_0x72f8('0x51')]=[{'all':!![]}];}_0x1ab20b=_[_0x72f8('0x4b')]({},_0x1ab20b,_0x434e33['options']);return db[_0x72f8('0x4f')][_0x72f8('0x55')](_0x1ab20b)[_0x72f8('0x20')](handleEntityNotFound(_0xa2f10,null))[_0x72f8('0x20')](respondWithResult(_0xa2f10,null))['catch'](handleError(_0xa2f10,null));};exports[_0x72f8('0x56')]=function(_0x15a80a,_0x3b0859){return db['ChatQueue']['create'](_0x15a80a[_0x72f8('0x57')],{})[_0x72f8('0x20')](function(_0x19de47){var _0x262760=_0x15a80a['user'][_0x72f8('0x58')]({'plain':!![]});if(!_0x262760)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x262760[_0x72f8('0x59')]==='user'){var _0x4761c1=_0x19de47['get']({'plain':!![]});var _0x3fd6ee=_0x72f8('0x5a');return db['UserProfileSection'][_0x72f8('0x55')]({'where':{'name':_0x3fd6ee,'userProfileId':_0x262760[_0x72f8('0x5b')]},'raw':!![]})[_0x72f8('0x20')](function(_0x20836e){if(_0x20836e&&_0x20836e[_0x72f8('0x5c')]===0x0){return db[_0x72f8('0x36')][_0x72f8('0x56')]({'name':_0x4761c1[_0x72f8('0x3a')],'resourceId':_0x4761c1['id'],'type':_0x20836e[_0x72f8('0x3a')],'sectionId':_0x20836e['id']},{})[_0x72f8('0x20')](function(){return _0x19de47;});}else{return _0x19de47;}})[_0x72f8('0x2a')](function(_0x21590b){logger[_0x72f8('0x25')](_0x72f8('0x5d'),_0x21590b);throw _0x21590b;});}return _0x19de47;})['then'](respondWithResult(_0x3b0859,0xc9))[_0x72f8('0x2a')](handleError(_0x3b0859,null));};exports[_0x72f8('0x35')]=function(_0x10f26f,_0x1df9a8){if(_0x10f26f[_0x72f8('0x57')]['id']){delete _0x10f26f[_0x72f8('0x57')]['id'];}return db[_0x72f8('0x4f')]['find']({'where':{'id':_0x10f26f[_0x72f8('0x52')]['id']}})[_0x72f8('0x20')](handleEntityNotFound(_0x1df9a8,null))['then'](saveUpdates(_0x10f26f[_0x72f8('0x57')],null))[_0x72f8('0x20')](respondWithResult(_0x1df9a8,null))[_0x72f8('0x2a')](handleError(_0x1df9a8,null));};exports['destroy']=function(_0x3ba9b0,_0x3f1f53){return db['ChatQueue'][_0x72f8('0x55')]({'where':{'id':_0x3ba9b0[_0x72f8('0x52')]['id']}})[_0x72f8('0x20')](handleEntityNotFound(_0x3f1f53,null))[_0x72f8('0x20')](removeEntity(_0x3f1f53,null))['catch'](handleError(_0x3f1f53,null));};exports[_0x72f8('0x5e')]=function(_0x469a5d,_0x2bcae4){return db[_0x72f8('0x4f')][_0x72f8('0x5e')]()['then'](respondWithResult(_0x2bcae4,null))[_0x72f8('0x2a')](handleError(_0x2bcae4,null));};exports[_0x72f8('0x5f')]=function(_0x585adc,_0x38f5a7,_0xb8a604){var _0x15abff={'raw':!![],'where':{}},_0x1c2464={},_0x9be2fa;return db[_0x72f8('0x4f')]['findOne']({'where':{'id':_0x585adc[_0x72f8('0x52')]['id']}})[_0x72f8('0x20')](handleEntityNotFound(_0x38f5a7,null))[_0x72f8('0x20')](function(_0x1267ea){if(_0x1267ea){_0x9be2fa=_0x1267ea['get']({'plain':!![]});_0x1c2464[_0x72f8('0x3f')]=_['keys'](db[_0x72f8('0x60')][_0x72f8('0x54')]);_0x1c2464[_0x72f8('0x41')]=_[_0x72f8('0x53')](_0x585adc[_0x72f8('0x41')]);_0x1c2464[_0x72f8('0x42')]=_[_0x72f8('0x43')](_0x1c2464['model'],_0x1c2464[_0x72f8('0x41')]);_0x15abff['attributes']=_[_0x72f8('0x43')](_0x1c2464[_0x72f8('0x3f')],qs['fields'](_0x585adc[_0x72f8('0x41')][_0x72f8('0x44')]));_0x15abff[_0x72f8('0x45')]=_0x15abff[_0x72f8('0x45')][_0x72f8('0x46')]?_0x15abff[_0x72f8('0x45')]:_0x1c2464[_0x72f8('0x3f')];if(!_0x585adc['query'][_0x72f8('0x47')](_0x72f8('0x61'))){_0x15abff[_0x72f8('0x2f')]=qs['limit'](_0x585adc[_0x72f8('0x41')]['limit']);_0x15abff[_0x72f8('0x2d')]=qs[_0x72f8('0x2d')](_0x585adc[_0x72f8('0x41')][_0x72f8('0x2d')]);}_0x15abff[_0x72f8('0x48')]=qs['sort'](_0x585adc[_0x72f8('0x41')][_0x72f8('0x49')]);_0x15abff[_0x72f8('0x4c')]=qs['filters'](_[_0x72f8('0x62')](_0x585adc[_0x72f8('0x41')],_0x1c2464[_0x72f8('0x42')]));_0x15abff['where'][_0x72f8('0x63')]=_0x1267ea['id'];if(_0x585adc[_0x72f8('0x41')]['filter']){_0x15abff['where']=_[_0x72f8('0x4b')](_0x15abff[_0x72f8('0x4c')],{'$or':_['map'](_0x15abff[_0x72f8('0x45')],function(_0x4c4bd1){var _0x5e2c06={};_0x5e2c06[_0x4c4bd1]={'$like':'%'+_0x585adc[_0x72f8('0x41')][_0x72f8('0x4a')]+'%'};return _0x5e2c06;})});}_0x15abff=_[_0x72f8('0x4b')]({},_0x15abff,_0x585adc[_0x72f8('0x4e')]);return db['UserChatQueue']['findAll'](_0x15abff);}})[_0x72f8('0x20')](function(_0x397f59){if(_0x397f59){return db[_0x72f8('0x64')][_0x72f8('0x65')]({'where':{'id':_[_0x72f8('0x40')](_0x397f59,_0x72f8('0x66')),'role':'agent'},'attributes':['id','name','chatPause',_0x72f8('0x67'),'createdAt']});}})['then'](function(_0x2ea4b0){if(_0x2ea4b0){return{'count':_0x2ea4b0[_0x72f8('0x30')],'rows':_['map'](_0x2ea4b0[_0x72f8('0x68')],function(_0x3a2436){return{'membername':_0x3a2436[_0x72f8('0x3a')],'UserId':_0x3a2436['id'],'queue_name':_0x9be2fa['name'],'ChatQueueId':_0x9be2fa['id'],'interface':util[_0x72f8('0x69')]('%s/%s',_0x72f8('0x6a'),_0x3a2436[_0x72f8('0x3a')]),'penalty':0x0,'paused':_0x3a2436[_0x72f8('0x6b')],'createdAt':_0x3a2436[_0x72f8('0x6c')],'updatedAt':_0x3a2436[_0x72f8('0x67')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x72f8('0x20')](respondWithFilteredResult(_0x38f5a7,_0x15abff))[_0x72f8('0x2a')](handleError(_0x38f5a7,null));};exports['getTeams']=function(_0x64c593,_0x221660,_0x3afb2c){var _0xb6812e={};var _0x12faef={};var _0x52993f;var _0x4f9d15;return db[_0x72f8('0x4f')][_0x72f8('0x6d')]({'where':{'id':_0x64c593[_0x72f8('0x52')]['id']}})[_0x72f8('0x20')](handleEntityNotFound(_0x221660,null))[_0x72f8('0x20')](function(_0x378e5b){if(_0x378e5b){_0x52993f=_0x378e5b;_0x12faef['model']=_[_0x72f8('0x53')](db['Team'][_0x72f8('0x54')]);_0x12faef[_0x72f8('0x41')]=_[_0x72f8('0x53')](_0x64c593[_0x72f8('0x41')]);_0x12faef[_0x72f8('0x42')]=_[_0x72f8('0x43')](_0x12faef[_0x72f8('0x3f')],_0x12faef[_0x72f8('0x41')]);_0xb6812e[_0x72f8('0x45')]=_[_0x72f8('0x43')](_0x12faef['model'],qs[_0x72f8('0x44')](_0x64c593[_0x72f8('0x41')][_0x72f8('0x44')]));_0xb6812e['attributes']=_0xb6812e['attributes'][_0x72f8('0x46')]?_0xb6812e[_0x72f8('0x45')]:_0x12faef[_0x72f8('0x3f')];_0xb6812e[_0x72f8('0x48')]=qs['sort'](_0x64c593[_0x72f8('0x41')]['sort']);_0xb6812e[_0x72f8('0x4c')]=qs[_0x72f8('0x42')](_[_0x72f8('0x62')](_0x64c593[_0x72f8('0x41')],_0x12faef[_0x72f8('0x42')]));if(_0x64c593['query'][_0x72f8('0x4a')]){_0xb6812e[_0x72f8('0x4c')]=_[_0x72f8('0x4b')](_0xb6812e[_0x72f8('0x4c')],{'$or':_['map'](_0xb6812e[_0x72f8('0x45')],function(_0x7862f9){var _0x1b6cd6={};_0x1b6cd6[_0x7862f9]={'$like':'%'+_0x64c593[_0x72f8('0x41')]['filter']+'%'};return _0x1b6cd6;})});}_0xb6812e=_[_0x72f8('0x4b')]({},_0xb6812e,_0x64c593[_0x72f8('0x4e')]);return _0x52993f[_0x72f8('0x6e')](_0xb6812e);}})['then'](function(_0x565c57){if(_0x565c57){_0x4f9d15=_0x565c57[_0x72f8('0x46')];if(!_0x64c593[_0x72f8('0x41')]['hasOwnProperty'](_0x72f8('0x61'))){_0xb6812e['limit']=qs[_0x72f8('0x2f')](_0x64c593[_0x72f8('0x41')][_0x72f8('0x2f')]);_0xb6812e['offset']=qs[_0x72f8('0x2d')](_0x64c593[_0x72f8('0x41')][_0x72f8('0x2d')]);}return _0x52993f[_0x72f8('0x6e')](_0xb6812e);}})[_0x72f8('0x20')](function(_0x3198b1){if(_0x3198b1){return _0x3198b1?{'count':_0x4f9d15,'rows':_0x3198b1}:null;}})['then'](respondWithResult(_0x221660,null))[_0x72f8('0x2a')](handleError(_0x221660,null));};exports[_0x72f8('0x6f')]=function(_0x2d6129,_0x3b601c,_0x225d24){var _0x266f18=_0x2d6129['body']['ids'];return db['Team'][_0x72f8('0x70')]({'where':{'id':_0x266f18},'attributes':['id'],'include':[{'model':db[_0x72f8('0x64')],'as':_0x72f8('0x71'),'attributes':['id','name','online',_0x72f8('0x72'),_0x72f8('0x73')],'raw':!![]}]})['then'](function(_0x357de4){if(_0x357de4){var _0x38c107=_['flatMap'](_0x357de4,function(_0xddfe40){var _0x4f1717=_0xddfe40[_0x72f8('0x58')]({'plain':!![]});return _0x4f1717[_0x72f8('0x71')];});return db[_0x72f8('0x4f')]['find']({'where':{'id':_0x2d6129[_0x72f8('0x52')]['id']}})[_0x72f8('0x20')](function(_0x44bc17){return db['sequelize'][_0x72f8('0x74')](function(_0x4c384a){return _0x44bc17[_0x72f8('0x6f')](_0x266f18,{'transaction':_0x4c384a})[_0x72f8('0x20')](function(){return BPromise[_0x72f8('0x75')](_0x38c107,function(_0x13e161){return db['UserChatQueue'][_0x72f8('0x76')]({'where':{'UserId':_0x13e161['id'],'ChatQueueId':_0x2d6129[_0x72f8('0x52')]['id']},'transaction':_0x4c384a});});})[_0x72f8('0x20')](function(){_0x38c107[_0x72f8('0x77')](function(_0x3ed5ce){socket[_0x72f8('0x78')](_0x72f8('0x79'),{'UserId':_0x3ed5ce['id'],'ChatQueueId':_0x44bc17['id']});});});});});}})[_0x72f8('0x20')](respondWithStatusCode(_0x3b601c,null))['catch'](handleError(_0x3b601c,null));};exports['removeTeams']=function(_0x47da86,_0x32ceb5,_0x34e9a5){return db[_0x72f8('0x7a')][_0x72f8('0x70')]({'where':{'id':_0x47da86[_0x72f8('0x41')][_0x72f8('0x7b')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x32ceb5,null))[_0x72f8('0x20')](function(_0x3c07ba){var _0x442a82=_['map'](_0x3c07ba,'id');var _0x1ce612=[];var _0x1ee3c2=[];var _0x146180=squel[_0x72f8('0x7c')]();_0x146180['field'](_0x72f8('0x7d'))[_0x72f8('0x7e')](_0x72f8('0x7f'),'tq')[_0x72f8('0x80')](_0x72f8('0x81'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0x72f8('0x82'),_0x47da86[_0x72f8('0x52')]['id']);for(var _0x4a302b=0x0;_0x4a302b<_0x3c07ba[_0x72f8('0x46')];_0x4a302b+=0x1){let _0x4896eb=_0x3c07ba[_0x4a302b];for(var _0x47aedb=0x0;_0x47aedb<_0x4896eb[_0x72f8('0x71')]['length'];_0x47aedb+=0x1){let _0x14a0c3=_0x4896eb[_0x72f8('0x71')][_0x47aedb];var _0x25bbc8=_0x146180[_0x72f8('0x83')]();_0x25bbc8[_0x72f8('0x4c')](_0x72f8('0x84'),_0x14a0c3['id']);_0x1ee3c2[_0x72f8('0x85')](db[_0x72f8('0x86')][_0x72f8('0x41')](_0x25bbc8[_0x72f8('0x87')](),{'type':db[_0x72f8('0x86')][_0x72f8('0x88')][_0x72f8('0x89')]})[_0x72f8('0x20')](function(_0x1f80ff){if(_0x1f80ff[_0x72f8('0x46')]===0x1){return _0x14a0c3['id'];}else{var _0x2ba3fd=_['every'](_[_0x72f8('0x40')](_0x1f80ff,_0x72f8('0x8a')),function(_0x290388){return _[_0x72f8('0x8b')](_0x442a82,_0x290388);});if(_0x2ba3fd){return _0x14a0c3['id'];}}}));}}return BPromise[_0x72f8('0x8c')](_0x1ee3c2)['then'](function(_0x48a9c5){_0x1ce612=_(_0x1ce612)[_0x72f8('0x8d')](_0x48a9c5)['compact']()[_0x72f8('0x8e')]();return db[_0x72f8('0x4f')][_0x72f8('0x55')]({'where':{'id':_0x47da86['params']['id']}})[_0x72f8('0x20')](function(_0x2c7107){return db['sequelize'][_0x72f8('0x74')](function(_0x1274d8){return _0x2c7107[_0x72f8('0x8f')](_0x47da86['query']['ids'],{'transaction':_0x1274d8})['then'](function(){if(!_[_0x72f8('0x90')](_0x1ce612)){return _0x2c7107[_0x72f8('0x91')](_0x1ce612,{'transaction':_0x1274d8});}})['then'](function(){_0x1ce612[_0x72f8('0x77')](function(_0x575d05){socket[_0x72f8('0x78')]('userChatQueue:remove',{'UserId':_0x575d05,'ChatQueueId':_0x2c7107['id']});});});});});});})[_0x72f8('0x20')](respondWithStatusCode(_0x32ceb5,null))[_0x72f8('0x2a')](handleError(_0x32ceb5,null));};exports[_0x72f8('0x92')]=function(_0x3b0abb,_0x59dc87,_0x271472){return db[_0x72f8('0x4f')]['find']({'where':{'id':_0x3b0abb['params']['id']}})[_0x72f8('0x20')](handleEntityNotFound(_0x59dc87,null))[_0x72f8('0x20')](function(_0x1e5707){if(_0x1e5707){return _0x1e5707[_0x72f8('0x92')](_0x3b0abb['body'][_0x72f8('0x7b')],_[_0x72f8('0x93')](_0x3b0abb['body'],[_0x72f8('0x7b'),'id'])||{})['spread'](function(_0x4f2746){for(var _0x236464=0x0;_0x236464<_0x3b0abb['body'][_0x72f8('0x7b')][_0x72f8('0x46')];_0x236464+=0x1){socket[_0x72f8('0x78')]('userChatQueue:save',{'UserId':Number(_0x3b0abb['body']['ids'][_0x236464]),'ChatQueueId':Number(_0x3b0abb[_0x72f8('0x52')]['id'])});}return _0x4f2746;});}})[_0x72f8('0x20')](respondWithResult(_0x59dc87,null))['catch'](handleError(_0x59dc87,null));};exports[_0x72f8('0x91')]=function(_0x21366a,_0x403fd9,_0x1ef836){return db[_0x72f8('0x4f')]['find']({'where':{'id':_0x21366a[_0x72f8('0x52')]['id']}})[_0x72f8('0x20')](handleEntityNotFound(_0x403fd9,null))[_0x72f8('0x20')](function(_0x24eb2d){if(_0x24eb2d){return _0x24eb2d['removeAgents'](_0x21366a[_0x72f8('0x41')][_0x72f8('0x7b')])['then'](function(){if(_['isArray'](_0x21366a['query'][_0x72f8('0x7b')])){for(var _0x31ea8e=0x0;_0x31ea8e<_0x21366a[_0x72f8('0x41')][_0x72f8('0x7b')][_0x72f8('0x46')];_0x31ea8e+=0x1){socket['emit'](_0x72f8('0x94'),{'UserId':Number(_0x21366a[_0x72f8('0x41')]['ids'][_0x31ea8e]),'ChatQueueId':Number(_0x21366a[_0x72f8('0x52')]['id'])});}}else{socket['emit'](_0x72f8('0x94'),{'UserId':Number(_0x21366a['query'][_0x72f8('0x7b')]),'ChatQueueId':Number(_0x21366a['params']['id'])});}});}})[_0x72f8('0x20')](respondWithStatusCode(_0x403fd9,null))[_0x72f8('0x2a')](handleError(_0x403fd9,null));};exports['getAgents']=function(_0x2ceb9b,_0xdca97b,_0x5ca41c){var _0x4b8c05={};var _0x2109dd={};var _0x239eba;var _0x3e84c6;return db[_0x72f8('0x4f')][_0x72f8('0x6d')]({'where':{'id':_0x2ceb9b[_0x72f8('0x52')]['id']}})[_0x72f8('0x20')](handleEntityNotFound(_0xdca97b,null))[_0x72f8('0x20')](function(_0x4fc861){if(_0x4fc861){_0x239eba=_0x4fc861;_0x2109dd['model']=_[_0x72f8('0x53')](db[_0x72f8('0x64')][_0x72f8('0x54')]);_0x2109dd['query']=_[_0x72f8('0x53')](_0x2ceb9b[_0x72f8('0x41')]);_0x2109dd[_0x72f8('0x42')]=_[_0x72f8('0x43')](_0x2109dd[_0x72f8('0x3f')],_0x2109dd[_0x72f8('0x41')]);_0x4b8c05['attributes']=_[_0x72f8('0x43')](_0x2109dd[_0x72f8('0x3f')],qs[_0x72f8('0x44')](_0x2ceb9b['query'][_0x72f8('0x44')]));_0x4b8c05[_0x72f8('0x45')]=_0x4b8c05['attributes']['length']?_0x4b8c05[_0x72f8('0x45')]:_0x2109dd[_0x72f8('0x3f')];_0x4b8c05[_0x72f8('0x48')]=qs['sort'](_0x2ceb9b['query'][_0x72f8('0x49')]);_0x4b8c05[_0x72f8('0x4c')]=qs[_0x72f8('0x42')](_[_0x72f8('0x62')](_0x2ceb9b['query'],_0x2109dd[_0x72f8('0x42')]));if(_0x2ceb9b[_0x72f8('0x41')][_0x72f8('0x4a')]){_0x4b8c05[_0x72f8('0x4c')]=_['merge'](_0x4b8c05[_0x72f8('0x4c')],{'$or':_[_0x72f8('0x40')](_0x4b8c05[_0x72f8('0x45')],function(_0xed0ccc){var _0x2e8921={};_0x2e8921[_0xed0ccc]={'$like':'%'+_0x2ceb9b['query'][_0x72f8('0x4a')]+'%'};return _0x2e8921;})});}_0x4b8c05=_[_0x72f8('0x4b')]({},_0x4b8c05,_0x2ceb9b['options']);return _0x239eba[_0x72f8('0x95')](_0x4b8c05);}})[_0x72f8('0x20')](function(_0x287781){if(_0x287781){_0x3e84c6=_0x287781[_0x72f8('0x46')];if(!_0x2ceb9b['query'][_0x72f8('0x47')]('nolimit')){_0x4b8c05['limit']=qs[_0x72f8('0x2f')](_0x2ceb9b[_0x72f8('0x41')]['limit']);_0x4b8c05[_0x72f8('0x2d')]=qs['offset'](_0x2ceb9b[_0x72f8('0x41')]['offset']);}return _0x239eba[_0x72f8('0x95')](_0x4b8c05);}})['then'](function(_0x38b831){if(_0x38b831){return _0x38b831?{'count':_0x3e84c6,'rows':_0x38b831}:null;}})[_0x72f8('0x20')](respondWithResult(_0xdca97b,null))[_0x72f8('0x2a')](handleError(_0xdca97b,null));};
\ No newline at end of file
index 818a096..79a7644 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf5b7=['save','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','ChatQueue','setMaxListeners'];(function(_0x43cd76,_0x595855){var _0x1b3f7b=function(_0xa65115){while(--_0xa65115){_0x43cd76['push'](_0x43cd76['shift']());}};_0x1b3f7b(++_0x595855);}(_0xf5b7,0xf7));var _0x7f5b=function(_0x3ba095,_0x29b419){_0x3ba095=_0x3ba095-0x0;var _0x38b10f=_0xf5b7[_0x3ba095];return _0x38b10f;};'use strict';var EventEmitter=require('events');var ChatQueue=require(_0x7f5b('0x0'))['db'][_0x7f5b('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x7f5b('0x2')](0x0);var events={'afterCreate':_0x7f5b('0x3'),'afterUpdate':_0x7f5b('0x4'),'afterDestroy':_0x7f5b('0x5')};function emitEvent(_0x4adde7){return function(_0x30569b,_0x566b54,_0xb1bfd3){ChatQueueEvents[_0x7f5b('0x6')](_0x4adde7+':'+_0x30569b['id'],_0x30569b);ChatQueueEvents['emit'](_0x4adde7,_0x30569b);_0xb1bfd3(null);};}for(var e in events){if(events[_0x7f5b('0x7')](e)){var event=events[e];ChatQueue[_0x7f5b('0x8')](e,emitEvent(event));}}module[_0x7f5b('0x9')]=ChatQueueEvents;
\ No newline at end of file
+var _0xb4a9=['exports','events','setMaxListeners','remove','emit','hasOwnProperty','hook'];(function(_0x332e43,_0x252844){var _0x13bee3=function(_0x28c39a){while(--_0x28c39a){_0x332e43['push'](_0x332e43['shift']());}};_0x13bee3(++_0x252844);}(_0xb4a9,0x1c1));var _0x9b4a=function(_0x3a8be4,_0x11056d){_0x3a8be4=_0x3a8be4-0x0;var _0x5f0406=_0xb4a9[_0x3a8be4];return _0x5f0406;};'use strict';var EventEmitter=require(_0x9b4a('0x0'));var ChatQueue=require('../../mysqldb')['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x9b4a('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x9b4a('0x2')};function emitEvent(_0x48824e){return function(_0x5cc501,_0x1a1ec6,_0x6e3590){ChatQueueEvents[_0x9b4a('0x3')](_0x48824e+':'+_0x5cc501['id'],_0x5cc501);ChatQueueEvents[_0x9b4a('0x3')](_0x48824e,_0x5cc501);_0x6e3590(null);};}for(var e in events){if(events[_0x9b4a('0x4')](e)){var event=events[e];ChatQueue[_0x9b4a('0x5')](e,emitEvent(event));}}module[_0x9b4a('0x6')]=ChatQueueEvents;
\ No newline at end of file
index bb4a94e..b142aad 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x82b9=['moment','bluebird','path','rimraf','./chatQueue.attributes','define','ChatQueue','chat_queues','util','../../config/logger','api'];(function(_0x9ec221,_0x2594a6){var _0xdbe55e=function(_0x4b4c43){while(--_0x4b4c43){_0x9ec221['push'](_0x9ec221['shift']());}};_0xdbe55e(++_0x2594a6);}(_0x82b9,0x11b));var _0x982b=function(_0x352311,_0x5b2dfc){_0x352311=_0x352311-0x0;var _0x15c3c6=_0x82b9[_0x352311];return _0x15c3c6;};'use strict';var _=require('lodash');var util=require(_0x982b('0x0'));var logger=require(_0x982b('0x1'))(_0x982b('0x2'));var moment=require(_0x982b('0x3'));var BPromise=require(_0x982b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x982b('0x5'));var rimraf=require(_0x982b('0x6'));var config=require('../../config/environment');var attributes=require(_0x982b('0x7'));module['exports']=function(_0x2533f5,_0x1b41e5){return _0x2533f5[_0x982b('0x8')](_0x982b('0x9'),attributes,{'tableName':_0x982b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0b48=['bluebird','request-promise','../../config/environment','exports','define','ChatQueue','util','api','moment'];(function(_0x430f44,_0x4ae21b){var _0x1f6b0f=function(_0x35968f){while(--_0x35968f){_0x430f44['push'](_0x430f44['shift']());}};_0x1f6b0f(++_0x4ae21b);}(_0x0b48,0x1bf));var _0x80b4=function(_0xc22a01,_0x77c37f){_0xc22a01=_0xc22a01-0x0;var _0x26ffbc=_0x0b48[_0xc22a01];return _0x26ffbc;};'use strict';var _=require('lodash');var util=require(_0x80b4('0x0'));var logger=require('../../config/logger')(_0x80b4('0x1'));var moment=require(_0x80b4('0x2'));var BPromise=require(_0x80b4('0x3'));var rp=require(_0x80b4('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x80b4('0x5'));var attributes=require('./chatQueue.attributes');module[_0x80b4('0x6')]=function(_0x4bd2f4,_0x36eb76){return _0x4bd2f4[_0x80b4('0x7')](_0x80b4('0x8'),attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 1ccb7d7..ba22160 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5ed0=['debug','error','code','message','result','catch','GetChatQueue','ChatQueue','options','raw','limit','include','model','attributes','map','stringify','ShowChatQueue','find','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','redis','defaults','localhost','register','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent'];(function(_0x5237de,_0x28dfaa){var _0x53eb92=function(_0x34f770){while(--_0x34f770){_0x5237de['push'](_0x5237de['shift']());}};_0x53eb92(++_0x28dfaa);}(_0x5ed0,0xcb));var _0x05ed=function(_0x4d0899,_0x23afea){_0x4d0899=_0x4d0899-0x0;var _0x360aab=_0x5ed0[_0x4d0899];return _0x360aab;};'use strict';var _=require('lodash');var util=require(_0x05ed('0x0'));var moment=require(_0x05ed('0x1'));var BPromise=require(_0x05ed('0x2'));var rs=require(_0x05ed('0x3'));var fs=require('fs');var Redis=require(_0x05ed('0x4'));var db=require(_0x05ed('0x5'))['db'];var utils=require(_0x05ed('0x6'));var logger=require(_0x05ed('0x7'))('rpc');var config=require(_0x05ed('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x05ed('0x9')]({'port':0x232a});config[_0x05ed('0xa')]=_[_0x05ed('0xb')](config[_0x05ed('0xa')],{'host':_0x05ed('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x05ed('0xa')]));require('./chatQueue.socket')[_0x05ed('0xd')](socket);function respondWithRpcPromise(_0x1f64ac,_0x4dd2e4,_0x8a6298){return new BPromise(function(_0x1c6502,_0x4fdba5){return client[_0x05ed('0xe')](_0x1f64ac,_0x8a6298)[_0x05ed('0xf')](function(_0x18954b){logger[_0x05ed('0x10')](_0x05ed('0x11'),_0x4dd2e4,_0x05ed('0x12'));logger[_0x05ed('0x13')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x4dd2e4,'request\x20sent',JSON['stringify'](_0x18954b));if(_0x18954b[_0x05ed('0x14')]){if(_0x18954b[_0x05ed('0x14')][_0x05ed('0x15')]===0x1f4){logger['error'](_0x05ed('0x11'),_0x4dd2e4,_0x18954b[_0x05ed('0x14')][_0x05ed('0x16')]);return _0x4fdba5(_0x18954b[_0x05ed('0x14')]['message']);}logger[_0x05ed('0x14')](_0x05ed('0x11'),_0x4dd2e4,_0x18954b[_0x05ed('0x14')]['message']);return _0x1c6502(_0x18954b[_0x05ed('0x14')][_0x05ed('0x16')]);}else{logger['info'](_0x05ed('0x11'),_0x4dd2e4,'request\x20sent');_0x1c6502(_0x18954b[_0x05ed('0x17')][_0x05ed('0x16')]);}})[_0x05ed('0x18')](function(_0x519124){logger['error'](_0x05ed('0x11'),_0x4dd2e4,_0x519124);_0x4fdba5(_0x519124);});});}exports[_0x05ed('0x19')]=function(_0x28de40){var _0x1bdf4d=this;return new Promise(function(_0x397a45,_0x3b023c){return db[_0x05ed('0x1a')]['findAll']({'raw':_0x28de40[_0x05ed('0x1b')]?_0x28de40[_0x05ed('0x1b')][_0x05ed('0x1c')]===undefined?!![]:![]:!![],'where':_0x28de40['options']?_0x28de40[_0x05ed('0x1b')]['where']||null:null,'attributes':_0x28de40[_0x05ed('0x1b')]?_0x28de40['options']['attributes']||null:null,'limit':_0x28de40['options']?_0x28de40['options'][_0x05ed('0x1d')]||null:null,'include':_0x28de40[_0x05ed('0x1b')]?_0x28de40[_0x05ed('0x1b')][_0x05ed('0x1e')]?_['map'](_0x28de40['options'][_0x05ed('0x1e')],function(_0x307321){return{'model':db[_0x307321[_0x05ed('0x1f')]],'as':_0x307321['as'],'attributes':_0x307321[_0x05ed('0x20')],'include':_0x307321[_0x05ed('0x1e')]?_[_0x05ed('0x21')](_0x307321[_0x05ed('0x1e')],function(_0x141c8f){return{'model':db[_0x141c8f[_0x05ed('0x1f')]],'as':_0x141c8f['as'],'attributes':_0x141c8f['attributes'],'include':_0x141c8f['include']?_['map'](_0x141c8f[_0x05ed('0x1e')],function(_0x5854cc){return{'model':db[_0x5854cc[_0x05ed('0x1f')]],'as':_0x5854cc['as'],'attributes':_0x5854cc[_0x05ed('0x20')]};}):[]};}):[]};}):[]:[]})[_0x05ed('0xf')](function(_0x4db7f4){logger['info'](_0x05ed('0x19'),_0x28de40);logger['debug'](_0x05ed('0x19'),_0x28de40,JSON[_0x05ed('0x22')](_0x4db7f4));_0x397a45(_0x4db7f4);})[_0x05ed('0x18')](function(_0x7644f0){logger[_0x05ed('0x14')](_0x05ed('0x19'),_0x7644f0['message'],_0x28de40);_0x3b023c(_0x1bdf4d['error'](0x1f4,_0x7644f0[_0x05ed('0x16')]));});});};exports[_0x05ed('0x23')]=function(_0x409588){var _0x1c7759=this;return new Promise(function(_0x1668ba,_0x3e95ad){return db[_0x05ed('0x1a')][_0x05ed('0x24')]({'raw':_0x409588[_0x05ed('0x1b')]?_0x409588[_0x05ed('0x1b')][_0x05ed('0x1c')]===undefined?!![]:![]:!![],'where':_0x409588['options']?_0x409588['options']['where']||null:null,'attributes':_0x409588[_0x05ed('0x1b')]?_0x409588[_0x05ed('0x1b')]['attributes']||null:null,'include':_0x409588[_0x05ed('0x1b')]?_0x409588[_0x05ed('0x1b')][_0x05ed('0x1e')]?_[_0x05ed('0x21')](_0x409588[_0x05ed('0x1b')][_0x05ed('0x1e')],function(_0x3454f7){return{'model':db[_0x3454f7[_0x05ed('0x1f')]],'as':_0x3454f7['as'],'attributes':_0x3454f7[_0x05ed('0x20')],'include':_0x3454f7[_0x05ed('0x1e')]?_['map'](_0x3454f7['include'],function(_0x3f8f26){return{'model':db[_0x3f8f26[_0x05ed('0x1f')]],'as':_0x3f8f26['as'],'attributes':_0x3f8f26['attributes'],'include':_0x3f8f26['include']?_[_0x05ed('0x21')](_0x3f8f26[_0x05ed('0x1e')],function(_0x30d771){return{'model':db[_0x30d771[_0x05ed('0x1f')]],'as':_0x30d771['as'],'attributes':_0x30d771[_0x05ed('0x20')]};}):[]};}):[]};}):[]:[]})[_0x05ed('0xf')](function(_0x46b118){logger[_0x05ed('0x10')](_0x05ed('0x23'),_0x409588);logger[_0x05ed('0x13')](_0x05ed('0x23'),_0x409588,JSON[_0x05ed('0x22')](_0x46b118));_0x1668ba(_0x46b118);})[_0x05ed('0x18')](function(_0x1ec847){logger['error'](_0x05ed('0x23'),_0x1ec847[_0x05ed('0x16')],_0x409588);_0x3e95ad(_0x1c7759[_0x05ed('0x14')](0x1f4,_0x1ec847[_0x05ed('0x16')]));});});};
\ No newline at end of file
+var _0xd0f5=['catch','GetChatQueue','ChatQueue','findAll','options','raw','attributes','limit','include','map','model','find','ShowChatQueue','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','defaults','redis','localhost','socket.io-emitter','./chatQueue.socket','register','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x27d6b6,_0x317686){var _0xc06c37=function(_0x6f6aa6){while(--_0x6f6aa6){_0x27d6b6['push'](_0x27d6b6['shift']());}};_0xc06c37(++_0x317686);}(_0xd0f5,0xda));var _0x5d0f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd0f5[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x5d0f('0x0'));var util=require(_0x5d0f('0x1'));var moment=require('moment');var BPromise=require(_0x5d0f('0x2'));var rs=require(_0x5d0f('0x3'));var fs=require('fs');var Redis=require(_0x5d0f('0x4'));var db=require(_0x5d0f('0x5'))['db'];var utils=require(_0x5d0f('0x6'));var logger=require(_0x5d0f('0x7'))(_0x5d0f('0x8'));var config=require(_0x5d0f('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x5d0f('0xa')][_0x5d0f('0xb')]({'port':0x232a});config['redis']=_[_0x5d0f('0xc')](config[_0x5d0f('0xd')],{'host':_0x5d0f('0xe'),'port':0x18eb});var socket=require(_0x5d0f('0xf'))(new Redis(config['redis']));require(_0x5d0f('0x10'))[_0x5d0f('0x11')](socket);function respondWithRpcPromise(_0x138715,_0x47f7a7,_0x177101){return new BPromise(function(_0x29164d,_0x49aba5){return client[_0x5d0f('0x12')](_0x138715,_0x177101)[_0x5d0f('0x13')](function(_0x5c5bc1){logger[_0x5d0f('0x14')](_0x5d0f('0x15'),_0x47f7a7,_0x5d0f('0x16'));logger[_0x5d0f('0x17')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x47f7a7,'request\x20sent',JSON[_0x5d0f('0x18')](_0x5c5bc1));if(_0x5c5bc1['error']){if(_0x5c5bc1[_0x5d0f('0x19')][_0x5d0f('0x1a')]===0x1f4){logger[_0x5d0f('0x19')](_0x5d0f('0x15'),_0x47f7a7,_0x5c5bc1[_0x5d0f('0x19')][_0x5d0f('0x1b')]);return _0x49aba5(_0x5c5bc1[_0x5d0f('0x19')][_0x5d0f('0x1b')]);}logger[_0x5d0f('0x19')](_0x5d0f('0x15'),_0x47f7a7,_0x5c5bc1[_0x5d0f('0x19')]['message']);return _0x29164d(_0x5c5bc1['error'][_0x5d0f('0x1b')]);}else{logger[_0x5d0f('0x14')](_0x5d0f('0x15'),_0x47f7a7,_0x5d0f('0x16'));_0x29164d(_0x5c5bc1['result'][_0x5d0f('0x1b')]);}})[_0x5d0f('0x1c')](function(_0x1c3976){logger[_0x5d0f('0x19')](_0x5d0f('0x15'),_0x47f7a7,_0x1c3976);_0x49aba5(_0x1c3976);});});}exports[_0x5d0f('0x1d')]=function(_0x27de43){var _0xdf02d5=this;return new Promise(function(_0x4a8fdb,_0x1679e2){return db[_0x5d0f('0x1e')][_0x5d0f('0x1f')]({'raw':_0x27de43[_0x5d0f('0x20')]?_0x27de43[_0x5d0f('0x20')][_0x5d0f('0x21')]===undefined?!![]:![]:!![],'where':_0x27de43[_0x5d0f('0x20')]?_0x27de43[_0x5d0f('0x20')]['where']||null:null,'attributes':_0x27de43['options']?_0x27de43[_0x5d0f('0x20')][_0x5d0f('0x22')]||null:null,'limit':_0x27de43['options']?_0x27de43[_0x5d0f('0x20')][_0x5d0f('0x23')]||null:null,'include':_0x27de43[_0x5d0f('0x20')]?_0x27de43['options'][_0x5d0f('0x24')]?_[_0x5d0f('0x25')](_0x27de43['options'][_0x5d0f('0x24')],function(_0x35aa62){return{'model':db[_0x35aa62[_0x5d0f('0x26')]],'as':_0x35aa62['as'],'attributes':_0x35aa62[_0x5d0f('0x22')],'include':_0x35aa62[_0x5d0f('0x24')]?_[_0x5d0f('0x25')](_0x35aa62[_0x5d0f('0x24')],function(_0x2a35eb){return{'model':db[_0x2a35eb[_0x5d0f('0x26')]],'as':_0x2a35eb['as'],'attributes':_0x2a35eb[_0x5d0f('0x22')],'include':_0x2a35eb[_0x5d0f('0x24')]?_[_0x5d0f('0x25')](_0x2a35eb['include'],function(_0x3886f8){return{'model':db[_0x3886f8['model']],'as':_0x3886f8['as'],'attributes':_0x3886f8[_0x5d0f('0x22')]};}):[]};}):[]};}):[]:[]})[_0x5d0f('0x13')](function(_0x4fbddf){logger[_0x5d0f('0x14')](_0x5d0f('0x1d'),_0x27de43);logger[_0x5d0f('0x17')]('GetChatQueue',_0x27de43,JSON[_0x5d0f('0x18')](_0x4fbddf));_0x4a8fdb(_0x4fbddf);})[_0x5d0f('0x1c')](function(_0x564496){logger[_0x5d0f('0x19')](_0x5d0f('0x1d'),_0x564496[_0x5d0f('0x1b')],_0x27de43);_0x1679e2(_0xdf02d5[_0x5d0f('0x19')](0x1f4,_0x564496[_0x5d0f('0x1b')]));});});};exports['ShowChatQueue']=function(_0x4d15e9){var _0x37c61e=this;return new Promise(function(_0x397c63,_0x13207d){return db[_0x5d0f('0x1e')][_0x5d0f('0x27')]({'raw':_0x4d15e9['options']?_0x4d15e9['options'][_0x5d0f('0x21')]===undefined?!![]:![]:!![],'where':_0x4d15e9[_0x5d0f('0x20')]?_0x4d15e9[_0x5d0f('0x20')]['where']||null:null,'attributes':_0x4d15e9[_0x5d0f('0x20')]?_0x4d15e9[_0x5d0f('0x20')][_0x5d0f('0x22')]||null:null,'include':_0x4d15e9[_0x5d0f('0x20')]?_0x4d15e9['options'][_0x5d0f('0x24')]?_[_0x5d0f('0x25')](_0x4d15e9[_0x5d0f('0x20')][_0x5d0f('0x24')],function(_0x16e25e){return{'model':db[_0x16e25e[_0x5d0f('0x26')]],'as':_0x16e25e['as'],'attributes':_0x16e25e[_0x5d0f('0x22')],'include':_0x16e25e[_0x5d0f('0x24')]?_[_0x5d0f('0x25')](_0x16e25e[_0x5d0f('0x24')],function(_0x3b2e11){return{'model':db[_0x3b2e11['model']],'as':_0x3b2e11['as'],'attributes':_0x3b2e11[_0x5d0f('0x22')],'include':_0x3b2e11[_0x5d0f('0x24')]?_[_0x5d0f('0x25')](_0x3b2e11['include'],function(_0x5bbfc2){return{'model':db[_0x5bbfc2[_0x5d0f('0x26')]],'as':_0x5bbfc2['as'],'attributes':_0x5bbfc2['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x396cd0){logger[_0x5d0f('0x14')]('ShowChatQueue',_0x4d15e9);logger[_0x5d0f('0x17')](_0x5d0f('0x28'),_0x4d15e9,JSON['stringify'](_0x396cd0));_0x397c63(_0x396cd0);})[_0x5d0f('0x1c')](function(_0x2b5c15){logger[_0x5d0f('0x19')](_0x5d0f('0x28'),_0x2b5c15[_0x5d0f('0x1b')],_0x4d15e9);_0x13207d(_0x37c61e[_0x5d0f('0x19')](0x1f4,_0x2b5c15['message']));});});};
\ No newline at end of file
index 6cdd16b..de5f7fc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x54ef=['remove','emit','removeListener','length','./chatQueue.events','save'];(function(_0x411c31,_0x58bedc){var _0x262758=function(_0x44fade){while(--_0x44fade){_0x411c31['push'](_0x411c31['shift']());}};_0x262758(++_0x58bedc);}(_0x54ef,0x112));var _0xf54e=function(_0x15609c,_0x3715f0){_0x15609c=_0x15609c-0x0;var _0xda5394=_0x54ef[_0x15609c];return _0xda5394;};'use strict';var ChatQueueEvents=require(_0xf54e('0x0'));var events=[_0xf54e('0x1'),_0xf54e('0x2'),'update'];function createListener(_0xd936f7,_0x18b7d6){return function(_0x18b1cf){_0x18b7d6[_0xf54e('0x3')](_0xd936f7,_0x18b1cf);};}function removeListener(_0x8b6bb6,_0x431e36){return function(){ChatQueueEvents[_0xf54e('0x4')](_0x8b6bb6,_0x431e36);};}exports['register']=function(_0x55e611){for(var _0x18e84e=0x0,_0x99cf9=events[_0xf54e('0x5')];_0x18e84e<_0x99cf9;_0x18e84e++){var _0x561870=events[_0x18e84e];var _0x27e69b=createListener('chatQueue:'+_0x561870,_0x55e611);ChatQueueEvents['on'](_0x561870,_0x27e69b);}};
\ No newline at end of file
+var _0x84ab=['update','emit','removeListener','register','length','chatQueue:','./chatQueue.events','save','remove'];(function(_0x47f1cc,_0x1081db){var _0x43760a=function(_0x55949b){while(--_0x55949b){_0x47f1cc['push'](_0x47f1cc['shift']());}};_0x43760a(++_0x1081db);}(_0x84ab,0x12f));var _0xb84a=function(_0x38ced4,_0x24263f){_0x38ced4=_0x38ced4-0x0;var _0x547c07=_0x84ab[_0x38ced4];return _0x547c07;};'use strict';var ChatQueueEvents=require(_0xb84a('0x0'));var events=[_0xb84a('0x1'),_0xb84a('0x2'),_0xb84a('0x3')];function createListener(_0x473c3,_0x512f13){return function(_0xc83587){_0x512f13[_0xb84a('0x4')](_0x473c3,_0xc83587);};}function removeListener(_0x47b8e3,_0x9d3a00){return function(){ChatQueueEvents[_0xb84a('0x5')](_0x47b8e3,_0x9d3a00);};}exports[_0xb84a('0x6')]=function(_0x5b9def){for(var _0x521a64=0x0,_0x4dc496=events[_0xb84a('0x7')];_0x521a64<_0x4dc496;_0x521a64++){var _0x4fac4d=events[_0x521a64];var _0x3e9086=createListener(_0xb84a('0x8')+_0x4fac4d,_0x5b9def);ChatQueueEvents['on'](_0x4fac4d,_0x3e9086);}};
\ No newline at end of file
index 45e7829..6ce4f00 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','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','show','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','/:id/teams','removeTeams','multer','util','path'];(function(_0x13850d,_0x35e9b2){var _0xa73b99=function(_0x4e8047){while(--_0x4e8047){_0x13850d['push'](_0x13850d['shift']());}};_0xa73b99(++_0x35e9b2);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/teams',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x14')]('/:id/teams',auth['isAuthenticated'](),controller[_0x7995('0x16')]);router[_0x7995('0x14')](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x17')]);router[_0x7995('0x18')](_0x7995('0x19'),auth[_0x7995('0xa')](),controller['update']);router[_0x7995('0x1a')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0x1b')]);router[_0x7995('0x1a')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x1d')]);router['delete']('/:id/users',auth[_0x7995('0xa')](),controller['removeAgents']);module['exports']=router;
\ No newline at end of file
+var _0x7217=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post','addTeams','update','delete','destroy','removeTeams','removeAgents','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x48ae10,_0x140e3c){var _0x66cd50=function(_0x253b59){while(--_0x253b59){_0x48ae10['push'](_0x48ae10['shift']());}};_0x66cd50(++_0x140e3c);}(_0x7217,0x19e));var _0x7721=function(_0x4e1d03,_0x786f3a){_0x4e1d03=_0x4e1d03-0x0;var _0x362d4b=_0x7217[_0x4e1d03];return _0x362d4b;};'use strict';var multer=require(_0x7721('0x0'));var util=require('util');var path=require(_0x7721('0x1'));var timeout=require(_0x7721('0x2'));var express=require(_0x7721('0x3'));var router=express[_0x7721('0x4')]();var fs_extra=require(_0x7721('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7721('0x6'));var controller=require(_0x7721('0x7'));router[_0x7721('0x8')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xa')]);router[_0x7721('0x8')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0xc')]);router[_0x7721('0x8')](_0x7721('0xd'),auth[_0x7721('0x9')](),controller[_0x7721('0xe')]);router[_0x7721('0x8')](_0x7721('0xf'),auth['isAuthenticated'](),controller[_0x7721('0x10')]);router[_0x7721('0x8')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x12')]);router[_0x7721('0x8')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller['getAgents']);router[_0x7721('0x14')]('/',auth[_0x7721('0x9')](),controller['create']);router[_0x7721('0x14')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x15')]);router['post'](_0x7721('0x13'),auth[_0x7721('0x9')](),controller['addAgents']);router['put']('/:id',auth[_0x7721('0x9')](),controller[_0x7721('0x16')]);router[_0x7721('0x17')](_0x7721('0xd'),auth['isAuthenticated'](),controller[_0x7721('0x18')]);router['delete'](_0x7721('0x11'),auth['isAuthenticated'](),controller[_0x7721('0x19')]);router[_0x7721('0x17')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller[_0x7721('0x1a')]);module[_0x7721('0x1b')]=router;
\ No newline at end of file
index 24d6a35..50d41b9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x81f3=['moment','exports','STRING','DATE'];(function(_0x215433,_0x35140a){var _0xb0a105=function(_0xe5b6fb){while(--_0xe5b6fb){_0x215433['push'](_0x215433['shift']());}};_0xb0a105(++_0x35140a);}(_0x81f3,0x1b8));var _0x381f=function(_0x517a75,_0x28b97b){_0x517a75=_0x517a75-0x0;var _0x59fffd=_0x81f3[_0x517a75];return _0x59fffd;};'use strict';var moment=require(_0x381f('0x0'));var Sequelize=require('sequelize');module[_0x381f('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x381f('0x2')]},'joinAt':{'type':Sequelize[_0x381f('0x3')]},'leaveAt':{'type':Sequelize[_0x381f('0x3')]},'acceptAt':{'type':Sequelize[_0x381f('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x381f('0x2')]}};
\ No newline at end of file
+var _0x8457=['STRING','DATE','moment','sequelize','exports'];(function(_0x3ccdeb,_0x44306d){var _0x1552e4=function(_0x18f396){while(--_0x18f396){_0x3ccdeb['push'](_0x3ccdeb['shift']());}};_0x1552e4(++_0x44306d);}(_0x8457,0x142));var _0x7845=function(_0x5c313d,_0x45bdf7){_0x5c313d=_0x5c313d-0x0;var _0x317ecf=_0x8457[_0x5c313d];return _0x317ecf;};'use strict';var moment=require(_0x7845('0x0'));var Sequelize=require(_0x7845('0x1'));module[_0x7845('0x2')]={'uniqueid':{'type':Sequelize[_0x7845('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x7845('0x3')]},'joinAt':{'type':Sequelize[_0x7845('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x7845('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x7845('0x3')]}};
\ No newline at end of file
index 138a753..7fe0067 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaf5a=['desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','json','offset','undefined','count','status','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','map','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','filters','pick','merge','filter','options','ChatQueueReport','includeAll','include','findAll','catch','show','params','keys','create','body','find','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','crypto','jsforce'];(function(_0x395eec,_0x365bce){var _0x3d2753=function(_0x59be0e){while(--_0x59be0e){_0x395eec['push'](_0x395eec['shift']());}};_0x3d2753(++_0x365bce);}(_0xaf5a,0x116));var _0xaaf5=function(_0x374ccf,_0xa945c4){_0x374ccf=_0x374ccf-0x0;var _0x443cde=_0xaf5a[_0x374ccf];return _0x443cde;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xaaf5('0x0'));var zipdir=require(_0xaaf5('0x1'));var jsonpatch=require(_0xaaf5('0x2'));var rp=require(_0xaaf5('0x3'));var moment=require(_0xaaf5('0x4'));var BPromise=require(_0xaaf5('0x5'));var Mustache=require(_0xaaf5('0x6'));var util=require(_0xaaf5('0x7'));var path=require('path');var sox=require(_0xaaf5('0x8'));var csv=require(_0xaaf5('0x9'));var ejs=require(_0xaaf5('0xa'));var fs=require('fs');var fs_extra=require(_0xaaf5('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xaaf5('0xc'));var jsforce=require(_0xaaf5('0xd'));var deskjs=require(_0xaaf5('0xe'));var toCsv=require(_0xaaf5('0x9'));var querystring=require(_0xaaf5('0xf'));var Papa=require('papaparse');var Redis=require(_0xaaf5('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xaaf5('0x11'));var hardwareService=require(_0xaaf5('0x12'));var logger=require('../../config/logger')(_0xaaf5('0x13'));var utils=require(_0xaaf5('0x14'));var config=require(_0xaaf5('0x15'));var licenseUtil=require(_0xaaf5('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x459334,_0x9ce7ce){_0x9ce7ce=_0x9ce7ce||0xcc;return function(_0x4b5c4c){if(_0x4b5c4c){return _0x459334[_0xaaf5('0x17')](_0x9ce7ce);}return _0x459334['status'](_0x9ce7ce)[_0xaaf5('0x18')]();};}function respondWithResult(_0xe50810,_0x35d891){_0x35d891=_0x35d891||0xc8;return function(_0x304060){if(_0x304060){return _0xe50810['status'](_0x35d891)[_0xaaf5('0x19')](_0x304060);}};}function respondWithFilteredResult(_0x3079c3,_0x2e8482){return function(_0x215007){if(_0x215007){var _0x277f2b=typeof _0x2e8482[_0xaaf5('0x1a')]===_0xaaf5('0x1b')&&typeof _0x2e8482['limit']===_0xaaf5('0x1b');var _0x14bc84=_0x215007[_0xaaf5('0x1c')];var _0x3a036d=_0x277f2b?0x0:_0x2e8482[_0xaaf5('0x1a')];var _0x403bb2=_0x277f2b?_0x215007[_0xaaf5('0x1c')]:_0x2e8482['offset']+_0x2e8482['limit'];var _0xf60239;if(_0x403bb2>=_0x14bc84){_0x403bb2=_0x14bc84;_0xf60239=0xc8;}else{_0xf60239=0xce;}_0x3079c3[_0xaaf5('0x1d')](_0xf60239);return _0x3079c3[_0xaaf5('0x1e')](_0xaaf5('0x1f'),_0x3a036d+'-'+_0x403bb2+'/'+_0x14bc84)[_0xaaf5('0x19')](_0x215007);}return null;};}function patchUpdates(_0x6131a3){return function(_0x589ed0){try{jsonpatch['apply'](_0x589ed0,_0x6131a3,!![]);}catch(_0xd31eae){return BPromise[_0xaaf5('0x20')](_0xd31eae);}return _0x589ed0[_0xaaf5('0x21')]();};}function saveUpdates(_0x24cef7,_0x3020b0){return function(_0x2a390c){if(_0x2a390c){return _0x2a390c[_0xaaf5('0x22')](_0x24cef7)[_0xaaf5('0x23')](function(_0x270783){return _0x270783;});}return null;};}function removeEntity(_0x2aabab,_0x43b064){return function(_0xd7db51){if(_0xd7db51){return _0xd7db51[_0xaaf5('0x24')]()[_0xaaf5('0x23')](function(){_0x2aabab['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x15a6e4,_0x569c78){return function(_0x44aef2){if(!_0x44aef2){_0x15a6e4['sendStatus'](0x194);}return _0x44aef2;};}function handleError(_0x501017,_0x236131){_0x236131=_0x236131||0x1f4;return function(_0x26f14a){logger[_0xaaf5('0x25')](_0x26f14a[_0xaaf5('0x26')]);if(_0x26f14a[_0xaaf5('0x27')]){delete _0x26f14a[_0xaaf5('0x27')];}_0x501017['status'](_0x236131)[_0xaaf5('0x28')](_0x26f14a);};}exports['index']=function(_0x4beb05,_0x24cd49){var _0x461fd9={},_0x443c1b={},_0x17d742={'count':0x0,'rows':[]};var _0x66ac51=_[_0xaaf5('0x29')](db['ChatQueueReport'][_0xaaf5('0x2a')],function(_0x4954af){return{'name':_0x4954af[_0xaaf5('0x2b')],'type':_0x4954af[_0xaaf5('0x2c')]['key']};});_0x443c1b[_0xaaf5('0x2d')]=_['map'](_0x66ac51,_0xaaf5('0x27'));_0x443c1b[_0xaaf5('0x2e')]=_['keys'](_0x4beb05[_0xaaf5('0x2e')]);_0x443c1b['filters']=_[_0xaaf5('0x2f')](_0x443c1b[_0xaaf5('0x2d')],_0x443c1b['query']);_0x461fd9[_0xaaf5('0x30')]=_['intersection'](_0x443c1b[_0xaaf5('0x2d')],qs[_0xaaf5('0x31')](_0x4beb05['query'][_0xaaf5('0x31')]));_0x461fd9['attributes']=_0x461fd9[_0xaaf5('0x30')][_0xaaf5('0x32')]?_0x461fd9[_0xaaf5('0x30')]:_0x443c1b[_0xaaf5('0x2d')];if(!_0x4beb05[_0xaaf5('0x2e')][_0xaaf5('0x33')](_0xaaf5('0x34'))){_0x461fd9['limit']=qs[_0xaaf5('0x35')](_0x4beb05[_0xaaf5('0x2e')]['limit']);_0x461fd9[_0xaaf5('0x1a')]=qs[_0xaaf5('0x1a')](_0x4beb05[_0xaaf5('0x2e')][_0xaaf5('0x1a')]);}_0x461fd9['order']=qs[_0xaaf5('0x36')](_0x4beb05[_0xaaf5('0x2e')][_0xaaf5('0x36')]);_0x461fd9[_0xaaf5('0x37')]=qs[_0xaaf5('0x38')](_[_0xaaf5('0x39')](_0x4beb05['query'],_0x443c1b[_0xaaf5('0x38')]),_0x66ac51);if(_0x4beb05[_0xaaf5('0x2e')]['filter']){_0x461fd9[_0xaaf5('0x37')]=_[_0xaaf5('0x3a')](_0x461fd9[_0xaaf5('0x37')],{'$or':_[_0xaaf5('0x29')](_0x66ac51,function(_0x583a3d){if(_0x583a3d[_0xaaf5('0x2c')]!=='VIRTUAL'){var _0x32b7f4={};_0x32b7f4[_0x583a3d[_0xaaf5('0x27')]]={'$like':'%'+_0x4beb05[_0xaaf5('0x2e')][_0xaaf5('0x3b')]+'%'};return _0x32b7f4;}})});}_0x461fd9=_[_0xaaf5('0x3a')]({},_0x461fd9,_0x4beb05[_0xaaf5('0x3c')]);var _0x43a126={'where':_0x461fd9[_0xaaf5('0x37')]};return db[_0xaaf5('0x3d')][_0xaaf5('0x1c')](_0x43a126)[_0xaaf5('0x23')](function(_0x294bf9){_0x17d742['count']=_0x294bf9;if(_0x4beb05[_0xaaf5('0x2e')][_0xaaf5('0x3e')]){_0x461fd9[_0xaaf5('0x3f')]=[{'all':!![]}];}return db[_0xaaf5('0x3d')][_0xaaf5('0x40')](_0x461fd9);})[_0xaaf5('0x23')](function(_0x3401fa){_0x17d742['rows']=_0x3401fa;return _0x17d742;})[_0xaaf5('0x23')](respondWithFilteredResult(_0x24cd49,_0x461fd9))[_0xaaf5('0x41')](handleError(_0x24cd49,null));};exports[_0xaaf5('0x42')]=function(_0x7fa50a,_0xbcd7f1){var _0x111cda={'raw':!![],'where':{'id':_0x7fa50a[_0xaaf5('0x43')]['id']}},_0xcf08ff={};_0xcf08ff[_0xaaf5('0x2d')]=_[_0xaaf5('0x44')](db[_0xaaf5('0x3d')][_0xaaf5('0x2a')]);_0xcf08ff['query']=_[_0xaaf5('0x44')](_0x7fa50a[_0xaaf5('0x2e')]);_0xcf08ff[_0xaaf5('0x38')]=_[_0xaaf5('0x2f')](_0xcf08ff[_0xaaf5('0x2d')],_0xcf08ff[_0xaaf5('0x2e')]);_0x111cda[_0xaaf5('0x30')]=_[_0xaaf5('0x2f')](_0xcf08ff['model'],qs[_0xaaf5('0x31')](_0x7fa50a['query']['fields']));_0x111cda[_0xaaf5('0x30')]=_0x111cda['attributes'][_0xaaf5('0x32')]?_0x111cda[_0xaaf5('0x30')]:_0xcf08ff['model'];if(_0x7fa50a[_0xaaf5('0x2e')]['includeAll']){_0x111cda['include']=[{'all':!![]}];}_0x111cda=_[_0xaaf5('0x3a')]({},_0x111cda,_0x7fa50a[_0xaaf5('0x3c')]);return db[_0xaaf5('0x3d')]['find'](_0x111cda)[_0xaaf5('0x23')](handleEntityNotFound(_0xbcd7f1,null))[_0xaaf5('0x23')](respondWithResult(_0xbcd7f1,null))[_0xaaf5('0x41')](handleError(_0xbcd7f1,null));};exports[_0xaaf5('0x45')]=function(_0x47d566,_0x461f9c){return db['ChatQueueReport']['create'](_0x47d566[_0xaaf5('0x46')],{})['then'](respondWithResult(_0x461f9c,0xc9))[_0xaaf5('0x41')](handleError(_0x461f9c,null));};exports[_0xaaf5('0x22')]=function(_0xd2ffe7,_0x12c65f){if(_0xd2ffe7[_0xaaf5('0x46')]['id']){delete _0xd2ffe7[_0xaaf5('0x46')]['id'];}return db['ChatQueueReport'][_0xaaf5('0x47')]({'where':{'id':_0xd2ffe7[_0xaaf5('0x43')]['id']}})['then'](handleEntityNotFound(_0x12c65f,null))[_0xaaf5('0x23')](saveUpdates(_0xd2ffe7[_0xaaf5('0x46')],null))[_0xaaf5('0x23')](respondWithResult(_0x12c65f,null))[_0xaaf5('0x41')](handleError(_0x12c65f,null));};exports[_0xaaf5('0x24')]=function(_0x879ee4,_0x12afb2){return db[_0xaaf5('0x3d')]['find']({'where':{'id':_0x879ee4[_0xaaf5('0x43')]['id']}})[_0xaaf5('0x23')](handleEntityNotFound(_0x12afb2,null))[_0xaaf5('0x23')](removeEntity(_0x12afb2,null))[_0xaaf5('0x41')](handleError(_0x12afb2,null));};exports[_0xaaf5('0x48')]=function(_0x170708,_0x5a5c73){return db[_0xaaf5('0x3d')][_0xaaf5('0x48')]()[_0xaaf5('0x23')](respondWithResult(_0x5a5c73,null))[_0xaaf5('0x41')](handleError(_0x5a5c73,null));};
\ No newline at end of file
+var _0xa647=['../../config/license/util','status','end','json','offset','undefined','limit','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','ChatQueueReport','type','map','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','count','includeAll','include','rows','catch','show','params','rawAttributes','create','body','find','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','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment'];(function(_0x141da6,_0x4d933d){var _0x1edf5a=function(_0x462593){while(--_0x462593){_0x141da6['push'](_0x141da6['shift']());}};_0x1edf5a(++_0x4d933d);}(_0xa647,0x81));var _0x7a64=function(_0x2939f6,_0x6dc867){_0x2939f6=_0x2939f6-0x0;var _0x58330c=_0xa647[_0x2939f6];return _0x58330c;};'use strict';var emlformat=require(_0x7a64('0x0'));var rimraf=require(_0x7a64('0x1'));var zipdir=require(_0x7a64('0x2'));var jsonpatch=require(_0x7a64('0x3'));var rp=require(_0x7a64('0x4'));var moment=require(_0x7a64('0x5'));var BPromise=require(_0x7a64('0x6'));var Mustache=require(_0x7a64('0x7'));var util=require(_0x7a64('0x8'));var path=require(_0x7a64('0x9'));var sox=require(_0x7a64('0xa'));var csv=require(_0x7a64('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7a64('0xc'));var _=require(_0x7a64('0xd'));var squel=require('squel');var crypto=require(_0x7a64('0xe'));var jsforce=require(_0x7a64('0xf'));var deskjs=require(_0x7a64('0x10'));var toCsv=require(_0x7a64('0xb'));var querystring=require(_0x7a64('0x11'));var Papa=require(_0x7a64('0x12'));var Redis=require(_0x7a64('0x13'));var authService=require(_0x7a64('0x14'));var qs=require(_0x7a64('0x15'));var as=require(_0x7a64('0x16'));var hardwareService=require(_0x7a64('0x17'));var logger=require(_0x7a64('0x18'))(_0x7a64('0x19'));var utils=require('../../config/utils');var config=require(_0x7a64('0x1a'));var licenseUtil=require(_0x7a64('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x10d549,_0x5923c){_0x5923c=_0x5923c||0xcc;return function(_0x30a408){if(_0x30a408){return _0x10d549['sendStatus'](_0x5923c);}return _0x10d549[_0x7a64('0x1c')](_0x5923c)[_0x7a64('0x1d')]();};}function respondWithResult(_0x38e79b,_0x293021){_0x293021=_0x293021||0xc8;return function(_0x24f0e3){if(_0x24f0e3){return _0x38e79b[_0x7a64('0x1c')](_0x293021)[_0x7a64('0x1e')](_0x24f0e3);}};}function respondWithFilteredResult(_0x4829f8,_0x136263){return function(_0x5ae1c3){if(_0x5ae1c3){var _0x47a13d=typeof _0x136263[_0x7a64('0x1f')]===_0x7a64('0x20')&&typeof _0x136263[_0x7a64('0x21')]==='undefined';var _0x126eef=_0x5ae1c3['count'];var _0x30c214=_0x47a13d?0x0:_0x136263['offset'];var _0x41e444=_0x47a13d?_0x5ae1c3['count']:_0x136263[_0x7a64('0x1f')]+_0x136263[_0x7a64('0x21')];var _0x5c196a;if(_0x41e444>=_0x126eef){_0x41e444=_0x126eef;_0x5c196a=0xc8;}else{_0x5c196a=0xce;}_0x4829f8['status'](_0x5c196a);return _0x4829f8['set'](_0x7a64('0x22'),_0x30c214+'-'+_0x41e444+'/'+_0x126eef)[_0x7a64('0x1e')](_0x5ae1c3);}return null;};}function patchUpdates(_0x4f56ab){return function(_0x57fa06){try{jsonpatch[_0x7a64('0x23')](_0x57fa06,_0x4f56ab,!![]);}catch(_0x5751b3){return BPromise[_0x7a64('0x24')](_0x5751b3);}return _0x57fa06[_0x7a64('0x25')]();};}function saveUpdates(_0x435abe,_0x2e78af){return function(_0x5dbac4){if(_0x5dbac4){return _0x5dbac4[_0x7a64('0x26')](_0x435abe)[_0x7a64('0x27')](function(_0x5e34d5){return _0x5e34d5;});}return null;};}function removeEntity(_0x2caaa4,_0xdfce54){return function(_0x61efd8){if(_0x61efd8){return _0x61efd8[_0x7a64('0x28')]()['then'](function(){_0x2caaa4['status'](0xcc)[_0x7a64('0x1d')]();});}};}function handleEntityNotFound(_0x40af63,_0x593144){return function(_0x38acec){if(!_0x38acec){_0x40af63['sendStatus'](0x194);}return _0x38acec;};}function handleError(_0x329f34,_0x3cc6a7){_0x3cc6a7=_0x3cc6a7||0x1f4;return function(_0x177132){logger[_0x7a64('0x29')](_0x177132[_0x7a64('0x2a')]);if(_0x177132[_0x7a64('0x2b')]){delete _0x177132[_0x7a64('0x2b')];}_0x329f34[_0x7a64('0x1c')](_0x3cc6a7)[_0x7a64('0x2c')](_0x177132);};}exports[_0x7a64('0x2d')]=function(_0x317183,_0x4e4136){var _0x1ce700={},_0x2dc737={},_0x358916={'count':0x0,'rows':[]};var _0x35a913=_['map'](db[_0x7a64('0x2e')]['rawAttributes'],function(_0x421092){return{'name':_0x421092['fieldName'],'type':_0x421092[_0x7a64('0x2f')]['key']};});_0x2dc737['model']=_[_0x7a64('0x30')](_0x35a913,_0x7a64('0x2b'));_0x2dc737[_0x7a64('0x31')]=_[_0x7a64('0x32')](_0x317183['query']);_0x2dc737[_0x7a64('0x33')]=_[_0x7a64('0x34')](_0x2dc737[_0x7a64('0x35')],_0x2dc737[_0x7a64('0x31')]);_0x1ce700['attributes']=_[_0x7a64('0x34')](_0x2dc737[_0x7a64('0x35')],qs['fields'](_0x317183['query'][_0x7a64('0x36')]));_0x1ce700[_0x7a64('0x37')]=_0x1ce700[_0x7a64('0x37')][_0x7a64('0x38')]?_0x1ce700[_0x7a64('0x37')]:_0x2dc737['model'];if(!_0x317183[_0x7a64('0x31')][_0x7a64('0x39')](_0x7a64('0x3a'))){_0x1ce700[_0x7a64('0x21')]=qs[_0x7a64('0x21')](_0x317183['query'][_0x7a64('0x21')]);_0x1ce700[_0x7a64('0x1f')]=qs[_0x7a64('0x1f')](_0x317183[_0x7a64('0x31')]['offset']);}_0x1ce700[_0x7a64('0x3b')]=qs[_0x7a64('0x3c')](_0x317183[_0x7a64('0x31')]['sort']);_0x1ce700[_0x7a64('0x3d')]=qs[_0x7a64('0x33')](_[_0x7a64('0x3e')](_0x317183[_0x7a64('0x31')],_0x2dc737[_0x7a64('0x33')]),_0x35a913);if(_0x317183['query'][_0x7a64('0x3f')]){_0x1ce700[_0x7a64('0x3d')]=_[_0x7a64('0x40')](_0x1ce700[_0x7a64('0x3d')],{'$or':_[_0x7a64('0x30')](_0x35a913,function(_0x5a1692){if(_0x5a1692[_0x7a64('0x2f')]!=='VIRTUAL'){var _0x255061={};_0x255061[_0x5a1692[_0x7a64('0x2b')]]={'$like':'%'+_0x317183[_0x7a64('0x31')][_0x7a64('0x3f')]+'%'};return _0x255061;}})});}_0x1ce700=_[_0x7a64('0x40')]({},_0x1ce700,_0x317183[_0x7a64('0x41')]);var _0x137b4d={'where':_0x1ce700[_0x7a64('0x3d')]};return db[_0x7a64('0x2e')]['count'](_0x137b4d)[_0x7a64('0x27')](function(_0xf7898a){_0x358916[_0x7a64('0x42')]=_0xf7898a;if(_0x317183[_0x7a64('0x31')][_0x7a64('0x43')]){_0x1ce700[_0x7a64('0x44')]=[{'all':!![]}];}return db['ChatQueueReport']['findAll'](_0x1ce700);})[_0x7a64('0x27')](function(_0x77b1e1){_0x358916[_0x7a64('0x45')]=_0x77b1e1;return _0x358916;})[_0x7a64('0x27')](respondWithFilteredResult(_0x4e4136,_0x1ce700))[_0x7a64('0x46')](handleError(_0x4e4136,null));};exports[_0x7a64('0x47')]=function(_0x1519a6,_0x306827){var _0x3f0766={'raw':!![],'where':{'id':_0x1519a6[_0x7a64('0x48')]['id']}},_0x5426f1={};_0x5426f1[_0x7a64('0x35')]=_[_0x7a64('0x32')](db[_0x7a64('0x2e')][_0x7a64('0x49')]);_0x5426f1[_0x7a64('0x31')]=_[_0x7a64('0x32')](_0x1519a6[_0x7a64('0x31')]);_0x5426f1['filters']=_[_0x7a64('0x34')](_0x5426f1[_0x7a64('0x35')],_0x5426f1[_0x7a64('0x31')]);_0x3f0766[_0x7a64('0x37')]=_['intersection'](_0x5426f1[_0x7a64('0x35')],qs[_0x7a64('0x36')](_0x1519a6[_0x7a64('0x31')][_0x7a64('0x36')]));_0x3f0766[_0x7a64('0x37')]=_0x3f0766[_0x7a64('0x37')][_0x7a64('0x38')]?_0x3f0766[_0x7a64('0x37')]:_0x5426f1[_0x7a64('0x35')];if(_0x1519a6['query'][_0x7a64('0x43')]){_0x3f0766[_0x7a64('0x44')]=[{'all':!![]}];}_0x3f0766=_[_0x7a64('0x40')]({},_0x3f0766,_0x1519a6[_0x7a64('0x41')]);return db[_0x7a64('0x2e')]['find'](_0x3f0766)[_0x7a64('0x27')](handleEntityNotFound(_0x306827,null))[_0x7a64('0x27')](respondWithResult(_0x306827,null))[_0x7a64('0x46')](handleError(_0x306827,null));};exports[_0x7a64('0x4a')]=function(_0x7d9d89,_0x2b3148){return db[_0x7a64('0x2e')]['create'](_0x7d9d89['body'],{})[_0x7a64('0x27')](respondWithResult(_0x2b3148,0xc9))['catch'](handleError(_0x2b3148,null));};exports[_0x7a64('0x26')]=function(_0x4eaa4f,_0x24b932){if(_0x4eaa4f['body']['id']){delete _0x4eaa4f[_0x7a64('0x4b')]['id'];}return db[_0x7a64('0x2e')][_0x7a64('0x4c')]({'where':{'id':_0x4eaa4f[_0x7a64('0x48')]['id']}})[_0x7a64('0x27')](handleEntityNotFound(_0x24b932,null))[_0x7a64('0x27')](saveUpdates(_0x4eaa4f['body'],null))[_0x7a64('0x27')](respondWithResult(_0x24b932,null))[_0x7a64('0x46')](handleError(_0x24b932,null));};exports[_0x7a64('0x28')]=function(_0x2dbd81,_0xfa8bfe){return db[_0x7a64('0x2e')][_0x7a64('0x4c')]({'where':{'id':_0x2dbd81[_0x7a64('0x48')]['id']}})['then'](handleEntityNotFound(_0xfa8bfe,null))[_0x7a64('0x27')](removeEntity(_0xfa8bfe,null))['catch'](handleError(_0xfa8bfe,null));};exports['describe']=function(_0x53d828,_0x5f4cd1){return db[_0x7a64('0x2e')][_0x7a64('0x4d')]()['then'](respondWithResult(_0x5f4cd1,null))[_0x7a64('0x46')](handleError(_0x5f4cd1,null));};
\ No newline at end of file
index 5ea630c..73fc330 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid'];(function(_0x215dc8,_0x52c245){var _0x583ea3=function(_0x32350d){while(--_0x32350d){_0x215dc8['push'](_0x215dc8['shift']());}};_0x583ea3(++_0x52c245);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));module[_0x3071('0x8')]=function(_0xabd7b6,_0x41cf76){return _0xabd7b6[_0x3071('0x9')](_0x3071('0xa'),attributes,{'tableName':_0x3071('0xb'),'paranoid':![],'indexes':[{'name':_0x3071('0xc'),'fields':[_0x3071('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xd8b0=['define','report_chat_queue','uniqueid','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x1488d4,_0x1286ec){var _0x5ce26d=function(_0x1cab99){while(--_0x1cab99){_0x1488d4['push'](_0x1488d4['shift']());}};_0x5ce26d(++_0x1286ec);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./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
index decc543..75dc592 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc260=['stringify','error','code','message','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','UpdateChatQueueReport','where','attributes','limit','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s'];(function(_0x297814,_0x36b00e){var _0x29801d=function(_0x17aa83){while(--_0x17aa83){_0x297814['push'](_0x297814['shift']());}};_0x29801d(++_0x36b00e);}(_0xc260,0x10f));var _0x0c26=function(_0x1294aa,_0x242aeb){_0x1294aa=_0x1294aa-0x0;var _0x1a5c83=_0xc260[_0x1294aa];return _0x1a5c83;};'use strict';var _=require(_0x0c26('0x0'));var util=require(_0x0c26('0x1'));var moment=require(_0x0c26('0x2'));var BPromise=require(_0x0c26('0x3'));var rs=require(_0x0c26('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0c26('0x5'))['db'];var utils=require(_0x0c26('0x6'));var logger=require('../../config/logger')(_0x0c26('0x7'));var config=require('../../config/environment');var jayson=require(_0x0c26('0x8'));var client=jayson['client'][_0x0c26('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x249491,_0x284726,_0x14d2a1){return new BPromise(function(_0xd8331e,_0x512054){return client[_0x0c26('0xa')](_0x249491,_0x14d2a1)[_0x0c26('0xb')](function(_0xeb0d29){logger[_0x0c26('0xc')](_0x0c26('0xd'),_0x284726,_0x0c26('0xe'));logger[_0x0c26('0xf')](_0x0c26('0x10'),_0x284726,_0x0c26('0xe'),JSON[_0x0c26('0x11')](_0xeb0d29));if(_0xeb0d29['error']){if(_0xeb0d29[_0x0c26('0x12')][_0x0c26('0x13')]===0x1f4){logger[_0x0c26('0x12')](_0x0c26('0xd'),_0x284726,_0xeb0d29[_0x0c26('0x12')][_0x0c26('0x14')]);return _0x512054(_0xeb0d29[_0x0c26('0x12')]['message']);}logger['error'](_0x0c26('0xd'),_0x284726,_0xeb0d29['error'][_0x0c26('0x14')]);return _0xd8331e(_0xeb0d29[_0x0c26('0x12')][_0x0c26('0x14')]);}else{logger[_0x0c26('0xc')](_0x0c26('0xd'),_0x284726,_0x0c26('0xe'));_0xd8331e(_0xeb0d29['result'][_0x0c26('0x14')]);}})[_0x0c26('0x15')](function(_0x5e87bf){logger[_0x0c26('0x12')](_0x0c26('0xd'),_0x284726,_0x5e87bf);_0x512054(_0x5e87bf);});});}exports[_0x0c26('0x16')]=function(_0x55fead){var _0x2f37d7=this;return new Promise(function(_0xe29adc,_0x5702dc){return db[_0x0c26('0x17')][_0x0c26('0x18')](_0x55fead[_0x0c26('0x19')],{'raw':_0x55fead['options']?_0x55fead[_0x0c26('0x1a')][_0x0c26('0x1b')]===undefined?!![]:![]:!![]})[_0x0c26('0xb')](function(_0xfff859){logger[_0x0c26('0xc')](_0x0c26('0x16'),_0x55fead);logger['debug']('CreateChatQueueReport',_0x55fead,JSON[_0x0c26('0x11')](_0xfff859));_0xe29adc(_0xfff859);})[_0x0c26('0x15')](function(_0x5af0ca){logger[_0x0c26('0x12')](_0x0c26('0x16'),_0x5af0ca[_0x0c26('0x14')],_0x55fead);_0x5702dc(_0x2f37d7['error'](0x1f4,_0x5af0ca[_0x0c26('0x14')]));});});};exports[_0x0c26('0x1c')]=function(_0x1f3021){var _0x2174e3=this;return new Promise(function(_0x120942,_0x8fb00e){return db[_0x0c26('0x17')]['update'](_0x1f3021[_0x0c26('0x19')],{'raw':_0x1f3021[_0x0c26('0x1a')]?_0x1f3021['options'][_0x0c26('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1f3021[_0x0c26('0x1a')]?_0x1f3021[_0x0c26('0x1a')][_0x0c26('0x1d')]||null:null,'attributes':_0x1f3021[_0x0c26('0x1a')]?_0x1f3021['options'][_0x0c26('0x1e')]||null:null,'limit':_0x1f3021['options']?_0x1f3021[_0x0c26('0x1a')][_0x0c26('0x1f')]||null:null})['then'](function(_0x2c2111){logger[_0x0c26('0xc')](_0x0c26('0x1c'),_0x1f3021);logger['debug'](_0x0c26('0x1c'),_0x1f3021,JSON['stringify'](_0x2c2111));_0x120942(_0x2c2111);})[_0x0c26('0x15')](function(_0x4c90dc){logger[_0x0c26('0x12')]('UpdateChatQueueReport',_0x4c90dc[_0x0c26('0x14')],_0x1f3021);_0x8fb00e(_0x2174e3['error'](0x1f4,_0x4c90dc[_0x0c26('0x14')]));});});};
\ No newline at end of file
+var _0x51c5=['limit','UpdateChatQueueReport','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','ChatQueueReport,\x20%s,\x20%s','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','debug','update','where'];(function(_0x4e4315,_0x5d7615){var _0x31f97a=function(_0x330858){while(--_0x330858){_0x4e4315['push'](_0x4e4315['shift']());}};_0x31f97a(++_0x5d7615);}(_0x51c5,0xc8));var _0x551c=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x51c5[_0x178e48];return _0x440d7e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x551c('0x0'));var BPromise=require(_0x551c('0x1'));var rs=require(_0x551c('0x2'));var fs=require('fs');var Redis=require(_0x551c('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x551c('0x4'));var logger=require(_0x551c('0x5'))(_0x551c('0x6'));var config=require(_0x551c('0x7'));var jayson=require(_0x551c('0x8'));var client=jayson[_0x551c('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1c5309,_0x3449a0,_0x24611b){return new BPromise(function(_0x39e753,_0x4758ac){return client[_0x551c('0xa')](_0x1c5309,_0x24611b)[_0x551c('0xb')](function(_0x1b83c4){logger[_0x551c('0xc')](_0x551c('0xd'),_0x3449a0,'request\x20sent');logger['debug'](_0x551c('0xe'),_0x3449a0,'request\x20sent',JSON[_0x551c('0xf')](_0x1b83c4));if(_0x1b83c4[_0x551c('0x10')]){if(_0x1b83c4['error'][_0x551c('0x11')]===0x1f4){logger['error'](_0x551c('0xd'),_0x3449a0,_0x1b83c4[_0x551c('0x10')][_0x551c('0x12')]);return _0x4758ac(_0x1b83c4[_0x551c('0x10')][_0x551c('0x12')]);}logger[_0x551c('0x10')](_0x551c('0xd'),_0x3449a0,_0x1b83c4['error'][_0x551c('0x12')]);return _0x39e753(_0x1b83c4[_0x551c('0x10')]['message']);}else{logger['info'](_0x551c('0xd'),_0x3449a0,_0x551c('0x13'));_0x39e753(_0x1b83c4[_0x551c('0x14')]['message']);}})[_0x551c('0x15')](function(_0x2f9710){logger[_0x551c('0x10')]('ChatQueueReport,\x20%s,\x20%s',_0x3449a0,_0x2f9710);_0x4758ac(_0x2f9710);});});}exports[_0x551c('0x16')]=function(_0x29d639){var _0x58267b=this;return new Promise(function(_0x34e284,_0x4d7669){return db[_0x551c('0x17')][_0x551c('0x18')](_0x29d639[_0x551c('0x19')],{'raw':_0x29d639['options']?_0x29d639[_0x551c('0x1a')][_0x551c('0x1b')]===undefined?!![]:![]:!![]})[_0x551c('0xb')](function(_0x1fff90){logger['info'](_0x551c('0x16'),_0x29d639);logger[_0x551c('0x1c')](_0x551c('0x16'),_0x29d639,JSON['stringify'](_0x1fff90));_0x34e284(_0x1fff90);})[_0x551c('0x15')](function(_0x10e611){logger[_0x551c('0x10')](_0x551c('0x16'),_0x10e611[_0x551c('0x12')],_0x29d639);_0x4d7669(_0x58267b['error'](0x1f4,_0x10e611[_0x551c('0x12')]));});});};exports['UpdateChatQueueReport']=function(_0x24b561){var _0x3d8c54=this;return new Promise(function(_0x488ac2,_0x5c1a8e){return db[_0x551c('0x17')][_0x551c('0x1d')](_0x24b561[_0x551c('0x19')],{'raw':_0x24b561[_0x551c('0x1a')]?_0x24b561[_0x551c('0x1a')][_0x551c('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x24b561[_0x551c('0x1a')]?_0x24b561[_0x551c('0x1a')][_0x551c('0x1e')]||null:null,'attributes':_0x24b561[_0x551c('0x1a')]?_0x24b561['options']['attributes']||null:null,'limit':_0x24b561[_0x551c('0x1a')]?_0x24b561[_0x551c('0x1a')][_0x551c('0x1f')]||null:null})[_0x551c('0xb')](function(_0x37b5fa){logger[_0x551c('0xc')](_0x551c('0x20'),_0x24b561);logger[_0x551c('0x1c')](_0x551c('0x20'),_0x24b561,JSON[_0x551c('0xf')](_0x37b5fa));_0x488ac2(_0x37b5fa);})[_0x551c('0x15')](function(_0x4dbe97){logger[_0x551c('0x10')](_0x551c('0x20'),_0x4dbe97[_0x551c('0x12')],_0x24b561);_0x5c1a8e(_0x3d8c54[_0x551c('0x10')](0x1f4,_0x4dbe97[_0x551c('0x12')]));});});};
\ No newline at end of file
index 6ffc47d..d4e3245 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x801a=['/:id','put','update','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','index','get','isAuthenticated','describe'];(function(_0x88cd7b,_0x4c884c){var _0x56fcc8=function(_0x513b3d){while(--_0x513b3d){_0x88cd7b['push'](_0x88cd7b['shift']());}};_0x56fcc8(++_0x4c884c);}(_0x801a,0x137));var _0xa801=function(_0x370f53,_0x142c7e){_0x370f53=_0x370f53-0x0;var _0x5aed78=_0x801a[_0x370f53];return _0x5aed78;};'use strict';var multer=require(_0xa801('0x0'));var util=require('util');var path=require(_0xa801('0x1'));var timeout=require(_0xa801('0x2'));var express=require('express');var router=express[_0xa801('0x3')]();var fs_extra=require(_0xa801('0x4'));var auth=require(_0xa801('0x5'));var interaction=require(_0xa801('0x6'));var config=require(_0xa801('0x7'));var controller=require(_0xa801('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xa801('0x9')]);router[_0xa801('0xa')]('/describe',auth[_0xa801('0xb')](),controller[_0xa801('0xc')]);router['get'](_0xa801('0xd'),auth[_0xa801('0xb')](),controller['show']);router['post']('/',auth[_0xa801('0xb')](),controller['create']);router[_0xa801('0xe')](_0xa801('0xd'),auth[_0xa801('0xb')](),controller[_0xa801('0xf')]);router['delete'](_0xa801('0xd'),auth['isAuthenticated'](),controller[_0xa801('0x10')]);module[_0xa801('0x11')]=router;
\ No newline at end of file
+var _0x22a0=['../../components/auth/service','../../components/interaction/service','./chatQueueReport.controller','isAuthenticated','index','get','describe','/:id','show','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router'];(function(_0x141da1,_0x3905c7){var _0x5abdbd=function(_0xc78a12){while(--_0xc78a12){_0x141da1['push'](_0x141da1['shift']());}};_0x5abdbd(++_0x3905c7);}(_0x22a0,0x80));var _0x022a=function(_0x1eb308,_0x140fa8){_0x1eb308=_0x1eb308-0x0;var _0x26d5c2=_0x22a0[_0x1eb308];return _0x26d5c2;};'use strict';var multer=require(_0x022a('0x0'));var util=require(_0x022a('0x1'));var path=require(_0x022a('0x2'));var timeout=require(_0x022a('0x3'));var express=require('express');var router=express[_0x022a('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x022a('0x5'));var interaction=require(_0x022a('0x6'));var config=require('../../config/environment');var controller=require(_0x022a('0x7'));router['get']('/',auth[_0x022a('0x8')](),controller[_0x022a('0x9')]);router[_0x022a('0xa')]('/describe',auth[_0x022a('0x8')](),controller[_0x022a('0xb')]);router['get'](_0x022a('0xc'),auth['isAuthenticated'](),controller[_0x022a('0xd')]);router['post']('/',auth[_0x022a('0x8')](),controller['create']);router[_0x022a('0xe')](_0x022a('0xc'),auth['isAuthenticated'](),controller[_0x022a('0xf')]);router[_0x022a('0x10')](_0x022a('0xc'),auth[_0x022a('0x8')](),controller[_0x022a('0x11')]);module[_0x022a('0x12')]=router;
\ No newline at end of file
index f5c75c5..659a77d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0x4f9993,_0xd91b5b){var _0x482152=function(_0x25b089){while(--_0x25b089){_0x4f9993['push'](_0x4f9993['shift']());}};_0x482152(++_0xd91b5b);}(_0xedd9,0xfc));var _0x9edd=function(_0x56a935,_0x1b4d7b){_0x56a935=_0x56a935-0x0;var _0x56b8a9=_0xedd9[_0x56a935];return _0x56b8a9;};'use strict';var moment=require('moment');var Sequelize=require(_0x9edd('0x0'));module[_0x9edd('0x1')]={'uniqueid':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9edd('0x3')](_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6')),'allowNull':![],'defaultValue':_0x9edd('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x9edd('0x7')]}};
\ No newline at end of file
+var _0xb43b=['DATE','NOW','moment','sequelize','STRING','ENUM','account','queue'];(function(_0x41d02a,_0x355e19){var _0x4c3983=function(_0x4802a7){while(--_0x4802a7){_0x41d02a['push'](_0x41d02a['shift']());}};_0x4c3983(++_0x355e19);}(_0xb43b,0x1b2));var _0xbb43=function(_0x33b476,_0x1d4cd3){_0x33b476=_0x33b476-0x0;var _0x99fa39=_0xb43b[_0x33b476];return _0x99fa39;};'use strict';var moment=require(_0xbb43('0x0'));var Sequelize=require(_0xbb43('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xbb43('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xbb43('0x3')](_0xbb43('0x4'),'agent',_0xbb43('0x5')),'allowNull':![],'defaultValue':_0xbb43('0x5')},'transferredAt':{'type':Sequelize[_0xbb43('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xbb43('0x7')]}};
\ No newline at end of file
index 779be0d..1fe704f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3067=['limit','count','offset','apply','reject','save','update','then','destroy','error','stack','name','send','map','ChatTransferReport','fieldName','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','catch','show','params','keys','length','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','end','status','json','undefined'];(function(_0x6cfc64,_0x53d1b1){var _0x592670=function(_0x4e538b){while(--_0x4e538b){_0x6cfc64['push'](_0x6cfc64['shift']());}};_0x592670(++_0x53d1b1);}(_0x3067,0x7e));var _0x7306=function(_0x20a6db,_0x3a00a5){_0x20a6db=_0x20a6db-0x0;var _0x406dc1=_0x3067[_0x20a6db];return _0x406dc1;};'use strict';var emlformat=require(_0x7306('0x0'));var rimraf=require(_0x7306('0x1'));var zipdir=require(_0x7306('0x2'));var jsonpatch=require(_0x7306('0x3'));var rp=require(_0x7306('0x4'));var moment=require(_0x7306('0x5'));var BPromise=require(_0x7306('0x6'));var Mustache=require(_0x7306('0x7'));var util=require(_0x7306('0x8'));var path=require(_0x7306('0x9'));var sox=require(_0x7306('0xa'));var csv=require(_0x7306('0xb'));var ejs=require(_0x7306('0xc'));var fs=require('fs');var fs_extra=require(_0x7306('0xd'));var _=require(_0x7306('0xe'));var squel=require(_0x7306('0xf'));var crypto=require(_0x7306('0x10'));var jsforce=require(_0x7306('0x11'));var deskjs=require(_0x7306('0x12'));var toCsv=require(_0x7306('0xb'));var querystring=require(_0x7306('0x13'));var Papa=require(_0x7306('0x14'));var Redis=require(_0x7306('0x15'));var authService=require(_0x7306('0x16'));var qs=require(_0x7306('0x17'));var as=require(_0x7306('0x18'));var hardwareService=require(_0x7306('0x19'));var logger=require(_0x7306('0x1a'))(_0x7306('0x1b'));var utils=require(_0x7306('0x1c'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x7306('0x1d'))['db'];function respondWithStatusCode(_0x26b43d,_0x191032){_0x191032=_0x191032||0xcc;return function(_0x2e0c76){if(_0x2e0c76){return _0x26b43d['sendStatus'](_0x191032);}return _0x26b43d['status'](_0x191032)[_0x7306('0x1e')]();};}function respondWithResult(_0x37ddac,_0x492bc6){_0x492bc6=_0x492bc6||0xc8;return function(_0x3b784f){if(_0x3b784f){return _0x37ddac[_0x7306('0x1f')](_0x492bc6)[_0x7306('0x20')](_0x3b784f);}};}function respondWithFilteredResult(_0x21764a,_0x546d58){return function(_0x1cbf0a){if(_0x1cbf0a){var _0x8e6278=typeof _0x546d58['offset']===_0x7306('0x21')&&typeof _0x546d58[_0x7306('0x22')]==='undefined';var _0x3c5e18=_0x1cbf0a[_0x7306('0x23')];var _0x50f5ef=_0x8e6278?0x0:_0x546d58[_0x7306('0x24')];var _0x33a144=_0x8e6278?_0x1cbf0a[_0x7306('0x23')]:_0x546d58[_0x7306('0x24')]+_0x546d58[_0x7306('0x22')];var _0x20baec;if(_0x33a144>=_0x3c5e18){_0x33a144=_0x3c5e18;_0x20baec=0xc8;}else{_0x20baec=0xce;}_0x21764a[_0x7306('0x1f')](_0x20baec);return _0x21764a['set']('Content-Range',_0x50f5ef+'-'+_0x33a144+'/'+_0x3c5e18)[_0x7306('0x20')](_0x1cbf0a);}return null;};}function patchUpdates(_0x5ee224){return function(_0x3ff934){try{jsonpatch[_0x7306('0x25')](_0x3ff934,_0x5ee224,!![]);}catch(_0xda48a0){return BPromise[_0x7306('0x26')](_0xda48a0);}return _0x3ff934[_0x7306('0x27')]();};}function saveUpdates(_0xf3d021,_0x223f21){return function(_0x2ae177){if(_0x2ae177){return _0x2ae177[_0x7306('0x28')](_0xf3d021)[_0x7306('0x29')](function(_0xa87e91){return _0xa87e91;});}return null;};}function removeEntity(_0x2bfb37,_0x1da87b){return function(_0x56f5c8){if(_0x56f5c8){return _0x56f5c8[_0x7306('0x2a')]()[_0x7306('0x29')](function(){_0x2bfb37[_0x7306('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4be940,_0x419b1a){return function(_0xb9b205){if(!_0xb9b205){_0x4be940['sendStatus'](0x194);}return _0xb9b205;};}function handleError(_0x237de5,_0x863b4){_0x863b4=_0x863b4||0x1f4;return function(_0x4b8ed3){logger[_0x7306('0x2b')](_0x4b8ed3[_0x7306('0x2c')]);if(_0x4b8ed3[_0x7306('0x2d')]){delete _0x4b8ed3[_0x7306('0x2d')];}_0x237de5[_0x7306('0x1f')](_0x863b4)[_0x7306('0x2e')](_0x4b8ed3);};}exports['index']=function(_0x29f7d6,_0x4c952d){var _0x1f623a={},_0x557473={},_0x1954eb={'count':0x0,'rows':[]};var _0x441fe9=_[_0x7306('0x2f')](db[_0x7306('0x30')]['rawAttributes'],function(_0x4e6a54){return{'name':_0x4e6a54[_0x7306('0x31')],'type':_0x4e6a54[_0x7306('0x32')][_0x7306('0x33')]};});_0x557473[_0x7306('0x34')]=_[_0x7306('0x2f')](_0x441fe9,'name');_0x557473['query']=_['keys'](_0x29f7d6[_0x7306('0x35')]);_0x557473[_0x7306('0x36')]=_[_0x7306('0x37')](_0x557473[_0x7306('0x34')],_0x557473[_0x7306('0x35')]);_0x1f623a['attributes']=_[_0x7306('0x37')](_0x557473['model'],qs['fields'](_0x29f7d6['query'][_0x7306('0x38')]));_0x1f623a['attributes']=_0x1f623a[_0x7306('0x39')]['length']?_0x1f623a[_0x7306('0x39')]:_0x557473[_0x7306('0x34')];if(!_0x29f7d6[_0x7306('0x35')][_0x7306('0x3a')](_0x7306('0x3b'))){_0x1f623a[_0x7306('0x22')]=qs[_0x7306('0x22')](_0x29f7d6['query'][_0x7306('0x22')]);_0x1f623a[_0x7306('0x24')]=qs[_0x7306('0x24')](_0x29f7d6[_0x7306('0x35')][_0x7306('0x24')]);}_0x1f623a[_0x7306('0x3c')]=qs['sort'](_0x29f7d6[_0x7306('0x35')][_0x7306('0x3d')]);_0x1f623a[_0x7306('0x3e')]=qs[_0x7306('0x36')](_[_0x7306('0x3f')](_0x29f7d6[_0x7306('0x35')],_0x557473['filters']),_0x441fe9);if(_0x29f7d6[_0x7306('0x35')]['filter']){_0x1f623a[_0x7306('0x3e')]=_['merge'](_0x1f623a[_0x7306('0x3e')],{'$or':_[_0x7306('0x2f')](_0x441fe9,function(_0x4d86a4){if(_0x4d86a4[_0x7306('0x32')]!==_0x7306('0x40')){var _0x18535c={};_0x18535c[_0x4d86a4['name']]={'$like':'%'+_0x29f7d6[_0x7306('0x35')][_0x7306('0x41')]+'%'};return _0x18535c;}})});}_0x1f623a=_[_0x7306('0x42')]({},_0x1f623a,_0x29f7d6[_0x7306('0x43')]);var _0x39647f={'where':_0x1f623a[_0x7306('0x3e')]};return db['ChatTransferReport'][_0x7306('0x23')](_0x39647f)['then'](function(_0x39479e){_0x1954eb['count']=_0x39479e;if(_0x29f7d6['query'][_0x7306('0x44')]){_0x1f623a[_0x7306('0x45')]=[{'all':!![]}];}return db[_0x7306('0x30')][_0x7306('0x46')](_0x1f623a);})[_0x7306('0x29')](function(_0x4df175){_0x1954eb['rows']=_0x4df175;return _0x1954eb;})[_0x7306('0x29')](respondWithFilteredResult(_0x4c952d,_0x1f623a))[_0x7306('0x47')](handleError(_0x4c952d,null));};exports[_0x7306('0x48')]=function(_0x42fa55,_0x2fdaa3){var _0x44fb77={'raw':!![],'where':{'id':_0x42fa55[_0x7306('0x49')]['id']}},_0x2f7b14={};_0x2f7b14[_0x7306('0x34')]=_['keys'](db[_0x7306('0x30')]['rawAttributes']);_0x2f7b14['query']=_[_0x7306('0x4a')](_0x42fa55[_0x7306('0x35')]);_0x2f7b14[_0x7306('0x36')]=_[_0x7306('0x37')](_0x2f7b14['model'],_0x2f7b14['query']);_0x44fb77[_0x7306('0x39')]=_[_0x7306('0x37')](_0x2f7b14['model'],qs[_0x7306('0x38')](_0x42fa55[_0x7306('0x35')][_0x7306('0x38')]));_0x44fb77[_0x7306('0x39')]=_0x44fb77[_0x7306('0x39')][_0x7306('0x4b')]?_0x44fb77[_0x7306('0x39')]:_0x2f7b14['model'];if(_0x42fa55[_0x7306('0x35')][_0x7306('0x44')]){_0x44fb77['include']=[{'all':!![]}];}_0x44fb77=_[_0x7306('0x42')]({},_0x44fb77,_0x42fa55[_0x7306('0x43')]);return db[_0x7306('0x30')][_0x7306('0x4c')](_0x44fb77)['then'](handleEntityNotFound(_0x2fdaa3,null))[_0x7306('0x29')](respondWithResult(_0x2fdaa3,null))[_0x7306('0x47')](handleError(_0x2fdaa3,null));};exports[_0x7306('0x4d')]=function(_0x3f5bd6,_0x23ebed){return db[_0x7306('0x30')][_0x7306('0x4d')](_0x3f5bd6[_0x7306('0x4e')],{})[_0x7306('0x29')](respondWithResult(_0x23ebed,0xc9))['catch'](handleError(_0x23ebed,null));};exports[_0x7306('0x28')]=function(_0x4c219e,_0x5e8cc6){if(_0x4c219e['body']['id']){delete _0x4c219e['body']['id'];}return db[_0x7306('0x30')][_0x7306('0x4c')]({'where':{'id':_0x4c219e['params']['id']}})[_0x7306('0x29')](handleEntityNotFound(_0x5e8cc6,null))[_0x7306('0x29')](saveUpdates(_0x4c219e[_0x7306('0x4e')],null))['then'](respondWithResult(_0x5e8cc6,null))['catch'](handleError(_0x5e8cc6,null));};exports[_0x7306('0x2a')]=function(_0xce3ccb,_0x14418c){return db[_0x7306('0x30')][_0x7306('0x4c')]({'where':{'id':_0xce3ccb['params']['id']}})['then'](handleEntityNotFound(_0x14418c,null))[_0x7306('0x29')](removeEntity(_0x14418c,null))[_0x7306('0x47')](handleError(_0x14418c,null));};exports[_0x7306('0x4f')]=function(_0x11b353,_0x14299d){return db[_0x7306('0x30')][_0x7306('0x4f')]()['then'](respondWithResult(_0x14299d,null))[_0x7306('0x47')](handleError(_0x14299d,null));};
\ No newline at end of file
+var _0x8286=['show','params','rawAttributes','find','catch','create','body','update','describe','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','status','json','undefined','limit','count','Content-Range','reject','then','destroy','end','error','stack','name','send','index','map','ChatTransferReport','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','offset','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows'];(function(_0xf7ec9b,_0xefe7a3){var _0x519f33=function(_0x3764d2){while(--_0x3764d2){_0xf7ec9b['push'](_0xf7ec9b['shift']());}};_0x519f33(++_0xefe7a3);}(_0x8286,0x17b));var _0x6828=function(_0xeb6b88,_0x313a36){_0xeb6b88=_0xeb6b88-0x0;var _0x23d2ab=_0x8286[_0xeb6b88];return _0x23d2ab;};'use strict';var emlformat=require(_0x6828('0x0'));var rimraf=require(_0x6828('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6828('0x2'));var rp=require('request-promise');var moment=require(_0x6828('0x3'));var BPromise=require(_0x6828('0x4'));var Mustache=require(_0x6828('0x5'));var util=require(_0x6828('0x6'));var path=require(_0x6828('0x7'));var sox=require(_0x6828('0x8'));var csv=require(_0x6828('0x9'));var ejs=require(_0x6828('0xa'));var fs=require('fs');var fs_extra=require(_0x6828('0xb'));var _=require(_0x6828('0xc'));var squel=require('squel');var crypto=require(_0x6828('0xd'));var jsforce=require(_0x6828('0xe'));var deskjs=require(_0x6828('0xf'));var toCsv=require(_0x6828('0x9'));var querystring=require(_0x6828('0x10'));var Papa=require(_0x6828('0x11'));var Redis=require(_0x6828('0x12'));var authService=require(_0x6828('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6828('0x14'));var logger=require(_0x6828('0x15'))(_0x6828('0x16'));var utils=require('../../config/utils');var config=require(_0x6828('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x6828('0x18'))['db'];function respondWithStatusCode(_0x266e5e,_0x1f44e5){_0x1f44e5=_0x1f44e5||0xcc;return function(_0x31e39c){if(_0x31e39c){return _0x266e5e['sendStatus'](_0x1f44e5);}return _0x266e5e[_0x6828('0x19')](_0x1f44e5)['end']();};}function respondWithResult(_0x11979a,_0x541c20){_0x541c20=_0x541c20||0xc8;return function(_0x463c75){if(_0x463c75){return _0x11979a[_0x6828('0x19')](_0x541c20)[_0x6828('0x1a')](_0x463c75);}};}function respondWithFilteredResult(_0x541537,_0x53fb85){return function(_0x520d5b){if(_0x520d5b){var _0x2d5f91=typeof _0x53fb85['offset']===_0x6828('0x1b')&&typeof _0x53fb85[_0x6828('0x1c')]==='undefined';var _0x4d1d8c=_0x520d5b[_0x6828('0x1d')];var _0x492365=_0x2d5f91?0x0:_0x53fb85['offset'];var _0x453ef1=_0x2d5f91?_0x520d5b['count']:_0x53fb85['offset']+_0x53fb85[_0x6828('0x1c')];var _0xdc4f1a;if(_0x453ef1>=_0x4d1d8c){_0x453ef1=_0x4d1d8c;_0xdc4f1a=0xc8;}else{_0xdc4f1a=0xce;}_0x541537['status'](_0xdc4f1a);return _0x541537['set'](_0x6828('0x1e'),_0x492365+'-'+_0x453ef1+'/'+_0x4d1d8c)[_0x6828('0x1a')](_0x520d5b);}return null;};}function patchUpdates(_0x72ff48){return function(_0x4d534e){try{jsonpatch['apply'](_0x4d534e,_0x72ff48,!![]);}catch(_0x2bf16d){return BPromise[_0x6828('0x1f')](_0x2bf16d);}return _0x4d534e['save']();};}function saveUpdates(_0x2cab6e,_0x2dddda){return function(_0x2ffe37){if(_0x2ffe37){return _0x2ffe37['update'](_0x2cab6e)[_0x6828('0x20')](function(_0x47c314){return _0x47c314;});}return null;};}function removeEntity(_0x58dc7b,_0xb4a764){return function(_0x4e197c){if(_0x4e197c){return _0x4e197c[_0x6828('0x21')]()[_0x6828('0x20')](function(){_0x58dc7b['status'](0xcc)[_0x6828('0x22')]();});}};}function handleEntityNotFound(_0x1200e4,_0x14de9b){return function(_0x1a32cc){if(!_0x1a32cc){_0x1200e4['sendStatus'](0x194);}return _0x1a32cc;};}function handleError(_0x515226,_0x66a9b9){_0x66a9b9=_0x66a9b9||0x1f4;return function(_0x28e279){logger[_0x6828('0x23')](_0x28e279[_0x6828('0x24')]);if(_0x28e279[_0x6828('0x25')]){delete _0x28e279[_0x6828('0x25')];}_0x515226['status'](_0x66a9b9)[_0x6828('0x26')](_0x28e279);};}exports[_0x6828('0x27')]=function(_0x4a1d53,_0x59e36a){var _0x920346={},_0xd87f9d={},_0xf60440={'count':0x0,'rows':[]};var _0x526c97=_[_0x6828('0x28')](db[_0x6828('0x29')]['rawAttributes'],function(_0x26eb3b){return{'name':_0x26eb3b[_0x6828('0x2a')],'type':_0x26eb3b[_0x6828('0x2b')][_0x6828('0x2c')]};});_0xd87f9d[_0x6828('0x2d')]=_[_0x6828('0x28')](_0x526c97,_0x6828('0x25'));_0xd87f9d[_0x6828('0x2e')]=_[_0x6828('0x2f')](_0x4a1d53[_0x6828('0x2e')]);_0xd87f9d[_0x6828('0x30')]=_[_0x6828('0x31')](_0xd87f9d[_0x6828('0x2d')],_0xd87f9d[_0x6828('0x2e')]);_0x920346[_0x6828('0x32')]=_[_0x6828('0x31')](_0xd87f9d[_0x6828('0x2d')],qs[_0x6828('0x33')](_0x4a1d53['query'][_0x6828('0x33')]));_0x920346[_0x6828('0x32')]=_0x920346[_0x6828('0x32')][_0x6828('0x34')]?_0x920346[_0x6828('0x32')]:_0xd87f9d[_0x6828('0x2d')];if(!_0x4a1d53[_0x6828('0x2e')]['hasOwnProperty']('nolimit')){_0x920346[_0x6828('0x1c')]=qs[_0x6828('0x1c')](_0x4a1d53['query'][_0x6828('0x1c')]);_0x920346['offset']=qs[_0x6828('0x35')](_0x4a1d53[_0x6828('0x2e')][_0x6828('0x35')]);}_0x920346[_0x6828('0x36')]=qs[_0x6828('0x37')](_0x4a1d53[_0x6828('0x2e')]['sort']);_0x920346[_0x6828('0x38')]=qs[_0x6828('0x30')](_[_0x6828('0x39')](_0x4a1d53[_0x6828('0x2e')],_0xd87f9d[_0x6828('0x30')]),_0x526c97);if(_0x4a1d53['query'][_0x6828('0x3a')]){_0x920346[_0x6828('0x38')]=_[_0x6828('0x3b')](_0x920346[_0x6828('0x38')],{'$or':_[_0x6828('0x28')](_0x526c97,function(_0x13b8d5){if(_0x13b8d5[_0x6828('0x2b')]!=='VIRTUAL'){var _0x16392e={};_0x16392e[_0x13b8d5[_0x6828('0x25')]]={'$like':'%'+_0x4a1d53[_0x6828('0x2e')][_0x6828('0x3a')]+'%'};return _0x16392e;}})});}_0x920346=_['merge']({},_0x920346,_0x4a1d53[_0x6828('0x3c')]);var _0x225d68={'where':_0x920346[_0x6828('0x38')]};return db['ChatTransferReport'][_0x6828('0x1d')](_0x225d68)[_0x6828('0x20')](function(_0x40320f){_0xf60440[_0x6828('0x1d')]=_0x40320f;if(_0x4a1d53[_0x6828('0x2e')][_0x6828('0x3d')]){_0x920346[_0x6828('0x3e')]=[{'all':!![]}];}return db['ChatTransferReport'][_0x6828('0x3f')](_0x920346);})[_0x6828('0x20')](function(_0xbacc2b){_0xf60440[_0x6828('0x40')]=_0xbacc2b;return _0xf60440;})[_0x6828('0x20')](respondWithFilteredResult(_0x59e36a,_0x920346))['catch'](handleError(_0x59e36a,null));};exports[_0x6828('0x41')]=function(_0x152eed,_0x35df70){var _0xddbf59={'raw':!![],'where':{'id':_0x152eed[_0x6828('0x42')]['id']}},_0x5e5d75={};_0x5e5d75['model']=_[_0x6828('0x2f')](db['ChatTransferReport'][_0x6828('0x43')]);_0x5e5d75[_0x6828('0x2e')]=_['keys'](_0x152eed[_0x6828('0x2e')]);_0x5e5d75[_0x6828('0x30')]=_[_0x6828('0x31')](_0x5e5d75[_0x6828('0x2d')],_0x5e5d75['query']);_0xddbf59['attributes']=_[_0x6828('0x31')](_0x5e5d75[_0x6828('0x2d')],qs[_0x6828('0x33')](_0x152eed[_0x6828('0x2e')][_0x6828('0x33')]));_0xddbf59[_0x6828('0x32')]=_0xddbf59[_0x6828('0x32')]['length']?_0xddbf59[_0x6828('0x32')]:_0x5e5d75['model'];if(_0x152eed[_0x6828('0x2e')][_0x6828('0x3d')]){_0xddbf59[_0x6828('0x3e')]=[{'all':!![]}];}_0xddbf59=_[_0x6828('0x3b')]({},_0xddbf59,_0x152eed[_0x6828('0x3c')]);return db['ChatTransferReport'][_0x6828('0x44')](_0xddbf59)['then'](handleEntityNotFound(_0x35df70,null))[_0x6828('0x20')](respondWithResult(_0x35df70,null))[_0x6828('0x45')](handleError(_0x35df70,null));};exports[_0x6828('0x46')]=function(_0x5dbf75,_0x14ac38){return db[_0x6828('0x29')][_0x6828('0x46')](_0x5dbf75[_0x6828('0x47')],{})[_0x6828('0x20')](respondWithResult(_0x14ac38,0xc9))['catch'](handleError(_0x14ac38,null));};exports[_0x6828('0x48')]=function(_0x33614d,_0x11d0c0){if(_0x33614d[_0x6828('0x47')]['id']){delete _0x33614d[_0x6828('0x47')]['id'];}return db[_0x6828('0x29')]['find']({'where':{'id':_0x33614d[_0x6828('0x42')]['id']}})[_0x6828('0x20')](handleEntityNotFound(_0x11d0c0,null))[_0x6828('0x20')](saveUpdates(_0x33614d[_0x6828('0x47')],null))[_0x6828('0x20')](respondWithResult(_0x11d0c0,null))[_0x6828('0x45')](handleError(_0x11d0c0,null));};exports[_0x6828('0x21')]=function(_0x445dcf,_0x2e35ab){return db[_0x6828('0x29')][_0x6828('0x44')]({'where':{'id':_0x445dcf[_0x6828('0x42')]['id']}})[_0x6828('0x20')](handleEntityNotFound(_0x2e35ab,null))[_0x6828('0x20')](removeEntity(_0x2e35ab,null))[_0x6828('0x45')](handleError(_0x2e35ab,null));};exports[_0x6828('0x49')]=function(_0x2fdabb,_0x1f5ffa){return db[_0x6828('0x29')][_0x6828('0x49')]()[_0x6828('0x20')](respondWithResult(_0x1f5ffa,null))[_0x6828('0x45')](handleError(_0x1f5ffa,null));};
\ No newline at end of file
index e70b9eb..1c1a2e0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd9a9=['path','rimraf','../../config/environment','./chatTransferReport.attributes','exports','define','report_chat_transfer','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x417b50,_0x35c440){var _0x493c22=function(_0x248018){while(--_0x248018){_0x417b50['push'](_0x417b50['shift']());}};_0x493c22(++_0x35c440);}(_0xd9a9,0xf6));var _0x9d9a=function(_0x2c0ede,_0x4c5d6f){_0x2c0ede=_0x2c0ede-0x0;var _0x4c0880=_0xd9a9[_0x2c0ede];return _0x4c0880;};'use strict';var _=require('lodash');var util=require(_0x9d9a('0x0'));var logger=require(_0x9d9a('0x1'))(_0x9d9a('0x2'));var moment=require(_0x9d9a('0x3'));var BPromise=require(_0x9d9a('0x4'));var rp=require(_0x9d9a('0x5'));var fs=require('fs');var path=require(_0x9d9a('0x6'));var rimraf=require(_0x9d9a('0x7'));var config=require(_0x9d9a('0x8'));var attributes=require(_0x9d9a('0x9'));module[_0x9d9a('0xa')]=function(_0x1aeab6,_0x2ed0b4){return _0x1aeab6[_0x9d9a('0xb')]('ChatTransferReport',attributes,{'tableName':_0x9d9a('0xc'),'paranoid':![],'indexes':[{'name':_0x9d9a('0xd'),'fields':[_0x9d9a('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x9f2c=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','ChatTransferReport','report_chat_transfer','uniqueid','util','../../config/logger'];(function(_0x7054ce,_0x3a24ad){var _0x3670c2=function(_0x1abf0d){while(--_0x1abf0d){_0x7054ce['push'](_0x7054ce['shift']());}};_0x3670c2(++_0x3a24ad);}(_0x9f2c,0x1ba));var _0xc9f2=function(_0x347399,_0x42bbda){_0x347399=_0x347399-0x0;var _0x24e7be=_0x9f2c[_0x347399];return _0x24e7be;};'use strict';var _=require('lodash');var util=require(_0xc9f2('0x0'));var logger=require(_0xc9f2('0x1'))(_0xc9f2('0x2'));var moment=require(_0xc9f2('0x3'));var BPromise=require(_0xc9f2('0x4'));var rp=require(_0xc9f2('0x5'));var fs=require('fs');var path=require(_0xc9f2('0x6'));var rimraf=require(_0xc9f2('0x7'));var config=require(_0xc9f2('0x8'));var attributes=require('./chatTransferReport.attributes');module['exports']=function(_0x2922dc,_0x490086){return _0x2922dc['define'](_0xc9f2('0x9'),attributes,{'tableName':_0xc9f2('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xc9f2('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
index 70ff396..8ce40d6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8f47=['then','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatTransferReport,\x20%s,\x20%s','message','info','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request'];(function(_0x2eccc8,_0x29bee5){var _0x258cf4=function(_0x2f6f86){while(--_0x2f6f86){_0x2eccc8['push'](_0x2eccc8['shift']());}};_0x258cf4(++_0x29bee5);}(_0x8f47,0x6b));var _0x78f4=function(_0x59f670,_0x2a34aa){_0x59f670=_0x59f670-0x0;var _0x4ad264=_0x8f47[_0x59f670];return _0x4ad264;};'use strict';var _=require(_0x78f4('0x0'));var util=require(_0x78f4('0x1'));var moment=require('moment');var BPromise=require(_0x78f4('0x2'));var rs=require(_0x78f4('0x3'));var fs=require('fs');var Redis=require(_0x78f4('0x4'));var db=require(_0x78f4('0x5'))['db'];var utils=require(_0x78f4('0x6'));var logger=require(_0x78f4('0x7'))(_0x78f4('0x8'));var config=require('../../config/environment');var jayson=require(_0x78f4('0x9'));var client=jayson[_0x78f4('0xa')][_0x78f4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x53096d,_0x149515,_0x305f49){return new BPromise(function(_0x15efa7,_0x55541e){return client[_0x78f4('0xc')](_0x53096d,_0x305f49)[_0x78f4('0xd')](function(_0x4b371b){logger['info']('ChatTransferReport,\x20%s,\x20%s',_0x149515,_0x78f4('0xe'));logger[_0x78f4('0xf')](_0x78f4('0x10'),_0x149515,_0x78f4('0xe'),JSON[_0x78f4('0x11')](_0x4b371b));if(_0x4b371b[_0x78f4('0x12')]){if(_0x4b371b[_0x78f4('0x12')][_0x78f4('0x13')]===0x1f4){logger['error'](_0x78f4('0x14'),_0x149515,_0x4b371b['error'][_0x78f4('0x15')]);return _0x55541e(_0x4b371b['error'][_0x78f4('0x15')]);}logger['error'](_0x78f4('0x14'),_0x149515,_0x4b371b['error'][_0x78f4('0x15')]);return _0x15efa7(_0x4b371b[_0x78f4('0x12')]['message']);}else{logger[_0x78f4('0x16')](_0x78f4('0x14'),_0x149515,'request\x20sent');_0x15efa7(_0x4b371b[_0x78f4('0x17')][_0x78f4('0x15')]);}})['catch'](function(_0x25c284){logger['error'](_0x78f4('0x14'),_0x149515,_0x25c284);_0x55541e(_0x25c284);});});}
\ No newline at end of file
+var _0x6a95=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','ChatTransferReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','lodash','moment','bluebird'];(function(_0x486b5e,_0x2c0ef8){var _0x343b2c=function(_0x274039){while(--_0x274039){_0x486b5e['push'](_0x486b5e['shift']());}};_0x343b2c(++_0x2c0ef8);}(_0x6a95,0x105));var _0x56a9=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0x6a95[_0x32d457];return _0x338386;};'use strict';var _=require(_0x56a9('0x0'));var util=require('util');var moment=require(_0x56a9('0x1'));var BPromise=require(_0x56a9('0x2'));var rs=require(_0x56a9('0x3'));var fs=require('fs');var Redis=require(_0x56a9('0x4'));var db=require(_0x56a9('0x5'))['db'];var utils=require(_0x56a9('0x6'));var logger=require(_0x56a9('0x7'))('rpc');var config=require(_0x56a9('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x56a9('0x9')][_0x56a9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3747e9,_0x4df9de,_0x3661de){return new BPromise(function(_0x2402f8,_0x403481){return client[_0x56a9('0xb')](_0x3747e9,_0x3661de)[_0x56a9('0xc')](function(_0x63c99c){logger[_0x56a9('0xd')](_0x56a9('0xe'),_0x4df9de,'request\x20sent');logger[_0x56a9('0xf')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x4df9de,_0x56a9('0x10'),JSON[_0x56a9('0x11')](_0x63c99c));if(_0x63c99c[_0x56a9('0x12')]){if(_0x63c99c[_0x56a9('0x12')][_0x56a9('0x13')]===0x1f4){logger['error'](_0x56a9('0xe'),_0x4df9de,_0x63c99c['error'][_0x56a9('0x14')]);return _0x403481(_0x63c99c[_0x56a9('0x12')][_0x56a9('0x14')]);}logger[_0x56a9('0x12')]('ChatTransferReport,\x20%s,\x20%s',_0x4df9de,_0x63c99c[_0x56a9('0x12')][_0x56a9('0x14')]);return _0x2402f8(_0x63c99c['error'][_0x56a9('0x14')]);}else{logger['info']('ChatTransferReport,\x20%s,\x20%s',_0x4df9de,_0x56a9('0x10'));_0x2402f8(_0x63c99c[_0x56a9('0x15')][_0x56a9('0x14')]);}})['catch'](function(_0xe29e76){logger[_0x56a9('0x12')](_0x56a9('0xe'),_0x4df9de,_0xe29e76);_0x403481(_0xe29e76);});});}
\ No newline at end of file
index 49ab5e0..ed52283 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1977=['show','post','create','put','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index','/:id'];(function(_0x1227fd,_0x49d01f){var _0x2bba3f=function(_0x2e754a){while(--_0x2e754a){_0x1227fd['push'](_0x1227fd['shift']());}};_0x2bba3f(++_0x49d01f);}(_0x1977,0x141));var _0x7197=function(_0x13be32,_0x43266c){_0x13be32=_0x13be32-0x0;var _0x2a073b=_0x1977[_0x13be32];return _0x2a073b;};'use strict';var multer=require(_0x7197('0x0'));var util=require(_0x7197('0x1'));var path=require(_0x7197('0x2'));var timeout=require(_0x7197('0x3'));var express=require(_0x7197('0x4'));var router=express[_0x7197('0x5')]();var fs_extra=require(_0x7197('0x6'));var auth=require(_0x7197('0x7'));var interaction=require(_0x7197('0x8'));var config=require(_0x7197('0x9'));var controller=require(_0x7197('0xa'));router[_0x7197('0xb')]('/',auth[_0x7197('0xc')](),controller[_0x7197('0xd')]);router[_0x7197('0xb')]('/describe',auth[_0x7197('0xc')](),controller['describe']);router[_0x7197('0xb')](_0x7197('0xe'),auth['isAuthenticated'](),controller[_0x7197('0xf')]);router[_0x7197('0x10')]('/',auth[_0x7197('0xc')](),controller[_0x7197('0x11')]);router[_0x7197('0x12')]('/:id',auth[_0x7197('0xc')](),controller['update']);router['delete']('/:id',auth[_0x7197('0xc')](),controller[_0x7197('0x13')]);module[_0x7197('0x14')]=router;
\ No newline at end of file
+var _0x1a86=['/describe','describe','get','/:id','show','post','create','put','update','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','isAuthenticated'];(function(_0x484780,_0xbbe226){var _0x2f6a92=function(_0x37e258){while(--_0x37e258){_0x484780['push'](_0x484780['shift']());}};_0x2f6a92(++_0xbbe226);}(_0x1a86,0x121));var _0x61a8=function(_0x2feae7,_0x4c7bf4){_0x2feae7=_0x2feae7-0x0;var _0x27ca97=_0x1a86[_0x2feae7];return _0x27ca97;};'use strict';var multer=require(_0x61a8('0x0'));var util=require('util');var path=require(_0x61a8('0x1'));var timeout=require(_0x61a8('0x2'));var express=require(_0x61a8('0x3'));var router=express[_0x61a8('0x4')]();var fs_extra=require(_0x61a8('0x5'));var auth=require(_0x61a8('0x6'));var interaction=require(_0x61a8('0x7'));var config=require(_0x61a8('0x8'));var controller=require(_0x61a8('0x9'));router['get']('/',auth[_0x61a8('0xa')](),controller['index']);router['get'](_0x61a8('0xb'),auth[_0x61a8('0xa')](),controller[_0x61a8('0xc')]);router[_0x61a8('0xd')](_0x61a8('0xe'),auth['isAuthenticated'](),controller[_0x61a8('0xf')]);router[_0x61a8('0x10')]('/',auth['isAuthenticated'](),controller[_0x61a8('0x11')]);router[_0x61a8('0x12')](_0x61a8('0xe'),auth[_0x61a8('0xa')](),controller[_0x61a8('0x13')]);router['delete'](_0x61a8('0xe'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index bfa5b21..478f145 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x34e8=['Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Chat','Contact\x20us','Powered\x20by\x20xCALLY','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Send','Skip','star','TEXT','name','text','input','getDataValue','onlineForm','stringify','offlineForm','parse','setDataValue','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.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','bottom_right','CHAT','#fafafa','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','address','email'];(function(_0x5b7d4c,_0x336fd6){var _0x2d58d4=function(_0x512e38){while(--_0x512e38){_0x5b7d4c['push'](_0x5b7d4c['shift']());}};_0x2d58d4(++_0x336fd6);}(_0x34e8,0x12c));var _0x834e=function(_0x5e3bbd,_0x4e2c8a){_0x5e3bbd=_0x5e3bbd-0x0;var _0x16f6c2=_0x34e8[_0x5e3bbd];return _0x16f6c2;};'use strict';var Sequelize=require(_0x834e('0x0'));var rs=require(_0x834e('0x1'));module[_0x834e('0x2')]={'name':{'type':Sequelize[_0x834e('0x3')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x834e('0x4')},'description':{'type':Sequelize[_0x834e('0x3')]},'mapKey':{'type':Sequelize[_0x834e('0x3')],'defaultValue':_0x834e('0x5')},'mapKeyOffline':{'type':Sequelize[_0x834e('0x3')],'defaultValue':_0x834e('0x5')},'key':{'type':Sequelize[_0x834e('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0x834e('0x6')},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize[_0x834e('0x3')],'allowNull':![],'defaultValue':_0x834e('0x7'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x834e('0x3')],'allowNull':![],'defaultValue':_0x834e('0x7'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x834e('0x3')],'allowNull':![],'defaultValue':_0x834e('0x8'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x834e('0x3')],'allowNull':![],'defaultValue':_0x834e('0x8'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x834e('0x9')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x834e('0x3')]},'animation':{'type':Sequelize[_0x834e('0xa')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x834e('0xb')](_0x834e('0xc'),_0x834e('0xd')),'defaultValue':_0x834e('0xc')},'header_online':{'type':Sequelize[_0x834e('0x3')],'defaultValue':_0x834e('0xe')},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x834e('0xf')},'offline_chat_button':{'type':Sequelize[_0x834e('0x3')],'defaultValue':'Send'},'header_offline':{'type':Sequelize[_0x834e('0x3')],'defaultValue':_0x834e('0x10')},'download_transcript':{'type':Sequelize[_0x834e('0xa')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x834e('0x9')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':_0x834e('0x11')},'defaultWhiteLabel':{'type':Sequelize[_0x834e('0xa')],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0x834e('0x3')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0x834e('0x3')],'defaultValue':_0x834e('0x12')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0x834e('0x13')},'noteTitle':{'type':Sequelize[_0x834e('0x3')],'defaultValue':_0x834e('0x14')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0x834e('0x15')},'closingMessage':{'type':Sequelize[_0x834e('0x3')],'defaultValue':_0x834e('0x16')},'closingMessageButton':{'type':Sequelize[_0x834e('0x3')],'defaultValue':_0x834e('0x17')},'skipMessageButton':{'type':Sequelize[_0x834e('0x3')],'defaultValue':_0x834e('0x18')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x834e('0xa')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x834e('0xa')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x834e('0xa')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x834e('0x3')],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize[_0x834e('0xb')](_0x834e('0x19'),'thumb'),'defaultValue':_0x834e('0x19')},'ratingStarsNumber':{'type':Sequelize[_0x834e('0x9')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x834e('0x1a')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':'input','variable':null,'config':{'placeholder':_0x834e('0x1b'),'type':_0x834e('0x1c'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':_0x834e('0x1d'),'props':{'title':_0x834e('0x5'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x834e('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x834e('0x1e')](_0x834e('0x1f'))?JSON['parse'](this[_0x834e('0x1e')](_0x834e('0x1f'))):{};},'set':function(_0x5e1cc5){return this['setDataValue'](_0x834e('0x1f'),JSON['stringify'](_0x5e1cc5));}},'offlineForm':{'type':Sequelize[_0x834e('0x1a')],'defaultValue':function(){return JSON[_0x834e('0x20')]({'items':[{'type':_0x834e('0x1d'),'props':{'title':_0x834e('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x834e('0x5'),'type':_0x834e('0x5')},'variable':null},{'type':'textarea','config':{'placeholder':'Comments'},'props':{'title':'Comments','helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0x834e('0x1e')](_0x834e('0x21'))?JSON[_0x834e('0x22')](this['getDataValue'](_0x834e('0x21'))):{};},'set':function(_0x11f1ce){return this[_0x834e('0x23')](_0x834e('0x21'),JSON[_0x834e('0x20')](_0x11f1ce));}},'token':{'type':Sequelize[_0x834e('0x3')],'defaultValue':function(){return rs[_0x834e('0x24')]();}},'autoclose':{'type':Sequelize[_0x834e('0xa')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x834e('0xa')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x834e('0x3')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x834e('0x3')]},'waitingTitle':{'type':Sequelize[_0x834e('0x3')],'defaultValue':_0x834e('0x25')},'waitingMessage':{'type':Sequelize[_0x834e('0x3')],'defaultValue':_0x834e('0x26')},'offlineMessageSubject':{'type':Sequelize[_0x834e('0x3')],'defaultValue':_0x834e('0x27')},'offlineMessageBody':{'type':Sequelize[_0x834e('0x3')],'defaultValue':_0x834e('0x28')},'enableUnmanagedNote':{'type':Sequelize[_0x834e('0xa')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0x834e('0x29')},'skipUnmanaged':{'type':Sequelize[_0x834e('0x3')],'defaultValue':_0x834e('0x18')},'sendUnmanaged':{'type':Sequelize[_0x834e('0x3')],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize[_0x834e('0xa')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x834e('0xa')],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x834e('0x1a')],'defaultValue':function(){return _0x834e('0x2a');}},'notificationSound':{'type':Sequelize[_0x834e('0xa')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x834e('0xa')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x834e('0xa')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x834e('0x3')],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0x834e('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':_0x834e('0x2b')},'verticalAlignment':{'type':Sequelize[_0x834e('0x9')],'defaultValue':0x1e},'labelText':{'type':Sequelize['STRING'],'defaultValue':_0x834e('0x2c')},'messagesAlignment':{'type':Sequelize[_0x834e('0x3')],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize[_0x834e('0x1a')]},'showCustomerAvatar':{'type':Sequelize[_0x834e('0xa')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x834e('0x9')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x834e('0x3')],'allowNull':![],'defaultValue':_0x834e('0x2d'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x834e('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x834e('0x3')],'defaultValue':'System'},'systemAvatar':{'type':Sequelize[_0x834e('0x1a')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x834e('0x9')],'comment':_0x834e('0x2e')},'mandatoryDisposition':{'type':Sequelize[_0x834e('0xa')],'defaultValue':![],'comment':_0x834e('0x2f'),'set':function(_0x574ea8){if(!_0x574ea8)this[_0x834e('0x23')](_0x834e('0x30'),null);this[_0x834e('0x23')]('mandatoryDisposition',_0x574ea8);}},'vidaooEscalation':{'type':Sequelize[_0x834e('0xa')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x834e('0x3')]},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x834e('0x31')},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0x834e('0x32');}},'vidaooMetadata':{'type':Sequelize[_0x834e('0x1a')],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0xf4eb=['squared','We\x20are\x20here!','Chat','Contact\x20us','Powered\x20by\x20xCALLY','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20submission\x20error','Note','Type\x20a\x20message','Skip','Feedback','ENUM','star','thumb','TEXT','stringify','input','text','name','getDataValue','onlineForm','textarea','Comments','Leave\x20your\x20comments','parse','offlineForm','setDataValue','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Your\x20request\x20has\x20not\x20been\x20processed.','Send','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','bottom_right','CHAT','alternate','#fafafa','System','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','sequelize','address','email','STRING','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN'];(function(_0x2cf3b0,_0x4e6a14){var _0x29fd9c=function(_0x514c07){while(--_0x514c07){_0x2cf3b0['push'](_0x2cf3b0['shift']());}};_0x29fd9c(++_0x4e6a14);}(_0xf4eb,0xec));var _0xbf4e=function(_0x60403,_0x70a934){_0x60403=_0x60403-0x0;var _0x134abb=_0xf4eb[_0x60403];return _0x134abb;};'use strict';var Sequelize=require(_0xbf4e('0x0'));var rs=require('randomstring');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xbf4e('0x1')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0xbf4e('0x2')},'mapKeyOffline':{'type':Sequelize[_0xbf4e('0x3')],'defaultValue':_0xbf4e('0x2')},'key':{'type':Sequelize[_0xbf4e('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xbf4e('0x3')],'defaultValue':_0xbf4e('0x4')},'customerAlias':{'type':Sequelize[_0xbf4e('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xbf4e('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xbf4e('0x3')],'allowNull':![],'defaultValue':_0xbf4e('0x6'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0xbf4e('0x3')],'allowNull':![],'defaultValue':_0xbf4e('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xbf4e('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xbf4e('0x3')]},'animation':{'type':Sequelize[_0xbf4e('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM']('rounded',_0xbf4e('0x9')),'defaultValue':'rounded'},'header_online':{'type':Sequelize[_0xbf4e('0x3')],'defaultValue':_0xbf4e('0xa')},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xbf4e('0xb')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':'Send'},'header_offline':{'type':Sequelize[_0xbf4e('0x3')],'defaultValue':_0xbf4e('0xc')},'download_transcript':{'type':Sequelize[_0xbf4e('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xbf4e('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xbf4e('0x3')],'defaultValue':_0xbf4e('0xd')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0xbf4e('0x3')],'defaultValue':_0xbf4e('0xe')},'formSubmitSuccessMessage':{'type':Sequelize[_0xbf4e('0x3')],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0xbf4e('0x3')],'defaultValue':_0xbf4e('0xf')},'noteTitle':{'type':Sequelize[_0xbf4e('0x3')],'defaultValue':_0xbf4e('0x10')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0xbf4e('0x11')},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize[_0xbf4e('0x3')],'defaultValue':_0xbf4e('0x12')},'conditionAgreement':{'type':Sequelize[_0xbf4e('0x8')],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xbf4e('0x8')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xbf4e('0x3')],'defaultValue':_0xbf4e('0x13')},'ratingType':{'type':Sequelize[_0xbf4e('0x14')](_0xbf4e('0x15'),_0xbf4e('0x16')),'defaultValue':_0xbf4e('0x15')},'ratingStarsNumber':{'type':Sequelize[_0xbf4e('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xbf4e('0x17')],'defaultValue':function(){return JSON[_0xbf4e('0x18')]({'items':[{'type':_0xbf4e('0x19'),'variable':null,'config':{'placeholder':'name','type':_0xbf4e('0x1a'),'required':!![]},'props':{'title':_0xbf4e('0x1b'),'helpText':''}},{'type':'input','props':{'title':_0xbf4e('0x2'),'helpText':''},'config':{'required':!![],'placeholder':_0xbf4e('0x2'),'type':_0xbf4e('0x2')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xbf4e('0x1c')](_0xbf4e('0x1d'))?JSON['parse'](this[_0xbf4e('0x1c')](_0xbf4e('0x1d'))):{};},'set':function(_0x3d6863){return this['setDataValue'](_0xbf4e('0x1d'),JSON['stringify'](_0x3d6863));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0xbf4e('0x18')]({'items':[{'type':'input','props':{'title':_0xbf4e('0x2'),'helpText':''},'config':{'required':!![],'placeholder':_0xbf4e('0x2'),'type':_0xbf4e('0x2')},'variable':null},{'type':_0xbf4e('0x1e'),'config':{'placeholder':'Comments'},'props':{'title':_0xbf4e('0x1f'),'helpText':_0xbf4e('0x20')}}],'fromKey':0x0});},'get':function(){return this[_0xbf4e('0x1c')]('offlineForm')?JSON[_0xbf4e('0x21')](this['getDataValue'](_0xbf4e('0x22'))):{};},'set':function(_0x1421e1){return this[_0xbf4e('0x23')]('offlineForm',JSON[_0xbf4e('0x18')](_0x1421e1));}},'token':{'type':Sequelize[_0xbf4e('0x3')],'defaultValue':function(){return rs[_0xbf4e('0x24')]();}},'autoclose':{'type':Sequelize[_0xbf4e('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xbf4e('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xbf4e('0x8')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize[_0xbf4e('0x8')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xbf4e('0x3')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0xbf4e('0x25')},'waitingMessage':{'type':Sequelize[_0xbf4e('0x3')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0xbf4e('0x3')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0xbf4e('0x3')],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0xbf4e('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xbf4e('0x3')],'defaultValue':_0xbf4e('0x26')},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0xbf4e('0x12')},'sendUnmanaged':{'type':Sequelize[_0xbf4e('0x3')],'defaultValue':_0xbf4e('0x27')},'enableCustomerAttachment':{'type':Sequelize[_0xbf4e('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xbf4e('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xbf4e('0x17')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize[_0xbf4e('0x3')]},'notificationTemplate':{'type':Sequelize[_0xbf4e('0x17')],'defaultValue':function(){return _0xbf4e('0x28');}},'notificationSound':{'type':Sequelize[_0xbf4e('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xbf4e('0x8')],'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[_0xbf4e('0x3')],'defaultValue':_0xbf4e('0x29')},'verticalAlignment':{'type':Sequelize[_0xbf4e('0x7')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0xbf4e('0x3')],'defaultValue':_0xbf4e('0x2a')},'messagesAlignment':{'type':Sequelize[_0xbf4e('0x3')],'defaultValue':_0xbf4e('0x2b')},'defaultTitle':{'type':Sequelize[_0xbf4e('0x3')]},'customerAvatar':{'type':Sequelize[_0xbf4e('0x17')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xbf4e('0x3')],'allowNull':![],'defaultValue':_0xbf4e('0x2c'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xbf4e('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xbf4e('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xbf4e('0x3')],'defaultValue':_0xbf4e('0x2d')},'systemAvatar':{'type':Sequelize[_0xbf4e('0x17')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xbf4e('0x7')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xbf4e('0x8')],'defaultValue':![],'comment':_0xbf4e('0x2e'),'set':function(_0x3aa308){if(!_0x3aa308)this[_0xbf4e('0x23')]('mandatoryDispositionPauseId',null);this[_0xbf4e('0x23')](_0xbf4e('0x2f'),_0x3aa308);}},'vidaooEscalation':{'type':Sequelize[_0xbf4e('0x8')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xbf4e('0x3')]},'vidaooTopic':{'type':Sequelize[_0xbf4e('0x3')],'allowNull':![],'defaultValue':_0xbf4e('0x30')},'vidaooNote':{'type':Sequelize[_0xbf4e('0x3')],'defaultValue':function(){return'Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}';}},'vidaooMetadata':{'type':Sequelize[_0xbf4e('0x17')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xbf4e('0x8')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}};
\ No newline at end of file
index a380606..c7fe785 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x425b=['ValidationError','updatedAt','difference','createdAt','CompanyId','ListId','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','ChatApplication','Applications','applications','list','orderBy','account','contact','customerIp','cf-connecting-ip','first','x-forwarded-for','split','firstName','lastName','x-real-port','referer','browser','version','format','unknown','%s\x20%s','device','%s\x20%s\x20%s','vendor','threadId','externalUrl','ChatInteraction','ContactId','interaction','spread','update','created','unmanaged','*,*,*,*','AttachmentId','User','unshift','agent','forcedOwnership','Start','startRouting','EventManager','files','no\x20available\x20attributes','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','readFileSync','utf8','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','originalname','mimetype','server','attachments','offline-chat','basename','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','MailServerOut','Smtp','CloudProvider','forwardOffline','SendMail','email','forwardOfflineAddress','offlineMessageSubject','MailAccountId','subjectOffline','Chat','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','getInteractions','Contact','Owner','Tag','Tags','tag','Command','getSnippet','timezone','iftime\x20%s,%s','iftime\x20%s','interval','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','Interval','Intervals','getProactiveActions','virtual','increment','chatLicenseExceeded','push','server/files/chat/iframe.ejs','remote','x-real-ip','connection','render','alignment','verticalAlignment','color','labelText','textColor','color_button','backgroundColor','IntervalId','addApplications','READ_COMMITTED','findAndCountAll','priority','finally','getApplications','hasOwnProperty','chatProactiveAction','addProactiveActions','omit','getFields','onlineForm','items','fromKey','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','bluebird','ejs','fs-extra','lodash','querystring','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','./chatWebsite.socket','register','jayson/promise','http','client','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','destroy','UserProfileResource','end','stack','name','send','index','Pause','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','type','query','keys','filters','model','fields','attributes','length','nolimit','order','sort','pick','filter','where','merge','options','includeAll','findAll','rows','show','params','intersection','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','describe','ChatWebsiteId','Disposition','findOne','removeDispositions','addAnswer','CannedAnswer','getAnswers','removeAnswers','ids','addLogo','file','filename','addAvatar','agentAvatar','customerAvatar','getLogo','join','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','custom','existsSync','root','server/files/images/logos/','sitepic','download','server/files/images/avatars/default_avatar.png','isNil','server/files/images/avatars/','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','server/files/images/avatars/system_avatar.png','systemAvatar','user-agent-parser','setUA','headers','user-agent','getResult','chat','CmContact','Sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x425b,0x1b7));var _0xb425=function(_0x34e7d0,_0x156956){_0x34e7d0=_0x34e7d0-0x0;var _0x2b1800=_0x425b[_0x34e7d0];return _0x2b1800;};'use strict';var BPromise=require(_0xb425('0x0'));var Mustache=require('mustache');var util=require('util');var path=require('path');var ejs=require(_0xb425('0x1'));var fs=require('fs');var fs_extra=require(_0xb425('0x2'));var _=require(_0xb425('0x3'));var querystring=require(_0xb425('0x4'));var Redis=require(_0xb425('0x5'));var qs=require(_0xb425('0x6'));var logger=require('../../config/logger')(_0xb425('0x7'));var config=require(_0xb425('0x8'));var db=require(_0xb425('0x9'))['db'];config['redis']=_[_0xb425('0xa')](config[_0xb425('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xb425('0xc'))(new Redis(config[_0xb425('0xb')]));require(_0xb425('0xd'))[_0xb425('0xe')](socket);var htmlToText=require('html-to-text');var jayson=require(_0xb425('0xf'));var client=jayson['client'][_0xb425('0x10')]({'port':0x232c});var client9002=jayson['client'][_0xb425('0x10')]({'port':0x232a});var client9003=jayson['client'][_0xb425('0x10')]({'port':0x232b});var client9001=jayson[_0xb425('0x11')]['http']({'port':0x2329});function respondWithRpcPromise(_0x4903e9,_0x49d1b9,_0x520683,_0x1e966e){return new BPromise(function(_0xe778a8,_0x45c482){var _0x31eb72=_0x1e966e||client;return _0x31eb72[_0xb425('0x12')](_0x4903e9,_0x520683)[_0xb425('0x13')](function(_0x21c17b){logger[_0xb425('0x14')](_0xb425('0x15'),_0x49d1b9,_0xb425('0x16'));logger[_0xb425('0x17')](_0xb425('0x18'),_0x49d1b9,_0xb425('0x16'),JSON[_0xb425('0x19')](_0x21c17b));if(_0x21c17b[_0xb425('0x1a')]){if(_0x21c17b['error'][_0xb425('0x1b')]===0x1f4){logger[_0xb425('0x1a')](_0xb425('0x15'),_0x49d1b9,_0x21c17b[_0xb425('0x1a')][_0xb425('0x1c')]);return _0x45c482(_0x21c17b['error'][_0xb425('0x1c')]);}logger['error'](_0xb425('0x15'),_0x49d1b9,_0x21c17b[_0xb425('0x1a')]['message']);return _0xe778a8(_0x21c17b[_0xb425('0x1a')][_0xb425('0x1c')]);}else{logger[_0xb425('0x14')]('ChatWebsite,\x20%s,\x20%s',_0x49d1b9,'request\x20sent');_0xe778a8(_0x21c17b[_0xb425('0x1d')][_0xb425('0x1c')]);}})[_0xb425('0x1e')](function(_0x1ad19e){logger[_0xb425('0x1a')](_0xb425('0x15'),_0x49d1b9,_0x1ad19e);_0x45c482(_0x1ad19e);});});}function respondWithStatusCode(_0x1884fe,_0x4d1bf1){_0x4d1bf1=_0x4d1bf1||0xcc;return function(_0x10c1a1){if(_0x10c1a1){return _0x1884fe[_0xb425('0x1f')](_0x4d1bf1);}return _0x1884fe['status'](_0x4d1bf1)['end']();};}function respondWithResult(_0x550fc0,_0x23ec8b){_0x23ec8b=_0x23ec8b||0xc8;return function(_0x156f74){if(_0x156f74){return _0x550fc0[_0xb425('0x20')](_0x23ec8b)['json'](_0x156f74);}};}function respondWithFilteredResult(_0x1a4156,_0x47e36a){return function(_0x4433db){if(_0x4433db){var _0x1d4531=typeof _0x47e36a[_0xb425('0x21')]===_0xb425('0x22')&&typeof _0x47e36a[_0xb425('0x23')]===_0xb425('0x22');var _0x154810=_0x4433db[_0xb425('0x24')];var _0x41000b=_0x1d4531?0x0:_0x47e36a[_0xb425('0x21')];var _0x2f2766=_0x1d4531?_0x4433db[_0xb425('0x24')]:_0x47e36a[_0xb425('0x21')]+_0x47e36a[_0xb425('0x23')];var _0xdf2c63;if(_0x2f2766>=_0x154810){_0x2f2766=_0x154810;_0xdf2c63=0xc8;}else{_0xdf2c63=0xce;}_0x1a4156[_0xb425('0x20')](_0xdf2c63);return _0x1a4156[_0xb425('0x25')](_0xb425('0x26'),_0x41000b+'-'+_0x2f2766+'/'+_0x154810)[_0xb425('0x27')](_0x4433db);}return null;};}function saveUpdates(_0x484b09){return function(_0x2a9994){if(_0x2a9994){return _0x2a9994['update'](_0x484b09)[_0xb425('0x13')](function(_0x3d58b4){return _0x3d58b4;});}return null;};}function removeEntity(_0x6777c0){return function(_0x2e9578){if(_0x2e9578){return _0x2e9578[_0xb425('0x28')]()[_0xb425('0x13')](function(){var _0x18ce8e=_0x2e9578['get']({'plain':!![]});var _0x52bb2b='ChatWebsites';return db[_0xb425('0x29')][_0xb425('0x28')]({'where':{'type':_0x52bb2b,'resourceId':_0x18ce8e['id']}})[_0xb425('0x13')](function(){return _0x2e9578;});})[_0xb425('0x13')](function(){_0x6777c0['status'](0xcc)[_0xb425('0x2a')]();});}};}function handleEntityNotFound(_0x5d3876){return function(_0x8f5ce){if(!_0x8f5ce){_0x5d3876[_0xb425('0x1f')](0x194);}return _0x8f5ce;};}function handleError(_0x3f9679,_0x166ac9){_0x166ac9=_0x166ac9||0x1f4;return function(_0xdf85b){logger[_0xb425('0x1a')](_0xdf85b[_0xb425('0x2b')]);if(_0xdf85b[_0xb425('0x2c')]){delete _0xdf85b[_0xb425('0x2c')];}_0x3f9679['status'](_0x166ac9)[_0xb425('0x2d')](_0xdf85b);};}exports[_0xb425('0x2e')]=function(_0xd18626,_0x54ad5f){var _0x315078={'include':[{'model':db[_0xb425('0x2f')],'as':_0xb425('0x30')}]},_0x7a0a2b={},_0x3dadfc={'count':0x0,'rows':[]};var _0x139c6b=_[_0xb425('0x31')](db[_0xb425('0x32')][_0xb425('0x33')],function(_0x439fba){return{'name':_0x439fba['fieldName'],'type':_0x439fba[_0xb425('0x34')]['key']};});_0x7a0a2b['model']=_[_0xb425('0x31')](_0x139c6b,'name');_0x7a0a2b[_0xb425('0x35')]=_[_0xb425('0x36')](_0xd18626[_0xb425('0x35')]);_0x7a0a2b[_0xb425('0x37')]=_['intersection'](_0x7a0a2b[_0xb425('0x38')],_0x7a0a2b['query']);_0x315078['attributes']=_['intersection'](_0x7a0a2b[_0xb425('0x38')],qs[_0xb425('0x39')](_0xd18626[_0xb425('0x35')][_0xb425('0x39')]));_0x315078[_0xb425('0x3a')]=_0x315078[_0xb425('0x3a')][_0xb425('0x3b')]?_0x315078['attributes']:_0x7a0a2b[_0xb425('0x38')];if(!_0xd18626['query']['hasOwnProperty'](_0xb425('0x3c'))){_0x315078['limit']=qs[_0xb425('0x23')](_0xd18626[_0xb425('0x35')][_0xb425('0x23')]);_0x315078[_0xb425('0x21')]=qs[_0xb425('0x21')](_0xd18626['query']['offset']);}_0x315078[_0xb425('0x3d')]=qs['sort'](_0xd18626['query'][_0xb425('0x3e')]);_0x315078['where']=qs[_0xb425('0x37')](_[_0xb425('0x3f')](_0xd18626[_0xb425('0x35')],_0x7a0a2b[_0xb425('0x37')]),_0x139c6b);if(_0xd18626[_0xb425('0x35')][_0xb425('0x40')]){_0x315078[_0xb425('0x41')]=_['merge'](_0x315078['where'],{'$or':_['map'](_0x139c6b,function(_0x2e5a88){if(_0x2e5a88[_0xb425('0x34')]!=='VIRTUAL'){var _0x2502c6={};_0x2502c6[_0x2e5a88['name']]={'$like':'%'+_0xd18626['query'][_0xb425('0x40')]+'%'};return _0x2502c6;}})});}_0x315078=_[_0xb425('0x42')]({},_0x315078,_0xd18626[_0xb425('0x43')]);var _0xd835d0={'where':_0x315078['where']};return db[_0xb425('0x32')]['count'](_0xd835d0)['then'](function(_0x3d6aaf){_0x3dadfc[_0xb425('0x24')]=_0x3d6aaf;if(_0xd18626[_0xb425('0x35')][_0xb425('0x44')]){_0x315078['include']=[{'all':!![]}];}return db[_0xb425('0x32')][_0xb425('0x45')](_0x315078);})[_0xb425('0x13')](function(_0x246370){_0x3dadfc[_0xb425('0x46')]=_0x246370;return _0x3dadfc;})[_0xb425('0x13')](respondWithFilteredResult(_0x54ad5f,_0x315078))['catch'](handleError(_0x54ad5f,null));};exports[_0xb425('0x47')]=function(_0x2e88eb,_0x5c0575){var _0x304129={'raw':![],'where':{'id':_0x2e88eb[_0xb425('0x48')]['id']},'include':[{'model':db['Pause'],'as':_0xb425('0x30')}]},_0x9579={};_0x9579[_0xb425('0x38')]=_[_0xb425('0x36')](db[_0xb425('0x32')][_0xb425('0x33')]);_0x9579['query']=_['keys'](_0x2e88eb[_0xb425('0x35')]);_0x9579['filters']=_[_0xb425('0x49')](_0x9579[_0xb425('0x38')],_0x9579['query']);_0x304129[_0xb425('0x3a')]=_[_0xb425('0x49')](_0x9579[_0xb425('0x38')],qs[_0xb425('0x39')](_0x2e88eb['query'][_0xb425('0x39')]));_0x304129[_0xb425('0x3a')]=_0x304129[_0xb425('0x3a')]['length']?_0x304129[_0xb425('0x3a')]:_0x9579[_0xb425('0x38')];if(_0x2e88eb[_0xb425('0x35')]['includeAll']){_0x304129[_0xb425('0x4a')]=[{'all':!![]}];}_0x304129=_[_0xb425('0x42')]({},_0x304129,_0x2e88eb[_0xb425('0x43')]);return db['ChatWebsite']['find'](_0x304129)[_0xb425('0x13')](handleEntityNotFound(_0x5c0575,null))[_0xb425('0x13')](respondWithResult(_0x5c0575,null))[_0xb425('0x1e')](handleError(_0x5c0575,null));};exports[_0xb425('0x4b')]=function(_0x4c2443,_0x3328be){return db[_0xb425('0x32')][_0xb425('0x4b')](_0x4c2443[_0xb425('0x4c')],{})['then'](function(_0x352885){var _0x533536=_0x4c2443[_0xb425('0x4d')]['get']({'plain':!![]});if(!_0x533536)throw new Error(_0xb425('0x4e'));if(_0x533536[_0xb425('0x4f')]==='user'){var _0x387b15=_0x352885[_0xb425('0x50')]({'plain':!![]});var _0x10818f='ChatWebsites';return db[_0xb425('0x51')]['find']({'where':{'name':_0x10818f,'userProfileId':_0x533536[_0xb425('0x52')]},'raw':!![]})[_0xb425('0x13')](function(_0x27c6de){if(_0x27c6de&&_0x27c6de['autoAssociation']===0x0){return db[_0xb425('0x29')][_0xb425('0x4b')]({'name':_0x387b15[_0xb425('0x2c')],'resourceId':_0x387b15['id'],'type':_0x27c6de[_0xb425('0x2c')],'sectionId':_0x27c6de['id']},{})['then'](function(){return _0x352885;});}else{return _0x352885;}})[_0xb425('0x1e')](function(_0x432cc9){logger[_0xb425('0x1a')](_0xb425('0x53'),_0x432cc9);throw _0x432cc9;});}return _0x352885;})[_0xb425('0x13')](respondWithResult(_0x3328be,0xc9))[_0xb425('0x1e')](handleError(_0x3328be,null));};exports['update']=function(_0x40de51,_0x1d4226){if(_0x40de51[_0xb425('0x4c')]['id']){delete _0x40de51[_0xb425('0x4c')]['id'];}return db['ChatWebsite'][_0xb425('0x54')]({'where':{'id':_0x40de51['params']['id']},'include':[{'model':db[_0xb425('0x2f')],'as':'mandatoryDispositionPause'}]})[_0xb425('0x13')](handleEntityNotFound(_0x1d4226,null))[_0xb425('0x13')](saveUpdates(_0x40de51[_0xb425('0x4c')],null))[_0xb425('0x13')](respondWithResult(_0x1d4226,null))[_0xb425('0x1e')](handleError(_0x1d4226,null));};exports[_0xb425('0x28')]=function(_0x139bd2,_0x799d39){return db[_0xb425('0x32')][_0xb425('0x54')]({'where':{'id':_0x139bd2[_0xb425('0x48')]['id']}})[_0xb425('0x13')](handleEntityNotFound(_0x799d39,null))[_0xb425('0x13')](removeEntity(_0x799d39,null))[_0xb425('0x1e')](handleError(_0x799d39,null));};exports[_0xb425('0x55')]=function(_0x13661d,_0x3532d9){return db[_0xb425('0x32')][_0xb425('0x55')]()[_0xb425('0x13')](respondWithResult(_0x3532d9,null))[_0xb425('0x1e')](handleError(_0x3532d9,null));};exports['addDisposition']=function(_0x5c0fcc,_0x154444){if(_0x5c0fcc['body']['id']){delete _0x5c0fcc['body']['id'];}return db[_0xb425('0x32')]['find']({'where':{'id':_0x5c0fcc[_0xb425('0x48')]['id']}})[_0xb425('0x13')](handleEntityNotFound(_0x154444,null))[_0xb425('0x13')](function(_0x311946){if(_0x311946){_0x5c0fcc['body'][_0xb425('0x56')]=_0x311946['id'];return db[_0xb425('0x57')][_0xb425('0x4b')](_0x5c0fcc[_0xb425('0x4c')]);}})[_0xb425('0x13')](respondWithResult(_0x154444,null))[_0xb425('0x1e')](handleError(_0x154444,null));};exports['getDispositions']=function(_0x566113,_0x241460){var _0x572152={'raw':![],'where':{}};var _0x12b788={};var _0x5c86d2={'count':0x0,'rows':[]};return db[_0xb425('0x32')][_0xb425('0x58')]({'where':{'id':_0x566113['params']['id']}})[_0xb425('0x13')](handleEntityNotFound(_0x241460,null))[_0xb425('0x13')](function(_0x30cad0){if(_0x30cad0){_0x12b788[_0xb425('0x38')]=_[_0xb425('0x36')](db[_0xb425('0x57')][_0xb425('0x33')]);_0x12b788[_0xb425('0x35')]=_[_0xb425('0x36')](_0x566113[_0xb425('0x35')]);_0x12b788['filters']=_['intersection'](_0x12b788[_0xb425('0x38')],_0x12b788[_0xb425('0x35')]);_0x572152[_0xb425('0x3a')]=_['intersection'](_0x12b788[_0xb425('0x38')],qs[_0xb425('0x39')](_0x566113[_0xb425('0x35')][_0xb425('0x39')]));_0x572152[_0xb425('0x3a')]=_0x572152['attributes'][_0xb425('0x3b')]?_0x572152[_0xb425('0x3a')]:_0x12b788[_0xb425('0x38')];if(!_0x566113[_0xb425('0x35')]['hasOwnProperty'](_0xb425('0x3c'))){_0x572152[_0xb425('0x23')]=qs[_0xb425('0x23')](_0x566113[_0xb425('0x35')][_0xb425('0x23')]);_0x572152[_0xb425('0x21')]=qs[_0xb425('0x21')](_0x566113[_0xb425('0x35')][_0xb425('0x21')]);}_0x572152[_0xb425('0x3d')]=qs[_0xb425('0x3e')](_0x566113[_0xb425('0x35')][_0xb425('0x3e')]);_0x572152[_0xb425('0x41')]=qs[_0xb425('0x37')](_[_0xb425('0x3f')](_0x566113[_0xb425('0x35')],_0x12b788[_0xb425('0x37')]));_0x572152[_0xb425('0x41')]['ChatWebsiteId']=_0x30cad0['id'];if(_0x566113[_0xb425('0x35')]['filter']){_0x572152[_0xb425('0x41')]=_['merge'](_0x572152['where'],{'$or':_[_0xb425('0x31')](_0x572152['attributes'],function(_0x15cb50){var _0x4e9175={};_0x4e9175[_0x15cb50]={'$like':'%'+_0x566113[_0xb425('0x35')]['filter']+'%'};return _0x4e9175;})});}_0x572152=_[_0xb425('0x42')]({},_0x572152,_0x566113[_0xb425('0x43')]);return db[_0xb425('0x57')][_0xb425('0x24')]({'where':_0x572152[_0xb425('0x41')]})[_0xb425('0x13')](function(_0x4329bb){_0x5c86d2[_0xb425('0x24')]=_0x4329bb;if(_0x566113['query'][_0xb425('0x44')]){_0x572152[_0xb425('0x4a')]=[{'all':!![]}];}return db['Disposition'][_0xb425('0x45')](_0x572152);})[_0xb425('0x13')](function(_0x74aafe){_0x5c86d2[_0xb425('0x46')]=_0x74aafe;return _0x5c86d2;});}})['then'](respondWithFilteredResult(_0x241460,_0x572152))['catch'](handleError(_0x241460,null));};exports[_0xb425('0x59')]=function(_0x368b9a,_0x240350){return db[_0xb425('0x32')]['find']({'where':{'id':_0x368b9a['params']['id']}})['then'](handleEntityNotFound(_0x240350,null))[_0xb425('0x13')](function(_0x45aecc){if(_0x45aecc){return _0x45aecc[_0xb425('0x59')](_0x368b9a[_0xb425('0x35')]['ids']);}})['then'](respondWithStatusCode(_0x240350,null))[_0xb425('0x1e')](handleError(_0x240350,null));};exports[_0xb425('0x5a')]=function(_0x1087b2,_0x22d0aa){if(_0x1087b2[_0xb425('0x4c')]['id']){delete _0x1087b2[_0xb425('0x4c')]['id'];}return db[_0xb425('0x32')][_0xb425('0x54')]({'where':{'id':_0x1087b2[_0xb425('0x48')]['id']}})[_0xb425('0x13')](handleEntityNotFound(_0x22d0aa,null))[_0xb425('0x13')](function(_0x765474){if(_0x765474){_0x1087b2['body'][_0xb425('0x56')]=_0x765474['id'];return db[_0xb425('0x5b')][_0xb425('0x4b')](_0x1087b2[_0xb425('0x4c')]);}})[_0xb425('0x13')](respondWithResult(_0x22d0aa,null))[_0xb425('0x1e')](handleError(_0x22d0aa,null));};exports[_0xb425('0x5c')]=function(_0x7ea25e,_0x34d0e9){var _0x1b37af={'raw':![],'where':{}};var _0x5313c1={};var _0x3ecf32={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xb425('0x58')]({'where':{'id':_0x7ea25e[_0xb425('0x48')]['id']}})[_0xb425('0x13')](handleEntityNotFound(_0x34d0e9,null))[_0xb425('0x13')](function(_0x41c65c){if(_0x41c65c){_0x5313c1[_0xb425('0x38')]=_[_0xb425('0x36')](db[_0xb425('0x5b')][_0xb425('0x33')]);_0x5313c1[_0xb425('0x35')]=_['keys'](_0x7ea25e[_0xb425('0x35')]);_0x5313c1[_0xb425('0x37')]=_[_0xb425('0x49')](_0x5313c1[_0xb425('0x38')],_0x5313c1[_0xb425('0x35')]);_0x1b37af[_0xb425('0x3a')]=_['intersection'](_0x5313c1[_0xb425('0x38')],qs[_0xb425('0x39')](_0x7ea25e['query'][_0xb425('0x39')]));_0x1b37af[_0xb425('0x3a')]=_0x1b37af[_0xb425('0x3a')][_0xb425('0x3b')]?_0x1b37af[_0xb425('0x3a')]:_0x5313c1[_0xb425('0x38')];if(!_0x7ea25e['query']['hasOwnProperty']('nolimit')){_0x1b37af['limit']=qs[_0xb425('0x23')](_0x7ea25e['query']['limit']);_0x1b37af[_0xb425('0x21')]=qs[_0xb425('0x21')](_0x7ea25e['query'][_0xb425('0x21')]);}_0x1b37af[_0xb425('0x3d')]=qs[_0xb425('0x3e')](_0x7ea25e[_0xb425('0x35')][_0xb425('0x3e')]);_0x1b37af[_0xb425('0x41')]=qs[_0xb425('0x37')](_[_0xb425('0x3f')](_0x7ea25e['query'],_0x5313c1[_0xb425('0x37')]));_0x1b37af[_0xb425('0x41')][_0xb425('0x56')]=_0x41c65c['id'];if(_0x7ea25e[_0xb425('0x35')]['filter']){_0x1b37af[_0xb425('0x41')]=_[_0xb425('0x42')](_0x1b37af[_0xb425('0x41')],{'$or':_[_0xb425('0x31')](_0x1b37af[_0xb425('0x3a')],function(_0x27a2c5){var _0x1e4a87={};_0x1e4a87[_0x27a2c5]={'$like':'%'+_0x7ea25e['query'][_0xb425('0x40')]+'%'};return _0x1e4a87;})});}_0x1b37af=_['merge']({},_0x1b37af,_0x7ea25e[_0xb425('0x43')]);return db[_0xb425('0x5b')]['count']({'where':_0x1b37af[_0xb425('0x41')]})[_0xb425('0x13')](function(_0x5a88d0){_0x3ecf32[_0xb425('0x24')]=_0x5a88d0;if(_0x7ea25e[_0xb425('0x35')][_0xb425('0x44')]){_0x1b37af[_0xb425('0x4a')]=[{'all':!![]}];}return db['CannedAnswer'][_0xb425('0x45')](_0x1b37af);})['then'](function(_0x4dae0e){_0x3ecf32[_0xb425('0x46')]=_0x4dae0e;return _0x3ecf32;});}})[_0xb425('0x13')](respondWithFilteredResult(_0x34d0e9,_0x1b37af))[_0xb425('0x1e')](handleError(_0x34d0e9,null));};exports[_0xb425('0x5d')]=function(_0x1d9a9c,_0x46de7e){return db['ChatWebsite'][_0xb425('0x54')]({'where':{'id':_0x1d9a9c[_0xb425('0x48')]['id']}})[_0xb425('0x13')](handleEntityNotFound(_0x46de7e,null))[_0xb425('0x13')](function(_0x4b51bb){if(_0x4b51bb){return _0x4b51bb[_0xb425('0x5d')](_0x1d9a9c['query'][_0xb425('0x5e')]);}})[_0xb425('0x13')](respondWithStatusCode(_0x46de7e,null))[_0xb425('0x1e')](handleError(_0x46de7e,null));};exports[_0xb425('0x5f')]=function(_0x5a88d4,_0x9893e3){_0x5a88d4[_0xb425('0x4c')]['sitepic']=_0x5a88d4[_0xb425('0x60')][_0xb425('0x61')];return db[_0xb425('0x32')][_0xb425('0x54')]({'where':{'id':_0x5a88d4[_0xb425('0x48')]['id']}})['then'](handleEntityNotFound(_0x9893e3,null))[_0xb425('0x13')](saveUpdates(_0x5a88d4[_0xb425('0x4c')],null))[_0xb425('0x13')](respondWithResult(_0x9893e3,null))[_0xb425('0x1e')](handleError(_0x9893e3,null));};exports[_0xb425('0x62')]=function(_0x4f5e52,_0x481cd9){_0x4f5e52[_0xb425('0x4c')][_0xb425('0x63')]=_0x4f5e52[_0xb425('0x60')][_0xb425('0x61')];return db[_0xb425('0x32')][_0xb425('0x54')]({'where':{'id':_0x4f5e52[_0xb425('0x48')]['id']}})[_0xb425('0x13')](handleEntityNotFound(_0x481cd9,null))[_0xb425('0x13')](saveUpdates(_0x4f5e52[_0xb425('0x4c')],null))['then'](respondWithResult(_0x481cd9,null))['catch'](handleError(_0x481cd9,null));};exports['addCustomerAvatar']=function(_0x5d741a,_0xfaa3bb){_0x5d741a['body'][_0xb425('0x64')]=_0x5d741a[_0xb425('0x60')]['filename'];return db['ChatWebsite'][_0xb425('0x54')]({'where':{'id':_0x5d741a[_0xb425('0x48')]['id']}})['then'](handleEntityNotFound(_0xfaa3bb,null))['then'](saveUpdates(_0x5d741a[_0xb425('0x4c')],null))[_0xb425('0x13')](respondWithResult(_0xfaa3bb,null))[_0xb425('0x1e')](handleError(_0xfaa3bb,null));};exports['addSystemAvatar']=function(_0x245a02,_0x36cde2){_0x245a02[_0xb425('0x4c')]['systemAvatar']=_0x245a02[_0xb425('0x60')]['filename'];return db[_0xb425('0x32')][_0xb425('0x54')]({'where':{'id':_0x245a02['params']['id']}})[_0xb425('0x13')](handleEntityNotFound(_0x36cde2,null))[_0xb425('0x13')](saveUpdates(_0x245a02[_0xb425('0x4c')],null))[_0xb425('0x13')](respondWithResult(_0x36cde2,null))[_0xb425('0x1e')](handleError(_0x36cde2,null));};exports[_0xb425('0x65')]=function(_0x226892,_0x2f2515){var _0x466605=path[_0xb425('0x66')](config['root'],_0xb425('0x67'));var _0x20ff51={'where':{'id':_0x226892[_0xb425('0x48')]['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x44028c=![];return require(_0xb425('0x68'))[_0xb425('0x69')]()[_0xb425('0x13')](function(_0x58ef39){if(_0x58ef39){_0x44028c=_0x58ef39[_0xb425('0x6a')];}})['then'](function(){return db[_0xb425('0x32')]['find'](_0x20ff51);})[_0xb425('0x13')](handleEntityNotFound(_0x2f2515,null))[_0xb425('0x13')](function(_0x21d887){if(_0x21d887){if(!_['isNil'](_0x21d887['sitepic'])){if(fs[_0xb425('0x6b')](path[_0xb425('0x66')](config[_0xb425('0x6c')],_0xb425('0x6d'),_0x21d887[_0xb425('0x6e')]))&&_0x44028c){_0x466605=path[_0xb425('0x66')](config[_0xb425('0x6c')],_0xb425('0x6d'),_0x21d887[_0xb425('0x6e')]);}}return _0x2f2515[_0xb425('0x6f')](_0x466605);}})[_0xb425('0x1e')](handleError(_0x2f2515,null));};exports['getAvatar']=function(_0x17659e,_0x3ea6c6){var _0x5a5607=path['join'](config[_0xb425('0x6c')],_0xb425('0x70'));var _0x1876cf={'where':{'id':_0x17659e['params']['id']},'attributes':['id',_0xb425('0x63')],'raw':!![]};return db['ChatWebsite'][_0xb425('0x54')](_0x1876cf)[_0xb425('0x13')](handleEntityNotFound(_0x3ea6c6,null))[_0xb425('0x13')](function(_0x4e933a){if(_0x4e933a){if(!_[_0xb425('0x71')](_0x4e933a[_0xb425('0x63')])){if(fs[_0xb425('0x6b')](path[_0xb425('0x66')](config[_0xb425('0x6c')],_0xb425('0x72'),_0x4e933a[_0xb425('0x63')]))){_0x5a5607=path['join'](config[_0xb425('0x6c')],_0xb425('0x72'),_0x4e933a[_0xb425('0x63')]);}}return _0x3ea6c6[_0xb425('0x6f')](_0x5a5607);}})[_0xb425('0x1e')](handleError(_0x3ea6c6,null));};exports['getCustomerAvatar']=function(_0x390f13,_0x3b7123){var _0x2e8899=path['join'](config[_0xb425('0x6c')],_0xb425('0x73'));var _0x421b0d={'where':{'id':_0x390f13['params']['id']},'attributes':['id',_0xb425('0x64'),'showCustomerAvatar'],'raw':!![]};return db[_0xb425('0x32')]['find'](_0x421b0d)['then'](handleEntityNotFound(_0x3b7123,null))['then'](function(_0x295fcc){if(_0x295fcc){if(!_[_0xb425('0x71')](_0x295fcc[_0xb425('0x64')])){if(fs[_0xb425('0x6b')](path[_0xb425('0x66')](config[_0xb425('0x6c')],_0xb425('0x72'),_0x295fcc[_0xb425('0x64')]))&&_0x295fcc[_0xb425('0x74')]){_0x2e8899=path[_0xb425('0x66')](config['root'],_0xb425('0x72'),_0x295fcc[_0xb425('0x64')]);}}return _0x3b7123[_0xb425('0x6f')](_0x2e8899);}})[_0xb425('0x1e')](handleError(_0x3b7123,null));};exports['getSystemAvatar']=function(_0x9295ca,_0x54eacc){var _0x113b90=path[_0xb425('0x66')](config[_0xb425('0x6c')],_0xb425('0x75'));var _0x4a37ad={'where':{'id':_0x9295ca['params']['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0xb425('0x32')][_0xb425('0x54')](_0x4a37ad)[_0xb425('0x13')](handleEntityNotFound(_0x54eacc,null))['then'](function(_0x612912){if(_0x612912){if(!_[_0xb425('0x71')](_0x612912[_0xb425('0x76')])){if(fs[_0xb425('0x6b')](path[_0xb425('0x66')](config[_0xb425('0x6c')],_0xb425('0x72'),_0x612912[_0xb425('0x76')]))){_0x113b90=path[_0xb425('0x66')](config[_0xb425('0x6c')],_0xb425('0x72'),_0x612912['systemAvatar']);}}return _0x54eacc['download'](_0x113b90);}})['catch'](handleError(_0x54eacc,null));};exports['notify']=function(_0x3fe7ce,_0x556e32){var _0x90bc29=require(_0xb425('0x77'));var _0x5695c7=new _0x90bc29();var _0x547928=_0x5695c7[_0xb425('0x78')](_0x3fe7ce[_0xb425('0x79')][_0xb425('0x7a')])[_0xb425('0x7b')]();var _0x2cf1e2={'body':_0x3fe7ce[_0xb425('0x4c')],'channel':_0xb425('0x7c')};var _0x248884=[];var _0xbc92ff=[];var _0x1c1649={};var _0x3ed658=![];return db[_0xb425('0x7d')]['describe']()['then'](function(_0x1dc3f9){if(!_0x1dc3f9){throw new db[(_0xb425('0x7e'))][(_0xb425('0x7f'))]('no\x20available\x20attributes');}_0x248884=_['difference'](_['keys'](_0x1dc3f9),['createdAt',_0xb425('0x80')]);_0xbc92ff=_[_0xb425('0x81')](_[_0xb425('0x36')](_0x1dc3f9),[_0xb425('0x82'),'updatedAt',_0xb425('0x83'),_0xb425('0x84')]);if(_0x3fe7ce[_0xb425('0x4c')]['id']){delete _0x3fe7ce[_0xb425('0x4c')]['id'];}if(_['isNil'](_0x3fe7ce[_0xb425('0x4c')][_0xb425('0x85')])){throw new db['Sequelize']['ValidationError'](_0xb425('0x86'));}if(_[_0xb425('0x71')](_0x3fe7ce[_0xb425('0x4c')][_0xb425('0x4c')])||_0x3fe7ce[_0xb425('0x4c')][_0xb425('0x4c')]===''){throw new db[(_0xb425('0x7e'))]['ValidationError'](_0xb425('0x87'));}if(_[_0xb425('0x71')](_0x3fe7ce[_0xb425('0x4c')][_0xb425('0x88')])){throw new db[(_0xb425('0x7e'))][(_0xb425('0x7f'))](_0xb425('0x89')+_0xbc92ff);}if(!_[_0xb425('0x8a')](_0xbc92ff,_0x3fe7ce['body'][_0xb425('0x88')])){throw new db[(_0xb425('0x7e'))][(_0xb425('0x7f'))](_0xb425('0x8b')+_0xbc92ff);}_0x1c1649[_0x3fe7ce[_0xb425('0x4c')][_0xb425('0x88')]]=_0x3fe7ce[_0xb425('0x4c')][_0xb425('0x85')];})[_0xb425('0x13')](function(){return db['ChatWebsite'][_0xb425('0x54')]({'where':{'id':_0x3fe7ce[_0xb425('0x48')]['id']},'include':[{'model':db[_0xb425('0x8c')],'as':_0xb425('0x8d'),'include':[{'model':db['CmContact'],'as':_0xb425('0x8e'),'where':_0x1c1649,'limit':0x1,'order':[[_0xb425('0x80'),'DESC']]}]},{'model':db[_0xb425('0x8f')],'as':_0xb425('0x90')}]});})[_0xb425('0x13')](handleEntityNotFound(_0x556e32,null))[_0xb425('0x13')](function(_0xc36932){if(_0xc36932&&_0xc36932['List']){_0x2cf1e2['account']=_0xc36932;_0x2cf1e2[_0xb425('0x91')]=_0xc36932[_0xb425('0x90')];_0x2cf1e2[_0xb425('0x92')]=_0xc36932[_0xb425('0x8d')];_0x2cf1e2[_0xb425('0x91')]=_[_0xb425('0x93')](_0x2cf1e2[_0xb425('0x91')],['priority'],['asc']);if(_0x2cf1e2['account']['Applications']){delete _0x2cf1e2['account'][_0xb425('0x90')];}if(_0x2cf1e2['account'][_0xb425('0x8d')]&&_0x2cf1e2[_0xb425('0x94')][_0xb425('0x8d')][_0xb425('0x8e')][_0xb425('0x3b')]){return _0x2cf1e2[_0xb425('0x94')][_0xb425('0x8d')]['Contacts'][0x0];}var _0x2080c5=_[_0xb425('0xa')](_0x3fe7ce[_0xb425('0x4c')],{'firstName':_0x3fe7ce[_0xb425('0x4c')][_0xb425('0x85')],'ListId':_0xc36932[_0xb425('0x84')]});_0x2080c5[_0x3fe7ce[_0xb425('0x4c')][_0xb425('0x88')]]=_0x3fe7ce[_0xb425('0x4c')][_0xb425('0x85')];return db[_0xb425('0x7d')][_0xb425('0x4b')](_0x2080c5,{'fields':_0x248884,'raw':!![]});}})['then'](handleEntityNotFound(_0x556e32,null))[_0xb425('0x13')](function(_0x55c5fd){_0x2cf1e2[_0xb425('0x95')]=_0x55c5fd;var _0x59a6c0=_0x3fe7ce[_0xb425('0x4c')][_0xb425('0x96')];if(_0x3fe7ce[_0xb425('0x79')][_0xb425('0x97')]){_0x59a6c0=_0x3fe7ce[_0xb425('0x79')][_0xb425('0x97')];}else if(_0x3fe7ce['headers']['x-forwarded-for']){_0x59a6c0=_[_0xb425('0x98')](_0x3fe7ce[_0xb425('0x79')][_0xb425('0x99')][_0xb425('0x9a')](','));}if(_0x55c5fd){var _0x3f1a66={'ContactId':_0x55c5fd['id'],'ChatWebsiteId':_0x3fe7ce[_0xb425('0x48')]['id'],'from':(_0x55c5fd[_0xb425('0x9b')]||'')+'\x20'+(_0x55c5fd[_0xb425('0x9c')]||''),'customerIp':_0x59a6c0,'customerPort':_0x3fe7ce[_0xb425('0x79')][_0xb425('0x9d')]?_0x3fe7ce[_0xb425('0x79')][_0xb425('0x9d')]:null,'referer':_0x3fe7ce['body'][_0xb425('0x9e')],'browserName':_0x547928[_0xb425('0x9f')][_0xb425('0x2c')]&&_0x547928[_0xb425('0x9f')][_0xb425('0xa0')]?util[_0xb425('0xa1')]('%s\x20%s',_0x547928['browser'][_0xb425('0x2c')],_0x547928[_0xb425('0x9f')][_0xb425('0xa0')]):_0xb425('0xa2'),'browserVersion':_0x547928['browser'][_0xb425('0xa0')]||_0xb425('0xa2'),'osName':util[_0xb425('0xa1')](_0xb425('0xa3'),_0x547928['os'][_0xb425('0x2c')],_0x547928['os'][_0xb425('0xa0')]),'osVersion':_0x547928['os'][_0xb425('0xa0')],'deviceModel':_0x547928[_0xb425('0xa4')][_0xb425('0x38')]&&_0x547928[_0xb425('0xa4')]['vendor']?util[_0xb425('0xa1')](_0xb425('0xa5'),_0x547928[_0xb425('0xa4')][_0xb425('0x38')],_0x547928['device'][_0xb425('0xa6')],_0x547928[_0xb425('0xa4')]['type']):null,'deviceVendor':_0x547928[_0xb425('0xa4')][_0xb425('0xa6')],'deviceType':_0x547928[_0xb425('0xa4')][_0xb425('0x34')],'formData':JSON[_0xb425('0x19')](_0x3fe7ce['body'])};var _0x152bb4={'ChatWebsiteId':_0x3fe7ce[_0xb425('0x48')]['id'],'closed':![]};if(_0x3fe7ce[_0xb425('0x4c')][_0xb425('0xa7')]){_0x152bb4[_0xb425('0xa7')]=_0x3fe7ce[_0xb425('0x4c')][_0xb425('0xa7')];return db['ChatInteraction'][_0xb425('0x54')]({'where':_0x152bb4})[_0xb425('0x13')](function(_0x34e9ce){if(_0x34e9ce){return[_0x34e9ce,![]];}_0x3f1a66[_0xb425('0xa7')]=_0x3fe7ce[_0xb425('0x4c')][_0xb425('0xa7')];_0x3f1a66[_0xb425('0xa8')]=_0x3fe7ce[_0xb425('0x4c')][_0xb425('0xa8')];return db[_0xb425('0xa9')][_0xb425('0x4b')](_0x3f1a66)[_0xb425('0x13')](function(_0x1cc010){return[_0x1cc010,!![]];});});}_0x152bb4[_0xb425('0xaa')]=_0x55c5fd['id'];if(_0x3fe7ce[_0xb425('0x4c')][_0xb425('0xab')]&&_0x3fe7ce['body'][_0xb425('0xab')]['id']){_0x152bb4['id']=_0x3fe7ce['body'][_0xb425('0xab')]['id'];return db[_0xb425('0xa9')][_0xb425('0x54')]({'where':_0x152bb4})[_0xb425('0x13')](function(_0x5f1a23){if(_0x5f1a23){return[_0x5f1a23,![]];}return db['ChatInteraction'][_0xb425('0x4b')](_0x3f1a66)[_0xb425('0x13')](function(_0x6c3ccd){return[_0x6c3ccd,!![]];});});}return db[_0xb425('0xa9')][_0xb425('0x4b')](_0x3f1a66)[_0xb425('0x13')](function(_0x13be6d){return[_0x13be6d,!![]];});}})[_0xb425('0xac')](function(_0x53247b,_0x7c1ad5){if(_0x53247b){_0x3ed658=_0x7c1ad5;if(!_0x7c1ad5){var _0x2c4a3f={'from':(_0x2cf1e2[_0xb425('0x95')][_0xb425('0x9b')]||'')+'\x20'+(_0x2cf1e2[_0xb425('0x95')][_0xb425('0x9c')]||'')};if(_0x3fe7ce[_0xb425('0x4c')][_0xb425('0xa7')]&&_0x3fe7ce[_0xb425('0x4c')]['messageId']&&_0x3fe7ce[_0xb425('0x4c')]['threadId']!=_0x3fe7ce[_0xb425('0x4c')]['messageId']){_0x2c4a3f[_0xb425('0xa7')]=_0x3fe7ce[_0xb425('0x4c')]['messageId'];}return _0x53247b[_0xb425('0xad')](_0x2c4a3f);}else{return _0x53247b;}}})[_0xb425('0x13')](function(_0x290e18){_0x2cf1e2[_0xb425('0xab')]=_0x290e18[_0xb425('0x50')]({'plain':!![]});_0x2cf1e2[_0xb425('0xab')][_0xb425('0xae')]=_0x3ed658;if(_0x2cf1e2['interaction'][_0xb425('0xae')]){if(_0x2cf1e2['account']['autoclose']){_0x2cf1e2['applications']['push']({'id':0x0,'priority':_0x2cf1e2[_0xb425('0x91')][_0xb425('0x3b')]+0x1,'app':'close','appdata':_0xb425('0xaf'),'interval':_0xb425('0xb0')});}}return db['ChatMessage'][_0xb425('0x4b')]({'body':_0x3fe7ce[_0xb425('0x4c')]['body'],'ChatWebsiteId':_0x3fe7ce[_0xb425('0x48')]['id'],'ChatInteractionId':_0x290e18['id'],'direction':'in','ContactId':_0x2cf1e2[_0xb425('0x95')]['id'],'AttachmentId':_0x3fe7ce[_0xb425('0x4c')][_0xb425('0xb1')]});})[_0xb425('0x13')](function(_0x4044ff){_0x2cf1e2['message']=_0x4044ff;if(_0x2cf1e2[_0xb425('0xab')]['UserId']){return db[_0xb425('0xb2')][_0xb425('0x54')]({'attributes':['id',_0xb425('0x2c')],'where':{'id':_0x2cf1e2[_0xb425('0xab')]['UserId']}})[_0xb425('0x13')](function(_0x5549be){if(_0x5549be){_0x2cf1e2[_0xb425('0x91')][_0xb425('0xb3')]({'id':0x0,'priority':0x0,'app':_0xb425('0xb4'),'appdata':_0x5549be[_0xb425('0x2c')]+','+(_0x2cf1e2[_0xb425('0x94')]['waitForTheAssignedAgent']||0xa),'interval':_0xb425('0xb0')});_0x2cf1e2[_0xb425('0xb5')]=!![];}return respondWithRpcPromise(_0xb425('0xb6'),_0xb425('0xb7'),_0x2cf1e2);});}return respondWithRpcPromise(_0xb425('0xb6'),'startRouting',_0x2cf1e2);})[_0xb425('0x13')](function(_0x67b0e6){respondWithRpcPromise(_0xb425('0xb8'),_0xb425('0xb8'),{'event':'notify','message':_0x67b0e6},client9002);return _0x67b0e6;})[_0xb425('0x13')](respondWithResult(_0x556e32,null))[_0xb425('0x1e')](handleError(_0x556e32,null));};exports['offline']=function(_0x14c951,_0x384903){var _0x19b5be,_0x5ea4d4,_0x23a9fc;var _0x5888ea=[];var _0x5356ad={};var _0x57fe59=_0x14c951[_0xb425('0xb9')]||[];var _0x136559=[];var _0x432094;return db[_0xb425('0x7d')][_0xb425('0x55')]()[_0xb425('0x13')](function(_0x1099b0){if(!_0x1099b0){throw new db[(_0xb425('0x7e'))][(_0xb425('0x7f'))](_0xb425('0xba'));}_0x5888ea=_[_0xb425('0x81')](_[_0xb425('0x36')](_0x1099b0),['createdAt','updatedAt',_0xb425('0x83'),'ListId']);if(_0x14c951[_0xb425('0x4c')]['id']){delete _0x14c951[_0xb425('0x4c')]['id'];}if(_[_0xb425('0x71')](_0x14c951[_0xb425('0x4c')][_0xb425('0x85')])){throw _0x384903[_0xb425('0x20')](0x1f4)[_0xb425('0x2d')](new db['Sequelize'][(_0xb425('0x7f'))](_0xb425('0x86')));}if(_[_0xb425('0x71')](_0x14c951['body'][_0xb425('0x4c')])||_0x14c951['body']['body']===''){throw _0x384903[_0xb425('0x20')](0x1f4)[_0xb425('0x2d')](new db['Sequelize']['ValidationError'](_0xb425('0x87')));}if(_['isNil'](_0x14c951[_0xb425('0x4c')][_0xb425('0xbb')])){throw _0x384903['status'](0x1f4)[_0xb425('0x2d')](new db['Sequelize'][(_0xb425('0x7f'))](_0xb425('0xbc')+_0x5888ea));}if(!_[_0xb425('0x8a')](_0x5888ea,_0x14c951['body']['mapKeyOffline'])){throw _0x384903['status'](0x1f4)[_0xb425('0x2d')](new db[(_0xb425('0x7e'))]['ValidationError']('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x5888ea));}_0x5356ad[_0x14c951['body']['mapKeyOffline']]=_0x14c951['body'][_0xb425('0x85')];})[_0xb425('0x13')](function(){return db[_0xb425('0x32')]['find']({'where':{'id':_0x14c951[_0xb425('0x48')]['id']},'include':[{'model':db[_0xb425('0x8c')],'as':_0xb425('0x8d')},{'model':db[_0xb425('0xbd')],'as':_0xb425('0xbd')}]});})[_0xb425('0x13')](handleEntityNotFound(_0x384903,null))[_0xb425('0x13')](function(_0x2d5955){if(_0x2d5955&&_0x2d5955[_0xb425('0x8d')]){_0x5ea4d4=_0x2d5955;var _0x3391c7=_[_0xb425('0xa')](_0x14c951[_0xb425('0x4c')],{'firstName':_0x14c951['body'][_0xb425('0x85')],'phone':_0x14c951['body'][_0xb425('0x85')],'ListId':_0x2d5955['ListId']});_0x3391c7[_0x14c951[_0xb425('0x4c')][_0xb425('0xbb')]]=_0x14c951[_0xb425('0x4c')][_0xb425('0x85')];return db[_0xb425('0x7d')][_0xb425('0xbe')]({'where':_0x5356ad,'defaults':_0x3391c7});}})[_0xb425('0xac')](function(_0x17a707){if(_0x17a707){_0x23a9fc=_0x17a707;var _0x4150a5=fs[_0xb425('0xbf')](path[_0xb425('0x66')](config[_0xb425('0x6c')],'server/files/templates/chatOfflineMessage.ejs'),_0xb425('0xc0'));var _0x393699=ejs['render'](_0x4150a5,{'body':_[_0xb425('0xc1')](_0x14c951['body'][_0xb425('0x4c')]),'bodyTitle':_0x5ea4d4[_0xb425('0xc2')]});return db[_0xb425('0xc3')][_0xb425('0x4b')]({'body':_0x393699,'plainBody':htmlToText[_0xb425('0xc4')](_0x393699),'ContactId':_0x17a707['id'],'ChatWebsiteId':_0x5ea4d4['id']});}})[_0xb425('0x13')](function(_0x493dae){_0x432094=_0x493dae;if(_0x57fe59['length']){var _0x2296f0=_0x57fe59[_0xb425('0x31')](function(_0x32b4af){return{'name':_0x32b4af[_0xb425('0xc5')],'basename':_0x32b4af[_0xb425('0x61')],'type':_0x32b4af[_0xb425('0xc6')],'ChatOfflineMessageId':_0x493dae['id']};});_0x136559=_0x2296f0[_0xb425('0x31')](_0x36bad9=>{var _0x42b475={'filename':_0x36bad9[_0xb425('0x2c')],'path':path[_0xb425('0x66')](config[_0xb425('0x6c')],_0xb425('0xc7'),_0xb425('0xb9'),_0xb425('0xc8'),_0xb425('0xc9'),_0x36bad9[_0xb425('0xca')])};return _0x42b475;});if(!_0x5ea4d4[_0xb425('0xcb')]){return db[_0xb425('0xcc')][_0xb425('0xcd')](function(_0x6c2b59){return db[_0xb425('0xce')][_0xb425('0xcf')](_0x2296f0,{'transaction':_0x6c2b59});});}}})[_0xb425('0x13')](function(){if(_0x432094){_0x19b5be=_0x432094;return db[_0xb425('0xbd')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0xb425('0xd0')],'as':_0xb425('0xd1'),'raw':!![],'include':[{'model':db[_0xb425('0xd2')],'as':_0xb425('0xd2'),'raw':!![]}]}]});}})[_0xb425('0x13')](function(_0x5eed23){if(_0x5eed23&&_0x5eed23['Smtp']&&_0x5ea4d4[_0xb425('0xd3')]&&_0x5ea4d4['forwardOfflineAddress']){var _0x415e2f=_0x5eed23['getSmtpOptions']();return respondWithRpcPromise(_0xb425('0xd4'),'sendMail',{'account':_0x415e2f,'message':{'from':util[_0xb425('0xa1')]('\x22%s\x22\x20<%s>',_0x5eed23[_0xb425('0x2c')],_0x5eed23[_0xb425('0xd5')]||_0x5eed23[_0xb425('0xd1')][_0xb425('0x4d')]),'to':_0x5ea4d4[_0xb425('0xd6')],'subject':_0x5ea4d4[_0xb425('0xd7')],'html':_0x19b5be[_0xb425('0x4c')],'attachments':_0x136559}},client9003)[_0xb425('0x13')](function(){return _0x19b5be;})['catch'](function(_0x5ce87d){logger[_0xb425('0x1a')](_0x5ce87d);});}})[_0xb425('0x13')](function(){if(_0x5ea4d4&&_0x5ea4d4['openNewInteraction']&&_0x5ea4d4[_0xb425('0xd8')]){var _0x29fc55=[];if(_0x57fe59[_0xb425('0x3b')]){_0x29fc55=_0x57fe59[_0xb425('0x31')](function(_0x21db27){return{'name':_0x21db27[_0xb425('0xc5')],'basename':_0x21db27[_0xb425('0x61')],'type':_0x21db27[_0xb425('0xc6')],'ChatOfflineMessageId':_0x432094['id']};});}var _0x1f7830;if(!_[_0xb425('0x71')](_0x5ea4d4[_0xb425('0xd9')])){var _0x1194bc=_[_0xb425('0x31')](_0x14c951['body'],function(_0x5e7bac){return _0x5e7bac;});var _0x18dc91=_['toPairsIn'](_0x1194bc)[0x0];var _0x40ce7b=_['mapValues'](_0x18dc91,function(_0x440089){return _0x440089;});_0x1f7830=_0x40ce7b[0x1][_0x5ea4d4['subjectOffline']];}var _0xe81d18={'from':_0x23a9fc[_0xb425('0xd5')],'firstName':_0x23a9fc[_0xb425('0x9b')],'lastName':_0x23a9fc[_0xb425('0x9c')],'mapKey':'email','message':{'from':_0x23a9fc['email'],'to':_0x5ea4d4[_0xb425('0xbd')]['email'],'cc':'','subject':_[_0xb425('0x71')](_0x1f7830)?_0x5ea4d4['offlineMessageSubject']:_0x1f7830,'messageId':'','sentAt':new Date(),'attach':_0x29fc55[_0xb425('0x3b')],'attachments':_0x29fc55,'originChannel':_0xb425('0xda'),'ChatWebsiteId':_0x5ea4d4['id'],'ChatOfflineMessageId':_0x19b5be['id'],'originTo':_0x5ea4d4[_0xb425('0xbd')][_0xb425('0xd5')]},'body':_0x19b5be[_0xb425('0x4c')]};var _0x1ca9b7={'account':{'id':_0x5ea4d4[_0xb425('0xd8')]},'body':_0xe81d18,'log':_0xb425('0xdb')};return respondWithRpcPromise(_0xb425('0xdb'),_0xb425('0xdc'),_0x1ca9b7,client9001)[_0xb425('0x13')](function(){return _0x19b5be;})[_0xb425('0x1e')](function(_0x2f01ba){logger['error'](_0x2f01ba);});}return;})['then'](function(){if(_0x19b5be){return _0x19b5be;}})[_0xb425('0x13')](respondWithResult(_0x384903,null))[_0xb425('0x1e')](function(_0x2f0130){logger['error']('catch',_0x2f0130);for(var _0x243eac of _0x57fe59){var _0x52375e=path[_0xb425('0x66')](config[_0xb425('0x6c')],_0xb425('0xc7'),_0xb425('0xb9'),_0xb425('0xc8'),_0xb425('0xc9'),_0x243eac['filename']);fs_extra[_0xb425('0xdd')](_0x52375e)[_0xb425('0x1e')](function(_0x3d1c0c){logger['error'](_0xb425('0xde'),_0x52375e,_0x3d1c0c);});}});};exports[_0xb425('0xdf')]=function(_0x273a7a,_0x59ff52){return db[_0xb425('0xa9')]['find']({'where':{'id':_0x273a7a['params']['id']}})[_0xb425('0x13')](handleEntityNotFound(_0x59ff52,null))[_0xb425('0x13')](function(_0x14dd53){if(_0x14dd53){return _0x14dd53[_0xb425('0xdf')](_0x273a7a[_0xb425('0x4c')][_0xb425('0x5e')],_['omit'](_0x273a7a[_0xb425('0x4c')],[_0xb425('0x5e'),'id'])||{});}})[_0xb425('0x13')](respondWithResult(_0x59ff52,null))[_0xb425('0x1e')](handleError(_0x59ff52,null));};exports[_0xb425('0xe0')]=function(_0x573873,_0x370c06){var _0x55bec6={'raw':![],'where':{}};var _0x2db934={};var _0x4131f0={'count':0x0,'rows':[]};return db[_0xb425('0x32')][_0xb425('0x58')]({'where':{'id':_0x573873['params']['id']}})[_0xb425('0x13')](handleEntityNotFound(_0x370c06,null))[_0xb425('0x13')](function(_0x55bbad){if(_0x55bbad){_0x2db934[_0xb425('0x38')]=_[_0xb425('0x36')](db[_0xb425('0xa9')][_0xb425('0x33')]);_0x2db934[_0xb425('0x35')]=_['keys'](_0x573873[_0xb425('0x35')]);_0x2db934[_0xb425('0x37')]=_['intersection'](_0x2db934[_0xb425('0x38')],_0x2db934[_0xb425('0x35')]);_0x55bec6[_0xb425('0x3a')]=_[_0xb425('0x49')](_0x2db934[_0xb425('0x38')],qs['fields'](_0x573873[_0xb425('0x35')][_0xb425('0x39')]));_0x55bec6[_0xb425('0x3a')]=_0x55bec6[_0xb425('0x3a')][_0xb425('0x3b')]?_0x55bec6[_0xb425('0x3a')]:_0x2db934[_0xb425('0x38')];if(!_0x573873[_0xb425('0x35')]['hasOwnProperty'](_0xb425('0x3c'))){_0x55bec6['limit']=qs[_0xb425('0x23')](_0x573873[_0xb425('0x35')][_0xb425('0x23')]);_0x55bec6[_0xb425('0x21')]=qs[_0xb425('0x21')](_0x573873[_0xb425('0x35')]['offset']);}_0x55bec6[_0xb425('0x3d')]=qs['sort'](_0x573873[_0xb425('0x35')][_0xb425('0x3e')]);_0x55bec6[_0xb425('0x41')]=qs[_0xb425('0x37')](_[_0xb425('0x3f')](_0x573873[_0xb425('0x35')],_0x2db934['filters']));_0x55bec6[_0xb425('0x41')][_0xb425('0x56')]=_0x55bbad['id'];if(_0x573873['query'][_0xb425('0x40')]){_0x55bec6[_0xb425('0x41')]=_[_0xb425('0x42')](_0x55bec6['where'],{'$or':_['map'](_0x55bec6[_0xb425('0x3a')],function(_0x4491b0){var _0x3da31c={};_0x3da31c[_0x4491b0]={'$like':'%'+_0x573873['query']['filter']+'%'};return _0x3da31c;})});}_0x55bec6=_[_0xb425('0x42')]({},_0x55bec6,_0x573873[_0xb425('0x43')]);return db[_0xb425('0xa9')][_0xb425('0x24')]({'where':_0x55bec6[_0xb425('0x41')]})['then'](function(_0x7942fb){_0x4131f0['count']=_0x7942fb;if(_0x573873[_0xb425('0x35')][_0xb425('0x44')]){_0x55bec6[_0xb425('0x4a')]=[{'model':db[_0xb425('0x7d')],'as':_0xb425('0xe1'),'required':![]},{'model':db['User'],'as':_0xb425('0xe2'),'attributes':[_0xb425('0x2c'),'fullname','internal'],'required':![]},{'model':db[_0xb425('0xe3')],'as':_0xb425('0xe4'),'attributes':['id',_0xb425('0x2c'),'color'],'where':_0x573873['query'][_0xb425('0xe5')]?{'id':_0x573873['query'][_0xb425('0xe5')]}:undefined,'required':_0x573873[_0xb425('0x35')][_0xb425('0xe5')]?!![]:![]}];}return db[_0xb425('0xa9')][_0xb425('0x45')](_0x55bec6);})['then'](function(_0x4ff92d){_0x4131f0['rows']=_0x4ff92d;return _0x4131f0;});}})[_0xb425('0x13')](respondWithFilteredResult(_0x370c06,_0x55bec6))[_0xb425('0x1e')](handleError(_0x370c06,null));};function iftimePromise(_0x143412,_0x1bf4f6){return respondWithRpcPromise(_0xb425('0xe6'),_0xb425('0xe7'),{'command':_0x1bf4f6[_0xb425('0xe8')]?util[_0xb425('0xa1')](_0xb425('0xe9'),_0x143412['interval'],_0x1bf4f6['timezone']):util[_0xb425('0xa1')](_0xb425('0xea'),_0x143412[_0xb425('0xeb')])},client9002)[_0xb425('0x13')](function(_0x4f32b7){var _0x48a05d=_0x4f32b7&&_0x4f32b7[_0xb425('0xec')](_0xb425('0xed'))>=0x0?!![]:![];logger[_0xb425('0x14')](_0xb425('0xee'),_0x1bf4f6['id'],_0x143412['id'],_0x143412[_0xb425('0xeb')],_0x48a05d?_0xb425('0xef'):_0xb425('0xf0'),_0x1bf4f6[_0xb425('0xe8')]?_0x1bf4f6[_0xb425('0xe8')]:_0xb425('0xf1'));return _0x48a05d;})[_0xb425('0x1e')](function(_0x5cc71a){logger['error'](_0xb425('0xee'),_0x1bf4f6['id'],_0x143412['id'],_0x143412['interval'],util['inspect'](_0x5cc71a,{'showHidden':![],'depth':null}),_0x1bf4f6[_0xb425('0xe8')]?_0x1bf4f6[_0xb425('0xe8')]:'No\x20timezone');return![];});}exports['getSnippet']=function(_0x72d2de,_0x150624){var _0x456a09=0x0;var _0x1aad58=0x0;var _0x29bbf4=![];var _0x250754;var _0x14750a;return db[_0xb425('0x32')]['find']({'where':{'id':_0x72d2de[_0xb425('0x48')]['id']},'include':[{'model':db[_0xb425('0xf2')],'as':_0xb425('0xf2'),'include':[{'model':db[_0xb425('0xf2')],'as':_0xb425('0xf3'),'attributes':['id',_0xb425('0xeb')],'raw':!![]}]}]})['then'](handleEntityNotFound(_0x150624,null))['then'](function(_0x1fce48){if(_0x1fce48){_0x250754=_0x1fce48;return _0x1fce48[_0xb425('0xf4')]({'raw':!![]});}})[_0xb425('0x13')](function(_0x4346bc){if(_0x250754){if(_0x4346bc){_0x14750a=_0x4346bc;}}return require(_0xb425('0x68'))['getLicense']();})[_0xb425('0x13')](function(_0x231bd8){if(_0x231bd8){_0x1aad58=_0x231bd8[_0xb425('0xf5')];_0x29bbf4=_0x231bd8[_0xb425('0x6a')];}})[_0xb425('0x13')](function(){return db[_0xb425('0xa9')][_0xb425('0x24')]({'where':{'closed':![]}});})[_0xb425('0x13')](function(_0xd4af9b){_0x456a09=_0xd4af9b;if(_0x1aad58&&_0xd4af9b>_0x1aad58){return db['License'][_0xb425('0x58')]({'where':{'id':0x1}})['then'](function(_0x1c21d1){if(_0x1c21d1){_0x1c21d1[_0xb425('0xf6')](_0xb425('0xf7'));}});}})[_0xb425('0x13')](function(){if(_0x250754['Interval']&&_0x250754['Interval'][_0xb425('0xf3')]){var _0x42e51e=[];for(var _0x16112d=0x0;_0x16112d<_0x250754[_0xb425('0xf2')][_0xb425('0xf3')][_0xb425('0x3b')];_0x16112d++){var _0x11ccea=_0x250754[_0xb425('0xf2')][_0xb425('0xf3')][_0x16112d][_0xb425('0x50')]({'plain':!![]});_0x42e51e[_0xb425('0xf8')](iftimePromise(_0x11ccea,_0x250754));}return BPromise['all'](_0x42e51e)[_0xb425('0x13')](function(_0x37ff26){return _['some'](_0x37ff26);});}else{return!![];}})[_0xb425('0x13')](function(_0x56e131){var _0x41720c=fs['readFileSync'](path['join'](config[_0xb425('0x6c')],_0xb425('0xf9')),_0xb425('0xc0'));var _0x230d9f={'remote':_0x250754[_0xb425('0xfa')],'query':querystring[_0xb425('0x19')](_['merge'](_0x250754[_0xb425('0x50')]({'plain':!![]}),{'customerIp':_0x72d2de[_0xb425('0x79')][_0xb425('0x99')]||_0x72d2de[_0xb425('0x79')][_0xb425('0xfb')]||_0x72d2de[_0xb425('0xfc')]['remoteAddress']||_0x72d2de['ip'],'referer':_0x72d2de[_0xb425('0x79')][_0xb425('0x9e')],'openedInteractions':_0x456a09,'maxInteractions':_0x1aad58,'virtual':_0x29bbf4[_0xb425('0xf5')],'online':_0x56e131,'custom':_0x29bbf4}))['replace'](/'/g,'\x5c\x27')};_0x150624[_0xb425('0x2d')](ejs['render'](Mustache[_0xb425('0xfd')](_0x41720c,_0x230d9f),{'proactiveActions':_0x14750a,'alignment':_0x250754[_0xb425('0xfe')],'verticalAlignment':_0x250754[_0xb425('0xff')],'div_color':_0x250754[_0xb425('0x100')],'labelText':_0x250754[_0xb425('0x101')],'text_color':_0x250754[_0xb425('0x102')],'text_button_color':_0x250754['textButtonColor'],'button_color':_0x250754[_0xb425('0x103')],'background_color':_0x250754[_0xb425('0x104')],'hideWhenOffline':_0x250754['hideWhenOffline'],'interval':_0x250754[_0xb425('0x105')]}));})[_0xb425('0x1e')](handleError(_0x150624,null));};exports[_0xb425('0x106')]=function(_0x334d81,_0x478a31){var _0x1eabb3=_0x334d81[_0xb425('0x48')]['id'];var _0x4fb13b=_0x334d81[_0xb425('0x4c')];var _0x55e3ad=0xc8;var _0x348360=null;return db[_0xb425('0xcc')][_0xb425('0xcd')]({'isolationLevel':db['sequelize']['Transaction']['ISOLATION_LEVELS'][_0xb425('0x107')]},function(_0x54d839){return db['ChatWebsite']['findOne']({'where':{'id':_0x1eabb3},'transaction':_0x54d839})[_0xb425('0x13')](function(_0xa34c01){if(_0xa34c01){return db[_0xb425('0x8f')][_0xb425('0x28')]({'where':{'ChatWebsiteId':_0x1eabb3},'transaction':_0x54d839})[_0xb425('0x13')](function(){var _0x3e7740=_[_0xb425('0x31')](_0x4fb13b,function(_0x583500){_0x583500['ChatWebsiteId']=_0x1eabb3;return _0x583500;});return db['ChatApplication'][_0xb425('0xcf')](_0x3e7740,{'transaction':_0x54d839});});}else{_0x55e3ad=0x194;_0x348360=[];}});})['then'](function(){if(_0x55e3ad!==0x194){return db[_0xb425('0x8f')][_0xb425('0x108')]({'where':{'ChatWebsiteId':_0x1eabb3},'order':_0xb425('0x109')})[_0xb425('0x13')](function(_0x565fd8){_0x348360=_0x565fd8;});}})[_0xb425('0x1e')](function(_0x5b1c95){_0x55e3ad=0x1f4;logger['error'](_0x5b1c95[_0xb425('0x2b')]);if(_0x5b1c95['name']){delete _0x5b1c95[_0xb425('0x2c')];}_0x348360=_0x5b1c95;})[_0xb425('0x10a')](function(){if(_0x348360===null){_0x478a31[_0xb425('0x1f')](_0x55e3ad);}else{if(_0x55e3ad===0x1f4){_0x478a31[_0xb425('0x20')](_0x55e3ad)[_0xb425('0x2d')](_0x348360);}else{_0x478a31[_0xb425('0x20')](_0x55e3ad)[_0xb425('0x27')](_0x348360);}}});};exports[_0xb425('0x10b')]=function(_0x164471,_0xc65da8){var _0x122434={};var _0x3063f6={};var _0x560701;var _0x51b8be;return db['ChatWebsite'][_0xb425('0x58')]({'where':{'id':_0x164471[_0xb425('0x48')]['id']}})[_0xb425('0x13')](handleEntityNotFound(_0xc65da8,null))[_0xb425('0x13')](function(_0x587c90){if(_0x587c90){_0x560701=_0x587c90;_0x3063f6[_0xb425('0x38')]=_[_0xb425('0x36')](db[_0xb425('0x8f')][_0xb425('0x33')]);_0x3063f6[_0xb425('0x35')]=_[_0xb425('0x36')](_0x164471[_0xb425('0x35')]);_0x3063f6[_0xb425('0x37')]=_[_0xb425('0x49')](_0x3063f6[_0xb425('0x38')],_0x3063f6[_0xb425('0x35')]);_0x122434[_0xb425('0x3a')]=_['intersection'](_0x3063f6[_0xb425('0x38')],qs[_0xb425('0x39')](_0x164471['query']['fields']));_0x122434[_0xb425('0x3a')]=_0x122434['attributes'][_0xb425('0x3b')]?_0x122434[_0xb425('0x3a')]:_0x3063f6['model'];_0x122434['order']=qs[_0xb425('0x3e')](_0x164471[_0xb425('0x35')]['sort']);_0x122434[_0xb425('0x41')]=qs[_0xb425('0x37')](_['pick'](_0x164471[_0xb425('0x35')],_0x3063f6[_0xb425('0x37')]));if(_0x164471[_0xb425('0x35')][_0xb425('0x40')]){_0x122434['where']=_[_0xb425('0x42')](_0x122434[_0xb425('0x41')],{'$or':_[_0xb425('0x31')](_0x122434[_0xb425('0x3a')],function(_0x28de7a){var _0x1ae7cb={};_0x1ae7cb[_0x28de7a]={'$like':'%'+_0x164471[_0xb425('0x35')][_0xb425('0x40')]+'%'};return _0x1ae7cb;})});}_0x122434=_[_0xb425('0x42')]({},_0x122434,_0x164471[_0xb425('0x43')]);return _0x560701[_0xb425('0x10b')](_0x122434);}})[_0xb425('0x13')](function(_0x30bc01){if(_0x30bc01){_0x51b8be=_0x30bc01[_0xb425('0x3b')];if(!_0x164471[_0xb425('0x35')][_0xb425('0x10c')](_0xb425('0x3c'))){_0x122434[_0xb425('0x23')]=qs[_0xb425('0x23')](_0x164471[_0xb425('0x35')][_0xb425('0x23')]);_0x122434[_0xb425('0x21')]=qs[_0xb425('0x21')](_0x164471[_0xb425('0x35')][_0xb425('0x21')]);}return _0x560701[_0xb425('0x10b')](_0x122434);}})[_0xb425('0x13')](function(_0x49ae8f){if(_0x49ae8f){return _0x49ae8f?{'count':_0x51b8be,'rows':_0x49ae8f}:null;}})[_0xb425('0x13')](respondWithResult(_0xc65da8,null))[_0xb425('0x1e')](handleError(_0xc65da8,null));};exports['addProactiveActions']=function(_0x40b314,_0x7c0ce8){return db[_0xb425('0x10d')]['find']({'where':{'id':_0x40b314['params']['id']}})['then'](handleEntityNotFound(_0x7c0ce8,null))[_0xb425('0x13')](function(_0x24d7f0){if(_0x24d7f0){return _0x24d7f0[_0xb425('0x10e')](_0x40b314[_0xb425('0x4c')][_0xb425('0x5e')],_[_0xb425('0x10f')](_0x40b314[_0xb425('0x4c')],['ids','id'])||{});}})['then'](respondWithResult(_0x7c0ce8,null))[_0xb425('0x1e')](handleError(_0x7c0ce8,null));};exports[_0xb425('0xf4')]=function(_0x499bb6,_0x303b08){var _0x544db3={};var _0x4e5d61={};var _0x28edd3;var _0x54b6c4;return db['ChatWebsite']['findOne']({'where':{'id':_0x499bb6[_0xb425('0x48')]['id']}})['then'](handleEntityNotFound(_0x303b08,null))[_0xb425('0x13')](function(_0x11ed91){if(_0x11ed91){_0x28edd3=_0x11ed91;_0x4e5d61[_0xb425('0x38')]=_[_0xb425('0x36')](db['ChatProactiveAction'][_0xb425('0x33')]);_0x4e5d61[_0xb425('0x35')]=_[_0xb425('0x36')](_0x499bb6[_0xb425('0x35')]);_0x4e5d61[_0xb425('0x37')]=_[_0xb425('0x49')](_0x4e5d61[_0xb425('0x38')],_0x4e5d61[_0xb425('0x35')]);_0x544db3[_0xb425('0x3a')]=_[_0xb425('0x49')](_0x4e5d61['model'],qs[_0xb425('0x39')](_0x499bb6[_0xb425('0x35')][_0xb425('0x39')]));_0x544db3[_0xb425('0x3a')]=_0x544db3[_0xb425('0x3a')]['length']?_0x544db3[_0xb425('0x3a')]:_0x4e5d61[_0xb425('0x38')];_0x544db3[_0xb425('0x3d')]=qs[_0xb425('0x3e')](_0x499bb6[_0xb425('0x35')][_0xb425('0x3e')]);_0x544db3[_0xb425('0x41')]=qs[_0xb425('0x37')](_[_0xb425('0x3f')](_0x499bb6[_0xb425('0x35')],_0x4e5d61['filters']));if(_0x499bb6[_0xb425('0x35')][_0xb425('0x40')]){_0x544db3[_0xb425('0x41')]=_['merge'](_0x544db3[_0xb425('0x41')],{'$or':_[_0xb425('0x31')](_0x544db3[_0xb425('0x3a')],function(_0x5f2df0){var _0x278460={};_0x278460[_0x5f2df0]={'$like':'%'+_0x499bb6[_0xb425('0x35')]['filter']+'%'};return _0x278460;})});}_0x544db3=_[_0xb425('0x42')]({},_0x544db3,_0x499bb6[_0xb425('0x43')]);return _0x28edd3['getProactiveActions'](_0x544db3);}})[_0xb425('0x13')](function(_0xa2a78d){if(_0xa2a78d){_0x54b6c4=_0xa2a78d[_0xb425('0x3b')];if(!_0x499bb6[_0xb425('0x35')]['hasOwnProperty'](_0xb425('0x3c'))){_0x544db3['limit']=qs[_0xb425('0x23')](_0x499bb6[_0xb425('0x35')]['limit']);_0x544db3[_0xb425('0x21')]=qs[_0xb425('0x21')](_0x499bb6['query'][_0xb425('0x21')]);}return _0x28edd3[_0xb425('0xf4')](_0x544db3);}})[_0xb425('0x13')](function(_0x525dee){if(_0x525dee){return _0x525dee?{'count':_0x54b6c4,'rows':_0x525dee}:null;}})[_0xb425('0x13')](respondWithResult(_0x303b08,null))[_0xb425('0x1e')](handleError(_0x303b08,null));};exports[_0xb425('0x110')]=function(_0x272f69,_0x133c41){var _0x1cd720=_0x272f69[_0xb425('0x35')]['online']==='false'?'offlineForm':_0xb425('0x111');return db['ChatWebsite'][_0xb425('0x54')]({'attributes':['id',_0x1cd720],'where':{'id':_0x272f69[_0xb425('0x48')]['id']}})[_0xb425('0x13')](handleEntityNotFound(_0x133c41,null))[_0xb425('0x13')](function(_0x577c5e){if(_0x577c5e){var _0x57444e=_0x577c5e[_0x1cd720];var _0x4ceb89=_0x57444e&&_0x57444e[_0xb425('0x112')]?_0x57444e[_0xb425('0x112')]:[];_0x133c41[_0xb425('0x2d')]({'fromKey':_[_0xb425('0x71')](_0x57444e[_0xb425('0x113')])?undefined:_0x57444e['fromKey'],'count':_0x4ceb89[_0xb425('0x3b')],'rows':_0x4ceb89});}})[_0xb425('0x1e')](handleError(_0x133c41,null));};exports['getOfflineMessages']=function(_0x2b87db,_0x365bae){var _0x58e832={'raw':![],'where':{}};var _0x4be10d={};var _0x5b55e9={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x2b87db['params']['id']}})[_0xb425('0x13')](handleEntityNotFound(_0x365bae,null))[_0xb425('0x13')](function(_0x4d739b){if(_0x4d739b){_0x4be10d[_0xb425('0x38')]=_[_0xb425('0x36')](db[_0xb425('0xc3')][_0xb425('0x33')]);_0x4be10d[_0xb425('0x35')]=_[_0xb425('0x36')](_0x2b87db['query']);_0x4be10d['filters']=_[_0xb425('0x49')](_0x4be10d[_0xb425('0x38')],_0x4be10d['query']);_0x58e832['attributes']=_[_0xb425('0x49')](_0x4be10d[_0xb425('0x38')],qs[_0xb425('0x39')](_0x2b87db['query'][_0xb425('0x39')]));_0x58e832['attributes']=_0x58e832['attributes'][_0xb425('0x3b')]?_0x58e832[_0xb425('0x3a')]:_0x4be10d[_0xb425('0x38')];if(!_0x2b87db[_0xb425('0x35')][_0xb425('0x10c')]('nolimit')){_0x58e832['limit']=qs[_0xb425('0x23')](_0x2b87db[_0xb425('0x35')][_0xb425('0x23')]);_0x58e832[_0xb425('0x21')]=qs[_0xb425('0x21')](_0x2b87db[_0xb425('0x35')]['offset']);}_0x58e832[_0xb425('0x3d')]=qs[_0xb425('0x3e')](_0x2b87db[_0xb425('0x35')][_0xb425('0x3e')]);_0x58e832[_0xb425('0x41')]=qs['filters'](_[_0xb425('0x3f')](_0x2b87db[_0xb425('0x35')],_0x4be10d[_0xb425('0x37')]));_0x58e832[_0xb425('0x41')]['ChatWebsiteId']=_0x4d739b['id'];if(_0x2b87db[_0xb425('0x35')][_0xb425('0x40')]){_0x58e832[_0xb425('0x41')]=_['merge'](_0x58e832[_0xb425('0x41')],{'$or':_[_0xb425('0x31')](_0x58e832[_0xb425('0x3a')],function(_0x4a0036){var _0x520837={};_0x520837[_0x4a0036]={'$like':'%'+_0x2b87db[_0xb425('0x35')][_0xb425('0x40')]+'%'};return _0x520837;})});}_0x58e832=_['merge']({},_0x58e832,_0x2b87db[_0xb425('0x43')]);return db['ChatOfflineMessage'][_0xb425('0x24')]({'where':_0x58e832[_0xb425('0x41')]})[_0xb425('0x13')](function(_0x1a5870){_0x5b55e9[_0xb425('0x24')]=_0x1a5870;if(_0x2b87db[_0xb425('0x35')][_0xb425('0x44')]){_0x58e832[_0xb425('0x4a')]=[{'all':!![]}];}else{_0x58e832[_0xb425('0x4a')]=[{'model':db[_0xb425('0x7d')],'as':_0xb425('0xe1'),'required':![]},{'model':db[_0xb425('0xce')],'as':'Attachments','required':![]}];}return db[_0xb425('0xc3')]['findAll'](_0x58e832);})['then'](function(_0x430a95){_0x5b55e9[_0xb425('0x46')]=_0x430a95;return _0x5b55e9;});}})['then'](respondWithFilteredResult(_0x365bae,_0x58e832))[_0xb425('0x1e')](handleError(_0x365bae,null));};exports[_0xb425('0x114')]=function(_0x3eff07,_0x382663){return db['ChatWebsite'][_0xb425('0x54')]({'where':{'id':_0x3eff07[_0xb425('0x48')]['id']}})[_0xb425('0x13')](handleEntityNotFound(_0x382663,null))[_0xb425('0x13')](function(_0x12edd2){if(_0x12edd2){return _0x12edd2['addAgents'](_0x3eff07['body']['ids'],_['omit'](_0x3eff07['body'],[_0xb425('0x5e'),'id'])||{})[_0xb425('0xac')](function(_0x2896a3){for(var _0x3e6fc7=0x0;_0x3e6fc7<_0x3eff07['body']['ids']['length'];_0x3e6fc7+=0x1){socket[_0xb425('0x115')](_0xb425('0x116'),{'UserId':Number(_0x3eff07[_0xb425('0x4c')][_0xb425('0x5e')][_0x3e6fc7]),'ChatWebsiteId':Number(_0x3eff07[_0xb425('0x48')]['id'])});}return _0x2896a3;});}})[_0xb425('0x13')](respondWithResult(_0x382663,null))['catch'](handleError(_0x382663,null));};exports[_0xb425('0x117')]=function(_0x1ec824,_0xf68045){return db[_0xb425('0x32')][_0xb425('0x54')]({'where':{'id':_0x1ec824['params']['id']}})['then'](handleEntityNotFound(_0xf68045,null))['then'](function(_0x42285f){if(_0x42285f){return _0x42285f[_0xb425('0x117')](_0x1ec824['query']['ids'])[_0xb425('0x13')](function(){if(_[_0xb425('0x118')](_0x1ec824['query'][_0xb425('0x5e')])){for(var _0x5ba7be=0x0;_0x5ba7be<_0x1ec824['query'][_0xb425('0x5e')][_0xb425('0x3b')];_0x5ba7be+=0x1){socket[_0xb425('0x115')](_0xb425('0x119'),{'UserId':Number(_0x1ec824['query']['ids'][_0x5ba7be]),'ChatWebsiteId':Number(_0x1ec824[_0xb425('0x48')]['id'])});}}else{socket[_0xb425('0x115')]('userChatWebsite:remove',{'UserId':Number(_0x1ec824['query']['ids']),'ChatWebsiteId':Number(_0x1ec824[_0xb425('0x48')]['id'])});}});}})[_0xb425('0x13')](respondWithStatusCode(_0xf68045,null))[_0xb425('0x1e')](handleError(_0xf68045,null));};exports[_0xb425('0x11a')]=function(_0x229d54,_0x54926e){var _0x1f22d7={};var _0x1993dd={};var _0x5834c0;var _0x271c07;return db[_0xb425('0x32')][_0xb425('0x58')]({'where':{'id':_0x229d54['params']['id']}})[_0xb425('0x13')](handleEntityNotFound(_0x54926e,null))['then'](function(_0x2a0567){if(_0x2a0567){_0x5834c0=_0x2a0567;_0x1993dd['model']=_['keys'](db[_0xb425('0xb2')][_0xb425('0x33')]);_0x1993dd[_0xb425('0x35')]=_[_0xb425('0x36')](_0x229d54['query']);_0x1993dd[_0xb425('0x37')]=_[_0xb425('0x49')](_0x1993dd[_0xb425('0x38')],_0x1993dd[_0xb425('0x35')]);_0x1f22d7[_0xb425('0x3a')]=_[_0xb425('0x49')](_0x1993dd[_0xb425('0x38')],qs[_0xb425('0x39')](_0x229d54[_0xb425('0x35')]['fields']));_0x1f22d7[_0xb425('0x3a')]=_0x1f22d7[_0xb425('0x3a')][_0xb425('0x3b')]?_0x1f22d7['attributes']:_0x1993dd[_0xb425('0x38')];_0x1f22d7[_0xb425('0x3d')]=qs['sort'](_0x229d54[_0xb425('0x35')][_0xb425('0x3e')]);_0x1f22d7[_0xb425('0x41')]=qs[_0xb425('0x37')](_[_0xb425('0x3f')](_0x229d54[_0xb425('0x35')],_0x1993dd[_0xb425('0x37')]));if(_0x229d54[_0xb425('0x35')]['filter']){_0x1f22d7[_0xb425('0x41')]=_[_0xb425('0x42')](_0x1f22d7[_0xb425('0x41')],{'$or':_[_0xb425('0x31')](_0x1f22d7['attributes'],function(_0x470f97){var _0x305837={};_0x305837[_0x470f97]={'$like':'%'+_0x229d54['query']['filter']+'%'};return _0x305837;})});}_0x1f22d7=_[_0xb425('0x42')]({},_0x1f22d7,_0x229d54[_0xb425('0x43')]);return _0x5834c0[_0xb425('0x11a')](_0x1f22d7);}})['then'](function(_0x9a8ac9){if(_0x9a8ac9){_0x271c07=_0x9a8ac9['length'];if(!_0x229d54[_0xb425('0x35')]['hasOwnProperty'](_0xb425('0x3c'))){_0x1f22d7[_0xb425('0x23')]=qs['limit'](_0x229d54[_0xb425('0x35')][_0xb425('0x23')]);_0x1f22d7[_0xb425('0x21')]=qs[_0xb425('0x21')](_0x229d54[_0xb425('0x35')]['offset']);}return _0x5834c0[_0xb425('0x11a')](_0x1f22d7);}})['then'](function(_0x314afc){if(_0x314afc){return _0x314afc?{'count':_0x271c07,'rows':_0x314afc}:null;}})['then'](respondWithResult(_0x54926e,null))[_0xb425('0x1e')](handleError(_0x54926e,null));};
\ No newline at end of file
+var _0x95b6=['Command','timezone','iftime\x20%s,%s','interval','iftime\x20%s','indexOf','true','ONLINE','inspect','No\x20timezone','getSnippet','Interval','getProactiveActions','virtual','License','increment','Intervals','readFileSync','remote','x-real-ip','remoteAddress','replace','render','alignment','verticalAlignment','labelText','textButtonColor','color_button','backgroundColor','hideWhenOffline','IntervalId','addApplications','ISOLATION_LEVELS','READ_COMMITTED','ChatApplication','findAndCountAll','stack','finally','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','offlineForm','items','fromKey','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','bluebird','mustache','path','ejs','fs-extra','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','html-to-text','jayson/promise','client','http','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','json','undefined','count','offset','limit','Content-Range','update','destroy','get','ChatWebsites','UserProfileResource','name','send','index','Pause','mandatoryDispositionPause','ChatWebsite','type','key','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','rows','show','params','keys','rawAttributes','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','find','describe','addDisposition','Disposition','getDispositions','findOne','length','ChatWebsiteId','removeDispositions','ids','CannedAnswer','findAll','removeAnswers','addLogo','sitepic','filename','addAvatar','file','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','root','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','custom','join','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','isNil','agentAvatar','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','headers','user-agent','getResult','CmContact','Sequelize','no\x20available\x20attributes','createdAt','updatedAt','CompanyId','ListId','from','ValidationError','from\x20is\x20mandatory','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','account','list','List','applications','orderBy','priority','asc','contact','cf-connecting-ip','x-forwarded-for','first','split','firstName','x-real-port','referer','browser','format','unknown','version','%s\x20%s','device','vendor','%s\x20%s\x20%s','stringify','threadId','ContactId','interaction','ChatInteraction','spread','lastName','messageId','created','autoclose','push','close','*,*,*,*','ChatMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','Start','startRouting','EventManager','files','difference','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','server/files/templates/chatOfflineMessage.ejs','utf8','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','mimetype','server','attachments','basename','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','MailServerOut','CloudProvider','forwardOffline','forwardOfflineAddress','SendMail','sendMail','email','Smtp','offlineMessageSubject','MailAccountId','subjectOffline','toPairsIn','Chat','NotifyMailAccount','notifyMail','offline-chat','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Owner','internal','Tag','Tags','color','tag'];(function(_0x275c39,_0x3584f0){var _0x437901=function(_0xdb2d9b){while(--_0xdb2d9b){_0x275c39['push'](_0x275c39['shift']());}};_0x437901(++_0x3584f0);}(_0x95b6,0x15f));var _0x695b=function(_0x87e81b,_0x2ddb31){_0x87e81b=_0x87e81b-0x0;var _0x1d4c78=_0x95b6[_0x87e81b];return _0x1d4c78;};'use strict';var BPromise=require(_0x695b('0x0'));var Mustache=require(_0x695b('0x1'));var util=require('util');var path=require(_0x695b('0x2'));var ejs=require(_0x695b('0x3'));var fs=require('fs');var fs_extra=require(_0x695b('0x4'));var _=require(_0x695b('0x5'));var querystring=require('querystring');var Redis=require(_0x695b('0x6'));var qs=require(_0x695b('0x7'));var logger=require(_0x695b('0x8'))(_0x695b('0x9'));var config=require(_0x695b('0xa'));var db=require(_0x695b('0xb'))['db'];config[_0x695b('0xc')]=_[_0x695b('0xd')](config[_0x695b('0xc')],{'host':_0x695b('0xe'),'port':0x18eb});var socket=require(_0x695b('0xf'))(new Redis(config[_0x695b('0xc')]));require(_0x695b('0x10'))[_0x695b('0x11')](socket);var htmlToText=require(_0x695b('0x12'));var jayson=require(_0x695b('0x13'));var client=jayson[_0x695b('0x14')][_0x695b('0x15')]({'port':0x232c});var client9002=jayson[_0x695b('0x14')]['http']({'port':0x232a});var client9003=jayson['client'][_0x695b('0x15')]({'port':0x232b});var client9001=jayson['client'][_0x695b('0x15')]({'port':0x2329});function respondWithRpcPromise(_0x146620,_0x233a7f,_0x3b9468,_0xec8f34){return new BPromise(function(_0x1128f6,_0x15809e){var _0x9d0ca8=_0xec8f34||client;return _0x9d0ca8['request'](_0x146620,_0x3b9468)[_0x695b('0x16')](function(_0x5aebd2){logger[_0x695b('0x17')](_0x695b('0x18'),_0x233a7f,_0x695b('0x19'));logger[_0x695b('0x1a')](_0x695b('0x1b'),_0x233a7f,_0x695b('0x19'),JSON['stringify'](_0x5aebd2));if(_0x5aebd2[_0x695b('0x1c')]){if(_0x5aebd2[_0x695b('0x1c')][_0x695b('0x1d')]===0x1f4){logger[_0x695b('0x1c')](_0x695b('0x18'),_0x233a7f,_0x5aebd2[_0x695b('0x1c')][_0x695b('0x1e')]);return _0x15809e(_0x5aebd2['error'][_0x695b('0x1e')]);}logger[_0x695b('0x1c')](_0x695b('0x18'),_0x233a7f,_0x5aebd2['error']['message']);return _0x1128f6(_0x5aebd2[_0x695b('0x1c')][_0x695b('0x1e')]);}else{logger[_0x695b('0x17')](_0x695b('0x18'),_0x233a7f,_0x695b('0x19'));_0x1128f6(_0x5aebd2[_0x695b('0x1f')][_0x695b('0x1e')]);}})[_0x695b('0x20')](function(_0x5a5221){logger[_0x695b('0x1c')](_0x695b('0x18'),_0x233a7f,_0x5a5221);_0x15809e(_0x5a5221);});});}function respondWithStatusCode(_0x19b4d8,_0x2b85a3){_0x2b85a3=_0x2b85a3||0xcc;return function(_0x4c9dd4){if(_0x4c9dd4){return _0x19b4d8[_0x695b('0x21')](_0x2b85a3);}return _0x19b4d8[_0x695b('0x22')](_0x2b85a3)[_0x695b('0x23')]();};}function respondWithResult(_0x18b4fe,_0x1d009b){_0x1d009b=_0x1d009b||0xc8;return function(_0x2935e){if(_0x2935e){return _0x18b4fe[_0x695b('0x22')](_0x1d009b)[_0x695b('0x24')](_0x2935e);}};}function respondWithFilteredResult(_0x11041d,_0x24085a){return function(_0x1b6eec){if(_0x1b6eec){var _0x12d645=typeof _0x24085a['offset']==='undefined'&&typeof _0x24085a['limit']===_0x695b('0x25');var _0x1875c9=_0x1b6eec[_0x695b('0x26')];var _0x3dbd41=_0x12d645?0x0:_0x24085a[_0x695b('0x27')];var _0x3be238=_0x12d645?_0x1b6eec[_0x695b('0x26')]:_0x24085a[_0x695b('0x27')]+_0x24085a[_0x695b('0x28')];var _0x1d7bc3;if(_0x3be238>=_0x1875c9){_0x3be238=_0x1875c9;_0x1d7bc3=0xc8;}else{_0x1d7bc3=0xce;}_0x11041d[_0x695b('0x22')](_0x1d7bc3);return _0x11041d['set'](_0x695b('0x29'),_0x3dbd41+'-'+_0x3be238+'/'+_0x1875c9)[_0x695b('0x24')](_0x1b6eec);}return null;};}function saveUpdates(_0x4d1062){return function(_0x178859){if(_0x178859){return _0x178859[_0x695b('0x2a')](_0x4d1062)[_0x695b('0x16')](function(_0xa1d932){return _0xa1d932;});}return null;};}function removeEntity(_0x31303e){return function(_0x4a831d){if(_0x4a831d){return _0x4a831d[_0x695b('0x2b')]()[_0x695b('0x16')](function(){var _0x11df91=_0x4a831d[_0x695b('0x2c')]({'plain':!![]});var _0x58f8f7=_0x695b('0x2d');return db[_0x695b('0x2e')][_0x695b('0x2b')]({'where':{'type':_0x58f8f7,'resourceId':_0x11df91['id']}})[_0x695b('0x16')](function(){return _0x4a831d;});})[_0x695b('0x16')](function(){_0x31303e[_0x695b('0x22')](0xcc)[_0x695b('0x23')]();});}};}function handleEntityNotFound(_0x4623fb){return function(_0xb40d02){if(!_0xb40d02){_0x4623fb[_0x695b('0x21')](0x194);}return _0xb40d02;};}function handleError(_0x5b3f0a,_0x5c688a){_0x5c688a=_0x5c688a||0x1f4;return function(_0xc48b60){logger[_0x695b('0x1c')](_0xc48b60['stack']);if(_0xc48b60[_0x695b('0x2f')]){delete _0xc48b60[_0x695b('0x2f')];}_0x5b3f0a['status'](_0x5c688a)[_0x695b('0x30')](_0xc48b60);};}exports[_0x695b('0x31')]=function(_0x3b6ad6,_0x1bdff6){var _0x399a95={'include':[{'model':db[_0x695b('0x32')],'as':_0x695b('0x33')}]},_0x235ba4={},_0x1052c1={'count':0x0,'rows':[]};var _0x1c7cf3=_['map'](db[_0x695b('0x34')]['rawAttributes'],function(_0x18886e){return{'name':_0x18886e['fieldName'],'type':_0x18886e[_0x695b('0x35')][_0x695b('0x36')]};});_0x235ba4[_0x695b('0x37')]=_[_0x695b('0x38')](_0x1c7cf3,_0x695b('0x2f'));_0x235ba4[_0x695b('0x39')]=_['keys'](_0x3b6ad6['query']);_0x235ba4[_0x695b('0x3a')]=_[_0x695b('0x3b')](_0x235ba4[_0x695b('0x37')],_0x235ba4[_0x695b('0x39')]);_0x399a95[_0x695b('0x3c')]=_[_0x695b('0x3b')](_0x235ba4[_0x695b('0x37')],qs[_0x695b('0x3d')](_0x3b6ad6[_0x695b('0x39')][_0x695b('0x3d')]));_0x399a95[_0x695b('0x3c')]=_0x399a95[_0x695b('0x3c')]['length']?_0x399a95['attributes']:_0x235ba4['model'];if(!_0x3b6ad6[_0x695b('0x39')][_0x695b('0x3e')](_0x695b('0x3f'))){_0x399a95['limit']=qs[_0x695b('0x28')](_0x3b6ad6[_0x695b('0x39')][_0x695b('0x28')]);_0x399a95[_0x695b('0x27')]=qs['offset'](_0x3b6ad6[_0x695b('0x39')][_0x695b('0x27')]);}_0x399a95[_0x695b('0x40')]=qs['sort'](_0x3b6ad6[_0x695b('0x39')][_0x695b('0x41')]);_0x399a95[_0x695b('0x42')]=qs[_0x695b('0x3a')](_[_0x695b('0x43')](_0x3b6ad6[_0x695b('0x39')],_0x235ba4[_0x695b('0x3a')]),_0x1c7cf3);if(_0x3b6ad6[_0x695b('0x39')][_0x695b('0x44')]){_0x399a95[_0x695b('0x42')]=_['merge'](_0x399a95[_0x695b('0x42')],{'$or':_[_0x695b('0x38')](_0x1c7cf3,function(_0x265fa9){if(_0x265fa9['type']!==_0x695b('0x45')){var _0x108ecf={};_0x108ecf[_0x265fa9[_0x695b('0x2f')]]={'$like':'%'+_0x3b6ad6[_0x695b('0x39')][_0x695b('0x44')]+'%'};return _0x108ecf;}})});}_0x399a95=_[_0x695b('0x46')]({},_0x399a95,_0x3b6ad6[_0x695b('0x47')]);var _0x3a7b8f={'where':_0x399a95['where']};return db['ChatWebsite'][_0x695b('0x26')](_0x3a7b8f)[_0x695b('0x16')](function(_0x23add8){_0x1052c1['count']=_0x23add8;if(_0x3b6ad6[_0x695b('0x39')][_0x695b('0x48')]){_0x399a95['include']=[{'all':!![]}];}return db['ChatWebsite']['findAll'](_0x399a95);})['then'](function(_0x53946a){_0x1052c1[_0x695b('0x49')]=_0x53946a;return _0x1052c1;})['then'](respondWithFilteredResult(_0x1bdff6,_0x399a95))[_0x695b('0x20')](handleError(_0x1bdff6,null));};exports[_0x695b('0x4a')]=function(_0x5db67c,_0x5492b6){var _0x2617f0={'raw':![],'where':{'id':_0x5db67c[_0x695b('0x4b')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x1d4c13={};_0x1d4c13[_0x695b('0x37')]=_[_0x695b('0x4c')](db[_0x695b('0x34')][_0x695b('0x4d')]);_0x1d4c13['query']=_[_0x695b('0x4c')](_0x5db67c[_0x695b('0x39')]);_0x1d4c13['filters']=_['intersection'](_0x1d4c13[_0x695b('0x37')],_0x1d4c13[_0x695b('0x39')]);_0x2617f0[_0x695b('0x3c')]=_[_0x695b('0x3b')](_0x1d4c13['model'],qs[_0x695b('0x3d')](_0x5db67c[_0x695b('0x39')][_0x695b('0x3d')]));_0x2617f0[_0x695b('0x3c')]=_0x2617f0[_0x695b('0x3c')]['length']?_0x2617f0[_0x695b('0x3c')]:_0x1d4c13[_0x695b('0x37')];if(_0x5db67c['query'][_0x695b('0x48')]){_0x2617f0[_0x695b('0x4e')]=[{'all':!![]}];}_0x2617f0=_[_0x695b('0x46')]({},_0x2617f0,_0x5db67c[_0x695b('0x47')]);return db[_0x695b('0x34')]['find'](_0x2617f0)['then'](handleEntityNotFound(_0x5492b6,null))['then'](respondWithResult(_0x5492b6,null))[_0x695b('0x20')](handleError(_0x5492b6,null));};exports[_0x695b('0x4f')]=function(_0x20285d,_0x8d8e53){return db['ChatWebsite'][_0x695b('0x4f')](_0x20285d[_0x695b('0x50')],{})[_0x695b('0x16')](function(_0x18cee7){var _0x52c2b9=_0x20285d[_0x695b('0x51')][_0x695b('0x2c')]({'plain':!![]});if(!_0x52c2b9)throw new Error(_0x695b('0x52'));if(_0x52c2b9[_0x695b('0x53')]==='user'){var _0x664a22=_0x18cee7[_0x695b('0x2c')]({'plain':!![]});var _0x47e397=_0x695b('0x2d');return db[_0x695b('0x54')]['find']({'where':{'name':_0x47e397,'userProfileId':_0x52c2b9[_0x695b('0x55')]},'raw':!![]})[_0x695b('0x16')](function(_0x47bf4d){if(_0x47bf4d&&_0x47bf4d[_0x695b('0x56')]===0x0){return db['UserProfileResource']['create']({'name':_0x664a22['name'],'resourceId':_0x664a22['id'],'type':_0x47bf4d[_0x695b('0x2f')],'sectionId':_0x47bf4d['id']},{})[_0x695b('0x16')](function(){return _0x18cee7;});}else{return _0x18cee7;}})[_0x695b('0x20')](function(_0x2ed6c1){logger[_0x695b('0x1c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2ed6c1);throw _0x2ed6c1;});}return _0x18cee7;})['then'](respondWithResult(_0x8d8e53,0xc9))['catch'](handleError(_0x8d8e53,null));};exports[_0x695b('0x2a')]=function(_0x2a8184,_0x5cc323){if(_0x2a8184[_0x695b('0x50')]['id']){delete _0x2a8184[_0x695b('0x50')]['id'];}return db[_0x695b('0x34')][_0x695b('0x57')]({'where':{'id':_0x2a8184[_0x695b('0x4b')]['id']},'include':[{'model':db[_0x695b('0x32')],'as':_0x695b('0x33')}]})[_0x695b('0x16')](handleEntityNotFound(_0x5cc323,null))['then'](saveUpdates(_0x2a8184['body'],null))[_0x695b('0x16')](respondWithResult(_0x5cc323,null))[_0x695b('0x20')](handleError(_0x5cc323,null));};exports['destroy']=function(_0x5d6ef7,_0x8f34d){return db[_0x695b('0x34')]['find']({'where':{'id':_0x5d6ef7[_0x695b('0x4b')]['id']}})[_0x695b('0x16')](handleEntityNotFound(_0x8f34d,null))[_0x695b('0x16')](removeEntity(_0x8f34d,null))[_0x695b('0x20')](handleError(_0x8f34d,null));};exports['describe']=function(_0x581c11,_0x329fab){return db['ChatWebsite'][_0x695b('0x58')]()[_0x695b('0x16')](respondWithResult(_0x329fab,null))[_0x695b('0x20')](handleError(_0x329fab,null));};exports[_0x695b('0x59')]=function(_0x31a4e6,_0x233bbf){if(_0x31a4e6['body']['id']){delete _0x31a4e6['body']['id'];}return db[_0x695b('0x34')][_0x695b('0x57')]({'where':{'id':_0x31a4e6['params']['id']}})['then'](handleEntityNotFound(_0x233bbf,null))[_0x695b('0x16')](function(_0xa7e6b7){if(_0xa7e6b7){_0x31a4e6['body']['ChatWebsiteId']=_0xa7e6b7['id'];return db[_0x695b('0x5a')]['create'](_0x31a4e6[_0x695b('0x50')]);}})['then'](respondWithResult(_0x233bbf,null))[_0x695b('0x20')](handleError(_0x233bbf,null));};exports[_0x695b('0x5b')]=function(_0x475aae,_0x3937ed){var _0x25d827={'raw':![],'where':{}};var _0x3e8627={};var _0x32a4d7={'count':0x0,'rows':[]};return db[_0x695b('0x34')][_0x695b('0x5c')]({'where':{'id':_0x475aae['params']['id']}})[_0x695b('0x16')](handleEntityNotFound(_0x3937ed,null))[_0x695b('0x16')](function(_0x3a0553){if(_0x3a0553){_0x3e8627[_0x695b('0x37')]=_[_0x695b('0x4c')](db['Disposition'][_0x695b('0x4d')]);_0x3e8627[_0x695b('0x39')]=_['keys'](_0x475aae[_0x695b('0x39')]);_0x3e8627[_0x695b('0x3a')]=_[_0x695b('0x3b')](_0x3e8627['model'],_0x3e8627[_0x695b('0x39')]);_0x25d827['attributes']=_['intersection'](_0x3e8627[_0x695b('0x37')],qs[_0x695b('0x3d')](_0x475aae[_0x695b('0x39')]['fields']));_0x25d827[_0x695b('0x3c')]=_0x25d827[_0x695b('0x3c')][_0x695b('0x5d')]?_0x25d827[_0x695b('0x3c')]:_0x3e8627[_0x695b('0x37')];if(!_0x475aae['query']['hasOwnProperty']('nolimit')){_0x25d827[_0x695b('0x28')]=qs['limit'](_0x475aae[_0x695b('0x39')][_0x695b('0x28')]);_0x25d827[_0x695b('0x27')]=qs[_0x695b('0x27')](_0x475aae['query'][_0x695b('0x27')]);}_0x25d827[_0x695b('0x40')]=qs[_0x695b('0x41')](_0x475aae[_0x695b('0x39')][_0x695b('0x41')]);_0x25d827[_0x695b('0x42')]=qs['filters'](_[_0x695b('0x43')](_0x475aae['query'],_0x3e8627[_0x695b('0x3a')]));_0x25d827[_0x695b('0x42')][_0x695b('0x5e')]=_0x3a0553['id'];if(_0x475aae['query']['filter']){_0x25d827['where']=_['merge'](_0x25d827['where'],{'$or':_[_0x695b('0x38')](_0x25d827['attributes'],function(_0x53ac2d){var _0x4591d6={};_0x4591d6[_0x53ac2d]={'$like':'%'+_0x475aae[_0x695b('0x39')][_0x695b('0x44')]+'%'};return _0x4591d6;})});}_0x25d827=_['merge']({},_0x25d827,_0x475aae[_0x695b('0x47')]);return db['Disposition'][_0x695b('0x26')]({'where':_0x25d827['where']})[_0x695b('0x16')](function(_0x588e5a){_0x32a4d7[_0x695b('0x26')]=_0x588e5a;if(_0x475aae[_0x695b('0x39')][_0x695b('0x48')]){_0x25d827[_0x695b('0x4e')]=[{'all':!![]}];}return db[_0x695b('0x5a')]['findAll'](_0x25d827);})[_0x695b('0x16')](function(_0xe53420){_0x32a4d7[_0x695b('0x49')]=_0xe53420;return _0x32a4d7;});}})[_0x695b('0x16')](respondWithFilteredResult(_0x3937ed,_0x25d827))[_0x695b('0x20')](handleError(_0x3937ed,null));};exports[_0x695b('0x5f')]=function(_0x46ac48,_0x376de3){return db[_0x695b('0x34')]['find']({'where':{'id':_0x46ac48[_0x695b('0x4b')]['id']}})['then'](handleEntityNotFound(_0x376de3,null))[_0x695b('0x16')](function(_0x43e79b){if(_0x43e79b){return _0x43e79b[_0x695b('0x5f')](_0x46ac48[_0x695b('0x39')][_0x695b('0x60')]);}})[_0x695b('0x16')](respondWithStatusCode(_0x376de3,null))['catch'](handleError(_0x376de3,null));};exports['addAnswer']=function(_0x3eb981,_0xf3a860){if(_0x3eb981[_0x695b('0x50')]['id']){delete _0x3eb981[_0x695b('0x50')]['id'];}return db['ChatWebsite'][_0x695b('0x57')]({'where':{'id':_0x3eb981['params']['id']}})[_0x695b('0x16')](handleEntityNotFound(_0xf3a860,null))['then'](function(_0x4c723b){if(_0x4c723b){_0x3eb981[_0x695b('0x50')][_0x695b('0x5e')]=_0x4c723b['id'];return db[_0x695b('0x61')][_0x695b('0x4f')](_0x3eb981['body']);}})[_0x695b('0x16')](respondWithResult(_0xf3a860,null))[_0x695b('0x20')](handleError(_0xf3a860,null));};exports['getAnswers']=function(_0x133242,_0x36f466){var _0x103456={'raw':![],'where':{}};var _0x1bb992={};var _0x2a7c5f={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x695b('0x5c')]({'where':{'id':_0x133242[_0x695b('0x4b')]['id']}})[_0x695b('0x16')](handleEntityNotFound(_0x36f466,null))[_0x695b('0x16')](function(_0x4600d7){if(_0x4600d7){_0x1bb992[_0x695b('0x37')]=_[_0x695b('0x4c')](db[_0x695b('0x61')][_0x695b('0x4d')]);_0x1bb992['query']=_['keys'](_0x133242['query']);_0x1bb992['filters']=_[_0x695b('0x3b')](_0x1bb992[_0x695b('0x37')],_0x1bb992['query']);_0x103456[_0x695b('0x3c')]=_[_0x695b('0x3b')](_0x1bb992['model'],qs[_0x695b('0x3d')](_0x133242[_0x695b('0x39')][_0x695b('0x3d')]));_0x103456[_0x695b('0x3c')]=_0x103456[_0x695b('0x3c')][_0x695b('0x5d')]?_0x103456[_0x695b('0x3c')]:_0x1bb992[_0x695b('0x37')];if(!_0x133242['query'][_0x695b('0x3e')]('nolimit')){_0x103456[_0x695b('0x28')]=qs[_0x695b('0x28')](_0x133242[_0x695b('0x39')][_0x695b('0x28')]);_0x103456[_0x695b('0x27')]=qs[_0x695b('0x27')](_0x133242['query'][_0x695b('0x27')]);}_0x103456['order']=qs[_0x695b('0x41')](_0x133242['query'][_0x695b('0x41')]);_0x103456[_0x695b('0x42')]=qs[_0x695b('0x3a')](_['pick'](_0x133242[_0x695b('0x39')],_0x1bb992[_0x695b('0x3a')]));_0x103456[_0x695b('0x42')][_0x695b('0x5e')]=_0x4600d7['id'];if(_0x133242['query']['filter']){_0x103456[_0x695b('0x42')]=_[_0x695b('0x46')](_0x103456[_0x695b('0x42')],{'$or':_['map'](_0x103456[_0x695b('0x3c')],function(_0x41fd32){var _0x3c3fd4={};_0x3c3fd4[_0x41fd32]={'$like':'%'+_0x133242[_0x695b('0x39')][_0x695b('0x44')]+'%'};return _0x3c3fd4;})});}_0x103456=_[_0x695b('0x46')]({},_0x103456,_0x133242['options']);return db[_0x695b('0x61')][_0x695b('0x26')]({'where':_0x103456['where']})[_0x695b('0x16')](function(_0x2d26b4){_0x2a7c5f[_0x695b('0x26')]=_0x2d26b4;if(_0x133242[_0x695b('0x39')][_0x695b('0x48')]){_0x103456['include']=[{'all':!![]}];}return db[_0x695b('0x61')][_0x695b('0x62')](_0x103456);})[_0x695b('0x16')](function(_0x437b89){_0x2a7c5f[_0x695b('0x49')]=_0x437b89;return _0x2a7c5f;});}})[_0x695b('0x16')](respondWithFilteredResult(_0x36f466,_0x103456))['catch'](handleError(_0x36f466,null));};exports[_0x695b('0x63')]=function(_0x577454,_0x530fc0){return db[_0x695b('0x34')]['find']({'where':{'id':_0x577454['params']['id']}})[_0x695b('0x16')](handleEntityNotFound(_0x530fc0,null))['then'](function(_0x23e857){if(_0x23e857){return _0x23e857['removeAnswers'](_0x577454['query'][_0x695b('0x60')]);}})['then'](respondWithStatusCode(_0x530fc0,null))['catch'](handleError(_0x530fc0,null));};exports[_0x695b('0x64')]=function(_0xf8a4db,_0x176135){_0xf8a4db['body'][_0x695b('0x65')]=_0xf8a4db['file'][_0x695b('0x66')];return db[_0x695b('0x34')][_0x695b('0x57')]({'where':{'id':_0xf8a4db[_0x695b('0x4b')]['id']}})['then'](handleEntityNotFound(_0x176135,null))[_0x695b('0x16')](saveUpdates(_0xf8a4db[_0x695b('0x50')],null))[_0x695b('0x16')](respondWithResult(_0x176135,null))[_0x695b('0x20')](handleError(_0x176135,null));};exports[_0x695b('0x67')]=function(_0xfa4da4,_0x21682b){_0xfa4da4[_0x695b('0x50')]['agentAvatar']=_0xfa4da4[_0x695b('0x68')][_0x695b('0x66')];return db[_0x695b('0x34')][_0x695b('0x57')]({'where':{'id':_0xfa4da4['params']['id']}})[_0x695b('0x16')](handleEntityNotFound(_0x21682b,null))[_0x695b('0x16')](saveUpdates(_0xfa4da4[_0x695b('0x50')],null))['then'](respondWithResult(_0x21682b,null))['catch'](handleError(_0x21682b,null));};exports[_0x695b('0x69')]=function(_0xa8344d,_0x177ca4){_0xa8344d[_0x695b('0x50')][_0x695b('0x6a')]=_0xa8344d[_0x695b('0x68')][_0x695b('0x66')];return db[_0x695b('0x34')]['find']({'where':{'id':_0xa8344d[_0x695b('0x4b')]['id']}})[_0x695b('0x16')](handleEntityNotFound(_0x177ca4,null))[_0x695b('0x16')](saveUpdates(_0xa8344d[_0x695b('0x50')],null))[_0x695b('0x16')](respondWithResult(_0x177ca4,null))[_0x695b('0x20')](handleError(_0x177ca4,null));};exports[_0x695b('0x6b')]=function(_0xcaa570,_0x22f1a8){_0xcaa570['body'][_0x695b('0x6c')]=_0xcaa570[_0x695b('0x68')]['filename'];return db[_0x695b('0x34')][_0x695b('0x57')]({'where':{'id':_0xcaa570[_0x695b('0x4b')]['id']}})['then'](handleEntityNotFound(_0x22f1a8,null))[_0x695b('0x16')](saveUpdates(_0xcaa570[_0x695b('0x50')],null))['then'](respondWithResult(_0x22f1a8,null))['catch'](handleError(_0x22f1a8,null));};exports[_0x695b('0x6d')]=function(_0x2ba3a8,_0x167724){var _0x3b698d=path['join'](config[_0x695b('0x6e')],_0x695b('0x6f'));var _0x4e452b={'where':{'id':_0x2ba3a8[_0x695b('0x4b')]['id']},'attributes':['id',_0x695b('0x65')],'raw':!![]};var _0x2f1f54=![];return require(_0x695b('0x70'))[_0x695b('0x71')]()[_0x695b('0x16')](function(_0x3d87f6){if(_0x3d87f6){_0x2f1f54=_0x3d87f6[_0x695b('0x72')];}})[_0x695b('0x16')](function(){return db['ChatWebsite'][_0x695b('0x57')](_0x4e452b);})[_0x695b('0x16')](handleEntityNotFound(_0x167724,null))['then'](function(_0xfcadd5){if(_0xfcadd5){if(!_['isNil'](_0xfcadd5[_0x695b('0x65')])){if(fs['existsSync'](path[_0x695b('0x73')](config['root'],_0x695b('0x74'),_0xfcadd5['sitepic']))&&_0x2f1f54){_0x3b698d=path[_0x695b('0x73')](config[_0x695b('0x6e')],'server/files/images/logos/',_0xfcadd5[_0x695b('0x65')]);}}return _0x167724[_0x695b('0x75')](_0x3b698d);}})[_0x695b('0x20')](handleError(_0x167724,null));};exports[_0x695b('0x76')]=function(_0x3ae23a,_0x368167){var _0xcd5d75=path[_0x695b('0x73')](config[_0x695b('0x6e')],_0x695b('0x77'));var _0x128363={'where':{'id':_0x3ae23a[_0x695b('0x4b')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0x695b('0x34')][_0x695b('0x57')](_0x128363)[_0x695b('0x16')](handleEntityNotFound(_0x368167,null))['then'](function(_0xc37a1a){if(_0xc37a1a){if(!_[_0x695b('0x78')](_0xc37a1a[_0x695b('0x79')])){if(fs[_0x695b('0x7a')](path['join'](config[_0x695b('0x6e')],_0x695b('0x7b'),_0xc37a1a[_0x695b('0x79')]))){_0xcd5d75=path[_0x695b('0x73')](config[_0x695b('0x6e')],'server/files/images/avatars/',_0xc37a1a[_0x695b('0x79')]);}}return _0x368167[_0x695b('0x75')](_0xcd5d75);}})['catch'](handleError(_0x368167,null));};exports['getCustomerAvatar']=function(_0x4f3b00,_0xa072d5){var _0x226e5f=path['join'](config[_0x695b('0x6e')],_0x695b('0x7c'));var _0x4fdb52={'where':{'id':_0x4f3b00['params']['id']},'attributes':['id',_0x695b('0x6a'),_0x695b('0x7d')],'raw':!![]};return db[_0x695b('0x34')][_0x695b('0x57')](_0x4fdb52)[_0x695b('0x16')](handleEntityNotFound(_0xa072d5,null))[_0x695b('0x16')](function(_0x10e62d){if(_0x10e62d){if(!_[_0x695b('0x78')](_0x10e62d[_0x695b('0x6a')])){if(fs[_0x695b('0x7a')](path[_0x695b('0x73')](config['root'],_0x695b('0x7b'),_0x10e62d[_0x695b('0x6a')]))&&_0x10e62d[_0x695b('0x7d')]){_0x226e5f=path[_0x695b('0x73')](config['root'],_0x695b('0x7b'),_0x10e62d[_0x695b('0x6a')]);}}return _0xa072d5[_0x695b('0x75')](_0x226e5f);}})[_0x695b('0x20')](handleError(_0xa072d5,null));};exports[_0x695b('0x7e')]=function(_0x3e88e0,_0x2a01df){var _0x4e8c55=path[_0x695b('0x73')](config[_0x695b('0x6e')],_0x695b('0x7f'));var _0xd237fa={'where':{'id':_0x3e88e0[_0x695b('0x4b')]['id']},'attributes':['id',_0x695b('0x6c')],'raw':!![]};return db['ChatWebsite'][_0x695b('0x57')](_0xd237fa)[_0x695b('0x16')](handleEntityNotFound(_0x2a01df,null))[_0x695b('0x16')](function(_0x51e1e7){if(_0x51e1e7){if(!_[_0x695b('0x78')](_0x51e1e7[_0x695b('0x6c')])){if(fs[_0x695b('0x7a')](path['join'](config[_0x695b('0x6e')],_0x695b('0x7b'),_0x51e1e7[_0x695b('0x6c')]))){_0x4e8c55=path['join'](config[_0x695b('0x6e')],_0x695b('0x7b'),_0x51e1e7[_0x695b('0x6c')]);}}return _0x2a01df[_0x695b('0x75')](_0x4e8c55);}})[_0x695b('0x20')](handleError(_0x2a01df,null));};exports[_0x695b('0x80')]=function(_0x1d0317,_0x11cde9){var _0x53be05=require(_0x695b('0x81'));var _0xaa5bcd=new _0x53be05();var _0x53ab26=_0xaa5bcd['setUA'](_0x1d0317[_0x695b('0x82')][_0x695b('0x83')])[_0x695b('0x84')]();var _0x4a6254={'body':_0x1d0317[_0x695b('0x50')],'channel':'chat'};var _0x937e4f=[];var _0x1418b9=[];var _0xe619af={};var _0x3a90f7=![];return db[_0x695b('0x85')][_0x695b('0x58')]()['then'](function(_0x5a1b6e){if(!_0x5a1b6e){throw new db[(_0x695b('0x86'))]['ValidationError'](_0x695b('0x87'));}_0x937e4f=_['difference'](_[_0x695b('0x4c')](_0x5a1b6e),[_0x695b('0x88'),'updatedAt']);_0x1418b9=_['difference'](_[_0x695b('0x4c')](_0x5a1b6e),[_0x695b('0x88'),_0x695b('0x89'),_0x695b('0x8a'),_0x695b('0x8b')]);if(_0x1d0317[_0x695b('0x50')]['id']){delete _0x1d0317[_0x695b('0x50')]['id'];}if(_[_0x695b('0x78')](_0x1d0317[_0x695b('0x50')][_0x695b('0x8c')])){throw new db[(_0x695b('0x86'))][(_0x695b('0x8d'))](_0x695b('0x8e'));}if(_[_0x695b('0x78')](_0x1d0317[_0x695b('0x50')][_0x695b('0x50')])||_0x1d0317['body'][_0x695b('0x50')]===''){throw new db[(_0x695b('0x86'))][(_0x695b('0x8d'))](_0x695b('0x8f'));}if(_['isNil'](_0x1d0317['body']['mapKey'])){throw new db[(_0x695b('0x86'))][(_0x695b('0x8d'))](_0x695b('0x90')+_0x1418b9);}if(!_[_0x695b('0x91')](_0x1418b9,_0x1d0317[_0x695b('0x50')]['mapKey'])){throw new db[(_0x695b('0x86'))]['ValidationError'](_0x695b('0x92')+_0x1418b9);}_0xe619af[_0x1d0317[_0x695b('0x50')][_0x695b('0x93')]]=_0x1d0317['body'][_0x695b('0x8c')];})[_0x695b('0x16')](function(){return db[_0x695b('0x34')]['find']({'where':{'id':_0x1d0317[_0x695b('0x4b')]['id']},'include':[{'model':db[_0x695b('0x94')],'as':'List','include':[{'model':db[_0x695b('0x85')],'as':_0x695b('0x95'),'where':_0xe619af,'limit':0x1,'order':[[_0x695b('0x89'),_0x695b('0x96')]]}]},{'model':db['ChatApplication'],'as':'Applications'}]});})[_0x695b('0x16')](handleEntityNotFound(_0x11cde9,null))[_0x695b('0x16')](function(_0x15feeb){if(_0x15feeb&&_0x15feeb['List']){_0x4a6254[_0x695b('0x97')]=_0x15feeb;_0x4a6254['applications']=_0x15feeb['Applications'];_0x4a6254[_0x695b('0x98')]=_0x15feeb[_0x695b('0x99')];_0x4a6254[_0x695b('0x9a')]=_[_0x695b('0x9b')](_0x4a6254[_0x695b('0x9a')],[_0x695b('0x9c')],[_0x695b('0x9d')]);if(_0x4a6254[_0x695b('0x97')]['Applications']){delete _0x4a6254[_0x695b('0x97')]['Applications'];}if(_0x4a6254[_0x695b('0x97')][_0x695b('0x99')]&&_0x4a6254[_0x695b('0x97')][_0x695b('0x99')]['Contacts'][_0x695b('0x5d')]){return _0x4a6254[_0x695b('0x97')][_0x695b('0x99')][_0x695b('0x95')][0x0];}var _0x1819a2=_[_0x695b('0xd')](_0x1d0317['body'],{'firstName':_0x1d0317[_0x695b('0x50')][_0x695b('0x8c')],'ListId':_0x15feeb[_0x695b('0x8b')]});_0x1819a2[_0x1d0317[_0x695b('0x50')][_0x695b('0x93')]]=_0x1d0317[_0x695b('0x50')][_0x695b('0x8c')];return db['CmContact'][_0x695b('0x4f')](_0x1819a2,{'fields':_0x937e4f,'raw':!![]});}})[_0x695b('0x16')](handleEntityNotFound(_0x11cde9,null))['then'](function(_0x2f3b43){_0x4a6254[_0x695b('0x9e')]=_0x2f3b43;var _0x254c4f=_0x1d0317['body']['customerIp'];if(_0x1d0317[_0x695b('0x82')][_0x695b('0x9f')]){_0x254c4f=_0x1d0317[_0x695b('0x82')][_0x695b('0x9f')];}else if(_0x1d0317['headers'][_0x695b('0xa0')]){_0x254c4f=_[_0x695b('0xa1')](_0x1d0317[_0x695b('0x82')][_0x695b('0xa0')][_0x695b('0xa2')](','));}if(_0x2f3b43){var _0x1ca6cc={'ContactId':_0x2f3b43['id'],'ChatWebsiteId':_0x1d0317[_0x695b('0x4b')]['id'],'from':(_0x2f3b43[_0x695b('0xa3')]||'')+'\x20'+(_0x2f3b43['lastName']||''),'customerIp':_0x254c4f,'customerPort':_0x1d0317[_0x695b('0x82')][_0x695b('0xa4')]?_0x1d0317[_0x695b('0x82')]['x-real-port']:null,'referer':_0x1d0317['body'][_0x695b('0xa5')],'browserName':_0x53ab26[_0x695b('0xa6')]['name']&&_0x53ab26[_0x695b('0xa6')]['version']?util[_0x695b('0xa7')]('%s\x20%s',_0x53ab26['browser']['name'],_0x53ab26[_0x695b('0xa6')]['version']):_0x695b('0xa8'),'browserVersion':_0x53ab26[_0x695b('0xa6')][_0x695b('0xa9')]||'unknown','osName':util[_0x695b('0xa7')](_0x695b('0xaa'),_0x53ab26['os'][_0x695b('0x2f')],_0x53ab26['os']['version']),'osVersion':_0x53ab26['os'][_0x695b('0xa9')],'deviceModel':_0x53ab26[_0x695b('0xab')][_0x695b('0x37')]&&_0x53ab26[_0x695b('0xab')][_0x695b('0xac')]?util[_0x695b('0xa7')](_0x695b('0xad'),_0x53ab26[_0x695b('0xab')]['model'],_0x53ab26[_0x695b('0xab')][_0x695b('0xac')],_0x53ab26[_0x695b('0xab')][_0x695b('0x35')]):null,'deviceVendor':_0x53ab26['device'][_0x695b('0xac')],'deviceType':_0x53ab26['device'][_0x695b('0x35')],'formData':JSON[_0x695b('0xae')](_0x1d0317[_0x695b('0x50')])};var _0x4c1b9b={'ChatWebsiteId':_0x1d0317['params']['id'],'closed':![]};if(_0x1d0317['body']['threadId']){_0x4c1b9b[_0x695b('0xaf')]=_0x1d0317[_0x695b('0x50')][_0x695b('0xaf')];return db['ChatInteraction'][_0x695b('0x57')]({'where':_0x4c1b9b})['then'](function(_0x423044){if(_0x423044){return[_0x423044,![]];}_0x1ca6cc[_0x695b('0xaf')]=_0x1d0317['body'][_0x695b('0xaf')];_0x1ca6cc['externalUrl']=_0x1d0317[_0x695b('0x50')]['externalUrl'];return db['ChatInteraction'][_0x695b('0x4f')](_0x1ca6cc)[_0x695b('0x16')](function(_0x3bb880){return[_0x3bb880,!![]];});});}_0x4c1b9b[_0x695b('0xb0')]=_0x2f3b43['id'];if(_0x1d0317['body']['interaction']&&_0x1d0317[_0x695b('0x50')][_0x695b('0xb1')]['id']){_0x4c1b9b['id']=_0x1d0317[_0x695b('0x50')][_0x695b('0xb1')]['id'];return db['ChatInteraction'][_0x695b('0x57')]({'where':_0x4c1b9b})[_0x695b('0x16')](function(_0x7bf4c6){if(_0x7bf4c6){return[_0x7bf4c6,![]];}return db[_0x695b('0xb2')][_0x695b('0x4f')](_0x1ca6cc)[_0x695b('0x16')](function(_0x253dc1){return[_0x253dc1,!![]];});});}return db[_0x695b('0xb2')][_0x695b('0x4f')](_0x1ca6cc)[_0x695b('0x16')](function(_0x5e0b67){return[_0x5e0b67,!![]];});}})[_0x695b('0xb3')](function(_0x5962d2,_0x13ba4d){if(_0x5962d2){_0x3a90f7=_0x13ba4d;if(!_0x13ba4d){var _0x46096b={'from':(_0x4a6254[_0x695b('0x9e')][_0x695b('0xa3')]||'')+'\x20'+(_0x4a6254[_0x695b('0x9e')][_0x695b('0xb4')]||'')};if(_0x1d0317[_0x695b('0x50')]['threadId']&&_0x1d0317['body'][_0x695b('0xb5')]&&_0x1d0317['body']['threadId']!=_0x1d0317[_0x695b('0x50')]['messageId']){_0x46096b[_0x695b('0xaf')]=_0x1d0317['body'][_0x695b('0xb5')];}return _0x5962d2[_0x695b('0x2a')](_0x46096b);}else{return _0x5962d2;}}})[_0x695b('0x16')](function(_0x81455e){_0x4a6254[_0x695b('0xb1')]=_0x81455e['get']({'plain':!![]});_0x4a6254[_0x695b('0xb1')][_0x695b('0xb6')]=_0x3a90f7;if(_0x4a6254[_0x695b('0xb1')][_0x695b('0xb6')]){if(_0x4a6254[_0x695b('0x97')][_0x695b('0xb7')]){_0x4a6254[_0x695b('0x9a')][_0x695b('0xb8')]({'id':0x0,'priority':_0x4a6254[_0x695b('0x9a')][_0x695b('0x5d')]+0x1,'app':_0x695b('0xb9'),'appdata':'unmanaged','interval':_0x695b('0xba')});}}return db[_0x695b('0xbb')][_0x695b('0x4f')]({'body':_0x1d0317[_0x695b('0x50')][_0x695b('0x50')],'ChatWebsiteId':_0x1d0317['params']['id'],'ChatInteractionId':_0x81455e['id'],'direction':'in','ContactId':_0x4a6254[_0x695b('0x9e')]['id'],'AttachmentId':_0x1d0317['body'][_0x695b('0xbc')]});})[_0x695b('0x16')](function(_0x58f198){_0x4a6254[_0x695b('0x1e')]=_0x58f198;if(_0x4a6254[_0x695b('0xb1')][_0x695b('0xbd')]){return db[_0x695b('0xbe')][_0x695b('0x57')]({'attributes':['id',_0x695b('0x2f')],'where':{'id':_0x4a6254['interaction'][_0x695b('0xbd')]}})['then'](function(_0x5ad216){if(_0x5ad216){_0x4a6254[_0x695b('0x9a')][_0x695b('0xbf')]({'id':0x0,'priority':0x0,'app':_0x695b('0xc0'),'appdata':_0x5ad216['name']+','+(_0x4a6254[_0x695b('0x97')][_0x695b('0xc1')]||0xa),'interval':_0x695b('0xba')});_0x4a6254['forcedOwnership']=!![];}return respondWithRpcPromise(_0x695b('0xc2'),_0x695b('0xc3'),_0x4a6254);});}return respondWithRpcPromise('Start',_0x695b('0xc3'),_0x4a6254);})['then'](function(_0x3952e1){respondWithRpcPromise('EventManager',_0x695b('0xc4'),{'event':_0x695b('0x80'),'message':_0x3952e1},client9002);return _0x3952e1;})[_0x695b('0x16')](respondWithResult(_0x11cde9,null))[_0x695b('0x20')](handleError(_0x11cde9,null));};exports['offline']=function(_0x47c763,_0x1c913c){var _0x91c4e5,_0x3d8361,_0x51de58;var _0x5712bc=[];var _0x3babf7={};var _0x3f01fe=_0x47c763[_0x695b('0xc5')]||[];var _0x37c31c=[];var _0x3b4d4f;return db[_0x695b('0x85')]['describe']()['then'](function(_0x51165b){if(!_0x51165b){throw new db[(_0x695b('0x86'))][(_0x695b('0x8d'))]('no\x20available\x20attributes');}_0x5712bc=_[_0x695b('0xc6')](_[_0x695b('0x4c')](_0x51165b),[_0x695b('0x88'),'updatedAt',_0x695b('0x8a'),'ListId']);if(_0x47c763[_0x695b('0x50')]['id']){delete _0x47c763['body']['id'];}if(_[_0x695b('0x78')](_0x47c763['body'][_0x695b('0x8c')])){throw _0x1c913c[_0x695b('0x22')](0x1f4)[_0x695b('0x30')](new db[(_0x695b('0x86'))][(_0x695b('0x8d'))]('from\x20is\x20mandatory'));}if(_[_0x695b('0x78')](_0x47c763[_0x695b('0x50')]['body'])||_0x47c763[_0x695b('0x50')][_0x695b('0x50')]===''){throw _0x1c913c[_0x695b('0x22')](0x1f4)[_0x695b('0x30')](new db[(_0x695b('0x86'))][(_0x695b('0x8d'))](_0x695b('0x8f')));}if(_['isNil'](_0x47c763[_0x695b('0x50')][_0x695b('0xc7')])){throw _0x1c913c['status'](0x1f4)[_0x695b('0x30')](new db[(_0x695b('0x86'))][(_0x695b('0x8d'))]('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x5712bc));}if(!_[_0x695b('0x91')](_0x5712bc,_0x47c763[_0x695b('0x50')][_0x695b('0xc7')])){throw _0x1c913c[_0x695b('0x22')](0x1f4)['send'](new db['Sequelize'][(_0x695b('0x8d'))](_0x695b('0xc8')+_0x5712bc));}_0x3babf7[_0x47c763['body'][_0x695b('0xc7')]]=_0x47c763[_0x695b('0x50')][_0x695b('0x8c')];})[_0x695b('0x16')](function(){return db[_0x695b('0x34')][_0x695b('0x57')]({'where':{'id':_0x47c763[_0x695b('0x4b')]['id']},'include':[{'model':db[_0x695b('0x94')],'as':_0x695b('0x99')},{'model':db['MailAccount'],'as':_0x695b('0xc9')}]});})[_0x695b('0x16')](handleEntityNotFound(_0x1c913c,null))[_0x695b('0x16')](function(_0x5a0ef5){if(_0x5a0ef5&&_0x5a0ef5['List']){_0x3d8361=_0x5a0ef5;var _0x541e45=_[_0x695b('0xd')](_0x47c763[_0x695b('0x50')],{'firstName':_0x47c763['body'][_0x695b('0x8c')],'phone':_0x47c763[_0x695b('0x50')][_0x695b('0x8c')],'ListId':_0x5a0ef5[_0x695b('0x8b')]});_0x541e45[_0x47c763['body'][_0x695b('0xc7')]]=_0x47c763['body'][_0x695b('0x8c')];return db[_0x695b('0x85')][_0x695b('0xca')]({'where':_0x3babf7,'defaults':_0x541e45});}})[_0x695b('0xb3')](function(_0xcf7387){if(_0xcf7387){_0x51de58=_0xcf7387;var _0x2f0a61=fs['readFileSync'](path[_0x695b('0x73')](config[_0x695b('0x6e')],_0x695b('0xcb')),_0x695b('0xcc'));var _0xae9b92=ejs['render'](_0x2f0a61,{'body':_[_0x695b('0xcd')](_0x47c763[_0x695b('0x50')]['body']),'bodyTitle':_0x3d8361[_0x695b('0xce')]});return db[_0x695b('0xcf')][_0x695b('0x4f')]({'body':_0xae9b92,'plainBody':htmlToText[_0x695b('0xd0')](_0xae9b92),'ContactId':_0xcf7387['id'],'ChatWebsiteId':_0x3d8361['id']});}})[_0x695b('0x16')](function(_0x18cf5){_0x3b4d4f=_0x18cf5;if(_0x3f01fe[_0x695b('0x5d')]){var _0x1c0e82=_0x3f01fe[_0x695b('0x38')](function(_0x1426f6){return{'name':_0x1426f6['originalname'],'basename':_0x1426f6['filename'],'type':_0x1426f6[_0x695b('0xd1')],'ChatOfflineMessageId':_0x18cf5['id']};});_0x37c31c=_0x1c0e82['map'](_0x174818=>{var _0x29c3b2={'filename':_0x174818[_0x695b('0x2f')],'path':path[_0x695b('0x73')](config[_0x695b('0x6e')],_0x695b('0xd2'),_0x695b('0xc5'),_0x695b('0xd3'),'offline-chat',_0x174818[_0x695b('0xd4')])};return _0x29c3b2;});if(!_0x3d8361[_0x695b('0xd5')]){return db[_0x695b('0xd6')][_0x695b('0xd7')](function(_0x6484da){return db[_0x695b('0xd8')][_0x695b('0xd9')](_0x1c0e82,{'transaction':_0x6484da});});}}})['then'](function(){if(_0x3b4d4f){_0x91c4e5=_0x3b4d4f;return db['MailAccount']['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x695b('0xda')],'as':'Smtp','raw':!![],'include':[{'model':db[_0x695b('0xdb')],'as':_0x695b('0xdb'),'raw':!![]}]}]});}})[_0x695b('0x16')](function(_0x6ddac6){if(_0x6ddac6&&_0x6ddac6['Smtp']&&_0x3d8361[_0x695b('0xdc')]&&_0x3d8361[_0x695b('0xdd')]){var _0x3a5575=_0x6ddac6['getSmtpOptions']();return respondWithRpcPromise(_0x695b('0xde'),_0x695b('0xdf'),{'account':_0x3a5575,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0x6ddac6[_0x695b('0x2f')],_0x6ddac6[_0x695b('0xe0')]||_0x6ddac6[_0x695b('0xe1')]['user']),'to':_0x3d8361[_0x695b('0xdd')],'subject':_0x3d8361[_0x695b('0xe2')],'html':_0x91c4e5[_0x695b('0x50')],'attachments':_0x37c31c}},client9003)[_0x695b('0x16')](function(){return _0x91c4e5;})[_0x695b('0x20')](function(_0x49311e){logger[_0x695b('0x1c')](_0x49311e);});}})[_0x695b('0x16')](function(){if(_0x3d8361&&_0x3d8361[_0x695b('0xd5')]&&_0x3d8361[_0x695b('0xe3')]){var _0x1a8df4=[];if(_0x3f01fe['length']){_0x1a8df4=_0x3f01fe[_0x695b('0x38')](function(_0x24f29d){return{'name':_0x24f29d['originalname'],'basename':_0x24f29d['filename'],'type':_0x24f29d[_0x695b('0xd1')],'ChatOfflineMessageId':_0x3b4d4f['id']};});}var _0x19d1a6;if(!_[_0x695b('0x78')](_0x3d8361[_0x695b('0xe4')])){var _0x41dbc0=_[_0x695b('0x38')](_0x47c763[_0x695b('0x50')],function(_0x2af248){return _0x2af248;});var _0x315d57=_[_0x695b('0xe5')](_0x41dbc0)[0x0];var _0x2c06f1=_['mapValues'](_0x315d57,function(_0x52f281){return _0x52f281;});_0x19d1a6=_0x2c06f1[0x1][_0x3d8361[_0x695b('0xe4')]];}var _0x58a56e={'from':_0x51de58[_0x695b('0xe0')],'firstName':_0x51de58[_0x695b('0xa3')],'lastName':_0x51de58[_0x695b('0xb4')],'mapKey':_0x695b('0xe0'),'message':{'from':_0x51de58[_0x695b('0xe0')],'to':_0x3d8361[_0x695b('0xc9')][_0x695b('0xe0')],'cc':'','subject':_[_0x695b('0x78')](_0x19d1a6)?_0x3d8361[_0x695b('0xe2')]:_0x19d1a6,'messageId':'','sentAt':new Date(),'attach':_0x1a8df4[_0x695b('0x5d')],'attachments':_0x1a8df4,'originChannel':_0x695b('0xe6'),'ChatWebsiteId':_0x3d8361['id'],'ChatOfflineMessageId':_0x91c4e5['id'],'originTo':_0x3d8361[_0x695b('0xc9')][_0x695b('0xe0')]},'body':_0x91c4e5[_0x695b('0x50')]};var _0x511095={'account':{'id':_0x3d8361['MailAccountId']},'body':_0x58a56e,'log':_0x695b('0xe7')};return respondWithRpcPromise(_0x695b('0xe7'),_0x695b('0xe8'),_0x511095,client9001)['then'](function(){return _0x91c4e5;})[_0x695b('0x20')](function(_0x2fdccc){logger[_0x695b('0x1c')](_0x2fdccc);});}return;})[_0x695b('0x16')](function(){if(_0x91c4e5){return _0x91c4e5;}})['then'](respondWithResult(_0x1c913c,null))[_0x695b('0x20')](function(_0x2a2dc7){logger['error'](_0x695b('0x20'),_0x2a2dc7);for(var _0xa8cb31 of _0x3f01fe){var _0x269a9e=path[_0x695b('0x73')](config[_0x695b('0x6e')],_0x695b('0xd2'),_0x695b('0xc5'),_0x695b('0xd3'),_0x695b('0xe9'),_0xa8cb31[_0x695b('0x66')]);fs_extra[_0x695b('0xea')](_0x269a9e)[_0x695b('0x20')](function(_0xac5cf2){logger[_0x695b('0x1c')](_0x695b('0xeb'),_0x269a9e,_0xac5cf2);});}});};exports[_0x695b('0xec')]=function(_0x5b42a2,_0x5da510){return db[_0x695b('0xb2')][_0x695b('0x57')]({'where':{'id':_0x5b42a2[_0x695b('0x4b')]['id']}})[_0x695b('0x16')](handleEntityNotFound(_0x5da510,null))[_0x695b('0x16')](function(_0x4e1ce3){if(_0x4e1ce3){return _0x4e1ce3[_0x695b('0xec')](_0x5b42a2[_0x695b('0x50')][_0x695b('0x60')],_[_0x695b('0xed')](_0x5b42a2[_0x695b('0x50')],['ids','id'])||{});}})['then'](respondWithResult(_0x5da510,null))[_0x695b('0x20')](handleError(_0x5da510,null));};exports[_0x695b('0xee')]=function(_0x1f3264,_0x43f9ba){var _0x25f421={'raw':![],'where':{}};var _0x50a788={};var _0x3e0ff1={'count':0x0,'rows':[]};return db[_0x695b('0x34')]['findOne']({'where':{'id':_0x1f3264[_0x695b('0x4b')]['id']}})[_0x695b('0x16')](handleEntityNotFound(_0x43f9ba,null))[_0x695b('0x16')](function(_0x5dff7a){if(_0x5dff7a){_0x50a788[_0x695b('0x37')]=_['keys'](db[_0x695b('0xb2')][_0x695b('0x4d')]);_0x50a788[_0x695b('0x39')]=_[_0x695b('0x4c')](_0x1f3264['query']);_0x50a788[_0x695b('0x3a')]=_[_0x695b('0x3b')](_0x50a788['model'],_0x50a788[_0x695b('0x39')]);_0x25f421[_0x695b('0x3c')]=_['intersection'](_0x50a788[_0x695b('0x37')],qs[_0x695b('0x3d')](_0x1f3264[_0x695b('0x39')]['fields']));_0x25f421['attributes']=_0x25f421[_0x695b('0x3c')][_0x695b('0x5d')]?_0x25f421[_0x695b('0x3c')]:_0x50a788[_0x695b('0x37')];if(!_0x1f3264[_0x695b('0x39')][_0x695b('0x3e')]('nolimit')){_0x25f421[_0x695b('0x28')]=qs[_0x695b('0x28')](_0x1f3264[_0x695b('0x39')][_0x695b('0x28')]);_0x25f421['offset']=qs[_0x695b('0x27')](_0x1f3264[_0x695b('0x39')][_0x695b('0x27')]);}_0x25f421[_0x695b('0x40')]=qs[_0x695b('0x41')](_0x1f3264[_0x695b('0x39')][_0x695b('0x41')]);_0x25f421[_0x695b('0x42')]=qs['filters'](_[_0x695b('0x43')](_0x1f3264[_0x695b('0x39')],_0x50a788[_0x695b('0x3a')]));_0x25f421[_0x695b('0x42')][_0x695b('0x5e')]=_0x5dff7a['id'];if(_0x1f3264['query']['filter']){_0x25f421[_0x695b('0x42')]=_[_0x695b('0x46')](_0x25f421[_0x695b('0x42')],{'$or':_[_0x695b('0x38')](_0x25f421[_0x695b('0x3c')],function(_0x2800c2){var _0x5d7501={};_0x5d7501[_0x2800c2]={'$like':'%'+_0x1f3264['query'][_0x695b('0x44')]+'%'};return _0x5d7501;})});}_0x25f421=_[_0x695b('0x46')]({},_0x25f421,_0x1f3264[_0x695b('0x47')]);return db[_0x695b('0xb2')][_0x695b('0x26')]({'where':_0x25f421['where']})[_0x695b('0x16')](function(_0x116352){_0x3e0ff1[_0x695b('0x26')]=_0x116352;if(_0x1f3264[_0x695b('0x39')][_0x695b('0x48')]){_0x25f421['include']=[{'model':db[_0x695b('0x85')],'as':'Contact','required':![]},{'model':db[_0x695b('0xbe')],'as':_0x695b('0xef'),'attributes':[_0x695b('0x2f'),'fullname',_0x695b('0xf0')],'required':![]},{'model':db[_0x695b('0xf1')],'as':_0x695b('0xf2'),'attributes':['id','name',_0x695b('0xf3')],'where':_0x1f3264['query'][_0x695b('0xf4')]?{'id':_0x1f3264[_0x695b('0x39')][_0x695b('0xf4')]}:undefined,'required':_0x1f3264['query'][_0x695b('0xf4')]?!![]:![]}];}return db[_0x695b('0xb2')]['findAll'](_0x25f421);})[_0x695b('0x16')](function(_0x3507e0){_0x3e0ff1['rows']=_0x3507e0;return _0x3e0ff1;});}})['then'](respondWithFilteredResult(_0x43f9ba,_0x25f421))['catch'](handleError(_0x43f9ba,null));};function iftimePromise(_0x288474,_0xdf18f0){return respondWithRpcPromise(_0x695b('0xf5'),'getSnippet',{'command':_0xdf18f0[_0x695b('0xf6')]?util[_0x695b('0xa7')](_0x695b('0xf7'),_0x288474[_0x695b('0xf8')],_0xdf18f0['timezone']):util[_0x695b('0xa7')](_0x695b('0xf9'),_0x288474['interval'])},client9002)[_0x695b('0x16')](function(_0x575881){var _0x14a25b=_0x575881&&_0x575881[_0x695b('0xfa')](_0x695b('0xfb'))>=0x0?!![]:![];logger[_0x695b('0x17')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0xdf18f0['id'],_0x288474['id'],_0x288474[_0x695b('0xf8')],_0x14a25b?_0x695b('0xfc'):'OFFLINE',_0xdf18f0[_0x695b('0xf6')]?_0xdf18f0['timezone']:'No\x20timezone');return _0x14a25b;})[_0x695b('0x20')](function(_0x253d87){logger[_0x695b('0x1c')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0xdf18f0['id'],_0x288474['id'],_0x288474[_0x695b('0xf8')],util[_0x695b('0xfd')](_0x253d87,{'showHidden':![],'depth':null}),_0xdf18f0['timezone']?_0xdf18f0[_0x695b('0xf6')]:_0x695b('0xfe'));return![];});}exports[_0x695b('0xff')]=function(_0x35a7cf,_0x4ca8c8){var _0x32f940=0x0;var _0x292cec=0x0;var _0x29f2b8=![];var _0x4b485f;var _0x3deedf;return db[_0x695b('0x34')][_0x695b('0x57')]({'where':{'id':_0x35a7cf[_0x695b('0x4b')]['id']},'include':[{'model':db[_0x695b('0x100')],'as':_0x695b('0x100'),'include':[{'model':db[_0x695b('0x100')],'as':'Intervals','attributes':['id',_0x695b('0xf8')],'raw':!![]}]}]})[_0x695b('0x16')](handleEntityNotFound(_0x4ca8c8,null))['then'](function(_0x448d7d){if(_0x448d7d){_0x4b485f=_0x448d7d;return _0x448d7d[_0x695b('0x101')]({'raw':!![]});}})[_0x695b('0x16')](function(_0x236569){if(_0x4b485f){if(_0x236569){_0x3deedf=_0x236569;}}return require(_0x695b('0x70'))[_0x695b('0x71')]();})[_0x695b('0x16')](function(_0x15ea98){if(_0x15ea98){_0x292cec=_0x15ea98[_0x695b('0x102')];_0x29f2b8=_0x15ea98[_0x695b('0x72')];}})[_0x695b('0x16')](function(){return db[_0x695b('0xb2')][_0x695b('0x26')]({'where':{'closed':![]}});})[_0x695b('0x16')](function(_0x334c7b){_0x32f940=_0x334c7b;if(_0x292cec&&_0x334c7b>_0x292cec){return db[_0x695b('0x103')][_0x695b('0x5c')]({'where':{'id':0x1}})[_0x695b('0x16')](function(_0x540b44){if(_0x540b44){_0x540b44[_0x695b('0x104')]('chatLicenseExceeded');}});}})[_0x695b('0x16')](function(){if(_0x4b485f[_0x695b('0x100')]&&_0x4b485f[_0x695b('0x100')][_0x695b('0x105')]){var _0x39d369=[];for(var _0x268a24=0x0;_0x268a24<_0x4b485f[_0x695b('0x100')][_0x695b('0x105')][_0x695b('0x5d')];_0x268a24++){var _0x1f0cf2=_0x4b485f[_0x695b('0x100')][_0x695b('0x105')][_0x268a24][_0x695b('0x2c')]({'plain':!![]});_0x39d369['push'](iftimePromise(_0x1f0cf2,_0x4b485f));}return BPromise['all'](_0x39d369)[_0x695b('0x16')](function(_0x2e4eb9){return _['some'](_0x2e4eb9);});}else{return!![];}})[_0x695b('0x16')](function(_0x11643f){var _0x45bd98=fs[_0x695b('0x106')](path[_0x695b('0x73')](config[_0x695b('0x6e')],'server/files/chat/iframe.ejs'),'utf8');var _0x36496a={'remote':_0x4b485f[_0x695b('0x107')],'query':querystring[_0x695b('0xae')](_[_0x695b('0x46')](_0x4b485f[_0x695b('0x2c')]({'plain':!![]}),{'customerIp':_0x35a7cf[_0x695b('0x82')]['x-forwarded-for']||_0x35a7cf[_0x695b('0x82')][_0x695b('0x108')]||_0x35a7cf['connection'][_0x695b('0x109')]||_0x35a7cf['ip'],'referer':_0x35a7cf[_0x695b('0x82')][_0x695b('0xa5')],'openedInteractions':_0x32f940,'maxInteractions':_0x292cec,'virtual':_0x29f2b8[_0x695b('0x102')],'online':_0x11643f,'custom':_0x29f2b8}))[_0x695b('0x10a')](/'/g,'\x5c\x27')};_0x4ca8c8['send'](ejs[_0x695b('0x10b')](Mustache['render'](_0x45bd98,_0x36496a),{'proactiveActions':_0x3deedf,'alignment':_0x4b485f[_0x695b('0x10c')],'verticalAlignment':_0x4b485f[_0x695b('0x10d')],'div_color':_0x4b485f['color'],'labelText':_0x4b485f[_0x695b('0x10e')],'text_color':_0x4b485f['textColor'],'text_button_color':_0x4b485f[_0x695b('0x10f')],'button_color':_0x4b485f[_0x695b('0x110')],'background_color':_0x4b485f[_0x695b('0x111')],'hideWhenOffline':_0x4b485f[_0x695b('0x112')],'interval':_0x4b485f[_0x695b('0x113')]}));})[_0x695b('0x20')](handleError(_0x4ca8c8,null));};exports[_0x695b('0x114')]=function(_0x3bd97c,_0x20b7fb){var _0x31a0d6=_0x3bd97c[_0x695b('0x4b')]['id'];var _0x15fce2=_0x3bd97c[_0x695b('0x50')];var _0x2a9f25=0xc8;var _0x15fb59=null;return db[_0x695b('0xd6')]['transaction']({'isolationLevel':db[_0x695b('0xd6')]['Transaction'][_0x695b('0x115')][_0x695b('0x116')]},function(_0x3732ef){return db[_0x695b('0x34')][_0x695b('0x5c')]({'where':{'id':_0x31a0d6},'transaction':_0x3732ef})[_0x695b('0x16')](function(_0x4b555d){if(_0x4b555d){return db[_0x695b('0x117')][_0x695b('0x2b')]({'where':{'ChatWebsiteId':_0x31a0d6},'transaction':_0x3732ef})[_0x695b('0x16')](function(){var _0x4d152e=_['map'](_0x15fce2,function(_0x29b92f){_0x29b92f[_0x695b('0x5e')]=_0x31a0d6;return _0x29b92f;});return db['ChatApplication'][_0x695b('0xd9')](_0x4d152e,{'transaction':_0x3732ef});});}else{_0x2a9f25=0x194;_0x15fb59=[];}});})[_0x695b('0x16')](function(){if(_0x2a9f25!==0x194){return db[_0x695b('0x117')][_0x695b('0x118')]({'where':{'ChatWebsiteId':_0x31a0d6},'order':'priority'})[_0x695b('0x16')](function(_0x5d7406){_0x15fb59=_0x5d7406;});}})[_0x695b('0x20')](function(_0x198b27){_0x2a9f25=0x1f4;logger[_0x695b('0x1c')](_0x198b27[_0x695b('0x119')]);if(_0x198b27[_0x695b('0x2f')]){delete _0x198b27[_0x695b('0x2f')];}_0x15fb59=_0x198b27;})[_0x695b('0x11a')](function(){if(_0x15fb59===null){_0x20b7fb['sendStatus'](_0x2a9f25);}else{if(_0x2a9f25===0x1f4){_0x20b7fb[_0x695b('0x22')](_0x2a9f25)['send'](_0x15fb59);}else{_0x20b7fb[_0x695b('0x22')](_0x2a9f25)[_0x695b('0x24')](_0x15fb59);}}});};exports[_0x695b('0x11b')]=function(_0x2c10a8,_0x4f1494){var _0x5b8151={};var _0x41d525={};var _0x2e376a;var _0x456af8;return db[_0x695b('0x34')][_0x695b('0x5c')]({'where':{'id':_0x2c10a8['params']['id']}})[_0x695b('0x16')](handleEntityNotFound(_0x4f1494,null))[_0x695b('0x16')](function(_0x39edc9){if(_0x39edc9){_0x2e376a=_0x39edc9;_0x41d525[_0x695b('0x37')]=_['keys'](db[_0x695b('0x117')][_0x695b('0x4d')]);_0x41d525['query']=_[_0x695b('0x4c')](_0x2c10a8[_0x695b('0x39')]);_0x41d525[_0x695b('0x3a')]=_[_0x695b('0x3b')](_0x41d525[_0x695b('0x37')],_0x41d525[_0x695b('0x39')]);_0x5b8151[_0x695b('0x3c')]=_[_0x695b('0x3b')](_0x41d525[_0x695b('0x37')],qs['fields'](_0x2c10a8[_0x695b('0x39')]['fields']));_0x5b8151[_0x695b('0x3c')]=_0x5b8151[_0x695b('0x3c')][_0x695b('0x5d')]?_0x5b8151[_0x695b('0x3c')]:_0x41d525[_0x695b('0x37')];_0x5b8151[_0x695b('0x40')]=qs[_0x695b('0x41')](_0x2c10a8['query'][_0x695b('0x41')]);_0x5b8151[_0x695b('0x42')]=qs[_0x695b('0x3a')](_['pick'](_0x2c10a8[_0x695b('0x39')],_0x41d525['filters']));if(_0x2c10a8[_0x695b('0x39')][_0x695b('0x44')]){_0x5b8151[_0x695b('0x42')]=_[_0x695b('0x46')](_0x5b8151[_0x695b('0x42')],{'$or':_[_0x695b('0x38')](_0x5b8151[_0x695b('0x3c')],function(_0x543dad){var _0x5e0613={};_0x5e0613[_0x543dad]={'$like':'%'+_0x2c10a8[_0x695b('0x39')][_0x695b('0x44')]+'%'};return _0x5e0613;})});}_0x5b8151=_[_0x695b('0x46')]({},_0x5b8151,_0x2c10a8['options']);return _0x2e376a[_0x695b('0x11b')](_0x5b8151);}})[_0x695b('0x16')](function(_0x328b2a){if(_0x328b2a){_0x456af8=_0x328b2a['length'];if(!_0x2c10a8[_0x695b('0x39')][_0x695b('0x3e')](_0x695b('0x3f'))){_0x5b8151[_0x695b('0x28')]=qs['limit'](_0x2c10a8[_0x695b('0x39')][_0x695b('0x28')]);_0x5b8151[_0x695b('0x27')]=qs[_0x695b('0x27')](_0x2c10a8['query'][_0x695b('0x27')]);}return _0x2e376a[_0x695b('0x11b')](_0x5b8151);}})[_0x695b('0x16')](function(_0x2d2e14){if(_0x2d2e14){return _0x2d2e14?{'count':_0x456af8,'rows':_0x2d2e14}:null;}})[_0x695b('0x16')](respondWithResult(_0x4f1494,null))[_0x695b('0x20')](handleError(_0x4f1494,null));};exports[_0x695b('0x11c')]=function(_0x4dc607,_0x52b126){return db[_0x695b('0x11d')][_0x695b('0x57')]({'where':{'id':_0x4dc607['params']['id']}})[_0x695b('0x16')](handleEntityNotFound(_0x52b126,null))['then'](function(_0x27a671){if(_0x27a671){return _0x27a671[_0x695b('0x11c')](_0x4dc607['body'][_0x695b('0x60')],_[_0x695b('0xed')](_0x4dc607[_0x695b('0x50')],['ids','id'])||{});}})[_0x695b('0x16')](respondWithResult(_0x52b126,null))[_0x695b('0x20')](handleError(_0x52b126,null));};exports[_0x695b('0x101')]=function(_0x55b487,_0x5a7a96){var _0x513a71={};var _0x3b54a0={};var _0x43f26f;var _0x446d27;return db[_0x695b('0x34')][_0x695b('0x5c')]({'where':{'id':_0x55b487[_0x695b('0x4b')]['id']}})['then'](handleEntityNotFound(_0x5a7a96,null))[_0x695b('0x16')](function(_0x1f08d2){if(_0x1f08d2){_0x43f26f=_0x1f08d2;_0x3b54a0[_0x695b('0x37')]=_[_0x695b('0x4c')](db[_0x695b('0x11e')][_0x695b('0x4d')]);_0x3b54a0[_0x695b('0x39')]=_[_0x695b('0x4c')](_0x55b487['query']);_0x3b54a0[_0x695b('0x3a')]=_['intersection'](_0x3b54a0[_0x695b('0x37')],_0x3b54a0[_0x695b('0x39')]);_0x513a71[_0x695b('0x3c')]=_[_0x695b('0x3b')](_0x3b54a0[_0x695b('0x37')],qs['fields'](_0x55b487[_0x695b('0x39')]['fields']));_0x513a71['attributes']=_0x513a71['attributes']['length']?_0x513a71[_0x695b('0x3c')]:_0x3b54a0[_0x695b('0x37')];_0x513a71[_0x695b('0x40')]=qs[_0x695b('0x41')](_0x55b487[_0x695b('0x39')][_0x695b('0x41')]);_0x513a71[_0x695b('0x42')]=qs[_0x695b('0x3a')](_[_0x695b('0x43')](_0x55b487[_0x695b('0x39')],_0x3b54a0[_0x695b('0x3a')]));if(_0x55b487['query'][_0x695b('0x44')]){_0x513a71['where']=_['merge'](_0x513a71[_0x695b('0x42')],{'$or':_[_0x695b('0x38')](_0x513a71[_0x695b('0x3c')],function(_0x4516a3){var _0x312b06={};_0x312b06[_0x4516a3]={'$like':'%'+_0x55b487['query']['filter']+'%'};return _0x312b06;})});}_0x513a71=_['merge']({},_0x513a71,_0x55b487[_0x695b('0x47')]);return _0x43f26f[_0x695b('0x101')](_0x513a71);}})['then'](function(_0x514a77){if(_0x514a77){_0x446d27=_0x514a77[_0x695b('0x5d')];if(!_0x55b487[_0x695b('0x39')][_0x695b('0x3e')](_0x695b('0x3f'))){_0x513a71[_0x695b('0x28')]=qs[_0x695b('0x28')](_0x55b487[_0x695b('0x39')]['limit']);_0x513a71['offset']=qs[_0x695b('0x27')](_0x55b487[_0x695b('0x39')][_0x695b('0x27')]);}return _0x43f26f[_0x695b('0x101')](_0x513a71);}})[_0x695b('0x16')](function(_0x414f64){if(_0x414f64){return _0x414f64?{'count':_0x446d27,'rows':_0x414f64}:null;}})[_0x695b('0x16')](respondWithResult(_0x5a7a96,null))[_0x695b('0x20')](handleError(_0x5a7a96,null));};exports[_0x695b('0x11f')]=function(_0x19def8,_0x40a385){var _0x5e8710=_0x19def8[_0x695b('0x39')]['online']==='false'?_0x695b('0x120'):'onlineForm';return db[_0x695b('0x34')][_0x695b('0x57')]({'attributes':['id',_0x5e8710],'where':{'id':_0x19def8[_0x695b('0x4b')]['id']}})[_0x695b('0x16')](handleEntityNotFound(_0x40a385,null))['then'](function(_0x2ad7f9){if(_0x2ad7f9){var _0x3d3353=_0x2ad7f9[_0x5e8710];var _0x2f1b2f=_0x3d3353&&_0x3d3353[_0x695b('0x121')]?_0x3d3353[_0x695b('0x121')]:[];_0x40a385[_0x695b('0x30')]({'fromKey':_[_0x695b('0x78')](_0x3d3353[_0x695b('0x122')])?undefined:_0x3d3353[_0x695b('0x122')],'count':_0x2f1b2f[_0x695b('0x5d')],'rows':_0x2f1b2f});}})['catch'](handleError(_0x40a385,null));};exports['getOfflineMessages']=function(_0x1dbba0,_0xcad2b9){var _0x16a1e9={'raw':![],'where':{}};var _0x3ad505={};var _0x5acee5={'count':0x0,'rows':[]};return db[_0x695b('0x34')]['findOne']({'where':{'id':_0x1dbba0[_0x695b('0x4b')]['id']}})[_0x695b('0x16')](handleEntityNotFound(_0xcad2b9,null))[_0x695b('0x16')](function(_0x2e7294){if(_0x2e7294){_0x3ad505[_0x695b('0x37')]=_[_0x695b('0x4c')](db[_0x695b('0xcf')]['rawAttributes']);_0x3ad505[_0x695b('0x39')]=_[_0x695b('0x4c')](_0x1dbba0[_0x695b('0x39')]);_0x3ad505[_0x695b('0x3a')]=_['intersection'](_0x3ad505['model'],_0x3ad505['query']);_0x16a1e9[_0x695b('0x3c')]=_['intersection'](_0x3ad505['model'],qs[_0x695b('0x3d')](_0x1dbba0['query']['fields']));_0x16a1e9[_0x695b('0x3c')]=_0x16a1e9[_0x695b('0x3c')][_0x695b('0x5d')]?_0x16a1e9[_0x695b('0x3c')]:_0x3ad505[_0x695b('0x37')];if(!_0x1dbba0[_0x695b('0x39')][_0x695b('0x3e')]('nolimit')){_0x16a1e9['limit']=qs[_0x695b('0x28')](_0x1dbba0[_0x695b('0x39')][_0x695b('0x28')]);_0x16a1e9[_0x695b('0x27')]=qs[_0x695b('0x27')](_0x1dbba0['query'][_0x695b('0x27')]);}_0x16a1e9[_0x695b('0x40')]=qs[_0x695b('0x41')](_0x1dbba0[_0x695b('0x39')][_0x695b('0x41')]);_0x16a1e9[_0x695b('0x42')]=qs[_0x695b('0x3a')](_[_0x695b('0x43')](_0x1dbba0[_0x695b('0x39')],_0x3ad505[_0x695b('0x3a')]));_0x16a1e9[_0x695b('0x42')][_0x695b('0x5e')]=_0x2e7294['id'];if(_0x1dbba0[_0x695b('0x39')]['filter']){_0x16a1e9['where']=_[_0x695b('0x46')](_0x16a1e9['where'],{'$or':_[_0x695b('0x38')](_0x16a1e9[_0x695b('0x3c')],function(_0x3fa8a7){var _0x345739={};_0x345739[_0x3fa8a7]={'$like':'%'+_0x1dbba0[_0x695b('0x39')][_0x695b('0x44')]+'%'};return _0x345739;})});}_0x16a1e9=_[_0x695b('0x46')]({},_0x16a1e9,_0x1dbba0[_0x695b('0x47')]);return db[_0x695b('0xcf')][_0x695b('0x26')]({'where':_0x16a1e9['where']})['then'](function(_0x362d49){_0x5acee5[_0x695b('0x26')]=_0x362d49;if(_0x1dbba0[_0x695b('0x39')][_0x695b('0x48')]){_0x16a1e9[_0x695b('0x4e')]=[{'all':!![]}];}else{_0x16a1e9[_0x695b('0x4e')]=[{'model':db[_0x695b('0x85')],'as':'Contact','required':![]},{'model':db[_0x695b('0xd8')],'as':'Attachments','required':![]}];}return db['ChatOfflineMessage'][_0x695b('0x62')](_0x16a1e9);})[_0x695b('0x16')](function(_0xa8b1fe){_0x5acee5[_0x695b('0x49')]=_0xa8b1fe;return _0x5acee5;});}})[_0x695b('0x16')](respondWithFilteredResult(_0xcad2b9,_0x16a1e9))[_0x695b('0x20')](handleError(_0xcad2b9,null));};exports[_0x695b('0x123')]=function(_0x40176c,_0x38493d){return db['ChatWebsite']['find']({'where':{'id':_0x40176c[_0x695b('0x4b')]['id']}})['then'](handleEntityNotFound(_0x38493d,null))[_0x695b('0x16')](function(_0x26053c){if(_0x26053c){return _0x26053c['addAgents'](_0x40176c['body'][_0x695b('0x60')],_[_0x695b('0xed')](_0x40176c['body'],[_0x695b('0x60'),'id'])||{})[_0x695b('0xb3')](function(_0x15ae05){for(var _0x3b9aac=0x0;_0x3b9aac<_0x40176c[_0x695b('0x50')][_0x695b('0x60')][_0x695b('0x5d')];_0x3b9aac+=0x1){socket[_0x695b('0x124')](_0x695b('0x125'),{'UserId':Number(_0x40176c[_0x695b('0x50')][_0x695b('0x60')][_0x3b9aac]),'ChatWebsiteId':Number(_0x40176c['params']['id'])});}return _0x15ae05;});}})[_0x695b('0x16')](respondWithResult(_0x38493d,null))['catch'](handleError(_0x38493d,null));};exports[_0x695b('0x126')]=function(_0x533541,_0x2dd705){return db['ChatWebsite'][_0x695b('0x57')]({'where':{'id':_0x533541[_0x695b('0x4b')]['id']}})[_0x695b('0x16')](handleEntityNotFound(_0x2dd705,null))[_0x695b('0x16')](function(_0x3edda8){if(_0x3edda8){return _0x3edda8['removeAgents'](_0x533541[_0x695b('0x39')]['ids'])[_0x695b('0x16')](function(){if(_[_0x695b('0x127')](_0x533541['query'][_0x695b('0x60')])){for(var _0x5e1ae8=0x0;_0x5e1ae8<_0x533541['query'][_0x695b('0x60')][_0x695b('0x5d')];_0x5e1ae8+=0x1){socket[_0x695b('0x124')](_0x695b('0x128'),{'UserId':Number(_0x533541[_0x695b('0x39')][_0x695b('0x60')][_0x5e1ae8]),'ChatWebsiteId':Number(_0x533541[_0x695b('0x4b')]['id'])});}}else{socket[_0x695b('0x124')](_0x695b('0x128'),{'UserId':Number(_0x533541['query'][_0x695b('0x60')]),'ChatWebsiteId':Number(_0x533541['params']['id'])});}});}})[_0x695b('0x16')](respondWithStatusCode(_0x2dd705,null))['catch'](handleError(_0x2dd705,null));};exports[_0x695b('0x129')]=function(_0x4bd1eb,_0x475971){var _0x498b68={};var _0x30f557={};var _0x47cadf;var _0x2f43ba;return db[_0x695b('0x34')][_0x695b('0x5c')]({'where':{'id':_0x4bd1eb[_0x695b('0x4b')]['id']}})[_0x695b('0x16')](handleEntityNotFound(_0x475971,null))['then'](function(_0x267bc7){if(_0x267bc7){_0x47cadf=_0x267bc7;_0x30f557[_0x695b('0x37')]=_[_0x695b('0x4c')](db[_0x695b('0xbe')][_0x695b('0x4d')]);_0x30f557['query']=_['keys'](_0x4bd1eb[_0x695b('0x39')]);_0x30f557['filters']=_['intersection'](_0x30f557[_0x695b('0x37')],_0x30f557[_0x695b('0x39')]);_0x498b68[_0x695b('0x3c')]=_[_0x695b('0x3b')](_0x30f557[_0x695b('0x37')],qs['fields'](_0x4bd1eb[_0x695b('0x39')][_0x695b('0x3d')]));_0x498b68[_0x695b('0x3c')]=_0x498b68[_0x695b('0x3c')][_0x695b('0x5d')]?_0x498b68[_0x695b('0x3c')]:_0x30f557['model'];_0x498b68[_0x695b('0x40')]=qs['sort'](_0x4bd1eb['query'][_0x695b('0x41')]);_0x498b68[_0x695b('0x42')]=qs['filters'](_[_0x695b('0x43')](_0x4bd1eb['query'],_0x30f557['filters']));if(_0x4bd1eb[_0x695b('0x39')][_0x695b('0x44')]){_0x498b68[_0x695b('0x42')]=_[_0x695b('0x46')](_0x498b68[_0x695b('0x42')],{'$or':_[_0x695b('0x38')](_0x498b68['attributes'],function(_0x3cd903){var _0x2d30e6={};_0x2d30e6[_0x3cd903]={'$like':'%'+_0x4bd1eb[_0x695b('0x39')][_0x695b('0x44')]+'%'};return _0x2d30e6;})});}_0x498b68=_[_0x695b('0x46')]({},_0x498b68,_0x4bd1eb['options']);return _0x47cadf[_0x695b('0x129')](_0x498b68);}})['then'](function(_0x12d802){if(_0x12d802){_0x2f43ba=_0x12d802['length'];if(!_0x4bd1eb[_0x695b('0x39')][_0x695b('0x3e')](_0x695b('0x3f'))){_0x498b68[_0x695b('0x28')]=qs[_0x695b('0x28')](_0x4bd1eb['query'][_0x695b('0x28')]);_0x498b68[_0x695b('0x27')]=qs[_0x695b('0x27')](_0x4bd1eb[_0x695b('0x39')][_0x695b('0x27')]);}return _0x47cadf[_0x695b('0x129')](_0x498b68);}})[_0x695b('0x16')](function(_0x43bad4){if(_0x43bad4){return _0x43bad4?{'count':_0x2f43ba,'rows':_0x43bad4}:null;}})['then'](respondWithResult(_0x475971,null))['catch'](handleError(_0x475971,null));};
\ No newline at end of file
index 16fad90..554bc83 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc090=['update','remove','emit','hook','events','../../mysqldb','ChatWebsite','setMaxListeners','save'];(function(_0x1d1bfb,_0x59f312){var _0x1369d1=function(_0x26cb60){while(--_0x26cb60){_0x1d1bfb['push'](_0x1d1bfb['shift']());}};_0x1369d1(++_0x59f312);}(_0xc090,0x112));var _0x0c09=function(_0x3b78a3,_0x518f44){_0x3b78a3=_0x3b78a3-0x0;var _0x1db25c=_0xc090[_0x3b78a3];return _0x1db25c;};'use strict';var EventEmitter=require(_0x0c09('0x0'));var ChatWebsite=require(_0x0c09('0x1'))['db'][_0x0c09('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x0c09('0x3')](0x0);var events={'afterCreate':_0x0c09('0x4'),'afterUpdate':_0x0c09('0x5'),'afterDestroy':_0x0c09('0x6')};function emitEvent(_0x260c36){return function(_0x11984f,_0x487f03,_0x2e968b){ChatWebsiteEvents[_0x0c09('0x7')](_0x260c36+':'+_0x11984f['id'],_0x11984f);ChatWebsiteEvents['emit'](_0x260c36,_0x11984f);_0x2e968b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite[_0x0c09('0x8')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents;
\ No newline at end of file
+var _0xa41a=['remove','emit','hasOwnProperty','events','../../mysqldb','setMaxListeners','save','update'];(function(_0xe3390b,_0x1daddd){var _0x22658c=function(_0x1bd38f){while(--_0x1bd38f){_0xe3390b['push'](_0xe3390b['shift']());}};_0x22658c(++_0x1daddd);}(_0xa41a,0x6b));var _0xaa41=function(_0x40879b,_0x65ac13){_0x40879b=_0x40879b-0x0;var _0x581594=_0xa41a[_0x40879b];return _0x581594;};'use strict';var EventEmitter=require(_0xaa41('0x0'));var ChatWebsite=require(_0xaa41('0x1'))['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xaa41('0x2')](0x0);var events={'afterCreate':_0xaa41('0x3'),'afterUpdate':_0xaa41('0x4'),'afterDestroy':_0xaa41('0x5')};function emitEvent(_0x37c7a1){return function(_0x3168be,_0x42896b,_0x251efa){ChatWebsiteEvents['emit'](_0x37c7a1+':'+_0x3168be['id'],_0x3168be);ChatWebsiteEvents[_0xaa41('0x6')](_0x37c7a1,_0x3168be);_0x251efa(null);};}for(var e in events){if(events[_0xaa41('0x7')](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents;
\ No newline at end of file
index d045435..af97716 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4735=['api','moment','bluebird','path','rimraf','./chatWebsite.attributes','define','chat_websites','util'];(function(_0x38d64b,_0x56a8ac){var _0x58868c=function(_0x4a06e0){while(--_0x4a06e0){_0x38d64b['push'](_0x38d64b['shift']());}};_0x58868c(++_0x56a8ac);}(_0x4735,0xb3));var _0x5473=function(_0x4b32dc,_0x2e8345){_0x4b32dc=_0x4b32dc-0x0;var _0x3643f2=_0x4735[_0x4b32dc];return _0x3643f2;};'use strict';var _=require('lodash');var util=require(_0x5473('0x0'));var logger=require('../../config/logger')(_0x5473('0x1'));var moment=require(_0x5473('0x2'));var BPromise=require(_0x5473('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5473('0x4'));var rimraf=require(_0x5473('0x5'));var config=require('../../config/environment');var attributes=require(_0x5473('0x6'));module['exports']=function(_0x503b15,_0x3927ec){return _0x503b15[_0x5473('0x7')]('ChatWebsite',attributes,{'tableName':_0x5473('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa7e3=['rimraf','./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x49057a,_0x4c6add){var _0x54b2d0=function(_0x37e906){while(--_0x37e906){_0x49057a['push'](_0x49057a['shift']());}};_0x54b2d0(++_0x4c6add);}(_0xa7e3,0x19e));var _0x3a7e=function(_0x12b944,_0x3f2c46){_0x12b944=_0x12b944-0x0;var _0xa542bf=_0xa7e3[_0x12b944];return _0xa542bf;};'use strict';var _=require('lodash');var util=require(_0x3a7e('0x0'));var logger=require(_0x3a7e('0x1'))('api');var moment=require(_0x3a7e('0x2'));var BPromise=require(_0x3a7e('0x3'));var rp=require(_0x3a7e('0x4'));var fs=require('fs');var path=require(_0x3a7e('0x5'));var rimraf=require(_0x3a7e('0x6'));var config=require('../../config/environment');var attributes=require(_0x3a7e('0x7'));module[_0x3a7e('0x8')]=function(_0x375637,_0x43b9fe){return _0x375637[_0x3a7e('0x9')](_0x3a7e('0xa'),attributes,{'tableName':_0x3a7e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 729ed98..341cb25 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x16b2=['rpc','jayson/promise','client','http','defaults','redis','localhost','request','then','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','info','result','lodash','util','moment','ioredis','../../mysqldb','../../config/utils'];(function(_0xaf29da,_0x117f5a){var _0x295c51=function(_0x3feaf4){while(--_0x3feaf4){_0xaf29da['push'](_0xaf29da['shift']());}};_0x295c51(++_0x117f5a);}(_0x16b2,0x13f));var _0x216b=function(_0x1a7846,_0x59723e){_0x1a7846=_0x1a7846-0x0;var _0x48049=_0x16b2[_0x1a7846];return _0x48049;};'use strict';var _=require(_0x216b('0x0'));var util=require(_0x216b('0x1'));var moment=require(_0x216b('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x216b('0x3'));var db=require(_0x216b('0x4'))['db'];var utils=require(_0x216b('0x5'));var logger=require('../../config/logger')(_0x216b('0x6'));var config=require('../../config/environment');var jayson=require(_0x216b('0x7'));var client=jayson[_0x216b('0x8')][_0x216b('0x9')]({'port':0x232a});config['redis']=_[_0x216b('0xa')](config[_0x216b('0xb')],{'host':_0x216b('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./chatWebsite.socket')['register'](socket);function respondWithRpcPromise(_0x5db6ef,_0xeb068a,_0x44b8d5){return new BPromise(function(_0x203994,_0x26b328){return client[_0x216b('0xd')](_0x5db6ef,_0x44b8d5)[_0x216b('0xe')](function(_0x142884){logger['info']('ChatWebsite,\x20%s,\x20%s',_0xeb068a,_0x216b('0xf'));logger[_0x216b('0x10')](_0x216b('0x11'),_0xeb068a,_0x216b('0xf'),JSON[_0x216b('0x12')](_0x142884));if(_0x142884[_0x216b('0x13')]){if(_0x142884[_0x216b('0x13')][_0x216b('0x14')]===0x1f4){logger['error'](_0x216b('0x15'),_0xeb068a,_0x142884[_0x216b('0x13')][_0x216b('0x16')]);return _0x26b328(_0x142884['error'][_0x216b('0x16')]);}logger[_0x216b('0x13')](_0x216b('0x15'),_0xeb068a,_0x142884['error'][_0x216b('0x16')]);return _0x203994(_0x142884['error'][_0x216b('0x16')]);}else{logger[_0x216b('0x17')](_0x216b('0x15'),_0xeb068a,_0x216b('0xf'));_0x203994(_0x142884[_0x216b('0x18')][_0x216b('0x16')]);}})['catch'](function(_0x250ea8){logger[_0x216b('0x13')](_0x216b('0x15'),_0xeb068a,_0x250ea8);_0x26b328(_0x250ea8);});});}
\ No newline at end of file
+var _0x2ee1=['socket.io-emitter','register','request','then','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults'];(function(_0x34882f,_0x601a99){var _0x455929=function(_0x463c7c){while(--_0x463c7c){_0x34882f['push'](_0x34882f['shift']());}};_0x455929(++_0x601a99);}(_0x2ee1,0xee));var _0x12ee=function(_0xfe3abe,_0x2a0817){_0xfe3abe=_0xfe3abe-0x0;var _0x4935d7=_0x2ee1[_0xfe3abe];return _0x4935d7;};'use strict';var _=require(_0x12ee('0x0'));var util=require(_0x12ee('0x1'));var moment=require('moment');var BPromise=require(_0x12ee('0x2'));var rs=require(_0x12ee('0x3'));var fs=require('fs');var Redis=require(_0x12ee('0x4'));var db=require(_0x12ee('0x5'))['db'];var utils=require(_0x12ee('0x6'));var logger=require('../../config/logger')(_0x12ee('0x7'));var config=require(_0x12ee('0x8'));var jayson=require(_0x12ee('0x9'));var client=jayson[_0x12ee('0xa')][_0x12ee('0xb')]({'port':0x232a});config[_0x12ee('0xc')]=_[_0x12ee('0xd')](config[_0x12ee('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x12ee('0xe'))(new Redis(config['redis']));require('./chatWebsite.socket')[_0x12ee('0xf')](socket);function respondWithRpcPromise(_0x54fc48,_0x494690,_0x4ce6be){return new BPromise(function(_0x4b1e9c,_0x1be7b8){return client[_0x12ee('0x10')](_0x54fc48,_0x4ce6be)[_0x12ee('0x11')](function(_0x26f509){logger['info'](_0x12ee('0x12'),_0x494690,_0x12ee('0x13'));logger[_0x12ee('0x14')](_0x12ee('0x15'),_0x494690,_0x12ee('0x13'),JSON[_0x12ee('0x16')](_0x26f509));if(_0x26f509[_0x12ee('0x17')]){if(_0x26f509[_0x12ee('0x17')][_0x12ee('0x18')]===0x1f4){logger[_0x12ee('0x17')](_0x12ee('0x12'),_0x494690,_0x26f509[_0x12ee('0x17')][_0x12ee('0x19')]);return _0x1be7b8(_0x26f509[_0x12ee('0x17')][_0x12ee('0x19')]);}logger[_0x12ee('0x17')](_0x12ee('0x12'),_0x494690,_0x26f509[_0x12ee('0x17')]['message']);return _0x4b1e9c(_0x26f509[_0x12ee('0x17')][_0x12ee('0x19')]);}else{logger[_0x12ee('0x1a')]('ChatWebsite,\x20%s,\x20%s',_0x494690,_0x12ee('0x13'));_0x4b1e9c(_0x26f509['result'][_0x12ee('0x19')]);}})[_0x12ee('0x1b')](function(_0x5d82ae){logger['error'](_0x12ee('0x12'),_0x494690,_0x5d82ae);_0x1be7b8(_0x5d82ae);});});}
\ No newline at end of file
index 075fb22..b782bce 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x97c8=['update','register','length','chatWebsite:','./chatWebsite.events','save','remove'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x97c8,0x138));var _0x897c=function(_0x366e51,_0x3a0178){_0x366e51=_0x366e51-0x0;var _0x4e23e3=_0x97c8[_0x366e51];return _0x4e23e3;};'use strict';var ChatWebsiteEvents=require(_0x897c('0x0'));var events=[_0x897c('0x1'),_0x897c('0x2'),_0x897c('0x3')];function createListener(_0x3d4412,_0x2b483d){return function(_0x5cc6bf){_0x2b483d['emit'](_0x3d4412,_0x5cc6bf);};}function removeListener(_0x508370,_0x26410c){return function(){ChatWebsiteEvents['removeListener'](_0x508370,_0x26410c);};}exports[_0x897c('0x4')]=function(_0x178536){for(var _0x22babf=0x0,_0x150ef1=events[_0x897c('0x5')];_0x22babf<_0x150ef1;_0x22babf++){var _0x50c84c=events[_0x22babf];var _0x5ea341=createListener(_0x897c('0x6')+_0x50c84c,_0x178536);ChatWebsiteEvents['on'](_0x50c84c,_0x5ea341);}};
\ No newline at end of file
+var _0x4870=['register','chatWebsite:','remove','update','emit'];(function(_0x5608a3,_0x5b33c5){var _0x1ed50a=function(_0x959171){while(--_0x959171){_0x5608a3['push'](_0x5608a3['shift']());}};_0x1ed50a(++_0x5b33c5);}(_0x4870,0xc0));var _0x0487=function(_0x1203f,_0x554bbc){_0x1203f=_0x1203f-0x0;var _0x365f0a=_0x4870[_0x1203f];return _0x365f0a;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=['save',_0x0487('0x0'),_0x0487('0x1')];function createListener(_0x122aa9,_0x183e62){return function(_0x4c5719){_0x183e62[_0x0487('0x2')](_0x122aa9,_0x4c5719);};}function removeListener(_0x843e2e,_0x237fed){return function(){ChatWebsiteEvents['removeListener'](_0x843e2e,_0x237fed);};}exports[_0x0487('0x3')]=function(_0x27fb54){for(var _0x5b149d=0x0,_0x20f637=events['length'];_0x5b149d<_0x20f637;_0x5b149d++){var _0x240d38=events[_0x5b149d];var _0x3088b9=createListener(_0x0487('0x4')+_0x240d38,_0x27fb54);ChatWebsiteEvents['on'](_0x240d38,_0x3088b9);}};
\ No newline at end of file
index 8baee32..1f4f4ae 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x786d=['attachments','offline-chat','ensureDir','replace','/:id/offline','any','offline','addInteraction','addApplications','/:id/proactive_actions','addProactiveActions','addAgents','update','delete','destroy','removeDispositions','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/avatar','getAvatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','/:id/snippet','/:id/applications','getApplications','getProactiveActions','getOfflineMessages','/:id/users','getAgents','create','post','addDisposition','diskStorage','join','root','server/files/images/logos/','format','%s-%s','now','/:id/logo','single','server/files/images/avatars/','file','addAvatar','originalname','/:id/customer_avatar','notify','server/files'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0x786d,0x94));var _0xd786=function(_0x51edb1,_0xaf0da4){_0x51edb1=_0x51edb1-0x0;var _0x1f3772=_0x786d[_0x51edb1];return _0x1f3772;};'use strict';var multer=require('multer');var util=require(_0xd786('0x0'));var path=require(_0xd786('0x1'));var timeout=require(_0xd786('0x2'));var express=require(_0xd786('0x3'));var router=express['Router']();var fs_extra=require(_0xd786('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xd786('0x5'));var config=require(_0xd786('0x6'));var controller=require('./chatWebsite.controller');router[_0xd786('0x7')]('/',auth[_0xd786('0x8')](),controller[_0xd786('0x9')]);router['get'](_0xd786('0xa'),auth[_0xd786('0x8')](),controller[_0xd786('0xb')]);router[_0xd786('0x7')](_0xd786('0xc'),auth[_0xd786('0x8')](),controller[_0xd786('0xd')]);router[_0xd786('0x7')](_0xd786('0xe'),auth[_0xd786('0x8')](),controller[_0xd786('0xf')]);router['get'](_0xd786('0x10'),auth[_0xd786('0x8')](),controller[_0xd786('0x11')]);router['get']('/:id/logo',controller['getLogo']);router[_0xd786('0x7')](_0xd786('0x12'),controller[_0xd786('0x13')]);router[_0xd786('0x7')]('/:id/customer_avatar',controller[_0xd786('0x14')]);router['get'](_0xd786('0x15'),controller[_0xd786('0x16')]);router['get'](_0xd786('0x17'),auth['isAuthenticated'](),controller['getInteractions']);router['get'](_0xd786('0x18'),controller['getSnippet']);router[_0xd786('0x7')](_0xd786('0x19'),auth['isAuthenticated'](),controller[_0xd786('0x1a')]);router['get']('/:id/proactive_actions',auth[_0xd786('0x8')](),controller[_0xd786('0x1b')]);router['get']('/:id/fields',controller['getFields']);router[_0xd786('0x7')]('/:id/offline_messages',auth[_0xd786('0x8')](),controller[_0xd786('0x1c')]);router[_0xd786('0x7')](_0xd786('0x1d'),auth[_0xd786('0x8')](),controller[_0xd786('0x1e')]);router['post']('/',auth[_0xd786('0x8')](),controller[_0xd786('0x1f')]);router[_0xd786('0x20')](_0xd786('0xe'),auth['isAuthenticated'](),controller[_0xd786('0x21')]);router[_0xd786('0x20')](_0xd786('0x10'),auth[_0xd786('0x8')](),controller['addAnswer']);var upload=multer({'storage':multer[_0xd786('0x22')]({'destination':function(_0x38a6d1,_0x4cabcd,_0x120ae6){_0x120ae6(null,path[_0xd786('0x23')](config[_0xd786('0x24')],_0xd786('0x25')));},'filename':function(_0x17b9b6,_0x36a818,_0x41e2ba){_0x41e2ba(null,util[_0xd786('0x26')](_0xd786('0x27'),Date[_0xd786('0x28')](),_0x36a818['originalname']));}})});router[_0xd786('0x20')](_0xd786('0x29'),upload[_0xd786('0x2a')]('file'),controller['addLogo']);var upload=multer({'storage':multer[_0xd786('0x22')]({'destination':function(_0x2a2d1c,_0x1daa49,_0x516415){_0x516415(null,path['join'](config['root'],_0xd786('0x2b')));},'filename':function(_0x50c512,_0x46fef5,_0x4398f2){_0x4398f2(null,util[_0xd786('0x26')](_0xd786('0x27'),Date[_0xd786('0x28')](),_0x46fef5['originalname']));}})});router[_0xd786('0x20')](_0xd786('0x12'),upload[_0xd786('0x2a')](_0xd786('0x2c')),controller[_0xd786('0x2d')]);var upload=multer({'storage':multer[_0xd786('0x22')]({'destination':function(_0x278199,_0x2ad61e,_0x31230a){_0x31230a(null,path[_0xd786('0x23')](config[_0xd786('0x24')],'server/files/images/avatars/'));},'filename':function(_0x4d18c9,_0x3c27ad,_0x218194){_0x218194(null,util[_0xd786('0x26')](_0xd786('0x27'),Date[_0xd786('0x28')](),_0x3c27ad[_0xd786('0x2e')]));}})});router[_0xd786('0x20')](_0xd786('0x2f'),upload['single'](_0xd786('0x2c')),controller['addCustomerAvatar']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x59cc00,_0x22901e,_0x40ef72){_0x40ef72(null,path[_0xd786('0x23')](config[_0xd786('0x24')],_0xd786('0x2b')));},'filename':function(_0x14755c,_0x2e53bc,_0x14310e){_0x14310e(null,util[_0xd786('0x26')]('%s-%s',Date[_0xd786('0x28')](),_0x2e53bc[_0xd786('0x2e')]));}})});router['post']('/:id/system_avatar',upload[_0xd786('0x2a')](_0xd786('0x2c')),controller['addSystemAvatar']);router[_0xd786('0x20')]('/:id/notify',controller[_0xd786('0x30')]);const offlineUploadMulter=multer({'storage':multer[_0xd786('0x22')]({'destination':function(_0x324d11,_0x354197,_0x5cf29e){const _0x8a4e29=path['join'](config[_0xd786('0x24')],_0xd786('0x31'),_0xd786('0x32'),_0xd786('0x33'));fs_extra[_0xd786('0x34')](_0x8a4e29,function(){_0x5cf29e(null,_0x8a4e29);});},'filename':function(_0x329f29,_0x1f5ca1,_0x3aa306){const _0x6deb63=_0x1f5ca1[_0xd786('0x2e')][_0xd786('0x35')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0xbabc11=path['extname'](_0x6deb63);const _0xad831a=Date[_0xd786('0x28')]()+'-'+_0x6deb63[_0xd786('0x35')](_0xbabc11,'')+_0xbabc11;_0x3aa306(null,_0xad831a);}})});router[_0xd786('0x20')](_0xd786('0x36'),offlineUploadMulter[_0xd786('0x37')](),controller[_0xd786('0x38')]);router[_0xd786('0x20')]('/:id/interactions',auth[_0xd786('0x8')](),controller[_0xd786('0x39')]);router[_0xd786('0x20')](_0xd786('0x19'),auth[_0xd786('0x8')](),controller[_0xd786('0x3a')]);router[_0xd786('0x20')](_0xd786('0x3b'),auth['isAuthenticated'](),controller[_0xd786('0x3c')]);router[_0xd786('0x20')]('/:id/users',auth[_0xd786('0x8')](),controller[_0xd786('0x3d')]);router['put'](_0xd786('0xc'),auth[_0xd786('0x8')](),controller[_0xd786('0x3e')]);router[_0xd786('0x3f')]('/:id',auth[_0xd786('0x8')](),controller[_0xd786('0x40')]);router[_0xd786('0x3f')](_0xd786('0xe'),auth[_0xd786('0x8')](),controller[_0xd786('0x41')]);router[_0xd786('0x3f')](_0xd786('0x10'),auth[_0xd786('0x8')](),controller['removeAnswers']);router['delete'](_0xd786('0x1d'),auth[_0xd786('0x8')](),controller['removeAgents']);module['exports']=router;
\ No newline at end of file
+var _0x7c79=['/:id/fields','getFields','getOfflineMessages','/:id/users','getAgents','post','create','addDisposition','addAnswer','diskStorage','join','root','server/files/images/logos/','format','%s-%s','originalname','file','server/files/images/avatars/','now','single','addAvatar','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','server/files','attachments','offline-chat','replace','/:id/offline','offline','/:id/interactions','addApplications','addProactiveActions','addAgents','destroy','/:id/dispositions','removeDispositions','delete','removeAnswers','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','getAvatar','/:id/customer_avatar','/:id/system_avatar','getSystemAvatar','getInteractions','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x7c79,0x177));var _0x97c7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7c79[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x97c7('0x0'));var util=require(_0x97c7('0x1'));var path=require(_0x97c7('0x2'));var timeout=require('connect-timeout');var express=require(_0x97c7('0x3'));var router=express[_0x97c7('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x97c7('0x5'));var config=require(_0x97c7('0x6'));var controller=require('./chatWebsite.controller');router['get']('/',auth[_0x97c7('0x7')](),controller[_0x97c7('0x8')]);router[_0x97c7('0x9')]('/describe',auth[_0x97c7('0x7')](),controller[_0x97c7('0xa')]);router[_0x97c7('0x9')](_0x97c7('0xb'),auth[_0x97c7('0x7')](),controller['show']);router[_0x97c7('0x9')]('/:id/dispositions',auth[_0x97c7('0x7')](),controller[_0x97c7('0xc')]);router['get'](_0x97c7('0xd'),auth[_0x97c7('0x7')](),controller[_0x97c7('0xe')]);router[_0x97c7('0x9')](_0x97c7('0xf'),controller[_0x97c7('0x10')]);router['get']('/:id/avatar',controller[_0x97c7('0x11')]);router['get'](_0x97c7('0x12'),controller['getCustomerAvatar']);router[_0x97c7('0x9')](_0x97c7('0x13'),controller[_0x97c7('0x14')]);router['get']('/:id/interactions',auth[_0x97c7('0x7')](),controller[_0x97c7('0x15')]);router['get']('/:id/snippet',controller[_0x97c7('0x16')]);router['get'](_0x97c7('0x17'),auth['isAuthenticated'](),controller[_0x97c7('0x18')]);router[_0x97c7('0x9')](_0x97c7('0x19'),auth['isAuthenticated'](),controller[_0x97c7('0x1a')]);router['get'](_0x97c7('0x1b'),controller[_0x97c7('0x1c')]);router[_0x97c7('0x9')]('/:id/offline_messages',auth[_0x97c7('0x7')](),controller[_0x97c7('0x1d')]);router[_0x97c7('0x9')](_0x97c7('0x1e'),auth[_0x97c7('0x7')](),controller[_0x97c7('0x1f')]);router[_0x97c7('0x20')]('/',auth['isAuthenticated'](),controller[_0x97c7('0x21')]);router[_0x97c7('0x20')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x97c7('0x22')]);router[_0x97c7('0x20')]('/:id/canned_answers',auth[_0x97c7('0x7')](),controller[_0x97c7('0x23')]);var upload=multer({'storage':multer[_0x97c7('0x24')]({'destination':function(_0x9ba20f,_0x525c26,_0x8b9744){_0x8b9744(null,path[_0x97c7('0x25')](config[_0x97c7('0x26')],_0x97c7('0x27')));},'filename':function(_0x145674,_0x26165a,_0x564f23){_0x564f23(null,util[_0x97c7('0x28')](_0x97c7('0x29'),Date['now'](),_0x26165a[_0x97c7('0x2a')]));}})});router[_0x97c7('0x20')](_0x97c7('0xf'),upload['single'](_0x97c7('0x2b')),controller['addLogo']);var upload=multer({'storage':multer[_0x97c7('0x24')]({'destination':function(_0x2b7e46,_0x70aa3b,_0x655608){_0x655608(null,path[_0x97c7('0x25')](config[_0x97c7('0x26')],_0x97c7('0x2c')));},'filename':function(_0xaf1b91,_0x2bba89,_0x4a7a7b){_0x4a7a7b(null,util[_0x97c7('0x28')](_0x97c7('0x29'),Date[_0x97c7('0x2d')](),_0x2bba89[_0x97c7('0x2a')]));}})});router[_0x97c7('0x20')]('/:id/avatar',upload[_0x97c7('0x2e')]('file'),controller[_0x97c7('0x2f')]);var upload=multer({'storage':multer[_0x97c7('0x24')]({'destination':function(_0x1face4,_0x52bb57,_0x3e3aed){_0x3e3aed(null,path[_0x97c7('0x25')](config[_0x97c7('0x26')],_0x97c7('0x2c')));},'filename':function(_0x2b6f98,_0x3a4662,_0x283212){_0x283212(null,util[_0x97c7('0x28')]('%s-%s',Date[_0x97c7('0x2d')](),_0x3a4662[_0x97c7('0x2a')]));}})});router[_0x97c7('0x20')]('/:id/customer_avatar',upload['single']('file'),controller[_0x97c7('0x30')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5790de,_0x3e4f44,_0x150bca){_0x150bca(null,path[_0x97c7('0x25')](config[_0x97c7('0x26')],_0x97c7('0x2c')));},'filename':function(_0x6dfcd2,_0x3a8608,_0x9077bf){_0x9077bf(null,util[_0x97c7('0x28')](_0x97c7('0x29'),Date['now'](),_0x3a8608['originalname']));}})});router[_0x97c7('0x20')](_0x97c7('0x13'),upload[_0x97c7('0x2e')](_0x97c7('0x2b')),controller[_0x97c7('0x31')]);router[_0x97c7('0x20')](_0x97c7('0x32'),controller[_0x97c7('0x33')]);const offlineUploadMulter=multer({'storage':multer[_0x97c7('0x24')]({'destination':function(_0x1f4036,_0xeddad9,_0x5017e){const _0x4ae10f=path[_0x97c7('0x25')](config['root'],_0x97c7('0x34'),_0x97c7('0x35'),_0x97c7('0x36'));fs_extra['ensureDir'](_0x4ae10f,function(){_0x5017e(null,_0x4ae10f);});},'filename':function(_0x8f06de,_0x58aefe,_0x431162){const _0x28e4b8=_0x58aefe[_0x97c7('0x2a')][_0x97c7('0x37')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x346812=path['extname'](_0x28e4b8);const _0x2d5149=Date['now']()+'-'+_0x28e4b8[_0x97c7('0x37')](_0x346812,'')+_0x346812;_0x431162(null,_0x2d5149);}})});router[_0x97c7('0x20')](_0x97c7('0x38'),offlineUploadMulter['any'](),controller[_0x97c7('0x39')]);router[_0x97c7('0x20')](_0x97c7('0x3a'),auth[_0x97c7('0x7')](),controller['addInteraction']);router[_0x97c7('0x20')](_0x97c7('0x17'),auth[_0x97c7('0x7')](),controller[_0x97c7('0x3b')]);router[_0x97c7('0x20')](_0x97c7('0x19'),auth[_0x97c7('0x7')](),controller[_0x97c7('0x3c')]);router[_0x97c7('0x20')](_0x97c7('0x1e'),auth[_0x97c7('0x7')](),controller[_0x97c7('0x3d')]);router['put'](_0x97c7('0xb'),auth[_0x97c7('0x7')](),controller['update']);router['delete'](_0x97c7('0xb'),auth[_0x97c7('0x7')](),controller[_0x97c7('0x3e')]);router['delete'](_0x97c7('0x3f'),auth[_0x97c7('0x7')](),controller[_0x97c7('0x40')]);router[_0x97c7('0x41')](_0x97c7('0xd'),auth['isAuthenticated'](),controller[_0x97c7('0x42')]);router[_0x97c7('0x41')](_0x97c7('0x1e'),auth[_0x97c7('0x7')](),controller['removeAgents']);module['exports']=router;
\ No newline at end of file
index 5738b12..bec9723 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1049=['expressEndpoint','/client-logs','use','isAuthenticated','exports','express','../components/auth/service','../config/environment','app','get','client-side-logger','Client-Side\x20logger\x20not\x20found!'];(function(_0x6ea93d,_0x245219){var _0x40763f=function(_0x42552b){while(--_0x42552b){_0x6ea93d['push'](_0x6ea93d['shift']());}};_0x40763f(++_0x245219);}(_0x1049,0x65));var _0x9104=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1049[_0x3dd15e];return _0x231fd0;};var beaverLogger=require('beaver-logger/server');var express=require(_0x9104('0x0'));var auth=require(_0x9104('0x1'));var config=require(_0x9104('0x2'));var router=express['Router']();var isProduction=config['env']==='production'||![];function clientSideLogs(_0x118010,_0x3bf187,_0x28f83b){var _0x56510d=_0x118010[_0x9104('0x3')][_0x9104('0x4')](_0x9104('0x5'));if(!_0x56510d){throw new Error(_0x9104('0x6'));}return beaverLogger[_0x9104('0x7')]({'uri':_0x9104('0x8'),'logger':_0x56510d,'enableCors':!isProduction})(_0x118010,_0x3bf187,_0x28f83b);}router[_0x9104('0x9')](auth[_0x9104('0xa')](),clientSideLogs);module[_0x9104('0xb')]=router;
\ No newline at end of file
+var _0xa78d=['Router','app','get','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs','use','isAuthenticated','exports','beaver-logger/server','express','../components/auth/service','../config/environment'];(function(_0x5f46ac,_0x4aed0a){var _0xbe5805=function(_0x308582){while(--_0x308582){_0x5f46ac['push'](_0x5f46ac['shift']());}};_0xbe5805(++_0x4aed0a);}(_0xa78d,0x1ca));var _0xda78=function(_0x2aea9e,_0x1f587f){_0x2aea9e=_0x2aea9e-0x0;var _0x430b92=_0xa78d[_0x2aea9e];return _0x430b92;};var beaverLogger=require(_0xda78('0x0'));var express=require(_0xda78('0x1'));var auth=require(_0xda78('0x2'));var config=require(_0xda78('0x3'));var router=express[_0xda78('0x4')]();var isProduction=config['env']==='production'||![];function clientSideLogs(_0x481043,_0x52b72e,_0x295ac4){var _0x45f794=_0x481043[_0xda78('0x5')][_0xda78('0x6')](_0xda78('0x7'));if(!_0x45f794){throw new Error(_0xda78('0x8'));}return beaverLogger[_0xda78('0x9')]({'uri':_0xda78('0xa'),'logger':_0x45f794,'enableCors':!isProduction})(_0x481043,_0x52b72e,_0x295ac4);}router[_0xda78('0xb')](auth[_0xda78('0xc')](),clientSideLogs);module[_0xda78('0xd')]=router;
\ No newline at end of file
index 1dd3c1c..320ae46 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd0ba=['exports','STRING','Google','ENUM','Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','sequelize'];(function(_0x13fd59,_0x2e05b1){var _0x2e6ce7=function(_0x519a4b){while(--_0x519a4b){_0x13fd59['push'](_0x13fd59['shift']());}};_0x2e6ce7(++_0x2e05b1);}(_0xd0ba,0xa7));var _0xad0b=function(_0x3b0731,_0xcf9925){_0x3b0731=_0x3b0731-0x0;var _0x4204d7=_0xd0ba[_0x3b0731];return _0x4204d7;};'use strict';var Sequelize=require(_0xad0b('0x0'));module[_0xad0b('0x1')]={'name':{'type':Sequelize[_0xad0b('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM']('AmazonAWS',_0xad0b('0x3'),'MicrosoftAzure'),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0xad0b('0x4')](_0xad0b('0x5'),_0xad0b('0x6'))},'data1':{'type':Sequelize[_0xad0b('0x2')],'comment':_0xad0b('0x7')},'data2':{'type':Sequelize[_0xad0b('0x2')],'comment':_0xad0b('0x8')},'data3':{'type':Sequelize[_0xad0b('0x2')],'comment':_0xad0b('0x9')},'data4':{'type':Sequelize[_0xad0b('0x2')],'comment':_0xad0b('0xa')},'data5':{'type':Sequelize[_0xad0b('0xb')],'comment':_0xad0b('0xc')},'data6':{'type':Sequelize[_0xad0b('0xb')],'comment':_0xad0b('0xd')},'data7':{'type':Sequelize[_0xad0b('0xb')],'comment':'MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri'}};
\ No newline at end of file
+var _0x88b0=['MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','TEXT','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING','ENUM','AmazonAWS','Google','MicrosoftAzure','Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20client_id'];(function(_0x4723d1,_0x515d2e){var _0x335b7f=function(_0x559134){while(--_0x559134){_0x4723d1['push'](_0x4723d1['shift']());}};_0x335b7f(++_0x515d2e);}(_0x88b0,0x1e0));var _0x088b=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x88b0[_0x3b380d];return _0x54502b;};'use strict';var Sequelize=require(_0x088b('0x0'));module[_0x088b('0x1')]={'name':{'type':Sequelize[_0x088b('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x088b('0x3')](_0x088b('0x4'),_0x088b('0x5'),_0x088b('0x6')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x088b('0x3')](_0x088b('0x7'),_0x088b('0x8'))},'data1':{'type':Sequelize[_0x088b('0x2')],'comment':_0x088b('0x9')},'data2':{'type':Sequelize[_0x088b('0x2')],'comment':_0x088b('0xa')},'data3':{'type':Sequelize['STRING'],'comment':_0x088b('0xb')},'data4':{'type':Sequelize[_0x088b('0x2')],'comment':'MicrosoftAzure\x20=>\x20redirect_uri'},'data5':{'type':Sequelize['TEXT'],'comment':'MicrosoftAzure\x20=>\x20access_token'},'data6':{'type':Sequelize['TEXT'],'comment':'MicrosoftAzure\x20=>\x20refresh_token'},'data7':{'type':Sequelize[_0x088b('0xc')],'comment':_0x088b('0xd')}};
\ No newline at end of file
index a324fa2..91e207c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2493=['pick','filter','merge','type','VIRTUAL','options','count','include','findAll','rows','service','MicrosoftAzure','decryptString','data3','catch','params','keys','rawAttributes','find','body','Name\x20parameter\x20not\x20specified','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','update','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','error','get','Invalid\x20state\x20parameter','from','state','base64','ascii','del','getOauth2MicrosoftAccessToken','data5','access_token','data6','refresh_token','startRefreshInterval','emit','microsoftAuthorization:success','Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','ioredis','../../config/environment','../../config/logger','api','../../mysqldb','redis','localhost','socket.io-emitter','sendStatus','status','json','offset','undefined','limit','set','then','destroy','end','name','send','slice','index','map','CloudProvider','fieldName','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where'];(function(_0x1621dd,_0x172229){var _0x3b0046=function(_0x53ab32){while(--_0x53ab32){_0x1621dd['push'](_0x1621dd['shift']());}};_0x3b0046(++_0x172229);}(_0x2493,0x18e));var _0x3249=function(_0x288020,_0x973011){_0x288020=_0x288020-0x0;var _0x16a4bc=_0x2493[_0x288020];return _0x16a4bc;};'use strict';var _=require(_0x3249('0x0'));var Redis=require(_0x3249('0x1'));var qs=require('../../components/parsers/qs');var encryptor=require('../../components/encryptor');var config=require(_0x3249('0x2'));var logger=require(_0x3249('0x3'))(_0x3249('0x4'));var db=require(_0x3249('0x5'))['db'];var oauth=require('./cloudProvider.oauth');config['redis']=_['defaults'](config[_0x3249('0x6')],{'host':_0x3249('0x7'),'port':0x18eb});var socket=require(_0x3249('0x8'))(new Redis(config[_0x3249('0x6')]));var redis=new Redis(config[_0x3249('0x6')]);function respondWithStatusCode(_0x372d45,_0x35ac25){_0x35ac25=_0x35ac25||0xcc;return function(_0x35550f){if(_0x35550f){return _0x372d45[_0x3249('0x9')](_0x35ac25);}return _0x372d45[_0x3249('0xa')](_0x35ac25)['end']();};}function respondWithResult(_0x35a052,_0x33238a){_0x33238a=_0x33238a||0xc8;return function(_0x26a23a){if(_0x26a23a){return _0x35a052[_0x3249('0xa')](_0x33238a)[_0x3249('0xb')](_0x26a23a);}};}function respondWithFilteredResult(_0xa80327,_0x2fe825){return function(_0x560305){if(_0x560305){var _0x105582=typeof _0x2fe825[_0x3249('0xc')]===_0x3249('0xd')&&typeof _0x2fe825[_0x3249('0xe')]==='undefined';var _0x2a0ea1=_0x560305['count'];var _0x4259d6=_0x105582?0x0:_0x2fe825[_0x3249('0xc')];var _0x1ce809=_0x105582?_0x560305['count']:_0x2fe825[_0x3249('0xc')]+_0x2fe825[_0x3249('0xe')];var _0xdd32a;if(_0x1ce809>=_0x2a0ea1){_0x1ce809=_0x2a0ea1;_0xdd32a=0xc8;}else{_0xdd32a=0xce;}_0xa80327['status'](_0xdd32a);return _0xa80327[_0x3249('0xf')]('Content-Range',_0x4259d6+'-'+_0x1ce809+'/'+_0x2a0ea1)[_0x3249('0xb')](_0x560305);}return null;};}function saveUpdates(_0xf8e12b){return function(_0x3036ca){if(_0x3036ca){return _0x3036ca['update'](_0xf8e12b)[_0x3249('0x10')](function(_0x1b0c8a){return _0x1b0c8a;});}return null;};}function removeEntity(_0x225bf0){return function(_0x2a06e0){if(_0x2a06e0){return _0x2a06e0[_0x3249('0x11')]()['then'](function(){_0x225bf0[_0x3249('0xa')](0xcc)[_0x3249('0x12')]();});}};}function handleEntityNotFound(_0x53077e){return function(_0x445882){if(!_0x445882){_0x53077e[_0x3249('0x9')](0x194);}return _0x445882;};}function handleError(_0x386f38,_0x220742){_0x220742=_0x220742||0x1f4;return function(_0x50ecd7){logger['error'](_0x50ecd7['stack']);if(_0x50ecd7['name']){delete _0x50ecd7[_0x3249('0x13')];}_0x386f38['status'](_0x220742)[_0x3249('0x14')](_0x50ecd7);};}function maskClientSecret(_0x1591c){return _['padEnd'](_0x1591c[_0x3249('0x15')](0x0,0x3),0x14,'*');}exports[_0x3249('0x16')]=function(_0x254de8,_0x4f546e){var _0x5692e5={},_0x41a914={},_0x337c55={'count':0x0,'rows':[]};var _0x39b256=_[_0x3249('0x17')](db[_0x3249('0x18')]['rawAttributes'],function(_0x544bfa){return{'name':_0x544bfa[_0x3249('0x19')],'type':_0x544bfa['type']['key']};});_0x41a914[_0x3249('0x1a')]=_['map'](_0x39b256,'name');_0x41a914[_0x3249('0x1b')]=_['keys'](_0x254de8['query']);_0x41a914[_0x3249('0x1c')]=_[_0x3249('0x1d')](_0x41a914[_0x3249('0x1a')],_0x41a914[_0x3249('0x1b')]);_0x5692e5[_0x3249('0x1e')]=_[_0x3249('0x1d')](_0x41a914[_0x3249('0x1a')],qs['fields'](_0x254de8['query'][_0x3249('0x1f')]));_0x5692e5[_0x3249('0x1e')]=_0x5692e5[_0x3249('0x1e')][_0x3249('0x20')]?_0x5692e5[_0x3249('0x1e')]:_0x41a914[_0x3249('0x1a')];if(!_0x254de8[_0x3249('0x1b')][_0x3249('0x21')](_0x3249('0x22'))){_0x5692e5[_0x3249('0xe')]=qs['limit'](_0x254de8[_0x3249('0x1b')]['limit']);_0x5692e5[_0x3249('0xc')]=qs[_0x3249('0xc')](_0x254de8[_0x3249('0x1b')][_0x3249('0xc')]);}_0x5692e5['order']=qs[_0x3249('0x23')](_0x254de8[_0x3249('0x1b')]['sort']);_0x5692e5[_0x3249('0x24')]=qs[_0x3249('0x1c')](_[_0x3249('0x25')](_0x254de8['query'],_0x41a914[_0x3249('0x1c')]),_0x39b256);if(_0x254de8[_0x3249('0x1b')][_0x3249('0x26')]){_0x5692e5[_0x3249('0x24')]=_[_0x3249('0x27')](_0x5692e5[_0x3249('0x24')],{'$or':_[_0x3249('0x17')](_0x39b256,function(_0x18ecbc){if(_0x18ecbc[_0x3249('0x28')]!==_0x3249('0x29')){var _0x2b8527={};_0x2b8527[_0x18ecbc['name']]={'$like':'%'+_0x254de8[_0x3249('0x1b')][_0x3249('0x26')]+'%'};return _0x2b8527;}})});}_0x5692e5=_[_0x3249('0x27')]({},_0x5692e5,_0x254de8[_0x3249('0x2a')]);var _0x559da6={'where':_0x5692e5[_0x3249('0x24')]};return db[_0x3249('0x18')][_0x3249('0x2b')](_0x559da6)[_0x3249('0x10')](function(_0x58b252){_0x337c55[_0x3249('0x2b')]=_0x58b252;if(_0x254de8[_0x3249('0x1b')]['includeAll']){_0x5692e5[_0x3249('0x2c')]=[{'all':!![]}];}return db[_0x3249('0x18')][_0x3249('0x2d')](_0x5692e5);})['then'](function(_0x2408c5){_0x337c55[_0x3249('0x2e')]=_['map'](_0x2408c5,function(_0x412623){if(_0x412623[_0x3249('0x2f')]===_0x3249('0x30')){var _0x508af7=encryptor[_0x3249('0x31')](_0x412623[_0x3249('0x32')]);_0x412623[_0x3249('0x32')]=maskClientSecret(_0x508af7);}return _0x412623;});return _0x337c55;})['then'](respondWithFilteredResult(_0x4f546e,_0x5692e5))[_0x3249('0x33')](handleError(_0x4f546e,null));};exports['show']=function(_0x8608d8,_0x57cdda){var _0x326832={'raw':!![],'where':{'id':_0x8608d8[_0x3249('0x34')]['id']}},_0x599ae5={};_0x599ae5[_0x3249('0x1a')]=_[_0x3249('0x35')](db[_0x3249('0x18')][_0x3249('0x36')]);_0x599ae5[_0x3249('0x1b')]=_['keys'](_0x8608d8['query']);_0x599ae5[_0x3249('0x1c')]=_['intersection'](_0x599ae5['model'],_0x599ae5[_0x3249('0x1b')]);_0x326832[_0x3249('0x1e')]=_['intersection'](_0x599ae5[_0x3249('0x1a')],qs[_0x3249('0x1f')](_0x8608d8[_0x3249('0x1b')][_0x3249('0x1f')]));_0x326832[_0x3249('0x1e')]=_0x326832[_0x3249('0x1e')]['length']?_0x326832['attributes']:_0x599ae5[_0x3249('0x1a')];if(_0x8608d8[_0x3249('0x1b')]['includeAll']){_0x326832[_0x3249('0x2c')]=[{'all':!![]}];}_0x326832=_[_0x3249('0x27')]({},_0x326832,_0x8608d8[_0x3249('0x2a')]);return db[_0x3249('0x18')][_0x3249('0x37')](_0x326832)['then'](handleEntityNotFound(_0x57cdda,null))[_0x3249('0x10')](function(_0x4778ee){if(_0x4778ee[_0x3249('0x2f')]==='MicrosoftAzure'){var _0x5d37df=encryptor[_0x3249('0x31')](_0x4778ee[_0x3249('0x32')]);_0x4778ee[_0x3249('0x32')]=maskClientSecret(_0x5d37df);}return _0x4778ee;})[_0x3249('0x10')](respondWithResult(_0x57cdda,null))['catch'](handleError(_0x57cdda,null));};exports['create']=function(_0x526b5a,_0x3c8a1d){if(!_0x526b5a[_0x3249('0x38')][_0x3249('0x13')])throw new Error(_0x3249('0x39'));if(!_0x526b5a[_0x3249('0x38')]['service'])throw new Error('Service\x20parameter\x20not\x20specified');var _0x3722c1=db['CloudProvider'][_0x3249('0x36')][_0x3249('0x2f')]['values'];if(!_0x3722c1[_0x3249('0x3a')](_0x526b5a[_0x3249('0x38')][_0x3249('0x2f')]))throw new Error(_0x3249('0x3b')+_0x3722c1[_0x3249('0x3c')](',\x20'));if(_0x526b5a[_0x3249('0x38')][_0x3249('0x2f')]===_0x3249('0x30')&&_0x526b5a[_0x3249('0x38')]['data3']){_0x526b5a[_0x3249('0x38')]['data3']=encryptor['encryptString'](_0x526b5a[_0x3249('0x38')][_0x3249('0x32')]);}return db[_0x3249('0x18')]['create'](_0x526b5a['body'],{})[_0x3249('0x10')](respondWithResult(_0x3c8a1d,0xc9))[_0x3249('0x33')](handleError(_0x3c8a1d,null));};exports[_0x3249('0x3d')]=function(_0x40ff45,_0x13426d){if(_0x40ff45[_0x3249('0x38')]['id']){delete _0x40ff45[_0x3249('0x38')]['id'];}return db[_0x3249('0x18')][_0x3249('0x37')]({'where':{'id':_0x40ff45[_0x3249('0x34')]['id']}})[_0x3249('0x10')](handleEntityNotFound(_0x13426d,null))[_0x3249('0x10')](function(_0x4f6166){if(_0x4f6166[_0x3249('0x2f')]===_0x3249('0x30')&&_0x40ff45[_0x3249('0x38')][_0x3249('0x32')]){_0x40ff45['body'][_0x3249('0x32')]=encryptor['encryptString'](_0x40ff45[_0x3249('0x38')][_0x3249('0x32')]);}return _0x4f6166;})[_0x3249('0x10')](saveUpdates(_0x40ff45[_0x3249('0x38')],null))[_0x3249('0x10')](respondWithResult(_0x13426d,null))[_0x3249('0x33')](handleError(_0x13426d,null));};exports[_0x3249('0x11')]=function(_0x360b38,_0x370d72){return db[_0x3249('0x18')][_0x3249('0x37')]({'where':{'id':_0x360b38[_0x3249('0x34')]['id']}})['then'](handleEntityNotFound(_0x370d72,null))['then'](removeEntity(_0x370d72,null))[_0x3249('0x33')](handleError(_0x370d72,null));};exports[_0x3249('0x3e')]=function(_0x36f0cc,_0x430944){return db[_0x3249('0x18')][_0x3249('0x3f')]({'where':{'id':_0x36f0cc[_0x3249('0x34')]['id']},'raw':!![]})['then'](function(_0x10d203){if(!_0x10d203)return _0x430944[_0x3249('0x9')](0x194);return{'url':oauth[_0x3249('0x40')](_0x10d203,_0x36f0cc[_0x3249('0x41')]['id'])};})[_0x3249('0x10')](respondWithResult(_0x430944,null))[_0x3249('0x33')](handleError(_0x430944,null));};exports[_0x3249('0x42')]=function(_0x2e280a,_0x21bfcb){var _0x15ba03=_0x2e280a[_0x3249('0x38')];var _0x5a54d6;var _0x40ab67;if(_0x15ba03[_0x3249('0x43')])throw _0x15ba03;redis[_0x3249('0x44')](_0x15ba03['state'])[_0x3249('0x10')](function(_0xa3b4cc){if(!_0xa3b4cc)throw new Error(_0x3249('0x45'));_0x5a54d6=JSON['parse'](_0xa3b4cc);var _0x474029=Buffer[_0x3249('0x46')](_0x15ba03[_0x3249('0x47')],_0x3249('0x48'))['toString'](_0x3249('0x49'));_0x40ab67=JSON['parse'](_0x474029);if(!oauth['isValidIdToken'](_0x15ba03['id_token'],_0x5a54d6['oauth2Claims']))throw new Error('Unable\x20to\x20validate\x20id_token');redis[_0x3249('0x4a')](_0x15ba03[_0x3249('0x47')]);return oauth[_0x3249('0x4b')](_0x15ba03['code'],_0x5a54d6);})[_0x3249('0x10')](function(_0xc58014){_0x5a54d6[_0x3249('0x4c')]=_0xc58014[_0x3249('0x4d')];_0x5a54d6[_0x3249('0x4e')]=_0xc58014[_0x3249('0x4f')];return db[_0x3249('0x18')][_0x3249('0x3d')]({'data5':_0x5a54d6[_0x3249('0x4c')],'data6':_0x5a54d6[_0x3249('0x4e')]},{'where':{'id':_0x5a54d6['id']}});})[_0x3249('0x10')](function(){oauth[_0x3249('0x50')](_0x5a54d6);socket[_0x3249('0x51')](_0x3249('0x52'),{'id':_0x40ab67['id']});return;})[_0x3249('0x10')](respondWithStatusCode(_0x21bfcb,null))['catch'](function(_0x6e9812){if(_0x40ab67){socket[_0x3249('0x51')]('microsoftAuthorization:error',{'id':_0x40ab67['id']});}if(!_0x5a54d6){logger[_0x3249('0x43')](_0x3249('0x53'),_0x6e9812);return _0x21bfcb[_0x3249('0xa')](0x1f4)[_0x3249('0x14')](_0x6e9812[_0x3249('0x54')]);}logger[_0x3249('0x43')](_0x3249('0x55'),_0x5a54d6['id'],JSON[_0x3249('0x56')](_0x6e9812));});};
\ No newline at end of file
+var _0x3dda=['count','limit','set','Content-Range','update','destroy','then','sendStatus','error','stack','name','padEnd','slice','index','map','CloudProvider','fieldName','type','key','model','query','filters','attributes','intersection','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','service','MicrosoftAzure','decryptString','data3','catch','show','rawAttributes','keys','fields','include','find','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','create','params','oauth2MicrosoftAuthorize','findOne','oauth2MicrosoftCallback','get','state','parse','from','toString','ascii','isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','data5','access_token','refresh_token','data6','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','send','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/logger','./cloudProvider.oauth','redis','defaults','socket.io-emitter','status','end','json','offset','undefined'];(function(_0x5351d4,_0x9fad72){var _0x158dd6=function(_0x21c0b4){while(--_0x21c0b4){_0x5351d4['push'](_0x5351d4['shift']());}};_0x158dd6(++_0x9fad72);}(_0x3dda,0x17a));var _0xa3dd=function(_0xfb073a,_0x248d58){_0xfb073a=_0xfb073a-0x0;var _0x4a0cd=_0x3dda[_0xfb073a];return _0x4a0cd;};'use strict';var _=require(_0xa3dd('0x0'));var Redis=require(_0xa3dd('0x1'));var qs=require(_0xa3dd('0x2'));var encryptor=require(_0xa3dd('0x3'));var config=require('../../config/environment');var logger=require(_0xa3dd('0x4'))('api');var db=require('../../mysqldb')['db'];var oauth=require(_0xa3dd('0x5'));config[_0xa3dd('0x6')]=_[_0xa3dd('0x7')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xa3dd('0x8'))(new Redis(config[_0xa3dd('0x6')]));var redis=new Redis(config[_0xa3dd('0x6')]);function respondWithStatusCode(_0x37bbbe,_0x5c8361){_0x5c8361=_0x5c8361||0xcc;return function(_0x4b699c){if(_0x4b699c){return _0x37bbbe['sendStatus'](_0x5c8361);}return _0x37bbbe[_0xa3dd('0x9')](_0x5c8361)[_0xa3dd('0xa')]();};}function respondWithResult(_0x2070e2,_0x3d67e9){_0x3d67e9=_0x3d67e9||0xc8;return function(_0x5d639e){if(_0x5d639e){return _0x2070e2[_0xa3dd('0x9')](_0x3d67e9)[_0xa3dd('0xb')](_0x5d639e);}};}function respondWithFilteredResult(_0x35705a,_0x2ea143){return function(_0x209c89){if(_0x209c89){var _0x3cc43c=typeof _0x2ea143[_0xa3dd('0xc')]==='undefined'&&typeof _0x2ea143['limit']===_0xa3dd('0xd');var _0x14279d=_0x209c89[_0xa3dd('0xe')];var _0xc3df35=_0x3cc43c?0x0:_0x2ea143[_0xa3dd('0xc')];var _0x451e43=_0x3cc43c?_0x209c89['count']:_0x2ea143[_0xa3dd('0xc')]+_0x2ea143[_0xa3dd('0xf')];var _0x29b6ce;if(_0x451e43>=_0x14279d){_0x451e43=_0x14279d;_0x29b6ce=0xc8;}else{_0x29b6ce=0xce;}_0x35705a['status'](_0x29b6ce);return _0x35705a[_0xa3dd('0x10')](_0xa3dd('0x11'),_0xc3df35+'-'+_0x451e43+'/'+_0x14279d)[_0xa3dd('0xb')](_0x209c89);}return null;};}function saveUpdates(_0x3c4d9f){return function(_0x23ee1f){if(_0x23ee1f){return _0x23ee1f[_0xa3dd('0x12')](_0x3c4d9f)['then'](function(_0x18f7e0){return _0x18f7e0;});}return null;};}function removeEntity(_0x945e79){return function(_0x3a5b8a){if(_0x3a5b8a){return _0x3a5b8a[_0xa3dd('0x13')]()[_0xa3dd('0x14')](function(){_0x945e79[_0xa3dd('0x9')](0xcc)[_0xa3dd('0xa')]();});}};}function handleEntityNotFound(_0x4afb7f){return function(_0xcf56e4){if(!_0xcf56e4){_0x4afb7f[_0xa3dd('0x15')](0x194);}return _0xcf56e4;};}function handleError(_0x243037,_0x2b19a5){_0x2b19a5=_0x2b19a5||0x1f4;return function(_0x552f1b){logger[_0xa3dd('0x16')](_0x552f1b[_0xa3dd('0x17')]);if(_0x552f1b[_0xa3dd('0x18')]){delete _0x552f1b[_0xa3dd('0x18')];}_0x243037[_0xa3dd('0x9')](_0x2b19a5)['send'](_0x552f1b);};}function maskClientSecret(_0x6040bd){return _[_0xa3dd('0x19')](_0x6040bd[_0xa3dd('0x1a')](0x0,0x3),0x14,'*');}exports[_0xa3dd('0x1b')]=function(_0x37eb39,_0x2119fb){var _0x19de62={},_0x14ef41={},_0x47fb61={'count':0x0,'rows':[]};var _0x411f90=_[_0xa3dd('0x1c')](db[_0xa3dd('0x1d')]['rawAttributes'],function(_0x20ee1f){return{'name':_0x20ee1f[_0xa3dd('0x1e')],'type':_0x20ee1f[_0xa3dd('0x1f')][_0xa3dd('0x20')]};});_0x14ef41[_0xa3dd('0x21')]=_[_0xa3dd('0x1c')](_0x411f90,_0xa3dd('0x18'));_0x14ef41[_0xa3dd('0x22')]=_['keys'](_0x37eb39[_0xa3dd('0x22')]);_0x14ef41[_0xa3dd('0x23')]=_['intersection'](_0x14ef41[_0xa3dd('0x21')],_0x14ef41[_0xa3dd('0x22')]);_0x19de62[_0xa3dd('0x24')]=_[_0xa3dd('0x25')](_0x14ef41[_0xa3dd('0x21')],qs['fields'](_0x37eb39['query']['fields']));_0x19de62[_0xa3dd('0x24')]=_0x19de62[_0xa3dd('0x24')]['length']?_0x19de62[_0xa3dd('0x24')]:_0x14ef41[_0xa3dd('0x21')];if(!_0x37eb39[_0xa3dd('0x22')][_0xa3dd('0x26')](_0xa3dd('0x27'))){_0x19de62[_0xa3dd('0xf')]=qs[_0xa3dd('0xf')](_0x37eb39[_0xa3dd('0x22')][_0xa3dd('0xf')]);_0x19de62[_0xa3dd('0xc')]=qs[_0xa3dd('0xc')](_0x37eb39[_0xa3dd('0x22')][_0xa3dd('0xc')]);}_0x19de62[_0xa3dd('0x28')]=qs[_0xa3dd('0x29')](_0x37eb39['query']['sort']);_0x19de62[_0xa3dd('0x2a')]=qs[_0xa3dd('0x23')](_[_0xa3dd('0x2b')](_0x37eb39[_0xa3dd('0x22')],_0x14ef41['filters']),_0x411f90);if(_0x37eb39[_0xa3dd('0x22')][_0xa3dd('0x2c')]){_0x19de62['where']=_[_0xa3dd('0x2d')](_0x19de62[_0xa3dd('0x2a')],{'$or':_['map'](_0x411f90,function(_0x3a8521){if(_0x3a8521['type']!==_0xa3dd('0x2e')){var _0x4c1e8c={};_0x4c1e8c[_0x3a8521[_0xa3dd('0x18')]]={'$like':'%'+_0x37eb39[_0xa3dd('0x22')][_0xa3dd('0x2c')]+'%'};return _0x4c1e8c;}})});}_0x19de62=_[_0xa3dd('0x2d')]({},_0x19de62,_0x37eb39[_0xa3dd('0x2f')]);var _0x454ce8={'where':_0x19de62['where']};return db['CloudProvider']['count'](_0x454ce8)[_0xa3dd('0x14')](function(_0x8dd7d0){_0x47fb61[_0xa3dd('0xe')]=_0x8dd7d0;if(_0x37eb39[_0xa3dd('0x22')][_0xa3dd('0x30')]){_0x19de62['include']=[{'all':!![]}];}return db['CloudProvider'][_0xa3dd('0x31')](_0x19de62);})[_0xa3dd('0x14')](function(_0x48b6b4){_0x47fb61['rows']=_[_0xa3dd('0x1c')](_0x48b6b4,function(_0xda0977){if(_0xda0977[_0xa3dd('0x32')]===_0xa3dd('0x33')){var _0x31cb65=encryptor[_0xa3dd('0x34')](_0xda0977['data3']);_0xda0977[_0xa3dd('0x35')]=maskClientSecret(_0x31cb65);}return _0xda0977;});return _0x47fb61;})[_0xa3dd('0x14')](respondWithFilteredResult(_0x2119fb,_0x19de62))[_0xa3dd('0x36')](handleError(_0x2119fb,null));};exports[_0xa3dd('0x37')]=function(_0x240465,_0x5614e0){var _0x1b464b={'raw':!![],'where':{'id':_0x240465['params']['id']}},_0x1c2f4e={};_0x1c2f4e[_0xa3dd('0x21')]=_['keys'](db[_0xa3dd('0x1d')][_0xa3dd('0x38')]);_0x1c2f4e[_0xa3dd('0x22')]=_[_0xa3dd('0x39')](_0x240465[_0xa3dd('0x22')]);_0x1c2f4e[_0xa3dd('0x23')]=_[_0xa3dd('0x25')](_0x1c2f4e[_0xa3dd('0x21')],_0x1c2f4e[_0xa3dd('0x22')]);_0x1b464b[_0xa3dd('0x24')]=_[_0xa3dd('0x25')](_0x1c2f4e[_0xa3dd('0x21')],qs['fields'](_0x240465[_0xa3dd('0x22')][_0xa3dd('0x3a')]));_0x1b464b[_0xa3dd('0x24')]=_0x1b464b[_0xa3dd('0x24')]['length']?_0x1b464b[_0xa3dd('0x24')]:_0x1c2f4e[_0xa3dd('0x21')];if(_0x240465[_0xa3dd('0x22')][_0xa3dd('0x30')]){_0x1b464b[_0xa3dd('0x3b')]=[{'all':!![]}];}_0x1b464b=_[_0xa3dd('0x2d')]({},_0x1b464b,_0x240465[_0xa3dd('0x2f')]);return db['CloudProvider'][_0xa3dd('0x3c')](_0x1b464b)[_0xa3dd('0x14')](handleEntityNotFound(_0x5614e0,null))[_0xa3dd('0x14')](function(_0x210f75){if(_0x210f75[_0xa3dd('0x32')]==='MicrosoftAzure'){var _0x9b0ee0=encryptor['decryptString'](_0x210f75['data3']);_0x210f75['data3']=maskClientSecret(_0x9b0ee0);}return _0x210f75;})[_0xa3dd('0x14')](respondWithResult(_0x5614e0,null))[_0xa3dd('0x36')](handleError(_0x5614e0,null));};exports['create']=function(_0xf968aa,_0x123e82){if(!_0xf968aa[_0xa3dd('0x3d')][_0xa3dd('0x18')])throw new Error(_0xa3dd('0x3e'));if(!_0xf968aa['body'][_0xa3dd('0x32')])throw new Error(_0xa3dd('0x3f'));var _0x2cd603=db[_0xa3dd('0x1d')][_0xa3dd('0x38')][_0xa3dd('0x32')][_0xa3dd('0x40')];if(!_0x2cd603[_0xa3dd('0x41')](_0xf968aa[_0xa3dd('0x3d')][_0xa3dd('0x32')]))throw new Error(_0xa3dd('0x42')+_0x2cd603[_0xa3dd('0x43')](',\x20'));if(_0xf968aa[_0xa3dd('0x3d')]['service']===_0xa3dd('0x33')&&_0xf968aa[_0xa3dd('0x3d')][_0xa3dd('0x35')]){_0xf968aa[_0xa3dd('0x3d')][_0xa3dd('0x35')]=encryptor[_0xa3dd('0x44')](_0xf968aa['body'][_0xa3dd('0x35')]);}return db[_0xa3dd('0x1d')][_0xa3dd('0x45')](_0xf968aa['body'],{})['then'](respondWithResult(_0x123e82,0xc9))[_0xa3dd('0x36')](handleError(_0x123e82,null));};exports[_0xa3dd('0x12')]=function(_0x74f826,_0x244beb){if(_0x74f826[_0xa3dd('0x3d')]['id']){delete _0x74f826[_0xa3dd('0x3d')]['id'];}return db[_0xa3dd('0x1d')][_0xa3dd('0x3c')]({'where':{'id':_0x74f826[_0xa3dd('0x46')]['id']}})[_0xa3dd('0x14')](handleEntityNotFound(_0x244beb,null))[_0xa3dd('0x14')](function(_0x4c50eb){if(_0x4c50eb[_0xa3dd('0x32')]===_0xa3dd('0x33')&&_0x74f826[_0xa3dd('0x3d')][_0xa3dd('0x35')]){_0x74f826[_0xa3dd('0x3d')][_0xa3dd('0x35')]=encryptor[_0xa3dd('0x44')](_0x74f826['body'][_0xa3dd('0x35')]);}return _0x4c50eb;})['then'](saveUpdates(_0x74f826[_0xa3dd('0x3d')],null))[_0xa3dd('0x14')](respondWithResult(_0x244beb,null))[_0xa3dd('0x36')](handleError(_0x244beb,null));};exports[_0xa3dd('0x13')]=function(_0x309fda,_0x3f7285){return db[_0xa3dd('0x1d')][_0xa3dd('0x3c')]({'where':{'id':_0x309fda['params']['id']}})[_0xa3dd('0x14')](handleEntityNotFound(_0x3f7285,null))[_0xa3dd('0x14')](removeEntity(_0x3f7285,null))['catch'](handleError(_0x3f7285,null));};exports[_0xa3dd('0x47')]=function(_0x31f029,_0x3c6ffb){return db[_0xa3dd('0x1d')][_0xa3dd('0x48')]({'where':{'id':_0x31f029['params']['id']},'raw':!![]})[_0xa3dd('0x14')](function(_0x510598){if(!_0x510598)return _0x3c6ffb[_0xa3dd('0x15')](0x194);return{'url':oauth['generateMicrosoftAuthorizationUrl'](_0x510598,_0x31f029['user']['id'])};})[_0xa3dd('0x14')](respondWithResult(_0x3c6ffb,null))[_0xa3dd('0x36')](handleError(_0x3c6ffb,null));};exports[_0xa3dd('0x49')]=function(_0x13f1b0,_0x5e303a){var _0x16a445=_0x13f1b0[_0xa3dd('0x3d')];var _0x3d54f0;var _0x1c8a1c;if(_0x16a445['error'])throw _0x16a445;redis[_0xa3dd('0x4a')](_0x16a445[_0xa3dd('0x4b')])[_0xa3dd('0x14')](function(_0x4beff3){if(!_0x4beff3)throw new Error('Invalid\x20state\x20parameter');_0x3d54f0=JSON[_0xa3dd('0x4c')](_0x4beff3);var _0x1c7bf4=Buffer[_0xa3dd('0x4d')](_0x16a445['state'],'base64')[_0xa3dd('0x4e')](_0xa3dd('0x4f'));_0x1c8a1c=JSON['parse'](_0x1c7bf4);if(!oauth[_0xa3dd('0x50')](_0x16a445[_0xa3dd('0x51')],_0x3d54f0[_0xa3dd('0x52')]))throw new Error(_0xa3dd('0x53'));redis[_0xa3dd('0x54')](_0x16a445[_0xa3dd('0x4b')]);return oauth[_0xa3dd('0x55')](_0x16a445['code'],_0x3d54f0);})['then'](function(_0x271398){_0x3d54f0[_0xa3dd('0x56')]=_0x271398[_0xa3dd('0x57')];_0x3d54f0['data6']=_0x271398[_0xa3dd('0x58')];return db[_0xa3dd('0x1d')][_0xa3dd('0x12')]({'data5':_0x3d54f0[_0xa3dd('0x56')],'data6':_0x3d54f0[_0xa3dd('0x59')]},{'where':{'id':_0x3d54f0['id']}});})[_0xa3dd('0x14')](function(){oauth[_0xa3dd('0x5a')](_0x3d54f0);socket[_0xa3dd('0x5b')](_0xa3dd('0x5c'),{'id':_0x1c8a1c['id']});return;})['then'](respondWithStatusCode(_0x5e303a,null))['catch'](function(_0x1cb1a3){if(_0x1c8a1c){socket[_0xa3dd('0x5b')](_0xa3dd('0x5d'),{'id':_0x1c8a1c['id']});}if(!_0x3d54f0){logger[_0xa3dd('0x16')](_0xa3dd('0x5e'),_0x1cb1a3);return _0x5e303a[_0xa3dd('0x9')](0x1f4)[_0xa3dd('0x5f')](_0x1cb1a3['message']);}logger[_0xa3dd('0x16')](_0xa3dd('0x60'),_0x3d54f0['id'],JSON[_0xa3dd('0x61')](_0x1cb1a3));});};
\ No newline at end of file
index f49a424..2f05ecc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x52cb=['cloud_providers','lodash','util','../../config/logger','moment','bluebird','request-promise','../../config/environment','./cloudProvider.attributes','exports','define','CloudProvider'];(function(_0x53fc13,_0x5e225d){var _0x5e5a5e=function(_0x4410bf){while(--_0x4410bf){_0x53fc13['push'](_0x53fc13['shift']());}};_0x5e5a5e(++_0x5e225d);}(_0x52cb,0x115));var _0xb52c=function(_0x3f765d,_0x1a42f0){_0x3f765d=_0x3f765d-0x0;var _0x2861e0=_0x52cb[_0x3f765d];return _0x2861e0;};'use strict';var _=require(_0xb52c('0x0'));var util=require(_0xb52c('0x1'));var logger=require(_0xb52c('0x2'))('api');var moment=require(_0xb52c('0x3'));var BPromise=require(_0xb52c('0x4'));var rp=require(_0xb52c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xb52c('0x6'));var attributes=require(_0xb52c('0x7'));module[_0xb52c('0x8')]=function(_0x551b65,_0x4770aa){return _0x551b65[_0xb52c('0x9')](_0xb52c('0xa'),attributes,{'tableName':_0xb52c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa9b8=['exports','CloudProvider','cloud_providers','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x523b92,_0x25d6b8){var _0x1a5e3b=function(_0x4e594e){while(--_0x4e594e){_0x523b92['push'](_0x523b92['shift']());}};_0x1a5e3b(++_0x25d6b8);}(_0xa9b8,0x12e));var _0x8a9b=function(_0x36af9a,_0x17b203){_0x36af9a=_0x36af9a-0x0;var _0x40abc9=_0xa9b8[_0x36af9a];return _0x40abc9;};'use strict';var _=require(_0x8a9b('0x0'));var util=require(_0x8a9b('0x1'));var logger=require(_0x8a9b('0x2'))(_0x8a9b('0x3'));var moment=require(_0x8a9b('0x4'));var BPromise=require(_0x8a9b('0x5'));var rp=require(_0x8a9b('0x6'));var fs=require('fs');var path=require(_0x8a9b('0x7'));var rimraf=require(_0x8a9b('0x8'));var config=require(_0x8a9b('0x9'));var attributes=require('./cloudProvider.attributes');module[_0x8a9b('0xa')]=function(_0x5b9a79,_0x517925){return _0x5b9a79['define'](_0x8a9b('0xb'),attributes,{'tableName':_0x8a9b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index c85fbcf..14038dd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5994=['data1','redirect_uri','data4','form_post','scope','nonce','prompt','map','value','replace','oauth2/','set','payload','iss','audience','isAfter','unix','exp','data3','CloudProvider','findOne','refresh_token','data6','decryptString','POST','{TENANT_ID}','then','data5','update','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','intervals','bind','findAll','all','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','crypto','moment','ioredis','request-promise','util','../../components/encryptor','../../config/environment','../../config/logger','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','localhost','openid','profile','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/authorize','type','Dynamics365','push','/.default','join','Outlook365','data7','data2','id_token','stringify','toString','base64','randomBytes','hex','client_id'];(function(_0x215fde,_0x222c24){var _0x16a010=function(_0x1a024f){while(--_0x1a024f){_0x215fde['push'](_0x215fde['shift']());}};_0x16a010(++_0x222c24);}(_0x5994,0xba));var _0x4599=function(_0x1e3846,_0x494be8){_0x1e3846=_0x1e3846-0x0;var _0x538e67=_0x5994[_0x1e3846];return _0x538e67;};'use strict';var _=require('lodash');var crypto=require(_0x4599('0x0'));var jwt=require('jsonwebtoken');var moment=require(_0x4599('0x1'));var Redis=require(_0x4599('0x2'));var rp=require(_0x4599('0x3'));var util=require(_0x4599('0x4'));var encryptor=require(_0x4599('0x5'));var config=require(_0x4599('0x6'));var logger=require(_0x4599('0x7'))('api');var schedule=require(_0x4599('0x8'));var db=require(_0x4599('0x9'))['db'];config[_0x4599('0xa')]=_[_0x4599('0xb')](config[_0x4599('0xa')],{'host':_0x4599('0xc'),'port':0x18eb});var redis=new Redis(config[_0x4599('0xa')]);var MICROSOFT_AUTH_URL='https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0';var AZURE_AUTH_SCOPES={'Outlook365':[_0x4599('0xd'),_0x4599('0xe'),_0x4599('0xf'),_0x4599('0x10'),_0x4599('0x11'),_0x4599('0x12'),_0x4599('0x13')],'Dynamics365':[_0x4599('0xd'),_0x4599('0x10')]};var MICROSOFT_AUTH_ENDPOINT=_0x4599('0x14');var MICROSOFT_TOKEN_ENDPOINT='/token';var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x3a6eb0){var _0x261d7b=_['map'](AZURE_AUTH_SCOPES[_0x3a6eb0[_0x4599('0x15')]]);if(_0x3a6eb0[_0x4599('0x15')]===_0x4599('0x16'))_0x261d7b[_0x4599('0x17')](_0x3a6eb0['data7']+_0x4599('0x18'));return _0x261d7b[_0x4599('0x19')]('\x20');}function getAccessTokenScope(_0x2888db){if(_0x2888db[_0x4599('0x15')]===_0x4599('0x1a'))return _0x4599('0x11');if(_0x2888db['type']===_0x4599('0x16'))return _0x2888db[_0x4599('0x1b')]+_0x4599('0x18');}function generateMicrosoftAuthorizationUrl(_0x153e93,_0x7816bd){var _0x3ab011=MICROSOFT_AUTH_URL['replace']('{TENANT_ID}',_0x153e93[_0x4599('0x1c')]);var _0x1d4cd1=['code',_0x4599('0x1d')];var _0x2a1db6=Buffer['from'](JSON[_0x4599('0x1e')]({'id':_0x7816bd}))[_0x4599('0x1f')](_0x4599('0x20'));var _0x188404=crypto[_0x4599('0x21')](0x10)[_0x4599('0x1f')](_0x4599('0x22'));var _0x5a1fc0=getAuthorizationScopes(_0x153e93);var _0x7217cc=[{'key':_0x4599('0x23'),'value':_0x153e93[_0x4599('0x24')]},{'key':'response_type','value':encodeURIComponent(_0x1d4cd1['join']('\x20'))},{'key':_0x4599('0x25'),'value':_0x153e93[_0x4599('0x26')]},{'key':'response_mode','value':_0x4599('0x27')},{'key':_0x4599('0x28'),'value':encodeURIComponent(_0x5a1fc0)},{'key':'state','value':_0x2a1db6},{'key':_0x4599('0x29'),'value':_0x188404},{'key':_0x4599('0x2a'),'value':'login'}];var _0x59b67e=_0x3ab011+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x4599('0x2b')](_0x7217cc,function(_0x96cfb5){return _0x96cfb5['key']+'='+_0x96cfb5[_0x4599('0x2c')];})[_0x4599('0x19')]('&');_0x153e93['oauth2Claims']={'issuer':_0x3ab011[_0x4599('0x2d')](_0x4599('0x2e'),''),'audience':_0x153e93[_0x4599('0x24')],'state':_0x2a1db6,'nonce':_0x188404};redis[_0x4599('0x2f')](_0x2a1db6,JSON['stringify'](_0x153e93));return _0x59b67e;}function isValidIdToken(_0x332942,_0x357b4b){try{var _0x5bd01d=jwt['decode'](_0x332942,{'complete':!![]});var _0x2d392c=_0x5bd01d[_0x4599('0x30')];if(_0x2d392c[_0x4599('0x31')]!==_0x357b4b['issuer'])return![];if(_0x2d392c['aud']!==_0x357b4b[_0x4599('0x32')])return![];if(_0x2d392c['nonce']!==_0x357b4b[_0x4599('0x29')])return![];if(moment()[_0x4599('0x33')](moment[_0x4599('0x34')](_0x2d392c[_0x4599('0x35')])))return![];return!![];}catch(_0x3191d3){throw _0x3191d3;}}function refreshOauth2MicrosoftAccessToken(_0x584379){return Promise['resolve']()['then'](function(){if(_0x584379[_0x4599('0x36')])return _0x584379;return db[_0x4599('0x37')][_0x4599('0x38')]({'where':{'id':_0x584379['id']},'raw':!![]});})['then'](function(_0xd776ad){var _0x522758={'grant_type':_0x4599('0x39'),'refresh_token':_0xd776ad[_0x4599('0x3a')],'scope':getAccessTokenScope(_0xd776ad),'redirect_uri':_0xd776ad[_0x4599('0x26')],'client_id':_0xd776ad['data1'],'client_secret':encryptor[_0x4599('0x3b')](_0xd776ad['data3'])};var _0x1d2acc={'method':_0x4599('0x3c'),'uri':MICROSOFT_AUTH_URL[_0x4599('0x2d')](_0x4599('0x3d'),_0xd776ad['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x522758,'json':!![]};return rp(_0x1d2acc);})[_0x4599('0x3e')](function(_0x2d1dc9){_0x584379[_0x4599('0x3f')]=_0x2d1dc9['access_token'];_0x584379[_0x4599('0x3a')]=_0x2d1dc9['refresh_token'];return db[_0x4599('0x37')][_0x4599('0x40')]({'data5':_0x584379[_0x4599('0x3f')],'data6':_0x584379[_0x4599('0x3a')]},{'where':{'id':_0x584379['id']}});})[_0x4599('0x3e')](function(){return _0x584379;})[_0x4599('0x41')](function(_0x25cd53){logger[_0x4599('0x42')](_0x4599('0x43'),_0x584379['id'],_0x25cd53);});}function getOauth2MicrosoftAccessToken(_0xebb46e,_0x30c7f0){var _0x3cc16e={'grant_type':'authorization_code','code':_0xebb46e,'scope':getAccessTokenScope(_0x30c7f0),'redirect_uri':_0x30c7f0['data4'],'client_id':_0x30c7f0['data1'],'client_secret':encryptor[_0x4599('0x3b')](_0x30c7f0[_0x4599('0x36')])};var _0x53dbba={'method':_0x4599('0x3c'),'uri':MICROSOFT_AUTH_URL[_0x4599('0x2d')]('{TENANT_ID}',_0x30c7f0[_0x4599('0x1c')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x3cc16e,'json':!![]};return rp(_0x53dbba);}function startRefreshInterval(_0x4e7042){var _0x578631=schedule[_0x4599('0x44')];if(_0x578631[_0x4e7042['id']])clearInterval(_0x578631[_0x4e7042['id']]);_0x578631[_0x4e7042['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x4599('0x45')](this,{'id':_0x4e7042['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x4599('0x44')]=_0x578631;}function startAllRefreshIntervals(){return db['CloudProvider'][_0x4599('0x46')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x4599('0x3e')](function(_0x237249){var _0x135c48=_0x237249[_0x4599('0x2b')](function(_0x5161c3){return refreshOauth2MicrosoftAccessToken(_0x5161c3)[_0x4599('0x3e')](function(_0x2b9704){startRefreshInterval(_0x2b9704);});});return Promise[_0x4599('0x47')](_0x135c48);})[_0x4599('0x41')](function(_0x5f51d4){var _0x14ba79=_0x5f51d4?util[_0x4599('0x48')](_0x5f51d4,{'showHidden':![],'depth':null}):'';logger[_0x4599('0x42')](_0x4599('0x49'),_0x14ba79);});}module['exports']={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
+var _0xbad1=['POST','{TENANT_ID}','data2','data5','access_token','update','catch','error','authorization_code','intervals','bind','all','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','crypto','jsonwebtoken','ioredis','util','../../components/encryptor','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','defaults','redis','localhost','openid','profile','offline_access','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/authorize','/token','map','type','Dynamics365','data7','/.default','Outlook365','https://outlook.office365.com/IMAP.AccessAsUser.All','replace','code','id_token','from','stringify','toString','randomBytes','hex','client_id','response_type','join','redirect_uri','data4','response_mode','form_post','state','nonce','prompt','login','oauth2Claims','data1','decode','payload','iss','issuer','aud','unix','exp','resolve','then','data3','CloudProvider','findOne','refresh_token','data6','decryptString'];(function(_0x3ba57e,_0x2e6810){var _0x5d95cf=function(_0x8017a0){while(--_0x8017a0){_0x3ba57e['push'](_0x3ba57e['shift']());}};_0x5d95cf(++_0x2e6810);}(_0xbad1,0x1e3));var _0x1bad=function(_0x2049d1,_0x32a702){_0x2049d1=_0x2049d1-0x0;var _0x2f4f35=_0xbad1[_0x2049d1];return _0x2f4f35;};'use strict';var _=require(_0x1bad('0x0'));var crypto=require(_0x1bad('0x1'));var jwt=require(_0x1bad('0x2'));var moment=require('moment');var Redis=require(_0x1bad('0x3'));var rp=require('request-promise');var util=require(_0x1bad('0x4'));var encryptor=require(_0x1bad('0x5'));var config=require('../../config/environment');var logger=require(_0x1bad('0x6'))(_0x1bad('0x7'));var schedule=require(_0x1bad('0x8'));var db=require(_0x1bad('0x9'))['db'];config['redis']=_[_0x1bad('0xa')](config[_0x1bad('0xb')],{'host':_0x1bad('0xc'),'port':0x18eb});var redis=new Redis(config[_0x1bad('0xb')]);var MICROSOFT_AUTH_URL='https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0';var AZURE_AUTH_SCOPES={'Outlook365':[_0x1bad('0xd'),_0x1bad('0xe'),'email',_0x1bad('0xf'),'https://outlook.office365.com/IMAP.AccessAsUser.All',_0x1bad('0x10'),_0x1bad('0x11')],'Dynamics365':['openid',_0x1bad('0xf')]};var MICROSOFT_AUTH_ENDPOINT=_0x1bad('0x12');var MICROSOFT_TOKEN_ENDPOINT=_0x1bad('0x13');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x1a78af){var _0x4193fc=_[_0x1bad('0x14')](AZURE_AUTH_SCOPES[_0x1a78af['type']]);if(_0x1a78af[_0x1bad('0x15')]===_0x1bad('0x16'))_0x4193fc['push'](_0x1a78af[_0x1bad('0x17')]+_0x1bad('0x18'));return _0x4193fc['join']('\x20');}function getAccessTokenScope(_0x2a67ec){if(_0x2a67ec[_0x1bad('0x15')]===_0x1bad('0x19'))return _0x1bad('0x1a');if(_0x2a67ec['type']===_0x1bad('0x16'))return _0x2a67ec['data7']+_0x1bad('0x18');}function generateMicrosoftAuthorizationUrl(_0x4013d7,_0x2180e7){var _0x3be3f7=MICROSOFT_AUTH_URL[_0x1bad('0x1b')]('{TENANT_ID}',_0x4013d7['data2']);var _0x4b0cec=[_0x1bad('0x1c'),_0x1bad('0x1d')];var _0x34bfa9=Buffer[_0x1bad('0x1e')](JSON[_0x1bad('0x1f')]({'id':_0x2180e7}))[_0x1bad('0x20')]('base64');var _0x124fb1=crypto[_0x1bad('0x21')](0x10)['toString'](_0x1bad('0x22'));var _0x41f0ad=getAuthorizationScopes(_0x4013d7);var _0x1f0ec8=[{'key':_0x1bad('0x23'),'value':_0x4013d7['data1']},{'key':_0x1bad('0x24'),'value':encodeURIComponent(_0x4b0cec[_0x1bad('0x25')]('\x20'))},{'key':_0x1bad('0x26'),'value':_0x4013d7[_0x1bad('0x27')]},{'key':_0x1bad('0x28'),'value':_0x1bad('0x29')},{'key':'scope','value':encodeURIComponent(_0x41f0ad)},{'key':_0x1bad('0x2a'),'value':_0x34bfa9},{'key':_0x1bad('0x2b'),'value':_0x124fb1},{'key':_0x1bad('0x2c'),'value':_0x1bad('0x2d')}];var _0x257cdc=_0x3be3f7+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x1bad('0x14')](_0x1f0ec8,function(_0x14f023){return _0x14f023['key']+'='+_0x14f023['value'];})[_0x1bad('0x25')]('&');_0x4013d7[_0x1bad('0x2e')]={'issuer':_0x3be3f7[_0x1bad('0x1b')]('oauth2/',''),'audience':_0x4013d7[_0x1bad('0x2f')],'state':_0x34bfa9,'nonce':_0x124fb1};redis['set'](_0x34bfa9,JSON[_0x1bad('0x1f')](_0x4013d7));return _0x257cdc;}function isValidIdToken(_0x3fb048,_0x53959c){try{var _0x5216e7=jwt[_0x1bad('0x30')](_0x3fb048,{'complete':!![]});var _0x17fdde=_0x5216e7[_0x1bad('0x31')];if(_0x17fdde[_0x1bad('0x32')]!==_0x53959c[_0x1bad('0x33')])return![];if(_0x17fdde[_0x1bad('0x34')]!==_0x53959c['audience'])return![];if(_0x17fdde[_0x1bad('0x2b')]!==_0x53959c[_0x1bad('0x2b')])return![];if(moment()['isAfter'](moment[_0x1bad('0x35')](_0x17fdde[_0x1bad('0x36')])))return![];return!![];}catch(_0x2633b0){throw _0x2633b0;}}function refreshOauth2MicrosoftAccessToken(_0x20d85f){return Promise[_0x1bad('0x37')]()[_0x1bad('0x38')](function(){if(_0x20d85f[_0x1bad('0x39')])return _0x20d85f;return db[_0x1bad('0x3a')][_0x1bad('0x3b')]({'where':{'id':_0x20d85f['id']},'raw':!![]});})[_0x1bad('0x38')](function(_0x1963f4){var _0x193a77={'grant_type':_0x1bad('0x3c'),'refresh_token':_0x1963f4[_0x1bad('0x3d')],'scope':getAccessTokenScope(_0x1963f4),'redirect_uri':_0x1963f4[_0x1bad('0x27')],'client_id':_0x1963f4[_0x1bad('0x2f')],'client_secret':encryptor[_0x1bad('0x3e')](_0x1963f4[_0x1bad('0x39')])};var _0x1e54d8={'method':_0x1bad('0x3f'),'uri':MICROSOFT_AUTH_URL[_0x1bad('0x1b')](_0x1bad('0x40'),_0x1963f4[_0x1bad('0x41')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x193a77,'json':!![]};return rp(_0x1e54d8);})['then'](function(_0x2de0e4){_0x20d85f[_0x1bad('0x42')]=_0x2de0e4[_0x1bad('0x43')];_0x20d85f[_0x1bad('0x3d')]=_0x2de0e4['refresh_token'];return db[_0x1bad('0x3a')][_0x1bad('0x44')]({'data5':_0x20d85f[_0x1bad('0x42')],'data6':_0x20d85f['data6']},{'where':{'id':_0x20d85f['id']}});})[_0x1bad('0x38')](function(){return _0x20d85f;})[_0x1bad('0x45')](function(_0x575f7f){logger[_0x1bad('0x46')]('Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s',_0x20d85f['id'],_0x575f7f);});}function getOauth2MicrosoftAccessToken(_0x260ee6,_0x56d4b5){var _0x55fb46={'grant_type':_0x1bad('0x47'),'code':_0x260ee6,'scope':getAccessTokenScope(_0x56d4b5),'redirect_uri':_0x56d4b5[_0x1bad('0x27')],'client_id':_0x56d4b5[_0x1bad('0x2f')],'client_secret':encryptor[_0x1bad('0x3e')](_0x56d4b5[_0x1bad('0x39')])};var _0x570c12={'method':_0x1bad('0x3f'),'uri':MICROSOFT_AUTH_URL[_0x1bad('0x1b')](_0x1bad('0x40'),_0x56d4b5[_0x1bad('0x41')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x55fb46,'json':!![]};return rp(_0x570c12);}function startRefreshInterval(_0x50b6a8){var _0x43fb37=schedule[_0x1bad('0x48')];if(_0x43fb37[_0x50b6a8['id']])clearInterval(_0x43fb37[_0x50b6a8['id']]);_0x43fb37[_0x50b6a8['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x1bad('0x49')](this,{'id':_0x50b6a8['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x1bad('0x48')]=_0x43fb37;}function startAllRefreshIntervals(){return db[_0x1bad('0x3a')]['findAll']({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x1bad('0x38')](function(_0x5b15b7){var _0x4d677b=_0x5b15b7['map'](function(_0x495290){return refreshOauth2MicrosoftAccessToken(_0x495290)[_0x1bad('0x38')](function(_0x1903fe){startRefreshInterval(_0x1903fe);});});return Promise[_0x1bad('0x4a')](_0x4d677b);})['catch'](function(_0x4d0e07){var _0x18c229=_0x4d0e07?util[_0x1bad('0x4b')](_0x4d0e07,{'showHidden':![],'depth':null}):'';logger['error'](_0x1bad('0x4c'),_0x18c229);});}module[_0x1bad('0x4d')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
index b6f2358..ee3789b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x566f=['../../config/utils','rpc','../../config/environment','jayson/promise','client','request','info','CloudProvider,\x20%s,\x20%s','request\x20sent','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x53de3f,_0xcbed3){var _0x251907=function(_0x24db88){while(--_0x24db88){_0x53de3f['push'](_0x53de3f['shift']());}};_0x251907(++_0xcbed3);}(_0x566f,0x124));var _0xf566=function(_0x16a1f9,_0x356c7d){_0x16a1f9=_0x16a1f9-0x0;var _0x1000dd=_0x566f[_0x16a1f9];return _0x1000dd;};'use strict';var _=require(_0xf566('0x0'));var util=require(_0xf566('0x1'));var moment=require(_0xf566('0x2'));var BPromise=require(_0xf566('0x3'));var rs=require(_0xf566('0x4'));var fs=require('fs');var Redis=require(_0xf566('0x5'));var db=require(_0xf566('0x6'))['db'];var utils=require(_0xf566('0x7'));var logger=require('../../config/logger')(_0xf566('0x8'));var config=require(_0xf566('0x9'));var jayson=require(_0xf566('0xa'));var client=jayson[_0xf566('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0xacfc48,_0x354e78,_0x3af552){return new BPromise(function(_0x1e33fa,_0x588e82){return client[_0xf566('0xc')](_0xacfc48,_0x3af552)['then'](function(_0x112610){logger[_0xf566('0xd')](_0xf566('0xe'),_0x354e78,_0xf566('0xf'));logger['debug'](_0xf566('0x10'),_0x354e78,_0xf566('0xf'),JSON[_0xf566('0x11')](_0x112610));if(_0x112610[_0xf566('0x12')]){if(_0x112610[_0xf566('0x12')][_0xf566('0x13')]===0x1f4){logger[_0xf566('0x12')](_0xf566('0xe'),_0x354e78,_0x112610['error'][_0xf566('0x14')]);return _0x588e82(_0x112610[_0xf566('0x12')][_0xf566('0x14')]);}logger[_0xf566('0x12')]('CloudProvider,\x20%s,\x20%s',_0x354e78,_0x112610[_0xf566('0x12')]['message']);return _0x1e33fa(_0x112610['error'][_0xf566('0x14')]);}else{logger[_0xf566('0xd')]('CloudProvider,\x20%s,\x20%s',_0x354e78,_0xf566('0xf'));_0x1e33fa(_0x112610[_0xf566('0x15')]['message']);}})[_0xf566('0x16')](function(_0x5e208d){logger[_0xf566('0x12')]('CloudProvider,\x20%s,\x20%s',_0x354e78,_0x5e208d);_0x588e82(_0x5e208d);});});}
\ No newline at end of file
+var _0x160c=['error','code','message','result','catch','util','moment','bluebird','../../config/utils','rpc','../../config/environment','jayson/promise','http','then','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x1fcaf1,_0x21c3c2){var _0x55f464=function(_0x348eb3){while(--_0x348eb3){_0x1fcaf1['push'](_0x1fcaf1['shift']());}};_0x55f464(++_0x21c3c2);}(_0x160c,0x181));var _0xc160=function(_0x2e938d,_0x888278){_0x2e938d=_0x2e938d-0x0;var _0x2ea295=_0x160c[_0x2e938d];return _0x2ea295;};'use strict';var _=require('lodash');var util=require(_0xc160('0x0'));var moment=require(_0xc160('0x1'));var BPromise=require(_0xc160('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xc160('0x3'));var logger=require('../../config/logger')(_0xc160('0x4'));var config=require(_0xc160('0x5'));var jayson=require(_0xc160('0x6'));var client=jayson['client'][_0xc160('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5dfb45,_0x26e1f4,_0x549651){return new BPromise(function(_0x359ac9,_0x30c90e){return client['request'](_0x5dfb45,_0x549651)[_0xc160('0x8')](function(_0x208643){logger['info'](_0xc160('0x9'),_0x26e1f4,_0xc160('0xa'));logger[_0xc160('0xb')](_0xc160('0xc'),_0x26e1f4,_0xc160('0xa'),JSON[_0xc160('0xd')](_0x208643));if(_0x208643[_0xc160('0xe')]){if(_0x208643[_0xc160('0xe')][_0xc160('0xf')]===0x1f4){logger['error'](_0xc160('0x9'),_0x26e1f4,_0x208643[_0xc160('0xe')]['message']);return _0x30c90e(_0x208643[_0xc160('0xe')][_0xc160('0x10')]);}logger[_0xc160('0xe')]('CloudProvider,\x20%s,\x20%s',_0x26e1f4,_0x208643[_0xc160('0xe')]['message']);return _0x359ac9(_0x208643[_0xc160('0xe')][_0xc160('0x10')]);}else{logger['info'](_0xc160('0x9'),_0x26e1f4,'request\x20sent');_0x359ac9(_0x208643[_0xc160('0x11')][_0xc160('0x10')]);}})[_0xc160('0x12')](function(_0x5bb074){logger['error'](_0xc160('0x9'),_0x26e1f4,_0x5bb074);_0x30c90e(_0x5bb074);});});}
\ No newline at end of file
index f69b4f9..ada28a5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc4aa=['put','/:id','destroy','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','/oauth2/microsoft/callback','exports','express','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','show','post','create'];(function(_0x58dbba,_0x52ea0b){var _0x3eba0c=function(_0x4028b6){while(--_0x4028b6){_0x58dbba['push'](_0x58dbba['shift']());}};_0x3eba0c(++_0x52ea0b);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0xc4aa[_0x8c43de];return _0xa6591b;};'use strict';var express=require(_0xac4a('0x0'));var router=express[_0xac4a('0x1')]();var auth=require(_0xac4a('0x2'));var controller=require(_0xac4a('0x3'));router[_0xac4a('0x4')]('/',auth[_0xac4a('0x5')](),controller['index']);router['get']('/:id',auth[_0xac4a('0x5')](),controller[_0xac4a('0x6')]);router[_0xac4a('0x7')]('/',auth[_0xac4a('0x5')](),controller[_0xac4a('0x8')]);router[_0xac4a('0x9')](_0xac4a('0xa'),auth[_0xac4a('0x5')](),controller['update']);router['delete'](_0xac4a('0xa'),auth[_0xac4a('0x5')](),controller[_0xac4a('0xb')]);router['get'](_0xac4a('0xc'),auth[_0xac4a('0x5')](),controller[_0xac4a('0xd')]);router['post'](_0xac4a('0xe'),controller['oauth2MicrosoftCallback']);module[_0xac4a('0xf')]=router;
\ No newline at end of file
+var _0x2ef3=['Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','/:id','show','post','put','update','delete','destroy','/:id/oauth2/microsoft/authorize/','/oauth2/microsoft/callback','oauth2MicrosoftCallback','exports','express'];(function(_0x197e88,_0x542f13){var _0x541669=function(_0x3f3672){while(--_0x3f3672){_0x197e88['push'](_0x197e88['shift']());}};_0x541669(++_0x542f13);}(_0x2ef3,0xba));var _0x32ef=function(_0x48162f,_0x598996){_0x48162f=_0x48162f-0x0;var _0x216f76=_0x2ef3[_0x48162f];return _0x216f76;};'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['index']);router[_0x32ef('0x4')](_0x32ef('0x6'),auth['isAuthenticated'](),controller[_0x32ef('0x7')]);router[_0x32ef('0x8')]('/',auth['isAuthenticated'](),controller['create']);router[_0x32ef('0x9')](_0x32ef('0x6'),auth[_0x32ef('0x5')](),controller[_0x32ef('0xa')]);router[_0x32ef('0xb')](_0x32ef('0x6'),auth[_0x32ef('0x5')](),controller[_0x32ef('0xc')]);router[_0x32ef('0x4')](_0x32ef('0xd'),auth['isAuthenticated'](),controller['oauth2MicrosoftAuthorize']);router[_0x32ef('0x8')](_0x32ef('0xe'),controller[_0x32ef('0xf')]);module[_0x32ef('0x10')]=router;
\ No newline at end of file
index 0a3a485..8128207 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc439=['sequelize','exports','STRING','name'];(function(_0x5b7f7b,_0x373769){var _0x17f284=function(_0x44667a){while(--_0x44667a){_0x5b7f7b['push'](_0x5b7f7b['shift']());}};_0x17f284(++_0x373769);}(_0xc439,0x174));var _0x9c43=function(_0x8e0a54,_0xe5fd1b){_0x8e0a54=_0x8e0a54-0x0;var _0x30a731=_0xc439[_0x8e0a54];return _0x30a731;};'use strict';var Sequelize=require(_0x9c43('0x0'));module[_0x9c43('0x1')]={'name':{'type':Sequelize[_0x9c43('0x2')],'unique':_0x9c43('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x9c43('0x2')]},'companyId':{'type':Sequelize[_0x9c43('0x2')]},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x9c43('0x2')]},'type':{'type':Sequelize[_0x9c43('0x2')]},'street':{'type':Sequelize[_0x9c43('0x2')]},'postalCode':{'type':Sequelize[_0x9c43('0x2')]},'city':{'type':Sequelize[_0x9c43('0x2')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x9c43('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x9c43('0x2')]},'sStreet':{'type':Sequelize[_0x9c43('0x2')]},'sPostalCode':{'type':Sequelize[_0x9c43('0x2')]},'sCity':{'type':Sequelize[_0x9c43('0x2')]},'sCountry':{'type':Sequelize[_0x9c43('0x2')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x7f47=['STRING','name','sequelize','exports'];(function(_0x25762d,_0x45830d){var _0x2300d0=function(_0x172f7b){while(--_0x172f7b){_0x25762d['push'](_0x25762d['shift']());}};_0x2300d0(++_0x45830d);}(_0x7f47,0x12e));var _0x77f4=function(_0x872f6f,_0x5efe7b){_0x872f6f=_0x872f6f-0x0;var _0x59a5f4=_0x7f47[_0x872f6f];return _0x59a5f4;};'use strict';var Sequelize=require(_0x77f4('0x0'));module[_0x77f4('0x1')]={'name':{'type':Sequelize[_0x77f4('0x2')],'unique':_0x77f4('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x77f4('0x2')]},'companyId':{'type':Sequelize[_0x77f4('0x2')]},'website':{'type':Sequelize[_0x77f4('0x2')]},'phone':{'type':Sequelize[_0x77f4('0x2')]},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x77f4('0x2')]},'street':{'type':Sequelize[_0x77f4('0x2')]},'postalCode':{'type':Sequelize[_0x77f4('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x77f4('0x2')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x77f4('0x2')]},'sStreet':{'type':Sequelize[_0x77f4('0x2')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0x77f4('0x2')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x77f4('0x2')]}};
\ No newline at end of file
index bd705aa..04aa5fe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe28d=['findOne','rawAttributes','order','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','offset','undefined','limit','set','Content-Range','apply','reject','save','update','destroy','then','Companies','UserProfileResource','sendStatus','error','stack','name','send','index','CmCompany','describe','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','map','options','count','includeAll','include','catch','params','keys','merge','find','create','user','get','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','addContacts','CmContact','ids','getContacts'];(function(_0x3938b4,_0x30826c){var _0x3a2e10=function(_0x203029){while(--_0x203029){_0x3938b4['push'](_0x3938b4['shift']());}};_0x3a2e10(++_0x30826c);}(_0xe28d,0x1c0));var _0xde28=function(_0x3d2b19,_0x349a5b){_0x3d2b19=_0x3d2b19-0x0;var _0x29769b=_0xe28d[_0x3d2b19];return _0x29769b;};'use strict';var emlformat=require(_0xde28('0x0'));var rimraf=require(_0xde28('0x1'));var zipdir=require(_0xde28('0x2'));var jsonpatch=require(_0xde28('0x3'));var rp=require(_0xde28('0x4'));var moment=require(_0xde28('0x5'));var BPromise=require(_0xde28('0x6'));var Mustache=require(_0xde28('0x7'));var util=require('util');var path=require(_0xde28('0x8'));var sox=require(_0xde28('0x9'));var csv=require(_0xde28('0xa'));var ejs=require(_0xde28('0xb'));var fs=require('fs');var fs_extra=require(_0xde28('0xc'));var _=require(_0xde28('0xd'));var squel=require(_0xde28('0xe'));var crypto=require(_0xde28('0xf'));var jsforce=require(_0xde28('0x10'));var deskjs=require(_0xde28('0x11'));var toCsv=require(_0xde28('0xa'));var querystring=require(_0xde28('0x12'));var Papa=require(_0xde28('0x13'));var Redis=require('ioredis');var authService=require(_0xde28('0x14'));var qs=require(_0xde28('0x15'));var as=require(_0xde28('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xde28('0x17'));var utils=require(_0xde28('0x18'));var config=require(_0xde28('0x19'));var licenseUtil=require(_0xde28('0x1a'));var db=require(_0xde28('0x1b'))['db'];function respondWithStatusCode(_0x415549,_0x2ebe23){_0x2ebe23=_0x2ebe23||0xcc;return function(_0x2e7188){if(_0x2e7188){return _0x415549['sendStatus'](_0x2ebe23);}return _0x415549['status'](_0x2ebe23)[_0xde28('0x1c')]();};}function respondWithResult(_0x5bfb22,_0x4a66ef){_0x4a66ef=_0x4a66ef||0xc8;return function(_0x3c06c8){if(_0x3c06c8){return _0x5bfb22[_0xde28('0x1d')](_0x4a66ef)['json'](_0x3c06c8);}};}function respondWithFilteredResult(_0x3ec902,_0x4a9cb3){return function(_0x3e246e){if(_0x3e246e){var _0x593878=typeof _0x4a9cb3[_0xde28('0x1e')]===_0xde28('0x1f')&&typeof _0x4a9cb3[_0xde28('0x20')]===_0xde28('0x1f');var _0x2a35db=_0x3e246e['count'];var _0x34910e=_0x593878?0x0:_0x4a9cb3[_0xde28('0x1e')];var _0x444789=_0x593878?_0x3e246e['count']:_0x4a9cb3[_0xde28('0x1e')]+_0x4a9cb3[_0xde28('0x20')];var _0x1b7584;if(_0x444789>=_0x2a35db){_0x444789=_0x2a35db;_0x1b7584=0xc8;}else{_0x1b7584=0xce;}_0x3ec902[_0xde28('0x1d')](_0x1b7584);return _0x3ec902[_0xde28('0x21')](_0xde28('0x22'),_0x34910e+'-'+_0x444789+'/'+_0x2a35db)['json'](_0x3e246e);}return null;};}function patchUpdates(_0x2af901){return function(_0x2bca13){try{jsonpatch[_0xde28('0x23')](_0x2bca13,_0x2af901,!![]);}catch(_0x186c81){return BPromise[_0xde28('0x24')](_0x186c81);}return _0x2bca13[_0xde28('0x25')]();};}function saveUpdates(_0x1b27e5,_0x263e2e){return function(_0x51ee8e){if(_0x51ee8e){return _0x51ee8e[_0xde28('0x26')](_0x1b27e5)['then'](function(_0x56e835){return _0x56e835;});}return null;};}function removeEntity(_0x5d135c,_0x185089){return function(_0x41aa9d){if(_0x41aa9d){return _0x41aa9d[_0xde28('0x27')]()[_0xde28('0x28')](function(){var _0x43f6f3=_0x41aa9d['get']({'plain':!![]});var _0x28eb4e=_0xde28('0x29');return db[_0xde28('0x2a')]['destroy']({'where':{'type':_0x28eb4e,'resourceId':_0x43f6f3['id']}})[_0xde28('0x28')](function(){return _0x41aa9d;});})[_0xde28('0x28')](function(){_0x5d135c[_0xde28('0x1d')](0xcc)[_0xde28('0x1c')]();});}};}function handleEntityNotFound(_0x4287b7,_0x3b2410){return function(_0x3240d8){if(!_0x3240d8){_0x4287b7[_0xde28('0x2b')](0x194);}return _0x3240d8;};}function handleError(_0x37f358,_0x9e8628){_0x9e8628=_0x9e8628||0x1f4;return function(_0x2bdd88){logger[_0xde28('0x2c')](_0x2bdd88[_0xde28('0x2d')]);if(_0x2bdd88[_0xde28('0x2e')]){delete _0x2bdd88[_0xde28('0x2e')];}_0x37f358[_0xde28('0x1d')](_0x9e8628)[_0xde28('0x2f')](_0x2bdd88);};}exports[_0xde28('0x30')]=function(_0xffc753,_0xcfa853){var _0x50d6ae={},_0x459d1c={},_0x53862f={'count':0x0,'rows':[]};return db[_0xde28('0x31')][_0xde28('0x32')]()[_0xde28('0x28')](function(_0x2e0214){_0x459d1c[_0xde28('0x33')]=_['keys'](_0x2e0214);_0x459d1c[_0xde28('0x34')]=_['keys'](_0xffc753['query']);_0x459d1c[_0xde28('0x35')]=_[_0xde28('0x36')](_0x459d1c['model'],_0x459d1c[_0xde28('0x34')]);_0x50d6ae[_0xde28('0x37')]=_['intersection'](_0x459d1c[_0xde28('0x33')],qs[_0xde28('0x38')](_0xffc753[_0xde28('0x34')][_0xde28('0x38')]));_0x50d6ae[_0xde28('0x37')]=_0x50d6ae[_0xde28('0x37')][_0xde28('0x39')]?_0x50d6ae[_0xde28('0x37')]:_0x459d1c[_0xde28('0x33')];if(!_0xffc753[_0xde28('0x34')][_0xde28('0x3a')](_0xde28('0x3b'))){_0x50d6ae[_0xde28('0x20')]=qs[_0xde28('0x20')](_0xffc753[_0xde28('0x34')][_0xde28('0x20')]);_0x50d6ae[_0xde28('0x1e')]=qs['offset'](_0xffc753['query'][_0xde28('0x1e')]);}_0x50d6ae['order']=qs[_0xde28('0x3c')](_0xffc753[_0xde28('0x34')][_0xde28('0x3c')]);_0x50d6ae[_0xde28('0x3d')]=qs[_0xde28('0x35')](_[_0xde28('0x3e')](_0xffc753[_0xde28('0x34')],_0x459d1c[_0xde28('0x35')]),_0x2e0214);if(_0xffc753[_0xde28('0x34')][_0xde28('0x3f')]){_0x50d6ae[_0xde28('0x3d')]=_['merge'](_0x50d6ae[_0xde28('0x3d')],{'$or':_[_0xde28('0x40')](_0x50d6ae['attributes'],function(_0x555e48){var _0x5d3016={};_0x5d3016[_0x555e48]={'$like':'%'+_0xffc753[_0xde28('0x34')][_0xde28('0x3f')]+'%'};return _0x5d3016;})});}_0x50d6ae=_['merge']({},_0x50d6ae,_0xffc753[_0xde28('0x41')]);var _0x3e0cc1={'where':_0x50d6ae[_0xde28('0x3d')]};return db[_0xde28('0x31')][_0xde28('0x42')](_0x3e0cc1)[_0xde28('0x28')](function(_0x515f28){_0x53862f[_0xde28('0x42')]=_0x515f28;if(_0xffc753[_0xde28('0x34')][_0xde28('0x43')]){_0x50d6ae[_0xde28('0x44')]=[{'all':!![]}];}return db[_0xde28('0x31')]['findAll'](_0x50d6ae);})[_0xde28('0x28')](function(_0x5891ff){_0x53862f['rows']=_0x5891ff;return _0x53862f;})['then'](respondWithFilteredResult(_0xcfa853,_0x50d6ae))['catch'](handleError(_0xcfa853,null));})[_0xde28('0x45')](handleError(_0xcfa853,null));};exports['show']=function(_0x288a9c,_0x4be8a8){var _0x2346bb={'raw':![],'where':{'id':_0x288a9c[_0xde28('0x46')]['id']}},_0x304daa={};_0x304daa[_0xde28('0x33')]=_[_0xde28('0x47')](db[_0xde28('0x31')]['rawAttributes']);_0x304daa[_0xde28('0x34')]=_[_0xde28('0x47')](_0x288a9c[_0xde28('0x34')]);_0x304daa[_0xde28('0x35')]=_[_0xde28('0x36')](_0x304daa[_0xde28('0x33')],_0x304daa[_0xde28('0x34')]);_0x2346bb[_0xde28('0x37')]=_[_0xde28('0x36')](_0x304daa[_0xde28('0x33')],qs['fields'](_0x288a9c[_0xde28('0x34')][_0xde28('0x38')]));_0x2346bb['attributes']=_0x2346bb[_0xde28('0x37')][_0xde28('0x39')]?_0x2346bb['attributes']:_0x304daa[_0xde28('0x33')];if(_0x288a9c[_0xde28('0x34')][_0xde28('0x43')]){_0x2346bb[_0xde28('0x44')]=[{'all':!![]}];}_0x2346bb=_[_0xde28('0x48')]({},_0x2346bb,_0x288a9c[_0xde28('0x41')]);return db[_0xde28('0x31')][_0xde28('0x49')](_0x2346bb)['then'](handleEntityNotFound(_0x4be8a8,null))[_0xde28('0x28')](respondWithResult(_0x4be8a8,null))[_0xde28('0x45')](handleError(_0x4be8a8,null));};exports[_0xde28('0x4a')]=function(_0x2d6db2,_0x266e7d){return db[_0xde28('0x31')]['create'](_0x2d6db2['body'],{})['then'](function(_0x229d69){var _0x2d029e=_0x2d6db2[_0xde28('0x4b')][_0xde28('0x4c')]({'plain':!![]});if(!_0x2d029e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2d029e['role']===_0xde28('0x4b')){var _0x4ee41f=_0x229d69[_0xde28('0x4c')]({'plain':!![]});var _0x5a5b6b=_0xde28('0x29');return db[_0xde28('0x4d')][_0xde28('0x49')]({'where':{'name':_0x5a5b6b,'userProfileId':_0x2d029e[_0xde28('0x4e')]},'raw':!![]})[_0xde28('0x28')](function(_0x2d4403){if(_0x2d4403&&_0x2d4403[_0xde28('0x4f')]===0x0){return db['UserProfileResource'][_0xde28('0x4a')]({'name':_0x4ee41f[_0xde28('0x2e')],'resourceId':_0x4ee41f['id'],'type':_0x2d4403[_0xde28('0x2e')],'sectionId':_0x2d4403['id']},{})[_0xde28('0x28')](function(){return _0x229d69;});}else{return _0x229d69;}})[_0xde28('0x45')](function(_0x56d1e7){logger[_0xde28('0x2c')](_0xde28('0x50'),_0x56d1e7);throw _0x56d1e7;});}return _0x229d69;})['then'](respondWithResult(_0x266e7d,0xc9))[_0xde28('0x45')](handleError(_0x266e7d,null));};exports['update']=function(_0x5c46ee,_0x383194){if(_0x5c46ee[_0xde28('0x51')]['id']){delete _0x5c46ee[_0xde28('0x51')]['id'];}return db['CmCompany'][_0xde28('0x49')]({'where':{'id':_0x5c46ee[_0xde28('0x46')]['id']}})[_0xde28('0x28')](handleEntityNotFound(_0x383194,null))['then'](saveUpdates(_0x5c46ee['body'],null))[_0xde28('0x28')](respondWithResult(_0x383194,null))['catch'](handleError(_0x383194,null));};exports[_0xde28('0x27')]=function(_0x2e73f4,_0x37fced){return db['CmCompany']['find']({'where':{'id':_0x2e73f4[_0xde28('0x46')]['id']}})[_0xde28('0x28')](handleEntityNotFound(_0x37fced,null))['then'](removeEntity(_0x37fced,null))['catch'](handleError(_0x37fced,null));};exports['describe']=function(_0x3b21f5,_0xc716f2){return db[_0xde28('0x31')][_0xde28('0x32')]()[_0xde28('0x28')](respondWithResult(_0xc716f2,null))[_0xde28('0x45')](handleError(_0xc716f2,null));};exports[_0xde28('0x52')]=function(_0x304afa,_0x2ac507,_0xc5005){return db[_0xde28('0x53')]['find']({'where':{'id':_0x304afa['params']['id']}})[_0xde28('0x28')](handleEntityNotFound(_0x2ac507,null))[_0xde28('0x28')](function(_0x1298a1){if(_0x1298a1){return _0x1298a1[_0xde28('0x52')](_0x304afa[_0xde28('0x51')][_0xde28('0x54')],_['omit'](_0x304afa[_0xde28('0x51')],[_0xde28('0x54'),'id'])||{});}})[_0xde28('0x28')](respondWithResult(_0x2ac507,null))[_0xde28('0x45')](handleError(_0x2ac507,null));};exports[_0xde28('0x55')]=function(_0x4c2718,_0x210097,_0x4e47c3){var _0x7594ab={};var _0xeaf52={};var _0x25f35f;var _0x36936f;return db['CmCompany'][_0xde28('0x56')]({'where':{'id':_0x4c2718[_0xde28('0x46')]['id']}})[_0xde28('0x28')](handleEntityNotFound(_0x210097,null))[_0xde28('0x28')](function(_0x56f76d){if(_0x56f76d){_0x25f35f=_0x56f76d;_0xeaf52[_0xde28('0x33')]=_[_0xde28('0x47')](db[_0xde28('0x53')][_0xde28('0x57')]);_0xeaf52[_0xde28('0x34')]=_[_0xde28('0x47')](_0x4c2718[_0xde28('0x34')]);_0xeaf52[_0xde28('0x35')]=_['intersection'](_0xeaf52['model'],_0xeaf52[_0xde28('0x34')]);_0x7594ab[_0xde28('0x37')]=_[_0xde28('0x36')](_0xeaf52[_0xde28('0x33')],qs[_0xde28('0x38')](_0x4c2718['query'][_0xde28('0x38')]));_0x7594ab[_0xde28('0x37')]=_0x7594ab[_0xde28('0x37')][_0xde28('0x39')]?_0x7594ab[_0xde28('0x37')]:_0xeaf52['model'];_0x7594ab[_0xde28('0x58')]=qs[_0xde28('0x3c')](_0x4c2718[_0xde28('0x34')][_0xde28('0x3c')]);_0x7594ab[_0xde28('0x3d')]=qs[_0xde28('0x35')](_['pick'](_0x4c2718[_0xde28('0x34')],_0xeaf52['filters']));if(_0x4c2718[_0xde28('0x34')][_0xde28('0x3f')]){_0x7594ab[_0xde28('0x3d')]=_[_0xde28('0x48')](_0x7594ab[_0xde28('0x3d')],{'$or':_['map'](_0x7594ab['attributes'],function(_0x364097){var _0x231615={};_0x231615[_0x364097]={'$like':'%'+_0x4c2718[_0xde28('0x34')][_0xde28('0x3f')]+'%'};return _0x231615;})});}_0x7594ab=_['merge']({},_0x7594ab,_0x4c2718[_0xde28('0x41')]);return _0x25f35f[_0xde28('0x55')](_0x7594ab);}})[_0xde28('0x28')](function(_0xfe7fb2){if(_0xfe7fb2){_0x36936f=_0xfe7fb2[_0xde28('0x39')];if(!_0x4c2718['query']['hasOwnProperty'](_0xde28('0x3b'))){_0x7594ab[_0xde28('0x20')]=qs[_0xde28('0x20')](_0x4c2718[_0xde28('0x34')]['limit']);_0x7594ab[_0xde28('0x1e')]=qs[_0xde28('0x1e')](_0x4c2718[_0xde28('0x34')][_0xde28('0x1e')]);}return _0x25f35f['getContacts'](_0x7594ab);}})[_0xde28('0x28')](function(_0x252f60){if(_0x252f60){return _0x252f60?{'count':_0x36936f,'rows':_0x252f60}:null;}})[_0xde28('0x28')](respondWithResult(_0x210097,null))[_0xde28('0x45')](handleError(_0x210097,null));};
\ No newline at end of file
+var _0xc554=['status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','Companies','UserProfileResource','error','stack','name','send','CmCompany','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','includeAll','findAll','rows','catch','show','params','rawAttributes','include','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','CmContact','addContacts','ids','omit','findOne','filter','getContacts','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x5adf6c,_0x43aded){var _0x54535f=function(_0xe03640){while(--_0xe03640){_0x5adf6c['push'](_0x5adf6c['shift']());}};_0x54535f(++_0x43aded);}(_0xc554,0x142));var _0x4c55=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xc554[_0x56482c];return _0x5aae7a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x4c55('0x0'));var jsonpatch=require(_0x4c55('0x1'));var rp=require(_0x4c55('0x2'));var moment=require(_0x4c55('0x3'));var BPromise=require(_0x4c55('0x4'));var Mustache=require('mustache');var util=require(_0x4c55('0x5'));var path=require('path');var sox=require(_0x4c55('0x6'));var csv=require(_0x4c55('0x7'));var ejs=require(_0x4c55('0x8'));var fs=require('fs');var fs_extra=require(_0x4c55('0x9'));var _=require(_0x4c55('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x4c55('0xb'));var toCsv=require(_0x4c55('0x7'));var querystring=require(_0x4c55('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x4c55('0xd'));var qs=require(_0x4c55('0xe'));var as=require(_0x4c55('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x4c55('0x10'));var utils=require(_0x4c55('0x11'));var config=require(_0x4c55('0x12'));var licenseUtil=require(_0x4c55('0x13'));var db=require(_0x4c55('0x14'))['db'];function respondWithStatusCode(_0x5918d2,_0x26b645){_0x26b645=_0x26b645||0xcc;return function(_0x55b87d){if(_0x55b87d){return _0x5918d2[_0x4c55('0x15')](_0x26b645);}return _0x5918d2[_0x4c55('0x16')](_0x26b645)[_0x4c55('0x17')]();};}function respondWithResult(_0x50f3e3,_0xbb2cfd){_0xbb2cfd=_0xbb2cfd||0xc8;return function(_0x6e3319){if(_0x6e3319){return _0x50f3e3[_0x4c55('0x16')](_0xbb2cfd)[_0x4c55('0x18')](_0x6e3319);}};}function respondWithFilteredResult(_0x15fd7d,_0x509b53){return function(_0x4a47a8){if(_0x4a47a8){var _0x912b74=typeof _0x509b53[_0x4c55('0x19')]===_0x4c55('0x1a')&&typeof _0x509b53[_0x4c55('0x1b')]===_0x4c55('0x1a');var _0x56edff=_0x4a47a8[_0x4c55('0x1c')];var _0x4956c1=_0x912b74?0x0:_0x509b53['offset'];var _0x373b3d=_0x912b74?_0x4a47a8['count']:_0x509b53['offset']+_0x509b53['limit'];var _0xb05ec4;if(_0x373b3d>=_0x56edff){_0x373b3d=_0x56edff;_0xb05ec4=0xc8;}else{_0xb05ec4=0xce;}_0x15fd7d[_0x4c55('0x16')](_0xb05ec4);return _0x15fd7d[_0x4c55('0x1d')](_0x4c55('0x1e'),_0x4956c1+'-'+_0x373b3d+'/'+_0x56edff)[_0x4c55('0x18')](_0x4a47a8);}return null;};}function patchUpdates(_0x50c810){return function(_0x52b567){try{jsonpatch[_0x4c55('0x1f')](_0x52b567,_0x50c810,!![]);}catch(_0x9ed2fc){return BPromise[_0x4c55('0x20')](_0x9ed2fc);}return _0x52b567[_0x4c55('0x21')]();};}function saveUpdates(_0x482a5c,_0x415154){return function(_0x55c924){if(_0x55c924){return _0x55c924[_0x4c55('0x22')](_0x482a5c)[_0x4c55('0x23')](function(_0x41af07){return _0x41af07;});}return null;};}function removeEntity(_0x2a5d16,_0x912a2e){return function(_0x3dc057){if(_0x3dc057){return _0x3dc057[_0x4c55('0x24')]()['then'](function(){var _0x38b85f=_0x3dc057[_0x4c55('0x25')]({'plain':!![]});var _0x103d57=_0x4c55('0x26');return db[_0x4c55('0x27')][_0x4c55('0x24')]({'where':{'type':_0x103d57,'resourceId':_0x38b85f['id']}})[_0x4c55('0x23')](function(){return _0x3dc057;});})[_0x4c55('0x23')](function(){_0x2a5d16[_0x4c55('0x16')](0xcc)[_0x4c55('0x17')]();});}};}function handleEntityNotFound(_0x6934d1,_0x4e2e99){return function(_0x3ed9b0){if(!_0x3ed9b0){_0x6934d1[_0x4c55('0x15')](0x194);}return _0x3ed9b0;};}function handleError(_0x18a30a,_0xe14066){_0xe14066=_0xe14066||0x1f4;return function(_0x2936c0){logger[_0x4c55('0x28')](_0x2936c0[_0x4c55('0x29')]);if(_0x2936c0[_0x4c55('0x2a')]){delete _0x2936c0[_0x4c55('0x2a')];}_0x18a30a[_0x4c55('0x16')](_0xe14066)[_0x4c55('0x2b')](_0x2936c0);};}exports['index']=function(_0x5bf367,_0x389ae2){var _0x123059={},_0x20cec5={},_0x2df10a={'count':0x0,'rows':[]};return db[_0x4c55('0x2c')]['describe']()[_0x4c55('0x23')](function(_0x548e4d){_0x20cec5[_0x4c55('0x2d')]=_['keys'](_0x548e4d);_0x20cec5[_0x4c55('0x2e')]=_[_0x4c55('0x2f')](_0x5bf367['query']);_0x20cec5['filters']=_[_0x4c55('0x30')](_0x20cec5['model'],_0x20cec5[_0x4c55('0x2e')]);_0x123059[_0x4c55('0x31')]=_[_0x4c55('0x30')](_0x20cec5[_0x4c55('0x2d')],qs['fields'](_0x5bf367['query'][_0x4c55('0x32')]));_0x123059['attributes']=_0x123059[_0x4c55('0x31')][_0x4c55('0x33')]?_0x123059[_0x4c55('0x31')]:_0x20cec5[_0x4c55('0x2d')];if(!_0x5bf367[_0x4c55('0x2e')][_0x4c55('0x34')](_0x4c55('0x35'))){_0x123059[_0x4c55('0x1b')]=qs[_0x4c55('0x1b')](_0x5bf367[_0x4c55('0x2e')][_0x4c55('0x1b')]);_0x123059[_0x4c55('0x19')]=qs['offset'](_0x5bf367[_0x4c55('0x2e')][_0x4c55('0x19')]);}_0x123059[_0x4c55('0x36')]=qs[_0x4c55('0x37')](_0x5bf367[_0x4c55('0x2e')][_0x4c55('0x37')]);_0x123059[_0x4c55('0x38')]=qs[_0x4c55('0x39')](_[_0x4c55('0x3a')](_0x5bf367['query'],_0x20cec5[_0x4c55('0x39')]),_0x548e4d);if(_0x5bf367['query']['filter']){_0x123059[_0x4c55('0x38')]=_['merge'](_0x123059[_0x4c55('0x38')],{'$or':_['map'](_0x123059[_0x4c55('0x31')],function(_0x5f3f66){var _0xf5a651={};_0xf5a651[_0x5f3f66]={'$like':'%'+_0x5bf367[_0x4c55('0x2e')]['filter']+'%'};return _0xf5a651;})});}_0x123059=_[_0x4c55('0x3b')]({},_0x123059,_0x5bf367['options']);var _0x180001={'where':_0x123059['where']};return db[_0x4c55('0x2c')][_0x4c55('0x1c')](_0x180001)[_0x4c55('0x23')](function(_0x17679a){_0x2df10a[_0x4c55('0x1c')]=_0x17679a;if(_0x5bf367[_0x4c55('0x2e')][_0x4c55('0x3c')]){_0x123059['include']=[{'all':!![]}];}return db[_0x4c55('0x2c')][_0x4c55('0x3d')](_0x123059);})[_0x4c55('0x23')](function(_0xbc7755){_0x2df10a[_0x4c55('0x3e')]=_0xbc7755;return _0x2df10a;})[_0x4c55('0x23')](respondWithFilteredResult(_0x389ae2,_0x123059))[_0x4c55('0x3f')](handleError(_0x389ae2,null));})[_0x4c55('0x3f')](handleError(_0x389ae2,null));};exports[_0x4c55('0x40')]=function(_0x125eab,_0xa00154){var _0x41698d={'raw':![],'where':{'id':_0x125eab[_0x4c55('0x41')]['id']}},_0x5d54eb={};_0x5d54eb[_0x4c55('0x2d')]=_[_0x4c55('0x2f')](db[_0x4c55('0x2c')][_0x4c55('0x42')]);_0x5d54eb[_0x4c55('0x2e')]=_[_0x4c55('0x2f')](_0x125eab[_0x4c55('0x2e')]);_0x5d54eb[_0x4c55('0x39')]=_[_0x4c55('0x30')](_0x5d54eb[_0x4c55('0x2d')],_0x5d54eb[_0x4c55('0x2e')]);_0x41698d[_0x4c55('0x31')]=_[_0x4c55('0x30')](_0x5d54eb[_0x4c55('0x2d')],qs[_0x4c55('0x32')](_0x125eab[_0x4c55('0x2e')][_0x4c55('0x32')]));_0x41698d['attributes']=_0x41698d[_0x4c55('0x31')]['length']?_0x41698d[_0x4c55('0x31')]:_0x5d54eb[_0x4c55('0x2d')];if(_0x125eab[_0x4c55('0x2e')][_0x4c55('0x3c')]){_0x41698d[_0x4c55('0x43')]=[{'all':!![]}];}_0x41698d=_['merge']({},_0x41698d,_0x125eab[_0x4c55('0x44')]);return db['CmCompany'][_0x4c55('0x45')](_0x41698d)['then'](handleEntityNotFound(_0xa00154,null))['then'](respondWithResult(_0xa00154,null))[_0x4c55('0x3f')](handleError(_0xa00154,null));};exports['create']=function(_0x11db4a,_0x36e82b){return db[_0x4c55('0x2c')][_0x4c55('0x46')](_0x11db4a[_0x4c55('0x47')],{})[_0x4c55('0x23')](function(_0x5f344a){var _0x12f1a7=_0x11db4a[_0x4c55('0x48')]['get']({'plain':!![]});if(!_0x12f1a7)throw new Error(_0x4c55('0x49'));if(_0x12f1a7[_0x4c55('0x4a')]===_0x4c55('0x48')){var _0x14ccc3=_0x5f344a[_0x4c55('0x25')]({'plain':!![]});var _0x2770b6='Companies';return db[_0x4c55('0x4b')][_0x4c55('0x45')]({'where':{'name':_0x2770b6,'userProfileId':_0x12f1a7['userProfileId']},'raw':!![]})['then'](function(_0x3ba594){if(_0x3ba594&&_0x3ba594[_0x4c55('0x4c')]===0x0){return db[_0x4c55('0x27')]['create']({'name':_0x14ccc3[_0x4c55('0x2a')],'resourceId':_0x14ccc3['id'],'type':_0x3ba594[_0x4c55('0x2a')],'sectionId':_0x3ba594['id']},{})[_0x4c55('0x23')](function(){return _0x5f344a;});}else{return _0x5f344a;}})[_0x4c55('0x3f')](function(_0x2e092b){logger[_0x4c55('0x28')](_0x4c55('0x4d'),_0x2e092b);throw _0x2e092b;});}return _0x5f344a;})[_0x4c55('0x23')](respondWithResult(_0x36e82b,0xc9))[_0x4c55('0x3f')](handleError(_0x36e82b,null));};exports[_0x4c55('0x22')]=function(_0x420573,_0x308284){if(_0x420573['body']['id']){delete _0x420573[_0x4c55('0x47')]['id'];}return db['CmCompany'][_0x4c55('0x45')]({'where':{'id':_0x420573[_0x4c55('0x41')]['id']}})[_0x4c55('0x23')](handleEntityNotFound(_0x308284,null))[_0x4c55('0x23')](saveUpdates(_0x420573[_0x4c55('0x47')],null))[_0x4c55('0x23')](respondWithResult(_0x308284,null))[_0x4c55('0x3f')](handleError(_0x308284,null));};exports[_0x4c55('0x24')]=function(_0x44e5f1,_0x39ec29){return db[_0x4c55('0x2c')]['find']({'where':{'id':_0x44e5f1[_0x4c55('0x41')]['id']}})[_0x4c55('0x23')](handleEntityNotFound(_0x39ec29,null))[_0x4c55('0x23')](removeEntity(_0x39ec29,null))[_0x4c55('0x3f')](handleError(_0x39ec29,null));};exports[_0x4c55('0x4e')]=function(_0x30678c,_0x4f996c){return db[_0x4c55('0x2c')][_0x4c55('0x4e')]()[_0x4c55('0x23')](respondWithResult(_0x4f996c,null))[_0x4c55('0x3f')](handleError(_0x4f996c,null));};exports['addContacts']=function(_0x1a483e,_0x2c3b9c,_0x355f06){return db[_0x4c55('0x4f')][_0x4c55('0x45')]({'where':{'id':_0x1a483e[_0x4c55('0x41')]['id']}})[_0x4c55('0x23')](handleEntityNotFound(_0x2c3b9c,null))['then'](function(_0x4eb2a2){if(_0x4eb2a2){return _0x4eb2a2[_0x4c55('0x50')](_0x1a483e[_0x4c55('0x47')][_0x4c55('0x51')],_[_0x4c55('0x52')](_0x1a483e[_0x4c55('0x47')],[_0x4c55('0x51'),'id'])||{});}})[_0x4c55('0x23')](respondWithResult(_0x2c3b9c,null))['catch'](handleError(_0x2c3b9c,null));};exports['getContacts']=function(_0xcf3413,_0x343b12,_0x40a1cb){var _0x27fb34={};var _0x8782af={};var _0x3c57f7;var _0x360e48;return db[_0x4c55('0x2c')][_0x4c55('0x53')]({'where':{'id':_0xcf3413['params']['id']}})[_0x4c55('0x23')](handleEntityNotFound(_0x343b12,null))[_0x4c55('0x23')](function(_0x2af24b){if(_0x2af24b){_0x3c57f7=_0x2af24b;_0x8782af[_0x4c55('0x2d')]=_['keys'](db[_0x4c55('0x4f')][_0x4c55('0x42')]);_0x8782af[_0x4c55('0x2e')]=_[_0x4c55('0x2f')](_0xcf3413['query']);_0x8782af[_0x4c55('0x39')]=_[_0x4c55('0x30')](_0x8782af['model'],_0x8782af[_0x4c55('0x2e')]);_0x27fb34[_0x4c55('0x31')]=_[_0x4c55('0x30')](_0x8782af[_0x4c55('0x2d')],qs[_0x4c55('0x32')](_0xcf3413[_0x4c55('0x2e')][_0x4c55('0x32')]));_0x27fb34['attributes']=_0x27fb34[_0x4c55('0x31')][_0x4c55('0x33')]?_0x27fb34[_0x4c55('0x31')]:_0x8782af[_0x4c55('0x2d')];_0x27fb34['order']=qs[_0x4c55('0x37')](_0xcf3413[_0x4c55('0x2e')]['sort']);_0x27fb34[_0x4c55('0x38')]=qs[_0x4c55('0x39')](_[_0x4c55('0x3a')](_0xcf3413[_0x4c55('0x2e')],_0x8782af['filters']));if(_0xcf3413[_0x4c55('0x2e')]['filter']){_0x27fb34['where']=_[_0x4c55('0x3b')](_0x27fb34[_0x4c55('0x38')],{'$or':_['map'](_0x27fb34['attributes'],function(_0x694deb){var _0x31c813={};_0x31c813[_0x694deb]={'$like':'%'+_0xcf3413[_0x4c55('0x2e')][_0x4c55('0x54')]+'%'};return _0x31c813;})});}_0x27fb34=_[_0x4c55('0x3b')]({},_0x27fb34,_0xcf3413['options']);return _0x3c57f7['getContacts'](_0x27fb34);}})[_0x4c55('0x23')](function(_0x40beb0){if(_0x40beb0){_0x360e48=_0x40beb0[_0x4c55('0x33')];if(!_0xcf3413[_0x4c55('0x2e')][_0x4c55('0x34')](_0x4c55('0x35'))){_0x27fb34[_0x4c55('0x1b')]=qs['limit'](_0xcf3413['query'][_0x4c55('0x1b')]);_0x27fb34['offset']=qs[_0x4c55('0x19')](_0xcf3413['query'][_0x4c55('0x19')]);}return _0x3c57f7[_0x4c55('0x55')](_0x27fb34);}})['then'](function(_0x59c169){if(_0x59c169){return _0x59c169?{'count':_0x360e48,'rows':_0x59c169}:null;}})['then'](respondWithResult(_0x343b12,null))[_0x4c55('0x3f')](handleError(_0x343b12,null));};
\ No newline at end of file
index 4d53a7b..ab05b5e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x694d=['cm_companies','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./cmCompany.attributes','define','CmCompany'];(function(_0x57e12f,_0x4d11e3){var _0x2b8c6c=function(_0x30b011){while(--_0x30b011){_0x57e12f['push'](_0x57e12f['shift']());}};_0x2b8c6c(++_0x4d11e3);}(_0x694d,0x160));var _0xd694=function(_0x37c66f,_0x24838a){_0x37c66f=_0x37c66f-0x0;var _0x46ba0e=_0x694d[_0x37c66f];return _0x46ba0e;};'use strict';var _=require(_0xd694('0x0'));var util=require(_0xd694('0x1'));var logger=require(_0xd694('0x2'))(_0xd694('0x3'));var moment=require(_0xd694('0x4'));var BPromise=require(_0xd694('0x5'));var rp=require(_0xd694('0x6'));var fs=require('fs');var path=require(_0xd694('0x7'));var rimraf=require('rimraf');var config=require(_0xd694('0x8'));var attributes=require(_0xd694('0x9'));module['exports']=function(_0x51b766,_0x3bdd71){return _0x51b766[_0xd694('0xa')](_0xd694('0xb'),attributes,{'tableName':_0xd694('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb577=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmCompany.attributes','exports','define','CmCompany','cm_companies','lodash','util','../../config/logger'];(function(_0xcb67f,_0x512990){var _0x1884d2=function(_0x42a682){while(--_0x42a682){_0xcb67f['push'](_0xcb67f['shift']());}};_0x1884d2(++_0x512990);}(_0xb577,0x1dd));var _0x7b57=function(_0x512178,_0x109489){_0x512178=_0x512178-0x0;var _0xae37b5=_0xb577[_0x512178];return _0xae37b5;};'use strict';var _=require(_0x7b57('0x0'));var util=require(_0x7b57('0x1'));var logger=require(_0x7b57('0x2'))(_0x7b57('0x3'));var moment=require(_0x7b57('0x4'));var BPromise=require(_0x7b57('0x5'));var rp=require(_0x7b57('0x6'));var fs=require('fs');var path=require(_0x7b57('0x7'));var rimraf=require(_0x7b57('0x8'));var config=require(_0x7b57('0x9'));var attributes=require(_0x7b57('0xa'));module[_0x7b57('0xb')]=function(_0x557531,_0x1cd83c){return _0x557531[_0x7b57('0xc')](_0x7b57('0xd'),attributes,{'tableName':_0x7b57('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index e496799..0ba4d1a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7d33=['error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x7d33,0x118));var _0x37d3=function(_0x4dcf1d,_0x491ea1){_0x4dcf1d=_0x4dcf1d-0x0;var _0x773104=_0x7d33[_0x4dcf1d];return _0x773104;};'use strict';var _=require(_0x37d3('0x0'));var util=require(_0x37d3('0x1'));var moment=require(_0x37d3('0x2'));var BPromise=require(_0x37d3('0x3'));var rs=require(_0x37d3('0x4'));var fs=require('fs');var Redis=require(_0x37d3('0x5'));var db=require(_0x37d3('0x6'))['db'];var utils=require(_0x37d3('0x7'));var logger=require(_0x37d3('0x8'))('rpc');var config=require(_0x37d3('0x9'));var jayson=require(_0x37d3('0xa'));var client=jayson[_0x37d3('0xb')][_0x37d3('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x417e7e,_0x5adff8,_0x4e7d22){return new BPromise(function(_0xd032de,_0x5b5f05){return client[_0x37d3('0xd')](_0x417e7e,_0x4e7d22)[_0x37d3('0xe')](function(_0x3b55ec){logger[_0x37d3('0xf')](_0x37d3('0x10'),_0x5adff8,_0x37d3('0x11'));logger[_0x37d3('0x12')](_0x37d3('0x13'),_0x5adff8,_0x37d3('0x11'),JSON['stringify'](_0x3b55ec));if(_0x3b55ec['error']){if(_0x3b55ec[_0x37d3('0x14')][_0x37d3('0x15')]===0x1f4){logger[_0x37d3('0x14')](_0x37d3('0x10'),_0x5adff8,_0x3b55ec[_0x37d3('0x14')][_0x37d3('0x16')]);return _0x5b5f05(_0x3b55ec[_0x37d3('0x14')][_0x37d3('0x16')]);}logger[_0x37d3('0x14')](_0x37d3('0x10'),_0x5adff8,_0x3b55ec['error'][_0x37d3('0x16')]);return _0xd032de(_0x3b55ec['error'][_0x37d3('0x16')]);}else{logger[_0x37d3('0xf')](_0x37d3('0x10'),_0x5adff8,'request\x20sent');_0xd032de(_0x3b55ec[_0x37d3('0x17')][_0x37d3('0x16')]);}})[_0x37d3('0x18')](function(_0x1e2733){logger[_0x37d3('0x14')](_0x37d3('0x10'),_0x5adff8,_0x1e2733);_0x5b5f05(_0x1e2733);});});}
\ No newline at end of file
+var _0x1199=['code','message','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmCompany,\x20%s,\x20%s','CmCompany,\x20%s,\x20%s,\x20%s','request\x20sent','error'];(function(_0xbb091,_0x3fe7ee){var _0x467a04=function(_0x3a978d){while(--_0x3a978d){_0xbb091['push'](_0xbb091['shift']());}};_0x467a04(++_0x3fe7ee);}(_0x1199,0x129));var _0x9119=function(_0x55841f,_0x487812){_0x55841f=_0x55841f-0x0;var _0x4c5ccf=_0x1199[_0x55841f];return _0x4c5ccf;};'use strict';var _=require(_0x9119('0x0'));var util=require('util');var moment=require(_0x9119('0x1'));var BPromise=require('bluebird');var rs=require(_0x9119('0x2'));var fs=require('fs');var Redis=require(_0x9119('0x3'));var db=require(_0x9119('0x4'))['db'];var utils=require(_0x9119('0x5'));var logger=require('../../config/logger')(_0x9119('0x6'));var config=require(_0x9119('0x7'));var jayson=require(_0x9119('0x8'));var client=jayson[_0x9119('0x9')][_0x9119('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x364b66,_0x3ac1ae,_0x314b6e){return new BPromise(function(_0x23dec1,_0x5e2cf0){return client[_0x9119('0xb')](_0x364b66,_0x314b6e)[_0x9119('0xc')](function(_0x44272f){logger[_0x9119('0xd')](_0x9119('0xe'),_0x3ac1ae,'request\x20sent');logger['debug'](_0x9119('0xf'),_0x3ac1ae,_0x9119('0x10'),JSON['stringify'](_0x44272f));if(_0x44272f['error']){if(_0x44272f[_0x9119('0x11')][_0x9119('0x12')]===0x1f4){logger[_0x9119('0x11')]('CmCompany,\x20%s,\x20%s',_0x3ac1ae,_0x44272f[_0x9119('0x11')][_0x9119('0x13')]);return _0x5e2cf0(_0x44272f[_0x9119('0x11')]['message']);}logger[_0x9119('0x11')]('CmCompany,\x20%s,\x20%s',_0x3ac1ae,_0x44272f[_0x9119('0x11')][_0x9119('0x13')]);return _0x23dec1(_0x44272f['error'][_0x9119('0x13')]);}else{logger[_0x9119('0xd')](_0x9119('0xe'),_0x3ac1ae,'request\x20sent');_0x23dec1(_0x44272f['result'][_0x9119('0x13')]);}})[_0x9119('0x14')](function(_0x2e0990){logger[_0x9119('0x11')](_0x9119('0xe'),_0x3ac1ae,_0x2e0990);_0x5e2cf0(_0x2e0990);});});}
\ No newline at end of file
index ad3b187..b7d6a66 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbf8f=['../../components/interaction/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','/describe','/:id','show','/:id/contacts','getContacts','create','post','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x170c59,_0x3fc75e){var _0x4eccd8=function(_0x56b71f){while(--_0x56b71f){_0x170c59['push'](_0x170c59['shift']());}};_0x4eccd8(++_0x3fc75e);}(_0xbf8f,0xb8));var _0xfbf8=function(_0x462b4e,_0x3d2257){_0x462b4e=_0x462b4e-0x0;var _0x455d8c=_0xbf8f[_0x462b4e];return _0x455d8c;};'use strict';var multer=require(_0xfbf8('0x0'));var util=require(_0xfbf8('0x1'));var path=require(_0xfbf8('0x2'));var timeout=require(_0xfbf8('0x3'));var express=require(_0xfbf8('0x4'));var router=express[_0xfbf8('0x5')]();var fs_extra=require(_0xfbf8('0x6'));var auth=require(_0xfbf8('0x7'));var interaction=require(_0xfbf8('0x8'));var config=require(_0xfbf8('0x9'));var controller=require(_0xfbf8('0xa'));router[_0xfbf8('0xb')]('/',auth[_0xfbf8('0xc')](),controller['index']);router[_0xfbf8('0xb')](_0xfbf8('0xd'),auth['isAuthenticated'](),controller['describe']);router['get'](_0xfbf8('0xe'),auth[_0xfbf8('0xc')](),controller[_0xfbf8('0xf')]);router[_0xfbf8('0xb')](_0xfbf8('0x10'),auth['isAuthenticated'](),controller[_0xfbf8('0x11')]);router['post']('/',auth['isAuthenticated'](),controller[_0xfbf8('0x12')]);router[_0xfbf8('0x13')]('/:id/contacts',auth[_0xfbf8('0xc')](),controller['addContacts']);router[_0xfbf8('0x14')](_0xfbf8('0xe'),auth[_0xfbf8('0xc')](),controller[_0xfbf8('0x15')]);router['delete'](_0xfbf8('0xe'),auth[_0xfbf8('0xc')](),controller[_0xfbf8('0x16')]);module[_0xfbf8('0x17')]=router;
\ No newline at end of file
+var _0x1059=['/:id','show','/:id/contacts','post','put','update','delete','exports','multer','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','index','isAuthenticated','describe','get'];(function(_0x4d1800,_0x2138d7){var _0x6ac748=function(_0x279259){while(--_0x279259){_0x4d1800['push'](_0x4d1800['shift']());}};_0x6ac748(++_0x2138d7);}(_0x1059,0x1aa));var _0x9105=function(_0x50baeb,_0x26431a){_0x50baeb=_0x50baeb-0x0;var _0x494366=_0x1059[_0x50baeb];return _0x494366;};'use strict';var multer=require(_0x9105('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x9105('0x1'));var router=express[_0x9105('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x9105('0x3'));var interaction=require(_0x9105('0x4'));var config=require(_0x9105('0x5'));var controller=require(_0x9105('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x9105('0x7')]);router['get']('/describe',auth[_0x9105('0x8')](),controller[_0x9105('0x9')]);router[_0x9105('0xa')](_0x9105('0xb'),auth[_0x9105('0x8')](),controller[_0x9105('0xc')]);router[_0x9105('0xa')](_0x9105('0xd'),auth[_0x9105('0x8')](),controller['getContacts']);router[_0x9105('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x9105('0xe')](_0x9105('0xd'),auth[_0x9105('0x8')](),controller['addContacts']);router[_0x9105('0xf')](_0x9105('0xb'),auth['isAuthenticated'](),controller[_0x9105('0x10')]);router[_0x9105('0x11')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x9105('0x12')]=router;
\ No newline at end of file
index 3167418..685d9fc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa509=['TEXT','INTEGER','UNSIGNED','DATE','lodash','exports','STRING'];(function(_0x3c97e3,_0x321677){var _0x9bb0ed=function(_0x3a0cb6){while(--_0x3a0cb6){_0x3c97e3['push'](_0x3c97e3['shift']());}};_0x9bb0ed(++_0x321677);}(_0xa509,0x1e7));var _0x9a50=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xa509[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x9a50('0x0'));var Sequelize=require('sequelize');module[_0x9a50('0x1')]={'firstName':{'type':Sequelize[_0x9a50('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x9a50('0x2')]},'street':{'type':Sequelize[_0x9a50('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x9a50('0x2')]},'country':{'type':Sequelize[_0x9a50('0x2')]},'dateOfBirth':{'type':Sequelize[_0x9a50('0x2')]},'description':{'type':Sequelize[_0x9a50('0x3')]},'phone':{'type':Sequelize[_0x9a50('0x2')]},'mobile':{'type':Sequelize[_0x9a50('0x2')]},'fax':{'type':Sequelize[_0x9a50('0x2')]},'email':{'type':Sequelize[_0x9a50('0x2')]},'url':{'type':Sequelize[_0x9a50('0x2')]},'facebook':{'type':Sequelize[_0x9a50('0x2')]},'fb_data':{'type':Sequelize[_0x9a50('0x2')]},'twitter':{'type':Sequelize[_0x9a50('0x2')]},'skype':{'type':Sequelize[_0x9a50('0x2')]},'teams':{'type':Sequelize[_0x9a50('0x2')]},'viber':{'type':Sequelize[_0x9a50('0x2')]},'line':{'type':Sequelize[_0x9a50('0x2')]},'wechat':{'type':Sequelize[_0x9a50('0x2')]},'telegram':{'type':Sequelize[_0x9a50('0x2')]},'UserId':{'type':Sequelize[_0x9a50('0x4')]},'AdditionalPhones':{'type':Sequelize[_0x9a50('0x2')]},'priority':{'type':Sequelize[_0x9a50('0x4')](0x2)[_0x9a50('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x9a50('0x6')],'defaultValue':Sequelize['NOW']},'dialTimezone':{'type':Sequelize[_0x9a50('0x2')]},'utcOffset':{'type':Sequelize[_0x9a50('0x4')]}};
\ No newline at end of file
+var _0x4293=['UNSIGNED','DATE','NOW','lodash','sequelize','exports','STRING','TEXT','INTEGER'];(function(_0x23f7f0,_0x1548a0){var _0x445c99=function(_0x339f94){while(--_0x339f94){_0x23f7f0['push'](_0x23f7f0['shift']());}};_0x445c99(++_0x1548a0);}(_0x4293,0x11a));var _0x3429=function(_0x407135,_0x2c22d4){_0x407135=_0x407135-0x0;var _0x17c45b=_0x4293[_0x407135];return _0x17c45b;};'use strict';var _=require(_0x3429('0x0'));var Sequelize=require(_0x3429('0x1'));module[_0x3429('0x2')]={'firstName':{'type':Sequelize[_0x3429('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0x3429('0x3')]},'street':{'type':Sequelize[_0x3429('0x3')]},'postalCode':{'type':Sequelize[_0x3429('0x3')]},'city':{'type':Sequelize[_0x3429('0x3')]},'country':{'type':Sequelize[_0x3429('0x3')]},'dateOfBirth':{'type':Sequelize[_0x3429('0x3')]},'description':{'type':Sequelize[_0x3429('0x4')]},'phone':{'type':Sequelize[_0x3429('0x3')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x3429('0x3')]},'email':{'type':Sequelize[_0x3429('0x3')]},'url':{'type':Sequelize[_0x3429('0x3')]},'facebook':{'type':Sequelize[_0x3429('0x3')]},'fb_data':{'type':Sequelize[_0x3429('0x3')]},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize[_0x3429('0x3')]},'teams':{'type':Sequelize[_0x3429('0x3')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0x3429('0x3')]},'wechat':{'type':Sequelize[_0x3429('0x3')]},'telegram':{'type':Sequelize[_0x3429('0x3')]},'UserId':{'type':Sequelize[_0x3429('0x5')]},'AdditionalPhones':{'type':Sequelize[_0x3429('0x3')]},'priority':{'type':Sequelize[_0x3429('0x5')](0x2)[_0x3429('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x3429('0x7')],'defaultValue':Sequelize[_0x3429('0x8')]},'dialTimezone':{'type':Sequelize[_0x3429('0x3')]},'utcOffset':{'type':Sequelize[_0x3429('0x5')]}};
\ No newline at end of file
index 0bb0aa4..71d0cc4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xefff=['nolimit','order','pick','select','field','color','from','tools_tags','cm_contacts','cm_user_has_contacts','uc.CmContactId\x20=\x20c.id','left_join','cm_contact_has_tags','ct.CmContactId\x20=\x20c.id','c.deletedAt\x20IS\x20NULL','expr','search','parseSearch','sqlOperator','conditions','Tag','split','map','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','uc.UserId\x20=\x20?','value','dateOfBirth','datetime','castTo','buildExpression','text','start','isNil','Contact','push','forEach','ListId','where','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','tag','replace','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','isNumeric','c.id\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','group','c.id','Sequelize','QueryTypes','SELECT','clone','having','resolve','user','role','agent','some','getLists','isEmpty','c.ListId\x20IS\x20NULL','toString','count','sequelize','keyBy','merge','c.firstName','c.mobile','c.fax','c.email','c.ListId','c.deletedAt','c.CompanyId','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','Tags','rows','catch','params','columnName','displayName','analytics','CmCustomField','alias','custom','values','body','findAll','get','mergeWith','isArray','tags','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','update','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmContactHasItem','CmHopperFinal','CmHopperHistory','ReportAgentPreview','VoiceCallReport','ChatQueueReport','FaxQueueReport','MailQueueReport','OpenchannelQueueReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','join','dialTimezone','timezones','utcOffset','each','duplicates','$or','findOrCreate','spread','additionalPhones','contact','show','find','Phones','ContactItemType','ItemType','literal','Phones.OrderBy','$and','omit','format','cf_%d','table','toParam','CmHopper','phone','getTags','rawAttributes','sort','filter','options','setTags','ids','setAdditionalPhones','item_types','items','ItemTypeId','description','OrderBy','contact\x20phone\x20exists','PHONE','CmHopperAdditionalPhone','item','`ItemType`.OrderBy','CmHopperId','bulkCreate','duplicateAdditionalPhones','fromContactId','CmContactId','toContactId','rescheduleAdditionalPhones','getHoppers','ContactId','includeAll','include','getHopperHistories','getJscriptySessions','JscriptySessionReport','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','No\x20firstName\x20column\x20specified','root','server/files/tmp','file','filename','chmodSync','child_process','fork','../../components/import/cm/csv','File\x20uploaded\x20correctly!','pid','upload','createReadStream','parse','meta','binding','firstName','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','../../components/import/cm/csv2','stringify','message','exit','../../components/import/cm/csvUpdates','start\x20child\x20process\x20correctly!','error\x20child\x20process','getJourney','mail','chat','sms','openchannel','whatsapp','voice','-createdAt','channel','includes','Invalid\x20channel','toLowerCase','range','Invalid\x20date\x20for\x20range\x20from\x20filter','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','uniqueid','source','destination','callerid','starttime','endtime','duration','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','DESC','findAndCountAll','fullname','startCase','Account','closed','closedAt','note','disposition','secondDisposition','thirdDisposition','Owner','customerPort','deviceModel','osName','ratingMessage','ratingType','referer','subject','threadId','Interaction','flatten','sortBy','reverse','moment','util','path','lodash','squel','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../mysqldb','redis','localhost','./cmContact.socket','register','status','json','offset','undefined','limit','set','Content-Range','destroy','sendStatus','error','stack','name','send','index','CmContact','describe','then','length','keys','startsWith','cf_','findOne','trimStart','all','fieldType','type','model','query','filters','intersection','attributes','fields','hasOwnProperty'];(function(_0x40fc45,_0x5518bc){var _0x179e2d=function(_0x584129){while(--_0x584129){_0x40fc45['push'](_0x40fc45['shift']());}};_0x179e2d(++_0x5518bc);}(_0xefff,0x114));var _0xfeff=function(_0x59dafd,_0x2c2bb0){_0x59dafd=_0x59dafd-0x0;var _0x528e42=_0xefff[_0x59dafd];return _0x528e42;};'use strict';var moment=require(_0xfeff('0x0'));var BPromise=require('bluebird');var util=require(_0xfeff('0x1'));var path=require(_0xfeff('0x2'));var fs=require('fs');var _=require(_0xfeff('0x3'));var squel=require(_0xfeff('0x4'));var Papa=require(_0xfeff('0x5'));var Redis=require(_0xfeff('0x6'));var qs=require(_0xfeff('0x7'));var as=require(_0xfeff('0x8'));var logger=require(_0xfeff('0x9'))('api');var config=require('../../config/environment');var shared=require('../../config/environment/shared');var db=require(_0xfeff('0xa'))['db'];config['redis']=_['defaults'](config[_0xfeff('0xb')],{'host':_0xfeff('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfeff('0xb')]));require(_0xfeff('0xd'))[_0xfeff('0xe')](socket);function respondWithResult(_0x5100c5,_0x1cd79e){_0x1cd79e=_0x1cd79e||0xc8;return function(_0x14ba05){if(_0x14ba05){return _0x5100c5[_0xfeff('0xf')](_0x1cd79e)[_0xfeff('0x10')](_0x14ba05);}};}function respondWithFilteredResult(_0x156d9a,_0x3f8ee0){return function(_0x121e47){if(_0x121e47){var _0x8a74e3=typeof _0x3f8ee0[_0xfeff('0x11')]===_0xfeff('0x12')&&typeof _0x3f8ee0[_0xfeff('0x13')]===_0xfeff('0x12');var _0x25a209=_0x121e47['count'];var _0x5bfa8c=_0x8a74e3?0x0:_0x3f8ee0['offset'];var _0x4ba232=_0x8a74e3?_0x121e47['count']:_0x3f8ee0[_0xfeff('0x11')]+_0x3f8ee0[_0xfeff('0x13')];var _0x1110df;if(_0x4ba232>=_0x25a209){_0x4ba232=_0x25a209;_0x1110df=0xc8;}else{_0x1110df=0xce;}_0x156d9a[_0xfeff('0xf')](_0x1110df);return _0x156d9a[_0xfeff('0x14')](_0xfeff('0x15'),_0x5bfa8c+'-'+_0x4ba232+'/'+_0x25a209)[_0xfeff('0x10')](_0x121e47);}return null;};}function saveUpdates(_0x4a6951){return function(_0x1a97e6){if(_0x1a97e6){return _0x1a97e6['update'](_0x4a6951)['then'](function(_0x427773){return _0x427773;});}return null;};}function removeEntity(_0x408cea){return function(_0x3624aa){if(_0x3624aa){return _0x3624aa[_0xfeff('0x16')]()['then'](function(){_0x408cea[_0xfeff('0xf')](0xcc)['end']();});}};}function handleEntityNotFound(_0x168f6b){return function(_0x116782){if(!_0x116782){_0x168f6b[_0xfeff('0x17')](0x194);}return _0x116782;};}function handleError(_0x160382,_0x268aa1){_0x268aa1=_0x268aa1||0x1f4;return function(_0x476de9){logger[_0xfeff('0x18')](_0x476de9[_0xfeff('0x19')]);if(_0x476de9[_0xfeff('0x1a')]){delete _0x476de9[_0xfeff('0x1a')];}_0x160382[_0xfeff('0xf')](_0x268aa1)[_0xfeff('0x1b')](_0x476de9);};}exports[_0xfeff('0x1c')]=function(_0x355826,_0x2b2031){var _0x5a6c94={},_0x5c2396={},_0x41ac76={'count':0x0,'rows':[]};return db[_0xfeff('0x1d')][_0xfeff('0x1e')]()[_0xfeff('0x1f')](function(_0x4446b9){var _0x1ecf32=[];for(var _0x361b85=0x0;_0x361b85<Object['keys'](_0x4446b9)[_0xfeff('0x20')];_0x361b85++){var _0x552a8c=Object[_0xfeff('0x21')](_0x4446b9)[_0x361b85];if(_[_0xfeff('0x22')](_0x552a8c,_0xfeff('0x23'))){_0x1ecf32['push'](db['CmCustomField'][_0xfeff('0x24')]({'where':{'id':_[_0xfeff('0x25')](_0x552a8c,_0xfeff('0x23'))},'raw':!![]}));}}return BPromise[_0xfeff('0x26')](_0x1ecf32)[_0xfeff('0x1f')](function(_0x5935c6){for(var _0x45d6cd=0x0;_0x45d6cd<_0x5935c6[_0xfeff('0x20')];_0x45d6cd++){if(_0x5935c6[_0x45d6cd]){var _0x318155=_0xfeff('0x23')+_0x5935c6[_0x45d6cd]['id'];var _0x189f47=_0x4446b9[_0x318155];_0x189f47[_0xfeff('0x27')]=_0x5935c6[_0x45d6cd][_0xfeff('0x28')];}}return _0x4446b9;});})[_0xfeff('0x1f')](function(_0x35c192){_0x5c2396[_0xfeff('0x29')]=_[_0xfeff('0x21')](_0x35c192);_0x5c2396[_0xfeff('0x2a')]=_[_0xfeff('0x21')](_0x355826['query']);_0x5c2396[_0xfeff('0x2b')]=_[_0xfeff('0x2c')](_0x5c2396[_0xfeff('0x29')],_0x5c2396[_0xfeff('0x2a')]);_0x5a6c94[_0xfeff('0x2d')]=_['intersection'](_0x5c2396[_0xfeff('0x29')],qs[_0xfeff('0x2e')](_0x355826['query'][_0xfeff('0x2e')]));_0x5a6c94[_0xfeff('0x2d')]=_0x5a6c94[_0xfeff('0x2d')][_0xfeff('0x20')]?_0x5a6c94[_0xfeff('0x2d')]:_0x5c2396[_0xfeff('0x29')];if(!_0x355826[_0xfeff('0x2a')][_0xfeff('0x2f')](_0xfeff('0x30'))){_0x5a6c94[_0xfeff('0x13')]=qs[_0xfeff('0x13')](_0x355826[_0xfeff('0x2a')][_0xfeff('0x13')]);_0x5a6c94[_0xfeff('0x11')]=qs[_0xfeff('0x11')](_0x355826[_0xfeff('0x2a')][_0xfeff('0x11')]);}_0x5a6c94[_0xfeff('0x31')]=qs['sort'](_0x355826['query']['sort']);_0x5a6c94['where']=qs[_0xfeff('0x2b')](_[_0xfeff('0x32')](_0x355826[_0xfeff('0x2a')],_0x5c2396[_0xfeff('0x2b')]),_0x35c192);var _0x339ec2=[];var _0x33ca3a=squel[_0xfeff('0x33')]()['field']('id')[_0xfeff('0x34')](_0xfeff('0x1a'))[_0xfeff('0x34')](_0xfeff('0x35'))[_0xfeff('0x36')](_0xfeff('0x37'));var _0x4d1d13=squel[_0xfeff('0x33')]()[_0xfeff('0x36')](_0xfeff('0x38'),'c')['left_join'](_0xfeff('0x39'),'uc',_0xfeff('0x3a'))[_0xfeff('0x3b')](_0xfeff('0x3c'),'ct',_0xfeff('0x3d'))[_0xfeff('0x3b')](_0xfeff('0x37'),'t','t.id\x20=\x20ct.TagId')['where'](_0xfeff('0x3e'));var _0x2a6f53=squel[_0xfeff('0x3f')]();var _0x488c3f=[];var _0x481aad=squel['expr']();var _0x31ef7b;if(_0x355826[_0xfeff('0x2a')][_0xfeff('0x40')]){_0x31ef7b=as[_0xfeff('0x41')](_0x355826[_0xfeff('0x2a')][_0xfeff('0x40')]);var _0x12f9ce=_0x31ef7b[_0xfeff('0x42')];for(var _0x1abcfc=0x0;_0x1abcfc<_0x31ef7b['conditions'][_0xfeff('0x20')];_0x1abcfc++){var _0x130d0a=_0x31ef7b[_0xfeff('0x43')][_0x1abcfc];var _0xaa5eb5='c';var _0x53d8e5=_(_0x35c192)['keys']()['find'](function(_0x2c2891){return _0x2c2891===_0x130d0a['field'];});if(_0x53d8e5)_0x53d8e5=_0x35c192[_0x130d0a[_0xfeff('0x34')]];if(!_0x53d8e5){if(_0x130d0a[_0xfeff('0x34')]===_0xfeff('0x44')){var _0x2a8d8c=_0x130d0a['value'][_0xfeff('0x45')](',')[_0xfeff('0x46')](function(_0x12a39f){return Number(_0x12a39f);});_0x2a8d8c['forEach'](function(_0x30aec2){_0x481aad['or'](_0xfeff('0x47'),'%,'+_0x30aec2+',%');});_0x488c3f=_['union'](_0x488c3f,_0x2a8d8c);}else if(_0x130d0a[_0xfeff('0x34')]===_0xfeff('0x48')){_0x2a6f53['and'](_0xfeff('0x49'),_0x130d0a[_0xfeff('0x4a')]);}}else{if(_0x130d0a[_0xfeff('0x34')]===_0xfeff('0x4b')||_0x53d8e5[_0xfeff('0x27')]===_0xfeff('0x4c'))_0x130d0a[_0xfeff('0x4d')]='DATE';var _0x47d344=as[_0xfeff('0x4e')](_0xaa5eb5,_0x53d8e5['type'],_0x130d0a);_0x2a6f53[_0x12f9ce](_0x47d344[_0xfeff('0x4f')],_0x47d344[_0xfeff('0x4a')][_0xfeff('0x50')],_0x47d344[_0xfeff('0x4a')]['end']);}}}else{var _0x40c0e8=_(Object[_0xfeff('0x21')](_0x355826['query']))[_0xfeff('0x46')](function(_0xe44d12){return _0x35c192[_0xfeff('0x2f')](_0xe44d12)?_0xe44d12:undefined;})['filter'](function(_0x3c81df){return!_[_0xfeff('0x51')](_0x3c81df);})[_0xfeff('0x4a')]();if(_0x355826[_0xfeff('0x2a')][_0xfeff('0x52')])_0x40c0e8[_0xfeff('0x53')](_0xfeff('0x52'));if(!_['isEmpty'](_0x40c0e8)){_0x40c0e8[_0xfeff('0x54')](function(_0x182f79){if(_0x182f79===_0xfeff('0x55')){_0x4d1d13[_0xfeff('0x56')](_0xfeff('0x57'),[][_0xfeff('0x58')](_0x355826['query'][_0x182f79]));}else if(_0x182f79===_0xfeff('0x52')){var _0x553303='%'+_0x355826[_0xfeff('0x2a')][_0x182f79]+'%';_0x4d1d13[_0xfeff('0x56')](_0xfeff('0x59'),_0x553303);}else{_0x4d1d13[_0xfeff('0x56')]('c.'+_0x182f79+_0xfeff('0x5a'),_0x355826[_0xfeff('0x2a')][_0x182f79]);}});}if(_0x355826[_0xfeff('0x2a')][_0xfeff('0x5b')]){_0x488c3f=_['isArray'](_0x355826[_0xfeff('0x2a')][_0xfeff('0x5b')])?_0x355826[_0xfeff('0x2a')][_0xfeff('0x5b')]:new Array(_0x355826['query'][_0xfeff('0x5b')]);_0x488c3f[_0xfeff('0x54')](function(_0xc6009d){_0x481aad['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0xc6009d+',%');});}if(_0x355826['query']['filter']){var _0x3ceec6=_0x355826[_0xfeff('0x2a')]['filter'][_0xfeff('0x5c')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(_0x3ceec6[_0xfeff('0x45')]('\x20')['length']>0x1){_0x2a6f53['or'](_0xfeff('0x5d'),qs[_0xfeff('0x5e')](_0x3ceec6),null);}else{if(qs[_0xfeff('0x5f')](_0x3ceec6)){_0x2a6f53['or'](_0xfeff('0x60'),_0x3ceec6+'%');_0x2a6f53['or']('c.phone\x20LIKE\x20?',_0x3ceec6+'%');_0x2a6f53['or'](_0xfeff('0x61'),_0x3ceec6+'%');_0x2a6f53['or'](_0xfeff('0x62'),_0x3ceec6+'%');}else if(qs['isEmail'](_0x3ceec6)){_0x2a6f53['or'](_0xfeff('0x63'),_0x3ceec6+'%');}else{_0x2a6f53['or'](_0xfeff('0x64'),'%'+_0x3ceec6+'%');_0x2a6f53['or'](_0xfeff('0x65'),'%'+_0x3ceec6+'%');_0x2a6f53['or']('c.email\x20LIKE\x20?','%'+_0x3ceec6+'%');}}}}_0x4d1d13[_0xfeff('0x56')](_0x2a6f53);_0x4d1d13[_0xfeff('0x66')](_0xfeff('0x67'));var _0x4e9be5={'type':db[_0xfeff('0x68')][_0xfeff('0x69')][_0xfeff('0x6a')],'raw':!![]};var _0x5c4132=_0x4d1d13[_0xfeff('0x6b')]()[_0xfeff('0x34')](_0xfeff('0x67'));if(_0x5a6c94[_0xfeff('0x31')]){_0x5a6c94[_0xfeff('0x31')][_0xfeff('0x54')](function(_0x2664b3){_0x4d1d13[_0xfeff('0x31')]('c.'+_0x2664b3[0x0],_0x2664b3[0x1]==='DESC'?![]:!![]);});}if(!_['isEmpty'](_0x488c3f)){_0x4d1d13[_0xfeff('0x6c')](_0x481aad);_0x5c4132[_0xfeff('0x56')]('t.id\x20IN\x20?',_0x488c3f);}BPromise[_0xfeff('0x6d')]()[_0xfeff('0x1f')](function(){if(!_0x31ef7b)return;if(_0x355826[_0xfeff('0x6e')][_0xfeff('0x6f')]!==_0xfeff('0x70'))return;if(!_[_0xfeff('0x71')](_0x31ef7b[_0xfeff('0x43')],['field','User'])){return _0x355826['user'][_0xfeff('0x72')]({'attributes':['id'],'raw':!![]})[_0xfeff('0x1f')](function(_0x2d2ffa){if(_[_0xfeff('0x73')](_0x2d2ffa)){_0x5c4132[_0xfeff('0x56')]('c.ListId\x20IS\x20NULL');_0x4d1d13[_0xfeff('0x56')](_0xfeff('0x74'));}else{_0x5c4132[_0xfeff('0x56')](_0xfeff('0x57'),_[_0xfeff('0x46')](_0x2d2ffa,'id'));_0x4d1d13['where']('c.ListId\x20IN\x20?',_[_0xfeff('0x46')](_0x2d2ffa,'id'));}});}})[_0xfeff('0x1f')](function(){if(_0x355826[_0xfeff('0x6e')]['role']===_0xfeff('0x70')&&!_0x31ef7b&&!_0x355826['query'][_0xfeff('0x55')])return[];return db['sequelize'][_0xfeff('0x2a')](_0x5c4132[_0xfeff('0x75')](),_0x4e9be5);})[_0xfeff('0x1f')](function(_0xc2b3bc){_0x41ac76[_0xfeff('0x76')]=_0xc2b3bc['length'];if(_0x41ac76[_0xfeff('0x76')]===0x0)return[];return db[_0xfeff('0x77')][_0xfeff('0x2a')](_0x33ca3a[_0xfeff('0x75')](),_0x4e9be5)[_0xfeff('0x1f')](function(_0x223ab5){_0x339ec2=_[_0xfeff('0x78')](_0x223ab5,'id');_0x4e9be5=_[_0xfeff('0x79')](_0x4e9be5,{'model':db['CmContact'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x355826['query'][_0xfeff('0x2e')]){_0x5a6c94['attributes'][_0xfeff('0x54')](function(_0x26b7d9){_0x4d1d13['field']('c.'+_0x26b7d9);});}else{_0x4d1d13['field'](_0xfeff('0x67'));_0x4d1d13[_0xfeff('0x34')](_0xfeff('0x7a'));_0x4d1d13[_0xfeff('0x34')]('c.lastName');_0x4d1d13[_0xfeff('0x34')]('c.phone');_0x4d1d13[_0xfeff('0x34')](_0xfeff('0x7b'));_0x4d1d13[_0xfeff('0x34')](_0xfeff('0x7c'));_0x4d1d13[_0xfeff('0x34')](_0xfeff('0x7d'));_0x4d1d13[_0xfeff('0x34')](_0xfeff('0x7e'));_0x4d1d13['field']('c.createdAt');_0x4d1d13[_0xfeff('0x34')](_0xfeff('0x7f'));_0x4d1d13[_0xfeff('0x34')](_0xfeff('0x80'));_0x4d1d13[_0xfeff('0x34')](_0xfeff('0x81'),_0xfeff('0x82'));}if(_0x5a6c94[_0xfeff('0x13')])_0x4d1d13[_0xfeff('0x13')](_0x5a6c94['limit']);if(_0x5a6c94['offset'])_0x4d1d13['offset'](_0x5a6c94[_0xfeff('0x11')]);return db[_0xfeff('0x77')]['query'](_0x4d1d13[_0xfeff('0x75')](),_0x4e9be5);});})['then'](function(_0xdc4111){_0xdc4111['forEach'](function(_0x9797ba){if(_0x9797ba['TagIds']){_0x9797ba[_0xfeff('0x83')]=[];_0x9797ba[_0xfeff('0x82')]['split'](',')[_0xfeff('0x54')](function(_0x3ca8bb){_0x9797ba['Tags'][_0xfeff('0x53')](_0x339ec2[_0x3ca8bb]);});}delete _0x9797ba[_0xfeff('0x82')];});_0x41ac76[_0xfeff('0x84')]=_0xdc4111;return _0x41ac76;})[_0xfeff('0x1f')](respondWithFilteredResult(_0x2b2031,_0x5a6c94));})[_0xfeff('0x85')](handleError(_0x2b2031,null));};exports[_0xfeff('0x16')]=function(_0x50385b,_0x41824d){return db[_0xfeff('0x1d')]['find']({'where':{'id':_0x50385b[_0xfeff('0x86')]['id']}})[_0xfeff('0x1f')](handleEntityNotFound(_0x41824d,null))[_0xfeff('0x1f')](removeEntity(_0x41824d,null))[_0xfeff('0x85')](handleError(_0x41824d,null));};exports[_0xfeff('0x1e')]=function(_0x3d448a,_0x27c12d){return db[_0xfeff('0x1d')]['describe']()[_0xfeff('0x1f')](function(_0x3ba7d3){delete _0x3ba7d3['tags'];for(var _0x4c21e1=0x0;_0x4c21e1<Object['keys'](_0x3ba7d3)[_0xfeff('0x20')];_0x4c21e1++){var _0x1325f2=Object[_0xfeff('0x21')](_0x3ba7d3)[_0x4c21e1];if(!_[_0xfeff('0x22')](_0x1325f2,_0xfeff('0x23'))){_0x3ba7d3[_0x1325f2][_0xfeff('0x87')]=_0x1325f2;_0x3ba7d3[_0x1325f2][_0xfeff('0x88')]=_0x1325f2;}}return _0x3ba7d3;})[_0xfeff('0x1f')](function(_0x145ed2){var _0x509599={'where':Boolean(_0x3d448a[_0xfeff('0x2a')][_0xfeff('0x89')])===!![]?undefined:{'$or':[{'ListId':_0x3d448a[_0xfeff('0x2a')]['id']},{'ListId':null}]},'raw':!![]};return db[_0xfeff('0x8a')]['findAll'](_0x509599)['then'](function(_0x4ba840){for(var _0x4e9065=0x0;_0x4e9065<_0x4ba840[_0xfeff('0x20')];_0x4e9065++){var _0x1e8025=_0xfeff('0x23')+_0x4ba840[_0x4e9065]['id'];_0x145ed2[_0x1e8025][_0xfeff('0x87')]=_0x1e8025;_0x145ed2[_0x1e8025][_0xfeff('0x88')]=_0x4ba840[_0x4e9065][_0xfeff('0x8b')];_0x145ed2[_0x1e8025][_0xfeff('0x8c')]={'type':_0x4ba840[_0x4e9065]['type'],'values':_0x4ba840[_0x4e9065][_0xfeff('0x8d')]};}Object[_0xfeff('0x21')](_0x145ed2)['forEach'](function(_0x3522c7){if(!_0x145ed2[_0x3522c7][_0xfeff('0x2f')](_0xfeff('0x87'))){delete _0x145ed2[_0x3522c7];}});return _0x145ed2;});})['then'](respondWithResult(_0x27c12d,null))[_0xfeff('0x85')](handleError(_0x27c12d,null));};exports['merge']=function(_0x1cb80c,_0x19d088){var _0x84518f;var _0xca0654;var _0x32d1e4;if(_0x1cb80c[_0xfeff('0x8e')]['id']){delete _0x1cb80c[_0xfeff('0x8e')]['id'];}return db[_0xfeff('0x1d')][_0xfeff('0x8f')]({'where':{'id':[_0x1cb80c['body']['to'],_0x1cb80c[_0xfeff('0x8e')]['from']]}})['then'](function(_0x4e0621){if(_0x4e0621){if(_0x4e0621[_0xfeff('0x20')]!==0x2){return null;}_0x4e0621[0x0]=_0x4e0621[0x0][_0xfeff('0x90')]({'plain':!![]});_0x4e0621[0x1]=_0x4e0621[0x1][_0xfeff('0x90')]({'plain':!![]});delete _0x4e0621[0x0]['id'];delete _0x4e0621[0x1]['id'];return _[_0xfeff('0x91')](_0x4e0621[0x0],_0x4e0621[0x1],function(_0x11939c,_0x307c4d){if(Array['isArray'](_0x307c4d)&&!_0x307c4d['length']){return _0x11939c;}else if(!_0x307c4d){return _0x11939c;}});}})[_0xfeff('0x1f')](handleEntityNotFound(_0x19d088,null))[_0xfeff('0x1f')](function(_0x537070){if(_0x537070){if(_0x537070['tags']&&_[_0xfeff('0x92')](_0x537070[_0xfeff('0x93')])){_0x537070[_0xfeff('0x93')]=_0x537070[_0xfeff('0x93')]['join']();}logger[_0xfeff('0x94')](_0xfeff('0x95'),_0x1cb80c[_0xfeff('0x8e')]['to'],_0x1cb80c['body']['from']);return db['CmHopper'][_0xfeff('0x16')]({'where':{'ContactId':[_0x1cb80c['body']['to'],_0x1cb80c[_0xfeff('0x8e')][_0xfeff('0x36')]]}})[_0xfeff('0x1f')](function(_0x3925a7){logger['info'](_0xfeff('0x96'),_0x3925a7);return db[_0xfeff('0x97')][_0xfeff('0x16')]({'where':{'ContactId':[_0x1cb80c[_0xfeff('0x8e')]['to'],_0x1cb80c[_0xfeff('0x8e')]['from']]}})[_0xfeff('0x1f')](function(_0xbf99b){logger['info'](_0xfeff('0x98'),_0xbf99b);return db[_0xfeff('0x1d')][_0xfeff('0x99')](_0x537070);});});}})[_0xfeff('0x1f')](function(_0x5dec71){if(_0x5dec71){_0x84518f=_0x5dec71;_0xca0654={'ContactId':_0x84518f['id']};_0x32d1e4={'where':{'ContactId':[_0x1cb80c[_0xfeff('0x8e')]['to'],_0x1cb80c[_0xfeff('0x8e')]['from']]}};return db[_0xfeff('0x9a')][_0xfeff('0x9b')](_0xca0654,_0x32d1e4);}})[_0xfeff('0x1f')](function(){if(_0x84518f){return db[_0xfeff('0x9c')][_0xfeff('0x9b')](_0xca0654,_0x32d1e4);}})[_0xfeff('0x1f')](function(){if(_0x84518f){return db[_0xfeff('0x9d')]['update'](_0xca0654,_0x32d1e4);}})['then'](function(){if(_0x84518f){return db[_0xfeff('0x9e')][_0xfeff('0x9b')](_0xca0654,_0x32d1e4);}})[_0xfeff('0x1f')](function(){if(_0x84518f){return db[_0xfeff('0x9f')][_0xfeff('0x9b')](_0xca0654,_0x32d1e4);}})[_0xfeff('0x1f')](function(){if(_0x84518f){return db[_0xfeff('0x9e')][_0xfeff('0x9b')](_0xca0654,_0x32d1e4);}})[_0xfeff('0x1f')](function(){if(_0x84518f){return db[_0xfeff('0x9f')][_0xfeff('0x9b')](_0xca0654,_0x32d1e4);}})[_0xfeff('0x1f')](function(){if(_0x84518f){return db[_0xfeff('0xa0')][_0xfeff('0x9b')](_0xca0654,_0x32d1e4);}})[_0xfeff('0x1f')](function(){if(_0x84518f){return db[_0xfeff('0xa1')][_0xfeff('0x9b')](_0xca0654,_0x32d1e4);}})[_0xfeff('0x1f')](function(){if(_0x84518f){return db[_0xfeff('0xa2')][_0xfeff('0x9b')](_0xca0654,_0x32d1e4);}})[_0xfeff('0x1f')](function(){if(_0x84518f){return db[_0xfeff('0xa3')][_0xfeff('0x9b')](_0xca0654,_0x32d1e4);}})['then'](function(){if(_0x84518f){return db[_0xfeff('0xa4')][_0xfeff('0x9b')](_0xca0654,_0x32d1e4);}})[_0xfeff('0x1f')](function(){if(_0x84518f){return db[_0xfeff('0xa5')][_0xfeff('0x9b')](_0xca0654,_0x32d1e4);}})[_0xfeff('0x1f')](function(){if(_0x84518f){return db[_0xfeff('0xa6')][_0xfeff('0x9b')]({'CmContactId':_0x84518f['id']},{'where':{'CmContactId':[_0x1cb80c[_0xfeff('0x8e')]['to'],_0x1cb80c[_0xfeff('0x8e')][_0xfeff('0x36')]]}});}})['then'](function(){if(_0x84518f){return db[_0xfeff('0xa7')][_0xfeff('0x9b')](_0xca0654,_0x32d1e4);}})[_0xfeff('0x1f')](function(){if(_0x84518f){return db[_0xfeff('0xa8')][_0xfeff('0x9b')](_0xca0654,_0x32d1e4);}})['then'](function(){if(_0x84518f){return db[_0xfeff('0xa9')][_0xfeff('0x9b')](_0xca0654,_0x32d1e4);}})[_0xfeff('0x1f')](function(){if(_0x84518f){return db[_0xfeff('0xaa')]['update'](_0xca0654,_0x32d1e4);}})[_0xfeff('0x1f')](function(){if(_0x84518f){return db[_0xfeff('0xab')]['update'](_0xca0654,_0x32d1e4);}})[_0xfeff('0x1f')](function(){if(_0x84518f){return db[_0xfeff('0xac')][_0xfeff('0x9b')](_0xca0654,_0x32d1e4);}})['then'](function(){if(_0x84518f){return db[_0xfeff('0xad')][_0xfeff('0x9b')](_0xca0654,_0x32d1e4);}})[_0xfeff('0x1f')](function(){if(_0x84518f){return db[_0xfeff('0xae')][_0xfeff('0x9b')](_0xca0654,_0x32d1e4);}})[_0xfeff('0x1f')](function(){if(_0x84518f){return db['SmsQueueReport'][_0xfeff('0x9b')](_0xca0654,_0x32d1e4);}})[_0xfeff('0x1f')](function(){if(_0x84518f){return db['JscriptySessionReport'][_0xfeff('0x9b')](_0xca0654,_0x32d1e4);}})[_0xfeff('0x1f')](function(){if(_0x84518f){return db[_0xfeff('0xaf')][_0xfeff('0x9b')](_0xca0654,_0x32d1e4);}})[_0xfeff('0x1f')](function(){if(_0x84518f){return db[_0xfeff('0xb0')][_0xfeff('0x9b')](_0xca0654,_0x32d1e4);}})[_0xfeff('0x1f')](function(){if(_0x84518f){return db[_0xfeff('0xb1')][_0xfeff('0x9b')](_0xca0654,_0x32d1e4);}})['then'](function(){if(_0x84518f){return db[_0xfeff('0x1d')]['destroy']({'where':{'id':[_0x1cb80c[_0xfeff('0x8e')]['to'],_0x1cb80c[_0xfeff('0x8e')][_0xfeff('0x36')]]}});}})[_0xfeff('0x1f')](function(){if(_0x84518f){return _0x84518f;}})[_0xfeff('0x1f')](respondWithResult(_0x19d088,null))['catch'](handleError(_0x19d088,null));};exports['create']=function(_0x793fe5,_0x3a61e3){return db[_0xfeff('0x1d')][_0xfeff('0x1e')]()[_0xfeff('0x1f')](function(_0x38aec2){if(_0x793fe5[_0xfeff('0x8e')]['tags']&&_[_0xfeff('0x92')](_0x793fe5[_0xfeff('0x8e')][_0xfeff('0x93')])){if(_0x793fe5[_0xfeff('0x8e')][_0xfeff('0x93')][_0xfeff('0x20')]){_0x793fe5[_0xfeff('0x8e')][_0xfeff('0x93')]=_0x793fe5[_0xfeff('0x8e')][_0xfeff('0x93')][_0xfeff('0xb2')](';')+';';}else{_0x793fe5[_0xfeff('0x8e')][_0xfeff('0x93')]=null;}}else{_0x793fe5[_0xfeff('0x8e')][_0xfeff('0x93')]=null;}if(!_['isNil'](_0x793fe5[_0xfeff('0x8e')][_0xfeff('0xb3')])){var _0x75a3da=_0x793fe5[_0xfeff('0x8e')]['dialTimezone'];if(!_[_0xfeff('0x51')](shared[_0xfeff('0xb4')][_0x75a3da]))_0x793fe5[_0xfeff('0x8e')][_0xfeff('0xb5')]=shared[_0xfeff('0xb4')][_0x75a3da]['utcOffset'];}return db['CmContact'][_0xfeff('0x99')](_0x793fe5[_0xfeff('0x8e')],{'fields':_['keys'](_0x38aec2),'raw':!![]});})[_0xfeff('0x1f')](function(_0x3f4991){if(_0x793fe5['body']['additionalPhones']){return insertAdditionalPhones(_0x3f4991,_0x793fe5[_0xfeff('0x8e')]['additionalPhones']);}else{return _0x3f4991;}})['then'](respondWithResult(_0x3a61e3,0xc9))[_0xfeff('0x85')](handleError(_0x3a61e3,null));};exports['bulkCreate']=function(_0x3f809d,_0x578d0c){var _0x2909f6=0x0;var _0x18c671=0x0;var _0x33ddca=0x0;var _0x5b97ec=[];return db['CmContact'][_0xfeff('0x1e')]()['then'](function(_0x56a536){return BPromise[_0xfeff('0xb6')](_0x3f809d[_0xfeff('0x8e')],function(_0x3c2543){var _0x55953c={'where':{'$or':[]},'defaults':_0x3c2543,'fields':_[_0xfeff('0x21')](_0x56a536),'raw':!![]};if(_0x3c2543['duplicates']){for(var _0x31b60c=0x0;_0x31b60c<_0x3c2543[_0xfeff('0xb7')][_0xfeff('0x20')];_0x31b60c++){var _0x116920={};_0x116920[_0x3c2543[_0xfeff('0xb7')][_0x31b60c]]=_0x3c2543[_0x3c2543[_0xfeff('0xb7')][_0x31b60c]];_0x55953c[_0xfeff('0x56')][_0xfeff('0xb8')][_0xfeff('0x53')](_0x116920);}_0x55953c[_0xfeff('0x56')][_0xfeff('0x55')]=_0x3c2543[_0xfeff('0x55')];}return db[_0xfeff('0x1d')][_0xfeff('0xb9')](_0x55953c)[_0xfeff('0xba')](function(_0x53b53f,_0x5bd62d){if(_0x5bd62d){if(_0x3c2543[_0xfeff('0x2f')]('additionalPhones')){_0x5b97ec[_0xfeff('0x53')]({'contact':_0x53b53f,'additionalPhones':_0x3c2543[_0xfeff('0xbb')]});}_0x2909f6++;}else{_0x33ddca++;}})[_0xfeff('0x85')](function(){_0x18c671++;});});})[_0xfeff('0x1f')](function(_0x3013a7){if(_0x3013a7){if(_0x5b97ec[_0xfeff('0x20')]>0x0){return new Promise(function(_0x2e3e98,_0x42fe82){var _0x22c20e=[];for(var _0x4e6f76=0x0;_0x4e6f76<_0x5b97ec[_0xfeff('0x20')];_0x4e6f76++){_0x22c20e[_0xfeff('0x53')](insertAdditionalPhones(_0x5b97ec[_0x4e6f76][_0xfeff('0xbc')],_0x5b97ec[_0x4e6f76]['additionalPhones']));}Promise[_0xfeff('0x26')](_0x22c20e)['then'](function(){_0x2e3e98(0x1);});})['then'](function(){return{'success':_0x2909f6,'failure':_0x18c671,'duplicates':_0x33ddca};});}else{return{'success':_0x2909f6,'failure':_0x18c671,'duplicates':_0x33ddca};}}})[_0xfeff('0x1f')](respondWithResult(_0x578d0c,0xc9))[_0xfeff('0x85')](handleError(_0x578d0c,null));};exports[_0xfeff('0xbd')]=function(_0x478661,_0x11817a){var _0x3e028b;return db[_0xfeff('0x1d')]['describe']()['then'](function(_0x5b3d36){return db[_0xfeff('0x1d')][_0xfeff('0xbe')]({'where':{'id':_0x478661[_0xfeff('0x86')]['id']},'include':[{'model':db['Tag'],'as':_0xfeff('0x83'),'attributes':['id',_0xfeff('0x1a'),_0xfeff('0x35')],'required':_0x478661[_0xfeff('0x2a')][_0xfeff('0x5b')]?!![]:![]},{'model':db[_0xfeff('0xa6')],'as':_0xfeff('0xbf'),'where':{'CmContactId':_0x478661['params']['id']},'required':![],'include':[{'model':db[_0xfeff('0xc0')],'as':_0xfeff('0xc1')}]}],'order':[db[_0xfeff('0x77')][_0xfeff('0xc2')](_0xfeff('0xc3'))],'attributes':_[_0xfeff('0x21')](_0x5b3d36)});})[_0xfeff('0x1f')](function(_0x4838e5){if(!_[_0xfeff('0x51')](_0x4838e5)){_0x3e028b=_0x4838e5['get']({'plain':!![]});var _0x582cc5={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x4838e5&&_0x4838e5['ListId']){if(_0x4838e5['ListId']){_0x582cc5[_0xfeff('0x56')][_0xfeff('0xc4')]['push']({'ListId':{'$ne':_0x4838e5[_0xfeff('0x55')]}});}}return db[_0xfeff('0x8a')][_0xfeff('0x8f')](_0x582cc5);}})[_0xfeff('0x1f')](function(_0x394443){if(!_[_0xfeff('0x51')](_0x394443)){return _[_0xfeff('0xc5')](_0x3e028b,_[_0xfeff('0x46')](_0x394443,function(_0x1de168){return util[_0xfeff('0xc6')](_0xfeff('0xc7'),_0x1de168['id']);}));}})[_0xfeff('0x1f')](handleEntityNotFound(_0x11817a,null))['then'](respondWithResult(_0x11817a,null))[_0xfeff('0x85')](handleError(_0x11817a,null));};exports[_0xfeff('0x9b')]=function(_0x2a381a,_0x539c5f){var _0x12e52d;if(_0x2a381a['body']['id']){delete _0x2a381a['body']['id'];}if(!_[_0xfeff('0x51')](_0x2a381a['body'][_0xfeff('0xb3')])){var _0x360e25=_0x2a381a[_0xfeff('0x8e')][_0xfeff('0xb3')];if(!_[_0xfeff('0x51')](shared[_0xfeff('0xb4')][_0x360e25]))_0x2a381a['body']['utcOffset']=shared[_0xfeff('0xb4')][_0x360e25]['utcOffset'];}return db[_0xfeff('0x1d')][_0xfeff('0xbe')]({'where':{'id':_0x2a381a['params']['id']}})[_0xfeff('0x1f')](handleEntityNotFound(_0x539c5f,null))[_0xfeff('0x1f')](saveUpdates(_0x2a381a[_0xfeff('0x8e')],null))[_0xfeff('0x1f')](function(_0x2b309e){_0x12e52d=_0x2b309e;var _0x2b6f22={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x2b309e&&_0x2b309e[_0xfeff('0x55')]){if(_0x2b309e[_0xfeff('0x55')]){_0x2b6f22[_0xfeff('0x56')][_0xfeff('0xc4')][_0xfeff('0x53')]({'ListId':{'$ne':_0x2b309e['ListId']}});}}return db[_0xfeff('0x8a')][_0xfeff('0x8f')](_0x2b6f22);})[_0xfeff('0x1f')](function(_0x5b8a67){if(_0x5b8a67){return _[_0xfeff('0xc5')](_['pickBy'](_0x2a381a[_0xfeff('0x8e')],function(_0x1fadc0,_0x37ec9c){return _['startsWith'](_0x37ec9c,_0xfeff('0x23'));}),_[_0xfeff('0x46')](_0x5b8a67,function(_0x4dd9a9){return util[_0xfeff('0xc6')](_0xfeff('0xc7'),_0x4dd9a9['id']);}));}})[_0xfeff('0x1f')](function(_0x253e49){if(_0x253e49&&!_['isEmpty'](_0x253e49)){var _0x1a75db=squel['update']()[_0xfeff('0xc8')](_0xfeff('0x38'))['setFields'](_0x253e49)['where']('id\x20=\x20?',_0x2a381a[_0xfeff('0x86')]['id'])[_0xfeff('0xc9')]();return db[_0xfeff('0x77')]['query'](_0x1a75db['text'],{'replacements':_0x1a75db[_0xfeff('0x8d')]});}})[_0xfeff('0x1f')](function(){if(_0x2a381a[_0xfeff('0x8e')]['phone']&&_0x12e52d){return db[_0xfeff('0xca')]['update']({'phone':_0x2a381a[_0xfeff('0x8e')][_0xfeff('0xcb')],'OrderBy':0x0},{'where':{'ContactId':_0x12e52d['id']}});}})[_0xfeff('0x1f')](function(){return _0x12e52d;})[_0xfeff('0x1f')](respondWithResult(_0x539c5f,null))[_0xfeff('0x85')](handleError(_0x539c5f,null));};exports[_0xfeff('0xcc')]=function(_0x9ba67b,_0x5843d0){var _0x15d9c6={};var _0x34420d={};var _0x1f20e7;var _0x1cbcfa;return db[_0xfeff('0x1d')][_0xfeff('0x24')]({'where':{'id':_0x9ba67b[_0xfeff('0x86')]['id']}})['then'](handleEntityNotFound(_0x5843d0,null))[_0xfeff('0x1f')](function(_0x48becb){if(_0x48becb){_0x1f20e7=_0x48becb;_0x34420d[_0xfeff('0x29')]=_[_0xfeff('0x21')](db[_0xfeff('0x44')][_0xfeff('0xcd')]);_0x34420d[_0xfeff('0x2a')]=_[_0xfeff('0x21')](_0x9ba67b[_0xfeff('0x2a')]);_0x34420d['filters']=_[_0xfeff('0x2c')](_0x34420d['model'],_0x34420d[_0xfeff('0x2a')]);_0x15d9c6['attributes']=_[_0xfeff('0x2c')](_0x34420d[_0xfeff('0x29')],qs['fields'](_0x9ba67b[_0xfeff('0x2a')][_0xfeff('0x2e')]));_0x15d9c6[_0xfeff('0x2d')]=_0x15d9c6[_0xfeff('0x2d')][_0xfeff('0x20')]?_0x15d9c6['attributes']:_0x34420d[_0xfeff('0x29')];_0x15d9c6[_0xfeff('0x31')]=qs[_0xfeff('0xce')](_0x9ba67b['query']['sort']);_0x15d9c6[_0xfeff('0x56')]=qs[_0xfeff('0x2b')](_[_0xfeff('0x32')](_0x9ba67b[_0xfeff('0x2a')],_0x34420d[_0xfeff('0x2b')]));if(_0x9ba67b[_0xfeff('0x2a')]['filter']){_0x15d9c6[_0xfeff('0x56')]=_[_0xfeff('0x79')](_0x15d9c6['where'],{'$or':_[_0xfeff('0x46')](_0x15d9c6[_0xfeff('0x2d')],function(_0x4592a0){var _0x53d29a={};_0x53d29a[_0x4592a0]={'$like':'%'+_0x9ba67b['query'][_0xfeff('0xcf')]+'%'};return _0x53d29a;})});}_0x15d9c6=_[_0xfeff('0x79')]({},_0x15d9c6,_0x9ba67b[_0xfeff('0xd0')]);return _0x1f20e7[_0xfeff('0xcc')](_0x15d9c6);}})[_0xfeff('0x1f')](function(_0x1788ed){if(_0x1788ed){_0x1cbcfa=_0x1788ed[_0xfeff('0x20')];if(!_0x9ba67b[_0xfeff('0x2a')]['hasOwnProperty'](_0xfeff('0x30'))){_0x15d9c6['limit']=qs[_0xfeff('0x13')](_0x9ba67b[_0xfeff('0x2a')][_0xfeff('0x13')]);_0x15d9c6[_0xfeff('0x11')]=qs['offset'](_0x9ba67b[_0xfeff('0x2a')][_0xfeff('0x11')]);}return _0x1f20e7[_0xfeff('0xcc')](_0x15d9c6);}})[_0xfeff('0x1f')](function(_0x34e220){if(_0x34e220){return _0x34e220?{'count':_0x1cbcfa,'rows':_0x34e220}:null;}})[_0xfeff('0x1f')](respondWithResult(_0x5843d0,null))[_0xfeff('0x85')](handleError(_0x5843d0,null));};exports[_0xfeff('0xd1')]=function(_0x554f8b,_0x11eed2){if(_0x554f8b[_0xfeff('0x8e')]['id']){delete _0x554f8b[_0xfeff('0x8e')]['id'];}return db['CmContact'][_0xfeff('0x24')]({'where':{'id':_0x554f8b[_0xfeff('0x86')]['id']}})[_0xfeff('0x1f')](handleEntityNotFound(_0x11eed2,null))[_0xfeff('0x1f')](function(_0x2282d4){if(_0x2282d4){return _0x2282d4[_0xfeff('0xd1')](_0x554f8b[_0xfeff('0x8e')][_0xfeff('0xd2')]||[]);}return null;})[_0xfeff('0x1f')](respondWithResult(_0x11eed2,null))['catch'](handleError(_0x11eed2,null));};exports[_0xfeff('0xd3')]=function(_0x269518,_0x54d2e2){var _0x59bb7a=[];_0x59bb7a['push'](addAdditionalPhones(_0x269518['body']));Promise[_0xfeff('0x26')](_0x59bb7a)[_0xfeff('0x1f')](function(){_0x59bb7a=[];_0x59bb7a[_0xfeff('0x53')](deleteCmHopperPhones(_0x269518[_0xfeff('0x8e')]['id']));_0x59bb7a[_0xfeff('0x53')](addCmHopperPhones(_0x269518[_0xfeff('0x8e')]['id']));Promise[_0xfeff('0x26')](_0x59bb7a)[_0xfeff('0x1f')](function(){return[0x1];})[_0xfeff('0x1f')](respondWithResult(_0x54d2e2,null));});};function addAdditionalPhones(_0x5878da){var _0x398fe5;return new Promise(function(_0x501a80,_0x11460d){return db[_0xfeff('0xa6')]['destroy']({'where':{'CmContactId':_0x5878da['id']}})[_0xfeff('0x1f')](function(){db[_0xfeff('0xc0')][_0xfeff('0x8f')]({'raw':!![],'attributes':['id','OrderBy']})['then'](function(_0x467984){var _0x856322=[];for(var _0x358cf7=0x0;_0x358cf7<_0x5878da['items'][_0xfeff('0x20')];_0x358cf7++){var _0x321529=_0x5878da['item_types']?_[_0xfeff('0x51')](_0x5878da[_0xfeff('0xd4')][_0x358cf7])?'':_0x5878da[_0xfeff('0xd4')][_0x358cf7]:_0x5878da[_0xfeff('0xd5')][_0x358cf7][_0xfeff('0xd6')]?_0x5878da['items'][_0x358cf7][_0xfeff('0xd6')]:'';var _0x59beed=_[_0xfeff('0x51')](_0x5878da[_0xfeff('0xd5')][_0x358cf7][_0xfeff('0xd7')])?'':_0x5878da[_0xfeff('0xd5')][_0x358cf7]['description'];var _0x503714=_0x321529+':'+_0x5878da['items'][_0x358cf7][_0xfeff('0xcb')]+'§'+_0x59beed;if(_[_0xfeff('0x51')](_0x398fe5))_0x398fe5=_0x503714;else _0x398fe5+=';'+_0x503714;var _0x312b50=null;if(_0x5878da[_0xfeff('0xd4')]){if(!_[_0xfeff('0x51')](_0x5878da[_0xfeff('0xd4')][_0x358cf7])){var _0x23b560=_['find'](_0x467984,function(_0x3c4a21){return _0x3c4a21['id']===_0x5878da[_0xfeff('0xd4')][_0x358cf7];});if(!_[_0xfeff('0x51')](_0x23b560)){_0x312b50=_0x23b560[_0xfeff('0xd8')];}}}else{if(!_['isNil'](_0x5878da['items'][_0x358cf7])){var _0x23b560=_[_0xfeff('0xbe')](_0x467984,function(_0x21cf07){return _0x21cf07['id']===_0x5878da[_0xfeff('0xd5')][_0x358cf7]['ItemTypeId'];});if(!_[_0xfeff('0x51')](_0x23b560)){_0x312b50=_0x358cf7;}}}if(_[_0xfeff('0x51')](_0x312b50)){_0x312b50=0x64;}_0x856322[_0xfeff('0x53')](addAdditionalPhone(_0x5878da['id'],_0x5878da[_0xfeff('0xd5')][_0x358cf7][_0xfeff('0xcb')],_0x5878da['item_types']?_[_0xfeff('0x51')](_0x5878da[_0xfeff('0xd4')][_0x358cf7])?null:_0x5878da['item_types'][_0x358cf7]:_0x5878da[_0xfeff('0xd5')][_0x358cf7]['ItemTypeId']?_0x5878da[_0xfeff('0xd5')][_0x358cf7][_0xfeff('0xd6')]:null,_0x312b50,_0x59beed));}Promise[_0xfeff('0x26')](_0x856322)[_0xfeff('0x1f')](function(){db['CmContact'][_0xfeff('0x9b')]({'AdditionalPhones':_0x398fe5},{'where':{'id':_0x5878da['id']}})[_0xfeff('0x1f')](function(){_0x501a80(0x1);});});});});});}function addAdditionalPhone(_0x25635a,_0x2e9f05,_0x2bb071,_0x211448,_0x4c7b67){return db[_0xfeff('0xa6')][_0xfeff('0xbe')]({'where':{'CmContactId':_0x25635a,'item':_0x2e9f05}})[_0xfeff('0x1f')](function(_0x4de62f){if(_0x4de62f)logger['info'](_0xfeff('0xd9'),_0x4de62f);else{db[_0xfeff('0xa6')][_0xfeff('0x99')]({'CmContactId':_0x25635a,'item':_0x2e9f05,'ItemTypeId':_0x2bb071,'OrderBy':_0x211448,'ItemClass':_0xfeff('0xda'),'description':_0x4c7b67});}});}function deletePhones(_0x38a86f){return db[_0xfeff('0xa6')][_0xfeff('0x16')]({'where':{'CmContactId':_0x38a86f}});}function deleteCmHopperPhones(_0x196884){return new Promise(function(_0x9c44d6,_0x5d4ad4){return db[_0xfeff('0xca')][_0xfeff('0x8f')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x196884}})[_0xfeff('0x1f')](function(_0x30079c){db[_0xfeff('0xdb')][_0xfeff('0x16')]({'where':{'CmHopperId':{'$in':_[_0xfeff('0x46')](_0x30079c,'id')}}});})[_0xfeff('0x1f')](function(){_0x9c44d6(0x1);});});}function addCmHopperPhones(_0x49c4ef){return new Promise(function(_0x494da1,_0x316027){return db[_0xfeff('0xca')]['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x49c4ef}})['then'](function(_0x52e4b0){var _0x5e6751=[];_[_0xfeff('0x46')](_0x52e4b0,function(_0x3bfe36){_0x5e6751[_0xfeff('0x53')](createCmHopperPhone(_0x49c4ef,_0x3bfe36['id']));});Promise['all'](_0x5e6751)[_0xfeff('0x1f')](function(){_0x494da1(0x1);});});});}function createCmHopperPhone(_0x3df156,_0x457dc1){return new Promise(function(_0x50302b,_0x3c652c){db[_0xfeff('0xa6')]['findAll']({'raw':!![],'attributes':[_0xfeff('0xdc'),_0xfeff('0xd8')],'where':{'CmContactId':_0x3df156,'ItemClass':'PHONE'},'include':[{'model':db[_0xfeff('0xc0')],'attributes':[_0xfeff('0xd8')],'as':_0xfeff('0xc1')}],'order':[_0xfeff('0xd8'),db['sequelize'][_0xfeff('0xc2')](_0xfeff('0xdd'))]})[_0xfeff('0x1f')](function(_0xdbd37e){var _0x52f557=0x1;var _0x58d780=_['map'](_0xdbd37e,function(_0x294cb7){_0x294cb7[_0xfeff('0xde')]=_0x457dc1;_0x294cb7[_0xfeff('0xcb')]=_0x294cb7[_0xfeff('0xdc')];_0x294cb7[_0xfeff('0xd8')]=_0x52f557;delete _0x294cb7['ItemType.OrderBy'];_0x52f557=_0x52f557+0x1;return _0x294cb7;});return db[_0xfeff('0xdb')][_0xfeff('0xdf')](_0x58d780,{});})['then'](function(){_0x50302b(0x1);});});}function insertAdditionalPhones(_0x554872,_0xd86ff9){return new Promise(function(_0x2613c2,_0x5601a8){var _0x23c2bd=[];for(var _0x3c1ed1=0x0;_0x3c1ed1<_0xd86ff9['length'];_0x3c1ed1++){var _0x1aa9e2=_0xd86ff9[_0x3c1ed1];_0x23c2bd[_0xfeff('0x53')](parseContactItemType(_0x1aa9e2));}Promise[_0xfeff('0x26')](_0x23c2bd)[_0xfeff('0x1f')](function(){var _0x115489={'id':_0x554872['id'],'items':_0xd86ff9};return addAdditionalPhones(_0x115489)[_0xfeff('0x1f')](function(_0x2d2ae6){return addCmHopperPhones(_0x554872['id']);});})[_0xfeff('0x1f')](function(){_0x2613c2(_0x554872);});});}function parseContactItemType(_0x52be2e){return new Promise(function(_0x11a71a,_0x992f5b){if(_0x52be2e[_0xfeff('0x2f')](_0xfeff('0xd6'))){_0x11a71a(_0x52be2e);}else{return db['ContactItemType'][_0xfeff('0xbe')]({'where':{'name':_0x52be2e['ItemType']}})[_0xfeff('0x1f')](function(_0x43c6d6){if(_[_0xfeff('0x51')](_0x43c6d6))_0x52be2e[_0xfeff('0xd6')]=null;else _0x52be2e[_0xfeff('0xd6')]=_0x43c6d6['id'];_0x11a71a(_0x52be2e);});}});}exports['getAdditionalPhones']=function(_0x9e6292,_0x312f31){return db[_0xfeff('0xa6')][_0xfeff('0x8f')]({'raw':!![],'where':{'CmContactId':_0x9e6292[_0xfeff('0x86')]['id'],'ItemClass':_0xfeff('0xda')},'include':[{'model':db[_0xfeff('0xc0')],'as':_0xfeff('0xc1')}],'order':[[_0xfeff('0xd8')],[db['sequelize'][_0xfeff('0xc2')](_0xfeff('0xdd'))]]})[_0xfeff('0x1f')](function(_0x3765a4){return _0x3765a4;})[_0xfeff('0x1f')](respondWithResult(_0x312f31,null))[_0xfeff('0x85')](handleError(_0x312f31,null));};exports[_0xfeff('0xe0')]=function(_0x4bed61,_0x5513b7){return db[_0xfeff('0xa6')][_0xfeff('0x8f')]({'raw':!![],'where':{'CmContactId':_0x4bed61[_0xfeff('0x8e')][_0xfeff('0xe1')]}})['then'](function(_0x3d1b66){var _0x399f4e=_[_0xfeff('0x46')](_0x3d1b66,function(_0x41da2a){_0x41da2a[_0xfeff('0xe2')]=_0x4bed61[_0xfeff('0x8e')][_0xfeff('0xe3')];return _0x41da2a;});return db[_0xfeff('0xa6')]['bulkCreate'](_0x399f4e,{});})['then'](function(_0x5e6621){return addCmHopperPhones(_0x4bed61['body'][_0xfeff('0xe3')]);})[_0xfeff('0x1f')](function(_0xbde6bf){return['ok'];})['then'](respondWithResult(_0x5513b7,null))[_0xfeff('0x85')](handleError(_0x5513b7,null));};exports[_0xfeff('0xe4')]=function(_0x3a8844,_0x3f59ad){var _0x39f232=[];_0x39f232['push'](createCmHopperPhone(_0x3a8844[_0xfeff('0x8e')]['id'],_0x3a8844[_0xfeff('0x8e')]['hopperId']));Promise[_0xfeff('0x26')](_0x39f232)['then'](function(){return[0x1];})[_0xfeff('0x1f')](respondWithResult(_0x3f59ad,null));};exports[_0xfeff('0xe5')]=function(_0x48a7b6,_0x3fcf4a){var _0xc311fa={'raw':![],'where':{}};var _0x11e0a5={};var _0x5e20a2={'count':0x0,'rows':[]};return db[_0xfeff('0x1d')][_0xfeff('0x24')]({'where':{'id':_0x48a7b6[_0xfeff('0x86')]['id']}})['then'](handleEntityNotFound(_0x3fcf4a,null))[_0xfeff('0x1f')](function(_0xbcbc01){if(_0xbcbc01){_0x11e0a5[_0xfeff('0x29')]=_[_0xfeff('0x21')](db[_0xfeff('0xca')]['rawAttributes']);_0x11e0a5[_0xfeff('0x2a')]=_[_0xfeff('0x21')](_0x48a7b6['query']);_0x11e0a5[_0xfeff('0x2b')]=_['intersection'](_0x11e0a5[_0xfeff('0x29')],_0x11e0a5[_0xfeff('0x2a')]);_0xc311fa[_0xfeff('0x2d')]=_[_0xfeff('0x2c')](_0x11e0a5[_0xfeff('0x29')],qs[_0xfeff('0x2e')](_0x48a7b6['query'][_0xfeff('0x2e')]));_0xc311fa[_0xfeff('0x2d')]=_0xc311fa[_0xfeff('0x2d')][_0xfeff('0x20')]?_0xc311fa[_0xfeff('0x2d')]:_0x11e0a5['model'];if(!_0x48a7b6['query'][_0xfeff('0x2f')](_0xfeff('0x30'))){_0xc311fa[_0xfeff('0x13')]=qs[_0xfeff('0x13')](_0x48a7b6['query'][_0xfeff('0x13')]);_0xc311fa['offset']=qs['offset'](_0x48a7b6['query']['offset']);}_0xc311fa[_0xfeff('0x31')]=qs['sort'](_0x48a7b6[_0xfeff('0x2a')][_0xfeff('0xce')]);_0xc311fa[_0xfeff('0x56')]=qs['filters'](_['pick'](_0x48a7b6[_0xfeff('0x2a')],_0x11e0a5[_0xfeff('0x2b')]));_0xc311fa[_0xfeff('0x56')][_0xfeff('0xe6')]=_0xbcbc01['id'];if(_0x48a7b6[_0xfeff('0x2a')]['filter']){_0xc311fa['where']=_[_0xfeff('0x79')](_0xc311fa['where'],{'$or':_['map'](_0xc311fa[_0xfeff('0x2d')],function(_0x21b73c){var _0x21a3bd={};_0x21a3bd[_0x21b73c]={'$like':'%'+_0x48a7b6[_0xfeff('0x2a')]['filter']+'%'};return _0x21a3bd;})});}_0xc311fa=_[_0xfeff('0x79')]({},_0xc311fa,_0x48a7b6[_0xfeff('0xd0')]);return db[_0xfeff('0xca')][_0xfeff('0x76')]({'where':_0xc311fa['where']})[_0xfeff('0x1f')](function(_0x351e62){_0x5e20a2[_0xfeff('0x76')]=_0x351e62;if(_0x48a7b6[_0xfeff('0x2a')][_0xfeff('0xe7')]){_0xc311fa[_0xfeff('0xe8')]=[{'all':!![]}];}return db[_0xfeff('0xca')][_0xfeff('0x8f')](_0xc311fa);})['then'](function(_0x251ae7){_0x5e20a2['rows']=_0x251ae7;return _0x5e20a2;});}})[_0xfeff('0x1f')](respondWithFilteredResult(_0x3fcf4a,_0xc311fa))['catch'](handleError(_0x3fcf4a,null));};exports[_0xfeff('0xe9')]=function(_0x2fe8f9,_0x49b4e5){var _0xa09bb7={'raw':!![],'where':{}};var _0x1e31cd={};var _0x509d9e={'count':0x0,'rows':[]};return db[_0xfeff('0x1d')][_0xfeff('0x24')]({'where':{'id':_0x2fe8f9[_0xfeff('0x86')]['id']}})[_0xfeff('0x1f')](handleEntityNotFound(_0x49b4e5,null))[_0xfeff('0x1f')](function(_0x4b8627){if(_0x4b8627){_0x1e31cd[_0xfeff('0x29')]=_[_0xfeff('0x21')](db[_0xfeff('0xa8')][_0xfeff('0xcd')]);_0x1e31cd[_0xfeff('0x2a')]=_[_0xfeff('0x21')](_0x2fe8f9['query']);_0x1e31cd['filters']=_['intersection'](_0x1e31cd[_0xfeff('0x29')],_0x1e31cd[_0xfeff('0x2a')]);_0xa09bb7[_0xfeff('0x2d')]=_[_0xfeff('0x2c')](_0x1e31cd[_0xfeff('0x29')],qs['fields'](_0x2fe8f9[_0xfeff('0x2a')][_0xfeff('0x2e')]));_0xa09bb7[_0xfeff('0x2d')]=_0xa09bb7[_0xfeff('0x2d')][_0xfeff('0x20')]?_0xa09bb7[_0xfeff('0x2d')]:_0x1e31cd[_0xfeff('0x29')];if(!_0x2fe8f9[_0xfeff('0x2a')][_0xfeff('0x2f')](_0xfeff('0x30'))){_0xa09bb7[_0xfeff('0x13')]=qs[_0xfeff('0x13')](_0x2fe8f9[_0xfeff('0x2a')][_0xfeff('0x13')]);_0xa09bb7[_0xfeff('0x11')]=qs[_0xfeff('0x11')](_0x2fe8f9[_0xfeff('0x2a')][_0xfeff('0x11')]);}_0xa09bb7[_0xfeff('0x31')]=qs[_0xfeff('0xce')](_0x2fe8f9[_0xfeff('0x2a')][_0xfeff('0xce')]);_0xa09bb7[_0xfeff('0x56')]=qs['filters'](_['pick'](_0x2fe8f9[_0xfeff('0x2a')],_0x1e31cd[_0xfeff('0x2b')]));_0xa09bb7[_0xfeff('0x56')][_0xfeff('0xe6')]=_0x4b8627['id'];if(_0x2fe8f9['query'][_0xfeff('0xcf')]){_0xa09bb7[_0xfeff('0x56')]=_[_0xfeff('0x79')](_0xa09bb7[_0xfeff('0x56')],{'$or':_[_0xfeff('0x46')](_0xa09bb7[_0xfeff('0x2d')],function(_0x447d26){var _0x1179b0={};_0x1179b0[_0x447d26]={'$like':'%'+_0x2fe8f9[_0xfeff('0x2a')][_0xfeff('0xcf')]+'%'};return _0x1179b0;})});}_0xa09bb7=_[_0xfeff('0x79')]({},_0xa09bb7,_0x2fe8f9[_0xfeff('0xd0')]);return db['CmHopperHistory'][_0xfeff('0x76')]({'where':_0xa09bb7[_0xfeff('0x56')]})[_0xfeff('0x1f')](function(_0x4d4b99){_0x509d9e[_0xfeff('0x76')]=_0x4d4b99;if(_0x2fe8f9['query'][_0xfeff('0xe7')]){_0xa09bb7['include']=[{'all':!![]}];}return db[_0xfeff('0xa8')]['findAll'](_0xa09bb7);})[_0xfeff('0x1f')](function(_0x225f22){_0x509d9e[_0xfeff('0x84')]=_0x225f22;return _0x509d9e;});}})[_0xfeff('0x1f')](respondWithFilteredResult(_0x49b4e5,_0xa09bb7))[_0xfeff('0x85')](handleError(_0x49b4e5,null));};exports['getHopperFinals']=function(_0x15985f,_0x33339e){var _0x3ec78d={'raw':!![],'where':{}};var _0x16f608={};var _0x2352e5={'count':0x0,'rows':[]};return db[_0xfeff('0x1d')]['findOne']({'where':{'id':_0x15985f['params']['id']}})['then'](handleEntityNotFound(_0x33339e,null))[_0xfeff('0x1f')](function(_0xa7859a){if(_0xa7859a){_0x16f608['model']=_[_0xfeff('0x21')](db[_0xfeff('0xa7')][_0xfeff('0xcd')]);_0x16f608[_0xfeff('0x2a')]=_[_0xfeff('0x21')](_0x15985f[_0xfeff('0x2a')]);_0x16f608[_0xfeff('0x2b')]=_['intersection'](_0x16f608[_0xfeff('0x29')],_0x16f608[_0xfeff('0x2a')]);_0x3ec78d[_0xfeff('0x2d')]=_[_0xfeff('0x2c')](_0x16f608[_0xfeff('0x29')],qs[_0xfeff('0x2e')](_0x15985f['query'][_0xfeff('0x2e')]));_0x3ec78d['attributes']=_0x3ec78d[_0xfeff('0x2d')][_0xfeff('0x20')]?_0x3ec78d['attributes']:_0x16f608[_0xfeff('0x29')];if(!_0x15985f[_0xfeff('0x2a')]['hasOwnProperty']('nolimit')){_0x3ec78d[_0xfeff('0x13')]=qs['limit'](_0x15985f[_0xfeff('0x2a')][_0xfeff('0x13')]);_0x3ec78d[_0xfeff('0x11')]=qs['offset'](_0x15985f['query'][_0xfeff('0x11')]);}_0x3ec78d[_0xfeff('0x31')]=qs['sort'](_0x15985f['query'][_0xfeff('0xce')]);_0x3ec78d['where']=qs[_0xfeff('0x2b')](_['pick'](_0x15985f[_0xfeff('0x2a')],_0x16f608[_0xfeff('0x2b')]));_0x3ec78d['where'][_0xfeff('0xe6')]=_0xa7859a['id'];if(_0x15985f['query'][_0xfeff('0xcf')]){_0x3ec78d[_0xfeff('0x56')]=_[_0xfeff('0x79')](_0x3ec78d[_0xfeff('0x56')],{'$or':_[_0xfeff('0x46')](_0x3ec78d[_0xfeff('0x2d')],function(_0x2307aa){var _0x93900e={};_0x93900e[_0x2307aa]={'$like':'%'+_0x15985f['query'][_0xfeff('0xcf')]+'%'};return _0x93900e;})});}_0x3ec78d=_['merge']({},_0x3ec78d,_0x15985f[_0xfeff('0xd0')]);return db[_0xfeff('0xa7')]['count']({'where':_0x3ec78d['where']})[_0xfeff('0x1f')](function(_0x4a4119){_0x2352e5['count']=_0x4a4119;if(_0x15985f['query'][_0xfeff('0xe7')]){_0x3ec78d[_0xfeff('0xe8')]=[{'all':!![]}];}return db['CmHopperFinal'][_0xfeff('0x8f')](_0x3ec78d);})['then'](function(_0x2640d4){_0x2352e5[_0xfeff('0x84')]=_0x2640d4;return _0x2352e5;});}})['then'](respondWithFilteredResult(_0x33339e,_0x3ec78d))[_0xfeff('0x85')](handleError(_0x33339e,null));};exports[_0xfeff('0xea')]=function(_0x544666,_0xaa3b07){var _0x564bd9={'raw':!![],'where':{}};var _0x215096={};var _0x4bd767={'count':0x0,'rows':[]};return db[_0xfeff('0x1d')]['findOne']({'where':{'id':_0x544666['params']['id']}})[_0xfeff('0x1f')](handleEntityNotFound(_0xaa3b07,null))[_0xfeff('0x1f')](function(_0x2b32d2){if(_0x2b32d2){_0x215096[_0xfeff('0x29')]=_['keys'](db[_0xfeff('0xeb')]['rawAttributes']);_0x215096['query']=_[_0xfeff('0x21')](_0x544666[_0xfeff('0x2a')]);_0x215096[_0xfeff('0x2b')]=_[_0xfeff('0x2c')](_0x215096[_0xfeff('0x29')],_0x215096[_0xfeff('0x2a')]);_0x564bd9[_0xfeff('0x2d')]=_[_0xfeff('0x2c')](_0x215096[_0xfeff('0x29')],qs[_0xfeff('0x2e')](_0x544666[_0xfeff('0x2a')][_0xfeff('0x2e')]));_0x564bd9[_0xfeff('0x2d')]=_0x564bd9[_0xfeff('0x2d')][_0xfeff('0x20')]?_0x564bd9['attributes']:_0x215096['model'];if(!_0x544666['query'][_0xfeff('0x2f')]('nolimit')){_0x564bd9['limit']=qs[_0xfeff('0x13')](_0x544666[_0xfeff('0x2a')]['limit']);_0x564bd9[_0xfeff('0x11')]=qs['offset'](_0x544666['query'][_0xfeff('0x11')]);}_0x564bd9[_0xfeff('0x31')]=qs[_0xfeff('0xce')](_0x544666['query'][_0xfeff('0xce')]);_0x564bd9[_0xfeff('0x56')]=qs[_0xfeff('0x2b')](_['pick'](_0x544666[_0xfeff('0x2a')],_0x215096['filters']));_0x564bd9[_0xfeff('0x56')][_0xfeff('0xe6')]=_0x2b32d2['id'];if(_0x544666[_0xfeff('0x2a')][_0xfeff('0xcf')]){_0x564bd9[_0xfeff('0x56')]=_['merge'](_0x564bd9[_0xfeff('0x56')],{'$or':_[_0xfeff('0x46')](_0x564bd9[_0xfeff('0x2d')],function(_0x11208d){var _0x33e22b={};_0x33e22b[_0x11208d]={'$like':'%'+_0x544666[_0xfeff('0x2a')][_0xfeff('0xcf')]+'%'};return _0x33e22b;})});}_0x564bd9=_['merge']({},_0x564bd9,_0x544666[_0xfeff('0xd0')]);return db[_0xfeff('0xeb')][_0xfeff('0x76')]({'where':_0x564bd9[_0xfeff('0x56')]})[_0xfeff('0x1f')](function(_0x24ac64){_0x4bd767[_0xfeff('0x76')]=_0x24ac64;if(_0x544666[_0xfeff('0x2a')][_0xfeff('0xe7')]){_0x564bd9[_0xfeff('0xe8')]=[{'all':!![]}];}return db[_0xfeff('0xeb')]['findAll'](_0x564bd9);})['then'](function(_0x163e68){_0x4bd767[_0xfeff('0x84')]=_0x163e68;return _0x4bd767;});}})[_0xfeff('0x1f')](respondWithFilteredResult(_0xaa3b07,_0x564bd9))[_0xfeff('0x85')](handleError(_0xaa3b07,null));};exports[_0xfeff('0xec')]=function(_0x2d79ec,_0x3ad815){try{if(!_0x2d79ec[_0xfeff('0x8e')][_0xfeff('0x55')]){throw new Error(_0xfeff('0xed'));}if(!_0x2d79ec['body'][_0xfeff('0xee')]){throw new Error(_0xfeff('0xef'));}if(!_0x2d79ec[_0xfeff('0x8e')][_0xfeff('0xf0')]){throw new Error(_0xfeff('0xf1'));}if(!_0x2d79ec[_0xfeff('0x8e')][_0xfeff('0xf2')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x2103fc=_0x2d79ec[_0xfeff('0x8e')][_0xfeff('0xee')][_0xfeff('0x45')](',');var _0xfac264=_0x2d79ec[_0xfeff('0x8e')][_0xfeff('0xf0')][_0xfeff('0x45')](',');if(!_0x2103fc['length']||!_0xfac264[_0xfeff('0x20')]||_0x2103fc[_0xfeff('0x20')]!==_0xfac264[_0xfeff('0x20')]){throw new Error(_0xfeff('0xf3'));}_0x2d79ec[_0xfeff('0x8e')]['fields']=_[_0xfeff('0xf4')](_0x2103fc,_0xfac264);if(!_0x2d79ec[_0xfeff('0x8e')]['fields'][_0xfeff('0xcb')]){throw new Error(_0xfeff('0xf5'));}if(!_0x2d79ec[_0xfeff('0x8e')][_0xfeff('0x2e')]['firstName']){throw new Error(_0xfeff('0xf6'));}var _0x128be7=path[_0xfeff('0xb2')](config[_0xfeff('0xf7')],_0xfeff('0xf8'),_0x2d79ec[_0xfeff('0xf9')][_0xfeff('0xfa')]);fs[_0xfeff('0xfb')](_0x128be7,parseInt('0777',0x8));var _0x499e35=require(_0xfeff('0xfc'))[_0xfeff('0xfd')](path[_0xfeff('0xb2')](__dirname,_0xfeff('0xfe')),[_0x128be7,_0x2d79ec['body'][_0xfeff('0xee')],_0x2d79ec[_0xfeff('0x8e')][_0xfeff('0xf0')],_0x2d79ec[_0xfeff('0x8e')][_0xfeff('0x55')],_0x2d79ec[_0xfeff('0x8e')]['CompanyId'],_0x2d79ec[_0xfeff('0x8e')][_0xfeff('0xb7')],_0x2d79ec['body'][_0xfeff('0xf2')]]);return _0x3ad815[_0xfeff('0xf')](0xc8)[_0xfeff('0x10')]({'message':_0xfeff('0xff'),'pid':_0x499e35[_0xfeff('0x100')]});}catch(_0x2e6d64){return _0x3ad815[_0xfeff('0xf')](0x1f4)[_0xfeff('0x1b')](_0x2e6d64);}};exports[_0xfeff('0x101')]=function(_0x2f7b43,_0x36b170){var _0x10537d=fs[_0xfeff('0x102')](_0x2f7b43[_0xfeff('0xf9')][_0xfeff('0x2')]);Papa[_0xfeff('0x103')](_0x10537d,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x4ffdf5){return _0x36b170[_0xfeff('0xf')](0xc8)['json']({'file':_0x2f7b43['file'],'fields':_0x4ffdf5[_0xfeff('0x104')][_0xfeff('0x2e')]});}});};exports['import']=function(_0x13e0ed,_0x4713cc){return db['User'][_0xfeff('0x8f')]({'raw':!![],'attributes':['id'],'where':{'role':_0xfeff('0x70')}})[_0xfeff('0x1f')](function(_0x51000d){var _0x4026d8=![];if(!_0x13e0ed[_0xfeff('0x8e')][_0xfeff('0x55')]){throw new Error(_0xfeff('0xed'));}if(!_0x13e0ed[_0xfeff('0x8e')][_0xfeff('0x105')][_0xfeff('0xcb')]){throw new Error(_0xfeff('0xf5'));}if(!_0x13e0ed[_0xfeff('0x8e')][_0xfeff('0x105')][_0xfeff('0x106')]){throw new Error(_0xfeff('0xf6'));}if(!_0x13e0ed['body'][_0xfeff('0xf2')]){throw new Error(_0xfeff('0x107'));}var _0x26f579=require(_0xfeff('0xfc'))[_0xfeff('0xfd')](path['join'](__dirname,_0xfeff('0x108')),[_0x13e0ed[_0xfeff('0x86')]['id'],JSON['stringify'](_0x13e0ed[_0xfeff('0x8e')]),JSON[_0xfeff('0x109')](_0x51000d)]);_0x26f579['on'](_0xfeff('0x10a'),function(){_0x4026d8=!![];return _0x4713cc[_0xfeff('0xf')](0xc8)[_0xfeff('0x10')]({'message':'start\x20child\x20process\x20correctly!','pid':_0x26f579['pid']});});_0x26f579['on'](_0xfeff('0x10b'),function(_0x157815){if(_0x157815&&!_0x4026d8){return _0x4713cc['status'](0x1f4)[_0xfeff('0x10')]({'message':'error\x20child\x20process','pid':_0x26f579[_0xfeff('0x100')]});}});})[_0xfeff('0x85')](handleError(_0x4713cc,null));};exports['importUpdates']=function(_0x370abb,_0x4b7703,_0x3b486e){return db[_0xfeff('0x48')][_0xfeff('0x8f')]({'raw':!![],'attributes':['id'],'where':{'role':_0xfeff('0x70')}})[_0xfeff('0x1f')](function(_0x3eec3f){var _0x2cbe02=![];if(!_0x370abb['body']['ListId']){throw new Error('No\x20ListId\x20specified');}if(!_0x370abb[_0xfeff('0x8e')]['binding'][_0xfeff('0xcb')]){throw new Error(_0xfeff('0xf5'));}if(!_0x370abb[_0xfeff('0x8e')][_0xfeff('0x105')][_0xfeff('0x106')]){throw new Error('No\x20firstName\x20column\x20specified');}if(!_0x370abb['body']['socket_timestamp']){throw new Error(_0xfeff('0x107'));}var _0x2e4caa=require(_0xfeff('0xfc'))[_0xfeff('0xfd')](path['join'](__dirname,_0xfeff('0x10c')),[_0x370abb[_0xfeff('0x86')]['id'],JSON['stringify'](_0x370abb[_0xfeff('0x8e')]),JSON[_0xfeff('0x109')](_0x3eec3f)]);_0x2e4caa['on'](_0xfeff('0x10a'),function(_0xcd7d6d){_0x2cbe02=!![];return _0x4b7703[_0xfeff('0xf')](0xc8)[_0xfeff('0x10')]({'message':_0xfeff('0x10d'),'pid':_0x2e4caa[_0xfeff('0x100')]});});_0x2e4caa['on'](_0xfeff('0x10b'),function(_0x154c00){if(_0x154c00&&!_0x2cbe02){return _0x4b7703['status'](0x1f4)[_0xfeff('0x10')]({'message':_0xfeff('0x10e'),'pid':_0x2e4caa[_0xfeff('0x100')]});}});})['catch'](handleError(_0x4b7703,null));};exports[_0xfeff('0x10f')]=function(_0x3dcb9f,_0x268572){var _0x59ffea=[_0xfeff('0x110'),_0xfeff('0x111'),_0xfeff('0x112'),_0xfeff('0x113'),'fax',_0xfeff('0x114'),_0xfeff('0x115')];var _0x373dfe={'offset':0x0,'order':qs[_0xfeff('0xce')](_0xfeff('0x116'))},_0x342767={'count':0x0,'rows':[]};Promise[_0xfeff('0x6d')]()[_0xfeff('0x1f')](function(){if(_0x3dcb9f['query'][_0xfeff('0x117')]){if(!_[_0xfeff('0x118')](_0x59ffea,_0x3dcb9f[_0xfeff('0x2a')]['channel']['toLowerCase']())){throw new Error(_0xfeff('0x119'));}_0x59ffea=[_0x3dcb9f[_0xfeff('0x2a')][_0xfeff('0x117')][_0xfeff('0x11a')]()];}if(_0x3dcb9f[_0xfeff('0x2a')][_0xfeff('0x11b')]){try{var _0x1a8243=JSON[_0xfeff('0x103')](_0x3dcb9f[_0xfeff('0x2a')][_0xfeff('0x11b')]);if(!moment(_0x1a8243[_0xfeff('0x36')])['isValid']()){throw new Error(_0xfeff('0x11c'));}if(!moment(_0x1a8243['to'])[_0xfeff('0x11d')]()){throw new Error(_0xfeff('0x11e'));}}catch(_0x212acb){throw new Error(_0xfeff('0x11f'));}}if(!_0x3dcb9f[_0xfeff('0x2a')][_0xfeff('0x2f')]('nolimit')){_0x373dfe[_0xfeff('0x13')]=qs[_0xfeff('0x13')](_0x3dcb9f[_0xfeff('0x2a')]['limit']||0xa);_0x373dfe[_0xfeff('0x11')]=qs[_0xfeff('0x11')](_0x3dcb9f[_0xfeff('0x2a')][_0xfeff('0x11')]);}var _0x33dabd=_0x59ffea['map'](function(_0x5544ab){if(_0x5544ab===_0xfeff('0x115')){var _0x3e94a8={'attributes':['id',_0xfeff('0x120'),_0xfeff('0x28'),_0xfeff('0x121'),_0xfeff('0x122'),_0xfeff('0x123'),_0xfeff('0x124'),_0xfeff('0x125'),_0xfeff('0x126'),'note',_0xfeff('0x127'),_0xfeff('0x128'),_0xfeff('0x129'),_0xfeff('0x12a'),_0xfeff('0x12b')],'where':{'ContactId':_0x3dcb9f['params']['id']},'include':[{'model':db[_0xfeff('0x48')],'as':_0xfeff('0x48'),'attributes':['id',_0xfeff('0x1a'),'fullname',_0xfeff('0x8b')]}],'order':[['createdAt',_0xfeff('0x12c')]]};if(_0x3dcb9f[_0xfeff('0x2a')][_0xfeff('0x11b')]){_0x3e94a8[_0xfeff('0x56')][_0xfeff('0x127')]={'$gte':_0x1a8243['from'],'$lte':_0x1a8243['to']};}return db[_0xfeff('0xaa')][_0xfeff('0x12d')](_0x3e94a8)[_0xfeff('0x1f')](function(_0x3bd833){_0x342767[_0xfeff('0x76')]+=_0x3bd833[_0xfeff('0x76')];return _[_0xfeff('0x46')](_0x3bd833[_0xfeff('0x84')],function(_0x238975){var _0x5e47f3=_0x238975[_0xfeff('0x90')]({'plain':!![]});_0x5e47f3[_0xfeff('0x117')]=_0x5544ab;if(_0x5e47f3['User']){_0x5e47f3[_0xfeff('0x48')]={'id':_0x5e47f3[_0xfeff('0x48')]['id'],'name':_0x5e47f3['User'][_0xfeff('0x1a')],'fullname':_0x5e47f3['User'][_0xfeff('0x12e')],'alias':_0x5e47f3[_0xfeff('0x48')][_0xfeff('0x8b')]};}return _0x5e47f3;});});}else{var _0x114faa=_[_0xfeff('0x12f')](_0x5544ab)+(_0x5544ab==='chat'?'Website':_0xfeff('0x130'));var _0x543da0={'attributes':['id',_0xfeff('0x131'),_0xfeff('0x132'),_0xfeff('0x127'),_0xfeff('0x133'),_0xfeff('0x134'),_0xfeff('0x135'),_0xfeff('0x136'),_0xfeff('0x12b'),_0x114faa+'Id'],'where':{'ContactId':_0x3dcb9f[_0xfeff('0x86')]['id']},'include':[{'model':db[_0x114faa],'as':_0xfeff('0x130'),'attributes':['id',_0xfeff('0x1a'),'key']},{'model':db[_0xfeff('0x48')],'as':_0xfeff('0x137'),'attributes':['id','name','fullname']},{'model':db[_0xfeff('0x44')],'as':'Tags','attributes':['id','name',_0xfeff('0x35')],'through':{'attributes':[]}}],'order':[[_0xfeff('0x127'),_0xfeff('0x12c')]]};if(_0x3dcb9f['query'][_0xfeff('0x11b')]){_0x543da0[_0xfeff('0x56')][_0xfeff('0x127')]={'$gte':_0x1a8243[_0xfeff('0x36')],'$lte':_0x1a8243['to']};}switch(_0x5544ab){case _0xfeff('0x111'):_0x543da0[_0xfeff('0x2d')][_0xfeff('0x53')]('browserName','customerIp',_0xfeff('0x138'),_0xfeff('0x139'),_0xfeff('0x13a'),_0xfeff('0x13b'),_0xfeff('0x13c'),'ratingValue',_0xfeff('0x13d'));break;case'mail':_0x543da0[_0xfeff('0x2d')][_0xfeff('0x53')](_0xfeff('0x13e'),'substatus');break;case _0xfeff('0x113'):_0x543da0[_0xfeff('0x2d')][_0xfeff('0x53')]('externalUrl',_0xfeff('0x13f'));break;}return db[_[_0xfeff('0x12f')](_0x5544ab)+_0xfeff('0x140')]['findAndCountAll'](_0x543da0)[_0xfeff('0x1f')](function(_0x12f4ff){_0x342767['count']+=_0x12f4ff['count'];return _[_0xfeff('0x46')](_0x12f4ff[_0xfeff('0x84')],function(_0x56af16){var _0x76eda8=_0x56af16[_0xfeff('0x90')]({'plain':!![]});_0x76eda8[_0xfeff('0x117')]=_0x5544ab;if(_0x76eda8['Owner']){_0x76eda8[_0xfeff('0x137')]={'id':_0x76eda8[_0xfeff('0x137')]['id'],'name':_0x76eda8['Owner'][_0xfeff('0x1a')],'fullname':_0x76eda8[_0xfeff('0x137')][_0xfeff('0x12e')]};}return _0x76eda8;});});}});return Promise[_0xfeff('0x26')](_0x33dabd);})['then'](function(_0x1d7d76){return _(_0x1d7d76)[_0xfeff('0x141')]()[_0xfeff('0x142')]('createdAt')[_0xfeff('0x143')]()[_0xfeff('0x4a')]();})[_0xfeff('0x1f')](function(_0x333b0a){_0x342767['rows']=_0x373dfe['limit']?_0x333b0a['slice'](_0x373dfe[_0xfeff('0x11')],_0x373dfe['offset']+_0x373dfe[_0xfeff('0x13')]):_0x333b0a;return _0x342767;})[_0xfeff('0x1f')](respondWithFilteredResult(_0x268572,_0x373dfe))[_0xfeff('0x85')](handleError(_0x268572,null));};
\ No newline at end of file
+var _0x6b1e=['having','t.id\x20IN\x20?','resolve','role','agent','some','user','getLists','c.ListId\x20IS\x20NULL','map','ListId','sequelize','toString','keyBy','merge','c.firstName','c.lastName','c.phone','c.mobile','c.ListId','c.createdAt','c.deletedAt','c.CompanyId','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','Tags','catch','find','params','tags','columnName','displayName','analytics','CmCustomField','findAll','custom','body','get','mergeWith','isArray','info','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsMessage','FaxMessage','OpenchannelInteraction','CmContactHasItem','CmHopperFinal','CmHopperHistory','FaxQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','WhatsappInteraction','WhatsappQueueReport','isNil','dialTimezone','timezones','utcOffset','additionalPhones','bulkCreate','duplicates','$or','findOrCreate','contact','Tag','Phones','ContactItemType','ItemType','literal','Phones.OrderBy','$and','format','cf_%d','omit','pickBy','table','values','phone','CmHopper','getTags','findOne','rawAttributes','options','setTags','ids','setAdditionalPhones','items','item_types','ItemTypeId','description','CmHopperAdditionalPhone','item','OrderBy','PHONE','`ItemType`.OrderBy','ItemType.OrderBy','getAdditionalPhones','fromContactId','toContactId','rescheduleAdditionalPhones','intersection','includeAll','rows','getHopperHistories','ContactId','include','getHopperFinals','getJscriptySessions','JscriptySessionReport','uploadCsv','No\x20ListId\x20specified','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','binding_keys','Incorrect\x20binding\x20parameters\x20passed!','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','join','root','server/files/tmp','filename','chmodSync','0777','fork','File\x20uploaded\x20correctly!','upload','file','parse','meta','import','User','binding','child_process','../../components/import/cm/csv2','stringify','message','pid','exit','importUpdates','start\x20child\x20process\x20correctly!','error\x20child\x20process','getJourney','mail','openchannel','fax','channel','includes','toLowerCase','Invalid\x20channel','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','voice','uniqueid','destination','starttime','endtime','userDisposition','userSecondDisposition','userThirdDisposition','fullname','alias','createdAt','VoiceCallReport','findAndCountAll','startCase','chat','Website','Account','closedAt','note','thirdDisposition','key','Owner','browserName','customerIp','customerPort','deviceModel','ratingMessage','ratingType','ratingValue','referer','subject','threadId','sortBy','util','path','lodash','squel','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/environment/shared','defaults','redis','localhost','./cmContact.socket','register','status','json','offset','undefined','limit','count','Content-Range','update','destroy','then','end','sendStatus','error','name','send','CmContact','describe','keys','length','startsWith','cf_','all','fieldType','type','model','query','filters','attributes','fields','hasOwnProperty','nolimit','sort','pick','field','color','from','select','cm_contacts','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20c.id','ct.CmContactId\x20=\x20c.id','tools_tags','t.id\x20=\x20ct.TagId','where','search','parseSearch','sqlOperator','conditions','value','split','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','and','uc.UserId\x20=\x20?','dateOfBirth','datetime','castTo','DATE','text','filter','Contact','push','isEmpty','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','tag','replace','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','isNumeric','c.mobile\x20LIKE\x20?','isEmail','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','c.email\x20LIKE\x20?','c.id','Sequelize','QueryTypes','SELECT','order','forEach','DESC'];(function(_0x1da527,_0x2dc953){var _0x40fc7c=function(_0x9949f5){while(--_0x9949f5){_0x1da527['push'](_0x1da527['shift']());}};_0x40fc7c(++_0x2dc953);}(_0x6b1e,0xc6));var _0xe6b1=function(_0x497f4a,_0x92ae85){_0x497f4a=_0x497f4a-0x0;var _0x194c59=_0x6b1e[_0x497f4a];return _0x194c59;};'use strict';var moment=require('moment');var BPromise=require('bluebird');var util=require(_0xe6b1('0x0'));var path=require(_0xe6b1('0x1'));var fs=require('fs');var _=require(_0xe6b1('0x2'));var squel=require(_0xe6b1('0x3'));var Papa=require(_0xe6b1('0x4'));var Redis=require('ioredis');var qs=require(_0xe6b1('0x5'));var as=require(_0xe6b1('0x6'));var logger=require(_0xe6b1('0x7'))('api');var config=require(_0xe6b1('0x8'));var shared=require(_0xe6b1('0x9'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xe6b1('0xa')](config[_0xe6b1('0xb')],{'host':_0xe6b1('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xe6b1('0xd'))[_0xe6b1('0xe')](socket);function respondWithResult(_0x40533d,_0x4a27d0){_0x4a27d0=_0x4a27d0||0xc8;return function(_0x9ae990){if(_0x9ae990){return _0x40533d[_0xe6b1('0xf')](_0x4a27d0)[_0xe6b1('0x10')](_0x9ae990);}};}function respondWithFilteredResult(_0x1522f2,_0x212335){return function(_0x3083a1){if(_0x3083a1){var _0x5ca68a=typeof _0x212335[_0xe6b1('0x11')]===_0xe6b1('0x12')&&typeof _0x212335[_0xe6b1('0x13')]===_0xe6b1('0x12');var _0x2c6211=_0x3083a1[_0xe6b1('0x14')];var _0x1acbf8=_0x5ca68a?0x0:_0x212335[_0xe6b1('0x11')];var _0x2c92a0=_0x5ca68a?_0x3083a1[_0xe6b1('0x14')]:_0x212335['offset']+_0x212335[_0xe6b1('0x13')];var _0x36161e;if(_0x2c92a0>=_0x2c6211){_0x2c92a0=_0x2c6211;_0x36161e=0xc8;}else{_0x36161e=0xce;}_0x1522f2[_0xe6b1('0xf')](_0x36161e);return _0x1522f2['set'](_0xe6b1('0x15'),_0x1acbf8+'-'+_0x2c92a0+'/'+_0x2c6211)[_0xe6b1('0x10')](_0x3083a1);}return null;};}function saveUpdates(_0x3d1a31){return function(_0x4e1817){if(_0x4e1817){return _0x4e1817[_0xe6b1('0x16')](_0x3d1a31)['then'](function(_0x4f05ca){return _0x4f05ca;});}return null;};}function removeEntity(_0x46c419){return function(_0x3a1f33){if(_0x3a1f33){return _0x3a1f33[_0xe6b1('0x17')]()[_0xe6b1('0x18')](function(){_0x46c419[_0xe6b1('0xf')](0xcc)[_0xe6b1('0x19')]();});}};}function handleEntityNotFound(_0x2f9f66){return function(_0x3bcde5){if(!_0x3bcde5){_0x2f9f66[_0xe6b1('0x1a')](0x194);}return _0x3bcde5;};}function handleError(_0x327d36,_0x2a4ab4){_0x2a4ab4=_0x2a4ab4||0x1f4;return function(_0x43dd10){logger[_0xe6b1('0x1b')](_0x43dd10['stack']);if(_0x43dd10[_0xe6b1('0x1c')]){delete _0x43dd10[_0xe6b1('0x1c')];}_0x327d36['status'](_0x2a4ab4)[_0xe6b1('0x1d')](_0x43dd10);};}exports['index']=function(_0x2b7920,_0x53aaeb){var _0x47c5c7={},_0x5c0f96={},_0x322026={'count':0x0,'rows':[]};return db[_0xe6b1('0x1e')][_0xe6b1('0x1f')]()[_0xe6b1('0x18')](function(_0x1d43f2){var _0x3f9d6d=[];for(var _0x365341=0x0;_0x365341<Object[_0xe6b1('0x20')](_0x1d43f2)[_0xe6b1('0x21')];_0x365341++){var _0x28f09c=Object[_0xe6b1('0x20')](_0x1d43f2)[_0x365341];if(_[_0xe6b1('0x22')](_0x28f09c,_0xe6b1('0x23'))){_0x3f9d6d['push'](db['CmCustomField']['findOne']({'where':{'id':_['trimStart'](_0x28f09c,_0xe6b1('0x23'))},'raw':!![]}));}}return BPromise[_0xe6b1('0x24')](_0x3f9d6d)[_0xe6b1('0x18')](function(_0x3821fe){for(var _0x53dc7d=0x0;_0x53dc7d<_0x3821fe[_0xe6b1('0x21')];_0x53dc7d++){if(_0x3821fe[_0x53dc7d]){var _0x279b4b=_0xe6b1('0x23')+_0x3821fe[_0x53dc7d]['id'];var _0x1ec83d=_0x1d43f2[_0x279b4b];_0x1ec83d[_0xe6b1('0x25')]=_0x3821fe[_0x53dc7d][_0xe6b1('0x26')];}}return _0x1d43f2;});})[_0xe6b1('0x18')](function(_0x3bfad7){_0x5c0f96[_0xe6b1('0x27')]=_[_0xe6b1('0x20')](_0x3bfad7);_0x5c0f96[_0xe6b1('0x28')]=_[_0xe6b1('0x20')](_0x2b7920[_0xe6b1('0x28')]);_0x5c0f96[_0xe6b1('0x29')]=_['intersection'](_0x5c0f96['model'],_0x5c0f96['query']);_0x47c5c7[_0xe6b1('0x2a')]=_['intersection'](_0x5c0f96[_0xe6b1('0x27')],qs['fields'](_0x2b7920['query'][_0xe6b1('0x2b')]));_0x47c5c7[_0xe6b1('0x2a')]=_0x47c5c7[_0xe6b1('0x2a')][_0xe6b1('0x21')]?_0x47c5c7[_0xe6b1('0x2a')]:_0x5c0f96[_0xe6b1('0x27')];if(!_0x2b7920[_0xe6b1('0x28')][_0xe6b1('0x2c')](_0xe6b1('0x2d'))){_0x47c5c7[_0xe6b1('0x13')]=qs[_0xe6b1('0x13')](_0x2b7920['query'][_0xe6b1('0x13')]);_0x47c5c7[_0xe6b1('0x11')]=qs[_0xe6b1('0x11')](_0x2b7920[_0xe6b1('0x28')][_0xe6b1('0x11')]);}_0x47c5c7['order']=qs[_0xe6b1('0x2e')](_0x2b7920[_0xe6b1('0x28')][_0xe6b1('0x2e')]);_0x47c5c7['where']=qs[_0xe6b1('0x29')](_[_0xe6b1('0x2f')](_0x2b7920[_0xe6b1('0x28')],_0x5c0f96[_0xe6b1('0x29')]),_0x3bfad7);var _0x154df0=[];var _0x2e23ab=squel['select']()[_0xe6b1('0x30')]('id')['field']('name')[_0xe6b1('0x30')](_0xe6b1('0x31'))[_0xe6b1('0x32')]('tools_tags');var _0x1c58d2=squel[_0xe6b1('0x33')]()[_0xe6b1('0x32')](_0xe6b1('0x34'),'c')[_0xe6b1('0x35')](_0xe6b1('0x36'),'uc',_0xe6b1('0x37'))[_0xe6b1('0x35')]('cm_contact_has_tags','ct',_0xe6b1('0x38'))[_0xe6b1('0x35')](_0xe6b1('0x39'),'t',_0xe6b1('0x3a'))[_0xe6b1('0x3b')]('c.deletedAt\x20IS\x20NULL');var _0x30d5f9=squel['expr']();var _0x148e85=[];var _0x29f12a=squel['expr']();var _0x5cefb7;if(_0x2b7920[_0xe6b1('0x28')][_0xe6b1('0x3c')]){_0x5cefb7=as[_0xe6b1('0x3d')](_0x2b7920['query'][_0xe6b1('0x3c')]);var _0x553678=_0x5cefb7[_0xe6b1('0x3e')];for(var _0x13062f=0x0;_0x13062f<_0x5cefb7['conditions'][_0xe6b1('0x21')];_0x13062f++){var _0x5af571=_0x5cefb7[_0xe6b1('0x3f')][_0x13062f];var _0x46fa1a='c';var _0xe917a3=_(_0x3bfad7)['keys']()['find'](function(_0x19e53f){return _0x19e53f===_0x5af571[_0xe6b1('0x30')];});if(_0xe917a3)_0xe917a3=_0x3bfad7[_0x5af571[_0xe6b1('0x30')]];if(!_0xe917a3){if(_0x5af571[_0xe6b1('0x30')]==='Tag'){var _0x29a49d=_0x5af571[_0xe6b1('0x40')][_0xe6b1('0x41')](',')['map'](function(_0x302a3e){return Number(_0x302a3e);});_0x29a49d['forEach'](function(_0x178f42){_0x29f12a['or'](_0xe6b1('0x42'),'%,'+_0x178f42+',%');});_0x148e85=_['union'](_0x148e85,_0x29a49d);}else if(_0x5af571[_0xe6b1('0x30')]==='User'){_0x30d5f9[_0xe6b1('0x43')](_0xe6b1('0x44'),_0x5af571[_0xe6b1('0x40')]);}}else{if(_0x5af571[_0xe6b1('0x30')]===_0xe6b1('0x45')||_0xe917a3[_0xe6b1('0x25')]===_0xe6b1('0x46'))_0x5af571[_0xe6b1('0x47')]=_0xe6b1('0x48');var _0x18e9ee=as['buildExpression'](_0x46fa1a,_0xe917a3[_0xe6b1('0x26')],_0x5af571);_0x30d5f9[_0x553678](_0x18e9ee[_0xe6b1('0x49')],_0x18e9ee['value']['start'],_0x18e9ee[_0xe6b1('0x40')][_0xe6b1('0x19')]);}}}else{var _0x5af766=_(Object['keys'](_0x2b7920[_0xe6b1('0x28')]))['map'](function(_0x2dbc30){return _0x3bfad7[_0xe6b1('0x2c')](_0x2dbc30)?_0x2dbc30:undefined;})[_0xe6b1('0x4a')](function(_0x2c34a8){return!_['isNil'](_0x2c34a8);})[_0xe6b1('0x40')]();if(_0x2b7920[_0xe6b1('0x28')][_0xe6b1('0x4b')])_0x5af766[_0xe6b1('0x4c')]('Contact');if(!_[_0xe6b1('0x4d')](_0x5af766)){_0x5af766['forEach'](function(_0x2373eb){if(_0x2373eb==='ListId'){_0x1c58d2['where'](_0xe6b1('0x4e'),[][_0xe6b1('0x4f')](_0x2b7920['query'][_0x2373eb]));}else if(_0x2373eb===_0xe6b1('0x4b')){var _0x282494='%'+_0x2b7920[_0xe6b1('0x28')][_0x2373eb]+'%';_0x1c58d2[_0xe6b1('0x3b')](_0xe6b1('0x50'),_0x282494);}else{_0x1c58d2[_0xe6b1('0x3b')]('c.'+_0x2373eb+_0xe6b1('0x51'),_0x2b7920[_0xe6b1('0x28')][_0x2373eb]);}});}if(_0x2b7920[_0xe6b1('0x28')][_0xe6b1('0x52')]){_0x148e85=_['isArray'](_0x2b7920[_0xe6b1('0x28')][_0xe6b1('0x52')])?_0x2b7920[_0xe6b1('0x28')][_0xe6b1('0x52')]:new Array(_0x2b7920['query'][_0xe6b1('0x52')]);_0x148e85['forEach'](function(_0x2fa3fa){_0x29f12a['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x2fa3fa+',%');});}if(_0x2b7920[_0xe6b1('0x28')][_0xe6b1('0x4a')]){var _0x41c92e=_0x2b7920['query'][_0xe6b1('0x4a')]['replace']('\x5c','\x5c\x5c')[_0xe6b1('0x53')](/'/g,'\x27\x27');if(_0x41c92e['split']('\x20')[_0xe6b1('0x21')]>0x1){_0x30d5f9['or'](_0xe6b1('0x54'),qs[_0xe6b1('0x55')](_0x41c92e),null);}else{if(qs[_0xe6b1('0x56')](_0x41c92e)){_0x30d5f9['or']('c.id\x20LIKE\x20?',_0x41c92e+'%');_0x30d5f9['or']('c.phone\x20LIKE\x20?',_0x41c92e+'%');_0x30d5f9['or'](_0xe6b1('0x57'),_0x41c92e+'%');_0x30d5f9['or']('c.fax\x20LIKE\x20?',_0x41c92e+'%');}else if(qs[_0xe6b1('0x58')](_0x41c92e)){_0x30d5f9['or']('c.email\x20LIKE\x20?',_0x41c92e+'%');}else{_0x30d5f9['or'](_0xe6b1('0x59'),'%'+_0x41c92e+'%');_0x30d5f9['or'](_0xe6b1('0x5a'),'%'+_0x41c92e+'%');_0x30d5f9['or'](_0xe6b1('0x5b'),'%'+_0x41c92e+'%');}}}}_0x1c58d2['where'](_0x30d5f9);_0x1c58d2['group'](_0xe6b1('0x5c'));var _0x4d5082={'type':db[_0xe6b1('0x5d')][_0xe6b1('0x5e')][_0xe6b1('0x5f')],'raw':!![]};var _0x478944=_0x1c58d2['clone']()['field'](_0xe6b1('0x5c'));if(_0x47c5c7['order']){_0x47c5c7[_0xe6b1('0x60')][_0xe6b1('0x61')](function(_0x2e7076){_0x1c58d2[_0xe6b1('0x60')]('c.'+_0x2e7076[0x0],_0x2e7076[0x1]===_0xe6b1('0x62')?![]:!![]);});}if(!_[_0xe6b1('0x4d')](_0x148e85)){_0x1c58d2[_0xe6b1('0x63')](_0x29f12a);_0x478944[_0xe6b1('0x3b')](_0xe6b1('0x64'),_0x148e85);}BPromise[_0xe6b1('0x65')]()[_0xe6b1('0x18')](function(){if(!_0x5cefb7)return;if(_0x2b7920['user'][_0xe6b1('0x66')]!==_0xe6b1('0x67'))return;if(!_[_0xe6b1('0x68')](_0x5cefb7[_0xe6b1('0x3f')],['field','User'])){return _0x2b7920[_0xe6b1('0x69')][_0xe6b1('0x6a')]({'attributes':['id'],'raw':!![]})['then'](function(_0x35e31c){if(_[_0xe6b1('0x4d')](_0x35e31c)){_0x478944['where'](_0xe6b1('0x6b'));_0x1c58d2[_0xe6b1('0x3b')](_0xe6b1('0x6b'));}else{_0x478944[_0xe6b1('0x3b')](_0xe6b1('0x4e'),_[_0xe6b1('0x6c')](_0x35e31c,'id'));_0x1c58d2[_0xe6b1('0x3b')]('c.ListId\x20IN\x20?',_[_0xe6b1('0x6c')](_0x35e31c,'id'));}});}})[_0xe6b1('0x18')](function(){if(_0x2b7920[_0xe6b1('0x69')][_0xe6b1('0x66')]===_0xe6b1('0x67')&&!_0x5cefb7&&!_0x2b7920[_0xe6b1('0x28')][_0xe6b1('0x6d')])return[];return db[_0xe6b1('0x6e')][_0xe6b1('0x28')](_0x478944[_0xe6b1('0x6f')](),_0x4d5082);})['then'](function(_0x20334e){_0x322026[_0xe6b1('0x14')]=_0x20334e[_0xe6b1('0x21')];if(_0x322026[_0xe6b1('0x14')]===0x0)return[];return db[_0xe6b1('0x6e')][_0xe6b1('0x28')](_0x2e23ab['toString'](),_0x4d5082)[_0xe6b1('0x18')](function(_0xe7a5c8){_0x154df0=_[_0xe6b1('0x70')](_0xe7a5c8,'id');_0x4d5082=_[_0xe6b1('0x71')](_0x4d5082,{'model':db[_0xe6b1('0x1e')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2b7920[_0xe6b1('0x28')][_0xe6b1('0x2b')]){_0x47c5c7[_0xe6b1('0x2a')][_0xe6b1('0x61')](function(_0xe62bc6){_0x1c58d2[_0xe6b1('0x30')]('c.'+_0xe62bc6);});}else{_0x1c58d2[_0xe6b1('0x30')](_0xe6b1('0x5c'));_0x1c58d2[_0xe6b1('0x30')](_0xe6b1('0x72'));_0x1c58d2['field'](_0xe6b1('0x73'));_0x1c58d2[_0xe6b1('0x30')](_0xe6b1('0x74'));_0x1c58d2[_0xe6b1('0x30')](_0xe6b1('0x75'));_0x1c58d2['field']('c.fax');_0x1c58d2[_0xe6b1('0x30')]('c.email');_0x1c58d2[_0xe6b1('0x30')](_0xe6b1('0x76'));_0x1c58d2[_0xe6b1('0x30')](_0xe6b1('0x77'));_0x1c58d2[_0xe6b1('0x30')](_0xe6b1('0x78'));_0x1c58d2['field'](_0xe6b1('0x79'));_0x1c58d2[_0xe6b1('0x30')](_0xe6b1('0x7a'),'TagIds');}if(_0x47c5c7['limit'])_0x1c58d2[_0xe6b1('0x13')](_0x47c5c7[_0xe6b1('0x13')]);if(_0x47c5c7[_0xe6b1('0x11')])_0x1c58d2[_0xe6b1('0x11')](_0x47c5c7[_0xe6b1('0x11')]);return db[_0xe6b1('0x6e')]['query'](_0x1c58d2[_0xe6b1('0x6f')](),_0x4d5082);});})[_0xe6b1('0x18')](function(_0x2ec84c){_0x2ec84c[_0xe6b1('0x61')](function(_0x2d5271){if(_0x2d5271[_0xe6b1('0x7b')]){_0x2d5271[_0xe6b1('0x7c')]=[];_0x2d5271[_0xe6b1('0x7b')][_0xe6b1('0x41')](',')[_0xe6b1('0x61')](function(_0x5b6f59){_0x2d5271[_0xe6b1('0x7c')][_0xe6b1('0x4c')](_0x154df0[_0x5b6f59]);});}delete _0x2d5271['TagIds'];});_0x322026['rows']=_0x2ec84c;return _0x322026;})[_0xe6b1('0x18')](respondWithFilteredResult(_0x53aaeb,_0x47c5c7));})[_0xe6b1('0x7d')](handleError(_0x53aaeb,null));};exports['destroy']=function(_0x13aa6c,_0xcd72a4){return db[_0xe6b1('0x1e')][_0xe6b1('0x7e')]({'where':{'id':_0x13aa6c[_0xe6b1('0x7f')]['id']}})[_0xe6b1('0x18')](handleEntityNotFound(_0xcd72a4,null))['then'](removeEntity(_0xcd72a4,null))[_0xe6b1('0x7d')](handleError(_0xcd72a4,null));};exports['describe']=function(_0xc7a573,_0x2fbf94){return db[_0xe6b1('0x1e')][_0xe6b1('0x1f')]()[_0xe6b1('0x18')](function(_0x3a5662){delete _0x3a5662[_0xe6b1('0x80')];for(var _0x17d488=0x0;_0x17d488<Object['keys'](_0x3a5662)['length'];_0x17d488++){var _0x1dc002=Object[_0xe6b1('0x20')](_0x3a5662)[_0x17d488];if(!_[_0xe6b1('0x22')](_0x1dc002,_0xe6b1('0x23'))){_0x3a5662[_0x1dc002][_0xe6b1('0x81')]=_0x1dc002;_0x3a5662[_0x1dc002][_0xe6b1('0x82')]=_0x1dc002;}}return _0x3a5662;})['then'](function(_0x11e05c){var _0x14c0ee={'where':Boolean(_0xc7a573[_0xe6b1('0x28')][_0xe6b1('0x83')])===!![]?undefined:{'$or':[{'ListId':_0xc7a573['query']['id']},{'ListId':null}]},'raw':!![]};return db[_0xe6b1('0x84')][_0xe6b1('0x85')](_0x14c0ee)[_0xe6b1('0x18')](function(_0x1752a1){for(var _0x2b559b=0x0;_0x2b559b<_0x1752a1[_0xe6b1('0x21')];_0x2b559b++){var _0x1931e2=_0xe6b1('0x23')+_0x1752a1[_0x2b559b]['id'];_0x11e05c[_0x1931e2][_0xe6b1('0x81')]=_0x1931e2;_0x11e05c[_0x1931e2]['displayName']=_0x1752a1[_0x2b559b]['alias'];_0x11e05c[_0x1931e2][_0xe6b1('0x86')]={'type':_0x1752a1[_0x2b559b][_0xe6b1('0x26')],'values':_0x1752a1[_0x2b559b]['values']};}Object['keys'](_0x11e05c)[_0xe6b1('0x61')](function(_0x18753d){if(!_0x11e05c[_0x18753d][_0xe6b1('0x2c')](_0xe6b1('0x81'))){delete _0x11e05c[_0x18753d];}});return _0x11e05c;});})[_0xe6b1('0x18')](respondWithResult(_0x2fbf94,null))[_0xe6b1('0x7d')](handleError(_0x2fbf94,null));};exports[_0xe6b1('0x71')]=function(_0x46593c,_0x36b887){var _0x34c1e1;var _0x33eab6;var _0x52ba05;if(_0x46593c[_0xe6b1('0x87')]['id']){delete _0x46593c[_0xe6b1('0x87')]['id'];}return db[_0xe6b1('0x1e')]['findAll']({'where':{'id':[_0x46593c[_0xe6b1('0x87')]['to'],_0x46593c[_0xe6b1('0x87')][_0xe6b1('0x32')]]}})[_0xe6b1('0x18')](function(_0x5e6809){if(_0x5e6809){if(_0x5e6809[_0xe6b1('0x21')]!==0x2){return null;}_0x5e6809[0x0]=_0x5e6809[0x0]['get']({'plain':!![]});_0x5e6809[0x1]=_0x5e6809[0x1][_0xe6b1('0x88')]({'plain':!![]});delete _0x5e6809[0x0]['id'];delete _0x5e6809[0x1]['id'];return _[_0xe6b1('0x89')](_0x5e6809[0x0],_0x5e6809[0x1],function(_0x3658ac,_0x12b665){if(Array[_0xe6b1('0x8a')](_0x12b665)&&!_0x12b665[_0xe6b1('0x21')]){return _0x3658ac;}else if(!_0x12b665){return _0x3658ac;}});}})['then'](handleEntityNotFound(_0x36b887,null))['then'](function(_0x4b1c9a){if(_0x4b1c9a){if(_0x4b1c9a[_0xe6b1('0x80')]&&_[_0xe6b1('0x8a')](_0x4b1c9a[_0xe6b1('0x80')])){_0x4b1c9a[_0xe6b1('0x80')]=_0x4b1c9a[_0xe6b1('0x80')]['join']();}logger[_0xe6b1('0x8b')]('[CmContact][merge]\x20to\x20%s\x20from\x20%s',_0x46593c[_0xe6b1('0x87')]['to'],_0x46593c['body'][_0xe6b1('0x32')]);return db['CmHopper']['destroy']({'where':{'ContactId':[_0x46593c[_0xe6b1('0x87')]['to'],_0x46593c[_0xe6b1('0x87')]['from']]}})[_0xe6b1('0x18')](function(_0x8ee5dd){logger[_0xe6b1('0x8b')]('[CmContact][merge][destroy][CmHopper],\x20%s',_0x8ee5dd);return db[_0xe6b1('0x8c')][_0xe6b1('0x17')]({'where':{'ContactId':[_0x46593c[_0xe6b1('0x87')]['to'],_0x46593c[_0xe6b1('0x87')][_0xe6b1('0x32')]]}})[_0xe6b1('0x18')](function(_0x4e02bc){logger[_0xe6b1('0x8b')](_0xe6b1('0x8d'),_0x4e02bc);return db[_0xe6b1('0x1e')][_0xe6b1('0x8e')](_0x4b1c9a);});});}})[_0xe6b1('0x18')](function(_0x361250){if(_0x361250){_0x34c1e1=_0x361250;_0x33eab6={'ContactId':_0x34c1e1['id']};_0x52ba05={'where':{'ContactId':[_0x46593c[_0xe6b1('0x87')]['to'],_0x46593c[_0xe6b1('0x87')][_0xe6b1('0x32')]]}};return db[_0xe6b1('0x8f')][_0xe6b1('0x16')](_0x33eab6,_0x52ba05);}})[_0xe6b1('0x18')](function(){if(_0x34c1e1){return db[_0xe6b1('0x90')][_0xe6b1('0x16')](_0x33eab6,_0x52ba05);}})[_0xe6b1('0x18')](function(){if(_0x34c1e1){return db[_0xe6b1('0x91')][_0xe6b1('0x16')](_0x33eab6,_0x52ba05);}})['then'](function(){if(_0x34c1e1){return db[_0xe6b1('0x92')][_0xe6b1('0x16')](_0x33eab6,_0x52ba05);}})[_0xe6b1('0x18')](function(){if(_0x34c1e1){return db[_0xe6b1('0x93')][_0xe6b1('0x16')](_0x33eab6,_0x52ba05);}})[_0xe6b1('0x18')](function(){if(_0x34c1e1){return db['MailInteraction']['update'](_0x33eab6,_0x52ba05);}})[_0xe6b1('0x18')](function(){if(_0x34c1e1){return db['MailMessage'][_0xe6b1('0x16')](_0x33eab6,_0x52ba05);}})[_0xe6b1('0x18')](function(){if(_0x34c1e1){return db['SmsInteraction'][_0xe6b1('0x16')](_0x33eab6,_0x52ba05);}})[_0xe6b1('0x18')](function(){if(_0x34c1e1){return db[_0xe6b1('0x94')][_0xe6b1('0x16')](_0x33eab6,_0x52ba05);}})[_0xe6b1('0x18')](function(){if(_0x34c1e1){return db['FaxInteraction']['update'](_0x33eab6,_0x52ba05);}})[_0xe6b1('0x18')](function(){if(_0x34c1e1){return db[_0xe6b1('0x95')][_0xe6b1('0x16')](_0x33eab6,_0x52ba05);}})[_0xe6b1('0x18')](function(){if(_0x34c1e1){return db[_0xe6b1('0x96')][_0xe6b1('0x16')](_0x33eab6,_0x52ba05);}})[_0xe6b1('0x18')](function(){if(_0x34c1e1){return db['OpenchannelMessage'][_0xe6b1('0x16')](_0x33eab6,_0x52ba05);}})[_0xe6b1('0x18')](function(){if(_0x34c1e1){return db[_0xe6b1('0x97')]['update']({'CmContactId':_0x34c1e1['id']},{'where':{'CmContactId':[_0x46593c[_0xe6b1('0x87')]['to'],_0x46593c[_0xe6b1('0x87')][_0xe6b1('0x32')]]}});}})[_0xe6b1('0x18')](function(){if(_0x34c1e1){return db[_0xe6b1('0x98')][_0xe6b1('0x16')](_0x33eab6,_0x52ba05);}})[_0xe6b1('0x18')](function(){if(_0x34c1e1){return db[_0xe6b1('0x99')][_0xe6b1('0x16')](_0x33eab6,_0x52ba05);}})[_0xe6b1('0x18')](function(){if(_0x34c1e1){return db['ReportAgentPreview']['update'](_0x33eab6,_0x52ba05);}})[_0xe6b1('0x18')](function(){if(_0x34c1e1){return db['VoiceCallReport'][_0xe6b1('0x16')](_0x33eab6,_0x52ba05);}})[_0xe6b1('0x18')](function(){if(_0x34c1e1){return db['ChatQueueReport'][_0xe6b1('0x16')](_0x33eab6,_0x52ba05);}})[_0xe6b1('0x18')](function(){if(_0x34c1e1){return db[_0xe6b1('0x9a')]['update'](_0x33eab6,_0x52ba05);}})[_0xe6b1('0x18')](function(){if(_0x34c1e1){return db[_0xe6b1('0x9b')][_0xe6b1('0x16')](_0x33eab6,_0x52ba05);}})[_0xe6b1('0x18')](function(){if(_0x34c1e1){return db[_0xe6b1('0x9c')][_0xe6b1('0x16')](_0x33eab6,_0x52ba05);}})[_0xe6b1('0x18')](function(){if(_0x34c1e1){return db[_0xe6b1('0x9d')][_0xe6b1('0x16')](_0x33eab6,_0x52ba05);}})[_0xe6b1('0x18')](function(){if(_0x34c1e1){return db['JscriptySessionReport'][_0xe6b1('0x16')](_0x33eab6,_0x52ba05);}})[_0xe6b1('0x18')](function(){if(_0x34c1e1){return db[_0xe6b1('0x9e')][_0xe6b1('0x16')](_0x33eab6,_0x52ba05);}})[_0xe6b1('0x18')](function(){if(_0x34c1e1){return db['WhatsappMessage'][_0xe6b1('0x16')](_0x33eab6,_0x52ba05);}})[_0xe6b1('0x18')](function(){if(_0x34c1e1){return db[_0xe6b1('0x9f')]['update'](_0x33eab6,_0x52ba05);}})['then'](function(){if(_0x34c1e1){return db[_0xe6b1('0x1e')][_0xe6b1('0x17')]({'where':{'id':[_0x46593c[_0xe6b1('0x87')]['to'],_0x46593c[_0xe6b1('0x87')][_0xe6b1('0x32')]]}});}})[_0xe6b1('0x18')](function(){if(_0x34c1e1){return _0x34c1e1;}})[_0xe6b1('0x18')](respondWithResult(_0x36b887,null))[_0xe6b1('0x7d')](handleError(_0x36b887,null));};exports['create']=function(_0x1e55b6,_0x5ca2d0){return db[_0xe6b1('0x1e')]['describe']()[_0xe6b1('0x18')](function(_0x1ea66e){if(_0x1e55b6[_0xe6b1('0x87')][_0xe6b1('0x80')]&&_[_0xe6b1('0x8a')](_0x1e55b6[_0xe6b1('0x87')][_0xe6b1('0x80')])){if(_0x1e55b6['body'][_0xe6b1('0x80')]['length']){_0x1e55b6[_0xe6b1('0x87')]['tags']=_0x1e55b6[_0xe6b1('0x87')][_0xe6b1('0x80')]['join'](';')+';';}else{_0x1e55b6[_0xe6b1('0x87')][_0xe6b1('0x80')]=null;}}else{_0x1e55b6[_0xe6b1('0x87')][_0xe6b1('0x80')]=null;}if(!_[_0xe6b1('0xa0')](_0x1e55b6[_0xe6b1('0x87')]['dialTimezone'])){var _0x3a314b=_0x1e55b6[_0xe6b1('0x87')][_0xe6b1('0xa1')];if(!_[_0xe6b1('0xa0')](shared[_0xe6b1('0xa2')][_0x3a314b]))_0x1e55b6['body'][_0xe6b1('0xa3')]=shared[_0xe6b1('0xa2')][_0x3a314b][_0xe6b1('0xa3')];}return db[_0xe6b1('0x1e')][_0xe6b1('0x8e')](_0x1e55b6['body'],{'fields':_['keys'](_0x1ea66e),'raw':!![]});})[_0xe6b1('0x18')](function(_0x8c18bc){if(_0x1e55b6[_0xe6b1('0x87')][_0xe6b1('0xa4')]){return insertAdditionalPhones(_0x8c18bc,_0x1e55b6[_0xe6b1('0x87')][_0xe6b1('0xa4')]);}else{return _0x8c18bc;}})[_0xe6b1('0x18')](respondWithResult(_0x5ca2d0,0xc9))[_0xe6b1('0x7d')](handleError(_0x5ca2d0,null));};exports[_0xe6b1('0xa5')]=function(_0x268e3a,_0x35cb94){var _0x3b4fe4=0x0;var _0x3b1105=0x0;var _0x39f840=0x0;var _0x53d627=[];return db[_0xe6b1('0x1e')][_0xe6b1('0x1f')]()[_0xe6b1('0x18')](function(_0x27754d){return BPromise['each'](_0x268e3a[_0xe6b1('0x87')],function(_0x36e448){var _0x2713db={'where':{'$or':[]},'defaults':_0x36e448,'fields':_['keys'](_0x27754d),'raw':!![]};if(_0x36e448[_0xe6b1('0xa6')]){for(var _0x5375e5=0x0;_0x5375e5<_0x36e448[_0xe6b1('0xa6')]['length'];_0x5375e5++){var _0x495889={};_0x495889[_0x36e448[_0xe6b1('0xa6')][_0x5375e5]]=_0x36e448[_0x36e448[_0xe6b1('0xa6')][_0x5375e5]];_0x2713db[_0xe6b1('0x3b')][_0xe6b1('0xa7')]['push'](_0x495889);}_0x2713db['where']['ListId']=_0x36e448[_0xe6b1('0x6d')];}return db[_0xe6b1('0x1e')][_0xe6b1('0xa8')](_0x2713db)['spread'](function(_0x41c523,_0x46bb5f){if(_0x46bb5f){if(_0x36e448[_0xe6b1('0x2c')](_0xe6b1('0xa4'))){_0x53d627[_0xe6b1('0x4c')]({'contact':_0x41c523,'additionalPhones':_0x36e448['additionalPhones']});}_0x3b4fe4++;}else{_0x39f840++;}})[_0xe6b1('0x7d')](function(){_0x3b1105++;});});})[_0xe6b1('0x18')](function(_0x3c876f){if(_0x3c876f){if(_0x53d627[_0xe6b1('0x21')]>0x0){return new Promise(function(_0x4e9a36,_0x4b2fcb){var _0x5c3308=[];for(var _0x3f11d6=0x0;_0x3f11d6<_0x53d627['length'];_0x3f11d6++){_0x5c3308[_0xe6b1('0x4c')](insertAdditionalPhones(_0x53d627[_0x3f11d6][_0xe6b1('0xa9')],_0x53d627[_0x3f11d6]['additionalPhones']));}Promise[_0xe6b1('0x24')](_0x5c3308)[_0xe6b1('0x18')](function(){_0x4e9a36(0x1);});})[_0xe6b1('0x18')](function(){return{'success':_0x3b4fe4,'failure':_0x3b1105,'duplicates':_0x39f840};});}else{return{'success':_0x3b4fe4,'failure':_0x3b1105,'duplicates':_0x39f840};}}})[_0xe6b1('0x18')](respondWithResult(_0x35cb94,0xc9))[_0xe6b1('0x7d')](handleError(_0x35cb94,null));};exports['show']=function(_0x62562f,_0x30ac47){var _0x2a5893;return db[_0xe6b1('0x1e')]['describe']()[_0xe6b1('0x18')](function(_0x51791f){return db[_0xe6b1('0x1e')][_0xe6b1('0x7e')]({'where':{'id':_0x62562f['params']['id']},'include':[{'model':db[_0xe6b1('0xaa')],'as':_0xe6b1('0x7c'),'attributes':['id',_0xe6b1('0x1c'),_0xe6b1('0x31')],'required':_0x62562f['query'][_0xe6b1('0x52')]?!![]:![]},{'model':db[_0xe6b1('0x97')],'as':_0xe6b1('0xab'),'where':{'CmContactId':_0x62562f[_0xe6b1('0x7f')]['id']},'required':![],'include':[{'model':db[_0xe6b1('0xac')],'as':_0xe6b1('0xad')}]}],'order':[db[_0xe6b1('0x6e')][_0xe6b1('0xae')](_0xe6b1('0xaf'))],'attributes':_[_0xe6b1('0x20')](_0x51791f)});})[_0xe6b1('0x18')](function(_0xf0dc5b){if(!_[_0xe6b1('0xa0')](_0xf0dc5b)){_0x2a5893=_0xf0dc5b[_0xe6b1('0x88')]({'plain':!![]});var _0x42c17f={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0xf0dc5b&&_0xf0dc5b[_0xe6b1('0x6d')]){if(_0xf0dc5b['ListId']){_0x42c17f[_0xe6b1('0x3b')][_0xe6b1('0xb0')][_0xe6b1('0x4c')]({'ListId':{'$ne':_0xf0dc5b[_0xe6b1('0x6d')]}});}}return db[_0xe6b1('0x84')][_0xe6b1('0x85')](_0x42c17f);}})[_0xe6b1('0x18')](function(_0x174f3b){if(!_[_0xe6b1('0xa0')](_0x174f3b)){return _['omit'](_0x2a5893,_[_0xe6b1('0x6c')](_0x174f3b,function(_0x1eb123){return util[_0xe6b1('0xb1')](_0xe6b1('0xb2'),_0x1eb123['id']);}));}})[_0xe6b1('0x18')](handleEntityNotFound(_0x30ac47,null))[_0xe6b1('0x18')](respondWithResult(_0x30ac47,null))[_0xe6b1('0x7d')](handleError(_0x30ac47,null));};exports[_0xe6b1('0x16')]=function(_0x1a18cd,_0x4d72b1){var _0x107383;if(_0x1a18cd[_0xe6b1('0x87')]['id']){delete _0x1a18cd[_0xe6b1('0x87')]['id'];}if(!_[_0xe6b1('0xa0')](_0x1a18cd[_0xe6b1('0x87')][_0xe6b1('0xa1')])){var _0x415a48=_0x1a18cd[_0xe6b1('0x87')]['dialTimezone'];if(!_[_0xe6b1('0xa0')](shared[_0xe6b1('0xa2')][_0x415a48]))_0x1a18cd[_0xe6b1('0x87')][_0xe6b1('0xa3')]=shared[_0xe6b1('0xa2')][_0x415a48][_0xe6b1('0xa3')];}return db['CmContact']['find']({'where':{'id':_0x1a18cd[_0xe6b1('0x7f')]['id']}})[_0xe6b1('0x18')](handleEntityNotFound(_0x4d72b1,null))[_0xe6b1('0x18')](saveUpdates(_0x1a18cd['body'],null))[_0xe6b1('0x18')](function(_0x21ccc2){_0x107383=_0x21ccc2;var _0x4c4899={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x21ccc2&&_0x21ccc2[_0xe6b1('0x6d')]){if(_0x21ccc2[_0xe6b1('0x6d')]){_0x4c4899['where'][_0xe6b1('0xb0')][_0xe6b1('0x4c')]({'ListId':{'$ne':_0x21ccc2[_0xe6b1('0x6d')]}});}}return db[_0xe6b1('0x84')][_0xe6b1('0x85')](_0x4c4899);})['then'](function(_0x3f7999){if(_0x3f7999){return _[_0xe6b1('0xb3')](_[_0xe6b1('0xb4')](_0x1a18cd[_0xe6b1('0x87')],function(_0x57034d,_0x46b33d){return _[_0xe6b1('0x22')](_0x46b33d,_0xe6b1('0x23'));}),_[_0xe6b1('0x6c')](_0x3f7999,function(_0x3cd94f){return util[_0xe6b1('0xb1')]('cf_%d',_0x3cd94f['id']);}));}})[_0xe6b1('0x18')](function(_0x1ecb26){if(_0x1ecb26&&!_[_0xe6b1('0x4d')](_0x1ecb26)){var _0x5e9d63=squel[_0xe6b1('0x16')]()[_0xe6b1('0xb5')](_0xe6b1('0x34'))['setFields'](_0x1ecb26)[_0xe6b1('0x3b')]('id\x20=\x20?',_0x1a18cd[_0xe6b1('0x7f')]['id'])['toParam']();return db[_0xe6b1('0x6e')][_0xe6b1('0x28')](_0x5e9d63['text'],{'replacements':_0x5e9d63[_0xe6b1('0xb6')]});}})[_0xe6b1('0x18')](function(){if(_0x1a18cd[_0xe6b1('0x87')][_0xe6b1('0xb7')]&&_0x107383){return db[_0xe6b1('0xb8')][_0xe6b1('0x16')]({'phone':_0x1a18cd[_0xe6b1('0x87')][_0xe6b1('0xb7')],'OrderBy':0x0},{'where':{'ContactId':_0x107383['id']}});}})[_0xe6b1('0x18')](function(){return _0x107383;})[_0xe6b1('0x18')](respondWithResult(_0x4d72b1,null))['catch'](handleError(_0x4d72b1,null));};exports[_0xe6b1('0xb9')]=function(_0x442fc4,_0x3ffc3e){var _0x3e8753={};var _0x370da3={};var _0x33e704;var _0x206d66;return db[_0xe6b1('0x1e')][_0xe6b1('0xba')]({'where':{'id':_0x442fc4[_0xe6b1('0x7f')]['id']}})[_0xe6b1('0x18')](handleEntityNotFound(_0x3ffc3e,null))[_0xe6b1('0x18')](function(_0x57099e){if(_0x57099e){_0x33e704=_0x57099e;_0x370da3[_0xe6b1('0x27')]=_['keys'](db[_0xe6b1('0xaa')][_0xe6b1('0xbb')]);_0x370da3[_0xe6b1('0x28')]=_[_0xe6b1('0x20')](_0x442fc4['query']);_0x370da3['filters']=_['intersection'](_0x370da3[_0xe6b1('0x27')],_0x370da3['query']);_0x3e8753[_0xe6b1('0x2a')]=_['intersection'](_0x370da3[_0xe6b1('0x27')],qs[_0xe6b1('0x2b')](_0x442fc4['query'][_0xe6b1('0x2b')]));_0x3e8753[_0xe6b1('0x2a')]=_0x3e8753[_0xe6b1('0x2a')]['length']?_0x3e8753['attributes']:_0x370da3[_0xe6b1('0x27')];_0x3e8753[_0xe6b1('0x60')]=qs[_0xe6b1('0x2e')](_0x442fc4['query'][_0xe6b1('0x2e')]);_0x3e8753['where']=qs[_0xe6b1('0x29')](_['pick'](_0x442fc4[_0xe6b1('0x28')],_0x370da3[_0xe6b1('0x29')]));if(_0x442fc4[_0xe6b1('0x28')]['filter']){_0x3e8753[_0xe6b1('0x3b')]=_[_0xe6b1('0x71')](_0x3e8753[_0xe6b1('0x3b')],{'$or':_[_0xe6b1('0x6c')](_0x3e8753[_0xe6b1('0x2a')],function(_0x531d48){var _0x3623a9={};_0x3623a9[_0x531d48]={'$like':'%'+_0x442fc4['query']['filter']+'%'};return _0x3623a9;})});}_0x3e8753=_[_0xe6b1('0x71')]({},_0x3e8753,_0x442fc4[_0xe6b1('0xbc')]);return _0x33e704[_0xe6b1('0xb9')](_0x3e8753);}})[_0xe6b1('0x18')](function(_0x3d3e76){if(_0x3d3e76){_0x206d66=_0x3d3e76[_0xe6b1('0x21')];if(!_0x442fc4[_0xe6b1('0x28')][_0xe6b1('0x2c')](_0xe6b1('0x2d'))){_0x3e8753[_0xe6b1('0x13')]=qs[_0xe6b1('0x13')](_0x442fc4[_0xe6b1('0x28')][_0xe6b1('0x13')]);_0x3e8753['offset']=qs[_0xe6b1('0x11')](_0x442fc4[_0xe6b1('0x28')]['offset']);}return _0x33e704['getTags'](_0x3e8753);}})['then'](function(_0x2447b8){if(_0x2447b8){return _0x2447b8?{'count':_0x206d66,'rows':_0x2447b8}:null;}})['then'](respondWithResult(_0x3ffc3e,null))[_0xe6b1('0x7d')](handleError(_0x3ffc3e,null));};exports[_0xe6b1('0xbd')]=function(_0x3099df,_0x4a47c2){if(_0x3099df[_0xe6b1('0x87')]['id']){delete _0x3099df[_0xe6b1('0x87')]['id'];}return db['CmContact'][_0xe6b1('0xba')]({'where':{'id':_0x3099df[_0xe6b1('0x7f')]['id']}})[_0xe6b1('0x18')](handleEntityNotFound(_0x4a47c2,null))[_0xe6b1('0x18')](function(_0x423ae3){if(_0x423ae3){return _0x423ae3['setTags'](_0x3099df['body'][_0xe6b1('0xbe')]||[]);}return null;})[_0xe6b1('0x18')](respondWithResult(_0x4a47c2,null))['catch'](handleError(_0x4a47c2,null));};exports[_0xe6b1('0xbf')]=function(_0x5c56ce,_0x295931){var _0x148862=[];_0x148862[_0xe6b1('0x4c')](addAdditionalPhones(_0x5c56ce[_0xe6b1('0x87')]));Promise[_0xe6b1('0x24')](_0x148862)['then'](function(){_0x148862=[];_0x148862[_0xe6b1('0x4c')](deleteCmHopperPhones(_0x5c56ce[_0xe6b1('0x87')]['id']));_0x148862['push'](addCmHopperPhones(_0x5c56ce['body']['id']));Promise[_0xe6b1('0x24')](_0x148862)[_0xe6b1('0x18')](function(){return[0x1];})[_0xe6b1('0x18')](respondWithResult(_0x295931,null));});};function addAdditionalPhones(_0x58c826){var _0xe78e28;return new Promise(function(_0x6c2806,_0x296bfd){return db[_0xe6b1('0x97')]['destroy']({'where':{'CmContactId':_0x58c826['id']}})['then'](function(){db[_0xe6b1('0xac')][_0xe6b1('0x85')]({'raw':!![],'attributes':['id','OrderBy']})['then'](function(_0x1741d6){var _0x471c95=[];for(var _0x24a65=0x0;_0x24a65<_0x58c826[_0xe6b1('0xc0')][_0xe6b1('0x21')];_0x24a65++){var _0x36eea2=_0x58c826[_0xe6b1('0xc1')]?_[_0xe6b1('0xa0')](_0x58c826['item_types'][_0x24a65])?'':_0x58c826[_0xe6b1('0xc1')][_0x24a65]:_0x58c826[_0xe6b1('0xc0')][_0x24a65][_0xe6b1('0xc2')]?_0x58c826['items'][_0x24a65][_0xe6b1('0xc2')]:'';var _0x33e936=_['isNil'](_0x58c826[_0xe6b1('0xc0')][_0x24a65]['description'])?'':_0x58c826[_0xe6b1('0xc0')][_0x24a65][_0xe6b1('0xc3')];var _0x14c2be=_0x36eea2+':'+_0x58c826[_0xe6b1('0xc0')][_0x24a65][_0xe6b1('0xb7')]+'§'+_0x33e936;if(_['isNil'](_0xe78e28))_0xe78e28=_0x14c2be;else _0xe78e28+=';'+_0x14c2be;var _0x4678ff=null;if(_0x58c826[_0xe6b1('0xc1')]){if(!_[_0xe6b1('0xa0')](_0x58c826['item_types'][_0x24a65])){var _0x12d7f4=_[_0xe6b1('0x7e')](_0x1741d6,function(_0x4dbe93){return _0x4dbe93['id']===_0x58c826[_0xe6b1('0xc1')][_0x24a65];});if(!_[_0xe6b1('0xa0')](_0x12d7f4)){_0x4678ff=_0x12d7f4['OrderBy'];}}}else{if(!_[_0xe6b1('0xa0')](_0x58c826['items'][_0x24a65])){var _0x12d7f4=_['find'](_0x1741d6,function(_0x244c19){return _0x244c19['id']===_0x58c826['items'][_0x24a65][_0xe6b1('0xc2')];});if(!_[_0xe6b1('0xa0')](_0x12d7f4)){_0x4678ff=_0x24a65;}}}if(_[_0xe6b1('0xa0')](_0x4678ff)){_0x4678ff=0x64;}_0x471c95[_0xe6b1('0x4c')](addAdditionalPhone(_0x58c826['id'],_0x58c826['items'][_0x24a65][_0xe6b1('0xb7')],_0x58c826[_0xe6b1('0xc1')]?_[_0xe6b1('0xa0')](_0x58c826[_0xe6b1('0xc1')][_0x24a65])?null:_0x58c826[_0xe6b1('0xc1')][_0x24a65]:_0x58c826[_0xe6b1('0xc0')][_0x24a65]['ItemTypeId']?_0x58c826['items'][_0x24a65][_0xe6b1('0xc2')]:null,_0x4678ff,_0x33e936));}Promise[_0xe6b1('0x24')](_0x471c95)[_0xe6b1('0x18')](function(){db[_0xe6b1('0x1e')]['update']({'AdditionalPhones':_0xe78e28},{'where':{'id':_0x58c826['id']}})[_0xe6b1('0x18')](function(){_0x6c2806(0x1);});});});});});}function addAdditionalPhone(_0x39bb70,_0x25295a,_0x439d9c,_0x47a434,_0x5e5880){return db[_0xe6b1('0x97')][_0xe6b1('0x7e')]({'where':{'CmContactId':_0x39bb70,'item':_0x25295a}})[_0xe6b1('0x18')](function(_0x18add5){if(_0x18add5)logger[_0xe6b1('0x8b')]('contact\x20phone\x20exists',_0x18add5);else{db[_0xe6b1('0x97')][_0xe6b1('0x8e')]({'CmContactId':_0x39bb70,'item':_0x25295a,'ItemTypeId':_0x439d9c,'OrderBy':_0x47a434,'ItemClass':'PHONE','description':_0x5e5880});}});}function deletePhones(_0x2e7b25){return db['CmContactHasItem']['destroy']({'where':{'CmContactId':_0x2e7b25}});}function deleteCmHopperPhones(_0x40f429){return new Promise(function(_0x28377f,_0x2f2fd1){return db[_0xe6b1('0xb8')][_0xe6b1('0x85')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x40f429}})[_0xe6b1('0x18')](function(_0xcfb7d3){db[_0xe6b1('0xc4')][_0xe6b1('0x17')]({'where':{'CmHopperId':{'$in':_['map'](_0xcfb7d3,'id')}}});})[_0xe6b1('0x18')](function(){_0x28377f(0x1);});});}function addCmHopperPhones(_0x1069c6){return new Promise(function(_0x4c72d3,_0x5ef28f){return db[_0xe6b1('0xb8')][_0xe6b1('0x85')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x1069c6}})['then'](function(_0x4c9ff5){var _0x3636ea=[];_[_0xe6b1('0x6c')](_0x4c9ff5,function(_0x296e28){_0x3636ea[_0xe6b1('0x4c')](createCmHopperPhone(_0x1069c6,_0x296e28['id']));});Promise[_0xe6b1('0x24')](_0x3636ea)[_0xe6b1('0x18')](function(){_0x4c72d3(0x1);});});});}function createCmHopperPhone(_0x4168d0,_0x58e0e7){return new Promise(function(_0x27fa50,_0x2d30be){db['CmContactHasItem']['findAll']({'raw':!![],'attributes':[_0xe6b1('0xc5'),_0xe6b1('0xc6')],'where':{'CmContactId':_0x4168d0,'ItemClass':_0xe6b1('0xc7')},'include':[{'model':db['ContactItemType'],'attributes':[_0xe6b1('0xc6')],'as':_0xe6b1('0xad')}],'order':[_0xe6b1('0xc6'),db['sequelize'][_0xe6b1('0xae')](_0xe6b1('0xc8'))]})['then'](function(_0x1adbb2){var _0x23a6ff=0x1;var _0x1a9d96=_[_0xe6b1('0x6c')](_0x1adbb2,function(_0x7709c1){_0x7709c1['CmHopperId']=_0x58e0e7;_0x7709c1[_0xe6b1('0xb7')]=_0x7709c1['item'];_0x7709c1['OrderBy']=_0x23a6ff;delete _0x7709c1[_0xe6b1('0xc9')];_0x23a6ff=_0x23a6ff+0x1;return _0x7709c1;});return db[_0xe6b1('0xc4')][_0xe6b1('0xa5')](_0x1a9d96,{});})[_0xe6b1('0x18')](function(){_0x27fa50(0x1);});});}function insertAdditionalPhones(_0x28538d,_0x395101){return new Promise(function(_0x16655b,_0x388c8b){var _0x5f537e=[];for(var _0x5e7081=0x0;_0x5e7081<_0x395101[_0xe6b1('0x21')];_0x5e7081++){var _0x5ae7ca=_0x395101[_0x5e7081];_0x5f537e['push'](parseContactItemType(_0x5ae7ca));}Promise[_0xe6b1('0x24')](_0x5f537e)[_0xe6b1('0x18')](function(){var _0x5514a4={'id':_0x28538d['id'],'items':_0x395101};return addAdditionalPhones(_0x5514a4)['then'](function(_0x4c4f2c){return addCmHopperPhones(_0x28538d['id']);});})[_0xe6b1('0x18')](function(){_0x16655b(_0x28538d);});});}function parseContactItemType(_0x689095){return new Promise(function(_0x27c2a9,_0x160906){if(_0x689095['hasOwnProperty'](_0xe6b1('0xc2'))){_0x27c2a9(_0x689095);}else{return db['ContactItemType'][_0xe6b1('0x7e')]({'where':{'name':_0x689095[_0xe6b1('0xad')]}})[_0xe6b1('0x18')](function(_0xcb4089){if(_[_0xe6b1('0xa0')](_0xcb4089))_0x689095['ItemTypeId']=null;else _0x689095[_0xe6b1('0xc2')]=_0xcb4089['id'];_0x27c2a9(_0x689095);});}});}exports[_0xe6b1('0xca')]=function(_0x448e9b,_0x488ddd){return db[_0xe6b1('0x97')][_0xe6b1('0x85')]({'raw':!![],'where':{'CmContactId':_0x448e9b[_0xe6b1('0x7f')]['id'],'ItemClass':_0xe6b1('0xc7')},'include':[{'model':db[_0xe6b1('0xac')],'as':_0xe6b1('0xad')}],'order':[[_0xe6b1('0xc6')],[db[_0xe6b1('0x6e')][_0xe6b1('0xae')](_0xe6b1('0xc8'))]]})[_0xe6b1('0x18')](function(_0x4071dd){return _0x4071dd;})[_0xe6b1('0x18')](respondWithResult(_0x488ddd,null))[_0xe6b1('0x7d')](handleError(_0x488ddd,null));};exports['duplicateAdditionalPhones']=function(_0x441930,_0x377e9a){return db[_0xe6b1('0x97')][_0xe6b1('0x85')]({'raw':!![],'where':{'CmContactId':_0x441930['body'][_0xe6b1('0xcb')]}})['then'](function(_0x2c7356){var _0x1cc0c5=_[_0xe6b1('0x6c')](_0x2c7356,function(_0x49644b){_0x49644b['CmContactId']=_0x441930['body'][_0xe6b1('0xcc')];return _0x49644b;});return db[_0xe6b1('0x97')][_0xe6b1('0xa5')](_0x1cc0c5,{});})[_0xe6b1('0x18')](function(_0x1f8e15){return addCmHopperPhones(_0x441930[_0xe6b1('0x87')][_0xe6b1('0xcc')]);})[_0xe6b1('0x18')](function(_0x12e4d6){return['ok'];})[_0xe6b1('0x18')](respondWithResult(_0x377e9a,null))[_0xe6b1('0x7d')](handleError(_0x377e9a,null));};exports[_0xe6b1('0xcd')]=function(_0x27940d,_0x5cbf5d){var _0x3351ee=[];_0x3351ee[_0xe6b1('0x4c')](createCmHopperPhone(_0x27940d[_0xe6b1('0x87')]['id'],_0x27940d['body']['hopperId']));Promise[_0xe6b1('0x24')](_0x3351ee)[_0xe6b1('0x18')](function(){return[0x1];})[_0xe6b1('0x18')](respondWithResult(_0x5cbf5d,null));};exports['getHoppers']=function(_0x4012dd,_0x306049){var _0x314eae={'raw':![],'where':{}};var _0x3eeef5={};var _0x470e1f={'count':0x0,'rows':[]};return db[_0xe6b1('0x1e')]['findOne']({'where':{'id':_0x4012dd[_0xe6b1('0x7f')]['id']}})['then'](handleEntityNotFound(_0x306049,null))[_0xe6b1('0x18')](function(_0x4d56a4){if(_0x4d56a4){_0x3eeef5[_0xe6b1('0x27')]=_['keys'](db[_0xe6b1('0xb8')][_0xe6b1('0xbb')]);_0x3eeef5['query']=_[_0xe6b1('0x20')](_0x4012dd[_0xe6b1('0x28')]);_0x3eeef5[_0xe6b1('0x29')]=_['intersection'](_0x3eeef5['model'],_0x3eeef5['query']);_0x314eae[_0xe6b1('0x2a')]=_[_0xe6b1('0xce')](_0x3eeef5[_0xe6b1('0x27')],qs[_0xe6b1('0x2b')](_0x4012dd[_0xe6b1('0x28')]['fields']));_0x314eae['attributes']=_0x314eae[_0xe6b1('0x2a')][_0xe6b1('0x21')]?_0x314eae[_0xe6b1('0x2a')]:_0x3eeef5[_0xe6b1('0x27')];if(!_0x4012dd[_0xe6b1('0x28')][_0xe6b1('0x2c')](_0xe6b1('0x2d'))){_0x314eae[_0xe6b1('0x13')]=qs[_0xe6b1('0x13')](_0x4012dd[_0xe6b1('0x28')]['limit']);_0x314eae[_0xe6b1('0x11')]=qs[_0xe6b1('0x11')](_0x4012dd['query'][_0xe6b1('0x11')]);}_0x314eae[_0xe6b1('0x60')]=qs[_0xe6b1('0x2e')](_0x4012dd[_0xe6b1('0x28')][_0xe6b1('0x2e')]);_0x314eae['where']=qs[_0xe6b1('0x29')](_[_0xe6b1('0x2f')](_0x4012dd[_0xe6b1('0x28')],_0x3eeef5[_0xe6b1('0x29')]));_0x314eae['where']['ContactId']=_0x4d56a4['id'];if(_0x4012dd['query']['filter']){_0x314eae['where']=_['merge'](_0x314eae[_0xe6b1('0x3b')],{'$or':_[_0xe6b1('0x6c')](_0x314eae[_0xe6b1('0x2a')],function(_0x29e63e){var _0x1004b4={};_0x1004b4[_0x29e63e]={'$like':'%'+_0x4012dd[_0xe6b1('0x28')][_0xe6b1('0x4a')]+'%'};return _0x1004b4;})});}_0x314eae=_[_0xe6b1('0x71')]({},_0x314eae,_0x4012dd[_0xe6b1('0xbc')]);return db[_0xe6b1('0xb8')]['count']({'where':_0x314eae['where']})[_0xe6b1('0x18')](function(_0x310134){_0x470e1f[_0xe6b1('0x14')]=_0x310134;if(_0x4012dd[_0xe6b1('0x28')][_0xe6b1('0xcf')]){_0x314eae['include']=[{'all':!![]}];}return db[_0xe6b1('0xb8')][_0xe6b1('0x85')](_0x314eae);})['then'](function(_0x2ff4c0){_0x470e1f[_0xe6b1('0xd0')]=_0x2ff4c0;return _0x470e1f;});}})[_0xe6b1('0x18')](respondWithFilteredResult(_0x306049,_0x314eae))[_0xe6b1('0x7d')](handleError(_0x306049,null));};exports[_0xe6b1('0xd1')]=function(_0x4b8041,_0x274a47){var _0x43042b={'raw':!![],'where':{}};var _0x44772d={};var _0x81a756={'count':0x0,'rows':[]};return db['CmContact'][_0xe6b1('0xba')]({'where':{'id':_0x4b8041[_0xe6b1('0x7f')]['id']}})[_0xe6b1('0x18')](handleEntityNotFound(_0x274a47,null))[_0xe6b1('0x18')](function(_0x3c45bf){if(_0x3c45bf){_0x44772d[_0xe6b1('0x27')]=_[_0xe6b1('0x20')](db[_0xe6b1('0x99')][_0xe6b1('0xbb')]);_0x44772d[_0xe6b1('0x28')]=_[_0xe6b1('0x20')](_0x4b8041['query']);_0x44772d[_0xe6b1('0x29')]=_[_0xe6b1('0xce')](_0x44772d[_0xe6b1('0x27')],_0x44772d['query']);_0x43042b[_0xe6b1('0x2a')]=_[_0xe6b1('0xce')](_0x44772d[_0xe6b1('0x27')],qs[_0xe6b1('0x2b')](_0x4b8041[_0xe6b1('0x28')][_0xe6b1('0x2b')]));_0x43042b[_0xe6b1('0x2a')]=_0x43042b['attributes'][_0xe6b1('0x21')]?_0x43042b[_0xe6b1('0x2a')]:_0x44772d[_0xe6b1('0x27')];if(!_0x4b8041[_0xe6b1('0x28')]['hasOwnProperty'](_0xe6b1('0x2d'))){_0x43042b[_0xe6b1('0x13')]=qs[_0xe6b1('0x13')](_0x4b8041[_0xe6b1('0x28')][_0xe6b1('0x13')]);_0x43042b['offset']=qs['offset'](_0x4b8041['query'][_0xe6b1('0x11')]);}_0x43042b['order']=qs[_0xe6b1('0x2e')](_0x4b8041['query'][_0xe6b1('0x2e')]);_0x43042b[_0xe6b1('0x3b')]=qs[_0xe6b1('0x29')](_[_0xe6b1('0x2f')](_0x4b8041[_0xe6b1('0x28')],_0x44772d[_0xe6b1('0x29')]));_0x43042b[_0xe6b1('0x3b')][_0xe6b1('0xd2')]=_0x3c45bf['id'];if(_0x4b8041[_0xe6b1('0x28')]['filter']){_0x43042b[_0xe6b1('0x3b')]=_[_0xe6b1('0x71')](_0x43042b[_0xe6b1('0x3b')],{'$or':_['map'](_0x43042b[_0xe6b1('0x2a')],function(_0x46219f){var _0x15110b={};_0x15110b[_0x46219f]={'$like':'%'+_0x4b8041[_0xe6b1('0x28')][_0xe6b1('0x4a')]+'%'};return _0x15110b;})});}_0x43042b=_['merge']({},_0x43042b,_0x4b8041[_0xe6b1('0xbc')]);return db[_0xe6b1('0x99')][_0xe6b1('0x14')]({'where':_0x43042b[_0xe6b1('0x3b')]})['then'](function(_0x48b108){_0x81a756['count']=_0x48b108;if(_0x4b8041['query'][_0xe6b1('0xcf')]){_0x43042b[_0xe6b1('0xd3')]=[{'all':!![]}];}return db['CmHopperHistory'][_0xe6b1('0x85')](_0x43042b);})[_0xe6b1('0x18')](function(_0x1b0728){_0x81a756[_0xe6b1('0xd0')]=_0x1b0728;return _0x81a756;});}})[_0xe6b1('0x18')](respondWithFilteredResult(_0x274a47,_0x43042b))[_0xe6b1('0x7d')](handleError(_0x274a47,null));};exports[_0xe6b1('0xd4')]=function(_0x35ac33,_0x449aa4){var _0x4d7633={'raw':!![],'where':{}};var _0x74b73c={};var _0x3c363e={'count':0x0,'rows':[]};return db[_0xe6b1('0x1e')][_0xe6b1('0xba')]({'where':{'id':_0x35ac33['params']['id']}})['then'](handleEntityNotFound(_0x449aa4,null))[_0xe6b1('0x18')](function(_0x540c99){if(_0x540c99){_0x74b73c[_0xe6b1('0x27')]=_[_0xe6b1('0x20')](db[_0xe6b1('0x98')][_0xe6b1('0xbb')]);_0x74b73c['query']=_[_0xe6b1('0x20')](_0x35ac33[_0xe6b1('0x28')]);_0x74b73c[_0xe6b1('0x29')]=_[_0xe6b1('0xce')](_0x74b73c['model'],_0x74b73c[_0xe6b1('0x28')]);_0x4d7633[_0xe6b1('0x2a')]=_[_0xe6b1('0xce')](_0x74b73c[_0xe6b1('0x27')],qs['fields'](_0x35ac33['query']['fields']));_0x4d7633[_0xe6b1('0x2a')]=_0x4d7633[_0xe6b1('0x2a')]['length']?_0x4d7633[_0xe6b1('0x2a')]:_0x74b73c[_0xe6b1('0x27')];if(!_0x35ac33[_0xe6b1('0x28')]['hasOwnProperty'](_0xe6b1('0x2d'))){_0x4d7633[_0xe6b1('0x13')]=qs[_0xe6b1('0x13')](_0x35ac33['query'][_0xe6b1('0x13')]);_0x4d7633['offset']=qs[_0xe6b1('0x11')](_0x35ac33['query'][_0xe6b1('0x11')]);}_0x4d7633[_0xe6b1('0x60')]=qs[_0xe6b1('0x2e')](_0x35ac33[_0xe6b1('0x28')]['sort']);_0x4d7633[_0xe6b1('0x3b')]=qs[_0xe6b1('0x29')](_[_0xe6b1('0x2f')](_0x35ac33['query'],_0x74b73c[_0xe6b1('0x29')]));_0x4d7633[_0xe6b1('0x3b')]['ContactId']=_0x540c99['id'];if(_0x35ac33[_0xe6b1('0x28')][_0xe6b1('0x4a')]){_0x4d7633['where']=_[_0xe6b1('0x71')](_0x4d7633[_0xe6b1('0x3b')],{'$or':_[_0xe6b1('0x6c')](_0x4d7633[_0xe6b1('0x2a')],function(_0x1f76fa){var _0x7171f4={};_0x7171f4[_0x1f76fa]={'$like':'%'+_0x35ac33[_0xe6b1('0x28')][_0xe6b1('0x4a')]+'%'};return _0x7171f4;})});}_0x4d7633=_[_0xe6b1('0x71')]({},_0x4d7633,_0x35ac33['options']);return db['CmHopperFinal'][_0xe6b1('0x14')]({'where':_0x4d7633[_0xe6b1('0x3b')]})[_0xe6b1('0x18')](function(_0x1cb866){_0x3c363e['count']=_0x1cb866;if(_0x35ac33[_0xe6b1('0x28')][_0xe6b1('0xcf')]){_0x4d7633[_0xe6b1('0xd3')]=[{'all':!![]}];}return db[_0xe6b1('0x98')][_0xe6b1('0x85')](_0x4d7633);})[_0xe6b1('0x18')](function(_0x1645fd){_0x3c363e['rows']=_0x1645fd;return _0x3c363e;});}})[_0xe6b1('0x18')](respondWithFilteredResult(_0x449aa4,_0x4d7633))[_0xe6b1('0x7d')](handleError(_0x449aa4,null));};exports[_0xe6b1('0xd5')]=function(_0x9faf27,_0x543cab){var _0x196490={'raw':!![],'where':{}};var _0x2b7588={};var _0x225df3={'count':0x0,'rows':[]};return db[_0xe6b1('0x1e')][_0xe6b1('0xba')]({'where':{'id':_0x9faf27[_0xe6b1('0x7f')]['id']}})['then'](handleEntityNotFound(_0x543cab,null))[_0xe6b1('0x18')](function(_0x5a54cb){if(_0x5a54cb){_0x2b7588[_0xe6b1('0x27')]=_[_0xe6b1('0x20')](db[_0xe6b1('0xd6')][_0xe6b1('0xbb')]);_0x2b7588['query']=_[_0xe6b1('0x20')](_0x9faf27[_0xe6b1('0x28')]);_0x2b7588[_0xe6b1('0x29')]=_[_0xe6b1('0xce')](_0x2b7588['model'],_0x2b7588[_0xe6b1('0x28')]);_0x196490[_0xe6b1('0x2a')]=_[_0xe6b1('0xce')](_0x2b7588[_0xe6b1('0x27')],qs[_0xe6b1('0x2b')](_0x9faf27[_0xe6b1('0x28')][_0xe6b1('0x2b')]));_0x196490['attributes']=_0x196490['attributes'][_0xe6b1('0x21')]?_0x196490[_0xe6b1('0x2a')]:_0x2b7588['model'];if(!_0x9faf27[_0xe6b1('0x28')][_0xe6b1('0x2c')](_0xe6b1('0x2d'))){_0x196490[_0xe6b1('0x13')]=qs['limit'](_0x9faf27[_0xe6b1('0x28')][_0xe6b1('0x13')]);_0x196490[_0xe6b1('0x11')]=qs[_0xe6b1('0x11')](_0x9faf27[_0xe6b1('0x28')][_0xe6b1('0x11')]);}_0x196490[_0xe6b1('0x60')]=qs[_0xe6b1('0x2e')](_0x9faf27[_0xe6b1('0x28')]['sort']);_0x196490[_0xe6b1('0x3b')]=qs['filters'](_[_0xe6b1('0x2f')](_0x9faf27[_0xe6b1('0x28')],_0x2b7588[_0xe6b1('0x29')]));_0x196490[_0xe6b1('0x3b')][_0xe6b1('0xd2')]=_0x5a54cb['id'];if(_0x9faf27[_0xe6b1('0x28')][_0xe6b1('0x4a')]){_0x196490[_0xe6b1('0x3b')]=_['merge'](_0x196490[_0xe6b1('0x3b')],{'$or':_[_0xe6b1('0x6c')](_0x196490[_0xe6b1('0x2a')],function(_0x4f2854){var _0x3dfa41={};_0x3dfa41[_0x4f2854]={'$like':'%'+_0x9faf27[_0xe6b1('0x28')][_0xe6b1('0x4a')]+'%'};return _0x3dfa41;})});}_0x196490=_['merge']({},_0x196490,_0x9faf27['options']);return db['JscriptySessionReport'][_0xe6b1('0x14')]({'where':_0x196490[_0xe6b1('0x3b')]})[_0xe6b1('0x18')](function(_0x435be2){_0x225df3[_0xe6b1('0x14')]=_0x435be2;if(_0x9faf27[_0xe6b1('0x28')]['includeAll']){_0x196490[_0xe6b1('0xd3')]=[{'all':!![]}];}return db[_0xe6b1('0xd6')][_0xe6b1('0x85')](_0x196490);})[_0xe6b1('0x18')](function(_0x4711b6){_0x225df3[_0xe6b1('0xd0')]=_0x4711b6;return _0x225df3;});}})[_0xe6b1('0x18')](respondWithFilteredResult(_0x543cab,_0x196490))[_0xe6b1('0x7d')](handleError(_0x543cab,null));};exports[_0xe6b1('0xd7')]=function(_0x4d778f,_0x9af91f){try{if(!_0x4d778f['body'][_0xe6b1('0x6d')]){throw new Error(_0xe6b1('0xd8'));}if(!_0x4d778f['body']['binding_keys']){throw new Error(_0xe6b1('0xd9'));}if(!_0x4d778f[_0xe6b1('0x87')][_0xe6b1('0xda')]){throw new Error(_0xe6b1('0xdb'));}if(!_0x4d778f['body'][_0xe6b1('0xdc')]){throw new Error(_0xe6b1('0xdd'));}var _0x4eb765=_0x4d778f[_0xe6b1('0x87')][_0xe6b1('0xde')]['split'](',');var _0x1c07ca=_0x4d778f['body'][_0xe6b1('0xda')]['split'](',');if(!_0x4eb765[_0xe6b1('0x21')]||!_0x1c07ca['length']||_0x4eb765[_0xe6b1('0x21')]!==_0x1c07ca[_0xe6b1('0x21')]){throw new Error(_0xe6b1('0xdf'));}_0x4d778f[_0xe6b1('0x87')][_0xe6b1('0x2b')]=_['zipObject'](_0x4eb765,_0x1c07ca);if(!_0x4d778f[_0xe6b1('0x87')][_0xe6b1('0x2b')][_0xe6b1('0xb7')]){throw new Error(_0xe6b1('0xe0'));}if(!_0x4d778f[_0xe6b1('0x87')][_0xe6b1('0x2b')][_0xe6b1('0xe1')]){throw new Error(_0xe6b1('0xe2'));}var _0x30cd93=path[_0xe6b1('0xe3')](config[_0xe6b1('0xe4')],_0xe6b1('0xe5'),_0x4d778f['file'][_0xe6b1('0xe6')]);fs[_0xe6b1('0xe7')](_0x30cd93,parseInt(_0xe6b1('0xe8'),0x8));var _0x66c8bb=require('child_process')[_0xe6b1('0xe9')](path[_0xe6b1('0xe3')](__dirname,'../../components/import/cm/csv'),[_0x30cd93,_0x4d778f['body'][_0xe6b1('0xde')],_0x4d778f[_0xe6b1('0x87')]['binding_values'],_0x4d778f[_0xe6b1('0x87')][_0xe6b1('0x6d')],_0x4d778f[_0xe6b1('0x87')]['CompanyId'],_0x4d778f[_0xe6b1('0x87')][_0xe6b1('0xa6')],_0x4d778f[_0xe6b1('0x87')][_0xe6b1('0xdc')]]);return _0x9af91f[_0xe6b1('0xf')](0xc8)[_0xe6b1('0x10')]({'message':_0xe6b1('0xea'),'pid':_0x66c8bb['pid']});}catch(_0x168c82){return _0x9af91f[_0xe6b1('0xf')](0x1f4)['send'](_0x168c82);}};exports[_0xe6b1('0xeb')]=function(_0x258574,_0x1cd69f){var _0x515001=fs['createReadStream'](_0x258574[_0xe6b1('0xec')][_0xe6b1('0x1')]);Papa[_0xe6b1('0xed')](_0x515001,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x3ccd8e){return _0x1cd69f[_0xe6b1('0xf')](0xc8)[_0xe6b1('0x10')]({'file':_0x258574[_0xe6b1('0xec')],'fields':_0x3ccd8e[_0xe6b1('0xee')]['fields']});}});};exports[_0xe6b1('0xef')]=function(_0x3f4413,_0x3bed8b){return db[_0xe6b1('0xf0')]['findAll']({'raw':!![],'attributes':['id'],'where':{'role':_0xe6b1('0x67')}})['then'](function(_0x2dda97){var _0x2610d3=![];if(!_0x3f4413[_0xe6b1('0x87')][_0xe6b1('0x6d')]){throw new Error(_0xe6b1('0xd8'));}if(!_0x3f4413[_0xe6b1('0x87')][_0xe6b1('0xf1')]['phone']){throw new Error(_0xe6b1('0xe0'));}if(!_0x3f4413['body']['binding']['firstName']){throw new Error(_0xe6b1('0xe2'));}if(!_0x3f4413[_0xe6b1('0x87')]['socket_timestamp']){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x2bef0d=require(_0xe6b1('0xf2'))[_0xe6b1('0xe9')](path[_0xe6b1('0xe3')](__dirname,_0xe6b1('0xf3')),[_0x3f4413[_0xe6b1('0x7f')]['id'],JSON['stringify'](_0x3f4413[_0xe6b1('0x87')]),JSON[_0xe6b1('0xf4')](_0x2dda97)]);_0x2bef0d['on'](_0xe6b1('0xf5'),function(){_0x2610d3=!![];return _0x3bed8b[_0xe6b1('0xf')](0xc8)[_0xe6b1('0x10')]({'message':'start\x20child\x20process\x20correctly!','pid':_0x2bef0d[_0xe6b1('0xf6')]});});_0x2bef0d['on'](_0xe6b1('0xf7'),function(_0x2e81c8){if(_0x2e81c8&&!_0x2610d3){return _0x3bed8b['status'](0x1f4)[_0xe6b1('0x10')]({'message':'error\x20child\x20process','pid':_0x2bef0d[_0xe6b1('0xf6')]});}});})['catch'](handleError(_0x3bed8b,null));};exports[_0xe6b1('0xf8')]=function(_0x1421e3,_0xea76b1,_0x25d9ae){return db[_0xe6b1('0xf0')][_0xe6b1('0x85')]({'raw':!![],'attributes':['id'],'where':{'role':_0xe6b1('0x67')}})[_0xe6b1('0x18')](function(_0x26283c){var _0x1c5580=![];if(!_0x1421e3[_0xe6b1('0x87')]['ListId']){throw new Error(_0xe6b1('0xd8'));}if(!_0x1421e3[_0xe6b1('0x87')][_0xe6b1('0xf1')][_0xe6b1('0xb7')]){throw new Error(_0xe6b1('0xe0'));}if(!_0x1421e3[_0xe6b1('0x87')][_0xe6b1('0xf1')][_0xe6b1('0xe1')]){throw new Error('No\x20firstName\x20column\x20specified');}if(!_0x1421e3['body'][_0xe6b1('0xdc')]){throw new Error(_0xe6b1('0xdd'));}var _0x2163cc=require(_0xe6b1('0xf2'))[_0xe6b1('0xe9')](path[_0xe6b1('0xe3')](__dirname,'../../components/import/cm/csvUpdates'),[_0x1421e3[_0xe6b1('0x7f')]['id'],JSON['stringify'](_0x1421e3[_0xe6b1('0x87')]),JSON[_0xe6b1('0xf4')](_0x26283c)]);_0x2163cc['on'](_0xe6b1('0xf5'),function(_0x105b80){_0x1c5580=!![];return _0xea76b1[_0xe6b1('0xf')](0xc8)[_0xe6b1('0x10')]({'message':_0xe6b1('0xf9'),'pid':_0x2163cc[_0xe6b1('0xf6')]});});_0x2163cc['on']('exit',function(_0x18b2a9){if(_0x18b2a9&&!_0x1c5580){return _0xea76b1[_0xe6b1('0xf')](0x1f4)[_0xe6b1('0x10')]({'message':_0xe6b1('0xfa'),'pid':_0x2163cc['pid']});}});})[_0xe6b1('0x7d')](handleError(_0xea76b1,null));};exports[_0xe6b1('0xfb')]=function(_0x4232d4,_0x3ae113){var _0x1c0a4a=[_0xe6b1('0xfc'),'chat','sms',_0xe6b1('0xfd'),_0xe6b1('0xfe'),'whatsapp','voice'];var _0x30ad10={'offset':0x0,'order':qs[_0xe6b1('0x2e')]('-createdAt')},_0x5b1d8a={'count':0x0,'rows':[]};Promise[_0xe6b1('0x65')]()[_0xe6b1('0x18')](function(){if(_0x4232d4[_0xe6b1('0x28')][_0xe6b1('0xff')]){if(!_[_0xe6b1('0x100')](_0x1c0a4a,_0x4232d4[_0xe6b1('0x28')]['channel'][_0xe6b1('0x101')]())){throw new Error(_0xe6b1('0x102'));}_0x1c0a4a=[_0x4232d4[_0xe6b1('0x28')]['channel'][_0xe6b1('0x101')]()];}if(_0x4232d4[_0xe6b1('0x28')][_0xe6b1('0x103')]){try{var _0x2e2f39=JSON[_0xe6b1('0xed')](_0x4232d4[_0xe6b1('0x28')]['range']);if(!moment(_0x2e2f39[_0xe6b1('0x32')])[_0xe6b1('0x104')]()){throw new Error(_0xe6b1('0x105'));}if(!moment(_0x2e2f39['to'])[_0xe6b1('0x104')]()){throw new Error(_0xe6b1('0x106'));}}catch(_0x5bb7e5){throw new Error(_0xe6b1('0x107'));}}if(!_0x4232d4[_0xe6b1('0x28')][_0xe6b1('0x2c')](_0xe6b1('0x2d'))){_0x30ad10['limit']=qs['limit'](_0x4232d4[_0xe6b1('0x28')]['limit']||0xa);_0x30ad10[_0xe6b1('0x11')]=qs[_0xe6b1('0x11')](_0x4232d4['query'][_0xe6b1('0x11')]);}var _0x492504=_0x1c0a4a[_0xe6b1('0x6c')](function(_0x476ee3){if(_0x476ee3===_0xe6b1('0x108')){var _0x2f1c62={'attributes':['id',_0xe6b1('0x109'),_0xe6b1('0x26'),'source',_0xe6b1('0x10a'),'callerid',_0xe6b1('0x10b'),_0xe6b1('0x10c'),'duration','note','createdAt',_0xe6b1('0x10d'),_0xe6b1('0x10e'),_0xe6b1('0x10f'),'UserId'],'where':{'ContactId':_0x4232d4[_0xe6b1('0x7f')]['id']},'include':[{'model':db[_0xe6b1('0xf0')],'as':'User','attributes':['id',_0xe6b1('0x1c'),_0xe6b1('0x110'),_0xe6b1('0x111')]}],'order':[[_0xe6b1('0x112'),'DESC']]};if(_0x4232d4[_0xe6b1('0x28')][_0xe6b1('0x103')]){_0x2f1c62[_0xe6b1('0x3b')][_0xe6b1('0x112')]={'$gte':_0x2e2f39[_0xe6b1('0x32')],'$lte':_0x2e2f39['to']};}return db[_0xe6b1('0x113')][_0xe6b1('0x114')](_0x2f1c62)['then'](function(_0x23a913){_0x5b1d8a[_0xe6b1('0x14')]+=_0x23a913[_0xe6b1('0x14')];return _[_0xe6b1('0x6c')](_0x23a913['rows'],function(_0x38c2c4){var _0x2aec17=_0x38c2c4['get']({'plain':!![]});_0x2aec17['channel']=_0x476ee3;if(_0x2aec17['User']){_0x2aec17['User']={'id':_0x2aec17[_0xe6b1('0xf0')]['id'],'name':_0x2aec17[_0xe6b1('0xf0')][_0xe6b1('0x1c')],'fullname':_0x2aec17[_0xe6b1('0xf0')][_0xe6b1('0x110')],'alias':_0x2aec17[_0xe6b1('0xf0')][_0xe6b1('0x111')]};}return _0x2aec17;});});}else{var _0x533aea=_[_0xe6b1('0x115')](_0x476ee3)+(_0x476ee3===_0xe6b1('0x116')?_0xe6b1('0x117'):_0xe6b1('0x118'));var _0x2be84d={'attributes':['id','closed',_0xe6b1('0x119'),_0xe6b1('0x112'),_0xe6b1('0x11a'),'disposition','secondDisposition',_0xe6b1('0x11b'),'UserId',_0x533aea+'Id'],'where':{'ContactId':_0x4232d4[_0xe6b1('0x7f')]['id']},'include':[{'model':db[_0x533aea],'as':_0xe6b1('0x118'),'attributes':['id',_0xe6b1('0x1c'),_0xe6b1('0x11c')]},{'model':db[_0xe6b1('0xf0')],'as':_0xe6b1('0x11d'),'attributes':['id',_0xe6b1('0x1c'),_0xe6b1('0x110')]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0xe6b1('0x1c'),'color'],'through':{'attributes':[]}}],'order':[[_0xe6b1('0x112'),_0xe6b1('0x62')]]};if(_0x4232d4[_0xe6b1('0x28')][_0xe6b1('0x103')]){_0x2be84d['where'][_0xe6b1('0x112')]={'$gte':_0x2e2f39['from'],'$lte':_0x2e2f39['to']};}switch(_0x476ee3){case _0xe6b1('0x116'):_0x2be84d[_0xe6b1('0x2a')]['push'](_0xe6b1('0x11e'),_0xe6b1('0x11f'),_0xe6b1('0x120'),_0xe6b1('0x121'),'osName',_0xe6b1('0x122'),_0xe6b1('0x123'),_0xe6b1('0x124'),_0xe6b1('0x125'));break;case _0xe6b1('0xfc'):_0x2be84d['attributes'][_0xe6b1('0x4c')](_0xe6b1('0x126'),'substatus');break;case _0xe6b1('0xfd'):_0x2be84d[_0xe6b1('0x2a')][_0xe6b1('0x4c')]('externalUrl',_0xe6b1('0x127'));break;}return db[_[_0xe6b1('0x115')](_0x476ee3)+'Interaction']['findAndCountAll'](_0x2be84d)[_0xe6b1('0x18')](function(_0x17b9c){_0x5b1d8a[_0xe6b1('0x14')]+=_0x17b9c[_0xe6b1('0x14')];return _[_0xe6b1('0x6c')](_0x17b9c[_0xe6b1('0xd0')],function(_0x6033ae){var _0x49ac90=_0x6033ae[_0xe6b1('0x88')]({'plain':!![]});_0x49ac90['channel']=_0x476ee3;if(_0x49ac90['Owner']){_0x49ac90['Owner']={'id':_0x49ac90[_0xe6b1('0x11d')]['id'],'name':_0x49ac90[_0xe6b1('0x11d')][_0xe6b1('0x1c')],'fullname':_0x49ac90['Owner'][_0xe6b1('0x110')]};}return _0x49ac90;});});}});return Promise[_0xe6b1('0x24')](_0x492504);})['then'](function(_0x3a8599){return _(_0x3a8599)['flatten']()[_0xe6b1('0x128')](_0xe6b1('0x112'))['reverse']()['value']();})[_0xe6b1('0x18')](function(_0x8968db){_0x5b1d8a['rows']=_0x30ad10['limit']?_0x8968db['slice'](_0x30ad10['offset'],_0x30ad10['offset']+_0x30ad10[_0xe6b1('0x13')]):_0x8968db;return _0x5b1d8a;})[_0xe6b1('0x18')](respondWithFilteredResult(_0x3ae113,_0x30ad10))[_0xe6b1('0x7d')](handleError(_0x3ae113,null));};
\ No newline at end of file
index e87e6d3..c0882ce 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5c8c=['save','emit','hook','exports','../../mysqldb'];(function(_0x203387,_0x25ee77){var _0x358e6b=function(_0xf5b2ff){while(--_0xf5b2ff){_0x203387['push'](_0x203387['shift']());}};_0x358e6b(++_0x25ee77);}(_0x5c8c,0xdb));var _0xc5c8=function(_0x57509a,_0x4332c5){_0x57509a=_0x57509a-0x0;var _0x28cdb1=_0x5c8c[_0x57509a];return _0x28cdb1;};'use strict';var EventEmitter=require('events');var CmContact=require(_0xc5c8('0x0'))['db']['CmContact'];var CmContactEvents=new EventEmitter();CmContactEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc5c8('0x1'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0xcad569){return function(_0x1f1187,_0x2bac2d,_0x1ab5c3){CmContactEvents[_0xc5c8('0x2')](_0xcad569+':'+_0x1f1187['id'],_0x1f1187);CmContactEvents[_0xc5c8('0x2')](_0xcad569,_0x1f1187);_0x1ab5c3(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmContact[_0xc5c8('0x3')](e,emitEvent(event));}}module[_0xc5c8('0x4')]=CmContactEvents;
\ No newline at end of file
+var _0x029e=['hasOwnProperty','hook','exports','events','../../mysqldb','CmContact','setMaxListeners','update','remove','emit'];(function(_0x330141,_0x1dd290){var _0x1b68a2=function(_0x4e7f3c){while(--_0x4e7f3c){_0x330141['push'](_0x330141['shift']());}};_0x1b68a2(++_0x1dd290);}(_0x029e,0x7b));var _0xe029=function(_0x15f962,_0x51aa80){_0x15f962=_0x15f962-0x0;var _0x58bec4=_0x029e[_0x15f962];return _0x58bec4;};'use strict';var EventEmitter=require(_0xe029('0x0'));var CmContact=require(_0xe029('0x1'))['db'][_0xe029('0x2')];var CmContactEvents=new EventEmitter();CmContactEvents[_0xe029('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xe029('0x4'),'afterDestroy':_0xe029('0x5')};function emitEvent(_0x21bcb3){return function(_0x4ad748,_0x747610,_0x3ecf94){CmContactEvents['emit'](_0x21bcb3+':'+_0x4ad748['id'],_0x4ad748);CmContactEvents[_0xe029('0x6')](_0x21bcb3,_0x4ad748);_0x3ecf94(null);};}for(var e in events){if(events[_0xe029('0x7')](e)){var event=events[e];CmContact[_0xe029('0x8')](e,emitEvent(event));}}module[_0xe029('0x9')]=CmContactEvents;
\ No newline at end of file
index 2483c71..8c9b1ba 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x17d8=['bluebird','path','rimraf','../../config/environment','../../config/environment/shared','./cmContact.attributes','exports','CmContact','cm_contacts','phone','fti_cm_contacts','firstName','lastName','fax','email','FULLTEXT','utf8mb4_unicode_ci','models','get','error','cmContact','afterCreate','inspect','YYYY-MM-DD\x20HH:mm:ss','dialTimezone','VoiceQueue','findOne','then','isNil','utcOffset','scheduledat','minutes','format','ret','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','CmHopper','ListId','priority','callbackUniqueid','catch','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','CmHopperFinal','cmContact,\x20afterCreate,\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20','timezones','add','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20','create','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20','findAll','outbound','CmList','Lists','length','dialCheckDuplicateType','onlyIfOpen','cmContact,\x20%s,\x20%s','message','Campaign','always','BlackLists','List\x20not\x20found','isEmpty','ContactId','CampaignId','all','info','[CmContact][afterDestroy][Succesfull]','lodash','util','api','moment'];(function(_0x400b43,_0x55da4e){var _0x3c330f=function(_0x5bbd52){while(--_0x5bbd52){_0x400b43['push'](_0x400b43['shift']());}};_0x3c330f(++_0x55da4e);}(_0x17d8,0xda));var _0x817d=function(_0x363cfa,_0x12a78a){_0x363cfa=_0x363cfa-0x0;var _0x1d22d2=_0x17d8[_0x363cfa];return _0x1d22d2;};'use strict';var _=require(_0x817d('0x0'));var util=require(_0x817d('0x1'));var logger=require('../../config/logger')(_0x817d('0x2'));var moment=require(_0x817d('0x3'));var BPromise=require(_0x817d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x817d('0x5'));var rimraf=require(_0x817d('0x6'));var config=require(_0x817d('0x7'));var shared=require(_0x817d('0x8'));var attributes=require(_0x817d('0x9'));module[_0x817d('0xa')]=function(_0x5c236d,_0x946fe3){return _0x5c236d['define'](_0x817d('0xb'),attributes,{'tableName':_0x817d('0xc'),'paranoid':!![],'indexes':[{'name':_0x817d('0xd'),'fields':[_0x817d('0xd')]},{'name':_0x817d('0xe'),'fields':[_0x817d('0xf'),_0x817d('0x10'),_0x817d('0xd'),'mobile',_0x817d('0x11'),_0x817d('0x12')],'type':_0x817d('0x13')}],'timestamps':!![],'charset':'utf8mb4','collate':_0x817d('0x14'),'hooks':{'afterCreate':function(_0x47e581,_0x5d341c,_0x3143f1){var _0x42a554=_0x5c236d[_0x817d('0x15')];var _0x2c5156=_0x47e581[_0x817d('0x16')]({'plain':!![]});function _0x3d71da(){return function(_0x5187b1){logger[_0x817d('0x17')](_0x817d('0x18'),_0x817d('0x19'),util[_0x817d('0x1a')](_0x5187b1,{'showHidden':![],'depth':null}));};}function _0xc598f3(_0x328e25,_0x5eae0c){var _0x388f9b=_0x5eae0c['scheduledat']?_0x5eae0c['scheduledat']:moment()['format'](_0x817d('0x1b'));return new BPromise(function(_0x1e7b34,_0x24e409){if(_['isNil'](_0x5eae0c[_0x817d('0x1c')])){_0x1e7b34({'ret':_0x388f9b});}else{_0x42a554[_0x817d('0x1d')][_0x817d('0x1e')]({'where':{'id':_0x328e25['id']}})[_0x817d('0x1f')](function(_0x1a284e){if(!_[_0x817d('0x20')](_0x1a284e)){var _0x2429cb=_0x1a284e['dialTimezone'];if(!_[_0x817d('0x20')](_0x2429cb)){var _0x2b269b=shared['timezones'];var _0x48af01=_0x2b269b[_0x2429cb];var _0x23dc3d=_0x2b269b[_0x5eae0c[_0x817d('0x1c')]];if(!_['isNil'](_0x48af01)&&!_[_0x817d('0x20')](_0x23dc3d)){var _0x1818ad=_0x48af01[_0x817d('0x21')]-_0x23dc3d[_0x817d('0x21')];_0x388f9b=_0x5eae0c[_0x817d('0x22')]?_0x5eae0c[_0x817d('0x22')]:moment();var _0x26ef87=moment(_0x388f9b)['add'](_0x1818ad,_0x817d('0x23'));_0x1e7b34({'ret':_0x26ef87[_0x817d('0x24')]('YYYY-MM-DD\x20HH:mm:ss')});}else _0x1e7b34({'ret':_0x388f9b});}else _0x1e7b34({'ret':_0x388f9b});}else{_0x1e7b34({'ret':_0x388f9b});}});}});return 0xa;}var _0x5cb44e=function(_0x239307){return new BPromise(function(_0x5b5f60,_0x4dd3c1){_0xc598f3(_0x239307,_0x2c5156)[_0x817d('0x1f')](function(_0x428804){_0x2c5156['scheduledat']=_0x428804[_0x817d('0x25')];_0x42a554['CmHopper'][_0x817d('0x1e')]({'where':{'phone':_0x2c5156[_0x817d('0xd')],'VoiceQueueId':_0x239307['id']}})[_0x817d('0x1f')](function(_0x1e9be8){if(!_[_0x817d('0x20')](_0x1e9be8)){throw new Error('cmContact,\x20afterCreate\x20'+_0x2c5156[_0x817d('0xd')]+_0x817d('0x26')+_0x239307['id']);}return _0x42a554[_0x817d('0x27')]['create']({'phone':_0x2c5156[_0x817d('0xd')],'ContactId':_0x2c5156['id'],'ListId':_0x2c5156[_0x817d('0x28')],'priority':_0x2c5156[_0x817d('0x29')]?_0x2c5156[_0x817d('0x29')]:0x2,'scheduledat':_0x2c5156[_0x817d('0x22')]?_0x2c5156[_0x817d('0x22')]:moment()[_0x817d('0x24')](_0x817d('0x1b')),'callback':_0x2c5156[_0x817d('0x2a')]?!![]:![],'callbackuniqueid':_0x2c5156[_0x817d('0x2a')]?_0x2c5156[_0x817d('0x2a')]:undefined,'callbackat':_0x2c5156['callbackUniqueid']?moment()[_0x817d('0x24')](_0x817d('0x1b')):undefined,'VoiceQueueId':_0x239307['id']});})[_0x817d('0x2b')](function(_0x58a56a){_0x4dd3c1(_0x58a56a);});});});};var _0x17c97c=function(_0x1ecf35){return new BPromise(function(_0x39aacf,_0x533d9d){_0xc598f3(_0x1ecf35,_0x2c5156)[_0x817d('0x1f')](function(_0x5b3099){_0x2c5156[_0x817d('0x22')]=_0x5b3099['ret'];_0x42a554[_0x817d('0x27')][_0x817d('0x1e')]({'where':{'phone':_0x2c5156[_0x817d('0xd')],'VoiceQueueId':_0x1ecf35['id']}})[_0x817d('0x1f')](function(_0x1d8c54){if(!_[_0x817d('0x20')](_0x1d8c54)){throw new Error(_0x817d('0x2c')+_0x2c5156[_0x817d('0xd')]+_0x817d('0x2d')+_0x1ecf35['id']);}return _0x42a554[_0x817d('0x2e')]['findOne']({'where':{'calleridnum':_0x2c5156[_0x817d('0xd')],'VoiceQueueId':_0x1ecf35['id']}});})['then'](function(_0x4c9871){if(!_[_0x817d('0x20')](_0x4c9871)){throw new Error(_0x817d('0x2f')+_0x2c5156[_0x817d('0xd')]+_0x817d('0x30')+_0x1ecf35['id']);}return _0x42a554['CmHopper']['create']({'phone':_0x2c5156[_0x817d('0xd')],'ContactId':_0x2c5156['id'],'ListId':_0x2c5156[_0x817d('0x28')],'priority':_0x2c5156['priority']?_0x2c5156[_0x817d('0x29')]:0x2,'scheduledat':_0x2c5156[_0x817d('0x22')]?_0x2c5156[_0x817d('0x22')]:moment()[_0x817d('0x24')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x2c5156[_0x817d('0x2a')]?!![]:![],'callbackuniqueid':_0x2c5156[_0x817d('0x2a')]?_0x2c5156[_0x817d('0x2a')]:undefined,'callbackat':_0x2c5156[_0x817d('0x2a')]?moment()[_0x817d('0x24')](_0x817d('0x1b')):undefined,'VoiceQueueId':_0x1ecf35['id']});})[_0x817d('0x2b')](function(_0x4e30bc){_0x533d9d(_0x4e30bc);});});});};function _0x321405(){return function(_0x1c68a0){logger[_0x817d('0x17')]('cmContact',_0x817d('0x19'),util[_0x817d('0x1a')](_0x1c68a0,{'showHidden':![],'depth':null}));};}function _0x108d7e(_0xbf1671,_0xe26334){var _0x59d497=_0xe26334[_0x817d('0x22')]?_0xe26334[_0x817d('0x22')]:moment()[_0x817d('0x24')](_0x817d('0x1b'));return new BPromise(function(_0x2bd6e0,_0x2022aa){if(_[_0x817d('0x20')](_0xe26334['dialTimezone'])){_0x2bd6e0({'ret':_0x59d497});}else{_0x42a554['Campaign']['findOne']({'where':{'id':_0xbf1671['id']}})[_0x817d('0x1f')](function(_0x1fedad){if(!_[_0x817d('0x20')](_0x1fedad)){var _0xe8e70b=_0x1fedad['dialTimezone'];if(!_['isNil'](_0xe8e70b)){var _0x2e2a55=shared[_0x817d('0x31')];var _0x14ad2e=_0x2e2a55[_0xe8e70b];var _0xc0bda4=_0x2e2a55[_0xe26334[_0x817d('0x1c')]];if(!_[_0x817d('0x20')](_0x14ad2e)&&!_[_0x817d('0x20')](_0xc0bda4)){var _0x3a4a38=_0x14ad2e[_0x817d('0x21')]-_0xc0bda4[_0x817d('0x21')];_0x59d497=_0xe26334[_0x817d('0x22')]?_0xe26334[_0x817d('0x22')]:moment();var _0x47969c=moment(_0x59d497)[_0x817d('0x32')](_0x3a4a38,'minutes');_0x2bd6e0({'ret':_0x47969c[_0x817d('0x24')](_0x817d('0x1b'))});}else _0x2bd6e0({'ret':_0x59d497});}else _0x2bd6e0({'ret':_0x59d497});}else{_0x2bd6e0({'ret':_0x59d497});}});}});return 0xa;}var _0xa18a1=function(_0x1e5607){return new BPromise(function(_0x10a72b,_0x4e3d4d){_0x108d7e(_0x1e5607,_0x2c5156)['then'](function(_0xe00c40){_0x2c5156[_0x817d('0x22')]=_0xe00c40[_0x817d('0x25')];_0x42a554[_0x817d('0x27')][_0x817d('0x1e')]({'where':{'phone':_0x2c5156[_0x817d('0xd')],'CampaignId':_0x1e5607['id']}})[_0x817d('0x1f')](function(_0x54f958){if(!_[_0x817d('0x20')](_0x54f958)){throw new Error(_0x817d('0x2c')+_0x2c5156['phone']+_0x817d('0x33')+_0x1e5607['id']);}return _0x42a554[_0x817d('0x27')][_0x817d('0x34')]({'phone':_0x2c5156[_0x817d('0xd')],'ContactId':_0x2c5156['id'],'ListId':_0x2c5156[_0x817d('0x28')],'priority':_0x2c5156[_0x817d('0x29')]?_0x2c5156[_0x817d('0x29')]:0x2,'scheduledat':_0x2c5156[_0x817d('0x22')]?_0x2c5156['scheduledat']:moment()[_0x817d('0x24')](_0x817d('0x1b')),'callback':_0x2c5156[_0x817d('0x2a')]?!![]:![],'callbackuniqueid':_0x2c5156['callbackUniqueid']?_0x2c5156[_0x817d('0x2a')]:undefined,'callbackat':_0x2c5156[_0x817d('0x2a')]?moment()[_0x817d('0x24')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x1e5607['id']});})[_0x817d('0x2b')](function(_0x51a5b7){_0x4e3d4d(_0x51a5b7);});});});};var _0x3fe375=function(_0x3a6297){return new BPromise(function(_0x2d5971,_0x1dd6a8){_0x108d7e(_0x3a6297,_0x2c5156)['then'](function(_0x5f2db4){_0x2c5156['scheduledat']=_0x5f2db4[_0x817d('0x25')];_0x42a554['CmHopper']['findOne']({'where':{'phone':_0x2c5156[_0x817d('0xd')],'CampaignId':_0x3a6297['id']}})['then'](function(_0x3d6bf4){if(!_[_0x817d('0x20')](_0x3d6bf4)){throw new Error(_0x817d('0x2c')+_0x2c5156['phone']+_0x817d('0x35')+_0x3a6297['id']);}return _0x42a554[_0x817d('0x2e')][_0x817d('0x1e')]({'where':{'calleridnum':_0x2c5156[_0x817d('0xd')],'CampaignId':_0x3a6297['id']}});})[_0x817d('0x1f')](function(_0x4a442f){if(!_[_0x817d('0x20')](_0x4a442f)){throw new Error(_0x817d('0x2f')+_0x2c5156[_0x817d('0xd')]+_0x817d('0x36')+_0x3a6297['id']);}return _0x42a554['CmHopper'][_0x817d('0x34')]({'phone':_0x2c5156[_0x817d('0xd')],'ContactId':_0x2c5156['id'],'ListId':_0x2c5156[_0x817d('0x28')],'priority':_0x2c5156[_0x817d('0x29')]?_0x2c5156['priority']:0x2,'scheduledat':_0x2c5156[_0x817d('0x22')]?_0x2c5156[_0x817d('0x22')]:moment()[_0x817d('0x24')](_0x817d('0x1b')),'callback':_0x2c5156[_0x817d('0x2a')]?!![]:![],'callbackuniqueid':_0x2c5156['callbackUniqueid']?_0x2c5156['callbackUniqueid']:undefined,'callbackat':_0x2c5156[_0x817d('0x2a')]?moment()[_0x817d('0x24')](_0x817d('0x1b')):undefined,'CampaignId':_0x3a6297['id']});})['catch'](function(_0x8c3e88){_0x1dd6a8(_0x8c3e88);});});});};if(_0x2c5156[_0x817d('0x28')]){_0x42a554[_0x817d('0x1d')][_0x817d('0x37')]({'where':{'type':_0x817d('0x38')},'attributes':['id','dialCheckDuplicateType',_0x817d('0x1c')],'include':[{'model':_0x42a554[_0x817d('0x39')],'as':_0x817d('0x3a'),'where':{'id':_0x2c5156['ListId']}}]})['then'](function(_0x6e4a6d){if(_0x6e4a6d){var _0x1a10b8=[];for(var _0x4a9d6f=0x0,_0x2bd30b;_0x4a9d6f<_0x6e4a6d[_0x817d('0x3b')];_0x4a9d6f+=0x1){_0x2bd30b=_0x6e4a6d[_0x4a9d6f]['get']({'plain':!![]});switch(_0x2bd30b[_0x817d('0x3c')]){case'always':_0x17c97c(_0x2bd30b)[_0x817d('0x2b')](_0x3d71da());break;case _0x817d('0x3d'):_0x5cb44e(_0x2bd30b)[_0x817d('0x2b')](_0x3d71da());break;default:_0x108d7e(_0x2bd30b,_0x2c5156)[_0x817d('0x1f')](function(_0x32c71a){_0x2c5156['scheduledat']=_0x32c71a['ret'];_0x42a554['CmHopper'][_0x817d('0x34')]({'phone':_0x2c5156[_0x817d('0xd')],'ContactId':_0x2c5156['id'],'ListId':_0x2c5156[_0x817d('0x28')],'scheduledat':_0x2c5156['scheduledat']?_0x2c5156[_0x817d('0x22')]:moment()['format'](_0x817d('0x1b')),'priority':_0x2c5156[_0x817d('0x29')]?_0x2c5156[_0x817d('0x29')]:0x2,'callback':_0x2c5156['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x2c5156[_0x817d('0x2a')]?_0x2c5156[_0x817d('0x2a')]:undefined,'callbackat':_0x2c5156[_0x817d('0x2a')]?moment()[_0x817d('0x24')](_0x817d('0x1b')):undefined,'VoiceQueueId':_0x2bd30b['id']})[_0x817d('0x2b')](_0x3d71da());});}}}})['then'](function(){return _0x42a554['VoiceQueue'][_0x817d('0x37')]({'where':{'type':_0x817d('0x38')},'attributes':['id'],'include':[{'model':_0x42a554['CmList'],'as':'BlackLists','where':{'id':_0x2c5156[_0x817d('0x28')]}}]})[_0x817d('0x1f')](function(_0x317714){if(_0x317714){var _0x45f4ad=[];for(var _0x506fba=0x0,_0x96a158;_0x506fba<_0x317714[_0x817d('0x3b')];_0x506fba+=0x1){_0x96a158=_0x317714[_0x506fba][_0x817d('0x16')]({'plain':!![]});_0x42a554['CmHopperBlack'][_0x817d('0x34')]({'phone':_0x2c5156[_0x817d('0xd')],'ContactId':_0x2c5156['id'],'ListId':_0x2c5156[_0x817d('0x28')],'VoiceQueueId':_0x96a158['id']})[_0x817d('0x2b')](function(_0x253f5b){logger['error'](_0x817d('0x3e'),'afterCreate',_0x253f5b[_0x817d('0x3f')]);});}}});})[_0x817d('0x1f')](function(){return _0x42a554[_0x817d('0x40')]['findAll']({'attributes':['id','dialCheckDuplicateType',_0x817d('0x1c')],'include':[{'model':_0x42a554['CmList'],'as':_0x817d('0x3a'),'where':{'id':_0x2c5156[_0x817d('0x28')]}}]})[_0x817d('0x1f')](function(_0x1f48a8){if(_0x1f48a8){var _0x2c233d=[];for(var _0x1a1e66=0x0,_0x197010;_0x1a1e66<_0x1f48a8['length'];_0x1a1e66+=0x1){_0x197010=_0x1f48a8[_0x1a1e66][_0x817d('0x16')]({'plain':!![]});switch(_0x197010[_0x817d('0x3c')]){case _0x817d('0x41'):_0x3fe375(_0x197010)['catch'](_0x321405());break;case _0x817d('0x3d'):_0xa18a1(_0x197010)[_0x817d('0x2b')](_0x321405());break;default:_0x42a554['CmHopper'][_0x817d('0x34')]({'phone':_0x2c5156[_0x817d('0xd')],'ContactId':_0x2c5156['id'],'ListId':_0x2c5156['ListId'],'scheduledat':_0x2c5156['scheduledat']?_0x2c5156[_0x817d('0x22')]:moment()[_0x817d('0x24')](_0x817d('0x1b')),'priority':_0x2c5156[_0x817d('0x29')]?_0x2c5156[_0x817d('0x29')]:0x2,'callback':_0x2c5156[_0x817d('0x2a')]?!![]:![],'callbackuniqueid':_0x2c5156[_0x817d('0x2a')]?_0x2c5156['callbackUniqueid']:undefined,'callbackat':_0x2c5156[_0x817d('0x2a')]?moment()[_0x817d('0x24')](_0x817d('0x1b')):undefined,'CampaignId':_0x197010['id']})[_0x817d('0x2b')](_0x321405());}}}});})[_0x817d('0x1f')](function(){return _0x42a554[_0x817d('0x40')][_0x817d('0x37')]({'attributes':['id'],'include':[{'model':_0x42a554['CmList'],'as':_0x817d('0x42'),'where':{'id':_0x2c5156[_0x817d('0x28')]}}]})[_0x817d('0x1f')](function(_0x27ed47){if(_0x27ed47){var _0x5e048f=[];for(var _0xb4b597=0x0,_0x5292c3;_0xb4b597<_0x27ed47[_0x817d('0x3b')];_0xb4b597+=0x1){_0x5292c3=_0x27ed47[_0xb4b597][_0x817d('0x16')]({'plain':!![]});_0x42a554['CmHopperBlack'][_0x817d('0x34')]({'phone':_0x2c5156[_0x817d('0xd')],'ContactId':_0x2c5156['id'],'ListId':_0x2c5156['ListId'],'CampaignId':_0x5292c3['id']})[_0x817d('0x2b')](function(_0x29025e){logger['error'](_0x817d('0x3e'),_0x817d('0x19'),_0x29025e[_0x817d('0x3f')]);});}}});})['then'](function(){_0x3143f1();})[_0x817d('0x2b')](function(_0xd55bd7){logger[_0x817d('0x17')](_0x817d('0x3e'),_0x817d('0x19'),_0xd55bd7[_0x817d('0x3f')]);_0x3143f1(_0xd55bd7);});}else{_0x3143f1(new Error(_0x817d('0x43')));}},'afterDestroy':function(_0xbfae96,_0x4e6daf,_0x3f1122){var _0x4f905f=_0x5c236d['models'];var _0x239c0d=_0xbfae96[_0x817d('0x16')]({'plain':!![]});return _0x4f905f['CmHopper'][_0x817d('0x37')]({'raw':!![],'where':{'ListId':_0x239c0d[_0x817d('0x28')],'ContactId':_0x239c0d['id']}})[_0x817d('0x1f')](function(_0x4c2f20){if(!_[_0x817d('0x44')](_0x4c2f20)){var _0x3f9997=[];for(var _0x128c8f=0x0;_0x128c8f<_0x4c2f20[_0x817d('0x3b')];_0x128c8f+=0x1){var _0x20179f=_0x4f905f['CmHopper']['destroy']({'where':{'ListId':_0x4c2f20[_0x128c8f][_0x817d('0x28')],'ContactId':_0x4c2f20[_0x128c8f][_0x817d('0x45')],'VoiceQueueId':_0x4c2f20[_0x128c8f]['VoiceQueueId'],'CampaignId':_0x4c2f20[_0x128c8f][_0x817d('0x46')]}});_0x3f9997['push'](_0x20179f);}return BPromise[_0x817d('0x47')](_0x3f9997);}})[_0x817d('0x1f')](function(_0xf58b34){logger[_0x817d('0x48')](_0x817d('0x49'),util[_0x817d('0x1a')](_0xf58b34,{'showHidden':![],'depth':null}));_0x3f1122();})[_0x817d('0x2b')](function(_0x1bca04){logger[_0x817d('0x17')]('[CmContact][afterDestroy][Error]',util['inspect'](_0x1bca04,{'showHidden':![],'depth':null}));_0x3f1122(_0x1bca04);});}}});};
\ No newline at end of file
+var _0x5d95=['dialCheckDuplicateType','CmList','Lists','length','always','onlyIfOpen','CmHopperBlack','cmContact,\x20%s,\x20%s','message','Campaign','List\x20not\x20found','destroy','ContactId','VoiceQueueId','CampaignId','all','lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./cmContact.attributes','exports','define','CmContact','cm_contacts','phone','fti_cm_contacts','lastName','fax','utf8mb4','utf8mb4_unicode_ci','models','get','scheduledat','format','YYYY-MM-DD\x20HH:mm:ss','isNil','VoiceQueue','findOne','dialTimezone','timezones','utcOffset','add','minutes','then','ret','CmHopper','cmContact,\x20afterCreate\x20','create','ListId','priority','callbackUniqueid','catch','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','cmContact,\x20afterCreate,\x20','error','afterCreate','inspect','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20','findAll','outbound'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x5d95,0x1de));var _0x55d9=function(_0x5fd687,_0x46d9d2){_0x5fd687=_0x5fd687-0x0;var _0x4188cf=_0x5d95[_0x5fd687];return _0x4188cf;};'use strict';var _=require(_0x55d9('0x0'));var util=require(_0x55d9('0x1'));var logger=require('../../config/logger')(_0x55d9('0x2'));var moment=require('moment');var BPromise=require(_0x55d9('0x3'));var rp=require(_0x55d9('0x4'));var fs=require('fs');var path=require(_0x55d9('0x5'));var rimraf=require(_0x55d9('0x6'));var config=require(_0x55d9('0x7'));var shared=require('../../config/environment/shared');var attributes=require(_0x55d9('0x8'));module[_0x55d9('0x9')]=function(_0x583ecf,_0x366cb8){return _0x583ecf[_0x55d9('0xa')](_0x55d9('0xb'),attributes,{'tableName':_0x55d9('0xc'),'paranoid':!![],'indexes':[{'name':'phone','fields':[_0x55d9('0xd')]},{'name':_0x55d9('0xe'),'fields':['firstName',_0x55d9('0xf'),'phone','mobile',_0x55d9('0x10'),'email'],'type':'FULLTEXT'}],'timestamps':!![],'charset':_0x55d9('0x11'),'collate':_0x55d9('0x12'),'hooks':{'afterCreate':function(_0x2e1ba4,_0xbd1c86,_0x5a71d6){var _0x249036=_0x583ecf[_0x55d9('0x13')];var _0x24ced2=_0x2e1ba4[_0x55d9('0x14')]({'plain':!![]});function _0x159d52(){return function(_0x41ec6f){logger['error']('cmContact','afterCreate',util['inspect'](_0x41ec6f,{'showHidden':![],'depth':null}));};}function _0x114474(_0x4c067e,_0x3dcc46){var _0x3846a4=_0x3dcc46['scheduledat']?_0x3dcc46[_0x55d9('0x15')]:moment()[_0x55d9('0x16')](_0x55d9('0x17'));return new BPromise(function(_0xf2d317,_0x11dd43){if(_[_0x55d9('0x18')](_0x3dcc46['dialTimezone'])){_0xf2d317({'ret':_0x3846a4});}else{_0x249036[_0x55d9('0x19')][_0x55d9('0x1a')]({'where':{'id':_0x4c067e['id']}})['then'](function(_0x281744){if(!_['isNil'](_0x281744)){var _0x248db1=_0x281744[_0x55d9('0x1b')];if(!_[_0x55d9('0x18')](_0x248db1)){var _0x5f16a4=shared[_0x55d9('0x1c')];var _0x5a8466=_0x5f16a4[_0x248db1];var _0x49b280=_0x5f16a4[_0x3dcc46[_0x55d9('0x1b')]];if(!_['isNil'](_0x5a8466)&&!_[_0x55d9('0x18')](_0x49b280)){var _0x1d40c1=_0x5a8466['utcOffset']-_0x49b280[_0x55d9('0x1d')];_0x3846a4=_0x3dcc46[_0x55d9('0x15')]?_0x3dcc46[_0x55d9('0x15')]:moment();var _0x6da16d=moment(_0x3846a4)[_0x55d9('0x1e')](_0x1d40c1,_0x55d9('0x1f'));_0xf2d317({'ret':_0x6da16d[_0x55d9('0x16')](_0x55d9('0x17'))});}else _0xf2d317({'ret':_0x3846a4});}else _0xf2d317({'ret':_0x3846a4});}else{_0xf2d317({'ret':_0x3846a4});}});}});return 0xa;}var _0x4c1feb=function(_0x18937d){return new BPromise(function(_0x13be96,_0x1975b8){_0x114474(_0x18937d,_0x24ced2)[_0x55d9('0x20')](function(_0x31ab72){_0x24ced2[_0x55d9('0x15')]=_0x31ab72[_0x55d9('0x21')];_0x249036[_0x55d9('0x22')][_0x55d9('0x1a')]({'where':{'phone':_0x24ced2[_0x55d9('0xd')],'VoiceQueueId':_0x18937d['id']}})['then'](function(_0x4abcf5){if(!_[_0x55d9('0x18')](_0x4abcf5)){throw new Error(_0x55d9('0x23')+_0x24ced2[_0x55d9('0xd')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20'+_0x18937d['id']);}return _0x249036[_0x55d9('0x22')][_0x55d9('0x24')]({'phone':_0x24ced2['phone'],'ContactId':_0x24ced2['id'],'ListId':_0x24ced2[_0x55d9('0x25')],'priority':_0x24ced2[_0x55d9('0x26')]?_0x24ced2[_0x55d9('0x26')]:0x2,'scheduledat':_0x24ced2['scheduledat']?_0x24ced2[_0x55d9('0x15')]:moment()['format'](_0x55d9('0x17')),'callback':_0x24ced2['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x24ced2[_0x55d9('0x27')]?_0x24ced2[_0x55d9('0x27')]:undefined,'callbackat':_0x24ced2[_0x55d9('0x27')]?moment()[_0x55d9('0x16')](_0x55d9('0x17')):undefined,'VoiceQueueId':_0x18937d['id']});})[_0x55d9('0x28')](function(_0x1742c0){_0x1975b8(_0x1742c0);});});});};var _0xce4d79=function(_0xe9f90b){return new BPromise(function(_0x44f76c,_0x5ac769){_0x114474(_0xe9f90b,_0x24ced2)[_0x55d9('0x20')](function(_0x1663ec){_0x24ced2[_0x55d9('0x15')]=_0x1663ec['ret'];_0x249036[_0x55d9('0x22')][_0x55d9('0x1a')]({'where':{'phone':_0x24ced2[_0x55d9('0xd')],'VoiceQueueId':_0xe9f90b['id']}})['then'](function(_0x453dab){if(!_[_0x55d9('0x18')](_0x453dab)){throw new Error(_0x55d9('0x23')+_0x24ced2[_0x55d9('0xd')]+_0x55d9('0x29')+_0xe9f90b['id']);}return _0x249036['CmHopperFinal']['findOne']({'where':{'calleridnum':_0x24ced2[_0x55d9('0xd')],'VoiceQueueId':_0xe9f90b['id']}});})['then'](function(_0x2d33ef){if(!_[_0x55d9('0x18')](_0x2d33ef)){throw new Error(_0x55d9('0x2a')+_0x24ced2[_0x55d9('0xd')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20'+_0xe9f90b['id']);}return _0x249036[_0x55d9('0x22')]['create']({'phone':_0x24ced2[_0x55d9('0xd')],'ContactId':_0x24ced2['id'],'ListId':_0x24ced2['ListId'],'priority':_0x24ced2[_0x55d9('0x26')]?_0x24ced2[_0x55d9('0x26')]:0x2,'scheduledat':_0x24ced2[_0x55d9('0x15')]?_0x24ced2[_0x55d9('0x15')]:moment()[_0x55d9('0x16')](_0x55d9('0x17')),'callback':_0x24ced2[_0x55d9('0x27')]?!![]:![],'callbackuniqueid':_0x24ced2['callbackUniqueid']?_0x24ced2[_0x55d9('0x27')]:undefined,'callbackat':_0x24ced2[_0x55d9('0x27')]?moment()[_0x55d9('0x16')](_0x55d9('0x17')):undefined,'VoiceQueueId':_0xe9f90b['id']});})['catch'](function(_0x28dda1){_0x5ac769(_0x28dda1);});});});};function _0x9d8520(){return function(_0x3b460b){logger[_0x55d9('0x2b')]('cmContact',_0x55d9('0x2c'),util[_0x55d9('0x2d')](_0x3b460b,{'showHidden':![],'depth':null}));};}function _0x122eff(_0x42d315,_0x32ba55){var _0x1ceb00=_0x32ba55['scheduledat']?_0x32ba55[_0x55d9('0x15')]:moment()[_0x55d9('0x16')](_0x55d9('0x17'));return new BPromise(function(_0x511251,_0x519b06){if(_['isNil'](_0x32ba55['dialTimezone'])){_0x511251({'ret':_0x1ceb00});}else{_0x249036['Campaign'][_0x55d9('0x1a')]({'where':{'id':_0x42d315['id']}})[_0x55d9('0x20')](function(_0x1377d3){if(!_[_0x55d9('0x18')](_0x1377d3)){var _0x4548a0=_0x1377d3[_0x55d9('0x1b')];if(!_[_0x55d9('0x18')](_0x4548a0)){var _0x288e7e=shared[_0x55d9('0x1c')];var _0x14404c=_0x288e7e[_0x4548a0];var _0x574287=_0x288e7e[_0x32ba55['dialTimezone']];if(!_[_0x55d9('0x18')](_0x14404c)&&!_[_0x55d9('0x18')](_0x574287)){var _0x55a110=_0x14404c[_0x55d9('0x1d')]-_0x574287['utcOffset'];_0x1ceb00=_0x32ba55[_0x55d9('0x15')]?_0x32ba55[_0x55d9('0x15')]:moment();var _0x1af0cd=moment(_0x1ceb00)[_0x55d9('0x1e')](_0x55a110,_0x55d9('0x1f'));_0x511251({'ret':_0x1af0cd[_0x55d9('0x16')](_0x55d9('0x17'))});}else _0x511251({'ret':_0x1ceb00});}else _0x511251({'ret':_0x1ceb00});}else{_0x511251({'ret':_0x1ceb00});}});}});return 0xa;}var _0x3b8ab9=function(_0x28f7eb){return new BPromise(function(_0x47d730,_0x2084ed){_0x122eff(_0x28f7eb,_0x24ced2)[_0x55d9('0x20')](function(_0x4518df){_0x24ced2[_0x55d9('0x15')]=_0x4518df['ret'];_0x249036['CmHopper']['findOne']({'where':{'phone':_0x24ced2[_0x55d9('0xd')],'CampaignId':_0x28f7eb['id']}})['then'](function(_0xffcf2d){if(!_[_0x55d9('0x18')](_0xffcf2d)){throw new Error('cmContact,\x20afterCreate\x20'+_0x24ced2[_0x55d9('0xd')]+_0x55d9('0x2e')+_0x28f7eb['id']);}return _0x249036[_0x55d9('0x22')]['create']({'phone':_0x24ced2['phone'],'ContactId':_0x24ced2['id'],'ListId':_0x24ced2[_0x55d9('0x25')],'priority':_0x24ced2[_0x55d9('0x26')]?_0x24ced2[_0x55d9('0x26')]:0x2,'scheduledat':_0x24ced2[_0x55d9('0x15')]?_0x24ced2['scheduledat']:moment()[_0x55d9('0x16')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x24ced2[_0x55d9('0x27')]?!![]:![],'callbackuniqueid':_0x24ced2['callbackUniqueid']?_0x24ced2[_0x55d9('0x27')]:undefined,'callbackat':_0x24ced2[_0x55d9('0x27')]?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x28f7eb['id']});})[_0x55d9('0x28')](function(_0x1238bd){_0x2084ed(_0x1238bd);});});});};var _0x4ce641=function(_0x20dcde){return new BPromise(function(_0x4270d1,_0x109e4e){_0x122eff(_0x20dcde,_0x24ced2)['then'](function(_0x83c5b6){_0x24ced2[_0x55d9('0x15')]=_0x83c5b6[_0x55d9('0x21')];_0x249036['CmHopper']['findOne']({'where':{'phone':_0x24ced2[_0x55d9('0xd')],'CampaignId':_0x20dcde['id']}})['then'](function(_0x344a7e){if(!_[_0x55d9('0x18')](_0x344a7e)){throw new Error('cmContact,\x20afterCreate\x20'+_0x24ced2[_0x55d9('0xd')]+_0x55d9('0x2f')+_0x20dcde['id']);}return _0x249036['CmHopperFinal']['findOne']({'where':{'calleridnum':_0x24ced2[_0x55d9('0xd')],'CampaignId':_0x20dcde['id']}});})[_0x55d9('0x20')](function(_0x100c25){if(!_[_0x55d9('0x18')](_0x100c25)){throw new Error(_0x55d9('0x2a')+_0x24ced2[_0x55d9('0xd')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20'+_0x20dcde['id']);}return _0x249036[_0x55d9('0x22')]['create']({'phone':_0x24ced2[_0x55d9('0xd')],'ContactId':_0x24ced2['id'],'ListId':_0x24ced2[_0x55d9('0x25')],'priority':_0x24ced2[_0x55d9('0x26')]?_0x24ced2[_0x55d9('0x26')]:0x2,'scheduledat':_0x24ced2[_0x55d9('0x15')]?_0x24ced2[_0x55d9('0x15')]:moment()[_0x55d9('0x16')](_0x55d9('0x17')),'callback':_0x24ced2['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x24ced2[_0x55d9('0x27')]?_0x24ced2[_0x55d9('0x27')]:undefined,'callbackat':_0x24ced2['callbackUniqueid']?moment()[_0x55d9('0x16')](_0x55d9('0x17')):undefined,'CampaignId':_0x20dcde['id']});})[_0x55d9('0x28')](function(_0xc04c35){_0x109e4e(_0xc04c35);});});});};if(_0x24ced2[_0x55d9('0x25')]){_0x249036['VoiceQueue'][_0x55d9('0x30')]({'where':{'type':_0x55d9('0x31')},'attributes':['id',_0x55d9('0x32'),_0x55d9('0x1b')],'include':[{'model':_0x249036[_0x55d9('0x33')],'as':_0x55d9('0x34'),'where':{'id':_0x24ced2[_0x55d9('0x25')]}}]})[_0x55d9('0x20')](function(_0x39b3f5){if(_0x39b3f5){var _0x54d9a7=[];for(var _0x10b757=0x0,_0x4b2054;_0x10b757<_0x39b3f5[_0x55d9('0x35')];_0x10b757+=0x1){_0x4b2054=_0x39b3f5[_0x10b757][_0x55d9('0x14')]({'plain':!![]});switch(_0x4b2054[_0x55d9('0x32')]){case _0x55d9('0x36'):_0xce4d79(_0x4b2054)[_0x55d9('0x28')](_0x159d52());break;case _0x55d9('0x37'):_0x4c1feb(_0x4b2054)[_0x55d9('0x28')](_0x159d52());break;default:_0x122eff(_0x4b2054,_0x24ced2)[_0x55d9('0x20')](function(_0x206f1a){_0x24ced2[_0x55d9('0x15')]=_0x206f1a[_0x55d9('0x21')];_0x249036['CmHopper']['create']({'phone':_0x24ced2[_0x55d9('0xd')],'ContactId':_0x24ced2['id'],'ListId':_0x24ced2[_0x55d9('0x25')],'scheduledat':_0x24ced2[_0x55d9('0x15')]?_0x24ced2[_0x55d9('0x15')]:moment()['format'](_0x55d9('0x17')),'priority':_0x24ced2[_0x55d9('0x26')]?_0x24ced2['priority']:0x2,'callback':_0x24ced2[_0x55d9('0x27')]?!![]:![],'callbackuniqueid':_0x24ced2[_0x55d9('0x27')]?_0x24ced2[_0x55d9('0x27')]:undefined,'callbackat':_0x24ced2['callbackUniqueid']?moment()[_0x55d9('0x16')](_0x55d9('0x17')):undefined,'VoiceQueueId':_0x4b2054['id']})[_0x55d9('0x28')](_0x159d52());});}}}})[_0x55d9('0x20')](function(){return _0x249036[_0x55d9('0x19')][_0x55d9('0x30')]({'where':{'type':_0x55d9('0x31')},'attributes':['id'],'include':[{'model':_0x249036[_0x55d9('0x33')],'as':'BlackLists','where':{'id':_0x24ced2[_0x55d9('0x25')]}}]})['then'](function(_0x5e7bbb){if(_0x5e7bbb){var _0x5edc94=[];for(var _0x2b04cc=0x0,_0x5a2042;_0x2b04cc<_0x5e7bbb['length'];_0x2b04cc+=0x1){_0x5a2042=_0x5e7bbb[_0x2b04cc]['get']({'plain':!![]});_0x249036[_0x55d9('0x38')][_0x55d9('0x24')]({'phone':_0x24ced2[_0x55d9('0xd')],'ContactId':_0x24ced2['id'],'ListId':_0x24ced2[_0x55d9('0x25')],'VoiceQueueId':_0x5a2042['id']})[_0x55d9('0x28')](function(_0x5ec0a9){logger['error'](_0x55d9('0x39'),_0x55d9('0x2c'),_0x5ec0a9[_0x55d9('0x3a')]);});}}});})[_0x55d9('0x20')](function(){return _0x249036[_0x55d9('0x3b')][_0x55d9('0x30')]({'attributes':['id','dialCheckDuplicateType',_0x55d9('0x1b')],'include':[{'model':_0x249036[_0x55d9('0x33')],'as':_0x55d9('0x34'),'where':{'id':_0x24ced2['ListId']}}]})[_0x55d9('0x20')](function(_0x30e76e){if(_0x30e76e){var _0x4e9132=[];for(var _0x324a48=0x0,_0x400a5a;_0x324a48<_0x30e76e['length'];_0x324a48+=0x1){_0x400a5a=_0x30e76e[_0x324a48]['get']({'plain':!![]});switch(_0x400a5a[_0x55d9('0x32')]){case _0x55d9('0x36'):_0x4ce641(_0x400a5a)[_0x55d9('0x28')](_0x9d8520());break;case'onlyIfOpen':_0x3b8ab9(_0x400a5a)[_0x55d9('0x28')](_0x9d8520());break;default:_0x249036[_0x55d9('0x22')][_0x55d9('0x24')]({'phone':_0x24ced2[_0x55d9('0xd')],'ContactId':_0x24ced2['id'],'ListId':_0x24ced2[_0x55d9('0x25')],'scheduledat':_0x24ced2[_0x55d9('0x15')]?_0x24ced2[_0x55d9('0x15')]:moment()[_0x55d9('0x16')]('YYYY-MM-DD\x20HH:mm:ss'),'priority':_0x24ced2[_0x55d9('0x26')]?_0x24ced2[_0x55d9('0x26')]:0x2,'callback':_0x24ced2[_0x55d9('0x27')]?!![]:![],'callbackuniqueid':_0x24ced2[_0x55d9('0x27')]?_0x24ced2[_0x55d9('0x27')]:undefined,'callbackat':_0x24ced2['callbackUniqueid']?moment()[_0x55d9('0x16')](_0x55d9('0x17')):undefined,'CampaignId':_0x400a5a['id']})[_0x55d9('0x28')](_0x9d8520());}}}});})['then'](function(){return _0x249036['Campaign']['findAll']({'attributes':['id'],'include':[{'model':_0x249036[_0x55d9('0x33')],'as':'BlackLists','where':{'id':_0x24ced2[_0x55d9('0x25')]}}]})['then'](function(_0x17cfb3){if(_0x17cfb3){var _0x533303=[];for(var _0x18adb8=0x0,_0x50a6bc;_0x18adb8<_0x17cfb3['length'];_0x18adb8+=0x1){_0x50a6bc=_0x17cfb3[_0x18adb8][_0x55d9('0x14')]({'plain':!![]});_0x249036[_0x55d9('0x38')][_0x55d9('0x24')]({'phone':_0x24ced2[_0x55d9('0xd')],'ContactId':_0x24ced2['id'],'ListId':_0x24ced2[_0x55d9('0x25')],'CampaignId':_0x50a6bc['id']})[_0x55d9('0x28')](function(_0x4f95a2){logger[_0x55d9('0x2b')](_0x55d9('0x39'),_0x55d9('0x2c'),_0x4f95a2[_0x55d9('0x3a')]);});}}});})[_0x55d9('0x20')](function(){_0x5a71d6();})[_0x55d9('0x28')](function(_0x476165){logger[_0x55d9('0x2b')](_0x55d9('0x39'),_0x55d9('0x2c'),_0x476165['message']);_0x5a71d6(_0x476165);});}else{_0x5a71d6(new Error(_0x55d9('0x3c')));}},'afterDestroy':function(_0x1612ea,_0x16ed90,_0x13647a){var _0x759f45=_0x583ecf['models'];var _0x579bba=_0x1612ea['get']({'plain':!![]});return _0x759f45[_0x55d9('0x22')][_0x55d9('0x30')]({'raw':!![],'where':{'ListId':_0x579bba['ListId'],'ContactId':_0x579bba['id']}})[_0x55d9('0x20')](function(_0x43bc4e){if(!_['isEmpty'](_0x43bc4e)){var _0x3227cf=[];for(var _0x3759dc=0x0;_0x3759dc<_0x43bc4e['length'];_0x3759dc+=0x1){var _0x3ef7a4=_0x759f45['CmHopper'][_0x55d9('0x3d')]({'where':{'ListId':_0x43bc4e[_0x3759dc]['ListId'],'ContactId':_0x43bc4e[_0x3759dc][_0x55d9('0x3e')],'VoiceQueueId':_0x43bc4e[_0x3759dc][_0x55d9('0x3f')],'CampaignId':_0x43bc4e[_0x3759dc][_0x55d9('0x40')]}});_0x3227cf['push'](_0x3ef7a4);}return BPromise[_0x55d9('0x41')](_0x3227cf);}})[_0x55d9('0x20')](function(_0x21c701){logger['info']('[CmContact][afterDestroy][Succesfull]',util['inspect'](_0x21c701,{'showHidden':![],'depth':null}));_0x13647a();})[_0x55d9('0x28')](function(_0x16777e){logger[_0x55d9('0x2b')]('[CmContact][afterDestroy][Error]',util['inspect'](_0x16777e,{'showHidden':![],'depth':null}));_0x13647a(_0x16777e);});}}});};
\ No newline at end of file
index c23f5c6..efce196 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['include','model','length','CmContactHasItem','find','ListId','Contact','isNil','CmContactId','CmContact','catch','CreateCmContact','create','body','keys','startsWith','cf_','table','cm_contacts','set','where','id\x20=\x20?','toString','sequelize','query','lodash','util','moment','bluebird','ioredis','squel','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','./cmContact.socket','register','request','then','info','CmContact,\x20%s,\x20%s','request\x20sent','debug','CmContact,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','GetCmContact','findAll','options','raw','attributes','limit','map'];(function(_0x5256e2,_0x11c968){var _0x51ddf8=function(_0xe4efb7){while(--_0xe4efb7){_0x5256e2['push'](_0x5256e2['shift']());}};_0x51ddf8(++_0x11c968);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var squel=require(_0x7995('0x5'));var db=require(_0x7995('0x6'))['db'];var utils=require(_0x7995('0x7'));var logger=require('../../config/logger')(_0x7995('0x8'));var config=require(_0x7995('0x9'));var jayson=require(_0x7995('0xa'));var client=jayson[_0x7995('0xb')][_0x7995('0xc')]({'port':0x232a});config[_0x7995('0xd')]=_['defaults'](config[_0x7995('0xd')],{'host':_0x7995('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7995('0xd')]));require(_0x7995('0xf'))[_0x7995('0x10')](socket);function respondWithRpcPromise(_0x35b5fe,_0x3c1d19,_0x1e400a){return new BPromise(function(_0x341672,_0x524f7b){return client[_0x7995('0x11')](_0x35b5fe,_0x1e400a)[_0x7995('0x12')](function(_0x581f22){logger[_0x7995('0x13')](_0x7995('0x14'),_0x3c1d19,_0x7995('0x15'));logger[_0x7995('0x16')](_0x7995('0x17'),_0x3c1d19,_0x7995('0x15'),JSON[_0x7995('0x18')](_0x581f22));if(_0x581f22['error']){if(_0x581f22['error'][_0x7995('0x19')]===0x1f4){logger[_0x7995('0x1a')](_0x7995('0x14'),_0x3c1d19,_0x581f22[_0x7995('0x1a')][_0x7995('0x1b')]);return _0x524f7b(_0x581f22[_0x7995('0x1a')][_0x7995('0x1b')]);}logger[_0x7995('0x1a')]('CmContact,\x20%s,\x20%s',_0x3c1d19,_0x581f22[_0x7995('0x1a')]['message']);return _0x341672(_0x581f22[_0x7995('0x1a')][_0x7995('0x1b')]);}else{logger[_0x7995('0x13')](_0x7995('0x14'),_0x3c1d19,_0x7995('0x15'));_0x341672(_0x581f22[_0x7995('0x1c')]['message']);}})['catch'](function(_0x2536c8){logger['error']('CmContact,\x20%s,\x20%s',_0x3c1d19,_0x2536c8);_0x524f7b(_0x2536c8);});});}exports[_0x7995('0x1d')]=function(_0x3d463e){var _0x4cbe10=this;return new Promise(function(_0x3a9b54,_0x51f276){return db['CmContact'][_0x7995('0x1e')]({'raw':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')][_0x7995('0x20')]===undefined?!![]:![]:!![],'where':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')]['where']||null:null,'attributes':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')][_0x7995('0x21')]||null:null,'limit':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')][_0x7995('0x22')]||null:null,'include':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')]['include']?_[_0x7995('0x23')](_0x3d463e[_0x7995('0x1f')][_0x7995('0x24')],function(_0x268ce7){return{'model':db[_0x268ce7[_0x7995('0x25')]],'as':_0x268ce7['as'],'attributes':_0x268ce7[_0x7995('0x21')],'include':_0x268ce7['include']?_[_0x7995('0x23')](_0x268ce7['include'],function(_0x229742){return{'model':db[_0x229742[_0x7995('0x25')]],'as':_0x229742['as'],'attributes':_0x229742[_0x7995('0x21')],'include':_0x229742[_0x7995('0x24')]?_[_0x7995('0x23')](_0x229742['include'],function(_0x9b2a15){return{'model':db[_0x9b2a15['model']],'as':_0x9b2a15['as'],'attributes':_0x9b2a15[_0x7995('0x21')]};}):[]};}):[]};}):[]:[]})[_0x7995('0x12')](function(_0x4253e5){logger['info']('GetCmContact',_0x3d463e);logger['debug'](_0x7995('0x1d'),_0x3d463e,JSON[_0x7995('0x18')](_0x4253e5));if(_0x4253e5[_0x7995('0x26')]==0x0){return db[_0x7995('0x27')][_0x7995('0x28')]({'raw':!![],'where':{'item':_0x3d463e[_0x7995('0x1f')]['phone']},'include':[{'model':db['CmContact'],'where':{'ListId':_0x3d463e[_0x7995('0x1f')]['where'][_0x7995('0x29')],'deletedAt':{'$eq':null}},'as':_0x7995('0x2a')}]})[_0x7995('0x12')](function(_0x1e9fa4){if(_[_0x7995('0x2b')](_0x1e9fa4)){_0x3a9b54(_0x4253e5);}else{var _0x510841=_0x1e9fa4[_0x7995('0x2c')];return db[_0x7995('0x2d')]['findAll']({'raw':!![],'where':{'id':_0x510841},'attributes':_0x3d463e['options']?_0x3d463e['options'][_0x7995('0x21')]||null:null})[_0x7995('0x12')](function(_0x4a176f){_0x3a9b54(_0x4a176f);});}});}else{_0x3a9b54(_0x4253e5);}})[_0x7995('0x2e')](function(_0x51b95d){logger[_0x7995('0x1a')](_0x7995('0x1d'),_0x51b95d[_0x7995('0x1b')],_0x3d463e);_0x51f276(_0x4cbe10['error'](0x1f4,_0x51b95d['message']));});});};exports[_0x7995('0x2f')]=function(_0x5e67fe){var _0x5d2428=this;return new Promise(function(_0x3e99cd,_0xe328b1){return db['CmContact'][_0x7995('0x30')](_0x5e67fe[_0x7995('0x31')],{'raw':_0x5e67fe[_0x7995('0x1f')]?_0x5e67fe[_0x7995('0x1f')][_0x7995('0x20')]===undefined?!![]:![]:!![]})['then'](function(_0x2d4285){var _0x242713;for(var _0xf612e6=0x0;_0xf612e6<Object[_0x7995('0x32')](_0x5e67fe['body'])[_0x7995('0x26')];_0xf612e6++){var _0x235df7=Object[_0x7995('0x32')](_0x5e67fe[_0x7995('0x31')])[_0xf612e6];if(_0x235df7[_0x7995('0x33')](_0x7995('0x34'))){_0x242713=squel['update']()[_0x7995('0x35')](_0x7995('0x36'))[_0x7995('0x37')](_0x235df7,_0x5e67fe[_0x7995('0x31')][_0x235df7])[_0x7995('0x38')](_0x7995('0x39'),_0x2d4285['id'])[_0x7995('0x3a')]();break;}}if(!_0x242713)return _0x2d4285;return db[_0x7995('0x3b')][_0x7995('0x3c')](_0x242713)[_0x7995('0x12')](function(){return _0x2d4285;});})[_0x7995('0x12')](function(_0x270d52){logger[_0x7995('0x13')]('CreateCmContact',_0x5e67fe);logger['debug'](_0x7995('0x2f'),_0x5e67fe,JSON[_0x7995('0x18')](_0x270d52));_0x3e99cd(_0x270d52);})['catch'](function(_0x4b0855){logger[_0x7995('0x1a')]('CreateCmContact',_0x4b0855['message'],_0x5e67fe);_0xe328b1(_0x5d2428[_0x7995('0x1a')](0x1f4,_0x4b0855[_0x7995('0x1b')]));});});};
\ No newline at end of file
+var _0x9957=['include','model','length','CmContactHasItem','find','ListId','Contact','isNil','CmContactId','CmContact','catch','CreateCmContact','create','body','keys','startsWith','cf_','table','cm_contacts','set','where','id\x20=\x20?','toString','sequelize','query','lodash','util','moment','bluebird','ioredis','squel','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','./cmContact.socket','register','request','then','info','CmContact,\x20%s,\x20%s','request\x20sent','debug','CmContact,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','GetCmContact','findAll','options','raw','attributes','limit','map'];(function(_0x24150e,_0xc3662e){var _0x1f1dfd=function(_0x4ab3da){while(--_0x4ab3da){_0x24150e['push'](_0x24150e['shift']());}};_0x1f1dfd(++_0xc3662e);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var squel=require(_0x7995('0x5'));var db=require(_0x7995('0x6'))['db'];var utils=require(_0x7995('0x7'));var logger=require('../../config/logger')(_0x7995('0x8'));var config=require(_0x7995('0x9'));var jayson=require(_0x7995('0xa'));var client=jayson[_0x7995('0xb')][_0x7995('0xc')]({'port':0x232a});config[_0x7995('0xd')]=_['defaults'](config[_0x7995('0xd')],{'host':_0x7995('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7995('0xd')]));require(_0x7995('0xf'))[_0x7995('0x10')](socket);function respondWithRpcPromise(_0x35b5fe,_0x3c1d19,_0x1e400a){return new BPromise(function(_0x341672,_0x524f7b){return client[_0x7995('0x11')](_0x35b5fe,_0x1e400a)[_0x7995('0x12')](function(_0x581f22){logger[_0x7995('0x13')](_0x7995('0x14'),_0x3c1d19,_0x7995('0x15'));logger[_0x7995('0x16')](_0x7995('0x17'),_0x3c1d19,_0x7995('0x15'),JSON[_0x7995('0x18')](_0x581f22));if(_0x581f22['error']){if(_0x581f22['error'][_0x7995('0x19')]===0x1f4){logger[_0x7995('0x1a')](_0x7995('0x14'),_0x3c1d19,_0x581f22[_0x7995('0x1a')][_0x7995('0x1b')]);return _0x524f7b(_0x581f22[_0x7995('0x1a')][_0x7995('0x1b')]);}logger[_0x7995('0x1a')]('CmContact,\x20%s,\x20%s',_0x3c1d19,_0x581f22[_0x7995('0x1a')]['message']);return _0x341672(_0x581f22[_0x7995('0x1a')][_0x7995('0x1b')]);}else{logger[_0x7995('0x13')](_0x7995('0x14'),_0x3c1d19,_0x7995('0x15'));_0x341672(_0x581f22[_0x7995('0x1c')]['message']);}})['catch'](function(_0x2536c8){logger['error']('CmContact,\x20%s,\x20%s',_0x3c1d19,_0x2536c8);_0x524f7b(_0x2536c8);});});}exports[_0x7995('0x1d')]=function(_0x3d463e){var _0x4cbe10=this;return new Promise(function(_0x3a9b54,_0x51f276){return db['CmContact'][_0x7995('0x1e')]({'raw':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')][_0x7995('0x20')]===undefined?!![]:![]:!![],'where':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')]['where']||null:null,'attributes':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')][_0x7995('0x21')]||null:null,'limit':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')][_0x7995('0x22')]||null:null,'include':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')]['include']?_[_0x7995('0x23')](_0x3d463e[_0x7995('0x1f')][_0x7995('0x24')],function(_0x268ce7){return{'model':db[_0x268ce7[_0x7995('0x25')]],'as':_0x268ce7['as'],'attributes':_0x268ce7[_0x7995('0x21')],'include':_0x268ce7['include']?_[_0x7995('0x23')](_0x268ce7['include'],function(_0x229742){return{'model':db[_0x229742[_0x7995('0x25')]],'as':_0x229742['as'],'attributes':_0x229742[_0x7995('0x21')],'include':_0x229742[_0x7995('0x24')]?_[_0x7995('0x23')](_0x229742['include'],function(_0x9b2a15){return{'model':db[_0x9b2a15['model']],'as':_0x9b2a15['as'],'attributes':_0x9b2a15[_0x7995('0x21')]};}):[]};}):[]};}):[]:[]})[_0x7995('0x12')](function(_0x4253e5){logger['info']('GetCmContact',_0x3d463e);logger['debug'](_0x7995('0x1d'),_0x3d463e,JSON[_0x7995('0x18')](_0x4253e5));if(_0x4253e5[_0x7995('0x26')]==0x0){return db[_0x7995('0x27')][_0x7995('0x28')]({'raw':!![],'where':{'item':_0x3d463e[_0x7995('0x1f')]['phone']},'include':[{'model':db['CmContact'],'where':{'ListId':_0x3d463e[_0x7995('0x1f')]['where'][_0x7995('0x29')],'deletedAt':{'$eq':null}},'as':_0x7995('0x2a')}]})[_0x7995('0x12')](function(_0x1e9fa4){if(_[_0x7995('0x2b')](_0x1e9fa4)){_0x3a9b54(_0x4253e5);}else{var _0x510841=_0x1e9fa4[_0x7995('0x2c')];return db[_0x7995('0x2d')]['findAll']({'raw':!![],'where':{'id':_0x510841},'attributes':_0x3d463e['options']?_0x3d463e['options'][_0x7995('0x21')]||null:null})[_0x7995('0x12')](function(_0x4a176f){_0x3a9b54(_0x4a176f);});}});}else{_0x3a9b54(_0x4253e5);}})[_0x7995('0x2e')](function(_0x51b95d){logger[_0x7995('0x1a')](_0x7995('0x1d'),_0x51b95d[_0x7995('0x1b')],_0x3d463e);_0x51f276(_0x4cbe10['error'](0x1f4,_0x51b95d['message']));});});};exports[_0x7995('0x2f')]=function(_0x5e67fe){var _0x5d2428=this;return new Promise(function(_0x3e99cd,_0xe328b1){return db['CmContact'][_0x7995('0x30')](_0x5e67fe[_0x7995('0x31')],{'raw':_0x5e67fe[_0x7995('0x1f')]?_0x5e67fe[_0x7995('0x1f')][_0x7995('0x20')]===undefined?!![]:![]:!![]})['then'](function(_0x2d4285){var _0x242713;for(var _0xf612e6=0x0;_0xf612e6<Object[_0x7995('0x32')](_0x5e67fe['body'])[_0x7995('0x26')];_0xf612e6++){var _0x235df7=Object[_0x7995('0x32')](_0x5e67fe[_0x7995('0x31')])[_0xf612e6];if(_0x235df7[_0x7995('0x33')](_0x7995('0x34'))){_0x242713=squel['update']()[_0x7995('0x35')](_0x7995('0x36'))[_0x7995('0x37')](_0x235df7,_0x5e67fe[_0x7995('0x31')][_0x235df7])[_0x7995('0x38')](_0x7995('0x39'),_0x2d4285['id'])[_0x7995('0x3a')]();break;}}if(!_0x242713)return _0x2d4285;return db[_0x7995('0x3b')][_0x7995('0x3c')](_0x242713)[_0x7995('0x12')](function(){return _0x2d4285;});})[_0x7995('0x12')](function(_0x270d52){logger[_0x7995('0x13')]('CreateCmContact',_0x5e67fe);logger['debug'](_0x7995('0x2f'),_0x5e67fe,JSON[_0x7995('0x18')](_0x270d52));_0x3e99cd(_0x270d52);})['catch'](function(_0x4b0855){logger[_0x7995('0x1a')]('CreateCmContact',_0x4b0855['message'],_0x5e67fe);_0xe328b1(_0x5d2428[_0x7995('0x1a')](0x1f4,_0x4b0855[_0x7995('0x1b')]));});});};
\ No newline at end of file
index 29ef2bc..098c216 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(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0xa9e0[_0x31e29a];return _0x32d892;};'use strict';var CmContactEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){CmContactEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);CmContactEvents['on'](_0x5f41ea,_0x503809);}};
\ No newline at end of file
+var _0xa9e0=['register','length','cmContact:','./cmContact.events','save','remove','emit','removeListener'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xa9e0[_0x311c35];return _0x5cc50c;};'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 422c080..9e6d2b7 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(_0x535e06,_0x39b0da){var _0x39047e=function(_0x350832){while(--_0x350832){_0x535e06['push'](_0x535e06['shift']());}};_0x39047e(++_0x39b0da);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xa9e0[_0x3947c9];return _0x2e7871;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/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(_0x19341c,_0x3abb2e){var _0x23beb2=function(_0x1a4ab8){while(--_0x1a4ab8){_0x19341c['push'](_0x19341c['shift']());}};_0x23beb2(++_0x3abb2e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0xa9e0[_0x34bc30];return _0x5706de;};'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 8c45836..44f8ff2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd66c=['STRING','sequelize','INTEGER'];(function(_0x36d221,_0x268765){var _0x15cb44=function(_0x317c54){while(--_0x317c54){_0x36d221['push'](_0x36d221['shift']());}};_0x15cb44(++_0x268765);}(_0xd66c,0x106));var _0xcd66=function(_0x41448a,_0x36b669){_0x41448a=_0x41448a-0x0;var _0x473fca=_0xd66c[_0x41448a];return _0x473fca;};'use strict';var Sequelize=require(_0xcd66('0x0'));module['exports']={'CmContactId':{'type':Sequelize[_0xcd66('0x1')],'primaryKey':!![]},'item':{'type':Sequelize[_0xcd66('0x2')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0xcd66('0x1')],'defaultValue':null},'ItemClass':{'type':Sequelize[_0xcd66('0x2')],'defaultValue':'PHONE'},'OrderBy':{'type':Sequelize[_0xcd66('0x1')],'defaultValue':null},'description':{'type':Sequelize[_0xcd66('0x2')],'defaultValue':null}};
\ No newline at end of file
+var _0xc68d=['STRING','PHONE','exports','INTEGER'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0xc68d,0x17a));var _0xdc68=function(_0x470670,_0x39fddd){_0x470670=_0x470670-0x0;var _0x4901ce=_0xc68d[_0x470670];return _0x4901ce;};'use strict';var Sequelize=require('sequelize');module[_0xdc68('0x0')]={'CmContactId':{'type':Sequelize[_0xdc68('0x1')],'primaryKey':!![]},'item':{'type':Sequelize['STRING'],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize['INTEGER'],'defaultValue':null},'ItemClass':{'type':Sequelize[_0xdc68('0x2')],'defaultValue':_0xdc68('0x3')},'OrderBy':{'type':Sequelize[_0xdc68('0x1')],'defaultValue':null},'description':{'type':Sequelize[_0xdc68('0x2')],'defaultValue':null}};
\ No newline at end of file
index 9061410..7dae0f8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf572=['Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','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','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','CmContactHasItems','UserProfileResource','name','send','index','CmContactHasItem','rawAttributes','key','model','map','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filters','pick','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body'];(function(_0x127129,_0x4875ec){var _0x25c971=function(_0x3c263c){while(--_0x3c263c){_0x127129['push'](_0x127129['shift']());}};_0x25c971(++_0x4875ec);}(_0xf572,0xad));var _0x2f57=function(_0x3487ae,_0x12dfeb){_0x3487ae=_0x3487ae-0x0;var _0x2a7788=_0xf572[_0x3487ae];return _0x2a7788;};'use strict';var emlformat=require(_0x2f57('0x0'));var rimraf=require(_0x2f57('0x1'));var zipdir=require(_0x2f57('0x2'));var jsonpatch=require(_0x2f57('0x3'));var rp=require('request-promise');var moment=require(_0x2f57('0x4'));var BPromise=require(_0x2f57('0x5'));var Mustache=require('mustache');var util=require(_0x2f57('0x6'));var path=require('path');var sox=require(_0x2f57('0x7'));var csv=require(_0x2f57('0x8'));var ejs=require(_0x2f57('0x9'));var fs=require('fs');var fs_extra=require(_0x2f57('0xa'));var _=require(_0x2f57('0xb'));var squel=require(_0x2f57('0xc'));var crypto=require(_0x2f57('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x2f57('0xe'));var Papa=require(_0x2f57('0xf'));var Redis=require(_0x2f57('0x10'));var authService=require(_0x2f57('0x11'));var qs=require(_0x2f57('0x12'));var as=require(_0x2f57('0x13'));var hardwareService=require(_0x2f57('0x14'));var logger=require('../../config/logger')(_0x2f57('0x15'));var utils=require('../../config/utils');var config=require(_0x2f57('0x16'));var licenseUtil=require(_0x2f57('0x17'));var db=require(_0x2f57('0x18'))['db'];function respondWithStatusCode(_0xba2760,_0x2c2f9b){_0x2c2f9b=_0x2c2f9b||0xcc;return function(_0x1fd386){if(_0x1fd386){return _0xba2760[_0x2f57('0x19')](_0x2c2f9b);}return _0xba2760[_0x2f57('0x1a')](_0x2c2f9b)[_0x2f57('0x1b')]();};}function respondWithResult(_0x439117,_0xd52546){_0xd52546=_0xd52546||0xc8;return function(_0x2cc9ff){if(_0x2cc9ff){return _0x439117[_0x2f57('0x1a')](_0xd52546)[_0x2f57('0x1c')](_0x2cc9ff);}};}function respondWithFilteredResult(_0x130b53,_0xea0881){return function(_0x44a008){if(_0x44a008){var _0x2097ea=typeof _0xea0881[_0x2f57('0x1d')]==='undefined'&&typeof _0xea0881['limit']==='undefined';var _0x4517fe=_0x44a008[_0x2f57('0x1e')];var _0x59b747=_0x2097ea?0x0:_0xea0881[_0x2f57('0x1d')];var _0x570602=_0x2097ea?_0x44a008[_0x2f57('0x1e')]:_0xea0881[_0x2f57('0x1d')]+_0xea0881[_0x2f57('0x1f')];var _0x32d99f;if(_0x570602>=_0x4517fe){_0x570602=_0x4517fe;_0x32d99f=0xc8;}else{_0x32d99f=0xce;}_0x130b53[_0x2f57('0x1a')](_0x32d99f);return _0x130b53[_0x2f57('0x20')](_0x2f57('0x21'),_0x59b747+'-'+_0x570602+'/'+_0x4517fe)[_0x2f57('0x1c')](_0x44a008);}return null;};}function patchUpdates(_0x3a71cd){return function(_0x1c3b64){try{jsonpatch[_0x2f57('0x22')](_0x1c3b64,_0x3a71cd,!![]);}catch(_0x1aeee8){return BPromise[_0x2f57('0x23')](_0x1aeee8);}return _0x1c3b64[_0x2f57('0x24')]();};}function saveUpdates(_0x4c47ed,_0x125239){return function(_0x289813){if(_0x289813){return _0x289813[_0x2f57('0x25')](_0x4c47ed)[_0x2f57('0x26')](function(_0x492396){return _0x492396;});}return null;};}function removeEntity(_0xe703c,_0x8bbf94){return function(_0x2b784a){if(_0x2b784a){return _0x2b784a[_0x2f57('0x27')]()['then'](function(){var _0x4310e9=_0x2b784a[_0x2f57('0x28')]({'plain':!![]});var _0x42782b=_0x2f57('0x29');return db[_0x2f57('0x2a')][_0x2f57('0x27')]({'where':{'type':_0x42782b,'resourceId':_0x4310e9['id']}})[_0x2f57('0x26')](function(){return _0x2b784a;});})['then'](function(){_0xe703c[_0x2f57('0x1a')](0xcc)[_0x2f57('0x1b')]();});}};}function handleEntityNotFound(_0x14ed17,_0x9c489f){return function(_0xe29a47){if(!_0xe29a47){_0x14ed17['sendStatus'](0x194);}return _0xe29a47;};}function handleError(_0x40cfda,_0x1b1347){_0x1b1347=_0x1b1347||0x1f4;return function(_0x5d8e94){logger['error'](_0x5d8e94['stack']);if(_0x5d8e94['name']){delete _0x5d8e94[_0x2f57('0x2b')];}_0x40cfda['status'](_0x1b1347)[_0x2f57('0x2c')](_0x5d8e94);};}exports[_0x2f57('0x2d')]=function(_0x56f317,_0x28ee38){var _0x4659f8={},_0x130f7f={},_0x57f0cd={'count':0x0,'rows':[]};var _0x11446d=_['map'](db[_0x2f57('0x2e')][_0x2f57('0x2f')],function(_0x213f93){return{'name':_0x213f93['fieldName'],'type':_0x213f93['type'][_0x2f57('0x30')]};});_0x130f7f[_0x2f57('0x31')]=_[_0x2f57('0x32')](_0x11446d,_0x2f57('0x2b'));_0x130f7f[_0x2f57('0x33')]=_[_0x2f57('0x34')](_0x56f317[_0x2f57('0x33')]);_0x130f7f['filters']=_[_0x2f57('0x35')](_0x130f7f[_0x2f57('0x31')],_0x130f7f[_0x2f57('0x33')]);_0x4659f8[_0x2f57('0x36')]=_['intersection'](_0x130f7f[_0x2f57('0x31')],qs['fields'](_0x56f317[_0x2f57('0x33')][_0x2f57('0x37')]));_0x4659f8[_0x2f57('0x36')]=_0x4659f8[_0x2f57('0x36')]['length']?_0x4659f8[_0x2f57('0x36')]:_0x130f7f[_0x2f57('0x31')];if(!_0x56f317['query'][_0x2f57('0x38')](_0x2f57('0x39'))){_0x4659f8['limit']=qs[_0x2f57('0x1f')](_0x56f317[_0x2f57('0x33')][_0x2f57('0x1f')]);_0x4659f8[_0x2f57('0x1d')]=qs[_0x2f57('0x1d')](_0x56f317[_0x2f57('0x33')][_0x2f57('0x1d')]);}_0x4659f8['order']=qs[_0x2f57('0x3a')](_0x56f317[_0x2f57('0x33')][_0x2f57('0x3a')]);_0x4659f8[_0x2f57('0x3b')]=qs[_0x2f57('0x3c')](_[_0x2f57('0x3d')](_0x56f317[_0x2f57('0x33')],_0x130f7f['filters']),_0x11446d);if(_0x56f317['query']['filter']){_0x4659f8[_0x2f57('0x3b')]=_[_0x2f57('0x3e')](_0x4659f8[_0x2f57('0x3b')],{'$or':_['map'](_0x11446d,function(_0x1142e7){if(_0x1142e7['type']!==_0x2f57('0x3f')){var _0x397df8={};_0x397df8[_0x1142e7['name']]={'$like':'%'+_0x56f317['query']['filter']+'%'};return _0x397df8;}})});}_0x4659f8=_[_0x2f57('0x3e')]({},_0x4659f8,_0x56f317[_0x2f57('0x40')]);var _0x3876b6={'where':_0x4659f8[_0x2f57('0x3b')]};return db[_0x2f57('0x2e')]['count'](_0x3876b6)[_0x2f57('0x26')](function(_0x359805){_0x57f0cd[_0x2f57('0x1e')]=_0x359805;if(_0x56f317[_0x2f57('0x33')][_0x2f57('0x41')]){_0x4659f8[_0x2f57('0x42')]=[{'all':!![]}];}return db[_0x2f57('0x2e')][_0x2f57('0x43')](_0x4659f8);})['then'](function(_0x310bc7){_0x57f0cd[_0x2f57('0x44')]=_0x310bc7;return _0x57f0cd;})[_0x2f57('0x26')](respondWithFilteredResult(_0x28ee38,_0x4659f8))[_0x2f57('0x45')](handleError(_0x28ee38,null));};exports[_0x2f57('0x46')]=function(_0x4fd0b,_0x564399){var _0x19249c={'raw':!![],'where':{'id':_0x4fd0b[_0x2f57('0x47')]['id']}},_0x1e010f={};_0x1e010f[_0x2f57('0x31')]=_[_0x2f57('0x34')](db[_0x2f57('0x2e')][_0x2f57('0x2f')]);_0x1e010f[_0x2f57('0x33')]=_[_0x2f57('0x34')](_0x4fd0b[_0x2f57('0x33')]);_0x1e010f[_0x2f57('0x3c')]=_[_0x2f57('0x35')](_0x1e010f['model'],_0x1e010f['query']);_0x19249c[_0x2f57('0x36')]=_[_0x2f57('0x35')](_0x1e010f[_0x2f57('0x31')],qs['fields'](_0x4fd0b[_0x2f57('0x33')][_0x2f57('0x37')]));_0x19249c[_0x2f57('0x36')]=_0x19249c[_0x2f57('0x36')][_0x2f57('0x48')]?_0x19249c[_0x2f57('0x36')]:_0x1e010f[_0x2f57('0x31')];if(_0x4fd0b['query'][_0x2f57('0x41')]){_0x19249c['include']=[{'all':!![]}];}_0x19249c=_[_0x2f57('0x3e')]({},_0x19249c,_0x4fd0b['options']);return db[_0x2f57('0x2e')][_0x2f57('0x49')](_0x19249c)[_0x2f57('0x26')](handleEntityNotFound(_0x564399,null))[_0x2f57('0x26')](respondWithResult(_0x564399,null))[_0x2f57('0x45')](handleError(_0x564399,null));};exports[_0x2f57('0x4a')]=function(_0xe716f5,_0x573b05){return db[_0x2f57('0x2e')][_0x2f57('0x4a')](_0xe716f5[_0x2f57('0x4b')],{})[_0x2f57('0x26')](function(_0x1ee27f){var _0x131d56=_0xe716f5['user'][_0x2f57('0x28')]({'plain':!![]});if(!_0x131d56)throw new Error(_0x2f57('0x4c'));if(_0x131d56[_0x2f57('0x4d')]==='user'){var _0x4fc170=_0x1ee27f['get']({'plain':!![]});var _0x29d56f=_0x2f57('0x29');return db[_0x2f57('0x4e')][_0x2f57('0x49')]({'where':{'name':_0x29d56f,'userProfileId':_0x131d56[_0x2f57('0x4f')]},'raw':!![]})['then'](function(_0x2139ba){if(_0x2139ba&&_0x2139ba[_0x2f57('0x50')]===0x0){return db[_0x2f57('0x2a')][_0x2f57('0x4a')]({'name':_0x4fc170[_0x2f57('0x2b')],'resourceId':_0x4fc170['id'],'type':_0x2139ba[_0x2f57('0x2b')],'sectionId':_0x2139ba['id']},{})[_0x2f57('0x26')](function(){return _0x1ee27f;});}else{return _0x1ee27f;}})[_0x2f57('0x45')](function(_0x596b8b){logger[_0x2f57('0x51')](_0x2f57('0x52'),_0x596b8b);throw _0x596b8b;});}return _0x1ee27f;})[_0x2f57('0x26')](respondWithResult(_0x573b05,0xc9))[_0x2f57('0x45')](handleError(_0x573b05,null));};exports[_0x2f57('0x25')]=function(_0x118570,_0x2ed756){if(_0x118570[_0x2f57('0x4b')]['id']){delete _0x118570['body']['id'];}return db[_0x2f57('0x2e')][_0x2f57('0x49')]({'where':{'id':_0x118570[_0x2f57('0x47')]['id']}})['then'](handleEntityNotFound(_0x2ed756,null))[_0x2f57('0x26')](saveUpdates(_0x118570[_0x2f57('0x4b')],null))[_0x2f57('0x26')](respondWithResult(_0x2ed756,null))[_0x2f57('0x45')](handleError(_0x2ed756,null));};exports[_0x2f57('0x27')]=function(_0x363ae3,_0x53328a){return db['CmContactHasItem'][_0x2f57('0x49')]({'where':{'id':_0x363ae3[_0x2f57('0x47')]['id']}})[_0x2f57('0x26')](handleEntityNotFound(_0x53328a,null))[_0x2f57('0x26')](removeEntity(_0x53328a,null))['catch'](handleError(_0x53328a,null));};
\ No newline at end of file
+var _0x5490=['error','name','index','map','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','CmContactHasItem','rows','catch','show','params','rawAttributes','include','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','update','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','count','set','Content-Range','apply','save','destroy','then','CmContactHasItems','end'];(function(_0x33fb76,_0x450ed3){var _0x41033e=function(_0x14ed5e){while(--_0x14ed5e){_0x33fb76['push'](_0x33fb76['shift']());}};_0x41033e(++_0x450ed3);}(_0x5490,0xca));var _0x0549=function(_0x4d77cc,_0xcaf146){_0x4d77cc=_0x4d77cc-0x0;var _0x24ae59=_0x5490[_0x4d77cc];return _0x24ae59;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0549('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0549('0x1'));var rp=require(_0x0549('0x2'));var moment=require(_0x0549('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0549('0x4'));var util=require(_0x0549('0x5'));var path=require(_0x0549('0x6'));var sox=require(_0x0549('0x7'));var csv=require('to-csv');var ejs=require(_0x0549('0x8'));var fs=require('fs');var fs_extra=require(_0x0549('0x9'));var _=require(_0x0549('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x0549('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x0549('0xc'));var querystring=require(_0x0549('0xd'));var Papa=require(_0x0549('0xe'));var Redis=require(_0x0549('0xf'));var authService=require(_0x0549('0x10'));var qs=require(_0x0549('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x0549('0x12'))(_0x0549('0x13'));var utils=require(_0x0549('0x14'));var config=require(_0x0549('0x15'));var licenseUtil=require(_0x0549('0x16'));var db=require(_0x0549('0x17'))['db'];function respondWithStatusCode(_0x344e29,_0x3550a9){_0x3550a9=_0x3550a9||0xcc;return function(_0x41f82f){if(_0x41f82f){return _0x344e29[_0x0549('0x18')](_0x3550a9);}return _0x344e29[_0x0549('0x19')](_0x3550a9)['end']();};}function respondWithResult(_0x5d45cd,_0x14a044){_0x14a044=_0x14a044||0xc8;return function(_0x2bf86b){if(_0x2bf86b){return _0x5d45cd['status'](_0x14a044)[_0x0549('0x1a')](_0x2bf86b);}};}function respondWithFilteredResult(_0x414324,_0x27f993){return function(_0x1f33c1){if(_0x1f33c1){var _0x205764=typeof _0x27f993[_0x0549('0x1b')]==='undefined'&&typeof _0x27f993[_0x0549('0x1c')]==='undefined';var _0x5e622c=_0x1f33c1[_0x0549('0x1d')];var _0x3d6337=_0x205764?0x0:_0x27f993[_0x0549('0x1b')];var _0x52cd6e=_0x205764?_0x1f33c1[_0x0549('0x1d')]:_0x27f993[_0x0549('0x1b')]+_0x27f993[_0x0549('0x1c')];var _0x1c73e3;if(_0x52cd6e>=_0x5e622c){_0x52cd6e=_0x5e622c;_0x1c73e3=0xc8;}else{_0x1c73e3=0xce;}_0x414324[_0x0549('0x19')](_0x1c73e3);return _0x414324[_0x0549('0x1e')](_0x0549('0x1f'),_0x3d6337+'-'+_0x52cd6e+'/'+_0x5e622c)[_0x0549('0x1a')](_0x1f33c1);}return null;};}function patchUpdates(_0x15cc22){return function(_0x1269d4){try{jsonpatch[_0x0549('0x20')](_0x1269d4,_0x15cc22,!![]);}catch(_0x49e8c7){return BPromise['reject'](_0x49e8c7);}return _0x1269d4[_0x0549('0x21')]();};}function saveUpdates(_0x57bd61,_0xecc0fd){return function(_0x4057ac){if(_0x4057ac){return _0x4057ac['update'](_0x57bd61)['then'](function(_0x4ebd6b){return _0x4ebd6b;});}return null;};}function removeEntity(_0x45f2d0,_0x1575d2){return function(_0x23e04e){if(_0x23e04e){return _0x23e04e[_0x0549('0x22')]()[_0x0549('0x23')](function(){var _0x716aa8=_0x23e04e['get']({'plain':!![]});var _0x5e734f=_0x0549('0x24');return db['UserProfileResource'][_0x0549('0x22')]({'where':{'type':_0x5e734f,'resourceId':_0x716aa8['id']}})[_0x0549('0x23')](function(){return _0x23e04e;});})[_0x0549('0x23')](function(){_0x45f2d0[_0x0549('0x19')](0xcc)[_0x0549('0x25')]();});}};}function handleEntityNotFound(_0xfe9cc4,_0x347017){return function(_0x12bf10){if(!_0x12bf10){_0xfe9cc4[_0x0549('0x18')](0x194);}return _0x12bf10;};}function handleError(_0x343563,_0x12a8b8){_0x12a8b8=_0x12a8b8||0x1f4;return function(_0x149827){logger[_0x0549('0x26')](_0x149827['stack']);if(_0x149827[_0x0549('0x27')]){delete _0x149827[_0x0549('0x27')];}_0x343563[_0x0549('0x19')](_0x12a8b8)['send'](_0x149827);};}exports[_0x0549('0x28')]=function(_0x5306d8,_0xc0da60){var _0x1c2ded={},_0x809e6c={},_0x5b9da2={'count':0x0,'rows':[]};var _0x3d9ecf=_[_0x0549('0x29')](db['CmContactHasItem']['rawAttributes'],function(_0x39e0ea){return{'name':_0x39e0ea[_0x0549('0x2a')],'type':_0x39e0ea[_0x0549('0x2b')][_0x0549('0x2c')]};});_0x809e6c[_0x0549('0x2d')]=_[_0x0549('0x29')](_0x3d9ecf,'name');_0x809e6c[_0x0549('0x2e')]=_[_0x0549('0x2f')](_0x5306d8[_0x0549('0x2e')]);_0x809e6c[_0x0549('0x30')]=_[_0x0549('0x31')](_0x809e6c[_0x0549('0x2d')],_0x809e6c['query']);_0x1c2ded['attributes']=_[_0x0549('0x31')](_0x809e6c[_0x0549('0x2d')],qs[_0x0549('0x32')](_0x5306d8['query'][_0x0549('0x32')]));_0x1c2ded[_0x0549('0x33')]=_0x1c2ded['attributes']['length']?_0x1c2ded[_0x0549('0x33')]:_0x809e6c['model'];if(!_0x5306d8['query'][_0x0549('0x34')](_0x0549('0x35'))){_0x1c2ded[_0x0549('0x1c')]=qs['limit'](_0x5306d8[_0x0549('0x2e')][_0x0549('0x1c')]);_0x1c2ded[_0x0549('0x1b')]=qs['offset'](_0x5306d8[_0x0549('0x2e')][_0x0549('0x1b')]);}_0x1c2ded[_0x0549('0x36')]=qs[_0x0549('0x37')](_0x5306d8[_0x0549('0x2e')][_0x0549('0x37')]);_0x1c2ded[_0x0549('0x38')]=qs['filters'](_[_0x0549('0x39')](_0x5306d8[_0x0549('0x2e')],_0x809e6c[_0x0549('0x30')]),_0x3d9ecf);if(_0x5306d8['query'][_0x0549('0x3a')]){_0x1c2ded[_0x0549('0x38')]=_[_0x0549('0x3b')](_0x1c2ded[_0x0549('0x38')],{'$or':_[_0x0549('0x29')](_0x3d9ecf,function(_0x103d93){if(_0x103d93[_0x0549('0x2b')]!==_0x0549('0x3c')){var _0x5c33ad={};_0x5c33ad[_0x103d93['name']]={'$like':'%'+_0x5306d8[_0x0549('0x2e')][_0x0549('0x3a')]+'%'};return _0x5c33ad;}})});}_0x1c2ded=_[_0x0549('0x3b')]({},_0x1c2ded,_0x5306d8[_0x0549('0x3d')]);var _0x3a089d={'where':_0x1c2ded[_0x0549('0x38')]};return db[_0x0549('0x3e')][_0x0549('0x1d')](_0x3a089d)[_0x0549('0x23')](function(_0x480421){_0x5b9da2[_0x0549('0x1d')]=_0x480421;if(_0x5306d8[_0x0549('0x2e')]['includeAll']){_0x1c2ded['include']=[{'all':!![]}];}return db['CmContactHasItem']['findAll'](_0x1c2ded);})[_0x0549('0x23')](function(_0x3a3811){_0x5b9da2[_0x0549('0x3f')]=_0x3a3811;return _0x5b9da2;})[_0x0549('0x23')](respondWithFilteredResult(_0xc0da60,_0x1c2ded))[_0x0549('0x40')](handleError(_0xc0da60,null));};exports[_0x0549('0x41')]=function(_0x17850d,_0x4f4e08){var _0x55b6a1={'raw':!![],'where':{'id':_0x17850d[_0x0549('0x42')]['id']}},_0x2a1d65={};_0x2a1d65[_0x0549('0x2d')]=_[_0x0549('0x2f')](db[_0x0549('0x3e')][_0x0549('0x43')]);_0x2a1d65[_0x0549('0x2e')]=_[_0x0549('0x2f')](_0x17850d[_0x0549('0x2e')]);_0x2a1d65['filters']=_[_0x0549('0x31')](_0x2a1d65['model'],_0x2a1d65[_0x0549('0x2e')]);_0x55b6a1[_0x0549('0x33')]=_[_0x0549('0x31')](_0x2a1d65[_0x0549('0x2d')],qs[_0x0549('0x32')](_0x17850d[_0x0549('0x2e')][_0x0549('0x32')]));_0x55b6a1['attributes']=_0x55b6a1[_0x0549('0x33')]['length']?_0x55b6a1[_0x0549('0x33')]:_0x2a1d65[_0x0549('0x2d')];if(_0x17850d[_0x0549('0x2e')]['includeAll']){_0x55b6a1[_0x0549('0x44')]=[{'all':!![]}];}_0x55b6a1=_[_0x0549('0x3b')]({},_0x55b6a1,_0x17850d['options']);return db[_0x0549('0x3e')][_0x0549('0x45')](_0x55b6a1)[_0x0549('0x23')](handleEntityNotFound(_0x4f4e08,null))[_0x0549('0x23')](respondWithResult(_0x4f4e08,null))['catch'](handleError(_0x4f4e08,null));};exports['create']=function(_0x4d9554,_0x300fde){return db[_0x0549('0x3e')][_0x0549('0x46')](_0x4d9554[_0x0549('0x47')],{})[_0x0549('0x23')](function(_0x4ddef0){var _0x454137=_0x4d9554['user'][_0x0549('0x48')]({'plain':!![]});if(!_0x454137)throw new Error(_0x0549('0x49'));if(_0x454137[_0x0549('0x4a')]==='user'){var _0x55dd0a=_0x4ddef0['get']({'plain':!![]});var _0x2de78e=_0x0549('0x24');return db[_0x0549('0x4b')][_0x0549('0x45')]({'where':{'name':_0x2de78e,'userProfileId':_0x454137[_0x0549('0x4c')]},'raw':!![]})[_0x0549('0x23')](function(_0x220d8b){if(_0x220d8b&&_0x220d8b[_0x0549('0x4d')]===0x0){return db[_0x0549('0x4e')]['create']({'name':_0x55dd0a['name'],'resourceId':_0x55dd0a['id'],'type':_0x220d8b[_0x0549('0x27')],'sectionId':_0x220d8b['id']},{})[_0x0549('0x23')](function(){return _0x4ddef0;});}else{return _0x4ddef0;}})['catch'](function(_0x5b20f6){logger[_0x0549('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5b20f6);throw _0x5b20f6;});}return _0x4ddef0;})[_0x0549('0x23')](respondWithResult(_0x300fde,0xc9))[_0x0549('0x40')](handleError(_0x300fde,null));};exports[_0x0549('0x4f')]=function(_0x435ff7,_0x4060bd){if(_0x435ff7['body']['id']){delete _0x435ff7[_0x0549('0x47')]['id'];}return db[_0x0549('0x3e')][_0x0549('0x45')]({'where':{'id':_0x435ff7[_0x0549('0x42')]['id']}})[_0x0549('0x23')](handleEntityNotFound(_0x4060bd,null))['then'](saveUpdates(_0x435ff7[_0x0549('0x47')],null))[_0x0549('0x23')](respondWithResult(_0x4060bd,null))[_0x0549('0x40')](handleError(_0x4060bd,null));};exports['destroy']=function(_0x39c3bd,_0x2667fa){return db[_0x0549('0x3e')]['find']({'where':{'id':_0x39c3bd[_0x0549('0x42')]['id']}})[_0x0549('0x23')](handleEntityNotFound(_0x2667fa,null))[_0x0549('0x23')](removeEntity(_0x2667fa,null))[_0x0549('0x40')](handleError(_0x2667fa,null));};
\ No newline at end of file
index ee5dc9b..39bf84e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbfad=['../../config/environment','./cmContactHasItem.attributes','exports','define','CmContactHasItem','cm_contact_has_items','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0xbfad,0x92));var _0xdbfa=function(_0x33528e,_0x52dc7d){_0x33528e=_0x33528e-0x0;var _0xe3ee80=_0xbfad[_0x33528e];return _0xe3ee80;};'use strict';var _=require(_0xdbfa('0x0'));var util=require(_0xdbfa('0x1'));var logger=require(_0xdbfa('0x2'))(_0xdbfa('0x3'));var moment=require(_0xdbfa('0x4'));var BPromise=require(_0xdbfa('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdbfa('0x6'));var rimraf=require(_0xdbfa('0x7'));var config=require(_0xdbfa('0x8'));var attributes=require(_0xdbfa('0x9'));module[_0xdbfa('0xa')]=function(_0x7682dd,_0x3f36bf){return _0x7682dd[_0xdbfa('0xb')](_0xdbfa('0xc'),attributes,{'tableName':_0xdbfa('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x11e3=['exports','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./cmContactHasItem.attributes'];(function(_0x1a5c43,_0x16de09){var _0x3a7675=function(_0x5efc39){while(--_0x5efc39){_0x1a5c43['push'](_0x1a5c43['shift']());}};_0x3a7675(++_0x16de09);}(_0x11e3,0x1f0));var _0x311e=function(_0x5247f8,_0x3c61a4){_0x5247f8=_0x5247f8-0x0;var _0x128759=_0x11e3[_0x5247f8];return _0x128759;};'use strict';var _=require(_0x311e('0x0'));var util=require(_0x311e('0x1'));var logger=require(_0x311e('0x2'))(_0x311e('0x3'));var moment=require(_0x311e('0x4'));var BPromise=require(_0x311e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x311e('0x6'));var rimraf=require(_0x311e('0x7'));var config=require(_0x311e('0x8'));var attributes=require(_0x311e('0x9'));module[_0x311e('0xa')]=function(_0x45ec76,_0x18506e){return _0x45ec76['define']('CmContactHasItem',attributes,{'tableName':'cm_contact_has_items','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 6ba4412..f40119c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb0b4=['stringify','error','message','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','CmContactHasItem,\x20%s,\x20%s','request\x20sent','debug','CmContactHasItem,\x20%s,\x20%s,\x20%s'];(function(_0x1fde8a,_0x332835){var _0xc3a536=function(_0x535210){while(--_0x535210){_0x1fde8a['push'](_0x1fde8a['shift']());}};_0xc3a536(++_0x332835);}(_0xb0b4,0x17f));var _0x4b0b=function(_0x42abac,_0x460f73){_0x42abac=_0x42abac-0x0;var _0x3c851d=_0xb0b4[_0x42abac];return _0x3c851d;};'use strict';var _=require(_0x4b0b('0x0'));var util=require(_0x4b0b('0x1'));var moment=require('moment');var BPromise=require(_0x4b0b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4b0b('0x3'))['db'];var utils=require(_0x4b0b('0x4'));var logger=require(_0x4b0b('0x5'))(_0x4b0b('0x6'));var config=require(_0x4b0b('0x7'));var jayson=require(_0x4b0b('0x8'));var client=jayson[_0x4b0b('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3aa118,_0x53de31,_0x2c725b){return new BPromise(function(_0x42557d,_0x3afc16){return client[_0x4b0b('0xa')](_0x3aa118,_0x2c725b)[_0x4b0b('0xb')](function(_0x17523f){logger[_0x4b0b('0xc')](_0x4b0b('0xd'),_0x53de31,_0x4b0b('0xe'));logger[_0x4b0b('0xf')](_0x4b0b('0x10'),_0x53de31,_0x4b0b('0xe'),JSON[_0x4b0b('0x11')](_0x17523f));if(_0x17523f[_0x4b0b('0x12')]){if(_0x17523f[_0x4b0b('0x12')]['code']===0x1f4){logger['error']('CmContactHasItem,\x20%s,\x20%s',_0x53de31,_0x17523f[_0x4b0b('0x12')][_0x4b0b('0x13')]);return _0x3afc16(_0x17523f['error'][_0x4b0b('0x13')]);}logger['error'](_0x4b0b('0xd'),_0x53de31,_0x17523f[_0x4b0b('0x12')][_0x4b0b('0x13')]);return _0x42557d(_0x17523f[_0x4b0b('0x12')][_0x4b0b('0x13')]);}else{logger[_0x4b0b('0xc')]('CmContactHasItem,\x20%s,\x20%s',_0x53de31,_0x4b0b('0xe'));_0x42557d(_0x17523f['result'][_0x4b0b('0x13')]);}})['catch'](function(_0x1af454){logger[_0x4b0b('0x12')](_0x4b0b('0xd'),_0x53de31,_0x1af454);_0x3afc16(_0x1af454);});});}
\ No newline at end of file
+var _0xb7c7=['util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','CmContactHasItem,\x20%s,\x20%s','request\x20sent','debug','CmContactHasItem,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash'];(function(_0x4a747d,_0x3b747f){var _0x3a5b5c=function(_0x4b3e81){while(--_0x4b3e81){_0x4a747d['push'](_0x4a747d['shift']());}};_0x3a5b5c(++_0x3b747f);}(_0xb7c7,0x175));var _0x7b7c=function(_0x1f3aec,_0x24c18e){_0x1f3aec=_0x1f3aec-0x0;var _0x409f0d=_0xb7c7[_0x1f3aec];return _0x409f0d;};'use strict';var _=require(_0x7b7c('0x0'));var util=require(_0x7b7c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x7b7c('0x2'));var fs=require('fs');var Redis=require(_0x7b7c('0x3'));var db=require(_0x7b7c('0x4'))['db'];var utils=require(_0x7b7c('0x5'));var logger=require(_0x7b7c('0x6'))(_0x7b7c('0x7'));var config=require(_0x7b7c('0x8'));var jayson=require(_0x7b7c('0x9'));var client=jayson[_0x7b7c('0xa')][_0x7b7c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x455b02,_0x4f7444,_0x492999){return new BPromise(function(_0x25393d,_0x432110){return client[_0x7b7c('0xc')](_0x455b02,_0x492999)['then'](function(_0x3e0766){logger[_0x7b7c('0xd')](_0x7b7c('0xe'),_0x4f7444,_0x7b7c('0xf'));logger[_0x7b7c('0x10')](_0x7b7c('0x11'),_0x4f7444,_0x7b7c('0xf'),JSON['stringify'](_0x3e0766));if(_0x3e0766[_0x7b7c('0x12')]){if(_0x3e0766[_0x7b7c('0x12')][_0x7b7c('0x13')]===0x1f4){logger['error']('CmContactHasItem,\x20%s,\x20%s',_0x4f7444,_0x3e0766['error'][_0x7b7c('0x14')]);return _0x432110(_0x3e0766[_0x7b7c('0x12')][_0x7b7c('0x14')]);}logger[_0x7b7c('0x12')]('CmContactHasItem,\x20%s,\x20%s',_0x4f7444,_0x3e0766[_0x7b7c('0x12')][_0x7b7c('0x14')]);return _0x25393d(_0x3e0766[_0x7b7c('0x12')][_0x7b7c('0x14')]);}else{logger[_0x7b7c('0xd')](_0x7b7c('0xe'),_0x4f7444,'request\x20sent');_0x25393d(_0x3e0766['result'][_0x7b7c('0x14')]);}})[_0x7b7c('0x15')](function(_0x513041){logger[_0x7b7c('0x12')]('CmContactHasItem,\x20%s,\x20%s',_0x4f7444,_0x513041);_0x432110(_0x513041);});});}
\ No newline at end of file
index 97171f2..7b0a0b0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa63b=['exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContactHasItem.controller','get','isAuthenticated','index','/:id','show','create','put','delete','destroy'];(function(_0x2411ad,_0x2811a5){var _0x21d6c9=function(_0x331a8f){while(--_0x331a8f){_0x2411ad['push'](_0x2411ad['shift']());}};_0x21d6c9(++_0x2811a5);}(_0xa63b,0xb5));var _0xba63=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0xa63b[_0x27af45];return _0x18df21;};'use strict';var multer=require(_0xba63('0x0'));var util=require(_0xba63('0x1'));var path=require(_0xba63('0x2'));var timeout=require(_0xba63('0x3'));var express=require(_0xba63('0x4'));var router=express[_0xba63('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xba63('0x6'));var interaction=require(_0xba63('0x7'));var config=require(_0xba63('0x8'));var controller=require(_0xba63('0x9'));router[_0xba63('0xa')]('/',auth[_0xba63('0xb')](),controller[_0xba63('0xc')]);router[_0xba63('0xa')](_0xba63('0xd'),auth[_0xba63('0xb')](),controller[_0xba63('0xe')]);router['post']('/',auth[_0xba63('0xb')](),controller[_0xba63('0xf')]);router[_0xba63('0x10')]('/:id',auth[_0xba63('0xb')](),controller['update']);router[_0xba63('0x11')](_0xba63('0xd'),auth['isAuthenticated'](),controller[_0xba63('0x12')]);module[_0xba63('0x13')]=router;
\ No newline at end of file
+var _0xdae9=['../../config/environment','./cmContactHasItem.controller','get','isAuthenticated','/:id','show','create','put','update','delete','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0xb83b3a,_0xd08bd8){var _0x1d4e6a=function(_0x4da2ef){while(--_0x4da2ef){_0xb83b3a['push'](_0xb83b3a['shift']());}};_0x1d4e6a(++_0xd08bd8);}(_0xdae9,0x15e));var _0x9dae=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xdae9[_0x3b380d];return _0x54502b;};'use strict';var multer=require('multer');var util=require(_0x9dae('0x0'));var path=require('path');var timeout=require(_0x9dae('0x1'));var express=require(_0x9dae('0x2'));var router=express[_0x9dae('0x3')]();var fs_extra=require(_0x9dae('0x4'));var auth=require(_0x9dae('0x5'));var interaction=require(_0x9dae('0x6'));var config=require(_0x9dae('0x7'));var controller=require(_0x9dae('0x8'));router[_0x9dae('0x9')]('/',auth[_0x9dae('0xa')](),controller['index']);router[_0x9dae('0x9')](_0x9dae('0xb'),auth['isAuthenticated'](),controller[_0x9dae('0xc')]);router['post']('/',auth[_0x9dae('0xa')](),controller[_0x9dae('0xd')]);router[_0x9dae('0xe')]('/:id',auth[_0x9dae('0xa')](),controller[_0x9dae('0xf')]);router[_0x9dae('0x10')](_0x9dae('0xb'),auth[_0x9dae('0xa')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index af10c7c..83a17a7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9f1f=['values','isArray','stringify','BOOLEAN','ENUM','voice','sequelize','lodash','exports','VIRTUAL','alias','STRING','setDataValue','getDataValue','name','TEXT','long','type','select'];(function(_0x2bc1ae,_0x32cdf3){var _0x22af74=function(_0x238a25){while(--_0x238a25){_0x2bc1ae['push'](_0x2bc1ae['shift']());}};_0x22af74(++_0x32cdf3);}(_0x9f1f,0xc4));var _0xf9f1=function(_0x9c2427,_0x17c865){_0x9c2427=_0x9c2427-0x0;var _0x51984f=_0x9f1f[_0x9c2427];return _0x51984f;};'use strict';var Sequelize=require(_0xf9f1('0x0'));var _=require(_0xf9f1('0x1'));module[_0xf9f1('0x2')]={'name':{'type':Sequelize[_0xf9f1('0x3')],'get':function(_0xe89331){return this['getDataValue'](_0xf9f1('0x4'));}},'alias':{'type':Sequelize[_0xf9f1('0x5')],'allowNull':![],'set':function(_0x6b1846){this[_0xf9f1('0x6')](_0xf9f1('0x4'),_0x6b1846?_0x6b1846:this[_0xf9f1('0x7')](_0xf9f1('0x8')));}},'type':{'type':Sequelize[_0xf9f1('0x5')],'allowNull':![]},'values':{'type':Sequelize[_0xf9f1('0x9')](_0xf9f1('0xa')),'get':function(){if(this[_0xf9f1('0x7')](_0xf9f1('0xb'))===_0xf9f1('0xc')){return JSON['parse'](this[_0xf9f1('0x7')](_0xf9f1('0xd')));}else{return this['getDataValue']('values');}},'set':function(_0x345b8d){if(Array[_0xf9f1('0xe')](_0x345b8d)){this[_0xf9f1('0x6')](_0xf9f1('0xd'),JSON[_0xf9f1('0xf')](_0x345b8d));}else{this[_0xf9f1('0x6')](_0xf9f1('0xd'),_0x345b8d);}}},'required':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0xf9f1('0x10')],'defaultValue':![]},'actionType':{'type':Sequelize[_0xf9f1('0x11')](_0xf9f1('0x12'))}};
\ No newline at end of file
+var _0x55e3=['VIRTUAL','getDataValue','STRING','setDataValue','alias','name','long','type','select','parse','values','isArray','stringify','BOOLEAN','ENUM','sequelize','lodash','exports'];(function(_0x122091,_0x2fb0dc){var _0x28b9ca=function(_0x1577e6){while(--_0x1577e6){_0x122091['push'](_0x122091['shift']());}};_0x28b9ca(++_0x2fb0dc);}(_0x55e3,0x177));var _0x355e=function(_0xa8ba63,_0x41601f){_0xa8ba63=_0xa8ba63-0x0;var _0x585b3b=_0x55e3[_0xa8ba63];return _0x585b3b;};'use strict';var Sequelize=require(_0x355e('0x0'));var _=require(_0x355e('0x1'));module[_0x355e('0x2')]={'name':{'type':Sequelize[_0x355e('0x3')],'get':function(_0x1f9eea){return this[_0x355e('0x4')]('alias');}},'alias':{'type':Sequelize[_0x355e('0x5')],'allowNull':![],'set':function(_0xca1e05){this[_0x355e('0x6')](_0x355e('0x7'),_0xca1e05?_0xca1e05:this[_0x355e('0x4')](_0x355e('0x8')));}},'type':{'type':Sequelize[_0x355e('0x5')],'allowNull':![]},'values':{'type':Sequelize['TEXT'](_0x355e('0x9')),'get':function(){if(this[_0x355e('0x4')](_0x355e('0xa'))===_0x355e('0xb')){return JSON[_0x355e('0xc')](this[_0x355e('0x4')](_0x355e('0xd')));}else{return this['getDataValue'](_0x355e('0xd'));}},'set':function(_0x3c8f73){if(Array[_0x355e('0xe')](_0x3c8f73)){this[_0x355e('0x6')]('values',JSON[_0x355e('0xf')](_0x3c8f73));}else{this['setDataValue'](_0x355e('0xd'),_0x3c8f73);}}},'required':{'type':Sequelize[_0x355e('0x10')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x355e('0x10')],'defaultValue':![]},'actionType':{'type':Sequelize[_0x355e('0x11')]('voice')}};
\ No newline at end of file
index 5c12943..1542a37 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdf3e=['includeAll','include','findAll','catch','show','params','body','find','sequelize','Sequelize','TEXT','text','number','INTEGER','switch','BOOLEAN','queryInterface','format','cf_%d','rimraf','zip-dir','fast-json-patch','moment','util','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','send','index','map','CmCustomField','rawAttributes','fieldName','type','key','model','differenceBy','name','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','options'];(function(_0x19e5b0,_0x148762){var _0x29b4b7=function(_0x466dfe){while(--_0x466dfe){_0x19e5b0['push'](_0x19e5b0['shift']());}};_0x29b4b7(++_0x148762);}(_0xdf3e,0x16b));var _0xedf3=function(_0x23cb1c,_0x4bcaf5){_0x23cb1c=_0x23cb1c-0x0;var _0x139ae1=_0xdf3e[_0x23cb1c];return _0x139ae1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xedf3('0x0'));var zipdir=require(_0xedf3('0x1'));var jsonpatch=require(_0xedf3('0x2'));var rp=require('request-promise');var moment=require(_0xedf3('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xedf3('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0xedf3('0x5'));var ejs=require(_0xedf3('0x6'));var fs=require('fs');var fs_extra=require(_0xedf3('0x7'));var _=require(_0xedf3('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xedf3('0x9'));var deskjs=require(_0xedf3('0xa'));var toCsv=require(_0xedf3('0x5'));var querystring=require(_0xedf3('0xb'));var Papa=require(_0xedf3('0xc'));var Redis=require(_0xedf3('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xedf3('0xe'));var as=require(_0xedf3('0xf'));var hardwareService=require(_0xedf3('0x10'));var logger=require('../../config/logger')(_0xedf3('0x11'));var utils=require(_0xedf3('0x12'));var config=require(_0xedf3('0x13'));var licenseUtil=require(_0xedf3('0x14'));var db=require(_0xedf3('0x15'))['db'];function respondWithStatusCode(_0x1b6168,_0x45d81f){_0x45d81f=_0x45d81f||0xcc;return function(_0x242288){if(_0x242288){return _0x1b6168[_0xedf3('0x16')](_0x45d81f);}return _0x1b6168[_0xedf3('0x17')](_0x45d81f)[_0xedf3('0x18')]();};}function respondWithResult(_0xb50c2a,_0x4c9f9a){_0x4c9f9a=_0x4c9f9a||0xc8;return function(_0x5c468b){if(_0x5c468b){return _0xb50c2a[_0xedf3('0x17')](_0x4c9f9a)[_0xedf3('0x19')](_0x5c468b);}};}function respondWithFilteredResult(_0x15e697,_0x3bf5c6){return function(_0x431437){if(_0x431437){var _0x175be1=typeof _0x3bf5c6[_0xedf3('0x1a')]===_0xedf3('0x1b')&&typeof _0x3bf5c6[_0xedf3('0x1c')]===_0xedf3('0x1b');var _0x2513f8=_0x431437[_0xedf3('0x1d')];var _0x5da51b=_0x175be1?0x0:_0x3bf5c6[_0xedf3('0x1a')];var _0x2493a4=_0x175be1?_0x431437[_0xedf3('0x1d')]:_0x3bf5c6[_0xedf3('0x1a')]+_0x3bf5c6[_0xedf3('0x1c')];var _0x36cbea;if(_0x2493a4>=_0x2513f8){_0x2493a4=_0x2513f8;_0x36cbea=0xc8;}else{_0x36cbea=0xce;}_0x15e697[_0xedf3('0x17')](_0x36cbea);return _0x15e697[_0xedf3('0x1e')](_0xedf3('0x1f'),_0x5da51b+'-'+_0x2493a4+'/'+_0x2513f8)[_0xedf3('0x19')](_0x431437);}return null;};}function patchUpdates(_0x5b9bdb){return function(_0x59ca7a){try{jsonpatch[_0xedf3('0x20')](_0x59ca7a,_0x5b9bdb,!![]);}catch(_0xbb565c){return BPromise[_0xedf3('0x21')](_0xbb565c);}return _0x59ca7a[_0xedf3('0x22')]();};}function saveUpdates(_0x5ec997,_0x329be9){return function(_0x3cd50e){if(_0x3cd50e){return _0x3cd50e[_0xedf3('0x23')](_0x5ec997)[_0xedf3('0x24')](function(_0x5b4ec5){return _0x5b4ec5;});}return null;};}function removeEntity(_0x49866a,_0x1b38e4){return function(_0x4793b0){if(_0x4793b0){return _0x4793b0[_0xedf3('0x25')]()[_0xedf3('0x24')](function(){_0x49866a[_0xedf3('0x17')](0xcc)[_0xedf3('0x18')]();});}};}function handleEntityNotFound(_0x1f4ac3,_0x50d675){return function(_0x3384b8){if(!_0x3384b8){_0x1f4ac3['sendStatus'](0x194);}return _0x3384b8;};}function handleError(_0x127f73,_0x277b12){_0x277b12=_0x277b12||0x1f4;return function(_0x2b9b01){logger[_0xedf3('0x26')](_0x2b9b01['stack']);if(_0x2b9b01['name']){delete _0x2b9b01['name'];}_0x127f73[_0xedf3('0x17')](_0x277b12)[_0xedf3('0x27')](_0x2b9b01);};}exports[_0xedf3('0x28')]=function(_0xce3921,_0x4db5dc){var _0x23cbc3={},_0x3e60bf={},_0x4d9a90={'count':0x0,'rows':[]};var _0x51d9b8=_[_0xedf3('0x29')](db[_0xedf3('0x2a')][_0xedf3('0x2b')],function(_0x5478ed){return{'name':_0x5478ed[_0xedf3('0x2c')],'type':_0x5478ed[_0xedf3('0x2d')][_0xedf3('0x2e')]};});_0x3e60bf[_0xedf3('0x2f')]=_[_0xedf3('0x30')](_['map'](_0x51d9b8,_0xedf3('0x31')),[_0xedf3('0x31')]);_0x3e60bf[_0xedf3('0x32')]=_[_0xedf3('0x33')](_0xce3921[_0xedf3('0x32')]);_0x3e60bf[_0xedf3('0x34')]=_[_0xedf3('0x35')](_0x3e60bf[_0xedf3('0x2f')],_0x3e60bf[_0xedf3('0x32')]);_0x23cbc3['attributes']=_[_0xedf3('0x35')](_0x3e60bf[_0xedf3('0x2f')],qs[_0xedf3('0x36')](_0xce3921[_0xedf3('0x32')]['fields']));_0x23cbc3[_0xedf3('0x37')]=_0x23cbc3[_0xedf3('0x37')][_0xedf3('0x38')]?_0x23cbc3[_0xedf3('0x37')]:_0x3e60bf[_0xedf3('0x2f')];if(!_0xce3921['query'][_0xedf3('0x39')](_0xedf3('0x3a'))){_0x23cbc3['limit']=qs['limit'](_0xce3921['query'][_0xedf3('0x1c')]);_0x23cbc3[_0xedf3('0x1a')]=qs[_0xedf3('0x1a')](_0xce3921[_0xedf3('0x32')]['offset']);}_0x23cbc3[_0xedf3('0x3b')]=qs[_0xedf3('0x3c')](_0xce3921['query'][_0xedf3('0x3c')]);_0x23cbc3['where']=qs['filters'](_[_0xedf3('0x3d')](_0xce3921['query'],_0x3e60bf[_0xedf3('0x34')]),_0x51d9b8);if(_0xce3921[_0xedf3('0x32')][_0xedf3('0x3e')]){_0x23cbc3['where']=_[_0xedf3('0x3f')](_0x23cbc3[_0xedf3('0x40')],{'$or':_['map'](_0x51d9b8,function(_0x5785a5){if(_0x5785a5['type']!==_0xedf3('0x41')){var _0x59b88e={};_0x59b88e[_0x5785a5[_0xedf3('0x31')]]={'$like':'%'+_0xce3921[_0xedf3('0x32')]['filter']+'%'};return _0x59b88e;}})});}_0x23cbc3=_['merge']({},_0x23cbc3,_0xce3921[_0xedf3('0x42')]);var _0x335371={'where':_0x23cbc3['where']};return db[_0xedf3('0x2a')]['count'](_0x335371)[_0xedf3('0x24')](function(_0x5074f1){_0x4d9a90[_0xedf3('0x1d')]=_0x5074f1;if(_0xce3921['query'][_0xedf3('0x43')]){_0x23cbc3[_0xedf3('0x44')]=[{'all':!![]}];}return db[_0xedf3('0x2a')][_0xedf3('0x45')](_0x23cbc3);})['then'](function(_0x520433){_0x4d9a90['rows']=_0x520433;return _0x4d9a90;})[_0xedf3('0x24')](respondWithFilteredResult(_0x4db5dc,_0x23cbc3))[_0xedf3('0x46')](handleError(_0x4db5dc,null));};exports[_0xedf3('0x47')]=function(_0x3e0a77,_0x3e0641){var _0x441840={'raw':!![],'where':{'id':_0x3e0a77[_0xedf3('0x48')]['id']}},_0x34c0c8={};_0x34c0c8[_0xedf3('0x2f')]=_[_0xedf3('0x33')](db[_0xedf3('0x2a')][_0xedf3('0x2b')]);_0x34c0c8['query']=_['keys'](_0x3e0a77[_0xedf3('0x32')]);_0x34c0c8[_0xedf3('0x34')]=_[_0xedf3('0x35')](_0x34c0c8[_0xedf3('0x2f')],_0x34c0c8[_0xedf3('0x32')]);_0x441840[_0xedf3('0x37')]=_[_0xedf3('0x35')](_0x34c0c8[_0xedf3('0x2f')],qs[_0xedf3('0x36')](_0x3e0a77[_0xedf3('0x32')][_0xedf3('0x36')]));_0x441840['attributes']=_0x441840[_0xedf3('0x37')]['length']?_0x441840[_0xedf3('0x37')]:_0x34c0c8[_0xedf3('0x2f')];if(_0x3e0a77[_0xedf3('0x32')][_0xedf3('0x43')]){_0x441840[_0xedf3('0x44')]=[{'all':!![]}];}_0x441840=_[_0xedf3('0x3f')]({},_0x441840,_0x3e0a77[_0xedf3('0x42')]);return db[_0xedf3('0x2a')]['find'](_0x441840)['then'](handleEntityNotFound(_0x3e0641,null))['then'](respondWithResult(_0x3e0641,null))['catch'](handleError(_0x3e0641,null));};exports[_0xedf3('0x23')]=function(_0x118110,_0x1bf74f){if(_0x118110[_0xedf3('0x49')]['id']){delete _0x118110[_0xedf3('0x49')]['id'];}return db['CmCustomField'][_0xedf3('0x4a')]({'where':{'id':_0x118110[_0xedf3('0x48')]['id']}})['then'](handleEntityNotFound(_0x1bf74f,null))['then'](saveUpdates(_0x118110[_0xedf3('0x49')],null))[_0xedf3('0x24')](respondWithResult(_0x1bf74f,null))[_0xedf3('0x46')](handleError(_0x1bf74f,null));};exports['destroy']=function(_0x274b76,_0x2a35ab){return db[_0xedf3('0x2a')]['find']({'where':{'id':_0x274b76['params']['id']}})[_0xedf3('0x24')](handleEntityNotFound(_0x2a35ab,null))[_0xedf3('0x24')](removeEntity(_0x2a35ab,null))[_0xedf3('0x46')](handleError(_0x2a35ab,null));};exports['create']=function(_0x252599,_0x34483a){var _0x807618;return db[_0xedf3('0x4b')]['transaction'](function(_0x5a79b5){return db[_0xedf3('0x2a')]['create'](_0x252599[_0xedf3('0x49')],{'transaction':_0x5a79b5})[_0xedf3('0x24')](function(_0x1455b1){_0x807618=_0x1455b1;var _0x4e4cc1={'type':db[_0xedf3('0x4c')][_0xedf3('0x4d')],'transaction':_0x5a79b5};switch(_0x252599[_0xedf3('0x49')][_0xedf3('0x2d')]){case _0xedf3('0x4e'):_0x4e4cc1[_0xedf3('0x2d')]=db[_0xedf3('0x4c')][_0xedf3('0x4d')];break;case _0xedf3('0x4f'):_0x4e4cc1[_0xedf3('0x2d')]=db[_0xedf3('0x4c')][_0xedf3('0x50')];break;case _0xedf3('0x51'):_0x4e4cc1[_0xedf3('0x2d')]=db[_0xedf3('0x4c')][_0xedf3('0x52')];_0x4e4cc1['defaultValue']=![];break;default:}return db[_0xedf3('0x4b')][_0xedf3('0x53')]['addColumn']('cm_contacts',util[_0xedf3('0x54')](_0xedf3('0x55'),_0x807618['id']),_0x4e4cc1);})['then'](function(){return _0x807618;});})[_0xedf3('0x24')](respondWithResult(_0x34483a,0xc9))[_0xedf3('0x46')](handleError(_0x34483a,null));};
\ No newline at end of file
+var _0x8a10=['create','sequelize','transaction','Sequelize','TEXT','text','INTEGER','switch','defaultValue','addColumn','cm_contacts','format','eml-format','rimraf','zip-dir','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','sendStatus','error','stack','name','send','CmCustomField','fieldName','type','model','differenceBy','map','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','pick','where','merge','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','options','find','update','body'];(function(_0x49f100,_0xa57605){var _0x299fb4=function(_0x170bf6){while(--_0x170bf6){_0x49f100['push'](_0x49f100['shift']());}};_0x299fb4(++_0xa57605);}(_0x8a10,0x10b));var _0x08a1=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x8a10[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x08a1('0x0'));var rimraf=require(_0x08a1('0x1'));var zipdir=require(_0x08a1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x08a1('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x08a1('0x4'));var util=require(_0x08a1('0x5'));var path=require('path');var sox=require(_0x08a1('0x6'));var csv=require(_0x08a1('0x7'));var ejs=require(_0x08a1('0x8'));var fs=require('fs');var fs_extra=require(_0x08a1('0x9'));var _=require(_0x08a1('0xa'));var squel=require(_0x08a1('0xb'));var crypto=require(_0x08a1('0xc'));var jsforce=require(_0x08a1('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x08a1('0xe'));var Papa=require(_0x08a1('0xf'));var Redis=require(_0x08a1('0x10'));var authService=require(_0x08a1('0x11'));var qs=require(_0x08a1('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x08a1('0x13'));var logger=require(_0x08a1('0x14'))('api');var utils=require(_0x08a1('0x15'));var config=require(_0x08a1('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x08a1('0x17'))['db'];function respondWithStatusCode(_0x309ca8,_0x31daa4){_0x31daa4=_0x31daa4||0xcc;return function(_0x172a00){if(_0x172a00){return _0x309ca8['sendStatus'](_0x31daa4);}return _0x309ca8[_0x08a1('0x18')](_0x31daa4)[_0x08a1('0x19')]();};}function respondWithResult(_0x60255a,_0x11ef81){_0x11ef81=_0x11ef81||0xc8;return function(_0x529e34){if(_0x529e34){return _0x60255a[_0x08a1('0x18')](_0x11ef81)[_0x08a1('0x1a')](_0x529e34);}};}function respondWithFilteredResult(_0x5c0f87,_0x31419d){return function(_0x263942){if(_0x263942){var _0x1a9992=typeof _0x31419d[_0x08a1('0x1b')]===_0x08a1('0x1c')&&typeof _0x31419d[_0x08a1('0x1d')]==='undefined';var _0x1ceb7c=_0x263942[_0x08a1('0x1e')];var _0x18e44d=_0x1a9992?0x0:_0x31419d[_0x08a1('0x1b')];var _0x65cead=_0x1a9992?_0x263942[_0x08a1('0x1e')]:_0x31419d[_0x08a1('0x1b')]+_0x31419d[_0x08a1('0x1d')];var _0x27d17a;if(_0x65cead>=_0x1ceb7c){_0x65cead=_0x1ceb7c;_0x27d17a=0xc8;}else{_0x27d17a=0xce;}_0x5c0f87[_0x08a1('0x18')](_0x27d17a);return _0x5c0f87[_0x08a1('0x1f')](_0x08a1('0x20'),_0x18e44d+'-'+_0x65cead+'/'+_0x1ceb7c)[_0x08a1('0x1a')](_0x263942);}return null;};}function patchUpdates(_0x2a28df){return function(_0x746bf5){try{jsonpatch[_0x08a1('0x21')](_0x746bf5,_0x2a28df,!![]);}catch(_0x2e7649){return BPromise[_0x08a1('0x22')](_0x2e7649);}return _0x746bf5[_0x08a1('0x23')]();};}function saveUpdates(_0x4c7912,_0x17d29a){return function(_0x1e1421){if(_0x1e1421){return _0x1e1421['update'](_0x4c7912)[_0x08a1('0x24')](function(_0x1d3673){return _0x1d3673;});}return null;};}function removeEntity(_0x3e6cf4,_0x18d5a2){return function(_0x2a4c45){if(_0x2a4c45){return _0x2a4c45['destroy']()['then'](function(){_0x3e6cf4[_0x08a1('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x417284,_0xc7ad3e){return function(_0x360bc6){if(!_0x360bc6){_0x417284[_0x08a1('0x25')](0x194);}return _0x360bc6;};}function handleError(_0x2f1ab7,_0x159881){_0x159881=_0x159881||0x1f4;return function(_0x4d11b3){logger[_0x08a1('0x26')](_0x4d11b3[_0x08a1('0x27')]);if(_0x4d11b3['name']){delete _0x4d11b3[_0x08a1('0x28')];}_0x2f1ab7['status'](_0x159881)[_0x08a1('0x29')](_0x4d11b3);};}exports['index']=function(_0x1a69f4,_0x5bb9d6){var _0x10906d={},_0x1f2326={},_0x22264e={'count':0x0,'rows':[]};var _0x32ea53=_['map'](db[_0x08a1('0x2a')]['rawAttributes'],function(_0x2f37ea){return{'name':_0x2f37ea[_0x08a1('0x2b')],'type':_0x2f37ea[_0x08a1('0x2c')]['key']};});_0x1f2326[_0x08a1('0x2d')]=_[_0x08a1('0x2e')](_[_0x08a1('0x2f')](_0x32ea53,'name'),['name']);_0x1f2326[_0x08a1('0x30')]=_[_0x08a1('0x31')](_0x1a69f4[_0x08a1('0x30')]);_0x1f2326[_0x08a1('0x32')]=_[_0x08a1('0x33')](_0x1f2326['model'],_0x1f2326[_0x08a1('0x30')]);_0x10906d[_0x08a1('0x34')]=_[_0x08a1('0x33')](_0x1f2326[_0x08a1('0x2d')],qs['fields'](_0x1a69f4[_0x08a1('0x30')][_0x08a1('0x35')]));_0x10906d['attributes']=_0x10906d[_0x08a1('0x34')]['length']?_0x10906d[_0x08a1('0x34')]:_0x1f2326[_0x08a1('0x2d')];if(!_0x1a69f4[_0x08a1('0x30')]['hasOwnProperty'](_0x08a1('0x36'))){_0x10906d[_0x08a1('0x1d')]=qs[_0x08a1('0x1d')](_0x1a69f4[_0x08a1('0x30')][_0x08a1('0x1d')]);_0x10906d[_0x08a1('0x1b')]=qs['offset'](_0x1a69f4['query'][_0x08a1('0x1b')]);}_0x10906d[_0x08a1('0x37')]=qs[_0x08a1('0x38')](_0x1a69f4[_0x08a1('0x30')][_0x08a1('0x38')]);_0x10906d['where']=qs[_0x08a1('0x32')](_[_0x08a1('0x39')](_0x1a69f4[_0x08a1('0x30')],_0x1f2326[_0x08a1('0x32')]),_0x32ea53);if(_0x1a69f4[_0x08a1('0x30')]['filter']){_0x10906d[_0x08a1('0x3a')]=_[_0x08a1('0x3b')](_0x10906d[_0x08a1('0x3a')],{'$or':_[_0x08a1('0x2f')](_0x32ea53,function(_0x2f9dcf){if(_0x2f9dcf[_0x08a1('0x2c')]!=='VIRTUAL'){var _0x15377d={};_0x15377d[_0x2f9dcf['name']]={'$like':'%'+_0x1a69f4[_0x08a1('0x30')]['filter']+'%'};return _0x15377d;}})});}_0x10906d=_['merge']({},_0x10906d,_0x1a69f4['options']);var _0x336df2={'where':_0x10906d[_0x08a1('0x3a')]};return db[_0x08a1('0x2a')][_0x08a1('0x1e')](_0x336df2)['then'](function(_0x165e1c){_0x22264e['count']=_0x165e1c;if(_0x1a69f4[_0x08a1('0x30')][_0x08a1('0x3c')]){_0x10906d[_0x08a1('0x3d')]=[{'all':!![]}];}return db['CmCustomField'][_0x08a1('0x3e')](_0x10906d);})[_0x08a1('0x24')](function(_0x295a2c){_0x22264e[_0x08a1('0x3f')]=_0x295a2c;return _0x22264e;})[_0x08a1('0x24')](respondWithFilteredResult(_0x5bb9d6,_0x10906d))[_0x08a1('0x40')](handleError(_0x5bb9d6,null));};exports[_0x08a1('0x41')]=function(_0x52b49f,_0x529911){var _0x4d582d={'raw':!![],'where':{'id':_0x52b49f[_0x08a1('0x42')]['id']}},_0x4d9b81={};_0x4d9b81['model']=_[_0x08a1('0x31')](db[_0x08a1('0x2a')][_0x08a1('0x43')]);_0x4d9b81[_0x08a1('0x30')]=_[_0x08a1('0x31')](_0x52b49f[_0x08a1('0x30')]);_0x4d9b81[_0x08a1('0x32')]=_[_0x08a1('0x33')](_0x4d9b81[_0x08a1('0x2d')],_0x4d9b81[_0x08a1('0x30')]);_0x4d582d[_0x08a1('0x34')]=_[_0x08a1('0x33')](_0x4d9b81[_0x08a1('0x2d')],qs[_0x08a1('0x35')](_0x52b49f['query'][_0x08a1('0x35')]));_0x4d582d[_0x08a1('0x34')]=_0x4d582d['attributes'][_0x08a1('0x44')]?_0x4d582d[_0x08a1('0x34')]:_0x4d9b81['model'];if(_0x52b49f['query'][_0x08a1('0x3c')]){_0x4d582d[_0x08a1('0x3d')]=[{'all':!![]}];}_0x4d582d=_['merge']({},_0x4d582d,_0x52b49f[_0x08a1('0x45')]);return db[_0x08a1('0x2a')][_0x08a1('0x46')](_0x4d582d)[_0x08a1('0x24')](handleEntityNotFound(_0x529911,null))[_0x08a1('0x24')](respondWithResult(_0x529911,null))[_0x08a1('0x40')](handleError(_0x529911,null));};exports[_0x08a1('0x47')]=function(_0x22a8de,_0x37ec00){if(_0x22a8de[_0x08a1('0x48')]['id']){delete _0x22a8de[_0x08a1('0x48')]['id'];}return db[_0x08a1('0x2a')][_0x08a1('0x46')]({'where':{'id':_0x22a8de[_0x08a1('0x42')]['id']}})[_0x08a1('0x24')](handleEntityNotFound(_0x37ec00,null))[_0x08a1('0x24')](saveUpdates(_0x22a8de[_0x08a1('0x48')],null))[_0x08a1('0x24')](respondWithResult(_0x37ec00,null))[_0x08a1('0x40')](handleError(_0x37ec00,null));};exports['destroy']=function(_0xc11b90,_0x597528){return db[_0x08a1('0x2a')][_0x08a1('0x46')]({'where':{'id':_0xc11b90[_0x08a1('0x42')]['id']}})[_0x08a1('0x24')](handleEntityNotFound(_0x597528,null))[_0x08a1('0x24')](removeEntity(_0x597528,null))[_0x08a1('0x40')](handleError(_0x597528,null));};exports[_0x08a1('0x49')]=function(_0x2f8520,_0x5df029){var _0x363584;return db[_0x08a1('0x4a')][_0x08a1('0x4b')](function(_0x45c3cd){return db[_0x08a1('0x2a')][_0x08a1('0x49')](_0x2f8520[_0x08a1('0x48')],{'transaction':_0x45c3cd})[_0x08a1('0x24')](function(_0x438159){_0x363584=_0x438159;var _0x86da2={'type':db[_0x08a1('0x4c')][_0x08a1('0x4d')],'transaction':_0x45c3cd};switch(_0x2f8520['body'][_0x08a1('0x2c')]){case _0x08a1('0x4e'):_0x86da2[_0x08a1('0x2c')]=db[_0x08a1('0x4c')][_0x08a1('0x4d')];break;case'number':_0x86da2[_0x08a1('0x2c')]=db['Sequelize'][_0x08a1('0x4f')];break;case _0x08a1('0x50'):_0x86da2['type']=db[_0x08a1('0x4c')]['BOOLEAN'];_0x86da2[_0x08a1('0x51')]=![];break;default:}return db[_0x08a1('0x4a')]['queryInterface'][_0x08a1('0x52')](_0x08a1('0x53'),util[_0x08a1('0x54')]('cf_%d',_0x363584['id']),_0x86da2);})['then'](function(){return _0x363584;});})[_0x08a1('0x24')](respondWithResult(_0x5df029,0xc9))[_0x08a1('0x40')](handleError(_0x5df029,null));};
\ No newline at end of file
index 771c265..db052cb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc2a4=['rimraf','../../config/environment','./cmCustomField.attributes','exports','define','CmCustomField','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x366b03,_0x20a705){var _0xd25f20=function(_0x27ac58){while(--_0x27ac58){_0x366b03['push'](_0x366b03['shift']());}};_0xd25f20(++_0x20a705);}(_0xc2a4,0xf4));var _0x4c2a=function(_0x5f0437,_0x2a97dc){_0x5f0437=_0x5f0437-0x0;var _0x4c7216=_0xc2a4[_0x5f0437];return _0x4c7216;};'use strict';var _=require(_0x4c2a('0x0'));var util=require(_0x4c2a('0x1'));var logger=require(_0x4c2a('0x2'))(_0x4c2a('0x3'));var moment=require(_0x4c2a('0x4'));var BPromise=require(_0x4c2a('0x5'));var rp=require(_0x4c2a('0x6'));var fs=require('fs');var path=require(_0x4c2a('0x7'));var rimraf=require(_0x4c2a('0x8'));var config=require(_0x4c2a('0x9'));var attributes=require(_0x4c2a('0xa'));module[_0x4c2a('0xb')]=function(_0x2a6f5c,_0x232b8a){return _0x2a6f5c[_0x4c2a('0xc')](_0x4c2a('0xd'),attributes,{'tableName':'cm_custom_fields','paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7f94=['cm_custom_fields','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./cmCustomField.attributes','CmCustomField'];(function(_0x310864,_0x286188){var _0x2fc306=function(_0x444ae3){while(--_0x444ae3){_0x310864['push'](_0x310864['shift']());}};_0x2fc306(++_0x286188);}(_0x7f94,0x1c4));var _0x47f9=function(_0x40895a,_0x73487){_0x40895a=_0x40895a-0x0;var _0x5dabdb=_0x7f94[_0x40895a];return _0x5dabdb;};'use strict';var _=require(_0x47f9('0x0'));var util=require(_0x47f9('0x1'));var logger=require(_0x47f9('0x2'))('api');var moment=require(_0x47f9('0x3'));var BPromise=require(_0x47f9('0x4'));var rp=require(_0x47f9('0x5'));var fs=require('fs');var path=require(_0x47f9('0x6'));var rimraf=require('rimraf');var config=require(_0x47f9('0x7'));var attributes=require(_0x47f9('0x8'));module['exports']=function(_0x3b1cd6,_0x4d0424){return _0x3b1cd6['define'](_0x47f9('0x9'),attributes,{'tableName':_0x47f9('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 6e56d23..95e845e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdd85=['catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','CmCustomField,\x20%s,\x20%s','request\x20sent','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0xaa1b3e,_0x47d976){var _0x454d7d=function(_0x575b32){while(--_0x575b32){_0xaa1b3e['push'](_0xaa1b3e['shift']());}};_0x454d7d(++_0x47d976);}(_0xdd85,0x166));var _0x5dd8=function(_0x55abe8,_0x1934bc){_0x55abe8=_0x55abe8-0x0;var _0x261b4c=_0xdd85[_0x55abe8];return _0x261b4c;};'use strict';var _=require(_0x5dd8('0x0'));var util=require(_0x5dd8('0x1'));var moment=require(_0x5dd8('0x2'));var BPromise=require(_0x5dd8('0x3'));var rs=require(_0x5dd8('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5dd8('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x5dd8('0x6'))('rpc');var config=require(_0x5dd8('0x7'));var jayson=require(_0x5dd8('0x8'));var client=jayson['client'][_0x5dd8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x32607b,_0x43171b,_0x1bbdd8){return new BPromise(function(_0x2fc76d,_0x4b4faa){return client[_0x5dd8('0xa')](_0x32607b,_0x1bbdd8)[_0x5dd8('0xb')](function(_0x570196){logger[_0x5dd8('0xc')](_0x5dd8('0xd'),_0x43171b,_0x5dd8('0xe'));logger['debug'](_0x5dd8('0xf'),_0x43171b,_0x5dd8('0xe'),JSON[_0x5dd8('0x10')](_0x570196));if(_0x570196[_0x5dd8('0x11')]){if(_0x570196[_0x5dd8('0x11')][_0x5dd8('0x12')]===0x1f4){logger[_0x5dd8('0x11')](_0x5dd8('0xd'),_0x43171b,_0x570196[_0x5dd8('0x11')]['message']);return _0x4b4faa(_0x570196[_0x5dd8('0x11')]['message']);}logger[_0x5dd8('0x11')](_0x5dd8('0xd'),_0x43171b,_0x570196['error'][_0x5dd8('0x13')]);return _0x2fc76d(_0x570196['error'][_0x5dd8('0x13')]);}else{logger[_0x5dd8('0xc')](_0x5dd8('0xd'),_0x43171b,_0x5dd8('0xe'));_0x2fc76d(_0x570196['result']['message']);}})[_0x5dd8('0x14')](function(_0x26eb04){logger[_0x5dd8('0x11')]('CmCustomField,\x20%s,\x20%s',_0x43171b,_0x26eb04);_0x4b4faa(_0x26eb04);});});}
\ No newline at end of file
+var _0x959a=['CmCustomField,\x20%s,\x20%s,\x20%s','error','code','message','CmCustomField,\x20%s,\x20%s','info','result','util','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','request\x20sent','debug'];(function(_0x16d0ed,_0x2912d4){var _0x20aa1e=function(_0x2766e3){while(--_0x2766e3){_0x16d0ed['push'](_0x16d0ed['shift']());}};_0x20aa1e(++_0x2912d4);}(_0x959a,0xd8));var _0xa959=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x959a[_0x42cae2];return _0x5f256f;};'use strict';var _=require('lodash');var util=require(_0xa959('0x0'));var moment=require('moment');var BPromise=require(_0xa959('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa959('0x2'))['db'];var utils=require(_0xa959('0x3'));var logger=require('../../config/logger')(_0xa959('0x4'));var config=require(_0xa959('0x5'));var jayson=require(_0xa959('0x6'));var client=jayson['client'][_0xa959('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2837ac,_0x37e39f,_0x51e21f){return new BPromise(function(_0x3cfdb7,_0x438ab4){return client[_0xa959('0x8')](_0x2837ac,_0x51e21f)[_0xa959('0x9')](function(_0x4cfb9d){logger['info']('CmCustomField,\x20%s,\x20%s',_0x37e39f,_0xa959('0xa'));logger[_0xa959('0xb')](_0xa959('0xc'),_0x37e39f,_0xa959('0xa'),JSON['stringify'](_0x4cfb9d));if(_0x4cfb9d[_0xa959('0xd')]){if(_0x4cfb9d['error'][_0xa959('0xe')]===0x1f4){logger[_0xa959('0xd')]('CmCustomField,\x20%s,\x20%s',_0x37e39f,_0x4cfb9d[_0xa959('0xd')][_0xa959('0xf')]);return _0x438ab4(_0x4cfb9d[_0xa959('0xd')]['message']);}logger[_0xa959('0xd')](_0xa959('0x10'),_0x37e39f,_0x4cfb9d[_0xa959('0xd')][_0xa959('0xf')]);return _0x3cfdb7(_0x4cfb9d[_0xa959('0xd')][_0xa959('0xf')]);}else{logger[_0xa959('0x11')](_0xa959('0x10'),_0x37e39f,_0xa959('0xa'));_0x3cfdb7(_0x4cfb9d[_0xa959('0x12')][_0xa959('0xf')]);}})['catch'](function(_0x2dfd04){logger[_0xa959('0xd')](_0xa959('0x10'),_0x37e39f,_0x2dfd04);_0x438ab4(_0x2dfd04);});});}
\ No newline at end of file
index 20aef69..3da41fd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd45e=['post','isAuthenticated','create','put','update','delete','destroy','exports','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','./cmCustomField.controller','get','/:id','show'];(function(_0x23d7a7,_0x4b0f57){var _0x43f390=function(_0x3528d0){while(--_0x3528d0){_0x23d7a7['push'](_0x23d7a7['shift']());}};_0x43f390(++_0x4b0f57);}(_0xd45e,0x182));var _0xed45=function(_0x5bac1f,_0x595228){_0x5bac1f=_0x5bac1f-0x0;var _0x1f8270=_0xd45e[_0x5bac1f];return _0x1f8270;};'use strict';var multer=require('multer');var util=require(_0xed45('0x0'));var path=require(_0xed45('0x1'));var timeout=require('connect-timeout');var express=require(_0xed45('0x2'));var router=express['Router']();var fs_extra=require(_0xed45('0x3'));var auth=require(_0xed45('0x4'));var interaction=require(_0xed45('0x5'));var config=require('../../config/environment');var controller=require(_0xed45('0x6'));router[_0xed45('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xed45('0x7')](_0xed45('0x8'),auth['isAuthenticated'](),controller[_0xed45('0x9')]);router[_0xed45('0xa')]('/',auth[_0xed45('0xb')](),controller[_0xed45('0xc')]);router[_0xed45('0xd')](_0xed45('0x8'),auth['isAuthenticated'](),controller[_0xed45('0xe')]);router[_0xed45('0xf')](_0xed45('0x8'),auth[_0xed45('0xb')](),controller[_0xed45('0x10')]);module[_0xed45('0x11')]=router;
\ No newline at end of file
+var _0xc4ab=['create','put','update','delete','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./cmCustomField.controller','isAuthenticated','index','get','/:id','post'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xc4ab,0xef));var _0xbc4a=function(_0x14dbbb,_0x416d9f){_0x14dbbb=_0x14dbbb-0x0;var _0x25855b=_0xc4ab[_0x14dbbb];return _0x25855b;};'use strict';var multer=require(_0xbc4a('0x0'));var util=require('util');var path=require(_0xbc4a('0x1'));var timeout=require(_0xbc4a('0x2'));var express=require(_0xbc4a('0x3'));var router=express['Router']();var fs_extra=require(_0xbc4a('0x4'));var auth=require(_0xbc4a('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xbc4a('0x6'));var controller=require(_0xbc4a('0x7'));router['get']('/',auth[_0xbc4a('0x8')](),controller[_0xbc4a('0x9')]);router[_0xbc4a('0xa')](_0xbc4a('0xb'),auth[_0xbc4a('0x8')](),controller['show']);router[_0xbc4a('0xc')]('/',auth[_0xbc4a('0x8')](),controller[_0xbc4a('0xd')]);router[_0xbc4a('0xe')](_0xbc4a('0xb'),auth[_0xbc4a('0x8')](),controller[_0xbc4a('0xf')]);router[_0xbc4a('0x10')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xbc4a('0x11')]=router;
\ No newline at end of file
index 67dda2e..00635da 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6aec=['INTEGER','UNSIGNED','contactListQueue','moment','sequelize','exports','STRING','BOOLEAN','DATE','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x5f3f57,_0x362f73){var _0x225609=function(_0x18067c){while(--_0x18067c){_0x5f3f57['push'](_0x5f3f57['shift']());}};_0x225609(++_0x362f73);}(_0x6aec,0xf5));var _0xc6ae=function(_0x466a3f,_0x5d0900){_0x466a3f=_0x466a3f-0x0;var _0x58dcf7=_0x6aec[_0x466a3f];return _0x58dcf7;};'use strict';var moment=require(_0xc6ae('0x0'));var Sequelize=require(_0xc6ae('0x1'));module[_0xc6ae('0x2')]={'phone':{'type':Sequelize[_0xc6ae('0x3')],'allowNull':![]},'active':{'type':Sequelize[_0xc6ae('0x4')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0xc6ae('0x5')],'defaultValue':moment()[_0xc6ae('0x6')](_0xc6ae('0x7'))},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xc6ae('0x8')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xc6ae('0x8')],'defaultValue':0x0},'callback':{'type':Sequelize[_0xc6ae('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xc6ae('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xc6ae('0x5')]},'priority':{'type':Sequelize[_0xc6ae('0x8')](0x2)[_0xc6ae('0x9')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ContactId':{'type':Sequelize[_0xc6ae('0x8')],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0xc6ae('0x8')],'unique':'contactListQueue'},'UserId':{'type':Sequelize[_0xc6ae('0x8')]},'VoiceQueueId':{'type':Sequelize[_0xc6ae('0x8')],'unique':_0xc6ae('0xa')},'CampaignId':{'type':Sequelize[_0xc6ae('0x8')]},'countnosuchnumberretry':{'type':Sequelize[_0xc6ae('0x8')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xc6ae('0x8')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xc6ae('0x8')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xc6ae('0x8')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xc6ae('0x8')],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0xc6ae('0x8')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0xc6ae('0x3')]},'recallmeNotifiedDate':{'type':Sequelize[_0xc6ae('0x5')],'allowNull':!![],'defaultValue':null}};
\ No newline at end of file
+var _0x9378=['contactListQueue','exports','STRING','BOOLEAN','DATE','format','INTEGER'];(function(_0x124179,_0x28f4e8){var _0x1569f7=function(_0x2e9b21){while(--_0x2e9b21){_0x124179['push'](_0x124179['shift']());}};_0x1569f7(++_0x28f4e8);}(_0x9378,0x94));var _0x8937=function(_0x12fc9c,_0x56a306){_0x12fc9c=_0x12fc9c-0x0;var _0x4aeed5=_0x9378[_0x12fc9c];return _0x4aeed5;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x8937('0x0')]={'phone':{'type':Sequelize[_0x8937('0x1')],'allowNull':![]},'active':{'type':Sequelize[_0x8937('0x2')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x8937('0x3')],'defaultValue':moment()[_0x8937('0x4')]('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize[_0x8937('0x5')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x8937('0x5')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'callback':{'type':Sequelize[_0x8937('0x2')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x8937('0x1')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x8937('0x3')]},'priority':{'type':Sequelize[_0x8937('0x5')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x8937('0x5')],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0x8937('0x5')],'unique':_0x8937('0x6')},'UserId':{'type':Sequelize[_0x8937('0x5')]},'VoiceQueueId':{'type':Sequelize[_0x8937('0x5')],'unique':_0x8937('0x6')},'CampaignId':{'type':Sequelize[_0x8937('0x5')]},'countnosuchnumberretry':{'type':Sequelize[_0x8937('0x5')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x8937('0x5')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x8937('0x5')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x8937('0x5')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0x8937('0x5')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x8937('0x1')]},'recallmeNotifiedDate':{'type':Sequelize[_0x8937('0x3')],'allowNull':!![],'defaultValue':null}};
\ No newline at end of file
index 44d231a..01eb835 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6191=['../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','save','update','then','index','map','CmHopper','rawAttributes','fieldName','type','model','keys','query','filters','concat','$and','$gt','$gte','$lt','$lte','$eq','$not','$between','$in','$notLike','$iLike','$notILike','$overlap','$contained','$any','attributes','fields','length','nolimit','order','sort','pick','where','merge','VIRTUAL','name','filter','options','includeAll','include','findAll','rows','catch','params','find','create','body','describe','destroy','VoiceQueueId','VoiceQueue','Campaign','CampaignId','dataValues','createdAt','updatedAt','campaign','membername','user','UserId','deleted','calleridnum','phone','campaigntype','queue','CmContact','ContactId','lastName','isNil','firstName','calleridname','finally','CmHopperFinal','CmHopperAdditionalPhone','getPreview','getVoiceQueues','preview','dialPreviewAutoRecallMe','sequelize','format','YYYY-MM-DD\x20HH:mm:ss','value','direction','prev','isEmpty','hopperIds','priority','ASC','scheduledAt','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','dialOrderByScheduledAt','COALESCE(CmHopper.UserId,\x200)\x20DESC','scheduledat','recallme','LOCK','UPDATE','CmList','List','Queue','dialActive','getPreviewRecall','outbound','hopperId','findOne','Contact','CmCompany','Company','getOpenContacts','timezones','utcOffset','getTimezone','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x692e72,_0x470c7b){var _0x7e109e=function(_0x27e039){while(--_0x27e039){_0x692e72['push'](_0x692e72['shift']());}};_0x7e109e(++_0x470c7b);}(_0x6191,0x80));var _0x1619=function(_0x30c2ae,_0x4c98a2){_0x30c2ae=_0x30c2ae-0x0;var _0x1ee1cc=_0x6191[_0x30c2ae];return _0x1ee1cc;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x1619('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1619('0x1'));var moment=require(_0x1619('0x2'));var BPromise=require(_0x1619('0x3'));var Mustache=require(_0x1619('0x4'));var util=require(_0x1619('0x5'));var path=require(_0x1619('0x6'));var sox=require(_0x1619('0x7'));var csv=require('to-csv');var ejs=require(_0x1619('0x8'));var fs=require('fs');var fs_extra=require(_0x1619('0x9'));var _=require(_0x1619('0xa'));var squel=require(_0x1619('0xb'));var crypto=require(_0x1619('0xc'));var jsforce=require(_0x1619('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x1619('0xe'));var querystring=require(_0x1619('0xf'));var Papa=require(_0x1619('0x10'));var Redis=require(_0x1619('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x1619('0x12'));var as=require(_0x1619('0x13'));var hardwareService=require(_0x1619('0x14'));var logger=require(_0x1619('0x15'))(_0x1619('0x16'));var utils=require(_0x1619('0x17'));var config=require(_0x1619('0x18'));var shared=require(_0x1619('0x18'));var licenseUtil=require(_0x1619('0x19'));var db=require(_0x1619('0x1a'))['db'];function respondWithStatusCode(_0x2fb1c9,_0x14a83f){_0x14a83f=_0x14a83f||0xcc;return function(_0x220007){if(_0x220007){return _0x2fb1c9[_0x1619('0x1b')](_0x14a83f);}return _0x2fb1c9[_0x1619('0x1c')](_0x14a83f)[_0x1619('0x1d')]();};}function respondWithResult(_0x3ef185,_0x8772b9){_0x8772b9=_0x8772b9||0xc8;return function(_0x4c02b4){if(_0x4c02b4){return _0x3ef185[_0x1619('0x1c')](_0x8772b9)[_0x1619('0x1e')](_0x4c02b4);}};}function respondWithFilteredResult(_0x1ef785,_0x1980ca){return function(_0x55ae2a){if(_0x55ae2a){var _0x321791=typeof _0x1980ca[_0x1619('0x1f')]==='undefined'&&typeof _0x1980ca['limit']===_0x1619('0x20');var _0x31c2ee=_0x55ae2a['count'];var _0x27938a=_0x321791?0x0:_0x1980ca[_0x1619('0x1f')];var _0xef1fda=_0x321791?_0x55ae2a[_0x1619('0x21')]:_0x1980ca[_0x1619('0x1f')]+_0x1980ca[_0x1619('0x22')];var _0x1043a7;if(_0xef1fda>=_0x31c2ee){_0xef1fda=_0x31c2ee;_0x1043a7=0xc8;}else{_0x1043a7=0xce;}_0x1ef785[_0x1619('0x1c')](_0x1043a7);return _0x1ef785[_0x1619('0x23')](_0x1619('0x24'),_0x27938a+'-'+_0xef1fda+'/'+_0x31c2ee)[_0x1619('0x1e')](_0x55ae2a);}return null;};}function patchUpdates(_0x494467){return function(_0x4b6b70){try{jsonpatch['apply'](_0x4b6b70,_0x494467,!![]);}catch(_0xa367af){return BPromise['reject'](_0xa367af);}return _0x4b6b70[_0x1619('0x25')]();};}function saveUpdates(_0x524b53,_0x27a6a0){return function(_0x2acda4){if(_0x2acda4){return _0x2acda4[_0x1619('0x26')](_0x524b53)[_0x1619('0x27')](function(_0x431fd1){return _0x431fd1;});}return null;};}function removeEntity(_0x492bd5,_0x26c37d){return function(_0x57c1a4){if(_0x57c1a4){return _0x57c1a4['destroy']()[_0x1619('0x27')](function(){_0x492bd5[_0x1619('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x46b8d5,_0x11678a){return function(_0x544d81){if(!_0x544d81){_0x46b8d5[_0x1619('0x1b')](0x194);}return _0x544d81;};}function handleError(_0x17f856,_0x38e4cf){_0x38e4cf=_0x38e4cf||0x1f4;return function(_0x4d6b3e){logger['error'](_0x4d6b3e['stack']);if(_0x4d6b3e['name']){delete _0x4d6b3e['name'];}_0x17f856[_0x1619('0x1c')](_0x38e4cf)['send'](_0x4d6b3e);};}exports[_0x1619('0x28')]=function(_0x1b2a09,_0x82c5e1){var _0x457aa9={},_0xd1da55={},_0x22afe6={'count':0x0,'rows':[]};var _0x564960=_[_0x1619('0x29')](db[_0x1619('0x2a')][_0x1619('0x2b')],function(_0x27f0f2){return{'name':_0x27f0f2[_0x1619('0x2c')],'type':_0x27f0f2[_0x1619('0x2d')]['key']};});_0xd1da55[_0x1619('0x2e')]=_['map'](_0x564960,'name');_0xd1da55['query']=_[_0x1619('0x2f')](_0x1b2a09[_0x1619('0x30')]);_0xd1da55[_0x1619('0x31')]=_['intersection'](_0xd1da55[_0x1619('0x2e')],_0xd1da55[_0x1619('0x30')]);_0xd1da55[_0x1619('0x31')]=_[_0x1619('0x32')](_0xd1da55['filters'],[_0x1619('0x33'),'$or',_0x1619('0x34'),_0x1619('0x35'),_0x1619('0x36'),_0x1619('0x37'),'$ne',_0x1619('0x38'),_0x1619('0x39'),_0x1619('0x3a'),'$notBetween',_0x1619('0x3b'),'$notIn','$like',_0x1619('0x3c'),_0x1619('0x3d'),_0x1619('0x3e'),'$like',_0x1619('0x3f'),'$contains',_0x1619('0x40'),_0x1619('0x41')]);_0x457aa9[_0x1619('0x42')]=_['intersection'](_0xd1da55['model'],qs[_0x1619('0x43')](_0x1b2a09[_0x1619('0x30')][_0x1619('0x43')]));_0x457aa9[_0x1619('0x42')]=_0x457aa9[_0x1619('0x42')][_0x1619('0x44')]?_0x457aa9[_0x1619('0x42')]:_0xd1da55[_0x1619('0x2e')];if(!_0x1b2a09[_0x1619('0x30')]['hasOwnProperty'](_0x1619('0x45'))){_0x457aa9[_0x1619('0x22')]=qs[_0x1619('0x22')](_0x1b2a09[_0x1619('0x30')]['limit']);_0x457aa9[_0x1619('0x1f')]=qs[_0x1619('0x1f')](_0x1b2a09['query'][_0x1619('0x1f')]);}_0x457aa9[_0x1619('0x46')]=qs['sort'](_0x1b2a09[_0x1619('0x30')][_0x1619('0x47')]);_0x457aa9['where']=qs[_0x1619('0x31')](_[_0x1619('0x48')](_0x1b2a09[_0x1619('0x30')],_0xd1da55[_0x1619('0x31')]),_0x564960);if(_0x1b2a09['query']['filter']){_0x457aa9[_0x1619('0x49')]=_[_0x1619('0x4a')](_0x457aa9[_0x1619('0x49')],{'$or':_[_0x1619('0x29')](_0x564960,function(_0x316ff8){if(_0x316ff8['type']!==_0x1619('0x4b')){var _0x56afe4={};_0x56afe4[_0x316ff8[_0x1619('0x4c')]]={'$like':'%'+_0x1b2a09[_0x1619('0x30')][_0x1619('0x4d')]+'%'};return _0x56afe4;}})});}_0x457aa9=_[_0x1619('0x4a')]({},_0x457aa9,_0x1b2a09[_0x1619('0x4e')]);var _0x1906fa={'where':_0x457aa9[_0x1619('0x49')]};return db[_0x1619('0x2a')]['count'](_0x1906fa)[_0x1619('0x27')](function(_0x4e46c3){_0x22afe6[_0x1619('0x21')]=_0x4e46c3;if(_0x1b2a09[_0x1619('0x30')][_0x1619('0x4f')]){_0x457aa9[_0x1619('0x50')]=[{'all':!![]}];}return db[_0x1619('0x2a')][_0x1619('0x51')](_0x457aa9);})[_0x1619('0x27')](function(_0x33e16f){_0x22afe6[_0x1619('0x52')]=_0x33e16f;return _0x22afe6;})[_0x1619('0x27')](respondWithFilteredResult(_0x82c5e1,_0x457aa9))[_0x1619('0x53')](handleError(_0x82c5e1,null));};exports['show']=function(_0x10e3dd,_0x27d5dd){var _0x1dceda={'raw':!![],'where':{'id':_0x10e3dd[_0x1619('0x54')]['id']}},_0xc63cb3={};_0xc63cb3[_0x1619('0x2e')]=_['keys'](db[_0x1619('0x2a')][_0x1619('0x2b')]);_0xc63cb3['query']=_[_0x1619('0x2f')](_0x10e3dd[_0x1619('0x30')]);_0xc63cb3[_0x1619('0x31')]=_['intersection'](_0xc63cb3[_0x1619('0x2e')],_0xc63cb3[_0x1619('0x30')]);_0x1dceda[_0x1619('0x42')]=_['intersection'](_0xc63cb3[_0x1619('0x2e')],qs[_0x1619('0x43')](_0x10e3dd['query'][_0x1619('0x43')]));_0x1dceda[_0x1619('0x42')]=_0x1dceda[_0x1619('0x42')][_0x1619('0x44')]?_0x1dceda['attributes']:_0xc63cb3[_0x1619('0x2e')];if(_0x10e3dd[_0x1619('0x30')][_0x1619('0x4f')]){_0x1dceda[_0x1619('0x50')]=[{'all':!![]}];}_0x1dceda=_['merge']({},_0x1dceda,_0x10e3dd[_0x1619('0x4e')]);return db[_0x1619('0x2a')][_0x1619('0x55')](_0x1dceda)[_0x1619('0x27')](handleEntityNotFound(_0x27d5dd,null))['then'](respondWithResult(_0x27d5dd,null))['catch'](handleError(_0x27d5dd,null));};exports[_0x1619('0x56')]=function(_0x278a80,_0x214208){return db[_0x1619('0x2a')][_0x1619('0x56')](_0x278a80[_0x1619('0x57')],{})[_0x1619('0x27')](respondWithResult(_0x214208,0xc9))[_0x1619('0x53')](handleError(_0x214208,null));};exports['update']=function(_0x485c23,_0x1b3d5b){if(_0x485c23[_0x1619('0x57')]['id']){delete _0x485c23[_0x1619('0x57')]['id'];}return db['CmHopper'][_0x1619('0x55')]({'where':{'id':_0x485c23[_0x1619('0x54')]['id']}})['then'](handleEntityNotFound(_0x1b3d5b,null))[_0x1619('0x27')](saveUpdates(_0x485c23[_0x1619('0x57')],null))[_0x1619('0x27')](respondWithResult(_0x1b3d5b,null))[_0x1619('0x53')](handleError(_0x1b3d5b,null));};exports['describe']=function(_0x2d9ee4,_0x3e42b8){return db['CmHopper'][_0x1619('0x58')]()['then'](respondWithResult(_0x3e42b8,null))[_0x1619('0x53')](handleError(_0x3e42b8,null));};exports[_0x1619('0x59')]=function(_0x311045,_0x2a8995){var _0x25df0c;var _0x1e6245=_0x311045[_0x1619('0x54')]['id'];return db[_0x1619('0x2a')][_0x1619('0x55')]({'where':{'id':_0x311045[_0x1619('0x54')]['id']}})[_0x1619('0x27')](handleEntityNotFound(_0x2a8995,null))[_0x1619('0x27')](function(_0x4bd590){if(_0x4bd590){return _0x4bd590['destroy']()[_0x1619('0x27')](function(_0x25ce76){return _0x25ce76;});}})[_0x1619('0x27')](function(_0xe03f9e){_0x25df0c=_0xe03f9e;if(_0xe03f9e){if(_0xe03f9e[_0x1619('0x5a')]||_0xe03f9e['CampaignId']){return db[_0xe03f9e[_0x1619('0x5a')]?_0x1619('0x5b'):_0x1619('0x5c')][_0x1619('0x55')]({'where':{'id':_0xe03f9e[_0x1619('0x5a')]?_0xe03f9e[_0x1619('0x5a')]:_0xe03f9e[_0x1619('0x5d')]},'attributes':['id',_0x1619('0x4c')],'raw':!![]});}}})['then'](function(_0x3a45a3){var _0x189a88={};if(_0x3a45a3){_['merge'](_0x189a88,_['omit'](_0x25df0c[_0x1619('0x5e')],[_0x1619('0x5f'),_0x1619('0x60'),'id']));_0x189a88['state']=0x15;_0x189a88['statedesc']='deleted';_0x189a88[_0x1619('0x61')]=_0x3a45a3[_0x1619('0x4c')];_0x189a88[_0x1619('0x62')]=_0x311045[_0x1619('0x63')][_0x1619('0x4c')];_0x189a88[_0x1619('0x64')]=_0x311045[_0x1619('0x63')]['id'];_0x189a88[_0x1619('0x65')]=!![];_0x189a88['deletedat']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x189a88[_0x1619('0x66')]=_0x25df0c[_0x1619('0x67')];_0x189a88[_0x1619('0x68')]=_0x25df0c[_0x1619('0x5a')]?_0x1619('0x69'):'ivr';return db[_0x1619('0x6a')][_0x1619('0x55')]({'where':{'id':_0x189a88[_0x1619('0x6b')]},'attributes':['firstName',_0x1619('0x6c')]})[_0x1619('0x27')](function(_0x2cf952){if(!_[_0x1619('0x6d')](_0x2a8995)&&!_['isNil'](_0x2cf952[_0x1619('0x6e')])){_0x189a88[_0x1619('0x6f')]=_0x2cf952[_0x1619('0x6e')];if(!_['isNil'](_0x2cf952[_0x1619('0x6c')])){_0x189a88['calleridname']+='\x20'+_0x2cf952[_0x1619('0x6c')];}}})[_0x1619('0x70')](function(){return db[_0x1619('0x71')]['create'](_0x189a88);});}})['then'](function(_0x532528){return db[_0x1619('0x72')][_0x1619('0x59')]({'where':{'CmHopperId':_0x1e6245}});})['then'](function(){return _0x2a8995['status'](0xcc)[_0x1619('0x1d')]();})[_0x1619('0x53')](handleError(_0x2a8995,null));};exports[_0x1619('0x73')]=function(_0xfdf050,_0xfcec25,_0x16825e){var _0x1a2292=[];return db['CmContact'][_0x1619('0x58')]()['then'](function(_0x11c0f4){_0x1a2292=_['keys'](_0x11c0f4);return _0xfdf050[_0x1619('0x63')][_0x1619('0x74')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0x1619('0x75')},'attributes':['id','dialOrderByScheduledAt',_0x1619('0x76')],'raw':!![]});})[_0x1619('0x27')](function(_0x40932b){if(_0x40932b&&_0x40932b[_0x1619('0x44')]){return db[_0x1619('0x77')]['transaction'](function(_0x59acbc){var _0x3cd864={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x1619('0x78')](_0x1619('0x79'))},'VoiceQueueId':{'$in':_[_0x1619('0x29')](_0x40932b,'id')},'$or':[{'UserId':null},{'UserId':_0xfdf050[_0x1619('0x63')]['id']}]};var _0x14b251={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x40932b)[_0x1619('0x4d')](['dialPreviewAutoRecallMe',0x0])['map']('id')[_0x1619('0x7a')]()},'$or':[{'UserId':null},{'UserId':_0xfdf050[_0x1619('0x63')]['id']}]};var _0x3f78a5={'$or':[_0x3cd864,_0x14b251]};var _0x88856f=[];if(_0xfdf050[_0x1619('0x57')][_0x1619('0x7b')]&&_0xfdf050[_0x1619('0x57')][_0x1619('0x7b')]===_0x1619('0x7c')){if(!_[_0x1619('0x7d')](_0xfdf050[_0x1619('0x57')]['hopperIds'])){_0x3f78a5['id']={'$in':_0xfdf050[_0x1619('0x57')][_0x1619('0x7e')]};}_0x88856f=[[_0x1619('0x7f'),_0x1619('0x80')],[_0x1619('0x81'),_0x40932b[0x0]['dialOrderByScheduledAt']===_0x1619('0x80')?_0x1619('0x82'):_0x1619('0x80')],db[_0x1619('0x77')][_0x1619('0x83')](_0x1619('0x84')),['id',_0x1619('0x82')]];}else{if(!_['isEmpty'](_0xfdf050['body'][_0x1619('0x7e')])){_0x3f78a5['id']={'$notIn':_0xfdf050[_0x1619('0x57')][_0x1619('0x7e')]};}_0x88856f=[[_0x1619('0x7f'),_0x1619('0x82')],[_0x1619('0x81'),_0x40932b[0x0][_0x1619('0x85')]],db['sequelize']['literal'](_0x1619('0x86')),['id','ASC']];}return db[_0x1619('0x2a')]['findOne']({'attributes':['id',_0x1619('0x87'),_0x1619('0x67'),_0x1619('0x88')],'where':_0x3f78a5,'order':_0x88856f,'transaction':_0x59acbc,'lock':_0x59acbc[_0x1619('0x89')][_0x1619('0x8a')],'include':[{'model':db['CmContact'],'as':'Contact','attributes':_0x1a2292,'include':[{'model':db['CmCompany'],'as':'Company','attributes':['id',_0x1619('0x4c')]}]},{'model':db[_0x1619('0x8b')],'as':_0x1619('0x8c'),'attributes':['id','name']},{'model':db[_0x1619('0x5b')],'as':_0x1619('0x8d'),'attributes':['id',_0x1619('0x4c'),_0x1619('0x8e')]}]})[_0x1619('0x27')](function(_0x4b51b8){if(_0x4b51b8){return _0x4b51b8['update']({'UserId':_0xfdf050['user']['id']},{'transaction':_0x59acbc});}});});}})['then'](handleEntityNotFound(_0xfcec25,null))[_0x1619('0x27')](respondWithResult(_0xfcec25,null))[_0x1619('0x53')](handleError(_0xfcec25,null));};exports[_0x1619('0x8f')]=function(_0x574d9b,_0x3f283f,_0x359c56){var _0x266273=[];return db[_0x1619('0x6a')][_0x1619('0x58')]()[_0x1619('0x27')](function(_0x69c8be){_0x266273=_[_0x1619('0x2f')](_0x69c8be);return _0x574d9b[_0x1619('0x63')][_0x1619('0x74')]({'where':{'type':_0x1619('0x90'),'dialActive':!![],'dialMethod':_0x1619('0x75')},'attributes':['id',_0x1619('0x85'),_0x1619('0x76')],'raw':!![]});})[_0x1619('0x27')](function(_0x1aefc5){if(_0x1aefc5&&_0x1aefc5[_0x1619('0x44')]){return db[_0x1619('0x77')]['transaction'](function(_0x3a60be){var _0x3aae98={'active':![],'recallme':!![],'id':_0x574d9b['body'][_0x1619('0x91')]};return db[_0x1619('0x2a')][_0x1619('0x92')]({'attributes':['id',_0x1619('0x87'),_0x1619('0x88')],'where':_0x3aae98,'transaction':_0x3a60be,'lock':_0x3a60be['LOCK']['UPDATE'],'include':[{'model':db[_0x1619('0x6a')],'as':_0x1619('0x93'),'attributes':_0x266273,'include':[{'model':db[_0x1619('0x94')],'as':_0x1619('0x95'),'attributes':['id','name']}]},{'model':db['CmList'],'as':_0x1619('0x8c'),'attributes':['id',_0x1619('0x4c')]},{'model':db[_0x1619('0x5b')],'as':'Queue','attributes':['id',_0x1619('0x4c'),_0x1619('0x8e')]}]})[_0x1619('0x27')](function(_0x1976c2){if(_0x1976c2){return _0x1976c2[_0x1619('0x26')]({'UserId':_0x574d9b[_0x1619('0x63')]['id']},{'transaction':_0x3a60be});}});});}})['then'](handleEntityNotFound(_0x3f283f,null))['then'](respondWithResult(_0x3f283f,null))[_0x1619('0x53')](handleError(_0x3f283f,null));};exports[_0x1619('0x96')]=function(_0x15543e,_0x526bf4,_0x3a0c98){return _0x15543e[_0x1619('0x63')][_0x1619('0x74')]({'where':{'type':_0x1619('0x90'),'dialActive':!![],'dialMethod':_0x1619('0x75')},'attributes':['id'],'raw':!![]})[_0x1619('0x27')](function(_0x180eb8){if(_0x180eb8&&_0x180eb8['length']){return db[_0x1619('0x2a')][_0x1619('0x21')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x1619('0x78')](_0x1619('0x79'))},'VoiceQueueId':{'$in':_[_0x1619('0x29')](_0x180eb8,'id')},'$or':[{'UserId':null},{'UserId':_0x15543e[_0x1619('0x63')]['id']}]}});}return 0x0;})[_0x1619('0x27')](function(_0x3d24a6){if(!_[_0x1619('0x6d')](_0x3d24a6)&&_['isNumber'](_0x3d24a6)){return _0x526bf4[_0x1619('0x1c')](0xc8)['json']({'contacts':_0x3d24a6});}else{logger['error']('CmHopper,\x20%s,\x20%s,\x20%s',_0x1619('0x96'),0x194,'entity\x20not\x20found');_0x526bf4[_0x1619('0x1b')](0x194);}})[_0x1619('0x53')](handleError(_0x526bf4,null));};exports['getTimezones']=function(_0x8e2aa3,_0xc4c90d,_0x415847){var _0x4e1c0b=shared[_0x1619('0x97')];var _0x34a56b=[];_['map'](_0x4e1c0b,function(_0x1f605c){_0x34a56b['push']({'id':_0x1f605c['name'],'name':_0x1f605c['name'],'utcOffset':_0x1f605c[_0x1619('0x98')]});});return _0xc4c90d[_0x1619('0x1c')](0xc8)[_0x1619('0x1e')]({'tz':_0x34a56b});};exports[_0x1619('0x99')]=function(_0x78a518,_0x380a3c,_0x27beff){var _0x56a8e1=shared[_0x1619('0x97')];var _0x5b9e2b={};if(!_[_0x1619('0x6d')](_0x56a8e1[_0x78a518[_0x1619('0x57')]['id']]))_0x5b9e2b=_0x56a8e1[_0x78a518['body']['id']];return _0x380a3c['status'](0xc8)[_0x1619('0x1e')](_0x5b9e2b);};
\ No newline at end of file
+var _0x4fd2=['rimraf','zip-dir','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','then','destroy','error','stack','send','index','map','CmHopper','rawAttributes','fieldName','name','query','keys','filters','concat','$or','$gt','$lt','$ne','$eq','$not','$between','$notBetween','$in','$like','$iLike','$notILike','$overlap','$contains','$contained','$any','attributes','intersection','fields','model','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','describe','CampaignId','VoiceQueueId','VoiceQueue','Campaign','omit','dataValues','updatedAt','state','statedesc','deleted','campaign','membername','user','UserId','deletedat','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','campaigntype','queue','ivr','CmContact','ContactId','firstName','isNil','calleridname','lastName','finally','CmHopperFinal','getPreview','getVoiceQueues','outbound','preview','dialOrderByScheduledAt','dialPreviewAutoRecallMe','sequelize','transaction','format','value','direction','isEmpty','hopperIds','priority','ASC','DESC','COALESCE(CmHopper.UserId,\x200)\x20ASC','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','recallme','LOCK','Contact','CmCompany','Company','CmList','List','dialActive','update','getPreviewRecall','hopperId','UPDATE','Queue','getOpenContacts','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','getTimezones','timezones','push','getTimezone','eml-format'];(function(_0x13c4f8,_0x433521){var _0x5a8f4b=function(_0x1df845){while(--_0x1df845){_0x13c4f8['push'](_0x13c4f8['shift']());}};_0x5a8f4b(++_0x433521);}(_0x4fd2,0x1d9));var _0x24fd=function(_0x146fd1,_0x5a02d2){_0x146fd1=_0x146fd1-0x0;var _0x3c755d=_0x4fd2[_0x146fd1];return _0x3c755d;};'use strict';var emlformat=require(_0x24fd('0x0'));var rimraf=require(_0x24fd('0x1'));var zipdir=require(_0x24fd('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x24fd('0x3'));var moment=require(_0x24fd('0x4'));var BPromise=require(_0x24fd('0x5'));var Mustache=require(_0x24fd('0x6'));var util=require('util');var path=require('path');var sox=require(_0x24fd('0x7'));var csv=require(_0x24fd('0x8'));var ejs=require(_0x24fd('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x24fd('0xa'));var squel=require('squel');var crypto=require(_0x24fd('0xb'));var jsforce=require(_0x24fd('0xc'));var deskjs=require(_0x24fd('0xd'));var toCsv=require(_0x24fd('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x24fd('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x24fd('0xf'));var logger=require(_0x24fd('0x10'))(_0x24fd('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var shared=require('../../config/environment');var licenseUtil=require(_0x24fd('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x431a7b,_0x8d2853){_0x8d2853=_0x8d2853||0xcc;return function(_0xc681a){if(_0xc681a){return _0x431a7b[_0x24fd('0x13')](_0x8d2853);}return _0x431a7b[_0x24fd('0x14')](_0x8d2853)[_0x24fd('0x15')]();};}function respondWithResult(_0x352ad7,_0x29ae1a){_0x29ae1a=_0x29ae1a||0xc8;return function(_0x4780aa){if(_0x4780aa){return _0x352ad7[_0x24fd('0x14')](_0x29ae1a)[_0x24fd('0x16')](_0x4780aa);}};}function respondWithFilteredResult(_0x44b8da,_0xb4a5f7){return function(_0x3a55dc){if(_0x3a55dc){var _0x42869e=typeof _0xb4a5f7[_0x24fd('0x17')]===_0x24fd('0x18')&&typeof _0xb4a5f7[_0x24fd('0x19')]==='undefined';var _0xad75c5=_0x3a55dc['count'];var _0x1b857b=_0x42869e?0x0:_0xb4a5f7[_0x24fd('0x17')];var _0x32d703=_0x42869e?_0x3a55dc[_0x24fd('0x1a')]:_0xb4a5f7[_0x24fd('0x17')]+_0xb4a5f7[_0x24fd('0x19')];var _0x565eef;if(_0x32d703>=_0xad75c5){_0x32d703=_0xad75c5;_0x565eef=0xc8;}else{_0x565eef=0xce;}_0x44b8da[_0x24fd('0x14')](_0x565eef);return _0x44b8da[_0x24fd('0x1b')]('Content-Range',_0x1b857b+'-'+_0x32d703+'/'+_0xad75c5)[_0x24fd('0x16')](_0x3a55dc);}return null;};}function patchUpdates(_0x54be39){return function(_0x1371ba){try{jsonpatch[_0x24fd('0x1c')](_0x1371ba,_0x54be39,!![]);}catch(_0x3c7827){return BPromise[_0x24fd('0x1d')](_0x3c7827);}return _0x1371ba[_0x24fd('0x1e')]();};}function saveUpdates(_0x4ce1df,_0x28e154){return function(_0x5a1b7d){if(_0x5a1b7d){return _0x5a1b7d['update'](_0x4ce1df)[_0x24fd('0x1f')](function(_0xbf6b7b){return _0xbf6b7b;});}return null;};}function removeEntity(_0x368f6b,_0x439734){return function(_0x1e30f8){if(_0x1e30f8){return _0x1e30f8[_0x24fd('0x20')]()[_0x24fd('0x1f')](function(){_0x368f6b[_0x24fd('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c15cd,_0x536723){return function(_0x45f1d1){if(!_0x45f1d1){_0x3c15cd[_0x24fd('0x13')](0x194);}return _0x45f1d1;};}function handleError(_0x1b0d13,_0xd44f71){_0xd44f71=_0xd44f71||0x1f4;return function(_0x48fb2c){logger[_0x24fd('0x21')](_0x48fb2c[_0x24fd('0x22')]);if(_0x48fb2c['name']){delete _0x48fb2c['name'];}_0x1b0d13[_0x24fd('0x14')](_0xd44f71)[_0x24fd('0x23')](_0x48fb2c);};}exports[_0x24fd('0x24')]=function(_0x5e5df9,_0x5106d9){var _0x4e510a={},_0x39a615={},_0x532df7={'count':0x0,'rows':[]};var _0x7369ce=_[_0x24fd('0x25')](db[_0x24fd('0x26')][_0x24fd('0x27')],function(_0x312abf){return{'name':_0x312abf[_0x24fd('0x28')],'type':_0x312abf['type']['key']};});_0x39a615['model']=_[_0x24fd('0x25')](_0x7369ce,_0x24fd('0x29'));_0x39a615[_0x24fd('0x2a')]=_[_0x24fd('0x2b')](_0x5e5df9[_0x24fd('0x2a')]);_0x39a615[_0x24fd('0x2c')]=_['intersection'](_0x39a615['model'],_0x39a615[_0x24fd('0x2a')]);_0x39a615[_0x24fd('0x2c')]=_[_0x24fd('0x2d')](_0x39a615['filters'],['$and',_0x24fd('0x2e'),_0x24fd('0x2f'),'$gte',_0x24fd('0x30'),'$lte',_0x24fd('0x31'),_0x24fd('0x32'),_0x24fd('0x33'),_0x24fd('0x34'),_0x24fd('0x35'),_0x24fd('0x36'),'$notIn',_0x24fd('0x37'),'$notLike',_0x24fd('0x38'),_0x24fd('0x39'),_0x24fd('0x37'),_0x24fd('0x3a'),_0x24fd('0x3b'),_0x24fd('0x3c'),_0x24fd('0x3d')]);_0x4e510a[_0x24fd('0x3e')]=_[_0x24fd('0x3f')](_0x39a615['model'],qs[_0x24fd('0x40')](_0x5e5df9[_0x24fd('0x2a')][_0x24fd('0x40')]));_0x4e510a[_0x24fd('0x3e')]=_0x4e510a[_0x24fd('0x3e')]['length']?_0x4e510a['attributes']:_0x39a615[_0x24fd('0x41')];if(!_0x5e5df9['query'][_0x24fd('0x42')](_0x24fd('0x43'))){_0x4e510a[_0x24fd('0x19')]=qs[_0x24fd('0x19')](_0x5e5df9[_0x24fd('0x2a')][_0x24fd('0x19')]);_0x4e510a[_0x24fd('0x17')]=qs[_0x24fd('0x17')](_0x5e5df9[_0x24fd('0x2a')][_0x24fd('0x17')]);}_0x4e510a[_0x24fd('0x44')]=qs['sort'](_0x5e5df9[_0x24fd('0x2a')][_0x24fd('0x45')]);_0x4e510a[_0x24fd('0x46')]=qs[_0x24fd('0x2c')](_[_0x24fd('0x47')](_0x5e5df9[_0x24fd('0x2a')],_0x39a615[_0x24fd('0x2c')]),_0x7369ce);if(_0x5e5df9[_0x24fd('0x2a')]['filter']){_0x4e510a['where']=_[_0x24fd('0x48')](_0x4e510a[_0x24fd('0x46')],{'$or':_[_0x24fd('0x25')](_0x7369ce,function(_0x1ee6ec){if(_0x1ee6ec[_0x24fd('0x49')]!==_0x24fd('0x4a')){var _0x5616f1={};_0x5616f1[_0x1ee6ec['name']]={'$like':'%'+_0x5e5df9[_0x24fd('0x2a')]['filter']+'%'};return _0x5616f1;}})});}_0x4e510a=_[_0x24fd('0x48')]({},_0x4e510a,_0x5e5df9[_0x24fd('0x4b')]);var _0x2f5086={'where':_0x4e510a[_0x24fd('0x46')]};return db[_0x24fd('0x26')]['count'](_0x2f5086)['then'](function(_0x2f456e){_0x532df7['count']=_0x2f456e;if(_0x5e5df9['query'][_0x24fd('0x4c')]){_0x4e510a[_0x24fd('0x4d')]=[{'all':!![]}];}return db[_0x24fd('0x26')][_0x24fd('0x4e')](_0x4e510a);})[_0x24fd('0x1f')](function(_0x364b41){_0x532df7[_0x24fd('0x4f')]=_0x364b41;return _0x532df7;})[_0x24fd('0x1f')](respondWithFilteredResult(_0x5106d9,_0x4e510a))[_0x24fd('0x50')](handleError(_0x5106d9,null));};exports[_0x24fd('0x51')]=function(_0x1b7777,_0x14f785){var _0x51f0db={'raw':!![],'where':{'id':_0x1b7777[_0x24fd('0x52')]['id']}},_0x1a0e8b={};_0x1a0e8b[_0x24fd('0x41')]=_[_0x24fd('0x2b')](db[_0x24fd('0x26')][_0x24fd('0x27')]);_0x1a0e8b[_0x24fd('0x2a')]=_[_0x24fd('0x2b')](_0x1b7777[_0x24fd('0x2a')]);_0x1a0e8b[_0x24fd('0x2c')]=_[_0x24fd('0x3f')](_0x1a0e8b['model'],_0x1a0e8b[_0x24fd('0x2a')]);_0x51f0db[_0x24fd('0x3e')]=_[_0x24fd('0x3f')](_0x1a0e8b[_0x24fd('0x41')],qs[_0x24fd('0x40')](_0x1b7777['query'][_0x24fd('0x40')]));_0x51f0db[_0x24fd('0x3e')]=_0x51f0db[_0x24fd('0x3e')][_0x24fd('0x53')]?_0x51f0db['attributes']:_0x1a0e8b[_0x24fd('0x41')];if(_0x1b7777[_0x24fd('0x2a')]['includeAll']){_0x51f0db['include']=[{'all':!![]}];}_0x51f0db=_[_0x24fd('0x48')]({},_0x51f0db,_0x1b7777[_0x24fd('0x4b')]);return db['CmHopper'][_0x24fd('0x54')](_0x51f0db)['then'](handleEntityNotFound(_0x14f785,null))[_0x24fd('0x1f')](respondWithResult(_0x14f785,null))['catch'](handleError(_0x14f785,null));};exports[_0x24fd('0x55')]=function(_0x494e9f,_0x2e256e){return db[_0x24fd('0x26')]['create'](_0x494e9f[_0x24fd('0x56')],{})['then'](respondWithResult(_0x2e256e,0xc9))['catch'](handleError(_0x2e256e,null));};exports['update']=function(_0x150850,_0x413a74){if(_0x150850[_0x24fd('0x56')]['id']){delete _0x150850[_0x24fd('0x56')]['id'];}return db[_0x24fd('0x26')][_0x24fd('0x54')]({'where':{'id':_0x150850[_0x24fd('0x52')]['id']}})[_0x24fd('0x1f')](handleEntityNotFound(_0x413a74,null))['then'](saveUpdates(_0x150850[_0x24fd('0x56')],null))[_0x24fd('0x1f')](respondWithResult(_0x413a74,null))[_0x24fd('0x50')](handleError(_0x413a74,null));};exports[_0x24fd('0x57')]=function(_0x56e282,_0xc66380){return db[_0x24fd('0x26')][_0x24fd('0x57')]()[_0x24fd('0x1f')](respondWithResult(_0xc66380,null))[_0x24fd('0x50')](handleError(_0xc66380,null));};exports[_0x24fd('0x20')]=function(_0x464970,_0x41cf13){var _0x4288d7;var _0x580944=_0x464970[_0x24fd('0x52')]['id'];return db[_0x24fd('0x26')][_0x24fd('0x54')]({'where':{'id':_0x464970[_0x24fd('0x52')]['id']}})['then'](handleEntityNotFound(_0x41cf13,null))[_0x24fd('0x1f')](function(_0x4fec01){if(_0x4fec01){return _0x4fec01[_0x24fd('0x20')]()[_0x24fd('0x1f')](function(_0x1ea9f1){return _0x1ea9f1;});}})[_0x24fd('0x1f')](function(_0x4e4895){_0x4288d7=_0x4e4895;if(_0x4e4895){if(_0x4e4895['VoiceQueueId']||_0x4e4895[_0x24fd('0x58')]){return db[_0x4e4895[_0x24fd('0x59')]?_0x24fd('0x5a'):_0x24fd('0x5b')]['find']({'where':{'id':_0x4e4895['VoiceQueueId']?_0x4e4895['VoiceQueueId']:_0x4e4895['CampaignId']},'attributes':['id','name'],'raw':!![]});}}})[_0x24fd('0x1f')](function(_0x351590){var _0x31aa0e={};if(_0x351590){_[_0x24fd('0x48')](_0x31aa0e,_[_0x24fd('0x5c')](_0x4288d7[_0x24fd('0x5d')],['createdAt',_0x24fd('0x5e'),'id']));_0x31aa0e[_0x24fd('0x5f')]=0x15;_0x31aa0e[_0x24fd('0x60')]=_0x24fd('0x61');_0x31aa0e[_0x24fd('0x62')]=_0x351590['name'];_0x31aa0e[_0x24fd('0x63')]=_0x464970[_0x24fd('0x64')][_0x24fd('0x29')];_0x31aa0e[_0x24fd('0x65')]=_0x464970['user']['id'];_0x31aa0e[_0x24fd('0x61')]=!![];_0x31aa0e[_0x24fd('0x66')]=moment()['format'](_0x24fd('0x67'));_0x31aa0e[_0x24fd('0x68')]=_0x4288d7[_0x24fd('0x69')];_0x31aa0e[_0x24fd('0x6a')]=_0x4288d7[_0x24fd('0x59')]?_0x24fd('0x6b'):_0x24fd('0x6c');return db[_0x24fd('0x6d')][_0x24fd('0x54')]({'where':{'id':_0x31aa0e[_0x24fd('0x6e')]},'attributes':[_0x24fd('0x6f'),'lastName']})['then'](function(_0x41172b){if(!_[_0x24fd('0x70')](_0x41cf13)&&!_[_0x24fd('0x70')](_0x41172b[_0x24fd('0x6f')])){_0x31aa0e[_0x24fd('0x71')]=_0x41172b['firstName'];if(!_[_0x24fd('0x70')](_0x41172b[_0x24fd('0x72')])){_0x31aa0e[_0x24fd('0x71')]+='\x20'+_0x41172b[_0x24fd('0x72')];}}})[_0x24fd('0x73')](function(){return db[_0x24fd('0x74')]['create'](_0x31aa0e);});}})[_0x24fd('0x1f')](function(_0x5eb7e8){return db['CmHopperAdditionalPhone'][_0x24fd('0x20')]({'where':{'CmHopperId':_0x580944}});})[_0x24fd('0x1f')](function(){return _0x41cf13['status'](0xcc)['end']();})[_0x24fd('0x50')](handleError(_0x41cf13,null));};exports[_0x24fd('0x75')]=function(_0x3c3d0a,_0x981369,_0x192faf){var _0x240831=[];return db[_0x24fd('0x6d')][_0x24fd('0x57')]()[_0x24fd('0x1f')](function(_0x181e00){_0x240831=_['keys'](_0x181e00);return _0x3c3d0a[_0x24fd('0x64')][_0x24fd('0x76')]({'where':{'type':_0x24fd('0x77'),'dialActive':!![],'dialMethod':_0x24fd('0x78')},'attributes':['id',_0x24fd('0x79'),_0x24fd('0x7a')],'raw':!![]});})[_0x24fd('0x1f')](function(_0x5d008f){if(_0x5d008f&&_0x5d008f[_0x24fd('0x53')]){return db[_0x24fd('0x7b')][_0x24fd('0x7c')](function(_0x582657){var _0x26195c={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x24fd('0x7d')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0x24fd('0x25')](_0x5d008f,'id')},'$or':[{'UserId':null},{'UserId':_0x3c3d0a['user']['id']}]};var _0x47bcc8={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x5d008f)['filter']([_0x24fd('0x7a'),0x0])[_0x24fd('0x25')]('id')[_0x24fd('0x7e')]()},'$or':[{'UserId':null},{'UserId':_0x3c3d0a[_0x24fd('0x64')]['id']}]};var _0x453954={'$or':[_0x26195c,_0x47bcc8]};var _0x5cc786=[];if(_0x3c3d0a[_0x24fd('0x56')][_0x24fd('0x7f')]&&_0x3c3d0a[_0x24fd('0x56')]['direction']==='prev'){if(!_[_0x24fd('0x80')](_0x3c3d0a['body']['hopperIds'])){_0x453954['id']={'$in':_0x3c3d0a['body'][_0x24fd('0x81')]};}_0x5cc786=[[_0x24fd('0x82'),'ASC'],['scheduledAt',_0x5d008f[0x0][_0x24fd('0x79')]===_0x24fd('0x83')?_0x24fd('0x84'):_0x24fd('0x83')],db[_0x24fd('0x7b')]['literal'](_0x24fd('0x85')),['id',_0x24fd('0x84')]];}else{if(!_[_0x24fd('0x80')](_0x3c3d0a['body'][_0x24fd('0x81')])){_0x453954['id']={'$notIn':_0x3c3d0a[_0x24fd('0x56')][_0x24fd('0x81')]};}_0x5cc786=[[_0x24fd('0x82'),_0x24fd('0x84')],['scheduledAt',_0x5d008f[0x0]['dialOrderByScheduledAt']],db['sequelize']['literal'](_0x24fd('0x86')),['id','ASC']];}return db[_0x24fd('0x26')][_0x24fd('0x87')]({'attributes':['id',_0x24fd('0x88'),_0x24fd('0x69'),_0x24fd('0x89')],'where':_0x453954,'order':_0x5cc786,'transaction':_0x582657,'lock':_0x582657[_0x24fd('0x8a')]['UPDATE'],'include':[{'model':db[_0x24fd('0x6d')],'as':_0x24fd('0x8b'),'attributes':_0x240831,'include':[{'model':db[_0x24fd('0x8c')],'as':_0x24fd('0x8d'),'attributes':['id',_0x24fd('0x29')]}]},{'model':db[_0x24fd('0x8e')],'as':_0x24fd('0x8f'),'attributes':['id','name']},{'model':db[_0x24fd('0x5a')],'as':'Queue','attributes':['id',_0x24fd('0x29'),_0x24fd('0x90')]}]})['then'](function(_0x30d88c){if(_0x30d88c){return _0x30d88c[_0x24fd('0x91')]({'UserId':_0x3c3d0a[_0x24fd('0x64')]['id']},{'transaction':_0x582657});}});});}})[_0x24fd('0x1f')](handleEntityNotFound(_0x981369,null))['then'](respondWithResult(_0x981369,null))[_0x24fd('0x50')](handleError(_0x981369,null));};exports[_0x24fd('0x92')]=function(_0x7c070c,_0x3a466e,_0x1794e1){var _0x46a09f=[];return db[_0x24fd('0x6d')][_0x24fd('0x57')]()[_0x24fd('0x1f')](function(_0x59c730){_0x46a09f=_[_0x24fd('0x2b')](_0x59c730);return _0x7c070c[_0x24fd('0x64')]['getVoiceQueues']({'where':{'type':_0x24fd('0x77'),'dialActive':!![],'dialMethod':_0x24fd('0x78')},'attributes':['id','dialOrderByScheduledAt',_0x24fd('0x7a')],'raw':!![]});})[_0x24fd('0x1f')](function(_0x55d10a){if(_0x55d10a&&_0x55d10a[_0x24fd('0x53')]){return db[_0x24fd('0x7b')][_0x24fd('0x7c')](function(_0x2318d1){var _0x49ad92={'active':![],'recallme':!![],'id':_0x7c070c[_0x24fd('0x56')][_0x24fd('0x93')]};return db[_0x24fd('0x26')][_0x24fd('0x87')]({'attributes':['id','scheduledat',_0x24fd('0x89')],'where':_0x49ad92,'transaction':_0x2318d1,'lock':_0x2318d1['LOCK'][_0x24fd('0x94')],'include':[{'model':db['CmContact'],'as':_0x24fd('0x8b'),'attributes':_0x46a09f,'include':[{'model':db['CmCompany'],'as':_0x24fd('0x8d'),'attributes':['id',_0x24fd('0x29')]}]},{'model':db['CmList'],'as':'List','attributes':['id',_0x24fd('0x29')]},{'model':db[_0x24fd('0x5a')],'as':_0x24fd('0x95'),'attributes':['id',_0x24fd('0x29'),_0x24fd('0x90')]}]})[_0x24fd('0x1f')](function(_0x539722){if(_0x539722){return _0x539722['update']({'UserId':_0x7c070c['user']['id']},{'transaction':_0x2318d1});}});});}})[_0x24fd('0x1f')](handleEntityNotFound(_0x3a466e,null))[_0x24fd('0x1f')](respondWithResult(_0x3a466e,null))[_0x24fd('0x50')](handleError(_0x3a466e,null));};exports[_0x24fd('0x96')]=function(_0x3bc1a0,_0x12dccb,_0x26e460){return _0x3bc1a0['user'][_0x24fd('0x76')]({'where':{'type':_0x24fd('0x77'),'dialActive':!![],'dialMethod':_0x24fd('0x78')},'attributes':['id'],'raw':!![]})[_0x24fd('0x1f')](function(_0x2d208e){if(_0x2d208e&&_0x2d208e[_0x24fd('0x53')]){return db[_0x24fd('0x26')][_0x24fd('0x1a')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x24fd('0x7d')](_0x24fd('0x67'))},'VoiceQueueId':{'$in':_[_0x24fd('0x25')](_0x2d208e,'id')},'$or':[{'UserId':null},{'UserId':_0x3bc1a0[_0x24fd('0x64')]['id']}]}});}return 0x0;})['then'](function(_0x191820){if(!_['isNil'](_0x191820)&&_[_0x24fd('0x97')](_0x191820)){return _0x12dccb[_0x24fd('0x14')](0xc8)['json']({'contacts':_0x191820});}else{logger[_0x24fd('0x21')](_0x24fd('0x98'),_0x24fd('0x96'),0x194,_0x24fd('0x99'));_0x12dccb[_0x24fd('0x13')](0x194);}})['catch'](handleError(_0x12dccb,null));};exports[_0x24fd('0x9a')]=function(_0x12fad5,_0x14120f,_0x2859a8){var _0x5e80bb=shared[_0x24fd('0x9b')];var _0x1ffc87=[];_[_0x24fd('0x25')](_0x5e80bb,function(_0x507048){_0x1ffc87[_0x24fd('0x9c')]({'id':_0x507048[_0x24fd('0x29')],'name':_0x507048[_0x24fd('0x29')],'utcOffset':_0x507048['utcOffset']});});return _0x14120f[_0x24fd('0x14')](0xc8)['json']({'tz':_0x1ffc87});};exports[_0x24fd('0x9d')]=function(_0x381d44,_0x407383,_0x112ec2){var _0x1595b9=shared[_0x24fd('0x9b')];var _0x36250a={};if(!_['isNil'](_0x1595b9[_0x381d44[_0x24fd('0x56')]['id']]))_0x36250a=_0x1595b9[_0x381d44[_0x24fd('0x56')]['id']];return _0x407383[_0x24fd('0x14')](0xc8)[_0x24fd('0x16')](_0x36250a);};
\ No newline at end of file
index 339926d..21bbf98 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe3da=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopper.attributes','exports','define','CmHopper','scheduledat','priority','lodash','util','../../config/logger'];(function(_0x534bbc,_0x5d40fc){var _0x41117d=function(_0x498443){while(--_0x498443){_0x534bbc['push'](_0x534bbc['shift']());}};_0x41117d(++_0x5d40fc);}(_0xe3da,0x1cd));var _0xae3d=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xe3da[_0x2641f9];return _0x585741;};'use strict';var _=require(_0xae3d('0x0'));var util=require(_0xae3d('0x1'));var logger=require(_0xae3d('0x2'))(_0xae3d('0x3'));var moment=require(_0xae3d('0x4'));var BPromise=require(_0xae3d('0x5'));var rp=require(_0xae3d('0x6'));var fs=require('fs');var path=require(_0xae3d('0x7'));var rimraf=require(_0xae3d('0x8'));var config=require(_0xae3d('0x9'));var attributes=require(_0xae3d('0xa'));module[_0xae3d('0xb')]=function(_0xa9a1a,_0xa54808){return _0xa9a1a[_0xae3d('0xc')](_0xae3d('0xd'),attributes,{'tableName':'cm_hopper','paranoid':![],'indexes':[{'name':_0xae3d('0xe'),'fields':[_0xae3d('0xe')]},{'name':'phone','fields':['phone']},{'name':_0xae3d('0xf'),'fields':[_0xae3d('0xf')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x1261=['path','rimraf','../../config/environment','./cmHopper.attributes','define','cm_hopper','scheduledat','phone','priority','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x40e22e,_0x457644){var _0x3089ee=function(_0x26fe80){while(--_0x26fe80){_0x40e22e['push'](_0x40e22e['shift']());}};_0x3089ee(++_0x457644);}(_0x1261,0x144));var _0x1126=function(_0x188d31,_0x576e87){_0x188d31=_0x188d31-0x0;var _0x30ed33=_0x1261[_0x188d31];return _0x30ed33;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var logger=require(_0x1126('0x1'))(_0x1126('0x2'));var moment=require(_0x1126('0x3'));var BPromise=require(_0x1126('0x4'));var rp=require(_0x1126('0x5'));var fs=require('fs');var path=require(_0x1126('0x6'));var rimraf=require(_0x1126('0x7'));var config=require(_0x1126('0x8'));var attributes=require(_0x1126('0x9'));module['exports']=function(_0x5c68c8,_0x40ba58){return _0x5c68c8[_0x1126('0xa')]('CmHopper',attributes,{'tableName':_0x1126('0xb'),'paranoid':![],'indexes':[{'name':_0x1126('0xc'),'fields':[_0x1126('0xc')]},{'name':_0x1126('0xd'),'fields':[_0x1126('0xd')]},{'name':'priority','fields':[_0x1126('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
index b2191f1..cc10ebb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd766=['update','includes','all','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','ContactId','MoveContactManagedDialer','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','COUNT','literal','`scheduledat`\x20>=\x20','\x22%s\x22','format','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','CountReScheduled','GetContactRecallMe','GetContactByPhone','phone','dialTimezone','DESC','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','voiceQueueId','interval','NOW()\x20+\x20INTERVAL\x20','\x20MINUTE','List','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','twilio/lib/webhooks/webhooks','http','then','info','CmHopper,\x20%s,\x20%s','CmHopper,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','GetCmHopper','findAll','options','raw','attributes','limit','include','map','model','stringify','ShowCmHopper','CmHopper','where','CreateCmHopper','create','body','debug','UpdateCmHopper','active','DestroyCmHopper','destroy','GetContactDialer','CmContact','describe','sequelize','transaction','order','LOCK','UPDATE','Contact','keys','User','Agent','name','voicePause','length','UserId','push'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0xd766,0x126));var _0x6d76=function(_0x48a928,_0x430727){_0x48a928=_0x48a928-0x0;var _0x11c1e9=_0xd766[_0x48a928];return _0x11c1e9;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x6d76('0x0'));var BPromise=require(_0x6d76('0x1'));var rs=require(_0x6d76('0x2'));var fs=require('fs');var Redis=require(_0x6d76('0x3'));var db=require(_0x6d76('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x6d76('0x5'))('rpc');var config=require(_0x6d76('0x6'));var jayson=require(_0x6d76('0x7'));const {validateExpressRequest}=require(_0x6d76('0x8'));var client=jayson['client'][_0x6d76('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x43bb5f,_0xbff865,_0x548a90){return new BPromise(function(_0x26f235,_0x3bb293){return client['request'](_0x43bb5f,_0x548a90)[_0x6d76('0xa')](function(_0x25162e){logger[_0x6d76('0xb')](_0x6d76('0xc'),_0xbff865,'request\x20sent');logger['debug'](_0x6d76('0xd'),_0xbff865,_0x6d76('0xe'),JSON['stringify'](_0x25162e));if(_0x25162e[_0x6d76('0xf')]){if(_0x25162e[_0x6d76('0xf')][_0x6d76('0x10')]===0x1f4){logger[_0x6d76('0xf')](_0x6d76('0xc'),_0xbff865,_0x25162e[_0x6d76('0xf')][_0x6d76('0x11')]);return _0x3bb293(_0x25162e[_0x6d76('0xf')][_0x6d76('0x11')]);}logger[_0x6d76('0xf')](_0x6d76('0xc'),_0xbff865,_0x25162e[_0x6d76('0xf')][_0x6d76('0x11')]);return _0x26f235(_0x25162e[_0x6d76('0xf')][_0x6d76('0x11')]);}else{logger[_0x6d76('0xb')](_0x6d76('0xc'),_0xbff865,_0x6d76('0xe'));_0x26f235(_0x25162e[_0x6d76('0x12')][_0x6d76('0x11')]);}})[_0x6d76('0x13')](function(_0x56fa59){logger[_0x6d76('0xf')](_0x6d76('0xc'),_0xbff865,_0x56fa59);_0x3bb293(_0x56fa59);});});}exports[_0x6d76('0x14')]=function(_0x238751){var _0x7ff910=this;return new Promise(function(_0xda79a4,_0x2003d7){return db['CmHopper'][_0x6d76('0x15')]({'raw':_0x238751[_0x6d76('0x16')]?_0x238751[_0x6d76('0x16')][_0x6d76('0x17')]===undefined?!![]:![]:!![],'where':_0x238751['options']?_0x238751[_0x6d76('0x16')]['where']||null:null,'attributes':_0x238751[_0x6d76('0x16')]?_0x238751[_0x6d76('0x16')][_0x6d76('0x18')]||null:null,'limit':_0x238751[_0x6d76('0x16')]?_0x238751[_0x6d76('0x16')][_0x6d76('0x19')]||null:null,'include':_0x238751['options']?_0x238751[_0x6d76('0x16')][_0x6d76('0x1a')]?_[_0x6d76('0x1b')](_0x238751[_0x6d76('0x16')][_0x6d76('0x1a')],function(_0x3c1173){return{'model':db[_0x3c1173['model']],'as':_0x3c1173['as'],'attributes':_0x3c1173[_0x6d76('0x18')],'include':_0x3c1173[_0x6d76('0x1a')]?_[_0x6d76('0x1b')](_0x3c1173[_0x6d76('0x1a')],function(_0x5b01bf){return{'model':db[_0x5b01bf[_0x6d76('0x1c')]],'as':_0x5b01bf['as'],'attributes':_0x5b01bf[_0x6d76('0x18')],'include':_0x5b01bf['include']?_[_0x6d76('0x1b')](_0x5b01bf[_0x6d76('0x1a')],function(_0x562c77){return{'model':db[_0x562c77[_0x6d76('0x1c')]],'as':_0x562c77['as'],'attributes':_0x562c77['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x17bfd7){logger[_0x6d76('0xb')](_0x6d76('0x14'),_0x238751);logger['debug']('GetCmHopper',_0x238751,JSON[_0x6d76('0x1d')](_0x17bfd7));_0xda79a4(_0x17bfd7);})[_0x6d76('0x13')](function(_0x391c50){logger[_0x6d76('0xf')](_0x6d76('0x14'),_0x391c50[_0x6d76('0x11')],_0x238751);_0x2003d7(_0x7ff910[_0x6d76('0xf')](0x1f4,_0x391c50[_0x6d76('0x11')]));});});};exports[_0x6d76('0x1e')]=function(_0x3ad5f3){var _0x10b13b=this;return new Promise(function(_0x37fcab,_0x4778d1){return db[_0x6d76('0x1f')]['find']({'raw':_0x3ad5f3[_0x6d76('0x16')]?_0x3ad5f3[_0x6d76('0x16')][_0x6d76('0x17')]===undefined?!![]:![]:!![],'where':_0x3ad5f3['options']?_0x3ad5f3[_0x6d76('0x16')][_0x6d76('0x20')]||null:null,'attributes':_0x3ad5f3['options']?_0x3ad5f3[_0x6d76('0x16')]['attributes']||null:null,'include':_0x3ad5f3[_0x6d76('0x16')]?_0x3ad5f3[_0x6d76('0x16')][_0x6d76('0x1a')]?_[_0x6d76('0x1b')](_0x3ad5f3[_0x6d76('0x16')][_0x6d76('0x1a')],function(_0x5e7c45){return{'model':db[_0x5e7c45[_0x6d76('0x1c')]],'as':_0x5e7c45['as'],'attributes':_0x5e7c45[_0x6d76('0x18')],'include':_0x5e7c45[_0x6d76('0x1a')]?_['map'](_0x5e7c45['include'],function(_0x32de47){return{'model':db[_0x32de47['model']],'as':_0x32de47['as'],'attributes':_0x32de47[_0x6d76('0x18')],'include':_0x32de47[_0x6d76('0x1a')]?_[_0x6d76('0x1b')](_0x32de47[_0x6d76('0x1a')],function(_0xd2cfea){return{'model':db[_0xd2cfea[_0x6d76('0x1c')]],'as':_0xd2cfea['as'],'attributes':_0xd2cfea['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x2f67ad){logger['info'](_0x6d76('0x1e'),_0x3ad5f3);logger['debug'](_0x6d76('0x1e'),_0x3ad5f3,JSON['stringify'](_0x2f67ad));_0x37fcab(_0x2f67ad);})[_0x6d76('0x13')](function(_0x929db5){logger[_0x6d76('0xf')](_0x6d76('0x1e'),_0x929db5[_0x6d76('0x11')],_0x3ad5f3);_0x4778d1(_0x10b13b[_0x6d76('0xf')](0x1f4,_0x929db5['message']));});});};exports[_0x6d76('0x21')]=function(_0x1b3ab9){var _0x1fc804=this;return new Promise(function(_0x3c5bfc,_0xc130a){return db['CmHopper'][_0x6d76('0x22')](_0x1b3ab9[_0x6d76('0x23')],{'raw':_0x1b3ab9[_0x6d76('0x16')]?_0x1b3ab9[_0x6d76('0x16')][_0x6d76('0x17')]===undefined?!![]:![]:!![]})[_0x6d76('0xa')](function(_0x54f65b){logger[_0x6d76('0xb')](_0x6d76('0x21'),_0x1b3ab9);logger[_0x6d76('0x24')](_0x6d76('0x21'),_0x1b3ab9,JSON[_0x6d76('0x1d')](_0x54f65b));_0x3c5bfc(_0x54f65b);})[_0x6d76('0x13')](function(_0x3f4eba){logger[_0x6d76('0xf')](_0x6d76('0x21'),_0x3f4eba[_0x6d76('0x11')],_0x1b3ab9);_0xc130a(_0x1fc804['error'](0x1f4,_0x3f4eba[_0x6d76('0x11')]));});});};exports[_0x6d76('0x25')]=function(_0x1aedf4){var _0x576d7c=this;return new Promise(function(_0x310b53,_0x4bcf15){return db[_0x6d76('0x1f')]['update'](_0x1aedf4[_0x6d76('0x23')],{'raw':_0x1aedf4['options']?_0x1aedf4['options'][_0x6d76('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1aedf4['options']?_0x1aedf4[_0x6d76('0x16')]['where']||null:null,'attributes':_0x1aedf4['options']?_0x1aedf4[_0x6d76('0x16')]['attributes']||null:null,'limit':_0x1aedf4[_0x6d76('0x16')]?_0x1aedf4['options'][_0x6d76('0x19')]||null:null})[_0x6d76('0xa')](function(_0x105412){logger['info'](_0x6d76('0x25'),_0x1aedf4);logger[_0x6d76('0xb')]('UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]',JSON[_0x6d76('0x1d')](_0x1aedf4[_0x6d76('0x16')]['where']),_0x1aedf4[_0x6d76('0x23')][_0x6d76('0x26')]);logger[_0x6d76('0x24')](_0x6d76('0x25'),_0x1aedf4,JSON['stringify'](_0x105412));_0x310b53(_0x105412);})[_0x6d76('0x13')](function(_0x2389ea){logger[_0x6d76('0xf')](_0x6d76('0x25'),_0x2389ea[_0x6d76('0x11')],_0x1aedf4);_0x4bcf15(_0x576d7c[_0x6d76('0xf')](0x1f4,_0x2389ea[_0x6d76('0x11')]));});});};exports[_0x6d76('0x27')]=function(_0x4e5d82){var _0x254b85=this;return new Promise(function(_0x400651,_0x279263){return db[_0x6d76('0x1f')][_0x6d76('0x28')]({'where':_0x4e5d82[_0x6d76('0x16')]?_0x4e5d82[_0x6d76('0x16')][_0x6d76('0x20')]||null:null})[_0x6d76('0xa')](function(_0x5812eb){logger[_0x6d76('0xb')](_0x6d76('0x27'),_0x4e5d82);logger[_0x6d76('0x24')]('DestroyCmHopper',_0x4e5d82,JSON['stringify'](_0x5812eb));_0x400651(_0x5812eb);})['catch'](function(_0x391771){logger[_0x6d76('0xf')](_0x6d76('0x27'),_0x391771[_0x6d76('0x11')],_0x4e5d82);_0x279263(_0x254b85[_0x6d76('0xf')](0x1f4,_0x391771['message']));});});};exports[_0x6d76('0x29')]=function(_0x5a96d2){var _0x6a0dc4=this;return new Promise(function(_0x143321,_0x3aca69){return db[_0x6d76('0x2a')][_0x6d76('0x2b')]()[_0x6d76('0xa')](function(_0xc569d7){return db[_0x6d76('0x2c')][_0x6d76('0x2d')](function(_0x4006d6){return db[_0x6d76('0x1f')][_0x6d76('0x15')]({'where':_0x5a96d2[_0x6d76('0x16')]?_0x5a96d2[_0x6d76('0x16')][_0x6d76('0x20')]||null:null,'attributes':_0x5a96d2[_0x6d76('0x16')]?_0x5a96d2[_0x6d76('0x16')]['attributes']||null:null,'limit':_0x5a96d2[_0x6d76('0x16')]?_0x5a96d2[_0x6d76('0x16')]['limit']||null:null,'order':_0x5a96d2[_0x6d76('0x16')]?_0x5a96d2[_0x6d76('0x16')][_0x6d76('0x2e')]||null:null,'transaction':_0x4006d6,'lock':_0x4006d6[_0x6d76('0x2f')][_0x6d76('0x30')],'include':[{'model':db[_0x6d76('0x2a')],'as':_0x6d76('0x31'),'attributes':_[_0x6d76('0x32')](_0xc569d7)},{'model':db[_0x6d76('0x33')],'as':_0x6d76('0x34'),'attributes':['id',_0x6d76('0x35'),_0x6d76('0x36')]}]})[_0x6d76('0xa')](function(_0x4ba243){var _0x518175=[];var _0x5c4ba0=[];for(var _0x510041=0x0;_0x510041<_0x4ba243[_0x6d76('0x37')];_0x510041+=0x1){var _0x5838e6=_0x4ba243[_0x510041][_0x6d76('0x38')];if(_0x5838e6===null){_0x518175[_0x6d76('0x39')](_0x4ba243[_0x510041][_0x6d76('0x3a')](_0x5a96d2['body'],{'transaction':_0x4006d6}));}else if(!_0x5c4ba0[_0x6d76('0x3b')](_0x5838e6)){_0x5c4ba0[_0x6d76('0x39')](_0x5838e6);_0x518175[_0x6d76('0x39')](_0x4ba243[_0x510041]['update'](_0x5a96d2['body'],{'transaction':_0x4006d6}));}}return BPromise[_0x6d76('0x3c')](_0x518175);});})['then'](function(_0x126fe3){logger[_0x6d76('0xb')](_0x6d76('0x29'),_0x5a96d2);if(_0x126fe3[_0x6d76('0x37')]>0x0){logger['info'](_0x6d76('0x3d'),_0x126fe3[0x0][_0x6d76('0x3e')]['id'],_0x126fe3[0x0][_0x6d76('0x3e')][_0x6d76('0x3f')],_0x126fe3[0x0][_0x6d76('0x3e')][_0x6d76('0x26')]);}logger['debug']('GetContactDialer',_0x5a96d2,JSON[_0x6d76('0x1d')](_0x126fe3));_0x143321(_0x126fe3);})[_0x6d76('0x13')](function(_0x5b119e){logger['error'](_0x6d76('0x29'),_0x5b119e[_0x6d76('0x11')],_0x5a96d2);_0x3aca69(_0x6a0dc4['error'](0x1f4,_0x5b119e[_0x6d76('0x11')]));});});});};exports[_0x6d76('0x40')]=function(_0x474804){var _0x4aba7d=this;return new Promise(function(_0x2d47cc,_0x5b6eaf){return db[_0x6d76('0x2c')][_0x6d76('0x2d')](function(_0x70b214){return db['CmHopperFinal'][_0x6d76('0x22')](_0x474804[_0x6d76('0x23')],{'raw':_0x474804[_0x6d76('0x16')]?_0x474804[_0x6d76('0x16')][_0x6d76('0x17')]===undefined?!![]:![]:!![],'transaction':_0x70b214})[_0x6d76('0xa')](function(){logger['info'](_0x6d76('0x41'),JSON[_0x6d76('0x1d')](_0x474804[_0x6d76('0x16')][_0x6d76('0x20')]),_0x474804[_0x6d76('0x16')][_0x6d76('0x20')]['active']);return db[_0x6d76('0x1f')]['destroy']({'where':_0x474804[_0x6d76('0x16')]?_0x474804[_0x6d76('0x16')][_0x6d76('0x20')]||null:null,'transaction':_0x70b214});});})[_0x6d76('0xa')](function(_0x5461e2){logger['info'](_0x6d76('0x40'),_0x474804);logger['debug'](_0x6d76('0x40'),_0x474804,JSON[_0x6d76('0x1d')](_0x5461e2));_0x2d47cc(_0x5461e2);})[_0x6d76('0x13')](function(_0x374af7){logger['error'](_0x6d76('0x40'),_0x374af7[_0x6d76('0x11')],_0x474804);_0x5b6eaf(_0x4aba7d['error'](0x1f4,_0x374af7[_0x6d76('0x11')]));});});};exports['CountReScheduled']=function(_0x4ca0d4){var _0x37715d=this;return new Promise(function(_0x2f5c5c,_0x316e94){return db[_0x6d76('0x1f')][_0x6d76('0x15')]({'raw':_0x4ca0d4[_0x6d76('0x16')]?_0x4ca0d4[_0x6d76('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x4ca0d4[_0x6d76('0x16')]?_0x4ca0d4[_0x6d76('0x16')][_0x6d76('0x20')]||null:null,'attributes':[[db['sequelize']['fn'](_0x6d76('0x42'),db[_0x6d76('0x2c')]['fn']('IF',db['sequelize'][_0x6d76('0x43')](_0x6d76('0x44')+util['format'](_0x6d76('0x45'),moment()[_0x6d76('0x46')](_0x6d76('0x47')))+_0x6d76('0x48')))),_0x6d76('0x49')]]})[_0x6d76('0xa')](function(_0x2b903a){logger[_0x6d76('0xb')](_0x6d76('0x4a'),_0x4ca0d4);logger[_0x6d76('0x24')](_0x6d76('0x4a'),_0x4ca0d4,JSON[_0x6d76('0x1d')](_0x2b903a));_0x2f5c5c(_0x2b903a);})[_0x6d76('0x13')](function(_0x21977c){logger['error'](_0x6d76('0x4a'),_0x21977c[_0x6d76('0x11')],_0x4ca0d4);_0x316e94(_0x37715d[_0x6d76('0xf')](0x1f4,_0x21977c[_0x6d76('0x11')]));});});};exports[_0x6d76('0x4b')]=function(_0x3ba385){var _0x57ccac=this;return new Promise(function(_0x2faa64,_0xb384e4){return db[_0x6d76('0x2a')][_0x6d76('0x2b')]()['then'](function(_0x52b330){return db[_0x6d76('0x2c')][_0x6d76('0x2d')](function(_0x37a022){return db['CmHopper'][_0x6d76('0x15')]({'where':_0x3ba385['options']?_0x3ba385[_0x6d76('0x16')][_0x6d76('0x20')]||null:null,'attributes':_0x3ba385[_0x6d76('0x16')]?_0x3ba385['options']['attributes']||null:null,'limit':0x1,'order':_0x3ba385[_0x6d76('0x16')]?_0x3ba385[_0x6d76('0x16')][_0x6d76('0x2e')]||null:null,'group':db[_0x6d76('0x1f')][_0x6d76('0x38')],'transaction':_0x37a022,'lock':_0x37a022['LOCK']['UPDATE'],'include':_0x3ba385[_0x6d76('0x16')]?_0x3ba385['options']['include']?_[_0x6d76('0x1b')](_0x3ba385[_0x6d76('0x16')][_0x6d76('0x1a')],function(_0x298022){return{'model':db[_0x298022['model']],'as':_0x298022['as'],'attributes':_0x298022['attributes'],'include':_0x298022[_0x6d76('0x1a')]?_[_0x6d76('0x1b')](_0x298022['include'],function(_0x7bd360){return{'model':db[_0x7bd360['model']],'as':_0x7bd360['as'],'attributes':_0x7bd360[_0x6d76('0x18')],'include':_0x7bd360[_0x6d76('0x1a')]?_[_0x6d76('0x1b')](_0x7bd360[_0x6d76('0x1a')],function(_0xde03be){return{'model':db[_0xde03be[_0x6d76('0x1c')]],'as':_0xde03be['as'],'attributes':_0xde03be[_0x6d76('0x18')]};}):[]};}):[]};}):[]:[]})[_0x6d76('0xa')](function(_0x1aac14){var _0x3e4ad8=[];for(var _0x1c154b=0x0;_0x1c154b<_0x1aac14['length'];_0x1c154b+=0x1){_0x3e4ad8['push'](_0x1aac14[_0x1c154b][_0x6d76('0x3a')](_0x3ba385[_0x6d76('0x23')],{'transaction':_0x37a022}));}return BPromise[_0x6d76('0x3c')](_0x3e4ad8);});})[_0x6d76('0xa')](function(_0x25a70e){logger[_0x6d76('0xb')](_0x6d76('0x4b'),_0x3ba385);logger[_0x6d76('0x24')](_0x6d76('0x4b'),_0x3ba385,JSON[_0x6d76('0x1d')](_0x25a70e));_0x2faa64(_0x25a70e);})['catch'](function(_0x42dba9){logger[_0x6d76('0xf')]('GetContactRecallMe',_0x42dba9[_0x6d76('0x11')],_0x3ba385);_0xb384e4(_0x57ccac[_0x6d76('0xf')](0x1f4,_0x42dba9[_0x6d76('0x11')]));});});});};exports['GetCmHopperPreview']=function(_0x562a6e){var _0x197c2d=this;return new Promise(function(_0x310e82,_0x45eda5){db['CmContact'][_0x6d76('0x2b')]()[_0x6d76('0xa')](function(_0x1108c5){return db[_0x6d76('0x1f')]['findAll']({'raw':_0x562a6e['options']?_0x562a6e[_0x6d76('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x562a6e['options']?_0x562a6e[_0x6d76('0x16')]['where']||null:null,'attributes':_0x562a6e[_0x6d76('0x16')]?_0x562a6e[_0x6d76('0x16')][_0x6d76('0x18')]||null:null,'limit':_0x562a6e[_0x6d76('0x16')]?_0x562a6e[_0x6d76('0x16')]['limit']||null:null,'include':_0x562a6e['options']?_0x562a6e[_0x6d76('0x16')][_0x6d76('0x1a')]?_[_0x6d76('0x1b')](_0x562a6e[_0x6d76('0x16')][_0x6d76('0x1a')],function(_0x4d96cf){return{'model':db[_0x4d96cf[_0x6d76('0x1c')]],'as':_0x4d96cf['as'],'attributes':_0x4d96cf['as']===_0x6d76('0x31')?_[_0x6d76('0x32')](_0x1108c5):_0x4d96cf[_0x6d76('0x18')],'include':_0x4d96cf[_0x6d76('0x1a')]?_[_0x6d76('0x1b')](_0x4d96cf['include'],function(_0x5976c4){return{'model':db[_0x5976c4[_0x6d76('0x1c')]],'as':_0x5976c4['as'],'attributes':_0x5976c4[_0x6d76('0x18')],'include':_0x5976c4[_0x6d76('0x1a')]?_[_0x6d76('0x1b')](_0x5976c4[_0x6d76('0x1a')],function(_0x351278){return{'model':db[_0x351278[_0x6d76('0x1c')]],'as':_0x351278['as'],'attributes':_0x351278[_0x6d76('0x18')]};}):[]};}):[]};}):[]:[]})[_0x6d76('0xa')](function(_0x460aa2){logger[_0x6d76('0xb')](_0x6d76('0x14'),_0x562a6e);logger[_0x6d76('0x24')](_0x6d76('0x14'),_0x562a6e,JSON['stringify'](_0x460aa2));_0x310e82(_0x460aa2);})[_0x6d76('0x13')](function(_0x2e62d0){logger[_0x6d76('0xf')](_0x6d76('0x14'),_0x2e62d0[_0x6d76('0x11')],_0x562a6e);_0x45eda5(_0x197c2d['error'](0x1f4,_0x2e62d0['message']));});});});};exports[_0x6d76('0x4c')]=function(_0xa4d4d8){var _0x4d8814=this;return new Promise(function(_0x5f58ee,_0x2ae8f7){return db[_0x6d76('0x2a')]['findOne']({'raw':!![],'where':{'phone':_0xa4d4d8[_0x6d76('0x16')][_0x6d76('0x20')][_0x6d76('0x4d')]},'attributes':['id',_0x6d76('0x4e')],'order':[['id',_0x6d76('0x4f')]]})[_0x6d76('0xa')](function(_0x31180f){logger[_0x6d76('0xb')](_0x6d76('0x50'),_0xa4d4d8);logger['debug']('getContactByPhone',_0xa4d4d8,JSON[_0x6d76('0x1d')](_0x31180f));_0x5f58ee(_0x31180f);})[_0x6d76('0x13')](function(_0x8cd2f6){logger['error']('getContactByPhone',_0x8cd2f6[_0x6d76('0x11')],_0xa4d4d8);_0x2ae8f7(_0x4d8814[_0x6d76('0xf')](0x1f4,_0x8cd2f6[_0x6d76('0x11')]));});});};exports[_0x6d76('0x51')]=function(_0x8215a5){var _0x2945fd=this;return new Promise(function(_0x56a0a8,_0x7cd7fc){return db[_0x6d76('0x2c')]['transaction'](function(_0x50445c){return db[_0x6d76('0x1f')][_0x6d76('0x3a')]({'active':![]},{'where':{},'transaction':_0x50445c})[_0x6d76('0xa')](function(_0x1c43b1){logger['info']('ResetActiveCalls',_0x8215a5);logger[_0x6d76('0x24')](_0x6d76('0x51'),_0x8215a5,JSON['stringify'](_0x1c43b1));_0x56a0a8(_0x1c43b1);})['catch'](function(_0x4ce5e6){logger[_0x6d76('0xf')](_0x6d76('0x51'),_0x4ce5e6[_0x6d76('0x11')],_0x8215a5);_0x7cd7fc(_0x2945fd['error'](0x1f4,_0x4ce5e6['message']));});});});};exports[_0x6d76('0x52')]=function(_0x16d962){var _0x4d955c=this;var _0x275110=_0x16d962[_0x6d76('0x23')][_0x6d76('0x20')][_0x6d76('0x53')];var _0x27d8e9=_0x16d962[_0x6d76('0x23')][_0x6d76('0x20')][_0x6d76('0x54')];return new Promise(function(_0x3513ca,_0x6ada65){return db[_0x6d76('0x1f')][_0x6d76('0x15')]({'where':{'voiceQueueId':_0x275110,'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$lte':db['sequelize'][_0x6d76('0x43')](_0x6d76('0x55')+_0x27d8e9+_0x6d76('0x56'))}},'include':[{'model':db['CmContact'],'as':_0x6d76('0x31')},{'model':db['User'],'as':_0x6d76('0x34'),'attributes':['id',_0x6d76('0x35'),_0x6d76('0x36')]},{'model':db['CmList'],'as':_0x6d76('0x57')}]})['then'](function(_0x145845){return db[_0x6d76('0x2c')][_0x6d76('0x2d')](function(_0x5e3dcb){return db[_0x6d76('0x1f')][_0x6d76('0x3a')]({'recallmeNotifiedDate':new Date()},{'where':{'voiceQueueId':_0x275110,'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$lte':db[_0x6d76('0x2c')]['literal'](_0x6d76('0x55')+_0x27d8e9+_0x6d76('0x56'))}},'transaction':_0x5e3dcb})['then'](function(_0xd59d9a){_0x3513ca(_0x145845);})['catch'](function(_0x3ac84a){logger['error'](_0x6d76('0x52'),_0x3ac84a[_0x6d76('0x11')],_0x16d962);_0x6ada65(validateExpressRequest);});});})[_0x6d76('0x13')](function(_0x3eb830){logger[_0x6d76('0xf')](_0x6d76('0x52'),_0x3eb830[_0x6d76('0x11')],_0x16d962);_0x6ada65(_0x4d955c[_0x6d76('0xf')](0x1f4,_0x3eb830[_0x6d76('0x11')]));});});};
\ No newline at end of file
+var _0x18c6=['UserId','push','all','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','MoveContactManagedDialer','COUNT','literal','`scheduledat`\x20>=\x20','format','\x22%s\x22','\x20,\x201,\x20null','contactsRescheduled','CountReScheduled','GetContactRecallMe','order','GetCmHopperPreview','keys','GetContactByPhone','findOne','phone','dialTimezone','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','voiceQueueId','interval','\x20MINUTE','CmList','List','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','twilio/lib/webhooks/webhooks','client','http','request','CmHopper,\x20%s,\x20%s','request\x20sent','debug','CmHopper,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','GetCmHopper','CmHopper','findAll','options','where','attributes','limit','include','model','map','then','find','raw','ShowCmHopper','CreateCmHopper','create','body','UpdateCmHopper','update','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','active','DestroyCmHopper','GetContactDialer','CmContact','describe','sequelize','transaction','LOCK','UPDATE','Contact','User','Agent','name','voicePause','length'];(function(_0x147f71,_0xa77d8b){var _0x24a2f2=function(_0xfea605){while(--_0xfea605){_0x147f71['push'](_0x147f71['shift']());}};_0x24a2f2(++_0xa77d8b);}(_0x18c6,0x182));var _0x618c=function(_0x3b77bf,_0x1c7826){_0x3b77bf=_0x3b77bf-0x0;var _0x4cdac6=_0x18c6[_0x3b77bf];return _0x4cdac6;};'use strict';var _=require('lodash');var util=require(_0x618c('0x0'));var moment=require(_0x618c('0x1'));var BPromise=require(_0x618c('0x2'));var rs=require(_0x618c('0x3'));var fs=require('fs');var Redis=require(_0x618c('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x618c('0x5'));var logger=require(_0x618c('0x6'))(_0x618c('0x7'));var config=require(_0x618c('0x8'));var jayson=require(_0x618c('0x9'));const {validateExpressRequest}=require(_0x618c('0xa'));var client=jayson[_0x618c('0xb')][_0x618c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x21687d,_0x523c65,_0x4c4313){return new BPromise(function(_0xf91f0a,_0x2ae550){return client[_0x618c('0xd')](_0x21687d,_0x4c4313)['then'](function(_0x44ddad){logger['info'](_0x618c('0xe'),_0x523c65,_0x618c('0xf'));logger[_0x618c('0x10')](_0x618c('0x11'),_0x523c65,'request\x20sent',JSON[_0x618c('0x12')](_0x44ddad));if(_0x44ddad[_0x618c('0x13')]){if(_0x44ddad[_0x618c('0x13')]['code']===0x1f4){logger['error'](_0x618c('0xe'),_0x523c65,_0x44ddad[_0x618c('0x13')][_0x618c('0x14')]);return _0x2ae550(_0x44ddad[_0x618c('0x13')][_0x618c('0x14')]);}logger[_0x618c('0x13')](_0x618c('0xe'),_0x523c65,_0x44ddad[_0x618c('0x13')][_0x618c('0x14')]);return _0xf91f0a(_0x44ddad[_0x618c('0x13')]['message']);}else{logger[_0x618c('0x15')](_0x618c('0xe'),_0x523c65,_0x618c('0xf'));_0xf91f0a(_0x44ddad[_0x618c('0x16')][_0x618c('0x14')]);}})[_0x618c('0x17')](function(_0x31fe9c){logger[_0x618c('0x13')]('CmHopper,\x20%s,\x20%s',_0x523c65,_0x31fe9c);_0x2ae550(_0x31fe9c);});});}exports[_0x618c('0x18')]=function(_0x2cd497){var _0x1ce350=this;return new Promise(function(_0x5091ae,_0x436fd7){return db[_0x618c('0x19')][_0x618c('0x1a')]({'raw':_0x2cd497[_0x618c('0x1b')]?_0x2cd497[_0x618c('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x2cd497[_0x618c('0x1b')]?_0x2cd497[_0x618c('0x1b')][_0x618c('0x1c')]||null:null,'attributes':_0x2cd497[_0x618c('0x1b')]?_0x2cd497[_0x618c('0x1b')][_0x618c('0x1d')]||null:null,'limit':_0x2cd497[_0x618c('0x1b')]?_0x2cd497[_0x618c('0x1b')][_0x618c('0x1e')]||null:null,'include':_0x2cd497[_0x618c('0x1b')]?_0x2cd497['options'][_0x618c('0x1f')]?_['map'](_0x2cd497[_0x618c('0x1b')][_0x618c('0x1f')],function(_0x41cdc4){return{'model':db[_0x41cdc4[_0x618c('0x20')]],'as':_0x41cdc4['as'],'attributes':_0x41cdc4[_0x618c('0x1d')],'include':_0x41cdc4[_0x618c('0x1f')]?_[_0x618c('0x21')](_0x41cdc4[_0x618c('0x1f')],function(_0x4586b5){return{'model':db[_0x4586b5[_0x618c('0x20')]],'as':_0x4586b5['as'],'attributes':_0x4586b5[_0x618c('0x1d')],'include':_0x4586b5[_0x618c('0x1f')]?_[_0x618c('0x21')](_0x4586b5['include'],function(_0x4c329f){return{'model':db[_0x4c329f[_0x618c('0x20')]],'as':_0x4c329f['as'],'attributes':_0x4c329f['attributes']};}):[]};}):[]};}):[]:[]})[_0x618c('0x22')](function(_0x346cfc){logger['info'](_0x618c('0x18'),_0x2cd497);logger[_0x618c('0x10')]('GetCmHopper',_0x2cd497,JSON[_0x618c('0x12')](_0x346cfc));_0x5091ae(_0x346cfc);})[_0x618c('0x17')](function(_0x4cf2cf){logger['error'](_0x618c('0x18'),_0x4cf2cf['message'],_0x2cd497);_0x436fd7(_0x1ce350[_0x618c('0x13')](0x1f4,_0x4cf2cf[_0x618c('0x14')]));});});};exports['ShowCmHopper']=function(_0x337e39){var _0x3ec499=this;return new Promise(function(_0x15d0c1,_0x5ba062){return db[_0x618c('0x19')][_0x618c('0x23')]({'raw':_0x337e39['options']?_0x337e39[_0x618c('0x1b')][_0x618c('0x24')]===undefined?!![]:![]:!![],'where':_0x337e39[_0x618c('0x1b')]?_0x337e39[_0x618c('0x1b')][_0x618c('0x1c')]||null:null,'attributes':_0x337e39[_0x618c('0x1b')]?_0x337e39['options']['attributes']||null:null,'include':_0x337e39[_0x618c('0x1b')]?_0x337e39[_0x618c('0x1b')]['include']?_['map'](_0x337e39['options'][_0x618c('0x1f')],function(_0x34d942){return{'model':db[_0x34d942[_0x618c('0x20')]],'as':_0x34d942['as'],'attributes':_0x34d942[_0x618c('0x1d')],'include':_0x34d942[_0x618c('0x1f')]?_[_0x618c('0x21')](_0x34d942[_0x618c('0x1f')],function(_0x129475){return{'model':db[_0x129475[_0x618c('0x20')]],'as':_0x129475['as'],'attributes':_0x129475[_0x618c('0x1d')],'include':_0x129475[_0x618c('0x1f')]?_[_0x618c('0x21')](_0x129475[_0x618c('0x1f')],function(_0x524359){return{'model':db[_0x524359['model']],'as':_0x524359['as'],'attributes':_0x524359[_0x618c('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x618c('0x22')](function(_0x2cc9b1){logger[_0x618c('0x15')](_0x618c('0x25'),_0x337e39);logger[_0x618c('0x10')](_0x618c('0x25'),_0x337e39,JSON['stringify'](_0x2cc9b1));_0x15d0c1(_0x2cc9b1);})[_0x618c('0x17')](function(_0x1d9fb4){logger[_0x618c('0x13')]('ShowCmHopper',_0x1d9fb4[_0x618c('0x14')],_0x337e39);_0x5ba062(_0x3ec499['error'](0x1f4,_0x1d9fb4[_0x618c('0x14')]));});});};exports[_0x618c('0x26')]=function(_0x2b1826){var _0xc34854=this;return new Promise(function(_0x262d51,_0x58c687){return db[_0x618c('0x19')][_0x618c('0x27')](_0x2b1826[_0x618c('0x28')],{'raw':_0x2b1826[_0x618c('0x1b')]?_0x2b1826['options'][_0x618c('0x24')]===undefined?!![]:![]:!![]})[_0x618c('0x22')](function(_0x28a9bc){logger[_0x618c('0x15')](_0x618c('0x26'),_0x2b1826);logger[_0x618c('0x10')](_0x618c('0x26'),_0x2b1826,JSON['stringify'](_0x28a9bc));_0x262d51(_0x28a9bc);})[_0x618c('0x17')](function(_0x1ae682){logger[_0x618c('0x13')](_0x618c('0x26'),_0x1ae682[_0x618c('0x14')],_0x2b1826);_0x58c687(_0xc34854[_0x618c('0x13')](0x1f4,_0x1ae682['message']));});});};exports[_0x618c('0x29')]=function(_0x34a5e1){var _0x1efa3e=this;return new Promise(function(_0x531e43,_0x176ccd){return db[_0x618c('0x19')][_0x618c('0x2a')](_0x34a5e1[_0x618c('0x28')],{'raw':_0x34a5e1[_0x618c('0x1b')]?_0x34a5e1['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x34a5e1[_0x618c('0x1b')]?_0x34a5e1[_0x618c('0x1b')][_0x618c('0x1c')]||null:null,'attributes':_0x34a5e1['options']?_0x34a5e1[_0x618c('0x1b')]['attributes']||null:null,'limit':_0x34a5e1['options']?_0x34a5e1[_0x618c('0x1b')][_0x618c('0x1e')]||null:null})['then'](function(_0x229315){logger[_0x618c('0x15')](_0x618c('0x29'),_0x34a5e1);logger[_0x618c('0x15')](_0x618c('0x2b'),JSON[_0x618c('0x12')](_0x34a5e1[_0x618c('0x1b')]['where']),_0x34a5e1[_0x618c('0x28')][_0x618c('0x2c')]);logger[_0x618c('0x10')](_0x618c('0x29'),_0x34a5e1,JSON[_0x618c('0x12')](_0x229315));_0x531e43(_0x229315);})['catch'](function(_0x59baef){logger['error'](_0x618c('0x29'),_0x59baef[_0x618c('0x14')],_0x34a5e1);_0x176ccd(_0x1efa3e[_0x618c('0x13')](0x1f4,_0x59baef[_0x618c('0x14')]));});});};exports[_0x618c('0x2d')]=function(_0x1b55be){var _0x4a2755=this;return new Promise(function(_0x2f6590,_0x1766a1){return db[_0x618c('0x19')]['destroy']({'where':_0x1b55be[_0x618c('0x1b')]?_0x1b55be[_0x618c('0x1b')][_0x618c('0x1c')]||null:null})[_0x618c('0x22')](function(_0x2ab1d5){logger['info']('DestroyCmHopper',_0x1b55be);logger[_0x618c('0x10')](_0x618c('0x2d'),_0x1b55be,JSON[_0x618c('0x12')](_0x2ab1d5));_0x2f6590(_0x2ab1d5);})[_0x618c('0x17')](function(_0x928e4b){logger[_0x618c('0x13')](_0x618c('0x2d'),_0x928e4b[_0x618c('0x14')],_0x1b55be);_0x1766a1(_0x4a2755['error'](0x1f4,_0x928e4b[_0x618c('0x14')]));});});};exports[_0x618c('0x2e')]=function(_0x243590){var _0x39a9d5=this;return new Promise(function(_0x4f41b4,_0x38f9cb){return db[_0x618c('0x2f')][_0x618c('0x30')]()[_0x618c('0x22')](function(_0x4f71fe){return db[_0x618c('0x31')][_0x618c('0x32')](function(_0x3f0070){return db[_0x618c('0x19')][_0x618c('0x1a')]({'where':_0x243590[_0x618c('0x1b')]?_0x243590[_0x618c('0x1b')]['where']||null:null,'attributes':_0x243590[_0x618c('0x1b')]?_0x243590['options']['attributes']||null:null,'limit':_0x243590[_0x618c('0x1b')]?_0x243590[_0x618c('0x1b')][_0x618c('0x1e')]||null:null,'order':_0x243590[_0x618c('0x1b')]?_0x243590[_0x618c('0x1b')]['order']||null:null,'transaction':_0x3f0070,'lock':_0x3f0070[_0x618c('0x33')][_0x618c('0x34')],'include':[{'model':db[_0x618c('0x2f')],'as':_0x618c('0x35'),'attributes':_['keys'](_0x4f71fe)},{'model':db[_0x618c('0x36')],'as':_0x618c('0x37'),'attributes':['id',_0x618c('0x38'),_0x618c('0x39')]}]})[_0x618c('0x22')](function(_0x20a5cc){var _0x1a2c9c=[];var _0x4f1a83=[];for(var _0x3a7571=0x0;_0x3a7571<_0x20a5cc[_0x618c('0x3a')];_0x3a7571+=0x1){var _0x413d4e=_0x20a5cc[_0x3a7571][_0x618c('0x3b')];if(_0x413d4e===null){_0x1a2c9c['push'](_0x20a5cc[_0x3a7571][_0x618c('0x2a')](_0x243590['body'],{'transaction':_0x3f0070}));}else if(!_0x4f1a83['includes'](_0x413d4e)){_0x4f1a83['push'](_0x413d4e);_0x1a2c9c[_0x618c('0x3c')](_0x20a5cc[_0x3a7571]['update'](_0x243590[_0x618c('0x28')],{'transaction':_0x3f0070}));}}return BPromise[_0x618c('0x3d')](_0x1a2c9c);});})[_0x618c('0x22')](function(_0x1ffc61){logger[_0x618c('0x15')](_0x618c('0x2e'),_0x243590);if(_0x1ffc61[_0x618c('0x3a')]>0x0){logger[_0x618c('0x15')](_0x618c('0x3e'),_0x1ffc61[0x0][_0x618c('0x3f')]['id'],_0x1ffc61[0x0]['dataValues']['ContactId'],_0x1ffc61[0x0]['dataValues']['active']);}logger[_0x618c('0x10')](_0x618c('0x2e'),_0x243590,JSON['stringify'](_0x1ffc61));_0x4f41b4(_0x1ffc61);})[_0x618c('0x17')](function(_0x5c90fe){logger[_0x618c('0x13')](_0x618c('0x2e'),_0x5c90fe[_0x618c('0x14')],_0x243590);_0x38f9cb(_0x39a9d5[_0x618c('0x13')](0x1f4,_0x5c90fe[_0x618c('0x14')]));});});});};exports[_0x618c('0x40')]=function(_0x25a77d){var _0x27420f=this;return new Promise(function(_0x30aecd,_0x187a28){return db[_0x618c('0x31')][_0x618c('0x32')](function(_0x5bce28){return db['CmHopperFinal'][_0x618c('0x27')](_0x25a77d[_0x618c('0x28')],{'raw':_0x25a77d[_0x618c('0x1b')]?_0x25a77d[_0x618c('0x1b')][_0x618c('0x24')]===undefined?!![]:![]:!![],'transaction':_0x5bce28})[_0x618c('0x22')](function(){logger[_0x618c('0x15')]('MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]',JSON['stringify'](_0x25a77d[_0x618c('0x1b')][_0x618c('0x1c')]),_0x25a77d['options'][_0x618c('0x1c')]['active']);return db['CmHopper']['destroy']({'where':_0x25a77d[_0x618c('0x1b')]?_0x25a77d[_0x618c('0x1b')][_0x618c('0x1c')]||null:null,'transaction':_0x5bce28});});})['then'](function(_0x24827b){logger[_0x618c('0x15')](_0x618c('0x40'),_0x25a77d);logger[_0x618c('0x10')](_0x618c('0x40'),_0x25a77d,JSON[_0x618c('0x12')](_0x24827b));_0x30aecd(_0x24827b);})['catch'](function(_0x156aa5){logger[_0x618c('0x13')](_0x618c('0x40'),_0x156aa5['message'],_0x25a77d);_0x187a28(_0x27420f[_0x618c('0x13')](0x1f4,_0x156aa5[_0x618c('0x14')]));});});};exports['CountReScheduled']=function(_0x2535c4){var _0x5e2d70=this;return new Promise(function(_0x549127,_0x176ab7){return db[_0x618c('0x19')][_0x618c('0x1a')]({'raw':_0x2535c4['options']?_0x2535c4[_0x618c('0x1b')][_0x618c('0x24')]===undefined?!![]:![]:!![],'where':_0x2535c4[_0x618c('0x1b')]?_0x2535c4[_0x618c('0x1b')][_0x618c('0x1c')]||null:null,'attributes':[[db[_0x618c('0x31')]['fn'](_0x618c('0x41'),db[_0x618c('0x31')]['fn']('IF',db[_0x618c('0x31')][_0x618c('0x42')](_0x618c('0x43')+util[_0x618c('0x44')](_0x618c('0x45'),moment()[_0x618c('0x44')]('YYYY-MM-DD\x20HH:mm:ss'))+_0x618c('0x46')))),_0x618c('0x47')]]})[_0x618c('0x22')](function(_0x2ecc70){logger[_0x618c('0x15')](_0x618c('0x48'),_0x2535c4);logger[_0x618c('0x10')]('CountReScheduled',_0x2535c4,JSON[_0x618c('0x12')](_0x2ecc70));_0x549127(_0x2ecc70);})[_0x618c('0x17')](function(_0x9d9ff7){logger[_0x618c('0x13')](_0x618c('0x48'),_0x9d9ff7[_0x618c('0x14')],_0x2535c4);_0x176ab7(_0x5e2d70[_0x618c('0x13')](0x1f4,_0x9d9ff7[_0x618c('0x14')]));});});};exports[_0x618c('0x49')]=function(_0x1fdaf6){var _0x5b99b0=this;return new Promise(function(_0x1461fb,_0xc9ee0c){return db[_0x618c('0x2f')][_0x618c('0x30')]()['then'](function(_0x162dbe){return db[_0x618c('0x31')][_0x618c('0x32')](function(_0x24db02){return db[_0x618c('0x19')][_0x618c('0x1a')]({'where':_0x1fdaf6['options']?_0x1fdaf6[_0x618c('0x1b')][_0x618c('0x1c')]||null:null,'attributes':_0x1fdaf6['options']?_0x1fdaf6[_0x618c('0x1b')]['attributes']||null:null,'limit':0x1,'order':_0x1fdaf6[_0x618c('0x1b')]?_0x1fdaf6['options'][_0x618c('0x4a')]||null:null,'group':db[_0x618c('0x19')]['UserId'],'transaction':_0x24db02,'lock':_0x24db02[_0x618c('0x33')][_0x618c('0x34')],'include':_0x1fdaf6[_0x618c('0x1b')]?_0x1fdaf6[_0x618c('0x1b')][_0x618c('0x1f')]?_[_0x618c('0x21')](_0x1fdaf6[_0x618c('0x1b')][_0x618c('0x1f')],function(_0x25ed86){return{'model':db[_0x25ed86[_0x618c('0x20')]],'as':_0x25ed86['as'],'attributes':_0x25ed86[_0x618c('0x1d')],'include':_0x25ed86[_0x618c('0x1f')]?_[_0x618c('0x21')](_0x25ed86['include'],function(_0xe25724){return{'model':db[_0xe25724['model']],'as':_0xe25724['as'],'attributes':_0xe25724[_0x618c('0x1d')],'include':_0xe25724['include']?_[_0x618c('0x21')](_0xe25724[_0x618c('0x1f')],function(_0x57df35){return{'model':db[_0x57df35[_0x618c('0x20')]],'as':_0x57df35['as'],'attributes':_0x57df35[_0x618c('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x9042de){var _0x802f6b=[];for(var _0x13867f=0x0;_0x13867f<_0x9042de['length'];_0x13867f+=0x1){_0x802f6b[_0x618c('0x3c')](_0x9042de[_0x13867f][_0x618c('0x2a')](_0x1fdaf6['body'],{'transaction':_0x24db02}));}return BPromise['all'](_0x802f6b);});})['then'](function(_0x4650c9){logger['info'](_0x618c('0x49'),_0x1fdaf6);logger[_0x618c('0x10')](_0x618c('0x49'),_0x1fdaf6,JSON[_0x618c('0x12')](_0x4650c9));_0x1461fb(_0x4650c9);})['catch'](function(_0x26db25){logger[_0x618c('0x13')](_0x618c('0x49'),_0x26db25[_0x618c('0x14')],_0x1fdaf6);_0xc9ee0c(_0x5b99b0['error'](0x1f4,_0x26db25[_0x618c('0x14')]));});});});};exports[_0x618c('0x4b')]=function(_0x562b53){var _0x1e8014=this;return new Promise(function(_0x595ae4,_0x3ed3fc){db[_0x618c('0x2f')]['describe']()['then'](function(_0x13a0cc){return db[_0x618c('0x19')][_0x618c('0x1a')]({'raw':_0x562b53['options']?_0x562b53['options'][_0x618c('0x24')]===undefined?!![]:![]:!![],'where':_0x562b53[_0x618c('0x1b')]?_0x562b53[_0x618c('0x1b')][_0x618c('0x1c')]||null:null,'attributes':_0x562b53[_0x618c('0x1b')]?_0x562b53[_0x618c('0x1b')][_0x618c('0x1d')]||null:null,'limit':_0x562b53['options']?_0x562b53[_0x618c('0x1b')][_0x618c('0x1e')]||null:null,'include':_0x562b53[_0x618c('0x1b')]?_0x562b53[_0x618c('0x1b')][_0x618c('0x1f')]?_['map'](_0x562b53[_0x618c('0x1b')][_0x618c('0x1f')],function(_0x334e25){return{'model':db[_0x334e25[_0x618c('0x20')]],'as':_0x334e25['as'],'attributes':_0x334e25['as']==='Contact'?_[_0x618c('0x4c')](_0x13a0cc):_0x334e25['attributes'],'include':_0x334e25[_0x618c('0x1f')]?_['map'](_0x334e25[_0x618c('0x1f')],function(_0x2c31c4){return{'model':db[_0x2c31c4[_0x618c('0x20')]],'as':_0x2c31c4['as'],'attributes':_0x2c31c4[_0x618c('0x1d')],'include':_0x2c31c4['include']?_['map'](_0x2c31c4[_0x618c('0x1f')],function(_0x207e5d){return{'model':db[_0x207e5d[_0x618c('0x20')]],'as':_0x207e5d['as'],'attributes':_0x207e5d[_0x618c('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x618c('0x22')](function(_0x477d27){logger[_0x618c('0x15')](_0x618c('0x18'),_0x562b53);logger[_0x618c('0x10')](_0x618c('0x18'),_0x562b53,JSON[_0x618c('0x12')](_0x477d27));_0x595ae4(_0x477d27);})['catch'](function(_0x52df41){logger[_0x618c('0x13')](_0x618c('0x18'),_0x52df41['message'],_0x562b53);_0x3ed3fc(_0x1e8014[_0x618c('0x13')](0x1f4,_0x52df41[_0x618c('0x14')]));});});});};exports[_0x618c('0x4d')]=function(_0x34295d){var _0x3f4e5a=this;return new Promise(function(_0x1c2831,_0x146141){return db[_0x618c('0x2f')][_0x618c('0x4e')]({'raw':!![],'where':{'phone':_0x34295d['options'][_0x618c('0x1c')][_0x618c('0x4f')]},'attributes':['id',_0x618c('0x50')],'order':[['id','DESC']]})['then'](function(_0x5afcdc){logger[_0x618c('0x15')](_0x618c('0x51'),_0x34295d);logger['debug'](_0x618c('0x51'),_0x34295d,JSON['stringify'](_0x5afcdc));_0x1c2831(_0x5afcdc);})[_0x618c('0x17')](function(_0x2117f1){logger[_0x618c('0x13')](_0x618c('0x51'),_0x2117f1[_0x618c('0x14')],_0x34295d);_0x146141(_0x3f4e5a[_0x618c('0x13')](0x1f4,_0x2117f1[_0x618c('0x14')]));});});};exports['ResetActiveCalls']=function(_0x9482c1){var _0x1899b2=this;return new Promise(function(_0x3c5d5c,_0x9c725e){return db[_0x618c('0x31')][_0x618c('0x32')](function(_0x3fc140){return db[_0x618c('0x19')][_0x618c('0x2a')]({'active':![]},{'where':{},'transaction':_0x3fc140})[_0x618c('0x22')](function(_0x3056a9){logger[_0x618c('0x15')](_0x618c('0x52'),_0x9482c1);logger['debug'](_0x618c('0x52'),_0x9482c1,JSON[_0x618c('0x12')](_0x3056a9));_0x3c5d5c(_0x3056a9);})[_0x618c('0x17')](function(_0x357613){logger['error'](_0x618c('0x52'),_0x357613['message'],_0x9482c1);_0x9c725e(_0x1899b2[_0x618c('0x13')](0x1f4,_0x357613['message']));});});});};exports[_0x618c('0x53')]=function(_0x48895b){var _0x4eff30=this;var _0x41afdf=_0x48895b[_0x618c('0x28')][_0x618c('0x1c')][_0x618c('0x54')];var _0x5ad52f=_0x48895b[_0x618c('0x28')]['where'][_0x618c('0x55')];return new Promise(function(_0x590a59,_0x3620c3){return db[_0x618c('0x19')][_0x618c('0x1a')]({'where':{'voiceQueueId':_0x41afdf,'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$lte':db[_0x618c('0x31')]['literal']('NOW()\x20+\x20INTERVAL\x20'+_0x5ad52f+_0x618c('0x56'))}},'include':[{'model':db[_0x618c('0x2f')],'as':_0x618c('0x35')},{'model':db[_0x618c('0x36')],'as':'Agent','attributes':['id','name',_0x618c('0x39')]},{'model':db[_0x618c('0x57')],'as':_0x618c('0x58')}]})[_0x618c('0x22')](function(_0x292c7f){return db[_0x618c('0x31')]['transaction'](function(_0x35dd72){return db['CmHopper'][_0x618c('0x2a')]({'recallmeNotifiedDate':new Date()},{'where':{'voiceQueueId':_0x41afdf,'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$lte':db[_0x618c('0x31')][_0x618c('0x42')]('NOW()\x20+\x20INTERVAL\x20'+_0x5ad52f+_0x618c('0x56'))}},'transaction':_0x35dd72})[_0x618c('0x22')](function(_0x29a9b8){_0x590a59(_0x292c7f);})['catch'](function(_0x34b500){logger[_0x618c('0x13')](_0x618c('0x53'),_0x34b500[_0x618c('0x14')],_0x48895b);_0x3620c3(validateExpressRequest);});});})[_0x618c('0x17')](function(_0x5821e3){logger['error'](_0x618c('0x53'),_0x5821e3[_0x618c('0x14')],_0x48895b);_0x3620c3(_0x4eff30[_0x618c('0x13')](0x1f4,_0x5821e3[_0x618c('0x14')]));});});};
\ No newline at end of file
index cbb8f94..4c6926b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5c8e=['delete','exports','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopper.controller','get','isAuthenticated','index','describe','/opencontacts','getOpenContacts','/timezones','getTimezones','/:id','show','post','create','/preview','getPreview','/timezone','getTimezone','/previewrecall','getPreviewRecall','update'];(function(_0x266d29,_0x2b6b29){var _0x33bbbd=function(_0x3b934d){while(--_0x3b934d){_0x266d29['push'](_0x266d29['shift']());}};_0x33bbbd(++_0x2b6b29);}(_0x5c8e,0x1b5));var _0xe5c8=function(_0x514f23,_0xfa7d58){_0x514f23=_0x514f23-0x0;var _0x88cb35=_0x5c8e[_0x514f23];return _0x88cb35;};'use strict';var multer=require('multer');var util=require(_0xe5c8('0x0'));var path=require('path');var timeout=require(_0xe5c8('0x1'));var express=require(_0xe5c8('0x2'));var router=express['Router']();var fs_extra=require(_0xe5c8('0x3'));var auth=require(_0xe5c8('0x4'));var interaction=require(_0xe5c8('0x5'));var config=require(_0xe5c8('0x6'));var controller=require(_0xe5c8('0x7'));router[_0xe5c8('0x8')]('/',auth[_0xe5c8('0x9')](),controller[_0xe5c8('0xa')]);router[_0xe5c8('0x8')]('/describe',auth['isAuthenticated'](),controller[_0xe5c8('0xb')]);router['get'](_0xe5c8('0xc'),auth[_0xe5c8('0x9')](),controller[_0xe5c8('0xd')]);router[_0xe5c8('0x8')](_0xe5c8('0xe'),auth['isAuthenticated'](),controller[_0xe5c8('0xf')]);router['get'](_0xe5c8('0x10'),auth['isAuthenticated'](),controller[_0xe5c8('0x11')]);router[_0xe5c8('0x12')]('/',auth[_0xe5c8('0x9')](),controller[_0xe5c8('0x13')]);router[_0xe5c8('0x12')](_0xe5c8('0x14'),auth[_0xe5c8('0x9')](),controller[_0xe5c8('0x15')]);router[_0xe5c8('0x12')](_0xe5c8('0x16'),auth['isAuthenticated'](),controller[_0xe5c8('0x17')]);router[_0xe5c8('0x12')](_0xe5c8('0x18'),auth[_0xe5c8('0x9')](),controller[_0xe5c8('0x19')]);router['put'](_0xe5c8('0x10'),auth[_0xe5c8('0x9')](),controller[_0xe5c8('0x1a')]);router[_0xe5c8('0x1b')](_0xe5c8('0x10'),auth[_0xe5c8('0x9')](),controller['destroy']);module[_0xe5c8('0x1c')]=router;
\ No newline at end of file
+var _0xda6f=['get','isAuthenticated','index','describe','/opencontacts','getOpenContacts','/timezones','getTimezones','/:id','show','post','create','/preview','/timezone','/previewrecall','getPreviewRecall','put','update','destroy','exports','multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopper.controller'];(function(_0x10f6e8,_0x351db6){var _0x35bb3c=function(_0x30a39b){while(--_0x30a39b){_0x10f6e8['push'](_0x10f6e8['shift']());}};_0x35bb3c(++_0x351db6);}(_0xda6f,0x148));var _0xfda6=function(_0x50707e,_0x14fc7c){_0x50707e=_0x50707e-0x0;var _0x12b962=_0xda6f[_0x50707e];return _0x12b962;};'use strict';var multer=require(_0xfda6('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xfda6('0x1'));var express=require('express');var router=express[_0xfda6('0x2')]();var fs_extra=require(_0xfda6('0x3'));var auth=require(_0xfda6('0x4'));var interaction=require(_0xfda6('0x5'));var config=require(_0xfda6('0x6'));var controller=require(_0xfda6('0x7'));router[_0xfda6('0x8')]('/',auth[_0xfda6('0x9')](),controller[_0xfda6('0xa')]);router[_0xfda6('0x8')]('/describe',auth[_0xfda6('0x9')](),controller[_0xfda6('0xb')]);router['get'](_0xfda6('0xc'),auth['isAuthenticated'](),controller[_0xfda6('0xd')]);router[_0xfda6('0x8')](_0xfda6('0xe'),auth['isAuthenticated'](),controller[_0xfda6('0xf')]);router[_0xfda6('0x8')](_0xfda6('0x10'),auth[_0xfda6('0x9')](),controller[_0xfda6('0x11')]);router[_0xfda6('0x12')]('/',auth['isAuthenticated'](),controller[_0xfda6('0x13')]);router['post'](_0xfda6('0x14'),auth[_0xfda6('0x9')](),controller['getPreview']);router[_0xfda6('0x12')](_0xfda6('0x15'),auth['isAuthenticated'](),controller['getTimezone']);router[_0xfda6('0x12')](_0xfda6('0x16'),auth[_0xfda6('0x9')](),controller[_0xfda6('0x17')]);router[_0xfda6('0x18')](_0xfda6('0x10'),auth[_0xfda6('0x9')](),controller[_0xfda6('0x19')]);router['delete'](_0xfda6('0x10'),auth[_0xfda6('0x9')](),controller[_0xfda6('0x1a')]);module[_0xfda6('0x1b')]=router;
\ No newline at end of file
index 819392e..10abfb6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xada4=['DATE','format','YYYY-MM-DD\x20HH:mm:ss','moment','exports','INTEGER','STRING'];(function(_0x597c16,_0x2292fe){var _0x30cc2c=function(_0x26cb58){while(--_0x26cb58){_0x597c16['push'](_0x597c16['shift']());}};_0x30cc2c(++_0x2292fe);}(_0xada4,0x153));var _0x4ada=function(_0x3e1826,_0x26cf28){_0x3e1826=_0x3e1826-0x0;var _0x5ebcfe=_0xada4[_0x3e1826];return _0x5ebcfe;};'use strict';var moment=require(_0x4ada('0x0'));var Sequelize=require('sequelize');module[_0x4ada('0x1')]={'CmHopperId':{'type':Sequelize[_0x4ada('0x2')]},'phone':{'type':Sequelize[_0x4ada('0x3')],'allowNull':![]},'OrderBy':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0x4ada('0x4')],'defaultValue':moment()[_0x4ada('0x5')](_0x4ada('0x6'))},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x4ada('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0x4ada('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x4ada('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x4ada('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x4ada('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
+var _0x469a=['STRING','DATE','exports','INTEGER'];(function(_0x466f51,_0x1393ed){var _0x2db305=function(_0x126ae3){while(--_0x126ae3){_0x466f51['push'](_0x466f51['shift']());}};_0x2db305(++_0x1393ed);}(_0x469a,0x166));var _0xa469=function(_0x934425,_0x5af72f){_0x934425=_0x934425-0x0;var _0x31d596=_0x469a[_0x934425];return _0x31d596;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0xa469('0x0')]={'CmHopperId':{'type':Sequelize[_0xa469('0x1')]},'phone':{'type':Sequelize[_0xa469('0x2')],'allowNull':![]},'OrderBy':{'type':Sequelize[_0xa469('0x1')],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0xa469('0x3')],'defaultValue':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xa469('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xa469('0x1')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xa469('0x1')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xa469('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xa469('0x1')],'defaultValue':0x0}};
\ No newline at end of file
index 0e58c33..0aa05dd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x21d5=['attributes','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','type','VIRTUAL','options','CmHopperAdditionalPhone','include','findAll','rows','catch','params','includeAll','find','create','body','user','role','CmHopperAdditionalPhones','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','key','query','keys','model','intersection','fields'];(function(_0x1883e6,_0x43f9a6){var _0x2d798b=function(_0x2222bf){while(--_0x2222bf){_0x1883e6['push'](_0x1883e6['shift']());}};_0x2d798b(++_0x43f9a6);}(_0x21d5,0x1c8));var _0x521d=function(_0x4f5778,_0xaddd3a){_0x4f5778=_0x4f5778-0x0;var _0x1c47a5=_0x21d5[_0x4f5778];return _0x1c47a5;};'use strict';var emlformat=require(_0x521d('0x0'));var rimraf=require(_0x521d('0x1'));var zipdir=require(_0x521d('0x2'));var jsonpatch=require(_0x521d('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x521d('0x4'));var Mustache=require('mustache');var util=require(_0x521d('0x5'));var path=require(_0x521d('0x6'));var sox=require('sox');var csv=require(_0x521d('0x7'));var ejs=require(_0x521d('0x8'));var fs=require('fs');var fs_extra=require(_0x521d('0x9'));var _=require(_0x521d('0xa'));var squel=require(_0x521d('0xb'));var crypto=require(_0x521d('0xc'));var jsforce=require(_0x521d('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x521d('0x7'));var querystring=require(_0x521d('0xe'));var Papa=require(_0x521d('0xf'));var Redis=require(_0x521d('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x521d('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x521d('0x12'));var logger=require(_0x521d('0x13'))(_0x521d('0x14'));var utils=require('../../config/utils');var config=require(_0x521d('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x521d('0x16'))['db'];function respondWithStatusCode(_0x235307,_0x3c2f04){_0x3c2f04=_0x3c2f04||0xcc;return function(_0x24a4e9){if(_0x24a4e9){return _0x235307[_0x521d('0x17')](_0x3c2f04);}return _0x235307['status'](_0x3c2f04)[_0x521d('0x18')]();};}function respondWithResult(_0x5db317,_0x2b36df){_0x2b36df=_0x2b36df||0xc8;return function(_0xa946ca){if(_0xa946ca){return _0x5db317[_0x521d('0x19')](_0x2b36df)[_0x521d('0x1a')](_0xa946ca);}};}function respondWithFilteredResult(_0x307010,_0xc50089){return function(_0x1f92c7){if(_0x1f92c7){var _0x1a58f7=typeof _0xc50089[_0x521d('0x1b')]===_0x521d('0x1c')&&typeof _0xc50089['limit']===_0x521d('0x1c');var _0x318ab5=_0x1f92c7[_0x521d('0x1d')];var _0x5ee2c3=_0x1a58f7?0x0:_0xc50089[_0x521d('0x1b')];var _0x262b88=_0x1a58f7?_0x1f92c7[_0x521d('0x1d')]:_0xc50089['offset']+_0xc50089[_0x521d('0x1e')];var _0x36b399;if(_0x262b88>=_0x318ab5){_0x262b88=_0x318ab5;_0x36b399=0xc8;}else{_0x36b399=0xce;}_0x307010[_0x521d('0x19')](_0x36b399);return _0x307010[_0x521d('0x1f')](_0x521d('0x20'),_0x5ee2c3+'-'+_0x262b88+'/'+_0x318ab5)[_0x521d('0x1a')](_0x1f92c7);}return null;};}function patchUpdates(_0x339320){return function(_0x4542a6){try{jsonpatch['apply'](_0x4542a6,_0x339320,!![]);}catch(_0x19ded4){return BPromise[_0x521d('0x21')](_0x19ded4);}return _0x4542a6[_0x521d('0x22')]();};}function saveUpdates(_0x247d0b,_0x185060){return function(_0x2d1773){if(_0x2d1773){return _0x2d1773[_0x521d('0x23')](_0x247d0b)[_0x521d('0x24')](function(_0x3c5879){return _0x3c5879;});}return null;};}function removeEntity(_0x4e1e97,_0x197d46){return function(_0x2613aa){if(_0x2613aa){return _0x2613aa[_0x521d('0x25')]()[_0x521d('0x24')](function(){var _0x53be24=_0x2613aa[_0x521d('0x26')]({'plain':!![]});var _0x28b2fd='CmHopperAdditionalPhones';return db[_0x521d('0x27')]['destroy']({'where':{'type':_0x28b2fd,'resourceId':_0x53be24['id']}})[_0x521d('0x24')](function(){return _0x2613aa;});})[_0x521d('0x24')](function(){_0x4e1e97[_0x521d('0x19')](0xcc)[_0x521d('0x18')]();});}};}function handleEntityNotFound(_0x5014e5,_0x43748e){return function(_0xdb34f2){if(!_0xdb34f2){_0x5014e5[_0x521d('0x17')](0x194);}return _0xdb34f2;};}function handleError(_0x573f57,_0x39e6c6){_0x39e6c6=_0x39e6c6||0x1f4;return function(_0x23a1b6){logger[_0x521d('0x28')](_0x23a1b6[_0x521d('0x29')]);if(_0x23a1b6[_0x521d('0x2a')]){delete _0x23a1b6[_0x521d('0x2a')];}_0x573f57['status'](_0x39e6c6)[_0x521d('0x2b')](_0x23a1b6);};}exports[_0x521d('0x2c')]=function(_0x42711a,_0x104cd3){var _0x194642={},_0x908771={},_0x4cee11={'count':0x0,'rows':[]};var _0x3b9337=_[_0x521d('0x2d')](db['CmHopperAdditionalPhone'][_0x521d('0x2e')],function(_0x529f9f){return{'name':_0x529f9f[_0x521d('0x2f')],'type':_0x529f9f['type'][_0x521d('0x30')]};});_0x908771['model']=_[_0x521d('0x2d')](_0x3b9337,'name');_0x908771[_0x521d('0x31')]=_[_0x521d('0x32')](_0x42711a[_0x521d('0x31')]);_0x908771['filters']=_['intersection'](_0x908771[_0x521d('0x33')],_0x908771[_0x521d('0x31')]);_0x194642['attributes']=_[_0x521d('0x34')](_0x908771['model'],qs['fields'](_0x42711a[_0x521d('0x31')][_0x521d('0x35')]));_0x194642[_0x521d('0x36')]=_0x194642['attributes'][_0x521d('0x37')]?_0x194642[_0x521d('0x36')]:_0x908771[_0x521d('0x33')];if(!_0x42711a[_0x521d('0x31')][_0x521d('0x38')](_0x521d('0x39'))){_0x194642[_0x521d('0x1e')]=qs[_0x521d('0x1e')](_0x42711a[_0x521d('0x31')][_0x521d('0x1e')]);_0x194642[_0x521d('0x1b')]=qs[_0x521d('0x1b')](_0x42711a['query'][_0x521d('0x1b')]);}_0x194642[_0x521d('0x3a')]=qs[_0x521d('0x3b')](_0x42711a[_0x521d('0x31')][_0x521d('0x3b')]);_0x194642['where']=qs[_0x521d('0x3c')](_[_0x521d('0x3d')](_0x42711a[_0x521d('0x31')],_0x908771[_0x521d('0x3c')]),_0x3b9337);if(_0x42711a['query'][_0x521d('0x3e')]){_0x194642[_0x521d('0x3f')]=_[_0x521d('0x40')](_0x194642[_0x521d('0x3f')],{'$or':_[_0x521d('0x2d')](_0x3b9337,function(_0x2182b3){if(_0x2182b3[_0x521d('0x41')]!==_0x521d('0x42')){var _0x2d734f={};_0x2d734f[_0x2182b3[_0x521d('0x2a')]]={'$like':'%'+_0x42711a[_0x521d('0x31')]['filter']+'%'};return _0x2d734f;}})});}_0x194642=_[_0x521d('0x40')]({},_0x194642,_0x42711a[_0x521d('0x43')]);var _0x13eb61={'where':_0x194642[_0x521d('0x3f')]};return db[_0x521d('0x44')][_0x521d('0x1d')](_0x13eb61)[_0x521d('0x24')](function(_0x38794c){_0x4cee11[_0x521d('0x1d')]=_0x38794c;if(_0x42711a[_0x521d('0x31')]['includeAll']){_0x194642[_0x521d('0x45')]=[{'all':!![]}];}return db[_0x521d('0x44')][_0x521d('0x46')](_0x194642);})[_0x521d('0x24')](function(_0x28dddd){_0x4cee11[_0x521d('0x47')]=_0x28dddd;return _0x4cee11;})['then'](respondWithFilteredResult(_0x104cd3,_0x194642))[_0x521d('0x48')](handleError(_0x104cd3,null));};exports['show']=function(_0x560c5b,_0x2865e4){var _0x447864={'raw':!![],'where':{'id':_0x560c5b[_0x521d('0x49')]['id']}},_0x195e58={};_0x195e58[_0x521d('0x33')]=_[_0x521d('0x32')](db[_0x521d('0x44')][_0x521d('0x2e')]);_0x195e58[_0x521d('0x31')]=_['keys'](_0x560c5b[_0x521d('0x31')]);_0x195e58[_0x521d('0x3c')]=_[_0x521d('0x34')](_0x195e58[_0x521d('0x33')],_0x195e58[_0x521d('0x31')]);_0x447864[_0x521d('0x36')]=_['intersection'](_0x195e58[_0x521d('0x33')],qs[_0x521d('0x35')](_0x560c5b[_0x521d('0x31')][_0x521d('0x35')]));_0x447864[_0x521d('0x36')]=_0x447864[_0x521d('0x36')][_0x521d('0x37')]?_0x447864[_0x521d('0x36')]:_0x195e58['model'];if(_0x560c5b['query'][_0x521d('0x4a')]){_0x447864[_0x521d('0x45')]=[{'all':!![]}];}_0x447864=_[_0x521d('0x40')]({},_0x447864,_0x560c5b[_0x521d('0x43')]);return db[_0x521d('0x44')][_0x521d('0x4b')](_0x447864)['then'](handleEntityNotFound(_0x2865e4,null))[_0x521d('0x24')](respondWithResult(_0x2865e4,null))[_0x521d('0x48')](handleError(_0x2865e4,null));};exports[_0x521d('0x4c')]=function(_0x59118b,_0x45ff6a){return db[_0x521d('0x44')][_0x521d('0x4c')](_0x59118b[_0x521d('0x4d')],{})[_0x521d('0x24')](function(_0x2e5f2e){var _0x17fe75=_0x59118b[_0x521d('0x4e')][_0x521d('0x26')]({'plain':!![]});if(!_0x17fe75)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x17fe75[_0x521d('0x4f')]===_0x521d('0x4e')){var _0x369216=_0x2e5f2e[_0x521d('0x26')]({'plain':!![]});var _0x34d3d4=_0x521d('0x50');return db[_0x521d('0x51')][_0x521d('0x4b')]({'where':{'name':_0x34d3d4,'userProfileId':_0x17fe75[_0x521d('0x52')]},'raw':!![]})['then'](function(_0x3906e8){if(_0x3906e8&&_0x3906e8[_0x521d('0x53')]===0x0){return db[_0x521d('0x27')][_0x521d('0x4c')]({'name':_0x369216['name'],'resourceId':_0x369216['id'],'type':_0x3906e8[_0x521d('0x2a')],'sectionId':_0x3906e8['id']},{})['then'](function(){return _0x2e5f2e;});}else{return _0x2e5f2e;}})[_0x521d('0x48')](function(_0x367bbd){logger['error'](_0x521d('0x54'),_0x367bbd);throw _0x367bbd;});}return _0x2e5f2e;})[_0x521d('0x24')](respondWithResult(_0x45ff6a,0xc9))[_0x521d('0x48')](handleError(_0x45ff6a,null));};exports['update']=function(_0x1ef1b2,_0x167f1b){if(_0x1ef1b2[_0x521d('0x4d')]['id']){delete _0x1ef1b2[_0x521d('0x4d')]['id'];}return db[_0x521d('0x44')][_0x521d('0x4b')]({'where':{'id':_0x1ef1b2['params']['id']}})['then'](handleEntityNotFound(_0x167f1b,null))['then'](saveUpdates(_0x1ef1b2['body'],null))['then'](respondWithResult(_0x167f1b,null))[_0x521d('0x48')](handleError(_0x167f1b,null));};exports[_0x521d('0x25')]=function(_0x260b28,_0x212f96){return db[_0x521d('0x44')][_0x521d('0x4b')]({'where':{'id':_0x260b28[_0x521d('0x49')]['id']}})[_0x521d('0x24')](handleEntityNotFound(_0x212f96,null))['then'](removeEntity(_0x212f96,null))['catch'](handleError(_0x212f96,null));};
\ No newline at end of file
+var _0xfb0b=['jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','set','Content-Range','reject','save','then','destroy','CmHopperAdditionalPhones','UserProfileResource','end','name','send','index','map','rawAttributes','key','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','CmHopperAdditionalPhone','count','includeAll','include','findAll','catch','show','params','keys','model','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','squel','crypto'];(function(_0x415774,_0x51ec60){var _0x3b1bfb=function(_0x647300){while(--_0x647300){_0x415774['push'](_0x415774['shift']());}};_0x3b1bfb(++_0x51ec60);}(_0xfb0b,0x94));var _0xbfb0=function(_0x146297,_0x17c702){_0x146297=_0x146297-0x0;var _0x4da9eb=_0xfb0b[_0x146297];return _0x4da9eb;};'use strict';var emlformat=require(_0xbfb0('0x0'));var rimraf=require(_0xbfb0('0x1'));var zipdir=require(_0xbfb0('0x2'));var jsonpatch=require(_0xbfb0('0x3'));var rp=require(_0xbfb0('0x4'));var moment=require(_0xbfb0('0x5'));var BPromise=require(_0xbfb0('0x6'));var Mustache=require(_0xbfb0('0x7'));var util=require('util');var path=require(_0xbfb0('0x8'));var sox=require(_0xbfb0('0x9'));var csv=require(_0xbfb0('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbfb0('0xb'));var _=require('lodash');var squel=require(_0xbfb0('0xc'));var crypto=require(_0xbfb0('0xd'));var jsforce=require(_0xbfb0('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xbfb0('0xa'));var querystring=require(_0xbfb0('0xf'));var Papa=require(_0xbfb0('0x10'));var Redis=require('ioredis');var authService=require(_0xbfb0('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xbfb0('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xbfb0('0x13'));var utils=require(_0xbfb0('0x14'));var config=require(_0xbfb0('0x15'));var licenseUtil=require(_0xbfb0('0x16'));var db=require(_0xbfb0('0x17'))['db'];function respondWithStatusCode(_0x2e5718,_0x8ed971){_0x8ed971=_0x8ed971||0xcc;return function(_0xa2f049){if(_0xa2f049){return _0x2e5718['sendStatus'](_0x8ed971);}return _0x2e5718[_0xbfb0('0x18')](_0x8ed971)['end']();};}function respondWithResult(_0x9278f9,_0x4b64b9){_0x4b64b9=_0x4b64b9||0xc8;return function(_0x42afd8){if(_0x42afd8){return _0x9278f9[_0xbfb0('0x18')](_0x4b64b9)[_0xbfb0('0x19')](_0x42afd8);}};}function respondWithFilteredResult(_0x246b50,_0x19031b){return function(_0x3c8a1a){if(_0x3c8a1a){var _0x245ec5=typeof _0x19031b[_0xbfb0('0x1a')]===_0xbfb0('0x1b')&&typeof _0x19031b[_0xbfb0('0x1c')]==='undefined';var _0xcec157=_0x3c8a1a['count'];var _0x10b096=_0x245ec5?0x0:_0x19031b['offset'];var _0x40f0a5=_0x245ec5?_0x3c8a1a['count']:_0x19031b['offset']+_0x19031b['limit'];var _0x3f9feb;if(_0x40f0a5>=_0xcec157){_0x40f0a5=_0xcec157;_0x3f9feb=0xc8;}else{_0x3f9feb=0xce;}_0x246b50[_0xbfb0('0x18')](_0x3f9feb);return _0x246b50[_0xbfb0('0x1d')](_0xbfb0('0x1e'),_0x10b096+'-'+_0x40f0a5+'/'+_0xcec157)['json'](_0x3c8a1a);}return null;};}function patchUpdates(_0x17802d){return function(_0x2feb81){try{jsonpatch['apply'](_0x2feb81,_0x17802d,!![]);}catch(_0x418569){return BPromise[_0xbfb0('0x1f')](_0x418569);}return _0x2feb81[_0xbfb0('0x20')]();};}function saveUpdates(_0xd1da6c,_0xd87897){return function(_0x22c0f0){if(_0x22c0f0){return _0x22c0f0['update'](_0xd1da6c)[_0xbfb0('0x21')](function(_0x3a6139){return _0x3a6139;});}return null;};}function removeEntity(_0x470a48,_0x3fb692){return function(_0x283b90){if(_0x283b90){return _0x283b90[_0xbfb0('0x22')]()[_0xbfb0('0x21')](function(){var _0x5096d5=_0x283b90['get']({'plain':!![]});var _0x2f4f84=_0xbfb0('0x23');return db[_0xbfb0('0x24')][_0xbfb0('0x22')]({'where':{'type':_0x2f4f84,'resourceId':_0x5096d5['id']}})[_0xbfb0('0x21')](function(){return _0x283b90;});})['then'](function(){_0x470a48[_0xbfb0('0x18')](0xcc)[_0xbfb0('0x25')]();});}};}function handleEntityNotFound(_0x2b905b,_0x2c95ae){return function(_0x4b8ec0){if(!_0x4b8ec0){_0x2b905b['sendStatus'](0x194);}return _0x4b8ec0;};}function handleError(_0x40ca5d,_0x55773a){_0x55773a=_0x55773a||0x1f4;return function(_0x2f7009){logger['error'](_0x2f7009['stack']);if(_0x2f7009[_0xbfb0('0x26')]){delete _0x2f7009[_0xbfb0('0x26')];}_0x40ca5d['status'](_0x55773a)[_0xbfb0('0x27')](_0x2f7009);};}exports[_0xbfb0('0x28')]=function(_0x30c82a,_0x2d65e8){var _0x2d4d2e={},_0x318cfe={},_0x274388={'count':0x0,'rows':[]};var _0x13ede2=_[_0xbfb0('0x29')](db['CmHopperAdditionalPhone'][_0xbfb0('0x2a')],function(_0x30ea57){return{'name':_0x30ea57['fieldName'],'type':_0x30ea57['type'][_0xbfb0('0x2b')]};});_0x318cfe['model']=_['map'](_0x13ede2,'name');_0x318cfe[_0xbfb0('0x2c')]=_['keys'](_0x30c82a[_0xbfb0('0x2c')]);_0x318cfe[_0xbfb0('0x2d')]=_['intersection'](_0x318cfe['model'],_0x318cfe[_0xbfb0('0x2c')]);_0x2d4d2e[_0xbfb0('0x2e')]=_[_0xbfb0('0x2f')](_0x318cfe['model'],qs[_0xbfb0('0x30')](_0x30c82a[_0xbfb0('0x2c')][_0xbfb0('0x30')]));_0x2d4d2e['attributes']=_0x2d4d2e[_0xbfb0('0x2e')][_0xbfb0('0x31')]?_0x2d4d2e[_0xbfb0('0x2e')]:_0x318cfe['model'];if(!_0x30c82a[_0xbfb0('0x2c')][_0xbfb0('0x32')]('nolimit')){_0x2d4d2e[_0xbfb0('0x1c')]=qs[_0xbfb0('0x1c')](_0x30c82a['query']['limit']);_0x2d4d2e[_0xbfb0('0x1a')]=qs[_0xbfb0('0x1a')](_0x30c82a[_0xbfb0('0x2c')]['offset']);}_0x2d4d2e[_0xbfb0('0x33')]=qs[_0xbfb0('0x34')](_0x30c82a[_0xbfb0('0x2c')][_0xbfb0('0x34')]);_0x2d4d2e[_0xbfb0('0x35')]=qs[_0xbfb0('0x2d')](_[_0xbfb0('0x36')](_0x30c82a[_0xbfb0('0x2c')],_0x318cfe['filters']),_0x13ede2);if(_0x30c82a[_0xbfb0('0x2c')][_0xbfb0('0x37')]){_0x2d4d2e[_0xbfb0('0x35')]=_[_0xbfb0('0x38')](_0x2d4d2e['where'],{'$or':_['map'](_0x13ede2,function(_0x37e398){if(_0x37e398[_0xbfb0('0x39')]!==_0xbfb0('0x3a')){var _0x13a750={};_0x13a750[_0x37e398[_0xbfb0('0x26')]]={'$like':'%'+_0x30c82a[_0xbfb0('0x2c')][_0xbfb0('0x37')]+'%'};return _0x13a750;}})});}_0x2d4d2e=_[_0xbfb0('0x38')]({},_0x2d4d2e,_0x30c82a[_0xbfb0('0x3b')]);var _0xd9e2f2={'where':_0x2d4d2e[_0xbfb0('0x35')]};return db[_0xbfb0('0x3c')]['count'](_0xd9e2f2)[_0xbfb0('0x21')](function(_0x41053e){_0x274388[_0xbfb0('0x3d')]=_0x41053e;if(_0x30c82a[_0xbfb0('0x2c')][_0xbfb0('0x3e')]){_0x2d4d2e[_0xbfb0('0x3f')]=[{'all':!![]}];}return db[_0xbfb0('0x3c')][_0xbfb0('0x40')](_0x2d4d2e);})[_0xbfb0('0x21')](function(_0x32d450){_0x274388['rows']=_0x32d450;return _0x274388;})[_0xbfb0('0x21')](respondWithFilteredResult(_0x2d65e8,_0x2d4d2e))[_0xbfb0('0x41')](handleError(_0x2d65e8,null));};exports[_0xbfb0('0x42')]=function(_0x5b1318,_0x68181c){var _0x551205={'raw':!![],'where':{'id':_0x5b1318[_0xbfb0('0x43')]['id']}},_0x43ad26={};_0x43ad26['model']=_[_0xbfb0('0x44')](db['CmHopperAdditionalPhone'][_0xbfb0('0x2a')]);_0x43ad26[_0xbfb0('0x2c')]=_['keys'](_0x5b1318['query']);_0x43ad26[_0xbfb0('0x2d')]=_[_0xbfb0('0x2f')](_0x43ad26[_0xbfb0('0x45')],_0x43ad26[_0xbfb0('0x2c')]);_0x551205[_0xbfb0('0x2e')]=_[_0xbfb0('0x2f')](_0x43ad26[_0xbfb0('0x45')],qs[_0xbfb0('0x30')](_0x5b1318['query'][_0xbfb0('0x30')]));_0x551205[_0xbfb0('0x2e')]=_0x551205[_0xbfb0('0x2e')][_0xbfb0('0x31')]?_0x551205[_0xbfb0('0x2e')]:_0x43ad26[_0xbfb0('0x45')];if(_0x5b1318[_0xbfb0('0x2c')][_0xbfb0('0x3e')]){_0x551205[_0xbfb0('0x3f')]=[{'all':!![]}];}_0x551205=_['merge']({},_0x551205,_0x5b1318[_0xbfb0('0x3b')]);return db[_0xbfb0('0x3c')][_0xbfb0('0x46')](_0x551205)[_0xbfb0('0x21')](handleEntityNotFound(_0x68181c,null))[_0xbfb0('0x21')](respondWithResult(_0x68181c,null))['catch'](handleError(_0x68181c,null));};exports[_0xbfb0('0x47')]=function(_0x53891c,_0x34e19b){return db[_0xbfb0('0x3c')][_0xbfb0('0x47')](_0x53891c['body'],{})['then'](function(_0x4ee50c){var _0x3b8bc9=_0x53891c[_0xbfb0('0x48')][_0xbfb0('0x49')]({'plain':!![]});if(!_0x3b8bc9)throw new Error(_0xbfb0('0x4a'));if(_0x3b8bc9['role']===_0xbfb0('0x48')){var _0x5ef65c=_0x4ee50c[_0xbfb0('0x49')]({'plain':!![]});var _0x5a9adc=_0xbfb0('0x23');return db[_0xbfb0('0x4b')]['find']({'where':{'name':_0x5a9adc,'userProfileId':_0x3b8bc9['userProfileId']},'raw':!![]})['then'](function(_0x5087ee){if(_0x5087ee&&_0x5087ee[_0xbfb0('0x4c')]===0x0){return db[_0xbfb0('0x24')]['create']({'name':_0x5ef65c['name'],'resourceId':_0x5ef65c['id'],'type':_0x5087ee[_0xbfb0('0x26')],'sectionId':_0x5087ee['id']},{})[_0xbfb0('0x21')](function(){return _0x4ee50c;});}else{return _0x4ee50c;}})[_0xbfb0('0x41')](function(_0x327489){logger[_0xbfb0('0x4d')](_0xbfb0('0x4e'),_0x327489);throw _0x327489;});}return _0x4ee50c;})['then'](respondWithResult(_0x34e19b,0xc9))['catch'](handleError(_0x34e19b,null));};exports[_0xbfb0('0x4f')]=function(_0x5e6e9f,_0x174482){if(_0x5e6e9f[_0xbfb0('0x50')]['id']){delete _0x5e6e9f['body']['id'];}return db[_0xbfb0('0x3c')]['find']({'where':{'id':_0x5e6e9f[_0xbfb0('0x43')]['id']}})[_0xbfb0('0x21')](handleEntityNotFound(_0x174482,null))[_0xbfb0('0x21')](saveUpdates(_0x5e6e9f[_0xbfb0('0x50')],null))[_0xbfb0('0x21')](respondWithResult(_0x174482,null))[_0xbfb0('0x41')](handleError(_0x174482,null));};exports[_0xbfb0('0x22')]=function(_0x1aab37,_0x11581f){return db[_0xbfb0('0x3c')][_0xbfb0('0x46')]({'where':{'id':_0x1aab37[_0xbfb0('0x43')]['id']}})[_0xbfb0('0x21')](handleEntityNotFound(_0x11581f,null))[_0xbfb0('0x21')](removeEntity(_0x11581f,null))[_0xbfb0('0x41')](handleError(_0x11581f,null));};
\ No newline at end of file
index c3c01a6..c6474b4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xde62=['./cmHopperAdditionalPhone.attributes','exports','define','cm_hopper_additional_phones','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x372515,_0xdd11f){var _0xa3bf4e=function(_0x212cc8){while(--_0x212cc8){_0x372515['push'](_0x372515['shift']());}};_0xa3bf4e(++_0xdd11f);}(_0xde62,0xf4));var _0x2de6=function(_0x1f5e0c,_0x49f7ce){_0x1f5e0c=_0x1f5e0c-0x0;var _0x49c1e5=_0xde62[_0x1f5e0c];return _0x49c1e5;};'use strict';var _=require(_0x2de6('0x0'));var util=require('util');var logger=require(_0x2de6('0x1'))('api');var moment=require(_0x2de6('0x2'));var BPromise=require(_0x2de6('0x3'));var rp=require(_0x2de6('0x4'));var fs=require('fs');var path=require(_0x2de6('0x5'));var rimraf=require(_0x2de6('0x6'));var config=require(_0x2de6('0x7'));var attributes=require(_0x2de6('0x8'));module[_0x2de6('0x9')]=function(_0x4e91a6,_0xaa8f80){return _0x4e91a6[_0x2de6('0xa')]('CmHopperAdditionalPhone',attributes,{'tableName':_0x2de6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa21d=['path','rimraf','../../config/environment','exports','define','CmHopperAdditionalPhone','cm_hopper_additional_phones','lodash','../../config/logger','api','moment','request-promise'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xa21d,0x8b));var _0xda21=function(_0xbd17dd,_0x4af886){_0xbd17dd=_0xbd17dd-0x0;var _0x5458ba=_0xa21d[_0xbd17dd];return _0x5458ba;};'use strict';var _=require(_0xda21('0x0'));var util=require('util');var logger=require(_0xda21('0x1'))(_0xda21('0x2'));var moment=require(_0xda21('0x3'));var BPromise=require('bluebird');var rp=require(_0xda21('0x4'));var fs=require('fs');var path=require(_0xda21('0x5'));var rimraf=require(_0xda21('0x6'));var config=require(_0xda21('0x7'));var attributes=require('./cmHopperAdditionalPhone.attributes');module[_0xda21('0x8')]=function(_0xd43f6b,_0x2e18bc){return _0xd43f6b[_0xda21('0x9')](_0xda21('0xa'),attributes,{'tableName':_0xda21('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 1f7e29a..2fbee17 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x90d2=['ContactId','duration','waitTime','isNil','scheduledat','add','minutes','createdAt','updatedAt','phone','sequelize','transaction','activateAdditionalPhone','IncrementPreviewCounters','update','field','lodash','util','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','CmHopperAdditionalPhone,\x20%s,\x20%s','request\x20sent','debug','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','error','code','message','result','VerifyAdditionalPhones','CmHopper','body','ListId','VoiceQueueId','CampaignId','then','CmHopperAdditionalPhone','findOne','OrderBy','ASC','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','entity','dialGlobalMaxRetry','catch','SwapAdditionalPhones'];(function(_0x486b00,_0x501df5){var _0x47ea82=function(_0x997782){while(--_0x997782){_0x486b00['push'](_0x486b00['shift']());}};_0x47ea82(++_0x501df5);}(_0x90d2,0x86));var _0x290d=function(_0x5668be,_0x5e93cf){_0x5668be=_0x5668be-0x0;var _0x425f72=_0x90d2[_0x5668be];return _0x425f72;};'use strict';var _=require(_0x290d('0x0'));var util=require(_0x290d('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x290d('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x290d('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x290d('0x4'))(_0x290d('0x5'));var config=require(_0x290d('0x6'));var jayson=require(_0x290d('0x7'));var client=jayson[_0x290d('0x8')][_0x290d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x416f5b,_0x4eeddf,_0x3aeb85){return new BPromise(function(_0x286134,_0x2fe9f7){return client[_0x290d('0xa')](_0x416f5b,_0x3aeb85)['then'](function(_0x49860c){logger[_0x290d('0xb')](_0x290d('0xc'),_0x4eeddf,_0x290d('0xd'));logger[_0x290d('0xe')](_0x290d('0xf'),_0x4eeddf,_0x290d('0xd'),JSON['stringify'](_0x49860c));if(_0x49860c[_0x290d('0x10')]){if(_0x49860c['error'][_0x290d('0x11')]===0x1f4){logger[_0x290d('0x10')](_0x290d('0xc'),_0x4eeddf,_0x49860c[_0x290d('0x10')]['message']);return _0x2fe9f7(_0x49860c[_0x290d('0x10')][_0x290d('0x12')]);}logger[_0x290d('0x10')](_0x290d('0xc'),_0x4eeddf,_0x49860c[_0x290d('0x10')][_0x290d('0x12')]);return _0x286134(_0x49860c[_0x290d('0x10')][_0x290d('0x12')]);}else{logger['info'](_0x290d('0xc'),_0x4eeddf,_0x290d('0xd'));_0x286134(_0x49860c[_0x290d('0x13')][_0x290d('0x12')]);}})['catch'](function(_0x49c7d5){logger[_0x290d('0x10')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x4eeddf,_0x49c7d5);_0x2fe9f7(_0x49c7d5);});});}exports[_0x290d('0x14')]=function(_0xdb5cb8){var _0x16d4c9=this;return new Promise(function(_0x4fc9ed,_0x2fbddf){return db[_0x290d('0x15')]['findOne']({'raw':!![],'where':{'ContactId':_0xdb5cb8['body']['ContactId'],'ListId':_0xdb5cb8[_0x290d('0x16')][_0x290d('0x17')],'VoiceQueueId':_0xdb5cb8['body'][_0x290d('0x18')]===undefined?null:_0xdb5cb8['body'][_0x290d('0x18')],'CampaignId':_0xdb5cb8[_0x290d('0x16')][_0x290d('0x19')]===undefined?null:_0xdb5cb8['body'][_0x290d('0x19')]}})[_0x290d('0x1a')](function(_0x380347){if(_0x380347!=null){return db[_0x290d('0x1b')][_0x290d('0x1c')]({'raw':!![],'where':{'CmHopperId':_0x380347['id'],'OrderBy':{'$gt':_0x380347[_0x290d('0x1d')]}},'order':[['OrderBy',_0x290d('0x1e')]]})[_0x290d('0x1a')](function(_0x12292){var _0x408e05=0x0;if(_0x12292){if(_0x12292[_0x290d('0x1f')]+_0x12292[_0x290d('0x20')]+_0x12292[_0x290d('0x21')]+_0x12292[_0x290d('0x22')]+_0x12292['countdropretry']+_0x12292[_0x290d('0x23')]+_0x12292[_0x290d('0x24')]+_0x12292[_0x290d('0x25')]<_0xdb5cb8['entity']['dialGlobalMaxRetry'])_0x408e05=0x1;_0x4fc9ed({'additional':_0x408e05});}else{return db[_0x290d('0x1b')]['findOne']({'raw':!![],'where':{'CmHopperId':_0x380347['id']},'order':[[_0x290d('0x1d'),'ASC']]})[_0x290d('0x1a')](function(_0x4ffb14){var _0x219d94=0x0;if(_0x4ffb14){if(_0x4ffb14[_0x290d('0x1f')]+_0x4ffb14['countcongestionretry']+_0x4ffb14[_0x290d('0x21')]+_0x4ffb14[_0x290d('0x22')]+_0x4ffb14[_0x290d('0x26')]+_0x4ffb14[_0x290d('0x23')]+_0x4ffb14[_0x290d('0x24')]+_0x4ffb14['countagentrejectretry']<_0xdb5cb8[_0x290d('0x27')][_0x290d('0x28')])_0x219d94=0x1;_0x4fc9ed({'additional':_0x219d94});}else{_0x4fc9ed({'additional':0x0});}})[_0x290d('0x29')](function(_0x1c5469){logger[_0x290d('0x10')](_0x290d('0x14'),_0x1c5469[_0x290d('0x12')]);_0x2fbddf(_0x16d4c9['error'](0x1f4,_0x1c5469[_0x290d('0x12')]));});}})['catch'](function(_0xaa0752){logger[_0x290d('0x10')]('VerifyAdditionalPhones',_0xaa0752[_0x290d('0x12')]);_0x2fbddf(_0x16d4c9[_0x290d('0x10')](0x1f4,_0xaa0752[_0x290d('0x12')]));});}else _0x4fc9ed({'additional':0x0});});});};exports[_0x290d('0x2a')]=function(_0x1b2b99){var _0xdab22=this;return new Promise(function(_0x50f34e,_0x404ca2){return db['CmHopper'][_0x290d('0x1c')]({'raw':!![],'where':{'ContactId':_0x1b2b99[_0x290d('0x16')][_0x290d('0x2b')],'ListId':_0x1b2b99['body'][_0x290d('0x17')],'VoiceQueueId':_0x1b2b99[_0x290d('0x16')][_0x290d('0x18')]===undefined?null:_0x1b2b99[_0x290d('0x16')][_0x290d('0x18')],'CampaignId':_0x1b2b99[_0x290d('0x16')]['CampaignId']===undefined?null:_0x1b2b99[_0x290d('0x16')][_0x290d('0x19')]}})[_0x290d('0x1a')](function(_0x3a3f1d){if(_0x3a3f1d!=null){return db[_0x290d('0x1b')][_0x290d('0x1c')]({'raw':!![],'where':{'CmHopperId':_0x3a3f1d['id'],'OrderBy':{'$gte':_0x3a3f1d[_0x290d('0x1d')]}},'order':[[_0x290d('0x1d'),_0x290d('0x1e')]]})[_0x290d('0x1a')](function(_0x562b15){if(_0x562b15)return activateAdditionalPhone(_0x3a3f1d,_0x1b2b99[_0x290d('0x16')],_0x562b15,_0x1b2b99[_0x290d('0x2c')],_0x1b2b99[_0x290d('0x2d')])[_0x290d('0x1a')](function(_0x32f058){_0x50f34e(_0x32f058);});else{return db['CmHopperAdditionalPhone'][_0x290d('0x1c')]({'raw':!![],'where':{'CmHopperId':_0x3a3f1d['id']},'order':[[_0x290d('0x1d'),_0x290d('0x1e')]]})[_0x290d('0x1a')](function(_0x1025ed){if(_0x1025ed)return activateAdditionalPhone(_0x3a3f1d,_0x1b2b99[_0x290d('0x16')],_0x1025ed,_0x1b2b99[_0x290d('0x2c')],_0x1b2b99[_0x290d('0x2d')])['then'](function(_0x11f502){_0x50f34e(_0x11f502);});else{_0x50f34e({'id':_0x3a3f1d['id'],'phone':''});}})[_0x290d('0x29')](function(_0x39c020){logger[_0x290d('0x10')](_0x290d('0x14'),_0x39c020['message']);_0x404ca2(_0xdab22['error'](0x1f4,_0x39c020[_0x290d('0x12')]));});}})['catch'](function(_0x159bbd){logger[_0x290d('0x10')](_0x290d('0x14'),_0x159bbd[_0x290d('0x12')]);_0x404ca2(_0xdab22[_0x290d('0x10')](0x1f4,_0x159bbd[_0x290d('0x12')]));});}else _0x50f34e(0x1);});});};function activateAdditionalPhone(_0x2b3a0c,_0x463d69,_0x48db55,_0x2a4b4c,_0x243461){return new Promise(function(_0x7b2ef1,_0xec9a92){var _0x8935ad;if(_[_0x290d('0x2e')](_0x48db55['scheduledat'])){_0x48db55[_0x290d('0x2f')]=moment();}if(moment()>moment(_0x48db55[_0x290d('0x2f')])){_0x8935ad=moment()[_0x290d('0x30')](_0x243461||0x3,_0x290d('0x31'));}else{if(_0x48db55[_0x290d('0x1d')]==0x0){_0x8935ad=moment(_0x48db55[_0x290d('0x2f')]);}else{_0x8935ad=moment()[_0x290d('0x30')](_0x243461||0x3,_0x290d('0x31'));}}if(_[_0x290d('0x2e')](_0x8935ad)){_0x8935ad=moment()['add'](_0x243461||0x3,'minutes');}var _0x2dcccc={'phone':_0x2b3a0c['phone'],'active':0x0,'OrderBy':_[_0x290d('0x2e')](_0x2b3a0c[_0x290d('0x1d')])?0x0:_0x2b3a0c[_0x290d('0x1d')],'scheduledat':moment()[_0x290d('0x30')](_0x2a4b4c||0x1,_0x290d('0x31')),'countbusyretry':_0x463d69['countbusyretry'],'countcongestionretry':_0x463d69[_0x290d('0x20')],'countnoanswerretry':_0x463d69['countnoanswerretry'],'countnosuchnumberretry':_0x463d69[_0x290d('0x22')],'countdropretry':_0x463d69['countdropretry'],'countabandonedretry':_0x463d69['countabandonedretry'],'countmachineretry':_0x463d69[_0x290d('0x24')],'countagentrejectretry':_0x463d69[_0x290d('0x25')],'createdAt':_0x463d69[_0x290d('0x32')],'updatedAt':_0x463d69[_0x290d('0x33')]};var _0x46afb3={'CmHopperId':_0x2b3a0c['id'],'phone':_0x48db55[_0x290d('0x34')],'active':0x0,'OrderBy':_[_0x290d('0x2e')](_0x48db55[_0x290d('0x1d')])?0x0:_0x48db55[_0x290d('0x1d')],'scheduledat':_0x8935ad,'countbusyretry':_0x48db55[_0x290d('0x1f')],'countcongestionretry':_0x48db55[_0x290d('0x20')],'countnoanswerretry':_0x48db55[_0x290d('0x21')],'countnosuchnumberretry':_0x48db55[_0x290d('0x22')],'countdropretry':_0x48db55[_0x290d('0x26')],'countabandonedretry':_0x48db55[_0x290d('0x23')],'countmachineretry':_0x48db55['countmachineretry'],'countagentrejectretry':_0x48db55[_0x290d('0x25')],'createdAt':_0x48db55['createdAt'],'updatedAt':_0x48db55[_0x290d('0x33')]};return db[_0x290d('0x35')][_0x290d('0x36')](function(_0x26ff7a){return db[_0x290d('0x1b')]['update'](_0x2dcccc,{'where':{'id':_0x48db55['id']}},{'transaction':_0x26ff7a})[_0x290d('0x1a')](function(){return db[_0x290d('0x15')]['update'](_0x46afb3,{'where':{'id':_0x2b3a0c['id']}},{'transaction':_0x26ff7a});});})[_0x290d('0x1a')](function(_0xd8311){_0x7b2ef1({'id':_0x2b3a0c['id'],'phone':_0x48db55['phone']});})[_0x290d('0x29')](function(_0x3b164b){logger['error'](_0x290d('0x37'),_0x3b164b[_0x290d('0x12')]);_0xec9a92({'error':_0x3b164b[_0x290d('0x12')]});});});}exports[_0x290d('0x38')]=function(_0x4e626f){var _0x64f384=this;return new Promise(function(_0xabd07a,_0x5eba27){return db[_0x290d('0x15')][_0x290d('0x39')](_0x4e626f['body'][_0x290d('0x3a')],{'where':{'id':_0x4e626f[_0x290d('0x16')]['id']}})[_0x290d('0x1a')](function(_0x4e46c5){_0xabd07a(_0x4e46c5);})[_0x290d('0x29')](function(_0xef3f9c){logger[_0x290d('0x10')](_0x290d('0x38'),_0xef3f9c['message']);_0x5eba27(_0x64f384[_0x290d('0x10')](0x1f4,_0xef3f9c[_0x290d('0x12')]));});});};
\ No newline at end of file
+var _0xf915=['client','request','then','info','CmHopperAdditionalPhone,\x20%s,\x20%s','request\x20sent','debug','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CmHopper','body','ContactId','VoiceQueueId','CampaignId','OrderBy','countbusyretry','countdropretry','countmachineretry','entity','dialGlobalMaxRetry','CmHopperAdditionalPhone','findOne','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countabandonedretry','catch','VerifyAdditionalPhones','SwapAdditionalPhones','ListId','ASC','duration','waitTime','isNil','scheduledat','add','minutes','phone','countagentrejectretry','createdAt','updatedAt','transaction','activateAdditionalPhone','update','field','IncrementPreviewCounters','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x284aac,_0x5a3201){var _0xe067ec=function(_0x16367e){while(--_0x16367e){_0x284aac['push'](_0x284aac['shift']());}};_0xe067ec(++_0x5a3201);}(_0xf915,0x6e));var _0x5f91=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xf915[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0x5f91('0x0'));var util=require(_0x5f91('0x1'));var moment=require('moment');var BPromise=require(_0x5f91('0x2'));var rs=require(_0x5f91('0x3'));var fs=require('fs');var Redis=require(_0x5f91('0x4'));var db=require(_0x5f91('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x5f91('0x6'))(_0x5f91('0x7'));var config=require(_0x5f91('0x8'));var jayson=require(_0x5f91('0x9'));var client=jayson[_0x5f91('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x42928e,_0xe9c58c,_0x3a88a5){return new BPromise(function(_0x1f70e0,_0x126dc9){return client[_0x5f91('0xb')](_0x42928e,_0x3a88a5)[_0x5f91('0xc')](function(_0x238553){logger[_0x5f91('0xd')](_0x5f91('0xe'),_0xe9c58c,_0x5f91('0xf'));logger[_0x5f91('0x10')](_0x5f91('0x11'),_0xe9c58c,_0x5f91('0xf'),JSON[_0x5f91('0x12')](_0x238553));if(_0x238553[_0x5f91('0x13')]){if(_0x238553['error'][_0x5f91('0x14')]===0x1f4){logger[_0x5f91('0x13')](_0x5f91('0xe'),_0xe9c58c,_0x238553[_0x5f91('0x13')][_0x5f91('0x15')]);return _0x126dc9(_0x238553[_0x5f91('0x13')][_0x5f91('0x15')]);}logger[_0x5f91('0x13')](_0x5f91('0xe'),_0xe9c58c,_0x238553['error'][_0x5f91('0x15')]);return _0x1f70e0(_0x238553['error']['message']);}else{logger[_0x5f91('0xd')](_0x5f91('0xe'),_0xe9c58c,_0x5f91('0xf'));_0x1f70e0(_0x238553[_0x5f91('0x16')][_0x5f91('0x15')]);}})['catch'](function(_0x2ffda9){logger[_0x5f91('0x13')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0xe9c58c,_0x2ffda9);_0x126dc9(_0x2ffda9);});});}exports['VerifyAdditionalPhones']=function(_0x247f13){var _0x1b8574=this;return new Promise(function(_0x2d7cec,_0x58b4a6){return db[_0x5f91('0x17')]['findOne']({'raw':!![],'where':{'ContactId':_0x247f13[_0x5f91('0x18')][_0x5f91('0x19')],'ListId':_0x247f13[_0x5f91('0x18')]['ListId'],'VoiceQueueId':_0x247f13[_0x5f91('0x18')][_0x5f91('0x1a')]===undefined?null:_0x247f13[_0x5f91('0x18')][_0x5f91('0x1a')],'CampaignId':_0x247f13[_0x5f91('0x18')][_0x5f91('0x1b')]===undefined?null:_0x247f13[_0x5f91('0x18')][_0x5f91('0x1b')]}})[_0x5f91('0xc')](function(_0x33245d){if(_0x33245d!=null){return db['CmHopperAdditionalPhone']['findOne']({'raw':!![],'where':{'CmHopperId':_0x33245d['id'],'OrderBy':{'$gt':_0x33245d[_0x5f91('0x1c')]}},'order':[[_0x5f91('0x1c'),'ASC']]})['then'](function(_0x27e682){var _0x5bd86b=0x0;if(_0x27e682){if(_0x27e682[_0x5f91('0x1d')]+_0x27e682['countcongestionretry']+_0x27e682['countnoanswerretry']+_0x27e682['countnosuchnumberretry']+_0x27e682[_0x5f91('0x1e')]+_0x27e682['countabandonedretry']+_0x27e682[_0x5f91('0x1f')]+_0x27e682['countagentrejectretry']<_0x247f13[_0x5f91('0x20')][_0x5f91('0x21')])_0x5bd86b=0x1;_0x2d7cec({'additional':_0x5bd86b});}else{return db[_0x5f91('0x22')][_0x5f91('0x23')]({'raw':!![],'where':{'CmHopperId':_0x33245d['id']},'order':[[_0x5f91('0x1c'),'ASC']]})['then'](function(_0x1de9d9){var _0x3b5b2f=0x0;if(_0x1de9d9){if(_0x1de9d9[_0x5f91('0x1d')]+_0x1de9d9[_0x5f91('0x24')]+_0x1de9d9[_0x5f91('0x25')]+_0x1de9d9[_0x5f91('0x26')]+_0x1de9d9[_0x5f91('0x1e')]+_0x1de9d9[_0x5f91('0x27')]+_0x1de9d9[_0x5f91('0x1f')]+_0x1de9d9['countagentrejectretry']<_0x247f13[_0x5f91('0x20')][_0x5f91('0x21')])_0x3b5b2f=0x1;_0x2d7cec({'additional':_0x3b5b2f});}else{_0x2d7cec({'additional':0x0});}})[_0x5f91('0x28')](function(_0x3b27d2){logger[_0x5f91('0x13')](_0x5f91('0x29'),_0x3b27d2[_0x5f91('0x15')]);_0x58b4a6(_0x1b8574['error'](0x1f4,_0x3b27d2[_0x5f91('0x15')]));});}})[_0x5f91('0x28')](function(_0x216080){logger[_0x5f91('0x13')](_0x5f91('0x29'),_0x216080[_0x5f91('0x15')]);_0x58b4a6(_0x1b8574['error'](0x1f4,_0x216080[_0x5f91('0x15')]));});}else _0x2d7cec({'additional':0x0});});});};exports[_0x5f91('0x2a')]=function(_0x4ed477){var _0x266ea3=this;return new Promise(function(_0x220de8,_0x434391){return db[_0x5f91('0x17')][_0x5f91('0x23')]({'raw':!![],'where':{'ContactId':_0x4ed477[_0x5f91('0x18')]['ContactId'],'ListId':_0x4ed477[_0x5f91('0x18')][_0x5f91('0x2b')],'VoiceQueueId':_0x4ed477['body'][_0x5f91('0x1a')]===undefined?null:_0x4ed477[_0x5f91('0x18')][_0x5f91('0x1a')],'CampaignId':_0x4ed477[_0x5f91('0x18')]['CampaignId']===undefined?null:_0x4ed477[_0x5f91('0x18')][_0x5f91('0x1b')]}})['then'](function(_0x5effd9){if(_0x5effd9!=null){return db[_0x5f91('0x22')][_0x5f91('0x23')]({'raw':!![],'where':{'CmHopperId':_0x5effd9['id'],'OrderBy':{'$gte':_0x5effd9[_0x5f91('0x1c')]}},'order':[['OrderBy',_0x5f91('0x2c')]]})[_0x5f91('0xc')](function(_0x5ef258){if(_0x5ef258)return activateAdditionalPhone(_0x5effd9,_0x4ed477[_0x5f91('0x18')],_0x5ef258,_0x4ed477[_0x5f91('0x2d')],_0x4ed477[_0x5f91('0x2e')])[_0x5f91('0xc')](function(_0x180d10){_0x220de8(_0x180d10);});else{return db[_0x5f91('0x22')][_0x5f91('0x23')]({'raw':!![],'where':{'CmHopperId':_0x5effd9['id']},'order':[['OrderBy',_0x5f91('0x2c')]]})[_0x5f91('0xc')](function(_0x13f2e6){if(_0x13f2e6)return activateAdditionalPhone(_0x5effd9,_0x4ed477[_0x5f91('0x18')],_0x13f2e6,_0x4ed477[_0x5f91('0x2d')],_0x4ed477['waitTime'])[_0x5f91('0xc')](function(_0x39384c){_0x220de8(_0x39384c);});else{_0x220de8({'id':_0x5effd9['id'],'phone':''});}})[_0x5f91('0x28')](function(_0x44e493){logger['error'](_0x5f91('0x29'),_0x44e493[_0x5f91('0x15')]);_0x434391(_0x266ea3['error'](0x1f4,_0x44e493[_0x5f91('0x15')]));});}})[_0x5f91('0x28')](function(_0x5ef571){logger['error'](_0x5f91('0x29'),_0x5ef571['message']);_0x434391(_0x266ea3[_0x5f91('0x13')](0x1f4,_0x5ef571[_0x5f91('0x15')]));});}else _0x220de8(0x1);});});};function activateAdditionalPhone(_0x3c6636,_0x3999f8,_0xac3f6,_0x4e5749,_0x1967d6){return new Promise(function(_0x20c623,_0x2cf48a){var _0x371670;if(_[_0x5f91('0x2f')](_0xac3f6['scheduledat'])){_0xac3f6[_0x5f91('0x30')]=moment();}if(moment()>moment(_0xac3f6[_0x5f91('0x30')])){_0x371670=moment()[_0x5f91('0x31')](_0x1967d6||0x3,_0x5f91('0x32'));}else{if(_0xac3f6['OrderBy']==0x0){_0x371670=moment(_0xac3f6[_0x5f91('0x30')]);}else{_0x371670=moment()['add'](_0x1967d6||0x3,'minutes');}}if(_[_0x5f91('0x2f')](_0x371670)){_0x371670=moment()['add'](_0x1967d6||0x3,_0x5f91('0x32'));}var _0x49bd56={'phone':_0x3c6636[_0x5f91('0x33')],'active':0x0,'OrderBy':_[_0x5f91('0x2f')](_0x3c6636[_0x5f91('0x1c')])?0x0:_0x3c6636[_0x5f91('0x1c')],'scheduledat':moment()['add'](_0x4e5749||0x1,_0x5f91('0x32')),'countbusyretry':_0x3999f8[_0x5f91('0x1d')],'countcongestionretry':_0x3999f8['countcongestionretry'],'countnoanswerretry':_0x3999f8['countnoanswerretry'],'countnosuchnumberretry':_0x3999f8['countnosuchnumberretry'],'countdropretry':_0x3999f8['countdropretry'],'countabandonedretry':_0x3999f8[_0x5f91('0x27')],'countmachineretry':_0x3999f8[_0x5f91('0x1f')],'countagentrejectretry':_0x3999f8[_0x5f91('0x34')],'createdAt':_0x3999f8[_0x5f91('0x35')],'updatedAt':_0x3999f8[_0x5f91('0x36')]};var _0x3fc0b2={'CmHopperId':_0x3c6636['id'],'phone':_0xac3f6['phone'],'active':0x0,'OrderBy':_['isNil'](_0xac3f6[_0x5f91('0x1c')])?0x0:_0xac3f6[_0x5f91('0x1c')],'scheduledat':_0x371670,'countbusyretry':_0xac3f6['countbusyretry'],'countcongestionretry':_0xac3f6[_0x5f91('0x24')],'countnoanswerretry':_0xac3f6[_0x5f91('0x25')],'countnosuchnumberretry':_0xac3f6['countnosuchnumberretry'],'countdropretry':_0xac3f6[_0x5f91('0x1e')],'countabandonedretry':_0xac3f6[_0x5f91('0x27')],'countmachineretry':_0xac3f6['countmachineretry'],'countagentrejectretry':_0xac3f6[_0x5f91('0x34')],'createdAt':_0xac3f6[_0x5f91('0x35')],'updatedAt':_0xac3f6[_0x5f91('0x36')]};return db['sequelize'][_0x5f91('0x37')](function(_0x229c99){return db[_0x5f91('0x22')]['update'](_0x49bd56,{'where':{'id':_0xac3f6['id']}},{'transaction':_0x229c99})['then'](function(){return db['CmHopper']['update'](_0x3fc0b2,{'where':{'id':_0x3c6636['id']}},{'transaction':_0x229c99});});})['then'](function(_0x9e2f10){_0x20c623({'id':_0x3c6636['id'],'phone':_0xac3f6[_0x5f91('0x33')]});})['catch'](function(_0x2b50b7){logger[_0x5f91('0x13')](_0x5f91('0x38'),_0x2b50b7[_0x5f91('0x15')]);_0x2cf48a({'error':_0x2b50b7[_0x5f91('0x15')]});});});}exports['IncrementPreviewCounters']=function(_0x35f0cd){var _0x46e85f=this;return new Promise(function(_0x29c4d1,_0x56b2bb){return db[_0x5f91('0x17')][_0x5f91('0x39')](_0x35f0cd[_0x5f91('0x18')][_0x5f91('0x3a')],{'where':{'id':_0x35f0cd[_0x5f91('0x18')]['id']}})[_0x5f91('0xc')](function(_0x32c877){_0x29c4d1(_0x32c877);})[_0x5f91('0x28')](function(_0x114047){logger['error'](_0x5f91('0x3b'),_0x114047[_0x5f91('0x15')]);_0x56b2bb(_0x46e85f[_0x5f91('0x13')](0x1f4,_0x114047[_0x5f91('0x15')]));});});};
\ No newline at end of file
index 74782eb..b1efa96 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x29f7=['./cmHopperAdditionalPhone.controller','get','isAuthenticated','index','/:id','put','delete','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0xe912a1,_0xa9e0a2){var _0x482054=function(_0x29d45a){while(--_0x29d45a){_0xe912a1['push'](_0xe912a1['shift']());}};_0x482054(++_0xa9e0a2);}(_0x29f7,0xf8));var _0x729f=function(_0x1d6216,_0x250153){_0x1d6216=_0x1d6216-0x0;var _0x28a629=_0x29f7[_0x1d6216];return _0x28a629;};'use strict';var multer=require(_0x729f('0x0'));var util=require(_0x729f('0x1'));var path=require(_0x729f('0x2'));var timeout=require('connect-timeout');var express=require(_0x729f('0x3'));var router=express['Router']();var fs_extra=require(_0x729f('0x4'));var auth=require(_0x729f('0x5'));var interaction=require(_0x729f('0x6'));var config=require('../../config/environment');var controller=require(_0x729f('0x7'));router[_0x729f('0x8')]('/',auth[_0x729f('0x9')](),controller[_0x729f('0xa')]);router[_0x729f('0x8')](_0x729f('0xb'),auth[_0x729f('0x9')](),controller['show']);router['post']('/',auth[_0x729f('0x9')](),controller['create']);router[_0x729f('0xc')](_0x729f('0xb'),auth[_0x729f('0x9')](),controller['update']);router[_0x729f('0xd')]('/:id',auth[_0x729f('0x9')](),controller['destroy']);module[_0x729f('0xe')]=router;
\ No newline at end of file
+var _0x8ba2=['Router','fs-extra','../../components/interaction/service','../../config/environment','./cmHopperAdditionalPhone.controller','get','isAuthenticated','index','/:id','show','create','put','update','delete','destroy','multer','util','path','express'];(function(_0x79cd47,_0x16102d){var _0x3b9484=function(_0x23db95){while(--_0x23db95){_0x79cd47['push'](_0x79cd47['shift']());}};_0x3b9484(++_0x16102d);}(_0x8ba2,0x13f));var _0x28ba=function(_0x4a4caf,_0x16c73b){_0x4a4caf=_0x4a4caf-0x0;var _0x2d1049=_0x8ba2[_0x4a4caf];return _0x2d1049;};'use strict';var multer=require(_0x28ba('0x0'));var util=require(_0x28ba('0x1'));var path=require(_0x28ba('0x2'));var timeout=require('connect-timeout');var express=require(_0x28ba('0x3'));var router=express[_0x28ba('0x4')]();var fs_extra=require(_0x28ba('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x28ba('0x6'));var config=require(_0x28ba('0x7'));var controller=require(_0x28ba('0x8'));router[_0x28ba('0x9')]('/',auth[_0x28ba('0xa')](),controller[_0x28ba('0xb')]);router['get'](_0x28ba('0xc'),auth[_0x28ba('0xa')](),controller[_0x28ba('0xd')]);router['post']('/',auth[_0x28ba('0xa')](),controller[_0x28ba('0xe')]);router[_0x28ba('0xf')](_0x28ba('0xc'),auth[_0x28ba('0xa')](),controller[_0x28ba('0x10')]);router[_0x28ba('0x11')](_0x28ba('0xc'),auth[_0x28ba('0xa')](),controller[_0x28ba('0x12')]);module['exports']=router;
\ No newline at end of file
index 6c070b3..ed1a479 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9ff9=['STRING','INTEGER','contactListQueue','sequelize'];(function(_0x4f5e03,_0x43528f){var _0x43a149=function(_0x278f47){while(--_0x278f47){_0x4f5e03['push'](_0x4f5e03['shift']());}};_0x43a149(++_0x43528f);}(_0x9ff9,0x1c3));var _0x99ff=function(_0x28d18d,_0x55896b){_0x28d18d=_0x28d18d-0x0;var _0x470640=_0x9ff9[_0x28d18d];return _0x470640;};'use strict';var moment=require('moment');var Sequelize=require(_0x99ff('0x0'));module['exports']={'phone':{'type':Sequelize[_0x99ff('0x1')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x99ff('0x2')],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0x99ff('0x2')],'unique':_0x99ff('0x3')},'VoiceQueueId':{'type':Sequelize[_0x99ff('0x2')],'unique':_0x99ff('0x3')}};
\ No newline at end of file
+var _0x4fd7=['INTEGER','contactListQueue','moment','sequelize','exports','STRING'];(function(_0x5c5b73,_0x26c7e4){var _0x3975db=function(_0x129032){while(--_0x129032){_0x5c5b73['push'](_0x5c5b73['shift']());}};_0x3975db(++_0x26c7e4);}(_0x4fd7,0xe6));var _0x74fd=function(_0x14a207,_0x462179){_0x14a207=_0x14a207-0x0;var _0x5c81a9=_0x4fd7[_0x14a207];return _0x5c81a9;};'use strict';var moment=require(_0x74fd('0x0'));var Sequelize=require(_0x74fd('0x1'));module[_0x74fd('0x2')]={'phone':{'type':Sequelize[_0x74fd('0x3')],'allowNull':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0x74fd('0x4')],'unique':_0x74fd('0x5')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0x74fd('0x5')}};
\ No newline at end of file
index 8975ef0..2296114 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xff48=['findAll','rows','show','params','includeAll','include','merge','find','catch','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','json','offset','limit','undefined','count','status','set','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','CmHopperBlack','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','options'];(function(_0x1d68d6,_0x2fbda3){var _0x2de5a1=function(_0x880d5b){while(--_0x880d5b){_0x1d68d6['push'](_0x1d68d6['shift']());}};_0x2de5a1(++_0x2fbda3);}(_0xff48,0xf2));var _0x8ff4=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xff48[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8ff4('0x0'));var zipdir=require(_0x8ff4('0x1'));var jsonpatch=require(_0x8ff4('0x2'));var rp=require(_0x8ff4('0x3'));var moment=require('moment');var BPromise=require(_0x8ff4('0x4'));var Mustache=require(_0x8ff4('0x5'));var util=require(_0x8ff4('0x6'));var path=require(_0x8ff4('0x7'));var sox=require('sox');var csv=require(_0x8ff4('0x8'));var ejs=require(_0x8ff4('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8ff4('0xa'));var crypto=require('crypto');var jsforce=require(_0x8ff4('0xb'));var deskjs=require(_0x8ff4('0xc'));var toCsv=require(_0x8ff4('0x8'));var querystring=require(_0x8ff4('0xd'));var Papa=require(_0x8ff4('0xe'));var Redis=require(_0x8ff4('0xf'));var authService=require(_0x8ff4('0x10'));var qs=require(_0x8ff4('0x11'));var as=require(_0x8ff4('0x12'));var hardwareService=require(_0x8ff4('0x13'));var logger=require(_0x8ff4('0x14'))('api');var utils=require(_0x8ff4('0x15'));var config=require(_0x8ff4('0x16'));var licenseUtil=require(_0x8ff4('0x17'));var db=require(_0x8ff4('0x18'))['db'];function respondWithStatusCode(_0x125812,_0x3e263e){_0x3e263e=_0x3e263e||0xcc;return function(_0x221b0d){if(_0x221b0d){return _0x125812[_0x8ff4('0x19')](_0x3e263e);}return _0x125812['status'](_0x3e263e)['end']();};}function respondWithResult(_0x20e41e,_0xb5ea14){_0xb5ea14=_0xb5ea14||0xc8;return function(_0x4f322d){if(_0x4f322d){return _0x20e41e['status'](_0xb5ea14)[_0x8ff4('0x1a')](_0x4f322d);}};}function respondWithFilteredResult(_0x2fe765,_0x53022e){return function(_0x1b4372){if(_0x1b4372){var _0x45d4e2=typeof _0x53022e[_0x8ff4('0x1b')]==='undefined'&&typeof _0x53022e[_0x8ff4('0x1c')]===_0x8ff4('0x1d');var _0x4754c2=_0x1b4372[_0x8ff4('0x1e')];var _0x2f5cf2=_0x45d4e2?0x0:_0x53022e['offset'];var _0x44cf7c=_0x45d4e2?_0x1b4372[_0x8ff4('0x1e')]:_0x53022e[_0x8ff4('0x1b')]+_0x53022e[_0x8ff4('0x1c')];var _0x1352bc;if(_0x44cf7c>=_0x4754c2){_0x44cf7c=_0x4754c2;_0x1352bc=0xc8;}else{_0x1352bc=0xce;}_0x2fe765[_0x8ff4('0x1f')](_0x1352bc);return _0x2fe765[_0x8ff4('0x20')]('Content-Range',_0x2f5cf2+'-'+_0x44cf7c+'/'+_0x4754c2)[_0x8ff4('0x1a')](_0x1b4372);}return null;};}function patchUpdates(_0x155e69){return function(_0x31c873){try{jsonpatch[_0x8ff4('0x21')](_0x31c873,_0x155e69,!![]);}catch(_0x2b2290){return BPromise[_0x8ff4('0x22')](_0x2b2290);}return _0x31c873[_0x8ff4('0x23')]();};}function saveUpdates(_0x4c8165,_0x51bcf2){return function(_0x395aca){if(_0x395aca){return _0x395aca[_0x8ff4('0x24')](_0x4c8165)[_0x8ff4('0x25')](function(_0x5e4aba){return _0x5e4aba;});}return null;};}function removeEntity(_0x1399ca,_0x1bad67){return function(_0x30ac7e){if(_0x30ac7e){return _0x30ac7e[_0x8ff4('0x26')]()[_0x8ff4('0x25')](function(){_0x1399ca['status'](0xcc)[_0x8ff4('0x27')]();});}};}function handleEntityNotFound(_0x444a5e,_0x58f5c9){return function(_0x20a19d){if(!_0x20a19d){_0x444a5e[_0x8ff4('0x19')](0x194);}return _0x20a19d;};}function handleError(_0x474281,_0x25c916){_0x25c916=_0x25c916||0x1f4;return function(_0x946fa4){logger[_0x8ff4('0x28')](_0x946fa4[_0x8ff4('0x29')]);if(_0x946fa4[_0x8ff4('0x2a')]){delete _0x946fa4[_0x8ff4('0x2a')];}_0x474281['status'](_0x25c916)[_0x8ff4('0x2b')](_0x946fa4);};}exports[_0x8ff4('0x2c')]=function(_0x7da77b,_0x203413){var _0x42d54b={},_0xeac49={},_0x335e2={'count':0x0,'rows':[]};var _0x1b9898=_['map'](db[_0x8ff4('0x2d')][_0x8ff4('0x2e')],function(_0x369f8c){return{'name':_0x369f8c[_0x8ff4('0x2f')],'type':_0x369f8c[_0x8ff4('0x30')][_0x8ff4('0x31')]};});_0xeac49[_0x8ff4('0x32')]=_[_0x8ff4('0x33')](_0x1b9898,_0x8ff4('0x2a'));_0xeac49[_0x8ff4('0x34')]=_[_0x8ff4('0x35')](_0x7da77b[_0x8ff4('0x34')]);_0xeac49[_0x8ff4('0x36')]=_[_0x8ff4('0x37')](_0xeac49[_0x8ff4('0x32')],_0xeac49['query']);_0x42d54b[_0x8ff4('0x38')]=_['intersection'](_0xeac49[_0x8ff4('0x32')],qs[_0x8ff4('0x39')](_0x7da77b[_0x8ff4('0x34')]['fields']));_0x42d54b[_0x8ff4('0x38')]=_0x42d54b[_0x8ff4('0x38')][_0x8ff4('0x3a')]?_0x42d54b[_0x8ff4('0x38')]:_0xeac49[_0x8ff4('0x32')];if(!_0x7da77b[_0x8ff4('0x34')]['hasOwnProperty'](_0x8ff4('0x3b'))){_0x42d54b['limit']=qs[_0x8ff4('0x1c')](_0x7da77b[_0x8ff4('0x34')]['limit']);_0x42d54b['offset']=qs[_0x8ff4('0x1b')](_0x7da77b[_0x8ff4('0x34')][_0x8ff4('0x1b')]);}_0x42d54b[_0x8ff4('0x3c')]=qs['sort'](_0x7da77b['query'][_0x8ff4('0x3d')]);_0x42d54b['where']=qs[_0x8ff4('0x36')](_[_0x8ff4('0x3e')](_0x7da77b[_0x8ff4('0x34')],_0xeac49[_0x8ff4('0x36')]),_0x1b9898);if(_0x7da77b['query'][_0x8ff4('0x3f')]){_0x42d54b[_0x8ff4('0x40')]=_['merge'](_0x42d54b[_0x8ff4('0x40')],{'$or':_[_0x8ff4('0x33')](_0x1b9898,function(_0x3213ab){if(_0x3213ab[_0x8ff4('0x30')]!=='VIRTUAL'){var _0x25cfed={};_0x25cfed[_0x3213ab[_0x8ff4('0x2a')]]={'$like':'%'+_0x7da77b[_0x8ff4('0x34')]['filter']+'%'};return _0x25cfed;}})});}_0x42d54b=_['merge']({},_0x42d54b,_0x7da77b[_0x8ff4('0x41')]);var _0x2f65ff={'where':_0x42d54b[_0x8ff4('0x40')]};return db[_0x8ff4('0x2d')]['count'](_0x2f65ff)[_0x8ff4('0x25')](function(_0x2efe04){_0x335e2[_0x8ff4('0x1e')]=_0x2efe04;if(_0x7da77b[_0x8ff4('0x34')]['includeAll']){_0x42d54b['include']=[{'all':!![]}];}return db['CmHopperBlack'][_0x8ff4('0x42')](_0x42d54b);})[_0x8ff4('0x25')](function(_0x22b454){_0x335e2[_0x8ff4('0x43')]=_0x22b454;return _0x335e2;})[_0x8ff4('0x25')](respondWithFilteredResult(_0x203413,_0x42d54b))['catch'](handleError(_0x203413,null));};exports[_0x8ff4('0x44')]=function(_0x4bc252,_0x34d120){var _0x3bcbb1={'raw':!![],'where':{'id':_0x4bc252[_0x8ff4('0x45')]['id']}},_0xaa1512={};_0xaa1512[_0x8ff4('0x32')]=_['keys'](db[_0x8ff4('0x2d')]['rawAttributes']);_0xaa1512[_0x8ff4('0x34')]=_['keys'](_0x4bc252[_0x8ff4('0x34')]);_0xaa1512[_0x8ff4('0x36')]=_['intersection'](_0xaa1512[_0x8ff4('0x32')],_0xaa1512['query']);_0x3bcbb1['attributes']=_[_0x8ff4('0x37')](_0xaa1512[_0x8ff4('0x32')],qs[_0x8ff4('0x39')](_0x4bc252[_0x8ff4('0x34')][_0x8ff4('0x39')]));_0x3bcbb1[_0x8ff4('0x38')]=_0x3bcbb1['attributes']['length']?_0x3bcbb1[_0x8ff4('0x38')]:_0xaa1512[_0x8ff4('0x32')];if(_0x4bc252[_0x8ff4('0x34')][_0x8ff4('0x46')]){_0x3bcbb1[_0x8ff4('0x47')]=[{'all':!![]}];}_0x3bcbb1=_[_0x8ff4('0x48')]({},_0x3bcbb1,_0x4bc252[_0x8ff4('0x41')]);return db[_0x8ff4('0x2d')][_0x8ff4('0x49')](_0x3bcbb1)[_0x8ff4('0x25')](handleEntityNotFound(_0x34d120,null))[_0x8ff4('0x25')](respondWithResult(_0x34d120,null))[_0x8ff4('0x4a')](handleError(_0x34d120,null));};exports[_0x8ff4('0x24')]=function(_0x3dc45c,_0x26c95b){if(_0x3dc45c[_0x8ff4('0x4b')]['id']){delete _0x3dc45c[_0x8ff4('0x4b')]['id'];}return db[_0x8ff4('0x2d')][_0x8ff4('0x49')]({'where':{'id':_0x3dc45c[_0x8ff4('0x45')]['id']}})['then'](handleEntityNotFound(_0x26c95b,null))['then'](saveUpdates(_0x3dc45c['body'],null))['then'](respondWithResult(_0x26c95b,null))['catch'](handleError(_0x26c95b,null));};exports[_0x8ff4('0x26')]=function(_0x123219,_0x230bba){return db[_0x8ff4('0x2d')][_0x8ff4('0x49')]({'where':{'id':_0x123219[_0x8ff4('0x45')]['id']}})[_0x8ff4('0x25')](handleEntityNotFound(_0x230bba,null))[_0x8ff4('0x25')](removeEntity(_0x230bba,null))[_0x8ff4('0x4a')](handleError(_0x230bba,null));};exports['describe']=function(_0x39458b,_0x4789b3){return db[_0x8ff4('0x2d')][_0x8ff4('0x4c')]()[_0x8ff4('0x25')](respondWithResult(_0x4789b3,null))['catch'](handleError(_0x4789b3,null));};
\ No newline at end of file
+var _0x3116=['path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','sendStatus','error','stack','name','send','index','CmHopperBlack','rawAttributes','fieldName','type','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','includeAll','include','show','params','catch','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util'];(function(_0x6277,_0x4f7d06){var _0x37f933=function(_0x30d4e5){while(--_0x30d4e5){_0x6277['push'](_0x6277['shift']());}};_0x37f933(++_0x4f7d06);}(_0x3116,0x17e));var _0x6311=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0x3116[_0xae7c2f];return _0x5d7001;};'use strict';var emlformat=require(_0x6311('0x0'));var rimraf=require(_0x6311('0x1'));var zipdir=require(_0x6311('0x2'));var jsonpatch=require(_0x6311('0x3'));var rp=require(_0x6311('0x4'));var moment=require(_0x6311('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x6311('0x6'));var util=require(_0x6311('0x7'));var path=require(_0x6311('0x8'));var sox=require(_0x6311('0x9'));var csv=require('to-csv');var ejs=require(_0x6311('0xa'));var fs=require('fs');var fs_extra=require(_0x6311('0xb'));var _=require(_0x6311('0xc'));var squel=require(_0x6311('0xd'));var crypto=require(_0x6311('0xe'));var jsforce=require(_0x6311('0xf'));var deskjs=require(_0x6311('0x10'));var toCsv=require(_0x6311('0x11'));var querystring=require(_0x6311('0x12'));var Papa=require(_0x6311('0x13'));var Redis=require('ioredis');var authService=require(_0x6311('0x14'));var qs=require(_0x6311('0x15'));var as=require(_0x6311('0x16'));var hardwareService=require(_0x6311('0x17'));var logger=require('../../config/logger')('api');var utils=require(_0x6311('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x6311('0x19'));var db=require(_0x6311('0x1a'))['db'];function respondWithStatusCode(_0x17da35,_0x1c2823){_0x1c2823=_0x1c2823||0xcc;return function(_0xa07ef1){if(_0xa07ef1){return _0x17da35['sendStatus'](_0x1c2823);}return _0x17da35[_0x6311('0x1b')](_0x1c2823)[_0x6311('0x1c')]();};}function respondWithResult(_0x4cfbbc,_0x1e73fe){_0x1e73fe=_0x1e73fe||0xc8;return function(_0x5890cb){if(_0x5890cb){return _0x4cfbbc[_0x6311('0x1b')](_0x1e73fe)[_0x6311('0x1d')](_0x5890cb);}};}function respondWithFilteredResult(_0xadfb75,_0x59f929){return function(_0x3fefbe){if(_0x3fefbe){var _0x188d68=typeof _0x59f929[_0x6311('0x1e')]===_0x6311('0x1f')&&typeof _0x59f929[_0x6311('0x20')]==='undefined';var _0x41c7e6=_0x3fefbe[_0x6311('0x21')];var _0x195800=_0x188d68?0x0:_0x59f929['offset'];var _0x3a4931=_0x188d68?_0x3fefbe['count']:_0x59f929['offset']+_0x59f929[_0x6311('0x20')];var _0x39b9c3;if(_0x3a4931>=_0x41c7e6){_0x3a4931=_0x41c7e6;_0x39b9c3=0xc8;}else{_0x39b9c3=0xce;}_0xadfb75[_0x6311('0x1b')](_0x39b9c3);return _0xadfb75[_0x6311('0x22')](_0x6311('0x23'),_0x195800+'-'+_0x3a4931+'/'+_0x41c7e6)[_0x6311('0x1d')](_0x3fefbe);}return null;};}function patchUpdates(_0x40b582){return function(_0xd32155){try{jsonpatch[_0x6311('0x24')](_0xd32155,_0x40b582,!![]);}catch(_0x4e085a){return BPromise[_0x6311('0x25')](_0x4e085a);}return _0xd32155[_0x6311('0x26')]();};}function saveUpdates(_0x11519c,_0x754561){return function(_0x3ea7ef){if(_0x3ea7ef){return _0x3ea7ef[_0x6311('0x27')](_0x11519c)[_0x6311('0x28')](function(_0x494141){return _0x494141;});}return null;};}function removeEntity(_0x3a667b,_0x1f80f7){return function(_0x402be5){if(_0x402be5){return _0x402be5['destroy']()[_0x6311('0x28')](function(){_0x3a667b[_0x6311('0x1b')](0xcc)[_0x6311('0x1c')]();});}};}function handleEntityNotFound(_0x4c0a5d,_0x2015ee){return function(_0x371565){if(!_0x371565){_0x4c0a5d[_0x6311('0x29')](0x194);}return _0x371565;};}function handleError(_0x53df5d,_0x25a9a8){_0x25a9a8=_0x25a9a8||0x1f4;return function(_0x20ed99){logger[_0x6311('0x2a')](_0x20ed99[_0x6311('0x2b')]);if(_0x20ed99[_0x6311('0x2c')]){delete _0x20ed99[_0x6311('0x2c')];}_0x53df5d['status'](_0x25a9a8)[_0x6311('0x2d')](_0x20ed99);};}exports[_0x6311('0x2e')]=function(_0x5da083,_0x1fdf0a){var _0x5b0dbe={},_0x15f26d={},_0x1fe933={'count':0x0,'rows':[]};var _0x7edfed=_['map'](db[_0x6311('0x2f')][_0x6311('0x30')],function(_0x10b321){return{'name':_0x10b321[_0x6311('0x31')],'type':_0x10b321[_0x6311('0x32')]['key']};});_0x15f26d[_0x6311('0x33')]=_[_0x6311('0x34')](_0x7edfed,_0x6311('0x2c'));_0x15f26d[_0x6311('0x35')]=_[_0x6311('0x36')](_0x5da083['query']);_0x15f26d['filters']=_[_0x6311('0x37')](_0x15f26d['model'],_0x15f26d['query']);_0x5b0dbe[_0x6311('0x38')]=_['intersection'](_0x15f26d[_0x6311('0x33')],qs['fields'](_0x5da083[_0x6311('0x35')][_0x6311('0x39')]));_0x5b0dbe[_0x6311('0x38')]=_0x5b0dbe['attributes'][_0x6311('0x3a')]?_0x5b0dbe[_0x6311('0x38')]:_0x15f26d[_0x6311('0x33')];if(!_0x5da083[_0x6311('0x35')][_0x6311('0x3b')](_0x6311('0x3c'))){_0x5b0dbe['limit']=qs[_0x6311('0x20')](_0x5da083[_0x6311('0x35')][_0x6311('0x20')]);_0x5b0dbe[_0x6311('0x1e')]=qs['offset'](_0x5da083[_0x6311('0x35')][_0x6311('0x1e')]);}_0x5b0dbe[_0x6311('0x3d')]=qs[_0x6311('0x3e')](_0x5da083[_0x6311('0x35')]['sort']);_0x5b0dbe[_0x6311('0x3f')]=qs[_0x6311('0x40')](_[_0x6311('0x41')](_0x5da083[_0x6311('0x35')],_0x15f26d[_0x6311('0x40')]),_0x7edfed);if(_0x5da083[_0x6311('0x35')]['filter']){_0x5b0dbe[_0x6311('0x3f')]=_[_0x6311('0x42')](_0x5b0dbe[_0x6311('0x3f')],{'$or':_['map'](_0x7edfed,function(_0xc29758){if(_0xc29758[_0x6311('0x32')]!==_0x6311('0x43')){var _0x3b2f53={};_0x3b2f53[_0xc29758[_0x6311('0x2c')]]={'$like':'%'+_0x5da083[_0x6311('0x35')][_0x6311('0x44')]+'%'};return _0x3b2f53;}})});}_0x5b0dbe=_[_0x6311('0x42')]({},_0x5b0dbe,_0x5da083[_0x6311('0x45')]);var _0x35090f={'where':_0x5b0dbe['where']};return db[_0x6311('0x2f')][_0x6311('0x21')](_0x35090f)['then'](function(_0x2934b8){_0x1fe933['count']=_0x2934b8;if(_0x5da083[_0x6311('0x35')][_0x6311('0x46')]){_0x5b0dbe[_0x6311('0x47')]=[{'all':!![]}];}return db[_0x6311('0x2f')]['findAll'](_0x5b0dbe);})['then'](function(_0x7b0713){_0x1fe933['rows']=_0x7b0713;return _0x1fe933;})['then'](respondWithFilteredResult(_0x1fdf0a,_0x5b0dbe))['catch'](handleError(_0x1fdf0a,null));};exports[_0x6311('0x48')]=function(_0x426f7b,_0x17080d){var _0x10d2b5={'raw':!![],'where':{'id':_0x426f7b[_0x6311('0x49')]['id']}},_0x3112d8={};_0x3112d8[_0x6311('0x33')]=_['keys'](db[_0x6311('0x2f')][_0x6311('0x30')]);_0x3112d8[_0x6311('0x35')]=_[_0x6311('0x36')](_0x426f7b[_0x6311('0x35')]);_0x3112d8[_0x6311('0x40')]=_['intersection'](_0x3112d8['model'],_0x3112d8[_0x6311('0x35')]);_0x10d2b5['attributes']=_['intersection'](_0x3112d8[_0x6311('0x33')],qs['fields'](_0x426f7b[_0x6311('0x35')][_0x6311('0x39')]));_0x10d2b5[_0x6311('0x38')]=_0x10d2b5[_0x6311('0x38')][_0x6311('0x3a')]?_0x10d2b5[_0x6311('0x38')]:_0x3112d8[_0x6311('0x33')];if(_0x426f7b[_0x6311('0x35')]['includeAll']){_0x10d2b5[_0x6311('0x47')]=[{'all':!![]}];}_0x10d2b5=_[_0x6311('0x42')]({},_0x10d2b5,_0x426f7b[_0x6311('0x45')]);return db[_0x6311('0x2f')]['find'](_0x10d2b5)['then'](handleEntityNotFound(_0x17080d,null))['then'](respondWithResult(_0x17080d,null))[_0x6311('0x4a')](handleError(_0x17080d,null));};exports[_0x6311('0x27')]=function(_0x1b7bc3,_0x27f6cc){if(_0x1b7bc3[_0x6311('0x4b')]['id']){delete _0x1b7bc3['body']['id'];}return db['CmHopperBlack'][_0x6311('0x4c')]({'where':{'id':_0x1b7bc3[_0x6311('0x49')]['id']}})[_0x6311('0x28')](handleEntityNotFound(_0x27f6cc,null))[_0x6311('0x28')](saveUpdates(_0x1b7bc3[_0x6311('0x4b')],null))[_0x6311('0x28')](respondWithResult(_0x27f6cc,null))['catch'](handleError(_0x27f6cc,null));};exports['destroy']=function(_0xd96d7b,_0x187127){return db[_0x6311('0x2f')][_0x6311('0x4c')]({'where':{'id':_0xd96d7b[_0x6311('0x49')]['id']}})[_0x6311('0x28')](handleEntityNotFound(_0x187127,null))[_0x6311('0x28')](removeEntity(_0x187127,null))[_0x6311('0x4a')](handleError(_0x187127,null));};exports[_0x6311('0x4d')]=function(_0x5a6faf,_0x4ba102){return db[_0x6311('0x2f')][_0x6311('0x4d')]()[_0x6311('0x28')](respondWithResult(_0x4ba102,null))['catch'](handleError(_0x4ba102,null));};
\ No newline at end of file
index 100061a..baf7838 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd701=['CmHopperBlack','cm_hopper_black','lodash','util','api','moment','bluebird','path','rimraf','../../config/environment','./cmHopperBlack.attributes','exports','define'];(function(_0x1182d9,_0x1e175e){var _0x59d642=function(_0x5af301){while(--_0x5af301){_0x1182d9['push'](_0x1182d9['shift']());}};_0x59d642(++_0x1e175e);}(_0xd701,0xc5));var _0x1d70=function(_0x6d0a22,_0x55d6c4){_0x6d0a22=_0x6d0a22-0x0;var _0x4c1e70=_0xd701[_0x6d0a22];return _0x4c1e70;};'use strict';var _=require(_0x1d70('0x0'));var util=require(_0x1d70('0x1'));var logger=require('../../config/logger')(_0x1d70('0x2'));var moment=require(_0x1d70('0x3'));var BPromise=require(_0x1d70('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1d70('0x5'));var rimraf=require(_0x1d70('0x6'));var config=require(_0x1d70('0x7'));var attributes=require(_0x1d70('0x8'));module[_0x1d70('0x9')]=function(_0x4ab0a3,_0x523318){return _0x4ab0a3[_0x1d70('0xa')](_0x1d70('0xb'),attributes,{'tableName':_0x1d70('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2d2a=['cm_hopper_black','lodash','api','bluebird','path','rimraf','../../config/environment','exports','define'];(function(_0x27e1e8,_0x2464a5){var _0x222e19=function(_0x506bbb){while(--_0x506bbb){_0x27e1e8['push'](_0x27e1e8['shift']());}};_0x222e19(++_0x2464a5);}(_0x2d2a,0x1ba));var _0xa2d2=function(_0x91347f,_0x5998a5){_0x91347f=_0x91347f-0x0;var _0x5db4e1=_0x2d2a[_0x91347f];return _0x5db4e1;};'use strict';var _=require(_0xa2d2('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xa2d2('0x1'));var moment=require('moment');var BPromise=require(_0xa2d2('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa2d2('0x3'));var rimraf=require(_0xa2d2('0x4'));var config=require(_0xa2d2('0x5'));var attributes=require('./cmHopperBlack.attributes');module[_0xa2d2('0x6')]=function(_0x1dfb58,_0x3c3df7){return _0x1dfb58[_0xa2d2('0x7')]('CmHopperBlack',attributes,{'tableName':_0xa2d2('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 6f6600c..c73f707 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1068=['raw','where','limit','include','map','model','attributes','stringify','catch','UpdateCmHopperBlack','update','body','DestroyCmHopperBlack','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','then','info','CmHopperBlack,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','GetCmHopperBlack','CmHopperBlack','findAll','options'];(function(_0x307427,_0x39e703){var _0x42ba72=function(_0x1db84f){while(--_0x1db84f){_0x307427['push'](_0x307427['shift']());}};_0x42ba72(++_0x39e703);}(_0x1068,0xa1));var _0x8106=function(_0x5b5041,_0x407d96){_0x5b5041=_0x5b5041-0x0;var _0x4cb53e=_0x1068[_0x5b5041];return _0x4cb53e;};'use strict';var _=require(_0x8106('0x0'));var util=require(_0x8106('0x1'));var moment=require(_0x8106('0x2'));var BPromise=require(_0x8106('0x3'));var rs=require(_0x8106('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8106('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x8106('0x6'))(_0x8106('0x7'));var config=require('../../config/environment');var jayson=require(_0x8106('0x8'));var client=jayson[_0x8106('0x9')][_0x8106('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x55a842,_0x3da54c,_0x16656a){return new BPromise(function(_0x24ac8b,_0x18e89f){return client['request'](_0x55a842,_0x16656a)[_0x8106('0xb')](function(_0x1ea328){logger[_0x8106('0xc')](_0x8106('0xd'),_0x3da54c,'request\x20sent');logger[_0x8106('0xe')]('CmHopperBlack,\x20%s,\x20%s,\x20%s',_0x3da54c,_0x8106('0xf'),JSON['stringify'](_0x1ea328));if(_0x1ea328[_0x8106('0x10')]){if(_0x1ea328[_0x8106('0x10')][_0x8106('0x11')]===0x1f4){logger[_0x8106('0x10')](_0x8106('0xd'),_0x3da54c,_0x1ea328[_0x8106('0x10')][_0x8106('0x12')]);return _0x18e89f(_0x1ea328[_0x8106('0x10')][_0x8106('0x12')]);}logger[_0x8106('0x10')](_0x8106('0xd'),_0x3da54c,_0x1ea328[_0x8106('0x10')]['message']);return _0x24ac8b(_0x1ea328[_0x8106('0x10')]['message']);}else{logger[_0x8106('0xc')](_0x8106('0xd'),_0x3da54c,'request\x20sent');_0x24ac8b(_0x1ea328[_0x8106('0x13')][_0x8106('0x12')]);}})['catch'](function(_0x6875cb){logger['error'](_0x8106('0xd'),_0x3da54c,_0x6875cb);_0x18e89f(_0x6875cb);});});}exports[_0x8106('0x14')]=function(_0x4ef7b4){var _0x512ec7=this;return new Promise(function(_0xd23af8,_0x2193f0){return db[_0x8106('0x15')][_0x8106('0x16')]({'raw':_0x4ef7b4['options']?_0x4ef7b4[_0x8106('0x17')][_0x8106('0x18')]===undefined?!![]:![]:!![],'where':_0x4ef7b4[_0x8106('0x17')]?_0x4ef7b4[_0x8106('0x17')][_0x8106('0x19')]||null:null,'attributes':_0x4ef7b4[_0x8106('0x17')]?_0x4ef7b4['options']['attributes']||null:null,'limit':_0x4ef7b4[_0x8106('0x17')]?_0x4ef7b4['options'][_0x8106('0x1a')]||null:null,'include':_0x4ef7b4[_0x8106('0x17')]?_0x4ef7b4['options'][_0x8106('0x1b')]?_[_0x8106('0x1c')](_0x4ef7b4['options']['include'],function(_0x2d2f58){return{'model':db[_0x2d2f58[_0x8106('0x1d')]],'as':_0x2d2f58['as'],'attributes':_0x2d2f58[_0x8106('0x1e')],'include':_0x2d2f58[_0x8106('0x1b')]?_[_0x8106('0x1c')](_0x2d2f58[_0x8106('0x1b')],function(_0x4f6464){return{'model':db[_0x4f6464[_0x8106('0x1d')]],'as':_0x4f6464['as'],'attributes':_0x4f6464[_0x8106('0x1e')],'include':_0x4f6464['include']?_[_0x8106('0x1c')](_0x4f6464[_0x8106('0x1b')],function(_0x1cf0e3){return{'model':db[_0x1cf0e3[_0x8106('0x1d')]],'as':_0x1cf0e3['as'],'attributes':_0x1cf0e3[_0x8106('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x33ccba){logger[_0x8106('0xc')]('GetCmHopperBlack',_0x4ef7b4);logger[_0x8106('0xe')](_0x8106('0x14'),_0x4ef7b4,JSON[_0x8106('0x1f')](_0x33ccba));_0xd23af8(_0x33ccba);})[_0x8106('0x20')](function(_0x219c20){logger[_0x8106('0x10')](_0x8106('0x14'),_0x219c20[_0x8106('0x12')],_0x4ef7b4);_0x2193f0(_0x512ec7[_0x8106('0x10')](0x1f4,_0x219c20[_0x8106('0x12')]));});});};exports[_0x8106('0x21')]=function(_0x34677d){var _0x1d1506=this;return new Promise(function(_0x346481,_0x4de55d){return db[_0x8106('0x15')][_0x8106('0x22')](_0x34677d[_0x8106('0x23')],{'raw':_0x34677d[_0x8106('0x17')]?_0x34677d['options'][_0x8106('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x34677d[_0x8106('0x17')]?_0x34677d[_0x8106('0x17')][_0x8106('0x19')]||null:null,'attributes':_0x34677d[_0x8106('0x17')]?_0x34677d[_0x8106('0x17')][_0x8106('0x1e')]||null:null,'limit':_0x34677d['options']?_0x34677d[_0x8106('0x17')]['limit']||null:null})[_0x8106('0xb')](function(_0x176032){logger[_0x8106('0xc')](_0x8106('0x21'),_0x34677d);logger[_0x8106('0xe')](_0x8106('0x21'),_0x34677d,JSON[_0x8106('0x1f')](_0x176032));_0x346481(_0x176032);})[_0x8106('0x20')](function(_0x51c826){logger[_0x8106('0x10')](_0x8106('0x21'),_0x51c826[_0x8106('0x12')],_0x34677d);_0x4de55d(_0x1d1506[_0x8106('0x10')](0x1f4,_0x51c826['message']));});});};exports['DestroyCmHopperBlack']=function(_0x527987){var _0xb113ff=this;return new Promise(function(_0x5549c6,_0x4bf135){return db[_0x8106('0x15')]['destroy']({'where':_0x527987[_0x8106('0x17')]?_0x527987[_0x8106('0x17')][_0x8106('0x19')]||null:null})[_0x8106('0xb')](function(_0x2fb890){logger[_0x8106('0xc')](_0x8106('0x24'),_0x527987);logger[_0x8106('0xe')]('DestroyCmHopperBlack',_0x527987,JSON['stringify'](_0x2fb890));_0x5549c6(_0x2fb890);})[_0x8106('0x20')](function(_0x418df7){logger[_0x8106('0x10')](_0x8106('0x24'),_0x418df7[_0x8106('0x12')],_0x527987);_0x4bf135(_0xb113ff['error'](0x1f4,_0x418df7[_0x8106('0x12')]));});});};
\ No newline at end of file
+var _0x1482=['limit','catch','DestroyCmHopperBlack','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','CmHopperBlack','findAll','options','raw','where','attributes','map','model','include','then','debug','GetCmHopperBlack','UpdateCmHopperBlack','body'];(function(_0x511bd1,_0x223e5b){var _0x4c48ec=function(_0x31814e){while(--_0x31814e){_0x511bd1['push'](_0x511bd1['shift']());}};_0x4c48ec(++_0x223e5b);}(_0x1482,0x1bf));var _0x2148=function(_0x167a41,_0x177dbe){_0x167a41=_0x167a41-0x0;var _0x2b7158=_0x1482[_0x167a41];return _0x2b7158;};'use strict';var _=require(_0x2148('0x0'));var util=require(_0x2148('0x1'));var moment=require(_0x2148('0x2'));var BPromise=require(_0x2148('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2148('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2148('0x5'));var logger=require(_0x2148('0x6'))(_0x2148('0x7'));var config=require(_0x2148('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x2148('0x9')][_0x2148('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4aaab3,_0x5b2f9b,_0x53d158){return new BPromise(function(_0x58504a,_0x11549e){return client[_0x2148('0xb')](_0x4aaab3,_0x53d158)['then'](function(_0x1edc50){logger[_0x2148('0xc')](_0x2148('0xd'),_0x5b2f9b,_0x2148('0xe'));logger['debug']('CmHopperBlack,\x20%s,\x20%s,\x20%s',_0x5b2f9b,_0x2148('0xe'),JSON[_0x2148('0xf')](_0x1edc50));if(_0x1edc50[_0x2148('0x10')]){if(_0x1edc50['error'][_0x2148('0x11')]===0x1f4){logger['error'](_0x2148('0xd'),_0x5b2f9b,_0x1edc50[_0x2148('0x10')]['message']);return _0x11549e(_0x1edc50[_0x2148('0x10')][_0x2148('0x12')]);}logger['error'](_0x2148('0xd'),_0x5b2f9b,_0x1edc50['error'][_0x2148('0x12')]);return _0x58504a(_0x1edc50[_0x2148('0x10')][_0x2148('0x12')]);}else{logger[_0x2148('0xc')](_0x2148('0xd'),_0x5b2f9b,_0x2148('0xe'));_0x58504a(_0x1edc50[_0x2148('0x13')][_0x2148('0x12')]);}})['catch'](function(_0x43f9af){logger[_0x2148('0x10')](_0x2148('0xd'),_0x5b2f9b,_0x43f9af);_0x11549e(_0x43f9af);});});}exports['GetCmHopperBlack']=function(_0x5d570b){var _0x3637c0=this;return new Promise(function(_0x2c1fe1,_0x34fd6b){return db[_0x2148('0x14')][_0x2148('0x15')]({'raw':_0x5d570b[_0x2148('0x16')]?_0x5d570b['options'][_0x2148('0x17')]===undefined?!![]:![]:!![],'where':_0x5d570b['options']?_0x5d570b[_0x2148('0x16')][_0x2148('0x18')]||null:null,'attributes':_0x5d570b[_0x2148('0x16')]?_0x5d570b[_0x2148('0x16')][_0x2148('0x19')]||null:null,'limit':_0x5d570b[_0x2148('0x16')]?_0x5d570b[_0x2148('0x16')]['limit']||null:null,'include':_0x5d570b['options']?_0x5d570b['options']['include']?_[_0x2148('0x1a')](_0x5d570b[_0x2148('0x16')]['include'],function(_0x358492){return{'model':db[_0x358492[_0x2148('0x1b')]],'as':_0x358492['as'],'attributes':_0x358492[_0x2148('0x19')],'include':_0x358492[_0x2148('0x1c')]?_['map'](_0x358492['include'],function(_0x1fcc38){return{'model':db[_0x1fcc38[_0x2148('0x1b')]],'as':_0x1fcc38['as'],'attributes':_0x1fcc38['attributes'],'include':_0x1fcc38[_0x2148('0x1c')]?_['map'](_0x1fcc38[_0x2148('0x1c')],function(_0x4cb94d){return{'model':db[_0x4cb94d[_0x2148('0x1b')]],'as':_0x4cb94d['as'],'attributes':_0x4cb94d[_0x2148('0x19')]};}):[]};}):[]};}):[]:[]})[_0x2148('0x1d')](function(_0x516b09){logger[_0x2148('0xc')]('GetCmHopperBlack',_0x5d570b);logger[_0x2148('0x1e')](_0x2148('0x1f'),_0x5d570b,JSON[_0x2148('0xf')](_0x516b09));_0x2c1fe1(_0x516b09);})['catch'](function(_0x54b0c9){logger[_0x2148('0x10')](_0x2148('0x1f'),_0x54b0c9[_0x2148('0x12')],_0x5d570b);_0x34fd6b(_0x3637c0[_0x2148('0x10')](0x1f4,_0x54b0c9[_0x2148('0x12')]));});});};exports[_0x2148('0x20')]=function(_0x7ca0a7){var _0x1a731e=this;return new Promise(function(_0x3dcd1a,_0x54f8f0){return db['CmHopperBlack']['update'](_0x7ca0a7[_0x2148('0x21')],{'raw':_0x7ca0a7[_0x2148('0x16')]?_0x7ca0a7[_0x2148('0x16')][_0x2148('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x7ca0a7[_0x2148('0x16')]?_0x7ca0a7[_0x2148('0x16')][_0x2148('0x18')]||null:null,'attributes':_0x7ca0a7[_0x2148('0x16')]?_0x7ca0a7[_0x2148('0x16')][_0x2148('0x19')]||null:null,'limit':_0x7ca0a7[_0x2148('0x16')]?_0x7ca0a7['options'][_0x2148('0x22')]||null:null})[_0x2148('0x1d')](function(_0x407261){logger[_0x2148('0xc')](_0x2148('0x20'),_0x7ca0a7);logger[_0x2148('0x1e')](_0x2148('0x20'),_0x7ca0a7,JSON[_0x2148('0xf')](_0x407261));_0x3dcd1a(_0x407261);})[_0x2148('0x23')](function(_0x22eddf){logger[_0x2148('0x10')]('UpdateCmHopperBlack',_0x22eddf['message'],_0x7ca0a7);_0x54f8f0(_0x1a731e[_0x2148('0x10')](0x1f4,_0x22eddf[_0x2148('0x12')]));});});};exports[_0x2148('0x24')]=function(_0x3b7066){var _0x13cef1=this;return new Promise(function(_0x793f3b,_0x34f23f){return db[_0x2148('0x14')]['destroy']({'where':_0x3b7066[_0x2148('0x16')]?_0x3b7066[_0x2148('0x16')][_0x2148('0x18')]||null:null})['then'](function(_0x44d9a2){logger[_0x2148('0xc')]('DestroyCmHopperBlack',_0x3b7066);logger['debug'](_0x2148('0x24'),_0x3b7066,JSON[_0x2148('0xf')](_0x44d9a2));_0x793f3b(_0x44d9a2);})[_0x2148('0x23')](function(_0x28bc1b){logger[_0x2148('0x10')](_0x2148('0x24'),_0x28bc1b['message'],_0x3b7066);_0x34f23f(_0x13cef1[_0x2148('0x10')](0x1f4,_0x28bc1b[_0x2148('0x12')]));});});};
\ No newline at end of file
index e76998c..5264a6c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa46e=['connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','index','isAuthenticated','describe','/:id','update','destroy','multer','util'];(function(_0x391230,_0xcf7312){var _0x33cca3=function(_0x1df625){while(--_0x1df625){_0x391230['push'](_0x391230['shift']());}};_0x33cca3(++_0xcf7312);}(_0xa46e,0x8a));var _0xea46=function(_0x5e709a,_0x1d7975){_0x5e709a=_0x5e709a-0x0;var _0x57401a=_0xa46e[_0x5e709a];return _0x57401a;};'use strict';var multer=require(_0xea46('0x0'));var util=require(_0xea46('0x1'));var path=require('path');var timeout=require(_0xea46('0x2'));var express=require(_0xea46('0x3'));var router=express[_0xea46('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xea46('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xea46('0x6'));var controller=require('./cmHopperBlack.controller');router[_0xea46('0x7')]('/',auth['isAuthenticated'](),controller[_0xea46('0x8')]);router[_0xea46('0x7')]('/describe',auth[_0xea46('0x9')](),controller[_0xea46('0xa')]);router[_0xea46('0x7')](_0xea46('0xb'),auth[_0xea46('0x9')](),controller['show']);router['put']('/:id',auth[_0xea46('0x9')](),controller[_0xea46('0xc')]);router['delete'](_0xea46('0xb'),auth[_0xea46('0x9')](),controller[_0xea46('0xd')]);module['exports']=router;
\ No newline at end of file
+var _0xbff5=['delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x4ef991,_0x3273d8){var _0x1ff040=function(_0x582253){while(--_0x582253){_0x4ef991['push'](_0x4ef991['shift']());}};_0x1ff040(++_0x3273d8);}(_0xbff5,0x1bc));var _0x5bff=function(_0xa67db1,_0x1078d1){_0xa67db1=_0xa67db1-0x0;var _0x5f3a34=_0xbff5[_0xa67db1];return _0x5f3a34;};'use strict';var multer=require(_0x5bff('0x0'));var util=require(_0x5bff('0x1'));var path=require(_0x5bff('0x2'));var timeout=require(_0x5bff('0x3'));var express=require(_0x5bff('0x4'));var router=express[_0x5bff('0x5')]();var fs_extra=require(_0x5bff('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x5bff('0x7'));var config=require('../../config/environment');var controller=require('./cmHopperBlack.controller');router[_0x5bff('0x8')]('/',auth[_0x5bff('0x9')](),controller[_0x5bff('0xa')]);router[_0x5bff('0x8')](_0x5bff('0xb'),auth[_0x5bff('0x9')](),controller[_0x5bff('0xc')]);router[_0x5bff('0x8')](_0x5bff('0xd'),auth['isAuthenticated'](),controller[_0x5bff('0xe')]);router['put'](_0x5bff('0xd'),auth[_0x5bff('0x9')](),controller['update']);router[_0x5bff('0xf')]('/:id',auth[_0x5bff('0x9')](),controller['destroy']);module[_0x5bff('0x10')]=router;
\ No newline at end of file
index beaf319..48828a7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2fd8=['diff','BOOLEAN','sequelize','moment','exports','INTEGER','STRING','DATE','getDataValue','endtime','setDataValue','followuptime'];(function(_0x1c9bac,_0x1b9870){var _0x1ab5e3=function(_0x44cf1d){while(--_0x44cf1d){_0x1c9bac['push'](_0x1c9bac['shift']());}};_0x1ab5e3(++_0x1b9870);}(_0x2fd8,0x12e));var _0x82fd=function(_0xda13e,_0x25436a){_0xda13e=_0xda13e-0x0;var _0x4a721d=_0x2fd8[_0xda13e];return _0x4a721d;};'use strict';var Sequelize=require(_0x82fd('0x0'));var moment=require(_0x82fd('0x1'));module[_0x82fd('0x2')]={'state':{'type':Sequelize[_0x82fd('0x3')](0x2)},'statedesc':{'type':Sequelize[_0x82fd('0x4')]},'scheduledat':{'type':Sequelize[_0x82fd('0x5')]},'countbusyretry':{'type':Sequelize[_0x82fd('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x82fd('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x82fd('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0x82fd('0x4')]},'originatecalleridname':{'type':Sequelize[_0x82fd('0x4')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x82fd('0x4')]},'starttime':{'type':Sequelize[_0x82fd('0x5')]},'responsetime':{'type':Sequelize[_0x82fd('0x5')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0x82fd('0x5')]},'endtime':{'type':Sequelize[_0x82fd('0x5')]},'ringtime':{'type':Sequelize[_0x82fd('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x82fd('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x82fd('0x4')]},'campaign':{'type':Sequelize[_0x82fd('0x4')]},'campaigntype':{'type':Sequelize[_0x82fd('0x4')]},'membername':{'type':Sequelize[_0x82fd('0x4')]},'reason':{'type':Sequelize[_0x82fd('0x4')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x82fd('0x4')]},'thirdDisposition':{'type':Sequelize[_0x82fd('0x4')]},'dispositionat':{'type':Sequelize[_0x82fd('0x5')],'set':function(_0x18e9f7){var _0x1062f2=this[_0x82fd('0x6')](_0x82fd('0x7'));if(_0x1062f2&&_0x18e9f7){this[_0x82fd('0x8')](_0x82fd('0x9'),moment(_0x18e9f7)[_0x82fd('0xa')](moment(_0x1062f2),'seconds'));}}},'amd':{'type':Sequelize[_0x82fd('0xb')],'defaultValue':![]},'fax':{'type':Sequelize[_0x82fd('0xb')],'defaultValue':![]},'blacklist':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x82fd('0x5')]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x82fd('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x82fd('0x5')]},'deleted':{'type':Sequelize['STRING'],'defaultValue':null},'deletedat':{'type':Sequelize[_0x82fd('0x5')]},'recallme':{'type':Sequelize[_0x82fd('0xb')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x82fd('0x5')]},'countnosuchnumberretry':{'type':Sequelize[_0x82fd('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x82fd('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x82fd('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x82fd('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x82fd('0x3')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x2b75=['BOOLEAN','moment','exports','INTEGER','STRING','DATE','endtime','setDataValue','diff','seconds'];(function(_0x38b777,_0x58b31e){var _0x41da2c=function(_0x1e929a){while(--_0x1e929a){_0x38b777['push'](_0x38b777['shift']());}};_0x41da2c(++_0x58b31e);}(_0x2b75,0x141));var _0x52b7=function(_0x346470,_0x544e8b){_0x346470=_0x346470-0x0;var _0x48c17a=_0x2b75[_0x346470];return _0x48c17a;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x52b7('0x0'));module[_0x52b7('0x1')]={'state':{'type':Sequelize[_0x52b7('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x52b7('0x3')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x52b7('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x52b7('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x52b7('0x3')]},'originatecalleridnum':{'type':Sequelize[_0x52b7('0x3')]},'originatecalleridname':{'type':Sequelize[_0x52b7('0x3')]},'calleridnum':{'type':Sequelize[_0x52b7('0x3')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x52b7('0x4')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x52b7('0x4')]},'droptime':{'type':Sequelize[_0x52b7('0x4')]},'endtime':{'type':Sequelize[_0x52b7('0x4')]},'ringtime':{'type':Sequelize[_0x52b7('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x52b7('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x52b7('0x3')]},'campaign':{'type':Sequelize[_0x52b7('0x3')]},'campaigntype':{'type':Sequelize[_0x52b7('0x3')]},'membername':{'type':Sequelize[_0x52b7('0x3')]},'reason':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0x52b7('0x3')]},'secondDisposition':{'type':Sequelize[_0x52b7('0x3')]},'thirdDisposition':{'type':Sequelize[_0x52b7('0x3')]},'dispositionat':{'type':Sequelize[_0x52b7('0x4')],'set':function(_0x237e88){var _0x25a13f=this['getDataValue'](_0x52b7('0x5'));if(_0x25a13f&&_0x237e88){this[_0x52b7('0x6')]('followuptime',moment(_0x237e88)[_0x52b7('0x7')](moment(_0x25a13f),_0x52b7('0x8')));}}},'amd':{'type':Sequelize[_0x52b7('0x9')],'defaultValue':![]},'fax':{'type':Sequelize[_0x52b7('0x9')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x52b7('0x9')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x52b7('0x9')],'defaultValue':![]},'rescheduledat':{'type':Sequelize['DATE']},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x52b7('0x4')]},'deleted':{'type':Sequelize[_0x52b7('0x3')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x52b7('0x4')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agiafterat':{'type':Sequelize['DATE']},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x52b7('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x52b7('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
index 3c039cc..f90964d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4819=['send','map','CmHopperFinal','rawAttributes','type','key','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','count','includeAll','include','catch','show','keys','find','describe','body','uniqueid','countContactsQueueCampaignHopperFinal','findAll','params','sequelize','COUNT','literal','`state`\x20=\x200,\x201,\x20null','noSuchContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','VoiceQueue','insert','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','VoiceQueueId','createdAt','updatedAt','select','field','ANY_VALUE(calleridnum)','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','from','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','state','calleridnum\x20NOT\x20IN\x20(?)','calleridnum','cm_hopper_final','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','Campaign','into','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','calleridnum\x20IS\x20NOT\x20NULL','CmHopper','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','offset','set','Content-Range','apply','reject','update','then','destroy','stack','name'];(function(_0x52b15d,_0x111cb9){var _0x3f4bce=function(_0x3e528f){while(--_0x3e528f){_0x52b15d['push'](_0x52b15d['shift']());}};_0x3f4bce(++_0x111cb9);}(_0x4819,0xcd));var _0x9481=function(_0x493c5b,_0x4523de){_0x493c5b=_0x493c5b-0x0;var _0x3e487d=_0x4819[_0x493c5b];return _0x3e487d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9481('0x0'));var zipdir=require(_0x9481('0x1'));var jsonpatch=require(_0x9481('0x2'));var rp=require(_0x9481('0x3'));var moment=require(_0x9481('0x4'));var BPromise=require(_0x9481('0x5'));var Mustache=require(_0x9481('0x6'));var util=require(_0x9481('0x7'));var path=require(_0x9481('0x8'));var sox=require(_0x9481('0x9'));var csv=require('to-csv');var ejs=require(_0x9481('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x9481('0xb'));var crypto=require(_0x9481('0xc'));var jsforce=require(_0x9481('0xd'));var deskjs=require(_0x9481('0xe'));var toCsv=require(_0x9481('0xf'));var querystring=require('querystring');var Papa=require(_0x9481('0x10'));var Redis=require('ioredis');var authService=require(_0x9481('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x9481('0x12'));var hardwareService=require(_0x9481('0x13'));var logger=require(_0x9481('0x14'))(_0x9481('0x15'));var utils=require(_0x9481('0x16'));var config=require(_0x9481('0x17'));var licenseUtil=require(_0x9481('0x18'));var db=require(_0x9481('0x19'))['db'];function respondWithStatusCode(_0xed8e9,_0x499b87){_0x499b87=_0x499b87||0xcc;return function(_0x5aac02){if(_0x5aac02){return _0xed8e9[_0x9481('0x1a')](_0x499b87);}return _0xed8e9[_0x9481('0x1b')](_0x499b87)[_0x9481('0x1c')]();};}function respondWithResult(_0x28fcb6,_0x3d23c2){_0x3d23c2=_0x3d23c2||0xc8;return function(_0xc7a0b5){if(_0xc7a0b5){return _0x28fcb6[_0x9481('0x1b')](_0x3d23c2)['json'](_0xc7a0b5);}};}function respondWithFilteredResult(_0x4220f1,_0x7a7ee){return function(_0x5b1fe6){if(_0x5b1fe6){var _0x2266d5=typeof _0x7a7ee['offset']===_0x9481('0x1d')&&typeof _0x7a7ee[_0x9481('0x1e')]===_0x9481('0x1d');var _0x2bb2a4=_0x5b1fe6['count'];var _0x5eda66=_0x2266d5?0x0:_0x7a7ee[_0x9481('0x1f')];var _0x50a559=_0x2266d5?_0x5b1fe6['count']:_0x7a7ee[_0x9481('0x1f')]+_0x7a7ee[_0x9481('0x1e')];var _0x18c6f5;if(_0x50a559>=_0x2bb2a4){_0x50a559=_0x2bb2a4;_0x18c6f5=0xc8;}else{_0x18c6f5=0xce;}_0x4220f1[_0x9481('0x1b')](_0x18c6f5);return _0x4220f1[_0x9481('0x20')](_0x9481('0x21'),_0x5eda66+'-'+_0x50a559+'/'+_0x2bb2a4)['json'](_0x5b1fe6);}return null;};}function patchUpdates(_0x2cf1aa){return function(_0x272a84){try{jsonpatch[_0x9481('0x22')](_0x272a84,_0x2cf1aa,!![]);}catch(_0x615e02){return BPromise[_0x9481('0x23')](_0x615e02);}return _0x272a84['save']();};}function saveUpdates(_0x215dd7,_0x294908){return function(_0x572599){if(_0x572599){return _0x572599[_0x9481('0x24')](_0x215dd7)[_0x9481('0x25')](function(_0x352b3a){return _0x352b3a;});}return null;};}function removeEntity(_0x1809d2,_0x2dc02e){return function(_0x49ecfa){if(_0x49ecfa){return _0x49ecfa[_0x9481('0x26')]()[_0x9481('0x25')](function(){_0x1809d2['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x12b0c3,_0x299e28){return function(_0x550fce){if(!_0x550fce){_0x12b0c3[_0x9481('0x1a')](0x194);}return _0x550fce;};}function handleError(_0x20ff9a,_0xeff0a5){_0xeff0a5=_0xeff0a5||0x1f4;return function(_0x28ae1b){logger['error'](_0x28ae1b[_0x9481('0x27')]);if(_0x28ae1b[_0x9481('0x28')]){delete _0x28ae1b[_0x9481('0x28')];}_0x20ff9a['status'](_0xeff0a5)[_0x9481('0x29')](_0x28ae1b);};}exports['index']=function(_0x2e1eff,_0xe153ab){var _0x22ab26={},_0x13ef93={},_0x2e5e63={'count':0x0,'rows':[]};var _0x53560d=_[_0x9481('0x2a')](db[_0x9481('0x2b')][_0x9481('0x2c')],function(_0x4895a0){return{'name':_0x4895a0['fieldName'],'type':_0x4895a0[_0x9481('0x2d')][_0x9481('0x2e')]};});_0x13ef93[_0x9481('0x2f')]=_[_0x9481('0x2a')](_0x53560d,'name');_0x13ef93['query']=_['keys'](_0x2e1eff[_0x9481('0x30')]);_0x13ef93['filters']=_[_0x9481('0x31')](_0x13ef93['model'],_0x13ef93[_0x9481('0x30')]);_0x22ab26[_0x9481('0x32')]=_[_0x9481('0x31')](_0x13ef93[_0x9481('0x2f')],qs[_0x9481('0x33')](_0x2e1eff['query'][_0x9481('0x33')]));_0x22ab26[_0x9481('0x32')]=_0x22ab26[_0x9481('0x32')]['length']?_0x22ab26[_0x9481('0x32')]:_0x13ef93[_0x9481('0x2f')];if(!_0x2e1eff[_0x9481('0x30')][_0x9481('0x34')](_0x9481('0x35'))){_0x22ab26[_0x9481('0x1e')]=qs['limit'](_0x2e1eff[_0x9481('0x30')]['limit']);_0x22ab26[_0x9481('0x1f')]=qs[_0x9481('0x1f')](_0x2e1eff[_0x9481('0x30')][_0x9481('0x1f')]);}_0x22ab26[_0x9481('0x36')]=qs[_0x9481('0x37')](_0x2e1eff['query'][_0x9481('0x37')]);_0x22ab26[_0x9481('0x38')]=qs['filters'](_['pick'](_0x2e1eff[_0x9481('0x30')],_0x13ef93['filters']),_0x53560d);if(_0x2e1eff[_0x9481('0x30')][_0x9481('0x39')]){_0x22ab26[_0x9481('0x38')]=_[_0x9481('0x3a')](_0x22ab26['where'],{'$or':_[_0x9481('0x2a')](_0x53560d,function(_0x590d50){if(_0x590d50[_0x9481('0x2d')]!=='VIRTUAL'){var _0x2ce972={};_0x2ce972[_0x590d50['name']]={'$like':'%'+_0x2e1eff[_0x9481('0x30')][_0x9481('0x39')]+'%'};return _0x2ce972;}})});}_0x22ab26=_[_0x9481('0x3a')]({},_0x22ab26,_0x2e1eff[_0x9481('0x3b')]);var _0x97dc3e={'where':_0x22ab26[_0x9481('0x38')]};return db[_0x9481('0x2b')]['count'](_0x97dc3e)[_0x9481('0x25')](function(_0x3857e8){_0x2e5e63[_0x9481('0x3c')]=_0x3857e8;if(_0x2e1eff[_0x9481('0x30')][_0x9481('0x3d')]){_0x22ab26[_0x9481('0x3e')]=[{'all':!![]}];}return db[_0x9481('0x2b')]['findAll'](_0x22ab26);})[_0x9481('0x25')](function(_0x1872ff){_0x2e5e63['rows']=_0x1872ff;return _0x2e5e63;})[_0x9481('0x25')](respondWithFilteredResult(_0xe153ab,_0x22ab26))[_0x9481('0x3f')](handleError(_0xe153ab,null));};exports[_0x9481('0x40')]=function(_0x3eb9ee,_0x29a8e9){var _0x5a8ffd={'raw':!![],'where':{'id':_0x3eb9ee['params']['id']}},_0x304791={};_0x304791[_0x9481('0x2f')]=_[_0x9481('0x41')](db['CmHopperFinal']['rawAttributes']);_0x304791[_0x9481('0x30')]=_[_0x9481('0x41')](_0x3eb9ee[_0x9481('0x30')]);_0x304791['filters']=_[_0x9481('0x31')](_0x304791[_0x9481('0x2f')],_0x304791['query']);_0x5a8ffd['attributes']=_[_0x9481('0x31')](_0x304791['model'],qs[_0x9481('0x33')](_0x3eb9ee[_0x9481('0x30')][_0x9481('0x33')]));_0x5a8ffd[_0x9481('0x32')]=_0x5a8ffd[_0x9481('0x32')]['length']?_0x5a8ffd[_0x9481('0x32')]:_0x304791[_0x9481('0x2f')];if(_0x3eb9ee['query'][_0x9481('0x3d')]){_0x5a8ffd[_0x9481('0x3e')]=[{'all':!![]}];}_0x5a8ffd=_[_0x9481('0x3a')]({},_0x5a8ffd,_0x3eb9ee[_0x9481('0x3b')]);return db[_0x9481('0x2b')][_0x9481('0x42')](_0x5a8ffd)[_0x9481('0x25')](handleEntityNotFound(_0x29a8e9,null))[_0x9481('0x25')](respondWithResult(_0x29a8e9,null))[_0x9481('0x3f')](handleError(_0x29a8e9,null));};exports['describe']=function(_0xd36133,_0x5d3a06){return db['CmHopperFinal'][_0x9481('0x43')]()['then'](respondWithResult(_0x5d3a06,null))[_0x9481('0x3f')](handleError(_0x5d3a06,null));};exports[_0x9481('0x24')]=function(_0x47f8b2,_0x277e2a){if(_0x47f8b2[_0x9481('0x44')][_0x9481('0x45')]){delete _0x47f8b2[_0x9481('0x44')][_0x9481('0x45')];}return db[_0x9481('0x2b')]['find']({'where':{'uniqueid':_0x47f8b2['params']['id']}})[_0x9481('0x25')](handleEntityNotFound(_0x277e2a,null))[_0x9481('0x25')](saveUpdates(_0x47f8b2[_0x9481('0x44')],null))[_0x9481('0x25')](respondWithResult(_0x277e2a,null))[_0x9481('0x3f')](handleError(_0x277e2a,null));};exports[_0x9481('0x46')]=function(_0x1c070c,_0x3d2250,_0x580273){return db[_0x9481('0x2b')][_0x9481('0x47')]({'raw':![],'where':{'VoiceQueueId':_0x1c070c[_0x9481('0x48')]['id']},'attributes':[[db[_0x9481('0x49')]['fn'](_0x9481('0x4a'),db['sequelize']['fn']('IF',db['sequelize'][_0x9481('0x4b')](_0x9481('0x4c')))),_0x9481('0x4d')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize']['literal']('`state`\x20=\x203,\x201,\x20null'))),'noAnswerContacts'],[db[_0x9481('0x49')]['fn'](_0x9481('0x4a'),db['sequelize']['fn']('IF',db[_0x9481('0x49')]['literal'](_0x9481('0x4e')))),_0x9481('0x4f')],[db[_0x9481('0x49')]['fn'](_0x9481('0x4a'),db[_0x9481('0x49')]['fn']('IF',db[_0x9481('0x49')][_0x9481('0x4b')]('`state`\x20=\x208,\x201,\x20null'))),_0x9481('0x50')],[db[_0x9481('0x49')]['fn']('COUNT',db[_0x9481('0x49')]['fn']('IF',db[_0x9481('0x49')][_0x9481('0x4b')](_0x9481('0x51')))),_0x9481('0x52')],[db['sequelize']['fn'](_0x9481('0x4a'),db[_0x9481('0x49')]['fn']('IF',db[_0x9481('0x49')][_0x9481('0x4b')](_0x9481('0x53')))),_0x9481('0x54')],[db[_0x9481('0x49')]['fn'](_0x9481('0x4a'),db[_0x9481('0x49')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x2022,\x201,\x20null'))),_0x9481('0x55')],[db[_0x9481('0x49')]['fn']('COUNT',db[_0x9481('0x49')]['fn']('IF',db[_0x9481('0x49')][_0x9481('0x4b')](_0x9481('0x56')))),_0x9481('0x57')]]})[_0x9481('0x25')](handleEntityNotFound(_0x3d2250,null))['then'](respondWithResult(_0x3d2250,null))['catch'](handleError(_0x3d2250,null));};exports[_0x9481('0x58')]=function(_0x3cbab5,_0xb58b67,_0xe008db){return db[_0x9481('0x2b')][_0x9481('0x47')]({'raw':![],'where':{'CampaignId':_0x3cbab5['params']['id']},'attributes':[[db['sequelize']['fn'](_0x9481('0x4a'),db['sequelize']['fn']('IF',db[_0x9481('0x49')]['literal'](_0x9481('0x4c')))),_0x9481('0x4d')],[db[_0x9481('0x49')]['fn']('COUNT',db[_0x9481('0x49')]['fn']('IF',db[_0x9481('0x49')]['literal']('`state`\x20=\x203,\x201,\x20null'))),'noAnswerContacts'],[db['sequelize']['fn'](_0x9481('0x4a'),db['sequelize']['fn']('IF',db[_0x9481('0x49')][_0x9481('0x4b')](_0x9481('0x4e')))),'busyContacts'],[db[_0x9481('0x49')]['fn']('COUNT',db[_0x9481('0x49')]['fn']('IF',db[_0x9481('0x49')][_0x9481('0x4b')]('`state`\x20=\x208,\x201,\x20null'))),_0x9481('0x50')],[db[_0x9481('0x49')]['fn']('COUNT',db[_0x9481('0x49')]['fn']('IF',db[_0x9481('0x49')][_0x9481('0x4b')](_0x9481('0x51')))),_0x9481('0x52')],[db[_0x9481('0x49')]['fn'](_0x9481('0x4a'),db[_0x9481('0x49')]['fn']('IF',db[_0x9481('0x49')][_0x9481('0x4b')](_0x9481('0x53')))),_0x9481('0x54')],[db[_0x9481('0x49')]['fn'](_0x9481('0x4a'),db[_0x9481('0x49')]['fn']('IF',db[_0x9481('0x49')][_0x9481('0x4b')]('`state`\x20=\x2022,\x201,\x20null'))),_0x9481('0x55')],[db['sequelize']['fn']('COUNT',db[_0x9481('0x49')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x2019,\x201,\x20null'))),_0x9481('0x57')]]})[_0x9481('0x25')](handleEntityNotFound(_0xb58b67,null))[_0x9481('0x25')](respondWithResult(_0xb58b67,null))[_0x9481('0x3f')](handleError(_0xb58b67,null));};exports['moveContactsQueueCampaignHopperFinal']=function(_0xa83176,_0x265f1c,_0x2a053a){return db[_0x9481('0x59')]['find']({'where':{'id':_0xa83176['params']['id']}})[_0x9481('0x25')](handleEntityNotFound(_0x265f1c,null))[_0x9481('0x25')](function(_0x193992){var _0x380f2a;if(_0x193992){_0x380f2a=squel[_0x9481('0x5a')]()['into'](_0x9481('0x5b'))[_0x9481('0x5c')]([_0x9481('0x5d'),_0x9481('0x5e'),_0x9481('0x5f'),_0x9481('0x60'),_0x9481('0x61'),_0x9481('0x62'),_0x9481('0x63')],squel[_0x9481('0x64')]()[_0x9481('0x65')](_0x9481('0x66'),_0x9481('0x5d'))[_0x9481('0x65')](_0x9481('0x67'),'scheduledAt')[_0x9481('0x65')](_0x9481('0x68'),_0x9481('0x5f'))[_0x9481('0x65')](_0x9481('0x69'),_0x9481('0x60'))[_0x9481('0x65')]('ANY_VALUE(VoiceQueueId)',_0x9481('0x61'))[_0x9481('0x65')]('NOW()','createdAt')[_0x9481('0x65')]('NOW()','updatedAt')[_0x9481('0x6a')]('cm_hopper_final')[_0x9481('0x38')](_0x9481('0x6b'),_0xa83176[_0x9481('0x48')]['id'][_0x9481('0x6c')]())['where'](_0x9481('0x6d'),_0xa83176['body'][_0x9481('0x6e')][_0x9481('0x6c')]())[_0x9481('0x38')]('calleridnum\x20IS\x20NOT\x20NULL')['where']('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x9481('0x64')]()['field']('phone')[_0x9481('0x6a')](_0x9481('0x5b'))[_0x9481('0x38')]('VoiceQueueId\x20=\x20?',_0xa83176[_0x9481('0x48')]['id'][_0x9481('0x6c')]()))['where'](_0x9481('0x6f'),squel[_0x9481('0x64')]()[_0x9481('0x65')](_0x9481('0x70'))['from'](_0x9481('0x71'))['where'](_0x9481('0x6b'),_0xa83176[_0x9481('0x48')]['id']['toString']())[_0x9481('0x38')](_0x9481('0x72')))[_0x9481('0x73')]('ContactId'))['toString']();return db[_0x9481('0x49')]['query'](_0x380f2a);}return[];})[_0x9481('0x25')](respondWithResult(_0x265f1c,null))[_0x9481('0x3f')](handleError(_0x265f1c,null));};exports[_0x9481('0x74')]=function(_0x55b428,_0x3f74f1,_0x287d06){return db[_0x9481('0x75')]['find']({'where':{'id':_0x55b428[_0x9481('0x48')]['id']}})[_0x9481('0x25')](handleEntityNotFound(_0x3f74f1,null))[_0x9481('0x25')](function(_0x32b30f){var _0x347da1;if(_0x32b30f){_0x347da1=squel[_0x9481('0x5a')]()[_0x9481('0x76')](_0x9481('0x5b'))[_0x9481('0x5c')]([_0x9481('0x5d'),'scheduledAt',_0x9481('0x5f'),'ListId','CampaignId','createdAt',_0x9481('0x63')],squel[_0x9481('0x64')]()[_0x9481('0x65')](_0x9481('0x66'),_0x9481('0x5d'))['field'](_0x9481('0x67'),_0x9481('0x5e'))[_0x9481('0x65')](_0x9481('0x68'),_0x9481('0x5f'))[_0x9481('0x65')](_0x9481('0x69'),_0x9481('0x60'))[_0x9481('0x65')](_0x9481('0x77'),'CampaignId')[_0x9481('0x65')](_0x9481('0x67'),_0x9481('0x62'))[_0x9481('0x65')](_0x9481('0x67'),_0x9481('0x63'))[_0x9481('0x6a')](_0x9481('0x71'))[_0x9481('0x38')](_0x9481('0x78'),_0x55b428['params']['id'][_0x9481('0x6c')]())[_0x9481('0x38')](_0x9481('0x6d'),_0x55b428[_0x9481('0x44')][_0x9481('0x6e')][_0x9481('0x6c')]())[_0x9481('0x38')](_0x9481('0x79'))[_0x9481('0x38')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x9481('0x64')]()['field']('phone')[_0x9481('0x6a')](_0x9481('0x5b'))[_0x9481('0x38')](_0x9481('0x78'),_0x55b428[_0x9481('0x48')]['id'][_0x9481('0x6c')]()))['where'](_0x9481('0x6f'),squel['select']()[_0x9481('0x65')](_0x9481('0x70'))[_0x9481('0x6a')]('cm_hopper_final')['where'](_0x9481('0x78'),_0x55b428[_0x9481('0x48')]['id'][_0x9481('0x6c')]())[_0x9481('0x38')](_0x9481('0x72')))[_0x9481('0x73')](_0x9481('0x5f')))[_0x9481('0x6c')]();return db[_0x9481('0x49')]['query'](_0x347da1);}return[];})[_0x9481('0x25')](respondWithResult(_0x3f74f1,null))[_0x9481('0x3f')](handleError(_0x3f74f1,null));};exports['checkContactHopper']=function(_0x2c53df,_0x534979,_0x616b77){return db[_0x9481('0x7a')]['findOne']({'where':{'VoiceQueueId':_0x2c53df[_0x9481('0x44')][_0x9481('0x61')],'CampaignId':_0x2c53df[_0x9481('0x44')]['CampaignId'],'ContactId':_0x2c53df[_0x9481('0x44')][_0x9481('0x5f')]}})['then'](handleEntityNotFound(_0x534979,null))[_0x9481('0x25')](function(_0x5c7602){if(_0x5c7602){return _0x5c7602;}return null;})[_0x9481('0x25')](respondWithResult(_0x534979,null))[_0x9481('0x3f')](handleError(_0x534979,null));};
\ No newline at end of file
+var _0x5496=['set','Content-Range','apply','reject','save','update','then','error','stack','name','index','CmHopperFinal','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','offset','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','rows','catch','show','params','keys','fields','include','options','find','describe','body','uniqueid','countContactsQueueCampaignHopperFinal','findAll','sequelize','literal','`state`\x20=\x200,\x201,\x20null','noSuchContacts','COUNT','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','`state`\x20=\x2022,\x201,\x20null','`state`\x20=\x2019,\x201,\x20null','countContactsIvrCampaignHopperFinal','dropContacts','abandonedContacts','reCallContacts','answeringMachine','into','cm_hopper','fromQuery','ListId','VoiceQueueId','createdAt','field','phone','NOW()','scheduledAt','ANY_VALUE(ContactId)','ContactId','ANY_VALUE(ListId)','updatedAt','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','select','from','calleridnum','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','Campaign','insert','CampaignId','ANY_VALUE(calleridnum)','CampaignId\x20=\x20?','checkContactHopper','CmHopper','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count'];(function(_0x4d9c7c,_0x55e6ec){var _0x437f57=function(_0x4026f2){while(--_0x4026f2){_0x4d9c7c['push'](_0x4d9c7c['shift']());}};_0x437f57(++_0x55e6ec);}(_0x5496,0x175));var _0x6549=function(_0x5b53d7,_0x2eecbc){_0x5b53d7=_0x5b53d7-0x0;var _0x331ec6=_0x5496[_0x5b53d7];return _0x331ec6;};'use strict';var emlformat=require(_0x6549('0x0'));var rimraf=require(_0x6549('0x1'));var zipdir=require(_0x6549('0x2'));var jsonpatch=require(_0x6549('0x3'));var rp=require(_0x6549('0x4'));var moment=require('moment');var BPromise=require(_0x6549('0x5'));var Mustache=require('mustache');var util=require(_0x6549('0x6'));var path=require(_0x6549('0x7'));var sox=require(_0x6549('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6549('0x9'));var _=require(_0x6549('0xa'));var squel=require('squel');var crypto=require(_0x6549('0xb'));var jsforce=require(_0x6549('0xc'));var deskjs=require(_0x6549('0xd'));var toCsv=require('to-csv');var querystring=require(_0x6549('0xe'));var Papa=require(_0x6549('0xf'));var Redis=require(_0x6549('0x10'));var authService=require(_0x6549('0x11'));var qs=require(_0x6549('0x12'));var as=require(_0x6549('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6549('0x14'));var utils=require(_0x6549('0x15'));var config=require(_0x6549('0x16'));var licenseUtil=require(_0x6549('0x17'));var db=require(_0x6549('0x18'))['db'];function respondWithStatusCode(_0x5bc018,_0x4dfb06){_0x4dfb06=_0x4dfb06||0xcc;return function(_0x3f844f){if(_0x3f844f){return _0x5bc018[_0x6549('0x19')](_0x4dfb06);}return _0x5bc018['status'](_0x4dfb06)[_0x6549('0x1a')]();};}function respondWithResult(_0x150fc8,_0x195d25){_0x195d25=_0x195d25||0xc8;return function(_0x12b068){if(_0x12b068){return _0x150fc8[_0x6549('0x1b')](_0x195d25)[_0x6549('0x1c')](_0x12b068);}};}function respondWithFilteredResult(_0x55c112,_0x5db86d){return function(_0x384f75){if(_0x384f75){var _0x25da29=typeof _0x5db86d['offset']===_0x6549('0x1d')&&typeof _0x5db86d[_0x6549('0x1e')]===_0x6549('0x1d');var _0x387e60=_0x384f75[_0x6549('0x1f')];var _0x53b12b=_0x25da29?0x0:_0x5db86d['offset'];var _0x26a212=_0x25da29?_0x384f75['count']:_0x5db86d['offset']+_0x5db86d[_0x6549('0x1e')];var _0x1e5079;if(_0x26a212>=_0x387e60){_0x26a212=_0x387e60;_0x1e5079=0xc8;}else{_0x1e5079=0xce;}_0x55c112[_0x6549('0x1b')](_0x1e5079);return _0x55c112[_0x6549('0x20')](_0x6549('0x21'),_0x53b12b+'-'+_0x26a212+'/'+_0x387e60)['json'](_0x384f75);}return null;};}function patchUpdates(_0x228117){return function(_0x4b40c1){try{jsonpatch[_0x6549('0x22')](_0x4b40c1,_0x228117,!![]);}catch(_0x72322b){return BPromise[_0x6549('0x23')](_0x72322b);}return _0x4b40c1[_0x6549('0x24')]();};}function saveUpdates(_0x22bcf8,_0x12d547){return function(_0x427b47){if(_0x427b47){return _0x427b47[_0x6549('0x25')](_0x22bcf8)[_0x6549('0x26')](function(_0x6ae00c){return _0x6ae00c;});}return null;};}function removeEntity(_0x40d3f9,_0x1fbfa4){return function(_0x23c0ba){if(_0x23c0ba){return _0x23c0ba['destroy']()[_0x6549('0x26')](function(){_0x40d3f9[_0x6549('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x126967,_0x29f89e){return function(_0x3768cb){if(!_0x3768cb){_0x126967['sendStatus'](0x194);}return _0x3768cb;};}function handleError(_0x31a95,_0xfb51a1){_0xfb51a1=_0xfb51a1||0x1f4;return function(_0x14de1f){logger[_0x6549('0x27')](_0x14de1f[_0x6549('0x28')]);if(_0x14de1f[_0x6549('0x29')]){delete _0x14de1f[_0x6549('0x29')];}_0x31a95[_0x6549('0x1b')](_0xfb51a1)['send'](_0x14de1f);};}exports[_0x6549('0x2a')]=function(_0x136518,_0x17fdfb){var _0x4c605c={},_0x3f1502={},_0x4acaf5={'count':0x0,'rows':[]};var _0x4f0ad1=_['map'](db[_0x6549('0x2b')][_0x6549('0x2c')],function(_0x4f3069){return{'name':_0x4f3069[_0x6549('0x2d')],'type':_0x4f3069[_0x6549('0x2e')][_0x6549('0x2f')]};});_0x3f1502[_0x6549('0x30')]=_[_0x6549('0x31')](_0x4f0ad1,_0x6549('0x29'));_0x3f1502[_0x6549('0x32')]=_['keys'](_0x136518[_0x6549('0x32')]);_0x3f1502[_0x6549('0x33')]=_[_0x6549('0x34')](_0x3f1502[_0x6549('0x30')],_0x3f1502[_0x6549('0x32')]);_0x4c605c[_0x6549('0x35')]=_['intersection'](_0x3f1502[_0x6549('0x30')],qs['fields'](_0x136518[_0x6549('0x32')]['fields']));_0x4c605c[_0x6549('0x35')]=_0x4c605c[_0x6549('0x35')][_0x6549('0x36')]?_0x4c605c['attributes']:_0x3f1502[_0x6549('0x30')];if(!_0x136518[_0x6549('0x32')][_0x6549('0x37')](_0x6549('0x38'))){_0x4c605c['limit']=qs['limit'](_0x136518['query'][_0x6549('0x1e')]);_0x4c605c[_0x6549('0x39')]=qs['offset'](_0x136518[_0x6549('0x32')][_0x6549('0x39')]);}_0x4c605c[_0x6549('0x3a')]=qs[_0x6549('0x3b')](_0x136518[_0x6549('0x32')]['sort']);_0x4c605c['where']=qs[_0x6549('0x33')](_[_0x6549('0x3c')](_0x136518[_0x6549('0x32')],_0x3f1502[_0x6549('0x33')]),_0x4f0ad1);if(_0x136518[_0x6549('0x32')][_0x6549('0x3d')]){_0x4c605c[_0x6549('0x3e')]=_[_0x6549('0x3f')](_0x4c605c[_0x6549('0x3e')],{'$or':_[_0x6549('0x31')](_0x4f0ad1,function(_0x525f82){if(_0x525f82[_0x6549('0x2e')]!==_0x6549('0x40')){var _0x2ea977={};_0x2ea977[_0x525f82[_0x6549('0x29')]]={'$like':'%'+_0x136518[_0x6549('0x32')]['filter']+'%'};return _0x2ea977;}})});}_0x4c605c=_['merge']({},_0x4c605c,_0x136518['options']);var _0x22b919={'where':_0x4c605c[_0x6549('0x3e')]};return db[_0x6549('0x2b')][_0x6549('0x1f')](_0x22b919)['then'](function(_0x56ce9f){_0x4acaf5[_0x6549('0x1f')]=_0x56ce9f;if(_0x136518[_0x6549('0x32')][_0x6549('0x41')]){_0x4c605c['include']=[{'all':!![]}];}return db[_0x6549('0x2b')]['findAll'](_0x4c605c);})[_0x6549('0x26')](function(_0x2ec614){_0x4acaf5[_0x6549('0x42')]=_0x2ec614;return _0x4acaf5;})[_0x6549('0x26')](respondWithFilteredResult(_0x17fdfb,_0x4c605c))[_0x6549('0x43')](handleError(_0x17fdfb,null));};exports[_0x6549('0x44')]=function(_0xbbfdc9,_0x4deaab){var _0x132625={'raw':!![],'where':{'id':_0xbbfdc9[_0x6549('0x45')]['id']}},_0x309f45={};_0x309f45[_0x6549('0x30')]=_[_0x6549('0x46')](db[_0x6549('0x2b')][_0x6549('0x2c')]);_0x309f45[_0x6549('0x32')]=_[_0x6549('0x46')](_0xbbfdc9[_0x6549('0x32')]);_0x309f45[_0x6549('0x33')]=_[_0x6549('0x34')](_0x309f45[_0x6549('0x30')],_0x309f45[_0x6549('0x32')]);_0x132625[_0x6549('0x35')]=_[_0x6549('0x34')](_0x309f45['model'],qs[_0x6549('0x47')](_0xbbfdc9[_0x6549('0x32')][_0x6549('0x47')]));_0x132625[_0x6549('0x35')]=_0x132625['attributes'][_0x6549('0x36')]?_0x132625['attributes']:_0x309f45[_0x6549('0x30')];if(_0xbbfdc9[_0x6549('0x32')]['includeAll']){_0x132625[_0x6549('0x48')]=[{'all':!![]}];}_0x132625=_[_0x6549('0x3f')]({},_0x132625,_0xbbfdc9[_0x6549('0x49')]);return db[_0x6549('0x2b')][_0x6549('0x4a')](_0x132625)['then'](handleEntityNotFound(_0x4deaab,null))['then'](respondWithResult(_0x4deaab,null))[_0x6549('0x43')](handleError(_0x4deaab,null));};exports[_0x6549('0x4b')]=function(_0x41d675,_0x1712f3){return db[_0x6549('0x2b')]['describe']()[_0x6549('0x26')](respondWithResult(_0x1712f3,null))[_0x6549('0x43')](handleError(_0x1712f3,null));};exports[_0x6549('0x25')]=function(_0x6121af,_0xa4c650){if(_0x6121af[_0x6549('0x4c')][_0x6549('0x4d')]){delete _0x6121af[_0x6549('0x4c')]['uniqueid'];}return db[_0x6549('0x2b')]['find']({'where':{'uniqueid':_0x6121af[_0x6549('0x45')]['id']}})[_0x6549('0x26')](handleEntityNotFound(_0xa4c650,null))[_0x6549('0x26')](saveUpdates(_0x6121af['body'],null))[_0x6549('0x26')](respondWithResult(_0xa4c650,null))[_0x6549('0x43')](handleError(_0xa4c650,null));};exports[_0x6549('0x4e')]=function(_0x5300c8,_0x19ac50,_0x17d7ce){return db[_0x6549('0x2b')][_0x6549('0x4f')]({'raw':![],'where':{'VoiceQueueId':_0x5300c8[_0x6549('0x45')]['id']},'attributes':[[db[_0x6549('0x50')]['fn']('COUNT',db[_0x6549('0x50')]['fn']('IF',db['sequelize'][_0x6549('0x51')](_0x6549('0x52')))),_0x6549('0x53')],[db[_0x6549('0x50')]['fn'](_0x6549('0x54'),db[_0x6549('0x50')]['fn']('IF',db[_0x6549('0x50')][_0x6549('0x51')](_0x6549('0x55')))),_0x6549('0x56')],[db[_0x6549('0x50')]['fn'](_0x6549('0x54'),db['sequelize']['fn']('IF',db[_0x6549('0x50')][_0x6549('0x51')](_0x6549('0x57')))),_0x6549('0x58')],[db[_0x6549('0x50')]['fn'](_0x6549('0x54'),db[_0x6549('0x50')]['fn']('IF',db[_0x6549('0x50')]['literal'](_0x6549('0x59')))),_0x6549('0x5a')],[db[_0x6549('0x50')]['fn'](_0x6549('0x54'),db[_0x6549('0x50')]['fn']('IF',db[_0x6549('0x50')][_0x6549('0x51')](_0x6549('0x5b')))),'dropContacts'],[db[_0x6549('0x50')]['fn'](_0x6549('0x54'),db[_0x6549('0x50')]['fn']('IF',db[_0x6549('0x50')][_0x6549('0x51')](_0x6549('0x5c')))),'abandonedContacts'],[db[_0x6549('0x50')]['fn'](_0x6549('0x54'),db['sequelize']['fn']('IF',db[_0x6549('0x50')][_0x6549('0x51')](_0x6549('0x5d')))),'reCallContacts'],[db[_0x6549('0x50')]['fn'](_0x6549('0x54'),db['sequelize']['fn']('IF',db[_0x6549('0x50')]['literal'](_0x6549('0x5e')))),'answeringMachine']]})[_0x6549('0x26')](handleEntityNotFound(_0x19ac50,null))[_0x6549('0x26')](respondWithResult(_0x19ac50,null))[_0x6549('0x43')](handleError(_0x19ac50,null));};exports[_0x6549('0x5f')]=function(_0x2da535,_0x45eb28,_0x3b01d9){return db[_0x6549('0x2b')][_0x6549('0x4f')]({'raw':![],'where':{'CampaignId':_0x2da535[_0x6549('0x45')]['id']},'attributes':[[db[_0x6549('0x50')]['fn'](_0x6549('0x54'),db[_0x6549('0x50')]['fn']('IF',db[_0x6549('0x50')]['literal'](_0x6549('0x52')))),_0x6549('0x53')],[db['sequelize']['fn'](_0x6549('0x54'),db[_0x6549('0x50')]['fn']('IF',db[_0x6549('0x50')][_0x6549('0x51')]('`state`\x20=\x203,\x201,\x20null'))),_0x6549('0x56')],[db[_0x6549('0x50')]['fn'](_0x6549('0x54'),db[_0x6549('0x50')]['fn']('IF',db['sequelize'][_0x6549('0x51')]('`state`\x20=\x205,\x201,\x20null'))),_0x6549('0x58')],[db[_0x6549('0x50')]['fn'](_0x6549('0x54'),db[_0x6549('0x50')]['fn']('IF',db[_0x6549('0x50')][_0x6549('0x51')](_0x6549('0x59')))),_0x6549('0x5a')],[db[_0x6549('0x50')]['fn'](_0x6549('0x54'),db['sequelize']['fn']('IF',db[_0x6549('0x50')][_0x6549('0x51')](_0x6549('0x5b')))),_0x6549('0x60')],[db[_0x6549('0x50')]['fn'](_0x6549('0x54'),db['sequelize']['fn']('IF',db['sequelize'][_0x6549('0x51')](_0x6549('0x5c')))),_0x6549('0x61')],[db['sequelize']['fn'](_0x6549('0x54'),db[_0x6549('0x50')]['fn']('IF',db['sequelize'][_0x6549('0x51')](_0x6549('0x5d')))),_0x6549('0x62')],[db[_0x6549('0x50')]['fn'](_0x6549('0x54'),db[_0x6549('0x50')]['fn']('IF',db[_0x6549('0x50')][_0x6549('0x51')]('`state`\x20=\x2019,\x201,\x20null'))),_0x6549('0x63')]]})['then'](handleEntityNotFound(_0x45eb28,null))[_0x6549('0x26')](respondWithResult(_0x45eb28,null))[_0x6549('0x43')](handleError(_0x45eb28,null));};exports['moveContactsQueueCampaignHopperFinal']=function(_0x372b67,_0x2c00a1,_0x2e6b4b){return db['VoiceQueue'][_0x6549('0x4a')]({'where':{'id':_0x372b67[_0x6549('0x45')]['id']}})[_0x6549('0x26')](handleEntityNotFound(_0x2c00a1,null))[_0x6549('0x26')](function(_0x15b906){var _0x34c5f9;if(_0x15b906){_0x34c5f9=squel['insert']()[_0x6549('0x64')](_0x6549('0x65'))[_0x6549('0x66')](['phone','scheduledAt','ContactId',_0x6549('0x67'),_0x6549('0x68'),_0x6549('0x69'),'updatedAt'],squel['select']()[_0x6549('0x6a')]('ANY_VALUE(calleridnum)',_0x6549('0x6b'))[_0x6549('0x6a')](_0x6549('0x6c'),_0x6549('0x6d'))[_0x6549('0x6a')](_0x6549('0x6e'),_0x6549('0x6f'))['field'](_0x6549('0x70'),_0x6549('0x67'))[_0x6549('0x6a')]('ANY_VALUE(VoiceQueueId)',_0x6549('0x68'))[_0x6549('0x6a')](_0x6549('0x6c'),_0x6549('0x69'))[_0x6549('0x6a')](_0x6549('0x6c'),_0x6549('0x71'))['from'](_0x6549('0x72'))['where'](_0x6549('0x73'),_0x372b67[_0x6549('0x45')]['id'][_0x6549('0x74')]())[_0x6549('0x3e')](_0x6549('0x75'),_0x372b67[_0x6549('0x4c')][_0x6549('0x76')][_0x6549('0x74')]())['where'](_0x6549('0x77'))[_0x6549('0x3e')](_0x6549('0x78'),squel[_0x6549('0x79')]()[_0x6549('0x6a')](_0x6549('0x6b'))[_0x6549('0x7a')](_0x6549('0x65'))[_0x6549('0x3e')](_0x6549('0x73'),_0x372b67['params']['id'][_0x6549('0x74')]()))[_0x6549('0x3e')](_0x6549('0x78'),squel[_0x6549('0x79')]()[_0x6549('0x6a')](_0x6549('0x7b'))[_0x6549('0x7a')](_0x6549('0x72'))[_0x6549('0x3e')](_0x6549('0x73'),_0x372b67[_0x6549('0x45')]['id'][_0x6549('0x74')]())[_0x6549('0x3e')](_0x6549('0x7c')))[_0x6549('0x7d')](_0x6549('0x6f')))[_0x6549('0x74')]();return db[_0x6549('0x50')]['query'](_0x34c5f9);}return[];})[_0x6549('0x26')](respondWithResult(_0x2c00a1,null))[_0x6549('0x43')](handleError(_0x2c00a1,null));};exports[_0x6549('0x7e')]=function(_0x35bad6,_0x371d8a,_0xfde69e){return db[_0x6549('0x7f')][_0x6549('0x4a')]({'where':{'id':_0x35bad6[_0x6549('0x45')]['id']}})[_0x6549('0x26')](handleEntityNotFound(_0x371d8a,null))[_0x6549('0x26')](function(_0x1da2d7){var _0x348d55;if(_0x1da2d7){_0x348d55=squel[_0x6549('0x80')]()[_0x6549('0x64')](_0x6549('0x65'))[_0x6549('0x66')](['phone',_0x6549('0x6d'),_0x6549('0x6f'),_0x6549('0x67'),_0x6549('0x81'),_0x6549('0x69'),_0x6549('0x71')],squel[_0x6549('0x79')]()['field'](_0x6549('0x82'),'phone')['field'](_0x6549('0x6c'),'scheduledAt')[_0x6549('0x6a')](_0x6549('0x6e'),_0x6549('0x6f'))[_0x6549('0x6a')](_0x6549('0x70'),'ListId')[_0x6549('0x6a')]('ANY_VALUE(CampaignId)',_0x6549('0x81'))[_0x6549('0x6a')](_0x6549('0x6c'),'createdAt')[_0x6549('0x6a')](_0x6549('0x6c'),'updatedAt')['from'](_0x6549('0x72'))[_0x6549('0x3e')](_0x6549('0x83'),_0x35bad6[_0x6549('0x45')]['id'][_0x6549('0x74')]())[_0x6549('0x3e')](_0x6549('0x75'),_0x35bad6[_0x6549('0x4c')][_0x6549('0x76')][_0x6549('0x74')]())[_0x6549('0x3e')](_0x6549('0x77'))[_0x6549('0x3e')](_0x6549('0x78'),squel[_0x6549('0x79')]()[_0x6549('0x6a')](_0x6549('0x6b'))[_0x6549('0x7a')](_0x6549('0x65'))['where']('CampaignId\x20=\x20?',_0x35bad6[_0x6549('0x45')]['id'][_0x6549('0x74')]()))[_0x6549('0x3e')](_0x6549('0x78'),squel[_0x6549('0x79')]()[_0x6549('0x6a')](_0x6549('0x7b'))[_0x6549('0x7a')](_0x6549('0x72'))[_0x6549('0x3e')]('CampaignId\x20=\x20?',_0x35bad6['params']['id']['toString']())[_0x6549('0x3e')](_0x6549('0x7c')))[_0x6549('0x7d')](_0x6549('0x6f')))[_0x6549('0x74')]();return db['sequelize'][_0x6549('0x32')](_0x348d55);}return[];})[_0x6549('0x26')](respondWithResult(_0x371d8a,null))[_0x6549('0x43')](handleError(_0x371d8a,null));};exports[_0x6549('0x84')]=function(_0x230874,_0x3be369,_0xaf1a80){return db[_0x6549('0x85')][_0x6549('0x86')]({'where':{'VoiceQueueId':_0x230874[_0x6549('0x4c')][_0x6549('0x68')],'CampaignId':_0x230874['body'][_0x6549('0x81')],'ContactId':_0x230874[_0x6549('0x4c')][_0x6549('0x6f')]}})[_0x6549('0x26')](handleEntityNotFound(_0x3be369,null))['then'](function(_0x158c92){if(_0x158c92){return _0x158c92;}return null;})[_0x6549('0x26')](respondWithResult(_0x3be369,null))[_0x6549('0x43')](handleError(_0x3be369,null));};
\ No newline at end of file
index e16707f..09fad50 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5c03=['../../config/logger','bluebird','path','rimraf','../../config/environment','./cmHopperFinal.attributes','exports','define','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','lodash','util'];(function(_0x31b4e1,_0x4cbd36){var _0x149492=function(_0x46ea18){while(--_0x46ea18){_0x31b4e1['push'](_0x31b4e1['shift']());}};_0x149492(++_0x4cbd36);}(_0x5c03,0x194));var _0x35c0=function(_0xe73080,_0x24c56d){_0xe73080=_0xe73080-0x0;var _0x12cbc4=_0x5c03[_0xe73080];return _0x12cbc4;};'use strict';var _=require(_0x35c0('0x0'));var util=require(_0x35c0('0x1'));var logger=require(_0x35c0('0x2'))('api');var moment=require('moment');var BPromise=require(_0x35c0('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x35c0('0x4'));var rimraf=require(_0x35c0('0x5'));var config=require(_0x35c0('0x6'));var attributes=require(_0x35c0('0x7'));module[_0x35c0('0x8')]=function(_0x3ee84d,_0x28fb48){return _0x3ee84d[_0x35c0('0x9')](_0x35c0('0xa'),attributes,{'tableName':_0x35c0('0xb'),'paranoid':![],'indexes':[{'name':'calleridnum','fields':[_0x35c0('0xc')]},{'name':'uniqueid','fields':[_0x35c0('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xa88f=['uniqueid','lodash','util','bluebird','request-promise','path','rimraf','./cmHopperFinal.attributes','exports','CmHopperFinal','cm_hopper_final','calleridnum'];(function(_0x47c882,_0x8a92aa){var _0x205ede=function(_0x2bf8ae){while(--_0x2bf8ae){_0x47c882['push'](_0x47c882['shift']());}};_0x205ede(++_0x8a92aa);}(_0xa88f,0x1e1));var _0xfa88=function(_0x36f6b8,_0x9c05ef){_0x36f6b8=_0x36f6b8-0x0;var _0x341b4c=_0xa88f[_0x36f6b8];return _0x341b4c;};'use strict';var _=require(_0xfa88('0x0'));var util=require(_0xfa88('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xfa88('0x2'));var rp=require(_0xfa88('0x3'));var fs=require('fs');var path=require(_0xfa88('0x4'));var rimraf=require(_0xfa88('0x5'));var config=require('../../config/environment');var attributes=require(_0xfa88('0x6'));module[_0xfa88('0x7')]=function(_0x46567b,_0x29afe2){return _0x46567b['define'](_0xfa88('0x8'),attributes,{'tableName':_0xfa88('0x9'),'paranoid':![],'indexes':[{'name':_0xfa88('0xa'),'fields':[_0xfa88('0xa')]},{'name':_0xfa88('0xb'),'fields':[_0xfa88('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
index 3ae7159..cb0642e 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(_0x536931,_0x575a46){var _0x311998=function(_0xc7d400){while(--_0xc7d400){_0x536931['push'](_0x536931['shift']());}};_0x311998(++_0x575a46);}(_0x7a54,0x106));var _0x47a5=function(_0x2523f0,_0x24de0f){_0x2523f0=_0x2523f0-0x0;var _0xb3ec0e=_0x7a54[_0x2523f0];return _0xb3ec0e;};'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 _0xb10b=['debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopperFinal,\x20%s,\x20%s','CmHopperFinal,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateCmHopperFinal','CmHopperFinal','create','options','raw'];(function(_0x27fdab,_0x398484){var _0x3782b7=function(_0xe936e8){while(--_0xe936e8){_0x27fdab['push'](_0x27fdab['shift']());}};_0x3782b7(++_0x398484);}(_0xb10b,0x12a));var _0xbb10=function(_0x3d0c0a,_0x569519){_0x3d0c0a=_0x3d0c0a-0x0;var _0x338e0e=_0xb10b[_0x3d0c0a];return _0x338e0e;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')](_0x378da8['body'],{'raw':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![]})[_0xbb10('0xc')](function(_0xdf237d){logger[_0xbb10('0xd')]('CreateCmHopperFinal',_0x378da8);logger[_0xbb10('0x1a')](_0xbb10('0x15'),_0x378da8,JSON['stringify'](_0xdf237d));_0x575cca(_0xdf237d);})['catch'](function(_0x8e2b97){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x8e2b97[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x8e2b97[_0xbb10('0x13')]));});});};
\ No newline at end of file
index c1a51ac..ea32bde 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd19f=['put','update','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','isAuthenticated','index','/describe','get','/:id','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','moveContactsIvrCampaignHopperFinal','/checkContactHopper'];(function(_0x24235f,_0x12ee7e){var _0x10cb40=function(_0x23723a){while(--_0x23723a){_0x24235f['push'](_0x24235f['shift']());}};_0x10cb40(++_0x12ee7e);}(_0xd19f,0x161));var _0xfd19=function(_0x5cc8,_0x1faa02){_0x5cc8=_0x5cc8-0x0;var _0x450661=_0xd19f[_0x5cc8];return _0x450661;};'use strict';var multer=require(_0xfd19('0x0'));var util=require(_0xfd19('0x1'));var path=require(_0xfd19('0x2'));var timeout=require('connect-timeout');var express=require(_0xfd19('0x3'));var router=express[_0xfd19('0x4')]();var fs_extra=require(_0xfd19('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xfd19('0x6'));var config=require(_0xfd19('0x7'));var controller=require(_0xfd19('0x8'));router['get']('/',auth[_0xfd19('0x9')](),controller[_0xfd19('0xa')]);router['get'](_0xfd19('0xb'),auth[_0xfd19('0x9')](),controller['describe']);router[_0xfd19('0xc')](_0xfd19('0xd'),auth[_0xfd19('0x9')](),controller[_0xfd19('0xe')]);router[_0xfd19('0xc')](_0xfd19('0xf'),auth[_0xfd19('0x9')](),controller[_0xfd19('0x10')]);router[_0xfd19('0xc')](_0xfd19('0x11'),auth['isAuthenticated'](),controller[_0xfd19('0x12')]);router[_0xfd19('0x13')]('/voice/queue/moveContacts/:id',auth[_0xfd19('0x9')](),controller['moveContactsQueueCampaignHopperFinal']);router['post']('/voice/campaign/moveContacts/:id',auth[_0xfd19('0x9')](),controller[_0xfd19('0x14')]);router[_0xfd19('0x13')](_0xfd19('0x15'),auth[_0xfd19('0x9')](),controller['checkContactHopper']);router[_0xfd19('0x16')](_0xfd19('0xd'),auth[_0xfd19('0x9')](),controller[_0xfd19('0x17')]);module[_0xfd19('0x18')]=router;
\ No newline at end of file
+var _0x283b=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','index','get','describe','/:id','isAuthenticated','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper','put','update','exports'];(function(_0x119d5a,_0x19b457){var _0x15bff4=function(_0x1b7c78){while(--_0x1b7c78){_0x119d5a['push'](_0x119d5a['shift']());}};_0x15bff4(++_0x19b457);}(_0x283b,0x188));var _0xb283=function(_0x2993e4,_0x2af2db){_0x2993e4=_0x2993e4-0x0;var _0x4167b5=_0x283b[_0x2993e4];return _0x4167b5;};'use strict';var multer=require(_0xb283('0x0'));var util=require(_0xb283('0x1'));var path=require(_0xb283('0x2'));var timeout=require(_0xb283('0x3'));var express=require(_0xb283('0x4'));var router=express[_0xb283('0x5')]();var fs_extra=require(_0xb283('0x6'));var auth=require(_0xb283('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./cmHopperFinal.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xb283('0x8')]);router[_0xb283('0x9')]('/describe',auth['isAuthenticated'](),controller[_0xb283('0xa')]);router[_0xb283('0x9')](_0xb283('0xb'),auth[_0xb283('0xc')](),controller[_0xb283('0xd')]);router[_0xb283('0x9')](_0xb283('0xe'),auth[_0xb283('0xc')](),controller[_0xb283('0xf')]);router[_0xb283('0x9')](_0xb283('0x10'),auth[_0xb283('0xc')](),controller[_0xb283('0x11')]);router[_0xb283('0x12')](_0xb283('0x13'),auth[_0xb283('0xc')](),controller[_0xb283('0x14')]);router[_0xb283('0x12')](_0xb283('0x15'),auth['isAuthenticated'](),controller[_0xb283('0x16')]);router['post'](_0xb283('0x17'),auth[_0xb283('0xc')](),controller[_0xb283('0x18')]);router[_0xb283('0x19')](_0xb283('0xb'),auth[_0xb283('0xc')](),controller[_0xb283('0x1a')]);module[_0xb283('0x1b')]=router;
\ No newline at end of file
index 015f37b..454de42 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd4ad=['INTEGER','STRING','DATE','BOOLEAN','sequelize','exports'];(function(_0x1b5a5a,_0x1c3b75){var _0x42b32d=function(_0x3d35ab){while(--_0x3d35ab){_0x1b5a5a['push'](_0x1b5a5a['shift']());}};_0x42b32d(++_0x1c3b75);}(_0xd4ad,0x1e4));var _0xdd4a=function(_0x1e3cf4,_0x401572){_0x1e3cf4=_0x1e3cf4-0x0;var _0x3ad992=_0xd4ad[_0x1e3cf4];return _0x3ad992;};'use strict';var Sequelize=require(_0xdd4a('0x0'));module[_0xdd4a('0x1')]={'state':{'type':Sequelize[_0xdd4a('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xdd4a('0x3')]},'scheduledat':{'type':Sequelize[_0xdd4a('0x4')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xdd4a('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xdd4a('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xdd4a('0x3')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0xdd4a('0x4')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0xdd4a('0x4')]},'endtime':{'type':Sequelize[_0xdd4a('0x4')]},'ringtime':{'type':Sequelize[_0xdd4a('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xdd4a('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xdd4a('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xdd4a('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0xdd4a('0x3')]},'campaigntype':{'type':Sequelize[_0xdd4a('0x3')]},'membername':{'type':Sequelize[_0xdd4a('0x3')]},'reason':{'type':Sequelize['STRING']},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0xdd4a('0x5')],'defaultValue':![]},'callback':{'type':Sequelize[_0xdd4a('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0xdd4a('0x4')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'editedat':{'type':Sequelize[_0xdd4a('0x4')]},'edited':{'type':Sequelize[_0xdd4a('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0xdd4a('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xdd4a('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xdd4a('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xdd4a('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xdd4a('0x2')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x3e0c=['exports','INTEGER','DATE','STRING','BOOLEAN','sequelize'];(function(_0x263a0a,_0x2aebeb){var _0x9fdcb=function(_0x335ae4){while(--_0x335ae4){_0x263a0a['push'](_0x263a0a['shift']());}};_0x9fdcb(++_0x2aebeb);}(_0x3e0c,0x16d));var _0xc3e0=function(_0x2a3982,_0x4b55ab){_0x2a3982=_0x2a3982-0x0;var _0x1a72c2=_0x3e0c[_0x2a3982];return _0x1a72c2;};'use strict';var Sequelize=require(_0xc3e0('0x0'));module[_0xc3e0('0x1')]={'state':{'type':Sequelize[_0xc3e0('0x2')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0xc3e0('0x3')]},'countbusyretry':{'type':Sequelize[_0xc3e0('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xc3e0('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xc3e0('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xc3e0('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0xc3e0('0x4')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0xc3e0('0x3')]},'answertime':{'type':Sequelize[_0xc3e0('0x3')]},'droptime':{'type':Sequelize[_0xc3e0('0x3')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xc3e0('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xc3e0('0x4')]},'campaign':{'type':Sequelize[_0xc3e0('0x4')]},'campaigntype':{'type':Sequelize[_0xc3e0('0x4')]},'membername':{'type':Sequelize[_0xc3e0('0x4')]},'reason':{'type':Sequelize[_0xc3e0('0x4')]},'amd':{'type':Sequelize[_0xc3e0('0x5')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callback':{'type':Sequelize[_0xc3e0('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0xc3e0('0x3')]},'recallme':{'type':Sequelize[_0xc3e0('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize['DATE']},'edited':{'type':Sequelize[_0xc3e0('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xc3e0('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xc3e0('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xc3e0('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xc3e0('0x2')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0xc3e0('0x4')]}};
\ No newline at end of file
index 5dfd54e..3678163 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9421=['path','sox','ejs','fs-extra','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/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','set','json','apply','save','update','then','destroy','name','send','index','map','CmHopperHistory','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','count','include','findAll','rows','catch','params','includeAll','create','body','describe','uniqueid','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util'];(function(_0x2b2d06,_0x48d8e8){var _0xb5d9e8=function(_0x45a367){while(--_0x45a367){_0x2b2d06['push'](_0x2b2d06['shift']());}};_0xb5d9e8(++_0x48d8e8);}(_0x9421,0xe4));var _0x1942=function(_0x460765,_0x30f733){_0x460765=_0x460765-0x0;var _0x22ee7e=_0x9421[_0x460765];return _0x22ee7e;};'use strict';var emlformat=require(_0x1942('0x0'));var rimraf=require(_0x1942('0x1'));var zipdir=require(_0x1942('0x2'));var jsonpatch=require(_0x1942('0x3'));var rp=require(_0x1942('0x4'));var moment=require(_0x1942('0x5'));var BPromise=require(_0x1942('0x6'));var Mustache=require(_0x1942('0x7'));var util=require(_0x1942('0x8'));var path=require(_0x1942('0x9'));var sox=require(_0x1942('0xa'));var csv=require('to-csv');var ejs=require(_0x1942('0xb'));var fs=require('fs');var fs_extra=require(_0x1942('0xc'));var _=require(_0x1942('0xd'));var squel=require(_0x1942('0xe'));var crypto=require('crypto');var jsforce=require(_0x1942('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x1942('0x10'));var querystring=require(_0x1942('0x11'));var Papa=require(_0x1942('0x12'));var Redis=require(_0x1942('0x13'));var authService=require(_0x1942('0x14'));var qs=require(_0x1942('0x15'));var as=require(_0x1942('0x16'));var hardwareService=require(_0x1942('0x17'));var logger=require(_0x1942('0x18'))(_0x1942('0x19'));var utils=require(_0x1942('0x1a'));var config=require('../../config/environment');var licenseUtil=require(_0x1942('0x1b'));var db=require(_0x1942('0x1c'))['db'];function respondWithStatusCode(_0xee0b2c,_0x4bd3d1){_0x4bd3d1=_0x4bd3d1||0xcc;return function(_0x4999fd){if(_0x4999fd){return _0xee0b2c[_0x1942('0x1d')](_0x4bd3d1);}return _0xee0b2c['status'](_0x4bd3d1)[_0x1942('0x1e')]();};}function respondWithResult(_0x132fcf,_0x487039){_0x487039=_0x487039||0xc8;return function(_0x211c25){if(_0x211c25){return _0x132fcf[_0x1942('0x1f')](_0x487039)['json'](_0x211c25);}};}function respondWithFilteredResult(_0x320d2b,_0x16f9e3){return function(_0x3d3182){if(_0x3d3182){var _0x4b47c5=typeof _0x16f9e3[_0x1942('0x20')]===_0x1942('0x21')&&typeof _0x16f9e3[_0x1942('0x22')]===_0x1942('0x21');var _0x2defb9=_0x3d3182['count'];var _0x29eb09=_0x4b47c5?0x0:_0x16f9e3[_0x1942('0x20')];var _0x2ea2dd=_0x4b47c5?_0x3d3182['count']:_0x16f9e3[_0x1942('0x20')]+_0x16f9e3['limit'];var _0x204705;if(_0x2ea2dd>=_0x2defb9){_0x2ea2dd=_0x2defb9;_0x204705=0xc8;}else{_0x204705=0xce;}_0x320d2b[_0x1942('0x1f')](_0x204705);return _0x320d2b[_0x1942('0x23')]('Content-Range',_0x29eb09+'-'+_0x2ea2dd+'/'+_0x2defb9)[_0x1942('0x24')](_0x3d3182);}return null;};}function patchUpdates(_0x39e82c){return function(_0x4bda48){try{jsonpatch[_0x1942('0x25')](_0x4bda48,_0x39e82c,!![]);}catch(_0x139245){return BPromise['reject'](_0x139245);}return _0x4bda48[_0x1942('0x26')]();};}function saveUpdates(_0x2f8ebb,_0x288e49){return function(_0x3c3fc7){if(_0x3c3fc7){return _0x3c3fc7[_0x1942('0x27')](_0x2f8ebb)[_0x1942('0x28')](function(_0x574162){return _0x574162;});}return null;};}function removeEntity(_0x4804ed,_0x56742f){return function(_0x38c0bc){if(_0x38c0bc){return _0x38c0bc[_0x1942('0x29')]()['then'](function(){_0x4804ed[_0x1942('0x1f')](0xcc)[_0x1942('0x1e')]();});}};}function handleEntityNotFound(_0x17432c,_0x43831e){return function(_0x340b96){if(!_0x340b96){_0x17432c[_0x1942('0x1d')](0x194);}return _0x340b96;};}function handleError(_0x49aa2b,_0x1bc98c){_0x1bc98c=_0x1bc98c||0x1f4;return function(_0x24e46a){logger['error'](_0x24e46a['stack']);if(_0x24e46a[_0x1942('0x2a')]){delete _0x24e46a[_0x1942('0x2a')];}_0x49aa2b['status'](_0x1bc98c)[_0x1942('0x2b')](_0x24e46a);};}exports[_0x1942('0x2c')]=function(_0x238966,_0x40d5bb){var _0x39799d={},_0xc0bf78={},_0x444674={'count':0x0,'rows':[]};var _0x2eaf43=_[_0x1942('0x2d')](db[_0x1942('0x2e')][_0x1942('0x2f')],function(_0x35334e){return{'name':_0x35334e['fieldName'],'type':_0x35334e['type'][_0x1942('0x30')]};});_0xc0bf78[_0x1942('0x31')]=_[_0x1942('0x2d')](_0x2eaf43,_0x1942('0x2a'));_0xc0bf78[_0x1942('0x32')]=_[_0x1942('0x33')](_0x238966[_0x1942('0x32')]);_0xc0bf78[_0x1942('0x34')]=_[_0x1942('0x35')](_0xc0bf78[_0x1942('0x31')],_0xc0bf78[_0x1942('0x32')]);_0x39799d[_0x1942('0x36')]=_['intersection'](_0xc0bf78[_0x1942('0x31')],qs[_0x1942('0x37')](_0x238966['query']['fields']));_0x39799d[_0x1942('0x36')]=_0x39799d[_0x1942('0x36')][_0x1942('0x38')]?_0x39799d[_0x1942('0x36')]:_0xc0bf78[_0x1942('0x31')];if(!_0x238966['query'][_0x1942('0x39')](_0x1942('0x3a'))){_0x39799d[_0x1942('0x22')]=qs[_0x1942('0x22')](_0x238966[_0x1942('0x32')][_0x1942('0x22')]);_0x39799d['offset']=qs['offset'](_0x238966[_0x1942('0x32')][_0x1942('0x20')]);}_0x39799d[_0x1942('0x3b')]=qs['sort'](_0x238966['query'][_0x1942('0x3c')]);_0x39799d['where']=qs[_0x1942('0x34')](_[_0x1942('0x3d')](_0x238966[_0x1942('0x32')],_0xc0bf78['filters']),_0x2eaf43);if(_0x238966['query'][_0x1942('0x3e')]){_0x39799d[_0x1942('0x3f')]=_[_0x1942('0x40')](_0x39799d[_0x1942('0x3f')],{'$or':_['map'](_0x2eaf43,function(_0x387d75){if(_0x387d75['type']!==_0x1942('0x41')){var _0x94546c={};_0x94546c[_0x387d75[_0x1942('0x2a')]]={'$like':'%'+_0x238966[_0x1942('0x32')][_0x1942('0x3e')]+'%'};return _0x94546c;}})});}_0x39799d=_[_0x1942('0x40')]({},_0x39799d,_0x238966[_0x1942('0x42')]);var _0x4e35a0={'where':_0x39799d['where']};return db['CmHopperHistory']['count'](_0x4e35a0)[_0x1942('0x28')](function(_0x512720){_0x444674[_0x1942('0x43')]=_0x512720;if(_0x238966['query']['includeAll']){_0x39799d[_0x1942('0x44')]=[{'all':!![]}];}return db[_0x1942('0x2e')][_0x1942('0x45')](_0x39799d);})[_0x1942('0x28')](function(_0x3b3166){_0x444674[_0x1942('0x46')]=_0x3b3166;return _0x444674;})['then'](respondWithFilteredResult(_0x40d5bb,_0x39799d))[_0x1942('0x47')](handleError(_0x40d5bb,null));};exports['show']=function(_0x268a41,_0x187fd3){var _0xa6ea75={'raw':!![],'where':{'id':_0x268a41[_0x1942('0x48')]['id']}},_0x518abe={};_0x518abe['model']=_[_0x1942('0x33')](db[_0x1942('0x2e')][_0x1942('0x2f')]);_0x518abe[_0x1942('0x32')]=_[_0x1942('0x33')](_0x268a41[_0x1942('0x32')]);_0x518abe[_0x1942('0x34')]=_['intersection'](_0x518abe['model'],_0x518abe[_0x1942('0x32')]);_0xa6ea75[_0x1942('0x36')]=_['intersection'](_0x518abe[_0x1942('0x31')],qs[_0x1942('0x37')](_0x268a41[_0x1942('0x32')]['fields']));_0xa6ea75[_0x1942('0x36')]=_0xa6ea75[_0x1942('0x36')][_0x1942('0x38')]?_0xa6ea75[_0x1942('0x36')]:_0x518abe[_0x1942('0x31')];if(_0x268a41[_0x1942('0x32')][_0x1942('0x49')]){_0xa6ea75['include']=[{'all':!![]}];}_0xa6ea75=_[_0x1942('0x40')]({},_0xa6ea75,_0x268a41[_0x1942('0x42')]);return db[_0x1942('0x2e')]['find'](_0xa6ea75)[_0x1942('0x28')](handleEntityNotFound(_0x187fd3,null))[_0x1942('0x28')](respondWithResult(_0x187fd3,null))[_0x1942('0x47')](handleError(_0x187fd3,null));};exports[_0x1942('0x4a')]=function(_0x1ca3ac,_0x2045c5){return db[_0x1942('0x2e')]['create'](_0x1ca3ac[_0x1942('0x4b')],{})[_0x1942('0x28')](respondWithResult(_0x2045c5,0xc9))[_0x1942('0x47')](handleError(_0x2045c5,null));};exports[_0x1942('0x4c')]=function(_0x420208,_0x5cca11){return db['CmHopperHistory']['describe']()['then'](respondWithResult(_0x5cca11,null))[_0x1942('0x47')](handleError(_0x5cca11,null));};exports['update']=function(_0x8e69dc,_0x541d91){if(_0x8e69dc['body'][_0x1942('0x4d')]){delete _0x8e69dc['body'][_0x1942('0x4d')];}return db[_0x1942('0x2e')][_0x1942('0x4e')]({'where':{'uniqueid':_0x8e69dc[_0x1942('0x48')]['id']}})['then'](handleEntityNotFound(_0x541d91,null))[_0x1942('0x28')](saveUpdates(_0x8e69dc[_0x1942('0x4b')],null))[_0x1942('0x28')](respondWithResult(_0x541d91,null))[_0x1942('0x47')](handleError(_0x541d91,null));};
\ No newline at end of file
+var _0xf8cb=['limit','count','set','reject','save','then','destroy','stack','name','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','VIRTUAL','include','CmHopperHistory','findAll','rows','catch','show','params','includeAll','options','find','create','body','describe','update','uniqueid','rimraf','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset'];(function(_0x450d4e,_0xcacc3){var _0x300304=function(_0x49ab27){while(--_0x49ab27){_0x450d4e['push'](_0x450d4e['shift']());}};_0x300304(++_0xcacc3);}(_0xf8cb,0x71));var _0xbf8c=function(_0x5b490a,_0x58ad91){_0x5b490a=_0x5b490a-0x0;var _0x71482c=_0xf8cb[_0x5b490a];return _0x71482c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbf8c('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbf8c('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xbf8c('0x2'));var Mustache=require(_0xbf8c('0x3'));var util=require(_0xbf8c('0x4'));var path=require(_0xbf8c('0x5'));var sox=require(_0xbf8c('0x6'));var csv=require(_0xbf8c('0x7'));var ejs=require(_0xbf8c('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xbf8c('0x9'));var crypto=require(_0xbf8c('0xa'));var jsforce=require(_0xbf8c('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xbf8c('0x7'));var querystring=require(_0xbf8c('0xc'));var Papa=require('papaparse');var Redis=require(_0xbf8c('0xd'));var authService=require(_0xbf8c('0xe'));var qs=require(_0xbf8c('0xf'));var as=require(_0xbf8c('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbf8c('0x11'))(_0xbf8c('0x12'));var utils=require(_0xbf8c('0x13'));var config=require(_0xbf8c('0x14'));var licenseUtil=require(_0xbf8c('0x15'));var db=require(_0xbf8c('0x16'))['db'];function respondWithStatusCode(_0x67f209,_0x1b1ca1){_0x1b1ca1=_0x1b1ca1||0xcc;return function(_0x2a4959){if(_0x2a4959){return _0x67f209['sendStatus'](_0x1b1ca1);}return _0x67f209[_0xbf8c('0x17')](_0x1b1ca1)[_0xbf8c('0x18')]();};}function respondWithResult(_0x5ba0bd,_0x106363){_0x106363=_0x106363||0xc8;return function(_0x33185b){if(_0x33185b){return _0x5ba0bd[_0xbf8c('0x17')](_0x106363)[_0xbf8c('0x19')](_0x33185b);}};}function respondWithFilteredResult(_0x4e42c0,_0x28ddf5){return function(_0xc4d57){if(_0xc4d57){var _0x2836a2=typeof _0x28ddf5[_0xbf8c('0x1a')]==='undefined'&&typeof _0x28ddf5[_0xbf8c('0x1b')]==='undefined';var _0xe6fb36=_0xc4d57[_0xbf8c('0x1c')];var _0x5a1fd3=_0x2836a2?0x0:_0x28ddf5[_0xbf8c('0x1a')];var _0x28e7ce=_0x2836a2?_0xc4d57['count']:_0x28ddf5['offset']+_0x28ddf5['limit'];var _0x2c9e2d;if(_0x28e7ce>=_0xe6fb36){_0x28e7ce=_0xe6fb36;_0x2c9e2d=0xc8;}else{_0x2c9e2d=0xce;}_0x4e42c0['status'](_0x2c9e2d);return _0x4e42c0[_0xbf8c('0x1d')]('Content-Range',_0x5a1fd3+'-'+_0x28e7ce+'/'+_0xe6fb36)[_0xbf8c('0x19')](_0xc4d57);}return null;};}function patchUpdates(_0x502f1a){return function(_0x2c8931){try{jsonpatch['apply'](_0x2c8931,_0x502f1a,!![]);}catch(_0x2768e0){return BPromise[_0xbf8c('0x1e')](_0x2768e0);}return _0x2c8931[_0xbf8c('0x1f')]();};}function saveUpdates(_0x210b4d,_0x24ed67){return function(_0x17845e){if(_0x17845e){return _0x17845e['update'](_0x210b4d)[_0xbf8c('0x20')](function(_0x3f939d){return _0x3f939d;});}return null;};}function removeEntity(_0x4c55eb,_0x54b62c){return function(_0x4fe1e9){if(_0x4fe1e9){return _0x4fe1e9[_0xbf8c('0x21')]()[_0xbf8c('0x20')](function(){_0x4c55eb[_0xbf8c('0x17')](0xcc)[_0xbf8c('0x18')]();});}};}function handleEntityNotFound(_0x32506e,_0x51d962){return function(_0x35317c){if(!_0x35317c){_0x32506e['sendStatus'](0x194);}return _0x35317c;};}function handleError(_0x3597fa,_0x280d4e){_0x280d4e=_0x280d4e||0x1f4;return function(_0x801fd4){logger['error'](_0x801fd4[_0xbf8c('0x22')]);if(_0x801fd4[_0xbf8c('0x23')]){delete _0x801fd4[_0xbf8c('0x23')];}_0x3597fa[_0xbf8c('0x17')](_0x280d4e)['send'](_0x801fd4);};}exports['index']=function(_0x340401,_0x10c1d6){var _0x2ddaed={},_0x2f32b7={},_0x1c1b07={'count':0x0,'rows':[]};var _0xe6ec4a=_[_0xbf8c('0x24')](db['CmHopperHistory'][_0xbf8c('0x25')],function(_0x145117){return{'name':_0x145117[_0xbf8c('0x26')],'type':_0x145117[_0xbf8c('0x27')][_0xbf8c('0x28')]};});_0x2f32b7[_0xbf8c('0x29')]=_['map'](_0xe6ec4a,_0xbf8c('0x23'));_0x2f32b7[_0xbf8c('0x2a')]=_[_0xbf8c('0x2b')](_0x340401['query']);_0x2f32b7[_0xbf8c('0x2c')]=_[_0xbf8c('0x2d')](_0x2f32b7[_0xbf8c('0x29')],_0x2f32b7['query']);_0x2ddaed[_0xbf8c('0x2e')]=_['intersection'](_0x2f32b7[_0xbf8c('0x29')],qs[_0xbf8c('0x2f')](_0x340401[_0xbf8c('0x2a')][_0xbf8c('0x2f')]));_0x2ddaed['attributes']=_0x2ddaed[_0xbf8c('0x2e')][_0xbf8c('0x30')]?_0x2ddaed[_0xbf8c('0x2e')]:_0x2f32b7[_0xbf8c('0x29')];if(!_0x340401[_0xbf8c('0x2a')][_0xbf8c('0x31')](_0xbf8c('0x32'))){_0x2ddaed[_0xbf8c('0x1b')]=qs[_0xbf8c('0x1b')](_0x340401[_0xbf8c('0x2a')][_0xbf8c('0x1b')]);_0x2ddaed[_0xbf8c('0x1a')]=qs['offset'](_0x340401[_0xbf8c('0x2a')]['offset']);}_0x2ddaed['order']=qs[_0xbf8c('0x33')](_0x340401['query'][_0xbf8c('0x33')]);_0x2ddaed[_0xbf8c('0x34')]=qs[_0xbf8c('0x2c')](_[_0xbf8c('0x35')](_0x340401[_0xbf8c('0x2a')],_0x2f32b7[_0xbf8c('0x2c')]),_0xe6ec4a);if(_0x340401[_0xbf8c('0x2a')]['filter']){_0x2ddaed[_0xbf8c('0x34')]=_['merge'](_0x2ddaed[_0xbf8c('0x34')],{'$or':_[_0xbf8c('0x24')](_0xe6ec4a,function(_0x1cdbe2){if(_0x1cdbe2[_0xbf8c('0x27')]!==_0xbf8c('0x36')){var _0x3df3ca={};_0x3df3ca[_0x1cdbe2[_0xbf8c('0x23')]]={'$like':'%'+_0x340401[_0xbf8c('0x2a')]['filter']+'%'};return _0x3df3ca;}})});}_0x2ddaed=_['merge']({},_0x2ddaed,_0x340401['options']);var _0x226520={'where':_0x2ddaed[_0xbf8c('0x34')]};return db['CmHopperHistory'][_0xbf8c('0x1c')](_0x226520)[_0xbf8c('0x20')](function(_0x5a759e){_0x1c1b07[_0xbf8c('0x1c')]=_0x5a759e;if(_0x340401[_0xbf8c('0x2a')]['includeAll']){_0x2ddaed[_0xbf8c('0x37')]=[{'all':!![]}];}return db[_0xbf8c('0x38')][_0xbf8c('0x39')](_0x2ddaed);})[_0xbf8c('0x20')](function(_0x20375b){_0x1c1b07[_0xbf8c('0x3a')]=_0x20375b;return _0x1c1b07;})[_0xbf8c('0x20')](respondWithFilteredResult(_0x10c1d6,_0x2ddaed))[_0xbf8c('0x3b')](handleError(_0x10c1d6,null));};exports[_0xbf8c('0x3c')]=function(_0x50f565,_0x114835){var _0x22365f={'raw':!![],'where':{'id':_0x50f565[_0xbf8c('0x3d')]['id']}},_0x9c99be={};_0x9c99be[_0xbf8c('0x29')]=_[_0xbf8c('0x2b')](db[_0xbf8c('0x38')][_0xbf8c('0x25')]);_0x9c99be[_0xbf8c('0x2a')]=_[_0xbf8c('0x2b')](_0x50f565[_0xbf8c('0x2a')]);_0x9c99be['filters']=_['intersection'](_0x9c99be[_0xbf8c('0x29')],_0x9c99be[_0xbf8c('0x2a')]);_0x22365f[_0xbf8c('0x2e')]=_['intersection'](_0x9c99be[_0xbf8c('0x29')],qs[_0xbf8c('0x2f')](_0x50f565['query'][_0xbf8c('0x2f')]));_0x22365f[_0xbf8c('0x2e')]=_0x22365f[_0xbf8c('0x2e')][_0xbf8c('0x30')]?_0x22365f[_0xbf8c('0x2e')]:_0x9c99be[_0xbf8c('0x29')];if(_0x50f565[_0xbf8c('0x2a')][_0xbf8c('0x3e')]){_0x22365f[_0xbf8c('0x37')]=[{'all':!![]}];}_0x22365f=_['merge']({},_0x22365f,_0x50f565[_0xbf8c('0x3f')]);return db['CmHopperHistory'][_0xbf8c('0x40')](_0x22365f)[_0xbf8c('0x20')](handleEntityNotFound(_0x114835,null))[_0xbf8c('0x20')](respondWithResult(_0x114835,null))['catch'](handleError(_0x114835,null));};exports['create']=function(_0x53a7dc,_0xa8577f){return db['CmHopperHistory'][_0xbf8c('0x41')](_0x53a7dc[_0xbf8c('0x42')],{})[_0xbf8c('0x20')](respondWithResult(_0xa8577f,0xc9))[_0xbf8c('0x3b')](handleError(_0xa8577f,null));};exports['describe']=function(_0x5d74a2,_0x49a01c){return db[_0xbf8c('0x38')][_0xbf8c('0x43')]()[_0xbf8c('0x20')](respondWithResult(_0x49a01c,null))[_0xbf8c('0x3b')](handleError(_0x49a01c,null));};exports[_0xbf8c('0x44')]=function(_0x1eaa20,_0xd5313f){if(_0x1eaa20[_0xbf8c('0x42')]['uniqueid']){delete _0x1eaa20['body'][_0xbf8c('0x45')];}return db[_0xbf8c('0x38')]['find']({'where':{'uniqueid':_0x1eaa20['params']['id']}})[_0xbf8c('0x20')](handleEntityNotFound(_0xd5313f,null))[_0xbf8c('0x20')](saveUpdates(_0x1eaa20[_0xbf8c('0x42')],null))[_0xbf8c('0x20')](respondWithResult(_0xd5313f,null))[_0xbf8c('0x3b')](handleError(_0xd5313f,null));};
\ No newline at end of file
index 42dafcf..1b4f0d5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5eef=['endtime','uniqueid','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./cmHopperHistory.attributes','define','CmHopperHistory'];(function(_0xf6c9e5,_0x32a095){var _0x447edc=function(_0x28e953){while(--_0x28e953){_0xf6c9e5['push'](_0xf6c9e5['shift']());}};_0x447edc(++_0x32a095);}(_0x5eef,0x9c));var _0xf5ee=function(_0x495949,_0x7ee99){_0x495949=_0x495949-0x0;var _0x4551a0=_0x5eef[_0x495949];return _0x4551a0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xf5ee('0x0'))('api');var moment=require(_0xf5ee('0x1'));var BPromise=require('bluebird');var rp=require(_0xf5ee('0x2'));var fs=require('fs');var path=require(_0xf5ee('0x3'));var rimraf=require(_0xf5ee('0x4'));var config=require(_0xf5ee('0x5'));var attributes=require(_0xf5ee('0x6'));module['exports']=function(_0x4d4175,_0x594128){return _0x4d4175[_0xf5ee('0x7')](_0xf5ee('0x8'),attributes,{'tableName':'cm_hopper_history','paranoid':![],'indexes':[{'name':_0xf5ee('0x9'),'fields':[_0xf5ee('0x9')]},{'name':_0xf5ee('0xa'),'fields':[_0xf5ee('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xd1d3=['rimraf','./cmHopperHistory.attributes','exports','define','cm_hopper_history','endtime','uniqueid','lodash','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xd1d3,0xd7));var _0x3d1d=function(_0x3f0a9b,_0x1f2b9b){_0x3f0a9b=_0x3f0a9b-0x0;var _0xb989a0=_0xd1d3[_0x3f0a9b];return _0xb989a0;};'use strict';var _=require(_0x3d1d('0x0'));var util=require('util');var logger=require(_0x3d1d('0x1'))('api');var moment=require(_0x3d1d('0x2'));var BPromise=require(_0x3d1d('0x3'));var rp=require(_0x3d1d('0x4'));var fs=require('fs');var path=require(_0x3d1d('0x5'));var rimraf=require(_0x3d1d('0x6'));var config=require('../../config/environment');var attributes=require(_0x3d1d('0x7'));module[_0x3d1d('0x8')]=function(_0x55c165,_0x2d3a52){return _0x55c165[_0x3d1d('0x9')]('CmHopperHistory',attributes,{'tableName':_0x3d1d('0xa'),'paranoid':![],'indexes':[{'name':_0x3d1d('0xb'),'fields':[_0x3d1d('0xb')]},{'name':_0x3d1d('0xc'),'fields':[_0x3d1d('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
index b05b738..72dbad1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4746=['GetVoiceQueueHopperHistory','GetCampaignHopperHistory','findAll','campaign','ivrTotalCallsDays','ivrAnswerCallsDay','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','request\x20sent','debug','error','code','message','CmHopperHistory,\x20%s,\x20%s','info','catch','CmHopperHistory','create','body','options','raw','CreateCmHopperHistory','stringify','sequelize','COUNT','col','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalAvgHoldtime','AVG','`state`\x20=\x204,\x20`talktime`,\x20null','then','AvgHandleTime','where','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','outboundNoAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','`state`\x20=\x2020,\x201,\x20null','outboundReCallsDay'];(function(_0x2da611,_0x29ad49){var _0x100a95=function(_0x48a880){while(--_0x48a880){_0x2da611['push'](_0x2da611['shift']());}};_0x100a95(++_0x29ad49);}(_0x4746,0xc6));var _0x6474=function(_0x34d177,_0xb67993){_0x34d177=_0x34d177-0x0;var _0x3c5780=_0x4746[_0x34d177];return _0x3c5780;};'use strict';var _=require(_0x6474('0x0'));var util=require(_0x6474('0x1'));var moment=require('moment');var BPromise=require(_0x6474('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6474('0x3'));var db=require(_0x6474('0x4'))['db'];var utils=require(_0x6474('0x5'));var logger=require(_0x6474('0x6'))(_0x6474('0x7'));var config=require('../../config/environment');var jayson=require(_0x6474('0x8'));var client=jayson[_0x6474('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x433af9,_0x427f79,_0xcd065e){return new BPromise(function(_0xec3cda,_0x15d4c2){return client[_0x6474('0xa')](_0x433af9,_0xcd065e)['then'](function(_0x1bc38b){logger['info']('CmHopperHistory,\x20%s,\x20%s',_0x427f79,_0x6474('0xb'));logger[_0x6474('0xc')]('CmHopperHistory,\x20%s,\x20%s,\x20%s',_0x427f79,_0x6474('0xb'),JSON['stringify'](_0x1bc38b));if(_0x1bc38b[_0x6474('0xd')]){if(_0x1bc38b['error'][_0x6474('0xe')]===0x1f4){logger[_0x6474('0xd')]('CmHopperHistory,\x20%s,\x20%s',_0x427f79,_0x1bc38b['error']['message']);return _0x15d4c2(_0x1bc38b[_0x6474('0xd')][_0x6474('0xf')]);}logger[_0x6474('0xd')](_0x6474('0x10'),_0x427f79,_0x1bc38b[_0x6474('0xd')][_0x6474('0xf')]);return _0xec3cda(_0x1bc38b[_0x6474('0xd')][_0x6474('0xf')]);}else{logger[_0x6474('0x11')]('CmHopperHistory,\x20%s,\x20%s',_0x427f79,'request\x20sent');_0xec3cda(_0x1bc38b['result'][_0x6474('0xf')]);}})[_0x6474('0x12')](function(_0x29c19b){logger[_0x6474('0xd')](_0x6474('0x10'),_0x427f79,_0x29c19b);_0x15d4c2(_0x29c19b);});});}exports['CreateCmHopperHistory']=function(_0x1505fc){var _0x7585ed=this;return new Promise(function(_0xb6ecb6,_0xc3448d){return db[_0x6474('0x13')][_0x6474('0x14')](_0x1505fc[_0x6474('0x15')],{'raw':_0x1505fc[_0x6474('0x16')]?_0x1505fc['options'][_0x6474('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0xd23b18){logger[_0x6474('0x11')](_0x6474('0x18'),_0x1505fc);logger[_0x6474('0xc')](_0x6474('0x18'),_0x1505fc,JSON[_0x6474('0x19')](_0xd23b18));_0xb6ecb6(_0xd23b18);})[_0x6474('0x12')](function(_0x5d0e5c){logger[_0x6474('0xd')]('CreateCmHopperHistory',_0x5d0e5c[_0x6474('0xf')],_0x1505fc);_0xc3448d(_0x7585ed['error'](0x1f4,_0x5d0e5c['message']));});});};exports['AvgHandleTime']=function(_0xb67896){var _0x340fb6=this;return new Promise(function(_0x444365,_0x18c1b3){return db[_0x6474('0x13')]['findAll']({'raw':_0xb67896[_0x6474('0x16')]?_0xb67896[_0x6474('0x16')][_0x6474('0x17')]===undefined?!![]:![]:!![],'where':_0xb67896[_0x6474('0x16')]?_0xb67896['options']['where']||null:null,'attributes':[[db[_0x6474('0x1a')]['fn'](_0x6474('0x1b'),db[_0x6474('0x1a')][_0x6474('0x1c')]('id')),'predictiveIntervalTotalCalls'],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x6474('0x1a')][_0x6474('0x1d')](_0x6474('0x1e')))),_0x6474('0x1f')],[db['sequelize']['fn'](_0x6474('0x1b'),db[_0x6474('0x1a')]['fn']('IF',db[_0x6474('0x1a')][_0x6474('0x1d')](_0x6474('0x20')))),_0x6474('0x21')],[db[_0x6474('0x1a')]['fn']('COUNT',db[_0x6474('0x1a')]['fn']('IF',db[_0x6474('0x1a')][_0x6474('0x1d')](_0x6474('0x22')))),'predictiveIntervalDroppedCallsCallersExit'],[db['sequelize']['fn']('AVG',db[_0x6474('0x1a')]['fn']('IF',db[_0x6474('0x1a')][_0x6474('0x1d')]('`state`\x20=\x204,\x20`holdtime`,\x20null'))),_0x6474('0x23')],[db[_0x6474('0x1a')]['fn'](_0x6474('0x24'),db['sequelize']['fn']('IF',db[_0x6474('0x1a')][_0x6474('0x1d')](_0x6474('0x25')))),'predictiveIntervalAvgTalktime']]})[_0x6474('0x26')](function(_0x3fa507){logger['info'](_0x6474('0x27'),_0xb67896);logger[_0x6474('0xc')](_0x6474('0x27'),_0xb67896,JSON[_0x6474('0x19')](_0x3fa507));_0x444365(_0x3fa507);})[_0x6474('0x12')](function(_0x48483b){logger[_0x6474('0xd')](_0x6474('0x27'),_0x48483b['message'],_0xb67896);_0x18c1b3(_0x340fb6['error'](0x1f4,_0x48483b[_0x6474('0xf')]));});});};exports['GetVoiceQueueHopperHistory']=function(_0x405c09){var _0xfd636c=this;return new Promise(function(_0x34bda2,_0x410b6a){return db[_0x6474('0x13')]['findAll']({'raw':_0x405c09['options']?_0x405c09[_0x6474('0x16')][_0x6474('0x17')]===undefined?!![]:![]:!![],'where':_0x405c09[_0x6474('0x16')]?_0x405c09['options'][_0x6474('0x28')]||null:null,'attributes':[['campaign',_0x6474('0x29')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x6474('0x1a')][_0x6474('0x1d')](_0x6474('0x2a')))),_0x6474('0x2b')],[db[_0x6474('0x1a')]['fn'](_0x6474('0x1b'),db['sequelize']['fn']('IF',db[_0x6474('0x1a')][_0x6474('0x1d')]('`state`\x20=\x203,\x201,\x20null'))),_0x6474('0x2c')],[db[_0x6474('0x1a')]['fn'](_0x6474('0x1b'),db['sequelize']['fn']('IF',db[_0x6474('0x1a')][_0x6474('0x1d')](_0x6474('0x1e')))),'outboundAnswerCallsDay'],[db['sequelize']['fn'](_0x6474('0x1b'),db[_0x6474('0x1a')]['fn']('IF',db['sequelize'][_0x6474('0x1d')](_0x6474('0x2d')))),_0x6474('0x2e')],[db[_0x6474('0x1a')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x6474('0x1a')]['literal'](_0x6474('0x2f')))),_0x6474('0x30')],[db[_0x6474('0x1a')]['fn']('COUNT',db[_0x6474('0x1a')]['fn']('IF',db[_0x6474('0x1a')]['literal'](_0x6474('0x31')))),_0x6474('0x32')],[db[_0x6474('0x1a')]['fn'](_0x6474('0x1b'),db[_0x6474('0x1a')]['fn']('IF',db[_0x6474('0x1a')][_0x6474('0x1d')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x6474('0x33')],[db[_0x6474('0x1a')]['fn']('COUNT',db[_0x6474('0x1a')]['fn']('IF',db[_0x6474('0x1a')]['literal']('`state`\x20=\x2012,\x201,\x20null'))),'outboundUnknownCallsDay'],[db['sequelize']['fn'](_0x6474('0x1b'),db[_0x6474('0x1a')]['fn']('IF',db[_0x6474('0x1a')][_0x6474('0x1d')]('`state`\x20=\x2013,\x201,\x20null'))),_0x6474('0x34')],[db[_0x6474('0x1a')]['fn'](_0x6474('0x1b'),db[_0x6474('0x1a')]['fn']('IF',db[_0x6474('0x1a')][_0x6474('0x1d')]('`state`\x20=\x2014,\x201,\x20null'))),_0x6474('0x35')],[db[_0x6474('0x1a')]['fn'](_0x6474('0x1b'),db['sequelize']['fn']('IF',db[_0x6474('0x1a')][_0x6474('0x1d')]('`state`\x20=\x2018,\x201,\x20null'))),_0x6474('0x36')],[db[_0x6474('0x1a')]['fn'](_0x6474('0x1b'),db[_0x6474('0x1a')]['fn']('IF',db[_0x6474('0x1a')][_0x6474('0x1d')](_0x6474('0x37')))),'outboundAnswerAgiCallsDay'],[db[_0x6474('0x1a')]['fn'](_0x6474('0x1b'),db[_0x6474('0x1a')]['fn']('IF',db['sequelize'][_0x6474('0x1d')](_0x6474('0x38')))),_0x6474('0x36')],[db['sequelize']['fn']('COUNT',db[_0x6474('0x1a')]['fn']('IF',db[_0x6474('0x1a')]['literal']('`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null'))),_0x6474('0x39')]],'group':['campaign']})[_0x6474('0x26')](function(_0x409e55){logger[_0x6474('0x11')](_0x6474('0x3a'),_0x405c09);logger[_0x6474('0xc')](_0x6474('0x3a'),_0x405c09,JSON[_0x6474('0x19')](_0x409e55));_0x34bda2(_0x409e55);})[_0x6474('0x12')](function(_0x471372){logger[_0x6474('0xd')](_0x6474('0x3a'),_0x471372[_0x6474('0xf')],_0x405c09);_0x410b6a(_0xfd636c[_0x6474('0xd')](0x1f4,_0x471372['message']));});});};exports[_0x6474('0x3b')]=function(_0x5a5866){var _0x5a3c6b=this;return new Promise(function(_0x1fb309,_0x77b9a4){return db[_0x6474('0x13')][_0x6474('0x3c')]({'raw':_0x5a5866['options']?_0x5a5866[_0x6474('0x16')][_0x6474('0x17')]===undefined?!![]:![]:!![],'where':_0x5a5866[_0x6474('0x16')]?_0x5a5866[_0x6474('0x16')][_0x6474('0x28')]||null:null,'attributes':[[_0x6474('0x3d'),_0x6474('0x29')],[db[_0x6474('0x1a')]['fn'](_0x6474('0x1b'),db[_0x6474('0x1a')][_0x6474('0x1c')]('id')),_0x6474('0x3e')],[db['sequelize']['fn']('COUNT',db[_0x6474('0x1a')]['fn']('IF',db[_0x6474('0x1a')][_0x6474('0x1d')](_0x6474('0x1e')))),_0x6474('0x3f')]],'group':[_0x6474('0x3d')]})[_0x6474('0x26')](function(_0x4dbab5){logger['info'](_0x6474('0x3b'),_0x5a5866);logger[_0x6474('0xc')](_0x6474('0x3b'),_0x5a5866,JSON['stringify'](_0x4dbab5));_0x1fb309(_0x4dbab5);})[_0x6474('0x12')](function(_0x51aab6){logger['error'](_0x6474('0x3b'),_0x51aab6['message'],_0x5a5866);_0x77b9a4(_0x5a3c6b[_0x6474('0xd')](0x1f4,_0x51aab6[_0x6474('0xf')]));});});};
\ No newline at end of file
+var _0x876b=['predictiveIntervalDroppedCallsCallersExit','AVG','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','debug','GetVoiceQueueHopperHistory','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','campaign','GetCampaignHopperHistory','ivrAnswerCallsDay','moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','CmHopperHistory,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','CreateCmHopperHistory','CmHopperHistory','create','options','raw','then','AvgHandleTime','findAll','where','COUNT','sequelize','col','literal','`state`\x20=\x204,\x201,\x20null','`state`\x20=\x2010,\x201,\x20null','`state`\x20=\x2011,\x201,\x20null'];(function(_0x462224,_0x308a88){var _0x6839bc=function(_0x1ac2c2){while(--_0x1ac2c2){_0x462224['push'](_0x462224['shift']());}};_0x6839bc(++_0x308a88);}(_0x876b,0x1ba));var _0xb876=function(_0x296236,_0x224e5d){_0x296236=_0x296236-0x0;var _0x3c17f4=_0x876b[_0x296236];return _0x3c17f4;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xb876('0x0'));var BPromise=require(_0xb876('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb876('0x2'))['db'];var utils=require(_0xb876('0x3'));var logger=require('../../config/logger')(_0xb876('0x4'));var config=require(_0xb876('0x5'));var jayson=require(_0xb876('0x6'));var client=jayson['client'][_0xb876('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4353cf,_0x4b2634,_0x309bfd){return new BPromise(function(_0xcbf343,_0x1a79d3){return client[_0xb876('0x8')](_0x4353cf,_0x309bfd)['then'](function(_0x45bd6f){logger['info'](_0xb876('0x9'),_0x4b2634,_0xb876('0xa'));logger['debug']('CmHopperHistory,\x20%s,\x20%s,\x20%s',_0x4b2634,'request\x20sent',JSON[_0xb876('0xb')](_0x45bd6f));if(_0x45bd6f['error']){if(_0x45bd6f[_0xb876('0xc')][_0xb876('0xd')]===0x1f4){logger['error'](_0xb876('0x9'),_0x4b2634,_0x45bd6f[_0xb876('0xc')][_0xb876('0xe')]);return _0x1a79d3(_0x45bd6f[_0xb876('0xc')][_0xb876('0xe')]);}logger[_0xb876('0xc')](_0xb876('0x9'),_0x4b2634,_0x45bd6f[_0xb876('0xc')][_0xb876('0xe')]);return _0xcbf343(_0x45bd6f[_0xb876('0xc')][_0xb876('0xe')]);}else{logger[_0xb876('0xf')]('CmHopperHistory,\x20%s,\x20%s',_0x4b2634,_0xb876('0xa'));_0xcbf343(_0x45bd6f[_0xb876('0x10')][_0xb876('0xe')]);}})[_0xb876('0x11')](function(_0x2c7ad2){logger[_0xb876('0xc')]('CmHopperHistory,\x20%s,\x20%s',_0x4b2634,_0x2c7ad2);_0x1a79d3(_0x2c7ad2);});});}exports[_0xb876('0x12')]=function(_0x3da83a){var _0x4e2048=this;return new Promise(function(_0x5eb24a,_0x1e3561){return db[_0xb876('0x13')][_0xb876('0x14')](_0x3da83a['body'],{'raw':_0x3da83a[_0xb876('0x15')]?_0x3da83a[_0xb876('0x15')][_0xb876('0x16')]===undefined?!![]:![]:!![]})[_0xb876('0x17')](function(_0x10b085){logger['info']('CreateCmHopperHistory',_0x3da83a);logger['debug'](_0xb876('0x12'),_0x3da83a,JSON[_0xb876('0xb')](_0x10b085));_0x5eb24a(_0x10b085);})[_0xb876('0x11')](function(_0x115f17){logger['error'](_0xb876('0x12'),_0x115f17[_0xb876('0xe')],_0x3da83a);_0x1e3561(_0x4e2048[_0xb876('0xc')](0x1f4,_0x115f17[_0xb876('0xe')]));});});};exports[_0xb876('0x18')]=function(_0x351dc3){var _0x183e7e=this;return new Promise(function(_0x43d94a,_0x3589db){return db[_0xb876('0x13')][_0xb876('0x19')]({'raw':_0x351dc3[_0xb876('0x15')]?_0x351dc3[_0xb876('0x15')][_0xb876('0x16')]===undefined?!![]:![]:!![],'where':_0x351dc3[_0xb876('0x15')]?_0x351dc3[_0xb876('0x15')][_0xb876('0x1a')]||null:null,'attributes':[[db['sequelize']['fn'](_0xb876('0x1b'),db[_0xb876('0x1c')][_0xb876('0x1d')]('id')),'predictiveIntervalTotalCalls'],[db[_0xb876('0x1c')]['fn'](_0xb876('0x1b'),db[_0xb876('0x1c')]['fn']('IF',db['sequelize'][_0xb876('0x1e')](_0xb876('0x1f')))),'predictiveIntervalAnsweredCalls'],[db[_0xb876('0x1c')]['fn']('COUNT',db[_0xb876('0x1c')]['fn']('IF',db[_0xb876('0x1c')][_0xb876('0x1e')](_0xb876('0x20')))),'predictiveIntervalDroppedCallsTimeout'],[db[_0xb876('0x1c')]['fn'](_0xb876('0x1b'),db[_0xb876('0x1c')]['fn']('IF',db[_0xb876('0x1c')][_0xb876('0x1e')](_0xb876('0x21')))),_0xb876('0x22')],[db['sequelize']['fn'](_0xb876('0x23'),db[_0xb876('0x1c')]['fn']('IF',db[_0xb876('0x1c')]['literal']('`state`\x20=\x204,\x20`holdtime`,\x20null'))),_0xb876('0x24')],[db[_0xb876('0x1c')]['fn'](_0xb876('0x23'),db['sequelize']['fn']('IF',db[_0xb876('0x1c')]['literal'](_0xb876('0x25')))),_0xb876('0x26')]]})[_0xb876('0x17')](function(_0x5a0c8d){logger[_0xb876('0xf')](_0xb876('0x18'),_0x351dc3);logger[_0xb876('0x27')](_0xb876('0x18'),_0x351dc3,JSON[_0xb876('0xb')](_0x5a0c8d));_0x43d94a(_0x5a0c8d);})[_0xb876('0x11')](function(_0x36fef8){logger[_0xb876('0xc')]('AvgHandleTime',_0x36fef8['message'],_0x351dc3);_0x3589db(_0x183e7e[_0xb876('0xc')](0x1f4,_0x36fef8[_0xb876('0xe')]));});});};exports[_0xb876('0x28')]=function(_0x2371de){var _0x5e50ee=this;return new Promise(function(_0x3c644b,_0x3d162c){return db[_0xb876('0x13')][_0xb876('0x19')]({'raw':_0x2371de[_0xb876('0x15')]?_0x2371de[_0xb876('0x15')][_0xb876('0x16')]===undefined?!![]:![]:!![],'where':_0x2371de[_0xb876('0x15')]?_0x2371de['options'][_0xb876('0x1a')]||null:null,'attributes':[['campaign',_0xb876('0x29')],[db[_0xb876('0x1c')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xb876('0x1c')]['literal'](_0xb876('0x2a')))),_0xb876('0x2b')],[db[_0xb876('0x1c')]['fn'](_0xb876('0x1b'),db[_0xb876('0x1c')]['fn']('IF',db[_0xb876('0x1c')][_0xb876('0x1e')](_0xb876('0x2c')))),_0xb876('0x2d')],[db[_0xb876('0x1c')]['fn'](_0xb876('0x1b'),db['sequelize']['fn']('IF',db[_0xb876('0x1c')]['literal'](_0xb876('0x1f')))),'outboundAnswerCallsDay'],[db[_0xb876('0x1c')]['fn'](_0xb876('0x1b'),db[_0xb876('0x1c')]['fn']('IF',db[_0xb876('0x1c')][_0xb876('0x1e')](_0xb876('0x2e')))),_0xb876('0x2f')],[db[_0xb876('0x1c')]['fn'](_0xb876('0x1b'),db[_0xb876('0x1c')]['fn']('IF',db[_0xb876('0x1c')]['literal'](_0xb876('0x30')))),_0xb876('0x31')],[db[_0xb876('0x1c')]['fn']('COUNT',db[_0xb876('0x1c')]['fn']('IF',db['sequelize'][_0xb876('0x1e')](_0xb876('0x32')))),_0xb876('0x33')],[db['sequelize']['fn'](_0xb876('0x1b'),db['sequelize']['fn']('IF',db[_0xb876('0x1c')]['literal']('`state`\x20=\x2011\x20,\x201,\x20null'))),_0xb876('0x34')],[db[_0xb876('0x1c')]['fn']('COUNT',db[_0xb876('0x1c')]['fn']('IF',db[_0xb876('0x1c')][_0xb876('0x1e')]('`state`\x20=\x2012,\x201,\x20null'))),_0xb876('0x35')],[db[_0xb876('0x1c')]['fn'](_0xb876('0x1b'),db['sequelize']['fn']('IF',db[_0xb876('0x1c')]['literal'](_0xb876('0x36')))),_0xb876('0x37')],[db['sequelize']['fn'](_0xb876('0x1b'),db[_0xb876('0x1c')]['fn']('IF',db[_0xb876('0x1c')][_0xb876('0x1e')](_0xb876('0x38')))),_0xb876('0x39')],[db[_0xb876('0x1c')]['fn'](_0xb876('0x1b'),db[_0xb876('0x1c')]['fn']('IF',db[_0xb876('0x1c')][_0xb876('0x1e')](_0xb876('0x3a')))),_0xb876('0x3b')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xb876('0x1c')][_0xb876('0x1e')](_0xb876('0x3c')))),_0xb876('0x3d')],[db[_0xb876('0x1c')]['fn'](_0xb876('0x1b'),db[_0xb876('0x1c')]['fn']('IF',db[_0xb876('0x1c')]['literal'](_0xb876('0x3e')))),_0xb876('0x3b')],[db[_0xb876('0x1c')]['fn'](_0xb876('0x1b'),db['sequelize']['fn']('IF',db[_0xb876('0x1c')][_0xb876('0x1e')](_0xb876('0x3f')))),_0xb876('0x40')]],'group':[_0xb876('0x41')]})[_0xb876('0x17')](function(_0x4e683d){logger['info'](_0xb876('0x28'),_0x2371de);logger[_0xb876('0x27')](_0xb876('0x28'),_0x2371de,JSON[_0xb876('0xb')](_0x4e683d));_0x3c644b(_0x4e683d);})[_0xb876('0x11')](function(_0x5cd816){logger[_0xb876('0xc')](_0xb876('0x28'),_0x5cd816[_0xb876('0xe')],_0x2371de);_0x3d162c(_0x5e50ee[_0xb876('0xc')](0x1f4,_0x5cd816[_0xb876('0xe')]));});});};exports[_0xb876('0x42')]=function(_0x5cf321){var _0x1ce34b=this;return new Promise(function(_0x2ceaeb,_0x45f543){return db[_0xb876('0x13')][_0xb876('0x19')]({'raw':_0x5cf321[_0xb876('0x15')]?_0x5cf321[_0xb876('0x15')][_0xb876('0x16')]===undefined?!![]:![]:!![],'where':_0x5cf321[_0xb876('0x15')]?_0x5cf321[_0xb876('0x15')][_0xb876('0x1a')]||null:null,'attributes':[[_0xb876('0x41'),_0xb876('0x29')],[db['sequelize']['fn'](_0xb876('0x1b'),db[_0xb876('0x1c')][_0xb876('0x1d')]('id')),'ivrTotalCallsDays'],[db[_0xb876('0x1c')]['fn']('COUNT',db[_0xb876('0x1c')]['fn']('IF',db[_0xb876('0x1c')][_0xb876('0x1e')](_0xb876('0x1f')))),_0xb876('0x43')]],'group':[_0xb876('0x41')]})[_0xb876('0x17')](function(_0x3e3ab7){logger[_0xb876('0xf')](_0xb876('0x42'),_0x5cf321);logger['debug'](_0xb876('0x42'),_0x5cf321,JSON[_0xb876('0xb')](_0x3e3ab7));_0x2ceaeb(_0x3e3ab7);})['catch'](function(_0x5cb8c4){logger[_0xb876('0xc')]('GetCampaignHopperHistory',_0x5cb8c4[_0xb876('0xe')],_0x5cf321);_0x45f543(_0x1ce34b[_0xb876('0xc')](0x1f4,_0x5cb8c4[_0xb876('0xe')]));});});};
\ No newline at end of file
index 893f7eb..2f321fd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5cbb=['get','index','isAuthenticated','describe','/:id','put','update','exports','multer','path','Router','fs-extra','../../components/interaction/service','./cmHopperHistory.controller'];(function(_0x503db7,_0x180cca){var _0x10c6a6=function(_0x2bbd9d){while(--_0x2bbd9d){_0x503db7['push'](_0x503db7['shift']());}};_0x10c6a6(++_0x180cca);}(_0x5cbb,0x19e));var _0xb5cb=function(_0x442b59,_0x500f76){_0x442b59=_0x442b59-0x0;var _0x2e8a3a=_0x5cbb[_0x442b59];return _0x2e8a3a;};'use strict';var multer=require(_0xb5cb('0x0'));var util=require('util');var path=require(_0xb5cb('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xb5cb('0x2')]();var fs_extra=require(_0xb5cb('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xb5cb('0x4'));var config=require('../../config/environment');var controller=require(_0xb5cb('0x5'));router[_0xb5cb('0x6')]('/',auth['isAuthenticated'](),controller[_0xb5cb('0x7')]);router[_0xb5cb('0x6')]('/describe',auth[_0xb5cb('0x8')](),controller[_0xb5cb('0x9')]);router['get'](_0xb5cb('0xa'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0xb5cb('0x8')](),controller['create']);router[_0xb5cb('0xb')]('/:id',auth[_0xb5cb('0x8')](),controller[_0xb5cb('0xc')]);module[_0xb5cb('0xd')]=router;
\ No newline at end of file
+var _0x5f15=['get','isAuthenticated','index','/describe','/:id','create','put','update','exports','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller'];(function(_0x4c9444,_0x29476e){var _0x207126=function(_0x45a30f){while(--_0x45a30f){_0x4c9444['push'](_0x4c9444['shift']());}};_0x207126(++_0x29476e);}(_0x5f15,0x139));var _0x55f1=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x5f15[_0x46e363];return _0x3fb059;};'use strict';var multer=require('multer');var util=require(_0x55f1('0x0'));var path=require('path');var timeout=require(_0x55f1('0x1'));var express=require(_0x55f1('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x55f1('0x3'));var interaction=require(_0x55f1('0x4'));var config=require(_0x55f1('0x5'));var controller=require(_0x55f1('0x6'));router[_0x55f1('0x7')]('/',auth[_0x55f1('0x8')](),controller[_0x55f1('0x9')]);router['get'](_0x55f1('0xa'),auth[_0x55f1('0x8')](),controller['describe']);router['get'](_0x55f1('0xb'),auth[_0x55f1('0x8')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x55f1('0xc')]);router[_0x55f1('0xd')](_0x55f1('0xb'),auth[_0x55f1('0x8')](),controller[_0x55f1('0xe')]);module[_0x55f1('0xf')]=router;
\ No newline at end of file
index 979097f..a62a726 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4f5a=['exports','name','sequelize'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x4f5a,0xaa));var _0xa4f5=function(_0x7d2e77,_0x561c88){_0x7d2e77=_0x7d2e77-0x0;var _0x12f3e9=_0x4f5a[_0x7d2e77];return _0x12f3e9;};'use strict';var Sequelize=require(_0xa4f5('0x0'));module[_0xa4f5('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xa4f5('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'dialPrefix':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x3c7b=['name','sequelize','exports','STRING'];(function(_0x42d35d,_0x33e6fc){var _0x445dbc=function(_0x45fb03){while(--_0x45fb03){_0x42d35d['push'](_0x42d35d['shift']());}};_0x445dbc(++_0x33e6fc);}(_0x3c7b,0x11d));var _0xb3c7=function(_0x17e801,_0x3b7885){_0x17e801=_0x17e801-0x0;var _0x123ce6=_0x3c7b[_0x17e801];return _0x123ce6;};'use strict';var Sequelize=require(_0xb3c7('0x0'));module[_0xb3c7('0x1')]={'name':{'type':Sequelize[_0xb3c7('0x2')],'unique':_0xb3c7('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xb3c7('0x2')]},'dialPrefix':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 1b00aa8..7817150 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xda39=['redis','socket.io-emitter','./cmList.socket','register','sendStatus','status','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','then','destroy','Lists','UserProfileResource','end','error','stack','name','send','index','map','CmList','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','merge','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addDisposition','ListId','Disposition','pick','removeDispositions','ids','addContacts','describe','tags','isArray','push','CmContact','omit','success','dataValues','errors','message','Malformed\x20request\x20syntax','getContacts','CustomFields','concat','format','cf_%d','raw','getContactsCsv','CmCustomField','alias','from','cm_contacts','c.ListId\x20=\x20?','c.deletedAt\x20is\x20null','distinct','field','c.cf_','customField_','cm_contact_has_items','ItemTypeId\x20=\x20?','CmContactId\x20=\x20c.id','additionalPhone_','select','description_additionalPhone_','toString','each','writeFileSync','/tmp/list_%d_%s.csv','setHeader','Content-disposition','download','addCustomField','findOne','transaction','addCustomFields','Sequelize','TEXT','text','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','addColumn','cf_%s','findAndCountAll','getGlobalCustomFields','addAgents','spread','emit','userCmList:save','removeAgents','getAgents','User','info','sequelize','eml-format','rimraf','zip-dir','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'];(function(_0x52f83d,_0x33f205){var _0x44a865=function(_0x46c422){while(--_0x46c422){_0x52f83d['push'](_0x52f83d['shift']());}};_0x44a865(++_0x33f205);}(_0xda39,0x8b));var _0x9da3=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xda39[_0x4b369d];return _0x571a98;};'use strict';var emlformat=require(_0x9da3('0x0'));var rimraf=require(_0x9da3('0x1'));var zipdir=require(_0x9da3('0x2'));var jsonpatch=require(_0x9da3('0x3'));var rp=require(_0x9da3('0x4'));var moment=require(_0x9da3('0x5'));var BPromise=require(_0x9da3('0x6'));var Mustache=require(_0x9da3('0x7'));var util=require(_0x9da3('0x8'));var path=require('path');var sox=require(_0x9da3('0x9'));var csv=require(_0x9da3('0xa'));var ejs=require(_0x9da3('0xb'));var fs=require('fs');var fs_extra=require(_0x9da3('0xc'));var _=require(_0x9da3('0xd'));var squel=require(_0x9da3('0xe'));var crypto=require(_0x9da3('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x9da3('0x10'));var toCsv=require(_0x9da3('0xa'));var querystring=require(_0x9da3('0x11'));var Papa=require(_0x9da3('0x12'));var Redis=require(_0x9da3('0x13'));var authService=require(_0x9da3('0x14'));var qs=require(_0x9da3('0x15'));var as=require(_0x9da3('0x16'));var hardwareService=require(_0x9da3('0x17'));var logger=require(_0x9da3('0x18'))(_0x9da3('0x19'));var utils=require(_0x9da3('0x1a'));var config=require(_0x9da3('0x1b'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var csv_results;config[_0x9da3('0x1c')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x9da3('0x1d'))(new Redis(config['redis']));require(_0x9da3('0x1e'))[_0x9da3('0x1f')](socket);function respondWithStatusCode(_0xb0f92c,_0x390eeb){_0x390eeb=_0x390eeb||0xcc;return function(_0x2cb9cd){if(_0x2cb9cd){return _0xb0f92c[_0x9da3('0x20')](_0x390eeb);}return _0xb0f92c[_0x9da3('0x21')](_0x390eeb)['end']();};}function respondWithResult(_0x4aa394,_0x3d0a27){_0x3d0a27=_0x3d0a27||0xc8;return function(_0x2885f2){if(_0x2885f2){return _0x4aa394[_0x9da3('0x21')](_0x3d0a27)['json'](_0x2885f2);}};}function respondWithFilteredResult(_0x1462d9,_0x4ef9f3){return function(_0x369f1c){if(_0x369f1c){var _0x37243a=typeof _0x4ef9f3[_0x9da3('0x22')]==='undefined'&&typeof _0x4ef9f3[_0x9da3('0x23')]===_0x9da3('0x24');var _0x186fc6=_0x369f1c[_0x9da3('0x25')];var _0x2bdb0a=_0x37243a?0x0:_0x4ef9f3[_0x9da3('0x22')];var _0xaf41ae=_0x37243a?_0x369f1c[_0x9da3('0x25')]:_0x4ef9f3['offset']+_0x4ef9f3[_0x9da3('0x23')];var _0x809d33;if(_0xaf41ae>=_0x186fc6){_0xaf41ae=_0x186fc6;_0x809d33=0xc8;}else{_0x809d33=0xce;}_0x1462d9[_0x9da3('0x21')](_0x809d33);return _0x1462d9[_0x9da3('0x26')](_0x9da3('0x27'),_0x2bdb0a+'-'+_0xaf41ae+'/'+_0x186fc6)[_0x9da3('0x28')](_0x369f1c);}return null;};}function patchUpdates(_0x5e9042){return function(_0x357cd7){try{jsonpatch[_0x9da3('0x29')](_0x357cd7,_0x5e9042,!![]);}catch(_0x73fd2f){return BPromise[_0x9da3('0x2a')](_0x73fd2f);}return _0x357cd7[_0x9da3('0x2b')]();};}function saveUpdates(_0x5e13de,_0x624f06){return function(_0x22f4e5){if(_0x22f4e5){return _0x22f4e5[_0x9da3('0x2c')](_0x5e13de)[_0x9da3('0x2d')](function(_0x128a53){return _0x128a53;});}return null;};}function removeEntity(_0x2d0a73,_0x2933a3){return function(_0x3738df){if(_0x3738df){return _0x3738df[_0x9da3('0x2e')]()[_0x9da3('0x2d')](function(){var _0x1522be=_0x3738df['get']({'plain':!![]});var _0x27352c=_0x9da3('0x2f');return db[_0x9da3('0x30')][_0x9da3('0x2e')]({'where':{'type':_0x27352c,'resourceId':_0x1522be['id']}})['then'](function(){return _0x3738df;});})[_0x9da3('0x2d')](function(){_0x2d0a73[_0x9da3('0x21')](0xcc)[_0x9da3('0x31')]();});}};}function handleEntityNotFound(_0x346c42,_0x4941fb){return function(_0x3f09f7){if(!_0x3f09f7){_0x346c42[_0x9da3('0x20')](0x194);}return _0x3f09f7;};}function handleError(_0x371c42,_0x51a154){_0x51a154=_0x51a154||0x1f4;return function(_0x4146a1){logger[_0x9da3('0x32')](_0x4146a1[_0x9da3('0x33')]);if(_0x4146a1[_0x9da3('0x34')]){delete _0x4146a1['name'];}_0x371c42[_0x9da3('0x21')](_0x51a154)[_0x9da3('0x35')](_0x4146a1);};}exports[_0x9da3('0x36')]=function(_0x3c7d1a,_0x5e5f6e){var _0x239063={},_0x1e3418={},_0x638a16={'count':0x0,'rows':[]};var _0x42fee0=_[_0x9da3('0x37')](db[_0x9da3('0x38')][_0x9da3('0x39')],function(_0x3979a4){return{'name':_0x3979a4[_0x9da3('0x3a')],'type':_0x3979a4[_0x9da3('0x3b')][_0x9da3('0x3c')]};});_0x1e3418[_0x9da3('0x3d')]=_[_0x9da3('0x37')](_0x42fee0,_0x9da3('0x34'));_0x1e3418['query']=_[_0x9da3('0x3e')](_0x3c7d1a[_0x9da3('0x3f')]);_0x1e3418['filters']=_[_0x9da3('0x40')](_0x1e3418[_0x9da3('0x3d')],_0x1e3418[_0x9da3('0x3f')]);_0x239063[_0x9da3('0x41')]=_[_0x9da3('0x40')](_0x1e3418[_0x9da3('0x3d')],qs[_0x9da3('0x42')](_0x3c7d1a['query'][_0x9da3('0x42')]));_0x239063[_0x9da3('0x41')]=_0x239063['attributes'][_0x9da3('0x43')]?_0x239063[_0x9da3('0x41')]:_0x1e3418[_0x9da3('0x3d')];if(!_0x3c7d1a[_0x9da3('0x3f')][_0x9da3('0x44')](_0x9da3('0x45'))){_0x239063['limit']=qs['limit'](_0x3c7d1a['query'][_0x9da3('0x23')]);_0x239063[_0x9da3('0x22')]=qs[_0x9da3('0x22')](_0x3c7d1a['query']['offset']);}_0x239063[_0x9da3('0x46')]=qs[_0x9da3('0x47')](_0x3c7d1a[_0x9da3('0x3f')][_0x9da3('0x47')]);_0x239063[_0x9da3('0x48')]=qs[_0x9da3('0x49')](_['pick'](_0x3c7d1a[_0x9da3('0x3f')],_0x1e3418[_0x9da3('0x49')]),_0x42fee0);if(_0x3c7d1a[_0x9da3('0x3f')][_0x9da3('0x4a')]){_0x239063[_0x9da3('0x48')]=_['merge'](_0x239063[_0x9da3('0x48')],{'$or':_[_0x9da3('0x37')](_0x42fee0,function(_0x152ffc){if(_0x152ffc['type']!==_0x9da3('0x4b')){var _0x1258dc={};_0x1258dc[_0x152ffc['name']]={'$like':'%'+_0x3c7d1a[_0x9da3('0x3f')][_0x9da3('0x4a')]+'%'};return _0x1258dc;}})});}_0x239063=_['merge']({},_0x239063,_0x3c7d1a[_0x9da3('0x4c')]);var _0x2197ee={'where':_0x239063[_0x9da3('0x48')]};return db[_0x9da3('0x38')][_0x9da3('0x25')](_0x2197ee)[_0x9da3('0x2d')](function(_0x4770c2){_0x638a16[_0x9da3('0x25')]=_0x4770c2;if(_0x3c7d1a[_0x9da3('0x3f')][_0x9da3('0x4d')]){_0x239063[_0x9da3('0x4e')]=[{'all':!![]}];}return db[_0x9da3('0x38')][_0x9da3('0x4f')](_0x239063);})[_0x9da3('0x2d')](function(_0x390b4d){_0x638a16[_0x9da3('0x50')]=_0x390b4d;return _0x638a16;})['then'](respondWithFilteredResult(_0x5e5f6e,_0x239063))[_0x9da3('0x51')](handleError(_0x5e5f6e,null));};exports[_0x9da3('0x52')]=function(_0x15d175,_0x39dd64){var _0x337b17={'raw':![],'where':{'id':_0x15d175[_0x9da3('0x53')]['id']}},_0xa8a1a3={};_0xa8a1a3['model']=_['keys'](db[_0x9da3('0x38')][_0x9da3('0x39')]);_0xa8a1a3['query']=_[_0x9da3('0x3e')](_0x15d175[_0x9da3('0x3f')]);_0xa8a1a3['filters']=_[_0x9da3('0x40')](_0xa8a1a3[_0x9da3('0x3d')],_0xa8a1a3[_0x9da3('0x3f')]);_0x337b17[_0x9da3('0x41')]=_['intersection'](_0xa8a1a3[_0x9da3('0x3d')],qs[_0x9da3('0x42')](_0x15d175[_0x9da3('0x3f')]['fields']));_0x337b17['attributes']=_0x337b17[_0x9da3('0x41')][_0x9da3('0x43')]?_0x337b17[_0x9da3('0x41')]:_0xa8a1a3['model'];if(_0x15d175[_0x9da3('0x3f')][_0x9da3('0x4d')]){_0x337b17[_0x9da3('0x4e')]=[{'all':!![]}];}_0x337b17=_[_0x9da3('0x54')]({},_0x337b17,_0x15d175[_0x9da3('0x4c')]);return db[_0x9da3('0x38')][_0x9da3('0x55')](_0x337b17)[_0x9da3('0x2d')](handleEntityNotFound(_0x39dd64,null))['then'](respondWithResult(_0x39dd64,null))['catch'](handleError(_0x39dd64,null));};exports[_0x9da3('0x56')]=function(_0x54bc83,_0x544aa4){return db['CmList']['create'](_0x54bc83[_0x9da3('0x57')],{})[_0x9da3('0x2d')](function(_0x84b9b9){var _0x36c808=_0x54bc83['user'][_0x9da3('0x58')]({'plain':!![]});if(!_0x36c808)throw new Error(_0x9da3('0x59'));if(_0x36c808[_0x9da3('0x5a')]==='user'){var _0x39c3ca=_0x84b9b9[_0x9da3('0x58')]({'plain':!![]});var _0xaa89d6='Lists';return db['UserProfileSection'][_0x9da3('0x55')]({'where':{'name':_0xaa89d6,'userProfileId':_0x36c808[_0x9da3('0x5b')]},'raw':!![]})[_0x9da3('0x2d')](function(_0x17cebd){if(_0x17cebd&&_0x17cebd[_0x9da3('0x5c')]===0x0){return db[_0x9da3('0x30')][_0x9da3('0x56')]({'name':_0x39c3ca[_0x9da3('0x34')],'resourceId':_0x39c3ca['id'],'type':_0x17cebd['name'],'sectionId':_0x17cebd['id']},{})[_0x9da3('0x2d')](function(){return _0x84b9b9;});}else{return _0x84b9b9;}})['catch'](function(_0x575b9f){logger[_0x9da3('0x32')](_0x9da3('0x5d'),_0x575b9f);throw _0x575b9f;});}return _0x84b9b9;})[_0x9da3('0x2d')](respondWithResult(_0x544aa4,0xc9))['catch'](handleError(_0x544aa4,null));};exports['update']=function(_0x3ca33d,_0x150491){if(_0x3ca33d[_0x9da3('0x57')]['id']){delete _0x3ca33d[_0x9da3('0x57')]['id'];}return db[_0x9da3('0x38')][_0x9da3('0x55')]({'where':{'id':_0x3ca33d[_0x9da3('0x53')]['id']}})[_0x9da3('0x2d')](handleEntityNotFound(_0x150491,null))['then'](saveUpdates(_0x3ca33d[_0x9da3('0x57')],null))[_0x9da3('0x2d')](respondWithResult(_0x150491,null))[_0x9da3('0x51')](handleError(_0x150491,null));};exports[_0x9da3('0x2e')]=function(_0x12c093,_0x2a7c10){return db[_0x9da3('0x38')]['find']({'where':{'id':_0x12c093[_0x9da3('0x53')]['id']}})[_0x9da3('0x2d')](handleEntityNotFound(_0x2a7c10,null))[_0x9da3('0x2d')](removeEntity(_0x2a7c10,null))[_0x9da3('0x51')](handleError(_0x2a7c10,null));};exports['describe']=function(_0xb2a70e,_0x208824){return db[_0x9da3('0x38')]['describe']()[_0x9da3('0x2d')](respondWithResult(_0x208824,null))['catch'](handleError(_0x208824,null));};exports[_0x9da3('0x5e')]=function(_0x1ab390,_0x1a71a8,_0x4b3894){if(_0x1ab390[_0x9da3('0x57')]['id']){delete _0x1ab390[_0x9da3('0x57')]['id'];}return db[_0x9da3('0x38')][_0x9da3('0x55')]({'where':{'id':_0x1ab390[_0x9da3('0x53')]['id']}})['then'](handleEntityNotFound(_0x1a71a8,null))['then'](function(_0x4e784f){if(_0x4e784f){_0x1ab390[_0x9da3('0x57')][_0x9da3('0x5f')]=_0x4e784f['id'];return db[_0x9da3('0x60')][_0x9da3('0x56')](_0x1ab390['body']);}})['then'](respondWithResult(_0x1a71a8,null))[_0x9da3('0x51')](handleError(_0x1a71a8,null));};exports['getDispositions']=function(_0x4a6f9b,_0x5e7e22,_0x4df4f7){var _0x52ff19={'raw':![],'where':{}};var _0x154155={};var _0x36493d={'count':0x0,'rows':[]};return db[_0x9da3('0x38')]['findOne']({'where':{'id':_0x4a6f9b['params']['id']}})[_0x9da3('0x2d')](handleEntityNotFound(_0x5e7e22,null))[_0x9da3('0x2d')](function(_0x59c214){if(_0x59c214){_0x154155[_0x9da3('0x3d')]=_[_0x9da3('0x3e')](db[_0x9da3('0x60')]['rawAttributes']);_0x154155[_0x9da3('0x3f')]=_[_0x9da3('0x3e')](_0x4a6f9b[_0x9da3('0x3f')]);_0x154155['filters']=_[_0x9da3('0x40')](_0x154155[_0x9da3('0x3d')],_0x154155['query']);_0x52ff19[_0x9da3('0x41')]=_[_0x9da3('0x40')](_0x154155['model'],qs[_0x9da3('0x42')](_0x4a6f9b[_0x9da3('0x3f')]['fields']));_0x52ff19[_0x9da3('0x41')]=_0x52ff19[_0x9da3('0x41')]['length']?_0x52ff19[_0x9da3('0x41')]:_0x154155[_0x9da3('0x3d')];if(!_0x4a6f9b[_0x9da3('0x3f')][_0x9da3('0x44')](_0x9da3('0x45'))){_0x52ff19['limit']=qs['limit'](_0x4a6f9b['query'][_0x9da3('0x23')]);_0x52ff19['offset']=qs[_0x9da3('0x22')](_0x4a6f9b[_0x9da3('0x3f')][_0x9da3('0x22')]);}_0x52ff19[_0x9da3('0x46')]=qs['sort'](_0x4a6f9b['query'][_0x9da3('0x47')]);_0x52ff19['where']=qs[_0x9da3('0x49')](_[_0x9da3('0x61')](_0x4a6f9b[_0x9da3('0x3f')],_0x154155[_0x9da3('0x49')]));_0x52ff19['where'][_0x9da3('0x5f')]=_0x59c214['id'];if(_0x4a6f9b[_0x9da3('0x3f')]['filter']){_0x52ff19[_0x9da3('0x48')]=_['merge'](_0x52ff19[_0x9da3('0x48')],{'$or':_['map'](_0x52ff19[_0x9da3('0x41')],function(_0x183f55){var _0x367bd6={};_0x367bd6[_0x183f55]={'$like':'%'+_0x4a6f9b['query'][_0x9da3('0x4a')]+'%'};return _0x367bd6;})});}_0x52ff19=_[_0x9da3('0x54')]({},_0x52ff19,_0x4a6f9b[_0x9da3('0x4c')]);return db[_0x9da3('0x60')][_0x9da3('0x25')]({'where':_0x52ff19[_0x9da3('0x48')]})[_0x9da3('0x2d')](function(_0x575f3a){_0x36493d['count']=_0x575f3a;if(_0x4a6f9b[_0x9da3('0x3f')][_0x9da3('0x4d')]){_0x52ff19[_0x9da3('0x4e')]=[{'all':!![]}];}return db[_0x9da3('0x60')][_0x9da3('0x4f')](_0x52ff19);})['then'](function(_0x27565e){_0x36493d[_0x9da3('0x50')]=_0x27565e;return _0x36493d;});}})[_0x9da3('0x2d')](respondWithFilteredResult(_0x5e7e22,_0x52ff19))[_0x9da3('0x51')](handleError(_0x5e7e22,null));};exports[_0x9da3('0x62')]=function(_0x3dc8ab,_0x3182c8,_0x407063){return db[_0x9da3('0x38')][_0x9da3('0x55')]({'where':{'id':_0x3dc8ab[_0x9da3('0x53')]['id']}})[_0x9da3('0x2d')](handleEntityNotFound(_0x3182c8,null))[_0x9da3('0x2d')](function(_0x14b0a1){if(_0x14b0a1){return _0x14b0a1[_0x9da3('0x62')](_0x3dc8ab[_0x9da3('0x3f')][_0x9da3('0x63')]);}})[_0x9da3('0x2d')](respondWithStatusCode(_0x3182c8,null))[_0x9da3('0x51')](handleError(_0x3182c8,null));};exports[_0x9da3('0x64')]=function(_0x7f1f62,_0x282377,_0xe9547f){return db[_0x9da3('0x38')][_0x9da3('0x55')]({'where':{'id':_0x7f1f62[_0x9da3('0x53')]['id']}})[_0x9da3('0x2d')](handleEntityNotFound(_0x282377,null))['then'](function(_0x24be3e){if(_0x24be3e){var _0x5b616c=[];var _0x11a97e={'success':[],'errors':[]};return db['CmContact'][_0x9da3('0x65')]()[_0x9da3('0x2d')](function(_0x1bc0c2){if(_0x7f1f62[_0x9da3('0x57')][_0x9da3('0x66')]&&_[_0x9da3('0x67')](_0x7f1f62['body'][_0x9da3('0x66')])){if(_0x7f1f62[_0x9da3('0x57')][_0x9da3('0x66')][_0x9da3('0x43')]){_0x7f1f62[_0x9da3('0x57')][_0x9da3('0x66')]=_0x7f1f62['body'][_0x9da3('0x66')]['join'](';')+';';}else{_0x7f1f62[_0x9da3('0x57')]['tags']=null;}}else{_0x7f1f62['body'][_0x9da3('0x66')]=null;}if(_0x7f1f62[_0x9da3('0x57')]&&_[_0x9da3('0x67')](_0x7f1f62[_0x9da3('0x57')])){for(var _0x267a2e=0x0;_0x267a2e<_0x7f1f62['body']['length'];_0x267a2e+=0x1){_0x7f1f62[_0x9da3('0x57')][_0x267a2e]['ListId']=_0x7f1f62[_0x9da3('0x53')]['id'];_0x5b616c[_0x9da3('0x68')](_0x7f1f62[_0x9da3('0x57')][_0x267a2e]);}return BPromise['each'](_0x5b616c,function(_0xe01fda){return db[_0x9da3('0x69')][_0x9da3('0x56')](_[_0x9da3('0x6a')](_0xe01fda,[_0x9da3('0x63'),'id'])||{},{'fields':_[_0x9da3('0x3e')](_0x1bc0c2),'raw':!![]})[_0x9da3('0x2d')](function(_0x4ba034){_0x11a97e[_0x9da3('0x6b')]['push'](_0x4ba034[_0x9da3('0x6c')]);})[_0x9da3('0x51')](function(_0x18610b){_0x11a97e[_0x9da3('0x6d')][_0x9da3('0x68')]({'data':_0xe01fda,'error':_0x18610b[_0x9da3('0x6e')]});});})[_0x9da3('0x2d')](function(_0x11d240){return _0x11a97e;})[_0x9da3('0x51')](function(_0x2be961){return _0x2be961;});}else{_0x282377['status'](0x190)['json']({'message':_0x9da3('0x6f')});}});}})[_0x9da3('0x2d')](respondWithResult(_0x282377,null))[_0x9da3('0x51')](handleError(_0x282377,null));};exports[_0x9da3('0x70')]=function(_0x2fd23f,_0x1f50b6,_0x2eaa40){var _0xcc733;return db[_0x9da3('0x38')][_0x9da3('0x55')]({'where':{'id':_0x2fd23f[_0x9da3('0x53')]['id']},'include':[{'model':db['CmCustomField'],'as':_0x9da3('0x71')}]})[_0x9da3('0x2d')](handleEntityNotFound(_0x1f50b6,null))[_0x9da3('0x2d')](function(_0x4749fd){if(_0x4749fd){_0xcc733=_0x4749fd;return db['CmContact'][_0x9da3('0x39')];}})[_0x9da3('0x2d')](function(_0x2150f8){if(_0x2150f8){var _0x2939cb={};var _0x32f7b2={};_0x32f7b2['model']=_[_0x9da3('0x72')](_[_0x9da3('0x3e')](_0x2150f8),_['map'](_0xcc733[_0x9da3('0x71')],function(_0x2bd6c5){return util[_0x9da3('0x73')](_0x9da3('0x74'),_0x2bd6c5['id']);}));_0x32f7b2['query']=_[_0x9da3('0x3e')](_0x2fd23f['query']);_0x32f7b2[_0x9da3('0x49')]=_[_0x9da3('0x40')](_0x32f7b2[_0x9da3('0x3d')],_0x32f7b2['query']);_0x2939cb[_0x9da3('0x41')]=_[_0x9da3('0x40')](_0x32f7b2[_0x9da3('0x3d')],qs[_0x9da3('0x42')](_0x2fd23f[_0x9da3('0x3f')][_0x9da3('0x42')]));_0x2939cb[_0x9da3('0x41')]=_0x2939cb['attributes'][_0x9da3('0x43')]?_0x2939cb[_0x9da3('0x41')]:_0x32f7b2[_0x9da3('0x3d')];if(!_0x2fd23f[_0x9da3('0x3f')][_0x9da3('0x44')]('nolimit')){_0x2939cb[_0x9da3('0x23')]=qs[_0x9da3('0x23')](_0x2fd23f[_0x9da3('0x3f')]['limit']);_0x2939cb[_0x9da3('0x22')]=qs[_0x9da3('0x22')](_0x2fd23f[_0x9da3('0x3f')][_0x9da3('0x22')]);}_0x2939cb[_0x9da3('0x46')]=qs['sort'](_0x2fd23f[_0x9da3('0x3f')]['sort']);_0x2939cb['where']=qs[_0x9da3('0x49')](_[_0x9da3('0x61')](_0x2fd23f[_0x9da3('0x3f')],_0x32f7b2[_0x9da3('0x49')]));_0x2939cb[_0x9da3('0x75')]=!![];if(_0x2fd23f['query'][_0x9da3('0x4a')]){_0x2939cb[_0x9da3('0x48')]=_[_0x9da3('0x54')](_0x2939cb['where'],{'$or':_[_0x9da3('0x37')](_0x2939cb[_0x9da3('0x41')],function(_0x276a0e){var _0x33392d={};_0x33392d[_0x276a0e]={'$like':'%'+_0x2fd23f[_0x9da3('0x3f')][_0x9da3('0x4a')]+'%'};return _0x33392d;})});}_0x2939cb=_[_0x9da3('0x54')]({},_0x2939cb,_0x2fd23f['options']);return _0xcc733[_0x9da3('0x70')](_0x2939cb);}})[_0x9da3('0x2d')](respondWithResult(_0x1f50b6,null))['catch'](handleError(_0x1f50b6,null));};exports[_0x9da3('0x76')]=function(_0x2a8615,_0x12d435,_0x1b2bf3){var _0x73e586;var _0x1411d8;var _0x3e8068;var _0x4b3ce5=_0x2a8615['params']['id'];csv_results=[];return db['ContactItemType'][_0x9da3('0x4f')]({'attributes':['id',_0x9da3('0x34')],'raw':!![],'order':['OrderBy']})[_0x9da3('0x2d')](function(_0x340d50){_0x73e586=_0x340d50;var _0x462f9d=_[_0x9da3('0x3e')](db[_0x9da3('0x69')][_0x9da3('0x39')]);return db[_0x9da3('0x77')][_0x9da3('0x4f')]({'raw':!![],'attributes':['id',_0x9da3('0x78')]})[_0x9da3('0x2d')](function(_0xfb68a4){_0x1411d8=_0xfb68a4;var _0x149413=squel['select']()[_0x9da3('0x42')](_0x462f9d)[_0x9da3('0x79')](_0x9da3('0x7a'),'c')[_0x9da3('0x48')](_0x9da3('0x7b'),_0x4b3ce5)[_0x9da3('0x48')](_0x9da3('0x7c'))[_0x9da3('0x7d')]();for(var _0x1437b8=0x0;_0x1437b8<_0x1411d8[_0x9da3('0x43')];_0x1437b8++){_0x149413[_0x9da3('0x7e')](_0x9da3('0x7f')+_0x1411d8[_0x1437b8]['id'],_0x9da3('0x80')+_0x1411d8[_0x1437b8]['alias']);}for(var _0x1437b8=0x0;_0x1437b8<_0x73e586[_0x9da3('0x43')];_0x1437b8++){_0x149413['field'](squel['select']()[_0x9da3('0x7e')]('item')[_0x9da3('0x79')](_0x9da3('0x81'))[_0x9da3('0x48')](_0x9da3('0x82'),_0x73e586[_0x1437b8]['id'])[_0x9da3('0x48')](_0x9da3('0x83')),_0x9da3('0x84')+_0x73e586[_0x1437b8][_0x9da3('0x34')]);_0x149413[_0x9da3('0x7e')](squel[_0x9da3('0x85')]()['field']('description')['from'](_0x9da3('0x81'))[_0x9da3('0x48')]('ItemTypeId\x20=\x20?',_0x73e586[_0x1437b8]['id'])['where']('CmContactId\x20=\x20c.id'),_0x9da3('0x86')+_0x73e586[_0x1437b8][_0x9da3('0x34')]);}var _0x1e8865=[];_0x1e8865['push'](_0x149413[_0x9da3('0x87')]());BPromise[_0x9da3('0x88')](_0x1e8865,handleQuery)[_0x9da3('0x2d')](function(_0x1213b0){handleQuery(_0x149413['toString']());var _0x5e12bd=csv_results[0x0];if(!_['isEmpty'](_0x5e12bd)){var _0x260476=toCsv(_0x5e12bd);var _0x16c30e=Date['now']();fs[_0x9da3('0x89')](util[_0x9da3('0x73')](_0x9da3('0x8a'),_0x4b3ce5,_0x16c30e),_0x260476);_0x12d435[_0x9da3('0x8b')](_0x9da3('0x8c'),'attachment;\x20filename='+util[_0x9da3('0x73')]('list_%d_%s.csv',_0x4b3ce5,_0x16c30e));_0x12d435[_0x9da3('0x8b')]('Content-type','text/csv');return _0x12d435[_0x9da3('0x8d')](util[_0x9da3('0x73')](_0x9da3('0x8a'),_0x4b3ce5,_0x16c30e));}else{return _0x12d435[_0x9da3('0x20')](0xcc);}});});});};exports[_0x9da3('0x8e')]=function(_0x32bd4b,_0x3d8ece,_0x5813cc){var _0x28135a;delete _0x32bd4b[_0x9da3('0x57')]['id'];return db[_0x9da3('0x38')][_0x9da3('0x8f')]({'where':{'id':_0x32bd4b[_0x9da3('0x53')]['id']}})[_0x9da3('0x2d')](handleEntityNotFound(_0x3d8ece,null))[_0x9da3('0x2d')](function(_0x2580c1){if(_0x2580c1){return db['sequelize'][_0x9da3('0x90')](function(_0x40fb56){return db[_0x9da3('0x77')][_0x9da3('0x56')](_0x32bd4b[_0x9da3('0x57')],{'transaction':_0x40fb56})[_0x9da3('0x2d')](function(_0x4edb75){_0x28135a=_0x4edb75;return _0x2580c1[_0x9da3('0x91')](_0x4edb75,{'transaction':_0x40fb56});})[_0x9da3('0x2d')](function(){var _0x59207f={'type':db[_0x9da3('0x92')][_0x9da3('0x93')],'transaction':_0x40fb56};switch(_0x32bd4b[_0x9da3('0x57')][_0x9da3('0x3b')]){case _0x9da3('0x94'):_0x59207f[_0x9da3('0x3b')]=db[_0x9da3('0x92')][_0x9da3('0x93')];break;case'number':_0x59207f[_0x9da3('0x3b')]=db['Sequelize'][_0x9da3('0x95')];break;case _0x9da3('0x96'):_0x59207f[_0x9da3('0x3b')]=db['Sequelize'][_0x9da3('0x97')];_0x59207f[_0x9da3('0x98')]=![];break;default:}return db['sequelize'][_0x9da3('0x99')][_0x9da3('0x9a')]('cm_contacts',util['format'](_0x9da3('0x9b'),_0x28135a['id']),_0x59207f);})['then'](function(){return _0x28135a;});});}})['then'](respondWithResult(_0x3d8ece,null))[_0x9da3('0x51')](handleError(_0x3d8ece,null));};exports['getCustomFields']=function(_0x463125,_0x2bd999,_0x1f2bf1){var _0x4cd209={};var _0x53a169={};var _0x554c5a;var _0x27d37a;return db['CmList']['findOne']({'where':{'id':_0x463125[_0x9da3('0x53')]['id']}})[_0x9da3('0x2d')](handleEntityNotFound(_0x2bd999,null))[_0x9da3('0x2d')](function(_0x28dc69){if(_0x28dc69){_0x554c5a=_0x28dc69;_0x53a169['model']=_['keys'](db[_0x9da3('0x77')][_0x9da3('0x39')]);_0x53a169[_0x9da3('0x3f')]=_[_0x9da3('0x3e')](_0x463125[_0x9da3('0x3f')]);_0x53a169[_0x9da3('0x49')]=_['intersection'](_0x53a169[_0x9da3('0x3d')],_0x53a169[_0x9da3('0x3f')]);_0x4cd209['attributes']=_[_0x9da3('0x40')](_0x53a169['model'],qs[_0x9da3('0x42')](_0x463125[_0x9da3('0x3f')]['fields']));_0x4cd209[_0x9da3('0x41')]=_0x4cd209[_0x9da3('0x41')][_0x9da3('0x43')]?_0x4cd209[_0x9da3('0x41')]:_0x53a169[_0x9da3('0x3d')];_0x4cd209[_0x9da3('0x46')]=qs[_0x9da3('0x47')](_0x463125[_0x9da3('0x3f')][_0x9da3('0x47')]);_0x4cd209[_0x9da3('0x48')]=qs['filters'](_[_0x9da3('0x61')](_0x463125[_0x9da3('0x3f')],_0x53a169[_0x9da3('0x49')]));_0x4cd209[_0x9da3('0x48')]=_[_0x9da3('0x54')](_0x4cd209['where'],{'$or':[{'ListId':_0x28dc69['id']},{'ListId':null}]});if(_0x463125['query'][_0x9da3('0x4a')]){_0x4cd209[_0x9da3('0x48')]=_[_0x9da3('0x54')](_0x4cd209[_0x9da3('0x48')],{'$or':_[_0x9da3('0x37')](_0x4cd209[_0x9da3('0x41')],function(_0x2ecd55){var _0x26d4a2={};_0x26d4a2[_0x2ecd55]={'$like':'%'+_0x463125[_0x9da3('0x3f')][_0x9da3('0x4a')]+'%'};return _0x26d4a2;})});}_0x4cd209=_[_0x9da3('0x54')]({},_0x4cd209,_0x463125['options']);return db[_0x9da3('0x77')][_0x9da3('0x9c')](_0x4cd209);}})[_0x9da3('0x2d')](respondWithResult(_0x2bd999,null))[_0x9da3('0x51')](handleError(_0x2bd999,null));};exports[_0x9da3('0x9d')]=function(_0x4cd68f,_0x27f78a){return db[_0x9da3('0x77')][_0x9da3('0x9c')]({'where':{'ListId':null}})[_0x9da3('0x2d')](handleEntityNotFound(_0x27f78a,null))[_0x9da3('0x2d')](function(_0xacee0c){return _0xacee0c;})['then'](respondWithResult(_0x27f78a,null))[_0x9da3('0x51')](handleError(_0x27f78a,null));};exports[_0x9da3('0x9e')]=function(_0x1d8e85,_0x14ee51,_0x526198){return db[_0x9da3('0x38')]['find']({'where':{'id':_0x1d8e85[_0x9da3('0x53')]['id']}})['then'](handleEntityNotFound(_0x14ee51,null))['then'](function(_0x318fe4){if(_0x318fe4){return _0x318fe4[_0x9da3('0x9e')](_0x1d8e85['body']['ids'],_[_0x9da3('0x6a')](_0x1d8e85[_0x9da3('0x57')],[_0x9da3('0x63'),'id'])||{})[_0x9da3('0x9f')](function(_0x534953){for(var _0x1bd956=0x0;_0x1bd956<_0x1d8e85['body'][_0x9da3('0x63')][_0x9da3('0x43')];_0x1bd956+=0x1){socket[_0x9da3('0xa0')](_0x9da3('0xa1'),{'UserId':Number(_0x1d8e85['body'][_0x9da3('0x63')][_0x1bd956]),'CmListId':Number(_0x1d8e85[_0x9da3('0x53')]['id'])});}return _0x534953;});}})[_0x9da3('0x2d')](respondWithResult(_0x14ee51,null))[_0x9da3('0x51')](handleError(_0x14ee51,null));};exports['removeAgents']=function(_0x18c9df,_0x11fd96,_0x1fbf5b){return db['CmList'][_0x9da3('0x55')]({'where':{'id':_0x18c9df[_0x9da3('0x53')]['id']}})[_0x9da3('0x2d')](handleEntityNotFound(_0x11fd96,null))[_0x9da3('0x2d')](function(_0xf05d4b){if(_0xf05d4b){return _0xf05d4b[_0x9da3('0xa2')](_0x18c9df[_0x9da3('0x3f')]['ids'])['then'](function(){if(_[_0x9da3('0x67')](_0x18c9df[_0x9da3('0x3f')][_0x9da3('0x63')])){for(var _0x52d6e0=0x0;_0x52d6e0<_0x18c9df[_0x9da3('0x3f')][_0x9da3('0x63')][_0x9da3('0x43')];_0x52d6e0+=0x1){socket[_0x9da3('0xa0')]('userCmList:remove',{'UserId':Number(_0x18c9df[_0x9da3('0x3f')]['ids'][_0x52d6e0]),'CmListId':Number(_0x18c9df[_0x9da3('0x53')]['id'])});}}else{socket[_0x9da3('0xa0')]('userCmList:remove',{'UserId':Number(_0x18c9df['query'][_0x9da3('0x63')]),'CmListId':Number(_0x18c9df[_0x9da3('0x53')]['id'])});}});}})[_0x9da3('0x2d')](respondWithStatusCode(_0x11fd96,null))[_0x9da3('0x51')](handleError(_0x11fd96,null));};exports[_0x9da3('0xa3')]=function(_0x4589e1,_0xebaedb,_0xb56e0f){var _0x1a5bbf={};var _0x380c6a={};var _0x573311;var _0x41511e;return db['CmList']['findOne']({'where':{'id':_0x4589e1[_0x9da3('0x53')]['id']}})[_0x9da3('0x2d')](handleEntityNotFound(_0xebaedb,null))[_0x9da3('0x2d')](function(_0x2bea56){if(_0x2bea56){_0x573311=_0x2bea56;_0x380c6a[_0x9da3('0x3d')]=_[_0x9da3('0x3e')](db[_0x9da3('0xa4')][_0x9da3('0x39')]);_0x380c6a[_0x9da3('0x3f')]=_['keys'](_0x4589e1['query']);_0x380c6a[_0x9da3('0x49')]=_[_0x9da3('0x40')](_0x380c6a[_0x9da3('0x3d')],_0x380c6a[_0x9da3('0x3f')]);_0x1a5bbf[_0x9da3('0x41')]=_[_0x9da3('0x40')](_0x380c6a[_0x9da3('0x3d')],qs[_0x9da3('0x42')](_0x4589e1[_0x9da3('0x3f')][_0x9da3('0x42')]));_0x1a5bbf[_0x9da3('0x41')]=_0x1a5bbf[_0x9da3('0x41')][_0x9da3('0x43')]?_0x1a5bbf[_0x9da3('0x41')]:_0x380c6a[_0x9da3('0x3d')];_0x1a5bbf[_0x9da3('0x46')]=qs[_0x9da3('0x47')](_0x4589e1[_0x9da3('0x3f')]['sort']);_0x1a5bbf[_0x9da3('0x48')]=qs['filters'](_['pick'](_0x4589e1[_0x9da3('0x3f')],_0x380c6a['filters']));if(_0x4589e1['query'][_0x9da3('0x4a')]){_0x1a5bbf[_0x9da3('0x48')]=_[_0x9da3('0x54')](_0x1a5bbf[_0x9da3('0x48')],{'$or':_[_0x9da3('0x37')](_0x1a5bbf[_0x9da3('0x41')],function(_0x234020){var _0x3b1b5a={};_0x3b1b5a[_0x234020]={'$like':'%'+_0x4589e1[_0x9da3('0x3f')][_0x9da3('0x4a')]+'%'};return _0x3b1b5a;})});}_0x1a5bbf=_[_0x9da3('0x54')]({},_0x1a5bbf,_0x4589e1[_0x9da3('0x4c')]);return _0x573311[_0x9da3('0xa3')](_0x1a5bbf);}})[_0x9da3('0x2d')](function(_0x4e105a){if(_0x4e105a){_0x41511e=_0x4e105a[_0x9da3('0x43')];if(!_0x4589e1[_0x9da3('0x3f')][_0x9da3('0x44')](_0x9da3('0x45'))){_0x1a5bbf[_0x9da3('0x23')]=qs['limit'](_0x4589e1[_0x9da3('0x3f')][_0x9da3('0x23')]);_0x1a5bbf[_0x9da3('0x22')]=qs[_0x9da3('0x22')](_0x4589e1[_0x9da3('0x3f')][_0x9da3('0x22')]);}return _0x573311[_0x9da3('0xa3')](_0x1a5bbf);}})[_0x9da3('0x2d')](function(_0x4060fb){if(_0x4060fb){return _0x4060fb?{'count':_0x41511e,'rows':_0x4060fb}:null;}})['then'](respondWithResult(_0xebaedb,null))[_0x9da3('0x51')](handleError(_0xebaedb,null));};function handleQuery(_0x2c62d8){logger[_0x9da3('0xa5')](_0x2c62d8);return db[_0x9da3('0xa6')][_0x9da3('0x3f')](_0x2c62d8)['spread'](function(_0xccdf03){csv_results['push'](_0xccdf03);})[_0x9da3('0x51')](function(_0x13a0e7){logger[_0x9da3('0x32')](_0x13a0e7[_0x9da3('0x6e')]);});}
\ No newline at end of file
+var _0xab10=['dataValues','errors','message','Malformed\x20request\x20syntax','CmCustomField','CustomFields','concat','format','cf_%d','getContacts','ContactItemType','OrderBy','select','from','cm_contacts','c.deletedAt\x20is\x20null','field','c.cf_','customField_','alias','cm_contact_has_items','ItemTypeId\x20=\x20?','CmContactId\x20=\x20c.id','additionalPhone_','description','toString','isEmpty','/tmp/list_%d_%s.csv','setHeader','attachment;\x20filename=','list_%d_%s.csv','Content-type','addCustomField','sequelize','transaction','Sequelize','TEXT','text','number','type','INTEGER','switch','defaultValue','queryInterface','addColumn','cf_%s','getCustomFields','getGlobalCustomFields','findAndCountAll','addAgents','spread','emit','userCmList:save','removeAgents','userCmList:remove','User','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','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','redis','defaults','localhost','./cmList.socket','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','get','Lists','UserProfileResource','destroy','error','stack','name','send','map','CmList','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','catch','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','Disposition','getDispositions','findOne','pick','ListId','options','rows','removeDispositions','addContacts','CmContact','tags','isArray','join','push','each','omit','ids','success'];(function(_0x3ef1b8,_0x49073d){var _0x422941=function(_0x95e358){while(--_0x95e358){_0x3ef1b8['push'](_0x3ef1b8['shift']());}};_0x422941(++_0x49073d);}(_0xab10,0x181));var _0x0ab1=function(_0x39e40c,_0x4ead18){_0x39e40c=_0x39e40c-0x0;var _0x151859=_0xab10[_0x39e40c];return _0x151859;};'use strict';var emlformat=require(_0x0ab1('0x0'));var rimraf=require(_0x0ab1('0x1'));var zipdir=require(_0x0ab1('0x2'));var jsonpatch=require(_0x0ab1('0x3'));var rp=require(_0x0ab1('0x4'));var moment=require('moment');var BPromise=require(_0x0ab1('0x5'));var Mustache=require(_0x0ab1('0x6'));var util=require(_0x0ab1('0x7'));var path=require(_0x0ab1('0x8'));var sox=require(_0x0ab1('0x9'));var csv=require('to-csv');var ejs=require(_0x0ab1('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0ab1('0xb'));var squel=require(_0x0ab1('0xc'));var crypto=require(_0x0ab1('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x0ab1('0xe'));var querystring=require(_0x0ab1('0xf'));var Papa=require(_0x0ab1('0x10'));var Redis=require(_0x0ab1('0x11'));var authService=require(_0x0ab1('0x12'));var qs=require(_0x0ab1('0x13'));var as=require(_0x0ab1('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0ab1('0x15'))(_0x0ab1('0x16'));var utils=require(_0x0ab1('0x17'));var config=require(_0x0ab1('0x18'));var licenseUtil=require(_0x0ab1('0x19'));var db=require(_0x0ab1('0x1a'))['db'];var csv_results;config[_0x0ab1('0x1b')]=_[_0x0ab1('0x1c')](config[_0x0ab1('0x1b')],{'host':_0x0ab1('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0ab1('0x1b')]));require(_0x0ab1('0x1e'))['register'](socket);function respondWithStatusCode(_0x5ce498,_0x433933){_0x433933=_0x433933||0xcc;return function(_0x8b7b21){if(_0x8b7b21){return _0x5ce498[_0x0ab1('0x1f')](_0x433933);}return _0x5ce498[_0x0ab1('0x20')](_0x433933)[_0x0ab1('0x21')]();};}function respondWithResult(_0x56b1bf,_0x227168){_0x227168=_0x227168||0xc8;return function(_0x2bc27d){if(_0x2bc27d){return _0x56b1bf[_0x0ab1('0x20')](_0x227168)[_0x0ab1('0x22')](_0x2bc27d);}};}function respondWithFilteredResult(_0x539831,_0xbbc1f8){return function(_0xb9effb){if(_0xb9effb){var _0x4cd836=typeof _0xbbc1f8[_0x0ab1('0x23')]==='undefined'&&typeof _0xbbc1f8[_0x0ab1('0x24')]===_0x0ab1('0x25');var _0xb4332d=_0xb9effb[_0x0ab1('0x26')];var _0x3db18c=_0x4cd836?0x0:_0xbbc1f8[_0x0ab1('0x23')];var _0x4f84a3=_0x4cd836?_0xb9effb[_0x0ab1('0x26')]:_0xbbc1f8[_0x0ab1('0x23')]+_0xbbc1f8[_0x0ab1('0x24')];var _0x24d6b4;if(_0x4f84a3>=_0xb4332d){_0x4f84a3=_0xb4332d;_0x24d6b4=0xc8;}else{_0x24d6b4=0xce;}_0x539831[_0x0ab1('0x20')](_0x24d6b4);return _0x539831[_0x0ab1('0x27')](_0x0ab1('0x28'),_0x3db18c+'-'+_0x4f84a3+'/'+_0xb4332d)[_0x0ab1('0x22')](_0xb9effb);}return null;};}function patchUpdates(_0x51b210){return function(_0xabf688){try{jsonpatch[_0x0ab1('0x29')](_0xabf688,_0x51b210,!![]);}catch(_0x6a15bf){return BPromise[_0x0ab1('0x2a')](_0x6a15bf);}return _0xabf688[_0x0ab1('0x2b')]();};}function saveUpdates(_0x58448e,_0x32dbf2){return function(_0x503fe3){if(_0x503fe3){return _0x503fe3[_0x0ab1('0x2c')](_0x58448e)['then'](function(_0x132a25){return _0x132a25;});}return null;};}function removeEntity(_0x3bdc87,_0x182fae){return function(_0x147e16){if(_0x147e16){return _0x147e16['destroy']()[_0x0ab1('0x2d')](function(){var _0x1cc991=_0x147e16[_0x0ab1('0x2e')]({'plain':!![]});var _0x1f1f1a=_0x0ab1('0x2f');return db[_0x0ab1('0x30')][_0x0ab1('0x31')]({'where':{'type':_0x1f1f1a,'resourceId':_0x1cc991['id']}})[_0x0ab1('0x2d')](function(){return _0x147e16;});})['then'](function(){_0x3bdc87['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3b9b3c,_0x329c36){return function(_0x37998b){if(!_0x37998b){_0x3b9b3c['sendStatus'](0x194);}return _0x37998b;};}function handleError(_0x5dd296,_0x4b7902){_0x4b7902=_0x4b7902||0x1f4;return function(_0x3cb1c1){logger[_0x0ab1('0x32')](_0x3cb1c1[_0x0ab1('0x33')]);if(_0x3cb1c1[_0x0ab1('0x34')]){delete _0x3cb1c1['name'];}_0x5dd296[_0x0ab1('0x20')](_0x4b7902)[_0x0ab1('0x35')](_0x3cb1c1);};}exports['index']=function(_0x131a1f,_0x440dbb){var _0x40db14={},_0x13cede={},_0x227321={'count':0x0,'rows':[]};var _0xe561dc=_[_0x0ab1('0x36')](db[_0x0ab1('0x37')][_0x0ab1('0x38')],function(_0x271459){return{'name':_0x271459[_0x0ab1('0x39')],'type':_0x271459['type'][_0x0ab1('0x3a')]};});_0x13cede['model']=_[_0x0ab1('0x36')](_0xe561dc,_0x0ab1('0x34'));_0x13cede[_0x0ab1('0x3b')]=_[_0x0ab1('0x3c')](_0x131a1f[_0x0ab1('0x3b')]);_0x13cede[_0x0ab1('0x3d')]=_[_0x0ab1('0x3e')](_0x13cede[_0x0ab1('0x3f')],_0x13cede[_0x0ab1('0x3b')]);_0x40db14[_0x0ab1('0x40')]=_['intersection'](_0x13cede['model'],qs[_0x0ab1('0x41')](_0x131a1f[_0x0ab1('0x3b')][_0x0ab1('0x41')]));_0x40db14[_0x0ab1('0x40')]=_0x40db14[_0x0ab1('0x40')][_0x0ab1('0x42')]?_0x40db14[_0x0ab1('0x40')]:_0x13cede[_0x0ab1('0x3f')];if(!_0x131a1f[_0x0ab1('0x3b')][_0x0ab1('0x43')](_0x0ab1('0x44'))){_0x40db14[_0x0ab1('0x24')]=qs['limit'](_0x131a1f[_0x0ab1('0x3b')][_0x0ab1('0x24')]);_0x40db14[_0x0ab1('0x23')]=qs['offset'](_0x131a1f[_0x0ab1('0x3b')][_0x0ab1('0x23')]);}_0x40db14[_0x0ab1('0x45')]=qs[_0x0ab1('0x46')](_0x131a1f['query']['sort']);_0x40db14[_0x0ab1('0x47')]=qs[_0x0ab1('0x3d')](_['pick'](_0x131a1f['query'],_0x13cede[_0x0ab1('0x3d')]),_0xe561dc);if(_0x131a1f[_0x0ab1('0x3b')][_0x0ab1('0x48')]){_0x40db14[_0x0ab1('0x47')]=_[_0x0ab1('0x49')](_0x40db14[_0x0ab1('0x47')],{'$or':_[_0x0ab1('0x36')](_0xe561dc,function(_0x4584ee){if(_0x4584ee['type']!==_0x0ab1('0x4a')){var _0xa855b9={};_0xa855b9[_0x4584ee['name']]={'$like':'%'+_0x131a1f[_0x0ab1('0x3b')][_0x0ab1('0x48')]+'%'};return _0xa855b9;}})});}_0x40db14=_['merge']({},_0x40db14,_0x131a1f['options']);var _0x132de1={'where':_0x40db14[_0x0ab1('0x47')]};return db[_0x0ab1('0x37')][_0x0ab1('0x26')](_0x132de1)[_0x0ab1('0x2d')](function(_0x2307e7){_0x227321['count']=_0x2307e7;if(_0x131a1f['query'][_0x0ab1('0x4b')]){_0x40db14[_0x0ab1('0x4c')]=[{'all':!![]}];}return db[_0x0ab1('0x37')][_0x0ab1('0x4d')](_0x40db14);})[_0x0ab1('0x2d')](function(_0x5b8370){_0x227321['rows']=_0x5b8370;return _0x227321;})[_0x0ab1('0x2d')](respondWithFilteredResult(_0x440dbb,_0x40db14))[_0x0ab1('0x4e')](handleError(_0x440dbb,null));};exports['show']=function(_0x346507,_0x54a56f){var _0x49609d={'raw':![],'where':{'id':_0x346507[_0x0ab1('0x4f')]['id']}},_0x488d8e={};_0x488d8e[_0x0ab1('0x3f')]=_[_0x0ab1('0x3c')](db[_0x0ab1('0x37')][_0x0ab1('0x38')]);_0x488d8e[_0x0ab1('0x3b')]=_[_0x0ab1('0x3c')](_0x346507[_0x0ab1('0x3b')]);_0x488d8e['filters']=_['intersection'](_0x488d8e[_0x0ab1('0x3f')],_0x488d8e[_0x0ab1('0x3b')]);_0x49609d['attributes']=_['intersection'](_0x488d8e[_0x0ab1('0x3f')],qs[_0x0ab1('0x41')](_0x346507['query']['fields']));_0x49609d[_0x0ab1('0x40')]=_0x49609d[_0x0ab1('0x40')]['length']?_0x49609d[_0x0ab1('0x40')]:_0x488d8e[_0x0ab1('0x3f')];if(_0x346507[_0x0ab1('0x3b')][_0x0ab1('0x4b')]){_0x49609d['include']=[{'all':!![]}];}_0x49609d=_[_0x0ab1('0x49')]({},_0x49609d,_0x346507['options']);return db[_0x0ab1('0x37')][_0x0ab1('0x50')](_0x49609d)[_0x0ab1('0x2d')](handleEntityNotFound(_0x54a56f,null))['then'](respondWithResult(_0x54a56f,null))[_0x0ab1('0x4e')](handleError(_0x54a56f,null));};exports[_0x0ab1('0x51')]=function(_0x7c13d5,_0x271627){return db[_0x0ab1('0x37')][_0x0ab1('0x51')](_0x7c13d5[_0x0ab1('0x52')],{})[_0x0ab1('0x2d')](function(_0x3455bf){var _0x18d7d7=_0x7c13d5[_0x0ab1('0x53')][_0x0ab1('0x2e')]({'plain':!![]});if(!_0x18d7d7)throw new Error(_0x0ab1('0x54'));if(_0x18d7d7['role']===_0x0ab1('0x53')){var _0x15b0f5=_0x3455bf['get']({'plain':!![]});var _0x2b67eb='Lists';return db[_0x0ab1('0x55')][_0x0ab1('0x50')]({'where':{'name':_0x2b67eb,'userProfileId':_0x18d7d7[_0x0ab1('0x56')]},'raw':!![]})[_0x0ab1('0x2d')](function(_0x1f2887){if(_0x1f2887&&_0x1f2887['autoAssociation']===0x0){return db[_0x0ab1('0x30')]['create']({'name':_0x15b0f5[_0x0ab1('0x34')],'resourceId':_0x15b0f5['id'],'type':_0x1f2887['name'],'sectionId':_0x1f2887['id']},{})[_0x0ab1('0x2d')](function(){return _0x3455bf;});}else{return _0x3455bf;}})[_0x0ab1('0x4e')](function(_0x376327){logger[_0x0ab1('0x32')](_0x0ab1('0x57'),_0x376327);throw _0x376327;});}return _0x3455bf;})['then'](respondWithResult(_0x271627,0xc9))[_0x0ab1('0x4e')](handleError(_0x271627,null));};exports[_0x0ab1('0x2c')]=function(_0x43d34e,_0x526d35){if(_0x43d34e[_0x0ab1('0x52')]['id']){delete _0x43d34e[_0x0ab1('0x52')]['id'];}return db[_0x0ab1('0x37')][_0x0ab1('0x50')]({'where':{'id':_0x43d34e[_0x0ab1('0x4f')]['id']}})['then'](handleEntityNotFound(_0x526d35,null))[_0x0ab1('0x2d')](saveUpdates(_0x43d34e['body'],null))[_0x0ab1('0x2d')](respondWithResult(_0x526d35,null))[_0x0ab1('0x4e')](handleError(_0x526d35,null));};exports[_0x0ab1('0x31')]=function(_0x370c83,_0x5cef74){return db['CmList'][_0x0ab1('0x50')]({'where':{'id':_0x370c83['params']['id']}})['then'](handleEntityNotFound(_0x5cef74,null))[_0x0ab1('0x2d')](removeEntity(_0x5cef74,null))[_0x0ab1('0x4e')](handleError(_0x5cef74,null));};exports[_0x0ab1('0x58')]=function(_0x2f50d7,_0x5807f1){return db[_0x0ab1('0x37')]['describe']()['then'](respondWithResult(_0x5807f1,null))[_0x0ab1('0x4e')](handleError(_0x5807f1,null));};exports['addDisposition']=function(_0x48c541,_0x10464c,_0x57704f){if(_0x48c541[_0x0ab1('0x52')]['id']){delete _0x48c541[_0x0ab1('0x52')]['id'];}return db[_0x0ab1('0x37')][_0x0ab1('0x50')]({'where':{'id':_0x48c541[_0x0ab1('0x4f')]['id']}})[_0x0ab1('0x2d')](handleEntityNotFound(_0x10464c,null))['then'](function(_0x326f6e){if(_0x326f6e){_0x48c541[_0x0ab1('0x52')]['ListId']=_0x326f6e['id'];return db[_0x0ab1('0x59')][_0x0ab1('0x51')](_0x48c541[_0x0ab1('0x52')]);}})['then'](respondWithResult(_0x10464c,null))[_0x0ab1('0x4e')](handleError(_0x10464c,null));};exports[_0x0ab1('0x5a')]=function(_0x51f882,_0xf02122,_0x170030){var _0x419e40={'raw':![],'where':{}};var _0xfcf688={};var _0x2c6e0f={'count':0x0,'rows':[]};return db['CmList'][_0x0ab1('0x5b')]({'where':{'id':_0x51f882[_0x0ab1('0x4f')]['id']}})[_0x0ab1('0x2d')](handleEntityNotFound(_0xf02122,null))['then'](function(_0x52c0d3){if(_0x52c0d3){_0xfcf688[_0x0ab1('0x3f')]=_['keys'](db[_0x0ab1('0x59')][_0x0ab1('0x38')]);_0xfcf688[_0x0ab1('0x3b')]=_['keys'](_0x51f882[_0x0ab1('0x3b')]);_0xfcf688[_0x0ab1('0x3d')]=_[_0x0ab1('0x3e')](_0xfcf688[_0x0ab1('0x3f')],_0xfcf688['query']);_0x419e40['attributes']=_[_0x0ab1('0x3e')](_0xfcf688[_0x0ab1('0x3f')],qs[_0x0ab1('0x41')](_0x51f882[_0x0ab1('0x3b')][_0x0ab1('0x41')]));_0x419e40[_0x0ab1('0x40')]=_0x419e40[_0x0ab1('0x40')][_0x0ab1('0x42')]?_0x419e40[_0x0ab1('0x40')]:_0xfcf688[_0x0ab1('0x3f')];if(!_0x51f882[_0x0ab1('0x3b')]['hasOwnProperty'](_0x0ab1('0x44'))){_0x419e40[_0x0ab1('0x24')]=qs[_0x0ab1('0x24')](_0x51f882[_0x0ab1('0x3b')][_0x0ab1('0x24')]);_0x419e40[_0x0ab1('0x23')]=qs['offset'](_0x51f882[_0x0ab1('0x3b')]['offset']);}_0x419e40[_0x0ab1('0x45')]=qs['sort'](_0x51f882[_0x0ab1('0x3b')]['sort']);_0x419e40[_0x0ab1('0x47')]=qs[_0x0ab1('0x3d')](_[_0x0ab1('0x5c')](_0x51f882[_0x0ab1('0x3b')],_0xfcf688[_0x0ab1('0x3d')]));_0x419e40[_0x0ab1('0x47')][_0x0ab1('0x5d')]=_0x52c0d3['id'];if(_0x51f882[_0x0ab1('0x3b')]['filter']){_0x419e40[_0x0ab1('0x47')]=_[_0x0ab1('0x49')](_0x419e40[_0x0ab1('0x47')],{'$or':_[_0x0ab1('0x36')](_0x419e40[_0x0ab1('0x40')],function(_0xd8049e){var _0x682cae={};_0x682cae[_0xd8049e]={'$like':'%'+_0x51f882[_0x0ab1('0x3b')][_0x0ab1('0x48')]+'%'};return _0x682cae;})});}_0x419e40=_[_0x0ab1('0x49')]({},_0x419e40,_0x51f882[_0x0ab1('0x5e')]);return db[_0x0ab1('0x59')][_0x0ab1('0x26')]({'where':_0x419e40[_0x0ab1('0x47')]})[_0x0ab1('0x2d')](function(_0x3ee825){_0x2c6e0f[_0x0ab1('0x26')]=_0x3ee825;if(_0x51f882[_0x0ab1('0x3b')]['includeAll']){_0x419e40[_0x0ab1('0x4c')]=[{'all':!![]}];}return db['Disposition'][_0x0ab1('0x4d')](_0x419e40);})[_0x0ab1('0x2d')](function(_0x141b14){_0x2c6e0f[_0x0ab1('0x5f')]=_0x141b14;return _0x2c6e0f;});}})['then'](respondWithFilteredResult(_0xf02122,_0x419e40))[_0x0ab1('0x4e')](handleError(_0xf02122,null));};exports[_0x0ab1('0x60')]=function(_0x1f8ebc,_0x40d10f,_0x2ec95f){return db[_0x0ab1('0x37')][_0x0ab1('0x50')]({'where':{'id':_0x1f8ebc[_0x0ab1('0x4f')]['id']}})['then'](handleEntityNotFound(_0x40d10f,null))[_0x0ab1('0x2d')](function(_0x17d920){if(_0x17d920){return _0x17d920[_0x0ab1('0x60')](_0x1f8ebc['query']['ids']);}})[_0x0ab1('0x2d')](respondWithStatusCode(_0x40d10f,null))[_0x0ab1('0x4e')](handleError(_0x40d10f,null));};exports[_0x0ab1('0x61')]=function(_0x2a5e36,_0x12969b,_0x29fdfd){return db['CmList'][_0x0ab1('0x50')]({'where':{'id':_0x2a5e36[_0x0ab1('0x4f')]['id']}})['then'](handleEntityNotFound(_0x12969b,null))[_0x0ab1('0x2d')](function(_0x4409bb){if(_0x4409bb){var _0x5054ce=[];var _0x2c5cdc={'success':[],'errors':[]};return db[_0x0ab1('0x62')]['describe']()['then'](function(_0x1a3205){if(_0x2a5e36[_0x0ab1('0x52')][_0x0ab1('0x63')]&&_[_0x0ab1('0x64')](_0x2a5e36['body'][_0x0ab1('0x63')])){if(_0x2a5e36[_0x0ab1('0x52')][_0x0ab1('0x63')][_0x0ab1('0x42')]){_0x2a5e36[_0x0ab1('0x52')][_0x0ab1('0x63')]=_0x2a5e36[_0x0ab1('0x52')]['tags'][_0x0ab1('0x65')](';')+';';}else{_0x2a5e36[_0x0ab1('0x52')][_0x0ab1('0x63')]=null;}}else{_0x2a5e36[_0x0ab1('0x52')][_0x0ab1('0x63')]=null;}if(_0x2a5e36[_0x0ab1('0x52')]&&_['isArray'](_0x2a5e36[_0x0ab1('0x52')])){for(var _0x1b229c=0x0;_0x1b229c<_0x2a5e36[_0x0ab1('0x52')][_0x0ab1('0x42')];_0x1b229c+=0x1){_0x2a5e36['body'][_0x1b229c][_0x0ab1('0x5d')]=_0x2a5e36[_0x0ab1('0x4f')]['id'];_0x5054ce[_0x0ab1('0x66')](_0x2a5e36[_0x0ab1('0x52')][_0x1b229c]);}return BPromise[_0x0ab1('0x67')](_0x5054ce,function(_0x1500c1){return db[_0x0ab1('0x62')][_0x0ab1('0x51')](_[_0x0ab1('0x68')](_0x1500c1,[_0x0ab1('0x69'),'id'])||{},{'fields':_[_0x0ab1('0x3c')](_0x1a3205),'raw':!![]})[_0x0ab1('0x2d')](function(_0x172ec5){_0x2c5cdc[_0x0ab1('0x6a')][_0x0ab1('0x66')](_0x172ec5[_0x0ab1('0x6b')]);})[_0x0ab1('0x4e')](function(_0xfaf301){_0x2c5cdc[_0x0ab1('0x6c')][_0x0ab1('0x66')]({'data':_0x1500c1,'error':_0xfaf301[_0x0ab1('0x6d')]});});})[_0x0ab1('0x2d')](function(_0x2d183f){return _0x2c5cdc;})['catch'](function(_0x3637e9){return _0x3637e9;});}else{_0x12969b[_0x0ab1('0x20')](0x190)[_0x0ab1('0x22')]({'message':_0x0ab1('0x6e')});}});}})[_0x0ab1('0x2d')](respondWithResult(_0x12969b,null))['catch'](handleError(_0x12969b,null));};exports['getContacts']=function(_0x4cb443,_0x39660a,_0x29b622){var _0x46c58f;return db['CmList'][_0x0ab1('0x50')]({'where':{'id':_0x4cb443[_0x0ab1('0x4f')]['id']},'include':[{'model':db[_0x0ab1('0x6f')],'as':_0x0ab1('0x70')}]})[_0x0ab1('0x2d')](handleEntityNotFound(_0x39660a,null))['then'](function(_0xf85db){if(_0xf85db){_0x46c58f=_0xf85db;return db['CmContact'][_0x0ab1('0x38')];}})[_0x0ab1('0x2d')](function(_0xae49ff){if(_0xae49ff){var _0x32d3ea={};var _0x26c07f={};_0x26c07f[_0x0ab1('0x3f')]=_[_0x0ab1('0x71')](_[_0x0ab1('0x3c')](_0xae49ff),_['map'](_0x46c58f[_0x0ab1('0x70')],function(_0x17da18){return util[_0x0ab1('0x72')](_0x0ab1('0x73'),_0x17da18['id']);}));_0x26c07f[_0x0ab1('0x3b')]=_[_0x0ab1('0x3c')](_0x4cb443[_0x0ab1('0x3b')]);_0x26c07f[_0x0ab1('0x3d')]=_[_0x0ab1('0x3e')](_0x26c07f[_0x0ab1('0x3f')],_0x26c07f[_0x0ab1('0x3b')]);_0x32d3ea[_0x0ab1('0x40')]=_[_0x0ab1('0x3e')](_0x26c07f['model'],qs[_0x0ab1('0x41')](_0x4cb443[_0x0ab1('0x3b')][_0x0ab1('0x41')]));_0x32d3ea['attributes']=_0x32d3ea[_0x0ab1('0x40')][_0x0ab1('0x42')]?_0x32d3ea[_0x0ab1('0x40')]:_0x26c07f[_0x0ab1('0x3f')];if(!_0x4cb443[_0x0ab1('0x3b')][_0x0ab1('0x43')]('nolimit')){_0x32d3ea[_0x0ab1('0x24')]=qs[_0x0ab1('0x24')](_0x4cb443[_0x0ab1('0x3b')]['limit']);_0x32d3ea[_0x0ab1('0x23')]=qs[_0x0ab1('0x23')](_0x4cb443[_0x0ab1('0x3b')][_0x0ab1('0x23')]);}_0x32d3ea[_0x0ab1('0x45')]=qs['sort'](_0x4cb443['query']['sort']);_0x32d3ea[_0x0ab1('0x47')]=qs[_0x0ab1('0x3d')](_[_0x0ab1('0x5c')](_0x4cb443['query'],_0x26c07f[_0x0ab1('0x3d')]));_0x32d3ea['raw']=!![];if(_0x4cb443[_0x0ab1('0x3b')]['filter']){_0x32d3ea[_0x0ab1('0x47')]=_['merge'](_0x32d3ea[_0x0ab1('0x47')],{'$or':_[_0x0ab1('0x36')](_0x32d3ea['attributes'],function(_0x407399){var _0x1f24b9={};_0x1f24b9[_0x407399]={'$like':'%'+_0x4cb443['query'][_0x0ab1('0x48')]+'%'};return _0x1f24b9;})});}_0x32d3ea=_['merge']({},_0x32d3ea,_0x4cb443['options']);return _0x46c58f[_0x0ab1('0x74')](_0x32d3ea);}})[_0x0ab1('0x2d')](respondWithResult(_0x39660a,null))[_0x0ab1('0x4e')](handleError(_0x39660a,null));};exports['getContactsCsv']=function(_0x4bfc3b,_0x5acaae,_0x1d79b6){var _0x17d5c9;var _0x323bc3;var _0x4ccfcc;var _0x4b8132=_0x4bfc3b[_0x0ab1('0x4f')]['id'];csv_results=[];return db[_0x0ab1('0x75')]['findAll']({'attributes':['id',_0x0ab1('0x34')],'raw':!![],'order':[_0x0ab1('0x76')]})['then'](function(_0x1c01d0){_0x17d5c9=_0x1c01d0;var _0x21d29b=_[_0x0ab1('0x3c')](db[_0x0ab1('0x62')][_0x0ab1('0x38')]);return db['CmCustomField'][_0x0ab1('0x4d')]({'raw':!![],'attributes':['id','alias']})[_0x0ab1('0x2d')](function(_0x16c69f){_0x323bc3=_0x16c69f;var _0xd73566=squel[_0x0ab1('0x77')]()[_0x0ab1('0x41')](_0x21d29b)[_0x0ab1('0x78')](_0x0ab1('0x79'),'c')[_0x0ab1('0x47')]('c.ListId\x20=\x20?',_0x4b8132)['where'](_0x0ab1('0x7a'))['distinct']();for(var _0x49ad76=0x0;_0x49ad76<_0x323bc3['length'];_0x49ad76++){_0xd73566[_0x0ab1('0x7b')](_0x0ab1('0x7c')+_0x323bc3[_0x49ad76]['id'],_0x0ab1('0x7d')+_0x323bc3[_0x49ad76][_0x0ab1('0x7e')]);}for(var _0x49ad76=0x0;_0x49ad76<_0x17d5c9[_0x0ab1('0x42')];_0x49ad76++){_0xd73566[_0x0ab1('0x7b')](squel[_0x0ab1('0x77')]()['field']('item')[_0x0ab1('0x78')](_0x0ab1('0x7f'))[_0x0ab1('0x47')](_0x0ab1('0x80'),_0x17d5c9[_0x49ad76]['id'])['where'](_0x0ab1('0x81')),_0x0ab1('0x82')+_0x17d5c9[_0x49ad76]['name']);_0xd73566[_0x0ab1('0x7b')](squel['select']()[_0x0ab1('0x7b')](_0x0ab1('0x83'))[_0x0ab1('0x78')]('cm_contact_has_items')[_0x0ab1('0x47')](_0x0ab1('0x80'),_0x17d5c9[_0x49ad76]['id'])[_0x0ab1('0x47')](_0x0ab1('0x81')),'description_additionalPhone_'+_0x17d5c9[_0x49ad76][_0x0ab1('0x34')]);}var _0x3511b7=[];_0x3511b7[_0x0ab1('0x66')](_0xd73566[_0x0ab1('0x84')]());BPromise[_0x0ab1('0x67')](_0x3511b7,handleQuery)[_0x0ab1('0x2d')](function(_0x4ce36e){handleQuery(_0xd73566['toString']());var _0xed2829=csv_results[0x0];if(!_[_0x0ab1('0x85')](_0xed2829)){var _0xec84f6=toCsv(_0xed2829);var _0x36738d=Date['now']();fs['writeFileSync'](util['format'](_0x0ab1('0x86'),_0x4b8132,_0x36738d),_0xec84f6);_0x5acaae[_0x0ab1('0x87')]('Content-disposition',_0x0ab1('0x88')+util[_0x0ab1('0x72')](_0x0ab1('0x89'),_0x4b8132,_0x36738d));_0x5acaae[_0x0ab1('0x87')](_0x0ab1('0x8a'),'text/csv');return _0x5acaae['download'](util[_0x0ab1('0x72')]('/tmp/list_%d_%s.csv',_0x4b8132,_0x36738d));}else{return _0x5acaae[_0x0ab1('0x1f')](0xcc);}});});});};exports[_0x0ab1('0x8b')]=function(_0x43d8d3,_0x3f427e,_0xcd4491){var _0x5b60db;delete _0x43d8d3[_0x0ab1('0x52')]['id'];return db[_0x0ab1('0x37')][_0x0ab1('0x5b')]({'where':{'id':_0x43d8d3[_0x0ab1('0x4f')]['id']}})[_0x0ab1('0x2d')](handleEntityNotFound(_0x3f427e,null))[_0x0ab1('0x2d')](function(_0x2ab481){if(_0x2ab481){return db[_0x0ab1('0x8c')][_0x0ab1('0x8d')](function(_0x302a6e){return db['CmCustomField'][_0x0ab1('0x51')](_0x43d8d3[_0x0ab1('0x52')],{'transaction':_0x302a6e})[_0x0ab1('0x2d')](function(_0x1f0abb){_0x5b60db=_0x1f0abb;return _0x2ab481['addCustomFields'](_0x1f0abb,{'transaction':_0x302a6e});})[_0x0ab1('0x2d')](function(){var _0x57229b={'type':db[_0x0ab1('0x8e')][_0x0ab1('0x8f')],'transaction':_0x302a6e};switch(_0x43d8d3['body']['type']){case _0x0ab1('0x90'):_0x57229b['type']=db['Sequelize'][_0x0ab1('0x8f')];break;case _0x0ab1('0x91'):_0x57229b[_0x0ab1('0x92')]=db['Sequelize'][_0x0ab1('0x93')];break;case _0x0ab1('0x94'):_0x57229b[_0x0ab1('0x92')]=db[_0x0ab1('0x8e')]['BOOLEAN'];_0x57229b[_0x0ab1('0x95')]=![];break;default:}return db['sequelize'][_0x0ab1('0x96')][_0x0ab1('0x97')]('cm_contacts',util[_0x0ab1('0x72')](_0x0ab1('0x98'),_0x5b60db['id']),_0x57229b);})[_0x0ab1('0x2d')](function(){return _0x5b60db;});});}})[_0x0ab1('0x2d')](respondWithResult(_0x3f427e,null))[_0x0ab1('0x4e')](handleError(_0x3f427e,null));};exports[_0x0ab1('0x99')]=function(_0x3de373,_0x34724d,_0x2effe8){var _0x30aa70={};var _0x516b31={};var _0x1be69e;var _0x5c33ea;return db[_0x0ab1('0x37')][_0x0ab1('0x5b')]({'where':{'id':_0x3de373['params']['id']}})[_0x0ab1('0x2d')](handleEntityNotFound(_0x34724d,null))[_0x0ab1('0x2d')](function(_0x3f6581){if(_0x3f6581){_0x1be69e=_0x3f6581;_0x516b31[_0x0ab1('0x3f')]=_[_0x0ab1('0x3c')](db[_0x0ab1('0x6f')][_0x0ab1('0x38')]);_0x516b31[_0x0ab1('0x3b')]=_['keys'](_0x3de373[_0x0ab1('0x3b')]);_0x516b31['filters']=_[_0x0ab1('0x3e')](_0x516b31['model'],_0x516b31[_0x0ab1('0x3b')]);_0x30aa70['attributes']=_[_0x0ab1('0x3e')](_0x516b31[_0x0ab1('0x3f')],qs[_0x0ab1('0x41')](_0x3de373[_0x0ab1('0x3b')][_0x0ab1('0x41')]));_0x30aa70[_0x0ab1('0x40')]=_0x30aa70[_0x0ab1('0x40')][_0x0ab1('0x42')]?_0x30aa70['attributes']:_0x516b31['model'];_0x30aa70[_0x0ab1('0x45')]=qs[_0x0ab1('0x46')](_0x3de373[_0x0ab1('0x3b')][_0x0ab1('0x46')]);_0x30aa70[_0x0ab1('0x47')]=qs['filters'](_[_0x0ab1('0x5c')](_0x3de373['query'],_0x516b31[_0x0ab1('0x3d')]));_0x30aa70['where']=_[_0x0ab1('0x49')](_0x30aa70[_0x0ab1('0x47')],{'$or':[{'ListId':_0x3f6581['id']},{'ListId':null}]});if(_0x3de373[_0x0ab1('0x3b')]['filter']){_0x30aa70[_0x0ab1('0x47')]=_[_0x0ab1('0x49')](_0x30aa70['where'],{'$or':_[_0x0ab1('0x36')](_0x30aa70[_0x0ab1('0x40')],function(_0x51197c){var _0x3ea3f2={};_0x3ea3f2[_0x51197c]={'$like':'%'+_0x3de373[_0x0ab1('0x3b')][_0x0ab1('0x48')]+'%'};return _0x3ea3f2;})});}_0x30aa70=_[_0x0ab1('0x49')]({},_0x30aa70,_0x3de373[_0x0ab1('0x5e')]);return db[_0x0ab1('0x6f')]['findAndCountAll'](_0x30aa70);}})[_0x0ab1('0x2d')](respondWithResult(_0x34724d,null))['catch'](handleError(_0x34724d,null));};exports[_0x0ab1('0x9a')]=function(_0x1ae25e,_0x1bd986){return db[_0x0ab1('0x6f')][_0x0ab1('0x9b')]({'where':{'ListId':null}})[_0x0ab1('0x2d')](handleEntityNotFound(_0x1bd986,null))[_0x0ab1('0x2d')](function(_0x23308a){return _0x23308a;})[_0x0ab1('0x2d')](respondWithResult(_0x1bd986,null))[_0x0ab1('0x4e')](handleError(_0x1bd986,null));};exports[_0x0ab1('0x9c')]=function(_0x3c7755,_0x13dcd2,_0x4ac282){return db['CmList'][_0x0ab1('0x50')]({'where':{'id':_0x3c7755[_0x0ab1('0x4f')]['id']}})[_0x0ab1('0x2d')](handleEntityNotFound(_0x13dcd2,null))[_0x0ab1('0x2d')](function(_0x10d3fe){if(_0x10d3fe){return _0x10d3fe[_0x0ab1('0x9c')](_0x3c7755[_0x0ab1('0x52')]['ids'],_[_0x0ab1('0x68')](_0x3c7755[_0x0ab1('0x52')],[_0x0ab1('0x69'),'id'])||{})[_0x0ab1('0x9d')](function(_0x5c3d6d){for(var _0x386499=0x0;_0x386499<_0x3c7755[_0x0ab1('0x52')][_0x0ab1('0x69')][_0x0ab1('0x42')];_0x386499+=0x1){socket[_0x0ab1('0x9e')](_0x0ab1('0x9f'),{'UserId':Number(_0x3c7755[_0x0ab1('0x52')][_0x0ab1('0x69')][_0x386499]),'CmListId':Number(_0x3c7755['params']['id'])});}return _0x5c3d6d;});}})[_0x0ab1('0x2d')](respondWithResult(_0x13dcd2,null))[_0x0ab1('0x4e')](handleError(_0x13dcd2,null));};exports['removeAgents']=function(_0x52c78c,_0x16e03b,_0x3f5fb0){return db[_0x0ab1('0x37')]['find']({'where':{'id':_0x52c78c[_0x0ab1('0x4f')]['id']}})['then'](handleEntityNotFound(_0x16e03b,null))[_0x0ab1('0x2d')](function(_0x21c95d){if(_0x21c95d){return _0x21c95d[_0x0ab1('0xa0')](_0x52c78c[_0x0ab1('0x3b')]['ids'])['then'](function(){if(_['isArray'](_0x52c78c[_0x0ab1('0x3b')][_0x0ab1('0x69')])){for(var _0x5c6014=0x0;_0x5c6014<_0x52c78c[_0x0ab1('0x3b')][_0x0ab1('0x69')][_0x0ab1('0x42')];_0x5c6014+=0x1){socket[_0x0ab1('0x9e')](_0x0ab1('0xa1'),{'UserId':Number(_0x52c78c[_0x0ab1('0x3b')]['ids'][_0x5c6014]),'CmListId':Number(_0x52c78c['params']['id'])});}}else{socket[_0x0ab1('0x9e')](_0x0ab1('0xa1'),{'UserId':Number(_0x52c78c[_0x0ab1('0x3b')][_0x0ab1('0x69')]),'CmListId':Number(_0x52c78c[_0x0ab1('0x4f')]['id'])});}});}})[_0x0ab1('0x2d')](respondWithStatusCode(_0x16e03b,null))[_0x0ab1('0x4e')](handleError(_0x16e03b,null));};exports['getAgents']=function(_0x5b2418,_0x393528,_0x34d80d){var _0x9fb80c={};var _0x732f9={};var _0x188ce8;var _0x40cb93;return db[_0x0ab1('0x37')]['findOne']({'where':{'id':_0x5b2418[_0x0ab1('0x4f')]['id']}})[_0x0ab1('0x2d')](handleEntityNotFound(_0x393528,null))[_0x0ab1('0x2d')](function(_0x2fc6e7){if(_0x2fc6e7){_0x188ce8=_0x2fc6e7;_0x732f9[_0x0ab1('0x3f')]=_[_0x0ab1('0x3c')](db[_0x0ab1('0xa2')][_0x0ab1('0x38')]);_0x732f9[_0x0ab1('0x3b')]=_[_0x0ab1('0x3c')](_0x5b2418[_0x0ab1('0x3b')]);_0x732f9[_0x0ab1('0x3d')]=_[_0x0ab1('0x3e')](_0x732f9['model'],_0x732f9[_0x0ab1('0x3b')]);_0x9fb80c[_0x0ab1('0x40')]=_['intersection'](_0x732f9['model'],qs[_0x0ab1('0x41')](_0x5b2418[_0x0ab1('0x3b')]['fields']));_0x9fb80c[_0x0ab1('0x40')]=_0x9fb80c[_0x0ab1('0x40')][_0x0ab1('0x42')]?_0x9fb80c['attributes']:_0x732f9[_0x0ab1('0x3f')];_0x9fb80c[_0x0ab1('0x45')]=qs['sort'](_0x5b2418[_0x0ab1('0x3b')][_0x0ab1('0x46')]);_0x9fb80c['where']=qs[_0x0ab1('0x3d')](_[_0x0ab1('0x5c')](_0x5b2418[_0x0ab1('0x3b')],_0x732f9['filters']));if(_0x5b2418[_0x0ab1('0x3b')]['filter']){_0x9fb80c[_0x0ab1('0x47')]=_[_0x0ab1('0x49')](_0x9fb80c['where'],{'$or':_['map'](_0x9fb80c[_0x0ab1('0x40')],function(_0x524bc1){var _0x4141a7={};_0x4141a7[_0x524bc1]={'$like':'%'+_0x5b2418[_0x0ab1('0x3b')][_0x0ab1('0x48')]+'%'};return _0x4141a7;})});}_0x9fb80c=_['merge']({},_0x9fb80c,_0x5b2418['options']);return _0x188ce8[_0x0ab1('0xa3')](_0x9fb80c);}})[_0x0ab1('0x2d')](function(_0x41a379){if(_0x41a379){_0x40cb93=_0x41a379[_0x0ab1('0x42')];if(!_0x5b2418['query'][_0x0ab1('0x43')]('nolimit')){_0x9fb80c[_0x0ab1('0x24')]=qs[_0x0ab1('0x24')](_0x5b2418[_0x0ab1('0x3b')][_0x0ab1('0x24')]);_0x9fb80c[_0x0ab1('0x23')]=qs[_0x0ab1('0x23')](_0x5b2418[_0x0ab1('0x3b')][_0x0ab1('0x23')]);}return _0x188ce8[_0x0ab1('0xa3')](_0x9fb80c);}})[_0x0ab1('0x2d')](function(_0x4dbb82){if(_0x4dbb82){return _0x4dbb82?{'count':_0x40cb93,'rows':_0x4dbb82}:null;}})['then'](respondWithResult(_0x393528,null))[_0x0ab1('0x4e')](handleError(_0x393528,null));};function handleQuery(_0x35f0e1){logger['info'](_0x35f0e1);return db['sequelize'][_0x0ab1('0x3b')](_0x35f0e1)[_0x0ab1('0x9d')](function(_0x59ab3a){csv_results[_0x0ab1('0x66')](_0x59ab3a);})['catch'](function(_0x2ed4cc){logger[_0x0ab1('0x32')](_0x2ed4cc[_0x0ab1('0x6d')]);});}
\ No newline at end of file
index d1feb34..51880ce 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7217=['emit','hasOwnProperty','hook','exports','events','CmList','setMaxListeners','save','update','remove'];(function(_0x39b9b3,_0x3e9a66){var _0x4977c8=function(_0x2610c9){while(--_0x2610c9){_0x39b9b3['push'](_0x39b9b3['shift']());}};_0x4977c8(++_0x3e9a66);}(_0x7217,0x19e));var _0x7721=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0x7217[_0x5037ab];return _0x512adb;};'use strict';var EventEmitter=require(_0x7721('0x0'));var CmList=require('../../mysqldb')['db'][_0x7721('0x1')];var CmListEvents=new EventEmitter();CmListEvents[_0x7721('0x2')](0x0);var events={'afterCreate':_0x7721('0x3'),'afterUpdate':_0x7721('0x4'),'afterDestroy':_0x7721('0x5')};function emitEvent(_0x4d6446){return function(_0x5bf160,_0x472a96,_0xce17f9){CmListEvents[_0x7721('0x6')](_0x4d6446+':'+_0x5bf160['id'],_0x5bf160);CmListEvents[_0x7721('0x6')](_0x4d6446,_0x5bf160);_0xce17f9(null);};}for(var e in events){if(events[_0x7721('0x7')](e)){var event=events[e];CmList[_0x7721('0x8')](e,emitEvent(event));}}module[_0x7721('0x9')]=CmListEvents;
\ No newline at end of file
+var _0x7217=['emit','hasOwnProperty','hook','exports','events','CmList','setMaxListeners','save','update','remove'];(function(_0xf60cd0,_0x34bf81){var _0x32ad56=function(_0x44cf0b){while(--_0x44cf0b){_0xf60cd0['push'](_0xf60cd0['shift']());}};_0x32ad56(++_0x34bf81);}(_0x7217,0x19e));var _0x7721=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0x7217[_0xf50820];return _0x2a9b10;};'use strict';var EventEmitter=require(_0x7721('0x0'));var CmList=require('../../mysqldb')['db'][_0x7721('0x1')];var CmListEvents=new EventEmitter();CmListEvents[_0x7721('0x2')](0x0);var events={'afterCreate':_0x7721('0x3'),'afterUpdate':_0x7721('0x4'),'afterDestroy':_0x7721('0x5')};function emitEvent(_0x4d6446){return function(_0x5bf160,_0x472a96,_0xce17f9){CmListEvents[_0x7721('0x6')](_0x4d6446+':'+_0x5bf160['id'],_0x5bf160);CmListEvents[_0x7721('0x6')](_0x4d6446,_0x5bf160);_0xce17f9(null);};}for(var e in events){if(events[_0x7721('0x7')](e)){var event=events[e];CmList[_0x7721('0x8')](e,emitEvent(event));}}module[_0x7721('0x9')]=CmListEvents;
\ No newline at end of file
index 48fe9e6..a9e1950 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2dae=['lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./cmList.attributes','exports','define','CmList','cm_lists'];(function(_0x2141d2,_0x3288aa){var _0x1080a5=function(_0x8308de){while(--_0x8308de){_0x2141d2['push'](_0x2141d2['shift']());}};_0x1080a5(++_0x3288aa);}(_0x2dae,0xc3));var _0xe2da=function(_0x1e03a6,_0xf0349){_0x1e03a6=_0x1e03a6-0x0;var _0x295b64=_0x2dae[_0x1e03a6];return _0x295b64;};'use strict';var _=require(_0xe2da('0x0'));var util=require('util');var logger=require(_0xe2da('0x1'))(_0xe2da('0x2'));var moment=require(_0xe2da('0x3'));var BPromise=require(_0xe2da('0x4'));var rp=require(_0xe2da('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe2da('0x6'));var config=require(_0xe2da('0x7'));var attributes=require(_0xe2da('0x8'));module[_0xe2da('0x9')]=function(_0x523c60,_0x3e3e25){return _0x523c60[_0xe2da('0xa')](_0xe2da('0xb'),attributes,{'tableName':_0xe2da('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0713=['moment','bluebird','request-promise','rimraf','../../config/environment','./cmList.attributes','exports','define','CmList','cm_lists','../../config/logger','api'];(function(_0xf3556b,_0x5d16ce){var _0x16d23b=function(_0x3cd758){while(--_0x3cd758){_0xf3556b['push'](_0xf3556b['shift']());}};_0x16d23b(++_0x5d16ce);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));module[_0x3071('0x8')]=function(_0xabd7b6,_0x41cf76){return _0xabd7b6[_0x3071('0x9')](_0x3071('0xa'),attributes,{'tableName':_0x3071('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 1035eb1..9479a60 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8578=['result','catch','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','./cmList.socket','register','request','then','info','CmList,\x20%s,\x20%s','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x8578,0x152));var _0x8857=function(_0x1724a7,_0x3709ec){_0x1724a7=_0x1724a7-0x0;var _0x3f6bb4=_0x8578[_0x1724a7];return _0x3f6bb4;};'use strict';var _=require(_0x8857('0x0'));var util=require(_0x8857('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8857('0x2'));var db=require(_0x8857('0x3'))['db'];var utils=require(_0x8857('0x4'));var logger=require(_0x8857('0x5'))(_0x8857('0x6'));var config=require(_0x8857('0x7'));var jayson=require(_0x8857('0x8'));var client=jayson['client'][_0x8857('0x9')]({'port':0x232a});config[_0x8857('0xa')]=_[_0x8857('0xb')](config[_0x8857('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x8857('0xc'))(new Redis(config[_0x8857('0xa')]));require(_0x8857('0xd'))[_0x8857('0xe')](socket);function respondWithRpcPromise(_0x4284d8,_0x4d2c7f,_0x3888f4){return new BPromise(function(_0x5b487c,_0x5e2d27){return client[_0x8857('0xf')](_0x4284d8,_0x3888f4)[_0x8857('0x10')](function(_0xa919ff){logger[_0x8857('0x11')](_0x8857('0x12'),_0x4d2c7f,_0x8857('0x13'));logger[_0x8857('0x14')](_0x8857('0x15'),_0x4d2c7f,_0x8857('0x13'),JSON[_0x8857('0x16')](_0xa919ff));if(_0xa919ff[_0x8857('0x17')]){if(_0xa919ff[_0x8857('0x17')][_0x8857('0x18')]===0x1f4){logger[_0x8857('0x17')]('CmList,\x20%s,\x20%s',_0x4d2c7f,_0xa919ff[_0x8857('0x17')][_0x8857('0x19')]);return _0x5e2d27(_0xa919ff[_0x8857('0x17')][_0x8857('0x19')]);}logger[_0x8857('0x17')](_0x8857('0x12'),_0x4d2c7f,_0xa919ff[_0x8857('0x17')]['message']);return _0x5b487c(_0xa919ff[_0x8857('0x17')][_0x8857('0x19')]);}else{logger[_0x8857('0x11')]('CmList,\x20%s,\x20%s',_0x4d2c7f,_0x8857('0x13'));_0x5b487c(_0xa919ff[_0x8857('0x1a')][_0x8857('0x19')]);}})[_0x8857('0x1b')](function(_0x2e7525){logger['error'](_0x8857('0x12'),_0x4d2c7f,_0x2e7525);_0x5e2d27(_0x2e7525);});});}
\ No newline at end of file
+var _0x479c=['ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','redis','localhost','./cmList.socket','register','request','then','info','CmList,\x20%s,\x20%s,\x20%s','stringify','error','code','message','CmList,\x20%s,\x20%s','request\x20sent','result','catch','lodash','util','moment','randomstring'];(function(_0x171446,_0x341df4){var _0x309220=function(_0x1b4e2d){while(--_0x1b4e2d){_0x171446['push'](_0x171446['shift']());}};_0x309220(++_0x341df4);}(_0x479c,0x7e));var _0xc479=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0x479c[_0x2070da];return _0x4f9fe1;};'use strict';var _=require(_0xc479('0x0'));var util=require(_0xc479('0x1'));var moment=require(_0xc479('0x2'));var BPromise=require('bluebird');var rs=require(_0xc479('0x3'));var fs=require('fs');var Redis=require(_0xc479('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc479('0x5'));var logger=require(_0xc479('0x6'))('rpc');var config=require(_0xc479('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xc479('0x8')][_0xc479('0x9')]({'port':0x232a});config[_0xc479('0xa')]=_['defaults'](config[_0xc479('0xa')],{'host':_0xc479('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xc479('0xc'))[_0xc479('0xd')](socket);function respondWithRpcPromise(_0x5505bc,_0x176452,_0x531012){return new BPromise(function(_0x1dcc05,_0x250e74){return client[_0xc479('0xe')](_0x5505bc,_0x531012)[_0xc479('0xf')](function(_0x22430c){logger[_0xc479('0x10')]('CmList,\x20%s,\x20%s',_0x176452,'request\x20sent');logger['debug'](_0xc479('0x11'),_0x176452,'request\x20sent',JSON[_0xc479('0x12')](_0x22430c));if(_0x22430c[_0xc479('0x13')]){if(_0x22430c[_0xc479('0x13')][_0xc479('0x14')]===0x1f4){logger['error']('CmList,\x20%s,\x20%s',_0x176452,_0x22430c[_0xc479('0x13')][_0xc479('0x15')]);return _0x250e74(_0x22430c[_0xc479('0x13')][_0xc479('0x15')]);}logger[_0xc479('0x13')](_0xc479('0x16'),_0x176452,_0x22430c[_0xc479('0x13')][_0xc479('0x15')]);return _0x1dcc05(_0x22430c[_0xc479('0x13')][_0xc479('0x15')]);}else{logger[_0xc479('0x10')](_0xc479('0x16'),_0x176452,_0xc479('0x17'));_0x1dcc05(_0x22430c[_0xc479('0x18')][_0xc479('0x15')]);}})[_0xc479('0x19')](function(_0x36d3a2){logger[_0xc479('0x13')]('CmList,\x20%s,\x20%s',_0x176452,_0x36d3a2);_0x250e74(_0x36d3a2);});});}
\ No newline at end of file
index beba6d6..0e5bea0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0f00=['remove','update','removeListener','register','length','cmList:','./cmList.events','save'];(function(_0x2857fc,_0x411fd1){var _0x49047c=function(_0x30ceb2){while(--_0x30ceb2){_0x2857fc['push'](_0x2857fc['shift']());}};_0x49047c(++_0x411fd1);}(_0x0f00,0x1de));var _0x00f0=function(_0x45b034,_0x3a57dd){_0x45b034=_0x45b034-0x0;var _0x509cb0=_0x0f00[_0x45b034];return _0x509cb0;};'use strict';var CmListEvents=require(_0x00f0('0x0'));var events=[_0x00f0('0x1'),_0x00f0('0x2'),_0x00f0('0x3')];function createListener(_0xe28a34,_0x14f2cb){return function(_0x40ca55){_0x14f2cb['emit'](_0xe28a34,_0x40ca55);};}function removeListener(_0x432ed3,_0x145a4d){return function(){CmListEvents[_0x00f0('0x4')](_0x432ed3,_0x145a4d);};}exports[_0x00f0('0x5')]=function(_0x4d9654){for(var _0x5cb523=0x0,_0x8145da=events[_0x00f0('0x6')];_0x5cb523<_0x8145da;_0x5cb523++){var _0x332d8e=events[_0x5cb523];var _0x4b3225=createListener(_0x00f0('0x7')+_0x332d8e,_0x4d9654);CmListEvents['on'](_0x332d8e,_0x4b3225);}};
\ No newline at end of file
+var _0x96a3=['./cmList.events','remove','removeListener','register','length','cmList:'];(function(_0x273f77,_0xe5b0cb){var _0x71e147=function(_0x564056){while(--_0x564056){_0x273f77['push'](_0x273f77['shift']());}};_0x71e147(++_0xe5b0cb);}(_0x96a3,0x126));var _0x396a=function(_0x480a48,_0x2ca5a8){_0x480a48=_0x480a48-0x0;var _0x2b34ec=_0x96a3[_0x480a48];return _0x2b34ec;};'use strict';var CmListEvents=require(_0x396a('0x0'));var events=['save',_0x396a('0x1'),'update'];function createListener(_0x12092f,_0x483652){return function(_0x7222c9){_0x483652['emit'](_0x12092f,_0x7222c9);};}function removeListener(_0x43ae58,_0x38a348){return function(){CmListEvents[_0x396a('0x2')](_0x43ae58,_0x38a348);};}exports[_0x396a('0x3')]=function(_0x8d54b1){for(var _0x179d44=0x0,_0x64dfa5=events[_0x396a('0x4')];_0x179d44<_0x64dfa5;_0x179d44++){var _0x48a482=events[_0x179d44];var _0x157240=createListener(_0x396a('0x5')+_0x48a482,_0x8d54b1);CmListEvents['on'](_0x48a482,_0x157240);}};
\ No newline at end of file
index 9910a6f..a23f1fa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb8a4=['isAuthenticated','index','/global_fields','getGlobalCustomFields','/:id','show','/:id/dispositions','/:id/contacts','getContacts','/:id/contacts/csv','getContactsCsv','/:id/fields','getCustomFields','/:id/users','getAgents','post','addDisposition','addContacts','addCustomField','put','update','delete','destroy','removeDispositions','removeAgents','exports','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmList.controller','get'];(function(_0x4243a3,_0x447337){var _0x1b2a33=function(_0x6a8200){while(--_0x6a8200){_0x4243a3['push'](_0x4243a3['shift']());}};_0x1b2a33(++_0x447337);}(_0xb8a4,0x83));var _0x4b8a=function(_0x14de89,_0xc4cafe){_0x14de89=_0x14de89-0x0;var _0x3a9d2a=_0xb8a4[_0x14de89];return _0x3a9d2a;};'use strict';var multer=require('multer');var util=require(_0x4b8a('0x0'));var path=require(_0x4b8a('0x1'));var timeout=require(_0x4b8a('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x4b8a('0x3'));var auth=require(_0x4b8a('0x4'));var interaction=require(_0x4b8a('0x5'));var config=require(_0x4b8a('0x6'));var controller=require(_0x4b8a('0x7'));router[_0x4b8a('0x8')]('/',auth[_0x4b8a('0x9')](),controller[_0x4b8a('0xa')]);router[_0x4b8a('0x8')]('/describe',auth[_0x4b8a('0x9')](),controller['describe']);router[_0x4b8a('0x8')](_0x4b8a('0xb'),auth[_0x4b8a('0x9')](),controller[_0x4b8a('0xc')]);router[_0x4b8a('0x8')](_0x4b8a('0xd'),auth[_0x4b8a('0x9')](),controller[_0x4b8a('0xe')]);router[_0x4b8a('0x8')](_0x4b8a('0xf'),auth['isAuthenticated'](),controller['getDispositions']);router[_0x4b8a('0x8')](_0x4b8a('0x10'),auth[_0x4b8a('0x9')](),controller[_0x4b8a('0x11')]);router[_0x4b8a('0x8')](_0x4b8a('0x12'),auth[_0x4b8a('0x9')](),controller[_0x4b8a('0x13')]);router[_0x4b8a('0x8')](_0x4b8a('0x14'),auth[_0x4b8a('0x9')](),controller[_0x4b8a('0x15')]);router[_0x4b8a('0x8')](_0x4b8a('0x16'),auth[_0x4b8a('0x9')](),controller[_0x4b8a('0x17')]);router[_0x4b8a('0x18')]('/',auth['isAuthenticated'](),controller['create']);router[_0x4b8a('0x18')](_0x4b8a('0xf'),auth['isAuthenticated'](),controller[_0x4b8a('0x19')]);router[_0x4b8a('0x18')]('/:id/contacts',auth[_0x4b8a('0x9')](),controller[_0x4b8a('0x1a')]);router[_0x4b8a('0x18')](_0x4b8a('0x14'),auth[_0x4b8a('0x9')](),controller[_0x4b8a('0x1b')]);router['post'](_0x4b8a('0x16'),auth[_0x4b8a('0x9')](),controller['addAgents']);router[_0x4b8a('0x1c')](_0x4b8a('0xd'),auth[_0x4b8a('0x9')](),controller[_0x4b8a('0x1d')]);router[_0x4b8a('0x1e')]('/:id',auth[_0x4b8a('0x9')](),controller[_0x4b8a('0x1f')]);router[_0x4b8a('0x1e')](_0x4b8a('0xf'),auth[_0x4b8a('0x9')](),controller[_0x4b8a('0x20')]);router['delete'](_0x4b8a('0x16'),auth[_0x4b8a('0x9')](),controller[_0x4b8a('0x21')]);module[_0x4b8a('0x22')]=router;
\ No newline at end of file
+var _0xc694=['path','Router','../../components/auth/service','../../components/interaction/service','./cmList.controller','get','isAuthenticated','index','/describe','describe','/global_fields','getGlobalCustomFields','/:id','show','/:id/dispositions','/:id/contacts','getContacts','/:id/contacts/csv','getContactsCsv','/:id/fields','getCustomFields','getAgents','post','create','addDisposition','addCustomField','/:id/users','addAgents','put','update','delete','destroy','removeDispositions','exports','multer','util'];(function(_0x2300f2,_0x315c5f){var _0x6bd508=function(_0x2fa0f6){while(--_0x2fa0f6){_0x2300f2['push'](_0x2300f2['shift']());}};_0x6bd508(++_0x315c5f);}(_0xc694,0x11e));var _0x4c69=function(_0x141177,_0x2944fc){_0x141177=_0x141177-0x0;var _0x3014ad=_0xc694[_0x141177];return _0x3014ad;};'use strict';var multer=require(_0x4c69('0x0'));var util=require(_0x4c69('0x1'));var path=require(_0x4c69('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x4c69('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x4c69('0x4'));var interaction=require(_0x4c69('0x5'));var config=require('../../config/environment');var controller=require(_0x4c69('0x6'));router[_0x4c69('0x7')]('/',auth[_0x4c69('0x8')](),controller[_0x4c69('0x9')]);router[_0x4c69('0x7')](_0x4c69('0xa'),auth[_0x4c69('0x8')](),controller[_0x4c69('0xb')]);router[_0x4c69('0x7')](_0x4c69('0xc'),auth[_0x4c69('0x8')](),controller[_0x4c69('0xd')]);router[_0x4c69('0x7')](_0x4c69('0xe'),auth['isAuthenticated'](),controller[_0x4c69('0xf')]);router[_0x4c69('0x7')](_0x4c69('0x10'),auth[_0x4c69('0x8')](),controller['getDispositions']);router[_0x4c69('0x7')](_0x4c69('0x11'),auth['isAuthenticated'](),controller[_0x4c69('0x12')]);router[_0x4c69('0x7')](_0x4c69('0x13'),auth['isAuthenticated'](),controller[_0x4c69('0x14')]);router[_0x4c69('0x7')](_0x4c69('0x15'),auth['isAuthenticated'](),controller[_0x4c69('0x16')]);router[_0x4c69('0x7')]('/:id/users',auth['isAuthenticated'](),controller[_0x4c69('0x17')]);router[_0x4c69('0x18')]('/',auth[_0x4c69('0x8')](),controller[_0x4c69('0x19')]);router[_0x4c69('0x18')]('/:id/dispositions',auth[_0x4c69('0x8')](),controller[_0x4c69('0x1a')]);router[_0x4c69('0x18')](_0x4c69('0x11'),auth[_0x4c69('0x8')](),controller['addContacts']);router[_0x4c69('0x18')]('/:id/fields',auth['isAuthenticated'](),controller[_0x4c69('0x1b')]);router[_0x4c69('0x18')](_0x4c69('0x1c'),auth[_0x4c69('0x8')](),controller[_0x4c69('0x1d')]);router[_0x4c69('0x1e')]('/:id',auth[_0x4c69('0x8')](),controller[_0x4c69('0x1f')]);router[_0x4c69('0x20')](_0x4c69('0xe'),auth[_0x4c69('0x8')](),controller[_0x4c69('0x21')]);router[_0x4c69('0x20')](_0x4c69('0x10'),auth[_0x4c69('0x8')](),controller[_0x4c69('0x22')]);router[_0x4c69('0x20')](_0x4c69('0x1c'),auth['isAuthenticated'](),controller['removeAgents']);module[_0x4c69('0x23')]=router;
\ No newline at end of file
index 8774f55..60ad11d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe459=['getDataValue','STRING','sequelize'];(function(_0x2680e3,_0x243387){var _0x3e789f=function(_0x487950){while(--_0x487950){_0x2680e3['push'](_0x2680e3['shift']());}};_0x3e789f(++_0x243387);}(_0xe459,0x13d));var _0x9e45=function(_0x39edbd,_0x38aa3a){_0x39edbd=_0x39edbd-0x0;var _0x29012f=_0xe459[_0x39edbd];return _0x29012f;};'use strict';var Sequelize=require(_0x9e45('0x0'));module['exports']={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x147851){return this[_0x9e45('0x1')]('field');}},'field':{'type':Sequelize['STRING'],'allowNull':![]},'operator':{'type':Sequelize[_0x9e45('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x9e45('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0x086f=['exports','VIRTUAL','getDataValue','STRING','sequelize'];(function(_0x1e65b9,_0x949ce8){var _0x45cdf8=function(_0x1f766f){while(--_0x1f766f){_0x1e65b9['push'](_0x1e65b9['shift']());}};_0x45cdf8(++_0x949ce8);}(_0x086f,0x72));var _0xf086=function(_0x778c05,_0x368acd){_0x778c05=_0x778c05-0x0;var _0x5c849b=_0x086f[_0x778c05];return _0x5c849b;};'use strict';var Sequelize=require(_0xf086('0x0'));module[_0xf086('0x1')]={'name':{'type':Sequelize[_0xf086('0x2')],'get':function(_0x217a80){return this[_0xf086('0x3')]('field');}},'field':{'type':Sequelize[_0xf086('0x4')],'allowNull':![]},'operator':{'type':Sequelize[_0xf086('0x4')],'allowNull':![]},'value':{'type':Sequelize[_0xf086('0x4')],'allowNull':![]}};
\ No newline at end of file
index 0dea899..7cb3d90 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(_0x47488,_0x44c5a3){var _0x531a83=function(_0x52fcfe){while(--_0x52fcfe){_0x47488['push'](_0x47488['shift']());}};_0x531a83(++_0x44c5a3);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){if(_0x4b6f99['body']['id']){delete _0x4b6f99[_0x7995('0x2c')]['id'];}return db[_0x7995('0x2d')][_0x7995('0x2e')]({'where':{'id':_0x4b6f99['params']['id']}})['then'](handleEntityNotFound(_0x9b2a15,null))['then'](saveUpdates(_0x4b6f99[_0x7995('0x2c')],null))[_0x7995('0x26')](respondWithResult(_0x9b2a15,null))[_0x7995('0x2f')](handleError(_0x9b2a15,null));};exports[_0x7995('0x27')]=function(_0x2e3493,_0x1ca460){return db['Condition']['find']({'where':{'id':_0x2e3493[_0x7995('0x30')]['id']}})['then'](handleEntityNotFound(_0x1ca460,null))[_0x7995('0x26')](removeEntity(_0x1ca460,null))[_0x7995('0x2f')](handleError(_0x1ca460,null));};
\ No newline at end of file
+var _0x7a54=['sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','body','Condition','find','catch','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path'];(function(_0x440a67,_0x59104){var _0xb6d702=function(_0x1d7fab){while(--_0x1d7fab){_0x440a67['push'](_0x440a67['shift']());}};_0xb6d702(++_0x59104);}(_0x7a54,0x106));var _0x47a5=function(_0x35fdce,_0x4646aa){_0x35fdce=_0x35fdce-0x0;var _0x523e34=_0x7a54[_0x35fdce];return _0x523e34;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x22')]=function(_0x136b14,_0x16631f){if(_0x136b14[_0x47a5('0x29')]['id']){delete _0x136b14[_0x47a5('0x29')]['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x136b14['params']['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x16631f,null))['then'](saveUpdates(_0x136b14[_0x47a5('0x29')],null))[_0x47a5('0x23')](respondWithResult(_0x16631f,null))[_0x47a5('0x2c')](handleError(_0x16631f,null));};exports['destroy']=function(_0x256650,_0x625952){return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x256650['params']['id']}})['then'](handleEntityNotFound(_0x625952,null))[_0x47a5('0x23')](removeEntity(_0x625952,null))[_0x47a5('0x2c')](handleError(_0x625952,null));};
\ No newline at end of file
index b6804c1..ed1c146 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd9dd=['./condition.attributes','Condition','lodash','util','../../config/logger','request-promise','path','rimraf','../../config/environment'];(function(_0xbe2983,_0x4c764d){var _0x139600=function(_0x2700e3){while(--_0x2700e3){_0xbe2983['push'](_0xbe2983['shift']());}};_0x139600(++_0x4c764d);}(_0xd9dd,0xb6));var _0xdd9d=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd9dd[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0xdd9d('0x0'));var util=require(_0xdd9d('0x1'));var logger=require(_0xdd9d('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xdd9d('0x3'));var fs=require('fs');var path=require(_0xdd9d('0x4'));var rimraf=require(_0xdd9d('0x5'));var config=require(_0xdd9d('0x6'));var attributes=require(_0xdd9d('0x7'));module['exports']=function(_0x4acebe,_0x362640){return _0x4acebe['define'](_0xdd9d('0x8'),attributes,{'tableName':'tools_conditions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd9b6=['Condition','tools_conditions','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./condition.attributes','exports'];(function(_0x174ef5,_0x256e8e){var _0x1cc379=function(_0x3eafcf){while(--_0x3eafcf){_0x174ef5['push'](_0x174ef5['shift']());}};_0x1cc379(++_0x256e8e);}(_0xd9b6,0x1a2));var _0x6d9b=function(_0x7a4b16,_0x2c3b70){_0x7a4b16=_0x7a4b16-0x0;var _0x59e441=_0xd9b6[_0x7a4b16];return _0x59e441;};'use strict';var _=require('lodash');var util=require(_0x6d9b('0x0'));var logger=require(_0x6d9b('0x1'))(_0x6d9b('0x2'));var moment=require(_0x6d9b('0x3'));var BPromise=require(_0x6d9b('0x4'));var rp=require(_0x6d9b('0x5'));var fs=require('fs');var path=require(_0x6d9b('0x6'));var rimraf=require(_0x6d9b('0x7'));var config=require(_0x6d9b('0x8'));var attributes=require(_0x6d9b('0x9'));module[_0x6d9b('0xa')]=function(_0x5e11ec,_0x4b58cb){return _0x5e11ec['define'](_0x6d9b('0xb'),attributes,{'tableName':_0x6d9b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 8da45a3..4444708 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7c7d=['../../config/environment','client','http','request','then','info','debug','Condition,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Condition,\x20%s,\x20%s','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x37e81f,_0x4de6ec){var _0x1fade0=function(_0x2eddea){while(--_0x2eddea){_0x37e81f['push'](_0x37e81f['shift']());}};_0x1fade0(++_0x4de6ec);}(_0x7c7d,0x13b));var _0xd7c7=function(_0x3f55ee,_0x104eef){_0x3f55ee=_0x3f55ee-0x0;var _0xf895ba=_0x7c7d[_0x3f55ee];return _0xf895ba;};'use strict';var _=require(_0xd7c7('0x0'));var util=require('util');var moment=require(_0xd7c7('0x1'));var BPromise=require('bluebird');var rs=require(_0xd7c7('0x2'));var fs=require('fs');var Redis=require(_0xd7c7('0x3'));var db=require(_0xd7c7('0x4'))['db'];var utils=require(_0xd7c7('0x5'));var logger=require(_0xd7c7('0x6'))('rpc');var config=require(_0xd7c7('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xd7c7('0x8')][_0xd7c7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x18228b,_0x54e89d,_0x22f67b){return new BPromise(function(_0x46b1d4,_0x52fedf){return client[_0xd7c7('0xa')](_0x18228b,_0x22f67b)[_0xd7c7('0xb')](function(_0xa2e2b0){logger[_0xd7c7('0xc')]('Condition,\x20%s,\x20%s',_0x54e89d,'request\x20sent');logger[_0xd7c7('0xd')](_0xd7c7('0xe'),_0x54e89d,_0xd7c7('0xf'),JSON[_0xd7c7('0x10')](_0xa2e2b0));if(_0xa2e2b0[_0xd7c7('0x11')]){if(_0xa2e2b0[_0xd7c7('0x11')][_0xd7c7('0x12')]===0x1f4){logger['error'](_0xd7c7('0x13'),_0x54e89d,_0xa2e2b0['error'][_0xd7c7('0x14')]);return _0x52fedf(_0xa2e2b0[_0xd7c7('0x11')][_0xd7c7('0x14')]);}logger[_0xd7c7('0x11')](_0xd7c7('0x13'),_0x54e89d,_0xa2e2b0[_0xd7c7('0x11')][_0xd7c7('0x14')]);return _0x46b1d4(_0xa2e2b0[_0xd7c7('0x11')]['message']);}else{logger[_0xd7c7('0xc')](_0xd7c7('0x13'),_0x54e89d,_0xd7c7('0xf'));_0x46b1d4(_0xa2e2b0[_0xd7c7('0x15')]['message']);}})[_0xd7c7('0x16')](function(_0xc97bc8){logger[_0xd7c7('0x11')]('Condition,\x20%s,\x20%s',_0x54e89d,_0xc97bc8);_0x52fedf(_0xc97bc8);});});}
\ No newline at end of file
+var _0xacd3=['moment','bluebird','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Condition,\x20%s,\x20%s','request\x20sent','Condition,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util'];(function(_0x51f130,_0x880c0f){var _0x2af9e2=function(_0x4f0d22){while(--_0x4f0d22){_0x51f130['push'](_0x51f130['shift']());}};_0x2af9e2(++_0x880c0f);}(_0xacd3,0x18d));var _0x3acd=function(_0x45a0c8,_0x2c58ef){_0x45a0c8=_0x45a0c8-0x0;var _0x2599a4=_0xacd3[_0x45a0c8];return _0x2599a4;};'use strict';var _=require(_0x3acd('0x0'));var util=require(_0x3acd('0x1'));var moment=require(_0x3acd('0x2'));var BPromise=require(_0x3acd('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3acd('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3acd('0x5'))('rpc');var config=require(_0x3acd('0x6'));var jayson=require(_0x3acd('0x7'));var client=jayson[_0x3acd('0x8')][_0x3acd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x17b447,_0x4e631e,_0x50cb4b){return new BPromise(function(_0x1c1952,_0x112719){return client['request'](_0x17b447,_0x50cb4b)[_0x3acd('0xa')](function(_0xdcb52){logger[_0x3acd('0xb')](_0x3acd('0xc'),_0x4e631e,_0x3acd('0xd'));logger['debug'](_0x3acd('0xe'),_0x4e631e,_0x3acd('0xd'),JSON[_0x3acd('0xf')](_0xdcb52));if(_0xdcb52[_0x3acd('0x10')]){if(_0xdcb52[_0x3acd('0x10')][_0x3acd('0x11')]===0x1f4){logger[_0x3acd('0x10')]('Condition,\x20%s,\x20%s',_0x4e631e,_0xdcb52[_0x3acd('0x10')][_0x3acd('0x12')]);return _0x112719(_0xdcb52['error']['message']);}logger['error'](_0x3acd('0xc'),_0x4e631e,_0xdcb52['error'][_0x3acd('0x12')]);return _0x1c1952(_0xdcb52[_0x3acd('0x10')][_0x3acd('0x12')]);}else{logger[_0x3acd('0xb')](_0x3acd('0xc'),_0x4e631e,_0x3acd('0xd'));_0x1c1952(_0xdcb52[_0x3acd('0x13')]['message']);}})[_0x3acd('0x14')](function(_0x23d0d7){logger['error'](_0x3acd('0xc'),_0x4e631e,_0x23d0d7);_0x112719(_0x23d0d7);});});}
\ No newline at end of file
index 3c3f8f8..396cc68 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdffb=['isAuthenticated','destroy','exports','multer','express','Router','fs-extra','../../components/auth/service','../../config/environment','put','/:id','update','delete'];(function(_0x126fb9,_0x122c59){var _0xc8a3b1=function(_0x355744){while(--_0x355744){_0x126fb9['push'](_0x126fb9['shift']());}};_0xc8a3b1(++_0x122c59);}(_0xdffb,0x148));var _0xbdff=function(_0x490832,_0x5be5bb){_0x490832=_0x490832-0x0;var _0x27dcda=_0xdffb[_0x490832];return _0x27dcda;};'use strict';var multer=require(_0xbdff('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbdff('0x1'));var router=express[_0xbdff('0x2')]();var fs_extra=require(_0xbdff('0x3'));var auth=require(_0xbdff('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xbdff('0x5'));var controller=require('./condition.controller');router[_0xbdff('0x6')](_0xbdff('0x7'),auth['isAuthenticated'](),controller[_0xbdff('0x8')]);router[_0xbdff('0x9')](_0xbdff('0x7'),auth[_0xbdff('0xa')](),controller[_0xbdff('0xb')]);module[_0xbdff('0xc')]=router;
\ No newline at end of file
+var _0xf09b=['update','isAuthenticated','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./condition.controller','put','/:id'];(function(_0x3fff53,_0xf8d045){var _0x41d153=function(_0x432fc5){while(--_0x432fc5){_0x3fff53['push'](_0x3fff53['shift']());}};_0x41d153(++_0xf8d045);}(_0xf09b,0xb4));var _0xbf09=function(_0x4b1edc,_0x412675){_0x4b1edc=_0x4b1edc-0x0;var _0x1f235f=_0xf09b[_0x4b1edc];return _0x1f235f;};'use strict';var multer=require(_0xbf09('0x0'));var util=require(_0xbf09('0x1'));var path=require(_0xbf09('0x2'));var timeout=require(_0xbf09('0x3'));var express=require(_0xbf09('0x4'));var router=express[_0xbf09('0x5')]();var fs_extra=require(_0xbf09('0x6'));var auth=require(_0xbf09('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xbf09('0x8'));var controller=require(_0xbf09('0x9'));router[_0xbf09('0xa')](_0xbf09('0xb'),auth['isAuthenticated'](),controller[_0xbf09('0xc')]);router['delete'](_0xbf09('0xb'),auth[_0xbf09('0xd')](),controller[_0xbf09('0xe')]);module[_0xbf09('0xf')]=router;
\ No newline at end of file
index bc11adc..ae80023 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb70c=['INTEGER','STRING','name'];(function(_0xbb14db,_0x3ee8c6){var _0x36bed7=function(_0x16c478){while(--_0x16c478){_0xbb14db['push'](_0xbb14db['shift']());}};_0x36bed7(++_0x3ee8c6);}(_0xb70c,0x15d));var _0xcb70=function(_0x184759,_0x1cc38a){_0x184759=_0x184759-0x0;var _0xf26d5f=_0xb70c[_0x184759];return _0xf26d5f;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xcb70('0x0')],'allowNull':![],'unique':_0xcb70('0x1')},'OrderBy':{'type':Sequelize[_0xcb70('0x2')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize['STRING'],'allowNull':!![]}};
\ No newline at end of file
+var _0x3978=['STRING','sequelize','exports','name','INTEGER'];(function(_0x16e50a,_0x5aec08){var _0x1bf2b6=function(_0x449873){while(--_0x449873){_0x16e50a['push'](_0x16e50a['shift']());}};_0x1bf2b6(++_0x5aec08);}(_0x3978,0xb0));var _0x8397=function(_0x4d6b23,_0x2001fc){_0x4d6b23=_0x4d6b23-0x0;var _0x4fbb27=_0x3978[_0x4d6b23];return _0x4fbb27;};'use strict';var Sequelize=require(_0x8397('0x0'));module[_0x8397('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x8397('0x2')},'OrderBy':{'type':Sequelize[_0x8397('0x3')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0x8397('0x4')],'allowNull':!![]}};
\ No newline at end of file
index 4fa1727..d871e0d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x36ee=['../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','ContactItemTypes','stack','index','map','ContactItemType','rawAttributes','fieldName','type','model','name','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','include','rows','catch','show','params','includeAll','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','CmContactHasItem','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'];(function(_0x638bee,_0x43cc86){var _0x475b42=function(_0x5dcd68){while(--_0x5dcd68){_0x638bee['push'](_0x638bee['shift']());}};_0x475b42(++_0x43cc86);}(_0x36ee,0xe8));var _0xe36e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x36ee[_0x3dd15e];return _0x231fd0;};'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(){var _0xb32195=_0x4749a8[_0xe36e('0x28')]({'plain':!![]});var _0x1507f9=_0xe36e('0x29');return db['UserProfileResource'][_0xe36e('0x27')]({'where':{'type':_0x1507f9,'resourceId':_0xb32195['id']}})[_0xe36e('0x26')](function(){return _0x4749a8;});})[_0xe36e('0x26')](function(){_0x53e13a[_0xe36e('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d757c,_0x5a3133){return function(_0xf7b02e){if(!_0xf7b02e){_0x2d757c['sendStatus'](0x194);}return _0xf7b02e;};}function handleError(_0x19f001,_0x5884cb){_0x5884cb=_0x5884cb||0x1f4;return function(_0x410504){logger['error'](_0x410504[_0xe36e('0x2a')]);if(_0x410504['name']){delete _0x410504['name'];}_0x19f001['status'](_0x5884cb)['send'](_0x410504);};}exports[_0xe36e('0x2b')]=function(_0x1fc639,_0x4cf185){var _0x4ac819={},_0x1fa1ec={},_0xb8d44e={'count':0x0,'rows':[]};var _0x259e19=_[_0xe36e('0x2c')](db[_0xe36e('0x2d')][_0xe36e('0x2e')],function(_0x57bb9b){return{'name':_0x57bb9b[_0xe36e('0x2f')],'type':_0x57bb9b[_0xe36e('0x30')]['key']};});_0x1fa1ec[_0xe36e('0x31')]=_[_0xe36e('0x2c')](_0x259e19,_0xe36e('0x32'));_0x1fa1ec[_0xe36e('0x33')]=_[_0xe36e('0x34')](_0x1fc639[_0xe36e('0x33')]);_0x1fa1ec[_0xe36e('0x35')]=_[_0xe36e('0x36')](_0x1fa1ec[_0xe36e('0x31')],_0x1fa1ec[_0xe36e('0x33')]);_0x4ac819[_0xe36e('0x37')]=_['intersection'](_0x1fa1ec[_0xe36e('0x31')],qs['fields'](_0x1fc639['query'][_0xe36e('0x38')]));_0x4ac819['attributes']=_0x4ac819[_0xe36e('0x37')][_0xe36e('0x39')]?_0x4ac819[_0xe36e('0x37')]:_0x1fa1ec[_0xe36e('0x31')];if(!_0x1fc639['query']['hasOwnProperty'](_0xe36e('0x3a'))){_0x4ac819[_0xe36e('0x1e')]=qs[_0xe36e('0x1e')](_0x1fc639[_0xe36e('0x33')]['limit']);_0x4ac819[_0xe36e('0x1c')]=qs[_0xe36e('0x1c')](_0x1fc639[_0xe36e('0x33')]['offset']);}_0x4ac819[_0xe36e('0x3b')]=qs[_0xe36e('0x3c')](_0x1fc639['query'][_0xe36e('0x3c')]);_0x4ac819[_0xe36e('0x3d')]=qs[_0xe36e('0x35')](_[_0xe36e('0x3e')](_0x1fc639[_0xe36e('0x33')],_0x1fa1ec[_0xe36e('0x35')]),_0x259e19);if(_0x1fc639[_0xe36e('0x33')][_0xe36e('0x3f')]){_0x4ac819[_0xe36e('0x3d')]=_[_0xe36e('0x40')](_0x4ac819[_0xe36e('0x3d')],{'$or':_[_0xe36e('0x2c')](_0x259e19,function(_0x3c4703){if(_0x3c4703['type']!==_0xe36e('0x41')){var _0x134fb2={};_0x134fb2[_0x3c4703[_0xe36e('0x32')]]={'$like':'%'+_0x1fc639[_0xe36e('0x33')][_0xe36e('0x3f')]+'%'};return _0x134fb2;}})});}_0x4ac819=_['merge']({},_0x4ac819,_0x1fc639['options']);var _0x4094c6={'where':_0x4ac819[_0xe36e('0x3d')]};return db[_0xe36e('0x2d')][_0xe36e('0x1f')](_0x4094c6)[_0xe36e('0x26')](function(_0x34a1ba){_0xb8d44e[_0xe36e('0x1f')]=_0x34a1ba;if(_0x1fc639[_0xe36e('0x33')]['includeAll']){_0x4ac819[_0xe36e('0x42')]=[{'all':!![]}];}return db[_0xe36e('0x2d')]['findAll'](_0x4ac819);})[_0xe36e('0x26')](function(_0x5ef3e4){_0xb8d44e[_0xe36e('0x43')]=_0x5ef3e4;return _0xb8d44e;})[_0xe36e('0x26')](respondWithFilteredResult(_0x4cf185,_0x4ac819))[_0xe36e('0x44')](handleError(_0x4cf185,null));};exports[_0xe36e('0x45')]=function(_0x3b1269,_0x4c5e10){var _0x2ffc34={'raw':!![],'where':{'id':_0x3b1269[_0xe36e('0x46')]['id']}},_0x2961c9={};_0x2961c9[_0xe36e('0x31')]=_[_0xe36e('0x34')](db[_0xe36e('0x2d')]['rawAttributes']);_0x2961c9[_0xe36e('0x33')]=_[_0xe36e('0x34')](_0x3b1269[_0xe36e('0x33')]);_0x2961c9[_0xe36e('0x35')]=_[_0xe36e('0x36')](_0x2961c9['model'],_0x2961c9[_0xe36e('0x33')]);_0x2ffc34[_0xe36e('0x37')]=_[_0xe36e('0x36')](_0x2961c9[_0xe36e('0x31')],qs[_0xe36e('0x38')](_0x3b1269[_0xe36e('0x33')][_0xe36e('0x38')]));_0x2ffc34[_0xe36e('0x37')]=_0x2ffc34[_0xe36e('0x37')]['length']?_0x2ffc34['attributes']:_0x2961c9[_0xe36e('0x31')];if(_0x3b1269['query'][_0xe36e('0x47')]){_0x2ffc34[_0xe36e('0x42')]=[{'all':!![]}];}_0x2ffc34=_[_0xe36e('0x40')]({},_0x2ffc34,_0x3b1269[_0xe36e('0x48')]);return db['ContactItemType'][_0xe36e('0x49')](_0x2ffc34)[_0xe36e('0x26')](handleEntityNotFound(_0x4c5e10,null))['then'](respondWithResult(_0x4c5e10,null))[_0xe36e('0x44')](handleError(_0x4c5e10,null));};exports[_0xe36e('0x4a')]=function(_0x2c26e6,_0x42eae5){return db[_0xe36e('0x2d')][_0xe36e('0x4a')](_0x2c26e6[_0xe36e('0x4b')],{})[_0xe36e('0x26')](function(_0x17555e){var _0x3a99aa=_0x2c26e6[_0xe36e('0x4c')][_0xe36e('0x28')]({'plain':!![]});if(!_0x3a99aa)throw new Error(_0xe36e('0x4d'));if(_0x3a99aa[_0xe36e('0x4e')]===_0xe36e('0x4c')){var _0x5678d3=_0x17555e[_0xe36e('0x28')]({'plain':!![]});var _0x55aadf='ContactItemTypes';return db[_0xe36e('0x4f')][_0xe36e('0x49')]({'where':{'name':_0x55aadf,'userProfileId':_0x3a99aa['userProfileId']},'raw':!![]})[_0xe36e('0x26')](function(_0x3814eb){if(_0x3814eb&&_0x3814eb[_0xe36e('0x50')]===0x0){return db[_0xe36e('0x51')][_0xe36e('0x4a')]({'name':_0x5678d3[_0xe36e('0x32')],'resourceId':_0x5678d3['id'],'type':_0x3814eb[_0xe36e('0x32')],'sectionId':_0x3814eb['id']},{})[_0xe36e('0x26')](function(){return _0x17555e;});}else{return _0x17555e;}})[_0xe36e('0x44')](function(_0x55d190){logger[_0xe36e('0x52')](_0xe36e('0x53'),_0x55d190);throw _0x55d190;});}return _0x17555e;})['then'](respondWithResult(_0x42eae5,0xc9))[_0xe36e('0x44')](handleError(_0x42eae5,null));};exports[_0xe36e('0x25')]=function(_0x3e1040,_0x206f75){if(_0x3e1040[_0xe36e('0x4b')]['id']){delete _0x3e1040['body']['id'];}return db['ContactItemType']['find']({'where':{'id':_0x3e1040['params']['id']}})[_0xe36e('0x26')](handleEntityNotFound(_0x206f75,null))[_0xe36e('0x26')](saveUpdates(_0x3e1040[_0xe36e('0x4b')],null))[_0xe36e('0x26')](respondWithResult(_0x206f75,null))[_0xe36e('0x44')](handleError(_0x206f75,null));};exports[_0xe36e('0x27')]=function(_0x7c3766,_0x17965c){return db[_0xe36e('0x2d')]['find']({'where':{'id':_0x7c3766[_0xe36e('0x46')]['id']}})[_0xe36e('0x26')](handleEntityNotFound(_0x17965c,null))['then'](db[_0xe36e('0x54')][_0xe36e('0x25')]({'ItemTypeId':null},{'where':{'ItemTypeId':_0x7c3766[_0xe36e('0x46')]['id']}}))[_0xe36e('0x26')](removeEntity(_0x17965c,null))[_0xe36e('0x44')](handleError(_0x17965c,null));};
\ No newline at end of file
+var _0x2032=['limit','count','set','Content-Range','apply','save','then','destroy','get','ContactItemTypes','sendStatus','error','stack','name','send','index','map','ContactItemType','fieldName','model','query','keys','filters','intersection','attributes','fields','nolimit','order','where','pick','merge','type','VIRTUAL','filter','options','include','findAll','rows','catch','show','params','includeAll','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','offset','undefined'];(function(_0x3342fe,_0x1b35bf){var _0x3e1183=function(_0x2ee2b6){while(--_0x2ee2b6){_0x3342fe['push'](_0x3342fe['shift']());}};_0x3e1183(++_0x1b35bf);}(_0x2032,0xd9));var _0x2203=function(_0x398c04,_0x4d9dcf){_0x398c04=_0x398c04-0x0;var _0x343aba=_0x2032[_0x398c04];return _0x343aba;};'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(){var _0x1244f4=_0x2718f5[_0x2203('0x25')]({'plain':!![]});var _0x49c12=_0x2203('0x26');return db['UserProfileResource'][_0x2203('0x24')]({'where':{'type':_0x49c12,'resourceId':_0x1244f4['id']}})[_0x2203('0x23')](function(){return _0x2718f5;});})[_0x2203('0x23')](function(){_0x5c8da9['status'](0xcc)[_0x2203('0x18')]();});}};}function handleEntityNotFound(_0x1cec17,_0x5c5fd3){return function(_0xd6e109){if(!_0xd6e109){_0x1cec17[_0x2203('0x27')](0x194);}return _0xd6e109;};}function handleError(_0x1c6a77,_0x46b8b9){_0x46b8b9=_0x46b8b9||0x1f4;return function(_0x28ae02){logger[_0x2203('0x28')](_0x28ae02[_0x2203('0x29')]);if(_0x28ae02['name']){delete _0x28ae02[_0x2203('0x2a')];}_0x1c6a77[_0x2203('0x19')](_0x46b8b9)[_0x2203('0x2b')](_0x28ae02);};}exports[_0x2203('0x2c')]=function(_0x52a426,_0x3a8e23){var _0x21ff0d={},_0x287c95={},_0xf59954={'count':0x0,'rows':[]};var _0x520602=_[_0x2203('0x2d')](db[_0x2203('0x2e')]['rawAttributes'],function(_0x5c0157){return{'name':_0x5c0157[_0x2203('0x2f')],'type':_0x5c0157['type']['key']};});_0x287c95[_0x2203('0x30')]=_[_0x2203('0x2d')](_0x520602,_0x2203('0x2a'));_0x287c95[_0x2203('0x31')]=_[_0x2203('0x32')](_0x52a426['query']);_0x287c95[_0x2203('0x33')]=_[_0x2203('0x34')](_0x287c95['model'],_0x287c95[_0x2203('0x31')]);_0x21ff0d[_0x2203('0x35')]=_[_0x2203('0x34')](_0x287c95[_0x2203('0x30')],qs[_0x2203('0x36')](_0x52a426[_0x2203('0x31')][_0x2203('0x36')]));_0x21ff0d[_0x2203('0x35')]=_0x21ff0d[_0x2203('0x35')]['length']?_0x21ff0d[_0x2203('0x35')]:_0x287c95[_0x2203('0x30')];if(!_0x52a426['query']['hasOwnProperty'](_0x2203('0x37'))){_0x21ff0d['limit']=qs[_0x2203('0x1d')](_0x52a426[_0x2203('0x31')][_0x2203('0x1d')]);_0x21ff0d['offset']=qs['offset'](_0x52a426[_0x2203('0x31')]['offset']);}_0x21ff0d[_0x2203('0x38')]=qs['sort'](_0x52a426[_0x2203('0x31')]['sort']);_0x21ff0d[_0x2203('0x39')]=qs[_0x2203('0x33')](_[_0x2203('0x3a')](_0x52a426[_0x2203('0x31')],_0x287c95[_0x2203('0x33')]),_0x520602);if(_0x52a426['query']['filter']){_0x21ff0d['where']=_[_0x2203('0x3b')](_0x21ff0d[_0x2203('0x39')],{'$or':_[_0x2203('0x2d')](_0x520602,function(_0x3b0c7a){if(_0x3b0c7a[_0x2203('0x3c')]!==_0x2203('0x3d')){var _0x1c7e3d={};_0x1c7e3d[_0x3b0c7a['name']]={'$like':'%'+_0x52a426[_0x2203('0x31')][_0x2203('0x3e')]+'%'};return _0x1c7e3d;}})});}_0x21ff0d=_[_0x2203('0x3b')]({},_0x21ff0d,_0x52a426[_0x2203('0x3f')]);var _0x493d12={'where':_0x21ff0d['where']};return db[_0x2203('0x2e')]['count'](_0x493d12)[_0x2203('0x23')](function(_0x446209){_0xf59954[_0x2203('0x1e')]=_0x446209;if(_0x52a426['query']['includeAll']){_0x21ff0d[_0x2203('0x40')]=[{'all':!![]}];}return db[_0x2203('0x2e')][_0x2203('0x41')](_0x21ff0d);})[_0x2203('0x23')](function(_0x372709){_0xf59954[_0x2203('0x42')]=_0x372709;return _0xf59954;})['then'](respondWithFilteredResult(_0x3a8e23,_0x21ff0d))[_0x2203('0x43')](handleError(_0x3a8e23,null));};exports[_0x2203('0x44')]=function(_0x3a866c,_0x266076){var _0x16b452={'raw':!![],'where':{'id':_0x3a866c[_0x2203('0x45')]['id']}},_0x36b99f={};_0x36b99f[_0x2203('0x30')]=_[_0x2203('0x32')](db[_0x2203('0x2e')]['rawAttributes']);_0x36b99f[_0x2203('0x31')]=_[_0x2203('0x32')](_0x3a866c[_0x2203('0x31')]);_0x36b99f[_0x2203('0x33')]=_['intersection'](_0x36b99f['model'],_0x36b99f[_0x2203('0x31')]);_0x16b452['attributes']=_[_0x2203('0x34')](_0x36b99f[_0x2203('0x30')],qs[_0x2203('0x36')](_0x3a866c[_0x2203('0x31')]['fields']));_0x16b452[_0x2203('0x35')]=_0x16b452[_0x2203('0x35')]['length']?_0x16b452[_0x2203('0x35')]:_0x36b99f[_0x2203('0x30')];if(_0x3a866c[_0x2203('0x31')][_0x2203('0x46')]){_0x16b452['include']=[{'all':!![]}];}_0x16b452=_['merge']({},_0x16b452,_0x3a866c[_0x2203('0x3f')]);return db['ContactItemType']['find'](_0x16b452)[_0x2203('0x23')](handleEntityNotFound(_0x266076,null))[_0x2203('0x23')](respondWithResult(_0x266076,null))[_0x2203('0x43')](handleError(_0x266076,null));};exports['create']=function(_0x4c1496,_0x131aec){return db[_0x2203('0x2e')][_0x2203('0x47')](_0x4c1496[_0x2203('0x48')],{})[_0x2203('0x23')](function(_0x21fd78){var _0x4a7f4e=_0x4c1496[_0x2203('0x49')]['get']({'plain':!![]});if(!_0x4a7f4e)throw new Error(_0x2203('0x4a'));if(_0x4a7f4e[_0x2203('0x4b')]===_0x2203('0x49')){var _0x1e49dd=_0x21fd78['get']({'plain':!![]});var _0x506795=_0x2203('0x26');return db[_0x2203('0x4c')][_0x2203('0x4d')]({'where':{'name':_0x506795,'userProfileId':_0x4a7f4e[_0x2203('0x4e')]},'raw':!![]})['then'](function(_0x4de47a){if(_0x4de47a&&_0x4de47a['autoAssociation']===0x0){return db[_0x2203('0x4f')][_0x2203('0x47')]({'name':_0x1e49dd['name'],'resourceId':_0x1e49dd['id'],'type':_0x4de47a[_0x2203('0x2a')],'sectionId':_0x4de47a['id']},{})[_0x2203('0x23')](function(){return _0x21fd78;});}else{return _0x21fd78;}})['catch'](function(_0x32b1db){logger[_0x2203('0x28')](_0x2203('0x50'),_0x32b1db);throw _0x32b1db;});}return _0x21fd78;})[_0x2203('0x23')](respondWithResult(_0x131aec,0xc9))['catch'](handleError(_0x131aec,null));};exports[_0x2203('0x51')]=function(_0x5268d6,_0x3858f0){if(_0x5268d6[_0x2203('0x48')]['id']){delete _0x5268d6['body']['id'];}return db[_0x2203('0x2e')][_0x2203('0x4d')]({'where':{'id':_0x5268d6[_0x2203('0x45')]['id']}})[_0x2203('0x23')](handleEntityNotFound(_0x3858f0,null))[_0x2203('0x23')](saveUpdates(_0x5268d6[_0x2203('0x48')],null))['then'](respondWithResult(_0x3858f0,null))['catch'](handleError(_0x3858f0,null));};exports[_0x2203('0x24')]=function(_0x524356,_0x56e881){return db[_0x2203('0x2e')][_0x2203('0x4d')]({'where':{'id':_0x524356[_0x2203('0x45')]['id']}})['then'](handleEntityNotFound(_0x56e881,null))[_0x2203('0x23')](db['CmContactHasItem']['update']({'ItemTypeId':null},{'where':{'ItemTypeId':_0x524356[_0x2203('0x45')]['id']}}))['then'](removeEntity(_0x56e881,null))['catch'](handleError(_0x56e881,null));};
\ No newline at end of file
index 58f8590..71e08e0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbfe4=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./contactItemType.attributes','define','ContactItemType','tools_contact_item_types','lodash','util','../../config/logger','api'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xbfe4,0x1d8));var _0x4bfe=function(_0xa71a53,_0x476379){_0xa71a53=_0xa71a53-0x0;var _0x7f9a25=_0xbfe4[_0xa71a53];return _0x7f9a25;};'use strict';var _=require(_0x4bfe('0x0'));var util=require(_0x4bfe('0x1'));var logger=require(_0x4bfe('0x2'))(_0x4bfe('0x3'));var moment=require(_0x4bfe('0x4'));var BPromise=require(_0x4bfe('0x5'));var rp=require(_0x4bfe('0x6'));var fs=require('fs');var path=require(_0x4bfe('0x7'));var rimraf=require(_0x4bfe('0x8'));var config=require(_0x4bfe('0x9'));var attributes=require(_0x4bfe('0xa'));module['exports']=function(_0x3bcea3,_0x183d93){return _0x3bcea3[_0x4bfe('0xb')](_0x4bfe('0xc'),attributes,{'tableName':_0x4bfe('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe389=['../../config/environment','./contactItemType.attributes','exports','ContactItemType','tools_contact_item_types','lodash','../../config/logger','api','bluebird','path','rimraf'];(function(_0x407c14,_0x226f5b){var _0x16c1e3=function(_0xdb2995){while(--_0xdb2995){_0x407c14['push'](_0x407c14['shift']());}};_0x16c1e3(++_0x226f5b);}(_0xe389,0x186));var _0x9e38=function(_0x5b3255,_0x526121){_0x5b3255=_0x5b3255-0x0;var _0x46cca0=_0xe389[_0x5b3255];return _0x46cca0;};'use strict';var _=require(_0x9e38('0x0'));var util=require('util');var logger=require(_0x9e38('0x1'))(_0x9e38('0x2'));var moment=require('moment');var BPromise=require(_0x9e38('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9e38('0x4'));var rimraf=require(_0x9e38('0x5'));var config=require(_0x9e38('0x6'));var attributes=require(_0x9e38('0x7'));module[_0x9e38('0x8')]=function(_0x8eef37,_0x2cc2ef){return _0x8eef37['define'](_0x9e38('0x9'),attributes,{'tableName':_0x9e38('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index a368c1d..521cc5e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c32=['debug','ContactItemType,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','randomstring','../../config/utils','../../config/logger','../../config/environment','client','info','ContactItemType,\x20%s,\x20%s','request\x20sent'];(function(_0x3ea005,_0x322961){var _0x21cd35=function(_0x1272c4){while(--_0x1272c4){_0x3ea005['push'](_0x3ea005['shift']());}};_0x21cd35(++_0x322961);}(_0x9c32,0x15d));var _0x29c3=function(_0x668546,_0x286eed){_0x668546=_0x668546-0x0;var _0x3fbed2=_0x9c32[_0x668546];return _0x3fbed2;};'use strict';var _=require(_0x29c3('0x0'));var util=require(_0x29c3('0x1'));var moment=require(_0x29c3('0x2'));var BPromise=require('bluebird');var rs=require(_0x29c3('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x29c3('0x4'));var logger=require(_0x29c3('0x5'))('rpc');var config=require(_0x29c3('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x29c3('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4b30fc,_0x2b2f35,_0x21c618){return new BPromise(function(_0x3a9b70,_0x4bf9db){return client['request'](_0x4b30fc,_0x21c618)['then'](function(_0x1e9797){logger[_0x29c3('0x8')](_0x29c3('0x9'),_0x2b2f35,_0x29c3('0xa'));logger[_0x29c3('0xb')](_0x29c3('0xc'),_0x2b2f35,_0x29c3('0xa'),JSON[_0x29c3('0xd')](_0x1e9797));if(_0x1e9797[_0x29c3('0xe')]){if(_0x1e9797[_0x29c3('0xe')]['code']===0x1f4){logger[_0x29c3('0xe')](_0x29c3('0x9'),_0x2b2f35,_0x1e9797[_0x29c3('0xe')][_0x29c3('0xf')]);return _0x4bf9db(_0x1e9797[_0x29c3('0xe')]['message']);}logger['error']('ContactItemType,\x20%s,\x20%s',_0x2b2f35,_0x1e9797[_0x29c3('0xe')]['message']);return _0x3a9b70(_0x1e9797[_0x29c3('0xe')][_0x29c3('0xf')]);}else{logger[_0x29c3('0x8')](_0x29c3('0x9'),_0x2b2f35,_0x29c3('0xa'));_0x3a9b70(_0x1e9797[_0x29c3('0x10')][_0x29c3('0xf')]);}})[_0x29c3('0x11')](function(_0x15d85b){logger['error'](_0x29c3('0x9'),_0x2b2f35,_0x15d85b);_0x4bf9db(_0x15d85b);});});}
\ No newline at end of file
+var _0x054f=['message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','http','request','then','info','ContactItemType,\x20%s,\x20%s','request\x20sent','debug','ContactItemType,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x054f,0x1a6));var _0xf054=function(_0x24a7b8,_0x4a203e){_0x24a7b8=_0x24a7b8-0x0;var _0xd84a8e=_0x054f[_0x24a7b8];return _0xd84a8e;};'use strict';var _=require(_0xf054('0x0'));var util=require(_0xf054('0x1'));var moment=require(_0xf054('0x2'));var BPromise=require(_0xf054('0x3'));var rs=require(_0xf054('0x4'));var fs=require('fs');var Redis=require(_0xf054('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xf054('0x6'));var logger=require(_0xf054('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xf054('0x8'));var client=jayson['client'][_0xf054('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x113205,_0x5a9681,_0x2e8bb8){return new BPromise(function(_0x155c76,_0x13d111){return client[_0xf054('0xa')](_0x113205,_0x2e8bb8)[_0xf054('0xb')](function(_0xfb30a9){logger[_0xf054('0xc')](_0xf054('0xd'),_0x5a9681,_0xf054('0xe'));logger[_0xf054('0xf')](_0xf054('0x10'),_0x5a9681,_0xf054('0xe'),JSON[_0xf054('0x11')](_0xfb30a9));if(_0xfb30a9[_0xf054('0x12')]){if(_0xfb30a9[_0xf054('0x12')]['code']===0x1f4){logger[_0xf054('0x12')](_0xf054('0xd'),_0x5a9681,_0xfb30a9[_0xf054('0x12')][_0xf054('0x13')]);return _0x13d111(_0xfb30a9[_0xf054('0x12')][_0xf054('0x13')]);}logger['error'](_0xf054('0xd'),_0x5a9681,_0xfb30a9[_0xf054('0x12')][_0xf054('0x13')]);return _0x155c76(_0xfb30a9[_0xf054('0x12')]['message']);}else{logger[_0xf054('0xc')](_0xf054('0xd'),_0x5a9681,_0xf054('0xe'));_0x155c76(_0xfb30a9['result'][_0xf054('0x13')]);}})[_0xf054('0x14')](function(_0x47f87c){logger['error'](_0xf054('0xd'),_0x5a9681,_0x47f87c);_0x13d111(_0x47f87c);});});}
\ No newline at end of file
index 11e0dd1..c8c058d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc3b3=['path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./contactItemType.controller','isAuthenticated','index','get','create','put','update','/:id','destroy','multer'];(function(_0x5568ed,_0x61f3be){var _0x406c98=function(_0x3cc9a7){while(--_0x3cc9a7){_0x5568ed['push'](_0x5568ed['shift']());}};_0x406c98(++_0x61f3be);}(_0xc3b3,0x1d0));var _0x3c3b=function(_0x13ce0c,_0x3f2a0d){_0x13ce0c=_0x13ce0c-0x0;var _0x4388fb=_0xc3b3[_0x13ce0c];return _0x4388fb;};'use strict';var multer=require(_0x3c3b('0x0'));var util=require('util');var path=require(_0x3c3b('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x3c3b('0x2')]();var fs_extra=require(_0x3c3b('0x3'));var auth=require(_0x3c3b('0x4'));var interaction=require(_0x3c3b('0x5'));var config=require('../../config/environment');var controller=require(_0x3c3b('0x6'));router['get']('/',auth[_0x3c3b('0x7')](),controller[_0x3c3b('0x8')]);router[_0x3c3b('0x9')]('/:id',auth[_0x3c3b('0x7')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x3c3b('0xa')]);router[_0x3c3b('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x3c3b('0xc')]);router['delete'](_0x3c3b('0xd'),auth[_0x3c3b('0x7')](),controller[_0x3c3b('0xe')]);module['exports']=router;
\ No newline at end of file
+var _0x4a47=['delete','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./contactItemType.controller','get','isAuthenticated','index','/:id','put','update'];(function(_0x6f3b8f,_0xefbfb2){var _0x2b38b7=function(_0x2ef32c){while(--_0x2ef32c){_0x6f3b8f['push'](_0x6f3b8f['shift']());}};_0x2b38b7(++_0xefbfb2);}(_0x4a47,0x92));var _0x74a4=function(_0x1707f0,_0x23f136){_0x1707f0=_0x1707f0-0x0;var _0xccacd1=_0x4a47[_0x1707f0];return _0xccacd1;};'use strict';var multer=require('multer');var util=require(_0x74a4('0x0'));var path=require('path');var timeout=require(_0x74a4('0x1'));var express=require(_0x74a4('0x2'));var router=express[_0x74a4('0x3')]();var fs_extra=require(_0x74a4('0x4'));var auth=require(_0x74a4('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x74a4('0x6'));var controller=require(_0x74a4('0x7'));router[_0x74a4('0x8')]('/',auth[_0x74a4('0x9')](),controller[_0x74a4('0xa')]);router[_0x74a4('0x8')](_0x74a4('0xb'),auth[_0x74a4('0x9')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x74a4('0xc')](_0x74a4('0xb'),auth[_0x74a4('0x9')](),controller[_0x74a4('0xd')]);router[_0x74a4('0xe')](_0x74a4('0xb'),auth[_0x74a4('0x9')](),controller['destroy']);module[_0x74a4('0xf')]=router;
\ No newline at end of file
index c5173ad..9345e49 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbaf0=['name','exports','STRING'];(function(_0x52ea08,_0x15d935){var _0x28d546=function(_0x4a3aa7){while(--_0x4a3aa7){_0x52ea08['push'](_0x52ea08['shift']());}};_0x28d546(++_0x15d935);}(_0xbaf0,0x12a));var _0x0baf=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xbaf0[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'name':{'type':Sequelize[_0x0baf('0x1')],'allowNull':![],'unique':_0x0baf('0x2')},'description':{'type':Sequelize[_0x0baf('0x1')]}};
\ No newline at end of file
+var _0xb7e7=['STRING','sequelize'];(function(_0x469a3c,_0x5ebc10){var _0x968f4=function(_0x22403b){while(--_0x22403b){_0x469a3c['push'](_0x469a3c['shift']());}};_0x968f4(++_0x5ebc10);}(_0xb7e7,0x121));var _0x7b7e=function(_0x243b2f,_0x30aa15){_0x243b2f=_0x243b2f-0x0;var _0xcb3c2d=_0xb7e7[_0x243b2f];return _0xcb3c2d;};'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 498e364..afbfa09 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1562=['widgetAttributes:\x20%s','addItem','DashboardId','DashboardItem','getItems','findOne','hasOwnProperty','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','register','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','get','CustomDashboards','UserProfileResource','destroy','end','name','index','map','Dashboard','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','fields','length','model','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','options','createdAt','updatedAt','omit','UserProfileSection','error','iframe','attrUrl','attrs','value','https://','attrPath','attrHourFormat','attrTimezone','attrFontSize','counter','attrMetric','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','multibar-chart','pie-chart','attrSerie1','total','attrSerie2','attrSerie3','attrChatWebsites','web-report','reportType','attrRefresh'];(function(_0x35a63c,_0x4af565){var _0x52f6b2=function(_0x244597){while(--_0x244597){_0x35a63c['push'](_0x35a63c['shift']());}};_0x52f6b2(++_0x4af565);}(_0x1562,0x113));var _0x2156=function(_0x7cdaf1,_0x40e620){_0x7cdaf1=_0x7cdaf1-0x0;var _0xf58e9a=_0x1562[_0x7cdaf1];return _0xf58e9a;};'use strict';var emlformat=require(_0x2156('0x0'));var rimraf=require(_0x2156('0x1'));var zipdir=require(_0x2156('0x2'));var jsonpatch=require(_0x2156('0x3'));var rp=require(_0x2156('0x4'));var moment=require('moment');var BPromise=require(_0x2156('0x5'));var Mustache=require(_0x2156('0x6'));var util=require(_0x2156('0x7'));var path=require(_0x2156('0x8'));var sox=require(_0x2156('0x9'));var csv=require(_0x2156('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2156('0xb'));var squel=require(_0x2156('0xc'));var crypto=require(_0x2156('0xd'));var jsforce=require(_0x2156('0xe'));var deskjs=require(_0x2156('0xf'));var toCsv=require('to-csv');var querystring=require(_0x2156('0x10'));var Papa=require(_0x2156('0x11'));var Redis=require(_0x2156('0x12'));var authService=require(_0x2156('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2156('0x14'));var logger=require(_0x2156('0x15'))(_0x2156('0x16'));var utils=require(_0x2156('0x17'));var config=require(_0x2156('0x18'));var licenseUtil=require(_0x2156('0x19'));var db=require(_0x2156('0x1a'))['db'];config[_0x2156('0x1b')]=_[_0x2156('0x1c')](config[_0x2156('0x1b')],{'host':_0x2156('0x1d'),'port':0x18eb});var socket=require(_0x2156('0x1e'))(new Redis(config[_0x2156('0x1b')]));require(_0x2156('0x1f'))[_0x2156('0x20')](socket);function respondWithStatusCode(_0x122944,_0x121228){_0x121228=_0x121228||0xcc;return function(_0x488827){if(_0x488827){return _0x122944[_0x2156('0x21')](_0x121228);}return _0x122944[_0x2156('0x22')](_0x121228)['end']();};}function respondWithResult(_0x4f6f7f,_0x2d4907){_0x2d4907=_0x2d4907||0xc8;return function(_0x4327d){if(_0x4327d){return _0x4f6f7f[_0x2156('0x22')](_0x2d4907)['json'](_0x4327d);}};}function respondWithFilteredResult(_0x14a1ba,_0x252b13){return function(_0x11356f){if(_0x11356f){var _0x4a639c=typeof _0x252b13[_0x2156('0x23')]===_0x2156('0x24')&&typeof _0x252b13[_0x2156('0x25')]==='undefined';var _0x154223=_0x11356f[_0x2156('0x26')];var _0x4e2328=_0x4a639c?0x0:_0x252b13[_0x2156('0x23')];var _0x1e1d85=_0x4a639c?_0x11356f[_0x2156('0x26')]:_0x252b13[_0x2156('0x23')]+_0x252b13[_0x2156('0x25')];var _0x8663bc;if(_0x1e1d85>=_0x154223){_0x1e1d85=_0x154223;_0x8663bc=0xc8;}else{_0x8663bc=0xce;}_0x14a1ba[_0x2156('0x22')](_0x8663bc);return _0x14a1ba[_0x2156('0x27')](_0x2156('0x28'),_0x4e2328+'-'+_0x1e1d85+'/'+_0x154223)[_0x2156('0x29')](_0x11356f);}return null;};}function patchUpdates(_0x1e2a4f){return function(_0xde1f67){try{jsonpatch[_0x2156('0x2a')](_0xde1f67,_0x1e2a4f,!![]);}catch(_0x5caff6){return BPromise[_0x2156('0x2b')](_0x5caff6);}return _0xde1f67[_0x2156('0x2c')]();};}function saveUpdates(_0x41bf28,_0x44130a){return function(_0x4b20e6){if(_0x4b20e6){return _0x4b20e6[_0x2156('0x2d')](_0x41bf28)[_0x2156('0x2e')](function(_0x33a913){return _0x33a913;});}return null;};}function removeEntity(_0xc154a1,_0x40ce77){return function(_0x5244ae){if(_0x5244ae){return _0x5244ae['destroy']()[_0x2156('0x2e')](function(){var _0x5e58ba=_0x5244ae[_0x2156('0x2f')]({'plain':!![]});var _0x430ee5=_0x2156('0x30');return db[_0x2156('0x31')][_0x2156('0x32')]({'where':{'type':_0x430ee5,'resourceId':_0x5e58ba['id']}})[_0x2156('0x2e')](function(){return _0x5244ae;});})['then'](function(){_0xc154a1['status'](0xcc)[_0x2156('0x33')]();});}};}function handleEntityNotFound(_0x1443d5,_0x5a323c){return function(_0x5b431c){if(!_0x5b431c){_0x1443d5[_0x2156('0x21')](0x194);}return _0x5b431c;};}function handleError(_0x59d421,_0xbc83fd){_0xbc83fd=_0xbc83fd||0x1f4;return function(_0x370841){logger['error'](_0x370841['stack']);if(_0x370841[_0x2156('0x34')]){delete _0x370841[_0x2156('0x34')];}_0x59d421[_0x2156('0x22')](_0xbc83fd)['send'](_0x370841);};}exports[_0x2156('0x35')]=function(_0x351c9f,_0x481fe4){var _0xd30510={},_0x92a390={},_0x4a34a0={'count':0x0,'rows':[]};var _0x10aa89=_[_0x2156('0x36')](db[_0x2156('0x37')][_0x2156('0x38')],function(_0x155892){return{'name':_0x155892[_0x2156('0x39')],'type':_0x155892[_0x2156('0x3a')][_0x2156('0x3b')]};});_0x92a390['model']=_['map'](_0x10aa89,_0x2156('0x34'));_0x92a390[_0x2156('0x3c')]=_[_0x2156('0x3d')](_0x351c9f[_0x2156('0x3c')]);_0x92a390[_0x2156('0x3e')]=_[_0x2156('0x3f')](_0x92a390['model'],_0x92a390[_0x2156('0x3c')]);_0xd30510[_0x2156('0x40')]=_[_0x2156('0x3f')](_0x92a390['model'],qs[_0x2156('0x41')](_0x351c9f[_0x2156('0x3c')][_0x2156('0x41')]));_0xd30510[_0x2156('0x40')]=_0xd30510[_0x2156('0x40')][_0x2156('0x42')]?_0xd30510[_0x2156('0x40')]:_0x92a390[_0x2156('0x43')];if(!_0x351c9f[_0x2156('0x3c')]['hasOwnProperty'](_0x2156('0x44'))){_0xd30510['limit']=qs[_0x2156('0x25')](_0x351c9f[_0x2156('0x3c')][_0x2156('0x25')]);_0xd30510[_0x2156('0x23')]=qs[_0x2156('0x23')](_0x351c9f[_0x2156('0x3c')][_0x2156('0x23')]);}_0xd30510[_0x2156('0x45')]=qs[_0x2156('0x46')](_0x351c9f[_0x2156('0x3c')][_0x2156('0x46')]);_0xd30510[_0x2156('0x47')]=qs[_0x2156('0x3e')](_[_0x2156('0x48')](_0x351c9f[_0x2156('0x3c')],_0x92a390[_0x2156('0x3e')]),_0x10aa89);if(_0x351c9f[_0x2156('0x3c')][_0x2156('0x49')]){_0xd30510[_0x2156('0x47')]=_[_0x2156('0x4a')](_0xd30510[_0x2156('0x47')],{'$or':_[_0x2156('0x36')](_0x10aa89,function(_0x7fa282){if(_0x7fa282[_0x2156('0x3a')]!==_0x2156('0x4b')){var _0x10afe3={};_0x10afe3[_0x7fa282[_0x2156('0x34')]]={'$like':'%'+_0x351c9f[_0x2156('0x3c')][_0x2156('0x49')]+'%'};return _0x10afe3;}})});}_0xd30510=_[_0x2156('0x4a')]({},_0xd30510,_0x351c9f['options']);var _0x5397a7={'where':_0xd30510['where']};return db[_0x2156('0x37')][_0x2156('0x26')](_0x5397a7)[_0x2156('0x2e')](function(_0x151487){_0x4a34a0[_0x2156('0x26')]=_0x151487;if(_0x351c9f[_0x2156('0x3c')][_0x2156('0x4c')]){_0xd30510[_0x2156('0x4d')]=[{'all':!![]}];}return db[_0x2156('0x37')][_0x2156('0x4e')](_0xd30510);})[_0x2156('0x2e')](function(_0x5c4d54){_0x4a34a0[_0x2156('0x4f')]=_0x5c4d54;return _0x4a34a0;})['then'](respondWithFilteredResult(_0x481fe4,_0xd30510))[_0x2156('0x50')](handleError(_0x481fe4,null));};exports[_0x2156('0x51')]=function(_0x3b8a92,_0x2a74c9){var _0x1bc77d={'raw':![],'where':{'id':_0x3b8a92[_0x2156('0x52')]['id']}},_0x1e66b2={};_0x1e66b2['model']=_[_0x2156('0x3d')](db[_0x2156('0x37')]['rawAttributes']);_0x1e66b2[_0x2156('0x3c')]=_[_0x2156('0x3d')](_0x3b8a92[_0x2156('0x3c')]);_0x1e66b2[_0x2156('0x3e')]=_[_0x2156('0x3f')](_0x1e66b2['model'],_0x1e66b2[_0x2156('0x3c')]);_0x1bc77d[_0x2156('0x40')]=_[_0x2156('0x3f')](_0x1e66b2['model'],qs[_0x2156('0x41')](_0x3b8a92[_0x2156('0x3c')]['fields']));_0x1bc77d['attributes']=_0x1bc77d['attributes']['length']?_0x1bc77d[_0x2156('0x40')]:_0x1e66b2[_0x2156('0x43')];if(_0x3b8a92['query']['includeAll']){_0x1bc77d[_0x2156('0x4d')]=[{'all':!![]}];}_0x1bc77d=_[_0x2156('0x4a')]({},_0x1bc77d,_0x3b8a92['options']);return db[_0x2156('0x37')][_0x2156('0x53')](_0x1bc77d)[_0x2156('0x2e')](handleEntityNotFound(_0x2a74c9,null))[_0x2156('0x2e')](respondWithResult(_0x2a74c9,null))[_0x2156('0x50')](handleError(_0x2a74c9,null));};exports[_0x2156('0x54')]=function(_0x2edd74,_0x289926){return db[_0x2156('0x37')]['create'](_0x2edd74[_0x2156('0x55')],{})['then'](function(_0x4f6a7c){var _0x2cade6=_0x2edd74[_0x2156('0x56')]['get']({'plain':!![]});if(!_0x2cade6)throw new Error(_0x2156('0x57'));if(_0x2cade6[_0x2156('0x58')]===_0x2156('0x56')){var _0x335811=_0x4f6a7c[_0x2156('0x2f')]({'plain':!![]});var _0x2c497f=_0x2156('0x30');return db['UserProfileSection']['find']({'where':{'name':_0x2c497f,'userProfileId':_0x2cade6[_0x2156('0x59')]},'raw':!![]})['then'](function(_0xf1fd53){if(_0xf1fd53&&_0xf1fd53['autoAssociation']===0x0){return db[_0x2156('0x31')][_0x2156('0x54')]({'name':_0x335811['name'],'resourceId':_0x335811['id'],'type':_0xf1fd53[_0x2156('0x34')],'sectionId':_0xf1fd53['id']},{})[_0x2156('0x2e')](function(){return _0x4f6a7c;});}else{return _0x4f6a7c;}})[_0x2156('0x50')](function(_0xad3958){logger['error'](_0x2156('0x5a'),_0xad3958);throw _0xad3958;});}return _0x4f6a7c;})[_0x2156('0x2e')](respondWithResult(_0x289926,0xc9))[_0x2156('0x50')](handleError(_0x289926,null));};exports[_0x2156('0x5b')]=function(_0x486a7b,_0x22b66c){var _0x53adb8={'where':{'id':_0x486a7b[_0x2156('0x52')]['id']}},_0xa0f352={};_0xa0f352[_0x2156('0x43')]=_[_0x2156('0x3d')](db[_0x2156('0x37')][_0x2156('0x38')]);_0x53adb8[_0x2156('0x40')]=_[_0x2156('0x3f')](_0xa0f352['model'],qs['fields'](_0x486a7b[_0x2156('0x3c')][_0x2156('0x41')]));_0x53adb8[_0x2156('0x40')]=_0x53adb8[_0x2156('0x40')][_0x2156('0x42')]?_0x53adb8[_0x2156('0x40')]:_0xa0f352[_0x2156('0x43')];if(_0x486a7b[_0x2156('0x3c')][_0x2156('0x4c')]){_0x53adb8[_0x2156('0x4d')]=[{'all':!![]}];}_0x53adb8=_[_0x2156('0x4a')]({},_0x53adb8,_0x486a7b[_0x2156('0x5c')]);return db[_0x2156('0x37')][_0x2156('0x53')](_0x53adb8)[_0x2156('0x2e')](handleEntityNotFound(_0x22b66c,null))[_0x2156('0x2e')](function(_0x3ebea9){if(_0x3ebea9){var _0x512120=_0x3ebea9[_0x2156('0x2f')]({'plain':!![]});_0x512120=qs['omit'](_0x512120,['id',_0x2156('0x5d'),_0x2156('0x5e')]);_0x486a7b[_0x2156('0x55')]=_[_0x2156('0x5f')](_0x486a7b[_0x2156('0x55')],['id',_0x2156('0x5d'),_0x2156('0x5e')]);return db[_0x2156('0x37')][_0x2156('0x54')](_[_0x2156('0x4a')](_0x512120,_0x486a7b[_0x2156('0x55')]),{'include':_0x486a7b[_0x2156('0x3c')][_0x2156('0x4c')]?[{'all':!![]}]:undefined})['then'](function(_0x5a4e85){var _0xb962c2=_0x486a7b[_0x2156('0x56')][_0x2156('0x2f')]({'plain':!![]});if(!_0xb962c2)throw new Error(_0x2156('0x57'));if(_0xb962c2['role']===_0x2156('0x56')){var _0x7a634=_0x5a4e85['get']({'plain':!![]});var _0x236c3d=_0x2156('0x30');return db[_0x2156('0x60')]['find']({'where':{'name':_0x236c3d,'userProfileId':_0xb962c2[_0x2156('0x59')]},'raw':!![]})[_0x2156('0x2e')](function(_0x3a2dff){if(_0x3a2dff&&_0x3a2dff['autoAssociation']===0x0){return db[_0x2156('0x31')][_0x2156('0x54')]({'name':_0x7a634[_0x2156('0x34')],'resourceId':_0x7a634['id'],'type':_0x3a2dff[_0x2156('0x34')],'sectionId':_0x3a2dff['id']},{})[_0x2156('0x2e')](function(){return _0x5a4e85;});}else{return _0x5a4e85;}})['catch'](function(_0x5dc2d8){logger[_0x2156('0x61')](_0x2156('0x5a'),_0x5dc2d8);throw _0x5dc2d8;});}return _0x5a4e85;});}})[_0x2156('0x2e')](respondWithResult(_0x22b66c,0xc9))[_0x2156('0x50')](handleError(_0x22b66c,null));};exports[_0x2156('0x2d')]=function(_0x53f70e,_0x4e3845){if(_0x53f70e[_0x2156('0x55')]['id']){delete _0x53f70e['body']['id'];}return db['Dashboard'][_0x2156('0x53')]({'where':{'id':_0x53f70e['params']['id']}})[_0x2156('0x2e')](handleEntityNotFound(_0x4e3845,null))[_0x2156('0x2e')](saveUpdates(_0x53f70e[_0x2156('0x55')],null))['then'](respondWithResult(_0x4e3845,null))['catch'](handleError(_0x4e3845,null));};exports[_0x2156('0x32')]=function(_0x446aa9,_0x1ca126){return db[_0x2156('0x37')][_0x2156('0x53')]({'where':{'id':_0x446aa9[_0x2156('0x52')]['id']}})[_0x2156('0x2e')](handleEntityNotFound(_0x1ca126,null))[_0x2156('0x2e')](removeEntity(_0x1ca126,null))[_0x2156('0x50')](handleError(_0x1ca126,null));};function widgetAttributes(_0x2795ae){try{switch(_0x2795ae[_0x2156('0x3a')]){case _0x2156('0x62'):return[{'name':'attrUrl','value':_0x2795ae[_0x2156('0x63')]||(_0x2795ae[_0x2156('0x64')]&&_0x2795ae['attrs'][0x0]?_0x2795ae[_0x2156('0x64')][0x0][_0x2156('0x65')]:undefined)||_0x2156('0x66')}];case'custom':return[{'name':'attrPath','value':_0x2795ae[_0x2156('0x67')]||(_0x2795ae[_0x2156('0x64')]&&_0x2795ae['attrs'][0x0]?_0x2795ae[_0x2156('0x64')][0x0][_0x2156('0x65')]:undefined)||''}];case'clock':return[{'name':_0x2156('0x68'),'value':_0x2795ae['attrHourFormat']||(_0x2795ae[_0x2156('0x64')]&&_0x2795ae[_0x2156('0x64')][0x0]?_0x2795ae[_0x2156('0x64')][0x0][_0x2156('0x65')]:undefined)||'HH:mm:ss'},{'name':_0x2156('0x69'),'value':_0x2795ae['attrTimezone']||(_0x2795ae[_0x2156('0x64')]&&_0x2795ae[_0x2156('0x64')][0x1]?_0x2795ae[_0x2156('0x64')][0x1][_0x2156('0x65')]:undefined)||'0.00'},{'name':_0x2156('0x6a'),'value':_0x2795ae[_0x2156('0x6a')]||(_0x2795ae[_0x2156('0x64')]&&_0x2795ae[_0x2156('0x64')][0x2]?_0x2795ae[_0x2156('0x64')][0x2][_0x2156('0x65')]:undefined)||0xc}];case _0x2156('0x6b'):return[{'name':_0x2156('0x6c'),'value':_0x2795ae[_0x2156('0x6c')]||(_0x2795ae[_0x2156('0x64')]&&_0x2795ae[_0x2156('0x64')][0x0]?_0x2795ae['attrs'][0x0][_0x2156('0x65')]:undefined)||'total'},{'name':'attrVoiceQueues','value':_0x2795ae[_0x2156('0x6d')]||(_0x2795ae[_0x2156('0x64')]&&_0x2795ae[_0x2156('0x64')][0x1]?_0x2795ae[_0x2156('0x64')][0x1][_0x2156('0x65')]:undefined)||[]},{'name':_0x2156('0x6a'),'value':_0x2795ae[_0x2156('0x6a')]||(_0x2795ae[_0x2156('0x64')]&&_0x2795ae[_0x2156('0x64')][0x2]?_0x2795ae[_0x2156('0x64')][0x2][_0x2156('0x65')]:undefined)||0x14},{'name':'attrChannel','value':_0x2795ae[_0x2156('0x6e')]||(_0x2795ae[_0x2156('0x64')]&&_0x2795ae['attrs'][0x3]?_0x2795ae[_0x2156('0x64')][0x3]['value']:undefined)||_0x2156('0x6f')},{'name':_0x2156('0x70'),'value':_0x2795ae[_0x2156('0x70')]||(_0x2795ae[_0x2156('0x64')]&&_0x2795ae[_0x2156('0x64')][0x4]?_0x2795ae['attrs'][0x4]['value']:undefined)||''},{'name':_0x2156('0x71'),'value':_0x2795ae['attrFaxAccounts']||(_0x2795ae['attrs']&&_0x2795ae[_0x2156('0x64')][0x5]?_0x2795ae[_0x2156('0x64')][0x5][_0x2156('0x65')]:undefined)||''},{'name':_0x2156('0x72'),'value':_0x2795ae['attrSmsAccounts']||(_0x2795ae[_0x2156('0x64')]&&_0x2795ae['attrs'][0x6]?_0x2795ae[_0x2156('0x64')][0x6]['value']:undefined)||''},{'name':_0x2156('0x73'),'value':_0x2795ae[_0x2156('0x73')]||(_0x2795ae[_0x2156('0x64')]&&_0x2795ae[_0x2156('0x64')][0x7]?_0x2795ae[_0x2156('0x64')][0x7][_0x2156('0x65')]:undefined)||''},{'name':_0x2156('0x74'),'value':_0x2795ae['attrWhatsappAccounts']||(_0x2795ae[_0x2156('0x64')]&&_0x2795ae[_0x2156('0x64')][0x8]?_0x2795ae['attrs'][0x8][_0x2156('0x65')]:undefined)||''},{'name':'attrChatWebsites','value':_0x2795ae['attrChatWebsites']||(_0x2795ae[_0x2156('0x64')]&&_0x2795ae[_0x2156('0x64')][0x9]?_0x2795ae[_0x2156('0x64')][0x9][_0x2156('0x65')]:undefined)||''}];case _0x2156('0x75'):case _0x2156('0x76'):return[{'name':'attrSerie1','value':_0x2795ae[_0x2156('0x77')]||(_0x2795ae[_0x2156('0x64')]&&_0x2795ae[_0x2156('0x64')][0x0]?_0x2795ae[_0x2156('0x64')][0x0]['value']:undefined)||_0x2156('0x78')},{'name':_0x2156('0x79'),'value':_0x2795ae[_0x2156('0x79')]||(_0x2795ae[_0x2156('0x64')]&&_0x2795ae[_0x2156('0x64')][0x1]?_0x2795ae[_0x2156('0x64')][0x1][_0x2156('0x65')]:undefined)||null},{'name':_0x2156('0x7a'),'value':_0x2795ae[_0x2156('0x7a')]||(_0x2795ae['attrs']&&_0x2795ae['attrs'][0x2]?_0x2795ae[_0x2156('0x64')][0x2][_0x2156('0x65')]:undefined)||null},{'name':_0x2156('0x6d'),'value':_0x2795ae[_0x2156('0x6d')]||(_0x2795ae[_0x2156('0x64')]&&_0x2795ae[_0x2156('0x64')][0x3]?_0x2795ae[_0x2156('0x64')][0x3][_0x2156('0x65')]:undefined)||[]},{'name':'attrChannel','value':_0x2795ae[_0x2156('0x6e')]||(_0x2795ae[_0x2156('0x64')]&&_0x2795ae[_0x2156('0x64')][0x4]?_0x2795ae[_0x2156('0x64')][0x4]['value']:undefined)||_0x2156('0x6f')},{'name':'attrEmailAccounts','value':_0x2795ae[_0x2156('0x70')]||(_0x2795ae[_0x2156('0x64')]&&_0x2795ae[_0x2156('0x64')][0x5]?_0x2795ae['attrs'][0x5][_0x2156('0x65')]:undefined)||''},{'name':_0x2156('0x71'),'value':_0x2795ae[_0x2156('0x71')]||(_0x2795ae[_0x2156('0x64')]&&_0x2795ae['attrs'][0x6]?_0x2795ae['attrs'][0x6][_0x2156('0x65')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x2795ae[_0x2156('0x72')]||(_0x2795ae[_0x2156('0x64')]&&_0x2795ae[_0x2156('0x64')][0x7]?_0x2795ae[_0x2156('0x64')][0x7][_0x2156('0x65')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x2795ae[_0x2156('0x73')]||(_0x2795ae[_0x2156('0x64')]&&_0x2795ae[_0x2156('0x64')][0x8]?_0x2795ae[_0x2156('0x64')][0x8][_0x2156('0x65')]:undefined)||''},{'name':_0x2156('0x74'),'value':_0x2795ae[_0x2156('0x74')]||(_0x2795ae[_0x2156('0x64')]&&_0x2795ae[_0x2156('0x64')][0x9]?_0x2795ae['attrs'][0x9][_0x2156('0x65')]:undefined)||''},{'name':'attrChatWebsites','value':_0x2795ae[_0x2156('0x7b')]||(_0x2795ae[_0x2156('0x64')]&&_0x2795ae[_0x2156('0x64')][0xa]?_0x2795ae[_0x2156('0x64')][0xa][_0x2156('0x65')]:undefined)||''}];case _0x2156('0x7c'):return[{'name':'attrReport','type':_0x2795ae[_0x2156('0x7d')]||(_0x2795ae[_0x2156('0x64')]&&_0x2795ae[_0x2156('0x64')][0x0]?_0x2795ae[_0x2156('0x64')][0x0][_0x2156('0x3a')]:undefined)||null,'value':_0x2795ae['attrReport']||(_0x2795ae[_0x2156('0x64')]&&_0x2795ae[_0x2156('0x64')][0x0]?_0x2795ae[_0x2156('0x64')][0x0][_0x2156('0x65')]:undefined)||null},{'name':_0x2156('0x7e'),'value':_0x2795ae['attrRefresh']||(_0x2795ae[_0x2156('0x64')]&&_0x2795ae[_0x2156('0x64')][0x1]?_0x2795ae[_0x2156('0x64')][0x1][_0x2156('0x65')]:undefined)||0x0}];default:return[];}}catch(_0x2fa83e){logger[_0x2156('0x61')](_0x2156('0x7f'),JSON['stringify'](_0x2fa83e));return[];}}exports[_0x2156('0x80')]=function(_0x41bf33,_0x2c7659,_0x3b294d){if(_0x41bf33['body']['id']){delete _0x41bf33[_0x2156('0x55')]['id'];}return db['Dashboard'][_0x2156('0x53')]({'where':{'id':_0x41bf33['params']['id']}})[_0x2156('0x2e')](handleEntityNotFound(_0x2c7659,null))[_0x2156('0x2e')](function(_0x154c44){if(_0x154c44){_0x41bf33[_0x2156('0x55')][_0x2156('0x81')]=_0x154c44['id'];_0x41bf33['body'][_0x2156('0x64')]=widgetAttributes(_0x41bf33[_0x2156('0x55')]);return db[_0x2156('0x82')][_0x2156('0x54')](_0x41bf33[_0x2156('0x55')]);}})[_0x2156('0x2e')](respondWithResult(_0x2c7659,null))['catch'](handleError(_0x2c7659,null));};exports[_0x2156('0x83')]=function(_0x5cfec4,_0x30d15d,_0x326558){var _0x2be0ae={};var _0x5acd73={};var _0x5806bc;var _0x2929e0;return db[_0x2156('0x37')][_0x2156('0x84')]({'where':{'id':_0x5cfec4[_0x2156('0x52')]['id']}})['then'](handleEntityNotFound(_0x30d15d,null))['then'](function(_0x487254){if(_0x487254){_0x5806bc=_0x487254;_0x5acd73[_0x2156('0x43')]=_['keys'](db[_0x2156('0x82')][_0x2156('0x38')]);_0x5acd73[_0x2156('0x3c')]=_['keys'](_0x5cfec4['query']);_0x5acd73[_0x2156('0x3e')]=_[_0x2156('0x3f')](_0x5acd73[_0x2156('0x43')],_0x5acd73[_0x2156('0x3c')]);_0x2be0ae[_0x2156('0x40')]=_[_0x2156('0x3f')](_0x5acd73[_0x2156('0x43')],qs[_0x2156('0x41')](_0x5cfec4[_0x2156('0x3c')]['fields']));_0x2be0ae['attributes']=_0x2be0ae[_0x2156('0x40')][_0x2156('0x42')]?_0x2be0ae[_0x2156('0x40')]:_0x5acd73[_0x2156('0x43')];_0x2be0ae[_0x2156('0x45')]=qs[_0x2156('0x46')](_0x5cfec4['query'][_0x2156('0x46')]);_0x2be0ae[_0x2156('0x47')]=qs[_0x2156('0x3e')](_[_0x2156('0x48')](_0x5cfec4['query'],_0x5acd73[_0x2156('0x3e')]));if(_0x5cfec4[_0x2156('0x3c')][_0x2156('0x49')]){_0x2be0ae[_0x2156('0x47')]=_['merge'](_0x2be0ae[_0x2156('0x47')],{'$or':_[_0x2156('0x36')](_0x2be0ae[_0x2156('0x40')],function(_0x8558dd){var _0x1d78f1={};_0x1d78f1[_0x8558dd]={'$like':'%'+_0x5cfec4[_0x2156('0x3c')][_0x2156('0x49')]+'%'};return _0x1d78f1;})});}_0x2be0ae=_[_0x2156('0x4a')]({},_0x2be0ae,_0x5cfec4[_0x2156('0x5c')]);return _0x5806bc[_0x2156('0x83')](_0x2be0ae);}})[_0x2156('0x2e')](function(_0xf8d977){if(_0xf8d977){_0x2929e0=_0xf8d977[_0x2156('0x42')];if(!_0x5cfec4['query'][_0x2156('0x85')](_0x2156('0x44'))){_0x2be0ae['limit']=qs[_0x2156('0x25')](_0x5cfec4[_0x2156('0x3c')][_0x2156('0x25')]);_0x2be0ae['offset']=qs[_0x2156('0x23')](_0x5cfec4[_0x2156('0x3c')][_0x2156('0x23')]);}return _0x5806bc[_0x2156('0x83')](_0x2be0ae);}})[_0x2156('0x2e')](function(_0x4c81b9){if(_0x4c81b9){return _0x4c81b9?{'count':_0x2929e0,'rows':_0x4c81b9}:null;}})[_0x2156('0x2e')](respondWithResult(_0x30d15d,null))[_0x2156('0x50')](handleError(_0x30d15d,null));};
\ No newline at end of file
+var _0xbde0=['count','limit','set','reject','save','update','destroy','then','get','CustomDashboards','UserProfileResource','sendStatus','stack','name','send','index','map','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','Dashboard','includeAll','include','findAll','rows','catch','show','rawAttributes','length','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','clone','params','createdAt','updatedAt','omit','error','iframe','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','total','attrVoiceQueues','attrChannel','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrChatWebsites','pie-chart','attrSerie1','attrSerie2','attrSerie3','voice','attrWhatsappAccounts','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardId','DashboardItem','getItems','findOne','order','hasOwnProperty','rimraf','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','register','status','end','json','offset','undefined'];(function(_0x3cd318,_0x23cbfa){var _0x443604=function(_0x21c38a){while(--_0x21c38a){_0x3cd318['push'](_0x3cd318['shift']());}};_0x443604(++_0x23cbfa);}(_0xbde0,0xe7));var _0x0bde=function(_0x5f3f88,_0x562baf){_0x5f3f88=_0x5f3f88-0x0;var _0xd08119=_0xbde0[_0x5f3f88];return _0xd08119;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0bde('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0bde('0x1'));var moment=require(_0x0bde('0x2'));var BPromise=require(_0x0bde('0x3'));var Mustache=require(_0x0bde('0x4'));var util=require('util');var path=require(_0x0bde('0x5'));var sox=require('sox');var csv=require(_0x0bde('0x6'));var ejs=require(_0x0bde('0x7'));var fs=require('fs');var fs_extra=require(_0x0bde('0x8'));var _=require('lodash');var squel=require(_0x0bde('0x9'));var crypto=require(_0x0bde('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x0bde('0xb'));var toCsv=require(_0x0bde('0x6'));var querystring=require('querystring');var Papa=require(_0x0bde('0xc'));var Redis=require(_0x0bde('0xd'));var authService=require(_0x0bde('0xe'));var qs=require(_0x0bde('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0bde('0x10'));var logger=require(_0x0bde('0x11'))('api');var utils=require(_0x0bde('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x0bde('0x13'));var db=require('../../mysqldb')['db'];config[_0x0bde('0x14')]=_[_0x0bde('0x15')](config[_0x0bde('0x14')],{'host':_0x0bde('0x16'),'port':0x18eb});var socket=require(_0x0bde('0x17'))(new Redis(config[_0x0bde('0x14')]));require(_0x0bde('0x18'))[_0x0bde('0x19')](socket);function respondWithStatusCode(_0x380c63,_0x41f1b6){_0x41f1b6=_0x41f1b6||0xcc;return function(_0x53e93d){if(_0x53e93d){return _0x380c63['sendStatus'](_0x41f1b6);}return _0x380c63[_0x0bde('0x1a')](_0x41f1b6)[_0x0bde('0x1b')]();};}function respondWithResult(_0x2a4bce,_0x13918a){_0x13918a=_0x13918a||0xc8;return function(_0x5dc905){if(_0x5dc905){return _0x2a4bce[_0x0bde('0x1a')](_0x13918a)[_0x0bde('0x1c')](_0x5dc905);}};}function respondWithFilteredResult(_0x4c0acb,_0x10d92e){return function(_0x4c4c78){if(_0x4c4c78){var _0x2386bb=typeof _0x10d92e[_0x0bde('0x1d')]==='undefined'&&typeof _0x10d92e['limit']===_0x0bde('0x1e');var _0xb7c23d=_0x4c4c78[_0x0bde('0x1f')];var _0x517d9f=_0x2386bb?0x0:_0x10d92e[_0x0bde('0x1d')];var _0x13f19e=_0x2386bb?_0x4c4c78[_0x0bde('0x1f')]:_0x10d92e['offset']+_0x10d92e[_0x0bde('0x20')];var _0x44ae5d;if(_0x13f19e>=_0xb7c23d){_0x13f19e=_0xb7c23d;_0x44ae5d=0xc8;}else{_0x44ae5d=0xce;}_0x4c0acb['status'](_0x44ae5d);return _0x4c0acb[_0x0bde('0x21')]('Content-Range',_0x517d9f+'-'+_0x13f19e+'/'+_0xb7c23d)['json'](_0x4c4c78);}return null;};}function patchUpdates(_0x5f5a24){return function(_0x224ddc){try{jsonpatch['apply'](_0x224ddc,_0x5f5a24,!![]);}catch(_0x341d1b){return BPromise[_0x0bde('0x22')](_0x341d1b);}return _0x224ddc[_0x0bde('0x23')]();};}function saveUpdates(_0xd7be22,_0x6e8195){return function(_0x90d9b7){if(_0x90d9b7){return _0x90d9b7[_0x0bde('0x24')](_0xd7be22)['then'](function(_0x56589c){return _0x56589c;});}return null;};}function removeEntity(_0x57b33c,_0x5c67c2){return function(_0x6fd21e){if(_0x6fd21e){return _0x6fd21e[_0x0bde('0x25')]()[_0x0bde('0x26')](function(){var _0x444d97=_0x6fd21e[_0x0bde('0x27')]({'plain':!![]});var _0x4e2a1b=_0x0bde('0x28');return db[_0x0bde('0x29')][_0x0bde('0x25')]({'where':{'type':_0x4e2a1b,'resourceId':_0x444d97['id']}})['then'](function(){return _0x6fd21e;});})[_0x0bde('0x26')](function(){_0x57b33c[_0x0bde('0x1a')](0xcc)[_0x0bde('0x1b')]();});}};}function handleEntityNotFound(_0x69af69,_0x160e2f){return function(_0x2ee332){if(!_0x2ee332){_0x69af69[_0x0bde('0x2a')](0x194);}return _0x2ee332;};}function handleError(_0x2e3b93,_0x5ed713){_0x5ed713=_0x5ed713||0x1f4;return function(_0x14b5f6){logger['error'](_0x14b5f6[_0x0bde('0x2b')]);if(_0x14b5f6[_0x0bde('0x2c')]){delete _0x14b5f6[_0x0bde('0x2c')];}_0x2e3b93[_0x0bde('0x1a')](_0x5ed713)[_0x0bde('0x2d')](_0x14b5f6);};}exports[_0x0bde('0x2e')]=function(_0x286791,_0x4607fb){var _0x5206d7={},_0x435461={},_0x410cad={'count':0x0,'rows':[]};var _0x24e0a1=_[_0x0bde('0x2f')](db['Dashboard']['rawAttributes'],function(_0x2444b1){return{'name':_0x2444b1[_0x0bde('0x30')],'type':_0x2444b1[_0x0bde('0x31')][_0x0bde('0x32')]};});_0x435461[_0x0bde('0x33')]=_[_0x0bde('0x2f')](_0x24e0a1,_0x0bde('0x2c'));_0x435461[_0x0bde('0x34')]=_[_0x0bde('0x35')](_0x286791['query']);_0x435461[_0x0bde('0x36')]=_['intersection'](_0x435461['model'],_0x435461[_0x0bde('0x34')]);_0x5206d7[_0x0bde('0x37')]=_[_0x0bde('0x38')](_0x435461[_0x0bde('0x33')],qs['fields'](_0x286791[_0x0bde('0x34')][_0x0bde('0x39')]));_0x5206d7[_0x0bde('0x37')]=_0x5206d7[_0x0bde('0x37')]['length']?_0x5206d7['attributes']:_0x435461[_0x0bde('0x33')];if(!_0x286791[_0x0bde('0x34')]['hasOwnProperty'](_0x0bde('0x3a'))){_0x5206d7[_0x0bde('0x20')]=qs[_0x0bde('0x20')](_0x286791[_0x0bde('0x34')][_0x0bde('0x20')]);_0x5206d7[_0x0bde('0x1d')]=qs[_0x0bde('0x1d')](_0x286791['query']['offset']);}_0x5206d7['order']=qs['sort'](_0x286791['query'][_0x0bde('0x3b')]);_0x5206d7['where']=qs['filters'](_[_0x0bde('0x3c')](_0x286791[_0x0bde('0x34')],_0x435461[_0x0bde('0x36')]),_0x24e0a1);if(_0x286791[_0x0bde('0x34')][_0x0bde('0x3d')]){_0x5206d7[_0x0bde('0x3e')]=_[_0x0bde('0x3f')](_0x5206d7[_0x0bde('0x3e')],{'$or':_[_0x0bde('0x2f')](_0x24e0a1,function(_0x109fff){if(_0x109fff[_0x0bde('0x31')]!==_0x0bde('0x40')){var _0x41fd66={};_0x41fd66[_0x109fff[_0x0bde('0x2c')]]={'$like':'%'+_0x286791['query'][_0x0bde('0x3d')]+'%'};return _0x41fd66;}})});}_0x5206d7=_[_0x0bde('0x3f')]({},_0x5206d7,_0x286791[_0x0bde('0x41')]);var _0x2c5a86={'where':_0x5206d7[_0x0bde('0x3e')]};return db[_0x0bde('0x42')][_0x0bde('0x1f')](_0x2c5a86)[_0x0bde('0x26')](function(_0x714276){_0x410cad[_0x0bde('0x1f')]=_0x714276;if(_0x286791[_0x0bde('0x34')][_0x0bde('0x43')]){_0x5206d7[_0x0bde('0x44')]=[{'all':!![]}];}return db[_0x0bde('0x42')][_0x0bde('0x45')](_0x5206d7);})[_0x0bde('0x26')](function(_0xaccd11){_0x410cad[_0x0bde('0x46')]=_0xaccd11;return _0x410cad;})[_0x0bde('0x26')](respondWithFilteredResult(_0x4607fb,_0x5206d7))[_0x0bde('0x47')](handleError(_0x4607fb,null));};exports[_0x0bde('0x48')]=function(_0x578fc0,_0x3fc80b){var _0x113c0e={'raw':![],'where':{'id':_0x578fc0['params']['id']}},_0x24204d={};_0x24204d[_0x0bde('0x33')]=_[_0x0bde('0x35')](db[_0x0bde('0x42')][_0x0bde('0x49')]);_0x24204d[_0x0bde('0x34')]=_['keys'](_0x578fc0[_0x0bde('0x34')]);_0x24204d[_0x0bde('0x36')]=_[_0x0bde('0x38')](_0x24204d['model'],_0x24204d[_0x0bde('0x34')]);_0x113c0e[_0x0bde('0x37')]=_[_0x0bde('0x38')](_0x24204d[_0x0bde('0x33')],qs[_0x0bde('0x39')](_0x578fc0[_0x0bde('0x34')][_0x0bde('0x39')]));_0x113c0e[_0x0bde('0x37')]=_0x113c0e[_0x0bde('0x37')][_0x0bde('0x4a')]?_0x113c0e[_0x0bde('0x37')]:_0x24204d[_0x0bde('0x33')];if(_0x578fc0[_0x0bde('0x34')]['includeAll']){_0x113c0e[_0x0bde('0x44')]=[{'all':!![]}];}_0x113c0e=_[_0x0bde('0x3f')]({},_0x113c0e,_0x578fc0[_0x0bde('0x41')]);return db[_0x0bde('0x42')][_0x0bde('0x4b')](_0x113c0e)['then'](handleEntityNotFound(_0x3fc80b,null))[_0x0bde('0x26')](respondWithResult(_0x3fc80b,null))[_0x0bde('0x47')](handleError(_0x3fc80b,null));};exports[_0x0bde('0x4c')]=function(_0x9dfa3c,_0x254ed4){return db['Dashboard'][_0x0bde('0x4c')](_0x9dfa3c[_0x0bde('0x4d')],{})[_0x0bde('0x26')](function(_0x30d72a){var _0x2fc289=_0x9dfa3c[_0x0bde('0x4e')]['get']({'plain':!![]});if(!_0x2fc289)throw new Error(_0x0bde('0x4f'));if(_0x2fc289[_0x0bde('0x50')]==='user'){var _0xa94c1b=_0x30d72a[_0x0bde('0x27')]({'plain':!![]});var _0x53b300=_0x0bde('0x28');return db[_0x0bde('0x51')][_0x0bde('0x4b')]({'where':{'name':_0x53b300,'userProfileId':_0x2fc289[_0x0bde('0x52')]},'raw':!![]})[_0x0bde('0x26')](function(_0x124adc){if(_0x124adc&&_0x124adc[_0x0bde('0x53')]===0x0){return db[_0x0bde('0x29')][_0x0bde('0x4c')]({'name':_0xa94c1b[_0x0bde('0x2c')],'resourceId':_0xa94c1b['id'],'type':_0x124adc[_0x0bde('0x2c')],'sectionId':_0x124adc['id']},{})[_0x0bde('0x26')](function(){return _0x30d72a;});}else{return _0x30d72a;}})[_0x0bde('0x47')](function(_0x3b6f33){logger['error'](_0x0bde('0x54'),_0x3b6f33);throw _0x3b6f33;});}return _0x30d72a;})['then'](respondWithResult(_0x254ed4,0xc9))[_0x0bde('0x47')](handleError(_0x254ed4,null));};exports[_0x0bde('0x55')]=function(_0xdbd993,_0x4981b3){var _0x5c1dc6={'where':{'id':_0xdbd993[_0x0bde('0x56')]['id']}},_0x54fa3d={};_0x54fa3d[_0x0bde('0x33')]=_[_0x0bde('0x35')](db[_0x0bde('0x42')][_0x0bde('0x49')]);_0x5c1dc6['attributes']=_[_0x0bde('0x38')](_0x54fa3d[_0x0bde('0x33')],qs[_0x0bde('0x39')](_0xdbd993[_0x0bde('0x34')][_0x0bde('0x39')]));_0x5c1dc6['attributes']=_0x5c1dc6[_0x0bde('0x37')]['length']?_0x5c1dc6[_0x0bde('0x37')]:_0x54fa3d[_0x0bde('0x33')];if(_0xdbd993['query'][_0x0bde('0x43')]){_0x5c1dc6[_0x0bde('0x44')]=[{'all':!![]}];}_0x5c1dc6=_[_0x0bde('0x3f')]({},_0x5c1dc6,_0xdbd993[_0x0bde('0x41')]);return db[_0x0bde('0x42')][_0x0bde('0x4b')](_0x5c1dc6)[_0x0bde('0x26')](handleEntityNotFound(_0x4981b3,null))['then'](function(_0x5c8d64){if(_0x5c8d64){var _0xb8daea=_0x5c8d64[_0x0bde('0x27')]({'plain':!![]});_0xb8daea=qs['omit'](_0xb8daea,['id',_0x0bde('0x57'),_0x0bde('0x58')]);_0xdbd993[_0x0bde('0x4d')]=_[_0x0bde('0x59')](_0xdbd993[_0x0bde('0x4d')],['id',_0x0bde('0x57'),_0x0bde('0x58')]);return db[_0x0bde('0x42')][_0x0bde('0x4c')](_[_0x0bde('0x3f')](_0xb8daea,_0xdbd993[_0x0bde('0x4d')]),{'include':_0xdbd993[_0x0bde('0x34')][_0x0bde('0x43')]?[{'all':!![]}]:undefined})['then'](function(_0x4a7509){var _0x57ded5=_0xdbd993[_0x0bde('0x4e')][_0x0bde('0x27')]({'plain':!![]});if(!_0x57ded5)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x57ded5[_0x0bde('0x50')]===_0x0bde('0x4e')){var _0x4ead3e=_0x4a7509[_0x0bde('0x27')]({'plain':!![]});var _0x4fbc0a=_0x0bde('0x28');return db[_0x0bde('0x51')][_0x0bde('0x4b')]({'where':{'name':_0x4fbc0a,'userProfileId':_0x57ded5[_0x0bde('0x52')]},'raw':!![]})[_0x0bde('0x26')](function(_0x5653e6){if(_0x5653e6&&_0x5653e6[_0x0bde('0x53')]===0x0){return db[_0x0bde('0x29')][_0x0bde('0x4c')]({'name':_0x4ead3e[_0x0bde('0x2c')],'resourceId':_0x4ead3e['id'],'type':_0x5653e6['name'],'sectionId':_0x5653e6['id']},{})[_0x0bde('0x26')](function(){return _0x4a7509;});}else{return _0x4a7509;}})[_0x0bde('0x47')](function(_0x14692e){logger[_0x0bde('0x5a')](_0x0bde('0x54'),_0x14692e);throw _0x14692e;});}return _0x4a7509;});}})['then'](respondWithResult(_0x4981b3,0xc9))[_0x0bde('0x47')](handleError(_0x4981b3,null));};exports[_0x0bde('0x24')]=function(_0xdc9cb9,_0xe5a655){if(_0xdc9cb9['body']['id']){delete _0xdc9cb9[_0x0bde('0x4d')]['id'];}return db[_0x0bde('0x42')][_0x0bde('0x4b')]({'where':{'id':_0xdc9cb9[_0x0bde('0x56')]['id']}})[_0x0bde('0x26')](handleEntityNotFound(_0xe5a655,null))[_0x0bde('0x26')](saveUpdates(_0xdc9cb9[_0x0bde('0x4d')],null))[_0x0bde('0x26')](respondWithResult(_0xe5a655,null))[_0x0bde('0x47')](handleError(_0xe5a655,null));};exports[_0x0bde('0x25')]=function(_0x359117,_0x369812){return db[_0x0bde('0x42')]['find']({'where':{'id':_0x359117[_0x0bde('0x56')]['id']}})[_0x0bde('0x26')](handleEntityNotFound(_0x369812,null))[_0x0bde('0x26')](removeEntity(_0x369812,null))['catch'](handleError(_0x369812,null));};function widgetAttributes(_0x4cd0cc){try{switch(_0x4cd0cc['type']){case _0x0bde('0x5b'):return[{'name':_0x0bde('0x5c'),'value':_0x4cd0cc[_0x0bde('0x5c')]||(_0x4cd0cc[_0x0bde('0x5d')]&&_0x4cd0cc[_0x0bde('0x5d')][0x0]?_0x4cd0cc['attrs'][0x0][_0x0bde('0x5e')]:undefined)||_0x0bde('0x5f')}];case _0x0bde('0x60'):return[{'name':_0x0bde('0x61'),'value':_0x4cd0cc[_0x0bde('0x61')]||(_0x4cd0cc['attrs']&&_0x4cd0cc[_0x0bde('0x5d')][0x0]?_0x4cd0cc['attrs'][0x0][_0x0bde('0x5e')]:undefined)||''}];case _0x0bde('0x62'):return[{'name':_0x0bde('0x63'),'value':_0x4cd0cc[_0x0bde('0x63')]||(_0x4cd0cc[_0x0bde('0x5d')]&&_0x4cd0cc[_0x0bde('0x5d')][0x0]?_0x4cd0cc[_0x0bde('0x5d')][0x0]['value']:undefined)||_0x0bde('0x64')},{'name':_0x0bde('0x65'),'value':_0x4cd0cc[_0x0bde('0x65')]||(_0x4cd0cc[_0x0bde('0x5d')]&&_0x4cd0cc[_0x0bde('0x5d')][0x1]?_0x4cd0cc[_0x0bde('0x5d')][0x1][_0x0bde('0x5e')]:undefined)||_0x0bde('0x66')},{'name':_0x0bde('0x67'),'value':_0x4cd0cc[_0x0bde('0x67')]||(_0x4cd0cc[_0x0bde('0x5d')]&&_0x4cd0cc['attrs'][0x2]?_0x4cd0cc[_0x0bde('0x5d')][0x2][_0x0bde('0x5e')]:undefined)||0xc}];case _0x0bde('0x68'):return[{'name':'attrMetric','value':_0x4cd0cc['attrMetric']||(_0x4cd0cc[_0x0bde('0x5d')]&&_0x4cd0cc[_0x0bde('0x5d')][0x0]?_0x4cd0cc['attrs'][0x0][_0x0bde('0x5e')]:undefined)||_0x0bde('0x69')},{'name':_0x0bde('0x6a'),'value':_0x4cd0cc[_0x0bde('0x6a')]||(_0x4cd0cc[_0x0bde('0x5d')]&&_0x4cd0cc['attrs'][0x1]?_0x4cd0cc[_0x0bde('0x5d')][0x1][_0x0bde('0x5e')]:undefined)||[]},{'name':_0x0bde('0x67'),'value':_0x4cd0cc[_0x0bde('0x67')]||(_0x4cd0cc['attrs']&&_0x4cd0cc[_0x0bde('0x5d')][0x2]?_0x4cd0cc[_0x0bde('0x5d')][0x2]['value']:undefined)||0x14},{'name':_0x0bde('0x6b'),'value':_0x4cd0cc[_0x0bde('0x6b')]||(_0x4cd0cc['attrs']&&_0x4cd0cc[_0x0bde('0x5d')][0x3]?_0x4cd0cc[_0x0bde('0x5d')][0x3][_0x0bde('0x5e')]:undefined)||'voice'},{'name':_0x0bde('0x6c'),'value':_0x4cd0cc['attrEmailAccounts']||(_0x4cd0cc[_0x0bde('0x5d')]&&_0x4cd0cc[_0x0bde('0x5d')][0x4]?_0x4cd0cc[_0x0bde('0x5d')][0x4][_0x0bde('0x5e')]:undefined)||''},{'name':_0x0bde('0x6d'),'value':_0x4cd0cc[_0x0bde('0x6d')]||(_0x4cd0cc[_0x0bde('0x5d')]&&_0x4cd0cc[_0x0bde('0x5d')][0x5]?_0x4cd0cc[_0x0bde('0x5d')][0x5][_0x0bde('0x5e')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x4cd0cc[_0x0bde('0x6e')]||(_0x4cd0cc[_0x0bde('0x5d')]&&_0x4cd0cc[_0x0bde('0x5d')][0x6]?_0x4cd0cc[_0x0bde('0x5d')][0x6][_0x0bde('0x5e')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x4cd0cc[_0x0bde('0x6f')]||(_0x4cd0cc[_0x0bde('0x5d')]&&_0x4cd0cc[_0x0bde('0x5d')][0x7]?_0x4cd0cc[_0x0bde('0x5d')][0x7]['value']:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x4cd0cc['attrWhatsappAccounts']||(_0x4cd0cc['attrs']&&_0x4cd0cc[_0x0bde('0x5d')][0x8]?_0x4cd0cc[_0x0bde('0x5d')][0x8][_0x0bde('0x5e')]:undefined)||''},{'name':_0x0bde('0x70'),'value':_0x4cd0cc[_0x0bde('0x70')]||(_0x4cd0cc[_0x0bde('0x5d')]&&_0x4cd0cc[_0x0bde('0x5d')][0x9]?_0x4cd0cc['attrs'][0x9][_0x0bde('0x5e')]:undefined)||''}];case'multibar-chart':case _0x0bde('0x71'):return[{'name':_0x0bde('0x72'),'value':_0x4cd0cc[_0x0bde('0x72')]||(_0x4cd0cc[_0x0bde('0x5d')]&&_0x4cd0cc[_0x0bde('0x5d')][0x0]?_0x4cd0cc['attrs'][0x0][_0x0bde('0x5e')]:undefined)||_0x0bde('0x69')},{'name':_0x0bde('0x73'),'value':_0x4cd0cc[_0x0bde('0x73')]||(_0x4cd0cc[_0x0bde('0x5d')]&&_0x4cd0cc['attrs'][0x1]?_0x4cd0cc[_0x0bde('0x5d')][0x1][_0x0bde('0x5e')]:undefined)||null},{'name':_0x0bde('0x74'),'value':_0x4cd0cc[_0x0bde('0x74')]||(_0x4cd0cc[_0x0bde('0x5d')]&&_0x4cd0cc[_0x0bde('0x5d')][0x2]?_0x4cd0cc['attrs'][0x2][_0x0bde('0x5e')]:undefined)||null},{'name':_0x0bde('0x6a'),'value':_0x4cd0cc[_0x0bde('0x6a')]||(_0x4cd0cc[_0x0bde('0x5d')]&&_0x4cd0cc[_0x0bde('0x5d')][0x3]?_0x4cd0cc['attrs'][0x3][_0x0bde('0x5e')]:undefined)||[]},{'name':_0x0bde('0x6b'),'value':_0x4cd0cc[_0x0bde('0x6b')]||(_0x4cd0cc[_0x0bde('0x5d')]&&_0x4cd0cc[_0x0bde('0x5d')][0x4]?_0x4cd0cc['attrs'][0x4][_0x0bde('0x5e')]:undefined)||_0x0bde('0x75')},{'name':'attrEmailAccounts','value':_0x4cd0cc[_0x0bde('0x6c')]||(_0x4cd0cc[_0x0bde('0x5d')]&&_0x4cd0cc['attrs'][0x5]?_0x4cd0cc['attrs'][0x5][_0x0bde('0x5e')]:undefined)||''},{'name':_0x0bde('0x6d'),'value':_0x4cd0cc[_0x0bde('0x6d')]||(_0x4cd0cc['attrs']&&_0x4cd0cc['attrs'][0x6]?_0x4cd0cc[_0x0bde('0x5d')][0x6]['value']:undefined)||''},{'name':_0x0bde('0x6e'),'value':_0x4cd0cc[_0x0bde('0x6e')]||(_0x4cd0cc[_0x0bde('0x5d')]&&_0x4cd0cc[_0x0bde('0x5d')][0x7]?_0x4cd0cc['attrs'][0x7][_0x0bde('0x5e')]:undefined)||''},{'name':_0x0bde('0x6f'),'value':_0x4cd0cc[_0x0bde('0x6f')]||(_0x4cd0cc[_0x0bde('0x5d')]&&_0x4cd0cc[_0x0bde('0x5d')][0x8]?_0x4cd0cc['attrs'][0x8][_0x0bde('0x5e')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x4cd0cc[_0x0bde('0x76')]||(_0x4cd0cc['attrs']&&_0x4cd0cc[_0x0bde('0x5d')][0x9]?_0x4cd0cc[_0x0bde('0x5d')][0x9]['value']:undefined)||''},{'name':_0x0bde('0x70'),'value':_0x4cd0cc[_0x0bde('0x70')]||(_0x4cd0cc[_0x0bde('0x5d')]&&_0x4cd0cc[_0x0bde('0x5d')][0xa]?_0x4cd0cc['attrs'][0xa][_0x0bde('0x5e')]:undefined)||''}];case'web-report':return[{'name':_0x0bde('0x77'),'type':_0x4cd0cc[_0x0bde('0x78')]||(_0x4cd0cc[_0x0bde('0x5d')]&&_0x4cd0cc[_0x0bde('0x5d')][0x0]?_0x4cd0cc[_0x0bde('0x5d')][0x0]['type']:undefined)||null,'value':_0x4cd0cc[_0x0bde('0x77')]||(_0x4cd0cc[_0x0bde('0x5d')]&&_0x4cd0cc[_0x0bde('0x5d')][0x0]?_0x4cd0cc[_0x0bde('0x5d')][0x0][_0x0bde('0x5e')]:undefined)||null},{'name':'attrRefresh','value':_0x4cd0cc[_0x0bde('0x79')]||(_0x4cd0cc[_0x0bde('0x5d')]&&_0x4cd0cc[_0x0bde('0x5d')][0x1]?_0x4cd0cc[_0x0bde('0x5d')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x1a8d42){logger['error'](_0x0bde('0x7a'),JSON[_0x0bde('0x7b')](_0x1a8d42));return[];}}exports[_0x0bde('0x7c')]=function(_0x44d28d,_0x5268d5,_0xfbf73){if(_0x44d28d[_0x0bde('0x4d')]['id']){delete _0x44d28d['body']['id'];}return db[_0x0bde('0x42')]['find']({'where':{'id':_0x44d28d[_0x0bde('0x56')]['id']}})[_0x0bde('0x26')](handleEntityNotFound(_0x5268d5,null))[_0x0bde('0x26')](function(_0x11b7e1){if(_0x11b7e1){_0x44d28d[_0x0bde('0x4d')][_0x0bde('0x7d')]=_0x11b7e1['id'];_0x44d28d['body']['attrs']=widgetAttributes(_0x44d28d[_0x0bde('0x4d')]);return db[_0x0bde('0x7e')][_0x0bde('0x4c')](_0x44d28d[_0x0bde('0x4d')]);}})[_0x0bde('0x26')](respondWithResult(_0x5268d5,null))[_0x0bde('0x47')](handleError(_0x5268d5,null));};exports[_0x0bde('0x7f')]=function(_0x143600,_0x5db950,_0x2fa22e){var _0x15147d={};var _0x119b94={};var _0x1fdb93;var _0x2d8b9d;return db[_0x0bde('0x42')][_0x0bde('0x80')]({'where':{'id':_0x143600['params']['id']}})[_0x0bde('0x26')](handleEntityNotFound(_0x5db950,null))[_0x0bde('0x26')](function(_0x5a853d){if(_0x5a853d){_0x1fdb93=_0x5a853d;_0x119b94['model']=_[_0x0bde('0x35')](db[_0x0bde('0x7e')][_0x0bde('0x49')]);_0x119b94[_0x0bde('0x34')]=_['keys'](_0x143600[_0x0bde('0x34')]);_0x119b94[_0x0bde('0x36')]=_[_0x0bde('0x38')](_0x119b94['model'],_0x119b94[_0x0bde('0x34')]);_0x15147d[_0x0bde('0x37')]=_[_0x0bde('0x38')](_0x119b94['model'],qs['fields'](_0x143600[_0x0bde('0x34')][_0x0bde('0x39')]));_0x15147d[_0x0bde('0x37')]=_0x15147d[_0x0bde('0x37')][_0x0bde('0x4a')]?_0x15147d['attributes']:_0x119b94[_0x0bde('0x33')];_0x15147d[_0x0bde('0x81')]=qs[_0x0bde('0x3b')](_0x143600[_0x0bde('0x34')][_0x0bde('0x3b')]);_0x15147d['where']=qs[_0x0bde('0x36')](_[_0x0bde('0x3c')](_0x143600[_0x0bde('0x34')],_0x119b94['filters']));if(_0x143600[_0x0bde('0x34')][_0x0bde('0x3d')]){_0x15147d['where']=_['merge'](_0x15147d[_0x0bde('0x3e')],{'$or':_[_0x0bde('0x2f')](_0x15147d[_0x0bde('0x37')],function(_0xd53bcb){var _0x5959bb={};_0x5959bb[_0xd53bcb]={'$like':'%'+_0x143600[_0x0bde('0x34')][_0x0bde('0x3d')]+'%'};return _0x5959bb;})});}_0x15147d=_[_0x0bde('0x3f')]({},_0x15147d,_0x143600['options']);return _0x1fdb93[_0x0bde('0x7f')](_0x15147d);}})[_0x0bde('0x26')](function(_0x2a4f88){if(_0x2a4f88){_0x2d8b9d=_0x2a4f88[_0x0bde('0x4a')];if(!_0x143600[_0x0bde('0x34')][_0x0bde('0x82')](_0x0bde('0x3a'))){_0x15147d[_0x0bde('0x20')]=qs[_0x0bde('0x20')](_0x143600[_0x0bde('0x34')]['limit']);_0x15147d[_0x0bde('0x1d')]=qs[_0x0bde('0x1d')](_0x143600[_0x0bde('0x34')][_0x0bde('0x1d')]);}return _0x1fdb93[_0x0bde('0x7f')](_0x15147d);}})[_0x0bde('0x26')](function(_0x181cfb){if(_0x181cfb){return _0x181cfb?{'count':_0x2d8b9d,'rows':_0x181cfb}:null;}})[_0x0bde('0x26')](respondWithResult(_0x5db950,null))[_0x0bde('0x47')](handleError(_0x5db950,null));};
\ No newline at end of file
index 128e1b0..7cc0a95 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6ddb=['Dashboard','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x2f109d,_0x2dfff8){var _0x1ccb3d=function(_0x3f61f8){while(--_0x3f61f8){_0x2f109d['push'](_0x2f109d['shift']());}};_0x1ccb3d(++_0x2dfff8);}(_0x6ddb,0x1a6));var _0xb6dd=function(_0x9c3f7f,_0x4f1399){_0x9c3f7f=_0x9c3f7f-0x0;var _0x1c8e5a=_0x6ddb[_0x9c3f7f];return _0x1c8e5a;};'use strict';var EventEmitter=require(_0xb6dd('0x0'));var Dashboard=require('../../mysqldb')['db'][_0xb6dd('0x1')];var DashboardEvents=new EventEmitter();DashboardEvents[_0xb6dd('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xb6dd('0x3'),'afterDestroy':_0xb6dd('0x4')};function emitEvent(_0x246cd6){return function(_0x86c327,_0x3e6009,_0x5468c8){DashboardEvents['emit'](_0x246cd6+':'+_0x86c327['id'],_0x86c327);DashboardEvents[_0xb6dd('0x5')](_0x246cd6,_0x86c327);_0x5468c8(null);};}for(var e in events){if(events[_0xb6dd('0x6')](e)){var event=events[e];Dashboard[_0xb6dd('0x7')](e,emitEvent(event));}}module[_0xb6dd('0x8')]=DashboardEvents;
\ No newline at end of file
+var _0x45bb=['update','remove','emit','hook','events','../../mysqldb','Dashboard','setMaxListeners','save'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x45bb,0x79));var _0xb45b=function(_0x31d422,_0x3b39aa){_0x31d422=_0x31d422-0x0;var _0x598462=_0x45bb[_0x31d422];return _0x598462;};'use strict';var EventEmitter=require(_0xb45b('0x0'));var Dashboard=require(_0xb45b('0x1'))['db'][_0xb45b('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents[_0xb45b('0x3')](0x0);var events={'afterCreate':_0xb45b('0x4'),'afterUpdate':_0xb45b('0x5'),'afterDestroy':_0xb45b('0x6')};function emitEvent(_0x431dea){return function(_0xac5ee2,_0x145e7a,_0x2802b0){DashboardEvents[_0xb45b('0x7')](_0x431dea+':'+_0xac5ee2['id'],_0xac5ee2);DashboardEvents['emit'](_0x431dea,_0xac5ee2);_0x2802b0(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Dashboard[_0xb45b('0x8')](e,emitEvent(event));}}module['exports']=DashboardEvents;
\ No newline at end of file
index 9982431..fad3068 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x887a=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./dashboard.attributes','exports','define','Dashboard','dashboards','util'];(function(_0x386042,_0x1869f1){var _0x5e766c=function(_0x24091e){while(--_0x24091e){_0x386042['push'](_0x386042['shift']());}};_0x5e766c(++_0x1869f1);}(_0x887a,0x185));var _0xa887=function(_0x7922cc,_0x307745){_0x7922cc=_0x7922cc-0x0;var _0x3b8745=_0x887a[_0x7922cc];return _0x3b8745;};'use strict';var _=require('lodash');var util=require(_0xa887('0x0'));var logger=require(_0xa887('0x1'))(_0xa887('0x2'));var moment=require('moment');var BPromise=require(_0xa887('0x3'));var rp=require(_0xa887('0x4'));var fs=require('fs');var path=require(_0xa887('0x5'));var rimraf=require(_0xa887('0x6'));var config=require(_0xa887('0x7'));var attributes=require(_0xa887('0x8'));module[_0xa887('0x9')]=function(_0x9891cd,_0x330419){return _0x9891cd[_0xa887('0xa')](_0xa887('0xb'),attributes,{'tableName':_0xa887('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x843b=['./dashboard.attributes','exports','define','dashboards','lodash','util','api','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x314864,_0x49fbd2){var _0x1a7005=function(_0x54e475){while(--_0x54e475){_0x314864['push'](_0x314864['shift']());}};_0x1a7005(++_0x49fbd2);}(_0x843b,0x143));var _0xb843=function(_0x56f972,_0x5f3bd3){_0x56f972=_0x56f972-0x0;var _0x3f299e=_0x843b[_0x56f972];return _0x3f299e;};'use strict';var _=require(_0xb843('0x0'));var util=require(_0xb843('0x1'));var logger=require('../../config/logger')(_0xb843('0x2'));var moment=require('moment');var BPromise=require(_0xb843('0x3'));var rp=require(_0xb843('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb843('0x5'));var config=require(_0xb843('0x6'));var attributes=require(_0xb843('0x7'));module[_0xb843('0x8')]=function(_0x2274cc,_0x574710){return _0x2274cc[_0xb843('0x9')]('Dashboard',attributes,{'tableName':_0xb843('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index eb415b7..08479f0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb609=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','register','request','then','Dashboard,\x20%s,\x20%s','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','code','error','message','info','result','catch','lodash'];(function(_0x31d439,_0xae9396){var _0x1616ab=function(_0x44ca4d){while(--_0x44ca4d){_0x31d439['push'](_0x31d439['shift']());}};_0x1616ab(++_0xae9396);}(_0xb609,0x6f));var _0x9b60=function(_0x19d73d,_0x4b5a08){_0x19d73d=_0x19d73d-0x0;var _0x5c9500=_0xb609[_0x19d73d];return _0x5c9500;};'use strict';var _=require(_0x9b60('0x0'));var util=require(_0x9b60('0x1'));var moment=require('moment');var BPromise=require(_0x9b60('0x2'));var rs=require(_0x9b60('0x3'));var fs=require('fs');var Redis=require(_0x9b60('0x4'));var db=require(_0x9b60('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x9b60('0x6'))(_0x9b60('0x7'));var config=require(_0x9b60('0x8'));var jayson=require(_0x9b60('0x9'));var client=jayson[_0x9b60('0xa')][_0x9b60('0xb')]({'port':0x232a});config[_0x9b60('0xc')]=_[_0x9b60('0xd')](config[_0x9b60('0xc')],{'host':_0x9b60('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9b60('0xc')]));require('./dashboard.socket')[_0x9b60('0xf')](socket);function respondWithRpcPromise(_0x482ef7,_0x2925e0,_0x180a77){return new BPromise(function(_0x14838d,_0x32d4de){return client[_0x9b60('0x10')](_0x482ef7,_0x180a77)[_0x9b60('0x11')](function(_0x23cb56){logger['info'](_0x9b60('0x12'),_0x2925e0,_0x9b60('0x13'));logger[_0x9b60('0x14')](_0x9b60('0x15'),_0x2925e0,_0x9b60('0x13'),JSON['stringify'](_0x23cb56));if(_0x23cb56['error']){if(_0x23cb56['error'][_0x9b60('0x16')]===0x1f4){logger[_0x9b60('0x17')]('Dashboard,\x20%s,\x20%s',_0x2925e0,_0x23cb56[_0x9b60('0x17')][_0x9b60('0x18')]);return _0x32d4de(_0x23cb56[_0x9b60('0x17')][_0x9b60('0x18')]);}logger[_0x9b60('0x17')](_0x9b60('0x12'),_0x2925e0,_0x23cb56[_0x9b60('0x17')]['message']);return _0x14838d(_0x23cb56[_0x9b60('0x17')]['message']);}else{logger[_0x9b60('0x19')](_0x9b60('0x12'),_0x2925e0,'request\x20sent');_0x14838d(_0x23cb56[_0x9b60('0x1a')][_0x9b60('0x18')]);}})[_0x9b60('0x1b')](function(_0x7f208){logger['error'](_0x9b60('0x12'),_0x2925e0,_0x7f208);_0x32d4de(_0x7f208);});});}
\ No newline at end of file
+var _0xa03e=['localhost','./dashboard.socket','register','request','then','Dashboard,\x20%s,\x20%s','request\x20sent','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults'];(function(_0x197683,_0x21df72){var _0x137639=function(_0x46b902){while(--_0x46b902){_0x197683['push'](_0x197683['shift']());}};_0x137639(++_0x21df72);}(_0xa03e,0xda));var _0xea03=function(_0x12dede,_0x41b01a){_0x12dede=_0x12dede-0x0;var _0x391367=_0xa03e[_0x12dede];return _0x391367;};'use strict';var _=require('lodash');var util=require(_0xea03('0x0'));var moment=require(_0xea03('0x1'));var BPromise=require(_0xea03('0x2'));var rs=require(_0xea03('0x3'));var fs=require('fs');var Redis=require(_0xea03('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xea03('0x5'));var logger=require(_0xea03('0x6'))(_0xea03('0x7'));var config=require(_0xea03('0x8'));var jayson=require(_0xea03('0x9'));var client=jayson[_0xea03('0xa')][_0xea03('0xb')]({'port':0x232a});config[_0xea03('0xc')]=_[_0xea03('0xd')](config[_0xea03('0xc')],{'host':_0xea03('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xea03('0xf'))[_0xea03('0x10')](socket);function respondWithRpcPromise(_0x43e1b0,_0x40758c,_0x3b5a02){return new BPromise(function(_0x1b35ef,_0x36e370){return client[_0xea03('0x11')](_0x43e1b0,_0x3b5a02)[_0xea03('0x12')](function(_0x5f337f){logger['info'](_0xea03('0x13'),_0x40758c,_0xea03('0x14'));logger['debug'](_0xea03('0x15'),_0x40758c,_0xea03('0x14'),JSON[_0xea03('0x16')](_0x5f337f));if(_0x5f337f['error']){if(_0x5f337f[_0xea03('0x17')][_0xea03('0x18')]===0x1f4){logger[_0xea03('0x17')](_0xea03('0x13'),_0x40758c,_0x5f337f[_0xea03('0x17')][_0xea03('0x19')]);return _0x36e370(_0x5f337f['error']['message']);}logger[_0xea03('0x17')]('Dashboard,\x20%s,\x20%s',_0x40758c,_0x5f337f[_0xea03('0x17')][_0xea03('0x19')]);return _0x1b35ef(_0x5f337f[_0xea03('0x17')]['message']);}else{logger[_0xea03('0x1a')]('Dashboard,\x20%s,\x20%s',_0x40758c,_0xea03('0x14'));_0x1b35ef(_0x5f337f[_0xea03('0x1b')]['message']);}})[_0xea03('0x1c')](function(_0x5ba016){logger[_0xea03('0x17')](_0xea03('0x13'),_0x40758c,_0x5ba016);_0x36e370(_0x5ba016);});});}
\ No newline at end of file
index dba3fd9..6160ec1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4ad4=['save','remove','update','register','length','./dashboard.events'];(function(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0x4ad4,0xbf));var _0x44ad=function(_0x1abb09,_0x18ee91){_0x1abb09=_0x1abb09-0x0;var _0xea1c07=_0x4ad4[_0x1abb09];return _0xea1c07;};'use strict';var DashboardEvents=require(_0x44ad('0x0'));var events=[_0x44ad('0x1'),_0x44ad('0x2'),_0x44ad('0x3')];function createListener(_0x26cd11,_0x8c4308){return function(_0xeb4dc7){_0x8c4308['emit'](_0x26cd11,_0xeb4dc7);};}function removeListener(_0x3d2001,_0x57298b){return function(){DashboardEvents['removeListener'](_0x3d2001,_0x57298b);};}exports[_0x44ad('0x4')]=function(_0x450c48){for(var _0x350a9f=0x0,_0x583676=events[_0x44ad('0x5')];_0x350a9f<_0x583676;_0x350a9f++){var _0x185c15=events[_0x350a9f];var _0x22fef8=createListener('dashboard:'+_0x185c15,_0x450c48);DashboardEvents['on'](_0x185c15,_0x22fef8);}};
\ No newline at end of file
+var _0xa68f=['emit','removeListener','register','length','dashboard:','./dashboard.events','save','update'];(function(_0x68eab0,_0xa8c589){var _0x4e481c=function(_0x49c097){while(--_0x49c097){_0x68eab0['push'](_0x68eab0['shift']());}};_0x4e481c(++_0xa8c589);}(_0xa68f,0x7d));var _0xfa68=function(_0xa25253,_0x33b4a0){_0xa25253=_0xa25253-0x0;var _0xb946cd=_0xa68f[_0xa25253];return _0xb946cd;};'use strict';var DashboardEvents=require(_0xfa68('0x0'));var events=[_0xfa68('0x1'),'remove',_0xfa68('0x2')];function createListener(_0x25ddce,_0x26015e){return function(_0x7d6b1){_0x26015e[_0xfa68('0x3')](_0x25ddce,_0x7d6b1);};}function removeListener(_0xbc8463,_0x50d286){return function(){DashboardEvents[_0xfa68('0x4')](_0xbc8463,_0x50d286);};}exports[_0xfa68('0x5')]=function(_0x264980){for(var _0x450bc4=0x0,_0x2975b7=events[_0xfa68('0x6')];_0x450bc4<_0x2975b7;_0x450bc4++){var _0x141994=events[_0x450bc4];var _0x1f7e32=createListener(_0xfa68('0x7')+_0x141994,_0x264980);DashboardEvents['on'](_0x141994,_0x1f7e32);}};
\ No newline at end of file
index 53cdbd7..3091d1a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe091=['isAuthenticated','index','/:id','/:id/items','getItems','post','clone','update','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller','get'];(function(_0x4dd5c2,_0x2a9bfc){var _0x3e78b7=function(_0x6297ff){while(--_0x6297ff){_0x4dd5c2['push'](_0x4dd5c2['shift']());}};_0x3e78b7(++_0x2a9bfc);}(_0xe091,0xf1));var _0x1e09=function(_0x551565,_0x478ff7){_0x551565=_0x551565-0x0;var _0x3174bb=_0xe091[_0x551565];return _0x3174bb;};'use strict';var multer=require(_0x1e09('0x0'));var util=require(_0x1e09('0x1'));var path=require(_0x1e09('0x2'));var timeout=require('connect-timeout');var express=require(_0x1e09('0x3'));var router=express[_0x1e09('0x4')]();var fs_extra=require(_0x1e09('0x5'));var auth=require(_0x1e09('0x6'));var interaction=require(_0x1e09('0x7'));var config=require(_0x1e09('0x8'));var controller=require(_0x1e09('0x9'));router[_0x1e09('0xa')]('/',auth[_0x1e09('0xb')](),controller[_0x1e09('0xc')]);router[_0x1e09('0xa')](_0x1e09('0xd'),auth['isAuthenticated'](),controller['show']);router['get'](_0x1e09('0xe'),auth[_0x1e09('0xb')](),controller[_0x1e09('0xf')]);router[_0x1e09('0x10')]('/',auth[_0x1e09('0xb')](),controller['create']);router[_0x1e09('0x10')]('/:id/clone',auth[_0x1e09('0xb')](),controller[_0x1e09('0x11')]);router[_0x1e09('0x10')](_0x1e09('0xe'),auth[_0x1e09('0xb')](),controller['addItem']);router['put'](_0x1e09('0xd'),auth[_0x1e09('0xb')](),controller[_0x1e09('0x12')]);router['delete'](_0x1e09('0xd'),auth[_0x1e09('0xb')](),controller[_0x1e09('0x13')]);module[_0x1e09('0x14')]=router;
\ No newline at end of file
+var _0x7327=['delete','destroy','exports','path','connect-timeout','express','fs-extra','../../config/environment','./dashboard.controller','isAuthenticated','/:id','show','get','/:id/items','getItems','post','create','/:id/clone','clone','put','update'];(function(_0x143057,_0x2689bd){var _0x55f417=function(_0x42ce62){while(--_0x42ce62){_0x143057['push'](_0x143057['shift']());}};_0x55f417(++_0x2689bd);}(_0x7327,0xff));var _0x7732=function(_0x32b181,_0x590b0f){_0x32b181=_0x32b181-0x0;var _0x50d5ef=_0x7327[_0x32b181];return _0x50d5ef;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x7732('0x0'));var timeout=require(_0x7732('0x1'));var express=require(_0x7732('0x2'));var router=express['Router']();var fs_extra=require(_0x7732('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7732('0x4'));var controller=require(_0x7732('0x5'));router['get']('/',auth[_0x7732('0x6')](),controller['index']);router['get'](_0x7732('0x7'),auth[_0x7732('0x6')](),controller[_0x7732('0x8')]);router[_0x7732('0x9')](_0x7732('0xa'),auth['isAuthenticated'](),controller[_0x7732('0xb')]);router[_0x7732('0xc')]('/',auth[_0x7732('0x6')](),controller[_0x7732('0xd')]);router[_0x7732('0xc')](_0x7732('0xe'),auth[_0x7732('0x6')](),controller[_0x7732('0xf')]);router[_0x7732('0xc')](_0x7732('0xa'),auth['isAuthenticated'](),controller['addItem']);router[_0x7732('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x7732('0x11')]);router[_0x7732('0x12')](_0x7732('0x7'),auth[_0x7732('0x6')](),controller[_0x7732('0x13')]);module[_0x7732('0x14')]=router;
\ No newline at end of file
index cf6435a..e578ed6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x46ed=['sequelize','squel','exports','STRING','long','parse','attrs','setDataValue','stringify','INTEGER','#ffffff','#2196f3'];(function(_0x4f3b2d,_0x3bbf46){var _0x3dddfa=function(_0xb8179a){while(--_0xb8179a){_0x4f3b2d['push'](_0x4f3b2d['shift']());}};_0x3dddfa(++_0x3bbf46);}(_0x46ed,0x168));var _0xd46e=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x46ed[_0x4e676e];return _0x336a3c;};'use strict';var Sequelize=require(_0xd46e('0x0'));var squel=require(_0xd46e('0x1'));var _=require('lodash');module[_0xd46e('0x2')]={'title':{'type':Sequelize[_0xd46e('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xd46e('0x3')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize['TEXT'](_0xd46e('0x4')),'get':function(){try{return JSON[_0xd46e('0x5')](this['getDataValue'](_0xd46e('0x6')));}catch(_0x1926d9){return[];}},'set':function(_0x160bcf){try{this[_0xd46e('0x7')](_0xd46e('0x6'),JSON[_0xd46e('0x8')](_0x160bcf));}catch(_0x437ea0){this[_0xd46e('0x7')](_0xd46e('0x6'),JSON[_0xd46e('0x8')]([]));}}},'sizeX':{'type':Sequelize[_0xd46e('0x9')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0xd46e('0x9')]},'col':{'type':Sequelize[_0xd46e('0x9')]},'background':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xd46e('0xa'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0xd46e('0x3')],'allowNull':![],'defaultValue':_0xd46e('0xb'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0xd46e('0x3')]},'titleFontSize':{'type':Sequelize[_0xd46e('0x9')],'defaultValue':0xc}};
\ No newline at end of file
+var _0xafc4=['TEXT','long','setDataValue','attrs','stringify','INTEGER','sequelize','lodash','STRING'];(function(_0x224742,_0x2c1bd2){var _0x31ed17=function(_0x1d7dcb){while(--_0x1d7dcb){_0x224742['push'](_0x224742['shift']());}};_0x31ed17(++_0x2c1bd2);}(_0xafc4,0x69));var _0x4afc=function(_0x390ad2,_0x3f1550){_0x390ad2=_0x390ad2-0x0;var _0x36c5e1=_0xafc4[_0x390ad2];return _0x36c5e1;};'use strict';var Sequelize=require(_0x4afc('0x0'));var squel=require('squel');var _=require(_0x4afc('0x1'));module['exports']={'title':{'type':Sequelize[_0x4afc('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x4afc('0x2')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x4afc('0x3')](_0x4afc('0x4')),'get':function(){try{return JSON['parse'](this['getDataValue']('attrs'));}catch(_0x36cb50){return[];}},'set':function(_0x471d45){try{this[_0x4afc('0x5')](_0x4afc('0x6'),JSON[_0x4afc('0x7')](_0x471d45));}catch(_0xaf053d){this['setDataValue'](_0x4afc('0x6'),JSON[_0x4afc('0x7')]([]));}}},'sizeX':{'type':Sequelize[_0x4afc('0x8')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x4afc('0x8')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x4afc('0x8')]},'col':{'type':Sequelize[_0x4afc('0x8')]},'background':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x4afc('0x2')],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x4afc('0x2')]},'titleFontSize':{'type':Sequelize[_0x4afc('0x8')],'defaultValue':0xc}};
\ No newline at end of file
index fd7efcd..e2d44d1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x63f2=['moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./dashboardItem.socket','register','sendStatus','status','undefined','limit','count','offset','set','Content-Range','json','apply','reject','destroy','then','end','stack','name','send','show','params','model','keys','DashboardItem','rawAttributes','query','attributes','intersection','fields','length','includeAll','include','merge','catch','type','iframe','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','attrTimezone','attrFontSize','counter','attrMetric','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','total','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','error','widgetAttributes:\x20%s','stringify','body','create','update','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x63f2,0x19b));var _0x263f=function(_0x375382,_0x32798c){_0x375382=_0x375382-0x0;var _0x44c94f=_0x63f2[_0x375382];return _0x44c94f;};'use strict';var emlformat=require(_0x263f('0x0'));var rimraf=require(_0x263f('0x1'));var zipdir=require(_0x263f('0x2'));var jsonpatch=require(_0x263f('0x3'));var rp=require(_0x263f('0x4'));var moment=require(_0x263f('0x5'));var BPromise=require(_0x263f('0x6'));var Mustache=require(_0x263f('0x7'));var util=require(_0x263f('0x8'));var path=require('path');var sox=require(_0x263f('0x9'));var csv=require(_0x263f('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x263f('0xb'));var _=require(_0x263f('0xc'));var squel=require(_0x263f('0xd'));var crypto=require('crypto');var jsforce=require(_0x263f('0xe'));var deskjs=require(_0x263f('0xf'));var toCsv=require(_0x263f('0xa'));var querystring=require(_0x263f('0x10'));var Papa=require(_0x263f('0x11'));var Redis=require(_0x263f('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x263f('0x13'));var as=require(_0x263f('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x263f('0x15'))(_0x263f('0x16'));var utils=require(_0x263f('0x17'));var config=require(_0x263f('0x18'));var licenseUtil=require(_0x263f('0x19'));var db=require(_0x263f('0x1a'))['db'];config[_0x263f('0x1b')]=_[_0x263f('0x1c')](config[_0x263f('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0x263f('0x1d'))(new Redis(config[_0x263f('0x1b')]));require(_0x263f('0x1e'))[_0x263f('0x1f')](socket);function respondWithStatusCode(_0x553413,_0x55b928){_0x55b928=_0x55b928||0xcc;return function(_0x53bc02){if(_0x53bc02){return _0x553413[_0x263f('0x20')](_0x55b928);}return _0x553413[_0x263f('0x21')](_0x55b928)['end']();};}function respondWithResult(_0x119170,_0x2cd876){_0x2cd876=_0x2cd876||0xc8;return function(_0x4421d0){if(_0x4421d0){return _0x119170[_0x263f('0x21')](_0x2cd876)['json'](_0x4421d0);}};}function respondWithFilteredResult(_0x4169c4,_0x45698d){return function(_0x143dcd){if(_0x143dcd){var _0x408bf8=typeof _0x45698d['offset']===_0x263f('0x22')&&typeof _0x45698d[_0x263f('0x23')]===_0x263f('0x22');var _0x15bf30=_0x143dcd[_0x263f('0x24')];var _0x1a7033=_0x408bf8?0x0:_0x45698d[_0x263f('0x25')];var _0x1f4341=_0x408bf8?_0x143dcd[_0x263f('0x24')]:_0x45698d[_0x263f('0x25')]+_0x45698d['limit'];var _0x1a6b15;if(_0x1f4341>=_0x15bf30){_0x1f4341=_0x15bf30;_0x1a6b15=0xc8;}else{_0x1a6b15=0xce;}_0x4169c4[_0x263f('0x21')](_0x1a6b15);return _0x4169c4[_0x263f('0x26')](_0x263f('0x27'),_0x1a7033+'-'+_0x1f4341+'/'+_0x15bf30)[_0x263f('0x28')](_0x143dcd);}return null;};}function patchUpdates(_0x12c090){return function(_0x3d208e){try{jsonpatch[_0x263f('0x29')](_0x3d208e,_0x12c090,!![]);}catch(_0x23a2ff){return BPromise[_0x263f('0x2a')](_0x23a2ff);}return _0x3d208e['save']();};}function saveUpdates(_0x3b3494,_0x489af7){return function(_0x364105){if(_0x364105){return _0x364105['update'](_0x3b3494)['then'](function(_0x501d66){return _0x501d66;});}return null;};}function removeEntity(_0x399cc3,_0x506f9a){return function(_0x4f5149){if(_0x4f5149){return _0x4f5149[_0x263f('0x2b')]()[_0x263f('0x2c')](function(){_0x399cc3['status'](0xcc)[_0x263f('0x2d')]();});}};}function handleEntityNotFound(_0x1f3aab,_0x302e50){return function(_0x35e358){if(!_0x35e358){_0x1f3aab[_0x263f('0x20')](0x194);}return _0x35e358;};}function handleError(_0x1523a2,_0xea84b4){_0xea84b4=_0xea84b4||0x1f4;return function(_0x2097bc){logger['error'](_0x2097bc[_0x263f('0x2e')]);if(_0x2097bc['name']){delete _0x2097bc[_0x263f('0x2f')];}_0x1523a2[_0x263f('0x21')](_0xea84b4)[_0x263f('0x30')](_0x2097bc);};}exports[_0x263f('0x31')]=function(_0x4fef0e,_0x89c70c){var _0x1d4404={'raw':![],'where':{'id':_0x4fef0e[_0x263f('0x32')]['id']}},_0x25fe4a={};_0x25fe4a[_0x263f('0x33')]=_[_0x263f('0x34')](db[_0x263f('0x35')][_0x263f('0x36')]);_0x25fe4a['query']=_[_0x263f('0x34')](_0x4fef0e[_0x263f('0x37')]);_0x25fe4a['filters']=_['intersection'](_0x25fe4a[_0x263f('0x33')],_0x25fe4a[_0x263f('0x37')]);_0x1d4404[_0x263f('0x38')]=_[_0x263f('0x39')](_0x25fe4a[_0x263f('0x33')],qs[_0x263f('0x3a')](_0x4fef0e[_0x263f('0x37')][_0x263f('0x3a')]));_0x1d4404[_0x263f('0x38')]=_0x1d4404['attributes'][_0x263f('0x3b')]?_0x1d4404['attributes']:_0x25fe4a[_0x263f('0x33')];if(_0x4fef0e[_0x263f('0x37')][_0x263f('0x3c')]){_0x1d4404[_0x263f('0x3d')]=[{'all':!![]}];}_0x1d4404=_[_0x263f('0x3e')]({},_0x1d4404,_0x4fef0e['options']);return db[_0x263f('0x35')]['find'](_0x1d4404)[_0x263f('0x2c')](handleEntityNotFound(_0x89c70c,null))[_0x263f('0x2c')](respondWithResult(_0x89c70c,null))[_0x263f('0x3f')](handleError(_0x89c70c,null));};exports[_0x263f('0x2b')]=function(_0x2b653e,_0x18b972){return db[_0x263f('0x35')]['find']({'where':{'id':_0x2b653e['params']['id']}})[_0x263f('0x2c')](handleEntityNotFound(_0x18b972,null))['then'](removeEntity(_0x18b972,null))['catch'](handleError(_0x18b972,null));};function widgetAttributes(_0x472892){try{switch(_0x472892[_0x263f('0x40')]){case _0x263f('0x41'):return[{'name':_0x263f('0x42'),'value':_0x472892[_0x263f('0x42')]||(_0x472892[_0x263f('0x43')]&&_0x472892[_0x263f('0x43')][0x0]?_0x472892[_0x263f('0x43')][0x0][_0x263f('0x44')]:undefined)||_0x263f('0x45')}];case _0x263f('0x46'):return[{'name':_0x263f('0x47'),'value':_0x472892[_0x263f('0x47')]||(_0x472892[_0x263f('0x43')]&&_0x472892[_0x263f('0x43')][0x0]?_0x472892[_0x263f('0x43')][0x0]['value']:undefined)||''}];case _0x263f('0x48'):return[{'name':'attrHourFormat','value':_0x472892[_0x263f('0x49')]||(_0x472892[_0x263f('0x43')]&&_0x472892[_0x263f('0x43')][0x0]?_0x472892[_0x263f('0x43')][0x0][_0x263f('0x44')]:undefined)||'HH:mm:ss'},{'name':_0x263f('0x4a'),'value':_0x472892['attrTimezone']||(_0x472892['attrs']&&_0x472892[_0x263f('0x43')][0x1]?_0x472892[_0x263f('0x43')][0x1][_0x263f('0x44')]:undefined)||'0.00'},{'name':_0x263f('0x4b'),'value':_0x472892[_0x263f('0x4b')]||(_0x472892[_0x263f('0x43')]&&_0x472892[_0x263f('0x43')][0x2]?_0x472892[_0x263f('0x43')][0x2][_0x263f('0x44')]:undefined)||0xc}];case _0x263f('0x4c'):return[{'name':_0x263f('0x4d'),'value':_0x472892[_0x263f('0x4d')]||(_0x472892[_0x263f('0x43')]&&_0x472892[_0x263f('0x43')][0x0]?_0x472892[_0x263f('0x43')][0x0][_0x263f('0x44')]:undefined)||'total'},{'name':_0x263f('0x4e'),'value':_0x472892['attrVoiceQueues']||(_0x472892['attrs']&&_0x472892[_0x263f('0x43')][0x1]?_0x472892[_0x263f('0x43')][0x1]['value']:undefined)||[]},{'name':'attrFontSize','value':_0x472892['attrFontSize']||(_0x472892[_0x263f('0x43')]&&_0x472892['attrs'][0x2]?_0x472892['attrs'][0x2][_0x263f('0x44')]:undefined)||0x14},{'name':_0x263f('0x4f'),'value':_0x472892['attrChannel']||(_0x472892[_0x263f('0x43')]&&_0x472892['attrs'][0x3]?_0x472892[_0x263f('0x43')][0x3][_0x263f('0x44')]:undefined)||_0x263f('0x50')},{'name':_0x263f('0x51'),'value':_0x472892[_0x263f('0x51')]||(_0x472892[_0x263f('0x43')]&&_0x472892[_0x263f('0x43')][0x4]?_0x472892[_0x263f('0x43')][0x4][_0x263f('0x44')]:undefined)||''},{'name':_0x263f('0x52'),'value':_0x472892[_0x263f('0x52')]||(_0x472892[_0x263f('0x43')]&&_0x472892[_0x263f('0x43')][0x5]?_0x472892['attrs'][0x5][_0x263f('0x44')]:undefined)||''},{'name':_0x263f('0x53'),'value':_0x472892[_0x263f('0x53')]||(_0x472892[_0x263f('0x43')]&&_0x472892['attrs'][0x6]?_0x472892[_0x263f('0x43')][0x6][_0x263f('0x44')]:undefined)||''},{'name':_0x263f('0x54'),'value':_0x472892[_0x263f('0x54')]||(_0x472892[_0x263f('0x43')]&&_0x472892[_0x263f('0x43')][0x7]?_0x472892['attrs'][0x7]['value']:undefined)||''},{'name':_0x263f('0x55'),'value':_0x472892[_0x263f('0x55')]||(_0x472892[_0x263f('0x43')]&&_0x472892['attrs'][0x8]?_0x472892[_0x263f('0x43')][0x8]['value']:undefined)||''},{'name':_0x263f('0x56'),'value':_0x472892[_0x263f('0x56')]||(_0x472892[_0x263f('0x43')]&&_0x472892[_0x263f('0x43')][0x9]?_0x472892['attrs'][0x9][_0x263f('0x44')]:undefined)||''}];case _0x263f('0x57'):case _0x263f('0x58'):return[{'name':_0x263f('0x59'),'value':_0x472892[_0x263f('0x59')]||(_0x472892[_0x263f('0x43')]&&_0x472892['attrs'][0x0]?_0x472892['attrs'][0x0][_0x263f('0x44')]:undefined)||_0x263f('0x5a')},{'name':_0x263f('0x5b'),'value':_0x472892[_0x263f('0x5b')]||(_0x472892[_0x263f('0x43')]&&_0x472892[_0x263f('0x43')][0x1]?_0x472892[_0x263f('0x43')][0x1][_0x263f('0x44')]:undefined)||null},{'name':_0x263f('0x5c'),'value':_0x472892[_0x263f('0x5c')]||(_0x472892[_0x263f('0x43')]&&_0x472892[_0x263f('0x43')][0x2]?_0x472892[_0x263f('0x43')][0x2][_0x263f('0x44')]:undefined)||null},{'name':_0x263f('0x4e'),'value':_0x472892[_0x263f('0x4e')]||(_0x472892[_0x263f('0x43')]&&_0x472892['attrs'][0x3]?_0x472892[_0x263f('0x43')][0x3][_0x263f('0x44')]:undefined)||[]},{'name':_0x263f('0x4f'),'value':_0x472892['attrChannel']||(_0x472892['attrs']&&_0x472892[_0x263f('0x43')][0x4]?_0x472892[_0x263f('0x43')][0x4]['value']:undefined)||_0x263f('0x50')},{'name':_0x263f('0x51'),'value':_0x472892['attrEmailAccounts']||(_0x472892[_0x263f('0x43')]&&_0x472892[_0x263f('0x43')][0x5]?_0x472892['attrs'][0x5][_0x263f('0x44')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x472892[_0x263f('0x52')]||(_0x472892['attrs']&&_0x472892[_0x263f('0x43')][0x6]?_0x472892['attrs'][0x6][_0x263f('0x44')]:undefined)||''},{'name':_0x263f('0x53'),'value':_0x472892[_0x263f('0x53')]||(_0x472892[_0x263f('0x43')]&&_0x472892[_0x263f('0x43')][0x7]?_0x472892['attrs'][0x7][_0x263f('0x44')]:undefined)||''},{'name':_0x263f('0x54'),'value':_0x472892[_0x263f('0x54')]||(_0x472892[_0x263f('0x43')]&&_0x472892[_0x263f('0x43')][0x8]?_0x472892['attrs'][0x8]['value']:undefined)||''},{'name':_0x263f('0x55'),'value':_0x472892[_0x263f('0x55')]||(_0x472892[_0x263f('0x43')]&&_0x472892[_0x263f('0x43')][0x9]?_0x472892[_0x263f('0x43')][0x9][_0x263f('0x44')]:undefined)||''},{'name':_0x263f('0x56'),'value':_0x472892[_0x263f('0x56')]||(_0x472892[_0x263f('0x43')]&&_0x472892['attrs'][0xa]?_0x472892[_0x263f('0x43')][0xa][_0x263f('0x44')]:undefined)||''}];case _0x263f('0x5d'):return[{'name':_0x263f('0x5e'),'type':_0x472892[_0x263f('0x5f')]||(_0x472892[_0x263f('0x43')]&&_0x472892[_0x263f('0x43')][0x0]?_0x472892['attrs'][0x0][_0x263f('0x40')]:undefined)||null,'value':_0x472892[_0x263f('0x5e')]||(_0x472892[_0x263f('0x43')]&&_0x472892[_0x263f('0x43')][0x0]?_0x472892['attrs'][0x0][_0x263f('0x44')]:undefined)||null},{'name':_0x263f('0x60'),'value':_0x472892[_0x263f('0x60')]||(_0x472892['attrs']&&_0x472892[_0x263f('0x43')][0x1]?_0x472892[_0x263f('0x43')][0x1][_0x263f('0x44')]:undefined)||0x0}];default:return[];}}catch(_0x2f5af6){logger[_0x263f('0x61')](_0x263f('0x62'),JSON[_0x263f('0x63')](_0x2f5af6));return[];}}exports['create']=function(_0x357786,_0x395784){if(_0x357786[_0x263f('0x64')]){_0x357786[_0x263f('0x64')][_0x263f('0x43')]=widgetAttributes(_0x357786['body']);}return db['DashboardItem'][_0x263f('0x65')](_0x357786[_0x263f('0x64')],{})[_0x263f('0x2c')](respondWithResult(_0x395784,0xc9))['catch'](handleError(_0x395784,null));};exports[_0x263f('0x66')]=function(_0x2a7e3b,_0x13ac40){if(_0x2a7e3b[_0x263f('0x64')]['id']){delete _0x2a7e3b['body']['id'];}_0x2a7e3b[_0x263f('0x64')]['attrs']=widgetAttributes(_0x2a7e3b['body']);return db[_0x263f('0x35')][_0x263f('0x67')]({'where':{'id':_0x2a7e3b[_0x263f('0x32')]['id']}})[_0x263f('0x2c')](handleEntityNotFound(_0x13ac40,null))[_0x263f('0x2c')](saveUpdates(_0x2a7e3b[_0x263f('0x64')],null))['then'](respondWithResult(_0x13ac40,null))['catch'](handleError(_0x13ac40,null));};
\ No newline at end of file
+var _0xa5aa=['attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','voice','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','show','params','keys','DashboardItem','rawAttributes','query','filters','intersection','model','fields','attributes','length','includeAll','merge','catch','find','type','iframe','attrUrl','attrs','https://','clock','attrHourFormat','value','HH:mm:ss','attrTimezone','0.00','counter','attrMetric','total','attrVoiceQueues','attrFontSize','attrChannel'];(function(_0x5e6506,_0x1ab5bb){var _0x43e803=function(_0x3471e3){while(--_0x3471e3){_0x5e6506['push'](_0x5e6506['shift']());}};_0x43e803(++_0x1ab5bb);}(_0xa5aa,0x1ac));var _0xaa5a=function(_0x535980,_0x138a0a){_0x535980=_0x535980-0x0;var _0x49349d=_0xa5aa[_0x535980];return _0x49349d;};'use strict';var emlformat=require(_0xaa5a('0x0'));var rimraf=require(_0xaa5a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xaa5a('0x2'));var rp=require(_0xaa5a('0x3'));var moment=require(_0xaa5a('0x4'));var BPromise=require(_0xaa5a('0x5'));var Mustache=require(_0xaa5a('0x6'));var util=require(_0xaa5a('0x7'));var path=require('path');var sox=require(_0xaa5a('0x8'));var csv=require(_0xaa5a('0x9'));var ejs=require(_0xaa5a('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xaa5a('0xb'));var crypto=require(_0xaa5a('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xaa5a('0xd'));var toCsv=require(_0xaa5a('0x9'));var querystring=require(_0xaa5a('0xe'));var Papa=require('papaparse');var Redis=require(_0xaa5a('0xf'));var authService=require(_0xaa5a('0x10'));var qs=require(_0xaa5a('0x11'));var as=require(_0xaa5a('0x12'));var hardwareService=require(_0xaa5a('0x13'));var logger=require(_0xaa5a('0x14'))('api');var utils=require(_0xaa5a('0x15'));var config=require(_0xaa5a('0x16'));var licenseUtil=require(_0xaa5a('0x17'));var db=require(_0xaa5a('0x18'))['db'];config[_0xaa5a('0x19')]=_[_0xaa5a('0x1a')](config[_0xaa5a('0x19')],{'host':_0xaa5a('0x1b'),'port':0x18eb});var socket=require(_0xaa5a('0x1c'))(new Redis(config[_0xaa5a('0x19')]));require(_0xaa5a('0x1d'))[_0xaa5a('0x1e')](socket);function respondWithStatusCode(_0x5eaa9c,_0x2d931c){_0x2d931c=_0x2d931c||0xcc;return function(_0x40b34f){if(_0x40b34f){return _0x5eaa9c[_0xaa5a('0x1f')](_0x2d931c);}return _0x5eaa9c['status'](_0x2d931c)[_0xaa5a('0x20')]();};}function respondWithResult(_0x10ba31,_0x286f17){_0x286f17=_0x286f17||0xc8;return function(_0x2b6fd0){if(_0x2b6fd0){return _0x10ba31[_0xaa5a('0x21')](_0x286f17)[_0xaa5a('0x22')](_0x2b6fd0);}};}function respondWithFilteredResult(_0x1b3eba,_0x1c7320){return function(_0xef5dd3){if(_0xef5dd3){var _0x3a8ccf=typeof _0x1c7320[_0xaa5a('0x23')]===_0xaa5a('0x24')&&typeof _0x1c7320[_0xaa5a('0x25')]===_0xaa5a('0x24');var _0x44279b=_0xef5dd3[_0xaa5a('0x26')];var _0x222e5e=_0x3a8ccf?0x0:_0x1c7320['offset'];var _0x20ec46=_0x3a8ccf?_0xef5dd3[_0xaa5a('0x26')]:_0x1c7320[_0xaa5a('0x23')]+_0x1c7320[_0xaa5a('0x25')];var _0x5af50f;if(_0x20ec46>=_0x44279b){_0x20ec46=_0x44279b;_0x5af50f=0xc8;}else{_0x5af50f=0xce;}_0x1b3eba[_0xaa5a('0x21')](_0x5af50f);return _0x1b3eba[_0xaa5a('0x27')](_0xaa5a('0x28'),_0x222e5e+'-'+_0x20ec46+'/'+_0x44279b)[_0xaa5a('0x22')](_0xef5dd3);}return null;};}function patchUpdates(_0xf50dd0){return function(_0x3b6083){try{jsonpatch[_0xaa5a('0x29')](_0x3b6083,_0xf50dd0,!![]);}catch(_0x1d3fbc){return BPromise[_0xaa5a('0x2a')](_0x1d3fbc);}return _0x3b6083['save']();};}function saveUpdates(_0x1e4e12,_0x4c9035){return function(_0x416351){if(_0x416351){return _0x416351[_0xaa5a('0x2b')](_0x1e4e12)[_0xaa5a('0x2c')](function(_0x3e6ac1){return _0x3e6ac1;});}return null;};}function removeEntity(_0x1d0c9b,_0x47cdcf){return function(_0x36a491){if(_0x36a491){return _0x36a491[_0xaa5a('0x2d')]()['then'](function(){_0x1d0c9b[_0xaa5a('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x36582e,_0xc915c1){return function(_0x24c8e5){if(!_0x24c8e5){_0x36582e[_0xaa5a('0x1f')](0x194);}return _0x24c8e5;};}function handleError(_0x4117a6,_0x10208d){_0x10208d=_0x10208d||0x1f4;return function(_0x57cd56){logger[_0xaa5a('0x2e')](_0x57cd56[_0xaa5a('0x2f')]);if(_0x57cd56['name']){delete _0x57cd56[_0xaa5a('0x30')];}_0x4117a6[_0xaa5a('0x21')](_0x10208d)['send'](_0x57cd56);};}exports[_0xaa5a('0x31')]=function(_0x453a46,_0x186413){var _0x115f03={'raw':![],'where':{'id':_0x453a46[_0xaa5a('0x32')]['id']}},_0x24ff37={};_0x24ff37['model']=_[_0xaa5a('0x33')](db[_0xaa5a('0x34')][_0xaa5a('0x35')]);_0x24ff37[_0xaa5a('0x36')]=_['keys'](_0x453a46['query']);_0x24ff37[_0xaa5a('0x37')]=_[_0xaa5a('0x38')](_0x24ff37['model'],_0x24ff37[_0xaa5a('0x36')]);_0x115f03['attributes']=_['intersection'](_0x24ff37[_0xaa5a('0x39')],qs[_0xaa5a('0x3a')](_0x453a46[_0xaa5a('0x36')][_0xaa5a('0x3a')]));_0x115f03[_0xaa5a('0x3b')]=_0x115f03[_0xaa5a('0x3b')][_0xaa5a('0x3c')]?_0x115f03['attributes']:_0x24ff37[_0xaa5a('0x39')];if(_0x453a46[_0xaa5a('0x36')][_0xaa5a('0x3d')]){_0x115f03['include']=[{'all':!![]}];}_0x115f03=_[_0xaa5a('0x3e')]({},_0x115f03,_0x453a46['options']);return db[_0xaa5a('0x34')]['find'](_0x115f03)['then'](handleEntityNotFound(_0x186413,null))[_0xaa5a('0x2c')](respondWithResult(_0x186413,null))[_0xaa5a('0x3f')](handleError(_0x186413,null));};exports[_0xaa5a('0x2d')]=function(_0x21e0b1,_0x401fb8){return db[_0xaa5a('0x34')][_0xaa5a('0x40')]({'where':{'id':_0x21e0b1[_0xaa5a('0x32')]['id']}})['then'](handleEntityNotFound(_0x401fb8,null))['then'](removeEntity(_0x401fb8,null))['catch'](handleError(_0x401fb8,null));};function widgetAttributes(_0xbb00cc){try{switch(_0xbb00cc[_0xaa5a('0x41')]){case _0xaa5a('0x42'):return[{'name':_0xaa5a('0x43'),'value':_0xbb00cc[_0xaa5a('0x43')]||(_0xbb00cc[_0xaa5a('0x44')]&&_0xbb00cc['attrs'][0x0]?_0xbb00cc['attrs'][0x0]['value']:undefined)||_0xaa5a('0x45')}];case'custom':return[{'name':'attrPath','value':_0xbb00cc['attrPath']||(_0xbb00cc[_0xaa5a('0x44')]&&_0xbb00cc[_0xaa5a('0x44')][0x0]?_0xbb00cc[_0xaa5a('0x44')][0x0]['value']:undefined)||''}];case _0xaa5a('0x46'):return[{'name':_0xaa5a('0x47'),'value':_0xbb00cc[_0xaa5a('0x47')]||(_0xbb00cc[_0xaa5a('0x44')]&&_0xbb00cc[_0xaa5a('0x44')][0x0]?_0xbb00cc['attrs'][0x0][_0xaa5a('0x48')]:undefined)||_0xaa5a('0x49')},{'name':_0xaa5a('0x4a'),'value':_0xbb00cc[_0xaa5a('0x4a')]||(_0xbb00cc[_0xaa5a('0x44')]&&_0xbb00cc[_0xaa5a('0x44')][0x1]?_0xbb00cc[_0xaa5a('0x44')][0x1][_0xaa5a('0x48')]:undefined)||_0xaa5a('0x4b')},{'name':'attrFontSize','value':_0xbb00cc['attrFontSize']||(_0xbb00cc['attrs']&&_0xbb00cc['attrs'][0x2]?_0xbb00cc[_0xaa5a('0x44')][0x2][_0xaa5a('0x48')]:undefined)||0xc}];case _0xaa5a('0x4c'):return[{'name':_0xaa5a('0x4d'),'value':_0xbb00cc[_0xaa5a('0x4d')]||(_0xbb00cc[_0xaa5a('0x44')]&&_0xbb00cc[_0xaa5a('0x44')][0x0]?_0xbb00cc[_0xaa5a('0x44')][0x0][_0xaa5a('0x48')]:undefined)||_0xaa5a('0x4e')},{'name':'attrVoiceQueues','value':_0xbb00cc[_0xaa5a('0x4f')]||(_0xbb00cc[_0xaa5a('0x44')]&&_0xbb00cc[_0xaa5a('0x44')][0x1]?_0xbb00cc[_0xaa5a('0x44')][0x1][_0xaa5a('0x48')]:undefined)||[]},{'name':_0xaa5a('0x50'),'value':_0xbb00cc[_0xaa5a('0x50')]||(_0xbb00cc['attrs']&&_0xbb00cc[_0xaa5a('0x44')][0x2]?_0xbb00cc[_0xaa5a('0x44')][0x2][_0xaa5a('0x48')]:undefined)||0x14},{'name':_0xaa5a('0x51'),'value':_0xbb00cc[_0xaa5a('0x51')]||(_0xbb00cc[_0xaa5a('0x44')]&&_0xbb00cc[_0xaa5a('0x44')][0x3]?_0xbb00cc[_0xaa5a('0x44')][0x3][_0xaa5a('0x48')]:undefined)||'voice'},{'name':'attrEmailAccounts','value':_0xbb00cc[_0xaa5a('0x52')]||(_0xbb00cc[_0xaa5a('0x44')]&&_0xbb00cc[_0xaa5a('0x44')][0x4]?_0xbb00cc[_0xaa5a('0x44')][0x4][_0xaa5a('0x48')]:undefined)||''},{'name':_0xaa5a('0x53'),'value':_0xbb00cc[_0xaa5a('0x53')]||(_0xbb00cc['attrs']&&_0xbb00cc[_0xaa5a('0x44')][0x5]?_0xbb00cc[_0xaa5a('0x44')][0x5][_0xaa5a('0x48')]:undefined)||''},{'name':_0xaa5a('0x54'),'value':_0xbb00cc[_0xaa5a('0x54')]||(_0xbb00cc['attrs']&&_0xbb00cc['attrs'][0x6]?_0xbb00cc['attrs'][0x6]['value']:undefined)||''},{'name':_0xaa5a('0x55'),'value':_0xbb00cc[_0xaa5a('0x55')]||(_0xbb00cc[_0xaa5a('0x44')]&&_0xbb00cc[_0xaa5a('0x44')][0x7]?_0xbb00cc[_0xaa5a('0x44')][0x7][_0xaa5a('0x48')]:undefined)||''},{'name':_0xaa5a('0x56'),'value':_0xbb00cc[_0xaa5a('0x56')]||(_0xbb00cc[_0xaa5a('0x44')]&&_0xbb00cc[_0xaa5a('0x44')][0x8]?_0xbb00cc[_0xaa5a('0x44')][0x8][_0xaa5a('0x48')]:undefined)||''},{'name':_0xaa5a('0x57'),'value':_0xbb00cc[_0xaa5a('0x57')]||(_0xbb00cc[_0xaa5a('0x44')]&&_0xbb00cc['attrs'][0x9]?_0xbb00cc['attrs'][0x9]['value']:undefined)||''}];case _0xaa5a('0x58'):case _0xaa5a('0x59'):return[{'name':_0xaa5a('0x5a'),'value':_0xbb00cc[_0xaa5a('0x5a')]||(_0xbb00cc[_0xaa5a('0x44')]&&_0xbb00cc[_0xaa5a('0x44')][0x0]?_0xbb00cc[_0xaa5a('0x44')][0x0][_0xaa5a('0x48')]:undefined)||_0xaa5a('0x4e')},{'name':_0xaa5a('0x5b'),'value':_0xbb00cc[_0xaa5a('0x5b')]||(_0xbb00cc[_0xaa5a('0x44')]&&_0xbb00cc[_0xaa5a('0x44')][0x1]?_0xbb00cc[_0xaa5a('0x44')][0x1][_0xaa5a('0x48')]:undefined)||null},{'name':'attrSerie3','value':_0xbb00cc[_0xaa5a('0x5c')]||(_0xbb00cc[_0xaa5a('0x44')]&&_0xbb00cc[_0xaa5a('0x44')][0x2]?_0xbb00cc[_0xaa5a('0x44')][0x2][_0xaa5a('0x48')]:undefined)||null},{'name':_0xaa5a('0x4f'),'value':_0xbb00cc[_0xaa5a('0x4f')]||(_0xbb00cc[_0xaa5a('0x44')]&&_0xbb00cc[_0xaa5a('0x44')][0x3]?_0xbb00cc[_0xaa5a('0x44')][0x3][_0xaa5a('0x48')]:undefined)||[]},{'name':_0xaa5a('0x51'),'value':_0xbb00cc[_0xaa5a('0x51')]||(_0xbb00cc[_0xaa5a('0x44')]&&_0xbb00cc[_0xaa5a('0x44')][0x4]?_0xbb00cc[_0xaa5a('0x44')][0x4][_0xaa5a('0x48')]:undefined)||_0xaa5a('0x5d')},{'name':'attrEmailAccounts','value':_0xbb00cc[_0xaa5a('0x52')]||(_0xbb00cc[_0xaa5a('0x44')]&&_0xbb00cc[_0xaa5a('0x44')][0x5]?_0xbb00cc['attrs'][0x5][_0xaa5a('0x48')]:undefined)||''},{'name':_0xaa5a('0x53'),'value':_0xbb00cc[_0xaa5a('0x53')]||(_0xbb00cc[_0xaa5a('0x44')]&&_0xbb00cc[_0xaa5a('0x44')][0x6]?_0xbb00cc[_0xaa5a('0x44')][0x6][_0xaa5a('0x48')]:undefined)||''},{'name':'attrSmsAccounts','value':_0xbb00cc[_0xaa5a('0x54')]||(_0xbb00cc[_0xaa5a('0x44')]&&_0xbb00cc[_0xaa5a('0x44')][0x7]?_0xbb00cc[_0xaa5a('0x44')][0x7][_0xaa5a('0x48')]:undefined)||''},{'name':_0xaa5a('0x55'),'value':_0xbb00cc['attrOpenchannelAccounts']||(_0xbb00cc[_0xaa5a('0x44')]&&_0xbb00cc['attrs'][0x8]?_0xbb00cc[_0xaa5a('0x44')][0x8]['value']:undefined)||''},{'name':'attrWhatsappAccounts','value':_0xbb00cc[_0xaa5a('0x56')]||(_0xbb00cc[_0xaa5a('0x44')]&&_0xbb00cc[_0xaa5a('0x44')][0x9]?_0xbb00cc[_0xaa5a('0x44')][0x9][_0xaa5a('0x48')]:undefined)||''},{'name':_0xaa5a('0x57'),'value':_0xbb00cc[_0xaa5a('0x57')]||(_0xbb00cc[_0xaa5a('0x44')]&&_0xbb00cc[_0xaa5a('0x44')][0xa]?_0xbb00cc[_0xaa5a('0x44')][0xa]['value']:undefined)||''}];case _0xaa5a('0x5e'):return[{'name':_0xaa5a('0x5f'),'type':_0xbb00cc[_0xaa5a('0x60')]||(_0xbb00cc[_0xaa5a('0x44')]&&_0xbb00cc[_0xaa5a('0x44')][0x0]?_0xbb00cc[_0xaa5a('0x44')][0x0]['type']:undefined)||null,'value':_0xbb00cc[_0xaa5a('0x5f')]||(_0xbb00cc[_0xaa5a('0x44')]&&_0xbb00cc[_0xaa5a('0x44')][0x0]?_0xbb00cc[_0xaa5a('0x44')][0x0]['value']:undefined)||null},{'name':_0xaa5a('0x61'),'value':_0xbb00cc[_0xaa5a('0x61')]||(_0xbb00cc['attrs']&&_0xbb00cc[_0xaa5a('0x44')][0x1]?_0xbb00cc['attrs'][0x1][_0xaa5a('0x48')]:undefined)||0x0}];default:return[];}}catch(_0x2fac84){logger[_0xaa5a('0x2e')](_0xaa5a('0x62'),JSON[_0xaa5a('0x63')](_0x2fac84));return[];}}exports[_0xaa5a('0x64')]=function(_0x2a2924,_0x4a001e){if(_0x2a2924[_0xaa5a('0x65')]){_0x2a2924[_0xaa5a('0x65')][_0xaa5a('0x44')]=widgetAttributes(_0x2a2924['body']);}return db[_0xaa5a('0x34')][_0xaa5a('0x64')](_0x2a2924[_0xaa5a('0x65')],{})[_0xaa5a('0x2c')](respondWithResult(_0x4a001e,0xc9))[_0xaa5a('0x3f')](handleError(_0x4a001e,null));};exports[_0xaa5a('0x2b')]=function(_0x73c40a,_0x2f5e1e){if(_0x73c40a['body']['id']){delete _0x73c40a['body']['id'];}_0x73c40a[_0xaa5a('0x65')]['attrs']=widgetAttributes(_0x73c40a['body']);return db[_0xaa5a('0x34')][_0xaa5a('0x40')]({'where':{'id':_0x73c40a[_0xaa5a('0x32')]['id']}})[_0xaa5a('0x2c')](handleEntityNotFound(_0x2f5e1e,null))[_0xaa5a('0x2c')](saveUpdates(_0x73c40a[_0xaa5a('0x65')],null))[_0xaa5a('0x2c')](respondWithResult(_0x2f5e1e,null))[_0xaa5a('0x3f')](handleError(_0x2f5e1e,null));};
\ No newline at end of file
index d64b58f..a34c57e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xea1d=['update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','DashboardItem','setMaxListeners','save'];(function(_0x3ce284,_0x4cdb02){var _0x49e58a=function(_0x38b7a6){while(--_0x38b7a6){_0x3ce284['push'](_0x3ce284['shift']());}};_0x49e58a(++_0x4cdb02);}(_0xea1d,0x1d1));var _0xdea1=function(_0x4d054a,_0x105b44){_0x4d054a=_0x4d054a-0x0;var _0x12e766=_0xea1d[_0x4d054a];return _0x12e766;};'use strict';var EventEmitter=require(_0xdea1('0x0'));var DashboardItem=require(_0xdea1('0x1'))['db'][_0xdea1('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0xdea1('0x3')](0x0);var events={'afterCreate':_0xdea1('0x4'),'afterUpdate':_0xdea1('0x5'),'afterDestroy':_0xdea1('0x6')};function emitEvent(_0x1a0083){return function(_0xaf24da,_0x2c226d,_0x80cfc8){DashboardItemEvents[_0xdea1('0x7')](_0x1a0083+':'+_0xaf24da['id'],_0xaf24da);DashboardItemEvents[_0xdea1('0x7')](_0x1a0083,_0xaf24da);_0x80cfc8(null);};}for(var e in events){if(events[_0xdea1('0x8')](e)){var event=events[e];DashboardItem[_0xdea1('0x9')](e,emitEvent(event));}}module['exports']=DashboardItemEvents;
\ No newline at end of file
+var _0x3762=['emit','hook','exports','events','../../mysqldb','save','update'];(function(_0x4aa4e6,_0x278c45){var _0x322588=function(_0x19279d){while(--_0x19279d){_0x4aa4e6['push'](_0x4aa4e6['shift']());}};_0x322588(++_0x278c45);}(_0x3762,0x7a));var _0x2376=function(_0x524caa,_0x579544){_0x524caa=_0x524caa-0x0;var _0x1c91df=_0x3762[_0x524caa];return _0x1c91df;};'use strict';var EventEmitter=require(_0x2376('0x0'));var DashboardItem=require(_0x2376('0x1'))['db']['DashboardItem'];var DashboardItemEvents=new EventEmitter();DashboardItemEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x2376('0x2'),'afterUpdate':_0x2376('0x3'),'afterDestroy':'remove'};function emitEvent(_0x35e672){return function(_0x35358b,_0xa2f7c,_0x4ed940){DashboardItemEvents[_0x2376('0x4')](_0x35e672+':'+_0x35358b['id'],_0x35358b);DashboardItemEvents[_0x2376('0x4')](_0x35e672,_0x35358b);_0x4ed940(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];DashboardItem[_0x2376('0x5')](e,emitEvent(event));}}module[_0x2376('0x6')]=DashboardItemEvents;
\ No newline at end of file
index fcd063d..376ddb6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9abc=['path','rimraf','../../config/environment','exports','define','DashboardItem','dashboard_items','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9abc,0x1e3));var _0xc9ab=function(_0x38aed2,_0x1513b9){_0x38aed2=_0x38aed2-0x0;var _0x1264c7=_0x9abc[_0x38aed2];return _0x1264c7;};'use strict';var _=require(_0xc9ab('0x0'));var util=require(_0xc9ab('0x1'));var logger=require(_0xc9ab('0x2'))(_0xc9ab('0x3'));var moment=require(_0xc9ab('0x4'));var BPromise=require(_0xc9ab('0x5'));var rp=require(_0xc9ab('0x6'));var fs=require('fs');var path=require(_0xc9ab('0x7'));var rimraf=require(_0xc9ab('0x8'));var config=require(_0xc9ab('0x9'));var attributes=require('./dashboardItem.attributes');module[_0xc9ab('0xa')]=function(_0xb06d88,_0x3ff086){return _0xb06d88[_0xc9ab('0xb')](_0xc9ab('0xc'),attributes,{'tableName':_0xc9ab('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3fc6=['rimraf','../../config/environment','define','dashboard_items','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x23c791,_0xa8bee3){var _0x57b777=function(_0x25f8c4){while(--_0x25f8c4){_0x23c791['push'](_0x23c791['shift']());}};_0x57b777(++_0xa8bee3);}(_0x3fc6,0x159));var _0x63fc=function(_0x3b4056,_0x522895){_0x3b4056=_0x3b4056-0x0;var _0x456850=_0x3fc6[_0x3b4056];return _0x456850;};'use strict';var _=require(_0x63fc('0x0'));var util=require(_0x63fc('0x1'));var logger=require(_0x63fc('0x2'))('api');var moment=require(_0x63fc('0x3'));var BPromise=require(_0x63fc('0x4'));var rp=require(_0x63fc('0x5'));var fs=require('fs');var path=require(_0x63fc('0x6'));var rimraf=require(_0x63fc('0x7'));var config=require(_0x63fc('0x8'));var attributes=require('./dashboardItem.attributes');module['exports']=function(_0xdb65b8,_0x7d24f){return _0xdb65b8[_0x63fc('0x9')]('DashboardItem',attributes,{'tableName':_0x63fc('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index ee4e105..2efb6aa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x530f=['info','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','code','message','DashboardItem,\x20%s,\x20%s','request\x20sent','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./dashboardItem.socket','register','request','then'];(function(_0x5bb912,_0x1d3690){var _0x21fb43=function(_0x221738){while(--_0x221738){_0x5bb912['push'](_0x5bb912['shift']());}};_0x21fb43(++_0x1d3690);}(_0x530f,0x166));var _0xf530=function(_0x3e6729,_0x16d4af){_0x3e6729=_0x3e6729-0x0;var _0x535bcd=_0x530f[_0x3e6729];return _0x535bcd;};'use strict';var _=require(_0xf530('0x0'));var util=require(_0xf530('0x1'));var moment=require(_0xf530('0x2'));var BPromise=require(_0xf530('0x3'));var rs=require(_0xf530('0x4'));var fs=require('fs');var Redis=require(_0xf530('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xf530('0x6'));var logger=require(_0xf530('0x7'))(_0xf530('0x8'));var config=require(_0xf530('0x9'));var jayson=require(_0xf530('0xa'));var client=jayson['client'][_0xf530('0xb')]({'port':0x232a});config[_0xf530('0xc')]=_['defaults'](config[_0xf530('0xc')],{'host':_0xf530('0xd'),'port':0x18eb});var socket=require(_0xf530('0xe'))(new Redis(config[_0xf530('0xc')]));require(_0xf530('0xf'))[_0xf530('0x10')](socket);function respondWithRpcPromise(_0x2d2836,_0x12775d,_0x4ea246){return new BPromise(function(_0x2ae7e9,_0x1cd967){return client[_0xf530('0x11')](_0x2d2836,_0x4ea246)[_0xf530('0x12')](function(_0x10acf9){logger[_0xf530('0x13')]('DashboardItem,\x20%s,\x20%s',_0x12775d,'request\x20sent');logger[_0xf530('0x14')](_0xf530('0x15'),_0x12775d,'request\x20sent',JSON[_0xf530('0x16')](_0x10acf9));if(_0x10acf9[_0xf530('0x17')]){if(_0x10acf9[_0xf530('0x17')][_0xf530('0x18')]===0x1f4){logger['error']('DashboardItem,\x20%s,\x20%s',_0x12775d,_0x10acf9[_0xf530('0x17')][_0xf530('0x19')]);return _0x1cd967(_0x10acf9['error']['message']);}logger[_0xf530('0x17')](_0xf530('0x1a'),_0x12775d,_0x10acf9['error']['message']);return _0x2ae7e9(_0x10acf9[_0xf530('0x17')][_0xf530('0x19')]);}else{logger[_0xf530('0x13')](_0xf530('0x1a'),_0x12775d,_0xf530('0x1b'));_0x2ae7e9(_0x10acf9['result'][_0xf530('0x19')]);}})[_0xf530('0x1c')](function(_0x334e13){logger[_0xf530('0x17')](_0xf530('0x1a'),_0x12775d,_0x334e13);_0x1cd967(_0x334e13);});});}
\ No newline at end of file
+var _0x4ef2=['message','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','./dashboardItem.socket','register','request','then','DashboardItem,\x20%s,\x20%s','request\x20sent','error'];(function(_0x4727f1,_0x2ff773){var _0x2977ce=function(_0x29be89){while(--_0x29be89){_0x4727f1['push'](_0x4727f1['shift']());}};_0x2977ce(++_0x2ff773);}(_0x4ef2,0x17b));var _0x24ef=function(_0x320a2b,_0x519e2a){_0x320a2b=_0x320a2b-0x0;var _0x128ae3=_0x4ef2[_0x320a2b];return _0x128ae3;};'use strict';var _=require('lodash');var util=require(_0x24ef('0x0'));var moment=require(_0x24ef('0x1'));var BPromise=require(_0x24ef('0x2'));var rs=require(_0x24ef('0x3'));var fs=require('fs');var Redis=require(_0x24ef('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x24ef('0x5'))(_0x24ef('0x6'));var config=require(_0x24ef('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x24ef('0x8')][_0x24ef('0x9')]({'port':0x232a});config[_0x24ef('0xa')]=_['defaults'](config[_0x24ef('0xa')],{'host':_0x24ef('0xb'),'port':0x18eb});var socket=require(_0x24ef('0xc'))(new Redis(config['redis']));require(_0x24ef('0xd'))[_0x24ef('0xe')](socket);function respondWithRpcPromise(_0x1d517c,_0x36171a,_0x4b685d){return new BPromise(function(_0x3f0b26,_0xcc334c){return client[_0x24ef('0xf')](_0x1d517c,_0x4b685d)[_0x24ef('0x10')](function(_0x402f03){logger['info'](_0x24ef('0x11'),_0x36171a,_0x24ef('0x12'));logger['debug']('DashboardItem,\x20%s,\x20%s,\x20%s',_0x36171a,_0x24ef('0x12'),JSON['stringify'](_0x402f03));if(_0x402f03[_0x24ef('0x13')]){if(_0x402f03[_0x24ef('0x13')]['code']===0x1f4){logger[_0x24ef('0x13')](_0x24ef('0x11'),_0x36171a,_0x402f03[_0x24ef('0x13')]['message']);return _0xcc334c(_0x402f03[_0x24ef('0x13')][_0x24ef('0x14')]);}logger[_0x24ef('0x13')]('DashboardItem,\x20%s,\x20%s',_0x36171a,_0x402f03['error'][_0x24ef('0x14')]);return _0x3f0b26(_0x402f03[_0x24ef('0x13')]['message']);}else{logger['info'](_0x24ef('0x11'),_0x36171a,_0x24ef('0x12'));_0x3f0b26(_0x402f03['result']['message']);}})['catch'](function(_0x1430a2){logger[_0x24ef('0x13')]('DashboardItem,\x20%s,\x20%s',_0x36171a,_0x1430a2);_0xcc334c(_0x1430a2);});});}
\ No newline at end of file
index a3ad258..c1c11e6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb5b4=['register','length','dashboardItem:','./dashboardItem.events','save','remove','update','emit','removeListener'];(function(_0x2dbe1f,_0x58eccd){var _0x4a83be=function(_0x197ae7){while(--_0x197ae7){_0x2dbe1f['push'](_0x2dbe1f['shift']());}};_0x4a83be(++_0x58eccd);}(_0xb5b4,0xc0));var _0x4b5b=function(_0x511bd1,_0x223e5b){_0x511bd1=_0x511bd1-0x0;var _0x4c48ec=_0xb5b4[_0x511bd1];return _0x4c48ec;};'use strict';var DashboardItemEvents=require(_0x4b5b('0x0'));var events=[_0x4b5b('0x1'),_0x4b5b('0x2'),_0x4b5b('0x3')];function createListener(_0xc963fd,_0x2f7dfa){return function(_0x468d09){_0x2f7dfa[_0x4b5b('0x4')](_0xc963fd,_0x468d09);};}function removeListener(_0xd2efad,_0x36d261){return function(){DashboardItemEvents[_0x4b5b('0x5')](_0xd2efad,_0x36d261);};}exports[_0x4b5b('0x6')]=function(_0x1afd40){for(var _0x2129c6=0x0,_0x56f3ba=events[_0x4b5b('0x7')];_0x2129c6<_0x56f3ba;_0x2129c6++){var _0x5bcc3c=events[_0x2129c6];var _0x481eee=createListener(_0x4b5b('0x8')+_0x5bcc3c,_0x1afd40);DashboardItemEvents['on'](_0x5bcc3c,_0x481eee);}};
\ No newline at end of file
+var _0x36f0=['save','remove','update','removeListener','register','length','./dashboardItem.events'];(function(_0x1680d6,_0x2b495f){var _0x183572=function(_0xea8a0f){while(--_0xea8a0f){_0x1680d6['push'](_0x1680d6['shift']());}};_0x183572(++_0x2b495f);}(_0x36f0,0x195));var _0x036f=function(_0x22ee1e,_0x3eff80){_0x22ee1e=_0x22ee1e-0x0;var _0x49a5c9=_0x36f0[_0x22ee1e];return _0x49a5c9;};'use strict';var DashboardItemEvents=require(_0x036f('0x0'));var events=[_0x036f('0x1'),_0x036f('0x2'),_0x036f('0x3')];function createListener(_0x2c1afd,_0x50d586){return function(_0x4371af){_0x50d586['emit'](_0x2c1afd,_0x4371af);};}function removeListener(_0x49e9b0,_0x44baed){return function(){DashboardItemEvents[_0x036f('0x4')](_0x49e9b0,_0x44baed);};}exports[_0x036f('0x5')]=function(_0x1e4cb3){for(var _0x112817=0x0,_0xa05ffc=events[_0x036f('0x6')];_0x112817<_0xa05ffc;_0x112817++){var _0x2358ea=events[_0x112817];var _0x52215f=createListener('dashboardItem:'+_0x2358ea,_0x1e4cb3);DashboardItemEvents['on'](_0x2358ea,_0x52215f);}};
\ No newline at end of file
index 9c208fb..eae8556 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2a6b=['../../components/interaction/service','../../config/environment','./dashboardItem.controller','get','/:id','isAuthenticated','show','post','create','put','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x425036,_0x39bebc){var _0x7fc880=function(_0x54493c){while(--_0x54493c){_0x425036['push'](_0x425036['shift']());}};_0x7fc880(++_0x39bebc);}(_0x2a6b,0xac));var _0xb2a6=function(_0x5ca0a6,_0x50efe1){_0x5ca0a6=_0x5ca0a6-0x0;var _0x22b8ef=_0x2a6b[_0x5ca0a6];return _0x22b8ef;};'use strict';var multer=require(_0xb2a6('0x0'));var util=require(_0xb2a6('0x1'));var path=require(_0xb2a6('0x2'));var timeout=require(_0xb2a6('0x3'));var express=require(_0xb2a6('0x4'));var router=express[_0xb2a6('0x5')]();var fs_extra=require(_0xb2a6('0x6'));var auth=require(_0xb2a6('0x7'));var interaction=require(_0xb2a6('0x8'));var config=require(_0xb2a6('0x9'));var controller=require(_0xb2a6('0xa'));router[_0xb2a6('0xb')](_0xb2a6('0xc'),auth[_0xb2a6('0xd')](),controller[_0xb2a6('0xe')]);router[_0xb2a6('0xf')]('/',auth[_0xb2a6('0xd')](),controller[_0xb2a6('0x10')]);router[_0xb2a6('0x11')](_0xb2a6('0xc'),auth[_0xb2a6('0xd')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xb2a6('0x12')]);module[_0xb2a6('0x13')]=router;
\ No newline at end of file
+var _0x1e7e=['path','connect-timeout','express','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','post','create','update','exports','multer'];(function(_0x37c8ef,_0x334449){var _0x5eaee9=function(_0x4b1b98){while(--_0x4b1b98){_0x37c8ef['push'](_0x37c8ef['shift']());}};_0x5eaee9(++_0x334449);}(_0x1e7e,0x8e));var _0xe1e7=function(_0x250453,_0x2a0799){_0x250453=_0x250453-0x0;var _0x471c1a=_0x1e7e[_0x250453];return _0x471c1a;};'use strict';var multer=require(_0xe1e7('0x0'));var util=require('util');var path=require(_0xe1e7('0x1'));var timeout=require(_0xe1e7('0x2'));var express=require(_0xe1e7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xe1e7('0x4'));var config=require(_0xe1e7('0x5'));var controller=require('./dashboardItem.controller');router[_0xe1e7('0x6')](_0xe1e7('0x7'),auth[_0xe1e7('0x8')](),controller['show']);router[_0xe1e7('0x9')]('/',auth[_0xe1e7('0x8')](),controller[_0xe1e7('0xa')]);router['put'](_0xe1e7('0x7'),auth[_0xe1e7('0x8')](),controller[_0xe1e7('0xb')]);router['delete'](_0xe1e7('0x7'),auth[_0xe1e7('0x8')](),controller['destroy']);module[_0xe1e7('0xc')]=router;
\ No newline at end of file
index 4437679..0ac7222 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb81b=['ENUM','first','second','third','STRING','exports'];(function(_0x2a3c4d,_0x9c6b37){var _0x55c390=function(_0x4871cf){while(--_0x4871cf){_0x2a3c4d['push'](_0x2a3c4d['shift']());}};_0x55c390(++_0x9c6b37);}(_0xb81b,0xbf));var _0xbb81=function(_0x122619,_0x4af243){_0x122619=_0x122619-0x0;var _0x5d7cbe=_0xb81b[_0x122619];return _0x5d7cbe;};'use strict';var Sequelize=require('sequelize');module[_0xbb81('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'level':{'type':Sequelize[_0xbb81('0x1')](_0xbb81('0x2'),_0xbb81('0x3'),_0xbb81('0x4')),'allowNull':![],'defaultValue':_0xbb81('0x2')},'description':{'type':Sequelize[_0xbb81('0x5')]}};
\ No newline at end of file
+var _0xcbc9=['ENUM','second','third','first','sequelize','exports'];(function(_0x58aad3,_0x2a1647){var _0x2618d9=function(_0x3b760a){while(--_0x3b760a){_0x58aad3['push'](_0x58aad3['shift']());}};_0x2618d9(++_0x2a1647);}(_0xcbc9,0x196));var _0x9cbc=function(_0x5311e8,_0x57c5bb){_0x5311e8=_0x5311e8-0x0;var _0x582ad8=_0xcbc9[_0x5311e8];return _0x582ad8;};'use strict';var Sequelize=require(_0x9cbc('0x0'));module[_0x9cbc('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'level':{'type':Sequelize[_0x9cbc('0x2')]('first',_0x9cbc('0x3'),_0x9cbc('0x4')),'allowNull':![],'defaultValue':_0x9cbc('0x5')},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 9f61c26..987af95 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1766=['sendStatus','status','end','undefined','offset','limit','Content-Range','json','apply','reject','save','update','then','destroy','get','Dispositions','error','name','send','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','Disposition','count','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x1bcf6b,_0x35b148){var _0x599b65=function(_0x41fa5c){while(--_0x41fa5c){_0x1bcf6b['push'](_0x1bcf6b['shift']());}};_0x599b65(++_0x35b148);}(_0x1766,0x17d));var _0x6176=function(_0x26cb37,_0x110a6e){_0x26cb37=_0x26cb37-0x0;var _0x372c8c=_0x1766[_0x26cb37];return _0x372c8c;};'use strict';var emlformat=require(_0x6176('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x6176('0x1'));var rp=require(_0x6176('0x2'));var moment=require(_0x6176('0x3'));var BPromise=require(_0x6176('0x4'));var Mustache=require(_0x6176('0x5'));var util=require(_0x6176('0x6'));var path=require('path');var sox=require(_0x6176('0x7'));var csv=require(_0x6176('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6176('0x9'));var _=require(_0x6176('0xa'));var squel=require(_0x6176('0xb'));var crypto=require(_0x6176('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x6176('0xd'));var toCsv=require(_0x6176('0x8'));var querystring=require(_0x6176('0xe'));var Papa=require(_0x6176('0xf'));var Redis=require(_0x6176('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x6176('0x11'));var as=require(_0x6176('0x12'));var hardwareService=require(_0x6176('0x13'));var logger=require('../../config/logger')(_0x6176('0x14'));var utils=require('../../config/utils');var config=require(_0x6176('0x15'));var licenseUtil=require(_0x6176('0x16'));var db=require(_0x6176('0x17'))['db'];function respondWithStatusCode(_0x1ac42f,_0x2390a3){_0x2390a3=_0x2390a3||0xcc;return function(_0x5879e5){if(_0x5879e5){return _0x1ac42f[_0x6176('0x18')](_0x2390a3);}return _0x1ac42f[_0x6176('0x19')](_0x2390a3)[_0x6176('0x1a')]();};}function respondWithResult(_0x18a2bb,_0x39c8e9){_0x39c8e9=_0x39c8e9||0xc8;return function(_0x10c04c){if(_0x10c04c){return _0x18a2bb[_0x6176('0x19')](_0x39c8e9)['json'](_0x10c04c);}};}function respondWithFilteredResult(_0x276c4f,_0x202604){return function(_0x10c72e){if(_0x10c72e){var _0x254344=typeof _0x202604['offset']==='undefined'&&typeof _0x202604['limit']===_0x6176('0x1b');var _0x45ddf1=_0x10c72e['count'];var _0x548fd1=_0x254344?0x0:_0x202604[_0x6176('0x1c')];var _0x5bc005=_0x254344?_0x10c72e['count']:_0x202604[_0x6176('0x1c')]+_0x202604[_0x6176('0x1d')];var _0x4fbe51;if(_0x5bc005>=_0x45ddf1){_0x5bc005=_0x45ddf1;_0x4fbe51=0xc8;}else{_0x4fbe51=0xce;}_0x276c4f[_0x6176('0x19')](_0x4fbe51);return _0x276c4f['set'](_0x6176('0x1e'),_0x548fd1+'-'+_0x5bc005+'/'+_0x45ddf1)[_0x6176('0x1f')](_0x10c72e);}return null;};}function patchUpdates(_0x540adf){return function(_0x58c379){try{jsonpatch[_0x6176('0x20')](_0x58c379,_0x540adf,!![]);}catch(_0x260473){return BPromise[_0x6176('0x21')](_0x260473);}return _0x58c379[_0x6176('0x22')]();};}function saveUpdates(_0x5f4dd0,_0x12a892){return function(_0x4dae63){if(_0x4dae63){return _0x4dae63[_0x6176('0x23')](_0x5f4dd0)[_0x6176('0x24')](function(_0x6befb7){return _0x6befb7;});}return null;};}function removeEntity(_0x37d1e7,_0x3bc605){return function(_0x9c9236){if(_0x9c9236){return _0x9c9236[_0x6176('0x25')]()[_0x6176('0x24')](function(){var _0x34801f=_0x9c9236[_0x6176('0x26')]({'plain':!![]});var _0xb0d33=_0x6176('0x27');return db['UserProfileResource'][_0x6176('0x25')]({'where':{'type':_0xb0d33,'resourceId':_0x34801f['id']}})[_0x6176('0x24')](function(){return _0x9c9236;});})[_0x6176('0x24')](function(){_0x37d1e7[_0x6176('0x19')](0xcc)[_0x6176('0x1a')]();});}};}function handleEntityNotFound(_0x20efab,_0x2546c2){return function(_0x20dd73){if(!_0x20dd73){_0x20efab[_0x6176('0x18')](0x194);}return _0x20dd73;};}function handleError(_0x3ea4e8,_0x131a70){_0x131a70=_0x131a70||0x1f4;return function(_0x301a0d){logger[_0x6176('0x28')](_0x301a0d['stack']);if(_0x301a0d[_0x6176('0x29')]){delete _0x301a0d[_0x6176('0x29')];}_0x3ea4e8[_0x6176('0x19')](_0x131a70)[_0x6176('0x2a')](_0x301a0d);};}exports['index']=function(_0xec2e66,_0x1fb484){var _0x3f5a90={},_0x53618c={},_0x44bf89={'count':0x0,'rows':[]};var _0x5ec8f9=_[_0x6176('0x2b')](db['Disposition'][_0x6176('0x2c')],function(_0x504891){return{'name':_0x504891[_0x6176('0x2d')],'type':_0x504891['type'][_0x6176('0x2e')]};});_0x53618c[_0x6176('0x2f')]=_['map'](_0x5ec8f9,'name');_0x53618c[_0x6176('0x30')]=_[_0x6176('0x31')](_0xec2e66[_0x6176('0x30')]);_0x53618c[_0x6176('0x32')]=_['intersection'](_0x53618c[_0x6176('0x2f')],_0x53618c[_0x6176('0x30')]);_0x3f5a90['attributes']=_[_0x6176('0x33')](_0x53618c[_0x6176('0x2f')],qs['fields'](_0xec2e66[_0x6176('0x30')][_0x6176('0x34')]));_0x3f5a90[_0x6176('0x35')]=_0x3f5a90[_0x6176('0x35')]['length']?_0x3f5a90[_0x6176('0x35')]:_0x53618c['model'];if(!_0xec2e66[_0x6176('0x30')][_0x6176('0x36')](_0x6176('0x37'))){_0x3f5a90['limit']=qs[_0x6176('0x1d')](_0xec2e66[_0x6176('0x30')][_0x6176('0x1d')]);_0x3f5a90['offset']=qs[_0x6176('0x1c')](_0xec2e66[_0x6176('0x30')]['offset']);}_0x3f5a90[_0x6176('0x38')]=qs[_0x6176('0x39')](_0xec2e66[_0x6176('0x30')][_0x6176('0x39')]);_0x3f5a90[_0x6176('0x3a')]=qs[_0x6176('0x32')](_['pick'](_0xec2e66[_0x6176('0x30')],_0x53618c['filters']),_0x5ec8f9);if(_0xec2e66[_0x6176('0x30')][_0x6176('0x3b')]){_0x3f5a90[_0x6176('0x3a')]=_[_0x6176('0x3c')](_0x3f5a90[_0x6176('0x3a')],{'$or':_[_0x6176('0x2b')](_0x5ec8f9,function(_0x446d07){if(_0x446d07['type']!=='VIRTUAL'){var _0x1e44d4={};_0x1e44d4[_0x446d07[_0x6176('0x29')]]={'$like':'%'+_0xec2e66['query'][_0x6176('0x3b')]+'%'};return _0x1e44d4;}})});}_0x3f5a90=_[_0x6176('0x3c')]({},_0x3f5a90,_0xec2e66[_0x6176('0x3d')]);var _0x40c25b={'where':_0x3f5a90['where']};return db[_0x6176('0x3e')][_0x6176('0x3f')](_0x40c25b)[_0x6176('0x24')](function(_0x2f650f){_0x44bf89[_0x6176('0x3f')]=_0x2f650f;if(_0xec2e66[_0x6176('0x30')][_0x6176('0x40')]){_0x3f5a90[_0x6176('0x41')]=[{'all':!![]}];}return db[_0x6176('0x3e')][_0x6176('0x42')](_0x3f5a90);})[_0x6176('0x24')](function(_0x57e171){_0x44bf89[_0x6176('0x43')]=_0x57e171;return _0x44bf89;})[_0x6176('0x24')](respondWithFilteredResult(_0x1fb484,_0x3f5a90))[_0x6176('0x44')](handleError(_0x1fb484,null));};exports[_0x6176('0x45')]=function(_0x46797f,_0x59e6e7){var _0x1c7c93={'raw':!![],'where':{'id':_0x46797f[_0x6176('0x46')]['id']}},_0x24bf0c={};_0x24bf0c[_0x6176('0x2f')]=_[_0x6176('0x31')](db[_0x6176('0x3e')][_0x6176('0x2c')]);_0x24bf0c[_0x6176('0x30')]=_[_0x6176('0x31')](_0x46797f[_0x6176('0x30')]);_0x24bf0c['filters']=_[_0x6176('0x33')](_0x24bf0c[_0x6176('0x2f')],_0x24bf0c[_0x6176('0x30')]);_0x1c7c93['attributes']=_[_0x6176('0x33')](_0x24bf0c[_0x6176('0x2f')],qs[_0x6176('0x34')](_0x46797f[_0x6176('0x30')][_0x6176('0x34')]));_0x1c7c93['attributes']=_0x1c7c93[_0x6176('0x35')][_0x6176('0x47')]?_0x1c7c93['attributes']:_0x24bf0c[_0x6176('0x2f')];if(_0x46797f['query'][_0x6176('0x40')]){_0x1c7c93['include']=[{'all':!![]}];}_0x1c7c93=_[_0x6176('0x3c')]({},_0x1c7c93,_0x46797f[_0x6176('0x3d')]);return db['Disposition'][_0x6176('0x48')](_0x1c7c93)[_0x6176('0x24')](handleEntityNotFound(_0x59e6e7,null))[_0x6176('0x24')](respondWithResult(_0x59e6e7,null))[_0x6176('0x44')](handleError(_0x59e6e7,null));};exports[_0x6176('0x49')]=function(_0x4ff7a7,_0x326e1f){return db[_0x6176('0x3e')][_0x6176('0x49')](_0x4ff7a7[_0x6176('0x4a')],{})['then'](function(_0x5ca994){var _0x1896c7=_0x4ff7a7[_0x6176('0x4b')]['get']({'plain':!![]});if(!_0x1896c7)throw new Error(_0x6176('0x4c'));if(_0x1896c7[_0x6176('0x4d')]===_0x6176('0x4b')){var _0x158b94=_0x5ca994[_0x6176('0x26')]({'plain':!![]});var _0x327c69=_0x6176('0x27');return db[_0x6176('0x4e')][_0x6176('0x48')]({'where':{'name':_0x327c69,'userProfileId':_0x1896c7['userProfileId']},'raw':!![]})[_0x6176('0x24')](function(_0x2892ef){if(_0x2892ef&&_0x2892ef['autoAssociation']===0x0){return db[_0x6176('0x4f')]['create']({'name':_0x158b94['name'],'resourceId':_0x158b94['id'],'type':_0x2892ef['name'],'sectionId':_0x2892ef['id']},{})[_0x6176('0x24')](function(){return _0x5ca994;});}else{return _0x5ca994;}})[_0x6176('0x44')](function(_0x20207f){logger[_0x6176('0x28')](_0x6176('0x50'),_0x20207f);throw _0x20207f;});}return _0x5ca994;})['then'](respondWithResult(_0x326e1f,0xc9))[_0x6176('0x44')](handleError(_0x326e1f,null));};exports[_0x6176('0x23')]=function(_0x525041,_0x59a12f){if(_0x525041[_0x6176('0x4a')]['id']){delete _0x525041[_0x6176('0x4a')]['id'];}return db[_0x6176('0x3e')][_0x6176('0x48')]({'where':{'id':_0x525041[_0x6176('0x46')]['id']}})[_0x6176('0x24')](handleEntityNotFound(_0x59a12f,null))[_0x6176('0x24')](saveUpdates(_0x525041[_0x6176('0x4a')],null))['then'](respondWithResult(_0x59a12f,null))[_0x6176('0x44')](handleError(_0x59a12f,null));};exports['destroy']=function(_0x20162a,_0x19d9ce){return db[_0x6176('0x3e')][_0x6176('0x48')]({'where':{'id':_0x20162a[_0x6176('0x46')]['id']}})[_0x6176('0x24')](handleEntityNotFound(_0x19d9ce,null))['then'](removeEntity(_0x19d9ce,null))['catch'](handleError(_0x19d9ce,null));};
\ No newline at end of file
+var _0x1caf=['show','params','keys','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','eml-format','zip-dir','bluebird','util','ejs','lodash','squel','crypto','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','update','get','Dispositions','UserProfileResource','destroy','then','error','stack','name','send','map','Disposition','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','merge','filter','options','count','includeAll','include','findAll'];(function(_0x4f6607,_0x383d7e){var _0x1fbc46=function(_0x4cd813){while(--_0x4cd813){_0x4f6607['push'](_0x4f6607['shift']());}};_0x1fbc46(++_0x383d7e);}(_0x1caf,0x1e1));var _0xf1ca=function(_0x4e9628,_0x250573){_0x4e9628=_0x4e9628-0x0;var _0x27bc8c=_0x1caf[_0x4e9628];return _0x27bc8c;};'use strict';var emlformat=require(_0xf1ca('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf1ca('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xf1ca('0x2'));var Mustache=require('mustache');var util=require(_0xf1ca('0x3'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xf1ca('0x4'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf1ca('0x5'));var squel=require(_0xf1ca('0x6'));var crypto=require(_0xf1ca('0x7'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xf1ca('0x8'));var querystring=require(_0xf1ca('0x9'));var Papa=require(_0xf1ca('0xa'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xf1ca('0xb'));var as=require(_0xf1ca('0xc'));var hardwareService=require(_0xf1ca('0xd'));var logger=require(_0xf1ca('0xe'))('api');var utils=require(_0xf1ca('0xf'));var config=require(_0xf1ca('0x10'));var licenseUtil=require(_0xf1ca('0x11'));var db=require(_0xf1ca('0x12'))['db'];function respondWithStatusCode(_0x45180b,_0x1d8a26){_0x1d8a26=_0x1d8a26||0xcc;return function(_0x27f35f){if(_0x27f35f){return _0x45180b[_0xf1ca('0x13')](_0x1d8a26);}return _0x45180b[_0xf1ca('0x14')](_0x1d8a26)[_0xf1ca('0x15')]();};}function respondWithResult(_0x58eb02,_0x3ca34f){_0x3ca34f=_0x3ca34f||0xc8;return function(_0x275875){if(_0x275875){return _0x58eb02[_0xf1ca('0x14')](_0x3ca34f)[_0xf1ca('0x16')](_0x275875);}};}function respondWithFilteredResult(_0x3c47f7,_0x166907){return function(_0x3ebed9){if(_0x3ebed9){var _0x5176ac=typeof _0x166907[_0xf1ca('0x17')]===_0xf1ca('0x18')&&typeof _0x166907[_0xf1ca('0x19')]===_0xf1ca('0x18');var _0x30c9b2=_0x3ebed9['count'];var _0x3ce46b=_0x5176ac?0x0:_0x166907['offset'];var _0x7d67bc=_0x5176ac?_0x3ebed9['count']:_0x166907[_0xf1ca('0x17')]+_0x166907[_0xf1ca('0x19')];var _0x401a3d;if(_0x7d67bc>=_0x30c9b2){_0x7d67bc=_0x30c9b2;_0x401a3d=0xc8;}else{_0x401a3d=0xce;}_0x3c47f7[_0xf1ca('0x14')](_0x401a3d);return _0x3c47f7[_0xf1ca('0x1a')](_0xf1ca('0x1b'),_0x3ce46b+'-'+_0x7d67bc+'/'+_0x30c9b2)['json'](_0x3ebed9);}return null;};}function patchUpdates(_0x13a37d){return function(_0x240e50){try{jsonpatch[_0xf1ca('0x1c')](_0x240e50,_0x13a37d,!![]);}catch(_0xb5462b){return BPromise[_0xf1ca('0x1d')](_0xb5462b);}return _0x240e50['save']();};}function saveUpdates(_0x95aa51,_0x175a25){return function(_0x28b8f5){if(_0x28b8f5){return _0x28b8f5[_0xf1ca('0x1e')](_0x95aa51)['then'](function(_0x1c2a35){return _0x1c2a35;});}return null;};}function removeEntity(_0x140597,_0x361204){return function(_0xbeca02){if(_0xbeca02){return _0xbeca02['destroy']()['then'](function(){var _0x3af470=_0xbeca02[_0xf1ca('0x1f')]({'plain':!![]});var _0x37d2f5=_0xf1ca('0x20');return db[_0xf1ca('0x21')][_0xf1ca('0x22')]({'where':{'type':_0x37d2f5,'resourceId':_0x3af470['id']}})[_0xf1ca('0x23')](function(){return _0xbeca02;});})[_0xf1ca('0x23')](function(){_0x140597['status'](0xcc)[_0xf1ca('0x15')]();});}};}function handleEntityNotFound(_0x1a3bc3,_0x146186){return function(_0x1ae59c){if(!_0x1ae59c){_0x1a3bc3[_0xf1ca('0x13')](0x194);}return _0x1ae59c;};}function handleError(_0x30631f,_0x57f433){_0x57f433=_0x57f433||0x1f4;return function(_0x14ef58){logger[_0xf1ca('0x24')](_0x14ef58[_0xf1ca('0x25')]);if(_0x14ef58[_0xf1ca('0x26')]){delete _0x14ef58[_0xf1ca('0x26')];}_0x30631f[_0xf1ca('0x14')](_0x57f433)[_0xf1ca('0x27')](_0x14ef58);};}exports['index']=function(_0x5a105d,_0xf98f9e){var _0x5b8ed2={},_0x24f3e5={},_0x52447d={'count':0x0,'rows':[]};var _0x944b52=_[_0xf1ca('0x28')](db[_0xf1ca('0x29')][_0xf1ca('0x2a')],function(_0x393f69){return{'name':_0x393f69[_0xf1ca('0x2b')],'type':_0x393f69[_0xf1ca('0x2c')][_0xf1ca('0x2d')]};});_0x24f3e5[_0xf1ca('0x2e')]=_[_0xf1ca('0x28')](_0x944b52,_0xf1ca('0x26'));_0x24f3e5[_0xf1ca('0x2f')]=_['keys'](_0x5a105d['query']);_0x24f3e5[_0xf1ca('0x30')]=_[_0xf1ca('0x31')](_0x24f3e5['model'],_0x24f3e5[_0xf1ca('0x2f')]);_0x5b8ed2[_0xf1ca('0x32')]=_[_0xf1ca('0x31')](_0x24f3e5[_0xf1ca('0x2e')],qs['fields'](_0x5a105d[_0xf1ca('0x2f')][_0xf1ca('0x33')]));_0x5b8ed2[_0xf1ca('0x32')]=_0x5b8ed2[_0xf1ca('0x32')][_0xf1ca('0x34')]?_0x5b8ed2[_0xf1ca('0x32')]:_0x24f3e5[_0xf1ca('0x2e')];if(!_0x5a105d[_0xf1ca('0x2f')][_0xf1ca('0x35')](_0xf1ca('0x36'))){_0x5b8ed2[_0xf1ca('0x19')]=qs[_0xf1ca('0x19')](_0x5a105d['query'][_0xf1ca('0x19')]);_0x5b8ed2[_0xf1ca('0x17')]=qs[_0xf1ca('0x17')](_0x5a105d['query'][_0xf1ca('0x17')]);}_0x5b8ed2[_0xf1ca('0x37')]=qs['sort'](_0x5a105d['query']['sort']);_0x5b8ed2[_0xf1ca('0x38')]=qs['filters'](_[_0xf1ca('0x39')](_0x5a105d['query'],_0x24f3e5['filters']),_0x944b52);if(_0x5a105d[_0xf1ca('0x2f')]['filter']){_0x5b8ed2[_0xf1ca('0x38')]=_[_0xf1ca('0x3a')](_0x5b8ed2[_0xf1ca('0x38')],{'$or':_[_0xf1ca('0x28')](_0x944b52,function(_0x366110){if(_0x366110[_0xf1ca('0x2c')]!=='VIRTUAL'){var _0x4d04ef={};_0x4d04ef[_0x366110[_0xf1ca('0x26')]]={'$like':'%'+_0x5a105d['query'][_0xf1ca('0x3b')]+'%'};return _0x4d04ef;}})});}_0x5b8ed2=_[_0xf1ca('0x3a')]({},_0x5b8ed2,_0x5a105d[_0xf1ca('0x3c')]);var _0xa98e7e={'where':_0x5b8ed2[_0xf1ca('0x38')]};return db[_0xf1ca('0x29')]['count'](_0xa98e7e)['then'](function(_0x5bf91a){_0x52447d[_0xf1ca('0x3d')]=_0x5bf91a;if(_0x5a105d[_0xf1ca('0x2f')][_0xf1ca('0x3e')]){_0x5b8ed2[_0xf1ca('0x3f')]=[{'all':!![]}];}return db['Disposition'][_0xf1ca('0x40')](_0x5b8ed2);})[_0xf1ca('0x23')](function(_0x3962c7){_0x52447d['rows']=_0x3962c7;return _0x52447d;})[_0xf1ca('0x23')](respondWithFilteredResult(_0xf98f9e,_0x5b8ed2))['catch'](handleError(_0xf98f9e,null));};exports[_0xf1ca('0x41')]=function(_0x2cfc77,_0x51d1f6){var _0x2cf980={'raw':!![],'where':{'id':_0x2cfc77[_0xf1ca('0x42')]['id']}},_0x3d900d={};_0x3d900d[_0xf1ca('0x2e')]=_['keys'](db[_0xf1ca('0x29')]['rawAttributes']);_0x3d900d['query']=_[_0xf1ca('0x43')](_0x2cfc77[_0xf1ca('0x2f')]);_0x3d900d[_0xf1ca('0x30')]=_[_0xf1ca('0x31')](_0x3d900d['model'],_0x3d900d[_0xf1ca('0x2f')]);_0x2cf980[_0xf1ca('0x32')]=_[_0xf1ca('0x31')](_0x3d900d[_0xf1ca('0x2e')],qs[_0xf1ca('0x33')](_0x2cfc77[_0xf1ca('0x2f')][_0xf1ca('0x33')]));_0x2cf980[_0xf1ca('0x32')]=_0x2cf980[_0xf1ca('0x32')][_0xf1ca('0x34')]?_0x2cf980[_0xf1ca('0x32')]:_0x3d900d[_0xf1ca('0x2e')];if(_0x2cfc77[_0xf1ca('0x2f')][_0xf1ca('0x3e')]){_0x2cf980[_0xf1ca('0x3f')]=[{'all':!![]}];}_0x2cf980=_['merge']({},_0x2cf980,_0x2cfc77['options']);return db[_0xf1ca('0x29')]['find'](_0x2cf980)['then'](handleEntityNotFound(_0x51d1f6,null))[_0xf1ca('0x23')](respondWithResult(_0x51d1f6,null))[_0xf1ca('0x44')](handleError(_0x51d1f6,null));};exports[_0xf1ca('0x45')]=function(_0x477fe0,_0x193064){return db[_0xf1ca('0x29')][_0xf1ca('0x45')](_0x477fe0[_0xf1ca('0x46')],{})[_0xf1ca('0x23')](function(_0x75346){var _0x4928a6=_0x477fe0[_0xf1ca('0x47')][_0xf1ca('0x1f')]({'plain':!![]});if(!_0x4928a6)throw new Error(_0xf1ca('0x48'));if(_0x4928a6[_0xf1ca('0x49')]==='user'){var _0x5a9ca4=_0x75346[_0xf1ca('0x1f')]({'plain':!![]});var _0x159c1f=_0xf1ca('0x20');return db[_0xf1ca('0x4a')]['find']({'where':{'name':_0x159c1f,'userProfileId':_0x4928a6['userProfileId']},'raw':!![]})[_0xf1ca('0x23')](function(_0x673b2d){if(_0x673b2d&&_0x673b2d[_0xf1ca('0x4b')]===0x0){return db[_0xf1ca('0x21')][_0xf1ca('0x45')]({'name':_0x5a9ca4['name'],'resourceId':_0x5a9ca4['id'],'type':_0x673b2d[_0xf1ca('0x26')],'sectionId':_0x673b2d['id']},{})[_0xf1ca('0x23')](function(){return _0x75346;});}else{return _0x75346;}})[_0xf1ca('0x44')](function(_0x31446d){logger['error'](_0xf1ca('0x4c'),_0x31446d);throw _0x31446d;});}return _0x75346;})[_0xf1ca('0x23')](respondWithResult(_0x193064,0xc9))[_0xf1ca('0x44')](handleError(_0x193064,null));};exports['update']=function(_0x57f67a,_0x481f28){if(_0x57f67a['body']['id']){delete _0x57f67a[_0xf1ca('0x46')]['id'];}return db[_0xf1ca('0x29')][_0xf1ca('0x4d')]({'where':{'id':_0x57f67a[_0xf1ca('0x42')]['id']}})[_0xf1ca('0x23')](handleEntityNotFound(_0x481f28,null))[_0xf1ca('0x23')](saveUpdates(_0x57f67a[_0xf1ca('0x46')],null))['then'](respondWithResult(_0x481f28,null))[_0xf1ca('0x44')](handleError(_0x481f28,null));};exports['destroy']=function(_0x4deeba,_0x1360fe){return db[_0xf1ca('0x29')][_0xf1ca('0x4d')]({'where':{'id':_0x4deeba['params']['id']}})[_0xf1ca('0x23')](handleEntityNotFound(_0x1360fe,null))['then'](removeEntity(_0x1360fe,null))[_0xf1ca('0x44')](handleError(_0x1360fe,null));};
\ No newline at end of file
index d9625e9..0a7d2fa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x86be=['name_mail','name_sms','FaxAccountId','name_openchannel','OpenchannelAccountId','name_whatsapp','WhatsappAccountId','lodash','moment','bluebird','path','rimraf','../../config/environment','./disposition.attributes','exports','define','Disposition','tools_dispositions','name','ListId','ChatWebsiteId'];(function(_0x94696b,_0xe621ce){var _0x43b479=function(_0x388f37){while(--_0x388f37){_0x94696b['push'](_0x94696b['shift']());}};_0x43b479(++_0xe621ce);}(_0x86be,0xd9));var _0xe86b=function(_0x5baca8,_0x404573){_0x5baca8=_0x5baca8-0x0;var _0x2fa74c=_0x86be[_0x5baca8];return _0x2fa74c;};'use strict';var _=require(_0xe86b('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xe86b('0x1'));var BPromise=require(_0xe86b('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe86b('0x3'));var rimraf=require(_0xe86b('0x4'));var config=require(_0xe86b('0x5'));var attributes=require(_0xe86b('0x6'));module[_0xe86b('0x7')]=function(_0x3643e6,_0x572db0){return _0x3643e6[_0xe86b('0x8')](_0xe86b('0x9'),attributes,{'tableName':_0xe86b('0xa'),'paranoid':![],'indexes':[{'unique':!![],'name':'name_voice','fields':[_0xe86b('0xb'),_0xe86b('0xc')]},{'unique':!![],'name':'name_chat','fields':['name',_0xe86b('0xd')]},{'unique':!![],'name':_0xe86b('0xe'),'fields':[_0xe86b('0xb'),'MailAccountId']},{'unique':!![],'name':_0xe86b('0xf'),'fields':['name','SmsAccountId']},{'unique':!![],'name':'name_fax','fields':[_0xe86b('0xb'),_0xe86b('0x10')]},{'unique':!![],'name':_0xe86b('0x11'),'fields':[_0xe86b('0xb'),_0xe86b('0x12')]},{'unique':!![],'name':_0xe86b('0x13'),'fields':[_0xe86b('0xb'),_0xe86b('0x14')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xf1d1=['name_whatsapp','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./disposition.attributes','exports','define','Disposition','tools_dispositions','ListId','name_chat','ChatWebsiteId','name_mail','name','MailAccountId','name_sms','SmsAccountId','FaxAccountId','name_openchannel','OpenchannelAccountId'];(function(_0x52f926,_0x3e9c33){var _0x416c69=function(_0x1b4096){while(--_0x1b4096){_0x52f926['push'](_0x52f926['shift']());}};_0x416c69(++_0x3e9c33);}(_0xf1d1,0xb7));var _0x1f1d=function(_0x426e5c,_0x5767ae){_0x426e5c=_0x426e5c-0x0;var _0x3558b4=_0xf1d1[_0x426e5c];return _0x3558b4;};'use strict';var _=require(_0x1f1d('0x0'));var util=require(_0x1f1d('0x1'));var logger=require(_0x1f1d('0x2'))(_0x1f1d('0x3'));var moment=require(_0x1f1d('0x4'));var BPromise=require('bluebird');var rp=require(_0x1f1d('0x5'));var fs=require('fs');var path=require(_0x1f1d('0x6'));var rimraf=require(_0x1f1d('0x7'));var config=require(_0x1f1d('0x8'));var attributes=require(_0x1f1d('0x9'));module[_0x1f1d('0xa')]=function(_0x574a4b,_0x619b3c){return _0x574a4b[_0x1f1d('0xb')](_0x1f1d('0xc'),attributes,{'tableName':_0x1f1d('0xd'),'paranoid':![],'indexes':[{'unique':!![],'name':'name_voice','fields':['name',_0x1f1d('0xe')]},{'unique':!![],'name':_0x1f1d('0xf'),'fields':['name',_0x1f1d('0x10')]},{'unique':!![],'name':_0x1f1d('0x11'),'fields':[_0x1f1d('0x12'),_0x1f1d('0x13')]},{'unique':!![],'name':_0x1f1d('0x14'),'fields':['name',_0x1f1d('0x15')]},{'unique':!![],'name':'name_fax','fields':[_0x1f1d('0x12'),_0x1f1d('0x16')]},{'unique':!![],'name':_0x1f1d('0x17'),'fields':[_0x1f1d('0x12'),_0x1f1d('0x18')]},{'unique':!![],'name':_0x1f1d('0x19'),'fields':[_0x1f1d('0x12'),'WhatsappAccountId']}],'timestamps':!![]});};
\ No newline at end of file
index d673fc2..e63b2e0 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(_0x10570d,_0x1484fe){var _0x456d2e=function(_0x23bbbe){while(--_0x23bbbe){_0x10570d['push'](_0x10570d['shift']());}};_0x456d2e(++_0x1484fe);}(_0xa9e0,0x123));var _0x0a9e=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xa9e0[_0xa1e3e3];return _0xc980e9;};'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(_0x212311,_0xb9ac85){var _0x1b407a=function(_0x16a73d){while(--_0x16a73d){_0x212311['push'](_0x212311['shift']());}};_0x1b407a(++_0xb9ac85);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xa9e0[_0x2dafbe];return _0x58a45a;};'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 5f26602..d5c76ef 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe38d=['destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./disposition.controller','get','isAuthenticated','index','/:id','create','update','delete'];(function(_0x36272a,_0x376fff){var _0x5cfc28=function(_0x178e84){while(--_0x178e84){_0x36272a['push'](_0x36272a['shift']());}};_0x5cfc28(++_0x376fff);}(_0xe38d,0x1de));var _0xde38=function(_0x3b84e6,_0x43908e){_0x3b84e6=_0x3b84e6-0x0;var _0x1e47e2=_0xe38d[_0x3b84e6];return _0x1e47e2;};'use strict';var multer=require(_0xde38('0x0'));var util=require(_0xde38('0x1'));var path=require(_0xde38('0x2'));var timeout=require(_0xde38('0x3'));var express=require('express');var router=express[_0xde38('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xde38('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xde38('0x6'));var controller=require(_0xde38('0x7'));router[_0xde38('0x8')]('/',auth[_0xde38('0x9')](),controller[_0xde38('0xa')]);router[_0xde38('0x8')](_0xde38('0xb'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0xde38('0x9')](),controller[_0xde38('0xc')]);router['put'](_0xde38('0xb'),auth[_0xde38('0x9')](),controller[_0xde38('0xd')]);router[_0xde38('0xe')](_0xde38('0xb'),auth['isAuthenticated'](),controller[_0xde38('0xf')]);module[_0xde38('0x10')]=router;
\ No newline at end of file
+var _0x8d72=['index','/:id','show','post','update','delete','destroy','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./disposition.controller','get','isAuthenticated'];(function(_0x1f68a0,_0x169293){var _0x2d2f71=function(_0x43d895){while(--_0x43d895){_0x1f68a0['push'](_0x1f68a0['shift']());}};_0x2d2f71(++_0x169293);}(_0x8d72,0x13a));var _0x28d7=function(_0x23e034,_0x1e1bfc){_0x23e034=_0x23e034-0x0;var _0x1d13a6=_0x8d72[_0x23e034];return _0x1d13a6;};'use strict';var multer=require(_0x28d7('0x0'));var util=require(_0x28d7('0x1'));var path=require(_0x28d7('0x2'));var timeout=require('connect-timeout');var express=require(_0x28d7('0x3'));var router=express[_0x28d7('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x28d7('0x5'));var config=require(_0x28d7('0x6'));var controller=require(_0x28d7('0x7'));router[_0x28d7('0x8')]('/',auth[_0x28d7('0x9')](),controller[_0x28d7('0xa')]);router[_0x28d7('0x8')](_0x28d7('0xb'),auth['isAuthenticated'](),controller[_0x28d7('0xc')]);router[_0x28d7('0xd')]('/',auth[_0x28d7('0x9')](),controller['create']);router['put'](_0x28d7('0xb'),auth[_0x28d7('0x9')](),controller[_0x28d7('0xe')]);router[_0x28d7('0xf')](_0x28d7('0xb'),auth[_0x28d7('0x9')](),controller[_0x28d7('0x10')]);module[_0x28d7('0x11')]=router;
\ No newline at end of file
index ee67871..79cb708 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb9da=['7200','v17,v27,v29','SIP','IAX','KHOMP','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','localstationid','9600','12000','14400','4800'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xb9da,0xad));var _0xab9d=function(_0x461886,_0x4fc171){_0x461886=_0x461886-0x0;var _0x295e0a=_0xb9da[_0x461886];return _0x295e0a;};'use strict';var Sequelize=require(_0xab9d('0x0'));module[_0xab9d('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xab9d('0x2')]},'ecm':{'type':Sequelize[_0xab9d('0x3')](_0xab9d('0x4'),'no'),'defaultValue':_0xab9d('0x4')},'headerinfo':{'type':Sequelize[_0xab9d('0x2')],'defaultValue':_0xab9d('0x5')},'localstationid':{'type':Sequelize['STRING'],'unique':_0xab9d('0x6')},'minrate':{'type':Sequelize['ENUM']('2400','4800','7200',_0xab9d('0x7'),_0xab9d('0x8'),_0xab9d('0x9')),'defaultValue':_0xab9d('0xa')},'maxrate':{'type':Sequelize[_0xab9d('0x3')]('2400','4800',_0xab9d('0xb'),_0xab9d('0x7'),'12000','14400'),'defaultValue':_0xab9d('0x9')},'modem':{'type':Sequelize['STRING'],'defaultValue':_0xab9d('0xc')},'gateway':{'type':Sequelize[_0xab9d('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0xab9d('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0xab9d('0x3')](_0xab9d('0xd'),_0xab9d('0xe'),'DADHI',_0xab9d('0xf')),'defaultValue':_0xab9d('0xd')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xab9d('0x10');}},'notificationSound':{'type':Sequelize[_0xab9d('0x11')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xab9d('0x11')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xab9d('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xab9d('0x11')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xab9d('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xab9d('0x11')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xab9d('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xab9d('0x12')],'allowNull':!![],'defaultValue':null,'comment':_0xab9d('0x13')},'mandatoryDisposition':{'type':Sequelize[_0xab9d('0x11')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x293dac){if(!_0x293dac)this[_0xab9d('0x14')](_0xab9d('0x15'),null);this['setDataValue'](_0xab9d('0x16'),_0x293dac);}}};
\ No newline at end of file
+var _0xa516=['Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','ENUM','yes','STRING','xCALLY\x20Motion\x20Fax','localstationid','4800','7200','9600','12000','14400','2400','v17,v27,v29','INTEGER','SIP','DADHI','KHOMP'];(function(_0x3a41e7,_0x5af6a3){var _0xbf867f=function(_0x2ff239){while(--_0x2ff239){_0x3a41e7['push'](_0x3a41e7['shift']());}};_0xbf867f(++_0x5af6a3);}(_0xa516,0x1c9));var _0x6a51=function(_0x210528,_0x3d9c9b){_0x210528=_0x210528-0x0;var _0x4a8782=_0xa516[_0x210528];return _0x4a8782;};'use strict';var Sequelize=require(_0x6a51('0x0'));module[_0x6a51('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'ecm':{'type':Sequelize[_0x6a51('0x2')](_0x6a51('0x3'),'no'),'defaultValue':_0x6a51('0x3')},'headerinfo':{'type':Sequelize[_0x6a51('0x4')],'defaultValue':_0x6a51('0x5')},'localstationid':{'type':Sequelize[_0x6a51('0x4')],'unique':_0x6a51('0x6')},'minrate':{'type':Sequelize[_0x6a51('0x2')]('2400',_0x6a51('0x7'),_0x6a51('0x8'),_0x6a51('0x9'),_0x6a51('0xa'),_0x6a51('0xb')),'defaultValue':'4800'},'maxrate':{'type':Sequelize['ENUM'](_0x6a51('0xc'),_0x6a51('0x7'),'7200',_0x6a51('0x9'),_0x6a51('0xa'),_0x6a51('0xb')),'defaultValue':_0x6a51('0xb')},'modem':{'type':Sequelize['STRING'],'defaultValue':_0x6a51('0xd')},'gateway':{'type':Sequelize[_0x6a51('0x4')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x6a51('0x4')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x6a51('0xe')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x6a51('0x2')](_0x6a51('0xf'),'IAX',_0x6a51('0x10'),_0x6a51('0x11')),'defaultValue':_0x6a51('0xf')},'key':{'type':Sequelize[_0x6a51('0x4')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x6a51('0x12');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x6a51('0x13')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x6a51('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x6a51('0x13')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x6a51('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x6a51('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x6a51('0xe')],'allowNull':!![],'defaultValue':null,'comment':_0x6a51('0x14')},'mandatoryDisposition':{'type':Sequelize[_0x6a51('0x13')],'defaultValue':![],'comment':_0x6a51('0x15'),'set':function(_0x181c3d){if(!_0x181c3d)this[_0x6a51('0x16')](_0x6a51('0x17'),null);this[_0x6a51('0x16')](_0x6a51('0x18'),_0x181c3d);}}};
\ No newline at end of file
index 967520b..650e1f7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb810=['apply','reject','save','get','FaxAccounts','UserProfileResource','destroy','name','send','index','Pause','map','rawAttributes','fieldName','type','key','query','keys','intersection','attributes','model','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','merge','FaxAccount','includeAll','include','findAll','params','mandatoryDispositionPause','fields','options','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','describe','addDisposition','FaxAccountId','Disposition','getDispositions','findOne','rows','removeDispositions','ids','CannedAnswer','removeAnswers','FaxInteraction','getInteractions','Contact','User','fullname','Tag','Tags','color','tag','addApplications','sequelize','Transaction','ISOLATION_LEVELS','FaxApplication','findAndCountAll','priority','stack','getApplications','context','localstationid','Fax\x20Extension','appdata','push','CDR(type)=inbound-fax','Set','gateway','faxdetect','headerinfo','maxrate','modem','t38timeout','FAXOPT(','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','addAccountApplications','transaction','VoiceExtension','bulkCreate','updateAccountApplications','createdAt','updatedAt','TrunkId','findById','getMessages','FaxMessage','$gte','split','YYYY-MM-DD\x20HH:mm:ss','CmList','List','CmContact','Contacts','attachments','join','root','server/files/attachments','basename','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','defaults','ListId','Send\x20Fax\x20failed','out','filename','Messages','Contact\x20not\x20found','spread','dataValues','SendFax','SendFaxRpc,\x20%s','info','addAgents','omit','userFaxAccount:save','removeAgents','userFaxAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./faxAccount.socket','register','client','http','request','then','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','end','json','offset','undefined','count','Content-Range'];(function(_0x56d928,_0x1f61d2){var _0x12e28a=function(_0x326046){while(--_0x326046){_0x56d928['push'](_0x56d928['shift']());}};_0x12e28a(++_0x1f61d2);}(_0xb810,0x8c));var _0x0b81=function(_0x5f309e,_0x66e31){_0x5f309e=_0x5f309e-0x0;var _0x487b5e=_0xb810[_0x5f309e];return _0x487b5e;};'use strict';var emlformat=require(_0x0b81('0x0'));var rimraf=require(_0x0b81('0x1'));var zipdir=require(_0x0b81('0x2'));var jsonpatch=require(_0x0b81('0x3'));var rp=require(_0x0b81('0x4'));var moment=require('moment');var BPromise=require(_0x0b81('0x5'));var Mustache=require(_0x0b81('0x6'));var util=require(_0x0b81('0x7'));var path=require(_0x0b81('0x8'));var sox=require(_0x0b81('0x9'));var csv=require(_0x0b81('0xa'));var ejs=require(_0x0b81('0xb'));var fs=require('fs');var fs_extra=require(_0x0b81('0xc'));var _=require(_0x0b81('0xd'));var squel=require(_0x0b81('0xe'));var crypto=require(_0x0b81('0xf'));var jsforce=require(_0x0b81('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x0b81('0xa'));var querystring=require(_0x0b81('0x11'));var Papa=require(_0x0b81('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x0b81('0x13'));var as=require(_0x0b81('0x14'));var hardwareService=require(_0x0b81('0x15'));var logger=require(_0x0b81('0x16'))('api');var utils=require(_0x0b81('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x0b81('0x18'));var db=require(_0x0b81('0x19'))['db'];config[_0x0b81('0x1a')]=_['defaults'](config[_0x0b81('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x0b81('0x1b'))(new Redis(config['redis']));require(_0x0b81('0x1c'))[_0x0b81('0x1d')](socket);var jayson=require('jayson/promise');var client=jayson[_0x0b81('0x1e')][_0x0b81('0x1f')]({'port':0x232c});var client9002=jayson[_0x0b81('0x1e')][_0x0b81('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x1c41d0,_0x26370b,_0x4b43b2,_0x6a05fd){return new BPromise(function(_0x5b4545,_0x5bad3e){var _0x29829f=_0x6a05fd||client;return _0x29829f[_0x0b81('0x20')](_0x1c41d0,_0x4b43b2)[_0x0b81('0x21')](function(_0xb46031){logger['info'](_0x0b81('0x22'),_0x26370b,_0x0b81('0x23'));logger[_0x0b81('0x24')](_0x0b81('0x25'),_0x26370b,_0x0b81('0x23'),JSON[_0x0b81('0x26')](_0xb46031));if(_0xb46031['error']){if(_0xb46031[_0x0b81('0x27')]['code']===0x1f4){logger['error'](_0x0b81('0x22'),_0x26370b,_0xb46031[_0x0b81('0x27')][_0x0b81('0x28')]);return _0x5bad3e(_0xb46031['error'][_0x0b81('0x28')]);}logger['error'](_0x0b81('0x22'),_0x26370b,_0xb46031[_0x0b81('0x27')][_0x0b81('0x28')]);return _0x5b4545(_0xb46031[_0x0b81('0x27')][_0x0b81('0x28')]);}else{logger['info']('FaxAccount,\x20%s,\x20%s',_0x26370b,_0x0b81('0x23'));_0x5b4545(_0xb46031[_0x0b81('0x29')]['message']);}})[_0x0b81('0x2a')](function(_0x5d4564){logger[_0x0b81('0x27')](_0x0b81('0x22'),_0x26370b,_0x5d4564);_0x5bad3e(_0x5d4564);});});}function respondWithStatusCode(_0x481b33,_0x220820){_0x220820=_0x220820||0xcc;return function(_0x407d16){if(_0x407d16){return _0x481b33[_0x0b81('0x2b')](_0x220820);}return _0x481b33[_0x0b81('0x2c')](_0x220820)[_0x0b81('0x2d')]();};}function respondWithResult(_0x2d4733,_0x135bed){_0x135bed=_0x135bed||0xc8;return function(_0x4ba4ac){if(_0x4ba4ac){return _0x2d4733[_0x0b81('0x2c')](_0x135bed)[_0x0b81('0x2e')](_0x4ba4ac);}};}function respondWithFilteredResult(_0x39498d,_0x17abd1){return function(_0x2214f9){if(_0x2214f9){var _0x414136=typeof _0x17abd1[_0x0b81('0x2f')]==='undefined'&&typeof _0x17abd1['limit']===_0x0b81('0x30');var _0x348f00=_0x2214f9['count'];var _0x533803=_0x414136?0x0:_0x17abd1[_0x0b81('0x2f')];var _0x32d450=_0x414136?_0x2214f9[_0x0b81('0x31')]:_0x17abd1[_0x0b81('0x2f')]+_0x17abd1['limit'];var _0x16a174;if(_0x32d450>=_0x348f00){_0x32d450=_0x348f00;_0x16a174=0xc8;}else{_0x16a174=0xce;}_0x39498d['status'](_0x16a174);return _0x39498d['set'](_0x0b81('0x32'),_0x533803+'-'+_0x32d450+'/'+_0x348f00)[_0x0b81('0x2e')](_0x2214f9);}return null;};}function patchUpdates(_0x235f84){return function(_0x4381f7){try{jsonpatch[_0x0b81('0x33')](_0x4381f7,_0x235f84,!![]);}catch(_0x57a6e5){return BPromise[_0x0b81('0x34')](_0x57a6e5);}return _0x4381f7[_0x0b81('0x35')]();};}function saveUpdates(_0x573bb1,_0x484c00){return function(_0x4e6d31){if(_0x4e6d31){return _0x4e6d31['update'](_0x573bb1)[_0x0b81('0x21')](function(_0xb9804f){return _0xb9804f;});}return null;};}function removeEntity(_0x3e1d3f,_0x2ec1f5){return function(_0x4157eb){if(_0x4157eb){return _0x4157eb['destroy']()['then'](function(){var _0x3f2b4c=_0x4157eb[_0x0b81('0x36')]({'plain':!![]});var _0x3d4043=_0x0b81('0x37');return db[_0x0b81('0x38')][_0x0b81('0x39')]({'where':{'type':_0x3d4043,'resourceId':_0x3f2b4c['id']}})[_0x0b81('0x21')](function(){return _0x4157eb;});})[_0x0b81('0x21')](function(){_0x3e1d3f[_0x0b81('0x2c')](0xcc)[_0x0b81('0x2d')]();});}};}function handleEntityNotFound(_0x284133,_0x33d989){return function(_0x80353){if(!_0x80353){_0x284133[_0x0b81('0x2b')](0x194);}return _0x80353;};}function handleError(_0x1b1dfe,_0x2fa670){_0x2fa670=_0x2fa670||0x1f4;return function(_0x26dab0){logger['error'](_0x26dab0['stack']);if(_0x26dab0[_0x0b81('0x3a')]){delete _0x26dab0[_0x0b81('0x3a')];}_0x1b1dfe[_0x0b81('0x2c')](_0x2fa670)[_0x0b81('0x3b')](_0x26dab0);};}exports[_0x0b81('0x3c')]=function(_0x3c6824,_0x1bbef8){var _0x19b150={'include':[{'model':db[_0x0b81('0x3d')],'as':'mandatoryDispositionPause'}]},_0x49bcf6={},_0x169724={'count':0x0,'rows':[]};var _0x9c8b16=_[_0x0b81('0x3e')](db['FaxAccount'][_0x0b81('0x3f')],function(_0xabbbf5){return{'name':_0xabbbf5[_0x0b81('0x40')],'type':_0xabbbf5[_0x0b81('0x41')][_0x0b81('0x42')]};});_0x49bcf6['model']=_[_0x0b81('0x3e')](_0x9c8b16,'name');_0x49bcf6[_0x0b81('0x43')]=_[_0x0b81('0x44')](_0x3c6824[_0x0b81('0x43')]);_0x49bcf6['filters']=_[_0x0b81('0x45')](_0x49bcf6['model'],_0x49bcf6[_0x0b81('0x43')]);_0x19b150[_0x0b81('0x46')]=_[_0x0b81('0x45')](_0x49bcf6[_0x0b81('0x47')],qs['fields'](_0x3c6824['query']['fields']));_0x19b150['attributes']=_0x19b150[_0x0b81('0x46')][_0x0b81('0x48')]?_0x19b150[_0x0b81('0x46')]:_0x49bcf6[_0x0b81('0x47')];if(!_0x3c6824[_0x0b81('0x43')][_0x0b81('0x49')](_0x0b81('0x4a'))){_0x19b150[_0x0b81('0x4b')]=qs[_0x0b81('0x4b')](_0x3c6824['query'][_0x0b81('0x4b')]);_0x19b150[_0x0b81('0x2f')]=qs[_0x0b81('0x2f')](_0x3c6824[_0x0b81('0x43')]['offset']);}_0x19b150[_0x0b81('0x4c')]=qs[_0x0b81('0x4d')](_0x3c6824[_0x0b81('0x43')][_0x0b81('0x4d')]);_0x19b150[_0x0b81('0x4e')]=qs[_0x0b81('0x4f')](_[_0x0b81('0x50')](_0x3c6824[_0x0b81('0x43')],_0x49bcf6['filters']),_0x9c8b16);if(_0x3c6824[_0x0b81('0x43')][_0x0b81('0x51')]){_0x19b150[_0x0b81('0x4e')]=_[_0x0b81('0x52')](_0x19b150[_0x0b81('0x4e')],{'$or':_[_0x0b81('0x3e')](_0x9c8b16,function(_0x46c4c5){if(_0x46c4c5['type']!=='VIRTUAL'){var _0x369b27={};_0x369b27[_0x46c4c5[_0x0b81('0x3a')]]={'$like':'%'+_0x3c6824['query']['filter']+'%'};return _0x369b27;}})});}_0x19b150=_[_0x0b81('0x52')]({},_0x19b150,_0x3c6824['options']);var _0x2c8f08={'where':_0x19b150[_0x0b81('0x4e')]};return db[_0x0b81('0x53')]['count'](_0x2c8f08)[_0x0b81('0x21')](function(_0x1c75e2){_0x169724[_0x0b81('0x31')]=_0x1c75e2;if(_0x3c6824[_0x0b81('0x43')][_0x0b81('0x54')]){_0x19b150[_0x0b81('0x55')]=[{'all':!![]}];}return db[_0x0b81('0x53')][_0x0b81('0x56')](_0x19b150);})[_0x0b81('0x21')](function(_0x36553f){_0x169724['rows']=_0x36553f;return _0x169724;})['then'](respondWithFilteredResult(_0x1bbef8,_0x19b150))[_0x0b81('0x2a')](handleError(_0x1bbef8,null));};exports['show']=function(_0x1a54ab,_0x2f7fc9){var _0x30c737={'raw':![],'where':{'id':_0x1a54ab[_0x0b81('0x57')]['id']},'include':[{'model':db['Pause'],'as':_0x0b81('0x58')}]},_0x1150ca={};_0x1150ca['model']=_[_0x0b81('0x44')](db[_0x0b81('0x53')][_0x0b81('0x3f')]);_0x1150ca[_0x0b81('0x43')]=_['keys'](_0x1a54ab['query']);_0x1150ca[_0x0b81('0x4f')]=_['intersection'](_0x1150ca[_0x0b81('0x47')],_0x1150ca[_0x0b81('0x43')]);_0x30c737[_0x0b81('0x46')]=_[_0x0b81('0x45')](_0x1150ca[_0x0b81('0x47')],qs[_0x0b81('0x59')](_0x1a54ab[_0x0b81('0x43')][_0x0b81('0x59')]));_0x30c737[_0x0b81('0x46')]=_0x30c737['attributes'][_0x0b81('0x48')]?_0x30c737['attributes']:_0x1150ca['model'];if(_0x1a54ab[_0x0b81('0x43')]['includeAll']){_0x30c737[_0x0b81('0x55')]=[{'all':!![]}];}_0x30c737=_[_0x0b81('0x52')]({},_0x30c737,_0x1a54ab[_0x0b81('0x5a')]);return db['FaxAccount'][_0x0b81('0x5b')](_0x30c737)[_0x0b81('0x21')](handleEntityNotFound(_0x2f7fc9,null))[_0x0b81('0x21')](respondWithResult(_0x2f7fc9,null))[_0x0b81('0x2a')](handleError(_0x2f7fc9,null));};exports[_0x0b81('0x5c')]=function(_0x2a064d,_0x8e060){return db[_0x0b81('0x53')][_0x0b81('0x5c')](_0x2a064d['body'],{})[_0x0b81('0x21')](function(_0x2203ce){var _0x2c50a0=_0x2a064d['user'][_0x0b81('0x36')]({'plain':!![]});if(!_0x2c50a0)throw new Error(_0x0b81('0x5d'));if(_0x2c50a0[_0x0b81('0x5e')]===_0x0b81('0x5f')){var _0x7b6e82=_0x2203ce['get']({'plain':!![]});var _0x389ab8='FaxAccounts';return db[_0x0b81('0x60')]['find']({'where':{'name':_0x389ab8,'userProfileId':_0x2c50a0['userProfileId']},'raw':!![]})[_0x0b81('0x21')](function(_0x492227){if(_0x492227&&_0x492227['autoAssociation']===0x0){return db['UserProfileResource'][_0x0b81('0x5c')]({'name':_0x7b6e82[_0x0b81('0x3a')],'resourceId':_0x7b6e82['id'],'type':_0x492227[_0x0b81('0x3a')],'sectionId':_0x492227['id']},{})[_0x0b81('0x21')](function(){return _0x2203ce;});}else{return _0x2203ce;}})[_0x0b81('0x2a')](function(_0x4c0574){logger[_0x0b81('0x27')](_0x0b81('0x61'),_0x4c0574);throw _0x4c0574;});}return _0x2203ce;})[_0x0b81('0x21')](respondWithResult(_0x8e060,0xc9))[_0x0b81('0x2a')](handleError(_0x8e060,null));};exports[_0x0b81('0x62')]=function(_0x12dd88,_0x481cd0){if(_0x12dd88[_0x0b81('0x63')]['id']){delete _0x12dd88[_0x0b81('0x63')]['id'];}return db[_0x0b81('0x53')][_0x0b81('0x5b')]({'where':{'id':_0x12dd88[_0x0b81('0x57')]['id']},'include':[{'model':db[_0x0b81('0x3d')],'as':'mandatoryDispositionPause'}]})[_0x0b81('0x21')](handleEntityNotFound(_0x481cd0,null))[_0x0b81('0x21')](saveUpdates(_0x12dd88[_0x0b81('0x63')],null))['then'](respondWithResult(_0x481cd0,null))['catch'](handleError(_0x481cd0,null));};exports[_0x0b81('0x39')]=function(_0x10ba52,_0x472362){return db[_0x0b81('0x53')][_0x0b81('0x5b')]({'where':{'id':_0x10ba52[_0x0b81('0x57')]['id']}})[_0x0b81('0x21')](handleEntityNotFound(_0x472362,null))[_0x0b81('0x21')](removeEntity(_0x472362,null))[_0x0b81('0x2a')](handleError(_0x472362,null));};exports[_0x0b81('0x64')]=function(_0x541bb2,_0x3fdb3f){return db[_0x0b81('0x53')][_0x0b81('0x64')]()[_0x0b81('0x21')](respondWithResult(_0x3fdb3f,null))[_0x0b81('0x2a')](handleError(_0x3fdb3f,null));};exports[_0x0b81('0x65')]=function(_0x3b8870,_0x15376e,_0x37e448){if(_0x3b8870['body']['id']){delete _0x3b8870[_0x0b81('0x63')]['id'];}return db['FaxAccount'][_0x0b81('0x5b')]({'where':{'id':_0x3b8870[_0x0b81('0x57')]['id']}})['then'](handleEntityNotFound(_0x15376e,null))[_0x0b81('0x21')](function(_0x3bd882){if(_0x3bd882){_0x3b8870['body'][_0x0b81('0x66')]=_0x3bd882['id'];return db[_0x0b81('0x67')][_0x0b81('0x5c')](_0x3b8870[_0x0b81('0x63')]);}})[_0x0b81('0x21')](respondWithResult(_0x15376e,null))[_0x0b81('0x2a')](handleError(_0x15376e,null));};exports[_0x0b81('0x68')]=function(_0x59de52,_0x2c2529,_0x548e16){var _0x4470d4={'raw':![],'where':{}};var _0x1042e9={};var _0x3c4a12={'count':0x0,'rows':[]};return db[_0x0b81('0x53')][_0x0b81('0x69')]({'where':{'id':_0x59de52[_0x0b81('0x57')]['id']}})[_0x0b81('0x21')](handleEntityNotFound(_0x2c2529,null))[_0x0b81('0x21')](function(_0x5ee008){if(_0x5ee008){_0x1042e9[_0x0b81('0x47')]=_[_0x0b81('0x44')](db[_0x0b81('0x67')][_0x0b81('0x3f')]);_0x1042e9[_0x0b81('0x43')]=_[_0x0b81('0x44')](_0x59de52[_0x0b81('0x43')]);_0x1042e9[_0x0b81('0x4f')]=_[_0x0b81('0x45')](_0x1042e9['model'],_0x1042e9[_0x0b81('0x43')]);_0x4470d4[_0x0b81('0x46')]=_['intersection'](_0x1042e9['model'],qs['fields'](_0x59de52[_0x0b81('0x43')][_0x0b81('0x59')]));_0x4470d4[_0x0b81('0x46')]=_0x4470d4[_0x0b81('0x46')][_0x0b81('0x48')]?_0x4470d4['attributes']:_0x1042e9[_0x0b81('0x47')];if(!_0x59de52[_0x0b81('0x43')][_0x0b81('0x49')](_0x0b81('0x4a'))){_0x4470d4['limit']=qs['limit'](_0x59de52[_0x0b81('0x43')][_0x0b81('0x4b')]);_0x4470d4['offset']=qs[_0x0b81('0x2f')](_0x59de52['query'][_0x0b81('0x2f')]);}_0x4470d4[_0x0b81('0x4c')]=qs['sort'](_0x59de52[_0x0b81('0x43')][_0x0b81('0x4d')]);_0x4470d4[_0x0b81('0x4e')]=qs[_0x0b81('0x4f')](_[_0x0b81('0x50')](_0x59de52['query'],_0x1042e9[_0x0b81('0x4f')]));_0x4470d4['where']['FaxAccountId']=_0x5ee008['id'];if(_0x59de52[_0x0b81('0x43')][_0x0b81('0x51')]){_0x4470d4[_0x0b81('0x4e')]=_[_0x0b81('0x52')](_0x4470d4['where'],{'$or':_[_0x0b81('0x3e')](_0x4470d4[_0x0b81('0x46')],function(_0x1eb3c){var _0x123aa6={};_0x123aa6[_0x1eb3c]={'$like':'%'+_0x59de52[_0x0b81('0x43')][_0x0b81('0x51')]+'%'};return _0x123aa6;})});}_0x4470d4=_['merge']({},_0x4470d4,_0x59de52[_0x0b81('0x5a')]);return db[_0x0b81('0x67')][_0x0b81('0x31')]({'where':_0x4470d4[_0x0b81('0x4e')]})['then'](function(_0x5efc4b){_0x3c4a12[_0x0b81('0x31')]=_0x5efc4b;if(_0x59de52['query'][_0x0b81('0x54')]){_0x4470d4['include']=[{'all':!![]}];}return db[_0x0b81('0x67')][_0x0b81('0x56')](_0x4470d4);})[_0x0b81('0x21')](function(_0x12d8fb){_0x3c4a12[_0x0b81('0x6a')]=_0x12d8fb;return _0x3c4a12;});}})[_0x0b81('0x21')](respondWithFilteredResult(_0x2c2529,_0x4470d4))[_0x0b81('0x2a')](handleError(_0x2c2529,null));};exports['removeDispositions']=function(_0x59adfa,_0x45db0b,_0x521c62){return db[_0x0b81('0x53')][_0x0b81('0x5b')]({'where':{'id':_0x59adfa[_0x0b81('0x57')]['id']}})[_0x0b81('0x21')](handleEntityNotFound(_0x45db0b,null))[_0x0b81('0x21')](function(_0x282e3d){if(_0x282e3d){return _0x282e3d[_0x0b81('0x6b')](_0x59adfa['query'][_0x0b81('0x6c')]);}})[_0x0b81('0x21')](respondWithStatusCode(_0x45db0b,null))[_0x0b81('0x2a')](handleError(_0x45db0b,null));};exports['addAnswer']=function(_0x19ab82,_0x1c7721,_0xb092f1){if(_0x19ab82[_0x0b81('0x63')]['id']){delete _0x19ab82['body']['id'];}return db['FaxAccount'][_0x0b81('0x5b')]({'where':{'id':_0x19ab82['params']['id']}})[_0x0b81('0x21')](handleEntityNotFound(_0x1c7721,null))[_0x0b81('0x21')](function(_0x326aa6){if(_0x326aa6){_0x19ab82[_0x0b81('0x63')][_0x0b81('0x66')]=_0x326aa6['id'];return db['CannedAnswer']['create'](_0x19ab82[_0x0b81('0x63')]);}})[_0x0b81('0x21')](respondWithResult(_0x1c7721,null))[_0x0b81('0x2a')](handleError(_0x1c7721,null));};exports['getAnswers']=function(_0x481743,_0x25f151,_0x144731){var _0x1a55c1={'raw':![],'where':{}};var _0x1b135b={};var _0x1488eb={'count':0x0,'rows':[]};return db['FaxAccount'][_0x0b81('0x69')]({'where':{'id':_0x481743[_0x0b81('0x57')]['id']}})[_0x0b81('0x21')](handleEntityNotFound(_0x25f151,null))[_0x0b81('0x21')](function(_0x4d11c7){if(_0x4d11c7){_0x1b135b[_0x0b81('0x47')]=_[_0x0b81('0x44')](db[_0x0b81('0x6d')][_0x0b81('0x3f')]);_0x1b135b[_0x0b81('0x43')]=_['keys'](_0x481743[_0x0b81('0x43')]);_0x1b135b[_0x0b81('0x4f')]=_[_0x0b81('0x45')](_0x1b135b['model'],_0x1b135b['query']);_0x1a55c1[_0x0b81('0x46')]=_[_0x0b81('0x45')](_0x1b135b[_0x0b81('0x47')],qs[_0x0b81('0x59')](_0x481743[_0x0b81('0x43')][_0x0b81('0x59')]));_0x1a55c1[_0x0b81('0x46')]=_0x1a55c1['attributes'][_0x0b81('0x48')]?_0x1a55c1[_0x0b81('0x46')]:_0x1b135b[_0x0b81('0x47')];if(!_0x481743[_0x0b81('0x43')][_0x0b81('0x49')](_0x0b81('0x4a'))){_0x1a55c1[_0x0b81('0x4b')]=qs[_0x0b81('0x4b')](_0x481743[_0x0b81('0x43')][_0x0b81('0x4b')]);_0x1a55c1['offset']=qs[_0x0b81('0x2f')](_0x481743[_0x0b81('0x43')][_0x0b81('0x2f')]);}_0x1a55c1[_0x0b81('0x4c')]=qs[_0x0b81('0x4d')](_0x481743[_0x0b81('0x43')][_0x0b81('0x4d')]);_0x1a55c1[_0x0b81('0x4e')]=qs[_0x0b81('0x4f')](_['pick'](_0x481743[_0x0b81('0x43')],_0x1b135b[_0x0b81('0x4f')]));_0x1a55c1[_0x0b81('0x4e')][_0x0b81('0x66')]=_0x4d11c7['id'];if(_0x481743[_0x0b81('0x43')][_0x0b81('0x51')]){_0x1a55c1[_0x0b81('0x4e')]=_[_0x0b81('0x52')](_0x1a55c1[_0x0b81('0x4e')],{'$or':_[_0x0b81('0x3e')](_0x1a55c1[_0x0b81('0x46')],function(_0xd19fa1){var _0xecc664={};_0xecc664[_0xd19fa1]={'$like':'%'+_0x481743[_0x0b81('0x43')][_0x0b81('0x51')]+'%'};return _0xecc664;})});}_0x1a55c1=_[_0x0b81('0x52')]({},_0x1a55c1,_0x481743[_0x0b81('0x5a')]);return db[_0x0b81('0x6d')][_0x0b81('0x31')]({'where':_0x1a55c1[_0x0b81('0x4e')]})[_0x0b81('0x21')](function(_0x3e9e6b){_0x1488eb[_0x0b81('0x31')]=_0x3e9e6b;if(_0x481743['query']['includeAll']){_0x1a55c1[_0x0b81('0x55')]=[{'all':!![]}];}return db[_0x0b81('0x6d')][_0x0b81('0x56')](_0x1a55c1);})[_0x0b81('0x21')](function(_0x3c4e56){_0x1488eb[_0x0b81('0x6a')]=_0x3c4e56;return _0x1488eb;});}})[_0x0b81('0x21')](respondWithFilteredResult(_0x25f151,_0x1a55c1))[_0x0b81('0x2a')](handleError(_0x25f151,null));};exports[_0x0b81('0x6e')]=function(_0x4c088c,_0x27c329,_0x53ab0b){return db['FaxAccount'][_0x0b81('0x5b')]({'where':{'id':_0x4c088c[_0x0b81('0x57')]['id']}})['then'](handleEntityNotFound(_0x27c329,null))[_0x0b81('0x21')](function(_0x3745b6){if(_0x3745b6){return _0x3745b6[_0x0b81('0x6e')](_0x4c088c[_0x0b81('0x43')][_0x0b81('0x6c')]);}})['then'](respondWithStatusCode(_0x27c329,null))[_0x0b81('0x2a')](handleError(_0x27c329,null));};exports['addInteraction']=function(_0x2c0fca,_0x3b4d14,_0x5e02cc){return db[_0x0b81('0x6f')]['find']({'where':{'id':_0x2c0fca['params']['id']}})[_0x0b81('0x21')](handleEntityNotFound(_0x3b4d14,null))['then'](function(_0x3e929d){if(_0x3e929d){return _0x3e929d['addInteraction'](_0x2c0fca['body'][_0x0b81('0x6c')],_['omit'](_0x2c0fca['body'],['ids','id'])||{});}})[_0x0b81('0x21')](respondWithResult(_0x3b4d14,null))[_0x0b81('0x2a')](handleError(_0x3b4d14,null));};exports[_0x0b81('0x70')]=function(_0x4f445a,_0x3aea0e,_0x24e89b){var _0x404c8d={'raw':![],'where':{}};var _0x5f0da9={};var _0x28f69a={'count':0x0,'rows':[]};return db[_0x0b81('0x53')][_0x0b81('0x69')]({'where':{'id':_0x4f445a[_0x0b81('0x57')]['id']}})[_0x0b81('0x21')](handleEntityNotFound(_0x3aea0e,null))['then'](function(_0x3e7b53){if(_0x3e7b53){_0x5f0da9[_0x0b81('0x47')]=_[_0x0b81('0x44')](db['FaxInteraction']['rawAttributes']);_0x5f0da9[_0x0b81('0x43')]=_[_0x0b81('0x44')](_0x4f445a[_0x0b81('0x43')]);_0x5f0da9['filters']=_[_0x0b81('0x45')](_0x5f0da9[_0x0b81('0x47')],_0x5f0da9[_0x0b81('0x43')]);_0x404c8d[_0x0b81('0x46')]=_['intersection'](_0x5f0da9['model'],qs['fields'](_0x4f445a[_0x0b81('0x43')][_0x0b81('0x59')]));_0x404c8d[_0x0b81('0x46')]=_0x404c8d['attributes']['length']?_0x404c8d[_0x0b81('0x46')]:_0x5f0da9[_0x0b81('0x47')];if(!_0x4f445a[_0x0b81('0x43')]['hasOwnProperty'](_0x0b81('0x4a'))){_0x404c8d[_0x0b81('0x4b')]=qs[_0x0b81('0x4b')](_0x4f445a[_0x0b81('0x43')][_0x0b81('0x4b')]);_0x404c8d[_0x0b81('0x2f')]=qs[_0x0b81('0x2f')](_0x4f445a[_0x0b81('0x43')]['offset']);}_0x404c8d[_0x0b81('0x4c')]=qs[_0x0b81('0x4d')](_0x4f445a[_0x0b81('0x43')][_0x0b81('0x4d')]);_0x404c8d[_0x0b81('0x4e')]=qs[_0x0b81('0x4f')](_[_0x0b81('0x50')](_0x4f445a[_0x0b81('0x43')],_0x5f0da9[_0x0b81('0x4f')]));_0x404c8d[_0x0b81('0x4e')][_0x0b81('0x66')]=_0x3e7b53['id'];if(_0x4f445a[_0x0b81('0x43')]['filter']){_0x404c8d[_0x0b81('0x4e')]=_[_0x0b81('0x52')](_0x404c8d[_0x0b81('0x4e')],{'$or':_['map'](_0x404c8d[_0x0b81('0x46')],function(_0x4bbd26){var _0x1fc5eb={};_0x1fc5eb[_0x4bbd26]={'$like':'%'+_0x4f445a[_0x0b81('0x43')]['filter']+'%'};return _0x1fc5eb;})});}_0x404c8d=_[_0x0b81('0x52')]({},_0x404c8d,_0x4f445a[_0x0b81('0x5a')]);return db[_0x0b81('0x6f')][_0x0b81('0x31')]({'where':_0x404c8d['where']})[_0x0b81('0x21')](function(_0x4ce500){_0x28f69a[_0x0b81('0x31')]=_0x4ce500;if(_0x4f445a[_0x0b81('0x43')]['includeAll']){_0x404c8d[_0x0b81('0x55')]=[{'model':db['CmContact'],'as':_0x0b81('0x71'),'required':![]},{'model':db[_0x0b81('0x72')],'as':'Owner','attributes':[_0x0b81('0x3a'),_0x0b81('0x73'),'internal'],'required':![]},{'model':db[_0x0b81('0x74')],'as':_0x0b81('0x75'),'attributes':['id',_0x0b81('0x3a'),_0x0b81('0x76')],'where':_0x4f445a['query'][_0x0b81('0x77')]?{'id':_0x4f445a[_0x0b81('0x43')]['tag']}:undefined,'required':_0x4f445a[_0x0b81('0x43')][_0x0b81('0x77')]?!![]:![]}];}return db['FaxInteraction'][_0x0b81('0x56')](_0x404c8d);})[_0x0b81('0x21')](function(_0x60aceb){_0x28f69a[_0x0b81('0x6a')]=_0x60aceb;return _0x28f69a;});}})[_0x0b81('0x21')](respondWithFilteredResult(_0x3aea0e,_0x404c8d))['catch'](handleError(_0x3aea0e,null));};exports[_0x0b81('0x78')]=function(_0x2eafe8,_0x1a74c5){var _0x13b5c6=_0x2eafe8['params']['id'];var _0x5067de=_0x2eafe8['body'];var _0x5baf86=0xc8;var _0x1a7721=null;return db[_0x0b81('0x79')]['transaction']({'isolationLevel':db['sequelize'][_0x0b81('0x7a')][_0x0b81('0x7b')]['READ_COMMITTED']},function(_0x3a3351){return db[_0x0b81('0x53')][_0x0b81('0x69')]({'where':{'id':_0x13b5c6},'transaction':_0x3a3351})['then'](function(_0x1545b1){if(_0x1545b1){return db[_0x0b81('0x7c')][_0x0b81('0x39')]({'where':{'FaxAccountId':_0x13b5c6},'transaction':_0x3a3351})['then'](function(){var _0xe5e98a=_[_0x0b81('0x3e')](_0x5067de,function(_0x376ea4){_0x376ea4[_0x0b81('0x66')]=_0x13b5c6;return _0x376ea4;});return db[_0x0b81('0x7c')]['bulkCreate'](_0xe5e98a,{'transaction':_0x3a3351});});}else{_0x5baf86=0x194;_0x1a7721=[];}});})[_0x0b81('0x21')](function(){if(_0x5baf86!==0x194){return db[_0x0b81('0x7c')][_0x0b81('0x7d')]({'where':{'FaxAccountId':_0x13b5c6},'order':_0x0b81('0x7e')})[_0x0b81('0x21')](function(_0x1dadd0){_0x1a7721=_0x1dadd0;});}})['catch'](function(_0x14c669){_0x5baf86=0x1f4;logger[_0x0b81('0x27')](_0x14c669[_0x0b81('0x7f')]);if(_0x14c669[_0x0b81('0x3a')]){delete _0x14c669[_0x0b81('0x3a')];}_0x1a7721=_0x14c669;})['finally'](function(){if(_0x1a7721===null){_0x1a74c5[_0x0b81('0x2b')](_0x5baf86);}else{if(_0x5baf86===0x1f4){_0x1a74c5['status'](_0x5baf86)['send'](_0x1a7721);}else{_0x1a74c5['status'](_0x5baf86)['json'](_0x1a7721);}}});};exports[_0x0b81('0x80')]=function(_0x5785b4,_0x199266,_0x5eceaf){var _0xf15256={};var _0x3274c0={};var _0xad3eda;var _0x3ee16a;return db[_0x0b81('0x53')][_0x0b81('0x69')]({'where':{'id':_0x5785b4[_0x0b81('0x57')]['id']}})[_0x0b81('0x21')](handleEntityNotFound(_0x199266,null))['then'](function(_0x576645){if(_0x576645){_0xad3eda=_0x576645;_0x3274c0['model']=_[_0x0b81('0x44')](db['FaxApplication'][_0x0b81('0x3f')]);_0x3274c0[_0x0b81('0x43')]=_['keys'](_0x5785b4[_0x0b81('0x43')]);_0x3274c0[_0x0b81('0x4f')]=_[_0x0b81('0x45')](_0x3274c0[_0x0b81('0x47')],_0x3274c0[_0x0b81('0x43')]);_0xf15256[_0x0b81('0x46')]=_['intersection'](_0x3274c0[_0x0b81('0x47')],qs[_0x0b81('0x59')](_0x5785b4[_0x0b81('0x43')]['fields']));_0xf15256[_0x0b81('0x46')]=_0xf15256['attributes']['length']?_0xf15256[_0x0b81('0x46')]:_0x3274c0['model'];_0xf15256['order']=qs[_0x0b81('0x4d')](_0x5785b4['query'][_0x0b81('0x4d')]);_0xf15256[_0x0b81('0x4e')]=qs[_0x0b81('0x4f')](_[_0x0b81('0x50')](_0x5785b4[_0x0b81('0x43')],_0x3274c0[_0x0b81('0x4f')]));if(_0x5785b4[_0x0b81('0x43')]['filter']){_0xf15256['where']=_[_0x0b81('0x52')](_0xf15256[_0x0b81('0x4e')],{'$or':_['map'](_0xf15256['attributes'],function(_0xd225f1){var _0x20f98b={};_0x20f98b[_0xd225f1]={'$like':'%'+_0x5785b4[_0x0b81('0x43')][_0x0b81('0x51')]+'%'};return _0x20f98b;})});}_0xf15256=_[_0x0b81('0x52')]({},_0xf15256,_0x5785b4[_0x0b81('0x5a')]);return _0xad3eda[_0x0b81('0x80')](_0xf15256);}})[_0x0b81('0x21')](function(_0xbf2d47){if(_0xbf2d47){_0x3ee16a=_0xbf2d47[_0x0b81('0x48')];if(!_0x5785b4[_0x0b81('0x43')][_0x0b81('0x49')](_0x0b81('0x4a'))){_0xf15256['limit']=qs['limit'](_0x5785b4[_0x0b81('0x43')]['limit']);_0xf15256['offset']=qs[_0x0b81('0x2f')](_0x5785b4[_0x0b81('0x43')][_0x0b81('0x2f')]);}return _0xad3eda['getApplications'](_0xf15256);}})['then'](function(_0x53bcdf){if(_0x53bcdf){return _0x53bcdf?{'count':_0x3ee16a,'rows':_0x53bcdf}:null;}})[_0x0b81('0x21')](respondWithResult(_0x199266,null))[_0x0b81('0x2a')](handleError(_0x199266,null));};function Extension(_0x383efb,_0x1e5dea,_0x3481d5,_0x4261b4){this[_0x0b81('0x81')]='from-voip-provider';this['exten']=_0x383efb[_0x0b81('0x82')];this['app']=_0x4261b4;this['type']='system';this['description']=_0x0b81('0x83');this[_0x0b81('0x66')]=_0x383efb['id'];this[_0x0b81('0x7e')]=_0x1e5dea;this[_0x0b81('0x84')]=_0x3481d5;}function createExtensionsReciveFax(_0x254eb8){var _0x1ea1dc=0x1;var _0x5dbb10=[];_0x5dbb10[_0x0b81('0x85')](new Extension(_0x254eb8,_0x1ea1dc,'','Answer'));_0x1ea1dc+=0x1;_0x5dbb10['push'](new Extension(_0x254eb8,_0x1ea1dc,_0x0b81('0x86'),_0x0b81('0x87')));_0x1ea1dc+=0x1;for(var _0x244e96 in _0x254eb8){if(_0x254eb8[_0x0b81('0x49')](_0x244e96)&&(_0x244e96==='ecm'||_0x244e96==='localstationid'||_0x244e96===_0x0b81('0x88')||_0x244e96===_0x0b81('0x89')||_0x244e96===_0x0b81('0x8a')||_0x244e96===_0x0b81('0x8b')||_0x244e96==='minrate'||_0x244e96===_0x0b81('0x8c')||_0x244e96===_0x0b81('0x8d'))){_0x5dbb10[_0x0b81('0x85')](new Extension(_0x254eb8,_0x1ea1dc,_0x0b81('0x8e')+_0x244e96+')='+_0x254eb8[_0x244e96],_0x0b81('0x87')));_0x1ea1dc+=0x1;}}_0x5dbb10[_0x0b81('0x85')](new Extension(_0x254eb8,_0x1ea1dc,'6',_0x0b81('0x8f')));_0x1ea1dc+=0x1;_0x5dbb10['push'](new Extension(_0x254eb8,_0x1ea1dc,_0x0b81('0x90'),_0x0b81('0x91')));_0x1ea1dc=0x0;return _0x5dbb10;}exports[_0x0b81('0x92')]=function(_0x4a8fc7,_0x32761d,_0xe23bc9){var _0x70ab49;return db[_0x0b81('0x79')][_0x0b81('0x93')](function(_0x2536e2){return db[_0x0b81('0x53')][_0x0b81('0x5c')](_0x4a8fc7[_0x0b81('0x63')],{'transaction':_0x2536e2})['then'](function(_0x5b36d3){_0x70ab49=_0x5b36d3[_0x0b81('0x36')]({'plain':!![]});return db[_0x0b81('0x94')][_0x0b81('0x95')](createExtensionsReciveFax(_0x70ab49),{'transaction':_0x2536e2});});})['then'](function(){return _0x70ab49;})['then'](respondWithResult(_0x32761d,null))[_0x0b81('0x2a')](handleError(_0x32761d,null));};exports[_0x0b81('0x96')]=function(_0x2c5fa5,_0x352aab,_0x20a205){var _0x52678e;return db[_0x0b81('0x79')][_0x0b81('0x93')](function(_0x434253){return db[_0x0b81('0x53')][_0x0b81('0x62')](_0x2c5fa5[_0x0b81('0x63')],{'where':{'id':_0x2c5fa5['body']['id']},'transaction':_0x434253})[_0x0b81('0x21')](function(_0x412ced){return db[_0x0b81('0x94')][_0x0b81('0x39')]({'where':{'FaxAccountId':_0x2c5fa5['body']['id']},'transaction':_0x434253})[_0x0b81('0x21')](function(_0x1412d8){return db[_0x0b81('0x94')][_0x0b81('0x95')](createExtensionsReciveFax(_['omit'](_0x2c5fa5[_0x0b81('0x63')],['tech',_0x0b81('0x42'),_0x0b81('0x97'),_0x0b81('0x98'),_0x0b81('0x99'),'ListId'])),{'transaction':_0x434253});});});})['then'](function(){return db[_0x0b81('0x53')][_0x0b81('0x9a')](_0x2c5fa5['body']['id']);})[_0x0b81('0x21')](respondWithResult(_0x352aab,null))[_0x0b81('0x2a')](handleError(_0x352aab,null));};exports[_0x0b81('0x9b')]=function(_0x347088,_0x1e8e6e,_0x4d004d){var _0x5ebb9d={'raw':!![],'where':{}};var _0x13ab68={};var _0x264e87={'count':0x0,'rows':[]};return db[_0x0b81('0x53')]['findOne']({'where':{'id':_0x347088[_0x0b81('0x57')]['id']}})['then'](handleEntityNotFound(_0x1e8e6e,null))[_0x0b81('0x21')](function(_0x483483){if(_0x483483){_0x13ab68[_0x0b81('0x47')]=_[_0x0b81('0x44')](db[_0x0b81('0x9c')][_0x0b81('0x3f')]);_0x13ab68[_0x0b81('0x43')]=_[_0x0b81('0x44')](_0x347088[_0x0b81('0x43')]);_0x13ab68[_0x0b81('0x4f')]=_['intersection'](_0x13ab68[_0x0b81('0x47')],_0x13ab68[_0x0b81('0x43')]);_0x5ebb9d['attributes']=_[_0x0b81('0x45')](_0x13ab68[_0x0b81('0x47')],qs['fields'](_0x347088['query']['fields']));_0x5ebb9d[_0x0b81('0x46')]=_0x5ebb9d[_0x0b81('0x46')]['length']?_0x5ebb9d[_0x0b81('0x46')]:_0x13ab68['model'];if(!_0x347088[_0x0b81('0x43')][_0x0b81('0x49')](_0x0b81('0x4a'))){_0x5ebb9d[_0x0b81('0x4b')]=qs['limit'](_0x347088[_0x0b81('0x43')][_0x0b81('0x4b')]);_0x5ebb9d[_0x0b81('0x2f')]=qs[_0x0b81('0x2f')](_0x347088[_0x0b81('0x43')][_0x0b81('0x2f')]);}_0x5ebb9d[_0x0b81('0x4c')]=qs[_0x0b81('0x4d')](_0x347088[_0x0b81('0x43')][_0x0b81('0x4d')]);_0x5ebb9d[_0x0b81('0x4e')]=qs[_0x0b81('0x4f')](_[_0x0b81('0x50')](_0x347088[_0x0b81('0x43')],_0x13ab68['filters']));_0x5ebb9d[_0x0b81('0x4e')]['FaxAccountId']=_0x483483['id'];if(_0x347088[_0x0b81('0x43')][_0x0b81('0x51')]){_0x5ebb9d['where']=_['merge'](_0x5ebb9d['where'],{'$or':_[_0x0b81('0x3e')](_0x5ebb9d[_0x0b81('0x46')],function(_0x1816b2){var _0x4fbb1f={};_0x4fbb1f[_0x1816b2]={'$like':'%'+_0x347088['query']['filter']+'%'};return _0x4fbb1f;})});}if(_0x347088[_0x0b81('0x43')][_0x0b81('0x9d')]){var _0x466f43=_0x347088[_0x0b81('0x43')][_0x0b81('0x9d')][_0x0b81('0x9e')](',');var _0x30b59e={};_0x30b59e[_0x466f43[0x0]]={'$gte':moment(_0x466f43[0x1])['format'](_0x0b81('0x9f'))};_0x5ebb9d[_0x0b81('0x4e')]=_[_0x0b81('0x52')](_0x5ebb9d['where'],_0x30b59e);}_0x5ebb9d=_[_0x0b81('0x52')]({},_0x5ebb9d,_0x347088[_0x0b81('0x5a')]);return db['FaxMessage'][_0x0b81('0x31')]({'where':_0x5ebb9d[_0x0b81('0x4e')]})[_0x0b81('0x21')](function(_0x96603){_0x264e87['count']=_0x96603;if(_0x347088[_0x0b81('0x43')]['includeAll']){_0x5ebb9d[_0x0b81('0x55')]=[{'all':!![]}];}return db['FaxMessage'][_0x0b81('0x56')](_0x5ebb9d);})[_0x0b81('0x21')](function(_0x54055b){_0x264e87[_0x0b81('0x6a')]=_0x54055b;return _0x264e87;});}})[_0x0b81('0x21')](respondWithFilteredResult(_0x1e8e6e,_0x5ebb9d))[_0x0b81('0x2a')](handleError(_0x1e8e6e,null));};exports['send']=function(_0x266524,_0x3f2cc2,_0x1b4b4a){var _0x413888,_0x46235a={},_0x22c0cd;if(_0x266524[_0x0b81('0x63')]['to']){_0x22c0cd=_0x266524[_0x0b81('0x63')]['to'][0x0];}return db['FaxAccount']['find']({'where':{'id':_0x266524[_0x0b81('0x57')]['id']},'include':[{'model':db[_0x0b81('0xa0')],'as':_0x0b81('0xa1'),'include':[{'model':db[_0x0b81('0xa2')],'as':_0x0b81('0xa3'),'where':{'fax':_0x22c0cd},'limit':0x1,'order':[[_0x0b81('0x98'),'DESC']]}]}]})[_0x0b81('0x21')](handleEntityNotFound(_0x3f2cc2,null))[_0x0b81('0x21')](function(_0x3446bb){_0x413888=_0x3446bb;if(_0x266524[_0x0b81('0x63')]['attachments']&&_0x266524[_0x0b81('0x63')][_0x0b81('0xa4')][_0x0b81('0x48')]){for(var _0x13ea86=0x0;_0x13ea86<_0x266524[_0x0b81('0x63')][_0x0b81('0xa4')][_0x0b81('0x48')];_0x13ea86+=0x1){_0x266524['body']['attachments'][_0x13ea86]={'filename':_0x266524['body'][_0x0b81('0xa4')][_0x13ea86][_0x0b81('0x3a')],'id':_0x266524[_0x0b81('0x63')][_0x0b81('0xa4')][_0x13ea86]['id'],'path':path[_0x0b81('0xa5')](config[_0x0b81('0xa6')],_0x0b81('0xa7'),_0x266524['body']['attachments'][_0x13ea86][_0x0b81('0xa8')])};}}return respondWithRpcPromise('CheckAfterSend',_0x0b81('0xa9'),{'FaxAccountId':_[_0x0b81('0xaa')](_0x266524[_0x0b81('0x57')]['id'])?undefined:_0x266524[_0x0b81('0x57')]['id'],'path':_[_0x0b81('0xaa')](_0x266524[_0x0b81('0x63')][_0x0b81('0xa4')][0x0][_0x0b81('0x8')])?undefined:_0x266524[_0x0b81('0x63')]['attachments'][0x0][_0x0b81('0x8')],'fax':_[_0x0b81('0xaa')](_0x266524[_0x0b81('0x63')]['to'][0x0])?undefined:_0x266524[_0x0b81('0x63')]['to'][0x0]},client9002);})['then'](function(){if(_0x413888){if(_[_0x0b81('0xaa')](_0x266524[_0x0b81('0x63')][_0x0b81('0xab')])){_0x266524['body'][_0x0b81('0xab')]=util['format'](_0x0b81('0xac'),_0x413888[_0x0b81('0x3a')],_0x413888['fax']);}if(_0x413888[_0x0b81('0xa1')]){if(_0x413888[_0x0b81('0xa1')][_0x0b81('0xa3')]['length']){return _0x413888[_0x0b81('0xa1')]['Contacts'][0x0];}else{return db[_0x0b81('0xa2')][_0x0b81('0x5c')](_[_0x0b81('0xad')](_0x266524[_0x0b81('0x63')],{'firstName':_0x266524[_0x0b81('0x63')]['to'][0x0],'phone':_0x266524['body']['to'][0x0],'fax':_0x266524[_0x0b81('0x63')]['to'][0x0],'ListId':_0x413888[_0x0b81('0xae')]}));}}else{throw new Error('List\x20not\x20found');}}else{throw new Error(_0x0b81('0xaf'));}})['then'](function(_0x3911ce){if(_0x3911ce){return db[_0x0b81('0x6f')][_0x0b81('0x5b')]({'where':{'ContactId':_0x3911ce['id'],'closed':![],'FaxAccountId':_0x413888['id']}})[_0x0b81('0x21')](function(_0x4859cb){if(_0x4859cb){return[_0x4859cb,![]];}return db[_0x0b81('0x6f')]['create']({'UserId':_0x266524[_0x0b81('0x5f')]['id'],'ContactId':_0x3911ce['id'],'FaxAccountId':_0x413888['id'],'fax':_0x266524['body']['to'][0x0],'firstMsgDirection':_0x0b81('0xb0'),'Messages':[_[_0x0b81('0x52')](_0x266524[_0x0b81('0x63')],{'read':![],'body':_0x266524[_0x0b81('0x63')][_0x0b81('0xa4')][0x0][_0x0b81('0xb1')],'FaxAccountId':_0x413888['id'],'UserId':_0x266524[_0x0b81('0x5f')]['id'],'ContactId':_0x3911ce['id'],'AttachmentId':_0x266524[_0x0b81('0x63')]['attachments'][0x0]['id']})]},{'include':[{'model':db[_0x0b81('0x9c')],'as':_0x0b81('0xb2')}]})[_0x0b81('0x21')](function(_0x2a11fa){return[_0x2a11fa,!![]];});});}else{throw new Error(_0x0b81('0xb3'));}})[_0x0b81('0xb4')](function(_0x5c3ed7,_0x373315){if(_0x373315){return _0x5c3ed7;}return db[_0x0b81('0x9c')][_0x0b81('0x5c')]({'direction':_0x0b81('0xb0'),'read':![],'body':_0x266524[_0x0b81('0x63')][_0x0b81('0xa4')][0x0][_0x0b81('0xb1')],'FaxAccountId':_0x413888['id'],'FaxInteractionId':_0x5c3ed7['id'],'UserId':_0x266524['user']['id'],'ContactId':_0x5c3ed7['ContactId'],'AttachmentId':_0x266524[_0x0b81('0x63')][_0x0b81('0xa4')][0x0]['id']})[_0x0b81('0x21')](function(_0x24314f){_0x5c3ed7[_0x0b81('0xb5')][_0x0b81('0xb2')]=[];_0x5c3ed7['dataValues'][_0x0b81('0xb2')]['push'](_0x24314f['dataValues']);return _0x5c3ed7;});})[_0x0b81('0x21')](function(_0x1c5e5f){respondWithRpcPromise(_0x0b81('0xb6'),_0x0b81('0xb6'),{'FaxAccountId':_[_0x0b81('0xaa')](_0x266524[_0x0b81('0x57')]['id'])?undefined:_0x266524[_0x0b81('0x57')]['id'],'path':_[_0x0b81('0xaa')](_0x266524[_0x0b81('0x63')]['attachments'][0x0][_0x0b81('0x8')])?undefined:_0x266524[_0x0b81('0x63')][_0x0b81('0xa4')][0x0][_0x0b81('0x8')],'fax':_['isNil'](_0x266524['body']['to'][0x0])?undefined:_0x266524[_0x0b81('0x63')]['to'][0x0],'AttachmentId':_0x266524[_0x0b81('0x63')][_0x0b81('0xa4')][0x0]['id']},client9002)['then'](function(_0x2ae04a){logger['info'](_0x0b81('0xb7'),_0x2ae04a);})['catch'](function(_0x1c0b07){logger[_0x0b81('0xb8')]('SendFaxRpc,\x20%s',_0x1c0b07);});return _0x1c5e5f;})[_0x0b81('0x21')](respondWithResult(_0x3f2cc2,null))[_0x0b81('0x2a')](handleError(_0x3f2cc2,null));};exports[_0x0b81('0xb9')]=function(_0x48d377,_0x347f5a,_0x49ffc8){return db['FaxAccount'][_0x0b81('0x5b')]({'where':{'id':_0x48d377[_0x0b81('0x57')]['id']}})[_0x0b81('0x21')](handleEntityNotFound(_0x347f5a,null))[_0x0b81('0x21')](function(_0x4b42b5){if(_0x4b42b5){return _0x4b42b5['addAgents'](_0x48d377[_0x0b81('0x63')][_0x0b81('0x6c')],_[_0x0b81('0xba')](_0x48d377[_0x0b81('0x63')],['ids','id'])||{})['spread'](function(_0x21144c){for(var _0x2ab775=0x0;_0x2ab775<_0x48d377[_0x0b81('0x63')][_0x0b81('0x6c')][_0x0b81('0x48')];_0x2ab775+=0x1){socket['emit'](_0x0b81('0xbb'),{'UserId':Number(_0x48d377[_0x0b81('0x63')][_0x0b81('0x6c')][_0x2ab775]),'FaxAccountId':Number(_0x48d377['params']['id'])});}return _0x21144c;});}})['then'](respondWithResult(_0x347f5a,null))[_0x0b81('0x2a')](handleError(_0x347f5a,null));};exports[_0x0b81('0xbc')]=function(_0x5af520,_0x45d555,_0x4be5b1){return db['FaxAccount'][_0x0b81('0x5b')]({'where':{'id':_0x5af520[_0x0b81('0x57')]['id']}})[_0x0b81('0x21')](handleEntityNotFound(_0x45d555,null))[_0x0b81('0x21')](function(_0x18469b){if(_0x18469b){return _0x18469b[_0x0b81('0xbc')](_0x5af520[_0x0b81('0x43')][_0x0b81('0x6c')])['then'](function(){if(_['isArray'](_0x5af520[_0x0b81('0x43')][_0x0b81('0x6c')])){for(var _0x2a4de8=0x0;_0x2a4de8<_0x5af520[_0x0b81('0x43')][_0x0b81('0x6c')]['length'];_0x2a4de8+=0x1){socket['emit'](_0x0b81('0xbd'),{'UserId':Number(_0x5af520[_0x0b81('0x43')][_0x0b81('0x6c')][_0x2a4de8]),'FaxAccountId':Number(_0x5af520[_0x0b81('0x57')]['id'])});}}else{socket['emit']('userFaxAccount:remove',{'UserId':Number(_0x5af520[_0x0b81('0x43')]['ids']),'FaxAccountId':Number(_0x5af520[_0x0b81('0x57')]['id'])});}});}})[_0x0b81('0x21')](respondWithStatusCode(_0x45d555,null))[_0x0b81('0x2a')](handleError(_0x45d555,null));};exports['getAgents']=function(_0x1e6583,_0x2c6870,_0x291079){var _0x77c81f={};var _0xc97583={};var _0x11dc2c;var _0x4c87aa;return db[_0x0b81('0x53')][_0x0b81('0x69')]({'where':{'id':_0x1e6583[_0x0b81('0x57')]['id']}})[_0x0b81('0x21')](handleEntityNotFound(_0x2c6870,null))[_0x0b81('0x21')](function(_0x3aa7ec){if(_0x3aa7ec){_0x11dc2c=_0x3aa7ec;_0xc97583[_0x0b81('0x47')]=_[_0x0b81('0x44')](db[_0x0b81('0x72')][_0x0b81('0x3f')]);_0xc97583[_0x0b81('0x43')]=_['keys'](_0x1e6583[_0x0b81('0x43')]);_0xc97583[_0x0b81('0x4f')]=_['intersection'](_0xc97583[_0x0b81('0x47')],_0xc97583[_0x0b81('0x43')]);_0x77c81f['attributes']=_[_0x0b81('0x45')](_0xc97583[_0x0b81('0x47')],qs[_0x0b81('0x59')](_0x1e6583['query'][_0x0b81('0x59')]));_0x77c81f[_0x0b81('0x46')]=_0x77c81f[_0x0b81('0x46')][_0x0b81('0x48')]?_0x77c81f[_0x0b81('0x46')]:_0xc97583[_0x0b81('0x47')];_0x77c81f[_0x0b81('0x4c')]=qs[_0x0b81('0x4d')](_0x1e6583[_0x0b81('0x43')]['sort']);_0x77c81f[_0x0b81('0x4e')]=qs[_0x0b81('0x4f')](_[_0x0b81('0x50')](_0x1e6583[_0x0b81('0x43')],_0xc97583[_0x0b81('0x4f')]));if(_0x1e6583[_0x0b81('0x43')]['filter']){_0x77c81f['where']=_[_0x0b81('0x52')](_0x77c81f[_0x0b81('0x4e')],{'$or':_['map'](_0x77c81f[_0x0b81('0x46')],function(_0x48187a){var _0x5c64ce={};_0x5c64ce[_0x48187a]={'$like':'%'+_0x1e6583['query'][_0x0b81('0x51')]+'%'};return _0x5c64ce;})});}_0x77c81f=_[_0x0b81('0x52')]({},_0x77c81f,_0x1e6583[_0x0b81('0x5a')]);return _0x11dc2c['getAgents'](_0x77c81f);}})[_0x0b81('0x21')](function(_0x3f8003){if(_0x3f8003){_0x4c87aa=_0x3f8003[_0x0b81('0x48')];if(!_0x1e6583[_0x0b81('0x43')][_0x0b81('0x49')](_0x0b81('0x4a'))){_0x77c81f[_0x0b81('0x4b')]=qs[_0x0b81('0x4b')](_0x1e6583[_0x0b81('0x43')][_0x0b81('0x4b')]);_0x77c81f[_0x0b81('0x2f')]=qs[_0x0b81('0x2f')](_0x1e6583['query'][_0x0b81('0x2f')]);}return _0x11dc2c[_0x0b81('0xbe')](_0x77c81f);}})['then'](function(_0x4db0c5){if(_0x4db0c5){return _0x4db0c5?{'count':_0x4c87aa,'rows':_0x4db0c5}:null;}})['then'](respondWithResult(_0x2c6870,null))[_0x0b81('0x2a')](handleError(_0x2c6870,null));};
\ No newline at end of file
+var _0xbc88=['appdata','Answer','push','CDR(type)=inbound-fax','Set','ecm','gateway','headerinfo','maxrate','minrate','t38timeout','FAXOPT(','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','addAccountApplications','VoiceExtension','updateAccountApplications','tech','createdAt','updatedAt','ListId','getMessages','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','List','Contacts','attachments','root','basename','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','List\x20not\x20found','out','Messages','Contact\x20not\x20found','spread','filename','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./faxAccount.socket','client','http','request','then','info','FaxAccount,\x20%s,\x20%s','debug','FaxAccount,\x20%s,\x20%s,\x20%s','error','message','request\x20sent','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','update','destroy','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','type','key','model','map','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','VIRTUAL','merge','FaxAccount','include','rows','rawAttributes','includeAll','options','find','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','FaxAccounts','userProfileId','autoAssociation','params','describe','addDisposition','Disposition','getDispositions','findOne','FaxAccountId','filter','findAll','removeDispositions','ids','CannedAnswer','create','getAnswers','removeAnswers','addInteraction','omit','getInteractions','FaxInteraction','hasOwnProperty','CmContact','Contact','User','internal','Tag','Tags','color','tag','addApplications','transaction','sequelize','ISOLATION_LEVELS','READ_COMMITTED','FaxApplication','bulkCreate','findAndCountAll','priority','getApplications','localstationid','app','system','Fax\x20Extension'];(function(_0xd688ab,_0x6eb877){var _0x188138=function(_0x3acc5b){while(--_0x3acc5b){_0xd688ab['push'](_0xd688ab['shift']());}};_0x188138(++_0x6eb877);}(_0xbc88,0xf3));var _0x8bc8=function(_0x1fb0f9,_0x55f4e1){_0x1fb0f9=_0x1fb0f9-0x0;var _0x318ee0=_0xbc88[_0x1fb0f9];return _0x318ee0;};'use strict';var emlformat=require(_0x8bc8('0x0'));var rimraf=require(_0x8bc8('0x1'));var zipdir=require(_0x8bc8('0x2'));var jsonpatch=require(_0x8bc8('0x3'));var rp=require(_0x8bc8('0x4'));var moment=require(_0x8bc8('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x8bc8('0x6'));var util=require(_0x8bc8('0x7'));var path=require(_0x8bc8('0x8'));var sox=require(_0x8bc8('0x9'));var csv=require(_0x8bc8('0xa'));var ejs=require(_0x8bc8('0xb'));var fs=require('fs');var fs_extra=require(_0x8bc8('0xc'));var _=require(_0x8bc8('0xd'));var squel=require('squel');var crypto=require(_0x8bc8('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x8bc8('0xf'));var toCsv=require(_0x8bc8('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x8bc8('0x10'));var hardwareService=require(_0x8bc8('0x11'));var logger=require('../../config/logger')(_0x8bc8('0x12'));var utils=require(_0x8bc8('0x13'));var config=require(_0x8bc8('0x14'));var licenseUtil=require(_0x8bc8('0x15'));var db=require(_0x8bc8('0x16'))['db'];config[_0x8bc8('0x17')]=_[_0x8bc8('0x18')](config[_0x8bc8('0x17')],{'host':_0x8bc8('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x8bc8('0x1a'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x8bc8('0x1b')][_0x8bc8('0x1c')]({'port':0x232c});var client9002=jayson[_0x8bc8('0x1b')][_0x8bc8('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x16ac11,_0x4712b0,_0x37a0e0,_0x4491b7){return new BPromise(function(_0x4ea473,_0x18c802){var _0x5279f0=_0x4491b7||client;return _0x5279f0[_0x8bc8('0x1d')](_0x16ac11,_0x37a0e0)[_0x8bc8('0x1e')](function(_0xfdadf8){logger[_0x8bc8('0x1f')](_0x8bc8('0x20'),_0x4712b0,'request\x20sent');logger[_0x8bc8('0x21')](_0x8bc8('0x22'),_0x4712b0,'request\x20sent',JSON['stringify'](_0xfdadf8));if(_0xfdadf8[_0x8bc8('0x23')]){if(_0xfdadf8['error']['code']===0x1f4){logger['error'](_0x8bc8('0x20'),_0x4712b0,_0xfdadf8['error'][_0x8bc8('0x24')]);return _0x18c802(_0xfdadf8[_0x8bc8('0x23')][_0x8bc8('0x24')]);}logger[_0x8bc8('0x23')](_0x8bc8('0x20'),_0x4712b0,_0xfdadf8[_0x8bc8('0x23')][_0x8bc8('0x24')]);return _0x4ea473(_0xfdadf8['error'][_0x8bc8('0x24')]);}else{logger[_0x8bc8('0x1f')](_0x8bc8('0x20'),_0x4712b0,_0x8bc8('0x25'));_0x4ea473(_0xfdadf8[_0x8bc8('0x26')]['message']);}})[_0x8bc8('0x27')](function(_0x4562b0){logger[_0x8bc8('0x23')](_0x8bc8('0x20'),_0x4712b0,_0x4562b0);_0x18c802(_0x4562b0);});});}function respondWithStatusCode(_0x53e9e7,_0x319c60){_0x319c60=_0x319c60||0xcc;return function(_0x528aa9){if(_0x528aa9){return _0x53e9e7[_0x8bc8('0x28')](_0x319c60);}return _0x53e9e7[_0x8bc8('0x29')](_0x319c60)[_0x8bc8('0x2a')]();};}function respondWithResult(_0x11d829,_0x5ce0de){_0x5ce0de=_0x5ce0de||0xc8;return function(_0x5b3422){if(_0x5b3422){return _0x11d829['status'](_0x5ce0de)[_0x8bc8('0x2b')](_0x5b3422);}};}function respondWithFilteredResult(_0x5c59bb,_0x4ebfad){return function(_0x22f744){if(_0x22f744){var _0x27a588=typeof _0x4ebfad[_0x8bc8('0x2c')]===_0x8bc8('0x2d')&&typeof _0x4ebfad[_0x8bc8('0x2e')]===_0x8bc8('0x2d');var _0xf06044=_0x22f744[_0x8bc8('0x2f')];var _0x41bb5f=_0x27a588?0x0:_0x4ebfad[_0x8bc8('0x2c')];var _0xd8d7df=_0x27a588?_0x22f744[_0x8bc8('0x2f')]:_0x4ebfad[_0x8bc8('0x2c')]+_0x4ebfad[_0x8bc8('0x2e')];var _0x523007;if(_0xd8d7df>=_0xf06044){_0xd8d7df=_0xf06044;_0x523007=0xc8;}else{_0x523007=0xce;}_0x5c59bb[_0x8bc8('0x29')](_0x523007);return _0x5c59bb['set']('Content-Range',_0x41bb5f+'-'+_0xd8d7df+'/'+_0xf06044)[_0x8bc8('0x2b')](_0x22f744);}return null;};}function patchUpdates(_0x34a563){return function(_0xd6d815){try{jsonpatch[_0x8bc8('0x30')](_0xd6d815,_0x34a563,!![]);}catch(_0xff6656){return BPromise[_0x8bc8('0x31')](_0xff6656);}return _0xd6d815[_0x8bc8('0x32')]();};}function saveUpdates(_0x459190,_0x37b962){return function(_0x524217){if(_0x524217){return _0x524217[_0x8bc8('0x33')](_0x459190)[_0x8bc8('0x1e')](function(_0x33fc55){return _0x33fc55;});}return null;};}function removeEntity(_0x1e349f,_0x253b5f){return function(_0x2c6176){if(_0x2c6176){return _0x2c6176[_0x8bc8('0x34')]()['then'](function(){var _0x5197e6=_0x2c6176['get']({'plain':!![]});var _0x1a5fc1='FaxAccounts';return db[_0x8bc8('0x35')]['destroy']({'where':{'type':_0x1a5fc1,'resourceId':_0x5197e6['id']}})[_0x8bc8('0x1e')](function(){return _0x2c6176;});})[_0x8bc8('0x1e')](function(){_0x1e349f[_0x8bc8('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe8c210,_0x4c181f){return function(_0x1f3ac8){if(!_0x1f3ac8){_0xe8c210['sendStatus'](0x194);}return _0x1f3ac8;};}function handleError(_0x1c83df,_0x4ab9ca){_0x4ab9ca=_0x4ab9ca||0x1f4;return function(_0x40fe96){logger[_0x8bc8('0x23')](_0x40fe96[_0x8bc8('0x36')]);if(_0x40fe96['name']){delete _0x40fe96[_0x8bc8('0x37')];}_0x1c83df[_0x8bc8('0x29')](_0x4ab9ca)[_0x8bc8('0x38')](_0x40fe96);};}exports[_0x8bc8('0x39')]=function(_0x273069,_0x5cbaef){var _0x19d48a={'include':[{'model':db[_0x8bc8('0x3a')],'as':_0x8bc8('0x3b')}]},_0x27b70a={},_0x3ba218={'count':0x0,'rows':[]};var _0x4b0d9c=_['map'](db['FaxAccount']['rawAttributes'],function(_0x4eb7e5){return{'name':_0x4eb7e5['fieldName'],'type':_0x4eb7e5[_0x8bc8('0x3c')][_0x8bc8('0x3d')]};});_0x27b70a[_0x8bc8('0x3e')]=_[_0x8bc8('0x3f')](_0x4b0d9c,_0x8bc8('0x37'));_0x27b70a[_0x8bc8('0x40')]=_[_0x8bc8('0x41')](_0x273069['query']);_0x27b70a['filters']=_[_0x8bc8('0x42')](_0x27b70a[_0x8bc8('0x3e')],_0x27b70a[_0x8bc8('0x40')]);_0x19d48a[_0x8bc8('0x43')]=_[_0x8bc8('0x42')](_0x27b70a['model'],qs[_0x8bc8('0x44')](_0x273069[_0x8bc8('0x40')]['fields']));_0x19d48a['attributes']=_0x19d48a['attributes'][_0x8bc8('0x45')]?_0x19d48a[_0x8bc8('0x43')]:_0x27b70a[_0x8bc8('0x3e')];if(!_0x273069[_0x8bc8('0x40')]['hasOwnProperty'](_0x8bc8('0x46'))){_0x19d48a['limit']=qs[_0x8bc8('0x2e')](_0x273069['query'][_0x8bc8('0x2e')]);_0x19d48a['offset']=qs[_0x8bc8('0x2c')](_0x273069[_0x8bc8('0x40')][_0x8bc8('0x2c')]);}_0x19d48a[_0x8bc8('0x47')]=qs['sort'](_0x273069[_0x8bc8('0x40')][_0x8bc8('0x48')]);_0x19d48a[_0x8bc8('0x49')]=qs[_0x8bc8('0x4a')](_[_0x8bc8('0x4b')](_0x273069[_0x8bc8('0x40')],_0x27b70a[_0x8bc8('0x4a')]),_0x4b0d9c);if(_0x273069[_0x8bc8('0x40')]['filter']){_0x19d48a[_0x8bc8('0x49')]=_['merge'](_0x19d48a[_0x8bc8('0x49')],{'$or':_[_0x8bc8('0x3f')](_0x4b0d9c,function(_0x5e31b3){if(_0x5e31b3[_0x8bc8('0x3c')]!==_0x8bc8('0x4c')){var _0x268d31={};_0x268d31[_0x5e31b3[_0x8bc8('0x37')]]={'$like':'%'+_0x273069['query']['filter']+'%'};return _0x268d31;}})});}_0x19d48a=_[_0x8bc8('0x4d')]({},_0x19d48a,_0x273069['options']);var _0x5b99b5={'where':_0x19d48a[_0x8bc8('0x49')]};return db[_0x8bc8('0x4e')]['count'](_0x5b99b5)['then'](function(_0xadcf9){_0x3ba218[_0x8bc8('0x2f')]=_0xadcf9;if(_0x273069[_0x8bc8('0x40')]['includeAll']){_0x19d48a[_0x8bc8('0x4f')]=[{'all':!![]}];}return db[_0x8bc8('0x4e')]['findAll'](_0x19d48a);})[_0x8bc8('0x1e')](function(_0x451eaf){_0x3ba218[_0x8bc8('0x50')]=_0x451eaf;return _0x3ba218;})['then'](respondWithFilteredResult(_0x5cbaef,_0x19d48a))[_0x8bc8('0x27')](handleError(_0x5cbaef,null));};exports['show']=function(_0x52b634,_0x53880c){var _0x3f2413={'raw':![],'where':{'id':_0x52b634['params']['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x3c61fa={};_0x3c61fa[_0x8bc8('0x3e')]=_['keys'](db[_0x8bc8('0x4e')][_0x8bc8('0x51')]);_0x3c61fa[_0x8bc8('0x40')]=_[_0x8bc8('0x41')](_0x52b634['query']);_0x3c61fa[_0x8bc8('0x4a')]=_[_0x8bc8('0x42')](_0x3c61fa[_0x8bc8('0x3e')],_0x3c61fa['query']);_0x3f2413[_0x8bc8('0x43')]=_[_0x8bc8('0x42')](_0x3c61fa[_0x8bc8('0x3e')],qs[_0x8bc8('0x44')](_0x52b634[_0x8bc8('0x40')]['fields']));_0x3f2413[_0x8bc8('0x43')]=_0x3f2413[_0x8bc8('0x43')][_0x8bc8('0x45')]?_0x3f2413['attributes']:_0x3c61fa['model'];if(_0x52b634[_0x8bc8('0x40')][_0x8bc8('0x52')]){_0x3f2413[_0x8bc8('0x4f')]=[{'all':!![]}];}_0x3f2413=_[_0x8bc8('0x4d')]({},_0x3f2413,_0x52b634[_0x8bc8('0x53')]);return db[_0x8bc8('0x4e')][_0x8bc8('0x54')](_0x3f2413)[_0x8bc8('0x1e')](handleEntityNotFound(_0x53880c,null))[_0x8bc8('0x1e')](respondWithResult(_0x53880c,null))['catch'](handleError(_0x53880c,null));};exports['create']=function(_0x1e7b11,_0x48b063){return db[_0x8bc8('0x4e')]['create'](_0x1e7b11[_0x8bc8('0x55')],{})[_0x8bc8('0x1e')](function(_0x3f93af){var _0x1dedf=_0x1e7b11[_0x8bc8('0x56')][_0x8bc8('0x57')]({'plain':!![]});if(!_0x1dedf)throw new Error(_0x8bc8('0x58'));if(_0x1dedf[_0x8bc8('0x59')]==='user'){var _0x5150b8=_0x3f93af[_0x8bc8('0x57')]({'plain':!![]});var _0x25b687=_0x8bc8('0x5a');return db['UserProfileSection'][_0x8bc8('0x54')]({'where':{'name':_0x25b687,'userProfileId':_0x1dedf[_0x8bc8('0x5b')]},'raw':!![]})[_0x8bc8('0x1e')](function(_0x203af7){if(_0x203af7&&_0x203af7[_0x8bc8('0x5c')]===0x0){return db[_0x8bc8('0x35')]['create']({'name':_0x5150b8[_0x8bc8('0x37')],'resourceId':_0x5150b8['id'],'type':_0x203af7['name'],'sectionId':_0x203af7['id']},{})[_0x8bc8('0x1e')](function(){return _0x3f93af;});}else{return _0x3f93af;}})[_0x8bc8('0x27')](function(_0x581877){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x581877);throw _0x581877;});}return _0x3f93af;})['then'](respondWithResult(_0x48b063,0xc9))[_0x8bc8('0x27')](handleError(_0x48b063,null));};exports[_0x8bc8('0x33')]=function(_0x5a1210,_0x5e2515){if(_0x5a1210[_0x8bc8('0x55')]['id']){delete _0x5a1210[_0x8bc8('0x55')]['id'];}return db[_0x8bc8('0x4e')][_0x8bc8('0x54')]({'where':{'id':_0x5a1210[_0x8bc8('0x5d')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})[_0x8bc8('0x1e')](handleEntityNotFound(_0x5e2515,null))['then'](saveUpdates(_0x5a1210[_0x8bc8('0x55')],null))[_0x8bc8('0x1e')](respondWithResult(_0x5e2515,null))[_0x8bc8('0x27')](handleError(_0x5e2515,null));};exports[_0x8bc8('0x34')]=function(_0x1cd040,_0x4cb520){return db[_0x8bc8('0x4e')][_0x8bc8('0x54')]({'where':{'id':_0x1cd040[_0x8bc8('0x5d')]['id']}})[_0x8bc8('0x1e')](handleEntityNotFound(_0x4cb520,null))[_0x8bc8('0x1e')](removeEntity(_0x4cb520,null))[_0x8bc8('0x27')](handleError(_0x4cb520,null));};exports['describe']=function(_0x13a113,_0x5222c9){return db[_0x8bc8('0x4e')][_0x8bc8('0x5e')]()['then'](respondWithResult(_0x5222c9,null))[_0x8bc8('0x27')](handleError(_0x5222c9,null));};exports[_0x8bc8('0x5f')]=function(_0x1710d1,_0x16f212,_0x2322fc){if(_0x1710d1[_0x8bc8('0x55')]['id']){delete _0x1710d1[_0x8bc8('0x55')]['id'];}return db[_0x8bc8('0x4e')]['find']({'where':{'id':_0x1710d1[_0x8bc8('0x5d')]['id']}})[_0x8bc8('0x1e')](handleEntityNotFound(_0x16f212,null))[_0x8bc8('0x1e')](function(_0x1dfb3d){if(_0x1dfb3d){_0x1710d1[_0x8bc8('0x55')]['FaxAccountId']=_0x1dfb3d['id'];return db[_0x8bc8('0x60')]['create'](_0x1710d1['body']);}})[_0x8bc8('0x1e')](respondWithResult(_0x16f212,null))['catch'](handleError(_0x16f212,null));};exports[_0x8bc8('0x61')]=function(_0x5508c1,_0x5ed0fb,_0x3bba67){var _0x4272ae={'raw':![],'where':{}};var _0x8d9d5c={};var _0x442371={'count':0x0,'rows':[]};return db[_0x8bc8('0x4e')][_0x8bc8('0x62')]({'where':{'id':_0x5508c1[_0x8bc8('0x5d')]['id']}})[_0x8bc8('0x1e')](handleEntityNotFound(_0x5ed0fb,null))[_0x8bc8('0x1e')](function(_0x58684a){if(_0x58684a){_0x8d9d5c[_0x8bc8('0x3e')]=_[_0x8bc8('0x41')](db[_0x8bc8('0x60')][_0x8bc8('0x51')]);_0x8d9d5c['query']=_['keys'](_0x5508c1['query']);_0x8d9d5c['filters']=_[_0x8bc8('0x42')](_0x8d9d5c['model'],_0x8d9d5c[_0x8bc8('0x40')]);_0x4272ae[_0x8bc8('0x43')]=_['intersection'](_0x8d9d5c[_0x8bc8('0x3e')],qs[_0x8bc8('0x44')](_0x5508c1[_0x8bc8('0x40')][_0x8bc8('0x44')]));_0x4272ae[_0x8bc8('0x43')]=_0x4272ae[_0x8bc8('0x43')][_0x8bc8('0x45')]?_0x4272ae[_0x8bc8('0x43')]:_0x8d9d5c[_0x8bc8('0x3e')];if(!_0x5508c1['query']['hasOwnProperty'](_0x8bc8('0x46'))){_0x4272ae[_0x8bc8('0x2e')]=qs['limit'](_0x5508c1[_0x8bc8('0x40')]['limit']);_0x4272ae[_0x8bc8('0x2c')]=qs[_0x8bc8('0x2c')](_0x5508c1[_0x8bc8('0x40')][_0x8bc8('0x2c')]);}_0x4272ae[_0x8bc8('0x47')]=qs['sort'](_0x5508c1[_0x8bc8('0x40')][_0x8bc8('0x48')]);_0x4272ae[_0x8bc8('0x49')]=qs[_0x8bc8('0x4a')](_[_0x8bc8('0x4b')](_0x5508c1[_0x8bc8('0x40')],_0x8d9d5c[_0x8bc8('0x4a')]));_0x4272ae['where'][_0x8bc8('0x63')]=_0x58684a['id'];if(_0x5508c1[_0x8bc8('0x40')]['filter']){_0x4272ae[_0x8bc8('0x49')]=_[_0x8bc8('0x4d')](_0x4272ae[_0x8bc8('0x49')],{'$or':_[_0x8bc8('0x3f')](_0x4272ae[_0x8bc8('0x43')],function(_0x3c1a34){var _0x262f7a={};_0x262f7a[_0x3c1a34]={'$like':'%'+_0x5508c1[_0x8bc8('0x40')][_0x8bc8('0x64')]+'%'};return _0x262f7a;})});}_0x4272ae=_[_0x8bc8('0x4d')]({},_0x4272ae,_0x5508c1['options']);return db['Disposition'][_0x8bc8('0x2f')]({'where':_0x4272ae['where']})['then'](function(_0x7a26bf){_0x442371[_0x8bc8('0x2f')]=_0x7a26bf;if(_0x5508c1[_0x8bc8('0x40')][_0x8bc8('0x52')]){_0x4272ae['include']=[{'all':!![]}];}return db['Disposition'][_0x8bc8('0x65')](_0x4272ae);})[_0x8bc8('0x1e')](function(_0x15df76){_0x442371['rows']=_0x15df76;return _0x442371;});}})[_0x8bc8('0x1e')](respondWithFilteredResult(_0x5ed0fb,_0x4272ae))['catch'](handleError(_0x5ed0fb,null));};exports[_0x8bc8('0x66')]=function(_0x4f0c19,_0x54ae0a,_0x4b677f){return db[_0x8bc8('0x4e')][_0x8bc8('0x54')]({'where':{'id':_0x4f0c19[_0x8bc8('0x5d')]['id']}})[_0x8bc8('0x1e')](handleEntityNotFound(_0x54ae0a,null))[_0x8bc8('0x1e')](function(_0x43a984){if(_0x43a984){return _0x43a984[_0x8bc8('0x66')](_0x4f0c19[_0x8bc8('0x40')][_0x8bc8('0x67')]);}})['then'](respondWithStatusCode(_0x54ae0a,null))[_0x8bc8('0x27')](handleError(_0x54ae0a,null));};exports['addAnswer']=function(_0x488149,_0x57ec35,_0x14ca20){if(_0x488149[_0x8bc8('0x55')]['id']){delete _0x488149[_0x8bc8('0x55')]['id'];}return db['FaxAccount'][_0x8bc8('0x54')]({'where':{'id':_0x488149[_0x8bc8('0x5d')]['id']}})[_0x8bc8('0x1e')](handleEntityNotFound(_0x57ec35,null))[_0x8bc8('0x1e')](function(_0x84d5a1){if(_0x84d5a1){_0x488149[_0x8bc8('0x55')][_0x8bc8('0x63')]=_0x84d5a1['id'];return db[_0x8bc8('0x68')][_0x8bc8('0x69')](_0x488149[_0x8bc8('0x55')]);}})[_0x8bc8('0x1e')](respondWithResult(_0x57ec35,null))[_0x8bc8('0x27')](handleError(_0x57ec35,null));};exports[_0x8bc8('0x6a')]=function(_0x2712d3,_0x1813c1,_0x5b1409){var _0xaf0d22={'raw':![],'where':{}};var _0x4839a0={};var _0x33cf06={'count':0x0,'rows':[]};return db[_0x8bc8('0x4e')]['findOne']({'where':{'id':_0x2712d3[_0x8bc8('0x5d')]['id']}})[_0x8bc8('0x1e')](handleEntityNotFound(_0x1813c1,null))[_0x8bc8('0x1e')](function(_0xa5a46c){if(_0xa5a46c){_0x4839a0[_0x8bc8('0x3e')]=_[_0x8bc8('0x41')](db[_0x8bc8('0x68')][_0x8bc8('0x51')]);_0x4839a0[_0x8bc8('0x40')]=_[_0x8bc8('0x41')](_0x2712d3[_0x8bc8('0x40')]);_0x4839a0['filters']=_[_0x8bc8('0x42')](_0x4839a0['model'],_0x4839a0[_0x8bc8('0x40')]);_0xaf0d22['attributes']=_[_0x8bc8('0x42')](_0x4839a0['model'],qs[_0x8bc8('0x44')](_0x2712d3[_0x8bc8('0x40')][_0x8bc8('0x44')]));_0xaf0d22[_0x8bc8('0x43')]=_0xaf0d22[_0x8bc8('0x43')][_0x8bc8('0x45')]?_0xaf0d22['attributes']:_0x4839a0['model'];if(!_0x2712d3[_0x8bc8('0x40')]['hasOwnProperty']('nolimit')){_0xaf0d22['limit']=qs[_0x8bc8('0x2e')](_0x2712d3[_0x8bc8('0x40')][_0x8bc8('0x2e')]);_0xaf0d22[_0x8bc8('0x2c')]=qs['offset'](_0x2712d3[_0x8bc8('0x40')]['offset']);}_0xaf0d22[_0x8bc8('0x47')]=qs[_0x8bc8('0x48')](_0x2712d3[_0x8bc8('0x40')][_0x8bc8('0x48')]);_0xaf0d22['where']=qs[_0x8bc8('0x4a')](_[_0x8bc8('0x4b')](_0x2712d3['query'],_0x4839a0[_0x8bc8('0x4a')]));_0xaf0d22['where'][_0x8bc8('0x63')]=_0xa5a46c['id'];if(_0x2712d3['query'][_0x8bc8('0x64')]){_0xaf0d22['where']=_[_0x8bc8('0x4d')](_0xaf0d22[_0x8bc8('0x49')],{'$or':_[_0x8bc8('0x3f')](_0xaf0d22['attributes'],function(_0xf0429b){var _0x15ca2b={};_0x15ca2b[_0xf0429b]={'$like':'%'+_0x2712d3[_0x8bc8('0x40')]['filter']+'%'};return _0x15ca2b;})});}_0xaf0d22=_[_0x8bc8('0x4d')]({},_0xaf0d22,_0x2712d3[_0x8bc8('0x53')]);return db[_0x8bc8('0x68')][_0x8bc8('0x2f')]({'where':_0xaf0d22[_0x8bc8('0x49')]})['then'](function(_0x562504){_0x33cf06[_0x8bc8('0x2f')]=_0x562504;if(_0x2712d3[_0x8bc8('0x40')][_0x8bc8('0x52')]){_0xaf0d22[_0x8bc8('0x4f')]=[{'all':!![]}];}return db[_0x8bc8('0x68')][_0x8bc8('0x65')](_0xaf0d22);})['then'](function(_0x2cf8bd){_0x33cf06[_0x8bc8('0x50')]=_0x2cf8bd;return _0x33cf06;});}})[_0x8bc8('0x1e')](respondWithFilteredResult(_0x1813c1,_0xaf0d22))['catch'](handleError(_0x1813c1,null));};exports['removeAnswers']=function(_0x3d6905,_0x36641e,_0x31fba3){return db[_0x8bc8('0x4e')][_0x8bc8('0x54')]({'where':{'id':_0x3d6905[_0x8bc8('0x5d')]['id']}})[_0x8bc8('0x1e')](handleEntityNotFound(_0x36641e,null))[_0x8bc8('0x1e')](function(_0x42e722){if(_0x42e722){return _0x42e722[_0x8bc8('0x6b')](_0x3d6905['query'][_0x8bc8('0x67')]);}})[_0x8bc8('0x1e')](respondWithStatusCode(_0x36641e,null))['catch'](handleError(_0x36641e,null));};exports[_0x8bc8('0x6c')]=function(_0x5b67d9,_0x29f1f6,_0x5b6914){return db['FaxInteraction'][_0x8bc8('0x54')]({'where':{'id':_0x5b67d9[_0x8bc8('0x5d')]['id']}})[_0x8bc8('0x1e')](handleEntityNotFound(_0x29f1f6,null))[_0x8bc8('0x1e')](function(_0x33426c){if(_0x33426c){return _0x33426c[_0x8bc8('0x6c')](_0x5b67d9['body'][_0x8bc8('0x67')],_[_0x8bc8('0x6d')](_0x5b67d9['body'],['ids','id'])||{});}})['then'](respondWithResult(_0x29f1f6,null))[_0x8bc8('0x27')](handleError(_0x29f1f6,null));};exports[_0x8bc8('0x6e')]=function(_0x4bfe01,_0x52d633,_0x59f6cb){var _0x1b16e4={'raw':![],'where':{}};var _0x2b1368={};var _0x12bb01={'count':0x0,'rows':[]};return db[_0x8bc8('0x4e')][_0x8bc8('0x62')]({'where':{'id':_0x4bfe01[_0x8bc8('0x5d')]['id']}})['then'](handleEntityNotFound(_0x52d633,null))['then'](function(_0x1b905a){if(_0x1b905a){_0x2b1368[_0x8bc8('0x3e')]=_[_0x8bc8('0x41')](db[_0x8bc8('0x6f')][_0x8bc8('0x51')]);_0x2b1368[_0x8bc8('0x40')]=_[_0x8bc8('0x41')](_0x4bfe01['query']);_0x2b1368[_0x8bc8('0x4a')]=_[_0x8bc8('0x42')](_0x2b1368['model'],_0x2b1368[_0x8bc8('0x40')]);_0x1b16e4[_0x8bc8('0x43')]=_[_0x8bc8('0x42')](_0x2b1368[_0x8bc8('0x3e')],qs[_0x8bc8('0x44')](_0x4bfe01[_0x8bc8('0x40')][_0x8bc8('0x44')]));_0x1b16e4[_0x8bc8('0x43')]=_0x1b16e4[_0x8bc8('0x43')][_0x8bc8('0x45')]?_0x1b16e4[_0x8bc8('0x43')]:_0x2b1368['model'];if(!_0x4bfe01[_0x8bc8('0x40')][_0x8bc8('0x70')](_0x8bc8('0x46'))){_0x1b16e4['limit']=qs[_0x8bc8('0x2e')](_0x4bfe01[_0x8bc8('0x40')][_0x8bc8('0x2e')]);_0x1b16e4[_0x8bc8('0x2c')]=qs[_0x8bc8('0x2c')](_0x4bfe01[_0x8bc8('0x40')]['offset']);}_0x1b16e4[_0x8bc8('0x47')]=qs[_0x8bc8('0x48')](_0x4bfe01[_0x8bc8('0x40')][_0x8bc8('0x48')]);_0x1b16e4[_0x8bc8('0x49')]=qs['filters'](_[_0x8bc8('0x4b')](_0x4bfe01[_0x8bc8('0x40')],_0x2b1368['filters']));_0x1b16e4[_0x8bc8('0x49')]['FaxAccountId']=_0x1b905a['id'];if(_0x4bfe01[_0x8bc8('0x40')][_0x8bc8('0x64')]){_0x1b16e4[_0x8bc8('0x49')]=_['merge'](_0x1b16e4[_0x8bc8('0x49')],{'$or':_['map'](_0x1b16e4[_0x8bc8('0x43')],function(_0x39b5a7){var _0x21381f={};_0x21381f[_0x39b5a7]={'$like':'%'+_0x4bfe01[_0x8bc8('0x40')][_0x8bc8('0x64')]+'%'};return _0x21381f;})});}_0x1b16e4=_[_0x8bc8('0x4d')]({},_0x1b16e4,_0x4bfe01['options']);return db['FaxInteraction'][_0x8bc8('0x2f')]({'where':_0x1b16e4[_0x8bc8('0x49')]})[_0x8bc8('0x1e')](function(_0x27792f){_0x12bb01['count']=_0x27792f;if(_0x4bfe01[_0x8bc8('0x40')][_0x8bc8('0x52')]){_0x1b16e4[_0x8bc8('0x4f')]=[{'model':db[_0x8bc8('0x71')],'as':_0x8bc8('0x72'),'required':![]},{'model':db[_0x8bc8('0x73')],'as':'Owner','attributes':['name','fullname',_0x8bc8('0x74')],'required':![]},{'model':db[_0x8bc8('0x75')],'as':_0x8bc8('0x76'),'attributes':['id',_0x8bc8('0x37'),_0x8bc8('0x77')],'where':_0x4bfe01[_0x8bc8('0x40')][_0x8bc8('0x78')]?{'id':_0x4bfe01[_0x8bc8('0x40')][_0x8bc8('0x78')]}:undefined,'required':_0x4bfe01['query'][_0x8bc8('0x78')]?!![]:![]}];}return db[_0x8bc8('0x6f')]['findAll'](_0x1b16e4);})['then'](function(_0x2ad90e){_0x12bb01[_0x8bc8('0x50')]=_0x2ad90e;return _0x12bb01;});}})['then'](respondWithFilteredResult(_0x52d633,_0x1b16e4))['catch'](handleError(_0x52d633,null));};exports[_0x8bc8('0x79')]=function(_0x1bb67b,_0x1b64c2){var _0x10cc4d=_0x1bb67b[_0x8bc8('0x5d')]['id'];var _0x5b327d=_0x1bb67b[_0x8bc8('0x55')];var _0x3f018d=0xc8;var _0x4b1027=null;return db['sequelize'][_0x8bc8('0x7a')]({'isolationLevel':db[_0x8bc8('0x7b')]['Transaction'][_0x8bc8('0x7c')][_0x8bc8('0x7d')]},function(_0x45a4e2){return db[_0x8bc8('0x4e')][_0x8bc8('0x62')]({'where':{'id':_0x10cc4d},'transaction':_0x45a4e2})[_0x8bc8('0x1e')](function(_0x90f3d4){if(_0x90f3d4){return db[_0x8bc8('0x7e')][_0x8bc8('0x34')]({'where':{'FaxAccountId':_0x10cc4d},'transaction':_0x45a4e2})[_0x8bc8('0x1e')](function(){var _0x4bce90=_['map'](_0x5b327d,function(_0x245d74){_0x245d74[_0x8bc8('0x63')]=_0x10cc4d;return _0x245d74;});return db[_0x8bc8('0x7e')][_0x8bc8('0x7f')](_0x4bce90,{'transaction':_0x45a4e2});});}else{_0x3f018d=0x194;_0x4b1027=[];}});})[_0x8bc8('0x1e')](function(){if(_0x3f018d!==0x194){return db['FaxApplication'][_0x8bc8('0x80')]({'where':{'FaxAccountId':_0x10cc4d},'order':_0x8bc8('0x81')})['then'](function(_0x1a2684){_0x4b1027=_0x1a2684;});}})[_0x8bc8('0x27')](function(_0x50a3a8){_0x3f018d=0x1f4;logger[_0x8bc8('0x23')](_0x50a3a8[_0x8bc8('0x36')]);if(_0x50a3a8[_0x8bc8('0x37')]){delete _0x50a3a8['name'];}_0x4b1027=_0x50a3a8;})['finally'](function(){if(_0x4b1027===null){_0x1b64c2[_0x8bc8('0x28')](_0x3f018d);}else{if(_0x3f018d===0x1f4){_0x1b64c2['status'](_0x3f018d)[_0x8bc8('0x38')](_0x4b1027);}else{_0x1b64c2[_0x8bc8('0x29')](_0x3f018d)[_0x8bc8('0x2b')](_0x4b1027);}}});};exports[_0x8bc8('0x82')]=function(_0x306b92,_0x15c7da,_0x21ed8b){var _0x25099a={};var _0x2704f6={};var _0x6f23b9;var _0x1c6291;return db['FaxAccount']['findOne']({'where':{'id':_0x306b92[_0x8bc8('0x5d')]['id']}})[_0x8bc8('0x1e')](handleEntityNotFound(_0x15c7da,null))[_0x8bc8('0x1e')](function(_0x5c9251){if(_0x5c9251){_0x6f23b9=_0x5c9251;_0x2704f6[_0x8bc8('0x3e')]=_['keys'](db['FaxApplication'][_0x8bc8('0x51')]);_0x2704f6[_0x8bc8('0x40')]=_[_0x8bc8('0x41')](_0x306b92[_0x8bc8('0x40')]);_0x2704f6['filters']=_[_0x8bc8('0x42')](_0x2704f6[_0x8bc8('0x3e')],_0x2704f6[_0x8bc8('0x40')]);_0x25099a[_0x8bc8('0x43')]=_[_0x8bc8('0x42')](_0x2704f6[_0x8bc8('0x3e')],qs[_0x8bc8('0x44')](_0x306b92[_0x8bc8('0x40')][_0x8bc8('0x44')]));_0x25099a['attributes']=_0x25099a[_0x8bc8('0x43')][_0x8bc8('0x45')]?_0x25099a[_0x8bc8('0x43')]:_0x2704f6[_0x8bc8('0x3e')];_0x25099a['order']=qs['sort'](_0x306b92[_0x8bc8('0x40')]['sort']);_0x25099a[_0x8bc8('0x49')]=qs[_0x8bc8('0x4a')](_[_0x8bc8('0x4b')](_0x306b92[_0x8bc8('0x40')],_0x2704f6[_0x8bc8('0x4a')]));if(_0x306b92[_0x8bc8('0x40')]['filter']){_0x25099a[_0x8bc8('0x49')]=_[_0x8bc8('0x4d')](_0x25099a['where'],{'$or':_[_0x8bc8('0x3f')](_0x25099a[_0x8bc8('0x43')],function(_0x5179f2){var _0x35ca2d={};_0x35ca2d[_0x5179f2]={'$like':'%'+_0x306b92[_0x8bc8('0x40')][_0x8bc8('0x64')]+'%'};return _0x35ca2d;})});}_0x25099a=_[_0x8bc8('0x4d')]({},_0x25099a,_0x306b92['options']);return _0x6f23b9['getApplications'](_0x25099a);}})[_0x8bc8('0x1e')](function(_0x416d42){if(_0x416d42){_0x1c6291=_0x416d42[_0x8bc8('0x45')];if(!_0x306b92['query'][_0x8bc8('0x70')](_0x8bc8('0x46'))){_0x25099a[_0x8bc8('0x2e')]=qs[_0x8bc8('0x2e')](_0x306b92['query'][_0x8bc8('0x2e')]);_0x25099a['offset']=qs[_0x8bc8('0x2c')](_0x306b92[_0x8bc8('0x40')][_0x8bc8('0x2c')]);}return _0x6f23b9['getApplications'](_0x25099a);}})[_0x8bc8('0x1e')](function(_0x2d0849){if(_0x2d0849){return _0x2d0849?{'count':_0x1c6291,'rows':_0x2d0849}:null;}})[_0x8bc8('0x1e')](respondWithResult(_0x15c7da,null))[_0x8bc8('0x27')](handleError(_0x15c7da,null));};function Extension(_0x3ca640,_0x578151,_0x4eea89,_0x8036e9){this['context']='from-voip-provider';this['exten']=_0x3ca640[_0x8bc8('0x83')];this[_0x8bc8('0x84')]=_0x8036e9;this[_0x8bc8('0x3c')]=_0x8bc8('0x85');this['description']=_0x8bc8('0x86');this[_0x8bc8('0x63')]=_0x3ca640['id'];this[_0x8bc8('0x81')]=_0x578151;this[_0x8bc8('0x87')]=_0x4eea89;}function createExtensionsReciveFax(_0x109510){var _0x2a795b=0x1;var _0x5e4c2f=[];_0x5e4c2f['push'](new Extension(_0x109510,_0x2a795b,'',_0x8bc8('0x88')));_0x2a795b+=0x1;_0x5e4c2f[_0x8bc8('0x89')](new Extension(_0x109510,_0x2a795b,_0x8bc8('0x8a'),_0x8bc8('0x8b')));_0x2a795b+=0x1;for(var _0x4a65f9 in _0x109510){if(_0x109510[_0x8bc8('0x70')](_0x4a65f9)&&(_0x4a65f9===_0x8bc8('0x8c')||_0x4a65f9==='localstationid'||_0x4a65f9===_0x8bc8('0x8d')||_0x4a65f9==='faxdetect'||_0x4a65f9===_0x8bc8('0x8e')||_0x4a65f9===_0x8bc8('0x8f')||_0x4a65f9===_0x8bc8('0x90')||_0x4a65f9==='modem'||_0x4a65f9===_0x8bc8('0x91'))){_0x5e4c2f[_0x8bc8('0x89')](new Extension(_0x109510,_0x2a795b,_0x8bc8('0x92')+_0x4a65f9+')='+_0x109510[_0x4a65f9],'Set'));_0x2a795b+=0x1;}}_0x5e4c2f[_0x8bc8('0x89')](new Extension(_0x109510,_0x2a795b,'6',_0x8bc8('0x93')));_0x2a795b+=0x1;_0x5e4c2f[_0x8bc8('0x89')](new Extension(_0x109510,_0x2a795b,_0x8bc8('0x94'),_0x8bc8('0x95')));_0x2a795b=0x0;return _0x5e4c2f;}exports[_0x8bc8('0x96')]=function(_0xd39c42,_0x18fc9d,_0x107afd){var _0x15ca44;return db[_0x8bc8('0x7b')][_0x8bc8('0x7a')](function(_0x5bf4f4){return db['FaxAccount'][_0x8bc8('0x69')](_0xd39c42[_0x8bc8('0x55')],{'transaction':_0x5bf4f4})[_0x8bc8('0x1e')](function(_0xe2135d){_0x15ca44=_0xe2135d[_0x8bc8('0x57')]({'plain':!![]});return db[_0x8bc8('0x97')][_0x8bc8('0x7f')](createExtensionsReciveFax(_0x15ca44),{'transaction':_0x5bf4f4});});})[_0x8bc8('0x1e')](function(){return _0x15ca44;})['then'](respondWithResult(_0x18fc9d,null))['catch'](handleError(_0x18fc9d,null));};exports[_0x8bc8('0x98')]=function(_0x45a4be,_0x23fd56,_0x56d56f){var _0x3f31f1;return db[_0x8bc8('0x7b')]['transaction'](function(_0x10e258){return db[_0x8bc8('0x4e')][_0x8bc8('0x33')](_0x45a4be[_0x8bc8('0x55')],{'where':{'id':_0x45a4be['body']['id']},'transaction':_0x10e258})[_0x8bc8('0x1e')](function(_0x1ede7d){return db[_0x8bc8('0x97')][_0x8bc8('0x34')]({'where':{'FaxAccountId':_0x45a4be[_0x8bc8('0x55')]['id']},'transaction':_0x10e258})[_0x8bc8('0x1e')](function(_0x29626d){return db['VoiceExtension'][_0x8bc8('0x7f')](createExtensionsReciveFax(_[_0x8bc8('0x6d')](_0x45a4be[_0x8bc8('0x55')],[_0x8bc8('0x99'),_0x8bc8('0x3d'),_0x8bc8('0x9a'),_0x8bc8('0x9b'),'TrunkId',_0x8bc8('0x9c')])),{'transaction':_0x10e258});});});})[_0x8bc8('0x1e')](function(){return db[_0x8bc8('0x4e')]['findById'](_0x45a4be[_0x8bc8('0x55')]['id']);})['then'](respondWithResult(_0x23fd56,null))[_0x8bc8('0x27')](handleError(_0x23fd56,null));};exports[_0x8bc8('0x9d')]=function(_0x5aab4b,_0x389b44,_0x5319a1){var _0x1fc579={'raw':!![],'where':{}};var _0x2d6c38={};var _0x232b74={'count':0x0,'rows':[]};return db[_0x8bc8('0x4e')][_0x8bc8('0x62')]({'where':{'id':_0x5aab4b[_0x8bc8('0x5d')]['id']}})[_0x8bc8('0x1e')](handleEntityNotFound(_0x389b44,null))['then'](function(_0x88e6ce){if(_0x88e6ce){_0x2d6c38[_0x8bc8('0x3e')]=_[_0x8bc8('0x41')](db[_0x8bc8('0x9e')][_0x8bc8('0x51')]);_0x2d6c38[_0x8bc8('0x40')]=_[_0x8bc8('0x41')](_0x5aab4b[_0x8bc8('0x40')]);_0x2d6c38['filters']=_[_0x8bc8('0x42')](_0x2d6c38['model'],_0x2d6c38[_0x8bc8('0x40')]);_0x1fc579[_0x8bc8('0x43')]=_[_0x8bc8('0x42')](_0x2d6c38[_0x8bc8('0x3e')],qs[_0x8bc8('0x44')](_0x5aab4b[_0x8bc8('0x40')][_0x8bc8('0x44')]));_0x1fc579['attributes']=_0x1fc579[_0x8bc8('0x43')][_0x8bc8('0x45')]?_0x1fc579[_0x8bc8('0x43')]:_0x2d6c38[_0x8bc8('0x3e')];if(!_0x5aab4b[_0x8bc8('0x40')][_0x8bc8('0x70')](_0x8bc8('0x46'))){_0x1fc579[_0x8bc8('0x2e')]=qs[_0x8bc8('0x2e')](_0x5aab4b[_0x8bc8('0x40')][_0x8bc8('0x2e')]);_0x1fc579[_0x8bc8('0x2c')]=qs['offset'](_0x5aab4b[_0x8bc8('0x40')]['offset']);}_0x1fc579[_0x8bc8('0x47')]=qs[_0x8bc8('0x48')](_0x5aab4b[_0x8bc8('0x40')]['sort']);_0x1fc579[_0x8bc8('0x49')]=qs[_0x8bc8('0x4a')](_[_0x8bc8('0x4b')](_0x5aab4b[_0x8bc8('0x40')],_0x2d6c38[_0x8bc8('0x4a')]));_0x1fc579[_0x8bc8('0x49')][_0x8bc8('0x63')]=_0x88e6ce['id'];if(_0x5aab4b[_0x8bc8('0x40')][_0x8bc8('0x64')]){_0x1fc579['where']=_[_0x8bc8('0x4d')](_0x1fc579['where'],{'$or':_[_0x8bc8('0x3f')](_0x1fc579[_0x8bc8('0x43')],function(_0x3779b4){var _0x52aa5c={};_0x52aa5c[_0x3779b4]={'$like':'%'+_0x5aab4b['query'][_0x8bc8('0x64')]+'%'};return _0x52aa5c;})});}if(_0x5aab4b[_0x8bc8('0x40')][_0x8bc8('0x9f')]){var _0x509d69=_0x5aab4b[_0x8bc8('0x40')][_0x8bc8('0x9f')][_0x8bc8('0xa0')](',');var _0x130fa6={};_0x130fa6[_0x509d69[0x0]]={'$gte':moment(_0x509d69[0x1])[_0x8bc8('0xa1')](_0x8bc8('0xa2'))};_0x1fc579['where']=_[_0x8bc8('0x4d')](_0x1fc579[_0x8bc8('0x49')],_0x130fa6);}_0x1fc579=_['merge']({},_0x1fc579,_0x5aab4b[_0x8bc8('0x53')]);return db[_0x8bc8('0x9e')][_0x8bc8('0x2f')]({'where':_0x1fc579['where']})['then'](function(_0x8593df){_0x232b74['count']=_0x8593df;if(_0x5aab4b[_0x8bc8('0x40')][_0x8bc8('0x52')]){_0x1fc579['include']=[{'all':!![]}];}return db[_0x8bc8('0x9e')][_0x8bc8('0x65')](_0x1fc579);})[_0x8bc8('0x1e')](function(_0x51e5df){_0x232b74['rows']=_0x51e5df;return _0x232b74;});}})['then'](respondWithFilteredResult(_0x389b44,_0x1fc579))[_0x8bc8('0x27')](handleError(_0x389b44,null));};exports['send']=function(_0x4cbb5f,_0x3e7188,_0x280d9a){var _0x23412f,_0x38c019={},_0x1713a9;if(_0x4cbb5f[_0x8bc8('0x55')]['to']){_0x1713a9=_0x4cbb5f[_0x8bc8('0x55')]['to'][0x0];}return db[_0x8bc8('0x4e')][_0x8bc8('0x54')]({'where':{'id':_0x4cbb5f[_0x8bc8('0x5d')]['id']},'include':[{'model':db['CmList'],'as':_0x8bc8('0xa3'),'include':[{'model':db[_0x8bc8('0x71')],'as':_0x8bc8('0xa4'),'where':{'fax':_0x1713a9},'limit':0x1,'order':[['updatedAt','DESC']]}]}]})[_0x8bc8('0x1e')](handleEntityNotFound(_0x3e7188,null))[_0x8bc8('0x1e')](function(_0xac8183){_0x23412f=_0xac8183;if(_0x4cbb5f[_0x8bc8('0x55')][_0x8bc8('0xa5')]&&_0x4cbb5f['body'][_0x8bc8('0xa5')]['length']){for(var _0x5362f1=0x0;_0x5362f1<_0x4cbb5f[_0x8bc8('0x55')][_0x8bc8('0xa5')]['length'];_0x5362f1+=0x1){_0x4cbb5f['body']['attachments'][_0x5362f1]={'filename':_0x4cbb5f[_0x8bc8('0x55')][_0x8bc8('0xa5')][_0x5362f1]['name'],'id':_0x4cbb5f['body']['attachments'][_0x5362f1]['id'],'path':path['join'](config[_0x8bc8('0xa6')],'server/files/attachments',_0x4cbb5f[_0x8bc8('0x55')]['attachments'][_0x5362f1][_0x8bc8('0xa7')])};}}return respondWithRpcPromise('CheckAfterSend',_0x8bc8('0xa8'),{'FaxAccountId':_['isNil'](_0x4cbb5f['params']['id'])?undefined:_0x4cbb5f[_0x8bc8('0x5d')]['id'],'path':_[_0x8bc8('0xa9')](_0x4cbb5f['body'][_0x8bc8('0xa5')][0x0][_0x8bc8('0x8')])?undefined:_0x4cbb5f[_0x8bc8('0x55')]['attachments'][0x0][_0x8bc8('0x8')],'fax':_[_0x8bc8('0xa9')](_0x4cbb5f['body']['to'][0x0])?undefined:_0x4cbb5f['body']['to'][0x0]},client9002);})[_0x8bc8('0x1e')](function(){if(_0x23412f){if(_[_0x8bc8('0xa9')](_0x4cbb5f[_0x8bc8('0x55')]['from'])){_0x4cbb5f[_0x8bc8('0x55')][_0x8bc8('0xaa')]=util['format'](_0x8bc8('0xab'),_0x23412f[_0x8bc8('0x37')],_0x23412f['fax']);}if(_0x23412f['List']){if(_0x23412f[_0x8bc8('0xa3')][_0x8bc8('0xa4')][_0x8bc8('0x45')]){return _0x23412f[_0x8bc8('0xa3')][_0x8bc8('0xa4')][0x0];}else{return db['CmContact'][_0x8bc8('0x69')](_[_0x8bc8('0x18')](_0x4cbb5f[_0x8bc8('0x55')],{'firstName':_0x4cbb5f['body']['to'][0x0],'phone':_0x4cbb5f[_0x8bc8('0x55')]['to'][0x0],'fax':_0x4cbb5f[_0x8bc8('0x55')]['to'][0x0],'ListId':_0x23412f['ListId']}));}}else{throw new Error(_0x8bc8('0xac'));}}else{throw new Error('Send\x20Fax\x20failed');}})[_0x8bc8('0x1e')](function(_0xab3748){if(_0xab3748){return db[_0x8bc8('0x6f')]['find']({'where':{'ContactId':_0xab3748['id'],'closed':![],'FaxAccountId':_0x23412f['id']}})[_0x8bc8('0x1e')](function(_0x351402){if(_0x351402){return[_0x351402,![]];}return db[_0x8bc8('0x6f')][_0x8bc8('0x69')]({'UserId':_0x4cbb5f[_0x8bc8('0x56')]['id'],'ContactId':_0xab3748['id'],'FaxAccountId':_0x23412f['id'],'fax':_0x4cbb5f[_0x8bc8('0x55')]['to'][0x0],'firstMsgDirection':_0x8bc8('0xad'),'Messages':[_[_0x8bc8('0x4d')](_0x4cbb5f[_0x8bc8('0x55')],{'read':![],'body':_0x4cbb5f[_0x8bc8('0x55')][_0x8bc8('0xa5')][0x0]['filename'],'FaxAccountId':_0x23412f['id'],'UserId':_0x4cbb5f[_0x8bc8('0x56')]['id'],'ContactId':_0xab3748['id'],'AttachmentId':_0x4cbb5f[_0x8bc8('0x55')]['attachments'][0x0]['id']})]},{'include':[{'model':db[_0x8bc8('0x9e')],'as':_0x8bc8('0xae')}]})[_0x8bc8('0x1e')](function(_0x28b1b1){return[_0x28b1b1,!![]];});});}else{throw new Error(_0x8bc8('0xaf'));}})[_0x8bc8('0xb0')](function(_0x53eb70,_0x33a7fb){if(_0x33a7fb){return _0x53eb70;}return db[_0x8bc8('0x9e')]['create']({'direction':_0x8bc8('0xad'),'read':![],'body':_0x4cbb5f['body']['attachments'][0x0][_0x8bc8('0xb1')],'FaxAccountId':_0x23412f['id'],'FaxInteractionId':_0x53eb70['id'],'UserId':_0x4cbb5f[_0x8bc8('0x56')]['id'],'ContactId':_0x53eb70[_0x8bc8('0xb2')],'AttachmentId':_0x4cbb5f[_0x8bc8('0x55')][_0x8bc8('0xa5')][0x0]['id']})['then'](function(_0x3c5f76){_0x53eb70[_0x8bc8('0xb3')][_0x8bc8('0xae')]=[];_0x53eb70[_0x8bc8('0xb3')][_0x8bc8('0xae')]['push'](_0x3c5f76['dataValues']);return _0x53eb70;});})['then'](function(_0x56855d){respondWithRpcPromise(_0x8bc8('0xb4'),_0x8bc8('0xb4'),{'FaxAccountId':_[_0x8bc8('0xa9')](_0x4cbb5f[_0x8bc8('0x5d')]['id'])?undefined:_0x4cbb5f[_0x8bc8('0x5d')]['id'],'path':_['isNil'](_0x4cbb5f[_0x8bc8('0x55')][_0x8bc8('0xa5')][0x0][_0x8bc8('0x8')])?undefined:_0x4cbb5f[_0x8bc8('0x55')][_0x8bc8('0xa5')][0x0][_0x8bc8('0x8')],'fax':_[_0x8bc8('0xa9')](_0x4cbb5f['body']['to'][0x0])?undefined:_0x4cbb5f[_0x8bc8('0x55')]['to'][0x0],'AttachmentId':_0x4cbb5f[_0x8bc8('0x55')][_0x8bc8('0xa5')][0x0]['id']},client9002)[_0x8bc8('0x1e')](function(_0x209ae5){logger[_0x8bc8('0x1f')](_0x8bc8('0xb5'),_0x209ae5);})['catch'](function(_0x37eac2){logger[_0x8bc8('0x1f')](_0x8bc8('0xb5'),_0x37eac2);});return _0x56855d;})[_0x8bc8('0x1e')](respondWithResult(_0x3e7188,null))[_0x8bc8('0x27')](handleError(_0x3e7188,null));};exports[_0x8bc8('0xb6')]=function(_0x1525ff,_0x2b6005,_0x482d21){return db[_0x8bc8('0x4e')][_0x8bc8('0x54')]({'where':{'id':_0x1525ff[_0x8bc8('0x5d')]['id']}})[_0x8bc8('0x1e')](handleEntityNotFound(_0x2b6005,null))[_0x8bc8('0x1e')](function(_0x5cb4b4){if(_0x5cb4b4){return _0x5cb4b4[_0x8bc8('0xb6')](_0x1525ff[_0x8bc8('0x55')]['ids'],_[_0x8bc8('0x6d')](_0x1525ff[_0x8bc8('0x55')],[_0x8bc8('0x67'),'id'])||{})[_0x8bc8('0xb0')](function(_0x4272d3){for(var _0x12f7cd=0x0;_0x12f7cd<_0x1525ff[_0x8bc8('0x55')][_0x8bc8('0x67')]['length'];_0x12f7cd+=0x1){socket[_0x8bc8('0xb7')](_0x8bc8('0xb8'),{'UserId':Number(_0x1525ff[_0x8bc8('0x55')][_0x8bc8('0x67')][_0x12f7cd]),'FaxAccountId':Number(_0x1525ff[_0x8bc8('0x5d')]['id'])});}return _0x4272d3;});}})[_0x8bc8('0x1e')](respondWithResult(_0x2b6005,null))['catch'](handleError(_0x2b6005,null));};exports[_0x8bc8('0xb9')]=function(_0x5224da,_0x475a88,_0x2527a1){return db[_0x8bc8('0x4e')]['find']({'where':{'id':_0x5224da['params']['id']}})['then'](handleEntityNotFound(_0x475a88,null))[_0x8bc8('0x1e')](function(_0x31f10f){if(_0x31f10f){return _0x31f10f[_0x8bc8('0xb9')](_0x5224da[_0x8bc8('0x40')][_0x8bc8('0x67')])[_0x8bc8('0x1e')](function(){if(_[_0x8bc8('0xba')](_0x5224da[_0x8bc8('0x40')][_0x8bc8('0x67')])){for(var _0x471caf=0x0;_0x471caf<_0x5224da['query'][_0x8bc8('0x67')]['length'];_0x471caf+=0x1){socket[_0x8bc8('0xb7')](_0x8bc8('0xbb'),{'UserId':Number(_0x5224da['query']['ids'][_0x471caf]),'FaxAccountId':Number(_0x5224da[_0x8bc8('0x5d')]['id'])});}}else{socket[_0x8bc8('0xb7')](_0x8bc8('0xbb'),{'UserId':Number(_0x5224da[_0x8bc8('0x40')][_0x8bc8('0x67')]),'FaxAccountId':Number(_0x5224da[_0x8bc8('0x5d')]['id'])});}});}})[_0x8bc8('0x1e')](respondWithStatusCode(_0x475a88,null))[_0x8bc8('0x27')](handleError(_0x475a88,null));};exports[_0x8bc8('0xbc')]=function(_0x2845e8,_0x38ba7f,_0x3bd7cc){var _0xa09ead={};var _0x197151={};var _0x274872;var _0xaf6058;return db[_0x8bc8('0x4e')][_0x8bc8('0x62')]({'where':{'id':_0x2845e8['params']['id']}})[_0x8bc8('0x1e')](handleEntityNotFound(_0x38ba7f,null))[_0x8bc8('0x1e')](function(_0x205c93){if(_0x205c93){_0x274872=_0x205c93;_0x197151['model']=_['keys'](db[_0x8bc8('0x73')]['rawAttributes']);_0x197151[_0x8bc8('0x40')]=_['keys'](_0x2845e8[_0x8bc8('0x40')]);_0x197151['filters']=_[_0x8bc8('0x42')](_0x197151[_0x8bc8('0x3e')],_0x197151[_0x8bc8('0x40')]);_0xa09ead[_0x8bc8('0x43')]=_[_0x8bc8('0x42')](_0x197151[_0x8bc8('0x3e')],qs[_0x8bc8('0x44')](_0x2845e8['query'][_0x8bc8('0x44')]));_0xa09ead[_0x8bc8('0x43')]=_0xa09ead[_0x8bc8('0x43')]['length']?_0xa09ead[_0x8bc8('0x43')]:_0x197151[_0x8bc8('0x3e')];_0xa09ead[_0x8bc8('0x47')]=qs[_0x8bc8('0x48')](_0x2845e8[_0x8bc8('0x40')][_0x8bc8('0x48')]);_0xa09ead[_0x8bc8('0x49')]=qs[_0x8bc8('0x4a')](_[_0x8bc8('0x4b')](_0x2845e8[_0x8bc8('0x40')],_0x197151[_0x8bc8('0x4a')]));if(_0x2845e8['query']['filter']){_0xa09ead['where']=_['merge'](_0xa09ead['where'],{'$or':_[_0x8bc8('0x3f')](_0xa09ead[_0x8bc8('0x43')],function(_0x3242ba){var _0x500bd1={};_0x500bd1[_0x3242ba]={'$like':'%'+_0x2845e8['query'][_0x8bc8('0x64')]+'%'};return _0x500bd1;})});}_0xa09ead=_[_0x8bc8('0x4d')]({},_0xa09ead,_0x2845e8[_0x8bc8('0x53')]);return _0x274872[_0x8bc8('0xbc')](_0xa09ead);}})[_0x8bc8('0x1e')](function(_0x143ef1){if(_0x143ef1){_0xaf6058=_0x143ef1['length'];if(!_0x2845e8[_0x8bc8('0x40')][_0x8bc8('0x70')](_0x8bc8('0x46'))){_0xa09ead[_0x8bc8('0x2e')]=qs['limit'](_0x2845e8['query']['limit']);_0xa09ead[_0x8bc8('0x2c')]=qs[_0x8bc8('0x2c')](_0x2845e8[_0x8bc8('0x40')][_0x8bc8('0x2c')]);}return _0x274872[_0x8bc8('0xbc')](_0xa09ead);}})[_0x8bc8('0x1e')](function(_0x503342){if(_0x503342){return _0x503342?{'count':_0xaf6058,'rows':_0x503342}:null;}})[_0x8bc8('0x1e')](respondWithResult(_0x38ba7f,null))[_0x8bc8('0x27')](handleError(_0x38ba7f,null));};
\ No newline at end of file
index 7c9de3d..fcc0b9f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb666=['save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','FaxAccount','setMaxListeners'];(function(_0x293759,_0xddffd4){var _0xa49f70=function(_0xdf1ad3){while(--_0xdf1ad3){_0x293759['push'](_0x293759['shift']());}};_0xa49f70(++_0xddffd4);}(_0xb666,0x1e6));var _0x6b66=function(_0x30cfcc,_0x340db8){_0x30cfcc=_0x30cfcc-0x0;var _0x28691f=_0xb666[_0x30cfcc];return _0x28691f;};'use strict';var EventEmitter=require(_0x6b66('0x0'));var FaxAccount=require(_0x6b66('0x1'))['db'][_0x6b66('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x6b66('0x3')](0x0);var events={'afterCreate':_0x6b66('0x4'),'afterUpdate':_0x6b66('0x5'),'afterDestroy':'remove'};function emitEvent(_0x3474c2){return function(_0x272f81,_0x27e0ff,_0x1bc83b){FaxAccountEvents[_0x6b66('0x6')](_0x3474c2+':'+_0x272f81['id'],_0x272f81);FaxAccountEvents[_0x6b66('0x6')](_0x3474c2,_0x272f81);_0x1bc83b(null);};}for(var e in events){if(events[_0x6b66('0x7')](e)){var event=events[e];FaxAccount[_0x6b66('0x8')](e,emitEvent(event));}}module[_0x6b66('0x9')]=FaxAccountEvents;
\ No newline at end of file
+var _0xec12=['FaxAccount','setMaxListeners','update','remove','emit','hasOwnProperty','exports','events'];(function(_0x325343,_0x16c135){var _0x1ce89f=function(_0x53856d){while(--_0x53856d){_0x325343['push'](_0x325343['shift']());}};_0x1ce89f(++_0x16c135);}(_0xec12,0xff));var _0x2ec1=function(_0x113b88,_0x147c10){_0x113b88=_0x113b88-0x0;var _0x2bc637=_0xec12[_0x113b88];return _0x2bc637;};'use strict';var EventEmitter=require(_0x2ec1('0x0'));var FaxAccount=require('../../mysqldb')['db'][_0x2ec1('0x1')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x2ec1('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x2ec1('0x3'),'afterDestroy':_0x2ec1('0x4')};function emitEvent(_0x249f70){return function(_0x485cad,_0x5a40f4,_0x3274c2){FaxAccountEvents[_0x2ec1('0x5')](_0x249f70+':'+_0x485cad['id'],_0x485cad);FaxAccountEvents[_0x2ec1('0x5')](_0x249f70,_0x485cad);_0x3274c2(null);};}for(var e in events){if(events[_0x2ec1('0x6')](e)){var event=events[e];FaxAccount['hook'](e,emitEvent(event));}}module[_0x2ec1('0x7')]=FaxAccountEvents;
\ No newline at end of file
index 857e3c6..406b67f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc934=['../../config/environment','./faxAccount.attributes','define','FaxAccount','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x2ec461,_0x5f588a){var _0x28603d=function(_0x21114b){while(--_0x21114b){_0x2ec461['push'](_0x2ec461['shift']());}};_0x28603d(++_0x5f588a);}(_0xc934,0x1dd));var _0x4c93=function(_0x3cc1e3,_0x1468fd){_0x3cc1e3=_0x3cc1e3-0x0;var _0x24bbdd=_0xc934[_0x3cc1e3];return _0x24bbdd;};'use strict';var _=require('lodash');var util=require(_0x4c93('0x0'));var logger=require('../../config/logger')(_0x4c93('0x1'));var moment=require(_0x4c93('0x2'));var BPromise=require(_0x4c93('0x3'));var rp=require(_0x4c93('0x4'));var fs=require('fs');var path=require(_0x4c93('0x5'));var rimraf=require(_0x4c93('0x6'));var config=require(_0x4c93('0x7'));var attributes=require(_0x4c93('0x8'));module['exports']=function(_0x51ffa1,_0x35f251){return _0x51ffa1[_0x4c93('0x9')](_0x4c93('0xa'),attributes,{'tableName':'fax_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8474=['fax_accounts','lodash','../../config/logger','api','bluebird','path','rimraf','define'];(function(_0x2c6f03,_0x3ca413){var _0x4b1114=function(_0x4233a2){while(--_0x4233a2){_0x2c6f03['push'](_0x2c6f03['shift']());}};_0x4b1114(++_0x3ca413);}(_0x8474,0x89));var _0x4847=function(_0x57d47d,_0x6c8523){_0x57d47d=_0x57d47d-0x0;var _0x3b511e=_0x8474[_0x57d47d];return _0x3b511e;};'use strict';var _=require(_0x4847('0x0'));var util=require('util');var logger=require(_0x4847('0x1'))(_0x4847('0x2'));var moment=require('moment');var BPromise=require(_0x4847('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4847('0x4'));var rimraf=require(_0x4847('0x5'));var config=require('../../config/environment');var attributes=require('./faxAccount.attributes');module['exports']=function(_0x5c9720,_0x13068b){return _0x5c9720[_0x4847('0x6')]('FaxAccount',attributes,{'tableName':_0x4847('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 6a0e80b..a438ca9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbf2b=['AttachmentId','UserId','User','name','unshift','agent','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','./faxAccount.socket','register','then','info','FaxAccount,\x20%s,\x20%s','debug','FaxAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','findAll','options','raw','where','attributes','include','map','model','GetFaxAccount','stringify','catch','NotifyFaxAccount','body','fax','describe','Sequelize','ValidationError','no\x20available\x20attributes','keys','createdAt','updatedAt','CompanyId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','FaxAccount','find','account','CmList','CmContact','DESC','Applications','List','get','applications','list','orderBy','asc','Contacts','ListId','contact','FaxInteraction','Contact\x20not\x20found','spread','push','length','close','unmanaged','created','interaction','create','ContactId'];(function(_0x63853d,_0xf073b9){var _0x2418d8=function(_0x5ee5be){while(--_0x5ee5be){_0x63853d['push'](_0x63853d['shift']());}};_0x2418d8(++_0xf073b9);}(_0xbf2b,0xbe));var _0xbbf2=function(_0x126c9e,_0x2dba7e){_0x126c9e=_0x126c9e-0x0;var _0x3d77f8=_0xbf2b[_0x126c9e];return _0x3d77f8;};'use strict';var _=require(_0xbbf2('0x0'));var util=require(_0xbbf2('0x1'));var moment=require(_0xbbf2('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbbf2('0x3'));var db=require(_0xbbf2('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xbbf2('0x5'))(_0xbbf2('0x6'));var config=require(_0xbbf2('0x7'));var jayson=require(_0xbbf2('0x8'));var client=jayson['client'][_0xbbf2('0x9')]({'port':0x232c});config[_0xbbf2('0xa')]=_[_0xbbf2('0xb')](config[_0xbbf2('0xa')],{'host':_0xbbf2('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbbf2('0xa')]));require(_0xbbf2('0xd'))[_0xbbf2('0xe')](socket);function respondWithRpcPromise(_0x7c632f,_0x43c9e9,_0x4a82b2){return new BPromise(function(_0x415a43,_0x54fc1c){return client['request'](_0x7c632f,_0x4a82b2)[_0xbbf2('0xf')](function(_0x2da498){logger[_0xbbf2('0x10')](_0xbbf2('0x11'),_0x43c9e9,'request\x20sent');logger[_0xbbf2('0x12')](_0xbbf2('0x13'),_0x43c9e9,_0xbbf2('0x14'),JSON['stringify'](_0x2da498));if(_0x2da498[_0xbbf2('0x15')]){if(_0x2da498[_0xbbf2('0x15')][_0xbbf2('0x16')]===0x1f4){logger['error'](_0xbbf2('0x11'),_0x43c9e9,_0x2da498[_0xbbf2('0x15')]['message']);return _0x54fc1c(_0x2da498[_0xbbf2('0x15')][_0xbbf2('0x17')]);}logger['error'](_0xbbf2('0x11'),_0x43c9e9,_0x2da498['error'][_0xbbf2('0x17')]);return _0x415a43(_0x2da498[_0xbbf2('0x15')][_0xbbf2('0x17')]);}else{logger[_0xbbf2('0x10')](_0xbbf2('0x11'),_0x43c9e9,_0xbbf2('0x14'));_0x415a43(_0x2da498[_0xbbf2('0x18')][_0xbbf2('0x17')]);}})['catch'](function(_0x266053){logger[_0xbbf2('0x15')](_0xbbf2('0x11'),_0x43c9e9,_0x266053);_0x54fc1c(_0x266053);});});}exports['GetFaxAccount']=function(_0x4f672f){var _0x5a1635=this;return new Promise(function(_0x3ad3e3,_0x22e5a2){return db['FaxAccount'][_0xbbf2('0x19')]({'raw':_0x4f672f['options']?_0x4f672f[_0xbbf2('0x1a')][_0xbbf2('0x1b')]===undefined?!![]:![]:!![],'where':_0x4f672f['options']?_0x4f672f[_0xbbf2('0x1a')][_0xbbf2('0x1c')]||null:null,'attributes':_0x4f672f[_0xbbf2('0x1a')]?_0x4f672f[_0xbbf2('0x1a')][_0xbbf2('0x1d')]||null:null,'limit':_0x4f672f[_0xbbf2('0x1a')]?_0x4f672f['options']['limit']||null:null,'include':_0x4f672f[_0xbbf2('0x1a')]?_0x4f672f[_0xbbf2('0x1a')][_0xbbf2('0x1e')]?_[_0xbbf2('0x1f')](_0x4f672f[_0xbbf2('0x1a')]['include'],function(_0x20742c){return{'model':db[_0x20742c[_0xbbf2('0x20')]],'as':_0x20742c['as'],'attributes':_0x20742c['attributes'],'include':_0x20742c[_0xbbf2('0x1e')]?_[_0xbbf2('0x1f')](_0x20742c['include'],function(_0xfe0550){return{'model':db[_0xfe0550[_0xbbf2('0x20')]],'as':_0xfe0550['as'],'attributes':_0xfe0550['attributes'],'include':_0xfe0550[_0xbbf2('0x1e')]?_[_0xbbf2('0x1f')](_0xfe0550[_0xbbf2('0x1e')],function(_0x45c742){return{'model':db[_0x45c742[_0xbbf2('0x20')]],'as':_0x45c742['as'],'attributes':_0x45c742[_0xbbf2('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xbbf2('0xf')](function(_0x29a288){logger['info']('GetFaxAccount',_0x4f672f);logger['debug'](_0xbbf2('0x21'),_0x4f672f,JSON[_0xbbf2('0x22')](_0x29a288));_0x3ad3e3(_0x29a288);})[_0xbbf2('0x23')](function(_0xb8911){logger[_0xbbf2('0x15')](_0xbbf2('0x21'),_0xb8911[_0xbbf2('0x17')],_0x4f672f);_0x22e5a2(_0x5a1635[_0xbbf2('0x15')](0x1f4,_0xb8911[_0xbbf2('0x17')]));});});};exports[_0xbbf2('0x24')]=function(_0x5c7347,_0x59476d,_0x47c4b9){var _0x1ea336=this;return new Promise(function(_0xfcd2b5,_0x5bc842){var _0x8d5597={'body':_0x5c7347[_0xbbf2('0x25')],'channel':_0xbbf2('0x26')};var _0x11b8bf=[];var _0x36b59e=[];var _0xc4b31b={};return db['CmContact'][_0xbbf2('0x27')]()[_0xbbf2('0xf')](function(_0x52cd92){if(!_0x52cd92){throw new db[(_0xbbf2('0x28'))][(_0xbbf2('0x29'))](_0xbbf2('0x2a'));}_0x11b8bf=_['difference'](_[_0xbbf2('0x2b')](_0x52cd92),[_0xbbf2('0x2c'),_0xbbf2('0x2d')]);_0x36b59e=_['difference'](_['keys'](_0x52cd92),[_0xbbf2('0x2c'),'updatedAt',_0xbbf2('0x2e'),'ListId']);if(_0x5c7347['body']['id']){delete _0x5c7347[_0xbbf2('0x25')]['id'];}if(_[_0xbbf2('0x2f')](_0x5c7347[_0xbbf2('0x25')][_0xbbf2('0x30')])){throw new db[(_0xbbf2('0x28'))][(_0xbbf2('0x29'))](_0xbbf2('0x31'));}if(_['isNil'](_0x5c7347[_0xbbf2('0x25')][_0xbbf2('0x25')])||_0x5c7347[_0xbbf2('0x25')][_0xbbf2('0x25')]===''){throw new db[(_0xbbf2('0x28'))][(_0xbbf2('0x29'))](_0xbbf2('0x32'));}if(_[_0xbbf2('0x2f')](_0x5c7347[_0xbbf2('0x25')][_0xbbf2('0x33')])){throw new db['Sequelize'][(_0xbbf2('0x29'))](_0xbbf2('0x34')+_0x36b59e);}if(!_['includes'](_0x36b59e,_0x5c7347[_0xbbf2('0x25')][_0xbbf2('0x33')])){throw new db['Sequelize'][(_0xbbf2('0x29'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x36b59e);}_0xc4b31b[_0x5c7347[_0xbbf2('0x25')][_0xbbf2('0x33')]]=_0x5c7347[_0xbbf2('0x25')][_0xbbf2('0x30')];})[_0xbbf2('0xf')](function(){return db[_0xbbf2('0x35')][_0xbbf2('0x36')]({'where':{'id':_0x5c7347[_0xbbf2('0x37')]['id']},'include':[{'model':db[_0xbbf2('0x38')],'as':'List','include':[{'model':db[_0xbbf2('0x39')],'as':'Contacts','where':_0xc4b31b,'limit':0x1,'order':[['updatedAt',_0xbbf2('0x3a')]]}]},{'model':db['FaxApplication'],'as':_0xbbf2('0x3b')}]});})[_0xbbf2('0xf')](function(_0x2aabf6){if(_0x2aabf6&&_0x2aabf6[_0xbbf2('0x3c')]){var _0x3f99ec=_0x2aabf6[_0xbbf2('0x3d')]({'plain':!![]});_0x8d5597[_0xbbf2('0x37')]=_0x3f99ec;_0x8d5597[_0xbbf2('0x3e')]=_0x3f99ec['Applications'];_0x8d5597[_0xbbf2('0x3f')]=_0x3f99ec[_0xbbf2('0x3c')];_0x8d5597[_0xbbf2('0x3e')]=_[_0xbbf2('0x40')](_0x8d5597[_0xbbf2('0x3e')],['priority'],[_0xbbf2('0x41')]);if(_0x8d5597[_0xbbf2('0x37')][_0xbbf2('0x3b')]){delete _0x8d5597[_0xbbf2('0x37')][_0xbbf2('0x3b')];}if(_0x8d5597[_0xbbf2('0x37')][_0xbbf2('0x3c')]&&_0x8d5597[_0xbbf2('0x37')][_0xbbf2('0x3c')]['Contacts']['length']){return _0x8d5597['account'][_0xbbf2('0x3c')][_0xbbf2('0x42')][0x0];}var _0x2ea211=_[_0xbbf2('0xb')](_0x5c7347[_0xbbf2('0x25')],{'firstName':_0x5c7347['body'][_0xbbf2('0x30')],'ListId':_0x3f99ec[_0xbbf2('0x43')]});_0x2ea211[_0x5c7347[_0xbbf2('0x25')]['mapKey']]=_0x5c7347[_0xbbf2('0x25')][_0xbbf2('0x30')];return db[_0xbbf2('0x39')]['create'](_0x2ea211,{'fields':_0x11b8bf,'raw':!![]});}})[_0xbbf2('0xf')](function(_0x129d1a){_0x8d5597[_0xbbf2('0x44')]=_0x129d1a;if(_0x129d1a){var _0x315a93={'ContactId':_0x129d1a['id'],'FaxAccountId':_0x5c7347[_0xbbf2('0x37')]['id'],'fax':_0x129d1a[_0xbbf2('0x26')]};return db[_0xbbf2('0x45')][_0xbbf2('0x36')]({'where':{'ContactId':_0x129d1a['id'],'closed':![],'FaxAccountId':_0x5c7347['account']['id']}})['then'](function(_0x13dd93){if(_0x13dd93){return[_0x13dd93,![]];}return db['FaxInteraction']['create'](_0x315a93)[_0xbbf2('0xf')](function(_0x2a0e09){return[_0x2a0e09,!![]];});});}else{throw new Error(_0xbbf2('0x46'));}})[_0xbbf2('0x47')](function(_0x37494a,_0xbaab1c){var _0x5589f6=_0x37494a[_0xbbf2('0x3d')]({'plain':!![]});if(_0xbaab1c){if(_0x8d5597[_0xbbf2('0x37')]['autoclose']){_0x8d5597[_0xbbf2('0x3e')][_0xbbf2('0x48')]({'id':0x0,'priority':_0x8d5597[_0xbbf2('0x3e')][_0xbbf2('0x49')]+0x1,'app':_0xbbf2('0x4a'),'appdata':_0xbbf2('0x4b'),'interval':'*,*,*,*'});}_0x5589f6['created']=!![];}else{_0x5589f6[_0xbbf2('0x4c')]=![];}_0x8d5597[_0xbbf2('0x4d')]=_0x5589f6;return db['FaxMessage'][_0xbbf2('0x4e')]({'body':_0x5c7347['body'][_0xbbf2('0x25')],'FaxAccountId':_0x5c7347[_0xbbf2('0x37')]['id'],'FaxInteractionId':_0x37494a['id'],'direction':'in','ContactId':_0x37494a[_0xbbf2('0x4f')],'AttachmentId':_0x5c7347[_0xbbf2('0x25')][_0xbbf2('0x50')]});})['then'](function(_0x3e8ec0){_0x8d5597[_0xbbf2('0x17')]=_0x3e8ec0;if(_0x8d5597[_0xbbf2('0x4d')][_0xbbf2('0x51')]){return db[_0xbbf2('0x52')]['find']({'attributes':['id',_0xbbf2('0x53')],'where':{'id':_0x8d5597[_0xbbf2('0x4d')][_0xbbf2('0x51')]}})[_0xbbf2('0xf')](function(_0x512551){if(_0x512551){_0x8d5597[_0xbbf2('0x3e')][_0xbbf2('0x54')]({'id':0x0,'priority':0x0,'app':_0xbbf2('0x55'),'appdata':_0x512551[_0xbbf2('0x53')]+','+(_0x8d5597[_0xbbf2('0x37')][_0xbbf2('0x56')]||0xa),'interval':_0xbbf2('0x57')});}return respondWithRpcPromise(_0xbbf2('0x58'),'startRouting',_0x8d5597);});}return respondWithRpcPromise(_0xbbf2('0x58'),_0xbbf2('0x59'),_0x8d5597);})['then'](function(_0x360846){_0xfcd2b5(_0x360846);})[_0xbbf2('0x23')](function(_0x1d464f){_0x5bc842(_0x1ea336[_0xbbf2('0x15')](0x1f4,_0x1d464f[_0xbbf2('0x17')]));});});};
\ No newline at end of file
+var _0x5915=['attributes','limit','include','map','model','debug','catch','body','fax','describe','Sequelize','ValidationError','no\x20available\x20attributes','difference','keys','createdAt','updatedAt','CompanyId','from','isNil','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','find','List','CmContact','DESC','FaxApplication','Applications','get','applications','list','priority','asc','account','Contacts','length','ListId','create','contact','FaxInteraction','Contact\x20not\x20found','spread','autoclose','close','unmanaged','*,*,*,*','FaxMessage','ContactId','AttachmentId','UserId','User','name','interaction','agent','Start','startRouting','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','register','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','GetFaxAccount','FaxAccount','findAll','options','where'];(function(_0x3df9dd,_0x26f5cd){var _0x4f11e4=function(_0x1993fe){while(--_0x1993fe){_0x3df9dd['push'](_0x3df9dd['shift']());}};_0x4f11e4(++_0x26f5cd);}(_0x5915,0x90));var _0x5591=function(_0x2e73c3,_0x4b152b){_0x2e73c3=_0x2e73c3-0x0;var _0x407658=_0x5915[_0x2e73c3];return _0x407658;};'use strict';var _=require(_0x5591('0x0'));var util=require(_0x5591('0x1'));var moment=require(_0x5591('0x2'));var BPromise=require(_0x5591('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5591('0x4'));var db=require(_0x5591('0x5'))['db'];var utils=require(_0x5591('0x6'));var logger=require(_0x5591('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x5591('0x8'));var client=jayson[_0x5591('0x9')][_0x5591('0xa')]({'port':0x232c});config['redis']=_[_0x5591('0xb')](config[_0x5591('0xc')],{'host':_0x5591('0xd'),'port':0x18eb});var socket=require(_0x5591('0xe'))(new Redis(config[_0x5591('0xc')]));require('./faxAccount.socket')[_0x5591('0xf')](socket);function respondWithRpcPromise(_0x2222f2,_0x57c812,_0x247893){return new BPromise(function(_0x5224eb,_0x4ed2d3){return client['request'](_0x2222f2,_0x247893)[_0x5591('0x10')](function(_0x3a1f5e){logger[_0x5591('0x11')](_0x5591('0x12'),_0x57c812,_0x5591('0x13'));logger['debug']('FaxAccount,\x20%s,\x20%s,\x20%s',_0x57c812,_0x5591('0x13'),JSON[_0x5591('0x14')](_0x3a1f5e));if(_0x3a1f5e[_0x5591('0x15')]){if(_0x3a1f5e[_0x5591('0x15')][_0x5591('0x16')]===0x1f4){logger[_0x5591('0x15')](_0x5591('0x12'),_0x57c812,_0x3a1f5e[_0x5591('0x15')][_0x5591('0x17')]);return _0x4ed2d3(_0x3a1f5e[_0x5591('0x15')][_0x5591('0x17')]);}logger['error'](_0x5591('0x12'),_0x57c812,_0x3a1f5e[_0x5591('0x15')]['message']);return _0x5224eb(_0x3a1f5e[_0x5591('0x15')][_0x5591('0x17')]);}else{logger['info'](_0x5591('0x12'),_0x57c812,'request\x20sent');_0x5224eb(_0x3a1f5e[_0x5591('0x18')][_0x5591('0x17')]);}})['catch'](function(_0xa08872){logger[_0x5591('0x15')]('FaxAccount,\x20%s,\x20%s',_0x57c812,_0xa08872);_0x4ed2d3(_0xa08872);});});}exports[_0x5591('0x19')]=function(_0x100183){var _0x501f80=this;return new Promise(function(_0x30c1ed,_0xd42914){return db[_0x5591('0x1a')][_0x5591('0x1b')]({'raw':_0x100183[_0x5591('0x1c')]?_0x100183[_0x5591('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x100183[_0x5591('0x1c')]?_0x100183[_0x5591('0x1c')][_0x5591('0x1d')]||null:null,'attributes':_0x100183[_0x5591('0x1c')]?_0x100183['options'][_0x5591('0x1e')]||null:null,'limit':_0x100183[_0x5591('0x1c')]?_0x100183[_0x5591('0x1c')][_0x5591('0x1f')]||null:null,'include':_0x100183[_0x5591('0x1c')]?_0x100183[_0x5591('0x1c')][_0x5591('0x20')]?_[_0x5591('0x21')](_0x100183[_0x5591('0x1c')]['include'],function(_0x49840c){return{'model':db[_0x49840c[_0x5591('0x22')]],'as':_0x49840c['as'],'attributes':_0x49840c[_0x5591('0x1e')],'include':_0x49840c[_0x5591('0x20')]?_[_0x5591('0x21')](_0x49840c[_0x5591('0x20')],function(_0x2309fb){return{'model':db[_0x2309fb[_0x5591('0x22')]],'as':_0x2309fb['as'],'attributes':_0x2309fb[_0x5591('0x1e')],'include':_0x2309fb[_0x5591('0x20')]?_[_0x5591('0x21')](_0x2309fb[_0x5591('0x20')],function(_0x59682a){return{'model':db[_0x59682a['model']],'as':_0x59682a['as'],'attributes':_0x59682a['attributes']};}):[]};}):[]};}):[]:[]})[_0x5591('0x10')](function(_0x50385f){logger[_0x5591('0x11')]('GetFaxAccount',_0x100183);logger[_0x5591('0x23')](_0x5591('0x19'),_0x100183,JSON[_0x5591('0x14')](_0x50385f));_0x30c1ed(_0x50385f);})[_0x5591('0x24')](function(_0x3cd76a){logger['error'](_0x5591('0x19'),_0x3cd76a['message'],_0x100183);_0xd42914(_0x501f80['error'](0x1f4,_0x3cd76a[_0x5591('0x17')]));});});};exports['NotifyFaxAccount']=function(_0x3f40f6,_0x516aed,_0x23d6a){var _0x30015b=this;return new Promise(function(_0x1a9aa4,_0x2b0bef){var _0x393c95={'body':_0x3f40f6[_0x5591('0x25')],'channel':_0x5591('0x26')};var _0x3c10dd=[];var _0x4d300d=[];var _0xcb140f={};return db['CmContact'][_0x5591('0x27')]()[_0x5591('0x10')](function(_0x4f34ea){if(!_0x4f34ea){throw new db[(_0x5591('0x28'))][(_0x5591('0x29'))](_0x5591('0x2a'));}_0x3c10dd=_[_0x5591('0x2b')](_[_0x5591('0x2c')](_0x4f34ea),[_0x5591('0x2d'),_0x5591('0x2e')]);_0x4d300d=_[_0x5591('0x2b')](_[_0x5591('0x2c')](_0x4f34ea),[_0x5591('0x2d'),_0x5591('0x2e'),_0x5591('0x2f'),'ListId']);if(_0x3f40f6[_0x5591('0x25')]['id']){delete _0x3f40f6[_0x5591('0x25')]['id'];}if(_['isNil'](_0x3f40f6[_0x5591('0x25')][_0x5591('0x30')])){throw new db['Sequelize'][(_0x5591('0x29'))]('from\x20is\x20mandatory');}if(_[_0x5591('0x31')](_0x3f40f6[_0x5591('0x25')][_0x5591('0x25')])||_0x3f40f6[_0x5591('0x25')][_0x5591('0x25')]===''){throw new db[(_0x5591('0x28'))][(_0x5591('0x29'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x5591('0x31')](_0x3f40f6[_0x5591('0x25')]['mapKey'])){throw new db[(_0x5591('0x28'))]['ValidationError'](_0x5591('0x32')+_0x4d300d);}if(!_[_0x5591('0x33')](_0x4d300d,_0x3f40f6[_0x5591('0x25')][_0x5591('0x34')])){throw new db[(_0x5591('0x28'))][(_0x5591('0x29'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4d300d);}_0xcb140f[_0x3f40f6[_0x5591('0x25')][_0x5591('0x34')]]=_0x3f40f6[_0x5591('0x25')]['from'];})[_0x5591('0x10')](function(){return db[_0x5591('0x1a')][_0x5591('0x35')]({'where':{'id':_0x3f40f6['account']['id']},'include':[{'model':db['CmList'],'as':_0x5591('0x36'),'include':[{'model':db[_0x5591('0x37')],'as':'Contacts','where':_0xcb140f,'limit':0x1,'order':[[_0x5591('0x2e'),_0x5591('0x38')]]}]},{'model':db[_0x5591('0x39')],'as':_0x5591('0x3a')}]});})[_0x5591('0x10')](function(_0xb7bea1){if(_0xb7bea1&&_0xb7bea1[_0x5591('0x36')]){var _0x5254e9=_0xb7bea1[_0x5591('0x3b')]({'plain':!![]});_0x393c95['account']=_0x5254e9;_0x393c95[_0x5591('0x3c')]=_0x5254e9[_0x5591('0x3a')];_0x393c95[_0x5591('0x3d')]=_0x5254e9[_0x5591('0x36')];_0x393c95[_0x5591('0x3c')]=_['orderBy'](_0x393c95[_0x5591('0x3c')],[_0x5591('0x3e')],[_0x5591('0x3f')]);if(_0x393c95[_0x5591('0x40')]['Applications']){delete _0x393c95[_0x5591('0x40')]['Applications'];}if(_0x393c95['account'][_0x5591('0x36')]&&_0x393c95[_0x5591('0x40')][_0x5591('0x36')][_0x5591('0x41')][_0x5591('0x42')]){return _0x393c95[_0x5591('0x40')][_0x5591('0x36')][_0x5591('0x41')][0x0];}var _0xe14aab=_[_0x5591('0xb')](_0x3f40f6[_0x5591('0x25')],{'firstName':_0x3f40f6['body']['from'],'ListId':_0x5254e9[_0x5591('0x43')]});_0xe14aab[_0x3f40f6[_0x5591('0x25')]['mapKey']]=_0x3f40f6[_0x5591('0x25')][_0x5591('0x30')];return db[_0x5591('0x37')][_0x5591('0x44')](_0xe14aab,{'fields':_0x3c10dd,'raw':!![]});}})['then'](function(_0x17f6e6){_0x393c95[_0x5591('0x45')]=_0x17f6e6;if(_0x17f6e6){var _0x2e8123={'ContactId':_0x17f6e6['id'],'FaxAccountId':_0x3f40f6[_0x5591('0x40')]['id'],'fax':_0x17f6e6[_0x5591('0x26')]};return db[_0x5591('0x46')][_0x5591('0x35')]({'where':{'ContactId':_0x17f6e6['id'],'closed':![],'FaxAccountId':_0x3f40f6[_0x5591('0x40')]['id']}})[_0x5591('0x10')](function(_0x1d0f6f){if(_0x1d0f6f){return[_0x1d0f6f,![]];}return db[_0x5591('0x46')][_0x5591('0x44')](_0x2e8123)['then'](function(_0x348620){return[_0x348620,!![]];});});}else{throw new Error(_0x5591('0x47'));}})[_0x5591('0x48')](function(_0x4ae7fd,_0x3369ec){var _0x297c29=_0x4ae7fd[_0x5591('0x3b')]({'plain':!![]});if(_0x3369ec){if(_0x393c95['account'][_0x5591('0x49')]){_0x393c95[_0x5591('0x3c')]['push']({'id':0x0,'priority':_0x393c95['applications'][_0x5591('0x42')]+0x1,'app':_0x5591('0x4a'),'appdata':_0x5591('0x4b'),'interval':_0x5591('0x4c')});}_0x297c29['created']=!![];}else{_0x297c29['created']=![];}_0x393c95['interaction']=_0x297c29;return db[_0x5591('0x4d')][_0x5591('0x44')]({'body':_0x3f40f6['body']['body'],'FaxAccountId':_0x3f40f6[_0x5591('0x40')]['id'],'FaxInteractionId':_0x4ae7fd['id'],'direction':'in','ContactId':_0x4ae7fd[_0x5591('0x4e')],'AttachmentId':_0x3f40f6['body'][_0x5591('0x4f')]});})[_0x5591('0x10')](function(_0x1ec5dd){_0x393c95['message']=_0x1ec5dd;if(_0x393c95['interaction'][_0x5591('0x50')]){return db[_0x5591('0x51')][_0x5591('0x35')]({'attributes':['id',_0x5591('0x52')],'where':{'id':_0x393c95[_0x5591('0x53')][_0x5591('0x50')]}})[_0x5591('0x10')](function(_0x3371d6){if(_0x3371d6){_0x393c95['applications']['unshift']({'id':0x0,'priority':0x0,'app':_0x5591('0x54'),'appdata':_0x3371d6[_0x5591('0x52')]+','+(_0x393c95[_0x5591('0x40')]['waitForTheAssignedAgent']||0xa),'interval':_0x5591('0x4c')});}return respondWithRpcPromise(_0x5591('0x55'),_0x5591('0x56'),_0x393c95);});}return respondWithRpcPromise(_0x5591('0x55'),_0x5591('0x56'),_0x393c95);})[_0x5591('0x10')](function(_0x4a4d2d){_0x1a9aa4(_0x4a4d2d);})[_0x5591('0x24')](function(_0x4dd3c9){_0x2b0bef(_0x30015b[_0x5591('0x15')](0x1f4,_0x4dd3c9['message']));});});};
\ No newline at end of file
index 154067b..6172eb9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa2ff=['save','update','removeListener','length'];(function(_0x576743,_0x213541){var _0x589cdb=function(_0x2ac3fd){while(--_0x2ac3fd){_0x576743['push'](_0x576743['shift']());}};_0x589cdb(++_0x213541);}(_0xa2ff,0x1ec));var _0xfa2f=function(_0x4f2c87,_0x489094){_0x4f2c87=_0x4f2c87-0x0;var _0x137d11=_0xa2ff[_0x4f2c87];return _0x137d11;};'use strict';var FaxAccountEvents=require('./faxAccount.events');var events=[_0xfa2f('0x0'),'remove',_0xfa2f('0x1')];function createListener(_0x8e52ad,_0x1d5b0e){return function(_0x19aaea){_0x1d5b0e['emit'](_0x8e52ad,_0x19aaea);};}function removeListener(_0x31ecfb,_0x597dff){return function(){FaxAccountEvents[_0xfa2f('0x2')](_0x31ecfb,_0x597dff);};}exports['register']=function(_0x82b268){for(var _0x4f71e2=0x0,_0x246769=events[_0xfa2f('0x3')];_0x4f71e2<_0x246769;_0x4f71e2++){var _0x15e26e=events[_0x4f71e2];var _0x51ed23=createListener('faxAccount:'+_0x15e26e,_0x82b268);FaxAccountEvents['on'](_0x15e26e,_0x51ed23);}};
\ No newline at end of file
+var _0x28f2=['save','removeListener','faxAccount:'];(function(_0xfa634c,_0x414e0e){var _0x73e478=function(_0xac2a51){while(--_0xac2a51){_0xfa634c['push'](_0xfa634c['shift']());}};_0x73e478(++_0x414e0e);}(_0x28f2,0xba));var _0x228f=function(_0x1b71ee,_0x1a77e5){_0x1b71ee=_0x1b71ee-0x0;var _0x3a98ac=_0x28f2[_0x1b71ee];return _0x3a98ac;};'use strict';var FaxAccountEvents=require('./faxAccount.events');var events=[_0x228f('0x0'),'remove','update'];function createListener(_0x3412f9,_0x326084){return function(_0x3c5027){_0x326084['emit'](_0x3412f9,_0x3c5027);};}function removeListener(_0x8b1c51,_0xceff94){return function(){FaxAccountEvents[_0x228f('0x1')](_0x8b1c51,_0xceff94);};}exports['register']=function(_0x6345a4){for(var _0x3d08b0=0x0,_0x267df8=events['length'];_0x3d08b0<_0x267df8;_0x3d08b0++){var _0x11d1fe=events[_0x3d08b0];var _0xa0ff6b=createListener(_0x228f('0x2')+_0x11d1fe,_0x6345a4);FaxAccountEvents['on'](_0x11d1fe,_0xa0ff6b);}};
\ No newline at end of file
index dc94785..b0423c9 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(_0x59757b,_0x579e5f){var _0x3d63f0=function(_0x35a366){while(--_0x35a366){_0x59757b['push'](_0x59757b['shift']());}};_0x3d63f0(++_0x579e5f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0xa9e0[_0x187ee1];return _0x388160;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));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(_0x3b50da,_0x1c7ad3){var _0x350f79=function(_0x2fd583){while(--_0x2fd583){_0x3b50da['push'](_0x3b50da['shift']());}};_0x350f79(++_0x1c7ad3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0xa9e0[_0x3c2a69];return _0x596bc8;};'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 5a50429..99af367 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1766=['STRING','sequelize','TEXT'];(function(_0x211632,_0x378e2e){var _0x5a1da1=function(_0x44aff2){while(--_0x44aff2){_0x211632['push'](_0x211632['shift']());}};_0x5a1da1(++_0x378e2e);}(_0x1766,0xfa));var _0x6176=function(_0x2d1e46,_0x3e6bd8){_0x2d1e46=_0x2d1e46-0x0;var _0x5ab901=_0x1766[_0x2d1e46];return _0x5ab901;};'use strict';var Sequelize=require(_0x6176('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x6176('0x1')]()},'description':{'type':Sequelize[_0x6176('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
+var _0xec18=['*,*,*,*','sequelize','exports','INTEGER','TEXT','STRING'];(function(_0x304bd2,_0x18f496){var _0x1ac6ea=function(_0x14eacc){while(--_0x14eacc){_0x304bd2['push'](_0x304bd2['shift']());}};_0x1ac6ea(++_0x18f496);}(_0xec18,0x181));var _0x8ec1=function(_0x70470e,_0x1fa022){_0x70470e=_0x70470e-0x0;var _0x590969=_0xec18[_0x70470e];return _0x590969;};'use strict';var Sequelize=require(_0x8ec1('0x0'));module[_0x8ec1('0x1')]={'priority':{'type':Sequelize[_0x8ec1('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x8ec1('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x8ec1('0x4')],'defaultValue':_0x8ec1('0x5')}};
\ No newline at end of file
index 1a7f33d..a4fa99b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2bb3=['attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','FaxApplication','includeAll','findAll','show','params','include','find','catch','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','error','name','send','map','rawAttributes','key','model','query','keys','filters','intersection'];(function(_0x2a32e1,_0x2dd0ff){var _0x1691d2=function(_0x2ec2ca){while(--_0x2ec2ca){_0x2a32e1['push'](_0x2a32e1['shift']());}};_0x1691d2(++_0x2dd0ff);}(_0x2bb3,0x190));var _0x32bb=function(_0x2aec52,_0x59d962){_0x2aec52=_0x2aec52-0x0;var _0x3b8835=_0x2bb3[_0x2aec52];return _0x3b8835;};'use strict';var emlformat=require(_0x32bb('0x0'));var rimraf=require(_0x32bb('0x1'));var zipdir=require(_0x32bb('0x2'));var jsonpatch=require(_0x32bb('0x3'));var rp=require(_0x32bb('0x4'));var moment=require(_0x32bb('0x5'));var BPromise=require(_0x32bb('0x6'));var Mustache=require('mustache');var util=require(_0x32bb('0x7'));var path=require(_0x32bb('0x8'));var sox=require(_0x32bb('0x9'));var csv=require(_0x32bb('0xa'));var ejs=require(_0x32bb('0xb'));var fs=require('fs');var fs_extra=require(_0x32bb('0xc'));var _=require('lodash');var squel=require(_0x32bb('0xd'));var crypto=require('crypto');var jsforce=require(_0x32bb('0xe'));var deskjs=require(_0x32bb('0xf'));var toCsv=require(_0x32bb('0xa'));var querystring=require(_0x32bb('0x10'));var Papa=require(_0x32bb('0x11'));var Redis=require('ioredis');var authService=require(_0x32bb('0x12'));var qs=require(_0x32bb('0x13'));var as=require(_0x32bb('0x14'));var hardwareService=require(_0x32bb('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x32bb('0x16'));var config=require(_0x32bb('0x17'));var licenseUtil=require(_0x32bb('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x26bed0,_0x54ac2e){_0x54ac2e=_0x54ac2e||0xcc;return function(_0x4cea0d){if(_0x4cea0d){return _0x26bed0[_0x32bb('0x19')](_0x54ac2e);}return _0x26bed0['status'](_0x54ac2e)[_0x32bb('0x1a')]();};}function respondWithResult(_0x4b0179,_0xcf137f){_0xcf137f=_0xcf137f||0xc8;return function(_0x4e0bb8){if(_0x4e0bb8){return _0x4b0179[_0x32bb('0x1b')](_0xcf137f)['json'](_0x4e0bb8);}};}function respondWithFilteredResult(_0x26d232,_0x442821){return function(_0x273fe9){if(_0x273fe9){var _0x1ee870=typeof _0x442821[_0x32bb('0x1c')]===_0x32bb('0x1d')&&typeof _0x442821[_0x32bb('0x1e')]===_0x32bb('0x1d');var _0x5a3d30=_0x273fe9[_0x32bb('0x1f')];var _0x3fbe6f=_0x1ee870?0x0:_0x442821[_0x32bb('0x1c')];var _0x69af08=_0x1ee870?_0x273fe9[_0x32bb('0x1f')]:_0x442821[_0x32bb('0x1c')]+_0x442821[_0x32bb('0x1e')];var _0x19663a;if(_0x69af08>=_0x5a3d30){_0x69af08=_0x5a3d30;_0x19663a=0xc8;}else{_0x19663a=0xce;}_0x26d232[_0x32bb('0x1b')](_0x19663a);return _0x26d232[_0x32bb('0x20')](_0x32bb('0x21'),_0x3fbe6f+'-'+_0x69af08+'/'+_0x5a3d30)[_0x32bb('0x22')](_0x273fe9);}return null;};}function patchUpdates(_0x4e82ae){return function(_0x40c593){try{jsonpatch[_0x32bb('0x23')](_0x40c593,_0x4e82ae,!![]);}catch(_0x5a2da3){return BPromise[_0x32bb('0x24')](_0x5a2da3);}return _0x40c593['save']();};}function saveUpdates(_0x100b7e,_0x7484e){return function(_0x1fd5cf){if(_0x1fd5cf){return _0x1fd5cf[_0x32bb('0x25')](_0x100b7e)[_0x32bb('0x26')](function(_0x210639){return _0x210639;});}return null;};}function removeEntity(_0x3651a7,_0x4a02da){return function(_0x4321cc){if(_0x4321cc){return _0x4321cc['destroy']()[_0x32bb('0x26')](function(){_0x3651a7[_0x32bb('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x24a195,_0x2b0c48){return function(_0x1c5bb0){if(!_0x1c5bb0){_0x24a195[_0x32bb('0x19')](0x194);}return _0x1c5bb0;};}function handleError(_0x393c2a,_0x4a0bb2){_0x4a0bb2=_0x4a0bb2||0x1f4;return function(_0x99add1){logger[_0x32bb('0x27')](_0x99add1['stack']);if(_0x99add1['name']){delete _0x99add1[_0x32bb('0x28')];}_0x393c2a[_0x32bb('0x1b')](_0x4a0bb2)[_0x32bb('0x29')](_0x99add1);};}exports['index']=function(_0x1c6eac,_0x436718){var _0x1ad798={},_0x3ed298={},_0x3b3b1c={'count':0x0,'rows':[]};var _0x5714de=_[_0x32bb('0x2a')](db['FaxApplication'][_0x32bb('0x2b')],function(_0x511924){return{'name':_0x511924['fieldName'],'type':_0x511924['type'][_0x32bb('0x2c')]};});_0x3ed298[_0x32bb('0x2d')]=_['map'](_0x5714de,_0x32bb('0x28'));_0x3ed298[_0x32bb('0x2e')]=_[_0x32bb('0x2f')](_0x1c6eac[_0x32bb('0x2e')]);_0x3ed298[_0x32bb('0x30')]=_[_0x32bb('0x31')](_0x3ed298['model'],_0x3ed298[_0x32bb('0x2e')]);_0x1ad798[_0x32bb('0x32')]=_['intersection'](_0x3ed298[_0x32bb('0x2d')],qs[_0x32bb('0x33')](_0x1c6eac['query'][_0x32bb('0x33')]));_0x1ad798[_0x32bb('0x32')]=_0x1ad798[_0x32bb('0x32')][_0x32bb('0x34')]?_0x1ad798[_0x32bb('0x32')]:_0x3ed298[_0x32bb('0x2d')];if(!_0x1c6eac[_0x32bb('0x2e')][_0x32bb('0x35')](_0x32bb('0x36'))){_0x1ad798[_0x32bb('0x1e')]=qs[_0x32bb('0x1e')](_0x1c6eac[_0x32bb('0x2e')][_0x32bb('0x1e')]);_0x1ad798[_0x32bb('0x1c')]=qs['offset'](_0x1c6eac[_0x32bb('0x2e')][_0x32bb('0x1c')]);}_0x1ad798[_0x32bb('0x37')]=qs[_0x32bb('0x38')](_0x1c6eac[_0x32bb('0x2e')][_0x32bb('0x38')]);_0x1ad798[_0x32bb('0x39')]=qs['filters'](_[_0x32bb('0x3a')](_0x1c6eac[_0x32bb('0x2e')],_0x3ed298[_0x32bb('0x30')]),_0x5714de);if(_0x1c6eac['query'][_0x32bb('0x3b')]){_0x1ad798[_0x32bb('0x39')]=_['merge'](_0x1ad798[_0x32bb('0x39')],{'$or':_['map'](_0x5714de,function(_0x2b81bb){if(_0x2b81bb[_0x32bb('0x3c')]!==_0x32bb('0x3d')){var _0x288a55={};_0x288a55[_0x2b81bb[_0x32bb('0x28')]]={'$like':'%'+_0x1c6eac['query'][_0x32bb('0x3b')]+'%'};return _0x288a55;}})});}_0x1ad798=_[_0x32bb('0x3e')]({},_0x1ad798,_0x1c6eac[_0x32bb('0x3f')]);var _0x26353c={'where':_0x1ad798[_0x32bb('0x39')]};return db[_0x32bb('0x40')][_0x32bb('0x1f')](_0x26353c)['then'](function(_0x3e8959){_0x3b3b1c[_0x32bb('0x1f')]=_0x3e8959;if(_0x1c6eac[_0x32bb('0x2e')][_0x32bb('0x41')]){_0x1ad798['include']=[{'all':!![]}];}return db[_0x32bb('0x40')][_0x32bb('0x42')](_0x1ad798);})[_0x32bb('0x26')](function(_0x7e915b){_0x3b3b1c['rows']=_0x7e915b;return _0x3b3b1c;})[_0x32bb('0x26')](respondWithFilteredResult(_0x436718,_0x1ad798))['catch'](handleError(_0x436718,null));};exports[_0x32bb('0x43')]=function(_0x4e8984,_0x2d079b){var _0x2c57b6={'raw':!![],'where':{'id':_0x4e8984[_0x32bb('0x44')]['id']}},_0x5d7286={};_0x5d7286[_0x32bb('0x2d')]=_[_0x32bb('0x2f')](db['FaxApplication'][_0x32bb('0x2b')]);_0x5d7286['query']=_[_0x32bb('0x2f')](_0x4e8984[_0x32bb('0x2e')]);_0x5d7286[_0x32bb('0x30')]=_[_0x32bb('0x31')](_0x5d7286[_0x32bb('0x2d')],_0x5d7286['query']);_0x2c57b6['attributes']=_['intersection'](_0x5d7286['model'],qs[_0x32bb('0x33')](_0x4e8984[_0x32bb('0x2e')]['fields']));_0x2c57b6[_0x32bb('0x32')]=_0x2c57b6[_0x32bb('0x32')][_0x32bb('0x34')]?_0x2c57b6['attributes']:_0x5d7286[_0x32bb('0x2d')];if(_0x4e8984[_0x32bb('0x2e')][_0x32bb('0x41')]){_0x2c57b6[_0x32bb('0x45')]=[{'all':!![]}];}_0x2c57b6=_[_0x32bb('0x3e')]({},_0x2c57b6,_0x4e8984['options']);return db['FaxApplication'][_0x32bb('0x46')](_0x2c57b6)[_0x32bb('0x26')](handleEntityNotFound(_0x2d079b,null))[_0x32bb('0x26')](respondWithResult(_0x2d079b,null))[_0x32bb('0x47')](handleError(_0x2d079b,null));};exports[_0x32bb('0x48')]=function(_0x47525e,_0x3bc95c){return db[_0x32bb('0x40')][_0x32bb('0x48')](_0x47525e[_0x32bb('0x49')],{})[_0x32bb('0x26')](respondWithResult(_0x3bc95c,0xc9))[_0x32bb('0x47')](handleError(_0x3bc95c,null));};exports[_0x32bb('0x25')]=function(_0x35670c,_0x5ab345){if(_0x35670c[_0x32bb('0x49')]['id']){delete _0x35670c[_0x32bb('0x49')]['id'];}return db[_0x32bb('0x40')]['find']({'where':{'id':_0x35670c['params']['id']}})[_0x32bb('0x26')](handleEntityNotFound(_0x5ab345,null))[_0x32bb('0x26')](saveUpdates(_0x35670c[_0x32bb('0x49')],null))[_0x32bb('0x26')](respondWithResult(_0x5ab345,null))[_0x32bb('0x47')](handleError(_0x5ab345,null));};exports[_0x32bb('0x4a')]=function(_0x349378,_0x5111d1){return db[_0x32bb('0x40')]['find']({'where':{'id':_0x349378[_0x32bb('0x44')]['id']}})['then'](handleEntityNotFound(_0x5111d1,null))[_0x32bb('0x26')](removeEntity(_0x5111d1,null))[_0x32bb('0x47')](handleError(_0x5111d1,null));};
\ No newline at end of file
+var _0x3088=['then','includeAll','findAll','rows','catch','show','params','include','create','body','update','find','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','save','destroy','error','stack','name','send','index','FaxApplication','rawAttributes','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','options'];(function(_0xc4001c,_0x1bf8f0){var _0x49f7bc=function(_0x1059b8){while(--_0x1059b8){_0xc4001c['push'](_0xc4001c['shift']());}};_0x49f7bc(++_0x1bf8f0);}(_0x3088,0x140));var _0x8308=function(_0xa4c85,_0x2b52a7){_0xa4c85=_0xa4c85-0x0;var _0x172c1f=_0x3088[_0xa4c85];return _0x172c1f;};'use strict';var emlformat=require(_0x8308('0x0'));var rimraf=require(_0x8308('0x1'));var zipdir=require(_0x8308('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8308('0x3'));var moment=require(_0x8308('0x4'));var BPromise=require(_0x8308('0x5'));var Mustache=require(_0x8308('0x6'));var util=require(_0x8308('0x7'));var path=require(_0x8308('0x8'));var sox=require(_0x8308('0x9'));var csv=require(_0x8308('0xa'));var ejs=require(_0x8308('0xb'));var fs=require('fs');var fs_extra=require(_0x8308('0xc'));var _=require(_0x8308('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x8308('0xe'));var deskjs=require(_0x8308('0xf'));var toCsv=require(_0x8308('0xa'));var querystring=require(_0x8308('0x10'));var Papa=require(_0x8308('0x11'));var Redis=require(_0x8308('0x12'));var authService=require(_0x8308('0x13'));var qs=require(_0x8308('0x14'));var as=require(_0x8308('0x15'));var hardwareService=require(_0x8308('0x16'));var logger=require(_0x8308('0x17'))('api');var utils=require(_0x8308('0x18'));var config=require(_0x8308('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4d2ec0,_0x3f170e){_0x3f170e=_0x3f170e||0xcc;return function(_0x501603){if(_0x501603){return _0x4d2ec0[_0x8308('0x1a')](_0x3f170e);}return _0x4d2ec0[_0x8308('0x1b')](_0x3f170e)[_0x8308('0x1c')]();};}function respondWithResult(_0xffc597,_0x2a165c){_0x2a165c=_0x2a165c||0xc8;return function(_0x30958e){if(_0x30958e){return _0xffc597[_0x8308('0x1b')](_0x2a165c)['json'](_0x30958e);}};}function respondWithFilteredResult(_0x3da505,_0x119c78){return function(_0x4ac50a){if(_0x4ac50a){var _0x5a3947=typeof _0x119c78[_0x8308('0x1d')]===_0x8308('0x1e')&&typeof _0x119c78[_0x8308('0x1f')]==='undefined';var _0x2811e0=_0x4ac50a[_0x8308('0x20')];var _0x3829bd=_0x5a3947?0x0:_0x119c78['offset'];var _0x432ba8=_0x5a3947?_0x4ac50a[_0x8308('0x20')]:_0x119c78[_0x8308('0x1d')]+_0x119c78[_0x8308('0x1f')];var _0x3f2584;if(_0x432ba8>=_0x2811e0){_0x432ba8=_0x2811e0;_0x3f2584=0xc8;}else{_0x3f2584=0xce;}_0x3da505['status'](_0x3f2584);return _0x3da505[_0x8308('0x21')](_0x8308('0x22'),_0x3829bd+'-'+_0x432ba8+'/'+_0x2811e0)[_0x8308('0x23')](_0x4ac50a);}return null;};}function patchUpdates(_0x1eb944){return function(_0x1c105a){try{jsonpatch['apply'](_0x1c105a,_0x1eb944,!![]);}catch(_0x1c03da){return BPromise['reject'](_0x1c03da);}return _0x1c105a[_0x8308('0x24')]();};}function saveUpdates(_0x25352c,_0x530b83){return function(_0x4c518b){if(_0x4c518b){return _0x4c518b['update'](_0x25352c)['then'](function(_0x465b57){return _0x465b57;});}return null;};}function removeEntity(_0x1fda2a,_0x34a122){return function(_0x4ad2e2){if(_0x4ad2e2){return _0x4ad2e2[_0x8308('0x25')]()['then'](function(){_0x1fda2a[_0x8308('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x23441a,_0x512ff7){return function(_0x1aab5e){if(!_0x1aab5e){_0x23441a['sendStatus'](0x194);}return _0x1aab5e;};}function handleError(_0x31263b,_0x1d23b1){_0x1d23b1=_0x1d23b1||0x1f4;return function(_0x169a26){logger[_0x8308('0x26')](_0x169a26[_0x8308('0x27')]);if(_0x169a26['name']){delete _0x169a26[_0x8308('0x28')];}_0x31263b[_0x8308('0x1b')](_0x1d23b1)[_0x8308('0x29')](_0x169a26);};}exports[_0x8308('0x2a')]=function(_0x1cb6d1,_0x36c147){var _0x3df3ef={},_0x3deb1e={},_0x5cde7d={'count':0x0,'rows':[]};var _0x2563d1=_['map'](db[_0x8308('0x2b')][_0x8308('0x2c')],function(_0x13d0b8){return{'name':_0x13d0b8['fieldName'],'type':_0x13d0b8['type'][_0x8308('0x2d')]};});_0x3deb1e['model']=_[_0x8308('0x2e')](_0x2563d1,'name');_0x3deb1e[_0x8308('0x2f')]=_[_0x8308('0x30')](_0x1cb6d1[_0x8308('0x2f')]);_0x3deb1e[_0x8308('0x31')]=_[_0x8308('0x32')](_0x3deb1e[_0x8308('0x33')],_0x3deb1e[_0x8308('0x2f')]);_0x3df3ef[_0x8308('0x34')]=_[_0x8308('0x32')](_0x3deb1e[_0x8308('0x33')],qs[_0x8308('0x35')](_0x1cb6d1['query'][_0x8308('0x35')]));_0x3df3ef[_0x8308('0x34')]=_0x3df3ef['attributes'][_0x8308('0x36')]?_0x3df3ef[_0x8308('0x34')]:_0x3deb1e['model'];if(!_0x1cb6d1['query'][_0x8308('0x37')](_0x8308('0x38'))){_0x3df3ef[_0x8308('0x1f')]=qs['limit'](_0x1cb6d1[_0x8308('0x2f')]['limit']);_0x3df3ef[_0x8308('0x1d')]=qs[_0x8308('0x1d')](_0x1cb6d1['query'][_0x8308('0x1d')]);}_0x3df3ef[_0x8308('0x39')]=qs[_0x8308('0x3a')](_0x1cb6d1[_0x8308('0x2f')]['sort']);_0x3df3ef[_0x8308('0x3b')]=qs[_0x8308('0x31')](_[_0x8308('0x3c')](_0x1cb6d1[_0x8308('0x2f')],_0x3deb1e[_0x8308('0x31')]),_0x2563d1);if(_0x1cb6d1[_0x8308('0x2f')][_0x8308('0x3d')]){_0x3df3ef[_0x8308('0x3b')]=_[_0x8308('0x3e')](_0x3df3ef['where'],{'$or':_[_0x8308('0x2e')](_0x2563d1,function(_0x334bba){if(_0x334bba[_0x8308('0x3f')]!=='VIRTUAL'){var _0x510883={};_0x510883[_0x334bba['name']]={'$like':'%'+_0x1cb6d1['query']['filter']+'%'};return _0x510883;}})});}_0x3df3ef=_['merge']({},_0x3df3ef,_0x1cb6d1[_0x8308('0x40')]);var _0x119898={'where':_0x3df3ef[_0x8308('0x3b')]};return db[_0x8308('0x2b')]['count'](_0x119898)[_0x8308('0x41')](function(_0x1b9aff){_0x5cde7d[_0x8308('0x20')]=_0x1b9aff;if(_0x1cb6d1[_0x8308('0x2f')][_0x8308('0x42')]){_0x3df3ef['include']=[{'all':!![]}];}return db['FaxApplication'][_0x8308('0x43')](_0x3df3ef);})[_0x8308('0x41')](function(_0x82cc4d){_0x5cde7d[_0x8308('0x44')]=_0x82cc4d;return _0x5cde7d;})[_0x8308('0x41')](respondWithFilteredResult(_0x36c147,_0x3df3ef))[_0x8308('0x45')](handleError(_0x36c147,null));};exports[_0x8308('0x46')]=function(_0x33ae56,_0x2957bd){var _0x5afce7={'raw':!![],'where':{'id':_0x33ae56[_0x8308('0x47')]['id']}},_0x10ac75={};_0x10ac75[_0x8308('0x33')]=_[_0x8308('0x30')](db[_0x8308('0x2b')][_0x8308('0x2c')]);_0x10ac75[_0x8308('0x2f')]=_[_0x8308('0x30')](_0x33ae56[_0x8308('0x2f')]);_0x10ac75[_0x8308('0x31')]=_['intersection'](_0x10ac75[_0x8308('0x33')],_0x10ac75[_0x8308('0x2f')]);_0x5afce7[_0x8308('0x34')]=_[_0x8308('0x32')](_0x10ac75['model'],qs[_0x8308('0x35')](_0x33ae56[_0x8308('0x2f')][_0x8308('0x35')]));_0x5afce7[_0x8308('0x34')]=_0x5afce7[_0x8308('0x34')][_0x8308('0x36')]?_0x5afce7['attributes']:_0x10ac75[_0x8308('0x33')];if(_0x33ae56['query'][_0x8308('0x42')]){_0x5afce7[_0x8308('0x48')]=[{'all':!![]}];}_0x5afce7=_['merge']({},_0x5afce7,_0x33ae56[_0x8308('0x40')]);return db[_0x8308('0x2b')]['find'](_0x5afce7)[_0x8308('0x41')](handleEntityNotFound(_0x2957bd,null))[_0x8308('0x41')](respondWithResult(_0x2957bd,null))[_0x8308('0x45')](handleError(_0x2957bd,null));};exports[_0x8308('0x49')]=function(_0x6fad0,_0x5b7ae0){return db['FaxApplication'][_0x8308('0x49')](_0x6fad0[_0x8308('0x4a')],{})['then'](respondWithResult(_0x5b7ae0,0xc9))[_0x8308('0x45')](handleError(_0x5b7ae0,null));};exports[_0x8308('0x4b')]=function(_0x422915,_0x575492){if(_0x422915['body']['id']){delete _0x422915[_0x8308('0x4a')]['id'];}return db['FaxApplication'][_0x8308('0x4c')]({'where':{'id':_0x422915[_0x8308('0x47')]['id']}})[_0x8308('0x41')](handleEntityNotFound(_0x575492,null))[_0x8308('0x41')](saveUpdates(_0x422915[_0x8308('0x4a')],null))[_0x8308('0x41')](respondWithResult(_0x575492,null))[_0x8308('0x45')](handleError(_0x575492,null));};exports[_0x8308('0x25')]=function(_0x45b1d0,_0x51691e){return db[_0x8308('0x2b')][_0x8308('0x4c')]({'where':{'id':_0x45b1d0[_0x8308('0x47')]['id']}})[_0x8308('0x41')](handleEntityNotFound(_0x51691e,null))[_0x8308('0x41')](removeEntity(_0x51691e,null))['catch'](handleError(_0x51691e,null));};
\ No newline at end of file
index 5053bd8..b84ba24 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x177f=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./faxApplication.attributes','exports','FaxApplication','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x42fb66,_0x2f7f7e){var _0x197e2a=function(_0x31a5e3){while(--_0x31a5e3){_0x42fb66['push'](_0x42fb66['shift']());}};_0x197e2a(++_0x2f7f7e);}(_0x177f,0xf5));var _0xf177=function(_0xb7acca,_0x15a520){_0xb7acca=_0xb7acca-0x0;var _0x176c7a=_0x177f[_0xb7acca];return _0x176c7a;};'use strict';var _=require(_0xf177('0x0'));var util=require(_0xf177('0x1'));var logger=require('../../config/logger')(_0xf177('0x2'));var moment=require(_0xf177('0x3'));var BPromise=require(_0xf177('0x4'));var rp=require(_0xf177('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf177('0x6'));var config=require(_0xf177('0x7'));var attributes=require(_0xf177('0x8'));module[_0xf177('0x9')]=function(_0x47128a,_0x123115){return _0x47128a['define'](_0xf177('0xa'),attributes,{'tableName':'fax_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf177('0xb'),'collate':_0xf177('0xc')});};
\ No newline at end of file
+var _0x72ef=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxApplication.attributes','exports','define','FaxApplication','util','../../config/logger','api'];(function(_0x13b02f,_0x462a53){var _0x12e9a6=function(_0x187d57){while(--_0x187d57){_0x13b02f['push'](_0x13b02f['shift']());}};_0x12e9a6(++_0x462a53);}(_0x72ef,0x1aa));var _0xf72e=function(_0x51e880,_0x2e410e){_0x51e880=_0x51e880-0x0;var _0x433f9d=_0x72ef[_0x51e880];return _0x433f9d;};'use strict';var _=require('lodash');var util=require(_0xf72e('0x0'));var logger=require(_0xf72e('0x1'))(_0xf72e('0x2'));var moment=require(_0xf72e('0x3'));var BPromise=require(_0xf72e('0x4'));var rp=require(_0xf72e('0x5'));var fs=require('fs');var path=require(_0xf72e('0x6'));var rimraf=require(_0xf72e('0x7'));var config=require(_0xf72e('0x8'));var attributes=require(_0xf72e('0x9'));module[_0xf72e('0xa')]=function(_0x411b9f,_0x32946f){return _0x411b9f[_0xf72e('0xb')](_0xf72e('0xc'),attributes,{'tableName':'fax_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
index b8326ae..04047e8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8994=['../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','debug','FaxApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','FaxApplication,\x20%s,\x20%s','result','UpdateFaxApplication','FaxApplication','update','options','raw','where','limit','info','catch','lodash','util','moment','bluebird','ioredis'];(function(_0x2835b9,_0x726de9){var _0x16e170=function(_0x23b81a){while(--_0x23b81a){_0x2835b9['push'](_0x2835b9['shift']());}};_0x16e170(++_0x726de9);}(_0x8994,0x16f));var _0x4899=function(_0x10004e,_0xd701e6){_0x10004e=_0x10004e-0x0;var _0x5af990=_0x8994[_0x10004e];return _0x5af990;};'use strict';var _=require(_0x4899('0x0'));var util=require(_0x4899('0x1'));var moment=require(_0x4899('0x2'));var BPromise=require(_0x4899('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4899('0x4'));var db=require(_0x4899('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x4899('0x6'))(_0x4899('0x7'));var config=require('../../config/environment');var jayson=require(_0x4899('0x8'));var client=jayson[_0x4899('0x9')][_0x4899('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x123126,_0x252436,_0x4d0809){return new BPromise(function(_0x3e6e5f,_0x542cf9){return client[_0x4899('0xb')](_0x123126,_0x4d0809)[_0x4899('0xc')](function(_0x26d2ab){logger['info']('FaxApplication,\x20%s,\x20%s',_0x252436,'request\x20sent');logger[_0x4899('0xd')](_0x4899('0xe'),_0x252436,_0x4899('0xf'),JSON[_0x4899('0x10')](_0x26d2ab));if(_0x26d2ab['error']){if(_0x26d2ab[_0x4899('0x11')][_0x4899('0x12')]===0x1f4){logger[_0x4899('0x11')]('FaxApplication,\x20%s,\x20%s',_0x252436,_0x26d2ab[_0x4899('0x11')][_0x4899('0x13')]);return _0x542cf9(_0x26d2ab[_0x4899('0x11')][_0x4899('0x13')]);}logger['error'](_0x4899('0x14'),_0x252436,_0x26d2ab[_0x4899('0x11')]['message']);return _0x3e6e5f(_0x26d2ab[_0x4899('0x11')][_0x4899('0x13')]);}else{logger['info'](_0x4899('0x14'),_0x252436,'request\x20sent');_0x3e6e5f(_0x26d2ab[_0x4899('0x15')]['message']);}})['catch'](function(_0x463884){logger['error'](_0x4899('0x14'),_0x252436,_0x463884);_0x542cf9(_0x463884);});});}exports[_0x4899('0x16')]=function(_0x2a58b6){var _0x1fb68e=this;return new Promise(function(_0x3dc804,_0x156b1a){return db[_0x4899('0x17')][_0x4899('0x18')](_0x2a58b6['body'],{'raw':_0x2a58b6[_0x4899('0x19')]?_0x2a58b6['options'][_0x4899('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2a58b6[_0x4899('0x19')]?_0x2a58b6[_0x4899('0x19')][_0x4899('0x1b')]||null:null,'attributes':_0x2a58b6[_0x4899('0x19')]?_0x2a58b6[_0x4899('0x19')]['attributes']||null:null,'limit':_0x2a58b6[_0x4899('0x19')]?_0x2a58b6[_0x4899('0x19')][_0x4899('0x1c')]||null:null})[_0x4899('0xc')](function(_0x1f787a){logger[_0x4899('0x1d')](_0x4899('0x16'),_0x2a58b6);logger['debug'](_0x4899('0x16'),_0x2a58b6,JSON[_0x4899('0x10')](_0x1f787a));_0x3dc804(_0x1f787a);})[_0x4899('0x1e')](function(_0x458ebc){logger['error'](_0x4899('0x16'),_0x458ebc[_0x4899('0x13')],_0x2a58b6);_0x156b1a(_0x1fb68e[_0x4899('0x11')](0x1f4,_0x458ebc[_0x4899('0x13')]));});});};
\ No newline at end of file
+var _0x1b91=['result','catch','UpdateFaxApplication','update','body','options','raw','where','attributes','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x1a485b,_0x248119){var _0x4d2842=function(_0x38708b){while(--_0x38708b){_0x1a485b['push'](_0x1a485b['shift']());}};_0x4d2842(++_0x248119);}(_0x1b91,0x171));var _0x11b9=function(_0x3fe491,_0x4d2e93){_0x3fe491=_0x3fe491-0x0;var _0x19c2e6=_0x1b91[_0x3fe491];return _0x19c2e6;};'use strict';var _=require(_0x11b9('0x0'));var util=require(_0x11b9('0x1'));var moment=require(_0x11b9('0x2'));var BPromise=require(_0x11b9('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x11b9('0x4'));var db=require(_0x11b9('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x11b9('0x6'))(_0x11b9('0x7'));var config=require(_0x11b9('0x8'));var jayson=require(_0x11b9('0x9'));var client=jayson['client'][_0x11b9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x506dc3,_0x14815d,_0x2509fa){return new BPromise(function(_0x162775,_0x1f56f0){return client[_0x11b9('0xb')](_0x506dc3,_0x2509fa)[_0x11b9('0xc')](function(_0x78e435){logger[_0x11b9('0xd')](_0x11b9('0xe'),_0x14815d,_0x11b9('0xf'));logger[_0x11b9('0x10')](_0x11b9('0x11'),_0x14815d,'request\x20sent',JSON[_0x11b9('0x12')](_0x78e435));if(_0x78e435[_0x11b9('0x13')]){if(_0x78e435[_0x11b9('0x13')]['code']===0x1f4){logger[_0x11b9('0x13')]('FaxApplication,\x20%s,\x20%s',_0x14815d,_0x78e435['error'][_0x11b9('0x14')]);return _0x1f56f0(_0x78e435['error']['message']);}logger[_0x11b9('0x13')]('FaxApplication,\x20%s,\x20%s',_0x14815d,_0x78e435[_0x11b9('0x13')][_0x11b9('0x14')]);return _0x162775(_0x78e435['error'][_0x11b9('0x14')]);}else{logger[_0x11b9('0xd')]('FaxApplication,\x20%s,\x20%s',_0x14815d,_0x11b9('0xf'));_0x162775(_0x78e435[_0x11b9('0x15')][_0x11b9('0x14')]);}})[_0x11b9('0x16')](function(_0x40b021){logger['error'](_0x11b9('0xe'),_0x14815d,_0x40b021);_0x1f56f0(_0x40b021);});});}exports[_0x11b9('0x17')]=function(_0x254069){var _0x46017e=this;return new Promise(function(_0x28cf64,_0x11419c){return db['FaxApplication'][_0x11b9('0x18')](_0x254069[_0x11b9('0x19')],{'raw':_0x254069[_0x11b9('0x1a')]?_0x254069[_0x11b9('0x1a')][_0x11b9('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x254069[_0x11b9('0x1a')]?_0x254069['options'][_0x11b9('0x1c')]||null:null,'attributes':_0x254069[_0x11b9('0x1a')]?_0x254069[_0x11b9('0x1a')][_0x11b9('0x1d')]||null:null,'limit':_0x254069[_0x11b9('0x1a')]?_0x254069[_0x11b9('0x1a')]['limit']||null:null})['then'](function(_0x1e66f6){logger['info']('UpdateFaxApplication',_0x254069);logger[_0x11b9('0x10')](_0x11b9('0x17'),_0x254069,JSON[_0x11b9('0x12')](_0x1e66f6));_0x28cf64(_0x1e66f6);})['catch'](function(_0x20cad4){logger['error']('UpdateFaxApplication',_0x20cad4[_0x11b9('0x14')],_0x254069);_0x11419c(_0x46017e['error'](0x1f4,_0x20cad4[_0x11b9('0x14')]));});});};
\ No newline at end of file
index f55cd51..4735691 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe605=['../../components/auth/service','../../components/interaction/service','../../config/environment','./faxApplication.controller','get','isAuthenticated','index','create','put','/:id','update','delete','exports','multer','util','connect-timeout','express','Router','fs-extra'];(function(_0x1e6d38,_0x8ce39){var _0x19dc36=function(_0x464409){while(--_0x464409){_0x1e6d38['push'](_0x1e6d38['shift']());}};_0x19dc36(++_0x8ce39);}(_0xe605,0x92));var _0x5e60=function(_0x37db10,_0xca4679){_0x37db10=_0x37db10-0x0;var _0x270b30=_0xe605[_0x37db10];return _0x270b30;};'use strict';var multer=require(_0x5e60('0x0'));var util=require(_0x5e60('0x1'));var path=require('path');var timeout=require(_0x5e60('0x2'));var express=require(_0x5e60('0x3'));var router=express[_0x5e60('0x4')]();var fs_extra=require(_0x5e60('0x5'));var auth=require(_0x5e60('0x6'));var interaction=require(_0x5e60('0x7'));var config=require(_0x5e60('0x8'));var controller=require(_0x5e60('0x9'));router[_0x5e60('0xa')]('/',auth[_0x5e60('0xb')](),controller[_0x5e60('0xc')]);router[_0x5e60('0xa')]('/:id',auth[_0x5e60('0xb')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x5e60('0xd')]);router[_0x5e60('0xe')](_0x5e60('0xf'),auth[_0x5e60('0xb')](),controller[_0x5e60('0x10')]);router[_0x5e60('0x11')]('/:id',auth[_0x5e60('0xb')](),controller['destroy']);module[_0x5e60('0x12')]=router;
\ No newline at end of file
+var _0x5eb8=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxApplication.controller','get','isAuthenticated','index','/:id','show','put','update','delete','exports','path','connect-timeout','express','Router'];(function(_0x27ce2c,_0x537242){var _0x58408c=function(_0x4f24b7){while(--_0x4f24b7){_0x27ce2c['push'](_0x27ce2c['shift']());}};_0x58408c(++_0x537242);}(_0x5eb8,0xb0));var _0x85eb=function(_0x509d9e,_0x2d1197){_0x509d9e=_0x509d9e-0x0;var _0x56b488=_0x5eb8[_0x509d9e];return _0x56b488;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x85eb('0x0'));var timeout=require(_0x85eb('0x1'));var express=require(_0x85eb('0x2'));var router=express[_0x85eb('0x3')]();var fs_extra=require(_0x85eb('0x4'));var auth=require(_0x85eb('0x5'));var interaction=require(_0x85eb('0x6'));var config=require(_0x85eb('0x7'));var controller=require(_0x85eb('0x8'));router[_0x85eb('0x9')]('/',auth[_0x85eb('0xa')](),controller[_0x85eb('0xb')]);router['get'](_0x85eb('0xc'),auth[_0x85eb('0xa')](),controller[_0x85eb('0xd')]);router['post']('/',auth[_0x85eb('0xa')](),controller['create']);router[_0x85eb('0xe')](_0x85eb('0xc'),auth[_0x85eb('0xa')](),controller[_0x85eb('0xf')]);router[_0x85eb('0x10')](_0x85eb('0xc'),auth[_0x85eb('0xa')](),controller['destroy']);module[_0x85eb('0x11')]=router;
\ No newline at end of file
index 03cc565..2042080 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9ab8=['DATE','ENUM','out','sequelize','exports','BOOLEAN','STRING'];(function(_0x2bd0dd,_0x167fb0){var _0x4637bb=function(_0x1bf601){while(--_0x1bf601){_0x2bd0dd['push'](_0x2bd0dd['shift']());}};_0x4637bb(++_0x167fb0);}(_0x9ab8,0x81));var _0x89ab=function(_0x455e82,_0x4c3f37){_0x455e82=_0x455e82-0x0;var _0x5902f5=_0x9ab8[_0x455e82];return _0x5902f5;};'use strict';var Sequelize=require(_0x89ab('0x0'));module[_0x89ab('0x1')]={'closed':{'type':Sequelize[_0x89ab('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x89ab('0x3')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x89ab('0x3')]},'read1stAt':{'type':Sequelize[_0x89ab('0x4')]},'fax':{'type':Sequelize['STRING']},'firstMsgDirection':{'type':Sequelize[_0x89ab('0x5')]('in',_0x89ab('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x89ab('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x89ab('0x5')]('in',_0x89ab('0x6')),'defaultValue':'in','allowNull':![]}};
\ No newline at end of file
+var _0xdfdf=['ENUM','out','sequelize','exports','DATE','STRING'];(function(_0x19288f,_0x593b58){var _0x280b73=function(_0x344efa){while(--_0x344efa){_0x19288f['push'](_0x19288f['shift']());}};_0x280b73(++_0x593b58);}(_0xdfdf,0xbc));var _0xfdfd=function(_0x1a6bc2,_0xded309){_0x1a6bc2=_0x1a6bc2-0x0;var _0x50faf8=_0xdfdf[_0x1a6bc2];return _0x50faf8;};'use strict';var Sequelize=require(_0xfdfd('0x0'));module[_0xfdfd('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xfdfd('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xfdfd('0x3')]},'note':{'type':Sequelize[_0xfdfd('0x3')]},'read1stAt':{'type':Sequelize[_0xfdfd('0x2')]},'fax':{'type':Sequelize['STRING']},'firstMsgDirection':{'type':Sequelize[_0xfdfd('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xfdfd('0x2')]},'lastMsgDirection':{'type':Sequelize[_0xfdfd('0x4')]('in',_0xfdfd('0x5')),'defaultValue':'in','allowNull':![]}};
\ No newline at end of file
index 13a9361..03f7f7f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa4c4=['value','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','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','type','text','start','body','FaxAccountId','i.FaxAccountId\x20IN\x20?','concat','createdAt','$gte','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.fax\x20LIKE\x20?','group','Sequelize','QueryTypes','SELECT','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','contactName','DESC','isEmpty','t.id\x20IN\x20?','role','getFaxAccounts','user','sequelize','toString','keyBy','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','FaxInteractionId','push','all','rows','catch','params','includeAll','include','merge','options','create','update','describe','addMessage','FaxMessage','ids','omit','getMessages','findOne','format','findAll','addTags','setTags','faxInteractionTags:save','removeTags','download','unix','files','join','server','attachments','Attachment','Messages','get','mkdirSync','basename','existsSync','createReadStream','pipe','createWriteStream','resolve','log','err','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./faxInteraction.socket','register','status','end','json','offset','undefined','limit','count','set','apply','reject','then','destroy','sendStatus','error','stack','name','send','fullname','TagIds','split','forEach','Tags','waiting','talking','unmanaged','closed','UserId','total','index','map','FaxInteraction','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','select','field','color','tools_tags','u.fullname','ui.FaxInteractionId','from','user_has_fax_interactions','left_join','u.id\x20=\x20ui.UserId','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','a.id\x20=\x20i.FaxAccountId','me.FaxInteractionId\x20=\x20i.id','it.FaxInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','find','unreadMessages','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring'];(function(_0x5b740b,_0x381833){var _0x6f8f4e=function(_0x86d068){while(--_0x86d068){_0x5b740b['push'](_0x5b740b['shift']());}};_0x6f8f4e(++_0x381833);}(_0xa4c4,0x72));var _0x4a4c=function(_0x3ed788,_0x5960f6){_0x3ed788=_0x3ed788-0x0;var _0x5ca00b=_0xa4c4[_0x3ed788];return _0x5ca00b;};'use strict';var emlformat=require(_0x4a4c('0x0'));var rimraf=require(_0x4a4c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x4a4c('0x2'));var moment=require(_0x4a4c('0x3'));var BPromise=require(_0x4a4c('0x4'));var Mustache=require(_0x4a4c('0x5'));var util=require(_0x4a4c('0x6'));var path=require(_0x4a4c('0x7'));var sox=require(_0x4a4c('0x8'));var csv=require(_0x4a4c('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4a4c('0xa'));var _=require(_0x4a4c('0xb'));var squel=require(_0x4a4c('0xc'));var crypto=require(_0x4a4c('0xd'));var jsforce=require(_0x4a4c('0xe'));var deskjs=require(_0x4a4c('0xf'));var toCsv=require(_0x4a4c('0x9'));var querystring=require(_0x4a4c('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x4a4c('0x11'));var as=require(_0x4a4c('0x12'));var hardwareService=require(_0x4a4c('0x13'));var logger=require(_0x4a4c('0x14'))(_0x4a4c('0x15'));var utils=require(_0x4a4c('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x4a4c('0x17'));var db=require(_0x4a4c('0x18'))['db'];config[_0x4a4c('0x19')]=_[_0x4a4c('0x1a')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x4a4c('0x1b'))(new Redis(config[_0x4a4c('0x19')]));require(_0x4a4c('0x1c'))[_0x4a4c('0x1d')](socket);function respondWithStatusCode(_0x503834,_0x29d049){_0x29d049=_0x29d049||0xcc;return function(_0x34254d){if(_0x34254d){return _0x503834['sendStatus'](_0x29d049);}return _0x503834[_0x4a4c('0x1e')](_0x29d049)[_0x4a4c('0x1f')]();};}function respondWithResult(_0xf1d97f,_0x134aa3){_0x134aa3=_0x134aa3||0xc8;return function(_0x2dc24a){if(_0x2dc24a){return _0xf1d97f['status'](_0x134aa3)[_0x4a4c('0x20')](_0x2dc24a);}};}function respondWithFilteredResult(_0x68ca5b,_0x4ea136){return function(_0x270d08){if(_0x270d08){var _0x209768=typeof _0x4ea136[_0x4a4c('0x21')]===_0x4a4c('0x22')&&typeof _0x4ea136[_0x4a4c('0x23')]===_0x4a4c('0x22');var _0x58719a=_0x270d08[_0x4a4c('0x24')];var _0x480511=_0x209768?0x0:_0x4ea136[_0x4a4c('0x21')];var _0x851bc3=_0x209768?_0x270d08[_0x4a4c('0x24')]:_0x4ea136[_0x4a4c('0x21')]+_0x4ea136['limit'];var _0x513b4a;if(_0x851bc3>=_0x58719a){_0x851bc3=_0x58719a;_0x513b4a=0xc8;}else{_0x513b4a=0xce;}_0x68ca5b[_0x4a4c('0x1e')](_0x513b4a);return _0x68ca5b[_0x4a4c('0x25')]('Content-Range',_0x480511+'-'+_0x851bc3+'/'+_0x58719a)[_0x4a4c('0x20')](_0x270d08);}return null;};}function patchUpdates(_0x5bd3e5){return function(_0x56a701){try{jsonpatch[_0x4a4c('0x26')](_0x56a701,_0x5bd3e5,!![]);}catch(_0x406104){return BPromise[_0x4a4c('0x27')](_0x406104);}return _0x56a701['save']();};}function saveUpdates(_0x1ed176,_0x4c139e){return function(_0x17dccd){if(_0x17dccd){return _0x17dccd['update'](_0x1ed176)[_0x4a4c('0x28')](function(_0x5a0f3c){return _0x5a0f3c;});}return null;};}function removeEntity(_0x1340ae,_0x4afbbd){return function(_0x1232a7){if(_0x1232a7){return _0x1232a7[_0x4a4c('0x29')]()[_0x4a4c('0x28')](function(){_0x1340ae[_0x4a4c('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4a270e,_0x1b7351){return function(_0x763675){if(!_0x763675){_0x4a270e[_0x4a4c('0x2a')](0x194);}return _0x763675;};}function handleError(_0x4d69ab,_0x2a1783){_0x2a1783=_0x2a1783||0x1f4;return function(_0x2bd3d1){logger[_0x4a4c('0x2b')](_0x2bd3d1[_0x4a4c('0x2c')]);if(_0x2bd3d1[_0x4a4c('0x2d')]){delete _0x2bd3d1[_0x4a4c('0x2d')];}_0x4d69ab['status'](_0x2a1783)[_0x4a4c('0x2e')](_0x2bd3d1);};}function getInteractionUsers(_0x9938a8,_0x6fa687){return new BPromise(function(_0x3666ca,_0x2a3291){try{if(_0x6fa687[_0x9938a8['id']]){_0x9938a8['Users']=_['map'](_0x6fa687[_0x9938a8['id']],function(_0x2be930){return{'id':_0x2be930['id'],'fullname':_0x2be930[_0x4a4c('0x2f')]};});}}catch(_0x5b3c1e){_0x2a3291(_0x5b3c1e);}_0x3666ca(_0x9938a8);});}function getInteractionTags(_0x2ba00e,_0x24e614){return new BPromise(function(_0x44dadd,_0x3f09f5){try{if(_0x2ba00e[_0x4a4c('0x30')]){_0x2ba00e['Tags']=[];_0x2ba00e[_0x4a4c('0x30')][_0x4a4c('0x31')](',')[_0x4a4c('0x32')](function(_0x3a355e){_0x2ba00e[_0x4a4c('0x33')]['push'](_0x24e614[_0x3a355e]);});}delete _0x2ba00e[_0x4a4c('0x30')];}catch(_0x2fa760){_0x3f09f5(_0x2fa760);}_0x44dadd(_0x2ba00e);});}function updateFaxInteraction(_0xfe55d3,_0x226c5c,_0x1785b3){return new BPromise(function(_0xc06aba,_0x2427e7){return getInteractionUsers(_0xfe55d3,_0x1785b3)[_0x4a4c('0x28')](function(_0x35c2c7){return getInteractionTags(_0x35c2c7,_0x226c5c);})[_0x4a4c('0x28')](function(_0x5ea4d5){return getStateInteraction(_0x5ea4d5);})[_0x4a4c('0x28')](function(_0x5e9f90){_0xc06aba(_0x5e9f90);})['catch'](function(_0x5da0dd){_0x2427e7(_0x5da0dd);});});}function getStateInteraction(_0x34234e){return new BPromise(function(_0x24c4a5){_0x34234e[_0x4a4c('0x34')]=0x0;_0x34234e[_0x4a4c('0x35')]=0x0;_0x34234e['answered']=0x0;_0x34234e[_0x4a4c('0x36')]=0x0;_0x34234e['total']=0x0;if(!_0x34234e[_0x4a4c('0x37')]&&!_0x34234e['UserId']){_0x34234e['waiting']+=0x1;}if(!_0x34234e[_0x4a4c('0x37')]&&_0x34234e[_0x4a4c('0x38')]){_0x34234e[_0x4a4c('0x35')]+=0x1;if(_0x34234e[_0x4a4c('0x34')]){_0x34234e[_0x4a4c('0x34')]-=0x1;}}if(_0x34234e[_0x4a4c('0x37')]&&_0x34234e[_0x4a4c('0x38')]){_0x34234e['answered']+=0x1;if(_0x34234e[_0x4a4c('0x35')]){_0x34234e[_0x4a4c('0x35')]-=0x1;}}if(_0x34234e[_0x4a4c('0x37')]&&!_0x34234e['UserId']){_0x34234e[_0x4a4c('0x36')]+=0x1;if(_0x34234e[_0x4a4c('0x34')]){_0x34234e[_0x4a4c('0x34')]-=0x1;}}_0x34234e[_0x4a4c('0x39')]+=0x1;_0x24c4a5(_0x34234e);});}exports[_0x4a4c('0x3a')]=function(_0x254b22,_0x4db224){var _0x282aa8={},_0x386ec9={},_0x32d771={'count':0x0,'rows':[]};var _0x5e00b3=_[_0x4a4c('0x3b')](db[_0x4a4c('0x3c')][_0x4a4c('0x3d')],function(_0x52d92a){return{'name':_0x52d92a[_0x4a4c('0x3e')],'type':_0x52d92a['type'][_0x4a4c('0x3f')]};});_0x386ec9['model']=_[_0x4a4c('0x3b')](_0x5e00b3,_0x4a4c('0x2d'));_0x386ec9[_0x4a4c('0x40')]=_[_0x4a4c('0x41')](_0x254b22[_0x4a4c('0x40')]);_0x386ec9[_0x4a4c('0x42')]=_[_0x4a4c('0x43')](_0x386ec9[_0x4a4c('0x44')],_0x386ec9[_0x4a4c('0x40')]);_0x282aa8[_0x4a4c('0x45')]=_['intersection'](_0x386ec9[_0x4a4c('0x44')],qs[_0x4a4c('0x46')](_0x254b22[_0x4a4c('0x40')][_0x4a4c('0x46')]));_0x282aa8[_0x4a4c('0x45')]=_0x282aa8[_0x4a4c('0x45')][_0x4a4c('0x47')]?_0x282aa8[_0x4a4c('0x45')]:_0x386ec9[_0x4a4c('0x44')];if(!_0x254b22[_0x4a4c('0x40')][_0x4a4c('0x48')](_0x4a4c('0x49'))){_0x282aa8[_0x4a4c('0x23')]=qs[_0x4a4c('0x23')](_0x254b22[_0x4a4c('0x40')][_0x4a4c('0x23')]);_0x282aa8[_0x4a4c('0x21')]=qs[_0x4a4c('0x21')](_0x254b22[_0x4a4c('0x40')][_0x4a4c('0x21')]);}_0x282aa8['order']=qs[_0x4a4c('0x4a')](_0x254b22[_0x4a4c('0x40')][_0x4a4c('0x4a')]);_0x282aa8[_0x4a4c('0x4b')]=qs['filters'](_[_0x4a4c('0x4c')](_0x254b22[_0x4a4c('0x40')],_0x386ec9['filters']),_0x5e00b3);var _0x5ac203=[];var _0x19b8f3=squel[_0x4a4c('0x4d')]()[_0x4a4c('0x4e')]('id')[_0x4a4c('0x4e')]('name')[_0x4a4c('0x4e')](_0x4a4c('0x4f'))['from'](_0x4a4c('0x50'));var _0x1bfb7a=squel[_0x4a4c('0x4d')]()['field']('u.id')['field'](_0x4a4c('0x51'))[_0x4a4c('0x4e')](_0x4a4c('0x52'))[_0x4a4c('0x53')](_0x4a4c('0x54'),'ui')[_0x4a4c('0x55')]('users','u',_0x4a4c('0x56'));var _0x196db9=squel[_0x4a4c('0x4d')]()['from']('fax_interactions','i')['left_join'](_0x4a4c('0x57'),'c',_0x4a4c('0x58'))[_0x4a4c('0x55')]('users','o',_0x4a4c('0x59'))[_0x4a4c('0x55')]('fax_accounts','a',_0x4a4c('0x5a'))[_0x4a4c('0x55')]('fax_messages','me',_0x4a4c('0x5b'))['left_join']('fax_interaction_has_tags','it',_0x4a4c('0x5c'))[_0x4a4c('0x55')]('tools_tags','t',_0x4a4c('0x5d'));var _0x6fabf2=squel['expr']();var _0x1d02ff=[];var _0x318773=squel[_0x4a4c('0x5e')]();var _0x303b39;if(_0x254b22[_0x4a4c('0x40')][_0x4a4c('0x5f')]){_0x303b39=as['parseSearch'](_0x254b22[_0x4a4c('0x40')]['search']);var _0x19fb20=_0x303b39[_0x4a4c('0x60')];for(var _0x4223b8=0x0;_0x4223b8<_0x303b39[_0x4a4c('0x61')][_0x4a4c('0x47')];_0x4223b8++){var _0x2b6868=_0x303b39[_0x4a4c('0x61')][_0x4223b8];var _0x538d29='i';var _0x3edb05=_[_0x4a4c('0x62')](_0x5e00b3,['name',_0x2b6868[_0x4a4c('0x4e')]]);if(!_0x3edb05){switch(_0x2b6868[_0x4a4c('0x4e')]){case _0x4a4c('0x63'):if(_0x2b6868['value']==0x1){_0x196db9[_0x4a4c('0x64')]('`'+_0x2b6868['field']+_0x4a4c('0x65'));}else{_0x196db9['having']('`'+_0x2b6868[_0x4a4c('0x4e')]+_0x4a4c('0x66'));}break;case _0x4a4c('0x67'):if(_0x2b6868[_0x4a4c('0x68')]===_0x4a4c('0x69')){if(_0x2b6868[_0x4a4c('0x6a')][_0x4a4c('0x31')]('\x20')['length']>0x1){_0x6fabf2[_0x19fb20](_0x4a4c('0x6b'),qs[_0x4a4c('0x6c')](_0x2b6868['value']),null);}else{var _0x2c53d3='%'+_0x2b6868['value']+'%';_0x6fabf2[_0x19fb20](_0x4a4c('0x6d'),_0x2c53d3,_0x2c53d3,_0x2c53d3);}}else{_0x3edb05=_[_0x4a4c('0x62')](_0x5e00b3,[_0x4a4c('0x2d'),_0x4a4c('0x6e')]);_0x2b6868[_0x4a4c('0x4e')]=_0x4a4c('0x6e');_0x23c82e=as[_0x4a4c('0x6f')](_0x538d29,_0x3edb05['type'],_0x2b6868);_0x6fabf2[_0x19fb20](_0x23c82e['text'],_0x23c82e[_0x4a4c('0x6a')]['start'],_0x23c82e[_0x4a4c('0x6a')][_0x4a4c('0x1f')]);}break;case _0x4a4c('0x70'):var _0x34575c=_0x2b6868[_0x4a4c('0x6a')]['split'](',')['map'](function(_0x5a8e33){return Number(_0x5a8e33);});_0x34575c[_0x4a4c('0x32')](function(_0x379d54){_0x318773['or'](_0x4a4c('0x71'),'%,'+_0x379d54+',%');});_0x1d02ff=_['union'](_0x1d02ff,_0x34575c);break;case _0x4a4c('0x72'):if(_0x2b6868['operator']===_0x4a4c('0x69')){_0x6fabf2[_0x19fb20]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x2b6868[_0x4a4c('0x6a')]+'%',null);}else{_0x3edb05=_[_0x4a4c('0x62')](_0x5e00b3,[_0x4a4c('0x2d'),'UserId']);_0x2b6868[_0x4a4c('0x4e')]=_0x4a4c('0x38');_0x23c82e=as[_0x4a4c('0x6f')](_0x538d29,_0x3edb05[_0x4a4c('0x73')],_0x2b6868);_0x6fabf2[_0x19fb20](_0x23c82e[_0x4a4c('0x74')],_0x23c82e[_0x4a4c('0x6a')][_0x4a4c('0x75')],_0x23c82e[_0x4a4c('0x6a')]['end']);}break;case _0x4a4c('0x76'):_0x23c82e=as['buildExpression']('me',null,_0x2b6868);_0x6fabf2[_0x19fb20](_0x23c82e['text'],_0x23c82e['value'][_0x4a4c('0x75')],_0x23c82e['value'][_0x4a4c('0x1f')]);break;}}else{var _0x23c82e=as[_0x4a4c('0x6f')](_0x538d29,_0x3edb05[_0x4a4c('0x73')],_0x2b6868);_0x6fabf2[_0x19fb20](_0x23c82e[_0x4a4c('0x74')],_0x23c82e[_0x4a4c('0x6a')][_0x4a4c('0x75')],_0x23c82e[_0x4a4c('0x6a')][_0x4a4c('0x1f')]);}}}else{var _0x4e8d7c=_(_0x254b22[_0x4a4c('0x40')])[_0x4a4c('0x41')]()['map'](function(_0x17d54d){return _['some'](_0x5e00b3,[_0x4a4c('0x2d'),_0x17d54d])?_0x17d54d:undefined;})['compact']()['value']();if(!_['isEmpty'](_0x4e8d7c)){_0x4e8d7c['forEach'](function(_0x48e504){if(_0x48e504===_0x4a4c('0x77')){_0x196db9[_0x4a4c('0x4b')](_0x4a4c('0x78'),[][_0x4a4c('0x79')](_0x254b22[_0x4a4c('0x40')][_0x48e504]));}else if(_0x48e504===_0x4a4c('0x7a')){var _0x2a063b=JSON['parse'](_0x254b22['query'][_0x48e504])[_0x4a4c('0x7b')];var _0x1667c4=JSON[_0x4a4c('0x7c')](_0x254b22[_0x4a4c('0x40')][_0x48e504])[_0x4a4c('0x7d')];_0x196db9[_0x4a4c('0x4b')](_0x4a4c('0x7e'),_0x2a063b,_0x1667c4);}else{if(_0x254b22[_0x4a4c('0x40')][_0x48e504]===_0x4a4c('0x7f')){_0x196db9[_0x4a4c('0x4b')]('i.'+_0x48e504+_0x4a4c('0x80'));}else{_0x196db9[_0x4a4c('0x4b')]('i.'+_0x48e504+'\x20=\x20?',_0x254b22['query'][_0x48e504]);}}});}if(_0x254b22['query'][_0x4a4c('0x81')]){if(_0x254b22[_0x4a4c('0x40')][_0x4a4c('0x81')]==0x1){_0x196db9[_0x4a4c('0x64')](_0x4a4c('0x82'));}else{_0x196db9[_0x4a4c('0x64')](_0x4a4c('0x83'));}}if(_0x254b22[_0x4a4c('0x40')][_0x4a4c('0x84')]){_0x1d02ff=_['isArray'](_0x254b22[_0x4a4c('0x40')][_0x4a4c('0x84')])?_0x254b22['query'][_0x4a4c('0x84')]:new Array(_0x254b22[_0x4a4c('0x40')][_0x4a4c('0x84')]);_0x1d02ff['forEach'](function(_0xa4e241){_0x318773['or'](_0x4a4c('0x71'),'%,'+_0xa4e241+',%');});}if(_0x254b22[_0x4a4c('0x40')][_0x4a4c('0x85')]){var _0x15b49d=_0x254b22['query'][_0x4a4c('0x85')][_0x4a4c('0x86')]('\x5c','\x5c\x5c')[_0x4a4c('0x86')](/'/g,'\x27\x27');if(qs[_0x4a4c('0x87')](_0x15b49d)){_0x6fabf2['or'](_0x4a4c('0x88'),_0x15b49d+'%')['or'](_0x4a4c('0x89'),_0x15b49d+'%');}_0x6fabf2['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x15b49d+'%');}}_0x196db9['where'](_0x6fabf2);_0x196db9[_0x4a4c('0x8a')]('i.id');var _0xe7e1ef={'type':db[_0x4a4c('0x8b')][_0x4a4c('0x8c')][_0x4a4c('0x8d')],'raw':!![]};var _0xe50fdf=_0x196db9[_0x4a4c('0x8e')]();_0xe50fdf[_0x4a4c('0x4e')](_0x4a4c('0x8f'));_0xe50fdf[_0x4a4c('0x4e')](_0x4a4c('0x90'),_0x4a4c('0x63'));if(_0x282aa8[_0x4a4c('0x91')]){_0x282aa8[_0x4a4c('0x91')][_0x4a4c('0x32')](function(_0xf500e3){var _0x448a45=_0xf500e3[0x0]===_0x4a4c('0x92')?_0xf500e3[0x0]:'i.'+_0xf500e3[0x0];_0x196db9[_0x4a4c('0x91')](_0x448a45,_0xf500e3[0x1]===_0x4a4c('0x93')?![]:!![]);});}if(!_[_0x4a4c('0x94')](_0x1d02ff)){_0x196db9['having'](_0x318773);_0xe50fdf[_0x4a4c('0x4b')](_0x4a4c('0x95'),_0x1d02ff);}BPromise['resolve']()[_0x4a4c('0x28')](function(){if(!_0x303b39){if(_0x254b22[_0x4a4c('0x40')][_0x4a4c('0x77')])return;_0xe50fdf[_0x4a4c('0x4b')]('i.FaxAccountId\x20IS\x20NOT\x20NULL');_0x196db9['where']('i.FaxAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x254b22['user'][_0x4a4c('0x96')]!=='agent')return;return _0x254b22['user'][_0x4a4c('0x97')]({'attributes':['id'],'raw':!![]})[_0x4a4c('0x28')](function(_0x31ff33){if(_[_0x4a4c('0x94')](_0x31ff33)){_0xe50fdf[_0x4a4c('0x4b')]('i.FaxAccountId\x20IS\x20NULL');_0x196db9[_0x4a4c('0x4b')]('i.FaxAccountId\x20IS\x20NULL');}else{_0xe50fdf[_0x4a4c('0x4b')](_0x4a4c('0x78'),_[_0x4a4c('0x3b')](_0x31ff33,'id'));_0x196db9[_0x4a4c('0x4b')]('i.FaxAccountId\x20IN\x20?',_[_0x4a4c('0x3b')](_0x31ff33,'id'));}});})[_0x4a4c('0x28')](function(){if(_0x254b22[_0x4a4c('0x98')][_0x4a4c('0x96')]==='agent'&&!_0x303b39&&!_0x254b22['query'][_0x4a4c('0x77')])return[];return db[_0x4a4c('0x99')][_0x4a4c('0x40')](_0xe50fdf[_0x4a4c('0x9a')](),_0xe7e1ef);})[_0x4a4c('0x28')](function(_0x22ebdd){_0x32d771[_0x4a4c('0x24')]=_0x22ebdd['length'];if(_0x32d771[_0x4a4c('0x24')]===0x0)return[];return db[_0x4a4c('0x99')][_0x4a4c('0x40')](_0x19b8f3[_0x4a4c('0x9a')](),_0xe7e1ef)[_0x4a4c('0x28')](function(_0x159a72){_0x5ac203=_[_0x4a4c('0x9b')](_0x159a72,'id');_0xe7e1ef=_['merge'](_0xe7e1ef,{'model':db[_0x4a4c('0x3c')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x254b22['query'][_0x4a4c('0x46')]){_0x282aa8[_0x4a4c('0x45')][_0x4a4c('0x32')](function(_0x6ca868){_0x196db9[_0x4a4c('0x4e')]('i.'+_0x6ca868);});}else{_0x196db9[_0x4a4c('0x4e')](_0x4a4c('0x90'),_0x4a4c('0x63'));_0x196db9[_0x4a4c('0x4e')](_0x4a4c('0x9c'),_0x4a4c('0x9d'));_0x196db9[_0x4a4c('0x4e')](_0x4a4c('0x9e'),_0x4a4c('0x9f'));_0x196db9[_0x4a4c('0x4e')](_0x4a4c('0xa0'),_0x4a4c('0x92'));_0x196db9[_0x4a4c('0x4e')](_0x4a4c('0xa1'));_0x196db9[_0x4a4c('0x4e')](_0x4a4c('0xa2'),_0x4a4c('0xa3'));_0x196db9[_0x4a4c('0x4e')](_0x4a4c('0xa4'),'Contact.lastName');_0x196db9[_0x4a4c('0x4e')](_0x4a4c('0xa5'),_0x4a4c('0xa6'));_0x196db9[_0x4a4c('0x4e')](_0x4a4c('0xa7'),_0x4a4c('0xa8'));_0x196db9['field'](_0x4a4c('0xa9'),_0x4a4c('0xaa'));_0x196db9['field'](_0x4a4c('0xab'),_0x4a4c('0xac'));_0x196db9[_0x4a4c('0x4e')](_0x4a4c('0xad'),_0x4a4c('0xae'));_0x196db9[_0x4a4c('0x4e')]('o.internal','Owner.internal');_0x196db9[_0x4a4c('0x4e')](_0x4a4c('0xaf'),'TagIds');}if(_0x282aa8['limit'])_0x196db9['limit'](_0x282aa8['limit']);if(_0x282aa8[_0x4a4c('0x21')])_0x196db9[_0x4a4c('0x21')](_0x282aa8[_0x4a4c('0x21')]);return db[_0x4a4c('0x99')][_0x4a4c('0x40')](_0x196db9[_0x4a4c('0x9a')](),_0xe7e1ef);})[_0x4a4c('0x28')](function(_0x4752f2){if(_0x4752f2[_0x4a4c('0x47')]>0x0)_0x1bfb7a[_0x4a4c('0x4b')]('ui.FaxInteractionId\x20IN\x20?',_['map'](_0x4752f2,'id'));return db[_0x4a4c('0x99')][_0x4a4c('0x40')](_0x1bfb7a[_0x4a4c('0x9a')](),_0xe7e1ef)['then'](function(_0x36f297){var _0x1fa8e8=_[_0x4a4c('0xb0')](_0x36f297,_0x4a4c('0xb1'));var _0x14700a=[];_0x4752f2[_0x4a4c('0x32')](function(_0x5e8a66){_0x14700a[_0x4a4c('0xb2')](updateFaxInteraction(_0x5e8a66,_0x5ac203,_0x1fa8e8));});return BPromise[_0x4a4c('0xb3')](_0x14700a);});});})['then'](function(_0x510c71){_0x32d771[_0x4a4c('0xb4')]=_0x510c71;return _0x32d771;})[_0x4a4c('0x28')](respondWithFilteredResult(_0x4db224,_0x282aa8))[_0x4a4c('0xb5')](handleError(_0x4db224,null));};exports['show']=function(_0x326dd5,_0x32a386){var _0x127875={'raw':![],'where':{'id':_0x326dd5[_0x4a4c('0xb6')]['id']}},_0x5636d9={};_0x5636d9[_0x4a4c('0x44')]=_[_0x4a4c('0x41')](db[_0x4a4c('0x3c')]['rawAttributes']);_0x5636d9[_0x4a4c('0x40')]=_[_0x4a4c('0x41')](_0x326dd5[_0x4a4c('0x40')]);_0x5636d9['filters']=_['intersection'](_0x5636d9[_0x4a4c('0x44')],_0x5636d9[_0x4a4c('0x40')]);_0x127875[_0x4a4c('0x45')]=_['intersection'](_0x5636d9['model'],qs[_0x4a4c('0x46')](_0x326dd5['query'][_0x4a4c('0x46')]));_0x127875[_0x4a4c('0x45')]=_0x127875[_0x4a4c('0x45')][_0x4a4c('0x47')]?_0x127875[_0x4a4c('0x45')]:_0x5636d9[_0x4a4c('0x44')];if(_0x326dd5[_0x4a4c('0x40')][_0x4a4c('0xb7')]){_0x127875[_0x4a4c('0xb8')]=[{'all':!![]}];}_0x127875=_[_0x4a4c('0xb9')]({},_0x127875,_0x326dd5[_0x4a4c('0xba')]);return db[_0x4a4c('0x3c')][_0x4a4c('0x62')](_0x127875)['then'](handleEntityNotFound(_0x32a386,null))[_0x4a4c('0x28')](respondWithResult(_0x32a386,null))[_0x4a4c('0xb5')](handleError(_0x32a386,null));};exports[_0x4a4c('0xbb')]=function(_0xc16823,_0x3f6f75){return db[_0x4a4c('0x3c')][_0x4a4c('0xbb')](_0xc16823['body'],{})[_0x4a4c('0x28')](respondWithResult(_0x3f6f75,0xc9))[_0x4a4c('0xb5')](handleError(_0x3f6f75,null));};exports[_0x4a4c('0xbc')]=function(_0x3bc997,_0x5c69a7){if(_0x3bc997[_0x4a4c('0x76')]['id']){delete _0x3bc997[_0x4a4c('0x76')]['id'];}return db[_0x4a4c('0x3c')][_0x4a4c('0x62')]({'where':{'id':_0x3bc997[_0x4a4c('0xb6')]['id']}})[_0x4a4c('0x28')](handleEntityNotFound(_0x5c69a7,null))[_0x4a4c('0x28')](saveUpdates(_0x3bc997[_0x4a4c('0x76')],null))[_0x4a4c('0x28')](respondWithResult(_0x5c69a7,null))[_0x4a4c('0xb5')](handleError(_0x5c69a7,null));};exports[_0x4a4c('0x29')]=function(_0x235449,_0x28b7c1){return db[_0x4a4c('0x3c')][_0x4a4c('0x62')]({'where':{'id':_0x235449[_0x4a4c('0xb6')]['id']}})[_0x4a4c('0x28')](handleEntityNotFound(_0x28b7c1,null))[_0x4a4c('0x28')](removeEntity(_0x28b7c1,null))[_0x4a4c('0xb5')](handleError(_0x28b7c1,null));};exports[_0x4a4c('0xbd')]=function(_0x245b0e,_0x2a00b8){return db[_0x4a4c('0x3c')][_0x4a4c('0xbd')]()[_0x4a4c('0x28')](respondWithResult(_0x2a00b8,null))[_0x4a4c('0xb5')](handleError(_0x2a00b8,null));};exports[_0x4a4c('0xbe')]=function(_0x2a53a2,_0x29da56,_0x2d9435){return db[_0x4a4c('0xbf')][_0x4a4c('0x62')]({'where':{'id':_0x2a53a2[_0x4a4c('0xb6')]['id']}})[_0x4a4c('0x28')](handleEntityNotFound(_0x29da56,null))[_0x4a4c('0x28')](function(_0x4f4854){if(_0x4f4854){return _0x4f4854[_0x4a4c('0xbe')](_0x2a53a2[_0x4a4c('0x76')][_0x4a4c('0xc0')],_[_0x4a4c('0xc1')](_0x2a53a2[_0x4a4c('0x76')],['ids','id'])||{});}})['then'](respondWithResult(_0x29da56,null))['catch'](handleError(_0x29da56,null));};exports[_0x4a4c('0xc2')]=function(_0x40af9b,_0x2fff45,_0x3d76cd){var _0x18cfb9={'raw':![],'where':{}};var _0x2fe310={};var _0x3e111f={'count':0x0,'rows':[]};return db[_0x4a4c('0x3c')][_0x4a4c('0xc3')]({'where':{'id':_0x40af9b['params']['id']}})[_0x4a4c('0x28')](handleEntityNotFound(_0x2fff45,null))[_0x4a4c('0x28')](function(_0x142db9){if(_0x142db9){_0x2fe310[_0x4a4c('0x44')]=_[_0x4a4c('0x41')](db['FaxMessage'][_0x4a4c('0x3d')]);_0x2fe310[_0x4a4c('0x40')]=_[_0x4a4c('0x41')](_0x40af9b[_0x4a4c('0x40')]);_0x2fe310[_0x4a4c('0x42')]=_[_0x4a4c('0x43')](_0x2fe310['model'],_0x2fe310['query']);_0x18cfb9['attributes']=_['intersection'](_0x2fe310['model'],qs['fields'](_0x40af9b['query'][_0x4a4c('0x46')]));_0x18cfb9[_0x4a4c('0x45')]=_0x18cfb9[_0x4a4c('0x45')][_0x4a4c('0x47')]?_0x18cfb9[_0x4a4c('0x45')]:_0x2fe310[_0x4a4c('0x44')];if(!_0x40af9b['query']['hasOwnProperty'](_0x4a4c('0x49'))){_0x18cfb9[_0x4a4c('0x23')]=qs['limit'](_0x40af9b[_0x4a4c('0x40')]['limit']);_0x18cfb9[_0x4a4c('0x21')]=qs['offset'](_0x40af9b[_0x4a4c('0x40')]['offset']);}_0x18cfb9[_0x4a4c('0x91')]=qs[_0x4a4c('0x4a')](_0x40af9b[_0x4a4c('0x40')][_0x4a4c('0x4a')]);_0x18cfb9['where']=qs[_0x4a4c('0x42')](_[_0x4a4c('0x4c')](_0x40af9b['query'],_0x2fe310[_0x4a4c('0x42')]));_0x18cfb9[_0x4a4c('0x4b')][_0x4a4c('0xb1')]=_0x142db9['id'];if(_0x40af9b['query'][_0x4a4c('0x85')]){_0x18cfb9['where']=_[_0x4a4c('0xb9')](_0x18cfb9[_0x4a4c('0x4b')],{'$or':_[_0x4a4c('0x3b')](_0x18cfb9[_0x4a4c('0x45')],function(_0x3ba334){var _0x5ea425={};_0x5ea425[_0x3ba334]={'$like':'%'+_0x40af9b['query'][_0x4a4c('0x85')]+'%'};return _0x5ea425;})});}if(_0x40af9b[_0x4a4c('0x40')][_0x4a4c('0x7b')]){var _0x4ba80d=_0x40af9b[_0x4a4c('0x40')][_0x4a4c('0x7b')][_0x4a4c('0x31')](',');var _0x11309b={};_0x11309b[_0x4ba80d[0x0]]={'$gte':moment(_0x4ba80d[0x1])[_0x4a4c('0xc4')]('YYYY-MM-DD\x20HH:mm:ss')};_0x18cfb9[_0x4a4c('0x4b')]=_[_0x4a4c('0xb9')](_0x18cfb9[_0x4a4c('0x4b')],_0x11309b);}_0x18cfb9=_['merge']({},_0x18cfb9,_0x40af9b[_0x4a4c('0xba')]);return db[_0x4a4c('0xbf')][_0x4a4c('0x24')]({'where':_0x18cfb9[_0x4a4c('0x4b')]})[_0x4a4c('0x28')](function(_0x43bced){_0x3e111f[_0x4a4c('0x24')]=_0x43bced;if(_0x40af9b[_0x4a4c('0x40')][_0x4a4c('0xb7')]){_0x18cfb9[_0x4a4c('0xb8')]=[{'all':!![]}];}return db[_0x4a4c('0xbf')][_0x4a4c('0xc5')](_0x18cfb9);})[_0x4a4c('0x28')](function(_0x514e39){_0x3e111f['rows']=_0x514e39;return _0x3e111f;});}})['then'](respondWithFilteredResult(_0x2fff45,_0x18cfb9))['catch'](handleError(_0x2fff45,null));};exports[_0x4a4c('0xc6')]=function(_0x2d9b33,_0x2462a4,_0x23b730){return db[_0x4a4c('0x3c')][_0x4a4c('0x62')]({'where':{'id':_0x2d9b33[_0x4a4c('0xb6')]['id']}})[_0x4a4c('0x28')](handleEntityNotFound(_0x2462a4,null))['then'](function(_0x4d2d0a){if(_0x4d2d0a){return _0x4d2d0a[_0x4a4c('0xc7')](_0x2d9b33[_0x4a4c('0x76')][_0x4a4c('0xc0')],_[_0x4a4c('0xc1')](_0x2d9b33['body'],[_0x4a4c('0xc0'),'id'])||{})['spread'](function(){return db[_0x4a4c('0x70')][_0x4a4c('0xc5')]({'attributes':['id',_0x4a4c('0x2d'),_0x4a4c('0x4f')],'where':{'id':_0x2d9b33[_0x4a4c('0x76')]['ids']}});})[_0x4a4c('0x28')](function(_0x2e14b5){socket['emit'](_0x4a4c('0xc8'),{'id':Number(_0x2d9b33[_0x4a4c('0xb6')]['id']),'tags':_0x2e14b5||[]});return{'id':Number(_0x2d9b33['params']['id']),'tags':_0x2e14b5||[]};});}})['then'](respondWithResult(_0x2462a4,null))[_0x4a4c('0xb5')](handleError(_0x2462a4,null));};exports[_0x4a4c('0xc9')]=function(_0x16fa41,_0x20a730,_0x2653a9){return db[_0x4a4c('0x3c')][_0x4a4c('0x62')]({'where':{'id':_0x16fa41[_0x4a4c('0xb6')]['id']}})['then'](handleEntityNotFound(_0x20a730,null))[_0x4a4c('0x28')](function(_0x4b2451){if(_0x4b2451){return _0x4b2451[_0x4a4c('0xc9')](_0x16fa41['query'][_0x4a4c('0xc0')]);}})[_0x4a4c('0x28')](respondWithStatusCode(_0x20a730,null))[_0x4a4c('0xb5')](handleError(_0x20a730,null));};exports[_0x4a4c('0xca')]=function(_0x48e0dc,_0x3e130a){var _0x1e0349=moment()[_0x4a4c('0xcb')]()['toString']();var _0x590386=path['join'](config['root'],'server',_0x4a4c('0xcc'),'tmp');var _0x120636=path[_0x4a4c('0xcd')](config['root'],_0x4a4c('0xce'),_0x4a4c('0xcc'),_0x4a4c('0xcf'));var _0x461344=path[_0x4a4c('0xcd')](_0x590386,_0x1e0349);var _0x3b98a9=util[_0x4a4c('0xc4')]('transcript-%d-%s.zip',_0x48e0dc['params']['id'],_0x1e0349);var _0x1d78a6=path[_0x4a4c('0xcd')](_0x590386,_0x3b98a9);var _0x46116d=[];_0x46116d[_0x4a4c('0xb2')]({'model':db[_0x4a4c('0xd0')],'as':_0x4a4c('0xd0'),'raw':!![]});var _0x358a4b=[{'model':db[_0x4a4c('0xbf')],'as':_0x4a4c('0xd1'),'attributes':['id',_0x4a4c('0x76'),_0x4a4c('0x7a')],'include':_0x46116d}];return db[_0x4a4c('0x3c')][_0x4a4c('0x62')]({'where':{'id':_0x48e0dc[_0x4a4c('0xb6')]['id']},'include':_0x358a4b})[_0x4a4c('0x28')](handleEntityNotFound(_0x3e130a,null))['then'](function(_0x59af29){if(_0x59af29&&_0x59af29[_0x4a4c('0xd1')]){var _0x8eacd4=_0x59af29[_0x4a4c('0xd2')]({'plain':!![]});fs[_0x4a4c('0xd3')](_0x461344);for(var _0x87a148=0x0;_0x87a148<_0x8eacd4[_0x4a4c('0xd1')][_0x4a4c('0x47')];_0x87a148++){var _0x4602bc=_0x8eacd4[_0x4a4c('0xd1')][_0x87a148][_0x4a4c('0xd0')];if(_0x4602bc){var _0x2fefa9=path[_0x4a4c('0xcd')](_0x120636,_0x4602bc[_0x4a4c('0xd4')]);if(fs[_0x4a4c('0xd5')](_0x2fefa9)){fs[_0x4a4c('0xd6')](_0x2fefa9)[_0x4a4c('0xd7')](fs[_0x4a4c('0xd8')](path[_0x4a4c('0xcd')](_0x461344,_0x4602bc[_0x4a4c('0xd4')])));}}}return BPromise[_0x4a4c('0xd9')]()[_0x4a4c('0x28')](function(){return new BPromise(function(_0x5291f7,_0x4a8ad4){zipdir(_0x461344,{'saveTo':_0x1d78a6},function(_0x26f240,_0x438688){if(_0x26f240)return _0x4a8ad4(_0x26f240);return _0x5291f7(_0x438688);});})[_0x4a4c('0x28')](function(){return new BPromise(function(_0xc8fbf8,_0x26df92){rimraf(_0x461344,function(_0x107ec3){if(_0x107ec3)_0x26df92(_0x107ec3);return _0xc8fbf8();});});})['then'](function(){return _0x3e130a[_0x4a4c('0xca')](_0x1d78a6,_0x3b98a9,function(_0x2737a8){if(_0x2737a8){console[_0x4a4c('0xda')](_0x4a4c('0xdb'),_0x2737a8);}else{fs['unlinkSync'](_0x1d78a6);}});});});}else{return _0x3e130a[_0x4a4c('0x2a')](0xc8);}})[_0x4a4c('0xb5')](handleError(_0x3e130a,null));};
\ No newline at end of file
+var _0xdfc0=['../../config/environment','../../config/license/util','redis','socket.io-emitter','register','sendStatus','status','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','then','destroy','end','name','Users','fullname','TagIds','Tags','split','forEach','push','waiting','talking','answered','total','closed','UserId','unmanaged','FaxInteraction','rawAttributes','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','select','field','color','from','tools_tags','u.id','ui.FaxInteractionId','user_has_fax_interactions','left_join','users','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','fax_accounts','a.id\x20=\x20i.FaxAccountId','fax_messages','me.FaxInteractionId\x20=\x20i.id','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','parseSearch','search','sqlOperator','conditions','find','unreadMessages','value','`\x20=\x200','having','`\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','type','text','start','Tag','union','User','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','body','some','compact','isEmpty','FaxAccountId','where','i.FaxAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.fax\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','DESC','resolve','i.FaxAccountId\x20IS\x20NOT\x20NULL','role','agent','user','i.FaxAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','a.key','Account.key','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.FaxInteractionId\x20IN\x20?','groupBy','FaxInteractionId','all','rows','show','params','includeAll','include','options','catch','describe','addMessage','FaxMessage','ids','getMessages','findOne','hasOwnProperty','pick','format','YYYY-MM-DD\x20HH:mm:ss','omit','spread','findAll','faxInteractionTags:save','download','join','files','tmp','server','attachments','transcript-%d-%s.zip','Attachment','Messages','get','mkdirSync','basename','createReadStream','pipe','createWriteStream','log','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/logger','api'];(function(_0x4772d6,_0x5e344a){var _0x25ffa2=function(_0x26dbb5){while(--_0x26dbb5){_0x4772d6['push'](_0x4772d6['shift']());}};_0x25ffa2(++_0x5e344a);}(_0xdfc0,0x1aa));var _0x0dfc=function(_0x173cab,_0x599609){_0x173cab=_0x173cab-0x0;var _0x199aa1=_0xdfc0[_0x173cab];return _0x199aa1;};'use strict';var emlformat=require(_0x0dfc('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0dfc('0x1'));var jsonpatch=require(_0x0dfc('0x2'));var rp=require(_0x0dfc('0x3'));var moment=require(_0x0dfc('0x4'));var BPromise=require(_0x0dfc('0x5'));var Mustache=require(_0x0dfc('0x6'));var util=require(_0x0dfc('0x7'));var path=require('path');var sox=require(_0x0dfc('0x8'));var csv=require('to-csv');var ejs=require(_0x0dfc('0x9'));var fs=require('fs');var fs_extra=require(_0x0dfc('0xa'));var _=require(_0x0dfc('0xb'));var squel=require(_0x0dfc('0xc'));var crypto=require(_0x0dfc('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x0dfc('0xe'));var toCsv=require('to-csv');var querystring=require(_0x0dfc('0xf'));var Papa=require('papaparse');var Redis=require(_0x0dfc('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x0dfc('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0dfc('0x12'))(_0x0dfc('0x13'));var utils=require('../../config/utils');var config=require(_0x0dfc('0x14'));var licenseUtil=require(_0x0dfc('0x15'));var db=require('../../mysqldb')['db'];config[_0x0dfc('0x16')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x0dfc('0x17'))(new Redis(config['redis']));require('./faxInteraction.socket')[_0x0dfc('0x18')](socket);function respondWithStatusCode(_0x3f5f3d,_0x4c8766){_0x4c8766=_0x4c8766||0xcc;return function(_0x4c6068){if(_0x4c6068){return _0x3f5f3d[_0x0dfc('0x19')](_0x4c8766);}return _0x3f5f3d[_0x0dfc('0x1a')](_0x4c8766)['end']();};}function respondWithResult(_0x120868,_0x357889){_0x357889=_0x357889||0xc8;return function(_0x287870){if(_0x287870){return _0x120868[_0x0dfc('0x1a')](_0x357889)['json'](_0x287870);}};}function respondWithFilteredResult(_0x1823de,_0x299743){return function(_0x316627){if(_0x316627){var _0x7acf01=typeof _0x299743[_0x0dfc('0x1b')]==='undefined'&&typeof _0x299743[_0x0dfc('0x1c')]===_0x0dfc('0x1d');var _0xa064ad=_0x316627['count'];var _0x41cbbd=_0x7acf01?0x0:_0x299743[_0x0dfc('0x1b')];var _0x233a11=_0x7acf01?_0x316627[_0x0dfc('0x1e')]:_0x299743[_0x0dfc('0x1b')]+_0x299743[_0x0dfc('0x1c')];var _0x3fe8d1;if(_0x233a11>=_0xa064ad){_0x233a11=_0xa064ad;_0x3fe8d1=0xc8;}else{_0x3fe8d1=0xce;}_0x1823de[_0x0dfc('0x1a')](_0x3fe8d1);return _0x1823de[_0x0dfc('0x1f')](_0x0dfc('0x20'),_0x41cbbd+'-'+_0x233a11+'/'+_0xa064ad)[_0x0dfc('0x21')](_0x316627);}return null;};}function patchUpdates(_0x47d636){return function(_0xd5e727){try{jsonpatch[_0x0dfc('0x22')](_0xd5e727,_0x47d636,!![]);}catch(_0x4afdb9){return BPromise[_0x0dfc('0x23')](_0x4afdb9);}return _0xd5e727[_0x0dfc('0x24')]();};}function saveUpdates(_0x58b9a0,_0x3b27e8){return function(_0x3c6fad){if(_0x3c6fad){return _0x3c6fad[_0x0dfc('0x25')](_0x58b9a0)[_0x0dfc('0x26')](function(_0x548bbc){return _0x548bbc;});}return null;};}function removeEntity(_0x20303b,_0x2bac84){return function(_0x4fde26){if(_0x4fde26){return _0x4fde26[_0x0dfc('0x27')]()[_0x0dfc('0x26')](function(){_0x20303b['status'](0xcc)[_0x0dfc('0x28')]();});}};}function handleEntityNotFound(_0x12927f,_0x29eac8){return function(_0x570fa2){if(!_0x570fa2){_0x12927f[_0x0dfc('0x19')](0x194);}return _0x570fa2;};}function handleError(_0x15468d,_0x176716){_0x176716=_0x176716||0x1f4;return function(_0x50c1da){logger['error'](_0x50c1da['stack']);if(_0x50c1da[_0x0dfc('0x29')]){delete _0x50c1da[_0x0dfc('0x29')];}_0x15468d['status'](_0x176716)['send'](_0x50c1da);};}function getInteractionUsers(_0x23fa8b,_0x51f8da){return new BPromise(function(_0x4570ca,_0x937888){try{if(_0x51f8da[_0x23fa8b['id']]){_0x23fa8b[_0x0dfc('0x2a')]=_['map'](_0x51f8da[_0x23fa8b['id']],function(_0x243ad0){return{'id':_0x243ad0['id'],'fullname':_0x243ad0[_0x0dfc('0x2b')]};});}}catch(_0x5715d0){_0x937888(_0x5715d0);}_0x4570ca(_0x23fa8b);});}function getInteractionTags(_0x237633,_0x795bf0){return new BPromise(function(_0x248509,_0x4f5858){try{if(_0x237633[_0x0dfc('0x2c')]){_0x237633[_0x0dfc('0x2d')]=[];_0x237633[_0x0dfc('0x2c')][_0x0dfc('0x2e')](',')[_0x0dfc('0x2f')](function(_0x21bd55){_0x237633[_0x0dfc('0x2d')][_0x0dfc('0x30')](_0x795bf0[_0x21bd55]);});}delete _0x237633[_0x0dfc('0x2c')];}catch(_0x49f058){_0x4f5858(_0x49f058);}_0x248509(_0x237633);});}function updateFaxInteraction(_0x2108ea,_0x5887ec,_0x5ed49a){return new BPromise(function(_0x33f6fc,_0x3f7d6a){return getInteractionUsers(_0x2108ea,_0x5ed49a)[_0x0dfc('0x26')](function(_0xc4dfc8){return getInteractionTags(_0xc4dfc8,_0x5887ec);})[_0x0dfc('0x26')](function(_0x468ed4){return getStateInteraction(_0x468ed4);})[_0x0dfc('0x26')](function(_0x15f142){_0x33f6fc(_0x15f142);})['catch'](function(_0x394e61){_0x3f7d6a(_0x394e61);});});}function getStateInteraction(_0x17e19f){return new BPromise(function(_0x5e3353){_0x17e19f[_0x0dfc('0x31')]=0x0;_0x17e19f[_0x0dfc('0x32')]=0x0;_0x17e19f[_0x0dfc('0x33')]=0x0;_0x17e19f['unmanaged']=0x0;_0x17e19f[_0x0dfc('0x34')]=0x0;if(!_0x17e19f['closed']&&!_0x17e19f['UserId']){_0x17e19f[_0x0dfc('0x31')]+=0x1;}if(!_0x17e19f[_0x0dfc('0x35')]&&_0x17e19f[_0x0dfc('0x36')]){_0x17e19f[_0x0dfc('0x32')]+=0x1;if(_0x17e19f[_0x0dfc('0x31')]){_0x17e19f[_0x0dfc('0x31')]-=0x1;}}if(_0x17e19f[_0x0dfc('0x35')]&&_0x17e19f[_0x0dfc('0x36')]){_0x17e19f['answered']+=0x1;if(_0x17e19f[_0x0dfc('0x32')]){_0x17e19f[_0x0dfc('0x32')]-=0x1;}}if(_0x17e19f['closed']&&!_0x17e19f[_0x0dfc('0x36')]){_0x17e19f[_0x0dfc('0x37')]+=0x1;if(_0x17e19f[_0x0dfc('0x31')]){_0x17e19f[_0x0dfc('0x31')]-=0x1;}}_0x17e19f[_0x0dfc('0x34')]+=0x1;_0x5e3353(_0x17e19f);});}exports['index']=function(_0x175e54,_0x5fb942){var _0x5c123={},_0x35bd2b={},_0x528915={'count':0x0,'rows':[]};var _0x5e0da7=_['map'](db[_0x0dfc('0x38')][_0x0dfc('0x39')],function(_0x579b0d){return{'name':_0x579b0d['fieldName'],'type':_0x579b0d['type'][_0x0dfc('0x3a')]};});_0x35bd2b[_0x0dfc('0x3b')]=_[_0x0dfc('0x3c')](_0x5e0da7,_0x0dfc('0x29'));_0x35bd2b[_0x0dfc('0x3d')]=_[_0x0dfc('0x3e')](_0x175e54['query']);_0x35bd2b[_0x0dfc('0x3f')]=_[_0x0dfc('0x40')](_0x35bd2b[_0x0dfc('0x3b')],_0x35bd2b['query']);_0x5c123[_0x0dfc('0x41')]=_['intersection'](_0x35bd2b[_0x0dfc('0x3b')],qs[_0x0dfc('0x42')](_0x175e54['query'][_0x0dfc('0x42')]));_0x5c123[_0x0dfc('0x41')]=_0x5c123[_0x0dfc('0x41')][_0x0dfc('0x43')]?_0x5c123[_0x0dfc('0x41')]:_0x35bd2b[_0x0dfc('0x3b')];if(!_0x175e54['query']['hasOwnProperty'](_0x0dfc('0x44'))){_0x5c123[_0x0dfc('0x1c')]=qs[_0x0dfc('0x1c')](_0x175e54[_0x0dfc('0x3d')][_0x0dfc('0x1c')]);_0x5c123[_0x0dfc('0x1b')]=qs[_0x0dfc('0x1b')](_0x175e54[_0x0dfc('0x3d')][_0x0dfc('0x1b')]);}_0x5c123['order']=qs[_0x0dfc('0x45')](_0x175e54[_0x0dfc('0x3d')]['sort']);_0x5c123['where']=qs[_0x0dfc('0x3f')](_['pick'](_0x175e54['query'],_0x35bd2b[_0x0dfc('0x3f')]),_0x5e0da7);var _0x48800e=[];var _0xb942a8=squel[_0x0dfc('0x46')]()['field']('id')[_0x0dfc('0x47')](_0x0dfc('0x29'))[_0x0dfc('0x47')](_0x0dfc('0x48'))[_0x0dfc('0x49')](_0x0dfc('0x4a'));var _0x45f7ac=squel['select']()[_0x0dfc('0x47')](_0x0dfc('0x4b'))['field']('u.fullname')['field'](_0x0dfc('0x4c'))[_0x0dfc('0x49')](_0x0dfc('0x4d'),'ui')[_0x0dfc('0x4e')](_0x0dfc('0x4f'),'u','u.id\x20=\x20ui.UserId');var _0xb0d643=squel['select']()[_0x0dfc('0x49')]('fax_interactions','i')['left_join'](_0x0dfc('0x50'),'c',_0x0dfc('0x51'))[_0x0dfc('0x4e')]('users','o',_0x0dfc('0x52'))['left_join'](_0x0dfc('0x53'),'a',_0x0dfc('0x54'))['left_join'](_0x0dfc('0x55'),'me',_0x0dfc('0x56'))[_0x0dfc('0x4e')](_0x0dfc('0x57'),'it',_0x0dfc('0x58'))[_0x0dfc('0x4e')](_0x0dfc('0x4a'),'t',_0x0dfc('0x59'));var _0x10107a=squel[_0x0dfc('0x5a')]();var _0x5160a8=[];var _0x166325=squel[_0x0dfc('0x5a')]();var _0x4d987f;if(_0x175e54[_0x0dfc('0x3d')]['search']){_0x4d987f=as[_0x0dfc('0x5b')](_0x175e54[_0x0dfc('0x3d')][_0x0dfc('0x5c')]);var _0x4e8278=_0x4d987f[_0x0dfc('0x5d')];for(var _0x2c0f7e=0x0;_0x2c0f7e<_0x4d987f[_0x0dfc('0x5e')][_0x0dfc('0x43')];_0x2c0f7e++){var _0x328fbe=_0x4d987f['conditions'][_0x2c0f7e];var _0x4f78aa='i';var _0x5e1bdc=_[_0x0dfc('0x5f')](_0x5e0da7,[_0x0dfc('0x29'),_0x328fbe[_0x0dfc('0x47')]]);if(!_0x5e1bdc){switch(_0x328fbe['field']){case _0x0dfc('0x60'):if(_0x328fbe[_0x0dfc('0x61')]==0x1){_0xb0d643['having']('`'+_0x328fbe['field']+_0x0dfc('0x62'));}else{_0xb0d643[_0x0dfc('0x63')]('`'+_0x328fbe[_0x0dfc('0x47')]+_0x0dfc('0x64'));}break;case _0x0dfc('0x65'):if(_0x328fbe[_0x0dfc('0x66')]==='$substring'){if(_0x328fbe[_0x0dfc('0x61')][_0x0dfc('0x2e')]('\x20')[_0x0dfc('0x43')]>0x1){_0x10107a[_0x4e8278](_0x0dfc('0x67'),qs[_0x0dfc('0x68')](_0x328fbe['value']),null);}else{var _0x1842f4='%'+_0x328fbe[_0x0dfc('0x61')]+'%';_0x10107a[_0x4e8278](_0x0dfc('0x69'),_0x1842f4,_0x1842f4,_0x1842f4);}}else{_0x5e1bdc=_[_0x0dfc('0x5f')](_0x5e0da7,[_0x0dfc('0x29'),_0x0dfc('0x6a')]);_0x328fbe[_0x0dfc('0x47')]=_0x0dfc('0x6a');_0x32813a=as[_0x0dfc('0x6b')](_0x4f78aa,_0x5e1bdc[_0x0dfc('0x6c')],_0x328fbe);_0x10107a[_0x4e8278](_0x32813a[_0x0dfc('0x6d')],_0x32813a[_0x0dfc('0x61')][_0x0dfc('0x6e')],_0x32813a[_0x0dfc('0x61')][_0x0dfc('0x28')]);}break;case _0x0dfc('0x6f'):var _0x129cf7=_0x328fbe[_0x0dfc('0x61')][_0x0dfc('0x2e')](',')[_0x0dfc('0x3c')](function(_0x19b7aa){return Number(_0x19b7aa);});_0x129cf7[_0x0dfc('0x2f')](function(_0x30ae65){_0x166325['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x30ae65+',%');});_0x5160a8=_[_0x0dfc('0x70')](_0x5160a8,_0x129cf7);break;case _0x0dfc('0x71'):if(_0x328fbe[_0x0dfc('0x66')]===_0x0dfc('0x72')){_0x10107a[_0x4e8278](_0x0dfc('0x73'),'%'+_0x328fbe['value']+'%',null);}else{_0x5e1bdc=_[_0x0dfc('0x5f')](_0x5e0da7,[_0x0dfc('0x29'),_0x0dfc('0x36')]);_0x328fbe[_0x0dfc('0x47')]=_0x0dfc('0x36');_0x32813a=as[_0x0dfc('0x6b')](_0x4f78aa,_0x5e1bdc['type'],_0x328fbe);_0x10107a[_0x4e8278](_0x32813a[_0x0dfc('0x6d')],_0x32813a[_0x0dfc('0x61')]['start'],_0x32813a[_0x0dfc('0x61')][_0x0dfc('0x28')]);}break;case _0x0dfc('0x74'):_0x32813a=as[_0x0dfc('0x6b')]('me',null,_0x328fbe);_0x10107a[_0x4e8278](_0x32813a[_0x0dfc('0x6d')],_0x32813a[_0x0dfc('0x61')][_0x0dfc('0x6e')],_0x32813a[_0x0dfc('0x61')]['end']);break;}}else{var _0x32813a=as['buildExpression'](_0x4f78aa,_0x5e1bdc[_0x0dfc('0x6c')],_0x328fbe);_0x10107a[_0x4e8278](_0x32813a['text'],_0x32813a[_0x0dfc('0x61')][_0x0dfc('0x6e')],_0x32813a[_0x0dfc('0x61')]['end']);}}}else{var _0x1d6519=_(_0x175e54[_0x0dfc('0x3d')])[_0x0dfc('0x3e')]()[_0x0dfc('0x3c')](function(_0x40b9c3){return _[_0x0dfc('0x75')](_0x5e0da7,['name',_0x40b9c3])?_0x40b9c3:undefined;})[_0x0dfc('0x76')]()[_0x0dfc('0x61')]();if(!_[_0x0dfc('0x77')](_0x1d6519)){_0x1d6519[_0x0dfc('0x2f')](function(_0x3898fa){if(_0x3898fa===_0x0dfc('0x78')){_0xb0d643[_0x0dfc('0x79')](_0x0dfc('0x7a'),[][_0x0dfc('0x7b')](_0x175e54[_0x0dfc('0x3d')][_0x3898fa]));}else if(_0x3898fa===_0x0dfc('0x7c')){var _0x20696b=JSON[_0x0dfc('0x7d')](_0x175e54['query'][_0x3898fa])[_0x0dfc('0x7e')];var _0x1f39b7=JSON[_0x0dfc('0x7d')](_0x175e54[_0x0dfc('0x3d')][_0x3898fa])[_0x0dfc('0x7f')];_0xb0d643[_0x0dfc('0x79')](_0x0dfc('0x80'),_0x20696b,_0x1f39b7);}else{if(_0x175e54['query'][_0x3898fa]===_0x0dfc('0x81')){_0xb0d643['where']('i.'+_0x3898fa+_0x0dfc('0x82'));}else{_0xb0d643['where']('i.'+_0x3898fa+_0x0dfc('0x83'),_0x175e54[_0x0dfc('0x3d')][_0x3898fa]);}}});}if(_0x175e54['query'][_0x0dfc('0x84')]){if(_0x175e54['query'][_0x0dfc('0x84')]==0x1){_0xb0d643[_0x0dfc('0x63')](_0x0dfc('0x85'));}else{_0xb0d643[_0x0dfc('0x63')](_0x0dfc('0x86'));}}if(_0x175e54[_0x0dfc('0x3d')]['tag']){_0x5160a8=_[_0x0dfc('0x87')](_0x175e54[_0x0dfc('0x3d')][_0x0dfc('0x88')])?_0x175e54[_0x0dfc('0x3d')][_0x0dfc('0x88')]:new Array(_0x175e54[_0x0dfc('0x3d')]['tag']);_0x5160a8[_0x0dfc('0x2f')](function(_0xf4507e){_0x166325['or'](_0x0dfc('0x89'),'%,'+_0xf4507e+',%');});}if(_0x175e54[_0x0dfc('0x3d')]['filter']){var _0xac940d=_0x175e54[_0x0dfc('0x3d')][_0x0dfc('0x8a')][_0x0dfc('0x8b')]('\x5c','\x5c\x5c')[_0x0dfc('0x8b')](/'/g,'\x27\x27');if(qs[_0x0dfc('0x8c')](_0xac940d)){_0x10107a['or'](_0x0dfc('0x8d'),_0xac940d+'%')['or'](_0x0dfc('0x8e'),_0xac940d+'%');}_0x10107a['or'](_0x0dfc('0x8f'),_0xac940d+'%');}}_0xb0d643['where'](_0x10107a);_0xb0d643['group'](_0x0dfc('0x90'));var _0x26c91d={'type':db[_0x0dfc('0x91')][_0x0dfc('0x92')][_0x0dfc('0x93')],'raw':!![]};var _0x169e68=_0xb0d643[_0x0dfc('0x94')]();_0x169e68[_0x0dfc('0x47')](_0x0dfc('0x90'));_0x169e68[_0x0dfc('0x47')](_0x0dfc('0x95'),_0x0dfc('0x60'));if(_0x5c123[_0x0dfc('0x96')]){_0x5c123[_0x0dfc('0x96')][_0x0dfc('0x2f')](function(_0x4e5dbf){var _0x4baaf5=_0x4e5dbf[0x0]==='contactName'?_0x4e5dbf[0x0]:'i.'+_0x4e5dbf[0x0];_0xb0d643[_0x0dfc('0x96')](_0x4baaf5,_0x4e5dbf[0x1]===_0x0dfc('0x97')?![]:!![]);});}if(!_['isEmpty'](_0x5160a8)){_0xb0d643['having'](_0x166325);_0x169e68[_0x0dfc('0x79')]('t.id\x20IN\x20?',_0x5160a8);}BPromise[_0x0dfc('0x98')]()['then'](function(){if(!_0x4d987f){if(_0x175e54[_0x0dfc('0x3d')][_0x0dfc('0x78')])return;_0x169e68[_0x0dfc('0x79')](_0x0dfc('0x99'));_0xb0d643[_0x0dfc('0x79')]('i.FaxAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x175e54['user'][_0x0dfc('0x9a')]!==_0x0dfc('0x9b'))return;return _0x175e54[_0x0dfc('0x9c')]['getFaxAccounts']({'attributes':['id'],'raw':!![]})[_0x0dfc('0x26')](function(_0x29ca6c){if(_[_0x0dfc('0x77')](_0x29ca6c)){_0x169e68[_0x0dfc('0x79')](_0x0dfc('0x9d'));_0xb0d643[_0x0dfc('0x79')](_0x0dfc('0x9d'));}else{_0x169e68[_0x0dfc('0x79')]('i.FaxAccountId\x20IN\x20?',_[_0x0dfc('0x3c')](_0x29ca6c,'id'));_0xb0d643['where'](_0x0dfc('0x7a'),_[_0x0dfc('0x3c')](_0x29ca6c,'id'));}});})['then'](function(){if(_0x175e54['user'][_0x0dfc('0x9a')]==='agent'&&!_0x4d987f&&!_0x175e54[_0x0dfc('0x3d')]['FaxAccountId'])return[];return db[_0x0dfc('0x9e')][_0x0dfc('0x3d')](_0x169e68['toString'](),_0x26c91d);})[_0x0dfc('0x26')](function(_0x456e2b){_0x528915[_0x0dfc('0x1e')]=_0x456e2b[_0x0dfc('0x43')];if(_0x528915[_0x0dfc('0x1e')]===0x0)return[];return db[_0x0dfc('0x9e')][_0x0dfc('0x3d')](_0xb942a8[_0x0dfc('0x9f')](),_0x26c91d)[_0x0dfc('0x26')](function(_0x26d17d){_0x48800e=_[_0x0dfc('0xa0')](_0x26d17d,'id');_0x26c91d=_[_0x0dfc('0xa1')](_0x26c91d,{'model':db[_0x0dfc('0x38')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x175e54[_0x0dfc('0x3d')]['fields']){_0x5c123[_0x0dfc('0x41')][_0x0dfc('0x2f')](function(_0x5970e9){_0xb0d643[_0x0dfc('0x47')]('i.'+_0x5970e9);});}else{_0xb0d643[_0x0dfc('0x47')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x0dfc('0x60'));_0xb0d643[_0x0dfc('0x47')](_0x0dfc('0xa2'),_0x0dfc('0xa3'));_0xb0d643['field']('a.mandatoryDisposition','Account.mandatoryDisposition');_0xb0d643[_0x0dfc('0x47')](_0x0dfc('0xa4'),_0x0dfc('0xa5'));_0xb0d643[_0x0dfc('0x47')]('i.*');_0xb0d643[_0x0dfc('0x47')](_0x0dfc('0xa6'),_0x0dfc('0xa7'));_0xb0d643['field'](_0x0dfc('0xa8'),_0x0dfc('0xa9'));_0xb0d643['field'](_0x0dfc('0xaa'),'Contact.email');_0xb0d643[_0x0dfc('0x47')](_0x0dfc('0xab'),_0x0dfc('0xac'));_0xb0d643[_0x0dfc('0x47')](_0x0dfc('0xad'),_0x0dfc('0xae'));_0xb0d643[_0x0dfc('0x47')](_0x0dfc('0xaf'),_0x0dfc('0xb0'));_0xb0d643[_0x0dfc('0x47')](_0x0dfc('0xb1'),_0x0dfc('0xb2'));_0xb0d643[_0x0dfc('0x47')](_0x0dfc('0xb3'),_0x0dfc('0xb4'));_0xb0d643[_0x0dfc('0x47')](_0x0dfc('0xb5'),'TagIds');}if(_0x5c123['limit'])_0xb0d643[_0x0dfc('0x1c')](_0x5c123[_0x0dfc('0x1c')]);if(_0x5c123[_0x0dfc('0x1b')])_0xb0d643[_0x0dfc('0x1b')](_0x5c123[_0x0dfc('0x1b')]);return db['sequelize'][_0x0dfc('0x3d')](_0xb0d643['toString'](),_0x26c91d);})['then'](function(_0x508d86){if(_0x508d86[_0x0dfc('0x43')]>0x0)_0x45f7ac[_0x0dfc('0x79')](_0x0dfc('0xb6'),_[_0x0dfc('0x3c')](_0x508d86,'id'));return db[_0x0dfc('0x9e')][_0x0dfc('0x3d')](_0x45f7ac[_0x0dfc('0x9f')](),_0x26c91d)['then'](function(_0x47ff17){var _0x1ad862=_[_0x0dfc('0xb7')](_0x47ff17,_0x0dfc('0xb8'));var _0x31ea5d=[];_0x508d86[_0x0dfc('0x2f')](function(_0x4fceb4){_0x31ea5d[_0x0dfc('0x30')](updateFaxInteraction(_0x4fceb4,_0x48800e,_0x1ad862));});return BPromise[_0x0dfc('0xb9')](_0x31ea5d);});});})[_0x0dfc('0x26')](function(_0x42dd06){_0x528915[_0x0dfc('0xba')]=_0x42dd06;return _0x528915;})['then'](respondWithFilteredResult(_0x5fb942,_0x5c123))['catch'](handleError(_0x5fb942,null));};exports[_0x0dfc('0xbb')]=function(_0x2f97f2,_0x3dfb0b){var _0x36e560={'raw':![],'where':{'id':_0x2f97f2[_0x0dfc('0xbc')]['id']}},_0x384e06={};_0x384e06['model']=_['keys'](db[_0x0dfc('0x38')][_0x0dfc('0x39')]);_0x384e06['query']=_[_0x0dfc('0x3e')](_0x2f97f2[_0x0dfc('0x3d')]);_0x384e06['filters']=_[_0x0dfc('0x40')](_0x384e06[_0x0dfc('0x3b')],_0x384e06['query']);_0x36e560['attributes']=_[_0x0dfc('0x40')](_0x384e06['model'],qs[_0x0dfc('0x42')](_0x2f97f2[_0x0dfc('0x3d')][_0x0dfc('0x42')]));_0x36e560[_0x0dfc('0x41')]=_0x36e560[_0x0dfc('0x41')][_0x0dfc('0x43')]?_0x36e560[_0x0dfc('0x41')]:_0x384e06['model'];if(_0x2f97f2[_0x0dfc('0x3d')][_0x0dfc('0xbd')]){_0x36e560[_0x0dfc('0xbe')]=[{'all':!![]}];}_0x36e560=_[_0x0dfc('0xa1')]({},_0x36e560,_0x2f97f2[_0x0dfc('0xbf')]);return db['FaxInteraction'][_0x0dfc('0x5f')](_0x36e560)[_0x0dfc('0x26')](handleEntityNotFound(_0x3dfb0b,null))[_0x0dfc('0x26')](respondWithResult(_0x3dfb0b,null))[_0x0dfc('0xc0')](handleError(_0x3dfb0b,null));};exports['create']=function(_0x572f64,_0x231a30){return db['FaxInteraction']['create'](_0x572f64['body'],{})[_0x0dfc('0x26')](respondWithResult(_0x231a30,0xc9))[_0x0dfc('0xc0')](handleError(_0x231a30,null));};exports[_0x0dfc('0x25')]=function(_0x20f54e,_0x11c1f8){if(_0x20f54e['body']['id']){delete _0x20f54e[_0x0dfc('0x74')]['id'];}return db[_0x0dfc('0x38')]['find']({'where':{'id':_0x20f54e[_0x0dfc('0xbc')]['id']}})['then'](handleEntityNotFound(_0x11c1f8,null))[_0x0dfc('0x26')](saveUpdates(_0x20f54e[_0x0dfc('0x74')],null))[_0x0dfc('0x26')](respondWithResult(_0x11c1f8,null))[_0x0dfc('0xc0')](handleError(_0x11c1f8,null));};exports[_0x0dfc('0x27')]=function(_0x4ec4bc,_0x683780){return db[_0x0dfc('0x38')][_0x0dfc('0x5f')]({'where':{'id':_0x4ec4bc[_0x0dfc('0xbc')]['id']}})[_0x0dfc('0x26')](handleEntityNotFound(_0x683780,null))[_0x0dfc('0x26')](removeEntity(_0x683780,null))['catch'](handleError(_0x683780,null));};exports[_0x0dfc('0xc1')]=function(_0x5831d5,_0x1f47de){return db[_0x0dfc('0x38')][_0x0dfc('0xc1')]()[_0x0dfc('0x26')](respondWithResult(_0x1f47de,null))['catch'](handleError(_0x1f47de,null));};exports[_0x0dfc('0xc2')]=function(_0x1b3192,_0x3ab54a,_0x1c8423){return db[_0x0dfc('0xc3')][_0x0dfc('0x5f')]({'where':{'id':_0x1b3192[_0x0dfc('0xbc')]['id']}})['then'](handleEntityNotFound(_0x3ab54a,null))['then'](function(_0x1e60ec){if(_0x1e60ec){return _0x1e60ec[_0x0dfc('0xc2')](_0x1b3192[_0x0dfc('0x74')][_0x0dfc('0xc4')],_['omit'](_0x1b3192[_0x0dfc('0x74')],[_0x0dfc('0xc4'),'id'])||{});}})[_0x0dfc('0x26')](respondWithResult(_0x3ab54a,null))[_0x0dfc('0xc0')](handleError(_0x3ab54a,null));};exports[_0x0dfc('0xc5')]=function(_0x35c502,_0x368c84,_0x522592){var _0x3825f6={'raw':![],'where':{}};var _0x535534={};var _0x4fa292={'count':0x0,'rows':[]};return db['FaxInteraction'][_0x0dfc('0xc6')]({'where':{'id':_0x35c502[_0x0dfc('0xbc')]['id']}})[_0x0dfc('0x26')](handleEntityNotFound(_0x368c84,null))[_0x0dfc('0x26')](function(_0x5e445d){if(_0x5e445d){_0x535534[_0x0dfc('0x3b')]=_[_0x0dfc('0x3e')](db[_0x0dfc('0xc3')][_0x0dfc('0x39')]);_0x535534['query']=_['keys'](_0x35c502[_0x0dfc('0x3d')]);_0x535534[_0x0dfc('0x3f')]=_[_0x0dfc('0x40')](_0x535534[_0x0dfc('0x3b')],_0x535534[_0x0dfc('0x3d')]);_0x3825f6['attributes']=_[_0x0dfc('0x40')](_0x535534[_0x0dfc('0x3b')],qs[_0x0dfc('0x42')](_0x35c502[_0x0dfc('0x3d')]['fields']));_0x3825f6[_0x0dfc('0x41')]=_0x3825f6['attributes']['length']?_0x3825f6[_0x0dfc('0x41')]:_0x535534[_0x0dfc('0x3b')];if(!_0x35c502[_0x0dfc('0x3d')][_0x0dfc('0xc7')]('nolimit')){_0x3825f6[_0x0dfc('0x1c')]=qs[_0x0dfc('0x1c')](_0x35c502['query'][_0x0dfc('0x1c')]);_0x3825f6['offset']=qs['offset'](_0x35c502[_0x0dfc('0x3d')][_0x0dfc('0x1b')]);}_0x3825f6['order']=qs[_0x0dfc('0x45')](_0x35c502[_0x0dfc('0x3d')][_0x0dfc('0x45')]);_0x3825f6['where']=qs[_0x0dfc('0x3f')](_[_0x0dfc('0xc8')](_0x35c502['query'],_0x535534[_0x0dfc('0x3f')]));_0x3825f6['where'][_0x0dfc('0xb8')]=_0x5e445d['id'];if(_0x35c502[_0x0dfc('0x3d')][_0x0dfc('0x8a')]){_0x3825f6[_0x0dfc('0x79')]=_[_0x0dfc('0xa1')](_0x3825f6[_0x0dfc('0x79')],{'$or':_['map'](_0x3825f6['attributes'],function(_0x2a557c){var _0x3e7b7b={};_0x3e7b7b[_0x2a557c]={'$like':'%'+_0x35c502['query'][_0x0dfc('0x8a')]+'%'};return _0x3e7b7b;})});}if(_0x35c502[_0x0dfc('0x3d')]['$gte']){var _0x4f87e0=_0x35c502[_0x0dfc('0x3d')][_0x0dfc('0x7e')]['split'](',');var _0x454933={};_0x454933[_0x4f87e0[0x0]]={'$gte':moment(_0x4f87e0[0x1])[_0x0dfc('0xc9')](_0x0dfc('0xca'))};_0x3825f6['where']=_[_0x0dfc('0xa1')](_0x3825f6[_0x0dfc('0x79')],_0x454933);}_0x3825f6=_[_0x0dfc('0xa1')]({},_0x3825f6,_0x35c502[_0x0dfc('0xbf')]);return db['FaxMessage'][_0x0dfc('0x1e')]({'where':_0x3825f6['where']})[_0x0dfc('0x26')](function(_0xe7fcf3){_0x4fa292[_0x0dfc('0x1e')]=_0xe7fcf3;if(_0x35c502[_0x0dfc('0x3d')][_0x0dfc('0xbd')]){_0x3825f6[_0x0dfc('0xbe')]=[{'all':!![]}];}return db['FaxMessage']['findAll'](_0x3825f6);})[_0x0dfc('0x26')](function(_0x423ad5){_0x4fa292[_0x0dfc('0xba')]=_0x423ad5;return _0x4fa292;});}})[_0x0dfc('0x26')](respondWithFilteredResult(_0x368c84,_0x3825f6))[_0x0dfc('0xc0')](handleError(_0x368c84,null));};exports['addTags']=function(_0x3acea4,_0x4fe997,_0x4d3ed1){return db['FaxInteraction'][_0x0dfc('0x5f')]({'where':{'id':_0x3acea4[_0x0dfc('0xbc')]['id']}})[_0x0dfc('0x26')](handleEntityNotFound(_0x4fe997,null))[_0x0dfc('0x26')](function(_0x8f41f){if(_0x8f41f){return _0x8f41f['setTags'](_0x3acea4[_0x0dfc('0x74')]['ids'],_[_0x0dfc('0xcb')](_0x3acea4[_0x0dfc('0x74')],[_0x0dfc('0xc4'),'id'])||{})[_0x0dfc('0xcc')](function(){return db[_0x0dfc('0x6f')][_0x0dfc('0xcd')]({'attributes':['id','name',_0x0dfc('0x48')],'where':{'id':_0x3acea4['body'][_0x0dfc('0xc4')]}});})[_0x0dfc('0x26')](function(_0xed35c1){socket['emit'](_0x0dfc('0xce'),{'id':Number(_0x3acea4[_0x0dfc('0xbc')]['id']),'tags':_0xed35c1||[]});return{'id':Number(_0x3acea4[_0x0dfc('0xbc')]['id']),'tags':_0xed35c1||[]};});}})[_0x0dfc('0x26')](respondWithResult(_0x4fe997,null))['catch'](handleError(_0x4fe997,null));};exports['removeTags']=function(_0x5340c0,_0x458d10,_0x1a39b7){return db[_0x0dfc('0x38')][_0x0dfc('0x5f')]({'where':{'id':_0x5340c0[_0x0dfc('0xbc')]['id']}})[_0x0dfc('0x26')](handleEntityNotFound(_0x458d10,null))[_0x0dfc('0x26')](function(_0xcf6a1a){if(_0xcf6a1a){return _0xcf6a1a['removeTags'](_0x5340c0[_0x0dfc('0x3d')][_0x0dfc('0xc4')]);}})['then'](respondWithStatusCode(_0x458d10,null))[_0x0dfc('0xc0')](handleError(_0x458d10,null));};exports[_0x0dfc('0xcf')]=function(_0x3a75c7,_0x5a5010){var _0x457c0d=moment()['unix']()[_0x0dfc('0x9f')]();var _0x26c823=path[_0x0dfc('0xd0')](config['root'],'server',_0x0dfc('0xd1'),_0x0dfc('0xd2'));var _0xbfa8de=path['join'](config['root'],_0x0dfc('0xd3'),_0x0dfc('0xd1'),_0x0dfc('0xd4'));var _0x52f548=path['join'](_0x26c823,_0x457c0d);var _0x20f596=util[_0x0dfc('0xc9')](_0x0dfc('0xd5'),_0x3a75c7[_0x0dfc('0xbc')]['id'],_0x457c0d);var _0x2f1cd9=path[_0x0dfc('0xd0')](_0x26c823,_0x20f596);var _0x579c2c=[];_0x579c2c[_0x0dfc('0x30')]({'model':db[_0x0dfc('0xd6')],'as':_0x0dfc('0xd6'),'raw':!![]});var _0xbcfedd=[{'model':db['FaxMessage'],'as':'Messages','attributes':['id','body',_0x0dfc('0x7c')],'include':_0x579c2c}];return db['FaxInteraction'][_0x0dfc('0x5f')]({'where':{'id':_0x3a75c7[_0x0dfc('0xbc')]['id']},'include':_0xbcfedd})[_0x0dfc('0x26')](handleEntityNotFound(_0x5a5010,null))[_0x0dfc('0x26')](function(_0x46c3be){if(_0x46c3be&&_0x46c3be[_0x0dfc('0xd7')]){var _0x9e4aa3=_0x46c3be[_0x0dfc('0xd8')]({'plain':!![]});fs[_0x0dfc('0xd9')](_0x52f548);for(var _0x38989c=0x0;_0x38989c<_0x9e4aa3[_0x0dfc('0xd7')][_0x0dfc('0x43')];_0x38989c++){var _0x6a55d7=_0x9e4aa3[_0x0dfc('0xd7')][_0x38989c][_0x0dfc('0xd6')];if(_0x6a55d7){var _0x5b968e=path[_0x0dfc('0xd0')](_0xbfa8de,_0x6a55d7[_0x0dfc('0xda')]);if(fs['existsSync'](_0x5b968e)){fs[_0x0dfc('0xdb')](_0x5b968e)[_0x0dfc('0xdc')](fs[_0x0dfc('0xdd')](path[_0x0dfc('0xd0')](_0x52f548,_0x6a55d7[_0x0dfc('0xda')])));}}}return BPromise[_0x0dfc('0x98')]()[_0x0dfc('0x26')](function(){return new BPromise(function(_0x307fbc,_0x490c9f){zipdir(_0x52f548,{'saveTo':_0x2f1cd9},function(_0x42aa76,_0x46ca53){if(_0x42aa76)return _0x490c9f(_0x42aa76);return _0x307fbc(_0x46ca53);});})[_0x0dfc('0x26')](function(){return new BPromise(function(_0x1383a2,_0x339236){rimraf(_0x52f548,function(_0x2c2e1d){if(_0x2c2e1d)_0x339236(_0x2c2e1d);return _0x1383a2();});});})[_0x0dfc('0x26')](function(){return _0x5a5010['download'](_0x2f1cd9,_0x20f596,function(_0x21bcbe){if(_0x21bcbe){console[_0x0dfc('0xde')]('err',_0x21bcbe);}else{fs['unlinkSync'](_0x2f1cd9);}});});});}else{return _0x5a5010[_0x0dfc('0x19')](0xc8);}})[_0x0dfc('0xc0')](handleError(_0x5a5010,null));};
\ No newline at end of file
index e6e783b..94a05ba 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5df3=['catch','hasOwnProperty','hook','exports','events','../../mysqldb','FaxInteraction','FaxMessage','setMaxListeners','save','update','getUsers','then','Users','setDataValue','unreadMessages','length','emit'];(function(_0x28b0a1,_0x99bd0a){var _0x21470c=function(_0x45bf01){while(--_0x45bf01){_0x28b0a1['push'](_0x28b0a1['shift']());}};_0x21470c(++_0x99bd0a);}(_0x5df3,0xdc));var _0x35df=function(_0x968411,_0x151619){_0x968411=_0x968411-0x0;var _0x46e3e5=_0x5df3[_0x968411];return _0x46e3e5;};'use strict';var EventEmitter=require(_0x35df('0x0'));var FaxInteraction=require(_0x35df('0x1'))['db'][_0x35df('0x2')];var FaxMessage=require(_0x35df('0x1'))['db'][_0x35df('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x35df('0x4')](0x0);var events={'afterCreate':_0x35df('0x5'),'afterUpdate':_0x35df('0x6'),'afterDestroy':'remove'};function emitEvent(_0xbcc87d){return function(_0x5b48a4,_0x5a1c20,_0x4391fa){_0x5b48a4[_0x35df('0x7')]({'attributes':['id'],'raw':!![]})[_0x35df('0x8')](function(_0x48ab8e){_0x5b48a4['setDataValue'](_0x35df('0x9'),_0x48ab8e['map'](function(_0xa276b7){return{'id':_0xa276b7['id']};}));return FaxMessage['findAll']({'where':{'FaxInteractionId':_0x5b48a4['id'],'direction':'in','read':![]},'raw':!![]});})[_0x35df('0x8')](function(_0x38e495){_0x5b48a4[_0x35df('0xa')](_0x35df('0xb'),_0x38e495[_0x35df('0xc')]);FaxInteractionEvents['emit'](_0xbcc87d+':'+_0x5b48a4['id'],_0x5b48a4);FaxInteractionEvents[_0x35df('0xd')](_0xbcc87d,_0x5b48a4);_0x4391fa(null);})[_0x35df('0xe')](_0x4391fa(null));};}for(var e in events){if(events[_0x35df('0xf')](e)){var event=events[e];FaxInteraction[_0x35df('0x10')](e,emitEvent(event));}}module[_0x35df('0x11')]=FaxInteractionEvents;
\ No newline at end of file
+var _0x38cc=['FaxInteraction','FaxMessage','save','remove','then','Users','map','setDataValue','unreadMessages','length','emit','catch','hook','../../mysqldb'];(function(_0x16e0c8,_0x4861eb){var _0xe4b5af=function(_0x5248bc){while(--_0x5248bc){_0x16e0c8['push'](_0x16e0c8['shift']());}};_0xe4b5af(++_0x4861eb);}(_0x38cc,0x195));var _0xc38c=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x38cc[_0x321bb2];return _0x9c12ed;};'use strict';var EventEmitter=require('events');var FaxInteraction=require(_0xc38c('0x0'))['db'][_0xc38c('0x1')];var FaxMessage=require('../../mysqldb')['db'][_0xc38c('0x2')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc38c('0x3'),'afterUpdate':'update','afterDestroy':_0xc38c('0x4')};function emitEvent(_0xadfe12){return function(_0x17a8cc,_0x9a70ba,_0x442d12){_0x17a8cc['getUsers']({'attributes':['id'],'raw':!![]})[_0xc38c('0x5')](function(_0x44ca75){_0x17a8cc['setDataValue'](_0xc38c('0x6'),_0x44ca75[_0xc38c('0x7')](function(_0x348886){return{'id':_0x348886['id']};}));return FaxMessage['findAll']({'where':{'FaxInteractionId':_0x17a8cc['id'],'direction':'in','read':![]},'raw':!![]});})[_0xc38c('0x5')](function(_0x115b33){_0x17a8cc[_0xc38c('0x8')](_0xc38c('0x9'),_0x115b33[_0xc38c('0xa')]);FaxInteractionEvents[_0xc38c('0xb')](_0xadfe12+':'+_0x17a8cc['id'],_0x17a8cc);FaxInteractionEvents[_0xc38c('0xb')](_0xadfe12,_0x17a8cc);_0x442d12(null);})[_0xc38c('0xc')](_0x442d12(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxInteraction[_0xc38c('0xd')](e,emitEvent(event));}}module['exports']=FaxInteractionEvents;
\ No newline at end of file
index 010b95b..a290f00 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8265=['exports','define','FaxInteraction','changed','closed','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','bluebird','request-promise','rimraf','../../config/environment','./faxInteraction.attributes'];(function(_0x209803,_0x205d7e){var _0x53ef29=function(_0x1dc858){while(--_0x1dc858){_0x209803['push'](_0x209803['shift']());}};_0x53ef29(++_0x205d7e);}(_0x8265,0xa0));var _0x5826=function(_0x5aee23,_0x5a602e){_0x5aee23=_0x5aee23-0x0;var _0x1309b9=_0x8265[_0x5aee23];return _0x1309b9;};'use strict';var _=require(_0x5826('0x0'));var util=require(_0x5826('0x1'));var logger=require(_0x5826('0x2'))('api');var moment=require('moment');var BPromise=require(_0x5826('0x3'));var rp=require(_0x5826('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5826('0x5'));var config=require(_0x5826('0x6'));var attributes=require(_0x5826('0x7'));module[_0x5826('0x8')]=function(_0x3bf5a3,_0x53cbb0){return _0x3bf5a3[_0x5826('0x9')](_0x5826('0xa'),attributes,{'tableName':'fax_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x598a9c,_0x4f696f,_0x2ff876){if(_0x598a9c[_0x5826('0xb')](_0x5826('0xc'))){_0x598a9c['closedAt']=moment()['format'](_0x5826('0xd'));}_0x2ff876(null,_0x598a9c);}}});};
\ No newline at end of file
+var _0x419f=['lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./faxInteraction.attributes','exports','define','FaxInteraction','fax_interactions','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x39e4ea,_0x1dcd57){var _0x2cf329=function(_0x7d9620){while(--_0x7d9620){_0x39e4ea['push'](_0x39e4ea['shift']());}};_0x2cf329(++_0x1dcd57);}(_0x419f,0x176));var _0xf419=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x419f[_0x1035c1];return _0x308d67;};'use strict';var _=require(_0xf419('0x0'));var util=require(_0xf419('0x1'));var logger=require(_0xf419('0x2'))(_0xf419('0x3'));var moment=require(_0xf419('0x4'));var BPromise=require(_0xf419('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf419('0x6'));var rimraf=require('rimraf');var config=require(_0xf419('0x7'));var attributes=require(_0xf419('0x8'));module[_0xf419('0x9')]=function(_0x38f2fa,_0x2d8430){return _0x38f2fa[_0xf419('0xa')](_0xf419('0xb'),attributes,{'tableName':_0xf419('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3f0c3e,_0x4bb5fd,_0x33fbb2){if(_0x3f0c3e[_0xf419('0xd')]('closed')){_0x3f0c3e[_0xf419('0xe')]=moment()[_0xf419('0xf')](_0xf419('0x10'));}_0x33fbb2(null,_0x3f0c3e);}}});};
\ No newline at end of file
index 203d090..85ee9a5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbe58=['stringify','AddTagsToFaxInteraction','FaxInteraction','find','addTags','omit','ids','spread','AddTags','catch','lodash','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','register','then','info','FaxInteraction,\x20%s,\x20%s','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','body','options','raw','where','limit','UpdateFaxInteraction'];(function(_0x133e54,_0x359ba9){var _0x2bba1c=function(_0x2b1714){while(--_0x2b1714){_0x133e54['push'](_0x133e54['shift']());}};_0x2bba1c(++_0x359ba9);}(_0xbe58,0x14a));var _0x8be5=function(_0x487b0c,_0x14ff74){_0x487b0c=_0x487b0c-0x0;var _0x1adbdc=_0xbe58[_0x487b0c];return _0x1adbdc;};'use strict';var _=require(_0x8be5('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x8be5('0x1'));var rs=require(_0x8be5('0x2'));var fs=require('fs');var Redis=require(_0x8be5('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x8be5('0x4'))(_0x8be5('0x5'));var config=require(_0x8be5('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x8be5('0x7')]({'port':0x232a});config[_0x8be5('0x8')]=_[_0x8be5('0x9')](config[_0x8be5('0x8')],{'host':_0x8be5('0xa'),'port':0x18eb});var socket=require(_0x8be5('0xb'))(new Redis(config[_0x8be5('0x8')]));require(_0x8be5('0xc'))[_0x8be5('0xd')](socket);function respondWithRpcPromise(_0x22a1f2,_0x4f41db,_0x20c3b5){return new BPromise(function(_0x4c4362,_0x2fa7d3){return client['request'](_0x22a1f2,_0x20c3b5)[_0x8be5('0xe')](function(_0x40c3f6){logger[_0x8be5('0xf')](_0x8be5('0x10'),_0x4f41db,'request\x20sent');logger[_0x8be5('0x11')](_0x8be5('0x12'),_0x4f41db,_0x8be5('0x13'),JSON['stringify'](_0x40c3f6));if(_0x40c3f6[_0x8be5('0x14')]){if(_0x40c3f6[_0x8be5('0x14')][_0x8be5('0x15')]===0x1f4){logger[_0x8be5('0x14')]('FaxInteraction,\x20%s,\x20%s',_0x4f41db,_0x40c3f6['error'][_0x8be5('0x16')]);return _0x2fa7d3(_0x40c3f6[_0x8be5('0x14')][_0x8be5('0x16')]);}logger[_0x8be5('0x14')]('FaxInteraction,\x20%s,\x20%s',_0x4f41db,_0x40c3f6[_0x8be5('0x14')]['message']);return _0x4c4362(_0x40c3f6[_0x8be5('0x14')]['message']);}else{logger[_0x8be5('0xf')](_0x8be5('0x10'),_0x4f41db,'request\x20sent');_0x4c4362(_0x40c3f6[_0x8be5('0x17')][_0x8be5('0x16')]);}})['catch'](function(_0x368bc4){logger[_0x8be5('0x14')]('FaxInteraction,\x20%s,\x20%s',_0x4f41db,_0x368bc4);_0x2fa7d3(_0x368bc4);});});}exports['UpdateFaxInteraction']=function(_0xe825c9){var _0x784949=this;return new Promise(function(_0x2507c4,_0x3ed354){return db['FaxInteraction']['update'](_0xe825c9[_0x8be5('0x18')],{'raw':_0xe825c9[_0x8be5('0x19')]?_0xe825c9[_0x8be5('0x19')][_0x8be5('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xe825c9[_0x8be5('0x19')]?_0xe825c9[_0x8be5('0x19')][_0x8be5('0x1b')]||null:null,'attributes':_0xe825c9['options']?_0xe825c9['options']['attributes']||null:null,'limit':_0xe825c9['options']?_0xe825c9[_0x8be5('0x19')][_0x8be5('0x1c')]||null:null})['then'](function(_0xfdb3ab){logger[_0x8be5('0xf')](_0x8be5('0x1d'),_0xe825c9);logger[_0x8be5('0x11')](_0x8be5('0x1d'),_0xe825c9,JSON[_0x8be5('0x1e')](_0xfdb3ab));_0x2507c4(_0xfdb3ab);})['catch'](function(_0x4a90a1){logger['error'](_0x8be5('0x1d'),_0x4a90a1[_0x8be5('0x16')],_0xe825c9);_0x3ed354(_0x784949[_0x8be5('0x14')](0x1f4,_0x4a90a1[_0x8be5('0x16')]));});});};exports[_0x8be5('0x1f')]=function(_0xe52e8d){return new Promise(function(_0x47a88b,_0x430745){return db[_0x8be5('0x20')][_0x8be5('0x21')]({'where':_0xe52e8d[_0x8be5('0x19')]?_0xe52e8d['options'][_0x8be5('0x1b')]||null:null})[_0x8be5('0xe')](function(_0x53028d){if(_0x53028d){return _0x53028d[_0x8be5('0x22')](_0xe52e8d[_0x8be5('0x18')]['ids'],_[_0x8be5('0x23')](_0xe52e8d[_0x8be5('0x18')],[_0x8be5('0x24'),'id'])||{});}})[_0x8be5('0x25')](function(_0xe2ce79){logger[_0x8be5('0xf')](_0x8be5('0x26'),_0xe52e8d);logger[_0x8be5('0x11')](_0x8be5('0x26'),_0xe52e8d,JSON[_0x8be5('0x1e')](_0xe2ce79));_0x47a88b(_0xe2ce79);})[_0x8be5('0x27')](function(_0x346d1c){logger[_0x8be5('0x14')](_0x8be5('0x26'),_0x346d1c[_0x8be5('0x16')],_0xe52e8d);_0x430745(_this['error'](0x1f4,_0x346d1c[_0x8be5('0x16')]));});});};
\ No newline at end of file
+var _0x0713=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','redis','./faxInteraction.socket','request','info','FaxInteraction,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','UpdateFaxInteraction','FaxInteraction','options','raw','where','limit','then','body','ids','omit','AddTags','catch','lodash'];(function(_0x212fcc,_0x1a8867){var _0x4d8190=function(_0x347f7b){while(--_0x347f7b){_0x212fcc['push'](_0x212fcc['shift']());}};_0x4d8190(++_0x1a8867);}(_0x0713,0xe6));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x3071('0x0'));var util=require('util');var moment=require(_0x3071('0x1'));var BPromise=require(_0x3071('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3071('0x3'));var db=require(_0x3071('0x4'))['db'];var utils=require(_0x3071('0x5'));var logger=require('../../config/logger')(_0x3071('0x6'));var config=require('../../config/environment');var jayson=require(_0x3071('0x7'));var client=jayson[_0x3071('0x8')]['http']({'port':0x232a});config[_0x3071('0x9')]=_['defaults'](config[_0x3071('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3071('0x9')]));require(_0x3071('0xa'))['register'](socket);function respondWithRpcPromise(_0x433cf5,_0x2e66d0,_0x2e6335){return new BPromise(function(_0x51605b,_0x23d055){return client[_0x3071('0xb')](_0x433cf5,_0x2e6335)['then'](function(_0x71cfc4){logger[_0x3071('0xc')](_0x3071('0xd'),_0x2e66d0,'request\x20sent');logger[_0x3071('0xe')]('FaxInteraction,\x20%s,\x20%s,\x20%s',_0x2e66d0,_0x3071('0xf'),JSON[_0x3071('0x10')](_0x71cfc4));if(_0x71cfc4['error']){if(_0x71cfc4[_0x3071('0x11')][_0x3071('0x12')]===0x1f4){logger[_0x3071('0x11')](_0x3071('0xd'),_0x2e66d0,_0x71cfc4[_0x3071('0x11')]['message']);return _0x23d055(_0x71cfc4[_0x3071('0x11')][_0x3071('0x13')]);}logger['error'](_0x3071('0xd'),_0x2e66d0,_0x71cfc4['error'][_0x3071('0x13')]);return _0x51605b(_0x71cfc4[_0x3071('0x11')][_0x3071('0x13')]);}else{logger['info'](_0x3071('0xd'),_0x2e66d0,_0x3071('0xf'));_0x51605b(_0x71cfc4[_0x3071('0x14')][_0x3071('0x13')]);}})['catch'](function(_0x16d4f8){logger[_0x3071('0x11')](_0x3071('0xd'),_0x2e66d0,_0x16d4f8);_0x23d055(_0x16d4f8);});});}exports[_0x3071('0x15')]=function(_0x517c6b){var _0x2a8252=this;return new Promise(function(_0x53cfd5,_0x2a07c4){return db[_0x3071('0x16')]['update'](_0x517c6b['body'],{'raw':_0x517c6b[_0x3071('0x17')]?_0x517c6b[_0x3071('0x17')][_0x3071('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x517c6b[_0x3071('0x17')]?_0x517c6b[_0x3071('0x17')][_0x3071('0x19')]||null:null,'attributes':_0x517c6b[_0x3071('0x17')]?_0x517c6b[_0x3071('0x17')]['attributes']||null:null,'limit':_0x517c6b['options']?_0x517c6b[_0x3071('0x17')][_0x3071('0x1a')]||null:null})[_0x3071('0x1b')](function(_0x3ed2c8){logger['info'](_0x3071('0x15'),_0x517c6b);logger[_0x3071('0xe')](_0x3071('0x15'),_0x517c6b,JSON[_0x3071('0x10')](_0x3ed2c8));_0x53cfd5(_0x3ed2c8);})['catch'](function(_0x15c159){logger[_0x3071('0x11')](_0x3071('0x15'),_0x15c159['message'],_0x517c6b);_0x2a07c4(_0x2a8252[_0x3071('0x11')](0x1f4,_0x15c159['message']));});});};exports['AddTagsToFaxInteraction']=function(_0x5a2f5b){return new Promise(function(_0x19e10a,_0x22a22c){return db[_0x3071('0x16')]['find']({'where':_0x5a2f5b[_0x3071('0x17')]?_0x5a2f5b[_0x3071('0x17')][_0x3071('0x19')]||null:null})[_0x3071('0x1b')](function(_0x4dc0d3){if(_0x4dc0d3){return _0x4dc0d3['addTags'](_0x5a2f5b[_0x3071('0x1c')][_0x3071('0x1d')],_[_0x3071('0x1e')](_0x5a2f5b[_0x3071('0x1c')],[_0x3071('0x1d'),'id'])||{});}})['spread'](function(_0x732034){logger['info']('AddTags',_0x5a2f5b);logger['debug'](_0x3071('0x1f'),_0x5a2f5b,JSON[_0x3071('0x10')](_0x732034));_0x19e10a(_0x732034);})[_0x3071('0x20')](function(_0x44bca9){logger[_0x3071('0x11')](_0x3071('0x1f'),_0x44bca9[_0x3071('0x13')],_0x5a2f5b);_0x22a22c(_this[_0x3071('0x11')](0x1f4,_0x44bca9['message']));});});};
\ No newline at end of file
index df6d18e..c16fee2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x99ba=['faxInteraction:','update','emit','removeListener'];(function(_0x2aa788,_0x498eb8){var _0x5be967=function(_0x546ba9){while(--_0x546ba9){_0x2aa788['push'](_0x2aa788['shift']());}};_0x5be967(++_0x498eb8);}(_0x99ba,0x121));var _0xa99b=function(_0x189863,_0x425026){_0x189863=_0x189863-0x0;var _0x50f734=_0x99ba[_0x189863];return _0x50f734;};'use strict';var FaxInteractionEvents=require('./faxInteraction.events');var events=['save','remove',_0xa99b('0x0')];function createListener(_0x32ae90,_0x1fb6b0){return function(_0xe26f1){_0x1fb6b0[_0xa99b('0x1')](_0x32ae90,_0xe26f1);};}function removeListener(_0x5a1cc5,_0xedc3e){return function(){FaxInteractionEvents[_0xa99b('0x2')](_0x5a1cc5,_0xedc3e);};}exports['register']=function(_0x41ac6c){for(var _0xfbf29e=0x0,_0x329b87=events['length'];_0xfbf29e<_0x329b87;_0xfbf29e++){var _0x2b8165=events[_0xfbf29e];var _0x1a094c=createListener(_0xa99b('0x3')+_0x2b8165,_0x41ac6c);FaxInteractionEvents['on'](_0x2b8165,_0x1a094c);}};
\ No newline at end of file
+var _0xfcc6=['./faxInteraction.events','save','update','register','length'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xfcc6,0x1bd));var _0x6fcc=function(_0x53f0db,_0x35c67c){_0x53f0db=_0x53f0db-0x0;var _0xae0a5c=_0xfcc6[_0x53f0db];return _0xae0a5c;};'use strict';var FaxInteractionEvents=require(_0x6fcc('0x0'));var events=[_0x6fcc('0x1'),'remove',_0x6fcc('0x2')];function createListener(_0x397147,_0x2ed6cb){return function(_0x9597fc){_0x2ed6cb['emit'](_0x397147,_0x9597fc);};}function removeListener(_0xdcef78,_0x562410){return function(){FaxInteractionEvents['removeListener'](_0xdcef78,_0x562410);};}exports[_0x6fcc('0x3')]=function(_0x5d02ab){for(var _0x2b69c7=0x0,_0x4bff93=events[_0x6fcc('0x4')];_0x2b69c7<_0x4bff93;_0x2b69c7++){var _0x3cd856=events[_0x2b69c7];var _0x42036b=createListener('faxInteraction:'+_0x3cd856,_0x5d02ab);FaxInteractionEvents['on'](_0x3cd856,_0x42036b);}};
\ No newline at end of file
index a00c92b..9098c5a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x65e0=['faxinteraction:addtags','addTags','put','faxinteraction:update','update','faxinteraction:destroy','destroy','delete','removeTags','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxInteraction.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/messages','getMessages','post','create','addMessage','/:id/tags','tracked','fax'];(function(_0x23e7c1,_0x35110c){var _0x1add43=function(_0x238918){while(--_0x238918){_0x23e7c1['push'](_0x23e7c1['shift']());}};_0x1add43(++_0x35110c);}(_0x65e0,0x96));var _0x065e=function(_0x1defb2,_0x429099){_0x1defb2=_0x1defb2-0x0;var _0xad8973=_0x65e0[_0x1defb2];return _0xad8973;};'use strict';var multer=require(_0x065e('0x0'));var util=require(_0x065e('0x1'));var path=require(_0x065e('0x2'));var timeout=require(_0x065e('0x3'));var express=require('express');var router=express[_0x065e('0x4')]();var fs_extra=require(_0x065e('0x5'));var auth=require(_0x065e('0x6'));var interaction=require(_0x065e('0x7'));var config=require(_0x065e('0x8'));var controller=require(_0x065e('0x9'));router[_0x065e('0xa')]('/',auth['isAuthenticated'](),controller[_0x065e('0xb')]);router['get'](_0x065e('0xc'),auth[_0x065e('0xd')](),controller[_0x065e('0xe')]);router[_0x065e('0xa')](_0x065e('0xf'),auth[_0x065e('0xd')](),controller[_0x065e('0x10')]);router[_0x065e('0xa')](_0x065e('0x11'),auth[_0x065e('0xd')](),controller[_0x065e('0x12')]);router[_0x065e('0xa')]('/:id/download',auth[_0x065e('0xd')](),controller['download']);router[_0x065e('0x13')]('/',auth[_0x065e('0xd')](),controller[_0x065e('0x14')]);router[_0x065e('0x13')](_0x065e('0x11'),auth[_0x065e('0xd')](),controller[_0x065e('0x15')]);router[_0x065e('0x13')](_0x065e('0x16'),auth[_0x065e('0xd')](),interaction[_0x065e('0x17')](_0x065e('0x18'),_0x065e('0x19')),controller[_0x065e('0x1a')]);router[_0x065e('0x1b')](_0x065e('0xf'),auth[_0x065e('0xd')](),interaction[_0x065e('0x17')](_0x065e('0x18'),_0x065e('0x1c')),controller[_0x065e('0x1d')]);router['delete'](_0x065e('0xf'),auth['isAuthenticated'](),interaction[_0x065e('0x17')](_0x065e('0x18'),_0x065e('0x1e')),controller[_0x065e('0x1f')]);router[_0x065e('0x20')](_0x065e('0x16'),auth[_0x065e('0xd')](),controller[_0x065e('0x21')]);module[_0x065e('0x22')]=router;
\ No newline at end of file
+var _0xe318=['faxinteraction:destroy','destroy','delete','removeTags','multer','util','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','addMessage','/:id/tags','tracked','fax','faxinteraction:addtags','addTags','put','faxinteraction:update','update'];(function(_0x38ac7b,_0x2dc75f){var _0x2c3cd5=function(_0x10ddc9){while(--_0x10ddc9){_0x38ac7b['push'](_0x38ac7b['shift']());}};_0x2c3cd5(++_0x2dc75f);}(_0xe318,0xdd));var _0x8e31=function(_0x33788f,_0x589b57){_0x33788f=_0x33788f-0x0;var _0x77e425=_0xe318[_0x33788f];return _0x77e425;};'use strict';var multer=require(_0x8e31('0x0'));var util=require(_0x8e31('0x1'));var path=require('path');var timeout=require(_0x8e31('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x8e31('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x8e31('0x4'));var config=require(_0x8e31('0x5'));var controller=require('./faxInteraction.controller');router[_0x8e31('0x6')]('/',auth[_0x8e31('0x7')](),controller[_0x8e31('0x8')]);router[_0x8e31('0x6')](_0x8e31('0x9'),auth[_0x8e31('0x7')](),controller[_0x8e31('0xa')]);router[_0x8e31('0x6')](_0x8e31('0xb'),auth[_0x8e31('0x7')](),controller[_0x8e31('0xc')]);router['get'](_0x8e31('0xd'),auth[_0x8e31('0x7')](),controller[_0x8e31('0xe')]);router['get'](_0x8e31('0xf'),auth[_0x8e31('0x7')](),controller[_0x8e31('0x10')]);router['post']('/',auth[_0x8e31('0x7')](),controller['create']);router[_0x8e31('0x11')]('/:id/messages',auth['isAuthenticated'](),controller[_0x8e31('0x12')]);router[_0x8e31('0x11')](_0x8e31('0x13'),auth[_0x8e31('0x7')](),interaction[_0x8e31('0x14')](_0x8e31('0x15'),_0x8e31('0x16')),controller[_0x8e31('0x17')]);router[_0x8e31('0x18')](_0x8e31('0xb'),auth[_0x8e31('0x7')](),interaction[_0x8e31('0x14')](_0x8e31('0x15'),_0x8e31('0x19')),controller[_0x8e31('0x1a')]);router['delete'](_0x8e31('0xb'),auth[_0x8e31('0x7')](),interaction['tracked']('fax',_0x8e31('0x1b')),controller[_0x8e31('0x1c')]);router[_0x8e31('0x1d')]('/:id/tags',auth[_0x8e31('0x7')](),controller[_0x8e31('0x1e')]);module['exports']=router;
\ No newline at end of file
index 9634827..bfe9118 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2356=['exports','TEXT','ENUM','out','DATE'];(function(_0xf05513,_0x376b1e){var _0x3dbe5b=function(_0x1e7dae){while(--_0x1e7dae){_0xf05513['push'](_0xf05513['shift']());}};_0x3dbe5b(++_0x376b1e);}(_0x2356,0x14f));var _0x6235=function(_0x2d0818,_0x16d1a9){_0x2d0818=_0x2d0818-0x0;var _0x466400=_0x2356[_0x2d0818];return _0x466400;};'use strict';var Sequelize=require('sequelize');module[_0x6235('0x0')]={'body':{'type':Sequelize[_0x6235('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x6235('0x2')]('in',_0x6235('0x3')),'defaultValue':'out','allowNull':![]},'failMessage':{'type':Sequelize['TEXT'],'defaultValue':null},'readAt':{'type':Sequelize[_0x6235('0x4')]}};
\ No newline at end of file
+var _0x255f=['TEXT','medium','BOOLEAN','out','DATE','sequelize'];(function(_0x4c7423,_0x117200){var _0x5f0094=function(_0x2f0448){while(--_0x2f0448){_0x4c7423['push'](_0x4c7423['shift']());}};_0x5f0094(++_0x117200);}(_0x255f,0x185));var _0xf255=function(_0x4a8935,_0x159d0f){_0x4a8935=_0x4a8935-0x0;var _0x3516fb=_0x255f[_0x4a8935];return _0x3516fb;};'use strict';var Sequelize=require(_0xf255('0x0'));module['exports']={'body':{'type':Sequelize[_0xf255('0x1')](_0xf255('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xf255('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xf255('0x4')),'defaultValue':_0xf255('0x4'),'allowNull':![]},'failMessage':{'type':Sequelize[_0xf255('0x1')],'defaultValue':null},'readAt':{'type':Sequelize[_0xf255('0x5')]}};
\ No newline at end of file
index d5d5672..01e13ca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xee4a=['options','find','update','body','params','describe','accept','fax','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','FaxInteractionId','isNil','interaction','get','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','contact','User','agent','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','fax-interactions','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','Sequelize','rejectmessage','CmContact','findOne','Attachment','AttachmentId','SendFax','FaxAccountId','basename','join','root','files','attachments','download','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../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','stringify','error','code','message','result','catch','sendStatus','status','offset','undefined','limit','count','Content-Range','apply','reject','destroy','end','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','VIRTUAL','merge','FaxMessage','includeAll','findAll','rows','include'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xee4a,0x161));var _0xaee4=function(_0x3aad02,_0x491ac2){_0x3aad02=_0x3aad02-0x0;var _0x311b59=_0xee4a[_0x3aad02];return _0x311b59;};'use strict';var emlformat=require(_0xaee4('0x0'));var rimraf=require(_0xaee4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xaee4('0x2'));var rp=require(_0xaee4('0x3'));var moment=require('moment');var BPromise=require(_0xaee4('0x4'));var Mustache=require(_0xaee4('0x5'));var util=require(_0xaee4('0x6'));var path=require(_0xaee4('0x7'));var sox=require(_0xaee4('0x8'));var csv=require(_0xaee4('0x9'));var ejs=require(_0xaee4('0xa'));var fs=require('fs');var fs_extra=require(_0xaee4('0xb'));var _=require(_0xaee4('0xc'));var squel=require(_0xaee4('0xd'));var crypto=require(_0xaee4('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xaee4('0xf'));var toCsv=require(_0xaee4('0x9'));var querystring=require(_0xaee4('0x10'));var Papa=require(_0xaee4('0x11'));var Redis=require(_0xaee4('0x12'));var authService=require(_0xaee4('0x13'));var qs=require(_0xaee4('0x14'));var as=require(_0xaee4('0x15'));var hardwareService=require(_0xaee4('0x16'));var logger=require(_0xaee4('0x17'))(_0xaee4('0x18'));var utils=require(_0xaee4('0x19'));var config=require(_0xaee4('0x1a'));var licenseUtil=require(_0xaee4('0x1b'));var db=require(_0xaee4('0x1c'))['db'];config[_0xaee4('0x1d')]=_['defaults'](config[_0xaee4('0x1d')],{'host':_0xaee4('0x1e'),'port':0x18eb});var socket=require(_0xaee4('0x1f'))(new Redis(config[_0xaee4('0x1d')]));require(_0xaee4('0x20'))[_0xaee4('0x21')](socket);var jayson=require(_0xaee4('0x22'));var client=jayson['client'][_0xaee4('0x23')]({'port':0x232c});var client9002=jayson[_0xaee4('0x24')]['http']({'port':0x232a});function respondWithRpcPromise(_0x35cb0e,_0x50aa50,_0x45234f,_0x21d661){return new BPromise(function(_0x5c86bf,_0xa1481f){var _0x2ef418=_0x21d661||client;return _0x2ef418[_0xaee4('0x25')](_0x35cb0e,_0x45234f)[_0xaee4('0x26')](function(_0x2e676f){logger[_0xaee4('0x27')](_0xaee4('0x28'),_0x50aa50,'request\x20sent');logger[_0xaee4('0x29')](_0xaee4('0x2a'),_0x50aa50,_0xaee4('0x2b'),JSON[_0xaee4('0x2c')](_0x2e676f));if(_0x2e676f[_0xaee4('0x2d')]){if(_0x2e676f[_0xaee4('0x2d')][_0xaee4('0x2e')]===0x1f4){logger[_0xaee4('0x2d')](_0xaee4('0x28'),_0x50aa50,_0x2e676f[_0xaee4('0x2d')][_0xaee4('0x2f')]);return _0xa1481f(_0x2e676f[_0xaee4('0x2d')][_0xaee4('0x2f')]);}logger[_0xaee4('0x2d')]('FaxMessage,\x20%s,\x20%s',_0x50aa50,_0x2e676f[_0xaee4('0x2d')][_0xaee4('0x2f')]);return _0x5c86bf(_0x2e676f[_0xaee4('0x2d')]['message']);}else{logger['info'](_0xaee4('0x28'),_0x50aa50,_0xaee4('0x2b'));_0x5c86bf(_0x2e676f[_0xaee4('0x30')][_0xaee4('0x2f')]);}})[_0xaee4('0x31')](function(_0x3d2c57){logger[_0xaee4('0x2d')](_0xaee4('0x28'),_0x50aa50,_0x3d2c57);_0xa1481f(_0x3d2c57);});});}function respondWithStatusCode(_0x494d95,_0xe97a17){_0xe97a17=_0xe97a17||0xcc;return function(_0x51215f){if(_0x51215f){return _0x494d95[_0xaee4('0x32')](_0xe97a17);}return _0x494d95['status'](_0xe97a17)['end']();};}function respondWithResult(_0x24c8bc,_0x38bdf7){_0x38bdf7=_0x38bdf7||0xc8;return function(_0x422eb2){if(_0x422eb2){return _0x24c8bc[_0xaee4('0x33')](_0x38bdf7)['json'](_0x422eb2);}};}function respondWithFilteredResult(_0x32b678,_0x4e4ea9){return function(_0x2b966d){if(_0x2b966d){var _0x59eafb=typeof _0x4e4ea9[_0xaee4('0x34')]===_0xaee4('0x35')&&typeof _0x4e4ea9[_0xaee4('0x36')]==='undefined';var _0x135c7f=_0x2b966d['count'];var _0x5bc4cc=_0x59eafb?0x0:_0x4e4ea9['offset'];var _0x2a1770=_0x59eafb?_0x2b966d[_0xaee4('0x37')]:_0x4e4ea9[_0xaee4('0x34')]+_0x4e4ea9['limit'];var _0xb36ad8;if(_0x2a1770>=_0x135c7f){_0x2a1770=_0x135c7f;_0xb36ad8=0xc8;}else{_0xb36ad8=0xce;}_0x32b678['status'](_0xb36ad8);return _0x32b678['set'](_0xaee4('0x38'),_0x5bc4cc+'-'+_0x2a1770+'/'+_0x135c7f)['json'](_0x2b966d);}return null;};}function patchUpdates(_0x4a405a){return function(_0x1e5e40){try{jsonpatch[_0xaee4('0x39')](_0x1e5e40,_0x4a405a,!![]);}catch(_0x1e8594){return BPromise[_0xaee4('0x3a')](_0x1e8594);}return _0x1e5e40['save']();};}function saveUpdates(_0x34e464,_0x273bc6){return function(_0xb673d5){if(_0xb673d5){return _0xb673d5['update'](_0x34e464)[_0xaee4('0x26')](function(_0x3585e9){return _0x3585e9;});}return null;};}function removeEntity(_0x1e6d2e,_0x329d63){return function(_0x2503d3){if(_0x2503d3){return _0x2503d3[_0xaee4('0x3b')]()[_0xaee4('0x26')](function(){_0x1e6d2e[_0xaee4('0x33')](0xcc)[_0xaee4('0x3c')]();});}};}function handleEntityNotFound(_0x1bdd4b,_0x32df7b){return function(_0x523fd5){if(!_0x523fd5){_0x1bdd4b[_0xaee4('0x32')](0x194);}return _0x523fd5;};}function handleError(_0x3eb318,_0xbe772e){_0xbe772e=_0xbe772e||0x1f4;return function(_0x4f6f6b){logger['error'](_0x4f6f6b['stack']);if(_0x4f6f6b[_0xaee4('0x3d')]){delete _0x4f6f6b[_0xaee4('0x3d')];}_0x3eb318[_0xaee4('0x33')](_0xbe772e)[_0xaee4('0x3e')](_0x4f6f6b);};}exports[_0xaee4('0x3f')]=function(_0x8feaf1,_0x50c978){var _0x18647f={},_0x17c99d={},_0x1fbeee={'count':0x0,'rows':[]};var _0x475beb=_[_0xaee4('0x40')](db['FaxMessage'][_0xaee4('0x41')],function(_0x2305e8){return{'name':_0x2305e8[_0xaee4('0x42')],'type':_0x2305e8[_0xaee4('0x43')][_0xaee4('0x44')]};});_0x17c99d[_0xaee4('0x45')]=_['map'](_0x475beb,'name');_0x17c99d['query']=_[_0xaee4('0x46')](_0x8feaf1['query']);_0x17c99d['filters']=_[_0xaee4('0x47')](_0x17c99d[_0xaee4('0x45')],_0x17c99d[_0xaee4('0x48')]);_0x18647f[_0xaee4('0x49')]=_[_0xaee4('0x47')](_0x17c99d[_0xaee4('0x45')],qs[_0xaee4('0x4a')](_0x8feaf1[_0xaee4('0x48')][_0xaee4('0x4a')]));_0x18647f['attributes']=_0x18647f[_0xaee4('0x49')][_0xaee4('0x4b')]?_0x18647f[_0xaee4('0x49')]:_0x17c99d[_0xaee4('0x45')];if(!_0x8feaf1[_0xaee4('0x48')][_0xaee4('0x4c')](_0xaee4('0x4d'))){_0x18647f['limit']=qs[_0xaee4('0x36')](_0x8feaf1['query']['limit']);_0x18647f['offset']=qs[_0xaee4('0x34')](_0x8feaf1[_0xaee4('0x48')][_0xaee4('0x34')]);}_0x18647f[_0xaee4('0x4e')]=qs[_0xaee4('0x4f')](_0x8feaf1[_0xaee4('0x48')][_0xaee4('0x4f')]);_0x18647f['where']=qs[_0xaee4('0x50')](_[_0xaee4('0x51')](_0x8feaf1[_0xaee4('0x48')],_0x17c99d['filters']),_0x475beb);if(_0x8feaf1[_0xaee4('0x48')][_0xaee4('0x52')]){_0x18647f[_0xaee4('0x53')]=_['merge'](_0x18647f[_0xaee4('0x53')],{'$or':_[_0xaee4('0x40')](_0x475beb,function(_0x5924f0){if(_0x5924f0['type']!==_0xaee4('0x54')){var _0xf12d47={};_0xf12d47[_0x5924f0[_0xaee4('0x3d')]]={'$like':'%'+_0x8feaf1[_0xaee4('0x48')][_0xaee4('0x52')]+'%'};return _0xf12d47;}})});}_0x18647f=_[_0xaee4('0x55')]({},_0x18647f,_0x8feaf1['options']);var _0x5ec222={'where':_0x18647f[_0xaee4('0x53')]};return db[_0xaee4('0x56')][_0xaee4('0x37')](_0x5ec222)[_0xaee4('0x26')](function(_0x263d2a){_0x1fbeee[_0xaee4('0x37')]=_0x263d2a;if(_0x8feaf1[_0xaee4('0x48')][_0xaee4('0x57')]){_0x18647f['include']=[{'all':!![]}];}return db[_0xaee4('0x56')][_0xaee4('0x58')](_0x18647f);})[_0xaee4('0x26')](function(_0x1e383b){_0x1fbeee[_0xaee4('0x59')]=_0x1e383b;return _0x1fbeee;})['then'](respondWithFilteredResult(_0x50c978,_0x18647f))[_0xaee4('0x31')](handleError(_0x50c978,null));};exports['show']=function(_0x2ed3c8,_0x3dbff3){var _0x52d290={'raw':!![],'where':{'id':_0x2ed3c8['params']['id']}},_0x142d39={};_0x142d39[_0xaee4('0x45')]=_[_0xaee4('0x46')](db[_0xaee4('0x56')][_0xaee4('0x41')]);_0x142d39['query']=_[_0xaee4('0x46')](_0x2ed3c8[_0xaee4('0x48')]);_0x142d39[_0xaee4('0x50')]=_[_0xaee4('0x47')](_0x142d39[_0xaee4('0x45')],_0x142d39[_0xaee4('0x48')]);_0x52d290[_0xaee4('0x49')]=_[_0xaee4('0x47')](_0x142d39[_0xaee4('0x45')],qs[_0xaee4('0x4a')](_0x2ed3c8['query'][_0xaee4('0x4a')]));_0x52d290[_0xaee4('0x49')]=_0x52d290[_0xaee4('0x49')][_0xaee4('0x4b')]?_0x52d290[_0xaee4('0x49')]:_0x142d39['model'];if(_0x2ed3c8[_0xaee4('0x48')][_0xaee4('0x57')]){_0x52d290[_0xaee4('0x5a')]=[{'all':!![]}];}_0x52d290=_[_0xaee4('0x55')]({},_0x52d290,_0x2ed3c8[_0xaee4('0x5b')]);return db['FaxMessage'][_0xaee4('0x5c')](_0x52d290)[_0xaee4('0x26')](handleEntityNotFound(_0x3dbff3,null))[_0xaee4('0x26')](respondWithResult(_0x3dbff3,null))[_0xaee4('0x31')](handleError(_0x3dbff3,null));};exports[_0xaee4('0x5d')]=function(_0x1b56b2,_0xa0a3ab){if(_0x1b56b2[_0xaee4('0x5e')]['id']){delete _0x1b56b2[_0xaee4('0x5e')]['id'];}return db[_0xaee4('0x56')]['find']({'where':{'id':_0x1b56b2[_0xaee4('0x5f')]['id']}})[_0xaee4('0x26')](handleEntityNotFound(_0xa0a3ab,null))[_0xaee4('0x26')](saveUpdates(_0x1b56b2['body'],null))[_0xaee4('0x26')](respondWithResult(_0xa0a3ab,null))[_0xaee4('0x31')](handleError(_0xa0a3ab,null));};exports[_0xaee4('0x3b')]=function(_0x532c2f,_0x3c381d){return db[_0xaee4('0x56')][_0xaee4('0x5c')]({'where':{'id':_0x532c2f['params']['id']}})[_0xaee4('0x26')](handleEntityNotFound(_0x3c381d,null))[_0xaee4('0x26')](removeEntity(_0x3c381d,null))[_0xaee4('0x31')](handleError(_0x3c381d,null));};exports[_0xaee4('0x60')]=function(_0x2bea57,_0x5913eb){return db[_0xaee4('0x56')][_0xaee4('0x60')]()[_0xaee4('0x26')](respondWithResult(_0x5913eb,null))[_0xaee4('0x31')](handleError(_0x5913eb,null));};var interaction_log=require(_0xaee4('0x17'))('fax-interactions');exports[_0xaee4('0x61')]=function(_0x2ab485,_0x2c68ec,_0x52792d){var _0x6fcf5d={'agent':{},'channel':_0xaee4('0x62')};if(_0x2ab485['body']['id']){delete _0x2ab485[_0xaee4('0x5e')]['id'];}_0x2ab485['body'][_0xaee4('0x63')]=!![];_0x2ab485[_0xaee4('0x5e')]['readAt']=moment()[_0xaee4('0x64')](_0xaee4('0x65'));_0x2ab485[_0xaee4('0x5e')][_0xaee4('0x66')]=_0x2ab485[_0xaee4('0x5e')]['UserId']||_0x2ab485[_0xaee4('0x67')]['id'];_0x6fcf5d['agent']['id']=_0x2ab485[_0xaee4('0x5e')]['UserId'];return db[_0xaee4('0x56')]['find']({'where':{'id':_0x2ab485[_0xaee4('0x5f')]['id'],'UserId':null}})[_0xaee4('0x26')](handleEntityNotFound(_0x2c68ec,null))[_0xaee4('0x26')](saveUpdates(_0x2ab485[_0xaee4('0x5e')],null))[_0xaee4('0x26')](function(_0x12364e){if(_0x12364e){_0x6fcf5d[_0xaee4('0x2f')]=_0x12364e['get']({'plain':!![]});return db['FaxInteraction'][_0xaee4('0x5c')]({'where':{'id':_0x12364e[_0xaee4('0x68')]}});}return null;})['then'](handleEntityNotFound(_0x2c68ec,null))[_0xaee4('0x26')](function(_0x5be228){if(_0x5be228){return _0x5be228[_0xaee4('0x5d')]({'UserId':_0x2ab485['body']['UserId'],'read1stAt':_[_0xaee4('0x69')](_0x5be228['read1stAt'])?moment()[_0xaee4('0x64')](_0xaee4('0x65')):undefined});}return null;})['then'](function(_0x23edc7){if(_0x23edc7){_0x6fcf5d[_0xaee4('0x6a')]=_0x23edc7[_0xaee4('0x6b')]({'plain':!![]});interaction_log['info'](_0xaee4('0x6c'),_0x2ab485[_0xaee4('0x67')]['id'],_0x2ab485[_0xaee4('0x67')]['name'],_0x2ab485[_0xaee4('0x67')][_0xaee4('0x6d')],_0x6fcf5d['interaction']['id'],_0x2ab485[_0xaee4('0x5e')]?JSON[_0xaee4('0x2c')](_0x2ab485[_0xaee4('0x5e')]):_0xaee4('0x6e'));return respondWithRpcPromise(_0xaee4('0x6f'),'acceptMessage',_0x6fcf5d);}return null;})[_0xaee4('0x26')](function(_0x373ec8){var _0x478671=_0xaee4('0x70')+_0x373ec8[_0xaee4('0x2f')][_0xaee4('0x71')];return db[_0xaee4('0x72')][_0xaee4('0x48')](_0x478671,{'type':db['Sequelize'][_0xaee4('0x73')][_0xaee4('0x74')],'raw':!![]})[_0xaee4('0x26')](function(_0x3a866e){return _0x3a866e;});})['then'](function(_0x29bc85){if(_0x29bc85){_0x6fcf5d[_0xaee4('0x2f')][_0xaee4('0x75')]=_0x29bc85[0x0];if(!_0x2ab485[_0xaee4('0x5e')]['UserId'])return;return db[_0xaee4('0x76')][_0xaee4('0x5c')]({'where':{'id':_0x2ab485[_0xaee4('0x5e')][_0xaee4('0x66')],'role':_0xaee4('0x77')},'attributes':['id',_0xaee4('0x3d'),_0xaee4('0x78'),_0xaee4('0x79'),_0xaee4('0x7a')],'raw':!![]});}return null;})[_0xaee4('0x26')](function(_0x412c2e){if(!_0x412c2e)return null;_0x6fcf5d[_0xaee4('0x2f')]['agent']=_0x412c2e;return _0x6fcf5d;})[_0xaee4('0x26')](function(_0x22b123){if(_0x22b123){if(_0x2ab485[_0xaee4('0x5e')][_0xaee4('0x7b')]){_0x6fcf5d[_0xaee4('0x2f')][_0xaee4('0x7c')]=util[_0xaee4('0x64')](_0xaee4('0x7d'),_0x2ab485['user'][_0xaee4('0x3d')]);_0x6fcf5d[_0xaee4('0x2f')]['channel']=_0x6fcf5d[_0xaee4('0x7e')];_0x6fcf5d[_0xaee4('0x2f')][_0xaee4('0x7f')]=_0x6fcf5d['channel'];_0x6fcf5d[_0xaee4('0x2f')][_0xaee4('0x80')]=_0xaee4('0x61');return respondWithRpcPromise(_0xaee4('0x81'),'EventManager',{'event':_0xaee4('0x82'),'message':_0x6fcf5d[_0xaee4('0x2f')]},client9002)[_0xaee4('0x26')](function(){return _0x6fcf5d;});}return _0x6fcf5d;}return null;})[_0xaee4('0x26')](respondWithResult(_0x2c68ec,null))[_0xaee4('0x31')](handleError(_0x2c68ec,null));};var interaction_log=require(_0xaee4('0x17'))(_0xaee4('0x83'));exports[_0xaee4('0x3a')]=function(_0x40ff44,_0x5edcee,_0x4d8ab9){var _0x51d48b={'agent':{},'channel':_0xaee4('0x62')};if(_0x40ff44[_0xaee4('0x5e')]['id']){delete _0x40ff44[_0xaee4('0x5e')]['id'];}_0x40ff44[_0xaee4('0x5e')][_0xaee4('0x66')]=_0x40ff44[_0xaee4('0x5e')][_0xaee4('0x66')]||_0x40ff44[_0xaee4('0x67')]['id'];_0x51d48b[_0xaee4('0x77')]['id']=_0x40ff44[_0xaee4('0x5e')][_0xaee4('0x66')];return db[_0xaee4('0x56')][_0xaee4('0x5c')]({'where':{'id':_0x40ff44[_0xaee4('0x5f')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x5edcee,null))['then'](function(_0x30f115){if(_0x30f115){_0x51d48b['message']=_0x30f115['get']({'plain':!![]});return db['FaxInteraction'][_0xaee4('0x5c')]({'where':{'id':_0x30f115['FaxInteractionId']}});}return null;})[_0xaee4('0x26')](handleEntityNotFound(_0x5edcee,null))[_0xaee4('0x26')](function(_0x24ed75){if(_0x24ed75){_0x51d48b[_0xaee4('0x6a')]=_0x24ed75[_0xaee4('0x6b')]({'plain':!![]});interaction_log[_0xaee4('0x27')](_0xaee4('0x84'),_0x40ff44[_0xaee4('0x67')]['id'],_0x40ff44[_0xaee4('0x67')][_0xaee4('0x3d')],_0x40ff44[_0xaee4('0x67')]['role'],_0x51d48b[_0xaee4('0x6a')]['id'],_0x40ff44[_0xaee4('0x5e')]?JSON[_0xaee4('0x2c')](_0x40ff44[_0xaee4('0x5e')]):_0xaee4('0x6e'));return respondWithRpcPromise(_0xaee4('0x85'),'rejectMessage',_0x51d48b);}return null;})[_0xaee4('0x26')](function(_0x1a568d){var _0x58201c=_0xaee4('0x70')+_0x1a568d[_0xaee4('0x2f')]['ContactId'];return db[_0xaee4('0x72')][_0xaee4('0x48')](_0x58201c,{'type':db[_0xaee4('0x86')][_0xaee4('0x73')][_0xaee4('0x74')],'raw':!![]})[_0xaee4('0x26')](function(_0x5d03a9){return _0x5d03a9;});})[_0xaee4('0x26')](function(_0x275d08){if(_0x275d08){_0x51d48b[_0xaee4('0x2f')]['contact']=_0x275d08[0x0];if(!_0x40ff44[_0xaee4('0x5e')][_0xaee4('0x66')])return;return db[_0xaee4('0x76')][_0xaee4('0x5c')]({'where':{'id':_0x40ff44[_0xaee4('0x5e')][_0xaee4('0x66')],'role':'agent'},'attributes':['id',_0xaee4('0x3d'),_0xaee4('0x78'),'email',_0xaee4('0x7a')],'raw':!![]});}return null;})[_0xaee4('0x26')](function(_0x48ed9c){if(!_0x48ed9c)return null;_0x51d48b[_0xaee4('0x2f')]['agent']=_0x48ed9c;return _0x51d48b;})['then'](function(_0x3d3706){if(_0x3d3706){_0x3d3706[_0xaee4('0x2f')][_0xaee4('0x7c')]=util[_0xaee4('0x64')](_0xaee4('0x7d'),_0x40ff44[_0xaee4('0x67')][_0xaee4('0x3d')]);_0x3d3706[_0xaee4('0x2f')]['channel']=_0x51d48b[_0xaee4('0x7e')];_0x3d3706[_0xaee4('0x2f')][_0xaee4('0x7f')]=_0x51d48b[_0xaee4('0x7e')];_0x3d3706[_0xaee4('0x2f')][_0xaee4('0x80')]=_0xaee4('0x3a');respondWithRpcPromise(_0xaee4('0x81'),_0xaee4('0x81'),{'event':_0xaee4('0x87'),'message':_0x3d3706[_0xaee4('0x2f')]},client9002);return _0x51d48b;}return null;})[_0xaee4('0x26')](respondWithResult(_0x5edcee,null))[_0xaee4('0x31')](handleError(_0x5edcee,null));};exports['create']=function(_0x80fd45,_0xedfc77){var _0x22f3b6;return db[_0xaee4('0x56')]['create'](_0x80fd45['body'],{})[_0xaee4('0x26')](function(_0x3d2716){_0x22f3b6=_0x3d2716;return db[_0xaee4('0x88')][_0xaee4('0x89')]({'where':{'id':_0x22f3b6[_0xaee4('0x71')]}});})[_0xaee4('0x26')](function(_0x2a8ca2){if(_[_0xaee4('0x69')](_0x2a8ca2)){return;}else{_0x22f3b6['fax']=_0x2a8ca2[_0xaee4('0x62')];return db[_0xaee4('0x8a')][_0xaee4('0x89')]({'where':{'id':_0x22f3b6[_0xaee4('0x8b')]}});}})[_0xaee4('0x26')](function(_0x5d40dd){return respondWithRpcPromise('SendFax',_0xaee4('0x8c'),{'FaxAccountId':_[_0xaee4('0x69')](_0x80fd45[_0xaee4('0x5e')])?undefined:_0x80fd45['body'][_0xaee4('0x8d')],'path':_[_0xaee4('0x69')](_0x5d40dd)?undefined:util[_0xaee4('0x64')]('/var/opt/motion2/server/files/attachments/%s',_0x5d40dd[_0xaee4('0x8e')]),'fax':_['isNil'](_0x22f3b6[_0xaee4('0x62')])?undefined:_0x22f3b6['fax'],'AttachmentId':_0x22f3b6[_0xaee4('0x8b')]},client9002);})[_0xaee4('0x26')](respondWithResult(_0xedfc77,0xc9))[_0xaee4('0x31')](handleError(_0xedfc77,null));};exports['download']=function(_0x454d78,_0x32af8b){var _0xee43ab=path[_0xaee4('0x8f')](config[_0xaee4('0x90')],'server',_0xaee4('0x91'),_0xaee4('0x92'));return db[_0xaee4('0x56')][_0xaee4('0x5c')]({'where':{'id':_0x454d78[_0xaee4('0x5f')]['id']},'include':[{'model':db[_0xaee4('0x8a')],'as':_0xaee4('0x8a')}]})[_0xaee4('0x26')](handleEntityNotFound(_0x32af8b,null))[_0xaee4('0x26')](function(_0xf60335){if(_0xf60335){return _0x32af8b[_0xaee4('0x93')](path[_0xaee4('0x8f')](_0xee43ab,_0xf60335[_0xaee4('0x8a')][_0xaee4('0x8e')]));}})[_0xaee4('0x31')](handleError(_0x32af8b,null));};
\ No newline at end of file
+var _0x5cee=['hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','update','body','find','params','describe','fax-interactions','accept','fax','read','readAt','format','UserId','user','agent','FaxInteraction','FaxInteractionId','YYYY-MM-DD\x20HH:mm:ss','interaction','get','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','contact','User','fullname','email','internal','manual','interface','channel','motionChannel','EventManager','acceptmessage','RejectMessage','rejectMessage','SELECT','SIP/%s','reject','rejectmessage','create','CmContact','findOne','isNil','Attachment','SendFax','/var/opt/motion2/server/files/attachments/%s','basename','AttachmentId','download','join','root','files','attachments','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','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','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./faxMessage.socket','register','client','http','request','info','FaxMessage,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','sendStatus','status','end','json','limit','undefined','count','offset','set','apply','save','then','stack','name','send','index','map','FaxMessage','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length'];(function(_0x5b2d3b,_0x1040cb){var _0x1cf324=function(_0x232689){while(--_0x232689){_0x5b2d3b['push'](_0x5b2d3b['shift']());}};_0x1cf324(++_0x1040cb);}(_0x5cee,0xdc));var _0xe5ce=function(_0x616290,_0x280b7f){_0x616290=_0x616290-0x0;var _0x453879=_0x5cee[_0x616290];return _0x453879;};'use strict';var emlformat=require(_0xe5ce('0x0'));var rimraf=require(_0xe5ce('0x1'));var zipdir=require(_0xe5ce('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xe5ce('0x3'));var BPromise=require(_0xe5ce('0x4'));var Mustache=require(_0xe5ce('0x5'));var util=require(_0xe5ce('0x6'));var path=require(_0xe5ce('0x7'));var sox=require(_0xe5ce('0x8'));var csv=require(_0xe5ce('0x9'));var ejs=require(_0xe5ce('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe5ce('0xb'));var squel=require(_0xe5ce('0xc'));var crypto=require(_0xe5ce('0xd'));var jsforce=require(_0xe5ce('0xe'));var deskjs=require(_0xe5ce('0xf'));var toCsv=require(_0xe5ce('0x9'));var querystring=require(_0xe5ce('0x10'));var Papa=require(_0xe5ce('0x11'));var Redis=require(_0xe5ce('0x12'));var authService=require(_0xe5ce('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xe5ce('0x14'));var hardwareService=require(_0xe5ce('0x15'));var logger=require(_0xe5ce('0x16'))(_0xe5ce('0x17'));var utils=require(_0xe5ce('0x18'));var config=require(_0xe5ce('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xe5ce('0x1a'))['db'];config['redis']=_[_0xe5ce('0x1b')](config['redis'],{'host':_0xe5ce('0x1c'),'port':0x18eb});var socket=require(_0xe5ce('0x1d'))(new Redis(config[_0xe5ce('0x1e')]));require(_0xe5ce('0x1f'))[_0xe5ce('0x20')](socket);var jayson=require('jayson/promise');var client=jayson[_0xe5ce('0x21')]['http']({'port':0x232c});var client9002=jayson[_0xe5ce('0x21')][_0xe5ce('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x32c2b9,_0x170753,_0x331e2f,_0x112560){return new BPromise(function(_0x415655,_0x5d9038){var _0x5d114d=_0x112560||client;return _0x5d114d[_0xe5ce('0x23')](_0x32c2b9,_0x331e2f)['then'](function(_0x3edeae){logger[_0xe5ce('0x24')](_0xe5ce('0x25'),_0x170753,_0xe5ce('0x26'));logger['debug']('FaxMessage,\x20%s,\x20%s,\x20%s',_0x170753,'request\x20sent',JSON[_0xe5ce('0x27')](_0x3edeae));if(_0x3edeae[_0xe5ce('0x28')]){if(_0x3edeae[_0xe5ce('0x28')]['code']===0x1f4){logger[_0xe5ce('0x28')](_0xe5ce('0x25'),_0x170753,_0x3edeae[_0xe5ce('0x28')][_0xe5ce('0x29')]);return _0x5d9038(_0x3edeae[_0xe5ce('0x28')][_0xe5ce('0x29')]);}logger['error'](_0xe5ce('0x25'),_0x170753,_0x3edeae[_0xe5ce('0x28')]['message']);return _0x415655(_0x3edeae['error']['message']);}else{logger[_0xe5ce('0x24')](_0xe5ce('0x25'),_0x170753,'request\x20sent');_0x415655(_0x3edeae['result'][_0xe5ce('0x29')]);}})[_0xe5ce('0x2a')](function(_0x5cf5a4){logger['error'](_0xe5ce('0x25'),_0x170753,_0x5cf5a4);_0x5d9038(_0x5cf5a4);});});}function respondWithStatusCode(_0x2b8f3c,_0x1ff0a5){_0x1ff0a5=_0x1ff0a5||0xcc;return function(_0x387b9d){if(_0x387b9d){return _0x2b8f3c[_0xe5ce('0x2b')](_0x1ff0a5);}return _0x2b8f3c[_0xe5ce('0x2c')](_0x1ff0a5)[_0xe5ce('0x2d')]();};}function respondWithResult(_0x47601b,_0x49f013){_0x49f013=_0x49f013||0xc8;return function(_0x342ce0){if(_0x342ce0){return _0x47601b[_0xe5ce('0x2c')](_0x49f013)[_0xe5ce('0x2e')](_0x342ce0);}};}function respondWithFilteredResult(_0x28b83f,_0x58b093){return function(_0x129396){if(_0x129396){var _0x53b599=typeof _0x58b093['offset']==='undefined'&&typeof _0x58b093[_0xe5ce('0x2f')]===_0xe5ce('0x30');var _0x2371e6=_0x129396[_0xe5ce('0x31')];var _0x5c3412=_0x53b599?0x0:_0x58b093['offset'];var _0x14b22c=_0x53b599?_0x129396[_0xe5ce('0x31')]:_0x58b093[_0xe5ce('0x32')]+_0x58b093[_0xe5ce('0x2f')];var _0x503c5a;if(_0x14b22c>=_0x2371e6){_0x14b22c=_0x2371e6;_0x503c5a=0xc8;}else{_0x503c5a=0xce;}_0x28b83f[_0xe5ce('0x2c')](_0x503c5a);return _0x28b83f[_0xe5ce('0x33')]('Content-Range',_0x5c3412+'-'+_0x14b22c+'/'+_0x2371e6)[_0xe5ce('0x2e')](_0x129396);}return null;};}function patchUpdates(_0x34c3f4){return function(_0xe0a7de){try{jsonpatch[_0xe5ce('0x34')](_0xe0a7de,_0x34c3f4,!![]);}catch(_0x2e8d71){return BPromise['reject'](_0x2e8d71);}return _0xe0a7de[_0xe5ce('0x35')]();};}function saveUpdates(_0x21dc18,_0x2df0d0){return function(_0x25e6f7){if(_0x25e6f7){return _0x25e6f7['update'](_0x21dc18)[_0xe5ce('0x36')](function(_0x44859e){return _0x44859e;});}return null;};}function removeEntity(_0x2b9180,_0x8f693c){return function(_0x12c220){if(_0x12c220){return _0x12c220['destroy']()[_0xe5ce('0x36')](function(){_0x2b9180[_0xe5ce('0x2c')](0xcc)[_0xe5ce('0x2d')]();});}};}function handleEntityNotFound(_0x109bba,_0x52bf8c){return function(_0x3e85b3){if(!_0x3e85b3){_0x109bba[_0xe5ce('0x2b')](0x194);}return _0x3e85b3;};}function handleError(_0x4efe47,_0x430726){_0x430726=_0x430726||0x1f4;return function(_0x587971){logger[_0xe5ce('0x28')](_0x587971[_0xe5ce('0x37')]);if(_0x587971[_0xe5ce('0x38')]){delete _0x587971[_0xe5ce('0x38')];}_0x4efe47['status'](_0x430726)[_0xe5ce('0x39')](_0x587971);};}exports[_0xe5ce('0x3a')]=function(_0x2c1a1e,_0x2e69b0){var _0x5ebb95={},_0x52e4e7={},_0x2ff9a0={'count':0x0,'rows':[]};var _0x18cdc4=_[_0xe5ce('0x3b')](db[_0xe5ce('0x3c')][_0xe5ce('0x3d')],function(_0x4863c1){return{'name':_0x4863c1[_0xe5ce('0x3e')],'type':_0x4863c1[_0xe5ce('0x3f')][_0xe5ce('0x40')]};});_0x52e4e7[_0xe5ce('0x41')]=_[_0xe5ce('0x3b')](_0x18cdc4,_0xe5ce('0x38'));_0x52e4e7[_0xe5ce('0x42')]=_[_0xe5ce('0x43')](_0x2c1a1e[_0xe5ce('0x42')]);_0x52e4e7['filters']=_[_0xe5ce('0x44')](_0x52e4e7[_0xe5ce('0x41')],_0x52e4e7['query']);_0x5ebb95['attributes']=_[_0xe5ce('0x44')](_0x52e4e7['model'],qs[_0xe5ce('0x45')](_0x2c1a1e[_0xe5ce('0x42')]['fields']));_0x5ebb95[_0xe5ce('0x46')]=_0x5ebb95[_0xe5ce('0x46')][_0xe5ce('0x47')]?_0x5ebb95['attributes']:_0x52e4e7[_0xe5ce('0x41')];if(!_0x2c1a1e['query'][_0xe5ce('0x48')]('nolimit')){_0x5ebb95[_0xe5ce('0x2f')]=qs[_0xe5ce('0x2f')](_0x2c1a1e[_0xe5ce('0x42')]['limit']);_0x5ebb95[_0xe5ce('0x32')]=qs[_0xe5ce('0x32')](_0x2c1a1e[_0xe5ce('0x42')]['offset']);}_0x5ebb95[_0xe5ce('0x49')]=qs['sort'](_0x2c1a1e[_0xe5ce('0x42')][_0xe5ce('0x4a')]);_0x5ebb95[_0xe5ce('0x4b')]=qs[_0xe5ce('0x4c')](_[_0xe5ce('0x4d')](_0x2c1a1e[_0xe5ce('0x42')],_0x52e4e7[_0xe5ce('0x4c')]),_0x18cdc4);if(_0x2c1a1e['query'][_0xe5ce('0x4e')]){_0x5ebb95[_0xe5ce('0x4b')]=_[_0xe5ce('0x4f')](_0x5ebb95['where'],{'$or':_[_0xe5ce('0x3b')](_0x18cdc4,function(_0x2cf2af){if(_0x2cf2af[_0xe5ce('0x3f')]!==_0xe5ce('0x50')){var _0xcad177={};_0xcad177[_0x2cf2af[_0xe5ce('0x38')]]={'$like':'%'+_0x2c1a1e['query'][_0xe5ce('0x4e')]+'%'};return _0xcad177;}})});}_0x5ebb95=_[_0xe5ce('0x4f')]({},_0x5ebb95,_0x2c1a1e[_0xe5ce('0x51')]);var _0x4c141c={'where':_0x5ebb95['where']};return db['FaxMessage']['count'](_0x4c141c)[_0xe5ce('0x36')](function(_0x20a9a9){_0x2ff9a0[_0xe5ce('0x31')]=_0x20a9a9;if(_0x2c1a1e['query'][_0xe5ce('0x52')]){_0x5ebb95[_0xe5ce('0x53')]=[{'all':!![]}];}return db[_0xe5ce('0x3c')][_0xe5ce('0x54')](_0x5ebb95);})[_0xe5ce('0x36')](function(_0x30df7e){_0x2ff9a0['rows']=_0x30df7e;return _0x2ff9a0;})[_0xe5ce('0x36')](respondWithFilteredResult(_0x2e69b0,_0x5ebb95))[_0xe5ce('0x2a')](handleError(_0x2e69b0,null));};exports[_0xe5ce('0x55')]=function(_0x4b45ca,_0x1b23c8){var _0x41ef03={'raw':!![],'where':{'id':_0x4b45ca['params']['id']}},_0x5e8206={};_0x5e8206[_0xe5ce('0x41')]=_[_0xe5ce('0x43')](db['FaxMessage']['rawAttributes']);_0x5e8206[_0xe5ce('0x42')]=_[_0xe5ce('0x43')](_0x4b45ca[_0xe5ce('0x42')]);_0x5e8206[_0xe5ce('0x4c')]=_[_0xe5ce('0x44')](_0x5e8206[_0xe5ce('0x41')],_0x5e8206['query']);_0x41ef03[_0xe5ce('0x46')]=_[_0xe5ce('0x44')](_0x5e8206['model'],qs[_0xe5ce('0x45')](_0x4b45ca[_0xe5ce('0x42')][_0xe5ce('0x45')]));_0x41ef03[_0xe5ce('0x46')]=_0x41ef03['attributes']['length']?_0x41ef03['attributes']:_0x5e8206[_0xe5ce('0x41')];if(_0x4b45ca['query']['includeAll']){_0x41ef03[_0xe5ce('0x53')]=[{'all':!![]}];}_0x41ef03=_[_0xe5ce('0x4f')]({},_0x41ef03,_0x4b45ca[_0xe5ce('0x51')]);return db[_0xe5ce('0x3c')]['find'](_0x41ef03)[_0xe5ce('0x36')](handleEntityNotFound(_0x1b23c8,null))[_0xe5ce('0x36')](respondWithResult(_0x1b23c8,null))[_0xe5ce('0x2a')](handleError(_0x1b23c8,null));};exports[_0xe5ce('0x56')]=function(_0x1f29d9,_0x53e62e){if(_0x1f29d9[_0xe5ce('0x57')]['id']){delete _0x1f29d9[_0xe5ce('0x57')]['id'];}return db[_0xe5ce('0x3c')][_0xe5ce('0x58')]({'where':{'id':_0x1f29d9[_0xe5ce('0x59')]['id']}})[_0xe5ce('0x36')](handleEntityNotFound(_0x53e62e,null))[_0xe5ce('0x36')](saveUpdates(_0x1f29d9['body'],null))[_0xe5ce('0x36')](respondWithResult(_0x53e62e,null))[_0xe5ce('0x2a')](handleError(_0x53e62e,null));};exports['destroy']=function(_0x58a846,_0x513099){return db['FaxMessage'][_0xe5ce('0x58')]({'where':{'id':_0x58a846['params']['id']}})['then'](handleEntityNotFound(_0x513099,null))['then'](removeEntity(_0x513099,null))[_0xe5ce('0x2a')](handleError(_0x513099,null));};exports[_0xe5ce('0x5a')]=function(_0x4b2975,_0x1817cc){return db[_0xe5ce('0x3c')][_0xe5ce('0x5a')]()[_0xe5ce('0x36')](respondWithResult(_0x1817cc,null))[_0xe5ce('0x2a')](handleError(_0x1817cc,null));};var interaction_log=require(_0xe5ce('0x16'))(_0xe5ce('0x5b'));exports[_0xe5ce('0x5c')]=function(_0x350c65,_0x52f85e,_0x32863b){var _0x144def={'agent':{},'channel':_0xe5ce('0x5d')};if(_0x350c65['body']['id']){delete _0x350c65[_0xe5ce('0x57')]['id'];}_0x350c65[_0xe5ce('0x57')][_0xe5ce('0x5e')]=!![];_0x350c65['body'][_0xe5ce('0x5f')]=moment()[_0xe5ce('0x60')]('YYYY-MM-DD\x20HH:mm:ss');_0x350c65[_0xe5ce('0x57')][_0xe5ce('0x61')]=_0x350c65[_0xe5ce('0x57')]['UserId']||_0x350c65[_0xe5ce('0x62')]['id'];_0x144def[_0xe5ce('0x63')]['id']=_0x350c65[_0xe5ce('0x57')][_0xe5ce('0x61')];return db['FaxMessage']['find']({'where':{'id':_0x350c65[_0xe5ce('0x59')]['id'],'UserId':null}})[_0xe5ce('0x36')](handleEntityNotFound(_0x52f85e,null))[_0xe5ce('0x36')](saveUpdates(_0x350c65[_0xe5ce('0x57')],null))[_0xe5ce('0x36')](function(_0x48dc45){if(_0x48dc45){_0x144def['message']=_0x48dc45['get']({'plain':!![]});return db[_0xe5ce('0x64')]['find']({'where':{'id':_0x48dc45[_0xe5ce('0x65')]}});}return null;})['then'](handleEntityNotFound(_0x52f85e,null))[_0xe5ce('0x36')](function(_0x1e1579){if(_0x1e1579){return _0x1e1579['update']({'UserId':_0x350c65[_0xe5ce('0x57')][_0xe5ce('0x61')],'read1stAt':_['isNil'](_0x1e1579['read1stAt'])?moment()['format'](_0xe5ce('0x66')):undefined});}return null;})['then'](function(_0x36db30){if(_0x36db30){_0x144def[_0xe5ce('0x67')]=_0x36db30[_0xe5ce('0x68')]({'plain':!![]});interaction_log['info'](_0xe5ce('0x69'),_0x350c65['user']['id'],_0x350c65['user'][_0xe5ce('0x38')],_0x350c65[_0xe5ce('0x62')][_0xe5ce('0x6a')],_0x144def[_0xe5ce('0x67')]['id'],_0x350c65[_0xe5ce('0x57')]?JSON[_0xe5ce('0x27')](_0x350c65['body']):_0xe5ce('0x6b'));return respondWithRpcPromise(_0xe5ce('0x6c'),_0xe5ce('0x6d'),_0x144def);}return null;})['then'](function(_0x1e742e){var _0x1b1b8e=_0xe5ce('0x6e')+_0x1e742e[_0xe5ce('0x29')][_0xe5ce('0x6f')];return db[_0xe5ce('0x70')][_0xe5ce('0x42')](_0x1b1b8e,{'type':db[_0xe5ce('0x71')][_0xe5ce('0x72')]['SELECT'],'raw':!![]})[_0xe5ce('0x36')](function(_0x2d7ce8){return _0x2d7ce8;});})[_0xe5ce('0x36')](function(_0x47a058){if(_0x47a058){_0x144def[_0xe5ce('0x29')][_0xe5ce('0x73')]=_0x47a058[0x0];if(!_0x350c65[_0xe5ce('0x57')]['UserId'])return;return db[_0xe5ce('0x74')][_0xe5ce('0x58')]({'where':{'id':_0x350c65[_0xe5ce('0x57')][_0xe5ce('0x61')],'role':'agent'},'attributes':['id',_0xe5ce('0x38'),_0xe5ce('0x75'),_0xe5ce('0x76'),_0xe5ce('0x77')],'raw':!![]});}return null;})[_0xe5ce('0x36')](function(_0xe74c8a){if(!_0xe74c8a)return null;_0x144def['message']['agent']=_0xe74c8a;return _0x144def;})[_0xe5ce('0x36')](function(_0x3548a1){if(_0x3548a1){if(_0x350c65[_0xe5ce('0x57')][_0xe5ce('0x78')]){_0x144def[_0xe5ce('0x29')][_0xe5ce('0x79')]=util[_0xe5ce('0x60')]('SIP/%s',_0x350c65[_0xe5ce('0x62')]['name']);_0x144def[_0xe5ce('0x29')][_0xe5ce('0x7a')]=_0x144def[_0xe5ce('0x7a')];_0x144def[_0xe5ce('0x29')][_0xe5ce('0x7b')]=_0x144def[_0xe5ce('0x7a')];_0x144def[_0xe5ce('0x29')]['event']=_0xe5ce('0x5c');return respondWithRpcPromise(_0xe5ce('0x7c'),_0xe5ce('0x7c'),{'event':_0xe5ce('0x7d'),'message':_0x144def[_0xe5ce('0x29')]},client9002)[_0xe5ce('0x36')](function(){return _0x144def;});}return _0x144def;}return null;})[_0xe5ce('0x36')](respondWithResult(_0x52f85e,null))[_0xe5ce('0x2a')](handleError(_0x52f85e,null));};var interaction_log=require(_0xe5ce('0x16'))(_0xe5ce('0x5b'));exports['reject']=function(_0x281d94,_0x24280a,_0xbdb420){var _0x40da15={'agent':{},'channel':_0xe5ce('0x5d')};if(_0x281d94[_0xe5ce('0x57')]['id']){delete _0x281d94[_0xe5ce('0x57')]['id'];}_0x281d94['body'][_0xe5ce('0x61')]=_0x281d94[_0xe5ce('0x57')][_0xe5ce('0x61')]||_0x281d94[_0xe5ce('0x62')]['id'];_0x40da15[_0xe5ce('0x63')]['id']=_0x281d94[_0xe5ce('0x57')]['UserId'];return db['FaxMessage'][_0xe5ce('0x58')]({'where':{'id':_0x281d94[_0xe5ce('0x59')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x24280a,null))['then'](function(_0x49d89e){if(_0x49d89e){_0x40da15[_0xe5ce('0x29')]=_0x49d89e['get']({'plain':!![]});return db[_0xe5ce('0x64')][_0xe5ce('0x58')]({'where':{'id':_0x49d89e[_0xe5ce('0x65')]}});}return null;})[_0xe5ce('0x36')](handleEntityNotFound(_0x24280a,null))[_0xe5ce('0x36')](function(_0x3cb12f){if(_0x3cb12f){_0x40da15['interaction']=_0x3cb12f['get']({'plain':!![]});interaction_log[_0xe5ce('0x24')]('[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x281d94['user']['id'],_0x281d94[_0xe5ce('0x62')][_0xe5ce('0x38')],_0x281d94['user'][_0xe5ce('0x6a')],_0x40da15[_0xe5ce('0x67')]['id'],_0x281d94['body']?JSON[_0xe5ce('0x27')](_0x281d94['body']):_0xe5ce('0x6b'));return respondWithRpcPromise(_0xe5ce('0x7e'),_0xe5ce('0x7f'),_0x40da15);}return null;})[_0xe5ce('0x36')](function(_0x53d4aa){var _0x481240='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x53d4aa[_0xe5ce('0x29')][_0xe5ce('0x6f')];return db[_0xe5ce('0x70')][_0xe5ce('0x42')](_0x481240,{'type':db[_0xe5ce('0x71')]['QueryTypes'][_0xe5ce('0x80')],'raw':!![]})[_0xe5ce('0x36')](function(_0x39c582){return _0x39c582;});})[_0xe5ce('0x36')](function(_0x4c540c){if(_0x4c540c){_0x40da15[_0xe5ce('0x29')][_0xe5ce('0x73')]=_0x4c540c[0x0];if(!_0x281d94['body'][_0xe5ce('0x61')])return;return db[_0xe5ce('0x74')]['find']({'where':{'id':_0x281d94[_0xe5ce('0x57')][_0xe5ce('0x61')],'role':_0xe5ce('0x63')},'attributes':['id',_0xe5ce('0x38'),_0xe5ce('0x75'),_0xe5ce('0x76'),_0xe5ce('0x77')],'raw':!![]});}return null;})[_0xe5ce('0x36')](function(_0x50b669){if(!_0x50b669)return null;_0x40da15[_0xe5ce('0x29')]['agent']=_0x50b669;return _0x40da15;})[_0xe5ce('0x36')](function(_0x2f9eaf){if(_0x2f9eaf){_0x2f9eaf[_0xe5ce('0x29')][_0xe5ce('0x79')]=util[_0xe5ce('0x60')](_0xe5ce('0x81'),_0x281d94[_0xe5ce('0x62')][_0xe5ce('0x38')]);_0x2f9eaf[_0xe5ce('0x29')][_0xe5ce('0x7a')]=_0x40da15['channel'];_0x2f9eaf[_0xe5ce('0x29')]['motionChannel']=_0x40da15['channel'];_0x2f9eaf['message']['event']=_0xe5ce('0x82');respondWithRpcPromise('EventManager',_0xe5ce('0x7c'),{'event':_0xe5ce('0x83'),'message':_0x2f9eaf['message']},client9002);return _0x40da15;}return null;})[_0xe5ce('0x36')](respondWithResult(_0x24280a,null))['catch'](handleError(_0x24280a,null));};exports[_0xe5ce('0x84')]=function(_0x483435,_0x568432){var _0x28d611;return db['FaxMessage'][_0xe5ce('0x84')](_0x483435[_0xe5ce('0x57')],{})[_0xe5ce('0x36')](function(_0x138c01){_0x28d611=_0x138c01;return db[_0xe5ce('0x85')][_0xe5ce('0x86')]({'where':{'id':_0x28d611[_0xe5ce('0x6f')]}});})[_0xe5ce('0x36')](function(_0x43b893){if(_[_0xe5ce('0x87')](_0x43b893)){return;}else{_0x28d611['fax']=_0x43b893[_0xe5ce('0x5d')];return db[_0xe5ce('0x88')][_0xe5ce('0x86')]({'where':{'id':_0x28d611['AttachmentId']}});}})[_0xe5ce('0x36')](function(_0x1e6d2c){return respondWithRpcPromise(_0xe5ce('0x89'),_0xe5ce('0x89'),{'FaxAccountId':_[_0xe5ce('0x87')](_0x483435['body'])?undefined:_0x483435[_0xe5ce('0x57')]['FaxAccountId'],'path':_[_0xe5ce('0x87')](_0x1e6d2c)?undefined:util['format'](_0xe5ce('0x8a'),_0x1e6d2c[_0xe5ce('0x8b')]),'fax':_[_0xe5ce('0x87')](_0x28d611[_0xe5ce('0x5d')])?undefined:_0x28d611[_0xe5ce('0x5d')],'AttachmentId':_0x28d611[_0xe5ce('0x8c')]},client9002);})['then'](respondWithResult(_0x568432,0xc9))[_0xe5ce('0x2a')](handleError(_0x568432,null));};exports[_0xe5ce('0x8d')]=function(_0x15e14c,_0xf6e2ac){var _0x5cd474=path[_0xe5ce('0x8e')](config[_0xe5ce('0x8f')],'server',_0xe5ce('0x90'),_0xe5ce('0x91'));return db[_0xe5ce('0x3c')][_0xe5ce('0x58')]({'where':{'id':_0x15e14c[_0xe5ce('0x59')]['id']},'include':[{'model':db[_0xe5ce('0x88')],'as':'Attachment'}]})[_0xe5ce('0x36')](handleEntityNotFound(_0xf6e2ac,null))['then'](function(_0x24e519){if(_0x24e519){return _0xf6e2ac[_0xe5ce('0x8d')](path[_0xe5ce('0x8e')](_0x5cd474,_0x24e519[_0xe5ce('0x88')][_0xe5ce('0x8b')]));}})['catch'](handleError(_0xf6e2ac,null));};
\ No newline at end of file
index 95bf728..5207f36 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf417=['FaxMessage','setMaxListeners','update','hasOwnProperty','exports','../../mysqldb'];(function(_0x4154a6,_0x2c0b8e){var _0x3b2786=function(_0x2f5936){while(--_0x2f5936){_0x4154a6['push'](_0x4154a6['shift']());}};_0x3b2786(++_0x2c0b8e);}(_0xf417,0x8f));var _0x7f41=function(_0x2a573d,_0x284675){_0x2a573d=_0x2a573d-0x0;var _0x370c3f=_0xf417[_0x2a573d];return _0x370c3f;};'use strict';var EventEmitter=require('events');var FaxMessage=require(_0x7f41('0x0'))['db'][_0x7f41('0x1')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x7f41('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7f41('0x3'),'afterDestroy':'remove'};function emitEvent(_0x4c7081){return function(_0x2b7d4c,_0x5170ec,_0x51b0cb){FaxMessageEvents['emit'](_0x4c7081+':'+_0x2b7d4c['id'],_0x2b7d4c);FaxMessageEvents['emit'](_0x4c7081,_0x2b7d4c);_0x51b0cb(null);};}for(var e in events){if(events[_0x7f41('0x4')](e)){var event=events[e];FaxMessage['hook'](e,emitEvent(event));}}module[_0x7f41('0x5')]=FaxMessageEvents;
\ No newline at end of file
+var _0x2f4a=['events','../../mysqldb','FaxMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x187718,_0x427383){var _0x29ddf4=function(_0x2ec62a){while(--_0x2ec62a){_0x187718['push'](_0x187718['shift']());}};_0x29ddf4(++_0x427383);}(_0x2f4a,0x8f));var _0xa2f4=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0x2f4a[_0x24237f];return _0x48298e;};'use strict';var EventEmitter=require(_0xa2f4('0x0'));var FaxMessage=require(_0xa2f4('0x1'))['db'][_0xa2f4('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0xa2f4('0x3')](0x0);var events={'afterCreate':_0xa2f4('0x4'),'afterUpdate':_0xa2f4('0x5'),'afterDestroy':_0xa2f4('0x6')};function emitEvent(_0x17ea32){return function(_0x3ba23a,_0x24aaf4,_0x4b22d6){FaxMessageEvents[_0xa2f4('0x7')](_0x17ea32+':'+_0x3ba23a['id'],_0x3ba23a);FaxMessageEvents[_0xa2f4('0x7')](_0x17ea32,_0x3ba23a);_0x4b22d6(null);};}for(var e in events){if(events[_0xa2f4('0x8')](e)){var event=events[e];FaxMessage[_0xa2f4('0x9')](e,emitEvent(event));}}module[_0xa2f4('0xa')]=FaxMessageEvents;
\ No newline at end of file
index 1050596..c5d23c7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa65b=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./faxMessage.attributes','define','fax_messages','fti_fax_messages','body','FULLTEXT','direction','toLowerCase','out','secret','isNil','FaxInteraction','findOne','FaxInteractionId','update','createdAt','catch','error','utf8mb4_unicode_ci','lodash','util'];(function(_0x42abad,_0x301cd9){var _0x54b1f9=function(_0x547ab8){while(--_0x547ab8){_0x42abad['push'](_0x42abad['shift']());}};_0x54b1f9(++_0x301cd9);}(_0xa65b,0x1c9));var _0xba65=function(_0x15c077,_0x59a326){_0x15c077=_0x15c077-0x0;var _0x32f0d8=_0xa65b[_0x15c077];return _0x32f0d8;};'use strict';var _=require(_0xba65('0x0'));var util=require(_0xba65('0x1'));var logger=require('../../config/logger')(_0xba65('0x2'));var moment=require(_0xba65('0x3'));var BPromise=require(_0xba65('0x4'));var rp=require(_0xba65('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xba65('0x6'));var config=require(_0xba65('0x7'));var attributes=require(_0xba65('0x8'));module['exports']=function(_0x467888,_0xcf6c0c){return _0x467888[_0xba65('0x9')]('FaxMessage',attributes,{'tableName':_0xba65('0xa'),'paranoid':![],'indexes':[{'name':_0xba65('0xb'),'fields':[_0xba65('0xc')],'type':_0xba65('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3f6f8b,_0x274977,_0x1ea358){var _0x1ecd54=_0x467888['models'];var _0x509572=_0x3f6f8b['get']({'plain':!![]});if(_0x509572[_0xba65('0xe')][_0xba65('0xf')]()==='in'||_0x509572[_0xba65('0xe')][_0xba65('0xf')]()===_0xba65('0x10')&&!_0x509572[_0xba65('0x11')]&&!_[_0xba65('0x12')](_0x509572['UserId'])){_0x1ecd54[_0xba65('0x13')][_0xba65('0x14')]({'where':{'id':_0x509572[_0xba65('0x15')]}})['then'](function(_0x2f73d1){if(_0x2f73d1){_0x2f73d1[_0xba65('0x16')]({'lastMsgAt':_0x509572[_0xba65('0x17')],'lastMsgDirection':_0x509572[_0xba65('0xe')][_0xba65('0xf')]()});}})[_0xba65('0x18')](function(_0x480b4f){console[_0xba65('0x19')](_0x480b4f);});}_0x1ea358();}},'charset':'utf8mb4','collate':_0xba65('0x1a')});};
\ No newline at end of file
+var _0x2a43=['body','FULLTEXT','models','get','toLowerCase','out','secret','isNil','FaxInteractionId','then','update','createdAt','direction','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./faxMessage.attributes','define','fax_messages'];(function(_0x2d8fc2,_0x1c461d){var _0x3a9e53=function(_0x18941c){while(--_0x18941c){_0x2d8fc2['push'](_0x2d8fc2['shift']());}};_0x3a9e53(++_0x1c461d);}(_0x2a43,0xcd));var _0x32a4=function(_0x1a7d0d,_0x5d67ce){_0x1a7d0d=_0x1a7d0d-0x0;var _0x6cc93=_0x2a43[_0x1a7d0d];return _0x6cc93;};'use strict';var _=require(_0x32a4('0x0'));var util=require(_0x32a4('0x1'));var logger=require(_0x32a4('0x2'))(_0x32a4('0x3'));var moment=require(_0x32a4('0x4'));var BPromise=require('bluebird');var rp=require(_0x32a4('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x32a4('0x6'));var config=require(_0x32a4('0x7'));var attributes=require(_0x32a4('0x8'));module['exports']=function(_0x5d0a00,_0x5290cd){return _0x5d0a00[_0x32a4('0x9')]('FaxMessage',attributes,{'tableName':_0x32a4('0xa'),'paranoid':![],'indexes':[{'name':'fti_fax_messages','fields':[_0x32a4('0xb')],'type':_0x32a4('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3e37a5,_0x42aa8a,_0xc83518){var _0x1015af=_0x5d0a00[_0x32a4('0xd')];var _0x17ffde=_0x3e37a5[_0x32a4('0xe')]({'plain':!![]});if(_0x17ffde['direction']['toLowerCase']()==='in'||_0x17ffde['direction'][_0x32a4('0xf')]()===_0x32a4('0x10')&&!_0x17ffde[_0x32a4('0x11')]&&!_[_0x32a4('0x12')](_0x17ffde['UserId'])){_0x1015af['FaxInteraction']['findOne']({'where':{'id':_0x17ffde[_0x32a4('0x13')]}})[_0x32a4('0x14')](function(_0x31f179){if(_0x31f179){_0x31f179[_0x32a4('0x15')]({'lastMsgAt':_0x17ffde[_0x32a4('0x16')],'lastMsgDirection':_0x17ffde[_0x32a4('0x17')]['toLowerCase']()});}})['catch'](function(_0x70acfd){console[_0x32a4('0x18')](_0x70acfd);});}_0xc83518();}},'charset':_0x32a4('0x19'),'collate':_0x32a4('0x1a')});};
\ No newline at end of file
index ba5e876..4dd8217 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe14d=['code','message','result','catch','FaxMessage','create','body','options','raw','CreateFaxMessage','UpdateFaxMessage','update','attributes','limit','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./faxMessage.socket','register','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x89a565,_0x2f0443){var _0x5964bd=function(_0x589f3f){while(--_0x589f3f){_0x89a565['push'](_0x89a565['shift']());}};_0x5964bd(++_0x2f0443);}(_0xe14d,0x1ee));var _0xde14=function(_0x543084,_0x4337f5){_0x543084=_0x543084-0x0;var _0x306a57=_0xe14d[_0x543084];return _0x306a57;};'use strict';var _=require(_0xde14('0x0'));var util=require(_0xde14('0x1'));var moment=require(_0xde14('0x2'));var BPromise=require(_0xde14('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xde14('0x4'));var db=require(_0xde14('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xde14('0x6'))(_0xde14('0x7'));var config=require(_0xde14('0x8'));var jayson=require(_0xde14('0x9'));var client=jayson[_0xde14('0xa')][_0xde14('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0xde14('0xc')],{'host':_0xde14('0xd'),'port':0x18eb});var socket=require(_0xde14('0xe'))(new Redis(config[_0xde14('0xc')]));require(_0xde14('0xf'))[_0xde14('0x10')](socket);function respondWithRpcPromise(_0xa17e8,_0x1ce0a2,_0x4b2b15){return new BPromise(function(_0x1a7167,_0xe785fb){return client[_0xde14('0x11')](_0xa17e8,_0x4b2b15)[_0xde14('0x12')](function(_0x8e0e){logger[_0xde14('0x13')](_0xde14('0x14'),_0x1ce0a2,_0xde14('0x15'));logger[_0xde14('0x16')](_0xde14('0x17'),_0x1ce0a2,_0xde14('0x15'),JSON[_0xde14('0x18')](_0x8e0e));if(_0x8e0e[_0xde14('0x19')]){if(_0x8e0e[_0xde14('0x19')][_0xde14('0x1a')]===0x1f4){logger['error']('FaxMessage,\x20%s,\x20%s',_0x1ce0a2,_0x8e0e[_0xde14('0x19')][_0xde14('0x1b')]);return _0xe785fb(_0x8e0e[_0xde14('0x19')]['message']);}logger[_0xde14('0x19')](_0xde14('0x14'),_0x1ce0a2,_0x8e0e[_0xde14('0x19')][_0xde14('0x1b')]);return _0x1a7167(_0x8e0e[_0xde14('0x19')][_0xde14('0x1b')]);}else{logger[_0xde14('0x13')](_0xde14('0x14'),_0x1ce0a2,_0xde14('0x15'));_0x1a7167(_0x8e0e[_0xde14('0x1c')]['message']);}})[_0xde14('0x1d')](function(_0x3bfc59){logger[_0xde14('0x19')](_0xde14('0x14'),_0x1ce0a2,_0x3bfc59);_0xe785fb(_0x3bfc59);});});}exports['CreateFaxMessage']=function(_0x394de7){var _0x53e905=this;return new Promise(function(_0x45d101,_0x4c24a8){return db[_0xde14('0x1e')][_0xde14('0x1f')](_0x394de7[_0xde14('0x20')],{'raw':_0x394de7[_0xde14('0x21')]?_0x394de7[_0xde14('0x21')][_0xde14('0x22')]===undefined?!![]:![]:!![]})[_0xde14('0x12')](function(_0x2dd9e7){logger[_0xde14('0x13')](_0xde14('0x23'),_0x394de7);logger[_0xde14('0x16')](_0xde14('0x23'),_0x394de7,JSON[_0xde14('0x18')](_0x2dd9e7));_0x45d101(_0x2dd9e7);})['catch'](function(_0x42dd4f){logger[_0xde14('0x19')](_0xde14('0x23'),_0x42dd4f[_0xde14('0x1b')],_0x394de7);_0x4c24a8(_0x53e905[_0xde14('0x19')](0x1f4,_0x42dd4f[_0xde14('0x1b')]));});});};exports[_0xde14('0x24')]=function(_0x23c735){var _0x1618e1=this;return new Promise(function(_0x350a78,_0x4eff65){return db[_0xde14('0x1e')][_0xde14('0x25')](_0x23c735[_0xde14('0x20')],{'raw':_0x23c735[_0xde14('0x21')]?_0x23c735['options'][_0xde14('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x23c735[_0xde14('0x21')]?_0x23c735[_0xde14('0x21')]['where']||null:null,'attributes':_0x23c735[_0xde14('0x21')]?_0x23c735['options'][_0xde14('0x26')]||null:null,'limit':_0x23c735[_0xde14('0x21')]?_0x23c735[_0xde14('0x21')][_0xde14('0x27')]||null:null})[_0xde14('0x12')](function(_0x237d3f){logger[_0xde14('0x13')](_0xde14('0x24'),_0x23c735);logger['debug'](_0xde14('0x24'),_0x23c735,JSON[_0xde14('0x18')](_0x237d3f));_0x350a78(_0x237d3f);})['catch'](function(_0xf25a9e){logger['error'](_0xde14('0x24'),_0xf25a9e[_0xde14('0x1b')],_0x23c735);_0x4eff65(_0x1618e1[_0xde14('0x19')](0x1f4,_0xf25a9e[_0xde14('0x1b')]));});});};
\ No newline at end of file
+var _0x9f62=['util','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','request','info','request\x20sent','stringify','error','code','FaxMessage,\x20%s,\x20%s','message','result','CreateFaxMessage','FaxMessage','body','raw','then','debug','catch','UpdateFaxMessage','update','options','where','attributes','limit'];(function(_0x21164a,_0x45f57c){var _0x3fbb17=function(_0x172926){while(--_0x172926){_0x21164a['push'](_0x21164a['shift']());}};_0x3fbb17(++_0x45f57c);}(_0x9f62,0x154));var _0x29f6=function(_0x28475d,_0x25773c){_0x28475d=_0x28475d-0x0;var _0x2d94db=_0x9f62[_0x28475d];return _0x2d94db;};'use strict';var _=require('lodash');var util=require(_0x29f6('0x0'));var moment=require('moment');var BPromise=require(_0x29f6('0x1'));var rs=require(_0x29f6('0x2'));var fs=require('fs');var Redis=require(_0x29f6('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x29f6('0x4'))(_0x29f6('0x5'));var config=require(_0x29f6('0x6'));var jayson=require(_0x29f6('0x7'));var client=jayson['client'][_0x29f6('0x8')]({'port':0x232a});config[_0x29f6('0x9')]=_[_0x29f6('0xa')](config[_0x29f6('0x9')],{'host':_0x29f6('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./faxMessage.socket')['register'](socket);function respondWithRpcPromise(_0xe25841,_0x44db16,_0x4fb455){return new BPromise(function(_0x5a0724,_0x29b3f5){return client[_0x29f6('0xc')](_0xe25841,_0x4fb455)['then'](function(_0x17b69c){logger[_0x29f6('0xd')]('FaxMessage,\x20%s,\x20%s',_0x44db16,'request\x20sent');logger['debug']('FaxMessage,\x20%s,\x20%s,\x20%s',_0x44db16,_0x29f6('0xe'),JSON[_0x29f6('0xf')](_0x17b69c));if(_0x17b69c[_0x29f6('0x10')]){if(_0x17b69c[_0x29f6('0x10')][_0x29f6('0x11')]===0x1f4){logger[_0x29f6('0x10')](_0x29f6('0x12'),_0x44db16,_0x17b69c[_0x29f6('0x10')][_0x29f6('0x13')]);return _0x29b3f5(_0x17b69c[_0x29f6('0x10')][_0x29f6('0x13')]);}logger[_0x29f6('0x10')](_0x29f6('0x12'),_0x44db16,_0x17b69c[_0x29f6('0x10')][_0x29f6('0x13')]);return _0x5a0724(_0x17b69c[_0x29f6('0x10')][_0x29f6('0x13')]);}else{logger['info']('FaxMessage,\x20%s,\x20%s',_0x44db16,_0x29f6('0xe'));_0x5a0724(_0x17b69c[_0x29f6('0x14')][_0x29f6('0x13')]);}})['catch'](function(_0xcb90){logger[_0x29f6('0x10')]('FaxMessage,\x20%s,\x20%s',_0x44db16,_0xcb90);_0x29b3f5(_0xcb90);});});}exports[_0x29f6('0x15')]=function(_0x3e81af){var _0x42a8fa=this;return new Promise(function(_0x41b9f0,_0xb6e7a9){return db[_0x29f6('0x16')]['create'](_0x3e81af[_0x29f6('0x17')],{'raw':_0x3e81af['options']?_0x3e81af['options'][_0x29f6('0x18')]===undefined?!![]:![]:!![]})[_0x29f6('0x19')](function(_0x39c6b3){logger[_0x29f6('0xd')]('CreateFaxMessage',_0x3e81af);logger[_0x29f6('0x1a')]('CreateFaxMessage',_0x3e81af,JSON[_0x29f6('0xf')](_0x39c6b3));_0x41b9f0(_0x39c6b3);})[_0x29f6('0x1b')](function(_0x4200cc){logger[_0x29f6('0x10')]('CreateFaxMessage',_0x4200cc[_0x29f6('0x13')],_0x3e81af);_0xb6e7a9(_0x42a8fa[_0x29f6('0x10')](0x1f4,_0x4200cc['message']));});});};exports[_0x29f6('0x1c')]=function(_0x45f792){var _0x2519ac=this;return new Promise(function(_0x342038,_0x84ccb7){return db[_0x29f6('0x16')][_0x29f6('0x1d')](_0x45f792['body'],{'raw':_0x45f792[_0x29f6('0x1e')]?_0x45f792[_0x29f6('0x1e')][_0x29f6('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x45f792[_0x29f6('0x1e')]?_0x45f792[_0x29f6('0x1e')][_0x29f6('0x1f')]||null:null,'attributes':_0x45f792[_0x29f6('0x1e')]?_0x45f792[_0x29f6('0x1e')][_0x29f6('0x20')]||null:null,'limit':_0x45f792[_0x29f6('0x1e')]?_0x45f792[_0x29f6('0x1e')][_0x29f6('0x21')]||null:null})[_0x29f6('0x19')](function(_0x304c28){logger[_0x29f6('0xd')](_0x29f6('0x1c'),_0x45f792);logger[_0x29f6('0x1a')]('UpdateFaxMessage',_0x45f792,JSON['stringify'](_0x304c28));_0x342038(_0x304c28);})[_0x29f6('0x1b')](function(_0x489897){logger[_0x29f6('0x10')](_0x29f6('0x1c'),_0x489897[_0x29f6('0x13')],_0x45f792);_0x84ccb7(_0x2519ac[_0x29f6('0x10')](0x1f4,_0x489897['message']));});});};
\ No newline at end of file
index 5c233eb..65e7670 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x26f0=['emit','register','length','faxMessage:','remove','update'];(function(_0x5dfba5,_0x2caa21){var _0x3083a0=function(_0x273366){while(--_0x273366){_0x5dfba5['push'](_0x5dfba5['shift']());}};_0x3083a0(++_0x2caa21);}(_0x26f0,0xbe));var _0x026f=function(_0x22454e,_0x24e058){_0x22454e=_0x22454e-0x0;var _0xfefeaf=_0x26f0[_0x22454e];return _0xfefeaf;};'use strict';var FaxMessageEvents=require('./faxMessage.events');var events=['save',_0x026f('0x0'),_0x026f('0x1')];function createListener(_0x461414,_0x748d5d){return function(_0x767834){_0x748d5d[_0x026f('0x2')](_0x461414,_0x767834);};}function removeListener(_0x59693f,_0x1574f0){return function(){FaxMessageEvents['removeListener'](_0x59693f,_0x1574f0);};}exports[_0x026f('0x3')]=function(_0x1760c1){for(var _0x4a1f15=0x0,_0x2d783f=events[_0x026f('0x4')];_0x4a1f15<_0x2d783f;_0x4a1f15++){var _0x3dec35=events[_0x4a1f15];var _0x58a729=createListener(_0x026f('0x5')+_0x3dec35,_0x1760c1);FaxMessageEvents['on'](_0x3dec35,_0x58a729);}};
\ No newline at end of file
+var _0x2fcf=['register','length','faxMessage:','./faxMessage.events','save','remove','emit','removeListener'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x2fcf,0x73));var _0xf2fc=function(_0x4d2169,_0x353eb9){_0x4d2169=_0x4d2169-0x0;var _0x52e417=_0x2fcf[_0x4d2169];return _0x52e417;};'use strict';var FaxMessageEvents=require(_0xf2fc('0x0'));var events=[_0xf2fc('0x1'),_0xf2fc('0x2'),'update'];function createListener(_0x547f0c,_0x4a93da){return function(_0x2e64f7){_0x4a93da[_0xf2fc('0x3')](_0x547f0c,_0x2e64f7);};}function removeListener(_0x3c2ed7,_0x535089){return function(){FaxMessageEvents[_0xf2fc('0x4')](_0x3c2ed7,_0x535089);};}exports[_0xf2fc('0x5')]=function(_0x48c95b){for(var _0x14a984=0x0,_0x5dcd8d=events[_0xf2fc('0x6')];_0x14a984<_0x5dcd8d;_0x14a984++){var _0x204277=events[_0x14a984];var _0x2ae8f1=createListener(_0xf2fc('0x7')+_0x204277,_0x48c95b);FaxMessageEvents['on'](_0x204277,_0x2ae8f1);}};
\ No newline at end of file
index 634ed4a..ba98667 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9aea=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxMessage.controller','get','index','/describe','describe','/:id','isAuthenticated','show','/:id/download','download','fax','faxmessage:create','create','put','update','accept','/:id/reject','reject','delete','destroy','exports','multer','path','express'];(function(_0x2a191f,_0x1c1809){var _0x27ffd4=function(_0x2ef366){while(--_0x2ef366){_0x2a191f['push'](_0x2a191f['shift']());}};_0x27ffd4(++_0x1c1809);}(_0x9aea,0xdd));var _0xa9ae=function(_0x107d2d,_0x2d9e27){_0x107d2d=_0x107d2d-0x0;var _0x4f9c5f=_0x9aea[_0x107d2d];return _0x4f9c5f;};'use strict';var multer=require(_0xa9ae('0x0'));var util=require('util');var path=require(_0xa9ae('0x1'));var timeout=require('connect-timeout');var express=require(_0xa9ae('0x2'));var router=express[_0xa9ae('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xa9ae('0x4'));var interaction=require(_0xa9ae('0x5'));var config=require(_0xa9ae('0x6'));var controller=require(_0xa9ae('0x7'));router[_0xa9ae('0x8')]('/',auth['isAuthenticated'](),controller[_0xa9ae('0x9')]);router[_0xa9ae('0x8')](_0xa9ae('0xa'),auth['isAuthenticated'](),controller[_0xa9ae('0xb')]);router[_0xa9ae('0x8')](_0xa9ae('0xc'),auth[_0xa9ae('0xd')](),controller[_0xa9ae('0xe')]);router[_0xa9ae('0x8')](_0xa9ae('0xf'),auth[_0xa9ae('0xd')](),controller[_0xa9ae('0x10')]);router['post']('/',auth[_0xa9ae('0xd')](),interaction['tracked'](_0xa9ae('0x11'),_0xa9ae('0x12')),controller[_0xa9ae('0x13')]);router[_0xa9ae('0x14')](_0xa9ae('0xc'),auth[_0xa9ae('0xd')](),controller[_0xa9ae('0x15')]);router[_0xa9ae('0x14')]('/:id/accept',auth[_0xa9ae('0xd')](),controller[_0xa9ae('0x16')]);router[_0xa9ae('0x14')](_0xa9ae('0x17'),auth['isAuthenticated'](),controller[_0xa9ae('0x18')]);router[_0xa9ae('0x19')](_0xa9ae('0xc'),auth[_0xa9ae('0xd')](),controller[_0xa9ae('0x1a')]);module[_0xa9ae('0x1b')]=router;
\ No newline at end of file
+var _0xcea2=['create','put','update','/:id/accept','accept','reject','destroy','exports','multer','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./faxMessage.controller','isAuthenticated','get','/describe','describe','/:id','show','/:id/download','download','post','tracked'];(function(_0x4f4d19,_0x574245){var _0x27a258=function(_0x38da3e){while(--_0x38da3e){_0x4f4d19['push'](_0x4f4d19['shift']());}};_0x27a258(++_0x574245);}(_0xcea2,0x15a));var _0x2cea=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xcea2[_0x21a9d9];return _0x46adce;};'use strict';var multer=require(_0x2cea('0x0'));var util=require('util');var path=require(_0x2cea('0x1'));var timeout=require('connect-timeout');var express=require(_0x2cea('0x2'));var router=express[_0x2cea('0x3')]();var fs_extra=require(_0x2cea('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2cea('0x5'));var config=require(_0x2cea('0x6'));var controller=require(_0x2cea('0x7'));router['get']('/',auth[_0x2cea('0x8')](),controller['index']);router[_0x2cea('0x9')](_0x2cea('0xa'),auth[_0x2cea('0x8')](),controller[_0x2cea('0xb')]);router[_0x2cea('0x9')](_0x2cea('0xc'),auth['isAuthenticated'](),controller[_0x2cea('0xd')]);router[_0x2cea('0x9')](_0x2cea('0xe'),auth[_0x2cea('0x8')](),controller[_0x2cea('0xf')]);router[_0x2cea('0x10')]('/',auth[_0x2cea('0x8')](),interaction[_0x2cea('0x11')]('fax','faxmessage:create'),controller[_0x2cea('0x12')]);router[_0x2cea('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x2cea('0x14')]);router['put'](_0x2cea('0x15'),auth[_0x2cea('0x8')](),controller[_0x2cea('0x16')]);router['put']('/:id/reject',auth['isAuthenticated'](),controller[_0x2cea('0x17')]);router['delete'](_0x2cea('0xc'),auth[_0x2cea('0x8')](),controller[_0x2cea('0x18')]);module[_0x2cea('0x19')]=router;
\ No newline at end of file
index 588018a..143bc51 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x36e0=['name','STRING','INTEGER','rrmemory','beepall','sequelize','exports'];(function(_0x56ad5a,_0x4eaa5b){var _0x4b4f08=function(_0x54b5e2){while(--_0x54b5e2){_0x56ad5a['push'](_0x56ad5a['shift']());}};_0x4b4f08(++_0x4eaa5b);}(_0x36e0,0x15c));var _0x036e=function(_0x1c6e58,_0x548024){_0x1c6e58=_0x1c6e58-0x0;var _0x24e516=_0x36e0[_0x1c6e58];return _0x24e516;};'use strict';var Sequelize=require(_0x036e('0x0'));module[_0x036e('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x036e('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x036e('0x3')]},'timeout':{'type':Sequelize[_0x036e('0x4')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x036e('0x5'),_0x036e('0x6'),'roundrobin'),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x036e('0x4')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x082a=['ENUM','rrmemory','beepall','roundrobin','exports','STRING','name','INTEGER'];(function(_0x3b0c93,_0x1d4e5d){var _0x14fd4a=function(_0x22ed7c){while(--_0x22ed7c){_0x3b0c93['push'](_0x3b0c93['shift']());}};_0x14fd4a(++_0x1d4e5d);}(_0x082a,0x154));var _0xa082=function(_0x3ed7f0,_0x7ad532){_0x3ed7f0=_0x3ed7f0-0x0;var _0x260fab=_0x082a[_0x3ed7f0];return _0x260fab;};'use strict';var Sequelize=require('sequelize');module[_0xa082('0x0')]={'name':{'type':Sequelize[_0xa082('0x1')],'unique':_0xa082('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xa082('0x3')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xa082('0x4')](_0xa082('0x5'),_0xa082('0x6'),_0xa082('0x7')),'allowNull':![]},'lastAgent':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
index 12f7b2a..3b561ff 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x10bc=['ut.UserId\x20=\x20?','QueryTypes','TeamId','includes','value','removeAgents','emit','addAgents','omit','isArray','userFaxQueue:remove','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','./faxQueue.socket','status','json','undefined','count','offset','limit','Content-Range','update','destroy','then','get','FaxQueues','UserProfileResource','end','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','filters','pick','filter','where','merge','type','VIRTUAL','options','FaxQueue','findAll','show','params','includeAll','include','find','catch','create','body','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserFaxQueue','nolimit','findAndCountAll','UserId','agent','updatedAt','rows','SIP','Team','getTeams','User','online','voicePause','interface','flatMap','Agents','sequelize','addTeams','findOrCreate','userFaxQueue:save','removeTeams','ids','select','tq.TeamId','team_has_fax_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone'];(function(_0x53d033,_0x194efd){var _0x121906=function(_0x2ad2b6){while(--_0x2ad2b6){_0x53d033['push'](_0x53d033['shift']());}};_0x121906(++_0x194efd);}(_0x10bc,0x8d));var _0xc10b=function(_0x3fee0,_0x394205){_0x3fee0=_0x3fee0-0x0;var _0xbb33fc=_0x10bc[_0x3fee0];return _0xbb33fc;};'use strict';var emlformat=require(_0xc10b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc10b('0x1'));var jsonpatch=require(_0xc10b('0x2'));var rp=require(_0xc10b('0x3'));var moment=require(_0xc10b('0x4'));var BPromise=require(_0xc10b('0x5'));var Mustache=require('mustache');var util=require(_0xc10b('0x6'));var path=require(_0xc10b('0x7'));var sox=require(_0xc10b('0x8'));var csv=require(_0xc10b('0x9'));var ejs=require(_0xc10b('0xa'));var fs=require('fs');var fs_extra=require(_0xc10b('0xb'));var _=require(_0xc10b('0xc'));var squel=require('squel');var crypto=require(_0xc10b('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xc10b('0xe'));var toCsv=require(_0xc10b('0x9'));var querystring=require(_0xc10b('0xf'));var Papa=require(_0xc10b('0x10'));var Redis=require(_0xc10b('0x11'));var authService=require(_0xc10b('0x12'));var qs=require(_0xc10b('0x13'));var as=require(_0xc10b('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc10b('0x15'));var utils=require(_0xc10b('0x16'));var config=require(_0xc10b('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xc10b('0x18'))['db'];config[_0xc10b('0x19')]=_[_0xc10b('0x1a')](config[_0xc10b('0x19')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xc10b('0x1b'))['register'](socket);function respondWithStatusCode(_0x38f512,_0x33d330){_0x33d330=_0x33d330||0xcc;return function(_0x2c7c53){if(_0x2c7c53){return _0x38f512['sendStatus'](_0x33d330);}return _0x38f512[_0xc10b('0x1c')](_0x33d330)['end']();};}function respondWithResult(_0x3c8205,_0x43b18c){_0x43b18c=_0x43b18c||0xc8;return function(_0x591ecf){if(_0x591ecf){return _0x3c8205[_0xc10b('0x1c')](_0x43b18c)[_0xc10b('0x1d')](_0x591ecf);}};}function respondWithFilteredResult(_0x48ddd0,_0x2b5f07){return function(_0x4c91f4){if(_0x4c91f4){var _0x476ade=typeof _0x2b5f07['offset']===_0xc10b('0x1e')&&typeof _0x2b5f07['limit']===_0xc10b('0x1e');var _0x13dd10=_0x4c91f4[_0xc10b('0x1f')];var _0x2aa80c=_0x476ade?0x0:_0x2b5f07[_0xc10b('0x20')];var _0x18d528=_0x476ade?_0x4c91f4['count']:_0x2b5f07[_0xc10b('0x20')]+_0x2b5f07[_0xc10b('0x21')];var _0x1496eb;if(_0x18d528>=_0x13dd10){_0x18d528=_0x13dd10;_0x1496eb=0xc8;}else{_0x1496eb=0xce;}_0x48ddd0[_0xc10b('0x1c')](_0x1496eb);return _0x48ddd0['set'](_0xc10b('0x22'),_0x2aa80c+'-'+_0x18d528+'/'+_0x13dd10)['json'](_0x4c91f4);}return null;};}function patchUpdates(_0xbff5d1){return function(_0x208523){try{jsonpatch['apply'](_0x208523,_0xbff5d1,!![]);}catch(_0x13fc8d){return BPromise['reject'](_0x13fc8d);}return _0x208523['save']();};}function saveUpdates(_0x471eef,_0x27a0fc){return function(_0x11587d){if(_0x11587d){return _0x11587d[_0xc10b('0x23')](_0x471eef)['then'](function(_0xc63187){return _0xc63187;});}return null;};}function removeEntity(_0x397ced,_0x402625){return function(_0x3076bd){if(_0x3076bd){return _0x3076bd[_0xc10b('0x24')]()[_0xc10b('0x25')](function(){var _0x83f401=_0x3076bd[_0xc10b('0x26')]({'plain':!![]});var _0x17c6b3=_0xc10b('0x27');return db[_0xc10b('0x28')][_0xc10b('0x24')]({'where':{'type':_0x17c6b3,'resourceId':_0x83f401['id']}})['then'](function(){return _0x3076bd;});})[_0xc10b('0x25')](function(){_0x397ced[_0xc10b('0x1c')](0xcc)[_0xc10b('0x29')]();});}};}function handleEntityNotFound(_0x2a3fc7,_0x4723d6){return function(_0x50d70a){if(!_0x50d70a){_0x2a3fc7[_0xc10b('0x2a')](0x194);}return _0x50d70a;};}function handleError(_0x3375b8,_0x5a4f2d){_0x5a4f2d=_0x5a4f2d||0x1f4;return function(_0xab867){logger[_0xc10b('0x2b')](_0xab867[_0xc10b('0x2c')]);if(_0xab867[_0xc10b('0x2d')]){delete _0xab867['name'];}_0x3375b8[_0xc10b('0x1c')](_0x5a4f2d)[_0xc10b('0x2e')](_0xab867);};}exports[_0xc10b('0x2f')]=function(_0x3cfaad,_0x225269){var _0x40781c={},_0x241829={},_0x2a9462={'count':0x0,'rows':[]};var _0x284928=_[_0xc10b('0x30')](db['FaxQueue'][_0xc10b('0x31')],function(_0x5275e6){return{'name':_0x5275e6[_0xc10b('0x32')],'type':_0x5275e6['type'][_0xc10b('0x33')]};});_0x241829[_0xc10b('0x34')]=_[_0xc10b('0x30')](_0x284928,'name');_0x241829['query']=_[_0xc10b('0x35')](_0x3cfaad[_0xc10b('0x36')]);_0x241829['filters']=_[_0xc10b('0x37')](_0x241829[_0xc10b('0x34')],_0x241829['query']);_0x40781c[_0xc10b('0x38')]=_['intersection'](_0x241829[_0xc10b('0x34')],qs[_0xc10b('0x39')](_0x3cfaad[_0xc10b('0x36')][_0xc10b('0x39')]));_0x40781c[_0xc10b('0x38')]=_0x40781c['attributes'][_0xc10b('0x3a')]?_0x40781c[_0xc10b('0x38')]:_0x241829[_0xc10b('0x34')];if(!_0x3cfaad[_0xc10b('0x36')][_0xc10b('0x3b')]('nolimit')){_0x40781c[_0xc10b('0x21')]=qs[_0xc10b('0x21')](_0x3cfaad[_0xc10b('0x36')][_0xc10b('0x21')]);_0x40781c[_0xc10b('0x20')]=qs['offset'](_0x3cfaad[_0xc10b('0x36')][_0xc10b('0x20')]);}_0x40781c[_0xc10b('0x3c')]=qs[_0xc10b('0x3d')](_0x3cfaad[_0xc10b('0x36')]['sort']);_0x40781c['where']=qs[_0xc10b('0x3e')](_[_0xc10b('0x3f')](_0x3cfaad[_0xc10b('0x36')],_0x241829['filters']),_0x284928);if(_0x3cfaad['query'][_0xc10b('0x40')]){_0x40781c[_0xc10b('0x41')]=_[_0xc10b('0x42')](_0x40781c['where'],{'$or':_['map'](_0x284928,function(_0x40a8ed){if(_0x40a8ed[_0xc10b('0x43')]!==_0xc10b('0x44')){var _0x1ead60={};_0x1ead60[_0x40a8ed[_0xc10b('0x2d')]]={'$like':'%'+_0x3cfaad['query']['filter']+'%'};return _0x1ead60;}})});}_0x40781c=_[_0xc10b('0x42')]({},_0x40781c,_0x3cfaad[_0xc10b('0x45')]);var _0x566aad={'where':_0x40781c['where']};return db[_0xc10b('0x46')]['count'](_0x566aad)[_0xc10b('0x25')](function(_0x15ae52){_0x2a9462[_0xc10b('0x1f')]=_0x15ae52;if(_0x3cfaad['query']['includeAll']){_0x40781c['include']=[{'all':!![]}];}return db[_0xc10b('0x46')][_0xc10b('0x47')](_0x40781c);})[_0xc10b('0x25')](function(_0xb69ed5){_0x2a9462['rows']=_0xb69ed5;return _0x2a9462;})[_0xc10b('0x25')](respondWithFilteredResult(_0x225269,_0x40781c))['catch'](handleError(_0x225269,null));};exports[_0xc10b('0x48')]=function(_0x4ab3c6,_0xcd6e86){var _0x46939c={'raw':!![],'where':{'id':_0x4ab3c6[_0xc10b('0x49')]['id']}},_0x516a6f={};_0x516a6f[_0xc10b('0x34')]=_[_0xc10b('0x35')](db[_0xc10b('0x46')]['rawAttributes']);_0x516a6f[_0xc10b('0x36')]=_[_0xc10b('0x35')](_0x4ab3c6[_0xc10b('0x36')]);_0x516a6f[_0xc10b('0x3e')]=_[_0xc10b('0x37')](_0x516a6f[_0xc10b('0x34')],_0x516a6f['query']);_0x46939c[_0xc10b('0x38')]=_[_0xc10b('0x37')](_0x516a6f[_0xc10b('0x34')],qs['fields'](_0x4ab3c6[_0xc10b('0x36')][_0xc10b('0x39')]));_0x46939c[_0xc10b('0x38')]=_0x46939c[_0xc10b('0x38')]['length']?_0x46939c[_0xc10b('0x38')]:_0x516a6f[_0xc10b('0x34')];if(_0x4ab3c6[_0xc10b('0x36')][_0xc10b('0x4a')]){_0x46939c[_0xc10b('0x4b')]=[{'all':!![]}];}_0x46939c=_['merge']({},_0x46939c,_0x4ab3c6[_0xc10b('0x45')]);return db[_0xc10b('0x46')][_0xc10b('0x4c')](_0x46939c)[_0xc10b('0x25')](handleEntityNotFound(_0xcd6e86,null))[_0xc10b('0x25')](respondWithResult(_0xcd6e86,null))[_0xc10b('0x4d')](handleError(_0xcd6e86,null));};exports[_0xc10b('0x4e')]=function(_0x22cd79,_0x5b5a3d){return db[_0xc10b('0x46')][_0xc10b('0x4e')](_0x22cd79[_0xc10b('0x4f')],{})['then'](function(_0x4493ac){var _0x63a3f2=_0x22cd79[_0xc10b('0x50')][_0xc10b('0x26')]({'plain':!![]});if(!_0x63a3f2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x63a3f2['role']===_0xc10b('0x50')){var _0x139d71=_0x4493ac[_0xc10b('0x26')]({'plain':!![]});var _0x5e9be4=_0xc10b('0x27');return db[_0xc10b('0x51')][_0xc10b('0x4c')]({'where':{'name':_0x5e9be4,'userProfileId':_0x63a3f2['userProfileId']},'raw':!![]})[_0xc10b('0x25')](function(_0x56e5c6){if(_0x56e5c6&&_0x56e5c6[_0xc10b('0x52')]===0x0){return db[_0xc10b('0x28')]['create']({'name':_0x139d71[_0xc10b('0x2d')],'resourceId':_0x139d71['id'],'type':_0x56e5c6['name'],'sectionId':_0x56e5c6['id']},{})[_0xc10b('0x25')](function(){return _0x4493ac;});}else{return _0x4493ac;}})['catch'](function(_0x3719c9){logger['error'](_0xc10b('0x53'),_0x3719c9);throw _0x3719c9;});}return _0x4493ac;})[_0xc10b('0x25')](respondWithResult(_0x5b5a3d,0xc9))[_0xc10b('0x4d')](handleError(_0x5b5a3d,null));};exports[_0xc10b('0x23')]=function(_0x51df05,_0x1ef747){if(_0x51df05['body']['id']){delete _0x51df05[_0xc10b('0x4f')]['id'];}return db['FaxQueue'][_0xc10b('0x4c')]({'where':{'id':_0x51df05[_0xc10b('0x49')]['id']}})[_0xc10b('0x25')](handleEntityNotFound(_0x1ef747,null))['then'](saveUpdates(_0x51df05['body'],null))[_0xc10b('0x25')](respondWithResult(_0x1ef747,null))[_0xc10b('0x4d')](handleError(_0x1ef747,null));};exports[_0xc10b('0x24')]=function(_0x5b1cf8,_0xe310a0){return db[_0xc10b('0x46')][_0xc10b('0x4c')]({'where':{'id':_0x5b1cf8[_0xc10b('0x49')]['id']}})[_0xc10b('0x25')](handleEntityNotFound(_0xe310a0,null))['then'](removeEntity(_0xe310a0,null))['catch'](handleError(_0xe310a0,null));};exports[_0xc10b('0x54')]=function(_0xdcc4aa,_0x1d49f4){return db['FaxQueue'][_0xc10b('0x54')]()[_0xc10b('0x25')](respondWithResult(_0x1d49f4,null))[_0xc10b('0x4d')](handleError(_0x1d49f4,null));};exports[_0xc10b('0x55')]=function(_0x4f8a1d,_0x96183e,_0x12cbe0){var _0x80e573={'raw':!![],'where':{}},_0x5ad721={},_0x2528c2;return db[_0xc10b('0x46')][_0xc10b('0x56')]({'where':{'id':_0x4f8a1d[_0xc10b('0x49')]['id']}})[_0xc10b('0x25')](handleEntityNotFound(_0x96183e,null))[_0xc10b('0x25')](function(_0xd96664){if(_0xd96664){_0x2528c2=_0xd96664[_0xc10b('0x26')]({'plain':!![]});_0x5ad721[_0xc10b('0x34')]=_['keys'](db[_0xc10b('0x57')][_0xc10b('0x31')]);_0x5ad721[_0xc10b('0x36')]=_[_0xc10b('0x35')](_0x4f8a1d[_0xc10b('0x36')]);_0x5ad721['filters']=_[_0xc10b('0x37')](_0x5ad721[_0xc10b('0x34')],_0x5ad721[_0xc10b('0x36')]);_0x80e573[_0xc10b('0x38')]=_[_0xc10b('0x37')](_0x5ad721[_0xc10b('0x34')],qs[_0xc10b('0x39')](_0x4f8a1d[_0xc10b('0x36')][_0xc10b('0x39')]));_0x80e573[_0xc10b('0x38')]=_0x80e573[_0xc10b('0x38')][_0xc10b('0x3a')]?_0x80e573[_0xc10b('0x38')]:_0x5ad721[_0xc10b('0x34')];if(!_0x4f8a1d[_0xc10b('0x36')][_0xc10b('0x3b')](_0xc10b('0x58'))){_0x80e573[_0xc10b('0x21')]=qs[_0xc10b('0x21')](_0x4f8a1d[_0xc10b('0x36')]['limit']);_0x80e573[_0xc10b('0x20')]=qs[_0xc10b('0x20')](_0x4f8a1d[_0xc10b('0x36')][_0xc10b('0x20')]);}_0x80e573[_0xc10b('0x3c')]=qs[_0xc10b('0x3d')](_0x4f8a1d['query'][_0xc10b('0x3d')]);_0x80e573[_0xc10b('0x41')]=qs['filters'](_[_0xc10b('0x3f')](_0x4f8a1d[_0xc10b('0x36')],_0x5ad721[_0xc10b('0x3e')]));_0x80e573[_0xc10b('0x41')]['FaxQueueId']=_0xd96664['id'];if(_0x4f8a1d[_0xc10b('0x36')][_0xc10b('0x40')]){_0x80e573[_0xc10b('0x41')]=_[_0xc10b('0x42')](_0x80e573[_0xc10b('0x41')],{'$or':_[_0xc10b('0x30')](_0x80e573[_0xc10b('0x38')],function(_0x226510){var _0x2d8e34={};_0x2d8e34[_0x226510]={'$like':'%'+_0x4f8a1d[_0xc10b('0x36')][_0xc10b('0x40')]+'%'};return _0x2d8e34;})});}_0x80e573=_['merge']({},_0x80e573,_0x4f8a1d[_0xc10b('0x45')]);return db[_0xc10b('0x57')][_0xc10b('0x47')](_0x80e573);}})[_0xc10b('0x25')](function(_0x4be770){if(_0x4be770){return db['User'][_0xc10b('0x59')]({'where':{'id':_[_0xc10b('0x30')](_0x4be770,_0xc10b('0x5a')),'role':_0xc10b('0x5b')},'attributes':['id',_0xc10b('0x2d'),'faxPause',_0xc10b('0x5c'),'createdAt']});}})[_0xc10b('0x25')](function(_0xa05121){if(_0xa05121){return{'count':_0xa05121[_0xc10b('0x1f')],'rows':_[_0xc10b('0x30')](_0xa05121[_0xc10b('0x5d')],function(_0x63282c){return{'membername':_0x63282c['name'],'UserId':_0x63282c['id'],'queue_name':_0x2528c2['name'],'FaxQueueId':_0x2528c2['id'],'interface':util['format']('%s/%s',_0xc10b('0x5e'),_0x63282c['name']),'penalty':0x0,'paused':_0x63282c['faxPause'],'createdAt':_0x63282c['createdAt'],'updatedAt':_0x63282c[_0xc10b('0x5c')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xc10b('0x25')](respondWithFilteredResult(_0x96183e,_0x80e573))[_0xc10b('0x4d')](handleError(_0x96183e,null));};exports['getTeams']=function(_0x5bb3a0,_0x53d400,_0x27e2af){var _0x1368bf={};var _0x4b52d8={};var _0x369412;var _0x3f35c6;return db['FaxQueue']['findOne']({'where':{'id':_0x5bb3a0[_0xc10b('0x49')]['id']}})[_0xc10b('0x25')](handleEntityNotFound(_0x53d400,null))[_0xc10b('0x25')](function(_0x556154){if(_0x556154){_0x369412=_0x556154;_0x4b52d8[_0xc10b('0x34')]=_['keys'](db[_0xc10b('0x5f')][_0xc10b('0x31')]);_0x4b52d8[_0xc10b('0x36')]=_[_0xc10b('0x35')](_0x5bb3a0[_0xc10b('0x36')]);_0x4b52d8['filters']=_[_0xc10b('0x37')](_0x4b52d8[_0xc10b('0x34')],_0x4b52d8[_0xc10b('0x36')]);_0x1368bf[_0xc10b('0x38')]=_[_0xc10b('0x37')](_0x4b52d8[_0xc10b('0x34')],qs[_0xc10b('0x39')](_0x5bb3a0[_0xc10b('0x36')][_0xc10b('0x39')]));_0x1368bf[_0xc10b('0x38')]=_0x1368bf[_0xc10b('0x38')][_0xc10b('0x3a')]?_0x1368bf[_0xc10b('0x38')]:_0x4b52d8[_0xc10b('0x34')];_0x1368bf[_0xc10b('0x3c')]=qs['sort'](_0x5bb3a0[_0xc10b('0x36')][_0xc10b('0x3d')]);_0x1368bf[_0xc10b('0x41')]=qs[_0xc10b('0x3e')](_[_0xc10b('0x3f')](_0x5bb3a0[_0xc10b('0x36')],_0x4b52d8[_0xc10b('0x3e')]));if(_0x5bb3a0[_0xc10b('0x36')][_0xc10b('0x40')]){_0x1368bf['where']=_['merge'](_0x1368bf[_0xc10b('0x41')],{'$or':_[_0xc10b('0x30')](_0x1368bf[_0xc10b('0x38')],function(_0x2d3986){var _0x5541b7={};_0x5541b7[_0x2d3986]={'$like':'%'+_0x5bb3a0[_0xc10b('0x36')][_0xc10b('0x40')]+'%'};return _0x5541b7;})});}_0x1368bf=_[_0xc10b('0x42')]({},_0x1368bf,_0x5bb3a0[_0xc10b('0x45')]);return _0x369412[_0xc10b('0x60')](_0x1368bf);}})[_0xc10b('0x25')](function(_0x5e8844){if(_0x5e8844){_0x3f35c6=_0x5e8844[_0xc10b('0x3a')];if(!_0x5bb3a0[_0xc10b('0x36')]['hasOwnProperty'](_0xc10b('0x58'))){_0x1368bf[_0xc10b('0x21')]=qs[_0xc10b('0x21')](_0x5bb3a0[_0xc10b('0x36')][_0xc10b('0x21')]);_0x1368bf[_0xc10b('0x20')]=qs[_0xc10b('0x20')](_0x5bb3a0[_0xc10b('0x36')][_0xc10b('0x20')]);}return _0x369412[_0xc10b('0x60')](_0x1368bf);}})[_0xc10b('0x25')](function(_0x2d8095){if(_0x2d8095){return _0x2d8095?{'count':_0x3f35c6,'rows':_0x2d8095}:null;}})[_0xc10b('0x25')](respondWithResult(_0x53d400,null))['catch'](handleError(_0x53d400,null));};exports['addTeams']=function(_0x5874d4,_0x4e6d65,_0x3704a5){var _0x2daf1f=_0x5874d4[_0xc10b('0x4f')]['ids'];return db[_0xc10b('0x5f')][_0xc10b('0x47')]({'where':{'id':_0x2daf1f},'attributes':['id'],'include':[{'model':db[_0xc10b('0x61')],'as':'Agents','attributes':['id',_0xc10b('0x2d'),_0xc10b('0x62'),_0xc10b('0x63'),_0xc10b('0x64')],'raw':!![]}]})[_0xc10b('0x25')](function(_0xf03ae1){if(_0xf03ae1){var _0x4ac003=_[_0xc10b('0x65')](_0xf03ae1,function(_0x564fef){var _0x44e842=_0x564fef[_0xc10b('0x26')]({'plain':!![]});return _0x44e842[_0xc10b('0x66')];});return db[_0xc10b('0x46')][_0xc10b('0x4c')]({'where':{'id':_0x5874d4[_0xc10b('0x49')]['id']}})[_0xc10b('0x25')](function(_0xe6100a){return db[_0xc10b('0x67')]['transaction'](function(_0x305a42){return _0xe6100a[_0xc10b('0x68')](_0x2daf1f,{'transaction':_0x305a42})['then'](function(){return BPromise['each'](_0x4ac003,function(_0x1b8f0e){return db['UserFaxQueue'][_0xc10b('0x69')]({'where':{'UserId':_0x1b8f0e['id'],'FaxQueueId':_0x5874d4[_0xc10b('0x49')]['id']},'transaction':_0x305a42});});})[_0xc10b('0x25')](function(){_0x4ac003['forEach'](function(_0x4285fc){socket['emit'](_0xc10b('0x6a'),{'UserId':_0x4285fc['id'],'FaxQueueId':_0xe6100a['id']});});});});});}})[_0xc10b('0x25')](respondWithStatusCode(_0x4e6d65,null))[_0xc10b('0x4d')](handleError(_0x4e6d65,null));};exports[_0xc10b('0x6b')]=function(_0x39d0ed,_0x7fa2f,_0x58819f){return db[_0xc10b('0x5f')][_0xc10b('0x47')]({'where':{'id':_0x39d0ed[_0xc10b('0x36')][_0xc10b('0x6c')]},'attributes':['id'],'include':[{'model':db[_0xc10b('0x61')],'as':_0xc10b('0x66'),'attributes':['id'],'raw':!![]}]})[_0xc10b('0x25')](handleEntityNotFound(_0x7fa2f,null))[_0xc10b('0x25')](function(_0x17eaff){var _0x5cddeb=_[_0xc10b('0x30')](_0x17eaff,'id');var _0x41613b=[];var _0x295a20=[];var _0x198134=squel[_0xc10b('0x6d')]();_0x198134['field'](_0xc10b('0x6e'))['from'](_0xc10b('0x6f'),'tq')[_0xc10b('0x70')](_0xc10b('0x71'),'ut',_0xc10b('0x72'))[_0xc10b('0x41')](_0xc10b('0x73'),_0x39d0ed[_0xc10b('0x49')]['id']);for(var _0x98d3c8=0x0;_0x98d3c8<_0x17eaff[_0xc10b('0x3a')];_0x98d3c8+=0x1){let _0x3f2dbd=_0x17eaff[_0x98d3c8];for(var _0x1cfc83=0x0;_0x1cfc83<_0x3f2dbd[_0xc10b('0x66')]['length'];_0x1cfc83+=0x1){let _0x21a39d=_0x3f2dbd[_0xc10b('0x66')][_0x1cfc83];var _0x34e711=_0x198134[_0xc10b('0x74')]();_0x34e711[_0xc10b('0x41')](_0xc10b('0x75'),_0x21a39d['id']);_0x295a20['push'](db['sequelize'][_0xc10b('0x36')](_0x34e711['toString'](),{'type':db[_0xc10b('0x67')][_0xc10b('0x76')]['SELECT']})[_0xc10b('0x25')](function(_0x3578ef){if(_0x3578ef[_0xc10b('0x3a')]===0x1){return _0x21a39d['id'];}else{var _0x2478f2=_['every'](_[_0xc10b('0x30')](_0x3578ef,_0xc10b('0x77')),function(_0x3b7ee1){return _[_0xc10b('0x78')](_0x5cddeb,_0x3b7ee1);});if(_0x2478f2){return _0x21a39d['id'];}}}));}}return BPromise['all'](_0x295a20)[_0xc10b('0x25')](function(_0x48626b){_0x41613b=_(_0x41613b)['union'](_0x48626b)['compact']()[_0xc10b('0x79')]();return db[_0xc10b('0x46')][_0xc10b('0x4c')]({'where':{'id':_0x39d0ed[_0xc10b('0x49')]['id']}})[_0xc10b('0x25')](function(_0x467361){return db['sequelize']['transaction'](function(_0x55ddbf){return _0x467361[_0xc10b('0x6b')](_0x39d0ed[_0xc10b('0x36')][_0xc10b('0x6c')],{'transaction':_0x55ddbf})[_0xc10b('0x25')](function(){if(!_['isEmpty'](_0x41613b)){return _0x467361[_0xc10b('0x7a')](_0x41613b,{'transaction':_0x55ddbf});}})['then'](function(){_0x41613b['forEach'](function(_0x5839a1){socket[_0xc10b('0x7b')]('userFaxQueue:remove',{'UserId':_0x5839a1,'FaxQueueId':_0x467361['id']});});});});});});})[_0xc10b('0x25')](respondWithStatusCode(_0x7fa2f,null))[_0xc10b('0x4d')](handleError(_0x7fa2f,null));};exports['addAgents']=function(_0x22e432,_0x28fd56,_0x2a2afb){return db[_0xc10b('0x46')][_0xc10b('0x4c')]({'where':{'id':_0x22e432['params']['id']}})[_0xc10b('0x25')](handleEntityNotFound(_0x28fd56,null))['then'](function(_0x427803){if(_0x427803){return _0x427803[_0xc10b('0x7c')](_0x22e432[_0xc10b('0x4f')][_0xc10b('0x6c')],_[_0xc10b('0x7d')](_0x22e432[_0xc10b('0x4f')],[_0xc10b('0x6c'),'id'])||{})['spread'](function(_0x50dfe7){for(var _0x3e519b=0x0;_0x3e519b<_0x22e432[_0xc10b('0x4f')][_0xc10b('0x6c')][_0xc10b('0x3a')];_0x3e519b+=0x1){socket['emit'](_0xc10b('0x6a'),{'UserId':Number(_0x22e432['body']['ids'][_0x3e519b]),'FaxQueueId':Number(_0x22e432[_0xc10b('0x49')]['id'])});}return _0x50dfe7;});}})[_0xc10b('0x25')](respondWithResult(_0x28fd56,null))['catch'](handleError(_0x28fd56,null));};exports[_0xc10b('0x7a')]=function(_0x5d7e63,_0x22e9d0,_0x51dadc){return db[_0xc10b('0x46')][_0xc10b('0x4c')]({'where':{'id':_0x5d7e63['params']['id']}})[_0xc10b('0x25')](handleEntityNotFound(_0x22e9d0,null))[_0xc10b('0x25')](function(_0x3edcc3){if(_0x3edcc3){return _0x3edcc3['removeAgents'](_0x5d7e63[_0xc10b('0x36')][_0xc10b('0x6c')])[_0xc10b('0x25')](function(){if(_[_0xc10b('0x7e')](_0x5d7e63[_0xc10b('0x36')][_0xc10b('0x6c')])){for(var _0x3eb1fb=0x0;_0x3eb1fb<_0x5d7e63[_0xc10b('0x36')][_0xc10b('0x6c')][_0xc10b('0x3a')];_0x3eb1fb+=0x1){socket['emit'](_0xc10b('0x7f'),{'UserId':Number(_0x5d7e63[_0xc10b('0x36')][_0xc10b('0x6c')][_0x3eb1fb]),'FaxQueueId':Number(_0x5d7e63[_0xc10b('0x49')]['id'])});}}else{socket['emit'](_0xc10b('0x7f'),{'UserId':Number(_0x5d7e63[_0xc10b('0x36')][_0xc10b('0x6c')]),'FaxQueueId':Number(_0x5d7e63[_0xc10b('0x49')]['id'])});}});}})[_0xc10b('0x25')](respondWithStatusCode(_0x22e9d0,null))['catch'](handleError(_0x22e9d0,null));};exports['getAgents']=function(_0x7f5bd4,_0x425619,_0x57f834){var _0x39a01d={};var _0x9ec46e={};var _0x1f1f34;var _0x165722;return db[_0xc10b('0x46')][_0xc10b('0x56')]({'where':{'id':_0x7f5bd4[_0xc10b('0x49')]['id']}})['then'](handleEntityNotFound(_0x425619,null))[_0xc10b('0x25')](function(_0x6cef1d){if(_0x6cef1d){_0x1f1f34=_0x6cef1d;_0x9ec46e['model']=_[_0xc10b('0x35')](db[_0xc10b('0x61')]['rawAttributes']);_0x9ec46e[_0xc10b('0x36')]=_['keys'](_0x7f5bd4[_0xc10b('0x36')]);_0x9ec46e[_0xc10b('0x3e')]=_['intersection'](_0x9ec46e['model'],_0x9ec46e['query']);_0x39a01d['attributes']=_['intersection'](_0x9ec46e[_0xc10b('0x34')],qs[_0xc10b('0x39')](_0x7f5bd4['query']['fields']));_0x39a01d[_0xc10b('0x38')]=_0x39a01d[_0xc10b('0x38')][_0xc10b('0x3a')]?_0x39a01d[_0xc10b('0x38')]:_0x9ec46e[_0xc10b('0x34')];_0x39a01d[_0xc10b('0x3c')]=qs[_0xc10b('0x3d')](_0x7f5bd4['query'][_0xc10b('0x3d')]);_0x39a01d[_0xc10b('0x41')]=qs['filters'](_[_0xc10b('0x3f')](_0x7f5bd4[_0xc10b('0x36')],_0x9ec46e['filters']));if(_0x7f5bd4['query'][_0xc10b('0x40')]){_0x39a01d[_0xc10b('0x41')]=_[_0xc10b('0x42')](_0x39a01d[_0xc10b('0x41')],{'$or':_[_0xc10b('0x30')](_0x39a01d['attributes'],function(_0xd52853){var _0x3a3f62={};_0x3a3f62[_0xd52853]={'$like':'%'+_0x7f5bd4['query'][_0xc10b('0x40')]+'%'};return _0x3a3f62;})});}_0x39a01d=_[_0xc10b('0x42')]({},_0x39a01d,_0x7f5bd4[_0xc10b('0x45')]);return _0x1f1f34[_0xc10b('0x80')](_0x39a01d);}})[_0xc10b('0x25')](function(_0xa984f1){if(_0xa984f1){_0x165722=_0xa984f1['length'];if(!_0x7f5bd4[_0xc10b('0x36')][_0xc10b('0x3b')](_0xc10b('0x58'))){_0x39a01d['limit']=qs['limit'](_0x7f5bd4[_0xc10b('0x36')]['limit']);_0x39a01d[_0xc10b('0x20')]=qs[_0xc10b('0x20')](_0x7f5bd4[_0xc10b('0x36')][_0xc10b('0x20')]);}return _0x1f1f34['getAgents'](_0x39a01d);}})[_0xc10b('0x25')](function(_0x238690){if(_0x238690){return _0x238690?{'count':_0x165722,'rows':_0x238690}:null;}})[_0xc10b('0x25')](respondWithResult(_0x425619,null))['catch'](handleError(_0x425619,null));};
\ No newline at end of file
+var _0xed23=['fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','options','includeAll','include','rows','catch','show','params','keys','merge','find','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','UserFaxQueue','findAll','UserId','faxPause','updatedAt','createdAt','format','%s/%s','Team','getTeams','addTeams','flatMap','Agents','transaction','each','findOrCreate','emit','ids','User','select','field','tq.TeamId','from','join','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','includes','union','compact','value','sequelize','removeTeams','removeAgents','forEach','userFaxQueue:remove','addAgents','spread','userFaxQueue:save','isArray','getAgents','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','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','./faxQueue.socket','register','end','status','json','offset','limit','count','set','apply','update','then','destroy','FaxQueues','UserProfileResource','sendStatus','error','stack','name','send','map','FaxQueue','rawAttributes','type','key','query','filters','intersection','model'];(function(_0x3610ba,_0x562f07){var _0x4e6aac=function(_0x54aebe){while(--_0x54aebe){_0x3610ba['push'](_0x3610ba['shift']());}};_0x4e6aac(++_0x562f07);}(_0xed23,0x160));var _0x3ed2=function(_0x32353f,_0x1e1573){_0x32353f=_0x32353f-0x0;var _0x229365=_0xed23[_0x32353f];return _0x229365;};'use strict';var emlformat=require(_0x3ed2('0x0'));var rimraf=require(_0x3ed2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3ed2('0x2'));var rp=require(_0x3ed2('0x3'));var moment=require('moment');var BPromise=require(_0x3ed2('0x4'));var Mustache=require(_0x3ed2('0x5'));var util=require(_0x3ed2('0x6'));var path=require(_0x3ed2('0x7'));var sox=require(_0x3ed2('0x8'));var csv=require(_0x3ed2('0x9'));var ejs=require(_0x3ed2('0xa'));var fs=require('fs');var fs_extra=require(_0x3ed2('0xb'));var _=require(_0x3ed2('0xc'));var squel=require(_0x3ed2('0xd'));var crypto=require(_0x3ed2('0xe'));var jsforce=require(_0x3ed2('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x3ed2('0x9'));var querystring=require(_0x3ed2('0x10'));var Papa=require('papaparse');var Redis=require(_0x3ed2('0x11'));var authService=require(_0x3ed2('0x12'));var qs=require(_0x3ed2('0x13'));var as=require(_0x3ed2('0x14'));var hardwareService=require(_0x3ed2('0x15'));var logger=require('../../config/logger')(_0x3ed2('0x16'));var utils=require(_0x3ed2('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x3ed2('0x18'));var db=require(_0x3ed2('0x19'))['db'];config[_0x3ed2('0x1a')]=_[_0x3ed2('0x1b')](config['redis'],{'host':_0x3ed2('0x1c'),'port':0x18eb});var socket=require(_0x3ed2('0x1d'))(new Redis(config[_0x3ed2('0x1a')]));require(_0x3ed2('0x1e'))[_0x3ed2('0x1f')](socket);function respondWithStatusCode(_0x10395b,_0xf5b7a3){_0xf5b7a3=_0xf5b7a3||0xcc;return function(_0x46120d){if(_0x46120d){return _0x10395b['sendStatus'](_0xf5b7a3);}return _0x10395b['status'](_0xf5b7a3)[_0x3ed2('0x20')]();};}function respondWithResult(_0x45f0d3,_0x14dbb2){_0x14dbb2=_0x14dbb2||0xc8;return function(_0x5edbf6){if(_0x5edbf6){return _0x45f0d3[_0x3ed2('0x21')](_0x14dbb2)[_0x3ed2('0x22')](_0x5edbf6);}};}function respondWithFilteredResult(_0x563a10,_0x3478ed){return function(_0x4590d1){if(_0x4590d1){var _0x5e04ca=typeof _0x3478ed[_0x3ed2('0x23')]==='undefined'&&typeof _0x3478ed[_0x3ed2('0x24')]==='undefined';var _0x26a993=_0x4590d1[_0x3ed2('0x25')];var _0x28a1e0=_0x5e04ca?0x0:_0x3478ed[_0x3ed2('0x23')];var _0x25f6b8=_0x5e04ca?_0x4590d1[_0x3ed2('0x25')]:_0x3478ed[_0x3ed2('0x23')]+_0x3478ed[_0x3ed2('0x24')];var _0x4091cb;if(_0x25f6b8>=_0x26a993){_0x25f6b8=_0x26a993;_0x4091cb=0xc8;}else{_0x4091cb=0xce;}_0x563a10[_0x3ed2('0x21')](_0x4091cb);return _0x563a10[_0x3ed2('0x26')]('Content-Range',_0x28a1e0+'-'+_0x25f6b8+'/'+_0x26a993)[_0x3ed2('0x22')](_0x4590d1);}return null;};}function patchUpdates(_0x5c7dd3){return function(_0x51b76b){try{jsonpatch[_0x3ed2('0x27')](_0x51b76b,_0x5c7dd3,!![]);}catch(_0x38354d){return BPromise['reject'](_0x38354d);}return _0x51b76b['save']();};}function saveUpdates(_0x5a382e,_0x34e4b2){return function(_0x5bd08d){if(_0x5bd08d){return _0x5bd08d[_0x3ed2('0x28')](_0x5a382e)[_0x3ed2('0x29')](function(_0x1a4a5e){return _0x1a4a5e;});}return null;};}function removeEntity(_0x2d16a8,_0x232912){return function(_0x5737ca){if(_0x5737ca){return _0x5737ca[_0x3ed2('0x2a')]()[_0x3ed2('0x29')](function(){var _0x471193=_0x5737ca['get']({'plain':!![]});var _0x47b6f6=_0x3ed2('0x2b');return db[_0x3ed2('0x2c')][_0x3ed2('0x2a')]({'where':{'type':_0x47b6f6,'resourceId':_0x471193['id']}})[_0x3ed2('0x29')](function(){return _0x5737ca;});})['then'](function(){_0x2d16a8[_0x3ed2('0x21')](0xcc)[_0x3ed2('0x20')]();});}};}function handleEntityNotFound(_0x473d6a,_0x961637){return function(_0x2b3b97){if(!_0x2b3b97){_0x473d6a[_0x3ed2('0x2d')](0x194);}return _0x2b3b97;};}function handleError(_0x273b56,_0x41400e){_0x41400e=_0x41400e||0x1f4;return function(_0x5c1826){logger[_0x3ed2('0x2e')](_0x5c1826[_0x3ed2('0x2f')]);if(_0x5c1826[_0x3ed2('0x30')]){delete _0x5c1826[_0x3ed2('0x30')];}_0x273b56[_0x3ed2('0x21')](_0x41400e)[_0x3ed2('0x31')](_0x5c1826);};}exports['index']=function(_0x1f4a1e,_0x4454ef){var _0x1f45b8={},_0x1791b5={},_0x3af8be={'count':0x0,'rows':[]};var _0x3d89e4=_[_0x3ed2('0x32')](db[_0x3ed2('0x33')][_0x3ed2('0x34')],function(_0x3d2f64){return{'name':_0x3d2f64['fieldName'],'type':_0x3d2f64[_0x3ed2('0x35')][_0x3ed2('0x36')]};});_0x1791b5['model']=_['map'](_0x3d89e4,'name');_0x1791b5[_0x3ed2('0x37')]=_['keys'](_0x1f4a1e[_0x3ed2('0x37')]);_0x1791b5[_0x3ed2('0x38')]=_[_0x3ed2('0x39')](_0x1791b5[_0x3ed2('0x3a')],_0x1791b5[_0x3ed2('0x37')]);_0x1f45b8['attributes']=_['intersection'](_0x1791b5[_0x3ed2('0x3a')],qs[_0x3ed2('0x3b')](_0x1f4a1e[_0x3ed2('0x37')]['fields']));_0x1f45b8['attributes']=_0x1f45b8[_0x3ed2('0x3c')][_0x3ed2('0x3d')]?_0x1f45b8['attributes']:_0x1791b5['model'];if(!_0x1f4a1e[_0x3ed2('0x37')][_0x3ed2('0x3e')](_0x3ed2('0x3f'))){_0x1f45b8[_0x3ed2('0x24')]=qs[_0x3ed2('0x24')](_0x1f4a1e[_0x3ed2('0x37')]['limit']);_0x1f45b8[_0x3ed2('0x23')]=qs['offset'](_0x1f4a1e[_0x3ed2('0x37')][_0x3ed2('0x23')]);}_0x1f45b8[_0x3ed2('0x40')]=qs[_0x3ed2('0x41')](_0x1f4a1e[_0x3ed2('0x37')][_0x3ed2('0x41')]);_0x1f45b8[_0x3ed2('0x42')]=qs[_0x3ed2('0x38')](_[_0x3ed2('0x43')](_0x1f4a1e['query'],_0x1791b5[_0x3ed2('0x38')]),_0x3d89e4);if(_0x1f4a1e['query']['filter']){_0x1f45b8[_0x3ed2('0x42')]=_['merge'](_0x1f45b8['where'],{'$or':_[_0x3ed2('0x32')](_0x3d89e4,function(_0xb4d5bb){if(_0xb4d5bb[_0x3ed2('0x35')]!==_0x3ed2('0x44')){var _0x1cb6a8={};_0x1cb6a8[_0xb4d5bb['name']]={'$like':'%'+_0x1f4a1e[_0x3ed2('0x37')][_0x3ed2('0x45')]+'%'};return _0x1cb6a8;}})});}_0x1f45b8=_['merge']({},_0x1f45b8,_0x1f4a1e[_0x3ed2('0x46')]);var _0x3adbed={'where':_0x1f45b8[_0x3ed2('0x42')]};return db[_0x3ed2('0x33')][_0x3ed2('0x25')](_0x3adbed)[_0x3ed2('0x29')](function(_0xc4354b){_0x3af8be['count']=_0xc4354b;if(_0x1f4a1e[_0x3ed2('0x37')][_0x3ed2('0x47')]){_0x1f45b8[_0x3ed2('0x48')]=[{'all':!![]}];}return db[_0x3ed2('0x33')]['findAll'](_0x1f45b8);})[_0x3ed2('0x29')](function(_0x4c8012){_0x3af8be[_0x3ed2('0x49')]=_0x4c8012;return _0x3af8be;})[_0x3ed2('0x29')](respondWithFilteredResult(_0x4454ef,_0x1f45b8))[_0x3ed2('0x4a')](handleError(_0x4454ef,null));};exports[_0x3ed2('0x4b')]=function(_0xc15ddb,_0x20b667){var _0x13ee36={'raw':!![],'where':{'id':_0xc15ddb[_0x3ed2('0x4c')]['id']}},_0x3060da={};_0x3060da['model']=_['keys'](db[_0x3ed2('0x33')][_0x3ed2('0x34')]);_0x3060da[_0x3ed2('0x37')]=_[_0x3ed2('0x4d')](_0xc15ddb[_0x3ed2('0x37')]);_0x3060da[_0x3ed2('0x38')]=_['intersection'](_0x3060da[_0x3ed2('0x3a')],_0x3060da['query']);_0x13ee36['attributes']=_[_0x3ed2('0x39')](_0x3060da[_0x3ed2('0x3a')],qs['fields'](_0xc15ddb[_0x3ed2('0x37')][_0x3ed2('0x3b')]));_0x13ee36['attributes']=_0x13ee36[_0x3ed2('0x3c')][_0x3ed2('0x3d')]?_0x13ee36[_0x3ed2('0x3c')]:_0x3060da[_0x3ed2('0x3a')];if(_0xc15ddb['query'][_0x3ed2('0x47')]){_0x13ee36['include']=[{'all':!![]}];}_0x13ee36=_[_0x3ed2('0x4e')]({},_0x13ee36,_0xc15ddb['options']);return db[_0x3ed2('0x33')][_0x3ed2('0x4f')](_0x13ee36)[_0x3ed2('0x29')](handleEntityNotFound(_0x20b667,null))['then'](respondWithResult(_0x20b667,null))['catch'](handleError(_0x20b667,null));};exports[_0x3ed2('0x50')]=function(_0x54e911,_0x221080){return db['FaxQueue'][_0x3ed2('0x50')](_0x54e911['body'],{})[_0x3ed2('0x29')](function(_0x47ac8f){var _0x473beb=_0x54e911['user'][_0x3ed2('0x51')]({'plain':!![]});if(!_0x473beb)throw new Error(_0x3ed2('0x52'));if(_0x473beb[_0x3ed2('0x53')]==='user'){var _0x37c3ea=_0x47ac8f[_0x3ed2('0x51')]({'plain':!![]});var _0x445a48=_0x3ed2('0x2b');return db[_0x3ed2('0x54')][_0x3ed2('0x4f')]({'where':{'name':_0x445a48,'userProfileId':_0x473beb[_0x3ed2('0x55')]},'raw':!![]})['then'](function(_0x43dab9){if(_0x43dab9&&_0x43dab9['autoAssociation']===0x0){return db[_0x3ed2('0x2c')][_0x3ed2('0x50')]({'name':_0x37c3ea[_0x3ed2('0x30')],'resourceId':_0x37c3ea['id'],'type':_0x43dab9[_0x3ed2('0x30')],'sectionId':_0x43dab9['id']},{})[_0x3ed2('0x29')](function(){return _0x47ac8f;});}else{return _0x47ac8f;}})['catch'](function(_0x47e64a){logger[_0x3ed2('0x2e')](_0x3ed2('0x56'),_0x47e64a);throw _0x47e64a;});}return _0x47ac8f;})[_0x3ed2('0x29')](respondWithResult(_0x221080,0xc9))[_0x3ed2('0x4a')](handleError(_0x221080,null));};exports['update']=function(_0x5728a8,_0x4c6533){if(_0x5728a8['body']['id']){delete _0x5728a8[_0x3ed2('0x57')]['id'];}return db[_0x3ed2('0x33')]['find']({'where':{'id':_0x5728a8['params']['id']}})[_0x3ed2('0x29')](handleEntityNotFound(_0x4c6533,null))['then'](saveUpdates(_0x5728a8[_0x3ed2('0x57')],null))['then'](respondWithResult(_0x4c6533,null))[_0x3ed2('0x4a')](handleError(_0x4c6533,null));};exports['destroy']=function(_0x49aff1,_0x4d7408){return db[_0x3ed2('0x33')][_0x3ed2('0x4f')]({'where':{'id':_0x49aff1[_0x3ed2('0x4c')]['id']}})[_0x3ed2('0x29')](handleEntityNotFound(_0x4d7408,null))[_0x3ed2('0x29')](removeEntity(_0x4d7408,null))['catch'](handleError(_0x4d7408,null));};exports[_0x3ed2('0x58')]=function(_0x334a78,_0x2b5d80){return db[_0x3ed2('0x33')][_0x3ed2('0x58')]()['then'](respondWithResult(_0x2b5d80,null))[_0x3ed2('0x4a')](handleError(_0x2b5d80,null));};exports[_0x3ed2('0x59')]=function(_0x1e904b,_0x39e68e,_0xb0b3ed){var _0x3328bc={'raw':!![],'where':{}},_0x8b53e7={},_0x4141f4;return db['FaxQueue'][_0x3ed2('0x5a')]({'where':{'id':_0x1e904b[_0x3ed2('0x4c')]['id']}})[_0x3ed2('0x29')](handleEntityNotFound(_0x39e68e,null))[_0x3ed2('0x29')](function(_0x1cc2a0){if(_0x1cc2a0){_0x4141f4=_0x1cc2a0[_0x3ed2('0x51')]({'plain':!![]});_0x8b53e7[_0x3ed2('0x3a')]=_[_0x3ed2('0x4d')](db[_0x3ed2('0x5b')][_0x3ed2('0x34')]);_0x8b53e7['query']=_['keys'](_0x1e904b[_0x3ed2('0x37')]);_0x8b53e7['filters']=_[_0x3ed2('0x39')](_0x8b53e7['model'],_0x8b53e7[_0x3ed2('0x37')]);_0x3328bc['attributes']=_[_0x3ed2('0x39')](_0x8b53e7[_0x3ed2('0x3a')],qs[_0x3ed2('0x3b')](_0x1e904b[_0x3ed2('0x37')]['fields']));_0x3328bc[_0x3ed2('0x3c')]=_0x3328bc[_0x3ed2('0x3c')][_0x3ed2('0x3d')]?_0x3328bc['attributes']:_0x8b53e7[_0x3ed2('0x3a')];if(!_0x1e904b['query']['hasOwnProperty']('nolimit')){_0x3328bc[_0x3ed2('0x24')]=qs[_0x3ed2('0x24')](_0x1e904b[_0x3ed2('0x37')][_0x3ed2('0x24')]);_0x3328bc[_0x3ed2('0x23')]=qs[_0x3ed2('0x23')](_0x1e904b[_0x3ed2('0x37')][_0x3ed2('0x23')]);}_0x3328bc[_0x3ed2('0x40')]=qs['sort'](_0x1e904b[_0x3ed2('0x37')][_0x3ed2('0x41')]);_0x3328bc[_0x3ed2('0x42')]=qs[_0x3ed2('0x38')](_[_0x3ed2('0x43')](_0x1e904b['query'],_0x8b53e7[_0x3ed2('0x38')]));_0x3328bc[_0x3ed2('0x42')]['FaxQueueId']=_0x1cc2a0['id'];if(_0x1e904b['query'][_0x3ed2('0x45')]){_0x3328bc[_0x3ed2('0x42')]=_[_0x3ed2('0x4e')](_0x3328bc[_0x3ed2('0x42')],{'$or':_['map'](_0x3328bc[_0x3ed2('0x3c')],function(_0x1a058d){var _0xdb46f1={};_0xdb46f1[_0x1a058d]={'$like':'%'+_0x1e904b['query'][_0x3ed2('0x45')]+'%'};return _0xdb46f1;})});}_0x3328bc=_[_0x3ed2('0x4e')]({},_0x3328bc,_0x1e904b[_0x3ed2('0x46')]);return db[_0x3ed2('0x5b')][_0x3ed2('0x5c')](_0x3328bc);}})[_0x3ed2('0x29')](function(_0xc933c){if(_0xc933c){return db['User']['findAndCountAll']({'where':{'id':_['map'](_0xc933c,_0x3ed2('0x5d')),'role':'agent'},'attributes':['id',_0x3ed2('0x30'),_0x3ed2('0x5e'),_0x3ed2('0x5f'),_0x3ed2('0x60')]});}})[_0x3ed2('0x29')](function(_0x48de5e){if(_0x48de5e){return{'count':_0x48de5e[_0x3ed2('0x25')],'rows':_[_0x3ed2('0x32')](_0x48de5e[_0x3ed2('0x49')],function(_0x6a54c5){return{'membername':_0x6a54c5[_0x3ed2('0x30')],'UserId':_0x6a54c5['id'],'queue_name':_0x4141f4['name'],'FaxQueueId':_0x4141f4['id'],'interface':util[_0x3ed2('0x61')](_0x3ed2('0x62'),'SIP',_0x6a54c5[_0x3ed2('0x30')]),'penalty':0x0,'paused':_0x6a54c5[_0x3ed2('0x5e')],'createdAt':_0x6a54c5[_0x3ed2('0x60')],'updatedAt':_0x6a54c5[_0x3ed2('0x5f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x3ed2('0x29')](respondWithFilteredResult(_0x39e68e,_0x3328bc))['catch'](handleError(_0x39e68e,null));};exports['getTeams']=function(_0x1c11a9,_0x5952e0,_0x586b2c){var _0x3962df={};var _0x57570f={};var _0x27ed96;var _0x4f85ff;return db[_0x3ed2('0x33')][_0x3ed2('0x5a')]({'where':{'id':_0x1c11a9[_0x3ed2('0x4c')]['id']}})[_0x3ed2('0x29')](handleEntityNotFound(_0x5952e0,null))[_0x3ed2('0x29')](function(_0x5e666f){if(_0x5e666f){_0x27ed96=_0x5e666f;_0x57570f[_0x3ed2('0x3a')]=_[_0x3ed2('0x4d')](db[_0x3ed2('0x63')]['rawAttributes']);_0x57570f['query']=_[_0x3ed2('0x4d')](_0x1c11a9[_0x3ed2('0x37')]);_0x57570f[_0x3ed2('0x38')]=_['intersection'](_0x57570f[_0x3ed2('0x3a')],_0x57570f['query']);_0x3962df[_0x3ed2('0x3c')]=_['intersection'](_0x57570f[_0x3ed2('0x3a')],qs[_0x3ed2('0x3b')](_0x1c11a9[_0x3ed2('0x37')][_0x3ed2('0x3b')]));_0x3962df[_0x3ed2('0x3c')]=_0x3962df[_0x3ed2('0x3c')]['length']?_0x3962df[_0x3ed2('0x3c')]:_0x57570f[_0x3ed2('0x3a')];_0x3962df[_0x3ed2('0x40')]=qs[_0x3ed2('0x41')](_0x1c11a9['query'][_0x3ed2('0x41')]);_0x3962df['where']=qs[_0x3ed2('0x38')](_[_0x3ed2('0x43')](_0x1c11a9[_0x3ed2('0x37')],_0x57570f[_0x3ed2('0x38')]));if(_0x1c11a9[_0x3ed2('0x37')][_0x3ed2('0x45')]){_0x3962df['where']=_[_0x3ed2('0x4e')](_0x3962df[_0x3ed2('0x42')],{'$or':_[_0x3ed2('0x32')](_0x3962df[_0x3ed2('0x3c')],function(_0x5c8aca){var _0x43ee9d={};_0x43ee9d[_0x5c8aca]={'$like':'%'+_0x1c11a9[_0x3ed2('0x37')][_0x3ed2('0x45')]+'%'};return _0x43ee9d;})});}_0x3962df=_[_0x3ed2('0x4e')]({},_0x3962df,_0x1c11a9[_0x3ed2('0x46')]);return _0x27ed96['getTeams'](_0x3962df);}})[_0x3ed2('0x29')](function(_0x209dcb){if(_0x209dcb){_0x4f85ff=_0x209dcb[_0x3ed2('0x3d')];if(!_0x1c11a9[_0x3ed2('0x37')][_0x3ed2('0x3e')](_0x3ed2('0x3f'))){_0x3962df[_0x3ed2('0x24')]=qs[_0x3ed2('0x24')](_0x1c11a9[_0x3ed2('0x37')]['limit']);_0x3962df['offset']=qs['offset'](_0x1c11a9[_0x3ed2('0x37')]['offset']);}return _0x27ed96[_0x3ed2('0x64')](_0x3962df);}})[_0x3ed2('0x29')](function(_0x31e1a5){if(_0x31e1a5){return _0x31e1a5?{'count':_0x4f85ff,'rows':_0x31e1a5}:null;}})[_0x3ed2('0x29')](respondWithResult(_0x5952e0,null))['catch'](handleError(_0x5952e0,null));};exports[_0x3ed2('0x65')]=function(_0x127ca7,_0x4a94bd,_0x4d7a8f){var _0x3bae92=_0x127ca7[_0x3ed2('0x57')]['ids'];return db[_0x3ed2('0x63')][_0x3ed2('0x5c')]({'where':{'id':_0x3bae92},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0x3ed2('0x30'),'online','voicePause','interface'],'raw':!![]}]})[_0x3ed2('0x29')](function(_0x25c75b){if(_0x25c75b){var _0x44d241=_[_0x3ed2('0x66')](_0x25c75b,function(_0x5f49a4){var _0x149ddf=_0x5f49a4[_0x3ed2('0x51')]({'plain':!![]});return _0x149ddf[_0x3ed2('0x67')];});return db[_0x3ed2('0x33')]['find']({'where':{'id':_0x127ca7[_0x3ed2('0x4c')]['id']}})[_0x3ed2('0x29')](function(_0xd9058e){return db['sequelize'][_0x3ed2('0x68')](function(_0x48b996){return _0xd9058e[_0x3ed2('0x65')](_0x3bae92,{'transaction':_0x48b996})[_0x3ed2('0x29')](function(){return BPromise[_0x3ed2('0x69')](_0x44d241,function(_0x471a59){return db[_0x3ed2('0x5b')][_0x3ed2('0x6a')]({'where':{'UserId':_0x471a59['id'],'FaxQueueId':_0x127ca7[_0x3ed2('0x4c')]['id']},'transaction':_0x48b996});});})[_0x3ed2('0x29')](function(){_0x44d241['forEach'](function(_0x77e6a4){socket[_0x3ed2('0x6b')]('userFaxQueue:save',{'UserId':_0x77e6a4['id'],'FaxQueueId':_0xd9058e['id']});});});});});}})[_0x3ed2('0x29')](respondWithStatusCode(_0x4a94bd,null))[_0x3ed2('0x4a')](handleError(_0x4a94bd,null));};exports['removeTeams']=function(_0x121639,_0x17a8ea,_0x4085f4){return db[_0x3ed2('0x63')]['findAll']({'where':{'id':_0x121639['query'][_0x3ed2('0x6c')]},'attributes':['id'],'include':[{'model':db[_0x3ed2('0x6d')],'as':_0x3ed2('0x67'),'attributes':['id'],'raw':!![]}]})[_0x3ed2('0x29')](handleEntityNotFound(_0x17a8ea,null))[_0x3ed2('0x29')](function(_0x15c54f){var _0x1105da=_['map'](_0x15c54f,'id');var _0x56b16d=[];var _0x197ff9=[];var _0x15a1b2=squel[_0x3ed2('0x6e')]();_0x15a1b2[_0x3ed2('0x6f')](_0x3ed2('0x70'))[_0x3ed2('0x71')]('team_has_fax_queues','tq')[_0x3ed2('0x72')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0x3ed2('0x73'),_0x121639[_0x3ed2('0x4c')]['id']);for(var _0x272abc=0x0;_0x272abc<_0x15c54f[_0x3ed2('0x3d')];_0x272abc+=0x1){let _0x4fb020=_0x15c54f[_0x272abc];for(var _0x10973d=0x0;_0x10973d<_0x4fb020[_0x3ed2('0x67')][_0x3ed2('0x3d')];_0x10973d+=0x1){let _0x208e28=_0x4fb020[_0x3ed2('0x67')][_0x10973d];var _0x2e3603=_0x15a1b2[_0x3ed2('0x74')]();_0x2e3603[_0x3ed2('0x42')](_0x3ed2('0x75'),_0x208e28['id']);_0x197ff9[_0x3ed2('0x76')](db['sequelize'][_0x3ed2('0x37')](_0x2e3603[_0x3ed2('0x77')](),{'type':db['sequelize'][_0x3ed2('0x78')][_0x3ed2('0x79')]})[_0x3ed2('0x29')](function(_0x45fd08){if(_0x45fd08[_0x3ed2('0x3d')]===0x1){return _0x208e28['id'];}else{var _0x12f3fd=_[_0x3ed2('0x7a')](_['map'](_0x45fd08,'TeamId'),function(_0x498db4){return _[_0x3ed2('0x7b')](_0x1105da,_0x498db4);});if(_0x12f3fd){return _0x208e28['id'];}}}));}}return BPromise['all'](_0x197ff9)[_0x3ed2('0x29')](function(_0x11f8e9){_0x56b16d=_(_0x56b16d)[_0x3ed2('0x7c')](_0x11f8e9)[_0x3ed2('0x7d')]()[_0x3ed2('0x7e')]();return db[_0x3ed2('0x33')][_0x3ed2('0x4f')]({'where':{'id':_0x121639[_0x3ed2('0x4c')]['id']}})[_0x3ed2('0x29')](function(_0x45ce78){return db[_0x3ed2('0x7f')]['transaction'](function(_0x450a00){return _0x45ce78[_0x3ed2('0x80')](_0x121639['query'][_0x3ed2('0x6c')],{'transaction':_0x450a00})[_0x3ed2('0x29')](function(){if(!_['isEmpty'](_0x56b16d)){return _0x45ce78[_0x3ed2('0x81')](_0x56b16d,{'transaction':_0x450a00});}})['then'](function(){_0x56b16d[_0x3ed2('0x82')](function(_0x1ded26){socket[_0x3ed2('0x6b')](_0x3ed2('0x83'),{'UserId':_0x1ded26,'FaxQueueId':_0x45ce78['id']});});});});});});})[_0x3ed2('0x29')](respondWithStatusCode(_0x17a8ea,null))[_0x3ed2('0x4a')](handleError(_0x17a8ea,null));};exports[_0x3ed2('0x84')]=function(_0x23f3fe,_0xaa007,_0x10c985){return db[_0x3ed2('0x33')][_0x3ed2('0x4f')]({'where':{'id':_0x23f3fe[_0x3ed2('0x4c')]['id']}})[_0x3ed2('0x29')](handleEntityNotFound(_0xaa007,null))[_0x3ed2('0x29')](function(_0x41f194){if(_0x41f194){return _0x41f194[_0x3ed2('0x84')](_0x23f3fe[_0x3ed2('0x57')][_0x3ed2('0x6c')],_['omit'](_0x23f3fe[_0x3ed2('0x57')],['ids','id'])||{})[_0x3ed2('0x85')](function(_0x23b4cc){for(var _0xe507d2=0x0;_0xe507d2<_0x23f3fe[_0x3ed2('0x57')]['ids'][_0x3ed2('0x3d')];_0xe507d2+=0x1){socket[_0x3ed2('0x6b')](_0x3ed2('0x86'),{'UserId':Number(_0x23f3fe[_0x3ed2('0x57')][_0x3ed2('0x6c')][_0xe507d2]),'FaxQueueId':Number(_0x23f3fe[_0x3ed2('0x4c')]['id'])});}return _0x23b4cc;});}})[_0x3ed2('0x29')](respondWithResult(_0xaa007,null))['catch'](handleError(_0xaa007,null));};exports[_0x3ed2('0x81')]=function(_0x314150,_0x202455,_0x32edad){return db[_0x3ed2('0x33')][_0x3ed2('0x4f')]({'where':{'id':_0x314150['params']['id']}})[_0x3ed2('0x29')](handleEntityNotFound(_0x202455,null))[_0x3ed2('0x29')](function(_0x262d78){if(_0x262d78){return _0x262d78[_0x3ed2('0x81')](_0x314150[_0x3ed2('0x37')][_0x3ed2('0x6c')])['then'](function(){if(_[_0x3ed2('0x87')](_0x314150[_0x3ed2('0x37')][_0x3ed2('0x6c')])){for(var _0x58da2f=0x0;_0x58da2f<_0x314150[_0x3ed2('0x37')][_0x3ed2('0x6c')][_0x3ed2('0x3d')];_0x58da2f+=0x1){socket[_0x3ed2('0x6b')](_0x3ed2('0x83'),{'UserId':Number(_0x314150[_0x3ed2('0x37')][_0x3ed2('0x6c')][_0x58da2f]),'FaxQueueId':Number(_0x314150[_0x3ed2('0x4c')]['id'])});}}else{socket['emit'](_0x3ed2('0x83'),{'UserId':Number(_0x314150[_0x3ed2('0x37')][_0x3ed2('0x6c')]),'FaxQueueId':Number(_0x314150[_0x3ed2('0x4c')]['id'])});}});}})[_0x3ed2('0x29')](respondWithStatusCode(_0x202455,null))['catch'](handleError(_0x202455,null));};exports[_0x3ed2('0x88')]=function(_0x123e64,_0x39a42c,_0x32be47){var _0x52127d={};var _0x48cc2f={};var _0x2c3f40;var _0x101a1e;return db[_0x3ed2('0x33')][_0x3ed2('0x5a')]({'where':{'id':_0x123e64[_0x3ed2('0x4c')]['id']}})['then'](handleEntityNotFound(_0x39a42c,null))['then'](function(_0x432fd8){if(_0x432fd8){_0x2c3f40=_0x432fd8;_0x48cc2f[_0x3ed2('0x3a')]=_[_0x3ed2('0x4d')](db[_0x3ed2('0x6d')][_0x3ed2('0x34')]);_0x48cc2f['query']=_[_0x3ed2('0x4d')](_0x123e64[_0x3ed2('0x37')]);_0x48cc2f[_0x3ed2('0x38')]=_[_0x3ed2('0x39')](_0x48cc2f[_0x3ed2('0x3a')],_0x48cc2f[_0x3ed2('0x37')]);_0x52127d['attributes']=_[_0x3ed2('0x39')](_0x48cc2f[_0x3ed2('0x3a')],qs[_0x3ed2('0x3b')](_0x123e64['query'][_0x3ed2('0x3b')]));_0x52127d[_0x3ed2('0x3c')]=_0x52127d[_0x3ed2('0x3c')]['length']?_0x52127d['attributes']:_0x48cc2f['model'];_0x52127d['order']=qs[_0x3ed2('0x41')](_0x123e64[_0x3ed2('0x37')][_0x3ed2('0x41')]);_0x52127d[_0x3ed2('0x42')]=qs[_0x3ed2('0x38')](_[_0x3ed2('0x43')](_0x123e64[_0x3ed2('0x37')],_0x48cc2f[_0x3ed2('0x38')]));if(_0x123e64[_0x3ed2('0x37')][_0x3ed2('0x45')]){_0x52127d['where']=_[_0x3ed2('0x4e')](_0x52127d[_0x3ed2('0x42')],{'$or':_[_0x3ed2('0x32')](_0x52127d['attributes'],function(_0x4df986){var _0x210186={};_0x210186[_0x4df986]={'$like':'%'+_0x123e64[_0x3ed2('0x37')][_0x3ed2('0x45')]+'%'};return _0x210186;})});}_0x52127d=_[_0x3ed2('0x4e')]({},_0x52127d,_0x123e64[_0x3ed2('0x46')]);return _0x2c3f40['getAgents'](_0x52127d);}})[_0x3ed2('0x29')](function(_0x3123d5){if(_0x3123d5){_0x101a1e=_0x3123d5['length'];if(!_0x123e64['query'][_0x3ed2('0x3e')](_0x3ed2('0x3f'))){_0x52127d['limit']=qs['limit'](_0x123e64[_0x3ed2('0x37')][_0x3ed2('0x24')]);_0x52127d[_0x3ed2('0x23')]=qs['offset'](_0x123e64['query']['offset']);}return _0x2c3f40['getAgents'](_0x52127d);}})['then'](function(_0x11bc31){if(_0x11bc31){return _0x11bc31?{'count':_0x101a1e,'rows':_0x11bc31}:null;}})[_0x3ed2('0x29')](respondWithResult(_0x39a42c,null))['catch'](handleError(_0x39a42c,null));};
\ No newline at end of file
index f186d19..ae888dc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x93bf=['save','update','remove','emit','hasOwnProperty','hook','exports','events','FaxQueue','setMaxListeners'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x93bf,0x1dd));var _0xf93b=function(_0xe34287,_0x2cdbde){_0xe34287=_0xe34287-0x0;var _0x1c9f20=_0x93bf[_0xe34287];return _0x1c9f20;};'use strict';var EventEmitter=require(_0xf93b('0x0'));var FaxQueue=require('../../mysqldb')['db'][_0xf93b('0x1')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0xf93b('0x2')](0x0);var events={'afterCreate':_0xf93b('0x3'),'afterUpdate':_0xf93b('0x4'),'afterDestroy':_0xf93b('0x5')};function emitEvent(_0x36a0c2){return function(_0x1bf8f3,_0x265abf,_0x2cb7e5){FaxQueueEvents['emit'](_0x36a0c2+':'+_0x1bf8f3['id'],_0x1bf8f3);FaxQueueEvents[_0xf93b('0x6')](_0x36a0c2,_0x1bf8f3);_0x2cb7e5(null);};}for(var e in events){if(events[_0xf93b('0x7')](e)){var event=events[e];FaxQueue[_0xf93b('0x8')](e,emitEvent(event));}}module[_0xf93b('0x9')]=FaxQueueEvents;
\ No newline at end of file
+var _0xc3cc=['events','save','update','remove','emit','hasOwnProperty','exports'];(function(_0xbe40ad,_0x44343c){var _0x50fac9=function(_0xdaed07){while(--_0xdaed07){_0xbe40ad['push'](_0xbe40ad['shift']());}};_0x50fac9(++_0x44343c);}(_0xc3cc,0x1ce));var _0xcc3c=function(_0x23e02e,_0x4d26cb){_0x23e02e=_0x23e02e-0x0;var _0x2a6db8=_0xc3cc[_0x23e02e];return _0x2a6db8;};'use strict';var EventEmitter=require(_0xcc3c('0x0'));var FaxQueue=require('../../mysqldb')['db']['FaxQueue'];var FaxQueueEvents=new EventEmitter();FaxQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xcc3c('0x1'),'afterUpdate':_0xcc3c('0x2'),'afterDestroy':_0xcc3c('0x3')};function emitEvent(_0x565db9){return function(_0x24caaa,_0x4a7c1e,_0x3d48c2){FaxQueueEvents[_0xcc3c('0x4')](_0x565db9+':'+_0x24caaa['id'],_0x24caaa);FaxQueueEvents[_0xcc3c('0x4')](_0x565db9,_0x24caaa);_0x3d48c2(null);};}for(var e in events){if(events[_0xcc3c('0x5')](e)){var event=events[e];FaxQueue['hook'](e,emitEvent(event));}}module[_0xcc3c('0x6')]=FaxQueueEvents;
\ No newline at end of file
index 208635b..b856f57 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbc73=['FaxQueue','fax_queues','lodash','../../config/logger','api','moment','bluebird','request-promise','path','./faxQueue.attributes','exports','define'];(function(_0x356d8e,_0x506867){var _0x358c01=function(_0x591aa7){while(--_0x591aa7){_0x356d8e['push'](_0x356d8e['shift']());}};_0x358c01(++_0x506867);}(_0xbc73,0x19a));var _0x3bc7=function(_0x587ba2,_0x42eb40){_0x587ba2=_0x587ba2-0x0;var _0x50ec73=_0xbc73[_0x587ba2];return _0x50ec73;};'use strict';var _=require(_0x3bc7('0x0'));var util=require('util');var logger=require(_0x3bc7('0x1'))(_0x3bc7('0x2'));var moment=require(_0x3bc7('0x3'));var BPromise=require(_0x3bc7('0x4'));var rp=require(_0x3bc7('0x5'));var fs=require('fs');var path=require(_0x3bc7('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x3bc7('0x7'));module[_0x3bc7('0x8')]=function(_0x3d3880,_0x416840){return _0x3d3880[_0x3bc7('0x9')](_0x3bc7('0xa'),attributes,{'tableName':_0x3bc7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe413=['fax_queues','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueue.attributes','exports','define','FaxQueue'];(function(_0x36790f,_0x46a2c6){var _0x36103b=function(_0x1e0dec){while(--_0x1e0dec){_0x36790f['push'](_0x36790f['shift']());}};_0x36103b(++_0x46a2c6);}(_0xe413,0x9d));var _0x3e41=function(_0x95d9e9,_0x1754f7){_0x95d9e9=_0x95d9e9-0x0;var _0x5013a1=_0xe413[_0x95d9e9];return _0x5013a1;};'use strict';var _=require('lodash');var util=require(_0x3e41('0x0'));var logger=require('../../config/logger')(_0x3e41('0x1'));var moment=require(_0x3e41('0x2'));var BPromise=require(_0x3e41('0x3'));var rp=require(_0x3e41('0x4'));var fs=require('fs');var path=require(_0x3e41('0x5'));var rimraf=require(_0x3e41('0x6'));var config=require(_0x3e41('0x7'));var attributes=require(_0x3e41('0x8'));module[_0x3e41('0x9')]=function(_0x2610bd,_0x48006e){return _0x2610bd[_0x3e41('0xa')](_0x3e41('0xb'),attributes,{'tableName':_0x3e41('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 39763b0..54ff94d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xac5e=['FaxQueue','find','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','register','then','info','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetFaxQueue','findAll','options','raw','where','attributes','include','model','map','catch','ShowFaxQueue'];(function(_0x138a38,_0x4e80ff){var _0x108744=function(_0x4a2e40){while(--_0x4a2e40){_0x138a38['push'](_0x138a38['shift']());}};_0x108744(++_0x4e80ff);}(_0xac5e,0xaa));var _0xeac5=function(_0x50610a,_0x3a724a){_0x50610a=_0x50610a-0x0;var _0xebe917=_0xac5e[_0x50610a];return _0xebe917;};'use strict';var _=require(_0xeac5('0x0'));var util=require('util');var moment=require(_0xeac5('0x1'));var BPromise=require(_0xeac5('0x2'));var rs=require(_0xeac5('0x3'));var fs=require('fs');var Redis=require(_0xeac5('0x4'));var db=require(_0xeac5('0x5'))['db'];var utils=require(_0xeac5('0x6'));var logger=require(_0xeac5('0x7'))(_0xeac5('0x8'));var config=require(_0xeac5('0x9'));var jayson=require(_0xeac5('0xa'));var client=jayson[_0xeac5('0xb')][_0xeac5('0xc')]({'port':0x232a});config['redis']=_[_0xeac5('0xd')](config[_0xeac5('0xe')],{'host':_0xeac5('0xf'),'port':0x18eb});var socket=require(_0xeac5('0x10'))(new Redis(config[_0xeac5('0xe')]));require('./faxQueue.socket')[_0xeac5('0x11')](socket);function respondWithRpcPromise(_0x1d8c1e,_0x3332ce,_0x71a870){return new BPromise(function(_0x77f0cb,_0x366c07){return client['request'](_0x1d8c1e,_0x71a870)[_0xeac5('0x12')](function(_0x17eaf4){logger[_0xeac5('0x13')](_0xeac5('0x14'),_0x3332ce,_0xeac5('0x15'));logger[_0xeac5('0x16')](_0xeac5('0x17'),_0x3332ce,_0xeac5('0x15'),JSON[_0xeac5('0x18')](_0x17eaf4));if(_0x17eaf4[_0xeac5('0x19')]){if(_0x17eaf4[_0xeac5('0x19')][_0xeac5('0x1a')]===0x1f4){logger[_0xeac5('0x19')](_0xeac5('0x14'),_0x3332ce,_0x17eaf4[_0xeac5('0x19')]['message']);return _0x366c07(_0x17eaf4[_0xeac5('0x19')][_0xeac5('0x1b')]);}logger[_0xeac5('0x19')](_0xeac5('0x14'),_0x3332ce,_0x17eaf4[_0xeac5('0x19')]['message']);return _0x77f0cb(_0x17eaf4[_0xeac5('0x19')]['message']);}else{logger[_0xeac5('0x13')](_0xeac5('0x14'),_0x3332ce,_0xeac5('0x15'));_0x77f0cb(_0x17eaf4[_0xeac5('0x1c')][_0xeac5('0x1b')]);}})['catch'](function(_0x5a1d73){logger[_0xeac5('0x19')](_0xeac5('0x14'),_0x3332ce,_0x5a1d73);_0x366c07(_0x5a1d73);});});}exports[_0xeac5('0x1d')]=function(_0xfc5f8f){var _0x398ee1=this;return new Promise(function(_0x54964c,_0x2a8429){return db['FaxQueue'][_0xeac5('0x1e')]({'raw':_0xfc5f8f[_0xeac5('0x1f')]?_0xfc5f8f['options'][_0xeac5('0x20')]===undefined?!![]:![]:!![],'where':_0xfc5f8f[_0xeac5('0x1f')]?_0xfc5f8f['options'][_0xeac5('0x21')]||null:null,'attributes':_0xfc5f8f['options']?_0xfc5f8f[_0xeac5('0x1f')][_0xeac5('0x22')]||null:null,'limit':_0xfc5f8f[_0xeac5('0x1f')]?_0xfc5f8f['options']['limit']||null:null,'include':_0xfc5f8f[_0xeac5('0x1f')]?_0xfc5f8f[_0xeac5('0x1f')][_0xeac5('0x23')]?_['map'](_0xfc5f8f[_0xeac5('0x1f')][_0xeac5('0x23')],function(_0x2a600c){return{'model':db[_0x2a600c[_0xeac5('0x24')]],'as':_0x2a600c['as'],'attributes':_0x2a600c['attributes'],'include':_0x2a600c[_0xeac5('0x23')]?_[_0xeac5('0x25')](_0x2a600c[_0xeac5('0x23')],function(_0x12b52b){return{'model':db[_0x12b52b['model']],'as':_0x12b52b['as'],'attributes':_0x12b52b['attributes'],'include':_0x12b52b[_0xeac5('0x23')]?_['map'](_0x12b52b[_0xeac5('0x23')],function(_0x298c12){return{'model':db[_0x298c12[_0xeac5('0x24')]],'as':_0x298c12['as'],'attributes':_0x298c12[_0xeac5('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x122d20){logger[_0xeac5('0x13')](_0xeac5('0x1d'),_0xfc5f8f);logger[_0xeac5('0x16')](_0xeac5('0x1d'),_0xfc5f8f,JSON[_0xeac5('0x18')](_0x122d20));_0x54964c(_0x122d20);})[_0xeac5('0x26')](function(_0x1ea036){logger[_0xeac5('0x19')](_0xeac5('0x1d'),_0x1ea036[_0xeac5('0x1b')],_0xfc5f8f);_0x2a8429(_0x398ee1['error'](0x1f4,_0x1ea036[_0xeac5('0x1b')]));});});};exports[_0xeac5('0x27')]=function(_0x5c1174){var _0x5d7a46=this;return new Promise(function(_0x431a90,_0x34f00d){return db[_0xeac5('0x28')][_0xeac5('0x29')]({'raw':_0x5c1174['options']?_0x5c1174[_0xeac5('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x5c1174[_0xeac5('0x1f')]?_0x5c1174[_0xeac5('0x1f')][_0xeac5('0x21')]||null:null,'attributes':_0x5c1174['options']?_0x5c1174[_0xeac5('0x1f')][_0xeac5('0x22')]||null:null,'include':_0x5c1174[_0xeac5('0x1f')]?_0x5c1174[_0xeac5('0x1f')][_0xeac5('0x23')]?_[_0xeac5('0x25')](_0x5c1174[_0xeac5('0x1f')][_0xeac5('0x23')],function(_0x2375c3){return{'model':db[_0x2375c3[_0xeac5('0x24')]],'as':_0x2375c3['as'],'attributes':_0x2375c3[_0xeac5('0x22')],'include':_0x2375c3[_0xeac5('0x23')]?_[_0xeac5('0x25')](_0x2375c3[_0xeac5('0x23')],function(_0x25265a){return{'model':db[_0x25265a[_0xeac5('0x24')]],'as':_0x25265a['as'],'attributes':_0x25265a[_0xeac5('0x22')],'include':_0x25265a[_0xeac5('0x23')]?_[_0xeac5('0x25')](_0x25265a[_0xeac5('0x23')],function(_0x2c7f4f){return{'model':db[_0x2c7f4f['model']],'as':_0x2c7f4f['as'],'attributes':_0x2c7f4f['attributes']};}):[]};}):[]};}):[]:[]})[_0xeac5('0x12')](function(_0xf141e){logger[_0xeac5('0x13')](_0xeac5('0x27'),_0x5c1174);logger['debug']('ShowFaxQueue',_0x5c1174,JSON[_0xeac5('0x18')](_0xf141e));_0x431a90(_0xf141e);})[_0xeac5('0x26')](function(_0x11226f){logger[_0xeac5('0x19')](_0xeac5('0x27'),_0x11226f['message'],_0x5c1174);_0x34f00d(_0x5d7a46[_0xeac5('0x19')](0x1f4,_0x11226f[_0xeac5('0x1b')]));});});};
\ No newline at end of file
+var _0x0bb4=['register','request','request\x20sent','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','FaxQueue,\x20%s,\x20%s','message','result','catch','GetFaxQueue','FaxQueue','findAll','options','where','attributes','limit','include','map','model','debug','ShowFaxQueue','find','raw','lodash','util','bluebird','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','defaults','redis','./faxQueue.socket'];(function(_0x2338fa,_0x80579a){var _0x42df9b=function(_0x13fe56){while(--_0x13fe56){_0x2338fa['push'](_0x2338fa['shift']());}};_0x42df9b(++_0x80579a);}(_0x0bb4,0x7e));var _0x40bb=function(_0x412e09,_0x491e8d){_0x412e09=_0x412e09-0x0;var _0x55b506=_0x0bb4[_0x412e09];return _0x55b506;};'use strict';var _=require(_0x40bb('0x0'));var util=require(_0x40bb('0x1'));var moment=require('moment');var BPromise=require(_0x40bb('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x40bb('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x40bb('0x4'))('rpc');var config=require(_0x40bb('0x5'));var jayson=require(_0x40bb('0x6'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0x40bb('0x7')](config[_0x40bb('0x8')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x40bb('0x8')]));require(_0x40bb('0x9'))[_0x40bb('0xa')](socket);function respondWithRpcPromise(_0x1e8112,_0x2156af,_0x2496ec){return new BPromise(function(_0x1be62f,_0x6bbf1){return client[_0x40bb('0xb')](_0x1e8112,_0x2496ec)['then'](function(_0x11e4e8){logger['info']('FaxQueue,\x20%s,\x20%s',_0x2156af,_0x40bb('0xc'));logger['debug'](_0x40bb('0xd'),_0x2156af,'request\x20sent',JSON[_0x40bb('0xe')](_0x11e4e8));if(_0x11e4e8[_0x40bb('0xf')]){if(_0x11e4e8['error']['code']===0x1f4){logger[_0x40bb('0xf')](_0x40bb('0x10'),_0x2156af,_0x11e4e8[_0x40bb('0xf')][_0x40bb('0x11')]);return _0x6bbf1(_0x11e4e8[_0x40bb('0xf')][_0x40bb('0x11')]);}logger[_0x40bb('0xf')]('FaxQueue,\x20%s,\x20%s',_0x2156af,_0x11e4e8[_0x40bb('0xf')]['message']);return _0x1be62f(_0x11e4e8['error'][_0x40bb('0x11')]);}else{logger['info'](_0x40bb('0x10'),_0x2156af,_0x40bb('0xc'));_0x1be62f(_0x11e4e8[_0x40bb('0x12')][_0x40bb('0x11')]);}})[_0x40bb('0x13')](function(_0x89b035){logger[_0x40bb('0xf')](_0x40bb('0x10'),_0x2156af,_0x89b035);_0x6bbf1(_0x89b035);});});}exports[_0x40bb('0x14')]=function(_0x47dfac){var _0x5537ef=this;return new Promise(function(_0x910e45,_0xbfe893){return db[_0x40bb('0x15')][_0x40bb('0x16')]({'raw':_0x47dfac[_0x40bb('0x17')]?_0x47dfac[_0x40bb('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x47dfac[_0x40bb('0x17')]?_0x47dfac[_0x40bb('0x17')][_0x40bb('0x18')]||null:null,'attributes':_0x47dfac[_0x40bb('0x17')]?_0x47dfac[_0x40bb('0x17')][_0x40bb('0x19')]||null:null,'limit':_0x47dfac[_0x40bb('0x17')]?_0x47dfac['options'][_0x40bb('0x1a')]||null:null,'include':_0x47dfac[_0x40bb('0x17')]?_0x47dfac[_0x40bb('0x17')][_0x40bb('0x1b')]?_['map'](_0x47dfac['options'][_0x40bb('0x1b')],function(_0xadbebe){return{'model':db[_0xadbebe['model']],'as':_0xadbebe['as'],'attributes':_0xadbebe[_0x40bb('0x19')],'include':_0xadbebe[_0x40bb('0x1b')]?_[_0x40bb('0x1c')](_0xadbebe['include'],function(_0x2f3176){return{'model':db[_0x2f3176['model']],'as':_0x2f3176['as'],'attributes':_0x2f3176[_0x40bb('0x19')],'include':_0x2f3176[_0x40bb('0x1b')]?_['map'](_0x2f3176['include'],function(_0x15f652){return{'model':db[_0x15f652[_0x40bb('0x1d')]],'as':_0x15f652['as'],'attributes':_0x15f652[_0x40bb('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x75a677){logger['info'](_0x40bb('0x14'),_0x47dfac);logger[_0x40bb('0x1e')](_0x40bb('0x14'),_0x47dfac,JSON[_0x40bb('0xe')](_0x75a677));_0x910e45(_0x75a677);})[_0x40bb('0x13')](function(_0x554228){logger[_0x40bb('0xf')]('GetFaxQueue',_0x554228[_0x40bb('0x11')],_0x47dfac);_0xbfe893(_0x5537ef[_0x40bb('0xf')](0x1f4,_0x554228[_0x40bb('0x11')]));});});};exports[_0x40bb('0x1f')]=function(_0x3d2b90){var _0x5c1ffa=this;return new Promise(function(_0x52628b,_0x2757ef){return db[_0x40bb('0x15')][_0x40bb('0x20')]({'raw':_0x3d2b90[_0x40bb('0x17')]?_0x3d2b90[_0x40bb('0x17')][_0x40bb('0x21')]===undefined?!![]:![]:!![],'where':_0x3d2b90['options']?_0x3d2b90['options'][_0x40bb('0x18')]||null:null,'attributes':_0x3d2b90[_0x40bb('0x17')]?_0x3d2b90[_0x40bb('0x17')]['attributes']||null:null,'include':_0x3d2b90[_0x40bb('0x17')]?_0x3d2b90['options'][_0x40bb('0x1b')]?_[_0x40bb('0x1c')](_0x3d2b90[_0x40bb('0x17')][_0x40bb('0x1b')],function(_0x195717){return{'model':db[_0x195717[_0x40bb('0x1d')]],'as':_0x195717['as'],'attributes':_0x195717[_0x40bb('0x19')],'include':_0x195717[_0x40bb('0x1b')]?_[_0x40bb('0x1c')](_0x195717['include'],function(_0x2aa809){return{'model':db[_0x2aa809[_0x40bb('0x1d')]],'as':_0x2aa809['as'],'attributes':_0x2aa809['attributes'],'include':_0x2aa809[_0x40bb('0x1b')]?_[_0x40bb('0x1c')](_0x2aa809['include'],function(_0x2d78a7){return{'model':db[_0x2d78a7[_0x40bb('0x1d')]],'as':_0x2d78a7['as'],'attributes':_0x2d78a7[_0x40bb('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x30a6b5){logger['info'](_0x40bb('0x1f'),_0x3d2b90);logger[_0x40bb('0x1e')]('ShowFaxQueue',_0x3d2b90,JSON[_0x40bb('0xe')](_0x30a6b5));_0x52628b(_0x30a6b5);})['catch'](function(_0x24271d){logger[_0x40bb('0xf')](_0x40bb('0x1f'),_0x24271d['message'],_0x3d2b90);_0x2757ef(_0x5c1ffa[_0x40bb('0xf')](0x1f4,_0x24271d[_0x40bb('0x11')]));});});};
\ No newline at end of file
index 4193110..2ef8190 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6b36=['faxQueue:','./faxQueue.events','save','update','emit','removeListener','register','length'];(function(_0x13137e,_0x29c0f3){var _0x346261=function(_0x8c7d4f){while(--_0x8c7d4f){_0x13137e['push'](_0x13137e['shift']());}};_0x346261(++_0x29c0f3);}(_0x6b36,0x1d1));var _0x66b3=function(_0x5c4c83,_0x48e1ea){_0x5c4c83=_0x5c4c83-0x0;var _0x4dbeab=_0x6b36[_0x5c4c83];return _0x4dbeab;};'use strict';var FaxQueueEvents=require(_0x66b3('0x0'));var events=[_0x66b3('0x1'),'remove',_0x66b3('0x2')];function createListener(_0x3d2ec1,_0x5b7cd0){return function(_0x37217c){_0x5b7cd0[_0x66b3('0x3')](_0x3d2ec1,_0x37217c);};}function removeListener(_0x5a7e88,_0x50e6f4){return function(){FaxQueueEvents[_0x66b3('0x4')](_0x5a7e88,_0x50e6f4);};}exports[_0x66b3('0x5')]=function(_0x2d951f){for(var _0x4f4c1e=0x0,_0x3251d7=events[_0x66b3('0x6')];_0x4f4c1e<_0x3251d7;_0x4f4c1e++){var _0x22bbf3=events[_0x4f4c1e];var _0xd55971=createListener(_0x66b3('0x7')+_0x22bbf3,_0x2d951f);FaxQueueEvents['on'](_0x22bbf3,_0xd55971);}};
\ No newline at end of file
+var _0x7fcf=['removeListener','register','faxQueue:','save','remove','update','emit'];(function(_0x446d28,_0x4a0eab){var _0x3fcf3e=function(_0x1965e9){while(--_0x1965e9){_0x446d28['push'](_0x446d28['shift']());}};_0x3fcf3e(++_0x4a0eab);}(_0x7fcf,0xce));var _0xf7fc=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0x7fcf[_0x433a86];return _0x23000c;};'use strict';var FaxQueueEvents=require('./faxQueue.events');var events=[_0xf7fc('0x0'),_0xf7fc('0x1'),_0xf7fc('0x2')];function createListener(_0x4fd1d0,_0x1081aa){return function(_0x49a1f3){_0x1081aa[_0xf7fc('0x3')](_0x4fd1d0,_0x49a1f3);};}function removeListener(_0x4f89a6,_0x49538e){return function(){FaxQueueEvents[_0xf7fc('0x4')](_0x4f89a6,_0x49538e);};}exports[_0xf7fc('0x5')]=function(_0x11b96a){for(var _0x54325e=0x0,_0x87869b=events['length'];_0x54325e<_0x87869b;_0x54325e++){var _0x44007d=events[_0x54325e];var _0x246819=createListener(_0xf7fc('0x6')+_0x44007d,_0x11b96a);FaxQueueEvents['on'](_0x44007d,_0x246819);}};
\ No newline at end of file
index a323675..9d9d866 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5e0e=['get','isAuthenticated','index','/describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','create','post','addAgents','put','update','delete','removeTeams','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x150068,_0x14db51){var _0x8ca19b=function(_0x4c0126){while(--_0x4c0126){_0x150068['push'](_0x150068['shift']());}};_0x8ca19b(++_0x14db51);}(_0x5e0e,0x89));var _0xe5e0=function(_0x31c3be,_0x5e540f){_0x31c3be=_0x31c3be-0x0;var _0x48314d=_0x5e0e[_0x31c3be];return _0x48314d;};'use strict';var multer=require(_0xe5e0('0x0'));var util=require(_0xe5e0('0x1'));var path=require('path');var timeout=require(_0xe5e0('0x2'));var express=require(_0xe5e0('0x3'));var router=express[_0xe5e0('0x4')]();var fs_extra=require(_0xe5e0('0x5'));var auth=require(_0xe5e0('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xe5e0('0x7'));var controller=require('./faxQueue.controller');router[_0xe5e0('0x8')]('/',auth[_0xe5e0('0x9')](),controller[_0xe5e0('0xa')]);router[_0xe5e0('0x8')](_0xe5e0('0xb'),auth[_0xe5e0('0x9')](),controller['describe']);router[_0xe5e0('0x8')](_0xe5e0('0xc'),auth['isAuthenticated'](),controller[_0xe5e0('0xd')]);router[_0xe5e0('0x8')](_0xe5e0('0xe'),auth[_0xe5e0('0x9')](),controller[_0xe5e0('0xf')]);router[_0xe5e0('0x8')](_0xe5e0('0x10'),auth[_0xe5e0('0x9')](),controller[_0xe5e0('0x11')]);router[_0xe5e0('0x8')](_0xe5e0('0x12'),auth[_0xe5e0('0x9')](),controller[_0xe5e0('0x13')]);router['post']('/',auth['isAuthenticated'](),controller[_0xe5e0('0x14')]);router[_0xe5e0('0x15')](_0xe5e0('0x10'),auth[_0xe5e0('0x9')](),controller['addTeams']);router[_0xe5e0('0x15')](_0xe5e0('0x12'),auth[_0xe5e0('0x9')](),controller[_0xe5e0('0x16')]);router[_0xe5e0('0x17')](_0xe5e0('0xc'),auth[_0xe5e0('0x9')](),controller[_0xe5e0('0x18')]);router[_0xe5e0('0x19')]('/:id',auth[_0xe5e0('0x9')](),controller['destroy']);router[_0xe5e0('0x19')]('/:id/teams',auth[_0xe5e0('0x9')](),controller[_0xe5e0('0x1a')]);router['delete'](_0xe5e0('0x12'),auth['isAuthenticated'](),controller[_0xe5e0('0x1b')]);module[_0xe5e0('0x1c')]=router;
\ No newline at end of file
+var _0x444e=['addAgents','put','update','delete','destroy','/:id/users','removeAgents','multer','path','express','fs-extra','../../components/interaction/service','../../config/environment','./faxQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getMembers','/:id/teams','getAgents','post'];(function(_0x15deda,_0x1ac756){var _0x110de0=function(_0x73bf57){while(--_0x73bf57){_0x15deda['push'](_0x15deda['shift']());}};_0x110de0(++_0x1ac756);}(_0x444e,0xe8));var _0xe444=function(_0xe44e08,_0x512e68){_0xe44e08=_0xe44e08-0x0;var _0x448bef=_0x444e[_0xe44e08];return _0x448bef;};'use strict';var multer=require(_0xe444('0x0'));var util=require('util');var path=require(_0xe444('0x1'));var timeout=require('connect-timeout');var express=require(_0xe444('0x2'));var router=express['Router']();var fs_extra=require(_0xe444('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xe444('0x4'));var config=require(_0xe444('0x5'));var controller=require(_0xe444('0x6'));router[_0xe444('0x7')]('/',auth[_0xe444('0x8')](),controller[_0xe444('0x9')]);router['get'](_0xe444('0xa'),auth['isAuthenticated'](),controller[_0xe444('0xb')]);router['get'](_0xe444('0xc'),auth[_0xe444('0x8')](),controller[_0xe444('0xd')]);router['get']('/:id/members',auth[_0xe444('0x8')](),controller[_0xe444('0xe')]);router['get'](_0xe444('0xf'),auth['isAuthenticated'](),controller['getTeams']);router[_0xe444('0x7')]('/:id/users',auth[_0xe444('0x8')](),controller[_0xe444('0x10')]);router['post']('/',auth[_0xe444('0x8')](),controller['create']);router['post'](_0xe444('0xf'),auth[_0xe444('0x8')](),controller['addTeams']);router[_0xe444('0x11')]('/:id/users',auth[_0xe444('0x8')](),controller[_0xe444('0x12')]);router[_0xe444('0x13')](_0xe444('0xc'),auth[_0xe444('0x8')](),controller[_0xe444('0x14')]);router[_0xe444('0x15')](_0xe444('0xc'),auth[_0xe444('0x8')](),controller[_0xe444('0x16')]);router[_0xe444('0x15')](_0xe444('0xf'),auth[_0xe444('0x8')](),controller['removeTeams']);router[_0xe444('0x15')](_0xe444('0x17'),auth[_0xe444('0x8')](),controller[_0xe444('0x18')]);module['exports']=router;
\ No newline at end of file
index b0e2d28..67f5d4b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeb54=['sequelize','exports','STRING','DATE','moment'];(function(_0x12ddb9,_0x31a30c){var _0x2d792d=function(_0x288768){while(--_0x288768){_0x12ddb9['push'](_0x12ddb9['shift']());}};_0x2d792d(++_0x31a30c);}(_0xeb54,0x13f));var _0x4eb5=function(_0x50d697,_0x22a7d3){_0x50d697=_0x50d697-0x0;var _0x3ea288=_0xeb54[_0x50d697];return _0x3ea288;};'use strict';var moment=require(_0x4eb5('0x0'));var Sequelize=require(_0x4eb5('0x1'));module[_0x4eb5('0x2')]={'uniqueid':{'type':Sequelize[_0x4eb5('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x4eb5('0x3')]},'joinAt':{'type':Sequelize[_0x4eb5('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x4eb5('0x4')]},'exitAt':{'type':Sequelize[_0x4eb5('0x4')]},'reason':{'type':Sequelize[_0x4eb5('0x3')]}};
\ No newline at end of file
+var _0x52f6=['sequelize','STRING','DATE','moment'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x52f6,0x11f));var _0x652f=function(_0x305b6b,_0x4ecf07){_0x305b6b=_0x305b6b-0x0;var _0x19918e=_0x52f6[_0x305b6b];return _0x19918e;};'use strict';var moment=require(_0x652f('0x0'));var Sequelize=require(_0x652f('0x1'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x652f('0x2')]},'joinAt':{'type':Sequelize[_0x652f('0x3')]},'leaveAt':{'type':Sequelize[_0x652f('0x3')]},'acceptAt':{'type':Sequelize[_0x652f('0x3')]},'exitAt':{'type':Sequelize[_0x652f('0x3')]},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 8802bc7..f5823eb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe920=['../../config/logger','../../config/license/util','../../mysqldb','status','end','json','limit','count','offset','set','save','update','destroy','then','sendStatus','stack','name','send','index','map','FaxQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','merge','VIRTUAL','options','findAll','rows','show','params','includeAll','include','catch','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../config/license/hardware'];(function(_0x3cb3ca,_0x44d697){var _0x214366=function(_0x6b38e1){while(--_0x6b38e1){_0x3cb3ca['push'](_0x3cb3ca['shift']());}};_0x214366(++_0x44d697);}(_0xe920,0xbe));var _0x0e92=function(_0x3bab09,_0x217c29){_0x3bab09=_0x3bab09-0x0;var _0x164376=_0xe920[_0x3bab09];return _0x164376;};'use strict';var emlformat=require(_0x0e92('0x0'));var rimraf=require(_0x0e92('0x1'));var zipdir=require(_0x0e92('0x2'));var jsonpatch=require(_0x0e92('0x3'));var rp=require(_0x0e92('0x4'));var moment=require(_0x0e92('0x5'));var BPromise=require(_0x0e92('0x6'));var Mustache=require(_0x0e92('0x7'));var util=require(_0x0e92('0x8'));var path=require(_0x0e92('0x9'));var sox=require('sox');var csv=require(_0x0e92('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0e92('0xb'));var _=require(_0x0e92('0xc'));var squel=require(_0x0e92('0xd'));var crypto=require(_0x0e92('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x0e92('0xf'));var toCsv=require(_0x0e92('0xa'));var querystring=require(_0x0e92('0x10'));var Papa=require(_0x0e92('0x11'));var Redis=require(_0x0e92('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0e92('0x13'));var logger=require(_0x0e92('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0e92('0x15'));var db=require(_0x0e92('0x16'))['db'];function respondWithStatusCode(_0x4e411f,_0x3a88f1){_0x3a88f1=_0x3a88f1||0xcc;return function(_0x12113d){if(_0x12113d){return _0x4e411f['sendStatus'](_0x3a88f1);}return _0x4e411f[_0x0e92('0x17')](_0x3a88f1)[_0x0e92('0x18')]();};}function respondWithResult(_0x4e9dc0,_0x3bc59f){_0x3bc59f=_0x3bc59f||0xc8;return function(_0x218f02){if(_0x218f02){return _0x4e9dc0[_0x0e92('0x17')](_0x3bc59f)[_0x0e92('0x19')](_0x218f02);}};}function respondWithFilteredResult(_0x5cce2d,_0x5e70ab){return function(_0x333faf){if(_0x333faf){var _0x211716=typeof _0x5e70ab['offset']==='undefined'&&typeof _0x5e70ab[_0x0e92('0x1a')]==='undefined';var _0x9ecd13=_0x333faf[_0x0e92('0x1b')];var _0x3316a5=_0x211716?0x0:_0x5e70ab[_0x0e92('0x1c')];var _0x153002=_0x211716?_0x333faf[_0x0e92('0x1b')]:_0x5e70ab[_0x0e92('0x1c')]+_0x5e70ab['limit'];var _0x1412ef;if(_0x153002>=_0x9ecd13){_0x153002=_0x9ecd13;_0x1412ef=0xc8;}else{_0x1412ef=0xce;}_0x5cce2d['status'](_0x1412ef);return _0x5cce2d[_0x0e92('0x1d')]('Content-Range',_0x3316a5+'-'+_0x153002+'/'+_0x9ecd13)['json'](_0x333faf);}return null;};}function patchUpdates(_0x47a265){return function(_0x263ba1){try{jsonpatch['apply'](_0x263ba1,_0x47a265,!![]);}catch(_0x433c05){return BPromise['reject'](_0x433c05);}return _0x263ba1[_0x0e92('0x1e')]();};}function saveUpdates(_0x198c5a,_0x5d44e2){return function(_0x3f2105){if(_0x3f2105){return _0x3f2105[_0x0e92('0x1f')](_0x198c5a)['then'](function(_0x3a18e1){return _0x3a18e1;});}return null;};}function removeEntity(_0x53de77,_0x43c54c){return function(_0x40375c){if(_0x40375c){return _0x40375c[_0x0e92('0x20')]()[_0x0e92('0x21')](function(){_0x53de77[_0x0e92('0x17')](0xcc)[_0x0e92('0x18')]();});}};}function handleEntityNotFound(_0xc34ae4,_0x42c5bc){return function(_0x32d258){if(!_0x32d258){_0xc34ae4[_0x0e92('0x22')](0x194);}return _0x32d258;};}function handleError(_0x538bac,_0x3eb532){_0x3eb532=_0x3eb532||0x1f4;return function(_0x47f156){logger['error'](_0x47f156[_0x0e92('0x23')]);if(_0x47f156[_0x0e92('0x24')]){delete _0x47f156['name'];}_0x538bac['status'](_0x3eb532)[_0x0e92('0x25')](_0x47f156);};}exports[_0x0e92('0x26')]=function(_0x5af9b4,_0x515bd9){var _0x140666={},_0x329c5f={},_0xc3d81d={'count':0x0,'rows':[]};var _0x150bc1=_[_0x0e92('0x27')](db[_0x0e92('0x28')][_0x0e92('0x29')],function(_0x367a35){return{'name':_0x367a35[_0x0e92('0x2a')],'type':_0x367a35[_0x0e92('0x2b')][_0x0e92('0x2c')]};});_0x329c5f[_0x0e92('0x2d')]=_[_0x0e92('0x27')](_0x150bc1,_0x0e92('0x24'));_0x329c5f[_0x0e92('0x2e')]=_[_0x0e92('0x2f')](_0x5af9b4[_0x0e92('0x2e')]);_0x329c5f[_0x0e92('0x30')]=_[_0x0e92('0x31')](_0x329c5f[_0x0e92('0x2d')],_0x329c5f['query']);_0x140666[_0x0e92('0x32')]=_[_0x0e92('0x31')](_0x329c5f['model'],qs['fields'](_0x5af9b4[_0x0e92('0x2e')][_0x0e92('0x33')]));_0x140666[_0x0e92('0x32')]=_0x140666[_0x0e92('0x32')][_0x0e92('0x34')]?_0x140666[_0x0e92('0x32')]:_0x329c5f[_0x0e92('0x2d')];if(!_0x5af9b4[_0x0e92('0x2e')]['hasOwnProperty'](_0x0e92('0x35'))){_0x140666[_0x0e92('0x1a')]=qs[_0x0e92('0x1a')](_0x5af9b4[_0x0e92('0x2e')][_0x0e92('0x1a')]);_0x140666[_0x0e92('0x1c')]=qs[_0x0e92('0x1c')](_0x5af9b4[_0x0e92('0x2e')][_0x0e92('0x1c')]);}_0x140666['order']=qs['sort'](_0x5af9b4[_0x0e92('0x2e')][_0x0e92('0x36')]);_0x140666['where']=qs[_0x0e92('0x30')](_['pick'](_0x5af9b4[_0x0e92('0x2e')],_0x329c5f['filters']),_0x150bc1);if(_0x5af9b4[_0x0e92('0x2e')]['filter']){_0x140666[_0x0e92('0x37')]=_[_0x0e92('0x38')](_0x140666[_0x0e92('0x37')],{'$or':_['map'](_0x150bc1,function(_0x58ab21){if(_0x58ab21[_0x0e92('0x2b')]!==_0x0e92('0x39')){var _0xd86fd8={};_0xd86fd8[_0x58ab21['name']]={'$like':'%'+_0x5af9b4[_0x0e92('0x2e')]['filter']+'%'};return _0xd86fd8;}})});}_0x140666=_['merge']({},_0x140666,_0x5af9b4[_0x0e92('0x3a')]);var _0x14475e={'where':_0x140666['where']};return db[_0x0e92('0x28')]['count'](_0x14475e)[_0x0e92('0x21')](function(_0x188f78){_0xc3d81d['count']=_0x188f78;if(_0x5af9b4[_0x0e92('0x2e')]['includeAll']){_0x140666['include']=[{'all':!![]}];}return db['FaxQueueReport'][_0x0e92('0x3b')](_0x140666);})[_0x0e92('0x21')](function(_0x60bf0b){_0xc3d81d[_0x0e92('0x3c')]=_0x60bf0b;return _0xc3d81d;})['then'](respondWithFilteredResult(_0x515bd9,_0x140666))['catch'](handleError(_0x515bd9,null));};exports[_0x0e92('0x3d')]=function(_0x42909f,_0x328570){var _0xe9e906={'raw':!![],'where':{'id':_0x42909f[_0x0e92('0x3e')]['id']}},_0x4f242d={};_0x4f242d[_0x0e92('0x2d')]=_[_0x0e92('0x2f')](db[_0x0e92('0x28')]['rawAttributes']);_0x4f242d['query']=_[_0x0e92('0x2f')](_0x42909f[_0x0e92('0x2e')]);_0x4f242d['filters']=_[_0x0e92('0x31')](_0x4f242d[_0x0e92('0x2d')],_0x4f242d[_0x0e92('0x2e')]);_0xe9e906[_0x0e92('0x32')]=_[_0x0e92('0x31')](_0x4f242d[_0x0e92('0x2d')],qs['fields'](_0x42909f[_0x0e92('0x2e')][_0x0e92('0x33')]));_0xe9e906[_0x0e92('0x32')]=_0xe9e906['attributes'][_0x0e92('0x34')]?_0xe9e906[_0x0e92('0x32')]:_0x4f242d[_0x0e92('0x2d')];if(_0x42909f[_0x0e92('0x2e')][_0x0e92('0x3f')]){_0xe9e906[_0x0e92('0x40')]=[{'all':!![]}];}_0xe9e906=_[_0x0e92('0x38')]({},_0xe9e906,_0x42909f[_0x0e92('0x3a')]);return db[_0x0e92('0x28')]['find'](_0xe9e906)['then'](handleEntityNotFound(_0x328570,null))[_0x0e92('0x21')](respondWithResult(_0x328570,null))[_0x0e92('0x41')](handleError(_0x328570,null));};exports[_0x0e92('0x42')]=function(_0x2c0c79,_0x3b02da){return db['FaxQueueReport'][_0x0e92('0x42')](_0x2c0c79[_0x0e92('0x43')],{})['then'](respondWithResult(_0x3b02da,0xc9))['catch'](handleError(_0x3b02da,null));};exports[_0x0e92('0x1f')]=function(_0x4e4ddc,_0x14e7ed){if(_0x4e4ddc[_0x0e92('0x43')]['id']){delete _0x4e4ddc[_0x0e92('0x43')]['id'];}return db[_0x0e92('0x28')][_0x0e92('0x44')]({'where':{'id':_0x4e4ddc['params']['id']}})[_0x0e92('0x21')](handleEntityNotFound(_0x14e7ed,null))[_0x0e92('0x21')](saveUpdates(_0x4e4ddc[_0x0e92('0x43')],null))[_0x0e92('0x21')](respondWithResult(_0x14e7ed,null))[_0x0e92('0x41')](handleError(_0x14e7ed,null));};exports[_0x0e92('0x20')]=function(_0x10a5b2,_0x4a71d1){return db[_0x0e92('0x28')][_0x0e92('0x44')]({'where':{'id':_0x10a5b2['params']['id']}})['then'](handleEntityNotFound(_0x4a71d1,null))[_0x0e92('0x21')](removeEntity(_0x4a71d1,null))['catch'](handleError(_0x4a71d1,null));};exports[_0x0e92('0x45')]=function(_0x5ea77e,_0x30b31d){return db[_0x0e92('0x28')][_0x0e92('0x45')]()[_0x0e92('0x21')](respondWithResult(_0x30b31d,null))[_0x0e92('0x41')](handleError(_0x30b31d,null));};
\ No newline at end of file
+var _0xdadd=['path','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','reject','destroy','then','stack','name','index','map','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','nolimit','sort','filter','where','merge','VIRTUAL','options','count','include','FaxQueueReport','findAll','catch','params','keys','includeAll','create','update','body','describe','eml-format','zip-dir','request-promise','moment','bluebird','util'];(function(_0x146a97,_0x2d8483){var _0x259d5c=function(_0x3ca436){while(--_0x3ca436){_0x146a97['push'](_0x146a97['shift']());}};_0x259d5c(++_0x2d8483);}(_0xdadd,0x1c8));var _0xddad=function(_0x1e93fa,_0x210f48){_0x1e93fa=_0x1e93fa-0x0;var _0xd4e1e6=_0xdadd[_0x1e93fa];return _0xd4e1e6;};'use strict';var emlformat=require(_0xddad('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xddad('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xddad('0x2'));var moment=require(_0xddad('0x3'));var BPromise=require(_0xddad('0x4'));var Mustache=require('mustache');var util=require(_0xddad('0x5'));var path=require(_0xddad('0x6'));var sox=require(_0xddad('0x7'));var csv=require(_0xddad('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xddad('0x9'));var squel=require(_0xddad('0xa'));var crypto=require('crypto');var jsforce=require(_0xddad('0xb'));var deskjs=require(_0xddad('0xc'));var toCsv=require(_0xddad('0x8'));var querystring=require(_0xddad('0xd'));var Papa=require(_0xddad('0xe'));var Redis=require(_0xddad('0xf'));var authService=require(_0xddad('0x10'));var qs=require(_0xddad('0x11'));var as=require(_0xddad('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xddad('0x13'))(_0xddad('0x14'));var utils=require(_0xddad('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xddad('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x193c44,_0x248c9b){_0x248c9b=_0x248c9b||0xcc;return function(_0xc8973d){if(_0xc8973d){return _0x193c44[_0xddad('0x17')](_0x248c9b);}return _0x193c44[_0xddad('0x18')](_0x248c9b)[_0xddad('0x19')]();};}function respondWithResult(_0x4f8c2e,_0x353723){_0x353723=_0x353723||0xc8;return function(_0x2c7b40){if(_0x2c7b40){return _0x4f8c2e[_0xddad('0x18')](_0x353723)[_0xddad('0x1a')](_0x2c7b40);}};}function respondWithFilteredResult(_0x2ac2ac,_0x1b4b94){return function(_0x4e0ca3){if(_0x4e0ca3){var _0x50c3e4=typeof _0x1b4b94[_0xddad('0x1b')]===_0xddad('0x1c')&&typeof _0x1b4b94[_0xddad('0x1d')]===_0xddad('0x1c');var _0x413fe9=_0x4e0ca3['count'];var _0x282b69=_0x50c3e4?0x0:_0x1b4b94[_0xddad('0x1b')];var _0x3c4a8a=_0x50c3e4?_0x4e0ca3['count']:_0x1b4b94[_0xddad('0x1b')]+_0x1b4b94['limit'];var _0x46ac1f;if(_0x3c4a8a>=_0x413fe9){_0x3c4a8a=_0x413fe9;_0x46ac1f=0xc8;}else{_0x46ac1f=0xce;}_0x2ac2ac['status'](_0x46ac1f);return _0x2ac2ac['set']('Content-Range',_0x282b69+'-'+_0x3c4a8a+'/'+_0x413fe9)[_0xddad('0x1a')](_0x4e0ca3);}return null;};}function patchUpdates(_0x49acbf){return function(_0x567986){try{jsonpatch['apply'](_0x567986,_0x49acbf,!![]);}catch(_0x4ea1e9){return BPromise[_0xddad('0x1e')](_0x4ea1e9);}return _0x567986['save']();};}function saveUpdates(_0x1c4db9,_0x450080){return function(_0x2598c3){if(_0x2598c3){return _0x2598c3['update'](_0x1c4db9)['then'](function(_0x59739e){return _0x59739e;});}return null;};}function removeEntity(_0x321b25,_0x5e9e62){return function(_0x3a6c68){if(_0x3a6c68){return _0x3a6c68[_0xddad('0x1f')]()[_0xddad('0x20')](function(){_0x321b25[_0xddad('0x18')](0xcc)[_0xddad('0x19')]();});}};}function handleEntityNotFound(_0x561f35,_0x17b9ce){return function(_0x5b3a5b){if(!_0x5b3a5b){_0x561f35['sendStatus'](0x194);}return _0x5b3a5b;};}function handleError(_0x3040d1,_0x74c3ea){_0x74c3ea=_0x74c3ea||0x1f4;return function(_0x3b4bc8){logger['error'](_0x3b4bc8[_0xddad('0x21')]);if(_0x3b4bc8[_0xddad('0x22')]){delete _0x3b4bc8['name'];}_0x3040d1[_0xddad('0x18')](_0x74c3ea)['send'](_0x3b4bc8);};}exports[_0xddad('0x23')]=function(_0x53c761,_0x35a882){var _0x1823b0={},_0x55ea75={},_0x108192={'count':0x0,'rows':[]};var _0x5617c0=_[_0xddad('0x24')](db['FaxQueueReport'][_0xddad('0x25')],function(_0xf5daec){return{'name':_0xf5daec[_0xddad('0x26')],'type':_0xf5daec[_0xddad('0x27')]['key']};});_0x55ea75[_0xddad('0x28')]=_[_0xddad('0x24')](_0x5617c0,'name');_0x55ea75[_0xddad('0x29')]=_['keys'](_0x53c761['query']);_0x55ea75[_0xddad('0x2a')]=_[_0xddad('0x2b')](_0x55ea75[_0xddad('0x28')],_0x55ea75[_0xddad('0x29')]);_0x1823b0[_0xddad('0x2c')]=_['intersection'](_0x55ea75[_0xddad('0x28')],qs[_0xddad('0x2d')](_0x53c761[_0xddad('0x29')]['fields']));_0x1823b0[_0xddad('0x2c')]=_0x1823b0['attributes'][_0xddad('0x2e')]?_0x1823b0['attributes']:_0x55ea75[_0xddad('0x28')];if(!_0x53c761[_0xddad('0x29')]['hasOwnProperty'](_0xddad('0x2f'))){_0x1823b0['limit']=qs['limit'](_0x53c761['query']['limit']);_0x1823b0[_0xddad('0x1b')]=qs[_0xddad('0x1b')](_0x53c761['query']['offset']);}_0x1823b0['order']=qs[_0xddad('0x30')](_0x53c761['query'][_0xddad('0x30')]);_0x1823b0['where']=qs['filters'](_['pick'](_0x53c761['query'],_0x55ea75['filters']),_0x5617c0);if(_0x53c761[_0xddad('0x29')][_0xddad('0x31')]){_0x1823b0[_0xddad('0x32')]=_[_0xddad('0x33')](_0x1823b0[_0xddad('0x32')],{'$or':_[_0xddad('0x24')](_0x5617c0,function(_0xdb46ad){if(_0xdb46ad[_0xddad('0x27')]!==_0xddad('0x34')){var _0x6f717d={};_0x6f717d[_0xdb46ad[_0xddad('0x22')]]={'$like':'%'+_0x53c761[_0xddad('0x29')]['filter']+'%'};return _0x6f717d;}})});}_0x1823b0=_[_0xddad('0x33')]({},_0x1823b0,_0x53c761[_0xddad('0x35')]);var _0x5ed1e2={'where':_0x1823b0[_0xddad('0x32')]};return db['FaxQueueReport'][_0xddad('0x36')](_0x5ed1e2)[_0xddad('0x20')](function(_0x1ea76d){_0x108192[_0xddad('0x36')]=_0x1ea76d;if(_0x53c761['query']['includeAll']){_0x1823b0[_0xddad('0x37')]=[{'all':!![]}];}return db[_0xddad('0x38')][_0xddad('0x39')](_0x1823b0);})[_0xddad('0x20')](function(_0x33c930){_0x108192['rows']=_0x33c930;return _0x108192;})[_0xddad('0x20')](respondWithFilteredResult(_0x35a882,_0x1823b0))[_0xddad('0x3a')](handleError(_0x35a882,null));};exports['show']=function(_0x229d7a,_0x3a9ed6){var _0x17bded={'raw':!![],'where':{'id':_0x229d7a[_0xddad('0x3b')]['id']}},_0x47a6af={};_0x47a6af[_0xddad('0x28')]=_[_0xddad('0x3c')](db[_0xddad('0x38')][_0xddad('0x25')]);_0x47a6af[_0xddad('0x29')]=_[_0xddad('0x3c')](_0x229d7a[_0xddad('0x29')]);_0x47a6af[_0xddad('0x2a')]=_['intersection'](_0x47a6af[_0xddad('0x28')],_0x47a6af[_0xddad('0x29')]);_0x17bded[_0xddad('0x2c')]=_[_0xddad('0x2b')](_0x47a6af['model'],qs['fields'](_0x229d7a[_0xddad('0x29')][_0xddad('0x2d')]));_0x17bded['attributes']=_0x17bded[_0xddad('0x2c')][_0xddad('0x2e')]?_0x17bded['attributes']:_0x47a6af['model'];if(_0x229d7a[_0xddad('0x29')][_0xddad('0x3d')]){_0x17bded[_0xddad('0x37')]=[{'all':!![]}];}_0x17bded=_[_0xddad('0x33')]({},_0x17bded,_0x229d7a['options']);return db['FaxQueueReport']['find'](_0x17bded)[_0xddad('0x20')](handleEntityNotFound(_0x3a9ed6,null))[_0xddad('0x20')](respondWithResult(_0x3a9ed6,null))['catch'](handleError(_0x3a9ed6,null));};exports['create']=function(_0x3693ee,_0x43b19c){return db[_0xddad('0x38')][_0xddad('0x3e')](_0x3693ee['body'],{})[_0xddad('0x20')](respondWithResult(_0x43b19c,0xc9))['catch'](handleError(_0x43b19c,null));};exports[_0xddad('0x3f')]=function(_0x1ada5e,_0x4ba42d){if(_0x1ada5e[_0xddad('0x40')]['id']){delete _0x1ada5e[_0xddad('0x40')]['id'];}return db['FaxQueueReport']['find']({'where':{'id':_0x1ada5e[_0xddad('0x3b')]['id']}})[_0xddad('0x20')](handleEntityNotFound(_0x4ba42d,null))[_0xddad('0x20')](saveUpdates(_0x1ada5e[_0xddad('0x40')],null))[_0xddad('0x20')](respondWithResult(_0x4ba42d,null))[_0xddad('0x3a')](handleError(_0x4ba42d,null));};exports['destroy']=function(_0x43dd61,_0x440124){return db['FaxQueueReport']['find']({'where':{'id':_0x43dd61['params']['id']}})[_0xddad('0x20')](handleEntityNotFound(_0x440124,null))[_0xddad('0x20')](removeEntity(_0x440124,null))['catch'](handleError(_0x440124,null));};exports[_0xddad('0x41')]=function(_0x2e168e,_0x2fe117){return db['FaxQueueReport'][_0xddad('0x41')]()[_0xddad('0x20')](respondWithResult(_0x2fe117,null))['catch'](handleError(_0x2fe117,null));};
\ No newline at end of file
index 8176ba5..2c84272 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4975=['path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','FaxQueueReport','report_fax_queue','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x186140,_0x42dfed){var _0x4c9aa7=function(_0x538e70){while(--_0x538e70){_0x186140['push'](_0x186140['shift']());}};_0x4c9aa7(++_0x42dfed);}(_0x4975,0x86));var _0x5497=function(_0xd5cd5c,_0x2bd0aa){_0xd5cd5c=_0xd5cd5c-0x0;var _0x409d0e=_0x4975[_0xd5cd5c];return _0x409d0e;};'use strict';var _=require(_0x5497('0x0'));var util=require('util');var logger=require(_0x5497('0x1'))(_0x5497('0x2'));var moment=require(_0x5497('0x3'));var BPromise=require(_0x5497('0x4'));var rp=require(_0x5497('0x5'));var fs=require('fs');var path=require(_0x5497('0x6'));var rimraf=require(_0x5497('0x7'));var config=require(_0x5497('0x8'));var attributes=require(_0x5497('0x9'));module[_0x5497('0xa')]=function(_0x539a27,_0x37e48d){return _0x539a27['define'](_0x5497('0xb'),attributes,{'tableName':_0x5497('0xc'),'paranoid':![],'indexes':[{'name':_0x5497('0xd'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x326f=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','define','FaxQueueReport','report_fax_queue','uniqueid','lodash'];(function(_0x46220d,_0x2c6675){var _0x428f57=function(_0x47bb8f){while(--_0x47bb8f){_0x46220d['push'](_0x46220d['shift']());}};_0x428f57(++_0x2c6675);}(_0x326f,0xd1));var _0xf326=function(_0x5e679e,_0x481dd9){_0x5e679e=_0x5e679e-0x0;var _0x260e54=_0x326f[_0x5e679e];return _0x260e54;};'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
index 67b7bea..ef67004 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x40b5=['then','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateFaxQueueReport','FaxQueueReport','create','body','options','catch','UpdateFaxQueueReport','update','raw','where','attributes','limit','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x1bdf67,_0x5b084f){var _0x1a39b8=function(_0x1268df){while(--_0x1268df){_0x1bdf67['push'](_0x1bdf67['shift']());}};_0x1a39b8(++_0x5b084f);}(_0x40b5,0x1c6));var _0x540b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x40b5[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x540b('0x0'));var util=require(_0x540b('0x1'));var moment=require('moment');var BPromise=require(_0x540b('0x2'));var rs=require(_0x540b('0x3'));var fs=require('fs');var Redis=require(_0x540b('0x4'));var db=require(_0x540b('0x5'))['db'];var utils=require(_0x540b('0x6'));var logger=require(_0x540b('0x7'))(_0x540b('0x8'));var config=require(_0x540b('0x9'));var jayson=require(_0x540b('0xa'));var client=jayson[_0x540b('0xb')][_0x540b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2913c8,_0x5d1b58,_0xa9e4fe){return new BPromise(function(_0x2af25c,_0x378cce){return client[_0x540b('0xd')](_0x2913c8,_0xa9e4fe)[_0x540b('0xe')](function(_0x27335b){logger[_0x540b('0xf')](_0x540b('0x10'),_0x5d1b58,_0x540b('0x11'));logger['debug'](_0x540b('0x12'),_0x5d1b58,_0x540b('0x11'),JSON[_0x540b('0x13')](_0x27335b));if(_0x27335b[_0x540b('0x14')]){if(_0x27335b[_0x540b('0x14')][_0x540b('0x15')]===0x1f4){logger[_0x540b('0x14')](_0x540b('0x10'),_0x5d1b58,_0x27335b[_0x540b('0x14')][_0x540b('0x16')]);return _0x378cce(_0x27335b[_0x540b('0x14')][_0x540b('0x16')]);}logger[_0x540b('0x14')](_0x540b('0x10'),_0x5d1b58,_0x27335b[_0x540b('0x14')][_0x540b('0x16')]);return _0x2af25c(_0x27335b[_0x540b('0x14')][_0x540b('0x16')]);}else{logger['info'](_0x540b('0x10'),_0x5d1b58,_0x540b('0x11'));_0x2af25c(_0x27335b[_0x540b('0x17')][_0x540b('0x16')]);}})['catch'](function(_0x351ae1){logger['error']('FaxQueueReport,\x20%s,\x20%s',_0x5d1b58,_0x351ae1);_0x378cce(_0x351ae1);});});}exports[_0x540b('0x18')]=function(_0x35ab11){var _0x7640e9=this;return new Promise(function(_0x123af7,_0x4a1778){return db[_0x540b('0x19')][_0x540b('0x1a')](_0x35ab11[_0x540b('0x1b')],{'raw':_0x35ab11[_0x540b('0x1c')]?_0x35ab11[_0x540b('0x1c')]['raw']===undefined?!![]:![]:!![]})[_0x540b('0xe')](function(_0x52dad5){logger[_0x540b('0xf')](_0x540b('0x18'),_0x35ab11);logger['debug'](_0x540b('0x18'),_0x35ab11,JSON[_0x540b('0x13')](_0x52dad5));_0x123af7(_0x52dad5);})[_0x540b('0x1d')](function(_0x4f1eaa){logger['error'](_0x540b('0x18'),_0x4f1eaa[_0x540b('0x16')],_0x35ab11);_0x4a1778(_0x7640e9[_0x540b('0x14')](0x1f4,_0x4f1eaa[_0x540b('0x16')]));});});};exports[_0x540b('0x1e')]=function(_0x291ba6){var _0x694c94=this;return new Promise(function(_0x122d4b,_0x293d9d){return db[_0x540b('0x19')][_0x540b('0x1f')](_0x291ba6[_0x540b('0x1b')],{'raw':_0x291ba6['options']?_0x291ba6['options'][_0x540b('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x291ba6[_0x540b('0x1c')]?_0x291ba6['options'][_0x540b('0x21')]||null:null,'attributes':_0x291ba6[_0x540b('0x1c')]?_0x291ba6[_0x540b('0x1c')][_0x540b('0x22')]||null:null,'limit':_0x291ba6[_0x540b('0x1c')]?_0x291ba6[_0x540b('0x1c')][_0x540b('0x23')]||null:null})[_0x540b('0xe')](function(_0x25dfab){logger[_0x540b('0xf')](_0x540b('0x1e'),_0x291ba6);logger['debug'](_0x540b('0x1e'),_0x291ba6,JSON['stringify'](_0x25dfab));_0x122d4b(_0x25dfab);})[_0x540b('0x1d')](function(_0xa72426){logger[_0x540b('0x14')]('UpdateFaxQueueReport',_0xa72426[_0x540b('0x16')],_0x291ba6);_0x293d9d(_0x694c94[_0x540b('0x14')](0x1f4,_0xa72426['message']));});});};
\ No newline at end of file
+var _0x1a41=['client','http','request','then','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateFaxQueueReport','FaxQueueReport','create','options','raw','stringify','UpdateFaxQueueReport','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x4a7fd1,_0x4bdde1){var _0x12ef10=function(_0x234855){while(--_0x234855){_0x4a7fd1['push'](_0x4a7fd1['shift']());}};_0x12ef10(++_0x4bdde1);}(_0x1a41,0x18d));var _0x11a4=function(_0x4ddc7e,_0xcb9b8){_0x4ddc7e=_0x4ddc7e-0x0;var _0xfbf0ec=_0x1a41[_0x4ddc7e];return _0xfbf0ec;};'use strict';var _=require(_0x11a4('0x0'));var util=require(_0x11a4('0x1'));var moment=require(_0x11a4('0x2'));var BPromise=require(_0x11a4('0x3'));var rs=require(_0x11a4('0x4'));var fs=require('fs');var Redis=require(_0x11a4('0x5'));var db=require(_0x11a4('0x6'))['db'];var utils=require(_0x11a4('0x7'));var logger=require(_0x11a4('0x8'))(_0x11a4('0x9'));var config=require('../../config/environment');var jayson=require(_0x11a4('0xa'));var client=jayson[_0x11a4('0xb')][_0x11a4('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x547988,_0x1e3f1c,_0x2d8d53){return new BPromise(function(_0x2230af,_0x361744){return client[_0x11a4('0xd')](_0x547988,_0x2d8d53)[_0x11a4('0xe')](function(_0x141e0e){logger[_0x11a4('0xf')](_0x11a4('0x10'),_0x1e3f1c,_0x11a4('0x11'));logger[_0x11a4('0x12')](_0x11a4('0x13'),_0x1e3f1c,_0x11a4('0x11'),JSON['stringify'](_0x141e0e));if(_0x141e0e[_0x11a4('0x14')]){if(_0x141e0e[_0x11a4('0x14')][_0x11a4('0x15')]===0x1f4){logger[_0x11a4('0x14')]('FaxQueueReport,\x20%s,\x20%s',_0x1e3f1c,_0x141e0e[_0x11a4('0x14')][_0x11a4('0x16')]);return _0x361744(_0x141e0e[_0x11a4('0x14')]['message']);}logger[_0x11a4('0x14')](_0x11a4('0x10'),_0x1e3f1c,_0x141e0e['error']['message']);return _0x2230af(_0x141e0e[_0x11a4('0x14')]['message']);}else{logger[_0x11a4('0xf')](_0x11a4('0x10'),_0x1e3f1c,_0x11a4('0x11'));_0x2230af(_0x141e0e[_0x11a4('0x17')][_0x11a4('0x16')]);}})[_0x11a4('0x18')](function(_0x3f11ee){logger[_0x11a4('0x14')](_0x11a4('0x10'),_0x1e3f1c,_0x3f11ee);_0x361744(_0x3f11ee);});});}exports[_0x11a4('0x19')]=function(_0x32a379){var _0x48f390=this;return new Promise(function(_0x39adbb,_0x5ac11d){return db[_0x11a4('0x1a')][_0x11a4('0x1b')](_0x32a379['body'],{'raw':_0x32a379[_0x11a4('0x1c')]?_0x32a379[_0x11a4('0x1c')][_0x11a4('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x2efd0b){logger[_0x11a4('0xf')]('CreateFaxQueueReport',_0x32a379);logger[_0x11a4('0x12')](_0x11a4('0x19'),_0x32a379,JSON[_0x11a4('0x1e')](_0x2efd0b));_0x39adbb(_0x2efd0b);})[_0x11a4('0x18')](function(_0x203736){logger[_0x11a4('0x14')](_0x11a4('0x19'),_0x203736[_0x11a4('0x16')],_0x32a379);_0x5ac11d(_0x48f390[_0x11a4('0x14')](0x1f4,_0x203736['message']));});});};exports[_0x11a4('0x1f')]=function(_0x868456){var _0x43fc5a=this;return new Promise(function(_0x316c15,_0x54aaf5){return db[_0x11a4('0x1a')]['update'](_0x868456['body'],{'raw':_0x868456[_0x11a4('0x1c')]?_0x868456[_0x11a4('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x868456[_0x11a4('0x1c')]?_0x868456[_0x11a4('0x1c')]['where']||null:null,'attributes':_0x868456[_0x11a4('0x1c')]?_0x868456[_0x11a4('0x1c')][_0x11a4('0x20')]||null:null,'limit':_0x868456[_0x11a4('0x1c')]?_0x868456[_0x11a4('0x1c')][_0x11a4('0x21')]||null:null})['then'](function(_0xb23bcd){logger[_0x11a4('0xf')](_0x11a4('0x1f'),_0x868456);logger[_0x11a4('0x12')]('UpdateFaxQueueReport',_0x868456,JSON[_0x11a4('0x1e')](_0xb23bcd));_0x316c15(_0xb23bcd);})[_0x11a4('0x18')](function(_0x47c2f3){logger['error']('UpdateFaxQueueReport',_0x47c2f3[_0x11a4('0x16')],_0x868456);_0x54aaf5(_0x43fc5a[_0x11a4('0x14')](0x1f4,_0x47c2f3[_0x11a4('0x16')]));});});};
\ No newline at end of file
index 31153d3..77ae92f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3640=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./faxQueueReport.controller','get','/describe','isAuthenticated','describe','/:id','post','update','delete','destroy','multer','util','path'];(function(_0x3c4737,_0x2329ec){var _0x2bb926=function(_0x3b9605){while(--_0x3b9605){_0x3c4737['push'](_0x3c4737['shift']());}};_0x2bb926(++_0x2329ec);}(_0x3640,0x1ad));var _0x0364=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0x3640[_0x37bd26];return _0xe83dc4;};'use strict';var multer=require(_0x0364('0x0'));var util=require(_0x0364('0x1'));var path=require(_0x0364('0x2'));var timeout=require(_0x0364('0x3'));var express=require('express');var router=express[_0x0364('0x4')]();var fs_extra=require(_0x0364('0x5'));var auth=require(_0x0364('0x6'));var interaction=require(_0x0364('0x7'));var config=require('../../config/environment');var controller=require(_0x0364('0x8'));router[_0x0364('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x0364('0x9')](_0x0364('0xa'),auth[_0x0364('0xb')](),controller[_0x0364('0xc')]);router[_0x0364('0x9')](_0x0364('0xd'),auth[_0x0364('0xb')](),controller['show']);router[_0x0364('0xe')]('/',auth[_0x0364('0xb')](),controller['create']);router['put'](_0x0364('0xd'),auth[_0x0364('0xb')](),controller[_0x0364('0xf')]);router[_0x0364('0x10')](_0x0364('0xd'),auth[_0x0364('0xb')](),controller[_0x0364('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0x1e8c=['post','create','update','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','get','isAuthenticated','/describe','describe','/:id','show'];(function(_0x165fd9,_0x735c52){var _0x34611f=function(_0xb44329){while(--_0xb44329){_0x165fd9['push'](_0x165fd9['shift']());}};_0x34611f(++_0x735c52);}(_0x1e8c,0xf2));var _0xc1e8=function(_0xdcda3,_0x4252fb){_0xdcda3=_0xdcda3-0x0;var _0x2bec82=_0x1e8c[_0xdcda3];return _0x2bec82;};'use strict';var multer=require('multer');var util=require(_0xc1e8('0x0'));var path=require(_0xc1e8('0x1'));var timeout=require(_0xc1e8('0x2'));var express=require(_0xc1e8('0x3'));var router=express[_0xc1e8('0x4')]();var fs_extra=require(_0xc1e8('0x5'));var auth=require(_0xc1e8('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./faxQueueReport.controller');router[_0xc1e8('0x7')]('/',auth[_0xc1e8('0x8')](),controller['index']);router[_0xc1e8('0x7')](_0xc1e8('0x9'),auth[_0xc1e8('0x8')](),controller[_0xc1e8('0xa')]);router[_0xc1e8('0x7')](_0xc1e8('0xb'),auth[_0xc1e8('0x8')](),controller[_0xc1e8('0xc')]);router[_0xc1e8('0xd')]('/',auth[_0xc1e8('0x8')](),controller[_0xc1e8('0xe')]);router['put'](_0xc1e8('0xb'),auth[_0xc1e8('0x8')](),controller[_0xc1e8('0xf')]);router['delete'](_0xc1e8('0xb'),auth['isAuthenticated'](),controller[_0xc1e8('0x10')]);module['exports']=router;
\ No newline at end of file
index 5da931a..6e9a5ef 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['account','queue','DATE','NOW','moment','sequelize','exports'];(function(_0x20580a,_0xc57976){var _0x2732ec=function(_0x2c7af0){while(--_0x2c7af0){_0x20580a['push'](_0x20580a['shift']());}};_0x2732ec(++_0xc57976);}(_0xa9e0,0x123));var _0x0a9e=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0xa9e0[_0x134c2e];return _0x2825db;};'use strict';var moment=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x3'),'agent',_0x0a9e('0x4')),'allowNull':![],'defaultValue':_0x0a9e('0x4')},'transferredAt':{'type':Sequelize[_0x0a9e('0x5')],'allowNull':![],'defaultValue':Sequelize[_0x0a9e('0x6')]}};
\ No newline at end of file
+var _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0xc7ddda,_0xccda4d){var _0x4cbc07=function(_0x46e730){while(--_0x46e730){_0xc7ddda['push'](_0xc7ddda['shift']());}};_0x4cbc07(++_0xccda4d);}(_0x70e0,0x17b));var _0x070e=function(_0x36e6f3,_0x5d9ac6){_0x36e6f3=_0x36e6f3-0x0;var _0xe485e7=_0x70e0[_0x36e6f3];return _0xe485e7;};'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 5995018..5a64891 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x367d=['filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','FaxTransferReport','rows','catch','params','length','find','create','body','describe','eml-format','rimraf','moment','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','count','offset','limit','Content-Range','json','apply','reject','update','destroy','then','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','keys','query'];(function(_0x5c468f,_0x2e5c25){var _0x2136b0=function(_0x56b8a4){while(--_0x56b8a4){_0x5c468f['push'](_0x5c468f['shift']());}};_0x2136b0(++_0x2e5c25);}(_0x367d,0x13c));var _0xd367=function(_0xdde01f,_0x538a28){_0xdde01f=_0xdde01f-0x0;var _0x12d060=_0x367d[_0xdde01f];return _0x12d060;};'use strict';var emlformat=require(_0xd367('0x0'));var rimraf=require(_0xd367('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xd367('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xd367('0x3'));var path=require(_0xd367('0x4'));var sox=require('sox');var csv=require(_0xd367('0x5'));var ejs=require(_0xd367('0x6'));var fs=require('fs');var fs_extra=require(_0xd367('0x7'));var _=require(_0xd367('0x8'));var squel=require(_0xd367('0x9'));var crypto=require(_0xd367('0xa'));var jsforce=require(_0xd367('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xd367('0x5'));var querystring=require(_0xd367('0xc'));var Papa=require(_0xd367('0xd'));var Redis=require(_0xd367('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xd367('0xf'));var as=require(_0xd367('0x10'));var hardwareService=require(_0xd367('0x11'));var logger=require(_0xd367('0x12'))(_0xd367('0x13'));var utils=require('../../config/utils');var config=require(_0xd367('0x14'));var licenseUtil=require(_0xd367('0x15'));var db=require(_0xd367('0x16'))['db'];function respondWithStatusCode(_0x307ac9,_0x786ead){_0x786ead=_0x786ead||0xcc;return function(_0x49d467){if(_0x49d467){return _0x307ac9[_0xd367('0x17')](_0x786ead);}return _0x307ac9[_0xd367('0x18')](_0x786ead)[_0xd367('0x19')]();};}function respondWithResult(_0x98f2fd,_0x14dd8e){_0x14dd8e=_0x14dd8e||0xc8;return function(_0x4323e5){if(_0x4323e5){return _0x98f2fd[_0xd367('0x18')](_0x14dd8e)['json'](_0x4323e5);}};}function respondWithFilteredResult(_0xc28159,_0x5e8fde){return function(_0x323185){if(_0x323185){var _0x3333b9=typeof _0x5e8fde['offset']===_0xd367('0x1a')&&typeof _0x5e8fde['limit']==='undefined';var _0x1a416b=_0x323185[_0xd367('0x1b')];var _0x5a94a1=_0x3333b9?0x0:_0x5e8fde['offset'];var _0x5314d0=_0x3333b9?_0x323185['count']:_0x5e8fde[_0xd367('0x1c')]+_0x5e8fde[_0xd367('0x1d')];var _0x4b36ff;if(_0x5314d0>=_0x1a416b){_0x5314d0=_0x1a416b;_0x4b36ff=0xc8;}else{_0x4b36ff=0xce;}_0xc28159[_0xd367('0x18')](_0x4b36ff);return _0xc28159['set'](_0xd367('0x1e'),_0x5a94a1+'-'+_0x5314d0+'/'+_0x1a416b)[_0xd367('0x1f')](_0x323185);}return null;};}function patchUpdates(_0x45773a){return function(_0x38e83a){try{jsonpatch[_0xd367('0x20')](_0x38e83a,_0x45773a,!![]);}catch(_0x1b32a4){return BPromise[_0xd367('0x21')](_0x1b32a4);}return _0x38e83a['save']();};}function saveUpdates(_0x1d9dcb,_0x4a25df){return function(_0x1fb66c){if(_0x1fb66c){return _0x1fb66c[_0xd367('0x22')](_0x1d9dcb)['then'](function(_0x18cbd1){return _0x18cbd1;});}return null;};}function removeEntity(_0x22309a,_0x3ee161){return function(_0x304c57){if(_0x304c57){return _0x304c57[_0xd367('0x23')]()[_0xd367('0x24')](function(){_0x22309a[_0xd367('0x18')](0xcc)[_0xd367('0x19')]();});}};}function handleEntityNotFound(_0x38b74f,_0x529e9f){return function(_0x82b802){if(!_0x82b802){_0x38b74f[_0xd367('0x17')](0x194);}return _0x82b802;};}function handleError(_0x2c082b,_0x559ae0){_0x559ae0=_0x559ae0||0x1f4;return function(_0x2352a1){logger['error'](_0x2352a1[_0xd367('0x25')]);if(_0x2352a1['name']){delete _0x2352a1[_0xd367('0x26')];}_0x2c082b[_0xd367('0x18')](_0x559ae0)[_0xd367('0x27')](_0x2352a1);};}exports[_0xd367('0x28')]=function(_0x92c8d6,_0x56dbe9){var _0x19665e={},_0x4cbc0b={},_0x27b5c1={'count':0x0,'rows':[]};var _0x380575=_['map'](db['FaxTransferReport'][_0xd367('0x29')],function(_0x58d484){return{'name':_0x58d484[_0xd367('0x2a')],'type':_0x58d484[_0xd367('0x2b')][_0xd367('0x2c')]};});_0x4cbc0b[_0xd367('0x2d')]=_[_0xd367('0x2e')](_0x380575,_0xd367('0x26'));_0x4cbc0b['query']=_[_0xd367('0x2f')](_0x92c8d6[_0xd367('0x30')]);_0x4cbc0b[_0xd367('0x31')]=_[_0xd367('0x32')](_0x4cbc0b[_0xd367('0x2d')],_0x4cbc0b[_0xd367('0x30')]);_0x19665e[_0xd367('0x33')]=_[_0xd367('0x32')](_0x4cbc0b[_0xd367('0x2d')],qs[_0xd367('0x34')](_0x92c8d6[_0xd367('0x30')]['fields']));_0x19665e[_0xd367('0x33')]=_0x19665e['attributes']['length']?_0x19665e[_0xd367('0x33')]:_0x4cbc0b[_0xd367('0x2d')];if(!_0x92c8d6[_0xd367('0x30')][_0xd367('0x35')](_0xd367('0x36'))){_0x19665e['limit']=qs[_0xd367('0x1d')](_0x92c8d6[_0xd367('0x30')][_0xd367('0x1d')]);_0x19665e['offset']=qs[_0xd367('0x1c')](_0x92c8d6[_0xd367('0x30')][_0xd367('0x1c')]);}_0x19665e['order']=qs[_0xd367('0x37')](_0x92c8d6[_0xd367('0x30')][_0xd367('0x37')]);_0x19665e[_0xd367('0x38')]=qs[_0xd367('0x31')](_[_0xd367('0x39')](_0x92c8d6[_0xd367('0x30')],_0x4cbc0b[_0xd367('0x31')]),_0x380575);if(_0x92c8d6[_0xd367('0x30')][_0xd367('0x3a')]){_0x19665e[_0xd367('0x38')]=_[_0xd367('0x3b')](_0x19665e[_0xd367('0x38')],{'$or':_[_0xd367('0x2e')](_0x380575,function(_0x20b44a){if(_0x20b44a[_0xd367('0x2b')]!==_0xd367('0x3c')){var _0x4ccd46={};_0x4ccd46[_0x20b44a[_0xd367('0x26')]]={'$like':'%'+_0x92c8d6[_0xd367('0x30')][_0xd367('0x3a')]+'%'};return _0x4ccd46;}})});}_0x19665e=_[_0xd367('0x3b')]({},_0x19665e,_0x92c8d6[_0xd367('0x3d')]);var _0x287e71={'where':_0x19665e[_0xd367('0x38')]};return db['FaxTransferReport']['count'](_0x287e71)[_0xd367('0x24')](function(_0x859ff0){_0x27b5c1[_0xd367('0x1b')]=_0x859ff0;if(_0x92c8d6[_0xd367('0x30')][_0xd367('0x3e')]){_0x19665e[_0xd367('0x3f')]=[{'all':!![]}];}return db[_0xd367('0x40')]['findAll'](_0x19665e);})[_0xd367('0x24')](function(_0x3be146){_0x27b5c1[_0xd367('0x41')]=_0x3be146;return _0x27b5c1;})[_0xd367('0x24')](respondWithFilteredResult(_0x56dbe9,_0x19665e))[_0xd367('0x42')](handleError(_0x56dbe9,null));};exports['show']=function(_0x5aaa55,_0x85ebc8){var _0x638888={'raw':!![],'where':{'id':_0x5aaa55[_0xd367('0x43')]['id']}},_0x42675f={};_0x42675f['model']=_[_0xd367('0x2f')](db[_0xd367('0x40')][_0xd367('0x29')]);_0x42675f[_0xd367('0x30')]=_[_0xd367('0x2f')](_0x5aaa55[_0xd367('0x30')]);_0x42675f[_0xd367('0x31')]=_[_0xd367('0x32')](_0x42675f[_0xd367('0x2d')],_0x42675f[_0xd367('0x30')]);_0x638888['attributes']=_[_0xd367('0x32')](_0x42675f[_0xd367('0x2d')],qs[_0xd367('0x34')](_0x5aaa55['query']['fields']));_0x638888[_0xd367('0x33')]=_0x638888[_0xd367('0x33')][_0xd367('0x44')]?_0x638888[_0xd367('0x33')]:_0x42675f['model'];if(_0x5aaa55['query'][_0xd367('0x3e')]){_0x638888[_0xd367('0x3f')]=[{'all':!![]}];}_0x638888=_[_0xd367('0x3b')]({},_0x638888,_0x5aaa55[_0xd367('0x3d')]);return db[_0xd367('0x40')][_0xd367('0x45')](_0x638888)['then'](handleEntityNotFound(_0x85ebc8,null))[_0xd367('0x24')](respondWithResult(_0x85ebc8,null))[_0xd367('0x42')](handleError(_0x85ebc8,null));};exports[_0xd367('0x46')]=function(_0x8c79a6,_0x469b07){return db['FaxTransferReport'][_0xd367('0x46')](_0x8c79a6[_0xd367('0x47')],{})[_0xd367('0x24')](respondWithResult(_0x469b07,0xc9))[_0xd367('0x42')](handleError(_0x469b07,null));};exports[_0xd367('0x22')]=function(_0x805f99,_0x2658e1){if(_0x805f99[_0xd367('0x47')]['id']){delete _0x805f99['body']['id'];}return db['FaxTransferReport'][_0xd367('0x45')]({'where':{'id':_0x805f99[_0xd367('0x43')]['id']}})[_0xd367('0x24')](handleEntityNotFound(_0x2658e1,null))[_0xd367('0x24')](saveUpdates(_0x805f99[_0xd367('0x47')],null))['then'](respondWithResult(_0x2658e1,null))[_0xd367('0x42')](handleError(_0x2658e1,null));};exports[_0xd367('0x23')]=function(_0x4cc9b8,_0xb90d4e){return db['FaxTransferReport'][_0xd367('0x45')]({'where':{'id':_0x4cc9b8[_0xd367('0x43')]['id']}})[_0xd367('0x24')](handleEntityNotFound(_0xb90d4e,null))[_0xd367('0x24')](removeEntity(_0xb90d4e,null))['catch'](handleError(_0xb90d4e,null));};exports[_0xd367('0x48')]=function(_0x77ff3b,_0x5b8d94){return db[_0xd367('0x40')][_0xd367('0x48')]()[_0xd367('0x24')](respondWithResult(_0x5b8d94,null))['catch'](handleError(_0x5b8d94,null));};
\ No newline at end of file
+var _0xa264=['crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','count','limit','set','Content-Range','reject','update','destroy','error','stack','name','status','index','map','FaxTransferReport','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','then','includeAll','findAll','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','ejs','fs-extra','lodash'];(function(_0x5e1b91,_0x236f17){var _0x59b52f=function(_0x5c05ed){while(--_0x5c05ed){_0x5e1b91['push'](_0x5e1b91['shift']());}};_0x59b52f(++_0x236f17);}(_0xa264,0xd6));var _0x4a26=function(_0x3cbe1c,_0x4bcabd){_0x3cbe1c=_0x3cbe1c-0x0;var _0x5ee08b=_0xa264[_0x3cbe1c];return _0x5ee08b;};'use strict';var emlformat=require(_0x4a26('0x0'));var rimraf=require(_0x4a26('0x1'));var zipdir=require(_0x4a26('0x2'));var jsonpatch=require(_0x4a26('0x3'));var rp=require(_0x4a26('0x4'));var moment=require(_0x4a26('0x5'));var BPromise=require(_0x4a26('0x6'));var Mustache=require(_0x4a26('0x7'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x4a26('0x8'));var fs=require('fs');var fs_extra=require(_0x4a26('0x9'));var _=require(_0x4a26('0xa'));var squel=require('squel');var crypto=require(_0x4a26('0xb'));var jsforce=require(_0x4a26('0xc'));var deskjs=require(_0x4a26('0xd'));var toCsv=require(_0x4a26('0xe'));var querystring=require(_0x4a26('0xf'));var Papa=require(_0x4a26('0x10'));var Redis=require(_0x4a26('0x11'));var authService=require(_0x4a26('0x12'));var qs=require(_0x4a26('0x13'));var as=require(_0x4a26('0x14'));var hardwareService=require(_0x4a26('0x15'));var logger=require(_0x4a26('0x16'))('api');var utils=require(_0x4a26('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x4a26('0x18'));var db=require(_0x4a26('0x19'))['db'];function respondWithStatusCode(_0x4934ce,_0x25612c){_0x25612c=_0x25612c||0xcc;return function(_0x2c1ea6){if(_0x2c1ea6){return _0x4934ce[_0x4a26('0x1a')](_0x25612c);}return _0x4934ce['status'](_0x25612c)[_0x4a26('0x1b')]();};}function respondWithResult(_0x127baa,_0x2cb158){_0x2cb158=_0x2cb158||0xc8;return function(_0x485358){if(_0x485358){return _0x127baa['status'](_0x2cb158)[_0x4a26('0x1c')](_0x485358);}};}function respondWithFilteredResult(_0x3974d8,_0x2f3be9){return function(_0x5653f2){if(_0x5653f2){var _0x4c8eab=typeof _0x2f3be9[_0x4a26('0x1d')]==='undefined'&&typeof _0x2f3be9['limit']===_0x4a26('0x1e');var _0x3c2390=_0x5653f2[_0x4a26('0x1f')];var _0x19245b=_0x4c8eab?0x0:_0x2f3be9[_0x4a26('0x1d')];var _0x40f050=_0x4c8eab?_0x5653f2[_0x4a26('0x1f')]:_0x2f3be9[_0x4a26('0x1d')]+_0x2f3be9[_0x4a26('0x20')];var _0x173a53;if(_0x40f050>=_0x3c2390){_0x40f050=_0x3c2390;_0x173a53=0xc8;}else{_0x173a53=0xce;}_0x3974d8['status'](_0x173a53);return _0x3974d8[_0x4a26('0x21')](_0x4a26('0x22'),_0x19245b+'-'+_0x40f050+'/'+_0x3c2390)[_0x4a26('0x1c')](_0x5653f2);}return null;};}function patchUpdates(_0x317eec){return function(_0x3d869b){try{jsonpatch['apply'](_0x3d869b,_0x317eec,!![]);}catch(_0x1a56ab){return BPromise[_0x4a26('0x23')](_0x1a56ab);}return _0x3d869b['save']();};}function saveUpdates(_0x573c7b,_0x321e4c){return function(_0x3fc7f1){if(_0x3fc7f1){return _0x3fc7f1[_0x4a26('0x24')](_0x573c7b)['then'](function(_0x180e16){return _0x180e16;});}return null;};}function removeEntity(_0x18d3a6,_0x1e08a0){return function(_0x152acf){if(_0x152acf){return _0x152acf[_0x4a26('0x25')]()['then'](function(){_0x18d3a6['status'](0xcc)[_0x4a26('0x1b')]();});}};}function handleEntityNotFound(_0x42e72a,_0x22ca5e){return function(_0x4868a4){if(!_0x4868a4){_0x42e72a['sendStatus'](0x194);}return _0x4868a4;};}function handleError(_0x2dd4bb,_0x21bddf){_0x21bddf=_0x21bddf||0x1f4;return function(_0x32a258){logger[_0x4a26('0x26')](_0x32a258[_0x4a26('0x27')]);if(_0x32a258['name']){delete _0x32a258[_0x4a26('0x28')];}_0x2dd4bb[_0x4a26('0x29')](_0x21bddf)['send'](_0x32a258);};}exports[_0x4a26('0x2a')]=function(_0xf1d7ef,_0x2f4f6c){var _0x10d29e={},_0x46165f={},_0x7688ab={'count':0x0,'rows':[]};var _0x560794=_[_0x4a26('0x2b')](db[_0x4a26('0x2c')][_0x4a26('0x2d')],function(_0x952477){return{'name':_0x952477['fieldName'],'type':_0x952477['type'][_0x4a26('0x2e')]};});_0x46165f[_0x4a26('0x2f')]=_['map'](_0x560794,_0x4a26('0x28'));_0x46165f[_0x4a26('0x30')]=_[_0x4a26('0x31')](_0xf1d7ef['query']);_0x46165f[_0x4a26('0x32')]=_[_0x4a26('0x33')](_0x46165f[_0x4a26('0x2f')],_0x46165f[_0x4a26('0x30')]);_0x10d29e[_0x4a26('0x34')]=_[_0x4a26('0x33')](_0x46165f[_0x4a26('0x2f')],qs['fields'](_0xf1d7ef[_0x4a26('0x30')][_0x4a26('0x35')]));_0x10d29e[_0x4a26('0x34')]=_0x10d29e[_0x4a26('0x34')][_0x4a26('0x36')]?_0x10d29e[_0x4a26('0x34')]:_0x46165f[_0x4a26('0x2f')];if(!_0xf1d7ef[_0x4a26('0x30')][_0x4a26('0x37')](_0x4a26('0x38'))){_0x10d29e[_0x4a26('0x20')]=qs[_0x4a26('0x20')](_0xf1d7ef[_0x4a26('0x30')][_0x4a26('0x20')]);_0x10d29e[_0x4a26('0x1d')]=qs['offset'](_0xf1d7ef['query']['offset']);}_0x10d29e[_0x4a26('0x39')]=qs[_0x4a26('0x3a')](_0xf1d7ef['query']['sort']);_0x10d29e[_0x4a26('0x3b')]=qs[_0x4a26('0x32')](_[_0x4a26('0x3c')](_0xf1d7ef[_0x4a26('0x30')],_0x46165f['filters']),_0x560794);if(_0xf1d7ef['query']['filter']){_0x10d29e['where']=_[_0x4a26('0x3d')](_0x10d29e[_0x4a26('0x3b')],{'$or':_['map'](_0x560794,function(_0x4a11ef){if(_0x4a11ef['type']!==_0x4a26('0x3e')){var _0x1f9549={};_0x1f9549[_0x4a11ef['name']]={'$like':'%'+_0xf1d7ef[_0x4a26('0x30')][_0x4a26('0x3f')]+'%'};return _0x1f9549;}})});}_0x10d29e=_['merge']({},_0x10d29e,_0xf1d7ef[_0x4a26('0x40')]);var _0x41a19e={'where':_0x10d29e[_0x4a26('0x3b')]};return db[_0x4a26('0x2c')][_0x4a26('0x1f')](_0x41a19e)[_0x4a26('0x41')](function(_0x1a5126){_0x7688ab[_0x4a26('0x1f')]=_0x1a5126;if(_0xf1d7ef[_0x4a26('0x30')][_0x4a26('0x42')]){_0x10d29e['include']=[{'all':!![]}];}return db[_0x4a26('0x2c')][_0x4a26('0x43')](_0x10d29e);})[_0x4a26('0x41')](function(_0x1950b7){_0x7688ab['rows']=_0x1950b7;return _0x7688ab;})['then'](respondWithFilteredResult(_0x2f4f6c,_0x10d29e))[_0x4a26('0x44')](handleError(_0x2f4f6c,null));};exports[_0x4a26('0x45')]=function(_0x11e5f7,_0x578cc1){var _0x4454a0={'raw':!![],'where':{'id':_0x11e5f7[_0x4a26('0x46')]['id']}},_0xb06ffa={};_0xb06ffa[_0x4a26('0x2f')]=_[_0x4a26('0x31')](db[_0x4a26('0x2c')][_0x4a26('0x2d')]);_0xb06ffa[_0x4a26('0x30')]=_[_0x4a26('0x31')](_0x11e5f7[_0x4a26('0x30')]);_0xb06ffa[_0x4a26('0x32')]=_[_0x4a26('0x33')](_0xb06ffa[_0x4a26('0x2f')],_0xb06ffa[_0x4a26('0x30')]);_0x4454a0[_0x4a26('0x34')]=_[_0x4a26('0x33')](_0xb06ffa[_0x4a26('0x2f')],qs[_0x4a26('0x35')](_0x11e5f7[_0x4a26('0x30')]['fields']));_0x4454a0[_0x4a26('0x34')]=_0x4454a0[_0x4a26('0x34')][_0x4a26('0x36')]?_0x4454a0[_0x4a26('0x34')]:_0xb06ffa[_0x4a26('0x2f')];if(_0x11e5f7[_0x4a26('0x30')][_0x4a26('0x42')]){_0x4454a0['include']=[{'all':!![]}];}_0x4454a0=_[_0x4a26('0x3d')]({},_0x4454a0,_0x11e5f7[_0x4a26('0x40')]);return db[_0x4a26('0x2c')][_0x4a26('0x47')](_0x4454a0)[_0x4a26('0x41')](handleEntityNotFound(_0x578cc1,null))['then'](respondWithResult(_0x578cc1,null))[_0x4a26('0x44')](handleError(_0x578cc1,null));};exports[_0x4a26('0x48')]=function(_0x111804,_0x3967b4){return db[_0x4a26('0x2c')][_0x4a26('0x48')](_0x111804[_0x4a26('0x49')],{})[_0x4a26('0x41')](respondWithResult(_0x3967b4,0xc9))['catch'](handleError(_0x3967b4,null));};exports[_0x4a26('0x24')]=function(_0x3fa488,_0x4d1b3e){if(_0x3fa488[_0x4a26('0x49')]['id']){delete _0x3fa488[_0x4a26('0x49')]['id'];}return db[_0x4a26('0x2c')][_0x4a26('0x47')]({'where':{'id':_0x3fa488[_0x4a26('0x46')]['id']}})['then'](handleEntityNotFound(_0x4d1b3e,null))[_0x4a26('0x41')](saveUpdates(_0x3fa488['body'],null))[_0x4a26('0x41')](respondWithResult(_0x4d1b3e,null))['catch'](handleError(_0x4d1b3e,null));};exports['destroy']=function(_0x24b6d0,_0x4aad6e){return db['FaxTransferReport'][_0x4a26('0x47')]({'where':{'id':_0x24b6d0[_0x4a26('0x46')]['id']}})[_0x4a26('0x41')](handleEntityNotFound(_0x4aad6e,null))[_0x4a26('0x41')](removeEntity(_0x4aad6e,null))[_0x4a26('0x44')](handleError(_0x4aad6e,null));};exports['describe']=function(_0x57115f,_0x120dbc){return db[_0x4a26('0x2c')][_0x4a26('0x4a')]()['then'](respondWithResult(_0x120dbc,null))[_0x4a26('0x44')](handleError(_0x120dbc,null));};
\ No newline at end of file
index aa182f1..f5f95f8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x93e9=['request-promise','../../config/environment','./faxTransferReport.attributes','exports','define','FaxTransferReport','report_fax_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x58581e,_0x3a3aef){var _0x1a0645=function(_0x3d09fc){while(--_0x3d09fc){_0x58581e['push'](_0x58581e['shift']());}};_0x1a0645(++_0x3a3aef);}(_0x93e9,0xcc));var _0x993e=function(_0x7655d8,_0x46b625){_0x7655d8=_0x7655d8-0x0;var _0x50e258=_0x93e9[_0x7655d8];return _0x50e258;};'use strict';var _=require(_0x993e('0x0'));var util=require(_0x993e('0x1'));var logger=require(_0x993e('0x2'))(_0x993e('0x3'));var moment=require(_0x993e('0x4'));var BPromise=require(_0x993e('0x5'));var rp=require(_0x993e('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x993e('0x7'));var attributes=require(_0x993e('0x8'));module[_0x993e('0x9')]=function(_0x45f52e,_0x1da414){return _0x45f52e[_0x993e('0xa')](_0x993e('0xb'),attributes,{'tableName':_0x993e('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x993e('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x0715=['bluebird','request-promise','path','rimraf','./faxTransferReport.attributes','exports','define','FaxTransferReport','report_fax_transfer','uniqueid','util','../../config/logger','api','moment'];(function(_0x2134b7,_0x1eb5e2){var _0x6c5914=function(_0x1da201){while(--_0x1da201){_0x2134b7['push'](_0x2134b7['shift']());}};_0x6c5914(++_0x1eb5e2);}(_0x0715,0x1f4));var _0x5071=function(_0x4380d2,_0x5ba89b){_0x4380d2=_0x4380d2-0x0;var _0x4b4abd=_0x0715[_0x4380d2];return _0x4b4abd;};'use strict';var _=require('lodash');var util=require(_0x5071('0x0'));var logger=require(_0x5071('0x1'))(_0x5071('0x2'));var moment=require(_0x5071('0x3'));var BPromise=require(_0x5071('0x4'));var rp=require(_0x5071('0x5'));var fs=require('fs');var path=require(_0x5071('0x6'));var rimraf=require(_0x5071('0x7'));var config=require('../../config/environment');var attributes=require(_0x5071('0x8'));module[_0x5071('0x9')]=function(_0x439932,_0x11466a){return _0x439932[_0x5071('0xa')](_0x5071('0xb'),attributes,{'tableName':_0x5071('0xc'),'paranoid':![],'indexes':[{'name':_0x5071('0xd'),'fields':[_0x5071('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
index 6a2fbe8..d41f6af 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa0f6=['../../config/utils','rpc','jayson/promise','client','http','then','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x1d9aa0,_0x272488){var _0x226868=function(_0x17127c){while(--_0x17127c){_0x1d9aa0['push'](_0x1d9aa0['shift']());}};_0x226868(++_0x272488);}(_0xa0f6,0x1f3));var _0x6a0f=function(_0x328c10,_0x5127cb){_0x328c10=_0x328c10-0x0;var _0x1ac992=_0xa0f6[_0x328c10];return _0x1ac992;};'use strict';var _=require(_0x6a0f('0x0'));var util=require(_0x6a0f('0x1'));var moment=require(_0x6a0f('0x2'));var BPromise=require(_0x6a0f('0x3'));var rs=require(_0x6a0f('0x4'));var fs=require('fs');var Redis=require(_0x6a0f('0x5'));var db=require(_0x6a0f('0x6'))['db'];var utils=require(_0x6a0f('0x7'));var logger=require('../../config/logger')(_0x6a0f('0x8'));var config=require('../../config/environment');var jayson=require(_0x6a0f('0x9'));var client=jayson[_0x6a0f('0xa')][_0x6a0f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x28bd25,_0x4e576c,_0xc03381){return new BPromise(function(_0x4f742f,_0xf8b1c){return client['request'](_0x28bd25,_0xc03381)[_0x6a0f('0xc')](function(_0xf1ecfc){logger[_0x6a0f('0xd')](_0x6a0f('0xe'),_0x4e576c,_0x6a0f('0xf'));logger[_0x6a0f('0x10')]('FaxTransferReport,\x20%s,\x20%s,\x20%s',_0x4e576c,_0x6a0f('0xf'),JSON[_0x6a0f('0x11')](_0xf1ecfc));if(_0xf1ecfc['error']){if(_0xf1ecfc['error'][_0x6a0f('0x12')]===0x1f4){logger[_0x6a0f('0x13')](_0x6a0f('0xe'),_0x4e576c,_0xf1ecfc['error'][_0x6a0f('0x14')]);return _0xf8b1c(_0xf1ecfc[_0x6a0f('0x13')][_0x6a0f('0x14')]);}logger[_0x6a0f('0x13')]('FaxTransferReport,\x20%s,\x20%s',_0x4e576c,_0xf1ecfc['error'][_0x6a0f('0x14')]);return _0x4f742f(_0xf1ecfc[_0x6a0f('0x13')][_0x6a0f('0x14')]);}else{logger[_0x6a0f('0xd')]('FaxTransferReport,\x20%s,\x20%s',_0x4e576c,_0x6a0f('0xf'));_0x4f742f(_0xf1ecfc[_0x6a0f('0x15')][_0x6a0f('0x14')]);}})[_0x6a0f('0x16')](function(_0x4dc11b){logger['error']('FaxTransferReport,\x20%s,\x20%s',_0x4e576c,_0x4dc11b);_0xf8b1c(_0x4dc11b);});});}
\ No newline at end of file
+var _0x40bf=['lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch'];(function(_0x27a283,_0x2fe54a){var _0x255f0e=function(_0x45a784){while(--_0x45a784){_0x27a283['push'](_0x27a283['shift']());}};_0x255f0e(++_0x2fe54a);}(_0x40bf,0x126));var _0xf40b=function(_0x13ce0c,_0x3f2a0d){_0x13ce0c=_0x13ce0c-0x0;var _0x4388fb=_0x40bf[_0x13ce0c];return _0x4388fb;};'use strict';var _=require(_0xf40b('0x0'));var util=require('util');var moment=require(_0xf40b('0x1'));var BPromise=require('bluebird');var rs=require(_0xf40b('0x2'));var fs=require('fs');var Redis=require(_0xf40b('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xf40b('0x4'));var logger=require(_0xf40b('0x5'))(_0xf40b('0x6'));var config=require(_0xf40b('0x7'));var jayson=require(_0xf40b('0x8'));var client=jayson[_0xf40b('0x9')][_0xf40b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x38bf33,_0x190bb1,_0x3d9bb6){return new BPromise(function(_0x4509ef,_0x2534e2){return client['request'](_0x38bf33,_0x3d9bb6)['then'](function(_0x20d5f1){logger['info'](_0xf40b('0xb'),_0x190bb1,_0xf40b('0xc'));logger[_0xf40b('0xd')](_0xf40b('0xe'),_0x190bb1,'request\x20sent',JSON['stringify'](_0x20d5f1));if(_0x20d5f1[_0xf40b('0xf')]){if(_0x20d5f1[_0xf40b('0xf')][_0xf40b('0x10')]===0x1f4){logger[_0xf40b('0xf')](_0xf40b('0xb'),_0x190bb1,_0x20d5f1[_0xf40b('0xf')]['message']);return _0x2534e2(_0x20d5f1[_0xf40b('0xf')][_0xf40b('0x11')]);}logger[_0xf40b('0xf')]('FaxTransferReport,\x20%s,\x20%s',_0x190bb1,_0x20d5f1[_0xf40b('0xf')][_0xf40b('0x11')]);return _0x4509ef(_0x20d5f1[_0xf40b('0xf')][_0xf40b('0x11')]);}else{logger[_0xf40b('0x12')](_0xf40b('0xb'),_0x190bb1,'request\x20sent');_0x4509ef(_0x20d5f1[_0xf40b('0x13')][_0xf40b('0x11')]);}})[_0xf40b('0x14')](function(_0x410c43){logger['error'](_0xf40b('0xb'),_0x190bb1,_0x410c43);_0x2534e2(_0x410c43);});});}
\ No newline at end of file
index 334f946..2861ac2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f98=['post','create','put','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','get','isAuthenticated','/:id','show'];(function(_0x20ef64,_0x4a8fe9){var _0x3707d8=function(_0x5b9a88){while(--_0x5b9a88){_0x20ef64['push'](_0x20ef64['shift']());}};_0x3707d8(++_0x4a8fe9);}(_0x5f98,0x93));var _0x85f9=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0x5f98[_0x278e3c];return _0x3e2d9b;};'use strict';var multer=require(_0x85f9('0x0'));var util=require(_0x85f9('0x1'));var path=require(_0x85f9('0x2'));var timeout=require('connect-timeout');var express=require(_0x85f9('0x3'));var router=express[_0x85f9('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x85f9('0x5'));var interaction=require(_0x85f9('0x6'));var config=require(_0x85f9('0x7'));var controller=require(_0x85f9('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x85f9('0x9')]('/describe',auth[_0x85f9('0xa')](),controller['describe']);router['get'](_0x85f9('0xb'),auth[_0x85f9('0xa')](),controller[_0x85f9('0xc')]);router[_0x85f9('0xd')]('/',auth['isAuthenticated'](),controller[_0x85f9('0xe')]);router[_0x85f9('0xf')](_0x85f9('0xb'),auth[_0x85f9('0xa')](),controller[_0x85f9('0x10')]);router[_0x85f9('0x11')](_0x85f9('0xb'),auth[_0x85f9('0xa')](),controller[_0x85f9('0x12')]);module[_0x85f9('0x13')]=router;
\ No newline at end of file
+var _0x3ae2=['index','isAuthenticated','describe','/:id','show','put','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get'];(function(_0x273dc5,_0x268a81){var _0x46dae7=function(_0x263d62){while(--_0x263d62){_0x273dc5['push'](_0x273dc5['shift']());}};_0x46dae7(++_0x268a81);}(_0x3ae2,0x7f));var _0x23ae=function(_0x333798,_0x9f6561){_0x333798=_0x333798-0x0;var _0x389f4e=_0x3ae2[_0x333798];return _0x389f4e;};'use strict';var multer=require('multer');var util=require(_0x23ae('0x0'));var path=require(_0x23ae('0x1'));var timeout=require(_0x23ae('0x2'));var express=require(_0x23ae('0x3'));var router=express[_0x23ae('0x4')]();var fs_extra=require(_0x23ae('0x5'));var auth=require(_0x23ae('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x23ae('0x7'));var controller=require('./faxTransferReport.controller');router[_0x23ae('0x8')]('/',auth['isAuthenticated'](),controller[_0x23ae('0x9')]);router[_0x23ae('0x8')]('/describe',auth[_0x23ae('0xa')](),controller[_0x23ae('0xb')]);router[_0x23ae('0x8')](_0x23ae('0xc'),auth[_0x23ae('0xa')](),controller[_0x23ae('0xd')]);router['post']('/',auth[_0x23ae('0xa')](),controller['create']);router[_0x23ae('0xe')](_0x23ae('0xc'),auth[_0x23ae('0xa')](),controller['update']);router[_0x23ae('0xf')](_0x23ae('0xc'),auth[_0x23ae('0xa')](),controller[_0x23ae('0x10')]);module['exports']=router;
\ No newline at end of file
index ab1973e..6e44fde 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4178=['../../components/interaction/service','./intDeskAccount.controller','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','create','post','addConfiguration','put','/:id','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x2ad840,_0x473cdd){var _0x4a8f5b=function(_0x51886a){while(--_0x51886a){_0x2ad840['push'](_0x2ad840['shift']());}};_0x4a8f5b(++_0x473cdd);}(_0x4178,0xa0));var _0x8417=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x4178[_0x53ccf2];return _0x5a2964;};'use strict';var multer=require(_0x8417('0x0'));var util=require(_0x8417('0x1'));var path=require(_0x8417('0x2'));var timeout=require(_0x8417('0x3'));var express=require(_0x8417('0x4'));var router=express[_0x8417('0x5')]();var fs_extra=require(_0x8417('0x6'));var auth=require(_0x8417('0x7'));var interaction=require(_0x8417('0x8'));var config=require('../../config/environment');var controller=require(_0x8417('0x9'));router['get']('/',auth[_0x8417('0xa')](),controller['index']);router['get']('/:id',auth[_0x8417('0xa')](),controller[_0x8417('0xb')]);router['get'](_0x8417('0xc'),auth[_0x8417('0xa')](),controller[_0x8417('0xd')]);router['get'](_0x8417('0xe'),auth[_0x8417('0xa')](),controller[_0x8417('0xf')]);router['post']('/',auth[_0x8417('0xa')](),controller[_0x8417('0x10')]);router[_0x8417('0x11')](_0x8417('0xc'),auth['isAuthenticated'](),controller[_0x8417('0x12')]);router[_0x8417('0x13')](_0x8417('0x14'),auth[_0x8417('0xa')](),controller[_0x8417('0x15')]);router[_0x8417('0x16')](_0x8417('0x14'),auth['isAuthenticated'](),controller['destroy']);module[_0x8417('0x17')]=router;
\ No newline at end of file
+var _0x3185=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intDeskAccount.controller','get','isAuthenticated','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','delete','destroy','exports'];(function(_0x17ba7d,_0x3d1ace){var _0x8fd171=function(_0xc08d1f){while(--_0xc08d1f){_0x17ba7d['push'](_0x17ba7d['shift']());}};_0x8fd171(++_0x3d1ace);}(_0x3185,0x177));var _0x5318=function(_0xbdd98b,_0x4d4052){_0xbdd98b=_0xbdd98b-0x0;var _0x37ee6e=_0x3185[_0xbdd98b];return _0x37ee6e;};'use strict';var multer=require(_0x5318('0x0'));var util=require(_0x5318('0x1'));var path=require(_0x5318('0x2'));var timeout=require(_0x5318('0x3'));var express=require(_0x5318('0x4'));var router=express[_0x5318('0x5')]();var fs_extra=require(_0x5318('0x6'));var auth=require(_0x5318('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x5318('0x8'));var controller=require(_0x5318('0x9'));router[_0x5318('0xa')]('/',auth[_0x5318('0xb')](),controller['index']);router[_0x5318('0xa')](_0x5318('0xc'),auth['isAuthenticated'](),controller[_0x5318('0xd')]);router[_0x5318('0xa')](_0x5318('0xe'),auth['isAuthenticated'](),controller[_0x5318('0xf')]);router[_0x5318('0xa')](_0x5318('0x10'),auth[_0x5318('0xb')](),controller[_0x5318('0x11')]);router[_0x5318('0x12')]('/',auth[_0x5318('0xb')](),controller[_0x5318('0x13')]);router['post'](_0x5318('0xe'),auth[_0x5318('0xb')](),controller[_0x5318('0x14')]);router[_0x5318('0x15')](_0x5318('0xc'),auth[_0x5318('0xb')](),controller['update']);router[_0x5318('0x16')](_0x5318('0xc'),auth['isAuthenticated'](),controller[_0x5318('0x17')]);module[_0x5318('0x18')]=router;
\ No newline at end of file
index 41db93c..53d8d2e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7f67=['STRING','ENUM','integrationTab','exports'];(function(_0x153c17,_0x2b2863){var _0x178af3=function(_0x391596){while(--_0x391596){_0x153c17['push'](_0x153c17['shift']());}};_0x178af3(++_0x2b2863);}(_0x7f67,0x1eb));var _0x77f6=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x7f67[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require('sequelize');module[_0x77f6('0x0')]={'name':{'type':Sequelize[_0x77f6('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x77f6('0x1')]},'remoteUri':{'type':Sequelize[_0x77f6('0x1')]},'authType':{'type':Sequelize[_0x77f6('0x2')]('basic'),'defaultValue':'basic'},'password':{'type':Sequelize[_0x77f6('0x1')]},'consumerKey':{'type':Sequelize[_0x77f6('0x1')]},'consumerSecret':{'type':Sequelize[_0x77f6('0x1')]},'token':{'type':Sequelize[_0x77f6('0x1')]},'tokenSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x77f6('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x77f6('0x2')]('integrationTab','newTab'),'defaultValue':_0x77f6('0x3')}};
\ No newline at end of file
+var _0x94cf=['newTab','integrationTab','sequelize','exports','STRING','ENUM','basic'];(function(_0x1bfc4c,_0x13383e){var _0x141d23=function(_0x15a68c){while(--_0x15a68c){_0x1bfc4c['push'](_0x1bfc4c['shift']());}};_0x141d23(++_0x13383e);}(_0x94cf,0xb8));var _0xf94c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x94cf[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xf94c('0x0'));module[_0xf94c('0x1')]={'name':{'type':Sequelize[_0xf94c('0x2')]},'description':{'type':Sequelize[_0xf94c('0x2')]},'username':{'type':Sequelize[_0xf94c('0x2')]},'remoteUri':{'type':Sequelize[_0xf94c('0x2')]},'authType':{'type':Sequelize[_0xf94c('0x3')](_0xf94c('0x4')),'defaultValue':_0xf94c('0x4')},'password':{'type':Sequelize[_0xf94c('0x2')]},'consumerKey':{'type':Sequelize['STRING']},'consumerSecret':{'type':Sequelize[_0xf94c('0x2')]},'token':{'type':Sequelize[_0xf94c('0x2')]},'tokenSecret':{'type':Sequelize[_0xf94c('0x2')]},'serverUrl':{'type':Sequelize[_0xf94c('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xf94c('0x3')]('integrationTab',_0xf94c('0x5')),'defaultValue':_0xf94c('0x6')}};
\ No newline at end of file
index cecaa5c..9cfbcdd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcc6f=['end','json','offset','undefined','count','Content-Range','apply','reject','save','then','destroy','stack','name','index','map','DeskAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','catch','show','includeAll','find','create','body','params','getConfigurations','findOne','DeskConfiguration','order','addConfiguration','AccountId','Subjects','getSubjects','getDescriptions','channel','DeskField','Descriptions','getFields','priority','remoteUri','authType','username','consumerSecret','token','tokenSecret','slice','lastIndexOf','%s/custom_fields','application/json','basic','headers','Authorization','Basic\x20%s','format','%s:%s','password','base64','concat','label','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../components/integrations/configuration','sendStatus','status'];(function(_0x129ed5,_0x4d9e13){var _0x4d8d19=function(_0x1b5854){while(--_0x1b5854){_0x129ed5['push'](_0x129ed5['shift']());}};_0x4d8d19(++_0x4d9e13);}(_0xcc6f,0x138));var _0xfcc6=function(_0x3d42d8,_0x4cffaa){_0x3d42d8=_0x3d42d8-0x0;var _0x27fc41=_0xcc6f[_0x3d42d8];return _0x27fc41;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfcc6('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xfcc6('0x1'));var moment=require(_0xfcc6('0x2'));var BPromise=require(_0xfcc6('0x3'));var Mustache=require(_0xfcc6('0x4'));var util=require(_0xfcc6('0x5'));var path=require(_0xfcc6('0x6'));var sox=require(_0xfcc6('0x7'));var csv=require(_0xfcc6('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfcc6('0x9'));var _=require(_0xfcc6('0xa'));var squel=require(_0xfcc6('0xb'));var crypto=require(_0xfcc6('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xfcc6('0xd'));var toCsv=require(_0xfcc6('0x8'));var querystring=require(_0xfcc6('0xe'));var Papa=require('papaparse');var Redis=require(_0xfcc6('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xfcc6('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xfcc6('0x11'))(_0xfcc6('0x12'));var utils=require(_0xfcc6('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xfcc6('0x14'));var db=require('../../mysqldb')['db'];var integrations=require(_0xfcc6('0x15'));function respondWithStatusCode(_0xa0e3a3,_0x509534){_0x509534=_0x509534||0xcc;return function(_0x21dfb1){if(_0x21dfb1){return _0xa0e3a3[_0xfcc6('0x16')](_0x509534);}return _0xa0e3a3[_0xfcc6('0x17')](_0x509534)[_0xfcc6('0x18')]();};}function respondWithResult(_0x270672,_0x14db13){_0x14db13=_0x14db13||0xc8;return function(_0x460c76){if(_0x460c76){return _0x270672[_0xfcc6('0x17')](_0x14db13)[_0xfcc6('0x19')](_0x460c76);}};}function respondWithFilteredResult(_0x37376d,_0x59d695){return function(_0x18cbe7){if(_0x18cbe7){var _0x35e028=typeof _0x59d695[_0xfcc6('0x1a')]===_0xfcc6('0x1b')&&typeof _0x59d695['limit']===_0xfcc6('0x1b');var _0x5b826f=_0x18cbe7[_0xfcc6('0x1c')];var _0x186f0f=_0x35e028?0x0:_0x59d695[_0xfcc6('0x1a')];var _0x23c757=_0x35e028?_0x18cbe7['count']:_0x59d695[_0xfcc6('0x1a')]+_0x59d695['limit'];var _0x2e0f8c;if(_0x23c757>=_0x5b826f){_0x23c757=_0x5b826f;_0x2e0f8c=0xc8;}else{_0x2e0f8c=0xce;}_0x37376d[_0xfcc6('0x17')](_0x2e0f8c);return _0x37376d['set'](_0xfcc6('0x1d'),_0x186f0f+'-'+_0x23c757+'/'+_0x5b826f)[_0xfcc6('0x19')](_0x18cbe7);}return null;};}function patchUpdates(_0x16e33f){return function(_0x3cba1c){try{jsonpatch[_0xfcc6('0x1e')](_0x3cba1c,_0x16e33f,!![]);}catch(_0x1ebb7d){return BPromise[_0xfcc6('0x1f')](_0x1ebb7d);}return _0x3cba1c[_0xfcc6('0x20')]();};}function saveUpdates(_0x41514b,_0x53a5cc){return function(_0x54dadf){if(_0x54dadf){return _0x54dadf['update'](_0x41514b)[_0xfcc6('0x21')](function(_0x200de5){return _0x200de5;});}return null;};}function removeEntity(_0xca5e7f,_0x361a40){return function(_0x37972a){if(_0x37972a){return _0x37972a[_0xfcc6('0x22')]()[_0xfcc6('0x21')](function(){_0xca5e7f[_0xfcc6('0x17')](0xcc)[_0xfcc6('0x18')]();});}};}function handleEntityNotFound(_0x46de06,_0x5485e9){return function(_0x18fe00){if(!_0x18fe00){_0x46de06['sendStatus'](0x194);}return _0x18fe00;};}function handleError(_0x46d68c,_0x5323cd){_0x5323cd=_0x5323cd||0x1f4;return function(_0x1586f7){logger['error'](_0x1586f7[_0xfcc6('0x23')]);if(_0x1586f7['name']){delete _0x1586f7[_0xfcc6('0x24')];}_0x46d68c['status'](_0x5323cd)['send'](_0x1586f7);};}exports[_0xfcc6('0x25')]=function(_0xa1fc55,_0x1a7df8){var _0x1e12f6={},_0x2eb9c7={},_0x2e815e={'count':0x0,'rows':[]};var _0x458aa3=_[_0xfcc6('0x26')](db[_0xfcc6('0x27')][_0xfcc6('0x28')],function(_0x287263){return{'name':_0x287263[_0xfcc6('0x29')],'type':_0x287263[_0xfcc6('0x2a')][_0xfcc6('0x2b')]};});_0x2eb9c7[_0xfcc6('0x2c')]=_[_0xfcc6('0x26')](_0x458aa3,_0xfcc6('0x24'));_0x2eb9c7[_0xfcc6('0x2d')]=_[_0xfcc6('0x2e')](_0xa1fc55[_0xfcc6('0x2d')]);_0x2eb9c7[_0xfcc6('0x2f')]=_[_0xfcc6('0x30')](_0x2eb9c7[_0xfcc6('0x2c')],_0x2eb9c7['query']);_0x1e12f6['attributes']=_[_0xfcc6('0x30')](_0x2eb9c7[_0xfcc6('0x2c')],qs[_0xfcc6('0x31')](_0xa1fc55[_0xfcc6('0x2d')][_0xfcc6('0x31')]));_0x1e12f6[_0xfcc6('0x32')]=_0x1e12f6[_0xfcc6('0x32')][_0xfcc6('0x33')]?_0x1e12f6[_0xfcc6('0x32')]:_0x2eb9c7['model'];if(!_0xa1fc55[_0xfcc6('0x2d')][_0xfcc6('0x34')](_0xfcc6('0x35'))){_0x1e12f6[_0xfcc6('0x36')]=qs['limit'](_0xa1fc55[_0xfcc6('0x2d')]['limit']);_0x1e12f6[_0xfcc6('0x1a')]=qs[_0xfcc6('0x1a')](_0xa1fc55[_0xfcc6('0x2d')][_0xfcc6('0x1a')]);}_0x1e12f6['order']=qs[_0xfcc6('0x37')](_0xa1fc55[_0xfcc6('0x2d')][_0xfcc6('0x37')]);_0x1e12f6['where']=qs[_0xfcc6('0x2f')](_[_0xfcc6('0x38')](_0xa1fc55[_0xfcc6('0x2d')],_0x2eb9c7[_0xfcc6('0x2f')]),_0x458aa3);if(_0xa1fc55[_0xfcc6('0x2d')][_0xfcc6('0x39')]){_0x1e12f6[_0xfcc6('0x3a')]=_[_0xfcc6('0x3b')](_0x1e12f6['where'],{'$or':_['map'](_0x458aa3,function(_0x52dedb){if(_0x52dedb[_0xfcc6('0x2a')]!==_0xfcc6('0x3c')){var _0x10795c={};_0x10795c[_0x52dedb['name']]={'$like':'%'+_0xa1fc55['query']['filter']+'%'};return _0x10795c;}})});}_0x1e12f6=_['merge']({},_0x1e12f6,_0xa1fc55[_0xfcc6('0x3d')]);var _0x519b5e={'where':_0x1e12f6[_0xfcc6('0x3a')]};return db[_0xfcc6('0x27')][_0xfcc6('0x1c')](_0x519b5e)[_0xfcc6('0x21')](function(_0x4c6111){_0x2e815e['count']=_0x4c6111;if(_0xa1fc55[_0xfcc6('0x2d')]['includeAll']){_0x1e12f6[_0xfcc6('0x3e')]=[{'all':!![]}];}return db['DeskAccount'][_0xfcc6('0x3f')](_0x1e12f6);})[_0xfcc6('0x21')](function(_0x130816){_0x2e815e['rows']=_0x130816;return _0x2e815e;})['then'](respondWithFilteredResult(_0x1a7df8,_0x1e12f6))[_0xfcc6('0x40')](handleError(_0x1a7df8,null));};exports[_0xfcc6('0x41')]=function(_0x37b410,_0x8229a){var _0x145fd8={'raw':![],'where':{'id':_0x37b410['params']['id']}},_0x51e2d3={};_0x51e2d3[_0xfcc6('0x2c')]=_[_0xfcc6('0x2e')](db[_0xfcc6('0x27')][_0xfcc6('0x28')]);_0x51e2d3['query']=_[_0xfcc6('0x2e')](_0x37b410[_0xfcc6('0x2d')]);_0x51e2d3[_0xfcc6('0x2f')]=_['intersection'](_0x51e2d3[_0xfcc6('0x2c')],_0x51e2d3[_0xfcc6('0x2d')]);_0x145fd8[_0xfcc6('0x32')]=_[_0xfcc6('0x30')](_0x51e2d3[_0xfcc6('0x2c')],qs[_0xfcc6('0x31')](_0x37b410[_0xfcc6('0x2d')][_0xfcc6('0x31')]));_0x145fd8[_0xfcc6('0x32')]=_0x145fd8[_0xfcc6('0x32')][_0xfcc6('0x33')]?_0x145fd8[_0xfcc6('0x32')]:_0x51e2d3[_0xfcc6('0x2c')];if(_0x37b410[_0xfcc6('0x2d')][_0xfcc6('0x42')]){_0x145fd8[_0xfcc6('0x3e')]=[{'all':!![]}];}_0x145fd8=_['merge']({},_0x145fd8,_0x37b410[_0xfcc6('0x3d')]);return db[_0xfcc6('0x27')][_0xfcc6('0x43')](_0x145fd8)[_0xfcc6('0x21')](handleEntityNotFound(_0x8229a,null))[_0xfcc6('0x21')](respondWithResult(_0x8229a,null))[_0xfcc6('0x40')](handleError(_0x8229a,null));};exports[_0xfcc6('0x44')]=function(_0x9eb9c6,_0x29bc98){return db['DeskAccount'][_0xfcc6('0x44')](_0x9eb9c6[_0xfcc6('0x45')],{})[_0xfcc6('0x21')](respondWithResult(_0x29bc98,0xc9))[_0xfcc6('0x40')](handleError(_0x29bc98,null));};exports['update']=function(_0xd0d1a0,_0x22b157){if(_0xd0d1a0[_0xfcc6('0x45')]['id']){delete _0xd0d1a0['body']['id'];}return db[_0xfcc6('0x27')][_0xfcc6('0x43')]({'where':{'id':_0xd0d1a0['params']['id']}})['then'](handleEntityNotFound(_0x22b157,null))[_0xfcc6('0x21')](saveUpdates(_0xd0d1a0[_0xfcc6('0x45')],null))[_0xfcc6('0x21')](respondWithResult(_0x22b157,null))['catch'](handleError(_0x22b157,null));};exports['destroy']=function(_0x2ce0d6,_0x5bd74d){return db['DeskAccount'][_0xfcc6('0x43')]({'where':{'id':_0x2ce0d6[_0xfcc6('0x46')]['id']}})[_0xfcc6('0x21')](handleEntityNotFound(_0x5bd74d,null))[_0xfcc6('0x21')](removeEntity(_0x5bd74d,null))[_0xfcc6('0x40')](handleError(_0x5bd74d,null));};exports[_0xfcc6('0x47')]=function(_0x5e831d,_0x13d6ff,_0x5215fb){var _0x26825b={};var _0xd0c9a5={};var _0x42d341;var _0x38890a;return db[_0xfcc6('0x27')][_0xfcc6('0x48')]({'where':{'id':_0x5e831d[_0xfcc6('0x46')]['id']}})[_0xfcc6('0x21')](handleEntityNotFound(_0x13d6ff,null))[_0xfcc6('0x21')](function(_0x183f8d){if(_0x183f8d){_0x42d341=_0x183f8d;_0xd0c9a5[_0xfcc6('0x2c')]=_[_0xfcc6('0x2e')](db[_0xfcc6('0x49')][_0xfcc6('0x28')]);_0xd0c9a5[_0xfcc6('0x2d')]=_['keys'](_0x5e831d[_0xfcc6('0x2d')]);_0xd0c9a5[_0xfcc6('0x2f')]=_[_0xfcc6('0x30')](_0xd0c9a5[_0xfcc6('0x2c')],_0xd0c9a5[_0xfcc6('0x2d')]);_0x26825b[_0xfcc6('0x32')]=_[_0xfcc6('0x30')](_0xd0c9a5[_0xfcc6('0x2c')],qs[_0xfcc6('0x31')](_0x5e831d[_0xfcc6('0x2d')][_0xfcc6('0x31')]));_0x26825b[_0xfcc6('0x32')]=_0x26825b[_0xfcc6('0x32')]['length']?_0x26825b['attributes']:_0xd0c9a5['model'];_0x26825b[_0xfcc6('0x4a')]=qs['sort'](_0x5e831d[_0xfcc6('0x2d')]['sort']);_0x26825b['where']=qs[_0xfcc6('0x2f')](_[_0xfcc6('0x38')](_0x5e831d[_0xfcc6('0x2d')],_0xd0c9a5[_0xfcc6('0x2f')]));if(_0x5e831d['query'][_0xfcc6('0x39')]){_0x26825b[_0xfcc6('0x3a')]=_['merge'](_0x26825b[_0xfcc6('0x3a')],{'$or':_[_0xfcc6('0x26')](_0x26825b[_0xfcc6('0x32')],function(_0x52c232){var _0x403269={};_0x403269[_0x52c232]={'$like':'%'+_0x5e831d[_0xfcc6('0x2d')][_0xfcc6('0x39')]+'%'};return _0x403269;})});}_0x26825b=_[_0xfcc6('0x3b')]({},_0x26825b,_0x5e831d[_0xfcc6('0x3d')]);return _0x42d341[_0xfcc6('0x47')](_0x26825b);}})[_0xfcc6('0x21')](function(_0x1d2e0b){if(_0x1d2e0b){_0x38890a=_0x1d2e0b['length'];if(!_0x5e831d[_0xfcc6('0x2d')][_0xfcc6('0x34')](_0xfcc6('0x35'))){_0x26825b[_0xfcc6('0x36')]=qs[_0xfcc6('0x36')](_0x5e831d['query']['limit']);_0x26825b[_0xfcc6('0x1a')]=qs['offset'](_0x5e831d[_0xfcc6('0x2d')][_0xfcc6('0x1a')]);}return _0x42d341['getConfigurations'](_0x26825b);}})[_0xfcc6('0x21')](function(_0x41c262){if(_0x41c262){return _0x41c262?{'count':_0x38890a,'rows':_0x41c262}:null;}})[_0xfcc6('0x21')](respondWithResult(_0x13d6ff,null))[_0xfcc6('0x40')](handleError(_0x13d6ff,null));};exports[_0xfcc6('0x4b')]=function(_0x1d1788,_0x1c4248,_0xd5d9b6){if(_0x1d1788[_0xfcc6('0x45')]['id']){delete _0x1d1788[_0xfcc6('0x45')]['id'];}return db[_0xfcc6('0x27')][_0xfcc6('0x48')]({'where':{'id':_0x1d1788[_0xfcc6('0x46')]['id']}})[_0xfcc6('0x21')](handleEntityNotFound(_0x1c4248,null))[_0xfcc6('0x21')](function(_0x2e6ed2){if(_0x2e6ed2){_0x1d1788['body'][_0xfcc6('0x4c')]=_0x2e6ed2['id'];_0x1d1788[_0xfcc6('0x45')][_0xfcc6('0x4d')]=integrations[_0xfcc6('0x4e')](_0x1d1788[_0xfcc6('0x45')]['channel'],_0x1d1788[_0xfcc6('0x45')][_0xfcc6('0x2a')]);_0x1d1788[_0xfcc6('0x45')]['Descriptions']=integrations[_0xfcc6('0x4f')](_0x1d1788[_0xfcc6('0x45')][_0xfcc6('0x50')],_0x1d1788[_0xfcc6('0x45')]['type']);return db[_0xfcc6('0x49')][_0xfcc6('0x44')](_0x1d1788[_0xfcc6('0x45')],{'include':[{'model':db[_0xfcc6('0x51')],'as':_0xfcc6('0x4d')},{'model':db[_0xfcc6('0x51')],'as':_0xfcc6('0x52')}]});}return null;})[_0xfcc6('0x21')](respondWithResult(_0x1c4248,null))[_0xfcc6('0x40')](handleError(_0x1c4248,null));};exports[_0xfcc6('0x53')]=function(_0x24a06a,_0x353b62,_0xef7a95){var _0x29d873=[{'name':_0xfcc6('0x54'),'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 _0x1d80e5='';return db[_0xfcc6('0x27')]['findOne']({'where':{'id':_0x24a06a['params']['id']},'attributes':['id',_0xfcc6('0x55'),_0xfcc6('0x56'),_0xfcc6('0x57'),'password','consumerKey',_0xfcc6('0x58'),_0xfcc6('0x59'),_0xfcc6('0x5a')]})[_0xfcc6('0x21')](handleEntityNotFound(_0x353b62,null))[_0xfcc6('0x21')](function(_0x2bf5d7){if(_0x2bf5d7){_0x1d80e5=_0x2bf5d7['remoteUri'];var _0x490a91=_0x1d80e5[_0xfcc6('0x5b')](-0x1);if(_0x490a91==='/'){_0x1d80e5=_0x1d80e5['substring'](0x0,_0x1d80e5[_0xfcc6('0x5c')](_0x490a91));}var _0x57221e={'method':'GET','uri':util['format'](_0xfcc6('0x5d'),_0x1d80e5),'headers':{'Content-Type':_0xfcc6('0x5e'),'Accept':_0xfcc6('0x5e')},'json':!![]};if(_0x2bf5d7[_0xfcc6('0x56')]===_0xfcc6('0x5f')){_0x57221e[_0xfcc6('0x60')][_0xfcc6('0x61')]=util['format'](_0xfcc6('0x62'),new Buffer(util[_0xfcc6('0x63')](_0xfcc6('0x64'),_0x2bf5d7[_0xfcc6('0x57')],_0x2bf5d7[_0xfcc6('0x65')]))['toString'](_0xfcc6('0x66')));}return rp(_0x57221e)[_0xfcc6('0x21')](function(_0x28f2a3){return _0x29d873[_0xfcc6('0x67')](_['map'](_0x28f2a3['_embedded']['entries'],function(_0xd726f5){return{'id':_0xd726f5[_0xfcc6('0x24')],'name':_0xd726f5[_0xfcc6('0x24')],'type':_0xd726f5[_0xfcc6('0x2a')],'active':_0xd726f5['active'],'label':_0xd726f5[_0xfcc6('0x68')],'custom':!![]};}));});}})[_0xfcc6('0x21')](function(_0x57d43b){return{'count':_0x57d43b[_0xfcc6('0x33')],'rows':_0x57d43b};})[_0xfcc6('0x21')](respondWithResult(_0x353b62,null))[_0xfcc6('0x40')](function(_0x488e22){var _0x3c261c=_0x24a06a[_0xfcc6('0x2d')][_0xfcc6('0x69')]?0x1f4:_0x488e22[_0xfcc6('0x6a')]||0x1f4;logger[_0xfcc6('0x6b')](_0xfcc6('0x6c'),_0xfcc6('0x53'),_0x3c261c,JSON[_0xfcc6('0x6d')](_0x488e22));delete _0x488e22[_0xfcc6('0x24')];if(_0x3c261c===0x191){_0x3c261c=0x190;}_0x353b62[_0xfcc6('0x17')](_0x3c261c)[_0xfcc6('0x6e')](_0x24a06a[_0xfcc6('0x2d')][_0xfcc6('0x69')]?{'message':_0xfcc6('0x6f'),'statusCode':_0x488e22[_0xfcc6('0x6a')]}:_0x488e22);});};
\ No newline at end of file
+var _0xd1e2=['findAll','rows','catch','show','params','length','find','body','getConfigurations','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','create','DeskField','getFields','priority','remoteUri','authType','token','slice','lastIndexOf','GET','format','%s/custom_fields','application/json','basic','Basic\x20%s','%s:%s','username','password','toString','base64','concat','_embedded','entries','active','label','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','json','limit','count','set','Content-Range','apply','reject','update','then','destroy','sendStatus','stack','name','send','index','map','DeskAccount','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','offset','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include'];(function(_0x4b49c9,_0x290d55){var _0xab2d67=function(_0x3a8e9c){while(--_0x3a8e9c){_0x4b49c9['push'](_0x4b49c9['shift']());}};_0xab2d67(++_0x290d55);}(_0xd1e2,0x9f));var _0x2d1e=function(_0x3c0c5d,_0x5e4829){_0x3c0c5d=_0x3c0c5d-0x0;var _0x2b9552=_0xd1e2[_0x3c0c5d];return _0x2b9552;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x2d1e('0x0'));var rp=require(_0x2d1e('0x1'));var moment=require('moment');var BPromise=require(_0x2d1e('0x2'));var Mustache=require(_0x2d1e('0x3'));var util=require(_0x2d1e('0x4'));var path=require(_0x2d1e('0x5'));var sox=require(_0x2d1e('0x6'));var csv=require(_0x2d1e('0x7'));var ejs=require(_0x2d1e('0x8'));var fs=require('fs');var fs_extra=require(_0x2d1e('0x9'));var _=require(_0x2d1e('0xa'));var squel=require('squel');var crypto=require(_0x2d1e('0xb'));var jsforce=require(_0x2d1e('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x2d1e('0xd'));var Papa=require(_0x2d1e('0xe'));var Redis=require(_0x2d1e('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x2d1e('0x10'));var hardwareService=require(_0x2d1e('0x11'));var logger=require(_0x2d1e('0x12'))(_0x2d1e('0x13'));var utils=require(_0x2d1e('0x14'));var config=require(_0x2d1e('0x15'));var licenseUtil=require(_0x2d1e('0x16'));var db=require(_0x2d1e('0x17'))['db'];var integrations=require(_0x2d1e('0x18'));function respondWithStatusCode(_0xa8e634,_0x417a18){_0x417a18=_0x417a18||0xcc;return function(_0x141ecc){if(_0x141ecc){return _0xa8e634['sendStatus'](_0x417a18);}return _0xa8e634[_0x2d1e('0x19')](_0x417a18)[_0x2d1e('0x1a')]();};}function respondWithResult(_0x4e2697,_0x6b3b57){_0x6b3b57=_0x6b3b57||0xc8;return function(_0x1485af){if(_0x1485af){return _0x4e2697[_0x2d1e('0x19')](_0x6b3b57)[_0x2d1e('0x1b')](_0x1485af);}};}function respondWithFilteredResult(_0x730699,_0x3a8aa4){return function(_0x191032){if(_0x191032){var _0x2f4e4b=typeof _0x3a8aa4['offset']==='undefined'&&typeof _0x3a8aa4[_0x2d1e('0x1c')]==='undefined';var _0x1dba1d=_0x191032['count'];var _0x536178=_0x2f4e4b?0x0:_0x3a8aa4['offset'];var _0x5e8b6c=_0x2f4e4b?_0x191032[_0x2d1e('0x1d')]:_0x3a8aa4['offset']+_0x3a8aa4[_0x2d1e('0x1c')];var _0x1ff05e;if(_0x5e8b6c>=_0x1dba1d){_0x5e8b6c=_0x1dba1d;_0x1ff05e=0xc8;}else{_0x1ff05e=0xce;}_0x730699[_0x2d1e('0x19')](_0x1ff05e);return _0x730699[_0x2d1e('0x1e')](_0x2d1e('0x1f'),_0x536178+'-'+_0x5e8b6c+'/'+_0x1dba1d)[_0x2d1e('0x1b')](_0x191032);}return null;};}function patchUpdates(_0x34fbae){return function(_0x648cb7){try{jsonpatch[_0x2d1e('0x20')](_0x648cb7,_0x34fbae,!![]);}catch(_0x363d64){return BPromise[_0x2d1e('0x21')](_0x363d64);}return _0x648cb7['save']();};}function saveUpdates(_0x2ba5ff,_0x38f71d){return function(_0x266906){if(_0x266906){return _0x266906[_0x2d1e('0x22')](_0x2ba5ff)[_0x2d1e('0x23')](function(_0x33051e){return _0x33051e;});}return null;};}function removeEntity(_0x53bbec,_0x33cdd7){return function(_0x147d88){if(_0x147d88){return _0x147d88[_0x2d1e('0x24')]()['then'](function(){_0x53bbec['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x156c30,_0x19013f){return function(_0x33c826){if(!_0x33c826){_0x156c30[_0x2d1e('0x25')](0x194);}return _0x33c826;};}function handleError(_0x4a5077,_0x4f60a5){_0x4f60a5=_0x4f60a5||0x1f4;return function(_0x4786d0){logger['error'](_0x4786d0[_0x2d1e('0x26')]);if(_0x4786d0[_0x2d1e('0x27')]){delete _0x4786d0[_0x2d1e('0x27')];}_0x4a5077[_0x2d1e('0x19')](_0x4f60a5)[_0x2d1e('0x28')](_0x4786d0);};}exports[_0x2d1e('0x29')]=function(_0x51a8a0,_0x11054f){var _0x45f39a={},_0x915247={},_0x523be1={'count':0x0,'rows':[]};var _0x55d6d5=_[_0x2d1e('0x2a')](db[_0x2d1e('0x2b')][_0x2d1e('0x2c')],function(_0x2acf43){return{'name':_0x2acf43['fieldName'],'type':_0x2acf43[_0x2d1e('0x2d')][_0x2d1e('0x2e')]};});_0x915247[_0x2d1e('0x2f')]=_[_0x2d1e('0x2a')](_0x55d6d5,'name');_0x915247[_0x2d1e('0x30')]=_[_0x2d1e('0x31')](_0x51a8a0['query']);_0x915247[_0x2d1e('0x32')]=_[_0x2d1e('0x33')](_0x915247[_0x2d1e('0x2f')],_0x915247[_0x2d1e('0x30')]);_0x45f39a['attributes']=_['intersection'](_0x915247[_0x2d1e('0x2f')],qs['fields'](_0x51a8a0[_0x2d1e('0x30')][_0x2d1e('0x34')]));_0x45f39a[_0x2d1e('0x35')]=_0x45f39a['attributes']['length']?_0x45f39a[_0x2d1e('0x35')]:_0x915247[_0x2d1e('0x2f')];if(!_0x51a8a0[_0x2d1e('0x30')][_0x2d1e('0x36')](_0x2d1e('0x37'))){_0x45f39a[_0x2d1e('0x1c')]=qs[_0x2d1e('0x1c')](_0x51a8a0[_0x2d1e('0x30')]['limit']);_0x45f39a['offset']=qs[_0x2d1e('0x38')](_0x51a8a0[_0x2d1e('0x30')][_0x2d1e('0x38')]);}_0x45f39a[_0x2d1e('0x39')]=qs[_0x2d1e('0x3a')](_0x51a8a0['query'][_0x2d1e('0x3a')]);_0x45f39a[_0x2d1e('0x3b')]=qs[_0x2d1e('0x32')](_[_0x2d1e('0x3c')](_0x51a8a0[_0x2d1e('0x30')],_0x915247[_0x2d1e('0x32')]),_0x55d6d5);if(_0x51a8a0[_0x2d1e('0x30')]['filter']){_0x45f39a[_0x2d1e('0x3b')]=_[_0x2d1e('0x3d')](_0x45f39a[_0x2d1e('0x3b')],{'$or':_[_0x2d1e('0x2a')](_0x55d6d5,function(_0x15cc1e){if(_0x15cc1e[_0x2d1e('0x2d')]!==_0x2d1e('0x3e')){var _0x497c86={};_0x497c86[_0x15cc1e[_0x2d1e('0x27')]]={'$like':'%'+_0x51a8a0[_0x2d1e('0x30')][_0x2d1e('0x3f')]+'%'};return _0x497c86;}})});}_0x45f39a=_[_0x2d1e('0x3d')]({},_0x45f39a,_0x51a8a0[_0x2d1e('0x40')]);var _0x3be758={'where':_0x45f39a[_0x2d1e('0x3b')]};return db[_0x2d1e('0x2b')][_0x2d1e('0x1d')](_0x3be758)[_0x2d1e('0x23')](function(_0x37cc5c){_0x523be1[_0x2d1e('0x1d')]=_0x37cc5c;if(_0x51a8a0[_0x2d1e('0x30')][_0x2d1e('0x41')]){_0x45f39a[_0x2d1e('0x42')]=[{'all':!![]}];}return db[_0x2d1e('0x2b')][_0x2d1e('0x43')](_0x45f39a);})['then'](function(_0x1a8dda){_0x523be1[_0x2d1e('0x44')]=_0x1a8dda;return _0x523be1;})[_0x2d1e('0x23')](respondWithFilteredResult(_0x11054f,_0x45f39a))[_0x2d1e('0x45')](handleError(_0x11054f,null));};exports[_0x2d1e('0x46')]=function(_0x343dc0,_0x35cac2){var _0x3ca236={'raw':![],'where':{'id':_0x343dc0[_0x2d1e('0x47')]['id']}},_0x328632={};_0x328632[_0x2d1e('0x2f')]=_[_0x2d1e('0x31')](db[_0x2d1e('0x2b')][_0x2d1e('0x2c')]);_0x328632[_0x2d1e('0x30')]=_[_0x2d1e('0x31')](_0x343dc0[_0x2d1e('0x30')]);_0x328632['filters']=_[_0x2d1e('0x33')](_0x328632[_0x2d1e('0x2f')],_0x328632['query']);_0x3ca236[_0x2d1e('0x35')]=_[_0x2d1e('0x33')](_0x328632['model'],qs['fields'](_0x343dc0[_0x2d1e('0x30')][_0x2d1e('0x34')]));_0x3ca236[_0x2d1e('0x35')]=_0x3ca236['attributes'][_0x2d1e('0x48')]?_0x3ca236[_0x2d1e('0x35')]:_0x328632[_0x2d1e('0x2f')];if(_0x343dc0[_0x2d1e('0x30')]['includeAll']){_0x3ca236[_0x2d1e('0x42')]=[{'all':!![]}];}_0x3ca236=_[_0x2d1e('0x3d')]({},_0x3ca236,_0x343dc0[_0x2d1e('0x40')]);return db[_0x2d1e('0x2b')][_0x2d1e('0x49')](_0x3ca236)[_0x2d1e('0x23')](handleEntityNotFound(_0x35cac2,null))[_0x2d1e('0x23')](respondWithResult(_0x35cac2,null))['catch'](handleError(_0x35cac2,null));};exports['create']=function(_0xb95e2,_0xa7f114){return db[_0x2d1e('0x2b')]['create'](_0xb95e2['body'],{})[_0x2d1e('0x23')](respondWithResult(_0xa7f114,0xc9))[_0x2d1e('0x45')](handleError(_0xa7f114,null));};exports[_0x2d1e('0x22')]=function(_0x1ca52e,_0x9c78d7){if(_0x1ca52e['body']['id']){delete _0x1ca52e[_0x2d1e('0x4a')]['id'];}return db['DeskAccount']['find']({'where':{'id':_0x1ca52e['params']['id']}})[_0x2d1e('0x23')](handleEntityNotFound(_0x9c78d7,null))[_0x2d1e('0x23')](saveUpdates(_0x1ca52e[_0x2d1e('0x4a')],null))[_0x2d1e('0x23')](respondWithResult(_0x9c78d7,null))[_0x2d1e('0x45')](handleError(_0x9c78d7,null));};exports[_0x2d1e('0x24')]=function(_0x29f85f,_0x3f9cde){return db['DeskAccount'][_0x2d1e('0x49')]({'where':{'id':_0x29f85f[_0x2d1e('0x47')]['id']}})[_0x2d1e('0x23')](handleEntityNotFound(_0x3f9cde,null))[_0x2d1e('0x23')](removeEntity(_0x3f9cde,null))['catch'](handleError(_0x3f9cde,null));};exports['getConfigurations']=function(_0x672ccb,_0x22b2e0,_0x73b2c4){var _0x433595={};var _0x55dc77={};var _0x3f7b64;var _0x10e13c;return db['DeskAccount']['findOne']({'where':{'id':_0x672ccb['params']['id']}})[_0x2d1e('0x23')](handleEntityNotFound(_0x22b2e0,null))[_0x2d1e('0x23')](function(_0x399f96){if(_0x399f96){_0x3f7b64=_0x399f96;_0x55dc77[_0x2d1e('0x2f')]=_[_0x2d1e('0x31')](db['DeskConfiguration']['rawAttributes']);_0x55dc77[_0x2d1e('0x30')]=_[_0x2d1e('0x31')](_0x672ccb['query']);_0x55dc77['filters']=_[_0x2d1e('0x33')](_0x55dc77[_0x2d1e('0x2f')],_0x55dc77[_0x2d1e('0x30')]);_0x433595[_0x2d1e('0x35')]=_[_0x2d1e('0x33')](_0x55dc77[_0x2d1e('0x2f')],qs[_0x2d1e('0x34')](_0x672ccb[_0x2d1e('0x30')]['fields']));_0x433595[_0x2d1e('0x35')]=_0x433595[_0x2d1e('0x35')][_0x2d1e('0x48')]?_0x433595[_0x2d1e('0x35')]:_0x55dc77[_0x2d1e('0x2f')];_0x433595['order']=qs['sort'](_0x672ccb[_0x2d1e('0x30')]['sort']);_0x433595[_0x2d1e('0x3b')]=qs[_0x2d1e('0x32')](_[_0x2d1e('0x3c')](_0x672ccb[_0x2d1e('0x30')],_0x55dc77[_0x2d1e('0x32')]));if(_0x672ccb['query'][_0x2d1e('0x3f')]){_0x433595[_0x2d1e('0x3b')]=_['merge'](_0x433595[_0x2d1e('0x3b')],{'$or':_['map'](_0x433595[_0x2d1e('0x35')],function(_0x3ad519){var _0x521c04={};_0x521c04[_0x3ad519]={'$like':'%'+_0x672ccb[_0x2d1e('0x30')][_0x2d1e('0x3f')]+'%'};return _0x521c04;})});}_0x433595=_[_0x2d1e('0x3d')]({},_0x433595,_0x672ccb[_0x2d1e('0x40')]);return _0x3f7b64[_0x2d1e('0x4b')](_0x433595);}})[_0x2d1e('0x23')](function(_0x3c83ff){if(_0x3c83ff){_0x10e13c=_0x3c83ff[_0x2d1e('0x48')];if(!_0x672ccb[_0x2d1e('0x30')][_0x2d1e('0x36')](_0x2d1e('0x37'))){_0x433595[_0x2d1e('0x1c')]=qs[_0x2d1e('0x1c')](_0x672ccb[_0x2d1e('0x30')]['limit']);_0x433595['offset']=qs['offset'](_0x672ccb['query']['offset']);}return _0x3f7b64[_0x2d1e('0x4b')](_0x433595);}})[_0x2d1e('0x23')](function(_0x3cd137){if(_0x3cd137){return _0x3cd137?{'count':_0x10e13c,'rows':_0x3cd137}:null;}})[_0x2d1e('0x23')](respondWithResult(_0x22b2e0,null))['catch'](handleError(_0x22b2e0,null));};exports['addConfiguration']=function(_0x1d092f,_0x319df8,_0x1363ca){if(_0x1d092f['body']['id']){delete _0x1d092f['body']['id'];}return db[_0x2d1e('0x2b')][_0x2d1e('0x4c')]({'where':{'id':_0x1d092f['params']['id']}})[_0x2d1e('0x23')](handleEntityNotFound(_0x319df8,null))[_0x2d1e('0x23')](function(_0x1fdb9d){if(_0x1fdb9d){_0x1d092f[_0x2d1e('0x4a')][_0x2d1e('0x4d')]=_0x1fdb9d['id'];_0x1d092f[_0x2d1e('0x4a')][_0x2d1e('0x4e')]=integrations[_0x2d1e('0x4f')](_0x1d092f[_0x2d1e('0x4a')][_0x2d1e('0x50')],_0x1d092f[_0x2d1e('0x4a')]['type']);_0x1d092f['body'][_0x2d1e('0x51')]=integrations[_0x2d1e('0x52')](_0x1d092f[_0x2d1e('0x4a')][_0x2d1e('0x50')],_0x1d092f[_0x2d1e('0x4a')][_0x2d1e('0x2d')]);return db['DeskConfiguration'][_0x2d1e('0x53')](_0x1d092f[_0x2d1e('0x4a')],{'include':[{'model':db[_0x2d1e('0x54')],'as':_0x2d1e('0x4e')},{'model':db[_0x2d1e('0x54')],'as':_0x2d1e('0x51')}]});}return null;})[_0x2d1e('0x23')](respondWithResult(_0x319df8,null))['catch'](handleError(_0x319df8,null));};exports[_0x2d1e('0x55')]=function(_0x4862e9,_0x1ee054,_0x5b3d2d){var _0x160760=[{'name':_0x2d1e('0x56'),'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 _0x1776ad='';return db['DeskAccount'][_0x2d1e('0x4c')]({'where':{'id':_0x4862e9[_0x2d1e('0x47')]['id']},'attributes':['id',_0x2d1e('0x57'),_0x2d1e('0x58'),'username','password','consumerKey','consumerSecret',_0x2d1e('0x59'),'tokenSecret']})[_0x2d1e('0x23')](handleEntityNotFound(_0x1ee054,null))[_0x2d1e('0x23')](function(_0x5d41bf){if(_0x5d41bf){_0x1776ad=_0x5d41bf[_0x2d1e('0x57')];var _0x5561ae=_0x1776ad[_0x2d1e('0x5a')](-0x1);if(_0x5561ae==='/'){_0x1776ad=_0x1776ad['substring'](0x0,_0x1776ad[_0x2d1e('0x5b')](_0x5561ae));}var _0x2bf896={'method':_0x2d1e('0x5c'),'uri':util[_0x2d1e('0x5d')](_0x2d1e('0x5e'),_0x1776ad),'headers':{'Content-Type':'application/json','Accept':_0x2d1e('0x5f')},'json':!![]};if(_0x5d41bf[_0x2d1e('0x58')]===_0x2d1e('0x60')){_0x2bf896['headers']['Authorization']=util[_0x2d1e('0x5d')](_0x2d1e('0x61'),new Buffer(util['format'](_0x2d1e('0x62'),_0x5d41bf[_0x2d1e('0x63')],_0x5d41bf[_0x2d1e('0x64')]))[_0x2d1e('0x65')](_0x2d1e('0x66')));}return rp(_0x2bf896)['then'](function(_0x1a9275){return _0x160760[_0x2d1e('0x67')](_[_0x2d1e('0x2a')](_0x1a9275[_0x2d1e('0x68')][_0x2d1e('0x69')],function(_0x4bbf66){return{'id':_0x4bbf66[_0x2d1e('0x27')],'name':_0x4bbf66['name'],'type':_0x4bbf66[_0x2d1e('0x2d')],'active':_0x4bbf66[_0x2d1e('0x6a')],'label':_0x4bbf66[_0x2d1e('0x6b')],'custom':!![]};}));});}})[_0x2d1e('0x23')](function(_0x3217f){return{'count':_0x3217f['length'],'rows':_0x3217f};})[_0x2d1e('0x23')](respondWithResult(_0x1ee054,null))[_0x2d1e('0x45')](function(_0x72edcf){var _0x46e079=_0x4862e9['query'][_0x2d1e('0x6c')]?0x1f4:_0x72edcf[_0x2d1e('0x6d')]||0x1f4;logger['error'](_0x2d1e('0x6e'),_0x2d1e('0x55'),_0x46e079,JSON[_0x2d1e('0x6f')](_0x72edcf));delete _0x72edcf[_0x2d1e('0x27')];if(_0x46e079===0x191){_0x46e079=0x190;}_0x1ee054[_0x2d1e('0x19')](_0x46e079)[_0x2d1e('0x28')](_0x4862e9[_0x2d1e('0x30')][_0x2d1e('0x6c')]?{'message':_0x2d1e('0x70'),'statusCode':_0x72edcf[_0x2d1e('0x6d')]}:_0x72edcf);});};
\ No newline at end of file
index 360abe4..2a26f7f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x27b4=['../../components/integrations/configuration','exports','define','DeskAccount','int_desk_accounts','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intDeskAccount.attributes'];(function(_0x291374,_0x149155){var _0x239be2=function(_0x18ec2c){while(--_0x18ec2c){_0x291374['push'](_0x291374['shift']());}};_0x239be2(++_0x149155);}(_0x27b4,0x12b));var _0x427b=function(_0x4faee7,_0x53c8a7){_0x4faee7=_0x4faee7-0x0;var _0x53bccd=_0x27b4[_0x4faee7];return _0x53bccd;};'use strict';var _=require(_0x427b('0x0'));var util=require(_0x427b('0x1'));var logger=require('../../config/logger')(_0x427b('0x2'));var moment=require(_0x427b('0x3'));var BPromise=require(_0x427b('0x4'));var rp=require(_0x427b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x427b('0x6'));var config=require(_0x427b('0x7'));var attributes=require(_0x427b('0x8'));var integrations=require(_0x427b('0x9'));module[_0x427b('0xa')]=function(_0x472144,_0x4e669a){return _0x472144[_0x427b('0xb')](_0x427b('0xc'),attributes,{'tableName':_0x427b('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd9a3=['../../config/environment','../../components/integrations/configuration','define','lodash','util','api','request-promise','path'];(function(_0x457d5c,_0x7c8200){var _0x517081=function(_0x43f091){while(--_0x43f091){_0x457d5c['push'](_0x457d5c['shift']());}};_0x517081(++_0x7c8200);}(_0xd9a3,0x103));var _0x3d9a=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd9a3[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x3d9a('0x0'));var util=require(_0x3d9a('0x1'));var logger=require('../../config/logger')(_0x3d9a('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x3d9a('0x3'));var fs=require('fs');var path=require(_0x3d9a('0x4'));var rimraf=require('rimraf');var config=require(_0x3d9a('0x5'));var attributes=require('./intDeskAccount.attributes');var integrations=require(_0x3d9a('0x6'));module['exports']=function(_0x4503a6,_0x3bf469){return _0x4503a6[_0x3d9a('0x7')]('DeskAccount',attributes,{'tableName':'int_desk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 1870dcd..89b92cc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6e02=['raw','where','attributes','map','include','model','GetDeskAccount','ShowDeskAccount','find','lodash','util','moment','randomstring','../../config/utils','../../config/environment','jayson/promise','client','request','info','request\x20sent','debug','stringify','error','code','message','DeskAccount,\x20%s,\x20%s','result','catch','DeskAccount','findAll','options'];(function(_0x3d8111,_0x5e0c4a){var _0x37f662=function(_0x12f29d){while(--_0x12f29d){_0x3d8111['push'](_0x3d8111['shift']());}};_0x37f662(++_0x5e0c4a);}(_0x6e02,0x66));var _0x26e0=function(_0x592bb1,_0xe0b807){_0x592bb1=_0x592bb1-0x0;var _0x2cc70a=_0x6e02[_0x592bb1];return _0x2cc70a;};'use strict';var _=require(_0x26e0('0x0'));var util=require(_0x26e0('0x1'));var moment=require(_0x26e0('0x2'));var BPromise=require('bluebird');var rs=require(_0x26e0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x26e0('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x26e0('0x5'));var jayson=require(_0x26e0('0x6'));var client=jayson[_0x26e0('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x555053,_0x16ff8e,_0x363668){return new BPromise(function(_0x4a59b5,_0x46bc39){return client[_0x26e0('0x8')](_0x555053,_0x363668)['then'](function(_0x5ebb0e){logger[_0x26e0('0x9')]('DeskAccount,\x20%s,\x20%s',_0x16ff8e,_0x26e0('0xa'));logger[_0x26e0('0xb')]('DeskAccount,\x20%s,\x20%s,\x20%s',_0x16ff8e,_0x26e0('0xa'),JSON[_0x26e0('0xc')](_0x5ebb0e));if(_0x5ebb0e[_0x26e0('0xd')]){if(_0x5ebb0e[_0x26e0('0xd')][_0x26e0('0xe')]===0x1f4){logger[_0x26e0('0xd')]('DeskAccount,\x20%s,\x20%s',_0x16ff8e,_0x5ebb0e[_0x26e0('0xd')][_0x26e0('0xf')]);return _0x46bc39(_0x5ebb0e[_0x26e0('0xd')][_0x26e0('0xf')]);}logger[_0x26e0('0xd')](_0x26e0('0x10'),_0x16ff8e,_0x5ebb0e['error'][_0x26e0('0xf')]);return _0x4a59b5(_0x5ebb0e[_0x26e0('0xd')]['message']);}else{logger[_0x26e0('0x9')](_0x26e0('0x10'),_0x16ff8e,_0x26e0('0xa'));_0x4a59b5(_0x5ebb0e[_0x26e0('0x11')][_0x26e0('0xf')]);}})[_0x26e0('0x12')](function(_0xdfbe7a){logger[_0x26e0('0xd')]('DeskAccount,\x20%s,\x20%s',_0x16ff8e,_0xdfbe7a);_0x46bc39(_0xdfbe7a);});});}exports['GetDeskAccount']=function(_0x459280){var _0x1267a6=this;return new Promise(function(_0x30c2ad,_0x2c0f1d){return db[_0x26e0('0x13')][_0x26e0('0x14')]({'raw':_0x459280[_0x26e0('0x15')]?_0x459280[_0x26e0('0x15')][_0x26e0('0x16')]===undefined?!![]:![]:!![],'where':_0x459280[_0x26e0('0x15')]?_0x459280[_0x26e0('0x15')][_0x26e0('0x17')]||null:null,'attributes':_0x459280['options']?_0x459280[_0x26e0('0x15')][_0x26e0('0x18')]||null:null,'limit':_0x459280[_0x26e0('0x15')]?_0x459280['options']['limit']||null:null,'include':_0x459280[_0x26e0('0x15')]?_0x459280[_0x26e0('0x15')]['include']?_[_0x26e0('0x19')](_0x459280[_0x26e0('0x15')][_0x26e0('0x1a')],function(_0x493c87){return{'model':db[_0x493c87[_0x26e0('0x1b')]],'as':_0x493c87['as'],'attributes':_0x493c87['attributes'],'include':_0x493c87[_0x26e0('0x1a')]?_[_0x26e0('0x19')](_0x493c87[_0x26e0('0x1a')],function(_0x153a46){return{'model':db[_0x153a46['model']],'as':_0x153a46['as'],'attributes':_0x153a46['attributes'],'include':_0x153a46[_0x26e0('0x1a')]?_['map'](_0x153a46[_0x26e0('0x1a')],function(_0x1aa4c1){return{'model':db[_0x1aa4c1['model']],'as':_0x1aa4c1['as'],'attributes':_0x1aa4c1[_0x26e0('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x15d19f){logger[_0x26e0('0x9')](_0x26e0('0x1c'),_0x459280);logger[_0x26e0('0xb')](_0x26e0('0x1c'),_0x459280,JSON[_0x26e0('0xc')](_0x15d19f));_0x30c2ad(_0x15d19f);})[_0x26e0('0x12')](function(_0x1fc41e){logger[_0x26e0('0xd')]('GetDeskAccount',_0x1fc41e['message'],_0x459280);_0x2c0f1d(_0x1267a6['error'](0x1f4,_0x1fc41e[_0x26e0('0xf')]));});});};exports[_0x26e0('0x1d')]=function(_0x4caa26){var _0x7ec2f0=this;return new Promise(function(_0x2bf280,_0x37f884){return db[_0x26e0('0x13')][_0x26e0('0x1e')]({'raw':_0x4caa26[_0x26e0('0x15')]?_0x4caa26[_0x26e0('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x4caa26['options']?_0x4caa26[_0x26e0('0x15')]['where']||null:null,'attributes':_0x4caa26[_0x26e0('0x15')]?_0x4caa26[_0x26e0('0x15')]['attributes']||null:null,'include':_0x4caa26[_0x26e0('0x15')]?_0x4caa26[_0x26e0('0x15')]['include']?_['map'](_0x4caa26[_0x26e0('0x15')][_0x26e0('0x1a')],function(_0x39766d){return{'model':db[_0x39766d[_0x26e0('0x1b')]],'as':_0x39766d['as'],'attributes':_0x39766d[_0x26e0('0x18')],'include':_0x39766d[_0x26e0('0x1a')]?_[_0x26e0('0x19')](_0x39766d['include'],function(_0x274326){return{'model':db[_0x274326[_0x26e0('0x1b')]],'as':_0x274326['as'],'attributes':_0x274326['attributes'],'include':_0x274326['include']?_['map'](_0x274326['include'],function(_0x579647){return{'model':db[_0x579647['model']],'as':_0x579647['as'],'attributes':_0x579647[_0x26e0('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x489c29){logger['info']('ShowDeskAccount',_0x4caa26);logger[_0x26e0('0xb')](_0x26e0('0x1d'),_0x4caa26,JSON['stringify'](_0x489c29));_0x2bf280(_0x489c29);})[_0x26e0('0x12')](function(_0x4ec274){logger[_0x26e0('0xd')](_0x26e0('0x1d'),_0x4ec274['message'],_0x4caa26);_0x37f884(_0x7ec2f0[_0x26e0('0xd')](0x1f4,_0x4ec274[_0x26e0('0xf')]));});});};
\ No newline at end of file
+var _0xc822=['options','raw','where','attributes','limit','map','include','model','GetDeskAccount','catch','ShowDeskAccount','find','then','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','request','info','DeskAccount,\x20%s,\x20%s','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','findAll'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0xc822,0x70));var _0x2c82=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0xc822[_0xbb091];return _0x467a04;};'use strict';var _=require(_0x2c82('0x0'));var util=require('util');var moment=require(_0x2c82('0x1'));var BPromise=require(_0x2c82('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2c82('0x3'));var db=require(_0x2c82('0x4'))['db'];var utils=require(_0x2c82('0x5'));var logger=require(_0x2c82('0x6'))(_0x2c82('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x2c82('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x43e7b7,_0xc3fd43,_0x4e0678){return new BPromise(function(_0x489734,_0x263d0b){return client[_0x2c82('0x9')](_0x43e7b7,_0x4e0678)['then'](function(_0x1da99f){logger[_0x2c82('0xa')](_0x2c82('0xb'),_0xc3fd43,'request\x20sent');logger[_0x2c82('0xc')](_0x2c82('0xd'),_0xc3fd43,'request\x20sent',JSON[_0x2c82('0xe')](_0x1da99f));if(_0x1da99f['error']){if(_0x1da99f[_0x2c82('0xf')][_0x2c82('0x10')]===0x1f4){logger[_0x2c82('0xf')](_0x2c82('0xb'),_0xc3fd43,_0x1da99f[_0x2c82('0xf')][_0x2c82('0x11')]);return _0x263d0b(_0x1da99f[_0x2c82('0xf')][_0x2c82('0x11')]);}logger[_0x2c82('0xf')](_0x2c82('0xb'),_0xc3fd43,_0x1da99f[_0x2c82('0xf')][_0x2c82('0x11')]);return _0x489734(_0x1da99f[_0x2c82('0xf')][_0x2c82('0x11')]);}else{logger[_0x2c82('0xa')]('DeskAccount,\x20%s,\x20%s',_0xc3fd43,_0x2c82('0x12'));_0x489734(_0x1da99f['result'][_0x2c82('0x11')]);}})['catch'](function(_0x12c361){logger['error'](_0x2c82('0xb'),_0xc3fd43,_0x12c361);_0x263d0b(_0x12c361);});});}exports['GetDeskAccount']=function(_0x49c45d){var _0x1e7729=this;return new Promise(function(_0x181136,_0x4482bd){return db['DeskAccount'][_0x2c82('0x13')]({'raw':_0x49c45d[_0x2c82('0x14')]?_0x49c45d['options'][_0x2c82('0x15')]===undefined?!![]:![]:!![],'where':_0x49c45d[_0x2c82('0x14')]?_0x49c45d[_0x2c82('0x14')][_0x2c82('0x16')]||null:null,'attributes':_0x49c45d[_0x2c82('0x14')]?_0x49c45d['options'][_0x2c82('0x17')]||null:null,'limit':_0x49c45d[_0x2c82('0x14')]?_0x49c45d['options'][_0x2c82('0x18')]||null:null,'include':_0x49c45d[_0x2c82('0x14')]?_0x49c45d[_0x2c82('0x14')]['include']?_[_0x2c82('0x19')](_0x49c45d['options'][_0x2c82('0x1a')],function(_0x2f8759){return{'model':db[_0x2f8759[_0x2c82('0x1b')]],'as':_0x2f8759['as'],'attributes':_0x2f8759[_0x2c82('0x17')],'include':_0x2f8759['include']?_[_0x2c82('0x19')](_0x2f8759[_0x2c82('0x1a')],function(_0x4ce8b4){return{'model':db[_0x4ce8b4[_0x2c82('0x1b')]],'as':_0x4ce8b4['as'],'attributes':_0x4ce8b4[_0x2c82('0x17')],'include':_0x4ce8b4[_0x2c82('0x1a')]?_[_0x2c82('0x19')](_0x4ce8b4[_0x2c82('0x1a')],function(_0x55fcb1){return{'model':db[_0x55fcb1['model']],'as':_0x55fcb1['as'],'attributes':_0x55fcb1[_0x2c82('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1f2d21){logger[_0x2c82('0xa')](_0x2c82('0x1c'),_0x49c45d);logger[_0x2c82('0xc')](_0x2c82('0x1c'),_0x49c45d,JSON[_0x2c82('0xe')](_0x1f2d21));_0x181136(_0x1f2d21);})[_0x2c82('0x1d')](function(_0x24729d){logger[_0x2c82('0xf')](_0x2c82('0x1c'),_0x24729d[_0x2c82('0x11')],_0x49c45d);_0x4482bd(_0x1e7729['error'](0x1f4,_0x24729d['message']));});});};exports[_0x2c82('0x1e')]=function(_0x2d9897){var _0x31e0a8=this;return new Promise(function(_0x5e7290,_0xb96bfd){return db['DeskAccount'][_0x2c82('0x1f')]({'raw':_0x2d9897['options']?_0x2d9897[_0x2c82('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0x2d9897['options']?_0x2d9897[_0x2c82('0x14')][_0x2c82('0x16')]||null:null,'attributes':_0x2d9897[_0x2c82('0x14')]?_0x2d9897['options'][_0x2c82('0x17')]||null:null,'include':_0x2d9897[_0x2c82('0x14')]?_0x2d9897[_0x2c82('0x14')][_0x2c82('0x1a')]?_['map'](_0x2d9897[_0x2c82('0x14')][_0x2c82('0x1a')],function(_0xe7ef4){return{'model':db[_0xe7ef4[_0x2c82('0x1b')]],'as':_0xe7ef4['as'],'attributes':_0xe7ef4[_0x2c82('0x17')],'include':_0xe7ef4['include']?_[_0x2c82('0x19')](_0xe7ef4[_0x2c82('0x1a')],function(_0x487577){return{'model':db[_0x487577[_0x2c82('0x1b')]],'as':_0x487577['as'],'attributes':_0x487577['attributes'],'include':_0x487577['include']?_['map'](_0x487577[_0x2c82('0x1a')],function(_0x3ef3f2){return{'model':db[_0x3ef3f2['model']],'as':_0x3ef3f2['as'],'attributes':_0x3ef3f2[_0x2c82('0x17')]};}):[]};}):[]};}):[]:[]})[_0x2c82('0x20')](function(_0x316032){logger['info'](_0x2c82('0x1e'),_0x2d9897);logger['debug'](_0x2c82('0x1e'),_0x2d9897,JSON[_0x2c82('0xe')](_0x316032));_0x5e7290(_0x316032);})[_0x2c82('0x1d')](function(_0x45a2b0){logger[_0x2c82('0xf')](_0x2c82('0x1e'),_0x45a2b0[_0x2c82('0x11')],_0x2d9897);_0xb96bfd(_0x31e0a8[_0x2c82('0xf')](0x1f4,_0x45a2b0[_0x2c82('0x11')]));});});};
\ No newline at end of file
index 10fb917..fa8034f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3e74=['show','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','getTags','post','/:id/tags','setTags','update','delete','exports','multer','path','connect-timeout','express','../../components/auth/service','../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id'];(function(_0x123444,_0x3be49d){var _0x392a13=function(_0x27ff6d){while(--_0x27ff6d){_0x123444['push'](_0x123444['shift']());}};_0x392a13(++_0x3be49d);}(_0x3e74,0x175));var _0x43e7=function(_0x3fe156,_0x13f6e5){_0x3fe156=_0x3fe156-0x0;var _0x278a37=_0x3e74[_0x3fe156];return _0x278a37;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x43e7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x43e7('0x5'));var controller=require(_0x43e7('0x6'));router[_0x43e7('0x7')]('/',auth[_0x43e7('0x8')](),controller[_0x43e7('0x9')]);router['get'](_0x43e7('0xa'),auth[_0x43e7('0x8')](),controller[_0x43e7('0xb')]);router[_0x43e7('0x7')](_0x43e7('0xc'),auth['isAuthenticated'](),controller[_0x43e7('0xd')]);router['get']('/:id/subjects',auth[_0x43e7('0x8')](),controller[_0x43e7('0xe')]);router['get'](_0x43e7('0xf'),auth['isAuthenticated'](),controller[_0x43e7('0x10')]);router[_0x43e7('0x7')]('/:id/tags',auth[_0x43e7('0x8')](),controller[_0x43e7('0x11')]);router[_0x43e7('0x12')]('/',auth[_0x43e7('0x8')](),controller['create']);router['post'](_0x43e7('0x13'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x14')]);router['put']('/:id',auth[_0x43e7('0x8')](),controller[_0x43e7('0x15')]);router[_0x43e7('0x16')](_0x43e7('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x43e7('0x17')]=router;
\ No newline at end of file
+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(_0x14d896,_0x53578b){var _0x28679a=function(_0x14921f){while(--_0x14921f){_0x14d896['push'](_0x14d896['shift']());}};_0x28679a(++_0x53578b);}(_0x55ca,0x126));var _0xa55c=function(_0x2af29a,_0x4f44bc){_0x2af29a=_0x2af29a-0x0;var _0x5ef02f=_0x55ca[_0x2af29a];return _0x5ef02f;};'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 2d38a5f..bb610be 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6cb6=['STRING','exports'];(function(_0x20c52b,_0x545374){var _0xbe9646=function(_0x3dde6b){while(--_0x3dde6b){_0x20c52b['push'](_0x20c52b['shift']());}};_0xbe9646(++_0x545374);}(_0x6cb6,0xad));var _0x66cb=function(_0x2b5eae,_0x55010d){_0x2b5eae=_0x2b5eae-0x0;var _0x5f3ac9=_0x6cb6[_0x2b5eae];return _0x5f3ac9;};'use strict';var Sequelize=require('sequelize');module[_0x66cb('0x0')]={'name':{'type':Sequelize[_0x66cb('0x1')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x0ebe=['exports','STRING','sequelize'];(function(_0x559bc4,_0x1c5809){var _0x140122=function(_0x2785a4){while(--_0x2785a4){_0x559bc4['push'](_0x559bc4['shift']());}};_0x140122(++_0x1c5809);}(_0x0ebe,0x1f4));var _0xe0eb=function(_0x300d11,_0x49cefd){_0x300d11=_0x300d11-0x0;var _0x2ceb31=_0x0ebe[_0x300d11];return _0x2ceb31;};'use strict';var Sequelize=require(_0xe0eb('0x0'));module[_0xe0eb('0x1')]={'name':{'type':Sequelize[_0xe0eb('0x2')]},'description':{'type':Sequelize[_0xe0eb('0x2')]}};
\ No newline at end of file
index 823f8b6..752808f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc5bc=['getDescriptions','Tag','getTags','setTags','ids','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','json','apply','reject','update','then','destroy','stack','name','send','index','map','DeskConfiguration','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','rows','show','include','catch','create','body','find','params','getFields','findOne','DeskField','getSubjects','pick'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xc5bc,0xa9));var _0xcc5b=function(_0x15f615,_0x410f6a){_0x15f615=_0x15f615-0x0;var _0x3e1320=_0xc5bc[_0x15f615];return _0x3e1320;};'use strict';var emlformat=require(_0xcc5b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcc5b('0x1'));var jsonpatch=require(_0xcc5b('0x2'));var rp=require(_0xcc5b('0x3'));var moment=require('moment');var BPromise=require(_0xcc5b('0x4'));var Mustache=require('mustache');var util=require(_0xcc5b('0x5'));var path=require(_0xcc5b('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xcc5b('0x7'));var fs=require('fs');var fs_extra=require(_0xcc5b('0x8'));var _=require(_0xcc5b('0x9'));var squel=require(_0xcc5b('0xa'));var crypto=require(_0xcc5b('0xb'));var jsforce=require(_0xcc5b('0xc'));var deskjs=require(_0xcc5b('0xd'));var toCsv=require(_0xcc5b('0xe'));var querystring=require(_0xcc5b('0xf'));var Papa=require(_0xcc5b('0x10'));var Redis=require('ioredis');var authService=require(_0xcc5b('0x11'));var qs=require(_0xcc5b('0x12'));var as=require(_0xcc5b('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcc5b('0x14'))('api');var utils=require('../../config/utils');var config=require(_0xcc5b('0x15'));var licenseUtil=require(_0xcc5b('0x16'));var db=require(_0xcc5b('0x17'))['db'];function respondWithStatusCode(_0x32a559,_0x23aff7){_0x23aff7=_0x23aff7||0xcc;return function(_0x20fa7b){if(_0x20fa7b){return _0x32a559['sendStatus'](_0x23aff7);}return _0x32a559[_0xcc5b('0x18')](_0x23aff7)[_0xcc5b('0x19')]();};}function respondWithResult(_0x2086cc,_0x19ddb6){_0x19ddb6=_0x19ddb6||0xc8;return function(_0x5df4f0){if(_0x5df4f0){return _0x2086cc[_0xcc5b('0x18')](_0x19ddb6)['json'](_0x5df4f0);}};}function respondWithFilteredResult(_0x4e3ab8,_0x908d93){return function(_0x588d44){if(_0x588d44){var _0x6d1634=typeof _0x908d93[_0xcc5b('0x1a')]===_0xcc5b('0x1b')&&typeof _0x908d93[_0xcc5b('0x1c')]===_0xcc5b('0x1b');var _0x581f4e=_0x588d44['count'];var _0x3ab738=_0x6d1634?0x0:_0x908d93[_0xcc5b('0x1a')];var _0x233b99=_0x6d1634?_0x588d44[_0xcc5b('0x1d')]:_0x908d93[_0xcc5b('0x1a')]+_0x908d93[_0xcc5b('0x1c')];var _0xc59fa1;if(_0x233b99>=_0x581f4e){_0x233b99=_0x581f4e;_0xc59fa1=0xc8;}else{_0xc59fa1=0xce;}_0x4e3ab8[_0xcc5b('0x18')](_0xc59fa1);return _0x4e3ab8['set']('Content-Range',_0x3ab738+'-'+_0x233b99+'/'+_0x581f4e)[_0xcc5b('0x1e')](_0x588d44);}return null;};}function patchUpdates(_0x30e835){return function(_0x228045){try{jsonpatch[_0xcc5b('0x1f')](_0x228045,_0x30e835,!![]);}catch(_0x2d35c1){return BPromise[_0xcc5b('0x20')](_0x2d35c1);}return _0x228045['save']();};}function saveUpdates(_0x2763c3,_0x20939c){return function(_0xb4a5a6){if(_0xb4a5a6){return _0xb4a5a6[_0xcc5b('0x21')](_0x2763c3)[_0xcc5b('0x22')](function(_0x5ea7bc){return _0x5ea7bc;});}return null;};}function removeEntity(_0x2bd13a,_0x12002f){return function(_0x66e508){if(_0x66e508){return _0x66e508[_0xcc5b('0x23')]()[_0xcc5b('0x22')](function(){_0x2bd13a[_0xcc5b('0x18')](0xcc)[_0xcc5b('0x19')]();});}};}function handleEntityNotFound(_0x59b381,_0x15e125){return function(_0x4843cb){if(!_0x4843cb){_0x59b381['sendStatus'](0x194);}return _0x4843cb;};}function handleError(_0x5daa33,_0x3bc13a){_0x3bc13a=_0x3bc13a||0x1f4;return function(_0xa97bcc){logger['error'](_0xa97bcc[_0xcc5b('0x24')]);if(_0xa97bcc[_0xcc5b('0x25')]){delete _0xa97bcc['name'];}_0x5daa33['status'](_0x3bc13a)[_0xcc5b('0x26')](_0xa97bcc);};}exports[_0xcc5b('0x27')]=function(_0x2feaf7,_0x588d2d){var _0x445fb4={},_0x4b15ed={},_0x2d6b83={'count':0x0,'rows':[]};var _0x564219=_[_0xcc5b('0x28')](db[_0xcc5b('0x29')][_0xcc5b('0x2a')],function(_0x1a5aee){return{'name':_0x1a5aee[_0xcc5b('0x2b')],'type':_0x1a5aee[_0xcc5b('0x2c')][_0xcc5b('0x2d')]};});_0x4b15ed['model']=_[_0xcc5b('0x28')](_0x564219,'name');_0x4b15ed[_0xcc5b('0x2e')]=_[_0xcc5b('0x2f')](_0x2feaf7['query']);_0x4b15ed[_0xcc5b('0x30')]=_[_0xcc5b('0x31')](_0x4b15ed[_0xcc5b('0x32')],_0x4b15ed[_0xcc5b('0x2e')]);_0x445fb4[_0xcc5b('0x33')]=_[_0xcc5b('0x31')](_0x4b15ed[_0xcc5b('0x32')],qs[_0xcc5b('0x34')](_0x2feaf7[_0xcc5b('0x2e')][_0xcc5b('0x34')]));_0x445fb4[_0xcc5b('0x33')]=_0x445fb4[_0xcc5b('0x33')][_0xcc5b('0x35')]?_0x445fb4[_0xcc5b('0x33')]:_0x4b15ed[_0xcc5b('0x32')];if(!_0x2feaf7[_0xcc5b('0x2e')][_0xcc5b('0x36')](_0xcc5b('0x37'))){_0x445fb4['limit']=qs[_0xcc5b('0x1c')](_0x2feaf7[_0xcc5b('0x2e')][_0xcc5b('0x1c')]);_0x445fb4[_0xcc5b('0x1a')]=qs[_0xcc5b('0x1a')](_0x2feaf7['query'][_0xcc5b('0x1a')]);}_0x445fb4[_0xcc5b('0x38')]=qs[_0xcc5b('0x39')](_0x2feaf7[_0xcc5b('0x2e')]['sort']);_0x445fb4[_0xcc5b('0x3a')]=qs['filters'](_['pick'](_0x2feaf7[_0xcc5b('0x2e')],_0x4b15ed[_0xcc5b('0x30')]),_0x564219);if(_0x2feaf7['query'][_0xcc5b('0x3b')]){_0x445fb4['where']=_[_0xcc5b('0x3c')](_0x445fb4['where'],{'$or':_[_0xcc5b('0x28')](_0x564219,function(_0x5ed0ad){if(_0x5ed0ad['type']!==_0xcc5b('0x3d')){var _0x38403f={};_0x38403f[_0x5ed0ad[_0xcc5b('0x25')]]={'$like':'%'+_0x2feaf7[_0xcc5b('0x2e')][_0xcc5b('0x3b')]+'%'};return _0x38403f;}})});}_0x445fb4=_['merge']({},_0x445fb4,_0x2feaf7[_0xcc5b('0x3e')]);var _0x1ae400={'where':_0x445fb4[_0xcc5b('0x3a')]};return db[_0xcc5b('0x29')][_0xcc5b('0x1d')](_0x1ae400)[_0xcc5b('0x22')](function(_0x1024e0){_0x2d6b83[_0xcc5b('0x1d')]=_0x1024e0;if(_0x2feaf7[_0xcc5b('0x2e')][_0xcc5b('0x3f')]){_0x445fb4['include']=[{'all':!![]}];}return db[_0xcc5b('0x29')]['findAll'](_0x445fb4);})[_0xcc5b('0x22')](function(_0x46e11e){_0x2d6b83[_0xcc5b('0x40')]=_0x46e11e;return _0x2d6b83;})[_0xcc5b('0x22')](respondWithFilteredResult(_0x588d2d,_0x445fb4))['catch'](handleError(_0x588d2d,null));};exports[_0xcc5b('0x41')]=function(_0x47d1c2,_0x30cbc3){var _0xd0a215={'raw':![],'where':{'id':_0x47d1c2['params']['id']}},_0x5b5537={};_0x5b5537[_0xcc5b('0x32')]=_['keys'](db['DeskConfiguration'][_0xcc5b('0x2a')]);_0x5b5537['query']=_['keys'](_0x47d1c2[_0xcc5b('0x2e')]);_0x5b5537[_0xcc5b('0x30')]=_['intersection'](_0x5b5537[_0xcc5b('0x32')],_0x5b5537[_0xcc5b('0x2e')]);_0xd0a215[_0xcc5b('0x33')]=_['intersection'](_0x5b5537['model'],qs[_0xcc5b('0x34')](_0x47d1c2['query'][_0xcc5b('0x34')]));_0xd0a215[_0xcc5b('0x33')]=_0xd0a215[_0xcc5b('0x33')][_0xcc5b('0x35')]?_0xd0a215[_0xcc5b('0x33')]:_0x5b5537[_0xcc5b('0x32')];if(_0x47d1c2['query'][_0xcc5b('0x3f')]){_0xd0a215[_0xcc5b('0x42')]=[{'all':!![]}];}_0xd0a215=_[_0xcc5b('0x3c')]({},_0xd0a215,_0x47d1c2[_0xcc5b('0x3e')]);return db[_0xcc5b('0x29')]['find'](_0xd0a215)['then'](handleEntityNotFound(_0x30cbc3,null))[_0xcc5b('0x22')](respondWithResult(_0x30cbc3,null))[_0xcc5b('0x43')](handleError(_0x30cbc3,null));};exports[_0xcc5b('0x44')]=function(_0x2fece7,_0x44c4cb){return db[_0xcc5b('0x29')][_0xcc5b('0x44')](_0x2fece7['body'],{})['then'](respondWithResult(_0x44c4cb,0xc9))[_0xcc5b('0x43')](handleError(_0x44c4cb,null));};exports[_0xcc5b('0x21')]=function(_0x5cf9b0,_0x18c5a1){if(_0x5cf9b0['body']['id']){delete _0x5cf9b0[_0xcc5b('0x45')]['id'];}return db[_0xcc5b('0x29')][_0xcc5b('0x46')]({'where':{'id':_0x5cf9b0['params']['id']}})[_0xcc5b('0x22')](handleEntityNotFound(_0x18c5a1,null))[_0xcc5b('0x22')](saveUpdates(_0x5cf9b0[_0xcc5b('0x45')],null))[_0xcc5b('0x22')](respondWithResult(_0x18c5a1,null))[_0xcc5b('0x43')](handleError(_0x18c5a1,null));};exports[_0xcc5b('0x23')]=function(_0x56fa44,_0x58646f){return db[_0xcc5b('0x29')][_0xcc5b('0x46')]({'where':{'id':_0x56fa44[_0xcc5b('0x47')]['id']}})['then'](handleEntityNotFound(_0x58646f,null))[_0xcc5b('0x22')](removeEntity(_0x58646f,null))[_0xcc5b('0x43')](handleError(_0x58646f,null));};exports[_0xcc5b('0x48')]=function(_0x1af7bb,_0x44a02d,_0x589658){var _0x4289cd={};var _0x59ba91={};var _0x4414c7;var _0x1139f9;return db['DeskConfiguration'][_0xcc5b('0x49')]({'where':{'id':_0x1af7bb['params']['id']}})[_0xcc5b('0x22')](handleEntityNotFound(_0x44a02d,null))[_0xcc5b('0x22')](function(_0x491cc2){if(_0x491cc2){_0x4414c7=_0x491cc2;_0x59ba91[_0xcc5b('0x32')]=_[_0xcc5b('0x2f')](db[_0xcc5b('0x4a')][_0xcc5b('0x2a')]);_0x59ba91[_0xcc5b('0x2e')]=_[_0xcc5b('0x2f')](_0x1af7bb[_0xcc5b('0x2e')]);_0x59ba91[_0xcc5b('0x30')]=_[_0xcc5b('0x31')](_0x59ba91['model'],_0x59ba91[_0xcc5b('0x2e')]);_0x4289cd[_0xcc5b('0x33')]=_[_0xcc5b('0x31')](_0x59ba91[_0xcc5b('0x32')],qs[_0xcc5b('0x34')](_0x1af7bb[_0xcc5b('0x2e')][_0xcc5b('0x34')]));_0x4289cd[_0xcc5b('0x33')]=_0x4289cd[_0xcc5b('0x33')][_0xcc5b('0x35')]?_0x4289cd['attributes']:_0x59ba91[_0xcc5b('0x32')];_0x4289cd[_0xcc5b('0x38')]=qs[_0xcc5b('0x39')](_0x1af7bb[_0xcc5b('0x2e')]['sort']);_0x4289cd[_0xcc5b('0x3a')]=qs['filters'](_['pick'](_0x1af7bb[_0xcc5b('0x2e')],_0x59ba91[_0xcc5b('0x30')]));if(_0x1af7bb[_0xcc5b('0x2e')][_0xcc5b('0x3b')]){_0x4289cd['where']=_[_0xcc5b('0x3c')](_0x4289cd[_0xcc5b('0x3a')],{'$or':_['map'](_0x4289cd[_0xcc5b('0x33')],function(_0x44f84e){var _0x1c5705={};_0x1c5705[_0x44f84e]={'$like':'%'+_0x1af7bb[_0xcc5b('0x2e')][_0xcc5b('0x3b')]+'%'};return _0x1c5705;})});}_0x4289cd=_['merge']({},_0x4289cd,_0x1af7bb[_0xcc5b('0x3e')]);return _0x4414c7[_0xcc5b('0x48')](_0x4289cd);}})['then'](function(_0xe6ba81){if(_0xe6ba81){_0x1139f9=_0xe6ba81[_0xcc5b('0x35')];if(!_0x1af7bb[_0xcc5b('0x2e')]['hasOwnProperty'](_0xcc5b('0x37'))){_0x4289cd[_0xcc5b('0x1c')]=qs[_0xcc5b('0x1c')](_0x1af7bb['query'][_0xcc5b('0x1c')]);_0x4289cd[_0xcc5b('0x1a')]=qs['offset'](_0x1af7bb[_0xcc5b('0x2e')]['offset']);}return _0x4414c7[_0xcc5b('0x48')](_0x4289cd);}})[_0xcc5b('0x22')](function(_0x50b6c3){if(_0x50b6c3){return _0x50b6c3?{'count':_0x1139f9,'rows':_0x50b6c3}:null;}})[_0xcc5b('0x22')](respondWithResult(_0x44a02d,null))[_0xcc5b('0x43')](handleError(_0x44a02d,null));};exports[_0xcc5b('0x4b')]=function(_0x5bbef0,_0x445186,_0x4f455e){var _0x455206={};var _0x200b3a={};var _0x3764eb;var _0xb2d92e;return db[_0xcc5b('0x29')][_0xcc5b('0x49')]({'where':{'id':_0x5bbef0['params']['id']}})[_0xcc5b('0x22')](handleEntityNotFound(_0x445186,null))[_0xcc5b('0x22')](function(_0x59be9a){if(_0x59be9a){_0x3764eb=_0x59be9a;_0x200b3a[_0xcc5b('0x32')]=_[_0xcc5b('0x2f')](db['DeskField']['rawAttributes']);_0x200b3a['query']=_[_0xcc5b('0x2f')](_0x5bbef0[_0xcc5b('0x2e')]);_0x200b3a[_0xcc5b('0x30')]=_['intersection'](_0x200b3a[_0xcc5b('0x32')],_0x200b3a[_0xcc5b('0x2e')]);_0x455206[_0xcc5b('0x33')]=_[_0xcc5b('0x31')](_0x200b3a['model'],qs[_0xcc5b('0x34')](_0x5bbef0['query'][_0xcc5b('0x34')]));_0x455206[_0xcc5b('0x33')]=_0x455206[_0xcc5b('0x33')][_0xcc5b('0x35')]?_0x455206[_0xcc5b('0x33')]:_0x200b3a['model'];_0x455206[_0xcc5b('0x38')]=qs[_0xcc5b('0x39')](_0x5bbef0[_0xcc5b('0x2e')][_0xcc5b('0x39')]);_0x455206[_0xcc5b('0x3a')]=qs[_0xcc5b('0x30')](_[_0xcc5b('0x4c')](_0x5bbef0[_0xcc5b('0x2e')],_0x200b3a[_0xcc5b('0x30')]));if(_0x5bbef0[_0xcc5b('0x2e')][_0xcc5b('0x3b')]){_0x455206[_0xcc5b('0x3a')]=_[_0xcc5b('0x3c')](_0x455206[_0xcc5b('0x3a')],{'$or':_[_0xcc5b('0x28')](_0x455206[_0xcc5b('0x33')],function(_0x58c6b2){var _0x2af0a9={};_0x2af0a9[_0x58c6b2]={'$like':'%'+_0x5bbef0[_0xcc5b('0x2e')][_0xcc5b('0x3b')]+'%'};return _0x2af0a9;})});}_0x455206=_[_0xcc5b('0x3c')]({},_0x455206,_0x5bbef0[_0xcc5b('0x3e')]);return _0x3764eb[_0xcc5b('0x4b')](_0x455206);}})[_0xcc5b('0x22')](function(_0x5b52de){if(_0x5b52de){_0xb2d92e=_0x5b52de[_0xcc5b('0x35')];if(!_0x5bbef0[_0xcc5b('0x2e')][_0xcc5b('0x36')](_0xcc5b('0x37'))){_0x455206[_0xcc5b('0x1c')]=qs[_0xcc5b('0x1c')](_0x5bbef0[_0xcc5b('0x2e')]['limit']);_0x455206[_0xcc5b('0x1a')]=qs[_0xcc5b('0x1a')](_0x5bbef0[_0xcc5b('0x2e')][_0xcc5b('0x1a')]);}return _0x3764eb[_0xcc5b('0x4b')](_0x455206);}})['then'](function(_0x5c3488){if(_0x5c3488){return _0x5c3488?{'count':_0xb2d92e,'rows':_0x5c3488}:null;}})[_0xcc5b('0x22')](respondWithResult(_0x445186,null))[_0xcc5b('0x43')](handleError(_0x445186,null));};exports['getDescriptions']=function(_0x4a6361,_0x23db7b,_0x871cc3){var _0x1a7d06={};var _0x26bb2d={};var _0x1141e0;var _0x21e952;return db[_0xcc5b('0x29')][_0xcc5b('0x49')]({'where':{'id':_0x4a6361[_0xcc5b('0x47')]['id']}})['then'](handleEntityNotFound(_0x23db7b,null))['then'](function(_0x31f26c){if(_0x31f26c){_0x1141e0=_0x31f26c;_0x26bb2d[_0xcc5b('0x32')]=_[_0xcc5b('0x2f')](db[_0xcc5b('0x4a')]['rawAttributes']);_0x26bb2d['query']=_[_0xcc5b('0x2f')](_0x4a6361[_0xcc5b('0x2e')]);_0x26bb2d[_0xcc5b('0x30')]=_[_0xcc5b('0x31')](_0x26bb2d[_0xcc5b('0x32')],_0x26bb2d[_0xcc5b('0x2e')]);_0x1a7d06[_0xcc5b('0x33')]=_['intersection'](_0x26bb2d[_0xcc5b('0x32')],qs[_0xcc5b('0x34')](_0x4a6361[_0xcc5b('0x2e')][_0xcc5b('0x34')]));_0x1a7d06[_0xcc5b('0x33')]=_0x1a7d06[_0xcc5b('0x33')]['length']?_0x1a7d06[_0xcc5b('0x33')]:_0x26bb2d[_0xcc5b('0x32')];_0x1a7d06[_0xcc5b('0x38')]=qs[_0xcc5b('0x39')](_0x4a6361[_0xcc5b('0x2e')][_0xcc5b('0x39')]);_0x1a7d06['where']=qs[_0xcc5b('0x30')](_['pick'](_0x4a6361[_0xcc5b('0x2e')],_0x26bb2d[_0xcc5b('0x30')]));if(_0x4a6361[_0xcc5b('0x2e')]['filter']){_0x1a7d06[_0xcc5b('0x3a')]=_[_0xcc5b('0x3c')](_0x1a7d06[_0xcc5b('0x3a')],{'$or':_[_0xcc5b('0x28')](_0x1a7d06['attributes'],function(_0x42e311){var _0x389c4f={};_0x389c4f[_0x42e311]={'$like':'%'+_0x4a6361[_0xcc5b('0x2e')]['filter']+'%'};return _0x389c4f;})});}_0x1a7d06=_[_0xcc5b('0x3c')]({},_0x1a7d06,_0x4a6361[_0xcc5b('0x3e')]);return _0x1141e0['getDescriptions'](_0x1a7d06);}})['then'](function(_0x1be902){if(_0x1be902){_0x21e952=_0x1be902[_0xcc5b('0x35')];if(!_0x4a6361[_0xcc5b('0x2e')][_0xcc5b('0x36')](_0xcc5b('0x37'))){_0x1a7d06[_0xcc5b('0x1c')]=qs[_0xcc5b('0x1c')](_0x4a6361[_0xcc5b('0x2e')][_0xcc5b('0x1c')]);_0x1a7d06['offset']=qs[_0xcc5b('0x1a')](_0x4a6361[_0xcc5b('0x2e')][_0xcc5b('0x1a')]);}return _0x1141e0[_0xcc5b('0x4d')](_0x1a7d06);}})[_0xcc5b('0x22')](function(_0x557482){if(_0x557482){return _0x557482?{'count':_0x21e952,'rows':_0x557482}:null;}})[_0xcc5b('0x22')](respondWithResult(_0x23db7b,null))[_0xcc5b('0x43')](handleError(_0x23db7b,null));};exports['getTags']=function(_0x204338,_0x14341e,_0x1221b1){var _0x2d3704={};var _0x721742={};var _0x439d59;var _0x88e022;return db['DeskConfiguration']['findOne']({'where':{'id':_0x204338['params']['id']}})['then'](handleEntityNotFound(_0x14341e,null))['then'](function(_0x439c8c){if(_0x439c8c){_0x439d59=_0x439c8c;_0x721742[_0xcc5b('0x32')]=_[_0xcc5b('0x2f')](db[_0xcc5b('0x4e')]['rawAttributes']);_0x721742[_0xcc5b('0x2e')]=_[_0xcc5b('0x2f')](_0x204338[_0xcc5b('0x2e')]);_0x721742[_0xcc5b('0x30')]=_['intersection'](_0x721742[_0xcc5b('0x32')],_0x721742[_0xcc5b('0x2e')]);_0x2d3704[_0xcc5b('0x33')]=_[_0xcc5b('0x31')](_0x721742['model'],qs[_0xcc5b('0x34')](_0x204338[_0xcc5b('0x2e')][_0xcc5b('0x34')]));_0x2d3704[_0xcc5b('0x33')]=_0x2d3704[_0xcc5b('0x33')][_0xcc5b('0x35')]?_0x2d3704['attributes']:_0x721742[_0xcc5b('0x32')];_0x2d3704[_0xcc5b('0x38')]=qs['sort'](_0x204338[_0xcc5b('0x2e')][_0xcc5b('0x39')]);_0x2d3704['where']=qs[_0xcc5b('0x30')](_['pick'](_0x204338[_0xcc5b('0x2e')],_0x721742[_0xcc5b('0x30')]));if(_0x204338[_0xcc5b('0x2e')][_0xcc5b('0x3b')]){_0x2d3704[_0xcc5b('0x3a')]=_[_0xcc5b('0x3c')](_0x2d3704[_0xcc5b('0x3a')],{'$or':_[_0xcc5b('0x28')](_0x2d3704['attributes'],function(_0x414a73){var _0x5563f6={};_0x5563f6[_0x414a73]={'$like':'%'+_0x204338['query'][_0xcc5b('0x3b')]+'%'};return _0x5563f6;})});}_0x2d3704=_['merge']({},_0x2d3704,_0x204338[_0xcc5b('0x3e')]);return _0x439d59[_0xcc5b('0x4f')](_0x2d3704);}})[_0xcc5b('0x22')](function(_0x4c5317){if(_0x4c5317){_0x88e022=_0x4c5317['length'];if(!_0x204338[_0xcc5b('0x2e')]['hasOwnProperty'](_0xcc5b('0x37'))){_0x2d3704[_0xcc5b('0x1c')]=qs[_0xcc5b('0x1c')](_0x204338[_0xcc5b('0x2e')][_0xcc5b('0x1c')]);_0x2d3704['offset']=qs[_0xcc5b('0x1a')](_0x204338[_0xcc5b('0x2e')][_0xcc5b('0x1a')]);}return _0x439d59[_0xcc5b('0x4f')](_0x2d3704);}})[_0xcc5b('0x22')](function(_0x5d68d1){if(_0x5d68d1){return _0x5d68d1?{'count':_0x88e022,'rows':_0x5d68d1}:null;}})[_0xcc5b('0x22')](respondWithResult(_0x14341e,null))[_0xcc5b('0x43')](handleError(_0x14341e,null));};exports[_0xcc5b('0x50')]=function(_0x55e799,_0x4c903f,_0x19fa55){if(_0x55e799['body']['id']){delete _0x55e799[_0xcc5b('0x45')]['id'];}return db[_0xcc5b('0x29')][_0xcc5b('0x49')]({'where':{'id':_0x55e799[_0xcc5b('0x47')]['id']}})[_0xcc5b('0x22')](handleEntityNotFound(_0x4c903f,null))[_0xcc5b('0x22')](function(_0x2b8083){if(_0x2b8083){return _0x2b8083[_0xcc5b('0x50')](_0x55e799[_0xcc5b('0x45')][_0xcc5b('0x51')]||[]);}return null;})[_0xcc5b('0x22')](respondWithResult(_0x4c903f,null))['catch'](handleError(_0x4c903f,null));};
\ No newline at end of file
+var _0xb8f5=['limit','set','Content-Range','apply','then','error','stack','name','index','map','DeskConfiguration','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','params','rawAttributes','find','create','body','destroy','getFields','findOne','pick','hasOwnProperty','getSubjects','DeskField','getDescriptions','getTags','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','offset','count'];(function(_0x44b7d6,_0x4a3f3f){var _0x5346f0=function(_0x35ac17){while(--_0x35ac17){_0x44b7d6['push'](_0x44b7d6['shift']());}};_0x5346f0(++_0x4a3f3f);}(_0xb8f5,0x88));var _0x5b8f=function(_0x480d28,_0x2de8ef){_0x480d28=_0x480d28-0x0;var _0x2f609d=_0xb8f5[_0x480d28];return _0x2f609d;};'use strict';var emlformat=require(_0x5b8f('0x0'));var rimraf=require(_0x5b8f('0x1'));var zipdir=require(_0x5b8f('0x2'));var jsonpatch=require(_0x5b8f('0x3'));var rp=require(_0x5b8f('0x4'));var moment=require('moment');var BPromise=require(_0x5b8f('0x5'));var Mustache=require(_0x5b8f('0x6'));var util=require(_0x5b8f('0x7'));var path=require(_0x5b8f('0x8'));var sox=require('sox');var csv=require(_0x5b8f('0x9'));var ejs=require(_0x5b8f('0xa'));var fs=require('fs');var fs_extra=require(_0x5b8f('0xb'));var _=require(_0x5b8f('0xc'));var squel=require(_0x5b8f('0xd'));var crypto=require(_0x5b8f('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x5b8f('0xf'));var toCsv=require(_0x5b8f('0x9'));var querystring=require(_0x5b8f('0x10'));var Papa=require(_0x5b8f('0x11'));var Redis=require(_0x5b8f('0x12'));var authService=require(_0x5b8f('0x13'));var qs=require(_0x5b8f('0x14'));var as=require(_0x5b8f('0x15'));var hardwareService=require(_0x5b8f('0x16'));var logger=require(_0x5b8f('0x17'))('api');var utils=require(_0x5b8f('0x18'));var config=require(_0x5b8f('0x19'));var licenseUtil=require(_0x5b8f('0x1a'));var db=require(_0x5b8f('0x1b'))['db'];function respondWithStatusCode(_0x28a510,_0x40766e){_0x40766e=_0x40766e||0xcc;return function(_0x535ebc){if(_0x535ebc){return _0x28a510[_0x5b8f('0x1c')](_0x40766e);}return _0x28a510[_0x5b8f('0x1d')](_0x40766e)[_0x5b8f('0x1e')]();};}function respondWithResult(_0x31d2ec,_0x1feb13){_0x1feb13=_0x1feb13||0xc8;return function(_0x54f901){if(_0x54f901){return _0x31d2ec[_0x5b8f('0x1d')](_0x1feb13)['json'](_0x54f901);}};}function respondWithFilteredResult(_0x508bd0,_0x31b2c1){return function(_0x294f5f){if(_0x294f5f){var _0x47d240=typeof _0x31b2c1['offset']===_0x5b8f('0x1f')&&typeof _0x31b2c1['limit']===_0x5b8f('0x1f');var _0x3ebda0=_0x294f5f['count'];var _0x25ce1f=_0x47d240?0x0:_0x31b2c1[_0x5b8f('0x20')];var _0x48094=_0x47d240?_0x294f5f[_0x5b8f('0x21')]:_0x31b2c1[_0x5b8f('0x20')]+_0x31b2c1[_0x5b8f('0x22')];var _0x57402d;if(_0x48094>=_0x3ebda0){_0x48094=_0x3ebda0;_0x57402d=0xc8;}else{_0x57402d=0xce;}_0x508bd0[_0x5b8f('0x1d')](_0x57402d);return _0x508bd0[_0x5b8f('0x23')](_0x5b8f('0x24'),_0x25ce1f+'-'+_0x48094+'/'+_0x3ebda0)['json'](_0x294f5f);}return null;};}function patchUpdates(_0x34cfc8){return function(_0x12583a){try{jsonpatch[_0x5b8f('0x25')](_0x12583a,_0x34cfc8,!![]);}catch(_0x5d44d5){return BPromise['reject'](_0x5d44d5);}return _0x12583a['save']();};}function saveUpdates(_0x2abf8a,_0x1ce4a9){return function(_0xe1efbd){if(_0xe1efbd){return _0xe1efbd['update'](_0x2abf8a)[_0x5b8f('0x26')](function(_0x8ef49b){return _0x8ef49b;});}return null;};}function removeEntity(_0x4cabfc,_0x18ddf1){return function(_0x13b180){if(_0x13b180){return _0x13b180['destroy']()['then'](function(){_0x4cabfc['status'](0xcc)[_0x5b8f('0x1e')]();});}};}function handleEntityNotFound(_0x9eeac4,_0x5a7de1){return function(_0x53458d){if(!_0x53458d){_0x9eeac4[_0x5b8f('0x1c')](0x194);}return _0x53458d;};}function handleError(_0x5b317c,_0x26e489){_0x26e489=_0x26e489||0x1f4;return function(_0x407d3d){logger[_0x5b8f('0x27')](_0x407d3d[_0x5b8f('0x28')]);if(_0x407d3d[_0x5b8f('0x29')]){delete _0x407d3d[_0x5b8f('0x29')];}_0x5b317c[_0x5b8f('0x1d')](_0x26e489)['send'](_0x407d3d);};}exports[_0x5b8f('0x2a')]=function(_0x5c652e,_0x5b6cc0){var _0x6408f6={},_0x3b5255={},_0x65e11d={'count':0x0,'rows':[]};var _0x40f09c=_[_0x5b8f('0x2b')](db[_0x5b8f('0x2c')]['rawAttributes'],function(_0x20aeeb){return{'name':_0x20aeeb[_0x5b8f('0x2d')],'type':_0x20aeeb[_0x5b8f('0x2e')][_0x5b8f('0x2f')]};});_0x3b5255[_0x5b8f('0x30')]=_[_0x5b8f('0x2b')](_0x40f09c,'name');_0x3b5255[_0x5b8f('0x31')]=_[_0x5b8f('0x32')](_0x5c652e[_0x5b8f('0x31')]);_0x3b5255[_0x5b8f('0x33')]=_[_0x5b8f('0x34')](_0x3b5255[_0x5b8f('0x30')],_0x3b5255[_0x5b8f('0x31')]);_0x6408f6[_0x5b8f('0x35')]=_[_0x5b8f('0x34')](_0x3b5255[_0x5b8f('0x30')],qs[_0x5b8f('0x36')](_0x5c652e[_0x5b8f('0x31')]['fields']));_0x6408f6['attributes']=_0x6408f6['attributes'][_0x5b8f('0x37')]?_0x6408f6['attributes']:_0x3b5255[_0x5b8f('0x30')];if(!_0x5c652e[_0x5b8f('0x31')]['hasOwnProperty'](_0x5b8f('0x38'))){_0x6408f6[_0x5b8f('0x22')]=qs[_0x5b8f('0x22')](_0x5c652e[_0x5b8f('0x31')]['limit']);_0x6408f6[_0x5b8f('0x20')]=qs['offset'](_0x5c652e['query'][_0x5b8f('0x20')]);}_0x6408f6[_0x5b8f('0x39')]=qs[_0x5b8f('0x3a')](_0x5c652e[_0x5b8f('0x31')][_0x5b8f('0x3a')]);_0x6408f6['where']=qs['filters'](_['pick'](_0x5c652e['query'],_0x3b5255[_0x5b8f('0x33')]),_0x40f09c);if(_0x5c652e[_0x5b8f('0x31')][_0x5b8f('0x3b')]){_0x6408f6[_0x5b8f('0x3c')]=_['merge'](_0x6408f6['where'],{'$or':_[_0x5b8f('0x2b')](_0x40f09c,function(_0x37ca25){if(_0x37ca25[_0x5b8f('0x2e')]!==_0x5b8f('0x3d')){var _0x772086={};_0x772086[_0x37ca25[_0x5b8f('0x29')]]={'$like':'%'+_0x5c652e[_0x5b8f('0x31')][_0x5b8f('0x3b')]+'%'};return _0x772086;}})});}_0x6408f6=_[_0x5b8f('0x3e')]({},_0x6408f6,_0x5c652e[_0x5b8f('0x3f')]);var _0xe8749f={'where':_0x6408f6[_0x5b8f('0x3c')]};return db[_0x5b8f('0x2c')][_0x5b8f('0x21')](_0xe8749f)[_0x5b8f('0x26')](function(_0x7a5191){_0x65e11d[_0x5b8f('0x21')]=_0x7a5191;if(_0x5c652e['query'][_0x5b8f('0x40')]){_0x6408f6[_0x5b8f('0x41')]=[{'all':!![]}];}return db[_0x5b8f('0x2c')][_0x5b8f('0x42')](_0x6408f6);})[_0x5b8f('0x26')](function(_0x127c44){_0x65e11d['rows']=_0x127c44;return _0x65e11d;})['then'](respondWithFilteredResult(_0x5b6cc0,_0x6408f6))[_0x5b8f('0x43')](handleError(_0x5b6cc0,null));};exports[_0x5b8f('0x44')]=function(_0xb432d5,_0x2f724f){var _0x35c67d={'raw':![],'where':{'id':_0xb432d5[_0x5b8f('0x45')]['id']}},_0x32b125={};_0x32b125['model']=_[_0x5b8f('0x32')](db[_0x5b8f('0x2c')][_0x5b8f('0x46')]);_0x32b125[_0x5b8f('0x31')]=_[_0x5b8f('0x32')](_0xb432d5[_0x5b8f('0x31')]);_0x32b125['filters']=_[_0x5b8f('0x34')](_0x32b125[_0x5b8f('0x30')],_0x32b125[_0x5b8f('0x31')]);_0x35c67d[_0x5b8f('0x35')]=_[_0x5b8f('0x34')](_0x32b125[_0x5b8f('0x30')],qs[_0x5b8f('0x36')](_0xb432d5['query'][_0x5b8f('0x36')]));_0x35c67d['attributes']=_0x35c67d['attributes'][_0x5b8f('0x37')]?_0x35c67d[_0x5b8f('0x35')]:_0x32b125[_0x5b8f('0x30')];if(_0xb432d5[_0x5b8f('0x31')][_0x5b8f('0x40')]){_0x35c67d[_0x5b8f('0x41')]=[{'all':!![]}];}_0x35c67d=_[_0x5b8f('0x3e')]({},_0x35c67d,_0xb432d5[_0x5b8f('0x3f')]);return db[_0x5b8f('0x2c')][_0x5b8f('0x47')](_0x35c67d)[_0x5b8f('0x26')](handleEntityNotFound(_0x2f724f,null))[_0x5b8f('0x26')](respondWithResult(_0x2f724f,null))['catch'](handleError(_0x2f724f,null));};exports[_0x5b8f('0x48')]=function(_0x138b3a,_0x30aefd){return db[_0x5b8f('0x2c')]['create'](_0x138b3a[_0x5b8f('0x49')],{})[_0x5b8f('0x26')](respondWithResult(_0x30aefd,0xc9))['catch'](handleError(_0x30aefd,null));};exports['update']=function(_0x565ed3,_0x3ffda3){if(_0x565ed3['body']['id']){delete _0x565ed3[_0x5b8f('0x49')]['id'];}return db[_0x5b8f('0x2c')][_0x5b8f('0x47')]({'where':{'id':_0x565ed3[_0x5b8f('0x45')]['id']}})[_0x5b8f('0x26')](handleEntityNotFound(_0x3ffda3,null))[_0x5b8f('0x26')](saveUpdates(_0x565ed3[_0x5b8f('0x49')],null))[_0x5b8f('0x26')](respondWithResult(_0x3ffda3,null))[_0x5b8f('0x43')](handleError(_0x3ffda3,null));};exports[_0x5b8f('0x4a')]=function(_0x43ab8b,_0x4cfee8){return db[_0x5b8f('0x2c')]['find']({'where':{'id':_0x43ab8b[_0x5b8f('0x45')]['id']}})[_0x5b8f('0x26')](handleEntityNotFound(_0x4cfee8,null))[_0x5b8f('0x26')](removeEntity(_0x4cfee8,null))[_0x5b8f('0x43')](handleError(_0x4cfee8,null));};exports[_0x5b8f('0x4b')]=function(_0x18eceb,_0xa04f8f,_0x4d65e1){var _0x47b0a6={};var _0x501336={};var _0x276529;var _0x16b561;return db[_0x5b8f('0x2c')][_0x5b8f('0x4c')]({'where':{'id':_0x18eceb[_0x5b8f('0x45')]['id']}})['then'](handleEntityNotFound(_0xa04f8f,null))[_0x5b8f('0x26')](function(_0x33cc84){if(_0x33cc84){_0x276529=_0x33cc84;_0x501336[_0x5b8f('0x30')]=_['keys'](db['DeskField']['rawAttributes']);_0x501336[_0x5b8f('0x31')]=_[_0x5b8f('0x32')](_0x18eceb[_0x5b8f('0x31')]);_0x501336['filters']=_[_0x5b8f('0x34')](_0x501336[_0x5b8f('0x30')],_0x501336['query']);_0x47b0a6[_0x5b8f('0x35')]=_[_0x5b8f('0x34')](_0x501336[_0x5b8f('0x30')],qs['fields'](_0x18eceb[_0x5b8f('0x31')]['fields']));_0x47b0a6['attributes']=_0x47b0a6[_0x5b8f('0x35')][_0x5b8f('0x37')]?_0x47b0a6[_0x5b8f('0x35')]:_0x501336[_0x5b8f('0x30')];_0x47b0a6[_0x5b8f('0x39')]=qs[_0x5b8f('0x3a')](_0x18eceb[_0x5b8f('0x31')][_0x5b8f('0x3a')]);_0x47b0a6[_0x5b8f('0x3c')]=qs[_0x5b8f('0x33')](_[_0x5b8f('0x4d')](_0x18eceb[_0x5b8f('0x31')],_0x501336[_0x5b8f('0x33')]));if(_0x18eceb[_0x5b8f('0x31')][_0x5b8f('0x3b')]){_0x47b0a6[_0x5b8f('0x3c')]=_[_0x5b8f('0x3e')](_0x47b0a6[_0x5b8f('0x3c')],{'$or':_[_0x5b8f('0x2b')](_0x47b0a6[_0x5b8f('0x35')],function(_0x46abfb){var _0x13e724={};_0x13e724[_0x46abfb]={'$like':'%'+_0x18eceb[_0x5b8f('0x31')][_0x5b8f('0x3b')]+'%'};return _0x13e724;})});}_0x47b0a6=_[_0x5b8f('0x3e')]({},_0x47b0a6,_0x18eceb['options']);return _0x276529[_0x5b8f('0x4b')](_0x47b0a6);}})[_0x5b8f('0x26')](function(_0x4bbf40){if(_0x4bbf40){_0x16b561=_0x4bbf40[_0x5b8f('0x37')];if(!_0x18eceb[_0x5b8f('0x31')][_0x5b8f('0x4e')](_0x5b8f('0x38'))){_0x47b0a6[_0x5b8f('0x22')]=qs[_0x5b8f('0x22')](_0x18eceb[_0x5b8f('0x31')][_0x5b8f('0x22')]);_0x47b0a6[_0x5b8f('0x20')]=qs[_0x5b8f('0x20')](_0x18eceb['query'][_0x5b8f('0x20')]);}return _0x276529[_0x5b8f('0x4b')](_0x47b0a6);}})[_0x5b8f('0x26')](function(_0x5b3797){if(_0x5b3797){return _0x5b3797?{'count':_0x16b561,'rows':_0x5b3797}:null;}})[_0x5b8f('0x26')](respondWithResult(_0xa04f8f,null))[_0x5b8f('0x43')](handleError(_0xa04f8f,null));};exports[_0x5b8f('0x4f')]=function(_0x29e95c,_0x2ebead,_0xac1465){var _0x1ef073={};var _0x5de7bb={};var _0x555806;var _0x207d62;return db[_0x5b8f('0x2c')]['findOne']({'where':{'id':_0x29e95c[_0x5b8f('0x45')]['id']}})[_0x5b8f('0x26')](handleEntityNotFound(_0x2ebead,null))['then'](function(_0xb702bc){if(_0xb702bc){_0x555806=_0xb702bc;_0x5de7bb[_0x5b8f('0x30')]=_['keys'](db[_0x5b8f('0x50')][_0x5b8f('0x46')]);_0x5de7bb['query']=_[_0x5b8f('0x32')](_0x29e95c['query']);_0x5de7bb[_0x5b8f('0x33')]=_[_0x5b8f('0x34')](_0x5de7bb[_0x5b8f('0x30')],_0x5de7bb['query']);_0x1ef073['attributes']=_[_0x5b8f('0x34')](_0x5de7bb[_0x5b8f('0x30')],qs[_0x5b8f('0x36')](_0x29e95c[_0x5b8f('0x31')][_0x5b8f('0x36')]));_0x1ef073['attributes']=_0x1ef073[_0x5b8f('0x35')][_0x5b8f('0x37')]?_0x1ef073[_0x5b8f('0x35')]:_0x5de7bb[_0x5b8f('0x30')];_0x1ef073[_0x5b8f('0x39')]=qs['sort'](_0x29e95c[_0x5b8f('0x31')]['sort']);_0x1ef073[_0x5b8f('0x3c')]=qs[_0x5b8f('0x33')](_[_0x5b8f('0x4d')](_0x29e95c['query'],_0x5de7bb[_0x5b8f('0x33')]));if(_0x29e95c[_0x5b8f('0x31')][_0x5b8f('0x3b')]){_0x1ef073['where']=_['merge'](_0x1ef073[_0x5b8f('0x3c')],{'$or':_[_0x5b8f('0x2b')](_0x1ef073['attributes'],function(_0x2c696b){var _0x5e2177={};_0x5e2177[_0x2c696b]={'$like':'%'+_0x29e95c[_0x5b8f('0x31')][_0x5b8f('0x3b')]+'%'};return _0x5e2177;})});}_0x1ef073=_['merge']({},_0x1ef073,_0x29e95c['options']);return _0x555806['getSubjects'](_0x1ef073);}})[_0x5b8f('0x26')](function(_0x2141fe){if(_0x2141fe){_0x207d62=_0x2141fe[_0x5b8f('0x37')];if(!_0x29e95c[_0x5b8f('0x31')][_0x5b8f('0x4e')](_0x5b8f('0x38'))){_0x1ef073[_0x5b8f('0x22')]=qs[_0x5b8f('0x22')](_0x29e95c[_0x5b8f('0x31')][_0x5b8f('0x22')]);_0x1ef073[_0x5b8f('0x20')]=qs['offset'](_0x29e95c[_0x5b8f('0x31')][_0x5b8f('0x20')]);}return _0x555806[_0x5b8f('0x4f')](_0x1ef073);}})[_0x5b8f('0x26')](function(_0x1a9325){if(_0x1a9325){return _0x1a9325?{'count':_0x207d62,'rows':_0x1a9325}:null;}})[_0x5b8f('0x26')](respondWithResult(_0x2ebead,null))[_0x5b8f('0x43')](handleError(_0x2ebead,null));};exports[_0x5b8f('0x51')]=function(_0x2f392f,_0x2f90f3,_0x19e1d8){var _0x52504f={};var _0x1c8e3f={};var _0x1e4ab3;var _0x1d2009;return db[_0x5b8f('0x2c')][_0x5b8f('0x4c')]({'where':{'id':_0x2f392f['params']['id']}})['then'](handleEntityNotFound(_0x2f90f3,null))[_0x5b8f('0x26')](function(_0x4a617b){if(_0x4a617b){_0x1e4ab3=_0x4a617b;_0x1c8e3f[_0x5b8f('0x30')]=_[_0x5b8f('0x32')](db[_0x5b8f('0x50')][_0x5b8f('0x46')]);_0x1c8e3f[_0x5b8f('0x31')]=_[_0x5b8f('0x32')](_0x2f392f[_0x5b8f('0x31')]);_0x1c8e3f[_0x5b8f('0x33')]=_[_0x5b8f('0x34')](_0x1c8e3f['model'],_0x1c8e3f[_0x5b8f('0x31')]);_0x52504f[_0x5b8f('0x35')]=_[_0x5b8f('0x34')](_0x1c8e3f[_0x5b8f('0x30')],qs[_0x5b8f('0x36')](_0x2f392f[_0x5b8f('0x31')]['fields']));_0x52504f[_0x5b8f('0x35')]=_0x52504f['attributes'][_0x5b8f('0x37')]?_0x52504f['attributes']:_0x1c8e3f['model'];_0x52504f[_0x5b8f('0x39')]=qs['sort'](_0x2f392f[_0x5b8f('0x31')][_0x5b8f('0x3a')]);_0x52504f[_0x5b8f('0x3c')]=qs['filters'](_[_0x5b8f('0x4d')](_0x2f392f[_0x5b8f('0x31')],_0x1c8e3f[_0x5b8f('0x33')]));if(_0x2f392f[_0x5b8f('0x31')][_0x5b8f('0x3b')]){_0x52504f[_0x5b8f('0x3c')]=_[_0x5b8f('0x3e')](_0x52504f[_0x5b8f('0x3c')],{'$or':_[_0x5b8f('0x2b')](_0x52504f[_0x5b8f('0x35')],function(_0xffe8e0){var _0x45b6c2={};_0x45b6c2[_0xffe8e0]={'$like':'%'+_0x2f392f[_0x5b8f('0x31')][_0x5b8f('0x3b')]+'%'};return _0x45b6c2;})});}_0x52504f=_['merge']({},_0x52504f,_0x2f392f[_0x5b8f('0x3f')]);return _0x1e4ab3[_0x5b8f('0x51')](_0x52504f);}})[_0x5b8f('0x26')](function(_0x12e1b7){if(_0x12e1b7){_0x1d2009=_0x12e1b7[_0x5b8f('0x37')];if(!_0x2f392f[_0x5b8f('0x31')][_0x5b8f('0x4e')](_0x5b8f('0x38'))){_0x52504f[_0x5b8f('0x22')]=qs[_0x5b8f('0x22')](_0x2f392f['query']['limit']);_0x52504f['offset']=qs[_0x5b8f('0x20')](_0x2f392f[_0x5b8f('0x31')][_0x5b8f('0x20')]);}return _0x1e4ab3['getDescriptions'](_0x52504f);}})['then'](function(_0x7341fc){if(_0x7341fc){return _0x7341fc?{'count':_0x1d2009,'rows':_0x7341fc}:null;}})[_0x5b8f('0x26')](respondWithResult(_0x2f90f3,null))['catch'](handleError(_0x2f90f3,null));};exports[_0x5b8f('0x52')]=function(_0x5232c9,_0x314706,_0x8e4072){var _0x199460={};var _0x5bdd71={};var _0x3e6a26;var _0x5170df;return db[_0x5b8f('0x2c')][_0x5b8f('0x4c')]({'where':{'id':_0x5232c9[_0x5b8f('0x45')]['id']}})[_0x5b8f('0x26')](handleEntityNotFound(_0x314706,null))['then'](function(_0x33229b){if(_0x33229b){_0x3e6a26=_0x33229b;_0x5bdd71[_0x5b8f('0x30')]=_[_0x5b8f('0x32')](db['Tag'][_0x5b8f('0x46')]);_0x5bdd71[_0x5b8f('0x31')]=_[_0x5b8f('0x32')](_0x5232c9['query']);_0x5bdd71[_0x5b8f('0x33')]=_[_0x5b8f('0x34')](_0x5bdd71[_0x5b8f('0x30')],_0x5bdd71['query']);_0x199460[_0x5b8f('0x35')]=_[_0x5b8f('0x34')](_0x5bdd71[_0x5b8f('0x30')],qs[_0x5b8f('0x36')](_0x5232c9['query']['fields']));_0x199460[_0x5b8f('0x35')]=_0x199460[_0x5b8f('0x35')]['length']?_0x199460[_0x5b8f('0x35')]:_0x5bdd71[_0x5b8f('0x30')];_0x199460[_0x5b8f('0x39')]=qs[_0x5b8f('0x3a')](_0x5232c9['query'][_0x5b8f('0x3a')]);_0x199460['where']=qs['filters'](_[_0x5b8f('0x4d')](_0x5232c9['query'],_0x5bdd71['filters']));if(_0x5232c9[_0x5b8f('0x31')][_0x5b8f('0x3b')]){_0x199460['where']=_[_0x5b8f('0x3e')](_0x199460['where'],{'$or':_[_0x5b8f('0x2b')](_0x199460[_0x5b8f('0x35')],function(_0x2025df){var _0x46d306={};_0x46d306[_0x2025df]={'$like':'%'+_0x5232c9[_0x5b8f('0x31')][_0x5b8f('0x3b')]+'%'};return _0x46d306;})});}_0x199460=_['merge']({},_0x199460,_0x5232c9['options']);return _0x3e6a26[_0x5b8f('0x52')](_0x199460);}})[_0x5b8f('0x26')](function(_0x265fd5){if(_0x265fd5){_0x5170df=_0x265fd5[_0x5b8f('0x37')];if(!_0x5232c9['query'][_0x5b8f('0x4e')](_0x5b8f('0x38'))){_0x199460['limit']=qs[_0x5b8f('0x22')](_0x5232c9[_0x5b8f('0x31')][_0x5b8f('0x22')]);_0x199460[_0x5b8f('0x20')]=qs[_0x5b8f('0x20')](_0x5232c9[_0x5b8f('0x31')][_0x5b8f('0x20')]);}return _0x3e6a26[_0x5b8f('0x52')](_0x199460);}})[_0x5b8f('0x26')](function(_0x2a15c4){if(_0x2a15c4){return _0x2a15c4?{'count':_0x5170df,'rows':_0x2a15c4}:null;}})[_0x5b8f('0x26')](respondWithResult(_0x314706,null))['catch'](handleError(_0x314706,null));};exports['setTags']=function(_0x5c0d14,_0x3aab12,_0x372fd8){if(_0x5c0d14[_0x5b8f('0x49')]['id']){delete _0x5c0d14[_0x5b8f('0x49')]['id'];}return db[_0x5b8f('0x2c')][_0x5b8f('0x4c')]({'where':{'id':_0x5c0d14['params']['id']}})[_0x5b8f('0x26')](handleEntityNotFound(_0x3aab12,null))[_0x5b8f('0x26')](function(_0x21dfdd){if(_0x21dfdd){return _0x21dfdd[_0x5b8f('0x53')](_0x5c0d14['body'][_0x5b8f('0x54')]||[]);}return null;})['then'](respondWithResult(_0x3aab12,null))[_0x5b8f('0x43')](handleError(_0x3aab12,null));};
\ No newline at end of file
index 7fd786c..ed6108f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x513d=['./intDeskConfiguration.attributes','exports','lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment'];(function(_0xba0502,_0x2fb75b){var _0x5ed16d=function(_0x3154a7){while(--_0x3154a7){_0xba0502['push'](_0xba0502['shift']());}};_0x5ed16d(++_0x2fb75b);}(_0x513d,0x7a));var _0xd513=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x513d[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0xd513('0x0'));var util=require(_0xd513('0x1'));var logger=require(_0xd513('0x2'))('api');var moment=require(_0xd513('0x3'));var BPromise=require('bluebird');var rp=require(_0xd513('0x4'));var fs=require('fs');var path=require(_0xd513('0x5'));var rimraf=require(_0xd513('0x6'));var config=require(_0xd513('0x7'));var attributes=require(_0xd513('0x8'));module[_0xd513('0x9')]=function(_0x32383b,_0x5195b9){return _0x32383b['define']('DeskConfiguration',attributes,{'tableName':'int_desk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xddda=['exports','define','int_desk_configurations','lodash','util','../../config/logger','moment','rimraf','../../config/environment','./intDeskConfiguration.attributes'];(function(_0x562eea,_0x1f9ea7){var _0x39caf9=function(_0x14f022){while(--_0x14f022){_0x562eea['push'](_0x562eea['shift']());}};_0x39caf9(++_0x1f9ea7);}(_0xddda,0x8f));var _0xaddd=function(_0x1a24a0,_0x12f21f){_0x1a24a0=_0x1a24a0-0x0;var _0x2eca50=_0xddda[_0x1a24a0];return _0x2eca50;};'use strict';var _=require(_0xaddd('0x0'));var util=require(_0xaddd('0x1'));var logger=require(_0xaddd('0x2'))('api');var moment=require(_0xaddd('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xaddd('0x4'));var config=require(_0xaddd('0x5'));var attributes=require(_0xaddd('0x6'));module[_0xaddd('0x7')]=function(_0x3c4b14,_0xccb3ab){return _0x3c4b14[_0xaddd('0x8')]('DeskConfiguration',attributes,{'tableName':_0xaddd('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index ecdaa85..b899c43 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbb61=['stringify','error','message','request\x20sent','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','DeskConfiguration,\x20%s,\x20%s','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0x171eaa,_0x95bc42){var _0x3b9ffe=function(_0x26991b){while(--_0x26991b){_0x171eaa['push'](_0x171eaa['shift']());}};_0x3b9ffe(++_0x95bc42);}(_0xbb61,0x131));var _0x1bb6=function(_0x19159a,_0x1cb5c3){_0x19159a=_0x19159a-0x0;var _0xa677f4=_0xbb61[_0x19159a];return _0xa677f4;};'use strict';var _=require(_0x1bb6('0x0'));var util=require('util');var moment=require(_0x1bb6('0x1'));var BPromise=require(_0x1bb6('0x2'));var rs=require(_0x1bb6('0x3'));var fs=require('fs');var Redis=require(_0x1bb6('0x4'));var db=require(_0x1bb6('0x5'))['db'];var utils=require(_0x1bb6('0x6'));var logger=require(_0x1bb6('0x7'))('rpc');var config=require(_0x1bb6('0x8'));var jayson=require(_0x1bb6('0x9'));var client=jayson[_0x1bb6('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x362383,_0x4629d0,_0x24d6b9){return new BPromise(function(_0x59a152,_0x13e2da){return client[_0x1bb6('0xb')](_0x362383,_0x24d6b9)[_0x1bb6('0xc')](function(_0xe56199){logger[_0x1bb6('0xd')](_0x1bb6('0xe'),_0x4629d0,'request\x20sent');logger[_0x1bb6('0xf')](_0x1bb6('0x10'),_0x4629d0,'request\x20sent',JSON[_0x1bb6('0x11')](_0xe56199));if(_0xe56199['error']){if(_0xe56199['error']['code']===0x1f4){logger['error'](_0x1bb6('0xe'),_0x4629d0,_0xe56199[_0x1bb6('0x12')]['message']);return _0x13e2da(_0xe56199['error'][_0x1bb6('0x13')]);}logger[_0x1bb6('0x12')](_0x1bb6('0xe'),_0x4629d0,_0xe56199[_0x1bb6('0x12')][_0x1bb6('0x13')]);return _0x59a152(_0xe56199[_0x1bb6('0x12')][_0x1bb6('0x13')]);}else{logger[_0x1bb6('0xd')]('DeskConfiguration,\x20%s,\x20%s',_0x4629d0,_0x1bb6('0x14'));_0x59a152(_0xe56199[_0x1bb6('0x15')][_0x1bb6('0x13')]);}})[_0x1bb6('0x16')](function(_0x583711){logger['error'](_0x1bb6('0xe'),_0x4629d0,_0x583711);_0x13e2da(_0x583711);});});}
\ No newline at end of file
+var _0xb94c=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','DeskConfiguration,\x20%s,\x20%s','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','bluebird','randomstring'];(function(_0x19f9e6,_0x4f59a6){var _0x45c862=function(_0x3447fb){while(--_0x3447fb){_0x19f9e6['push'](_0x19f9e6['shift']());}};_0x45c862(++_0x4f59a6);}(_0xb94c,0x176));var _0xcb94=function(_0x2cdc7a,_0x38d065){_0x2cdc7a=_0x2cdc7a-0x0;var _0xb32d2b=_0xb94c[_0x2cdc7a];return _0xb32d2b;};'use strict';var _=require(_0xcb94('0x0'));var util=require(_0xcb94('0x1'));var moment=require('moment');var BPromise=require(_0xcb94('0x2'));var rs=require(_0xcb94('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcb94('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xcb94('0x5'))(_0xcb94('0x6'));var config=require(_0xcb94('0x7'));var jayson=require(_0xcb94('0x8'));var client=jayson[_0xcb94('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3ab328,_0x27441c,_0x20f879){return new BPromise(function(_0x22cac1,_0x16288f){return client['request'](_0x3ab328,_0x20f879)[_0xcb94('0xa')](function(_0x3305c9){logger[_0xcb94('0xb')](_0xcb94('0xc'),_0x27441c,'request\x20sent');logger[_0xcb94('0xd')](_0xcb94('0xe'),_0x27441c,_0xcb94('0xf'),JSON[_0xcb94('0x10')](_0x3305c9));if(_0x3305c9[_0xcb94('0x11')]){if(_0x3305c9[_0xcb94('0x11')][_0xcb94('0x12')]===0x1f4){logger[_0xcb94('0x11')](_0xcb94('0xc'),_0x27441c,_0x3305c9[_0xcb94('0x11')]['message']);return _0x16288f(_0x3305c9[_0xcb94('0x11')][_0xcb94('0x13')]);}logger['error']('DeskConfiguration,\x20%s,\x20%s',_0x27441c,_0x3305c9['error']['message']);return _0x22cac1(_0x3305c9[_0xcb94('0x11')][_0xcb94('0x13')]);}else{logger[_0xcb94('0xb')]('DeskConfiguration,\x20%s,\x20%s',_0x27441c,_0xcb94('0xf'));_0x22cac1(_0x3305c9['result'][_0xcb94('0x13')]);}})[_0xcb94('0x14')](function(_0x3dbfbb){logger[_0xcb94('0x11')](_0xcb94('0xc'),_0x27441c,_0x3dbfbb);_0x16288f(_0x3dbfbb);});});}
\ No newline at end of file
index 359074b..0f7ce00 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0289=['get','isAuthenticated','index','post','create','put','/:id','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskField.controller'];(function(_0x45f513,_0x2c6eef){var _0x3108b6=function(_0x561245){while(--_0x561245){_0x45f513['push'](_0x45f513['shift']());}};_0x3108b6(++_0x2c6eef);}(_0x0289,0x14c));var _0x9028=function(_0x43daa8,_0x2b964e){_0x43daa8=_0x43daa8-0x0;var _0x42a182=_0x0289[_0x43daa8];return _0x42a182;};'use strict';var multer=require(_0x9028('0x0'));var util=require(_0x9028('0x1'));var path=require('path');var timeout=require(_0x9028('0x2'));var express=require(_0x9028('0x3'));var router=express[_0x9028('0x4')]();var fs_extra=require(_0x9028('0x5'));var auth=require(_0x9028('0x6'));var interaction=require(_0x9028('0x7'));var config=require(_0x9028('0x8'));var controller=require(_0x9028('0x9'));router[_0x9028('0xa')]('/',auth[_0x9028('0xb')](),controller[_0x9028('0xc')]);router[_0x9028('0xa')]('/:id',auth[_0x9028('0xb')](),controller['show']);router[_0x9028('0xd')]('/',auth[_0x9028('0xb')](),controller[_0x9028('0xe')]);router[_0x9028('0xf')](_0x9028('0x10'),auth['isAuthenticated'](),controller['update']);router[_0x9028('0x11')](_0x9028('0x10'),auth[_0x9028('0xb')](),controller[_0x9028('0x12')]);module['exports']=router;
\ No newline at end of file
+var _0x91d2=['./intDeskField.controller','get','index','/:id','isAuthenticated','show','post','put','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../config/environment'];(function(_0xe14f77,_0x3ee4ad){var _0x178c57=function(_0x50b827){while(--_0x50b827){_0xe14f77['push'](_0xe14f77['shift']());}};_0x178c57(++_0x3ee4ad);}(_0x91d2,0x188));var _0x291d=function(_0x3d62b3,_0xacbab4){_0x3d62b3=_0x3d62b3-0x0;var _0x45b6dc=_0x91d2[_0x3d62b3];return _0x45b6dc;};'use strict';var multer=require(_0x291d('0x0'));var util=require(_0x291d('0x1'));var path=require(_0x291d('0x2'));var timeout=require('connect-timeout');var express=require(_0x291d('0x3'));var router=express[_0x291d('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x291d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x291d('0x6'));var controller=require(_0x291d('0x7'));router[_0x291d('0x8')]('/',auth['isAuthenticated'](),controller[_0x291d('0x9')]);router[_0x291d('0x8')](_0x291d('0xa'),auth[_0x291d('0xb')](),controller[_0x291d('0xc')]);router[_0x291d('0xd')]('/',auth[_0x291d('0xb')](),controller['create']);router[_0x291d('0xe')](_0x291d('0xa'),auth[_0x291d('0xb')](),controller[_0x291d('0xf')]);router[_0x291d('0x10')](_0x291d('0xa'),auth[_0x291d('0xb')](),controller[_0x291d('0x11')]);module[_0x291d('0x12')]=router;
\ No newline at end of file
index 3c040ff..de9ac1b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd53d=['picklist','STRING','BOOLEAN','ENUM','string','variable','customVariable','keyValue'];(function(_0x47da64,_0x34a4ba){var _0x154bd3=function(_0x318afc){while(--_0x318afc){_0x47da64['push'](_0x47da64['shift']());}};_0x154bd3(++_0x34a4ba);}(_0xd53d,0x1d3));var _0xdd53=function(_0x1ba5ff,_0x3f17db){_0x1ba5ff=_0x1ba5ff-0x0;var _0x4b3505=_0xd53d[_0x1ba5ff];return _0x4b3505;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0xdd53('0x0')](_0xdd53('0x1'),_0xdd53('0x2'),_0xdd53('0x3'),_0xdd53('0x4'),_0xdd53('0x5')),'defaultValue':_0xdd53('0x1')},'content':{'type':Sequelize[_0xdd53('0x6')]},'key':{'type':Sequelize[_0xdd53('0x6')]},'keyType':{'type':Sequelize[_0xdd53('0x0')](_0xdd53('0x1'),_0xdd53('0x2'),_0xdd53('0x3'))},'keyContent':{'type':Sequelize[_0xdd53('0x6')]},'idField':{'type':Sequelize[_0xdd53('0x6')]},'nameField':{'type':Sequelize[_0xdd53('0x6')]},'customField':{'type':Sequelize[_0xdd53('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xb0f3=['exports','variable','customVariable','keyValue','string','STRING','ENUM','sequelize'];(function(_0x22e03a,_0x1063df){var _0x326c4b=function(_0x22ace9){while(--_0x22ace9){_0x22e03a['push'](_0x22e03a['shift']());}};_0x326c4b(++_0x1063df);}(_0xb0f3,0xa7));var _0x3b0f=function(_0x3f333c,_0x14f59a){_0x3f333c=_0x3f333c-0x0;var _0x6af3ad=_0xb0f3[_0x3f333c];return _0x6af3ad;};'use strict';var Sequelize=require(_0x3b0f('0x0'));module[_0x3b0f('0x1')]={'type':{'type':Sequelize['ENUM']('string',_0x3b0f('0x2'),_0x3b0f('0x3'),_0x3b0f('0x4'),'picklist'),'defaultValue':_0x3b0f('0x5')},'content':{'type':Sequelize[_0x3b0f('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x3b0f('0x7')]('string',_0x3b0f('0x2'),'customVariable')},'keyContent':{'type':Sequelize[_0x3b0f('0x6')]},'idField':{'type':Sequelize[_0x3b0f('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x3b0f('0x6')]}};
\ No newline at end of file
index 17af083..45fd089 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcff4=['zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','error','stack','name','send','map','type','keys','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','DeskField','findAll','rows','show','params','find','create','body','catch','eml-format','rimraf'];(function(_0x392897,_0x449b2a){var _0x156e49=function(_0x370f08){while(--_0x370f08){_0x392897['push'](_0x392897['shift']());}};_0x156e49(++_0x449b2a);}(_0xcff4,0x11e));var _0x4cff=function(_0x10dfb6,_0x47ea82){_0x10dfb6=_0x10dfb6-0x0;var _0x4c9c8c=_0xcff4[_0x10dfb6];return _0x4c9c8c;};'use strict';var emlformat=require(_0x4cff('0x0'));var rimraf=require(_0x4cff('0x1'));var zipdir=require(_0x4cff('0x2'));var jsonpatch=require(_0x4cff('0x3'));var rp=require(_0x4cff('0x4'));var moment=require(_0x4cff('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x4cff('0x6'));var util=require('util');var path=require(_0x4cff('0x7'));var sox=require(_0x4cff('0x8'));var csv=require(_0x4cff('0x9'));var ejs=require(_0x4cff('0xa'));var fs=require('fs');var fs_extra=require(_0x4cff('0xb'));var _=require(_0x4cff('0xc'));var squel=require('squel');var crypto=require(_0x4cff('0xd'));var jsforce=require(_0x4cff('0xe'));var deskjs=require(_0x4cff('0xf'));var toCsv=require(_0x4cff('0x9'));var querystring=require(_0x4cff('0x10'));var Papa=require(_0x4cff('0x11'));var Redis=require(_0x4cff('0x12'));var authService=require(_0x4cff('0x13'));var qs=require(_0x4cff('0x14'));var as=require(_0x4cff('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x4cff('0x16'));var utils=require(_0x4cff('0x17'));var config=require(_0x4cff('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x4cff('0x19'))['db'];function respondWithStatusCode(_0x2b8273,_0xd86c2c){_0xd86c2c=_0xd86c2c||0xcc;return function(_0x35a40b){if(_0x35a40b){return _0x2b8273[_0x4cff('0x1a')](_0xd86c2c);}return _0x2b8273[_0x4cff('0x1b')](_0xd86c2c)[_0x4cff('0x1c')]();};}function respondWithResult(_0x2e4e5d,_0x306e91){_0x306e91=_0x306e91||0xc8;return function(_0x12f445){if(_0x12f445){return _0x2e4e5d[_0x4cff('0x1b')](_0x306e91)[_0x4cff('0x1d')](_0x12f445);}};}function respondWithFilteredResult(_0x56ea80,_0x148e70){return function(_0x565647){if(_0x565647){var _0x14bce8=typeof _0x148e70[_0x4cff('0x1e')]===_0x4cff('0x1f')&&typeof _0x148e70[_0x4cff('0x20')]===_0x4cff('0x1f');var _0x2749ec=_0x565647[_0x4cff('0x21')];var _0x939924=_0x14bce8?0x0:_0x148e70['offset'];var _0xae8a0e=_0x14bce8?_0x565647['count']:_0x148e70[_0x4cff('0x1e')]+_0x148e70[_0x4cff('0x20')];var _0x110e85;if(_0xae8a0e>=_0x2749ec){_0xae8a0e=_0x2749ec;_0x110e85=0xc8;}else{_0x110e85=0xce;}_0x56ea80['status'](_0x110e85);return _0x56ea80['set'](_0x4cff('0x22'),_0x939924+'-'+_0xae8a0e+'/'+_0x2749ec)['json'](_0x565647);}return null;};}function patchUpdates(_0xc7388a){return function(_0x498771){try{jsonpatch[_0x4cff('0x23')](_0x498771,_0xc7388a,!![]);}catch(_0x448079){return BPromise['reject'](_0x448079);}return _0x498771[_0x4cff('0x24')]();};}function saveUpdates(_0x65c0ab,_0x2931cf){return function(_0x181ed4){if(_0x181ed4){return _0x181ed4[_0x4cff('0x25')](_0x65c0ab)[_0x4cff('0x26')](function(_0xe6bcff){return _0xe6bcff;});}return null;};}function removeEntity(_0xfe7adb,_0x304c08){return function(_0x1c054c){if(_0x1c054c){return _0x1c054c['destroy']()[_0x4cff('0x26')](function(){_0xfe7adb[_0x4cff('0x1b')](0xcc)[_0x4cff('0x1c')]();});}};}function handleEntityNotFound(_0x4bc25a,_0x4eb3c9){return function(_0x139957){if(!_0x139957){_0x4bc25a[_0x4cff('0x1a')](0x194);}return _0x139957;};}function handleError(_0xe70525,_0x2ba328){_0x2ba328=_0x2ba328||0x1f4;return function(_0x632d03){logger[_0x4cff('0x27')](_0x632d03[_0x4cff('0x28')]);if(_0x632d03[_0x4cff('0x29')]){delete _0x632d03[_0x4cff('0x29')];}_0xe70525['status'](_0x2ba328)[_0x4cff('0x2a')](_0x632d03);};}exports['index']=function(_0x4debdd,_0x5c9e64){var _0xc476b={},_0x5da67d={},_0x207683={'count':0x0,'rows':[]};var _0xab4a17=_[_0x4cff('0x2b')](db['DeskField']['rawAttributes'],function(_0x5915d6){return{'name':_0x5915d6['fieldName'],'type':_0x5915d6[_0x4cff('0x2c')]['key']};});_0x5da67d['model']=_['map'](_0xab4a17,'name');_0x5da67d['query']=_[_0x4cff('0x2d')](_0x4debdd[_0x4cff('0x2e')]);_0x5da67d[_0x4cff('0x2f')]=_[_0x4cff('0x30')](_0x5da67d[_0x4cff('0x31')],_0x5da67d[_0x4cff('0x2e')]);_0xc476b[_0x4cff('0x32')]=_[_0x4cff('0x30')](_0x5da67d[_0x4cff('0x31')],qs[_0x4cff('0x33')](_0x4debdd[_0x4cff('0x2e')][_0x4cff('0x33')]));_0xc476b[_0x4cff('0x32')]=_0xc476b['attributes'][_0x4cff('0x34')]?_0xc476b[_0x4cff('0x32')]:_0x5da67d['model'];if(!_0x4debdd[_0x4cff('0x2e')]['hasOwnProperty'](_0x4cff('0x35'))){_0xc476b[_0x4cff('0x20')]=qs[_0x4cff('0x20')](_0x4debdd[_0x4cff('0x2e')][_0x4cff('0x20')]);_0xc476b[_0x4cff('0x1e')]=qs[_0x4cff('0x1e')](_0x4debdd[_0x4cff('0x2e')][_0x4cff('0x1e')]);}_0xc476b[_0x4cff('0x36')]=qs[_0x4cff('0x37')](_0x4debdd['query']['sort']);_0xc476b[_0x4cff('0x38')]=qs[_0x4cff('0x2f')](_[_0x4cff('0x39')](_0x4debdd[_0x4cff('0x2e')],_0x5da67d['filters']),_0xab4a17);if(_0x4debdd['query'][_0x4cff('0x3a')]){_0xc476b[_0x4cff('0x38')]=_['merge'](_0xc476b[_0x4cff('0x38')],{'$or':_[_0x4cff('0x2b')](_0xab4a17,function(_0xe70ab4){if(_0xe70ab4[_0x4cff('0x2c')]!==_0x4cff('0x3b')){var _0x2c2ef4={};_0x2c2ef4[_0xe70ab4['name']]={'$like':'%'+_0x4debdd['query'][_0x4cff('0x3a')]+'%'};return _0x2c2ef4;}})});}_0xc476b=_[_0x4cff('0x3c')]({},_0xc476b,_0x4debdd[_0x4cff('0x3d')]);var _0x4c9ba5={'where':_0xc476b[_0x4cff('0x38')]};return db['DeskField'][_0x4cff('0x21')](_0x4c9ba5)[_0x4cff('0x26')](function(_0x452564){_0x207683[_0x4cff('0x21')]=_0x452564;if(_0x4debdd['query'][_0x4cff('0x3e')]){_0xc476b['include']=[{'all':!![]}];}return db[_0x4cff('0x3f')][_0x4cff('0x40')](_0xc476b);})['then'](function(_0x5c6279){_0x207683[_0x4cff('0x41')]=_0x5c6279;return _0x207683;})[_0x4cff('0x26')](respondWithFilteredResult(_0x5c9e64,_0xc476b))['catch'](handleError(_0x5c9e64,null));};exports[_0x4cff('0x42')]=function(_0xa91b2a,_0x470cc5){var _0x306c83={'raw':!![],'where':{'id':_0xa91b2a[_0x4cff('0x43')]['id']}},_0x1903f7={};_0x1903f7[_0x4cff('0x31')]=_[_0x4cff('0x2d')](db[_0x4cff('0x3f')]['rawAttributes']);_0x1903f7[_0x4cff('0x2e')]=_[_0x4cff('0x2d')](_0xa91b2a[_0x4cff('0x2e')]);_0x1903f7[_0x4cff('0x2f')]=_[_0x4cff('0x30')](_0x1903f7['model'],_0x1903f7[_0x4cff('0x2e')]);_0x306c83['attributes']=_[_0x4cff('0x30')](_0x1903f7[_0x4cff('0x31')],qs['fields'](_0xa91b2a[_0x4cff('0x2e')][_0x4cff('0x33')]));_0x306c83[_0x4cff('0x32')]=_0x306c83[_0x4cff('0x32')][_0x4cff('0x34')]?_0x306c83[_0x4cff('0x32')]:_0x1903f7['model'];if(_0xa91b2a['query']['includeAll']){_0x306c83['include']=[{'all':!![]}];}_0x306c83=_[_0x4cff('0x3c')]({},_0x306c83,_0xa91b2a['options']);return db[_0x4cff('0x3f')][_0x4cff('0x44')](_0x306c83)[_0x4cff('0x26')](handleEntityNotFound(_0x470cc5,null))[_0x4cff('0x26')](respondWithResult(_0x470cc5,null))['catch'](handleError(_0x470cc5,null));};exports[_0x4cff('0x45')]=function(_0x4e5f99,_0x1bedbb){return db[_0x4cff('0x3f')][_0x4cff('0x45')](_0x4e5f99[_0x4cff('0x46')],{})['then'](respondWithResult(_0x1bedbb,0xc9))['catch'](handleError(_0x1bedbb,null));};exports[_0x4cff('0x25')]=function(_0x4d9f4c,_0x33a9e0){if(_0x4d9f4c[_0x4cff('0x46')]['id']){delete _0x4d9f4c[_0x4cff('0x46')]['id'];}return db[_0x4cff('0x3f')][_0x4cff('0x44')]({'where':{'id':_0x4d9f4c[_0x4cff('0x43')]['id']}})[_0x4cff('0x26')](handleEntityNotFound(_0x33a9e0,null))[_0x4cff('0x26')](saveUpdates(_0x4d9f4c[_0x4cff('0x46')],null))[_0x4cff('0x26')](respondWithResult(_0x33a9e0,null))[_0x4cff('0x47')](handleError(_0x33a9e0,null));};exports['destroy']=function(_0x5ec97c,_0x117cca){return db[_0x4cff('0x3f')][_0x4cff('0x44')]({'where':{'id':_0x5ec97c[_0x4cff('0x43')]['id']}})[_0x4cff('0x26')](handleEntityNotFound(_0x117cca,null))['then'](removeEntity(_0x117cca,null))[_0x4cff('0x47')](handleError(_0x117cca,null));};
\ No newline at end of file
+var _0xfd1b=['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','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','json','undefined','limit','count','status','set','reject','save','update','destroy','then','error','stack','name','index','map','DeskField','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','offset','order','sort','where','filters','filter','merge','options','includeAll','include','findAll','show','find','catch','create','body','params','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash'];(function(_0x13a275,_0x3959a5){var _0x45919a=function(_0x56cb70){while(--_0x56cb70){_0x13a275['push'](_0x13a275['shift']());}};_0x45919a(++_0x3959a5);}(_0xfd1b,0x1b1));var _0xbfd1=function(_0x1f924a,_0x1f096d){_0x1f924a=_0x1f924a-0x0;var _0x49d6d0=_0xfd1b[_0x1f924a];return _0x49d6d0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xbfd1('0x0'));var jsonpatch=require(_0xbfd1('0x1'));var rp=require(_0xbfd1('0x2'));var moment=require(_0xbfd1('0x3'));var BPromise=require(_0xbfd1('0x4'));var Mustache=require('mustache');var util=require(_0xbfd1('0x5'));var path=require(_0xbfd1('0x6'));var sox=require(_0xbfd1('0x7'));var csv=require('to-csv');var ejs=require(_0xbfd1('0x8'));var fs=require('fs');var fs_extra=require(_0xbfd1('0x9'));var _=require(_0xbfd1('0xa'));var squel=require(_0xbfd1('0xb'));var crypto=require(_0xbfd1('0xc'));var jsforce=require(_0xbfd1('0xd'));var deskjs=require(_0xbfd1('0xe'));var toCsv=require(_0xbfd1('0xf'));var querystring=require('querystring');var Papa=require(_0xbfd1('0x10'));var Redis=require('ioredis');var authService=require(_0xbfd1('0x11'));var qs=require(_0xbfd1('0x12'));var as=require(_0xbfd1('0x13'));var hardwareService=require(_0xbfd1('0x14'));var logger=require(_0xbfd1('0x15'))(_0xbfd1('0x16'));var utils=require(_0xbfd1('0x17'));var config=require(_0xbfd1('0x18'));var licenseUtil=require(_0xbfd1('0x19'));var db=require(_0xbfd1('0x1a'))['db'];function respondWithStatusCode(_0x3390e2,_0x521c41){_0x521c41=_0x521c41||0xcc;return function(_0x12b4d2){if(_0x12b4d2){return _0x3390e2[_0xbfd1('0x1b')](_0x521c41);}return _0x3390e2['status'](_0x521c41)['end']();};}function respondWithResult(_0x9aebf2,_0x4a968e){_0x4a968e=_0x4a968e||0xc8;return function(_0xa2e380){if(_0xa2e380){return _0x9aebf2['status'](_0x4a968e)[_0xbfd1('0x1c')](_0xa2e380);}};}function respondWithFilteredResult(_0x6de36,_0x223ff5){return function(_0x4c8303){if(_0x4c8303){var _0x5d039f=typeof _0x223ff5['offset']===_0xbfd1('0x1d')&&typeof _0x223ff5[_0xbfd1('0x1e')]===_0xbfd1('0x1d');var _0x27381f=_0x4c8303[_0xbfd1('0x1f')];var _0x3f6913=_0x5d039f?0x0:_0x223ff5['offset'];var _0xf824d7=_0x5d039f?_0x4c8303[_0xbfd1('0x1f')]:_0x223ff5['offset']+_0x223ff5[_0xbfd1('0x1e')];var _0x4b1086;if(_0xf824d7>=_0x27381f){_0xf824d7=_0x27381f;_0x4b1086=0xc8;}else{_0x4b1086=0xce;}_0x6de36[_0xbfd1('0x20')](_0x4b1086);return _0x6de36[_0xbfd1('0x21')]('Content-Range',_0x3f6913+'-'+_0xf824d7+'/'+_0x27381f)[_0xbfd1('0x1c')](_0x4c8303);}return null;};}function patchUpdates(_0x44c3ba){return function(_0x3b8653){try{jsonpatch['apply'](_0x3b8653,_0x44c3ba,!![]);}catch(_0x52f02b){return BPromise[_0xbfd1('0x22')](_0x52f02b);}return _0x3b8653[_0xbfd1('0x23')]();};}function saveUpdates(_0x10480f,_0x813f06){return function(_0x1a27a7){if(_0x1a27a7){return _0x1a27a7[_0xbfd1('0x24')](_0x10480f)['then'](function(_0x53bebe){return _0x53bebe;});}return null;};}function removeEntity(_0x3f22d9,_0x9b225d){return function(_0x36aed3){if(_0x36aed3){return _0x36aed3[_0xbfd1('0x25')]()[_0xbfd1('0x26')](function(){_0x3f22d9[_0xbfd1('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x28072a,_0x24df99){return function(_0x67df92){if(!_0x67df92){_0x28072a['sendStatus'](0x194);}return _0x67df92;};}function handleError(_0x306097,_0x55cdb2){_0x55cdb2=_0x55cdb2||0x1f4;return function(_0x3dbbc0){logger[_0xbfd1('0x27')](_0x3dbbc0[_0xbfd1('0x28')]);if(_0x3dbbc0[_0xbfd1('0x29')]){delete _0x3dbbc0[_0xbfd1('0x29')];}_0x306097[_0xbfd1('0x20')](_0x55cdb2)['send'](_0x3dbbc0);};}exports[_0xbfd1('0x2a')]=function(_0xe6f7b0,_0x1342dc){var _0x9a5bcc={},_0x5f144a={},_0x12d43d={'count':0x0,'rows':[]};var _0x5cafc6=_[_0xbfd1('0x2b')](db[_0xbfd1('0x2c')][_0xbfd1('0x2d')],function(_0x4e7727){return{'name':_0x4e7727[_0xbfd1('0x2e')],'type':_0x4e7727[_0xbfd1('0x2f')][_0xbfd1('0x30')]};});_0x5f144a[_0xbfd1('0x31')]=_['map'](_0x5cafc6,_0xbfd1('0x29'));_0x5f144a['query']=_[_0xbfd1('0x32')](_0xe6f7b0[_0xbfd1('0x33')]);_0x5f144a['filters']=_[_0xbfd1('0x34')](_0x5f144a['model'],_0x5f144a[_0xbfd1('0x33')]);_0x9a5bcc[_0xbfd1('0x35')]=_[_0xbfd1('0x34')](_0x5f144a['model'],qs[_0xbfd1('0x36')](_0xe6f7b0[_0xbfd1('0x33')]['fields']));_0x9a5bcc[_0xbfd1('0x35')]=_0x9a5bcc[_0xbfd1('0x35')]['length']?_0x9a5bcc[_0xbfd1('0x35')]:_0x5f144a[_0xbfd1('0x31')];if(!_0xe6f7b0[_0xbfd1('0x33')][_0xbfd1('0x37')](_0xbfd1('0x38'))){_0x9a5bcc[_0xbfd1('0x1e')]=qs['limit'](_0xe6f7b0[_0xbfd1('0x33')][_0xbfd1('0x1e')]);_0x9a5bcc[_0xbfd1('0x39')]=qs[_0xbfd1('0x39')](_0xe6f7b0[_0xbfd1('0x33')][_0xbfd1('0x39')]);}_0x9a5bcc[_0xbfd1('0x3a')]=qs[_0xbfd1('0x3b')](_0xe6f7b0[_0xbfd1('0x33')]['sort']);_0x9a5bcc[_0xbfd1('0x3c')]=qs[_0xbfd1('0x3d')](_['pick'](_0xe6f7b0['query'],_0x5f144a['filters']),_0x5cafc6);if(_0xe6f7b0[_0xbfd1('0x33')][_0xbfd1('0x3e')]){_0x9a5bcc[_0xbfd1('0x3c')]=_[_0xbfd1('0x3f')](_0x9a5bcc[_0xbfd1('0x3c')],{'$or':_['map'](_0x5cafc6,function(_0x44c5b6){if(_0x44c5b6['type']!=='VIRTUAL'){var _0x20b77d={};_0x20b77d[_0x44c5b6[_0xbfd1('0x29')]]={'$like':'%'+_0xe6f7b0[_0xbfd1('0x33')]['filter']+'%'};return _0x20b77d;}})});}_0x9a5bcc=_[_0xbfd1('0x3f')]({},_0x9a5bcc,_0xe6f7b0[_0xbfd1('0x40')]);var _0x116ad4={'where':_0x9a5bcc[_0xbfd1('0x3c')]};return db[_0xbfd1('0x2c')][_0xbfd1('0x1f')](_0x116ad4)['then'](function(_0x1b0267){_0x12d43d[_0xbfd1('0x1f')]=_0x1b0267;if(_0xe6f7b0[_0xbfd1('0x33')][_0xbfd1('0x41')]){_0x9a5bcc[_0xbfd1('0x42')]=[{'all':!![]}];}return db['DeskField'][_0xbfd1('0x43')](_0x9a5bcc);})[_0xbfd1('0x26')](function(_0xf03c46){_0x12d43d['rows']=_0xf03c46;return _0x12d43d;})['then'](respondWithFilteredResult(_0x1342dc,_0x9a5bcc))['catch'](handleError(_0x1342dc,null));};exports[_0xbfd1('0x44')]=function(_0x5263f8,_0x470869){var _0x4f5ac8={'raw':!![],'where':{'id':_0x5263f8['params']['id']}},_0x51ade4={};_0x51ade4[_0xbfd1('0x31')]=_[_0xbfd1('0x32')](db['DeskField'][_0xbfd1('0x2d')]);_0x51ade4[_0xbfd1('0x33')]=_[_0xbfd1('0x32')](_0x5263f8['query']);_0x51ade4['filters']=_['intersection'](_0x51ade4['model'],_0x51ade4[_0xbfd1('0x33')]);_0x4f5ac8['attributes']=_[_0xbfd1('0x34')](_0x51ade4[_0xbfd1('0x31')],qs[_0xbfd1('0x36')](_0x5263f8['query'][_0xbfd1('0x36')]));_0x4f5ac8[_0xbfd1('0x35')]=_0x4f5ac8[_0xbfd1('0x35')]['length']?_0x4f5ac8['attributes']:_0x51ade4['model'];if(_0x5263f8[_0xbfd1('0x33')][_0xbfd1('0x41')]){_0x4f5ac8[_0xbfd1('0x42')]=[{'all':!![]}];}_0x4f5ac8=_[_0xbfd1('0x3f')]({},_0x4f5ac8,_0x5263f8[_0xbfd1('0x40')]);return db[_0xbfd1('0x2c')][_0xbfd1('0x45')](_0x4f5ac8)[_0xbfd1('0x26')](handleEntityNotFound(_0x470869,null))[_0xbfd1('0x26')](respondWithResult(_0x470869,null))[_0xbfd1('0x46')](handleError(_0x470869,null));};exports[_0xbfd1('0x47')]=function(_0x17cd61,_0x1138be){return db['DeskField'][_0xbfd1('0x47')](_0x17cd61[_0xbfd1('0x48')],{})[_0xbfd1('0x26')](respondWithResult(_0x1138be,0xc9))[_0xbfd1('0x46')](handleError(_0x1138be,null));};exports['update']=function(_0x4f2a3c,_0x28ff3a){if(_0x4f2a3c[_0xbfd1('0x48')]['id']){delete _0x4f2a3c[_0xbfd1('0x48')]['id'];}return db[_0xbfd1('0x2c')][_0xbfd1('0x45')]({'where':{'id':_0x4f2a3c['params']['id']}})[_0xbfd1('0x26')](handleEntityNotFound(_0x28ff3a,null))[_0xbfd1('0x26')](saveUpdates(_0x4f2a3c[_0xbfd1('0x48')],null))[_0xbfd1('0x26')](respondWithResult(_0x28ff3a,null))[_0xbfd1('0x46')](handleError(_0x28ff3a,null));};exports['destroy']=function(_0x2fa869,_0xd8f84){return db[_0xbfd1('0x2c')]['find']({'where':{'id':_0x2fa869[_0xbfd1('0x49')]['id']}})[_0xbfd1('0x26')](handleEntityNotFound(_0xd8f84,null))[_0xbfd1('0x26')](removeEntity(_0xd8f84,null))[_0xbfd1('0x46')](handleError(_0xd8f84,null));};
\ No newline at end of file
index 02872cf..41c4bf9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb342=['../../config/logger','moment','request-promise','path','../../config/environment','./intDeskField.attributes','exports','define','desk_unique_index','idField','FieldId','lodash','util'];(function(_0x3c42bc,_0x3ca03d){var _0x128473=function(_0x5d4bb7){while(--_0x5d4bb7){_0x3c42bc['push'](_0x3c42bc['shift']());}};_0x128473(++_0x3ca03d);}(_0xb342,0x1df));var _0x2b34=function(_0x9adcd6,_0x36278b){_0x9adcd6=_0x9adcd6-0x0;var _0xdf8ff2=_0xb342[_0x9adcd6];return _0xdf8ff2;};'use strict';var _=require(_0x2b34('0x0'));var util=require(_0x2b34('0x1'));var logger=require(_0x2b34('0x2'))('api');var moment=require(_0x2b34('0x3'));var BPromise=require('bluebird');var rp=require(_0x2b34('0x4'));var fs=require('fs');var path=require(_0x2b34('0x5'));var rimraf=require('rimraf');var config=require(_0x2b34('0x6'));var attributes=require(_0x2b34('0x7'));module[_0x2b34('0x8')]=function(_0x43f974,_0x8fad14){return _0x43f974[_0x2b34('0x9')]('DeskField',attributes,{'tableName':'int_desk_fields','paranoid':![],'indexes':[{'name':_0x2b34('0xa'),'fields':[_0x2b34('0xb'),_0x2b34('0xc')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xb240=['idField','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./intDeskField.attributes','exports','define','int_desk_fields','desk_unique_index'];(function(_0x16e762,_0x147162){var _0x143736=function(_0x1f754d){while(--_0x1f754d){_0x16e762['push'](_0x16e762['shift']());}};_0x143736(++_0x147162);}(_0xb240,0x16d));var _0x0b24=function(_0x5b2adb,_0x56aa23){_0x5b2adb=_0x5b2adb-0x0;var _0x501756=_0xb240[_0x5b2adb];return _0x501756;};'use strict';var _=require(_0x0b24('0x0'));var util=require(_0x0b24('0x1'));var logger=require(_0x0b24('0x2'))(_0x0b24('0x3'));var moment=require(_0x0b24('0x4'));var BPromise=require(_0x0b24('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0b24('0x6'));var rimraf=require(_0x0b24('0x7'));var config=require('../../config/environment');var attributes=require(_0x0b24('0x8'));module[_0x0b24('0x9')]=function(_0x57c83b,_0x42f468){return _0x57c83b[_0x0b24('0xa')]('DeskField',attributes,{'tableName':_0x0b24('0xb'),'paranoid':![],'indexes':[{'name':_0x0b24('0xc'),'fields':[_0x0b24('0xd'),'FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index e545f75..33c30ab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeae2=['jayson/promise','client','http','request','then','info','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','DeskField,\x20%s,\x20%s','result','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x2802b0,_0x24f510){var _0x595313=function(_0x100ccd){while(--_0x100ccd){_0x2802b0['push'](_0x2802b0['shift']());}};_0x595313(++_0x24f510);}(_0xeae2,0x1f3));var _0x2eae=function(_0x2a70c8,_0x17e0d7){_0x2a70c8=_0x2a70c8-0x0;var _0x1dd930=_0xeae2[_0x2a70c8];return _0x1dd930;};'use strict';var _=require('lodash');var util=require(_0x2eae('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x2eae('0x1'));var fs=require('fs');var Redis=require(_0x2eae('0x2'));var db=require(_0x2eae('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x2eae('0x4'))(_0x2eae('0x5'));var config=require(_0x2eae('0x6'));var jayson=require(_0x2eae('0x7'));var client=jayson[_0x2eae('0x8')][_0x2eae('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2553c2,_0x131e86,_0x410f43){return new BPromise(function(_0xd8bc51,_0x23153b){return client[_0x2eae('0xa')](_0x2553c2,_0x410f43)[_0x2eae('0xb')](function(_0x1175d4){logger[_0x2eae('0xc')]('DeskField,\x20%s,\x20%s',_0x131e86,_0x2eae('0xd'));logger[_0x2eae('0xe')](_0x2eae('0xf'),_0x131e86,'request\x20sent',JSON[_0x2eae('0x10')](_0x1175d4));if(_0x1175d4[_0x2eae('0x11')]){if(_0x1175d4[_0x2eae('0x11')][_0x2eae('0x12')]===0x1f4){logger['error']('DeskField,\x20%s,\x20%s',_0x131e86,_0x1175d4['error']['message']);return _0x23153b(_0x1175d4[_0x2eae('0x11')][_0x2eae('0x13')]);}logger[_0x2eae('0x11')]('DeskField,\x20%s,\x20%s',_0x131e86,_0x1175d4[_0x2eae('0x11')][_0x2eae('0x13')]);return _0xd8bc51(_0x1175d4[_0x2eae('0x11')][_0x2eae('0x13')]);}else{logger['info'](_0x2eae('0x14'),_0x131e86,_0x2eae('0xd'));_0xd8bc51(_0x1175d4[_0x2eae('0x15')][_0x2eae('0x13')]);}})['catch'](function(_0x597406){logger[_0x2eae('0x11')](_0x2eae('0x14'),_0x131e86,_0x597406);_0x23153b(_0x597406);});});}
\ No newline at end of file
+var _0x172e=['then','info','request\x20sent','stringify','error','code','DeskField,\x20%s,\x20%s','message','result','catch','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x42f5de,_0x310589){var _0x3f5776=function(_0x18d9c6){while(--_0x18d9c6){_0x42f5de['push'](_0x42f5de['shift']());}};_0x3f5776(++_0x310589);}(_0x172e,0x13e));var _0xe172=function(_0xfc6749,_0x25395a){_0xfc6749=_0xfc6749-0x0;var _0x8a243f=_0x172e[_0xfc6749];return _0x8a243f;};'use strict';var _=require(_0xe172('0x0'));var util=require(_0xe172('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xe172('0x2'));var fs=require('fs');var Redis=require(_0xe172('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xe172('0x4'));var logger=require(_0xe172('0x5'))(_0xe172('0x6'));var config=require(_0xe172('0x7'));var jayson=require(_0xe172('0x8'));var client=jayson[_0xe172('0x9')][_0xe172('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x382c35,_0x3e7c7d,_0x3143f8){return new BPromise(function(_0x88b285,_0x32e50b){return client[_0xe172('0xb')](_0x382c35,_0x3143f8)[_0xe172('0xc')](function(_0x535093){logger[_0xe172('0xd')]('DeskField,\x20%s,\x20%s',_0x3e7c7d,'request\x20sent');logger['debug']('DeskField,\x20%s,\x20%s,\x20%s',_0x3e7c7d,_0xe172('0xe'),JSON[_0xe172('0xf')](_0x535093));if(_0x535093[_0xe172('0x10')]){if(_0x535093[_0xe172('0x10')][_0xe172('0x11')]===0x1f4){logger[_0xe172('0x10')](_0xe172('0x12'),_0x3e7c7d,_0x535093[_0xe172('0x10')][_0xe172('0x13')]);return _0x32e50b(_0x535093[_0xe172('0x10')][_0xe172('0x13')]);}logger[_0xe172('0x10')]('DeskField,\x20%s,\x20%s',_0x3e7c7d,_0x535093[_0xe172('0x10')]['message']);return _0x88b285(_0x535093[_0xe172('0x10')]['message']);}else{logger[_0xe172('0xd')](_0xe172('0x12'),_0x3e7c7d,_0xe172('0xe'));_0x88b285(_0x535093[_0xe172('0x14')][_0xe172('0x13')]);}})[_0xe172('0x15')](function(_0x56047c){logger[_0xe172('0x10')]('DeskField,\x20%s,\x20%s',_0x3e7c7d,_0x56047c);_0x32e50b(_0x56047c);});});}
\ No newline at end of file
index 84f823f..1860fda 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2a63=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDynamics365Account.controller','get','index','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','create','post','addConfiguration','put','/:id','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x2ce4e7,_0xfd206f){var _0x4d85db=function(_0x89da97){while(--_0x89da97){_0x2ce4e7['push'](_0x2ce4e7['shift']());}};_0x4d85db(++_0xfd206f);}(_0x2a63,0x14e));var _0x32a6=function(_0xc9b988,_0x429150){_0xc9b988=_0xc9b988-0x0;var _0x5f14fe=_0x2a63[_0xc9b988];return _0x5f14fe;};'use strict';var multer=require(_0x32a6('0x0'));var util=require(_0x32a6('0x1'));var path=require(_0x32a6('0x2'));var timeout=require(_0x32a6('0x3'));var express=require(_0x32a6('0x4'));var router=express[_0x32a6('0x5')]();var fs_extra=require(_0x32a6('0x6'));var auth=require(_0x32a6('0x7'));var interaction=require(_0x32a6('0x8'));var config=require('../../config/environment');var controller=require(_0x32a6('0x9'));router[_0x32a6('0xa')]('/',auth['isAuthenticated'](),controller[_0x32a6('0xb')]);router[_0x32a6('0xa')]('/:id',auth[_0x32a6('0xc')](),controller[_0x32a6('0xd')]);router['get'](_0x32a6('0xe'),auth['isAuthenticated'](),controller[_0x32a6('0xf')]);router[_0x32a6('0xa')](_0x32a6('0x10'),auth[_0x32a6('0xc')](),controller[_0x32a6('0x11')]);router['post']('/',auth[_0x32a6('0xc')](),controller[_0x32a6('0x12')]);router[_0x32a6('0x13')]('/:id/configurations',auth[_0x32a6('0xc')](),controller[_0x32a6('0x14')]);router[_0x32a6('0x15')](_0x32a6('0x16'),auth[_0x32a6('0xc')](),controller['update']);router[_0x32a6('0x17')](_0x32a6('0x16'),auth['isAuthenticated'](),controller[_0x32a6('0x18')]);module[_0x32a6('0x19')]=router;
\ No newline at end of file
+var _0xc9fb=['multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','get','isAuthenticated','/:id','show','/:id/fields','post','/:id/configurations','addConfiguration','put','update','delete','destroy','exports'];(function(_0x26462c,_0xd20a35){var _0x509a42=function(_0x1b22c9){while(--_0x1b22c9){_0x26462c['push'](_0x26462c['shift']());}};_0x509a42(++_0xd20a35);}(_0xc9fb,0xfc));var _0xbc9f=function(_0x15e782,_0x4f825d){_0x15e782=_0x15e782-0x0;var _0x2ea84b=_0xc9fb[_0x15e782];return _0x2ea84b;};'use strict';var multer=require(_0xbc9f('0x0'));var util=require(_0xbc9f('0x1'));var path=require(_0xbc9f('0x2'));var timeout=require(_0xbc9f('0x3'));var express=require(_0xbc9f('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xbc9f('0x5'));var config=require(_0xbc9f('0x6'));var controller=require(_0xbc9f('0x7'));router[_0xbc9f('0x8')]('/',auth[_0xbc9f('0x9')](),controller['index']);router[_0xbc9f('0x8')](_0xbc9f('0xa'),auth['isAuthenticated'](),controller[_0xbc9f('0xb')]);router[_0xbc9f('0x8')]('/:id/configurations',auth[_0xbc9f('0x9')](),controller['getConfigurations']);router['get'](_0xbc9f('0xc'),auth[_0xbc9f('0x9')](),controller['getFields']);router[_0xbc9f('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0xbc9f('0xe'),auth[_0xbc9f('0x9')](),controller[_0xbc9f('0xf')]);router[_0xbc9f('0x10')](_0xbc9f('0xa'),auth[_0xbc9f('0x9')](),controller[_0xbc9f('0x11')]);router[_0xbc9f('0x12')](_0xbc9f('0xa'),auth[_0xbc9f('0x9')](),controller[_0xbc9f('0x13')]);module[_0xbc9f('0x14')]=router;
\ No newline at end of file
index 24b74bd..b132d56 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3b74=['sequelize','exports','STRING','BOOLEAN'];(function(_0x1688f6,_0x9ab079){var _0x144c86=function(_0x3e979e){while(--_0x3e979e){_0x1688f6['push'](_0x1688f6['shift']());}};_0x144c86(++_0x9ab079);}(_0x3b74,0x80));var _0x43b7=function(_0x5c3834,_0x2f4bcc){_0x5c3834=_0x5c3834-0x0;var _0x415f97=_0x3b74[_0x5c3834];return _0x415f97;};'use strict';var Sequelize=require(_0x43b7('0x0'));module[_0x43b7('0x1')]={'name':{'type':Sequelize[_0x43b7('0x2')]},'username':{'type':Sequelize[_0x43b7('0x2')]},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x43b7('0x2')]},'tenantId':{'type':Sequelize[_0x43b7('0x2')]},'clientId':{'type':Sequelize[_0x43b7('0x2')]},'clientSecret':{'type':Sequelize[_0x43b7('0x2')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x43b7('0x2')]},'modernAuthentication':{'type':Sequelize[_0x43b7('0x3')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x94ba=['STRING','sequelize','exports'];(function(_0x53cebc,_0x165766){var _0x3ce28b=function(_0x1913ec){while(--_0x1913ec){_0x53cebc['push'](_0x53cebc['shift']());}};_0x3ce28b(++_0x165766);}(_0x94ba,0xbe));var _0xa94b=function(_0x4d3a2b,_0x32a224){_0x4d3a2b=_0x4d3a2b-0x0;var _0xdd32c8=_0x94ba[_0x4d3a2b];return _0xdd32c8;};'use strict';var Sequelize=require(_0xa94b('0x0'));module[_0xa94b('0x1')]={'name':{'type':Sequelize[_0xa94b('0x2')]},'username':{'type':Sequelize[_0xa94b('0x2')]},'password':{'type':Sequelize[_0xa94b('0x2')]},'remoteUri':{'type':Sequelize['STRING']},'tenantId':{'type':Sequelize[_0xa94b('0x2')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0xa94b('0x2')]},'serverUrl':{'type':Sequelize[_0xa94b('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
index 0adb67d..935be8f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xab3a=['entityimage_url','exchangerate','firstresponsebykpiidname','followupby','importsequencenumber','influencescore','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedon','modifiedonbehalfbyyominame','msdyn_iotalertname','numberofchildincidents','onholdtime','overriddencreatedon','owneridname','owneridtype','owneridyominame','primarycontactidname','prioritycodename','productidname','resolveby','responseby','responsiblecontactidyominame','sentimentvalue','slainvokedidname','slaname','socialprofileidname','statecode','statuscode','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','utcconversiontimezonecode','concat','username','password','tenantId','clientId','clientSecret','modernAuthentication','CloudProvider','data5','data7','remoteUri','POST','/oauth2/token','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','value','MetadataId',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','4.0','Attributes','remove','includes','LogicalName','forEach','@odata.type','PicklistAttributeMetadata','push','all','isNil','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','DecimalAttributeMetadata','test','statusCode','Wrong\x20credentials','EntityDefinitions(',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','Label','UserLocalizedLabel','Value','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','true','FalseOption','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','request-promise','util','lodash','../../components/parsers/qs','../../config/logger','api','../../mysqldb','../../components/integrations/configuration','status','json','offset','undefined','limit','count','set','then','destroy','end','error','stack','name','send','index','map','Dynamics365Account','rawAttributes','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','options','includeAll','include','rows','catch','show','merge','create','body','update','find','params','findOne','Dynamics365Configuration','getConfigurations','addConfiguration','AccountId','Subjects','Descriptions','getDescriptions','Dynamics365Field','slice','substring','lastIndexOf','format','%s/api/data/v9.0/','incident','Incident','PhoneCall','title','description','customerid','ownerid','caseorigincode','subject','directioncode','phonecall_activity_parties','accountidname','accountidyominame','actualserviceunits','billedserviceunits','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdon','customeridname','customeridtype','emailaddress','entityimage_timestamp'];(function(_0x27f76b,_0x377e5e){var _0x41a9a5=function(_0x163d0e){while(--_0x163d0e){_0x27f76b['push'](_0x27f76b['shift']());}};_0x41a9a5(++_0x377e5e);}(_0xab3a,0x1d3));var _0xaab3=function(_0x172133,_0x10246b){_0x172133=_0x172133-0x0;var _0x2460e5=_0xab3a[_0x172133];return _0x2460e5;};'use strict';var rp=require(_0xaab3('0x0'));var util=require(_0xaab3('0x1'));var _=require(_0xaab3('0x2'));var qs=require(_0xaab3('0x3'));var logger=require(_0xaab3('0x4'))(_0xaab3('0x5'));var db=require(_0xaab3('0x6'))['db'];var integrations=require(_0xaab3('0x7'));function respondWithResult(_0x5d0e1c,_0xd15ecb){_0xd15ecb=_0xd15ecb||0xc8;return function(_0x32840f){if(_0x32840f){return _0x5d0e1c[_0xaab3('0x8')](_0xd15ecb)[_0xaab3('0x9')](_0x32840f);}};}function respondWithFilteredResult(_0x4c5d04,_0x5760e8){return function(_0x501657){if(_0x501657){var _0x1fd19f=typeof _0x5760e8[_0xaab3('0xa')]===_0xaab3('0xb')&&typeof _0x5760e8[_0xaab3('0xc')]===_0xaab3('0xb');var _0x15841e=_0x501657[_0xaab3('0xd')];var _0x3595c0=_0x1fd19f?0x0:_0x5760e8[_0xaab3('0xa')];var _0x404054=_0x1fd19f?_0x501657['count']:_0x5760e8['offset']+_0x5760e8[_0xaab3('0xc')];var _0x45363f;if(_0x404054>=_0x15841e){_0x404054=_0x15841e;_0x45363f=0xc8;}else{_0x45363f=0xce;}_0x4c5d04[_0xaab3('0x8')](_0x45363f);return _0x4c5d04[_0xaab3('0xe')]('Content-Range',_0x3595c0+'-'+_0x404054+'/'+_0x15841e)[_0xaab3('0x9')](_0x501657);}return null;};}function saveUpdates(_0x536fd2){return function(_0x1be7b2){if(_0x1be7b2){return _0x1be7b2['update'](_0x536fd2)[_0xaab3('0xf')](function(_0x14136c){return _0x14136c;});}return null;};}function removeEntity(_0x4ccbf5){return function(_0x553449){if(_0x553449){return _0x553449[_0xaab3('0x10')]()[_0xaab3('0xf')](function(){_0x4ccbf5['status'](0xcc)[_0xaab3('0x11')]();});}};}function handleEntityNotFound(_0xcc28ed){return function(_0x2aea7a){if(!_0x2aea7a){_0xcc28ed['sendStatus'](0x194);}return _0x2aea7a;};}function handleError(_0x4f3f96,_0x48924b){_0x48924b=_0x48924b||0x1f4;return function(_0x484dc5){logger[_0xaab3('0x12')](_0x484dc5[_0xaab3('0x13')]);if(_0x484dc5[_0xaab3('0x14')]){delete _0x484dc5['name'];}_0x4f3f96[_0xaab3('0x8')](_0x48924b)[_0xaab3('0x15')](_0x484dc5);};}exports[_0xaab3('0x16')]=function(_0x13048f,_0x231256){var _0x4c0d11={},_0x4649e0={},_0x5a865b={'count':0x0,'rows':[]};var _0x1b72a5=_[_0xaab3('0x17')](db[_0xaab3('0x18')][_0xaab3('0x19')],function(_0xbd23c2){return{'name':_0xbd23c2['fieldName'],'type':_0xbd23c2['type']['key']};});_0x4649e0['model']=_['map'](_0x1b72a5,_0xaab3('0x14'));_0x4649e0[_0xaab3('0x1a')]=_[_0xaab3('0x1b')](_0x13048f[_0xaab3('0x1a')]);_0x4649e0[_0xaab3('0x1c')]=_[_0xaab3('0x1d')](_0x4649e0[_0xaab3('0x1e')],_0x4649e0[_0xaab3('0x1a')]);_0x4c0d11[_0xaab3('0x1f')]=_[_0xaab3('0x1d')](_0x4649e0[_0xaab3('0x1e')],qs[_0xaab3('0x20')](_0x13048f[_0xaab3('0x1a')]['fields']));_0x4c0d11[_0xaab3('0x1f')]=_0x4c0d11['attributes'][_0xaab3('0x21')]?_0x4c0d11[_0xaab3('0x1f')]:_0x4649e0['model'];if(!_0x13048f[_0xaab3('0x1a')][_0xaab3('0x22')](_0xaab3('0x23'))){_0x4c0d11['limit']=qs['limit'](_0x13048f[_0xaab3('0x1a')][_0xaab3('0xc')]);_0x4c0d11[_0xaab3('0xa')]=qs['offset'](_0x13048f[_0xaab3('0x1a')][_0xaab3('0xa')]);}_0x4c0d11[_0xaab3('0x24')]=qs[_0xaab3('0x25')](_0x13048f[_0xaab3('0x1a')][_0xaab3('0x25')]);_0x4c0d11[_0xaab3('0x26')]=qs[_0xaab3('0x1c')](_[_0xaab3('0x27')](_0x13048f[_0xaab3('0x1a')],_0x4649e0[_0xaab3('0x1c')]),_0x1b72a5);if(_0x13048f[_0xaab3('0x1a')][_0xaab3('0x28')]){_0x4c0d11[_0xaab3('0x26')]=_['merge'](_0x4c0d11[_0xaab3('0x26')],{'$or':_[_0xaab3('0x17')](_0x1b72a5,function(_0x20d925){if(_0x20d925[_0xaab3('0x29')]!==_0xaab3('0x2a')){var _0x2c9632={};_0x2c9632[_0x20d925['name']]={'$like':'%'+_0x13048f[_0xaab3('0x1a')]['filter']+'%'};return _0x2c9632;}})});}_0x4c0d11=_['merge']({},_0x4c0d11,_0x13048f[_0xaab3('0x2b')]);var _0x85c0e5={'where':_0x4c0d11['where']};return db['Dynamics365Account'][_0xaab3('0xd')](_0x85c0e5)[_0xaab3('0xf')](function(_0x2111a5){_0x5a865b['count']=_0x2111a5;if(_0x13048f[_0xaab3('0x1a')][_0xaab3('0x2c')]){_0x4c0d11[_0xaab3('0x2d')]=[{'all':!![]}];}return db['Dynamics365Account']['findAll'](_0x4c0d11);})[_0xaab3('0xf')](function(_0x33434e){_0x5a865b[_0xaab3('0x2e')]=_0x33434e;return _0x5a865b;})[_0xaab3('0xf')](respondWithFilteredResult(_0x231256,_0x4c0d11))[_0xaab3('0x2f')](handleError(_0x231256,null));};exports[_0xaab3('0x30')]=function(_0x5c8218,_0x152458){var _0x11eb58={'raw':![],'where':{'id':_0x5c8218['params']['id']}},_0x476bfa={};_0x476bfa[_0xaab3('0x1e')]=_[_0xaab3('0x1b')](db[_0xaab3('0x18')][_0xaab3('0x19')]);_0x476bfa[_0xaab3('0x1a')]=_[_0xaab3('0x1b')](_0x5c8218['query']);_0x476bfa['filters']=_[_0xaab3('0x1d')](_0x476bfa[_0xaab3('0x1e')],_0x476bfa['query']);_0x11eb58['attributes']=_[_0xaab3('0x1d')](_0x476bfa[_0xaab3('0x1e')],qs['fields'](_0x5c8218[_0xaab3('0x1a')][_0xaab3('0x20')]));_0x11eb58[_0xaab3('0x1f')]=_0x11eb58[_0xaab3('0x1f')]['length']?_0x11eb58[_0xaab3('0x1f')]:_0x476bfa[_0xaab3('0x1e')];if(_0x5c8218['query'][_0xaab3('0x2c')]){_0x11eb58['include']=[{'all':!![]}];}_0x11eb58=_[_0xaab3('0x31')]({},_0x11eb58,_0x5c8218[_0xaab3('0x2b')]);return db[_0xaab3('0x18')]['find'](_0x11eb58)[_0xaab3('0xf')](handleEntityNotFound(_0x152458,null))[_0xaab3('0xf')](respondWithResult(_0x152458,null))[_0xaab3('0x2f')](handleError(_0x152458,null));};exports['create']=function(_0x35dc0c,_0x1f2bed){return db[_0xaab3('0x18')][_0xaab3('0x32')](_0x35dc0c[_0xaab3('0x33')],{})[_0xaab3('0xf')](respondWithResult(_0x1f2bed,0xc9))['catch'](handleError(_0x1f2bed,null));};exports[_0xaab3('0x34')]=function(_0x17919e,_0x2e315c){if(_0x17919e[_0xaab3('0x33')]['id']){delete _0x17919e[_0xaab3('0x33')]['id'];}return db[_0xaab3('0x18')][_0xaab3('0x35')]({'where':{'id':_0x17919e[_0xaab3('0x36')]['id']}})[_0xaab3('0xf')](handleEntityNotFound(_0x2e315c,null))[_0xaab3('0xf')](saveUpdates(_0x17919e[_0xaab3('0x33')],null))[_0xaab3('0xf')](respondWithResult(_0x2e315c,null))['catch'](handleError(_0x2e315c,null));};exports[_0xaab3('0x10')]=function(_0x18b45e,_0x12cdcf){return db[_0xaab3('0x18')]['find']({'where':{'id':_0x18b45e[_0xaab3('0x36')]['id']}})[_0xaab3('0xf')](handleEntityNotFound(_0x12cdcf,null))[_0xaab3('0xf')](removeEntity(_0x12cdcf,null))['catch'](handleError(_0x12cdcf,null));};exports['getConfigurations']=function(_0x4924b0,_0x834527){var _0x105da9={};var _0x579ca6={};var _0x26767d;var _0x366b4d;return db[_0xaab3('0x18')][_0xaab3('0x37')]({'where':{'id':_0x4924b0[_0xaab3('0x36')]['id']}})[_0xaab3('0xf')](handleEntityNotFound(_0x834527,null))[_0xaab3('0xf')](function(_0x15ff7d){if(_0x15ff7d){_0x26767d=_0x15ff7d;_0x579ca6['model']=_[_0xaab3('0x1b')](db[_0xaab3('0x38')][_0xaab3('0x19')]);_0x579ca6[_0xaab3('0x1a')]=_[_0xaab3('0x1b')](_0x4924b0['query']);_0x579ca6[_0xaab3('0x1c')]=_['intersection'](_0x579ca6['model'],_0x579ca6['query']);_0x105da9['attributes']=_[_0xaab3('0x1d')](_0x579ca6[_0xaab3('0x1e')],qs['fields'](_0x4924b0[_0xaab3('0x1a')][_0xaab3('0x20')]));_0x105da9[_0xaab3('0x1f')]=_0x105da9[_0xaab3('0x1f')]['length']?_0x105da9[_0xaab3('0x1f')]:_0x579ca6[_0xaab3('0x1e')];_0x105da9[_0xaab3('0x24')]=qs[_0xaab3('0x25')](_0x4924b0['query'][_0xaab3('0x25')]);_0x105da9[_0xaab3('0x26')]=qs[_0xaab3('0x1c')](_[_0xaab3('0x27')](_0x4924b0[_0xaab3('0x1a')],_0x579ca6[_0xaab3('0x1c')]));if(_0x4924b0[_0xaab3('0x1a')][_0xaab3('0x28')]){_0x105da9[_0xaab3('0x26')]=_[_0xaab3('0x31')](_0x105da9['where'],{'$or':_['map'](_0x105da9['attributes'],function(_0x1e86c4){var _0x4a3d0c={};_0x4a3d0c[_0x1e86c4]={'$like':'%'+_0x4924b0[_0xaab3('0x1a')][_0xaab3('0x28')]+'%'};return _0x4a3d0c;})});}_0x105da9=_[_0xaab3('0x31')]({},_0x105da9,_0x4924b0[_0xaab3('0x2b')]);return _0x26767d[_0xaab3('0x39')](_0x105da9);}})[_0xaab3('0xf')](function(_0x471fcd){if(_0x471fcd){_0x366b4d=_0x471fcd[_0xaab3('0x21')];if(!_0x4924b0['query']['hasOwnProperty'](_0xaab3('0x23'))){_0x105da9[_0xaab3('0xc')]=qs[_0xaab3('0xc')](_0x4924b0[_0xaab3('0x1a')]['limit']);_0x105da9[_0xaab3('0xa')]=qs[_0xaab3('0xa')](_0x4924b0[_0xaab3('0x1a')][_0xaab3('0xa')]);}return _0x26767d[_0xaab3('0x39')](_0x105da9);}})[_0xaab3('0xf')](function(_0x494aec){if(_0x494aec){return _0x494aec?{'count':_0x366b4d,'rows':_0x494aec}:null;}})['then'](respondWithResult(_0x834527,null))['catch'](handleError(_0x834527,null));};exports[_0xaab3('0x3a')]=function(_0x3e4ffd,_0x172707){if(_0x3e4ffd[_0xaab3('0x33')]['id']){delete _0x3e4ffd[_0xaab3('0x33')]['id'];}return db[_0xaab3('0x18')]['findOne']({'where':{'id':_0x3e4ffd[_0xaab3('0x36')]['id']}})[_0xaab3('0xf')](handleEntityNotFound(_0x172707,null))[_0xaab3('0xf')](function(_0x1e8bff){if(_0x1e8bff){_0x3e4ffd[_0xaab3('0x33')][_0xaab3('0x3b')]=_0x1e8bff['id'];_0x3e4ffd[_0xaab3('0x33')][_0xaab3('0x3c')]=integrations['getSubjects'](_0x3e4ffd['body']['channel'],_0x3e4ffd[_0xaab3('0x33')][_0xaab3('0x29')]);_0x3e4ffd[_0xaab3('0x33')][_0xaab3('0x3d')]=integrations[_0xaab3('0x3e')](_0x3e4ffd[_0xaab3('0x33')]['channel'],_0x3e4ffd[_0xaab3('0x33')][_0xaab3('0x29')]);return db[_0xaab3('0x38')][_0xaab3('0x32')](_0x3e4ffd[_0xaab3('0x33')],{'include':[{'model':db[_0xaab3('0x3f')],'as':_0xaab3('0x3c')},{'model':db[_0xaab3('0x3f')],'as':_0xaab3('0x3d')}]});}return null;})[_0xaab3('0xf')](respondWithResult(_0x172707,null))[_0xaab3('0x2f')](handleError(_0x172707,null));};function sanitizeRemoteUri(_0xa0b936){var _0x50d62f=_0xa0b936[_0xaab3('0x40')](-0x1);if(_0x50d62f==='/')return _0xa0b936[_0xaab3('0x41')](0x0,_0xa0b936[_0xaab3('0x42')](_0x50d62f));return _0xa0b936;}function getWebApiUrl(_0x5b8765){return util[_0xaab3('0x43')](_0xaab3('0x44'),_0x5b8765);}exports['getFields']=function(_0x449a8a,_0x3d5900){var _0x59733c=_0x449a8a['query']['ticketType'];var _0x7c483f=_0x59733c===_0xaab3('0x45')?_0xaab3('0x46'):_0xaab3('0x47');var _0x1590d9='';var _0x45323f='';var _0x335343='';var _0x53065b='';var _0x238050='';var _0x45b4de='';var _0x487821='';var _0x9a083a='';var _0xd02eb8=[_0xaab3('0x48'),_0xaab3('0x49'),_0xaab3('0x4a'),_0xaab3('0x4b'),_0xaab3('0x4c'),_0xaab3('0x4d'),'phonenumber','regardingobjectid',_0xaab3('0x4e'),_0xaab3('0x4f')];var _0x3fc7fd=[_0xaab3('0x50'),_0xaab3('0x51'),_0xaab3('0x52'),_0xaab3('0x53'),'contactidname',_0xaab3('0x54'),_0xaab3('0x55'),_0xaab3('0x56'),_0xaab3('0x57'),_0xaab3('0x58'),'createdbyname','createdbyyominame',_0xaab3('0x59'),'createdonbehalfbyname','createdonbehalfbyyominame',_0xaab3('0x5a'),_0xaab3('0x5b'),'customeridyominame',_0xaab3('0x5c'),'entitlementidname',_0xaab3('0x5d'),_0xaab3('0x5e'),'escalatedon',_0xaab3('0x5f'),_0xaab3('0x60'),_0xaab3('0x61'),_0xaab3('0x62'),_0xaab3('0x63'),_0xaab3('0x64'),_0xaab3('0x65'),_0xaab3('0x66'),_0xaab3('0x67'),_0xaab3('0x68'),_0xaab3('0x69'),'modifiedbyyominame',_0xaab3('0x6a'),'modifiedonbehalfbyname',_0xaab3('0x6b'),'msdyn_incidenttypename',_0xaab3('0x6c'),_0xaab3('0x6d'),_0xaab3('0x6e'),_0xaab3('0x6f'),_0xaab3('0x70'),_0xaab3('0x71'),_0xaab3('0x72'),'parentcaseidname',_0xaab3('0x73'),'primarycontactidyominame',_0xaab3('0x74'),_0xaab3('0x75'),'productserialnumber',_0xaab3('0x76'),'resolvebykpiidname',_0xaab3('0x77'),'responsiblecontactidname',_0xaab3('0x78'),_0xaab3('0x79'),_0xaab3('0x7a'),_0xaab3('0x7b'),_0xaab3('0x7c'),_0xaab3('0x7d'),_0xaab3('0x7e'),'subjectidname',_0xaab3('0x7f'),_0xaab3('0x80'),_0xaab3('0x81'),'traversedpath',_0xaab3('0x82'),'versionnumber'];var _0x574adb=_0xd02eb8[_0xaab3('0x83')](_0x3fc7fd);return db['Dynamics365Account'][_0xaab3('0x37')]({'where':{'id':_0x449a8a[_0xaab3('0x36')]['id']},'attributes':['id',_0xaab3('0x84'),_0xaab3('0x85'),'remoteUri',_0xaab3('0x86'),_0xaab3('0x87'),_0xaab3('0x88'),_0xaab3('0x89')],'include':[{'model':db[_0xaab3('0x8a')],'as':_0xaab3('0x8a'),'attributes':['id',_0xaab3('0x8b'),_0xaab3('0x8c')]}]})[_0xaab3('0xf')](handleEntityNotFound(_0x3d5900,null))[_0xaab3('0xf')](function(_0x13b98b){if(_0x13b98b){if(_0x13b98b[_0xaab3('0x89')]){_0x13b98b['access_token']=_0x13b98b['CloudProvider'][_0xaab3('0x8b')];_0x9a083a=sanitizeRemoteUri(_0x13b98b[_0xaab3('0x8a')]['data7']);_0x487821=getWebApiUrl(_0x9a083a);return _0x13b98b;}_0x9a083a=sanitizeRemoteUri(_0x13b98b[_0xaab3('0x8d')]);_0x487821=getWebApiUrl(_0x9a083a);var _0x35795d={'method':_0xaab3('0x8e'),'uri':'https://login.microsoftonline.com/'+_0x13b98b['tenantId']+_0xaab3('0x8f'),'form':{'client_id':_0x13b98b[_0xaab3('0x87')],'resource':_0x9a083a,'username':_0x13b98b[_0xaab3('0x84')],'password':_0x13b98b['password'],'grant_type':_0xaab3('0x85'),'client_secret':_0x13b98b[_0xaab3('0x88')]},'json':!![]};return rp(_0x35795d);}})[_0xaab3('0xf')](function(_0x1605e2){_0x45b4de=_0x1605e2['access_token'];var _0x4aa36a={'method':_0xaab3('0x90'),'uri':encodeURI(_0x487821+_0xaab3('0x91')+_0x7c483f+'\x27'),'headers':{'Authorization':_0xaab3('0x92')+_0x45b4de,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x4aa36a);})[_0xaab3('0xf')](function(_0x55c68d){var _0x99dc3b=_0x55c68d[_0xaab3('0x93')][0x0];var _0x12b9f3=_0x99dc3b[_0xaab3('0x94')];var _0x2558e2={'method':'GET','uri':_0x487821+'EntityDefinitions('+_0x12b9f3+_0xaab3('0x95'),'headers':{'Authorization':'Bearer\x20'+_0x45b4de,'If-None-Match':null,'OData-Version':_0xaab3('0x96')},'json':!![]};return rp(_0x2558e2);})['then'](function(_0x4be128){_0x1590d9=_0x4be128;_0x45323f=_0x1590d9[_0xaab3('0x97')];_0x45323f=_[_0xaab3('0x98')](_0x45323f,function(_0x121ac3){return!_0x574adb[_0xaab3('0x99')](_0x121ac3[_0xaab3('0x9a')]);});var _0x20900d=[];var _0xf7c111=[];_0x45323f[_0xaab3('0x9b')](function(_0xa91ef1){if(_0xa91ef1[_0xaab3('0x9c')]){var _0x372883=_0xa91ef1[_0xaab3('0x9c')][_0xaab3('0x41')](_0xa91ef1[_0xaab3('0x9c')][_0xaab3('0x42')]('.')+0x1);if(_0x372883===_0xaab3('0x9d')){_0x20900d[_0xaab3('0x9e')](getSelectList(_0x487821,_0x59733c,_0xf7c111,_0x1590d9[_0xaab3('0x94')],_0xa91ef1[_0xaab3('0x94')],_0x45b4de));}}});return Promise[_0xaab3('0x9f')](_0x20900d);})[_0xaab3('0xf')](function(_0x2f60c9){_0x335343=_0x2f60c9[0x0];var _0x144e37=[];var _0x4ff659=[];_0x45323f[_0xaab3('0x9b')](function(_0x1db8fc){if(!_[_0xaab3('0xa0')](_0x1db8fc[_0xaab3('0x9c')])){var _0x27398a=_0x1db8fc[_0xaab3('0x9c')]['substring'](_0x1db8fc[_0xaab3('0x9c')][_0xaab3('0x42')]('.')+0x1);if(_0x27398a==='BooleanAttributeMetadata'){_0x144e37[_0xaab3('0x9e')](getBooleanList(_0x487821,_0x59733c,_0x4ff659,_0x1590d9[_0xaab3('0x94')],_0x1db8fc[_0xaab3('0x94')],_0x45b4de));}}});return Promise[_0xaab3('0x9f')](_0x144e37);})[_0xaab3('0xf')](function(_0x1c2e36){_0x53065b=_0x1c2e36[0x0];var _0x4317d4=[];var _0x37837f=[];_0x45323f[_0xaab3('0x9b')](function(_0x17ef3c){if(_0x17ef3c[_0xaab3('0x9c')]){var _0x1cca9a=_0x17ef3c['@odata.type'][_0xaab3('0x41')](_0x17ef3c[_0xaab3('0x9c')][_0xaab3('0x42')]('.')+0x1);if(_0x1cca9a===_0xaab3('0xa1')||_0x1cca9a===_0xaab3('0xa2')||_0x1cca9a===_0xaab3('0xa3')||_0x1cca9a===_0xaab3('0xa4')||_0x1cca9a==='MemoAttributeMetadata'||_0x1cca9a==='DateTimeAttributeMetadata'||_0x1cca9a===_0xaab3('0xa5')||_0x1cca9a===_0xaab3('0xa6')||_0x1cca9a==='StateAttributeMetadata'||_0x1cca9a===_0xaab3('0xa7')){_0x4317d4[_0xaab3('0x9e')](getInputList(_0x487821,_0x59733c,_0x1cca9a,_0x37837f,_0x1590d9[_0xaab3('0x94')],_0x17ef3c[_0xaab3('0x94')],_0x45b4de));}}});return Promise[_0xaab3('0x9f')](_0x4317d4);})[_0xaab3('0xf')](function(_0x4a389c){_0x238050=_0x4a389c[0x0];var _0x3d28af=_0x335343[_0xaab3('0x83')](_0x53065b)[_0xaab3('0x83')](_0x238050);var _0x3b1f2e={'count':_0x3d28af[_0xaab3('0x21')],'rows':_0x3d28af};return _0x3b1f2e;})[_0xaab3('0xf')](respondWithResult(_0x3d5900,null))['catch'](function(_0x4b0ea8){var _0x31d8d6=_0x449a8a[_0xaab3('0x1a')][_0xaab3('0xa8')]?0x1f4:_0x4b0ea8[_0xaab3('0xa9')]||0x1f4;logger[_0xaab3('0x12')](_0x4b0ea8[_0xaab3('0x13')]);delete _0x4b0ea8[_0xaab3('0x14')];if(_0x31d8d6===0x191){_0x31d8d6=0x190;}_0x3d5900[_0xaab3('0x8')](_0x31d8d6)[_0xaab3('0x15')](_0x449a8a[_0xaab3('0x1a')][_0xaab3('0xa8')]?{'message':_0xaab3('0xaa'),'statusCode':_0x4b0ea8['statusCode']}:_0x4b0ea8);});};function getSelectList(_0x2efd30,_0x4bffd5,_0x4e6100,_0x50fd6d,_0x25fea7,_0x11bd3e){var _0x1002d8={'method':_0xaab3('0x90'),'uri':_0x2efd30+_0xaab3('0xab')+_0x50fd6d+_0xaab3('0xac')+_0x25fea7+_0xaab3('0xad')+_0xaab3('0xae'),'headers':{'Authorization':_0xaab3('0x92')+_0x11bd3e,'If-None-Match':null,'OData-Version':_0xaab3('0x96')},'json':!![]};return rp(_0x1002d8)['then'](function(_0x41c5c0){var _0x71c001=[];var _0x932410=_0x41c5c0[_0xaab3('0xaf')][_0xaab3('0xb0')];_0x932410[_0xaab3('0x9b')](function(_0x498030){_0x71c001[_0xaab3('0x9e')]({'name':_0x498030[_0xaab3('0xb1')][_0xaab3('0xb2')]['Label'],'value':String(_0x498030[_0xaab3('0xb3')])});});var _0x43882d={'id':_0x4bffd5+'_'+_0x41c5c0[_0xaab3('0x9a')],'name':_0x41c5c0[_0xaab3('0xb4')][_0xaab3('0xb2')]['Label'],'custom':![],'options':_0x71c001};_0x4e6100[_0xaab3('0x9e')](_0x43882d);return _0x4e6100;});}function getBooleanList(_0x42ad0d,_0x5cb3f0,_0x135daa,_0x1f10cf,_0xb4012c,_0x45afc5){var _0xf51fbb={'method':'GET','uri':_0x42ad0d+_0xaab3('0xab')+_0x1f10cf+_0xaab3('0xac')+_0xb4012c+_0xaab3('0xb5'),'headers':{'Authorization':'Bearer\x20'+_0x45afc5,'If-None-Match':null,'OData-Version':_0xaab3('0x96')},'json':!![]};return rp(_0xf51fbb)[_0xaab3('0xf')](function(_0xb15012){var _0x542404=[];_0x542404[_0xaab3('0x9e')]({'name':_0xb15012[_0xaab3('0xaf')]['TrueOption'][_0xaab3('0xb1')]['UserLocalizedLabel'][_0xaab3('0xb1')],'value':_0xaab3('0xb6')},{'name':_0xb15012['OptionSet'][_0xaab3('0xb7')][_0xaab3('0xb1')][_0xaab3('0xb2')][_0xaab3('0xb1')],'value':_0xaab3('0xb8')});var _0x112b80={'id':_0x5cb3f0+'_'+_0xb15012['LogicalName'],'name':_0xb15012[_0xaab3('0xb4')]['UserLocalizedLabel']['Label'],'custom':![],'options':_0x542404};_0x135daa[_0xaab3('0x9e')](_0x112b80);return _0x135daa;});}function getInputList(_0x2be001,_0x61d158,_0x560b42,_0x95faed,_0x1644f4,_0x253100,_0x2791ee){var _0x11e096={'method':'GET','uri':_0x2be001+'EntityDefinitions('+_0x1644f4+_0xaab3('0xac')+_0x253100+_0xaab3('0xb9')+_0x560b42+_0xaab3('0xba'),'headers':{'Authorization':_0xaab3('0x92')+_0x2791ee,'If-None-Match':null,'OData-Version':_0xaab3('0x96')},'json':!![]};return rp(_0x11e096)[_0xaab3('0xf')](function(_0xa356de){var _0x5b694d={'id':_0x61d158+'_'+_0xa356de[_0xaab3('0x9a')],'name':_0xa356de[_0xaab3('0xb4')][_0xaab3('0xb2')]?_0xa356de[_0xaab3('0xb4')][_0xaab3('0xb2')][_0xaab3('0xb1')]:_0xa356de[_0xaab3('0x9a')],'custom':![],'options':[]};_0x95faed[_0xaab3('0x9e')](_0x5b694d);return _0x95faed;});}
\ No newline at end of file
+var _0x064b=['BooleanAttributeMetadata','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','test','statusCode','Wrong\x20credentials',')/Attributes(','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','Label','UserLocalizedLabel','Value','LogicalName','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','request-promise','util','lodash','../../components/parsers/qs','api','../../mysqldb','../../components/integrations/configuration','limit','undefined','count','offset','status','set','Content-Range','json','update','then','destroy','sendStatus','error','stack','name','send','index','map','Dynamics365Account','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','filter','options','includeAll','include','findAll','rows','catch','params','create','body','find','Dynamics365Configuration','getConfigurations','addConfiguration','Subjects','channel','Descriptions','Dynamics365Field','slice','substring','lastIndexOf','format','%s/api/data/v9.0/','getFields','incident','Incident','PhoneCall','description','customerid','caseorigincode','subject','phonenumber','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','accountidyominame','actualserviceunits','billedserviceunits','contactidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','followupby','influencescore','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','onholdtime','primarycontactidyominame','prioritycodename','productidname','productserialnumber','resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slainvokedidname','slaname','socialprofileidname','statecode','statuscode','subjectidname','ticketnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','versionnumber','concat','findOne','password','remoteUri','tenantId','clientId','clientSecret','modernAuthentication','CloudProvider','data5','access_token','POST','https://login.microsoftonline.com/','/oauth2/token','username','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','MetadataId','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','remove','forEach','@odata.type','PicklistAttributeMetadata','push','all','isNil'];(function(_0x4ffa09,_0xfd49e8){var _0x1fcb94=function(_0x40e4c7){while(--_0x40e4c7){_0x4ffa09['push'](_0x4ffa09['shift']());}};_0x1fcb94(++_0xfd49e8);}(_0x064b,0xd9));var _0xb064=function(_0x11c89a,_0x306026){_0x11c89a=_0x11c89a-0x0;var _0x563c7a=_0x064b[_0x11c89a];return _0x563c7a;};'use strict';var rp=require(_0xb064('0x0'));var util=require(_0xb064('0x1'));var _=require(_0xb064('0x2'));var qs=require(_0xb064('0x3'));var logger=require('../../config/logger')(_0xb064('0x4'));var db=require(_0xb064('0x5'))['db'];var integrations=require(_0xb064('0x6'));function respondWithResult(_0x27fc05,_0x16d040){_0x16d040=_0x16d040||0xc8;return function(_0x4884c3){if(_0x4884c3){return _0x27fc05['status'](_0x16d040)['json'](_0x4884c3);}};}function respondWithFilteredResult(_0xe5fb85,_0x72a5cc){return function(_0x10a51e){if(_0x10a51e){var _0x300188=typeof _0x72a5cc['offset']==='undefined'&&typeof _0x72a5cc[_0xb064('0x7')]===_0xb064('0x8');var _0x475fbe=_0x10a51e[_0xb064('0x9')];var _0x12510d=_0x300188?0x0:_0x72a5cc[_0xb064('0xa')];var _0x3efffe=_0x300188?_0x10a51e[_0xb064('0x9')]:_0x72a5cc[_0xb064('0xa')]+_0x72a5cc[_0xb064('0x7')];var _0x3b0577;if(_0x3efffe>=_0x475fbe){_0x3efffe=_0x475fbe;_0x3b0577=0xc8;}else{_0x3b0577=0xce;}_0xe5fb85[_0xb064('0xb')](_0x3b0577);return _0xe5fb85[_0xb064('0xc')](_0xb064('0xd'),_0x12510d+'-'+_0x3efffe+'/'+_0x475fbe)[_0xb064('0xe')](_0x10a51e);}return null;};}function saveUpdates(_0x54872c){return function(_0x2bd86b){if(_0x2bd86b){return _0x2bd86b[_0xb064('0xf')](_0x54872c)[_0xb064('0x10')](function(_0x3797c){return _0x3797c;});}return null;};}function removeEntity(_0x5770bd){return function(_0x324806){if(_0x324806){return _0x324806[_0xb064('0x11')]()[_0xb064('0x10')](function(){_0x5770bd['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1e2b9c){return function(_0xd19cb4){if(!_0xd19cb4){_0x1e2b9c[_0xb064('0x12')](0x194);}return _0xd19cb4;};}function handleError(_0x39a846,_0xe92104){_0xe92104=_0xe92104||0x1f4;return function(_0x3c5fd0){logger[_0xb064('0x13')](_0x3c5fd0[_0xb064('0x14')]);if(_0x3c5fd0['name']){delete _0x3c5fd0[_0xb064('0x15')];}_0x39a846[_0xb064('0xb')](_0xe92104)[_0xb064('0x16')](_0x3c5fd0);};}exports[_0xb064('0x17')]=function(_0x4e8efd,_0x278c50){var _0x2e3270={},_0x120cd0={},_0x39a9e3={'count':0x0,'rows':[]};var _0xfaa1bf=_[_0xb064('0x18')](db[_0xb064('0x19')][_0xb064('0x1a')],function(_0x1ed50a){return{'name':_0x1ed50a['fieldName'],'type':_0x1ed50a['type'][_0xb064('0x1b')]};});_0x120cd0[_0xb064('0x1c')]=_[_0xb064('0x18')](_0xfaa1bf,'name');_0x120cd0[_0xb064('0x1d')]=_[_0xb064('0x1e')](_0x4e8efd[_0xb064('0x1d')]);_0x120cd0[_0xb064('0x1f')]=_[_0xb064('0x20')](_0x120cd0['model'],_0x120cd0['query']);_0x2e3270[_0xb064('0x21')]=_[_0xb064('0x20')](_0x120cd0[_0xb064('0x1c')],qs[_0xb064('0x22')](_0x4e8efd[_0xb064('0x1d')][_0xb064('0x22')]));_0x2e3270[_0xb064('0x21')]=_0x2e3270[_0xb064('0x21')][_0xb064('0x23')]?_0x2e3270['attributes']:_0x120cd0[_0xb064('0x1c')];if(!_0x4e8efd[_0xb064('0x1d')][_0xb064('0x24')](_0xb064('0x25'))){_0x2e3270['limit']=qs[_0xb064('0x7')](_0x4e8efd[_0xb064('0x1d')][_0xb064('0x7')]);_0x2e3270[_0xb064('0xa')]=qs['offset'](_0x4e8efd[_0xb064('0x1d')][_0xb064('0xa')]);}_0x2e3270[_0xb064('0x26')]=qs[_0xb064('0x27')](_0x4e8efd[_0xb064('0x1d')]['sort']);_0x2e3270[_0xb064('0x28')]=qs[_0xb064('0x1f')](_[_0xb064('0x29')](_0x4e8efd[_0xb064('0x1d')],_0x120cd0[_0xb064('0x1f')]),_0xfaa1bf);if(_0x4e8efd[_0xb064('0x1d')]['filter']){_0x2e3270['where']=_[_0xb064('0x2a')](_0x2e3270[_0xb064('0x28')],{'$or':_[_0xb064('0x18')](_0xfaa1bf,function(_0x420fce){if(_0x420fce[_0xb064('0x2b')]!=='VIRTUAL'){var _0x1f2374={};_0x1f2374[_0x420fce['name']]={'$like':'%'+_0x4e8efd['query'][_0xb064('0x2c')]+'%'};return _0x1f2374;}})});}_0x2e3270=_[_0xb064('0x2a')]({},_0x2e3270,_0x4e8efd[_0xb064('0x2d')]);var _0x534e0f={'where':_0x2e3270['where']};return db[_0xb064('0x19')][_0xb064('0x9')](_0x534e0f)[_0xb064('0x10')](function(_0x42c86b){_0x39a9e3['count']=_0x42c86b;if(_0x4e8efd[_0xb064('0x1d')][_0xb064('0x2e')]){_0x2e3270[_0xb064('0x2f')]=[{'all':!![]}];}return db['Dynamics365Account'][_0xb064('0x30')](_0x2e3270);})['then'](function(_0x1d3ab4){_0x39a9e3[_0xb064('0x31')]=_0x1d3ab4;return _0x39a9e3;})['then'](respondWithFilteredResult(_0x278c50,_0x2e3270))[_0xb064('0x32')](handleError(_0x278c50,null));};exports['show']=function(_0x2f1ee0,_0x1bda58){var _0x330cfb={'raw':![],'where':{'id':_0x2f1ee0[_0xb064('0x33')]['id']}},_0x4de849={};_0x4de849[_0xb064('0x1c')]=_[_0xb064('0x1e')](db[_0xb064('0x19')][_0xb064('0x1a')]);_0x4de849['query']=_['keys'](_0x2f1ee0[_0xb064('0x1d')]);_0x4de849['filters']=_[_0xb064('0x20')](_0x4de849[_0xb064('0x1c')],_0x4de849['query']);_0x330cfb['attributes']=_[_0xb064('0x20')](_0x4de849[_0xb064('0x1c')],qs[_0xb064('0x22')](_0x2f1ee0[_0xb064('0x1d')][_0xb064('0x22')]));_0x330cfb['attributes']=_0x330cfb[_0xb064('0x21')][_0xb064('0x23')]?_0x330cfb['attributes']:_0x4de849['model'];if(_0x2f1ee0['query'][_0xb064('0x2e')]){_0x330cfb[_0xb064('0x2f')]=[{'all':!![]}];}_0x330cfb=_[_0xb064('0x2a')]({},_0x330cfb,_0x2f1ee0[_0xb064('0x2d')]);return db['Dynamics365Account']['find'](_0x330cfb)[_0xb064('0x10')](handleEntityNotFound(_0x1bda58,null))[_0xb064('0x10')](respondWithResult(_0x1bda58,null))[_0xb064('0x32')](handleError(_0x1bda58,null));};exports['create']=function(_0xb02382,_0xcf13a){return db[_0xb064('0x19')][_0xb064('0x34')](_0xb02382['body'],{})[_0xb064('0x10')](respondWithResult(_0xcf13a,0xc9))[_0xb064('0x32')](handleError(_0xcf13a,null));};exports[_0xb064('0xf')]=function(_0x2049c9,_0x5321ae){if(_0x2049c9['body']['id']){delete _0x2049c9[_0xb064('0x35')]['id'];}return db[_0xb064('0x19')][_0xb064('0x36')]({'where':{'id':_0x2049c9['params']['id']}})[_0xb064('0x10')](handleEntityNotFound(_0x5321ae,null))['then'](saveUpdates(_0x2049c9[_0xb064('0x35')],null))[_0xb064('0x10')](respondWithResult(_0x5321ae,null))[_0xb064('0x32')](handleError(_0x5321ae,null));};exports[_0xb064('0x11')]=function(_0x3708b3,_0x1d4acd){return db[_0xb064('0x19')][_0xb064('0x36')]({'where':{'id':_0x3708b3[_0xb064('0x33')]['id']}})[_0xb064('0x10')](handleEntityNotFound(_0x1d4acd,null))[_0xb064('0x10')](removeEntity(_0x1d4acd,null))[_0xb064('0x32')](handleError(_0x1d4acd,null));};exports['getConfigurations']=function(_0x73af3,_0x16a779){var _0x4277a4={};var _0x2d71e0={};var _0x2ca2e1;var _0x2f6b24;return db[_0xb064('0x19')]['findOne']({'where':{'id':_0x73af3[_0xb064('0x33')]['id']}})[_0xb064('0x10')](handleEntityNotFound(_0x16a779,null))[_0xb064('0x10')](function(_0x12d19d){if(_0x12d19d){_0x2ca2e1=_0x12d19d;_0x2d71e0[_0xb064('0x1c')]=_[_0xb064('0x1e')](db[_0xb064('0x37')][_0xb064('0x1a')]);_0x2d71e0[_0xb064('0x1d')]=_[_0xb064('0x1e')](_0x73af3[_0xb064('0x1d')]);_0x2d71e0[_0xb064('0x1f')]=_[_0xb064('0x20')](_0x2d71e0['model'],_0x2d71e0['query']);_0x4277a4[_0xb064('0x21')]=_['intersection'](_0x2d71e0[_0xb064('0x1c')],qs[_0xb064('0x22')](_0x73af3[_0xb064('0x1d')][_0xb064('0x22')]));_0x4277a4[_0xb064('0x21')]=_0x4277a4[_0xb064('0x21')]['length']?_0x4277a4[_0xb064('0x21')]:_0x2d71e0[_0xb064('0x1c')];_0x4277a4['order']=qs[_0xb064('0x27')](_0x73af3[_0xb064('0x1d')][_0xb064('0x27')]);_0x4277a4[_0xb064('0x28')]=qs['filters'](_[_0xb064('0x29')](_0x73af3[_0xb064('0x1d')],_0x2d71e0[_0xb064('0x1f')]));if(_0x73af3[_0xb064('0x1d')][_0xb064('0x2c')]){_0x4277a4[_0xb064('0x28')]=_['merge'](_0x4277a4['where'],{'$or':_['map'](_0x4277a4[_0xb064('0x21')],function(_0x87217a){var _0x47a40b={};_0x47a40b[_0x87217a]={'$like':'%'+_0x73af3['query'][_0xb064('0x2c')]+'%'};return _0x47a40b;})});}_0x4277a4=_['merge']({},_0x4277a4,_0x73af3[_0xb064('0x2d')]);return _0x2ca2e1[_0xb064('0x38')](_0x4277a4);}})[_0xb064('0x10')](function(_0x539f42){if(_0x539f42){_0x2f6b24=_0x539f42[_0xb064('0x23')];if(!_0x73af3[_0xb064('0x1d')][_0xb064('0x24')]('nolimit')){_0x4277a4[_0xb064('0x7')]=qs[_0xb064('0x7')](_0x73af3['query'][_0xb064('0x7')]);_0x4277a4[_0xb064('0xa')]=qs[_0xb064('0xa')](_0x73af3['query'][_0xb064('0xa')]);}return _0x2ca2e1[_0xb064('0x38')](_0x4277a4);}})[_0xb064('0x10')](function(_0xf3c850){if(_0xf3c850){return _0xf3c850?{'count':_0x2f6b24,'rows':_0xf3c850}:null;}})['then'](respondWithResult(_0x16a779,null))[_0xb064('0x32')](handleError(_0x16a779,null));};exports[_0xb064('0x39')]=function(_0x3d42f7,_0x4f7e92){if(_0x3d42f7[_0xb064('0x35')]['id']){delete _0x3d42f7[_0xb064('0x35')]['id'];}return db[_0xb064('0x19')]['findOne']({'where':{'id':_0x3d42f7[_0xb064('0x33')]['id']}})[_0xb064('0x10')](handleEntityNotFound(_0x4f7e92,null))['then'](function(_0x46d26b){if(_0x46d26b){_0x3d42f7['body']['AccountId']=_0x46d26b['id'];_0x3d42f7[_0xb064('0x35')][_0xb064('0x3a')]=integrations['getSubjects'](_0x3d42f7[_0xb064('0x35')][_0xb064('0x3b')],_0x3d42f7['body']['type']);_0x3d42f7[_0xb064('0x35')][_0xb064('0x3c')]=integrations['getDescriptions'](_0x3d42f7[_0xb064('0x35')][_0xb064('0x3b')],_0x3d42f7[_0xb064('0x35')][_0xb064('0x2b')]);return db[_0xb064('0x37')][_0xb064('0x34')](_0x3d42f7[_0xb064('0x35')],{'include':[{'model':db[_0xb064('0x3d')],'as':_0xb064('0x3a')},{'model':db[_0xb064('0x3d')],'as':_0xb064('0x3c')}]});}return null;})[_0xb064('0x10')](respondWithResult(_0x4f7e92,null))[_0xb064('0x32')](handleError(_0x4f7e92,null));};function sanitizeRemoteUri(_0x54c87d){var _0x499644=_0x54c87d[_0xb064('0x3e')](-0x1);if(_0x499644==='/')return _0x54c87d[_0xb064('0x3f')](0x0,_0x54c87d[_0xb064('0x40')](_0x499644));return _0x54c87d;}function getWebApiUrl(_0x292daf){return util[_0xb064('0x41')](_0xb064('0x42'),_0x292daf);}exports[_0xb064('0x43')]=function(_0xebf88d,_0x3fcc28){var _0x2f03a3=_0xebf88d[_0xb064('0x1d')]['ticketType'];var _0x14aa44=_0x2f03a3===_0xb064('0x44')?_0xb064('0x45'):_0xb064('0x46');var _0x265671='';var _0x5c50f9='';var _0x390e24='';var _0x3fc924='';var _0x56f424='';var _0x490990='';var _0x45a4cb='';var _0x572732='';var _0xb10475=['title',_0xb064('0x47'),_0xb064('0x48'),'ownerid',_0xb064('0x49'),_0xb064('0x4a'),_0xb064('0x4b'),_0xb064('0x4c'),_0xb064('0x4d'),_0xb064('0x4e')];var _0xb7ef73=[_0xb064('0x4f'),_0xb064('0x50'),_0xb064('0x51'),_0xb064('0x52'),_0xb064('0x53'),'contactidyominame','contractdetailidname',_0xb064('0x54'),_0xb064('0x55'),_0xb064('0x56'),_0xb064('0x57'),_0xb064('0x58'),'createdon','createdonbehalfbyname',_0xb064('0x59'),_0xb064('0x5a'),_0xb064('0x5b'),_0xb064('0x5c'),_0xb064('0x5d'),_0xb064('0x5e'),_0xb064('0x5f'),_0xb064('0x60'),_0xb064('0x61'),_0xb064('0x62'),'firstresponsebykpiidname',_0xb064('0x63'),'importsequencenumber',_0xb064('0x64'),_0xb064('0x65'),_0xb064('0x66'),_0xb064('0x67'),_0xb064('0x68'),_0xb064('0x69'),_0xb064('0x6a'),_0xb064('0x6b'),_0xb064('0x6c'),_0xb064('0x6d'),_0xb064('0x6e'),_0xb064('0x6f'),_0xb064('0x70'),_0xb064('0x71'),_0xb064('0x72'),'overriddencreatedon','owneridname','owneridtype','owneridyominame','parentcaseidname','primarycontactidname',_0xb064('0x73'),_0xb064('0x74'),_0xb064('0x75'),_0xb064('0x76'),'resolveby',_0xb064('0x77'),_0xb064('0x78'),_0xb064('0x79'),_0xb064('0x7a'),_0xb064('0x7b'),_0xb064('0x7c'),_0xb064('0x7d'),_0xb064('0x7e'),_0xb064('0x7f'),_0xb064('0x80'),_0xb064('0x81'),_0xb064('0x82'),'timezoneruleversionnumber',_0xb064('0x83'),_0xb064('0x84'),_0xb064('0x85'),_0xb064('0x86')];var _0x21a245=_0xb10475[_0xb064('0x87')](_0xb7ef73);return db[_0xb064('0x19')][_0xb064('0x88')]({'where':{'id':_0xebf88d[_0xb064('0x33')]['id']},'attributes':['id','username',_0xb064('0x89'),_0xb064('0x8a'),_0xb064('0x8b'),_0xb064('0x8c'),_0xb064('0x8d'),_0xb064('0x8e')],'include':[{'model':db[_0xb064('0x8f')],'as':_0xb064('0x8f'),'attributes':['id',_0xb064('0x90'),'data7']}]})[_0xb064('0x10')](handleEntityNotFound(_0x3fcc28,null))[_0xb064('0x10')](function(_0x5d5e8d){if(_0x5d5e8d){if(_0x5d5e8d[_0xb064('0x8e')]){_0x5d5e8d[_0xb064('0x91')]=_0x5d5e8d[_0xb064('0x8f')][_0xb064('0x90')];_0x572732=sanitizeRemoteUri(_0x5d5e8d[_0xb064('0x8f')]['data7']);_0x45a4cb=getWebApiUrl(_0x572732);return _0x5d5e8d;}_0x572732=sanitizeRemoteUri(_0x5d5e8d[_0xb064('0x8a')]);_0x45a4cb=getWebApiUrl(_0x572732);var _0x2fd265={'method':_0xb064('0x92'),'uri':_0xb064('0x93')+_0x5d5e8d[_0xb064('0x8b')]+_0xb064('0x94'),'form':{'client_id':_0x5d5e8d['clientId'],'resource':_0x572732,'username':_0x5d5e8d[_0xb064('0x95')],'password':_0x5d5e8d['password'],'grant_type':_0xb064('0x89'),'client_secret':_0x5d5e8d[_0xb064('0x8d')]},'json':!![]};return rp(_0x2fd265);}})[_0xb064('0x10')](function(_0x1bf6f8){_0x490990=_0x1bf6f8['access_token'];var _0x5b25da={'method':_0xb064('0x96'),'uri':encodeURI(_0x45a4cb+_0xb064('0x97')+_0x14aa44+'\x27'),'headers':{'Authorization':_0xb064('0x98')+_0x490990,'If-None-Match':null,'OData-Version':_0xb064('0x99')},'json':!![]};return rp(_0x5b25da);})[_0xb064('0x10')](function(_0x4f9d8c){var _0x1c6718=_0x4f9d8c['value'][0x0];var _0x2a3e37=_0x1c6718[_0xb064('0x9a')];var _0x5a9c66={'method':_0xb064('0x96'),'uri':_0x45a4cb+_0xb064('0x9b')+_0x2a3e37+_0xb064('0x9c'),'headers':{'Authorization':_0xb064('0x98')+_0x490990,'If-None-Match':null,'OData-Version':_0xb064('0x99')},'json':!![]};return rp(_0x5a9c66);})[_0xb064('0x10')](function(_0x343e18){_0x265671=_0x343e18;_0x5c50f9=_0x265671[_0xb064('0x9d')];_0x5c50f9=_[_0xb064('0x9e')](_0x5c50f9,function(_0x2f8795){return!_0x21a245['includes'](_0x2f8795['LogicalName']);});var _0x576184=[];var _0x2293c3=[];_0x5c50f9[_0xb064('0x9f')](function(_0x257cc1){if(_0x257cc1[_0xb064('0xa0')]){var _0x49a01f=_0x257cc1['@odata.type']['substring'](_0x257cc1[_0xb064('0xa0')][_0xb064('0x40')]('.')+0x1);if(_0x49a01f===_0xb064('0xa1')){_0x576184[_0xb064('0xa2')](getSelectList(_0x45a4cb,_0x2f03a3,_0x2293c3,_0x265671[_0xb064('0x9a')],_0x257cc1[_0xb064('0x9a')],_0x490990));}}});return Promise[_0xb064('0xa3')](_0x576184);})['then'](function(_0x3ba7d6){_0x390e24=_0x3ba7d6[0x0];var _0x52a57b=[];var _0x2c4cc2=[];_0x5c50f9[_0xb064('0x9f')](function(_0x2d6028){if(!_[_0xb064('0xa4')](_0x2d6028[_0xb064('0xa0')])){var _0x41ff96=_0x2d6028['@odata.type']['substring'](_0x2d6028[_0xb064('0xa0')][_0xb064('0x40')]('.')+0x1);if(_0x41ff96===_0xb064('0xa5')){_0x52a57b[_0xb064('0xa2')](getBooleanList(_0x45a4cb,_0x2f03a3,_0x2c4cc2,_0x265671[_0xb064('0x9a')],_0x2d6028[_0xb064('0x9a')],_0x490990));}}});return Promise['all'](_0x52a57b);})['then'](function(_0x3603d1){_0x3fc924=_0x3603d1[0x0];var _0x464513=[];var _0x37a668=[];_0x5c50f9[_0xb064('0x9f')](function(_0x107b22){if(_0x107b22['@odata.type']){var _0x119c57=_0x107b22[_0xb064('0xa0')][_0xb064('0x3f')](_0x107b22[_0xb064('0xa0')]['lastIndexOf']('.')+0x1);if(_0x119c57===_0xb064('0xa6')||_0x119c57===_0xb064('0xa7')||_0x119c57===_0xb064('0xa8')||_0x119c57===_0xb064('0xa9')||_0x119c57==='MemoAttributeMetadata'||_0x119c57===_0xb064('0xaa')||_0x119c57===_0xb064('0xab')||_0x119c57===_0xb064('0xac')||_0x119c57===_0xb064('0xad')||_0x119c57==='DecimalAttributeMetadata'){_0x464513[_0xb064('0xa2')](getInputList(_0x45a4cb,_0x2f03a3,_0x119c57,_0x37a668,_0x265671['MetadataId'],_0x107b22[_0xb064('0x9a')],_0x490990));}}});return Promise['all'](_0x464513);})['then'](function(_0x2efcec){_0x56f424=_0x2efcec[0x0];var _0x41a5cb=_0x390e24['concat'](_0x3fc924)[_0xb064('0x87')](_0x56f424);var _0x23e97a={'count':_0x41a5cb[_0xb064('0x23')],'rows':_0x41a5cb};return _0x23e97a;})['then'](respondWithResult(_0x3fcc28,null))['catch'](function(_0x41f5c2){var _0xfb0918=_0xebf88d[_0xb064('0x1d')][_0xb064('0xae')]?0x1f4:_0x41f5c2[_0xb064('0xaf')]||0x1f4;logger[_0xb064('0x13')](_0x41f5c2[_0xb064('0x14')]);delete _0x41f5c2[_0xb064('0x15')];if(_0xfb0918===0x191){_0xfb0918=0x190;}_0x3fcc28[_0xb064('0xb')](_0xfb0918)[_0xb064('0x16')](_0xebf88d['query'][_0xb064('0xae')]?{'message':_0xb064('0xb0'),'statusCode':_0x41f5c2[_0xb064('0xaf')]}:_0x41f5c2);});};function getSelectList(_0x2fe45a,_0x31d3e8,_0x1dcd57,_0x26f220,_0x1b514b,_0x5f4bd0){var _0x4de3f5={'method':_0xb064('0x96'),'uri':_0x2fe45a+_0xb064('0x9b')+_0x26f220+_0xb064('0xb1')+_0x1b514b+')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?'+_0xb064('0xb2'),'headers':{'Authorization':_0xb064('0x98')+_0x5f4bd0,'If-None-Match':null,'OData-Version':_0xb064('0x99')},'json':!![]};return rp(_0x4de3f5)[_0xb064('0x10')](function(_0x5695f6){var _0x46bda4=[];var _0x33a355=_0x5695f6[_0xb064('0xb3')][_0xb064('0xb4')];_0x33a355['forEach'](function(_0x335062){_0x46bda4['push']({'name':_0x335062[_0xb064('0xb5')][_0xb064('0xb6')][_0xb064('0xb5')],'value':String(_0x335062[_0xb064('0xb7')])});});var _0x509c79={'id':_0x31d3e8+'_'+_0x5695f6[_0xb064('0xb8')],'name':_0x5695f6[_0xb064('0xb9')][_0xb064('0xb6')][_0xb064('0xb5')],'custom':![],'options':_0x46bda4};_0x1dcd57[_0xb064('0xa2')](_0x509c79);return _0x1dcd57;});}function getBooleanList(_0x3f5874,_0x585108,_0x51eb10,_0x436c31,_0x34dfb6,_0x281d10){var _0x15373e={'method':_0xb064('0x96'),'uri':_0x3f5874+'EntityDefinitions('+_0x436c31+')/Attributes('+_0x34dfb6+_0xb064('0xba'),'headers':{'Authorization':_0xb064('0x98')+_0x281d10,'If-None-Match':null,'OData-Version':_0xb064('0x99')},'json':!![]};return rp(_0x15373e)['then'](function(_0x1ae37f){var _0x442a91=[];_0x442a91[_0xb064('0xa2')]({'name':_0x1ae37f[_0xb064('0xb3')][_0xb064('0xbb')][_0xb064('0xb5')][_0xb064('0xb6')][_0xb064('0xb5')],'value':'true'},{'name':_0x1ae37f[_0xb064('0xb3')]['FalseOption'][_0xb064('0xb5')]['UserLocalizedLabel'][_0xb064('0xb5')],'value':_0xb064('0xbc')});var _0x430b25={'id':_0x585108+'_'+_0x1ae37f[_0xb064('0xb8')],'name':_0x1ae37f[_0xb064('0xb9')]['UserLocalizedLabel'][_0xb064('0xb5')],'custom':![],'options':_0x442a91};_0x51eb10[_0xb064('0xa2')](_0x430b25);return _0x51eb10;});}function getInputList(_0x423c98,_0x5ee819,_0x37dadd,_0x5d276a,_0x15df74,_0x48ff8d,_0x4a5ef1){var _0x2d4fdd={'method':'GET','uri':_0x423c98+'EntityDefinitions('+_0x15df74+_0xb064('0xb1')+_0x48ff8d+_0xb064('0xbd')+_0x37dadd+_0xb064('0xbe'),'headers':{'Authorization':_0xb064('0x98')+_0x4a5ef1,'If-None-Match':null,'OData-Version':_0xb064('0x99')},'json':!![]};return rp(_0x2d4fdd)[_0xb064('0x10')](function(_0x4ee2b1){var _0x53e3d1={'id':_0x5ee819+'_'+_0x4ee2b1[_0xb064('0xb8')],'name':_0x4ee2b1[_0xb064('0xb9')]['UserLocalizedLabel']?_0x4ee2b1['DisplayName']['UserLocalizedLabel'][_0xb064('0xb5')]:_0x4ee2b1[_0xb064('0xb8')],'custom':![],'options':[]};_0x5d276a['push'](_0x53e3d1);return _0x5d276a;});}
\ No newline at end of file
index 693b507..6916c34 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb7e7=['int_dynamics365_accounts','lodash','../../config/logger','moment','request-promise','rimraf','../../config/environment','./intDynamics365Account.attributes','define'];(function(_0x14756e,_0x51c2a9){var _0x10e004=function(_0x1113ee){while(--_0x1113ee){_0x14756e['push'](_0x14756e['shift']());}};_0x10e004(++_0x51c2a9);}(_0xb7e7,0x121));var _0x7b7e=function(_0xa6cc5c,_0x239c99){_0xa6cc5c=_0xa6cc5c-0x0;var _0x44803d=_0xb7e7[_0xa6cc5c];return _0x44803d;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var logger=require(_0x7b7e('0x1'))('api');var moment=require(_0x7b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var attributes=require(_0x7b7e('0x6'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x333fa4,_0x372bde){return _0x333fa4[_0x7b7e('0x7')]('Dynamics365Account',attributes,{'tableName':_0x7b7e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account','int_dynamics365_accounts','lodash','util'];(function(_0x3138c1,_0x2020ed){var _0x4d0fce=function(_0x39d429){while(--_0x39d429){_0x3138c1['push'](_0x3138c1['shift']());}};_0x4d0fce(++_0x2020ed);}(_0xe706,0xa3));var _0x6e70=function(_0x358fb5,_0x4407b8){_0x358fb5=_0x358fb5-0x0;var _0x4abfeb=_0xe706[_0x358fb5];return _0x4abfeb;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));var integrations=require(_0x6e70('0xa'));module[_0x6e70('0xb')]=function(_0x4381d1,_0x36357b){return _0x4381d1[_0x6e70('0xc')](_0x6e70('0xd'),attributes,{'tableName':_0x6e70('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index c4f1fac..1723ff2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2dbd=['Dynamics365Account','findAll','options','where','attributes','limit','map','include','model','debug','ShowDynamics365Account','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetDynamics365Account'];(function(_0xd0a847,_0x72562b){var _0x2536ec=function(_0x20e4db){while(--_0x20e4db){_0xd0a847['push'](_0xd0a847['shift']());}};_0x2536ec(++_0x72562b);}(_0x2dbd,0xd1));var _0xd2db=function(_0x1fae65,_0x43391d){_0x1fae65=_0x1fae65-0x0;var _0x56805f=_0x2dbd[_0x1fae65];return _0x56805f;};'use strict';var _=require(_0xd2db('0x0'));var util=require('util');var moment=require(_0xd2db('0x1'));var BPromise=require(_0xd2db('0x2'));var rs=require(_0xd2db('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd2db('0x4'))['db'];var utils=require(_0xd2db('0x5'));var logger=require(_0xd2db('0x6'))(_0xd2db('0x7'));var config=require('../../config/environment');var jayson=require(_0xd2db('0x8'));var client=jayson[_0xd2db('0x9')][_0xd2db('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x41fac8,_0x45dd97,_0x1cae5e){return new BPromise(function(_0x171cf1,_0x5ae9b2){return client['request'](_0x41fac8,_0x1cae5e)[_0xd2db('0xb')](function(_0x19094b){logger[_0xd2db('0xc')](_0xd2db('0xd'),_0x45dd97,_0xd2db('0xe'));logger['debug'](_0xd2db('0xf'),_0x45dd97,_0xd2db('0xe'),JSON[_0xd2db('0x10')](_0x19094b));if(_0x19094b[_0xd2db('0x11')]){if(_0x19094b[_0xd2db('0x11')][_0xd2db('0x12')]===0x1f4){logger[_0xd2db('0x11')]('Dynamics365Account,\x20%s,\x20%s',_0x45dd97,_0x19094b['error']['message']);return _0x5ae9b2(_0x19094b[_0xd2db('0x11')][_0xd2db('0x13')]);}logger[_0xd2db('0x11')](_0xd2db('0xd'),_0x45dd97,_0x19094b[_0xd2db('0x11')][_0xd2db('0x13')]);return _0x171cf1(_0x19094b[_0xd2db('0x11')][_0xd2db('0x13')]);}else{logger['info'](_0xd2db('0xd'),_0x45dd97,'request\x20sent');_0x171cf1(_0x19094b['result'][_0xd2db('0x13')]);}})[_0xd2db('0x14')](function(_0x29fb1f){logger[_0xd2db('0x11')](_0xd2db('0xd'),_0x45dd97,_0x29fb1f);_0x5ae9b2(_0x29fb1f);});});}exports[_0xd2db('0x15')]=function(_0x4a2a30){var _0x415484=this;return new Promise(function(_0x43a574,_0x352ab5){return db[_0xd2db('0x16')][_0xd2db('0x17')]({'raw':_0x4a2a30[_0xd2db('0x18')]?_0x4a2a30[_0xd2db('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x4a2a30['options']?_0x4a2a30[_0xd2db('0x18')][_0xd2db('0x19')]||null:null,'attributes':_0x4a2a30[_0xd2db('0x18')]?_0x4a2a30[_0xd2db('0x18')][_0xd2db('0x1a')]||null:null,'limit':_0x4a2a30[_0xd2db('0x18')]?_0x4a2a30[_0xd2db('0x18')][_0xd2db('0x1b')]||null:null,'include':_0x4a2a30[_0xd2db('0x18')]?_0x4a2a30['options']['include']?_[_0xd2db('0x1c')](_0x4a2a30[_0xd2db('0x18')][_0xd2db('0x1d')],function(_0x33c9ec){return{'model':db[_0x33c9ec[_0xd2db('0x1e')]],'as':_0x33c9ec['as'],'attributes':_0x33c9ec['attributes'],'include':_0x33c9ec[_0xd2db('0x1d')]?_[_0xd2db('0x1c')](_0x33c9ec['include'],function(_0x2cd5ea){return{'model':db[_0x2cd5ea[_0xd2db('0x1e')]],'as':_0x2cd5ea['as'],'attributes':_0x2cd5ea['attributes'],'include':_0x2cd5ea[_0xd2db('0x1d')]?_[_0xd2db('0x1c')](_0x2cd5ea[_0xd2db('0x1d')],function(_0x5ebfe8){return{'model':db[_0x5ebfe8[_0xd2db('0x1e')]],'as':_0x5ebfe8['as'],'attributes':_0x5ebfe8[_0xd2db('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xd2db('0xb')](function(_0x502cdc){logger['info']('GetDynamics365Account',_0x4a2a30);logger[_0xd2db('0x1f')](_0xd2db('0x15'),_0x4a2a30,JSON[_0xd2db('0x10')](_0x502cdc));_0x43a574(_0x502cdc);})[_0xd2db('0x14')](function(_0x485c73){logger[_0xd2db('0x11')](_0xd2db('0x15'),_0x485c73['message'],_0x4a2a30);_0x352ab5(_0x415484[_0xd2db('0x11')](0x1f4,_0x485c73[_0xd2db('0x13')]));});});};exports[_0xd2db('0x20')]=function(_0x4d2bc4){var _0x1f0bcc=this;return new Promise(function(_0x377d7e,_0x317f13){return db[_0xd2db('0x16')]['find']({'raw':_0x4d2bc4[_0xd2db('0x18')]?_0x4d2bc4[_0xd2db('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x4d2bc4[_0xd2db('0x18')]?_0x4d2bc4[_0xd2db('0x18')][_0xd2db('0x19')]||null:null,'attributes':_0x4d2bc4['options']?_0x4d2bc4[_0xd2db('0x18')][_0xd2db('0x1a')]||null:null,'include':_0x4d2bc4['options']?_0x4d2bc4['options'][_0xd2db('0x1d')]?_[_0xd2db('0x1c')](_0x4d2bc4[_0xd2db('0x18')]['include'],function(_0x4f54cf){return{'model':db[_0x4f54cf[_0xd2db('0x1e')]],'as':_0x4f54cf['as'],'attributes':_0x4f54cf['attributes'],'include':_0x4f54cf['include']?_['map'](_0x4f54cf[_0xd2db('0x1d')],function(_0x1f9317){return{'model':db[_0x1f9317[_0xd2db('0x1e')]],'as':_0x1f9317['as'],'attributes':_0x1f9317[_0xd2db('0x1a')],'include':_0x1f9317[_0xd2db('0x1d')]?_[_0xd2db('0x1c')](_0x1f9317[_0xd2db('0x1d')],function(_0x1d6a57){return{'model':db[_0x1d6a57[_0xd2db('0x1e')]],'as':_0x1d6a57['as'],'attributes':_0x1d6a57[_0xd2db('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x64946a){logger['info'](_0xd2db('0x20'),_0x4d2bc4);logger['debug'](_0xd2db('0x20'),_0x4d2bc4,JSON[_0xd2db('0x10')](_0x64946a));_0x377d7e(_0x64946a);})[_0xd2db('0x14')](function(_0xdd0cc3){logger['error'](_0xd2db('0x20'),_0xdd0cc3[_0xd2db('0x13')],_0x4d2bc4);_0x317f13(_0x1f0bcc[_0xd2db('0x11')](0x1f4,_0xdd0cc3[_0xd2db('0x13')]));});});};
\ No newline at end of file
+var _0x3558=['lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','request','then','info','Dynamics365Account,\x20%s,\x20%s','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetDynamics365Account','options','where','map','attributes','include','model','ShowDynamics365Account','Dynamics365Account','find','raw'];(function(_0x22cd62,_0x3f322d){var _0x5e8bf3=function(_0x19319c){while(--_0x19319c){_0x22cd62['push'](_0x22cd62['shift']());}};_0x5e8bf3(++_0x3f322d);}(_0x3558,0xc6));var _0x8355=function(_0xa3463d,_0x32f8da){_0xa3463d=_0xa3463d-0x0;var _0x50fd67=_0x3558[_0xa3463d];return _0x50fd67;};'use strict';var _=require(_0x8355('0x0'));var util=require(_0x8355('0x1'));var moment=require('moment');var BPromise=require(_0x8355('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8355('0x3'));var db=require(_0x8355('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x8355('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x8355('0x6'));var client=jayson[_0x8355('0x7')][_0x8355('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x53a299,_0x12779c,_0x31c7d5){return new BPromise(function(_0x5c1729,_0x33b9da){return client[_0x8355('0x9')](_0x53a299,_0x31c7d5)[_0x8355('0xa')](function(_0x10661b){logger[_0x8355('0xb')](_0x8355('0xc'),_0x12779c,'request\x20sent');logger[_0x8355('0xd')](_0x8355('0xe'),_0x12779c,_0x8355('0xf'),JSON[_0x8355('0x10')](_0x10661b));if(_0x10661b[_0x8355('0x11')]){if(_0x10661b[_0x8355('0x11')][_0x8355('0x12')]===0x1f4){logger[_0x8355('0x11')](_0x8355('0xc'),_0x12779c,_0x10661b[_0x8355('0x11')][_0x8355('0x13')]);return _0x33b9da(_0x10661b[_0x8355('0x11')][_0x8355('0x13')]);}logger['error'](_0x8355('0xc'),_0x12779c,_0x10661b[_0x8355('0x11')][_0x8355('0x13')]);return _0x5c1729(_0x10661b[_0x8355('0x11')][_0x8355('0x13')]);}else{logger[_0x8355('0xb')](_0x8355('0xc'),_0x12779c,'request\x20sent');_0x5c1729(_0x10661b[_0x8355('0x14')]['message']);}})[_0x8355('0x15')](function(_0x1cf1ba){logger[_0x8355('0x11')](_0x8355('0xc'),_0x12779c,_0x1cf1ba);_0x33b9da(_0x1cf1ba);});});}exports[_0x8355('0x16')]=function(_0x344cb3){var _0x4643e5=this;return new Promise(function(_0x281792,_0x5bcd80){return db['Dynamics365Account']['findAll']({'raw':_0x344cb3[_0x8355('0x17')]?_0x344cb3[_0x8355('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x344cb3['options']?_0x344cb3[_0x8355('0x17')][_0x8355('0x18')]||null:null,'attributes':_0x344cb3['options']?_0x344cb3[_0x8355('0x17')]['attributes']||null:null,'limit':_0x344cb3[_0x8355('0x17')]?_0x344cb3[_0x8355('0x17')]['limit']||null:null,'include':_0x344cb3[_0x8355('0x17')]?_0x344cb3[_0x8355('0x17')]['include']?_[_0x8355('0x19')](_0x344cb3[_0x8355('0x17')]['include'],function(_0x48ad9a){return{'model':db[_0x48ad9a['model']],'as':_0x48ad9a['as'],'attributes':_0x48ad9a[_0x8355('0x1a')],'include':_0x48ad9a[_0x8355('0x1b')]?_[_0x8355('0x19')](_0x48ad9a[_0x8355('0x1b')],function(_0xc41c71){return{'model':db[_0xc41c71[_0x8355('0x1c')]],'as':_0xc41c71['as'],'attributes':_0xc41c71[_0x8355('0x1a')],'include':_0xc41c71[_0x8355('0x1b')]?_[_0x8355('0x19')](_0xc41c71['include'],function(_0x4b98a5){return{'model':db[_0x4b98a5[_0x8355('0x1c')]],'as':_0x4b98a5['as'],'attributes':_0x4b98a5[_0x8355('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2dde9d){logger['info'](_0x8355('0x16'),_0x344cb3);logger['debug'](_0x8355('0x16'),_0x344cb3,JSON[_0x8355('0x10')](_0x2dde9d));_0x281792(_0x2dde9d);})['catch'](function(_0x22aeb4){logger['error'](_0x8355('0x16'),_0x22aeb4[_0x8355('0x13')],_0x344cb3);_0x5bcd80(_0x4643e5[_0x8355('0x11')](0x1f4,_0x22aeb4[_0x8355('0x13')]));});});};exports[_0x8355('0x1d')]=function(_0x33e7f9){var _0x5d2447=this;return new Promise(function(_0x21659d,_0x358547){return db[_0x8355('0x1e')][_0x8355('0x1f')]({'raw':_0x33e7f9[_0x8355('0x17')]?_0x33e7f9['options'][_0x8355('0x20')]===undefined?!![]:![]:!![],'where':_0x33e7f9[_0x8355('0x17')]?_0x33e7f9[_0x8355('0x17')][_0x8355('0x18')]||null:null,'attributes':_0x33e7f9[_0x8355('0x17')]?_0x33e7f9[_0x8355('0x17')][_0x8355('0x1a')]||null:null,'include':_0x33e7f9[_0x8355('0x17')]?_0x33e7f9[_0x8355('0x17')]['include']?_[_0x8355('0x19')](_0x33e7f9[_0x8355('0x17')][_0x8355('0x1b')],function(_0x32e013){return{'model':db[_0x32e013[_0x8355('0x1c')]],'as':_0x32e013['as'],'attributes':_0x32e013['attributes'],'include':_0x32e013[_0x8355('0x1b')]?_[_0x8355('0x19')](_0x32e013[_0x8355('0x1b')],function(_0x481b46){return{'model':db[_0x481b46['model']],'as':_0x481b46['as'],'attributes':_0x481b46['attributes'],'include':_0x481b46[_0x8355('0x1b')]?_[_0x8355('0x19')](_0x481b46[_0x8355('0x1b')],function(_0x52fe61){return{'model':db[_0x52fe61['model']],'as':_0x52fe61['as'],'attributes':_0x52fe61[_0x8355('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x8355('0xa')](function(_0x52f749){logger[_0x8355('0xb')](_0x8355('0x1d'),_0x33e7f9);logger[_0x8355('0xd')](_0x8355('0x1d'),_0x33e7f9,JSON['stringify'](_0x52f749));_0x21659d(_0x52f749);})[_0x8355('0x15')](function(_0x1a0e8a){logger[_0x8355('0x11')](_0x8355('0x1d'),_0x1a0e8a['message'],_0x33e7f9);_0x358547(_0x5d2447[_0x8355('0x11')](0x1f4,_0x1a0e8a[_0x8355('0x13')]));});});};
\ No newline at end of file
index 72736cb..9bfce6f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa35e=['/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','create','put','update','delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','get','isAuthenticated','index'];(function(_0x1833dc,_0x121d9d){var _0x77da96=function(_0x5edeb1){while(--_0x5edeb1){_0x1833dc['push'](_0x1833dc['shift']());}};_0x77da96(++_0x121d9d);}(_0xa35e,0x111));var _0xea35=function(_0x105bde,_0xb333d2){_0x105bde=_0x105bde-0x0;var _0x24dcab=_0xa35e[_0x105bde];return _0x24dcab;};'use strict';var multer=require(_0xea35('0x0'));var util=require('util');var path=require(_0xea35('0x1'));var timeout=require(_0xea35('0x2'));var express=require(_0xea35('0x3'));var router=express[_0xea35('0x4')]();var fs_extra=require(_0xea35('0x5'));var auth=require(_0xea35('0x6'));var interaction=require(_0xea35('0x7'));var config=require(_0xea35('0x8'));var controller=require(_0xea35('0x9'));router[_0xea35('0xa')]('/',auth[_0xea35('0xb')](),controller[_0xea35('0xc')]);router[_0xea35('0xa')](_0xea35('0xd'),auth['isAuthenticated'](),controller[_0xea35('0xe')]);router[_0xea35('0xa')](_0xea35('0xf'),auth['isAuthenticated'](),controller[_0xea35('0x10')]);router[_0xea35('0xa')](_0xea35('0x11'),auth['isAuthenticated'](),controller[_0xea35('0x12')]);router[_0xea35('0xa')](_0xea35('0x13'),auth[_0xea35('0xb')](),controller[_0xea35('0x14')]);router['post']('/',auth[_0xea35('0xb')](),controller[_0xea35('0x15')]);router[_0xea35('0x16')]('/:id',auth['isAuthenticated'](),controller[_0xea35('0x17')]);router[_0xea35('0x18')](_0xea35('0xd'),auth[_0xea35('0xb')](),controller['destroy']);module[_0xea35('0x19')]=router;
\ No newline at end of file
+var _0xc759=['isAuthenticated','/:id','/:id/fields','/:id/subjects','/:id/descriptions','getDescriptions','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','get'];(function(_0xde91d9,_0x15fe0b){var _0x55a65e=function(_0x1456a3){while(--_0x1456a3){_0xde91d9['push'](_0xde91d9['shift']());}};_0x55a65e(++_0x15fe0b);}(_0xc759,0xa0));var _0x9c75=function(_0x3bf696,_0x45040e){_0x3bf696=_0x3bf696-0x0;var _0x50a06e=_0xc759[_0x3bf696];return _0x50a06e;};'use strict';var multer=require('multer');var util=require(_0x9c75('0x0'));var path=require(_0x9c75('0x1'));var timeout=require(_0x9c75('0x2'));var express=require(_0x9c75('0x3'));var router=express['Router']();var fs_extra=require(_0x9c75('0x4'));var auth=require(_0x9c75('0x5'));var interaction=require(_0x9c75('0x6'));var config=require('../../config/environment');var controller=require('./intDynamics365Configuration.controller');router[_0x9c75('0x7')]('/',auth[_0x9c75('0x8')](),controller['index']);router[_0x9c75('0x7')](_0x9c75('0x9'),auth[_0x9c75('0x8')](),controller['show']);router[_0x9c75('0x7')](_0x9c75('0xa'),auth[_0x9c75('0x8')](),controller['getFields']);router[_0x9c75('0x7')](_0x9c75('0xb'),auth[_0x9c75('0x8')](),controller['getSubjects']);router[_0x9c75('0x7')](_0x9c75('0xc'),auth[_0x9c75('0x8')](),controller[_0x9c75('0xd')]);router[_0x9c75('0xe')]('/',auth[_0x9c75('0x8')](),controller[_0x9c75('0xf')]);router[_0x9c75('0x10')](_0x9c75('0x9'),auth['isAuthenticated'](),controller[_0x9c75('0x11')]);router[_0x9c75('0x12')](_0x9c75('0x9'),auth['isAuthenticated'](),controller[_0x9c75('0x13')]);module[_0x9c75('0x14')]=router;
\ No newline at end of file
index a461553..abb2814 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x12f6=['phonecall','nothing','contact','sequelize','STRING','incident'];(function(_0x3d0c0a,_0x569519){var _0x338e0e=function(_0x50f9aa){while(--_0x50f9aa){_0x3d0c0a['push'](_0x3d0c0a['shift']());}};_0x338e0e(++_0x569519);}(_0x12f6,0x159));var _0x612f=function(_0x25b068,_0xb6ac60){_0x25b068=_0x25b068-0x0;var _0xb9f40f=_0x12f6[_0x25b068];return _0xb9f40f;};'use strict';var Sequelize=require(_0x612f('0x0'));module['exports']={'name':{'type':Sequelize[_0x612f('0x1')]},'description':{'type':Sequelize[_0x612f('0x1')]},'ticketType':{'type':Sequelize['ENUM'](_0x612f('0x2'),_0x612f('0x3')),'defaultValue':'incident'},'moduleCreate':{'type':Sequelize['ENUM']('contact',_0x612f('0x4')),'defaultValue':_0x612f('0x5'),'allowNull':![]},'additionalSearchContact':{'type':Sequelize['STRING'],'allowNull':!![]}};
\ No newline at end of file
+var _0xaa6b=['ENUM','incident','phonecall','contact','nothing','sequelize','exports','STRING'];(function(_0x597b14,_0x4eadc8){var _0x32dd31=function(_0x388ba3){while(--_0x388ba3){_0x597b14['push'](_0x597b14['shift']());}};_0x32dd31(++_0x4eadc8);}(_0xaa6b,0x12d));var _0xbaa6=function(_0x4308b9,_0xe07b97){_0x4308b9=_0x4308b9-0x0;var _0x455976=_0xaa6b[_0x4308b9];return _0x455976;};'use strict';var Sequelize=require(_0xbaa6('0x0'));module[_0xbaa6('0x1')]={'name':{'type':Sequelize[_0xbaa6('0x2')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0xbaa6('0x3')](_0xbaa6('0x4'),_0xbaa6('0x5')),'defaultValue':_0xbaa6('0x4')},'moduleCreate':{'type':Sequelize[_0xbaa6('0x3')](_0xbaa6('0x6'),_0xbaa6('0x7')),'defaultValue':_0xbaa6('0x6'),'allowNull':![]},'additionalSearchContact':{'type':Sequelize[_0xbaa6('0x2')],'allowNull':!![]}};
\ No newline at end of file
index a1c9f37..9fa7abf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x26ae=['body','params','findOne','Dynamics365Field','getFields','hasOwnProperty','getSubjects','getDescriptions','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','Content-Range','json','apply','save','update','then','destroy','name','send','index','map','Dynamics365Configuration','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','rawAttributes','length','find'];(function(_0x2a6809,_0x44edde){var _0x11c371=function(_0x1a4888){while(--_0x1a4888){_0x2a6809['push'](_0x2a6809['shift']());}};_0x11c371(++_0x44edde);}(_0x26ae,0xa2));var _0xe26a=function(_0x4532fb,_0x2dc398){_0x4532fb=_0x4532fb-0x0;var _0x46ee28=_0x26ae[_0x4532fb];return _0x46ee28;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe26a('0x0'));var jsonpatch=require(_0xe26a('0x1'));var rp=require('request-promise');var moment=require(_0xe26a('0x2'));var BPromise=require(_0xe26a('0x3'));var Mustache=require(_0xe26a('0x4'));var util=require(_0xe26a('0x5'));var path=require(_0xe26a('0x6'));var sox=require(_0xe26a('0x7'));var csv=require(_0xe26a('0x8'));var ejs=require(_0xe26a('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xe26a('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xe26a('0xb'));var Papa=require(_0xe26a('0xc'));var Redis=require(_0xe26a('0xd'));var authService=require(_0xe26a('0xe'));var qs=require(_0xe26a('0xf'));var as=require(_0xe26a('0x10'));var hardwareService=require(_0xe26a('0x11'));var logger=require(_0xe26a('0x12'))(_0xe26a('0x13'));var utils=require(_0xe26a('0x14'));var config=require(_0xe26a('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xe26a('0x16'))['db'];function respondWithStatusCode(_0x1bfa06,_0x3d2a48){_0x3d2a48=_0x3d2a48||0xcc;return function(_0x505e37){if(_0x505e37){return _0x1bfa06[_0xe26a('0x17')](_0x3d2a48);}return _0x1bfa06[_0xe26a('0x18')](_0x3d2a48)[_0xe26a('0x19')]();};}function respondWithResult(_0x2042ae,_0x460a33){_0x460a33=_0x460a33||0xc8;return function(_0x519722){if(_0x519722){return _0x2042ae[_0xe26a('0x18')](_0x460a33)['json'](_0x519722);}};}function respondWithFilteredResult(_0x4c05dc,_0xa3f8cb){return function(_0x6f8cc0){if(_0x6f8cc0){var _0x10f2b2=typeof _0xa3f8cb[_0xe26a('0x1a')]===_0xe26a('0x1b')&&typeof _0xa3f8cb['limit']===_0xe26a('0x1b');var _0x56f7a2=_0x6f8cc0[_0xe26a('0x1c')];var _0x5d0b37=_0x10f2b2?0x0:_0xa3f8cb['offset'];var _0x5c8fb1=_0x10f2b2?_0x6f8cc0['count']:_0xa3f8cb[_0xe26a('0x1a')]+_0xa3f8cb[_0xe26a('0x1d')];var _0x26cb75;if(_0x5c8fb1>=_0x56f7a2){_0x5c8fb1=_0x56f7a2;_0x26cb75=0xc8;}else{_0x26cb75=0xce;}_0x4c05dc[_0xe26a('0x18')](_0x26cb75);return _0x4c05dc['set'](_0xe26a('0x1e'),_0x5d0b37+'-'+_0x5c8fb1+'/'+_0x56f7a2)[_0xe26a('0x1f')](_0x6f8cc0);}return null;};}function patchUpdates(_0x1ecde5){return function(_0x1986f0){try{jsonpatch[_0xe26a('0x20')](_0x1986f0,_0x1ecde5,!![]);}catch(_0x156961){return BPromise['reject'](_0x156961);}return _0x1986f0[_0xe26a('0x21')]();};}function saveUpdates(_0x317fb7,_0x5e6830){return function(_0x5dca56){if(_0x5dca56){return _0x5dca56[_0xe26a('0x22')](_0x317fb7)[_0xe26a('0x23')](function(_0xc570a8){return _0xc570a8;});}return null;};}function removeEntity(_0x1b1d40,_0xa4fc5){return function(_0x33445c){if(_0x33445c){return _0x33445c[_0xe26a('0x24')]()[_0xe26a('0x23')](function(){_0x1b1d40[_0xe26a('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1575f2,_0x12a635){return function(_0x6be829){if(!_0x6be829){_0x1575f2['sendStatus'](0x194);}return _0x6be829;};}function handleError(_0x579867,_0x45a086){_0x45a086=_0x45a086||0x1f4;return function(_0xa227e3){logger['error'](_0xa227e3['stack']);if(_0xa227e3['name']){delete _0xa227e3[_0xe26a('0x25')];}_0x579867['status'](_0x45a086)[_0xe26a('0x26')](_0xa227e3);};}exports[_0xe26a('0x27')]=function(_0x66cbe8,_0x22eb88){var _0x270fcf={},_0x1191b6={},_0x3f8277={'count':0x0,'rows':[]};var _0x4ee74a=_[_0xe26a('0x28')](db[_0xe26a('0x29')]['rawAttributes'],function(_0x3d5d52){return{'name':_0x3d5d52[_0xe26a('0x2a')],'type':_0x3d5d52[_0xe26a('0x2b')][_0xe26a('0x2c')]};});_0x1191b6[_0xe26a('0x2d')]=_[_0xe26a('0x28')](_0x4ee74a,_0xe26a('0x25'));_0x1191b6[_0xe26a('0x2e')]=_[_0xe26a('0x2f')](_0x66cbe8['query']);_0x1191b6[_0xe26a('0x30')]=_[_0xe26a('0x31')](_0x1191b6['model'],_0x1191b6['query']);_0x270fcf['attributes']=_[_0xe26a('0x31')](_0x1191b6['model'],qs[_0xe26a('0x32')](_0x66cbe8[_0xe26a('0x2e')][_0xe26a('0x32')]));_0x270fcf[_0xe26a('0x33')]=_0x270fcf[_0xe26a('0x33')]['length']?_0x270fcf[_0xe26a('0x33')]:_0x1191b6[_0xe26a('0x2d')];if(!_0x66cbe8[_0xe26a('0x2e')]['hasOwnProperty'](_0xe26a('0x34'))){_0x270fcf[_0xe26a('0x1d')]=qs[_0xe26a('0x1d')](_0x66cbe8[_0xe26a('0x2e')][_0xe26a('0x1d')]);_0x270fcf[_0xe26a('0x1a')]=qs[_0xe26a('0x1a')](_0x66cbe8[_0xe26a('0x2e')][_0xe26a('0x1a')]);}_0x270fcf[_0xe26a('0x35')]=qs[_0xe26a('0x36')](_0x66cbe8['query'][_0xe26a('0x36')]);_0x270fcf[_0xe26a('0x37')]=qs[_0xe26a('0x30')](_[_0xe26a('0x38')](_0x66cbe8[_0xe26a('0x2e')],_0x1191b6[_0xe26a('0x30')]),_0x4ee74a);if(_0x66cbe8['query'][_0xe26a('0x39')]){_0x270fcf['where']=_[_0xe26a('0x3a')](_0x270fcf[_0xe26a('0x37')],{'$or':_['map'](_0x4ee74a,function(_0x210726){if(_0x210726[_0xe26a('0x2b')]!=='VIRTUAL'){var _0x13e330={};_0x13e330[_0x210726[_0xe26a('0x25')]]={'$like':'%'+_0x66cbe8['query']['filter']+'%'};return _0x13e330;}})});}_0x270fcf=_[_0xe26a('0x3a')]({},_0x270fcf,_0x66cbe8[_0xe26a('0x3b')]);var _0x504f1c={'where':_0x270fcf[_0xe26a('0x37')]};return db['Dynamics365Configuration'][_0xe26a('0x1c')](_0x504f1c)[_0xe26a('0x23')](function(_0x1ee177){_0x3f8277[_0xe26a('0x1c')]=_0x1ee177;if(_0x66cbe8['query'][_0xe26a('0x3c')]){_0x270fcf[_0xe26a('0x3d')]=[{'all':!![]}];}return db['Dynamics365Configuration'][_0xe26a('0x3e')](_0x270fcf);})[_0xe26a('0x23')](function(_0x4656df){_0x3f8277[_0xe26a('0x3f')]=_0x4656df;return _0x3f8277;})[_0xe26a('0x23')](respondWithFilteredResult(_0x22eb88,_0x270fcf))[_0xe26a('0x40')](handleError(_0x22eb88,null));};exports[_0xe26a('0x41')]=function(_0xf65d54,_0x4b868e){var _0x4ca352={'raw':![],'where':{'id':_0xf65d54['params']['id']}},_0x5709e5={};_0x5709e5[_0xe26a('0x2d')]=_['keys'](db[_0xe26a('0x29')][_0xe26a('0x42')]);_0x5709e5[_0xe26a('0x2e')]=_[_0xe26a('0x2f')](_0xf65d54[_0xe26a('0x2e')]);_0x5709e5['filters']=_[_0xe26a('0x31')](_0x5709e5['model'],_0x5709e5[_0xe26a('0x2e')]);_0x4ca352['attributes']=_[_0xe26a('0x31')](_0x5709e5['model'],qs[_0xe26a('0x32')](_0xf65d54['query'][_0xe26a('0x32')]));_0x4ca352[_0xe26a('0x33')]=_0x4ca352[_0xe26a('0x33')][_0xe26a('0x43')]?_0x4ca352['attributes']:_0x5709e5[_0xe26a('0x2d')];if(_0xf65d54[_0xe26a('0x2e')][_0xe26a('0x3c')]){_0x4ca352[_0xe26a('0x3d')]=[{'all':!![]}];}_0x4ca352=_[_0xe26a('0x3a')]({},_0x4ca352,_0xf65d54['options']);return db['Dynamics365Configuration'][_0xe26a('0x44')](_0x4ca352)[_0xe26a('0x23')](handleEntityNotFound(_0x4b868e,null))['then'](respondWithResult(_0x4b868e,null))['catch'](handleError(_0x4b868e,null));};exports['create']=function(_0x50315c,_0x1e3135){return db[_0xe26a('0x29')]['create'](_0x50315c[_0xe26a('0x45')],{})[_0xe26a('0x23')](respondWithResult(_0x1e3135,0xc9))[_0xe26a('0x40')](handleError(_0x1e3135,null));};exports[_0xe26a('0x22')]=function(_0x3e98d8,_0x3f8856){if(_0x3e98d8['body']['id']){delete _0x3e98d8[_0xe26a('0x45')]['id'];}return db[_0xe26a('0x29')][_0xe26a('0x44')]({'where':{'id':_0x3e98d8[_0xe26a('0x46')]['id']}})[_0xe26a('0x23')](handleEntityNotFound(_0x3f8856,null))[_0xe26a('0x23')](saveUpdates(_0x3e98d8[_0xe26a('0x45')],null))['then'](respondWithResult(_0x3f8856,null))[_0xe26a('0x40')](handleError(_0x3f8856,null));};exports[_0xe26a('0x24')]=function(_0x33b9f3,_0xe7c3e0){return db['Dynamics365Configuration'][_0xe26a('0x44')]({'where':{'id':_0x33b9f3[_0xe26a('0x46')]['id']}})['then'](handleEntityNotFound(_0xe7c3e0,null))[_0xe26a('0x23')](removeEntity(_0xe7c3e0,null))[_0xe26a('0x40')](handleError(_0xe7c3e0,null));};exports['getFields']=function(_0x1861b2,_0x766011,_0x38384d){var _0xa4c8db={};var _0x40cb16={};var _0x473f06;var _0x22d534;return db[_0xe26a('0x29')][_0xe26a('0x47')]({'where':{'id':_0x1861b2[_0xe26a('0x46')]['id']}})[_0xe26a('0x23')](handleEntityNotFound(_0x766011,null))[_0xe26a('0x23')](function(_0x4479ee){if(_0x4479ee){_0x473f06=_0x4479ee;_0x40cb16[_0xe26a('0x2d')]=_[_0xe26a('0x2f')](db[_0xe26a('0x48')]['rawAttributes']);_0x40cb16['query']=_[_0xe26a('0x2f')](_0x1861b2[_0xe26a('0x2e')]);_0x40cb16[_0xe26a('0x30')]=_['intersection'](_0x40cb16[_0xe26a('0x2d')],_0x40cb16[_0xe26a('0x2e')]);_0xa4c8db['attributes']=_[_0xe26a('0x31')](_0x40cb16[_0xe26a('0x2d')],qs['fields'](_0x1861b2[_0xe26a('0x2e')]['fields']));_0xa4c8db[_0xe26a('0x33')]=_0xa4c8db[_0xe26a('0x33')][_0xe26a('0x43')]?_0xa4c8db[_0xe26a('0x33')]:_0x40cb16[_0xe26a('0x2d')];_0xa4c8db['order']=qs[_0xe26a('0x36')](_0x1861b2[_0xe26a('0x2e')][_0xe26a('0x36')]);_0xa4c8db[_0xe26a('0x37')]=qs[_0xe26a('0x30')](_[_0xe26a('0x38')](_0x1861b2[_0xe26a('0x2e')],_0x40cb16[_0xe26a('0x30')]));if(_0x1861b2[_0xe26a('0x2e')][_0xe26a('0x39')]){_0xa4c8db[_0xe26a('0x37')]=_[_0xe26a('0x3a')](_0xa4c8db[_0xe26a('0x37')],{'$or':_[_0xe26a('0x28')](_0xa4c8db[_0xe26a('0x33')],function(_0xe09fce){var _0x4cb905={};_0x4cb905[_0xe09fce]={'$like':'%'+_0x1861b2['query'][_0xe26a('0x39')]+'%'};return _0x4cb905;})});}_0xa4c8db=_['merge']({},_0xa4c8db,_0x1861b2[_0xe26a('0x3b')]);return _0x473f06[_0xe26a('0x49')](_0xa4c8db);}})['then'](function(_0x570c1c){if(_0x570c1c){_0x22d534=_0x570c1c[_0xe26a('0x43')];if(!_0x1861b2[_0xe26a('0x2e')][_0xe26a('0x4a')]('nolimit')){_0xa4c8db[_0xe26a('0x1d')]=qs[_0xe26a('0x1d')](_0x1861b2[_0xe26a('0x2e')]['limit']);_0xa4c8db[_0xe26a('0x1a')]=qs[_0xe26a('0x1a')](_0x1861b2['query'][_0xe26a('0x1a')]);}return _0x473f06[_0xe26a('0x49')](_0xa4c8db);}})[_0xe26a('0x23')](function(_0x2d23f6){if(_0x2d23f6){return _0x2d23f6?{'count':_0x22d534,'rows':_0x2d23f6}:null;}})[_0xe26a('0x23')](respondWithResult(_0x766011,null))['catch'](handleError(_0x766011,null));};exports[_0xe26a('0x4b')]=function(_0x123725,_0x43bf46,_0x4e9b5d){var _0x2f0d69={};var _0x251e45={};var _0x3050aa;var _0x2671aa;return db[_0xe26a('0x29')]['findOne']({'where':{'id':_0x123725[_0xe26a('0x46')]['id']}})['then'](handleEntityNotFound(_0x43bf46,null))[_0xe26a('0x23')](function(_0x4edf88){if(_0x4edf88){_0x3050aa=_0x4edf88;_0x251e45[_0xe26a('0x2d')]=_[_0xe26a('0x2f')](db[_0xe26a('0x48')][_0xe26a('0x42')]);_0x251e45[_0xe26a('0x2e')]=_[_0xe26a('0x2f')](_0x123725[_0xe26a('0x2e')]);_0x251e45[_0xe26a('0x30')]=_['intersection'](_0x251e45[_0xe26a('0x2d')],_0x251e45[_0xe26a('0x2e')]);_0x2f0d69[_0xe26a('0x33')]=_[_0xe26a('0x31')](_0x251e45['model'],qs['fields'](_0x123725[_0xe26a('0x2e')][_0xe26a('0x32')]));_0x2f0d69[_0xe26a('0x33')]=_0x2f0d69[_0xe26a('0x33')]['length']?_0x2f0d69[_0xe26a('0x33')]:_0x251e45['model'];_0x2f0d69[_0xe26a('0x35')]=qs[_0xe26a('0x36')](_0x123725[_0xe26a('0x2e')][_0xe26a('0x36')]);_0x2f0d69[_0xe26a('0x37')]=qs[_0xe26a('0x30')](_[_0xe26a('0x38')](_0x123725[_0xe26a('0x2e')],_0x251e45[_0xe26a('0x30')]));if(_0x123725[_0xe26a('0x2e')][_0xe26a('0x39')]){_0x2f0d69[_0xe26a('0x37')]=_[_0xe26a('0x3a')](_0x2f0d69['where'],{'$or':_[_0xe26a('0x28')](_0x2f0d69[_0xe26a('0x33')],function(_0x9fa84c){var _0x8292f9={};_0x8292f9[_0x9fa84c]={'$like':'%'+_0x123725[_0xe26a('0x2e')][_0xe26a('0x39')]+'%'};return _0x8292f9;})});}_0x2f0d69=_[_0xe26a('0x3a')]({},_0x2f0d69,_0x123725['options']);return _0x3050aa[_0xe26a('0x4b')](_0x2f0d69);}})[_0xe26a('0x23')](function(_0x343e5b){if(_0x343e5b){_0x2671aa=_0x343e5b[_0xe26a('0x43')];if(!_0x123725[_0xe26a('0x2e')]['hasOwnProperty'](_0xe26a('0x34'))){_0x2f0d69['limit']=qs[_0xe26a('0x1d')](_0x123725[_0xe26a('0x2e')][_0xe26a('0x1d')]);_0x2f0d69[_0xe26a('0x1a')]=qs[_0xe26a('0x1a')](_0x123725['query'][_0xe26a('0x1a')]);}return _0x3050aa[_0xe26a('0x4b')](_0x2f0d69);}})['then'](function(_0x24c01a){if(_0x24c01a){return _0x24c01a?{'count':_0x2671aa,'rows':_0x24c01a}:null;}})['then'](respondWithResult(_0x43bf46,null))[_0xe26a('0x40')](handleError(_0x43bf46,null));};exports[_0xe26a('0x4c')]=function(_0x582a87,_0x50e754,_0x28899f){var _0x533cc4={};var _0x3998a8={};var _0x54aa5b;var _0xf5a2aa;return db[_0xe26a('0x29')][_0xe26a('0x47')]({'where':{'id':_0x582a87[_0xe26a('0x46')]['id']}})[_0xe26a('0x23')](handleEntityNotFound(_0x50e754,null))[_0xe26a('0x23')](function(_0x4526d4){if(_0x4526d4){_0x54aa5b=_0x4526d4;_0x3998a8[_0xe26a('0x2d')]=_['keys'](db[_0xe26a('0x48')][_0xe26a('0x42')]);_0x3998a8['query']=_[_0xe26a('0x2f')](_0x582a87[_0xe26a('0x2e')]);_0x3998a8[_0xe26a('0x30')]=_[_0xe26a('0x31')](_0x3998a8[_0xe26a('0x2d')],_0x3998a8[_0xe26a('0x2e')]);_0x533cc4['attributes']=_[_0xe26a('0x31')](_0x3998a8['model'],qs[_0xe26a('0x32')](_0x582a87[_0xe26a('0x2e')][_0xe26a('0x32')]));_0x533cc4[_0xe26a('0x33')]=_0x533cc4[_0xe26a('0x33')][_0xe26a('0x43')]?_0x533cc4[_0xe26a('0x33')]:_0x3998a8[_0xe26a('0x2d')];_0x533cc4[_0xe26a('0x35')]=qs[_0xe26a('0x36')](_0x582a87[_0xe26a('0x2e')][_0xe26a('0x36')]);_0x533cc4[_0xe26a('0x37')]=qs[_0xe26a('0x30')](_[_0xe26a('0x38')](_0x582a87[_0xe26a('0x2e')],_0x3998a8['filters']));if(_0x582a87[_0xe26a('0x2e')]['filter']){_0x533cc4[_0xe26a('0x37')]=_[_0xe26a('0x3a')](_0x533cc4[_0xe26a('0x37')],{'$or':_[_0xe26a('0x28')](_0x533cc4[_0xe26a('0x33')],function(_0x1c86f1){var _0x43be5b={};_0x43be5b[_0x1c86f1]={'$like':'%'+_0x582a87[_0xe26a('0x2e')]['filter']+'%'};return _0x43be5b;})});}_0x533cc4=_[_0xe26a('0x3a')]({},_0x533cc4,_0x582a87[_0xe26a('0x3b')]);return _0x54aa5b[_0xe26a('0x4c')](_0x533cc4);}})['then'](function(_0x2930b4){if(_0x2930b4){_0xf5a2aa=_0x2930b4[_0xe26a('0x43')];if(!_0x582a87['query'][_0xe26a('0x4a')](_0xe26a('0x34'))){_0x533cc4[_0xe26a('0x1d')]=qs[_0xe26a('0x1d')](_0x582a87[_0xe26a('0x2e')][_0xe26a('0x1d')]);_0x533cc4[_0xe26a('0x1a')]=qs[_0xe26a('0x1a')](_0x582a87['query'][_0xe26a('0x1a')]);}return _0x54aa5b['getDescriptions'](_0x533cc4);}})[_0xe26a('0x23')](function(_0x6318ae){if(_0x6318ae){return _0x6318ae?{'count':_0xf5a2aa,'rows':_0x6318ae}:null;}})[_0xe26a('0x23')](respondWithResult(_0x50e754,null))[_0xe26a('0x40')](handleError(_0x50e754,null));};
\ No newline at end of file
+var _0x6846=['undefined','count','offset','set','Content-Range','json','reject','update','then','destroy','error','stack','name','send','index','map','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','VIRTUAL','merge','options','Dynamics365Configuration','include','findAll','rows','catch','keys','length','find','create','body','params','getFields','findOne','Dynamics365Field','filter','hasOwnProperty','getSubjects','getDescriptions','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','crypto','jsforce','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','limit'];(function(_0x59fc6f,_0x4a71cf){var _0x2687ce=function(_0x40cb18){while(--_0x40cb18){_0x59fc6f['push'](_0x59fc6f['shift']());}};_0x2687ce(++_0x4a71cf);}(_0x6846,0x15f));var _0x6684=function(_0x24a234,_0x504c09){_0x24a234=_0x24a234-0x0;var _0xbc39b8=_0x6846[_0x24a234];return _0xbc39b8;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x6684('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6684('0x1'));var moment=require(_0x6684('0x2'));var BPromise=require(_0x6684('0x3'));var Mustache=require(_0x6684('0x4'));var util=require(_0x6684('0x5'));var path=require('path');var sox=require(_0x6684('0x6'));var csv=require(_0x6684('0x7'));var ejs=require(_0x6684('0x8'));var fs=require('fs');var fs_extra=require(_0x6684('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x6684('0xa'));var jsforce=require(_0x6684('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x6684('0x7'));var querystring=require('querystring');var Papa=require(_0x6684('0xc'));var Redis=require(_0x6684('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x6684('0xe'));var hardwareService=require(_0x6684('0xf'));var logger=require(_0x6684('0x10'))(_0x6684('0x11'));var utils=require('../../config/utils');var config=require(_0x6684('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x6684('0x13'))['db'];function respondWithStatusCode(_0x1478ae,_0x57c7af){_0x57c7af=_0x57c7af||0xcc;return function(_0x23dc9f){if(_0x23dc9f){return _0x1478ae[_0x6684('0x14')](_0x57c7af);}return _0x1478ae[_0x6684('0x15')](_0x57c7af)[_0x6684('0x16')]();};}function respondWithResult(_0x28eaf0,_0xba927){_0xba927=_0xba927||0xc8;return function(_0x3d1b59){if(_0x3d1b59){return _0x28eaf0[_0x6684('0x15')](_0xba927)['json'](_0x3d1b59);}};}function respondWithFilteredResult(_0x40a37f,_0x2cf04e){return function(_0x2d9ec0){if(_0x2d9ec0){var _0x35d060=typeof _0x2cf04e['offset']==='undefined'&&typeof _0x2cf04e[_0x6684('0x17')]===_0x6684('0x18');var _0x2e3034=_0x2d9ec0[_0x6684('0x19')];var _0x2f180a=_0x35d060?0x0:_0x2cf04e[_0x6684('0x1a')];var _0xd5272b=_0x35d060?_0x2d9ec0['count']:_0x2cf04e[_0x6684('0x1a')]+_0x2cf04e[_0x6684('0x17')];var _0x181d47;if(_0xd5272b>=_0x2e3034){_0xd5272b=_0x2e3034;_0x181d47=0xc8;}else{_0x181d47=0xce;}_0x40a37f['status'](_0x181d47);return _0x40a37f[_0x6684('0x1b')](_0x6684('0x1c'),_0x2f180a+'-'+_0xd5272b+'/'+_0x2e3034)[_0x6684('0x1d')](_0x2d9ec0);}return null;};}function patchUpdates(_0x5179d9){return function(_0x2cb27d){try{jsonpatch['apply'](_0x2cb27d,_0x5179d9,!![]);}catch(_0x2de210){return BPromise[_0x6684('0x1e')](_0x2de210);}return _0x2cb27d['save']();};}function saveUpdates(_0x594dcd,_0xba1642){return function(_0x4997af){if(_0x4997af){return _0x4997af[_0x6684('0x1f')](_0x594dcd)[_0x6684('0x20')](function(_0x2ece65){return _0x2ece65;});}return null;};}function removeEntity(_0x472f62,_0x3f9670){return function(_0x409964){if(_0x409964){return _0x409964[_0x6684('0x21')]()[_0x6684('0x20')](function(){_0x472f62[_0x6684('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4ab4d5,_0x3c15b1){return function(_0x4865a3){if(!_0x4865a3){_0x4ab4d5[_0x6684('0x14')](0x194);}return _0x4865a3;};}function handleError(_0x5aa0b2,_0x126de5){_0x126de5=_0x126de5||0x1f4;return function(_0xa917f6){logger[_0x6684('0x22')](_0xa917f6[_0x6684('0x23')]);if(_0xa917f6[_0x6684('0x24')]){delete _0xa917f6['name'];}_0x5aa0b2[_0x6684('0x15')](_0x126de5)[_0x6684('0x25')](_0xa917f6);};}exports[_0x6684('0x26')]=function(_0x4da832,_0x1056da){var _0x4b757a={},_0x4497fa={},_0x27268d={'count':0x0,'rows':[]};var _0x371ce6=_[_0x6684('0x27')](db['Dynamics365Configuration'][_0x6684('0x28')],function(_0x56dad5){return{'name':_0x56dad5['fieldName'],'type':_0x56dad5[_0x6684('0x29')][_0x6684('0x2a')]};});_0x4497fa[_0x6684('0x2b')]=_['map'](_0x371ce6,'name');_0x4497fa[_0x6684('0x2c')]=_['keys'](_0x4da832['query']);_0x4497fa[_0x6684('0x2d')]=_[_0x6684('0x2e')](_0x4497fa['model'],_0x4497fa[_0x6684('0x2c')]);_0x4b757a[_0x6684('0x2f')]=_[_0x6684('0x2e')](_0x4497fa[_0x6684('0x2b')],qs['fields'](_0x4da832[_0x6684('0x2c')][_0x6684('0x30')]));_0x4b757a['attributes']=_0x4b757a[_0x6684('0x2f')]['length']?_0x4b757a[_0x6684('0x2f')]:_0x4497fa['model'];if(!_0x4da832[_0x6684('0x2c')]['hasOwnProperty'](_0x6684('0x31'))){_0x4b757a[_0x6684('0x17')]=qs[_0x6684('0x17')](_0x4da832[_0x6684('0x2c')][_0x6684('0x17')]);_0x4b757a[_0x6684('0x1a')]=qs['offset'](_0x4da832[_0x6684('0x2c')]['offset']);}_0x4b757a[_0x6684('0x32')]=qs['sort'](_0x4da832[_0x6684('0x2c')][_0x6684('0x33')]);_0x4b757a[_0x6684('0x34')]=qs['filters'](_[_0x6684('0x35')](_0x4da832['query'],_0x4497fa[_0x6684('0x2d')]),_0x371ce6);if(_0x4da832[_0x6684('0x2c')]['filter']){_0x4b757a[_0x6684('0x34')]=_['merge'](_0x4b757a[_0x6684('0x34')],{'$or':_['map'](_0x371ce6,function(_0x4ce4c8){if(_0x4ce4c8[_0x6684('0x29')]!==_0x6684('0x36')){var _0x10344b={};_0x10344b[_0x4ce4c8['name']]={'$like':'%'+_0x4da832[_0x6684('0x2c')]['filter']+'%'};return _0x10344b;}})});}_0x4b757a=_[_0x6684('0x37')]({},_0x4b757a,_0x4da832[_0x6684('0x38')]);var _0x13e5c8={'where':_0x4b757a[_0x6684('0x34')]};return db[_0x6684('0x39')][_0x6684('0x19')](_0x13e5c8)[_0x6684('0x20')](function(_0x224061){_0x27268d[_0x6684('0x19')]=_0x224061;if(_0x4da832[_0x6684('0x2c')]['includeAll']){_0x4b757a[_0x6684('0x3a')]=[{'all':!![]}];}return db['Dynamics365Configuration'][_0x6684('0x3b')](_0x4b757a);})[_0x6684('0x20')](function(_0xfd1a74){_0x27268d[_0x6684('0x3c')]=_0xfd1a74;return _0x27268d;})['then'](respondWithFilteredResult(_0x1056da,_0x4b757a))[_0x6684('0x3d')](handleError(_0x1056da,null));};exports['show']=function(_0x4ade38,_0x56597a){var _0x42d145={'raw':![],'where':{'id':_0x4ade38['params']['id']}},_0x54f02b={};_0x54f02b['model']=_[_0x6684('0x3e')](db[_0x6684('0x39')][_0x6684('0x28')]);_0x54f02b['query']=_['keys'](_0x4ade38['query']);_0x54f02b[_0x6684('0x2d')]=_[_0x6684('0x2e')](_0x54f02b[_0x6684('0x2b')],_0x54f02b[_0x6684('0x2c')]);_0x42d145[_0x6684('0x2f')]=_[_0x6684('0x2e')](_0x54f02b[_0x6684('0x2b')],qs['fields'](_0x4ade38[_0x6684('0x2c')][_0x6684('0x30')]));_0x42d145['attributes']=_0x42d145[_0x6684('0x2f')][_0x6684('0x3f')]?_0x42d145[_0x6684('0x2f')]:_0x54f02b['model'];if(_0x4ade38['query']['includeAll']){_0x42d145[_0x6684('0x3a')]=[{'all':!![]}];}_0x42d145=_[_0x6684('0x37')]({},_0x42d145,_0x4ade38['options']);return db['Dynamics365Configuration'][_0x6684('0x40')](_0x42d145)[_0x6684('0x20')](handleEntityNotFound(_0x56597a,null))[_0x6684('0x20')](respondWithResult(_0x56597a,null))['catch'](handleError(_0x56597a,null));};exports[_0x6684('0x41')]=function(_0x406b99,_0xc27afb){return db[_0x6684('0x39')][_0x6684('0x41')](_0x406b99[_0x6684('0x42')],{})['then'](respondWithResult(_0xc27afb,0xc9))[_0x6684('0x3d')](handleError(_0xc27afb,null));};exports[_0x6684('0x1f')]=function(_0x296114,_0x3ee65b){if(_0x296114['body']['id']){delete _0x296114[_0x6684('0x42')]['id'];}return db['Dynamics365Configuration'][_0x6684('0x40')]({'where':{'id':_0x296114['params']['id']}})[_0x6684('0x20')](handleEntityNotFound(_0x3ee65b,null))[_0x6684('0x20')](saveUpdates(_0x296114[_0x6684('0x42')],null))[_0x6684('0x20')](respondWithResult(_0x3ee65b,null))['catch'](handleError(_0x3ee65b,null));};exports['destroy']=function(_0x1fcfb9,_0x132e55){return db[_0x6684('0x39')][_0x6684('0x40')]({'where':{'id':_0x1fcfb9[_0x6684('0x43')]['id']}})[_0x6684('0x20')](handleEntityNotFound(_0x132e55,null))[_0x6684('0x20')](removeEntity(_0x132e55,null))[_0x6684('0x3d')](handleError(_0x132e55,null));};exports[_0x6684('0x44')]=function(_0x5add44,_0x55633b,_0x5716de){var _0x24ac7b={};var _0x55ddfd={};var _0x5f23f9;var _0x1c28f9;return db[_0x6684('0x39')][_0x6684('0x45')]({'where':{'id':_0x5add44[_0x6684('0x43')]['id']}})[_0x6684('0x20')](handleEntityNotFound(_0x55633b,null))[_0x6684('0x20')](function(_0x1c5c95){if(_0x1c5c95){_0x5f23f9=_0x1c5c95;_0x55ddfd[_0x6684('0x2b')]=_['keys'](db[_0x6684('0x46')][_0x6684('0x28')]);_0x55ddfd['query']=_[_0x6684('0x3e')](_0x5add44['query']);_0x55ddfd[_0x6684('0x2d')]=_['intersection'](_0x55ddfd['model'],_0x55ddfd[_0x6684('0x2c')]);_0x24ac7b[_0x6684('0x2f')]=_[_0x6684('0x2e')](_0x55ddfd[_0x6684('0x2b')],qs['fields'](_0x5add44[_0x6684('0x2c')][_0x6684('0x30')]));_0x24ac7b[_0x6684('0x2f')]=_0x24ac7b[_0x6684('0x2f')][_0x6684('0x3f')]?_0x24ac7b[_0x6684('0x2f')]:_0x55ddfd['model'];_0x24ac7b[_0x6684('0x32')]=qs[_0x6684('0x33')](_0x5add44[_0x6684('0x2c')][_0x6684('0x33')]);_0x24ac7b[_0x6684('0x34')]=qs[_0x6684('0x2d')](_[_0x6684('0x35')](_0x5add44[_0x6684('0x2c')],_0x55ddfd[_0x6684('0x2d')]));if(_0x5add44['query'][_0x6684('0x47')]){_0x24ac7b['where']=_[_0x6684('0x37')](_0x24ac7b[_0x6684('0x34')],{'$or':_[_0x6684('0x27')](_0x24ac7b[_0x6684('0x2f')],function(_0x124fc5){var _0x41bab1={};_0x41bab1[_0x124fc5]={'$like':'%'+_0x5add44[_0x6684('0x2c')][_0x6684('0x47')]+'%'};return _0x41bab1;})});}_0x24ac7b=_[_0x6684('0x37')]({},_0x24ac7b,_0x5add44[_0x6684('0x38')]);return _0x5f23f9['getFields'](_0x24ac7b);}})[_0x6684('0x20')](function(_0x475b71){if(_0x475b71){_0x1c28f9=_0x475b71[_0x6684('0x3f')];if(!_0x5add44['query'][_0x6684('0x48')](_0x6684('0x31'))){_0x24ac7b['limit']=qs[_0x6684('0x17')](_0x5add44['query'][_0x6684('0x17')]);_0x24ac7b[_0x6684('0x1a')]=qs[_0x6684('0x1a')](_0x5add44[_0x6684('0x2c')][_0x6684('0x1a')]);}return _0x5f23f9[_0x6684('0x44')](_0x24ac7b);}})[_0x6684('0x20')](function(_0x1ac243){if(_0x1ac243){return _0x1ac243?{'count':_0x1c28f9,'rows':_0x1ac243}:null;}})[_0x6684('0x20')](respondWithResult(_0x55633b,null))[_0x6684('0x3d')](handleError(_0x55633b,null));};exports[_0x6684('0x49')]=function(_0x52a281,_0x49bdfe,_0x1388aa){var _0x576847={};var _0x8aa304={};var _0x392444;var _0x5934f6;return db[_0x6684('0x39')][_0x6684('0x45')]({'where':{'id':_0x52a281[_0x6684('0x43')]['id']}})[_0x6684('0x20')](handleEntityNotFound(_0x49bdfe,null))[_0x6684('0x20')](function(_0x31bf42){if(_0x31bf42){_0x392444=_0x31bf42;_0x8aa304[_0x6684('0x2b')]=_[_0x6684('0x3e')](db[_0x6684('0x46')][_0x6684('0x28')]);_0x8aa304[_0x6684('0x2c')]=_[_0x6684('0x3e')](_0x52a281[_0x6684('0x2c')]);_0x8aa304[_0x6684('0x2d')]=_[_0x6684('0x2e')](_0x8aa304[_0x6684('0x2b')],_0x8aa304[_0x6684('0x2c')]);_0x576847[_0x6684('0x2f')]=_[_0x6684('0x2e')](_0x8aa304[_0x6684('0x2b')],qs[_0x6684('0x30')](_0x52a281[_0x6684('0x2c')]['fields']));_0x576847['attributes']=_0x576847[_0x6684('0x2f')][_0x6684('0x3f')]?_0x576847[_0x6684('0x2f')]:_0x8aa304[_0x6684('0x2b')];_0x576847['order']=qs['sort'](_0x52a281[_0x6684('0x2c')][_0x6684('0x33')]);_0x576847[_0x6684('0x34')]=qs['filters'](_['pick'](_0x52a281[_0x6684('0x2c')],_0x8aa304['filters']));if(_0x52a281['query'][_0x6684('0x47')]){_0x576847[_0x6684('0x34')]=_[_0x6684('0x37')](_0x576847[_0x6684('0x34')],{'$or':_['map'](_0x576847[_0x6684('0x2f')],function(_0x6dd6fd){var _0x1b1080={};_0x1b1080[_0x6dd6fd]={'$like':'%'+_0x52a281['query']['filter']+'%'};return _0x1b1080;})});}_0x576847=_[_0x6684('0x37')]({},_0x576847,_0x52a281[_0x6684('0x38')]);return _0x392444[_0x6684('0x49')](_0x576847);}})[_0x6684('0x20')](function(_0x77dcb0){if(_0x77dcb0){_0x5934f6=_0x77dcb0[_0x6684('0x3f')];if(!_0x52a281['query'][_0x6684('0x48')]('nolimit')){_0x576847[_0x6684('0x17')]=qs[_0x6684('0x17')](_0x52a281[_0x6684('0x2c')][_0x6684('0x17')]);_0x576847['offset']=qs[_0x6684('0x1a')](_0x52a281[_0x6684('0x2c')][_0x6684('0x1a')]);}return _0x392444[_0x6684('0x49')](_0x576847);}})[_0x6684('0x20')](function(_0x1ec325){if(_0x1ec325){return _0x1ec325?{'count':_0x5934f6,'rows':_0x1ec325}:null;}})['then'](respondWithResult(_0x49bdfe,null))['catch'](handleError(_0x49bdfe,null));};exports['getDescriptions']=function(_0x1cfa5e,_0x1f0ecf,_0x14cca2){var _0x5fb4bd={};var _0x2be291={};var _0x78e6cd;var _0x330454;return db['Dynamics365Configuration'][_0x6684('0x45')]({'where':{'id':_0x1cfa5e[_0x6684('0x43')]['id']}})[_0x6684('0x20')](handleEntityNotFound(_0x1f0ecf,null))[_0x6684('0x20')](function(_0x124a3a){if(_0x124a3a){_0x78e6cd=_0x124a3a;_0x2be291[_0x6684('0x2b')]=_['keys'](db[_0x6684('0x46')][_0x6684('0x28')]);_0x2be291[_0x6684('0x2c')]=_[_0x6684('0x3e')](_0x1cfa5e[_0x6684('0x2c')]);_0x2be291[_0x6684('0x2d')]=_[_0x6684('0x2e')](_0x2be291[_0x6684('0x2b')],_0x2be291[_0x6684('0x2c')]);_0x5fb4bd['attributes']=_[_0x6684('0x2e')](_0x2be291[_0x6684('0x2b')],qs['fields'](_0x1cfa5e[_0x6684('0x2c')][_0x6684('0x30')]));_0x5fb4bd[_0x6684('0x2f')]=_0x5fb4bd[_0x6684('0x2f')]['length']?_0x5fb4bd[_0x6684('0x2f')]:_0x2be291[_0x6684('0x2b')];_0x5fb4bd['order']=qs[_0x6684('0x33')](_0x1cfa5e[_0x6684('0x2c')][_0x6684('0x33')]);_0x5fb4bd['where']=qs['filters'](_[_0x6684('0x35')](_0x1cfa5e[_0x6684('0x2c')],_0x2be291[_0x6684('0x2d')]));if(_0x1cfa5e[_0x6684('0x2c')][_0x6684('0x47')]){_0x5fb4bd[_0x6684('0x34')]=_[_0x6684('0x37')](_0x5fb4bd[_0x6684('0x34')],{'$or':_['map'](_0x5fb4bd[_0x6684('0x2f')],function(_0x31aa24){var _0x50145e={};_0x50145e[_0x31aa24]={'$like':'%'+_0x1cfa5e[_0x6684('0x2c')][_0x6684('0x47')]+'%'};return _0x50145e;})});}_0x5fb4bd=_[_0x6684('0x37')]({},_0x5fb4bd,_0x1cfa5e['options']);return _0x78e6cd[_0x6684('0x4a')](_0x5fb4bd);}})['then'](function(_0x47d5c3){if(_0x47d5c3){_0x330454=_0x47d5c3[_0x6684('0x3f')];if(!_0x1cfa5e['query']['hasOwnProperty'](_0x6684('0x31'))){_0x5fb4bd[_0x6684('0x17')]=qs[_0x6684('0x17')](_0x1cfa5e['query'][_0x6684('0x17')]);_0x5fb4bd['offset']=qs[_0x6684('0x1a')](_0x1cfa5e[_0x6684('0x2c')][_0x6684('0x1a')]);}return _0x78e6cd[_0x6684('0x4a')](_0x5fb4bd);}})['then'](function(_0x146307){if(_0x146307){return _0x146307?{'count':_0x330454,'rows':_0x146307}:null;}})['then'](respondWithResult(_0x1f0ecf,null))[_0x6684('0x3d')](handleError(_0x1f0ecf,null));};
\ No newline at end of file
index 18854f8..69268f4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8d0e=['define','Dynamics365Configuration','int_dynamics365_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intDynamics365Configuration.attributes'];(function(_0x40d699,_0x28ea63){var _0x26a2b4=function(_0x3acdbd){while(--_0x3acdbd){_0x40d699['push'](_0x40d699['shift']());}};_0x26a2b4(++_0x28ea63);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x5b29cb,_0x35d5ca){_0x5b29cb=_0x5b29cb-0x0;var _0x2f32d6=_0x8d0e[_0x5b29cb];return _0x2f32d6;};'use strict';var _=require(_0xe8d0('0x0'));var util=require(_0xe8d0('0x1'));var logger=require(_0xe8d0('0x2'))(_0xe8d0('0x3'));var moment=require(_0xe8d0('0x4'));var BPromise=require(_0xe8d0('0x5'));var rp=require(_0xe8d0('0x6'));var fs=require('fs');var path=require(_0xe8d0('0x7'));var rimraf=require(_0xe8d0('0x8'));var config=require('../../config/environment');var attributes=require(_0xe8d0('0x9'));module['exports']=function(_0x560dab,_0x2e2985){return _0x560dab[_0xe8d0('0xa')](_0xe8d0('0xb'),attributes,{'tableName':_0xe8d0('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb43b=['rimraf','../../config/environment','./intDynamics365Configuration.attributes','Dynamics365Configuration','int_dynamics365_configurations','lodash','util','api','moment','bluebird','path'];(function(_0x2bb18c,_0x4413dd){var _0x299c02=function(_0x33cd37){while(--_0x33cd37){_0x2bb18c['push'](_0x2bb18c['shift']());}};_0x299c02(++_0x4413dd);}(_0xb43b,0x1b2));var _0xbb43=function(_0x541831,_0x4aa10e){_0x541831=_0x541831-0x0;var _0x3550fc=_0xb43b[_0x541831];return _0x3550fc;};'use strict';var _=require(_0xbb43('0x0'));var util=require(_0xbb43('0x1'));var logger=require('../../config/logger')(_0xbb43('0x2'));var moment=require(_0xbb43('0x3'));var BPromise=require(_0xbb43('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbb43('0x5'));var rimraf=require(_0xbb43('0x6'));var config=require(_0xbb43('0x7'));var attributes=require(_0xbb43('0x8'));module['exports']=function(_0x491fb9,_0x378df5){return _0x491fb9['define'](_0xbb43('0x9'),attributes,{'tableName':_0xbb43('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index f1e1673..7b62a23 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0041=['stringify','error','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s'];(function(_0x3d78d7,_0x44acea){var _0x4b6784=function(_0x284157){while(--_0x284157){_0x3d78d7['push'](_0x3d78d7['shift']());}};_0x4b6784(++_0x44acea);}(_0x0041,0x8e));var _0x1004=function(_0x4e0d77,_0x45e348){_0x4e0d77=_0x4e0d77-0x0;var _0x31c680=_0x0041[_0x4e0d77];return _0x31c680;};'use strict';var _=require(_0x1004('0x0'));var util=require(_0x1004('0x1'));var moment=require(_0x1004('0x2'));var BPromise=require(_0x1004('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1004('0x4'));var db=require(_0x1004('0x5'))['db'];var utils=require(_0x1004('0x6'));var logger=require(_0x1004('0x7'))(_0x1004('0x8'));var config=require(_0x1004('0x9'));var jayson=require(_0x1004('0xa'));var client=jayson[_0x1004('0xb')][_0x1004('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x200dd5,_0x2f5382,_0x1666d9){return new BPromise(function(_0x24bd78,_0x5ceea2){return client['request'](_0x200dd5,_0x1666d9)[_0x1004('0xd')](function(_0x35f76a){logger[_0x1004('0xe')](_0x1004('0xf'),_0x2f5382,_0x1004('0x10'));logger[_0x1004('0x11')](_0x1004('0x12'),_0x2f5382,_0x1004('0x10'),JSON[_0x1004('0x13')](_0x35f76a));if(_0x35f76a['error']){if(_0x35f76a[_0x1004('0x14')]['code']===0x1f4){logger[_0x1004('0x14')](_0x1004('0xf'),_0x2f5382,_0x35f76a[_0x1004('0x14')]['message']);return _0x5ceea2(_0x35f76a['error'][_0x1004('0x15')]);}logger[_0x1004('0x14')](_0x1004('0xf'),_0x2f5382,_0x35f76a['error'][_0x1004('0x15')]);return _0x24bd78(_0x35f76a['error']['message']);}else{logger[_0x1004('0xe')](_0x1004('0xf'),_0x2f5382,_0x1004('0x10'));_0x24bd78(_0x35f76a[_0x1004('0x16')][_0x1004('0x15')]);}})['catch'](function(_0x32a67f){logger[_0x1004('0x14')]('Dynamics365Configuration,\x20%s,\x20%s',_0x2f5382,_0x32a67f);_0x5ceea2(_0x32a67f);});});}
\ No newline at end of file
+var _0x892d=['../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x119f8d,_0x2e792f){var _0x10c3f8=function(_0x306ed6){while(--_0x306ed6){_0x119f8d['push'](_0x119f8d['shift']());}};_0x10c3f8(++_0x2e792f);}(_0x892d,0x14a));var _0xd892=function(_0x108b75,_0x38bab7){_0x108b75=_0x108b75-0x0;var _0x5f50c2=_0x892d[_0x108b75];return _0x5f50c2;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xd892('0x0'));var BPromise=require(_0xd892('0x1'));var rs=require(_0xd892('0x2'));var fs=require('fs');var Redis=require(_0xd892('0x3'));var db=require(_0xd892('0x4'))['db'];var utils=require(_0xd892('0x5'));var logger=require(_0xd892('0x6'))(_0xd892('0x7'));var config=require(_0xd892('0x8'));var jayson=require(_0xd892('0x9'));var client=jayson['client'][_0xd892('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x195caa,_0x62474e,_0x3b2885){return new BPromise(function(_0x4d7bc7,_0x471413){return client[_0xd892('0xb')](_0x195caa,_0x3b2885)['then'](function(_0x5bde0f){logger[_0xd892('0xc')](_0xd892('0xd'),_0x62474e,_0xd892('0xe'));logger['debug'](_0xd892('0xf'),_0x62474e,_0xd892('0xe'),JSON[_0xd892('0x10')](_0x5bde0f));if(_0x5bde0f[_0xd892('0x11')]){if(_0x5bde0f[_0xd892('0x11')]['code']===0x1f4){logger['error'](_0xd892('0xd'),_0x62474e,_0x5bde0f['error'][_0xd892('0x12')]);return _0x471413(_0x5bde0f[_0xd892('0x11')][_0xd892('0x12')]);}logger[_0xd892('0x11')](_0xd892('0xd'),_0x62474e,_0x5bde0f[_0xd892('0x11')][_0xd892('0x12')]);return _0x4d7bc7(_0x5bde0f[_0xd892('0x11')][_0xd892('0x12')]);}else{logger[_0xd892('0xc')](_0xd892('0xd'),_0x62474e,_0xd892('0xe'));_0x4d7bc7(_0x5bde0f[_0xd892('0x13')][_0xd892('0x12')]);}})[_0xd892('0x14')](function(_0x358001){logger[_0xd892('0x11')](_0xd892('0xd'),_0x62474e,_0x358001);_0x471413(_0x358001);});});}
\ No newline at end of file
index 994570b..634a766 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb4e1=['put','update','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../config/environment','get','isAuthenticated','index','/:id','show'];(function(_0x435fcc,_0x489fd4){var _0x14b4ee=function(_0x15dbec){while(--_0x15dbec){_0x435fcc['push'](_0x435fcc['shift']());}};_0x14b4ee(++_0x489fd4);}(_0xb4e1,0x6d));var _0x1b4e=function(_0x5d3a45,_0x516be0){_0x5d3a45=_0x5d3a45-0x0;var _0x3708d1=_0xb4e1[_0x5d3a45];return _0x3708d1;};'use strict';var multer=require('multer');var util=require(_0x1b4e('0x0'));var path=require('path');var timeout=require(_0x1b4e('0x1'));var express=require(_0x1b4e('0x2'));var router=express[_0x1b4e('0x3')]();var fs_extra=require(_0x1b4e('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x1b4e('0x5'));var controller=require('./intDynamics365Field.controller');router[_0x1b4e('0x6')]('/',auth[_0x1b4e('0x7')](),controller[_0x1b4e('0x8')]);router[_0x1b4e('0x6')](_0x1b4e('0x9'),auth['isAuthenticated'](),controller[_0x1b4e('0xa')]);router['post']('/',auth[_0x1b4e('0x7')](),controller['create']);router[_0x1b4e('0xb')]('/:id',auth[_0x1b4e('0x7')](),controller[_0x1b4e('0xc')]);router['delete']('/:id',auth[_0x1b4e('0x7')](),controller[_0x1b4e('0xd')]);module[_0x1b4e('0xe')]=router;
\ No newline at end of file
+var _0xaced=['post','create','delete','destroy','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDynamics365Field.controller','get','isAuthenticated','/:id'];(function(_0x3d024f,_0x551806){var _0xec6028=function(_0x14c9a1){while(--_0x14c9a1){_0x3d024f['push'](_0x3d024f['shift']());}};_0xec6028(++_0x551806);}(_0xaced,0xd6));var _0xdace=function(_0x4fad8f,_0x1b4193){_0x4fad8f=_0x4fad8f-0x0;var _0x47741f=_0xaced[_0x4fad8f];return _0x47741f;};'use strict';var multer=require('multer');var util=require(_0xdace('0x0'));var path=require(_0xdace('0x1'));var timeout=require(_0xdace('0x2'));var express=require('express');var router=express[_0xdace('0x3')]();var fs_extra=require(_0xdace('0x4'));var auth=require(_0xdace('0x5'));var interaction=require(_0xdace('0x6'));var config=require('../../config/environment');var controller=require(_0xdace('0x7'));router[_0xdace('0x8')]('/',auth[_0xdace('0x9')](),controller['index']);router[_0xdace('0x8')](_0xdace('0xa'),auth['isAuthenticated'](),controller['show']);router[_0xdace('0xb')]('/',auth[_0xdace('0x9')](),controller[_0xdace('0xc')]);router['put'](_0xdace('0xa'),auth[_0xdace('0x9')](),controller['update']);router[_0xdace('0xd')]('/:id',auth[_0xdace('0x9')](),controller[_0xdace('0xe')]);module['exports']=router;
\ No newline at end of file
index 8da8bef..2e2aee8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfb49=['picklist','STRING','BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable','keyValue'];(function(_0x275851,_0x2542a8){var _0x318b2a=function(_0xe46e2a){while(--_0xe46e2a){_0x275851['push'](_0x275851['shift']());}};_0x318b2a(++_0x2542a8);}(_0xfb49,0x139));var _0x9fb4=function(_0x420f2a,_0x2cc58d){_0x420f2a=_0x420f2a-0x0;var _0x28f802=_0xfb49[_0x420f2a];return _0x28f802;};'use strict';var Sequelize=require(_0x9fb4('0x0'));module[_0x9fb4('0x1')]={'type':{'type':Sequelize[_0x9fb4('0x2')](_0x9fb4('0x3'),_0x9fb4('0x4'),_0x9fb4('0x5'),_0x9fb4('0x6'),_0x9fb4('0x7')),'defaultValue':'string'},'content':{'type':Sequelize[_0x9fb4('0x8')]},'key':{'type':Sequelize[_0x9fb4('0x8')]},'keyType':{'type':Sequelize['ENUM'](_0x9fb4('0x3'),_0x9fb4('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0x9fb4('0x8')]},'idField':{'type':Sequelize[_0x9fb4('0x8')]},'nameField':{'type':Sequelize[_0x9fb4('0x8')]},'customField':{'type':Sequelize[_0x9fb4('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x9fb4('0x8')]}};
\ No newline at end of file
+var _0x3399=['BOOLEAN','ENUM','variable','customVariable','keyValue','string','STRING'];(function(_0x375bfd,_0x7c9e97){var _0x5ae9af=function(_0x1b8e61){while(--_0x1b8e61){_0x375bfd['push'](_0x375bfd['shift']());}};_0x5ae9af(++_0x7c9e97);}(_0x3399,0x71));var _0x9339=function(_0x2783fd,_0xd18827){_0x2783fd=_0x2783fd-0x0;var _0x77dee6=_0x3399[_0x2783fd];return _0x77dee6;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x9339('0x0')]('string',_0x9339('0x1'),_0x9339('0x2'),_0x9339('0x3'),'picklist'),'defaultValue':_0x9339('0x4')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x9339('0x5')]},'keyType':{'type':Sequelize[_0x9339('0x0')](_0x9339('0x4'),'variable',_0x9339('0x2'))},'keyContent':{'type':Sequelize[_0x9339('0x5')]},'idField':{'type':Sequelize[_0x9339('0x5')]},'nameField':{'type':Sequelize[_0x9339('0x5')]},'customField':{'type':Sequelize[_0x9339('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x9339('0x5')]}};
\ No newline at end of file
index 2678690..136438f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0929=['type','model','keys','query','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','params','find','create','body','eml-format','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','update','then','destroy','name','send','index','map','Dynamics365Field','rawAttributes'];(function(_0x222c0a,_0x14be91){var _0x583ec4=function(_0x5c9848){while(--_0x5c9848){_0x222c0a['push'](_0x222c0a['shift']());}};_0x583ec4(++_0x14be91);}(_0x0929,0x16d));var _0x9092=function(_0x595054,_0x150da8){_0x595054=_0x595054-0x0;var _0x3b02bd=_0x0929[_0x595054];return _0x3b02bd;};'use strict';var emlformat=require(_0x9092('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x9092('0x1'));var rp=require('request-promise');var moment=require(_0x9092('0x2'));var BPromise=require(_0x9092('0x3'));var Mustache=require(_0x9092('0x4'));var util=require(_0x9092('0x5'));var path=require('path');var sox=require(_0x9092('0x6'));var csv=require(_0x9092('0x7'));var ejs=require(_0x9092('0x8'));var fs=require('fs');var fs_extra=require(_0x9092('0x9'));var _=require(_0x9092('0xa'));var squel=require(_0x9092('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x9092('0xc'));var toCsv=require(_0x9092('0x7'));var querystring=require('querystring');var Papa=require(_0x9092('0xd'));var Redis=require(_0x9092('0xe'));var authService=require(_0x9092('0xf'));var qs=require(_0x9092('0x10'));var as=require(_0x9092('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9092('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x9092('0x13'));var licenseUtil=require(_0x9092('0x14'));var db=require(_0x9092('0x15'))['db'];function respondWithStatusCode(_0x4041ed,_0xab0a4b){_0xab0a4b=_0xab0a4b||0xcc;return function(_0x535605){if(_0x535605){return _0x4041ed[_0x9092('0x16')](_0xab0a4b);}return _0x4041ed[_0x9092('0x17')](_0xab0a4b)[_0x9092('0x18')]();};}function respondWithResult(_0x2f115f,_0x33e5e8){_0x33e5e8=_0x33e5e8||0xc8;return function(_0x3eb82f){if(_0x3eb82f){return _0x2f115f[_0x9092('0x17')](_0x33e5e8)['json'](_0x3eb82f);}};}function respondWithFilteredResult(_0x3c7ab8,_0x7490e1){return function(_0xf3258d){if(_0xf3258d){var _0x1a3167=typeof _0x7490e1['offset']===_0x9092('0x19')&&typeof _0x7490e1[_0x9092('0x1a')]===_0x9092('0x19');var _0x191d55=_0xf3258d[_0x9092('0x1b')];var _0x38c8d9=_0x1a3167?0x0:_0x7490e1[_0x9092('0x1c')];var _0x2090cf=_0x1a3167?_0xf3258d[_0x9092('0x1b')]:_0x7490e1[_0x9092('0x1c')]+_0x7490e1['limit'];var _0x104ad4;if(_0x2090cf>=_0x191d55){_0x2090cf=_0x191d55;_0x104ad4=0xc8;}else{_0x104ad4=0xce;}_0x3c7ab8['status'](_0x104ad4);return _0x3c7ab8[_0x9092('0x1d')](_0x9092('0x1e'),_0x38c8d9+'-'+_0x2090cf+'/'+_0x191d55)[_0x9092('0x1f')](_0xf3258d);}return null;};}function patchUpdates(_0x2a7e05){return function(_0xfee398){try{jsonpatch[_0x9092('0x20')](_0xfee398,_0x2a7e05,!![]);}catch(_0x2b8fa6){return BPromise[_0x9092('0x21')](_0x2b8fa6);}return _0xfee398['save']();};}function saveUpdates(_0x38e9fd,_0x439a76){return function(_0x43f69f){if(_0x43f69f){return _0x43f69f[_0x9092('0x22')](_0x38e9fd)[_0x9092('0x23')](function(_0x105faa){return _0x105faa;});}return null;};}function removeEntity(_0x37ba17,_0x202c70){return function(_0x4a578f){if(_0x4a578f){return _0x4a578f[_0x9092('0x24')]()['then'](function(){_0x37ba17[_0x9092('0x17')](0xcc)[_0x9092('0x18')]();});}};}function handleEntityNotFound(_0x145820,_0x146611){return function(_0x190937){if(!_0x190937){_0x145820['sendStatus'](0x194);}return _0x190937;};}function handleError(_0x37b374,_0xe35709){_0xe35709=_0xe35709||0x1f4;return function(_0x5f383a){logger['error'](_0x5f383a['stack']);if(_0x5f383a['name']){delete _0x5f383a[_0x9092('0x25')];}_0x37b374[_0x9092('0x17')](_0xe35709)[_0x9092('0x26')](_0x5f383a);};}exports[_0x9092('0x27')]=function(_0x32b147,_0x62f51f){var _0x5efe7a={},_0x3b3a7c={},_0x28cd0c={'count':0x0,'rows':[]};var _0x497901=_[_0x9092('0x28')](db[_0x9092('0x29')][_0x9092('0x2a')],function(_0x17acda){return{'name':_0x17acda['fieldName'],'type':_0x17acda[_0x9092('0x2b')]['key']};});_0x3b3a7c[_0x9092('0x2c')]=_[_0x9092('0x28')](_0x497901,'name');_0x3b3a7c['query']=_[_0x9092('0x2d')](_0x32b147[_0x9092('0x2e')]);_0x3b3a7c[_0x9092('0x2f')]=_[_0x9092('0x30')](_0x3b3a7c[_0x9092('0x2c')],_0x3b3a7c['query']);_0x5efe7a[_0x9092('0x31')]=_[_0x9092('0x30')](_0x3b3a7c['model'],qs[_0x9092('0x32')](_0x32b147[_0x9092('0x2e')][_0x9092('0x32')]));_0x5efe7a[_0x9092('0x31')]=_0x5efe7a[_0x9092('0x31')][_0x9092('0x33')]?_0x5efe7a[_0x9092('0x31')]:_0x3b3a7c[_0x9092('0x2c')];if(!_0x32b147[_0x9092('0x2e')]['hasOwnProperty']('nolimit')){_0x5efe7a[_0x9092('0x1a')]=qs[_0x9092('0x1a')](_0x32b147[_0x9092('0x2e')][_0x9092('0x1a')]);_0x5efe7a[_0x9092('0x1c')]=qs[_0x9092('0x1c')](_0x32b147[_0x9092('0x2e')][_0x9092('0x1c')]);}_0x5efe7a[_0x9092('0x34')]=qs[_0x9092('0x35')](_0x32b147[_0x9092('0x2e')][_0x9092('0x35')]);_0x5efe7a[_0x9092('0x36')]=qs[_0x9092('0x2f')](_[_0x9092('0x37')](_0x32b147[_0x9092('0x2e')],_0x3b3a7c['filters']),_0x497901);if(_0x32b147[_0x9092('0x2e')][_0x9092('0x38')]){_0x5efe7a['where']=_[_0x9092('0x39')](_0x5efe7a[_0x9092('0x36')],{'$or':_[_0x9092('0x28')](_0x497901,function(_0x301563){if(_0x301563['type']!=='VIRTUAL'){var _0x4f2b52={};_0x4f2b52[_0x301563[_0x9092('0x25')]]={'$like':'%'+_0x32b147[_0x9092('0x2e')][_0x9092('0x38')]+'%'};return _0x4f2b52;}})});}_0x5efe7a=_[_0x9092('0x39')]({},_0x5efe7a,_0x32b147[_0x9092('0x3a')]);var _0x3eb7f0={'where':_0x5efe7a[_0x9092('0x36')]};return db['Dynamics365Field'][_0x9092('0x1b')](_0x3eb7f0)['then'](function(_0xd071cc){_0x28cd0c[_0x9092('0x1b')]=_0xd071cc;if(_0x32b147['query'][_0x9092('0x3b')]){_0x5efe7a[_0x9092('0x3c')]=[{'all':!![]}];}return db['Dynamics365Field'][_0x9092('0x3d')](_0x5efe7a);})[_0x9092('0x23')](function(_0x39d371){_0x28cd0c[_0x9092('0x3e')]=_0x39d371;return _0x28cd0c;})[_0x9092('0x23')](respondWithFilteredResult(_0x62f51f,_0x5efe7a))[_0x9092('0x3f')](handleError(_0x62f51f,null));};exports['show']=function(_0x246cf4,_0x2bd337){var _0xbf314b={'raw':!![],'where':{'id':_0x246cf4[_0x9092('0x40')]['id']}},_0x1be0e3={};_0x1be0e3[_0x9092('0x2c')]=_['keys'](db[_0x9092('0x29')][_0x9092('0x2a')]);_0x1be0e3[_0x9092('0x2e')]=_[_0x9092('0x2d')](_0x246cf4['query']);_0x1be0e3[_0x9092('0x2f')]=_[_0x9092('0x30')](_0x1be0e3[_0x9092('0x2c')],_0x1be0e3[_0x9092('0x2e')]);_0xbf314b[_0x9092('0x31')]=_[_0x9092('0x30')](_0x1be0e3['model'],qs[_0x9092('0x32')](_0x246cf4[_0x9092('0x2e')][_0x9092('0x32')]));_0xbf314b[_0x9092('0x31')]=_0xbf314b[_0x9092('0x31')][_0x9092('0x33')]?_0xbf314b[_0x9092('0x31')]:_0x1be0e3[_0x9092('0x2c')];if(_0x246cf4[_0x9092('0x2e')]['includeAll']){_0xbf314b['include']=[{'all':!![]}];}_0xbf314b=_[_0x9092('0x39')]({},_0xbf314b,_0x246cf4[_0x9092('0x3a')]);return db['Dynamics365Field'][_0x9092('0x41')](_0xbf314b)[_0x9092('0x23')](handleEntityNotFound(_0x2bd337,null))[_0x9092('0x23')](respondWithResult(_0x2bd337,null))[_0x9092('0x3f')](handleError(_0x2bd337,null));};exports[_0x9092('0x42')]=function(_0x4ebb1c,_0x245153){return db[_0x9092('0x29')][_0x9092('0x42')](_0x4ebb1c['body'],{})[_0x9092('0x23')](respondWithResult(_0x245153,0xc9))[_0x9092('0x3f')](handleError(_0x245153,null));};exports['update']=function(_0x33ed86,_0x54f0ec){if(_0x33ed86['body']['id']){delete _0x33ed86[_0x9092('0x43')]['id'];}return db['Dynamics365Field']['find']({'where':{'id':_0x33ed86[_0x9092('0x40')]['id']}})[_0x9092('0x23')](handleEntityNotFound(_0x54f0ec,null))['then'](saveUpdates(_0x33ed86[_0x9092('0x43')],null))['then'](respondWithResult(_0x54f0ec,null))[_0x9092('0x3f')](handleError(_0x54f0ec,null));};exports[_0x9092('0x24')]=function(_0x1dd191,_0x13836b){return db['Dynamics365Field'][_0x9092('0x41')]({'where':{'id':_0x1dd191[_0x9092('0x40')]['id']}})['then'](handleEntityNotFound(_0x13836b,null))[_0x9092('0x23')](removeEntity(_0x13836b,null))[_0x9092('0x3f')](handleError(_0x13836b,null));};
\ No newline at end of file
+var _0x5cba=['querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','error','stack','name','index','map','rawAttributes','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','merge','Dynamics365Field','then','includeAll','include','findAll','rows','catch','show','params','filters','find','create','body','destroy','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','desk.js'];(function(_0xcaf223,_0xd39f07){var _0x17e00d=function(_0xe2852e){while(--_0xe2852e){_0xcaf223['push'](_0xcaf223['shift']());}};_0x17e00d(++_0xd39f07);}(_0x5cba,0xc8));var _0xa5cb=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x5cba[_0x19950b];return _0x3c6b41;};'use strict';var emlformat=require(_0xa5cb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa5cb('0x1'));var jsonpatch=require(_0xa5cb('0x2'));var rp=require(_0xa5cb('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xa5cb('0x4'));var util=require(_0xa5cb('0x5'));var path=require(_0xa5cb('0x6'));var sox=require(_0xa5cb('0x7'));var csv=require(_0xa5cb('0x8'));var ejs=require(_0xa5cb('0x9'));var fs=require('fs');var fs_extra=require(_0xa5cb('0xa'));var _=require('lodash');var squel=require(_0xa5cb('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xa5cb('0xc'));var toCsv=require('to-csv');var querystring=require(_0xa5cb('0xd'));var Papa=require(_0xa5cb('0xe'));var Redis=require('ioredis');var authService=require(_0xa5cb('0xf'));var qs=require(_0xa5cb('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa5cb('0x11'));var logger=require(_0xa5cb('0x12'))(_0xa5cb('0x13'));var utils=require('../../config/utils');var config=require(_0xa5cb('0x14'));var licenseUtil=require(_0xa5cb('0x15'));var db=require(_0xa5cb('0x16'))['db'];function respondWithStatusCode(_0x26a6ff,_0x21dbd8){_0x21dbd8=_0x21dbd8||0xcc;return function(_0x30a95d){if(_0x30a95d){return _0x26a6ff[_0xa5cb('0x17')](_0x21dbd8);}return _0x26a6ff[_0xa5cb('0x18')](_0x21dbd8)[_0xa5cb('0x19')]();};}function respondWithResult(_0x213aa8,_0x3ae2b9){_0x3ae2b9=_0x3ae2b9||0xc8;return function(_0x4caf52){if(_0x4caf52){return _0x213aa8[_0xa5cb('0x18')](_0x3ae2b9)[_0xa5cb('0x1a')](_0x4caf52);}};}function respondWithFilteredResult(_0x202195,_0x26d6c7){return function(_0x3a61a3){if(_0x3a61a3){var _0xda4a7a=typeof _0x26d6c7[_0xa5cb('0x1b')]===_0xa5cb('0x1c')&&typeof _0x26d6c7[_0xa5cb('0x1d')]===_0xa5cb('0x1c');var _0x177652=_0x3a61a3[_0xa5cb('0x1e')];var _0x34bc7f=_0xda4a7a?0x0:_0x26d6c7[_0xa5cb('0x1b')];var _0x3725bc=_0xda4a7a?_0x3a61a3['count']:_0x26d6c7['offset']+_0x26d6c7[_0xa5cb('0x1d')];var _0x1ae470;if(_0x3725bc>=_0x177652){_0x3725bc=_0x177652;_0x1ae470=0xc8;}else{_0x1ae470=0xce;}_0x202195[_0xa5cb('0x18')](_0x1ae470);return _0x202195['set'](_0xa5cb('0x1f'),_0x34bc7f+'-'+_0x3725bc+'/'+_0x177652)[_0xa5cb('0x1a')](_0x3a61a3);}return null;};}function patchUpdates(_0xdf8b4a){return function(_0x21377c){try{jsonpatch[_0xa5cb('0x20')](_0x21377c,_0xdf8b4a,!![]);}catch(_0x1008ba){return BPromise[_0xa5cb('0x21')](_0x1008ba);}return _0x21377c['save']();};}function saveUpdates(_0x2d42af,_0x24834f){return function(_0x7dd43c){if(_0x7dd43c){return _0x7dd43c[_0xa5cb('0x22')](_0x2d42af)['then'](function(_0xb40a87){return _0xb40a87;});}return null;};}function removeEntity(_0x22cd59,_0x2153c0){return function(_0x13b7d6){if(_0x13b7d6){return _0x13b7d6['destroy']()['then'](function(){_0x22cd59[_0xa5cb('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x30ddb1,_0x2067e2){return function(_0xada32b){if(!_0xada32b){_0x30ddb1[_0xa5cb('0x17')](0x194);}return _0xada32b;};}function handleError(_0x3c7b2d,_0x3f59f3){_0x3f59f3=_0x3f59f3||0x1f4;return function(_0x5cf8b9){logger[_0xa5cb('0x23')](_0x5cf8b9[_0xa5cb('0x24')]);if(_0x5cf8b9[_0xa5cb('0x25')]){delete _0x5cf8b9['name'];}_0x3c7b2d[_0xa5cb('0x18')](_0x3f59f3)['send'](_0x5cf8b9);};}exports[_0xa5cb('0x26')]=function(_0x1b9f6f,_0x437b22){var _0xad972={},_0x3328ee={},_0x2d94f2={'count':0x0,'rows':[]};var _0xb42048=_[_0xa5cb('0x27')](db['Dynamics365Field'][_0xa5cb('0x28')],function(_0x476a70){return{'name':_0x476a70['fieldName'],'type':_0x476a70[_0xa5cb('0x29')][_0xa5cb('0x2a')]};});_0x3328ee[_0xa5cb('0x2b')]=_[_0xa5cb('0x27')](_0xb42048,_0xa5cb('0x25'));_0x3328ee['query']=_[_0xa5cb('0x2c')](_0x1b9f6f[_0xa5cb('0x2d')]);_0x3328ee['filters']=_[_0xa5cb('0x2e')](_0x3328ee[_0xa5cb('0x2b')],_0x3328ee[_0xa5cb('0x2d')]);_0xad972[_0xa5cb('0x2f')]=_[_0xa5cb('0x2e')](_0x3328ee[_0xa5cb('0x2b')],qs[_0xa5cb('0x30')](_0x1b9f6f[_0xa5cb('0x2d')]['fields']));_0xad972[_0xa5cb('0x2f')]=_0xad972[_0xa5cb('0x2f')][_0xa5cb('0x31')]?_0xad972[_0xa5cb('0x2f')]:_0x3328ee[_0xa5cb('0x2b')];if(!_0x1b9f6f[_0xa5cb('0x2d')][_0xa5cb('0x32')](_0xa5cb('0x33'))){_0xad972['limit']=qs[_0xa5cb('0x1d')](_0x1b9f6f[_0xa5cb('0x2d')][_0xa5cb('0x1d')]);_0xad972[_0xa5cb('0x1b')]=qs['offset'](_0x1b9f6f[_0xa5cb('0x2d')][_0xa5cb('0x1b')]);}_0xad972['order']=qs['sort'](_0x1b9f6f[_0xa5cb('0x2d')][_0xa5cb('0x34')]);_0xad972[_0xa5cb('0x35')]=qs['filters'](_['pick'](_0x1b9f6f[_0xa5cb('0x2d')],_0x3328ee['filters']),_0xb42048);if(_0x1b9f6f['query'][_0xa5cb('0x36')]){_0xad972[_0xa5cb('0x35')]=_['merge'](_0xad972['where'],{'$or':_[_0xa5cb('0x27')](_0xb42048,function(_0x1ac202){if(_0x1ac202[_0xa5cb('0x29')]!==_0xa5cb('0x37')){var _0x5574a5={};_0x5574a5[_0x1ac202[_0xa5cb('0x25')]]={'$like':'%'+_0x1b9f6f['query']['filter']+'%'};return _0x5574a5;}})});}_0xad972=_[_0xa5cb('0x38')]({},_0xad972,_0x1b9f6f['options']);var _0x12dc77={'where':_0xad972[_0xa5cb('0x35')]};return db[_0xa5cb('0x39')][_0xa5cb('0x1e')](_0x12dc77)[_0xa5cb('0x3a')](function(_0x4af4ed){_0x2d94f2[_0xa5cb('0x1e')]=_0x4af4ed;if(_0x1b9f6f[_0xa5cb('0x2d')][_0xa5cb('0x3b')]){_0xad972[_0xa5cb('0x3c')]=[{'all':!![]}];}return db[_0xa5cb('0x39')][_0xa5cb('0x3d')](_0xad972);})[_0xa5cb('0x3a')](function(_0x29bc15){_0x2d94f2[_0xa5cb('0x3e')]=_0x29bc15;return _0x2d94f2;})['then'](respondWithFilteredResult(_0x437b22,_0xad972))[_0xa5cb('0x3f')](handleError(_0x437b22,null));};exports[_0xa5cb('0x40')]=function(_0x3bc1e5,_0x5e5b32){var _0x44848d={'raw':!![],'where':{'id':_0x3bc1e5[_0xa5cb('0x41')]['id']}},_0x160f33={};_0x160f33['model']=_['keys'](db[_0xa5cb('0x39')][_0xa5cb('0x28')]);_0x160f33[_0xa5cb('0x2d')]=_[_0xa5cb('0x2c')](_0x3bc1e5[_0xa5cb('0x2d')]);_0x160f33[_0xa5cb('0x42')]=_['intersection'](_0x160f33[_0xa5cb('0x2b')],_0x160f33[_0xa5cb('0x2d')]);_0x44848d[_0xa5cb('0x2f')]=_[_0xa5cb('0x2e')](_0x160f33[_0xa5cb('0x2b')],qs['fields'](_0x3bc1e5[_0xa5cb('0x2d')][_0xa5cb('0x30')]));_0x44848d[_0xa5cb('0x2f')]=_0x44848d[_0xa5cb('0x2f')][_0xa5cb('0x31')]?_0x44848d[_0xa5cb('0x2f')]:_0x160f33[_0xa5cb('0x2b')];if(_0x3bc1e5[_0xa5cb('0x2d')][_0xa5cb('0x3b')]){_0x44848d[_0xa5cb('0x3c')]=[{'all':!![]}];}_0x44848d=_['merge']({},_0x44848d,_0x3bc1e5['options']);return db['Dynamics365Field'][_0xa5cb('0x43')](_0x44848d)[_0xa5cb('0x3a')](handleEntityNotFound(_0x5e5b32,null))['then'](respondWithResult(_0x5e5b32,null))[_0xa5cb('0x3f')](handleError(_0x5e5b32,null));};exports[_0xa5cb('0x44')]=function(_0x534458,_0x268239){return db['Dynamics365Field'][_0xa5cb('0x44')](_0x534458[_0xa5cb('0x45')],{})[_0xa5cb('0x3a')](respondWithResult(_0x268239,0xc9))[_0xa5cb('0x3f')](handleError(_0x268239,null));};exports[_0xa5cb('0x22')]=function(_0x5de08f,_0xa9e0d3){if(_0x5de08f['body']['id']){delete _0x5de08f[_0xa5cb('0x45')]['id'];}return db[_0xa5cb('0x39')][_0xa5cb('0x43')]({'where':{'id':_0x5de08f[_0xa5cb('0x41')]['id']}})[_0xa5cb('0x3a')](handleEntityNotFound(_0xa9e0d3,null))['then'](saveUpdates(_0x5de08f[_0xa5cb('0x45')],null))[_0xa5cb('0x3a')](respondWithResult(_0xa9e0d3,null))['catch'](handleError(_0xa9e0d3,null));};exports[_0xa5cb('0x46')]=function(_0x47f04c,_0x4b7138){return db[_0xa5cb('0x39')][_0xa5cb('0x43')]({'where':{'id':_0x47f04c['params']['id']}})[_0xa5cb('0x3a')](handleEntityNotFound(_0x4b7138,null))[_0xa5cb('0x3a')](removeEntity(_0x4b7138,null))[_0xa5cb('0x3f')](handleError(_0x4b7138,null));};
\ No newline at end of file
index 3121dc3..261e2be 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc6f6=['exports','define','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index','idField','FieldId','lodash','util','../../config/logger','request-promise','../../config/environment'];(function(_0x1ad1ae,_0x8cbf26){var _0x3afc51=function(_0x205664){while(--_0x205664){_0x1ad1ae['push'](_0x1ad1ae['shift']());}};_0x3afc51(++_0x8cbf26);}(_0xc6f6,0x16f));var _0x6c6f=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xc6f6[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x6c6f('0x0'));var util=require(_0x6c6f('0x1'));var logger=require(_0x6c6f('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6c6f('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x6c6f('0x4'));var attributes=require('./intDynamics365Field.attributes');module[_0x6c6f('0x5')]=function(_0x47464b,_0x52b250){return _0x47464b[_0x6c6f('0x6')](_0x6c6f('0x7'),attributes,{'tableName':_0x6c6f('0x8'),'paranoid':![],'indexes':[{'name':_0x6c6f('0x9'),'fields':[_0x6c6f('0xa'),_0x6c6f('0xb')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x08fe=['../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./intDynamics365Field.attributes','define','Dynamics365Field','dynamics365_unique_index','idField','FieldId','util'];(function(_0x517641,_0x1ebc8e){var _0x2a5de4=function(_0x4581c2){while(--_0x4581c2){_0x517641['push'](_0x517641['shift']());}};_0x2a5de4(++_0x1ebc8e);}(_0x08fe,0xcf));var _0xe08f=function(_0x45d80c,_0x35c0ff){_0x45d80c=_0x45d80c-0x0;var _0x449a98=_0x08fe[_0x45d80c];return _0x449a98;};'use strict';var _=require('lodash');var util=require(_0xe08f('0x0'));var logger=require(_0xe08f('0x1'))('api');var moment=require(_0xe08f('0x2'));var BPromise=require('bluebird');var rp=require(_0xe08f('0x3'));var fs=require('fs');var path=require(_0xe08f('0x4'));var rimraf=require(_0xe08f('0x5'));var config=require(_0xe08f('0x6'));var attributes=require(_0xe08f('0x7'));module['exports']=function(_0x3c378a,_0x17dea4){return _0x3c378a[_0xe08f('0x8')](_0xe08f('0x9'),attributes,{'tableName':'int_dynamics365_fields','paranoid':![],'indexes':[{'name':_0xe08f('0xa'),'fields':[_0xe08f('0xb'),_0xe08f('0xc')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 5d9510c..d2263c9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2621=['request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','code','Dynamics365Field,\x20%s,\x20%s','message','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info'];(function(_0x7803e9,_0x12def6){var _0x12c5d5=function(_0x4cbee2){while(--_0x4cbee2){_0x7803e9['push'](_0x7803e9['shift']());}};_0x12c5d5(++_0x12def6);}(_0x2621,0x126));var _0x1262=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2621[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x1262('0x0'));var util=require(_0x1262('0x1'));var moment=require(_0x1262('0x2'));var BPromise=require(_0x1262('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1262('0x4'));var db=require(_0x1262('0x5'))['db'];var utils=require(_0x1262('0x6'));var logger=require(_0x1262('0x7'))(_0x1262('0x8'));var config=require('../../config/environment');var jayson=require(_0x1262('0x9'));var client=jayson[_0x1262('0xa')][_0x1262('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x226890,_0x4ba92a,_0x44544d){return new BPromise(function(_0x3a8555,_0x3fcbc4){return client[_0x1262('0xc')](_0x226890,_0x44544d)['then'](function(_0x504b45){logger[_0x1262('0xd')]('Dynamics365Field,\x20%s,\x20%s',_0x4ba92a,_0x1262('0xe'));logger[_0x1262('0xf')](_0x1262('0x10'),_0x4ba92a,_0x1262('0xe'),JSON[_0x1262('0x11')](_0x504b45));if(_0x504b45[_0x1262('0x12')]){if(_0x504b45[_0x1262('0x12')][_0x1262('0x13')]===0x1f4){logger['error'](_0x1262('0x14'),_0x4ba92a,_0x504b45['error'][_0x1262('0x15')]);return _0x3fcbc4(_0x504b45['error'][_0x1262('0x15')]);}logger[_0x1262('0x12')](_0x1262('0x14'),_0x4ba92a,_0x504b45[_0x1262('0x12')]['message']);return _0x3a8555(_0x504b45[_0x1262('0x12')]['message']);}else{logger[_0x1262('0xd')](_0x1262('0x14'),_0x4ba92a,'request\x20sent');_0x3a8555(_0x504b45['result'][_0x1262('0x15')]);}})['catch'](function(_0x1dff88){logger[_0x1262('0x12')]('Dynamics365Field,\x20%s,\x20%s',_0x4ba92a,_0x1dff88);_0x3fcbc4(_0x1dff88);});});}
\ No newline at end of file
+var _0xf1a9=['Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','client','request','then','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x1e8b1e,_0x407bbd){var _0x4a0fde=function(_0x4fd2be){while(--_0x4fd2be){_0x1e8b1e['push'](_0x1e8b1e['shift']());}};_0x4a0fde(++_0x407bbd);}(_0xf1a9,0x1e7));var _0x9f1a=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xf1a9[_0x297fd3];return _0x2af381;};'use strict';var _=require(_0x9f1a('0x0'));var util=require(_0x9f1a('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x9f1a('0x2'));var fs=require('fs');var Redis=require(_0x9f1a('0x3'));var db=require(_0x9f1a('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x9f1a('0x5'));var config=require('../../config/environment');var jayson=require(_0x9f1a('0x6'));var client=jayson[_0x9f1a('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x31ad56,_0x45a5d8,_0x368e7c){return new BPromise(function(_0x13a0fd,_0x40942d){return client[_0x9f1a('0x8')](_0x31ad56,_0x368e7c)[_0x9f1a('0x9')](function(_0x2fc169){logger['info'](_0x9f1a('0xa'),_0x45a5d8,_0x9f1a('0xb'));logger[_0x9f1a('0xc')](_0x9f1a('0xd'),_0x45a5d8,'request\x20sent',JSON[_0x9f1a('0xe')](_0x2fc169));if(_0x2fc169[_0x9f1a('0xf')]){if(_0x2fc169[_0x9f1a('0xf')]['code']===0x1f4){logger['error'](_0x9f1a('0xa'),_0x45a5d8,_0x2fc169[_0x9f1a('0xf')][_0x9f1a('0x10')]);return _0x40942d(_0x2fc169[_0x9f1a('0xf')]['message']);}logger[_0x9f1a('0xf')](_0x9f1a('0xa'),_0x45a5d8,_0x2fc169['error'][_0x9f1a('0x10')]);return _0x13a0fd(_0x2fc169[_0x9f1a('0xf')][_0x9f1a('0x10')]);}else{logger[_0x9f1a('0x11')](_0x9f1a('0xa'),_0x45a5d8,_0x9f1a('0xb'));_0x13a0fd(_0x2fc169[_0x9f1a('0x12')]['message']);}})[_0x9f1a('0x13')](function(_0x427901){logger['error']('Dynamics365Field,\x20%s,\x20%s',_0x45a5d8,_0x427901);_0x40942d(_0x427901);});});}
\ No newline at end of file
index 92674c9..cc540a4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x88f1=['/:id','update','delete','destroy','exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./intFreshdeskAccount.controller','get','isAuthenticated','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put'];(function(_0x140327,_0x4ff244){var _0x46f126=function(_0x36568c){while(--_0x36568c){_0x140327['push'](_0x140327['shift']());}};_0x46f126(++_0x4ff244);}(_0x88f1,0x9f));var _0x188f=function(_0x58e14e,_0x23e92c){_0x58e14e=_0x58e14e-0x0;var _0x127788=_0x88f1[_0x58e14e];return _0x127788;};'use strict';var multer=require('multer');var util=require(_0x188f('0x0'));var path=require(_0x188f('0x1'));var timeout=require('connect-timeout');var express=require(_0x188f('0x2'));var router=express[_0x188f('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x188f('0x4'));var interaction=require(_0x188f('0x5'));var config=require('../../config/environment');var controller=require(_0x188f('0x6'));router[_0x188f('0x7')]('/',auth[_0x188f('0x8')](),controller['index']);router[_0x188f('0x7')]('/:id',auth[_0x188f('0x8')](),controller['show']);router[_0x188f('0x7')](_0x188f('0x9'),auth['isAuthenticated'](),controller[_0x188f('0xa')]);router[_0x188f('0x7')](_0x188f('0xb'),auth['isAuthenticated'](),controller[_0x188f('0xc')]);router[_0x188f('0xd')]('/',auth[_0x188f('0x8')](),controller[_0x188f('0xe')]);router[_0x188f('0xd')](_0x188f('0x9'),auth[_0x188f('0x8')](),controller[_0x188f('0xf')]);router[_0x188f('0x10')](_0x188f('0x11'),auth[_0x188f('0x8')](),controller[_0x188f('0x12')]);router[_0x188f('0x13')](_0x188f('0x11'),auth['isAuthenticated'](),controller[_0x188f('0x14')]);module[_0x188f('0x15')]=router;
\ No newline at end of file
+var _0x752d=['util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','getFields','post','create','addConfiguration','update','delete','exports','multer'];(function(_0x230f48,_0x3734dd){var _0x15d00f=function(_0x4faf44){while(--_0x4faf44){_0x230f48['push'](_0x230f48['shift']());}};_0x15d00f(++_0x3734dd);}(_0x752d,0x8f));var _0xd752=function(_0x587497,_0x27c8af){_0x587497=_0x587497-0x0;var _0x21c65c=_0x752d[_0x587497];return _0x21c65c;};'use strict';var multer=require(_0xd752('0x0'));var util=require(_0xd752('0x1'));var path=require(_0xd752('0x2'));var timeout=require('connect-timeout');var express=require(_0xd752('0x3'));var router=express[_0xd752('0x4')]();var fs_extra=require(_0xd752('0x5'));var auth=require(_0xd752('0x6'));var interaction=require(_0xd752('0x7'));var config=require(_0xd752('0x8'));var controller=require(_0xd752('0x9'));router[_0xd752('0xa')]('/',auth[_0xd752('0xb')](),controller[_0xd752('0xc')]);router['get'](_0xd752('0xd'),auth[_0xd752('0xb')](),controller[_0xd752('0xe')]);router[_0xd752('0xa')](_0xd752('0xf'),auth[_0xd752('0xb')](),controller[_0xd752('0x10')]);router['get']('/:id/fields',auth[_0xd752('0xb')](),controller[_0xd752('0x11')]);router[_0xd752('0x12')]('/',auth[_0xd752('0xb')](),controller[_0xd752('0x13')]);router[_0xd752('0x12')]('/:id/configurations',auth[_0xd752('0xb')](),controller[_0xd752('0x14')]);router['put'](_0xd752('0xd'),auth[_0xd752('0xb')](),controller[_0xd752('0x15')]);router[_0xd752('0x16')](_0xd752('0xd'),auth[_0xd752('0xb')](),controller['destroy']);module[_0xd752('0x17')]=router;
\ No newline at end of file
index 7705f50..3de8fed 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4137=['STRING','username','remoteUri','sequelize','exports'];(function(_0x2087ac,_0x1efeeb){var _0x5958d3=function(_0x1c94cb){while(--_0x1c94cb){_0x2087ac['push'](_0x2087ac['shift']());}};_0x5958d3(++_0x1efeeb);}(_0x4137,0xf8));var _0x7413=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x4137[_0x27af45];return _0x18df21;};'use strict';var Sequelize=require(_0x7413('0x0'));module[_0x7413('0x1')]={'name':{'type':Sequelize[_0x7413('0x2')]},'description':{'type':Sequelize[_0x7413('0x2')]},'username':{'type':Sequelize[_0x7413('0x2')],'unique':_0x7413('0x3')},'apiKey':{'type':Sequelize[_0x7413('0x2')]},'remoteUri':{'type':Sequelize[_0x7413('0x2')],'unique':_0x7413('0x4')},'serverUrl':{'type':Sequelize[_0x7413('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0x056b=['username','remoteUri','exports','STRING'];(function(_0x2fd9d5,_0x2017bd){var _0x3b4276=function(_0x929d64){while(--_0x929d64){_0x2fd9d5['push'](_0x2fd9d5['shift']());}};_0x3b4276(++_0x2017bd);}(_0x056b,0xb6));var _0xb056=function(_0x3fa29a,_0x218173){_0x3fa29a=_0x3fa29a-0x0;var _0x4486d8=_0x056b[_0x3fa29a];return _0x4486d8;};'use strict';var Sequelize=require('sequelize');module[_0xb056('0x0')]={'name':{'type':Sequelize[_0xb056('0x1')]},'description':{'type':Sequelize[_0xb056('0x1')]},'username':{'type':Sequelize[_0xb056('0x1')],'unique':_0xb056('0x2')},'apiKey':{'type':Sequelize[_0xb056('0x1')]},'remoteUri':{'type':Sequelize[_0xb056('0x1')],'unique':_0xb056('0x3')},'serverUrl':{'type':Sequelize[_0xb056('0x1')],'allowNull':![]}};
\ No newline at end of file
index 04ee018..bcefc0c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x263f=['merge','type','options','findAll','rows','catch','show','params','include','find','create','body','getConfigurations','FreshdeskConfiguration','addConfiguration','findOne','Subjects','getSubjects','channel','getDescriptions','FreshdeskField','Descriptions','getFields','remoteUri','apiKey','slice','lastIndexOf','GET','%s/%s','api/v2/ticket_fields','format','toString','base64','requester','subject','description','priority','group','source','ticket_type','includes','default','custom_text','custom_dropdown','label','choices','statusCode','send','test','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','error','name','index','map','FreshdeskAccount','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter'];(function(_0x41cf13,_0xc58ad9){var _0x549962=function(_0x32a732){while(--_0x32a732){_0x41cf13['push'](_0x41cf13['shift']());}};_0x549962(++_0xc58ad9);}(_0x263f,0x182));var _0xf263=function(_0x59656b,_0x221208){_0x59656b=_0x59656b-0x0;var _0x5ba4d3=_0x263f[_0x59656b];return _0x5ba4d3;};'use strict';var emlformat=require(_0xf263('0x0'));var rimraf=require(_0xf263('0x1'));var zipdir=require(_0xf263('0x2'));var jsonpatch=require(_0xf263('0x3'));var rp=require(_0xf263('0x4'));var moment=require(_0xf263('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xf263('0x6'));var util=require(_0xf263('0x7'));var path=require(_0xf263('0x8'));var sox=require('sox');var csv=require(_0xf263('0x9'));var ejs=require(_0xf263('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xf263('0xb'));var crypto=require(_0xf263('0xc'));var jsforce=require(_0xf263('0xd'));var deskjs=require(_0xf263('0xe'));var toCsv=require('to-csv');var querystring=require(_0xf263('0xf'));var Papa=require(_0xf263('0x10'));var Redis=require(_0xf263('0x11'));var authService=require(_0xf263('0x12'));var qs=require(_0xf263('0x13'));var as=require(_0xf263('0x14'));var hardwareService=require(_0xf263('0x15'));var logger=require('../../config/logger')(_0xf263('0x16'));var utils=require('../../config/utils');var config=require(_0xf263('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0xf263('0x18'));function respondWithStatusCode(_0x2b1145,_0x17471d){_0x17471d=_0x17471d||0xcc;return function(_0xd7a907){if(_0xd7a907){return _0x2b1145[_0xf263('0x19')](_0x17471d);}return _0x2b1145[_0xf263('0x1a')](_0x17471d)[_0xf263('0x1b')]();};}function respondWithResult(_0x559c6c,_0x2f40d8){_0x2f40d8=_0x2f40d8||0xc8;return function(_0x497311){if(_0x497311){return _0x559c6c[_0xf263('0x1a')](_0x2f40d8)[_0xf263('0x1c')](_0x497311);}};}function respondWithFilteredResult(_0x3ac432,_0x402739){return function(_0x16b4dd){if(_0x16b4dd){var _0xf45ebe=typeof _0x402739[_0xf263('0x1d')]==='undefined'&&typeof _0x402739['limit']===_0xf263('0x1e');var _0x423ce6=_0x16b4dd[_0xf263('0x1f')];var _0x2e660e=_0xf45ebe?0x0:_0x402739[_0xf263('0x1d')];var _0x56bd2d=_0xf45ebe?_0x16b4dd[_0xf263('0x1f')]:_0x402739['offset']+_0x402739[_0xf263('0x20')];var _0x22e399;if(_0x56bd2d>=_0x423ce6){_0x56bd2d=_0x423ce6;_0x22e399=0xc8;}else{_0x22e399=0xce;}_0x3ac432[_0xf263('0x1a')](_0x22e399);return _0x3ac432['set'](_0xf263('0x21'),_0x2e660e+'-'+_0x56bd2d+'/'+_0x423ce6)[_0xf263('0x1c')](_0x16b4dd);}return null;};}function patchUpdates(_0x127135){return function(_0x51be84){try{jsonpatch[_0xf263('0x22')](_0x51be84,_0x127135,!![]);}catch(_0x4202d1){return BPromise[_0xf263('0x23')](_0x4202d1);}return _0x51be84[_0xf263('0x24')]();};}function saveUpdates(_0xa0695,_0x2c0996){return function(_0x43cb61){if(_0x43cb61){return _0x43cb61[_0xf263('0x25')](_0xa0695)[_0xf263('0x26')](function(_0xe32b07){return _0xe32b07;});}return null;};}function removeEntity(_0x29eb45,_0x4de045){return function(_0x54f4e4){if(_0x54f4e4){return _0x54f4e4['destroy']()[_0xf263('0x26')](function(){_0x29eb45[_0xf263('0x1a')](0xcc)[_0xf263('0x1b')]();});}};}function handleEntityNotFound(_0x1b3603,_0x36df8e){return function(_0x3a9390){if(!_0x3a9390){_0x1b3603[_0xf263('0x19')](0x194);}return _0x3a9390;};}function handleError(_0x41fab2,_0x3c44f1){_0x3c44f1=_0x3c44f1||0x1f4;return function(_0xbeabe5){logger[_0xf263('0x27')](_0xbeabe5['stack']);if(_0xbeabe5[_0xf263('0x28')]){delete _0xbeabe5['name'];}_0x41fab2[_0xf263('0x1a')](_0x3c44f1)['send'](_0xbeabe5);};}exports[_0xf263('0x29')]=function(_0x3500b2,_0x5a11bf){var _0x57ae2f={},_0x43f306={},_0x339b3b={'count':0x0,'rows':[]};var _0x2dcebc=_[_0xf263('0x2a')](db[_0xf263('0x2b')][_0xf263('0x2c')],function(_0x3caa96){return{'name':_0x3caa96[_0xf263('0x2d')],'type':_0x3caa96['type'][_0xf263('0x2e')]};});_0x43f306[_0xf263('0x2f')]=_[_0xf263('0x2a')](_0x2dcebc,_0xf263('0x28'));_0x43f306[_0xf263('0x30')]=_[_0xf263('0x31')](_0x3500b2[_0xf263('0x30')]);_0x43f306[_0xf263('0x32')]=_[_0xf263('0x33')](_0x43f306['model'],_0x43f306[_0xf263('0x30')]);_0x57ae2f['attributes']=_['intersection'](_0x43f306[_0xf263('0x2f')],qs[_0xf263('0x34')](_0x3500b2['query'][_0xf263('0x34')]));_0x57ae2f[_0xf263('0x35')]=_0x57ae2f['attributes'][_0xf263('0x36')]?_0x57ae2f[_0xf263('0x35')]:_0x43f306[_0xf263('0x2f')];if(!_0x3500b2[_0xf263('0x30')][_0xf263('0x37')](_0xf263('0x38'))){_0x57ae2f['limit']=qs[_0xf263('0x20')](_0x3500b2[_0xf263('0x30')]['limit']);_0x57ae2f['offset']=qs[_0xf263('0x1d')](_0x3500b2[_0xf263('0x30')][_0xf263('0x1d')]);}_0x57ae2f[_0xf263('0x39')]=qs['sort'](_0x3500b2[_0xf263('0x30')][_0xf263('0x3a')]);_0x57ae2f[_0xf263('0x3b')]=qs[_0xf263('0x32')](_[_0xf263('0x3c')](_0x3500b2['query'],_0x43f306[_0xf263('0x32')]),_0x2dcebc);if(_0x3500b2[_0xf263('0x30')][_0xf263('0x3d')]){_0x57ae2f['where']=_[_0xf263('0x3e')](_0x57ae2f[_0xf263('0x3b')],{'$or':_[_0xf263('0x2a')](_0x2dcebc,function(_0x2a2b37){if(_0x2a2b37[_0xf263('0x3f')]!=='VIRTUAL'){var _0x288c61={};_0x288c61[_0x2a2b37[_0xf263('0x28')]]={'$like':'%'+_0x3500b2[_0xf263('0x30')]['filter']+'%'};return _0x288c61;}})});}_0x57ae2f=_[_0xf263('0x3e')]({},_0x57ae2f,_0x3500b2[_0xf263('0x40')]);var _0xfbe2b1={'where':_0x57ae2f['where']};return db[_0xf263('0x2b')]['count'](_0xfbe2b1)[_0xf263('0x26')](function(_0x2861ba){_0x339b3b[_0xf263('0x1f')]=_0x2861ba;if(_0x3500b2['query']['includeAll']){_0x57ae2f['include']=[{'all':!![]}];}return db[_0xf263('0x2b')][_0xf263('0x41')](_0x57ae2f);})['then'](function(_0x5e33ba){_0x339b3b[_0xf263('0x42')]=_0x5e33ba;return _0x339b3b;})[_0xf263('0x26')](respondWithFilteredResult(_0x5a11bf,_0x57ae2f))[_0xf263('0x43')](handleError(_0x5a11bf,null));};exports[_0xf263('0x44')]=function(_0x1bc12a,_0x54d8e4){var _0x1577c9={'raw':![],'where':{'id':_0x1bc12a[_0xf263('0x45')]['id']}},_0x338646={};_0x338646[_0xf263('0x2f')]=_[_0xf263('0x31')](db['FreshdeskAccount'][_0xf263('0x2c')]);_0x338646[_0xf263('0x30')]=_[_0xf263('0x31')](_0x1bc12a['query']);_0x338646['filters']=_[_0xf263('0x33')](_0x338646['model'],_0x338646['query']);_0x1577c9[_0xf263('0x35')]=_[_0xf263('0x33')](_0x338646[_0xf263('0x2f')],qs['fields'](_0x1bc12a[_0xf263('0x30')][_0xf263('0x34')]));_0x1577c9['attributes']=_0x1577c9[_0xf263('0x35')][_0xf263('0x36')]?_0x1577c9['attributes']:_0x338646[_0xf263('0x2f')];if(_0x1bc12a[_0xf263('0x30')]['includeAll']){_0x1577c9[_0xf263('0x46')]=[{'all':!![]}];}_0x1577c9=_[_0xf263('0x3e')]({},_0x1577c9,_0x1bc12a[_0xf263('0x40')]);return db[_0xf263('0x2b')][_0xf263('0x47')](_0x1577c9)[_0xf263('0x26')](handleEntityNotFound(_0x54d8e4,null))[_0xf263('0x26')](respondWithResult(_0x54d8e4,null))['catch'](handleError(_0x54d8e4,null));};exports[_0xf263('0x48')]=function(_0x2e8cbe,_0x19e09c){return db[_0xf263('0x2b')][_0xf263('0x48')](_0x2e8cbe[_0xf263('0x49')],{})[_0xf263('0x26')](respondWithResult(_0x19e09c,0xc9))[_0xf263('0x43')](handleError(_0x19e09c,null));};exports['update']=function(_0x8993f7,_0x227ece){if(_0x8993f7[_0xf263('0x49')]['id']){delete _0x8993f7[_0xf263('0x49')]['id'];}return db['FreshdeskAccount'][_0xf263('0x47')]({'where':{'id':_0x8993f7['params']['id']}})[_0xf263('0x26')](handleEntityNotFound(_0x227ece,null))[_0xf263('0x26')](saveUpdates(_0x8993f7[_0xf263('0x49')],null))['then'](respondWithResult(_0x227ece,null))['catch'](handleError(_0x227ece,null));};exports['destroy']=function(_0x4f5578,_0x56e9a3){return db[_0xf263('0x2b')][_0xf263('0x47')]({'where':{'id':_0x4f5578['params']['id']}})[_0xf263('0x26')](handleEntityNotFound(_0x56e9a3,null))[_0xf263('0x26')](removeEntity(_0x56e9a3,null))[_0xf263('0x43')](handleError(_0x56e9a3,null));};exports[_0xf263('0x4a')]=function(_0x662aa0,_0x1a5ab4,_0x365925){var _0x3bc40a={};var _0x34afc5={};var _0x28fb58;var _0x12c84f;return db[_0xf263('0x2b')]['findOne']({'where':{'id':_0x662aa0[_0xf263('0x45')]['id']}})['then'](handleEntityNotFound(_0x1a5ab4,null))['then'](function(_0x33b837){if(_0x33b837){_0x28fb58=_0x33b837;_0x34afc5['model']=_['keys'](db[_0xf263('0x4b')][_0xf263('0x2c')]);_0x34afc5['query']=_[_0xf263('0x31')](_0x662aa0['query']);_0x34afc5[_0xf263('0x32')]=_[_0xf263('0x33')](_0x34afc5['model'],_0x34afc5[_0xf263('0x30')]);_0x3bc40a[_0xf263('0x35')]=_['intersection'](_0x34afc5[_0xf263('0x2f')],qs['fields'](_0x662aa0[_0xf263('0x30')][_0xf263('0x34')]));_0x3bc40a[_0xf263('0x35')]=_0x3bc40a[_0xf263('0x35')][_0xf263('0x36')]?_0x3bc40a[_0xf263('0x35')]:_0x34afc5[_0xf263('0x2f')];_0x3bc40a[_0xf263('0x39')]=qs[_0xf263('0x3a')](_0x662aa0[_0xf263('0x30')][_0xf263('0x3a')]);_0x3bc40a[_0xf263('0x3b')]=qs[_0xf263('0x32')](_[_0xf263('0x3c')](_0x662aa0['query'],_0x34afc5['filters']));if(_0x662aa0[_0xf263('0x30')]['filter']){_0x3bc40a[_0xf263('0x3b')]=_[_0xf263('0x3e')](_0x3bc40a[_0xf263('0x3b')],{'$or':_[_0xf263('0x2a')](_0x3bc40a[_0xf263('0x35')],function(_0x6423f9){var _0x22285e={};_0x22285e[_0x6423f9]={'$like':'%'+_0x662aa0[_0xf263('0x30')]['filter']+'%'};return _0x22285e;})});}_0x3bc40a=_[_0xf263('0x3e')]({},_0x3bc40a,_0x662aa0[_0xf263('0x40')]);return _0x28fb58[_0xf263('0x4a')](_0x3bc40a);}})[_0xf263('0x26')](function(_0x99714d){if(_0x99714d){_0x12c84f=_0x99714d['length'];if(!_0x662aa0[_0xf263('0x30')]['hasOwnProperty'](_0xf263('0x38'))){_0x3bc40a['limit']=qs[_0xf263('0x20')](_0x662aa0[_0xf263('0x30')]['limit']);_0x3bc40a[_0xf263('0x1d')]=qs[_0xf263('0x1d')](_0x662aa0[_0xf263('0x30')][_0xf263('0x1d')]);}return _0x28fb58['getConfigurations'](_0x3bc40a);}})['then'](function(_0x41f4f1){if(_0x41f4f1){return _0x41f4f1?{'count':_0x12c84f,'rows':_0x41f4f1}:null;}})[_0xf263('0x26')](respondWithResult(_0x1a5ab4,null))[_0xf263('0x43')](handleError(_0x1a5ab4,null));};exports[_0xf263('0x4c')]=function(_0x8f88d0,_0x168225,_0x4dc071){if(_0x8f88d0['body']['id']){delete _0x8f88d0['body']['id'];}return db['FreshdeskAccount'][_0xf263('0x4d')]({'where':{'id':_0x8f88d0[_0xf263('0x45')]['id']}})['then'](handleEntityNotFound(_0x168225,null))[_0xf263('0x26')](function(_0x2a88d8){if(_0x2a88d8){_0x8f88d0[_0xf263('0x49')]['AccountId']=_0x2a88d8['id'];_0x8f88d0[_0xf263('0x49')][_0xf263('0x4e')]=integrations[_0xf263('0x4f')](_0x8f88d0[_0xf263('0x49')][_0xf263('0x50')],_0x8f88d0[_0xf263('0x49')][_0xf263('0x3f')]);_0x8f88d0[_0xf263('0x49')]['Descriptions']=integrations[_0xf263('0x51')](_0x8f88d0[_0xf263('0x49')][_0xf263('0x50')],_0x8f88d0['body'][_0xf263('0x3f')]);return db[_0xf263('0x4b')][_0xf263('0x48')](_0x8f88d0[_0xf263('0x49')],{'include':[{'model':db[_0xf263('0x52')],'as':_0xf263('0x4e')},{'model':db['FreshdeskField'],'as':_0xf263('0x53')}]});}return null;})['then'](respondWithResult(_0x168225,null))[_0xf263('0x43')](handleError(_0x168225,null));};exports[_0xf263('0x54')]=function(_0x291238,_0xae54e5,_0x299e52){var _0x240ad3='';return db[_0xf263('0x2b')][_0xf263('0x4d')]({'where':{'id':_0x291238['params']['id']},'attributes':['id',_0xf263('0x55'),_0xf263('0x56')]})[_0xf263('0x26')](handleEntityNotFound(_0xae54e5,null))['then'](function(_0x393b2d){if(_0x393b2d){_0x240ad3=_0x393b2d['remoteUri'];var _0xa3751c=_0x240ad3[_0xf263('0x57')](-0x1);if(_0xa3751c==='/'){_0x240ad3=_0x240ad3['substring'](0x0,_0x240ad3[_0xf263('0x58')](_0xa3751c));}return rp({'method':_0xf263('0x59'),'uri':util['format'](_0xf263('0x5a'),_0x240ad3,_0xf263('0x5b')),'headers':{'Authorization':util[_0xf263('0x5c')]('Basic\x20%s',new Buffer(util['format']('%s:X',_0x393b2d[_0xf263('0x56')]))[_0xf263('0x5d')](_0xf263('0x5e')))},'json':!![]});}})['then'](function(_0x4b4a42){if(_0x4b4a42){var _0x2dfd3b=[_0xf263('0x5f'),_0xf263('0x60'),'agent',_0xf263('0x61'),'status',_0xf263('0x62'),_0xf263('0x63'),_0xf263('0x64'),_0xf263('0x65'),_0xf263('0x63'),'company'];_['remove'](_0x4b4a42,function(_0x82a7e5){return _0x2dfd3b[_0xf263('0x66')](_0x82a7e5['name'])||!_0x82a7e5[_0xf263('0x67')]&&_0x82a7e5[_0xf263('0x3f')]!==_0xf263('0x68')&&_0x82a7e5[_0xf263('0x3f')]!==_0xf263('0x69');});return{'count':_0x4b4a42[_0xf263('0x36')],'rows':_[_0xf263('0x2a')](_0x4b4a42,function(_0x48e766){return{'id':_0x48e766[_0xf263('0x28')],'name':_0x48e766[_0xf263('0x6a')],'custom':!_0x48e766[_0xf263('0x67')],'options':_0x48e766[_0xf263('0x6b')]?_[_0xf263('0x2a')](_0x48e766['choices'],function(_0x10b1e9){return{'name':_['capitalize'](_0x10b1e9),'value':_0x10b1e9};}):[]};})};}})[_0xf263('0x26')](respondWithResult(_0xae54e5,null))[_0xf263('0x43')](function(_0x342a5f){var _0x35c536=_0x291238[_0xf263('0x30')]['test']?0x1f4:_0x342a5f[_0xf263('0x6c')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x35c536,JSON['stringify'](_0x342a5f));delete _0x342a5f[_0xf263('0x28')];if(_0x35c536===0x191){_0x35c536=0x190;}_0xae54e5[_0xf263('0x1a')](_0x35c536)[_0xf263('0x6d')](_0x291238[_0xf263('0x30')][_0xf263('0x6e')]?{'message':_0xf263('0x6f'),'statusCode':_0x342a5f[_0xf263('0x6c')]}:_0x342a5f);});};
\ No newline at end of file
+var _0xab23=['path','sox','fs-extra','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','limit','Content-Range','json','apply','reject','save','update','then','destroy','error','name','send','index','type','key','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','FreshdeskAccount','includeAll','include','findAll','rows','catch','show','params','model','keys','rawAttributes','options','find','create','body','getConfigurations','findOne','FreshdeskConfiguration','order','addConfiguration','AccountId','Subjects','Descriptions','getDescriptions','FreshdeskField','getFields','slice','substring','lastIndexOf','GET','format','%s/%s','%s:X','base64','requester','subject','agent','description','priority','source','ticket_type','group','includes','default','custom_dropdown','label','choices','capitalize','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util'];(function(_0x19a9fa,_0x174540){var _0x40a47f=function(_0x340721){while(--_0x340721){_0x19a9fa['push'](_0x19a9fa['shift']());}};_0x40a47f(++_0x174540);}(_0xab23,0x1bc));var _0x3ab2=function(_0x41c3f6,_0x3729c4){_0x41c3f6=_0x41c3f6-0x0;var _0x99ef9=_0xab23[_0x41c3f6];return _0x99ef9;};'use strict';var emlformat=require(_0x3ab2('0x0'));var rimraf=require(_0x3ab2('0x1'));var zipdir=require(_0x3ab2('0x2'));var jsonpatch=require(_0x3ab2('0x3'));var rp=require(_0x3ab2('0x4'));var moment=require(_0x3ab2('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x3ab2('0x6'));var util=require(_0x3ab2('0x7'));var path=require(_0x3ab2('0x8'));var sox=require(_0x3ab2('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3ab2('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x3ab2('0xb'));var jsforce=require(_0x3ab2('0xc'));var deskjs=require(_0x3ab2('0xd'));var toCsv=require(_0x3ab2('0xe'));var querystring=require(_0x3ab2('0xf'));var Papa=require(_0x3ab2('0x10'));var Redis=require(_0x3ab2('0x11'));var authService=require(_0x3ab2('0x12'));var qs=require(_0x3ab2('0x13'));var as=require(_0x3ab2('0x14'));var hardwareService=require(_0x3ab2('0x15'));var logger=require('../../config/logger')(_0x3ab2('0x16'));var utils=require(_0x3ab2('0x17'));var config=require(_0x3ab2('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0x3ab2('0x19'));function respondWithStatusCode(_0x2ec0e3,_0x1f967a){_0x1f967a=_0x1f967a||0xcc;return function(_0x42d017){if(_0x42d017){return _0x2ec0e3[_0x3ab2('0x1a')](_0x1f967a);}return _0x2ec0e3[_0x3ab2('0x1b')](_0x1f967a)[_0x3ab2('0x1c')]();};}function respondWithResult(_0x101769,_0x11d439){_0x11d439=_0x11d439||0xc8;return function(_0x4eecd3){if(_0x4eecd3){return _0x101769[_0x3ab2('0x1b')](_0x11d439)['json'](_0x4eecd3);}};}function respondWithFilteredResult(_0x1e4e9c,_0x458f08){return function(_0x5c152c){if(_0x5c152c){var _0x560437=typeof _0x458f08[_0x3ab2('0x1d')]===_0x3ab2('0x1e')&&typeof _0x458f08[_0x3ab2('0x1f')]===_0x3ab2('0x1e');var _0x170506=_0x5c152c['count'];var _0x4d129b=_0x560437?0x0:_0x458f08[_0x3ab2('0x1d')];var _0x1efcb9=_0x560437?_0x5c152c['count']:_0x458f08[_0x3ab2('0x1d')]+_0x458f08[_0x3ab2('0x1f')];var _0x192f94;if(_0x1efcb9>=_0x170506){_0x1efcb9=_0x170506;_0x192f94=0xc8;}else{_0x192f94=0xce;}_0x1e4e9c[_0x3ab2('0x1b')](_0x192f94);return _0x1e4e9c['set'](_0x3ab2('0x20'),_0x4d129b+'-'+_0x1efcb9+'/'+_0x170506)[_0x3ab2('0x21')](_0x5c152c);}return null;};}function patchUpdates(_0x16d0b2){return function(_0x143bfe){try{jsonpatch[_0x3ab2('0x22')](_0x143bfe,_0x16d0b2,!![]);}catch(_0xed8423){return BPromise[_0x3ab2('0x23')](_0xed8423);}return _0x143bfe[_0x3ab2('0x24')]();};}function saveUpdates(_0x5dbfdc,_0x186853){return function(_0x4e702d){if(_0x4e702d){return _0x4e702d[_0x3ab2('0x25')](_0x5dbfdc)[_0x3ab2('0x26')](function(_0x299a78){return _0x299a78;});}return null;};}function removeEntity(_0x53bbcc,_0x436433){return function(_0x3b05dd){if(_0x3b05dd){return _0x3b05dd[_0x3ab2('0x27')]()[_0x3ab2('0x26')](function(){_0x53bbcc[_0x3ab2('0x1b')](0xcc)[_0x3ab2('0x1c')]();});}};}function handleEntityNotFound(_0x40422d,_0x3e764a){return function(_0xfdb909){if(!_0xfdb909){_0x40422d[_0x3ab2('0x1a')](0x194);}return _0xfdb909;};}function handleError(_0xbef8f3,_0x393376){_0x393376=_0x393376||0x1f4;return function(_0x533688){logger[_0x3ab2('0x28')](_0x533688['stack']);if(_0x533688[_0x3ab2('0x29')]){delete _0x533688[_0x3ab2('0x29')];}_0xbef8f3[_0x3ab2('0x1b')](_0x393376)[_0x3ab2('0x2a')](_0x533688);};}exports[_0x3ab2('0x2b')]=function(_0x36005a,_0xb3a40e){var _0x5d5f56={},_0x3b7967={},_0x3402f6={'count':0x0,'rows':[]};var _0x2f20e4=_['map'](db['FreshdeskAccount']['rawAttributes'],function(_0x27f666){return{'name':_0x27f666['fieldName'],'type':_0x27f666[_0x3ab2('0x2c')][_0x3ab2('0x2d')]};});_0x3b7967['model']=_[_0x3ab2('0x2e')](_0x2f20e4,_0x3ab2('0x29'));_0x3b7967[_0x3ab2('0x2f')]=_['keys'](_0x36005a[_0x3ab2('0x2f')]);_0x3b7967[_0x3ab2('0x30')]=_[_0x3ab2('0x31')](_0x3b7967['model'],_0x3b7967['query']);_0x5d5f56[_0x3ab2('0x32')]=_[_0x3ab2('0x31')](_0x3b7967['model'],qs['fields'](_0x36005a[_0x3ab2('0x2f')][_0x3ab2('0x33')]));_0x5d5f56[_0x3ab2('0x32')]=_0x5d5f56['attributes'][_0x3ab2('0x34')]?_0x5d5f56[_0x3ab2('0x32')]:_0x3b7967['model'];if(!_0x36005a[_0x3ab2('0x2f')][_0x3ab2('0x35')](_0x3ab2('0x36'))){_0x5d5f56[_0x3ab2('0x1f')]=qs['limit'](_0x36005a[_0x3ab2('0x2f')][_0x3ab2('0x1f')]);_0x5d5f56[_0x3ab2('0x1d')]=qs[_0x3ab2('0x1d')](_0x36005a[_0x3ab2('0x2f')][_0x3ab2('0x1d')]);}_0x5d5f56['order']=qs[_0x3ab2('0x37')](_0x36005a[_0x3ab2('0x2f')][_0x3ab2('0x37')]);_0x5d5f56[_0x3ab2('0x38')]=qs[_0x3ab2('0x30')](_['pick'](_0x36005a[_0x3ab2('0x2f')],_0x3b7967[_0x3ab2('0x30')]),_0x2f20e4);if(_0x36005a['query'][_0x3ab2('0x39')]){_0x5d5f56[_0x3ab2('0x38')]=_[_0x3ab2('0x3a')](_0x5d5f56[_0x3ab2('0x38')],{'$or':_[_0x3ab2('0x2e')](_0x2f20e4,function(_0x569d34){if(_0x569d34[_0x3ab2('0x2c')]!==_0x3ab2('0x3b')){var _0xd0ee49={};_0xd0ee49[_0x569d34[_0x3ab2('0x29')]]={'$like':'%'+_0x36005a[_0x3ab2('0x2f')][_0x3ab2('0x39')]+'%'};return _0xd0ee49;}})});}_0x5d5f56=_[_0x3ab2('0x3a')]({},_0x5d5f56,_0x36005a['options']);var _0x3a5277={'where':_0x5d5f56['where']};return db[_0x3ab2('0x3c')]['count'](_0x3a5277)[_0x3ab2('0x26')](function(_0x41dd27){_0x3402f6['count']=_0x41dd27;if(_0x36005a[_0x3ab2('0x2f')][_0x3ab2('0x3d')]){_0x5d5f56[_0x3ab2('0x3e')]=[{'all':!![]}];}return db[_0x3ab2('0x3c')][_0x3ab2('0x3f')](_0x5d5f56);})[_0x3ab2('0x26')](function(_0x1afe4c){_0x3402f6[_0x3ab2('0x40')]=_0x1afe4c;return _0x3402f6;})[_0x3ab2('0x26')](respondWithFilteredResult(_0xb3a40e,_0x5d5f56))[_0x3ab2('0x41')](handleError(_0xb3a40e,null));};exports[_0x3ab2('0x42')]=function(_0x83b4fc,_0x5e7a25){var _0x127b10={'raw':![],'where':{'id':_0x83b4fc[_0x3ab2('0x43')]['id']}},_0x40f6d8={};_0x40f6d8[_0x3ab2('0x44')]=_[_0x3ab2('0x45')](db[_0x3ab2('0x3c')][_0x3ab2('0x46')]);_0x40f6d8['query']=_[_0x3ab2('0x45')](_0x83b4fc[_0x3ab2('0x2f')]);_0x40f6d8[_0x3ab2('0x30')]=_['intersection'](_0x40f6d8[_0x3ab2('0x44')],_0x40f6d8[_0x3ab2('0x2f')]);_0x127b10[_0x3ab2('0x32')]=_[_0x3ab2('0x31')](_0x40f6d8['model'],qs[_0x3ab2('0x33')](_0x83b4fc[_0x3ab2('0x2f')]['fields']));_0x127b10[_0x3ab2('0x32')]=_0x127b10['attributes'][_0x3ab2('0x34')]?_0x127b10['attributes']:_0x40f6d8[_0x3ab2('0x44')];if(_0x83b4fc[_0x3ab2('0x2f')]['includeAll']){_0x127b10[_0x3ab2('0x3e')]=[{'all':!![]}];}_0x127b10=_[_0x3ab2('0x3a')]({},_0x127b10,_0x83b4fc[_0x3ab2('0x47')]);return db[_0x3ab2('0x3c')][_0x3ab2('0x48')](_0x127b10)[_0x3ab2('0x26')](handleEntityNotFound(_0x5e7a25,null))['then'](respondWithResult(_0x5e7a25,null))[_0x3ab2('0x41')](handleError(_0x5e7a25,null));};exports['create']=function(_0x4b70ee,_0x1aad66){return db[_0x3ab2('0x3c')][_0x3ab2('0x49')](_0x4b70ee[_0x3ab2('0x4a')],{})[_0x3ab2('0x26')](respondWithResult(_0x1aad66,0xc9))[_0x3ab2('0x41')](handleError(_0x1aad66,null));};exports[_0x3ab2('0x25')]=function(_0x586b89,_0x59d980){if(_0x586b89[_0x3ab2('0x4a')]['id']){delete _0x586b89['body']['id'];}return db[_0x3ab2('0x3c')][_0x3ab2('0x48')]({'where':{'id':_0x586b89[_0x3ab2('0x43')]['id']}})[_0x3ab2('0x26')](handleEntityNotFound(_0x59d980,null))[_0x3ab2('0x26')](saveUpdates(_0x586b89[_0x3ab2('0x4a')],null))[_0x3ab2('0x26')](respondWithResult(_0x59d980,null))['catch'](handleError(_0x59d980,null));};exports[_0x3ab2('0x27')]=function(_0x4b658b,_0x28f546){return db[_0x3ab2('0x3c')][_0x3ab2('0x48')]({'where':{'id':_0x4b658b[_0x3ab2('0x43')]['id']}})[_0x3ab2('0x26')](handleEntityNotFound(_0x28f546,null))[_0x3ab2('0x26')](removeEntity(_0x28f546,null))[_0x3ab2('0x41')](handleError(_0x28f546,null));};exports[_0x3ab2('0x4b')]=function(_0x2d4745,_0xdf4c3a,_0x296e26){var _0x31b89e={};var _0x3f688b={};var _0x4bbba8;var _0x1a6e71;return db['FreshdeskAccount'][_0x3ab2('0x4c')]({'where':{'id':_0x2d4745[_0x3ab2('0x43')]['id']}})['then'](handleEntityNotFound(_0xdf4c3a,null))[_0x3ab2('0x26')](function(_0x3fd928){if(_0x3fd928){_0x4bbba8=_0x3fd928;_0x3f688b['model']=_[_0x3ab2('0x45')](db[_0x3ab2('0x4d')][_0x3ab2('0x46')]);_0x3f688b[_0x3ab2('0x2f')]=_[_0x3ab2('0x45')](_0x2d4745[_0x3ab2('0x2f')]);_0x3f688b[_0x3ab2('0x30')]=_[_0x3ab2('0x31')](_0x3f688b[_0x3ab2('0x44')],_0x3f688b[_0x3ab2('0x2f')]);_0x31b89e[_0x3ab2('0x32')]=_[_0x3ab2('0x31')](_0x3f688b[_0x3ab2('0x44')],qs['fields'](_0x2d4745[_0x3ab2('0x2f')][_0x3ab2('0x33')]));_0x31b89e[_0x3ab2('0x32')]=_0x31b89e[_0x3ab2('0x32')][_0x3ab2('0x34')]?_0x31b89e['attributes']:_0x3f688b[_0x3ab2('0x44')];_0x31b89e[_0x3ab2('0x4e')]=qs[_0x3ab2('0x37')](_0x2d4745[_0x3ab2('0x2f')]['sort']);_0x31b89e[_0x3ab2('0x38')]=qs[_0x3ab2('0x30')](_['pick'](_0x2d4745['query'],_0x3f688b[_0x3ab2('0x30')]));if(_0x2d4745[_0x3ab2('0x2f')]['filter']){_0x31b89e['where']=_[_0x3ab2('0x3a')](_0x31b89e['where'],{'$or':_[_0x3ab2('0x2e')](_0x31b89e[_0x3ab2('0x32')],function(_0xd70b68){var _0x5e585d={};_0x5e585d[_0xd70b68]={'$like':'%'+_0x2d4745[_0x3ab2('0x2f')][_0x3ab2('0x39')]+'%'};return _0x5e585d;})});}_0x31b89e=_[_0x3ab2('0x3a')]({},_0x31b89e,_0x2d4745['options']);return _0x4bbba8[_0x3ab2('0x4b')](_0x31b89e);}})[_0x3ab2('0x26')](function(_0x411914){if(_0x411914){_0x1a6e71=_0x411914[_0x3ab2('0x34')];if(!_0x2d4745[_0x3ab2('0x2f')][_0x3ab2('0x35')](_0x3ab2('0x36'))){_0x31b89e[_0x3ab2('0x1f')]=qs['limit'](_0x2d4745['query']['limit']);_0x31b89e[_0x3ab2('0x1d')]=qs[_0x3ab2('0x1d')](_0x2d4745[_0x3ab2('0x2f')][_0x3ab2('0x1d')]);}return _0x4bbba8[_0x3ab2('0x4b')](_0x31b89e);}})[_0x3ab2('0x26')](function(_0xb2e7d2){if(_0xb2e7d2){return _0xb2e7d2?{'count':_0x1a6e71,'rows':_0xb2e7d2}:null;}})[_0x3ab2('0x26')](respondWithResult(_0xdf4c3a,null))[_0x3ab2('0x41')](handleError(_0xdf4c3a,null));};exports[_0x3ab2('0x4f')]=function(_0x50b6ee,_0x9b1249,_0x1af902){if(_0x50b6ee[_0x3ab2('0x4a')]['id']){delete _0x50b6ee[_0x3ab2('0x4a')]['id'];}return db[_0x3ab2('0x3c')][_0x3ab2('0x4c')]({'where':{'id':_0x50b6ee['params']['id']}})[_0x3ab2('0x26')](handleEntityNotFound(_0x9b1249,null))[_0x3ab2('0x26')](function(_0x5ea5e6){if(_0x5ea5e6){_0x50b6ee[_0x3ab2('0x4a')][_0x3ab2('0x50')]=_0x5ea5e6['id'];_0x50b6ee[_0x3ab2('0x4a')][_0x3ab2('0x51')]=integrations['getSubjects'](_0x50b6ee[_0x3ab2('0x4a')]['channel'],_0x50b6ee['body'][_0x3ab2('0x2c')]);_0x50b6ee[_0x3ab2('0x4a')][_0x3ab2('0x52')]=integrations[_0x3ab2('0x53')](_0x50b6ee['body']['channel'],_0x50b6ee[_0x3ab2('0x4a')][_0x3ab2('0x2c')]);return db[_0x3ab2('0x4d')][_0x3ab2('0x49')](_0x50b6ee['body'],{'include':[{'model':db[_0x3ab2('0x54')],'as':_0x3ab2('0x51')},{'model':db[_0x3ab2('0x54')],'as':_0x3ab2('0x52')}]});}return null;})[_0x3ab2('0x26')](respondWithResult(_0x9b1249,null))[_0x3ab2('0x41')](handleError(_0x9b1249,null));};exports[_0x3ab2('0x55')]=function(_0x3c98ca,_0x23df14,_0x392967){var _0x38dbec='';return db[_0x3ab2('0x3c')][_0x3ab2('0x4c')]({'where':{'id':_0x3c98ca[_0x3ab2('0x43')]['id']},'attributes':['id','remoteUri','apiKey']})[_0x3ab2('0x26')](handleEntityNotFound(_0x23df14,null))['then'](function(_0x3ea475){if(_0x3ea475){_0x38dbec=_0x3ea475['remoteUri'];var _0x279253=_0x38dbec[_0x3ab2('0x56')](-0x1);if(_0x279253==='/'){_0x38dbec=_0x38dbec[_0x3ab2('0x57')](0x0,_0x38dbec[_0x3ab2('0x58')](_0x279253));}return rp({'method':_0x3ab2('0x59'),'uri':util[_0x3ab2('0x5a')](_0x3ab2('0x5b'),_0x38dbec,'api/v2/ticket_fields'),'headers':{'Authorization':util[_0x3ab2('0x5a')]('Basic\x20%s',new Buffer(util['format'](_0x3ab2('0x5c'),_0x3ea475['apiKey']))['toString'](_0x3ab2('0x5d')))},'json':!![]});}})[_0x3ab2('0x26')](function(_0x5b646c){if(_0x5b646c){var _0x5305a0=[_0x3ab2('0x5e'),_0x3ab2('0x5f'),_0x3ab2('0x60'),_0x3ab2('0x61'),_0x3ab2('0x1b'),_0x3ab2('0x62'),'group',_0x3ab2('0x63'),_0x3ab2('0x64'),_0x3ab2('0x65'),'company'];_['remove'](_0x5b646c,function(_0x3c302a){return _0x5305a0[_0x3ab2('0x66')](_0x3c302a[_0x3ab2('0x29')])||!_0x3c302a[_0x3ab2('0x67')]&&_0x3c302a[_0x3ab2('0x2c')]!=='custom_text'&&_0x3c302a[_0x3ab2('0x2c')]!==_0x3ab2('0x68');});return{'count':_0x5b646c['length'],'rows':_[_0x3ab2('0x2e')](_0x5b646c,function(_0x56290a){return{'id':_0x56290a[_0x3ab2('0x29')],'name':_0x56290a[_0x3ab2('0x69')],'custom':!_0x56290a['default'],'options':_0x56290a[_0x3ab2('0x6a')]?_[_0x3ab2('0x2e')](_0x56290a[_0x3ab2('0x6a')],function(_0x19da58){return{'name':_[_0x3ab2('0x6b')](_0x19da58),'value':_0x19da58};}):[]};})};}})[_0x3ab2('0x26')](respondWithResult(_0x23df14,null))['catch'](function(_0x407b87){var _0xde806f=_0x3c98ca[_0x3ab2('0x2f')][_0x3ab2('0x6c')]?0x1f4:_0x407b87[_0x3ab2('0x6d')]||0x1f4;logger[_0x3ab2('0x28')](_0x3ab2('0x6e'),_0x3ab2('0x55'),_0xde806f,JSON[_0x3ab2('0x6f')](_0x407b87));delete _0x407b87[_0x3ab2('0x29')];if(_0xde806f===0x191){_0xde806f=0x190;}_0x23df14[_0x3ab2('0x1b')](_0xde806f)[_0x3ab2('0x2a')](_0x3c98ca[_0x3ab2('0x2f')]['test']?{'message':_0x3ab2('0x70'),'statusCode':_0x407b87['statusCode']}:_0x407b87);});};
\ No newline at end of file
index 9cca389..de630c5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb78a=['../../config/logger','api','moment','bluebird','request-promise','rimraf','./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','define','int_freshdesk_accounts','util'];(function(_0x1093f9,_0x468167){var _0x34ed4a=function(_0x231741){while(--_0x231741){_0x1093f9['push'](_0x1093f9['shift']());}};_0x34ed4a(++_0x468167);}(_0xb78a,0x1af));var _0xab78=function(_0xfadccd,_0x290136){_0xfadccd=_0xfadccd-0x0;var _0x482ac4=_0xb78a[_0xfadccd];return _0x482ac4;};'use strict';var _=require('lodash');var util=require(_0xab78('0x0'));var logger=require(_0xab78('0x1'))(_0xab78('0x2'));var moment=require(_0xab78('0x3'));var BPromise=require(_0xab78('0x4'));var rp=require(_0xab78('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xab78('0x6'));var config=require('../../config/environment');var attributes=require(_0xab78('0x7'));var integrations=require(_0xab78('0x8'));module[_0xab78('0x9')]=function(_0x303d13,_0x3e7134){return _0x303d13[_0xab78('0xa')]('FreshdeskAccount',attributes,{'tableName':_0xab78('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xfdd7=['int_freshdesk_accounts','api','moment','request-promise','path','rimraf','../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','define','FreshdeskAccount'];(function(_0x5a7fbc,_0xa081de){var _0xcba0fc=function(_0x4f083b){while(--_0x4f083b){_0x5a7fbc['push'](_0x5a7fbc['shift']());}};_0xcba0fc(++_0xa081de);}(_0xfdd7,0xa9));var _0x7fdd=function(_0x57fd18,_0x590abf){_0x57fd18=_0x57fd18-0x0;var _0x1e7199=_0xfdd7[_0x57fd18];return _0x1e7199;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x7fdd('0x0'));var moment=require(_0x7fdd('0x1'));var BPromise=require('bluebird');var rp=require(_0x7fdd('0x2'));var fs=require('fs');var path=require(_0x7fdd('0x3'));var rimraf=require(_0x7fdd('0x4'));var config=require(_0x7fdd('0x5'));var attributes=require(_0x7fdd('0x6'));var integrations=require(_0x7fdd('0x7'));module[_0x7fdd('0x8')]=function(_0x32f476,_0x49ea87){return _0x32f476[_0x7fdd('0x9')](_0x7fdd('0xa'),attributes,{'tableName':_0x7fdd('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index f335c9d..90e8560 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x074b=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','catch','FreshdeskAccount','findAll','options','raw','where','include','attributes','map','model','GetFreshdeskAccount','stringify','ShowFreshdeskAccount','find','lodash','util','moment'];(function(_0x3adf7a,_0x2dfff3){var _0x48a24d=function(_0x59c955){while(--_0x59c955){_0x3adf7a['push'](_0x3adf7a['shift']());}};_0x48a24d(++_0x2dfff3);}(_0x074b,0x195));var _0xb074=function(_0x4ed09f,_0x401780){_0x4ed09f=_0x4ed09f-0x0;var _0x491cdd=_0x074b[_0x4ed09f];return _0x491cdd;};'use strict';var _=require(_0xb074('0x0'));var util=require(_0xb074('0x1'));var moment=require(_0xb074('0x2'));var BPromise=require(_0xb074('0x3'));var rs=require(_0xb074('0x4'));var fs=require('fs');var Redis=require(_0xb074('0x5'));var db=require(_0xb074('0x6'))['db'];var utils=require(_0xb074('0x7'));var logger=require(_0xb074('0x8'))(_0xb074('0x9'));var config=require('../../config/environment');var jayson=require(_0xb074('0xa'));var client=jayson[_0xb074('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1f8d92,_0x330d20,_0x24515c){return new BPromise(function(_0x542721,_0x16e8ff){return client['request'](_0x1f8d92,_0x24515c)[_0xb074('0xc')](function(_0x27ff21){logger[_0xb074('0xd')](_0xb074('0xe'),_0x330d20,_0xb074('0xf'));logger[_0xb074('0x10')]('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0x330d20,_0xb074('0xf'),JSON['stringify'](_0x27ff21));if(_0x27ff21[_0xb074('0x11')]){if(_0x27ff21[_0xb074('0x11')][_0xb074('0x12')]===0x1f4){logger[_0xb074('0x11')](_0xb074('0xe'),_0x330d20,_0x27ff21[_0xb074('0x11')][_0xb074('0x13')]);return _0x16e8ff(_0x27ff21[_0xb074('0x11')][_0xb074('0x13')]);}logger[_0xb074('0x11')]('FreshdeskAccount,\x20%s,\x20%s',_0x330d20,_0x27ff21[_0xb074('0x11')][_0xb074('0x13')]);return _0x542721(_0x27ff21['error'][_0xb074('0x13')]);}else{logger['info']('FreshdeskAccount,\x20%s,\x20%s',_0x330d20,_0xb074('0xf'));_0x542721(_0x27ff21['result'][_0xb074('0x13')]);}})[_0xb074('0x14')](function(_0xa9af0a){logger[_0xb074('0x11')](_0xb074('0xe'),_0x330d20,_0xa9af0a);_0x16e8ff(_0xa9af0a);});});}exports['GetFreshdeskAccount']=function(_0x3222ce){var _0x259843=this;return new Promise(function(_0x221fd1,_0x4a2a31){return db[_0xb074('0x15')][_0xb074('0x16')]({'raw':_0x3222ce[_0xb074('0x17')]?_0x3222ce['options'][_0xb074('0x18')]===undefined?!![]:![]:!![],'where':_0x3222ce[_0xb074('0x17')]?_0x3222ce[_0xb074('0x17')][_0xb074('0x19')]||null:null,'attributes':_0x3222ce[_0xb074('0x17')]?_0x3222ce['options']['attributes']||null:null,'limit':_0x3222ce['options']?_0x3222ce['options']['limit']||null:null,'include':_0x3222ce[_0xb074('0x17')]?_0x3222ce['options'][_0xb074('0x1a')]?_['map'](_0x3222ce['options'][_0xb074('0x1a')],function(_0x5b19c4){return{'model':db[_0x5b19c4['model']],'as':_0x5b19c4['as'],'attributes':_0x5b19c4[_0xb074('0x1b')],'include':_0x5b19c4[_0xb074('0x1a')]?_[_0xb074('0x1c')](_0x5b19c4[_0xb074('0x1a')],function(_0x17cd29){return{'model':db[_0x17cd29[_0xb074('0x1d')]],'as':_0x17cd29['as'],'attributes':_0x17cd29['attributes'],'include':_0x17cd29[_0xb074('0x1a')]?_[_0xb074('0x1c')](_0x17cd29[_0xb074('0x1a')],function(_0x3ba3b9){return{'model':db[_0x3ba3b9[_0xb074('0x1d')]],'as':_0x3ba3b9['as'],'attributes':_0x3ba3b9['attributes']};}):[]};}):[]};}):[]:[]})[_0xb074('0xc')](function(_0x42bfbc){logger[_0xb074('0xd')]('GetFreshdeskAccount',_0x3222ce);logger['debug'](_0xb074('0x1e'),_0x3222ce,JSON[_0xb074('0x1f')](_0x42bfbc));_0x221fd1(_0x42bfbc);})[_0xb074('0x14')](function(_0x3d5b64){logger['error'](_0xb074('0x1e'),_0x3d5b64[_0xb074('0x13')],_0x3222ce);_0x4a2a31(_0x259843[_0xb074('0x11')](0x1f4,_0x3d5b64[_0xb074('0x13')]));});});};exports[_0xb074('0x20')]=function(_0x4dd27d){var _0x52c987=this;return new Promise(function(_0x3bf7d9,_0x2f9810){return db[_0xb074('0x15')][_0xb074('0x21')]({'raw':_0x4dd27d[_0xb074('0x17')]?_0x4dd27d[_0xb074('0x17')][_0xb074('0x18')]===undefined?!![]:![]:!![],'where':_0x4dd27d[_0xb074('0x17')]?_0x4dd27d[_0xb074('0x17')][_0xb074('0x19')]||null:null,'attributes':_0x4dd27d['options']?_0x4dd27d[_0xb074('0x17')][_0xb074('0x1b')]||null:null,'include':_0x4dd27d[_0xb074('0x17')]?_0x4dd27d['options']['include']?_[_0xb074('0x1c')](_0x4dd27d[_0xb074('0x17')][_0xb074('0x1a')],function(_0x308a92){return{'model':db[_0x308a92[_0xb074('0x1d')]],'as':_0x308a92['as'],'attributes':_0x308a92[_0xb074('0x1b')],'include':_0x308a92[_0xb074('0x1a')]?_[_0xb074('0x1c')](_0x308a92['include'],function(_0x3652ff){return{'model':db[_0x3652ff[_0xb074('0x1d')]],'as':_0x3652ff['as'],'attributes':_0x3652ff[_0xb074('0x1b')],'include':_0x3652ff[_0xb074('0x1a')]?_[_0xb074('0x1c')](_0x3652ff[_0xb074('0x1a')],function(_0x5f3335){return{'model':db[_0x5f3335[_0xb074('0x1d')]],'as':_0x5f3335['as'],'attributes':_0x5f3335['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x43db14){logger['info'](_0xb074('0x20'),_0x4dd27d);logger[_0xb074('0x10')](_0xb074('0x20'),_0x4dd27d,JSON[_0xb074('0x1f')](_0x43db14));_0x3bf7d9(_0x43db14);})[_0xb074('0x14')](function(_0x234585){logger[_0xb074('0x11')](_0xb074('0x20'),_0x234585[_0xb074('0x13')],_0x4dd27d);_0x2f9810(_0x52c987[_0xb074('0x11')](0x1f4,_0x234585[_0xb074('0x13')]));});});};
\ No newline at end of file
+var _0x0a1c=['request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','FreshdeskAccount,\x20%s,\x20%s','message','catch','GetFreshdeskAccount','findAll','options','raw','where','limit','map','include','model','attributes','ShowFreshdeskAccount','FreshdeskAccount','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x543242,_0xeac9fd){var _0x4c99b6=function(_0x47d087){while(--_0x47d087){_0x543242['push'](_0x543242['shift']());}};_0x4c99b6(++_0xeac9fd);}(_0x0a1c,0x7a));var _0xc0a1=function(_0x496333,_0x1c47d6){_0x496333=_0x496333-0x0;var _0x44256e=_0x0a1c[_0x496333];return _0x44256e;};'use strict';var _=require(_0xc0a1('0x0'));var util=require(_0xc0a1('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xc0a1('0x2'));var fs=require('fs');var Redis=require(_0xc0a1('0x3'));var db=require(_0xc0a1('0x4'))['db'];var utils=require(_0xc0a1('0x5'));var logger=require('../../config/logger')(_0xc0a1('0x6'));var config=require(_0xc0a1('0x7'));var jayson=require(_0xc0a1('0x8'));var client=jayson[_0xc0a1('0x9')][_0xc0a1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x199b79,_0x2522c8,_0x570f44){return new BPromise(function(_0x2c8f26,_0x4dcaf2){return client[_0xc0a1('0xb')](_0x199b79,_0x570f44)[_0xc0a1('0xc')](function(_0x4a1f22){logger[_0xc0a1('0xd')]('FreshdeskAccount,\x20%s,\x20%s',_0x2522c8,_0xc0a1('0xe'));logger[_0xc0a1('0xf')](_0xc0a1('0x10'),_0x2522c8,'request\x20sent',JSON[_0xc0a1('0x11')](_0x4a1f22));if(_0x4a1f22[_0xc0a1('0x12')]){if(_0x4a1f22[_0xc0a1('0x12')]['code']===0x1f4){logger[_0xc0a1('0x12')](_0xc0a1('0x13'),_0x2522c8,_0x4a1f22[_0xc0a1('0x12')][_0xc0a1('0x14')]);return _0x4dcaf2(_0x4a1f22[_0xc0a1('0x12')][_0xc0a1('0x14')]);}logger[_0xc0a1('0x12')]('FreshdeskAccount,\x20%s,\x20%s',_0x2522c8,_0x4a1f22[_0xc0a1('0x12')][_0xc0a1('0x14')]);return _0x2c8f26(_0x4a1f22[_0xc0a1('0x12')]['message']);}else{logger[_0xc0a1('0xd')](_0xc0a1('0x13'),_0x2522c8,_0xc0a1('0xe'));_0x2c8f26(_0x4a1f22['result'][_0xc0a1('0x14')]);}})[_0xc0a1('0x15')](function(_0xaee3be){logger['error'](_0xc0a1('0x13'),_0x2522c8,_0xaee3be);_0x4dcaf2(_0xaee3be);});});}exports[_0xc0a1('0x16')]=function(_0x176850){var _0xaa69f8=this;return new Promise(function(_0x33a91f,_0x1d9e41){return db['FreshdeskAccount'][_0xc0a1('0x17')]({'raw':_0x176850[_0xc0a1('0x18')]?_0x176850[_0xc0a1('0x18')][_0xc0a1('0x19')]===undefined?!![]:![]:!![],'where':_0x176850['options']?_0x176850[_0xc0a1('0x18')][_0xc0a1('0x1a')]||null:null,'attributes':_0x176850[_0xc0a1('0x18')]?_0x176850[_0xc0a1('0x18')]['attributes']||null:null,'limit':_0x176850[_0xc0a1('0x18')]?_0x176850[_0xc0a1('0x18')][_0xc0a1('0x1b')]||null:null,'include':_0x176850[_0xc0a1('0x18')]?_0x176850[_0xc0a1('0x18')]['include']?_[_0xc0a1('0x1c')](_0x176850[_0xc0a1('0x18')][_0xc0a1('0x1d')],function(_0x1e19d5){return{'model':db[_0x1e19d5[_0xc0a1('0x1e')]],'as':_0x1e19d5['as'],'attributes':_0x1e19d5['attributes'],'include':_0x1e19d5['include']?_[_0xc0a1('0x1c')](_0x1e19d5[_0xc0a1('0x1d')],function(_0x549197){return{'model':db[_0x549197[_0xc0a1('0x1e')]],'as':_0x549197['as'],'attributes':_0x549197[_0xc0a1('0x1f')],'include':_0x549197[_0xc0a1('0x1d')]?_[_0xc0a1('0x1c')](_0x549197[_0xc0a1('0x1d')],function(_0x47f927){return{'model':db[_0x47f927[_0xc0a1('0x1e')]],'as':_0x47f927['as'],'attributes':_0x47f927[_0xc0a1('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xc0a1('0xc')](function(_0xe06e27){logger['info'](_0xc0a1('0x16'),_0x176850);logger[_0xc0a1('0xf')]('GetFreshdeskAccount',_0x176850,JSON[_0xc0a1('0x11')](_0xe06e27));_0x33a91f(_0xe06e27);})[_0xc0a1('0x15')](function(_0x5249c0){logger[_0xc0a1('0x12')](_0xc0a1('0x16'),_0x5249c0[_0xc0a1('0x14')],_0x176850);_0x1d9e41(_0xaa69f8[_0xc0a1('0x12')](0x1f4,_0x5249c0[_0xc0a1('0x14')]));});});};exports[_0xc0a1('0x20')]=function(_0x1da577){var _0x5d1310=this;return new Promise(function(_0x2346a1,_0x2830fa){return db[_0xc0a1('0x21')]['find']({'raw':_0x1da577['options']?_0x1da577[_0xc0a1('0x18')][_0xc0a1('0x19')]===undefined?!![]:![]:!![],'where':_0x1da577['options']?_0x1da577[_0xc0a1('0x18')][_0xc0a1('0x1a')]||null:null,'attributes':_0x1da577[_0xc0a1('0x18')]?_0x1da577[_0xc0a1('0x18')]['attributes']||null:null,'include':_0x1da577[_0xc0a1('0x18')]?_0x1da577[_0xc0a1('0x18')][_0xc0a1('0x1d')]?_[_0xc0a1('0x1c')](_0x1da577[_0xc0a1('0x18')][_0xc0a1('0x1d')],function(_0x290b55){return{'model':db[_0x290b55[_0xc0a1('0x1e')]],'as':_0x290b55['as'],'attributes':_0x290b55[_0xc0a1('0x1f')],'include':_0x290b55[_0xc0a1('0x1d')]?_[_0xc0a1('0x1c')](_0x290b55[_0xc0a1('0x1d')],function(_0x335c9f){return{'model':db[_0x335c9f[_0xc0a1('0x1e')]],'as':_0x335c9f['as'],'attributes':_0x335c9f['attributes'],'include':_0x335c9f['include']?_[_0xc0a1('0x1c')](_0x335c9f[_0xc0a1('0x1d')],function(_0x516e87){return{'model':db[_0x516e87['model']],'as':_0x516e87['as'],'attributes':_0x516e87[_0xc0a1('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xc0a1('0xc')](function(_0x109792){logger['info'](_0xc0a1('0x20'),_0x1da577);logger[_0xc0a1('0xf')](_0xc0a1('0x20'),_0x1da577,JSON[_0xc0a1('0x11')](_0x109792));_0x2346a1(_0x109792);})['catch'](function(_0x6760d1){logger[_0xc0a1('0x12')](_0xc0a1('0x20'),_0x6760d1[_0xc0a1('0x14')],_0x1da577);_0x2830fa(_0x5d1310[_0xc0a1('0x12')](0x1f4,_0x6760d1[_0xc0a1('0x14')]));});});};
\ No newline at end of file
index dfe0351..bf0eb6e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2786=['setTags','put','update','delete','destroy','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','/:id','show','get','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','create'];(function(_0x12ddb2,_0x5ad61e){var _0x10b6dd=function(_0x47dd27){while(--_0x47dd27){_0x12ddb2['push'](_0x12ddb2['shift']());}};_0x10b6dd(++_0x5ad61e);}(_0x2786,0xf8));var _0x6278=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x2786[_0x3947c9];return _0x2e7871;};'use strict';var multer=require('multer');var util=require(_0x6278('0x0'));var path=require(_0x6278('0x1'));var timeout=require('connect-timeout');var express=require(_0x6278('0x2'));var router=express[_0x6278('0x3')]();var fs_extra=require(_0x6278('0x4'));var auth=require(_0x6278('0x5'));var interaction=require(_0x6278('0x6'));var config=require(_0x6278('0x7'));var controller=require('./intFreshdeskConfiguration.controller');router['get']('/',auth[_0x6278('0x8')](),controller[_0x6278('0x9')]);router['get'](_0x6278('0xa'),auth[_0x6278('0x8')](),controller[_0x6278('0xb')]);router[_0x6278('0xc')]('/:id/fields',auth[_0x6278('0x8')](),controller[_0x6278('0xd')]);router['get'](_0x6278('0xe'),auth[_0x6278('0x8')](),controller[_0x6278('0xf')]);router[_0x6278('0xc')](_0x6278('0x10'),auth[_0x6278('0x8')](),controller[_0x6278('0x11')]);router[_0x6278('0xc')](_0x6278('0x12'),auth[_0x6278('0x8')](),controller[_0x6278('0x13')]);router[_0x6278('0x14')]('/',auth[_0x6278('0x8')](),controller[_0x6278('0x15')]);router['post'](_0x6278('0x12'),auth['isAuthenticated'](),controller[_0x6278('0x16')]);router[_0x6278('0x17')](_0x6278('0xa'),auth[_0x6278('0x8')](),controller[_0x6278('0x18')]);router[_0x6278('0x19')](_0x6278('0xa'),auth[_0x6278('0x8')](),controller[_0x6278('0x1a')]);module['exports']=router;
\ No newline at end of file
+var _0x7d09=['delete','destroy','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','index','get','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','create','post','setTags','put','update'];(function(_0x47dde9,_0x1e8683){var _0x291547=function(_0x488c0a){while(--_0x488c0a){_0x47dde9['push'](_0x47dde9['shift']());}};_0x291547(++_0x1e8683);}(_0x7d09,0x137));var _0x97d0=function(_0x491cbe,_0x45c8ba){_0x491cbe=_0x491cbe-0x0;var _0x59449d=_0x7d09[_0x491cbe];return _0x59449d;};'use strict';var multer=require(_0x97d0('0x0'));var util=require('util');var path=require(_0x97d0('0x1'));var timeout=require(_0x97d0('0x2'));var express=require('express');var router=express[_0x97d0('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x97d0('0x4'));var interaction=require(_0x97d0('0x5'));var config=require(_0x97d0('0x6'));var controller=require(_0x97d0('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x97d0('0x8')]);router[_0x97d0('0x9')](_0x97d0('0xa'),auth[_0x97d0('0xb')](),controller[_0x97d0('0xc')]);router['get'](_0x97d0('0xd'),auth['isAuthenticated'](),controller[_0x97d0('0xe')]);router[_0x97d0('0x9')](_0x97d0('0xf'),auth[_0x97d0('0xb')](),controller['getSubjects']);router[_0x97d0('0x9')](_0x97d0('0x10'),auth['isAuthenticated'](),controller[_0x97d0('0x11')]);router[_0x97d0('0x9')](_0x97d0('0x12'),auth['isAuthenticated'](),controller[_0x97d0('0x13')]);router['post']('/',auth[_0x97d0('0xb')](),controller[_0x97d0('0x14')]);router[_0x97d0('0x15')](_0x97d0('0x12'),auth[_0x97d0('0xb')](),controller[_0x97d0('0x16')]);router[_0x97d0('0x17')](_0x97d0('0xa'),auth[_0x97d0('0xb')](),controller[_0x97d0('0x18')]);router[_0x97d0('0x19')]('/:id',auth['isAuthenticated'](),controller[_0x97d0('0x1a')]);module[_0x97d0('0x1b')]=router;
\ No newline at end of file
index 6ca6515..16cf635 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcc81=['STRING','exports'];(function(_0x37b9ad,_0x179adf){var _0x6264e2=function(_0x469b7d){while(--_0x469b7d){_0x37b9ad['push'](_0x37b9ad['shift']());}};_0x6264e2(++_0x179adf);}(_0xcc81,0x1af));var _0x1cc8=function(_0x3a723e,_0x59d99a){_0x3a723e=_0x3a723e-0x0;var _0x3e9c03=_0xcc81[_0x3a723e];return _0x3e9c03;};'use strict';var Sequelize=require('sequelize');module[_0x1cc8('0x0')]={'name':{'type':Sequelize[_0x1cc8('0x1')]},'description':{'type':Sequelize[_0x1cc8('0x1')]}};
\ No newline at end of file
+var _0x1830=['exports','STRING','sequelize'];(function(_0x507945,_0x1a7f6d){var _0x2a1916=function(_0x345d3f){while(--_0x345d3f){_0x507945['push'](_0x507945['shift']());}};_0x2a1916(++_0x1a7f6d);}(_0x1830,0xb6));var _0x0183=function(_0x741334,_0x4dadd8){_0x741334=_0x741334-0x0;var _0x11f9e0=_0x1830[_0x741334];return _0x11f9e0;};'use strict';var Sequelize=require(_0x0183('0x0'));module[_0x0183('0x1')]={'name':{'type':Sequelize[_0x0183('0x2')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index f426706..01988f7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd10c=['body','findOne','rawAttributes','length','getFields','hasOwnProperty','nolimit','getSubjects','order','getDescriptions','getTags','setTags','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','sendStatus','status','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','FreshdeskConfiguration','fieldName','type','key','model','query','keys','fields','attributes','sort','filters','pick','filter','where','merge','options','includeAll','include','findAll','rows','catch','show','params','intersection','find','create'];(function(_0x21c7a4,_0x4c40a0){var _0x5c4184=function(_0x3c65c3){while(--_0x3c65c3){_0x21c7a4['push'](_0x21c7a4['shift']());}};_0x5c4184(++_0x4c40a0);}(_0xd10c,0x19c));var _0xcd10=function(_0x3dcc45,_0x525d95){_0x3dcc45=_0x3dcc45-0x0;var _0x123929=_0xd10c[_0x3dcc45];return _0x123929;};'use strict';var emlformat=require(_0xcd10('0x0'));var rimraf=require(_0xcd10('0x1'));var zipdir=require(_0xcd10('0x2'));var jsonpatch=require(_0xcd10('0x3'));var rp=require(_0xcd10('0x4'));var moment=require(_0xcd10('0x5'));var BPromise=require(_0xcd10('0x6'));var Mustache=require(_0xcd10('0x7'));var util=require(_0xcd10('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0xcd10('0x9'));var ejs=require(_0xcd10('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcd10('0xb'));var squel=require(_0xcd10('0xc'));var crypto=require('crypto');var jsforce=require(_0xcd10('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xcd10('0x9'));var querystring=require('querystring');var Papa=require(_0xcd10('0xe'));var Redis=require('ioredis');var authService=require(_0xcd10('0xf'));var qs=require(_0xcd10('0x10'));var as=require(_0xcd10('0x11'));var hardwareService=require(_0xcd10('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0xcd10('0x13'));var config=require(_0xcd10('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4569b4,_0x5cbc51){_0x5cbc51=_0x5cbc51||0xcc;return function(_0x550e44){if(_0x550e44){return _0x4569b4[_0xcd10('0x15')](_0x5cbc51);}return _0x4569b4[_0xcd10('0x16')](_0x5cbc51)['end']();};}function respondWithResult(_0x5459f9,_0x26dd1b){_0x26dd1b=_0x26dd1b||0xc8;return function(_0x59c003){if(_0x59c003){return _0x5459f9[_0xcd10('0x16')](_0x26dd1b)[_0xcd10('0x17')](_0x59c003);}};}function respondWithFilteredResult(_0x71a253,_0x4f38e4){return function(_0x433486){if(_0x433486){var _0xfc4c7d=typeof _0x4f38e4[_0xcd10('0x18')]===_0xcd10('0x19')&&typeof _0x4f38e4['limit']==='undefined';var _0x129f62=_0x433486['count'];var _0xb29996=_0xfc4c7d?0x0:_0x4f38e4[_0xcd10('0x18')];var _0x92b53=_0xfc4c7d?_0x433486['count']:_0x4f38e4[_0xcd10('0x18')]+_0x4f38e4[_0xcd10('0x1a')];var _0xa98129;if(_0x92b53>=_0x129f62){_0x92b53=_0x129f62;_0xa98129=0xc8;}else{_0xa98129=0xce;}_0x71a253[_0xcd10('0x16')](_0xa98129);return _0x71a253[_0xcd10('0x1b')](_0xcd10('0x1c'),_0xb29996+'-'+_0x92b53+'/'+_0x129f62)['json'](_0x433486);}return null;};}function patchUpdates(_0x378314){return function(_0x539d04){try{jsonpatch[_0xcd10('0x1d')](_0x539d04,_0x378314,!![]);}catch(_0xbdf439){return BPromise[_0xcd10('0x1e')](_0xbdf439);}return _0x539d04[_0xcd10('0x1f')]();};}function saveUpdates(_0x2814c3,_0x5e9b5e){return function(_0x20bbfb){if(_0x20bbfb){return _0x20bbfb[_0xcd10('0x20')](_0x2814c3)[_0xcd10('0x21')](function(_0xe2c30a){return _0xe2c30a;});}return null;};}function removeEntity(_0xa1f5cc,_0x298950){return function(_0x472ea3){if(_0x472ea3){return _0x472ea3[_0xcd10('0x22')]()[_0xcd10('0x21')](function(){_0xa1f5cc[_0xcd10('0x16')](0xcc)[_0xcd10('0x23')]();});}};}function handleEntityNotFound(_0x34294e,_0x50ed1d){return function(_0x21584d){if(!_0x21584d){_0x34294e[_0xcd10('0x15')](0x194);}return _0x21584d;};}function handleError(_0x3aa431,_0x246553){_0x246553=_0x246553||0x1f4;return function(_0x2fd395){logger[_0xcd10('0x24')](_0x2fd395[_0xcd10('0x25')]);if(_0x2fd395[_0xcd10('0x26')]){delete _0x2fd395[_0xcd10('0x26')];}_0x3aa431['status'](_0x246553)[_0xcd10('0x27')](_0x2fd395);};}exports[_0xcd10('0x28')]=function(_0x44cf85,_0x32d61e){var _0x2dac9c={},_0x33416b={},_0x2557cd={'count':0x0,'rows':[]};var _0x133702=_[_0xcd10('0x29')](db[_0xcd10('0x2a')]['rawAttributes'],function(_0x34fc2b){return{'name':_0x34fc2b[_0xcd10('0x2b')],'type':_0x34fc2b[_0xcd10('0x2c')][_0xcd10('0x2d')]};});_0x33416b[_0xcd10('0x2e')]=_[_0xcd10('0x29')](_0x133702,_0xcd10('0x26'));_0x33416b[_0xcd10('0x2f')]=_[_0xcd10('0x30')](_0x44cf85[_0xcd10('0x2f')]);_0x33416b['filters']=_['intersection'](_0x33416b[_0xcd10('0x2e')],_0x33416b['query']);_0x2dac9c['attributes']=_['intersection'](_0x33416b[_0xcd10('0x2e')],qs[_0xcd10('0x31')](_0x44cf85[_0xcd10('0x2f')][_0xcd10('0x31')]));_0x2dac9c[_0xcd10('0x32')]=_0x2dac9c[_0xcd10('0x32')]['length']?_0x2dac9c[_0xcd10('0x32')]:_0x33416b[_0xcd10('0x2e')];if(!_0x44cf85['query']['hasOwnProperty']('nolimit')){_0x2dac9c['limit']=qs['limit'](_0x44cf85[_0xcd10('0x2f')][_0xcd10('0x1a')]);_0x2dac9c[_0xcd10('0x18')]=qs[_0xcd10('0x18')](_0x44cf85[_0xcd10('0x2f')][_0xcd10('0x18')]);}_0x2dac9c['order']=qs['sort'](_0x44cf85[_0xcd10('0x2f')][_0xcd10('0x33')]);_0x2dac9c['where']=qs[_0xcd10('0x34')](_[_0xcd10('0x35')](_0x44cf85[_0xcd10('0x2f')],_0x33416b[_0xcd10('0x34')]),_0x133702);if(_0x44cf85[_0xcd10('0x2f')][_0xcd10('0x36')]){_0x2dac9c[_0xcd10('0x37')]=_['merge'](_0x2dac9c[_0xcd10('0x37')],{'$or':_[_0xcd10('0x29')](_0x133702,function(_0x446ea4){if(_0x446ea4[_0xcd10('0x2c')]!=='VIRTUAL'){var _0x47b1aa={};_0x47b1aa[_0x446ea4[_0xcd10('0x26')]]={'$like':'%'+_0x44cf85[_0xcd10('0x2f')][_0xcd10('0x36')]+'%'};return _0x47b1aa;}})});}_0x2dac9c=_[_0xcd10('0x38')]({},_0x2dac9c,_0x44cf85[_0xcd10('0x39')]);var _0xb9de57={'where':_0x2dac9c[_0xcd10('0x37')]};return db[_0xcd10('0x2a')]['count'](_0xb9de57)['then'](function(_0x2b781d){_0x2557cd['count']=_0x2b781d;if(_0x44cf85[_0xcd10('0x2f')][_0xcd10('0x3a')]){_0x2dac9c[_0xcd10('0x3b')]=[{'all':!![]}];}return db[_0xcd10('0x2a')][_0xcd10('0x3c')](_0x2dac9c);})[_0xcd10('0x21')](function(_0x3a8aa2){_0x2557cd[_0xcd10('0x3d')]=_0x3a8aa2;return _0x2557cd;})['then'](respondWithFilteredResult(_0x32d61e,_0x2dac9c))[_0xcd10('0x3e')](handleError(_0x32d61e,null));};exports[_0xcd10('0x3f')]=function(_0xb102a6,_0x110490){var _0x1909e1={'raw':![],'where':{'id':_0xb102a6[_0xcd10('0x40')]['id']}},_0x1f36bf={};_0x1f36bf[_0xcd10('0x2e')]=_[_0xcd10('0x30')](db['FreshdeskConfiguration']['rawAttributes']);_0x1f36bf[_0xcd10('0x2f')]=_[_0xcd10('0x30')](_0xb102a6[_0xcd10('0x2f')]);_0x1f36bf[_0xcd10('0x34')]=_['intersection'](_0x1f36bf['model'],_0x1f36bf[_0xcd10('0x2f')]);_0x1909e1[_0xcd10('0x32')]=_[_0xcd10('0x41')](_0x1f36bf[_0xcd10('0x2e')],qs['fields'](_0xb102a6[_0xcd10('0x2f')][_0xcd10('0x31')]));_0x1909e1[_0xcd10('0x32')]=_0x1909e1[_0xcd10('0x32')]['length']?_0x1909e1['attributes']:_0x1f36bf[_0xcd10('0x2e')];if(_0xb102a6[_0xcd10('0x2f')][_0xcd10('0x3a')]){_0x1909e1['include']=[{'all':!![]}];}_0x1909e1=_[_0xcd10('0x38')]({},_0x1909e1,_0xb102a6['options']);return db[_0xcd10('0x2a')][_0xcd10('0x42')](_0x1909e1)['then'](handleEntityNotFound(_0x110490,null))[_0xcd10('0x21')](respondWithResult(_0x110490,null))['catch'](handleError(_0x110490,null));};exports[_0xcd10('0x43')]=function(_0x3d5d08,_0x744a5e){return db[_0xcd10('0x2a')]['create'](_0x3d5d08[_0xcd10('0x44')],{})[_0xcd10('0x21')](respondWithResult(_0x744a5e,0xc9))['catch'](handleError(_0x744a5e,null));};exports[_0xcd10('0x20')]=function(_0x25bf4e,_0xee440){if(_0x25bf4e[_0xcd10('0x44')]['id']){delete _0x25bf4e[_0xcd10('0x44')]['id'];}return db[_0xcd10('0x2a')][_0xcd10('0x42')]({'where':{'id':_0x25bf4e[_0xcd10('0x40')]['id']}})['then'](handleEntityNotFound(_0xee440,null))['then'](saveUpdates(_0x25bf4e[_0xcd10('0x44')],null))[_0xcd10('0x21')](respondWithResult(_0xee440,null))[_0xcd10('0x3e')](handleError(_0xee440,null));};exports[_0xcd10('0x22')]=function(_0x412509,_0x571f66){return db[_0xcd10('0x2a')][_0xcd10('0x42')]({'where':{'id':_0x412509[_0xcd10('0x40')]['id']}})[_0xcd10('0x21')](handleEntityNotFound(_0x571f66,null))[_0xcd10('0x21')](removeEntity(_0x571f66,null))[_0xcd10('0x3e')](handleError(_0x571f66,null));};exports['getFields']=function(_0x5df863,_0x39ed88,_0x2561ca){var _0x1b4f06={};var _0x12095f={};var _0xdc5559;var _0xe7684f;return db[_0xcd10('0x2a')][_0xcd10('0x45')]({'where':{'id':_0x5df863[_0xcd10('0x40')]['id']}})[_0xcd10('0x21')](handleEntityNotFound(_0x39ed88,null))[_0xcd10('0x21')](function(_0x182608){if(_0x182608){_0xdc5559=_0x182608;_0x12095f[_0xcd10('0x2e')]=_['keys'](db['FreshdeskField'][_0xcd10('0x46')]);_0x12095f[_0xcd10('0x2f')]=_[_0xcd10('0x30')](_0x5df863[_0xcd10('0x2f')]);_0x12095f[_0xcd10('0x34')]=_[_0xcd10('0x41')](_0x12095f['model'],_0x12095f['query']);_0x1b4f06[_0xcd10('0x32')]=_[_0xcd10('0x41')](_0x12095f['model'],qs['fields'](_0x5df863[_0xcd10('0x2f')]['fields']));_0x1b4f06['attributes']=_0x1b4f06['attributes'][_0xcd10('0x47')]?_0x1b4f06[_0xcd10('0x32')]:_0x12095f[_0xcd10('0x2e')];_0x1b4f06['order']=qs[_0xcd10('0x33')](_0x5df863[_0xcd10('0x2f')][_0xcd10('0x33')]);_0x1b4f06[_0xcd10('0x37')]=qs[_0xcd10('0x34')](_['pick'](_0x5df863[_0xcd10('0x2f')],_0x12095f['filters']));if(_0x5df863[_0xcd10('0x2f')]['filter']){_0x1b4f06[_0xcd10('0x37')]=_[_0xcd10('0x38')](_0x1b4f06[_0xcd10('0x37')],{'$or':_[_0xcd10('0x29')](_0x1b4f06[_0xcd10('0x32')],function(_0x9c8726){var _0x766d44={};_0x766d44[_0x9c8726]={'$like':'%'+_0x5df863['query'][_0xcd10('0x36')]+'%'};return _0x766d44;})});}_0x1b4f06=_['merge']({},_0x1b4f06,_0x5df863[_0xcd10('0x39')]);return _0xdc5559[_0xcd10('0x48')](_0x1b4f06);}})[_0xcd10('0x21')](function(_0x201c31){if(_0x201c31){_0xe7684f=_0x201c31[_0xcd10('0x47')];if(!_0x5df863[_0xcd10('0x2f')][_0xcd10('0x49')](_0xcd10('0x4a'))){_0x1b4f06[_0xcd10('0x1a')]=qs[_0xcd10('0x1a')](_0x5df863[_0xcd10('0x2f')][_0xcd10('0x1a')]);_0x1b4f06['offset']=qs[_0xcd10('0x18')](_0x5df863[_0xcd10('0x2f')][_0xcd10('0x18')]);}return _0xdc5559['getFields'](_0x1b4f06);}})['then'](function(_0x463da9){if(_0x463da9){return _0x463da9?{'count':_0xe7684f,'rows':_0x463da9}:null;}})[_0xcd10('0x21')](respondWithResult(_0x39ed88,null))[_0xcd10('0x3e')](handleError(_0x39ed88,null));};exports[_0xcd10('0x4b')]=function(_0x23ed0c,_0x2bd14c,_0x3d87d7){var _0xb528f7={};var _0x3b33de={};var _0x478856;var _0x56b532;return db[_0xcd10('0x2a')][_0xcd10('0x45')]({'where':{'id':_0x23ed0c[_0xcd10('0x40')]['id']}})[_0xcd10('0x21')](handleEntityNotFound(_0x2bd14c,null))[_0xcd10('0x21')](function(_0x53d10c){if(_0x53d10c){_0x478856=_0x53d10c;_0x3b33de[_0xcd10('0x2e')]=_[_0xcd10('0x30')](db['FreshdeskField'][_0xcd10('0x46')]);_0x3b33de[_0xcd10('0x2f')]=_[_0xcd10('0x30')](_0x23ed0c[_0xcd10('0x2f')]);_0x3b33de[_0xcd10('0x34')]=_[_0xcd10('0x41')](_0x3b33de['model'],_0x3b33de[_0xcd10('0x2f')]);_0xb528f7[_0xcd10('0x32')]=_[_0xcd10('0x41')](_0x3b33de[_0xcd10('0x2e')],qs['fields'](_0x23ed0c[_0xcd10('0x2f')][_0xcd10('0x31')]));_0xb528f7[_0xcd10('0x32')]=_0xb528f7[_0xcd10('0x32')]['length']?_0xb528f7[_0xcd10('0x32')]:_0x3b33de['model'];_0xb528f7[_0xcd10('0x4c')]=qs[_0xcd10('0x33')](_0x23ed0c[_0xcd10('0x2f')][_0xcd10('0x33')]);_0xb528f7['where']=qs['filters'](_['pick'](_0x23ed0c['query'],_0x3b33de[_0xcd10('0x34')]));if(_0x23ed0c['query'][_0xcd10('0x36')]){_0xb528f7[_0xcd10('0x37')]=_[_0xcd10('0x38')](_0xb528f7[_0xcd10('0x37')],{'$or':_[_0xcd10('0x29')](_0xb528f7[_0xcd10('0x32')],function(_0x188257){var _0x2c5dd6={};_0x2c5dd6[_0x188257]={'$like':'%'+_0x23ed0c[_0xcd10('0x2f')][_0xcd10('0x36')]+'%'};return _0x2c5dd6;})});}_0xb528f7=_[_0xcd10('0x38')]({},_0xb528f7,_0x23ed0c[_0xcd10('0x39')]);return _0x478856[_0xcd10('0x4b')](_0xb528f7);}})[_0xcd10('0x21')](function(_0x4e91c6){if(_0x4e91c6){_0x56b532=_0x4e91c6[_0xcd10('0x47')];if(!_0x23ed0c[_0xcd10('0x2f')][_0xcd10('0x49')](_0xcd10('0x4a'))){_0xb528f7['limit']=qs[_0xcd10('0x1a')](_0x23ed0c[_0xcd10('0x2f')][_0xcd10('0x1a')]);_0xb528f7[_0xcd10('0x18')]=qs['offset'](_0x23ed0c[_0xcd10('0x2f')][_0xcd10('0x18')]);}return _0x478856[_0xcd10('0x4b')](_0xb528f7);}})[_0xcd10('0x21')](function(_0x112bb5){if(_0x112bb5){return _0x112bb5?{'count':_0x56b532,'rows':_0x112bb5}:null;}})[_0xcd10('0x21')](respondWithResult(_0x2bd14c,null))[_0xcd10('0x3e')](handleError(_0x2bd14c,null));};exports[_0xcd10('0x4d')]=function(_0x20627d,_0x1c8e07,_0x528d86){var _0x55442a={};var _0x24294d={};var _0x3393f9;var _0x26ce4c;return db[_0xcd10('0x2a')][_0xcd10('0x45')]({'where':{'id':_0x20627d[_0xcd10('0x40')]['id']}})[_0xcd10('0x21')](handleEntityNotFound(_0x1c8e07,null))[_0xcd10('0x21')](function(_0x299f22){if(_0x299f22){_0x3393f9=_0x299f22;_0x24294d[_0xcd10('0x2e')]=_[_0xcd10('0x30')](db['FreshdeskField'][_0xcd10('0x46')]);_0x24294d['query']=_[_0xcd10('0x30')](_0x20627d[_0xcd10('0x2f')]);_0x24294d[_0xcd10('0x34')]=_['intersection'](_0x24294d[_0xcd10('0x2e')],_0x24294d['query']);_0x55442a['attributes']=_['intersection'](_0x24294d[_0xcd10('0x2e')],qs[_0xcd10('0x31')](_0x20627d[_0xcd10('0x2f')][_0xcd10('0x31')]));_0x55442a[_0xcd10('0x32')]=_0x55442a[_0xcd10('0x32')]['length']?_0x55442a[_0xcd10('0x32')]:_0x24294d[_0xcd10('0x2e')];_0x55442a[_0xcd10('0x4c')]=qs[_0xcd10('0x33')](_0x20627d[_0xcd10('0x2f')][_0xcd10('0x33')]);_0x55442a[_0xcd10('0x37')]=qs[_0xcd10('0x34')](_[_0xcd10('0x35')](_0x20627d[_0xcd10('0x2f')],_0x24294d[_0xcd10('0x34')]));if(_0x20627d['query'][_0xcd10('0x36')]){_0x55442a[_0xcd10('0x37')]=_[_0xcd10('0x38')](_0x55442a[_0xcd10('0x37')],{'$or':_['map'](_0x55442a[_0xcd10('0x32')],function(_0x293e46){var _0x5c9a26={};_0x5c9a26[_0x293e46]={'$like':'%'+_0x20627d[_0xcd10('0x2f')][_0xcd10('0x36')]+'%'};return _0x5c9a26;})});}_0x55442a=_[_0xcd10('0x38')]({},_0x55442a,_0x20627d[_0xcd10('0x39')]);return _0x3393f9[_0xcd10('0x4d')](_0x55442a);}})['then'](function(_0x3076a3){if(_0x3076a3){_0x26ce4c=_0x3076a3[_0xcd10('0x47')];if(!_0x20627d['query'][_0xcd10('0x49')]('nolimit')){_0x55442a[_0xcd10('0x1a')]=qs[_0xcd10('0x1a')](_0x20627d['query'][_0xcd10('0x1a')]);_0x55442a['offset']=qs[_0xcd10('0x18')](_0x20627d[_0xcd10('0x2f')][_0xcd10('0x18')]);}return _0x3393f9[_0xcd10('0x4d')](_0x55442a);}})['then'](function(_0x7d4077){if(_0x7d4077){return _0x7d4077?{'count':_0x26ce4c,'rows':_0x7d4077}:null;}})[_0xcd10('0x21')](respondWithResult(_0x1c8e07,null))['catch'](handleError(_0x1c8e07,null));};exports[_0xcd10('0x4e')]=function(_0x2af407,_0x2b398b,_0x158c68){var _0x5568d1={};var _0x400aea={};var _0x432db5;var _0x418697;return db[_0xcd10('0x2a')][_0xcd10('0x45')]({'where':{'id':_0x2af407[_0xcd10('0x40')]['id']}})[_0xcd10('0x21')](handleEntityNotFound(_0x2b398b,null))[_0xcd10('0x21')](function(_0xdb1e9a){if(_0xdb1e9a){_0x432db5=_0xdb1e9a;_0x400aea[_0xcd10('0x2e')]=_[_0xcd10('0x30')](db['Tag']['rawAttributes']);_0x400aea[_0xcd10('0x2f')]=_[_0xcd10('0x30')](_0x2af407['query']);_0x400aea[_0xcd10('0x34')]=_[_0xcd10('0x41')](_0x400aea[_0xcd10('0x2e')],_0x400aea[_0xcd10('0x2f')]);_0x5568d1[_0xcd10('0x32')]=_['intersection'](_0x400aea[_0xcd10('0x2e')],qs[_0xcd10('0x31')](_0x2af407['query'][_0xcd10('0x31')]));_0x5568d1[_0xcd10('0x32')]=_0x5568d1[_0xcd10('0x32')]['length']?_0x5568d1[_0xcd10('0x32')]:_0x400aea[_0xcd10('0x2e')];_0x5568d1[_0xcd10('0x4c')]=qs[_0xcd10('0x33')](_0x2af407[_0xcd10('0x2f')][_0xcd10('0x33')]);_0x5568d1['where']=qs[_0xcd10('0x34')](_[_0xcd10('0x35')](_0x2af407[_0xcd10('0x2f')],_0x400aea[_0xcd10('0x34')]));if(_0x2af407[_0xcd10('0x2f')]['filter']){_0x5568d1[_0xcd10('0x37')]=_[_0xcd10('0x38')](_0x5568d1[_0xcd10('0x37')],{'$or':_[_0xcd10('0x29')](_0x5568d1['attributes'],function(_0x2c245e){var _0x4ff830={};_0x4ff830[_0x2c245e]={'$like':'%'+_0x2af407['query']['filter']+'%'};return _0x4ff830;})});}_0x5568d1=_[_0xcd10('0x38')]({},_0x5568d1,_0x2af407[_0xcd10('0x39')]);return _0x432db5[_0xcd10('0x4e')](_0x5568d1);}})[_0xcd10('0x21')](function(_0x5dab49){if(_0x5dab49){_0x418697=_0x5dab49['length'];if(!_0x2af407['query'][_0xcd10('0x49')](_0xcd10('0x4a'))){_0x5568d1[_0xcd10('0x1a')]=qs[_0xcd10('0x1a')](_0x2af407['query'][_0xcd10('0x1a')]);_0x5568d1[_0xcd10('0x18')]=qs[_0xcd10('0x18')](_0x2af407['query'][_0xcd10('0x18')]);}return _0x432db5[_0xcd10('0x4e')](_0x5568d1);}})[_0xcd10('0x21')](function(_0x5a1fdb){if(_0x5a1fdb){return _0x5a1fdb?{'count':_0x418697,'rows':_0x5a1fdb}:null;}})['then'](respondWithResult(_0x2b398b,null))['catch'](handleError(_0x2b398b,null));};exports[_0xcd10('0x4f')]=function(_0x3bd8c1,_0x52bc90,_0xe9172c){if(_0x3bd8c1[_0xcd10('0x44')]['id']){delete _0x3bd8c1['body']['id'];}return db[_0xcd10('0x2a')][_0xcd10('0x45')]({'where':{'id':_0x3bd8c1[_0xcd10('0x40')]['id']}})[_0xcd10('0x21')](handleEntityNotFound(_0x52bc90,null))[_0xcd10('0x21')](function(_0x4586c2){if(_0x4586c2){return _0x4586c2[_0xcd10('0x4f')](_0x3bd8c1[_0xcd10('0x44')]['ids']||[]);}return null;})[_0xcd10('0x21')](respondWithResult(_0x52bc90,null))[_0xcd10('0x3e')](handleError(_0x52bc90,null));};
\ No newline at end of file
+var _0x6021=['api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','offset','count','limit','set','apply','reject','update','then','destroy','stack','name','send','index','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','order','sort','where','pick','filter','merge','map','FreshdeskConfiguration','includeAll','findAll','rows','catch','show','params','include','find','create','body','getFields','findOne','FreshdeskField','options','hasOwnProperty','nolimit','getSubjects','getDescriptions','getTags','Tag','setTags','ids','zip-dir','fast-json-patch','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x6021,0x1d0));var _0x1602=function(_0x23fd7a,_0x193ac1){_0x23fd7a=_0x23fd7a-0x0;var _0x1e6e80=_0x6021[_0x23fd7a];return _0x1e6e80;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x1602('0x0'));var jsonpatch=require(_0x1602('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x1602('0x2'));var Mustache=require(_0x1602('0x3'));var util=require('util');var path=require(_0x1602('0x4'));var sox=require(_0x1602('0x5'));var csv=require(_0x1602('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1602('0x7'));var _=require(_0x1602('0x8'));var squel=require('squel');var crypto=require(_0x1602('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x1602('0xa'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x1602('0xb'));var Redis=require('ioredis');var authService=require(_0x1602('0xc'));var qs=require(_0x1602('0xd'));var as=require(_0x1602('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1602('0xf'))(_0x1602('0x10'));var utils=require('../../config/utils');var config=require(_0x1602('0x11'));var licenseUtil=require(_0x1602('0x12'));var db=require(_0x1602('0x13'))['db'];function respondWithStatusCode(_0xb71833,_0x1ff7c0){_0x1ff7c0=_0x1ff7c0||0xcc;return function(_0x3b7c15){if(_0x3b7c15){return _0xb71833[_0x1602('0x14')](_0x1ff7c0);}return _0xb71833[_0x1602('0x15')](_0x1ff7c0)[_0x1602('0x16')]();};}function respondWithResult(_0xd111a3,_0x19309f){_0x19309f=_0x19309f||0xc8;return function(_0xb7fdc7){if(_0xb7fdc7){return _0xd111a3['status'](_0x19309f)[_0x1602('0x17')](_0xb7fdc7);}};}function respondWithFilteredResult(_0x1b4df7,_0x4c2743){return function(_0x44e18a){if(_0x44e18a){var _0x4a8bae=typeof _0x4c2743['offset']===_0x1602('0x18')&&typeof _0x4c2743['limit']===_0x1602('0x18');var _0x561792=_0x44e18a['count'];var _0x15cf4e=_0x4a8bae?0x0:_0x4c2743[_0x1602('0x19')];var _0x416073=_0x4a8bae?_0x44e18a[_0x1602('0x1a')]:_0x4c2743[_0x1602('0x19')]+_0x4c2743[_0x1602('0x1b')];var _0x41bfe2;if(_0x416073>=_0x561792){_0x416073=_0x561792;_0x41bfe2=0xc8;}else{_0x41bfe2=0xce;}_0x1b4df7['status'](_0x41bfe2);return _0x1b4df7[_0x1602('0x1c')]('Content-Range',_0x15cf4e+'-'+_0x416073+'/'+_0x561792)[_0x1602('0x17')](_0x44e18a);}return null;};}function patchUpdates(_0x161241){return function(_0x4d1da5){try{jsonpatch[_0x1602('0x1d')](_0x4d1da5,_0x161241,!![]);}catch(_0x28072d){return BPromise[_0x1602('0x1e')](_0x28072d);}return _0x4d1da5['save']();};}function saveUpdates(_0x3018c8,_0x114eb0){return function(_0x216854){if(_0x216854){return _0x216854[_0x1602('0x1f')](_0x3018c8)[_0x1602('0x20')](function(_0x265790){return _0x265790;});}return null;};}function removeEntity(_0x3cf3dc,_0x1edbd8){return function(_0x577a57){if(_0x577a57){return _0x577a57[_0x1602('0x21')]()['then'](function(){_0x3cf3dc[_0x1602('0x15')](0xcc)[_0x1602('0x16')]();});}};}function handleEntityNotFound(_0x39837a,_0x4dd95c){return function(_0x51e21d){if(!_0x51e21d){_0x39837a[_0x1602('0x14')](0x194);}return _0x51e21d;};}function handleError(_0x55945e,_0x2116b6){_0x2116b6=_0x2116b6||0x1f4;return function(_0x183fdf){logger['error'](_0x183fdf[_0x1602('0x22')]);if(_0x183fdf[_0x1602('0x23')]){delete _0x183fdf['name'];}_0x55945e[_0x1602('0x15')](_0x2116b6)[_0x1602('0x24')](_0x183fdf);};}exports[_0x1602('0x25')]=function(_0x49d761,_0x2f1984){var _0x202a4e={},_0x4dea90={},_0x8c5862={'count':0x0,'rows':[]};var _0x5a9787=_['map'](db['FreshdeskConfiguration'][_0x1602('0x26')],function(_0x3cb417){return{'name':_0x3cb417[_0x1602('0x27')],'type':_0x3cb417[_0x1602('0x28')][_0x1602('0x29')]};});_0x4dea90[_0x1602('0x2a')]=_['map'](_0x5a9787,_0x1602('0x23'));_0x4dea90[_0x1602('0x2b')]=_[_0x1602('0x2c')](_0x49d761[_0x1602('0x2b')]);_0x4dea90[_0x1602('0x2d')]=_['intersection'](_0x4dea90[_0x1602('0x2a')],_0x4dea90[_0x1602('0x2b')]);_0x202a4e[_0x1602('0x2e')]=_[_0x1602('0x2f')](_0x4dea90[_0x1602('0x2a')],qs[_0x1602('0x30')](_0x49d761['query'][_0x1602('0x30')]));_0x202a4e[_0x1602('0x2e')]=_0x202a4e[_0x1602('0x2e')][_0x1602('0x31')]?_0x202a4e['attributes']:_0x4dea90[_0x1602('0x2a')];if(!_0x49d761[_0x1602('0x2b')]['hasOwnProperty']('nolimit')){_0x202a4e[_0x1602('0x1b')]=qs[_0x1602('0x1b')](_0x49d761['query'][_0x1602('0x1b')]);_0x202a4e[_0x1602('0x19')]=qs[_0x1602('0x19')](_0x49d761['query'][_0x1602('0x19')]);}_0x202a4e[_0x1602('0x32')]=qs[_0x1602('0x33')](_0x49d761[_0x1602('0x2b')][_0x1602('0x33')]);_0x202a4e[_0x1602('0x34')]=qs[_0x1602('0x2d')](_[_0x1602('0x35')](_0x49d761[_0x1602('0x2b')],_0x4dea90['filters']),_0x5a9787);if(_0x49d761[_0x1602('0x2b')][_0x1602('0x36')]){_0x202a4e[_0x1602('0x34')]=_[_0x1602('0x37')](_0x202a4e[_0x1602('0x34')],{'$or':_[_0x1602('0x38')](_0x5a9787,function(_0x2123b9){if(_0x2123b9[_0x1602('0x28')]!=='VIRTUAL'){var _0x1eaa8d={};_0x1eaa8d[_0x2123b9[_0x1602('0x23')]]={'$like':'%'+_0x49d761[_0x1602('0x2b')][_0x1602('0x36')]+'%'};return _0x1eaa8d;}})});}_0x202a4e=_['merge']({},_0x202a4e,_0x49d761['options']);var _0x4585d0={'where':_0x202a4e['where']};return db[_0x1602('0x39')][_0x1602('0x1a')](_0x4585d0)[_0x1602('0x20')](function(_0x3d9484){_0x8c5862[_0x1602('0x1a')]=_0x3d9484;if(_0x49d761[_0x1602('0x2b')][_0x1602('0x3a')]){_0x202a4e['include']=[{'all':!![]}];}return db[_0x1602('0x39')][_0x1602('0x3b')](_0x202a4e);})['then'](function(_0x5226f4){_0x8c5862[_0x1602('0x3c')]=_0x5226f4;return _0x8c5862;})['then'](respondWithFilteredResult(_0x2f1984,_0x202a4e))[_0x1602('0x3d')](handleError(_0x2f1984,null));};exports[_0x1602('0x3e')]=function(_0x586cb,_0x1626b6){var _0x13fbeb={'raw':![],'where':{'id':_0x586cb[_0x1602('0x3f')]['id']}},_0x54811f={};_0x54811f[_0x1602('0x2a')]=_[_0x1602('0x2c')](db['FreshdeskConfiguration'][_0x1602('0x26')]);_0x54811f[_0x1602('0x2b')]=_[_0x1602('0x2c')](_0x586cb[_0x1602('0x2b')]);_0x54811f[_0x1602('0x2d')]=_['intersection'](_0x54811f[_0x1602('0x2a')],_0x54811f[_0x1602('0x2b')]);_0x13fbeb['attributes']=_[_0x1602('0x2f')](_0x54811f[_0x1602('0x2a')],qs['fields'](_0x586cb['query'][_0x1602('0x30')]));_0x13fbeb['attributes']=_0x13fbeb[_0x1602('0x2e')][_0x1602('0x31')]?_0x13fbeb['attributes']:_0x54811f['model'];if(_0x586cb['query'][_0x1602('0x3a')]){_0x13fbeb[_0x1602('0x40')]=[{'all':!![]}];}_0x13fbeb=_[_0x1602('0x37')]({},_0x13fbeb,_0x586cb['options']);return db[_0x1602('0x39')][_0x1602('0x41')](_0x13fbeb)[_0x1602('0x20')](handleEntityNotFound(_0x1626b6,null))['then'](respondWithResult(_0x1626b6,null))['catch'](handleError(_0x1626b6,null));};exports['create']=function(_0x3600a9,_0x2095ce){return db[_0x1602('0x39')][_0x1602('0x42')](_0x3600a9[_0x1602('0x43')],{})[_0x1602('0x20')](respondWithResult(_0x2095ce,0xc9))[_0x1602('0x3d')](handleError(_0x2095ce,null));};exports[_0x1602('0x1f')]=function(_0x241ad8,_0x1a5fc0){if(_0x241ad8[_0x1602('0x43')]['id']){delete _0x241ad8[_0x1602('0x43')]['id'];}return db[_0x1602('0x39')][_0x1602('0x41')]({'where':{'id':_0x241ad8[_0x1602('0x3f')]['id']}})[_0x1602('0x20')](handleEntityNotFound(_0x1a5fc0,null))[_0x1602('0x20')](saveUpdates(_0x241ad8[_0x1602('0x43')],null))[_0x1602('0x20')](respondWithResult(_0x1a5fc0,null))[_0x1602('0x3d')](handleError(_0x1a5fc0,null));};exports[_0x1602('0x21')]=function(_0x5f130b,_0xb8f86c){return db['FreshdeskConfiguration'][_0x1602('0x41')]({'where':{'id':_0x5f130b[_0x1602('0x3f')]['id']}})[_0x1602('0x20')](handleEntityNotFound(_0xb8f86c,null))[_0x1602('0x20')](removeEntity(_0xb8f86c,null))[_0x1602('0x3d')](handleError(_0xb8f86c,null));};exports[_0x1602('0x44')]=function(_0x2f3206,_0x3e48f3,_0x1c2b46){var _0x49f873={};var _0x528dac={};var _0x474d6b;var _0x363c99;return db[_0x1602('0x39')][_0x1602('0x45')]({'where':{'id':_0x2f3206[_0x1602('0x3f')]['id']}})[_0x1602('0x20')](handleEntityNotFound(_0x3e48f3,null))[_0x1602('0x20')](function(_0x4b1281){if(_0x4b1281){_0x474d6b=_0x4b1281;_0x528dac['model']=_[_0x1602('0x2c')](db[_0x1602('0x46')][_0x1602('0x26')]);_0x528dac[_0x1602('0x2b')]=_[_0x1602('0x2c')](_0x2f3206[_0x1602('0x2b')]);_0x528dac[_0x1602('0x2d')]=_[_0x1602('0x2f')](_0x528dac[_0x1602('0x2a')],_0x528dac[_0x1602('0x2b')]);_0x49f873[_0x1602('0x2e')]=_['intersection'](_0x528dac['model'],qs[_0x1602('0x30')](_0x2f3206['query'][_0x1602('0x30')]));_0x49f873[_0x1602('0x2e')]=_0x49f873[_0x1602('0x2e')][_0x1602('0x31')]?_0x49f873[_0x1602('0x2e')]:_0x528dac[_0x1602('0x2a')];_0x49f873[_0x1602('0x32')]=qs['sort'](_0x2f3206[_0x1602('0x2b')][_0x1602('0x33')]);_0x49f873[_0x1602('0x34')]=qs[_0x1602('0x2d')](_[_0x1602('0x35')](_0x2f3206[_0x1602('0x2b')],_0x528dac['filters']));if(_0x2f3206[_0x1602('0x2b')][_0x1602('0x36')]){_0x49f873[_0x1602('0x34')]=_[_0x1602('0x37')](_0x49f873['where'],{'$or':_['map'](_0x49f873[_0x1602('0x2e')],function(_0x2e2a5c){var _0x499fe7={};_0x499fe7[_0x2e2a5c]={'$like':'%'+_0x2f3206[_0x1602('0x2b')][_0x1602('0x36')]+'%'};return _0x499fe7;})});}_0x49f873=_['merge']({},_0x49f873,_0x2f3206[_0x1602('0x47')]);return _0x474d6b[_0x1602('0x44')](_0x49f873);}})[_0x1602('0x20')](function(_0x355e44){if(_0x355e44){_0x363c99=_0x355e44[_0x1602('0x31')];if(!_0x2f3206[_0x1602('0x2b')][_0x1602('0x48')](_0x1602('0x49'))){_0x49f873[_0x1602('0x1b')]=qs[_0x1602('0x1b')](_0x2f3206[_0x1602('0x2b')]['limit']);_0x49f873[_0x1602('0x19')]=qs[_0x1602('0x19')](_0x2f3206[_0x1602('0x2b')]['offset']);}return _0x474d6b[_0x1602('0x44')](_0x49f873);}})[_0x1602('0x20')](function(_0x47a252){if(_0x47a252){return _0x47a252?{'count':_0x363c99,'rows':_0x47a252}:null;}})['then'](respondWithResult(_0x3e48f3,null))[_0x1602('0x3d')](handleError(_0x3e48f3,null));};exports[_0x1602('0x4a')]=function(_0x47ca09,_0x428478,_0x447d7c){var _0x2ccbda={};var _0x17f4bb={};var _0x20e83b;var _0x1d3a98;return db[_0x1602('0x39')][_0x1602('0x45')]({'where':{'id':_0x47ca09[_0x1602('0x3f')]['id']}})[_0x1602('0x20')](handleEntityNotFound(_0x428478,null))[_0x1602('0x20')](function(_0x1a2e07){if(_0x1a2e07){_0x20e83b=_0x1a2e07;_0x17f4bb[_0x1602('0x2a')]=_[_0x1602('0x2c')](db[_0x1602('0x46')][_0x1602('0x26')]);_0x17f4bb['query']=_['keys'](_0x47ca09['query']);_0x17f4bb['filters']=_['intersection'](_0x17f4bb['model'],_0x17f4bb[_0x1602('0x2b')]);_0x2ccbda[_0x1602('0x2e')]=_[_0x1602('0x2f')](_0x17f4bb['model'],qs['fields'](_0x47ca09['query'][_0x1602('0x30')]));_0x2ccbda[_0x1602('0x2e')]=_0x2ccbda[_0x1602('0x2e')][_0x1602('0x31')]?_0x2ccbda[_0x1602('0x2e')]:_0x17f4bb[_0x1602('0x2a')];_0x2ccbda[_0x1602('0x32')]=qs[_0x1602('0x33')](_0x47ca09[_0x1602('0x2b')]['sort']);_0x2ccbda['where']=qs[_0x1602('0x2d')](_[_0x1602('0x35')](_0x47ca09[_0x1602('0x2b')],_0x17f4bb['filters']));if(_0x47ca09['query'][_0x1602('0x36')]){_0x2ccbda['where']=_[_0x1602('0x37')](_0x2ccbda[_0x1602('0x34')],{'$or':_['map'](_0x2ccbda[_0x1602('0x2e')],function(_0x4425e2){var _0x31abb1={};_0x31abb1[_0x4425e2]={'$like':'%'+_0x47ca09[_0x1602('0x2b')][_0x1602('0x36')]+'%'};return _0x31abb1;})});}_0x2ccbda=_[_0x1602('0x37')]({},_0x2ccbda,_0x47ca09[_0x1602('0x47')]);return _0x20e83b[_0x1602('0x4a')](_0x2ccbda);}})['then'](function(_0x350c5c){if(_0x350c5c){_0x1d3a98=_0x350c5c[_0x1602('0x31')];if(!_0x47ca09[_0x1602('0x2b')][_0x1602('0x48')](_0x1602('0x49'))){_0x2ccbda['limit']=qs['limit'](_0x47ca09['query']['limit']);_0x2ccbda[_0x1602('0x19')]=qs[_0x1602('0x19')](_0x47ca09[_0x1602('0x2b')]['offset']);}return _0x20e83b[_0x1602('0x4a')](_0x2ccbda);}})['then'](function(_0x56b705){if(_0x56b705){return _0x56b705?{'count':_0x1d3a98,'rows':_0x56b705}:null;}})[_0x1602('0x20')](respondWithResult(_0x428478,null))[_0x1602('0x3d')](handleError(_0x428478,null));};exports[_0x1602('0x4b')]=function(_0x5d9a58,_0x4817c6,_0xb4826){var _0xdeecdb={};var _0xc53bfa={};var _0xf9e58f;var _0x301f6c;return db[_0x1602('0x39')][_0x1602('0x45')]({'where':{'id':_0x5d9a58[_0x1602('0x3f')]['id']}})['then'](handleEntityNotFound(_0x4817c6,null))[_0x1602('0x20')](function(_0x4e1079){if(_0x4e1079){_0xf9e58f=_0x4e1079;_0xc53bfa[_0x1602('0x2a')]=_['keys'](db[_0x1602('0x46')][_0x1602('0x26')]);_0xc53bfa[_0x1602('0x2b')]=_[_0x1602('0x2c')](_0x5d9a58[_0x1602('0x2b')]);_0xc53bfa['filters']=_[_0x1602('0x2f')](_0xc53bfa[_0x1602('0x2a')],_0xc53bfa['query']);_0xdeecdb[_0x1602('0x2e')]=_[_0x1602('0x2f')](_0xc53bfa[_0x1602('0x2a')],qs[_0x1602('0x30')](_0x5d9a58[_0x1602('0x2b')][_0x1602('0x30')]));_0xdeecdb['attributes']=_0xdeecdb[_0x1602('0x2e')][_0x1602('0x31')]?_0xdeecdb[_0x1602('0x2e')]:_0xc53bfa[_0x1602('0x2a')];_0xdeecdb[_0x1602('0x32')]=qs['sort'](_0x5d9a58[_0x1602('0x2b')][_0x1602('0x33')]);_0xdeecdb[_0x1602('0x34')]=qs[_0x1602('0x2d')](_[_0x1602('0x35')](_0x5d9a58[_0x1602('0x2b')],_0xc53bfa[_0x1602('0x2d')]));if(_0x5d9a58[_0x1602('0x2b')][_0x1602('0x36')]){_0xdeecdb[_0x1602('0x34')]=_[_0x1602('0x37')](_0xdeecdb['where'],{'$or':_[_0x1602('0x38')](_0xdeecdb[_0x1602('0x2e')],function(_0xc32b1b){var _0x5bb0e8={};_0x5bb0e8[_0xc32b1b]={'$like':'%'+_0x5d9a58[_0x1602('0x2b')][_0x1602('0x36')]+'%'};return _0x5bb0e8;})});}_0xdeecdb=_[_0x1602('0x37')]({},_0xdeecdb,_0x5d9a58[_0x1602('0x47')]);return _0xf9e58f['getDescriptions'](_0xdeecdb);}})['then'](function(_0x45cccf){if(_0x45cccf){_0x301f6c=_0x45cccf[_0x1602('0x31')];if(!_0x5d9a58[_0x1602('0x2b')][_0x1602('0x48')](_0x1602('0x49'))){_0xdeecdb[_0x1602('0x1b')]=qs['limit'](_0x5d9a58['query'][_0x1602('0x1b')]);_0xdeecdb[_0x1602('0x19')]=qs[_0x1602('0x19')](_0x5d9a58[_0x1602('0x2b')][_0x1602('0x19')]);}return _0xf9e58f[_0x1602('0x4b')](_0xdeecdb);}})[_0x1602('0x20')](function(_0xd973a2){if(_0xd973a2){return _0xd973a2?{'count':_0x301f6c,'rows':_0xd973a2}:null;}})[_0x1602('0x20')](respondWithResult(_0x4817c6,null))[_0x1602('0x3d')](handleError(_0x4817c6,null));};exports[_0x1602('0x4c')]=function(_0x1aa405,_0x3a48d7,_0x1c963e){var _0x5c0055={};var _0x18d1c6={};var _0x469ae3;var _0x30a894;return db[_0x1602('0x39')]['findOne']({'where':{'id':_0x1aa405[_0x1602('0x3f')]['id']}})['then'](handleEntityNotFound(_0x3a48d7,null))[_0x1602('0x20')](function(_0x3c2f01){if(_0x3c2f01){_0x469ae3=_0x3c2f01;_0x18d1c6[_0x1602('0x2a')]=_[_0x1602('0x2c')](db[_0x1602('0x4d')][_0x1602('0x26')]);_0x18d1c6['query']=_[_0x1602('0x2c')](_0x1aa405[_0x1602('0x2b')]);_0x18d1c6[_0x1602('0x2d')]=_[_0x1602('0x2f')](_0x18d1c6['model'],_0x18d1c6['query']);_0x5c0055[_0x1602('0x2e')]=_[_0x1602('0x2f')](_0x18d1c6[_0x1602('0x2a')],qs['fields'](_0x1aa405[_0x1602('0x2b')][_0x1602('0x30')]));_0x5c0055[_0x1602('0x2e')]=_0x5c0055['attributes'][_0x1602('0x31')]?_0x5c0055[_0x1602('0x2e')]:_0x18d1c6[_0x1602('0x2a')];_0x5c0055[_0x1602('0x32')]=qs[_0x1602('0x33')](_0x1aa405[_0x1602('0x2b')]['sort']);_0x5c0055['where']=qs[_0x1602('0x2d')](_[_0x1602('0x35')](_0x1aa405[_0x1602('0x2b')],_0x18d1c6[_0x1602('0x2d')]));if(_0x1aa405[_0x1602('0x2b')][_0x1602('0x36')]){_0x5c0055[_0x1602('0x34')]=_[_0x1602('0x37')](_0x5c0055[_0x1602('0x34')],{'$or':_[_0x1602('0x38')](_0x5c0055[_0x1602('0x2e')],function(_0x555dab){var _0x47ab7a={};_0x47ab7a[_0x555dab]={'$like':'%'+_0x1aa405[_0x1602('0x2b')]['filter']+'%'};return _0x47ab7a;})});}_0x5c0055=_[_0x1602('0x37')]({},_0x5c0055,_0x1aa405[_0x1602('0x47')]);return _0x469ae3['getTags'](_0x5c0055);}})[_0x1602('0x20')](function(_0x419a90){if(_0x419a90){_0x30a894=_0x419a90[_0x1602('0x31')];if(!_0x1aa405[_0x1602('0x2b')][_0x1602('0x48')](_0x1602('0x49'))){_0x5c0055['limit']=qs[_0x1602('0x1b')](_0x1aa405['query'][_0x1602('0x1b')]);_0x5c0055[_0x1602('0x19')]=qs[_0x1602('0x19')](_0x1aa405['query']['offset']);}return _0x469ae3[_0x1602('0x4c')](_0x5c0055);}})['then'](function(_0x48ef80){if(_0x48ef80){return _0x48ef80?{'count':_0x30a894,'rows':_0x48ef80}:null;}})[_0x1602('0x20')](respondWithResult(_0x3a48d7,null))[_0x1602('0x3d')](handleError(_0x3a48d7,null));};exports[_0x1602('0x4e')]=function(_0x579959,_0x2bbe85,_0x2b3673){if(_0x579959[_0x1602('0x43')]['id']){delete _0x579959[_0x1602('0x43')]['id'];}return db[_0x1602('0x39')][_0x1602('0x45')]({'where':{'id':_0x579959[_0x1602('0x3f')]['id']}})[_0x1602('0x20')](handleEntityNotFound(_0x2bbe85,null))['then'](function(_0x1e385a){if(_0x1e385a){return _0x1e385a[_0x1602('0x4e')](_0x579959[_0x1602('0x43')][_0x1602('0x4f')]||[]);}return null;})['then'](respondWithResult(_0x2bbe85,null))[_0x1602('0x3d')](handleError(_0x2bbe85,null));};
\ No newline at end of file
index e89260f..3926605 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7311=['request-promise','rimraf','../../config/environment','./intFreshdeskConfiguration.attributes','int_freshdesk_configurations','util','../../config/logger','api','moment','bluebird'];(function(_0x5d80de,_0x2cf15d){var _0x1c7556=function(_0x5bd806){while(--_0x5bd806){_0x5d80de['push'](_0x5d80de['shift']());}};_0x1c7556(++_0x2cf15d);}(_0x7311,0xeb));var _0x1731=function(_0x1ff2c7,_0x506fa9){_0x1ff2c7=_0x1ff2c7-0x0;var _0xe6362=_0x7311[_0x1ff2c7];return _0xe6362;};'use strict';var _=require('lodash');var util=require(_0x1731('0x0'));var logger=require(_0x1731('0x1'))(_0x1731('0x2'));var moment=require(_0x1731('0x3'));var BPromise=require(_0x1731('0x4'));var rp=require(_0x1731('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1731('0x6'));var config=require(_0x1731('0x7'));var attributes=require(_0x1731('0x8'));module['exports']=function(_0x4738f0,_0x371eb6){return _0x4738f0['define']('FreshdeskConfiguration',attributes,{'tableName':_0x1731('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc079=['exports','define','FreshdeskConfiguration','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskConfiguration.attributes'];(function(_0x362cc3,_0x246771){var _0x409b3b=function(_0x1b3979){while(--_0x1b3979){_0x362cc3['push'](_0x362cc3['shift']());}};_0x409b3b(++_0x246771);}(_0xc079,0x17c));var _0x9c07=function(_0x536280,_0x432d96){_0x536280=_0x536280-0x0;var _0x58845c=_0xc079[_0x536280];return _0x58845c;};'use strict';var _=require(_0x9c07('0x0'));var util=require(_0x9c07('0x1'));var logger=require('../../config/logger')(_0x9c07('0x2'));var moment=require(_0x9c07('0x3'));var BPromise=require(_0x9c07('0x4'));var rp=require(_0x9c07('0x5'));var fs=require('fs');var path=require(_0x9c07('0x6'));var rimraf=require(_0x9c07('0x7'));var config=require(_0x9c07('0x8'));var attributes=require(_0x9c07('0x9'));module[_0x9c07('0xa')]=function(_0x19b379,_0x3637c3){return _0x19b379[_0x9c07('0xb')](_0x9c07('0xc'),attributes,{'tableName':'int_freshdesk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 2ede3e5..5c85cfc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x89e3=['error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x1782d5,_0x5206a4){var _0x54f559=function(_0x51af07){while(--_0x51af07){_0x1782d5['push'](_0x1782d5['shift']());}};_0x54f559(++_0x5206a4);}(_0x89e3,0x1b5));var _0x389e=function(_0x44860b,_0x25902b){_0x44860b=_0x44860b-0x0;var _0xbdfcba=_0x89e3[_0x44860b];return _0xbdfcba;};'use strict';var _=require(_0x389e('0x0'));var util=require('util');var moment=require(_0x389e('0x1'));var BPromise=require(_0x389e('0x2'));var rs=require(_0x389e('0x3'));var fs=require('fs');var Redis=require(_0x389e('0x4'));var db=require(_0x389e('0x5'))['db'];var utils=require(_0x389e('0x6'));var logger=require('../../config/logger')(_0x389e('0x7'));var config=require(_0x389e('0x8'));var jayson=require(_0x389e('0x9'));var client=jayson[_0x389e('0xa')][_0x389e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3e9ab5,_0x250637,_0x818c7){return new BPromise(function(_0x21a937,_0x16dda7){return client[_0x389e('0xc')](_0x3e9ab5,_0x818c7)['then'](function(_0xc2595a){logger[_0x389e('0xd')](_0x389e('0xe'),_0x250637,_0x389e('0xf'));logger[_0x389e('0x10')](_0x389e('0x11'),_0x250637,_0x389e('0xf'),JSON[_0x389e('0x12')](_0xc2595a));if(_0xc2595a[_0x389e('0x13')]){if(_0xc2595a[_0x389e('0x13')][_0x389e('0x14')]===0x1f4){logger[_0x389e('0x13')](_0x389e('0xe'),_0x250637,_0xc2595a['error'][_0x389e('0x15')]);return _0x16dda7(_0xc2595a['error'][_0x389e('0x15')]);}logger[_0x389e('0x13')](_0x389e('0xe'),_0x250637,_0xc2595a[_0x389e('0x13')][_0x389e('0x15')]);return _0x21a937(_0xc2595a[_0x389e('0x13')][_0x389e('0x15')]);}else{logger[_0x389e('0xd')](_0x389e('0xe'),_0x250637,_0x389e('0xf'));_0x21a937(_0xc2595a[_0x389e('0x16')]['message']);}})[_0x389e('0x17')](function(_0x1f0dc9){logger[_0x389e('0x13')](_0x389e('0xe'),_0x250637,_0x1f0dc9);_0x16dda7(_0x1f0dc9);});});}
\ No newline at end of file
+var _0xcd4c=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','FreshdeskConfiguration,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x4de4f9,_0x380d76){var _0x1b894d=function(_0xe6aeb7){while(--_0xe6aeb7){_0x4de4f9['push'](_0x4de4f9['shift']());}};_0x1b894d(++_0x380d76);}(_0xcd4c,0x161));var _0xccd4=function(_0x3e76a3,_0x28373e){_0x3e76a3=_0x3e76a3-0x0;var _0x2c67d2=_0xcd4c[_0x3e76a3];return _0x2c67d2;};'use strict';var _=require(_0xccd4('0x0'));var util=require(_0xccd4('0x1'));var moment=require(_0xccd4('0x2'));var BPromise=require(_0xccd4('0x3'));var rs=require(_0xccd4('0x4'));var fs=require('fs');var Redis=require(_0xccd4('0x5'));var db=require(_0xccd4('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xccd4('0x7'))(_0xccd4('0x8'));var config=require(_0xccd4('0x9'));var jayson=require(_0xccd4('0xa'));var client=jayson[_0xccd4('0xb')][_0xccd4('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5db9be,_0x5a301d,_0x3a9d06){return new BPromise(function(_0x5c5017,_0x474094){return client['request'](_0x5db9be,_0x3a9d06)[_0xccd4('0xd')](function(_0x188af9){logger['info'](_0xccd4('0xe'),_0x5a301d,'request\x20sent');logger[_0xccd4('0xf')]('FreshdeskConfiguration,\x20%s,\x20%s,\x20%s',_0x5a301d,_0xccd4('0x10'),JSON[_0xccd4('0x11')](_0x188af9));if(_0x188af9[_0xccd4('0x12')]){if(_0x188af9[_0xccd4('0x12')][_0xccd4('0x13')]===0x1f4){logger[_0xccd4('0x12')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x5a301d,_0x188af9[_0xccd4('0x12')][_0xccd4('0x14')]);return _0x474094(_0x188af9[_0xccd4('0x12')][_0xccd4('0x14')]);}logger[_0xccd4('0x12')](_0xccd4('0xe'),_0x5a301d,_0x188af9[_0xccd4('0x12')]['message']);return _0x5c5017(_0x188af9[_0xccd4('0x12')][_0xccd4('0x14')]);}else{logger[_0xccd4('0x15')](_0xccd4('0xe'),_0x5a301d,'request\x20sent');_0x5c5017(_0x188af9[_0xccd4('0x16')]['message']);}})[_0xccd4('0x17')](function(_0x335cad){logger['error']('FreshdeskConfiguration,\x20%s,\x20%s',_0x5a301d,_0x335cad);_0x474094(_0x335cad);});});}
\ No newline at end of file
index c717f23..aab9754 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6258=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','isAuthenticated','get','/:id','create','update','delete'];(function(_0x22ffbf,_0x16f31e){var _0x360c17=function(_0x40807f){while(--_0x40807f){_0x22ffbf['push'](_0x22ffbf['shift']());}};_0x360c17(++_0x16f31e);}(_0x6258,0x1a4));var _0x8625=function(_0x1cac23,_0xa69db4){_0x1cac23=_0x1cac23-0x0;var _0x3cbb5d=_0x6258[_0x1cac23];return _0x3cbb5d;};'use strict';var multer=require(_0x8625('0x0'));var util=require(_0x8625('0x1'));var path=require(_0x8625('0x2'));var timeout=require(_0x8625('0x3'));var express=require(_0x8625('0x4'));var router=express[_0x8625('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x8625('0x6'));var interaction=require(_0x8625('0x7'));var config=require('../../config/environment');var controller=require('./intFreshdeskField.controller');router['get']('/',auth[_0x8625('0x8')](),controller['index']);router[_0x8625('0x9')](_0x8625('0xa'),auth[_0x8625('0x8')](),controller['show']);router['post']('/',auth[_0x8625('0x8')](),controller[_0x8625('0xb')]);router['put'](_0x8625('0xa'),auth[_0x8625('0x8')](),controller[_0x8625('0xc')]);router[_0x8625('0xd')]('/:id',auth[_0x8625('0x8')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x4d6a=['destroy','exports','multer','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','get','index','isAuthenticated','show','create','put','/:id','update','delete'];(function(_0x482a1f,_0x26da54){var _0x2a0c0a=function(_0x136b24){while(--_0x136b24){_0x482a1f['push'](_0x482a1f['shift']());}};_0x2a0c0a(++_0x26da54);}(_0x4d6a,0x17e));var _0xa4d6=function(_0x259c86,_0x5a7ce9){_0x259c86=_0x259c86-0x0;var _0x1bd2fc=_0x4d6a[_0x259c86];return _0x1bd2fc;};'use strict';var multer=require(_0xa4d6('0x0'));var util=require('util');var path=require(_0xa4d6('0x1'));var timeout=require('connect-timeout');var express=require(_0xa4d6('0x2'));var router=express[_0xa4d6('0x3')]();var fs_extra=require(_0xa4d6('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xa4d6('0x5'));var config=require(_0xa4d6('0x6'));var controller=require(_0xa4d6('0x7'));router[_0xa4d6('0x8')]('/',auth['isAuthenticated'](),controller[_0xa4d6('0x9')]);router[_0xa4d6('0x8')]('/:id',auth[_0xa4d6('0xa')](),controller[_0xa4d6('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0xa4d6('0xc')]);router[_0xa4d6('0xd')](_0xa4d6('0xe'),auth[_0xa4d6('0xa')](),controller[_0xa4d6('0xf')]);router[_0xa4d6('0x10')]('/:id',auth[_0xa4d6('0xa')](),controller[_0xa4d6('0x11')]);module[_0xa4d6('0x12')]=router;
\ No newline at end of file
index f934f6a..6671026 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfc73=['exports','ENUM','string','customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0xfc73,0x18b));var _0x3fc7=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0xfc73[_0x2c7618];return _0x5ce3f0;};'use strict';var Sequelize=require(_0x3fc7('0x0'));module[_0x3fc7('0x1')]={'type':{'type':Sequelize[_0x3fc7('0x2')](_0x3fc7('0x3'),'variable',_0x3fc7('0x4'),_0x3fc7('0x5'),_0x3fc7('0x6')),'defaultValue':_0x3fc7('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x3fc7('0x7')]},'keyType':{'type':Sequelize[_0x3fc7('0x2')](_0x3fc7('0x3'),'variable',_0x3fc7('0x4'))},'keyContent':{'type':Sequelize[_0x3fc7('0x7')]},'idField':{'type':Sequelize[_0x3fc7('0x7')]},'nameField':{'type':Sequelize[_0x3fc7('0x7')]},'customField':{'type':Sequelize[_0x3fc7('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x2779=['BOOLEAN','sequelize','exports','string','keyValue','picklist','STRING','ENUM','variable','customVariable'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x2779,0x1eb));var _0x9277=function(_0x331b78,_0x533fd9){_0x331b78=_0x331b78-0x0;var _0x2de754=_0x2779[_0x331b78];return _0x2de754;};'use strict';var Sequelize=require(_0x9277('0x0'));module[_0x9277('0x1')]={'type':{'type':Sequelize['ENUM'](_0x9277('0x2'),'variable','customVariable',_0x9277('0x3'),_0x9277('0x4')),'defaultValue':_0x9277('0x2')},'content':{'type':Sequelize[_0x9277('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x9277('0x6')]('string',_0x9277('0x7'),_0x9277('0x8'))},'keyContent':{'type':Sequelize[_0x9277('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x9277('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 733d164..fdaa809 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd404=['set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','FreshdeskField','fieldName','type','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','includeAll','include','findAll','rows','catch','params','rawAttributes','options','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count'];(function(_0x577956,_0x3d2cde){var _0x1a0e05=function(_0x1c7ed7){while(--_0x1c7ed7){_0x577956['push'](_0x577956['shift']());}};_0x1a0e05(++_0x3d2cde);}(_0xd404,0x15b));var _0x4d40=function(_0x37d0c7,_0x233690){_0x37d0c7=_0x37d0c7-0x0;var _0xd99728=_0xd404[_0x37d0c7];return _0xd99728;};'use strict';var emlformat=require(_0x4d40('0x0'));var rimraf=require(_0x4d40('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4d40('0x2'));var rp=require(_0x4d40('0x3'));var moment=require('moment');var BPromise=require(_0x4d40('0x4'));var Mustache=require(_0x4d40('0x5'));var util=require(_0x4d40('0x6'));var path=require(_0x4d40('0x7'));var sox=require(_0x4d40('0x8'));var csv=require(_0x4d40('0x9'));var ejs=require(_0x4d40('0xa'));var fs=require('fs');var fs_extra=require(_0x4d40('0xb'));var _=require(_0x4d40('0xc'));var squel=require('squel');var crypto=require(_0x4d40('0xd'));var jsforce=require(_0x4d40('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x4d40('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4d40('0xf'));var authService=require(_0x4d40('0x10'));var qs=require(_0x4d40('0x11'));var as=require(_0x4d40('0x12'));var hardwareService=require(_0x4d40('0x13'));var logger=require(_0x4d40('0x14'))(_0x4d40('0x15'));var utils=require(_0x4d40('0x16'));var config=require(_0x4d40('0x17'));var licenseUtil=require(_0x4d40('0x18'));var db=require(_0x4d40('0x19'))['db'];function respondWithStatusCode(_0x3c3b7e,_0x28e5bf){_0x28e5bf=_0x28e5bf||0xcc;return function(_0x42a621){if(_0x42a621){return _0x3c3b7e['sendStatus'](_0x28e5bf);}return _0x3c3b7e[_0x4d40('0x1a')](_0x28e5bf)[_0x4d40('0x1b')]();};}function respondWithResult(_0x3b071b,_0x2083bd){_0x2083bd=_0x2083bd||0xc8;return function(_0x477a91){if(_0x477a91){return _0x3b071b['status'](_0x2083bd)[_0x4d40('0x1c')](_0x477a91);}};}function respondWithFilteredResult(_0x4077ce,_0x20bc1b){return function(_0xcee25a){if(_0xcee25a){var _0x453857=typeof _0x20bc1b[_0x4d40('0x1d')]===_0x4d40('0x1e')&&typeof _0x20bc1b[_0x4d40('0x1f')]===_0x4d40('0x1e');var _0x4b5d23=_0xcee25a['count'];var _0x1ae5c7=_0x453857?0x0:_0x20bc1b[_0x4d40('0x1d')];var _0x4e505f=_0x453857?_0xcee25a[_0x4d40('0x20')]:_0x20bc1b[_0x4d40('0x1d')]+_0x20bc1b['limit'];var _0x36d031;if(_0x4e505f>=_0x4b5d23){_0x4e505f=_0x4b5d23;_0x36d031=0xc8;}else{_0x36d031=0xce;}_0x4077ce['status'](_0x36d031);return _0x4077ce[_0x4d40('0x21')](_0x4d40('0x22'),_0x1ae5c7+'-'+_0x4e505f+'/'+_0x4b5d23)['json'](_0xcee25a);}return null;};}function patchUpdates(_0x57c997){return function(_0x375ce0){try{jsonpatch[_0x4d40('0x23')](_0x375ce0,_0x57c997,!![]);}catch(_0x4d52ce){return BPromise[_0x4d40('0x24')](_0x4d52ce);}return _0x375ce0[_0x4d40('0x25')]();};}function saveUpdates(_0x30f058,_0x5d4c24){return function(_0x356fd6){if(_0x356fd6){return _0x356fd6[_0x4d40('0x26')](_0x30f058)[_0x4d40('0x27')](function(_0x5ca0a0){return _0x5ca0a0;});}return null;};}function removeEntity(_0x4eebc3,_0x2df33a){return function(_0x90b652){if(_0x90b652){return _0x90b652[_0x4d40('0x28')]()[_0x4d40('0x27')](function(){_0x4eebc3[_0x4d40('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0xbcd540,_0x1f5e5b){return function(_0x560df8){if(!_0x560df8){_0xbcd540['sendStatus'](0x194);}return _0x560df8;};}function handleError(_0x274d44,_0x2a0c82){_0x2a0c82=_0x2a0c82||0x1f4;return function(_0x3fa83e){logger[_0x4d40('0x29')](_0x3fa83e[_0x4d40('0x2a')]);if(_0x3fa83e[_0x4d40('0x2b')]){delete _0x3fa83e[_0x4d40('0x2b')];}_0x274d44[_0x4d40('0x1a')](_0x2a0c82)[_0x4d40('0x2c')](_0x3fa83e);};}exports[_0x4d40('0x2d')]=function(_0x1c0fcf,_0x4ca431){var _0x4e4e61={},_0x52f706={},_0x158a86={'count':0x0,'rows':[]};var _0x350488=_[_0x4d40('0x2e')](db[_0x4d40('0x2f')]['rawAttributes'],function(_0x18e601){return{'name':_0x18e601[_0x4d40('0x30')],'type':_0x18e601[_0x4d40('0x31')]['key']};});_0x52f706[_0x4d40('0x32')]=_[_0x4d40('0x2e')](_0x350488,_0x4d40('0x2b'));_0x52f706[_0x4d40('0x33')]=_[_0x4d40('0x34')](_0x1c0fcf['query']);_0x52f706[_0x4d40('0x35')]=_['intersection'](_0x52f706[_0x4d40('0x32')],_0x52f706[_0x4d40('0x33')]);_0x4e4e61[_0x4d40('0x36')]=_[_0x4d40('0x37')](_0x52f706['model'],qs['fields'](_0x1c0fcf[_0x4d40('0x33')][_0x4d40('0x38')]));_0x4e4e61[_0x4d40('0x36')]=_0x4e4e61[_0x4d40('0x36')]['length']?_0x4e4e61[_0x4d40('0x36')]:_0x52f706['model'];if(!_0x1c0fcf[_0x4d40('0x33')][_0x4d40('0x39')](_0x4d40('0x3a'))){_0x4e4e61[_0x4d40('0x1f')]=qs[_0x4d40('0x1f')](_0x1c0fcf[_0x4d40('0x33')][_0x4d40('0x1f')]);_0x4e4e61[_0x4d40('0x1d')]=qs[_0x4d40('0x1d')](_0x1c0fcf[_0x4d40('0x33')]['offset']);}_0x4e4e61[_0x4d40('0x3b')]=qs[_0x4d40('0x3c')](_0x1c0fcf['query']['sort']);_0x4e4e61['where']=qs[_0x4d40('0x35')](_[_0x4d40('0x3d')](_0x1c0fcf['query'],_0x52f706[_0x4d40('0x35')]),_0x350488);if(_0x1c0fcf[_0x4d40('0x33')][_0x4d40('0x3e')]){_0x4e4e61[_0x4d40('0x3f')]=_[_0x4d40('0x40')](_0x4e4e61['where'],{'$or':_[_0x4d40('0x2e')](_0x350488,function(_0x21a4ec){if(_0x21a4ec['type']!=='VIRTUAL'){var _0x3a4924={};_0x3a4924[_0x21a4ec[_0x4d40('0x2b')]]={'$like':'%'+_0x1c0fcf['query'][_0x4d40('0x3e')]+'%'};return _0x3a4924;}})});}_0x4e4e61=_[_0x4d40('0x40')]({},_0x4e4e61,_0x1c0fcf['options']);var _0x1e8427={'where':_0x4e4e61[_0x4d40('0x3f')]};return db['FreshdeskField'][_0x4d40('0x20')](_0x1e8427)[_0x4d40('0x27')](function(_0x4841ac){_0x158a86[_0x4d40('0x20')]=_0x4841ac;if(_0x1c0fcf['query'][_0x4d40('0x41')]){_0x4e4e61[_0x4d40('0x42')]=[{'all':!![]}];}return db[_0x4d40('0x2f')][_0x4d40('0x43')](_0x4e4e61);})[_0x4d40('0x27')](function(_0x2ef0ca){_0x158a86[_0x4d40('0x44')]=_0x2ef0ca;return _0x158a86;})[_0x4d40('0x27')](respondWithFilteredResult(_0x4ca431,_0x4e4e61))[_0x4d40('0x45')](handleError(_0x4ca431,null));};exports['show']=function(_0x250847,_0x3718a8){var _0x1c2fa8={'raw':!![],'where':{'id':_0x250847[_0x4d40('0x46')]['id']}},_0xcdde22={};_0xcdde22['model']=_[_0x4d40('0x34')](db['FreshdeskField'][_0x4d40('0x47')]);_0xcdde22[_0x4d40('0x33')]=_[_0x4d40('0x34')](_0x250847[_0x4d40('0x33')]);_0xcdde22['filters']=_[_0x4d40('0x37')](_0xcdde22[_0x4d40('0x32')],_0xcdde22['query']);_0x1c2fa8[_0x4d40('0x36')]=_['intersection'](_0xcdde22[_0x4d40('0x32')],qs[_0x4d40('0x38')](_0x250847[_0x4d40('0x33')][_0x4d40('0x38')]));_0x1c2fa8['attributes']=_0x1c2fa8[_0x4d40('0x36')]['length']?_0x1c2fa8[_0x4d40('0x36')]:_0xcdde22[_0x4d40('0x32')];if(_0x250847[_0x4d40('0x33')][_0x4d40('0x41')]){_0x1c2fa8['include']=[{'all':!![]}];}_0x1c2fa8=_[_0x4d40('0x40')]({},_0x1c2fa8,_0x250847[_0x4d40('0x48')]);return db[_0x4d40('0x2f')][_0x4d40('0x49')](_0x1c2fa8)['then'](handleEntityNotFound(_0x3718a8,null))[_0x4d40('0x27')](respondWithResult(_0x3718a8,null))[_0x4d40('0x45')](handleError(_0x3718a8,null));};exports['create']=function(_0x200d29,_0x493d8e){return db[_0x4d40('0x2f')][_0x4d40('0x4a')](_0x200d29[_0x4d40('0x4b')],{})[_0x4d40('0x27')](respondWithResult(_0x493d8e,0xc9))[_0x4d40('0x45')](handleError(_0x493d8e,null));};exports[_0x4d40('0x26')]=function(_0x30be7b,_0x37b6bf){if(_0x30be7b[_0x4d40('0x4b')]['id']){delete _0x30be7b['body']['id'];}return db[_0x4d40('0x2f')][_0x4d40('0x49')]({'where':{'id':_0x30be7b[_0x4d40('0x46')]['id']}})[_0x4d40('0x27')](handleEntityNotFound(_0x37b6bf,null))[_0x4d40('0x27')](saveUpdates(_0x30be7b['body'],null))[_0x4d40('0x27')](respondWithResult(_0x37b6bf,null))[_0x4d40('0x45')](handleError(_0x37b6bf,null));};exports['destroy']=function(_0xdf0235,_0x48ffd7){return db[_0x4d40('0x2f')][_0x4d40('0x49')]({'where':{'id':_0xdf0235[_0x4d40('0x46')]['id']}})['then'](handleEntityNotFound(_0x48ffd7,null))[_0x4d40('0x27')](removeEntity(_0x48ffd7,null))[_0x4d40('0x45')](handleError(_0x48ffd7,null));};
\ No newline at end of file
+var _0xa902=['sox','to-csv','ejs','fs-extra','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../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','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','order','sort','filters','filter','merge','where','VIRTUAL','includeAll','include','FreshdeskField','findAll','rows','catch','params','length','options','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path'];(function(_0x1abd00,_0x37fcde){var _0x2424d3=function(_0x508d8b){while(--_0x508d8b){_0x1abd00['push'](_0x1abd00['shift']());}};_0x2424d3(++_0x37fcde);}(_0xa902,0x8d));var _0x2a90=function(_0x1c0d28,_0x2d366d){_0x1c0d28=_0x1c0d28-0x0;var _0x357de8=_0xa902[_0x1c0d28];return _0x357de8;};'use strict';var emlformat=require(_0x2a90('0x0'));var rimraf=require(_0x2a90('0x1'));var zipdir=require(_0x2a90('0x2'));var jsonpatch=require(_0x2a90('0x3'));var rp=require(_0x2a90('0x4'));var moment=require('moment');var BPromise=require(_0x2a90('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x2a90('0x6'));var sox=require(_0x2a90('0x7'));var csv=require(_0x2a90('0x8'));var ejs=require(_0x2a90('0x9'));var fs=require('fs');var fs_extra=require(_0x2a90('0xa'));var _=require(_0x2a90('0xb'));var squel=require('squel');var crypto=require(_0x2a90('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x2a90('0x8'));var querystring=require(_0x2a90('0xd'));var Papa=require(_0x2a90('0xe'));var Redis=require(_0x2a90('0xf'));var authService=require(_0x2a90('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x2a90('0x11'));var hardwareService=require(_0x2a90('0x12'));var logger=require(_0x2a90('0x13'))(_0x2a90('0x14'));var utils=require('../../config/utils');var config=require(_0x2a90('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x2a90('0x16'))['db'];function respondWithStatusCode(_0x57458a,_0x1f6953){_0x1f6953=_0x1f6953||0xcc;return function(_0x57aee3){if(_0x57aee3){return _0x57458a[_0x2a90('0x17')](_0x1f6953);}return _0x57458a[_0x2a90('0x18')](_0x1f6953)[_0x2a90('0x19')]();};}function respondWithResult(_0x4c328b,_0x56d1b8){_0x56d1b8=_0x56d1b8||0xc8;return function(_0x57227c){if(_0x57227c){return _0x4c328b[_0x2a90('0x18')](_0x56d1b8)[_0x2a90('0x1a')](_0x57227c);}};}function respondWithFilteredResult(_0x5a2682,_0x1ff63d){return function(_0x21c648){if(_0x21c648){var _0x312782=typeof _0x1ff63d[_0x2a90('0x1b')]===_0x2a90('0x1c')&&typeof _0x1ff63d[_0x2a90('0x1d')]===_0x2a90('0x1c');var _0x10cf94=_0x21c648[_0x2a90('0x1e')];var _0x5c3e4b=_0x312782?0x0:_0x1ff63d[_0x2a90('0x1b')];var _0x1d9a28=_0x312782?_0x21c648[_0x2a90('0x1e')]:_0x1ff63d['offset']+_0x1ff63d[_0x2a90('0x1d')];var _0x1f51a6;if(_0x1d9a28>=_0x10cf94){_0x1d9a28=_0x10cf94;_0x1f51a6=0xc8;}else{_0x1f51a6=0xce;}_0x5a2682[_0x2a90('0x18')](_0x1f51a6);return _0x5a2682[_0x2a90('0x1f')](_0x2a90('0x20'),_0x5c3e4b+'-'+_0x1d9a28+'/'+_0x10cf94)[_0x2a90('0x1a')](_0x21c648);}return null;};}function patchUpdates(_0x312cd5){return function(_0x114d42){try{jsonpatch[_0x2a90('0x21')](_0x114d42,_0x312cd5,!![]);}catch(_0x465284){return BPromise[_0x2a90('0x22')](_0x465284);}return _0x114d42[_0x2a90('0x23')]();};}function saveUpdates(_0x4fdd62,_0x3da7d0){return function(_0x217873){if(_0x217873){return _0x217873[_0x2a90('0x24')](_0x4fdd62)[_0x2a90('0x25')](function(_0x5912fd){return _0x5912fd;});}return null;};}function removeEntity(_0x180485,_0xd033d){return function(_0x4ed9e6){if(_0x4ed9e6){return _0x4ed9e6[_0x2a90('0x26')]()[_0x2a90('0x25')](function(){_0x180485[_0x2a90('0x18')](0xcc)[_0x2a90('0x19')]();});}};}function handleEntityNotFound(_0x2a212c,_0x1303d9){return function(_0x29ed73){if(!_0x29ed73){_0x2a212c[_0x2a90('0x17')](0x194);}return _0x29ed73;};}function handleError(_0x48c2f9,_0x27f883){_0x27f883=_0x27f883||0x1f4;return function(_0x17f978){logger[_0x2a90('0x27')](_0x17f978[_0x2a90('0x28')]);if(_0x17f978[_0x2a90('0x29')]){delete _0x17f978['name'];}_0x48c2f9['status'](_0x27f883)[_0x2a90('0x2a')](_0x17f978);};}exports['index']=function(_0x53391e,_0x4969c3){var _0x2d83b3={},_0x3c78f5={},_0x595638={'count':0x0,'rows':[]};var _0x5bd700=_[_0x2a90('0x2b')](db['FreshdeskField'][_0x2a90('0x2c')],function(_0x6892e1){return{'name':_0x6892e1[_0x2a90('0x2d')],'type':_0x6892e1[_0x2a90('0x2e')][_0x2a90('0x2f')]};});_0x3c78f5[_0x2a90('0x30')]=_[_0x2a90('0x2b')](_0x5bd700,'name');_0x3c78f5[_0x2a90('0x31')]=_[_0x2a90('0x32')](_0x53391e[_0x2a90('0x31')]);_0x3c78f5['filters']=_[_0x2a90('0x33')](_0x3c78f5[_0x2a90('0x30')],_0x3c78f5[_0x2a90('0x31')]);_0x2d83b3[_0x2a90('0x34')]=_['intersection'](_0x3c78f5[_0x2a90('0x30')],qs[_0x2a90('0x35')](_0x53391e[_0x2a90('0x31')][_0x2a90('0x35')]));_0x2d83b3[_0x2a90('0x34')]=_0x2d83b3[_0x2a90('0x34')]['length']?_0x2d83b3[_0x2a90('0x34')]:_0x3c78f5[_0x2a90('0x30')];if(!_0x53391e[_0x2a90('0x31')][_0x2a90('0x36')]('nolimit')){_0x2d83b3[_0x2a90('0x1d')]=qs[_0x2a90('0x1d')](_0x53391e['query'][_0x2a90('0x1d')]);_0x2d83b3[_0x2a90('0x1b')]=qs['offset'](_0x53391e['query'][_0x2a90('0x1b')]);}_0x2d83b3[_0x2a90('0x37')]=qs[_0x2a90('0x38')](_0x53391e['query'][_0x2a90('0x38')]);_0x2d83b3['where']=qs[_0x2a90('0x39')](_['pick'](_0x53391e[_0x2a90('0x31')],_0x3c78f5['filters']),_0x5bd700);if(_0x53391e['query'][_0x2a90('0x3a')]){_0x2d83b3['where']=_[_0x2a90('0x3b')](_0x2d83b3[_0x2a90('0x3c')],{'$or':_[_0x2a90('0x2b')](_0x5bd700,function(_0x573aee){if(_0x573aee[_0x2a90('0x2e')]!==_0x2a90('0x3d')){var _0x3be438={};_0x3be438[_0x573aee['name']]={'$like':'%'+_0x53391e[_0x2a90('0x31')][_0x2a90('0x3a')]+'%'};return _0x3be438;}})});}_0x2d83b3=_[_0x2a90('0x3b')]({},_0x2d83b3,_0x53391e['options']);var _0x1aa096={'where':_0x2d83b3[_0x2a90('0x3c')]};return db['FreshdeskField'][_0x2a90('0x1e')](_0x1aa096)[_0x2a90('0x25')](function(_0x2a6bea){_0x595638[_0x2a90('0x1e')]=_0x2a6bea;if(_0x53391e[_0x2a90('0x31')][_0x2a90('0x3e')]){_0x2d83b3[_0x2a90('0x3f')]=[{'all':!![]}];}return db[_0x2a90('0x40')][_0x2a90('0x41')](_0x2d83b3);})[_0x2a90('0x25')](function(_0x45b41c){_0x595638[_0x2a90('0x42')]=_0x45b41c;return _0x595638;})[_0x2a90('0x25')](respondWithFilteredResult(_0x4969c3,_0x2d83b3))[_0x2a90('0x43')](handleError(_0x4969c3,null));};exports['show']=function(_0x45cbc2,_0x3a70fe){var _0x528b41={'raw':!![],'where':{'id':_0x45cbc2[_0x2a90('0x44')]['id']}},_0x1045bb={};_0x1045bb[_0x2a90('0x30')]=_[_0x2a90('0x32')](db[_0x2a90('0x40')]['rawAttributes']);_0x1045bb[_0x2a90('0x31')]=_['keys'](_0x45cbc2[_0x2a90('0x31')]);_0x1045bb['filters']=_[_0x2a90('0x33')](_0x1045bb[_0x2a90('0x30')],_0x1045bb[_0x2a90('0x31')]);_0x528b41[_0x2a90('0x34')]=_[_0x2a90('0x33')](_0x1045bb[_0x2a90('0x30')],qs[_0x2a90('0x35')](_0x45cbc2['query']['fields']));_0x528b41[_0x2a90('0x34')]=_0x528b41[_0x2a90('0x34')][_0x2a90('0x45')]?_0x528b41[_0x2a90('0x34')]:_0x1045bb[_0x2a90('0x30')];if(_0x45cbc2[_0x2a90('0x31')][_0x2a90('0x3e')]){_0x528b41[_0x2a90('0x3f')]=[{'all':!![]}];}_0x528b41=_['merge']({},_0x528b41,_0x45cbc2[_0x2a90('0x46')]);return db['FreshdeskField'][_0x2a90('0x47')](_0x528b41)[_0x2a90('0x25')](handleEntityNotFound(_0x3a70fe,null))['then'](respondWithResult(_0x3a70fe,null))[_0x2a90('0x43')](handleError(_0x3a70fe,null));};exports[_0x2a90('0x48')]=function(_0x280e63,_0x1d55db){return db[_0x2a90('0x40')][_0x2a90('0x48')](_0x280e63[_0x2a90('0x49')],{})['then'](respondWithResult(_0x1d55db,0xc9))['catch'](handleError(_0x1d55db,null));};exports[_0x2a90('0x24')]=function(_0x2611d0,_0x42c890){if(_0x2611d0[_0x2a90('0x49')]['id']){delete _0x2611d0[_0x2a90('0x49')]['id'];}return db['FreshdeskField']['find']({'where':{'id':_0x2611d0[_0x2a90('0x44')]['id']}})[_0x2a90('0x25')](handleEntityNotFound(_0x42c890,null))['then'](saveUpdates(_0x2611d0['body'],null))['then'](respondWithResult(_0x42c890,null))[_0x2a90('0x43')](handleError(_0x42c890,null));};exports['destroy']=function(_0x370da3,_0x3dfe72){return db[_0x2a90('0x40')][_0x2a90('0x47')]({'where':{'id':_0x370da3[_0x2a90('0x44')]['id']}})[_0x2a90('0x25')](handleEntityNotFound(_0x3dfe72,null))['then'](removeEntity(_0x3dfe72,null))[_0x2a90('0x43')](handleError(_0x3dfe72,null));};
\ No newline at end of file
index 7f096b0..f63e5aa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf51e=['FreshdeskField','freshdesk_unique_index','idField','FieldId','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intFreshdeskField.attributes','exports','define'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xf51e,0x9a));var _0xef51=function(_0x3dcd7e,_0x16b81a){_0x3dcd7e=_0x3dcd7e-0x0;var _0x357803=_0xf51e[_0x3dcd7e];return _0x357803;};'use strict';var _=require('lodash');var util=require(_0xef51('0x0'));var logger=require(_0xef51('0x1'))(_0xef51('0x2'));var moment=require(_0xef51('0x3'));var BPromise=require(_0xef51('0x4'));var rp=require(_0xef51('0x5'));var fs=require('fs');var path=require(_0xef51('0x6'));var rimraf=require('rimraf');var config=require(_0xef51('0x7'));var attributes=require(_0xef51('0x8'));module[_0xef51('0x9')]=function(_0x1f13f0,_0x4b159f){return _0x1f13f0[_0xef51('0xa')](_0xef51('0xb'),attributes,{'tableName':'int_freshdesk_fields','paranoid':![],'indexes':[{'name':_0xef51('0xc'),'fields':[_0xef51('0xd'),_0xef51('0xe')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x8bc9=['./intFreshdeskField.attributes','exports','define','FreshdeskField','int_freshdesk_fields','idField','FieldId','util','api','moment','bluebird','path','rimraf'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x8bc9,0x89));var _0x98bc=function(_0x1265e8,_0x8385ba){_0x1265e8=_0x1265e8-0x0;var _0x1ee567=_0x8bc9[_0x1265e8];return _0x1ee567;};'use strict';var _=require('lodash');var util=require(_0x98bc('0x0'));var logger=require('../../config/logger')(_0x98bc('0x1'));var moment=require(_0x98bc('0x2'));var BPromise=require(_0x98bc('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x98bc('0x4'));var rimraf=require(_0x98bc('0x5'));var config=require('../../config/environment');var attributes=require(_0x98bc('0x6'));module[_0x98bc('0x7')]=function(_0x3f5ec2,_0x3177dc){return _0x3f5ec2[_0x98bc('0x8')](_0x98bc('0x9'),attributes,{'tableName':_0x98bc('0xa'),'paranoid':![],'indexes':[{'name':'freshdesk_unique_index','fields':[_0x98bc('0xb'),_0x98bc('0xc')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index eae3d92..fe01d91 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7654=['debug','FreshdeskField,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','util','bluebird','randomstring','../../mysqldb','../../config/logger','jayson/promise','client','http','request','then','FreshdeskField,\x20%s,\x20%s','request\x20sent'];(function(_0x42bc91,_0x41f40a){var _0x3f5507=function(_0x20cfaf){while(--_0x20cfaf){_0x42bc91['push'](_0x42bc91['shift']());}};_0x3f5507(++_0x41f40a);}(_0x7654,0x137));var _0x4765=function(_0xdf7c3,_0x54e0d3){_0xdf7c3=_0xdf7c3-0x0;var _0x444c30=_0x7654[_0xdf7c3];return _0x444c30;};'use strict';var _=require('lodash');var util=require(_0x4765('0x0'));var moment=require('moment');var BPromise=require(_0x4765('0x1'));var rs=require(_0x4765('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4765('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x4765('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0x4765('0x5'));var client=jayson[_0x4765('0x6')][_0x4765('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x337b2d,_0x415ae3,_0x548874){return new BPromise(function(_0x133584,_0x513250){return client[_0x4765('0x8')](_0x337b2d,_0x548874)[_0x4765('0x9')](function(_0x4ab9f8){logger['info'](_0x4765('0xa'),_0x415ae3,_0x4765('0xb'));logger[_0x4765('0xc')](_0x4765('0xd'),_0x415ae3,_0x4765('0xb'),JSON['stringify'](_0x4ab9f8));if(_0x4ab9f8[_0x4765('0xe')]){if(_0x4ab9f8[_0x4765('0xe')][_0x4765('0xf')]===0x1f4){logger[_0x4765('0xe')]('FreshdeskField,\x20%s,\x20%s',_0x415ae3,_0x4ab9f8[_0x4765('0xe')]['message']);return _0x513250(_0x4ab9f8[_0x4765('0xe')][_0x4765('0x10')]);}logger[_0x4765('0xe')]('FreshdeskField,\x20%s,\x20%s',_0x415ae3,_0x4ab9f8[_0x4765('0xe')][_0x4765('0x10')]);return _0x133584(_0x4ab9f8[_0x4765('0xe')][_0x4765('0x10')]);}else{logger[_0x4765('0x11')]('FreshdeskField,\x20%s,\x20%s',_0x415ae3,_0x4765('0xb'));_0x133584(_0x4ab9f8['result'][_0x4765('0x10')]);}})[_0x4765('0x12')](function(_0x375ff9){logger['error'](_0x4765('0xa'),_0x415ae3,_0x375ff9);_0x513250(_0x375ff9);});});}
\ No newline at end of file
+var _0xc23d=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','FreshdeskField,\x20%s,\x20%s','request\x20sent','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc23d,0x90));var _0xdc23=function(_0x51674a,_0x77ccff){_0x51674a=_0x51674a-0x0;var _0x13fca6=_0xc23d[_0x51674a];return _0x13fca6;};'use strict';var _=require(_0xdc23('0x0'));var util=require('util');var moment=require(_0xdc23('0x1'));var BPromise=require(_0xdc23('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdc23('0x3'));var db=require(_0xdc23('0x4'))['db'];var utils=require(_0xdc23('0x5'));var logger=require(_0xdc23('0x6'))('rpc');var config=require(_0xdc23('0x7'));var jayson=require(_0xdc23('0x8'));var client=jayson['client'][_0xdc23('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x28d271,_0x584c36,_0x5a7381){return new BPromise(function(_0x254d4f,_0x40033c){return client[_0xdc23('0xa')](_0x28d271,_0x5a7381)['then'](function(_0x449758){logger[_0xdc23('0xb')](_0xdc23('0xc'),_0x584c36,_0xdc23('0xd'));logger['debug'](_0xdc23('0xe'),_0x584c36,'request\x20sent',JSON[_0xdc23('0xf')](_0x449758));if(_0x449758[_0xdc23('0x10')]){if(_0x449758['error'][_0xdc23('0x11')]===0x1f4){logger[_0xdc23('0x10')](_0xdc23('0xc'),_0x584c36,_0x449758[_0xdc23('0x10')][_0xdc23('0x12')]);return _0x40033c(_0x449758[_0xdc23('0x10')][_0xdc23('0x12')]);}logger[_0xdc23('0x10')](_0xdc23('0xc'),_0x584c36,_0x449758[_0xdc23('0x10')][_0xdc23('0x12')]);return _0x254d4f(_0x449758['error'][_0xdc23('0x12')]);}else{logger[_0xdc23('0xb')]('FreshdeskField,\x20%s,\x20%s',_0x584c36,'request\x20sent');_0x254d4f(_0x449758[_0xdc23('0x13')]['message']);}})[_0xdc23('0x14')](function(_0x1d258a){logger[_0xdc23('0x10')](_0xdc23('0xc'),_0x584c36,_0x1d258a);_0x40033c(_0x1d258a);});});}
\ No newline at end of file
index 2e22a27..6d3e8c9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2e54=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration','put','update','delete','destroy','exports','multer','connect-timeout','express'];(function(_0x1368d7,_0x1e2a36){var _0x47a112=function(_0x29df1c){while(--_0x29df1c){_0x1368d7['push'](_0x1368d7['shift']());}};_0x47a112(++_0x1e2a36);}(_0x2e54,0x1dd));var _0x42e5=function(_0x41f27f,_0x51fa03){_0x41f27f=_0x41f27f-0x0;var _0x35d82f=_0x2e54[_0x41f27f];return _0x35d82f;};'use strict';var multer=require(_0x42e5('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x42e5('0x1'));var express=require(_0x42e5('0x2'));var router=express[_0x42e5('0x3')]();var fs_extra=require(_0x42e5('0x4'));var auth=require(_0x42e5('0x5'));var interaction=require(_0x42e5('0x6'));var config=require(_0x42e5('0x7'));var controller=require('./intFreshsalesAccount.controller');router[_0x42e5('0x8')]('/',auth[_0x42e5('0x9')](),controller[_0x42e5('0xa')]);router['get'](_0x42e5('0xb'),auth['isAuthenticated'](),controller[_0x42e5('0xc')]);router['get'](_0x42e5('0xd'),auth[_0x42e5('0x9')](),controller[_0x42e5('0xe')]);router[_0x42e5('0x8')](_0x42e5('0xf'),auth[_0x42e5('0x9')](),controller[_0x42e5('0x10')]);router[_0x42e5('0x11')]('/',auth[_0x42e5('0x9')](),controller['create']);router[_0x42e5('0x11')](_0x42e5('0xd'),auth['isAuthenticated'](),controller[_0x42e5('0x12')]);router[_0x42e5('0x13')](_0x42e5('0xb'),auth[_0x42e5('0x9')](),controller[_0x42e5('0x14')]);router[_0x42e5('0x15')](_0x42e5('0xb'),auth[_0x42e5('0x9')](),controller[_0x42e5('0x16')]);module[_0x42e5('0x17')]=router;
\ No newline at end of file
+var _0x16d2=['./intFreshsalesAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','post','create','addConfiguration','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x2ec461,_0x5f588a){var _0x28603d=function(_0x21114b){while(--_0x21114b){_0x2ec461['push'](_0x2ec461['shift']());}};_0x28603d(++_0x5f588a);}(_0x16d2,0x123));var _0x216d=function(_0x5ba549,_0x425afd){_0x5ba549=_0x5ba549-0x0;var _0x36e3a1=_0x16d2[_0x5ba549];return _0x36e3a1;};'use strict';var multer=require(_0x216d('0x0'));var util=require(_0x216d('0x1'));var path=require(_0x216d('0x2'));var timeout=require(_0x216d('0x3'));var express=require(_0x216d('0x4'));var router=express[_0x216d('0x5')]();var fs_extra=require(_0x216d('0x6'));var auth=require(_0x216d('0x7'));var interaction=require(_0x216d('0x8'));var config=require('../../config/environment');var controller=require(_0x216d('0x9'));router[_0x216d('0xa')]('/',auth[_0x216d('0xb')](),controller[_0x216d('0xc')]);router[_0x216d('0xa')](_0x216d('0xd'),auth[_0x216d('0xb')](),controller[_0x216d('0xe')]);router['get'](_0x216d('0xf'),auth[_0x216d('0xb')](),controller[_0x216d('0x10')]);router[_0x216d('0xa')](_0x216d('0x11'),auth[_0x216d('0xb')](),controller['getFields']);router[_0x216d('0x12')]('/',auth['isAuthenticated'](),controller[_0x216d('0x13')]);router[_0x216d('0x12')](_0x216d('0xf'),auth[_0x216d('0xb')](),controller[_0x216d('0x14')]);router[_0x216d('0x15')]('/:id',auth[_0x216d('0xb')](),controller['update']);router[_0x216d('0x16')](_0x216d('0xd'),auth['isAuthenticated'](),controller[_0x216d('0x17')]);module[_0x216d('0x18')]=router;
\ No newline at end of file
index 6611e34..79f593e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3d04=['STRING','username','sequelize','exports'];(function(_0x75ce5b,_0x3b582f){var _0x22195e=function(_0x166668){while(--_0x166668){_0x75ce5b['push'](_0x75ce5b['shift']());}};_0x22195e(++_0x3b582f);}(_0x3d04,0xbe));var _0x43d0=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x3d04[_0x1facfa];return _0x9ec701;};'use strict';var Sequelize=require(_0x43d0('0x0'));module[_0x43d0('0x1')]={'name':{'type':Sequelize[_0x43d0('0x2')]},'description':{'type':Sequelize[_0x43d0('0x2')]},'username':{'type':Sequelize[_0x43d0('0x2')],'unique':_0x43d0('0x3')},'apiKey':{'type':Sequelize[_0x43d0('0x2')]},'remoteUri':{'type':Sequelize[_0x43d0('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x43d0('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0x3d04=['STRING','username','sequelize','exports'];(function(_0x39e84d,_0x11931d){var _0x1991bc=function(_0xc81e32){while(--_0xc81e32){_0x39e84d['push'](_0x39e84d['shift']());}};_0x1991bc(++_0x11931d);}(_0x3d04,0xbe));var _0x43d0=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x3d04[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require(_0x43d0('0x0'));module[_0x43d0('0x1')]={'name':{'type':Sequelize[_0x43d0('0x2')]},'description':{'type':Sequelize[_0x43d0('0x2')]},'username':{'type':Sequelize[_0x43d0('0x2')],'unique':_0x43d0('0x3')},'apiKey':{'type':Sequelize[_0x43d0('0x2')]},'remoteUri':{'type':Sequelize[_0x43d0('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x43d0('0x2')],'allowNull':![]}};
\ No newline at end of file
index 217fdcc..130f399 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9564=['%s%s','/api/selector/owners','users','email','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','merge','VIRTUAL','options','where','FreshsalesAccount','includeAll','include','findAll','rows','catch','show','params','find','create','body','getConfigurations','findOne','FreshsalesConfiguration','nolimit','addConfiguration','AccountId','Subjects','Descriptions','getDescriptions','channel','getFields','username','remoteUri','apiKey','substring','GET','format'];(function(_0x697bfe,_0x1fa1c4){var _0x18221b=function(_0xa9ad){while(--_0xa9ad){_0x697bfe['push'](_0x697bfe['shift']());}};_0x18221b(++_0x1fa1c4);}(_0x9564,0x144));var _0x4956=function(_0x12ba3d,_0x5eae0d){_0x12ba3d=_0x12ba3d-0x0;var _0x178544=_0x9564[_0x12ba3d];return _0x178544;};'use strict';var emlformat=require(_0x4956('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4956('0x1'));var jsonpatch=require(_0x4956('0x2'));var rp=require(_0x4956('0x3'));var moment=require(_0x4956('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4956('0x5'));var util=require(_0x4956('0x6'));var path=require(_0x4956('0x7'));var sox=require('sox');var csv=require(_0x4956('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4956('0x9'));var _=require(_0x4956('0xa'));var squel=require(_0x4956('0xb'));var crypto=require('crypto');var jsforce=require(_0x4956('0xc'));var deskjs=require(_0x4956('0xd'));var toCsv=require(_0x4956('0x8'));var querystring=require('querystring');var Papa=require(_0x4956('0xe'));var Redis=require(_0x4956('0xf'));var authService=require(_0x4956('0x10'));var qs=require(_0x4956('0x11'));var as=require(_0x4956('0x12'));var hardwareService=require(_0x4956('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x4956('0x14'));var config=require(_0x4956('0x15'));var licenseUtil=require(_0x4956('0x16'));var db=require(_0x4956('0x17'))['db'];var integrations=require(_0x4956('0x18'));function respondWithStatusCode(_0x59a3e9,_0x1d1bad){_0x1d1bad=_0x1d1bad||0xcc;return function(_0x1575ec){if(_0x1575ec){return _0x59a3e9[_0x4956('0x19')](_0x1d1bad);}return _0x59a3e9[_0x4956('0x1a')](_0x1d1bad)[_0x4956('0x1b')]();};}function respondWithResult(_0xfcce00,_0x3dbbcb){_0x3dbbcb=_0x3dbbcb||0xc8;return function(_0x1ca90d){if(_0x1ca90d){return _0xfcce00['status'](_0x3dbbcb)[_0x4956('0x1c')](_0x1ca90d);}};}function respondWithFilteredResult(_0x4e3bc9,_0x391be1){return function(_0x1732f3){if(_0x1732f3){var _0x2721ef=typeof _0x391be1[_0x4956('0x1d')]==='undefined'&&typeof _0x391be1['limit']===_0x4956('0x1e');var _0x3956e8=_0x1732f3[_0x4956('0x1f')];var _0x42f63e=_0x2721ef?0x0:_0x391be1[_0x4956('0x1d')];var _0x12c010=_0x2721ef?_0x1732f3[_0x4956('0x1f')]:_0x391be1[_0x4956('0x1d')]+_0x391be1[_0x4956('0x20')];var _0x4344de;if(_0x12c010>=_0x3956e8){_0x12c010=_0x3956e8;_0x4344de=0xc8;}else{_0x4344de=0xce;}_0x4e3bc9[_0x4956('0x1a')](_0x4344de);return _0x4e3bc9[_0x4956('0x21')](_0x4956('0x22'),_0x42f63e+'-'+_0x12c010+'/'+_0x3956e8)['json'](_0x1732f3);}return null;};}function patchUpdates(_0x4f52aa){return function(_0x55461d){try{jsonpatch[_0x4956('0x23')](_0x55461d,_0x4f52aa,!![]);}catch(_0x11d301){return BPromise[_0x4956('0x24')](_0x11d301);}return _0x55461d[_0x4956('0x25')]();};}function saveUpdates(_0x5d384a,_0xb8a754){return function(_0x53ec7f){if(_0x53ec7f){return _0x53ec7f[_0x4956('0x26')](_0x5d384a)[_0x4956('0x27')](function(_0x33fb4b){return _0x33fb4b;});}return null;};}function removeEntity(_0x12b27,_0x49b142){return function(_0x478d16){if(_0x478d16){return _0x478d16[_0x4956('0x28')]()[_0x4956('0x27')](function(){_0x12b27['status'](0xcc)[_0x4956('0x1b')]();});}};}function handleEntityNotFound(_0x485be7,_0xd56591){return function(_0x301c57){if(!_0x301c57){_0x485be7[_0x4956('0x19')](0x194);}return _0x301c57;};}function handleError(_0x50a9ae,_0x38c802){_0x38c802=_0x38c802||0x1f4;return function(_0x464069){logger[_0x4956('0x29')](_0x464069[_0x4956('0x2a')]);if(_0x464069['name']){delete _0x464069[_0x4956('0x2b')];}_0x50a9ae[_0x4956('0x1a')](_0x38c802)[_0x4956('0x2c')](_0x464069);};}exports[_0x4956('0x2d')]=function(_0x557d19,_0x3cd0ce){var _0xcbe763={},_0x20125c={},_0x14fe4f={'count':0x0,'rows':[]};var _0xef47b4=_[_0x4956('0x2e')](db['FreshsalesAccount'][_0x4956('0x2f')],function(_0x3f7f55){return{'name':_0x3f7f55[_0x4956('0x30')],'type':_0x3f7f55[_0x4956('0x31')][_0x4956('0x32')]};});_0x20125c['model']=_[_0x4956('0x2e')](_0xef47b4,_0x4956('0x2b'));_0x20125c[_0x4956('0x33')]=_[_0x4956('0x34')](_0x557d19[_0x4956('0x33')]);_0x20125c[_0x4956('0x35')]=_[_0x4956('0x36')](_0x20125c[_0x4956('0x37')],_0x20125c['query']);_0xcbe763[_0x4956('0x38')]=_[_0x4956('0x36')](_0x20125c[_0x4956('0x37')],qs[_0x4956('0x39')](_0x557d19[_0x4956('0x33')][_0x4956('0x39')]));_0xcbe763[_0x4956('0x38')]=_0xcbe763[_0x4956('0x38')][_0x4956('0x3a')]?_0xcbe763['attributes']:_0x20125c[_0x4956('0x37')];if(!_0x557d19[_0x4956('0x33')][_0x4956('0x3b')]('nolimit')){_0xcbe763[_0x4956('0x20')]=qs[_0x4956('0x20')](_0x557d19['query'][_0x4956('0x20')]);_0xcbe763[_0x4956('0x1d')]=qs['offset'](_0x557d19[_0x4956('0x33')][_0x4956('0x1d')]);}_0xcbe763[_0x4956('0x3c')]=qs[_0x4956('0x3d')](_0x557d19[_0x4956('0x33')]['sort']);_0xcbe763['where']=qs[_0x4956('0x35')](_[_0x4956('0x3e')](_0x557d19[_0x4956('0x33')],_0x20125c['filters']),_0xef47b4);if(_0x557d19[_0x4956('0x33')][_0x4956('0x3f')]){_0xcbe763['where']=_[_0x4956('0x40')](_0xcbe763['where'],{'$or':_[_0x4956('0x2e')](_0xef47b4,function(_0x2db149){if(_0x2db149[_0x4956('0x31')]!==_0x4956('0x41')){var _0xbca977={};_0xbca977[_0x2db149[_0x4956('0x2b')]]={'$like':'%'+_0x557d19[_0x4956('0x33')][_0x4956('0x3f')]+'%'};return _0xbca977;}})});}_0xcbe763=_[_0x4956('0x40')]({},_0xcbe763,_0x557d19[_0x4956('0x42')]);var _0x38ca56={'where':_0xcbe763[_0x4956('0x43')]};return db[_0x4956('0x44')][_0x4956('0x1f')](_0x38ca56)['then'](function(_0x3ebf58){_0x14fe4f[_0x4956('0x1f')]=_0x3ebf58;if(_0x557d19['query'][_0x4956('0x45')]){_0xcbe763[_0x4956('0x46')]=[{'all':!![]}];}return db['FreshsalesAccount'][_0x4956('0x47')](_0xcbe763);})[_0x4956('0x27')](function(_0xc7938d){_0x14fe4f[_0x4956('0x48')]=_0xc7938d;return _0x14fe4f;})['then'](respondWithFilteredResult(_0x3cd0ce,_0xcbe763))[_0x4956('0x49')](handleError(_0x3cd0ce,null));};exports[_0x4956('0x4a')]=function(_0x3037e7,_0x3fbdde){var _0x13f330={'raw':![],'where':{'id':_0x3037e7[_0x4956('0x4b')]['id']}},_0x648e5b={};_0x648e5b[_0x4956('0x37')]=_[_0x4956('0x34')](db[_0x4956('0x44')][_0x4956('0x2f')]);_0x648e5b['query']=_[_0x4956('0x34')](_0x3037e7[_0x4956('0x33')]);_0x648e5b['filters']=_[_0x4956('0x36')](_0x648e5b[_0x4956('0x37')],_0x648e5b[_0x4956('0x33')]);_0x13f330[_0x4956('0x38')]=_['intersection'](_0x648e5b[_0x4956('0x37')],qs[_0x4956('0x39')](_0x3037e7[_0x4956('0x33')][_0x4956('0x39')]));_0x13f330[_0x4956('0x38')]=_0x13f330['attributes'][_0x4956('0x3a')]?_0x13f330[_0x4956('0x38')]:_0x648e5b['model'];if(_0x3037e7[_0x4956('0x33')][_0x4956('0x45')]){_0x13f330[_0x4956('0x46')]=[{'all':!![]}];}_0x13f330=_['merge']({},_0x13f330,_0x3037e7[_0x4956('0x42')]);return db[_0x4956('0x44')][_0x4956('0x4c')](_0x13f330)[_0x4956('0x27')](handleEntityNotFound(_0x3fbdde,null))['then'](respondWithResult(_0x3fbdde,null))['catch'](handleError(_0x3fbdde,null));};exports[_0x4956('0x4d')]=function(_0x1387c4,_0x293df9){return db[_0x4956('0x44')][_0x4956('0x4d')](_0x1387c4[_0x4956('0x4e')],{})['then'](respondWithResult(_0x293df9,0xc9))['catch'](handleError(_0x293df9,null));};exports['update']=function(_0x5a5091,_0x345388){if(_0x5a5091['body']['id']){delete _0x5a5091['body']['id'];}return db['FreshsalesAccount'][_0x4956('0x4c')]({'where':{'id':_0x5a5091['params']['id']}})[_0x4956('0x27')](handleEntityNotFound(_0x345388,null))['then'](saveUpdates(_0x5a5091[_0x4956('0x4e')],null))[_0x4956('0x27')](respondWithResult(_0x345388,null))[_0x4956('0x49')](handleError(_0x345388,null));};exports[_0x4956('0x28')]=function(_0x334399,_0xeec323){return db[_0x4956('0x44')][_0x4956('0x4c')]({'where':{'id':_0x334399[_0x4956('0x4b')]['id']}})[_0x4956('0x27')](handleEntityNotFound(_0xeec323,null))[_0x4956('0x27')](removeEntity(_0xeec323,null))[_0x4956('0x49')](handleError(_0xeec323,null));};exports[_0x4956('0x4f')]=function(_0x554ed0,_0x4880e9,_0x45aea2){var _0x4a8e5c={};var _0x34df19={};var _0x4671e6;var _0x44561c;return db[_0x4956('0x44')][_0x4956('0x50')]({'where':{'id':_0x554ed0[_0x4956('0x4b')]['id']}})['then'](handleEntityNotFound(_0x4880e9,null))[_0x4956('0x27')](function(_0x4c4f08){if(_0x4c4f08){_0x4671e6=_0x4c4f08;_0x34df19[_0x4956('0x37')]=_['keys'](db[_0x4956('0x51')][_0x4956('0x2f')]);_0x34df19[_0x4956('0x33')]=_['keys'](_0x554ed0['query']);_0x34df19['filters']=_[_0x4956('0x36')](_0x34df19['model'],_0x34df19[_0x4956('0x33')]);_0x4a8e5c[_0x4956('0x38')]=_['intersection'](_0x34df19[_0x4956('0x37')],qs['fields'](_0x554ed0[_0x4956('0x33')][_0x4956('0x39')]));_0x4a8e5c[_0x4956('0x38')]=_0x4a8e5c[_0x4956('0x38')][_0x4956('0x3a')]?_0x4a8e5c['attributes']:_0x34df19[_0x4956('0x37')];_0x4a8e5c[_0x4956('0x3c')]=qs['sort'](_0x554ed0[_0x4956('0x33')][_0x4956('0x3d')]);_0x4a8e5c[_0x4956('0x43')]=qs[_0x4956('0x35')](_[_0x4956('0x3e')](_0x554ed0['query'],_0x34df19[_0x4956('0x35')]));if(_0x554ed0['query']['filter']){_0x4a8e5c[_0x4956('0x43')]=_[_0x4956('0x40')](_0x4a8e5c[_0x4956('0x43')],{'$or':_[_0x4956('0x2e')](_0x4a8e5c[_0x4956('0x38')],function(_0x442322){var _0x36ae68={};_0x36ae68[_0x442322]={'$like':'%'+_0x554ed0[_0x4956('0x33')]['filter']+'%'};return _0x36ae68;})});}_0x4a8e5c=_['merge']({},_0x4a8e5c,_0x554ed0[_0x4956('0x42')]);return _0x4671e6[_0x4956('0x4f')](_0x4a8e5c);}})[_0x4956('0x27')](function(_0x3f5a3a){if(_0x3f5a3a){_0x44561c=_0x3f5a3a[_0x4956('0x3a')];if(!_0x554ed0[_0x4956('0x33')][_0x4956('0x3b')](_0x4956('0x52'))){_0x4a8e5c[_0x4956('0x20')]=qs[_0x4956('0x20')](_0x554ed0[_0x4956('0x33')]['limit']);_0x4a8e5c[_0x4956('0x1d')]=qs[_0x4956('0x1d')](_0x554ed0[_0x4956('0x33')][_0x4956('0x1d')]);}return _0x4671e6[_0x4956('0x4f')](_0x4a8e5c);}})[_0x4956('0x27')](function(_0x571df5){if(_0x571df5){return _0x571df5?{'count':_0x44561c,'rows':_0x571df5}:null;}})[_0x4956('0x27')](respondWithResult(_0x4880e9,null))[_0x4956('0x49')](handleError(_0x4880e9,null));};exports[_0x4956('0x53')]=function(_0x9b4f,_0x3e04cf,_0x20dd23){if(_0x9b4f[_0x4956('0x4e')]['id']){delete _0x9b4f[_0x4956('0x4e')]['id'];}return db[_0x4956('0x44')][_0x4956('0x50')]({'where':{'id':_0x9b4f[_0x4956('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3e04cf,null))['then'](function(_0x1f1314){if(_0x1f1314){_0x9b4f[_0x4956('0x4e')][_0x4956('0x54')]=_0x1f1314['id'];_0x9b4f[_0x4956('0x4e')][_0x4956('0x55')]=integrations['getSubjects'](_0x9b4f['body']['channel'],_0x9b4f['body'][_0x4956('0x31')]);_0x9b4f[_0x4956('0x4e')][_0x4956('0x56')]=integrations[_0x4956('0x57')](_0x9b4f[_0x4956('0x4e')][_0x4956('0x58')],_0x9b4f[_0x4956('0x4e')][_0x4956('0x31')]);return db[_0x4956('0x51')][_0x4956('0x4d')](_0x9b4f['body'],{'include':[{'model':db['FreshsalesField'],'as':_0x4956('0x55')},{'model':db['FreshsalesField'],'as':_0x4956('0x56')}]});}return null;})['then'](respondWithResult(_0x3e04cf,null))[_0x4956('0x49')](handleError(_0x3e04cf,null));};exports[_0x4956('0x59')]=function(_0x452e4f,_0x21b176,_0x343596){var _0x3ad97b='';var _0x5a5d79='';return db[_0x4956('0x44')][_0x4956('0x50')]({'where':{'id':_0x452e4f[_0x4956('0x4b')]['id']},'attributes':['id',_0x4956('0x5a'),_0x4956('0x5b'),_0x4956('0x5c')]})['then'](handleEntityNotFound(_0x21b176,null))[_0x4956('0x27')](function(_0x1feb58){if(_0x1feb58){_0x5a5d79=_0x1feb58[_0x4956('0x5a')];_0x3ad97b=_0x1feb58[_0x4956('0x5b')];var _0x4aec1b=_0x1feb58[_0x4956('0x5b')]['slice'](-0x1);if(_0x4aec1b==='/'){_0x3ad97b=_0x3ad97b[_0x4956('0x5d')](0x0,_0x3ad97b['lastIndexOf'](_0x4aec1b));}return rp({'method':_0x4956('0x5e'),'uri':util[_0x4956('0x5f')](_0x4956('0x60'),_0x3ad97b,_0x4956('0x61')),'headers':{'Authorization':'Token\x20token='+_0x1feb58[_0x4956('0x5c')]},'json':!![]});}})[_0x4956('0x27')](function(_0x193956){if(_0x193956){var _0x5d1aab=_0x193956[_0x4956('0x62')];var _0x2466c0=![];var _0xa2e1e4=null;for(_0xa2e1e4=0x0;_0xa2e1e4<_0x5d1aab[_0x4956('0x3a')];_0xa2e1e4++){if(_0x5d1aab[_0xa2e1e4][_0x4956('0x63')]===_0x5a5d79){_0x2466c0=!![];}}if(_0x2466c0){return!![];}else{throw new Error({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}})[_0x4956('0x27')](respondWithResult(_0x21b176,null))['catch'](function(_0x473a69){var _0x5cdfec=_0x452e4f[_0x4956('0x33')][_0x4956('0x64')]?0x1f4:_0x473a69[_0x4956('0x65')]||0x1f4;logger['error'](_0x4956('0x66'),_0x4956('0x59'),_0x5cdfec,JSON[_0x4956('0x67')](_0x473a69));delete _0x473a69['name'];if(_0x5cdfec===0x191){_0x5cdfec=0x190;}_0x21b176['status'](_0x5cdfec)[_0x4956('0x2c')](_0x452e4f[_0x4956('0x33')][_0x4956('0x64')]?{'message':_0x4956('0x68'),'statusCode':_0x473a69['statusCode']}:_0x473a69);});};
\ No newline at end of file
+var _0x481e=['where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','getConfigurations','FreshsalesConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','getFields','findOne','username','remoteUri','apiKey','substring','%s%s','users','Requested\x20Resource\x20not\x20Found','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','json','reject','update','then','destroy','error','stack','name','send','map','FreshsalesAccount','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0x481e,0x83));var _0xe481=function(_0x1bb8e0,_0xd66e71){_0x1bb8e0=_0x1bb8e0-0x0;var _0x3f497f=_0x481e[_0x1bb8e0];return _0x3f497f;};'use strict';var emlformat=require(_0xe481('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe481('0x1'));var jsonpatch=require(_0xe481('0x2'));var rp=require(_0xe481('0x3'));var moment=require('moment');var BPromise=require(_0xe481('0x4'));var Mustache=require(_0xe481('0x5'));var util=require(_0xe481('0x6'));var path=require(_0xe481('0x7'));var sox=require(_0xe481('0x8'));var csv=require(_0xe481('0x9'));var ejs=require(_0xe481('0xa'));var fs=require('fs');var fs_extra=require(_0xe481('0xb'));var _=require('lodash');var squel=require(_0xe481('0xc'));var crypto=require('crypto');var jsforce=require(_0xe481('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xe481('0xe'));var Papa=require('papaparse');var Redis=require(_0xe481('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xe481('0x10'));var as=require(_0xe481('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe481('0x12'))(_0xe481('0x13'));var utils=require('../../config/utils');var config=require(_0xe481('0x14'));var licenseUtil=require(_0xe481('0x15'));var db=require(_0xe481('0x16'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x5151f,_0x114692){_0x114692=_0x114692||0xcc;return function(_0x13a793){if(_0x13a793){return _0x5151f[_0xe481('0x17')](_0x114692);}return _0x5151f[_0xe481('0x18')](_0x114692)[_0xe481('0x19')]();};}function respondWithResult(_0x2c252c,_0x34b5df){_0x34b5df=_0x34b5df||0xc8;return function(_0x21be5e){if(_0x21be5e){return _0x2c252c[_0xe481('0x18')](_0x34b5df)['json'](_0x21be5e);}};}function respondWithFilteredResult(_0x321c94,_0x48acbf){return function(_0x10b9df){if(_0x10b9df){var _0x44af26=typeof _0x48acbf['offset']===_0xe481('0x1a')&&typeof _0x48acbf[_0xe481('0x1b')]==='undefined';var _0xf1bef6=_0x10b9df[_0xe481('0x1c')];var _0xf0d801=_0x44af26?0x0:_0x48acbf[_0xe481('0x1d')];var _0x49b2f2=_0x44af26?_0x10b9df[_0xe481('0x1c')]:_0x48acbf[_0xe481('0x1d')]+_0x48acbf[_0xe481('0x1b')];var _0x2ef390;if(_0x49b2f2>=_0xf1bef6){_0x49b2f2=_0xf1bef6;_0x2ef390=0xc8;}else{_0x2ef390=0xce;}_0x321c94[_0xe481('0x18')](_0x2ef390);return _0x321c94[_0xe481('0x1e')]('Content-Range',_0xf0d801+'-'+_0x49b2f2+'/'+_0xf1bef6)[_0xe481('0x1f')](_0x10b9df);}return null;};}function patchUpdates(_0x65dc55){return function(_0x73326e){try{jsonpatch['apply'](_0x73326e,_0x65dc55,!![]);}catch(_0x7d4790){return BPromise[_0xe481('0x20')](_0x7d4790);}return _0x73326e['save']();};}function saveUpdates(_0x316af8,_0x45b9f9){return function(_0x4f04fc){if(_0x4f04fc){return _0x4f04fc[_0xe481('0x21')](_0x316af8)[_0xe481('0x22')](function(_0x1c2c04){return _0x1c2c04;});}return null;};}function removeEntity(_0x2da3a7,_0x43f30b){return function(_0x533dd2){if(_0x533dd2){return _0x533dd2[_0xe481('0x23')]()[_0xe481('0x22')](function(){_0x2da3a7[_0xe481('0x18')](0xcc)[_0xe481('0x19')]();});}};}function handleEntityNotFound(_0x172014,_0x9858b){return function(_0x19f4df){if(!_0x19f4df){_0x172014[_0xe481('0x17')](0x194);}return _0x19f4df;};}function handleError(_0x1150e2,_0x383b7d){_0x383b7d=_0x383b7d||0x1f4;return function(_0xb9e5dd){logger[_0xe481('0x24')](_0xb9e5dd[_0xe481('0x25')]);if(_0xb9e5dd['name']){delete _0xb9e5dd[_0xe481('0x26')];}_0x1150e2[_0xe481('0x18')](_0x383b7d)[_0xe481('0x27')](_0xb9e5dd);};}exports['index']=function(_0x377a5c,_0x1470c8){var _0x144367={},_0x16d0f6={},_0x11e768={'count':0x0,'rows':[]};var _0x5cb8a0=_[_0xe481('0x28')](db[_0xe481('0x29')][_0xe481('0x2a')],function(_0x52d28f){return{'name':_0x52d28f[_0xe481('0x2b')],'type':_0x52d28f[_0xe481('0x2c')]['key']};});_0x16d0f6['model']=_['map'](_0x5cb8a0,_0xe481('0x26'));_0x16d0f6[_0xe481('0x2d')]=_[_0xe481('0x2e')](_0x377a5c['query']);_0x16d0f6[_0xe481('0x2f')]=_[_0xe481('0x30')](_0x16d0f6[_0xe481('0x31')],_0x16d0f6[_0xe481('0x2d')]);_0x144367[_0xe481('0x32')]=_[_0xe481('0x30')](_0x16d0f6[_0xe481('0x31')],qs['fields'](_0x377a5c[_0xe481('0x2d')][_0xe481('0x33')]));_0x144367[_0xe481('0x32')]=_0x144367[_0xe481('0x32')][_0xe481('0x34')]?_0x144367[_0xe481('0x32')]:_0x16d0f6[_0xe481('0x31')];if(!_0x377a5c[_0xe481('0x2d')][_0xe481('0x35')](_0xe481('0x36'))){_0x144367[_0xe481('0x1b')]=qs[_0xe481('0x1b')](_0x377a5c[_0xe481('0x2d')][_0xe481('0x1b')]);_0x144367[_0xe481('0x1d')]=qs[_0xe481('0x1d')](_0x377a5c[_0xe481('0x2d')][_0xe481('0x1d')]);}_0x144367[_0xe481('0x37')]=qs[_0xe481('0x38')](_0x377a5c[_0xe481('0x2d')][_0xe481('0x38')]);_0x144367[_0xe481('0x39')]=qs[_0xe481('0x2f')](_[_0xe481('0x3a')](_0x377a5c[_0xe481('0x2d')],_0x16d0f6['filters']),_0x5cb8a0);if(_0x377a5c['query'][_0xe481('0x3b')]){_0x144367[_0xe481('0x39')]=_[_0xe481('0x3c')](_0x144367[_0xe481('0x39')],{'$or':_[_0xe481('0x28')](_0x5cb8a0,function(_0x243240){if(_0x243240[_0xe481('0x2c')]!==_0xe481('0x3d')){var _0x3b934b={};_0x3b934b[_0x243240[_0xe481('0x26')]]={'$like':'%'+_0x377a5c[_0xe481('0x2d')][_0xe481('0x3b')]+'%'};return _0x3b934b;}})});}_0x144367=_[_0xe481('0x3c')]({},_0x144367,_0x377a5c[_0xe481('0x3e')]);var _0xf3134d={'where':_0x144367[_0xe481('0x39')]};return db[_0xe481('0x29')][_0xe481('0x1c')](_0xf3134d)[_0xe481('0x22')](function(_0x248196){_0x11e768['count']=_0x248196;if(_0x377a5c[_0xe481('0x2d')][_0xe481('0x3f')]){_0x144367[_0xe481('0x40')]=[{'all':!![]}];}return db['FreshsalesAccount'][_0xe481('0x41')](_0x144367);})[_0xe481('0x22')](function(_0x1a4149){_0x11e768[_0xe481('0x42')]=_0x1a4149;return _0x11e768;})[_0xe481('0x22')](respondWithFilteredResult(_0x1470c8,_0x144367))[_0xe481('0x43')](handleError(_0x1470c8,null));};exports[_0xe481('0x44')]=function(_0xf8e312,_0x1ccdb8){var _0x2c743f={'raw':![],'where':{'id':_0xf8e312[_0xe481('0x45')]['id']}},_0x4685f3={};_0x4685f3[_0xe481('0x31')]=_[_0xe481('0x2e')](db[_0xe481('0x29')][_0xe481('0x2a')]);_0x4685f3['query']=_[_0xe481('0x2e')](_0xf8e312[_0xe481('0x2d')]);_0x4685f3[_0xe481('0x2f')]=_[_0xe481('0x30')](_0x4685f3[_0xe481('0x31')],_0x4685f3[_0xe481('0x2d')]);_0x2c743f[_0xe481('0x32')]=_['intersection'](_0x4685f3[_0xe481('0x31')],qs[_0xe481('0x33')](_0xf8e312[_0xe481('0x2d')][_0xe481('0x33')]));_0x2c743f[_0xe481('0x32')]=_0x2c743f[_0xe481('0x32')][_0xe481('0x34')]?_0x2c743f[_0xe481('0x32')]:_0x4685f3[_0xe481('0x31')];if(_0xf8e312[_0xe481('0x2d')][_0xe481('0x3f')]){_0x2c743f[_0xe481('0x40')]=[{'all':!![]}];}_0x2c743f=_[_0xe481('0x3c')]({},_0x2c743f,_0xf8e312[_0xe481('0x3e')]);return db[_0xe481('0x29')][_0xe481('0x46')](_0x2c743f)[_0xe481('0x22')](handleEntityNotFound(_0x1ccdb8,null))[_0xe481('0x22')](respondWithResult(_0x1ccdb8,null))['catch'](handleError(_0x1ccdb8,null));};exports[_0xe481('0x47')]=function(_0x3ac04a,_0x3e9f74){return db[_0xe481('0x29')][_0xe481('0x47')](_0x3ac04a[_0xe481('0x48')],{})[_0xe481('0x22')](respondWithResult(_0x3e9f74,0xc9))['catch'](handleError(_0x3e9f74,null));};exports[_0xe481('0x21')]=function(_0x2b88c0,_0x1e11ce){if(_0x2b88c0['body']['id']){delete _0x2b88c0[_0xe481('0x48')]['id'];}return db[_0xe481('0x29')][_0xe481('0x46')]({'where':{'id':_0x2b88c0[_0xe481('0x45')]['id']}})['then'](handleEntityNotFound(_0x1e11ce,null))['then'](saveUpdates(_0x2b88c0[_0xe481('0x48')],null))[_0xe481('0x22')](respondWithResult(_0x1e11ce,null))[_0xe481('0x43')](handleError(_0x1e11ce,null));};exports[_0xe481('0x23')]=function(_0x433792,_0x5ae6ee){return db[_0xe481('0x29')][_0xe481('0x46')]({'where':{'id':_0x433792[_0xe481('0x45')]['id']}})[_0xe481('0x22')](handleEntityNotFound(_0x5ae6ee,null))[_0xe481('0x22')](removeEntity(_0x5ae6ee,null))['catch'](handleError(_0x5ae6ee,null));};exports[_0xe481('0x49')]=function(_0x22898c,_0x4b33b6,_0x50b619){var _0x306ec4={};var _0x21ce12={};var _0x485ef;var _0x445781;return db['FreshsalesAccount']['findOne']({'where':{'id':_0x22898c[_0xe481('0x45')]['id']}})[_0xe481('0x22')](handleEntityNotFound(_0x4b33b6,null))[_0xe481('0x22')](function(_0x3dcdeb){if(_0x3dcdeb){_0x485ef=_0x3dcdeb;_0x21ce12[_0xe481('0x31')]=_[_0xe481('0x2e')](db[_0xe481('0x4a')]['rawAttributes']);_0x21ce12[_0xe481('0x2d')]=_[_0xe481('0x2e')](_0x22898c[_0xe481('0x2d')]);_0x21ce12[_0xe481('0x2f')]=_[_0xe481('0x30')](_0x21ce12['model'],_0x21ce12['query']);_0x306ec4[_0xe481('0x32')]=_[_0xe481('0x30')](_0x21ce12[_0xe481('0x31')],qs[_0xe481('0x33')](_0x22898c[_0xe481('0x2d')][_0xe481('0x33')]));_0x306ec4[_0xe481('0x32')]=_0x306ec4[_0xe481('0x32')][_0xe481('0x34')]?_0x306ec4[_0xe481('0x32')]:_0x21ce12[_0xe481('0x31')];_0x306ec4['order']=qs[_0xe481('0x38')](_0x22898c['query'][_0xe481('0x38')]);_0x306ec4['where']=qs[_0xe481('0x2f')](_[_0xe481('0x3a')](_0x22898c[_0xe481('0x2d')],_0x21ce12[_0xe481('0x2f')]));if(_0x22898c[_0xe481('0x2d')][_0xe481('0x3b')]){_0x306ec4[_0xe481('0x39')]=_['merge'](_0x306ec4[_0xe481('0x39')],{'$or':_['map'](_0x306ec4[_0xe481('0x32')],function(_0x198b34){var _0x4685e4={};_0x4685e4[_0x198b34]={'$like':'%'+_0x22898c[_0xe481('0x2d')][_0xe481('0x3b')]+'%'};return _0x4685e4;})});}_0x306ec4=_[_0xe481('0x3c')]({},_0x306ec4,_0x22898c[_0xe481('0x3e')]);return _0x485ef[_0xe481('0x49')](_0x306ec4);}})[_0xe481('0x22')](function(_0x383be8){if(_0x383be8){_0x445781=_0x383be8['length'];if(!_0x22898c['query'][_0xe481('0x35')](_0xe481('0x36'))){_0x306ec4[_0xe481('0x1b')]=qs['limit'](_0x22898c[_0xe481('0x2d')]['limit']);_0x306ec4['offset']=qs[_0xe481('0x1d')](_0x22898c['query'][_0xe481('0x1d')]);}return _0x485ef[_0xe481('0x49')](_0x306ec4);}})[_0xe481('0x22')](function(_0x4b758f){if(_0x4b758f){return _0x4b758f?{'count':_0x445781,'rows':_0x4b758f}:null;}})[_0xe481('0x22')](respondWithResult(_0x4b33b6,null))[_0xe481('0x43')](handleError(_0x4b33b6,null));};exports['addConfiguration']=function(_0x188246,_0x2e9e5c,_0x2a730a){if(_0x188246[_0xe481('0x48')]['id']){delete _0x188246['body']['id'];}return db[_0xe481('0x29')]['findOne']({'where':{'id':_0x188246[_0xe481('0x45')]['id']}})[_0xe481('0x22')](handleEntityNotFound(_0x2e9e5c,null))['then'](function(_0xdb1dbe){if(_0xdb1dbe){_0x188246['body'][_0xe481('0x4b')]=_0xdb1dbe['id'];_0x188246[_0xe481('0x48')][_0xe481('0x4c')]=integrations[_0xe481('0x4d')](_0x188246[_0xe481('0x48')][_0xe481('0x4e')],_0x188246[_0xe481('0x48')][_0xe481('0x2c')]);_0x188246[_0xe481('0x48')][_0xe481('0x4f')]=integrations[_0xe481('0x50')](_0x188246[_0xe481('0x48')][_0xe481('0x4e')],_0x188246[_0xe481('0x48')][_0xe481('0x2c')]);return db['FreshsalesConfiguration']['create'](_0x188246['body'],{'include':[{'model':db['FreshsalesField'],'as':_0xe481('0x4c')},{'model':db['FreshsalesField'],'as':_0xe481('0x4f')}]});}return null;})[_0xe481('0x22')](respondWithResult(_0x2e9e5c,null))[_0xe481('0x43')](handleError(_0x2e9e5c,null));};exports[_0xe481('0x51')]=function(_0x4b3089,_0x5edd66,_0x533ab5){var _0x8acfd5='';var _0x342d01='';return db[_0xe481('0x29')][_0xe481('0x52')]({'where':{'id':_0x4b3089[_0xe481('0x45')]['id']},'attributes':['id',_0xe481('0x53'),_0xe481('0x54'),_0xe481('0x55')]})['then'](handleEntityNotFound(_0x5edd66,null))[_0xe481('0x22')](function(_0x3eeef4){if(_0x3eeef4){_0x342d01=_0x3eeef4[_0xe481('0x53')];_0x8acfd5=_0x3eeef4[_0xe481('0x54')];var _0x7e7071=_0x3eeef4['remoteUri']['slice'](-0x1);if(_0x7e7071==='/'){_0x8acfd5=_0x8acfd5[_0xe481('0x56')](0x0,_0x8acfd5['lastIndexOf'](_0x7e7071));}return rp({'method':'GET','uri':util['format'](_0xe481('0x57'),_0x8acfd5,'/api/selector/owners'),'headers':{'Authorization':'Token\x20token='+_0x3eeef4[_0xe481('0x55')]},'json':!![]});}})[_0xe481('0x22')](function(_0x3fcae0){if(_0x3fcae0){var _0x42ebdc=_0x3fcae0[_0xe481('0x58')];var _0x38304b=![];var _0x3f6119=null;for(_0x3f6119=0x0;_0x3f6119<_0x42ebdc['length'];_0x3f6119++){if(_0x42ebdc[_0x3f6119]['email']===_0x342d01){_0x38304b=!![];}}if(_0x38304b){return!![];}else{throw new Error({'statusCode':0x194,'message':_0xe481('0x59')});}}})['then'](respondWithResult(_0x5edd66,null))[_0xe481('0x43')](function(_0x109c5f){var _0x868d5a=_0x4b3089[_0xe481('0x2d')][_0xe481('0x5a')]?0x1f4:_0x109c5f[_0xe481('0x5b')]||0x1f4;logger[_0xe481('0x24')](_0xe481('0x5c'),_0xe481('0x51'),_0x868d5a,JSON[_0xe481('0x5d')](_0x109c5f));delete _0x109c5f[_0xe481('0x26')];if(_0x868d5a===0x191){_0x868d5a=0x190;}_0x5edd66[_0xe481('0x18')](_0x868d5a)[_0xe481('0x27')](_0x4b3089[_0xe481('0x2d')][_0xe481('0x5a')]?{'message':'Wrong\x20credentials','statusCode':_0x109c5f[_0xe481('0x5b')]}:_0x109c5f);});};
\ No newline at end of file
index 4a83fa9..904ffa9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8aad=['FreshsalesAccount','int_freshsales_accounts','lodash','util','api','bluebird','request-promise','../../config/environment','exports'];(function(_0x39609a,_0x28a563){var _0xecd92=function(_0x57241a){while(--_0x57241a){_0x39609a['push'](_0x39609a['shift']());}};_0xecd92(++_0x28a563);}(_0x8aad,0x146));var _0xd8aa=function(_0x476d43,_0x1033b){_0x476d43=_0x476d43-0x0;var _0x1f725d=_0x8aad[_0x476d43];return _0x1f725d;};'use strict';var _=require(_0xd8aa('0x0'));var util=require(_0xd8aa('0x1'));var logger=require('../../config/logger')(_0xd8aa('0x2'));var moment=require('moment');var BPromise=require(_0xd8aa('0x3'));var rp=require(_0xd8aa('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xd8aa('0x5'));var attributes=require('./intFreshsalesAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0xd8aa('0x6')]=function(_0x43ddeb,_0x16ea12){return _0x43ddeb['define'](_0xd8aa('0x7'),attributes,{'tableName':_0xd8aa('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3d04=['bluebird','request-promise','path','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration','exports','int_freshsales_accounts','lodash','util','../../config/logger','api','moment'];(function(_0x1aea5f,_0x5378c1){var _0x23dd26=function(_0x592800){while(--_0x592800){_0x1aea5f['push'](_0x1aea5f['shift']());}};_0x23dd26(++_0x5378c1);}(_0x3d04,0xbe));var _0x43d0=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x3d04[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x43d0('0x0'));var util=require(_0x43d0('0x1'));var logger=require(_0x43d0('0x2'))(_0x43d0('0x3'));var moment=require(_0x43d0('0x4'));var BPromise=require(_0x43d0('0x5'));var rp=require(_0x43d0('0x6'));var fs=require('fs');var path=require(_0x43d0('0x7'));var rimraf=require('rimraf');var config=require(_0x43d0('0x8'));var attributes=require(_0x43d0('0x9'));var integrations=require(_0x43d0('0xa'));module[_0x43d0('0xb')]=function(_0x5e284f,_0x484271){return _0x5e284f['define']('FreshsalesAccount',attributes,{'tableName':_0x43d0('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index e351541..e3ddb27 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x896e=['limit','include','model','attributes','map','ShowFreshsalesAccount','find','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','FreshsalesAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','catch','GetFreshsalesAccount','FreshsalesAccount','findAll','options','raw'];(function(_0x43a883,_0x585bb9){var _0x2a93ac=function(_0x252cfa){while(--_0x252cfa){_0x43a883['push'](_0x43a883['shift']());}};_0x2a93ac(++_0x585bb9);}(_0x896e,0x1e9));var _0xe896=function(_0x13f64d,_0x594290){_0x13f64d=_0x13f64d-0x0;var _0x273645=_0x896e[_0x13f64d];return _0x273645;};'use strict';var _=require(_0xe896('0x0'));var util=require(_0xe896('0x1'));var moment=require(_0xe896('0x2'));var BPromise=require(_0xe896('0x3'));var rs=require(_0xe896('0x4'));var fs=require('fs');var Redis=require(_0xe896('0x5'));var db=require(_0xe896('0x6'))['db'];var utils=require(_0xe896('0x7'));var logger=require(_0xe896('0x8'))(_0xe896('0x9'));var config=require(_0xe896('0xa'));var jayson=require(_0xe896('0xb'));var client=jayson['client'][_0xe896('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x7a0721,_0x3b902c,_0x264eeb){return new BPromise(function(_0x43c619,_0x5a1909){return client[_0xe896('0xd')](_0x7a0721,_0x264eeb)[_0xe896('0xe')](function(_0x37a90d){logger['info'](_0xe896('0xf'),_0x3b902c,'request\x20sent');logger[_0xe896('0x10')]('FreshsalesAccount,\x20%s,\x20%s,\x20%s',_0x3b902c,_0xe896('0x11'),JSON[_0xe896('0x12')](_0x37a90d));if(_0x37a90d[_0xe896('0x13')]){if(_0x37a90d['error'][_0xe896('0x14')]===0x1f4){logger[_0xe896('0x13')](_0xe896('0xf'),_0x3b902c,_0x37a90d['error'][_0xe896('0x15')]);return _0x5a1909(_0x37a90d[_0xe896('0x13')][_0xe896('0x15')]);}logger['error'](_0xe896('0xf'),_0x3b902c,_0x37a90d[_0xe896('0x13')][_0xe896('0x15')]);return _0x43c619(_0x37a90d['error']['message']);}else{logger[_0xe896('0x16')](_0xe896('0xf'),_0x3b902c,'request\x20sent');_0x43c619(_0x37a90d['result'][_0xe896('0x15')]);}})[_0xe896('0x17')](function(_0x57f04b){logger[_0xe896('0x13')]('FreshsalesAccount,\x20%s,\x20%s',_0x3b902c,_0x57f04b);_0x5a1909(_0x57f04b);});});}exports[_0xe896('0x18')]=function(_0x32f86d){var _0x2d4cf0=this;return new Promise(function(_0x5dc89d,_0x782813){return db[_0xe896('0x19')][_0xe896('0x1a')]({'raw':_0x32f86d[_0xe896('0x1b')]?_0x32f86d[_0xe896('0x1b')][_0xe896('0x1c')]===undefined?!![]:![]:!![],'where':_0x32f86d[_0xe896('0x1b')]?_0x32f86d[_0xe896('0x1b')]['where']||null:null,'attributes':_0x32f86d[_0xe896('0x1b')]?_0x32f86d['options']['attributes']||null:null,'limit':_0x32f86d[_0xe896('0x1b')]?_0x32f86d[_0xe896('0x1b')][_0xe896('0x1d')]||null:null,'include':_0x32f86d[_0xe896('0x1b')]?_0x32f86d['options'][_0xe896('0x1e')]?_['map'](_0x32f86d['options'][_0xe896('0x1e')],function(_0x41e689){return{'model':db[_0x41e689[_0xe896('0x1f')]],'as':_0x41e689['as'],'attributes':_0x41e689[_0xe896('0x20')],'include':_0x41e689[_0xe896('0x1e')]?_[_0xe896('0x21')](_0x41e689[_0xe896('0x1e')],function(_0x4b71cc){return{'model':db[_0x4b71cc[_0xe896('0x1f')]],'as':_0x4b71cc['as'],'attributes':_0x4b71cc[_0xe896('0x20')],'include':_0x4b71cc[_0xe896('0x1e')]?_['map'](_0x4b71cc[_0xe896('0x1e')],function(_0xd50fe2){return{'model':db[_0xd50fe2[_0xe896('0x1f')]],'as':_0xd50fe2['as'],'attributes':_0xd50fe2[_0xe896('0x20')]};}):[]};}):[]};}):[]:[]})[_0xe896('0xe')](function(_0x3f8ceb){logger['info'](_0xe896('0x18'),_0x32f86d);logger[_0xe896('0x10')](_0xe896('0x18'),_0x32f86d,JSON[_0xe896('0x12')](_0x3f8ceb));_0x5dc89d(_0x3f8ceb);})[_0xe896('0x17')](function(_0x5e0d9b){logger['error']('GetFreshsalesAccount',_0x5e0d9b['message'],_0x32f86d);_0x782813(_0x2d4cf0['error'](0x1f4,_0x5e0d9b[_0xe896('0x15')]));});});};exports[_0xe896('0x22')]=function(_0x10fd26){var _0x76c781=this;return new Promise(function(_0x3cd88e,_0x1a6090){return db[_0xe896('0x19')][_0xe896('0x23')]({'raw':_0x10fd26['options']?_0x10fd26['options'][_0xe896('0x1c')]===undefined?!![]:![]:!![],'where':_0x10fd26[_0xe896('0x1b')]?_0x10fd26[_0xe896('0x1b')][_0xe896('0x24')]||null:null,'attributes':_0x10fd26['options']?_0x10fd26[_0xe896('0x1b')]['attributes']||null:null,'include':_0x10fd26['options']?_0x10fd26[_0xe896('0x1b')][_0xe896('0x1e')]?_[_0xe896('0x21')](_0x10fd26['options']['include'],function(_0x567589){return{'model':db[_0x567589[_0xe896('0x1f')]],'as':_0x567589['as'],'attributes':_0x567589[_0xe896('0x20')],'include':_0x567589[_0xe896('0x1e')]?_[_0xe896('0x21')](_0x567589[_0xe896('0x1e')],function(_0x486eb5){return{'model':db[_0x486eb5[_0xe896('0x1f')]],'as':_0x486eb5['as'],'attributes':_0x486eb5[_0xe896('0x20')],'include':_0x486eb5[_0xe896('0x1e')]?_[_0xe896('0x21')](_0x486eb5[_0xe896('0x1e')],function(_0x2cce09){return{'model':db[_0x2cce09[_0xe896('0x1f')]],'as':_0x2cce09['as'],'attributes':_0x2cce09[_0xe896('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x42f3fb){logger[_0xe896('0x16')]('ShowFreshsalesAccount',_0x10fd26);logger[_0xe896('0x10')]('ShowFreshsalesAccount',_0x10fd26,JSON[_0xe896('0x12')](_0x42f3fb));_0x3cd88e(_0x42f3fb);})['catch'](function(_0x42f445){logger['error'](_0xe896('0x22'),_0x42f445[_0xe896('0x15')],_0x10fd26);_0x1a6090(_0x76c781[_0xe896('0x13')](0x1f4,_0x42f445[_0xe896('0x15')]));});});};
\ No newline at end of file
+var _0x524e=['http','request','then','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','FreshsalesAccount','findAll','options','raw','where','attributes','limit','include','model','map','GetFreshsalesAccount','catch','ShowFreshsalesAccount','find','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x49e5f9,_0x38d639){var _0x31aa57=function(_0x50d6ff){while(--_0x50d6ff){_0x49e5f9['push'](_0x49e5f9['shift']());}};_0x31aa57(++_0x38d639);}(_0x524e,0x15e));var _0xe524=function(_0x364f67,_0x2e0cb7){_0x364f67=_0x364f67-0x0;var _0x15f2f7=_0x524e[_0x364f67];return _0x15f2f7;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe524('0x0'));var BPromise=require(_0xe524('0x1'));var rs=require(_0xe524('0x2'));var fs=require('fs');var Redis=require(_0xe524('0x3'));var db=require(_0xe524('0x4'))['db'];var utils=require(_0xe524('0x5'));var logger=require(_0xe524('0x6'))(_0xe524('0x7'));var config=require(_0xe524('0x8'));var jayson=require(_0xe524('0x9'));var client=jayson['client'][_0xe524('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x41e1a3,_0x347bed,_0x533c14){return new BPromise(function(_0x384935,_0x3e4cda){return client[_0xe524('0xb')](_0x41e1a3,_0x533c14)[_0xe524('0xc')](function(_0x991924){logger[_0xe524('0xd')](_0xe524('0xe'),_0x347bed,_0xe524('0xf'));logger[_0xe524('0x10')](_0xe524('0x11'),_0x347bed,_0xe524('0xf'),JSON[_0xe524('0x12')](_0x991924));if(_0x991924[_0xe524('0x13')]){if(_0x991924[_0xe524('0x13')][_0xe524('0x14')]===0x1f4){logger[_0xe524('0x13')]('FreshsalesAccount,\x20%s,\x20%s',_0x347bed,_0x991924['error'][_0xe524('0x15')]);return _0x3e4cda(_0x991924[_0xe524('0x13')][_0xe524('0x15')]);}logger[_0xe524('0x13')](_0xe524('0xe'),_0x347bed,_0x991924['error'][_0xe524('0x15')]);return _0x384935(_0x991924['error'][_0xe524('0x15')]);}else{logger[_0xe524('0xd')]('FreshsalesAccount,\x20%s,\x20%s',_0x347bed,_0xe524('0xf'));_0x384935(_0x991924['result'][_0xe524('0x15')]);}})['catch'](function(_0x29a031){logger['error']('FreshsalesAccount,\x20%s,\x20%s',_0x347bed,_0x29a031);_0x3e4cda(_0x29a031);});});}exports['GetFreshsalesAccount']=function(_0x3a4027){var _0x4f1dfb=this;return new Promise(function(_0x11b2a1,_0x238f8f){return db[_0xe524('0x16')][_0xe524('0x17')]({'raw':_0x3a4027['options']?_0x3a4027[_0xe524('0x18')][_0xe524('0x19')]===undefined?!![]:![]:!![],'where':_0x3a4027['options']?_0x3a4027[_0xe524('0x18')][_0xe524('0x1a')]||null:null,'attributes':_0x3a4027[_0xe524('0x18')]?_0x3a4027[_0xe524('0x18')][_0xe524('0x1b')]||null:null,'limit':_0x3a4027[_0xe524('0x18')]?_0x3a4027[_0xe524('0x18')][_0xe524('0x1c')]||null:null,'include':_0x3a4027[_0xe524('0x18')]?_0x3a4027['options'][_0xe524('0x1d')]?_['map'](_0x3a4027['options'][_0xe524('0x1d')],function(_0x23df5e){return{'model':db[_0x23df5e[_0xe524('0x1e')]],'as':_0x23df5e['as'],'attributes':_0x23df5e[_0xe524('0x1b')],'include':_0x23df5e['include']?_[_0xe524('0x1f')](_0x23df5e['include'],function(_0x17e245){return{'model':db[_0x17e245[_0xe524('0x1e')]],'as':_0x17e245['as'],'attributes':_0x17e245[_0xe524('0x1b')],'include':_0x17e245[_0xe524('0x1d')]?_[_0xe524('0x1f')](_0x17e245[_0xe524('0x1d')],function(_0x2141db){return{'model':db[_0x2141db['model']],'as':_0x2141db['as'],'attributes':_0x2141db['attributes']};}):[]};}):[]};}):[]:[]})[_0xe524('0xc')](function(_0x45abad){logger[_0xe524('0xd')](_0xe524('0x20'),_0x3a4027);logger[_0xe524('0x10')]('GetFreshsalesAccount',_0x3a4027,JSON['stringify'](_0x45abad));_0x11b2a1(_0x45abad);})[_0xe524('0x21')](function(_0x25e7a7){logger[_0xe524('0x13')](_0xe524('0x20'),_0x25e7a7[_0xe524('0x15')],_0x3a4027);_0x238f8f(_0x4f1dfb['error'](0x1f4,_0x25e7a7[_0xe524('0x15')]));});});};exports[_0xe524('0x22')]=function(_0x4a4e15){var _0x5b7ded=this;return new Promise(function(_0x20688e,_0x376324){return db['FreshsalesAccount'][_0xe524('0x23')]({'raw':_0x4a4e15['options']?_0x4a4e15[_0xe524('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x4a4e15[_0xe524('0x18')]?_0x4a4e15[_0xe524('0x18')][_0xe524('0x1a')]||null:null,'attributes':_0x4a4e15['options']?_0x4a4e15[_0xe524('0x18')]['attributes']||null:null,'include':_0x4a4e15[_0xe524('0x18')]?_0x4a4e15[_0xe524('0x18')][_0xe524('0x1d')]?_['map'](_0x4a4e15[_0xe524('0x18')][_0xe524('0x1d')],function(_0x49c43e){return{'model':db[_0x49c43e[_0xe524('0x1e')]],'as':_0x49c43e['as'],'attributes':_0x49c43e[_0xe524('0x1b')],'include':_0x49c43e[_0xe524('0x1d')]?_[_0xe524('0x1f')](_0x49c43e['include'],function(_0x415450){return{'model':db[_0x415450[_0xe524('0x1e')]],'as':_0x415450['as'],'attributes':_0x415450[_0xe524('0x1b')],'include':_0x415450[_0xe524('0x1d')]?_[_0xe524('0x1f')](_0x415450[_0xe524('0x1d')],function(_0x2741e8){return{'model':db[_0x2741e8[_0xe524('0x1e')]],'as':_0x2741e8['as'],'attributes':_0x2741e8['attributes']};}):[]};}):[]};}):[]:[]})[_0xe524('0xc')](function(_0x56f371){logger[_0xe524('0xd')](_0xe524('0x22'),_0x4a4e15);logger['debug'](_0xe524('0x22'),_0x4a4e15,JSON['stringify'](_0x56f371));_0x20688e(_0x56f371);})[_0xe524('0x21')](function(_0x41af26){logger[_0xe524('0x13')](_0xe524('0x22'),_0x41af26[_0xe524('0x15')],_0x4a4e15);_0x376324(_0x5b7ded[_0xe524('0x13')](0x1f4,_0x41af26[_0xe524('0x15')]));});});};
\ No newline at end of file
index 19f1719..f37a174 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x794b=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/subjects','getSubjects','getDescriptions','post','create','put','update'];(function(_0xe96e1b,_0x5a0646){var _0x3445f9=function(_0x4d0736){while(--_0x4d0736){_0xe96e1b['push'](_0xe96e1b['shift']());}};_0x3445f9(++_0x5a0646);}(_0x794b,0x13b));var _0xb794=function(_0x4d28c9,_0x37d9d8){_0x4d28c9=_0x4d28c9-0x0;var _0x41795b=_0x794b[_0x4d28c9];return _0x41795b;};'use strict';var multer=require(_0xb794('0x0'));var util=require(_0xb794('0x1'));var path=require(_0xb794('0x2'));var timeout=require(_0xb794('0x3'));var express=require(_0xb794('0x4'));var router=express[_0xb794('0x5')]();var fs_extra=require(_0xb794('0x6'));var auth=require(_0xb794('0x7'));var interaction=require(_0xb794('0x8'));var config=require(_0xb794('0x9'));var controller=require(_0xb794('0xa'));router[_0xb794('0xb')]('/',auth[_0xb794('0xc')](),controller[_0xb794('0xd')]);router[_0xb794('0xb')](_0xb794('0xe'),auth['isAuthenticated'](),controller[_0xb794('0xf')]);router[_0xb794('0xb')](_0xb794('0x10'),auth[_0xb794('0xc')](),controller[_0xb794('0x11')]);router['get']('/:id/descriptions',auth[_0xb794('0xc')](),controller[_0xb794('0x12')]);router[_0xb794('0xb')]('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router[_0xb794('0x13')]('/',auth['isAuthenticated'](),controller[_0xb794('0x14')]);router[_0xb794('0x15')](_0xb794('0xe'),auth[_0xb794('0xc')](),controller[_0xb794('0x16')]);router[_0xb794('0x17')](_0xb794('0xe'),auth[_0xb794('0xc')](),controller[_0xb794('0x18')]);module[_0xb794('0x19')]=router;
\ No newline at end of file
+var _0xfd6e=['/:id','show','getSubjects','/:id/fields','getFields','post','create','put','update','destroy','path','connect-timeout','express','fs-extra','../../components/interaction/service','./intFreshsalesConfiguration.controller','get','isAuthenticated','index'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0xfd6e,0xee));var _0xefd6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfd6e[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xefd6('0x0'));var timeout=require(_0xefd6('0x1'));var express=require(_0xefd6('0x2'));var router=express['Router']();var fs_extra=require(_0xefd6('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xefd6('0x4'));var config=require('../../config/environment');var controller=require(_0xefd6('0x5'));router[_0xefd6('0x6')]('/',auth[_0xefd6('0x7')](),controller[_0xefd6('0x8')]);router[_0xefd6('0x6')](_0xefd6('0x9'),auth[_0xefd6('0x7')](),controller[_0xefd6('0xa')]);router[_0xefd6('0x6')]('/:id/subjects',auth[_0xefd6('0x7')](),controller[_0xefd6('0xb')]);router[_0xefd6('0x6')]('/:id/descriptions',auth[_0xefd6('0x7')](),controller['getDescriptions']);router[_0xefd6('0x6')](_0xefd6('0xc'),auth[_0xefd6('0x7')](),controller[_0xefd6('0xd')]);router[_0xefd6('0xe')]('/',auth['isAuthenticated'](),controller[_0xefd6('0xf')]);router[_0xefd6('0x10')]('/:id',auth[_0xefd6('0x7')](),controller[_0xefd6('0x11')]);router['delete']('/:id',auth[_0xefd6('0x7')](),controller[_0xefd6('0x12')]);module['exports']=router;
\ No newline at end of file
index 5df99e1..3d3b425 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1138=['STRING','sequelize','exports'];(function(_0x59c301,_0x359c50){var _0x3866b9=function(_0x2d380e){while(--_0x2d380e){_0x59c301['push'](_0x59c301['shift']());}};_0x3866b9(++_0x359c50);}(_0x1138,0x148));var _0x8113=function(_0x530f75,_0xf2bcd0){_0x530f75=_0x530f75-0x0;var _0x2501d1=_0x1138[_0x530f75];return _0x2501d1;};'use strict';var Sequelize=require(_0x8113('0x0'));module[_0x8113('0x1')]={'name':{'type':Sequelize[_0x8113('0x2')]},'description':{'type':Sequelize[_0x8113('0x2')]}};
\ No newline at end of file
+var _0xee59=['exports','STRING','sequelize'];(function(_0x47f47b,_0x33d82a){var _0x3e629f=function(_0x5f508a){while(--_0x5f508a){_0x47f47b['push'](_0x47f47b['shift']());}};_0x3e629f(++_0x33d82a);}(_0xee59,0x1b8));var _0x9ee5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xee59[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x9ee5('0x0'));module[_0x9ee5('0x1')]={'name':{'type':Sequelize[_0x9ee5('0x2')]},'description':{'type':Sequelize[_0x9ee5('0x2')]}};
\ No newline at end of file
index e0c28ad..bc7c7a4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc5ff=['params','FreshsalesField','getDescriptions','findOne','getFields','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','undefined','count','offset','limit','set','Content-Range','json','reject','save','update','then','destroy','error','stack','name','send','map','FreshsalesConfiguration','rawAttributes','type','model','query','filters','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','keys','intersection','find','create','body','getSubjects'];(function(_0x2e937e,_0x925b29){var _0xb9cb1b=function(_0x3fea3a){while(--_0x3fea3a){_0x2e937e['push'](_0x2e937e['shift']());}};_0xb9cb1b(++_0x925b29);}(_0xc5ff,0xab));var _0xfc5f=function(_0x3ae7e0,_0x5e4091){_0x3ae7e0=_0x3ae7e0-0x0;var _0xd914aa=_0xc5ff[_0x3ae7e0];return _0xd914aa;};'use strict';var emlformat=require(_0xfc5f('0x0'));var rimraf=require(_0xfc5f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xfc5f('0x2'));var moment=require(_0xfc5f('0x3'));var BPromise=require(_0xfc5f('0x4'));var Mustache=require(_0xfc5f('0x5'));var util=require(_0xfc5f('0x6'));var path=require(_0xfc5f('0x7'));var sox=require(_0xfc5f('0x8'));var csv=require(_0xfc5f('0x9'));var ejs=require(_0xfc5f('0xa'));var fs=require('fs');var fs_extra=require(_0xfc5f('0xb'));var _=require(_0xfc5f('0xc'));var squel=require(_0xfc5f('0xd'));var crypto=require(_0xfc5f('0xe'));var jsforce=require(_0xfc5f('0xf'));var deskjs=require(_0xfc5f('0x10'));var toCsv=require(_0xfc5f('0x9'));var querystring=require('querystring');var Papa=require(_0xfc5f('0x11'));var Redis=require(_0xfc5f('0x12'));var authService=require(_0xfc5f('0x13'));var qs=require(_0xfc5f('0x14'));var as=require(_0xfc5f('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xfc5f('0x16'))(_0xfc5f('0x17'));var utils=require(_0xfc5f('0x18'));var config=require(_0xfc5f('0x19'));var licenseUtil=require(_0xfc5f('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x175e44,_0xc4c0c3){_0xc4c0c3=_0xc4c0c3||0xcc;return function(_0x462c62){if(_0x462c62){return _0x175e44[_0xfc5f('0x1b')](_0xc4c0c3);}return _0x175e44['status'](_0xc4c0c3)[_0xfc5f('0x1c')]();};}function respondWithResult(_0xeccd77,_0x587b59){_0x587b59=_0x587b59||0xc8;return function(_0x3a93e6){if(_0x3a93e6){return _0xeccd77[_0xfc5f('0x1d')](_0x587b59)['json'](_0x3a93e6);}};}function respondWithFilteredResult(_0x146ad3,_0x13027c){return function(_0x521132){if(_0x521132){var _0x47716f=typeof _0x13027c['offset']===_0xfc5f('0x1e')&&typeof _0x13027c['limit']===_0xfc5f('0x1e');var _0x19bea3=_0x521132[_0xfc5f('0x1f')];var _0x3502e9=_0x47716f?0x0:_0x13027c[_0xfc5f('0x20')];var _0x51502d=_0x47716f?_0x521132['count']:_0x13027c[_0xfc5f('0x20')]+_0x13027c[_0xfc5f('0x21')];var _0x2f0c5f;if(_0x51502d>=_0x19bea3){_0x51502d=_0x19bea3;_0x2f0c5f=0xc8;}else{_0x2f0c5f=0xce;}_0x146ad3[_0xfc5f('0x1d')](_0x2f0c5f);return _0x146ad3[_0xfc5f('0x22')](_0xfc5f('0x23'),_0x3502e9+'-'+_0x51502d+'/'+_0x19bea3)[_0xfc5f('0x24')](_0x521132);}return null;};}function patchUpdates(_0x72fbe7){return function(_0x59ed8a){try{jsonpatch['apply'](_0x59ed8a,_0x72fbe7,!![]);}catch(_0x35896e){return BPromise[_0xfc5f('0x25')](_0x35896e);}return _0x59ed8a[_0xfc5f('0x26')]();};}function saveUpdates(_0x4a1143,_0x528d8c){return function(_0x38b1c1){if(_0x38b1c1){return _0x38b1c1[_0xfc5f('0x27')](_0x4a1143)[_0xfc5f('0x28')](function(_0x2a3280){return _0x2a3280;});}return null;};}function removeEntity(_0x7bb4e3,_0x1cf764){return function(_0x19ff30){if(_0x19ff30){return _0x19ff30[_0xfc5f('0x29')]()[_0xfc5f('0x28')](function(){_0x7bb4e3[_0xfc5f('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5de44f,_0x2d15ae){return function(_0x1f2f5e){if(!_0x1f2f5e){_0x5de44f[_0xfc5f('0x1b')](0x194);}return _0x1f2f5e;};}function handleError(_0x236923,_0x3303ef){_0x3303ef=_0x3303ef||0x1f4;return function(_0x376173){logger[_0xfc5f('0x2a')](_0x376173[_0xfc5f('0x2b')]);if(_0x376173[_0xfc5f('0x2c')]){delete _0x376173[_0xfc5f('0x2c')];}_0x236923[_0xfc5f('0x1d')](_0x3303ef)[_0xfc5f('0x2d')](_0x376173);};}exports['index']=function(_0x1882ae,_0x2ef4c0){var _0x2a67bd={},_0x5c51f4={},_0x25b3fd={'count':0x0,'rows':[]};var _0x28a0f0=_[_0xfc5f('0x2e')](db[_0xfc5f('0x2f')][_0xfc5f('0x30')],function(_0x5410ec){return{'name':_0x5410ec['fieldName'],'type':_0x5410ec[_0xfc5f('0x31')]['key']};});_0x5c51f4[_0xfc5f('0x32')]=_[_0xfc5f('0x2e')](_0x28a0f0,_0xfc5f('0x2c'));_0x5c51f4[_0xfc5f('0x33')]=_['keys'](_0x1882ae[_0xfc5f('0x33')]);_0x5c51f4[_0xfc5f('0x34')]=_['intersection'](_0x5c51f4[_0xfc5f('0x32')],_0x5c51f4[_0xfc5f('0x33')]);_0x2a67bd['attributes']=_['intersection'](_0x5c51f4[_0xfc5f('0x32')],qs[_0xfc5f('0x35')](_0x1882ae['query']['fields']));_0x2a67bd[_0xfc5f('0x36')]=_0x2a67bd[_0xfc5f('0x36')][_0xfc5f('0x37')]?_0x2a67bd[_0xfc5f('0x36')]:_0x5c51f4[_0xfc5f('0x32')];if(!_0x1882ae['query'][_0xfc5f('0x38')](_0xfc5f('0x39'))){_0x2a67bd[_0xfc5f('0x21')]=qs[_0xfc5f('0x21')](_0x1882ae[_0xfc5f('0x33')]['limit']);_0x2a67bd[_0xfc5f('0x20')]=qs['offset'](_0x1882ae[_0xfc5f('0x33')][_0xfc5f('0x20')]);}_0x2a67bd[_0xfc5f('0x3a')]=qs['sort'](_0x1882ae[_0xfc5f('0x33')][_0xfc5f('0x3b')]);_0x2a67bd['where']=qs[_0xfc5f('0x34')](_[_0xfc5f('0x3c')](_0x1882ae[_0xfc5f('0x33')],_0x5c51f4['filters']),_0x28a0f0);if(_0x1882ae[_0xfc5f('0x33')][_0xfc5f('0x3d')]){_0x2a67bd[_0xfc5f('0x3e')]=_[_0xfc5f('0x3f')](_0x2a67bd[_0xfc5f('0x3e')],{'$or':_[_0xfc5f('0x2e')](_0x28a0f0,function(_0x37c089){if(_0x37c089['type']!==_0xfc5f('0x40')){var _0x238c52={};_0x238c52[_0x37c089[_0xfc5f('0x2c')]]={'$like':'%'+_0x1882ae[_0xfc5f('0x33')][_0xfc5f('0x3d')]+'%'};return _0x238c52;}})});}_0x2a67bd=_['merge']({},_0x2a67bd,_0x1882ae[_0xfc5f('0x41')]);var _0x5aaa32={'where':_0x2a67bd[_0xfc5f('0x3e')]};return db[_0xfc5f('0x2f')][_0xfc5f('0x1f')](_0x5aaa32)[_0xfc5f('0x28')](function(_0x289c9b){_0x25b3fd[_0xfc5f('0x1f')]=_0x289c9b;if(_0x1882ae[_0xfc5f('0x33')][_0xfc5f('0x42')]){_0x2a67bd[_0xfc5f('0x43')]=[{'all':!![]}];}return db[_0xfc5f('0x2f')][_0xfc5f('0x44')](_0x2a67bd);})[_0xfc5f('0x28')](function(_0x5bb751){_0x25b3fd[_0xfc5f('0x45')]=_0x5bb751;return _0x25b3fd;})[_0xfc5f('0x28')](respondWithFilteredResult(_0x2ef4c0,_0x2a67bd))[_0xfc5f('0x46')](handleError(_0x2ef4c0,null));};exports[_0xfc5f('0x47')]=function(_0x10daa2,_0x1a1ad9){var _0x5d6bd5={'raw':![],'where':{'id':_0x10daa2['params']['id']}},_0x1f5acb={};_0x1f5acb[_0xfc5f('0x32')]=_[_0xfc5f('0x48')](db['FreshsalesConfiguration'][_0xfc5f('0x30')]);_0x1f5acb[_0xfc5f('0x33')]=_['keys'](_0x10daa2[_0xfc5f('0x33')]);_0x1f5acb['filters']=_[_0xfc5f('0x49')](_0x1f5acb['model'],_0x1f5acb['query']);_0x5d6bd5[_0xfc5f('0x36')]=_[_0xfc5f('0x49')](_0x1f5acb[_0xfc5f('0x32')],qs[_0xfc5f('0x35')](_0x10daa2['query']['fields']));_0x5d6bd5[_0xfc5f('0x36')]=_0x5d6bd5[_0xfc5f('0x36')][_0xfc5f('0x37')]?_0x5d6bd5[_0xfc5f('0x36')]:_0x1f5acb[_0xfc5f('0x32')];if(_0x10daa2[_0xfc5f('0x33')]['includeAll']){_0x5d6bd5[_0xfc5f('0x43')]=[{'all':!![]}];}_0x5d6bd5=_[_0xfc5f('0x3f')]({},_0x5d6bd5,_0x10daa2['options']);return db[_0xfc5f('0x2f')][_0xfc5f('0x4a')](_0x5d6bd5)['then'](handleEntityNotFound(_0x1a1ad9,null))[_0xfc5f('0x28')](respondWithResult(_0x1a1ad9,null))[_0xfc5f('0x46')](handleError(_0x1a1ad9,null));};exports[_0xfc5f('0x4b')]=function(_0x2d368d,_0x2c762f){return db['FreshsalesConfiguration'][_0xfc5f('0x4b')](_0x2d368d[_0xfc5f('0x4c')],{})[_0xfc5f('0x28')](respondWithResult(_0x2c762f,0xc9))[_0xfc5f('0x46')](handleError(_0x2c762f,null));};exports['update']=function(_0x23c338,_0x243cd9){if(_0x23c338[_0xfc5f('0x4c')]['id']){delete _0x23c338['body']['id'];}return db[_0xfc5f('0x2f')][_0xfc5f('0x4a')]({'where':{'id':_0x23c338['params']['id']}})['then'](handleEntityNotFound(_0x243cd9,null))['then'](saveUpdates(_0x23c338['body'],null))['then'](respondWithResult(_0x243cd9,null))[_0xfc5f('0x46')](handleError(_0x243cd9,null));};exports[_0xfc5f('0x29')]=function(_0x6b3e7e,_0x108a4c){return db['FreshsalesConfiguration'][_0xfc5f('0x4a')]({'where':{'id':_0x6b3e7e['params']['id']}})[_0xfc5f('0x28')](handleEntityNotFound(_0x108a4c,null))[_0xfc5f('0x28')](removeEntity(_0x108a4c,null))[_0xfc5f('0x46')](handleError(_0x108a4c,null));};exports[_0xfc5f('0x4d')]=function(_0x1edfa5,_0x5ef293,_0x60c7a6){var _0x42ca44={};var _0x555da1={};var _0xd99297;var _0x375250;return db[_0xfc5f('0x2f')]['findOne']({'where':{'id':_0x1edfa5[_0xfc5f('0x4e')]['id']}})[_0xfc5f('0x28')](handleEntityNotFound(_0x5ef293,null))[_0xfc5f('0x28')](function(_0x578a16){if(_0x578a16){_0xd99297=_0x578a16;_0x555da1[_0xfc5f('0x32')]=_[_0xfc5f('0x48')](db[_0xfc5f('0x4f')][_0xfc5f('0x30')]);_0x555da1[_0xfc5f('0x33')]=_[_0xfc5f('0x48')](_0x1edfa5[_0xfc5f('0x33')]);_0x555da1[_0xfc5f('0x34')]=_[_0xfc5f('0x49')](_0x555da1[_0xfc5f('0x32')],_0x555da1[_0xfc5f('0x33')]);_0x42ca44[_0xfc5f('0x36')]=_[_0xfc5f('0x49')](_0x555da1[_0xfc5f('0x32')],qs[_0xfc5f('0x35')](_0x1edfa5[_0xfc5f('0x33')][_0xfc5f('0x35')]));_0x42ca44[_0xfc5f('0x36')]=_0x42ca44[_0xfc5f('0x36')][_0xfc5f('0x37')]?_0x42ca44[_0xfc5f('0x36')]:_0x555da1[_0xfc5f('0x32')];_0x42ca44[_0xfc5f('0x3a')]=qs[_0xfc5f('0x3b')](_0x1edfa5['query'][_0xfc5f('0x3b')]);_0x42ca44[_0xfc5f('0x3e')]=qs[_0xfc5f('0x34')](_['pick'](_0x1edfa5['query'],_0x555da1[_0xfc5f('0x34')]));if(_0x1edfa5[_0xfc5f('0x33')][_0xfc5f('0x3d')]){_0x42ca44['where']=_[_0xfc5f('0x3f')](_0x42ca44[_0xfc5f('0x3e')],{'$or':_[_0xfc5f('0x2e')](_0x42ca44[_0xfc5f('0x36')],function(_0xa31941){var _0x386963={};_0x386963[_0xa31941]={'$like':'%'+_0x1edfa5[_0xfc5f('0x33')][_0xfc5f('0x3d')]+'%'};return _0x386963;})});}_0x42ca44=_[_0xfc5f('0x3f')]({},_0x42ca44,_0x1edfa5[_0xfc5f('0x41')]);return _0xd99297[_0xfc5f('0x4d')](_0x42ca44);}})[_0xfc5f('0x28')](function(_0x5d4021){if(_0x5d4021){_0x375250=_0x5d4021['length'];if(!_0x1edfa5['query'][_0xfc5f('0x38')](_0xfc5f('0x39'))){_0x42ca44[_0xfc5f('0x21')]=qs[_0xfc5f('0x21')](_0x1edfa5[_0xfc5f('0x33')][_0xfc5f('0x21')]);_0x42ca44[_0xfc5f('0x20')]=qs[_0xfc5f('0x20')](_0x1edfa5[_0xfc5f('0x33')][_0xfc5f('0x20')]);}return _0xd99297[_0xfc5f('0x4d')](_0x42ca44);}})[_0xfc5f('0x28')](function(_0xbc9aeb){if(_0xbc9aeb){return _0xbc9aeb?{'count':_0x375250,'rows':_0xbc9aeb}:null;}})[_0xfc5f('0x28')](respondWithResult(_0x5ef293,null))[_0xfc5f('0x46')](handleError(_0x5ef293,null));};exports[_0xfc5f('0x50')]=function(_0x868920,_0x45caf0,_0x221ea9){var _0x2e0ed8={};var _0x37600f={};var _0x109730;var _0x1840d0;return db[_0xfc5f('0x2f')][_0xfc5f('0x51')]({'where':{'id':_0x868920[_0xfc5f('0x4e')]['id']}})['then'](handleEntityNotFound(_0x45caf0,null))[_0xfc5f('0x28')](function(_0x46b154){if(_0x46b154){_0x109730=_0x46b154;_0x37600f[_0xfc5f('0x32')]=_[_0xfc5f('0x48')](db['FreshsalesField'][_0xfc5f('0x30')]);_0x37600f['query']=_[_0xfc5f('0x48')](_0x868920[_0xfc5f('0x33')]);_0x37600f[_0xfc5f('0x34')]=_[_0xfc5f('0x49')](_0x37600f[_0xfc5f('0x32')],_0x37600f[_0xfc5f('0x33')]);_0x2e0ed8[_0xfc5f('0x36')]=_[_0xfc5f('0x49')](_0x37600f['model'],qs[_0xfc5f('0x35')](_0x868920[_0xfc5f('0x33')][_0xfc5f('0x35')]));_0x2e0ed8[_0xfc5f('0x36')]=_0x2e0ed8[_0xfc5f('0x36')][_0xfc5f('0x37')]?_0x2e0ed8[_0xfc5f('0x36')]:_0x37600f[_0xfc5f('0x32')];_0x2e0ed8[_0xfc5f('0x3a')]=qs['sort'](_0x868920['query'][_0xfc5f('0x3b')]);_0x2e0ed8[_0xfc5f('0x3e')]=qs[_0xfc5f('0x34')](_[_0xfc5f('0x3c')](_0x868920[_0xfc5f('0x33')],_0x37600f[_0xfc5f('0x34')]));if(_0x868920[_0xfc5f('0x33')][_0xfc5f('0x3d')]){_0x2e0ed8[_0xfc5f('0x3e')]=_['merge'](_0x2e0ed8[_0xfc5f('0x3e')],{'$or':_[_0xfc5f('0x2e')](_0x2e0ed8[_0xfc5f('0x36')],function(_0x1a9da3){var _0x29544a={};_0x29544a[_0x1a9da3]={'$like':'%'+_0x868920['query'][_0xfc5f('0x3d')]+'%'};return _0x29544a;})});}_0x2e0ed8=_[_0xfc5f('0x3f')]({},_0x2e0ed8,_0x868920[_0xfc5f('0x41')]);return _0x109730[_0xfc5f('0x50')](_0x2e0ed8);}})[_0xfc5f('0x28')](function(_0x20cced){if(_0x20cced){_0x1840d0=_0x20cced[_0xfc5f('0x37')];if(!_0x868920[_0xfc5f('0x33')][_0xfc5f('0x38')]('nolimit')){_0x2e0ed8[_0xfc5f('0x21')]=qs[_0xfc5f('0x21')](_0x868920[_0xfc5f('0x33')]['limit']);_0x2e0ed8[_0xfc5f('0x20')]=qs['offset'](_0x868920[_0xfc5f('0x33')][_0xfc5f('0x20')]);}return _0x109730['getDescriptions'](_0x2e0ed8);}})[_0xfc5f('0x28')](function(_0x569782){if(_0x569782){return _0x569782?{'count':_0x1840d0,'rows':_0x569782}:null;}})['then'](respondWithResult(_0x45caf0,null))[_0xfc5f('0x46')](handleError(_0x45caf0,null));};exports[_0xfc5f('0x52')]=function(_0x5f5b30,_0x4ccc8f,_0x3ae37b){var _0x3551c4={};var _0x54d10c={};var _0x4f84c8;var _0x245d91;return db[_0xfc5f('0x2f')][_0xfc5f('0x51')]({'where':{'id':_0x5f5b30[_0xfc5f('0x4e')]['id']}})[_0xfc5f('0x28')](handleEntityNotFound(_0x4ccc8f,null))[_0xfc5f('0x28')](function(_0x11eb21){if(_0x11eb21){_0x4f84c8=_0x11eb21;_0x54d10c[_0xfc5f('0x32')]=_[_0xfc5f('0x48')](db[_0xfc5f('0x4f')][_0xfc5f('0x30')]);_0x54d10c[_0xfc5f('0x33')]=_[_0xfc5f('0x48')](_0x5f5b30['query']);_0x54d10c[_0xfc5f('0x34')]=_[_0xfc5f('0x49')](_0x54d10c[_0xfc5f('0x32')],_0x54d10c['query']);_0x3551c4[_0xfc5f('0x36')]=_[_0xfc5f('0x49')](_0x54d10c[_0xfc5f('0x32')],qs[_0xfc5f('0x35')](_0x5f5b30[_0xfc5f('0x33')][_0xfc5f('0x35')]));_0x3551c4['attributes']=_0x3551c4['attributes'][_0xfc5f('0x37')]?_0x3551c4[_0xfc5f('0x36')]:_0x54d10c[_0xfc5f('0x32')];_0x3551c4['order']=qs[_0xfc5f('0x3b')](_0x5f5b30['query'][_0xfc5f('0x3b')]);_0x3551c4['where']=qs[_0xfc5f('0x34')](_['pick'](_0x5f5b30[_0xfc5f('0x33')],_0x54d10c[_0xfc5f('0x34')]));if(_0x5f5b30['query'][_0xfc5f('0x3d')]){_0x3551c4[_0xfc5f('0x3e')]=_[_0xfc5f('0x3f')](_0x3551c4[_0xfc5f('0x3e')],{'$or':_[_0xfc5f('0x2e')](_0x3551c4[_0xfc5f('0x36')],function(_0x10235c){var _0x4b8ace={};_0x4b8ace[_0x10235c]={'$like':'%'+_0x5f5b30[_0xfc5f('0x33')][_0xfc5f('0x3d')]+'%'};return _0x4b8ace;})});}_0x3551c4=_[_0xfc5f('0x3f')]({},_0x3551c4,_0x5f5b30['options']);return _0x4f84c8[_0xfc5f('0x52')](_0x3551c4);}})[_0xfc5f('0x28')](function(_0x28fd74){if(_0x28fd74){_0x245d91=_0x28fd74['length'];if(!_0x5f5b30[_0xfc5f('0x33')][_0xfc5f('0x38')]('nolimit')){_0x3551c4[_0xfc5f('0x21')]=qs[_0xfc5f('0x21')](_0x5f5b30['query']['limit']);_0x3551c4[_0xfc5f('0x20')]=qs[_0xfc5f('0x20')](_0x5f5b30[_0xfc5f('0x33')][_0xfc5f('0x20')]);}return _0x4f84c8[_0xfc5f('0x52')](_0x3551c4);}})[_0xfc5f('0x28')](function(_0x520239){if(_0x520239){return _0x520239?{'count':_0x245d91,'rows':_0x520239}:null;}})['then'](respondWithResult(_0x4ccc8f,null))[_0xfc5f('0x46')](handleError(_0x4ccc8f,null));};
\ No newline at end of file
+var _0x7b95=['pick','filters','filter','merge','type','VIRTUAL','options','includeAll','include','rows','catch','show','params','length','find','create','body','getSubjects','findOne','FreshsalesField','getDescriptions','getFields','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','update','then','destroy','sendStatus','error','stack','name','send','map','FreshsalesConfiguration','rawAttributes','fieldName','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where'];(function(_0x12728f,_0x3a3ac2){var _0x242959=function(_0x56d3ca){while(--_0x56d3ca){_0x12728f['push'](_0x12728f['shift']());}};_0x242959(++_0x3a3ac2);}(_0x7b95,0x66));var _0x57b9=function(_0x3ba89a,_0x3f4ec5){_0x3ba89a=_0x3ba89a-0x0;var _0xf8e0bc=_0x7b95[_0x3ba89a];return _0xf8e0bc;};'use strict';var emlformat=require(_0x57b9('0x0'));var rimraf=require(_0x57b9('0x1'));var zipdir=require(_0x57b9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x57b9('0x3'));var moment=require('moment');var BPromise=require(_0x57b9('0x4'));var Mustache=require(_0x57b9('0x5'));var util=require('util');var path=require(_0x57b9('0x6'));var sox=require(_0x57b9('0x7'));var csv=require('to-csv');var ejs=require(_0x57b9('0x8'));var fs=require('fs');var fs_extra=require(_0x57b9('0x9'));var _=require(_0x57b9('0xa'));var squel=require(_0x57b9('0xb'));var crypto=require(_0x57b9('0xc'));var jsforce=require(_0x57b9('0xd'));var deskjs=require(_0x57b9('0xe'));var toCsv=require(_0x57b9('0xf'));var querystring=require(_0x57b9('0x10'));var Papa=require('papaparse');var Redis=require(_0x57b9('0x11'));var authService=require(_0x57b9('0x12'));var qs=require(_0x57b9('0x13'));var as=require(_0x57b9('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x57b9('0x15'))('api');var utils=require(_0x57b9('0x16'));var config=require(_0x57b9('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x57b9('0x18'))['db'];function respondWithStatusCode(_0x36371a,_0x59f21c){_0x59f21c=_0x59f21c||0xcc;return function(_0x4229d6){if(_0x4229d6){return _0x36371a['sendStatus'](_0x59f21c);}return _0x36371a[_0x57b9('0x19')](_0x59f21c)[_0x57b9('0x1a')]();};}function respondWithResult(_0x2936a9,_0xba1157){_0xba1157=_0xba1157||0xc8;return function(_0x27eb51){if(_0x27eb51){return _0x2936a9[_0x57b9('0x19')](_0xba1157)[_0x57b9('0x1b')](_0x27eb51);}};}function respondWithFilteredResult(_0x4dbeb9,_0x5afb16){return function(_0x4af6ce){if(_0x4af6ce){var _0x33d246=typeof _0x5afb16[_0x57b9('0x1c')]==='undefined'&&typeof _0x5afb16[_0x57b9('0x1d')]===_0x57b9('0x1e');var _0x456b23=_0x4af6ce[_0x57b9('0x1f')];var _0x50f968=_0x33d246?0x0:_0x5afb16[_0x57b9('0x1c')];var _0x4f6ec6=_0x33d246?_0x4af6ce[_0x57b9('0x1f')]:_0x5afb16[_0x57b9('0x1c')]+_0x5afb16[_0x57b9('0x1d')];var _0x3d3315;if(_0x4f6ec6>=_0x456b23){_0x4f6ec6=_0x456b23;_0x3d3315=0xc8;}else{_0x3d3315=0xce;}_0x4dbeb9[_0x57b9('0x19')](_0x3d3315);return _0x4dbeb9['set'](_0x57b9('0x20'),_0x50f968+'-'+_0x4f6ec6+'/'+_0x456b23)[_0x57b9('0x1b')](_0x4af6ce);}return null;};}function patchUpdates(_0x1a93fe){return function(_0x1c6fbf){try{jsonpatch[_0x57b9('0x21')](_0x1c6fbf,_0x1a93fe,!![]);}catch(_0x4dfabb){return BPromise[_0x57b9('0x22')](_0x4dfabb);}return _0x1c6fbf['save']();};}function saveUpdates(_0x51046e,_0x5a787d){return function(_0x1dd73f){if(_0x1dd73f){return _0x1dd73f[_0x57b9('0x23')](_0x51046e)[_0x57b9('0x24')](function(_0x2f5eb0){return _0x2f5eb0;});}return null;};}function removeEntity(_0x312eb6,_0x5a649a){return function(_0x4be9aa){if(_0x4be9aa){return _0x4be9aa[_0x57b9('0x25')]()[_0x57b9('0x24')](function(){_0x312eb6['status'](0xcc)[_0x57b9('0x1a')]();});}};}function handleEntityNotFound(_0x116a84,_0x2c663f){return function(_0x4c3337){if(!_0x4c3337){_0x116a84[_0x57b9('0x26')](0x194);}return _0x4c3337;};}function handleError(_0x238616,_0x135a95){_0x135a95=_0x135a95||0x1f4;return function(_0x1e4ddd){logger[_0x57b9('0x27')](_0x1e4ddd[_0x57b9('0x28')]);if(_0x1e4ddd[_0x57b9('0x29')]){delete _0x1e4ddd[_0x57b9('0x29')];}_0x238616[_0x57b9('0x19')](_0x135a95)[_0x57b9('0x2a')](_0x1e4ddd);};}exports['index']=function(_0x1ee40c,_0x2748ed){var _0x4953be={},_0x1dd51a={},_0x52e60f={'count':0x0,'rows':[]};var _0x35f8e3=_[_0x57b9('0x2b')](db[_0x57b9('0x2c')][_0x57b9('0x2d')],function(_0x5557a6){return{'name':_0x5557a6[_0x57b9('0x2e')],'type':_0x5557a6['type']['key']};});_0x1dd51a[_0x57b9('0x2f')]=_[_0x57b9('0x2b')](_0x35f8e3,_0x57b9('0x29'));_0x1dd51a[_0x57b9('0x30')]=_[_0x57b9('0x31')](_0x1ee40c[_0x57b9('0x30')]);_0x1dd51a['filters']=_[_0x57b9('0x32')](_0x1dd51a[_0x57b9('0x2f')],_0x1dd51a[_0x57b9('0x30')]);_0x4953be[_0x57b9('0x33')]=_[_0x57b9('0x32')](_0x1dd51a[_0x57b9('0x2f')],qs['fields'](_0x1ee40c[_0x57b9('0x30')][_0x57b9('0x34')]));_0x4953be['attributes']=_0x4953be[_0x57b9('0x33')]['length']?_0x4953be['attributes']:_0x1dd51a['model'];if(!_0x1ee40c['query'][_0x57b9('0x35')](_0x57b9('0x36'))){_0x4953be['limit']=qs[_0x57b9('0x1d')](_0x1ee40c[_0x57b9('0x30')]['limit']);_0x4953be[_0x57b9('0x1c')]=qs[_0x57b9('0x1c')](_0x1ee40c[_0x57b9('0x30')][_0x57b9('0x1c')]);}_0x4953be[_0x57b9('0x37')]=qs[_0x57b9('0x38')](_0x1ee40c['query'][_0x57b9('0x38')]);_0x4953be[_0x57b9('0x39')]=qs['filters'](_[_0x57b9('0x3a')](_0x1ee40c[_0x57b9('0x30')],_0x1dd51a[_0x57b9('0x3b')]),_0x35f8e3);if(_0x1ee40c[_0x57b9('0x30')][_0x57b9('0x3c')]){_0x4953be['where']=_[_0x57b9('0x3d')](_0x4953be['where'],{'$or':_['map'](_0x35f8e3,function(_0x302875){if(_0x302875[_0x57b9('0x3e')]!==_0x57b9('0x3f')){var _0x20fe28={};_0x20fe28[_0x302875['name']]={'$like':'%'+_0x1ee40c['query']['filter']+'%'};return _0x20fe28;}})});}_0x4953be=_[_0x57b9('0x3d')]({},_0x4953be,_0x1ee40c[_0x57b9('0x40')]);var _0x3d78c9={'where':_0x4953be[_0x57b9('0x39')]};return db[_0x57b9('0x2c')][_0x57b9('0x1f')](_0x3d78c9)[_0x57b9('0x24')](function(_0xfd70d1){_0x52e60f['count']=_0xfd70d1;if(_0x1ee40c[_0x57b9('0x30')][_0x57b9('0x41')]){_0x4953be[_0x57b9('0x42')]=[{'all':!![]}];}return db[_0x57b9('0x2c')]['findAll'](_0x4953be);})[_0x57b9('0x24')](function(_0x48dda8){_0x52e60f[_0x57b9('0x43')]=_0x48dda8;return _0x52e60f;})['then'](respondWithFilteredResult(_0x2748ed,_0x4953be))[_0x57b9('0x44')](handleError(_0x2748ed,null));};exports[_0x57b9('0x45')]=function(_0x4487f1,_0x58244b){var _0x168cdc={'raw':![],'where':{'id':_0x4487f1[_0x57b9('0x46')]['id']}},_0x405ead={};_0x405ead[_0x57b9('0x2f')]=_[_0x57b9('0x31')](db[_0x57b9('0x2c')]['rawAttributes']);_0x405ead[_0x57b9('0x30')]=_[_0x57b9('0x31')](_0x4487f1[_0x57b9('0x30')]);_0x405ead[_0x57b9('0x3b')]=_[_0x57b9('0x32')](_0x405ead['model'],_0x405ead[_0x57b9('0x30')]);_0x168cdc[_0x57b9('0x33')]=_[_0x57b9('0x32')](_0x405ead['model'],qs[_0x57b9('0x34')](_0x4487f1['query'][_0x57b9('0x34')]));_0x168cdc[_0x57b9('0x33')]=_0x168cdc[_0x57b9('0x33')][_0x57b9('0x47')]?_0x168cdc[_0x57b9('0x33')]:_0x405ead[_0x57b9('0x2f')];if(_0x4487f1[_0x57b9('0x30')][_0x57b9('0x41')]){_0x168cdc['include']=[{'all':!![]}];}_0x168cdc=_[_0x57b9('0x3d')]({},_0x168cdc,_0x4487f1['options']);return db[_0x57b9('0x2c')][_0x57b9('0x48')](_0x168cdc)['then'](handleEntityNotFound(_0x58244b,null))[_0x57b9('0x24')](respondWithResult(_0x58244b,null))[_0x57b9('0x44')](handleError(_0x58244b,null));};exports[_0x57b9('0x49')]=function(_0x478c45,_0x365a47){return db['FreshsalesConfiguration'][_0x57b9('0x49')](_0x478c45['body'],{})[_0x57b9('0x24')](respondWithResult(_0x365a47,0xc9))['catch'](handleError(_0x365a47,null));};exports[_0x57b9('0x23')]=function(_0x4ffc5d,_0x52f4a7){if(_0x4ffc5d[_0x57b9('0x4a')]['id']){delete _0x4ffc5d[_0x57b9('0x4a')]['id'];}return db[_0x57b9('0x2c')]['find']({'where':{'id':_0x4ffc5d[_0x57b9('0x46')]['id']}})[_0x57b9('0x24')](handleEntityNotFound(_0x52f4a7,null))[_0x57b9('0x24')](saveUpdates(_0x4ffc5d['body'],null))[_0x57b9('0x24')](respondWithResult(_0x52f4a7,null))[_0x57b9('0x44')](handleError(_0x52f4a7,null));};exports[_0x57b9('0x25')]=function(_0x289173,_0x203fbc){return db['FreshsalesConfiguration'][_0x57b9('0x48')]({'where':{'id':_0x289173[_0x57b9('0x46')]['id']}})[_0x57b9('0x24')](handleEntityNotFound(_0x203fbc,null))[_0x57b9('0x24')](removeEntity(_0x203fbc,null))[_0x57b9('0x44')](handleError(_0x203fbc,null));};exports[_0x57b9('0x4b')]=function(_0x2a2cfd,_0x296f65,_0x5b9af1){var _0x1c5413={};var _0x19d7e5={};var _0x542eb7;var _0x3e4435;return db[_0x57b9('0x2c')][_0x57b9('0x4c')]({'where':{'id':_0x2a2cfd[_0x57b9('0x46')]['id']}})[_0x57b9('0x24')](handleEntityNotFound(_0x296f65,null))['then'](function(_0x59a2ca){if(_0x59a2ca){_0x542eb7=_0x59a2ca;_0x19d7e5[_0x57b9('0x2f')]=_[_0x57b9('0x31')](db[_0x57b9('0x4d')]['rawAttributes']);_0x19d7e5['query']=_[_0x57b9('0x31')](_0x2a2cfd[_0x57b9('0x30')]);_0x19d7e5[_0x57b9('0x3b')]=_['intersection'](_0x19d7e5[_0x57b9('0x2f')],_0x19d7e5['query']);_0x1c5413[_0x57b9('0x33')]=_[_0x57b9('0x32')](_0x19d7e5[_0x57b9('0x2f')],qs['fields'](_0x2a2cfd[_0x57b9('0x30')]['fields']));_0x1c5413[_0x57b9('0x33')]=_0x1c5413[_0x57b9('0x33')][_0x57b9('0x47')]?_0x1c5413[_0x57b9('0x33')]:_0x19d7e5[_0x57b9('0x2f')];_0x1c5413['order']=qs[_0x57b9('0x38')](_0x2a2cfd['query'][_0x57b9('0x38')]);_0x1c5413[_0x57b9('0x39')]=qs[_0x57b9('0x3b')](_[_0x57b9('0x3a')](_0x2a2cfd[_0x57b9('0x30')],_0x19d7e5['filters']));if(_0x2a2cfd[_0x57b9('0x30')]['filter']){_0x1c5413[_0x57b9('0x39')]=_[_0x57b9('0x3d')](_0x1c5413[_0x57b9('0x39')],{'$or':_[_0x57b9('0x2b')](_0x1c5413[_0x57b9('0x33')],function(_0x2468a9){var _0x236dbc={};_0x236dbc[_0x2468a9]={'$like':'%'+_0x2a2cfd[_0x57b9('0x30')][_0x57b9('0x3c')]+'%'};return _0x236dbc;})});}_0x1c5413=_['merge']({},_0x1c5413,_0x2a2cfd[_0x57b9('0x40')]);return _0x542eb7[_0x57b9('0x4b')](_0x1c5413);}})['then'](function(_0x5b04a6){if(_0x5b04a6){_0x3e4435=_0x5b04a6['length'];if(!_0x2a2cfd[_0x57b9('0x30')][_0x57b9('0x35')](_0x57b9('0x36'))){_0x1c5413[_0x57b9('0x1d')]=qs[_0x57b9('0x1d')](_0x2a2cfd[_0x57b9('0x30')][_0x57b9('0x1d')]);_0x1c5413[_0x57b9('0x1c')]=qs[_0x57b9('0x1c')](_0x2a2cfd['query'][_0x57b9('0x1c')]);}return _0x542eb7[_0x57b9('0x4b')](_0x1c5413);}})[_0x57b9('0x24')](function(_0x435d71){if(_0x435d71){return _0x435d71?{'count':_0x3e4435,'rows':_0x435d71}:null;}})[_0x57b9('0x24')](respondWithResult(_0x296f65,null))[_0x57b9('0x44')](handleError(_0x296f65,null));};exports['getDescriptions']=function(_0x3e3c01,_0x407129,_0x4d488c){var _0x3c71ef={};var _0x1dd507={};var _0x579437;var _0x50884a;return db[_0x57b9('0x2c')][_0x57b9('0x4c')]({'where':{'id':_0x3e3c01[_0x57b9('0x46')]['id']}})[_0x57b9('0x24')](handleEntityNotFound(_0x407129,null))[_0x57b9('0x24')](function(_0x3dc086){if(_0x3dc086){_0x579437=_0x3dc086;_0x1dd507[_0x57b9('0x2f')]=_[_0x57b9('0x31')](db[_0x57b9('0x4d')]['rawAttributes']);_0x1dd507[_0x57b9('0x30')]=_['keys'](_0x3e3c01[_0x57b9('0x30')]);_0x1dd507[_0x57b9('0x3b')]=_[_0x57b9('0x32')](_0x1dd507[_0x57b9('0x2f')],_0x1dd507[_0x57b9('0x30')]);_0x3c71ef[_0x57b9('0x33')]=_[_0x57b9('0x32')](_0x1dd507[_0x57b9('0x2f')],qs[_0x57b9('0x34')](_0x3e3c01['query']['fields']));_0x3c71ef[_0x57b9('0x33')]=_0x3c71ef[_0x57b9('0x33')]['length']?_0x3c71ef['attributes']:_0x1dd507[_0x57b9('0x2f')];_0x3c71ef['order']=qs[_0x57b9('0x38')](_0x3e3c01['query']['sort']);_0x3c71ef[_0x57b9('0x39')]=qs[_0x57b9('0x3b')](_[_0x57b9('0x3a')](_0x3e3c01[_0x57b9('0x30')],_0x1dd507[_0x57b9('0x3b')]));if(_0x3e3c01[_0x57b9('0x30')][_0x57b9('0x3c')]){_0x3c71ef[_0x57b9('0x39')]=_[_0x57b9('0x3d')](_0x3c71ef['where'],{'$or':_[_0x57b9('0x2b')](_0x3c71ef['attributes'],function(_0x5e8bfc){var _0x20416a={};_0x20416a[_0x5e8bfc]={'$like':'%'+_0x3e3c01[_0x57b9('0x30')][_0x57b9('0x3c')]+'%'};return _0x20416a;})});}_0x3c71ef=_[_0x57b9('0x3d')]({},_0x3c71ef,_0x3e3c01[_0x57b9('0x40')]);return _0x579437[_0x57b9('0x4e')](_0x3c71ef);}})[_0x57b9('0x24')](function(_0x4010ad){if(_0x4010ad){_0x50884a=_0x4010ad['length'];if(!_0x3e3c01['query'][_0x57b9('0x35')](_0x57b9('0x36'))){_0x3c71ef[_0x57b9('0x1d')]=qs[_0x57b9('0x1d')](_0x3e3c01[_0x57b9('0x30')][_0x57b9('0x1d')]);_0x3c71ef['offset']=qs['offset'](_0x3e3c01[_0x57b9('0x30')][_0x57b9('0x1c')]);}return _0x579437['getDescriptions'](_0x3c71ef);}})['then'](function(_0x38766e){if(_0x38766e){return _0x38766e?{'count':_0x50884a,'rows':_0x38766e}:null;}})[_0x57b9('0x24')](respondWithResult(_0x407129,null))[_0x57b9('0x44')](handleError(_0x407129,null));};exports[_0x57b9('0x4f')]=function(_0x4543dc,_0x6641c6,_0x3dc5f){var _0x46f940={};var _0x16df3f={};var _0x4a1a95;var _0x595be6;return db['FreshsalesConfiguration'][_0x57b9('0x4c')]({'where':{'id':_0x4543dc['params']['id']}})[_0x57b9('0x24')](handleEntityNotFound(_0x6641c6,null))['then'](function(_0x4f6908){if(_0x4f6908){_0x4a1a95=_0x4f6908;_0x16df3f[_0x57b9('0x2f')]=_['keys'](db[_0x57b9('0x4d')][_0x57b9('0x2d')]);_0x16df3f['query']=_[_0x57b9('0x31')](_0x4543dc[_0x57b9('0x30')]);_0x16df3f[_0x57b9('0x3b')]=_[_0x57b9('0x32')](_0x16df3f[_0x57b9('0x2f')],_0x16df3f[_0x57b9('0x30')]);_0x46f940[_0x57b9('0x33')]=_[_0x57b9('0x32')](_0x16df3f[_0x57b9('0x2f')],qs['fields'](_0x4543dc['query'][_0x57b9('0x34')]));_0x46f940[_0x57b9('0x33')]=_0x46f940[_0x57b9('0x33')][_0x57b9('0x47')]?_0x46f940[_0x57b9('0x33')]:_0x16df3f[_0x57b9('0x2f')];_0x46f940[_0x57b9('0x37')]=qs['sort'](_0x4543dc['query'][_0x57b9('0x38')]);_0x46f940[_0x57b9('0x39')]=qs[_0x57b9('0x3b')](_[_0x57b9('0x3a')](_0x4543dc[_0x57b9('0x30')],_0x16df3f[_0x57b9('0x3b')]));if(_0x4543dc['query'][_0x57b9('0x3c')]){_0x46f940[_0x57b9('0x39')]=_['merge'](_0x46f940[_0x57b9('0x39')],{'$or':_[_0x57b9('0x2b')](_0x46f940[_0x57b9('0x33')],function(_0x479d76){var _0x3c98d8={};_0x3c98d8[_0x479d76]={'$like':'%'+_0x4543dc['query'][_0x57b9('0x3c')]+'%'};return _0x3c98d8;})});}_0x46f940=_['merge']({},_0x46f940,_0x4543dc[_0x57b9('0x40')]);return _0x4a1a95[_0x57b9('0x4f')](_0x46f940);}})[_0x57b9('0x24')](function(_0x590729){if(_0x590729){_0x595be6=_0x590729['length'];if(!_0x4543dc[_0x57b9('0x30')][_0x57b9('0x35')]('nolimit')){_0x46f940[_0x57b9('0x1d')]=qs[_0x57b9('0x1d')](_0x4543dc[_0x57b9('0x30')][_0x57b9('0x1d')]);_0x46f940['offset']=qs[_0x57b9('0x1c')](_0x4543dc['query'][_0x57b9('0x1c')]);}return _0x4a1a95[_0x57b9('0x4f')](_0x46f940);}})['then'](function(_0x2825de){if(_0x2825de){return _0x2825de?{'count':_0x595be6,'rows':_0x2825de}:null;}})[_0x57b9('0x24')](respondWithResult(_0x6641c6,null))[_0x57b9('0x44')](handleError(_0x6641c6,null));};
\ No newline at end of file
index 8e14495..96d260d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf8d8=['request-promise','path','rimraf','../../config/environment','./intFreshsalesConfiguration.attributes','exports','define','FreshsalesConfiguration','int_freshsales_configurations','lodash','util','../../config/logger','api','moment'];(function(_0x5037ab,_0x43209e){var _0x512adb=function(_0x261783){while(--_0x261783){_0x5037ab['push'](_0x5037ab['shift']());}};_0x512adb(++_0x43209e);}(_0xf8d8,0x159));var _0x8f8d=function(_0x5d5373,_0x10cd97){_0x5d5373=_0x5d5373-0x0;var _0x360a4a=_0xf8d8[_0x5d5373];return _0x360a4a;};'use strict';var _=require(_0x8f8d('0x0'));var util=require(_0x8f8d('0x1'));var logger=require(_0x8f8d('0x2'))(_0x8f8d('0x3'));var moment=require(_0x8f8d('0x4'));var BPromise=require('bluebird');var rp=require(_0x8f8d('0x5'));var fs=require('fs');var path=require(_0x8f8d('0x6'));var rimraf=require(_0x8f8d('0x7'));var config=require(_0x8f8d('0x8'));var attributes=require(_0x8f8d('0x9'));module[_0x8f8d('0xa')]=function(_0x55f3b3,_0x4fd046){return _0x55f3b3[_0x8f8d('0xb')](_0x8f8d('0xc'),attributes,{'tableName':_0x8f8d('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xfc79=['moment','bluebird','request-promise','path','../../config/environment','./intFreshsalesConfiguration.attributes','exports','FreshsalesConfiguration','lodash','api'];(function(_0x4c1518,_0x4051d4){var _0x31aeba=function(_0x4bf611){while(--_0x4bf611){_0x4c1518['push'](_0x4c1518['shift']());}};_0x31aeba(++_0x4051d4);}(_0xfc79,0x1de));var _0x9fc7=function(_0xa40e2c,_0x43921b){_0xa40e2c=_0xa40e2c-0x0;var _0xaa7b25=_0xfc79[_0xa40e2c];return _0xaa7b25;};'use strict';var _=require(_0x9fc7('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x9fc7('0x1'));var moment=require(_0x9fc7('0x2'));var BPromise=require(_0x9fc7('0x3'));var rp=require(_0x9fc7('0x4'));var fs=require('fs');var path=require(_0x9fc7('0x5'));var rimraf=require('rimraf');var config=require(_0x9fc7('0x6'));var attributes=require(_0x9fc7('0x7'));module[_0x9fc7('0x8')]=function(_0x2c95d4,_0x3c5f56){return _0x2c95d4['define'](_0x9fc7('0x9'),attributes,{'tableName':'int_freshsales_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 23aec7f..b54b60b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3fff=['rpc','jayson/promise','client','then','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x4b3940,_0x1dd35e){var _0x506e7f=function(_0x2e36e0){while(--_0x2e36e0){_0x4b3940['push'](_0x4b3940['shift']());}};_0x506e7f(++_0x1dd35e);}(_0x3fff,0xfc));var _0xf3ff=function(_0x53efa4,_0x1e673b){_0x53efa4=_0x53efa4-0x0;var _0x276274=_0x3fff[_0x53efa4];return _0x276274;};'use strict';var _=require(_0xf3ff('0x0'));var util=require(_0xf3ff('0x1'));var moment=require(_0xf3ff('0x2'));var BPromise=require('bluebird');var rs=require(_0xf3ff('0x3'));var fs=require('fs');var Redis=require(_0xf3ff('0x4'));var db=require(_0xf3ff('0x5'))['db'];var utils=require(_0xf3ff('0x6'));var logger=require(_0xf3ff('0x7'))(_0xf3ff('0x8'));var config=require('../../config/environment');var jayson=require(_0xf3ff('0x9'));var client=jayson[_0xf3ff('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3437a1,_0x4c3c0b,_0x46302d){return new BPromise(function(_0xd76d46,_0x45efb3){return client['request'](_0x3437a1,_0x46302d)[_0xf3ff('0xb')](function(_0x15c2d0){logger['info'](_0xf3ff('0xc'),_0x4c3c0b,_0xf3ff('0xd'));logger['debug']('FreshsalesConfiguration,\x20%s,\x20%s,\x20%s',_0x4c3c0b,_0xf3ff('0xd'),JSON['stringify'](_0x15c2d0));if(_0x15c2d0[_0xf3ff('0xe')]){if(_0x15c2d0[_0xf3ff('0xe')][_0xf3ff('0xf')]===0x1f4){logger[_0xf3ff('0xe')](_0xf3ff('0xc'),_0x4c3c0b,_0x15c2d0['error'][_0xf3ff('0x10')]);return _0x45efb3(_0x15c2d0[_0xf3ff('0xe')][_0xf3ff('0x10')]);}logger[_0xf3ff('0xe')](_0xf3ff('0xc'),_0x4c3c0b,_0x15c2d0['error'][_0xf3ff('0x10')]);return _0xd76d46(_0x15c2d0[_0xf3ff('0xe')][_0xf3ff('0x10')]);}else{logger[_0xf3ff('0x11')](_0xf3ff('0xc'),_0x4c3c0b,_0xf3ff('0xd'));_0xd76d46(_0x15c2d0[_0xf3ff('0x12')][_0xf3ff('0x10')]);}})[_0xf3ff('0x13')](function(_0x42ea94){logger[_0xf3ff('0xe')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x4c3c0b,_0x42ea94);_0x45efb3(_0x42ea94);});});}
\ No newline at end of file
+var _0xe2d3=['util','moment','bluebird','ioredis','rpc','../../config/environment','jayson/promise','request','then','info','FreshsalesConfiguration,\x20%s,\x20%s','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','lodash'];(function(_0x263a74,_0xc31414){var _0x2aa86c=function(_0x382896){while(--_0x382896){_0x263a74['push'](_0x263a74['shift']());}};_0x2aa86c(++_0xc31414);}(_0xe2d3,0x97));var _0x3e2d=function(_0x511bd1,_0x223e5b){_0x511bd1=_0x511bd1-0x0;var _0x4c48ec=_0xe2d3[_0x511bd1];return _0x4c48ec;};'use strict';var _=require(_0x3e2d('0x0'));var util=require(_0x3e2d('0x1'));var moment=require(_0x3e2d('0x2'));var BPromise=require(_0x3e2d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3e2d('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3e2d('0x5'));var config=require(_0x3e2d('0x6'));var jayson=require(_0x3e2d('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x7ce2e1,_0x105d1a,_0x123324){return new BPromise(function(_0x4679d6,_0x113e10){return client[_0x3e2d('0x8')](_0x7ce2e1,_0x123324)[_0x3e2d('0x9')](function(_0x2dc111){logger[_0x3e2d('0xa')](_0x3e2d('0xb'),_0x105d1a,'request\x20sent');logger[_0x3e2d('0xc')](_0x3e2d('0xd'),_0x105d1a,_0x3e2d('0xe'),JSON[_0x3e2d('0xf')](_0x2dc111));if(_0x2dc111['error']){if(_0x2dc111[_0x3e2d('0x10')]['code']===0x1f4){logger[_0x3e2d('0x10')](_0x3e2d('0xb'),_0x105d1a,_0x2dc111[_0x3e2d('0x10')][_0x3e2d('0x11')]);return _0x113e10(_0x2dc111[_0x3e2d('0x10')][_0x3e2d('0x11')]);}logger[_0x3e2d('0x10')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x105d1a,_0x2dc111['error'][_0x3e2d('0x11')]);return _0x4679d6(_0x2dc111[_0x3e2d('0x10')][_0x3e2d('0x11')]);}else{logger[_0x3e2d('0xa')](_0x3e2d('0xb'),_0x105d1a,_0x3e2d('0xe'));_0x4679d6(_0x2dc111[_0x3e2d('0x12')][_0x3e2d('0x11')]);}})['catch'](function(_0x596493){logger['error'](_0x3e2d('0xb'),_0x105d1a,_0x596493);_0x113e10(_0x596493);});});}
\ No newline at end of file
index 976259b..12ce4f9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x385b=['isAuthenticated','index','/:id','show','post','create','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intFreshsalesField.controller','get'];(function(_0x382d02,_0x322147){var _0x242c3d=function(_0x54d860){while(--_0x54d860){_0x382d02['push'](_0x382d02['shift']());}};_0x242c3d(++_0x322147);}(_0x385b,0x1a7));var _0xb385=function(_0x3edb26,_0x9613b4){_0x3edb26=_0x3edb26-0x0;var _0x4ad9f5=_0x385b[_0x3edb26];return _0x4ad9f5;};'use strict';var multer=require('multer');var util=require(_0xb385('0x0'));var path=require('path');var timeout=require(_0xb385('0x1'));var express=require(_0xb385('0x2'));var router=express[_0xb385('0x3')]();var fs_extra=require(_0xb385('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xb385('0x5'));var config=require(_0xb385('0x6'));var controller=require(_0xb385('0x7'));router[_0xb385('0x8')]('/',auth[_0xb385('0x9')](),controller[_0xb385('0xa')]);router[_0xb385('0x8')](_0xb385('0xb'),auth['isAuthenticated'](),controller[_0xb385('0xc')]);router[_0xb385('0xd')]('/',auth[_0xb385('0x9')](),controller[_0xb385('0xe')]);router['put'](_0xb385('0xb'),auth[_0xb385('0x9')](),controller['update']);router[_0xb385('0xf')](_0xb385('0xb'),auth[_0xb385('0x9')](),controller[_0xb385('0x10')]);module[_0xb385('0x11')]=router;
\ No newline at end of file
+var _0x2dae=['create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intFreshsalesField.controller','get','index','/:id','isAuthenticated','show','post'];(function(_0x5d815b,_0x4c422d){var _0x5440a9=function(_0xd527f7){while(--_0xd527f7){_0x5d815b['push'](_0x5d815b['shift']());}};_0x5440a9(++_0x4c422d);}(_0x2dae,0xc3));var _0xe2da=function(_0x54eab6,_0x5e262f){_0x54eab6=_0x54eab6-0x0;var _0x1e7435=_0x2dae[_0x54eab6];return _0x1e7435;};'use strict';var multer=require(_0xe2da('0x0'));var util=require('util');var path=require(_0xe2da('0x1'));var timeout=require(_0xe2da('0x2'));var express=require(_0xe2da('0x3'));var router=express[_0xe2da('0x4')]();var fs_extra=require(_0xe2da('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xe2da('0x6'));var config=require(_0xe2da('0x7'));var controller=require(_0xe2da('0x8'));router[_0xe2da('0x9')]('/',auth['isAuthenticated'](),controller[_0xe2da('0xa')]);router[_0xe2da('0x9')](_0xe2da('0xb'),auth[_0xe2da('0xc')](),controller[_0xe2da('0xd')]);router[_0xe2da('0xe')]('/',auth[_0xe2da('0xc')](),controller[_0xe2da('0xf')]);router[_0xe2da('0x10')]('/:id',auth[_0xe2da('0xc')](),controller[_0xe2da('0x11')]);router[_0xe2da('0x12')](_0xe2da('0xb'),auth[_0xe2da('0xc')](),controller[_0xe2da('0x13')]);module[_0xe2da('0x14')]=router;
\ No newline at end of file
index f709614..ba6e3f1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa8eb=['BOOLEAN','sequelize','variable','customVariable','keyValue','picklist','STRING','string'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xa8eb,0x101));var _0xba8e=function(_0x15004b,_0x5a4a06){_0x15004b=_0x15004b-0x0;var _0x49c19f=_0xa8eb[_0x15004b];return _0x49c19f;};'use strict';var Sequelize=require(_0xba8e('0x0'));module['exports']={'type':{'type':Sequelize['ENUM']('string',_0xba8e('0x1'),_0xba8e('0x2'),_0xba8e('0x3'),_0xba8e('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0xba8e('0x5')]},'key':{'type':Sequelize[_0xba8e('0x5')]},'keyType':{'type':Sequelize['ENUM'](_0xba8e('0x6'),'variable','customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xba8e('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xba8e('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xba8e('0x5')]}};
\ No newline at end of file
+var _0xbb01=['sequelize','exports','string','variable','customVariable','keyValue','picklist','STRING','ENUM','BOOLEAN'];(function(_0x1ed010,_0x734e0b){var _0x6e22bf=function(_0x1ffe15){while(--_0x1ffe15){_0x1ed010['push'](_0x1ed010['shift']());}};_0x6e22bf(++_0x734e0b);}(_0xbb01,0x12c));var _0x1bb0=function(_0x51f4fc,_0x1fe3ef){_0x51f4fc=_0x51f4fc-0x0;var _0x4d96fc=_0xbb01[_0x51f4fc];return _0x4d96fc;};'use strict';var Sequelize=require(_0x1bb0('0x0'));module[_0x1bb0('0x1')]={'type':{'type':Sequelize['ENUM'](_0x1bb0('0x2'),_0x1bb0('0x3'),_0x1bb0('0x4'),_0x1bb0('0x5'),_0x1bb0('0x6')),'defaultValue':_0x1bb0('0x2')},'content':{'type':Sequelize[_0x1bb0('0x7')]},'key':{'type':Sequelize[_0x1bb0('0x7')]},'keyType':{'type':Sequelize[_0x1bb0('0x8')](_0x1bb0('0x2'),_0x1bb0('0x3'),_0x1bb0('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x1bb0('0x7')]},'nameField':{'type':Sequelize[_0x1bb0('0x7')]},'customField':{'type':Sequelize[_0x1bb0('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x1bb0('0x7')]}};
\ No newline at end of file
index 7298f95..101e7e2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcb57=['set','apply','save','update','destroy','then','error','stack','name','index','map','FreshsalesField','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','show','params','length','catch','create','body','find','eml-format','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','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'];(function(_0x257337,_0x476168){var _0x2fc6fa=function(_0x1b0c29){while(--_0x1b0c29){_0x257337['push'](_0x257337['shift']());}};_0x2fc6fa(++_0x476168);}(_0xcb57,0x197));var _0x7cb5=function(_0x4ae6ef,_0xc2af80){_0x4ae6ef=_0x4ae6ef-0x0;var _0x3cbb4e=_0xcb57[_0x4ae6ef];return _0x3cbb4e;};'use strict';var emlformat=require(_0x7cb5('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x7cb5('0x1'));var rp=require('request-promise');var moment=require(_0x7cb5('0x2'));var BPromise=require(_0x7cb5('0x3'));var Mustache=require('mustache');var util=require(_0x7cb5('0x4'));var path=require(_0x7cb5('0x5'));var sox=require(_0x7cb5('0x6'));var csv=require(_0x7cb5('0x7'));var ejs=require(_0x7cb5('0x8'));var fs=require('fs');var fs_extra=require(_0x7cb5('0x9'));var _=require(_0x7cb5('0xa'));var squel=require('squel');var crypto=require(_0x7cb5('0xb'));var jsforce=require(_0x7cb5('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x7cb5('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x7cb5('0xd'));var authService=require(_0x7cb5('0xe'));var qs=require(_0x7cb5('0xf'));var as=require(_0x7cb5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7cb5('0x11'))(_0x7cb5('0x12'));var utils=require(_0x7cb5('0x13'));var config=require(_0x7cb5('0x14'));var licenseUtil=require(_0x7cb5('0x15'));var db=require(_0x7cb5('0x16'))['db'];function respondWithStatusCode(_0xf37f2b,_0x6f5853){_0x6f5853=_0x6f5853||0xcc;return function(_0xf997a5){if(_0xf997a5){return _0xf37f2b[_0x7cb5('0x17')](_0x6f5853);}return _0xf37f2b[_0x7cb5('0x18')](_0x6f5853)[_0x7cb5('0x19')]();};}function respondWithResult(_0x8576bc,_0xfbf7b4){_0xfbf7b4=_0xfbf7b4||0xc8;return function(_0x312d7b){if(_0x312d7b){return _0x8576bc[_0x7cb5('0x18')](_0xfbf7b4)[_0x7cb5('0x1a')](_0x312d7b);}};}function respondWithFilteredResult(_0x43138e,_0x1de3da){return function(_0x572683){if(_0x572683){var _0x1b289f=typeof _0x1de3da[_0x7cb5('0x1b')]===_0x7cb5('0x1c')&&typeof _0x1de3da[_0x7cb5('0x1d')]===_0x7cb5('0x1c');var _0x5eec5e=_0x572683['count'];var _0x39ba78=_0x1b289f?0x0:_0x1de3da[_0x7cb5('0x1b')];var _0x324f9f=_0x1b289f?_0x572683[_0x7cb5('0x1e')]:_0x1de3da[_0x7cb5('0x1b')]+_0x1de3da[_0x7cb5('0x1d')];var _0x2fdf58;if(_0x324f9f>=_0x5eec5e){_0x324f9f=_0x5eec5e;_0x2fdf58=0xc8;}else{_0x2fdf58=0xce;}_0x43138e[_0x7cb5('0x18')](_0x2fdf58);return _0x43138e[_0x7cb5('0x1f')]('Content-Range',_0x39ba78+'-'+_0x324f9f+'/'+_0x5eec5e)['json'](_0x572683);}return null;};}function patchUpdates(_0x19614a){return function(_0x697ca7){try{jsonpatch[_0x7cb5('0x20')](_0x697ca7,_0x19614a,!![]);}catch(_0x5e5ac7){return BPromise['reject'](_0x5e5ac7);}return _0x697ca7[_0x7cb5('0x21')]();};}function saveUpdates(_0x3bd18c,_0x5c49d9){return function(_0x33c705){if(_0x33c705){return _0x33c705[_0x7cb5('0x22')](_0x3bd18c)['then'](function(_0x1fe1cf){return _0x1fe1cf;});}return null;};}function removeEntity(_0x33f4bd,_0x2bccf9){return function(_0x4b3d28){if(_0x4b3d28){return _0x4b3d28[_0x7cb5('0x23')]()[_0x7cb5('0x24')](function(){_0x33f4bd[_0x7cb5('0x18')](0xcc)[_0x7cb5('0x19')]();});}};}function handleEntityNotFound(_0x29deec,_0x272d69){return function(_0x107198){if(!_0x107198){_0x29deec[_0x7cb5('0x17')](0x194);}return _0x107198;};}function handleError(_0x471b94,_0x52d0ba){_0x52d0ba=_0x52d0ba||0x1f4;return function(_0x260092){logger[_0x7cb5('0x25')](_0x260092[_0x7cb5('0x26')]);if(_0x260092[_0x7cb5('0x27')]){delete _0x260092[_0x7cb5('0x27')];}_0x471b94[_0x7cb5('0x18')](_0x52d0ba)['send'](_0x260092);};}exports[_0x7cb5('0x28')]=function(_0x442b1f,_0x244c75){var _0x6bd887={},_0x4adff5={},_0x2a7f9e={'count':0x0,'rows':[]};var _0x234579=_[_0x7cb5('0x29')](db[_0x7cb5('0x2a')][_0x7cb5('0x2b')],function(_0x5d7faa){return{'name':_0x5d7faa[_0x7cb5('0x2c')],'type':_0x5d7faa[_0x7cb5('0x2d')][_0x7cb5('0x2e')]};});_0x4adff5[_0x7cb5('0x2f')]=_['map'](_0x234579,_0x7cb5('0x27'));_0x4adff5[_0x7cb5('0x30')]=_['keys'](_0x442b1f['query']);_0x4adff5[_0x7cb5('0x31')]=_[_0x7cb5('0x32')](_0x4adff5['model'],_0x4adff5['query']);_0x6bd887[_0x7cb5('0x33')]=_[_0x7cb5('0x32')](_0x4adff5[_0x7cb5('0x2f')],qs[_0x7cb5('0x34')](_0x442b1f['query']['fields']));_0x6bd887[_0x7cb5('0x33')]=_0x6bd887[_0x7cb5('0x33')]['length']?_0x6bd887[_0x7cb5('0x33')]:_0x4adff5[_0x7cb5('0x2f')];if(!_0x442b1f[_0x7cb5('0x30')][_0x7cb5('0x35')](_0x7cb5('0x36'))){_0x6bd887[_0x7cb5('0x1d')]=qs[_0x7cb5('0x1d')](_0x442b1f['query'][_0x7cb5('0x1d')]);_0x6bd887[_0x7cb5('0x1b')]=qs[_0x7cb5('0x1b')](_0x442b1f[_0x7cb5('0x30')][_0x7cb5('0x1b')]);}_0x6bd887[_0x7cb5('0x37')]=qs[_0x7cb5('0x38')](_0x442b1f['query'][_0x7cb5('0x38')]);_0x6bd887['where']=qs[_0x7cb5('0x31')](_[_0x7cb5('0x39')](_0x442b1f[_0x7cb5('0x30')],_0x4adff5[_0x7cb5('0x31')]),_0x234579);if(_0x442b1f[_0x7cb5('0x30')][_0x7cb5('0x3a')]){_0x6bd887[_0x7cb5('0x3b')]=_['merge'](_0x6bd887[_0x7cb5('0x3b')],{'$or':_[_0x7cb5('0x29')](_0x234579,function(_0x2939c3){if(_0x2939c3['type']!==_0x7cb5('0x3c')){var _0x2ef27c={};_0x2ef27c[_0x2939c3[_0x7cb5('0x27')]]={'$like':'%'+_0x442b1f[_0x7cb5('0x30')][_0x7cb5('0x3a')]+'%'};return _0x2ef27c;}})});}_0x6bd887=_[_0x7cb5('0x3d')]({},_0x6bd887,_0x442b1f[_0x7cb5('0x3e')]);var _0x1974b6={'where':_0x6bd887[_0x7cb5('0x3b')]};return db[_0x7cb5('0x2a')]['count'](_0x1974b6)[_0x7cb5('0x24')](function(_0x186cdd){_0x2a7f9e[_0x7cb5('0x1e')]=_0x186cdd;if(_0x442b1f[_0x7cb5('0x30')][_0x7cb5('0x3f')]){_0x6bd887[_0x7cb5('0x40')]=[{'all':!![]}];}return db['FreshsalesField'][_0x7cb5('0x41')](_0x6bd887);})[_0x7cb5('0x24')](function(_0x3553e8){_0x2a7f9e['rows']=_0x3553e8;return _0x2a7f9e;})[_0x7cb5('0x24')](respondWithFilteredResult(_0x244c75,_0x6bd887))['catch'](handleError(_0x244c75,null));};exports[_0x7cb5('0x42')]=function(_0x5a5690,_0x435926){var _0x4d0f4e={'raw':!![],'where':{'id':_0x5a5690[_0x7cb5('0x43')]['id']}},_0x3f14bb={};_0x3f14bb[_0x7cb5('0x2f')]=_['keys'](db['FreshsalesField'][_0x7cb5('0x2b')]);_0x3f14bb['query']=_['keys'](_0x5a5690[_0x7cb5('0x30')]);_0x3f14bb[_0x7cb5('0x31')]=_[_0x7cb5('0x32')](_0x3f14bb[_0x7cb5('0x2f')],_0x3f14bb[_0x7cb5('0x30')]);_0x4d0f4e['attributes']=_['intersection'](_0x3f14bb[_0x7cb5('0x2f')],qs['fields'](_0x5a5690['query']['fields']));_0x4d0f4e[_0x7cb5('0x33')]=_0x4d0f4e[_0x7cb5('0x33')][_0x7cb5('0x44')]?_0x4d0f4e[_0x7cb5('0x33')]:_0x3f14bb[_0x7cb5('0x2f')];if(_0x5a5690[_0x7cb5('0x30')][_0x7cb5('0x3f')]){_0x4d0f4e[_0x7cb5('0x40')]=[{'all':!![]}];}_0x4d0f4e=_['merge']({},_0x4d0f4e,_0x5a5690[_0x7cb5('0x3e')]);return db[_0x7cb5('0x2a')]['find'](_0x4d0f4e)[_0x7cb5('0x24')](handleEntityNotFound(_0x435926,null))[_0x7cb5('0x24')](respondWithResult(_0x435926,null))[_0x7cb5('0x45')](handleError(_0x435926,null));};exports['create']=function(_0x514284,_0x1ba9b1){return db['FreshsalesField'][_0x7cb5('0x46')](_0x514284[_0x7cb5('0x47')],{})[_0x7cb5('0x24')](respondWithResult(_0x1ba9b1,0xc9))[_0x7cb5('0x45')](handleError(_0x1ba9b1,null));};exports[_0x7cb5('0x22')]=function(_0x17b28c,_0x4415d1){if(_0x17b28c[_0x7cb5('0x47')]['id']){delete _0x17b28c[_0x7cb5('0x47')]['id'];}return db[_0x7cb5('0x2a')]['find']({'where':{'id':_0x17b28c['params']['id']}})[_0x7cb5('0x24')](handleEntityNotFound(_0x4415d1,null))[_0x7cb5('0x24')](saveUpdates(_0x17b28c[_0x7cb5('0x47')],null))['then'](respondWithResult(_0x4415d1,null))[_0x7cb5('0x45')](handleError(_0x4415d1,null));};exports['destroy']=function(_0x37e3ea,_0x3f6896){return db[_0x7cb5('0x2a')][_0x7cb5('0x48')]({'where':{'id':_0x37e3ea[_0x7cb5('0x43')]['id']}})[_0x7cb5('0x24')](handleEntityNotFound(_0x3f6896,null))[_0x7cb5('0x24')](removeEntity(_0x3f6896,null))['catch'](handleError(_0x3f6896,null));};
\ No newline at end of file
+var _0xa831=['undefined','limit','count','offset','set','apply','reject','save','update','then','error','stack','name','index','map','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','FreshsalesField','include','findAll','catch','params','rawAttributes','fields','includeAll','find','create','body','destroy','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json'];(function(_0x1ce71d,_0x3c9783){var _0x58484a=function(_0x484751){while(--_0x484751){_0x1ce71d['push'](_0x1ce71d['shift']());}};_0x58484a(++_0x3c9783);}(_0xa831,0x156));var _0x1a83=function(_0x1de43c,_0xaa29de){_0x1de43c=_0x1de43c-0x0;var _0x296d3e=_0xa831[_0x1de43c];return _0x296d3e;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x1a83('0x0'));var jsonpatch=require(_0x1a83('0x1'));var rp=require(_0x1a83('0x2'));var moment=require(_0x1a83('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x1a83('0x4'));var util=require('util');var path=require(_0x1a83('0x5'));var sox=require(_0x1a83('0x6'));var csv=require(_0x1a83('0x7'));var ejs=require(_0x1a83('0x8'));var fs=require('fs');var fs_extra=require(_0x1a83('0x9'));var _=require(_0x1a83('0xa'));var squel=require(_0x1a83('0xb'));var crypto=require(_0x1a83('0xc'));var jsforce=require(_0x1a83('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x1a83('0x7'));var querystring=require('querystring');var Papa=require(_0x1a83('0xe'));var Redis=require(_0x1a83('0xf'));var authService=require(_0x1a83('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1a83('0x11'));var logger=require(_0x1a83('0x12'))(_0x1a83('0x13'));var utils=require(_0x1a83('0x14'));var config=require(_0x1a83('0x15'));var licenseUtil=require(_0x1a83('0x16'));var db=require(_0x1a83('0x17'))['db'];function respondWithStatusCode(_0x300127,_0x26828f){_0x26828f=_0x26828f||0xcc;return function(_0x4dbb70){if(_0x4dbb70){return _0x300127[_0x1a83('0x18')](_0x26828f);}return _0x300127[_0x1a83('0x19')](_0x26828f)[_0x1a83('0x1a')]();};}function respondWithResult(_0x10bc1e,_0x54440a){_0x54440a=_0x54440a||0xc8;return function(_0x468ca5){if(_0x468ca5){return _0x10bc1e[_0x1a83('0x19')](_0x54440a)[_0x1a83('0x1b')](_0x468ca5);}};}function respondWithFilteredResult(_0x2b9dad,_0x2b00c1){return function(_0xc2ee45){if(_0xc2ee45){var _0x16f34f=typeof _0x2b00c1['offset']===_0x1a83('0x1c')&&typeof _0x2b00c1[_0x1a83('0x1d')]==='undefined';var _0x86392=_0xc2ee45[_0x1a83('0x1e')];var _0x8d621b=_0x16f34f?0x0:_0x2b00c1[_0x1a83('0x1f')];var _0x7ca371=_0x16f34f?_0xc2ee45[_0x1a83('0x1e')]:_0x2b00c1[_0x1a83('0x1f')]+_0x2b00c1[_0x1a83('0x1d')];var _0x5e47de;if(_0x7ca371>=_0x86392){_0x7ca371=_0x86392;_0x5e47de=0xc8;}else{_0x5e47de=0xce;}_0x2b9dad['status'](_0x5e47de);return _0x2b9dad[_0x1a83('0x20')]('Content-Range',_0x8d621b+'-'+_0x7ca371+'/'+_0x86392)[_0x1a83('0x1b')](_0xc2ee45);}return null;};}function patchUpdates(_0x3bd9a9){return function(_0x258604){try{jsonpatch[_0x1a83('0x21')](_0x258604,_0x3bd9a9,!![]);}catch(_0x236fa4){return BPromise[_0x1a83('0x22')](_0x236fa4);}return _0x258604[_0x1a83('0x23')]();};}function saveUpdates(_0x859656,_0x398fea){return function(_0x2e2ca6){if(_0x2e2ca6){return _0x2e2ca6[_0x1a83('0x24')](_0x859656)[_0x1a83('0x25')](function(_0x436c73){return _0x436c73;});}return null;};}function removeEntity(_0x269480,_0x47ee9e){return function(_0x1be2aa){if(_0x1be2aa){return _0x1be2aa['destroy']()[_0x1a83('0x25')](function(){_0x269480[_0x1a83('0x19')](0xcc)[_0x1a83('0x1a')]();});}};}function handleEntityNotFound(_0x535c5e,_0x3ef17d){return function(_0x2a0460){if(!_0x2a0460){_0x535c5e[_0x1a83('0x18')](0x194);}return _0x2a0460;};}function handleError(_0x47401a,_0x5acb96){_0x5acb96=_0x5acb96||0x1f4;return function(_0x3e618a){logger[_0x1a83('0x26')](_0x3e618a[_0x1a83('0x27')]);if(_0x3e618a[_0x1a83('0x28')]){delete _0x3e618a[_0x1a83('0x28')];}_0x47401a['status'](_0x5acb96)['send'](_0x3e618a);};}exports[_0x1a83('0x29')]=function(_0x1eee9c,_0x1e9e5f){var _0x1ba422={},_0x1808a5={},_0x2d0b03={'count':0x0,'rows':[]};var _0x21933c=_[_0x1a83('0x2a')](db['FreshsalesField']['rawAttributes'],function(_0x314eec){return{'name':_0x314eec['fieldName'],'type':_0x314eec['type'][_0x1a83('0x2b')]};});_0x1808a5[_0x1a83('0x2c')]=_[_0x1a83('0x2a')](_0x21933c,_0x1a83('0x28'));_0x1808a5[_0x1a83('0x2d')]=_[_0x1a83('0x2e')](_0x1eee9c['query']);_0x1808a5[_0x1a83('0x2f')]=_['intersection'](_0x1808a5[_0x1a83('0x2c')],_0x1808a5[_0x1a83('0x2d')]);_0x1ba422['attributes']=_[_0x1a83('0x30')](_0x1808a5[_0x1a83('0x2c')],qs['fields'](_0x1eee9c[_0x1a83('0x2d')]['fields']));_0x1ba422[_0x1a83('0x31')]=_0x1ba422[_0x1a83('0x31')][_0x1a83('0x32')]?_0x1ba422['attributes']:_0x1808a5['model'];if(!_0x1eee9c[_0x1a83('0x2d')][_0x1a83('0x33')](_0x1a83('0x34'))){_0x1ba422['limit']=qs[_0x1a83('0x1d')](_0x1eee9c[_0x1a83('0x2d')][_0x1a83('0x1d')]);_0x1ba422[_0x1a83('0x1f')]=qs['offset'](_0x1eee9c['query'][_0x1a83('0x1f')]);}_0x1ba422[_0x1a83('0x35')]=qs[_0x1a83('0x36')](_0x1eee9c[_0x1a83('0x2d')][_0x1a83('0x36')]);_0x1ba422[_0x1a83('0x37')]=qs[_0x1a83('0x2f')](_[_0x1a83('0x38')](_0x1eee9c[_0x1a83('0x2d')],_0x1808a5['filters']),_0x21933c);if(_0x1eee9c['query'][_0x1a83('0x39')]){_0x1ba422[_0x1a83('0x37')]=_[_0x1a83('0x3a')](_0x1ba422[_0x1a83('0x37')],{'$or':_[_0x1a83('0x2a')](_0x21933c,function(_0x349703){if(_0x349703[_0x1a83('0x3b')]!==_0x1a83('0x3c')){var _0x11bd0f={};_0x11bd0f[_0x349703['name']]={'$like':'%'+_0x1eee9c[_0x1a83('0x2d')][_0x1a83('0x39')]+'%'};return _0x11bd0f;}})});}_0x1ba422=_[_0x1a83('0x3a')]({},_0x1ba422,_0x1eee9c[_0x1a83('0x3d')]);var _0x3c74a7={'where':_0x1ba422[_0x1a83('0x37')]};return db[_0x1a83('0x3e')]['count'](_0x3c74a7)[_0x1a83('0x25')](function(_0x6f762c){_0x2d0b03['count']=_0x6f762c;if(_0x1eee9c[_0x1a83('0x2d')]['includeAll']){_0x1ba422[_0x1a83('0x3f')]=[{'all':!![]}];}return db['FreshsalesField'][_0x1a83('0x40')](_0x1ba422);})[_0x1a83('0x25')](function(_0x56a574){_0x2d0b03['rows']=_0x56a574;return _0x2d0b03;})[_0x1a83('0x25')](respondWithFilteredResult(_0x1e9e5f,_0x1ba422))[_0x1a83('0x41')](handleError(_0x1e9e5f,null));};exports['show']=function(_0x2900aa,_0x128f63){var _0xd34e24={'raw':!![],'where':{'id':_0x2900aa[_0x1a83('0x42')]['id']}},_0x3dbb84={};_0x3dbb84[_0x1a83('0x2c')]=_[_0x1a83('0x2e')](db[_0x1a83('0x3e')][_0x1a83('0x43')]);_0x3dbb84[_0x1a83('0x2d')]=_[_0x1a83('0x2e')](_0x2900aa[_0x1a83('0x2d')]);_0x3dbb84[_0x1a83('0x2f')]=_['intersection'](_0x3dbb84['model'],_0x3dbb84['query']);_0xd34e24[_0x1a83('0x31')]=_[_0x1a83('0x30')](_0x3dbb84[_0x1a83('0x2c')],qs[_0x1a83('0x44')](_0x2900aa[_0x1a83('0x2d')][_0x1a83('0x44')]));_0xd34e24['attributes']=_0xd34e24[_0x1a83('0x31')][_0x1a83('0x32')]?_0xd34e24[_0x1a83('0x31')]:_0x3dbb84['model'];if(_0x2900aa[_0x1a83('0x2d')][_0x1a83('0x45')]){_0xd34e24[_0x1a83('0x3f')]=[{'all':!![]}];}_0xd34e24=_[_0x1a83('0x3a')]({},_0xd34e24,_0x2900aa[_0x1a83('0x3d')]);return db['FreshsalesField'][_0x1a83('0x46')](_0xd34e24)['then'](handleEntityNotFound(_0x128f63,null))[_0x1a83('0x25')](respondWithResult(_0x128f63,null))[_0x1a83('0x41')](handleError(_0x128f63,null));};exports[_0x1a83('0x47')]=function(_0x3fba01,_0x3b556d){return db['FreshsalesField'][_0x1a83('0x47')](_0x3fba01['body'],{})[_0x1a83('0x25')](respondWithResult(_0x3b556d,0xc9))[_0x1a83('0x41')](handleError(_0x3b556d,null));};exports[_0x1a83('0x24')]=function(_0x46f265,_0x325397){if(_0x46f265[_0x1a83('0x48')]['id']){delete _0x46f265[_0x1a83('0x48')]['id'];}return db[_0x1a83('0x3e')][_0x1a83('0x46')]({'where':{'id':_0x46f265[_0x1a83('0x42')]['id']}})[_0x1a83('0x25')](handleEntityNotFound(_0x325397,null))['then'](saveUpdates(_0x46f265[_0x1a83('0x48')],null))['then'](respondWithResult(_0x325397,null))['catch'](handleError(_0x325397,null));};exports[_0x1a83('0x49')]=function(_0x318c47,_0x2edba8){return db[_0x1a83('0x3e')][_0x1a83('0x46')]({'where':{'id':_0x318c47['params']['id']}})[_0x1a83('0x25')](handleEntityNotFound(_0x2edba8,null))[_0x1a83('0x25')](removeEntity(_0x2edba8,null))[_0x1a83('0x41')](handleError(_0x2edba8,null));};
\ No newline at end of file
index 3e2176f..ed7a737 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0b63=['FreshsalesField','freshsales_unique_index','FieldId','lodash','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intFreshsalesField.attributes','exports'];(function(_0x425c33,_0xfdb294){var _0x53f1db=function(_0x2e1fa4){while(--_0x2e1fa4){_0x425c33['push'](_0x425c33['shift']());}};_0x53f1db(++_0xfdb294);}(_0x0b63,0xe7));var _0x30b6=function(_0x49b75c,_0x443782){_0x49b75c=_0x49b75c-0x0;var _0xb11b94=_0x0b63[_0x49b75c];return _0xb11b94;};'use strict';var _=require(_0x30b6('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x30b6('0x1'));var moment=require(_0x30b6('0x2'));var BPromise=require(_0x30b6('0x3'));var rp=require(_0x30b6('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x30b6('0x5'));var config=require(_0x30b6('0x6'));var attributes=require(_0x30b6('0x7'));module[_0x30b6('0x8')]=function(_0x2670c6,_0x2fddeb){return _0x2670c6['define'](_0x30b6('0x9'),attributes,{'tableName':'int_freshsales_fields','paranoid':![],'indexes':[{'name':_0x30b6('0xa'),'fields':['idField',_0x30b6('0xb')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xa3fe=['request-promise','path','../../config/environment','exports','int_freshsales_fields','freshsales_unique_index','idField','lodash','../../config/logger','api','bluebird'];(function(_0x3e967f,_0x28027a){var _0x54bffd=function(_0x2bf5db){while(--_0x2bf5db){_0x3e967f['push'](_0x3e967f['shift']());}};_0x54bffd(++_0x28027a);}(_0xa3fe,0xd8));var _0xea3f=function(_0x1bdf25,_0x2db6b5){_0x1bdf25=_0x1bdf25-0x0;var _0x20a96d=_0xa3fe[_0x1bdf25];return _0x20a96d;};'use strict';var _=require(_0xea3f('0x0'));var util=require('util');var logger=require(_0xea3f('0x1'))(_0xea3f('0x2'));var moment=require('moment');var BPromise=require(_0xea3f('0x3'));var rp=require(_0xea3f('0x4'));var fs=require('fs');var path=require(_0xea3f('0x5'));var rimraf=require('rimraf');var config=require(_0xea3f('0x6'));var attributes=require('./intFreshsalesField.attributes');module[_0xea3f('0x7')]=function(_0x7ea359,_0x4150b2){return _0x7ea359['define']('FreshsalesField',attributes,{'tableName':_0xea3f('0x8'),'paranoid':![],'indexes':[{'name':_0xea3f('0x9'),'fields':[_0xea3f('0xa'),'FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 9e6236c..26806d9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc6ac=['http','request','then','info','FreshsalesField,\x20%s,\x20%s','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x41e67e,_0x1aaf7){var _0x247517=function(_0x1f4750){while(--_0x1f4750){_0x41e67e['push'](_0x41e67e['shift']());}};_0x247517(++_0x1aaf7);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x285c7c,_0x1ea0a6){_0x285c7c=_0x285c7c-0x0;var _0x486753=_0xc6ac[_0x285c7c];return _0x486753;};'use strict';var _=require(_0xcc6a('0x0'));var util=require(_0xcc6a('0x1'));var moment=require(_0xcc6a('0x2'));var BPromise=require(_0xcc6a('0x3'));var rs=require(_0xcc6a('0x4'));var fs=require('fs');var Redis=require(_0xcc6a('0x5'));var db=require(_0xcc6a('0x6'))['db'];var utils=require(_0xcc6a('0x7'));var logger=require(_0xcc6a('0x8'))(_0xcc6a('0x9'));var config=require(_0xcc6a('0xa'));var jayson=require(_0xcc6a('0xb'));var client=jayson[_0xcc6a('0xc')][_0xcc6a('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x5f3887,_0x3dd497,_0x11b919){return new BPromise(function(_0xf02261,_0x560cc4){return client[_0xcc6a('0xe')](_0x5f3887,_0x11b919)[_0xcc6a('0xf')](function(_0x7806a0){logger[_0xcc6a('0x10')](_0xcc6a('0x11'),_0x3dd497,'request\x20sent');logger[_0xcc6a('0x12')](_0xcc6a('0x13'),_0x3dd497,_0xcc6a('0x14'),JSON['stringify'](_0x7806a0));if(_0x7806a0[_0xcc6a('0x15')]){if(_0x7806a0[_0xcc6a('0x15')][_0xcc6a('0x16')]===0x1f4){logger['error']('FreshsalesField,\x20%s,\x20%s',_0x3dd497,_0x7806a0[_0xcc6a('0x15')][_0xcc6a('0x17')]);return _0x560cc4(_0x7806a0[_0xcc6a('0x15')]['message']);}logger['error'](_0xcc6a('0x11'),_0x3dd497,_0x7806a0[_0xcc6a('0x15')][_0xcc6a('0x17')]);return _0xf02261(_0x7806a0[_0xcc6a('0x15')][_0xcc6a('0x17')]);}else{logger[_0xcc6a('0x10')](_0xcc6a('0x11'),_0x3dd497,_0xcc6a('0x14'));_0xf02261(_0x7806a0['result']['message']);}})['catch'](function(_0x395a55){logger[_0xcc6a('0x15')](_0xcc6a('0x11'),_0x3dd497,_0x395a55);_0x560cc4(_0x395a55);});});}
\ No newline at end of file
+var _0xacf4=['message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','info','FreshsalesField,\x20%s,\x20%s','request\x20sent','FreshsalesField,\x20%s,\x20%s,\x20%s','error'];(function(_0x34843e,_0x4c4224){var _0x598f7f=function(_0x12a44c){while(--_0x12a44c){_0x34843e['push'](_0x34843e['shift']());}};_0x598f7f(++_0x4c4224);}(_0xacf4,0xe7));var _0x4acf=function(_0x54a3cc,_0x480b4b){_0x54a3cc=_0x54a3cc-0x0;var _0x18d0aa=_0xacf4[_0x54a3cc];return _0x18d0aa;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4acf('0x0'));var BPromise=require(_0x4acf('0x1'));var rs=require(_0x4acf('0x2'));var fs=require('fs');var Redis=require(_0x4acf('0x3'));var db=require(_0x4acf('0x4'))['db'];var utils=require(_0x4acf('0x5'));var logger=require(_0x4acf('0x6'))('rpc');var config=require(_0x4acf('0x7'));var jayson=require(_0x4acf('0x8'));var client=jayson['client'][_0x4acf('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2ba08a,_0x649ad2,_0x45a5a4){return new BPromise(function(_0x25d345,_0x50f5f4){return client['request'](_0x2ba08a,_0x45a5a4)[_0x4acf('0xa')](function(_0x59f559){logger[_0x4acf('0xb')](_0x4acf('0xc'),_0x649ad2,_0x4acf('0xd'));logger['debug'](_0x4acf('0xe'),_0x649ad2,_0x4acf('0xd'),JSON['stringify'](_0x59f559));if(_0x59f559['error']){if(_0x59f559[_0x4acf('0xf')]['code']===0x1f4){logger['error'](_0x4acf('0xc'),_0x649ad2,_0x59f559[_0x4acf('0xf')][_0x4acf('0x10')]);return _0x50f5f4(_0x59f559[_0x4acf('0xf')][_0x4acf('0x10')]);}logger[_0x4acf('0xf')](_0x4acf('0xc'),_0x649ad2,_0x59f559[_0x4acf('0xf')][_0x4acf('0x10')]);return _0x25d345(_0x59f559[_0x4acf('0xf')][_0x4acf('0x10')]);}else{logger['info'](_0x4acf('0xc'),_0x649ad2,'request\x20sent');_0x25d345(_0x59f559[_0x4acf('0x11')][_0x4acf('0x10')]);}})[_0x4acf('0x12')](function(_0x5d934a){logger['error'](_0x4acf('0xc'),_0x649ad2,_0x5d934a);_0x50f5f4(_0x5d934a);});});}
\ No newline at end of file
index ef3411f..0b67d3a 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(_0x5b8885,_0x1ff60b){var _0x1053ee=function(_0x309327){while(--_0x309327){_0x5b8885['push'](_0x5b8885['shift']());}};_0x1053ee(++_0x1ff60b);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'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(_0xda5a5a,_0x3944b8){var _0x3f468a=function(_0x3b1f31){while(--_0x3b1f31){_0xda5a5a['push'](_0xda5a5a['shift']());}};_0x3f468a(++_0x3944b8);}(_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['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 9662dba..9435f93 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1472=['STRING','username','ENUM','integrationTab','sequelize','exports'];(function(_0x4f45a8,_0xa604a9){var _0x12b3c8=function(_0x25f744){while(--_0x25f744){_0x4f45a8['push'](_0x4f45a8['shift']());}};_0x12b3c8(++_0xa604a9);}(_0x1472,0x166));var _0x2147=function(_0x4d45c1,_0x2beda1){_0x4d45c1=_0x4d45c1-0x0;var _0x244478=_0x1472[_0x4d45c1];return _0x244478;};'use strict';var Sequelize=require(_0x2147('0x0'));module[_0x2147('0x1')]={'name':{'type':Sequelize[_0x2147('0x2')]},'description':{'type':Sequelize[_0x2147('0x2')]},'username':{'type':Sequelize[_0x2147('0x2')],'unique':_0x2147('0x3')},'remoteUri':{'type':Sequelize[_0x2147('0x2')]},'password':{'type':Sequelize[_0x2147('0x2')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize['STRING']},'securityToken':{'type':Sequelize[_0x2147('0x2')]},'serverUrl':{'type':Sequelize[_0x2147('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x2147('0x4')]('integrationTab','newTab'),'defaultValue':_0x2147('0x5')}};
\ No newline at end of file
+var _0xb36b=['username','ENUM','integrationTab','newTab','sequelize','STRING'];(function(_0x11ae05,_0xb34f47){var _0x239c2f=function(_0xd35c61){while(--_0xd35c61){_0x11ae05['push'](_0x11ae05['shift']());}};_0x239c2f(++_0xb34f47);}(_0xb36b,0xac));var _0xbb36=function(_0x2423cc,_0x5b382e){_0x2423cc=_0x2423cc-0x0;var _0x2b8110=_0xb36b[_0x2423cc];return _0x2b8110;};'use strict';var Sequelize=require(_0xbb36('0x0'));module['exports']={'name':{'type':Sequelize[_0xbb36('0x1')]},'description':{'type':Sequelize[_0xbb36('0x1')]},'username':{'type':Sequelize[_0xbb36('0x1')],'unique':_0xbb36('0x2')},'remoteUri':{'type':Sequelize[_0xbb36('0x1')]},'password':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0xbb36('0x1')]},'clientSecret':{'type':Sequelize[_0xbb36('0x1')]},'securityToken':{'type':Sequelize[_0xbb36('0x1')]},'serverUrl':{'type':Sequelize[_0xbb36('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xbb36('0x3')](_0xbb36('0x4'),_0xbb36('0x5')),'defaultValue':_0xbb36('0x4')}};
\ No newline at end of file
index e18a7d6..015aaa2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd123=['int','picklist','boolean','textarea','label','picklistValues','value','False','false','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','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','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','undefined','count','offset','set','Content-Range','apply','reject','save','update','destroy','error','stack','name','SalesforceAccount','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','then','rows','catch','show','params','find','create','body','getConfigurations','SalesforceConfiguration','order','findOne','Subjects','getSubjects','channel','getDescriptions','SalesforceField','Descriptions','getFields','Task','remoteUri','clientId','clientSecret','username','password','securityToken','substring','lastIndexOf','Connection','concat','isNil','ticketType','sobject','describe','OwnerId','IsReminderSet','IsRecurrence','Subject','string'];(function(_0x109b28,_0x1e39f6){var _0x19a427=function(_0x57a871){while(--_0x57a871){_0x109b28['push'](_0x109b28['shift']());}};_0x19a427(++_0x1e39f6);}(_0xd123,0x8f));var _0x3d12=function(_0x5257bf,_0xf39844){_0x5257bf=_0x5257bf-0x0;var _0x30f32b=_0xd123[_0x5257bf];return _0x30f32b;};'use strict';var emlformat=require(_0x3d12('0x0'));var rimraf=require(_0x3d12('0x1'));var zipdir=require(_0x3d12('0x2'));var jsonpatch=require(_0x3d12('0x3'));var rp=require(_0x3d12('0x4'));var moment=require(_0x3d12('0x5'));var BPromise=require(_0x3d12('0x6'));var Mustache=require(_0x3d12('0x7'));var util=require(_0x3d12('0x8'));var path=require(_0x3d12('0x9'));var sox=require('sox');var csv=require(_0x3d12('0xa'));var ejs=require(_0x3d12('0xb'));var fs=require('fs');var fs_extra=require(_0x3d12('0xc'));var _=require(_0x3d12('0xd'));var squel=require(_0x3d12('0xe'));var crypto=require(_0x3d12('0xf'));var jsforce=require(_0x3d12('0x10'));var deskjs=require(_0x3d12('0x11'));var toCsv=require(_0x3d12('0xa'));var querystring=require(_0x3d12('0x12'));var Papa=require('papaparse');var Redis=require(_0x3d12('0x13'));var authService=require(_0x3d12('0x14'));var qs=require(_0x3d12('0x15'));var as=require(_0x3d12('0x16'));var hardwareService=require(_0x3d12('0x17'));var logger=require(_0x3d12('0x18'))(_0x3d12('0x19'));var utils=require(_0x3d12('0x1a'));var config=require(_0x3d12('0x1b'));var licenseUtil=require('../../config/license/util');var db=require(_0x3d12('0x1c'))['db'];var integrations=require(_0x3d12('0x1d'));function respondWithStatusCode(_0x4a997b,_0x39f54b){_0x39f54b=_0x39f54b||0xcc;return function(_0x710739){if(_0x710739){return _0x4a997b[_0x3d12('0x1e')](_0x39f54b);}return _0x4a997b[_0x3d12('0x1f')](_0x39f54b)[_0x3d12('0x20')]();};}function respondWithResult(_0x185266,_0xb72c27){_0xb72c27=_0xb72c27||0xc8;return function(_0x3f8575){if(_0x3f8575){return _0x185266[_0x3d12('0x1f')](_0xb72c27)[_0x3d12('0x21')](_0x3f8575);}};}function respondWithFilteredResult(_0x5557b4,_0x20a609){return function(_0x2e1da6){if(_0x2e1da6){var _0x2c412f=typeof _0x20a609['offset']===_0x3d12('0x22')&&typeof _0x20a609['limit']===_0x3d12('0x22');var _0x3459a0=_0x2e1da6['count'];var _0x28c3b8=_0x2c412f?0x0:_0x20a609['offset'];var _0xc45edf=_0x2c412f?_0x2e1da6[_0x3d12('0x23')]:_0x20a609[_0x3d12('0x24')]+_0x20a609['limit'];var _0x34f071;if(_0xc45edf>=_0x3459a0){_0xc45edf=_0x3459a0;_0x34f071=0xc8;}else{_0x34f071=0xce;}_0x5557b4[_0x3d12('0x1f')](_0x34f071);return _0x5557b4[_0x3d12('0x25')](_0x3d12('0x26'),_0x28c3b8+'-'+_0xc45edf+'/'+_0x3459a0)[_0x3d12('0x21')](_0x2e1da6);}return null;};}function patchUpdates(_0x412a0a){return function(_0xfe0fa5){try{jsonpatch[_0x3d12('0x27')](_0xfe0fa5,_0x412a0a,!![]);}catch(_0x5acd02){return BPromise[_0x3d12('0x28')](_0x5acd02);}return _0xfe0fa5[_0x3d12('0x29')]();};}function saveUpdates(_0x17fadd,_0x175f3d){return function(_0x3180e3){if(_0x3180e3){return _0x3180e3[_0x3d12('0x2a')](_0x17fadd)['then'](function(_0x268cfb){return _0x268cfb;});}return null;};}function removeEntity(_0x1a045e,_0x9cd058){return function(_0x150c32){if(_0x150c32){return _0x150c32[_0x3d12('0x2b')]()['then'](function(){_0x1a045e[_0x3d12('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1fa663,_0x2d3484){return function(_0x93aeb2){if(!_0x93aeb2){_0x1fa663['sendStatus'](0x194);}return _0x93aeb2;};}function handleError(_0x501f1d,_0x500ef0){_0x500ef0=_0x500ef0||0x1f4;return function(_0x132c26){logger[_0x3d12('0x2c')](_0x132c26[_0x3d12('0x2d')]);if(_0x132c26[_0x3d12('0x2e')]){delete _0x132c26[_0x3d12('0x2e')];}_0x501f1d[_0x3d12('0x1f')](_0x500ef0)['send'](_0x132c26);};}exports['index']=function(_0x1925b0,_0x3ab5fe){var _0x526726={},_0x3f07ce={},_0x448981={'count':0x0,'rows':[]};var _0x3efd5c=_['map'](db[_0x3d12('0x2f')][_0x3d12('0x30')],function(_0x579e1b){return{'name':_0x579e1b[_0x3d12('0x31')],'type':_0x579e1b[_0x3d12('0x32')][_0x3d12('0x33')]};});_0x3f07ce[_0x3d12('0x34')]=_[_0x3d12('0x35')](_0x3efd5c,'name');_0x3f07ce[_0x3d12('0x36')]=_[_0x3d12('0x37')](_0x1925b0[_0x3d12('0x36')]);_0x3f07ce[_0x3d12('0x38')]=_[_0x3d12('0x39')](_0x3f07ce[_0x3d12('0x34')],_0x3f07ce[_0x3d12('0x36')]);_0x526726[_0x3d12('0x3a')]=_[_0x3d12('0x39')](_0x3f07ce[_0x3d12('0x34')],qs[_0x3d12('0x3b')](_0x1925b0[_0x3d12('0x36')][_0x3d12('0x3b')]));_0x526726['attributes']=_0x526726[_0x3d12('0x3a')][_0x3d12('0x3c')]?_0x526726[_0x3d12('0x3a')]:_0x3f07ce[_0x3d12('0x34')];if(!_0x1925b0[_0x3d12('0x36')][_0x3d12('0x3d')](_0x3d12('0x3e'))){_0x526726['limit']=qs[_0x3d12('0x3f')](_0x1925b0[_0x3d12('0x36')]['limit']);_0x526726[_0x3d12('0x24')]=qs[_0x3d12('0x24')](_0x1925b0['query'][_0x3d12('0x24')]);}_0x526726['order']=qs[_0x3d12('0x40')](_0x1925b0[_0x3d12('0x36')][_0x3d12('0x40')]);_0x526726[_0x3d12('0x41')]=qs['filters'](_[_0x3d12('0x42')](_0x1925b0['query'],_0x3f07ce[_0x3d12('0x38')]),_0x3efd5c);if(_0x1925b0[_0x3d12('0x36')][_0x3d12('0x43')]){_0x526726[_0x3d12('0x41')]=_[_0x3d12('0x44')](_0x526726['where'],{'$or':_[_0x3d12('0x35')](_0x3efd5c,function(_0x3f8867){if(_0x3f8867[_0x3d12('0x32')]!==_0x3d12('0x45')){var _0x51696d={};_0x51696d[_0x3f8867[_0x3d12('0x2e')]]={'$like':'%'+_0x1925b0['query']['filter']+'%'};return _0x51696d;}})});}_0x526726=_[_0x3d12('0x44')]({},_0x526726,_0x1925b0[_0x3d12('0x46')]);var _0x4fd99e={'where':_0x526726['where']};return db[_0x3d12('0x2f')][_0x3d12('0x23')](_0x4fd99e)['then'](function(_0x3ca720){_0x448981['count']=_0x3ca720;if(_0x1925b0[_0x3d12('0x36')][_0x3d12('0x47')]){_0x526726[_0x3d12('0x48')]=[{'all':!![]}];}return db['SalesforceAccount'][_0x3d12('0x49')](_0x526726);})[_0x3d12('0x4a')](function(_0x1aeed3){_0x448981[_0x3d12('0x4b')]=_0x1aeed3;return _0x448981;})[_0x3d12('0x4a')](respondWithFilteredResult(_0x3ab5fe,_0x526726))[_0x3d12('0x4c')](handleError(_0x3ab5fe,null));};exports[_0x3d12('0x4d')]=function(_0x2d3811,_0xa2e308){var _0x4f66b0={'raw':![],'where':{'id':_0x2d3811[_0x3d12('0x4e')]['id']}},_0x54b719={};_0x54b719['model']=_[_0x3d12('0x37')](db['SalesforceAccount']['rawAttributes']);_0x54b719['query']=_[_0x3d12('0x37')](_0x2d3811[_0x3d12('0x36')]);_0x54b719[_0x3d12('0x38')]=_['intersection'](_0x54b719[_0x3d12('0x34')],_0x54b719[_0x3d12('0x36')]);_0x4f66b0['attributes']=_[_0x3d12('0x39')](_0x54b719[_0x3d12('0x34')],qs[_0x3d12('0x3b')](_0x2d3811[_0x3d12('0x36')]['fields']));_0x4f66b0[_0x3d12('0x3a')]=_0x4f66b0['attributes'][_0x3d12('0x3c')]?_0x4f66b0[_0x3d12('0x3a')]:_0x54b719[_0x3d12('0x34')];if(_0x2d3811[_0x3d12('0x36')]['includeAll']){_0x4f66b0[_0x3d12('0x48')]=[{'all':!![]}];}_0x4f66b0=_[_0x3d12('0x44')]({},_0x4f66b0,_0x2d3811[_0x3d12('0x46')]);return db[_0x3d12('0x2f')][_0x3d12('0x4f')](_0x4f66b0)[_0x3d12('0x4a')](handleEntityNotFound(_0xa2e308,null))[_0x3d12('0x4a')](respondWithResult(_0xa2e308,null))[_0x3d12('0x4c')](handleError(_0xa2e308,null));};exports[_0x3d12('0x50')]=function(_0x507f36,_0x421212){return db['SalesforceAccount'][_0x3d12('0x50')](_0x507f36[_0x3d12('0x51')],{})[_0x3d12('0x4a')](respondWithResult(_0x421212,0xc9))[_0x3d12('0x4c')](handleError(_0x421212,null));};exports[_0x3d12('0x2a')]=function(_0x7f40b0,_0x44fe8a){if(_0x7f40b0[_0x3d12('0x51')]['id']){delete _0x7f40b0['body']['id'];}return db[_0x3d12('0x2f')][_0x3d12('0x4f')]({'where':{'id':_0x7f40b0[_0x3d12('0x4e')]['id']}})[_0x3d12('0x4a')](handleEntityNotFound(_0x44fe8a,null))[_0x3d12('0x4a')](saveUpdates(_0x7f40b0[_0x3d12('0x51')],null))[_0x3d12('0x4a')](respondWithResult(_0x44fe8a,null))[_0x3d12('0x4c')](handleError(_0x44fe8a,null));};exports[_0x3d12('0x2b')]=function(_0x178d8a,_0x27e870){return db['SalesforceAccount']['find']({'where':{'id':_0x178d8a[_0x3d12('0x4e')]['id']}})[_0x3d12('0x4a')](handleEntityNotFound(_0x27e870,null))[_0x3d12('0x4a')](removeEntity(_0x27e870,null))['catch'](handleError(_0x27e870,null));};exports[_0x3d12('0x52')]=function(_0x1388ff,_0x383316,_0x32b633){var _0x2e23f6={};var _0x54ec38={};var _0x30bbaf;var _0x1e4c7f;return db[_0x3d12('0x2f')]['findOne']({'where':{'id':_0x1388ff[_0x3d12('0x4e')]['id']}})[_0x3d12('0x4a')](handleEntityNotFound(_0x383316,null))[_0x3d12('0x4a')](function(_0x38fa48){if(_0x38fa48){_0x30bbaf=_0x38fa48;_0x54ec38[_0x3d12('0x34')]=_[_0x3d12('0x37')](db[_0x3d12('0x53')][_0x3d12('0x30')]);_0x54ec38[_0x3d12('0x36')]=_[_0x3d12('0x37')](_0x1388ff[_0x3d12('0x36')]);_0x54ec38[_0x3d12('0x38')]=_['intersection'](_0x54ec38[_0x3d12('0x34')],_0x54ec38[_0x3d12('0x36')]);_0x2e23f6[_0x3d12('0x3a')]=_[_0x3d12('0x39')](_0x54ec38[_0x3d12('0x34')],qs[_0x3d12('0x3b')](_0x1388ff[_0x3d12('0x36')][_0x3d12('0x3b')]));_0x2e23f6[_0x3d12('0x3a')]=_0x2e23f6['attributes'][_0x3d12('0x3c')]?_0x2e23f6['attributes']:_0x54ec38[_0x3d12('0x34')];_0x2e23f6[_0x3d12('0x54')]=qs[_0x3d12('0x40')](_0x1388ff[_0x3d12('0x36')][_0x3d12('0x40')]);_0x2e23f6[_0x3d12('0x41')]=qs[_0x3d12('0x38')](_['pick'](_0x1388ff[_0x3d12('0x36')],_0x54ec38['filters']));if(_0x1388ff[_0x3d12('0x36')]['filter']){_0x2e23f6[_0x3d12('0x41')]=_[_0x3d12('0x44')](_0x2e23f6[_0x3d12('0x41')],{'$or':_['map'](_0x2e23f6['attributes'],function(_0x3c5535){var _0x2c5cce={};_0x2c5cce[_0x3c5535]={'$like':'%'+_0x1388ff[_0x3d12('0x36')][_0x3d12('0x43')]+'%'};return _0x2c5cce;})});}_0x2e23f6=_[_0x3d12('0x44')]({},_0x2e23f6,_0x1388ff[_0x3d12('0x46')]);return _0x30bbaf[_0x3d12('0x52')](_0x2e23f6);}})[_0x3d12('0x4a')](function(_0x896e8f){if(_0x896e8f){_0x1e4c7f=_0x896e8f[_0x3d12('0x3c')];if(!_0x1388ff[_0x3d12('0x36')][_0x3d12('0x3d')](_0x3d12('0x3e'))){_0x2e23f6[_0x3d12('0x3f')]=qs['limit'](_0x1388ff[_0x3d12('0x36')][_0x3d12('0x3f')]);_0x2e23f6[_0x3d12('0x24')]=qs[_0x3d12('0x24')](_0x1388ff[_0x3d12('0x36')]['offset']);}return _0x30bbaf['getConfigurations'](_0x2e23f6);}})[_0x3d12('0x4a')](function(_0x2fb5ef){if(_0x2fb5ef){return _0x2fb5ef?{'count':_0x1e4c7f,'rows':_0x2fb5ef}:null;}})[_0x3d12('0x4a')](respondWithResult(_0x383316,null))[_0x3d12('0x4c')](handleError(_0x383316,null));};exports['addConfiguration']=function(_0x23606f,_0x424c31,_0x7acfd0){if(_0x23606f[_0x3d12('0x51')]['id']){delete _0x23606f[_0x3d12('0x51')]['id'];}return db[_0x3d12('0x2f')][_0x3d12('0x55')]({'where':{'id':_0x23606f[_0x3d12('0x4e')]['id']}})[_0x3d12('0x4a')](handleEntityNotFound(_0x424c31,null))[_0x3d12('0x4a')](function(_0x1d85ec){if(_0x1d85ec){_0x23606f[_0x3d12('0x51')]['AccountId']=_0x1d85ec['id'];_0x23606f['body'][_0x3d12('0x56')]=integrations[_0x3d12('0x57')](_0x23606f[_0x3d12('0x51')][_0x3d12('0x58')],_0x23606f[_0x3d12('0x51')]['type']);_0x23606f[_0x3d12('0x51')]['Descriptions']=integrations[_0x3d12('0x59')](_0x23606f[_0x3d12('0x51')][_0x3d12('0x58')],_0x23606f[_0x3d12('0x51')][_0x3d12('0x32')]);return db[_0x3d12('0x53')][_0x3d12('0x50')](_0x23606f['body'],{'include':[{'model':db[_0x3d12('0x5a')],'as':'Subjects'},{'model':db[_0x3d12('0x5a')],'as':_0x3d12('0x5b')}]});}return null;})[_0x3d12('0x4a')](respondWithResult(_0x424c31,null))[_0x3d12('0x4c')](handleError(_0x424c31,null));};exports[_0x3d12('0x5c')]=function(_0x471e36,_0x26276d,_0xea4a0c){var _0x5e9e32;var _0x1ae18b='';var _0x1e7543=_0x3d12('0x5d');return db[_0x3d12('0x2f')][_0x3d12('0x55')]({'where':{'id':_0x471e36[_0x3d12('0x4e')]['id']},'attributes':['id',_0x3d12('0x5e'),_0x3d12('0x5f'),_0x3d12('0x60'),_0x3d12('0x61'),_0x3d12('0x62'),_0x3d12('0x63')]})['then'](handleEntityNotFound(_0x26276d,null))['then'](function(_0x5c110c){if(_0x5c110c){_0x1ae18b=_0x5c110c[_0x3d12('0x5e')];var _0x1552d9=_0x1ae18b['slice'](-0x1);if(_0x1552d9==='/'){_0x1ae18b=_0x1ae18b[_0x3d12('0x64')](0x0,_0x1ae18b[_0x3d12('0x65')](_0x1552d9));}_0x5e9e32=new jsforce[(_0x3d12('0x66'))]({'oauth2':{'loginUrl':_0x1ae18b,'clientId':_0x5c110c[_0x3d12('0x5f')],'clientSecret':_0x5c110c[_0x3d12('0x60')]}});return _0x5e9e32['login'](_0x5c110c[_0x3d12('0x61')],_0x5c110c[_0x3d12('0x62')][_0x3d12('0x67')](_0x5c110c[_0x3d12('0x63')]));}})[_0x3d12('0x4a')](function(_0x5bc15c){if(_0x5bc15c){if(!_[_0x3d12('0x68')](_0x471e36['query'][_0x3d12('0x69')])){_0x1e7543=_0x471e36[_0x3d12('0x36')][_0x3d12('0x69')];}return _0x5e9e32[_0x3d12('0x6a')](_0x1e7543)[_0x3d12('0x6b')]();}})[_0x3d12('0x4a')](function(_0x550a29){var _0x2fe054=[_0x3d12('0x6c'),'ActivityDate',_0x3d12('0x6d'),_0x3d12('0x6e'),_0x3d12('0x6f'),'Description'];var _0x105bde=[_0x3d12('0x70'),_0x3d12('0x71'),_0x3d12('0x72'),_0x3d12('0x73'),'email',_0x3d12('0x74'),'phone'];if(_0x550a29){_['remove'](_0x550a29[_0x3d12('0x3b')],function(_0x1be3ed){return _0x2fe054['includes'](_0x1be3ed[_0x3d12('0x2e')])||!_0x105bde['includes'](_0x1be3ed['type']);});return{'count':_0x550a29[_0x3d12('0x3b')]['length'],'rows':_[_0x3d12('0x35')](_0x550a29[_0x3d12('0x3b')],function(_0x5b660d){return{'id':_0x5b660d['name'],'name':_0x5b660d[_0x3d12('0x75')],'custom':_0x5b660d['custom'],'options':_0x5b660d[_0x3d12('0x76')][_0x3d12('0x3c')]>0x0?_[_0x3d12('0x35')](_0x5b660d[_0x3d12('0x76')],function(_0x1a8c25){return{'name':_0x1a8c25[_0x3d12('0x75')],'value':_0x1a8c25[_0x3d12('0x77')]};}):_0x5b660d['type']=='boolean'?[{'name':'True','value':'true'},{'name':_0x3d12('0x78'),'value':_0x3d12('0x79')}]:[]};})};}})[_0x3d12('0x4a')](respondWithResult(_0x26276d,null))[_0x3d12('0x4c')](function(_0x2fad02){var _0x1821c8=_0x471e36[_0x3d12('0x36')][_0x3d12('0x7a')]?0x1f4:_0x2fad02[_0x3d12('0x7b')]||0x1f4;logger[_0x3d12('0x2c')](_0x3d12('0x7c'),_0x3d12('0x5c'),_0x1821c8,JSON[_0x3d12('0x7d')](_0x2fad02));delete _0x2fad02[_0x3d12('0x2e')];if(_0x1821c8===0x191){_0x1821c8=0x190;}_0x26276d[_0x3d12('0x1f')](_0x1821c8)[_0x3d12('0x7e')](_0x471e36[_0x3d12('0x36')][_0x3d12('0x7a')]?{'message':_0x3d12('0x7f'),'statusCode':_0x2fad02[_0x3d12('0x7b')]}:_0x2fad02);});};
\ No newline at end of file
+var _0xea58=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','error','stack','send','map','SalesforceAccount','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','name','merge','options','findAll','rows','catch','show','params','rawAttributes','include','find','create','body','destroy','getConfigurations','findOne','SalesforceConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','SalesforceField','Task','clientId','clientSecret','username','securityToken','slice','substring','lastIndexOf','Connection','login','password','concat','isNil','ticketType','describe','OwnerId','Subject','Description','string','picklist','boolean','email','textarea','remove','includes','label','custom','picklistValues','True','true','False','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','ejs','crypto','jsforce','desk.js'];(function(_0x9f7bd7,_0x3860dc){var _0x57c810=function(_0x4e0a92){while(--_0x4e0a92){_0x9f7bd7['push'](_0x9f7bd7['shift']());}};_0x57c810(++_0x3860dc);}(_0xea58,0xe0));var _0x8ea5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xea58[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8ea5('0x0'));var zipdir=require(_0x8ea5('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8ea5('0x2'));var moment=require('moment');var BPromise=require(_0x8ea5('0x3'));var Mustache=require(_0x8ea5('0x4'));var util=require(_0x8ea5('0x5'));var path=require(_0x8ea5('0x6'));var sox=require(_0x8ea5('0x7'));var csv=require('to-csv');var ejs=require(_0x8ea5('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x8ea5('0x9'));var jsforce=require(_0x8ea5('0xa'));var deskjs=require(_0x8ea5('0xb'));var toCsv=require('to-csv');var querystring=require(_0x8ea5('0xc'));var Papa=require(_0x8ea5('0xd'));var Redis=require(_0x8ea5('0xe'));var authService=require(_0x8ea5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x8ea5('0x10'));var hardwareService=require(_0x8ea5('0x11'));var logger=require(_0x8ea5('0x12'))(_0x8ea5('0x13'));var utils=require(_0x8ea5('0x14'));var config=require(_0x8ea5('0x15'));var licenseUtil=require(_0x8ea5('0x16'));var db=require(_0x8ea5('0x17'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x31d475,_0x456f23){_0x456f23=_0x456f23||0xcc;return function(_0x417de5){if(_0x417de5){return _0x31d475[_0x8ea5('0x18')](_0x456f23);}return _0x31d475[_0x8ea5('0x19')](_0x456f23)[_0x8ea5('0x1a')]();};}function respondWithResult(_0x36726e,_0x5083f0){_0x5083f0=_0x5083f0||0xc8;return function(_0x104e07){if(_0x104e07){return _0x36726e[_0x8ea5('0x19')](_0x5083f0)[_0x8ea5('0x1b')](_0x104e07);}};}function respondWithFilteredResult(_0x4fbb76,_0xafbfd4){return function(_0x201d76){if(_0x201d76){var _0x5a33ad=typeof _0xafbfd4[_0x8ea5('0x1c')]===_0x8ea5('0x1d')&&typeof _0xafbfd4[_0x8ea5('0x1e')]==='undefined';var _0x24e6d0=_0x201d76['count'];var _0x163eb4=_0x5a33ad?0x0:_0xafbfd4[_0x8ea5('0x1c')];var _0x163019=_0x5a33ad?_0x201d76[_0x8ea5('0x1f')]:_0xafbfd4[_0x8ea5('0x1c')]+_0xafbfd4[_0x8ea5('0x1e')];var _0x3863ef;if(_0x163019>=_0x24e6d0){_0x163019=_0x24e6d0;_0x3863ef=0xc8;}else{_0x3863ef=0xce;}_0x4fbb76[_0x8ea5('0x19')](_0x3863ef);return _0x4fbb76[_0x8ea5('0x20')]('Content-Range',_0x163eb4+'-'+_0x163019+'/'+_0x24e6d0)[_0x8ea5('0x1b')](_0x201d76);}return null;};}function patchUpdates(_0x185c00){return function(_0x2b8d34){try{jsonpatch[_0x8ea5('0x21')](_0x2b8d34,_0x185c00,!![]);}catch(_0x22d4b0){return BPromise['reject'](_0x22d4b0);}return _0x2b8d34[_0x8ea5('0x22')]();};}function saveUpdates(_0x5a587d,_0x63857b){return function(_0x2c2822){if(_0x2c2822){return _0x2c2822[_0x8ea5('0x23')](_0x5a587d)[_0x8ea5('0x24')](function(_0x2104d7){return _0x2104d7;});}return null;};}function removeEntity(_0x8d326b,_0x23ca52){return function(_0x3b4cb7){if(_0x3b4cb7){return _0x3b4cb7['destroy']()[_0x8ea5('0x24')](function(){_0x8d326b[_0x8ea5('0x19')](0xcc)[_0x8ea5('0x1a')]();});}};}function handleEntityNotFound(_0x9192f6,_0x454b38){return function(_0x14608a){if(!_0x14608a){_0x9192f6[_0x8ea5('0x18')](0x194);}return _0x14608a;};}function handleError(_0x3d0020,_0x446872){_0x446872=_0x446872||0x1f4;return function(_0x32ef1e){logger[_0x8ea5('0x25')](_0x32ef1e[_0x8ea5('0x26')]);if(_0x32ef1e['name']){delete _0x32ef1e['name'];}_0x3d0020['status'](_0x446872)[_0x8ea5('0x27')](_0x32ef1e);};}exports['index']=function(_0x579c76,_0x5163b0){var _0x1750f4={},_0x300684={},_0x2924d9={'count':0x0,'rows':[]};var _0x132150=_[_0x8ea5('0x28')](db[_0x8ea5('0x29')]['rawAttributes'],function(_0x5f24d0){return{'name':_0x5f24d0[_0x8ea5('0x2a')],'type':_0x5f24d0['type'][_0x8ea5('0x2b')]};});_0x300684[_0x8ea5('0x2c')]=_[_0x8ea5('0x28')](_0x132150,'name');_0x300684[_0x8ea5('0x2d')]=_[_0x8ea5('0x2e')](_0x579c76['query']);_0x300684[_0x8ea5('0x2f')]=_[_0x8ea5('0x30')](_0x300684['model'],_0x300684['query']);_0x1750f4[_0x8ea5('0x31')]=_[_0x8ea5('0x30')](_0x300684[_0x8ea5('0x2c')],qs[_0x8ea5('0x32')](_0x579c76[_0x8ea5('0x2d')][_0x8ea5('0x32')]));_0x1750f4[_0x8ea5('0x31')]=_0x1750f4[_0x8ea5('0x31')][_0x8ea5('0x33')]?_0x1750f4['attributes']:_0x300684[_0x8ea5('0x2c')];if(!_0x579c76['query'][_0x8ea5('0x34')](_0x8ea5('0x35'))){_0x1750f4[_0x8ea5('0x1e')]=qs[_0x8ea5('0x1e')](_0x579c76[_0x8ea5('0x2d')][_0x8ea5('0x1e')]);_0x1750f4[_0x8ea5('0x1c')]=qs[_0x8ea5('0x1c')](_0x579c76[_0x8ea5('0x2d')]['offset']);}_0x1750f4[_0x8ea5('0x36')]=qs[_0x8ea5('0x37')](_0x579c76['query'][_0x8ea5('0x37')]);_0x1750f4[_0x8ea5('0x38')]=qs[_0x8ea5('0x2f')](_[_0x8ea5('0x39')](_0x579c76[_0x8ea5('0x2d')],_0x300684[_0x8ea5('0x2f')]),_0x132150);if(_0x579c76[_0x8ea5('0x2d')][_0x8ea5('0x3a')]){_0x1750f4[_0x8ea5('0x38')]=_['merge'](_0x1750f4['where'],{'$or':_[_0x8ea5('0x28')](_0x132150,function(_0x3ad9cd){if(_0x3ad9cd[_0x8ea5('0x3b')]!=='VIRTUAL'){var _0x5ddbc6={};_0x5ddbc6[_0x3ad9cd[_0x8ea5('0x3c')]]={'$like':'%'+_0x579c76[_0x8ea5('0x2d')][_0x8ea5('0x3a')]+'%'};return _0x5ddbc6;}})});}_0x1750f4=_[_0x8ea5('0x3d')]({},_0x1750f4,_0x579c76[_0x8ea5('0x3e')]);var _0x50c1c0={'where':_0x1750f4['where']};return db['SalesforceAccount'][_0x8ea5('0x1f')](_0x50c1c0)[_0x8ea5('0x24')](function(_0x23bf38){_0x2924d9[_0x8ea5('0x1f')]=_0x23bf38;if(_0x579c76['query']['includeAll']){_0x1750f4['include']=[{'all':!![]}];}return db['SalesforceAccount'][_0x8ea5('0x3f')](_0x1750f4);})[_0x8ea5('0x24')](function(_0x16916e){_0x2924d9[_0x8ea5('0x40')]=_0x16916e;return _0x2924d9;})[_0x8ea5('0x24')](respondWithFilteredResult(_0x5163b0,_0x1750f4))[_0x8ea5('0x41')](handleError(_0x5163b0,null));};exports[_0x8ea5('0x42')]=function(_0x2deff6,_0x1f398e){var _0x3c5b2d={'raw':![],'where':{'id':_0x2deff6[_0x8ea5('0x43')]['id']}},_0x235f0c={};_0x235f0c[_0x8ea5('0x2c')]=_['keys'](db[_0x8ea5('0x29')][_0x8ea5('0x44')]);_0x235f0c[_0x8ea5('0x2d')]=_[_0x8ea5('0x2e')](_0x2deff6[_0x8ea5('0x2d')]);_0x235f0c[_0x8ea5('0x2f')]=_[_0x8ea5('0x30')](_0x235f0c['model'],_0x235f0c['query']);_0x3c5b2d[_0x8ea5('0x31')]=_[_0x8ea5('0x30')](_0x235f0c[_0x8ea5('0x2c')],qs[_0x8ea5('0x32')](_0x2deff6[_0x8ea5('0x2d')][_0x8ea5('0x32')]));_0x3c5b2d[_0x8ea5('0x31')]=_0x3c5b2d[_0x8ea5('0x31')][_0x8ea5('0x33')]?_0x3c5b2d[_0x8ea5('0x31')]:_0x235f0c[_0x8ea5('0x2c')];if(_0x2deff6[_0x8ea5('0x2d')]['includeAll']){_0x3c5b2d[_0x8ea5('0x45')]=[{'all':!![]}];}_0x3c5b2d=_[_0x8ea5('0x3d')]({},_0x3c5b2d,_0x2deff6[_0x8ea5('0x3e')]);return db[_0x8ea5('0x29')][_0x8ea5('0x46')](_0x3c5b2d)['then'](handleEntityNotFound(_0x1f398e,null))[_0x8ea5('0x24')](respondWithResult(_0x1f398e,null))[_0x8ea5('0x41')](handleError(_0x1f398e,null));};exports[_0x8ea5('0x47')]=function(_0x52f1b6,_0x3ef08c){return db[_0x8ea5('0x29')][_0x8ea5('0x47')](_0x52f1b6[_0x8ea5('0x48')],{})[_0x8ea5('0x24')](respondWithResult(_0x3ef08c,0xc9))['catch'](handleError(_0x3ef08c,null));};exports[_0x8ea5('0x23')]=function(_0x7fe75b,_0x2ee68d){if(_0x7fe75b[_0x8ea5('0x48')]['id']){delete _0x7fe75b[_0x8ea5('0x48')]['id'];}return db[_0x8ea5('0x29')]['find']({'where':{'id':_0x7fe75b[_0x8ea5('0x43')]['id']}})[_0x8ea5('0x24')](handleEntityNotFound(_0x2ee68d,null))['then'](saveUpdates(_0x7fe75b[_0x8ea5('0x48')],null))[_0x8ea5('0x24')](respondWithResult(_0x2ee68d,null))[_0x8ea5('0x41')](handleError(_0x2ee68d,null));};exports[_0x8ea5('0x49')]=function(_0x357387,_0x169026){return db['SalesforceAccount'][_0x8ea5('0x46')]({'where':{'id':_0x357387[_0x8ea5('0x43')]['id']}})['then'](handleEntityNotFound(_0x169026,null))[_0x8ea5('0x24')](removeEntity(_0x169026,null))['catch'](handleError(_0x169026,null));};exports[_0x8ea5('0x4a')]=function(_0x5925ee,_0x43d0ee,_0x25d53b){var _0x27602a={};var _0x52f8b2={};var _0x118e1c;var _0x31b1f6;return db[_0x8ea5('0x29')][_0x8ea5('0x4b')]({'where':{'id':_0x5925ee[_0x8ea5('0x43')]['id']}})[_0x8ea5('0x24')](handleEntityNotFound(_0x43d0ee,null))['then'](function(_0x5f49b7){if(_0x5f49b7){_0x118e1c=_0x5f49b7;_0x52f8b2[_0x8ea5('0x2c')]=_['keys'](db[_0x8ea5('0x4c')]['rawAttributes']);_0x52f8b2['query']=_[_0x8ea5('0x2e')](_0x5925ee[_0x8ea5('0x2d')]);_0x52f8b2[_0x8ea5('0x2f')]=_[_0x8ea5('0x30')](_0x52f8b2[_0x8ea5('0x2c')],_0x52f8b2[_0x8ea5('0x2d')]);_0x27602a['attributes']=_[_0x8ea5('0x30')](_0x52f8b2[_0x8ea5('0x2c')],qs[_0x8ea5('0x32')](_0x5925ee[_0x8ea5('0x2d')][_0x8ea5('0x32')]));_0x27602a['attributes']=_0x27602a[_0x8ea5('0x31')][_0x8ea5('0x33')]?_0x27602a[_0x8ea5('0x31')]:_0x52f8b2['model'];_0x27602a[_0x8ea5('0x36')]=qs['sort'](_0x5925ee[_0x8ea5('0x2d')]['sort']);_0x27602a['where']=qs[_0x8ea5('0x2f')](_[_0x8ea5('0x39')](_0x5925ee[_0x8ea5('0x2d')],_0x52f8b2['filters']));if(_0x5925ee[_0x8ea5('0x2d')][_0x8ea5('0x3a')]){_0x27602a[_0x8ea5('0x38')]=_['merge'](_0x27602a[_0x8ea5('0x38')],{'$or':_[_0x8ea5('0x28')](_0x27602a[_0x8ea5('0x31')],function(_0x5022ba){var _0x237392={};_0x237392[_0x5022ba]={'$like':'%'+_0x5925ee[_0x8ea5('0x2d')][_0x8ea5('0x3a')]+'%'};return _0x237392;})});}_0x27602a=_[_0x8ea5('0x3d')]({},_0x27602a,_0x5925ee['options']);return _0x118e1c[_0x8ea5('0x4a')](_0x27602a);}})[_0x8ea5('0x24')](function(_0x4fdae0){if(_0x4fdae0){_0x31b1f6=_0x4fdae0[_0x8ea5('0x33')];if(!_0x5925ee[_0x8ea5('0x2d')]['hasOwnProperty'](_0x8ea5('0x35'))){_0x27602a[_0x8ea5('0x1e')]=qs[_0x8ea5('0x1e')](_0x5925ee[_0x8ea5('0x2d')][_0x8ea5('0x1e')]);_0x27602a[_0x8ea5('0x1c')]=qs[_0x8ea5('0x1c')](_0x5925ee[_0x8ea5('0x2d')]['offset']);}return _0x118e1c[_0x8ea5('0x4a')](_0x27602a);}})[_0x8ea5('0x24')](function(_0x32868f){if(_0x32868f){return _0x32868f?{'count':_0x31b1f6,'rows':_0x32868f}:null;}})['then'](respondWithResult(_0x43d0ee,null))[_0x8ea5('0x41')](handleError(_0x43d0ee,null));};exports['addConfiguration']=function(_0x56a62b,_0x3b033d,_0x563165){if(_0x56a62b[_0x8ea5('0x48')]['id']){delete _0x56a62b[_0x8ea5('0x48')]['id'];}return db['SalesforceAccount']['findOne']({'where':{'id':_0x56a62b[_0x8ea5('0x43')]['id']}})[_0x8ea5('0x24')](handleEntityNotFound(_0x3b033d,null))['then'](function(_0x3f4aa5){if(_0x3f4aa5){_0x56a62b['body'][_0x8ea5('0x4d')]=_0x3f4aa5['id'];_0x56a62b[_0x8ea5('0x48')][_0x8ea5('0x4e')]=integrations[_0x8ea5('0x4f')](_0x56a62b[_0x8ea5('0x48')]['channel'],_0x56a62b[_0x8ea5('0x48')]['type']);_0x56a62b[_0x8ea5('0x48')][_0x8ea5('0x50')]=integrations[_0x8ea5('0x51')](_0x56a62b[_0x8ea5('0x48')][_0x8ea5('0x52')],_0x56a62b[_0x8ea5('0x48')][_0x8ea5('0x3b')]);return db['SalesforceConfiguration'][_0x8ea5('0x47')](_0x56a62b[_0x8ea5('0x48')],{'include':[{'model':db[_0x8ea5('0x53')],'as':'Subjects'},{'model':db[_0x8ea5('0x53')],'as':'Descriptions'}]});}return null;})[_0x8ea5('0x24')](respondWithResult(_0x3b033d,null))['catch'](handleError(_0x3b033d,null));};exports['getFields']=function(_0x43223f,_0x342986,_0x2272e3){var _0x18e12e;var _0x24ce70='';var _0x428ed8=_0x8ea5('0x54');return db[_0x8ea5('0x29')][_0x8ea5('0x4b')]({'where':{'id':_0x43223f[_0x8ea5('0x43')]['id']},'attributes':['id','remoteUri',_0x8ea5('0x55'),_0x8ea5('0x56'),_0x8ea5('0x57'),'password',_0x8ea5('0x58')]})[_0x8ea5('0x24')](handleEntityNotFound(_0x342986,null))[_0x8ea5('0x24')](function(_0x1e8167){if(_0x1e8167){_0x24ce70=_0x1e8167['remoteUri'];var _0x46a480=_0x24ce70[_0x8ea5('0x59')](-0x1);if(_0x46a480==='/'){_0x24ce70=_0x24ce70[_0x8ea5('0x5a')](0x0,_0x24ce70[_0x8ea5('0x5b')](_0x46a480));}_0x18e12e=new jsforce[(_0x8ea5('0x5c'))]({'oauth2':{'loginUrl':_0x24ce70,'clientId':_0x1e8167[_0x8ea5('0x55')],'clientSecret':_0x1e8167[_0x8ea5('0x56')]}});return _0x18e12e[_0x8ea5('0x5d')](_0x1e8167['username'],_0x1e8167[_0x8ea5('0x5e')][_0x8ea5('0x5f')](_0x1e8167[_0x8ea5('0x58')]));}})['then'](function(_0x51e612){if(_0x51e612){if(!_[_0x8ea5('0x60')](_0x43223f[_0x8ea5('0x2d')][_0x8ea5('0x61')])){_0x428ed8=_0x43223f[_0x8ea5('0x2d')][_0x8ea5('0x61')];}return _0x18e12e['sobject'](_0x428ed8)[_0x8ea5('0x62')]();}})[_0x8ea5('0x24')](function(_0xb4de5d){var _0x5ea09e=[_0x8ea5('0x63'),'ActivityDate','IsReminderSet','IsRecurrence',_0x8ea5('0x64'),_0x8ea5('0x65')];var _0x4a7205=[_0x8ea5('0x66'),'int',_0x8ea5('0x67'),_0x8ea5('0x68'),_0x8ea5('0x69'),_0x8ea5('0x6a'),'phone'];if(_0xb4de5d){_[_0x8ea5('0x6b')](_0xb4de5d['fields'],function(_0x25d59c){return _0x5ea09e[_0x8ea5('0x6c')](_0x25d59c[_0x8ea5('0x3c')])||!_0x4a7205[_0x8ea5('0x6c')](_0x25d59c[_0x8ea5('0x3b')]);});return{'count':_0xb4de5d[_0x8ea5('0x32')]['length'],'rows':_['map'](_0xb4de5d[_0x8ea5('0x32')],function(_0x442e19){return{'id':_0x442e19[_0x8ea5('0x3c')],'name':_0x442e19[_0x8ea5('0x6d')],'custom':_0x442e19[_0x8ea5('0x6e')],'options':_0x442e19['picklistValues'][_0x8ea5('0x33')]>0x0?_[_0x8ea5('0x28')](_0x442e19[_0x8ea5('0x6f')],function(_0xea7d3b){return{'name':_0xea7d3b[_0x8ea5('0x6d')],'value':_0xea7d3b['value']};}):_0x442e19[_0x8ea5('0x3b')]=='boolean'?[{'name':_0x8ea5('0x70'),'value':_0x8ea5('0x71')},{'name':_0x8ea5('0x72'),'value':'false'}]:[]};})};}})[_0x8ea5('0x24')](respondWithResult(_0x342986,null))[_0x8ea5('0x41')](function(_0x1db949){var _0x43fdc5=_0x43223f[_0x8ea5('0x2d')][_0x8ea5('0x73')]?0x1f4:_0x1db949[_0x8ea5('0x74')]||0x1f4;logger[_0x8ea5('0x25')](_0x8ea5('0x75'),'getFields',_0x43fdc5,JSON['stringify'](_0x1db949));delete _0x1db949[_0x8ea5('0x3c')];if(_0x43fdc5===0x191){_0x43fdc5=0x190;}_0x342986[_0x8ea5('0x19')](_0x43fdc5)[_0x8ea5('0x27')](_0x43223f[_0x8ea5('0x2d')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x1db949[_0x8ea5('0x74')]}:_0x1db949);});};
\ No newline at end of file
index f3e9870..d01983f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc9df=['define','SalesforceAccount','util','../../config/logger','api','../../components/integrations/configuration','exports'];(function(_0x230dd3,_0x26024b){var _0x7987fa=function(_0x36a021){while(--_0x36a021){_0x230dd3['push'](_0x230dd3['shift']());}};_0x7987fa(++_0x26024b);}(_0xc9df,0x121));var _0xfc9d=function(_0x5a06c1,_0x2b05a5){_0x5a06c1=_0x5a06c1-0x0;var _0x26a0fe=_0xc9df[_0x5a06c1];return _0x26a0fe;};'use strict';var _=require('lodash');var util=require(_0xfc9d('0x0'));var logger=require(_0xfc9d('0x1'))(_0xfc9d('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intSalesforceAccount.attributes');var integrations=require(_0xfc9d('0x3'));module[_0xfc9d('0x4')]=function(_0x2e7243,_0x206c6e){return _0x2e7243[_0xfc9d('0x5')](_0xfc9d('0x6'),attributes,{'tableName':'int_salesforce_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe32f=['request-promise','path','rimraf','../../config/environment','exports','define','SalesforceAccount','int_salesforce_accounts','lodash','../../config/logger','moment','bluebird'];(function(_0x4c862c,_0x58b07f){var _0x50a68e=function(_0x2eaa9a){while(--_0x2eaa9a){_0x4c862c['push'](_0x4c862c['shift']());}};_0x50a68e(++_0x58b07f);}(_0xe32f,0x80));var _0xfe32=function(_0x18d91a,_0x59d42c){_0x18d91a=_0x18d91a-0x0;var _0x2835fd=_0xe32f[_0x18d91a];return _0x2835fd;};'use strict';var _=require(_0xfe32('0x0'));var util=require('util');var logger=require(_0xfe32('0x1'))('api');var moment=require(_0xfe32('0x2'));var BPromise=require(_0xfe32('0x3'));var rp=require(_0xfe32('0x4'));var fs=require('fs');var path=require(_0xfe32('0x5'));var rimraf=require(_0xfe32('0x6'));var config=require(_0xfe32('0x7'));var attributes=require('./intSalesforceAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0xfe32('0x8')]=function(_0xc9b52c,_0x15116c){return _0xc9b52c[_0xfe32('0x9')](_0xfe32('0xa'),attributes,{'tableName':_0xfe32('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 159a20f..63f16b0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcd19=['model','ShowSalesforceAccount','find','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','SalesforceAccount,\x20%s,\x20%s','message','result','catch','GetSalesforceAccount','SalesforceAccount','findAll','options','where','attributes','limit','include','map'];(function(_0x2f3794,_0x3c3bec){var _0x1c9fbe=function(_0x2d2eac){while(--_0x2d2eac){_0x2f3794['push'](_0x2f3794['shift']());}};_0x1c9fbe(++_0x3c3bec);}(_0xcd19,0x98));var _0x9cd1=function(_0x12f688,_0x585c25){_0x12f688=_0x12f688-0x0;var _0x59c3de=_0xcd19[_0x12f688];return _0x59c3de;};'use strict';var _=require(_0x9cd1('0x0'));var util=require(_0x9cd1('0x1'));var moment=require(_0x9cd1('0x2'));var BPromise=require(_0x9cd1('0x3'));var rs=require(_0x9cd1('0x4'));var fs=require('fs');var Redis=require(_0x9cd1('0x5'));var db=require(_0x9cd1('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x9cd1('0x7'))(_0x9cd1('0x8'));var config=require(_0x9cd1('0x9'));var jayson=require(_0x9cd1('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4cb594,_0x405c85,_0x408ad4){return new BPromise(function(_0x4b5acd,_0x47544c){return client[_0x9cd1('0xb')](_0x4cb594,_0x408ad4)[_0x9cd1('0xc')](function(_0x38790b){logger[_0x9cd1('0xd')]('SalesforceAccount,\x20%s,\x20%s',_0x405c85,_0x9cd1('0xe'));logger[_0x9cd1('0xf')](_0x9cd1('0x10'),_0x405c85,_0x9cd1('0xe'),JSON[_0x9cd1('0x11')](_0x38790b));if(_0x38790b[_0x9cd1('0x12')]){if(_0x38790b[_0x9cd1('0x12')][_0x9cd1('0x13')]===0x1f4){logger['error'](_0x9cd1('0x14'),_0x405c85,_0x38790b['error'][_0x9cd1('0x15')]);return _0x47544c(_0x38790b[_0x9cd1('0x12')][_0x9cd1('0x15')]);}logger[_0x9cd1('0x12')](_0x9cd1('0x14'),_0x405c85,_0x38790b[_0x9cd1('0x12')][_0x9cd1('0x15')]);return _0x4b5acd(_0x38790b[_0x9cd1('0x12')][_0x9cd1('0x15')]);}else{logger[_0x9cd1('0xd')]('SalesforceAccount,\x20%s,\x20%s',_0x405c85,'request\x20sent');_0x4b5acd(_0x38790b[_0x9cd1('0x16')][_0x9cd1('0x15')]);}})[_0x9cd1('0x17')](function(_0x27e8a0){logger['error']('SalesforceAccount,\x20%s,\x20%s',_0x405c85,_0x27e8a0);_0x47544c(_0x27e8a0);});});}exports[_0x9cd1('0x18')]=function(_0x2821b1){var _0x1ebd4d=this;return new Promise(function(_0x5ea152,_0x22b359){return db[_0x9cd1('0x19')][_0x9cd1('0x1a')]({'raw':_0x2821b1[_0x9cd1('0x1b')]?_0x2821b1['options']['raw']===undefined?!![]:![]:!![],'where':_0x2821b1[_0x9cd1('0x1b')]?_0x2821b1[_0x9cd1('0x1b')][_0x9cd1('0x1c')]||null:null,'attributes':_0x2821b1['options']?_0x2821b1['options'][_0x9cd1('0x1d')]||null:null,'limit':_0x2821b1['options']?_0x2821b1['options'][_0x9cd1('0x1e')]||null:null,'include':_0x2821b1['options']?_0x2821b1[_0x9cd1('0x1b')][_0x9cd1('0x1f')]?_['map'](_0x2821b1[_0x9cd1('0x1b')][_0x9cd1('0x1f')],function(_0x1aafbb){return{'model':db[_0x1aafbb['model']],'as':_0x1aafbb['as'],'attributes':_0x1aafbb[_0x9cd1('0x1d')],'include':_0x1aafbb['include']?_['map'](_0x1aafbb['include'],function(_0x3972d1){return{'model':db[_0x3972d1['model']],'as':_0x3972d1['as'],'attributes':_0x3972d1['attributes'],'include':_0x3972d1[_0x9cd1('0x1f')]?_[_0x9cd1('0x20')](_0x3972d1[_0x9cd1('0x1f')],function(_0x3162ad){return{'model':db[_0x3162ad[_0x9cd1('0x21')]],'as':_0x3162ad['as'],'attributes':_0x3162ad[_0x9cd1('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x9cd1('0xc')](function(_0x40337d){logger[_0x9cd1('0xd')](_0x9cd1('0x18'),_0x2821b1);logger['debug'](_0x9cd1('0x18'),_0x2821b1,JSON['stringify'](_0x40337d));_0x5ea152(_0x40337d);})['catch'](function(_0x195b56){logger[_0x9cd1('0x12')](_0x9cd1('0x18'),_0x195b56['message'],_0x2821b1);_0x22b359(_0x1ebd4d['error'](0x1f4,_0x195b56[_0x9cd1('0x15')]));});});};exports[_0x9cd1('0x22')]=function(_0x237e32){var _0x5dc55b=this;return new Promise(function(_0x451531,_0x114c00){return db[_0x9cd1('0x19')][_0x9cd1('0x23')]({'raw':_0x237e32[_0x9cd1('0x1b')]?_0x237e32[_0x9cd1('0x1b')][_0x9cd1('0x24')]===undefined?!![]:![]:!![],'where':_0x237e32[_0x9cd1('0x1b')]?_0x237e32[_0x9cd1('0x1b')][_0x9cd1('0x1c')]||null:null,'attributes':_0x237e32[_0x9cd1('0x1b')]?_0x237e32[_0x9cd1('0x1b')][_0x9cd1('0x1d')]||null:null,'include':_0x237e32[_0x9cd1('0x1b')]?_0x237e32[_0x9cd1('0x1b')][_0x9cd1('0x1f')]?_[_0x9cd1('0x20')](_0x237e32[_0x9cd1('0x1b')][_0x9cd1('0x1f')],function(_0x40a857){return{'model':db[_0x40a857['model']],'as':_0x40a857['as'],'attributes':_0x40a857['attributes'],'include':_0x40a857['include']?_[_0x9cd1('0x20')](_0x40a857['include'],function(_0x2972af){return{'model':db[_0x2972af[_0x9cd1('0x21')]],'as':_0x2972af['as'],'attributes':_0x2972af[_0x9cd1('0x1d')],'include':_0x2972af[_0x9cd1('0x1f')]?_[_0x9cd1('0x20')](_0x2972af['include'],function(_0x40ed21){return{'model':db[_0x40ed21[_0x9cd1('0x21')]],'as':_0x40ed21['as'],'attributes':_0x40ed21[_0x9cd1('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x9cd1('0xc')](function(_0x5423f1){logger[_0x9cd1('0xd')]('ShowSalesforceAccount',_0x237e32);logger[_0x9cd1('0xf')]('ShowSalesforceAccount',_0x237e32,JSON[_0x9cd1('0x11')](_0x5423f1));_0x451531(_0x5423f1);})[_0x9cd1('0x17')](function(_0x57c48a){logger[_0x9cd1('0x12')](_0x9cd1('0x22'),_0x57c48a[_0x9cd1('0x15')],_0x237e32);_0x114c00(_0x5dc55b[_0x9cd1('0x12')](0x1f4,_0x57c48a[_0x9cd1('0x15')]));});});};
\ No newline at end of file
+var _0xc053=['then','ShowSalesforceAccount','find','map','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','info','SalesforceAccount,\x20%s,\x20%s','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','GetSalesforceAccount','SalesforceAccount','findAll','options','raw','where','attributes','limit','include','model'];(function(_0x14caf6,_0x23de34){var _0x3b0248=function(_0x13aa8d){while(--_0x13aa8d){_0x14caf6['push'](_0x14caf6['shift']());}};_0x3b0248(++_0x23de34);}(_0xc053,0x170));var _0x3c05=function(_0x3434a8,_0x5571b1){_0x3434a8=_0x3434a8-0x0;var _0x555665=_0xc053[_0x3434a8];return _0x555665;};'use strict';var _=require(_0x3c05('0x0'));var util=require(_0x3c05('0x1'));var moment=require(_0x3c05('0x2'));var BPromise=require('bluebird');var rs=require(_0x3c05('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3c05('0x4'))['db'];var utils=require(_0x3c05('0x5'));var logger=require(_0x3c05('0x6'))(_0x3c05('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3c05('0x8')][_0x3c05('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x53b755,_0x4fe2a7,_0x200985){return new BPromise(function(_0x3972c4,_0x2479e7){return client['request'](_0x53b755,_0x200985)['then'](function(_0x2ebe69){logger[_0x3c05('0xa')](_0x3c05('0xb'),_0x4fe2a7,'request\x20sent');logger[_0x3c05('0xc')](_0x3c05('0xd'),_0x4fe2a7,'request\x20sent',JSON[_0x3c05('0xe')](_0x2ebe69));if(_0x2ebe69[_0x3c05('0xf')]){if(_0x2ebe69[_0x3c05('0xf')]['code']===0x1f4){logger[_0x3c05('0xf')](_0x3c05('0xb'),_0x4fe2a7,_0x2ebe69[_0x3c05('0xf')][_0x3c05('0x10')]);return _0x2479e7(_0x2ebe69[_0x3c05('0xf')]['message']);}logger[_0x3c05('0xf')](_0x3c05('0xb'),_0x4fe2a7,_0x2ebe69[_0x3c05('0xf')]['message']);return _0x3972c4(_0x2ebe69[_0x3c05('0xf')][_0x3c05('0x10')]);}else{logger[_0x3c05('0xa')]('SalesforceAccount,\x20%s,\x20%s',_0x4fe2a7,'request\x20sent');_0x3972c4(_0x2ebe69[_0x3c05('0x11')][_0x3c05('0x10')]);}})['catch'](function(_0x53b2a6){logger[_0x3c05('0xf')](_0x3c05('0xb'),_0x4fe2a7,_0x53b2a6);_0x2479e7(_0x53b2a6);});});}exports[_0x3c05('0x12')]=function(_0x1d2204){var _0x4021df=this;return new Promise(function(_0x5d4541,_0x5324eb){return db[_0x3c05('0x13')][_0x3c05('0x14')]({'raw':_0x1d2204[_0x3c05('0x15')]?_0x1d2204[_0x3c05('0x15')][_0x3c05('0x16')]===undefined?!![]:![]:!![],'where':_0x1d2204['options']?_0x1d2204[_0x3c05('0x15')][_0x3c05('0x17')]||null:null,'attributes':_0x1d2204[_0x3c05('0x15')]?_0x1d2204[_0x3c05('0x15')][_0x3c05('0x18')]||null:null,'limit':_0x1d2204[_0x3c05('0x15')]?_0x1d2204[_0x3c05('0x15')][_0x3c05('0x19')]||null:null,'include':_0x1d2204[_0x3c05('0x15')]?_0x1d2204[_0x3c05('0x15')][_0x3c05('0x1a')]?_['map'](_0x1d2204[_0x3c05('0x15')]['include'],function(_0x3ea83f){return{'model':db[_0x3ea83f[_0x3c05('0x1b')]],'as':_0x3ea83f['as'],'attributes':_0x3ea83f['attributes'],'include':_0x3ea83f['include']?_['map'](_0x3ea83f[_0x3c05('0x1a')],function(_0x333c9f){return{'model':db[_0x333c9f[_0x3c05('0x1b')]],'as':_0x333c9f['as'],'attributes':_0x333c9f['attributes'],'include':_0x333c9f[_0x3c05('0x1a')]?_['map'](_0x333c9f[_0x3c05('0x1a')],function(_0x4d7781){return{'model':db[_0x4d7781[_0x3c05('0x1b')]],'as':_0x4d7781['as'],'attributes':_0x4d7781['attributes']};}):[]};}):[]};}):[]:[]})[_0x3c05('0x1c')](function(_0x218185){logger['info'](_0x3c05('0x12'),_0x1d2204);logger[_0x3c05('0xc')](_0x3c05('0x12'),_0x1d2204,JSON[_0x3c05('0xe')](_0x218185));_0x5d4541(_0x218185);})['catch'](function(_0x226ee5){logger[_0x3c05('0xf')](_0x3c05('0x12'),_0x226ee5[_0x3c05('0x10')],_0x1d2204);_0x5324eb(_0x4021df['error'](0x1f4,_0x226ee5[_0x3c05('0x10')]));});});};exports[_0x3c05('0x1d')]=function(_0x1100e4){var _0x4063a3=this;return new Promise(function(_0x30eecd,_0x56a09d){return db[_0x3c05('0x13')][_0x3c05('0x1e')]({'raw':_0x1100e4['options']?_0x1100e4[_0x3c05('0x15')][_0x3c05('0x16')]===undefined?!![]:![]:!![],'where':_0x1100e4['options']?_0x1100e4[_0x3c05('0x15')][_0x3c05('0x17')]||null:null,'attributes':_0x1100e4[_0x3c05('0x15')]?_0x1100e4[_0x3c05('0x15')]['attributes']||null:null,'include':_0x1100e4['options']?_0x1100e4[_0x3c05('0x15')][_0x3c05('0x1a')]?_[_0x3c05('0x1f')](_0x1100e4[_0x3c05('0x15')]['include'],function(_0x1e458b){return{'model':db[_0x1e458b[_0x3c05('0x1b')]],'as':_0x1e458b['as'],'attributes':_0x1e458b[_0x3c05('0x18')],'include':_0x1e458b[_0x3c05('0x1a')]?_['map'](_0x1e458b[_0x3c05('0x1a')],function(_0x140c3a){return{'model':db[_0x140c3a[_0x3c05('0x1b')]],'as':_0x140c3a['as'],'attributes':_0x140c3a[_0x3c05('0x18')],'include':_0x140c3a[_0x3c05('0x1a')]?_[_0x3c05('0x1f')](_0x140c3a[_0x3c05('0x1a')],function(_0x5c378c){return{'model':db[_0x5c378c[_0x3c05('0x1b')]],'as':_0x5c378c['as'],'attributes':_0x5c378c[_0x3c05('0x18')]};}):[]};}):[]};}):[]:[]})[_0x3c05('0x1c')](function(_0x1370ac){logger['info'](_0x3c05('0x1d'),_0x1100e4);logger[_0x3c05('0xc')](_0x3c05('0x1d'),_0x1100e4,JSON[_0x3c05('0xe')](_0x1370ac));_0x30eecd(_0x1370ac);})[_0x3c05('0x20')](function(_0x4e948c){logger[_0x3c05('0xf')](_0x3c05('0x1d'),_0x4e948c[_0x3c05('0x10')],_0x1100e4);_0x56a09d(_0x4063a3[_0x3c05('0xf')](0x1f4,_0x4e948c[_0x3c05('0x10')]));});});};
\ No newline at end of file
index ab62d8c..9c9a4b2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdb28=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','post','create','put','delete','destroy','exports','multer','util'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0xdb28,0x106));var _0x8db2=function(_0x12b8ae,_0x2af56d){_0x12b8ae=_0x12b8ae-0x0;var _0x1573b1=_0xdb28[_0x12b8ae];return _0x1573b1;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var fs_extra=require(_0x8db2('0x5'));var auth=require(_0x8db2('0x6'));var interaction=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var controller=require('./intSalesforceConfiguration.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['get'](_0x8db2('0xf'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x10')]);router['get'](_0x8db2('0x11'),auth[_0x8db2('0xa')](),controller['getDescriptions']);router[_0x8db2('0x12')]('/',auth[_0x8db2('0xa')](),controller[_0x8db2('0x13')]);router[_0x8db2('0x14')](_0x8db2('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x8db2('0x15')](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x16')]);module[_0x8db2('0x17')]=router;
\ No newline at end of file
+var _0x5f66=['express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','/:id/subjects','getSubjects','put','update','delete','destroy','exports','util','connect-timeout'];(function(_0x476278,_0x536d36){var _0x545d7d=function(_0x392ec3){while(--_0x392ec3){_0x476278['push'](_0x476278['shift']());}};_0x545d7d(++_0x536d36);}(_0x5f66,0x1a0));var _0x65f6=function(_0xefd519,_0xc62635){_0xefd519=_0xefd519-0x0;var _0x4bb882=_0x5f66[_0xefd519];return _0x4bb882;};'use strict';var multer=require('multer');var util=require(_0x65f6('0x0'));var path=require('path');var timeout=require(_0x65f6('0x1'));var express=require(_0x65f6('0x2'));var router=express[_0x65f6('0x3')]();var fs_extra=require(_0x65f6('0x4'));var auth=require(_0x65f6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x65f6('0x6'));var controller=require('./intSalesforceConfiguration.controller');router[_0x65f6('0x7')]('/',auth[_0x65f6('0x8')](),controller['index']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x7')](_0x65f6('0xb'),auth[_0x65f6('0x8')](),controller['getFields']);router['get'](_0x65f6('0xc'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xd')]);router[_0x65f6('0x7')]('/:id/descriptions',auth[_0x65f6('0x8')](),controller['getDescriptions']);router['post']('/',auth[_0x65f6('0x8')](),controller['create']);router[_0x65f6('0xe')]('/:id',auth[_0x65f6('0x8')](),controller[_0x65f6('0xf')]);router[_0x65f6('0x10')](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0x11')]);module[_0x65f6('0x12')]=router;
\ No newline at end of file
index 6b6cd28..7225ba4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfeb3=['account','contact_lead','nothing','contact','sequelize','exports','STRING','ENUM','Case','Task','lead'];(function(_0x402262,_0x1992d5){var _0x5489f5=function(_0x25d59b){while(--_0x25d59b){_0x402262['push'](_0x402262['shift']());}};_0x5489f5(++_0x1992d5);}(_0xfeb3,0x19b));var _0x3feb=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xfeb3[_0x21a9d9];return _0x46adce;};'use strict';var Sequelize=require(_0x3feb('0x0'));module[_0x3feb('0x1')]={'name':{'type':Sequelize[_0x3feb('0x2')]},'description':{'type':Sequelize[_0x3feb('0x2')]},'ticketType':{'type':Sequelize[_0x3feb('0x3')]('Task',_0x3feb('0x4')),'defaultValue':_0x3feb('0x5')},'moduleSearch':{'type':Sequelize['ENUM']('contact_lead','contact',_0x3feb('0x6'),'account_contact_lead',_0x3feb('0x7')),'defaultValue':_0x3feb('0x8')},'moduleCreate':{'type':Sequelize[_0x3feb('0x3')](_0x3feb('0x9'),_0x3feb('0xa'),_0x3feb('0x6'),'account'),'defaultValue':_0x3feb('0x6')},'leadId':{'type':Sequelize['STRING']},'additionalSearchAccount':{'type':Sequelize[_0x3feb('0x2')]},'additionalSearchContact':{'type':Sequelize[_0x3feb('0x2')]},'additionalSearchLead':{'type':Sequelize[_0x3feb('0x2')]}};
\ No newline at end of file
+var _0x2902=['nothing','sequelize','exports','STRING','ENUM','Task','Case','contact_lead','contact','lead','account_contact_lead','account'];(function(_0x1b01e8,_0x2897ec){var _0x2e3c14=function(_0x4a2c08){while(--_0x4a2c08){_0x1b01e8['push'](_0x1b01e8['shift']());}};_0x2e3c14(++_0x2897ec);}(_0x2902,0xc1));var _0x2290=function(_0x3e0763,_0x3d12be){_0x3e0763=_0x3e0763-0x0;var _0x351ca2=_0x2902[_0x3e0763];return _0x351ca2;};'use strict';var Sequelize=require(_0x2290('0x0'));module[_0x2290('0x1')]={'name':{'type':Sequelize[_0x2290('0x2')]},'description':{'type':Sequelize[_0x2290('0x2')]},'ticketType':{'type':Sequelize[_0x2290('0x3')](_0x2290('0x4'),_0x2290('0x5')),'defaultValue':_0x2290('0x4')},'moduleSearch':{'type':Sequelize[_0x2290('0x3')](_0x2290('0x6'),_0x2290('0x7'),_0x2290('0x8'),_0x2290('0x9'),_0x2290('0xa')),'defaultValue':_0x2290('0x6')},'moduleCreate':{'type':Sequelize[_0x2290('0x3')](_0x2290('0xb'),_0x2290('0x7'),_0x2290('0x8'),_0x2290('0xa')),'defaultValue':_0x2290('0x8')},'leadId':{'type':Sequelize['STRING']},'additionalSearchAccount':{'type':Sequelize[_0x2290('0x2')]},'additionalSearchContact':{'type':Sequelize['STRING']},'additionalSearchLead':{'type':Sequelize[_0x2290('0x2')]}};
\ No newline at end of file
index c8c3250..43bdb3b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa234=['zip-dir','fast-json-patch','request-promise','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','offset','undefined','limit','count','status','Content-Range','json','apply','save','update','then','destroy','error','stack','name','send','index','map','SalesforceConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','show','params','create','body','catch','find','getFields','findOne','SalesforceField','getDescriptions','eml-format','rimraf'];(function(_0x13a5a8,_0x186495){var _0x397582=function(_0x33dc56){while(--_0x33dc56){_0x13a5a8['push'](_0x13a5a8['shift']());}};_0x397582(++_0x186495);}(_0xa234,0x142));var _0x4a23=function(_0x58dbc9,_0x41aee0){_0x58dbc9=_0x58dbc9-0x0;var _0x2106e7=_0xa234[_0x58dbc9];return _0x2106e7;};'use strict';var emlformat=require(_0x4a23('0x0'));var rimraf=require(_0x4a23('0x1'));var zipdir=require(_0x4a23('0x2'));var jsonpatch=require(_0x4a23('0x3'));var rp=require(_0x4a23('0x4'));var moment=require('moment');var BPromise=require(_0x4a23('0x5'));var Mustache=require('mustache');var util=require(_0x4a23('0x6'));var path=require('path');var sox=require(_0x4a23('0x7'));var csv=require(_0x4a23('0x8'));var ejs=require(_0x4a23('0x9'));var fs=require('fs');var fs_extra=require(_0x4a23('0xa'));var _=require(_0x4a23('0xb'));var squel=require(_0x4a23('0xc'));var crypto=require('crypto');var jsforce=require(_0x4a23('0xd'));var deskjs=require(_0x4a23('0xe'));var toCsv=require(_0x4a23('0x8'));var querystring=require(_0x4a23('0xf'));var Papa=require(_0x4a23('0x10'));var Redis=require(_0x4a23('0x11'));var authService=require(_0x4a23('0x12'));var qs=require(_0x4a23('0x13'));var as=require(_0x4a23('0x14'));var hardwareService=require(_0x4a23('0x15'));var logger=require(_0x4a23('0x16'))('api');var utils=require(_0x4a23('0x17'));var config=require(_0x4a23('0x18'));var licenseUtil=require(_0x4a23('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x9bb68b,_0x3aa067){_0x3aa067=_0x3aa067||0xcc;return function(_0xa558e7){if(_0xa558e7){return _0x9bb68b[_0x4a23('0x1a')](_0x3aa067);}return _0x9bb68b['status'](_0x3aa067)[_0x4a23('0x1b')]();};}function respondWithResult(_0x207026,_0x838369){_0x838369=_0x838369||0xc8;return function(_0x2b16ad){if(_0x2b16ad){return _0x207026['status'](_0x838369)['json'](_0x2b16ad);}};}function respondWithFilteredResult(_0x4b104a,_0x4abba6){return function(_0x494c0c){if(_0x494c0c){var _0x38cfbf=typeof _0x4abba6[_0x4a23('0x1c')]===_0x4a23('0x1d')&&typeof _0x4abba6[_0x4a23('0x1e')]==='undefined';var _0x11a2b6=_0x494c0c['count'];var _0x242c8f=_0x38cfbf?0x0:_0x4abba6[_0x4a23('0x1c')];var _0xfa42a4=_0x38cfbf?_0x494c0c[_0x4a23('0x1f')]:_0x4abba6[_0x4a23('0x1c')]+_0x4abba6[_0x4a23('0x1e')];var _0x499a2e;if(_0xfa42a4>=_0x11a2b6){_0xfa42a4=_0x11a2b6;_0x499a2e=0xc8;}else{_0x499a2e=0xce;}_0x4b104a[_0x4a23('0x20')](_0x499a2e);return _0x4b104a['set'](_0x4a23('0x21'),_0x242c8f+'-'+_0xfa42a4+'/'+_0x11a2b6)[_0x4a23('0x22')](_0x494c0c);}return null;};}function patchUpdates(_0x373e6f){return function(_0x1cc28e){try{jsonpatch[_0x4a23('0x23')](_0x1cc28e,_0x373e6f,!![]);}catch(_0x55c391){return BPromise['reject'](_0x55c391);}return _0x1cc28e[_0x4a23('0x24')]();};}function saveUpdates(_0x2c766a,_0x25f647){return function(_0x1d91c0){if(_0x1d91c0){return _0x1d91c0[_0x4a23('0x25')](_0x2c766a)[_0x4a23('0x26')](function(_0x56e2a8){return _0x56e2a8;});}return null;};}function removeEntity(_0x16ce94,_0x194e88){return function(_0x11b8b8){if(_0x11b8b8){return _0x11b8b8[_0x4a23('0x27')]()[_0x4a23('0x26')](function(){_0x16ce94['status'](0xcc)[_0x4a23('0x1b')]();});}};}function handleEntityNotFound(_0x5c6c76,_0x3bea8c){return function(_0x4a8373){if(!_0x4a8373){_0x5c6c76[_0x4a23('0x1a')](0x194);}return _0x4a8373;};}function handleError(_0x3690fc,_0x3c3184){_0x3c3184=_0x3c3184||0x1f4;return function(_0x305546){logger[_0x4a23('0x28')](_0x305546[_0x4a23('0x29')]);if(_0x305546[_0x4a23('0x2a')]){delete _0x305546[_0x4a23('0x2a')];}_0x3690fc['status'](_0x3c3184)[_0x4a23('0x2b')](_0x305546);};}exports[_0x4a23('0x2c')]=function(_0x430c34,_0x4f8469){var _0x39976d={},_0x52c510={},_0x4627f6={'count':0x0,'rows':[]};var _0x83dd2b=_[_0x4a23('0x2d')](db[_0x4a23('0x2e')][_0x4a23('0x2f')],function(_0x174c3e){return{'name':_0x174c3e[_0x4a23('0x30')],'type':_0x174c3e[_0x4a23('0x31')][_0x4a23('0x32')]};});_0x52c510[_0x4a23('0x33')]=_[_0x4a23('0x2d')](_0x83dd2b,'name');_0x52c510[_0x4a23('0x34')]=_[_0x4a23('0x35')](_0x430c34[_0x4a23('0x34')]);_0x52c510[_0x4a23('0x36')]=_[_0x4a23('0x37')](_0x52c510[_0x4a23('0x33')],_0x52c510[_0x4a23('0x34')]);_0x39976d['attributes']=_[_0x4a23('0x37')](_0x52c510[_0x4a23('0x33')],qs[_0x4a23('0x38')](_0x430c34[_0x4a23('0x34')][_0x4a23('0x38')]));_0x39976d[_0x4a23('0x39')]=_0x39976d[_0x4a23('0x39')][_0x4a23('0x3a')]?_0x39976d['attributes']:_0x52c510[_0x4a23('0x33')];if(!_0x430c34[_0x4a23('0x34')][_0x4a23('0x3b')](_0x4a23('0x3c'))){_0x39976d[_0x4a23('0x1e')]=qs[_0x4a23('0x1e')](_0x430c34[_0x4a23('0x34')][_0x4a23('0x1e')]);_0x39976d[_0x4a23('0x1c')]=qs[_0x4a23('0x1c')](_0x430c34[_0x4a23('0x34')]['offset']);}_0x39976d[_0x4a23('0x3d')]=qs['sort'](_0x430c34[_0x4a23('0x34')][_0x4a23('0x3e')]);_0x39976d['where']=qs[_0x4a23('0x36')](_[_0x4a23('0x3f')](_0x430c34[_0x4a23('0x34')],_0x52c510[_0x4a23('0x36')]),_0x83dd2b);if(_0x430c34['query'][_0x4a23('0x40')]){_0x39976d[_0x4a23('0x41')]=_[_0x4a23('0x42')](_0x39976d['where'],{'$or':_['map'](_0x83dd2b,function(_0x294cba){if(_0x294cba[_0x4a23('0x31')]!==_0x4a23('0x43')){var _0x14cdb4={};_0x14cdb4[_0x294cba[_0x4a23('0x2a')]]={'$like':'%'+_0x430c34[_0x4a23('0x34')][_0x4a23('0x40')]+'%'};return _0x14cdb4;}})});}_0x39976d=_[_0x4a23('0x42')]({},_0x39976d,_0x430c34[_0x4a23('0x44')]);var _0x4d778a={'where':_0x39976d[_0x4a23('0x41')]};return db[_0x4a23('0x2e')][_0x4a23('0x1f')](_0x4d778a)['then'](function(_0x2b5de2){_0x4627f6[_0x4a23('0x1f')]=_0x2b5de2;if(_0x430c34[_0x4a23('0x34')][_0x4a23('0x45')]){_0x39976d[_0x4a23('0x46')]=[{'all':!![]}];}return db['SalesforceConfiguration']['findAll'](_0x39976d);})[_0x4a23('0x26')](function(_0x4b4429){_0x4627f6['rows']=_0x4b4429;return _0x4627f6;})['then'](respondWithFilteredResult(_0x4f8469,_0x39976d))['catch'](handleError(_0x4f8469,null));};exports[_0x4a23('0x47')]=function(_0x3700d9,_0x106f0f){var _0x555cca={'raw':![],'where':{'id':_0x3700d9[_0x4a23('0x48')]['id']}},_0x22a77e={};_0x22a77e[_0x4a23('0x33')]=_[_0x4a23('0x35')](db[_0x4a23('0x2e')]['rawAttributes']);_0x22a77e[_0x4a23('0x34')]=_['keys'](_0x3700d9['query']);_0x22a77e[_0x4a23('0x36')]=_[_0x4a23('0x37')](_0x22a77e['model'],_0x22a77e[_0x4a23('0x34')]);_0x555cca['attributes']=_['intersection'](_0x22a77e[_0x4a23('0x33')],qs[_0x4a23('0x38')](_0x3700d9[_0x4a23('0x34')][_0x4a23('0x38')]));_0x555cca[_0x4a23('0x39')]=_0x555cca[_0x4a23('0x39')][_0x4a23('0x3a')]?_0x555cca[_0x4a23('0x39')]:_0x22a77e[_0x4a23('0x33')];if(_0x3700d9[_0x4a23('0x34')][_0x4a23('0x45')]){_0x555cca[_0x4a23('0x46')]=[{'all':!![]}];}_0x555cca=_[_0x4a23('0x42')]({},_0x555cca,_0x3700d9[_0x4a23('0x44')]);return db[_0x4a23('0x2e')]['find'](_0x555cca)[_0x4a23('0x26')](handleEntityNotFound(_0x106f0f,null))[_0x4a23('0x26')](respondWithResult(_0x106f0f,null))['catch'](handleError(_0x106f0f,null));};exports[_0x4a23('0x49')]=function(_0x55df48,_0x47e5c4){return db[_0x4a23('0x2e')]['create'](_0x55df48[_0x4a23('0x4a')],{})['then'](respondWithResult(_0x47e5c4,0xc9))[_0x4a23('0x4b')](handleError(_0x47e5c4,null));};exports[_0x4a23('0x25')]=function(_0x147fbd,_0x5b8b6e){if(_0x147fbd[_0x4a23('0x4a')]['id']){delete _0x147fbd[_0x4a23('0x4a')]['id'];}return db[_0x4a23('0x2e')]['find']({'where':{'id':_0x147fbd['params']['id']}})['then'](handleEntityNotFound(_0x5b8b6e,null))[_0x4a23('0x26')](saveUpdates(_0x147fbd[_0x4a23('0x4a')],null))[_0x4a23('0x26')](respondWithResult(_0x5b8b6e,null))[_0x4a23('0x4b')](handleError(_0x5b8b6e,null));};exports[_0x4a23('0x27')]=function(_0x5047d8,_0x284ce6){return db['SalesforceConfiguration'][_0x4a23('0x4c')]({'where':{'id':_0x5047d8[_0x4a23('0x48')]['id']}})['then'](handleEntityNotFound(_0x284ce6,null))[_0x4a23('0x26')](removeEntity(_0x284ce6,null))[_0x4a23('0x4b')](handleError(_0x284ce6,null));};exports[_0x4a23('0x4d')]=function(_0x146d37,_0x1d0fe5,_0x4bb823){var _0x970933={};var _0x48e450={};var _0x499f47;var _0x30a4e3;return db[_0x4a23('0x2e')][_0x4a23('0x4e')]({'where':{'id':_0x146d37[_0x4a23('0x48')]['id']}})[_0x4a23('0x26')](handleEntityNotFound(_0x1d0fe5,null))[_0x4a23('0x26')](function(_0x54b332){if(_0x54b332){_0x499f47=_0x54b332;_0x48e450[_0x4a23('0x33')]=_[_0x4a23('0x35')](db[_0x4a23('0x4f')]['rawAttributes']);_0x48e450['query']=_[_0x4a23('0x35')](_0x146d37[_0x4a23('0x34')]);_0x48e450['filters']=_[_0x4a23('0x37')](_0x48e450[_0x4a23('0x33')],_0x48e450['query']);_0x970933['attributes']=_[_0x4a23('0x37')](_0x48e450[_0x4a23('0x33')],qs[_0x4a23('0x38')](_0x146d37[_0x4a23('0x34')][_0x4a23('0x38')]));_0x970933[_0x4a23('0x39')]=_0x970933[_0x4a23('0x39')][_0x4a23('0x3a')]?_0x970933[_0x4a23('0x39')]:_0x48e450[_0x4a23('0x33')];_0x970933[_0x4a23('0x3d')]=qs[_0x4a23('0x3e')](_0x146d37[_0x4a23('0x34')][_0x4a23('0x3e')]);_0x970933[_0x4a23('0x41')]=qs[_0x4a23('0x36')](_[_0x4a23('0x3f')](_0x146d37[_0x4a23('0x34')],_0x48e450['filters']));if(_0x146d37['query'][_0x4a23('0x40')]){_0x970933[_0x4a23('0x41')]=_[_0x4a23('0x42')](_0x970933[_0x4a23('0x41')],{'$or':_[_0x4a23('0x2d')](_0x970933['attributes'],function(_0x1d132f){var _0x9a9928={};_0x9a9928[_0x1d132f]={'$like':'%'+_0x146d37[_0x4a23('0x34')]['filter']+'%'};return _0x9a9928;})});}_0x970933=_[_0x4a23('0x42')]({},_0x970933,_0x146d37[_0x4a23('0x44')]);return _0x499f47[_0x4a23('0x4d')](_0x970933);}})['then'](function(_0x5e1e6f){if(_0x5e1e6f){_0x30a4e3=_0x5e1e6f['length'];if(!_0x146d37[_0x4a23('0x34')]['hasOwnProperty'](_0x4a23('0x3c'))){_0x970933[_0x4a23('0x1e')]=qs['limit'](_0x146d37[_0x4a23('0x34')][_0x4a23('0x1e')]);_0x970933[_0x4a23('0x1c')]=qs[_0x4a23('0x1c')](_0x146d37[_0x4a23('0x34')][_0x4a23('0x1c')]);}return _0x499f47['getFields'](_0x970933);}})[_0x4a23('0x26')](function(_0x2f2d2f){if(_0x2f2d2f){return _0x2f2d2f?{'count':_0x30a4e3,'rows':_0x2f2d2f}:null;}})['then'](respondWithResult(_0x1d0fe5,null))['catch'](handleError(_0x1d0fe5,null));};exports['getSubjects']=function(_0x1d1856,_0x311dc2,_0x4c0bc1){var _0x5c6276={};var _0x4cbba7={};var _0x1f0a1d;var _0x2a1137;return db['SalesforceConfiguration'][_0x4a23('0x4e')]({'where':{'id':_0x1d1856[_0x4a23('0x48')]['id']}})[_0x4a23('0x26')](handleEntityNotFound(_0x311dc2,null))[_0x4a23('0x26')](function(_0x50a560){if(_0x50a560){_0x1f0a1d=_0x50a560;_0x4cbba7['model']=_[_0x4a23('0x35')](db[_0x4a23('0x4f')][_0x4a23('0x2f')]);_0x4cbba7[_0x4a23('0x34')]=_[_0x4a23('0x35')](_0x1d1856['query']);_0x4cbba7['filters']=_[_0x4a23('0x37')](_0x4cbba7[_0x4a23('0x33')],_0x4cbba7[_0x4a23('0x34')]);_0x5c6276[_0x4a23('0x39')]=_[_0x4a23('0x37')](_0x4cbba7['model'],qs[_0x4a23('0x38')](_0x1d1856[_0x4a23('0x34')]['fields']));_0x5c6276[_0x4a23('0x39')]=_0x5c6276['attributes'][_0x4a23('0x3a')]?_0x5c6276[_0x4a23('0x39')]:_0x4cbba7[_0x4a23('0x33')];_0x5c6276[_0x4a23('0x3d')]=qs['sort'](_0x1d1856[_0x4a23('0x34')][_0x4a23('0x3e')]);_0x5c6276[_0x4a23('0x41')]=qs[_0x4a23('0x36')](_[_0x4a23('0x3f')](_0x1d1856[_0x4a23('0x34')],_0x4cbba7[_0x4a23('0x36')]));if(_0x1d1856[_0x4a23('0x34')][_0x4a23('0x40')]){_0x5c6276['where']=_[_0x4a23('0x42')](_0x5c6276[_0x4a23('0x41')],{'$or':_['map'](_0x5c6276[_0x4a23('0x39')],function(_0x3c72a6){var _0x556c2f={};_0x556c2f[_0x3c72a6]={'$like':'%'+_0x1d1856[_0x4a23('0x34')][_0x4a23('0x40')]+'%'};return _0x556c2f;})});}_0x5c6276=_[_0x4a23('0x42')]({},_0x5c6276,_0x1d1856[_0x4a23('0x44')]);return _0x1f0a1d['getSubjects'](_0x5c6276);}})[_0x4a23('0x26')](function(_0x2f705d){if(_0x2f705d){_0x2a1137=_0x2f705d['length'];if(!_0x1d1856[_0x4a23('0x34')][_0x4a23('0x3b')](_0x4a23('0x3c'))){_0x5c6276['limit']=qs[_0x4a23('0x1e')](_0x1d1856[_0x4a23('0x34')]['limit']);_0x5c6276['offset']=qs[_0x4a23('0x1c')](_0x1d1856['query'][_0x4a23('0x1c')]);}return _0x1f0a1d['getSubjects'](_0x5c6276);}})[_0x4a23('0x26')](function(_0x137b0e){if(_0x137b0e){return _0x137b0e?{'count':_0x2a1137,'rows':_0x137b0e}:null;}})[_0x4a23('0x26')](respondWithResult(_0x311dc2,null))[_0x4a23('0x4b')](handleError(_0x311dc2,null));};exports['getDescriptions']=function(_0x1a563d,_0x4d579e,_0x1bfd55){var _0x10172c={};var _0x2a771e={};var _0x194b8;var _0x4a13e4;return db[_0x4a23('0x2e')][_0x4a23('0x4e')]({'where':{'id':_0x1a563d['params']['id']}})[_0x4a23('0x26')](handleEntityNotFound(_0x4d579e,null))['then'](function(_0x2c53ec){if(_0x2c53ec){_0x194b8=_0x2c53ec;_0x2a771e[_0x4a23('0x33')]=_['keys'](db[_0x4a23('0x4f')][_0x4a23('0x2f')]);_0x2a771e[_0x4a23('0x34')]=_[_0x4a23('0x35')](_0x1a563d['query']);_0x2a771e['filters']=_[_0x4a23('0x37')](_0x2a771e['model'],_0x2a771e[_0x4a23('0x34')]);_0x10172c[_0x4a23('0x39')]=_[_0x4a23('0x37')](_0x2a771e[_0x4a23('0x33')],qs[_0x4a23('0x38')](_0x1a563d[_0x4a23('0x34')][_0x4a23('0x38')]));_0x10172c[_0x4a23('0x39')]=_0x10172c['attributes'][_0x4a23('0x3a')]?_0x10172c[_0x4a23('0x39')]:_0x2a771e[_0x4a23('0x33')];_0x10172c['order']=qs[_0x4a23('0x3e')](_0x1a563d[_0x4a23('0x34')][_0x4a23('0x3e')]);_0x10172c['where']=qs['filters'](_['pick'](_0x1a563d['query'],_0x2a771e[_0x4a23('0x36')]));if(_0x1a563d[_0x4a23('0x34')][_0x4a23('0x40')]){_0x10172c[_0x4a23('0x41')]=_[_0x4a23('0x42')](_0x10172c[_0x4a23('0x41')],{'$or':_['map'](_0x10172c['attributes'],function(_0x20a7fa){var _0x22bfef={};_0x22bfef[_0x20a7fa]={'$like':'%'+_0x1a563d[_0x4a23('0x34')][_0x4a23('0x40')]+'%'};return _0x22bfef;})});}_0x10172c=_[_0x4a23('0x42')]({},_0x10172c,_0x1a563d['options']);return _0x194b8['getDescriptions'](_0x10172c);}})[_0x4a23('0x26')](function(_0x399030){if(_0x399030){_0x4a13e4=_0x399030['length'];if(!_0x1a563d[_0x4a23('0x34')][_0x4a23('0x3b')](_0x4a23('0x3c'))){_0x10172c['limit']=qs[_0x4a23('0x1e')](_0x1a563d[_0x4a23('0x34')]['limit']);_0x10172c[_0x4a23('0x1c')]=qs['offset'](_0x1a563d[_0x4a23('0x34')][_0x4a23('0x1c')]);}return _0x194b8[_0x4a23('0x50')](_0x10172c);}})[_0x4a23('0x26')](function(_0x54b058){if(_0x54b058){return _0x54b058?{'count':_0x4a13e4,'rows':_0x54b058}:null;}})[_0x4a23('0x26')](respondWithResult(_0x4d579e,null))[_0x4a23('0x4b')](handleError(_0x4d579e,null));};
\ No newline at end of file
+var _0x2d66=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','destroy','stack','name','send','index','map','SalesforceConfiguration','rawAttributes','type','model','keys','filters','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','intersection','getFields','getSubjects','SalesforceField','getDescriptions','findOne','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js'];(function(_0x2f13eb,_0x1539d8){var _0x9df8ef=function(_0x4b62f9){while(--_0x4b62f9){_0x2f13eb['push'](_0x2f13eb['shift']());}};_0x9df8ef(++_0x1539d8);}(_0x2d66,0x18c));var _0x62d6=function(_0x6c36ed,_0x5a4176){_0x6c36ed=_0x6c36ed-0x0;var _0x120f72=_0x2d66[_0x6c36ed];return _0x120f72;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x62d6('0x0'));var zipdir=require(_0x62d6('0x1'));var jsonpatch=require(_0x62d6('0x2'));var rp=require('request-promise');var moment=require(_0x62d6('0x3'));var BPromise=require(_0x62d6('0x4'));var Mustache=require('mustache');var util=require(_0x62d6('0x5'));var path=require(_0x62d6('0x6'));var sox=require(_0x62d6('0x7'));var csv=require(_0x62d6('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x62d6('0x9'));var _=require('lodash');var squel=require(_0x62d6('0xa'));var crypto=require(_0x62d6('0xb'));var jsforce=require(_0x62d6('0xc'));var deskjs=require(_0x62d6('0xd'));var toCsv=require('to-csv');var querystring=require(_0x62d6('0xe'));var Papa=require(_0x62d6('0xf'));var Redis=require(_0x62d6('0x10'));var authService=require(_0x62d6('0x11'));var qs=require(_0x62d6('0x12'));var as=require(_0x62d6('0x13'));var hardwareService=require(_0x62d6('0x14'));var logger=require(_0x62d6('0x15'))(_0x62d6('0x16'));var utils=require('../../config/utils');var config=require(_0x62d6('0x17'));var licenseUtil=require(_0x62d6('0x18'));var db=require(_0x62d6('0x19'))['db'];function respondWithStatusCode(_0x393ee6,_0x18bb95){_0x18bb95=_0x18bb95||0xcc;return function(_0x316684){if(_0x316684){return _0x393ee6[_0x62d6('0x1a')](_0x18bb95);}return _0x393ee6[_0x62d6('0x1b')](_0x18bb95)[_0x62d6('0x1c')]();};}function respondWithResult(_0x44fa8b,_0x207f67){_0x207f67=_0x207f67||0xc8;return function(_0x5420a3){if(_0x5420a3){return _0x44fa8b[_0x62d6('0x1b')](_0x207f67)[_0x62d6('0x1d')](_0x5420a3);}};}function respondWithFilteredResult(_0x7eb493,_0x309ccb){return function(_0x1e7ff4){if(_0x1e7ff4){var _0x1af65a=typeof _0x309ccb[_0x62d6('0x1e')]===_0x62d6('0x1f')&&typeof _0x309ccb['limit']===_0x62d6('0x1f');var _0x293366=_0x1e7ff4[_0x62d6('0x20')];var _0x4d5135=_0x1af65a?0x0:_0x309ccb[_0x62d6('0x1e')];var _0x53c804=_0x1af65a?_0x1e7ff4[_0x62d6('0x20')]:_0x309ccb[_0x62d6('0x1e')]+_0x309ccb[_0x62d6('0x21')];var _0x4c3f4f;if(_0x53c804>=_0x293366){_0x53c804=_0x293366;_0x4c3f4f=0xc8;}else{_0x4c3f4f=0xce;}_0x7eb493[_0x62d6('0x1b')](_0x4c3f4f);return _0x7eb493[_0x62d6('0x22')](_0x62d6('0x23'),_0x4d5135+'-'+_0x53c804+'/'+_0x293366)['json'](_0x1e7ff4);}return null;};}function patchUpdates(_0x10a6da){return function(_0xb4653f){try{jsonpatch[_0x62d6('0x24')](_0xb4653f,_0x10a6da,!![]);}catch(_0x59b0bd){return BPromise[_0x62d6('0x25')](_0x59b0bd);}return _0xb4653f[_0x62d6('0x26')]();};}function saveUpdates(_0x287aa5,_0x25897a){return function(_0x1ee373){if(_0x1ee373){return _0x1ee373['update'](_0x287aa5)[_0x62d6('0x27')](function(_0x39034d){return _0x39034d;});}return null;};}function removeEntity(_0x1fb0b2,_0x26f80c){return function(_0x292309){if(_0x292309){return _0x292309[_0x62d6('0x28')]()[_0x62d6('0x27')](function(){_0x1fb0b2[_0x62d6('0x1b')](0xcc)[_0x62d6('0x1c')]();});}};}function handleEntityNotFound(_0x5c60e9,_0x4a160e){return function(_0x3ea920){if(!_0x3ea920){_0x5c60e9[_0x62d6('0x1a')](0x194);}return _0x3ea920;};}function handleError(_0x54935f,_0x2c895f){_0x2c895f=_0x2c895f||0x1f4;return function(_0x4ddb59){logger['error'](_0x4ddb59[_0x62d6('0x29')]);if(_0x4ddb59['name']){delete _0x4ddb59[_0x62d6('0x2a')];}_0x54935f[_0x62d6('0x1b')](_0x2c895f)[_0x62d6('0x2b')](_0x4ddb59);};}exports[_0x62d6('0x2c')]=function(_0x26ecee,_0x2609e8){var _0x3329ad={},_0x2704e4={},_0x516f6d={'count':0x0,'rows':[]};var _0x4f235e=_[_0x62d6('0x2d')](db[_0x62d6('0x2e')][_0x62d6('0x2f')],function(_0x3565b7){return{'name':_0x3565b7['fieldName'],'type':_0x3565b7[_0x62d6('0x30')]['key']};});_0x2704e4[_0x62d6('0x31')]=_['map'](_0x4f235e,'name');_0x2704e4['query']=_[_0x62d6('0x32')](_0x26ecee['query']);_0x2704e4[_0x62d6('0x33')]=_['intersection'](_0x2704e4[_0x62d6('0x31')],_0x2704e4[_0x62d6('0x34')]);_0x3329ad['attributes']=_['intersection'](_0x2704e4[_0x62d6('0x31')],qs[_0x62d6('0x35')](_0x26ecee[_0x62d6('0x34')][_0x62d6('0x35')]));_0x3329ad[_0x62d6('0x36')]=_0x3329ad['attributes'][_0x62d6('0x37')]?_0x3329ad[_0x62d6('0x36')]:_0x2704e4[_0x62d6('0x31')];if(!_0x26ecee[_0x62d6('0x34')][_0x62d6('0x38')](_0x62d6('0x39'))){_0x3329ad['limit']=qs[_0x62d6('0x21')](_0x26ecee[_0x62d6('0x34')][_0x62d6('0x21')]);_0x3329ad[_0x62d6('0x1e')]=qs['offset'](_0x26ecee[_0x62d6('0x34')]['offset']);}_0x3329ad[_0x62d6('0x3a')]=qs['sort'](_0x26ecee[_0x62d6('0x34')][_0x62d6('0x3b')]);_0x3329ad[_0x62d6('0x3c')]=qs[_0x62d6('0x33')](_[_0x62d6('0x3d')](_0x26ecee[_0x62d6('0x34')],_0x2704e4[_0x62d6('0x33')]),_0x4f235e);if(_0x26ecee['query'][_0x62d6('0x3e')]){_0x3329ad[_0x62d6('0x3c')]=_[_0x62d6('0x3f')](_0x3329ad[_0x62d6('0x3c')],{'$or':_[_0x62d6('0x2d')](_0x4f235e,function(_0x3281ee){if(_0x3281ee['type']!==_0x62d6('0x40')){var _0x137f45={};_0x137f45[_0x3281ee[_0x62d6('0x2a')]]={'$like':'%'+_0x26ecee[_0x62d6('0x34')][_0x62d6('0x3e')]+'%'};return _0x137f45;}})});}_0x3329ad=_[_0x62d6('0x3f')]({},_0x3329ad,_0x26ecee[_0x62d6('0x41')]);var _0x49b5c1={'where':_0x3329ad[_0x62d6('0x3c')]};return db[_0x62d6('0x2e')][_0x62d6('0x20')](_0x49b5c1)[_0x62d6('0x27')](function(_0x40d118){_0x516f6d[_0x62d6('0x20')]=_0x40d118;if(_0x26ecee[_0x62d6('0x34')][_0x62d6('0x42')]){_0x3329ad[_0x62d6('0x43')]=[{'all':!![]}];}return db[_0x62d6('0x2e')][_0x62d6('0x44')](_0x3329ad);})[_0x62d6('0x27')](function(_0x46f5b2){_0x516f6d[_0x62d6('0x45')]=_0x46f5b2;return _0x516f6d;})[_0x62d6('0x27')](respondWithFilteredResult(_0x2609e8,_0x3329ad))[_0x62d6('0x46')](handleError(_0x2609e8,null));};exports[_0x62d6('0x47')]=function(_0xad9878,_0x34fc68){var _0x58a4a5={'raw':![],'where':{'id':_0xad9878['params']['id']}},_0x58d93d={};_0x58d93d[_0x62d6('0x31')]=_['keys'](db[_0x62d6('0x2e')]['rawAttributes']);_0x58d93d[_0x62d6('0x34')]=_['keys'](_0xad9878[_0x62d6('0x34')]);_0x58d93d[_0x62d6('0x33')]=_['intersection'](_0x58d93d[_0x62d6('0x31')],_0x58d93d[_0x62d6('0x34')]);_0x58a4a5[_0x62d6('0x36')]=_['intersection'](_0x58d93d['model'],qs[_0x62d6('0x35')](_0xad9878['query'][_0x62d6('0x35')]));_0x58a4a5['attributes']=_0x58a4a5['attributes'][_0x62d6('0x37')]?_0x58a4a5['attributes']:_0x58d93d[_0x62d6('0x31')];if(_0xad9878['query'][_0x62d6('0x42')]){_0x58a4a5[_0x62d6('0x43')]=[{'all':!![]}];}_0x58a4a5=_[_0x62d6('0x3f')]({},_0x58a4a5,_0xad9878[_0x62d6('0x41')]);return db['SalesforceConfiguration'][_0x62d6('0x48')](_0x58a4a5)[_0x62d6('0x27')](handleEntityNotFound(_0x34fc68,null))[_0x62d6('0x27')](respondWithResult(_0x34fc68,null))[_0x62d6('0x46')](handleError(_0x34fc68,null));};exports[_0x62d6('0x49')]=function(_0x57aae1,_0x2b86fc){return db[_0x62d6('0x2e')][_0x62d6('0x49')](_0x57aae1[_0x62d6('0x4a')],{})['then'](respondWithResult(_0x2b86fc,0xc9))['catch'](handleError(_0x2b86fc,null));};exports['update']=function(_0xbfc3f,_0x73e8b5){if(_0xbfc3f['body']['id']){delete _0xbfc3f[_0x62d6('0x4a')]['id'];}return db[_0x62d6('0x2e')][_0x62d6('0x48')]({'where':{'id':_0xbfc3f[_0x62d6('0x4b')]['id']}})[_0x62d6('0x27')](handleEntityNotFound(_0x73e8b5,null))[_0x62d6('0x27')](saveUpdates(_0xbfc3f[_0x62d6('0x4a')],null))[_0x62d6('0x27')](respondWithResult(_0x73e8b5,null))[_0x62d6('0x46')](handleError(_0x73e8b5,null));};exports[_0x62d6('0x28')]=function(_0x31c64c,_0x494ba2){return db['SalesforceConfiguration'][_0x62d6('0x48')]({'where':{'id':_0x31c64c[_0x62d6('0x4b')]['id']}})[_0x62d6('0x27')](handleEntityNotFound(_0x494ba2,null))[_0x62d6('0x27')](removeEntity(_0x494ba2,null))[_0x62d6('0x46')](handleError(_0x494ba2,null));};exports['getFields']=function(_0xb2d6a1,_0x298add,_0x1e5c4d){var _0x244dae={};var _0x313f16={};var _0x56440c;var _0x656fe8;return db[_0x62d6('0x2e')]['findOne']({'where':{'id':_0xb2d6a1[_0x62d6('0x4b')]['id']}})[_0x62d6('0x27')](handleEntityNotFound(_0x298add,null))[_0x62d6('0x27')](function(_0x488747){if(_0x488747){_0x56440c=_0x488747;_0x313f16[_0x62d6('0x31')]=_[_0x62d6('0x32')](db['SalesforceField']['rawAttributes']);_0x313f16[_0x62d6('0x34')]=_['keys'](_0xb2d6a1[_0x62d6('0x34')]);_0x313f16['filters']=_[_0x62d6('0x4c')](_0x313f16[_0x62d6('0x31')],_0x313f16[_0x62d6('0x34')]);_0x244dae[_0x62d6('0x36')]=_['intersection'](_0x313f16[_0x62d6('0x31')],qs[_0x62d6('0x35')](_0xb2d6a1[_0x62d6('0x34')][_0x62d6('0x35')]));_0x244dae[_0x62d6('0x36')]=_0x244dae[_0x62d6('0x36')][_0x62d6('0x37')]?_0x244dae[_0x62d6('0x36')]:_0x313f16[_0x62d6('0x31')];_0x244dae[_0x62d6('0x3a')]=qs['sort'](_0xb2d6a1[_0x62d6('0x34')][_0x62d6('0x3b')]);_0x244dae['where']=qs[_0x62d6('0x33')](_['pick'](_0xb2d6a1[_0x62d6('0x34')],_0x313f16['filters']));if(_0xb2d6a1[_0x62d6('0x34')]['filter']){_0x244dae[_0x62d6('0x3c')]=_['merge'](_0x244dae[_0x62d6('0x3c')],{'$or':_[_0x62d6('0x2d')](_0x244dae[_0x62d6('0x36')],function(_0xb3f9e6){var _0x5b0644={};_0x5b0644[_0xb3f9e6]={'$like':'%'+_0xb2d6a1[_0x62d6('0x34')][_0x62d6('0x3e')]+'%'};return _0x5b0644;})});}_0x244dae=_[_0x62d6('0x3f')]({},_0x244dae,_0xb2d6a1[_0x62d6('0x41')]);return _0x56440c[_0x62d6('0x4d')](_0x244dae);}})[_0x62d6('0x27')](function(_0x5ad586){if(_0x5ad586){_0x656fe8=_0x5ad586[_0x62d6('0x37')];if(!_0xb2d6a1[_0x62d6('0x34')]['hasOwnProperty'](_0x62d6('0x39'))){_0x244dae[_0x62d6('0x21')]=qs[_0x62d6('0x21')](_0xb2d6a1[_0x62d6('0x34')]['limit']);_0x244dae[_0x62d6('0x1e')]=qs['offset'](_0xb2d6a1[_0x62d6('0x34')][_0x62d6('0x1e')]);}return _0x56440c[_0x62d6('0x4d')](_0x244dae);}})[_0x62d6('0x27')](function(_0x3e7a94){if(_0x3e7a94){return _0x3e7a94?{'count':_0x656fe8,'rows':_0x3e7a94}:null;}})[_0x62d6('0x27')](respondWithResult(_0x298add,null))['catch'](handleError(_0x298add,null));};exports[_0x62d6('0x4e')]=function(_0x480ea1,_0x482531,_0x1e38f8){var _0x161177={};var _0x13647a={};var _0xb08f0f;var _0x3a8838;return db['SalesforceConfiguration']['findOne']({'where':{'id':_0x480ea1[_0x62d6('0x4b')]['id']}})['then'](handleEntityNotFound(_0x482531,null))[_0x62d6('0x27')](function(_0x5b0075){if(_0x5b0075){_0xb08f0f=_0x5b0075;_0x13647a[_0x62d6('0x31')]=_['keys'](db[_0x62d6('0x4f')][_0x62d6('0x2f')]);_0x13647a[_0x62d6('0x34')]=_[_0x62d6('0x32')](_0x480ea1[_0x62d6('0x34')]);_0x13647a[_0x62d6('0x33')]=_['intersection'](_0x13647a['model'],_0x13647a[_0x62d6('0x34')]);_0x161177[_0x62d6('0x36')]=_[_0x62d6('0x4c')](_0x13647a['model'],qs[_0x62d6('0x35')](_0x480ea1[_0x62d6('0x34')][_0x62d6('0x35')]));_0x161177['attributes']=_0x161177[_0x62d6('0x36')][_0x62d6('0x37')]?_0x161177[_0x62d6('0x36')]:_0x13647a[_0x62d6('0x31')];_0x161177[_0x62d6('0x3a')]=qs[_0x62d6('0x3b')](_0x480ea1[_0x62d6('0x34')][_0x62d6('0x3b')]);_0x161177['where']=qs[_0x62d6('0x33')](_['pick'](_0x480ea1[_0x62d6('0x34')],_0x13647a[_0x62d6('0x33')]));if(_0x480ea1[_0x62d6('0x34')][_0x62d6('0x3e')]){_0x161177[_0x62d6('0x3c')]=_[_0x62d6('0x3f')](_0x161177[_0x62d6('0x3c')],{'$or':_[_0x62d6('0x2d')](_0x161177[_0x62d6('0x36')],function(_0x2874bd){var _0x34037a={};_0x34037a[_0x2874bd]={'$like':'%'+_0x480ea1[_0x62d6('0x34')][_0x62d6('0x3e')]+'%'};return _0x34037a;})});}_0x161177=_[_0x62d6('0x3f')]({},_0x161177,_0x480ea1['options']);return _0xb08f0f['getSubjects'](_0x161177);}})[_0x62d6('0x27')](function(_0x5e24b3){if(_0x5e24b3){_0x3a8838=_0x5e24b3[_0x62d6('0x37')];if(!_0x480ea1[_0x62d6('0x34')][_0x62d6('0x38')]('nolimit')){_0x161177[_0x62d6('0x21')]=qs['limit'](_0x480ea1[_0x62d6('0x34')][_0x62d6('0x21')]);_0x161177[_0x62d6('0x1e')]=qs[_0x62d6('0x1e')](_0x480ea1['query'][_0x62d6('0x1e')]);}return _0xb08f0f[_0x62d6('0x4e')](_0x161177);}})['then'](function(_0x2945a2){if(_0x2945a2){return _0x2945a2?{'count':_0x3a8838,'rows':_0x2945a2}:null;}})[_0x62d6('0x27')](respondWithResult(_0x482531,null))['catch'](handleError(_0x482531,null));};exports[_0x62d6('0x50')]=function(_0x2d91ea,_0x9b0a1e,_0x47f8b7){var _0x841b31={};var _0x1f92d3={};var _0x14e52f;var _0x5a42ac;return db['SalesforceConfiguration'][_0x62d6('0x51')]({'where':{'id':_0x2d91ea['params']['id']}})['then'](handleEntityNotFound(_0x9b0a1e,null))[_0x62d6('0x27')](function(_0x3190ac){if(_0x3190ac){_0x14e52f=_0x3190ac;_0x1f92d3['model']=_[_0x62d6('0x32')](db[_0x62d6('0x4f')]['rawAttributes']);_0x1f92d3[_0x62d6('0x34')]=_['keys'](_0x2d91ea[_0x62d6('0x34')]);_0x1f92d3[_0x62d6('0x33')]=_[_0x62d6('0x4c')](_0x1f92d3[_0x62d6('0x31')],_0x1f92d3[_0x62d6('0x34')]);_0x841b31[_0x62d6('0x36')]=_[_0x62d6('0x4c')](_0x1f92d3[_0x62d6('0x31')],qs[_0x62d6('0x35')](_0x2d91ea[_0x62d6('0x34')][_0x62d6('0x35')]));_0x841b31[_0x62d6('0x36')]=_0x841b31[_0x62d6('0x36')][_0x62d6('0x37')]?_0x841b31[_0x62d6('0x36')]:_0x1f92d3[_0x62d6('0x31')];_0x841b31[_0x62d6('0x3a')]=qs[_0x62d6('0x3b')](_0x2d91ea[_0x62d6('0x34')][_0x62d6('0x3b')]);_0x841b31[_0x62d6('0x3c')]=qs['filters'](_[_0x62d6('0x3d')](_0x2d91ea['query'],_0x1f92d3[_0x62d6('0x33')]));if(_0x2d91ea[_0x62d6('0x34')]['filter']){_0x841b31[_0x62d6('0x3c')]=_[_0x62d6('0x3f')](_0x841b31[_0x62d6('0x3c')],{'$or':_[_0x62d6('0x2d')](_0x841b31[_0x62d6('0x36')],function(_0x532531){var _0x3a9f7b={};_0x3a9f7b[_0x532531]={'$like':'%'+_0x2d91ea[_0x62d6('0x34')][_0x62d6('0x3e')]+'%'};return _0x3a9f7b;})});}_0x841b31=_['merge']({},_0x841b31,_0x2d91ea[_0x62d6('0x41')]);return _0x14e52f[_0x62d6('0x50')](_0x841b31);}})[_0x62d6('0x27')](function(_0x2bbee8){if(_0x2bbee8){_0x5a42ac=_0x2bbee8['length'];if(!_0x2d91ea[_0x62d6('0x34')][_0x62d6('0x38')](_0x62d6('0x39'))){_0x841b31['limit']=qs[_0x62d6('0x21')](_0x2d91ea[_0x62d6('0x34')][_0x62d6('0x21')]);_0x841b31[_0x62d6('0x1e')]=qs[_0x62d6('0x1e')](_0x2d91ea['query'][_0x62d6('0x1e')]);}return _0x14e52f[_0x62d6('0x50')](_0x841b31);}})['then'](function(_0x5d178a){if(_0x5d178a){return _0x5d178a?{'count':_0x5a42ac,'rows':_0x5d178a}:null;}})[_0x62d6('0x27')](respondWithResult(_0x9b0a1e,null))[_0x62d6('0x46')](handleError(_0x9b0a1e,null));};
\ No newline at end of file
index bdee60a..85b84b4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x35ff=['define','SalesforceConfiguration','int_salesforce_configurations','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x35ff,0x107));var _0xf35f=function(_0x5871bb,_0x3779ab){_0x5871bb=_0x5871bb-0x0;var _0x5a3cb6=_0x35ff[_0x5871bb];return _0x5a3cb6;};'use strict';var _=require(_0xf35f('0x0'));var util=require(_0xf35f('0x1'));var logger=require(_0xf35f('0x2'))(_0xf35f('0x3'));var moment=require('moment');var BPromise=require(_0xf35f('0x4'));var rp=require(_0xf35f('0x5'));var fs=require('fs');var path=require(_0xf35f('0x6'));var rimraf=require(_0xf35f('0x7'));var config=require(_0xf35f('0x8'));var attributes=require('./intSalesforceConfiguration.attributes');module[_0xf35f('0x9')]=function(_0x262076,_0x52f450){return _0x262076[_0xf35f('0xa')](_0xf35f('0xb'),attributes,{'tableName':_0xf35f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0d40=['moment','bluebird','request-promise','path','../../config/environment','./intSalesforceConfiguration.attributes','exports','define','int_salesforce_configurations','lodash','api'];(function(_0x373dee,_0x1a8c45){var _0x46798f=function(_0xc389f0){while(--_0xc389f0){_0x373dee['push'](_0x373dee['shift']());}};_0x46798f(++_0x1a8c45);}(_0x0d40,0x8d));var _0x00d4=function(_0x24b1ea,_0x642a66){_0x24b1ea=_0x24b1ea-0x0;var _0x1eb3b0=_0x0d40[_0x24b1ea];return _0x1eb3b0;};'use strict';var _=require(_0x00d4('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x00d4('0x1'));var moment=require(_0x00d4('0x2'));var BPromise=require(_0x00d4('0x3'));var rp=require(_0x00d4('0x4'));var fs=require('fs');var path=require(_0x00d4('0x5'));var rimraf=require('rimraf');var config=require(_0x00d4('0x6'));var attributes=require(_0x00d4('0x7'));module[_0x00d4('0x8')]=function(_0x649d79,_0x40298a){return _0x649d79[_0x00d4('0x9')]('SalesforceConfiguration',attributes,{'tableName':_0x00d4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 8d126e4..cf3d81e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5201=['ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','then','info','SalesforceConfiguration,\x20%s,\x20%s','debug','error','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x2b7cd5,_0x582861){var _0x46e1af=function(_0x2834d1){while(--_0x2834d1){_0x2b7cd5['push'](_0x2b7cd5['shift']());}};_0x46e1af(++_0x582861);}(_0x5201,0x1bd));var _0x1520=function(_0x2802cb,_0xffbd53){_0x2802cb=_0x2802cb-0x0;var _0x26f518=_0x5201[_0x2802cb];return _0x26f518;};'use strict';var _=require(_0x1520('0x0'));var util=require(_0x1520('0x1'));var moment=require(_0x1520('0x2'));var BPromise=require(_0x1520('0x3'));var rs=require(_0x1520('0x4'));var fs=require('fs');var Redis=require(_0x1520('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x1520('0x6'));var logger=require(_0x1520('0x7'))(_0x1520('0x8'));var config=require('../../config/environment');var jayson=require(_0x1520('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4a04d3,_0x2a56ab,_0x147e20){return new BPromise(function(_0x1b9f56,_0xd36c87){return client['request'](_0x4a04d3,_0x147e20)[_0x1520('0xa')](function(_0x45f3bc){logger[_0x1520('0xb')](_0x1520('0xc'),_0x2a56ab,'request\x20sent');logger[_0x1520('0xd')]('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0x2a56ab,'request\x20sent',JSON['stringify'](_0x45f3bc));if(_0x45f3bc[_0x1520('0xe')]){if(_0x45f3bc[_0x1520('0xe')]['code']===0x1f4){logger[_0x1520('0xe')](_0x1520('0xc'),_0x2a56ab,_0x45f3bc['error']['message']);return _0xd36c87(_0x45f3bc[_0x1520('0xe')][_0x1520('0xf')]);}logger[_0x1520('0xe')](_0x1520('0xc'),_0x2a56ab,_0x45f3bc[_0x1520('0xe')][_0x1520('0xf')]);return _0x1b9f56(_0x45f3bc[_0x1520('0xe')][_0x1520('0xf')]);}else{logger[_0x1520('0xb')](_0x1520('0xc'),_0x2a56ab,'request\x20sent');_0x1b9f56(_0x45f3bc[_0x1520('0x10')]['message']);}})[_0x1520('0x11')](function(_0x16d1ec){logger['error'](_0x1520('0xc'),_0x2a56ab,_0x16d1ec);_0xd36c87(_0x16d1ec);});});}
\ No newline at end of file
+var _0x5ecf=['rpc','../../config/environment','client','then','info','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','SalesforceConfiguration,\x20%s,\x20%s','message','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x392357,_0x1ffd71){var _0x57c7dd=function(_0x28efcf){while(--_0x28efcf){_0x392357['push'](_0x392357['shift']());}};_0x57c7dd(++_0x1ffd71);}(_0x5ecf,0x11e));var _0xf5ec=function(_0x269a37,_0x2415c5){_0x269a37=_0x269a37-0x0;var _0x1448f1=_0x5ecf[_0x269a37];return _0x1448f1;};'use strict';var _=require(_0xf5ec('0x0'));var util=require(_0xf5ec('0x1'));var moment=require(_0xf5ec('0x2'));var BPromise=require(_0xf5ec('0x3'));var rs=require(_0xf5ec('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf5ec('0x5'))['db'];var utils=require(_0xf5ec('0x6'));var logger=require(_0xf5ec('0x7'))(_0xf5ec('0x8'));var config=require(_0xf5ec('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xf5ec('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c8025,_0x58536e,_0x10d1d){return new BPromise(function(_0x2e9d4c,_0x4f16ac){return client['request'](_0x3c8025,_0x10d1d)[_0xf5ec('0xb')](function(_0xc53431){logger[_0xf5ec('0xc')]('SalesforceConfiguration,\x20%s,\x20%s',_0x58536e,'request\x20sent');logger['debug'](_0xf5ec('0xd'),_0x58536e,'request\x20sent',JSON[_0xf5ec('0xe')](_0xc53431));if(_0xc53431[_0xf5ec('0xf')]){if(_0xc53431['error']['code']===0x1f4){logger[_0xf5ec('0xf')](_0xf5ec('0x10'),_0x58536e,_0xc53431[_0xf5ec('0xf')][_0xf5ec('0x11')]);return _0x4f16ac(_0xc53431[_0xf5ec('0xf')][_0xf5ec('0x11')]);}logger['error'](_0xf5ec('0x10'),_0x58536e,_0xc53431[_0xf5ec('0xf')][_0xf5ec('0x11')]);return _0x2e9d4c(_0xc53431[_0xf5ec('0xf')][_0xf5ec('0x11')]);}else{logger['info']('SalesforceConfiguration,\x20%s,\x20%s',_0x58536e,_0xf5ec('0x12'));_0x2e9d4c(_0xc53431[_0xf5ec('0x13')][_0xf5ec('0x11')]);}})[_0xf5ec('0x14')](function(_0x255c1b){logger[_0xf5ec('0xf')](_0xf5ec('0x10'),_0x58536e,_0x255c1b);_0x4f16ac(_0x255c1b);});});}
\ No newline at end of file
index 0c830e2..d67baba 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1e4d=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./intSalesforceField.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete'];(function(_0x5a1da0,_0x5c4805){var _0x484881=function(_0x2c7919){while(--_0x2c7919){_0x5a1da0['push'](_0x5a1da0['shift']());}};_0x484881(++_0x5c4805);}(_0x1e4d,0x155));var _0xd1e4=function(_0xc93913,_0x14e912){_0xc93913=_0xc93913-0x0;var _0x1880ca=_0x1e4d[_0xc93913];return _0x1880ca;};'use strict';var multer=require(_0xd1e4('0x0'));var util=require(_0xd1e4('0x1'));var path=require(_0xd1e4('0x2'));var timeout=require(_0xd1e4('0x3'));var express=require(_0xd1e4('0x4'));var router=express[_0xd1e4('0x5')]();var fs_extra=require(_0xd1e4('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xd1e4('0x7'));var config=require('../../config/environment');var controller=require(_0xd1e4('0x8'));router[_0xd1e4('0x9')]('/',auth[_0xd1e4('0xa')](),controller[_0xd1e4('0xb')]);router[_0xd1e4('0x9')](_0xd1e4('0xc'),auth['isAuthenticated'](),controller[_0xd1e4('0xd')]);router[_0xd1e4('0xe')]('/',auth[_0xd1e4('0xa')](),controller[_0xd1e4('0xf')]);router[_0xd1e4('0x10')](_0xd1e4('0xc'),auth[_0xd1e4('0xa')](),controller[_0xd1e4('0x11')]);router[_0xd1e4('0x12')](_0xd1e4('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0xd1e4('0x13')]=router;
\ No newline at end of file
+var _0x6e94=['../../config/environment','get','isAuthenticated','index','/:id','show','post','create','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x6e94,0x1a9));var _0x46e9=function(_0x57ec17,_0x5cd112){_0x57ec17=_0x57ec17-0x0;var _0x7933b9=_0x6e94[_0x57ec17];return _0x7933b9;};'use strict';var multer=require(_0x46e9('0x0'));var util=require(_0x46e9('0x1'));var path=require(_0x46e9('0x2'));var timeout=require(_0x46e9('0x3'));var express=require(_0x46e9('0x4'));var router=express[_0x46e9('0x5')]();var fs_extra=require(_0x46e9('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x46e9('0x7'));var controller=require('./intSalesforceField.controller');router[_0x46e9('0x8')]('/',auth[_0x46e9('0x9')](),controller[_0x46e9('0xa')]);router[_0x46e9('0x8')](_0x46e9('0xb'),auth[_0x46e9('0x9')](),controller[_0x46e9('0xc')]);router[_0x46e9('0xd')]('/',auth[_0x46e9('0x9')](),controller[_0x46e9('0xe')]);router['put'](_0x46e9('0xb'),auth['isAuthenticated'](),controller[_0x46e9('0xf')]);router[_0x46e9('0x10')]('/:id',auth[_0x46e9('0x9')](),controller[_0x46e9('0x11')]);module['exports']=router;
\ No newline at end of file
index f490e11..296ba60 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x46ad=['exports','ENUM','string','variable','customVariable','keyValue','STRING','sequelize'];(function(_0x298020,_0x53698c){var _0x392ab4=function(_0x207176){while(--_0x207176){_0x298020['push'](_0x298020['shift']());}};_0x392ab4(++_0x53698c);}(_0x46ad,0x1cf));var _0xd46a=function(_0x266d29,_0x2b6b29){_0x266d29=_0x266d29-0x0;var _0x33bbbd=_0x46ad[_0x266d29];return _0x33bbbd;};'use strict';var Sequelize=require(_0xd46a('0x0'));module[_0xd46a('0x1')]={'type':{'type':Sequelize[_0xd46a('0x2')](_0xd46a('0x3'),_0xd46a('0x4'),_0xd46a('0x5'),_0xd46a('0x6'),'picklist'),'defaultValue':_0xd46a('0x3')},'content':{'type':Sequelize[_0xd46a('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0xd46a('0x3'),_0xd46a('0x4'),_0xd46a('0x5'))},'keyContent':{'type':Sequelize[_0xd46a('0x7')]},'idField':{'type':Sequelize[_0xd46a('0x7')]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x1a92=['variable','customVariable','keyValue','picklist','string','STRING','sequelize','exports','ENUM'];(function(_0x48d00f,_0xc344c6){var _0x527ffa=function(_0x469548){while(--_0x469548){_0x48d00f['push'](_0x48d00f['shift']());}};_0x527ffa(++_0xc344c6);}(_0x1a92,0xba));var _0x21a9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1a92[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x21a9('0x0'));module[_0x21a9('0x1')]={'type':{'type':Sequelize[_0x21a9('0x2')]('string',_0x21a9('0x3'),_0x21a9('0x4'),_0x21a9('0x5'),_0x21a9('0x6')),'defaultValue':_0x21a9('0x7')},'content':{'type':Sequelize[_0x21a9('0x8')]},'key':{'type':Sequelize[_0x21a9('0x8')]},'keyType':{'type':Sequelize[_0x21a9('0x2')](_0x21a9('0x7'),'variable',_0x21a9('0x4'))},'keyContent':{'type':Sequelize[_0x21a9('0x8')]},'idField':{'type':Sequelize[_0x21a9('0x8')]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
index cc3d219..6650340 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1301=['lodash','crypto','jsforce','desk.js','to-csv','querystring','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','count','Content-Range','json','apply','reject','update','then','error','stack','name','send','rawAttributes','fieldName','type','key','model','map','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','where','filters','filter','merge','SalesforceField','include','findAll','catch','params','includeAll','find','create','body','destroy','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra'];(function(_0x2d8a02,_0x1f4e5d){var _0xe7aaf8=function(_0x1ba751){while(--_0x1ba751){_0x2d8a02['push'](_0x2d8a02['shift']());}};_0xe7aaf8(++_0x1f4e5d);}(_0x1301,0x15d));var _0x1130=function(_0x5dc61c,_0xa9eb41){_0x5dc61c=_0x5dc61c-0x0;var _0x2e6c5b=_0x1301[_0x5dc61c];return _0x2e6c5b;};'use strict';var emlformat=require(_0x1130('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1130('0x1'));var jsonpatch=require(_0x1130('0x2'));var rp=require(_0x1130('0x3'));var moment=require(_0x1130('0x4'));var BPromise=require(_0x1130('0x5'));var Mustache=require('mustache');var util=require(_0x1130('0x6'));var path=require(_0x1130('0x7'));var sox=require(_0x1130('0x8'));var csv=require('to-csv');var ejs=require(_0x1130('0x9'));var fs=require('fs');var fs_extra=require(_0x1130('0xa'));var _=require(_0x1130('0xb'));var squel=require('squel');var crypto=require(_0x1130('0xc'));var jsforce=require(_0x1130('0xd'));var deskjs=require(_0x1130('0xe'));var toCsv=require(_0x1130('0xf'));var querystring=require(_0x1130('0x10'));var Papa=require('papaparse');var Redis=require(_0x1130('0x11'));var authService=require(_0x1130('0x12'));var qs=require(_0x1130('0x13'));var as=require(_0x1130('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1130('0x15'))(_0x1130('0x16'));var utils=require(_0x1130('0x17'));var config=require(_0x1130('0x18'));var licenseUtil=require(_0x1130('0x19'));var db=require(_0x1130('0x1a'))['db'];function respondWithStatusCode(_0x5bc457,_0x3baebb){_0x3baebb=_0x3baebb||0xcc;return function(_0x335184){if(_0x335184){return _0x5bc457[_0x1130('0x1b')](_0x3baebb);}return _0x5bc457[_0x1130('0x1c')](_0x3baebb)[_0x1130('0x1d')]();};}function respondWithResult(_0x586f0f,_0x4749c7){_0x4749c7=_0x4749c7||0xc8;return function(_0x127b5e){if(_0x127b5e){return _0x586f0f[_0x1130('0x1c')](_0x4749c7)['json'](_0x127b5e);}};}function respondWithFilteredResult(_0x5ecf3d,_0x4cbe8f){return function(_0x408235){if(_0x408235){var _0x24d3df=typeof _0x4cbe8f[_0x1130('0x1e')]===_0x1130('0x1f')&&typeof _0x4cbe8f[_0x1130('0x20')]===_0x1130('0x1f');var _0x3585c0=_0x408235[_0x1130('0x21')];var _0x3c33dc=_0x24d3df?0x0:_0x4cbe8f[_0x1130('0x1e')];var _0x2092d8=_0x24d3df?_0x408235['count']:_0x4cbe8f[_0x1130('0x1e')]+_0x4cbe8f[_0x1130('0x20')];var _0x47ed75;if(_0x2092d8>=_0x3585c0){_0x2092d8=_0x3585c0;_0x47ed75=0xc8;}else{_0x47ed75=0xce;}_0x5ecf3d[_0x1130('0x1c')](_0x47ed75);return _0x5ecf3d['set'](_0x1130('0x22'),_0x3c33dc+'-'+_0x2092d8+'/'+_0x3585c0)[_0x1130('0x23')](_0x408235);}return null;};}function patchUpdates(_0x39edcd){return function(_0x93e81c){try{jsonpatch[_0x1130('0x24')](_0x93e81c,_0x39edcd,!![]);}catch(_0x129c46){return BPromise[_0x1130('0x25')](_0x129c46);}return _0x93e81c['save']();};}function saveUpdates(_0xb40215,_0x5c42ad){return function(_0x5d8b08){if(_0x5d8b08){return _0x5d8b08[_0x1130('0x26')](_0xb40215)[_0x1130('0x27')](function(_0x34be9f){return _0x34be9f;});}return null;};}function removeEntity(_0x25514a,_0x2d7614){return function(_0x261266){if(_0x261266){return _0x261266['destroy']()[_0x1130('0x27')](function(){_0x25514a['status'](0xcc)[_0x1130('0x1d')]();});}};}function handleEntityNotFound(_0x54aee5,_0x1f39eb){return function(_0x334f12){if(!_0x334f12){_0x54aee5[_0x1130('0x1b')](0x194);}return _0x334f12;};}function handleError(_0x2d5038,_0x380452){_0x380452=_0x380452||0x1f4;return function(_0x44fa4e){logger[_0x1130('0x28')](_0x44fa4e[_0x1130('0x29')]);if(_0x44fa4e[_0x1130('0x2a')]){delete _0x44fa4e[_0x1130('0x2a')];}_0x2d5038[_0x1130('0x1c')](_0x380452)[_0x1130('0x2b')](_0x44fa4e);};}exports['index']=function(_0x27c746,_0x48856e){var _0x2beb07={},_0x303eb6={},_0x191668={'count':0x0,'rows':[]};var _0x2e2811=_['map'](db['SalesforceField'][_0x1130('0x2c')],function(_0x74eace){return{'name':_0x74eace[_0x1130('0x2d')],'type':_0x74eace[_0x1130('0x2e')][_0x1130('0x2f')]};});_0x303eb6[_0x1130('0x30')]=_[_0x1130('0x31')](_0x2e2811,_0x1130('0x2a'));_0x303eb6['query']=_[_0x1130('0x32')](_0x27c746[_0x1130('0x33')]);_0x303eb6['filters']=_[_0x1130('0x34')](_0x303eb6['model'],_0x303eb6['query']);_0x2beb07['attributes']=_[_0x1130('0x34')](_0x303eb6[_0x1130('0x30')],qs[_0x1130('0x35')](_0x27c746[_0x1130('0x33')][_0x1130('0x35')]));_0x2beb07[_0x1130('0x36')]=_0x2beb07['attributes'][_0x1130('0x37')]?_0x2beb07['attributes']:_0x303eb6[_0x1130('0x30')];if(!_0x27c746['query'][_0x1130('0x38')](_0x1130('0x39'))){_0x2beb07[_0x1130('0x20')]=qs[_0x1130('0x20')](_0x27c746[_0x1130('0x33')]['limit']);_0x2beb07[_0x1130('0x1e')]=qs[_0x1130('0x1e')](_0x27c746['query'][_0x1130('0x1e')]);}_0x2beb07['order']=qs['sort'](_0x27c746['query']['sort']);_0x2beb07[_0x1130('0x3a')]=qs[_0x1130('0x3b')](_['pick'](_0x27c746[_0x1130('0x33')],_0x303eb6['filters']),_0x2e2811);if(_0x27c746['query'][_0x1130('0x3c')]){_0x2beb07['where']=_[_0x1130('0x3d')](_0x2beb07[_0x1130('0x3a')],{'$or':_[_0x1130('0x31')](_0x2e2811,function(_0x4e587a){if(_0x4e587a[_0x1130('0x2e')]!=='VIRTUAL'){var _0x2943aa={};_0x2943aa[_0x4e587a[_0x1130('0x2a')]]={'$like':'%'+_0x27c746[_0x1130('0x33')]['filter']+'%'};return _0x2943aa;}})});}_0x2beb07=_[_0x1130('0x3d')]({},_0x2beb07,_0x27c746['options']);var _0x44e401={'where':_0x2beb07[_0x1130('0x3a')]};return db[_0x1130('0x3e')][_0x1130('0x21')](_0x44e401)[_0x1130('0x27')](function(_0x10c3cb){_0x191668[_0x1130('0x21')]=_0x10c3cb;if(_0x27c746['query']['includeAll']){_0x2beb07[_0x1130('0x3f')]=[{'all':!![]}];}return db[_0x1130('0x3e')][_0x1130('0x40')](_0x2beb07);})[_0x1130('0x27')](function(_0x3ce2c2){_0x191668['rows']=_0x3ce2c2;return _0x191668;})[_0x1130('0x27')](respondWithFilteredResult(_0x48856e,_0x2beb07))[_0x1130('0x41')](handleError(_0x48856e,null));};exports['show']=function(_0x354de5,_0x301a2f){var _0x14b44c={'raw':!![],'where':{'id':_0x354de5[_0x1130('0x42')]['id']}},_0x4acb0a={};_0x4acb0a[_0x1130('0x30')]=_[_0x1130('0x32')](db[_0x1130('0x3e')]['rawAttributes']);_0x4acb0a[_0x1130('0x33')]=_[_0x1130('0x32')](_0x354de5[_0x1130('0x33')]);_0x4acb0a[_0x1130('0x3b')]=_[_0x1130('0x34')](_0x4acb0a[_0x1130('0x30')],_0x4acb0a[_0x1130('0x33')]);_0x14b44c['attributes']=_[_0x1130('0x34')](_0x4acb0a[_0x1130('0x30')],qs['fields'](_0x354de5[_0x1130('0x33')][_0x1130('0x35')]));_0x14b44c[_0x1130('0x36')]=_0x14b44c[_0x1130('0x36')][_0x1130('0x37')]?_0x14b44c[_0x1130('0x36')]:_0x4acb0a[_0x1130('0x30')];if(_0x354de5['query'][_0x1130('0x43')]){_0x14b44c[_0x1130('0x3f')]=[{'all':!![]}];}_0x14b44c=_['merge']({},_0x14b44c,_0x354de5['options']);return db[_0x1130('0x3e')][_0x1130('0x44')](_0x14b44c)[_0x1130('0x27')](handleEntityNotFound(_0x301a2f,null))[_0x1130('0x27')](respondWithResult(_0x301a2f,null))[_0x1130('0x41')](handleError(_0x301a2f,null));};exports[_0x1130('0x45')]=function(_0x23a100,_0x37bffb){return db[_0x1130('0x3e')][_0x1130('0x45')](_0x23a100[_0x1130('0x46')],{})['then'](respondWithResult(_0x37bffb,0xc9))[_0x1130('0x41')](handleError(_0x37bffb,null));};exports[_0x1130('0x26')]=function(_0x32171e,_0x4cf1f2){if(_0x32171e['body']['id']){delete _0x32171e[_0x1130('0x46')]['id'];}return db[_0x1130('0x3e')]['find']({'where':{'id':_0x32171e[_0x1130('0x42')]['id']}})[_0x1130('0x27')](handleEntityNotFound(_0x4cf1f2,null))['then'](saveUpdates(_0x32171e[_0x1130('0x46')],null))[_0x1130('0x27')](respondWithResult(_0x4cf1f2,null))[_0x1130('0x41')](handleError(_0x4cf1f2,null));};exports[_0x1130('0x47')]=function(_0x3c6110,_0x5bd3b7){return db[_0x1130('0x3e')]['find']({'where':{'id':_0x3c6110[_0x1130('0x42')]['id']}})['then'](handleEntityNotFound(_0x5bd3b7,null))[_0x1130('0x27')](removeEntity(_0x5bd3b7,null))[_0x1130('0x41')](handleError(_0x5bd3b7,null));};
\ No newline at end of file
+var _0x14b4=['bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','save','update','then','error','name','send','index','map','SalesforceField','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','order','sort','where','filters','filter','merge','includeAll','findAll','rows','catch','show','include','options','find','create','body','params','zip-dir','fast-json-patch','request-promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x14b4,0x8b));var _0x414b=function(_0xd26500,_0xfa64ae){_0xd26500=_0xd26500-0x0;var _0x16cdba=_0x14b4[_0xd26500];return _0x16cdba;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x414b('0x0'));var jsonpatch=require(_0x414b('0x1'));var rp=require(_0x414b('0x2'));var moment=require('moment');var BPromise=require(_0x414b('0x3'));var Mustache=require(_0x414b('0x4'));var util=require(_0x414b('0x5'));var path=require('path');var sox=require(_0x414b('0x6'));var csv=require(_0x414b('0x7'));var ejs=require(_0x414b('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x414b('0x9'));var squel=require(_0x414b('0xa'));var crypto=require(_0x414b('0xb'));var jsforce=require(_0x414b('0xc'));var deskjs=require(_0x414b('0xd'));var toCsv=require(_0x414b('0x7'));var querystring=require('querystring');var Papa=require(_0x414b('0xe'));var Redis=require(_0x414b('0xf'));var authService=require(_0x414b('0x10'));var qs=require(_0x414b('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x414b('0x12'));var logger=require(_0x414b('0x13'))(_0x414b('0x14'));var utils=require(_0x414b('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x414b('0x16'));var db=require(_0x414b('0x17'))['db'];function respondWithStatusCode(_0x41a76c,_0x36d033){_0x36d033=_0x36d033||0xcc;return function(_0x37b242){if(_0x37b242){return _0x41a76c[_0x414b('0x18')](_0x36d033);}return _0x41a76c[_0x414b('0x19')](_0x36d033)[_0x414b('0x1a')]();};}function respondWithResult(_0x1e3452,_0x163bc9){_0x163bc9=_0x163bc9||0xc8;return function(_0x2bd6b3){if(_0x2bd6b3){return _0x1e3452[_0x414b('0x19')](_0x163bc9)[_0x414b('0x1b')](_0x2bd6b3);}};}function respondWithFilteredResult(_0x39c4d7,_0x45f93c){return function(_0x4b072e){if(_0x4b072e){var _0x5e0a18=typeof _0x45f93c['offset']===_0x414b('0x1c')&&typeof _0x45f93c[_0x414b('0x1d')]===_0x414b('0x1c');var _0x2bb787=_0x4b072e[_0x414b('0x1e')];var _0xce1b57=_0x5e0a18?0x0:_0x45f93c[_0x414b('0x1f')];var _0x383f04=_0x5e0a18?_0x4b072e[_0x414b('0x1e')]:_0x45f93c['offset']+_0x45f93c[_0x414b('0x1d')];var _0x59a5d6;if(_0x383f04>=_0x2bb787){_0x383f04=_0x2bb787;_0x59a5d6=0xc8;}else{_0x59a5d6=0xce;}_0x39c4d7[_0x414b('0x19')](_0x59a5d6);return _0x39c4d7[_0x414b('0x20')](_0x414b('0x21'),_0xce1b57+'-'+_0x383f04+'/'+_0x2bb787)[_0x414b('0x1b')](_0x4b072e);}return null;};}function patchUpdates(_0x4ee659){return function(_0x4254cd){try{jsonpatch['apply'](_0x4254cd,_0x4ee659,!![]);}catch(_0x270e42){return BPromise['reject'](_0x270e42);}return _0x4254cd[_0x414b('0x22')]();};}function saveUpdates(_0x5c6704,_0x34023e){return function(_0x42625d){if(_0x42625d){return _0x42625d[_0x414b('0x23')](_0x5c6704)[_0x414b('0x24')](function(_0x9acd46){return _0x9acd46;});}return null;};}function removeEntity(_0x3b5099,_0x5b3de5){return function(_0x3a6731){if(_0x3a6731){return _0x3a6731['destroy']()[_0x414b('0x24')](function(){_0x3b5099[_0x414b('0x19')](0xcc)[_0x414b('0x1a')]();});}};}function handleEntityNotFound(_0x5177ed,_0x400e1a){return function(_0xfb3182){if(!_0xfb3182){_0x5177ed[_0x414b('0x18')](0x194);}return _0xfb3182;};}function handleError(_0x3c097a,_0x1c8d81){_0x1c8d81=_0x1c8d81||0x1f4;return function(_0x16dc32){logger[_0x414b('0x25')](_0x16dc32['stack']);if(_0x16dc32[_0x414b('0x26')]){delete _0x16dc32[_0x414b('0x26')];}_0x3c097a[_0x414b('0x19')](_0x1c8d81)[_0x414b('0x27')](_0x16dc32);};}exports[_0x414b('0x28')]=function(_0x4d08da,_0x119633){var _0x380603={},_0x1d7d7e={},_0x388639={'count':0x0,'rows':[]};var _0x59f538=_[_0x414b('0x29')](db[_0x414b('0x2a')][_0x414b('0x2b')],function(_0x268985){return{'name':_0x268985[_0x414b('0x2c')],'type':_0x268985[_0x414b('0x2d')][_0x414b('0x2e')]};});_0x1d7d7e[_0x414b('0x2f')]=_['map'](_0x59f538,_0x414b('0x26'));_0x1d7d7e[_0x414b('0x30')]=_[_0x414b('0x31')](_0x4d08da[_0x414b('0x30')]);_0x1d7d7e['filters']=_['intersection'](_0x1d7d7e[_0x414b('0x2f')],_0x1d7d7e[_0x414b('0x30')]);_0x380603[_0x414b('0x32')]=_[_0x414b('0x33')](_0x1d7d7e[_0x414b('0x2f')],qs[_0x414b('0x34')](_0x4d08da[_0x414b('0x30')][_0x414b('0x34')]));_0x380603[_0x414b('0x32')]=_0x380603[_0x414b('0x32')][_0x414b('0x35')]?_0x380603['attributes']:_0x1d7d7e[_0x414b('0x2f')];if(!_0x4d08da[_0x414b('0x30')]['hasOwnProperty']('nolimit')){_0x380603[_0x414b('0x1d')]=qs[_0x414b('0x1d')](_0x4d08da['query'][_0x414b('0x1d')]);_0x380603[_0x414b('0x1f')]=qs[_0x414b('0x1f')](_0x4d08da[_0x414b('0x30')][_0x414b('0x1f')]);}_0x380603[_0x414b('0x36')]=qs[_0x414b('0x37')](_0x4d08da[_0x414b('0x30')]['sort']);_0x380603[_0x414b('0x38')]=qs[_0x414b('0x39')](_['pick'](_0x4d08da[_0x414b('0x30')],_0x1d7d7e[_0x414b('0x39')]),_0x59f538);if(_0x4d08da[_0x414b('0x30')][_0x414b('0x3a')]){_0x380603[_0x414b('0x38')]=_[_0x414b('0x3b')](_0x380603[_0x414b('0x38')],{'$or':_[_0x414b('0x29')](_0x59f538,function(_0x1066c9){if(_0x1066c9[_0x414b('0x2d')]!=='VIRTUAL'){var _0x392f5d={};_0x392f5d[_0x1066c9['name']]={'$like':'%'+_0x4d08da[_0x414b('0x30')][_0x414b('0x3a')]+'%'};return _0x392f5d;}})});}_0x380603=_[_0x414b('0x3b')]({},_0x380603,_0x4d08da['options']);var _0x137668={'where':_0x380603[_0x414b('0x38')]};return db[_0x414b('0x2a')][_0x414b('0x1e')](_0x137668)[_0x414b('0x24')](function(_0x156652){_0x388639[_0x414b('0x1e')]=_0x156652;if(_0x4d08da[_0x414b('0x30')][_0x414b('0x3c')]){_0x380603['include']=[{'all':!![]}];}return db[_0x414b('0x2a')][_0x414b('0x3d')](_0x380603);})[_0x414b('0x24')](function(_0x49a803){_0x388639[_0x414b('0x3e')]=_0x49a803;return _0x388639;})[_0x414b('0x24')](respondWithFilteredResult(_0x119633,_0x380603))[_0x414b('0x3f')](handleError(_0x119633,null));};exports[_0x414b('0x40')]=function(_0x3fa62e,_0x4fea54){var _0x3ec8f1={'raw':!![],'where':{'id':_0x3fa62e['params']['id']}},_0xb8165f={};_0xb8165f[_0x414b('0x2f')]=_[_0x414b('0x31')](db[_0x414b('0x2a')][_0x414b('0x2b')]);_0xb8165f[_0x414b('0x30')]=_[_0x414b('0x31')](_0x3fa62e[_0x414b('0x30')]);_0xb8165f['filters']=_[_0x414b('0x33')](_0xb8165f[_0x414b('0x2f')],_0xb8165f['query']);_0x3ec8f1[_0x414b('0x32')]=_[_0x414b('0x33')](_0xb8165f[_0x414b('0x2f')],qs[_0x414b('0x34')](_0x3fa62e[_0x414b('0x30')][_0x414b('0x34')]));_0x3ec8f1[_0x414b('0x32')]=_0x3ec8f1['attributes'][_0x414b('0x35')]?_0x3ec8f1['attributes']:_0xb8165f['model'];if(_0x3fa62e[_0x414b('0x30')]['includeAll']){_0x3ec8f1[_0x414b('0x41')]=[{'all':!![]}];}_0x3ec8f1=_[_0x414b('0x3b')]({},_0x3ec8f1,_0x3fa62e[_0x414b('0x42')]);return db[_0x414b('0x2a')][_0x414b('0x43')](_0x3ec8f1)[_0x414b('0x24')](handleEntityNotFound(_0x4fea54,null))[_0x414b('0x24')](respondWithResult(_0x4fea54,null))[_0x414b('0x3f')](handleError(_0x4fea54,null));};exports[_0x414b('0x44')]=function(_0x15aede,_0x3be1c9){return db[_0x414b('0x2a')][_0x414b('0x44')](_0x15aede[_0x414b('0x45')],{})[_0x414b('0x24')](respondWithResult(_0x3be1c9,0xc9))[_0x414b('0x3f')](handleError(_0x3be1c9,null));};exports[_0x414b('0x23')]=function(_0x5c5d07,_0x5bc7a7){if(_0x5c5d07[_0x414b('0x45')]['id']){delete _0x5c5d07[_0x414b('0x45')]['id'];}return db[_0x414b('0x2a')][_0x414b('0x43')]({'where':{'id':_0x5c5d07[_0x414b('0x46')]['id']}})[_0x414b('0x24')](handleEntityNotFound(_0x5bc7a7,null))['then'](saveUpdates(_0x5c5d07[_0x414b('0x45')],null))['then'](respondWithResult(_0x5bc7a7,null))[_0x414b('0x3f')](handleError(_0x5bc7a7,null));};exports['destroy']=function(_0x25e223,_0x51391a){return db[_0x414b('0x2a')]['find']({'where':{'id':_0x25e223[_0x414b('0x46')]['id']}})[_0x414b('0x24')](handleEntityNotFound(_0x51391a,null))[_0x414b('0x24')](removeEntity(_0x51391a,null))[_0x414b('0x3f')](handleError(_0x51391a,null));};
\ No newline at end of file
index 4af0307..2324c43 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x40bf=['int_salesforce_fields','salesforce_unique_index','idField','FieldId','lodash','api','moment','bluebird','request-promise','../../config/environment','./intSalesforceField.attributes','exports','define','SalesforceField'];(function(_0x170678,_0x3e6c83){var _0xec79a8=function(_0x346b8b){while(--_0x346b8b){_0x170678['push'](_0x170678['shift']());}};_0xec79a8(++_0x3e6c83);}(_0x40bf,0x1ee));var _0xf40b=function(_0x20c9b2,_0x55d7b1){_0x20c9b2=_0x20c9b2-0x0;var _0x2c6030=_0x40bf[_0x20c9b2];return _0x2c6030;};'use strict';var _=require(_0xf40b('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf40b('0x1'));var moment=require(_0xf40b('0x2'));var BPromise=require(_0xf40b('0x3'));var rp=require(_0xf40b('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xf40b('0x5'));var attributes=require(_0xf40b('0x6'));module[_0xf40b('0x7')]=function(_0x4785f7,_0x176dfe){return _0x4785f7[_0xf40b('0x8')](_0xf40b('0x9'),attributes,{'tableName':_0xf40b('0xa'),'paranoid':![],'indexes':[{'name':_0xf40b('0xb'),'fields':[_0xf40b('0xc'),_0xf40b('0xd')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x5ba8=['SalesforceField','int_salesforce_fields','salesforce_unique_index','idField','FieldId','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSalesforceField.attributes','exports'];(function(_0x3de1a6,_0x500005){var _0xa747b5=function(_0x3a5aaf){while(--_0x3a5aaf){_0x3de1a6['push'](_0x3de1a6['shift']());}};_0xa747b5(++_0x500005);}(_0x5ba8,0x115));var _0x85ba=function(_0x46f5a7,_0x5ad6a4){_0x46f5a7=_0x46f5a7-0x0;var _0x3108f0=_0x5ba8[_0x46f5a7];return _0x3108f0;};'use strict';var _=require(_0x85ba('0x0'));var util=require(_0x85ba('0x1'));var logger=require(_0x85ba('0x2'))('api');var moment=require(_0x85ba('0x3'));var BPromise=require(_0x85ba('0x4'));var rp=require(_0x85ba('0x5'));var fs=require('fs');var path=require(_0x85ba('0x6'));var rimraf=require(_0x85ba('0x7'));var config=require(_0x85ba('0x8'));var attributes=require(_0x85ba('0x9'));module[_0x85ba('0xa')]=function(_0x4b759a,_0x2adcb7){return _0x4b759a['define'](_0x85ba('0xb'),attributes,{'tableName':_0x85ba('0xc'),'paranoid':![],'indexes':[{'name':_0x85ba('0xd'),'fields':[_0x85ba('0xe'),_0x85ba('0xf')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index a7a89e3..a47f2db 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6694=['../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','SalesforceField,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','lodash','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0x7eab27,_0x406432){var _0x3e413e=function(_0xc846b9){while(--_0xc846b9){_0x7eab27['push'](_0x7eab27['shift']());}};_0x3e413e(++_0x406432);}(_0x6694,0x176));var _0x4669=function(_0x52c538,_0x48f45a){_0x52c538=_0x52c538-0x0;var _0x33cb72=_0x6694[_0x52c538];return _0x33cb72;};'use strict';var _=require(_0x4669('0x0'));var util=require(_0x4669('0x1'));var moment=require(_0x4669('0x2'));var BPromise=require('bluebird');var rs=require(_0x4669('0x3'));var fs=require('fs');var Redis=require(_0x4669('0x4'));var db=require(_0x4669('0x5'))['db'];var utils=require(_0x4669('0x6'));var logger=require(_0x4669('0x7'))(_0x4669('0x8'));var config=require(_0x4669('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x4669('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xcc61b2,_0x37fe10,_0x45ad77){return new BPromise(function(_0x1a7717,_0x19b603){return client[_0x4669('0xb')](_0xcc61b2,_0x45ad77)[_0x4669('0xc')](function(_0x520556){logger['info'](_0x4669('0xd'),_0x37fe10,_0x4669('0xe'));logger['debug']('SalesforceField,\x20%s,\x20%s,\x20%s',_0x37fe10,_0x4669('0xe'),JSON[_0x4669('0xf')](_0x520556));if(_0x520556[_0x4669('0x10')]){if(_0x520556[_0x4669('0x10')]['code']===0x1f4){logger[_0x4669('0x10')]('SalesforceField,\x20%s,\x20%s',_0x37fe10,_0x520556[_0x4669('0x10')][_0x4669('0x11')]);return _0x19b603(_0x520556[_0x4669('0x10')][_0x4669('0x11')]);}logger[_0x4669('0x10')](_0x4669('0xd'),_0x37fe10,_0x520556[_0x4669('0x10')][_0x4669('0x11')]);return _0x1a7717(_0x520556[_0x4669('0x10')][_0x4669('0x11')]);}else{logger[_0x4669('0x12')]('SalesforceField,\x20%s,\x20%s',_0x37fe10,_0x4669('0xe'));_0x1a7717(_0x520556[_0x4669('0x13')][_0x4669('0x11')]);}})['catch'](function(_0x3f2147){logger['error'](_0x4669('0xd'),_0x37fe10,_0x3f2147);_0x19b603(_0x3f2147);});});}
\ No newline at end of file
+var _0xd225=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','SalesforceField,\x20%s,\x20%s','debug','SalesforceField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x47645e,_0x3418b4){var _0x4d7399=function(_0x863c50){while(--_0x863c50){_0x47645e['push'](_0x47645e['shift']());}};_0x4d7399(++_0x3418b4);}(_0xd225,0x181));var _0x5d22=function(_0x2bf10a,_0x4e9c77){_0x2bf10a=_0x2bf10a-0x0;var _0x5aa870=_0xd225[_0x2bf10a];return _0x5aa870;};'use strict';var _=require(_0x5d22('0x0'));var util=require(_0x5d22('0x1'));var moment=require('moment');var BPromise=require(_0x5d22('0x2'));var rs=require(_0x5d22('0x3'));var fs=require('fs');var Redis=require(_0x5d22('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x5d22('0x5'));var logger=require(_0x5d22('0x6'))(_0x5d22('0x7'));var config=require(_0x5d22('0x8'));var jayson=require(_0x5d22('0x9'));var client=jayson[_0x5d22('0xa')][_0x5d22('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xe7ee6c,_0x5bdc0d,_0x2f197d){return new BPromise(function(_0xceee82,_0x430ccc){return client['request'](_0xe7ee6c,_0x2f197d)[_0x5d22('0xc')](function(_0x2b4186){logger[_0x5d22('0xd')](_0x5d22('0xe'),_0x5bdc0d,'request\x20sent');logger[_0x5d22('0xf')](_0x5d22('0x10'),_0x5bdc0d,_0x5d22('0x11'),JSON[_0x5d22('0x12')](_0x2b4186));if(_0x2b4186[_0x5d22('0x13')]){if(_0x2b4186[_0x5d22('0x13')][_0x5d22('0x14')]===0x1f4){logger[_0x5d22('0x13')](_0x5d22('0xe'),_0x5bdc0d,_0x2b4186[_0x5d22('0x13')][_0x5d22('0x15')]);return _0x430ccc(_0x2b4186['error'][_0x5d22('0x15')]);}logger['error'](_0x5d22('0xe'),_0x5bdc0d,_0x2b4186[_0x5d22('0x13')][_0x5d22('0x15')]);return _0xceee82(_0x2b4186[_0x5d22('0x13')][_0x5d22('0x15')]);}else{logger['info'](_0x5d22('0xe'),_0x5bdc0d,_0x5d22('0x11'));_0xceee82(_0x2b4186['result'][_0x5d22('0x15')]);}})[_0x5d22('0x16')](function(_0x449c10){logger[_0x5d22('0x13')](_0x5d22('0xe'),_0x5bdc0d,_0x449c10);_0x430ccc(_0x449c10);});});}
\ No newline at end of file
index 11468fe..5b4a18f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe4ec=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','get','isAuthenticated','index','/:id','/:id/configurations','getConfigurations','getFields','post','create','addConfiguration','update','delete','destroy','exports','util','connect-timeout'];(function(_0x3c73b3,_0x4618bb){var _0x5ac5e8=function(_0x24a0bb){while(--_0x24a0bb){_0x3c73b3['push'](_0x3c73b3['shift']());}};_0x5ac5e8(++_0x4618bb);}(_0xe4ec,0x11c));var _0xce4e=function(_0x2a261d,_0x5c19b4){_0x2a261d=_0x2a261d-0x0;var _0x4cfc5a=_0xe4ec[_0x2a261d];return _0x4cfc5a;};'use strict';var multer=require('multer');var util=require(_0xce4e('0x0'));var path=require('path');var timeout=require(_0xce4e('0x1'));var express=require(_0xce4e('0x2'));var router=express[_0xce4e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xce4e('0x4'));var interaction=require(_0xce4e('0x5'));var config=require(_0xce4e('0x6'));var controller=require(_0xce4e('0x7'));router[_0xce4e('0x8')]('/',auth[_0xce4e('0x9')](),controller[_0xce4e('0xa')]);router['get'](_0xce4e('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xce4e('0x8')](_0xce4e('0xc'),auth[_0xce4e('0x9')](),controller[_0xce4e('0xd')]);router['get']('/:id/fields',auth['isAuthenticated'](),controller[_0xce4e('0xe')]);router[_0xce4e('0xf')]('/',auth[_0xce4e('0x9')](),controller[_0xce4e('0x10')]);router[_0xce4e('0xf')](_0xce4e('0xc'),auth[_0xce4e('0x9')](),controller[_0xce4e('0x11')]);router['put'](_0xce4e('0xb'),auth[_0xce4e('0x9')](),controller[_0xce4e('0x12')]);router[_0xce4e('0x13')]('/:id',auth['isAuthenticated'](),controller[_0xce4e('0x14')]);module[_0xce4e('0x15')]=router;
\ No newline at end of file
+var _0x552d=['post','addConfiguration','put','update','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','get','index','/:id','isAuthenticated','show','getConfigurations','getFields','create'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x552d,0xbe));var _0xd552=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0x552d[_0x1928c9];return _0x51b5fb;};'use strict';var multer=require(_0xd552('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xd552('0x1'));var express=require(_0xd552('0x2'));var router=express[_0xd552('0x3')]();var fs_extra=require(_0xd552('0x4'));var auth=require(_0xd552('0x5'));var interaction=require(_0xd552('0x6'));var config=require(_0xd552('0x7'));var controller=require(_0xd552('0x8'));router[_0xd552('0x9')]('/',auth['isAuthenticated'](),controller[_0xd552('0xa')]);router[_0xd552('0x9')](_0xd552('0xb'),auth[_0xd552('0xc')](),controller[_0xd552('0xd')]);router[_0xd552('0x9')]('/:id/configurations',auth[_0xd552('0xc')](),controller[_0xd552('0xe')]);router[_0xd552('0x9')]('/:id/fields',auth[_0xd552('0xc')](),controller[_0xd552('0xf')]);router['post']('/',auth[_0xd552('0xc')](),controller[_0xd552('0x10')]);router[_0xd552('0x11')]('/:id/configurations',auth[_0xd552('0xc')](),controller[_0xd552('0x12')]);router[_0xd552('0x13')]('/:id',auth[_0xd552('0xc')](),controller[_0xd552('0x14')]);router['delete']('/:id',auth[_0xd552('0xc')](),controller[_0xd552('0x15')]);module[_0xd552('0x16')]=router;
\ No newline at end of file
index 95b1c95..d242b74 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1886=['sequelize','exports','STRING'];(function(_0xf3a43,_0x252e05){var _0x33d271=function(_0x5c4a5d){while(--_0x5c4a5d){_0xf3a43['push'](_0xf3a43['shift']());}};_0x33d271(++_0x252e05);}(_0x1886,0x1a4));var _0x6188=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x1886[_0x42cae2];return _0x5f256f;};'use strict';var Sequelize=require(_0x6188('0x0'));module[_0x6188('0x1')]={'name':{'type':Sequelize[_0x6188('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x6188('0x2')],'unique':'username'},'password':{'type':Sequelize[_0x6188('0x2')]},'email':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x6188('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x6188('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0x6b63=['STRING','username','exports'];(function(_0x407396,_0x4c2610){var _0x56ef4c=function(_0x5e593d){while(--_0x5e593d){_0x407396['push'](_0x407396['shift']());}};_0x56ef4c(++_0x4c2610);}(_0x6b63,0x158));var _0x36b6=function(_0x4588bd,_0x5d3153){_0x4588bd=_0x4588bd-0x0;var _0x234247=_0x6b63[_0x4588bd];return _0x234247;};'use strict';var Sequelize=require('sequelize');module[_0x36b6('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x36b6('0x1')]},'username':{'type':Sequelize[_0x36b6('0x1')],'unique':_0x36b6('0x2')},'password':{'type':Sequelize[_0x36b6('0x1')]},'email':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x36b6('0x1')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x36b6('0x1')],'allowNull':![]}};
\ No newline at end of file
index 7abb7d0..954f977 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x81dd=['TCL:\x20_object','remove','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','concat','ServiceNow\x20error:\x20','test','Wrong\x20credentials','boolean','True','true','False','false','inactive','value','eml-format','rimraf','moment','mustache','util','path','sox','to-csv','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/license/util','../../mysqldb','../../components/integrations/configuration','status','end','json','offset','undefined','count','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','index','map','ServicenowAccount','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','getConfigurations','rawAttributes','limit','addConfiguration','findOne','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','ServicenowField','made_sla','knowledge','subcategory','notify','incident_state','category','parent','caused_by','watch_list','upon_reject','sys_updated_on','child_incidents','hold_reason','approval_history','resolved_by','opened_by','user_input','sys_created_on','sys_domain','sys_created_by','calendar_stc','closed_at','cmdb_ci','delivery_plan','work_notes_list','priority','sys_domain_path','time_worked','expected_start','work_end','resolved_at','caller_id','approval_set','short_description','close_code','correlation_display','delivery_task','work_start','business_stc','additional_assignee_list','calendar_duration','close_notes','closed_by','sys_id','contact_type','reopened_by','urgency','problem_id','activity_due','severity','sla_due','comments_and_work_notes','due_date','sys_mod_count','reopen_count','sys_tags','escalation','password','email','remoteUri','serverUrl','substring','lastIndexOf','format','%s/api/now/doc/table/schema/','%s/api/now/table/','username','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','assign','includes','forEach','internalType','label','push','all'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x81dd,0x176));var _0xd81d=function(_0x4a492f,_0x2e9c7d){_0x4a492f=_0x4a492f-0x0;var _0x39f703=_0x81dd[_0x4a492f];return _0x39f703;};'use strict';var emlformat=require(_0xd81d('0x0'));var rimraf=require(_0xd81d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xd81d('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xd81d('0x3'));var util=require(_0xd81d('0x4'));var path=require(_0xd81d('0x5'));var sox=require(_0xd81d('0x6'));var csv=require(_0xd81d('0x7'));var ejs=require(_0xd81d('0x8'));var fs=require('fs');var fs_extra=require(_0xd81d('0x9'));var _=require(_0xd81d('0xa'));var squel=require(_0xd81d('0xb'));var crypto=require(_0xd81d('0xc'));var jsforce=require(_0xd81d('0xd'));var deskjs=require(_0xd81d('0xe'));var toCsv=require(_0xd81d('0x7'));var querystring=require(_0xd81d('0xf'));var Papa=require('papaparse');var Redis=require(_0xd81d('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xd81d('0x11'));var as=require(_0xd81d('0x12'));var hardwareService=require(_0xd81d('0x13'));var logger=require(_0xd81d('0x14'))(_0xd81d('0x15'));var utils=require(_0xd81d('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xd81d('0x17'));var db=require(_0xd81d('0x18'))['db'];var integrations=require(_0xd81d('0x19'));function respondWithStatusCode(_0x1a2cf9,_0xf4e5c5){_0xf4e5c5=_0xf4e5c5||0xcc;return function(_0xbcb614){if(_0xbcb614){return _0x1a2cf9['sendStatus'](_0xf4e5c5);}return _0x1a2cf9[_0xd81d('0x1a')](_0xf4e5c5)[_0xd81d('0x1b')]();};}function respondWithResult(_0x46fe37,_0x279288){_0x279288=_0x279288||0xc8;return function(_0x389d0c){if(_0x389d0c){return _0x46fe37[_0xd81d('0x1a')](_0x279288)[_0xd81d('0x1c')](_0x389d0c);}};}function respondWithFilteredResult(_0x4babc7,_0x4e2add){return function(_0x15151a){if(_0x15151a){var _0x24b6ad=typeof _0x4e2add[_0xd81d('0x1d')]===_0xd81d('0x1e')&&typeof _0x4e2add['limit']===_0xd81d('0x1e');var _0x5becf4=_0x15151a[_0xd81d('0x1f')];var _0x4f2c62=_0x24b6ad?0x0:_0x4e2add[_0xd81d('0x1d')];var _0x2cbf82=_0x24b6ad?_0x15151a[_0xd81d('0x1f')]:_0x4e2add['offset']+_0x4e2add['limit'];var _0x20b94d;if(_0x2cbf82>=_0x5becf4){_0x2cbf82=_0x5becf4;_0x20b94d=0xc8;}else{_0x20b94d=0xce;}_0x4babc7[_0xd81d('0x1a')](_0x20b94d);return _0x4babc7['set'](_0xd81d('0x20'),_0x4f2c62+'-'+_0x2cbf82+'/'+_0x5becf4)['json'](_0x15151a);}return null;};}function patchUpdates(_0x4d129c){return function(_0x43fdaf){try{jsonpatch[_0xd81d('0x21')](_0x43fdaf,_0x4d129c,!![]);}catch(_0x354fbc){return BPromise[_0xd81d('0x22')](_0x354fbc);}return _0x43fdaf[_0xd81d('0x23')]();};}function saveUpdates(_0x2e9aca,_0x48072f){return function(_0x534fad){if(_0x534fad){return _0x534fad[_0xd81d('0x24')](_0x2e9aca)[_0xd81d('0x25')](function(_0x3480dd){return _0x3480dd;});}return null;};}function removeEntity(_0x3f4a37,_0x3fe59f){return function(_0x51df00){if(_0x51df00){return _0x51df00[_0xd81d('0x26')]()[_0xd81d('0x25')](function(){_0x3f4a37[_0xd81d('0x1a')](0xcc)[_0xd81d('0x1b')]();});}};}function handleEntityNotFound(_0x4d388b,_0x6b2f98){return function(_0x53d158){if(!_0x53d158){_0x4d388b[_0xd81d('0x27')](0x194);}return _0x53d158;};}function handleError(_0x33b1e2,_0x24a495){_0x24a495=_0x24a495||0x1f4;return function(_0x1b5dc0){logger['error'](_0x1b5dc0[_0xd81d('0x28')]);if(_0x1b5dc0[_0xd81d('0x29')]){delete _0x1b5dc0['name'];}_0x33b1e2[_0xd81d('0x1a')](_0x24a495)[_0xd81d('0x2a')](_0x1b5dc0);};}exports[_0xd81d('0x2b')]=function(_0x3e19ef,_0x5083f0){var _0x3081ef={},_0x2910b7={},_0x4addc4={'count':0x0,'rows':[]};var _0x1c6fb6=_[_0xd81d('0x2c')](db[_0xd81d('0x2d')]['rawAttributes'],function(_0x3bc5d8){return{'name':_0x3bc5d8[_0xd81d('0x2e')],'type':_0x3bc5d8[_0xd81d('0x2f')][_0xd81d('0x30')]};});_0x2910b7[_0xd81d('0x31')]=_[_0xd81d('0x2c')](_0x1c6fb6,_0xd81d('0x29'));_0x2910b7[_0xd81d('0x32')]=_[_0xd81d('0x33')](_0x3e19ef[_0xd81d('0x32')]);_0x2910b7[_0xd81d('0x34')]=_[_0xd81d('0x35')](_0x2910b7['model'],_0x2910b7[_0xd81d('0x32')]);_0x3081ef[_0xd81d('0x36')]=_[_0xd81d('0x35')](_0x2910b7[_0xd81d('0x31')],qs[_0xd81d('0x37')](_0x3e19ef[_0xd81d('0x32')][_0xd81d('0x37')]));_0x3081ef[_0xd81d('0x36')]=_0x3081ef[_0xd81d('0x36')][_0xd81d('0x38')]?_0x3081ef[_0xd81d('0x36')]:_0x2910b7[_0xd81d('0x31')];if(!_0x3e19ef[_0xd81d('0x32')][_0xd81d('0x39')](_0xd81d('0x3a'))){_0x3081ef['limit']=qs['limit'](_0x3e19ef[_0xd81d('0x32')]['limit']);_0x3081ef[_0xd81d('0x1d')]=qs['offset'](_0x3e19ef[_0xd81d('0x32')][_0xd81d('0x1d')]);}_0x3081ef[_0xd81d('0x3b')]=qs[_0xd81d('0x3c')](_0x3e19ef[_0xd81d('0x32')]['sort']);_0x3081ef[_0xd81d('0x3d')]=qs[_0xd81d('0x34')](_[_0xd81d('0x3e')](_0x3e19ef[_0xd81d('0x32')],_0x2910b7[_0xd81d('0x34')]),_0x1c6fb6);if(_0x3e19ef[_0xd81d('0x32')][_0xd81d('0x3f')]){_0x3081ef[_0xd81d('0x3d')]=_[_0xd81d('0x40')](_0x3081ef['where'],{'$or':_['map'](_0x1c6fb6,function(_0x53c5d9){if(_0x53c5d9[_0xd81d('0x2f')]!==_0xd81d('0x41')){var _0x23b03d={};_0x23b03d[_0x53c5d9[_0xd81d('0x29')]]={'$like':'%'+_0x3e19ef['query'][_0xd81d('0x3f')]+'%'};return _0x23b03d;}})});}_0x3081ef=_['merge']({},_0x3081ef,_0x3e19ef[_0xd81d('0x42')]);var _0x3416ac={'where':_0x3081ef[_0xd81d('0x3d')]};return db[_0xd81d('0x2d')][_0xd81d('0x1f')](_0x3416ac)[_0xd81d('0x25')](function(_0x5f1e80){_0x4addc4[_0xd81d('0x1f')]=_0x5f1e80;if(_0x3e19ef[_0xd81d('0x32')][_0xd81d('0x43')]){_0x3081ef[_0xd81d('0x44')]=[{'all':!![]}];}return db[_0xd81d('0x2d')][_0xd81d('0x45')](_0x3081ef);})['then'](function(_0x4a8d74){_0x4addc4[_0xd81d('0x46')]=_0x4a8d74;return _0x4addc4;})[_0xd81d('0x25')](respondWithFilteredResult(_0x5083f0,_0x3081ef))['catch'](handleError(_0x5083f0,null));};exports[_0xd81d('0x47')]=function(_0x2d75b1,_0x5b8516){var _0x481e1a={'raw':![],'where':{'id':_0x2d75b1[_0xd81d('0x48')]['id']}},_0x241f67={};_0x241f67[_0xd81d('0x31')]=_[_0xd81d('0x33')](db[_0xd81d('0x2d')]['rawAttributes']);_0x241f67['query']=_[_0xd81d('0x33')](_0x2d75b1['query']);_0x241f67[_0xd81d('0x34')]=_[_0xd81d('0x35')](_0x241f67['model'],_0x241f67[_0xd81d('0x32')]);_0x481e1a[_0xd81d('0x36')]=_['intersection'](_0x241f67['model'],qs[_0xd81d('0x37')](_0x2d75b1[_0xd81d('0x32')]['fields']));_0x481e1a[_0xd81d('0x36')]=_0x481e1a['attributes'][_0xd81d('0x38')]?_0x481e1a['attributes']:_0x241f67[_0xd81d('0x31')];if(_0x2d75b1['query'][_0xd81d('0x43')]){_0x481e1a[_0xd81d('0x44')]=[{'all':!![]}];}_0x481e1a=_[_0xd81d('0x40')]({},_0x481e1a,_0x2d75b1[_0xd81d('0x42')]);return db[_0xd81d('0x2d')][_0xd81d('0x49')](_0x481e1a)[_0xd81d('0x25')](handleEntityNotFound(_0x5b8516,null))['then'](respondWithResult(_0x5b8516,null))[_0xd81d('0x4a')](handleError(_0x5b8516,null));};exports[_0xd81d('0x4b')]=function(_0x580bbb,_0x337897){return db[_0xd81d('0x2d')]['create'](_0x580bbb[_0xd81d('0x4c')],{})[_0xd81d('0x25')](respondWithResult(_0x337897,0xc9))[_0xd81d('0x4a')](handleError(_0x337897,null));};exports['update']=function(_0x450972,_0xfd352a){if(_0x450972[_0xd81d('0x4c')]['id']){delete _0x450972['body']['id'];}return db[_0xd81d('0x2d')][_0xd81d('0x49')]({'where':{'id':_0x450972[_0xd81d('0x48')]['id']}})[_0xd81d('0x25')](handleEntityNotFound(_0xfd352a,null))[_0xd81d('0x25')](saveUpdates(_0x450972[_0xd81d('0x4c')],null))[_0xd81d('0x25')](respondWithResult(_0xfd352a,null))[_0xd81d('0x4a')](handleError(_0xfd352a,null));};exports[_0xd81d('0x26')]=function(_0x2a69fb,_0x33b268){return db[_0xd81d('0x2d')][_0xd81d('0x49')]({'where':{'id':_0x2a69fb[_0xd81d('0x48')]['id']}})[_0xd81d('0x25')](handleEntityNotFound(_0x33b268,null))[_0xd81d('0x25')](removeEntity(_0x33b268,null))[_0xd81d('0x4a')](handleError(_0x33b268,null));};exports[_0xd81d('0x4d')]=function(_0x44c034,_0x4a5c9f,_0x2c4f00){var _0x58c051={};var _0x16a15e={};var _0x119e53;var _0x3c07dd;return db[_0xd81d('0x2d')]['findOne']({'where':{'id':_0x44c034[_0xd81d('0x48')]['id']}})[_0xd81d('0x25')](handleEntityNotFound(_0x4a5c9f,null))['then'](function(_0x316264){if(_0x316264){_0x119e53=_0x316264;_0x16a15e[_0xd81d('0x31')]=_[_0xd81d('0x33')](db['ServicenowConfiguration'][_0xd81d('0x4e')]);_0x16a15e[_0xd81d('0x32')]=_['keys'](_0x44c034[_0xd81d('0x32')]);_0x16a15e[_0xd81d('0x34')]=_[_0xd81d('0x35')](_0x16a15e[_0xd81d('0x31')],_0x16a15e[_0xd81d('0x32')]);_0x58c051[_0xd81d('0x36')]=_[_0xd81d('0x35')](_0x16a15e[_0xd81d('0x31')],qs['fields'](_0x44c034[_0xd81d('0x32')][_0xd81d('0x37')]));_0x58c051[_0xd81d('0x36')]=_0x58c051[_0xd81d('0x36')][_0xd81d('0x38')]?_0x58c051[_0xd81d('0x36')]:_0x16a15e['model'];_0x58c051['order']=qs[_0xd81d('0x3c')](_0x44c034['query']['sort']);_0x58c051[_0xd81d('0x3d')]=qs['filters'](_['pick'](_0x44c034[_0xd81d('0x32')],_0x16a15e[_0xd81d('0x34')]));if(_0x44c034['query'][_0xd81d('0x3f')]){_0x58c051[_0xd81d('0x3d')]=_[_0xd81d('0x40')](_0x58c051['where'],{'$or':_[_0xd81d('0x2c')](_0x58c051['attributes'],function(_0x12c6ec){var _0x3ff33a={};_0x3ff33a[_0x12c6ec]={'$like':'%'+_0x44c034[_0xd81d('0x32')][_0xd81d('0x3f')]+'%'};return _0x3ff33a;})});}_0x58c051=_[_0xd81d('0x40')]({},_0x58c051,_0x44c034[_0xd81d('0x42')]);return _0x119e53[_0xd81d('0x4d')](_0x58c051);}})[_0xd81d('0x25')](function(_0x159531){if(_0x159531){_0x3c07dd=_0x159531[_0xd81d('0x38')];if(!_0x44c034[_0xd81d('0x32')][_0xd81d('0x39')]('nolimit')){_0x58c051['limit']=qs['limit'](_0x44c034[_0xd81d('0x32')][_0xd81d('0x4f')]);_0x58c051[_0xd81d('0x1d')]=qs[_0xd81d('0x1d')](_0x44c034[_0xd81d('0x32')][_0xd81d('0x1d')]);}return _0x119e53[_0xd81d('0x4d')](_0x58c051);}})[_0xd81d('0x25')](function(_0x4422e2){if(_0x4422e2){return _0x4422e2?{'count':_0x3c07dd,'rows':_0x4422e2}:null;}})['then'](respondWithResult(_0x4a5c9f,null))[_0xd81d('0x4a')](handleError(_0x4a5c9f,null));};exports[_0xd81d('0x50')]=function(_0xb2b7ef,_0x42a324,_0x2bee56){if(_0xb2b7ef['body']['id']){delete _0xb2b7ef[_0xd81d('0x4c')]['id'];}return db[_0xd81d('0x2d')][_0xd81d('0x51')]({'where':{'id':_0xb2b7ef[_0xd81d('0x48')]['id']}})[_0xd81d('0x25')](handleEntityNotFound(_0x42a324,null))[_0xd81d('0x25')](function(_0x4f5bb1){if(_0x4f5bb1){_0xb2b7ef[_0xd81d('0x4c')][_0xd81d('0x52')]=_0x4f5bb1['id'];_0xb2b7ef['body'][_0xd81d('0x53')]=integrations[_0xd81d('0x54')](_0xb2b7ef[_0xd81d('0x4c')]['channel'],_0xb2b7ef[_0xd81d('0x4c')][_0xd81d('0x2f')]);_0xb2b7ef[_0xd81d('0x4c')][_0xd81d('0x55')]=integrations[_0xd81d('0x56')](_0xb2b7ef[_0xd81d('0x4c')]['channel'],_0xb2b7ef[_0xd81d('0x4c')]['type']);return db['ServicenowConfiguration']['create'](_0xb2b7ef[_0xd81d('0x4c')],{'include':[{'model':db[_0xd81d('0x57')],'as':_0xd81d('0x53')},{'model':db[_0xd81d('0x57')],'as':'Descriptions'}]});}return null;})[_0xd81d('0x25')](respondWithResult(_0x42a324,null))['catch'](handleError(_0x42a324,null));};exports['getFields']=function(_0x5d1b88,_0x2b7efe,_0x2f0871){var _0x5c701a=[_0xd81d('0x58'),'hold_reason',_0xd81d('0x59'),_0xd81d('0x5a'),'close_code',_0xd81d('0x5b'),_0xd81d('0x5c'),'severity',_0xd81d('0x5d')];var _0x3640b5=[_0xd81d('0x5e'),'made_sla',_0xd81d('0x5f'),_0xd81d('0x60'),_0xd81d('0x61'),_0xd81d('0x62'),_0xd81d('0x63'),_0xd81d('0x64'),_0xd81d('0x65'),'number',_0xd81d('0x66'),'sys_updated_by',_0xd81d('0x67'),_0xd81d('0x68'),_0xd81d('0x69'),_0xd81d('0x6a'),'state',_0xd81d('0x6b'),_0xd81d('0x59'),_0xd81d('0x3b'),_0xd81d('0x6c'),_0xd81d('0x6d'),_0xd81d('0x6e'),_0xd81d('0x6f'),'impact','active',_0xd81d('0x70'),'business_service',_0xd81d('0x71'),_0xd81d('0x72'),'rfc',_0xd81d('0x73'),_0xd81d('0x74'),'opened_at','business_duration','group_list',_0xd81d('0x75'),'reopened_time',_0xd81d('0x76'),_0xd81d('0x77'),_0xd81d('0x78'),_0xd81d('0x5a'),'work_notes',_0xd81d('0x79'),_0xd81d('0x7a'),_0xd81d('0x7b'),_0xd81d('0x7c'),_0xd81d('0x7d'),'assignment_group',_0xd81d('0x7e'),_0xd81d('0x7f'),'description',_0xd81d('0x80'),_0xd81d('0x5b'),'sys_class_name',_0xd81d('0x81'),_0xd81d('0x82'),'follow_up','parent_incident',_0xd81d('0x83'),_0xd81d('0x84'),_0xd81d('0x85'),_0xd81d('0x5c'),_0xd81d('0x86'),_0xd81d('0x87'),'company','reassignment_count',_0xd81d('0x88'),'assigned_to',_0xd81d('0x89'),'comments',_0xd81d('0x8a'),'approval',_0xd81d('0x8b'),_0xd81d('0x8c'),_0xd81d('0x8d'),_0xd81d('0x8e'),_0xd81d('0x8f'),_0xd81d('0x90'),'upon_approval','correlation_id','location',_0xd81d('0x5d')];var _0x1d71c3='';var _0x59fbc6='';var _0x3eee6d=[];var _0x906c0b='';var _0x1a7aa3='';var _0x2244af=[];var _0x513757='';var _0x3f598b='';var _0x5ae9a1={};var _0x44c1d5='';return db['ServicenowAccount'][_0xd81d('0x51')]({'where':{'id':_0x5d1b88['params']['id']},'attributes':['id','username',_0xd81d('0x91'),_0xd81d('0x92'),_0xd81d('0x93'),_0xd81d('0x94')]})[_0xd81d('0x25')](handleEntityNotFound(_0x2b7efe,null))['then'](function(_0x207ad2){if(_0x207ad2){_0x44c1d5=_0x207ad2[_0xd81d('0x93')];var _0x157dee=_0x44c1d5['slice'](-0x1);if(_0x157dee==='/'){_0x44c1d5=_0x44c1d5[_0xd81d('0x95')](0x0,_0x44c1d5[_0xd81d('0x96')](_0x157dee));}_0x3f598b=util[_0xd81d('0x97')](_0xd81d('0x98'),_0x44c1d5);_0x513757=util[_0xd81d('0x97')](_0xd81d('0x99'),_0x44c1d5);_0x5ae9a1={'user':_0x207ad2[_0xd81d('0x9a')],'pass':_0x207ad2[_0xd81d('0x91')]};var _0xb8ec3d={'method':'GET','uri':_0x3f598b+_0xd81d('0x9b'),'auth':_0x5ae9a1,'json':!![]};return rp(_0xb8ec3d);}})[_0xd81d('0x25')](function(_0x294515){if(_0x294515['result'][_0xd81d('0x38')]>0x0){_0x1d71c3=_0x294515[_0xd81d('0x9c')];}console[_0xd81d('0x9d')](_0xd81d('0x9e'),_0x1d71c3);_0x2244af=[];_0x59fbc6=Object[_0xd81d('0x9f')]([],_0x1d71c3);_['remove'](_0x59fbc6,function(_0x5d21b2){return!_0x5c701a[_0xd81d('0xa0')](_0x5d21b2[_0xd81d('0x29')]);});_0x59fbc6[_0xd81d('0xa1')](function(_0x436820){var _0x3a235b=createFieldObject(_0x513757,_0x5ae9a1,_0x436820[_0xd81d('0xa2')],_0x436820[_0xd81d('0x29')],_0x436820[_0xd81d('0xa3')],![]);_0x2244af[_0xd81d('0xa4')](_0x3a235b);});return Promise[_0xd81d('0xa5')](_0x2244af);})[_0xd81d('0x25')](function(_0x2f9175){_0x3eee6d=_0x2f9175;_0x906c0b=Object[_0xd81d('0x9f')]([],_0x1d71c3);console[_0xd81d('0x9d')](_0xd81d('0xa6'),_0x1d71c3);_[_0xd81d('0xa7')](_0x906c0b,function(_0x1602a6){return _0x3640b5[_0xd81d('0xa0')](_0x1602a6[_0xd81d('0x29')]);});console[_0xd81d('0x9d')](_0xd81d('0xa8'),_0x906c0b);_0x2244af=[];_0x906c0b['forEach'](function(_0x15b4a2){var _0x497b16=createFieldObject(_0x513757,_0x5ae9a1,_0x15b4a2[_0xd81d('0xa2')],_0x15b4a2[_0xd81d('0x29')],_0x15b4a2[_0xd81d('0xa3')],!![]);_0x2244af[_0xd81d('0xa4')](_0x497b16);});return Promise[_0xd81d('0xa5')](_0x2244af);})[_0xd81d('0x25')](function(_0x192af7){_0x1a7aa3=_0x192af7;var _0x29b238=_0x3eee6d[_0xd81d('0xa9')](_0x1a7aa3);return{'count':_0x29b238[_0xd81d('0x38')],'rows':_0x29b238};})[_0xd81d('0x25')](respondWithResult(_0x2b7efe,null))['catch'](function(_0x32ad24){console[_0xd81d('0x9d')](_0xd81d('0xaa')+_0x32ad24);var _0x324bb=_0x5d1b88[_0xd81d('0x32')][_0xd81d('0xab')]?0x1f4:_0x32ad24['statusCode']||0x1f4;logger['error'](_0x32ad24[_0xd81d('0x28')]);delete _0x32ad24[_0xd81d('0x29')];if(_0x324bb===0x191){_0x324bb=0x190;}_0x2b7efe[_0xd81d('0x1a')](_0x324bb)['send'](_0x5d1b88['query']['test']?{'message':_0xd81d('0xac'),'statusCode':_0x32ad24['statusCode']}:_0x32ad24);});};function createFieldObject(_0x53ec7b,_0x10fd44,_0x5b05f8,_0x421da2,_0x19cf11,_0x25cd02){return new Promise(function(_0x504d34,_0x585fed){var _0x25c125={'id':_0x421da2,'name':_0x19cf11,'custom':_0x25cd02};if(_0x5b05f8===_0xd81d('0xad')){_0x25c125['options']=[{'name':_0xd81d('0xae'),'value':_0xd81d('0xaf')},{'name':_0xd81d('0xb0'),'value':_0xd81d('0xb1')}];_0x504d34(_0x25c125);}else{var _0xeecb2e={'method':'GET','uri':_0x53ec7b+'sys_choice?sysparm_query=name=incident^element='+_0x421da2,'auth':_0x10fd44,'json':!![]};return rp(_0xeecb2e)['then'](function(_0x5285e5){var _0x48caa8=[];if(_0x5285e5[_0xd81d('0x9c')][_0xd81d('0x38')]>0x0){_0x5285e5['result'][_0xd81d('0xa1')](function(_0x1e4324){if(_0x1e4324[_0xd81d('0xb2')]===_0xd81d('0xb1')){var _0x120811={'name':_0x1e4324[_0xd81d('0xa3')],'value':_0x1e4324[_0xd81d('0xb3')]};_0x48caa8['push'](_0x120811);}});}_0x25c125[_0xd81d('0x42')]=_0x48caa8;if(_0x25c125['options'][_0xd81d('0x38')]>0x0){_0x504d34(_0x25c125);}else{if(_0x25cd02==![]){_0x504d34();}else{_0x504d34(_0x25c125);}}});}});}
\ No newline at end of file
+var _0x4109=['cmdb_ci','delivery_plan','impact','active','work_notes_list','business_service','priority','sys_domain_path','expected_start','opened_at','business_duration','group_list','work_end','resolved_at','caller_id','subcategory','work_notes','short_description','correlation_display','delivery_task','work_start','assignment_group','additional_assignee_list','description','calendar_duration','sys_class_name','close_notes','closed_by','follow_up','sys_id','contact_type','reopened_by','urgency','problem_id','company','reassignment_count','activity_due','assigned_to','comments','sla_due','approval','comments_and_work_notes','due_date','sys_mod_count','reopen_count','escalation','upon_approval','correlation_id','location','email','remoteUri','slice','lastIndexOf','format','%s/api/now/table/','password','GET','result','incident\x20table\x20objects','assign','remove','includes','forEach','label','push','all','log','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','concat','ServiceNow\x20error:\x20','statusCode','send','test','False','false','sys_choice?sysparm_query=name=incident^element=','inactive','value','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','undefined','limit','offset','count','set','Content-Range','apply','reject','update','then','destroy','end','error','stack','name','index','map','ServicenowAccount','fieldName','type','key','model','query','intersection','attributes','length','hasOwnProperty','nolimit','sort','where','filters','merge','VIRTUAL','filter','options','include','findAll','show','params','keys','rawAttributes','fields','includeAll','create','body','find','catch','getConfigurations','order','pick','addConfiguration','findOne','AccountId','Subjects','Descriptions','getDescriptions','ServicenowField','getFields','made_sla','close_code','notify','incident_state','severity','parent','caused_by','upon_reject','sys_updated_on','hold_reason','number','resolved_by','sys_updated_by','opened_by','sys_created_on','sys_domain','state','sys_created_by','calendar_stc','closed_at'];(function(_0x5be677,_0x43ce21){var _0x54e9ca=function(_0x42d5dc){while(--_0x42d5dc){_0x5be677['push'](_0x5be677['shift']());}};_0x54e9ca(++_0x43ce21);}(_0x4109,0x10a));var _0x9410=function(_0x5dd75d,_0x34a12c){_0x5dd75d=_0x5dd75d-0x0;var _0xd3788a=_0x4109[_0x5dd75d];return _0xd3788a;};'use strict';var emlformat=require(_0x9410('0x0'));var rimraf=require(_0x9410('0x1'));var zipdir=require(_0x9410('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9410('0x3'));var moment=require(_0x9410('0x4'));var BPromise=require(_0x9410('0x5'));var Mustache=require(_0x9410('0x6'));var util=require(_0x9410('0x7'));var path=require(_0x9410('0x8'));var sox=require(_0x9410('0x9'));var csv=require('to-csv');var ejs=require(_0x9410('0xa'));var fs=require('fs');var fs_extra=require(_0x9410('0xb'));var _=require(_0x9410('0xc'));var squel=require('squel');var crypto=require(_0x9410('0xd'));var jsforce=require(_0x9410('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x9410('0xf'));var querystring=require(_0x9410('0x10'));var Papa=require(_0x9410('0x11'));var Redis=require(_0x9410('0x12'));var authService=require(_0x9410('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x9410('0x14'));var hardwareService=require(_0x9410('0x15'));var logger=require(_0x9410('0x16'))('api');var utils=require(_0x9410('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x9410('0x18'));var db=require(_0x9410('0x19'))['db'];var integrations=require(_0x9410('0x1a'));function respondWithStatusCode(_0x5d7238,_0x723fff){_0x723fff=_0x723fff||0xcc;return function(_0x1b2c59){if(_0x1b2c59){return _0x5d7238[_0x9410('0x1b')](_0x723fff);}return _0x5d7238[_0x9410('0x1c')](_0x723fff)['end']();};}function respondWithResult(_0x5d04be,_0x59dea5){_0x59dea5=_0x59dea5||0xc8;return function(_0xfeea30){if(_0xfeea30){return _0x5d04be['status'](_0x59dea5)[_0x9410('0x1d')](_0xfeea30);}};}function respondWithFilteredResult(_0x3e78c3,_0x5d76b2){return function(_0x50f52b){if(_0x50f52b){var _0x4d6fd6=typeof _0x5d76b2['offset']===_0x9410('0x1e')&&typeof _0x5d76b2[_0x9410('0x1f')]===_0x9410('0x1e');var _0x11831e=_0x50f52b['count'];var _0x4b3359=_0x4d6fd6?0x0:_0x5d76b2[_0x9410('0x20')];var _0x3a95d8=_0x4d6fd6?_0x50f52b[_0x9410('0x21')]:_0x5d76b2[_0x9410('0x20')]+_0x5d76b2[_0x9410('0x1f')];var _0x15dc3c;if(_0x3a95d8>=_0x11831e){_0x3a95d8=_0x11831e;_0x15dc3c=0xc8;}else{_0x15dc3c=0xce;}_0x3e78c3[_0x9410('0x1c')](_0x15dc3c);return _0x3e78c3[_0x9410('0x22')](_0x9410('0x23'),_0x4b3359+'-'+_0x3a95d8+'/'+_0x11831e)['json'](_0x50f52b);}return null;};}function patchUpdates(_0x521021){return function(_0x2fa6b8){try{jsonpatch[_0x9410('0x24')](_0x2fa6b8,_0x521021,!![]);}catch(_0x2270e3){return BPromise[_0x9410('0x25')](_0x2270e3);}return _0x2fa6b8['save']();};}function saveUpdates(_0x41d218,_0x557b5d){return function(_0x40be36){if(_0x40be36){return _0x40be36[_0x9410('0x26')](_0x41d218)[_0x9410('0x27')](function(_0x3fc167){return _0x3fc167;});}return null;};}function removeEntity(_0x64696e,_0x5da0c1){return function(_0x2fc822){if(_0x2fc822){return _0x2fc822[_0x9410('0x28')]()[_0x9410('0x27')](function(){_0x64696e[_0x9410('0x1c')](0xcc)[_0x9410('0x29')]();});}};}function handleEntityNotFound(_0x5ed60b,_0x20ff1c){return function(_0x58d514){if(!_0x58d514){_0x5ed60b[_0x9410('0x1b')](0x194);}return _0x58d514;};}function handleError(_0x5d6b3b,_0x19b862){_0x19b862=_0x19b862||0x1f4;return function(_0x36ed64){logger[_0x9410('0x2a')](_0x36ed64[_0x9410('0x2b')]);if(_0x36ed64['name']){delete _0x36ed64[_0x9410('0x2c')];}_0x5d6b3b[_0x9410('0x1c')](_0x19b862)['send'](_0x36ed64);};}exports[_0x9410('0x2d')]=function(_0x1cb779,_0x21fefa){var _0x5ac0fe={},_0x226099={},_0x167572={'count':0x0,'rows':[]};var _0x4fb03b=_[_0x9410('0x2e')](db[_0x9410('0x2f')]['rawAttributes'],function(_0x56f44d){return{'name':_0x56f44d[_0x9410('0x30')],'type':_0x56f44d[_0x9410('0x31')][_0x9410('0x32')]};});_0x226099[_0x9410('0x33')]=_[_0x9410('0x2e')](_0x4fb03b,_0x9410('0x2c'));_0x226099['query']=_['keys'](_0x1cb779[_0x9410('0x34')]);_0x226099['filters']=_[_0x9410('0x35')](_0x226099['model'],_0x226099[_0x9410('0x34')]);_0x5ac0fe[_0x9410('0x36')]=_[_0x9410('0x35')](_0x226099[_0x9410('0x33')],qs['fields'](_0x1cb779[_0x9410('0x34')]['fields']));_0x5ac0fe[_0x9410('0x36')]=_0x5ac0fe[_0x9410('0x36')][_0x9410('0x37')]?_0x5ac0fe[_0x9410('0x36')]:_0x226099['model'];if(!_0x1cb779[_0x9410('0x34')][_0x9410('0x38')](_0x9410('0x39'))){_0x5ac0fe[_0x9410('0x1f')]=qs[_0x9410('0x1f')](_0x1cb779[_0x9410('0x34')][_0x9410('0x1f')]);_0x5ac0fe['offset']=qs[_0x9410('0x20')](_0x1cb779[_0x9410('0x34')][_0x9410('0x20')]);}_0x5ac0fe['order']=qs[_0x9410('0x3a')](_0x1cb779[_0x9410('0x34')][_0x9410('0x3a')]);_0x5ac0fe[_0x9410('0x3b')]=qs[_0x9410('0x3c')](_['pick'](_0x1cb779[_0x9410('0x34')],_0x226099[_0x9410('0x3c')]),_0x4fb03b);if(_0x1cb779[_0x9410('0x34')]['filter']){_0x5ac0fe[_0x9410('0x3b')]=_[_0x9410('0x3d')](_0x5ac0fe[_0x9410('0x3b')],{'$or':_[_0x9410('0x2e')](_0x4fb03b,function(_0xfdbe36){if(_0xfdbe36[_0x9410('0x31')]!==_0x9410('0x3e')){var _0x411183={};_0x411183[_0xfdbe36[_0x9410('0x2c')]]={'$like':'%'+_0x1cb779['query'][_0x9410('0x3f')]+'%'};return _0x411183;}})});}_0x5ac0fe=_['merge']({},_0x5ac0fe,_0x1cb779[_0x9410('0x40')]);var _0x44b7f9={'where':_0x5ac0fe['where']};return db[_0x9410('0x2f')]['count'](_0x44b7f9)[_0x9410('0x27')](function(_0x25c1ee){_0x167572[_0x9410('0x21')]=_0x25c1ee;if(_0x1cb779[_0x9410('0x34')]['includeAll']){_0x5ac0fe[_0x9410('0x41')]=[{'all':!![]}];}return db[_0x9410('0x2f')][_0x9410('0x42')](_0x5ac0fe);})[_0x9410('0x27')](function(_0x13952d){_0x167572['rows']=_0x13952d;return _0x167572;})['then'](respondWithFilteredResult(_0x21fefa,_0x5ac0fe))['catch'](handleError(_0x21fefa,null));};exports[_0x9410('0x43')]=function(_0x35478f,_0x1011b1){var _0x5de3d4={'raw':![],'where':{'id':_0x35478f[_0x9410('0x44')]['id']}},_0x4e4950={};_0x4e4950[_0x9410('0x33')]=_[_0x9410('0x45')](db[_0x9410('0x2f')][_0x9410('0x46')]);_0x4e4950[_0x9410('0x34')]=_[_0x9410('0x45')](_0x35478f['query']);_0x4e4950[_0x9410('0x3c')]=_[_0x9410('0x35')](_0x4e4950[_0x9410('0x33')],_0x4e4950[_0x9410('0x34')]);_0x5de3d4[_0x9410('0x36')]=_[_0x9410('0x35')](_0x4e4950[_0x9410('0x33')],qs['fields'](_0x35478f[_0x9410('0x34')][_0x9410('0x47')]));_0x5de3d4['attributes']=_0x5de3d4[_0x9410('0x36')]['length']?_0x5de3d4[_0x9410('0x36')]:_0x4e4950[_0x9410('0x33')];if(_0x35478f[_0x9410('0x34')][_0x9410('0x48')]){_0x5de3d4[_0x9410('0x41')]=[{'all':!![]}];}_0x5de3d4=_[_0x9410('0x3d')]({},_0x5de3d4,_0x35478f[_0x9410('0x40')]);return db[_0x9410('0x2f')]['find'](_0x5de3d4)[_0x9410('0x27')](handleEntityNotFound(_0x1011b1,null))[_0x9410('0x27')](respondWithResult(_0x1011b1,null))['catch'](handleError(_0x1011b1,null));};exports[_0x9410('0x49')]=function(_0x4df576,_0x54103b){return db[_0x9410('0x2f')][_0x9410('0x49')](_0x4df576['body'],{})[_0x9410('0x27')](respondWithResult(_0x54103b,0xc9))['catch'](handleError(_0x54103b,null));};exports[_0x9410('0x26')]=function(_0xcc3762,_0xc46e4e){if(_0xcc3762[_0x9410('0x4a')]['id']){delete _0xcc3762['body']['id'];}return db[_0x9410('0x2f')][_0x9410('0x4b')]({'where':{'id':_0xcc3762[_0x9410('0x44')]['id']}})['then'](handleEntityNotFound(_0xc46e4e,null))[_0x9410('0x27')](saveUpdates(_0xcc3762['body'],null))['then'](respondWithResult(_0xc46e4e,null))[_0x9410('0x4c')](handleError(_0xc46e4e,null));};exports[_0x9410('0x28')]=function(_0x3b42ec,_0x145098){return db[_0x9410('0x2f')][_0x9410('0x4b')]({'where':{'id':_0x3b42ec[_0x9410('0x44')]['id']}})[_0x9410('0x27')](handleEntityNotFound(_0x145098,null))[_0x9410('0x27')](removeEntity(_0x145098,null))[_0x9410('0x4c')](handleError(_0x145098,null));};exports[_0x9410('0x4d')]=function(_0x5379c5,_0x5af622,_0x4b0e91){var _0x90bb37={};var _0x4f406f={};var _0xf84eac;var _0x1291ec;return db[_0x9410('0x2f')]['findOne']({'where':{'id':_0x5379c5[_0x9410('0x44')]['id']}})[_0x9410('0x27')](handleEntityNotFound(_0x5af622,null))[_0x9410('0x27')](function(_0x341d72){if(_0x341d72){_0xf84eac=_0x341d72;_0x4f406f[_0x9410('0x33')]=_['keys'](db['ServicenowConfiguration']['rawAttributes']);_0x4f406f['query']=_[_0x9410('0x45')](_0x5379c5[_0x9410('0x34')]);_0x4f406f[_0x9410('0x3c')]=_[_0x9410('0x35')](_0x4f406f[_0x9410('0x33')],_0x4f406f['query']);_0x90bb37[_0x9410('0x36')]=_[_0x9410('0x35')](_0x4f406f['model'],qs[_0x9410('0x47')](_0x5379c5[_0x9410('0x34')][_0x9410('0x47')]));_0x90bb37['attributes']=_0x90bb37[_0x9410('0x36')][_0x9410('0x37')]?_0x90bb37[_0x9410('0x36')]:_0x4f406f[_0x9410('0x33')];_0x90bb37[_0x9410('0x4e')]=qs['sort'](_0x5379c5[_0x9410('0x34')][_0x9410('0x3a')]);_0x90bb37['where']=qs[_0x9410('0x3c')](_[_0x9410('0x4f')](_0x5379c5[_0x9410('0x34')],_0x4f406f[_0x9410('0x3c')]));if(_0x5379c5[_0x9410('0x34')][_0x9410('0x3f')]){_0x90bb37[_0x9410('0x3b')]=_[_0x9410('0x3d')](_0x90bb37[_0x9410('0x3b')],{'$or':_[_0x9410('0x2e')](_0x90bb37[_0x9410('0x36')],function(_0x1ee8f2){var _0x4a5ad4={};_0x4a5ad4[_0x1ee8f2]={'$like':'%'+_0x5379c5[_0x9410('0x34')]['filter']+'%'};return _0x4a5ad4;})});}_0x90bb37=_['merge']({},_0x90bb37,_0x5379c5['options']);return _0xf84eac['getConfigurations'](_0x90bb37);}})[_0x9410('0x27')](function(_0x4019de){if(_0x4019de){_0x1291ec=_0x4019de['length'];if(!_0x5379c5['query'][_0x9410('0x38')](_0x9410('0x39'))){_0x90bb37[_0x9410('0x1f')]=qs['limit'](_0x5379c5[_0x9410('0x34')][_0x9410('0x1f')]);_0x90bb37[_0x9410('0x20')]=qs[_0x9410('0x20')](_0x5379c5[_0x9410('0x34')][_0x9410('0x20')]);}return _0xf84eac[_0x9410('0x4d')](_0x90bb37);}})[_0x9410('0x27')](function(_0x55d8fe){if(_0x55d8fe){return _0x55d8fe?{'count':_0x1291ec,'rows':_0x55d8fe}:null;}})['then'](respondWithResult(_0x5af622,null))[_0x9410('0x4c')](handleError(_0x5af622,null));};exports[_0x9410('0x50')]=function(_0x5983ff,_0x45fb3d,_0x4e15c8){if(_0x5983ff[_0x9410('0x4a')]['id']){delete _0x5983ff[_0x9410('0x4a')]['id'];}return db['ServicenowAccount'][_0x9410('0x51')]({'where':{'id':_0x5983ff['params']['id']}})[_0x9410('0x27')](handleEntityNotFound(_0x45fb3d,null))['then'](function(_0x4b2279){if(_0x4b2279){_0x5983ff[_0x9410('0x4a')][_0x9410('0x52')]=_0x4b2279['id'];_0x5983ff[_0x9410('0x4a')][_0x9410('0x53')]=integrations['getSubjects'](_0x5983ff[_0x9410('0x4a')]['channel'],_0x5983ff['body'][_0x9410('0x31')]);_0x5983ff[_0x9410('0x4a')][_0x9410('0x54')]=integrations[_0x9410('0x55')](_0x5983ff[_0x9410('0x4a')]['channel'],_0x5983ff[_0x9410('0x4a')][_0x9410('0x31')]);return db['ServicenowConfiguration'][_0x9410('0x49')](_0x5983ff['body'],{'include':[{'model':db[_0x9410('0x56')],'as':_0x9410('0x53')},{'model':db[_0x9410('0x56')],'as':_0x9410('0x54')}]});}return null;})['then'](respondWithResult(_0x45fb3d,null))['catch'](handleError(_0x45fb3d,null));};exports[_0x9410('0x57')]=function(_0x247f18,_0x2539b0,_0x54713c){var _0x231b34=[_0x9410('0x58'),'hold_reason','knowledge','subcategory',_0x9410('0x59'),_0x9410('0x5a'),_0x9410('0x5b'),_0x9410('0x5c'),'category'];var _0x24a0c3=[_0x9410('0x5d'),_0x9410('0x58'),_0x9410('0x5e'),'watch_list',_0x9410('0x5f'),_0x9410('0x60'),'child_incidents',_0x9410('0x61'),'approval_history',_0x9410('0x62'),_0x9410('0x63'),_0x9410('0x64'),_0x9410('0x65'),'user_input',_0x9410('0x66'),_0x9410('0x67'),_0x9410('0x68'),_0x9410('0x69'),'knowledge',_0x9410('0x4e'),_0x9410('0x6a'),_0x9410('0x6b'),_0x9410('0x6c'),_0x9410('0x6d'),_0x9410('0x6e'),_0x9410('0x6f'),_0x9410('0x70'),_0x9410('0x71'),_0x9410('0x72'),_0x9410('0x73'),'rfc','time_worked',_0x9410('0x74'),_0x9410('0x75'),_0x9410('0x76'),_0x9410('0x77'),_0x9410('0x78'),'reopened_time',_0x9410('0x79'),_0x9410('0x7a'),'approval_set',_0x9410('0x7b'),_0x9410('0x7c'),_0x9410('0x7d'),_0x9410('0x59'),_0x9410('0x7e'),_0x9410('0x7f'),_0x9410('0x80'),_0x9410('0x81'),'business_stc',_0x9410('0x82'),_0x9410('0x83'),_0x9410('0x84'),_0x9410('0x5a'),_0x9410('0x85'),_0x9410('0x86'),_0x9410('0x87'),_0x9410('0x88'),'parent_incident',_0x9410('0x89'),_0x9410('0x8a'),_0x9410('0x8b'),_0x9410('0x5b'),_0x9410('0x8c'),_0x9410('0x8d'),_0x9410('0x8e'),_0x9410('0x8f'),_0x9410('0x90'),_0x9410('0x91'),'severity',_0x9410('0x92'),_0x9410('0x93'),_0x9410('0x94'),_0x9410('0x95'),_0x9410('0x96'),_0x9410('0x97'),_0x9410('0x98'),'sys_tags',_0x9410('0x99'),_0x9410('0x9a'),_0x9410('0x9b'),_0x9410('0x9c'),'category'];var _0x367f0c='';var _0x443aad='';var _0x412679=[];var _0xe055c0='';var _0x69a02f='';var _0x3eacdb=[];var _0x7c52be='';var _0x117a96='';var _0x32e3ad={};var _0x34f21f='';return db[_0x9410('0x2f')][_0x9410('0x51')]({'where':{'id':_0x247f18[_0x9410('0x44')]['id']},'attributes':['id','username','password',_0x9410('0x9d'),_0x9410('0x9e'),'serverUrl']})[_0x9410('0x27')](handleEntityNotFound(_0x2539b0,null))[_0x9410('0x27')](function(_0x484157){if(_0x484157){_0x34f21f=_0x484157['remoteUri'];var _0x56567b=_0x34f21f[_0x9410('0x9f')](-0x1);if(_0x56567b==='/'){_0x34f21f=_0x34f21f['substring'](0x0,_0x34f21f[_0x9410('0xa0')](_0x56567b));}_0x117a96=util['format']('%s/api/now/doc/table/schema/',_0x34f21f);_0x7c52be=util[_0x9410('0xa1')](_0x9410('0xa2'),_0x34f21f);_0x32e3ad={'user':_0x484157['username'],'pass':_0x484157[_0x9410('0xa3')]};var _0x4b411a={'method':_0x9410('0xa4'),'uri':_0x117a96+'incident?sysparm_display_value=all','auth':_0x32e3ad,'json':!![]};return rp(_0x4b411a);}})[_0x9410('0x27')](function(_0x37536c){if(_0x37536c['result'][_0x9410('0x37')]>0x0){_0x367f0c=_0x37536c[_0x9410('0xa5')];}console['log'](_0x9410('0xa6'),_0x367f0c);_0x3eacdb=[];_0x443aad=Object[_0x9410('0xa7')]([],_0x367f0c);_[_0x9410('0xa8')](_0x443aad,function(_0xb34549){return!_0x231b34[_0x9410('0xa9')](_0xb34549[_0x9410('0x2c')]);});_0x443aad[_0x9410('0xaa')](function(_0x19eabc){var _0x3139e7=createFieldObject(_0x7c52be,_0x32e3ad,_0x19eabc['internalType'],_0x19eabc[_0x9410('0x2c')],_0x19eabc[_0x9410('0xab')],![]);_0x3eacdb[_0x9410('0xac')](_0x3139e7);});return Promise[_0x9410('0xad')](_0x3eacdb);})[_0x9410('0x27')](function(_0x3f8ab2){_0x412679=_0x3f8ab2;_0xe055c0=Object[_0x9410('0xa7')]([],_0x367f0c);console[_0x9410('0xae')](_0x9410('0xaf'),_0x367f0c);_['remove'](_0xe055c0,function(_0x4e4df8){return _0x24a0c3[_0x9410('0xa9')](_0x4e4df8['name']);});console[_0x9410('0xae')](_0x9410('0xb0'),_0xe055c0);_0x3eacdb=[];_0xe055c0[_0x9410('0xaa')](function(_0x32975f){var _0x1f8cc4=createFieldObject(_0x7c52be,_0x32e3ad,_0x32975f['internalType'],_0x32975f['name'],_0x32975f[_0x9410('0xab')],!![]);_0x3eacdb[_0x9410('0xac')](_0x1f8cc4);});return Promise[_0x9410('0xad')](_0x3eacdb);})[_0x9410('0x27')](function(_0xda48f1){_0x69a02f=_0xda48f1;var _0x408e83=_0x412679[_0x9410('0xb1')](_0x69a02f);return{'count':_0x408e83[_0x9410('0x37')],'rows':_0x408e83};})['then'](respondWithResult(_0x2539b0,null))[_0x9410('0x4c')](function(_0x3077ff){console['log'](_0x9410('0xb2')+_0x3077ff);var _0x1f2ca0=_0x247f18[_0x9410('0x34')]['test']?0x1f4:_0x3077ff[_0x9410('0xb3')]||0x1f4;logger[_0x9410('0x2a')](_0x3077ff[_0x9410('0x2b')]);delete _0x3077ff[_0x9410('0x2c')];if(_0x1f2ca0===0x191){_0x1f2ca0=0x190;}_0x2539b0[_0x9410('0x1c')](_0x1f2ca0)[_0x9410('0xb4')](_0x247f18[_0x9410('0x34')][_0x9410('0xb5')]?{'message':'Wrong\x20credentials','statusCode':_0x3077ff[_0x9410('0xb3')]}:_0x3077ff);});};function createFieldObject(_0x26ff73,_0x12e5e2,_0x4455dc,_0x153626,_0xb93bcd,_0x4aea56){return new Promise(function(_0x56af61,_0x298c1a){var _0x404050={'id':_0x153626,'name':_0xb93bcd,'custom':_0x4aea56};if(_0x4455dc==='boolean'){_0x404050['options']=[{'name':'True','value':'true'},{'name':_0x9410('0xb6'),'value':_0x9410('0xb7')}];_0x56af61(_0x404050);}else{var _0x53f531={'method':_0x9410('0xa4'),'uri':_0x26ff73+_0x9410('0xb8')+_0x153626,'auth':_0x12e5e2,'json':!![]};return rp(_0x53f531)[_0x9410('0x27')](function(_0xbdb8a7){var _0x8ffc83=[];if(_0xbdb8a7[_0x9410('0xa5')][_0x9410('0x37')]>0x0){_0xbdb8a7['result'][_0x9410('0xaa')](function(_0x278cce){if(_0x278cce[_0x9410('0xb9')]===_0x9410('0xb7')){var _0x3d5cda={'name':_0x278cce['label'],'value':_0x278cce[_0x9410('0xba')]};_0x8ffc83[_0x9410('0xac')](_0x3d5cda);}});}_0x404050[_0x9410('0x40')]=_0x8ffc83;if(_0x404050[_0x9410('0x40')][_0x9410('0x37')]>0x0){_0x56af61(_0x404050);}else{if(_0x4aea56==![]){_0x56af61();}else{_0x56af61(_0x404050);}}});}});}
\ No newline at end of file
index 5ba48e5..9cdbb71 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x46ed=['bluebird','path','rimraf','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','ServicenowAccount','int_servicenow_accounts','lodash','util','api','moment'];(function(_0x138fe3,_0x9189cf){var _0x3dc19f=function(_0x3e4d3d){while(--_0x3e4d3d){_0x138fe3['push'](_0x138fe3['shift']());}};_0x3dc19f(++_0x9189cf);}(_0x46ed,0x168));var _0xd46e=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0x46ed[_0x2070da];return _0x4f9fe1;};'use strict';var _=require(_0xd46e('0x0'));var util=require(_0xd46e('0x1'));var logger=require('../../config/logger')(_0xd46e('0x2'));var moment=require(_0xd46e('0x3'));var BPromise=require(_0xd46e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd46e('0x5'));var rimraf=require(_0xd46e('0x6'));var config=require('../../config/environment');var attributes=require(_0xd46e('0x7'));var integrations=require(_0xd46e('0x8'));module[_0xd46e('0x9')]=function(_0x25cf78,_0x45e680){return _0x25cf78[_0xd46e('0xa')](_0xd46e('0xb'),attributes,{'tableName':_0xd46e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2675=['path','rimraf','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','int_servicenow_accounts','lodash','moment','bluebird'];(function(_0xef34c5,_0xd17a9d){var _0x1de207=function(_0x3e8169){while(--_0x3e8169){_0xef34c5['push'](_0xef34c5['shift']());}};_0x1de207(++_0xd17a9d);}(_0x2675,0x75));var _0x5267=function(_0x411ee3,_0x4a8b80){_0x411ee3=_0x411ee3-0x0;var _0x2f4597=_0x2675[_0x411ee3];return _0x2f4597;};'use strict';var _=require(_0x5267('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x5267('0x1'));var BPromise=require(_0x5267('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5267('0x3'));var rimraf=require(_0x5267('0x4'));var config=require('../../config/environment');var attributes=require(_0x5267('0x5'));var integrations=require(_0x5267('0x6'));module[_0x5267('0x7')]=function(_0x10f92c,_0x20f065){return _0x10f92c[_0x5267('0x8')]('ServicenowAccount',attributes,{'tableName':_0x5267('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 9b8ddbb..3b925c0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xacc3=['http','request','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','ServicenowAccount','findAll','options','where','attributes','include','map','model','GetServicenowAccount','ShowServicenowAccount','find','raw','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x336e8f,_0xe29509){var _0xcd3a25=function(_0x2a2a43){while(--_0x2a2a43){_0x336e8f['push'](_0x336e8f['shift']());}};_0xcd3a25(++_0xe29509);}(_0xacc3,0x106));var _0x3acc=function(_0xa54031,_0x21531e){_0xa54031=_0xa54031-0x0;var _0x3c201f=_0xacc3[_0xa54031];return _0x3c201f;};'use strict';var _=require(_0x3acc('0x0'));var util=require(_0x3acc('0x1'));var moment=require(_0x3acc('0x2'));var BPromise=require('bluebird');var rs=require(_0x3acc('0x3'));var fs=require('fs');var Redis=require(_0x3acc('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x3acc('0x5'));var logger=require(_0x3acc('0x6'))('rpc');var config=require(_0x3acc('0x7'));var jayson=require(_0x3acc('0x8'));var client=jayson[_0x3acc('0x9')][_0x3acc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3021e6,_0x400248,_0x35a1a9){return new BPromise(function(_0x385673,_0x40421c){return client[_0x3acc('0xb')](_0x3021e6,_0x35a1a9)[_0x3acc('0xc')](function(_0x2db82e){logger[_0x3acc('0xd')](_0x3acc('0xe'),_0x400248,_0x3acc('0xf'));logger[_0x3acc('0x10')](_0x3acc('0x11'),_0x400248,'request\x20sent',JSON[_0x3acc('0x12')](_0x2db82e));if(_0x2db82e[_0x3acc('0x13')]){if(_0x2db82e[_0x3acc('0x13')]['code']===0x1f4){logger[_0x3acc('0x13')](_0x3acc('0xe'),_0x400248,_0x2db82e[_0x3acc('0x13')]['message']);return _0x40421c(_0x2db82e[_0x3acc('0x13')][_0x3acc('0x14')]);}logger[_0x3acc('0x13')]('ServicenowAccount,\x20%s,\x20%s',_0x400248,_0x2db82e[_0x3acc('0x13')][_0x3acc('0x14')]);return _0x385673(_0x2db82e['error'][_0x3acc('0x14')]);}else{logger['info']('ServicenowAccount,\x20%s,\x20%s',_0x400248,_0x3acc('0xf'));_0x385673(_0x2db82e['result'][_0x3acc('0x14')]);}})[_0x3acc('0x15')](function(_0x408347){logger['error'](_0x3acc('0xe'),_0x400248,_0x408347);_0x40421c(_0x408347);});});}exports['GetServicenowAccount']=function(_0x2295e7){var _0x24764c=this;return new Promise(function(_0x4ffef2,_0x1bdf88){return db[_0x3acc('0x16')][_0x3acc('0x17')]({'raw':_0x2295e7[_0x3acc('0x18')]?_0x2295e7['options']['raw']===undefined?!![]:![]:!![],'where':_0x2295e7['options']?_0x2295e7['options'][_0x3acc('0x19')]||null:null,'attributes':_0x2295e7['options']?_0x2295e7[_0x3acc('0x18')][_0x3acc('0x1a')]||null:null,'limit':_0x2295e7[_0x3acc('0x18')]?_0x2295e7[_0x3acc('0x18')]['limit']||null:null,'include':_0x2295e7['options']?_0x2295e7[_0x3acc('0x18')][_0x3acc('0x1b')]?_[_0x3acc('0x1c')](_0x2295e7[_0x3acc('0x18')][_0x3acc('0x1b')],function(_0x1d9555){return{'model':db[_0x1d9555[_0x3acc('0x1d')]],'as':_0x1d9555['as'],'attributes':_0x1d9555['attributes'],'include':_0x1d9555[_0x3acc('0x1b')]?_[_0x3acc('0x1c')](_0x1d9555[_0x3acc('0x1b')],function(_0x579a41){return{'model':db[_0x579a41[_0x3acc('0x1d')]],'as':_0x579a41['as'],'attributes':_0x579a41[_0x3acc('0x1a')],'include':_0x579a41[_0x3acc('0x1b')]?_[_0x3acc('0x1c')](_0x579a41[_0x3acc('0x1b')],function(_0x17d56c){return{'model':db[_0x17d56c[_0x3acc('0x1d')]],'as':_0x17d56c['as'],'attributes':_0x17d56c[_0x3acc('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x3acc('0xc')](function(_0x53fc45){logger[_0x3acc('0xd')](_0x3acc('0x1e'),_0x2295e7);logger[_0x3acc('0x10')](_0x3acc('0x1e'),_0x2295e7,JSON[_0x3acc('0x12')](_0x53fc45));_0x4ffef2(_0x53fc45);})[_0x3acc('0x15')](function(_0x380e83){logger['error'](_0x3acc('0x1e'),_0x380e83['message'],_0x2295e7);_0x1bdf88(_0x24764c[_0x3acc('0x13')](0x1f4,_0x380e83[_0x3acc('0x14')]));});});};exports[_0x3acc('0x1f')]=function(_0x55c891){var _0x2c77a3=this;return new Promise(function(_0x589f87,_0x4a5986){return db['ServicenowAccount'][_0x3acc('0x20')]({'raw':_0x55c891[_0x3acc('0x18')]?_0x55c891[_0x3acc('0x18')][_0x3acc('0x21')]===undefined?!![]:![]:!![],'where':_0x55c891[_0x3acc('0x18')]?_0x55c891[_0x3acc('0x18')][_0x3acc('0x19')]||null:null,'attributes':_0x55c891['options']?_0x55c891[_0x3acc('0x18')][_0x3acc('0x1a')]||null:null,'include':_0x55c891[_0x3acc('0x18')]?_0x55c891[_0x3acc('0x18')][_0x3acc('0x1b')]?_[_0x3acc('0x1c')](_0x55c891[_0x3acc('0x18')][_0x3acc('0x1b')],function(_0x10dee6){return{'model':db[_0x10dee6[_0x3acc('0x1d')]],'as':_0x10dee6['as'],'attributes':_0x10dee6[_0x3acc('0x1a')],'include':_0x10dee6[_0x3acc('0x1b')]?_[_0x3acc('0x1c')](_0x10dee6['include'],function(_0x183c16){return{'model':db[_0x183c16[_0x3acc('0x1d')]],'as':_0x183c16['as'],'attributes':_0x183c16['attributes'],'include':_0x183c16['include']?_[_0x3acc('0x1c')](_0x183c16[_0x3acc('0x1b')],function(_0x45e11c){return{'model':db[_0x45e11c['model']],'as':_0x45e11c['as'],'attributes':_0x45e11c[_0x3acc('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x3acc('0xc')](function(_0x3cd8f3){logger[_0x3acc('0xd')](_0x3acc('0x1f'),_0x55c891);logger['debug'](_0x3acc('0x1f'),_0x55c891,JSON[_0x3acc('0x12')](_0x3cd8f3));_0x589f87(_0x3cd8f3);})[_0x3acc('0x15')](function(_0x1c7f08){logger[_0x3acc('0x13')]('ShowServicenowAccount',_0x1c7f08[_0x3acc('0x14')],_0x55c891);_0x4a5986(_0x2c77a3[_0x3acc('0x13')](0x1f4,_0x1c7f08[_0x3acc('0x14')]));});});};
\ No newline at end of file
+var _0x8b3e=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','stringify','error','code','ServicenowAccount,\x20%s,\x20%s','message','request\x20sent','result','catch','GetServicenowAccount','ServicenowAccount','findAll','options','raw','where','limit','include','map','attributes','model','then','debug','ShowServicenowAccount','find','lodash','util','moment'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0x8b3e,0x1c5));var _0xe8b3=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x8b3e[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xe8b3('0x0'));var util=require(_0xe8b3('0x1'));var moment=require(_0xe8b3('0x2'));var BPromise=require(_0xe8b3('0x3'));var rs=require(_0xe8b3('0x4'));var fs=require('fs');var Redis=require(_0xe8b3('0x5'));var db=require(_0xe8b3('0x6'))['db'];var utils=require(_0xe8b3('0x7'));var logger=require(_0xe8b3('0x8'))(_0xe8b3('0x9'));var config=require(_0xe8b3('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xe8b3('0xb')][_0xe8b3('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x21aab4,_0x3ad777,_0x310e52){return new BPromise(function(_0xec3dd3,_0x3035ce){return client[_0xe8b3('0xd')](_0x21aab4,_0x310e52)['then'](function(_0x3cec2d){logger[_0xe8b3('0xe')]('ServicenowAccount,\x20%s,\x20%s',_0x3ad777,'request\x20sent');logger['debug']('ServicenowAccount,\x20%s,\x20%s,\x20%s',_0x3ad777,'request\x20sent',JSON[_0xe8b3('0xf')](_0x3cec2d));if(_0x3cec2d[_0xe8b3('0x10')]){if(_0x3cec2d[_0xe8b3('0x10')][_0xe8b3('0x11')]===0x1f4){logger[_0xe8b3('0x10')](_0xe8b3('0x12'),_0x3ad777,_0x3cec2d[_0xe8b3('0x10')][_0xe8b3('0x13')]);return _0x3035ce(_0x3cec2d[_0xe8b3('0x10')][_0xe8b3('0x13')]);}logger[_0xe8b3('0x10')](_0xe8b3('0x12'),_0x3ad777,_0x3cec2d[_0xe8b3('0x10')][_0xe8b3('0x13')]);return _0xec3dd3(_0x3cec2d[_0xe8b3('0x10')]['message']);}else{logger[_0xe8b3('0xe')](_0xe8b3('0x12'),_0x3ad777,_0xe8b3('0x14'));_0xec3dd3(_0x3cec2d[_0xe8b3('0x15')][_0xe8b3('0x13')]);}})[_0xe8b3('0x16')](function(_0x4dabf7){logger[_0xe8b3('0x10')](_0xe8b3('0x12'),_0x3ad777,_0x4dabf7);_0x3035ce(_0x4dabf7);});});}exports[_0xe8b3('0x17')]=function(_0x3efc36){var _0x36a8bb=this;return new Promise(function(_0x2804a4,_0xd40f70){return db[_0xe8b3('0x18')][_0xe8b3('0x19')]({'raw':_0x3efc36[_0xe8b3('0x1a')]?_0x3efc36[_0xe8b3('0x1a')][_0xe8b3('0x1b')]===undefined?!![]:![]:!![],'where':_0x3efc36['options']?_0x3efc36[_0xe8b3('0x1a')][_0xe8b3('0x1c')]||null:null,'attributes':_0x3efc36[_0xe8b3('0x1a')]?_0x3efc36['options']['attributes']||null:null,'limit':_0x3efc36['options']?_0x3efc36['options'][_0xe8b3('0x1d')]||null:null,'include':_0x3efc36[_0xe8b3('0x1a')]?_0x3efc36['options'][_0xe8b3('0x1e')]?_[_0xe8b3('0x1f')](_0x3efc36[_0xe8b3('0x1a')][_0xe8b3('0x1e')],function(_0x5df835){return{'model':db[_0x5df835['model']],'as':_0x5df835['as'],'attributes':_0x5df835[_0xe8b3('0x20')],'include':_0x5df835[_0xe8b3('0x1e')]?_['map'](_0x5df835['include'],function(_0x2de182){return{'model':db[_0x2de182['model']],'as':_0x2de182['as'],'attributes':_0x2de182[_0xe8b3('0x20')],'include':_0x2de182[_0xe8b3('0x1e')]?_[_0xe8b3('0x1f')](_0x2de182['include'],function(_0x34afd1){return{'model':db[_0x34afd1[_0xe8b3('0x21')]],'as':_0x34afd1['as'],'attributes':_0x34afd1[_0xe8b3('0x20')]};}):[]};}):[]};}):[]:[]})[_0xe8b3('0x22')](function(_0x2601e3){logger[_0xe8b3('0xe')]('GetServicenowAccount',_0x3efc36);logger[_0xe8b3('0x23')](_0xe8b3('0x17'),_0x3efc36,JSON[_0xe8b3('0xf')](_0x2601e3));_0x2804a4(_0x2601e3);})[_0xe8b3('0x16')](function(_0x1dff72){logger[_0xe8b3('0x10')]('GetServicenowAccount',_0x1dff72['message'],_0x3efc36);_0xd40f70(_0x36a8bb[_0xe8b3('0x10')](0x1f4,_0x1dff72[_0xe8b3('0x13')]));});});};exports[_0xe8b3('0x24')]=function(_0x5580ae){var _0x5072ec=this;return new Promise(function(_0x54b41b,_0x445331){return db[_0xe8b3('0x18')][_0xe8b3('0x25')]({'raw':_0x5580ae['options']?_0x5580ae['options'][_0xe8b3('0x1b')]===undefined?!![]:![]:!![],'where':_0x5580ae[_0xe8b3('0x1a')]?_0x5580ae[_0xe8b3('0x1a')][_0xe8b3('0x1c')]||null:null,'attributes':_0x5580ae[_0xe8b3('0x1a')]?_0x5580ae[_0xe8b3('0x1a')][_0xe8b3('0x20')]||null:null,'include':_0x5580ae[_0xe8b3('0x1a')]?_0x5580ae[_0xe8b3('0x1a')][_0xe8b3('0x1e')]?_[_0xe8b3('0x1f')](_0x5580ae[_0xe8b3('0x1a')]['include'],function(_0x787e86){return{'model':db[_0x787e86[_0xe8b3('0x21')]],'as':_0x787e86['as'],'attributes':_0x787e86['attributes'],'include':_0x787e86[_0xe8b3('0x1e')]?_['map'](_0x787e86['include'],function(_0x31920a){return{'model':db[_0x31920a[_0xe8b3('0x21')]],'as':_0x31920a['as'],'attributes':_0x31920a['attributes'],'include':_0x31920a[_0xe8b3('0x1e')]?_['map'](_0x31920a[_0xe8b3('0x1e')],function(_0x3a05a5){return{'model':db[_0x3a05a5[_0xe8b3('0x21')]],'as':_0x3a05a5['as'],'attributes':_0x3a05a5[_0xe8b3('0x20')]};}):[]};}):[]};}):[]:[]})[_0xe8b3('0x22')](function(_0x36c733){logger['info']('ShowServicenowAccount',_0x5580ae);logger[_0xe8b3('0x23')](_0xe8b3('0x24'),_0x5580ae,JSON[_0xe8b3('0xf')](_0x36c733));_0x54b41b(_0x36c733);})['catch'](function(_0x3c0086){logger[_0xe8b3('0x10')](_0xe8b3('0x24'),_0x3c0086[_0xe8b3('0x13')],_0x5580ae);_0x445331(_0x5072ec[_0xe8b3('0x10')](0x1f4,_0x3c0086[_0xe8b3('0x13')]));});});};
\ No newline at end of file
index 13cd856..be60996 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd30f=['/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','post','create','put','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','get','isAuthenticated','index','/:id','show'];(function(_0x5969e6,_0x1164d2){var _0x406cdf=function(_0x3884ae){while(--_0x3884ae){_0x5969e6['push'](_0x5969e6['shift']());}};_0x406cdf(++_0x1164d2);}(_0xd30f,0xa3));var _0xfd30=function(_0x7ad931,_0x10a8ec){_0x7ad931=_0x7ad931-0x0;var _0x538036=_0xd30f[_0x7ad931];return _0x538036;};'use strict';var multer=require(_0xfd30('0x0'));var util=require(_0xfd30('0x1'));var path=require(_0xfd30('0x2'));var timeout=require(_0xfd30('0x3'));var express=require(_0xfd30('0x4'));var router=express[_0xfd30('0x5')]();var fs_extra=require(_0xfd30('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xfd30('0x7'));var controller=require('./intServicenowConfiguration.controller');router[_0xfd30('0x8')]('/',auth[_0xfd30('0x9')](),controller[_0xfd30('0xa')]);router[_0xfd30('0x8')](_0xfd30('0xb'),auth[_0xfd30('0x9')](),controller[_0xfd30('0xc')]);router[_0xfd30('0x8')](_0xfd30('0xd'),auth[_0xfd30('0x9')](),controller['getFields']);router['get'](_0xfd30('0xe'),auth[_0xfd30('0x9')](),controller[_0xfd30('0xf')]);router[_0xfd30('0x8')](_0xfd30('0x10'),auth[_0xfd30('0x9')](),controller['getDescriptions']);router[_0xfd30('0x11')]('/',auth['isAuthenticated'](),controller[_0xfd30('0x12')]);router[_0xfd30('0x13')](_0xfd30('0xb'),auth[_0xfd30('0x9')](),controller['update']);router[_0xfd30('0x14')]('/:id',auth[_0xfd30('0x9')](),controller[_0xfd30('0x15')]);module['exports']=router;
\ No newline at end of file
+var _0xbdf4=['/:id/descriptions','getDescriptions','post','put','update','delete','destroy','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects'];(function(_0x38fa81,_0x4bfb78){var _0x17af8a=function(_0x15c0cf){while(--_0x15c0cf){_0x38fa81['push'](_0x38fa81['shift']());}};_0x17af8a(++_0x4bfb78);}(_0xbdf4,0x101));var _0x4bdf=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0xbdf4[_0x209941];return _0x1e8729;};'use strict';var multer=require(_0x4bdf('0x0'));var util=require(_0x4bdf('0x1'));var path=require(_0x4bdf('0x2'));var timeout=require(_0x4bdf('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x4bdf('0x4'));var auth=require(_0x4bdf('0x5'));var interaction=require(_0x4bdf('0x6'));var config=require(_0x4bdf('0x7'));var controller=require(_0x4bdf('0x8'));router[_0x4bdf('0x9')]('/',auth[_0x4bdf('0xa')](),controller[_0x4bdf('0xb')]);router[_0x4bdf('0x9')](_0x4bdf('0xc'),auth[_0x4bdf('0xa')](),controller[_0x4bdf('0xd')]);router[_0x4bdf('0x9')](_0x4bdf('0xe'),auth['isAuthenticated'](),controller[_0x4bdf('0xf')]);router[_0x4bdf('0x9')](_0x4bdf('0x10'),auth[_0x4bdf('0xa')](),controller[_0x4bdf('0x11')]);router[_0x4bdf('0x9')](_0x4bdf('0x12'),auth['isAuthenticated'](),controller[_0x4bdf('0x13')]);router[_0x4bdf('0x14')]('/',auth[_0x4bdf('0xa')](),controller['create']);router[_0x4bdf('0x15')](_0x4bdf('0xc'),auth[_0x4bdf('0xa')](),controller[_0x4bdf('0x16')]);router[_0x4bdf('0x17')]('/:id',auth[_0x4bdf('0xa')](),controller[_0x4bdf('0x18')]);module['exports']=router;
\ No newline at end of file
index 20150aa..1335fff 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x617a=['STRING','sequelize','exports'];(function(_0x5e608c,_0x453591){var _0x44d7fc=function(_0xc9de57){while(--_0xc9de57){_0x5e608c['push'](_0x5e608c['shift']());}};_0x44d7fc(++_0x453591);}(_0x617a,0x1ab));var _0xa617=function(_0x4fa010,_0x17d350){_0x4fa010=_0x4fa010-0x0;var _0x32ddce=_0x617a[_0x4fa010];return _0x32ddce;};'use strict';var Sequelize=require(_0xa617('0x0'));module[_0xa617('0x1')]={'name':{'type':Sequelize[_0xa617('0x2')]},'description':{'type':Sequelize[_0xa617('0x2')]}};
\ No newline at end of file
+var _0x064a=['sequelize','STRING'];(function(_0x339123,_0x13cf39){var _0x510cdb=function(_0x7d4ce7){while(--_0x7d4ce7){_0x339123['push'](_0x339123['shift']());}};_0x510cdb(++_0x13cf39);}(_0x064a,0x13a));var _0xa064=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x064a[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0xa064('0x0'));module['exports']={'name':{'type':Sequelize[_0xa064('0x1')]},'description':{'type':Sequelize[_0xa064('0x1')]}};
\ No newline at end of file
index b74af7f..a05cbc8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd5d3=['sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','limit','count','offset','set','Content-Range','json','apply','reject','save','then','destroy','end','stack','name','map','ServicenowConfiguration','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','includeAll','include','catch','show','params','rawAttributes','length','options','find','create','body','update','getFields','findOne','ServicenowField','pick','getSubjects','getDescriptions','rimraf','request-promise','bluebird','path'];(function(_0x3ed72,_0x38ee72){var _0x599143=function(_0x41ba01){while(--_0x41ba01){_0x3ed72['push'](_0x3ed72['shift']());}};_0x599143(++_0x38ee72);}(_0xd5d3,0x90));var _0x3d5d=function(_0x270394,_0x3366fc){_0x270394=_0x270394-0x0;var _0x421775=_0xd5d3[_0x270394];return _0x421775;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3d5d('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x3d5d('0x1'));var moment=require('moment');var BPromise=require(_0x3d5d('0x2'));var Mustache=require('mustache');var util=require('util');var path=require(_0x3d5d('0x3'));var sox=require(_0x3d5d('0x4'));var csv=require(_0x3d5d('0x5'));var ejs=require(_0x3d5d('0x6'));var fs=require('fs');var fs_extra=require(_0x3d5d('0x7'));var _=require(_0x3d5d('0x8'));var squel=require('squel');var crypto=require(_0x3d5d('0x9'));var jsforce=require(_0x3d5d('0xa'));var deskjs=require(_0x3d5d('0xb'));var toCsv=require(_0x3d5d('0x5'));var querystring=require(_0x3d5d('0xc'));var Papa=require(_0x3d5d('0xd'));var Redis=require(_0x3d5d('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x3d5d('0xf'));var hardwareService=require(_0x3d5d('0x10'));var logger=require(_0x3d5d('0x11'))('api');var utils=require(_0x3d5d('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x3d5d('0x13'));var db=require(_0x3d5d('0x14'))['db'];function respondWithStatusCode(_0x4d9b20,_0x54a998){_0x54a998=_0x54a998||0xcc;return function(_0x399e67){if(_0x399e67){return _0x4d9b20[_0x3d5d('0x15')](_0x54a998);}return _0x4d9b20[_0x3d5d('0x16')](_0x54a998)['end']();};}function respondWithResult(_0x1f916b,_0x46b4d0){_0x46b4d0=_0x46b4d0||0xc8;return function(_0x43a8a4){if(_0x43a8a4){return _0x1f916b[_0x3d5d('0x16')](_0x46b4d0)['json'](_0x43a8a4);}};}function respondWithFilteredResult(_0x5ec9a7,_0x357113){return function(_0x3f5925){if(_0x3f5925){var _0x2e0e11=typeof _0x357113['offset']==='undefined'&&typeof _0x357113[_0x3d5d('0x17')]==='undefined';var _0x3c47c6=_0x3f5925[_0x3d5d('0x18')];var _0x51c8ec=_0x2e0e11?0x0:_0x357113[_0x3d5d('0x19')];var _0x32dbe5=_0x2e0e11?_0x3f5925[_0x3d5d('0x18')]:_0x357113[_0x3d5d('0x19')]+_0x357113[_0x3d5d('0x17')];var _0x1adfa4;if(_0x32dbe5>=_0x3c47c6){_0x32dbe5=_0x3c47c6;_0x1adfa4=0xc8;}else{_0x1adfa4=0xce;}_0x5ec9a7[_0x3d5d('0x16')](_0x1adfa4);return _0x5ec9a7[_0x3d5d('0x1a')](_0x3d5d('0x1b'),_0x51c8ec+'-'+_0x32dbe5+'/'+_0x3c47c6)[_0x3d5d('0x1c')](_0x3f5925);}return null;};}function patchUpdates(_0x4a8506){return function(_0x24d3be){try{jsonpatch[_0x3d5d('0x1d')](_0x24d3be,_0x4a8506,!![]);}catch(_0x3b2ebc){return BPromise[_0x3d5d('0x1e')](_0x3b2ebc);}return _0x24d3be[_0x3d5d('0x1f')]();};}function saveUpdates(_0x2ba238,_0xce3d34){return function(_0x56b279){if(_0x56b279){return _0x56b279['update'](_0x2ba238)[_0x3d5d('0x20')](function(_0x5277bd){return _0x5277bd;});}return null;};}function removeEntity(_0x5b244b,_0x488600){return function(_0x3851f2){if(_0x3851f2){return _0x3851f2[_0x3d5d('0x21')]()['then'](function(){_0x5b244b[_0x3d5d('0x16')](0xcc)[_0x3d5d('0x22')]();});}};}function handleEntityNotFound(_0x3b3087,_0x2d17e8){return function(_0x4cde52){if(!_0x4cde52){_0x3b3087[_0x3d5d('0x15')](0x194);}return _0x4cde52;};}function handleError(_0x5958ac,_0x69ae95){_0x69ae95=_0x69ae95||0x1f4;return function(_0x247b12){logger['error'](_0x247b12[_0x3d5d('0x23')]);if(_0x247b12[_0x3d5d('0x24')]){delete _0x247b12['name'];}_0x5958ac[_0x3d5d('0x16')](_0x69ae95)['send'](_0x247b12);};}exports['index']=function(_0x49f636,_0x203469){var _0x359cd1={},_0x20fe0b={},_0x5b8403={'count':0x0,'rows':[]};var _0x29a40c=_[_0x3d5d('0x25')](db[_0x3d5d('0x26')]['rawAttributes'],function(_0x1cb5fc){return{'name':_0x1cb5fc['fieldName'],'type':_0x1cb5fc[_0x3d5d('0x27')][_0x3d5d('0x28')]};});_0x20fe0b[_0x3d5d('0x29')]=_['map'](_0x29a40c,_0x3d5d('0x24'));_0x20fe0b[_0x3d5d('0x2a')]=_[_0x3d5d('0x2b')](_0x49f636[_0x3d5d('0x2a')]);_0x20fe0b[_0x3d5d('0x2c')]=_[_0x3d5d('0x2d')](_0x20fe0b['model'],_0x20fe0b[_0x3d5d('0x2a')]);_0x359cd1[_0x3d5d('0x2e')]=_[_0x3d5d('0x2d')](_0x20fe0b[_0x3d5d('0x29')],qs[_0x3d5d('0x2f')](_0x49f636['query'][_0x3d5d('0x2f')]));_0x359cd1[_0x3d5d('0x2e')]=_0x359cd1[_0x3d5d('0x2e')]['length']?_0x359cd1['attributes']:_0x20fe0b[_0x3d5d('0x29')];if(!_0x49f636[_0x3d5d('0x2a')][_0x3d5d('0x30')](_0x3d5d('0x31'))){_0x359cd1['limit']=qs[_0x3d5d('0x17')](_0x49f636['query'][_0x3d5d('0x17')]);_0x359cd1[_0x3d5d('0x19')]=qs[_0x3d5d('0x19')](_0x49f636['query']['offset']);}_0x359cd1[_0x3d5d('0x32')]=qs[_0x3d5d('0x33')](_0x49f636[_0x3d5d('0x2a')][_0x3d5d('0x33')]);_0x359cd1[_0x3d5d('0x34')]=qs['filters'](_['pick'](_0x49f636[_0x3d5d('0x2a')],_0x20fe0b[_0x3d5d('0x2c')]),_0x29a40c);if(_0x49f636['query'][_0x3d5d('0x35')]){_0x359cd1['where']=_[_0x3d5d('0x36')](_0x359cd1[_0x3d5d('0x34')],{'$or':_[_0x3d5d('0x25')](_0x29a40c,function(_0xf7d90){if(_0xf7d90[_0x3d5d('0x27')]!==_0x3d5d('0x37')){var _0x468cb1={};_0x468cb1[_0xf7d90[_0x3d5d('0x24')]]={'$like':'%'+_0x49f636[_0x3d5d('0x2a')][_0x3d5d('0x35')]+'%'};return _0x468cb1;}})});}_0x359cd1=_['merge']({},_0x359cd1,_0x49f636['options']);var _0x367235={'where':_0x359cd1[_0x3d5d('0x34')]};return db[_0x3d5d('0x26')][_0x3d5d('0x18')](_0x367235)['then'](function(_0x2e81a1){_0x5b8403[_0x3d5d('0x18')]=_0x2e81a1;if(_0x49f636[_0x3d5d('0x2a')][_0x3d5d('0x38')]){_0x359cd1[_0x3d5d('0x39')]=[{'all':!![]}];}return db[_0x3d5d('0x26')]['findAll'](_0x359cd1);})['then'](function(_0x1290d2){_0x5b8403['rows']=_0x1290d2;return _0x5b8403;})['then'](respondWithFilteredResult(_0x203469,_0x359cd1))[_0x3d5d('0x3a')](handleError(_0x203469,null));};exports[_0x3d5d('0x3b')]=function(_0x569e5f,_0x21eb3b){var _0x24bbb5={'raw':![],'where':{'id':_0x569e5f[_0x3d5d('0x3c')]['id']}},_0x38972f={};_0x38972f['model']=_[_0x3d5d('0x2b')](db[_0x3d5d('0x26')][_0x3d5d('0x3d')]);_0x38972f[_0x3d5d('0x2a')]=_[_0x3d5d('0x2b')](_0x569e5f['query']);_0x38972f[_0x3d5d('0x2c')]=_['intersection'](_0x38972f[_0x3d5d('0x29')],_0x38972f['query']);_0x24bbb5['attributes']=_[_0x3d5d('0x2d')](_0x38972f[_0x3d5d('0x29')],qs[_0x3d5d('0x2f')](_0x569e5f[_0x3d5d('0x2a')][_0x3d5d('0x2f')]));_0x24bbb5['attributes']=_0x24bbb5['attributes'][_0x3d5d('0x3e')]?_0x24bbb5[_0x3d5d('0x2e')]:_0x38972f[_0x3d5d('0x29')];if(_0x569e5f[_0x3d5d('0x2a')][_0x3d5d('0x38')]){_0x24bbb5[_0x3d5d('0x39')]=[{'all':!![]}];}_0x24bbb5=_['merge']({},_0x24bbb5,_0x569e5f[_0x3d5d('0x3f')]);return db[_0x3d5d('0x26')][_0x3d5d('0x40')](_0x24bbb5)[_0x3d5d('0x20')](handleEntityNotFound(_0x21eb3b,null))[_0x3d5d('0x20')](respondWithResult(_0x21eb3b,null))[_0x3d5d('0x3a')](handleError(_0x21eb3b,null));};exports[_0x3d5d('0x41')]=function(_0x5259d7,_0x2f7e9f){return db[_0x3d5d('0x26')][_0x3d5d('0x41')](_0x5259d7[_0x3d5d('0x42')],{})['then'](respondWithResult(_0x2f7e9f,0xc9))['catch'](handleError(_0x2f7e9f,null));};exports[_0x3d5d('0x43')]=function(_0x49d20e,_0x2b7c1d){if(_0x49d20e[_0x3d5d('0x42')]['id']){delete _0x49d20e[_0x3d5d('0x42')]['id'];}return db[_0x3d5d('0x26')]['find']({'where':{'id':_0x49d20e[_0x3d5d('0x3c')]['id']}})[_0x3d5d('0x20')](handleEntityNotFound(_0x2b7c1d,null))[_0x3d5d('0x20')](saveUpdates(_0x49d20e['body'],null))[_0x3d5d('0x20')](respondWithResult(_0x2b7c1d,null))['catch'](handleError(_0x2b7c1d,null));};exports[_0x3d5d('0x21')]=function(_0x4d2da7,_0x2cce4c){return db['ServicenowConfiguration'][_0x3d5d('0x40')]({'where':{'id':_0x4d2da7[_0x3d5d('0x3c')]['id']}})['then'](handleEntityNotFound(_0x2cce4c,null))[_0x3d5d('0x20')](removeEntity(_0x2cce4c,null))[_0x3d5d('0x3a')](handleError(_0x2cce4c,null));};exports[_0x3d5d('0x44')]=function(_0x2b2706,_0x594a2d,_0x1efa40){var _0x3e23e0={};var _0x3a7b82={};var _0x1402b7;var _0x35287f;return db[_0x3d5d('0x26')][_0x3d5d('0x45')]({'where':{'id':_0x2b2706[_0x3d5d('0x3c')]['id']}})['then'](handleEntityNotFound(_0x594a2d,null))[_0x3d5d('0x20')](function(_0x1ee0a5){if(_0x1ee0a5){_0x1402b7=_0x1ee0a5;_0x3a7b82[_0x3d5d('0x29')]=_[_0x3d5d('0x2b')](db[_0x3d5d('0x46')]['rawAttributes']);_0x3a7b82[_0x3d5d('0x2a')]=_[_0x3d5d('0x2b')](_0x2b2706[_0x3d5d('0x2a')]);_0x3a7b82[_0x3d5d('0x2c')]=_[_0x3d5d('0x2d')](_0x3a7b82[_0x3d5d('0x29')],_0x3a7b82[_0x3d5d('0x2a')]);_0x3e23e0['attributes']=_[_0x3d5d('0x2d')](_0x3a7b82[_0x3d5d('0x29')],qs[_0x3d5d('0x2f')](_0x2b2706['query'][_0x3d5d('0x2f')]));_0x3e23e0['attributes']=_0x3e23e0[_0x3d5d('0x2e')]['length']?_0x3e23e0[_0x3d5d('0x2e')]:_0x3a7b82['model'];_0x3e23e0[_0x3d5d('0x32')]=qs['sort'](_0x2b2706[_0x3d5d('0x2a')]['sort']);_0x3e23e0['where']=qs[_0x3d5d('0x2c')](_[_0x3d5d('0x47')](_0x2b2706[_0x3d5d('0x2a')],_0x3a7b82[_0x3d5d('0x2c')]));if(_0x2b2706[_0x3d5d('0x2a')][_0x3d5d('0x35')]){_0x3e23e0[_0x3d5d('0x34')]=_[_0x3d5d('0x36')](_0x3e23e0[_0x3d5d('0x34')],{'$or':_[_0x3d5d('0x25')](_0x3e23e0[_0x3d5d('0x2e')],function(_0x408760){var _0x1df1fa={};_0x1df1fa[_0x408760]={'$like':'%'+_0x2b2706[_0x3d5d('0x2a')]['filter']+'%'};return _0x1df1fa;})});}_0x3e23e0=_[_0x3d5d('0x36')]({},_0x3e23e0,_0x2b2706[_0x3d5d('0x3f')]);return _0x1402b7['getFields'](_0x3e23e0);}})[_0x3d5d('0x20')](function(_0x405352){if(_0x405352){_0x35287f=_0x405352['length'];if(!_0x2b2706[_0x3d5d('0x2a')]['hasOwnProperty'](_0x3d5d('0x31'))){_0x3e23e0[_0x3d5d('0x17')]=qs['limit'](_0x2b2706[_0x3d5d('0x2a')][_0x3d5d('0x17')]);_0x3e23e0['offset']=qs['offset'](_0x2b2706[_0x3d5d('0x2a')][_0x3d5d('0x19')]);}return _0x1402b7['getFields'](_0x3e23e0);}})[_0x3d5d('0x20')](function(_0x5d4f7a){if(_0x5d4f7a){return _0x5d4f7a?{'count':_0x35287f,'rows':_0x5d4f7a}:null;}})['then'](respondWithResult(_0x594a2d,null))['catch'](handleError(_0x594a2d,null));};exports[_0x3d5d('0x48')]=function(_0x5353be,_0x5e1122,_0x576b45){var _0x327911={};var _0x54781d={};var _0x3f4300;var _0x1f8d23;return db[_0x3d5d('0x26')][_0x3d5d('0x45')]({'where':{'id':_0x5353be['params']['id']}})[_0x3d5d('0x20')](handleEntityNotFound(_0x5e1122,null))['then'](function(_0x4c9ba1){if(_0x4c9ba1){_0x3f4300=_0x4c9ba1;_0x54781d['model']=_[_0x3d5d('0x2b')](db[_0x3d5d('0x46')][_0x3d5d('0x3d')]);_0x54781d[_0x3d5d('0x2a')]=_['keys'](_0x5353be['query']);_0x54781d[_0x3d5d('0x2c')]=_[_0x3d5d('0x2d')](_0x54781d['model'],_0x54781d[_0x3d5d('0x2a')]);_0x327911[_0x3d5d('0x2e')]=_[_0x3d5d('0x2d')](_0x54781d['model'],qs[_0x3d5d('0x2f')](_0x5353be[_0x3d5d('0x2a')][_0x3d5d('0x2f')]));_0x327911['attributes']=_0x327911[_0x3d5d('0x2e')][_0x3d5d('0x3e')]?_0x327911[_0x3d5d('0x2e')]:_0x54781d[_0x3d5d('0x29')];_0x327911['order']=qs[_0x3d5d('0x33')](_0x5353be[_0x3d5d('0x2a')]['sort']);_0x327911['where']=qs[_0x3d5d('0x2c')](_['pick'](_0x5353be[_0x3d5d('0x2a')],_0x54781d[_0x3d5d('0x2c')]));if(_0x5353be[_0x3d5d('0x2a')][_0x3d5d('0x35')]){_0x327911['where']=_[_0x3d5d('0x36')](_0x327911[_0x3d5d('0x34')],{'$or':_[_0x3d5d('0x25')](_0x327911[_0x3d5d('0x2e')],function(_0x3beb78){var _0x2ea6cc={};_0x2ea6cc[_0x3beb78]={'$like':'%'+_0x5353be[_0x3d5d('0x2a')][_0x3d5d('0x35')]+'%'};return _0x2ea6cc;})});}_0x327911=_[_0x3d5d('0x36')]({},_0x327911,_0x5353be['options']);return _0x3f4300[_0x3d5d('0x48')](_0x327911);}})[_0x3d5d('0x20')](function(_0x307976){if(_0x307976){_0x1f8d23=_0x307976['length'];if(!_0x5353be[_0x3d5d('0x2a')][_0x3d5d('0x30')](_0x3d5d('0x31'))){_0x327911[_0x3d5d('0x17')]=qs[_0x3d5d('0x17')](_0x5353be[_0x3d5d('0x2a')][_0x3d5d('0x17')]);_0x327911['offset']=qs[_0x3d5d('0x19')](_0x5353be[_0x3d5d('0x2a')]['offset']);}return _0x3f4300[_0x3d5d('0x48')](_0x327911);}})[_0x3d5d('0x20')](function(_0x367d0f){if(_0x367d0f){return _0x367d0f?{'count':_0x1f8d23,'rows':_0x367d0f}:null;}})[_0x3d5d('0x20')](respondWithResult(_0x5e1122,null))[_0x3d5d('0x3a')](handleError(_0x5e1122,null));};exports[_0x3d5d('0x49')]=function(_0x31cb2e,_0x350261,_0x11eb95){var _0x417c6b={};var _0x337076={};var _0xd64ab6;var _0x11fe1e;return db[_0x3d5d('0x26')]['findOne']({'where':{'id':_0x31cb2e['params']['id']}})[_0x3d5d('0x20')](handleEntityNotFound(_0x350261,null))[_0x3d5d('0x20')](function(_0x4999a4){if(_0x4999a4){_0xd64ab6=_0x4999a4;_0x337076[_0x3d5d('0x29')]=_[_0x3d5d('0x2b')](db[_0x3d5d('0x46')][_0x3d5d('0x3d')]);_0x337076[_0x3d5d('0x2a')]=_['keys'](_0x31cb2e[_0x3d5d('0x2a')]);_0x337076['filters']=_['intersection'](_0x337076[_0x3d5d('0x29')],_0x337076['query']);_0x417c6b[_0x3d5d('0x2e')]=_[_0x3d5d('0x2d')](_0x337076[_0x3d5d('0x29')],qs['fields'](_0x31cb2e[_0x3d5d('0x2a')][_0x3d5d('0x2f')]));_0x417c6b[_0x3d5d('0x2e')]=_0x417c6b[_0x3d5d('0x2e')]['length']?_0x417c6b['attributes']:_0x337076[_0x3d5d('0x29')];_0x417c6b[_0x3d5d('0x32')]=qs[_0x3d5d('0x33')](_0x31cb2e[_0x3d5d('0x2a')][_0x3d5d('0x33')]);_0x417c6b[_0x3d5d('0x34')]=qs[_0x3d5d('0x2c')](_['pick'](_0x31cb2e[_0x3d5d('0x2a')],_0x337076[_0x3d5d('0x2c')]));if(_0x31cb2e[_0x3d5d('0x2a')][_0x3d5d('0x35')]){_0x417c6b[_0x3d5d('0x34')]=_[_0x3d5d('0x36')](_0x417c6b[_0x3d5d('0x34')],{'$or':_[_0x3d5d('0x25')](_0x417c6b[_0x3d5d('0x2e')],function(_0x1327f7){var _0x2da360={};_0x2da360[_0x1327f7]={'$like':'%'+_0x31cb2e[_0x3d5d('0x2a')][_0x3d5d('0x35')]+'%'};return _0x2da360;})});}_0x417c6b=_['merge']({},_0x417c6b,_0x31cb2e[_0x3d5d('0x3f')]);return _0xd64ab6[_0x3d5d('0x49')](_0x417c6b);}})['then'](function(_0x43c325){if(_0x43c325){_0x11fe1e=_0x43c325['length'];if(!_0x31cb2e[_0x3d5d('0x2a')][_0x3d5d('0x30')](_0x3d5d('0x31'))){_0x417c6b['limit']=qs['limit'](_0x31cb2e[_0x3d5d('0x2a')]['limit']);_0x417c6b[_0x3d5d('0x19')]=qs[_0x3d5d('0x19')](_0x31cb2e[_0x3d5d('0x2a')]['offset']);}return _0xd64ab6[_0x3d5d('0x49')](_0x417c6b);}})[_0x3d5d('0x20')](function(_0x41bfe5){if(_0x41bfe5){return _0x41bfe5?{'count':_0x11fe1e,'rows':_0x41bfe5}:null;}})['then'](respondWithResult(_0x350261,null))[_0x3d5d('0x3a')](handleError(_0x350261,null));};
\ No newline at end of file
+var _0xdc71=['mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','offset','limit','count','set','Content-Range','apply','save','then','destroy','end','error','stack','name','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','fields','hasOwnProperty','nolimit','where','merge','options','ServicenowConfiguration','includeAll','include','catch','show','params','intersection','length','find','create','body','update','getFields','findOne','ServicenowField','order','sort','pick','filter','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','bluebird'];(function(_0x33ef54,_0x241f9f){var _0xd49c20=function(_0x16bb1f){while(--_0x16bb1f){_0x33ef54['push'](_0x33ef54['shift']());}};_0xd49c20(++_0x241f9f);}(_0xdc71,0x1cf));var _0x1dc7=function(_0x25f3e9,_0x29870b){_0x25f3e9=_0x25f3e9-0x0;var _0x1c0b28=_0xdc71[_0x25f3e9];return _0x1c0b28;};'use strict';var emlformat=require(_0x1dc7('0x0'));var rimraf=require(_0x1dc7('0x1'));var zipdir=require(_0x1dc7('0x2'));var jsonpatch=require(_0x1dc7('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x1dc7('0x4'));var Mustache=require(_0x1dc7('0x5'));var util=require(_0x1dc7('0x6'));var path=require(_0x1dc7('0x7'));var sox=require(_0x1dc7('0x8'));var csv=require(_0x1dc7('0x9'));var ejs=require(_0x1dc7('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1dc7('0xb'));var squel=require(_0x1dc7('0xc'));var crypto=require('crypto');var jsforce=require(_0x1dc7('0xd'));var deskjs=require(_0x1dc7('0xe'));var toCsv=require(_0x1dc7('0x9'));var querystring=require(_0x1dc7('0xf'));var Papa=require(_0x1dc7('0x10'));var Redis=require('ioredis');var authService=require(_0x1dc7('0x11'));var qs=require(_0x1dc7('0x12'));var as=require(_0x1dc7('0x13'));var hardwareService=require(_0x1dc7('0x14'));var logger=require(_0x1dc7('0x15'))(_0x1dc7('0x16'));var utils=require('../../config/utils');var config=require(_0x1dc7('0x17'));var licenseUtil=require(_0x1dc7('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4c5ebf,_0x4aa79b){_0x4aa79b=_0x4aa79b||0xcc;return function(_0x13ec0e){if(_0x13ec0e){return _0x4c5ebf[_0x1dc7('0x19')](_0x4aa79b);}return _0x4c5ebf[_0x1dc7('0x1a')](_0x4aa79b)['end']();};}function respondWithResult(_0x442c1f,_0x7d4367){_0x7d4367=_0x7d4367||0xc8;return function(_0x4bab72){if(_0x4bab72){return _0x442c1f['status'](_0x7d4367)['json'](_0x4bab72);}};}function respondWithFilteredResult(_0x226964,_0x44893a){return function(_0xc43965){if(_0xc43965){var _0x2ecbe4=typeof _0x44893a[_0x1dc7('0x1b')]==='undefined'&&typeof _0x44893a[_0x1dc7('0x1c')]==='undefined';var _0x359617=_0xc43965[_0x1dc7('0x1d')];var _0x34f166=_0x2ecbe4?0x0:_0x44893a['offset'];var _0x52f2b1=_0x2ecbe4?_0xc43965[_0x1dc7('0x1d')]:_0x44893a['offset']+_0x44893a[_0x1dc7('0x1c')];var _0x4765af;if(_0x52f2b1>=_0x359617){_0x52f2b1=_0x359617;_0x4765af=0xc8;}else{_0x4765af=0xce;}_0x226964['status'](_0x4765af);return _0x226964[_0x1dc7('0x1e')](_0x1dc7('0x1f'),_0x34f166+'-'+_0x52f2b1+'/'+_0x359617)['json'](_0xc43965);}return null;};}function patchUpdates(_0xd490a6){return function(_0x577ed5){try{jsonpatch[_0x1dc7('0x20')](_0x577ed5,_0xd490a6,!![]);}catch(_0x1f1885){return BPromise['reject'](_0x1f1885);}return _0x577ed5[_0x1dc7('0x21')]();};}function saveUpdates(_0x427e58,_0x1784ad){return function(_0x4c3943){if(_0x4c3943){return _0x4c3943['update'](_0x427e58)[_0x1dc7('0x22')](function(_0x401b17){return _0x401b17;});}return null;};}function removeEntity(_0x20d253,_0x29c845){return function(_0x50c1bc){if(_0x50c1bc){return _0x50c1bc[_0x1dc7('0x23')]()['then'](function(){_0x20d253[_0x1dc7('0x1a')](0xcc)[_0x1dc7('0x24')]();});}};}function handleEntityNotFound(_0x6db4e5,_0x38a282){return function(_0x2ca5a0){if(!_0x2ca5a0){_0x6db4e5[_0x1dc7('0x19')](0x194);}return _0x2ca5a0;};}function handleError(_0xdf40c3,_0x2947e2){_0x2947e2=_0x2947e2||0x1f4;return function(_0x453ba7){logger[_0x1dc7('0x25')](_0x453ba7[_0x1dc7('0x26')]);if(_0x453ba7[_0x1dc7('0x27')]){delete _0x453ba7['name'];}_0xdf40c3['status'](_0x2947e2)['send'](_0x453ba7);};}exports[_0x1dc7('0x28')]=function(_0x544d87,_0x514680){var _0x2a3a93={},_0x4cbb36={},_0x522982={'count':0x0,'rows':[]};var _0x474fa7=_['map'](db['ServicenowConfiguration'][_0x1dc7('0x29')],function(_0x111ff3){return{'name':_0x111ff3[_0x1dc7('0x2a')],'type':_0x111ff3[_0x1dc7('0x2b')][_0x1dc7('0x2c')]};});_0x4cbb36[_0x1dc7('0x2d')]=_[_0x1dc7('0x2e')](_0x474fa7,_0x1dc7('0x27'));_0x4cbb36[_0x1dc7('0x2f')]=_[_0x1dc7('0x30')](_0x544d87[_0x1dc7('0x2f')]);_0x4cbb36[_0x1dc7('0x31')]=_['intersection'](_0x4cbb36[_0x1dc7('0x2d')],_0x4cbb36['query']);_0x2a3a93[_0x1dc7('0x32')]=_['intersection'](_0x4cbb36['model'],qs[_0x1dc7('0x33')](_0x544d87[_0x1dc7('0x2f')][_0x1dc7('0x33')]));_0x2a3a93['attributes']=_0x2a3a93['attributes']['length']?_0x2a3a93[_0x1dc7('0x32')]:_0x4cbb36[_0x1dc7('0x2d')];if(!_0x544d87[_0x1dc7('0x2f')][_0x1dc7('0x34')](_0x1dc7('0x35'))){_0x2a3a93[_0x1dc7('0x1c')]=qs[_0x1dc7('0x1c')](_0x544d87['query'][_0x1dc7('0x1c')]);_0x2a3a93[_0x1dc7('0x1b')]=qs[_0x1dc7('0x1b')](_0x544d87[_0x1dc7('0x2f')][_0x1dc7('0x1b')]);}_0x2a3a93['order']=qs['sort'](_0x544d87['query']['sort']);_0x2a3a93[_0x1dc7('0x36')]=qs[_0x1dc7('0x31')](_['pick'](_0x544d87[_0x1dc7('0x2f')],_0x4cbb36[_0x1dc7('0x31')]),_0x474fa7);if(_0x544d87['query']['filter']){_0x2a3a93['where']=_['merge'](_0x2a3a93[_0x1dc7('0x36')],{'$or':_[_0x1dc7('0x2e')](_0x474fa7,function(_0x54eaa8){if(_0x54eaa8[_0x1dc7('0x2b')]!=='VIRTUAL'){var _0x250d55={};_0x250d55[_0x54eaa8[_0x1dc7('0x27')]]={'$like':'%'+_0x544d87[_0x1dc7('0x2f')]['filter']+'%'};return _0x250d55;}})});}_0x2a3a93=_[_0x1dc7('0x37')]({},_0x2a3a93,_0x544d87[_0x1dc7('0x38')]);var _0x505ae4={'where':_0x2a3a93[_0x1dc7('0x36')]};return db[_0x1dc7('0x39')]['count'](_0x505ae4)[_0x1dc7('0x22')](function(_0x1e0a90){_0x522982[_0x1dc7('0x1d')]=_0x1e0a90;if(_0x544d87[_0x1dc7('0x2f')][_0x1dc7('0x3a')]){_0x2a3a93[_0x1dc7('0x3b')]=[{'all':!![]}];}return db[_0x1dc7('0x39')]['findAll'](_0x2a3a93);})['then'](function(_0x4c3104){_0x522982['rows']=_0x4c3104;return _0x522982;})[_0x1dc7('0x22')](respondWithFilteredResult(_0x514680,_0x2a3a93))[_0x1dc7('0x3c')](handleError(_0x514680,null));};exports[_0x1dc7('0x3d')]=function(_0x2a3e31,_0x6f7ae7){var _0x525ca4={'raw':![],'where':{'id':_0x2a3e31[_0x1dc7('0x3e')]['id']}},_0x158c7c={};_0x158c7c[_0x1dc7('0x2d')]=_[_0x1dc7('0x30')](db[_0x1dc7('0x39')][_0x1dc7('0x29')]);_0x158c7c[_0x1dc7('0x2f')]=_['keys'](_0x2a3e31['query']);_0x158c7c['filters']=_[_0x1dc7('0x3f')](_0x158c7c[_0x1dc7('0x2d')],_0x158c7c['query']);_0x525ca4['attributes']=_['intersection'](_0x158c7c[_0x1dc7('0x2d')],qs[_0x1dc7('0x33')](_0x2a3e31[_0x1dc7('0x2f')][_0x1dc7('0x33')]));_0x525ca4['attributes']=_0x525ca4[_0x1dc7('0x32')][_0x1dc7('0x40')]?_0x525ca4[_0x1dc7('0x32')]:_0x158c7c[_0x1dc7('0x2d')];if(_0x2a3e31[_0x1dc7('0x2f')][_0x1dc7('0x3a')]){_0x525ca4[_0x1dc7('0x3b')]=[{'all':!![]}];}_0x525ca4=_[_0x1dc7('0x37')]({},_0x525ca4,_0x2a3e31[_0x1dc7('0x38')]);return db[_0x1dc7('0x39')][_0x1dc7('0x41')](_0x525ca4)[_0x1dc7('0x22')](handleEntityNotFound(_0x6f7ae7,null))['then'](respondWithResult(_0x6f7ae7,null))[_0x1dc7('0x3c')](handleError(_0x6f7ae7,null));};exports[_0x1dc7('0x42')]=function(_0x8b9b78,_0x405402){return db[_0x1dc7('0x39')]['create'](_0x8b9b78[_0x1dc7('0x43')],{})[_0x1dc7('0x22')](respondWithResult(_0x405402,0xc9))[_0x1dc7('0x3c')](handleError(_0x405402,null));};exports[_0x1dc7('0x44')]=function(_0x2f6455,_0x1d7883){if(_0x2f6455[_0x1dc7('0x43')]['id']){delete _0x2f6455[_0x1dc7('0x43')]['id'];}return db[_0x1dc7('0x39')][_0x1dc7('0x41')]({'where':{'id':_0x2f6455[_0x1dc7('0x3e')]['id']}})[_0x1dc7('0x22')](handleEntityNotFound(_0x1d7883,null))[_0x1dc7('0x22')](saveUpdates(_0x2f6455[_0x1dc7('0x43')],null))[_0x1dc7('0x22')](respondWithResult(_0x1d7883,null))['catch'](handleError(_0x1d7883,null));};exports[_0x1dc7('0x23')]=function(_0x353c4b,_0x12b002){return db[_0x1dc7('0x39')][_0x1dc7('0x41')]({'where':{'id':_0x353c4b[_0x1dc7('0x3e')]['id']}})[_0x1dc7('0x22')](handleEntityNotFound(_0x12b002,null))[_0x1dc7('0x22')](removeEntity(_0x12b002,null))['catch'](handleError(_0x12b002,null));};exports[_0x1dc7('0x45')]=function(_0x5a84ed,_0x30baf6,_0x46b474){var _0x27f073={};var _0x261bd5={};var _0x330e77;var _0x443858;return db[_0x1dc7('0x39')][_0x1dc7('0x46')]({'where':{'id':_0x5a84ed[_0x1dc7('0x3e')]['id']}})[_0x1dc7('0x22')](handleEntityNotFound(_0x30baf6,null))[_0x1dc7('0x22')](function(_0x2f407c){if(_0x2f407c){_0x330e77=_0x2f407c;_0x261bd5['model']=_[_0x1dc7('0x30')](db[_0x1dc7('0x47')][_0x1dc7('0x29')]);_0x261bd5[_0x1dc7('0x2f')]=_[_0x1dc7('0x30')](_0x5a84ed[_0x1dc7('0x2f')]);_0x261bd5[_0x1dc7('0x31')]=_[_0x1dc7('0x3f')](_0x261bd5[_0x1dc7('0x2d')],_0x261bd5[_0x1dc7('0x2f')]);_0x27f073[_0x1dc7('0x32')]=_['intersection'](_0x261bd5[_0x1dc7('0x2d')],qs[_0x1dc7('0x33')](_0x5a84ed['query'][_0x1dc7('0x33')]));_0x27f073['attributes']=_0x27f073['attributes']['length']?_0x27f073[_0x1dc7('0x32')]:_0x261bd5['model'];_0x27f073[_0x1dc7('0x48')]=qs['sort'](_0x5a84ed[_0x1dc7('0x2f')][_0x1dc7('0x49')]);_0x27f073[_0x1dc7('0x36')]=qs[_0x1dc7('0x31')](_[_0x1dc7('0x4a')](_0x5a84ed['query'],_0x261bd5[_0x1dc7('0x31')]));if(_0x5a84ed[_0x1dc7('0x2f')][_0x1dc7('0x4b')]){_0x27f073['where']=_[_0x1dc7('0x37')](_0x27f073[_0x1dc7('0x36')],{'$or':_[_0x1dc7('0x2e')](_0x27f073[_0x1dc7('0x32')],function(_0x4527a7){var _0x15e112={};_0x15e112[_0x4527a7]={'$like':'%'+_0x5a84ed[_0x1dc7('0x2f')]['filter']+'%'};return _0x15e112;})});}_0x27f073=_['merge']({},_0x27f073,_0x5a84ed[_0x1dc7('0x38')]);return _0x330e77[_0x1dc7('0x45')](_0x27f073);}})[_0x1dc7('0x22')](function(_0x569d12){if(_0x569d12){_0x443858=_0x569d12[_0x1dc7('0x40')];if(!_0x5a84ed[_0x1dc7('0x2f')][_0x1dc7('0x34')](_0x1dc7('0x35'))){_0x27f073['limit']=qs[_0x1dc7('0x1c')](_0x5a84ed['query']['limit']);_0x27f073[_0x1dc7('0x1b')]=qs[_0x1dc7('0x1b')](_0x5a84ed[_0x1dc7('0x2f')]['offset']);}return _0x330e77[_0x1dc7('0x45')](_0x27f073);}})['then'](function(_0x3aa7e4){if(_0x3aa7e4){return _0x3aa7e4?{'count':_0x443858,'rows':_0x3aa7e4}:null;}})[_0x1dc7('0x22')](respondWithResult(_0x30baf6,null))[_0x1dc7('0x3c')](handleError(_0x30baf6,null));};exports[_0x1dc7('0x4c')]=function(_0x512451,_0xf56ece,_0x1c7ee7){var _0x274398={};var _0x1b136f={};var _0x36a55f;var _0x4178c0;return db['ServicenowConfiguration']['findOne']({'where':{'id':_0x512451[_0x1dc7('0x3e')]['id']}})[_0x1dc7('0x22')](handleEntityNotFound(_0xf56ece,null))['then'](function(_0x4e76e5){if(_0x4e76e5){_0x36a55f=_0x4e76e5;_0x1b136f[_0x1dc7('0x2d')]=_[_0x1dc7('0x30')](db[_0x1dc7('0x47')][_0x1dc7('0x29')]);_0x1b136f[_0x1dc7('0x2f')]=_[_0x1dc7('0x30')](_0x512451[_0x1dc7('0x2f')]);_0x1b136f['filters']=_[_0x1dc7('0x3f')](_0x1b136f[_0x1dc7('0x2d')],_0x1b136f['query']);_0x274398[_0x1dc7('0x32')]=_['intersection'](_0x1b136f[_0x1dc7('0x2d')],qs[_0x1dc7('0x33')](_0x512451[_0x1dc7('0x2f')]['fields']));_0x274398[_0x1dc7('0x32')]=_0x274398[_0x1dc7('0x32')][_0x1dc7('0x40')]?_0x274398['attributes']:_0x1b136f['model'];_0x274398[_0x1dc7('0x48')]=qs['sort'](_0x512451[_0x1dc7('0x2f')]['sort']);_0x274398[_0x1dc7('0x36')]=qs[_0x1dc7('0x31')](_['pick'](_0x512451[_0x1dc7('0x2f')],_0x1b136f[_0x1dc7('0x31')]));if(_0x512451['query'][_0x1dc7('0x4b')]){_0x274398[_0x1dc7('0x36')]=_[_0x1dc7('0x37')](_0x274398[_0x1dc7('0x36')],{'$or':_[_0x1dc7('0x2e')](_0x274398[_0x1dc7('0x32')],function(_0x3fe6b4){var _0x5c10e4={};_0x5c10e4[_0x3fe6b4]={'$like':'%'+_0x512451[_0x1dc7('0x2f')][_0x1dc7('0x4b')]+'%'};return _0x5c10e4;})});}_0x274398=_['merge']({},_0x274398,_0x512451['options']);return _0x36a55f[_0x1dc7('0x4c')](_0x274398);}})[_0x1dc7('0x22')](function(_0x1ea5a1){if(_0x1ea5a1){_0x4178c0=_0x1ea5a1[_0x1dc7('0x40')];if(!_0x512451[_0x1dc7('0x2f')][_0x1dc7('0x34')](_0x1dc7('0x35'))){_0x274398[_0x1dc7('0x1c')]=qs[_0x1dc7('0x1c')](_0x512451[_0x1dc7('0x2f')][_0x1dc7('0x1c')]);_0x274398[_0x1dc7('0x1b')]=qs[_0x1dc7('0x1b')](_0x512451[_0x1dc7('0x2f')][_0x1dc7('0x1b')]);}return _0x36a55f['getSubjects'](_0x274398);}})[_0x1dc7('0x22')](function(_0x389321){if(_0x389321){return _0x389321?{'count':_0x4178c0,'rows':_0x389321}:null;}})['then'](respondWithResult(_0xf56ece,null))[_0x1dc7('0x3c')](handleError(_0xf56ece,null));};exports[_0x1dc7('0x4d')]=function(_0x519baf,_0x42fe6b,_0x247d8a){var _0x3bd259={};var _0x1d8f1f={};var _0x53dbd1;var _0x263052;return db[_0x1dc7('0x39')]['findOne']({'where':{'id':_0x519baf['params']['id']}})[_0x1dc7('0x22')](handleEntityNotFound(_0x42fe6b,null))[_0x1dc7('0x22')](function(_0xc13c6d){if(_0xc13c6d){_0x53dbd1=_0xc13c6d;_0x1d8f1f[_0x1dc7('0x2d')]=_[_0x1dc7('0x30')](db[_0x1dc7('0x47')]['rawAttributes']);_0x1d8f1f[_0x1dc7('0x2f')]=_[_0x1dc7('0x30')](_0x519baf[_0x1dc7('0x2f')]);_0x1d8f1f[_0x1dc7('0x31')]=_['intersection'](_0x1d8f1f['model'],_0x1d8f1f[_0x1dc7('0x2f')]);_0x3bd259[_0x1dc7('0x32')]=_[_0x1dc7('0x3f')](_0x1d8f1f[_0x1dc7('0x2d')],qs[_0x1dc7('0x33')](_0x519baf['query'][_0x1dc7('0x33')]));_0x3bd259[_0x1dc7('0x32')]=_0x3bd259['attributes'][_0x1dc7('0x40')]?_0x3bd259[_0x1dc7('0x32')]:_0x1d8f1f['model'];_0x3bd259[_0x1dc7('0x48')]=qs[_0x1dc7('0x49')](_0x519baf['query'][_0x1dc7('0x49')]);_0x3bd259[_0x1dc7('0x36')]=qs['filters'](_[_0x1dc7('0x4a')](_0x519baf[_0x1dc7('0x2f')],_0x1d8f1f[_0x1dc7('0x31')]));if(_0x519baf[_0x1dc7('0x2f')][_0x1dc7('0x4b')]){_0x3bd259[_0x1dc7('0x36')]=_[_0x1dc7('0x37')](_0x3bd259['where'],{'$or':_[_0x1dc7('0x2e')](_0x3bd259['attributes'],function(_0x36a609){var _0x48e166={};_0x48e166[_0x36a609]={'$like':'%'+_0x519baf[_0x1dc7('0x2f')][_0x1dc7('0x4b')]+'%'};return _0x48e166;})});}_0x3bd259=_[_0x1dc7('0x37')]({},_0x3bd259,_0x519baf['options']);return _0x53dbd1[_0x1dc7('0x4d')](_0x3bd259);}})[_0x1dc7('0x22')](function(_0x578296){if(_0x578296){_0x263052=_0x578296[_0x1dc7('0x40')];if(!_0x519baf['query'][_0x1dc7('0x34')]('nolimit')){_0x3bd259['limit']=qs[_0x1dc7('0x1c')](_0x519baf[_0x1dc7('0x2f')][_0x1dc7('0x1c')]);_0x3bd259[_0x1dc7('0x1b')]=qs[_0x1dc7('0x1b')](_0x519baf[_0x1dc7('0x2f')]['offset']);}return _0x53dbd1['getDescriptions'](_0x3bd259);}})[_0x1dc7('0x22')](function(_0x508b17){if(_0x508b17){return _0x508b17?{'count':_0x263052,'rows':_0x508b17}:null;}})[_0x1dc7('0x22')](respondWithResult(_0x42fe6b,null))[_0x1dc7('0x3c')](handleError(_0x42fe6b,null));};
\ No newline at end of file
index 1ff3afe..ce8d82b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x47d6=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intServicenowConfiguration.attributes','exports','define','ServicenowConfiguration','lodash','util','../../config/logger'];(function(_0x4aed6b,_0x54b865){var _0x175d7b=function(_0xe428bb){while(--_0xe428bb){_0x4aed6b['push'](_0x4aed6b['shift']());}};_0x175d7b(++_0x54b865);}(_0x47d6,0x13f));var _0x647d=function(_0x4b16fa,_0x506861){_0x4b16fa=_0x4b16fa-0x0;var _0x27e8c8=_0x47d6[_0x4b16fa];return _0x27e8c8;};'use strict';var _=require(_0x647d('0x0'));var util=require(_0x647d('0x1'));var logger=require(_0x647d('0x2'))(_0x647d('0x3'));var moment=require(_0x647d('0x4'));var BPromise=require(_0x647d('0x5'));var rp=require(_0x647d('0x6'));var fs=require('fs');var path=require(_0x647d('0x7'));var rimraf=require(_0x647d('0x8'));var config=require(_0x647d('0x9'));var attributes=require(_0x647d('0xa'));module[_0x647d('0xb')]=function(_0x8a0753,_0x8ffe2b){return _0x8a0753[_0x647d('0xc')](_0x647d('0xd'),attributes,{'tableName':'int_servicenow_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x38d0=['int_servicenow_configurations','util','../../config/logger','api','bluebird','request-promise','../../config/environment','exports','define','ServicenowConfiguration'];(function(_0x4c05da,_0x414720){var _0x1614db=function(_0xa19cf6){while(--_0xa19cf6){_0x4c05da['push'](_0x4c05da['shift']());}};_0x1614db(++_0x414720);}(_0x38d0,0x123));var _0x038d=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x38d0[_0x465a0c];return _0x1e202e;};'use strict';var _=require('lodash');var util=require(_0x038d('0x0'));var logger=require(_0x038d('0x1'))(_0x038d('0x2'));var moment=require('moment');var BPromise=require(_0x038d('0x3'));var rp=require(_0x038d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x038d('0x5'));var attributes=require('./intServicenowConfiguration.attributes');module[_0x038d('0x6')]=function(_0x2dd6b0,_0x5914cb){return _0x2dd6b0[_0x038d('0x7')](_0x038d('0x8'),attributes,{'tableName':_0x038d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 1c93834..6b8a770 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x94aa=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','randomstring','ioredis','../../mysqldb'];(function(_0x2f2bb3,_0x1fcd25){var _0x51daa0=function(_0x467a42){while(--_0x467a42){_0x2f2bb3['push'](_0x2f2bb3['shift']());}};_0x51daa0(++_0x1fcd25);}(_0x94aa,0x65));var _0xa94a=function(_0x480a81,_0x43d7ec){_0x480a81=_0x480a81-0x0;var _0x102e97=_0x94aa[_0x480a81];return _0x102e97;};'use strict';var _=require(_0xa94a('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa94a('0x1'));var fs=require('fs');var Redis=require(_0xa94a('0x2'));var db=require(_0xa94a('0x3'))['db'];var utils=require(_0xa94a('0x4'));var logger=require(_0xa94a('0x5'))('rpc');var config=require(_0xa94a('0x6'));var jayson=require(_0xa94a('0x7'));var client=jayson[_0xa94a('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x514dff,_0x48e78d,_0x4dc20f){return new BPromise(function(_0x5d65c3,_0x45869c){return client[_0xa94a('0x9')](_0x514dff,_0x4dc20f)['then'](function(_0x5ec4ef){logger['info'](_0xa94a('0xa'),_0x48e78d,_0xa94a('0xb'));logger[_0xa94a('0xc')](_0xa94a('0xd'),_0x48e78d,_0xa94a('0xb'),JSON[_0xa94a('0xe')](_0x5ec4ef));if(_0x5ec4ef['error']){if(_0x5ec4ef[_0xa94a('0xf')][_0xa94a('0x10')]===0x1f4){logger[_0xa94a('0xf')]('ServicenowConfiguration,\x20%s,\x20%s',_0x48e78d,_0x5ec4ef[_0xa94a('0xf')][_0xa94a('0x11')]);return _0x45869c(_0x5ec4ef[_0xa94a('0xf')][_0xa94a('0x11')]);}logger['error'](_0xa94a('0xa'),_0x48e78d,_0x5ec4ef[_0xa94a('0xf')][_0xa94a('0x11')]);return _0x5d65c3(_0x5ec4ef['error'][_0xa94a('0x11')]);}else{logger[_0xa94a('0x12')]('ServicenowConfiguration,\x20%s,\x20%s',_0x48e78d,'request\x20sent');_0x5d65c3(_0x5ec4ef[_0xa94a('0x13')][_0xa94a('0x11')]);}})[_0xa94a('0x14')](function(_0x1e707){logger[_0xa94a('0xf')]('ServicenowConfiguration,\x20%s,\x20%s',_0x48e78d,_0x1e707);_0x45869c(_0x1e707);});});}
\ No newline at end of file
+var _0x3926=['info','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','ServicenowConfiguration,\x20%s,\x20%s','message'];(function(_0x186783,_0x52c982){var _0x13ffbe=function(_0x6dda86){while(--_0x6dda86){_0x186783['push'](_0x186783['shift']());}};_0x13ffbe(++_0x52c982);}(_0x3926,0xb1));var _0x6392=function(_0x1e7b16,_0x4607a1){_0x1e7b16=_0x1e7b16-0x0;var _0x37fadc=_0x3926[_0x1e7b16];return _0x37fadc;};'use strict';var _=require('lodash');var util=require(_0x6392('0x0'));var moment=require(_0x6392('0x1'));var BPromise=require(_0x6392('0x2'));var rs=require(_0x6392('0x3'));var fs=require('fs');var Redis=require(_0x6392('0x4'));var db=require(_0x6392('0x5'))['db'];var utils=require(_0x6392('0x6'));var logger=require(_0x6392('0x7'))(_0x6392('0x8'));var config=require(_0x6392('0x9'));var jayson=require(_0x6392('0xa'));var client=jayson[_0x6392('0xb')][_0x6392('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2406b2,_0x1c5407,_0x50988c){return new BPromise(function(_0x7cfe81,_0x331baf){return client[_0x6392('0xd')](_0x2406b2,_0x50988c)[_0x6392('0xe')](function(_0x3ad6d6){logger['info']('ServicenowConfiguration,\x20%s,\x20%s',_0x1c5407,_0x6392('0xf'));logger[_0x6392('0x10')](_0x6392('0x11'),_0x1c5407,_0x6392('0xf'),JSON[_0x6392('0x12')](_0x3ad6d6));if(_0x3ad6d6['error']){if(_0x3ad6d6[_0x6392('0x13')][_0x6392('0x14')]===0x1f4){logger[_0x6392('0x13')](_0x6392('0x15'),_0x1c5407,_0x3ad6d6['error'][_0x6392('0x16')]);return _0x331baf(_0x3ad6d6[_0x6392('0x13')][_0x6392('0x16')]);}logger['error']('ServicenowConfiguration,\x20%s,\x20%s',_0x1c5407,_0x3ad6d6[_0x6392('0x13')][_0x6392('0x16')]);return _0x7cfe81(_0x3ad6d6['error']['message']);}else{logger[_0x6392('0x17')](_0x6392('0x15'),_0x1c5407,'request\x20sent');_0x7cfe81(_0x3ad6d6['result'][_0x6392('0x16')]);}})[_0x6392('0x18')](function(_0x606e59){logger[_0x6392('0x13')]('ServicenowConfiguration,\x20%s,\x20%s',_0x1c5407,_0x606e59);_0x331baf(_0x606e59);});});}
\ No newline at end of file
index 6ec1108..581082f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb4d0=['fs-extra','../../components/auth/service','../../config/environment','./intServicenowField.controller','get','isAuthenticated','index','/:id','show','post','create','update','delete','exports','util','path','connect-timeout'];(function(_0x557f0b,_0x346cb7){var _0x2c48fc=function(_0x570238){while(--_0x570238){_0x557f0b['push'](_0x557f0b['shift']());}};_0x2c48fc(++_0x346cb7);}(_0xb4d0,0x184));var _0x0b4d=function(_0x5b0d46,_0x3c2f1d){_0x5b0d46=_0x5b0d46-0x0;var _0x158499=_0xb4d0[_0x5b0d46];return _0x158499;};'use strict';var multer=require('multer');var util=require(_0x0b4d('0x0'));var path=require(_0x0b4d('0x1'));var timeout=require(_0x0b4d('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x0b4d('0x3'));var auth=require(_0x0b4d('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x0b4d('0x5'));var controller=require(_0x0b4d('0x6'));router[_0x0b4d('0x7')]('/',auth[_0x0b4d('0x8')](),controller[_0x0b4d('0x9')]);router[_0x0b4d('0x7')](_0x0b4d('0xa'),auth[_0x0b4d('0x8')](),controller[_0x0b4d('0xb')]);router[_0x0b4d('0xc')]('/',auth[_0x0b4d('0x8')](),controller[_0x0b4d('0xd')]);router['put'](_0x0b4d('0xa'),auth[_0x0b4d('0x8')](),controller[_0x0b4d('0xe')]);router[_0x0b4d('0xf')](_0x0b4d('0xa'),auth[_0x0b4d('0x8')](),controller['destroy']);module[_0x0b4d('0x10')]=router;
\ No newline at end of file
+var _0xcd0b=['./intServicenowField.controller','get','index','/:id','show','post','create','put','isAuthenticated','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service'];(function(_0x13abf5,_0x55539d){var _0x24c51e=function(_0x30c4f8){while(--_0x30c4f8){_0x13abf5['push'](_0x13abf5['shift']());}};_0x24c51e(++_0x55539d);}(_0xcd0b,0x116));var _0xbcd0=function(_0x49c4de,_0xac4172){_0x49c4de=_0x49c4de-0x0;var _0xdcc4d3=_0xcd0b[_0x49c4de];return _0xdcc4d3;};'use strict';var multer=require(_0xbcd0('0x0'));var util=require(_0xbcd0('0x1'));var path=require(_0xbcd0('0x2'));var timeout=require(_0xbcd0('0x3'));var express=require(_0xbcd0('0x4'));var router=express['Router']();var fs_extra=require(_0xbcd0('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xbcd0('0x6'));var config=require('../../config/environment');var controller=require(_0xbcd0('0x7'));router[_0xbcd0('0x8')]('/',auth['isAuthenticated'](),controller[_0xbcd0('0x9')]);router['get'](_0xbcd0('0xa'),auth['isAuthenticated'](),controller[_0xbcd0('0xb')]);router[_0xbcd0('0xc')]('/',auth['isAuthenticated'](),controller[_0xbcd0('0xd')]);router[_0xbcd0('0xe')]('/:id',auth[_0xbcd0('0xf')](),controller[_0xbcd0('0x10')]);router['delete'](_0xbcd0('0xa'),auth[_0xbcd0('0xf')](),controller[_0xbcd0('0x11')]);module[_0xbcd0('0x12')]=router;
\ No newline at end of file
index 8b602d6..93d28d0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8288=['BOOLEAN','sequelize','ENUM','string','variable','customVariable','picklist','STRING'];(function(_0x40e468,_0x1a2d68){var _0x31a1f0=function(_0x697409){while(--_0x697409){_0x40e468['push'](_0x40e468['shift']());}};_0x31a1f0(++_0x1a2d68);}(_0x8288,0x179));var _0x8828=function(_0x5bc4b5,_0x33338c){_0x5bc4b5=_0x5bc4b5-0x0;var _0x4174ec=_0x8288[_0x5bc4b5];return _0x4174ec;};'use strict';var Sequelize=require(_0x8828('0x0'));module['exports']={'type':{'type':Sequelize[_0x8828('0x1')](_0x8828('0x2'),_0x8828('0x3'),_0x8828('0x4'),'keyValue',_0x8828('0x5')),'defaultValue':_0x8828('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x8828('0x1')](_0x8828('0x2'),_0x8828('0x3'),_0x8828('0x4'))},'keyContent':{'type':Sequelize[_0x8828('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x8828('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x462b=['customVariable','BOOLEAN','sequelize','exports','string','keyValue','picklist','STRING','ENUM','variable'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x462b,0xe8));var _0xb462=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x462b[_0x502c7d];return _0x30b7ed;};'use strict';var Sequelize=require(_0xb462('0x0'));module[_0xb462('0x1')]={'type':{'type':Sequelize['ENUM'](_0xb462('0x2'),'variable','customVariable',_0xb462('0x3'),_0xb462('0x4')),'defaultValue':_0xb462('0x2')},'content':{'type':Sequelize[_0xb462('0x5')]},'key':{'type':Sequelize[_0xb462('0x5')]},'keyType':{'type':Sequelize[_0xb462('0x6')](_0xb462('0x2'),_0xb462('0x7'),_0xb462('0x8'))},'keyContent':{'type':Sequelize[_0xb462('0x5')]},'idField':{'type':Sequelize[_0xb462('0x5')]},'nameField':{'type':Sequelize[_0xb462('0x5')]},'customField':{'type':Sequelize[_0xb462('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xb462('0x5')]}};
\ No newline at end of file
index 1271852..665a2b7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2dd0=['status','end','json','offset','undefined','count','limit','set','Content-Range','update','then','destroy','error','stack','send','index','ServicenowField','rawAttributes','fieldName','key','name','keys','query','intersection','model','attributes','fields','hasOwnProperty','order','sort','where','filters','filter','map','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','merge','find','create','body','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','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/license/util','../../mysqldb','sendStatus'];(function(_0x79250d,_0x5e273a){var _0x26bb9f=function(_0x219988){while(--_0x219988){_0x79250d['push'](_0x79250d['shift']());}};_0x26bb9f(++_0x5e273a);}(_0x2dd0,0x1a8));var _0x02dd=function(_0x2dca65,_0xdbf550){_0x2dca65=_0x2dca65-0x0;var _0x4be162=_0x2dd0[_0x2dca65];return _0x4be162;};'use strict';var emlformat=require(_0x02dd('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x02dd('0x1'));var rp=require('request-promise');var moment=require(_0x02dd('0x2'));var BPromise=require(_0x02dd('0x3'));var Mustache=require(_0x02dd('0x4'));var util=require(_0x02dd('0x5'));var path=require(_0x02dd('0x6'));var sox=require('sox');var csv=require(_0x02dd('0x7'));var ejs=require(_0x02dd('0x8'));var fs=require('fs');var fs_extra=require(_0x02dd('0x9'));var _=require(_0x02dd('0xa'));var squel=require(_0x02dd('0xb'));var crypto=require(_0x02dd('0xc'));var jsforce=require(_0x02dd('0xd'));var deskjs=require(_0x02dd('0xe'));var toCsv=require(_0x02dd('0x7'));var querystring=require(_0x02dd('0xf'));var Papa=require(_0x02dd('0x10'));var Redis=require(_0x02dd('0x11'));var authService=require(_0x02dd('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x02dd('0x13'));var hardwareService=require(_0x02dd('0x14'));var logger=require(_0x02dd('0x15'))('api');var utils=require(_0x02dd('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x02dd('0x17'));var db=require(_0x02dd('0x18'))['db'];function respondWithStatusCode(_0x3b5c88,_0x5f3ed7){_0x5f3ed7=_0x5f3ed7||0xcc;return function(_0x1ceb5f){if(_0x1ceb5f){return _0x3b5c88[_0x02dd('0x19')](_0x5f3ed7);}return _0x3b5c88[_0x02dd('0x1a')](_0x5f3ed7)[_0x02dd('0x1b')]();};}function respondWithResult(_0x1ec7e8,_0x2d0bab){_0x2d0bab=_0x2d0bab||0xc8;return function(_0x2652cc){if(_0x2652cc){return _0x1ec7e8[_0x02dd('0x1a')](_0x2d0bab)[_0x02dd('0x1c')](_0x2652cc);}};}function respondWithFilteredResult(_0x5b4bbe,_0x8bcf61){return function(_0x3af8d3){if(_0x3af8d3){var _0x598836=typeof _0x8bcf61[_0x02dd('0x1d')]===_0x02dd('0x1e')&&typeof _0x8bcf61['limit']==='undefined';var _0x53fbcf=_0x3af8d3[_0x02dd('0x1f')];var _0x158245=_0x598836?0x0:_0x8bcf61[_0x02dd('0x1d')];var _0x67ec1d=_0x598836?_0x3af8d3[_0x02dd('0x1f')]:_0x8bcf61[_0x02dd('0x1d')]+_0x8bcf61[_0x02dd('0x20')];var _0x37f9ba;if(_0x67ec1d>=_0x53fbcf){_0x67ec1d=_0x53fbcf;_0x37f9ba=0xc8;}else{_0x37f9ba=0xce;}_0x5b4bbe['status'](_0x37f9ba);return _0x5b4bbe[_0x02dd('0x21')](_0x02dd('0x22'),_0x158245+'-'+_0x67ec1d+'/'+_0x53fbcf)[_0x02dd('0x1c')](_0x3af8d3);}return null;};}function patchUpdates(_0x46bf7e){return function(_0x4e7344){try{jsonpatch['apply'](_0x4e7344,_0x46bf7e,!![]);}catch(_0x52ec61){return BPromise['reject'](_0x52ec61);}return _0x4e7344['save']();};}function saveUpdates(_0x48f7b2,_0xca3b09){return function(_0x13be4c){if(_0x13be4c){return _0x13be4c[_0x02dd('0x23')](_0x48f7b2)[_0x02dd('0x24')](function(_0x3a7b87){return _0x3a7b87;});}return null;};}function removeEntity(_0x44a9f6,_0x512830){return function(_0xc5c75d){if(_0xc5c75d){return _0xc5c75d[_0x02dd('0x25')]()[_0x02dd('0x24')](function(){_0x44a9f6[_0x02dd('0x1a')](0xcc)[_0x02dd('0x1b')]();});}};}function handleEntityNotFound(_0x5f013f,_0xbf9e7c){return function(_0x5105f4){if(!_0x5105f4){_0x5f013f['sendStatus'](0x194);}return _0x5105f4;};}function handleError(_0x2ca843,_0xc4bd51){_0xc4bd51=_0xc4bd51||0x1f4;return function(_0x54c191){logger[_0x02dd('0x26')](_0x54c191[_0x02dd('0x27')]);if(_0x54c191['name']){delete _0x54c191['name'];}_0x2ca843['status'](_0xc4bd51)[_0x02dd('0x28')](_0x54c191);};}exports[_0x02dd('0x29')]=function(_0x18d5a2,_0x29ad80){var _0x9dbab2={},_0x3e192a={},_0x331c2e={'count':0x0,'rows':[]};var _0x8cde29=_['map'](db[_0x02dd('0x2a')][_0x02dd('0x2b')],function(_0x2e6b41){return{'name':_0x2e6b41[_0x02dd('0x2c')],'type':_0x2e6b41['type'][_0x02dd('0x2d')]};});_0x3e192a['model']=_['map'](_0x8cde29,_0x02dd('0x2e'));_0x3e192a['query']=_[_0x02dd('0x2f')](_0x18d5a2[_0x02dd('0x30')]);_0x3e192a['filters']=_[_0x02dd('0x31')](_0x3e192a[_0x02dd('0x32')],_0x3e192a[_0x02dd('0x30')]);_0x9dbab2[_0x02dd('0x33')]=_['intersection'](_0x3e192a[_0x02dd('0x32')],qs['fields'](_0x18d5a2[_0x02dd('0x30')][_0x02dd('0x34')]));_0x9dbab2[_0x02dd('0x33')]=_0x9dbab2['attributes']['length']?_0x9dbab2[_0x02dd('0x33')]:_0x3e192a[_0x02dd('0x32')];if(!_0x18d5a2['query'][_0x02dd('0x35')]('nolimit')){_0x9dbab2[_0x02dd('0x20')]=qs[_0x02dd('0x20')](_0x18d5a2[_0x02dd('0x30')][_0x02dd('0x20')]);_0x9dbab2[_0x02dd('0x1d')]=qs[_0x02dd('0x1d')](_0x18d5a2['query'][_0x02dd('0x1d')]);}_0x9dbab2[_0x02dd('0x36')]=qs[_0x02dd('0x37')](_0x18d5a2[_0x02dd('0x30')][_0x02dd('0x37')]);_0x9dbab2[_0x02dd('0x38')]=qs[_0x02dd('0x39')](_['pick'](_0x18d5a2['query'],_0x3e192a[_0x02dd('0x39')]),_0x8cde29);if(_0x18d5a2[_0x02dd('0x30')][_0x02dd('0x3a')]){_0x9dbab2[_0x02dd('0x38')]=_['merge'](_0x9dbab2[_0x02dd('0x38')],{'$or':_[_0x02dd('0x3b')](_0x8cde29,function(_0x739afe){if(_0x739afe[_0x02dd('0x3c')]!==_0x02dd('0x3d')){var _0x3dea90={};_0x3dea90[_0x739afe[_0x02dd('0x2e')]]={'$like':'%'+_0x18d5a2['query'][_0x02dd('0x3a')]+'%'};return _0x3dea90;}})});}_0x9dbab2=_['merge']({},_0x9dbab2,_0x18d5a2[_0x02dd('0x3e')]);var _0xb11758={'where':_0x9dbab2[_0x02dd('0x38')]};return db[_0x02dd('0x2a')][_0x02dd('0x1f')](_0xb11758)[_0x02dd('0x24')](function(_0x346682){_0x331c2e[_0x02dd('0x1f')]=_0x346682;if(_0x18d5a2[_0x02dd('0x30')][_0x02dd('0x3f')]){_0x9dbab2[_0x02dd('0x40')]=[{'all':!![]}];}return db[_0x02dd('0x2a')][_0x02dd('0x41')](_0x9dbab2);})['then'](function(_0x4dd9e2){_0x331c2e[_0x02dd('0x42')]=_0x4dd9e2;return _0x331c2e;})[_0x02dd('0x24')](respondWithFilteredResult(_0x29ad80,_0x9dbab2))[_0x02dd('0x43')](handleError(_0x29ad80,null));};exports[_0x02dd('0x44')]=function(_0x4bf2d8,_0x172a64){var _0x394546={'raw':!![],'where':{'id':_0x4bf2d8[_0x02dd('0x45')]['id']}},_0x53a3e6={};_0x53a3e6[_0x02dd('0x32')]=_[_0x02dd('0x2f')](db[_0x02dd('0x2a')][_0x02dd('0x2b')]);_0x53a3e6[_0x02dd('0x30')]=_[_0x02dd('0x2f')](_0x4bf2d8[_0x02dd('0x30')]);_0x53a3e6[_0x02dd('0x39')]=_[_0x02dd('0x31')](_0x53a3e6[_0x02dd('0x32')],_0x53a3e6['query']);_0x394546['attributes']=_[_0x02dd('0x31')](_0x53a3e6['model'],qs['fields'](_0x4bf2d8[_0x02dd('0x30')][_0x02dd('0x34')]));_0x394546[_0x02dd('0x33')]=_0x394546[_0x02dd('0x33')][_0x02dd('0x46')]?_0x394546[_0x02dd('0x33')]:_0x53a3e6['model'];if(_0x4bf2d8[_0x02dd('0x30')][_0x02dd('0x3f')]){_0x394546[_0x02dd('0x40')]=[{'all':!![]}];}_0x394546=_[_0x02dd('0x47')]({},_0x394546,_0x4bf2d8['options']);return db[_0x02dd('0x2a')][_0x02dd('0x48')](_0x394546)['then'](handleEntityNotFound(_0x172a64,null))[_0x02dd('0x24')](respondWithResult(_0x172a64,null))[_0x02dd('0x43')](handleError(_0x172a64,null));};exports['create']=function(_0x9cf8e2,_0x5204a8){return db[_0x02dd('0x2a')][_0x02dd('0x49')](_0x9cf8e2[_0x02dd('0x4a')],{})[_0x02dd('0x24')](respondWithResult(_0x5204a8,0xc9))[_0x02dd('0x43')](handleError(_0x5204a8,null));};exports[_0x02dd('0x23')]=function(_0xc3a64,_0x2bca34){if(_0xc3a64['body']['id']){delete _0xc3a64[_0x02dd('0x4a')]['id'];}return db['ServicenowField'][_0x02dd('0x48')]({'where':{'id':_0xc3a64[_0x02dd('0x45')]['id']}})[_0x02dd('0x24')](handleEntityNotFound(_0x2bca34,null))[_0x02dd('0x24')](saveUpdates(_0xc3a64['body'],null))[_0x02dd('0x24')](respondWithResult(_0x2bca34,null))[_0x02dd('0x43')](handleError(_0x2bca34,null));};exports[_0x02dd('0x25')]=function(_0x3d3b82,_0x18508c){return db[_0x02dd('0x2a')][_0x02dd('0x48')]({'where':{'id':_0x3d3b82[_0x02dd('0x45')]['id']}})[_0x02dd('0x24')](handleEntityNotFound(_0x18508c,null))[_0x02dd('0x24')](removeEntity(_0x18508c,null))[_0x02dd('0x43')](handleError(_0x18508c,null));};
\ No newline at end of file
+var _0x00d9=['bluebird','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','then','error','stack','name','ServicenowField','type','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','options','includeAll','rows','catch','show','params','rawAttributes','find','create','body','update','destroy','eml-format','rimraf','zip-dir','fast-json-patch','moment'];(function(_0x2bf526,_0xeca6fc){var _0x4e4886=function(_0xcd8f33){while(--_0xcd8f33){_0x2bf526['push'](_0x2bf526['shift']());}};_0x4e4886(++_0xeca6fc);}(_0x00d9,0xd3));var _0x900d=function(_0x45783c,_0x49c56d){_0x45783c=_0x45783c-0x0;var _0x1161da=_0x00d9[_0x45783c];return _0x1161da;};'use strict';var emlformat=require(_0x900d('0x0'));var rimraf=require(_0x900d('0x1'));var zipdir=require(_0x900d('0x2'));var jsonpatch=require(_0x900d('0x3'));var rp=require('request-promise');var moment=require(_0x900d('0x4'));var BPromise=require(_0x900d('0x5'));var Mustache=require(_0x900d('0x6'));var util=require(_0x900d('0x7'));var path=require('path');var sox=require(_0x900d('0x8'));var csv=require(_0x900d('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x900d('0xa'));var squel=require(_0x900d('0xb'));var crypto=require(_0x900d('0xc'));var jsforce=require(_0x900d('0xd'));var deskjs=require(_0x900d('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x900d('0xf'));var Redis=require(_0x900d('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x900d('0x11'));var as=require(_0x900d('0x12'));var hardwareService=require(_0x900d('0x13'));var logger=require(_0x900d('0x14'))('api');var utils=require(_0x900d('0x15'));var config=require(_0x900d('0x16'));var licenseUtil=require(_0x900d('0x17'));var db=require(_0x900d('0x18'))['db'];function respondWithStatusCode(_0x5ab185,_0x46f150){_0x46f150=_0x46f150||0xcc;return function(_0x1190a4){if(_0x1190a4){return _0x5ab185[_0x900d('0x19')](_0x46f150);}return _0x5ab185[_0x900d('0x1a')](_0x46f150)['end']();};}function respondWithResult(_0x5b1a6b,_0x50e2cd){_0x50e2cd=_0x50e2cd||0xc8;return function(_0x2b81c5){if(_0x2b81c5){return _0x5b1a6b[_0x900d('0x1a')](_0x50e2cd)[_0x900d('0x1b')](_0x2b81c5);}};}function respondWithFilteredResult(_0x262c27,_0xbecf1f){return function(_0x2edac2){if(_0x2edac2){var _0x41f80a=typeof _0xbecf1f['offset']===_0x900d('0x1c')&&typeof _0xbecf1f[_0x900d('0x1d')]===_0x900d('0x1c');var _0x2cb35c=_0x2edac2[_0x900d('0x1e')];var _0x291fde=_0x41f80a?0x0:_0xbecf1f[_0x900d('0x1f')];var _0x32ba97=_0x41f80a?_0x2edac2[_0x900d('0x1e')]:_0xbecf1f[_0x900d('0x1f')]+_0xbecf1f['limit'];var _0x2042bd;if(_0x32ba97>=_0x2cb35c){_0x32ba97=_0x2cb35c;_0x2042bd=0xc8;}else{_0x2042bd=0xce;}_0x262c27['status'](_0x2042bd);return _0x262c27[_0x900d('0x20')](_0x900d('0x21'),_0x291fde+'-'+_0x32ba97+'/'+_0x2cb35c)[_0x900d('0x1b')](_0x2edac2);}return null;};}function patchUpdates(_0x1bb8f3){return function(_0x10d6aa){try{jsonpatch[_0x900d('0x22')](_0x10d6aa,_0x1bb8f3,!![]);}catch(_0x4ee06e){return BPromise[_0x900d('0x23')](_0x4ee06e);}return _0x10d6aa[_0x900d('0x24')]();};}function saveUpdates(_0x5e7672,_0xfe6b48){return function(_0x2e3027){if(_0x2e3027){return _0x2e3027['update'](_0x5e7672)[_0x900d('0x25')](function(_0x57c697){return _0x57c697;});}return null;};}function removeEntity(_0x414873,_0x57f255){return function(_0x38a686){if(_0x38a686){return _0x38a686['destroy']()[_0x900d('0x25')](function(){_0x414873[_0x900d('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4b0a62,_0x6bff08){return function(_0x275a04){if(!_0x275a04){_0x4b0a62[_0x900d('0x19')](0x194);}return _0x275a04;};}function handleError(_0x34a28b,_0xf27de6){_0xf27de6=_0xf27de6||0x1f4;return function(_0x1260b4){logger[_0x900d('0x26')](_0x1260b4[_0x900d('0x27')]);if(_0x1260b4[_0x900d('0x28')]){delete _0x1260b4[_0x900d('0x28')];}_0x34a28b[_0x900d('0x1a')](_0xf27de6)['send'](_0x1260b4);};}exports['index']=function(_0x20a0e1,_0x5a07ea){var _0x1fca35={},_0x176246={},_0x14be64={'count':0x0,'rows':[]};var _0x1ffbf4=_['map'](db[_0x900d('0x29')]['rawAttributes'],function(_0xabbe1a){return{'name':_0xabbe1a['fieldName'],'type':_0xabbe1a[_0x900d('0x2a')]['key']};});_0x176246[_0x900d('0x2b')]=_['map'](_0x1ffbf4,_0x900d('0x28'));_0x176246['query']=_[_0x900d('0x2c')](_0x20a0e1['query']);_0x176246[_0x900d('0x2d')]=_[_0x900d('0x2e')](_0x176246['model'],_0x176246[_0x900d('0x2f')]);_0x1fca35[_0x900d('0x30')]=_['intersection'](_0x176246[_0x900d('0x2b')],qs[_0x900d('0x31')](_0x20a0e1['query'][_0x900d('0x31')]));_0x1fca35[_0x900d('0x30')]=_0x1fca35[_0x900d('0x30')][_0x900d('0x32')]?_0x1fca35[_0x900d('0x30')]:_0x176246[_0x900d('0x2b')];if(!_0x20a0e1[_0x900d('0x2f')][_0x900d('0x33')](_0x900d('0x34'))){_0x1fca35[_0x900d('0x1d')]=qs[_0x900d('0x1d')](_0x20a0e1[_0x900d('0x2f')]['limit']);_0x1fca35[_0x900d('0x1f')]=qs[_0x900d('0x1f')](_0x20a0e1['query'][_0x900d('0x1f')]);}_0x1fca35[_0x900d('0x35')]=qs['sort'](_0x20a0e1['query'][_0x900d('0x36')]);_0x1fca35[_0x900d('0x37')]=qs['filters'](_[_0x900d('0x38')](_0x20a0e1[_0x900d('0x2f')],_0x176246[_0x900d('0x2d')]),_0x1ffbf4);if(_0x20a0e1[_0x900d('0x2f')][_0x900d('0x39')]){_0x1fca35[_0x900d('0x37')]=_[_0x900d('0x3a')](_0x1fca35[_0x900d('0x37')],{'$or':_[_0x900d('0x3b')](_0x1ffbf4,function(_0x15b366){if(_0x15b366[_0x900d('0x2a')]!=='VIRTUAL'){var _0x42c855={};_0x42c855[_0x15b366[_0x900d('0x28')]]={'$like':'%'+_0x20a0e1[_0x900d('0x2f')][_0x900d('0x39')]+'%'};return _0x42c855;}})});}_0x1fca35=_[_0x900d('0x3a')]({},_0x1fca35,_0x20a0e1[_0x900d('0x3c')]);var _0xeffeea={'where':_0x1fca35[_0x900d('0x37')]};return db[_0x900d('0x29')]['count'](_0xeffeea)[_0x900d('0x25')](function(_0x17103e){_0x14be64['count']=_0x17103e;if(_0x20a0e1[_0x900d('0x2f')][_0x900d('0x3d')]){_0x1fca35['include']=[{'all':!![]}];}return db[_0x900d('0x29')]['findAll'](_0x1fca35);})[_0x900d('0x25')](function(_0x30962b){_0x14be64[_0x900d('0x3e')]=_0x30962b;return _0x14be64;})[_0x900d('0x25')](respondWithFilteredResult(_0x5a07ea,_0x1fca35))[_0x900d('0x3f')](handleError(_0x5a07ea,null));};exports[_0x900d('0x40')]=function(_0x3a2e17,_0x3524e0){var _0x166309={'raw':!![],'where':{'id':_0x3a2e17[_0x900d('0x41')]['id']}},_0x3fa208={};_0x3fa208['model']=_[_0x900d('0x2c')](db[_0x900d('0x29')][_0x900d('0x42')]);_0x3fa208[_0x900d('0x2f')]=_[_0x900d('0x2c')](_0x3a2e17['query']);_0x3fa208[_0x900d('0x2d')]=_[_0x900d('0x2e')](_0x3fa208['model'],_0x3fa208[_0x900d('0x2f')]);_0x166309[_0x900d('0x30')]=_[_0x900d('0x2e')](_0x3fa208[_0x900d('0x2b')],qs['fields'](_0x3a2e17[_0x900d('0x2f')][_0x900d('0x31')]));_0x166309['attributes']=_0x166309[_0x900d('0x30')][_0x900d('0x32')]?_0x166309[_0x900d('0x30')]:_0x3fa208['model'];if(_0x3a2e17[_0x900d('0x2f')][_0x900d('0x3d')]){_0x166309['include']=[{'all':!![]}];}_0x166309=_[_0x900d('0x3a')]({},_0x166309,_0x3a2e17[_0x900d('0x3c')]);return db[_0x900d('0x29')][_0x900d('0x43')](_0x166309)[_0x900d('0x25')](handleEntityNotFound(_0x3524e0,null))['then'](respondWithResult(_0x3524e0,null))[_0x900d('0x3f')](handleError(_0x3524e0,null));};exports[_0x900d('0x44')]=function(_0x722fcd,_0x1d6f30){return db[_0x900d('0x29')][_0x900d('0x44')](_0x722fcd[_0x900d('0x45')],{})['then'](respondWithResult(_0x1d6f30,0xc9))[_0x900d('0x3f')](handleError(_0x1d6f30,null));};exports[_0x900d('0x46')]=function(_0x492b94,_0x4d35be){if(_0x492b94[_0x900d('0x45')]['id']){delete _0x492b94[_0x900d('0x45')]['id'];}return db[_0x900d('0x29')]['find']({'where':{'id':_0x492b94[_0x900d('0x41')]['id']}})['then'](handleEntityNotFound(_0x4d35be,null))[_0x900d('0x25')](saveUpdates(_0x492b94[_0x900d('0x45')],null))[_0x900d('0x25')](respondWithResult(_0x4d35be,null))[_0x900d('0x3f')](handleError(_0x4d35be,null));};exports[_0x900d('0x47')]=function(_0x41d13b,_0x4d6f33){return db[_0x900d('0x29')][_0x900d('0x43')]({'where':{'id':_0x41d13b['params']['id']}})[_0x900d('0x25')](handleEntityNotFound(_0x4d6f33,null))[_0x900d('0x25')](removeEntity(_0x4d6f33,null))['catch'](handleError(_0x4d6f33,null));};
\ No newline at end of file
index 59d337f..6c3c2df 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6def=['lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intServicenowField.attributes','define','int_servicenow_fields','servicenow_unique_index','FieldId'];(function(_0x4366e7,_0x16cd29){var _0x176080=function(_0x24456a){while(--_0x24456a){_0x4366e7['push'](_0x4366e7['shift']());}};_0x176080(++_0x16cd29);}(_0x6def,0x1a0));var _0xf6de=function(_0x3c8e07,_0x1c507f){_0x3c8e07=_0x3c8e07-0x0;var _0x3893d3=_0x6def[_0x3c8e07];return _0x3893d3;};'use strict';var _=require(_0xf6de('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf6de('0x1'));var moment=require(_0xf6de('0x2'));var BPromise=require(_0xf6de('0x3'));var rp=require(_0xf6de('0x4'));var fs=require('fs');var path=require(_0xf6de('0x5'));var rimraf=require(_0xf6de('0x6'));var config=require(_0xf6de('0x7'));var attributes=require(_0xf6de('0x8'));module['exports']=function(_0x4b9591,_0x48e622){return _0x4b9591[_0xf6de('0x9')]('ServicenowField',attributes,{'tableName':_0xf6de('0xa'),'paranoid':![],'indexes':[{'name':_0xf6de('0xb'),'fields':['idField',_0xf6de('0xc')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xab29=['./intServicenowField.attributes','exports','ServicenowField','int_servicenow_fields','servicenow_unique_index','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0xd1c39b,_0x16f0c6){var _0x58f5bc=function(_0x412cf3){while(--_0x412cf3){_0xd1c39b['push'](_0xd1c39b['shift']());}};_0x58f5bc(++_0x16f0c6);}(_0xab29,0x1b6));var _0x9ab2=function(_0x32cf27,_0x5c30d3){_0x32cf27=_0x32cf27-0x0;var _0x5422b0=_0xab29[_0x32cf27];return _0x5422b0;};'use strict';var _=require(_0x9ab2('0x0'));var util=require(_0x9ab2('0x1'));var logger=require(_0x9ab2('0x2'))(_0x9ab2('0x3'));var moment=require(_0x9ab2('0x4'));var BPromise=require(_0x9ab2('0x5'));var rp=require(_0x9ab2('0x6'));var fs=require('fs');var path=require(_0x9ab2('0x7'));var rimraf=require(_0x9ab2('0x8'));var config=require(_0x9ab2('0x9'));var attributes=require(_0x9ab2('0xa'));module[_0x9ab2('0xb')]=function(_0x3ec89a,_0x1cc379){return _0x3ec89a['define'](_0x9ab2('0xc'),attributes,{'tableName':_0x9ab2('0xd'),'paranoid':![],'indexes':[{'name':_0x9ab2('0xe'),'fields':['idField',_0x9ab2('0xf')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 569ffa5..e055ca9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe706=['http','request','then','info','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x16c95a,_0x1910e6){var _0x4af5be=function(_0x1279cf){while(--_0x1279cf){_0x16c95a['push'](_0x16c95a['shift']());}};_0x4af5be(++_0x1910e6);}(_0xe706,0xa3));var _0x6e70=function(_0x510cd9,_0x551300){_0x510cd9=_0x510cd9-0x0;var _0x2b1f61=_0xe706[_0x510cd9];return _0x2b1f61;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var moment=require(_0x6e70('0x2'));var BPromise=require('bluebird');var rs=require(_0x6e70('0x3'));var fs=require('fs');var Redis=require(_0x6e70('0x4'));var db=require(_0x6e70('0x5'))['db'];var utils=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));var config=require(_0x6e70('0x9'));var jayson=require(_0x6e70('0xa'));var client=jayson[_0x6e70('0xb')][_0x6e70('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x36357b,_0x293ce7,_0x45a2d4){return new BPromise(function(_0x188ed3,_0x3c4843){return client[_0x6e70('0xd')](_0x36357b,_0x45a2d4)[_0x6e70('0xe')](function(_0x25e61c){logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,_0x6e70('0x11'));logger[_0x6e70('0x12')](_0x6e70('0x13'),_0x293ce7,_0x6e70('0x11'),JSON['stringify'](_0x25e61c));if(_0x25e61c['error']){if(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x15')]===0x1f4){logger[_0x6e70('0x14')](_0x6e70('0x10'),_0x293ce7,_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);return _0x3c4843(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);}logger['error']('ServicenowField,\x20%s,\x20%s',_0x293ce7,_0x25e61c['error'][_0x6e70('0x16')]);return _0x188ed3(_0x25e61c['error']['message']);}else{logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,'request\x20sent');_0x188ed3(_0x25e61c[_0x6e70('0x17')]['message']);}})[_0x6e70('0x18')](function(_0x161f23){logger['error']('ServicenowField,\x20%s,\x20%s',_0x293ce7,_0x161f23);_0x3c4843(_0x161f23);});});}
\ No newline at end of file
+var _0xaa88=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','info','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','error','ServicenowField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird'];(function(_0x52b62b,_0x1100cd){var _0x3d14d0=function(_0x1b5ef7){while(--_0x1b5ef7){_0x52b62b['push'](_0x52b62b['shift']());}};_0x3d14d0(++_0x1100cd);}(_0xaa88,0x137));var _0x8aa8=function(_0x466247,_0x5d69e3){_0x466247=_0x466247-0x0;var _0x4b352e=_0xaa88[_0x466247];return _0x4b352e;};'use strict';var _=require(_0x8aa8('0x0'));var util=require(_0x8aa8('0x1'));var moment=require(_0x8aa8('0x2'));var BPromise=require(_0x8aa8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8aa8('0x4'));var db=require(_0x8aa8('0x5'))['db'];var utils=require(_0x8aa8('0x6'));var logger=require(_0x8aa8('0x7'))(_0x8aa8('0x8'));var config=require(_0x8aa8('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x8aa8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5264ff,_0x449d2d,_0x1ed84d){return new BPromise(function(_0x27c08d,_0x40826f){return client['request'](_0x5264ff,_0x1ed84d)[_0x8aa8('0xb')](function(_0x2d974c){logger[_0x8aa8('0xc')]('ServicenowField,\x20%s,\x20%s',_0x449d2d,_0x8aa8('0xd'));logger[_0x8aa8('0xe')](_0x8aa8('0xf'),_0x449d2d,_0x8aa8('0xd'),JSON['stringify'](_0x2d974c));if(_0x2d974c[_0x8aa8('0x10')]){if(_0x2d974c[_0x8aa8('0x10')]['code']===0x1f4){logger[_0x8aa8('0x10')](_0x8aa8('0x11'),_0x449d2d,_0x2d974c[_0x8aa8('0x10')]['message']);return _0x40826f(_0x2d974c[_0x8aa8('0x10')][_0x8aa8('0x12')]);}logger[_0x8aa8('0x10')]('ServicenowField,\x20%s,\x20%s',_0x449d2d,_0x2d974c[_0x8aa8('0x10')]['message']);return _0x27c08d(_0x2d974c['error'][_0x8aa8('0x12')]);}else{logger[_0x8aa8('0xc')](_0x8aa8('0x11'),_0x449d2d,_0x8aa8('0xd'));_0x27c08d(_0x2d974c[_0x8aa8('0x13')][_0x8aa8('0x12')]);}})[_0x8aa8('0x14')](function(_0xd59fb8){logger[_0x8aa8('0x10')]('ServicenowField,\x20%s,\x20%s',_0x449d2d,_0xd59fb8);_0x40826f(_0xd59fb8);});});}
\ No newline at end of file
index 070bc79..49e72db 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0xa22b9,_0x5da86e){var _0x1d5bc4=function(_0x3cff4a){while(--_0x3cff4a){_0xa22b9['push'](_0xa22b9['shift']());}};_0x1d5bc4(++_0x5da86e);}(_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
+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(_0x1563f5,_0x731195){var _0x52cfb2=function(_0x7e239e){while(--_0x7e239e){_0x1563f5['push'](_0x1563f5['shift']());}};_0x52cfb2(++_0x731195);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router;
\ No newline at end of file
index 2a7b6af..7b50723 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['remoteUri','sequelize','exports','STRING','username'];(function(_0x4e4a54,_0x3aea53){var _0xe99c97=function(_0xb3b33d){while(--_0xb3b33d){_0x4e4a54['push'](_0x4e4a54['shift']());}};_0xe99c97(++_0x3aea53);}(_0xa9e0,0x123));var _0x0a9e=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0xa9e0[_0xc6be3a];return _0x56a310;};'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(_0x3499c1,_0x24f84f){var _0xbc25d7=function(_0x3b81ba){while(--_0x3b81ba){_0x3499c1['push'](_0x3499c1['shift']());}};_0xbc25d7(++_0x24f84f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0xa9e0[_0x2763f2];return _0x3ef471;};'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 6950724..15d93b6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6326=['Subjects','assigned_user_id','description','date_start','duration_hours','parent_id','parent_type','parent_name','direction','username','password','remoteUri','slice','lastIndexOf','%s%s','login','JSON','stringify','PLAIN','xCALLY\x20Motion\x20Integration','Password\x20Expired','POST','/service/v4_1/rest.php','get_module_fields','Calls','values','module_fields','remove','label','endsWith','value','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','send','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','request-promise','moment','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','destroy','then','stack','name','index','map','SugarcrmAccount','rawAttributes','fieldName','type','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','options','includeAll','include','findAll','show','params','keys','catch','create','body','find','getConfigurations','SugarcrmConfiguration','merge','addConfiguration','findOne','AccountId','Descriptions','getDescriptions','channel','SugarcrmField'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0x6326,0x18d));var _0x6632=function(_0x1d6f0f,_0x18a467){_0x1d6f0f=_0x1d6f0f-0x0;var _0x2b3aa7=_0x6326[_0x1d6f0f];return _0x2b3aa7;};'use strict';var emlformat=require(_0x6632('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6632('0x1'));var jsonpatch=require(_0x6632('0x2'));var rp=require(_0x6632('0x3'));var moment=require(_0x6632('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x6632('0x5'));var csv=require(_0x6632('0x6'));var ejs=require(_0x6632('0x7'));var fs=require('fs');var fs_extra=require(_0x6632('0x8'));var _=require(_0x6632('0x9'));var squel=require('squel');var crypto=require(_0x6632('0xa'));var jsforce=require(_0x6632('0xb'));var deskjs=require(_0x6632('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x6632('0xd'));var Redis=require(_0x6632('0xe'));var authService=require(_0x6632('0xf'));var qs=require(_0x6632('0x10'));var as=require(_0x6632('0x11'));var hardwareService=require(_0x6632('0x12'));var logger=require(_0x6632('0x13'))(_0x6632('0x14'));var utils=require(_0x6632('0x15'));var config=require(_0x6632('0x16'));var licenseUtil=require(_0x6632('0x17'));var db=require(_0x6632('0x18'))['db'];var integrations=require(_0x6632('0x19'));function respondWithStatusCode(_0x26cd8c,_0x21e573){_0x21e573=_0x21e573||0xcc;return function(_0x529abf){if(_0x529abf){return _0x26cd8c[_0x6632('0x1a')](_0x21e573);}return _0x26cd8c[_0x6632('0x1b')](_0x21e573)[_0x6632('0x1c')]();};}function respondWithResult(_0x32e934,_0x7d8490){_0x7d8490=_0x7d8490||0xc8;return function(_0x2e5c1a){if(_0x2e5c1a){return _0x32e934[_0x6632('0x1b')](_0x7d8490)[_0x6632('0x1d')](_0x2e5c1a);}};}function respondWithFilteredResult(_0xf50e4,_0x2a9eb3){return function(_0x3ee63a){if(_0x3ee63a){var _0x2d22ec=typeof _0x2a9eb3[_0x6632('0x1e')]===_0x6632('0x1f')&&typeof _0x2a9eb3[_0x6632('0x20')]===_0x6632('0x1f');var _0x4498ff=_0x3ee63a['count'];var _0x597648=_0x2d22ec?0x0:_0x2a9eb3[_0x6632('0x1e')];var _0x45b412=_0x2d22ec?_0x3ee63a[_0x6632('0x21')]:_0x2a9eb3[_0x6632('0x1e')]+_0x2a9eb3[_0x6632('0x20')];var _0x42c932;if(_0x45b412>=_0x4498ff){_0x45b412=_0x4498ff;_0x42c932=0xc8;}else{_0x42c932=0xce;}_0xf50e4[_0x6632('0x1b')](_0x42c932);return _0xf50e4['set'](_0x6632('0x22'),_0x597648+'-'+_0x45b412+'/'+_0x4498ff)[_0x6632('0x1d')](_0x3ee63a);}return null;};}function patchUpdates(_0x145121){return function(_0x2d08af){try{jsonpatch['apply'](_0x2d08af,_0x145121,!![]);}catch(_0x310465){return BPromise[_0x6632('0x23')](_0x310465);}return _0x2d08af[_0x6632('0x24')]();};}function saveUpdates(_0x13858f,_0x1e0870){return function(_0x46c72a){if(_0x46c72a){return _0x46c72a[_0x6632('0x25')](_0x13858f)['then'](function(_0x540dcd){return _0x540dcd;});}return null;};}function removeEntity(_0x2968cf,_0x1dbe22){return function(_0x259664){if(_0x259664){return _0x259664[_0x6632('0x26')]()[_0x6632('0x27')](function(){_0x2968cf[_0x6632('0x1b')](0xcc)[_0x6632('0x1c')]();});}};}function handleEntityNotFound(_0x329264,_0x3c72ae){return function(_0x3e4cba){if(!_0x3e4cba){_0x329264[_0x6632('0x1a')](0x194);}return _0x3e4cba;};}function handleError(_0x3cdd33,_0x483f08){_0x483f08=_0x483f08||0x1f4;return function(_0x573dab){logger['error'](_0x573dab[_0x6632('0x28')]);if(_0x573dab['name']){delete _0x573dab[_0x6632('0x29')];}_0x3cdd33[_0x6632('0x1b')](_0x483f08)['send'](_0x573dab);};}exports[_0x6632('0x2a')]=function(_0x1f21b0,_0x47bf42){var _0x792f16={},_0x47f8af={},_0x51ab22={'count':0x0,'rows':[]};var _0x19ac47=_[_0x6632('0x2b')](db[_0x6632('0x2c')][_0x6632('0x2d')],function(_0x3d3c4c){return{'name':_0x3d3c4c[_0x6632('0x2e')],'type':_0x3d3c4c[_0x6632('0x2f')]['key']};});_0x47f8af[_0x6632('0x30')]=_['map'](_0x19ac47,'name');_0x47f8af[_0x6632('0x31')]=_['keys'](_0x1f21b0['query']);_0x47f8af[_0x6632('0x32')]=_['intersection'](_0x47f8af[_0x6632('0x30')],_0x47f8af[_0x6632('0x31')]);_0x792f16['attributes']=_[_0x6632('0x33')](_0x47f8af[_0x6632('0x30')],qs[_0x6632('0x34')](_0x1f21b0[_0x6632('0x31')][_0x6632('0x34')]));_0x792f16['attributes']=_0x792f16[_0x6632('0x35')][_0x6632('0x36')]?_0x792f16[_0x6632('0x35')]:_0x47f8af[_0x6632('0x30')];if(!_0x1f21b0[_0x6632('0x31')][_0x6632('0x37')](_0x6632('0x38'))){_0x792f16[_0x6632('0x20')]=qs[_0x6632('0x20')](_0x1f21b0['query'][_0x6632('0x20')]);_0x792f16[_0x6632('0x1e')]=qs[_0x6632('0x1e')](_0x1f21b0['query'][_0x6632('0x1e')]);}_0x792f16[_0x6632('0x39')]=qs[_0x6632('0x3a')](_0x1f21b0['query'][_0x6632('0x3a')]);_0x792f16[_0x6632('0x3b')]=qs[_0x6632('0x32')](_[_0x6632('0x3c')](_0x1f21b0[_0x6632('0x31')],_0x47f8af['filters']),_0x19ac47);if(_0x1f21b0[_0x6632('0x31')][_0x6632('0x3d')]){_0x792f16[_0x6632('0x3b')]=_['merge'](_0x792f16['where'],{'$or':_[_0x6632('0x2b')](_0x19ac47,function(_0x2e9742){if(_0x2e9742[_0x6632('0x2f')]!=='VIRTUAL'){var _0x3b7a81={};_0x3b7a81[_0x2e9742[_0x6632('0x29')]]={'$like':'%'+_0x1f21b0[_0x6632('0x31')][_0x6632('0x3d')]+'%'};return _0x3b7a81;}})});}_0x792f16=_['merge']({},_0x792f16,_0x1f21b0[_0x6632('0x3e')]);var _0x524111={'where':_0x792f16['where']};return db[_0x6632('0x2c')]['count'](_0x524111)[_0x6632('0x27')](function(_0xb1b45b){_0x51ab22['count']=_0xb1b45b;if(_0x1f21b0[_0x6632('0x31')][_0x6632('0x3f')]){_0x792f16[_0x6632('0x40')]=[{'all':!![]}];}return db[_0x6632('0x2c')][_0x6632('0x41')](_0x792f16);})[_0x6632('0x27')](function(_0x1dfa7d){_0x51ab22['rows']=_0x1dfa7d;return _0x51ab22;})['then'](respondWithFilteredResult(_0x47bf42,_0x792f16))['catch'](handleError(_0x47bf42,null));};exports[_0x6632('0x42')]=function(_0x1d0dd6,_0x10d9a0){var _0x4dd9d0={'raw':![],'where':{'id':_0x1d0dd6[_0x6632('0x43')]['id']}},_0x1cb3bd={};_0x1cb3bd[_0x6632('0x30')]=_['keys'](db[_0x6632('0x2c')][_0x6632('0x2d')]);_0x1cb3bd['query']=_[_0x6632('0x44')](_0x1d0dd6['query']);_0x1cb3bd[_0x6632('0x32')]=_[_0x6632('0x33')](_0x1cb3bd[_0x6632('0x30')],_0x1cb3bd[_0x6632('0x31')]);_0x4dd9d0[_0x6632('0x35')]=_[_0x6632('0x33')](_0x1cb3bd[_0x6632('0x30')],qs[_0x6632('0x34')](_0x1d0dd6[_0x6632('0x31')][_0x6632('0x34')]));_0x4dd9d0[_0x6632('0x35')]=_0x4dd9d0[_0x6632('0x35')][_0x6632('0x36')]?_0x4dd9d0['attributes']:_0x1cb3bd[_0x6632('0x30')];if(_0x1d0dd6[_0x6632('0x31')][_0x6632('0x3f')]){_0x4dd9d0[_0x6632('0x40')]=[{'all':!![]}];}_0x4dd9d0=_['merge']({},_0x4dd9d0,_0x1d0dd6[_0x6632('0x3e')]);return db[_0x6632('0x2c')]['find'](_0x4dd9d0)['then'](handleEntityNotFound(_0x10d9a0,null))[_0x6632('0x27')](respondWithResult(_0x10d9a0,null))[_0x6632('0x45')](handleError(_0x10d9a0,null));};exports[_0x6632('0x46')]=function(_0x59f4f5,_0x3f1d3b){return db[_0x6632('0x2c')][_0x6632('0x46')](_0x59f4f5[_0x6632('0x47')],{})['then'](respondWithResult(_0x3f1d3b,0xc9))['catch'](handleError(_0x3f1d3b,null));};exports['update']=function(_0x447705,_0xae0597){if(_0x447705['body']['id']){delete _0x447705['body']['id'];}return db[_0x6632('0x2c')][_0x6632('0x48')]({'where':{'id':_0x447705[_0x6632('0x43')]['id']}})['then'](handleEntityNotFound(_0xae0597,null))[_0x6632('0x27')](saveUpdates(_0x447705['body'],null))['then'](respondWithResult(_0xae0597,null))[_0x6632('0x45')](handleError(_0xae0597,null));};exports[_0x6632('0x26')]=function(_0x55140e,_0x23befb){return db[_0x6632('0x2c')]['find']({'where':{'id':_0x55140e[_0x6632('0x43')]['id']}})['then'](handleEntityNotFound(_0x23befb,null))[_0x6632('0x27')](removeEntity(_0x23befb,null))[_0x6632('0x45')](handleError(_0x23befb,null));};exports[_0x6632('0x49')]=function(_0xbe8caa,_0x173c0c,_0x4046bb){var _0x4de157={};var _0x236889={};var _0x473fdc;var _0x4b2709;return db[_0x6632('0x2c')]['findOne']({'where':{'id':_0xbe8caa[_0x6632('0x43')]['id']}})['then'](handleEntityNotFound(_0x173c0c,null))[_0x6632('0x27')](function(_0x58f661){if(_0x58f661){_0x473fdc=_0x58f661;_0x236889[_0x6632('0x30')]=_[_0x6632('0x44')](db[_0x6632('0x4a')]['rawAttributes']);_0x236889[_0x6632('0x31')]=_[_0x6632('0x44')](_0xbe8caa['query']);_0x236889[_0x6632('0x32')]=_['intersection'](_0x236889['model'],_0x236889[_0x6632('0x31')]);_0x4de157[_0x6632('0x35')]=_[_0x6632('0x33')](_0x236889[_0x6632('0x30')],qs['fields'](_0xbe8caa[_0x6632('0x31')][_0x6632('0x34')]));_0x4de157[_0x6632('0x35')]=_0x4de157[_0x6632('0x35')][_0x6632('0x36')]?_0x4de157[_0x6632('0x35')]:_0x236889[_0x6632('0x30')];_0x4de157[_0x6632('0x39')]=qs[_0x6632('0x3a')](_0xbe8caa[_0x6632('0x31')][_0x6632('0x3a')]);_0x4de157[_0x6632('0x3b')]=qs['filters'](_[_0x6632('0x3c')](_0xbe8caa['query'],_0x236889['filters']));if(_0xbe8caa['query'][_0x6632('0x3d')]){_0x4de157[_0x6632('0x3b')]=_[_0x6632('0x4b')](_0x4de157[_0x6632('0x3b')],{'$or':_[_0x6632('0x2b')](_0x4de157[_0x6632('0x35')],function(_0x1e3e12){var _0x4b9e66={};_0x4b9e66[_0x1e3e12]={'$like':'%'+_0xbe8caa['query'][_0x6632('0x3d')]+'%'};return _0x4b9e66;})});}_0x4de157=_[_0x6632('0x4b')]({},_0x4de157,_0xbe8caa['options']);return _0x473fdc[_0x6632('0x49')](_0x4de157);}})[_0x6632('0x27')](function(_0x233ead){if(_0x233ead){_0x4b2709=_0x233ead[_0x6632('0x36')];if(!_0xbe8caa[_0x6632('0x31')]['hasOwnProperty']('nolimit')){_0x4de157[_0x6632('0x20')]=qs[_0x6632('0x20')](_0xbe8caa[_0x6632('0x31')][_0x6632('0x20')]);_0x4de157[_0x6632('0x1e')]=qs[_0x6632('0x1e')](_0xbe8caa[_0x6632('0x31')][_0x6632('0x1e')]);}return _0x473fdc['getConfigurations'](_0x4de157);}})[_0x6632('0x27')](function(_0x1f6d6d){if(_0x1f6d6d){return _0x1f6d6d?{'count':_0x4b2709,'rows':_0x1f6d6d}:null;}})[_0x6632('0x27')](respondWithResult(_0x173c0c,null))['catch'](handleError(_0x173c0c,null));};exports[_0x6632('0x4c')]=function(_0x396bcc,_0x2f07e9,_0x5dda91){if(_0x396bcc[_0x6632('0x47')]['id']){delete _0x396bcc['body']['id'];}return db[_0x6632('0x2c')][_0x6632('0x4d')]({'where':{'id':_0x396bcc[_0x6632('0x43')]['id']}})[_0x6632('0x27')](handleEntityNotFound(_0x2f07e9,null))[_0x6632('0x27')](function(_0x453560){if(_0x453560){_0x396bcc[_0x6632('0x47')][_0x6632('0x4e')]=_0x453560['id'];_0x396bcc[_0x6632('0x47')]['Subjects']=integrations['getSubjects'](_0x396bcc['body']['channel'],_0x396bcc[_0x6632('0x47')][_0x6632('0x2f')]);_0x396bcc['body'][_0x6632('0x4f')]=integrations[_0x6632('0x50')](_0x396bcc[_0x6632('0x47')][_0x6632('0x51')],_0x396bcc[_0x6632('0x47')][_0x6632('0x2f')]);return db[_0x6632('0x4a')][_0x6632('0x46')](_0x396bcc[_0x6632('0x47')],{'include':[{'model':db[_0x6632('0x52')],'as':_0x6632('0x53')},{'model':db[_0x6632('0x52')],'as':_0x6632('0x4f')}]});}return null;})['then'](respondWithResult(_0x2f07e9,null))['catch'](handleError(_0x2f07e9,null));};exports['getFields']=function(_0x8f4753,_0x5b5252,_0x51149){var _0x153d68='';var _0x5de4d1=['id','name',_0x6632('0x54'),'created_by',_0x6632('0x55'),_0x6632('0x56'),_0x6632('0x57'),'duration_minutes',_0x6632('0x58'),_0x6632('0x59'),_0x6632('0x5a'),_0x6632('0x5b')];return db[_0x6632('0x2c')][_0x6632('0x4d')]({'where':{'id':_0x8f4753['params']['id']},'attributes':['id',_0x6632('0x5c'),_0x6632('0x5d'),_0x6632('0x5e')]})['then'](handleEntityNotFound(_0x5b5252,null))[_0x6632('0x27')](function(_0x4aa519){if(_0x4aa519){_0x153d68=_0x4aa519[_0x6632('0x5e')];var _0x12edf7=_0x153d68[_0x6632('0x5f')](-0x1);if(_0x12edf7==='/'){_0x153d68=_0x153d68['substring'](0x0,_0x153d68[_0x6632('0x60')](_0x12edf7));}return rp({'method':'POST','uri':util['format'](_0x6632('0x61'),_0x153d68,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0x6632('0x62'),'input_type':_0x6632('0x63'),'response_type':_0x6632('0x63'),'rest_data':JSON[_0x6632('0x64')]({'user_auth':{'user_name':_0x4aa519[_0x6632('0x5c')],'password':_0x4aa519[_0x6632('0x5d')],'encryption':_0x6632('0x65')},'application':_0x6632('0x66')})}});}})[_0x6632('0x27')](function(_0x2685f3){if(_0x2685f3&&_0x2685f3[_0x6632('0x29')]!=='Invalid\x20Login'&&_0x2685f3[_0x6632('0x29')]!==_0x6632('0x67')){return rp({'method':_0x6632('0x68'),'uri':util['format']('%s%s',_0x153d68,_0x6632('0x69')),'json':!![],'form':{'method':_0x6632('0x6a'),'input_type':_0x6632('0x63'),'response_type':_0x6632('0x63'),'rest_data':JSON[_0x6632('0x64')]({'session':_0x2685f3['id'],'module_name':_0x6632('0x6b')})}})[_0x6632('0x27')](function(_0x45a771){if(_0x45a771){var _0x366243=_[_0x6632('0x6c')](_0x45a771[_0x6632('0x6d')]);_[_0x6632('0x6e')](_0x366243,function(_0x348803){return _0x5de4d1['includes'](_0x348803[_0x6632('0x29')]);});return{'count':_0x366243[_0x6632('0x36')],'rows':_[_0x6632('0x2b')](_0x366243,function(_0x1d6f09){return{'id':_0x1d6f09[_0x6632('0x29')],'name':_0x1d6f09[_0x6632('0x6f')],'custom':_[_0x6632('0x70')](_0x1d6f09['name'],'_c')?!![]:![],'options':_0x1d6f09[_0x6632('0x3e')]?_[_0x6632('0x2b')](_['values'](_0x1d6f09[_0x6632('0x3e')]),function(_0x1f2327){return{'name':_0x1f2327[_0x6632('0x71')],'value':_0x1f2327[_0x6632('0x29')]};}):[]};})};}})['then'](respondWithResult(_0x5b5252,null))[_0x6632('0x45')](function(_0xccb7ea){var _0x133607=_0x8f4753[_0x6632('0x31')][_0x6632('0x72')]?0x1f4:_0xccb7ea[_0x6632('0x73')]||0x1f4;logger[_0x6632('0x74')](_0x6632('0x75'),'getFields',_0x133607,JSON[_0x6632('0x64')](_0xccb7ea));delete _0xccb7ea[_0x6632('0x29')];if(_0x133607===0x191){_0x133607=0x190;}_0x5b5252[_0x6632('0x1b')](_0x133607)[_0x6632('0x76')](_0x8f4753['query'][_0x6632('0x72')]?{'message':_0x6632('0x77'),'statusCode':_0xccb7ea['statusCode']}:_0xccb7ea);});}else{var _0x104bb1=0x1f4;_0x5b5252['status'](_0x104bb1)[_0x6632('0x76')]({'message':_0x6632('0x77'),'statusCode':0x190});}});};
\ No newline at end of file
+var _0x9320=['direction','username','password','remoteUri','slice','substring','POST','%s%s','/service/v4_1/rest.php','JSON','xCALLY\x20Motion\x20Integration','Password\x20Expired','format','get_module_fields','stringify','values','remove','includes','label','endsWith','value','test','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','sendStatus','error','name','send','SugarcrmAccount','rawAttributes','fieldName','type','model','map','filters','intersection','query','fields','attributes','length','order','sort','where','filter','merge','VIRTUAL','include','findAll','rows','catch','keys','includeAll','options','find','create','body','params','destroy','getConfigurations','findOne','SugarcrmConfiguration','pick','hasOwnProperty','nolimit','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','SugarcrmField','getFields','assigned_user_id','description','date_start','duration_minutes','parent_type','parent_name'];(function(_0x493cb4,_0x416b68){var _0x13ba41=function(_0x5a119b){while(--_0x5a119b){_0x493cb4['push'](_0x493cb4['shift']());}};_0x13ba41(++_0x416b68);}(_0x9320,0x17d));var _0x0932=function(_0x450198,_0x4f11d0){_0x450198=_0x450198-0x0;var _0xb77fdc=_0x9320[_0x450198];return _0xb77fdc;};'use strict';var emlformat=require(_0x0932('0x0'));var rimraf=require(_0x0932('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0932('0x2'));var rp=require(_0x0932('0x3'));var moment=require(_0x0932('0x4'));var BPromise=require(_0x0932('0x5'));var Mustache=require(_0x0932('0x6'));var util=require(_0x0932('0x7'));var path=require(_0x0932('0x8'));var sox=require(_0x0932('0x9'));var csv=require(_0x0932('0xa'));var ejs=require(_0x0932('0xb'));var fs=require('fs');var fs_extra=require(_0x0932('0xc'));var _=require(_0x0932('0xd'));var squel=require(_0x0932('0xe'));var crypto=require(_0x0932('0xf'));var jsforce=require(_0x0932('0x10'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0932('0x11'));var Redis=require(_0x0932('0x12'));var authService=require(_0x0932('0x13'));var qs=require(_0x0932('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x0932('0x15'))('api');var utils=require(_0x0932('0x16'));var config=require(_0x0932('0x17'));var licenseUtil=require(_0x0932('0x18'));var db=require('../../mysqldb')['db'];var integrations=require(_0x0932('0x19'));function respondWithStatusCode(_0x47281e,_0x5bc8ea){_0x5bc8ea=_0x5bc8ea||0xcc;return function(_0xd2a2ec){if(_0xd2a2ec){return _0x47281e['sendStatus'](_0x5bc8ea);}return _0x47281e[_0x0932('0x1a')](_0x5bc8ea)[_0x0932('0x1b')]();};}function respondWithResult(_0x1ae8b2,_0x1f6546){_0x1f6546=_0x1f6546||0xc8;return function(_0x3f35a2){if(_0x3f35a2){return _0x1ae8b2[_0x0932('0x1a')](_0x1f6546)['json'](_0x3f35a2);}};}function respondWithFilteredResult(_0x1b1480,_0x14b318){return function(_0x487ef2){if(_0x487ef2){var _0x41500d=typeof _0x14b318[_0x0932('0x1c')]===_0x0932('0x1d')&&typeof _0x14b318[_0x0932('0x1e')]===_0x0932('0x1d');var _0x99996e=_0x487ef2[_0x0932('0x1f')];var _0xcd4586=_0x41500d?0x0:_0x14b318[_0x0932('0x1c')];var _0x8a95fd=_0x41500d?_0x487ef2[_0x0932('0x1f')]:_0x14b318[_0x0932('0x1c')]+_0x14b318[_0x0932('0x1e')];var _0x1610ea;if(_0x8a95fd>=_0x99996e){_0x8a95fd=_0x99996e;_0x1610ea=0xc8;}else{_0x1610ea=0xce;}_0x1b1480[_0x0932('0x1a')](_0x1610ea);return _0x1b1480[_0x0932('0x20')](_0x0932('0x21'),_0xcd4586+'-'+_0x8a95fd+'/'+_0x99996e)[_0x0932('0x22')](_0x487ef2);}return null;};}function patchUpdates(_0x34a69a){return function(_0x17838b){try{jsonpatch[_0x0932('0x23')](_0x17838b,_0x34a69a,!![]);}catch(_0x2dd20c){return BPromise[_0x0932('0x24')](_0x2dd20c);}return _0x17838b[_0x0932('0x25')]();};}function saveUpdates(_0xef34db,_0x387b9e){return function(_0x258832){if(_0x258832){return _0x258832[_0x0932('0x26')](_0xef34db)[_0x0932('0x27')](function(_0x1d2cc4){return _0x1d2cc4;});}return null;};}function removeEntity(_0x59551f,_0x333955){return function(_0x508662){if(_0x508662){return _0x508662['destroy']()[_0x0932('0x27')](function(){_0x59551f[_0x0932('0x1a')](0xcc)[_0x0932('0x1b')]();});}};}function handleEntityNotFound(_0x85cdf4,_0x52b601){return function(_0x3b92cb){if(!_0x3b92cb){_0x85cdf4[_0x0932('0x28')](0x194);}return _0x3b92cb;};}function handleError(_0x5a9b47,_0x1756d8){_0x1756d8=_0x1756d8||0x1f4;return function(_0x1ba84d){logger[_0x0932('0x29')](_0x1ba84d['stack']);if(_0x1ba84d[_0x0932('0x2a')]){delete _0x1ba84d[_0x0932('0x2a')];}_0x5a9b47[_0x0932('0x1a')](_0x1756d8)[_0x0932('0x2b')](_0x1ba84d);};}exports['index']=function(_0x26b90f,_0x1896c5){var _0x274376={},_0x5310af={},_0x5772b9={'count':0x0,'rows':[]};var _0x33c718=_['map'](db[_0x0932('0x2c')][_0x0932('0x2d')],function(_0x305fc1){return{'name':_0x305fc1[_0x0932('0x2e')],'type':_0x305fc1[_0x0932('0x2f')]['key']};});_0x5310af[_0x0932('0x30')]=_[_0x0932('0x31')](_0x33c718,_0x0932('0x2a'));_0x5310af['query']=_['keys'](_0x26b90f['query']);_0x5310af[_0x0932('0x32')]=_[_0x0932('0x33')](_0x5310af[_0x0932('0x30')],_0x5310af[_0x0932('0x34')]);_0x274376['attributes']=_[_0x0932('0x33')](_0x5310af[_0x0932('0x30')],qs[_0x0932('0x35')](_0x26b90f[_0x0932('0x34')][_0x0932('0x35')]));_0x274376[_0x0932('0x36')]=_0x274376[_0x0932('0x36')][_0x0932('0x37')]?_0x274376[_0x0932('0x36')]:_0x5310af[_0x0932('0x30')];if(!_0x26b90f[_0x0932('0x34')]['hasOwnProperty']('nolimit')){_0x274376[_0x0932('0x1e')]=qs[_0x0932('0x1e')](_0x26b90f[_0x0932('0x34')][_0x0932('0x1e')]);_0x274376[_0x0932('0x1c')]=qs[_0x0932('0x1c')](_0x26b90f['query']['offset']);}_0x274376[_0x0932('0x38')]=qs[_0x0932('0x39')](_0x26b90f[_0x0932('0x34')][_0x0932('0x39')]);_0x274376[_0x0932('0x3a')]=qs['filters'](_['pick'](_0x26b90f[_0x0932('0x34')],_0x5310af[_0x0932('0x32')]),_0x33c718);if(_0x26b90f[_0x0932('0x34')][_0x0932('0x3b')]){_0x274376['where']=_[_0x0932('0x3c')](_0x274376[_0x0932('0x3a')],{'$or':_[_0x0932('0x31')](_0x33c718,function(_0x503c77){if(_0x503c77[_0x0932('0x2f')]!==_0x0932('0x3d')){var _0x5671d1={};_0x5671d1[_0x503c77[_0x0932('0x2a')]]={'$like':'%'+_0x26b90f[_0x0932('0x34')][_0x0932('0x3b')]+'%'};return _0x5671d1;}})});}_0x274376=_[_0x0932('0x3c')]({},_0x274376,_0x26b90f['options']);var _0x1e8907={'where':_0x274376['where']};return db[_0x0932('0x2c')][_0x0932('0x1f')](_0x1e8907)[_0x0932('0x27')](function(_0x3c1cfa){_0x5772b9['count']=_0x3c1cfa;if(_0x26b90f[_0x0932('0x34')]['includeAll']){_0x274376[_0x0932('0x3e')]=[{'all':!![]}];}return db['SugarcrmAccount'][_0x0932('0x3f')](_0x274376);})['then'](function(_0x5226b8){_0x5772b9[_0x0932('0x40')]=_0x5226b8;return _0x5772b9;})[_0x0932('0x27')](respondWithFilteredResult(_0x1896c5,_0x274376))[_0x0932('0x41')](handleError(_0x1896c5,null));};exports['show']=function(_0x2bac63,_0x231e40){var _0x3ad4a6={'raw':![],'where':{'id':_0x2bac63['params']['id']}},_0x2982b5={};_0x2982b5[_0x0932('0x30')]=_['keys'](db[_0x0932('0x2c')][_0x0932('0x2d')]);_0x2982b5[_0x0932('0x34')]=_[_0x0932('0x42')](_0x2bac63[_0x0932('0x34')]);_0x2982b5['filters']=_[_0x0932('0x33')](_0x2982b5[_0x0932('0x30')],_0x2982b5[_0x0932('0x34')]);_0x3ad4a6[_0x0932('0x36')]=_[_0x0932('0x33')](_0x2982b5[_0x0932('0x30')],qs['fields'](_0x2bac63[_0x0932('0x34')]['fields']));_0x3ad4a6[_0x0932('0x36')]=_0x3ad4a6[_0x0932('0x36')][_0x0932('0x37')]?_0x3ad4a6[_0x0932('0x36')]:_0x2982b5[_0x0932('0x30')];if(_0x2bac63[_0x0932('0x34')][_0x0932('0x43')]){_0x3ad4a6['include']=[{'all':!![]}];}_0x3ad4a6=_['merge']({},_0x3ad4a6,_0x2bac63[_0x0932('0x44')]);return db[_0x0932('0x2c')][_0x0932('0x45')](_0x3ad4a6)[_0x0932('0x27')](handleEntityNotFound(_0x231e40,null))[_0x0932('0x27')](respondWithResult(_0x231e40,null))[_0x0932('0x41')](handleError(_0x231e40,null));};exports[_0x0932('0x46')]=function(_0x281fb9,_0xf474cc){return db[_0x0932('0x2c')][_0x0932('0x46')](_0x281fb9[_0x0932('0x47')],{})['then'](respondWithResult(_0xf474cc,0xc9))[_0x0932('0x41')](handleError(_0xf474cc,null));};exports[_0x0932('0x26')]=function(_0x71d377,_0x5d6a2a){if(_0x71d377[_0x0932('0x47')]['id']){delete _0x71d377[_0x0932('0x47')]['id'];}return db[_0x0932('0x2c')]['find']({'where':{'id':_0x71d377[_0x0932('0x48')]['id']}})[_0x0932('0x27')](handleEntityNotFound(_0x5d6a2a,null))[_0x0932('0x27')](saveUpdates(_0x71d377[_0x0932('0x47')],null))[_0x0932('0x27')](respondWithResult(_0x5d6a2a,null))[_0x0932('0x41')](handleError(_0x5d6a2a,null));};exports[_0x0932('0x49')]=function(_0x431268,_0x30bff9){return db[_0x0932('0x2c')][_0x0932('0x45')]({'where':{'id':_0x431268[_0x0932('0x48')]['id']}})[_0x0932('0x27')](handleEntityNotFound(_0x30bff9,null))[_0x0932('0x27')](removeEntity(_0x30bff9,null))[_0x0932('0x41')](handleError(_0x30bff9,null));};exports[_0x0932('0x4a')]=function(_0x36896a,_0x4c94e9,_0x83580b){var _0x4345aa={};var _0x419261={};var _0x11afc3;var _0x2c926c;return db['SugarcrmAccount'][_0x0932('0x4b')]({'where':{'id':_0x36896a[_0x0932('0x48')]['id']}})[_0x0932('0x27')](handleEntityNotFound(_0x4c94e9,null))[_0x0932('0x27')](function(_0x2566d3){if(_0x2566d3){_0x11afc3=_0x2566d3;_0x419261[_0x0932('0x30')]=_['keys'](db[_0x0932('0x4c')]['rawAttributes']);_0x419261[_0x0932('0x34')]=_[_0x0932('0x42')](_0x36896a['query']);_0x419261[_0x0932('0x32')]=_['intersection'](_0x419261['model'],_0x419261[_0x0932('0x34')]);_0x4345aa['attributes']=_[_0x0932('0x33')](_0x419261[_0x0932('0x30')],qs[_0x0932('0x35')](_0x36896a['query'][_0x0932('0x35')]));_0x4345aa[_0x0932('0x36')]=_0x4345aa['attributes'][_0x0932('0x37')]?_0x4345aa[_0x0932('0x36')]:_0x419261[_0x0932('0x30')];_0x4345aa['order']=qs[_0x0932('0x39')](_0x36896a[_0x0932('0x34')][_0x0932('0x39')]);_0x4345aa[_0x0932('0x3a')]=qs['filters'](_[_0x0932('0x4d')](_0x36896a[_0x0932('0x34')],_0x419261['filters']));if(_0x36896a[_0x0932('0x34')]['filter']){_0x4345aa['where']=_[_0x0932('0x3c')](_0x4345aa[_0x0932('0x3a')],{'$or':_['map'](_0x4345aa[_0x0932('0x36')],function(_0x3bb082){var _0x3ed921={};_0x3ed921[_0x3bb082]={'$like':'%'+_0x36896a[_0x0932('0x34')][_0x0932('0x3b')]+'%'};return _0x3ed921;})});}_0x4345aa=_['merge']({},_0x4345aa,_0x36896a['options']);return _0x11afc3[_0x0932('0x4a')](_0x4345aa);}})[_0x0932('0x27')](function(_0x26560d){if(_0x26560d){_0x2c926c=_0x26560d[_0x0932('0x37')];if(!_0x36896a[_0x0932('0x34')][_0x0932('0x4e')](_0x0932('0x4f'))){_0x4345aa[_0x0932('0x1e')]=qs[_0x0932('0x1e')](_0x36896a['query']['limit']);_0x4345aa[_0x0932('0x1c')]=qs[_0x0932('0x1c')](_0x36896a[_0x0932('0x34')]['offset']);}return _0x11afc3[_0x0932('0x4a')](_0x4345aa);}})['then'](function(_0x29311f){if(_0x29311f){return _0x29311f?{'count':_0x2c926c,'rows':_0x29311f}:null;}})['then'](respondWithResult(_0x4c94e9,null))[_0x0932('0x41')](handleError(_0x4c94e9,null));};exports[_0x0932('0x50')]=function(_0xd0ee41,_0x5edfde,_0xd7f9bf){if(_0xd0ee41[_0x0932('0x47')]['id']){delete _0xd0ee41['body']['id'];}return db[_0x0932('0x2c')][_0x0932('0x4b')]({'where':{'id':_0xd0ee41['params']['id']}})[_0x0932('0x27')](handleEntityNotFound(_0x5edfde,null))[_0x0932('0x27')](function(_0x1d8bea){if(_0x1d8bea){_0xd0ee41[_0x0932('0x47')][_0x0932('0x51')]=_0x1d8bea['id'];_0xd0ee41[_0x0932('0x47')][_0x0932('0x52')]=integrations[_0x0932('0x53')](_0xd0ee41['body'][_0x0932('0x54')],_0xd0ee41[_0x0932('0x47')][_0x0932('0x2f')]);_0xd0ee41[_0x0932('0x47')][_0x0932('0x55')]=integrations[_0x0932('0x56')](_0xd0ee41[_0x0932('0x47')][_0x0932('0x54')],_0xd0ee41[_0x0932('0x47')][_0x0932('0x2f')]);return db[_0x0932('0x4c')][_0x0932('0x46')](_0xd0ee41['body'],{'include':[{'model':db[_0x0932('0x57')],'as':'Subjects'},{'model':db[_0x0932('0x57')],'as':'Descriptions'}]});}return null;})[_0x0932('0x27')](respondWithResult(_0x5edfde,null))['catch'](handleError(_0x5edfde,null));};exports[_0x0932('0x58')]=function(_0x2d68ba,_0x9f987e,_0x94031e){var _0x2a9ff5='';var _0x3bfaa8=['id','name',_0x0932('0x59'),'created_by',_0x0932('0x5a'),_0x0932('0x5b'),'duration_hours',_0x0932('0x5c'),'parent_id',_0x0932('0x5d'),_0x0932('0x5e'),_0x0932('0x5f')];return db['SugarcrmAccount'][_0x0932('0x4b')]({'where':{'id':_0x2d68ba[_0x0932('0x48')]['id']},'attributes':['id',_0x0932('0x60'),_0x0932('0x61'),'remoteUri']})[_0x0932('0x27')](handleEntityNotFound(_0x9f987e,null))['then'](function(_0x25b7dd){if(_0x25b7dd){_0x2a9ff5=_0x25b7dd[_0x0932('0x62')];var _0x517933=_0x2a9ff5[_0x0932('0x63')](-0x1);if(_0x517933==='/'){_0x2a9ff5=_0x2a9ff5[_0x0932('0x64')](0x0,_0x2a9ff5['lastIndexOf'](_0x517933));}return rp({'method':_0x0932('0x65'),'uri':util['format'](_0x0932('0x66'),_0x2a9ff5,_0x0932('0x67')),'json':!![],'form':{'method':'login','input_type':_0x0932('0x68'),'response_type':_0x0932('0x68'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x25b7dd[_0x0932('0x60')],'password':_0x25b7dd[_0x0932('0x61')],'encryption':'PLAIN'},'application':_0x0932('0x69')})}});}})['then'](function(_0x4b4ee9){if(_0x4b4ee9&&_0x4b4ee9[_0x0932('0x2a')]!=='Invalid\x20Login'&&_0x4b4ee9['name']!==_0x0932('0x6a')){return rp({'method':'POST','uri':util[_0x0932('0x6b')](_0x0932('0x66'),_0x2a9ff5,_0x0932('0x67')),'json':!![],'form':{'method':_0x0932('0x6c'),'input_type':_0x0932('0x68'),'response_type':'JSON','rest_data':JSON[_0x0932('0x6d')]({'session':_0x4b4ee9['id'],'module_name':'Calls'})}})[_0x0932('0x27')](function(_0x2c91f0){if(_0x2c91f0){var _0x5393a5=_[_0x0932('0x6e')](_0x2c91f0['module_fields']);_[_0x0932('0x6f')](_0x5393a5,function(_0x1cdd39){return _0x3bfaa8[_0x0932('0x70')](_0x1cdd39['name']);});return{'count':_0x5393a5[_0x0932('0x37')],'rows':_[_0x0932('0x31')](_0x5393a5,function(_0xcc84f0){return{'id':_0xcc84f0['name'],'name':_0xcc84f0[_0x0932('0x71')],'custom':_[_0x0932('0x72')](_0xcc84f0[_0x0932('0x2a')],'_c')?!![]:![],'options':_0xcc84f0['options']?_[_0x0932('0x31')](_[_0x0932('0x6e')](_0xcc84f0['options']),function(_0x206e66){return{'name':_0x206e66[_0x0932('0x73')],'value':_0x206e66[_0x0932('0x2a')]};}):[]};})};}})['then'](respondWithResult(_0x9f987e,null))[_0x0932('0x41')](function(_0x3de001){var _0x117457=_0x2d68ba[_0x0932('0x34')][_0x0932('0x74')]?0x1f4:_0x3de001['statusCode']||0x1f4;logger['error'](_0x0932('0x75'),_0x0932('0x58'),_0x117457,JSON[_0x0932('0x6d')](_0x3de001));delete _0x3de001[_0x0932('0x2a')];if(_0x117457===0x191){_0x117457=0x190;}_0x9f987e[_0x0932('0x1a')](_0x117457)['send'](_0x2d68ba[_0x0932('0x34')][_0x0932('0x74')]?{'message':_0x0932('0x76'),'statusCode':_0x3de001['statusCode']}:_0x3de001);});}else{var _0x4191a3=0x1f4;_0x9f987e['status'](_0x4191a3)[_0x0932('0x2b')]({'message':_0x0932('0x76'),'statusCode':0x190});}});};
\ No newline at end of file
index 11f6928..6aa98db 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1a5a=['int_sugarcrm_accounts','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','define','SugarcrmAccount'];(function(_0x5c74c3,_0x30e49a){var _0x5efa85=function(_0x1eba1e){while(--_0x1eba1e){_0x5c74c3['push'](_0x5c74c3['shift']());}};_0x5efa85(++_0x30e49a);}(_0x1a5a,0x1d5));var _0xa1a5=function(_0xb95742,_0x165e9c){_0xb95742=_0xb95742-0x0;var _0x3c920e=_0x1a5a[_0xb95742];return _0x3c920e;};'use strict';var _=require(_0xa1a5('0x0'));var util=require('util');var logger=require(_0xa1a5('0x1'))(_0xa1a5('0x2'));var moment=require(_0xa1a5('0x3'));var BPromise=require(_0xa1a5('0x4'));var rp=require(_0xa1a5('0x5'));var fs=require('fs');var path=require(_0xa1a5('0x6'));var rimraf=require('rimraf');var config=require(_0xa1a5('0x7'));var attributes=require(_0xa1a5('0x8'));var integrations=require(_0xa1a5('0x9'));module['exports']=function(_0x160046,_0x3a9306){return _0x160046[_0xa1a5('0xa')](_0xa1a5('0xb'),attributes,{'tableName':_0xa1a5('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc11e=['path','rimraf','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','define','SugarcrmAccount','int_sugarcrm_accounts','lodash','../../config/logger','moment','request-promise'];(function(_0x1facc6,_0x541448){var _0x174763=function(_0x4abcc0){while(--_0x4abcc0){_0x1facc6['push'](_0x1facc6['shift']());}};_0x174763(++_0x541448);}(_0xc11e,0xf8));var _0xec11=function(_0x35a3da,_0x286c6a){_0x35a3da=_0x35a3da-0x0;var _0x568a40=_0xc11e[_0x35a3da];return _0x568a40;};'use strict';var _=require(_0xec11('0x0'));var util=require('util');var logger=require(_0xec11('0x1'))('api');var moment=require(_0xec11('0x2'));var BPromise=require('bluebird');var rp=require(_0xec11('0x3'));var fs=require('fs');var path=require(_0xec11('0x4'));var rimraf=require(_0xec11('0x5'));var config=require(_0xec11('0x6'));var attributes=require(_0xec11('0x7'));var integrations=require(_0xec11('0x8'));module['exports']=function(_0x23cd66,_0x120483){return _0x23cd66[_0xec11('0x9')](_0xec11('0xa'),attributes,{'tableName':_0xec11('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 0c5d0d4..5dd27ee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9ed3=['options','raw','where','attributes','limit','include','map','model','ShowSugarcrmAccount','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','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','catch','GetSugarcrmAccount','SugarcrmAccount','findAll'];(function(_0x4b73b6,_0x206376){var _0x3632db=function(_0x4d52a2){while(--_0x4d52a2){_0x4b73b6['push'](_0x4b73b6['shift']());}};_0x3632db(++_0x206376);}(_0x9ed3,0x17f));var _0x39ed=function(_0x24259d,_0x64a194){_0x24259d=_0x24259d-0x0;var _0x5a701=_0x9ed3[_0x24259d];return _0x5a701;};'use strict';var _=require('lodash');var util=require(_0x39ed('0x0'));var moment=require(_0x39ed('0x1'));var BPromise=require(_0x39ed('0x2'));var rs=require(_0x39ed('0x3'));var fs=require('fs');var Redis=require(_0x39ed('0x4'));var db=require(_0x39ed('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x39ed('0x6'))(_0x39ed('0x7'));var config=require('../../config/environment');var jayson=require(_0x39ed('0x8'));var client=jayson[_0x39ed('0x9')][_0x39ed('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1c8ac5,_0x5d2148,_0x57aff0){return new BPromise(function(_0x2f79bd,_0x3badf4){return client['request'](_0x1c8ac5,_0x57aff0)[_0x39ed('0xb')](function(_0x3cf156){logger[_0x39ed('0xc')](_0x39ed('0xd'),_0x5d2148,_0x39ed('0xe'));logger[_0x39ed('0xf')](_0x39ed('0x10'),_0x5d2148,'request\x20sent',JSON[_0x39ed('0x11')](_0x3cf156));if(_0x3cf156[_0x39ed('0x12')]){if(_0x3cf156[_0x39ed('0x12')][_0x39ed('0x13')]===0x1f4){logger['error'](_0x39ed('0xd'),_0x5d2148,_0x3cf156[_0x39ed('0x12')]['message']);return _0x3badf4(_0x3cf156['error'][_0x39ed('0x14')]);}logger[_0x39ed('0x12')](_0x39ed('0xd'),_0x5d2148,_0x3cf156[_0x39ed('0x12')][_0x39ed('0x14')]);return _0x2f79bd(_0x3cf156['error'][_0x39ed('0x14')]);}else{logger[_0x39ed('0xc')]('SugarcrmAccount,\x20%s,\x20%s',_0x5d2148,_0x39ed('0xe'));_0x2f79bd(_0x3cf156['result'][_0x39ed('0x14')]);}})[_0x39ed('0x15')](function(_0x41b2ae){logger[_0x39ed('0x12')](_0x39ed('0xd'),_0x5d2148,_0x41b2ae);_0x3badf4(_0x41b2ae);});});}exports[_0x39ed('0x16')]=function(_0x24e0e6){var _0x3fc81d=this;return new Promise(function(_0x1ed508,_0x3ad9df){return db[_0x39ed('0x17')][_0x39ed('0x18')]({'raw':_0x24e0e6[_0x39ed('0x19')]?_0x24e0e6[_0x39ed('0x19')][_0x39ed('0x1a')]===undefined?!![]:![]:!![],'where':_0x24e0e6[_0x39ed('0x19')]?_0x24e0e6[_0x39ed('0x19')][_0x39ed('0x1b')]||null:null,'attributes':_0x24e0e6[_0x39ed('0x19')]?_0x24e0e6[_0x39ed('0x19')][_0x39ed('0x1c')]||null:null,'limit':_0x24e0e6['options']?_0x24e0e6[_0x39ed('0x19')][_0x39ed('0x1d')]||null:null,'include':_0x24e0e6[_0x39ed('0x19')]?_0x24e0e6['options'][_0x39ed('0x1e')]?_[_0x39ed('0x1f')](_0x24e0e6[_0x39ed('0x19')][_0x39ed('0x1e')],function(_0x1f6bc7){return{'model':db[_0x1f6bc7['model']],'as':_0x1f6bc7['as'],'attributes':_0x1f6bc7[_0x39ed('0x1c')],'include':_0x1f6bc7[_0x39ed('0x1e')]?_[_0x39ed('0x1f')](_0x1f6bc7[_0x39ed('0x1e')],function(_0x2b18ca){return{'model':db[_0x2b18ca[_0x39ed('0x20')]],'as':_0x2b18ca['as'],'attributes':_0x2b18ca['attributes'],'include':_0x2b18ca[_0x39ed('0x1e')]?_[_0x39ed('0x1f')](_0x2b18ca['include'],function(_0xa53c96){return{'model':db[_0xa53c96['model']],'as':_0xa53c96['as'],'attributes':_0xa53c96[_0x39ed('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x39ed('0xb')](function(_0x53820a){logger[_0x39ed('0xc')](_0x39ed('0x16'),_0x24e0e6);logger['debug']('GetSugarcrmAccount',_0x24e0e6,JSON['stringify'](_0x53820a));_0x1ed508(_0x53820a);})[_0x39ed('0x15')](function(_0x32ed53){logger['error'](_0x39ed('0x16'),_0x32ed53[_0x39ed('0x14')],_0x24e0e6);_0x3ad9df(_0x3fc81d[_0x39ed('0x12')](0x1f4,_0x32ed53[_0x39ed('0x14')]));});});};exports['ShowSugarcrmAccount']=function(_0x1ab41c){var _0x5da627=this;return new Promise(function(_0x54e6cf,_0x5b9b19){return db[_0x39ed('0x17')]['find']({'raw':_0x1ab41c[_0x39ed('0x19')]?_0x1ab41c[_0x39ed('0x19')][_0x39ed('0x1a')]===undefined?!![]:![]:!![],'where':_0x1ab41c['options']?_0x1ab41c[_0x39ed('0x19')]['where']||null:null,'attributes':_0x1ab41c[_0x39ed('0x19')]?_0x1ab41c[_0x39ed('0x19')][_0x39ed('0x1c')]||null:null,'include':_0x1ab41c['options']?_0x1ab41c['options'][_0x39ed('0x1e')]?_[_0x39ed('0x1f')](_0x1ab41c[_0x39ed('0x19')]['include'],function(_0x529a98){return{'model':db[_0x529a98[_0x39ed('0x20')]],'as':_0x529a98['as'],'attributes':_0x529a98[_0x39ed('0x1c')],'include':_0x529a98[_0x39ed('0x1e')]?_['map'](_0x529a98[_0x39ed('0x1e')],function(_0x39086a){return{'model':db[_0x39086a['model']],'as':_0x39086a['as'],'attributes':_0x39086a[_0x39ed('0x1c')],'include':_0x39086a['include']?_[_0x39ed('0x1f')](_0x39086a[_0x39ed('0x1e')],function(_0x33fafc){return{'model':db[_0x33fafc[_0x39ed('0x20')]],'as':_0x33fafc['as'],'attributes':_0x33fafc[_0x39ed('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x39ed('0xb')](function(_0x571b66){logger[_0x39ed('0xc')](_0x39ed('0x21'),_0x1ab41c);logger['debug'](_0x39ed('0x21'),_0x1ab41c,JSON[_0x39ed('0x11')](_0x571b66));_0x54e6cf(_0x571b66);})['catch'](function(_0x458fab){logger['error']('ShowSugarcrmAccount',_0x458fab[_0x39ed('0x14')],_0x1ab41c);_0x5b9b19(_0x5da627['error'](0x1f4,_0x458fab[_0x39ed('0x14')]));});});};
\ No newline at end of file
+var _0x25b8=['../../config/logger','rpc','../../config/environment','jayson/promise','request','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','GetSugarcrmAccount','SugarcrmAccount','findAll','options','raw','limit','map','include','model','attributes','then','catch','ShowSugarcrmAccount','find','where','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x1abf7b,_0x320253){var _0x423b0a=function(_0x485cea){while(--_0x485cea){_0x1abf7b['push'](_0x1abf7b['shift']());}};_0x423b0a(++_0x320253);}(_0x25b8,0x135));var _0x825b=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x25b8[_0x2d7f0e];return _0x110b07;};'use strict';var _=require(_0x825b('0x0'));var util=require('util');var moment=require(_0x825b('0x1'));var BPromise=require(_0x825b('0x2'));var rs=require(_0x825b('0x3'));var fs=require('fs');var Redis=require(_0x825b('0x4'));var db=require(_0x825b('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x825b('0x6'))(_0x825b('0x7'));var config=require(_0x825b('0x8'));var jayson=require(_0x825b('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x356540,_0x3da9a7,_0x2a2605){return new BPromise(function(_0x11a3ca,_0x4c0060){return client[_0x825b('0xa')](_0x356540,_0x2a2605)['then'](function(_0x49bf12){logger[_0x825b('0xb')](_0x825b('0xc'),_0x3da9a7,_0x825b('0xd'));logger[_0x825b('0xe')](_0x825b('0xf'),_0x3da9a7,_0x825b('0xd'),JSON[_0x825b('0x10')](_0x49bf12));if(_0x49bf12[_0x825b('0x11')]){if(_0x49bf12[_0x825b('0x11')]['code']===0x1f4){logger['error'](_0x825b('0xc'),_0x3da9a7,_0x49bf12[_0x825b('0x11')][_0x825b('0x12')]);return _0x4c0060(_0x49bf12[_0x825b('0x11')][_0x825b('0x12')]);}logger[_0x825b('0x11')](_0x825b('0xc'),_0x3da9a7,_0x49bf12[_0x825b('0x11')]['message']);return _0x11a3ca(_0x49bf12[_0x825b('0x11')][_0x825b('0x12')]);}else{logger[_0x825b('0xb')](_0x825b('0xc'),_0x3da9a7,'request\x20sent');_0x11a3ca(_0x49bf12[_0x825b('0x13')][_0x825b('0x12')]);}})['catch'](function(_0x32d3d7){logger[_0x825b('0x11')]('SugarcrmAccount,\x20%s,\x20%s',_0x3da9a7,_0x32d3d7);_0x4c0060(_0x32d3d7);});});}exports[_0x825b('0x14')]=function(_0x42f040){var _0xbde8ae=this;return new Promise(function(_0x547b15,_0x1bec81){return db[_0x825b('0x15')][_0x825b('0x16')]({'raw':_0x42f040[_0x825b('0x17')]?_0x42f040['options'][_0x825b('0x18')]===undefined?!![]:![]:!![],'where':_0x42f040[_0x825b('0x17')]?_0x42f040[_0x825b('0x17')]['where']||null:null,'attributes':_0x42f040['options']?_0x42f040[_0x825b('0x17')]['attributes']||null:null,'limit':_0x42f040[_0x825b('0x17')]?_0x42f040[_0x825b('0x17')][_0x825b('0x19')]||null:null,'include':_0x42f040['options']?_0x42f040[_0x825b('0x17')]['include']?_[_0x825b('0x1a')](_0x42f040[_0x825b('0x17')][_0x825b('0x1b')],function(_0x53c1e2){return{'model':db[_0x53c1e2[_0x825b('0x1c')]],'as':_0x53c1e2['as'],'attributes':_0x53c1e2[_0x825b('0x1d')],'include':_0x53c1e2['include']?_[_0x825b('0x1a')](_0x53c1e2[_0x825b('0x1b')],function(_0x2bb370){return{'model':db[_0x2bb370[_0x825b('0x1c')]],'as':_0x2bb370['as'],'attributes':_0x2bb370[_0x825b('0x1d')],'include':_0x2bb370[_0x825b('0x1b')]?_[_0x825b('0x1a')](_0x2bb370[_0x825b('0x1b')],function(_0x183e6a){return{'model':db[_0x183e6a['model']],'as':_0x183e6a['as'],'attributes':_0x183e6a[_0x825b('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x825b('0x1e')](function(_0x37f46c){logger['info']('GetSugarcrmAccount',_0x42f040);logger[_0x825b('0xe')](_0x825b('0x14'),_0x42f040,JSON[_0x825b('0x10')](_0x37f46c));_0x547b15(_0x37f46c);})[_0x825b('0x1f')](function(_0x4617a1){logger[_0x825b('0x11')](_0x825b('0x14'),_0x4617a1[_0x825b('0x12')],_0x42f040);_0x1bec81(_0xbde8ae[_0x825b('0x11')](0x1f4,_0x4617a1[_0x825b('0x12')]));});});};exports[_0x825b('0x20')]=function(_0x3a53ef){var _0x1fd3cf=this;return new Promise(function(_0x36bbe0,_0x27af1c){return db[_0x825b('0x15')][_0x825b('0x21')]({'raw':_0x3a53ef[_0x825b('0x17')]?_0x3a53ef[_0x825b('0x17')][_0x825b('0x18')]===undefined?!![]:![]:!![],'where':_0x3a53ef[_0x825b('0x17')]?_0x3a53ef[_0x825b('0x17')][_0x825b('0x22')]||null:null,'attributes':_0x3a53ef[_0x825b('0x17')]?_0x3a53ef[_0x825b('0x17')][_0x825b('0x1d')]||null:null,'include':_0x3a53ef[_0x825b('0x17')]?_0x3a53ef[_0x825b('0x17')]['include']?_[_0x825b('0x1a')](_0x3a53ef[_0x825b('0x17')]['include'],function(_0x4311f9){return{'model':db[_0x4311f9[_0x825b('0x1c')]],'as':_0x4311f9['as'],'attributes':_0x4311f9[_0x825b('0x1d')],'include':_0x4311f9[_0x825b('0x1b')]?_[_0x825b('0x1a')](_0x4311f9[_0x825b('0x1b')],function(_0x2e41a8){return{'model':db[_0x2e41a8[_0x825b('0x1c')]],'as':_0x2e41a8['as'],'attributes':_0x2e41a8[_0x825b('0x1d')],'include':_0x2e41a8[_0x825b('0x1b')]?_[_0x825b('0x1a')](_0x2e41a8[_0x825b('0x1b')],function(_0x22894a){return{'model':db[_0x22894a[_0x825b('0x1c')]],'as':_0x22894a['as'],'attributes':_0x22894a[_0x825b('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x825b('0x1e')](function(_0x5cd1cf){logger[_0x825b('0xb')]('ShowSugarcrmAccount',_0x3a53ef);logger['debug'](_0x825b('0x20'),_0x3a53ef,JSON['stringify'](_0x5cd1cf));_0x36bbe0(_0x5cd1cf);})[_0x825b('0x1f')](function(_0x5500e2){logger[_0x825b('0x11')](_0x825b('0x20'),_0x5500e2[_0x825b('0x12')],_0x3a53ef);_0x27af1c(_0x1fd3cf[_0x825b('0x11')](0x1f4,_0x5500e2[_0x825b('0x12')]));});});};
\ No newline at end of file
index 59c8c41..78e6444 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x990c=['../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/subjects','getDescriptions','post','create','put','update','delete','destroy','exports','util','path','express'];(function(_0x871f48,_0x3bf215){var _0x3e1cbd=function(_0x357816){while(--_0x357816){_0x871f48['push'](_0x871f48['shift']());}};_0x3e1cbd(++_0x3bf215);}(_0x990c,0x1ad));var _0xc990=function(_0x58f79a,_0x399d4e){_0x58f79a=_0x58f79a-0x0;var _0x219d86=_0x990c[_0x58f79a];return _0x219d86;};'use strict';var multer=require('multer');var util=require(_0xc990('0x0'));var path=require(_0xc990('0x1'));var timeout=require('connect-timeout');var express=require(_0xc990('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xc990('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xc990('0x4'));var controller=require('./intSugarcrmConfiguration.controller');router[_0xc990('0x5')]('/',auth[_0xc990('0x6')](),controller['index']);router[_0xc990('0x5')](_0xc990('0x7'),auth[_0xc990('0x6')](),controller[_0xc990('0x8')]);router['get']('/:id/fields',auth[_0xc990('0x6')](),controller['getFields']);router[_0xc990('0x5')](_0xc990('0x9'),auth['isAuthenticated'](),controller['getSubjects']);router[_0xc990('0x5')]('/:id/descriptions',auth[_0xc990('0x6')](),controller[_0xc990('0xa')]);router[_0xc990('0xb')]('/',auth['isAuthenticated'](),controller[_0xc990('0xc')]);router[_0xc990('0xd')](_0xc990('0x7'),auth[_0xc990('0x6')](),controller[_0xc990('0xe')]);router[_0xc990('0xf')](_0xc990('0x7'),auth[_0xc990('0x6')](),controller[_0xc990('0x10')]);module[_0xc990('0x11')]=router;
\ No newline at end of file
+var _0xe661=['get','isAuthenticated','index','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','post','create','put','/:id','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../config/environment','./intSugarcrmConfiguration.controller'];(function(_0x79f5bd,_0x347c29){var _0x1e77d7=function(_0x6e3805){while(--_0x6e3805){_0x79f5bd['push'](_0x79f5bd['shift']());}};_0x1e77d7(++_0x347c29);}(_0xe661,0x179));var _0x1e66=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xe661[_0x3b380d];return _0x54502b;};'use strict';var multer=require('multer');var util=require(_0x1e66('0x0'));var path=require(_0x1e66('0x1'));var timeout=require(_0x1e66('0x2'));var express=require(_0x1e66('0x3'));var router=express[_0x1e66('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x1e66('0x5'));var controller=require(_0x1e66('0x6'));router[_0x1e66('0x7')]('/',auth[_0x1e66('0x8')](),controller[_0x1e66('0x9')]);router[_0x1e66('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x1e66('0xa')]);router[_0x1e66('0x7')](_0x1e66('0xb'),auth[_0x1e66('0x8')](),controller[_0x1e66('0xc')]);router[_0x1e66('0x7')](_0x1e66('0xd'),auth['isAuthenticated'](),controller['getSubjects']);router['get'](_0x1e66('0xe'),auth[_0x1e66('0x8')](),controller[_0x1e66('0xf')]);router[_0x1e66('0x10')]('/',auth[_0x1e66('0x8')](),controller[_0x1e66('0x11')]);router[_0x1e66('0x12')](_0x1e66('0x13'),auth[_0x1e66('0x8')](),controller[_0x1e66('0x14')]);router[_0x1e66('0x15')](_0x1e66('0x13'),auth[_0x1e66('0x8')](),controller[_0x1e66('0x16')]);module[_0x1e66('0x17')]=router;
\ No newline at end of file
index edf771e..9f63505 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfb27=['exports','STRING'];(function(_0xe0d388,_0xbe14e5){var _0x3b2858=function(_0x5026a2){while(--_0x5026a2){_0xe0d388['push'](_0xe0d388['shift']());}};_0x3b2858(++_0xbe14e5);}(_0xfb27,0x10a));var _0x7fb2=function(_0x4f6e97,_0x121c56){_0x4f6e97=_0x4f6e97-0x0;var _0x48ee74=_0xfb27[_0x4f6e97];return _0x48ee74;};'use strict';var Sequelize=require('sequelize');module[_0x7fb2('0x0')]={'name':{'type':Sequelize[_0x7fb2('0x1')]},'description':{'type':Sequelize[_0x7fb2('0x1')]}};
\ No newline at end of file
+var _0x3742=['STRING','sequelize','exports'];(function(_0x7e2eb0,_0x17cd58){var _0xd92de4=function(_0x5d005b){while(--_0x5d005b){_0x7e2eb0['push'](_0x7e2eb0['shift']());}};_0xd92de4(++_0x17cd58);}(_0x3742,0x109));var _0x2374=function(_0x4a0f60,_0x298c30){_0x4a0f60=_0x4a0f60-0x0;var _0x59b579=_0x3742[_0x4a0f60];return _0x59b579;};'use strict';var Sequelize=require(_0x2374('0x0'));module[_0x2374('0x1')]={'name':{'type':Sequelize[_0x2374('0x2')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 88e176a..7a28174 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc40b=['../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','error','stack','name','send','index','map','SugarcrmConfiguration','fieldName','type','model','query','filters','attributes','intersection','fields','hasOwnProperty','sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','keys','rawAttributes','length','includeAll','find','create','body','destroy','getFields','findOne','SugarcrmField','order','nolimit','getSubjects','getDescriptions','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service'];(function(_0x1e1d49,_0x52fe77){var _0x5a4753=function(_0x10ec1b){while(--_0x10ec1b){_0x1e1d49['push'](_0x1e1d49['shift']());}};_0x5a4753(++_0x52fe77);}(_0xc40b,0x17c));var _0xbc40=function(_0x15ab7e,_0x3bc773){_0x15ab7e=_0x15ab7e-0x0;var _0xb0c2ca=_0xc40b[_0x15ab7e];return _0xb0c2ca;};'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(_0xbc40('0x0'));var moment=require('moment');var BPromise=require(_0xbc40('0x1'));var Mustache=require(_0xbc40('0x2'));var util=require(_0xbc40('0x3'));var path=require(_0xbc40('0x4'));var sox=require(_0xbc40('0x5'));var csv=require(_0xbc40('0x6'));var ejs=require(_0xbc40('0x7'));var fs=require('fs');var fs_extra=require(_0xbc40('0x8'));var _=require('lodash');var squel=require(_0xbc40('0x9'));var crypto=require(_0xbc40('0xa'));var jsforce=require(_0xbc40('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xbc40('0x6'));var querystring=require('querystring');var Papa=require(_0xbc40('0xc'));var Redis=require(_0xbc40('0xd'));var authService=require(_0xbc40('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xbc40('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbc40('0x10'))(_0xbc40('0x11'));var utils=require('../../config/utils');var config=require(_0xbc40('0x12'));var licenseUtil=require(_0xbc40('0x13'));var db=require(_0xbc40('0x14'))['db'];function respondWithStatusCode(_0x5eee31,_0x373040){_0x373040=_0x373040||0xcc;return function(_0x93f728){if(_0x93f728){return _0x5eee31[_0xbc40('0x15')](_0x373040);}return _0x5eee31['status'](_0x373040)['end']();};}function respondWithResult(_0x4fa345,_0x5ef944){_0x5ef944=_0x5ef944||0xc8;return function(_0x57724d){if(_0x57724d){return _0x4fa345[_0xbc40('0x16')](_0x5ef944)['json'](_0x57724d);}};}function respondWithFilteredResult(_0x4b4fa6,_0x2949a8){return function(_0x87bdf9){if(_0x87bdf9){var _0x283ee3=typeof _0x2949a8[_0xbc40('0x17')]===_0xbc40('0x18')&&typeof _0x2949a8[_0xbc40('0x19')]===_0xbc40('0x18');var _0x567ed8=_0x87bdf9[_0xbc40('0x1a')];var _0x4f9fd2=_0x283ee3?0x0:_0x2949a8[_0xbc40('0x17')];var _0xa165e8=_0x283ee3?_0x87bdf9[_0xbc40('0x1a')]:_0x2949a8[_0xbc40('0x17')]+_0x2949a8[_0xbc40('0x19')];var _0x518ecc;if(_0xa165e8>=_0x567ed8){_0xa165e8=_0x567ed8;_0x518ecc=0xc8;}else{_0x518ecc=0xce;}_0x4b4fa6['status'](_0x518ecc);return _0x4b4fa6[_0xbc40('0x1b')](_0xbc40('0x1c'),_0x4f9fd2+'-'+_0xa165e8+'/'+_0x567ed8)[_0xbc40('0x1d')](_0x87bdf9);}return null;};}function patchUpdates(_0x22f106){return function(_0x3bc115){try{jsonpatch[_0xbc40('0x1e')](_0x3bc115,_0x22f106,!![]);}catch(_0x39e2ed){return BPromise[_0xbc40('0x1f')](_0x39e2ed);}return _0x3bc115[_0xbc40('0x20')]();};}function saveUpdates(_0x1053aa,_0x5aa527){return function(_0x40f427){if(_0x40f427){return _0x40f427[_0xbc40('0x21')](_0x1053aa)['then'](function(_0x5ce6b7){return _0x5ce6b7;});}return null;};}function removeEntity(_0x4e8bb0,_0x4f279a){return function(_0x2aa12a){if(_0x2aa12a){return _0x2aa12a['destroy']()[_0xbc40('0x22')](function(){_0x4e8bb0[_0xbc40('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1566a7,_0x1e5726){return function(_0xee8446){if(!_0xee8446){_0x1566a7[_0xbc40('0x15')](0x194);}return _0xee8446;};}function handleError(_0x3593b2,_0x37c0fc){_0x37c0fc=_0x37c0fc||0x1f4;return function(_0x592f40){logger[_0xbc40('0x23')](_0x592f40[_0xbc40('0x24')]);if(_0x592f40[_0xbc40('0x25')]){delete _0x592f40[_0xbc40('0x25')];}_0x3593b2[_0xbc40('0x16')](_0x37c0fc)[_0xbc40('0x26')](_0x592f40);};}exports[_0xbc40('0x27')]=function(_0x2811d8,_0x4587ef){var _0x5096c1={},_0x5f5761={},_0x5dc733={'count':0x0,'rows':[]};var _0x330212=_[_0xbc40('0x28')](db[_0xbc40('0x29')]['rawAttributes'],function(_0x2ef5b4){return{'name':_0x2ef5b4[_0xbc40('0x2a')],'type':_0x2ef5b4[_0xbc40('0x2b')]['key']};});_0x5f5761[_0xbc40('0x2c')]=_['map'](_0x330212,'name');_0x5f5761[_0xbc40('0x2d')]=_['keys'](_0x2811d8['query']);_0x5f5761[_0xbc40('0x2e')]=_['intersection'](_0x5f5761[_0xbc40('0x2c')],_0x5f5761[_0xbc40('0x2d')]);_0x5096c1[_0xbc40('0x2f')]=_[_0xbc40('0x30')](_0x5f5761[_0xbc40('0x2c')],qs[_0xbc40('0x31')](_0x2811d8[_0xbc40('0x2d')][_0xbc40('0x31')]));_0x5096c1[_0xbc40('0x2f')]=_0x5096c1['attributes']['length']?_0x5096c1[_0xbc40('0x2f')]:_0x5f5761[_0xbc40('0x2c')];if(!_0x2811d8[_0xbc40('0x2d')][_0xbc40('0x32')]('nolimit')){_0x5096c1['limit']=qs[_0xbc40('0x19')](_0x2811d8[_0xbc40('0x2d')][_0xbc40('0x19')]);_0x5096c1['offset']=qs[_0xbc40('0x17')](_0x2811d8[_0xbc40('0x2d')]['offset']);}_0x5096c1['order']=qs[_0xbc40('0x33')](_0x2811d8['query'][_0xbc40('0x33')]);_0x5096c1['where']=qs['filters'](_[_0xbc40('0x34')](_0x2811d8['query'],_0x5f5761[_0xbc40('0x2e')]),_0x330212);if(_0x2811d8[_0xbc40('0x2d')][_0xbc40('0x35')]){_0x5096c1[_0xbc40('0x36')]=_[_0xbc40('0x37')](_0x5096c1[_0xbc40('0x36')],{'$or':_[_0xbc40('0x28')](_0x330212,function(_0x1bcee2){if(_0x1bcee2[_0xbc40('0x2b')]!==_0xbc40('0x38')){var _0x57a6f4={};_0x57a6f4[_0x1bcee2[_0xbc40('0x25')]]={'$like':'%'+_0x2811d8[_0xbc40('0x2d')][_0xbc40('0x35')]+'%'};return _0x57a6f4;}})});}_0x5096c1=_[_0xbc40('0x37')]({},_0x5096c1,_0x2811d8[_0xbc40('0x39')]);var _0x19cc38={'where':_0x5096c1['where']};return db[_0xbc40('0x29')][_0xbc40('0x1a')](_0x19cc38)['then'](function(_0x9290c7){_0x5dc733[_0xbc40('0x1a')]=_0x9290c7;if(_0x2811d8[_0xbc40('0x2d')]['includeAll']){_0x5096c1[_0xbc40('0x3a')]=[{'all':!![]}];}return db[_0xbc40('0x29')][_0xbc40('0x3b')](_0x5096c1);})['then'](function(_0x51d845){_0x5dc733[_0xbc40('0x3c')]=_0x51d845;return _0x5dc733;})['then'](respondWithFilteredResult(_0x4587ef,_0x5096c1))[_0xbc40('0x3d')](handleError(_0x4587ef,null));};exports[_0xbc40('0x3e')]=function(_0x26a12f,_0x3e1e86){var _0x32e8b3={'raw':![],'where':{'id':_0x26a12f[_0xbc40('0x3f')]['id']}},_0x1c2d59={};_0x1c2d59[_0xbc40('0x2c')]=_[_0xbc40('0x40')](db[_0xbc40('0x29')][_0xbc40('0x41')]);_0x1c2d59['query']=_[_0xbc40('0x40')](_0x26a12f[_0xbc40('0x2d')]);_0x1c2d59['filters']=_[_0xbc40('0x30')](_0x1c2d59[_0xbc40('0x2c')],_0x1c2d59[_0xbc40('0x2d')]);_0x32e8b3[_0xbc40('0x2f')]=_[_0xbc40('0x30')](_0x1c2d59[_0xbc40('0x2c')],qs[_0xbc40('0x31')](_0x26a12f['query']['fields']));_0x32e8b3[_0xbc40('0x2f')]=_0x32e8b3[_0xbc40('0x2f')][_0xbc40('0x42')]?_0x32e8b3[_0xbc40('0x2f')]:_0x1c2d59[_0xbc40('0x2c')];if(_0x26a12f[_0xbc40('0x2d')][_0xbc40('0x43')]){_0x32e8b3[_0xbc40('0x3a')]=[{'all':!![]}];}_0x32e8b3=_[_0xbc40('0x37')]({},_0x32e8b3,_0x26a12f[_0xbc40('0x39')]);return db[_0xbc40('0x29')][_0xbc40('0x44')](_0x32e8b3)[_0xbc40('0x22')](handleEntityNotFound(_0x3e1e86,null))[_0xbc40('0x22')](respondWithResult(_0x3e1e86,null))[_0xbc40('0x3d')](handleError(_0x3e1e86,null));};exports[_0xbc40('0x45')]=function(_0x35ad7a,_0x32312c){return db['SugarcrmConfiguration'][_0xbc40('0x45')](_0x35ad7a[_0xbc40('0x46')],{})[_0xbc40('0x22')](respondWithResult(_0x32312c,0xc9))['catch'](handleError(_0x32312c,null));};exports[_0xbc40('0x21')]=function(_0x3027ee,_0x52a4bb){if(_0x3027ee['body']['id']){delete _0x3027ee[_0xbc40('0x46')]['id'];}return db[_0xbc40('0x29')][_0xbc40('0x44')]({'where':{'id':_0x3027ee[_0xbc40('0x3f')]['id']}})[_0xbc40('0x22')](handleEntityNotFound(_0x52a4bb,null))[_0xbc40('0x22')](saveUpdates(_0x3027ee[_0xbc40('0x46')],null))['then'](respondWithResult(_0x52a4bb,null))['catch'](handleError(_0x52a4bb,null));};exports[_0xbc40('0x47')]=function(_0xdb946a,_0x439960){return db[_0xbc40('0x29')][_0xbc40('0x44')]({'where':{'id':_0xdb946a[_0xbc40('0x3f')]['id']}})[_0xbc40('0x22')](handleEntityNotFound(_0x439960,null))[_0xbc40('0x22')](removeEntity(_0x439960,null))[_0xbc40('0x3d')](handleError(_0x439960,null));};exports[_0xbc40('0x48')]=function(_0xd06a01,_0x2b8c80,_0x5e0032){var _0x896f3d={};var _0x4f15e7={};var _0x14467a;var _0x4acd28;return db[_0xbc40('0x29')][_0xbc40('0x49')]({'where':{'id':_0xd06a01['params']['id']}})[_0xbc40('0x22')](handleEntityNotFound(_0x2b8c80,null))[_0xbc40('0x22')](function(_0x2c5913){if(_0x2c5913){_0x14467a=_0x2c5913;_0x4f15e7['model']=_[_0xbc40('0x40')](db[_0xbc40('0x4a')]['rawAttributes']);_0x4f15e7[_0xbc40('0x2d')]=_[_0xbc40('0x40')](_0xd06a01[_0xbc40('0x2d')]);_0x4f15e7[_0xbc40('0x2e')]=_[_0xbc40('0x30')](_0x4f15e7[_0xbc40('0x2c')],_0x4f15e7[_0xbc40('0x2d')]);_0x896f3d[_0xbc40('0x2f')]=_[_0xbc40('0x30')](_0x4f15e7[_0xbc40('0x2c')],qs['fields'](_0xd06a01[_0xbc40('0x2d')][_0xbc40('0x31')]));_0x896f3d[_0xbc40('0x2f')]=_0x896f3d[_0xbc40('0x2f')][_0xbc40('0x42')]?_0x896f3d[_0xbc40('0x2f')]:_0x4f15e7[_0xbc40('0x2c')];_0x896f3d[_0xbc40('0x4b')]=qs[_0xbc40('0x33')](_0xd06a01[_0xbc40('0x2d')][_0xbc40('0x33')]);_0x896f3d['where']=qs['filters'](_[_0xbc40('0x34')](_0xd06a01[_0xbc40('0x2d')],_0x4f15e7['filters']));if(_0xd06a01[_0xbc40('0x2d')][_0xbc40('0x35')]){_0x896f3d[_0xbc40('0x36')]=_[_0xbc40('0x37')](_0x896f3d[_0xbc40('0x36')],{'$or':_[_0xbc40('0x28')](_0x896f3d['attributes'],function(_0x2ec025){var _0x8e9822={};_0x8e9822[_0x2ec025]={'$like':'%'+_0xd06a01[_0xbc40('0x2d')][_0xbc40('0x35')]+'%'};return _0x8e9822;})});}_0x896f3d=_[_0xbc40('0x37')]({},_0x896f3d,_0xd06a01[_0xbc40('0x39')]);return _0x14467a['getFields'](_0x896f3d);}})[_0xbc40('0x22')](function(_0x2287d1){if(_0x2287d1){_0x4acd28=_0x2287d1['length'];if(!_0xd06a01[_0xbc40('0x2d')][_0xbc40('0x32')](_0xbc40('0x4c'))){_0x896f3d[_0xbc40('0x19')]=qs['limit'](_0xd06a01['query']['limit']);_0x896f3d['offset']=qs[_0xbc40('0x17')](_0xd06a01[_0xbc40('0x2d')]['offset']);}return _0x14467a[_0xbc40('0x48')](_0x896f3d);}})[_0xbc40('0x22')](function(_0x169b8f){if(_0x169b8f){return _0x169b8f?{'count':_0x4acd28,'rows':_0x169b8f}:null;}})[_0xbc40('0x22')](respondWithResult(_0x2b8c80,null))['catch'](handleError(_0x2b8c80,null));};exports[_0xbc40('0x4d')]=function(_0x5f159f,_0x267296,_0x35db1b){var _0x1dd606={};var _0x22a964={};var _0x28bf8b;var _0x13a155;return db[_0xbc40('0x29')][_0xbc40('0x49')]({'where':{'id':_0x5f159f[_0xbc40('0x3f')]['id']}})['then'](handleEntityNotFound(_0x267296,null))[_0xbc40('0x22')](function(_0x46e075){if(_0x46e075){_0x28bf8b=_0x46e075;_0x22a964[_0xbc40('0x2c')]=_[_0xbc40('0x40')](db['SugarcrmField'][_0xbc40('0x41')]);_0x22a964[_0xbc40('0x2d')]=_['keys'](_0x5f159f[_0xbc40('0x2d')]);_0x22a964[_0xbc40('0x2e')]=_[_0xbc40('0x30')](_0x22a964[_0xbc40('0x2c')],_0x22a964[_0xbc40('0x2d')]);_0x1dd606[_0xbc40('0x2f')]=_['intersection'](_0x22a964['model'],qs['fields'](_0x5f159f['query']['fields']));_0x1dd606[_0xbc40('0x2f')]=_0x1dd606[_0xbc40('0x2f')]['length']?_0x1dd606[_0xbc40('0x2f')]:_0x22a964[_0xbc40('0x2c')];_0x1dd606[_0xbc40('0x4b')]=qs[_0xbc40('0x33')](_0x5f159f[_0xbc40('0x2d')][_0xbc40('0x33')]);_0x1dd606['where']=qs[_0xbc40('0x2e')](_[_0xbc40('0x34')](_0x5f159f[_0xbc40('0x2d')],_0x22a964['filters']));if(_0x5f159f[_0xbc40('0x2d')][_0xbc40('0x35')]){_0x1dd606[_0xbc40('0x36')]=_[_0xbc40('0x37')](_0x1dd606[_0xbc40('0x36')],{'$or':_[_0xbc40('0x28')](_0x1dd606['attributes'],function(_0x25d26c){var _0xbf625={};_0xbf625[_0x25d26c]={'$like':'%'+_0x5f159f[_0xbc40('0x2d')]['filter']+'%'};return _0xbf625;})});}_0x1dd606=_[_0xbc40('0x37')]({},_0x1dd606,_0x5f159f['options']);return _0x28bf8b['getSubjects'](_0x1dd606);}})['then'](function(_0x52672c){if(_0x52672c){_0x13a155=_0x52672c[_0xbc40('0x42')];if(!_0x5f159f['query'][_0xbc40('0x32')](_0xbc40('0x4c'))){_0x1dd606[_0xbc40('0x19')]=qs[_0xbc40('0x19')](_0x5f159f[_0xbc40('0x2d')][_0xbc40('0x19')]);_0x1dd606[_0xbc40('0x17')]=qs[_0xbc40('0x17')](_0x5f159f['query'][_0xbc40('0x17')]);}return _0x28bf8b[_0xbc40('0x4d')](_0x1dd606);}})[_0xbc40('0x22')](function(_0x41319d){if(_0x41319d){return _0x41319d?{'count':_0x13a155,'rows':_0x41319d}:null;}})['then'](respondWithResult(_0x267296,null))[_0xbc40('0x3d')](handleError(_0x267296,null));};exports[_0xbc40('0x4e')]=function(_0x3db4c5,_0x3fe679,_0x4c11d3){var _0x3e4f74={};var _0x533874={};var _0x32af60;var _0x515553;return db[_0xbc40('0x29')][_0xbc40('0x49')]({'where':{'id':_0x3db4c5[_0xbc40('0x3f')]['id']}})[_0xbc40('0x22')](handleEntityNotFound(_0x3fe679,null))[_0xbc40('0x22')](function(_0x2ce7a2){if(_0x2ce7a2){_0x32af60=_0x2ce7a2;_0x533874['model']=_[_0xbc40('0x40')](db[_0xbc40('0x4a')][_0xbc40('0x41')]);_0x533874[_0xbc40('0x2d')]=_[_0xbc40('0x40')](_0x3db4c5[_0xbc40('0x2d')]);_0x533874['filters']=_[_0xbc40('0x30')](_0x533874[_0xbc40('0x2c')],_0x533874[_0xbc40('0x2d')]);_0x3e4f74[_0xbc40('0x2f')]=_[_0xbc40('0x30')](_0x533874['model'],qs[_0xbc40('0x31')](_0x3db4c5[_0xbc40('0x2d')][_0xbc40('0x31')]));_0x3e4f74[_0xbc40('0x2f')]=_0x3e4f74[_0xbc40('0x2f')]['length']?_0x3e4f74[_0xbc40('0x2f')]:_0x533874['model'];_0x3e4f74[_0xbc40('0x4b')]=qs[_0xbc40('0x33')](_0x3db4c5['query'][_0xbc40('0x33')]);_0x3e4f74[_0xbc40('0x36')]=qs[_0xbc40('0x2e')](_['pick'](_0x3db4c5[_0xbc40('0x2d')],_0x533874['filters']));if(_0x3db4c5[_0xbc40('0x2d')][_0xbc40('0x35')]){_0x3e4f74[_0xbc40('0x36')]=_['merge'](_0x3e4f74[_0xbc40('0x36')],{'$or':_[_0xbc40('0x28')](_0x3e4f74[_0xbc40('0x2f')],function(_0x5ac5f1){var _0x4f36da={};_0x4f36da[_0x5ac5f1]={'$like':'%'+_0x3db4c5[_0xbc40('0x2d')][_0xbc40('0x35')]+'%'};return _0x4f36da;})});}_0x3e4f74=_['merge']({},_0x3e4f74,_0x3db4c5[_0xbc40('0x39')]);return _0x32af60[_0xbc40('0x4e')](_0x3e4f74);}})[_0xbc40('0x22')](function(_0x1858c8){if(_0x1858c8){_0x515553=_0x1858c8[_0xbc40('0x42')];if(!_0x3db4c5[_0xbc40('0x2d')][_0xbc40('0x32')]('nolimit')){_0x3e4f74[_0xbc40('0x19')]=qs[_0xbc40('0x19')](_0x3db4c5[_0xbc40('0x2d')]['limit']);_0x3e4f74[_0xbc40('0x17')]=qs[_0xbc40('0x17')](_0x3db4c5[_0xbc40('0x2d')]['offset']);}return _0x32af60['getDescriptions'](_0x3e4f74);}})[_0xbc40('0x22')](function(_0x24a6ae){if(_0x24a6ae){return _0x24a6ae?{'count':_0x515553,'rows':_0x24a6ae}:null;}})[_0xbc40('0x22')](respondWithResult(_0x3fe679,null))[_0xbc40('0x3d')](handleError(_0x3fe679,null));};
\ No newline at end of file
+var _0xc35b=['desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','undefined','limit','count','offset','reject','save','then','destroy','name','send','index','SugarcrmConfiguration','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','rows','show','catch','create','body','update','find','params','getFields','findOne','SugarcrmField','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','squel','crypto','jsforce'];(function(_0xb497ba,_0x19ea31){var _0x5212d1=function(_0xeea100){while(--_0xeea100){_0xb497ba['push'](_0xb497ba['shift']());}};_0x5212d1(++_0x19ea31);}(_0xc35b,0x12a));var _0xbc35=function(_0x550d12,_0x5384bd){_0x550d12=_0x550d12-0x0;var _0x12103d=_0xc35b[_0x550d12];return _0x12103d;};'use strict';var emlformat=require(_0xbc35('0x0'));var rimraf=require(_0xbc35('0x1'));var zipdir=require(_0xbc35('0x2'));var jsonpatch=require(_0xbc35('0x3'));var rp=require(_0xbc35('0x4'));var moment=require(_0xbc35('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xbc35('0x6'));var util=require(_0xbc35('0x7'));var path=require(_0xbc35('0x8'));var sox=require(_0xbc35('0x9'));var csv=require('to-csv');var ejs=require(_0xbc35('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xbc35('0xb'));var crypto=require(_0xbc35('0xc'));var jsforce=require(_0xbc35('0xd'));var deskjs=require(_0xbc35('0xe'));var toCsv=require(_0xbc35('0xf'));var querystring=require(_0xbc35('0x10'));var Papa=require(_0xbc35('0x11'));var Redis=require('ioredis');var authService=require(_0xbc35('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xbc35('0x13'));var hardwareService=require(_0xbc35('0x14'));var logger=require('../../config/logger')(_0xbc35('0x15'));var utils=require(_0xbc35('0x16'));var config=require(_0xbc35('0x17'));var licenseUtil=require(_0xbc35('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x428f49,_0x2c4295){_0x2c4295=_0x2c4295||0xcc;return function(_0x55478d){if(_0x55478d){return _0x428f49[_0xbc35('0x19')](_0x2c4295);}return _0x428f49['status'](_0x2c4295)[_0xbc35('0x1a')]();};}function respondWithResult(_0x2bae91,_0x269992){_0x269992=_0x269992||0xc8;return function(_0xddff39){if(_0xddff39){return _0x2bae91[_0xbc35('0x1b')](_0x269992)[_0xbc35('0x1c')](_0xddff39);}};}function respondWithFilteredResult(_0x53221,_0x2e2783){return function(_0x75516b){if(_0x75516b){var _0x3d845b=typeof _0x2e2783['offset']===_0xbc35('0x1d')&&typeof _0x2e2783[_0xbc35('0x1e')]===_0xbc35('0x1d');var _0x12f64a=_0x75516b[_0xbc35('0x1f')];var _0x114c9c=_0x3d845b?0x0:_0x2e2783[_0xbc35('0x20')];var _0x4edc3c=_0x3d845b?_0x75516b[_0xbc35('0x1f')]:_0x2e2783['offset']+_0x2e2783[_0xbc35('0x1e')];var _0x5b9807;if(_0x4edc3c>=_0x12f64a){_0x4edc3c=_0x12f64a;_0x5b9807=0xc8;}else{_0x5b9807=0xce;}_0x53221[_0xbc35('0x1b')](_0x5b9807);return _0x53221['set']('Content-Range',_0x114c9c+'-'+_0x4edc3c+'/'+_0x12f64a)[_0xbc35('0x1c')](_0x75516b);}return null;};}function patchUpdates(_0x9c1684){return function(_0x4c3d1b){try{jsonpatch['apply'](_0x4c3d1b,_0x9c1684,!![]);}catch(_0x44bcdd){return BPromise[_0xbc35('0x21')](_0x44bcdd);}return _0x4c3d1b[_0xbc35('0x22')]();};}function saveUpdates(_0x4dad35,_0x452fbf){return function(_0x402d8e){if(_0x402d8e){return _0x402d8e['update'](_0x4dad35)[_0xbc35('0x23')](function(_0x268210){return _0x268210;});}return null;};}function removeEntity(_0x3f90f3,_0x8dd1ad){return function(_0x2bff62){if(_0x2bff62){return _0x2bff62[_0xbc35('0x24')]()[_0xbc35('0x23')](function(){_0x3f90f3['status'](0xcc)[_0xbc35('0x1a')]();});}};}function handleEntityNotFound(_0x2569b9,_0xb538ae){return function(_0x1806e5){if(!_0x1806e5){_0x2569b9['sendStatus'](0x194);}return _0x1806e5;};}function handleError(_0xa4c3e8,_0x1ce336){_0x1ce336=_0x1ce336||0x1f4;return function(_0x59ec42){logger['error'](_0x59ec42['stack']);if(_0x59ec42['name']){delete _0x59ec42[_0xbc35('0x25')];}_0xa4c3e8[_0xbc35('0x1b')](_0x1ce336)[_0xbc35('0x26')](_0x59ec42);};}exports[_0xbc35('0x27')]=function(_0x10e25a,_0x425dc4){var _0x45f55e={},_0x33d3c2={},_0xdc5e9d={'count':0x0,'rows':[]};var _0x474479=_['map'](db[_0xbc35('0x28')][_0xbc35('0x29')],function(_0x5db910){return{'name':_0x5db910[_0xbc35('0x2a')],'type':_0x5db910['type'][_0xbc35('0x2b')]};});_0x33d3c2[_0xbc35('0x2c')]=_[_0xbc35('0x2d')](_0x474479,'name');_0x33d3c2[_0xbc35('0x2e')]=_[_0xbc35('0x2f')](_0x10e25a[_0xbc35('0x2e')]);_0x33d3c2[_0xbc35('0x30')]=_[_0xbc35('0x31')](_0x33d3c2[_0xbc35('0x2c')],_0x33d3c2[_0xbc35('0x2e')]);_0x45f55e[_0xbc35('0x32')]=_['intersection'](_0x33d3c2[_0xbc35('0x2c')],qs[_0xbc35('0x33')](_0x10e25a['query'][_0xbc35('0x33')]));_0x45f55e[_0xbc35('0x32')]=_0x45f55e[_0xbc35('0x32')][_0xbc35('0x34')]?_0x45f55e[_0xbc35('0x32')]:_0x33d3c2[_0xbc35('0x2c')];if(!_0x10e25a[_0xbc35('0x2e')][_0xbc35('0x35')](_0xbc35('0x36'))){_0x45f55e[_0xbc35('0x1e')]=qs['limit'](_0x10e25a['query'][_0xbc35('0x1e')]);_0x45f55e[_0xbc35('0x20')]=qs[_0xbc35('0x20')](_0x10e25a[_0xbc35('0x2e')][_0xbc35('0x20')]);}_0x45f55e[_0xbc35('0x37')]=qs['sort'](_0x10e25a[_0xbc35('0x2e')][_0xbc35('0x38')]);_0x45f55e[_0xbc35('0x39')]=qs['filters'](_[_0xbc35('0x3a')](_0x10e25a[_0xbc35('0x2e')],_0x33d3c2[_0xbc35('0x30')]),_0x474479);if(_0x10e25a[_0xbc35('0x2e')][_0xbc35('0x3b')]){_0x45f55e[_0xbc35('0x39')]=_[_0xbc35('0x3c')](_0x45f55e[_0xbc35('0x39')],{'$or':_[_0xbc35('0x2d')](_0x474479,function(_0x4b738e){if(_0x4b738e[_0xbc35('0x3d')]!==_0xbc35('0x3e')){var _0xf9eed2={};_0xf9eed2[_0x4b738e[_0xbc35('0x25')]]={'$like':'%'+_0x10e25a[_0xbc35('0x2e')][_0xbc35('0x3b')]+'%'};return _0xf9eed2;}})});}_0x45f55e=_[_0xbc35('0x3c')]({},_0x45f55e,_0x10e25a[_0xbc35('0x3f')]);var _0x3f5e2a={'where':_0x45f55e[_0xbc35('0x39')]};return db['SugarcrmConfiguration'][_0xbc35('0x1f')](_0x3f5e2a)[_0xbc35('0x23')](function(_0x50148c){_0xdc5e9d['count']=_0x50148c;if(_0x10e25a[_0xbc35('0x2e')][_0xbc35('0x40')]){_0x45f55e['include']=[{'all':!![]}];}return db[_0xbc35('0x28')]['findAll'](_0x45f55e);})[_0xbc35('0x23')](function(_0xd81ac7){_0xdc5e9d[_0xbc35('0x41')]=_0xd81ac7;return _0xdc5e9d;})['then'](respondWithFilteredResult(_0x425dc4,_0x45f55e))['catch'](handleError(_0x425dc4,null));};exports[_0xbc35('0x42')]=function(_0x5a470e,_0x2300f4){var _0x949021={'raw':![],'where':{'id':_0x5a470e['params']['id']}},_0x517633={};_0x517633[_0xbc35('0x2c')]=_[_0xbc35('0x2f')](db['SugarcrmConfiguration']['rawAttributes']);_0x517633[_0xbc35('0x2e')]=_[_0xbc35('0x2f')](_0x5a470e[_0xbc35('0x2e')]);_0x517633[_0xbc35('0x30')]=_[_0xbc35('0x31')](_0x517633[_0xbc35('0x2c')],_0x517633[_0xbc35('0x2e')]);_0x949021['attributes']=_[_0xbc35('0x31')](_0x517633['model'],qs[_0xbc35('0x33')](_0x5a470e['query'][_0xbc35('0x33')]));_0x949021[_0xbc35('0x32')]=_0x949021[_0xbc35('0x32')]['length']?_0x949021['attributes']:_0x517633[_0xbc35('0x2c')];if(_0x5a470e[_0xbc35('0x2e')][_0xbc35('0x40')]){_0x949021['include']=[{'all':!![]}];}_0x949021=_[_0xbc35('0x3c')]({},_0x949021,_0x5a470e[_0xbc35('0x3f')]);return db[_0xbc35('0x28')]['find'](_0x949021)[_0xbc35('0x23')](handleEntityNotFound(_0x2300f4,null))['then'](respondWithResult(_0x2300f4,null))[_0xbc35('0x43')](handleError(_0x2300f4,null));};exports[_0xbc35('0x44')]=function(_0x226758,_0x5eafa5){return db['SugarcrmConfiguration'][_0xbc35('0x44')](_0x226758[_0xbc35('0x45')],{})[_0xbc35('0x23')](respondWithResult(_0x5eafa5,0xc9))[_0xbc35('0x43')](handleError(_0x5eafa5,null));};exports[_0xbc35('0x46')]=function(_0x627ec7,_0x28cab6){if(_0x627ec7[_0xbc35('0x45')]['id']){delete _0x627ec7[_0xbc35('0x45')]['id'];}return db[_0xbc35('0x28')][_0xbc35('0x47')]({'where':{'id':_0x627ec7[_0xbc35('0x48')]['id']}})[_0xbc35('0x23')](handleEntityNotFound(_0x28cab6,null))['then'](saveUpdates(_0x627ec7[_0xbc35('0x45')],null))[_0xbc35('0x23')](respondWithResult(_0x28cab6,null))[_0xbc35('0x43')](handleError(_0x28cab6,null));};exports['destroy']=function(_0x53d9b9,_0x1d859c){return db[_0xbc35('0x28')][_0xbc35('0x47')]({'where':{'id':_0x53d9b9[_0xbc35('0x48')]['id']}})[_0xbc35('0x23')](handleEntityNotFound(_0x1d859c,null))[_0xbc35('0x23')](removeEntity(_0x1d859c,null))['catch'](handleError(_0x1d859c,null));};exports[_0xbc35('0x49')]=function(_0x531e1c,_0x1030bc,_0x352b14){var _0x8db7eb={};var _0x3f939e={};var _0x357c4c;var _0x42f287;return db[_0xbc35('0x28')][_0xbc35('0x4a')]({'where':{'id':_0x531e1c[_0xbc35('0x48')]['id']}})[_0xbc35('0x23')](handleEntityNotFound(_0x1030bc,null))[_0xbc35('0x23')](function(_0xb1677a){if(_0xb1677a){_0x357c4c=_0xb1677a;_0x3f939e[_0xbc35('0x2c')]=_['keys'](db[_0xbc35('0x4b')][_0xbc35('0x29')]);_0x3f939e[_0xbc35('0x2e')]=_[_0xbc35('0x2f')](_0x531e1c[_0xbc35('0x2e')]);_0x3f939e[_0xbc35('0x30')]=_[_0xbc35('0x31')](_0x3f939e[_0xbc35('0x2c')],_0x3f939e[_0xbc35('0x2e')]);_0x8db7eb[_0xbc35('0x32')]=_[_0xbc35('0x31')](_0x3f939e[_0xbc35('0x2c')],qs['fields'](_0x531e1c[_0xbc35('0x2e')][_0xbc35('0x33')]));_0x8db7eb[_0xbc35('0x32')]=_0x8db7eb[_0xbc35('0x32')]['length']?_0x8db7eb[_0xbc35('0x32')]:_0x3f939e[_0xbc35('0x2c')];_0x8db7eb[_0xbc35('0x37')]=qs['sort'](_0x531e1c[_0xbc35('0x2e')][_0xbc35('0x38')]);_0x8db7eb[_0xbc35('0x39')]=qs[_0xbc35('0x30')](_[_0xbc35('0x3a')](_0x531e1c[_0xbc35('0x2e')],_0x3f939e[_0xbc35('0x30')]));if(_0x531e1c[_0xbc35('0x2e')][_0xbc35('0x3b')]){_0x8db7eb['where']=_[_0xbc35('0x3c')](_0x8db7eb['where'],{'$or':_[_0xbc35('0x2d')](_0x8db7eb['attributes'],function(_0x4ee0c5){var _0x11cb13={};_0x11cb13[_0x4ee0c5]={'$like':'%'+_0x531e1c[_0xbc35('0x2e')]['filter']+'%'};return _0x11cb13;})});}_0x8db7eb=_[_0xbc35('0x3c')]({},_0x8db7eb,_0x531e1c[_0xbc35('0x3f')]);return _0x357c4c[_0xbc35('0x49')](_0x8db7eb);}})[_0xbc35('0x23')](function(_0x174dab){if(_0x174dab){_0x42f287=_0x174dab[_0xbc35('0x34')];if(!_0x531e1c['query']['hasOwnProperty'](_0xbc35('0x36'))){_0x8db7eb['limit']=qs[_0xbc35('0x1e')](_0x531e1c['query']['limit']);_0x8db7eb['offset']=qs[_0xbc35('0x20')](_0x531e1c['query'][_0xbc35('0x20')]);}return _0x357c4c[_0xbc35('0x49')](_0x8db7eb);}})[_0xbc35('0x23')](function(_0x3bfe83){if(_0x3bfe83){return _0x3bfe83?{'count':_0x42f287,'rows':_0x3bfe83}:null;}})[_0xbc35('0x23')](respondWithResult(_0x1030bc,null))[_0xbc35('0x43')](handleError(_0x1030bc,null));};exports['getSubjects']=function(_0x20521c,_0x3650e2,_0x5029ce){var _0x2f9afd={};var _0x50e3ff={};var _0xfc4524;var _0x4267d2;return db['SugarcrmConfiguration']['findOne']({'where':{'id':_0x20521c[_0xbc35('0x48')]['id']}})['then'](handleEntityNotFound(_0x3650e2,null))['then'](function(_0x1837d){if(_0x1837d){_0xfc4524=_0x1837d;_0x50e3ff[_0xbc35('0x2c')]=_[_0xbc35('0x2f')](db[_0xbc35('0x4b')][_0xbc35('0x29')]);_0x50e3ff[_0xbc35('0x2e')]=_[_0xbc35('0x2f')](_0x20521c[_0xbc35('0x2e')]);_0x50e3ff[_0xbc35('0x30')]=_[_0xbc35('0x31')](_0x50e3ff[_0xbc35('0x2c')],_0x50e3ff[_0xbc35('0x2e')]);_0x2f9afd[_0xbc35('0x32')]=_[_0xbc35('0x31')](_0x50e3ff[_0xbc35('0x2c')],qs[_0xbc35('0x33')](_0x20521c['query']['fields']));_0x2f9afd[_0xbc35('0x32')]=_0x2f9afd['attributes'][_0xbc35('0x34')]?_0x2f9afd[_0xbc35('0x32')]:_0x50e3ff[_0xbc35('0x2c')];_0x2f9afd[_0xbc35('0x37')]=qs[_0xbc35('0x38')](_0x20521c[_0xbc35('0x2e')][_0xbc35('0x38')]);_0x2f9afd[_0xbc35('0x39')]=qs[_0xbc35('0x30')](_[_0xbc35('0x3a')](_0x20521c['query'],_0x50e3ff['filters']));if(_0x20521c['query'][_0xbc35('0x3b')]){_0x2f9afd[_0xbc35('0x39')]=_[_0xbc35('0x3c')](_0x2f9afd[_0xbc35('0x39')],{'$or':_[_0xbc35('0x2d')](_0x2f9afd[_0xbc35('0x32')],function(_0x1bf69){var _0x1018e9={};_0x1018e9[_0x1bf69]={'$like':'%'+_0x20521c[_0xbc35('0x2e')][_0xbc35('0x3b')]+'%'};return _0x1018e9;})});}_0x2f9afd=_[_0xbc35('0x3c')]({},_0x2f9afd,_0x20521c[_0xbc35('0x3f')]);return _0xfc4524[_0xbc35('0x4c')](_0x2f9afd);}})[_0xbc35('0x23')](function(_0x23d55b){if(_0x23d55b){_0x4267d2=_0x23d55b['length'];if(!_0x20521c[_0xbc35('0x2e')][_0xbc35('0x35')](_0xbc35('0x36'))){_0x2f9afd[_0xbc35('0x1e')]=qs[_0xbc35('0x1e')](_0x20521c['query']['limit']);_0x2f9afd[_0xbc35('0x20')]=qs['offset'](_0x20521c['query'][_0xbc35('0x20')]);}return _0xfc4524[_0xbc35('0x4c')](_0x2f9afd);}})[_0xbc35('0x23')](function(_0x3c59fd){if(_0x3c59fd){return _0x3c59fd?{'count':_0x4267d2,'rows':_0x3c59fd}:null;}})[_0xbc35('0x23')](respondWithResult(_0x3650e2,null))[_0xbc35('0x43')](handleError(_0x3650e2,null));};exports['getDescriptions']=function(_0x30c0bf,_0x17e9f3,_0x2b6566){var _0x4995e0={};var _0x3bd012={};var _0x4f10d5;var _0x448999;return db['SugarcrmConfiguration'][_0xbc35('0x4a')]({'where':{'id':_0x30c0bf[_0xbc35('0x48')]['id']}})['then'](handleEntityNotFound(_0x17e9f3,null))[_0xbc35('0x23')](function(_0x7cd8){if(_0x7cd8){_0x4f10d5=_0x7cd8;_0x3bd012[_0xbc35('0x2c')]=_[_0xbc35('0x2f')](db[_0xbc35('0x4b')][_0xbc35('0x29')]);_0x3bd012[_0xbc35('0x2e')]=_['keys'](_0x30c0bf[_0xbc35('0x2e')]);_0x3bd012['filters']=_[_0xbc35('0x31')](_0x3bd012[_0xbc35('0x2c')],_0x3bd012[_0xbc35('0x2e')]);_0x4995e0[_0xbc35('0x32')]=_['intersection'](_0x3bd012[_0xbc35('0x2c')],qs['fields'](_0x30c0bf['query'][_0xbc35('0x33')]));_0x4995e0[_0xbc35('0x32')]=_0x4995e0[_0xbc35('0x32')][_0xbc35('0x34')]?_0x4995e0[_0xbc35('0x32')]:_0x3bd012[_0xbc35('0x2c')];_0x4995e0[_0xbc35('0x37')]=qs[_0xbc35('0x38')](_0x30c0bf['query'][_0xbc35('0x38')]);_0x4995e0[_0xbc35('0x39')]=qs[_0xbc35('0x30')](_[_0xbc35('0x3a')](_0x30c0bf[_0xbc35('0x2e')],_0x3bd012[_0xbc35('0x30')]));if(_0x30c0bf['query'][_0xbc35('0x3b')]){_0x4995e0['where']=_[_0xbc35('0x3c')](_0x4995e0[_0xbc35('0x39')],{'$or':_[_0xbc35('0x2d')](_0x4995e0[_0xbc35('0x32')],function(_0x439589){var _0x2d11ee={};_0x2d11ee[_0x439589]={'$like':'%'+_0x30c0bf[_0xbc35('0x2e')][_0xbc35('0x3b')]+'%'};return _0x2d11ee;})});}_0x4995e0=_['merge']({},_0x4995e0,_0x30c0bf['options']);return _0x4f10d5['getDescriptions'](_0x4995e0);}})[_0xbc35('0x23')](function(_0x490dba){if(_0x490dba){_0x448999=_0x490dba[_0xbc35('0x34')];if(!_0x30c0bf['query'][_0xbc35('0x35')](_0xbc35('0x36'))){_0x4995e0[_0xbc35('0x1e')]=qs[_0xbc35('0x1e')](_0x30c0bf[_0xbc35('0x2e')][_0xbc35('0x1e')]);_0x4995e0[_0xbc35('0x20')]=qs['offset'](_0x30c0bf[_0xbc35('0x2e')][_0xbc35('0x20')]);}return _0x4f10d5[_0xbc35('0x4d')](_0x4995e0);}})[_0xbc35('0x23')](function(_0x2e2607){if(_0x2e2607){return _0x2e2607?{'count':_0x448999,'rows':_0x2e2607}:null;}})['then'](respondWithResult(_0x17e9f3,null))[_0xbc35('0x43')](handleError(_0x17e9f3,null));};
\ No newline at end of file
index 6a1def2..3dcb4bf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xae90=['util','../../config/logger','api','request-promise','rimraf','../../config/environment','./intSugarcrmConfiguration.attributes','exports','define','SugarcrmConfiguration','int_sugarcrm_configurations'];(function(_0x408f72,_0x4c7f6d){var _0x42c895=function(_0x152360){while(--_0x152360){_0x408f72['push'](_0x408f72['shift']());}};_0x42c895(++_0x4c7f6d);}(_0xae90,0x1ad));var _0x0ae9=function(_0x380274,_0x2de11c){_0x380274=_0x380274-0x0;var _0x9d7f61=_0xae90[_0x380274];return _0x9d7f61;};'use strict';var _=require('lodash');var util=require(_0x0ae9('0x0'));var logger=require(_0x0ae9('0x1'))(_0x0ae9('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x0ae9('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0ae9('0x4'));var config=require(_0x0ae9('0x5'));var attributes=require(_0x0ae9('0x6'));module[_0x0ae9('0x7')]=function(_0x3c3b2a,_0x45f6b0){return _0x3c3b2a[_0x0ae9('0x8')](_0x0ae9('0x9'),attributes,{'tableName':_0x0ae9('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9d30=['request-promise','path','rimraf','../../config/environment','define','SugarcrmConfiguration','int_sugarcrm_configurations','lodash','util','../../config/logger','api'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x9d30,0xf9));var _0x09d3=function(_0x30077a,_0x232d23){_0x30077a=_0x30077a-0x0;var _0x195189=_0x9d30[_0x30077a];return _0x195189;};'use strict';var _=require(_0x09d3('0x0'));var util=require(_0x09d3('0x1'));var logger=require(_0x09d3('0x2'))(_0x09d3('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x09d3('0x4'));var fs=require('fs');var path=require(_0x09d3('0x5'));var rimraf=require(_0x09d3('0x6'));var config=require(_0x09d3('0x7'));var attributes=require('./intSugarcrmConfiguration.attributes');module['exports']=function(_0x51f142,_0xa48705){return _0x51f142[_0x09d3('0x8')](_0x09d3('0x9'),attributes,{'tableName':_0x09d3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 035bba6..1f4ced8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd0ab=['../../config/environment','jayson/promise','client','http','request','info','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','SugarcrmConfiguration,\x20%s,\x20%s','message','request\x20sent','result','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x4e4538,_0x160a76){var _0x2baffb=function(_0x4dcc7c){while(--_0x4dcc7c){_0x4e4538['push'](_0x4e4538['shift']());}};_0x2baffb(++_0x160a76);}(_0xd0ab,0x1dd));var _0xbd0a=function(_0x103159,_0x28dacb){_0x103159=_0x103159-0x0;var _0x1d545a=_0xd0ab[_0x103159];return _0x1d545a;};'use strict';var _=require(_0xbd0a('0x0'));var util=require(_0xbd0a('0x1'));var moment=require(_0xbd0a('0x2'));var BPromise=require(_0xbd0a('0x3'));var rs=require(_0xbd0a('0x4'));var fs=require('fs');var Redis=require(_0xbd0a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xbd0a('0x6'));var jayson=require(_0xbd0a('0x7'));var client=jayson[_0xbd0a('0x8')][_0xbd0a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x14d573,_0x54672d,_0x259e32){return new BPromise(function(_0x2e2bda,_0x1a057a){return client[_0xbd0a('0xa')](_0x14d573,_0x259e32)['then'](function(_0x2cf11c){logger[_0xbd0a('0xb')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x54672d,'request\x20sent');logger[_0xbd0a('0xc')](_0xbd0a('0xd'),_0x54672d,'request\x20sent',JSON[_0xbd0a('0xe')](_0x2cf11c));if(_0x2cf11c['error']){if(_0x2cf11c[_0xbd0a('0xf')][_0xbd0a('0x10')]===0x1f4){logger[_0xbd0a('0xf')](_0xbd0a('0x11'),_0x54672d,_0x2cf11c[_0xbd0a('0xf')][_0xbd0a('0x12')]);return _0x1a057a(_0x2cf11c[_0xbd0a('0xf')][_0xbd0a('0x12')]);}logger[_0xbd0a('0xf')](_0xbd0a('0x11'),_0x54672d,_0x2cf11c[_0xbd0a('0xf')][_0xbd0a('0x12')]);return _0x2e2bda(_0x2cf11c[_0xbd0a('0xf')][_0xbd0a('0x12')]);}else{logger['info'](_0xbd0a('0x11'),_0x54672d,_0xbd0a('0x13'));_0x2e2bda(_0x2cf11c[_0xbd0a('0x14')]['message']);}})['catch'](function(_0x151deb){logger[_0xbd0a('0xf')](_0xbd0a('0x11'),_0x54672d,_0x151deb);_0x1a057a(_0x151deb);});});}
\ No newline at end of file
+var _0x96cf=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','SugarcrmConfiguration,\x20%s,\x20%s','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x14596d,_0x1a4568){var _0x55696a=function(_0x103e27){while(--_0x103e27){_0x14596d['push'](_0x14596d['shift']());}};_0x55696a(++_0x1a4568);}(_0x96cf,0x171));var _0xf96c=function(_0x557592,_0x1885ec){_0x557592=_0x557592-0x0;var _0x44b748=_0x96cf[_0x557592];return _0x44b748;};'use strict';var _=require(_0xf96c('0x0'));var util=require(_0xf96c('0x1'));var moment=require(_0xf96c('0x2'));var BPromise=require(_0xf96c('0x3'));var rs=require(_0xf96c('0x4'));var fs=require('fs');var Redis=require(_0xf96c('0x5'));var db=require(_0xf96c('0x6'))['db'];var utils=require(_0xf96c('0x7'));var logger=require(_0xf96c('0x8'))(_0xf96c('0x9'));var config=require(_0xf96c('0xa'));var jayson=require('jayson/promise');var client=jayson['client'][_0xf96c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xc30cda,_0x1dfd96,_0x3699af){return new BPromise(function(_0x2e9146,_0x9df3ef){return client[_0xf96c('0xc')](_0xc30cda,_0x3699af)['then'](function(_0x4f43e8){logger['info'](_0xf96c('0xd'),_0x1dfd96,'request\x20sent');logger['debug'](_0xf96c('0xe'),_0x1dfd96,_0xf96c('0xf'),JSON[_0xf96c('0x10')](_0x4f43e8));if(_0x4f43e8[_0xf96c('0x11')]){if(_0x4f43e8[_0xf96c('0x11')]['code']===0x1f4){logger[_0xf96c('0x11')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x1dfd96,_0x4f43e8[_0xf96c('0x11')][_0xf96c('0x12')]);return _0x9df3ef(_0x4f43e8['error'][_0xf96c('0x12')]);}logger[_0xf96c('0x11')](_0xf96c('0xd'),_0x1dfd96,_0x4f43e8[_0xf96c('0x11')][_0xf96c('0x12')]);return _0x2e9146(_0x4f43e8[_0xf96c('0x11')][_0xf96c('0x12')]);}else{logger[_0xf96c('0x13')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x1dfd96,'request\x20sent');_0x2e9146(_0x4f43e8[_0xf96c('0x14')][_0xf96c('0x12')]);}})[_0xf96c('0x15')](function(_0x2fb7e7){logger[_0xf96c('0x11')](_0xf96c('0xd'),_0x1dfd96,_0x2fb7e7);_0x9df3ef(_0x2fb7e7);});});}
\ No newline at end of file
index b973047..1bb6d48 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdb28=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x4074d5,_0xa57194){var _0x502cfe=function(_0x345efa){while(--_0x345efa){_0x4074d5['push'](_0x4074d5['shift']());}};_0x502cfe(++_0xa57194);}(_0xdb28,0xe6));var _0x8db2=function(_0x4df33f,_0x274b38){_0x4df33f=_0x4df33f-0x0;var _0x215b03=_0xdb28[_0x4df33f];return _0x215b03;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require(_0x8db2('0x4'));var router=express[_0x8db2('0x5')]();var fs_extra=require(_0x8db2('0x6'));var auth=require(_0x8db2('0x7'));var interaction=require(_0x8db2('0x8'));var config=require(_0x8db2('0x9'));var controller=require(_0x8db2('0xa'));router[_0x8db2('0xb')]('/',auth[_0x8db2('0xc')](),controller[_0x8db2('0xd')]);router[_0x8db2('0xb')](_0x8db2('0xe'),auth[_0x8db2('0xc')](),controller[_0x8db2('0xf')]);router[_0x8db2('0x10')]('/',auth[_0x8db2('0xc')](),controller[_0x8db2('0x11')]);router[_0x8db2('0x12')](_0x8db2('0xe'),auth[_0x8db2('0xc')](),controller[_0x8db2('0x13')]);router[_0x8db2('0x14')](_0x8db2('0xe'),auth['isAuthenticated'](),controller[_0x8db2('0x15')]);module[_0x8db2('0x16')]=router;
\ No newline at end of file
+var _0x2360=['../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','get','isAuthenticated','index','/:id','post','create','delete','destroy','multer','util','path','connect-timeout','../../components/auth/service'];(function(_0x2cc569,_0x4e9568){var _0x1bfc2e=function(_0x5b8fcb){while(--_0x5b8fcb){_0x2cc569['push'](_0x2cc569['shift']());}};_0x1bfc2e(++_0x4e9568);}(_0x2360,0x18b));var _0x0236=function(_0x397ae9,_0x316ca6){_0x397ae9=_0x397ae9-0x0;var _0x19d565=_0x2360[_0x397ae9];return _0x19d565;};'use strict';var multer=require(_0x0236('0x0'));var util=require(_0x0236('0x1'));var path=require(_0x0236('0x2'));var timeout=require(_0x0236('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x0236('0x4'));var interaction=require(_0x0236('0x5'));var config=require(_0x0236('0x6'));var controller=require(_0x0236('0x7'));router[_0x0236('0x8')]('/',auth[_0x0236('0x9')](),controller[_0x0236('0xa')]);router[_0x0236('0x8')](_0x0236('0xb'),auth[_0x0236('0x9')](),controller['show']);router[_0x0236('0xc')]('/',auth[_0x0236('0x9')](),controller[_0x0236('0xd')]);router['put'](_0x0236('0xb'),auth[_0x0236('0x9')](),controller['update']);router[_0x0236('0xe')](_0x0236('0xb'),auth[_0x0236('0x9')](),controller[_0x0236('0xf')]);module['exports']=router;
\ No newline at end of file
index d807f7c..5330b58 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9bdb=['picklist','STRING','BOOLEAN','exports','ENUM','string','variable','customVariable','keyValue'];(function(_0x5f4d3d,_0x59e9fd){var _0x47672b=function(_0x368ed5){while(--_0x368ed5){_0x5f4d3d['push'](_0x5f4d3d['shift']());}};_0x47672b(++_0x59e9fd);}(_0x9bdb,0x8a));var _0xb9bd=function(_0x4bd5bf,_0x1a96bc){_0x4bd5bf=_0x4bd5bf-0x0;var _0x930b55=_0x9bdb[_0x4bd5bf];return _0x930b55;};'use strict';var Sequelize=require('sequelize');module[_0xb9bd('0x0')]={'type':{'type':Sequelize[_0xb9bd('0x1')](_0xb9bd('0x2'),_0xb9bd('0x3'),_0xb9bd('0x4'),_0xb9bd('0x5'),_0xb9bd('0x6')),'defaultValue':_0xb9bd('0x2')},'content':{'type':Sequelize[_0xb9bd('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0xb9bd('0x2'),'variable',_0xb9bd('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xb9bd('0x7')]},'nameField':{'type':Sequelize[_0xb9bd('0x7')]},'customField':{'type':Sequelize[_0xb9bd('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xb9bd('0x7')]}};
\ No newline at end of file
+var _0x6a45=['keyValue','picklist','STRING','BOOLEAN','ENUM','string','variable','customVariable'];(function(_0x8491bd,_0xd0c9da){var _0x2ab523=function(_0x3ce169){while(--_0x3ce169){_0x8491bd['push'](_0x8491bd['shift']());}};_0x2ab523(++_0xd0c9da);}(_0x6a45,0xf4));var _0x56a4=function(_0x2d8af7,_0x266491){_0x2d8af7=_0x2d8af7-0x0;var _0x4f2151=_0x6a45[_0x2d8af7];return _0x4f2151;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x56a4('0x0')](_0x56a4('0x1'),_0x56a4('0x2'),_0x56a4('0x3'),_0x56a4('0x4'),_0x56a4('0x5')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x56a4('0x6')]},'keyType':{'type':Sequelize[_0x56a4('0x0')](_0x56a4('0x1'),'variable',_0x56a4('0x3'))},'keyContent':{'type':Sequelize[_0x56a4('0x6')]},'idField':{'type':Sequelize[_0x56a4('0x6')]},'nameField':{'type':Sequelize[_0x56a4('0x6')]},'customField':{'type':Sequelize[_0x56a4('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x56a4('0x6')]}};
\ No newline at end of file
index 3ae7619..c4c5487 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9221=['name','send','map','SugarcrmField','rawAttributes','fieldName','type','key','query','intersection','model','fields','attributes','length','hasOwnProperty','limit','sort','filters','pick','filter','where','merge','options','includeAll','include','findAll','rows','show','params','keys','catch','create','body','find','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','status','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','end','sendStatus','error'];(function(_0x2e4e19,_0x493b50){var _0x9ba20b=function(_0x2f6456){while(--_0x2f6456){_0x2e4e19['push'](_0x2e4e19['shift']());}};_0x9ba20b(++_0x493b50);}(_0x9221,0x6c));var _0x1922=function(_0x247aab,_0x6d308){_0x247aab=_0x247aab-0x0;var _0x198cd0=_0x9221[_0x247aab];return _0x198cd0;};'use strict';var emlformat=require(_0x1922('0x0'));var rimraf=require(_0x1922('0x1'));var zipdir=require(_0x1922('0x2'));var jsonpatch=require(_0x1922('0x3'));var rp=require(_0x1922('0x4'));var moment=require(_0x1922('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x1922('0x6'));var util=require(_0x1922('0x7'));var path=require('path');var sox=require(_0x1922('0x8'));var csv=require('to-csv');var ejs=require(_0x1922('0x9'));var fs=require('fs');var fs_extra=require(_0x1922('0xa'));var _=require('lodash');var squel=require(_0x1922('0xb'));var crypto=require(_0x1922('0xc'));var jsforce=require(_0x1922('0xd'));var deskjs=require(_0x1922('0xe'));var toCsv=require('to-csv');var querystring=require(_0x1922('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x1922('0x10'));var qs=require(_0x1922('0x11'));var as=require(_0x1922('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1922('0x13'))(_0x1922('0x14'));var utils=require(_0x1922('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x1922('0x16'))['db'];function respondWithStatusCode(_0x6bd24e,_0x42dc93){_0x42dc93=_0x42dc93||0xcc;return function(_0x523b02){if(_0x523b02){return _0x6bd24e['sendStatus'](_0x42dc93);}return _0x6bd24e['status'](_0x42dc93)['end']();};}function respondWithResult(_0x3f446d,_0x121078){_0x121078=_0x121078||0xc8;return function(_0x148d6d){if(_0x148d6d){return _0x3f446d[_0x1922('0x17')](_0x121078)[_0x1922('0x18')](_0x148d6d);}};}function respondWithFilteredResult(_0x3a9dfc,_0x248809){return function(_0x42f83f){if(_0x42f83f){var _0x4c658a=typeof _0x248809[_0x1922('0x19')]===_0x1922('0x1a')&&typeof _0x248809['limit']===_0x1922('0x1a');var _0x281c36=_0x42f83f['count'];var _0x5c8847=_0x4c658a?0x0:_0x248809[_0x1922('0x19')];var _0x24dd2e=_0x4c658a?_0x42f83f[_0x1922('0x1b')]:_0x248809[_0x1922('0x19')]+_0x248809['limit'];var _0x7f58cc;if(_0x24dd2e>=_0x281c36){_0x24dd2e=_0x281c36;_0x7f58cc=0xc8;}else{_0x7f58cc=0xce;}_0x3a9dfc[_0x1922('0x17')](_0x7f58cc);return _0x3a9dfc[_0x1922('0x1c')](_0x1922('0x1d'),_0x5c8847+'-'+_0x24dd2e+'/'+_0x281c36)[_0x1922('0x18')](_0x42f83f);}return null;};}function patchUpdates(_0x5e9202){return function(_0x2a9dc5){try{jsonpatch[_0x1922('0x1e')](_0x2a9dc5,_0x5e9202,!![]);}catch(_0x592897){return BPromise[_0x1922('0x1f')](_0x592897);}return _0x2a9dc5[_0x1922('0x20')]();};}function saveUpdates(_0xce113d,_0x2558d8){return function(_0x5592db){if(_0x5592db){return _0x5592db[_0x1922('0x21')](_0xce113d)[_0x1922('0x22')](function(_0x564bea){return _0x564bea;});}return null;};}function removeEntity(_0x30125d,_0x4e066d){return function(_0x136520){if(_0x136520){return _0x136520['destroy']()[_0x1922('0x22')](function(){_0x30125d[_0x1922('0x17')](0xcc)[_0x1922('0x23')]();});}};}function handleEntityNotFound(_0x471219,_0x1b2ed5){return function(_0x12f607){if(!_0x12f607){_0x471219[_0x1922('0x24')](0x194);}return _0x12f607;};}function handleError(_0x18fce2,_0x4abe83){_0x4abe83=_0x4abe83||0x1f4;return function(_0x42f20b){logger[_0x1922('0x25')](_0x42f20b['stack']);if(_0x42f20b['name']){delete _0x42f20b[_0x1922('0x26')];}_0x18fce2['status'](_0x4abe83)[_0x1922('0x27')](_0x42f20b);};}exports['index']=function(_0x337120,_0x1bd529){var _0xd88046={},_0xd06118={},_0x60aca6={'count':0x0,'rows':[]};var _0x126cec=_[_0x1922('0x28')](db[_0x1922('0x29')][_0x1922('0x2a')],function(_0x47eaec){return{'name':_0x47eaec[_0x1922('0x2b')],'type':_0x47eaec[_0x1922('0x2c')][_0x1922('0x2d')]};});_0xd06118['model']=_[_0x1922('0x28')](_0x126cec,_0x1922('0x26'));_0xd06118[_0x1922('0x2e')]=_['keys'](_0x337120[_0x1922('0x2e')]);_0xd06118['filters']=_[_0x1922('0x2f')](_0xd06118[_0x1922('0x30')],_0xd06118[_0x1922('0x2e')]);_0xd88046['attributes']=_['intersection'](_0xd06118[_0x1922('0x30')],qs[_0x1922('0x31')](_0x337120[_0x1922('0x2e')][_0x1922('0x31')]));_0xd88046[_0x1922('0x32')]=_0xd88046[_0x1922('0x32')][_0x1922('0x33')]?_0xd88046[_0x1922('0x32')]:_0xd06118[_0x1922('0x30')];if(!_0x337120[_0x1922('0x2e')][_0x1922('0x34')]('nolimit')){_0xd88046[_0x1922('0x35')]=qs[_0x1922('0x35')](_0x337120[_0x1922('0x2e')][_0x1922('0x35')]);_0xd88046[_0x1922('0x19')]=qs[_0x1922('0x19')](_0x337120['query'][_0x1922('0x19')]);}_0xd88046['order']=qs['sort'](_0x337120[_0x1922('0x2e')][_0x1922('0x36')]);_0xd88046['where']=qs[_0x1922('0x37')](_[_0x1922('0x38')](_0x337120[_0x1922('0x2e')],_0xd06118[_0x1922('0x37')]),_0x126cec);if(_0x337120[_0x1922('0x2e')][_0x1922('0x39')]){_0xd88046[_0x1922('0x3a')]=_['merge'](_0xd88046[_0x1922('0x3a')],{'$or':_[_0x1922('0x28')](_0x126cec,function(_0x3894a3){if(_0x3894a3['type']!=='VIRTUAL'){var _0x43d4a1={};_0x43d4a1[_0x3894a3[_0x1922('0x26')]]={'$like':'%'+_0x337120['query']['filter']+'%'};return _0x43d4a1;}})});}_0xd88046=_[_0x1922('0x3b')]({},_0xd88046,_0x337120[_0x1922('0x3c')]);var _0xd22bd={'where':_0xd88046[_0x1922('0x3a')]};return db[_0x1922('0x29')][_0x1922('0x1b')](_0xd22bd)[_0x1922('0x22')](function(_0x54fba5){_0x60aca6[_0x1922('0x1b')]=_0x54fba5;if(_0x337120[_0x1922('0x2e')][_0x1922('0x3d')]){_0xd88046[_0x1922('0x3e')]=[{'all':!![]}];}return db[_0x1922('0x29')][_0x1922('0x3f')](_0xd88046);})[_0x1922('0x22')](function(_0xb7a398){_0x60aca6[_0x1922('0x40')]=_0xb7a398;return _0x60aca6;})[_0x1922('0x22')](respondWithFilteredResult(_0x1bd529,_0xd88046))['catch'](handleError(_0x1bd529,null));};exports[_0x1922('0x41')]=function(_0x361ecb,_0x36ef3b){var _0x5d70ce={'raw':!![],'where':{'id':_0x361ecb[_0x1922('0x42')]['id']}},_0x1ba72d={};_0x1ba72d[_0x1922('0x30')]=_[_0x1922('0x43')](db['SugarcrmField'][_0x1922('0x2a')]);_0x1ba72d[_0x1922('0x2e')]=_[_0x1922('0x43')](_0x361ecb['query']);_0x1ba72d[_0x1922('0x37')]=_[_0x1922('0x2f')](_0x1ba72d['model'],_0x1ba72d[_0x1922('0x2e')]);_0x5d70ce[_0x1922('0x32')]=_[_0x1922('0x2f')](_0x1ba72d[_0x1922('0x30')],qs['fields'](_0x361ecb[_0x1922('0x2e')]['fields']));_0x5d70ce['attributes']=_0x5d70ce[_0x1922('0x32')][_0x1922('0x33')]?_0x5d70ce['attributes']:_0x1ba72d[_0x1922('0x30')];if(_0x361ecb['query'][_0x1922('0x3d')]){_0x5d70ce[_0x1922('0x3e')]=[{'all':!![]}];}_0x5d70ce=_[_0x1922('0x3b')]({},_0x5d70ce,_0x361ecb[_0x1922('0x3c')]);return db[_0x1922('0x29')]['find'](_0x5d70ce)['then'](handleEntityNotFound(_0x36ef3b,null))['then'](respondWithResult(_0x36ef3b,null))[_0x1922('0x44')](handleError(_0x36ef3b,null));};exports[_0x1922('0x45')]=function(_0x3af956,_0xe44431){return db[_0x1922('0x29')][_0x1922('0x45')](_0x3af956[_0x1922('0x46')],{})[_0x1922('0x22')](respondWithResult(_0xe44431,0xc9))[_0x1922('0x44')](handleError(_0xe44431,null));};exports[_0x1922('0x21')]=function(_0x381aa8,_0x2047cd){if(_0x381aa8[_0x1922('0x46')]['id']){delete _0x381aa8[_0x1922('0x46')]['id'];}return db[_0x1922('0x29')][_0x1922('0x47')]({'where':{'id':_0x381aa8['params']['id']}})[_0x1922('0x22')](handleEntityNotFound(_0x2047cd,null))['then'](saveUpdates(_0x381aa8[_0x1922('0x46')],null))[_0x1922('0x22')](respondWithResult(_0x2047cd,null))[_0x1922('0x44')](handleError(_0x2047cd,null));};exports[_0x1922('0x48')]=function(_0x1997e1,_0x265d7e){return db[_0x1922('0x29')][_0x1922('0x47')]({'where':{'id':_0x1997e1[_0x1922('0x42')]['id']}})[_0x1922('0x22')](handleEntityNotFound(_0x265d7e,null))[_0x1922('0x22')](removeEntity(_0x265d7e,null))[_0x1922('0x44')](handleError(_0x265d7e,null));};
\ No newline at end of file
+var _0x120a=['show','rawAttributes','find','catch','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','SugarcrmField','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include'];(function(_0x3799a1,_0x202382){var _0x534d7e=function(_0x18620e){while(--_0x18620e){_0x3799a1['push'](_0x3799a1['shift']());}};_0x534d7e(++_0x202382);}(_0x120a,0x99));var _0xa120=function(_0x121b1a,_0x42fdb7){_0x121b1a=_0x121b1a-0x0;var _0x2d89a6=_0x120a[_0x121b1a];return _0x2d89a6;};'use strict';var emlformat=require(_0xa120('0x0'));var rimraf=require(_0xa120('0x1'));var zipdir=require(_0xa120('0x2'));var jsonpatch=require(_0xa120('0x3'));var rp=require(_0xa120('0x4'));var moment=require(_0xa120('0x5'));var BPromise=require(_0xa120('0x6'));var Mustache=require(_0xa120('0x7'));var util=require('util');var path=require(_0xa120('0x8'));var sox=require(_0xa120('0x9'));var csv=require(_0xa120('0xa'));var ejs=require(_0xa120('0xb'));var fs=require('fs');var fs_extra=require(_0xa120('0xc'));var _=require(_0xa120('0xd'));var squel=require(_0xa120('0xe'));var crypto=require(_0xa120('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xa120('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xa120('0x10'));var hardwareService=require(_0xa120('0x11'));var logger=require(_0xa120('0x12'))(_0xa120('0x13'));var utils=require(_0xa120('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xa120('0x15'));var db=require(_0xa120('0x16'))['db'];function respondWithStatusCode(_0x144164,_0x399858){_0x399858=_0x399858||0xcc;return function(_0x4c1720){if(_0x4c1720){return _0x144164[_0xa120('0x17')](_0x399858);}return _0x144164['status'](_0x399858)[_0xa120('0x18')]();};}function respondWithResult(_0x435eab,_0x39ce62){_0x39ce62=_0x39ce62||0xc8;return function(_0x56cad4){if(_0x56cad4){return _0x435eab['status'](_0x39ce62)[_0xa120('0x19')](_0x56cad4);}};}function respondWithFilteredResult(_0x5d3865,_0x468d5b){return function(_0x560a28){if(_0x560a28){var _0x47c71f=typeof _0x468d5b[_0xa120('0x1a')]===_0xa120('0x1b')&&typeof _0x468d5b[_0xa120('0x1c')]===_0xa120('0x1b');var _0x422b9c=_0x560a28[_0xa120('0x1d')];var _0xbd6b51=_0x47c71f?0x0:_0x468d5b[_0xa120('0x1a')];var _0x235047=_0x47c71f?_0x560a28['count']:_0x468d5b[_0xa120('0x1a')]+_0x468d5b['limit'];var _0x3a1217;if(_0x235047>=_0x422b9c){_0x235047=_0x422b9c;_0x3a1217=0xc8;}else{_0x3a1217=0xce;}_0x5d3865[_0xa120('0x1e')](_0x3a1217);return _0x5d3865['set'](_0xa120('0x1f'),_0xbd6b51+'-'+_0x235047+'/'+_0x422b9c)[_0xa120('0x19')](_0x560a28);}return null;};}function patchUpdates(_0x244cca){return function(_0xb1f8bc){try{jsonpatch[_0xa120('0x20')](_0xb1f8bc,_0x244cca,!![]);}catch(_0x4c3af8){return BPromise[_0xa120('0x21')](_0x4c3af8);}return _0xb1f8bc[_0xa120('0x22')]();};}function saveUpdates(_0x3e950a,_0x4bf053){return function(_0x3e5a35){if(_0x3e5a35){return _0x3e5a35[_0xa120('0x23')](_0x3e950a)[_0xa120('0x24')](function(_0x2a2295){return _0x2a2295;});}return null;};}function removeEntity(_0x1c3f0b,_0x2a70ef){return function(_0x2c395e){if(_0x2c395e){return _0x2c395e[_0xa120('0x25')]()['then'](function(){_0x1c3f0b[_0xa120('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x46bc01,_0x48f871){return function(_0x132415){if(!_0x132415){_0x46bc01['sendStatus'](0x194);}return _0x132415;};}function handleError(_0xd87cc4,_0x31ee8b){_0x31ee8b=_0x31ee8b||0x1f4;return function(_0xf479e9){logger[_0xa120('0x26')](_0xf479e9[_0xa120('0x27')]);if(_0xf479e9[_0xa120('0x28')]){delete _0xf479e9[_0xa120('0x28')];}_0xd87cc4[_0xa120('0x1e')](_0x31ee8b)[_0xa120('0x29')](_0xf479e9);};}exports[_0xa120('0x2a')]=function(_0x35ff3b,_0x2ff902){var _0x483605={},_0x267d23={},_0x3bead3={'count':0x0,'rows':[]};var _0x201523=_[_0xa120('0x2b')](db[_0xa120('0x2c')]['rawAttributes'],function(_0x183111){return{'name':_0x183111[_0xa120('0x2d')],'type':_0x183111[_0xa120('0x2e')][_0xa120('0x2f')]};});_0x267d23[_0xa120('0x30')]=_['map'](_0x201523,_0xa120('0x28'));_0x267d23[_0xa120('0x31')]=_[_0xa120('0x32')](_0x35ff3b['query']);_0x267d23[_0xa120('0x33')]=_[_0xa120('0x34')](_0x267d23['model'],_0x267d23[_0xa120('0x31')]);_0x483605[_0xa120('0x35')]=_[_0xa120('0x34')](_0x267d23['model'],qs[_0xa120('0x36')](_0x35ff3b[_0xa120('0x31')][_0xa120('0x36')]));_0x483605[_0xa120('0x35')]=_0x483605[_0xa120('0x35')][_0xa120('0x37')]?_0x483605[_0xa120('0x35')]:_0x267d23[_0xa120('0x30')];if(!_0x35ff3b[_0xa120('0x31')]['hasOwnProperty']('nolimit')){_0x483605[_0xa120('0x1c')]=qs[_0xa120('0x1c')](_0x35ff3b[_0xa120('0x31')][_0xa120('0x1c')]);_0x483605[_0xa120('0x1a')]=qs[_0xa120('0x1a')](_0x35ff3b[_0xa120('0x31')][_0xa120('0x1a')]);}_0x483605[_0xa120('0x38')]=qs[_0xa120('0x39')](_0x35ff3b[_0xa120('0x31')]['sort']);_0x483605[_0xa120('0x3a')]=qs[_0xa120('0x33')](_[_0xa120('0x3b')](_0x35ff3b['query'],_0x267d23[_0xa120('0x33')]),_0x201523);if(_0x35ff3b['query']['filter']){_0x483605[_0xa120('0x3a')]=_[_0xa120('0x3c')](_0x483605['where'],{'$or':_[_0xa120('0x2b')](_0x201523,function(_0xd3e0c8){if(_0xd3e0c8['type']!==_0xa120('0x3d')){var _0x14441a={};_0x14441a[_0xd3e0c8[_0xa120('0x28')]]={'$like':'%'+_0x35ff3b[_0xa120('0x31')][_0xa120('0x3e')]+'%'};return _0x14441a;}})});}_0x483605=_[_0xa120('0x3c')]({},_0x483605,_0x35ff3b[_0xa120('0x3f')]);var _0x52806a={'where':_0x483605[_0xa120('0x3a')]};return db[_0xa120('0x2c')]['count'](_0x52806a)[_0xa120('0x24')](function(_0x1b6d9b){_0x3bead3['count']=_0x1b6d9b;if(_0x35ff3b[_0xa120('0x31')][_0xa120('0x40')]){_0x483605[_0xa120('0x41')]=[{'all':!![]}];}return db['SugarcrmField']['findAll'](_0x483605);})[_0xa120('0x24')](function(_0x532521){_0x3bead3['rows']=_0x532521;return _0x3bead3;})['then'](respondWithFilteredResult(_0x2ff902,_0x483605))['catch'](handleError(_0x2ff902,null));};exports[_0xa120('0x42')]=function(_0x25ae91,_0x13d2a8){var _0x43cec0={'raw':!![],'where':{'id':_0x25ae91['params']['id']}},_0x214b0a={};_0x214b0a['model']=_[_0xa120('0x32')](db[_0xa120('0x2c')][_0xa120('0x43')]);_0x214b0a[_0xa120('0x31')]=_[_0xa120('0x32')](_0x25ae91[_0xa120('0x31')]);_0x214b0a['filters']=_['intersection'](_0x214b0a[_0xa120('0x30')],_0x214b0a[_0xa120('0x31')]);_0x43cec0[_0xa120('0x35')]=_['intersection'](_0x214b0a['model'],qs[_0xa120('0x36')](_0x25ae91['query']['fields']));_0x43cec0[_0xa120('0x35')]=_0x43cec0['attributes'][_0xa120('0x37')]?_0x43cec0[_0xa120('0x35')]:_0x214b0a['model'];if(_0x25ae91[_0xa120('0x31')]['includeAll']){_0x43cec0[_0xa120('0x41')]=[{'all':!![]}];}_0x43cec0=_[_0xa120('0x3c')]({},_0x43cec0,_0x25ae91[_0xa120('0x3f')]);return db[_0xa120('0x2c')][_0xa120('0x44')](_0x43cec0)[_0xa120('0x24')](handleEntityNotFound(_0x13d2a8,null))[_0xa120('0x24')](respondWithResult(_0x13d2a8,null))[_0xa120('0x45')](handleError(_0x13d2a8,null));};exports[_0xa120('0x46')]=function(_0x10bae3,_0x1042a6){return db[_0xa120('0x2c')][_0xa120('0x46')](_0x10bae3[_0xa120('0x47')],{})['then'](respondWithResult(_0x1042a6,0xc9))[_0xa120('0x45')](handleError(_0x1042a6,null));};exports[_0xa120('0x23')]=function(_0x421f20,_0x579708){if(_0x421f20[_0xa120('0x47')]['id']){delete _0x421f20[_0xa120('0x47')]['id'];}return db[_0xa120('0x2c')]['find']({'where':{'id':_0x421f20[_0xa120('0x48')]['id']}})['then'](handleEntityNotFound(_0x579708,null))['then'](saveUpdates(_0x421f20[_0xa120('0x47')],null))[_0xa120('0x24')](respondWithResult(_0x579708,null))[_0xa120('0x45')](handleError(_0x579708,null));};exports[_0xa120('0x25')]=function(_0x1074e3,_0x8bd8d2){return db[_0xa120('0x2c')][_0xa120('0x44')]({'where':{'id':_0x1074e3[_0xa120('0x48')]['id']}})[_0xa120('0x24')](handleEntityNotFound(_0x8bd8d2,null))['then'](removeEntity(_0x8bd8d2,null))[_0xa120('0x45')](handleError(_0x8bd8d2,null));};
\ No newline at end of file
index a923dae..f901c6c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xabd0=['path','rimraf','./intSugarcrmField.attributes','exports','define','SugarcrmField','sugarcrm_unique_index','idField','FieldId','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x49175c,_0x3154a9){var _0x568a7e=function(_0x40e34e){while(--_0x40e34e){_0x49175c['push'](_0x49175c['shift']());}};_0x568a7e(++_0x3154a9);}(_0xabd0,0xbd));var _0x0abd=function(_0x4450fa,_0x8b690a){_0x4450fa=_0x4450fa-0x0;var _0x43642d=_0xabd0[_0x4450fa];return _0x43642d;};'use strict';var _=require(_0x0abd('0x0'));var util=require('util');var logger=require(_0x0abd('0x1'))(_0x0abd('0x2'));var moment=require(_0x0abd('0x3'));var BPromise=require(_0x0abd('0x4'));var rp=require(_0x0abd('0x5'));var fs=require('fs');var path=require(_0x0abd('0x6'));var rimraf=require(_0x0abd('0x7'));var config=require('../../config/environment');var attributes=require(_0x0abd('0x8'));module[_0x0abd('0x9')]=function(_0x20fff0,_0x17ba4a){return _0x20fff0[_0x0abd('0xa')](_0x0abd('0xb'),attributes,{'tableName':'int_sugarcrm_fields','paranoid':![],'indexes':[{'name':_0x0abd('0xc'),'fields':[_0x0abd('0xd'),_0x0abd('0xe')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x31a4=['../../config/environment','./intSugarcrmField.attributes','exports','define','SugarcrmField','sugarcrm_unique_index','idField','FieldId','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x5374eb,_0x4e5e18){var _0x406a25=function(_0x3dfa42){while(--_0x3dfa42){_0x5374eb['push'](_0x5374eb['shift']());}};_0x406a25(++_0x4e5e18);}(_0x31a4,0x19d));var _0x431a=function(_0x235955,_0x2c8565){_0x235955=_0x235955-0x0;var _0x58c0f9=_0x31a4[_0x235955];return _0x58c0f9;};'use strict';var _=require('lodash');var util=require(_0x431a('0x0'));var logger=require(_0x431a('0x1'))(_0x431a('0x2'));var moment=require(_0x431a('0x3'));var BPromise=require('bluebird');var rp=require(_0x431a('0x4'));var fs=require('fs');var path=require(_0x431a('0x5'));var rimraf=require(_0x431a('0x6'));var config=require(_0x431a('0x7'));var attributes=require(_0x431a('0x8'));module[_0x431a('0x9')]=function(_0x2b411c,_0x489c7a){return _0x2b411c[_0x431a('0xa')](_0x431a('0xb'),attributes,{'tableName':'int_sugarcrm_fields','paranoid':![],'indexes':[{'name':_0x431a('0xc'),'fields':[_0x431a('0xd'),_0x431a('0xe')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 5114062..8d749ae 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd8d7=['stringify','error','code','message','info','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','SugarcrmField,\x20%s,\x20%s','SugarcrmField,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x100124,_0x47052b){var _0x5dc705=function(_0x3aebfb){while(--_0x3aebfb){_0x100124['push'](_0x100124['shift']());}};_0x5dc705(++_0x47052b);}(_0xd8d7,0x97));var _0x7d8d=function(_0x29d623,_0x1a5c9c){_0x29d623=_0x29d623-0x0;var _0x242e59=_0xd8d7[_0x29d623];return _0x242e59;};'use strict';var _=require(_0x7d8d('0x0'));var util=require(_0x7d8d('0x1'));var moment=require(_0x7d8d('0x2'));var BPromise=require('bluebird');var rs=require(_0x7d8d('0x3'));var fs=require('fs');var Redis=require(_0x7d8d('0x4'));var db=require(_0x7d8d('0x5'))['db'];var utils=require(_0x7d8d('0x6'));var logger=require(_0x7d8d('0x7'))(_0x7d8d('0x8'));var config=require(_0x7d8d('0x9'));var jayson=require(_0x7d8d('0xa'));var client=jayson['client'][_0x7d8d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x55fef7,_0x29c2d4,_0x518c9b){return new BPromise(function(_0x4370bc,_0x5db8ef){return client[_0x7d8d('0xc')](_0x55fef7,_0x518c9b)[_0x7d8d('0xd')](function(_0x4cb963){logger['info'](_0x7d8d('0xe'),_0x29c2d4,'request\x20sent');logger['debug'](_0x7d8d('0xf'),_0x29c2d4,_0x7d8d('0x10'),JSON[_0x7d8d('0x11')](_0x4cb963));if(_0x4cb963[_0x7d8d('0x12')]){if(_0x4cb963[_0x7d8d('0x12')][_0x7d8d('0x13')]===0x1f4){logger[_0x7d8d('0x12')](_0x7d8d('0xe'),_0x29c2d4,_0x4cb963[_0x7d8d('0x12')]['message']);return _0x5db8ef(_0x4cb963[_0x7d8d('0x12')][_0x7d8d('0x14')]);}logger['error'](_0x7d8d('0xe'),_0x29c2d4,_0x4cb963[_0x7d8d('0x12')][_0x7d8d('0x14')]);return _0x4370bc(_0x4cb963[_0x7d8d('0x12')][_0x7d8d('0x14')]);}else{logger[_0x7d8d('0x15')]('SugarcrmField,\x20%s,\x20%s',_0x29c2d4,_0x7d8d('0x10'));_0x4370bc(_0x4cb963[_0x7d8d('0x16')][_0x7d8d('0x14')]);}})[_0x7d8d('0x17')](function(_0x598a6b){logger['error'](_0x7d8d('0xe'),_0x29c2d4,_0x598a6b);_0x5db8ef(_0x598a6b);});});}
\ No newline at end of file
+var _0xa02f=['jayson/promise','client','request','then','SugarcrmField,\x20%s,\x20%s','SugarcrmField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x3a801c,_0x384c52){var _0x37f999=function(_0x412595){while(--_0x412595){_0x3a801c['push'](_0x3a801c['shift']());}};_0x37f999(++_0x384c52);}(_0xa02f,0xbe));var _0xfa02=function(_0x21837e,_0x137b5d){_0x21837e=_0x21837e-0x0;var _0x3d0b4d=_0xa02f[_0x21837e];return _0x3d0b4d;};'use strict';var _=require(_0xfa02('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xfa02('0x1'));var rs=require(_0xfa02('0x2'));var fs=require('fs');var Redis=require(_0xfa02('0x3'));var db=require(_0xfa02('0x4'))['db'];var utils=require(_0xfa02('0x5'));var logger=require(_0xfa02('0x6'))('rpc');var config=require(_0xfa02('0x7'));var jayson=require(_0xfa02('0x8'));var client=jayson[_0xfa02('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x35a56d,_0x20d13b,_0x4e6338){return new BPromise(function(_0x467b62,_0x3c62cf){return client[_0xfa02('0xa')](_0x35a56d,_0x4e6338)[_0xfa02('0xb')](function(_0x5399ea){logger['info'](_0xfa02('0xc'),_0x20d13b,'request\x20sent');logger['debug'](_0xfa02('0xd'),_0x20d13b,_0xfa02('0xe'),JSON[_0xfa02('0xf')](_0x5399ea));if(_0x5399ea[_0xfa02('0x10')]){if(_0x5399ea['error'][_0xfa02('0x11')]===0x1f4){logger[_0xfa02('0x10')]('SugarcrmField,\x20%s,\x20%s',_0x20d13b,_0x5399ea[_0xfa02('0x10')]['message']);return _0x3c62cf(_0x5399ea[_0xfa02('0x10')][_0xfa02('0x12')]);}logger['error']('SugarcrmField,\x20%s,\x20%s',_0x20d13b,_0x5399ea[_0xfa02('0x10')][_0xfa02('0x12')]);return _0x467b62(_0x5399ea[_0xfa02('0x10')][_0xfa02('0x12')]);}else{logger[_0xfa02('0x13')]('SugarcrmField,\x20%s,\x20%s',_0x20d13b,'request\x20sent');_0x467b62(_0x5399ea[_0xfa02('0x14')]['message']);}})[_0xfa02('0x15')](function(_0xaa3669){logger['error'](_0xfa02('0xc'),_0x20d13b,_0xaa3669);_0x3c62cf(_0xaa3669);});});}
\ No newline at end of file
index d9e3826..4118468 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xefe5=['update','delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/interaction/service','./intVtigerAccount.controller','get','isAuthenticated','index','show','/:id/configurations','getConfigurations','/:id/fields','post','create','put','/:id'];(function(_0x4c1f48,_0xa9a87a){var _0x39e7a6=function(_0x31a892){while(--_0x31a892){_0x4c1f48['push'](_0x4c1f48['shift']());}};_0x39e7a6(++_0xa9a87a);}(_0xefe5,0xf6));var _0x5efe=function(_0x2a80b4,_0x4d29a2){_0x2a80b4=_0x2a80b4-0x0;var _0x235877=_0xefe5[_0x2a80b4];return _0x235877;};'use strict';var multer=require(_0x5efe('0x0'));var util=require('util');var path=require(_0x5efe('0x1'));var timeout=require(_0x5efe('0x2'));var express=require('express');var router=express[_0x5efe('0x3')]();var fs_extra=require(_0x5efe('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x5efe('0x5'));var config=require('../../config/environment');var controller=require(_0x5efe('0x6'));router[_0x5efe('0x7')]('/',auth[_0x5efe('0x8')](),controller[_0x5efe('0x9')]);router[_0x5efe('0x7')]('/:id',auth[_0x5efe('0x8')](),controller[_0x5efe('0xa')]);router[_0x5efe('0x7')](_0x5efe('0xb'),auth[_0x5efe('0x8')](),controller[_0x5efe('0xc')]);router[_0x5efe('0x7')](_0x5efe('0xd'),auth[_0x5efe('0x8')](),controller['getFields']);router[_0x5efe('0xe')]('/',auth[_0x5efe('0x8')](),controller[_0x5efe('0xf')]);router[_0x5efe('0xe')]('/:id/configurations',auth['isAuthenticated'](),controller['addConfiguration']);router[_0x5efe('0x10')](_0x5efe('0x11'),auth[_0x5efe('0x8')](),controller[_0x5efe('0x12')]);router[_0x5efe('0x13')](_0x5efe('0x11'),auth[_0x5efe('0x8')](),controller[_0x5efe('0x14')]);module[_0x5efe('0x15')]=router;
\ No newline at end of file
+var _0xb43b=['../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','index','/:id','isAuthenticated','show','get','/:id/configurations','getConfigurations','getFields','post','create','addConfiguration','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service'];(function(_0x2b9e6b,_0x3c2eb1){var _0x1982b7=function(_0x27f978){while(--_0x27f978){_0x2b9e6b['push'](_0x2b9e6b['shift']());}};_0x1982b7(++_0x3c2eb1);}(_0xb43b,0x1b2));var _0xbb43=function(_0x101df6,_0x5b488e){_0x101df6=_0x101df6-0x0;var _0x507b57=_0xb43b[_0x101df6];return _0x507b57;};'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/fields',auth[_0xbb43('0xb')](),controller[_0xbb43('0x10')]);router[_0xbb43('0x11')]('/',auth[_0xbb43('0xb')](),controller[_0xbb43('0x12')]);router[_0xbb43('0x11')]('/:id/configurations',auth[_0xbb43('0xb')](),controller[_0xbb43('0x13')]);router['put']('/:id',auth[_0xbb43('0xb')](),controller['update']);router['delete'](_0xbb43('0xa'),auth['isAuthenticated'](),controller[_0xbb43('0x14')]);module[_0xbb43('0x15')]=router;
\ No newline at end of file
index 4735fef..654c339 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x550e=['STRING','HelpDesk'];(function(_0x34c50d,_0x1cf0e0){var _0x39249b=function(_0x4cce15){while(--_0x4cce15){_0x34c50d['push'](_0x34c50d['shift']());}};_0x39249b(++_0x1cf0e0);}(_0x550e,0x174));var _0xe550=function(_0x10306a,_0x4136aa){_0x10306a=_0x10306a-0x0;var _0x4452a5=_0x550e[_0x10306a];return _0x4452a5;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xe550('0x0')],'allowNull':![]},'description':{'type':Sequelize[_0xe550('0x0')]},'username':{'type':Sequelize['STRING'],'allowNull':![]},'moduleName':{'type':Sequelize[_0xe550('0x0')],'allowNull':![],'defaultValue':_0xe550('0x1')},'remoteUri':{'type':Sequelize[_0xe550('0x0')],'allowNull':![]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'accessKey':{'type':Sequelize[_0xe550('0x0')],'allowNull':![]}};
\ No newline at end of file
+var _0x0d5d=['exports','STRING','HelpDesk'];(function(_0x36ccbf,_0x45a895){var _0x495ea0=function(_0x4d37b2){while(--_0x4d37b2){_0x36ccbf['push'](_0x36ccbf['shift']());}};_0x495ea0(++_0x45a895);}(_0x0d5d,0x7e));var _0xd0d5=function(_0xc1bfb9,_0x4538c6){_0xc1bfb9=_0xc1bfb9-0x0;var _0x2296a7=_0x0d5d[_0xc1bfb9];return _0x2296a7;};'use strict';var Sequelize=require('sequelize');module[_0xd0d5('0x0')]={'name':{'type':Sequelize[_0xd0d5('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xd0d5('0x1')]},'username':{'type':Sequelize[_0xd0d5('0x1')],'allowNull':![]},'moduleName':{'type':Sequelize[_0xd0d5('0x1')],'allowNull':![],'defaultValue':_0xd0d5('0x2')},'remoteUri':{'type':Sequelize[_0xd0d5('0x1')],'allowNull':![]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'accessKey':{'type':Sequelize['STRING'],'allowNull':![]}};
\ No newline at end of file
index f64d976..bda6cbe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb586=['map','VtigerAccount','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','find','create','body','update','params','getConfigurations','findOne','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','channel','type','getDescriptions','VtigerConfiguration','VtigerField','md5','getFields','moduleName','serverUrl','accessKey','remoteUri','slice','lastIndexOf','format','%s/webservice.php','GET','getchallenge','username','POST','result','success','describe','autogenerated','owner','remove','includes','startsWith','picklist','picklistValues','label','log','vTiger\x20error:\x20','test','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','sendStatus','end','status','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','index'];(function(_0x580647,_0x43d2c3){var _0x5f0792=function(_0x386cef){while(--_0x386cef){_0x580647['push'](_0x580647['shift']());}};_0x5f0792(++_0x43d2c3);}(_0xb586,0x19e));var _0x6b58=function(_0x4f3f71,_0x1e35ce){_0x4f3f71=_0x4f3f71-0x0;var _0x559c25=_0xb586[_0x4f3f71];return _0x559c25;};'use strict';var emlformat=require(_0x6b58('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x6b58('0x1'));var moment=require(_0x6b58('0x2'));var BPromise=require(_0x6b58('0x3'));var Mustache=require('mustache');var util=require(_0x6b58('0x4'));var path=require(_0x6b58('0x5'));var sox=require(_0x6b58('0x6'));var csv=require('to-csv');var ejs=require(_0x6b58('0x7'));var fs=require('fs');var fs_extra=require(_0x6b58('0x8'));var _=require(_0x6b58('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x6b58('0xa'));var toCsv=require('to-csv');var querystring=require(_0x6b58('0xb'));var Papa=require('papaparse');var Redis=require(_0x6b58('0xc'));var authService=require(_0x6b58('0xd'));var qs=require(_0x6b58('0xe'));var as=require(_0x6b58('0xf'));var hardwareService=require(_0x6b58('0x10'));var logger=require('../../config/logger')(_0x6b58('0x11'));var utils=require('../../config/utils');var config=require(_0x6b58('0x12'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x4afd89,_0x4ca8ee){_0x4ca8ee=_0x4ca8ee||0xcc;return function(_0x1e81d2){if(_0x1e81d2){return _0x4afd89[_0x6b58('0x13')](_0x4ca8ee);}return _0x4afd89['status'](_0x4ca8ee)[_0x6b58('0x14')]();};}function respondWithResult(_0x31a825,_0x5aee0f){_0x5aee0f=_0x5aee0f||0xc8;return function(_0x130ab7){if(_0x130ab7){return _0x31a825[_0x6b58('0x15')](_0x5aee0f)[_0x6b58('0x16')](_0x130ab7);}};}function respondWithFilteredResult(_0x2da398,_0x103850){return function(_0x5815c6){if(_0x5815c6){var _0x7273bb=typeof _0x103850['offset']==='undefined'&&typeof _0x103850['limit']===_0x6b58('0x17');var _0x4434a4=_0x5815c6[_0x6b58('0x18')];var _0x58a625=_0x7273bb?0x0:_0x103850['offset'];var _0x431089=_0x7273bb?_0x5815c6[_0x6b58('0x18')]:_0x103850[_0x6b58('0x19')]+_0x103850[_0x6b58('0x1a')];var _0x46806d;if(_0x431089>=_0x4434a4){_0x431089=_0x4434a4;_0x46806d=0xc8;}else{_0x46806d=0xce;}_0x2da398['status'](_0x46806d);return _0x2da398[_0x6b58('0x1b')](_0x6b58('0x1c'),_0x58a625+'-'+_0x431089+'/'+_0x4434a4)['json'](_0x5815c6);}return null;};}function patchUpdates(_0x3803a3){return function(_0x191353){try{jsonpatch[_0x6b58('0x1d')](_0x191353,_0x3803a3,!![]);}catch(_0x2421d2){return BPromise[_0x6b58('0x1e')](_0x2421d2);}return _0x191353[_0x6b58('0x1f')]();};}function saveUpdates(_0x242266,_0x2f1c7c){return function(_0x273078){if(_0x273078){return _0x273078['update'](_0x242266)[_0x6b58('0x20')](function(_0x4fe2e9){return _0x4fe2e9;});}return null;};}function removeEntity(_0x51e5d2,_0x3e0ec8){return function(_0x7b7344){if(_0x7b7344){return _0x7b7344[_0x6b58('0x21')]()[_0x6b58('0x20')](function(){_0x51e5d2[_0x6b58('0x15')](0xcc)[_0x6b58('0x14')]();});}};}function handleEntityNotFound(_0x1e567f,_0x26b065){return function(_0x26d8fe){if(!_0x26d8fe){_0x1e567f[_0x6b58('0x13')](0x194);}return _0x26d8fe;};}function handleError(_0x647ff7,_0x299f66){_0x299f66=_0x299f66||0x1f4;return function(_0x5bf132){logger[_0x6b58('0x22')](_0x5bf132[_0x6b58('0x23')]);if(_0x5bf132[_0x6b58('0x24')]){delete _0x5bf132[_0x6b58('0x24')];}_0x647ff7[_0x6b58('0x15')](_0x299f66)['send'](_0x5bf132);};}exports[_0x6b58('0x25')]=function(_0x1ce791,_0x35b3f4){var _0x24a756={},_0x37a4f9={},_0x675960={'count':0x0,'rows':[]};var _0x10cdb7=_[_0x6b58('0x26')](db[_0x6b58('0x27')][_0x6b58('0x28')],function(_0x31521c){return{'name':_0x31521c[_0x6b58('0x29')],'type':_0x31521c['type'][_0x6b58('0x2a')]};});_0x37a4f9[_0x6b58('0x2b')]=_[_0x6b58('0x26')](_0x10cdb7,_0x6b58('0x24'));_0x37a4f9[_0x6b58('0x2c')]=_[_0x6b58('0x2d')](_0x1ce791[_0x6b58('0x2c')]);_0x37a4f9[_0x6b58('0x2e')]=_[_0x6b58('0x2f')](_0x37a4f9[_0x6b58('0x2b')],_0x37a4f9[_0x6b58('0x2c')]);_0x24a756['attributes']=_[_0x6b58('0x2f')](_0x37a4f9[_0x6b58('0x2b')],qs['fields'](_0x1ce791[_0x6b58('0x2c')][_0x6b58('0x30')]));_0x24a756[_0x6b58('0x31')]=_0x24a756[_0x6b58('0x31')][_0x6b58('0x32')]?_0x24a756[_0x6b58('0x31')]:_0x37a4f9[_0x6b58('0x2b')];if(!_0x1ce791[_0x6b58('0x2c')]['hasOwnProperty'](_0x6b58('0x33'))){_0x24a756[_0x6b58('0x1a')]=qs[_0x6b58('0x1a')](_0x1ce791['query'][_0x6b58('0x1a')]);_0x24a756[_0x6b58('0x19')]=qs[_0x6b58('0x19')](_0x1ce791[_0x6b58('0x2c')][_0x6b58('0x19')]);}_0x24a756[_0x6b58('0x34')]=qs[_0x6b58('0x35')](_0x1ce791['query'][_0x6b58('0x35')]);_0x24a756[_0x6b58('0x36')]=qs[_0x6b58('0x2e')](_[_0x6b58('0x37')](_0x1ce791[_0x6b58('0x2c')],_0x37a4f9['filters']),_0x10cdb7);if(_0x1ce791['query'][_0x6b58('0x38')]){_0x24a756[_0x6b58('0x36')]=_[_0x6b58('0x39')](_0x24a756[_0x6b58('0x36')],{'$or':_[_0x6b58('0x26')](_0x10cdb7,function(_0x1ca1c1){if(_0x1ca1c1['type']!==_0x6b58('0x3a')){var _0x4134ba={};_0x4134ba[_0x1ca1c1[_0x6b58('0x24')]]={'$like':'%'+_0x1ce791[_0x6b58('0x2c')][_0x6b58('0x38')]+'%'};return _0x4134ba;}})});}_0x24a756=_['merge']({},_0x24a756,_0x1ce791[_0x6b58('0x3b')]);var _0x1971e6={'where':_0x24a756[_0x6b58('0x36')]};return db['VtigerAccount'][_0x6b58('0x18')](_0x1971e6)['then'](function(_0x4651f6){_0x675960[_0x6b58('0x18')]=_0x4651f6;if(_0x1ce791[_0x6b58('0x2c')][_0x6b58('0x3c')]){_0x24a756[_0x6b58('0x3d')]=[{'all':!![]}];}return db[_0x6b58('0x27')][_0x6b58('0x3e')](_0x24a756);})[_0x6b58('0x20')](function(_0x282210){_0x675960['rows']=_0x282210;return _0x675960;})['then'](respondWithFilteredResult(_0x35b3f4,_0x24a756))[_0x6b58('0x3f')](handleError(_0x35b3f4,null));};exports[_0x6b58('0x40')]=function(_0xba4905,_0x56dd55){var _0x4b1c2e={'raw':![],'where':{'id':_0xba4905['params']['id']}},_0x456fd2={};_0x456fd2['model']=_['keys'](db[_0x6b58('0x27')][_0x6b58('0x28')]);_0x456fd2[_0x6b58('0x2c')]=_['keys'](_0xba4905[_0x6b58('0x2c')]);_0x456fd2[_0x6b58('0x2e')]=_[_0x6b58('0x2f')](_0x456fd2[_0x6b58('0x2b')],_0x456fd2[_0x6b58('0x2c')]);_0x4b1c2e[_0x6b58('0x31')]=_[_0x6b58('0x2f')](_0x456fd2['model'],qs[_0x6b58('0x30')](_0xba4905[_0x6b58('0x2c')][_0x6b58('0x30')]));_0x4b1c2e[_0x6b58('0x31')]=_0x4b1c2e[_0x6b58('0x31')][_0x6b58('0x32')]?_0x4b1c2e[_0x6b58('0x31')]:_0x456fd2[_0x6b58('0x2b')];if(_0xba4905[_0x6b58('0x2c')][_0x6b58('0x3c')]){_0x4b1c2e[_0x6b58('0x3d')]=[{'all':!![]}];}_0x4b1c2e=_[_0x6b58('0x39')]({},_0x4b1c2e,_0xba4905[_0x6b58('0x3b')]);return db[_0x6b58('0x27')][_0x6b58('0x41')](_0x4b1c2e)[_0x6b58('0x20')](handleEntityNotFound(_0x56dd55,null))[_0x6b58('0x20')](respondWithResult(_0x56dd55,null))[_0x6b58('0x3f')](handleError(_0x56dd55,null));};exports[_0x6b58('0x42')]=function(_0xca5eaa,_0x284d5e){return db[_0x6b58('0x27')][_0x6b58('0x42')](_0xca5eaa[_0x6b58('0x43')],{})['then'](respondWithResult(_0x284d5e,0xc9))[_0x6b58('0x3f')](handleError(_0x284d5e,null));};exports[_0x6b58('0x44')]=function(_0x17c942,_0x20276d){if(_0x17c942['body']['id']){delete _0x17c942[_0x6b58('0x43')]['id'];}return db[_0x6b58('0x27')]['find']({'where':{'id':_0x17c942[_0x6b58('0x45')]['id']}})[_0x6b58('0x20')](handleEntityNotFound(_0x20276d,null))[_0x6b58('0x20')](saveUpdates(_0x17c942[_0x6b58('0x43')],null))[_0x6b58('0x20')](respondWithResult(_0x20276d,null))[_0x6b58('0x3f')](handleError(_0x20276d,null));};exports['destroy']=function(_0x229e95,_0x1274c0){return db[_0x6b58('0x27')][_0x6b58('0x41')]({'where':{'id':_0x229e95[_0x6b58('0x45')]['id']}})[_0x6b58('0x20')](handleEntityNotFound(_0x1274c0,null))[_0x6b58('0x20')](removeEntity(_0x1274c0,null))[_0x6b58('0x3f')](handleError(_0x1274c0,null));};exports[_0x6b58('0x46')]=function(_0x39e055,_0x208f87,_0x342502){var _0x5f14ed={};var _0x59790e={};var _0x134501;var _0x56e848;return db['VtigerAccount'][_0x6b58('0x47')]({'where':{'id':_0x39e055['params']['id']}})[_0x6b58('0x20')](handleEntityNotFound(_0x208f87,null))[_0x6b58('0x20')](function(_0xe5df89){if(_0xe5df89){_0x134501=_0xe5df89;_0x59790e['model']=_[_0x6b58('0x2d')](db['VtigerConfiguration'][_0x6b58('0x28')]);_0x59790e[_0x6b58('0x2c')]=_['keys'](_0x39e055[_0x6b58('0x2c')]);_0x59790e[_0x6b58('0x2e')]=_[_0x6b58('0x2f')](_0x59790e[_0x6b58('0x2b')],_0x59790e[_0x6b58('0x2c')]);_0x5f14ed[_0x6b58('0x31')]=_['intersection'](_0x59790e[_0x6b58('0x2b')],qs[_0x6b58('0x30')](_0x39e055[_0x6b58('0x2c')][_0x6b58('0x30')]));_0x5f14ed[_0x6b58('0x31')]=_0x5f14ed[_0x6b58('0x31')][_0x6b58('0x32')]?_0x5f14ed[_0x6b58('0x31')]:_0x59790e[_0x6b58('0x2b')];_0x5f14ed[_0x6b58('0x34')]=qs['sort'](_0x39e055[_0x6b58('0x2c')][_0x6b58('0x35')]);_0x5f14ed['where']=qs['filters'](_[_0x6b58('0x37')](_0x39e055[_0x6b58('0x2c')],_0x59790e['filters']));if(_0x39e055[_0x6b58('0x2c')]['filter']){_0x5f14ed[_0x6b58('0x36')]=_['merge'](_0x5f14ed['where'],{'$or':_[_0x6b58('0x26')](_0x5f14ed['attributes'],function(_0xb704c){var _0x2e293b={};_0x2e293b[_0xb704c]={'$like':'%'+_0x39e055[_0x6b58('0x2c')]['filter']+'%'};return _0x2e293b;})});}_0x5f14ed=_[_0x6b58('0x39')]({},_0x5f14ed,_0x39e055['options']);return _0x134501[_0x6b58('0x46')](_0x5f14ed);}})[_0x6b58('0x20')](function(_0x1f1fdc){if(_0x1f1fdc){_0x56e848=_0x1f1fdc['length'];if(!_0x39e055['query'][_0x6b58('0x48')](_0x6b58('0x33'))){_0x5f14ed[_0x6b58('0x1a')]=qs['limit'](_0x39e055[_0x6b58('0x2c')][_0x6b58('0x1a')]);_0x5f14ed[_0x6b58('0x19')]=qs[_0x6b58('0x19')](_0x39e055['query'][_0x6b58('0x19')]);}return _0x134501[_0x6b58('0x46')](_0x5f14ed);}})[_0x6b58('0x20')](function(_0x4c7b9d){if(_0x4c7b9d){return _0x4c7b9d?{'count':_0x56e848,'rows':_0x4c7b9d}:null;}})[_0x6b58('0x20')](respondWithResult(_0x208f87,null))[_0x6b58('0x3f')](handleError(_0x208f87,null));};exports[_0x6b58('0x49')]=function(_0x351f98,_0x2c8d92,_0x374d71){if(_0x351f98[_0x6b58('0x43')]['id']){delete _0x351f98[_0x6b58('0x43')]['id'];}return db[_0x6b58('0x27')][_0x6b58('0x47')]({'where':{'id':_0x351f98[_0x6b58('0x45')]['id']}})[_0x6b58('0x20')](handleEntityNotFound(_0x2c8d92,null))[_0x6b58('0x20')](function(_0x23e021){if(_0x23e021){_0x351f98['body'][_0x6b58('0x4a')]=_0x23e021['id'];_0x351f98['body'][_0x6b58('0x4b')]=integrations[_0x6b58('0x4c')](_0x351f98[_0x6b58('0x43')][_0x6b58('0x4d')],_0x351f98['body'][_0x6b58('0x4e')]);_0x351f98[_0x6b58('0x43')]['Descriptions']=integrations[_0x6b58('0x4f')](_0x351f98[_0x6b58('0x43')][_0x6b58('0x4d')],_0x351f98[_0x6b58('0x43')][_0x6b58('0x4e')]);return db[_0x6b58('0x50')]['create'](_0x351f98[_0x6b58('0x43')],{'include':[{'model':db[_0x6b58('0x51')],'as':_0x6b58('0x4b')},{'model':db['VtigerField'],'as':'Descriptions'}]});}return null;})[_0x6b58('0x20')](respondWithResult(_0x2c8d92,null))['catch'](handleError(_0x2c8d92,null));};var md5=require(_0x6b58('0x52'));exports[_0x6b58('0x53')]=function(_0xbaeae6,_0x1c6602,_0x305ea8){var _0xa5693d=null;var _0x3778f3=null;var _0x12bd44=null;var _0x52657e=null;var _0x556e70='';return db[_0x6b58('0x27')][_0x6b58('0x47')]({'where':{'id':_0xbaeae6['params']['id']},'attributes':['id','name','username','description',_0x6b58('0x54'),'remoteUri',_0x6b58('0x55'),_0x6b58('0x56')]})[_0x6b58('0x20')](handleEntityNotFound(_0x1c6602,null))[_0x6b58('0x20')](function(_0x3cbde1){if(_0x3cbde1){_0xa5693d=_0x3cbde1['username'];_0x3778f3=_0x3cbde1[_0x6b58('0x56')];_0x12bd44=_0x3cbde1[_0x6b58('0x54')];_0x556e70=_0x3cbde1[_0x6b58('0x57')];var _0x47b09a=_0x556e70[_0x6b58('0x58')](-0x1);if(_0x47b09a==='/'){_0x556e70=_0x556e70['substring'](0x0,_0x556e70[_0x6b58('0x59')](_0x47b09a));}_0x52657e=util[_0x6b58('0x5a')](_0x6b58('0x5b'),_0x556e70);var _0x2110c7={'method':_0x6b58('0x5c'),'uri':_0x52657e,'qs':{'operation':_0x6b58('0x5d'),'username':_0x3cbde1[_0x6b58('0x5e')]},'json':!![]};return rp(_0x2110c7);}})[_0x6b58('0x20')](function(_0x3cb69a){if(_0x3cb69a['success']){var _0x4d520c={'method':_0x6b58('0x5f'),'uri':_0x52657e,'form':{'operation':'login','username':_0xa5693d,'accessKey':md5(_0x3cb69a[_0x6b58('0x60')]['token']+_0x3778f3)},'json':!![]};return rp(_0x4d520c);}})['then'](function(_0x41dff5){if(_0x41dff5[_0x6b58('0x61')]){var _0x3b9528={'method':_0x6b58('0x5c'),'uri':_0x52657e,'qs':{'operation':_0x6b58('0x62'),'username':_0xa5693d,'sessionName':_0x41dff5[_0x6b58('0x60')]['sessionName'],'elementType':_0x12bd44},'json':!![]};return rp(_0x3b9528);}})['then'](function(_0x1c552d){if(_0x1c552d[_0x6b58('0x61')]){var _0x33b100=[_0x6b58('0x63'),'reference',_0x6b58('0x64')];_[_0x6b58('0x65')](_0x1c552d[_0x6b58('0x60')][_0x6b58('0x30')],function(_0x1ea544){return _0x33b100[_0x6b58('0x66')](_0x1ea544[_0x6b58('0x4e')][_0x6b58('0x24')]);});_[_0x6b58('0x65')](_0x1c552d[_0x6b58('0x60')][_0x6b58('0x30')],function(_0x17aaa9){return _0x17aaa9['editable']==='false';});return{'count':_0x1c552d['result']['fields'][_0x6b58('0x32')],'rows':_[_0x6b58('0x26')](_0x1c552d[_0x6b58('0x60')][_0x6b58('0x30')],function(_0x4d9839){return{'id':_0x4d9839['name'],'name':_0x4d9839['label'],'custom':_[_0x6b58('0x67')](_0x4d9839[_0x6b58('0x24')],'cf_')?!![]:![],'options':_0x4d9839[_0x6b58('0x4e')][_0x6b58('0x24')]===_0x6b58('0x68')&&_0x4d9839[_0x6b58('0x4e')][_0x6b58('0x69')][_0x6b58('0x32')]>0x0?_['map'](_0x4d9839[_0x6b58('0x4e')][_0x6b58('0x69')],function(_0x4efb0d){return{'name':_0x4efb0d[_0x6b58('0x6a')],'value':_0x4efb0d['value']};}):[]};})};}})[_0x6b58('0x20')](respondWithResult(_0x1c6602,null))[_0x6b58('0x3f')](function(_0x21af07){console[_0x6b58('0x6b')](_0x6b58('0x6c')+_0x21af07);var _0x46060b=_0xbaeae6[_0x6b58('0x2c')][_0x6b58('0x6d')]?0x1f4:_0x21af07['statusCode']||0x1f4;logger[_0x6b58('0x22')](_0x6b58('0x6e'),'getFields',_0x46060b,JSON[_0x6b58('0x6f')](_0x21af07));delete _0x21af07[_0x6b58('0x24')];if(_0x46060b===0x191){_0x46060b=0x190;}_0x1c6602[_0x6b58('0x15')](_0x46060b)['send'](_0xbaeae6[_0x6b58('0x2c')][_0x6b58('0x6d')]?{'message':_0x6b58('0x70'),'statusCode':_0x21af07['statusCode']}:_0x21af07);});};
\ No newline at end of file
+var _0x256b=['ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','destroy','stack','name','send','map','VtigerAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','then','includeAll','include','rows','catch','show','params','create','body','find','getConfigurations','findOne','VtigerConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','VtigerField','remoteUri','accessKey','moduleName','slice','substring','lastIndexOf','format','%s/webservice.php','success','POST','login','token','GET','describe','sessionName','autogenerated','reference','remove','result','includes','editable','false','startsWith','picklist','picklistValues','label','value','log','vTiger\x20error:\x20','getFields','test','Wrong\x20credentials','statusCode','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','squel','crypto','desk.js','querystring','papaparse'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x256b,0xd9));var _0xb256=function(_0x2fa2e5,_0x48fa14){_0x2fa2e5=_0x2fa2e5-0x0;var _0x2e6480=_0x256b[_0x2fa2e5];return _0x2e6480;};'use strict';var emlformat=require(_0xb256('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb256('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb256('0x2'));var moment=require(_0xb256('0x3'));var BPromise=require(_0xb256('0x4'));var Mustache=require(_0xb256('0x5'));var util=require(_0xb256('0x6'));var path=require(_0xb256('0x7'));var sox=require(_0xb256('0x8'));var csv=require(_0xb256('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb256('0xa'));var crypto=require(_0xb256('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xb256('0xc'));var toCsv=require(_0xb256('0x9'));var querystring=require(_0xb256('0xd'));var Papa=require(_0xb256('0xe'));var Redis=require(_0xb256('0xf'));var authService=require(_0xb256('0x10'));var qs=require(_0xb256('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb256('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0xb256('0x13'));var config=require(_0xb256('0x14'));var licenseUtil=require(_0xb256('0x15'));var db=require(_0xb256('0x16'))['db'];var integrations=require(_0xb256('0x17'));function respondWithStatusCode(_0x35510c,_0x256885){_0x256885=_0x256885||0xcc;return function(_0x5594ae){if(_0x5594ae){return _0x35510c[_0xb256('0x18')](_0x256885);}return _0x35510c[_0xb256('0x19')](_0x256885)[_0xb256('0x1a')]();};}function respondWithResult(_0x53845b,_0x3c0cd2){_0x3c0cd2=_0x3c0cd2||0xc8;return function(_0x5c183f){if(_0x5c183f){return _0x53845b[_0xb256('0x19')](_0x3c0cd2)[_0xb256('0x1b')](_0x5c183f);}};}function respondWithFilteredResult(_0x2ba99b,_0x17f102){return function(_0x56342c){if(_0x56342c){var _0x5fb73c=typeof _0x17f102[_0xb256('0x1c')]===_0xb256('0x1d')&&typeof _0x17f102[_0xb256('0x1e')]==='undefined';var _0x245574=_0x56342c[_0xb256('0x1f')];var _0x8ccf57=_0x5fb73c?0x0:_0x17f102[_0xb256('0x1c')];var _0x2e1cf4=_0x5fb73c?_0x56342c[_0xb256('0x1f')]:_0x17f102[_0xb256('0x1c')]+_0x17f102[_0xb256('0x1e')];var _0x4619bb;if(_0x2e1cf4>=_0x245574){_0x2e1cf4=_0x245574;_0x4619bb=0xc8;}else{_0x4619bb=0xce;}_0x2ba99b[_0xb256('0x19')](_0x4619bb);return _0x2ba99b[_0xb256('0x20')](_0xb256('0x21'),_0x8ccf57+'-'+_0x2e1cf4+'/'+_0x245574)[_0xb256('0x1b')](_0x56342c);}return null;};}function patchUpdates(_0x4eb452){return function(_0x217ee6){try{jsonpatch[_0xb256('0x22')](_0x217ee6,_0x4eb452,!![]);}catch(_0xadb37f){return BPromise['reject'](_0xadb37f);}return _0x217ee6['save']();};}function saveUpdates(_0x125a15,_0x7acb01){return function(_0x2e0cf7){if(_0x2e0cf7){return _0x2e0cf7[_0xb256('0x23')](_0x125a15)['then'](function(_0x22e5de){return _0x22e5de;});}return null;};}function removeEntity(_0x3bbc23,_0x391bf7){return function(_0x8a5c1d){if(_0x8a5c1d){return _0x8a5c1d[_0xb256('0x24')]()['then'](function(){_0x3bbc23['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xe4229b,_0x343b31){return function(_0x5427bb){if(!_0x5427bb){_0xe4229b[_0xb256('0x18')](0x194);}return _0x5427bb;};}function handleError(_0x169eb3,_0x2c9e8e){_0x2c9e8e=_0x2c9e8e||0x1f4;return function(_0x2ad709){logger['error'](_0x2ad709[_0xb256('0x25')]);if(_0x2ad709['name']){delete _0x2ad709[_0xb256('0x26')];}_0x169eb3[_0xb256('0x19')](_0x2c9e8e)[_0xb256('0x27')](_0x2ad709);};}exports['index']=function(_0x3f57e3,_0x2ba0fa){var _0xf7f3de={},_0x341696={},_0x1338f9={'count':0x0,'rows':[]};var _0x3697c1=_[_0xb256('0x28')](db[_0xb256('0x29')][_0xb256('0x2a')],function(_0x416f00){return{'name':_0x416f00[_0xb256('0x2b')],'type':_0x416f00[_0xb256('0x2c')][_0xb256('0x2d')]};});_0x341696[_0xb256('0x2e')]=_[_0xb256('0x28')](_0x3697c1,'name');_0x341696[_0xb256('0x2f')]=_[_0xb256('0x30')](_0x3f57e3[_0xb256('0x2f')]);_0x341696[_0xb256('0x31')]=_[_0xb256('0x32')](_0x341696[_0xb256('0x2e')],_0x341696[_0xb256('0x2f')]);_0xf7f3de['attributes']=_[_0xb256('0x32')](_0x341696[_0xb256('0x2e')],qs[_0xb256('0x33')](_0x3f57e3[_0xb256('0x2f')]['fields']));_0xf7f3de[_0xb256('0x34')]=_0xf7f3de[_0xb256('0x34')][_0xb256('0x35')]?_0xf7f3de['attributes']:_0x341696[_0xb256('0x2e')];if(!_0x3f57e3[_0xb256('0x2f')][_0xb256('0x36')](_0xb256('0x37'))){_0xf7f3de[_0xb256('0x1e')]=qs['limit'](_0x3f57e3['query'][_0xb256('0x1e')]);_0xf7f3de[_0xb256('0x1c')]=qs[_0xb256('0x1c')](_0x3f57e3['query'][_0xb256('0x1c')]);}_0xf7f3de[_0xb256('0x38')]=qs[_0xb256('0x39')](_0x3f57e3[_0xb256('0x2f')][_0xb256('0x39')]);_0xf7f3de[_0xb256('0x3a')]=qs['filters'](_[_0xb256('0x3b')](_0x3f57e3[_0xb256('0x2f')],_0x341696[_0xb256('0x31')]),_0x3697c1);if(_0x3f57e3['query'][_0xb256('0x3c')]){_0xf7f3de['where']=_[_0xb256('0x3d')](_0xf7f3de[_0xb256('0x3a')],{'$or':_[_0xb256('0x28')](_0x3697c1,function(_0x5bf620){if(_0x5bf620[_0xb256('0x2c')]!=='VIRTUAL'){var _0x3ef276={};_0x3ef276[_0x5bf620[_0xb256('0x26')]]={'$like':'%'+_0x3f57e3[_0xb256('0x2f')][_0xb256('0x3c')]+'%'};return _0x3ef276;}})});}_0xf7f3de=_[_0xb256('0x3d')]({},_0xf7f3de,_0x3f57e3[_0xb256('0x3e')]);var _0x545e39={'where':_0xf7f3de[_0xb256('0x3a')]};return db[_0xb256('0x29')][_0xb256('0x1f')](_0x545e39)[_0xb256('0x3f')](function(_0x3dba43){_0x1338f9['count']=_0x3dba43;if(_0x3f57e3[_0xb256('0x2f')][_0xb256('0x40')]){_0xf7f3de[_0xb256('0x41')]=[{'all':!![]}];}return db[_0xb256('0x29')]['findAll'](_0xf7f3de);})[_0xb256('0x3f')](function(_0x58f247){_0x1338f9[_0xb256('0x42')]=_0x58f247;return _0x1338f9;})['then'](respondWithFilteredResult(_0x2ba0fa,_0xf7f3de))[_0xb256('0x43')](handleError(_0x2ba0fa,null));};exports[_0xb256('0x44')]=function(_0x54d16d,_0x4aaf5e){var _0x597718={'raw':![],'where':{'id':_0x54d16d[_0xb256('0x45')]['id']}},_0x182662={};_0x182662['model']=_[_0xb256('0x30')](db[_0xb256('0x29')][_0xb256('0x2a')]);_0x182662[_0xb256('0x2f')]=_[_0xb256('0x30')](_0x54d16d[_0xb256('0x2f')]);_0x182662[_0xb256('0x31')]=_[_0xb256('0x32')](_0x182662[_0xb256('0x2e')],_0x182662[_0xb256('0x2f')]);_0x597718[_0xb256('0x34')]=_['intersection'](_0x182662[_0xb256('0x2e')],qs['fields'](_0x54d16d['query'][_0xb256('0x33')]));_0x597718[_0xb256('0x34')]=_0x597718[_0xb256('0x34')]['length']?_0x597718[_0xb256('0x34')]:_0x182662[_0xb256('0x2e')];if(_0x54d16d[_0xb256('0x2f')][_0xb256('0x40')]){_0x597718[_0xb256('0x41')]=[{'all':!![]}];}_0x597718=_['merge']({},_0x597718,_0x54d16d[_0xb256('0x3e')]);return db['VtigerAccount']['find'](_0x597718)[_0xb256('0x3f')](handleEntityNotFound(_0x4aaf5e,null))[_0xb256('0x3f')](respondWithResult(_0x4aaf5e,null))['catch'](handleError(_0x4aaf5e,null));};exports[_0xb256('0x46')]=function(_0x44ac4c,_0x21dd67){return db['VtigerAccount'][_0xb256('0x46')](_0x44ac4c[_0xb256('0x47')],{})[_0xb256('0x3f')](respondWithResult(_0x21dd67,0xc9))[_0xb256('0x43')](handleError(_0x21dd67,null));};exports[_0xb256('0x23')]=function(_0x6ecc4,_0xe39d81){if(_0x6ecc4[_0xb256('0x47')]['id']){delete _0x6ecc4[_0xb256('0x47')]['id'];}return db[_0xb256('0x29')]['find']({'where':{'id':_0x6ecc4[_0xb256('0x45')]['id']}})[_0xb256('0x3f')](handleEntityNotFound(_0xe39d81,null))[_0xb256('0x3f')](saveUpdates(_0x6ecc4[_0xb256('0x47')],null))[_0xb256('0x3f')](respondWithResult(_0xe39d81,null))[_0xb256('0x43')](handleError(_0xe39d81,null));};exports['destroy']=function(_0x4af0f1,_0x3e03c3){return db[_0xb256('0x29')][_0xb256('0x48')]({'where':{'id':_0x4af0f1[_0xb256('0x45')]['id']}})[_0xb256('0x3f')](handleEntityNotFound(_0x3e03c3,null))['then'](removeEntity(_0x3e03c3,null))[_0xb256('0x43')](handleError(_0x3e03c3,null));};exports[_0xb256('0x49')]=function(_0x55b051,_0x55793a,_0x246c76){var _0x2f0c74={};var _0x4ec6be={};var _0x516c87;var _0x1b01ee;return db[_0xb256('0x29')][_0xb256('0x4a')]({'where':{'id':_0x55b051[_0xb256('0x45')]['id']}})[_0xb256('0x3f')](handleEntityNotFound(_0x55793a,null))['then'](function(_0x35a601){if(_0x35a601){_0x516c87=_0x35a601;_0x4ec6be['model']=_[_0xb256('0x30')](db[_0xb256('0x4b')][_0xb256('0x2a')]);_0x4ec6be[_0xb256('0x2f')]=_[_0xb256('0x30')](_0x55b051[_0xb256('0x2f')]);_0x4ec6be[_0xb256('0x31')]=_['intersection'](_0x4ec6be[_0xb256('0x2e')],_0x4ec6be[_0xb256('0x2f')]);_0x2f0c74[_0xb256('0x34')]=_['intersection'](_0x4ec6be[_0xb256('0x2e')],qs[_0xb256('0x33')](_0x55b051[_0xb256('0x2f')][_0xb256('0x33')]));_0x2f0c74[_0xb256('0x34')]=_0x2f0c74['attributes'][_0xb256('0x35')]?_0x2f0c74['attributes']:_0x4ec6be[_0xb256('0x2e')];_0x2f0c74[_0xb256('0x38')]=qs[_0xb256('0x39')](_0x55b051[_0xb256('0x2f')]['sort']);_0x2f0c74[_0xb256('0x3a')]=qs[_0xb256('0x31')](_[_0xb256('0x3b')](_0x55b051[_0xb256('0x2f')],_0x4ec6be[_0xb256('0x31')]));if(_0x55b051[_0xb256('0x2f')][_0xb256('0x3c')]){_0x2f0c74[_0xb256('0x3a')]=_['merge'](_0x2f0c74['where'],{'$or':_[_0xb256('0x28')](_0x2f0c74[_0xb256('0x34')],function(_0x3c4b90){var _0x5d5761={};_0x5d5761[_0x3c4b90]={'$like':'%'+_0x55b051[_0xb256('0x2f')][_0xb256('0x3c')]+'%'};return _0x5d5761;})});}_0x2f0c74=_[_0xb256('0x3d')]({},_0x2f0c74,_0x55b051[_0xb256('0x3e')]);return _0x516c87[_0xb256('0x49')](_0x2f0c74);}})[_0xb256('0x3f')](function(_0x3fc618){if(_0x3fc618){_0x1b01ee=_0x3fc618[_0xb256('0x35')];if(!_0x55b051[_0xb256('0x2f')][_0xb256('0x36')](_0xb256('0x37'))){_0x2f0c74[_0xb256('0x1e')]=qs[_0xb256('0x1e')](_0x55b051[_0xb256('0x2f')][_0xb256('0x1e')]);_0x2f0c74[_0xb256('0x1c')]=qs[_0xb256('0x1c')](_0x55b051['query'][_0xb256('0x1c')]);}return _0x516c87[_0xb256('0x49')](_0x2f0c74);}})[_0xb256('0x3f')](function(_0x579734){if(_0x579734){return _0x579734?{'count':_0x1b01ee,'rows':_0x579734}:null;}})[_0xb256('0x3f')](respondWithResult(_0x55793a,null))['catch'](handleError(_0x55793a,null));};exports[_0xb256('0x4c')]=function(_0x5ccac9,_0x1c90d2,_0xcd2bc0){if(_0x5ccac9[_0xb256('0x47')]['id']){delete _0x5ccac9['body']['id'];}return db[_0xb256('0x29')][_0xb256('0x4a')]({'where':{'id':_0x5ccac9['params']['id']}})[_0xb256('0x3f')](handleEntityNotFound(_0x1c90d2,null))[_0xb256('0x3f')](function(_0x5f4c6c){if(_0x5f4c6c){_0x5ccac9['body'][_0xb256('0x4d')]=_0x5f4c6c['id'];_0x5ccac9[_0xb256('0x47')][_0xb256('0x4e')]=integrations[_0xb256('0x4f')](_0x5ccac9[_0xb256('0x47')][_0xb256('0x50')],_0x5ccac9[_0xb256('0x47')][_0xb256('0x2c')]);_0x5ccac9[_0xb256('0x47')][_0xb256('0x51')]=integrations['getDescriptions'](_0x5ccac9[_0xb256('0x47')][_0xb256('0x50')],_0x5ccac9[_0xb256('0x47')][_0xb256('0x2c')]);return db['VtigerConfiguration'][_0xb256('0x46')](_0x5ccac9[_0xb256('0x47')],{'include':[{'model':db[_0xb256('0x52')],'as':_0xb256('0x4e')},{'model':db[_0xb256('0x52')],'as':'Descriptions'}]});}return null;})[_0xb256('0x3f')](respondWithResult(_0x1c90d2,null))['catch'](handleError(_0x1c90d2,null));};var md5=require('md5');exports['getFields']=function(_0x225331,_0x5b6e02,_0x1fd1ca){var _0x843c63=null;var _0x10cab2=null;var _0x3d13ac=null;var _0x387919=null;var _0x94f253='';return db[_0xb256('0x29')][_0xb256('0x4a')]({'where':{'id':_0x225331[_0xb256('0x45')]['id']},'attributes':['id',_0xb256('0x26'),'username','description','moduleName',_0xb256('0x53'),'serverUrl',_0xb256('0x54')]})[_0xb256('0x3f')](handleEntityNotFound(_0x5b6e02,null))[_0xb256('0x3f')](function(_0x3fdea4){if(_0x3fdea4){_0x843c63=_0x3fdea4['username'];_0x10cab2=_0x3fdea4[_0xb256('0x54')];_0x3d13ac=_0x3fdea4[_0xb256('0x55')];_0x94f253=_0x3fdea4[_0xb256('0x53')];var _0xfd74a2=_0x94f253[_0xb256('0x56')](-0x1);if(_0xfd74a2==='/'){_0x94f253=_0x94f253[_0xb256('0x57')](0x0,_0x94f253[_0xb256('0x58')](_0xfd74a2));}_0x387919=util[_0xb256('0x59')](_0xb256('0x5a'),_0x94f253);var _0x204919={'method':'GET','uri':_0x387919,'qs':{'operation':'getchallenge','username':_0x3fdea4['username']},'json':!![]};return rp(_0x204919);}})[_0xb256('0x3f')](function(_0x5ab95e){if(_0x5ab95e[_0xb256('0x5b')]){var _0x3c9158={'method':_0xb256('0x5c'),'uri':_0x387919,'form':{'operation':_0xb256('0x5d'),'username':_0x843c63,'accessKey':md5(_0x5ab95e['result'][_0xb256('0x5e')]+_0x10cab2)},'json':!![]};return rp(_0x3c9158);}})['then'](function(_0x2df2df){if(_0x2df2df[_0xb256('0x5b')]){var _0x1d91ea={'method':_0xb256('0x5f'),'uri':_0x387919,'qs':{'operation':_0xb256('0x60'),'username':_0x843c63,'sessionName':_0x2df2df['result'][_0xb256('0x61')],'elementType':_0x3d13ac},'json':!![]};return rp(_0x1d91ea);}})[_0xb256('0x3f')](function(_0x4ee907){if(_0x4ee907['success']){var _0x43e986=[_0xb256('0x62'),_0xb256('0x63'),'owner'];_[_0xb256('0x64')](_0x4ee907[_0xb256('0x65')][_0xb256('0x33')],function(_0x400834){return _0x43e986[_0xb256('0x66')](_0x400834[_0xb256('0x2c')][_0xb256('0x26')]);});_[_0xb256('0x64')](_0x4ee907['result'][_0xb256('0x33')],function(_0x3ca8c8){return _0x3ca8c8[_0xb256('0x67')]===_0xb256('0x68');});return{'count':_0x4ee907['result'][_0xb256('0x33')]['length'],'rows':_[_0xb256('0x28')](_0x4ee907[_0xb256('0x65')][_0xb256('0x33')],function(_0x25b55d){return{'id':_0x25b55d[_0xb256('0x26')],'name':_0x25b55d['label'],'custom':_[_0xb256('0x69')](_0x25b55d[_0xb256('0x26')],'cf_')?!![]:![],'options':_0x25b55d[_0xb256('0x2c')][_0xb256('0x26')]===_0xb256('0x6a')&&_0x25b55d[_0xb256('0x2c')][_0xb256('0x6b')][_0xb256('0x35')]>0x0?_[_0xb256('0x28')](_0x25b55d[_0xb256('0x2c')][_0xb256('0x6b')],function(_0x563ac9){return{'name':_0x563ac9[_0xb256('0x6c')],'value':_0x563ac9[_0xb256('0x6d')]};}):[]};})};}})['then'](respondWithResult(_0x5b6e02,null))[_0xb256('0x43')](function(_0x48fec3){console[_0xb256('0x6e')](_0xb256('0x6f')+_0x48fec3);var _0x50ac06=_0x225331[_0xb256('0x2f')]['test']?0x1f4:_0x48fec3['statusCode']||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0xb256('0x70'),_0x50ac06,JSON['stringify'](_0x48fec3));delete _0x48fec3['name'];if(_0x50ac06===0x191){_0x50ac06=0x190;}_0x5b6e02['status'](_0x50ac06)[_0xb256('0x27')](_0x225331[_0xb256('0x2f')][_0xb256('0x71')]?{'message':_0xb256('0x72'),'statusCode':_0x48fec3[_0xb256('0x73')]}:_0x48fec3);});};
\ No newline at end of file
index 2ecf462..a81529a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x24c4=['rimraf','./intVtigerAccount.attributes','../../components/integrations/configuration','exports','VtigerAccount','int_vtiger_accounts','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x12f8e8,_0x49ce73){var _0x3ec0a6=function(_0x403cdd){while(--_0x403cdd){_0x12f8e8['push'](_0x12f8e8['shift']());}};_0x3ec0a6(++_0x49ce73);}(_0x24c4,0x165));var _0x424c=function(_0x41bce7,_0x2edfaf){_0x41bce7=_0x41bce7-0x0;var _0x1dc61e=_0x24c4[_0x41bce7];return _0x1dc61e;};'use strict';var _=require(_0x424c('0x0'));var util=require('util');var logger=require(_0x424c('0x1'))(_0x424c('0x2'));var moment=require(_0x424c('0x3'));var BPromise=require(_0x424c('0x4'));var rp=require(_0x424c('0x5'));var fs=require('fs');var path=require(_0x424c('0x6'));var rimraf=require(_0x424c('0x7'));var config=require('../../config/environment');var attributes=require(_0x424c('0x8'));var integrations=require(_0x424c('0x9'));module[_0x424c('0xa')]=function(_0xfcd1e8,_0x2d1ccd){return _0xfcd1e8['define'](_0x424c('0xb'),attributes,{'tableName':_0x424c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd774=['./intVtigerAccount.attributes','../../components/integrations/configuration','VtigerAccount','int_vtiger_accounts','lodash','util','../../config/logger','api','moment','bluebird','rimraf'];(function(_0x59e821,_0x86c723){var _0x5333f6=function(_0x5dc2c9){while(--_0x5dc2c9){_0x59e821['push'](_0x59e821['shift']());}};_0x5333f6(++_0x86c723);}(_0xd774,0x122));var _0x4d77=function(_0x47f418,_0x11d15e){_0x47f418=_0x47f418-0x0;var _0x131dd6=_0xd774[_0x47f418];return _0x131dd6;};'use strict';var _=require(_0x4d77('0x0'));var util=require(_0x4d77('0x1'));var logger=require(_0x4d77('0x2'))(_0x4d77('0x3'));var moment=require(_0x4d77('0x4'));var BPromise=require(_0x4d77('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x4d77('0x6'));var config=require('../../config/environment');var attributes=require(_0x4d77('0x7'));var integrations=require(_0x4d77('0x8'));module['exports']=function(_0x5e22ba,_0x5dc1af){return _0x5e22ba['define'](_0x4d77('0x9'),attributes,{'tableName':_0x4d77('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index b35a624..b82fe53 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe1e3=['result','GetVtigerAccount','options','raw','where','attributes','limit','include','model','map','debug','catch','find','ShowVtigerAccount','lodash','util','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','VtigerAccount,\x20%s,\x20%s','message','info'];(function(_0x1491b3,_0x487634){var _0x22033b=function(_0x1d8edf){while(--_0x1d8edf){_0x1491b3['push'](_0x1491b3['shift']());}};_0x22033b(++_0x487634);}(_0xe1e3,0x1bb));var _0x3e1e=function(_0x422c25,_0xdf4379){_0x422c25=_0x422c25-0x0;var _0x135312=_0xe1e3[_0x422c25];return _0x135312;};'use strict';var _=require(_0x3e1e('0x0'));var util=require(_0x3e1e('0x1'));var moment=require('moment');var BPromise=require(_0x3e1e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3e1e('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x3e1e('0x4'))(_0x3e1e('0x5'));var config=require(_0x3e1e('0x6'));var jayson=require(_0x3e1e('0x7'));var client=jayson[_0x3e1e('0x8')][_0x3e1e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x55cfba,_0x1574e5,_0x13926d){return new BPromise(function(_0x2f0e12,_0xa67e35){return client[_0x3e1e('0xa')](_0x55cfba,_0x13926d)[_0x3e1e('0xb')](function(_0x5e7d1f){logger['info']('VtigerAccount,\x20%s,\x20%s',_0x1574e5,_0x3e1e('0xc'));logger['debug'](_0x3e1e('0xd'),_0x1574e5,_0x3e1e('0xc'),JSON[_0x3e1e('0xe')](_0x5e7d1f));if(_0x5e7d1f['error']){if(_0x5e7d1f[_0x3e1e('0xf')]['code']===0x1f4){logger['error']('VtigerAccount,\x20%s,\x20%s',_0x1574e5,_0x5e7d1f['error']['message']);return _0xa67e35(_0x5e7d1f[_0x3e1e('0xf')]['message']);}logger['error'](_0x3e1e('0x10'),_0x1574e5,_0x5e7d1f[_0x3e1e('0xf')][_0x3e1e('0x11')]);return _0x2f0e12(_0x5e7d1f['error']['message']);}else{logger[_0x3e1e('0x12')](_0x3e1e('0x10'),_0x1574e5,'request\x20sent');_0x2f0e12(_0x5e7d1f[_0x3e1e('0x13')][_0x3e1e('0x11')]);}})['catch'](function(_0x11c07f){logger['error'](_0x3e1e('0x10'),_0x1574e5,_0x11c07f);_0xa67e35(_0x11c07f);});});}exports[_0x3e1e('0x14')]=function(_0x1d786c){var _0x39eaa7=this;return new Promise(function(_0x791ed8,_0x1c181b){return db['VtigerAccount']['findAll']({'raw':_0x1d786c['options']?_0x1d786c[_0x3e1e('0x15')][_0x3e1e('0x16')]===undefined?!![]:![]:!![],'where':_0x1d786c[_0x3e1e('0x15')]?_0x1d786c['options'][_0x3e1e('0x17')]||null:null,'attributes':_0x1d786c['options']?_0x1d786c[_0x3e1e('0x15')][_0x3e1e('0x18')]||null:null,'limit':_0x1d786c[_0x3e1e('0x15')]?_0x1d786c['options'][_0x3e1e('0x19')]||null:null,'include':_0x1d786c[_0x3e1e('0x15')]?_0x1d786c[_0x3e1e('0x15')]['include']?_['map'](_0x1d786c[_0x3e1e('0x15')][_0x3e1e('0x1a')],function(_0x488f9f){return{'model':db[_0x488f9f[_0x3e1e('0x1b')]],'as':_0x488f9f['as'],'attributes':_0x488f9f[_0x3e1e('0x18')],'include':_0x488f9f[_0x3e1e('0x1a')]?_[_0x3e1e('0x1c')](_0x488f9f[_0x3e1e('0x1a')],function(_0x159212){return{'model':db[_0x159212[_0x3e1e('0x1b')]],'as':_0x159212['as'],'attributes':_0x159212[_0x3e1e('0x18')],'include':_0x159212['include']?_['map'](_0x159212[_0x3e1e('0x1a')],function(_0x541ef1){return{'model':db[_0x541ef1['model']],'as':_0x541ef1['as'],'attributes':_0x541ef1['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1a33bb){logger[_0x3e1e('0x12')]('GetVtigerAccount',_0x1d786c);logger[_0x3e1e('0x1d')]('GetVtigerAccount',_0x1d786c,JSON[_0x3e1e('0xe')](_0x1a33bb));_0x791ed8(_0x1a33bb);})[_0x3e1e('0x1e')](function(_0x53a6ff){logger[_0x3e1e('0xf')](_0x3e1e('0x14'),_0x53a6ff[_0x3e1e('0x11')],_0x1d786c);_0x1c181b(_0x39eaa7['error'](0x1f4,_0x53a6ff[_0x3e1e('0x11')]));});});};exports['ShowVtigerAccount']=function(_0x591c36){var _0x494c75=this;return new Promise(function(_0x39da8d,_0x5b8f95){return db['VtigerAccount'][_0x3e1e('0x1f')]({'raw':_0x591c36[_0x3e1e('0x15')]?_0x591c36[_0x3e1e('0x15')][_0x3e1e('0x16')]===undefined?!![]:![]:!![],'where':_0x591c36[_0x3e1e('0x15')]?_0x591c36['options']['where']||null:null,'attributes':_0x591c36['options']?_0x591c36['options'][_0x3e1e('0x18')]||null:null,'include':_0x591c36[_0x3e1e('0x15')]?_0x591c36[_0x3e1e('0x15')][_0x3e1e('0x1a')]?_[_0x3e1e('0x1c')](_0x591c36[_0x3e1e('0x15')][_0x3e1e('0x1a')],function(_0x431bd5){return{'model':db[_0x431bd5['model']],'as':_0x431bd5['as'],'attributes':_0x431bd5[_0x3e1e('0x18')],'include':_0x431bd5[_0x3e1e('0x1a')]?_['map'](_0x431bd5[_0x3e1e('0x1a')],function(_0x3f4ef3){return{'model':db[_0x3f4ef3[_0x3e1e('0x1b')]],'as':_0x3f4ef3['as'],'attributes':_0x3f4ef3[_0x3e1e('0x18')],'include':_0x3f4ef3['include']?_['map'](_0x3f4ef3[_0x3e1e('0x1a')],function(_0x332f1e){return{'model':db[_0x332f1e['model']],'as':_0x332f1e['as'],'attributes':_0x332f1e[_0x3e1e('0x18')]};}):[]};}):[]};}):[]:[]})[_0x3e1e('0xb')](function(_0x4e9acd){logger[_0x3e1e('0x12')](_0x3e1e('0x20'),_0x591c36);logger[_0x3e1e('0x1d')](_0x3e1e('0x20'),_0x591c36,JSON[_0x3e1e('0xe')](_0x4e9acd));_0x39da8d(_0x4e9acd);})['catch'](function(_0x1da527){logger[_0x3e1e('0xf')](_0x3e1e('0x20'),_0x1da527[_0x3e1e('0x11')],_0x591c36);_0x5b8f95(_0x494c75['error'](0x1f4,_0x1da527[_0x3e1e('0x11')]));});});};
\ No newline at end of file
+var _0x1c7c=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VtigerAccount,\x20%s,\x20%s','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','GetVtigerAccount','VtigerAccount','findAll','options','where','limit','include','map','model','attributes','ShowVtigerAccount','raw','lodash','util','moment','bluebird'];(function(_0x5daefc,_0x213300){var _0x5f126f=function(_0xa7a198){while(--_0xa7a198){_0x5daefc['push'](_0x5daefc['shift']());}};_0x5f126f(++_0x213300);}(_0x1c7c,0x164));var _0xc1c7=function(_0x3ce9fd,_0x387f73){_0x3ce9fd=_0x3ce9fd-0x0;var _0x27ed12=_0x1c7c[_0x3ce9fd];return _0x27ed12;};'use strict';var _=require(_0xc1c7('0x0'));var util=require(_0xc1c7('0x1'));var moment=require(_0xc1c7('0x2'));var BPromise=require(_0xc1c7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc1c7('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc1c7('0x5'));var logger=require(_0xc1c7('0x6'))(_0xc1c7('0x7'));var config=require(_0xc1c7('0x8'));var jayson=require(_0xc1c7('0x9'));var client=jayson[_0xc1c7('0xa')][_0xc1c7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x419138,_0xce5bcd,_0x3b3e9c){return new BPromise(function(_0x434a35,_0x11c7ef){return client[_0xc1c7('0xc')](_0x419138,_0x3b3e9c)[_0xc1c7('0xd')](function(_0x339649){logger[_0xc1c7('0xe')](_0xc1c7('0xf'),_0xce5bcd,'request\x20sent');logger[_0xc1c7('0x10')](_0xc1c7('0x11'),_0xce5bcd,'request\x20sent',JSON[_0xc1c7('0x12')](_0x339649));if(_0x339649[_0xc1c7('0x13')]){if(_0x339649[_0xc1c7('0x13')]['code']===0x1f4){logger[_0xc1c7('0x13')](_0xc1c7('0xf'),_0xce5bcd,_0x339649[_0xc1c7('0x13')][_0xc1c7('0x14')]);return _0x11c7ef(_0x339649[_0xc1c7('0x13')][_0xc1c7('0x14')]);}logger[_0xc1c7('0x13')](_0xc1c7('0xf'),_0xce5bcd,_0x339649[_0xc1c7('0x13')][_0xc1c7('0x14')]);return _0x434a35(_0x339649[_0xc1c7('0x13')][_0xc1c7('0x14')]);}else{logger['info'](_0xc1c7('0xf'),_0xce5bcd,_0xc1c7('0x15'));_0x434a35(_0x339649[_0xc1c7('0x16')]['message']);}})[_0xc1c7('0x17')](function(_0x3939c1){logger[_0xc1c7('0x13')](_0xc1c7('0xf'),_0xce5bcd,_0x3939c1);_0x11c7ef(_0x3939c1);});});}exports[_0xc1c7('0x18')]=function(_0xb42702){var _0x21758a=this;return new Promise(function(_0x2e93e5,_0x5d44e9){return db[_0xc1c7('0x19')][_0xc1c7('0x1a')]({'raw':_0xb42702[_0xc1c7('0x1b')]?_0xb42702[_0xc1c7('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0xb42702[_0xc1c7('0x1b')]?_0xb42702['options'][_0xc1c7('0x1c')]||null:null,'attributes':_0xb42702[_0xc1c7('0x1b')]?_0xb42702['options']['attributes']||null:null,'limit':_0xb42702[_0xc1c7('0x1b')]?_0xb42702[_0xc1c7('0x1b')][_0xc1c7('0x1d')]||null:null,'include':_0xb42702['options']?_0xb42702[_0xc1c7('0x1b')][_0xc1c7('0x1e')]?_[_0xc1c7('0x1f')](_0xb42702[_0xc1c7('0x1b')][_0xc1c7('0x1e')],function(_0x3a2483){return{'model':db[_0x3a2483[_0xc1c7('0x20')]],'as':_0x3a2483['as'],'attributes':_0x3a2483[_0xc1c7('0x21')],'include':_0x3a2483[_0xc1c7('0x1e')]?_[_0xc1c7('0x1f')](_0x3a2483[_0xc1c7('0x1e')],function(_0x363fbc){return{'model':db[_0x363fbc[_0xc1c7('0x20')]],'as':_0x363fbc['as'],'attributes':_0x363fbc[_0xc1c7('0x21')],'include':_0x363fbc[_0xc1c7('0x1e')]?_[_0xc1c7('0x1f')](_0x363fbc['include'],function(_0xf0ab9c){return{'model':db[_0xf0ab9c[_0xc1c7('0x20')]],'as':_0xf0ab9c['as'],'attributes':_0xf0ab9c['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x352f24){logger['info']('GetVtigerAccount',_0xb42702);logger[_0xc1c7('0x10')](_0xc1c7('0x18'),_0xb42702,JSON[_0xc1c7('0x12')](_0x352f24));_0x2e93e5(_0x352f24);})[_0xc1c7('0x17')](function(_0x461360){logger['error']('GetVtigerAccount',_0x461360[_0xc1c7('0x14')],_0xb42702);_0x5d44e9(_0x21758a[_0xc1c7('0x13')](0x1f4,_0x461360[_0xc1c7('0x14')]));});});};exports[_0xc1c7('0x22')]=function(_0x2e35f1){var _0x4968b0=this;return new Promise(function(_0x50042f,_0x125920){return db[_0xc1c7('0x19')]['find']({'raw':_0x2e35f1[_0xc1c7('0x1b')]?_0x2e35f1[_0xc1c7('0x1b')][_0xc1c7('0x23')]===undefined?!![]:![]:!![],'where':_0x2e35f1[_0xc1c7('0x1b')]?_0x2e35f1[_0xc1c7('0x1b')][_0xc1c7('0x1c')]||null:null,'attributes':_0x2e35f1[_0xc1c7('0x1b')]?_0x2e35f1['options'][_0xc1c7('0x21')]||null:null,'include':_0x2e35f1[_0xc1c7('0x1b')]?_0x2e35f1[_0xc1c7('0x1b')][_0xc1c7('0x1e')]?_[_0xc1c7('0x1f')](_0x2e35f1[_0xc1c7('0x1b')][_0xc1c7('0x1e')],function(_0xef703f){return{'model':db[_0xef703f[_0xc1c7('0x20')]],'as':_0xef703f['as'],'attributes':_0xef703f['attributes'],'include':_0xef703f['include']?_[_0xc1c7('0x1f')](_0xef703f[_0xc1c7('0x1e')],function(_0x263900){return{'model':db[_0x263900[_0xc1c7('0x20')]],'as':_0x263900['as'],'attributes':_0x263900[_0xc1c7('0x21')],'include':_0x263900[_0xc1c7('0x1e')]?_[_0xc1c7('0x1f')](_0x263900[_0xc1c7('0x1e')],function(_0x3bd3b0){return{'model':db[_0x3bd3b0[_0xc1c7('0x20')]],'as':_0x3bd3b0['as'],'attributes':_0x3bd3b0[_0xc1c7('0x21')]};}):[]};}):[]};}):[]:[]})[_0xc1c7('0xd')](function(_0x154476){logger[_0xc1c7('0xe')](_0xc1c7('0x22'),_0x2e35f1);logger[_0xc1c7('0x10')](_0xc1c7('0x22'),_0x2e35f1,JSON[_0xc1c7('0x12')](_0x154476));_0x50042f(_0x154476);})[_0xc1c7('0x17')](function(_0x239a91){logger[_0xc1c7('0x13')]('ShowVtigerAccount',_0x239a91['message'],_0x2e35f1);_0x125920(_0x4968b0['error'](0x1f4,_0x239a91[_0xc1c7('0x14')]));});});};
\ No newline at end of file
index ac2628e..529e012 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5617=['isAuthenticated','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id'];(function(_0x409ef3,_0x59f9df){var _0x2ba639=function(_0x1ffa61){while(--_0x1ffa61){_0x409ef3['push'](_0x409ef3['shift']());}};_0x2ba639(++_0x59f9df);}(_0x5617,0x12d));var _0x7561=function(_0x2b9607,_0x3b5e1d){_0x2b9607=_0x2b9607-0x0;var _0x3044eb=_0x5617[_0x2b9607];return _0x3044eb;};'use strict';var multer=require(_0x7561('0x0'));var util=require(_0x7561('0x1'));var path=require(_0x7561('0x2'));var timeout=require(_0x7561('0x3'));var express=require(_0x7561('0x4'));var router=express['Router']();var fs_extra=require(_0x7561('0x5'));var auth=require(_0x7561('0x6'));var interaction=require(_0x7561('0x7'));var config=require(_0x7561('0x8'));var controller=require('./intVtigerConfiguration.controller');router[_0x7561('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x7561('0x9')](_0x7561('0xa'),auth[_0x7561('0xb')](),controller[_0x7561('0xc')]);router[_0x7561('0x9')](_0x7561('0xd'),auth['isAuthenticated'](),controller['getFields']);router['get'](_0x7561('0xe'),auth['isAuthenticated'](),controller[_0x7561('0xf')]);router[_0x7561('0x9')](_0x7561('0x10'),auth[_0x7561('0xb')](),controller[_0x7561('0x11')]);router['post']('/',auth['isAuthenticated'](),controller[_0x7561('0x12')]);router[_0x7561('0x13')](_0x7561('0xa'),auth[_0x7561('0xb')](),controller[_0x7561('0x14')]);router[_0x7561('0x15')](_0x7561('0xa'),auth['isAuthenticated'](),controller[_0x7561('0x16')]);module[_0x7561('0x17')]=router;
\ No newline at end of file
+var _0x4b04=['multer','util','Router','fs-extra','../../components/auth/service','./intVtigerConfiguration.controller','get','index','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getDescriptions','post','create','put','/:id','delete','destroy','exports'];(function(_0x34f0fb,_0x1a69b6){var _0x73790=function(_0xdeeb68){while(--_0xdeeb68){_0x34f0fb['push'](_0x34f0fb['shift']());}};_0x73790(++_0x1a69b6);}(_0x4b04,0x17a));var _0x44b0=function(_0xb65be,_0x269947){_0xb65be=_0xb65be-0x0;var _0x2200dc=_0x4b04[_0xb65be];return _0x2200dc;};'use strict';var multer=require(_0x44b0('0x0'));var util=require(_0x44b0('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x44b0('0x2')]();var fs_extra=require(_0x44b0('0x3'));var auth=require(_0x44b0('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x44b0('0x5'));router[_0x44b0('0x6')]('/',auth['isAuthenticated'](),controller[_0x44b0('0x7')]);router[_0x44b0('0x6')]('/:id',auth[_0x44b0('0x8')](),controller[_0x44b0('0x9')]);router[_0x44b0('0x6')](_0x44b0('0xa'),auth['isAuthenticated'](),controller[_0x44b0('0xb')]);router[_0x44b0('0x6')](_0x44b0('0xc'),auth[_0x44b0('0x8')](),controller['getSubjects']);router[_0x44b0('0x6')]('/:id/descriptions',auth['isAuthenticated'](),controller[_0x44b0('0xd')]);router[_0x44b0('0xe')]('/',auth[_0x44b0('0x8')](),controller[_0x44b0('0xf')]);router[_0x44b0('0x10')](_0x44b0('0x11'),auth[_0x44b0('0x8')](),controller['update']);router[_0x44b0('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x44b0('0x13')]);module[_0x44b0('0x14')]=router;
\ No newline at end of file
index fdce173..a99b6a8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdd34=['exports','STRING','sequelize'];(function(_0x1e2080,_0x53283b){var _0x260111=function(_0x15da5e){while(--_0x15da5e){_0x1e2080['push'](_0x1e2080['shift']());}};_0x260111(++_0x53283b);}(_0xdd34,0xfb));var _0x4dd3=function(_0x52397b,_0x5476db){_0x52397b=_0x52397b-0x0;var _0x583157=_0xdd34[_0x52397b];return _0x583157;};'use strict';var Sequelize=require(_0x4dd3('0x0'));module[_0x4dd3('0x1')]={'name':{'type':Sequelize[_0x4dd3('0x2')]},'description':{'type':Sequelize[_0x4dd3('0x2')]}};
\ No newline at end of file
+var _0xa0fb=['exports','sequelize'];(function(_0x32a1eb,_0x43c306){var _0x2944b1=function(_0x35594d){while(--_0x35594d){_0x32a1eb['push'](_0x32a1eb['shift']());}};_0x2944b1(++_0x43c306);}(_0xa0fb,0x105));var _0xba0f=function(_0x158a35,_0xae92e5){_0x158a35=_0x158a35-0x0;var _0x375dbd=_0xa0fb[_0x158a35];return _0x375dbd;};'use strict';var Sequelize=require(_0xba0f('0x0'));module[_0xba0f('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 06db5d6..4649aa3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1546=['rimraf','zip-dir','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','count','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','VtigerConfiguration','rawAttributes','key','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','limit','sort','where','filter','merge','type','VIRTUAL','findAll','rows','show','includeAll','include','find','body','catch','params','getFields','findOne','VtigerField','pick','getSubjects','order','options','getDescriptions','nolimit'];(function(_0x358aed,_0x48ce04){var _0x38614a=function(_0x470176){while(--_0x470176){_0x358aed['push'](_0x358aed['shift']());}};_0x38614a(++_0x48ce04);}(_0x1546,0x18b));var _0x6154=function(_0x1d01cc,_0x1c6f22){_0x1d01cc=_0x1d01cc-0x0;var _0x14eb78=_0x1546[_0x1d01cc];return _0x14eb78;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6154('0x0'));var zipdir=require(_0x6154('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x6154('0x2'));var Mustache=require(_0x6154('0x3'));var util=require(_0x6154('0x4'));var path=require(_0x6154('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x6154('0x6'));var fs=require('fs');var fs_extra=require(_0x6154('0x7'));var _=require(_0x6154('0x8'));var squel=require(_0x6154('0x9'));var crypto=require(_0x6154('0xa'));var jsforce=require(_0x6154('0xb'));var deskjs=require(_0x6154('0xc'));var toCsv=require(_0x6154('0xd'));var querystring=require(_0x6154('0xe'));var Papa=require('papaparse');var Redis=require(_0x6154('0xf'));var authService=require(_0x6154('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x6154('0x11'));var hardwareService=require(_0x6154('0x12'));var logger=require(_0x6154('0x13'))(_0x6154('0x14'));var utils=require(_0x6154('0x15'));var config=require(_0x6154('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x6154('0x17'))['db'];function respondWithStatusCode(_0x4ad2d1,_0x431913){_0x431913=_0x431913||0xcc;return function(_0x4d9e67){if(_0x4d9e67){return _0x4ad2d1[_0x6154('0x18')](_0x431913);}return _0x4ad2d1[_0x6154('0x19')](_0x431913)[_0x6154('0x1a')]();};}function respondWithResult(_0x32ecb1,_0x4a80f7){_0x4a80f7=_0x4a80f7||0xc8;return function(_0x310632){if(_0x310632){return _0x32ecb1[_0x6154('0x19')](_0x4a80f7)['json'](_0x310632);}};}function respondWithFilteredResult(_0x1b5407,_0x763acb){return function(_0x1b4afe){if(_0x1b4afe){var _0x1674e4=typeof _0x763acb[_0x6154('0x1b')]===_0x6154('0x1c')&&typeof _0x763acb['limit']===_0x6154('0x1c');var _0x26d54e=_0x1b4afe[_0x6154('0x1d')];var _0x283e31=_0x1674e4?0x0:_0x763acb[_0x6154('0x1b')];var _0x53eb2b=_0x1674e4?_0x1b4afe['count']:_0x763acb['offset']+_0x763acb['limit'];var _0x20458c;if(_0x53eb2b>=_0x26d54e){_0x53eb2b=_0x26d54e;_0x20458c=0xc8;}else{_0x20458c=0xce;}_0x1b5407[_0x6154('0x19')](_0x20458c);return _0x1b5407['set'](_0x6154('0x1e'),_0x283e31+'-'+_0x53eb2b+'/'+_0x26d54e)['json'](_0x1b4afe);}return null;};}function patchUpdates(_0x50b844){return function(_0x1679ef){try{jsonpatch[_0x6154('0x1f')](_0x1679ef,_0x50b844,!![]);}catch(_0x5197ac){return BPromise['reject'](_0x5197ac);}return _0x1679ef[_0x6154('0x20')]();};}function saveUpdates(_0x30ee0a,_0x4df022){return function(_0x49aadb){if(_0x49aadb){return _0x49aadb[_0x6154('0x21')](_0x30ee0a)[_0x6154('0x22')](function(_0x3309f5){return _0x3309f5;});}return null;};}function removeEntity(_0xbd53f8,_0x477ff6){return function(_0x7da997){if(_0x7da997){return _0x7da997[_0x6154('0x23')]()[_0x6154('0x22')](function(){_0xbd53f8[_0x6154('0x19')](0xcc)[_0x6154('0x1a')]();});}};}function handleEntityNotFound(_0x4d46fc,_0x53af5a){return function(_0x71fbc0){if(!_0x71fbc0){_0x4d46fc[_0x6154('0x18')](0x194);}return _0x71fbc0;};}function handleError(_0xb336d1,_0xd413d6){_0xd413d6=_0xd413d6||0x1f4;return function(_0x1fffd2){logger[_0x6154('0x24')](_0x1fffd2[_0x6154('0x25')]);if(_0x1fffd2[_0x6154('0x26')]){delete _0x1fffd2['name'];}_0xb336d1['status'](_0xd413d6)[_0x6154('0x27')](_0x1fffd2);};}exports[_0x6154('0x28')]=function(_0x57e98,_0x1ce81b){var _0x10700e={},_0x56aaae={},_0x23822e={'count':0x0,'rows':[]};var _0x37309b=_['map'](db[_0x6154('0x29')][_0x6154('0x2a')],function(_0x1dc7b3){return{'name':_0x1dc7b3['fieldName'],'type':_0x1dc7b3['type'][_0x6154('0x2b')]};});_0x56aaae[_0x6154('0x2c')]=_[_0x6154('0x2d')](_0x37309b,_0x6154('0x26'));_0x56aaae[_0x6154('0x2e')]=_[_0x6154('0x2f')](_0x57e98[_0x6154('0x2e')]);_0x56aaae[_0x6154('0x30')]=_['intersection'](_0x56aaae[_0x6154('0x2c')],_0x56aaae['query']);_0x10700e[_0x6154('0x31')]=_[_0x6154('0x32')](_0x56aaae[_0x6154('0x2c')],qs[_0x6154('0x33')](_0x57e98[_0x6154('0x2e')][_0x6154('0x33')]));_0x10700e[_0x6154('0x31')]=_0x10700e[_0x6154('0x31')][_0x6154('0x34')]?_0x10700e[_0x6154('0x31')]:_0x56aaae[_0x6154('0x2c')];if(!_0x57e98[_0x6154('0x2e')][_0x6154('0x35')]('nolimit')){_0x10700e['limit']=qs[_0x6154('0x36')](_0x57e98[_0x6154('0x2e')]['limit']);_0x10700e[_0x6154('0x1b')]=qs[_0x6154('0x1b')](_0x57e98[_0x6154('0x2e')]['offset']);}_0x10700e['order']=qs[_0x6154('0x37')](_0x57e98[_0x6154('0x2e')][_0x6154('0x37')]);_0x10700e[_0x6154('0x38')]=qs[_0x6154('0x30')](_['pick'](_0x57e98['query'],_0x56aaae['filters']),_0x37309b);if(_0x57e98[_0x6154('0x2e')][_0x6154('0x39')]){_0x10700e['where']=_[_0x6154('0x3a')](_0x10700e['where'],{'$or':_['map'](_0x37309b,function(_0x38e52c){if(_0x38e52c[_0x6154('0x3b')]!==_0x6154('0x3c')){var _0x335ad4={};_0x335ad4[_0x38e52c[_0x6154('0x26')]]={'$like':'%'+_0x57e98[_0x6154('0x2e')][_0x6154('0x39')]+'%'};return _0x335ad4;}})});}_0x10700e=_[_0x6154('0x3a')]({},_0x10700e,_0x57e98['options']);var _0x474c80={'where':_0x10700e[_0x6154('0x38')]};return db[_0x6154('0x29')][_0x6154('0x1d')](_0x474c80)[_0x6154('0x22')](function(_0x5072b6){_0x23822e[_0x6154('0x1d')]=_0x5072b6;if(_0x57e98[_0x6154('0x2e')]['includeAll']){_0x10700e['include']=[{'all':!![]}];}return db[_0x6154('0x29')][_0x6154('0x3d')](_0x10700e);})[_0x6154('0x22')](function(_0x4619e7){_0x23822e[_0x6154('0x3e')]=_0x4619e7;return _0x23822e;})[_0x6154('0x22')](respondWithFilteredResult(_0x1ce81b,_0x10700e))['catch'](handleError(_0x1ce81b,null));};exports[_0x6154('0x3f')]=function(_0x1b2dfb,_0x338276){var _0x4936c7={'raw':![],'where':{'id':_0x1b2dfb['params']['id']}},_0xc40f20={};_0xc40f20[_0x6154('0x2c')]=_[_0x6154('0x2f')](db[_0x6154('0x29')][_0x6154('0x2a')]);_0xc40f20['query']=_[_0x6154('0x2f')](_0x1b2dfb[_0x6154('0x2e')]);_0xc40f20[_0x6154('0x30')]=_['intersection'](_0xc40f20[_0x6154('0x2c')],_0xc40f20[_0x6154('0x2e')]);_0x4936c7['attributes']=_[_0x6154('0x32')](_0xc40f20['model'],qs[_0x6154('0x33')](_0x1b2dfb['query']['fields']));_0x4936c7[_0x6154('0x31')]=_0x4936c7[_0x6154('0x31')][_0x6154('0x34')]?_0x4936c7[_0x6154('0x31')]:_0xc40f20['model'];if(_0x1b2dfb[_0x6154('0x2e')][_0x6154('0x40')]){_0x4936c7[_0x6154('0x41')]=[{'all':!![]}];}_0x4936c7=_['merge']({},_0x4936c7,_0x1b2dfb['options']);return db['VtigerConfiguration'][_0x6154('0x42')](_0x4936c7)[_0x6154('0x22')](handleEntityNotFound(_0x338276,null))[_0x6154('0x22')](respondWithResult(_0x338276,null))['catch'](handleError(_0x338276,null));};exports['create']=function(_0x1f0bde,_0x212467){return db[_0x6154('0x29')]['create'](_0x1f0bde[_0x6154('0x43')],{})['then'](respondWithResult(_0x212467,0xc9))[_0x6154('0x44')](handleError(_0x212467,null));};exports[_0x6154('0x21')]=function(_0x2902b1,_0x30130e){if(_0x2902b1[_0x6154('0x43')]['id']){delete _0x2902b1[_0x6154('0x43')]['id'];}return db[_0x6154('0x29')]['find']({'where':{'id':_0x2902b1[_0x6154('0x45')]['id']}})[_0x6154('0x22')](handleEntityNotFound(_0x30130e,null))[_0x6154('0x22')](saveUpdates(_0x2902b1[_0x6154('0x43')],null))[_0x6154('0x22')](respondWithResult(_0x30130e,null))['catch'](handleError(_0x30130e,null));};exports['destroy']=function(_0x11c9a3,_0x105dd9){return db[_0x6154('0x29')][_0x6154('0x42')]({'where':{'id':_0x11c9a3[_0x6154('0x45')]['id']}})[_0x6154('0x22')](handleEntityNotFound(_0x105dd9,null))[_0x6154('0x22')](removeEntity(_0x105dd9,null))[_0x6154('0x44')](handleError(_0x105dd9,null));};exports[_0x6154('0x46')]=function(_0xac5575,_0x5668a7,_0x5df18e){var _0x50a8dd={};var _0x3143a4={};var _0x2eb42d;var _0x982843;return db[_0x6154('0x29')][_0x6154('0x47')]({'where':{'id':_0xac5575['params']['id']}})['then'](handleEntityNotFound(_0x5668a7,null))[_0x6154('0x22')](function(_0x265a1c){if(_0x265a1c){_0x2eb42d=_0x265a1c;_0x3143a4['model']=_[_0x6154('0x2f')](db[_0x6154('0x48')][_0x6154('0x2a')]);_0x3143a4['query']=_[_0x6154('0x2f')](_0xac5575[_0x6154('0x2e')]);_0x3143a4[_0x6154('0x30')]=_['intersection'](_0x3143a4[_0x6154('0x2c')],_0x3143a4[_0x6154('0x2e')]);_0x50a8dd['attributes']=_[_0x6154('0x32')](_0x3143a4[_0x6154('0x2c')],qs[_0x6154('0x33')](_0xac5575[_0x6154('0x2e')][_0x6154('0x33')]));_0x50a8dd[_0x6154('0x31')]=_0x50a8dd[_0x6154('0x31')][_0x6154('0x34')]?_0x50a8dd[_0x6154('0x31')]:_0x3143a4[_0x6154('0x2c')];_0x50a8dd['order']=qs['sort'](_0xac5575[_0x6154('0x2e')][_0x6154('0x37')]);_0x50a8dd[_0x6154('0x38')]=qs[_0x6154('0x30')](_[_0x6154('0x49')](_0xac5575[_0x6154('0x2e')],_0x3143a4[_0x6154('0x30')]));if(_0xac5575['query']['filter']){_0x50a8dd[_0x6154('0x38')]=_[_0x6154('0x3a')](_0x50a8dd[_0x6154('0x38')],{'$or':_[_0x6154('0x2d')](_0x50a8dd[_0x6154('0x31')],function(_0x404ca3){var _0x217bee={};_0x217bee[_0x404ca3]={'$like':'%'+_0xac5575[_0x6154('0x2e')][_0x6154('0x39')]+'%'};return _0x217bee;})});}_0x50a8dd=_[_0x6154('0x3a')]({},_0x50a8dd,_0xac5575['options']);return _0x2eb42d['getFields'](_0x50a8dd);}})[_0x6154('0x22')](function(_0x2fcc1f){if(_0x2fcc1f){_0x982843=_0x2fcc1f[_0x6154('0x34')];if(!_0xac5575['query'][_0x6154('0x35')]('nolimit')){_0x50a8dd['limit']=qs[_0x6154('0x36')](_0xac5575[_0x6154('0x2e')]['limit']);_0x50a8dd['offset']=qs[_0x6154('0x1b')](_0xac5575[_0x6154('0x2e')]['offset']);}return _0x2eb42d['getFields'](_0x50a8dd);}})['then'](function(_0x577046){if(_0x577046){return _0x577046?{'count':_0x982843,'rows':_0x577046}:null;}})[_0x6154('0x22')](respondWithResult(_0x5668a7,null))[_0x6154('0x44')](handleError(_0x5668a7,null));};exports[_0x6154('0x4a')]=function(_0x21041d,_0x41b8a9,_0x254079){var _0x18f99d={};var _0x4033cd={};var _0x450f2d;var _0x374963;return db[_0x6154('0x29')]['findOne']({'where':{'id':_0x21041d[_0x6154('0x45')]['id']}})[_0x6154('0x22')](handleEntityNotFound(_0x41b8a9,null))[_0x6154('0x22')](function(_0x5b3b87){if(_0x5b3b87){_0x450f2d=_0x5b3b87;_0x4033cd['model']=_[_0x6154('0x2f')](db['VtigerField']['rawAttributes']);_0x4033cd[_0x6154('0x2e')]=_[_0x6154('0x2f')](_0x21041d[_0x6154('0x2e')]);_0x4033cd[_0x6154('0x30')]=_[_0x6154('0x32')](_0x4033cd[_0x6154('0x2c')],_0x4033cd[_0x6154('0x2e')]);_0x18f99d[_0x6154('0x31')]=_[_0x6154('0x32')](_0x4033cd[_0x6154('0x2c')],qs[_0x6154('0x33')](_0x21041d[_0x6154('0x2e')][_0x6154('0x33')]));_0x18f99d['attributes']=_0x18f99d['attributes'][_0x6154('0x34')]?_0x18f99d[_0x6154('0x31')]:_0x4033cd['model'];_0x18f99d[_0x6154('0x4b')]=qs[_0x6154('0x37')](_0x21041d[_0x6154('0x2e')][_0x6154('0x37')]);_0x18f99d['where']=qs[_0x6154('0x30')](_[_0x6154('0x49')](_0x21041d[_0x6154('0x2e')],_0x4033cd[_0x6154('0x30')]));if(_0x21041d[_0x6154('0x2e')][_0x6154('0x39')]){_0x18f99d[_0x6154('0x38')]=_[_0x6154('0x3a')](_0x18f99d[_0x6154('0x38')],{'$or':_[_0x6154('0x2d')](_0x18f99d['attributes'],function(_0x53fc0f){var _0x3f2e88={};_0x3f2e88[_0x53fc0f]={'$like':'%'+_0x21041d[_0x6154('0x2e')][_0x6154('0x39')]+'%'};return _0x3f2e88;})});}_0x18f99d=_[_0x6154('0x3a')]({},_0x18f99d,_0x21041d[_0x6154('0x4c')]);return _0x450f2d[_0x6154('0x4a')](_0x18f99d);}})['then'](function(_0x348b5e){if(_0x348b5e){_0x374963=_0x348b5e[_0x6154('0x34')];if(!_0x21041d[_0x6154('0x2e')][_0x6154('0x35')]('nolimit')){_0x18f99d[_0x6154('0x36')]=qs[_0x6154('0x36')](_0x21041d['query'][_0x6154('0x36')]);_0x18f99d[_0x6154('0x1b')]=qs[_0x6154('0x1b')](_0x21041d['query'][_0x6154('0x1b')]);}return _0x450f2d[_0x6154('0x4a')](_0x18f99d);}})[_0x6154('0x22')](function(_0xc2aaf7){if(_0xc2aaf7){return _0xc2aaf7?{'count':_0x374963,'rows':_0xc2aaf7}:null;}})[_0x6154('0x22')](respondWithResult(_0x41b8a9,null))[_0x6154('0x44')](handleError(_0x41b8a9,null));};exports['getDescriptions']=function(_0x56541b,_0x3445a5,_0x2e1c9e){var _0x53f562={};var _0xba7e90={};var _0x2a911f;var _0x1c8630;return db[_0x6154('0x29')][_0x6154('0x47')]({'where':{'id':_0x56541b[_0x6154('0x45')]['id']}})[_0x6154('0x22')](handleEntityNotFound(_0x3445a5,null))['then'](function(_0x46029f){if(_0x46029f){_0x2a911f=_0x46029f;_0xba7e90[_0x6154('0x2c')]=_[_0x6154('0x2f')](db['VtigerField'][_0x6154('0x2a')]);_0xba7e90[_0x6154('0x2e')]=_['keys'](_0x56541b['query']);_0xba7e90[_0x6154('0x30')]=_['intersection'](_0xba7e90[_0x6154('0x2c')],_0xba7e90[_0x6154('0x2e')]);_0x53f562[_0x6154('0x31')]=_[_0x6154('0x32')](_0xba7e90[_0x6154('0x2c')],qs[_0x6154('0x33')](_0x56541b[_0x6154('0x2e')][_0x6154('0x33')]));_0x53f562[_0x6154('0x31')]=_0x53f562['attributes'][_0x6154('0x34')]?_0x53f562[_0x6154('0x31')]:_0xba7e90[_0x6154('0x2c')];_0x53f562[_0x6154('0x4b')]=qs[_0x6154('0x37')](_0x56541b['query'][_0x6154('0x37')]);_0x53f562[_0x6154('0x38')]=qs[_0x6154('0x30')](_[_0x6154('0x49')](_0x56541b[_0x6154('0x2e')],_0xba7e90['filters']));if(_0x56541b[_0x6154('0x2e')][_0x6154('0x39')]){_0x53f562[_0x6154('0x38')]=_[_0x6154('0x3a')](_0x53f562[_0x6154('0x38')],{'$or':_[_0x6154('0x2d')](_0x53f562[_0x6154('0x31')],function(_0x309a54){var _0x46f9a6={};_0x46f9a6[_0x309a54]={'$like':'%'+_0x56541b[_0x6154('0x2e')][_0x6154('0x39')]+'%'};return _0x46f9a6;})});}_0x53f562=_[_0x6154('0x3a')]({},_0x53f562,_0x56541b[_0x6154('0x4c')]);return _0x2a911f[_0x6154('0x4d')](_0x53f562);}})['then'](function(_0x1cffe2){if(_0x1cffe2){_0x1c8630=_0x1cffe2[_0x6154('0x34')];if(!_0x56541b[_0x6154('0x2e')][_0x6154('0x35')](_0x6154('0x4e'))){_0x53f562[_0x6154('0x36')]=qs[_0x6154('0x36')](_0x56541b[_0x6154('0x2e')]['limit']);_0x53f562['offset']=qs['offset'](_0x56541b[_0x6154('0x2e')][_0x6154('0x1b')]);}return _0x2a911f[_0x6154('0x4d')](_0x53f562);}})[_0x6154('0x22')](function(_0x569228){if(_0x569228){return _0x569228?{'count':_0x1c8630,'rows':_0x569228}:null;}})[_0x6154('0x22')](respondWithResult(_0x3445a5,null))[_0x6154('0x44')](handleError(_0x3445a5,null));};
\ No newline at end of file
+var _0x9d86=['show','include','create','body','params','find','findOne','VtigerField','getFields','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','limit','count','set','apply','reject','save','update','then','destroy','error','stack','name','send','map','VtigerConfiguration','rawAttributes','fieldName','type','key','query','keys','filters','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','rows','catch'];(function(_0x3547ac,_0x4d7e59){var _0x5ac6ff=function(_0x1d1b79){while(--_0x1d1b79){_0x3547ac['push'](_0x3547ac['shift']());}};_0x5ac6ff(++_0x4d7e59);}(_0x9d86,0x1a5));var _0x69d8=function(_0x2b9ef0,_0x475182){_0x2b9ef0=_0x2b9ef0-0x0;var _0x26f42c=_0x9d86[_0x2b9ef0];return _0x26f42c;};'use strict';var emlformat=require(_0x69d8('0x0'));var rimraf=require(_0x69d8('0x1'));var zipdir=require(_0x69d8('0x2'));var jsonpatch=require(_0x69d8('0x3'));var rp=require(_0x69d8('0x4'));var moment=require(_0x69d8('0x5'));var BPromise=require(_0x69d8('0x6'));var Mustache=require(_0x69d8('0x7'));var util=require(_0x69d8('0x8'));var path=require(_0x69d8('0x9'));var sox=require(_0x69d8('0xa'));var csv=require(_0x69d8('0xb'));var ejs=require(_0x69d8('0xc'));var fs=require('fs');var fs_extra=require(_0x69d8('0xd'));var _=require(_0x69d8('0xe'));var squel=require('squel');var crypto=require(_0x69d8('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x69d8('0x10'));var toCsv=require('to-csv');var querystring=require(_0x69d8('0x11'));var Papa=require(_0x69d8('0x12'));var Redis=require(_0x69d8('0x13'));var authService=require(_0x69d8('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x69d8('0x15'));var hardwareService=require(_0x69d8('0x16'));var logger=require(_0x69d8('0x17'))(_0x69d8('0x18'));var utils=require(_0x69d8('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x69d8('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x309f34,_0x38e924){_0x38e924=_0x38e924||0xcc;return function(_0x51f93f){if(_0x51f93f){return _0x309f34[_0x69d8('0x1b')](_0x38e924);}return _0x309f34[_0x69d8('0x1c')](_0x38e924)[_0x69d8('0x1d')]();};}function respondWithResult(_0x5de503,_0x90227f){_0x90227f=_0x90227f||0xc8;return function(_0x370bf4){if(_0x370bf4){return _0x5de503[_0x69d8('0x1c')](_0x90227f)[_0x69d8('0x1e')](_0x370bf4);}};}function respondWithFilteredResult(_0x142899,_0x2bc71f){return function(_0x1a2874){if(_0x1a2874){var _0xeab49e=typeof _0x2bc71f[_0x69d8('0x1f')]==='undefined'&&typeof _0x2bc71f[_0x69d8('0x20')]==='undefined';var _0x414979=_0x1a2874[_0x69d8('0x21')];var _0x2c94b5=_0xeab49e?0x0:_0x2bc71f[_0x69d8('0x1f')];var _0x4cdcf4=_0xeab49e?_0x1a2874['count']:_0x2bc71f['offset']+_0x2bc71f[_0x69d8('0x20')];var _0x48adfb;if(_0x4cdcf4>=_0x414979){_0x4cdcf4=_0x414979;_0x48adfb=0xc8;}else{_0x48adfb=0xce;}_0x142899[_0x69d8('0x1c')](_0x48adfb);return _0x142899[_0x69d8('0x22')]('Content-Range',_0x2c94b5+'-'+_0x4cdcf4+'/'+_0x414979)[_0x69d8('0x1e')](_0x1a2874);}return null;};}function patchUpdates(_0x1e2c7b){return function(_0x5a4453){try{jsonpatch[_0x69d8('0x23')](_0x5a4453,_0x1e2c7b,!![]);}catch(_0x20391e){return BPromise[_0x69d8('0x24')](_0x20391e);}return _0x5a4453[_0x69d8('0x25')]();};}function saveUpdates(_0x556496,_0x354b80){return function(_0x5885c3){if(_0x5885c3){return _0x5885c3[_0x69d8('0x26')](_0x556496)[_0x69d8('0x27')](function(_0x1cab68){return _0x1cab68;});}return null;};}function removeEntity(_0x5c76bf,_0x2a7a3e){return function(_0x381551){if(_0x381551){return _0x381551[_0x69d8('0x28')]()['then'](function(){_0x5c76bf[_0x69d8('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x58a88c,_0x14b259){return function(_0x3cfcac){if(!_0x3cfcac){_0x58a88c[_0x69d8('0x1b')](0x194);}return _0x3cfcac;};}function handleError(_0x3833a4,_0x48a7c7){_0x48a7c7=_0x48a7c7||0x1f4;return function(_0x8c7160){logger[_0x69d8('0x29')](_0x8c7160[_0x69d8('0x2a')]);if(_0x8c7160['name']){delete _0x8c7160[_0x69d8('0x2b')];}_0x3833a4[_0x69d8('0x1c')](_0x48a7c7)[_0x69d8('0x2c')](_0x8c7160);};}exports['index']=function(_0x20f0d4,_0x56eabb){var _0x4508eb={},_0x196e70={},_0x7466c0={'count':0x0,'rows':[]};var _0x1b50f3=_[_0x69d8('0x2d')](db[_0x69d8('0x2e')][_0x69d8('0x2f')],function(_0x573d08){return{'name':_0x573d08[_0x69d8('0x30')],'type':_0x573d08[_0x69d8('0x31')][_0x69d8('0x32')]};});_0x196e70['model']=_[_0x69d8('0x2d')](_0x1b50f3,_0x69d8('0x2b'));_0x196e70[_0x69d8('0x33')]=_[_0x69d8('0x34')](_0x20f0d4['query']);_0x196e70[_0x69d8('0x35')]=_['intersection'](_0x196e70[_0x69d8('0x36')],_0x196e70['query']);_0x4508eb['attributes']=_[_0x69d8('0x37')](_0x196e70[_0x69d8('0x36')],qs['fields'](_0x20f0d4[_0x69d8('0x33')][_0x69d8('0x38')]));_0x4508eb['attributes']=_0x4508eb[_0x69d8('0x39')][_0x69d8('0x3a')]?_0x4508eb[_0x69d8('0x39')]:_0x196e70[_0x69d8('0x36')];if(!_0x20f0d4[_0x69d8('0x33')][_0x69d8('0x3b')](_0x69d8('0x3c'))){_0x4508eb[_0x69d8('0x20')]=qs[_0x69d8('0x20')](_0x20f0d4[_0x69d8('0x33')][_0x69d8('0x20')]);_0x4508eb[_0x69d8('0x1f')]=qs[_0x69d8('0x1f')](_0x20f0d4['query'][_0x69d8('0x1f')]);}_0x4508eb[_0x69d8('0x3d')]=qs[_0x69d8('0x3e')](_0x20f0d4['query'][_0x69d8('0x3e')]);_0x4508eb[_0x69d8('0x3f')]=qs[_0x69d8('0x35')](_[_0x69d8('0x40')](_0x20f0d4['query'],_0x196e70[_0x69d8('0x35')]),_0x1b50f3);if(_0x20f0d4[_0x69d8('0x33')]['filter']){_0x4508eb['where']=_[_0x69d8('0x41')](_0x4508eb['where'],{'$or':_[_0x69d8('0x2d')](_0x1b50f3,function(_0x4138e3){if(_0x4138e3[_0x69d8('0x31')]!==_0x69d8('0x42')){var _0x36f349={};_0x36f349[_0x4138e3[_0x69d8('0x2b')]]={'$like':'%'+_0x20f0d4[_0x69d8('0x33')][_0x69d8('0x43')]+'%'};return _0x36f349;}})});}_0x4508eb=_['merge']({},_0x4508eb,_0x20f0d4[_0x69d8('0x44')]);var _0x1e7bb0={'where':_0x4508eb[_0x69d8('0x3f')]};return db[_0x69d8('0x2e')][_0x69d8('0x21')](_0x1e7bb0)[_0x69d8('0x27')](function(_0x31b89d){_0x7466c0['count']=_0x31b89d;if(_0x20f0d4[_0x69d8('0x33')]['includeAll']){_0x4508eb['include']=[{'all':!![]}];}return db[_0x69d8('0x2e')]['findAll'](_0x4508eb);})[_0x69d8('0x27')](function(_0x5e2fe5){_0x7466c0[_0x69d8('0x45')]=_0x5e2fe5;return _0x7466c0;})[_0x69d8('0x27')](respondWithFilteredResult(_0x56eabb,_0x4508eb))[_0x69d8('0x46')](handleError(_0x56eabb,null));};exports[_0x69d8('0x47')]=function(_0x789b18,_0x2f4b2f){var _0x2943b7={'raw':![],'where':{'id':_0x789b18['params']['id']}},_0x49e1e3={};_0x49e1e3[_0x69d8('0x36')]=_[_0x69d8('0x34')](db[_0x69d8('0x2e')][_0x69d8('0x2f')]);_0x49e1e3[_0x69d8('0x33')]=_[_0x69d8('0x34')](_0x789b18[_0x69d8('0x33')]);_0x49e1e3[_0x69d8('0x35')]=_[_0x69d8('0x37')](_0x49e1e3[_0x69d8('0x36')],_0x49e1e3[_0x69d8('0x33')]);_0x2943b7[_0x69d8('0x39')]=_[_0x69d8('0x37')](_0x49e1e3['model'],qs[_0x69d8('0x38')](_0x789b18[_0x69d8('0x33')][_0x69d8('0x38')]));_0x2943b7[_0x69d8('0x39')]=_0x2943b7[_0x69d8('0x39')]['length']?_0x2943b7[_0x69d8('0x39')]:_0x49e1e3[_0x69d8('0x36')];if(_0x789b18[_0x69d8('0x33')]['includeAll']){_0x2943b7[_0x69d8('0x48')]=[{'all':!![]}];}_0x2943b7=_[_0x69d8('0x41')]({},_0x2943b7,_0x789b18[_0x69d8('0x44')]);return db[_0x69d8('0x2e')]['find'](_0x2943b7)[_0x69d8('0x27')](handleEntityNotFound(_0x2f4b2f,null))[_0x69d8('0x27')](respondWithResult(_0x2f4b2f,null))[_0x69d8('0x46')](handleError(_0x2f4b2f,null));};exports['create']=function(_0x56bc71,_0x5e5b12){return db[_0x69d8('0x2e')][_0x69d8('0x49')](_0x56bc71['body'],{})[_0x69d8('0x27')](respondWithResult(_0x5e5b12,0xc9))['catch'](handleError(_0x5e5b12,null));};exports[_0x69d8('0x26')]=function(_0x3af55e,_0xaeec1e){if(_0x3af55e[_0x69d8('0x4a')]['id']){delete _0x3af55e['body']['id'];}return db[_0x69d8('0x2e')]['find']({'where':{'id':_0x3af55e[_0x69d8('0x4b')]['id']}})[_0x69d8('0x27')](handleEntityNotFound(_0xaeec1e,null))[_0x69d8('0x27')](saveUpdates(_0x3af55e[_0x69d8('0x4a')],null))[_0x69d8('0x27')](respondWithResult(_0xaeec1e,null))[_0x69d8('0x46')](handleError(_0xaeec1e,null));};exports[_0x69d8('0x28')]=function(_0x4d2ca3,_0x88ac8){return db['VtigerConfiguration'][_0x69d8('0x4c')]({'where':{'id':_0x4d2ca3[_0x69d8('0x4b')]['id']}})[_0x69d8('0x27')](handleEntityNotFound(_0x88ac8,null))[_0x69d8('0x27')](removeEntity(_0x88ac8,null))[_0x69d8('0x46')](handleError(_0x88ac8,null));};exports['getFields']=function(_0x362b3e,_0x394d9a,_0x2e38d5){var _0x5a8115={};var _0x274dd0={};var _0x4bda12;var _0x4a02fb;return db[_0x69d8('0x2e')][_0x69d8('0x4d')]({'where':{'id':_0x362b3e[_0x69d8('0x4b')]['id']}})[_0x69d8('0x27')](handleEntityNotFound(_0x394d9a,null))[_0x69d8('0x27')](function(_0x3b305d){if(_0x3b305d){_0x4bda12=_0x3b305d;_0x274dd0[_0x69d8('0x36')]=_['keys'](db[_0x69d8('0x4e')][_0x69d8('0x2f')]);_0x274dd0[_0x69d8('0x33')]=_[_0x69d8('0x34')](_0x362b3e[_0x69d8('0x33')]);_0x274dd0[_0x69d8('0x35')]=_['intersection'](_0x274dd0[_0x69d8('0x36')],_0x274dd0[_0x69d8('0x33')]);_0x5a8115['attributes']=_['intersection'](_0x274dd0[_0x69d8('0x36')],qs['fields'](_0x362b3e[_0x69d8('0x33')][_0x69d8('0x38')]));_0x5a8115[_0x69d8('0x39')]=_0x5a8115[_0x69d8('0x39')]['length']?_0x5a8115[_0x69d8('0x39')]:_0x274dd0[_0x69d8('0x36')];_0x5a8115['order']=qs[_0x69d8('0x3e')](_0x362b3e[_0x69d8('0x33')][_0x69d8('0x3e')]);_0x5a8115[_0x69d8('0x3f')]=qs[_0x69d8('0x35')](_[_0x69d8('0x40')](_0x362b3e['query'],_0x274dd0['filters']));if(_0x362b3e['query'][_0x69d8('0x43')]){_0x5a8115[_0x69d8('0x3f')]=_[_0x69d8('0x41')](_0x5a8115['where'],{'$or':_[_0x69d8('0x2d')](_0x5a8115[_0x69d8('0x39')],function(_0x36436d){var _0x462b5a={};_0x462b5a[_0x36436d]={'$like':'%'+_0x362b3e[_0x69d8('0x33')][_0x69d8('0x43')]+'%'};return _0x462b5a;})});}_0x5a8115=_[_0x69d8('0x41')]({},_0x5a8115,_0x362b3e[_0x69d8('0x44')]);return _0x4bda12['getFields'](_0x5a8115);}})['then'](function(_0x366655){if(_0x366655){_0x4a02fb=_0x366655[_0x69d8('0x3a')];if(!_0x362b3e[_0x69d8('0x33')][_0x69d8('0x3b')](_0x69d8('0x3c'))){_0x5a8115['limit']=qs[_0x69d8('0x20')](_0x362b3e[_0x69d8('0x33')][_0x69d8('0x20')]);_0x5a8115[_0x69d8('0x1f')]=qs[_0x69d8('0x1f')](_0x362b3e[_0x69d8('0x33')][_0x69d8('0x1f')]);}return _0x4bda12[_0x69d8('0x4f')](_0x5a8115);}})[_0x69d8('0x27')](function(_0x2590f6){if(_0x2590f6){return _0x2590f6?{'count':_0x4a02fb,'rows':_0x2590f6}:null;}})[_0x69d8('0x27')](respondWithResult(_0x394d9a,null))[_0x69d8('0x46')](handleError(_0x394d9a,null));};exports[_0x69d8('0x50')]=function(_0x6aa732,_0x34ac2d,_0x27b819){var _0x40a12d={};var _0x32e1bc={};var _0x5de024;var _0x37b024;return db[_0x69d8('0x2e')]['findOne']({'where':{'id':_0x6aa732[_0x69d8('0x4b')]['id']}})[_0x69d8('0x27')](handleEntityNotFound(_0x34ac2d,null))[_0x69d8('0x27')](function(_0x26184a){if(_0x26184a){_0x5de024=_0x26184a;_0x32e1bc[_0x69d8('0x36')]=_['keys'](db[_0x69d8('0x4e')][_0x69d8('0x2f')]);_0x32e1bc[_0x69d8('0x33')]=_[_0x69d8('0x34')](_0x6aa732[_0x69d8('0x33')]);_0x32e1bc['filters']=_[_0x69d8('0x37')](_0x32e1bc[_0x69d8('0x36')],_0x32e1bc['query']);_0x40a12d['attributes']=_[_0x69d8('0x37')](_0x32e1bc[_0x69d8('0x36')],qs[_0x69d8('0x38')](_0x6aa732[_0x69d8('0x33')][_0x69d8('0x38')]));_0x40a12d['attributes']=_0x40a12d['attributes'][_0x69d8('0x3a')]?_0x40a12d[_0x69d8('0x39')]:_0x32e1bc[_0x69d8('0x36')];_0x40a12d[_0x69d8('0x3d')]=qs[_0x69d8('0x3e')](_0x6aa732[_0x69d8('0x33')][_0x69d8('0x3e')]);_0x40a12d[_0x69d8('0x3f')]=qs[_0x69d8('0x35')](_['pick'](_0x6aa732[_0x69d8('0x33')],_0x32e1bc[_0x69d8('0x35')]));if(_0x6aa732[_0x69d8('0x33')]['filter']){_0x40a12d[_0x69d8('0x3f')]=_[_0x69d8('0x41')](_0x40a12d[_0x69d8('0x3f')],{'$or':_[_0x69d8('0x2d')](_0x40a12d['attributes'],function(_0x34ad59){var _0x24766c={};_0x24766c[_0x34ad59]={'$like':'%'+_0x6aa732[_0x69d8('0x33')]['filter']+'%'};return _0x24766c;})});}_0x40a12d=_[_0x69d8('0x41')]({},_0x40a12d,_0x6aa732[_0x69d8('0x44')]);return _0x5de024[_0x69d8('0x50')](_0x40a12d);}})[_0x69d8('0x27')](function(_0x4c1aaf){if(_0x4c1aaf){_0x37b024=_0x4c1aaf['length'];if(!_0x6aa732[_0x69d8('0x33')]['hasOwnProperty']('nolimit')){_0x40a12d['limit']=qs[_0x69d8('0x20')](_0x6aa732[_0x69d8('0x33')]['limit']);_0x40a12d[_0x69d8('0x1f')]=qs['offset'](_0x6aa732[_0x69d8('0x33')][_0x69d8('0x1f')]);}return _0x5de024['getSubjects'](_0x40a12d);}})[_0x69d8('0x27')](function(_0x4d2261){if(_0x4d2261){return _0x4d2261?{'count':_0x37b024,'rows':_0x4d2261}:null;}})[_0x69d8('0x27')](respondWithResult(_0x34ac2d,null))[_0x69d8('0x46')](handleError(_0x34ac2d,null));};exports[_0x69d8('0x51')]=function(_0x144579,_0x7acca3,_0x43d626){var _0x310d30={};var _0x14a392={};var _0x4655ca;var _0x156d6c;return db[_0x69d8('0x2e')]['findOne']({'where':{'id':_0x144579[_0x69d8('0x4b')]['id']}})[_0x69d8('0x27')](handleEntityNotFound(_0x7acca3,null))['then'](function(_0x1487ed){if(_0x1487ed){_0x4655ca=_0x1487ed;_0x14a392[_0x69d8('0x36')]=_[_0x69d8('0x34')](db[_0x69d8('0x4e')][_0x69d8('0x2f')]);_0x14a392[_0x69d8('0x33')]=_[_0x69d8('0x34')](_0x144579[_0x69d8('0x33')]);_0x14a392[_0x69d8('0x35')]=_[_0x69d8('0x37')](_0x14a392[_0x69d8('0x36')],_0x14a392['query']);_0x310d30[_0x69d8('0x39')]=_[_0x69d8('0x37')](_0x14a392['model'],qs[_0x69d8('0x38')](_0x144579['query'][_0x69d8('0x38')]));_0x310d30['attributes']=_0x310d30[_0x69d8('0x39')]['length']?_0x310d30[_0x69d8('0x39')]:_0x14a392[_0x69d8('0x36')];_0x310d30[_0x69d8('0x3d')]=qs[_0x69d8('0x3e')](_0x144579['query'][_0x69d8('0x3e')]);_0x310d30[_0x69d8('0x3f')]=qs[_0x69d8('0x35')](_[_0x69d8('0x40')](_0x144579[_0x69d8('0x33')],_0x14a392['filters']));if(_0x144579[_0x69d8('0x33')][_0x69d8('0x43')]){_0x310d30[_0x69d8('0x3f')]=_[_0x69d8('0x41')](_0x310d30['where'],{'$or':_[_0x69d8('0x2d')](_0x310d30[_0x69d8('0x39')],function(_0x2c6433){var _0x1a1e02={};_0x1a1e02[_0x2c6433]={'$like':'%'+_0x144579[_0x69d8('0x33')][_0x69d8('0x43')]+'%'};return _0x1a1e02;})});}_0x310d30=_['merge']({},_0x310d30,_0x144579[_0x69d8('0x44')]);return _0x4655ca[_0x69d8('0x51')](_0x310d30);}})[_0x69d8('0x27')](function(_0x43774f){if(_0x43774f){_0x156d6c=_0x43774f['length'];if(!_0x144579[_0x69d8('0x33')][_0x69d8('0x3b')](_0x69d8('0x3c'))){_0x310d30[_0x69d8('0x20')]=qs[_0x69d8('0x20')](_0x144579[_0x69d8('0x33')][_0x69d8('0x20')]);_0x310d30[_0x69d8('0x1f')]=qs[_0x69d8('0x1f')](_0x144579[_0x69d8('0x33')]['offset']);}return _0x4655ca[_0x69d8('0x51')](_0x310d30);}})[_0x69d8('0x27')](function(_0xf17de5){if(_0xf17de5){return _0xf17de5?{'count':_0x156d6c,'rows':_0xf17de5}:null;}})['then'](respondWithResult(_0x7acca3,null))[_0x69d8('0x46')](handleError(_0x7acca3,null));};
\ No newline at end of file
index 9afe305..b10a29a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x87f8=['int_vtiger_configurations','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','exports'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x87f8,0x191));var _0x887f=function(_0x5735ff,_0x21579c){_0x5735ff=_0x5735ff-0x0;var _0x2be86f=_0x87f8[_0x5735ff];return _0x2be86f;};'use strict';var _=require(_0x887f('0x0'));var util=require(_0x887f('0x1'));var logger=require(_0x887f('0x2'))(_0x887f('0x3'));var moment=require('moment');var BPromise=require(_0x887f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x887f('0x5'));var rimraf=require(_0x887f('0x6'));var config=require(_0x887f('0x7'));var attributes=require('./intVtigerConfiguration.attributes');module[_0x887f('0x8')]=function(_0x7d608a,_0x342be8){return _0x7d608a['define']('VtigerConfiguration',attributes,{'tableName':_0x887f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x800c=['rimraf','define','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x800c,0x77));var _0xc800=function(_0x34fea2,_0x596681){_0x34fea2=_0x34fea2-0x0;var _0x18f042=_0x800c[_0x34fea2];return _0x18f042;};'use strict';var _=require(_0xc800('0x0'));var util=require(_0xc800('0x1'));var logger=require(_0xc800('0x2'))(_0xc800('0x3'));var moment=require('moment');var BPromise=require(_0xc800('0x4'));var rp=require(_0xc800('0x5'));var fs=require('fs');var path=require(_0xc800('0x6'));var rimraf=require(_0xc800('0x7'));var config=require('../../config/environment');var attributes=require('./intVtigerConfiguration.attributes');module['exports']=function(_0x2957b0,_0x54565){return _0x2957b0[_0xc800('0x8')]('VtigerConfiguration',attributes,{'tableName':'int_vtiger_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index a610891..89e1123 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdef8=['then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request'];(function(_0x32c0e1,_0x1f8f0f){var _0x181d1f=function(_0x438c27){while(--_0x438c27){_0x32c0e1['push'](_0x32c0e1['shift']());}};_0x181d1f(++_0x1f8f0f);}(_0xdef8,0xd9));var _0x8def=function(_0x555016,_0x51284a){_0x555016=_0x555016-0x0;var _0x32bf61=_0xdef8[_0x555016];return _0x32bf61;};'use strict';var _=require(_0x8def('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x8def('0x1'));var rs=require(_0x8def('0x2'));var fs=require('fs');var Redis=require(_0x8def('0x3'));var db=require(_0x8def('0x4'))['db'];var utils=require(_0x8def('0x5'));var logger=require(_0x8def('0x6'))(_0x8def('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x8def('0x8')][_0x8def('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x22220e,_0x4f7a20,_0x4d1ab6){return new BPromise(function(_0xe05d2f,_0x86dbc1){return client[_0x8def('0xa')](_0x22220e,_0x4d1ab6)[_0x8def('0xb')](function(_0x4d116e){logger[_0x8def('0xc')](_0x8def('0xd'),_0x4f7a20,_0x8def('0xe'));logger[_0x8def('0xf')]('VtigerConfiguration,\x20%s,\x20%s,\x20%s',_0x4f7a20,_0x8def('0xe'),JSON[_0x8def('0x10')](_0x4d116e));if(_0x4d116e['error']){if(_0x4d116e[_0x8def('0x11')]['code']===0x1f4){logger['error'](_0x8def('0xd'),_0x4f7a20,_0x4d116e['error'][_0x8def('0x12')]);return _0x86dbc1(_0x4d116e[_0x8def('0x11')]['message']);}logger['error'](_0x8def('0xd'),_0x4f7a20,_0x4d116e[_0x8def('0x11')][_0x8def('0x12')]);return _0xe05d2f(_0x4d116e['error']['message']);}else{logger[_0x8def('0xc')](_0x8def('0xd'),_0x4f7a20,_0x8def('0xe'));_0xe05d2f(_0x4d116e['result']['message']);}})['catch'](function(_0x3cefc6){logger[_0x8def('0x11')](_0x8def('0xd'),_0x4f7a20,_0x3cefc6);_0x86dbc1(_0x3cefc6);});});}
\ No newline at end of file
+var _0x2cd8=['catch','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x2cd8,0x13c));var _0x82cd=function(_0x522e0c,_0x3d69cb){_0x522e0c=_0x522e0c-0x0;var _0x58eb18=_0x2cd8[_0x522e0c];return _0x58eb18;};'use strict';var _=require('lodash');var util=require(_0x82cd('0x0'));var moment=require('moment');var BPromise=require(_0x82cd('0x1'));var rs=require(_0x82cd('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x82cd('0x3'))['db'];var utils=require(_0x82cd('0x4'));var logger=require('../../config/logger')(_0x82cd('0x5'));var config=require(_0x82cd('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x82cd('0x7')][_0x82cd('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x14d100,_0x39d013,_0x3d866f){return new BPromise(function(_0x3196b8,_0x19a1f6){return client[_0x82cd('0x9')](_0x14d100,_0x3d866f)[_0x82cd('0xa')](function(_0x3376d1){logger['info'](_0x82cd('0xb'),_0x39d013,_0x82cd('0xc'));logger[_0x82cd('0xd')](_0x82cd('0xe'),_0x39d013,_0x82cd('0xc'),JSON[_0x82cd('0xf')](_0x3376d1));if(_0x3376d1[_0x82cd('0x10')]){if(_0x3376d1[_0x82cd('0x10')]['code']===0x1f4){logger[_0x82cd('0x10')](_0x82cd('0xb'),_0x39d013,_0x3376d1[_0x82cd('0x10')]['message']);return _0x19a1f6(_0x3376d1['error'][_0x82cd('0x11')]);}logger['error']('VtigerConfiguration,\x20%s,\x20%s',_0x39d013,_0x3376d1['error'][_0x82cd('0x11')]);return _0x3196b8(_0x3376d1['error'][_0x82cd('0x11')]);}else{logger[_0x82cd('0x12')](_0x82cd('0xb'),_0x39d013,_0x82cd('0xc'));_0x3196b8(_0x3376d1[_0x82cd('0x13')][_0x82cd('0x11')]);}})[_0x82cd('0x14')](function(_0x186541){logger[_0x82cd('0x10')]('VtigerConfiguration,\x20%s,\x20%s',_0x39d013,_0x186541);_0x19a1f6(_0x186541);});});}
\ No newline at end of file
index aeb8df2..6b36a01 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf52c=['show','create','delete','multer','util','path','./intVtigerField.controller','get','isAuthenticated','index','/:id'];(function(_0x256d6a,_0x2f002f){var _0x460058=function(_0x195be7){while(--_0x195be7){_0x256d6a['push'](_0x256d6a['shift']());}};_0x460058(++_0x2f002f);}(_0xf52c,0x19a));var _0xcf52=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf52c[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xcf52('0x0'));var util=require(_0xcf52('0x1'));var path=require(_0xcf52('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xcf52('0x3'));router[_0xcf52('0x4')]('/',auth[_0xcf52('0x5')](),controller[_0xcf52('0x6')]);router['get'](_0xcf52('0x7'),auth[_0xcf52('0x5')](),controller[_0xcf52('0x8')]);router['post']('/',auth[_0xcf52('0x5')](),controller[_0xcf52('0x9')]);router['put'](_0xcf52('0x7'),auth[_0xcf52('0x5')](),controller['update']);router[_0xcf52('0xa')](_0xcf52('0x7'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x59e4=['exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','./intVtigerField.controller','get','index','/:id','isAuthenticated','post','put','delete','destroy'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0x59e4,0xe1));var _0x459e=function(_0x300d0e,_0x4fcd1b){_0x300d0e=_0x300d0e-0x0;var _0x1903cb=_0x59e4[_0x300d0e];return _0x1903cb;};'use strict';var multer=require(_0x459e('0x0'));var util=require('util');var path=require(_0x459e('0x1'));var timeout=require(_0x459e('0x2'));var express=require(_0x459e('0x3'));var router=express[_0x459e('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x459e('0x5'));var config=require('../../config/environment');var controller=require(_0x459e('0x6'));router[_0x459e('0x7')]('/',auth['isAuthenticated'](),controller[_0x459e('0x8')]);router[_0x459e('0x7')](_0x459e('0x9'),auth[_0x459e('0xa')](),controller['show']);router[_0x459e('0xb')]('/',auth[_0x459e('0xa')](),controller['create']);router[_0x459e('0xc')](_0x459e('0x9'),auth[_0x459e('0xa')](),controller['update']);router[_0x459e('0xd')](_0x459e('0x9'),auth['isAuthenticated'](),controller[_0x459e('0xe')]);module[_0x459e('0xf')]=router;
\ No newline at end of file
index 4837f10..5eb742b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x71f6=['keyValue','picklist','string','STRING','BOOLEAN','ENUM','variable','customVariable'];(function(_0x47f0ac,_0x147d60){var _0x263ee9=function(_0x3b423e){while(--_0x3b423e){_0x47f0ac['push'](_0x47f0ac['shift']());}};_0x263ee9(++_0x147d60);}(_0x71f6,0x65));var _0x671f=function(_0x3cdf45,_0xf8b0e1){_0x3cdf45=_0x3cdf45-0x0;var _0x32c277=_0x71f6[_0x3cdf45];return _0x32c277;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x671f('0x0')]('string',_0x671f('0x1'),_0x671f('0x2'),_0x671f('0x3'),_0x671f('0x4')),'defaultValue':_0x671f('0x5')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x671f('0x0')](_0x671f('0x5'),_0x671f('0x1'),_0x671f('0x2'))},'keyContent':{'type':Sequelize[_0x671f('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x671f('0x6')]},'customField':{'type':Sequelize[_0x671f('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x671f('0x6')]}};
\ No newline at end of file
+var _0x1b1f=['ENUM','sequelize','exports','variable','customVariable','keyValue','picklist','STRING'];(function(_0x479730,_0x42f634){var _0x27b98b=function(_0xb88c4a){while(--_0xb88c4a){_0x479730['push'](_0x479730['shift']());}};_0x27b98b(++_0x42f634);}(_0x1b1f,0x69));var _0xf1b1=function(_0x4d92c,_0x1eb40d){_0x4d92c=_0x4d92c-0x0;var _0x39163e=_0x1b1f[_0x4d92c];return _0x39163e;};'use strict';var Sequelize=require(_0xf1b1('0x0'));module[_0xf1b1('0x1')]={'type':{'type':Sequelize['ENUM']('string',_0xf1b1('0x2'),_0xf1b1('0x3'),_0xf1b1('0x4'),_0xf1b1('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0xf1b1('0x6')]},'key':{'type':Sequelize[_0xf1b1('0x6')]},'keyType':{'type':Sequelize[_0xf1b1('0x7')]('string',_0xf1b1('0x2'),_0xf1b1('0x3'))},'keyContent':{'type':Sequelize[_0xf1b1('0x6')]},'idField':{'type':Sequelize[_0xf1b1('0x6')]},'nameField':{'type':Sequelize[_0xf1b1('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xf1b1('0x6')]}};
\ No newline at end of file
index 4d888f9..8f86355 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x63c6=['attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','catch','show','params','find','create','body','update','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','fs-extra','lodash','jsforce','desk.js','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','sendStatus','status','end','undefined','offset','count','limit','Content-Range','json','reject','then','destroy','error','name','index','map','VtigerField','rawAttributes','fieldName','type','key','model','query','keys','filters'];(function(_0x5a67bd,_0x156565){var _0x3a3bc0=function(_0x5215c9){while(--_0x5215c9){_0x5a67bd['push'](_0x5a67bd['shift']());}};_0x3a3bc0(++_0x156565);}(_0x63c6,0xf2));var _0x663c=function(_0x332833,_0x2cf214){_0x332833=_0x332833-0x0;var _0x4ed639=_0x63c6[_0x332833];return _0x4ed639;};'use strict';var emlformat=require(_0x663c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x663c('0x1'));var jsonpatch=require(_0x663c('0x2'));var rp=require(_0x663c('0x3'));var moment=require('moment');var BPromise=require(_0x663c('0x4'));var Mustache=require(_0x663c('0x5'));var util=require(_0x663c('0x6'));var path=require(_0x663c('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x663c('0x8'));var _=require(_0x663c('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x663c('0xa'));var deskjs=require(_0x663c('0xb'));var toCsv=require(_0x663c('0xc'));var querystring=require(_0x663c('0xd'));var Papa=require(_0x663c('0xe'));var Redis=require(_0x663c('0xf'));var authService=require(_0x663c('0x10'));var qs=require(_0x663c('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x663c('0x12'));var logger=require(_0x663c('0x13'))(_0x663c('0x14'));var utils=require(_0x663c('0x15'));var config=require(_0x663c('0x16'));var licenseUtil=require(_0x663c('0x17'));var db=require(_0x663c('0x18'))['db'];function respondWithStatusCode(_0x268532,_0x2de415){_0x2de415=_0x2de415||0xcc;return function(_0x1c28a0){if(_0x1c28a0){return _0x268532[_0x663c('0x19')](_0x2de415);}return _0x268532[_0x663c('0x1a')](_0x2de415)[_0x663c('0x1b')]();};}function respondWithResult(_0x1a546f,_0x606f9e){_0x606f9e=_0x606f9e||0xc8;return function(_0x8ee5f3){if(_0x8ee5f3){return _0x1a546f['status'](_0x606f9e)['json'](_0x8ee5f3);}};}function respondWithFilteredResult(_0x14c1f0,_0x36006d){return function(_0x5beb62){if(_0x5beb62){var _0x19cd42=typeof _0x36006d['offset']===_0x663c('0x1c')&&typeof _0x36006d['limit']===_0x663c('0x1c');var _0x3052d4=_0x5beb62['count'];var _0xa79f67=_0x19cd42?0x0:_0x36006d[_0x663c('0x1d')];var _0x564892=_0x19cd42?_0x5beb62[_0x663c('0x1e')]:_0x36006d[_0x663c('0x1d')]+_0x36006d[_0x663c('0x1f')];var _0x4be3bc;if(_0x564892>=_0x3052d4){_0x564892=_0x3052d4;_0x4be3bc=0xc8;}else{_0x4be3bc=0xce;}_0x14c1f0[_0x663c('0x1a')](_0x4be3bc);return _0x14c1f0['set'](_0x663c('0x20'),_0xa79f67+'-'+_0x564892+'/'+_0x3052d4)[_0x663c('0x21')](_0x5beb62);}return null;};}function patchUpdates(_0x34b5f2){return function(_0x114117){try{jsonpatch['apply'](_0x114117,_0x34b5f2,!![]);}catch(_0x484221){return BPromise[_0x663c('0x22')](_0x484221);}return _0x114117['save']();};}function saveUpdates(_0x36cb5d,_0x269e4d){return function(_0x1c1c40){if(_0x1c1c40){return _0x1c1c40['update'](_0x36cb5d)[_0x663c('0x23')](function(_0x2fcee6){return _0x2fcee6;});}return null;};}function removeEntity(_0x5f5106,_0x1bc735){return function(_0x49e306){if(_0x49e306){return _0x49e306[_0x663c('0x24')]()[_0x663c('0x23')](function(){_0x5f5106[_0x663c('0x1a')](0xcc)[_0x663c('0x1b')]();});}};}function handleEntityNotFound(_0x278848,_0x1c28a9){return function(_0x4e92ca){if(!_0x4e92ca){_0x278848['sendStatus'](0x194);}return _0x4e92ca;};}function handleError(_0xdf1088,_0x45dc5b){_0x45dc5b=_0x45dc5b||0x1f4;return function(_0x320b8c){logger[_0x663c('0x25')](_0x320b8c['stack']);if(_0x320b8c[_0x663c('0x26')]){delete _0x320b8c[_0x663c('0x26')];}_0xdf1088[_0x663c('0x1a')](_0x45dc5b)['send'](_0x320b8c);};}exports[_0x663c('0x27')]=function(_0x419c53,_0x2bf552){var _0x45098f={},_0x2a3d98={},_0x1303b9={'count':0x0,'rows':[]};var _0x237638=_[_0x663c('0x28')](db[_0x663c('0x29')][_0x663c('0x2a')],function(_0x28fabd){return{'name':_0x28fabd[_0x663c('0x2b')],'type':_0x28fabd[_0x663c('0x2c')][_0x663c('0x2d')]};});_0x2a3d98[_0x663c('0x2e')]=_['map'](_0x237638,_0x663c('0x26'));_0x2a3d98[_0x663c('0x2f')]=_[_0x663c('0x30')](_0x419c53[_0x663c('0x2f')]);_0x2a3d98[_0x663c('0x31')]=_['intersection'](_0x2a3d98[_0x663c('0x2e')],_0x2a3d98[_0x663c('0x2f')]);_0x45098f[_0x663c('0x32')]=_[_0x663c('0x33')](_0x2a3d98['model'],qs[_0x663c('0x34')](_0x419c53[_0x663c('0x2f')][_0x663c('0x34')]));_0x45098f[_0x663c('0x32')]=_0x45098f[_0x663c('0x32')][_0x663c('0x35')]?_0x45098f[_0x663c('0x32')]:_0x2a3d98['model'];if(!_0x419c53[_0x663c('0x2f')][_0x663c('0x36')](_0x663c('0x37'))){_0x45098f[_0x663c('0x1f')]=qs[_0x663c('0x1f')](_0x419c53[_0x663c('0x2f')][_0x663c('0x1f')]);_0x45098f[_0x663c('0x1d')]=qs['offset'](_0x419c53['query'][_0x663c('0x1d')]);}_0x45098f[_0x663c('0x38')]=qs[_0x663c('0x39')](_0x419c53['query'][_0x663c('0x39')]);_0x45098f[_0x663c('0x3a')]=qs[_0x663c('0x31')](_[_0x663c('0x3b')](_0x419c53[_0x663c('0x2f')],_0x2a3d98[_0x663c('0x31')]),_0x237638);if(_0x419c53['query'][_0x663c('0x3c')]){_0x45098f[_0x663c('0x3a')]=_[_0x663c('0x3d')](_0x45098f[_0x663c('0x3a')],{'$or':_[_0x663c('0x28')](_0x237638,function(_0x309a99){if(_0x309a99[_0x663c('0x2c')]!==_0x663c('0x3e')){var _0x3c8ea6={};_0x3c8ea6[_0x309a99[_0x663c('0x26')]]={'$like':'%'+_0x419c53[_0x663c('0x2f')][_0x663c('0x3c')]+'%'};return _0x3c8ea6;}})});}_0x45098f=_[_0x663c('0x3d')]({},_0x45098f,_0x419c53['options']);var _0x57aeb7={'where':_0x45098f[_0x663c('0x3a')]};return db[_0x663c('0x29')][_0x663c('0x1e')](_0x57aeb7)[_0x663c('0x23')](function(_0x297783){_0x1303b9[_0x663c('0x1e')]=_0x297783;if(_0x419c53['query'][_0x663c('0x3f')]){_0x45098f[_0x663c('0x40')]=[{'all':!![]}];}return db[_0x663c('0x29')][_0x663c('0x41')](_0x45098f);})['then'](function(_0x115455){_0x1303b9['rows']=_0x115455;return _0x1303b9;})['then'](respondWithFilteredResult(_0x2bf552,_0x45098f))[_0x663c('0x42')](handleError(_0x2bf552,null));};exports[_0x663c('0x43')]=function(_0x16ee34,_0x177400){var _0x2cf18e={'raw':!![],'where':{'id':_0x16ee34[_0x663c('0x44')]['id']}},_0x5e5276={};_0x5e5276[_0x663c('0x2e')]=_[_0x663c('0x30')](db[_0x663c('0x29')]['rawAttributes']);_0x5e5276[_0x663c('0x2f')]=_[_0x663c('0x30')](_0x16ee34[_0x663c('0x2f')]);_0x5e5276['filters']=_[_0x663c('0x33')](_0x5e5276[_0x663c('0x2e')],_0x5e5276[_0x663c('0x2f')]);_0x2cf18e[_0x663c('0x32')]=_[_0x663c('0x33')](_0x5e5276['model'],qs['fields'](_0x16ee34[_0x663c('0x2f')][_0x663c('0x34')]));_0x2cf18e[_0x663c('0x32')]=_0x2cf18e[_0x663c('0x32')]['length']?_0x2cf18e[_0x663c('0x32')]:_0x5e5276[_0x663c('0x2e')];if(_0x16ee34['query'][_0x663c('0x3f')]){_0x2cf18e['include']=[{'all':!![]}];}_0x2cf18e=_[_0x663c('0x3d')]({},_0x2cf18e,_0x16ee34['options']);return db[_0x663c('0x29')][_0x663c('0x45')](_0x2cf18e)[_0x663c('0x23')](handleEntityNotFound(_0x177400,null))[_0x663c('0x23')](respondWithResult(_0x177400,null))['catch'](handleError(_0x177400,null));};exports[_0x663c('0x46')]=function(_0x469619,_0x4c3775){return db[_0x663c('0x29')][_0x663c('0x46')](_0x469619[_0x663c('0x47')],{})[_0x663c('0x23')](respondWithResult(_0x4c3775,0xc9))[_0x663c('0x42')](handleError(_0x4c3775,null));};exports[_0x663c('0x48')]=function(_0x45a598,_0x2f25e9){if(_0x45a598['body']['id']){delete _0x45a598[_0x663c('0x47')]['id'];}return db['VtigerField'][_0x663c('0x45')]({'where':{'id':_0x45a598[_0x663c('0x44')]['id']}})['then'](handleEntityNotFound(_0x2f25e9,null))[_0x663c('0x23')](saveUpdates(_0x45a598['body'],null))[_0x663c('0x23')](respondWithResult(_0x2f25e9,null))[_0x663c('0x42')](handleError(_0x2f25e9,null));};exports[_0x663c('0x24')]=function(_0x4eb01a,_0x5dac5a){return db[_0x663c('0x29')][_0x663c('0x45')]({'where':{'id':_0x4eb01a[_0x663c('0x44')]['id']}})['then'](handleEntityNotFound(_0x5dac5a,null))[_0x663c('0x23')](removeEntity(_0x5dac5a,null))[_0x663c('0x42')](handleError(_0x5dac5a,null));};
\ No newline at end of file
+var _0xeccc=['includeAll','include','findAll','rows','catch','show','rawAttributes','create','body','find','params','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','stack','name','send','fieldName','type','key','model','map','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','VtigerField'];(function(_0x495b3d,_0x4d3da4){var _0x4cb329=function(_0xdef9f0){while(--_0xdef9f0){_0x495b3d['push'](_0x495b3d['shift']());}};_0x4cb329(++_0x4d3da4);}(_0xeccc,0x147));var _0xcecc=function(_0x2d10f7,_0x36abd0){_0x2d10f7=_0x2d10f7-0x0;var _0x94c2f7=_0xeccc[_0x2d10f7];return _0x94c2f7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcecc('0x0'));var zipdir=require(_0xcecc('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xcecc('0x2'));var BPromise=require(_0xcecc('0x3'));var Mustache=require(_0xcecc('0x4'));var util=require(_0xcecc('0x5'));var path=require(_0xcecc('0x6'));var sox=require(_0xcecc('0x7'));var csv=require(_0xcecc('0x8'));var ejs=require(_0xcecc('0x9'));var fs=require('fs');var fs_extra=require(_0xcecc('0xa'));var _=require('lodash');var squel=require(_0xcecc('0xb'));var crypto=require(_0xcecc('0xc'));var jsforce=require(_0xcecc('0xd'));var deskjs=require(_0xcecc('0xe'));var toCsv=require(_0xcecc('0x8'));var querystring=require(_0xcecc('0xf'));var Papa=require(_0xcecc('0x10'));var Redis=require(_0xcecc('0x11'));var authService=require(_0xcecc('0x12'));var qs=require(_0xcecc('0x13'));var as=require(_0xcecc('0x14'));var hardwareService=require(_0xcecc('0x15'));var logger=require(_0xcecc('0x16'))(_0xcecc('0x17'));var utils=require(_0xcecc('0x18'));var config=require(_0xcecc('0x19'));var licenseUtil=require(_0xcecc('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x18ef86,_0x4f6fbd){_0x4f6fbd=_0x4f6fbd||0xcc;return function(_0x52fb62){if(_0x52fb62){return _0x18ef86[_0xcecc('0x1b')](_0x4f6fbd);}return _0x18ef86[_0xcecc('0x1c')](_0x4f6fbd)[_0xcecc('0x1d')]();};}function respondWithResult(_0x5ae229,_0x2417ff){_0x2417ff=_0x2417ff||0xc8;return function(_0x4e322e){if(_0x4e322e){return _0x5ae229[_0xcecc('0x1c')](_0x2417ff)['json'](_0x4e322e);}};}function respondWithFilteredResult(_0x1541ce,_0x246256){return function(_0x323568){if(_0x323568){var _0x336b8b=typeof _0x246256[_0xcecc('0x1e')]===_0xcecc('0x1f')&&typeof _0x246256[_0xcecc('0x20')]===_0xcecc('0x1f');var _0x323044=_0x323568[_0xcecc('0x21')];var _0x124443=_0x336b8b?0x0:_0x246256['offset'];var _0x5cdcba=_0x336b8b?_0x323568['count']:_0x246256[_0xcecc('0x1e')]+_0x246256[_0xcecc('0x20')];var _0x49884c;if(_0x5cdcba>=_0x323044){_0x5cdcba=_0x323044;_0x49884c=0xc8;}else{_0x49884c=0xce;}_0x1541ce['status'](_0x49884c);return _0x1541ce[_0xcecc('0x22')](_0xcecc('0x23'),_0x124443+'-'+_0x5cdcba+'/'+_0x323044)[_0xcecc('0x24')](_0x323568);}return null;};}function patchUpdates(_0x4aeb89){return function(_0x157ad0){try{jsonpatch[_0xcecc('0x25')](_0x157ad0,_0x4aeb89,!![]);}catch(_0x3c6d31){return BPromise[_0xcecc('0x26')](_0x3c6d31);}return _0x157ad0[_0xcecc('0x27')]();};}function saveUpdates(_0x3ea521,_0x236fc2){return function(_0x8af1f1){if(_0x8af1f1){return _0x8af1f1[_0xcecc('0x28')](_0x3ea521)[_0xcecc('0x29')](function(_0x4287da){return _0x4287da;});}return null;};}function removeEntity(_0x21da89,_0x40bc7d){return function(_0x22ab34){if(_0x22ab34){return _0x22ab34[_0xcecc('0x2a')]()['then'](function(){_0x21da89[_0xcecc('0x1c')](0xcc)[_0xcecc('0x1d')]();});}};}function handleEntityNotFound(_0x5c7b79,_0x4a6289){return function(_0x3f8ec4){if(!_0x3f8ec4){_0x5c7b79[_0xcecc('0x1b')](0x194);}return _0x3f8ec4;};}function handleError(_0x1f14e1,_0x8624ca){_0x8624ca=_0x8624ca||0x1f4;return function(_0x5113ab){logger['error'](_0x5113ab[_0xcecc('0x2b')]);if(_0x5113ab[_0xcecc('0x2c')]){delete _0x5113ab[_0xcecc('0x2c')];}_0x1f14e1[_0xcecc('0x1c')](_0x8624ca)[_0xcecc('0x2d')](_0x5113ab);};}exports['index']=function(_0x548e6e,_0x47e336){var _0x162be8={},_0x3a4ef2={},_0x199e7c={'count':0x0,'rows':[]};var _0x930bcf=_['map'](db['VtigerField']['rawAttributes'],function(_0x4c03de){return{'name':_0x4c03de[_0xcecc('0x2e')],'type':_0x4c03de[_0xcecc('0x2f')][_0xcecc('0x30')]};});_0x3a4ef2[_0xcecc('0x31')]=_[_0xcecc('0x32')](_0x930bcf,_0xcecc('0x2c'));_0x3a4ef2['query']=_[_0xcecc('0x33')](_0x548e6e[_0xcecc('0x34')]);_0x3a4ef2[_0xcecc('0x35')]=_['intersection'](_0x3a4ef2[_0xcecc('0x31')],_0x3a4ef2['query']);_0x162be8[_0xcecc('0x36')]=_[_0xcecc('0x37')](_0x3a4ef2[_0xcecc('0x31')],qs[_0xcecc('0x38')](_0x548e6e[_0xcecc('0x34')]['fields']));_0x162be8[_0xcecc('0x36')]=_0x162be8['attributes'][_0xcecc('0x39')]?_0x162be8[_0xcecc('0x36')]:_0x3a4ef2['model'];if(!_0x548e6e['query'][_0xcecc('0x3a')](_0xcecc('0x3b'))){_0x162be8['limit']=qs['limit'](_0x548e6e[_0xcecc('0x34')]['limit']);_0x162be8[_0xcecc('0x1e')]=qs['offset'](_0x548e6e[_0xcecc('0x34')]['offset']);}_0x162be8[_0xcecc('0x3c')]=qs[_0xcecc('0x3d')](_0x548e6e[_0xcecc('0x34')][_0xcecc('0x3d')]);_0x162be8[_0xcecc('0x3e')]=qs['filters'](_['pick'](_0x548e6e[_0xcecc('0x34')],_0x3a4ef2[_0xcecc('0x35')]),_0x930bcf);if(_0x548e6e['query'][_0xcecc('0x3f')]){_0x162be8['where']=_[_0xcecc('0x40')](_0x162be8[_0xcecc('0x3e')],{'$or':_[_0xcecc('0x32')](_0x930bcf,function(_0x236afa){if(_0x236afa[_0xcecc('0x2f')]!==_0xcecc('0x41')){var _0x570b5d={};_0x570b5d[_0x236afa[_0xcecc('0x2c')]]={'$like':'%'+_0x548e6e[_0xcecc('0x34')][_0xcecc('0x3f')]+'%'};return _0x570b5d;}})});}_0x162be8=_[_0xcecc('0x40')]({},_0x162be8,_0x548e6e[_0xcecc('0x42')]);var _0x2945be={'where':_0x162be8['where']};return db[_0xcecc('0x43')][_0xcecc('0x21')](_0x2945be)[_0xcecc('0x29')](function(_0xd2f0ee){_0x199e7c['count']=_0xd2f0ee;if(_0x548e6e[_0xcecc('0x34')][_0xcecc('0x44')]){_0x162be8[_0xcecc('0x45')]=[{'all':!![]}];}return db['VtigerField'][_0xcecc('0x46')](_0x162be8);})[_0xcecc('0x29')](function(_0x4dae8e){_0x199e7c[_0xcecc('0x47')]=_0x4dae8e;return _0x199e7c;})[_0xcecc('0x29')](respondWithFilteredResult(_0x47e336,_0x162be8))[_0xcecc('0x48')](handleError(_0x47e336,null));};exports[_0xcecc('0x49')]=function(_0x2803ba,_0xb0afb9){var _0x29feaa={'raw':!![],'where':{'id':_0x2803ba['params']['id']}},_0x464fcc={};_0x464fcc['model']=_[_0xcecc('0x33')](db[_0xcecc('0x43')][_0xcecc('0x4a')]);_0x464fcc[_0xcecc('0x34')]=_[_0xcecc('0x33')](_0x2803ba[_0xcecc('0x34')]);_0x464fcc[_0xcecc('0x35')]=_[_0xcecc('0x37')](_0x464fcc[_0xcecc('0x31')],_0x464fcc[_0xcecc('0x34')]);_0x29feaa[_0xcecc('0x36')]=_[_0xcecc('0x37')](_0x464fcc[_0xcecc('0x31')],qs['fields'](_0x2803ba[_0xcecc('0x34')][_0xcecc('0x38')]));_0x29feaa[_0xcecc('0x36')]=_0x29feaa[_0xcecc('0x36')][_0xcecc('0x39')]?_0x29feaa['attributes']:_0x464fcc[_0xcecc('0x31')];if(_0x2803ba['query'][_0xcecc('0x44')]){_0x29feaa[_0xcecc('0x45')]=[{'all':!![]}];}_0x29feaa=_['merge']({},_0x29feaa,_0x2803ba[_0xcecc('0x42')]);return db[_0xcecc('0x43')]['find'](_0x29feaa)[_0xcecc('0x29')](handleEntityNotFound(_0xb0afb9,null))[_0xcecc('0x29')](respondWithResult(_0xb0afb9,null))[_0xcecc('0x48')](handleError(_0xb0afb9,null));};exports[_0xcecc('0x4b')]=function(_0x1a5f37,_0x403f03){return db[_0xcecc('0x43')][_0xcecc('0x4b')](_0x1a5f37[_0xcecc('0x4c')],{})[_0xcecc('0x29')](respondWithResult(_0x403f03,0xc9))[_0xcecc('0x48')](handleError(_0x403f03,null));};exports['update']=function(_0xdf0800,_0x2f5d40){if(_0xdf0800[_0xcecc('0x4c')]['id']){delete _0xdf0800['body']['id'];}return db['VtigerField'][_0xcecc('0x4d')]({'where':{'id':_0xdf0800[_0xcecc('0x4e')]['id']}})[_0xcecc('0x29')](handleEntityNotFound(_0x2f5d40,null))[_0xcecc('0x29')](saveUpdates(_0xdf0800[_0xcecc('0x4c')],null))[_0xcecc('0x29')](respondWithResult(_0x2f5d40,null))['catch'](handleError(_0x2f5d40,null));};exports['destroy']=function(_0x4e354d,_0x7863b){return db[_0xcecc('0x43')]['find']({'where':{'id':_0x4e354d[_0xcecc('0x4e')]['id']}})[_0xcecc('0x29')](handleEntityNotFound(_0x7863b,null))[_0xcecc('0x29')](removeEntity(_0x7863b,null))[_0xcecc('0x48')](handleError(_0x7863b,null));};
\ No newline at end of file
index 9f85c05..b6b0963 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa95a=['./intVtigerField.attributes','exports','define','VtigerField','int_vtiger_fields','vtiger_unique_index','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x1e381c,_0x47b5b9){var _0x9b5ea9=function(_0x6d2be5){while(--_0x6d2be5){_0x1e381c['push'](_0x1e381c['shift']());}};_0x9b5ea9(++_0x47b5b9);}(_0xa95a,0x9c));var _0xaa95=function(_0xc8a601,_0x1f483e){_0xc8a601=_0xc8a601-0x0;var _0x591aca=_0xa95a[_0xc8a601];return _0x591aca;};'use strict';var _=require(_0xaa95('0x0'));var util=require(_0xaa95('0x1'));var logger=require(_0xaa95('0x2'))(_0xaa95('0x3'));var moment=require(_0xaa95('0x4'));var BPromise=require(_0xaa95('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xaa95('0x6'));var rimraf=require(_0xaa95('0x7'));var config=require(_0xaa95('0x8'));var attributes=require(_0xaa95('0x9'));module[_0xaa95('0xa')]=function(_0x4a4da5,_0x36463f){return _0x4a4da5[_0xaa95('0xb')](_0xaa95('0xc'),attributes,{'tableName':_0xaa95('0xd'),'paranoid':![],'indexes':[{'name':_0xaa95('0xe'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x703c=['moment','request-promise','path','rimraf','../../config/environment','define','VtigerField','int_vtiger_fields','idField','lodash','util','../../config/logger','api'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x703c,0x168));var _0xc703=function(_0x4fd64a,_0x55368b){_0x4fd64a=_0x4fd64a-0x0;var _0x5a3c3f=_0x703c[_0x4fd64a];return _0x5a3c3f;};'use strict';var _=require(_0xc703('0x0'));var util=require(_0xc703('0x1'));var logger=require(_0xc703('0x2'))(_0xc703('0x3'));var moment=require(_0xc703('0x4'));var BPromise=require('bluebird');var rp=require(_0xc703('0x5'));var fs=require('fs');var path=require(_0xc703('0x6'));var rimraf=require(_0xc703('0x7'));var config=require(_0xc703('0x8'));var attributes=require('./intVtigerField.attributes');module['exports']=function(_0x852740,_0x5ddf2a){return _0x852740[_0xc703('0x9')](_0xc703('0xa'),attributes,{'tableName':_0xc703('0xb'),'paranoid':![],'indexes':[{'name':'vtiger_unique_index','fields':[_0xc703('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 5b0c048..906f01e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfe32=['message','result','catch','moment','bluebird','../../config/logger','rpc','../../config/environment','client','http','then','info','VtigerField,\x20%s,\x20%s','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x40d8d7,_0x30dd5e){var _0x3454cc=function(_0x512c1b){while(--_0x512c1b){_0x40d8d7['push'](_0x40d8d7['shift']());}};_0x3454cc(++_0x30dd5e);}(_0xfe32,0xed));var _0x2fe3=function(_0x4f0323,_0x3f1469){_0x4f0323=_0x4f0323-0x0;var _0x315bb3=_0xfe32[_0x4f0323];return _0x315bb3;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x2fe3('0x0'));var BPromise=require(_0x2fe3('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x2fe3('0x2'))(_0x2fe3('0x3'));var config=require(_0x2fe3('0x4'));var jayson=require('jayson/promise');var client=jayson[_0x2fe3('0x5')][_0x2fe3('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x228dd6,_0x1698b4,_0x1137d4){return new BPromise(function(_0x34250b,_0x4a3df5){return client['request'](_0x228dd6,_0x1137d4)[_0x2fe3('0x7')](function(_0x1e0cef){logger[_0x2fe3('0x8')](_0x2fe3('0x9'),_0x1698b4,_0x2fe3('0xa'));logger[_0x2fe3('0xb')](_0x2fe3('0xc'),_0x1698b4,'request\x20sent',JSON[_0x2fe3('0xd')](_0x1e0cef));if(_0x1e0cef[_0x2fe3('0xe')]){if(_0x1e0cef[_0x2fe3('0xe')]['code']===0x1f4){logger[_0x2fe3('0xe')](_0x2fe3('0x9'),_0x1698b4,_0x1e0cef[_0x2fe3('0xe')][_0x2fe3('0xf')]);return _0x4a3df5(_0x1e0cef[_0x2fe3('0xe')][_0x2fe3('0xf')]);}logger[_0x2fe3('0xe')]('VtigerField,\x20%s,\x20%s',_0x1698b4,_0x1e0cef[_0x2fe3('0xe')][_0x2fe3('0xf')]);return _0x34250b(_0x1e0cef['error'][_0x2fe3('0xf')]);}else{logger[_0x2fe3('0x8')](_0x2fe3('0x9'),_0x1698b4,_0x2fe3('0xa'));_0x34250b(_0x1e0cef[_0x2fe3('0x10')][_0x2fe3('0xf')]);}})[_0x2fe3('0x11')](function(_0x39edec){logger[_0x2fe3('0xe')](_0x2fe3('0x9'),_0x1698b4,_0x39edec);_0x4a3df5(_0x39edec);});});}
\ No newline at end of file
+var _0x19e6=['jayson/promise','client','http','then','info','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','code','VtigerField,\x20%s,\x20%s','message','result','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x4247e5,_0x30b7bb){var _0x5ee3d5=function(_0x5056cd){while(--_0x5056cd){_0x4247e5['push'](_0x4247e5['shift']());}};_0x5ee3d5(++_0x30b7bb);}(_0x19e6,0x1ac));var _0x619e=function(_0x51e206,_0x1cdc2d){_0x51e206=_0x51e206-0x0;var _0x44b6f8=_0x19e6[_0x51e206];return _0x44b6f8;};'use strict';var _=require(_0x619e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x619e('0x1'));var rs=require(_0x619e('0x2'));var fs=require('fs');var Redis=require(_0x619e('0x3'));var db=require(_0x619e('0x4'))['db'];var utils=require(_0x619e('0x5'));var logger=require(_0x619e('0x6'))(_0x619e('0x7'));var config=require(_0x619e('0x8'));var jayson=require(_0x619e('0x9'));var client=jayson[_0x619e('0xa')][_0x619e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x249a59,_0x36dd9a,_0x3b76c3){return new BPromise(function(_0x590c10,_0x2be90e){return client['request'](_0x249a59,_0x3b76c3)[_0x619e('0xc')](function(_0xb964c9){logger[_0x619e('0xd')]('VtigerField,\x20%s,\x20%s',_0x36dd9a,_0x619e('0xe'));logger[_0x619e('0xf')](_0x619e('0x10'),_0x36dd9a,_0x619e('0xe'),JSON[_0x619e('0x11')](_0xb964c9));if(_0xb964c9[_0x619e('0x12')]){if(_0xb964c9[_0x619e('0x12')][_0x619e('0x13')]===0x1f4){logger['error'](_0x619e('0x14'),_0x36dd9a,_0xb964c9[_0x619e('0x12')][_0x619e('0x15')]);return _0x2be90e(_0xb964c9['error'][_0x619e('0x15')]);}logger[_0x619e('0x12')]('VtigerField,\x20%s,\x20%s',_0x36dd9a,_0xb964c9['error'][_0x619e('0x15')]);return _0x590c10(_0xb964c9[_0x619e('0x12')]['message']);}else{logger[_0x619e('0xd')](_0x619e('0x14'),_0x36dd9a,'request\x20sent');_0x590c10(_0xb964c9[_0x619e('0x16')][_0x619e('0x15')]);}})['catch'](function(_0x554a4b){logger[_0x619e('0x12')]('VtigerField,\x20%s,\x20%s',_0x36dd9a,_0x554a4b);_0x2be90e(_0x554a4b);});});}
\ No newline at end of file
index b7d92ce..959a47f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0d3b=['addConfiguration','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','getFields','post'];(function(_0x2ff834,_0x24114d){var _0x11e954=function(_0xabc669){while(--_0xabc669){_0x2ff834['push'](_0x2ff834['shift']());}};_0x11e954(++_0x24114d);}(_0x0d3b,0xf0));var _0xb0d3=function(_0x2454b5,_0x2a3a9a){_0x2454b5=_0x2454b5-0x0;var _0xf63504=_0x0d3b[_0x2454b5];return _0xf63504;};'use strict';var multer=require(_0xb0d3('0x0'));var util=require(_0xb0d3('0x1'));var path=require(_0xb0d3('0x2'));var timeout=require(_0xb0d3('0x3'));var express=require(_0xb0d3('0x4'));var router=express[_0xb0d3('0x5')]();var fs_extra=require(_0xb0d3('0x6'));var auth=require(_0xb0d3('0x7'));var interaction=require(_0xb0d3('0x8'));var config=require(_0xb0d3('0x9'));var controller=require(_0xb0d3('0xa'));router[_0xb0d3('0xb')]('/',auth[_0xb0d3('0xc')](),controller[_0xb0d3('0xd')]);router['get'](_0xb0d3('0xe'),auth[_0xb0d3('0xc')](),controller[_0xb0d3('0xf')]);router[_0xb0d3('0xb')](_0xb0d3('0x10'),auth['isAuthenticated'](),controller[_0xb0d3('0x11')]);router['get']('/:id/fields',auth[_0xb0d3('0xc')](),controller[_0xb0d3('0x12')]);router[_0xb0d3('0x13')]('/',auth[_0xb0d3('0xc')](),controller['create']);router['post'](_0xb0d3('0x10'),auth['isAuthenticated'](),controller[_0xb0d3('0x14')]);router[_0xb0d3('0x15')]('/:id',auth[_0xb0d3('0xc')](),controller[_0xb0d3('0x16')]);router[_0xb0d3('0x17')](_0xb0d3('0xe'),auth['isAuthenticated'](),controller[_0xb0d3('0x18')]);module[_0xb0d3('0x19')]=router;
\ No newline at end of file
+var _0x5302=['../../components/interaction/service','./intZendeskAccount.controller','get','isAuthenticated','index','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','/:id','update','delete','destroy','path','connect-timeout','fs-extra'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x5302,0x1b5));var _0x2530=function(_0x125666,_0x3b928c){_0x125666=_0x125666-0x0;var _0x1e52be=_0x5302[_0x125666];return _0x1e52be;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x2530('0x0'));var timeout=require(_0x2530('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x2530('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x2530('0x3'));var config=require('../../config/environment');var controller=require(_0x2530('0x4'));router[_0x2530('0x5')]('/',auth[_0x2530('0x6')](),controller[_0x2530('0x7')]);router[_0x2530('0x5')]('/:id',auth[_0x2530('0x6')](),controller[_0x2530('0x8')]);router[_0x2530('0x5')](_0x2530('0x9'),auth[_0x2530('0x6')](),controller[_0x2530('0xa')]);router[_0x2530('0x5')](_0x2530('0xb'),auth[_0x2530('0x6')](),controller[_0x2530('0xc')]);router[_0x2530('0xd')]('/',auth[_0x2530('0x6')](),controller[_0x2530('0xe')]);router[_0x2530('0xd')](_0x2530('0x9'),auth[_0x2530('0x6')](),controller[_0x2530('0xf')]);router['put'](_0x2530('0x10'),auth[_0x2530('0x6')](),controller[_0x2530('0x11')]);router[_0x2530('0x12')](_0x2530('0x10'),auth[_0x2530('0x6')](),controller[_0x2530('0x13')]);module['exports']=router;
\ No newline at end of file
index dde267f..7d89ca1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0650=['password','integrationTab','sequelize','exports','STRING','username','remoteUri','ENUM'];(function(_0x3a480a,_0x73e02b){var _0x4d48f4=function(_0x4e0184){while(--_0x4e0184){_0x3a480a['push'](_0x3a480a['shift']());}};_0x4d48f4(++_0x73e02b);}(_0x0650,0x1aa));var _0x0065=function(_0x556b28,_0x46061b){_0x556b28=_0x556b28-0x0;var _0x23bfc1=_0x0650[_0x556b28];return _0x23bfc1;};'use strict';var Sequelize=require(_0x0065('0x0'));module[_0x0065('0x1')]={'name':{'type':Sequelize[_0x0065('0x2')]},'description':{'type':Sequelize[_0x0065('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0x0065('0x3')},'password':{'type':Sequelize['STRING']},'token':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x0065('0x2')],'unique':_0x0065('0x4')},'authType':{'type':Sequelize[_0x0065('0x5')]('password','token'),'defaultValue':_0x0065('0x6')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM']('integrationTab','newTab'),'defaultValue':_0x0065('0x7')}};
\ No newline at end of file
+var _0x4489=['exports','STRING','username','token','integrationTab','newTab','sequelize'];(function(_0x144049,_0x4e6ccf){var _0x517caa=function(_0x7416b8){while(--_0x7416b8){_0x144049['push'](_0x144049['shift']());}};_0x517caa(++_0x4e6ccf);}(_0x4489,0x164));var _0x9448=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4489[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x9448('0x0'));module[_0x9448('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x9448('0x2')]},'username':{'type':Sequelize[_0x9448('0x2')],'unique':_0x9448('0x3')},'password':{'type':Sequelize[_0x9448('0x2')]},'token':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'authType':{'type':Sequelize['ENUM']('password',_0x9448('0x4')),'defaultValue':'password'},'serverUrl':{'type':Sequelize[_0x9448('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x9448('0x5'),_0x9448('0x6')),'defaultValue':_0x9448('0x5')}};
\ No newline at end of file
index fceb911..3dc7417 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4fc2=['addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZendeskField','getFields','username','token','authType','remoteUri','slice','substring','lastIndexOf','format','ticket_fields','password','headers','Basic\x20%s','%s:%s','toString','base64','Sequelize','Unknown\x20authentication\x20type','subject','description','remove','position','title','system_field_options','statusCode','error','stringify','test','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','destroy','stack','name','send','index','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','ZendeskAccount','includeAll','findAll','rows','show','params','rawAttributes','include','find','catch','create','body','update','getConfigurations','findOne','ZendeskConfiguration'];(function(_0x791c33,_0x1c3110){var _0x4b270e=function(_0x1a521f){while(--_0x1a521f){_0x791c33['push'](_0x791c33['shift']());}};_0x4b270e(++_0x1c3110);}(_0x4fc2,0x111));var _0x24fc=function(_0x3d0ffa,_0x2c71a7){_0x3d0ffa=_0x3d0ffa-0x0;var _0x249d3b=_0x4fc2[_0x3d0ffa];return _0x249d3b;};'use strict';var emlformat=require(_0x24fc('0x0'));var rimraf=require(_0x24fc('0x1'));var zipdir=require(_0x24fc('0x2'));var jsonpatch=require(_0x24fc('0x3'));var rp=require('request-promise');var moment=require(_0x24fc('0x4'));var BPromise=require(_0x24fc('0x5'));var Mustache=require(_0x24fc('0x6'));var util=require('util');var path=require(_0x24fc('0x7'));var sox=require(_0x24fc('0x8'));var csv=require('to-csv');var ejs=require(_0x24fc('0x9'));var fs=require('fs');var fs_extra=require(_0x24fc('0xa'));var _=require('lodash');var squel=require(_0x24fc('0xb'));var crypto=require(_0x24fc('0xc'));var jsforce=require(_0x24fc('0xd'));var deskjs=require(_0x24fc('0xe'));var toCsv=require(_0x24fc('0xf'));var querystring=require(_0x24fc('0x10'));var Papa=require('papaparse');var Redis=require(_0x24fc('0x11'));var authService=require(_0x24fc('0x12'));var qs=require(_0x24fc('0x13'));var as=require(_0x24fc('0x14'));var hardwareService=require(_0x24fc('0x15'));var logger=require(_0x24fc('0x16'))(_0x24fc('0x17'));var utils=require(_0x24fc('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x24fc('0x19'));var db=require(_0x24fc('0x1a'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x306873,_0x76cb25){_0x76cb25=_0x76cb25||0xcc;return function(_0x3f6d8b){if(_0x3f6d8b){return _0x306873[_0x24fc('0x1b')](_0x76cb25);}return _0x306873[_0x24fc('0x1c')](_0x76cb25)[_0x24fc('0x1d')]();};}function respondWithResult(_0x537b5c,_0x2a0971){_0x2a0971=_0x2a0971||0xc8;return function(_0x18c0a7){if(_0x18c0a7){return _0x537b5c[_0x24fc('0x1c')](_0x2a0971)[_0x24fc('0x1e')](_0x18c0a7);}};}function respondWithFilteredResult(_0x4acd36,_0x2ac989){return function(_0x588543){if(_0x588543){var _0x4af098=typeof _0x2ac989[_0x24fc('0x1f')]===_0x24fc('0x20')&&typeof _0x2ac989[_0x24fc('0x21')]===_0x24fc('0x20');var _0x52a884=_0x588543[_0x24fc('0x22')];var _0x1cb3d0=_0x4af098?0x0:_0x2ac989[_0x24fc('0x1f')];var _0x8ac114=_0x4af098?_0x588543['count']:_0x2ac989[_0x24fc('0x1f')]+_0x2ac989[_0x24fc('0x21')];var _0x304881;if(_0x8ac114>=_0x52a884){_0x8ac114=_0x52a884;_0x304881=0xc8;}else{_0x304881=0xce;}_0x4acd36['status'](_0x304881);return _0x4acd36[_0x24fc('0x23')](_0x24fc('0x24'),_0x1cb3d0+'-'+_0x8ac114+'/'+_0x52a884)[_0x24fc('0x1e')](_0x588543);}return null;};}function patchUpdates(_0x2d0e3d){return function(_0x49a0ba){try{jsonpatch[_0x24fc('0x25')](_0x49a0ba,_0x2d0e3d,!![]);}catch(_0x545939){return BPromise[_0x24fc('0x26')](_0x545939);}return _0x49a0ba['save']();};}function saveUpdates(_0x3ed464,_0x44c121){return function(_0x2ffade){if(_0x2ffade){return _0x2ffade['update'](_0x3ed464)[_0x24fc('0x27')](function(_0x552035){return _0x552035;});}return null;};}function removeEntity(_0x35a9c7,_0x2bb93a){return function(_0x36a9b4){if(_0x36a9b4){return _0x36a9b4[_0x24fc('0x28')]()[_0x24fc('0x27')](function(){_0x35a9c7[_0x24fc('0x1c')](0xcc)[_0x24fc('0x1d')]();});}};}function handleEntityNotFound(_0x20192b,_0x168d98){return function(_0x2a5c4b){if(!_0x2a5c4b){_0x20192b['sendStatus'](0x194);}return _0x2a5c4b;};}function handleError(_0x11c913,_0x16f27f){_0x16f27f=_0x16f27f||0x1f4;return function(_0x3ee302){logger['error'](_0x3ee302[_0x24fc('0x29')]);if(_0x3ee302[_0x24fc('0x2a')]){delete _0x3ee302[_0x24fc('0x2a')];}_0x11c913[_0x24fc('0x1c')](_0x16f27f)[_0x24fc('0x2b')](_0x3ee302);};}exports[_0x24fc('0x2c')]=function(_0x5ac1f2,_0x240ae7){var _0x29a461={},_0x3c99ed={},_0x1c5146={'count':0x0,'rows':[]};var _0x9f7bbc=_['map'](db['ZendeskAccount']['rawAttributes'],function(_0x3df6f4){return{'name':_0x3df6f4['fieldName'],'type':_0x3df6f4[_0x24fc('0x2d')][_0x24fc('0x2e')]};});_0x3c99ed[_0x24fc('0x2f')]=_[_0x24fc('0x30')](_0x9f7bbc,'name');_0x3c99ed[_0x24fc('0x31')]=_[_0x24fc('0x32')](_0x5ac1f2['query']);_0x3c99ed[_0x24fc('0x33')]=_[_0x24fc('0x34')](_0x3c99ed['model'],_0x3c99ed['query']);_0x29a461[_0x24fc('0x35')]=_['intersection'](_0x3c99ed[_0x24fc('0x2f')],qs[_0x24fc('0x36')](_0x5ac1f2['query'][_0x24fc('0x36')]));_0x29a461[_0x24fc('0x35')]=_0x29a461[_0x24fc('0x35')][_0x24fc('0x37')]?_0x29a461[_0x24fc('0x35')]:_0x3c99ed[_0x24fc('0x2f')];if(!_0x5ac1f2[_0x24fc('0x31')][_0x24fc('0x38')](_0x24fc('0x39'))){_0x29a461['limit']=qs[_0x24fc('0x21')](_0x5ac1f2[_0x24fc('0x31')][_0x24fc('0x21')]);_0x29a461[_0x24fc('0x1f')]=qs[_0x24fc('0x1f')](_0x5ac1f2['query']['offset']);}_0x29a461[_0x24fc('0x3a')]=qs['sort'](_0x5ac1f2[_0x24fc('0x31')][_0x24fc('0x3b')]);_0x29a461[_0x24fc('0x3c')]=qs[_0x24fc('0x33')](_['pick'](_0x5ac1f2[_0x24fc('0x31')],_0x3c99ed['filters']),_0x9f7bbc);if(_0x5ac1f2[_0x24fc('0x31')][_0x24fc('0x3d')]){_0x29a461[_0x24fc('0x3c')]=_[_0x24fc('0x3e')](_0x29a461[_0x24fc('0x3c')],{'$or':_['map'](_0x9f7bbc,function(_0xadedb4){if(_0xadedb4[_0x24fc('0x2d')]!==_0x24fc('0x3f')){var _0x22a75c={};_0x22a75c[_0xadedb4['name']]={'$like':'%'+_0x5ac1f2[_0x24fc('0x31')][_0x24fc('0x3d')]+'%'};return _0x22a75c;}})});}_0x29a461=_['merge']({},_0x29a461,_0x5ac1f2[_0x24fc('0x40')]);var _0x52df2e={'where':_0x29a461[_0x24fc('0x3c')]};return db[_0x24fc('0x41')][_0x24fc('0x22')](_0x52df2e)[_0x24fc('0x27')](function(_0x431189){_0x1c5146[_0x24fc('0x22')]=_0x431189;if(_0x5ac1f2[_0x24fc('0x31')][_0x24fc('0x42')]){_0x29a461['include']=[{'all':!![]}];}return db[_0x24fc('0x41')][_0x24fc('0x43')](_0x29a461);})[_0x24fc('0x27')](function(_0x4fee9f){_0x1c5146[_0x24fc('0x44')]=_0x4fee9f;return _0x1c5146;})[_0x24fc('0x27')](respondWithFilteredResult(_0x240ae7,_0x29a461))['catch'](handleError(_0x240ae7,null));};exports[_0x24fc('0x45')]=function(_0x22f30b,_0x2c598c){var _0x5e4e9b={'raw':![],'where':{'id':_0x22f30b[_0x24fc('0x46')]['id']}},_0x31ddd0={};_0x31ddd0['model']=_[_0x24fc('0x32')](db[_0x24fc('0x41')][_0x24fc('0x47')]);_0x31ddd0[_0x24fc('0x31')]=_['keys'](_0x22f30b[_0x24fc('0x31')]);_0x31ddd0[_0x24fc('0x33')]=_[_0x24fc('0x34')](_0x31ddd0[_0x24fc('0x2f')],_0x31ddd0[_0x24fc('0x31')]);_0x5e4e9b['attributes']=_[_0x24fc('0x34')](_0x31ddd0[_0x24fc('0x2f')],qs[_0x24fc('0x36')](_0x22f30b[_0x24fc('0x31')]['fields']));_0x5e4e9b[_0x24fc('0x35')]=_0x5e4e9b[_0x24fc('0x35')]['length']?_0x5e4e9b['attributes']:_0x31ddd0[_0x24fc('0x2f')];if(_0x22f30b['query']['includeAll']){_0x5e4e9b[_0x24fc('0x48')]=[{'all':!![]}];}_0x5e4e9b=_['merge']({},_0x5e4e9b,_0x22f30b[_0x24fc('0x40')]);return db[_0x24fc('0x41')][_0x24fc('0x49')](_0x5e4e9b)['then'](handleEntityNotFound(_0x2c598c,null))[_0x24fc('0x27')](respondWithResult(_0x2c598c,null))[_0x24fc('0x4a')](handleError(_0x2c598c,null));};exports[_0x24fc('0x4b')]=function(_0x1ad8d6,_0x39873d){return db[_0x24fc('0x41')][_0x24fc('0x4b')](_0x1ad8d6[_0x24fc('0x4c')],{})['then'](respondWithResult(_0x39873d,0xc9))['catch'](handleError(_0x39873d,null));};exports[_0x24fc('0x4d')]=function(_0x2f1a99,_0x12e9f7){if(_0x2f1a99['body']['id']){delete _0x2f1a99['body']['id'];}return db[_0x24fc('0x41')][_0x24fc('0x49')]({'where':{'id':_0x2f1a99[_0x24fc('0x46')]['id']}})[_0x24fc('0x27')](handleEntityNotFound(_0x12e9f7,null))[_0x24fc('0x27')](saveUpdates(_0x2f1a99[_0x24fc('0x4c')],null))[_0x24fc('0x27')](respondWithResult(_0x12e9f7,null))[_0x24fc('0x4a')](handleError(_0x12e9f7,null));};exports[_0x24fc('0x28')]=function(_0x4574d3,_0x434700){return db[_0x24fc('0x41')]['find']({'where':{'id':_0x4574d3[_0x24fc('0x46')]['id']}})[_0x24fc('0x27')](handleEntityNotFound(_0x434700,null))[_0x24fc('0x27')](removeEntity(_0x434700,null))[_0x24fc('0x4a')](handleError(_0x434700,null));};exports[_0x24fc('0x4e')]=function(_0x5bdc4d,_0x428012,_0x4bf3a8){var _0x2c8f74={};var _0x2ee445={};var _0x446c14;var _0x41ddfb;return db[_0x24fc('0x41')][_0x24fc('0x4f')]({'where':{'id':_0x5bdc4d['params']['id']}})[_0x24fc('0x27')](handleEntityNotFound(_0x428012,null))[_0x24fc('0x27')](function(_0xc49d9f){if(_0xc49d9f){_0x446c14=_0xc49d9f;_0x2ee445[_0x24fc('0x2f')]=_[_0x24fc('0x32')](db[_0x24fc('0x50')]['rawAttributes']);_0x2ee445[_0x24fc('0x31')]=_[_0x24fc('0x32')](_0x5bdc4d[_0x24fc('0x31')]);_0x2ee445[_0x24fc('0x33')]=_[_0x24fc('0x34')](_0x2ee445[_0x24fc('0x2f')],_0x2ee445[_0x24fc('0x31')]);_0x2c8f74['attributes']=_[_0x24fc('0x34')](_0x2ee445[_0x24fc('0x2f')],qs['fields'](_0x5bdc4d[_0x24fc('0x31')][_0x24fc('0x36')]));_0x2c8f74[_0x24fc('0x35')]=_0x2c8f74[_0x24fc('0x35')][_0x24fc('0x37')]?_0x2c8f74[_0x24fc('0x35')]:_0x2ee445['model'];_0x2c8f74[_0x24fc('0x3a')]=qs['sort'](_0x5bdc4d[_0x24fc('0x31')][_0x24fc('0x3b')]);_0x2c8f74['where']=qs[_0x24fc('0x33')](_['pick'](_0x5bdc4d[_0x24fc('0x31')],_0x2ee445['filters']));if(_0x5bdc4d[_0x24fc('0x31')][_0x24fc('0x3d')]){_0x2c8f74['where']=_[_0x24fc('0x3e')](_0x2c8f74['where'],{'$or':_[_0x24fc('0x30')](_0x2c8f74[_0x24fc('0x35')],function(_0x59e46e){var _0xd1638f={};_0xd1638f[_0x59e46e]={'$like':'%'+_0x5bdc4d[_0x24fc('0x31')][_0x24fc('0x3d')]+'%'};return _0xd1638f;})});}_0x2c8f74=_[_0x24fc('0x3e')]({},_0x2c8f74,_0x5bdc4d[_0x24fc('0x40')]);return _0x446c14['getConfigurations'](_0x2c8f74);}})[_0x24fc('0x27')](function(_0x2f62b0){if(_0x2f62b0){_0x41ddfb=_0x2f62b0[_0x24fc('0x37')];if(!_0x5bdc4d[_0x24fc('0x31')][_0x24fc('0x38')]('nolimit')){_0x2c8f74['limit']=qs[_0x24fc('0x21')](_0x5bdc4d[_0x24fc('0x31')]['limit']);_0x2c8f74['offset']=qs[_0x24fc('0x1f')](_0x5bdc4d[_0x24fc('0x31')][_0x24fc('0x1f')]);}return _0x446c14[_0x24fc('0x4e')](_0x2c8f74);}})['then'](function(_0x20973d){if(_0x20973d){return _0x20973d?{'count':_0x41ddfb,'rows':_0x20973d}:null;}})[_0x24fc('0x27')](respondWithResult(_0x428012,null))[_0x24fc('0x4a')](handleError(_0x428012,null));};exports[_0x24fc('0x51')]=function(_0x1df0c4,_0x3e896f,_0x26ac2e){if(_0x1df0c4[_0x24fc('0x4c')]['id']){delete _0x1df0c4[_0x24fc('0x4c')]['id'];}return db[_0x24fc('0x41')][_0x24fc('0x4f')]({'where':{'id':_0x1df0c4[_0x24fc('0x46')]['id']}})[_0x24fc('0x27')](handleEntityNotFound(_0x3e896f,null))[_0x24fc('0x27')](function(_0x354fc6){if(_0x354fc6){_0x1df0c4['body'][_0x24fc('0x52')]=_0x354fc6['id'];_0x1df0c4[_0x24fc('0x4c')][_0x24fc('0x53')]=integrations[_0x24fc('0x54')](_0x1df0c4[_0x24fc('0x4c')][_0x24fc('0x55')],_0x1df0c4[_0x24fc('0x4c')][_0x24fc('0x2d')]);_0x1df0c4['body'][_0x24fc('0x56')]=integrations[_0x24fc('0x57')](_0x1df0c4[_0x24fc('0x4c')][_0x24fc('0x55')],_0x1df0c4['body'][_0x24fc('0x2d')]);return db[_0x24fc('0x50')]['create'](_0x1df0c4['body'],{'include':[{'model':db['ZendeskField'],'as':_0x24fc('0x53')},{'model':db[_0x24fc('0x58')],'as':_0x24fc('0x56')}]});}return null;})[_0x24fc('0x27')](respondWithResult(_0x3e896f,null))[_0x24fc('0x4a')](handleError(_0x3e896f,null));};exports[_0x24fc('0x59')]=function(_0x52e1aa,_0x11bafd,_0x15e8a3){var _0x5a2c09='';return db['ZendeskAccount'][_0x24fc('0x4f')]({'where':{'id':_0x52e1aa[_0x24fc('0x46')]['id']},'attributes':['id',_0x24fc('0x5a'),'password',_0x24fc('0x5b'),_0x24fc('0x5c'),_0x24fc('0x5d')]})['then'](handleEntityNotFound(_0x11bafd,null))['then'](function(_0x4c286d){if(_0x4c286d){_0x5a2c09=_0x4c286d['remoteUri'];var _0x4a1b8e=_0x5a2c09[_0x24fc('0x5e')](-0x1);if(_0x4a1b8e==='/'){_0x5a2c09=_0x5a2c09[_0x24fc('0x5f')](0x0,_0x5a2c09[_0x24fc('0x60')](_0x4a1b8e));}var _0x2a1236={'method':'GET','uri':util[_0x24fc('0x61')]('%s/%s',_0x5a2c09,_0x24fc('0x62')),'json':!![]};switch(_0x4c286d['authType']){case _0x24fc('0x63'):_0x2a1236[_0x24fc('0x64')]={'Authorization':util[_0x24fc('0x61')](_0x24fc('0x65'),new Buffer(util[_0x24fc('0x61')](_0x24fc('0x66'),_0x4c286d[_0x24fc('0x5a')],_0x4c286d['password']))[_0x24fc('0x67')](_0x24fc('0x68')))};break;case _0x24fc('0x5b'):_0x2a1236['headers']={'Authorization':util['format'](_0x24fc('0x65'),new Buffer(util[_0x24fc('0x61')]('%s/token:%s',_0x4c286d[_0x24fc('0x5a')],_0x4c286d[_0x24fc('0x5b')]))['toString'](_0x24fc('0x68')))};break;default:throw new db[(_0x24fc('0x69'))]['ValidationError'](_0x24fc('0x6a'));}return rp(_0x2a1236);}})[_0x24fc('0x27')](function(_0x24e717){if(_0x24e717){var _0x1efe4e=[_0x24fc('0x6b'),_0x24fc('0x6c'),'group','assignee'];_[_0x24fc('0x6d')](_0x24e717['ticket_fields'],function(_0x29bd9f){return _0x1efe4e['includes'](_0x29bd9f['type']);});return{'count':_0x24e717[_0x24fc('0x62')][_0x24fc('0x37')],'rows':_[_0x24fc('0x30')](_0x24e717[_0x24fc('0x62')],function(_0x66de4f){return{'id':_0x66de4f['id'],'name':_0x66de4f[_0x24fc('0x6e')]>0x7?_0x66de4f[_0x24fc('0x6f')]:_0x66de4f[_0x24fc('0x2d')],'custom':_0x66de4f['position']>0x7?!![]:![],'options':_0x66de4f[_0x24fc('0x70')]?_0x66de4f[_0x24fc('0x70')]:_0x66de4f['custom_field_options']?_0x66de4f['custom_field_options']:[]};})};}})[_0x24fc('0x27')](respondWithResult(_0x11bafd,null))[_0x24fc('0x4a')](function(_0x938dcf){var _0x1b2a97=_0x52e1aa[_0x24fc('0x31')]['test']?0x1f4:_0x938dcf[_0x24fc('0x71')]||0x1f4;logger[_0x24fc('0x72')]('getFields,\x20%s,\x20%s,\x20%s',_0x24fc('0x59'),_0x1b2a97,JSON[_0x24fc('0x73')](_0x938dcf));delete _0x938dcf[_0x24fc('0x2a')];if(_0x1b2a97===0x191){_0x1b2a97=0x190;}_0x11bafd['status'](_0x1b2a97)[_0x24fc('0x2b')](_0x52e1aa[_0x24fc('0x31')][_0x24fc('0x74')]?{'message':_0x24fc('0x75'),'statusCode':_0x938dcf[_0x24fc('0x71')]}:_0x938dcf);});};
\ No newline at end of file
+var _0x36ee=['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','end','status','json','offset','undefined','limit','count','set','apply','reject','update','then','destroy','error','name','index','map','ZendeskAccount','fieldName','type','key','model','keys','query','intersection','attributes','fields','hasOwnProperty','order','sort','where','filters','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','getConfigurations','findOne','pick','options','nolimit','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZendeskConfiguration','ZendeskField','getFields','username','token','remoteUri','lastIndexOf','GET','format','%s/%s','ticket_fields','password','headers','Basic\x20%s','%s:%s','toString','base64','Sequelize','ValidationError','Unknown\x20authentication\x20type','subject','description','group','assignee','includes','position','system_field_options','custom_field_options','getFields,\x20%s,\x20%s,\x20%s','stringify','send','test','Wrong\x20credentials','statusCode','zip-dir','request-promise','moment','bluebird'];(function(_0x2d2511,_0x1a5ed5){var _0x5a8ee1=function(_0x13a8a9){while(--_0x13a8a9){_0x2d2511['push'](_0x2d2511['shift']());}};_0x5a8ee1(++_0x1a5ed5);}(_0x36ee,0xe8));var _0xe36e=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x36ee[_0x5b644e];return _0x49c6bf;};'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'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x32981d,_0x27841e){_0x27841e=_0x27841e||0xcc;return function(_0x23abfb){if(_0x23abfb){return _0x32981d[_0xe36e('0x19')](_0x27841e);}return _0x32981d['status'](_0x27841e)[_0xe36e('0x1a')]();};}function respondWithResult(_0x521afa,_0x525155){_0x525155=_0x525155||0xc8;return function(_0x27ff47){if(_0x27ff47){return _0x521afa[_0xe36e('0x1b')](_0x525155)[_0xe36e('0x1c')](_0x27ff47);}};}function respondWithFilteredResult(_0x278135,_0xd6828e){return function(_0x924cd5){if(_0x924cd5){var _0x2096f6=typeof _0xd6828e[_0xe36e('0x1d')]===_0xe36e('0x1e')&&typeof _0xd6828e[_0xe36e('0x1f')]==='undefined';var _0x333554=_0x924cd5[_0xe36e('0x20')];var _0x56c019=_0x2096f6?0x0:_0xd6828e[_0xe36e('0x1d')];var _0x533c06=_0x2096f6?_0x924cd5[_0xe36e('0x20')]:_0xd6828e[_0xe36e('0x1d')]+_0xd6828e['limit'];var _0x472825;if(_0x533c06>=_0x333554){_0x533c06=_0x333554;_0x472825=0xc8;}else{_0x472825=0xce;}_0x278135[_0xe36e('0x1b')](_0x472825);return _0x278135[_0xe36e('0x21')]('Content-Range',_0x56c019+'-'+_0x533c06+'/'+_0x333554)[_0xe36e('0x1c')](_0x924cd5);}return null;};}function patchUpdates(_0x21bcf9){return function(_0x3f0ae3){try{jsonpatch[_0xe36e('0x22')](_0x3f0ae3,_0x21bcf9,!![]);}catch(_0x2c4e30){return BPromise[_0xe36e('0x23')](_0x2c4e30);}return _0x3f0ae3['save']();};}function saveUpdates(_0xd71137,_0x4f214a){return function(_0x23bcf3){if(_0x23bcf3){return _0x23bcf3[_0xe36e('0x24')](_0xd71137)[_0xe36e('0x25')](function(_0x53e13a){return _0x53e13a;});}return null;};}function removeEntity(_0x598a7a,_0x4749a8){return function(_0x10818d){if(_0x10818d){return _0x10818d[_0xe36e('0x26')]()[_0xe36e('0x25')](function(){_0x598a7a[_0xe36e('0x1b')](0xcc)[_0xe36e('0x1a')]();});}};}function handleEntityNotFound(_0x1a045c,_0x5ac484){return function(_0x3cafbf){if(!_0x3cafbf){_0x1a045c[_0xe36e('0x19')](0x194);}return _0x3cafbf;};}function handleError(_0x10597f,_0x262caa){_0x262caa=_0x262caa||0x1f4;return function(_0x5e58d8){logger[_0xe36e('0x27')](_0x5e58d8['stack']);if(_0x5e58d8[_0xe36e('0x28')]){delete _0x5e58d8['name'];}_0x10597f[_0xe36e('0x1b')](_0x262caa)['send'](_0x5e58d8);};}exports[_0xe36e('0x29')]=function(_0x4c5d98,_0x3b1045){var _0x59548b={},_0x4bb75b={},_0x5d8fd8={'count':0x0,'rows':[]};var _0x5b5d53=_[_0xe36e('0x2a')](db[_0xe36e('0x2b')]['rawAttributes'],function(_0x4ac819){return{'name':_0x4ac819[_0xe36e('0x2c')],'type':_0x4ac819[_0xe36e('0x2d')][_0xe36e('0x2e')]};});_0x4bb75b[_0xe36e('0x2f')]=_[_0xe36e('0x2a')](_0x5b5d53,_0xe36e('0x28'));_0x4bb75b['query']=_[_0xe36e('0x30')](_0x4c5d98[_0xe36e('0x31')]);_0x4bb75b['filters']=_[_0xe36e('0x32')](_0x4bb75b[_0xe36e('0x2f')],_0x4bb75b[_0xe36e('0x31')]);_0x59548b[_0xe36e('0x33')]=_[_0xe36e('0x32')](_0x4bb75b[_0xe36e('0x2f')],qs[_0xe36e('0x34')](_0x4c5d98[_0xe36e('0x31')][_0xe36e('0x34')]));_0x59548b[_0xe36e('0x33')]=_0x59548b[_0xe36e('0x33')]['length']?_0x59548b[_0xe36e('0x33')]:_0x4bb75b['model'];if(!_0x4c5d98['query'][_0xe36e('0x35')]('nolimit')){_0x59548b[_0xe36e('0x1f')]=qs[_0xe36e('0x1f')](_0x4c5d98[_0xe36e('0x31')][_0xe36e('0x1f')]);_0x59548b['offset']=qs['offset'](_0x4c5d98[_0xe36e('0x31')][_0xe36e('0x1d')]);}_0x59548b[_0xe36e('0x36')]=qs[_0xe36e('0x37')](_0x4c5d98['query'][_0xe36e('0x37')]);_0x59548b[_0xe36e('0x38')]=qs[_0xe36e('0x39')](_['pick'](_0x4c5d98[_0xe36e('0x31')],_0x4bb75b[_0xe36e('0x39')]),_0x5b5d53);if(_0x4c5d98['query'][_0xe36e('0x3a')]){_0x59548b[_0xe36e('0x38')]=_[_0xe36e('0x3b')](_0x59548b[_0xe36e('0x38')],{'$or':_[_0xe36e('0x2a')](_0x5b5d53,function(_0x2fc909){if(_0x2fc909[_0xe36e('0x2d')]!==_0xe36e('0x3c')){var _0x458a4e={};_0x458a4e[_0x2fc909[_0xe36e('0x28')]]={'$like':'%'+_0x4c5d98[_0xe36e('0x31')][_0xe36e('0x3a')]+'%'};return _0x458a4e;}})});}_0x59548b=_[_0xe36e('0x3b')]({},_0x59548b,_0x4c5d98['options']);var _0x23d36e={'where':_0x59548b[_0xe36e('0x38')]};return db[_0xe36e('0x2b')][_0xe36e('0x20')](_0x23d36e)[_0xe36e('0x25')](function(_0x4d133b){_0x5d8fd8['count']=_0x4d133b;if(_0x4c5d98[_0xe36e('0x31')][_0xe36e('0x3d')]){_0x59548b[_0xe36e('0x3e')]=[{'all':!![]}];}return db[_0xe36e('0x2b')][_0xe36e('0x3f')](_0x59548b);})[_0xe36e('0x25')](function(_0xff4f63){_0x5d8fd8[_0xe36e('0x40')]=_0xff4f63;return _0x5d8fd8;})['then'](respondWithFilteredResult(_0x3b1045,_0x59548b))[_0xe36e('0x41')](handleError(_0x3b1045,null));};exports[_0xe36e('0x42')]=function(_0x4788a0,_0x21dc35){var _0x5ef3e4={'raw':![],'where':{'id':_0x4788a0[_0xe36e('0x43')]['id']}},_0x23e344={};_0x23e344[_0xe36e('0x2f')]=_[_0xe36e('0x30')](db[_0xe36e('0x2b')]['rawAttributes']);_0x23e344[_0xe36e('0x31')]=_[_0xe36e('0x30')](_0x4788a0[_0xe36e('0x31')]);_0x23e344[_0xe36e('0x39')]=_[_0xe36e('0x32')](_0x23e344[_0xe36e('0x2f')],_0x23e344['query']);_0x5ef3e4[_0xe36e('0x33')]=_[_0xe36e('0x32')](_0x23e344[_0xe36e('0x2f')],qs[_0xe36e('0x34')](_0x4788a0[_0xe36e('0x31')]['fields']));_0x5ef3e4[_0xe36e('0x33')]=_0x5ef3e4[_0xe36e('0x33')][_0xe36e('0x44')]?_0x5ef3e4[_0xe36e('0x33')]:_0x23e344[_0xe36e('0x2f')];if(_0x4788a0[_0xe36e('0x31')][_0xe36e('0x3d')]){_0x5ef3e4[_0xe36e('0x3e')]=[{'all':!![]}];}_0x5ef3e4=_[_0xe36e('0x3b')]({},_0x5ef3e4,_0x4788a0['options']);return db['ZendeskAccount'][_0xe36e('0x45')](_0x5ef3e4)['then'](handleEntityNotFound(_0x21dc35,null))[_0xe36e('0x25')](respondWithResult(_0x21dc35,null))[_0xe36e('0x41')](handleError(_0x21dc35,null));};exports[_0xe36e('0x46')]=function(_0x25aa09,_0x51641c){return db[_0xe36e('0x2b')][_0xe36e('0x46')](_0x25aa09['body'],{})[_0xe36e('0x25')](respondWithResult(_0x51641c,0xc9))[_0xe36e('0x41')](handleError(_0x51641c,null));};exports[_0xe36e('0x24')]=function(_0x42eae5,_0x15895d){if(_0x42eae5[_0xe36e('0x47')]['id']){delete _0x42eae5[_0xe36e('0x47')]['id'];}return db[_0xe36e('0x2b')][_0xe36e('0x45')]({'where':{'id':_0x42eae5[_0xe36e('0x43')]['id']}})[_0xe36e('0x25')](handleEntityNotFound(_0x15895d,null))[_0xe36e('0x25')](saveUpdates(_0x42eae5[_0xe36e('0x47')],null))[_0xe36e('0x25')](respondWithResult(_0x15895d,null))[_0xe36e('0x41')](handleError(_0x15895d,null));};exports['destroy']=function(_0x3262bf,_0x55aadf){return db['ZendeskAccount'][_0xe36e('0x45')]({'where':{'id':_0x3262bf[_0xe36e('0x43')]['id']}})['then'](handleEntityNotFound(_0x55aadf,null))[_0xe36e('0x25')](removeEntity(_0x55aadf,null))[_0xe36e('0x41')](handleError(_0x55aadf,null));};exports[_0xe36e('0x48')]=function(_0x1f4a5d,_0xa4be24,_0x22788b){var _0x935e84={};var _0x41e10d={};var _0x4d5762;var _0x55d190;return db[_0xe36e('0x2b')][_0xe36e('0x49')]({'where':{'id':_0x1f4a5d['params']['id']}})[_0xe36e('0x25')](handleEntityNotFound(_0xa4be24,null))[_0xe36e('0x25')](function(_0x3e1040){if(_0x3e1040){_0x4d5762=_0x3e1040;_0x41e10d[_0xe36e('0x2f')]=_[_0xe36e('0x30')](db['ZendeskConfiguration']['rawAttributes']);_0x41e10d['query']=_['keys'](_0x1f4a5d[_0xe36e('0x31')]);_0x41e10d[_0xe36e('0x39')]=_[_0xe36e('0x32')](_0x41e10d[_0xe36e('0x2f')],_0x41e10d[_0xe36e('0x31')]);_0x935e84[_0xe36e('0x33')]=_[_0xe36e('0x32')](_0x41e10d[_0xe36e('0x2f')],qs[_0xe36e('0x34')](_0x1f4a5d['query'][_0xe36e('0x34')]));_0x935e84[_0xe36e('0x33')]=_0x935e84['attributes'][_0xe36e('0x44')]?_0x935e84[_0xe36e('0x33')]:_0x41e10d[_0xe36e('0x2f')];_0x935e84[_0xe36e('0x36')]=qs[_0xe36e('0x37')](_0x1f4a5d[_0xe36e('0x31')][_0xe36e('0x37')]);_0x935e84[_0xe36e('0x38')]=qs[_0xe36e('0x39')](_[_0xe36e('0x4a')](_0x1f4a5d[_0xe36e('0x31')],_0x41e10d[_0xe36e('0x39')]));if(_0x1f4a5d[_0xe36e('0x31')][_0xe36e('0x3a')]){_0x935e84[_0xe36e('0x38')]=_[_0xe36e('0x3b')](_0x935e84[_0xe36e('0x38')],{'$or':_[_0xe36e('0x2a')](_0x935e84[_0xe36e('0x33')],function(_0x3e7d8d){var _0x362204={};_0x362204[_0x3e7d8d]={'$like':'%'+_0x1f4a5d[_0xe36e('0x31')][_0xe36e('0x3a')]+'%'};return _0x362204;})});}_0x935e84=_[_0xe36e('0x3b')]({},_0x935e84,_0x1f4a5d[_0xe36e('0x4b')]);return _0x4d5762['getConfigurations'](_0x935e84);}})[_0xe36e('0x25')](function(_0xedaa96){if(_0xedaa96){_0x55d190=_0xedaa96['length'];if(!_0x1f4a5d[_0xe36e('0x31')][_0xe36e('0x35')](_0xe36e('0x4c'))){_0x935e84[_0xe36e('0x1f')]=qs[_0xe36e('0x1f')](_0x1f4a5d[_0xe36e('0x31')]['limit']);_0x935e84[_0xe36e('0x1d')]=qs['offset'](_0x1f4a5d[_0xe36e('0x31')][_0xe36e('0x1d')]);}return _0x4d5762[_0xe36e('0x48')](_0x935e84);}})[_0xe36e('0x25')](function(_0x2a767d){if(_0x2a767d){return _0x2a767d?{'count':_0x55d190,'rows':_0x2a767d}:null;}})[_0xe36e('0x25')](respondWithResult(_0xa4be24,null))[_0xe36e('0x41')](handleError(_0xa4be24,null));};exports[_0xe36e('0x4d')]=function(_0x4c8d2b,_0x34c7a5,_0xcafb87){if(_0x4c8d2b['body']['id']){delete _0x4c8d2b[_0xe36e('0x47')]['id'];}return db[_0xe36e('0x2b')][_0xe36e('0x49')]({'where':{'id':_0x4c8d2b[_0xe36e('0x43')]['id']}})[_0xe36e('0x25')](handleEntityNotFound(_0x34c7a5,null))[_0xe36e('0x25')](function(_0x3d4874){if(_0x3d4874){_0x4c8d2b['body'][_0xe36e('0x4e')]=_0x3d4874['id'];_0x4c8d2b[_0xe36e('0x47')][_0xe36e('0x4f')]=integrations[_0xe36e('0x50')](_0x4c8d2b[_0xe36e('0x47')][_0xe36e('0x51')],_0x4c8d2b[_0xe36e('0x47')][_0xe36e('0x2d')]);_0x4c8d2b[_0xe36e('0x47')][_0xe36e('0x52')]=integrations[_0xe36e('0x53')](_0x4c8d2b['body'][_0xe36e('0x51')],_0x4c8d2b[_0xe36e('0x47')][_0xe36e('0x2d')]);return db[_0xe36e('0x54')]['create'](_0x4c8d2b['body'],{'include':[{'model':db[_0xe36e('0x55')],'as':'Subjects'},{'model':db['ZendeskField'],'as':'Descriptions'}]});}return null;})[_0xe36e('0x25')](respondWithResult(_0x34c7a5,null))['catch'](handleError(_0x34c7a5,null));};exports[_0xe36e('0x56')]=function(_0x2f7093,_0x258a63,_0x221a90){var _0x1bd60d='';return db[_0xe36e('0x2b')][_0xe36e('0x49')]({'where':{'id':_0x2f7093[_0xe36e('0x43')]['id']},'attributes':['id',_0xe36e('0x57'),'password',_0xe36e('0x58'),'authType',_0xe36e('0x59')]})['then'](handleEntityNotFound(_0x258a63,null))[_0xe36e('0x25')](function(_0x209e45){if(_0x209e45){_0x1bd60d=_0x209e45[_0xe36e('0x59')];var _0x29a372=_0x1bd60d['slice'](-0x1);if(_0x29a372==='/'){_0x1bd60d=_0x1bd60d['substring'](0x0,_0x1bd60d[_0xe36e('0x5a')](_0x29a372));}var _0x2b44a6={'method':_0xe36e('0x5b'),'uri':util[_0xe36e('0x5c')](_0xe36e('0x5d'),_0x1bd60d,_0xe36e('0x5e')),'json':!![]};switch(_0x209e45['authType']){case _0xe36e('0x5f'):_0x2b44a6[_0xe36e('0x60')]={'Authorization':util['format'](_0xe36e('0x61'),new Buffer(util['format'](_0xe36e('0x62'),_0x209e45[_0xe36e('0x57')],_0x209e45[_0xe36e('0x5f')]))[_0xe36e('0x63')]('base64'))};break;case _0xe36e('0x58'):_0x2b44a6['headers']={'Authorization':util['format'](_0xe36e('0x61'),new Buffer(util[_0xe36e('0x5c')]('%s/token:%s',_0x209e45['username'],_0x209e45[_0xe36e('0x58')]))['toString'](_0xe36e('0x64')))};break;default:throw new db[(_0xe36e('0x65'))][(_0xe36e('0x66'))](_0xe36e('0x67'));}return rp(_0x2b44a6);}})[_0xe36e('0x25')](function(_0x16c26a){if(_0x16c26a){var _0x590885=[_0xe36e('0x68'),_0xe36e('0x69'),_0xe36e('0x6a'),_0xe36e('0x6b')];_['remove'](_0x16c26a[_0xe36e('0x5e')],function(_0x37409f){return _0x590885[_0xe36e('0x6c')](_0x37409f[_0xe36e('0x2d')]);});return{'count':_0x16c26a['ticket_fields'][_0xe36e('0x44')],'rows':_['map'](_0x16c26a[_0xe36e('0x5e')],function(_0x5d3dac){return{'id':_0x5d3dac['id'],'name':_0x5d3dac[_0xe36e('0x6d')]>0x7?_0x5d3dac['title']:_0x5d3dac['type'],'custom':_0x5d3dac[_0xe36e('0x6d')]>0x7?!![]:![],'options':_0x5d3dac[_0xe36e('0x6e')]?_0x5d3dac[_0xe36e('0x6e')]:_0x5d3dac['custom_field_options']?_0x5d3dac[_0xe36e('0x6f')]:[]};})};}})[_0xe36e('0x25')](respondWithResult(_0x258a63,null))['catch'](function(_0x3beba7){var _0x369576=_0x2f7093[_0xe36e('0x31')]['test']?0x1f4:_0x3beba7['statusCode']||0x1f4;logger[_0xe36e('0x27')](_0xe36e('0x70'),_0xe36e('0x56'),_0x369576,JSON[_0xe36e('0x71')](_0x3beba7));delete _0x3beba7[_0xe36e('0x28')];if(_0x369576===0x191){_0x369576=0x190;}_0x258a63['status'](_0x369576)[_0xe36e('0x72')](_0x2f7093[_0xe36e('0x31')][_0xe36e('0x73')]?{'message':_0xe36e('0x74'),'statusCode':_0x3beba7[_0xe36e('0x75')]}:_0x3beba7);});};
\ No newline at end of file
index 20cd2f0..5db79f6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbdac=['../../config/logger','api','moment','path','rimraf','../../components/integrations/configuration','exports','define','ZendeskAccount','int_zendesk_accounts','util'];(function(_0x51331f,_0x25ac7b){var _0x17ec93=function(_0x2d81b5){while(--_0x2d81b5){_0x51331f['push'](_0x51331f['shift']());}};_0x17ec93(++_0x25ac7b);}(_0xbdac,0x1d8));var _0xcbda=function(_0x28e159,_0x293ec3){_0x28e159=_0x28e159-0x0;var _0x548c34=_0xbdac[_0x28e159];return _0x548c34;};'use strict';var _=require('lodash');var util=require(_0xcbda('0x0'));var logger=require(_0xcbda('0x1'))(_0xcbda('0x2'));var moment=require(_0xcbda('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xcbda('0x4'));var rimraf=require(_0xcbda('0x5'));var config=require('../../config/environment');var attributes=require('./intZendeskAccount.attributes');var integrations=require(_0xcbda('0x6'));module[_0xcbda('0x7')]=function(_0x4476bf,_0x3e4762){return _0x4476bf[_0xcbda('0x8')](_0xcbda('0x9'),attributes,{'tableName':_0xcbda('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x953e=['moment','bluebird','path','rimraf','../../config/environment','./intZendeskAccount.attributes','define','int_zendesk_accounts','lodash','util','../../config/logger','api'];(function(_0x31fed9,_0x30dd29){var _0x11e83c=function(_0x5e4e0c){while(--_0x5e4e0c){_0x31fed9['push'](_0x31fed9['shift']());}};_0x11e83c(++_0x30dd29);}(_0x953e,0x164));var _0xe953=function(_0x26686f,_0x5e95a4){_0x26686f=_0x26686f-0x0;var _0x2e2a45=_0x953e[_0x26686f];return _0x2e2a45;};'use strict';var _=require(_0xe953('0x0'));var util=require(_0xe953('0x1'));var logger=require(_0xe953('0x2'))(_0xe953('0x3'));var moment=require(_0xe953('0x4'));var BPromise=require(_0xe953('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe953('0x6'));var rimraf=require(_0xe953('0x7'));var config=require(_0xe953('0x8'));var attributes=require(_0xe953('0x9'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x3f9693,_0x288da4){return _0x3f9693[_0xe953('0xa')]('ZendeskAccount',attributes,{'tableName':_0xe953('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 0cea759..3fdc7a9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1be5=['code','ZendeskAccount,\x20%s,\x20%s','message','result','catch','GetZendeskAccount','findAll','options','raw','where','attributes','limit','include','map','model','ShowZendeskAccount','ZendeskAccount','find','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x2e4fef,_0x2afaef){var _0x1a73e9=function(_0x3c1c44){while(--_0x3c1c44){_0x2e4fef['push'](_0x2e4fef['shift']());}};_0x1a73e9(++_0x2afaef);}(_0x1be5,0x10e));var _0x51be=function(_0xbf0f4f,_0x232147){_0xbf0f4f=_0xbf0f4f-0x0;var _0x110a60=_0x1be5[_0xbf0f4f];return _0x110a60;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x51be('0x0'));var BPromise=require('bluebird');var rs=require(_0x51be('0x1'));var fs=require('fs');var Redis=require(_0x51be('0x2'));var db=require(_0x51be('0x3'))['db'];var utils=require(_0x51be('0x4'));var logger=require(_0x51be('0x5'))('rpc');var config=require(_0x51be('0x6'));var jayson=require(_0x51be('0x7'));var client=jayson[_0x51be('0x8')][_0x51be('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x8b63a1,_0xc6988a,_0x360caf){return new BPromise(function(_0x4bd7fb,_0x2f88b0){return client[_0x51be('0xa')](_0x8b63a1,_0x360caf)[_0x51be('0xb')](function(_0x3a1040){logger[_0x51be('0xc')]('ZendeskAccount,\x20%s,\x20%s',_0xc6988a,_0x51be('0xd'));logger[_0x51be('0xe')](_0x51be('0xf'),_0xc6988a,_0x51be('0xd'),JSON[_0x51be('0x10')](_0x3a1040));if(_0x3a1040[_0x51be('0x11')]){if(_0x3a1040[_0x51be('0x11')][_0x51be('0x12')]===0x1f4){logger[_0x51be('0x11')](_0x51be('0x13'),_0xc6988a,_0x3a1040['error'][_0x51be('0x14')]);return _0x2f88b0(_0x3a1040['error']['message']);}logger['error'](_0x51be('0x13'),_0xc6988a,_0x3a1040[_0x51be('0x11')][_0x51be('0x14')]);return _0x4bd7fb(_0x3a1040['error'][_0x51be('0x14')]);}else{logger[_0x51be('0xc')]('ZendeskAccount,\x20%s,\x20%s',_0xc6988a,_0x51be('0xd'));_0x4bd7fb(_0x3a1040[_0x51be('0x15')][_0x51be('0x14')]);}})[_0x51be('0x16')](function(_0x1cecf5){logger['error'](_0x51be('0x13'),_0xc6988a,_0x1cecf5);_0x2f88b0(_0x1cecf5);});});}exports[_0x51be('0x17')]=function(_0x352187){var _0x3a98d4=this;return new Promise(function(_0x18b7d4,_0x4763d9){return db['ZendeskAccount'][_0x51be('0x18')]({'raw':_0x352187[_0x51be('0x19')]?_0x352187[_0x51be('0x19')][_0x51be('0x1a')]===undefined?!![]:![]:!![],'where':_0x352187[_0x51be('0x19')]?_0x352187['options'][_0x51be('0x1b')]||null:null,'attributes':_0x352187[_0x51be('0x19')]?_0x352187[_0x51be('0x19')][_0x51be('0x1c')]||null:null,'limit':_0x352187['options']?_0x352187[_0x51be('0x19')][_0x51be('0x1d')]||null:null,'include':_0x352187['options']?_0x352187[_0x51be('0x19')][_0x51be('0x1e')]?_[_0x51be('0x1f')](_0x352187[_0x51be('0x19')][_0x51be('0x1e')],function(_0x368de8){return{'model':db[_0x368de8[_0x51be('0x20')]],'as':_0x368de8['as'],'attributes':_0x368de8[_0x51be('0x1c')],'include':_0x368de8[_0x51be('0x1e')]?_[_0x51be('0x1f')](_0x368de8[_0x51be('0x1e')],function(_0x2144d7){return{'model':db[_0x2144d7[_0x51be('0x20')]],'as':_0x2144d7['as'],'attributes':_0x2144d7[_0x51be('0x1c')],'include':_0x2144d7[_0x51be('0x1e')]?_[_0x51be('0x1f')](_0x2144d7[_0x51be('0x1e')],function(_0x4dfd1a){return{'model':db[_0x4dfd1a[_0x51be('0x20')]],'as':_0x4dfd1a['as'],'attributes':_0x4dfd1a[_0x51be('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x43fdbf){logger[_0x51be('0xc')](_0x51be('0x17'),_0x352187);logger[_0x51be('0xe')](_0x51be('0x17'),_0x352187,JSON[_0x51be('0x10')](_0x43fdbf));_0x18b7d4(_0x43fdbf);})['catch'](function(_0x37bea1){logger[_0x51be('0x11')](_0x51be('0x17'),_0x37bea1[_0x51be('0x14')],_0x352187);_0x4763d9(_0x3a98d4[_0x51be('0x11')](0x1f4,_0x37bea1['message']));});});};exports[_0x51be('0x21')]=function(_0x285b85){var _0x1216d0=this;return new Promise(function(_0x6b3a05,_0x5a7205){return db[_0x51be('0x22')][_0x51be('0x23')]({'raw':_0x285b85[_0x51be('0x19')]?_0x285b85[_0x51be('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x285b85[_0x51be('0x19')]?_0x285b85[_0x51be('0x19')][_0x51be('0x1b')]||null:null,'attributes':_0x285b85['options']?_0x285b85[_0x51be('0x19')]['attributes']||null:null,'include':_0x285b85[_0x51be('0x19')]?_0x285b85[_0x51be('0x19')][_0x51be('0x1e')]?_[_0x51be('0x1f')](_0x285b85[_0x51be('0x19')][_0x51be('0x1e')],function(_0x24b002){return{'model':db[_0x24b002[_0x51be('0x20')]],'as':_0x24b002['as'],'attributes':_0x24b002[_0x51be('0x1c')],'include':_0x24b002['include']?_[_0x51be('0x1f')](_0x24b002[_0x51be('0x1e')],function(_0x19958f){return{'model':db[_0x19958f['model']],'as':_0x19958f['as'],'attributes':_0x19958f[_0x51be('0x1c')],'include':_0x19958f[_0x51be('0x1e')]?_['map'](_0x19958f['include'],function(_0x1713de){return{'model':db[_0x1713de[_0x51be('0x20')]],'as':_0x1713de['as'],'attributes':_0x1713de[_0x51be('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x51be('0xb')](function(_0x2bb484){logger[_0x51be('0xc')](_0x51be('0x21'),_0x285b85);logger[_0x51be('0xe')](_0x51be('0x21'),_0x285b85,JSON[_0x51be('0x10')](_0x2bb484));_0x6b3a05(_0x2bb484);})[_0x51be('0x16')](function(_0x1f5724){logger[_0x51be('0x11')](_0x51be('0x21'),_0x1f5724[_0x51be('0x14')],_0x285b85);_0x5a7205(_0x1216d0['error'](0x1f4,_0x1f5724[_0x51be('0x14')]));});});};
\ No newline at end of file
+var _0xfaf1=['debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','message','error','request\x20sent','result','catch','ZendeskAccount','options','raw','attributes','include','map','model','GetZendeskAccount','find','where','ShowZendeskAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','request','then','info','ZendeskAccount,\x20%s,\x20%s'];(function(_0x461eff,_0x283cd4){var _0x4fa4e5=function(_0x199915){while(--_0x199915){_0x461eff['push'](_0x461eff['shift']());}};_0x4fa4e5(++_0x283cd4);}(_0xfaf1,0xd3));var _0x1faf=function(_0x4339dc,_0x562095){_0x4339dc=_0x4339dc-0x0;var _0x387b4a=_0xfaf1[_0x4339dc];return _0x387b4a;};'use strict';var _=require(_0x1faf('0x0'));var util=require(_0x1faf('0x1'));var moment=require(_0x1faf('0x2'));var BPromise=require(_0x1faf('0x3'));var rs=require(_0x1faf('0x4'));var fs=require('fs');var Redis=require(_0x1faf('0x5'));var db=require(_0x1faf('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x1faf('0x7'));var jayson=require(_0x1faf('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x33135c,_0x326e87,_0x61c29a){return new BPromise(function(_0x3c5ef8,_0x5b145d){return client[_0x1faf('0x9')](_0x33135c,_0x61c29a)[_0x1faf('0xa')](function(_0x1e09a4){logger[_0x1faf('0xb')](_0x1faf('0xc'),_0x326e87,'request\x20sent');logger[_0x1faf('0xd')](_0x1faf('0xe'),_0x326e87,'request\x20sent',JSON[_0x1faf('0xf')](_0x1e09a4));if(_0x1e09a4['error']){if(_0x1e09a4['error']['code']===0x1f4){logger['error'](_0x1faf('0xc'),_0x326e87,_0x1e09a4['error'][_0x1faf('0x10')]);return _0x5b145d(_0x1e09a4['error'][_0x1faf('0x10')]);}logger[_0x1faf('0x11')]('ZendeskAccount,\x20%s,\x20%s',_0x326e87,_0x1e09a4[_0x1faf('0x11')][_0x1faf('0x10')]);return _0x3c5ef8(_0x1e09a4[_0x1faf('0x11')][_0x1faf('0x10')]);}else{logger[_0x1faf('0xb')](_0x1faf('0xc'),_0x326e87,_0x1faf('0x12'));_0x3c5ef8(_0x1e09a4[_0x1faf('0x13')][_0x1faf('0x10')]);}})[_0x1faf('0x14')](function(_0x4a37ad){logger[_0x1faf('0x11')](_0x1faf('0xc'),_0x326e87,_0x4a37ad);_0x5b145d(_0x4a37ad);});});}exports['GetZendeskAccount']=function(_0x415db9){var _0x4b83a4=this;return new Promise(function(_0x36f463,_0x5e5f4e){return db[_0x1faf('0x15')]['findAll']({'raw':_0x415db9[_0x1faf('0x16')]?_0x415db9[_0x1faf('0x16')][_0x1faf('0x17')]===undefined?!![]:![]:!![],'where':_0x415db9[_0x1faf('0x16')]?_0x415db9[_0x1faf('0x16')]['where']||null:null,'attributes':_0x415db9[_0x1faf('0x16')]?_0x415db9[_0x1faf('0x16')][_0x1faf('0x18')]||null:null,'limit':_0x415db9[_0x1faf('0x16')]?_0x415db9['options']['limit']||null:null,'include':_0x415db9[_0x1faf('0x16')]?_0x415db9[_0x1faf('0x16')][_0x1faf('0x19')]?_[_0x1faf('0x1a')](_0x415db9[_0x1faf('0x16')][_0x1faf('0x19')],function(_0x2d8c28){return{'model':db[_0x2d8c28['model']],'as':_0x2d8c28['as'],'attributes':_0x2d8c28[_0x1faf('0x18')],'include':_0x2d8c28[_0x1faf('0x19')]?_[_0x1faf('0x1a')](_0x2d8c28['include'],function(_0x1d911a){return{'model':db[_0x1d911a[_0x1faf('0x1b')]],'as':_0x1d911a['as'],'attributes':_0x1d911a[_0x1faf('0x18')],'include':_0x1d911a[_0x1faf('0x19')]?_[_0x1faf('0x1a')](_0x1d911a[_0x1faf('0x19')],function(_0x1c4b77){return{'model':db[_0x1c4b77[_0x1faf('0x1b')]],'as':_0x1c4b77['as'],'attributes':_0x1c4b77[_0x1faf('0x18')]};}):[]};}):[]};}):[]:[]})[_0x1faf('0xa')](function(_0x443a8b){logger[_0x1faf('0xb')]('GetZendeskAccount',_0x415db9);logger[_0x1faf('0xd')]('GetZendeskAccount',_0x415db9,JSON['stringify'](_0x443a8b));_0x36f463(_0x443a8b);})['catch'](function(_0x44ea3e){logger[_0x1faf('0x11')](_0x1faf('0x1c'),_0x44ea3e[_0x1faf('0x10')],_0x415db9);_0x5e5f4e(_0x4b83a4[_0x1faf('0x11')](0x1f4,_0x44ea3e[_0x1faf('0x10')]));});});};exports['ShowZendeskAccount']=function(_0x14fea8){var _0xce2a80=this;return new Promise(function(_0x48ecc7,_0x4fc7f7){return db[_0x1faf('0x15')][_0x1faf('0x1d')]({'raw':_0x14fea8[_0x1faf('0x16')]?_0x14fea8[_0x1faf('0x16')][_0x1faf('0x17')]===undefined?!![]:![]:!![],'where':_0x14fea8[_0x1faf('0x16')]?_0x14fea8[_0x1faf('0x16')][_0x1faf('0x1e')]||null:null,'attributes':_0x14fea8[_0x1faf('0x16')]?_0x14fea8[_0x1faf('0x16')][_0x1faf('0x18')]||null:null,'include':_0x14fea8['options']?_0x14fea8['options']['include']?_[_0x1faf('0x1a')](_0x14fea8['options'][_0x1faf('0x19')],function(_0x127ce8){return{'model':db[_0x127ce8[_0x1faf('0x1b')]],'as':_0x127ce8['as'],'attributes':_0x127ce8[_0x1faf('0x18')],'include':_0x127ce8[_0x1faf('0x19')]?_['map'](_0x127ce8['include'],function(_0x499a97){return{'model':db[_0x499a97[_0x1faf('0x1b')]],'as':_0x499a97['as'],'attributes':_0x499a97[_0x1faf('0x18')],'include':_0x499a97[_0x1faf('0x19')]?_[_0x1faf('0x1a')](_0x499a97[_0x1faf('0x19')],function(_0x39dced){return{'model':db[_0x39dced['model']],'as':_0x39dced['as'],'attributes':_0x39dced[_0x1faf('0x18')]};}):[]};}):[]};}):[]:[]})[_0x1faf('0xa')](function(_0x1adf50){logger[_0x1faf('0xb')](_0x1faf('0x1f'),_0x14fea8);logger[_0x1faf('0xd')]('ShowZendeskAccount',_0x14fea8,JSON['stringify'](_0x1adf50));_0x48ecc7(_0x1adf50);})[_0x1faf('0x14')](function(_0x5df738){logger[_0x1faf('0x11')](_0x1faf('0x1f'),_0x5df738[_0x1faf('0x10')],_0x14fea8);_0x4fc7f7(_0xce2a80['error'](0x1f4,_0x5df738['message']));});});};
\ No newline at end of file
index ac114fe..6208e1b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x91a7=['util','path','connect-timeout','Router','../../components/auth/service','./intZendeskConfiguration.controller','get','index','/:id','isAuthenticated','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','create','put','update','destroy','exports'];(function(_0x10c83b,_0x3525a3){var _0x28312a=function(_0x573df9){while(--_0x573df9){_0x10c83b['push'](_0x10c83b['shift']());}};_0x28312a(++_0x3525a3);}(_0x91a7,0xe7));var _0x791a=function(_0x46596a,_0x2a464e){_0x46596a=_0x46596a-0x0;var _0x17b8a6=_0x91a7[_0x46596a];return _0x17b8a6;};'use strict';var multer=require('multer');var util=require(_0x791a('0x0'));var path=require(_0x791a('0x1'));var timeout=require(_0x791a('0x2'));var express=require('express');var router=express[_0x791a('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x791a('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x791a('0x5'));router[_0x791a('0x6')]('/',auth['isAuthenticated'](),controller[_0x791a('0x7')]);router['get'](_0x791a('0x8'),auth[_0x791a('0x9')](),controller['show']);router[_0x791a('0x6')](_0x791a('0xa'),auth[_0x791a('0x9')](),controller[_0x791a('0xb')]);router[_0x791a('0x6')]('/:id/subjects',auth[_0x791a('0x9')](),controller[_0x791a('0xc')]);router['get'](_0x791a('0xd'),auth[_0x791a('0x9')](),controller[_0x791a('0xe')]);router[_0x791a('0x6')](_0x791a('0xf'),auth[_0x791a('0x9')](),controller['getTags']);router['post']('/',auth[_0x791a('0x9')](),controller[_0x791a('0x10')]);router['post'](_0x791a('0xf'),auth[_0x791a('0x9')](),controller['setTags']);router[_0x791a('0x11')](_0x791a('0x8'),auth[_0x791a('0x9')](),controller[_0x791a('0x12')]);router['delete'](_0x791a('0x8'),auth['isAuthenticated'](),controller[_0x791a('0x13')]);module[_0x791a('0x14')]=router;
\ No newline at end of file
+var _0xea28=['Router','fs-extra','../../components/auth/service','../../config/environment','./intZendeskConfiguration.controller','get','index','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','setTags','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x3dad57,_0x1dd8b3){var _0x47a6b5=function(_0x6e545d){while(--_0x6e545d){_0x3dad57['push'](_0x3dad57['shift']());}};_0x47a6b5(++_0x1dd8b3);}(_0xea28,0x13a));var _0x8ea2=function(_0x8c44d8,_0x1cd536){_0x8c44d8=_0x8c44d8-0x0;var _0x570a16=_0xea28[_0x8c44d8];return _0x570a16;};'use strict';var multer=require(_0x8ea2('0x0'));var util=require(_0x8ea2('0x1'));var path=require(_0x8ea2('0x2'));var timeout=require(_0x8ea2('0x3'));var express=require(_0x8ea2('0x4'));var router=express[_0x8ea2('0x5')]();var fs_extra=require(_0x8ea2('0x6'));var auth=require(_0x8ea2('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x8ea2('0x8'));var controller=require(_0x8ea2('0x9'));router[_0x8ea2('0xa')]('/',auth['isAuthenticated'](),controller[_0x8ea2('0xb')]);router[_0x8ea2('0xa')](_0x8ea2('0xc'),auth[_0x8ea2('0xd')](),controller[_0x8ea2('0xe')]);router[_0x8ea2('0xa')](_0x8ea2('0xf'),auth[_0x8ea2('0xd')](),controller[_0x8ea2('0x10')]);router[_0x8ea2('0xa')](_0x8ea2('0x11'),auth[_0x8ea2('0xd')](),controller['getSubjects']);router['get'](_0x8ea2('0x12'),auth[_0x8ea2('0xd')](),controller[_0x8ea2('0x13')]);router['get'](_0x8ea2('0x14'),auth[_0x8ea2('0xd')](),controller[_0x8ea2('0x15')]);router[_0x8ea2('0x16')]('/',auth[_0x8ea2('0xd')](),controller['create']);router[_0x8ea2('0x16')]('/:id/tags',auth['isAuthenticated'](),controller[_0x8ea2('0x17')]);router[_0x8ea2('0x18')](_0x8ea2('0xc'),auth[_0x8ea2('0xd')](),controller[_0x8ea2('0x19')]);router[_0x8ea2('0x1a')](_0x8ea2('0xc'),auth[_0x8ea2('0xd')](),controller[_0x8ea2('0x1b')]);module[_0x8ea2('0x1c')]=router;
\ No newline at end of file
index 34ff892..593a301 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb59a=['STRING','sequelize'];(function(_0x3238bd,_0x4ea3ef){var _0xdc7a7e=function(_0x275fbc){while(--_0x275fbc){_0x3238bd['push'](_0x3238bd['shift']());}};_0xdc7a7e(++_0x4ea3ef);}(_0xb59a,0xff));var _0xab59=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb59a[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xab59('0x0'));module['exports']={'name':{'type':Sequelize[_0xab59('0x1')]},'description':{'type':Sequelize[_0xab59('0x1')]}};
\ No newline at end of file
+var _0x6f65=['exports','sequelize'];(function(_0x4cc262,_0x4827b){var _0x49a208=function(_0x2151ee){while(--_0x2151ee){_0x4cc262['push'](_0x4cc262['shift']());}};_0x49a208(++_0x4827b);}(_0x6f65,0xbf));var _0x56f6=function(_0xb93e8d,_0x11e30e){_0xb93e8d=_0xb93e8d-0x0;var _0xeda55b=_0x6f65[_0xb93e8d];return _0xeda55b;};'use strict';var Sequelize=require(_0x56f6('0x0'));module[_0x56f6('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 003be20..f369bac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x10c8=['limit','count','set','Content-Range','apply','reject','save','destroy','stack','name','send','index','map','ZendeskConfiguration','rawAttributes','fieldName','type','key','keys','query','intersection','fields','attributes','length','order','sort','where','filters','pick','filter','merge','options','then','includeAll','include','rows','show','model','find','create','body','catch','update','params','getFields','findOne','ZendeskField','nolimit','getSubjects','hasOwnProperty','getDescriptions','Tag','getTags','setTags','ids','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','fs-extra','lodash','crypto','jsforce','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined'];(function(_0x197d72,_0x19b07b){var _0x1e3507=function(_0x34e0b6){while(--_0x34e0b6){_0x197d72['push'](_0x197d72['shift']());}};_0x1e3507(++_0x19b07b);}(_0x10c8,0xdb));var _0x810c=function(_0x52bfa5,_0x42cf21){_0x52bfa5=_0x52bfa5-0x0;var _0x26f80b=_0x10c8[_0x52bfa5];return _0x26f80b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x810c('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x810c('0x1'));var rp=require(_0x810c('0x2'));var moment=require('moment');var BPromise=require(_0x810c('0x3'));var Mustache=require(_0x810c('0x4'));var util=require(_0x810c('0x5'));var path=require(_0x810c('0x6'));var sox=require(_0x810c('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x810c('0x8'));var _=require(_0x810c('0x9'));var squel=require('squel');var crypto=require(_0x810c('0xa'));var jsforce=require(_0x810c('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x810c('0xc'));var querystring=require(_0x810c('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x810c('0xe'));var qs=require(_0x810c('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x810c('0x10'));var logger=require(_0x810c('0x11'))(_0x810c('0x12'));var utils=require(_0x810c('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x810c('0x14'));var db=require(_0x810c('0x15'))['db'];function respondWithStatusCode(_0x49e2a2,_0x105909){_0x105909=_0x105909||0xcc;return function(_0x1f079c){if(_0x1f079c){return _0x49e2a2['sendStatus'](_0x105909);}return _0x49e2a2[_0x810c('0x16')](_0x105909)[_0x810c('0x17')]();};}function respondWithResult(_0x21cd51,_0x2acd91){_0x2acd91=_0x2acd91||0xc8;return function(_0x1e7686){if(_0x1e7686){return _0x21cd51[_0x810c('0x16')](_0x2acd91)[_0x810c('0x18')](_0x1e7686);}};}function respondWithFilteredResult(_0x3b02f4,_0x219024){return function(_0x628bfe){if(_0x628bfe){var _0x110653=typeof _0x219024[_0x810c('0x19')]===_0x810c('0x1a')&&typeof _0x219024[_0x810c('0x1b')]===_0x810c('0x1a');var _0xda844e=_0x628bfe[_0x810c('0x1c')];var _0xe5a53c=_0x110653?0x0:_0x219024[_0x810c('0x19')];var _0x6ac2bc=_0x110653?_0x628bfe[_0x810c('0x1c')]:_0x219024[_0x810c('0x19')]+_0x219024[_0x810c('0x1b')];var _0x34e9ba;if(_0x6ac2bc>=_0xda844e){_0x6ac2bc=_0xda844e;_0x34e9ba=0xc8;}else{_0x34e9ba=0xce;}_0x3b02f4['status'](_0x34e9ba);return _0x3b02f4[_0x810c('0x1d')](_0x810c('0x1e'),_0xe5a53c+'-'+_0x6ac2bc+'/'+_0xda844e)[_0x810c('0x18')](_0x628bfe);}return null;};}function patchUpdates(_0x378adf){return function(_0x502d8f){try{jsonpatch[_0x810c('0x1f')](_0x502d8f,_0x378adf,!![]);}catch(_0x2a9c20){return BPromise[_0x810c('0x20')](_0x2a9c20);}return _0x502d8f[_0x810c('0x21')]();};}function saveUpdates(_0x187ba5,_0x47ea54){return function(_0x438d82){if(_0x438d82){return _0x438d82['update'](_0x187ba5)['then'](function(_0x3d3da6){return _0x3d3da6;});}return null;};}function removeEntity(_0x3928f6,_0x33db0c){return function(_0x7113b6){if(_0x7113b6){return _0x7113b6[_0x810c('0x22')]()['then'](function(){_0x3928f6['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x45ed9e,_0x2fec80){return function(_0x590918){if(!_0x590918){_0x45ed9e['sendStatus'](0x194);}return _0x590918;};}function handleError(_0x12acc1,_0x217312){_0x217312=_0x217312||0x1f4;return function(_0x24d27e){logger['error'](_0x24d27e[_0x810c('0x23')]);if(_0x24d27e[_0x810c('0x24')]){delete _0x24d27e['name'];}_0x12acc1[_0x810c('0x16')](_0x217312)[_0x810c('0x25')](_0x24d27e);};}exports[_0x810c('0x26')]=function(_0x4d1e1e,_0x39dec2){var _0x5afd31={},_0x52105b={},_0x437498={'count':0x0,'rows':[]};var _0x57de2a=_[_0x810c('0x27')](db[_0x810c('0x28')][_0x810c('0x29')],function(_0xfb1c8c){return{'name':_0xfb1c8c[_0x810c('0x2a')],'type':_0xfb1c8c[_0x810c('0x2b')][_0x810c('0x2c')]};});_0x52105b['model']=_[_0x810c('0x27')](_0x57de2a,_0x810c('0x24'));_0x52105b['query']=_[_0x810c('0x2d')](_0x4d1e1e[_0x810c('0x2e')]);_0x52105b['filters']=_[_0x810c('0x2f')](_0x52105b['model'],_0x52105b[_0x810c('0x2e')]);_0x5afd31['attributes']=_['intersection'](_0x52105b['model'],qs[_0x810c('0x30')](_0x4d1e1e[_0x810c('0x2e')][_0x810c('0x30')]));_0x5afd31['attributes']=_0x5afd31[_0x810c('0x31')][_0x810c('0x32')]?_0x5afd31['attributes']:_0x52105b['model'];if(!_0x4d1e1e[_0x810c('0x2e')]['hasOwnProperty']('nolimit')){_0x5afd31[_0x810c('0x1b')]=qs[_0x810c('0x1b')](_0x4d1e1e[_0x810c('0x2e')]['limit']);_0x5afd31['offset']=qs[_0x810c('0x19')](_0x4d1e1e[_0x810c('0x2e')][_0x810c('0x19')]);}_0x5afd31[_0x810c('0x33')]=qs[_0x810c('0x34')](_0x4d1e1e[_0x810c('0x2e')][_0x810c('0x34')]);_0x5afd31[_0x810c('0x35')]=qs[_0x810c('0x36')](_[_0x810c('0x37')](_0x4d1e1e['query'],_0x52105b[_0x810c('0x36')]),_0x57de2a);if(_0x4d1e1e[_0x810c('0x2e')]['filter']){_0x5afd31[_0x810c('0x35')]=_['merge'](_0x5afd31[_0x810c('0x35')],{'$or':_[_0x810c('0x27')](_0x57de2a,function(_0x446c90){if(_0x446c90[_0x810c('0x2b')]!=='VIRTUAL'){var _0x1e032f={};_0x1e032f[_0x446c90[_0x810c('0x24')]]={'$like':'%'+_0x4d1e1e[_0x810c('0x2e')][_0x810c('0x38')]+'%'};return _0x1e032f;}})});}_0x5afd31=_[_0x810c('0x39')]({},_0x5afd31,_0x4d1e1e[_0x810c('0x3a')]);var _0x1b75c1={'where':_0x5afd31['where']};return db[_0x810c('0x28')][_0x810c('0x1c')](_0x1b75c1)[_0x810c('0x3b')](function(_0x28259a){_0x437498['count']=_0x28259a;if(_0x4d1e1e['query'][_0x810c('0x3c')]){_0x5afd31[_0x810c('0x3d')]=[{'all':!![]}];}return db['ZendeskConfiguration']['findAll'](_0x5afd31);})['then'](function(_0x45ba02){_0x437498[_0x810c('0x3e')]=_0x45ba02;return _0x437498;})['then'](respondWithFilteredResult(_0x39dec2,_0x5afd31))['catch'](handleError(_0x39dec2,null));};exports[_0x810c('0x3f')]=function(_0xd13e2e,_0x18ba23){var _0x2c90d1={'raw':![],'where':{'id':_0xd13e2e['params']['id']}},_0x3bcda1={};_0x3bcda1[_0x810c('0x40')]=_[_0x810c('0x2d')](db[_0x810c('0x28')][_0x810c('0x29')]);_0x3bcda1['query']=_[_0x810c('0x2d')](_0xd13e2e['query']);_0x3bcda1[_0x810c('0x36')]=_['intersection'](_0x3bcda1[_0x810c('0x40')],_0x3bcda1['query']);_0x2c90d1[_0x810c('0x31')]=_[_0x810c('0x2f')](_0x3bcda1['model'],qs[_0x810c('0x30')](_0xd13e2e[_0x810c('0x2e')][_0x810c('0x30')]));_0x2c90d1['attributes']=_0x2c90d1[_0x810c('0x31')][_0x810c('0x32')]?_0x2c90d1['attributes']:_0x3bcda1[_0x810c('0x40')];if(_0xd13e2e[_0x810c('0x2e')][_0x810c('0x3c')]){_0x2c90d1[_0x810c('0x3d')]=[{'all':!![]}];}_0x2c90d1=_[_0x810c('0x39')]({},_0x2c90d1,_0xd13e2e[_0x810c('0x3a')]);return db['ZendeskConfiguration'][_0x810c('0x41')](_0x2c90d1)['then'](handleEntityNotFound(_0x18ba23,null))[_0x810c('0x3b')](respondWithResult(_0x18ba23,null))['catch'](handleError(_0x18ba23,null));};exports[_0x810c('0x42')]=function(_0x391aa4,_0x14cc72){return db[_0x810c('0x28')]['create'](_0x391aa4[_0x810c('0x43')],{})['then'](respondWithResult(_0x14cc72,0xc9))[_0x810c('0x44')](handleError(_0x14cc72,null));};exports[_0x810c('0x45')]=function(_0x49d3be,_0x523596){if(_0x49d3be[_0x810c('0x43')]['id']){delete _0x49d3be[_0x810c('0x43')]['id'];}return db['ZendeskConfiguration'][_0x810c('0x41')]({'where':{'id':_0x49d3be[_0x810c('0x46')]['id']}})['then'](handleEntityNotFound(_0x523596,null))['then'](saveUpdates(_0x49d3be[_0x810c('0x43')],null))['then'](respondWithResult(_0x523596,null))[_0x810c('0x44')](handleError(_0x523596,null));};exports['destroy']=function(_0x4b9483,_0x1c5a8f){return db[_0x810c('0x28')][_0x810c('0x41')]({'where':{'id':_0x4b9483['params']['id']}})[_0x810c('0x3b')](handleEntityNotFound(_0x1c5a8f,null))[_0x810c('0x3b')](removeEntity(_0x1c5a8f,null))['catch'](handleError(_0x1c5a8f,null));};exports[_0x810c('0x47')]=function(_0x560d09,_0x24c97f,_0x4db3d1){var _0xaea2ff={};var _0x46b486={};var _0x13967f;var _0x228d50;return db[_0x810c('0x28')][_0x810c('0x48')]({'where':{'id':_0x560d09[_0x810c('0x46')]['id']}})['then'](handleEntityNotFound(_0x24c97f,null))[_0x810c('0x3b')](function(_0x929392){if(_0x929392){_0x13967f=_0x929392;_0x46b486['model']=_[_0x810c('0x2d')](db[_0x810c('0x49')][_0x810c('0x29')]);_0x46b486[_0x810c('0x2e')]=_['keys'](_0x560d09[_0x810c('0x2e')]);_0x46b486[_0x810c('0x36')]=_[_0x810c('0x2f')](_0x46b486[_0x810c('0x40')],_0x46b486[_0x810c('0x2e')]);_0xaea2ff[_0x810c('0x31')]=_[_0x810c('0x2f')](_0x46b486[_0x810c('0x40')],qs[_0x810c('0x30')](_0x560d09['query'][_0x810c('0x30')]));_0xaea2ff[_0x810c('0x31')]=_0xaea2ff[_0x810c('0x31')][_0x810c('0x32')]?_0xaea2ff['attributes']:_0x46b486[_0x810c('0x40')];_0xaea2ff['order']=qs['sort'](_0x560d09['query'][_0x810c('0x34')]);_0xaea2ff[_0x810c('0x35')]=qs['filters'](_[_0x810c('0x37')](_0x560d09['query'],_0x46b486[_0x810c('0x36')]));if(_0x560d09[_0x810c('0x2e')][_0x810c('0x38')]){_0xaea2ff[_0x810c('0x35')]=_['merge'](_0xaea2ff[_0x810c('0x35')],{'$or':_[_0x810c('0x27')](_0xaea2ff['attributes'],function(_0xd4db4e){var _0x20a50c={};_0x20a50c[_0xd4db4e]={'$like':'%'+_0x560d09[_0x810c('0x2e')]['filter']+'%'};return _0x20a50c;})});}_0xaea2ff=_['merge']({},_0xaea2ff,_0x560d09[_0x810c('0x3a')]);return _0x13967f['getFields'](_0xaea2ff);}})['then'](function(_0x524374){if(_0x524374){_0x228d50=_0x524374[_0x810c('0x32')];if(!_0x560d09[_0x810c('0x2e')]['hasOwnProperty'](_0x810c('0x4a'))){_0xaea2ff['limit']=qs['limit'](_0x560d09[_0x810c('0x2e')]['limit']);_0xaea2ff[_0x810c('0x19')]=qs[_0x810c('0x19')](_0x560d09['query'][_0x810c('0x19')]);}return _0x13967f[_0x810c('0x47')](_0xaea2ff);}})[_0x810c('0x3b')](function(_0x1d8489){if(_0x1d8489){return _0x1d8489?{'count':_0x228d50,'rows':_0x1d8489}:null;}})[_0x810c('0x3b')](respondWithResult(_0x24c97f,null))['catch'](handleError(_0x24c97f,null));};exports[_0x810c('0x4b')]=function(_0x13923a,_0x562a43,_0x48856e){var _0x3d2489={};var _0x59a84d={};var _0x2b3eb3;var _0xf8e140;return db[_0x810c('0x28')][_0x810c('0x48')]({'where':{'id':_0x13923a[_0x810c('0x46')]['id']}})[_0x810c('0x3b')](handleEntityNotFound(_0x562a43,null))[_0x810c('0x3b')](function(_0x57c347){if(_0x57c347){_0x2b3eb3=_0x57c347;_0x59a84d[_0x810c('0x40')]=_['keys'](db['ZendeskField'][_0x810c('0x29')]);_0x59a84d[_0x810c('0x2e')]=_[_0x810c('0x2d')](_0x13923a['query']);_0x59a84d[_0x810c('0x36')]=_[_0x810c('0x2f')](_0x59a84d['model'],_0x59a84d[_0x810c('0x2e')]);_0x3d2489['attributes']=_['intersection'](_0x59a84d[_0x810c('0x40')],qs[_0x810c('0x30')](_0x13923a[_0x810c('0x2e')]['fields']));_0x3d2489[_0x810c('0x31')]=_0x3d2489['attributes']['length']?_0x3d2489['attributes']:_0x59a84d['model'];_0x3d2489['order']=qs['sort'](_0x13923a[_0x810c('0x2e')][_0x810c('0x34')]);_0x3d2489[_0x810c('0x35')]=qs['filters'](_[_0x810c('0x37')](_0x13923a['query'],_0x59a84d['filters']));if(_0x13923a[_0x810c('0x2e')][_0x810c('0x38')]){_0x3d2489[_0x810c('0x35')]=_[_0x810c('0x39')](_0x3d2489[_0x810c('0x35')],{'$or':_['map'](_0x3d2489[_0x810c('0x31')],function(_0x4b27d5){var _0x42feeb={};_0x42feeb[_0x4b27d5]={'$like':'%'+_0x13923a[_0x810c('0x2e')][_0x810c('0x38')]+'%'};return _0x42feeb;})});}_0x3d2489=_[_0x810c('0x39')]({},_0x3d2489,_0x13923a['options']);return _0x2b3eb3['getSubjects'](_0x3d2489);}})[_0x810c('0x3b')](function(_0x5a6f84){if(_0x5a6f84){_0xf8e140=_0x5a6f84['length'];if(!_0x13923a[_0x810c('0x2e')][_0x810c('0x4c')]('nolimit')){_0x3d2489['limit']=qs[_0x810c('0x1b')](_0x13923a[_0x810c('0x2e')][_0x810c('0x1b')]);_0x3d2489[_0x810c('0x19')]=qs[_0x810c('0x19')](_0x13923a[_0x810c('0x2e')][_0x810c('0x19')]);}return _0x2b3eb3[_0x810c('0x4b')](_0x3d2489);}})[_0x810c('0x3b')](function(_0x42768f){if(_0x42768f){return _0x42768f?{'count':_0xf8e140,'rows':_0x42768f}:null;}})[_0x810c('0x3b')](respondWithResult(_0x562a43,null))[_0x810c('0x44')](handleError(_0x562a43,null));};exports[_0x810c('0x4d')]=function(_0x11707d,_0xe1d7b2,_0x58da1c){var _0x434c1e={};var _0x1061e5={};var _0x11a368;var _0x1c4db0;return db[_0x810c('0x28')][_0x810c('0x48')]({'where':{'id':_0x11707d['params']['id']}})[_0x810c('0x3b')](handleEntityNotFound(_0xe1d7b2,null))['then'](function(_0x4df84d){if(_0x4df84d){_0x11a368=_0x4df84d;_0x1061e5[_0x810c('0x40')]=_['keys'](db[_0x810c('0x49')]['rawAttributes']);_0x1061e5[_0x810c('0x2e')]=_[_0x810c('0x2d')](_0x11707d['query']);_0x1061e5[_0x810c('0x36')]=_[_0x810c('0x2f')](_0x1061e5[_0x810c('0x40')],_0x1061e5[_0x810c('0x2e')]);_0x434c1e[_0x810c('0x31')]=_['intersection'](_0x1061e5[_0x810c('0x40')],qs[_0x810c('0x30')](_0x11707d['query'][_0x810c('0x30')]));_0x434c1e[_0x810c('0x31')]=_0x434c1e['attributes'][_0x810c('0x32')]?_0x434c1e[_0x810c('0x31')]:_0x1061e5[_0x810c('0x40')];_0x434c1e['order']=qs[_0x810c('0x34')](_0x11707d['query'][_0x810c('0x34')]);_0x434c1e[_0x810c('0x35')]=qs[_0x810c('0x36')](_[_0x810c('0x37')](_0x11707d[_0x810c('0x2e')],_0x1061e5[_0x810c('0x36')]));if(_0x11707d[_0x810c('0x2e')][_0x810c('0x38')]){_0x434c1e[_0x810c('0x35')]=_[_0x810c('0x39')](_0x434c1e['where'],{'$or':_[_0x810c('0x27')](_0x434c1e[_0x810c('0x31')],function(_0x469cb2){var _0xd42439={};_0xd42439[_0x469cb2]={'$like':'%'+_0x11707d[_0x810c('0x2e')][_0x810c('0x38')]+'%'};return _0xd42439;})});}_0x434c1e=_[_0x810c('0x39')]({},_0x434c1e,_0x11707d[_0x810c('0x3a')]);return _0x11a368[_0x810c('0x4d')](_0x434c1e);}})[_0x810c('0x3b')](function(_0x55f101){if(_0x55f101){_0x1c4db0=_0x55f101['length'];if(!_0x11707d[_0x810c('0x2e')]['hasOwnProperty'](_0x810c('0x4a'))){_0x434c1e['limit']=qs[_0x810c('0x1b')](_0x11707d[_0x810c('0x2e')][_0x810c('0x1b')]);_0x434c1e[_0x810c('0x19')]=qs[_0x810c('0x19')](_0x11707d[_0x810c('0x2e')][_0x810c('0x19')]);}return _0x11a368[_0x810c('0x4d')](_0x434c1e);}})[_0x810c('0x3b')](function(_0x149c82){if(_0x149c82){return _0x149c82?{'count':_0x1c4db0,'rows':_0x149c82}:null;}})['then'](respondWithResult(_0xe1d7b2,null))[_0x810c('0x44')](handleError(_0xe1d7b2,null));};exports['getTags']=function(_0x178a7f,_0x4d46da,_0x16d6cf){var _0x353675={};var _0x84a605={};var _0x480c75;var _0x232509;return db['ZendeskConfiguration'][_0x810c('0x48')]({'where':{'id':_0x178a7f[_0x810c('0x46')]['id']}})[_0x810c('0x3b')](handleEntityNotFound(_0x4d46da,null))[_0x810c('0x3b')](function(_0x1f2281){if(_0x1f2281){_0x480c75=_0x1f2281;_0x84a605['model']=_[_0x810c('0x2d')](db[_0x810c('0x4e')][_0x810c('0x29')]);_0x84a605[_0x810c('0x2e')]=_[_0x810c('0x2d')](_0x178a7f[_0x810c('0x2e')]);_0x84a605[_0x810c('0x36')]=_['intersection'](_0x84a605['model'],_0x84a605[_0x810c('0x2e')]);_0x353675[_0x810c('0x31')]=_[_0x810c('0x2f')](_0x84a605[_0x810c('0x40')],qs[_0x810c('0x30')](_0x178a7f[_0x810c('0x2e')][_0x810c('0x30')]));_0x353675[_0x810c('0x31')]=_0x353675[_0x810c('0x31')]['length']?_0x353675[_0x810c('0x31')]:_0x84a605[_0x810c('0x40')];_0x353675[_0x810c('0x33')]=qs[_0x810c('0x34')](_0x178a7f[_0x810c('0x2e')][_0x810c('0x34')]);_0x353675[_0x810c('0x35')]=qs[_0x810c('0x36')](_[_0x810c('0x37')](_0x178a7f[_0x810c('0x2e')],_0x84a605['filters']));if(_0x178a7f[_0x810c('0x2e')][_0x810c('0x38')]){_0x353675[_0x810c('0x35')]=_[_0x810c('0x39')](_0x353675['where'],{'$or':_[_0x810c('0x27')](_0x353675['attributes'],function(_0x31995b){var _0x14ab2b={};_0x14ab2b[_0x31995b]={'$like':'%'+_0x178a7f[_0x810c('0x2e')]['filter']+'%'};return _0x14ab2b;})});}_0x353675=_['merge']({},_0x353675,_0x178a7f[_0x810c('0x3a')]);return _0x480c75[_0x810c('0x4f')](_0x353675);}})[_0x810c('0x3b')](function(_0x1e6c5d){if(_0x1e6c5d){_0x232509=_0x1e6c5d[_0x810c('0x32')];if(!_0x178a7f[_0x810c('0x2e')][_0x810c('0x4c')]('nolimit')){_0x353675[_0x810c('0x1b')]=qs[_0x810c('0x1b')](_0x178a7f[_0x810c('0x2e')][_0x810c('0x1b')]);_0x353675['offset']=qs[_0x810c('0x19')](_0x178a7f[_0x810c('0x2e')]['offset']);}return _0x480c75[_0x810c('0x4f')](_0x353675);}})[_0x810c('0x3b')](function(_0x1d0920){if(_0x1d0920){return _0x1d0920?{'count':_0x232509,'rows':_0x1d0920}:null;}})[_0x810c('0x3b')](respondWithResult(_0x4d46da,null))[_0x810c('0x44')](handleError(_0x4d46da,null));};exports[_0x810c('0x50')]=function(_0x35ac71,_0x5ddbf1,_0x1a45dc){if(_0x35ac71[_0x810c('0x43')]['id']){delete _0x35ac71[_0x810c('0x43')]['id'];}return db[_0x810c('0x28')][_0x810c('0x48')]({'where':{'id':_0x35ac71[_0x810c('0x46')]['id']}})[_0x810c('0x3b')](handleEntityNotFound(_0x5ddbf1,null))[_0x810c('0x3b')](function(_0xdf85ae){if(_0xdf85ae){return _0xdf85ae[_0x810c('0x50')](_0x35ac71[_0x810c('0x43')][_0x810c('0x51')]||[]);}return null;})['then'](respondWithResult(_0x5ddbf1,null))[_0x810c('0x44')](handleError(_0x5ddbf1,null));};
\ No newline at end of file
+var _0x0c57=['body','destroy','getFields','findOne','getSubjects','getDescriptions','ZendeskField','getTags','Tag','setTags','ids','eml-format','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','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','apply','save','then','name','send','index','ZendeskConfiguration','fieldName','type','key','model','map','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','include','findAll','catch','show','params','keys','rawAttributes','includeAll','find','create'];(function(_0x32a884,_0x183853){var _0x242f9b=function(_0x556c63){while(--_0x556c63){_0x32a884['push'](_0x32a884['shift']());}};_0x242f9b(++_0x183853);}(_0x0c57,0x107));var _0x70c5=function(_0x40d73f,_0x1422dc){_0x40d73f=_0x40d73f-0x0;var _0x123a9c=_0x0c57[_0x40d73f];return _0x123a9c;};'use strict';var emlformat=require(_0x70c5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x70c5('0x1'));var jsonpatch=require(_0x70c5('0x2'));var rp=require(_0x70c5('0x3'));var moment=require('moment');var BPromise=require(_0x70c5('0x4'));var Mustache=require(_0x70c5('0x5'));var util=require(_0x70c5('0x6'));var path=require(_0x70c5('0x7'));var sox=require(_0x70c5('0x8'));var csv=require(_0x70c5('0x9'));var ejs=require(_0x70c5('0xa'));var fs=require('fs');var fs_extra=require(_0x70c5('0xb'));var _=require(_0x70c5('0xc'));var squel=require(_0x70c5('0xd'));var crypto=require(_0x70c5('0xe'));var jsforce=require(_0x70c5('0xf'));var deskjs=require(_0x70c5('0x10'));var toCsv=require('to-csv');var querystring=require(_0x70c5('0x11'));var Papa=require(_0x70c5('0x12'));var Redis=require(_0x70c5('0x13'));var authService=require(_0x70c5('0x14'));var qs=require(_0x70c5('0x15'));var as=require(_0x70c5('0x16'));var hardwareService=require(_0x70c5('0x17'));var logger=require(_0x70c5('0x18'))('api');var utils=require(_0x70c5('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x70c5('0x1a'));var db=require(_0x70c5('0x1b'))['db'];function respondWithStatusCode(_0x46c0a1,_0x13f0f5){_0x13f0f5=_0x13f0f5||0xcc;return function(_0x2f3805){if(_0x2f3805){return _0x46c0a1[_0x70c5('0x1c')](_0x13f0f5);}return _0x46c0a1[_0x70c5('0x1d')](_0x13f0f5)[_0x70c5('0x1e')]();};}function respondWithResult(_0x295866,_0x54e421){_0x54e421=_0x54e421||0xc8;return function(_0x5d6112){if(_0x5d6112){return _0x295866[_0x70c5('0x1d')](_0x54e421)[_0x70c5('0x1f')](_0x5d6112);}};}function respondWithFilteredResult(_0x4f7f1a,_0x3e56f8){return function(_0x336584){if(_0x336584){var _0x5866b5=typeof _0x3e56f8[_0x70c5('0x20')]===_0x70c5('0x21')&&typeof _0x3e56f8[_0x70c5('0x22')]===_0x70c5('0x21');var _0x2969cc=_0x336584[_0x70c5('0x23')];var _0x25eaab=_0x5866b5?0x0:_0x3e56f8[_0x70c5('0x20')];var _0x19ee07=_0x5866b5?_0x336584[_0x70c5('0x23')]:_0x3e56f8[_0x70c5('0x20')]+_0x3e56f8[_0x70c5('0x22')];var _0x44e1f0;if(_0x19ee07>=_0x2969cc){_0x19ee07=_0x2969cc;_0x44e1f0=0xc8;}else{_0x44e1f0=0xce;}_0x4f7f1a[_0x70c5('0x1d')](_0x44e1f0);return _0x4f7f1a['set']('Content-Range',_0x25eaab+'-'+_0x19ee07+'/'+_0x2969cc)['json'](_0x336584);}return null;};}function patchUpdates(_0x1f6220){return function(_0x12d817){try{jsonpatch[_0x70c5('0x24')](_0x12d817,_0x1f6220,!![]);}catch(_0x54e48f){return BPromise['reject'](_0x54e48f);}return _0x12d817[_0x70c5('0x25')]();};}function saveUpdates(_0x622cbb,_0x233cf7){return function(_0x4b9826){if(_0x4b9826){return _0x4b9826['update'](_0x622cbb)['then'](function(_0x143653){return _0x143653;});}return null;};}function removeEntity(_0x2dc6f3,_0xd2c458){return function(_0x1481b6){if(_0x1481b6){return _0x1481b6['destroy']()[_0x70c5('0x26')](function(){_0x2dc6f3[_0x70c5('0x1d')](0xcc)[_0x70c5('0x1e')]();});}};}function handleEntityNotFound(_0x4ea497,_0x58d67c){return function(_0x4f307e){if(!_0x4f307e){_0x4ea497['sendStatus'](0x194);}return _0x4f307e;};}function handleError(_0x2a5a9d,_0x36f4eb){_0x36f4eb=_0x36f4eb||0x1f4;return function(_0x42e989){logger['error'](_0x42e989['stack']);if(_0x42e989[_0x70c5('0x27')]){delete _0x42e989['name'];}_0x2a5a9d[_0x70c5('0x1d')](_0x36f4eb)[_0x70c5('0x28')](_0x42e989);};}exports[_0x70c5('0x29')]=function(_0x449c87,_0x20fb01){var _0x31146e={},_0x2ceeaa={},_0x3c9f40={'count':0x0,'rows':[]};var _0x179085=_['map'](db[_0x70c5('0x2a')]['rawAttributes'],function(_0x1357b4){return{'name':_0x1357b4[_0x70c5('0x2b')],'type':_0x1357b4[_0x70c5('0x2c')][_0x70c5('0x2d')]};});_0x2ceeaa[_0x70c5('0x2e')]=_[_0x70c5('0x2f')](_0x179085,_0x70c5('0x27'));_0x2ceeaa[_0x70c5('0x30')]=_['keys'](_0x449c87[_0x70c5('0x30')]);_0x2ceeaa[_0x70c5('0x31')]=_[_0x70c5('0x32')](_0x2ceeaa[_0x70c5('0x2e')],_0x2ceeaa[_0x70c5('0x30')]);_0x31146e['attributes']=_[_0x70c5('0x32')](_0x2ceeaa[_0x70c5('0x2e')],qs[_0x70c5('0x33')](_0x449c87[_0x70c5('0x30')][_0x70c5('0x33')]));_0x31146e['attributes']=_0x31146e[_0x70c5('0x34')][_0x70c5('0x35')]?_0x31146e[_0x70c5('0x34')]:_0x2ceeaa[_0x70c5('0x2e')];if(!_0x449c87['query'][_0x70c5('0x36')](_0x70c5('0x37'))){_0x31146e[_0x70c5('0x22')]=qs['limit'](_0x449c87['query'][_0x70c5('0x22')]);_0x31146e[_0x70c5('0x20')]=qs[_0x70c5('0x20')](_0x449c87[_0x70c5('0x30')][_0x70c5('0x20')]);}_0x31146e[_0x70c5('0x38')]=qs[_0x70c5('0x39')](_0x449c87[_0x70c5('0x30')][_0x70c5('0x39')]);_0x31146e[_0x70c5('0x3a')]=qs[_0x70c5('0x31')](_[_0x70c5('0x3b')](_0x449c87[_0x70c5('0x30')],_0x2ceeaa[_0x70c5('0x31')]),_0x179085);if(_0x449c87['query']['filter']){_0x31146e[_0x70c5('0x3a')]=_[_0x70c5('0x3c')](_0x31146e['where'],{'$or':_[_0x70c5('0x2f')](_0x179085,function(_0x587c8f){if(_0x587c8f['type']!=='VIRTUAL'){var _0x1ffc1f={};_0x1ffc1f[_0x587c8f[_0x70c5('0x27')]]={'$like':'%'+_0x449c87[_0x70c5('0x30')][_0x70c5('0x3d')]+'%'};return _0x1ffc1f;}})});}_0x31146e=_[_0x70c5('0x3c')]({},_0x31146e,_0x449c87[_0x70c5('0x3e')]);var _0x5d148f={'where':_0x31146e[_0x70c5('0x3a')]};return db[_0x70c5('0x2a')][_0x70c5('0x23')](_0x5d148f)[_0x70c5('0x26')](function(_0x63177b){_0x3c9f40['count']=_0x63177b;if(_0x449c87[_0x70c5('0x30')]['includeAll']){_0x31146e[_0x70c5('0x3f')]=[{'all':!![]}];}return db['ZendeskConfiguration'][_0x70c5('0x40')](_0x31146e);})['then'](function(_0x42f50a){_0x3c9f40['rows']=_0x42f50a;return _0x3c9f40;})['then'](respondWithFilteredResult(_0x20fb01,_0x31146e))[_0x70c5('0x41')](handleError(_0x20fb01,null));};exports[_0x70c5('0x42')]=function(_0x5a162f,_0x3270b1){var _0x42a350={'raw':![],'where':{'id':_0x5a162f[_0x70c5('0x43')]['id']}},_0x2a1a24={};_0x2a1a24['model']=_[_0x70c5('0x44')](db[_0x70c5('0x2a')][_0x70c5('0x45')]);_0x2a1a24[_0x70c5('0x30')]=_[_0x70c5('0x44')](_0x5a162f[_0x70c5('0x30')]);_0x2a1a24[_0x70c5('0x31')]=_['intersection'](_0x2a1a24['model'],_0x2a1a24[_0x70c5('0x30')]);_0x42a350[_0x70c5('0x34')]=_[_0x70c5('0x32')](_0x2a1a24['model'],qs[_0x70c5('0x33')](_0x5a162f[_0x70c5('0x30')][_0x70c5('0x33')]));_0x42a350[_0x70c5('0x34')]=_0x42a350[_0x70c5('0x34')]['length']?_0x42a350[_0x70c5('0x34')]:_0x2a1a24[_0x70c5('0x2e')];if(_0x5a162f[_0x70c5('0x30')][_0x70c5('0x46')]){_0x42a350[_0x70c5('0x3f')]=[{'all':!![]}];}_0x42a350=_[_0x70c5('0x3c')]({},_0x42a350,_0x5a162f[_0x70c5('0x3e')]);return db[_0x70c5('0x2a')][_0x70c5('0x47')](_0x42a350)[_0x70c5('0x26')](handleEntityNotFound(_0x3270b1,null))[_0x70c5('0x26')](respondWithResult(_0x3270b1,null))[_0x70c5('0x41')](handleError(_0x3270b1,null));};exports[_0x70c5('0x48')]=function(_0xababaa,_0x4d8a82){return db[_0x70c5('0x2a')][_0x70c5('0x48')](_0xababaa[_0x70c5('0x49')],{})[_0x70c5('0x26')](respondWithResult(_0x4d8a82,0xc9))[_0x70c5('0x41')](handleError(_0x4d8a82,null));};exports['update']=function(_0x48e237,_0x57f098){if(_0x48e237[_0x70c5('0x49')]['id']){delete _0x48e237[_0x70c5('0x49')]['id'];}return db['ZendeskConfiguration'][_0x70c5('0x47')]({'where':{'id':_0x48e237[_0x70c5('0x43')]['id']}})[_0x70c5('0x26')](handleEntityNotFound(_0x57f098,null))[_0x70c5('0x26')](saveUpdates(_0x48e237[_0x70c5('0x49')],null))[_0x70c5('0x26')](respondWithResult(_0x57f098,null))[_0x70c5('0x41')](handleError(_0x57f098,null));};exports[_0x70c5('0x4a')]=function(_0x2633aa,_0x42528f){return db['ZendeskConfiguration'][_0x70c5('0x47')]({'where':{'id':_0x2633aa[_0x70c5('0x43')]['id']}})[_0x70c5('0x26')](handleEntityNotFound(_0x42528f,null))[_0x70c5('0x26')](removeEntity(_0x42528f,null))['catch'](handleError(_0x42528f,null));};exports[_0x70c5('0x4b')]=function(_0x3b78c6,_0x375e04,_0x218421){var _0x444b01={};var _0x158615={};var _0x2e09d7;var _0x10a8c1;return db[_0x70c5('0x2a')][_0x70c5('0x4c')]({'where':{'id':_0x3b78c6[_0x70c5('0x43')]['id']}})[_0x70c5('0x26')](handleEntityNotFound(_0x375e04,null))[_0x70c5('0x26')](function(_0x135df8){if(_0x135df8){_0x2e09d7=_0x135df8;_0x158615[_0x70c5('0x2e')]=_[_0x70c5('0x44')](db['ZendeskField'][_0x70c5('0x45')]);_0x158615[_0x70c5('0x30')]=_[_0x70c5('0x44')](_0x3b78c6[_0x70c5('0x30')]);_0x158615[_0x70c5('0x31')]=_[_0x70c5('0x32')](_0x158615[_0x70c5('0x2e')],_0x158615[_0x70c5('0x30')]);_0x444b01[_0x70c5('0x34')]=_['intersection'](_0x158615[_0x70c5('0x2e')],qs[_0x70c5('0x33')](_0x3b78c6[_0x70c5('0x30')]['fields']));_0x444b01[_0x70c5('0x34')]=_0x444b01['attributes'][_0x70c5('0x35')]?_0x444b01[_0x70c5('0x34')]:_0x158615[_0x70c5('0x2e')];_0x444b01[_0x70c5('0x38')]=qs[_0x70c5('0x39')](_0x3b78c6['query']['sort']);_0x444b01[_0x70c5('0x3a')]=qs[_0x70c5('0x31')](_[_0x70c5('0x3b')](_0x3b78c6[_0x70c5('0x30')],_0x158615[_0x70c5('0x31')]));if(_0x3b78c6['query'][_0x70c5('0x3d')]){_0x444b01[_0x70c5('0x3a')]=_[_0x70c5('0x3c')](_0x444b01['where'],{'$or':_[_0x70c5('0x2f')](_0x444b01[_0x70c5('0x34')],function(_0x41475d){var _0x21c8dd={};_0x21c8dd[_0x41475d]={'$like':'%'+_0x3b78c6[_0x70c5('0x30')][_0x70c5('0x3d')]+'%'};return _0x21c8dd;})});}_0x444b01=_[_0x70c5('0x3c')]({},_0x444b01,_0x3b78c6[_0x70c5('0x3e')]);return _0x2e09d7[_0x70c5('0x4b')](_0x444b01);}})[_0x70c5('0x26')](function(_0x3713bd){if(_0x3713bd){_0x10a8c1=_0x3713bd[_0x70c5('0x35')];if(!_0x3b78c6['query']['hasOwnProperty'](_0x70c5('0x37'))){_0x444b01[_0x70c5('0x22')]=qs[_0x70c5('0x22')](_0x3b78c6[_0x70c5('0x30')][_0x70c5('0x22')]);_0x444b01[_0x70c5('0x20')]=qs[_0x70c5('0x20')](_0x3b78c6[_0x70c5('0x30')][_0x70c5('0x20')]);}return _0x2e09d7[_0x70c5('0x4b')](_0x444b01);}})[_0x70c5('0x26')](function(_0x1eed6f){if(_0x1eed6f){return _0x1eed6f?{'count':_0x10a8c1,'rows':_0x1eed6f}:null;}})[_0x70c5('0x26')](respondWithResult(_0x375e04,null))[_0x70c5('0x41')](handleError(_0x375e04,null));};exports[_0x70c5('0x4d')]=function(_0x56e4e8,_0x2ca94a,_0x2ac1e0){var _0x5783ef={};var _0x417b05={};var _0x6ccde3;var _0x455798;return db['ZendeskConfiguration'][_0x70c5('0x4c')]({'where':{'id':_0x56e4e8[_0x70c5('0x43')]['id']}})[_0x70c5('0x26')](handleEntityNotFound(_0x2ca94a,null))[_0x70c5('0x26')](function(_0x5b8dbb){if(_0x5b8dbb){_0x6ccde3=_0x5b8dbb;_0x417b05['model']=_[_0x70c5('0x44')](db['ZendeskField'][_0x70c5('0x45')]);_0x417b05[_0x70c5('0x30')]=_[_0x70c5('0x44')](_0x56e4e8[_0x70c5('0x30')]);_0x417b05['filters']=_[_0x70c5('0x32')](_0x417b05[_0x70c5('0x2e')],_0x417b05[_0x70c5('0x30')]);_0x5783ef[_0x70c5('0x34')]=_[_0x70c5('0x32')](_0x417b05['model'],qs[_0x70c5('0x33')](_0x56e4e8['query'][_0x70c5('0x33')]));_0x5783ef[_0x70c5('0x34')]=_0x5783ef[_0x70c5('0x34')][_0x70c5('0x35')]?_0x5783ef[_0x70c5('0x34')]:_0x417b05[_0x70c5('0x2e')];_0x5783ef[_0x70c5('0x38')]=qs['sort'](_0x56e4e8[_0x70c5('0x30')][_0x70c5('0x39')]);_0x5783ef['where']=qs[_0x70c5('0x31')](_['pick'](_0x56e4e8[_0x70c5('0x30')],_0x417b05[_0x70c5('0x31')]));if(_0x56e4e8[_0x70c5('0x30')][_0x70c5('0x3d')]){_0x5783ef[_0x70c5('0x3a')]=_[_0x70c5('0x3c')](_0x5783ef[_0x70c5('0x3a')],{'$or':_['map'](_0x5783ef['attributes'],function(_0x3b718b){var _0x1ac07f={};_0x1ac07f[_0x3b718b]={'$like':'%'+_0x56e4e8[_0x70c5('0x30')][_0x70c5('0x3d')]+'%'};return _0x1ac07f;})});}_0x5783ef=_['merge']({},_0x5783ef,_0x56e4e8[_0x70c5('0x3e')]);return _0x6ccde3[_0x70c5('0x4d')](_0x5783ef);}})[_0x70c5('0x26')](function(_0x3aced4){if(_0x3aced4){_0x455798=_0x3aced4[_0x70c5('0x35')];if(!_0x56e4e8[_0x70c5('0x30')][_0x70c5('0x36')](_0x70c5('0x37'))){_0x5783ef['limit']=qs[_0x70c5('0x22')](_0x56e4e8[_0x70c5('0x30')][_0x70c5('0x22')]);_0x5783ef[_0x70c5('0x20')]=qs[_0x70c5('0x20')](_0x56e4e8[_0x70c5('0x30')][_0x70c5('0x20')]);}return _0x6ccde3[_0x70c5('0x4d')](_0x5783ef);}})[_0x70c5('0x26')](function(_0x50d718){if(_0x50d718){return _0x50d718?{'count':_0x455798,'rows':_0x50d718}:null;}})[_0x70c5('0x26')](respondWithResult(_0x2ca94a,null))[_0x70c5('0x41')](handleError(_0x2ca94a,null));};exports[_0x70c5('0x4e')]=function(_0x46d4d1,_0x1860c9,_0x20b9ff){var _0x3a4974={};var _0x1197db={};var _0x5c9bc3;var _0x4daf1b;return db['ZendeskConfiguration'][_0x70c5('0x4c')]({'where':{'id':_0x46d4d1[_0x70c5('0x43')]['id']}})[_0x70c5('0x26')](handleEntityNotFound(_0x1860c9,null))[_0x70c5('0x26')](function(_0x2d3020){if(_0x2d3020){_0x5c9bc3=_0x2d3020;_0x1197db[_0x70c5('0x2e')]=_['keys'](db[_0x70c5('0x4f')][_0x70c5('0x45')]);_0x1197db[_0x70c5('0x30')]=_[_0x70c5('0x44')](_0x46d4d1[_0x70c5('0x30')]);_0x1197db[_0x70c5('0x31')]=_[_0x70c5('0x32')](_0x1197db[_0x70c5('0x2e')],_0x1197db[_0x70c5('0x30')]);_0x3a4974['attributes']=_[_0x70c5('0x32')](_0x1197db['model'],qs[_0x70c5('0x33')](_0x46d4d1[_0x70c5('0x30')][_0x70c5('0x33')]));_0x3a4974['attributes']=_0x3a4974['attributes'][_0x70c5('0x35')]?_0x3a4974['attributes']:_0x1197db[_0x70c5('0x2e')];_0x3a4974[_0x70c5('0x38')]=qs['sort'](_0x46d4d1[_0x70c5('0x30')][_0x70c5('0x39')]);_0x3a4974[_0x70c5('0x3a')]=qs[_0x70c5('0x31')](_[_0x70c5('0x3b')](_0x46d4d1[_0x70c5('0x30')],_0x1197db['filters']));if(_0x46d4d1[_0x70c5('0x30')][_0x70c5('0x3d')]){_0x3a4974[_0x70c5('0x3a')]=_[_0x70c5('0x3c')](_0x3a4974[_0x70c5('0x3a')],{'$or':_[_0x70c5('0x2f')](_0x3a4974[_0x70c5('0x34')],function(_0x21cc56){var _0x41f95f={};_0x41f95f[_0x21cc56]={'$like':'%'+_0x46d4d1[_0x70c5('0x30')][_0x70c5('0x3d')]+'%'};return _0x41f95f;})});}_0x3a4974=_[_0x70c5('0x3c')]({},_0x3a4974,_0x46d4d1[_0x70c5('0x3e')]);return _0x5c9bc3['getDescriptions'](_0x3a4974);}})[_0x70c5('0x26')](function(_0x1ac048){if(_0x1ac048){_0x4daf1b=_0x1ac048[_0x70c5('0x35')];if(!_0x46d4d1[_0x70c5('0x30')]['hasOwnProperty'](_0x70c5('0x37'))){_0x3a4974['limit']=qs[_0x70c5('0x22')](_0x46d4d1['query'][_0x70c5('0x22')]);_0x3a4974[_0x70c5('0x20')]=qs['offset'](_0x46d4d1[_0x70c5('0x30')][_0x70c5('0x20')]);}return _0x5c9bc3[_0x70c5('0x4e')](_0x3a4974);}})[_0x70c5('0x26')](function(_0x1ab817){if(_0x1ab817){return _0x1ab817?{'count':_0x4daf1b,'rows':_0x1ab817}:null;}})[_0x70c5('0x26')](respondWithResult(_0x1860c9,null))[_0x70c5('0x41')](handleError(_0x1860c9,null));};exports[_0x70c5('0x50')]=function(_0x1bbd48,_0x24d360,_0x2ac3ef){var _0x15bf39={};var _0xd1c142={};var _0xb616d3;var _0xff2c30;return db[_0x70c5('0x2a')][_0x70c5('0x4c')]({'where':{'id':_0x1bbd48['params']['id']}})['then'](handleEntityNotFound(_0x24d360,null))[_0x70c5('0x26')](function(_0x110a41){if(_0x110a41){_0xb616d3=_0x110a41;_0xd1c142['model']=_['keys'](db[_0x70c5('0x51')][_0x70c5('0x45')]);_0xd1c142[_0x70c5('0x30')]=_['keys'](_0x1bbd48[_0x70c5('0x30')]);_0xd1c142[_0x70c5('0x31')]=_[_0x70c5('0x32')](_0xd1c142[_0x70c5('0x2e')],_0xd1c142[_0x70c5('0x30')]);_0x15bf39[_0x70c5('0x34')]=_[_0x70c5('0x32')](_0xd1c142[_0x70c5('0x2e')],qs['fields'](_0x1bbd48[_0x70c5('0x30')][_0x70c5('0x33')]));_0x15bf39[_0x70c5('0x34')]=_0x15bf39[_0x70c5('0x34')][_0x70c5('0x35')]?_0x15bf39['attributes']:_0xd1c142[_0x70c5('0x2e')];_0x15bf39['order']=qs[_0x70c5('0x39')](_0x1bbd48['query'][_0x70c5('0x39')]);_0x15bf39[_0x70c5('0x3a')]=qs['filters'](_[_0x70c5('0x3b')](_0x1bbd48[_0x70c5('0x30')],_0xd1c142[_0x70c5('0x31')]));if(_0x1bbd48['query']['filter']){_0x15bf39[_0x70c5('0x3a')]=_[_0x70c5('0x3c')](_0x15bf39[_0x70c5('0x3a')],{'$or':_[_0x70c5('0x2f')](_0x15bf39[_0x70c5('0x34')],function(_0x3b67a7){var _0x920b86={};_0x920b86[_0x3b67a7]={'$like':'%'+_0x1bbd48['query'][_0x70c5('0x3d')]+'%'};return _0x920b86;})});}_0x15bf39=_[_0x70c5('0x3c')]({},_0x15bf39,_0x1bbd48['options']);return _0xb616d3[_0x70c5('0x50')](_0x15bf39);}})['then'](function(_0x5d55b3){if(_0x5d55b3){_0xff2c30=_0x5d55b3[_0x70c5('0x35')];if(!_0x1bbd48[_0x70c5('0x30')][_0x70c5('0x36')](_0x70c5('0x37'))){_0x15bf39[_0x70c5('0x22')]=qs['limit'](_0x1bbd48[_0x70c5('0x30')][_0x70c5('0x22')]);_0x15bf39[_0x70c5('0x20')]=qs[_0x70c5('0x20')](_0x1bbd48[_0x70c5('0x30')][_0x70c5('0x20')]);}return _0xb616d3[_0x70c5('0x50')](_0x15bf39);}})[_0x70c5('0x26')](function(_0x278162){if(_0x278162){return _0x278162?{'count':_0xff2c30,'rows':_0x278162}:null;}})['then'](respondWithResult(_0x24d360,null))[_0x70c5('0x41')](handleError(_0x24d360,null));};exports['setTags']=function(_0x14421b,_0x4b18d9,_0x30d155){if(_0x14421b[_0x70c5('0x49')]['id']){delete _0x14421b[_0x70c5('0x49')]['id'];}return db[_0x70c5('0x2a')]['findOne']({'where':{'id':_0x14421b[_0x70c5('0x43')]['id']}})[_0x70c5('0x26')](handleEntityNotFound(_0x4b18d9,null))['then'](function(_0x3bdc07){if(_0x3bdc07){return _0x3bdc07[_0x70c5('0x52')](_0x14421b[_0x70c5('0x49')][_0x70c5('0x53')]||[]);}return null;})[_0x70c5('0x26')](respondWithResult(_0x4b18d9,null))[_0x70c5('0x41')](handleError(_0x4b18d9,null));};
\ No newline at end of file
index e5252cd..107ff88 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3266=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intZendeskConfiguration.attributes','define','int_zendesk_configurations','lodash','util'];(function(_0x401ade,_0x4686f0){var _0x773892=function(_0x30b0cb){while(--_0x30b0cb){_0x401ade['push'](_0x401ade['shift']());}};_0x773892(++_0x4686f0);}(_0x3266,0x6a));var _0x6326=function(_0x11a220,_0x4e470a){_0x11a220=_0x11a220-0x0;var _0x20d8fe=_0x3266[_0x11a220];return _0x20d8fe;};'use strict';var _=require(_0x6326('0x0'));var util=require(_0x6326('0x1'));var logger=require(_0x6326('0x2'))(_0x6326('0x3'));var moment=require(_0x6326('0x4'));var BPromise=require(_0x6326('0x5'));var rp=require(_0x6326('0x6'));var fs=require('fs');var path=require(_0x6326('0x7'));var rimraf=require(_0x6326('0x8'));var config=require('../../config/environment');var attributes=require(_0x6326('0x9'));module['exports']=function(_0x25ecd8,_0x44460c){return _0x25ecd8[_0x6326('0xa')]('ZendeskConfiguration',attributes,{'tableName':_0x6326('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x351d=['../../config/environment','exports','ZendeskConfiguration','int_zendesk_configurations','lodash','../../config/logger','api','moment','request-promise','rimraf'];(function(_0x44ee06,_0x5ae651){var _0x1032d8=function(_0x14a742){while(--_0x14a742){_0x44ee06['push'](_0x44ee06['shift']());}};_0x1032d8(++_0x5ae651);}(_0x351d,0x90));var _0xd351=function(_0x310449,_0x49ef86){_0x310449=_0x310449-0x0;var _0x570713=_0x351d[_0x310449];return _0x570713;};'use strict';var _=require(_0xd351('0x0'));var util=require('util');var logger=require(_0xd351('0x1'))(_0xd351('0x2'));var moment=require(_0xd351('0x3'));var BPromise=require('bluebird');var rp=require(_0xd351('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd351('0x5'));var config=require(_0xd351('0x6'));var attributes=require('./intZendeskConfiguration.attributes');module[_0xd351('0x7')]=function(_0x45e9e5,_0x88bd2b){return _0x45e9e5['define'](_0xd351('0x8'),attributes,{'tableName':_0xd351('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index c0596bd..75d796a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3da9=['error','message','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','info','ZendeskConfiguration,\x20%s,\x20%s','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3da9,0x1d3));var _0x93da=function(_0x42e9bb,_0x16f58f){_0x42e9bb=_0x42e9bb-0x0;var _0x1952f9=_0x3da9[_0x42e9bb];return _0x1952f9;};'use strict';var _=require(_0x93da('0x0'));var util=require(_0x93da('0x1'));var moment=require(_0x93da('0x2'));var BPromise=require(_0x93da('0x3'));var rs=require(_0x93da('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x93da('0x5'))['db'];var utils=require(_0x93da('0x6'));var logger=require('../../config/logger')(_0x93da('0x7'));var config=require(_0x93da('0x8'));var jayson=require(_0x93da('0x9'));var client=jayson['client'][_0x93da('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2beb17,_0x4fc541,_0xb8af00){return new BPromise(function(_0x500f50,_0x565919){return client['request'](_0x2beb17,_0xb8af00)['then'](function(_0x41e820){logger[_0x93da('0xb')](_0x93da('0xc'),_0x4fc541,'request\x20sent');logger[_0x93da('0xd')](_0x93da('0xe'),_0x4fc541,'request\x20sent',JSON[_0x93da('0xf')](_0x41e820));if(_0x41e820[_0x93da('0x10')]){if(_0x41e820[_0x93da('0x10')]['code']===0x1f4){logger[_0x93da('0x10')](_0x93da('0xc'),_0x4fc541,_0x41e820[_0x93da('0x10')][_0x93da('0x11')]);return _0x565919(_0x41e820[_0x93da('0x10')][_0x93da('0x11')]);}logger['error'](_0x93da('0xc'),_0x4fc541,_0x41e820[_0x93da('0x10')][_0x93da('0x11')]);return _0x500f50(_0x41e820[_0x93da('0x10')][_0x93da('0x11')]);}else{logger[_0x93da('0xb')](_0x93da('0xc'),_0x4fc541,_0x93da('0x12'));_0x500f50(_0x41e820[_0x93da('0x13')][_0x93da('0x11')]);}})[_0x93da('0x14')](function(_0x2abaaf){logger['error'](_0x93da('0xc'),_0x4fc541,_0x2abaaf);_0x565919(_0x2abaaf);});});}
\ No newline at end of file
+var _0x498e=['request','then','ZendeskConfiguration,\x20%s,\x20%s','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x498e,0xe7));var _0xe498=function(_0x402fa6,_0x307f1b){_0x402fa6=_0x402fa6-0x0;var _0x19f0c5=_0x498e[_0x402fa6];return _0x19f0c5;};'use strict';var _=require(_0xe498('0x0'));var util=require(_0xe498('0x1'));var moment=require(_0xe498('0x2'));var BPromise=require('bluebird');var rs=require(_0xe498('0x3'));var fs=require('fs');var Redis=require(_0xe498('0x4'));var db=require(_0xe498('0x5'))['db'];var utils=require(_0xe498('0x6'));var logger=require('../../config/logger')(_0xe498('0x7'));var config=require(_0xe498('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xe498('0x9')][_0xe498('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x50236a,_0x14f013,_0x17ac78){return new BPromise(function(_0x5262de,_0x2a7072){return client[_0xe498('0xb')](_0x50236a,_0x17ac78)[_0xe498('0xc')](function(_0x352c4e){logger['info'](_0xe498('0xd'),_0x14f013,'request\x20sent');logger['debug'](_0xe498('0xe'),_0x14f013,_0xe498('0xf'),JSON[_0xe498('0x10')](_0x352c4e));if(_0x352c4e[_0xe498('0x11')]){if(_0x352c4e[_0xe498('0x11')][_0xe498('0x12')]===0x1f4){logger[_0xe498('0x11')](_0xe498('0xd'),_0x14f013,_0x352c4e['error']['message']);return _0x2a7072(_0x352c4e[_0xe498('0x11')][_0xe498('0x13')]);}logger[_0xe498('0x11')]('ZendeskConfiguration,\x20%s,\x20%s',_0x14f013,_0x352c4e['error']['message']);return _0x5262de(_0x352c4e['error']['message']);}else{logger['info'](_0xe498('0xd'),_0x14f013,'request\x20sent');_0x5262de(_0x352c4e[_0xe498('0x14')][_0xe498('0x13')]);}})[_0xe498('0x15')](function(_0x8ef84c){logger[_0xe498('0x11')]('ZendeskConfiguration,\x20%s,\x20%s',_0x14f013,_0x8ef84c);_0x2a7072(_0x8ef84c);});});}
\ No newline at end of file
index fe2e925..a5cbecb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4c63=['../../components/interaction/service','../../config/environment','./intZendeskField.controller','get','isAuthenticated','/:id','show','post','put','update','delete','destroy','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x4180af,_0x1086a4){var _0x2a5ccf=function(_0x449bfc){while(--_0x449bfc){_0x4180af['push'](_0x4180af['shift']());}};_0x2a5ccf(++_0x1086a4);}(_0x4c63,0x150));var _0x34c6=function(_0x4150c1,_0x263412){_0x4150c1=_0x4150c1-0x0;var _0x9a9fdd=_0x4c63[_0x4150c1];return _0x9a9fdd;};'use strict';var multer=require('multer');var util=require(_0x34c6('0x0'));var path=require(_0x34c6('0x1'));var timeout=require(_0x34c6('0x2'));var express=require(_0x34c6('0x3'));var router=express[_0x34c6('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x34c6('0x5'));var interaction=require(_0x34c6('0x6'));var config=require(_0x34c6('0x7'));var controller=require(_0x34c6('0x8'));router[_0x34c6('0x9')]('/',auth[_0x34c6('0xa')](),controller['index']);router[_0x34c6('0x9')](_0x34c6('0xb'),auth[_0x34c6('0xa')](),controller[_0x34c6('0xc')]);router[_0x34c6('0xd')]('/',auth[_0x34c6('0xa')](),controller['create']);router[_0x34c6('0xe')](_0x34c6('0xb'),auth[_0x34c6('0xa')](),controller[_0x34c6('0xf')]);router[_0x34c6('0x10')](_0x34c6('0xb'),auth[_0x34c6('0xa')](),controller[_0x34c6('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0xa0e9=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskField.controller','get','isAuthenticated','index','/:id','create','put','update','delete','destroy','exports','util','path','connect-timeout','express'];(function(_0x4df17c,_0x2d2b61){var _0x4e79b5=function(_0x2134a5){while(--_0x2134a5){_0x4df17c['push'](_0x4df17c['shift']());}};_0x4e79b5(++_0x2d2b61);}(_0xa0e9,0x18c));var _0x9a0e=function(_0x2d5cbd,_0x286551){_0x2d5cbd=_0x2d5cbd-0x0;var _0x432a42=_0xa0e9[_0x2d5cbd];return _0x432a42;};'use strict';var multer=require('multer');var util=require(_0x9a0e('0x0'));var path=require(_0x9a0e('0x1'));var timeout=require(_0x9a0e('0x2'));var express=require(_0x9a0e('0x3'));var router=express[_0x9a0e('0x4')]();var fs_extra=require(_0x9a0e('0x5'));var auth=require(_0x9a0e('0x6'));var interaction=require(_0x9a0e('0x7'));var config=require(_0x9a0e('0x8'));var controller=require(_0x9a0e('0x9'));router[_0x9a0e('0xa')]('/',auth[_0x9a0e('0xb')](),controller[_0x9a0e('0xc')]);router[_0x9a0e('0xa')](_0x9a0e('0xd'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x9a0e('0xb')](),controller[_0x9a0e('0xe')]);router[_0x9a0e('0xf')](_0x9a0e('0xd'),auth['isAuthenticated'](),controller[_0x9a0e('0x10')]);router[_0x9a0e('0x11')](_0x9a0e('0xd'),auth[_0x9a0e('0xb')](),controller[_0x9a0e('0x12')]);module[_0x9a0e('0x13')]=router;
\ No newline at end of file
index 1f9086e..ccd4d31 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1317=['ENUM','customVariable','keyValue','picklist','string','STRING','variable'];(function(_0x26d877,_0x384864){var _0x297ecd=function(_0xe36c58){while(--_0xe36c58){_0x26d877['push'](_0x26d877['shift']());}};_0x297ecd(++_0x384864);}(_0x1317,0x10a));var _0x7131=function(_0x3875da,_0x11c93c){_0x3875da=_0x3875da-0x0;var _0x1451c4=_0x1317[_0x3875da];return _0x1451c4;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x7131('0x0')]('string','variable',_0x7131('0x1'),_0x7131('0x2'),_0x7131('0x3')),'defaultValue':_0x7131('0x4')},'content':{'type':Sequelize[_0x7131('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x7131('0x0')]('string',_0x7131('0x6'),_0x7131('0x1'))},'keyContent':{'type':Sequelize[_0x7131('0x5')]},'idField':{'type':Sequelize[_0x7131('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x6f9a=['BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable','keyValue','STRING'];(function(_0x4aad38,_0x1acb99){var _0x1cf2d3=function(_0x4b1598){while(--_0x4b1598){_0x4aad38['push'](_0x4aad38['shift']());}};_0x1cf2d3(++_0x1acb99);}(_0x6f9a,0x118));var _0xa6f9=function(_0x9b4a6c,_0x503cf8){_0x9b4a6c=_0x9b4a6c-0x0;var _0x4b2310=_0x6f9a[_0x9b4a6c];return _0x4b2310;};'use strict';var Sequelize=require(_0xa6f9('0x0'));module[_0xa6f9('0x1')]={'type':{'type':Sequelize[_0xa6f9('0x2')](_0xa6f9('0x3'),_0xa6f9('0x4'),_0xa6f9('0x5'),_0xa6f9('0x6'),'picklist'),'defaultValue':_0xa6f9('0x3')},'content':{'type':Sequelize[_0xa6f9('0x7')]},'key':{'type':Sequelize[_0xa6f9('0x7')]},'keyType':{'type':Sequelize[_0xa6f9('0x2')](_0xa6f9('0x3'),'variable',_0xa6f9('0x5'))},'keyContent':{'type':Sequelize[_0xa6f9('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xa6f9('0x7')]},'customField':{'type':Sequelize[_0xa6f9('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xa6f9('0x7')]}};
\ No newline at end of file
index 2a85726..e1d3950 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf2a9=['../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','destroy','then','end','error','stack','name','index','map','ZendeskField','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','sort','where','filter','VIRTUAL','includeAll','findAll','rows','catch','params','rawAttributes','merge','options','find','create','body','update','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment'];(function(_0x903228,_0x42c429){var _0xcec81d=function(_0x4da97a){while(--_0x4da97a){_0x903228['push'](_0x903228['shift']());}};_0xcec81d(++_0x42c429);}(_0xf2a9,0x77));var _0x9f2a=function(_0x2297ed,_0x3840a3){_0x2297ed=_0x2297ed-0x0;var _0x15eba7=_0xf2a9[_0x2297ed];return _0x15eba7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9f2a('0x0'));var zipdir=require(_0x9f2a('0x1'));var jsonpatch=require(_0x9f2a('0x2'));var rp=require('request-promise');var moment=require(_0x9f2a('0x3'));var BPromise=require(_0x9f2a('0x4'));var Mustache=require(_0x9f2a('0x5'));var util=require(_0x9f2a('0x6'));var path=require(_0x9f2a('0x7'));var sox=require('sox');var csv=require(_0x9f2a('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9f2a('0x9'));var squel=require('squel');var crypto=require(_0x9f2a('0xa'));var jsforce=require(_0x9f2a('0xb'));var deskjs=require(_0x9f2a('0xc'));var toCsv=require(_0x9f2a('0x8'));var querystring=require(_0x9f2a('0xd'));var Papa=require(_0x9f2a('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x9f2a('0xf'));var as=require(_0x9f2a('0x10'));var hardwareService=require(_0x9f2a('0x11'));var logger=require('../../config/logger')(_0x9f2a('0x12'));var utils=require(_0x9f2a('0x13'));var config=require(_0x9f2a('0x14'));var licenseUtil=require(_0x9f2a('0x15'));var db=require(_0x9f2a('0x16'))['db'];function respondWithStatusCode(_0x486314,_0x27e0bc){_0x27e0bc=_0x27e0bc||0xcc;return function(_0xd4163b){if(_0xd4163b){return _0x486314[_0x9f2a('0x17')](_0x27e0bc);}return _0x486314[_0x9f2a('0x18')](_0x27e0bc)['end']();};}function respondWithResult(_0x4f001d,_0x5241f8){_0x5241f8=_0x5241f8||0xc8;return function(_0x44c503){if(_0x44c503){return _0x4f001d[_0x9f2a('0x18')](_0x5241f8)[_0x9f2a('0x19')](_0x44c503);}};}function respondWithFilteredResult(_0x240c7b,_0x4d1813){return function(_0x1cd0c4){if(_0x1cd0c4){var _0x3b0e4b=typeof _0x4d1813[_0x9f2a('0x1a')]===_0x9f2a('0x1b')&&typeof _0x4d1813[_0x9f2a('0x1c')]===_0x9f2a('0x1b');var _0x3ea1da=_0x1cd0c4['count'];var _0x1ca43d=_0x3b0e4b?0x0:_0x4d1813[_0x9f2a('0x1a')];var _0x22937a=_0x3b0e4b?_0x1cd0c4[_0x9f2a('0x1d')]:_0x4d1813['offset']+_0x4d1813[_0x9f2a('0x1c')];var _0x1c84fa;if(_0x22937a>=_0x3ea1da){_0x22937a=_0x3ea1da;_0x1c84fa=0xc8;}else{_0x1c84fa=0xce;}_0x240c7b[_0x9f2a('0x18')](_0x1c84fa);return _0x240c7b[_0x9f2a('0x1e')](_0x9f2a('0x1f'),_0x1ca43d+'-'+_0x22937a+'/'+_0x3ea1da)[_0x9f2a('0x19')](_0x1cd0c4);}return null;};}function patchUpdates(_0x111016){return function(_0x4bcf7e){try{jsonpatch['apply'](_0x4bcf7e,_0x111016,!![]);}catch(_0x28d2c8){return BPromise[_0x9f2a('0x20')](_0x28d2c8);}return _0x4bcf7e[_0x9f2a('0x21')]();};}function saveUpdates(_0x5035ec,_0x10cdd2){return function(_0x5b6804){if(_0x5b6804){return _0x5b6804['update'](_0x5035ec)['then'](function(_0x2b4cf6){return _0x2b4cf6;});}return null;};}function removeEntity(_0x56b638,_0x5bcda3){return function(_0x1f8337){if(_0x1f8337){return _0x1f8337[_0x9f2a('0x22')]()[_0x9f2a('0x23')](function(){_0x56b638[_0x9f2a('0x18')](0xcc)[_0x9f2a('0x24')]();});}};}function handleEntityNotFound(_0x451782,_0x1d84fe){return function(_0x5eddbd){if(!_0x5eddbd){_0x451782[_0x9f2a('0x17')](0x194);}return _0x5eddbd;};}function handleError(_0x4b4565,_0x45f0ba){_0x45f0ba=_0x45f0ba||0x1f4;return function(_0x51d8f8){logger[_0x9f2a('0x25')](_0x51d8f8[_0x9f2a('0x26')]);if(_0x51d8f8[_0x9f2a('0x27')]){delete _0x51d8f8[_0x9f2a('0x27')];}_0x4b4565[_0x9f2a('0x18')](_0x45f0ba)['send'](_0x51d8f8);};}exports[_0x9f2a('0x28')]=function(_0xd91f9e,_0x4bda1f){var _0xc0a1b7={},_0x165bb3={},_0x2de7c5={'count':0x0,'rows':[]};var _0x22906a=_[_0x9f2a('0x29')](db[_0x9f2a('0x2a')]['rawAttributes'],function(_0x5b47ca){return{'name':_0x5b47ca[_0x9f2a('0x2b')],'type':_0x5b47ca[_0x9f2a('0x2c')][_0x9f2a('0x2d')]};});_0x165bb3[_0x9f2a('0x2e')]=_[_0x9f2a('0x29')](_0x22906a,'name');_0x165bb3[_0x9f2a('0x2f')]=_[_0x9f2a('0x30')](_0xd91f9e[_0x9f2a('0x2f')]);_0x165bb3[_0x9f2a('0x31')]=_[_0x9f2a('0x32')](_0x165bb3[_0x9f2a('0x2e')],_0x165bb3['query']);_0xc0a1b7[_0x9f2a('0x33')]=_[_0x9f2a('0x32')](_0x165bb3[_0x9f2a('0x2e')],qs[_0x9f2a('0x34')](_0xd91f9e[_0x9f2a('0x2f')][_0x9f2a('0x34')]));_0xc0a1b7[_0x9f2a('0x33')]=_0xc0a1b7[_0x9f2a('0x33')][_0x9f2a('0x35')]?_0xc0a1b7[_0x9f2a('0x33')]:_0x165bb3['model'];if(!_0xd91f9e[_0x9f2a('0x2f')]['hasOwnProperty']('nolimit')){_0xc0a1b7[_0x9f2a('0x1c')]=qs[_0x9f2a('0x1c')](_0xd91f9e[_0x9f2a('0x2f')]['limit']);_0xc0a1b7[_0x9f2a('0x1a')]=qs[_0x9f2a('0x1a')](_0xd91f9e[_0x9f2a('0x2f')][_0x9f2a('0x1a')]);}_0xc0a1b7['order']=qs[_0x9f2a('0x36')](_0xd91f9e[_0x9f2a('0x2f')]['sort']);_0xc0a1b7[_0x9f2a('0x37')]=qs[_0x9f2a('0x31')](_['pick'](_0xd91f9e[_0x9f2a('0x2f')],_0x165bb3[_0x9f2a('0x31')]),_0x22906a);if(_0xd91f9e[_0x9f2a('0x2f')][_0x9f2a('0x38')]){_0xc0a1b7[_0x9f2a('0x37')]=_['merge'](_0xc0a1b7['where'],{'$or':_[_0x9f2a('0x29')](_0x22906a,function(_0xa47fe5){if(_0xa47fe5[_0x9f2a('0x2c')]!==_0x9f2a('0x39')){var _0xf41039={};_0xf41039[_0xa47fe5[_0x9f2a('0x27')]]={'$like':'%'+_0xd91f9e[_0x9f2a('0x2f')][_0x9f2a('0x38')]+'%'};return _0xf41039;}})});}_0xc0a1b7=_['merge']({},_0xc0a1b7,_0xd91f9e['options']);var _0x4c0102={'where':_0xc0a1b7['where']};return db[_0x9f2a('0x2a')][_0x9f2a('0x1d')](_0x4c0102)[_0x9f2a('0x23')](function(_0x195040){_0x2de7c5[_0x9f2a('0x1d')]=_0x195040;if(_0xd91f9e[_0x9f2a('0x2f')][_0x9f2a('0x3a')]){_0xc0a1b7['include']=[{'all':!![]}];}return db[_0x9f2a('0x2a')][_0x9f2a('0x3b')](_0xc0a1b7);})[_0x9f2a('0x23')](function(_0x426fa1){_0x2de7c5[_0x9f2a('0x3c')]=_0x426fa1;return _0x2de7c5;})[_0x9f2a('0x23')](respondWithFilteredResult(_0x4bda1f,_0xc0a1b7))[_0x9f2a('0x3d')](handleError(_0x4bda1f,null));};exports['show']=function(_0x30ca83,_0x1e0670){var _0x1addff={'raw':!![],'where':{'id':_0x30ca83[_0x9f2a('0x3e')]['id']}},_0x338d22={};_0x338d22[_0x9f2a('0x2e')]=_[_0x9f2a('0x30')](db[_0x9f2a('0x2a')][_0x9f2a('0x3f')]);_0x338d22[_0x9f2a('0x2f')]=_['keys'](_0x30ca83[_0x9f2a('0x2f')]);_0x338d22[_0x9f2a('0x31')]=_['intersection'](_0x338d22[_0x9f2a('0x2e')],_0x338d22[_0x9f2a('0x2f')]);_0x1addff['attributes']=_[_0x9f2a('0x32')](_0x338d22[_0x9f2a('0x2e')],qs[_0x9f2a('0x34')](_0x30ca83[_0x9f2a('0x2f')][_0x9f2a('0x34')]));_0x1addff[_0x9f2a('0x33')]=_0x1addff[_0x9f2a('0x33')][_0x9f2a('0x35')]?_0x1addff['attributes']:_0x338d22['model'];if(_0x30ca83[_0x9f2a('0x2f')]['includeAll']){_0x1addff['include']=[{'all':!![]}];}_0x1addff=_[_0x9f2a('0x40')]({},_0x1addff,_0x30ca83[_0x9f2a('0x41')]);return db[_0x9f2a('0x2a')][_0x9f2a('0x42')](_0x1addff)['then'](handleEntityNotFound(_0x1e0670,null))[_0x9f2a('0x23')](respondWithResult(_0x1e0670,null))[_0x9f2a('0x3d')](handleError(_0x1e0670,null));};exports[_0x9f2a('0x43')]=function(_0x5274ac,_0xdfa311){return db[_0x9f2a('0x2a')][_0x9f2a('0x43')](_0x5274ac[_0x9f2a('0x44')],{})[_0x9f2a('0x23')](respondWithResult(_0xdfa311,0xc9))['catch'](handleError(_0xdfa311,null));};exports[_0x9f2a('0x45')]=function(_0x226496,_0x3bd563){if(_0x226496['body']['id']){delete _0x226496['body']['id'];}return db[_0x9f2a('0x2a')]['find']({'where':{'id':_0x226496[_0x9f2a('0x3e')]['id']}})['then'](handleEntityNotFound(_0x3bd563,null))[_0x9f2a('0x23')](saveUpdates(_0x226496[_0x9f2a('0x44')],null))[_0x9f2a('0x23')](respondWithResult(_0x3bd563,null))['catch'](handleError(_0x3bd563,null));};exports[_0x9f2a('0x22')]=function(_0x3934c0,_0x3c87ac){return db[_0x9f2a('0x2a')]['find']({'where':{'id':_0x3934c0['params']['id']}})[_0x9f2a('0x23')](handleEntityNotFound(_0x3c87ac,null))[_0x9f2a('0x23')](removeEntity(_0x3c87ac,null))[_0x9f2a('0x3d')](handleError(_0x3c87ac,null));};
\ No newline at end of file
+var _0xf498=['filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','rawAttributes','length','find','catch','create','body','update','eml-format','zip-dir','fast-json-patch','moment','bluebird','path','sox','to-csv','fs-extra','lodash','squel','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','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','destroy','then','error','stack','name','send','index','ZendeskField','type','key','model','map','query','keys'];(function(_0x34fcb3,_0x4c412f){var _0x488710=function(_0x3e0d03){while(--_0x3e0d03){_0x34fcb3['push'](_0x34fcb3['shift']());}};_0x488710(++_0x4c412f);}(_0xf498,0x108));var _0x8f49=function(_0x47aa64,_0xfb8a07){_0x47aa64=_0x47aa64-0x0;var _0x549c7a=_0xf498[_0x47aa64];return _0x549c7a;};'use strict';var emlformat=require(_0x8f49('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8f49('0x1'));var jsonpatch=require(_0x8f49('0x2'));var rp=require('request-promise');var moment=require(_0x8f49('0x3'));var BPromise=require(_0x8f49('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x8f49('0x5'));var sox=require(_0x8f49('0x6'));var csv=require(_0x8f49('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8f49('0x8'));var _=require(_0x8f49('0x9'));var squel=require(_0x8f49('0xa'));var crypto=require(_0x8f49('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x8f49('0xc'));var toCsv=require(_0x8f49('0x7'));var querystring=require('querystring');var Papa=require(_0x8f49('0xd'));var Redis=require(_0x8f49('0xe'));var authService=require(_0x8f49('0xf'));var qs=require(_0x8f49('0x10'));var as=require(_0x8f49('0x11'));var hardwareService=require(_0x8f49('0x12'));var logger=require(_0x8f49('0x13'))(_0x8f49('0x14'));var utils=require(_0x8f49('0x15'));var config=require(_0x8f49('0x16'));var licenseUtil=require(_0x8f49('0x17'));var db=require(_0x8f49('0x18'))['db'];function respondWithStatusCode(_0x231660,_0x3eb7d4){_0x3eb7d4=_0x3eb7d4||0xcc;return function(_0x1d050d){if(_0x1d050d){return _0x231660[_0x8f49('0x19')](_0x3eb7d4);}return _0x231660['status'](_0x3eb7d4)[_0x8f49('0x1a')]();};}function respondWithResult(_0x14dbbd,_0x1d5b82){_0x1d5b82=_0x1d5b82||0xc8;return function(_0x3d38f2){if(_0x3d38f2){return _0x14dbbd[_0x8f49('0x1b')](_0x1d5b82)[_0x8f49('0x1c')](_0x3d38f2);}};}function respondWithFilteredResult(_0x1fdb2b,_0x305613){return function(_0x2b44df){if(_0x2b44df){var _0x28324c=typeof _0x305613[_0x8f49('0x1d')]===_0x8f49('0x1e')&&typeof _0x305613['limit']===_0x8f49('0x1e');var _0x205cfa=_0x2b44df['count'];var _0x2cee85=_0x28324c?0x0:_0x305613[_0x8f49('0x1d')];var _0x1ed6eb=_0x28324c?_0x2b44df[_0x8f49('0x1f')]:_0x305613[_0x8f49('0x1d')]+_0x305613[_0x8f49('0x20')];var _0x397b6b;if(_0x1ed6eb>=_0x205cfa){_0x1ed6eb=_0x205cfa;_0x397b6b=0xc8;}else{_0x397b6b=0xce;}_0x1fdb2b[_0x8f49('0x1b')](_0x397b6b);return _0x1fdb2b[_0x8f49('0x21')](_0x8f49('0x22'),_0x2cee85+'-'+_0x1ed6eb+'/'+_0x205cfa)[_0x8f49('0x1c')](_0x2b44df);}return null;};}function patchUpdates(_0x4ae4e1){return function(_0x3b4cee){try{jsonpatch[_0x8f49('0x23')](_0x3b4cee,_0x4ae4e1,!![]);}catch(_0x1692ff){return BPromise[_0x8f49('0x24')](_0x1692ff);}return _0x3b4cee[_0x8f49('0x25')]();};}function saveUpdates(_0x4f957d,_0x3e5957){return function(_0x9e0bed){if(_0x9e0bed){return _0x9e0bed['update'](_0x4f957d)['then'](function(_0x2af6e8){return _0x2af6e8;});}return null;};}function removeEntity(_0x448ac3,_0x2dad23){return function(_0x5f2f88){if(_0x5f2f88){return _0x5f2f88[_0x8f49('0x26')]()[_0x8f49('0x27')](function(){_0x448ac3[_0x8f49('0x1b')](0xcc)[_0x8f49('0x1a')]();});}};}function handleEntityNotFound(_0x175526,_0x2a34c0){return function(_0x5ea5f5){if(!_0x5ea5f5){_0x175526[_0x8f49('0x19')](0x194);}return _0x5ea5f5;};}function handleError(_0x9fd032,_0x3ad2f5){_0x3ad2f5=_0x3ad2f5||0x1f4;return function(_0x42fdd2){logger[_0x8f49('0x28')](_0x42fdd2[_0x8f49('0x29')]);if(_0x42fdd2[_0x8f49('0x2a')]){delete _0x42fdd2[_0x8f49('0x2a')];}_0x9fd032[_0x8f49('0x1b')](_0x3ad2f5)[_0x8f49('0x2b')](_0x42fdd2);};}exports[_0x8f49('0x2c')]=function(_0x354ad4,_0xfe4cb2){var _0x4eac20={},_0x566258={},_0x2d0041={'count':0x0,'rows':[]};var _0x596911=_['map'](db[_0x8f49('0x2d')]['rawAttributes'],function(_0x47d4c1){return{'name':_0x47d4c1['fieldName'],'type':_0x47d4c1[_0x8f49('0x2e')][_0x8f49('0x2f')]};});_0x566258[_0x8f49('0x30')]=_[_0x8f49('0x31')](_0x596911,_0x8f49('0x2a'));_0x566258[_0x8f49('0x32')]=_[_0x8f49('0x33')](_0x354ad4[_0x8f49('0x32')]);_0x566258[_0x8f49('0x34')]=_[_0x8f49('0x35')](_0x566258[_0x8f49('0x30')],_0x566258[_0x8f49('0x32')]);_0x4eac20[_0x8f49('0x36')]=_[_0x8f49('0x35')](_0x566258['model'],qs[_0x8f49('0x37')](_0x354ad4[_0x8f49('0x32')]['fields']));_0x4eac20[_0x8f49('0x36')]=_0x4eac20[_0x8f49('0x36')]['length']?_0x4eac20['attributes']:_0x566258[_0x8f49('0x30')];if(!_0x354ad4[_0x8f49('0x32')][_0x8f49('0x38')](_0x8f49('0x39'))){_0x4eac20[_0x8f49('0x20')]=qs['limit'](_0x354ad4[_0x8f49('0x32')][_0x8f49('0x20')]);_0x4eac20['offset']=qs[_0x8f49('0x1d')](_0x354ad4[_0x8f49('0x32')][_0x8f49('0x1d')]);}_0x4eac20[_0x8f49('0x3a')]=qs[_0x8f49('0x3b')](_0x354ad4[_0x8f49('0x32')][_0x8f49('0x3b')]);_0x4eac20[_0x8f49('0x3c')]=qs[_0x8f49('0x34')](_[_0x8f49('0x3d')](_0x354ad4[_0x8f49('0x32')],_0x566258['filters']),_0x596911);if(_0x354ad4[_0x8f49('0x32')][_0x8f49('0x3e')]){_0x4eac20[_0x8f49('0x3c')]=_[_0x8f49('0x3f')](_0x4eac20[_0x8f49('0x3c')],{'$or':_[_0x8f49('0x31')](_0x596911,function(_0x3fc1f8){if(_0x3fc1f8[_0x8f49('0x2e')]!==_0x8f49('0x40')){var _0x3c5c7d={};_0x3c5c7d[_0x3fc1f8[_0x8f49('0x2a')]]={'$like':'%'+_0x354ad4[_0x8f49('0x32')][_0x8f49('0x3e')]+'%'};return _0x3c5c7d;}})});}_0x4eac20=_[_0x8f49('0x3f')]({},_0x4eac20,_0x354ad4[_0x8f49('0x41')]);var _0x57462e={'where':_0x4eac20[_0x8f49('0x3c')]};return db[_0x8f49('0x2d')][_0x8f49('0x1f')](_0x57462e)[_0x8f49('0x27')](function(_0x397830){_0x2d0041[_0x8f49('0x1f')]=_0x397830;if(_0x354ad4[_0x8f49('0x32')][_0x8f49('0x42')]){_0x4eac20[_0x8f49('0x43')]=[{'all':!![]}];}return db[_0x8f49('0x2d')][_0x8f49('0x44')](_0x4eac20);})['then'](function(_0x327134){_0x2d0041[_0x8f49('0x45')]=_0x327134;return _0x2d0041;})[_0x8f49('0x27')](respondWithFilteredResult(_0xfe4cb2,_0x4eac20))['catch'](handleError(_0xfe4cb2,null));};exports[_0x8f49('0x46')]=function(_0xf29c03,_0x5f0230){var _0x5166fb={'raw':!![],'where':{'id':_0xf29c03[_0x8f49('0x47')]['id']}},_0x488416={};_0x488416[_0x8f49('0x30')]=_[_0x8f49('0x33')](db[_0x8f49('0x2d')][_0x8f49('0x48')]);_0x488416[_0x8f49('0x32')]=_[_0x8f49('0x33')](_0xf29c03[_0x8f49('0x32')]);_0x488416[_0x8f49('0x34')]=_['intersection'](_0x488416[_0x8f49('0x30')],_0x488416[_0x8f49('0x32')]);_0x5166fb[_0x8f49('0x36')]=_[_0x8f49('0x35')](_0x488416[_0x8f49('0x30')],qs[_0x8f49('0x37')](_0xf29c03['query'][_0x8f49('0x37')]));_0x5166fb['attributes']=_0x5166fb['attributes'][_0x8f49('0x49')]?_0x5166fb[_0x8f49('0x36')]:_0x488416[_0x8f49('0x30')];if(_0xf29c03[_0x8f49('0x32')][_0x8f49('0x42')]){_0x5166fb['include']=[{'all':!![]}];}_0x5166fb=_[_0x8f49('0x3f')]({},_0x5166fb,_0xf29c03[_0x8f49('0x41')]);return db[_0x8f49('0x2d')][_0x8f49('0x4a')](_0x5166fb)[_0x8f49('0x27')](handleEntityNotFound(_0x5f0230,null))[_0x8f49('0x27')](respondWithResult(_0x5f0230,null))[_0x8f49('0x4b')](handleError(_0x5f0230,null));};exports[_0x8f49('0x4c')]=function(_0x3f05d1,_0x551e90){return db[_0x8f49('0x2d')][_0x8f49('0x4c')](_0x3f05d1[_0x8f49('0x4d')],{})[_0x8f49('0x27')](respondWithResult(_0x551e90,0xc9))[_0x8f49('0x4b')](handleError(_0x551e90,null));};exports[_0x8f49('0x4e')]=function(_0x3f09ee,_0x5159d5){if(_0x3f09ee[_0x8f49('0x4d')]['id']){delete _0x3f09ee[_0x8f49('0x4d')]['id'];}return db[_0x8f49('0x2d')][_0x8f49('0x4a')]({'where':{'id':_0x3f09ee[_0x8f49('0x47')]['id']}})['then'](handleEntityNotFound(_0x5159d5,null))[_0x8f49('0x27')](saveUpdates(_0x3f09ee['body'],null))['then'](respondWithResult(_0x5159d5,null))[_0x8f49('0x4b')](handleError(_0x5159d5,null));};exports[_0x8f49('0x26')]=function(_0x5702ad,_0x544bcd){return db[_0x8f49('0x2d')][_0x8f49('0x4a')]({'where':{'id':_0x5702ad[_0x8f49('0x47')]['id']}})[_0x8f49('0x27')](handleEntityNotFound(_0x544bcd,null))[_0x8f49('0x27')](removeEntity(_0x544bcd,null))[_0x8f49('0x4b')](handleError(_0x544bcd,null));};
\ No newline at end of file
index b206f4d..79cf7a3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x10a1=['define','int_zendesk_fields','zendesk_unique_index','FieldId','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intZendeskField.attributes'];(function(_0x486dd4,_0x21c6ae){var _0x35646a=function(_0x4b0afe){while(--_0x4b0afe){_0x486dd4['push'](_0x486dd4['shift']());}};_0x35646a(++_0x21c6ae);}(_0x10a1,0xe1));var _0x110a=function(_0x34b138,_0x10615e){_0x34b138=_0x34b138-0x0;var _0x41bd6b=_0x10a1[_0x34b138];return _0x41bd6b;};'use strict';var _=require(_0x110a('0x0'));var util=require('util');var logger=require(_0x110a('0x1'))(_0x110a('0x2'));var moment=require(_0x110a('0x3'));var BPromise=require(_0x110a('0x4'));var rp=require(_0x110a('0x5'));var fs=require('fs');var path=require(_0x110a('0x6'));var rimraf=require('rimraf');var config=require(_0x110a('0x7'));var attributes=require(_0x110a('0x8'));module['exports']=function(_0x47bab9,_0x2a1f8e){return _0x47bab9[_0x110a('0x9')]('ZendeskField',attributes,{'tableName':_0x110a('0xa'),'paranoid':![],'indexes':[{'name':_0x110a('0xb'),'fields':['idField',_0x110a('0xc')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xec59=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./intZendeskField.attributes','exports','ZendeskField','int_zendesk_fields','zendesk_unique_index','idField'];(function(_0x25e995,_0x143cdc){var _0x446a58=function(_0x545ebc){while(--_0x545ebc){_0x25e995['push'](_0x25e995['shift']());}};_0x446a58(++_0x143cdc);}(_0xec59,0x1c0));var _0x9ec5=function(_0x399338,_0x11496b){_0x399338=_0x399338-0x0;var _0x3c4485=_0xec59[_0x399338];return _0x3c4485;};'use strict';var _=require(_0x9ec5('0x0'));var util=require(_0x9ec5('0x1'));var logger=require(_0x9ec5('0x2'))(_0x9ec5('0x3'));var moment=require(_0x9ec5('0x4'));var BPromise=require(_0x9ec5('0x5'));var rp=require(_0x9ec5('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x9ec5('0x7'));var attributes=require(_0x9ec5('0x8'));module[_0x9ec5('0x9')]=function(_0x2e51c2,_0x4ee1f0){return _0x2e51c2['define'](_0x9ec5('0xa'),attributes,{'tableName':_0x9ec5('0xb'),'paranoid':![],'indexes':[{'name':_0x9ec5('0xc'),'fields':[_0x9ec5('0xd'),'FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 6829e0d..0911343 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6146=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ZendeskField,\x20%s,\x20%s','request\x20sent','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x2981c3,_0x4b7fa6){var _0x2a6f16=function(_0x52b955){while(--_0x52b955){_0x2981c3['push'](_0x2981c3['shift']());}};_0x2a6f16(++_0x4b7fa6);}(_0x6146,0x9b));var _0x6614=function(_0x578220,_0x1e5ebc){_0x578220=_0x578220-0x0;var _0x2c16d7=_0x6146[_0x578220];return _0x2c16d7;};'use strict';var _=require(_0x6614('0x0'));var util=require(_0x6614('0x1'));var moment=require('moment');var BPromise=require(_0x6614('0x2'));var rs=require(_0x6614('0x3'));var fs=require('fs');var Redis=require(_0x6614('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x6614('0x5'));var logger=require(_0x6614('0x6'))(_0x6614('0x7'));var config=require(_0x6614('0x8'));var jayson=require(_0x6614('0x9'));var client=jayson[_0x6614('0xa')][_0x6614('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4977db,_0x24b2d1,_0x405cc8){return new BPromise(function(_0x512db7,_0x1fe093){return client['request'](_0x4977db,_0x405cc8)[_0x6614('0xc')](function(_0x330104){logger[_0x6614('0xd')](_0x6614('0xe'),_0x24b2d1,_0x6614('0xf'));logger['debug'](_0x6614('0x10'),_0x24b2d1,_0x6614('0xf'),JSON[_0x6614('0x11')](_0x330104));if(_0x330104['error']){if(_0x330104['error'][_0x6614('0x12')]===0x1f4){logger[_0x6614('0x13')](_0x6614('0xe'),_0x24b2d1,_0x330104[_0x6614('0x13')][_0x6614('0x14')]);return _0x1fe093(_0x330104[_0x6614('0x13')]['message']);}logger['error'](_0x6614('0xe'),_0x24b2d1,_0x330104['error'][_0x6614('0x14')]);return _0x512db7(_0x330104[_0x6614('0x13')][_0x6614('0x14')]);}else{logger[_0x6614('0xd')](_0x6614('0xe'),_0x24b2d1,_0x6614('0xf'));_0x512db7(_0x330104[_0x6614('0x15')][_0x6614('0x14')]);}})[_0x6614('0x16')](function(_0xc28bf6){logger[_0x6614('0x13')](_0x6614('0xe'),_0x24b2d1,_0xc28bf6);_0x1fe093(_0xc28bf6);});});}
\ No newline at end of file
+var _0xeb3c=['request','then','info','ZendeskField,\x20%s,\x20%s','request\x20sent','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x3a60a0,_0x3a761b){var _0x4a0977=function(_0xa4ee73){while(--_0xa4ee73){_0x3a60a0['push'](_0x3a60a0['shift']());}};_0x4a0977(++_0x3a761b);}(_0xeb3c,0x15b));var _0xceb3=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0xeb3c[_0x46aff0];return _0x9d78cf;};'use strict';var _=require(_0xceb3('0x0'));var util=require(_0xceb3('0x1'));var moment=require(_0xceb3('0x2'));var BPromise=require('bluebird');var rs=require(_0xceb3('0x3'));var fs=require('fs');var Redis=require(_0xceb3('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xceb3('0x5'));var logger=require(_0xceb3('0x6'))(_0xceb3('0x7'));var config=require(_0xceb3('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xceb3('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xfc39ec,_0x2abb47,_0x57ebbd){return new BPromise(function(_0x38599b,_0xbc7561){return client[_0xceb3('0xa')](_0xfc39ec,_0x57ebbd)[_0xceb3('0xb')](function(_0x212772){logger[_0xceb3('0xc')](_0xceb3('0xd'),_0x2abb47,_0xceb3('0xe'));logger['debug'](_0xceb3('0xf'),_0x2abb47,_0xceb3('0xe'),JSON[_0xceb3('0x10')](_0x212772));if(_0x212772[_0xceb3('0x11')]){if(_0x212772[_0xceb3('0x11')][_0xceb3('0x12')]===0x1f4){logger[_0xceb3('0x11')](_0xceb3('0xd'),_0x2abb47,_0x212772[_0xceb3('0x11')][_0xceb3('0x13')]);return _0xbc7561(_0x212772[_0xceb3('0x11')]['message']);}logger[_0xceb3('0x11')](_0xceb3('0xd'),_0x2abb47,_0x212772['error'][_0xceb3('0x13')]);return _0x38599b(_0x212772[_0xceb3('0x11')][_0xceb3('0x13')]);}else{logger[_0xceb3('0xc')]('ZendeskField,\x20%s,\x20%s',_0x2abb47,_0xceb3('0xe'));_0x38599b(_0x212772['result'][_0xceb3('0x13')]);}})[_0xceb3('0x14')](function(_0x1ab989){logger['error'](_0xceb3('0xd'),_0x2abb47,_0x1ab989);_0xbc7561(_0x1ab989);});});}
\ No newline at end of file
index 5ec34dd..1c54063 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf804=['util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','get','index','/:id','/:id/configurations','isAuthenticated','getConfigurations','getFields','create','addConfiguration','update','destroy','exports','multer'];(function(_0x259cad,_0x3dae11){var _0x4e6a68=function(_0x1669dc){while(--_0x1669dc){_0x259cad['push'](_0x259cad['shift']());}};_0x4e6a68(++_0x3dae11);}(_0xf804,0x13a));var _0x4f80=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xf804[_0x4565bf];return _0x5610ba;};'use strict';var multer=require(_0x4f80('0x0'));var util=require(_0x4f80('0x1'));var path=require(_0x4f80('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x4f80('0x3')]();var fs_extra=require(_0x4f80('0x4'));var auth=require(_0x4f80('0x5'));var interaction=require(_0x4f80('0x6'));var config=require(_0x4f80('0x7'));var controller=require(_0x4f80('0x8'));router[_0x4f80('0x9')]('/',auth['isAuthenticated'](),controller[_0x4f80('0xa')]);router[_0x4f80('0x9')](_0x4f80('0xb'),auth['isAuthenticated'](),controller['show']);router['get'](_0x4f80('0xc'),auth[_0x4f80('0xd')](),controller[_0x4f80('0xe')]);router[_0x4f80('0x9')]('/:id/fields',auth[_0x4f80('0xd')](),controller[_0x4f80('0xf')]);router['post']('/',auth[_0x4f80('0xd')](),controller[_0x4f80('0x10')]);router['post'](_0x4f80('0xc'),auth['isAuthenticated'](),controller[_0x4f80('0x11')]);router['put']('/:id',auth[_0x4f80('0xd')](),controller[_0x4f80('0x12')]);router['delete'](_0x4f80('0xb'),auth[_0x4f80('0xd')](),controller[_0x4f80('0x13')]);module[_0x4f80('0x14')]=router;
\ No newline at end of file
+var _0xf98f=['index','/:id','show','/:id/configurations','getFields','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated'];(function(_0x1d6ec9,_0x997c5d){var _0x4ba1e7=function(_0x1677c0){while(--_0x1677c0){_0x1d6ec9['push'](_0x1d6ec9['shift']());}};_0x4ba1e7(++_0x997c5d);}(_0xf98f,0x1da));var _0xff98=function(_0x46293e,_0x55fd36){_0x46293e=_0x46293e-0x0;var _0x6cc314=_0xf98f[_0x46293e];return _0x6cc314;};'use strict';var multer=require(_0xff98('0x0'));var util=require(_0xff98('0x1'));var path=require(_0xff98('0x2'));var timeout=require('connect-timeout');var express=require(_0xff98('0x3'));var router=express[_0xff98('0x4')]();var fs_extra=require(_0xff98('0x5'));var auth=require(_0xff98('0x6'));var interaction=require(_0xff98('0x7'));var config=require('../../config/environment');var controller=require('./intZohoAccount.controller');router[_0xff98('0x8')]('/',auth[_0xff98('0x9')](),controller[_0xff98('0xa')]);router[_0xff98('0x8')](_0xff98('0xb'),auth[_0xff98('0x9')](),controller[_0xff98('0xc')]);router[_0xff98('0x8')](_0xff98('0xd'),auth[_0xff98('0x9')](),controller['getConfigurations']);router[_0xff98('0x8')]('/:id/fields',auth[_0xff98('0x9')](),controller[_0xff98('0xe')]);router['post']('/',auth[_0xff98('0x9')](),controller[_0xff98('0xf')]);router['post'](_0xff98('0xd'),auth[_0xff98('0x9')](),controller[_0xff98('0x10')]);router[_0xff98('0x11')](_0xff98('0xb'),auth[_0xff98('0x9')](),controller[_0xff98('0x12')]);router[_0xff98('0x13')](_0xff98('0xb'),auth[_0xff98('0x9')](),controller[_0xff98('0x14')]);module[_0xff98('0x15')]=router;
\ No newline at end of file
index b5bb9fa..190dc0c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x34e8=['sequelize','exports','STRING'];(function(_0x204e52,_0x1d553a){var _0xe5dd25=function(_0x39302b){while(--_0x39302b){_0x204e52['push'](_0x204e52['shift']());}};_0xe5dd25(++_0x1d553a);}(_0x34e8,0x12c));var _0x834e=function(_0x1d963c,_0x25b8e0){_0x1d963c=_0x1d963c-0x0;var _0x471b4d=_0x34e8[_0x1d963c];return _0x471b4d;};'use strict';var Sequelize=require(_0x834e('0x0'));module[_0x834e('0x1')]={'name':{'type':Sequelize[_0x834e('0x2')]},'description':{'type':Sequelize[_0x834e('0x2')]},'host':{'type':Sequelize['STRING']},'zone':{'type':Sequelize[_0x834e('0x2')]},'clientId':{'type':Sequelize[_0x834e('0x2')]},'clientSecret':{'type':Sequelize[_0x834e('0x2')]},'serverUrl':{'type':Sequelize[_0x834e('0x2')],'allowNull':![]},'code':{'type':Sequelize[_0x834e('0x2')]},'refreshToken':{'type':Sequelize[_0x834e('0x2')]}};
\ No newline at end of file
+var _0xe5b3=['STRING','exports'];(function(_0x19a927,_0xe4a166){var _0x3ba90=function(_0x3d9ef1){while(--_0x3d9ef1){_0x19a927['push'](_0x19a927['shift']());}};_0x3ba90(++_0xe4a166);}(_0xe5b3,0x133));var _0x3e5b=function(_0x42efa7,_0x2d5d92){_0x42efa7=_0x42efa7-0x0;var _0x5d1b50=_0xe5b3[_0x42efa7];return _0x5d1b50;};'use strict';var Sequelize=require('sequelize');module[_0x3e5b('0x0')]={'name':{'type':Sequelize[_0x3e5b('0x1')]},'description':{'type':Sequelize[_0x3e5b('0x1')]},'host':{'type':Sequelize[_0x3e5b('0x1')]},'zone':{'type':Sequelize[_0x3e5b('0x1')]},'clientId':{'type':Sequelize[_0x3e5b('0x1')]},'clientSecret':{'type':Sequelize[_0x3e5b('0x1')]},'serverUrl':{'type':Sequelize[_0x3e5b('0x1')],'allowNull':![]},'code':{'type':Sequelize[_0x3e5b('0x1')]},'refreshToken':{'type':Sequelize[_0x3e5b('0x1')]}};
\ No newline at end of file
index 7598e21..ce7cf60 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8a8d=['slice','lastIndexOf','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','error','message','Description','Call_Result','Call_Start_Time','Call_Type','includes','api_name','system_mandatory','push','display_label','custom_field','data_type','picklist','pick_list_values','test','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','request-promise','moment','util','path','sox','ejs','fs-extra','squel','crypto','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','../../components/integrations/configuration','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','end','stack','name','send','index','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','merge','VIRTUAL','ZohoAccount','include','findAll','rows','show','params','includeAll','options','find','create','body','catch','destroy','getConfigurations','ZohoConfiguration','order','where','pick','filter','addConfiguration','AccountId','channel','Descriptions','getDescriptions','ZohoField','Subjects','zone','https://accounts.zoho.com','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','/oauth/v2/token','refreshToken','clientId','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','findOne','clientSecret','serverUrl','code','host','zoho.eu','com'];(function(_0x599e51,_0x4a9643){var _0x6999ce=function(_0x265d9c){while(--_0x265d9c){_0x599e51['push'](_0x599e51['shift']());}};_0x6999ce(++_0x4a9643);}(_0x8a8d,0x9a));var _0xd8a8=function(_0x5a97d1,_0x58d7c0){_0x5a97d1=_0x5a97d1-0x0;var _0x2b3166=_0x8a8d[_0x5a97d1];return _0x2b3166;};'use strict';var emlformat=require(_0xd8a8('0x0'));var rimraf=require(_0xd8a8('0x1'));var zipdir=require(_0xd8a8('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd8a8('0x3'));var moment=require(_0xd8a8('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xd8a8('0x5'));var path=require(_0xd8a8('0x6'));var sox=require(_0xd8a8('0x7'));var csv=require('to-csv');var ejs=require(_0xd8a8('0x8'));var fs=require('fs');var fs_extra=require(_0xd8a8('0x9'));var _=require('lodash');var squel=require(_0xd8a8('0xa'));var crypto=require(_0xd8a8('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xd8a8('0xc'));var Redis=require(_0xd8a8('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xd8a8('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd8a8('0xf'));var logger=require(_0xd8a8('0x10'))('api');var utils=require(_0xd8a8('0x11'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xd8a8('0x12'))['db'];var integrations=require(_0xd8a8('0x13'));function respondWithStatusCode(_0x41844c,_0x2f19e0){_0x2f19e0=_0x2f19e0||0xcc;return function(_0x5876ca){if(_0x5876ca){return _0x41844c['sendStatus'](_0x2f19e0);}return _0x41844c['status'](_0x2f19e0)['end']();};}function respondWithResult(_0x2e9c3b,_0x182635){_0x182635=_0x182635||0xc8;return function(_0xcf212){if(_0xcf212){return _0x2e9c3b[_0xd8a8('0x14')](_0x182635)[_0xd8a8('0x15')](_0xcf212);}};}function respondWithFilteredResult(_0x527ff7,_0x4ad7cb){return function(_0x39f9e8){if(_0x39f9e8){var _0x3a62b5=typeof _0x4ad7cb[_0xd8a8('0x16')]==='undefined'&&typeof _0x4ad7cb[_0xd8a8('0x17')]===_0xd8a8('0x18');var _0x1be818=_0x39f9e8['count'];var _0x50aed1=_0x3a62b5?0x0:_0x4ad7cb['offset'];var _0xbfb0a5=_0x3a62b5?_0x39f9e8[_0xd8a8('0x19')]:_0x4ad7cb[_0xd8a8('0x16')]+_0x4ad7cb['limit'];var _0x170991;if(_0xbfb0a5>=_0x1be818){_0xbfb0a5=_0x1be818;_0x170991=0xc8;}else{_0x170991=0xce;}_0x527ff7[_0xd8a8('0x14')](_0x170991);return _0x527ff7[_0xd8a8('0x1a')](_0xd8a8('0x1b'),_0x50aed1+'-'+_0xbfb0a5+'/'+_0x1be818)[_0xd8a8('0x15')](_0x39f9e8);}return null;};}function patchUpdates(_0x45ef6b){return function(_0x185501){try{jsonpatch[_0xd8a8('0x1c')](_0x185501,_0x45ef6b,!![]);}catch(_0x3d38aa){return BPromise[_0xd8a8('0x1d')](_0x3d38aa);}return _0x185501[_0xd8a8('0x1e')]();};}function saveUpdates(_0x25e8bc,_0x379bf8){return function(_0x4a830a){if(_0x4a830a){return _0x4a830a[_0xd8a8('0x1f')](_0x25e8bc)[_0xd8a8('0x20')](function(_0x554be8){return _0x554be8;});}return null;};}function removeEntity(_0xed6c30,_0x14d5b8){return function(_0x1bc8ac){if(_0x1bc8ac){return _0x1bc8ac['destroy']()[_0xd8a8('0x20')](function(){_0xed6c30['status'](0xcc)[_0xd8a8('0x21')]();});}};}function handleEntityNotFound(_0x37957e,_0x40b1e5){return function(_0x38b5e9){if(!_0x38b5e9){_0x37957e['sendStatus'](0x194);}return _0x38b5e9;};}function handleError(_0x20841e,_0x269438){_0x269438=_0x269438||0x1f4;return function(_0x578d2b){logger['error'](_0x578d2b[_0xd8a8('0x22')]);if(_0x578d2b[_0xd8a8('0x23')]){delete _0x578d2b['name'];}_0x20841e[_0xd8a8('0x14')](_0x269438)[_0xd8a8('0x24')](_0x578d2b);};}exports[_0xd8a8('0x25')]=function(_0x1b7fc5,_0x5f156a){var _0x49243e={},_0x17b831={},_0x5966b9={'count':0x0,'rows':[]};var _0x147b28=_['map'](db['ZohoAccount'][_0xd8a8('0x26')],function(_0x365ecf){return{'name':_0x365ecf['fieldName'],'type':_0x365ecf[_0xd8a8('0x27')][_0xd8a8('0x28')]};});_0x17b831[_0xd8a8('0x29')]=_[_0xd8a8('0x2a')](_0x147b28,'name');_0x17b831[_0xd8a8('0x2b')]=_[_0xd8a8('0x2c')](_0x1b7fc5[_0xd8a8('0x2b')]);_0x17b831[_0xd8a8('0x2d')]=_[_0xd8a8('0x2e')](_0x17b831[_0xd8a8('0x29')],_0x17b831[_0xd8a8('0x2b')]);_0x49243e[_0xd8a8('0x2f')]=_[_0xd8a8('0x2e')](_0x17b831[_0xd8a8('0x29')],qs[_0xd8a8('0x30')](_0x1b7fc5[_0xd8a8('0x2b')][_0xd8a8('0x30')]));_0x49243e[_0xd8a8('0x2f')]=_0x49243e[_0xd8a8('0x2f')][_0xd8a8('0x31')]?_0x49243e[_0xd8a8('0x2f')]:_0x17b831[_0xd8a8('0x29')];if(!_0x1b7fc5[_0xd8a8('0x2b')][_0xd8a8('0x32')](_0xd8a8('0x33'))){_0x49243e[_0xd8a8('0x17')]=qs['limit'](_0x1b7fc5[_0xd8a8('0x2b')][_0xd8a8('0x17')]);_0x49243e[_0xd8a8('0x16')]=qs[_0xd8a8('0x16')](_0x1b7fc5['query'][_0xd8a8('0x16')]);}_0x49243e['order']=qs[_0xd8a8('0x34')](_0x1b7fc5[_0xd8a8('0x2b')][_0xd8a8('0x34')]);_0x49243e['where']=qs[_0xd8a8('0x2d')](_['pick'](_0x1b7fc5['query'],_0x17b831[_0xd8a8('0x2d')]),_0x147b28);if(_0x1b7fc5['query']['filter']){_0x49243e['where']=_[_0xd8a8('0x35')](_0x49243e['where'],{'$or':_['map'](_0x147b28,function(_0x4fc242){if(_0x4fc242['type']!==_0xd8a8('0x36')){var _0x516672={};_0x516672[_0x4fc242[_0xd8a8('0x23')]]={'$like':'%'+_0x1b7fc5[_0xd8a8('0x2b')]['filter']+'%'};return _0x516672;}})});}_0x49243e=_[_0xd8a8('0x35')]({},_0x49243e,_0x1b7fc5['options']);var _0x161eae={'where':_0x49243e['where']};return db[_0xd8a8('0x37')][_0xd8a8('0x19')](_0x161eae)['then'](function(_0x34c382){_0x5966b9[_0xd8a8('0x19')]=_0x34c382;if(_0x1b7fc5[_0xd8a8('0x2b')]['includeAll']){_0x49243e[_0xd8a8('0x38')]=[{'all':!![]}];}return db[_0xd8a8('0x37')][_0xd8a8('0x39')](_0x49243e);})[_0xd8a8('0x20')](function(_0xab1a37){_0x5966b9[_0xd8a8('0x3a')]=_0xab1a37;return _0x5966b9;})[_0xd8a8('0x20')](respondWithFilteredResult(_0x5f156a,_0x49243e))['catch'](handleError(_0x5f156a,null));};exports[_0xd8a8('0x3b')]=function(_0x2a7de2,_0x49a75d){var _0x31b320={'raw':![],'where':{'id':_0x2a7de2[_0xd8a8('0x3c')]['id']}},_0x3d8914={};_0x3d8914[_0xd8a8('0x29')]=_[_0xd8a8('0x2c')](db[_0xd8a8('0x37')][_0xd8a8('0x26')]);_0x3d8914[_0xd8a8('0x2b')]=_[_0xd8a8('0x2c')](_0x2a7de2[_0xd8a8('0x2b')]);_0x3d8914['filters']=_[_0xd8a8('0x2e')](_0x3d8914['model'],_0x3d8914[_0xd8a8('0x2b')]);_0x31b320[_0xd8a8('0x2f')]=_[_0xd8a8('0x2e')](_0x3d8914[_0xd8a8('0x29')],qs[_0xd8a8('0x30')](_0x2a7de2['query'][_0xd8a8('0x30')]));_0x31b320['attributes']=_0x31b320[_0xd8a8('0x2f')]['length']?_0x31b320[_0xd8a8('0x2f')]:_0x3d8914['model'];if(_0x2a7de2[_0xd8a8('0x2b')][_0xd8a8('0x3d')]){_0x31b320['include']=[{'all':!![]}];}_0x31b320=_['merge']({},_0x31b320,_0x2a7de2[_0xd8a8('0x3e')]);return db[_0xd8a8('0x37')][_0xd8a8('0x3f')](_0x31b320)[_0xd8a8('0x20')](handleEntityNotFound(_0x49a75d,null))['then'](respondWithResult(_0x49a75d,null))['catch'](handleError(_0x49a75d,null));};exports['create']=function(_0xd3ed11,_0x15de9e){return db[_0xd8a8('0x37')][_0xd8a8('0x40')](_0xd3ed11[_0xd8a8('0x41')],{})[_0xd8a8('0x20')](respondWithResult(_0x15de9e,0xc9))['catch'](handleError(_0x15de9e,null));};exports[_0xd8a8('0x1f')]=function(_0x4fbafe,_0x5dd476){if(_0x4fbafe[_0xd8a8('0x41')]['id']){delete _0x4fbafe[_0xd8a8('0x41')]['id'];}return db[_0xd8a8('0x37')][_0xd8a8('0x3f')]({'where':{'id':_0x4fbafe[_0xd8a8('0x3c')]['id']}})[_0xd8a8('0x20')](handleEntityNotFound(_0x5dd476,null))[_0xd8a8('0x20')](saveUpdates(_0x4fbafe[_0xd8a8('0x41')],null))['then'](respondWithResult(_0x5dd476,null))[_0xd8a8('0x42')](handleError(_0x5dd476,null));};exports[_0xd8a8('0x43')]=function(_0x341fcd,_0xb24810){return db[_0xd8a8('0x37')][_0xd8a8('0x3f')]({'where':{'id':_0x341fcd[_0xd8a8('0x3c')]['id']}})[_0xd8a8('0x20')](handleEntityNotFound(_0xb24810,null))['then'](removeEntity(_0xb24810,null))[_0xd8a8('0x42')](handleError(_0xb24810,null));};exports[_0xd8a8('0x44')]=function(_0x16c68b,_0x50df3c,_0x8269ad){var _0x4a50f8={};var _0x10cd1d={};var _0x220e4c;var _0x33a7cc;return db[_0xd8a8('0x37')]['findOne']({'where':{'id':_0x16c68b[_0xd8a8('0x3c')]['id']}})[_0xd8a8('0x20')](handleEntityNotFound(_0x50df3c,null))[_0xd8a8('0x20')](function(_0x201456){if(_0x201456){_0x220e4c=_0x201456;_0x10cd1d[_0xd8a8('0x29')]=_[_0xd8a8('0x2c')](db[_0xd8a8('0x45')][_0xd8a8('0x26')]);_0x10cd1d[_0xd8a8('0x2b')]=_[_0xd8a8('0x2c')](_0x16c68b[_0xd8a8('0x2b')]);_0x10cd1d[_0xd8a8('0x2d')]=_['intersection'](_0x10cd1d[_0xd8a8('0x29')],_0x10cd1d[_0xd8a8('0x2b')]);_0x4a50f8[_0xd8a8('0x2f')]=_['intersection'](_0x10cd1d[_0xd8a8('0x29')],qs[_0xd8a8('0x30')](_0x16c68b[_0xd8a8('0x2b')][_0xd8a8('0x30')]));_0x4a50f8[_0xd8a8('0x2f')]=_0x4a50f8[_0xd8a8('0x2f')][_0xd8a8('0x31')]?_0x4a50f8['attributes']:_0x10cd1d[_0xd8a8('0x29')];_0x4a50f8[_0xd8a8('0x46')]=qs[_0xd8a8('0x34')](_0x16c68b[_0xd8a8('0x2b')][_0xd8a8('0x34')]);_0x4a50f8[_0xd8a8('0x47')]=qs[_0xd8a8('0x2d')](_[_0xd8a8('0x48')](_0x16c68b[_0xd8a8('0x2b')],_0x10cd1d[_0xd8a8('0x2d')]));if(_0x16c68b[_0xd8a8('0x2b')][_0xd8a8('0x49')]){_0x4a50f8[_0xd8a8('0x47')]=_[_0xd8a8('0x35')](_0x4a50f8[_0xd8a8('0x47')],{'$or':_[_0xd8a8('0x2a')](_0x4a50f8[_0xd8a8('0x2f')],function(_0x136b57){var _0x74db66={};_0x74db66[_0x136b57]={'$like':'%'+_0x16c68b['query'][_0xd8a8('0x49')]+'%'};return _0x74db66;})});}_0x4a50f8=_[_0xd8a8('0x35')]({},_0x4a50f8,_0x16c68b['options']);return _0x220e4c['getConfigurations'](_0x4a50f8);}})[_0xd8a8('0x20')](function(_0x155662){if(_0x155662){_0x33a7cc=_0x155662[_0xd8a8('0x31')];if(!_0x16c68b[_0xd8a8('0x2b')][_0xd8a8('0x32')](_0xd8a8('0x33'))){_0x4a50f8['limit']=qs[_0xd8a8('0x17')](_0x16c68b[_0xd8a8('0x2b')][_0xd8a8('0x17')]);_0x4a50f8['offset']=qs['offset'](_0x16c68b[_0xd8a8('0x2b')][_0xd8a8('0x16')]);}return _0x220e4c[_0xd8a8('0x44')](_0x4a50f8);}})[_0xd8a8('0x20')](function(_0x8a76d2){if(_0x8a76d2){return _0x8a76d2?{'count':_0x33a7cc,'rows':_0x8a76d2}:null;}})['then'](respondWithResult(_0x50df3c,null))['catch'](handleError(_0x50df3c,null));};exports[_0xd8a8('0x4a')]=function(_0x4314b1,_0x39dbba,_0x4d15d1){if(_0x4314b1[_0xd8a8('0x41')]['id']){delete _0x4314b1['body']['id'];}return db[_0xd8a8('0x37')]['findOne']({'where':{'id':_0x4314b1[_0xd8a8('0x3c')]['id']}})[_0xd8a8('0x20')](handleEntityNotFound(_0x39dbba,null))[_0xd8a8('0x20')](function(_0x1ff5e0){if(_0x1ff5e0){_0x4314b1['body'][_0xd8a8('0x4b')]=_0x1ff5e0['id'];_0x4314b1['body']['Subjects']=integrations['getSubjects'](_0x4314b1['body'][_0xd8a8('0x4c')],_0x4314b1[_0xd8a8('0x41')][_0xd8a8('0x27')]);_0x4314b1[_0xd8a8('0x41')][_0xd8a8('0x4d')]=integrations[_0xd8a8('0x4e')](_0x4314b1[_0xd8a8('0x41')]['channel'],_0x4314b1[_0xd8a8('0x41')][_0xd8a8('0x27')]);return db[_0xd8a8('0x45')][_0xd8a8('0x40')](_0x4314b1[_0xd8a8('0x41')],{'include':[{'model':db[_0xd8a8('0x4f')],'as':_0xd8a8('0x50')},{'model':db[_0xd8a8('0x4f')],'as':'Descriptions'}]});}return null;})[_0xd8a8('0x20')](respondWithResult(_0x39dbba,null))[_0xd8a8('0x42')](handleError(_0x39dbba,null));};function getAccessToken(_0x2add90){return new Promise(function(_0x555c14,_0x271f52){var _0x17d0ae;switch(_0x2add90[_0xd8a8('0x51')]){case'US':_0x17d0ae=_0xd8a8('0x52');break;case'AU':_0x17d0ae='https://accounts.zoho.com.au';break;case'EU':_0x17d0ae=_0xd8a8('0x53');break;case'IN':_0x17d0ae=_0xd8a8('0x54');break;case'CN':_0x17d0ae=_0xd8a8('0x55');break;default:_0x17d0ae='https://accounts.zoho.eu';break;}var _0x529fc3={'method':'POST','uri':_0x17d0ae+_0xd8a8('0x56'),'qs':{'refresh_token':_0x2add90[_0xd8a8('0x57')],'client_id':_0x2add90[_0xd8a8('0x58')],'client_secret':_0x2add90['clientSecret'],'grant_type':'refresh_token'},'json':!![]};return rp(_0x529fc3)[_0xd8a8('0x20')](function(_0x76f3f4){if(_0x76f3f4[_0xd8a8('0x59')]){_0x555c14(_0x76f3f4[_0xd8a8('0x59')]);}else{_0x271f52(_0xd8a8('0x5a'));}})[_0xd8a8('0x42')](function(_0x25e9b0){_0x271f52(_0x25e9b0);});});}exports['getFields']=function(_0x2d5e2d,_0x57fa91,_0x27fd21){var _0x2f4ae2,_0x3e3f49,_0x23a720,_0x34c3b0,_0x224723;return db[_0xd8a8('0x37')][_0xd8a8('0x5b')]({'where':{'id':_0x2d5e2d['params']['id']},'attributes':['id','host',_0xd8a8('0x51'),_0xd8a8('0x58'),_0xd8a8('0x5c'),_0xd8a8('0x5d'),_0xd8a8('0x5e'),_0xd8a8('0x57')]})[_0xd8a8('0x20')](handleEntityNotFound(_0x57fa91,null))[_0xd8a8('0x20')](function(_0xfbe89d){_0x224723=_0xfbe89d;_0x2f4ae2=_0x224723[_0xd8a8('0x5f')];_0x3e3f49=_0x2f4ae2===_0xd8a8('0x60')?'eu':_0xd8a8('0x61');_0x23a720=_0x224723[_0xd8a8('0x5d')];var _0x766489=_0x23a720[_0xd8a8('0x62')](-0x1);if(_0x766489==='/'||_0x766489==='\x5c'||_0x766489===':'){_0x23a720=_0x23a720['substring'](0x0,_0x23a720[_0xd8a8('0x63')](_0x766489));}if(!_0x224723[_0xd8a8('0x57')]){throw new Error('Refresh\x20Token\x20not\x20available\x20for\x20the\x20account');}return getAccessToken(_0x224723);})[_0xd8a8('0x20')](function(_0x4607da){if(_0x4607da){return rp({'method':'GET','uri':util[_0xd8a8('0x64')](_0xd8a8('0x65'),_0x3e3f49),'qs':{'module':_0xd8a8('0x66')},'headers':{'Authorization':_0xd8a8('0x67')+_0x4607da},'json':!![]});}})[_0xd8a8('0x20')](function(_0x37021c){if(_0x37021c){if(_0x37021c[_0xd8a8('0x68')]&&_0x37021c['response'][_0xd8a8('0x69')]){throw new Error(_0x37021c['response'][_0xd8a8('0x69')][_0xd8a8('0x6a')]);}var _0x3432d0=[];var _0x15aa15=[];var _0x5e52b5=['Owner','Subject',_0xd8a8('0x6b'),'WhoId','Call_Duration',_0xd8a8('0x6c'),_0xd8a8('0x6d'),_0xd8a8('0x6e')];_0x15aa15=_['remove'](_0x37021c[_0xd8a8('0x30')],function(_0x5375a5){return _0x5e52b5[_0xd8a8('0x6f')](_0x5375a5[_0xd8a8('0x70')]);});for(var _0x2ac720=0x0;_0x2ac720<_0x15aa15['length'];_0x2ac720++){if(_0x15aa15[_0x2ac720][_0xd8a8('0x71')]===![]){_0x3432d0[_0xd8a8('0x72')]({'id':_0x15aa15[_0x2ac720]['id'],'name':_0x15aa15[_0x2ac720][_0xd8a8('0x73')],'custom':_0x15aa15[_0x2ac720][_0xd8a8('0x74')],'options':_0x15aa15[_0x2ac720][_0xd8a8('0x75')]===_0xd8a8('0x76')&&_0x15aa15[_0x2ac720][_0xd8a8('0x77')]['length']>-0x1?_[_0xd8a8('0x2a')](_0x15aa15[_0x2ac720][_0xd8a8('0x77')],function(_0x373f48){return{'name':_0x373f48,'value':_0x373f48};}):[]});}}return{'count':_0x3432d0[_0xd8a8('0x31')],'rows':_0x3432d0};}else{return{'count':0x0,'rows':[]};}})[_0xd8a8('0x20')](respondWithResult(_0x57fa91,null))['catch'](function(_0x4a5b4b){var _0x270baf=_0x2d5e2d[_0xd8a8('0x2b')][_0xd8a8('0x78')]?0x1f4:_0x4a5b4b['statusCode']||0x1f4;logger[_0xd8a8('0x69')](_0xd8a8('0x79'),_0xd8a8('0x7a'),_0x270baf,JSON[_0xd8a8('0x7b')](_0x4a5b4b));delete _0x4a5b4b[_0xd8a8('0x23')];if(_0x270baf===0x191){_0x270baf=0x190;}_0x57fa91[_0xd8a8('0x14')](_0x270baf)['send'](_0x2d5e2d[_0xd8a8('0x2b')][_0xd8a8('0x78')]?{'message':_0xd8a8('0x7c'),'statusCode':_0x4a5b4b[_0xd8a8('0x7d')]}:_0x4a5b4b);});};
\ No newline at end of file
+var _0x3762=['status','undefined','limit','count','offset','set','json','apply','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','ZohoAccount','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','findAll','catch','show','params','fields','length','include','options','find','create','body','getConfigurations','findOne','ZohoConfiguration','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','/oauth/v2/token','refreshToken','clientId','clientSecret','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','zoho.eu','com','serverUrl','slice','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','response','message','Owner','Description','Call_Duration','Call_Type','remove','includes','api_name','system_mandatory','push','display_label','custom_field','picklist','pick_list_values','test','getFields,\x20%s,\x20%s,\x20%s','stringify','statusCode','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','end'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x3762,0x68));var _0x2376=function(_0x3688d5,_0x51d2b7){_0x3688d5=_0x3688d5-0x0;var _0x3013c4=_0x3762[_0x3688d5];return _0x3013c4;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x2376('0x0'));var rp=require(_0x2376('0x1'));var moment=require(_0x2376('0x2'));var BPromise=require(_0x2376('0x3'));var Mustache=require(_0x2376('0x4'));var util=require(_0x2376('0x5'));var path=require(_0x2376('0x6'));var sox=require(_0x2376('0x7'));var csv=require(_0x2376('0x8'));var ejs=require(_0x2376('0x9'));var fs=require('fs');var fs_extra=require(_0x2376('0xa'));var _=require(_0x2376('0xb'));var squel=require('squel');var crypto=require(_0x2376('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x2376('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x2376('0xd'));var as=require(_0x2376('0xe'));var hardwareService=require(_0x2376('0xf'));var logger=require(_0x2376('0x10'))(_0x2376('0x11'));var utils=require(_0x2376('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x2376('0x13'));var db=require(_0x2376('0x14'))['db'];var integrations=require(_0x2376('0x15'));function respondWithStatusCode(_0xb06862,_0x352118){_0x352118=_0x352118||0xcc;return function(_0x18c09f){if(_0x18c09f){return _0xb06862['sendStatus'](_0x352118);}return _0xb06862['status'](_0x352118)[_0x2376('0x16')]();};}function respondWithResult(_0x2d4e11,_0x5be1a1){_0x5be1a1=_0x5be1a1||0xc8;return function(_0x387971){if(_0x387971){return _0x2d4e11[_0x2376('0x17')](_0x5be1a1)['json'](_0x387971);}};}function respondWithFilteredResult(_0x4e5489,_0x15dce4){return function(_0x7b7869){if(_0x7b7869){var _0x42fdc7=typeof _0x15dce4['offset']===_0x2376('0x18')&&typeof _0x15dce4[_0x2376('0x19')]===_0x2376('0x18');var _0x4f5789=_0x7b7869[_0x2376('0x1a')];var _0x4858ef=_0x42fdc7?0x0:_0x15dce4[_0x2376('0x1b')];var _0x1ad484=_0x42fdc7?_0x7b7869[_0x2376('0x1a')]:_0x15dce4[_0x2376('0x1b')]+_0x15dce4[_0x2376('0x19')];var _0x4975c8;if(_0x1ad484>=_0x4f5789){_0x1ad484=_0x4f5789;_0x4975c8=0xc8;}else{_0x4975c8=0xce;}_0x4e5489['status'](_0x4975c8);return _0x4e5489[_0x2376('0x1c')]('Content-Range',_0x4858ef+'-'+_0x1ad484+'/'+_0x4f5789)[_0x2376('0x1d')](_0x7b7869);}return null;};}function patchUpdates(_0x3b9078){return function(_0x24270f){try{jsonpatch[_0x2376('0x1e')](_0x24270f,_0x3b9078,!![]);}catch(_0x391472){return BPromise['reject'](_0x391472);}return _0x24270f[_0x2376('0x1f')]();};}function saveUpdates(_0x593f09,_0x115fb7){return function(_0x571f17){if(_0x571f17){return _0x571f17[_0x2376('0x20')](_0x593f09)[_0x2376('0x21')](function(_0x19f660){return _0x19f660;});}return null;};}function removeEntity(_0x463f99,_0x2dd1fa){return function(_0x40f3e7){if(_0x40f3e7){return _0x40f3e7[_0x2376('0x22')]()[_0x2376('0x21')](function(){_0x463f99[_0x2376('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x416567,_0x34360c){return function(_0x5e4edd){if(!_0x5e4edd){_0x416567[_0x2376('0x23')](0x194);}return _0x5e4edd;};}function handleError(_0x318d05,_0x4a037d){_0x4a037d=_0x4a037d||0x1f4;return function(_0x1d036a){logger[_0x2376('0x24')](_0x1d036a[_0x2376('0x25')]);if(_0x1d036a[_0x2376('0x26')]){delete _0x1d036a[_0x2376('0x26')];}_0x318d05[_0x2376('0x17')](_0x4a037d)[_0x2376('0x27')](_0x1d036a);};}exports[_0x2376('0x28')]=function(_0x304d98,_0x1af634){var _0x4db5b8={},_0x379f13={},_0x8cf771={'count':0x0,'rows':[]};var _0x4d2a04=_[_0x2376('0x29')](db[_0x2376('0x2a')][_0x2376('0x2b')],function(_0x107938){return{'name':_0x107938[_0x2376('0x2c')],'type':_0x107938[_0x2376('0x2d')]['key']};});_0x379f13[_0x2376('0x2e')]=_[_0x2376('0x29')](_0x4d2a04,_0x2376('0x26'));_0x379f13[_0x2376('0x2f')]=_[_0x2376('0x30')](_0x304d98['query']);_0x379f13[_0x2376('0x31')]=_[_0x2376('0x32')](_0x379f13[_0x2376('0x2e')],_0x379f13[_0x2376('0x2f')]);_0x4db5b8[_0x2376('0x33')]=_[_0x2376('0x32')](_0x379f13['model'],qs['fields'](_0x304d98['query']['fields']));_0x4db5b8['attributes']=_0x4db5b8['attributes']['length']?_0x4db5b8[_0x2376('0x33')]:_0x379f13['model'];if(!_0x304d98[_0x2376('0x2f')][_0x2376('0x34')](_0x2376('0x35'))){_0x4db5b8[_0x2376('0x19')]=qs['limit'](_0x304d98[_0x2376('0x2f')][_0x2376('0x19')]);_0x4db5b8['offset']=qs['offset'](_0x304d98[_0x2376('0x2f')][_0x2376('0x1b')]);}_0x4db5b8[_0x2376('0x36')]=qs[_0x2376('0x37')](_0x304d98['query']['sort']);_0x4db5b8[_0x2376('0x38')]=qs['filters'](_[_0x2376('0x39')](_0x304d98[_0x2376('0x2f')],_0x379f13['filters']),_0x4d2a04);if(_0x304d98[_0x2376('0x2f')][_0x2376('0x3a')]){_0x4db5b8[_0x2376('0x38')]=_[_0x2376('0x3b')](_0x4db5b8['where'],{'$or':_['map'](_0x4d2a04,function(_0x537533){if(_0x537533[_0x2376('0x2d')]!=='VIRTUAL'){var _0xd05b5d={};_0xd05b5d[_0x537533['name']]={'$like':'%'+_0x304d98[_0x2376('0x2f')][_0x2376('0x3a')]+'%'};return _0xd05b5d;}})});}_0x4db5b8=_[_0x2376('0x3b')]({},_0x4db5b8,_0x304d98['options']);var _0x4b5f39={'where':_0x4db5b8[_0x2376('0x38')]};return db[_0x2376('0x2a')][_0x2376('0x1a')](_0x4b5f39)['then'](function(_0x1e60e8){_0x8cf771[_0x2376('0x1a')]=_0x1e60e8;if(_0x304d98[_0x2376('0x2f')][_0x2376('0x3c')]){_0x4db5b8['include']=[{'all':!![]}];}return db[_0x2376('0x2a')][_0x2376('0x3d')](_0x4db5b8);})[_0x2376('0x21')](function(_0x17f656){_0x8cf771['rows']=_0x17f656;return _0x8cf771;})[_0x2376('0x21')](respondWithFilteredResult(_0x1af634,_0x4db5b8))[_0x2376('0x3e')](handleError(_0x1af634,null));};exports[_0x2376('0x3f')]=function(_0x58f788,_0x174763){var _0x237878={'raw':![],'where':{'id':_0x58f788[_0x2376('0x40')]['id']}},_0xc3f5d6={};_0xc3f5d6[_0x2376('0x2e')]=_['keys'](db[_0x2376('0x2a')][_0x2376('0x2b')]);_0xc3f5d6[_0x2376('0x2f')]=_[_0x2376('0x30')](_0x58f788[_0x2376('0x2f')]);_0xc3f5d6[_0x2376('0x31')]=_[_0x2376('0x32')](_0xc3f5d6[_0x2376('0x2e')],_0xc3f5d6['query']);_0x237878[_0x2376('0x33')]=_['intersection'](_0xc3f5d6[_0x2376('0x2e')],qs[_0x2376('0x41')](_0x58f788[_0x2376('0x2f')]['fields']));_0x237878[_0x2376('0x33')]=_0x237878['attributes'][_0x2376('0x42')]?_0x237878[_0x2376('0x33')]:_0xc3f5d6[_0x2376('0x2e')];if(_0x58f788[_0x2376('0x2f')]['includeAll']){_0x237878[_0x2376('0x43')]=[{'all':!![]}];}_0x237878=_['merge']({},_0x237878,_0x58f788[_0x2376('0x44')]);return db[_0x2376('0x2a')][_0x2376('0x45')](_0x237878)[_0x2376('0x21')](handleEntityNotFound(_0x174763,null))['then'](respondWithResult(_0x174763,null))[_0x2376('0x3e')](handleError(_0x174763,null));};exports[_0x2376('0x46')]=function(_0x5a0dbc,_0xdbe2e){return db[_0x2376('0x2a')]['create'](_0x5a0dbc['body'],{})['then'](respondWithResult(_0xdbe2e,0xc9))['catch'](handleError(_0xdbe2e,null));};exports[_0x2376('0x20')]=function(_0xba25f9,_0x5afddc){if(_0xba25f9[_0x2376('0x47')]['id']){delete _0xba25f9[_0x2376('0x47')]['id'];}return db[_0x2376('0x2a')][_0x2376('0x45')]({'where':{'id':_0xba25f9[_0x2376('0x40')]['id']}})[_0x2376('0x21')](handleEntityNotFound(_0x5afddc,null))['then'](saveUpdates(_0xba25f9[_0x2376('0x47')],null))['then'](respondWithResult(_0x5afddc,null))[_0x2376('0x3e')](handleError(_0x5afddc,null));};exports['destroy']=function(_0x4cff06,_0x29dfc3){return db[_0x2376('0x2a')][_0x2376('0x45')]({'where':{'id':_0x4cff06[_0x2376('0x40')]['id']}})[_0x2376('0x21')](handleEntityNotFound(_0x29dfc3,null))['then'](removeEntity(_0x29dfc3,null))[_0x2376('0x3e')](handleError(_0x29dfc3,null));};exports[_0x2376('0x48')]=function(_0x367204,_0x133246,_0x1aad76){var _0x263d36={};var _0x288381={};var _0x2d2fd3;var _0x52dd46;return db[_0x2376('0x2a')][_0x2376('0x49')]({'where':{'id':_0x367204['params']['id']}})[_0x2376('0x21')](handleEntityNotFound(_0x133246,null))[_0x2376('0x21')](function(_0x1ceb5a){if(_0x1ceb5a){_0x2d2fd3=_0x1ceb5a;_0x288381[_0x2376('0x2e')]=_[_0x2376('0x30')](db[_0x2376('0x4a')][_0x2376('0x2b')]);_0x288381[_0x2376('0x2f')]=_[_0x2376('0x30')](_0x367204['query']);_0x288381[_0x2376('0x31')]=_['intersection'](_0x288381[_0x2376('0x2e')],_0x288381[_0x2376('0x2f')]);_0x263d36[_0x2376('0x33')]=_[_0x2376('0x32')](_0x288381[_0x2376('0x2e')],qs[_0x2376('0x41')](_0x367204[_0x2376('0x2f')][_0x2376('0x41')]));_0x263d36[_0x2376('0x33')]=_0x263d36[_0x2376('0x33')][_0x2376('0x42')]?_0x263d36[_0x2376('0x33')]:_0x288381[_0x2376('0x2e')];_0x263d36[_0x2376('0x36')]=qs[_0x2376('0x37')](_0x367204[_0x2376('0x2f')][_0x2376('0x37')]);_0x263d36[_0x2376('0x38')]=qs[_0x2376('0x31')](_[_0x2376('0x39')](_0x367204[_0x2376('0x2f')],_0x288381[_0x2376('0x31')]));if(_0x367204[_0x2376('0x2f')][_0x2376('0x3a')]){_0x263d36[_0x2376('0x38')]=_['merge'](_0x263d36[_0x2376('0x38')],{'$or':_[_0x2376('0x29')](_0x263d36[_0x2376('0x33')],function(_0x354034){var _0xe39c39={};_0xe39c39[_0x354034]={'$like':'%'+_0x367204[_0x2376('0x2f')][_0x2376('0x3a')]+'%'};return _0xe39c39;})});}_0x263d36=_[_0x2376('0x3b')]({},_0x263d36,_0x367204[_0x2376('0x44')]);return _0x2d2fd3[_0x2376('0x48')](_0x263d36);}})['then'](function(_0x127a9f){if(_0x127a9f){_0x52dd46=_0x127a9f[_0x2376('0x42')];if(!_0x367204['query'][_0x2376('0x34')](_0x2376('0x35'))){_0x263d36[_0x2376('0x19')]=qs[_0x2376('0x19')](_0x367204[_0x2376('0x2f')]['limit']);_0x263d36[_0x2376('0x1b')]=qs[_0x2376('0x1b')](_0x367204[_0x2376('0x2f')][_0x2376('0x1b')]);}return _0x2d2fd3[_0x2376('0x48')](_0x263d36);}})[_0x2376('0x21')](function(_0x6f5a36){if(_0x6f5a36){return _0x6f5a36?{'count':_0x52dd46,'rows':_0x6f5a36}:null;}})['then'](respondWithResult(_0x133246,null))[_0x2376('0x3e')](handleError(_0x133246,null));};exports[_0x2376('0x4b')]=function(_0x2d4d43,_0xf2858,_0x2d1469){if(_0x2d4d43['body']['id']){delete _0x2d4d43[_0x2376('0x47')]['id'];}return db[_0x2376('0x2a')][_0x2376('0x49')]({'where':{'id':_0x2d4d43[_0x2376('0x40')]['id']}})['then'](handleEntityNotFound(_0xf2858,null))[_0x2376('0x21')](function(_0x53a4c7){if(_0x53a4c7){_0x2d4d43[_0x2376('0x47')][_0x2376('0x4c')]=_0x53a4c7['id'];_0x2d4d43[_0x2376('0x47')][_0x2376('0x4d')]=integrations[_0x2376('0x4e')](_0x2d4d43[_0x2376('0x47')]['channel'],_0x2d4d43['body'][_0x2376('0x2d')]);_0x2d4d43[_0x2376('0x47')][_0x2376('0x4f')]=integrations[_0x2376('0x50')](_0x2d4d43[_0x2376('0x47')][_0x2376('0x51')],_0x2d4d43[_0x2376('0x47')][_0x2376('0x2d')]);return db[_0x2376('0x4a')][_0x2376('0x46')](_0x2d4d43['body'],{'include':[{'model':db[_0x2376('0x52')],'as':_0x2376('0x4d')},{'model':db['ZohoField'],'as':_0x2376('0x4f')}]});}return null;})[_0x2376('0x21')](respondWithResult(_0xf2858,null))['catch'](handleError(_0xf2858,null));};function getAccessToken(_0x1a715a){return new Promise(function(_0x20fe3f,_0x1703b6){var _0x444adf;switch(_0x1a715a[_0x2376('0x53')]){case'US':_0x444adf=_0x2376('0x54');break;case'AU':_0x444adf=_0x2376('0x55');break;case'EU':_0x444adf=_0x2376('0x56');break;case'IN':_0x444adf=_0x2376('0x57');break;case'CN':_0x444adf=_0x2376('0x58');break;default:_0x444adf=_0x2376('0x56');break;}var _0x6edf14={'method':'POST','uri':_0x444adf+_0x2376('0x59'),'qs':{'refresh_token':_0x1a715a[_0x2376('0x5a')],'client_id':_0x1a715a[_0x2376('0x5b')],'client_secret':_0x1a715a[_0x2376('0x5c')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x6edf14)[_0x2376('0x21')](function(_0x417be3){if(_0x417be3[_0x2376('0x5d')]){_0x20fe3f(_0x417be3[_0x2376('0x5d')]);}else{_0x1703b6(_0x2376('0x5e'));}})[_0x2376('0x3e')](function(_0x1240fb){_0x1703b6(_0x1240fb);});});}exports[_0x2376('0x5f')]=function(_0x3ce019,_0x1202e8,_0x41ea5f){var _0x46acac,_0xad90f5,_0x2f013a,_0x252fce,_0x5a562b;return db['ZohoAccount'][_0x2376('0x49')]({'where':{'id':_0x3ce019[_0x2376('0x40')]['id']},'attributes':['id','host','zone',_0x2376('0x5b'),_0x2376('0x5c'),'serverUrl','code',_0x2376('0x5a')]})[_0x2376('0x21')](handleEntityNotFound(_0x1202e8,null))['then'](function(_0x38a031){_0x5a562b=_0x38a031;_0x46acac=_0x5a562b[_0x2376('0x60')];_0xad90f5=_0x46acac===_0x2376('0x61')?'eu':_0x2376('0x62');_0x2f013a=_0x5a562b[_0x2376('0x63')];var _0x117b0e=_0x2f013a[_0x2376('0x64')](-0x1);if(_0x117b0e==='/'||_0x117b0e==='\x5c'||_0x117b0e===':'){_0x2f013a=_0x2f013a[_0x2376('0x65')](0x0,_0x2f013a[_0x2376('0x66')](_0x117b0e));}if(!_0x5a562b[_0x2376('0x5a')]){throw new Error(_0x2376('0x67'));}return getAccessToken(_0x5a562b);})[_0x2376('0x21')](function(_0x2e5584){if(_0x2e5584){return rp({'method':_0x2376('0x68'),'uri':util[_0x2376('0x69')](_0x2376('0x6a'),_0xad90f5),'qs':{'module':_0x2376('0x6b')},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x2e5584},'json':!![]});}})[_0x2376('0x21')](function(_0x522026){if(_0x522026){if(_0x522026[_0x2376('0x6c')]&&_0x522026['response']['error']){throw new Error(_0x522026[_0x2376('0x6c')]['error'][_0x2376('0x6d')]);}var _0x573b20=[];var _0x2413ac=[];var _0x52040f=[_0x2376('0x6e'),'Subject',_0x2376('0x6f'),'WhoId',_0x2376('0x70'),'Call_Result','Call_Start_Time',_0x2376('0x71')];_0x2413ac=_[_0x2376('0x72')](_0x522026['fields'],function(_0x36acc5){return _0x52040f[_0x2376('0x73')](_0x36acc5[_0x2376('0x74')]);});for(var _0x2951da=0x0;_0x2951da<_0x2413ac[_0x2376('0x42')];_0x2951da++){if(_0x2413ac[_0x2951da][_0x2376('0x75')]===![]){_0x573b20[_0x2376('0x76')]({'id':_0x2413ac[_0x2951da]['id'],'name':_0x2413ac[_0x2951da][_0x2376('0x77')],'custom':_0x2413ac[_0x2951da][_0x2376('0x78')],'options':_0x2413ac[_0x2951da]['data_type']===_0x2376('0x79')&&_0x2413ac[_0x2951da][_0x2376('0x7a')][_0x2376('0x42')]>-0x1?_['map'](_0x2413ac[_0x2951da][_0x2376('0x7a')],function(_0x43bf78){return{'name':_0x43bf78,'value':_0x43bf78};}):[]});}}return{'count':_0x573b20[_0x2376('0x42')],'rows':_0x573b20};}else{return{'count':0x0,'rows':[]};}})[_0x2376('0x21')](respondWithResult(_0x1202e8,null))['catch'](function(_0x34cf04){var _0xcf18bc=_0x3ce019[_0x2376('0x2f')][_0x2376('0x7b')]?0x1f4:_0x34cf04['statusCode']||0x1f4;logger[_0x2376('0x24')](_0x2376('0x7c'),_0x2376('0x5f'),_0xcf18bc,JSON[_0x2376('0x7d')](_0x34cf04));delete _0x34cf04[_0x2376('0x26')];if(_0xcf18bc===0x191){_0xcf18bc=0x190;}_0x1202e8[_0x2376('0x17')](_0xcf18bc)[_0x2376('0x27')](_0x3ce019[_0x2376('0x2f')][_0x2376('0x7b')]?{'message':'Wrong\x20credentials','statusCode':_0x34cf04[_0x2376('0x7e')]}:_0x34cf04);});};
\ No newline at end of file
index 5fc30d4..8f6a6ec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x095a=['host','slice','substring','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','authorization_code','application/x-www-form-urlencoded','then','parse','refresh_token','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','catch','serverUrl','/oauth/v2/token','refreshToken','lodash','util','moment','bluebird','request-promise','path','rimraf','../../components/integrations/configuration','define','ZohoAccount','changed','zone','clientId','clientSecret','code'];(function(_0x3c6eb2,_0x28fc73){var _0x520966=function(_0x4907f6){while(--_0x4907f6){_0x3c6eb2['push'](_0x3c6eb2['shift']());}};_0x520966(++_0x28fc73);}(_0x095a,0x18b));var _0xa095=function(_0x2040b2,_0x49925e){_0x2040b2=_0x2040b2-0x0;var _0x41ad70=_0x095a[_0x2040b2];return _0x41ad70;};'use strict';var _=require(_0xa095('0x0'));var util=require(_0xa095('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xa095('0x2'));var BPromise=require(_0xa095('0x3'));var rp=require(_0xa095('0x4'));var fs=require('fs');var path=require(_0xa095('0x5'));var rimraf=require(_0xa095('0x6'));var config=require('../../config/environment');var attributes=require('./intZohoAccount.attributes');var integrations=require(_0xa095('0x7'));module['exports']=function(_0x5685ed,_0x4e3f9a){return _0x5685ed[_0xa095('0x8')](_0xa095('0x9'),attributes,{'tableName':'int_zoho_accounts','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x1faf4f,_0x692746,_0x15e941){if(_0x1faf4f[_0xa095('0xa')](_0xa095('0xb'))||_0x1faf4f[_0xa095('0xa')]('serverUrl')||_0x1faf4f['changed'](_0xa095('0xc'))||_0x1faf4f['changed'](_0xa095('0xd'))||_0x1faf4f[_0xa095('0xa')](_0xa095('0xe'))||_0x1faf4f[_0xa095('0xa')](_0xa095('0xf'))){var _0x1f02ba,_0x5f3a07;_0x1f02ba=_0x1faf4f['serverUrl'];var _0x5072a7=_0x1f02ba[_0xa095('0x10')](-0x1);if(_0x5072a7==='/'||_0x5072a7==='\x5c'||_0x5072a7===':'){_0x1f02ba=_0x1f02ba[_0xa095('0x11')](0x0,_0x1f02ba[_0xa095('0x12')](_0x5072a7));}switch(_0x1faf4f[_0xa095('0xb')]){case'US':_0x5f3a07=_0xa095('0x13');break;case'AU':_0x5f3a07=_0xa095('0x14');break;case'IN':_0x5f3a07=_0xa095('0x15');break;case'CN':_0x5f3a07=_0xa095('0x16');break;default:_0x5f3a07=_0xa095('0x17');break;}var _0xa6b9b1={'method':_0xa095('0x18'),'uri':_0x5f3a07+'/oauth/v2/token','form':{'grant_type':_0xa095('0x19'),'client_id':_0x1faf4f[_0xa095('0xc')],'client_secret':_0x1faf4f[_0xa095('0xd')],'redirect_uri':_0x1faf4f['serverUrl'],'code':_0x1faf4f['code']},'headers':{'Content-Type':_0xa095('0x1a')}};return rp(_0xa6b9b1)[_0xa095('0x1b')](function(_0x58de5e){var _0x27027f=JSON[_0xa095('0x1c')](_0x58de5e);if(_0x27027f[_0xa095('0x1d')]){_0x1faf4f['refreshToken']=_0x27027f[_0xa095('0x1d')];logger[_0xa095('0x1e')](util[_0xa095('0x1f')](_0xa095('0x20'),_0x1faf4f[_0xa095('0x21')],_0x1faf4f['id']));}else{logger[_0xa095('0x22')](util['format'](_0xa095('0x23'),_0x1faf4f[_0xa095('0x21')],_0x1faf4f['id']),util[_0xa095('0x24')](_0x27027f,{'showHidden':![],'depth':null}));}return _0x15e941(null,_0x692746);})[_0xa095('0x25')](function(_0x20151a){logger[_0xa095('0x22')](util['format'](_0xa095('0x23'),_0x1faf4f[_0xa095('0x21')],_0x1faf4f['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x15e941(_0x20151a);});}else{return _0x15e941(null,_0x692746);}},'beforeUpdate':function(_0x50631c,_0xde0130,_0x212556){if(_0x50631c[_0xa095('0xa')]('zone')||_0x50631c[_0xa095('0xa')](_0xa095('0x26'))||_0x50631c[_0xa095('0xa')](_0xa095('0xc'))||_0x50631c['changed'](_0xa095('0xd'))||_0x50631c[_0xa095('0xa')](_0xa095('0xe'))||_0x50631c[_0xa095('0xa')](_0xa095('0xf'))){var _0x5ad24f,_0x5d480f;_0x5ad24f=_0x50631c['serverUrl'];var _0x1e8696=_0x5ad24f[_0xa095('0x10')](-0x1);if(_0x1e8696==='/'||_0x1e8696==='\x5c'||_0x1e8696===':'){_0x5ad24f=_0x5ad24f[_0xa095('0x11')](0x0,_0x5ad24f[_0xa095('0x12')](_0x1e8696));}switch(_0x50631c[_0xa095('0xb')]){case'US':_0x5d480f=_0xa095('0x13');break;case'AU':_0x5d480f=_0xa095('0x14');break;case'IN':_0x5d480f=_0xa095('0x15');break;case'CN':_0x5d480f='https://accounts.zoho.com.cn';break;default:_0x5d480f='https://accounts.zoho.eu';break;}var _0x4010b9={'method':'POST','uri':_0x5d480f+_0xa095('0x27'),'form':{'grant_type':'authorization_code','client_id':_0x50631c[_0xa095('0xc')],'client_secret':_0x50631c[_0xa095('0xd')],'redirect_uri':_0x50631c[_0xa095('0x26')],'code':_0x50631c[_0xa095('0xe')]},'headers':{'Content-Type':_0xa095('0x1a')}};return rp(_0x4010b9)[_0xa095('0x1b')](function(_0x416a3a){var _0x325f28=JSON[_0xa095('0x1c')](_0x416a3a);if(_0x325f28['refresh_token']){_0x50631c[_0xa095('0x28')]=_0x325f28[_0xa095('0x1d')];logger[_0xa095('0x1e')](util[_0xa095('0x1f')](_0xa095('0x20'),_0x50631c[_0xa095('0x21')],_0x50631c['id']));}else{logger[_0xa095('0x22')](util['format'](_0xa095('0x23'),_0x50631c[_0xa095('0x21')],_0x50631c['id']),util[_0xa095('0x24')](_0x325f28,{'showHidden':![],'depth':null}));}return _0x212556(null,_0xde0130);})['catch'](function(_0x2eb2c0){logger[_0xa095('0x22')](util['format'](_0xa095('0x23'),_0x50631c['name'],_0x50631c['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x212556(_0x2eb2c0);});}else{return _0x212556(null,_0xde0130);}}}});};
\ No newline at end of file
+var _0xc26e=['lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.in','https://accounts.zoho.eu','POST','/oauth/v2/token','authorization_code','clientSecret','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','name','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','error','host','https://accounts.zoho.com.au','https://accounts.zoho.com.cn','code','catch','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','exports','int_zoho_accounts','changed','zone','serverUrl','clientId','slice','substring'];(function(_0x25bca6,_0xe415ea){var _0x3f8d02=function(_0x3e581b){while(--_0x3e581b){_0x25bca6['push'](_0x25bca6['shift']());}};_0x3f8d02(++_0xe415ea);}(_0xc26e,0x103));var _0xec26=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc26e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xec26('0x0'))('api');var moment=require(_0xec26('0x1'));var BPromise=require(_0xec26('0x2'));var rp=require(_0xec26('0x3'));var fs=require('fs');var path=require(_0xec26('0x4'));var rimraf=require('rimraf');var config=require(_0xec26('0x5'));var attributes=require('./intZohoAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0xec26('0x6')]=function(_0x294a95,_0x380276){return _0x294a95['define']('ZohoAccount',attributes,{'tableName':_0xec26('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x40e0f6,_0x380f62,_0x31c978){if(_0x40e0f6[_0xec26('0x8')](_0xec26('0x9'))||_0x40e0f6[_0xec26('0x8')](_0xec26('0xa'))||_0x40e0f6[_0xec26('0x8')](_0xec26('0xb'))||_0x40e0f6['changed']('clientSecret')||_0x40e0f6[_0xec26('0x8')]('code')||_0x40e0f6[_0xec26('0x8')]('host')){var _0x59ad16,_0x545660;_0x59ad16=_0x40e0f6[_0xec26('0xa')];var _0x304b89=_0x59ad16[_0xec26('0xc')](-0x1);if(_0x304b89==='/'||_0x304b89==='\x5c'||_0x304b89===':'){_0x59ad16=_0x59ad16[_0xec26('0xd')](0x0,_0x59ad16[_0xec26('0xe')](_0x304b89));}switch(_0x40e0f6[_0xec26('0x9')]){case'US':_0x545660=_0xec26('0xf');break;case'AU':_0x545660='https://accounts.zoho.com.au';break;case'IN':_0x545660=_0xec26('0x10');break;case'CN':_0x545660='https://accounts.zoho.com.cn';break;default:_0x545660=_0xec26('0x11');break;}var _0x34e328={'method':_0xec26('0x12'),'uri':_0x545660+_0xec26('0x13'),'form':{'grant_type':_0xec26('0x14'),'client_id':_0x40e0f6['clientId'],'client_secret':_0x40e0f6[_0xec26('0x15')],'redirect_uri':_0x40e0f6[_0xec26('0xa')],'code':_0x40e0f6['code']},'headers':{'Content-Type':_0xec26('0x16')}};return rp(_0x34e328)[_0xec26('0x17')](function(_0x330d56){var _0x1e7b64=JSON[_0xec26('0x18')](_0x330d56);if(_0x1e7b64[_0xec26('0x19')]){_0x40e0f6[_0xec26('0x1a')]=_0x1e7b64['refresh_token'];logger[_0xec26('0x1b')](util[_0xec26('0x1c')](_0xec26('0x1d'),_0x40e0f6[_0xec26('0x1e')],_0x40e0f6['id']));}else{logger['error'](util[_0xec26('0x1c')](_0xec26('0x1f'),_0x40e0f6['name'],_0x40e0f6['id']),util[_0xec26('0x20')](_0x1e7b64,{'showHidden':![],'depth':null}));}return _0x31c978(null,_0x380f62);})['catch'](function(_0xb5eb98){logger[_0xec26('0x21')](util[_0xec26('0x1c')](_0xec26('0x1f'),_0x40e0f6[_0xec26('0x1e')],_0x40e0f6['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x31c978(_0xb5eb98);});}else{return _0x31c978(null,_0x380f62);}},'beforeUpdate':function(_0x4f88dc,_0x72e561,_0x43e0ec){if(_0x4f88dc[_0xec26('0x8')](_0xec26('0x9'))||_0x4f88dc[_0xec26('0x8')](_0xec26('0xa'))||_0x4f88dc['changed']('clientId')||_0x4f88dc[_0xec26('0x8')](_0xec26('0x15'))||_0x4f88dc[_0xec26('0x8')]('code')||_0x4f88dc[_0xec26('0x8')](_0xec26('0x22'))){var _0x4884a9,_0x4711bb;_0x4884a9=_0x4f88dc[_0xec26('0xa')];var _0x33f6d1=_0x4884a9[_0xec26('0xc')](-0x1);if(_0x33f6d1==='/'||_0x33f6d1==='\x5c'||_0x33f6d1===':'){_0x4884a9=_0x4884a9['substring'](0x0,_0x4884a9['lastIndexOf'](_0x33f6d1));}switch(_0x4f88dc['zone']){case'US':_0x4711bb='https://accounts.zoho.com';break;case'AU':_0x4711bb=_0xec26('0x23');break;case'IN':_0x4711bb=_0xec26('0x10');break;case'CN':_0x4711bb=_0xec26('0x24');break;default:_0x4711bb=_0xec26('0x11');break;}var _0x35b048={'method':_0xec26('0x12'),'uri':_0x4711bb+'/oauth/v2/token','form':{'grant_type':_0xec26('0x14'),'client_id':_0x4f88dc[_0xec26('0xb')],'client_secret':_0x4f88dc[_0xec26('0x15')],'redirect_uri':_0x4f88dc['serverUrl'],'code':_0x4f88dc[_0xec26('0x25')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x35b048)[_0xec26('0x17')](function(_0x503110){var _0x6a152b=JSON[_0xec26('0x18')](_0x503110);if(_0x6a152b['refresh_token']){_0x4f88dc[_0xec26('0x1a')]=_0x6a152b[_0xec26('0x19')];logger[_0xec26('0x1b')](util['format'](_0xec26('0x1d'),_0x4f88dc[_0xec26('0x1e')],_0x4f88dc['id']));}else{logger[_0xec26('0x21')](util['format'](_0xec26('0x1f'),_0x4f88dc[_0xec26('0x1e')],_0x4f88dc['id']),util[_0xec26('0x20')](_0x6a152b,{'showHidden':![],'depth':null}));}return _0x43e0ec(null,_0x72e561);})[_0xec26('0x26')](function(_0x1fcb11){logger[_0xec26('0x21')](util['format']('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x4f88dc['name'],_0x4f88dc['id']),util[_0xec26('0x20')](parsedResult,{'showHidden':![],'depth':null}));return _0x43e0ec(_0x1fcb11);});}else{return _0x43e0ec(null,_0x72e561);}}}});};
\ No newline at end of file
index 6d942c2..ba2bff1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x23db=['result','catch','findAll','options','raw','where','include','map','model','attributes','GetZohoAccount','stringify','find','then','ShowZohoAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','http','request','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message'];(function(_0xbd53d,_0x31c71f){var _0x3b02e=function(_0x13cd94){while(--_0x13cd94){_0xbd53d['push'](_0xbd53d['shift']());}};_0x3b02e(++_0x31c71f);}(_0x23db,0x141));var _0xb23d=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0x23db[_0x2a6809];return _0x11c371;};'use strict';var _=require(_0xb23d('0x0'));var util=require(_0xb23d('0x1'));var moment=require(_0xb23d('0x2'));var BPromise=require(_0xb23d('0x3'));var rs=require(_0xb23d('0x4'));var fs=require('fs');var Redis=require(_0xb23d('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xb23d('0x6'))(_0xb23d('0x7'));var config=require('../../config/environment');var jayson=require(_0xb23d('0x8'));var client=jayson[_0xb23d('0x9')][_0xb23d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2056b6,_0x39799c,_0x38bed9){return new BPromise(function(_0x460fa0,_0x466785){return client[_0xb23d('0xb')](_0x2056b6,_0x38bed9)['then'](function(_0x2f91f0){logger[_0xb23d('0xc')](_0xb23d('0xd'),_0x39799c,_0xb23d('0xe'));logger[_0xb23d('0xf')]('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x39799c,'request\x20sent',JSON['stringify'](_0x2f91f0));if(_0x2f91f0[_0xb23d('0x10')]){if(_0x2f91f0['error'][_0xb23d('0x11')]===0x1f4){logger[_0xb23d('0x10')](_0xb23d('0xd'),_0x39799c,_0x2f91f0[_0xb23d('0x10')][_0xb23d('0x12')]);return _0x466785(_0x2f91f0[_0xb23d('0x10')][_0xb23d('0x12')]);}logger['error'](_0xb23d('0xd'),_0x39799c,_0x2f91f0[_0xb23d('0x10')][_0xb23d('0x12')]);return _0x460fa0(_0x2f91f0[_0xb23d('0x10')][_0xb23d('0x12')]);}else{logger[_0xb23d('0xc')]('ZohoAccount,\x20%s,\x20%s',_0x39799c,'request\x20sent');_0x460fa0(_0x2f91f0[_0xb23d('0x13')][_0xb23d('0x12')]);}})[_0xb23d('0x14')](function(_0x9e5eb3){logger[_0xb23d('0x10')](_0xb23d('0xd'),_0x39799c,_0x9e5eb3);_0x466785(_0x9e5eb3);});});}exports['GetZohoAccount']=function(_0x37bfe2){var _0x3f2c6b=this;return new Promise(function(_0x2b47e0,_0x2673d3){return db['ZohoAccount'][_0xb23d('0x15')]({'raw':_0x37bfe2['options']?_0x37bfe2[_0xb23d('0x16')][_0xb23d('0x17')]===undefined?!![]:![]:!![],'where':_0x37bfe2[_0xb23d('0x16')]?_0x37bfe2[_0xb23d('0x16')][_0xb23d('0x18')]||null:null,'attributes':_0x37bfe2[_0xb23d('0x16')]?_0x37bfe2[_0xb23d('0x16')]['attributes']||null:null,'limit':_0x37bfe2[_0xb23d('0x16')]?_0x37bfe2['options']['limit']||null:null,'include':_0x37bfe2[_0xb23d('0x16')]?_0x37bfe2[_0xb23d('0x16')][_0xb23d('0x19')]?_[_0xb23d('0x1a')](_0x37bfe2[_0xb23d('0x16')][_0xb23d('0x19')],function(_0x921fc){return{'model':db[_0x921fc[_0xb23d('0x1b')]],'as':_0x921fc['as'],'attributes':_0x921fc[_0xb23d('0x1c')],'include':_0x921fc[_0xb23d('0x19')]?_[_0xb23d('0x1a')](_0x921fc['include'],function(_0x1f0731){return{'model':db[_0x1f0731[_0xb23d('0x1b')]],'as':_0x1f0731['as'],'attributes':_0x1f0731[_0xb23d('0x1c')],'include':_0x1f0731['include']?_['map'](_0x1f0731[_0xb23d('0x19')],function(_0x2e758e){return{'model':db[_0x2e758e[_0xb23d('0x1b')]],'as':_0x2e758e['as'],'attributes':_0x2e758e[_0xb23d('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2785f5){logger[_0xb23d('0xc')](_0xb23d('0x1d'),_0x37bfe2);logger[_0xb23d('0xf')](_0xb23d('0x1d'),_0x37bfe2,JSON[_0xb23d('0x1e')](_0x2785f5));_0x2b47e0(_0x2785f5);})[_0xb23d('0x14')](function(_0x867d69){logger[_0xb23d('0x10')](_0xb23d('0x1d'),_0x867d69[_0xb23d('0x12')],_0x37bfe2);_0x2673d3(_0x3f2c6b[_0xb23d('0x10')](0x1f4,_0x867d69[_0xb23d('0x12')]));});});};exports['ShowZohoAccount']=function(_0x56f62a){var _0x536be6=this;return new Promise(function(_0x4722c1,_0x53c6ed){return db['ZohoAccount'][_0xb23d('0x1f')]({'raw':_0x56f62a['options']?_0x56f62a[_0xb23d('0x16')][_0xb23d('0x17')]===undefined?!![]:![]:!![],'where':_0x56f62a[_0xb23d('0x16')]?_0x56f62a[_0xb23d('0x16')][_0xb23d('0x18')]||null:null,'attributes':_0x56f62a[_0xb23d('0x16')]?_0x56f62a[_0xb23d('0x16')][_0xb23d('0x1c')]||null:null,'include':_0x56f62a[_0xb23d('0x16')]?_0x56f62a[_0xb23d('0x16')][_0xb23d('0x19')]?_[_0xb23d('0x1a')](_0x56f62a[_0xb23d('0x16')][_0xb23d('0x19')],function(_0x220543){return{'model':db[_0x220543[_0xb23d('0x1b')]],'as':_0x220543['as'],'attributes':_0x220543['attributes'],'include':_0x220543[_0xb23d('0x19')]?_[_0xb23d('0x1a')](_0x220543[_0xb23d('0x19')],function(_0x208b2a){return{'model':db[_0x208b2a[_0xb23d('0x1b')]],'as':_0x208b2a['as'],'attributes':_0x208b2a[_0xb23d('0x1c')],'include':_0x208b2a[_0xb23d('0x19')]?_[_0xb23d('0x1a')](_0x208b2a['include'],function(_0x1131d3){return{'model':db[_0x1131d3[_0xb23d('0x1b')]],'as':_0x1131d3['as'],'attributes':_0x1131d3[_0xb23d('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xb23d('0x20')](function(_0x3ca4af){logger[_0xb23d('0xc')](_0xb23d('0x21'),_0x56f62a);logger[_0xb23d('0xf')](_0xb23d('0x21'),_0x56f62a,JSON[_0xb23d('0x1e')](_0x3ca4af));_0x4722c1(_0x3ca4af);})[_0xb23d('0x14')](function(_0x22683a){logger['error'](_0xb23d('0x21'),_0x22683a[_0xb23d('0x12')],_0x56f62a);_0x53c6ed(_0x536be6[_0xb23d('0x10')](0x1f4,_0x22683a['message']));});});};
\ No newline at end of file
+var _0xc74c=['catch','GetZohoAccount','ZohoAccount','findAll','options','raw','where','attributes','include','map','model','debug','find','then','ShowZohoAccount','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xc74c,0x163));var _0xcc74=function(_0x40f339,_0x463c1e){_0x40f339=_0x40f339-0x0;var _0x46948c=_0xc74c[_0x40f339];return _0x46948c;};'use strict';var _=require(_0xcc74('0x0'));var util=require(_0xcc74('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xcc74('0x2'));var fs=require('fs');var Redis=require(_0xcc74('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xcc74('0x4'));var logger=require(_0xcc74('0x5'))(_0xcc74('0x6'));var config=require(_0xcc74('0x7'));var jayson=require(_0xcc74('0x8'));var client=jayson[_0xcc74('0x9')][_0xcc74('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5d46a6,_0x15248f,_0x86f429){return new BPromise(function(_0x1eb886,_0x473308){return client[_0xcc74('0xb')](_0x5d46a6,_0x86f429)['then'](function(_0x4b4534){logger[_0xcc74('0xc')](_0xcc74('0xd'),_0x15248f,_0xcc74('0xe'));logger['debug'](_0xcc74('0xf'),_0x15248f,_0xcc74('0xe'),JSON[_0xcc74('0x10')](_0x4b4534));if(_0x4b4534['error']){if(_0x4b4534[_0xcc74('0x11')]['code']===0x1f4){logger[_0xcc74('0x11')]('ZohoAccount,\x20%s,\x20%s',_0x15248f,_0x4b4534['error']['message']);return _0x473308(_0x4b4534[_0xcc74('0x11')][_0xcc74('0x12')]);}logger[_0xcc74('0x11')](_0xcc74('0xd'),_0x15248f,_0x4b4534[_0xcc74('0x11')]['message']);return _0x1eb886(_0x4b4534[_0xcc74('0x11')][_0xcc74('0x12')]);}else{logger[_0xcc74('0xc')](_0xcc74('0xd'),_0x15248f,_0xcc74('0xe'));_0x1eb886(_0x4b4534['result'][_0xcc74('0x12')]);}})[_0xcc74('0x13')](function(_0xe44014){logger[_0xcc74('0x11')](_0xcc74('0xd'),_0x15248f,_0xe44014);_0x473308(_0xe44014);});});}exports[_0xcc74('0x14')]=function(_0x170583){var _0x45d9bd=this;return new Promise(function(_0x30101f,_0x5a18b3){return db[_0xcc74('0x15')][_0xcc74('0x16')]({'raw':_0x170583[_0xcc74('0x17')]?_0x170583[_0xcc74('0x17')][_0xcc74('0x18')]===undefined?!![]:![]:!![],'where':_0x170583[_0xcc74('0x17')]?_0x170583['options'][_0xcc74('0x19')]||null:null,'attributes':_0x170583[_0xcc74('0x17')]?_0x170583['options'][_0xcc74('0x1a')]||null:null,'limit':_0x170583[_0xcc74('0x17')]?_0x170583[_0xcc74('0x17')]['limit']||null:null,'include':_0x170583[_0xcc74('0x17')]?_0x170583[_0xcc74('0x17')][_0xcc74('0x1b')]?_[_0xcc74('0x1c')](_0x170583['options'][_0xcc74('0x1b')],function(_0x11811d){return{'model':db[_0x11811d[_0xcc74('0x1d')]],'as':_0x11811d['as'],'attributes':_0x11811d['attributes'],'include':_0x11811d[_0xcc74('0x1b')]?_[_0xcc74('0x1c')](_0x11811d[_0xcc74('0x1b')],function(_0x5a9fa6){return{'model':db[_0x5a9fa6['model']],'as':_0x5a9fa6['as'],'attributes':_0x5a9fa6['attributes'],'include':_0x5a9fa6[_0xcc74('0x1b')]?_[_0xcc74('0x1c')](_0x5a9fa6[_0xcc74('0x1b')],function(_0x311cc2){return{'model':db[_0x311cc2[_0xcc74('0x1d')]],'as':_0x311cc2['as'],'attributes':_0x311cc2[_0xcc74('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x393e56){logger[_0xcc74('0xc')](_0xcc74('0x14'),_0x170583);logger[_0xcc74('0x1e')]('GetZohoAccount',_0x170583,JSON[_0xcc74('0x10')](_0x393e56));_0x30101f(_0x393e56);})[_0xcc74('0x13')](function(_0x46e47f){logger[_0xcc74('0x11')](_0xcc74('0x14'),_0x46e47f[_0xcc74('0x12')],_0x170583);_0x5a18b3(_0x45d9bd['error'](0x1f4,_0x46e47f[_0xcc74('0x12')]));});});};exports['ShowZohoAccount']=function(_0x3faeab){var _0x380134=this;return new Promise(function(_0x424718,_0x43513b){return db[_0xcc74('0x15')][_0xcc74('0x1f')]({'raw':_0x3faeab['options']?_0x3faeab['options'][_0xcc74('0x18')]===undefined?!![]:![]:!![],'where':_0x3faeab[_0xcc74('0x17')]?_0x3faeab[_0xcc74('0x17')]['where']||null:null,'attributes':_0x3faeab[_0xcc74('0x17')]?_0x3faeab[_0xcc74('0x17')]['attributes']||null:null,'include':_0x3faeab['options']?_0x3faeab[_0xcc74('0x17')][_0xcc74('0x1b')]?_['map'](_0x3faeab[_0xcc74('0x17')][_0xcc74('0x1b')],function(_0x1a8b20){return{'model':db[_0x1a8b20[_0xcc74('0x1d')]],'as':_0x1a8b20['as'],'attributes':_0x1a8b20[_0xcc74('0x1a')],'include':_0x1a8b20[_0xcc74('0x1b')]?_['map'](_0x1a8b20[_0xcc74('0x1b')],function(_0x2a4634){return{'model':db[_0x2a4634[_0xcc74('0x1d')]],'as':_0x2a4634['as'],'attributes':_0x2a4634[_0xcc74('0x1a')],'include':_0x2a4634[_0xcc74('0x1b')]?_[_0xcc74('0x1c')](_0x2a4634[_0xcc74('0x1b')],function(_0x5a361f){return{'model':db[_0x5a361f[_0xcc74('0x1d')]],'as':_0x5a361f['as'],'attributes':_0x5a361f['attributes']};}):[]};}):[]};}):[]:[]})[_0xcc74('0x20')](function(_0xe7c08b){logger[_0xcc74('0xc')](_0xcc74('0x21'),_0x3faeab);logger[_0xcc74('0x1e')](_0xcc74('0x21'),_0x3faeab,JSON[_0xcc74('0x10')](_0xe7c08b));_0x424718(_0xe7c08b);})[_0xcc74('0x13')](function(_0x11d7d7){logger[_0xcc74('0x11')](_0xcc74('0x21'),_0x11d7d7[_0xcc74('0x12')],_0x3faeab);_0x43513b(_0x380134['error'](0x1f4,_0x11d7d7[_0xcc74('0x12')]));});});};
\ No newline at end of file
index 7fbca91..cd5171d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe0c7=['multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','get','isAuthenticated','index','/:id','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','put','update','delete','destroy','exports'];(function(_0x2064e5,_0x4f6fa2){var _0x21a233=function(_0x1b2491){while(--_0x1b2491){_0x2064e5['push'](_0x2064e5['shift']());}};_0x21a233(++_0x4f6fa2);}(_0xe0c7,0xc8));var _0x7e0c=function(_0x537db1,_0x341b77){_0x537db1=_0x537db1-0x0;var _0x448112=_0xe0c7[_0x537db1];return _0x448112;};'use strict';var multer=require(_0x7e0c('0x0'));var util=require(_0x7e0c('0x1'));var path=require(_0x7e0c('0x2'));var timeout=require('connect-timeout');var express=require(_0x7e0c('0x3'));var router=express['Router']();var fs_extra=require(_0x7e0c('0x4'));var auth=require(_0x7e0c('0x5'));var interaction=require(_0x7e0c('0x6'));var config=require(_0x7e0c('0x7'));var controller=require(_0x7e0c('0x8'));router[_0x7e0c('0x9')]('/',auth[_0x7e0c('0xa')](),controller[_0x7e0c('0xb')]);router[_0x7e0c('0x9')](_0x7e0c('0xc'),auth[_0x7e0c('0xa')](),controller['show']);router[_0x7e0c('0x9')](_0x7e0c('0xd'),auth[_0x7e0c('0xa')](),controller[_0x7e0c('0xe')]);router['get'](_0x7e0c('0xf'),auth[_0x7e0c('0xa')](),controller[_0x7e0c('0x10')]);router[_0x7e0c('0x9')](_0x7e0c('0x11'),auth[_0x7e0c('0xa')](),controller[_0x7e0c('0x12')]);router[_0x7e0c('0x13')]('/',auth[_0x7e0c('0xa')](),controller['create']);router[_0x7e0c('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x7e0c('0x15')]);router[_0x7e0c('0x16')](_0x7e0c('0xc'),auth['isAuthenticated'](),controller[_0x7e0c('0x17')]);module[_0x7e0c('0x18')]=router;
\ No newline at end of file
+var _0x3c50=['show','getFields','getSubjects','getDescriptions','post','create','put','update','destroy','exports','util','path','Router','fs-extra','../../components/interaction/service','./intZohoConfiguration.controller','get','isAuthenticated','index','/:id'];(function(_0x2a1452,_0x1e6d27){var _0x52725e=function(_0x497b0c){while(--_0x497b0c){_0x2a1452['push'](_0x2a1452['shift']());}};_0x52725e(++_0x1e6d27);}(_0x3c50,0x1d6));var _0x03c5=function(_0x9e0a51,_0x2fa12d){_0x9e0a51=_0x9e0a51-0x0;var _0x23a33e=_0x3c50[_0x9e0a51];return _0x23a33e;};'use strict';var multer=require('multer');var util=require(_0x03c5('0x0'));var path=require(_0x03c5('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x03c5('0x2')]();var fs_extra=require(_0x03c5('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x03c5('0x4'));var config=require('../../config/environment');var controller=require(_0x03c5('0x5'));router[_0x03c5('0x6')]('/',auth[_0x03c5('0x7')](),controller[_0x03c5('0x8')]);router['get'](_0x03c5('0x9'),auth[_0x03c5('0x7')](),controller[_0x03c5('0xa')]);router[_0x03c5('0x6')]('/:id/fields',auth[_0x03c5('0x7')](),controller[_0x03c5('0xb')]);router[_0x03c5('0x6')]('/:id/subjects',auth[_0x03c5('0x7')](),controller[_0x03c5('0xc')]);router[_0x03c5('0x6')]('/:id/descriptions',auth[_0x03c5('0x7')](),controller[_0x03c5('0xd')]);router[_0x03c5('0xe')]('/',auth['isAuthenticated'](),controller[_0x03c5('0xf')]);router[_0x03c5('0x10')](_0x03c5('0x9'),auth['isAuthenticated'](),controller[_0x03c5('0x11')]);router['delete'](_0x03c5('0x9'),auth[_0x03c5('0x7')](),controller[_0x03c5('0x12')]);module[_0x03c5('0x13')]=router;
\ No newline at end of file
index e658bf7..7464a1c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x34c3=['contact_lead','sequelize','exports','STRING','ENUM','lead','contact','nothing'];(function(_0x59c774,_0x372231){var _0x35f17e=function(_0xb91cd4){while(--_0xb91cd4){_0x59c774['push'](_0x59c774['shift']());}};_0x35f17e(++_0x372231);}(_0x34c3,0x1e1));var _0x334c=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x34c3[_0x17d9e3];return _0x14192d;};'use strict';var Sequelize=require(_0x334c('0x0'));module[_0x334c('0x1')]={'name':{'type':Sequelize[_0x334c('0x2')]},'moduleCreate':{'type':Sequelize[_0x334c('0x3')](_0x334c('0x4'),_0x334c('0x5'),_0x334c('0x6')),'defaultValue':_0x334c('0x4')},'moduleSearch':{'type':Sequelize[_0x334c('0x3')](_0x334c('0x7'),_0x334c('0x5'),_0x334c('0x4')),'defaultValue':_0x334c('0x7')},'description':{'type':Sequelize[_0x334c('0x2')]}};
\ No newline at end of file
+var _0x5e97=['ENUM','lead','nothing','contact_lead','STRING','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5e97,0x155));var _0x75e9=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x5e97[_0x1035c1];return _0x308d67;};'use strict';var Sequelize=require(_0x75e9('0x0'));module[_0x75e9('0x1')]={'name':{'type':Sequelize['STRING']},'moduleCreate':{'type':Sequelize[_0x75e9('0x2')](_0x75e9('0x3'),'contact',_0x75e9('0x4')),'defaultValue':_0x75e9('0x3')},'moduleSearch':{'type':Sequelize[_0x75e9('0x2')](_0x75e9('0x5'),'contact',_0x75e9('0x3')),'defaultValue':_0x75e9('0x5')},'description':{'type':Sequelize[_0x75e9('0x6')]}};
\ No newline at end of file
index 16dbf68..080350c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x65c4=['bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','update','then','destroy','error','name','send','index','map','ZohoConfiguration','rawAttributes','fieldName','type','query','filters','intersection','model','fields','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','keys','length','includeAll','find','create','body','ZohoField','getFields','nolimit','getSubjects','findOne','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x5e244e,_0x9f5a99){var _0x275036=function(_0x713b58){while(--_0x713b58){_0x5e244e['push'](_0x5e244e['shift']());}};_0x275036(++_0x9f5a99);}(_0x65c4,0xf1));var _0x465c=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0x65c4[_0x56482c];return _0x5aae7a;};'use strict';var emlformat=require(_0x465c('0x0'));var rimraf=require(_0x465c('0x1'));var zipdir=require(_0x465c('0x2'));var jsonpatch=require(_0x465c('0x3'));var rp=require(_0x465c('0x4'));var moment=require('moment');var BPromise=require(_0x465c('0x5'));var Mustache=require(_0x465c('0x6'));var util=require(_0x465c('0x7'));var path=require(_0x465c('0x8'));var sox=require(_0x465c('0x9'));var csv=require(_0x465c('0xa'));var ejs=require(_0x465c('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x465c('0xc'));var squel=require('squel');var crypto=require(_0x465c('0xd'));var jsforce=require(_0x465c('0xe'));var deskjs=require(_0x465c('0xf'));var toCsv=require(_0x465c('0xa'));var querystring=require('querystring');var Papa=require(_0x465c('0x10'));var Redis=require(_0x465c('0x11'));var authService=require(_0x465c('0x12'));var qs=require(_0x465c('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x465c('0x14'));var logger=require(_0x465c('0x15'))(_0x465c('0x16'));var utils=require('../../config/utils');var config=require(_0x465c('0x17'));var licenseUtil=require(_0x465c('0x18'));var db=require(_0x465c('0x19'))['db'];function respondWithStatusCode(_0x26e441,_0x494153){_0x494153=_0x494153||0xcc;return function(_0x589d82){if(_0x589d82){return _0x26e441[_0x465c('0x1a')](_0x494153);}return _0x26e441[_0x465c('0x1b')](_0x494153)[_0x465c('0x1c')]();};}function respondWithResult(_0x58d5c5,_0x45b2d3){_0x45b2d3=_0x45b2d3||0xc8;return function(_0x592e7b){if(_0x592e7b){return _0x58d5c5[_0x465c('0x1b')](_0x45b2d3)[_0x465c('0x1d')](_0x592e7b);}};}function respondWithFilteredResult(_0x369ba2,_0x4cb129){return function(_0x13cbfe){if(_0x13cbfe){var _0x45326f=typeof _0x4cb129[_0x465c('0x1e')]===_0x465c('0x1f')&&typeof _0x4cb129[_0x465c('0x20')]==='undefined';var _0x5b14d1=_0x13cbfe[_0x465c('0x21')];var _0xfc1ee6=_0x45326f?0x0:_0x4cb129[_0x465c('0x1e')];var _0x123d41=_0x45326f?_0x13cbfe[_0x465c('0x21')]:_0x4cb129[_0x465c('0x1e')]+_0x4cb129[_0x465c('0x20')];var _0xe410c4;if(_0x123d41>=_0x5b14d1){_0x123d41=_0x5b14d1;_0xe410c4=0xc8;}else{_0xe410c4=0xce;}_0x369ba2[_0x465c('0x1b')](_0xe410c4);return _0x369ba2['set']('Content-Range',_0xfc1ee6+'-'+_0x123d41+'/'+_0x5b14d1)['json'](_0x13cbfe);}return null;};}function patchUpdates(_0x114c39){return function(_0x16a2b1){try{jsonpatch[_0x465c('0x22')](_0x16a2b1,_0x114c39,!![]);}catch(_0x134a3c){return BPromise[_0x465c('0x23')](_0x134a3c);}return _0x16a2b1[_0x465c('0x24')]();};}function saveUpdates(_0x1f0318,_0x4817c2){return function(_0x376389){if(_0x376389){return _0x376389[_0x465c('0x25')](_0x1f0318)[_0x465c('0x26')](function(_0x3c79da){return _0x3c79da;});}return null;};}function removeEntity(_0x271b22,_0x16428f){return function(_0x1ca2d8){if(_0x1ca2d8){return _0x1ca2d8[_0x465c('0x27')]()[_0x465c('0x26')](function(){_0x271b22[_0x465c('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2e48d6,_0x1fa5a4){return function(_0x2b8cc6){if(!_0x2b8cc6){_0x2e48d6[_0x465c('0x1a')](0x194);}return _0x2b8cc6;};}function handleError(_0x27536e,_0x1af6ed){_0x1af6ed=_0x1af6ed||0x1f4;return function(_0xd7c4f2){logger[_0x465c('0x28')](_0xd7c4f2['stack']);if(_0xd7c4f2['name']){delete _0xd7c4f2[_0x465c('0x29')];}_0x27536e[_0x465c('0x1b')](_0x1af6ed)[_0x465c('0x2a')](_0xd7c4f2);};}exports[_0x465c('0x2b')]=function(_0x3c04a8,_0x45a1f1){var _0x40f23b={},_0x38defe={},_0x2c035e={'count':0x0,'rows':[]};var _0xb47059=_[_0x465c('0x2c')](db[_0x465c('0x2d')][_0x465c('0x2e')],function(_0x97e679){return{'name':_0x97e679[_0x465c('0x2f')],'type':_0x97e679[_0x465c('0x30')]['key']};});_0x38defe['model']=_[_0x465c('0x2c')](_0xb47059,_0x465c('0x29'));_0x38defe['query']=_['keys'](_0x3c04a8[_0x465c('0x31')]);_0x38defe[_0x465c('0x32')]=_[_0x465c('0x33')](_0x38defe[_0x465c('0x34')],_0x38defe[_0x465c('0x31')]);_0x40f23b['attributes']=_['intersection'](_0x38defe['model'],qs[_0x465c('0x35')](_0x3c04a8[_0x465c('0x31')][_0x465c('0x35')]));_0x40f23b['attributes']=_0x40f23b['attributes']['length']?_0x40f23b[_0x465c('0x36')]:_0x38defe[_0x465c('0x34')];if(!_0x3c04a8['query'][_0x465c('0x37')]('nolimit')){_0x40f23b[_0x465c('0x20')]=qs[_0x465c('0x20')](_0x3c04a8['query'][_0x465c('0x20')]);_0x40f23b[_0x465c('0x1e')]=qs['offset'](_0x3c04a8[_0x465c('0x31')][_0x465c('0x1e')]);}_0x40f23b[_0x465c('0x38')]=qs[_0x465c('0x39')](_0x3c04a8[_0x465c('0x31')][_0x465c('0x39')]);_0x40f23b[_0x465c('0x3a')]=qs[_0x465c('0x32')](_[_0x465c('0x3b')](_0x3c04a8[_0x465c('0x31')],_0x38defe[_0x465c('0x32')]),_0xb47059);if(_0x3c04a8[_0x465c('0x31')][_0x465c('0x3c')]){_0x40f23b[_0x465c('0x3a')]=_[_0x465c('0x3d')](_0x40f23b[_0x465c('0x3a')],{'$or':_[_0x465c('0x2c')](_0xb47059,function(_0x2f83a5){if(_0x2f83a5[_0x465c('0x30')]!==_0x465c('0x3e')){var _0x1e7ab6={};_0x1e7ab6[_0x2f83a5['name']]={'$like':'%'+_0x3c04a8[_0x465c('0x31')]['filter']+'%'};return _0x1e7ab6;}})});}_0x40f23b=_[_0x465c('0x3d')]({},_0x40f23b,_0x3c04a8[_0x465c('0x3f')]);var _0x412d7a={'where':_0x40f23b['where']};return db[_0x465c('0x2d')][_0x465c('0x21')](_0x412d7a)[_0x465c('0x26')](function(_0x2f0c02){_0x2c035e[_0x465c('0x21')]=_0x2f0c02;if(_0x3c04a8[_0x465c('0x31')]['includeAll']){_0x40f23b[_0x465c('0x40')]=[{'all':!![]}];}return db[_0x465c('0x2d')][_0x465c('0x41')](_0x40f23b);})['then'](function(_0x1a76aa){_0x2c035e[_0x465c('0x42')]=_0x1a76aa;return _0x2c035e;})[_0x465c('0x26')](respondWithFilteredResult(_0x45a1f1,_0x40f23b))[_0x465c('0x43')](handleError(_0x45a1f1,null));};exports[_0x465c('0x44')]=function(_0x52e34d,_0xdc78dc){var _0x5d5d6f={'raw':![],'where':{'id':_0x52e34d[_0x465c('0x45')]['id']}},_0x31a59a={};_0x31a59a[_0x465c('0x34')]=_[_0x465c('0x46')](db[_0x465c('0x2d')][_0x465c('0x2e')]);_0x31a59a[_0x465c('0x31')]=_[_0x465c('0x46')](_0x52e34d[_0x465c('0x31')]);_0x31a59a[_0x465c('0x32')]=_[_0x465c('0x33')](_0x31a59a['model'],_0x31a59a[_0x465c('0x31')]);_0x5d5d6f[_0x465c('0x36')]=_[_0x465c('0x33')](_0x31a59a[_0x465c('0x34')],qs[_0x465c('0x35')](_0x52e34d[_0x465c('0x31')][_0x465c('0x35')]));_0x5d5d6f['attributes']=_0x5d5d6f[_0x465c('0x36')][_0x465c('0x47')]?_0x5d5d6f[_0x465c('0x36')]:_0x31a59a[_0x465c('0x34')];if(_0x52e34d[_0x465c('0x31')][_0x465c('0x48')]){_0x5d5d6f[_0x465c('0x40')]=[{'all':!![]}];}_0x5d5d6f=_['merge']({},_0x5d5d6f,_0x52e34d[_0x465c('0x3f')]);return db[_0x465c('0x2d')][_0x465c('0x49')](_0x5d5d6f)[_0x465c('0x26')](handleEntityNotFound(_0xdc78dc,null))['then'](respondWithResult(_0xdc78dc,null))[_0x465c('0x43')](handleError(_0xdc78dc,null));};exports[_0x465c('0x4a')]=function(_0x54b206,_0x3ab448){return db[_0x465c('0x2d')][_0x465c('0x4a')](_0x54b206[_0x465c('0x4b')],{})[_0x465c('0x26')](respondWithResult(_0x3ab448,0xc9))[_0x465c('0x43')](handleError(_0x3ab448,null));};exports[_0x465c('0x25')]=function(_0x412bb5,_0x4b2d44){if(_0x412bb5[_0x465c('0x4b')]['id']){delete _0x412bb5[_0x465c('0x4b')]['id'];}return db[_0x465c('0x2d')][_0x465c('0x49')]({'where':{'id':_0x412bb5[_0x465c('0x45')]['id']}})[_0x465c('0x26')](handleEntityNotFound(_0x4b2d44,null))[_0x465c('0x26')](saveUpdates(_0x412bb5[_0x465c('0x4b')],null))[_0x465c('0x26')](respondWithResult(_0x4b2d44,null))[_0x465c('0x43')](handleError(_0x4b2d44,null));};exports[_0x465c('0x27')]=function(_0x341d53,_0x4162dc){return db['ZohoConfiguration'][_0x465c('0x49')]({'where':{'id':_0x341d53['params']['id']}})[_0x465c('0x26')](handleEntityNotFound(_0x4162dc,null))[_0x465c('0x26')](removeEntity(_0x4162dc,null))[_0x465c('0x43')](handleError(_0x4162dc,null));};exports['getFields']=function(_0x495bf2,_0x1759a0,_0x2cd6a0){var _0x4585fd={};var _0x287976={};var _0x52f3dd;var _0x2725d9;return db[_0x465c('0x2d')]['findOne']({'where':{'id':_0x495bf2[_0x465c('0x45')]['id']}})['then'](handleEntityNotFound(_0x1759a0,null))[_0x465c('0x26')](function(_0x1c913c){if(_0x1c913c){_0x52f3dd=_0x1c913c;_0x287976[_0x465c('0x34')]=_[_0x465c('0x46')](db[_0x465c('0x4c')][_0x465c('0x2e')]);_0x287976['query']=_[_0x465c('0x46')](_0x495bf2[_0x465c('0x31')]);_0x287976[_0x465c('0x32')]=_[_0x465c('0x33')](_0x287976[_0x465c('0x34')],_0x287976[_0x465c('0x31')]);_0x4585fd[_0x465c('0x36')]=_[_0x465c('0x33')](_0x287976['model'],qs['fields'](_0x495bf2[_0x465c('0x31')]['fields']));_0x4585fd[_0x465c('0x36')]=_0x4585fd[_0x465c('0x36')]['length']?_0x4585fd[_0x465c('0x36')]:_0x287976[_0x465c('0x34')];_0x4585fd[_0x465c('0x38')]=qs[_0x465c('0x39')](_0x495bf2[_0x465c('0x31')][_0x465c('0x39')]);_0x4585fd['where']=qs['filters'](_['pick'](_0x495bf2['query'],_0x287976[_0x465c('0x32')]));if(_0x495bf2['query'][_0x465c('0x3c')]){_0x4585fd[_0x465c('0x3a')]=_['merge'](_0x4585fd['where'],{'$or':_[_0x465c('0x2c')](_0x4585fd[_0x465c('0x36')],function(_0x382275){var _0x451ffe={};_0x451ffe[_0x382275]={'$like':'%'+_0x495bf2[_0x465c('0x31')][_0x465c('0x3c')]+'%'};return _0x451ffe;})});}_0x4585fd=_[_0x465c('0x3d')]({},_0x4585fd,_0x495bf2[_0x465c('0x3f')]);return _0x52f3dd[_0x465c('0x4d')](_0x4585fd);}})[_0x465c('0x26')](function(_0x446416){if(_0x446416){_0x2725d9=_0x446416[_0x465c('0x47')];if(!_0x495bf2['query'][_0x465c('0x37')](_0x465c('0x4e'))){_0x4585fd[_0x465c('0x20')]=qs[_0x465c('0x20')](_0x495bf2[_0x465c('0x31')][_0x465c('0x20')]);_0x4585fd[_0x465c('0x1e')]=qs['offset'](_0x495bf2[_0x465c('0x31')][_0x465c('0x1e')]);}return _0x52f3dd[_0x465c('0x4d')](_0x4585fd);}})[_0x465c('0x26')](function(_0x26267b){if(_0x26267b){return _0x26267b?{'count':_0x2725d9,'rows':_0x26267b}:null;}})['then'](respondWithResult(_0x1759a0,null))[_0x465c('0x43')](handleError(_0x1759a0,null));};exports[_0x465c('0x4f')]=function(_0x1c5d1b,_0x130344,_0x2d59a6){var _0x36fe8b={};var _0x44e966={};var _0x1fb1e5;var _0x373e58;return db[_0x465c('0x2d')][_0x465c('0x50')]({'where':{'id':_0x1c5d1b[_0x465c('0x45')]['id']}})[_0x465c('0x26')](handleEntityNotFound(_0x130344,null))['then'](function(_0x50a7ba){if(_0x50a7ba){_0x1fb1e5=_0x50a7ba;_0x44e966[_0x465c('0x34')]=_[_0x465c('0x46')](db[_0x465c('0x4c')][_0x465c('0x2e')]);_0x44e966['query']=_['keys'](_0x1c5d1b[_0x465c('0x31')]);_0x44e966['filters']=_[_0x465c('0x33')](_0x44e966[_0x465c('0x34')],_0x44e966[_0x465c('0x31')]);_0x36fe8b['attributes']=_[_0x465c('0x33')](_0x44e966[_0x465c('0x34')],qs[_0x465c('0x35')](_0x1c5d1b[_0x465c('0x31')]['fields']));_0x36fe8b['attributes']=_0x36fe8b[_0x465c('0x36')][_0x465c('0x47')]?_0x36fe8b[_0x465c('0x36')]:_0x44e966[_0x465c('0x34')];_0x36fe8b['order']=qs['sort'](_0x1c5d1b[_0x465c('0x31')]['sort']);_0x36fe8b[_0x465c('0x3a')]=qs[_0x465c('0x32')](_['pick'](_0x1c5d1b['query'],_0x44e966[_0x465c('0x32')]));if(_0x1c5d1b[_0x465c('0x31')][_0x465c('0x3c')]){_0x36fe8b[_0x465c('0x3a')]=_[_0x465c('0x3d')](_0x36fe8b[_0x465c('0x3a')],{'$or':_[_0x465c('0x2c')](_0x36fe8b['attributes'],function(_0x334de6){var _0x323981={};_0x323981[_0x334de6]={'$like':'%'+_0x1c5d1b['query'][_0x465c('0x3c')]+'%'};return _0x323981;})});}_0x36fe8b=_[_0x465c('0x3d')]({},_0x36fe8b,_0x1c5d1b[_0x465c('0x3f')]);return _0x1fb1e5[_0x465c('0x4f')](_0x36fe8b);}})[_0x465c('0x26')](function(_0x5a59a8){if(_0x5a59a8){_0x373e58=_0x5a59a8[_0x465c('0x47')];if(!_0x1c5d1b['query']['hasOwnProperty']('nolimit')){_0x36fe8b['limit']=qs[_0x465c('0x20')](_0x1c5d1b[_0x465c('0x31')][_0x465c('0x20')]);_0x36fe8b[_0x465c('0x1e')]=qs[_0x465c('0x1e')](_0x1c5d1b[_0x465c('0x31')][_0x465c('0x1e')]);}return _0x1fb1e5[_0x465c('0x4f')](_0x36fe8b);}})[_0x465c('0x26')](function(_0x2763b1){if(_0x2763b1){return _0x2763b1?{'count':_0x373e58,'rows':_0x2763b1}:null;}})['then'](respondWithResult(_0x130344,null))[_0x465c('0x43')](handleError(_0x130344,null));};exports[_0x465c('0x51')]=function(_0x596272,_0xc94a19,_0x3495fc){var _0x18a1ba={};var _0x424f3c={};var _0xc4587e;var _0x3c2617;return db['ZohoConfiguration'][_0x465c('0x50')]({'where':{'id':_0x596272[_0x465c('0x45')]['id']}})[_0x465c('0x26')](handleEntityNotFound(_0xc94a19,null))[_0x465c('0x26')](function(_0x1c5e7c){if(_0x1c5e7c){_0xc4587e=_0x1c5e7c;_0x424f3c[_0x465c('0x34')]=_[_0x465c('0x46')](db['ZohoField'][_0x465c('0x2e')]);_0x424f3c[_0x465c('0x31')]=_[_0x465c('0x46')](_0x596272[_0x465c('0x31')]);_0x424f3c[_0x465c('0x32')]=_[_0x465c('0x33')](_0x424f3c['model'],_0x424f3c['query']);_0x18a1ba[_0x465c('0x36')]=_[_0x465c('0x33')](_0x424f3c['model'],qs[_0x465c('0x35')](_0x596272[_0x465c('0x31')][_0x465c('0x35')]));_0x18a1ba['attributes']=_0x18a1ba[_0x465c('0x36')]['length']?_0x18a1ba[_0x465c('0x36')]:_0x424f3c[_0x465c('0x34')];_0x18a1ba[_0x465c('0x38')]=qs[_0x465c('0x39')](_0x596272[_0x465c('0x31')][_0x465c('0x39')]);_0x18a1ba['where']=qs[_0x465c('0x32')](_[_0x465c('0x3b')](_0x596272['query'],_0x424f3c[_0x465c('0x32')]));if(_0x596272[_0x465c('0x31')][_0x465c('0x3c')]){_0x18a1ba['where']=_[_0x465c('0x3d')](_0x18a1ba[_0x465c('0x3a')],{'$or':_[_0x465c('0x2c')](_0x18a1ba['attributes'],function(_0x42c5ac){var _0x45a92e={};_0x45a92e[_0x42c5ac]={'$like':'%'+_0x596272[_0x465c('0x31')][_0x465c('0x3c')]+'%'};return _0x45a92e;})});}_0x18a1ba=_[_0x465c('0x3d')]({},_0x18a1ba,_0x596272[_0x465c('0x3f')]);return _0xc4587e[_0x465c('0x51')](_0x18a1ba);}})['then'](function(_0x5afc51){if(_0x5afc51){_0x3c2617=_0x5afc51[_0x465c('0x47')];if(!_0x596272[_0x465c('0x31')]['hasOwnProperty'](_0x465c('0x4e'))){_0x18a1ba[_0x465c('0x20')]=qs['limit'](_0x596272[_0x465c('0x31')]['limit']);_0x18a1ba[_0x465c('0x1e')]=qs[_0x465c('0x1e')](_0x596272['query'][_0x465c('0x1e')]);}return _0xc4587e['getDescriptions'](_0x18a1ba);}})['then'](function(_0x43248e){if(_0x43248e){return _0x43248e?{'count':_0x3c2617,'rows':_0x43248e}:null;}})[_0x465c('0x26')](respondWithResult(_0xc94a19,null))[_0x465c('0x43')](handleError(_0xc94a19,null));};
\ No newline at end of file
+var _0x1a0c=['update','params','findOne','ZohoField','order','getFields','getSubjects','getDescriptions','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','Content-Range','apply','save','destroy','then','sendStatus','error','name','send','index','map','ZohoConfiguration','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','include','find','create','body'];(function(_0x3ed556,_0x1b89ce){var _0x5d2a21=function(_0x3eb557){while(--_0x3eb557){_0x3ed556['push'](_0x3ed556['shift']());}};_0x5d2a21(++_0x1b89ce);}(_0x1a0c,0xf9));var _0xc1a0=function(_0x58885f,_0x98e475){_0x58885f=_0x58885f-0x0;var _0x15b184=_0x1a0c[_0x58885f];return _0x15b184;};'use strict';var emlformat=require(_0xc1a0('0x0'));var rimraf=require(_0xc1a0('0x1'));var zipdir=require(_0xc1a0('0x2'));var jsonpatch=require(_0xc1a0('0x3'));var rp=require(_0xc1a0('0x4'));var moment=require('moment');var BPromise=require(_0xc1a0('0x5'));var Mustache=require(_0xc1a0('0x6'));var util=require(_0xc1a0('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xc1a0('0x8'));var ejs=require(_0xc1a0('0x9'));var fs=require('fs');var fs_extra=require(_0xc1a0('0xa'));var _=require(_0xc1a0('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xc1a0('0xc'));var toCsv=require(_0xc1a0('0x8'));var querystring=require(_0xc1a0('0xd'));var Papa=require(_0xc1a0('0xe'));var Redis=require(_0xc1a0('0xf'));var authService=require(_0xc1a0('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xc1a0('0x11'));var hardwareService=require(_0xc1a0('0x12'));var logger=require('../../config/logger')(_0xc1a0('0x13'));var utils=require('../../config/utils');var config=require(_0xc1a0('0x14'));var licenseUtil=require(_0xc1a0('0x15'));var db=require(_0xc1a0('0x16'))['db'];function respondWithStatusCode(_0x1f2143,_0x4e3d47){_0x4e3d47=_0x4e3d47||0xcc;return function(_0x15aa4f){if(_0x15aa4f){return _0x1f2143['sendStatus'](_0x4e3d47);}return _0x1f2143[_0xc1a0('0x17')](_0x4e3d47)[_0xc1a0('0x18')]();};}function respondWithResult(_0x4d9c76,_0x3a44f7){_0x3a44f7=_0x3a44f7||0xc8;return function(_0x5c218f){if(_0x5c218f){return _0x4d9c76[_0xc1a0('0x17')](_0x3a44f7)[_0xc1a0('0x19')](_0x5c218f);}};}function respondWithFilteredResult(_0xe568c7,_0x283be3){return function(_0x91716a){if(_0x91716a){var _0x27421c=typeof _0x283be3[_0xc1a0('0x1a')]==='undefined'&&typeof _0x283be3[_0xc1a0('0x1b')]===_0xc1a0('0x1c');var _0x76974d=_0x91716a[_0xc1a0('0x1d')];var _0x48d0e3=_0x27421c?0x0:_0x283be3[_0xc1a0('0x1a')];var _0x1ce4d1=_0x27421c?_0x91716a[_0xc1a0('0x1d')]:_0x283be3['offset']+_0x283be3[_0xc1a0('0x1b')];var _0x332abf;if(_0x1ce4d1>=_0x76974d){_0x1ce4d1=_0x76974d;_0x332abf=0xc8;}else{_0x332abf=0xce;}_0xe568c7[_0xc1a0('0x17')](_0x332abf);return _0xe568c7['set'](_0xc1a0('0x1e'),_0x48d0e3+'-'+_0x1ce4d1+'/'+_0x76974d)['json'](_0x91716a);}return null;};}function patchUpdates(_0x5997fa){return function(_0x5df6cc){try{jsonpatch[_0xc1a0('0x1f')](_0x5df6cc,_0x5997fa,!![]);}catch(_0xef2b76){return BPromise['reject'](_0xef2b76);}return _0x5df6cc[_0xc1a0('0x20')]();};}function saveUpdates(_0x18775e,_0x6cb4de){return function(_0x42adf1){if(_0x42adf1){return _0x42adf1['update'](_0x18775e)['then'](function(_0x5d2aba){return _0x5d2aba;});}return null;};}function removeEntity(_0x540563,_0x37cad4){return function(_0x4b2a7a){if(_0x4b2a7a){return _0x4b2a7a[_0xc1a0('0x21')]()[_0xc1a0('0x22')](function(){_0x540563[_0xc1a0('0x17')](0xcc)[_0xc1a0('0x18')]();});}};}function handleEntityNotFound(_0xd07e5a,_0x1f30cf){return function(_0x9066db){if(!_0x9066db){_0xd07e5a[_0xc1a0('0x23')](0x194);}return _0x9066db;};}function handleError(_0x5ca3b9,_0x1983ab){_0x1983ab=_0x1983ab||0x1f4;return function(_0x5c7b47){logger[_0xc1a0('0x24')](_0x5c7b47['stack']);if(_0x5c7b47[_0xc1a0('0x25')]){delete _0x5c7b47[_0xc1a0('0x25')];}_0x5ca3b9[_0xc1a0('0x17')](_0x1983ab)[_0xc1a0('0x26')](_0x5c7b47);};}exports[_0xc1a0('0x27')]=function(_0xda35c8,_0x2fc028){var _0x287587={},_0x282415={},_0x1828f2={'count':0x0,'rows':[]};var _0x28d248=_[_0xc1a0('0x28')](db[_0xc1a0('0x29')][_0xc1a0('0x2a')],function(_0x3e1ec5){return{'name':_0x3e1ec5[_0xc1a0('0x2b')],'type':_0x3e1ec5[_0xc1a0('0x2c')][_0xc1a0('0x2d')]};});_0x282415[_0xc1a0('0x2e')]=_[_0xc1a0('0x28')](_0x28d248,_0xc1a0('0x25'));_0x282415['query']=_[_0xc1a0('0x2f')](_0xda35c8['query']);_0x282415[_0xc1a0('0x30')]=_[_0xc1a0('0x31')](_0x282415[_0xc1a0('0x2e')],_0x282415[_0xc1a0('0x32')]);_0x287587['attributes']=_[_0xc1a0('0x31')](_0x282415[_0xc1a0('0x2e')],qs['fields'](_0xda35c8['query'][_0xc1a0('0x33')]));_0x287587[_0xc1a0('0x34')]=_0x287587[_0xc1a0('0x34')][_0xc1a0('0x35')]?_0x287587['attributes']:_0x282415['model'];if(!_0xda35c8[_0xc1a0('0x32')][_0xc1a0('0x36')]('nolimit')){_0x287587[_0xc1a0('0x1b')]=qs[_0xc1a0('0x1b')](_0xda35c8['query'][_0xc1a0('0x1b')]);_0x287587[_0xc1a0('0x1a')]=qs[_0xc1a0('0x1a')](_0xda35c8['query'][_0xc1a0('0x1a')]);}_0x287587['order']=qs[_0xc1a0('0x37')](_0xda35c8['query'][_0xc1a0('0x37')]);_0x287587['where']=qs[_0xc1a0('0x30')](_[_0xc1a0('0x38')](_0xda35c8[_0xc1a0('0x32')],_0x282415[_0xc1a0('0x30')]),_0x28d248);if(_0xda35c8['query'][_0xc1a0('0x39')]){_0x287587[_0xc1a0('0x3a')]=_[_0xc1a0('0x3b')](_0x287587[_0xc1a0('0x3a')],{'$or':_[_0xc1a0('0x28')](_0x28d248,function(_0x25113f){if(_0x25113f[_0xc1a0('0x2c')]!==_0xc1a0('0x3c')){var _0x1451d8={};_0x1451d8[_0x25113f[_0xc1a0('0x25')]]={'$like':'%'+_0xda35c8[_0xc1a0('0x32')]['filter']+'%'};return _0x1451d8;}})});}_0x287587=_[_0xc1a0('0x3b')]({},_0x287587,_0xda35c8[_0xc1a0('0x3d')]);var _0x1b987e={'where':_0x287587['where']};return db[_0xc1a0('0x29')][_0xc1a0('0x1d')](_0x1b987e)['then'](function(_0x3c8b87){_0x1828f2['count']=_0x3c8b87;if(_0xda35c8[_0xc1a0('0x32')][_0xc1a0('0x3e')]){_0x287587['include']=[{'all':!![]}];}return db[_0xc1a0('0x29')][_0xc1a0('0x3f')](_0x287587);})[_0xc1a0('0x22')](function(_0x571c65){_0x1828f2[_0xc1a0('0x40')]=_0x571c65;return _0x1828f2;})[_0xc1a0('0x22')](respondWithFilteredResult(_0x2fc028,_0x287587))[_0xc1a0('0x41')](handleError(_0x2fc028,null));};exports[_0xc1a0('0x42')]=function(_0x531a28,_0x1b912c){var _0xaeb016={'raw':![],'where':{'id':_0x531a28['params']['id']}},_0x10bc61={};_0x10bc61[_0xc1a0('0x2e')]=_[_0xc1a0('0x2f')](db[_0xc1a0('0x29')][_0xc1a0('0x2a')]);_0x10bc61[_0xc1a0('0x32')]=_[_0xc1a0('0x2f')](_0x531a28['query']);_0x10bc61['filters']=_[_0xc1a0('0x31')](_0x10bc61[_0xc1a0('0x2e')],_0x10bc61['query']);_0xaeb016['attributes']=_[_0xc1a0('0x31')](_0x10bc61[_0xc1a0('0x2e')],qs[_0xc1a0('0x33')](_0x531a28[_0xc1a0('0x32')][_0xc1a0('0x33')]));_0xaeb016[_0xc1a0('0x34')]=_0xaeb016['attributes']['length']?_0xaeb016[_0xc1a0('0x34')]:_0x10bc61['model'];if(_0x531a28[_0xc1a0('0x32')][_0xc1a0('0x3e')]){_0xaeb016[_0xc1a0('0x43')]=[{'all':!![]}];}_0xaeb016=_[_0xc1a0('0x3b')]({},_0xaeb016,_0x531a28[_0xc1a0('0x3d')]);return db[_0xc1a0('0x29')][_0xc1a0('0x44')](_0xaeb016)[_0xc1a0('0x22')](handleEntityNotFound(_0x1b912c,null))['then'](respondWithResult(_0x1b912c,null))[_0xc1a0('0x41')](handleError(_0x1b912c,null));};exports[_0xc1a0('0x45')]=function(_0x5baa72,_0x138c2e){return db[_0xc1a0('0x29')][_0xc1a0('0x45')](_0x5baa72[_0xc1a0('0x46')],{})[_0xc1a0('0x22')](respondWithResult(_0x138c2e,0xc9))['catch'](handleError(_0x138c2e,null));};exports[_0xc1a0('0x47')]=function(_0x42c159,_0x1ec56a){if(_0x42c159['body']['id']){delete _0x42c159['body']['id'];}return db[_0xc1a0('0x29')][_0xc1a0('0x44')]({'where':{'id':_0x42c159[_0xc1a0('0x48')]['id']}})[_0xc1a0('0x22')](handleEntityNotFound(_0x1ec56a,null))[_0xc1a0('0x22')](saveUpdates(_0x42c159['body'],null))[_0xc1a0('0x22')](respondWithResult(_0x1ec56a,null))[_0xc1a0('0x41')](handleError(_0x1ec56a,null));};exports[_0xc1a0('0x21')]=function(_0x34e56e,_0x1b4e61){return db[_0xc1a0('0x29')][_0xc1a0('0x44')]({'where':{'id':_0x34e56e['params']['id']}})[_0xc1a0('0x22')](handleEntityNotFound(_0x1b4e61,null))[_0xc1a0('0x22')](removeEntity(_0x1b4e61,null))[_0xc1a0('0x41')](handleError(_0x1b4e61,null));};exports['getFields']=function(_0x25e764,_0x57d843,_0x4d459b){var _0x13c8ed={};var _0x350edb={};var _0x2b58f5;var _0x4d1728;return db[_0xc1a0('0x29')][_0xc1a0('0x49')]({'where':{'id':_0x25e764['params']['id']}})[_0xc1a0('0x22')](handleEntityNotFound(_0x57d843,null))[_0xc1a0('0x22')](function(_0x37eecc){if(_0x37eecc){_0x2b58f5=_0x37eecc;_0x350edb[_0xc1a0('0x2e')]=_[_0xc1a0('0x2f')](db[_0xc1a0('0x4a')][_0xc1a0('0x2a')]);_0x350edb['query']=_[_0xc1a0('0x2f')](_0x25e764['query']);_0x350edb[_0xc1a0('0x30')]=_[_0xc1a0('0x31')](_0x350edb[_0xc1a0('0x2e')],_0x350edb['query']);_0x13c8ed[_0xc1a0('0x34')]=_[_0xc1a0('0x31')](_0x350edb[_0xc1a0('0x2e')],qs[_0xc1a0('0x33')](_0x25e764[_0xc1a0('0x32')]['fields']));_0x13c8ed[_0xc1a0('0x34')]=_0x13c8ed['attributes']['length']?_0x13c8ed['attributes']:_0x350edb[_0xc1a0('0x2e')];_0x13c8ed[_0xc1a0('0x4b')]=qs[_0xc1a0('0x37')](_0x25e764[_0xc1a0('0x32')][_0xc1a0('0x37')]);_0x13c8ed[_0xc1a0('0x3a')]=qs[_0xc1a0('0x30')](_[_0xc1a0('0x38')](_0x25e764['query'],_0x350edb[_0xc1a0('0x30')]));if(_0x25e764[_0xc1a0('0x32')][_0xc1a0('0x39')]){_0x13c8ed[_0xc1a0('0x3a')]=_[_0xc1a0('0x3b')](_0x13c8ed[_0xc1a0('0x3a')],{'$or':_[_0xc1a0('0x28')](_0x13c8ed[_0xc1a0('0x34')],function(_0xd3cfda){var _0x4d2b87={};_0x4d2b87[_0xd3cfda]={'$like':'%'+_0x25e764[_0xc1a0('0x32')]['filter']+'%'};return _0x4d2b87;})});}_0x13c8ed=_[_0xc1a0('0x3b')]({},_0x13c8ed,_0x25e764[_0xc1a0('0x3d')]);return _0x2b58f5[_0xc1a0('0x4c')](_0x13c8ed);}})['then'](function(_0x2ce3ef){if(_0x2ce3ef){_0x4d1728=_0x2ce3ef[_0xc1a0('0x35')];if(!_0x25e764[_0xc1a0('0x32')][_0xc1a0('0x36')]('nolimit')){_0x13c8ed[_0xc1a0('0x1b')]=qs[_0xc1a0('0x1b')](_0x25e764[_0xc1a0('0x32')][_0xc1a0('0x1b')]);_0x13c8ed[_0xc1a0('0x1a')]=qs['offset'](_0x25e764[_0xc1a0('0x32')]['offset']);}return _0x2b58f5[_0xc1a0('0x4c')](_0x13c8ed);}})[_0xc1a0('0x22')](function(_0x504a9f){if(_0x504a9f){return _0x504a9f?{'count':_0x4d1728,'rows':_0x504a9f}:null;}})[_0xc1a0('0x22')](respondWithResult(_0x57d843,null))[_0xc1a0('0x41')](handleError(_0x57d843,null));};exports[_0xc1a0('0x4d')]=function(_0xe5c3c1,_0x43a963,_0x41354f){var _0x19627f={};var _0x2e74f6={};var _0x7aa10b;var _0x58d47e;return db[_0xc1a0('0x29')][_0xc1a0('0x49')]({'where':{'id':_0xe5c3c1[_0xc1a0('0x48')]['id']}})['then'](handleEntityNotFound(_0x43a963,null))[_0xc1a0('0x22')](function(_0x4c880b){if(_0x4c880b){_0x7aa10b=_0x4c880b;_0x2e74f6['model']=_[_0xc1a0('0x2f')](db[_0xc1a0('0x4a')]['rawAttributes']);_0x2e74f6[_0xc1a0('0x32')]=_[_0xc1a0('0x2f')](_0xe5c3c1[_0xc1a0('0x32')]);_0x2e74f6[_0xc1a0('0x30')]=_[_0xc1a0('0x31')](_0x2e74f6[_0xc1a0('0x2e')],_0x2e74f6[_0xc1a0('0x32')]);_0x19627f[_0xc1a0('0x34')]=_[_0xc1a0('0x31')](_0x2e74f6[_0xc1a0('0x2e')],qs['fields'](_0xe5c3c1[_0xc1a0('0x32')][_0xc1a0('0x33')]));_0x19627f[_0xc1a0('0x34')]=_0x19627f[_0xc1a0('0x34')][_0xc1a0('0x35')]?_0x19627f[_0xc1a0('0x34')]:_0x2e74f6[_0xc1a0('0x2e')];_0x19627f['order']=qs[_0xc1a0('0x37')](_0xe5c3c1[_0xc1a0('0x32')][_0xc1a0('0x37')]);_0x19627f[_0xc1a0('0x3a')]=qs[_0xc1a0('0x30')](_[_0xc1a0('0x38')](_0xe5c3c1['query'],_0x2e74f6['filters']));if(_0xe5c3c1[_0xc1a0('0x32')][_0xc1a0('0x39')]){_0x19627f[_0xc1a0('0x3a')]=_[_0xc1a0('0x3b')](_0x19627f[_0xc1a0('0x3a')],{'$or':_[_0xc1a0('0x28')](_0x19627f[_0xc1a0('0x34')],function(_0x5a91b2){var _0x31b969={};_0x31b969[_0x5a91b2]={'$like':'%'+_0xe5c3c1[_0xc1a0('0x32')][_0xc1a0('0x39')]+'%'};return _0x31b969;})});}_0x19627f=_[_0xc1a0('0x3b')]({},_0x19627f,_0xe5c3c1[_0xc1a0('0x3d')]);return _0x7aa10b['getSubjects'](_0x19627f);}})[_0xc1a0('0x22')](function(_0x29f0ab){if(_0x29f0ab){_0x58d47e=_0x29f0ab[_0xc1a0('0x35')];if(!_0xe5c3c1[_0xc1a0('0x32')][_0xc1a0('0x36')]('nolimit')){_0x19627f[_0xc1a0('0x1b')]=qs[_0xc1a0('0x1b')](_0xe5c3c1[_0xc1a0('0x32')]['limit']);_0x19627f[_0xc1a0('0x1a')]=qs[_0xc1a0('0x1a')](_0xe5c3c1[_0xc1a0('0x32')][_0xc1a0('0x1a')]);}return _0x7aa10b[_0xc1a0('0x4d')](_0x19627f);}})[_0xc1a0('0x22')](function(_0xc894fe){if(_0xc894fe){return _0xc894fe?{'count':_0x58d47e,'rows':_0xc894fe}:null;}})[_0xc1a0('0x22')](respondWithResult(_0x43a963,null))[_0xc1a0('0x41')](handleError(_0x43a963,null));};exports[_0xc1a0('0x4e')]=function(_0x4089a3,_0x3271e7,_0x456967){var _0x475b92={};var _0x403c37={};var _0x2c650b;var _0x544daf;return db[_0xc1a0('0x29')][_0xc1a0('0x49')]({'where':{'id':_0x4089a3['params']['id']}})[_0xc1a0('0x22')](handleEntityNotFound(_0x3271e7,null))[_0xc1a0('0x22')](function(_0x15e8df){if(_0x15e8df){_0x2c650b=_0x15e8df;_0x403c37[_0xc1a0('0x2e')]=_[_0xc1a0('0x2f')](db[_0xc1a0('0x4a')]['rawAttributes']);_0x403c37['query']=_[_0xc1a0('0x2f')](_0x4089a3[_0xc1a0('0x32')]);_0x403c37['filters']=_[_0xc1a0('0x31')](_0x403c37[_0xc1a0('0x2e')],_0x403c37[_0xc1a0('0x32')]);_0x475b92[_0xc1a0('0x34')]=_[_0xc1a0('0x31')](_0x403c37['model'],qs[_0xc1a0('0x33')](_0x4089a3['query'][_0xc1a0('0x33')]));_0x475b92[_0xc1a0('0x34')]=_0x475b92[_0xc1a0('0x34')][_0xc1a0('0x35')]?_0x475b92[_0xc1a0('0x34')]:_0x403c37[_0xc1a0('0x2e')];_0x475b92[_0xc1a0('0x4b')]=qs['sort'](_0x4089a3['query'][_0xc1a0('0x37')]);_0x475b92[_0xc1a0('0x3a')]=qs[_0xc1a0('0x30')](_[_0xc1a0('0x38')](_0x4089a3[_0xc1a0('0x32')],_0x403c37[_0xc1a0('0x30')]));if(_0x4089a3[_0xc1a0('0x32')][_0xc1a0('0x39')]){_0x475b92[_0xc1a0('0x3a')]=_[_0xc1a0('0x3b')](_0x475b92[_0xc1a0('0x3a')],{'$or':_[_0xc1a0('0x28')](_0x475b92[_0xc1a0('0x34')],function(_0x30a574){var _0xcb8e1b={};_0xcb8e1b[_0x30a574]={'$like':'%'+_0x4089a3[_0xc1a0('0x32')]['filter']+'%'};return _0xcb8e1b;})});}_0x475b92=_[_0xc1a0('0x3b')]({},_0x475b92,_0x4089a3[_0xc1a0('0x3d')]);return _0x2c650b[_0xc1a0('0x4e')](_0x475b92);}})['then'](function(_0x3dc757){if(_0x3dc757){_0x544daf=_0x3dc757[_0xc1a0('0x35')];if(!_0x4089a3[_0xc1a0('0x32')][_0xc1a0('0x36')](_0xc1a0('0x4f'))){_0x475b92[_0xc1a0('0x1b')]=qs['limit'](_0x4089a3['query'][_0xc1a0('0x1b')]);_0x475b92[_0xc1a0('0x1a')]=qs[_0xc1a0('0x1a')](_0x4089a3[_0xc1a0('0x32')]['offset']);}return _0x2c650b[_0xc1a0('0x4e')](_0x475b92);}})['then'](function(_0xe371c2){if(_0xe371c2){return _0xe371c2?{'count':_0x544daf,'rows':_0xe371c2}:null;}})[_0xc1a0('0x22')](respondWithResult(_0x3271e7,null))['catch'](handleError(_0x3271e7,null));};
\ No newline at end of file
index a0ad22d..629761a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa128=['api','moment','bluebird','request-promise','path','rimraf','./intZohoConfiguration.attributes','define','ZohoConfiguration','int_zoho_configurations'];(function(_0x47195e,_0x347734){var _0x571abb=function(_0x3574ad){while(--_0x3574ad){_0x47195e['push'](_0x47195e['shift']());}};_0x571abb(++_0x347734);}(_0xa128,0x96));var _0x8a12=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xa128[_0xa464c9];return _0x3d73c4;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x8a12('0x0'));var moment=require(_0x8a12('0x1'));var BPromise=require(_0x8a12('0x2'));var rp=require(_0x8a12('0x3'));var fs=require('fs');var path=require(_0x8a12('0x4'));var rimraf=require(_0x8a12('0x5'));var config=require('../../config/environment');var attributes=require(_0x8a12('0x6'));module['exports']=function(_0x148567,_0x5dcaf2){return _0x148567[_0x8a12('0x7')](_0x8a12('0x8'),attributes,{'tableName':_0x8a12('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xbf42=['ZohoConfiguration','int_zoho_configurations','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x5738f7,_0x17df47){var _0x2e6d3c=function(_0x5c9b13){while(--_0x5c9b13){_0x5738f7['push'](_0x5738f7['shift']());}};_0x2e6d3c(++_0x17df47);}(_0xbf42,0xd3));var _0x2bf4=function(_0x513aa5,_0x1fba79){_0x513aa5=_0x513aa5-0x0;var _0x1a1a7c=_0xbf42[_0x513aa5];return _0x1a1a7c;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2bf4('0x0'))('api');var moment=require(_0x2bf4('0x1'));var BPromise=require(_0x2bf4('0x2'));var rp=require(_0x2bf4('0x3'));var fs=require('fs');var path=require(_0x2bf4('0x4'));var rimraf=require(_0x2bf4('0x5'));var config=require(_0x2bf4('0x6'));var attributes=require('./intZohoConfiguration.attributes');module[_0x2bf4('0x7')]=function(_0x589a36,_0x2574b5){return _0x589a36[_0x2bf4('0x8')](_0x2bf4('0x9'),attributes,{'tableName':_0x2bf4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 698c883..6e53d54 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe240=['../../config/logger','rpc','jayson/promise','http','request','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x27d811,_0x46515d){var _0x3242fb=function(_0x59fa6e){while(--_0x59fa6e){_0x27d811['push'](_0x27d811['shift']());}};_0x3242fb(++_0x46515d);}(_0xe240,0x161));var _0x0e24=function(_0x82129b,_0x484ae9){_0x82129b=_0x82129b-0x0;var _0x2ae5dc=_0xe240[_0x82129b];return _0x2ae5dc;};'use strict';var _=require(_0x0e24('0x0'));var util=require(_0x0e24('0x1'));var moment=require(_0x0e24('0x2'));var BPromise=require(_0x0e24('0x3'));var rs=require(_0x0e24('0x4'));var fs=require('fs');var Redis=require(_0x0e24('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x0e24('0x6'));var logger=require(_0x0e24('0x7'))(_0x0e24('0x8'));var config=require('../../config/environment');var jayson=require(_0x0e24('0x9'));var client=jayson['client'][_0x0e24('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x58bd77,_0x48623d,_0x51be27){return new BPromise(function(_0xe74765,_0x13e440){return client[_0x0e24('0xb')](_0x58bd77,_0x51be27)[_0x0e24('0xc')](function(_0x2eb5f8){logger[_0x0e24('0xd')](_0x0e24('0xe'),_0x48623d,_0x0e24('0xf'));logger[_0x0e24('0x10')](_0x0e24('0x11'),_0x48623d,_0x0e24('0xf'),JSON[_0x0e24('0x12')](_0x2eb5f8));if(_0x2eb5f8[_0x0e24('0x13')]){if(_0x2eb5f8[_0x0e24('0x13')][_0x0e24('0x14')]===0x1f4){logger[_0x0e24('0x13')](_0x0e24('0xe'),_0x48623d,_0x2eb5f8[_0x0e24('0x13')][_0x0e24('0x15')]);return _0x13e440(_0x2eb5f8[_0x0e24('0x13')][_0x0e24('0x15')]);}logger[_0x0e24('0x13')](_0x0e24('0xe'),_0x48623d,_0x2eb5f8[_0x0e24('0x13')]['message']);return _0xe74765(_0x2eb5f8[_0x0e24('0x13')][_0x0e24('0x15')]);}else{logger[_0x0e24('0xd')](_0x0e24('0xe'),_0x48623d,_0x0e24('0xf'));_0xe74765(_0x2eb5f8[_0x0e24('0x16')][_0x0e24('0x15')]);}})[_0x0e24('0x17')](function(_0x30bd40){logger[_0x0e24('0x13')](_0x0e24('0xe'),_0x48623d,_0x30bd40);_0x13e440(_0x30bd40);});});}
\ No newline at end of file
+var _0x607d=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','util'];(function(_0x553145,_0x4f9ab8){var _0x11cfbd=function(_0x2e7702){while(--_0x2e7702){_0x553145['push'](_0x553145['shift']());}};_0x11cfbd(++_0x4f9ab8);}(_0x607d,0x89));var _0xd607=function(_0x451df2,_0x17991f){_0x451df2=_0x451df2-0x0;var _0x1f7bba=_0x607d[_0x451df2];return _0x1f7bba;};'use strict';var _=require('lodash');var util=require(_0xd607('0x0'));var moment=require(_0xd607('0x1'));var BPromise=require(_0xd607('0x2'));var rs=require(_0xd607('0x3'));var fs=require('fs');var Redis=require(_0xd607('0x4'));var db=require(_0xd607('0x5'))['db'];var utils=require(_0xd607('0x6'));var logger=require('../../config/logger')(_0xd607('0x7'));var config=require(_0xd607('0x8'));var jayson=require(_0xd607('0x9'));var client=jayson[_0xd607('0xa')][_0xd607('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5aed75,_0x3ac8c3,_0x3197ae){return new BPromise(function(_0x308fe0,_0x3bc226){return client[_0xd607('0xc')](_0x5aed75,_0x3197ae)[_0xd607('0xd')](function(_0x331d4a){logger['info'](_0xd607('0xe'),_0x3ac8c3,_0xd607('0xf'));logger['debug']('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x3ac8c3,_0xd607('0xf'),JSON[_0xd607('0x10')](_0x331d4a));if(_0x331d4a[_0xd607('0x11')]){if(_0x331d4a[_0xd607('0x11')][_0xd607('0x12')]===0x1f4){logger['error'](_0xd607('0xe'),_0x3ac8c3,_0x331d4a[_0xd607('0x11')]['message']);return _0x3bc226(_0x331d4a['error'][_0xd607('0x13')]);}logger[_0xd607('0x11')]('ZohoConfiguration,\x20%s,\x20%s',_0x3ac8c3,_0x331d4a[_0xd607('0x11')][_0xd607('0x13')]);return _0x308fe0(_0x331d4a[_0xd607('0x11')][_0xd607('0x13')]);}else{logger[_0xd607('0x14')](_0xd607('0xe'),_0x3ac8c3,_0xd607('0xf'));_0x308fe0(_0x331d4a[_0xd607('0x15')]['message']);}})[_0xd607('0x16')](function(_0xe1f819){logger['error'](_0xd607('0xe'),_0x3ac8c3,_0xe1f819);_0x3bc226(_0xe1f819);});});}
\ No newline at end of file
index 0423131..a11f32c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0af1=['show','post','create','put','/:id','delete','destroy','exports','multer','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoField.controller','get','isAuthenticated','index'];(function(_0x561605,_0x288fc3){var _0x2f9792=function(_0x5a4a8d){while(--_0x5a4a8d){_0x561605['push'](_0x561605['shift']());}};_0x2f9792(++_0x288fc3);}(_0x0af1,0x171));var _0x10af=function(_0x3e6a1e,_0xab9b3a){_0x3e6a1e=_0x3e6a1e-0x0;var _0x461ebf=_0x0af1[_0x3e6a1e];return _0x461ebf;};'use strict';var multer=require(_0x10af('0x0'));var util=require('util');var path=require(_0x10af('0x1'));var timeout=require(_0x10af('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x10af('0x3'));var auth=require(_0x10af('0x4'));var interaction=require(_0x10af('0x5'));var config=require(_0x10af('0x6'));var controller=require(_0x10af('0x7'));router[_0x10af('0x8')]('/',auth[_0x10af('0x9')](),controller[_0x10af('0xa')]);router[_0x10af('0x8')]('/:id',auth[_0x10af('0x9')](),controller[_0x10af('0xb')]);router[_0x10af('0xc')]('/',auth['isAuthenticated'](),controller[_0x10af('0xd')]);router[_0x10af('0xe')](_0x10af('0xf'),auth[_0x10af('0x9')](),controller['update']);router[_0x10af('0x10')](_0x10af('0xf'),auth[_0x10af('0x9')](),controller[_0x10af('0x11')]);module[_0x10af('0x12')]=router;
\ No newline at end of file
+var _0x33c8=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','put','update','delete','destroy','exports','multer','path'];(function(_0x1b7f41,_0x4889f4){var _0x1dc8e1=function(_0x150489){while(--_0x150489){_0x1b7f41['push'](_0x1b7f41['shift']());}};_0x1dc8e1(++_0x4889f4);}(_0x33c8,0xc6));var _0x833c=function(_0x32ff46,_0x3c4dbc){_0x32ff46=_0x32ff46-0x0;var _0x47f1c4=_0x33c8[_0x32ff46];return _0x47f1c4;};'use strict';var multer=require(_0x833c('0x0'));var util=require('util');var path=require(_0x833c('0x1'));var timeout=require(_0x833c('0x2'));var express=require(_0x833c('0x3'));var router=express[_0x833c('0x4')]();var fs_extra=require(_0x833c('0x5'));var auth=require(_0x833c('0x6'));var interaction=require(_0x833c('0x7'));var config=require(_0x833c('0x8'));var controller=require('./intZohoField.controller');router[_0x833c('0x9')]('/',auth[_0x833c('0xa')](),controller[_0x833c('0xb')]);router['get'](_0x833c('0xc'),auth[_0x833c('0xa')](),controller[_0x833c('0xd')]);router[_0x833c('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x833c('0xf')]('/:id',auth[_0x833c('0xa')](),controller[_0x833c('0x10')]);router[_0x833c('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x833c('0x12')]);module[_0x833c('0x13')]=router;
\ No newline at end of file
index c20fa03..46918a7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd7a9=['STRING','BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable','picklist'];(function(_0x39d8a5,_0x1549b2){var _0x329ec0=function(_0x1b3593){while(--_0x1b3593){_0x39d8a5['push'](_0x39d8a5['shift']());}};_0x329ec0(++_0x1549b2);}(_0xd7a9,0x161));var _0x9d7a=function(_0x26313b,_0xba671e){_0x26313b=_0x26313b-0x0;var _0xc88161=_0xd7a9[_0x26313b];return _0xc88161;};'use strict';var Sequelize=require(_0x9d7a('0x0'));module[_0x9d7a('0x1')]={'type':{'type':Sequelize[_0x9d7a('0x2')](_0x9d7a('0x3'),_0x9d7a('0x4'),_0x9d7a('0x5'),'keyValue',_0x9d7a('0x6')),'defaultValue':_0x9d7a('0x3')},'content':{'type':Sequelize[_0x9d7a('0x7')]},'key':{'type':Sequelize[_0x9d7a('0x7')]},'keyType':{'type':Sequelize[_0x9d7a('0x2')](_0x9d7a('0x3'),_0x9d7a('0x4'),_0x9d7a('0x5'))},'keyContent':{'type':Sequelize[_0x9d7a('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x9d7a('0x7')]},'customField':{'type':Sequelize[_0x9d7a('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x9d7a('0x7')]}};
\ No newline at end of file
+var _0x583e=['customVariable','sequelize','ENUM','string','variable','keyValue','picklist','STRING'];(function(_0x3ce025,_0x1bbd23){var _0x19206a=function(_0x9ec5b2){while(--_0x9ec5b2){_0x3ce025['push'](_0x3ce025['shift']());}};_0x19206a(++_0x1bbd23);}(_0x583e,0x1d9));var _0xe583=function(_0x5f0eb9,_0x37f75b){_0x5f0eb9=_0x5f0eb9-0x0;var _0x274bf4=_0x583e[_0x5f0eb9];return _0x274bf4;};'use strict';var Sequelize=require(_0xe583('0x0'));module['exports']={'type':{'type':Sequelize[_0xe583('0x1')](_0xe583('0x2'),_0xe583('0x3'),'customVariable',_0xe583('0x4'),_0xe583('0x5')),'defaultValue':_0xe583('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xe583('0x6')]},'keyType':{'type':Sequelize[_0xe583('0x1')](_0xe583('0x2'),_0xe583('0x3'),_0xe583('0x7'))},'keyContent':{'type':Sequelize[_0xe583('0x6')]},'idField':{'type':Sequelize[_0xe583('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xe583('0x6')]}};
\ No newline at end of file
index 6973689..7a5658f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x95a4=['end','json','undefined','limit','offset','count','set','Content-Range','apply','save','destroy','then','sendStatus','error','name','index','map','ZohoField','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','options','includeAll','include','findAll','rows','catch','show','fields','find','create','update','body','params','eml-format','rimraf','zip-dir','moment','bluebird','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status'];(function(_0x5ecb67,_0x33e49e){var _0x8a0b75=function(_0x5b5596){while(--_0x5b5596){_0x5ecb67['push'](_0x5ecb67['shift']());}};_0x8a0b75(++_0x33e49e);}(_0x95a4,0x76));var _0x495a=function(_0xa853f6,_0x45dc90){_0xa853f6=_0xa853f6-0x0;var _0x1f4369=_0x95a4[_0xa853f6];return _0x1f4369;};'use strict';var emlformat=require(_0x495a('0x0'));var rimraf=require(_0x495a('0x1'));var zipdir=require(_0x495a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x495a('0x3'));var BPromise=require(_0x495a('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x495a('0x5'));var csv=require(_0x495a('0x6'));var ejs=require(_0x495a('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x495a('0x8'));var crypto=require(_0x495a('0x9'));var jsforce=require(_0x495a('0xa'));var deskjs=require(_0x495a('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x495a('0xc'));var Redis=require(_0x495a('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x495a('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x495a('0xf'));var logger=require(_0x495a('0x10'))(_0x495a('0x11'));var utils=require(_0x495a('0x12'));var config=require(_0x495a('0x13'));var licenseUtil=require(_0x495a('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x271225,_0x4df526){_0x4df526=_0x4df526||0xcc;return function(_0x41a28d){if(_0x41a28d){return _0x271225['sendStatus'](_0x4df526);}return _0x271225[_0x495a('0x15')](_0x4df526)[_0x495a('0x16')]();};}function respondWithResult(_0x19794a,_0x4c39b8){_0x4c39b8=_0x4c39b8||0xc8;return function(_0x987b00){if(_0x987b00){return _0x19794a[_0x495a('0x15')](_0x4c39b8)[_0x495a('0x17')](_0x987b00);}};}function respondWithFilteredResult(_0x130b63,_0x2702ee){return function(_0x23d355){if(_0x23d355){var _0x224867=typeof _0x2702ee['offset']===_0x495a('0x18')&&typeof _0x2702ee[_0x495a('0x19')]===_0x495a('0x18');var _0x1108ed=_0x23d355['count'];var _0x1d4054=_0x224867?0x0:_0x2702ee[_0x495a('0x1a')];var _0x5c4409=_0x224867?_0x23d355[_0x495a('0x1b')]:_0x2702ee[_0x495a('0x1a')]+_0x2702ee[_0x495a('0x19')];var _0x27391c;if(_0x5c4409>=_0x1108ed){_0x5c4409=_0x1108ed;_0x27391c=0xc8;}else{_0x27391c=0xce;}_0x130b63[_0x495a('0x15')](_0x27391c);return _0x130b63[_0x495a('0x1c')](_0x495a('0x1d'),_0x1d4054+'-'+_0x5c4409+'/'+_0x1108ed)['json'](_0x23d355);}return null;};}function patchUpdates(_0x23920f){return function(_0x57a08b){try{jsonpatch[_0x495a('0x1e')](_0x57a08b,_0x23920f,!![]);}catch(_0x75d6c1){return BPromise['reject'](_0x75d6c1);}return _0x57a08b[_0x495a('0x1f')]();};}function saveUpdates(_0x3ea833,_0x1cf1ef){return function(_0x387737){if(_0x387737){return _0x387737['update'](_0x3ea833)['then'](function(_0x100e44){return _0x100e44;});}return null;};}function removeEntity(_0x201e83,_0x275621){return function(_0x13a936){if(_0x13a936){return _0x13a936[_0x495a('0x20')]()[_0x495a('0x21')](function(){_0x201e83['status'](0xcc)[_0x495a('0x16')]();});}};}function handleEntityNotFound(_0x5071ed,_0x3bc6ff){return function(_0x2fd8b9){if(!_0x2fd8b9){_0x5071ed[_0x495a('0x22')](0x194);}return _0x2fd8b9;};}function handleError(_0x34cd9f,_0x582b71){_0x582b71=_0x582b71||0x1f4;return function(_0x1f2f8e){logger[_0x495a('0x23')](_0x1f2f8e['stack']);if(_0x1f2f8e[_0x495a('0x24')]){delete _0x1f2f8e[_0x495a('0x24')];}_0x34cd9f[_0x495a('0x15')](_0x582b71)['send'](_0x1f2f8e);};}exports[_0x495a('0x25')]=function(_0x548aa7,_0x411c8e){var _0x138424={},_0x2b1fc1={},_0x1e6948={'count':0x0,'rows':[]};var _0x32668e=_[_0x495a('0x26')](db[_0x495a('0x27')][_0x495a('0x28')],function(_0x555cca){return{'name':_0x555cca[_0x495a('0x29')],'type':_0x555cca['type'][_0x495a('0x2a')]};});_0x2b1fc1[_0x495a('0x2b')]=_[_0x495a('0x26')](_0x32668e,_0x495a('0x24'));_0x2b1fc1[_0x495a('0x2c')]=_[_0x495a('0x2d')](_0x548aa7[_0x495a('0x2c')]);_0x2b1fc1[_0x495a('0x2e')]=_[_0x495a('0x2f')](_0x2b1fc1[_0x495a('0x2b')],_0x2b1fc1[_0x495a('0x2c')]);_0x138424[_0x495a('0x30')]=_['intersection'](_0x2b1fc1['model'],qs['fields'](_0x548aa7[_0x495a('0x2c')]['fields']));_0x138424[_0x495a('0x30')]=_0x138424[_0x495a('0x30')][_0x495a('0x31')]?_0x138424[_0x495a('0x30')]:_0x2b1fc1['model'];if(!_0x548aa7['query'][_0x495a('0x32')](_0x495a('0x33'))){_0x138424[_0x495a('0x19')]=qs['limit'](_0x548aa7['query'][_0x495a('0x19')]);_0x138424[_0x495a('0x1a')]=qs[_0x495a('0x1a')](_0x548aa7[_0x495a('0x2c')][_0x495a('0x1a')]);}_0x138424[_0x495a('0x34')]=qs[_0x495a('0x35')](_0x548aa7['query'][_0x495a('0x35')]);_0x138424['where']=qs[_0x495a('0x2e')](_['pick'](_0x548aa7[_0x495a('0x2c')],_0x2b1fc1[_0x495a('0x2e')]),_0x32668e);if(_0x548aa7[_0x495a('0x2c')][_0x495a('0x36')]){_0x138424[_0x495a('0x37')]=_['merge'](_0x138424['where'],{'$or':_['map'](_0x32668e,function(_0x421add){if(_0x421add['type']!=='VIRTUAL'){var _0x2481a4={};_0x2481a4[_0x421add['name']]={'$like':'%'+_0x548aa7[_0x495a('0x2c')][_0x495a('0x36')]+'%'};return _0x2481a4;}})});}_0x138424=_[_0x495a('0x38')]({},_0x138424,_0x548aa7[_0x495a('0x39')]);var _0x49e974={'where':_0x138424[_0x495a('0x37')]};return db[_0x495a('0x27')][_0x495a('0x1b')](_0x49e974)['then'](function(_0x2ee126){_0x1e6948[_0x495a('0x1b')]=_0x2ee126;if(_0x548aa7[_0x495a('0x2c')][_0x495a('0x3a')]){_0x138424[_0x495a('0x3b')]=[{'all':!![]}];}return db[_0x495a('0x27')][_0x495a('0x3c')](_0x138424);})['then'](function(_0x35f4f2){_0x1e6948[_0x495a('0x3d')]=_0x35f4f2;return _0x1e6948;})['then'](respondWithFilteredResult(_0x411c8e,_0x138424))[_0x495a('0x3e')](handleError(_0x411c8e,null));};exports[_0x495a('0x3f')]=function(_0x2a548c,_0x4cac6f){var _0x3a8659={'raw':!![],'where':{'id':_0x2a548c['params']['id']}},_0x4b25bb={};_0x4b25bb['model']=_[_0x495a('0x2d')](db['ZohoField'][_0x495a('0x28')]);_0x4b25bb[_0x495a('0x2c')]=_['keys'](_0x2a548c[_0x495a('0x2c')]);_0x4b25bb[_0x495a('0x2e')]=_[_0x495a('0x2f')](_0x4b25bb[_0x495a('0x2b')],_0x4b25bb['query']);_0x3a8659[_0x495a('0x30')]=_[_0x495a('0x2f')](_0x4b25bb[_0x495a('0x2b')],qs[_0x495a('0x40')](_0x2a548c[_0x495a('0x2c')][_0x495a('0x40')]));_0x3a8659[_0x495a('0x30')]=_0x3a8659[_0x495a('0x30')][_0x495a('0x31')]?_0x3a8659[_0x495a('0x30')]:_0x4b25bb[_0x495a('0x2b')];if(_0x2a548c['query'][_0x495a('0x3a')]){_0x3a8659[_0x495a('0x3b')]=[{'all':!![]}];}_0x3a8659=_[_0x495a('0x38')]({},_0x3a8659,_0x2a548c['options']);return db[_0x495a('0x27')][_0x495a('0x41')](_0x3a8659)[_0x495a('0x21')](handleEntityNotFound(_0x4cac6f,null))[_0x495a('0x21')](respondWithResult(_0x4cac6f,null))[_0x495a('0x3e')](handleError(_0x4cac6f,null));};exports[_0x495a('0x42')]=function(_0x517d50,_0x5784ef){return db[_0x495a('0x27')]['create'](_0x517d50['body'],{})[_0x495a('0x21')](respondWithResult(_0x5784ef,0xc9))['catch'](handleError(_0x5784ef,null));};exports[_0x495a('0x43')]=function(_0x398a24,_0x58fb96){if(_0x398a24[_0x495a('0x44')]['id']){delete _0x398a24[_0x495a('0x44')]['id'];}return db[_0x495a('0x27')][_0x495a('0x41')]({'where':{'id':_0x398a24[_0x495a('0x45')]['id']}})[_0x495a('0x21')](handleEntityNotFound(_0x58fb96,null))[_0x495a('0x21')](saveUpdates(_0x398a24[_0x495a('0x44')],null))[_0x495a('0x21')](respondWithResult(_0x58fb96,null))[_0x495a('0x3e')](handleError(_0x58fb96,null));};exports[_0x495a('0x20')]=function(_0x2a72fb,_0x717310){return db[_0x495a('0x27')][_0x495a('0x41')]({'where':{'id':_0x2a72fb['params']['id']}})[_0x495a('0x21')](handleEntityNotFound(_0x717310,null))[_0x495a('0x21')](removeEntity(_0x717310,null))[_0x495a('0x3e')](handleError(_0x717310,null));};
\ No newline at end of file
+var _0x142a=['set','Content-Range','apply','reject','update','then','destroy','error','stack','map','ZohoField','rawAttributes','fieldName','type','key','name','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','order','sort','filter','where','merge','VIRTUAL','includeAll','include','findAll','catch','params','keys','options','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count'];(function(_0x4606d2,_0xe550ed){var _0x4e86a6=function(_0x4322d0){while(--_0x4322d0){_0x4606d2['push'](_0x4606d2['shift']());}};_0x4e86a6(++_0xe550ed);}(_0x142a,0x18b));var _0xa142=function(_0x49e055,_0x504469){_0x49e055=_0x49e055-0x0;var _0x147c23=_0x142a[_0x49e055];return _0x147c23;};'use strict';var emlformat=require(_0xa142('0x0'));var rimraf=require(_0xa142('0x1'));var zipdir=require(_0xa142('0x2'));var jsonpatch=require(_0xa142('0x3'));var rp=require(_0xa142('0x4'));var moment=require('moment');var BPromise=require(_0xa142('0x5'));var Mustache=require(_0xa142('0x6'));var util=require(_0xa142('0x7'));var path=require('path');var sox=require(_0xa142('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa142('0x9'));var _=require('lodash');var squel=require(_0xa142('0xa'));var crypto=require(_0xa142('0xb'));var jsforce=require(_0xa142('0xc'));var deskjs=require(_0xa142('0xd'));var toCsv=require(_0xa142('0xe'));var querystring=require(_0xa142('0xf'));var Papa=require(_0xa142('0x10'));var Redis=require('ioredis');var authService=require(_0xa142('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xa142('0x12'));var hardwareService=require(_0xa142('0x13'));var logger=require('../../config/logger')(_0xa142('0x14'));var utils=require(_0xa142('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xa142('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x62d0ae,_0x3c6d5a){_0x3c6d5a=_0x3c6d5a||0xcc;return function(_0x373c55){if(_0x373c55){return _0x62d0ae[_0xa142('0x17')](_0x3c6d5a);}return _0x62d0ae[_0xa142('0x18')](_0x3c6d5a)[_0xa142('0x19')]();};}function respondWithResult(_0x32e6de,_0x286b64){_0x286b64=_0x286b64||0xc8;return function(_0x1b3798){if(_0x1b3798){return _0x32e6de[_0xa142('0x18')](_0x286b64)[_0xa142('0x1a')](_0x1b3798);}};}function respondWithFilteredResult(_0x1821d1,_0x23f62f){return function(_0x440d53){if(_0x440d53){var _0xb66838=typeof _0x23f62f[_0xa142('0x1b')]===_0xa142('0x1c')&&typeof _0x23f62f[_0xa142('0x1d')]===_0xa142('0x1c');var _0x5c57b0=_0x440d53[_0xa142('0x1e')];var _0x359960=_0xb66838?0x0:_0x23f62f['offset'];var _0x5e4dc9=_0xb66838?_0x440d53[_0xa142('0x1e')]:_0x23f62f[_0xa142('0x1b')]+_0x23f62f[_0xa142('0x1d')];var _0x4d18be;if(_0x5e4dc9>=_0x5c57b0){_0x5e4dc9=_0x5c57b0;_0x4d18be=0xc8;}else{_0x4d18be=0xce;}_0x1821d1[_0xa142('0x18')](_0x4d18be);return _0x1821d1[_0xa142('0x1f')](_0xa142('0x20'),_0x359960+'-'+_0x5e4dc9+'/'+_0x5c57b0)[_0xa142('0x1a')](_0x440d53);}return null;};}function patchUpdates(_0x1a024e){return function(_0x10d0e6){try{jsonpatch[_0xa142('0x21')](_0x10d0e6,_0x1a024e,!![]);}catch(_0x2ad7a5){return BPromise[_0xa142('0x22')](_0x2ad7a5);}return _0x10d0e6['save']();};}function saveUpdates(_0x24bbb8,_0xfe36c8){return function(_0x196595){if(_0x196595){return _0x196595[_0xa142('0x23')](_0x24bbb8)[_0xa142('0x24')](function(_0x20aadf){return _0x20aadf;});}return null;};}function removeEntity(_0x5e0376,_0x4d5695){return function(_0x567dc9){if(_0x567dc9){return _0x567dc9[_0xa142('0x25')]()[_0xa142('0x24')](function(){_0x5e0376[_0xa142('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x36d9fc,_0xc29ef1){return function(_0x4154bf){if(!_0x4154bf){_0x36d9fc[_0xa142('0x17')](0x194);}return _0x4154bf;};}function handleError(_0x18e8a0,_0x10c2e4){_0x10c2e4=_0x10c2e4||0x1f4;return function(_0x1fad4c){logger[_0xa142('0x26')](_0x1fad4c[_0xa142('0x27')]);if(_0x1fad4c['name']){delete _0x1fad4c['name'];}_0x18e8a0[_0xa142('0x18')](_0x10c2e4)['send'](_0x1fad4c);};}exports['index']=function(_0x11dda8,_0x591ff3){var _0x5f1eaf={},_0x515bd7={},_0x576f1b={'count':0x0,'rows':[]};var _0x5b07fd=_[_0xa142('0x28')](db[_0xa142('0x29')][_0xa142('0x2a')],function(_0x2b80c2){return{'name':_0x2b80c2[_0xa142('0x2b')],'type':_0x2b80c2[_0xa142('0x2c')][_0xa142('0x2d')]};});_0x515bd7['model']=_[_0xa142('0x28')](_0x5b07fd,_0xa142('0x2e'));_0x515bd7[_0xa142('0x2f')]=_['keys'](_0x11dda8[_0xa142('0x2f')]);_0x515bd7[_0xa142('0x30')]=_[_0xa142('0x31')](_0x515bd7['model'],_0x515bd7[_0xa142('0x2f')]);_0x5f1eaf[_0xa142('0x32')]=_[_0xa142('0x31')](_0x515bd7[_0xa142('0x33')],qs[_0xa142('0x34')](_0x11dda8[_0xa142('0x2f')][_0xa142('0x34')]));_0x5f1eaf[_0xa142('0x32')]=_0x5f1eaf[_0xa142('0x32')][_0xa142('0x35')]?_0x5f1eaf[_0xa142('0x32')]:_0x515bd7[_0xa142('0x33')];if(!_0x11dda8[_0xa142('0x2f')][_0xa142('0x36')]('nolimit')){_0x5f1eaf['limit']=qs['limit'](_0x11dda8['query'][_0xa142('0x1d')]);_0x5f1eaf[_0xa142('0x1b')]=qs[_0xa142('0x1b')](_0x11dda8[_0xa142('0x2f')][_0xa142('0x1b')]);}_0x5f1eaf[_0xa142('0x37')]=qs[_0xa142('0x38')](_0x11dda8[_0xa142('0x2f')][_0xa142('0x38')]);_0x5f1eaf['where']=qs[_0xa142('0x30')](_['pick'](_0x11dda8[_0xa142('0x2f')],_0x515bd7[_0xa142('0x30')]),_0x5b07fd);if(_0x11dda8[_0xa142('0x2f')][_0xa142('0x39')]){_0x5f1eaf[_0xa142('0x3a')]=_[_0xa142('0x3b')](_0x5f1eaf[_0xa142('0x3a')],{'$or':_[_0xa142('0x28')](_0x5b07fd,function(_0x45807a){if(_0x45807a['type']!==_0xa142('0x3c')){var _0x5e7b9d={};_0x5e7b9d[_0x45807a['name']]={'$like':'%'+_0x11dda8[_0xa142('0x2f')][_0xa142('0x39')]+'%'};return _0x5e7b9d;}})});}_0x5f1eaf=_[_0xa142('0x3b')]({},_0x5f1eaf,_0x11dda8['options']);var _0xc04f5a={'where':_0x5f1eaf[_0xa142('0x3a')]};return db['ZohoField']['count'](_0xc04f5a)['then'](function(_0x1e0e89){_0x576f1b[_0xa142('0x1e')]=_0x1e0e89;if(_0x11dda8['query'][_0xa142('0x3d')]){_0x5f1eaf[_0xa142('0x3e')]=[{'all':!![]}];}return db[_0xa142('0x29')][_0xa142('0x3f')](_0x5f1eaf);})[_0xa142('0x24')](function(_0x43885f){_0x576f1b['rows']=_0x43885f;return _0x576f1b;})[_0xa142('0x24')](respondWithFilteredResult(_0x591ff3,_0x5f1eaf))[_0xa142('0x40')](handleError(_0x591ff3,null));};exports['show']=function(_0x215418,_0x310dc8){var _0x58b86f={'raw':!![],'where':{'id':_0x215418[_0xa142('0x41')]['id']}},_0x59ed2={};_0x59ed2['model']=_[_0xa142('0x42')](db[_0xa142('0x29')][_0xa142('0x2a')]);_0x59ed2[_0xa142('0x2f')]=_[_0xa142('0x42')](_0x215418[_0xa142('0x2f')]);_0x59ed2[_0xa142('0x30')]=_['intersection'](_0x59ed2['model'],_0x59ed2[_0xa142('0x2f')]);_0x58b86f[_0xa142('0x32')]=_[_0xa142('0x31')](_0x59ed2['model'],qs[_0xa142('0x34')](_0x215418[_0xa142('0x2f')][_0xa142('0x34')]));_0x58b86f[_0xa142('0x32')]=_0x58b86f[_0xa142('0x32')][_0xa142('0x35')]?_0x58b86f[_0xa142('0x32')]:_0x59ed2[_0xa142('0x33')];if(_0x215418[_0xa142('0x2f')][_0xa142('0x3d')]){_0x58b86f[_0xa142('0x3e')]=[{'all':!![]}];}_0x58b86f=_['merge']({},_0x58b86f,_0x215418[_0xa142('0x43')]);return db[_0xa142('0x29')][_0xa142('0x44')](_0x58b86f)[_0xa142('0x24')](handleEntityNotFound(_0x310dc8,null))['then'](respondWithResult(_0x310dc8,null))['catch'](handleError(_0x310dc8,null));};exports['create']=function(_0x225d29,_0x231861){return db[_0xa142('0x29')][_0xa142('0x45')](_0x225d29['body'],{})[_0xa142('0x24')](respondWithResult(_0x231861,0xc9))[_0xa142('0x40')](handleError(_0x231861,null));};exports[_0xa142('0x23')]=function(_0x566405,_0x39dc1c){if(_0x566405[_0xa142('0x46')]['id']){delete _0x566405[_0xa142('0x46')]['id'];}return db['ZohoField']['find']({'where':{'id':_0x566405['params']['id']}})[_0xa142('0x24')](handleEntityNotFound(_0x39dc1c,null))[_0xa142('0x24')](saveUpdates(_0x566405[_0xa142('0x46')],null))[_0xa142('0x24')](respondWithResult(_0x39dc1c,null))['catch'](handleError(_0x39dc1c,null));};exports[_0xa142('0x25')]=function(_0x1bb79a,_0x5dfd06){return db[_0xa142('0x29')][_0xa142('0x44')]({'where':{'id':_0x1bb79a['params']['id']}})[_0xa142('0x24')](handleEntityNotFound(_0x5dfd06,null))['then'](removeEntity(_0x5dfd06,null))['catch'](handleError(_0x5dfd06,null));};
\ No newline at end of file
index c0e650e..ea32835 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x68b3=['../../config/environment','exports','define','ZohoField','int_zoho_fields','zoho_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x4e50a8,_0x2f2025){var _0xbb4a6d=function(_0x39e355){while(--_0x39e355){_0x4e50a8['push'](_0x4e50a8['shift']());}};_0xbb4a6d(++_0x2f2025);}(_0x68b3,0x1d8));var _0x368b=function(_0x28f1d3,_0x2335d3){_0x28f1d3=_0x28f1d3-0x0;var _0x2a3f1c=_0x68b3[_0x28f1d3];return _0x2a3f1c;};'use strict';var _=require(_0x368b('0x0'));var util=require(_0x368b('0x1'));var logger=require(_0x368b('0x2'))(_0x368b('0x3'));var moment=require(_0x368b('0x4'));var BPromise=require('bluebird');var rp=require(_0x368b('0x5'));var fs=require('fs');var path=require(_0x368b('0x6'));var rimraf=require(_0x368b('0x7'));var config=require(_0x368b('0x8'));var attributes=require('./intZohoField.attributes');module[_0x368b('0x9')]=function(_0x41b15b,_0x104dad){return _0x41b15b[_0x368b('0xa')](_0x368b('0xb'),attributes,{'tableName':_0x368b('0xc'),'paranoid':![],'indexes':[{'name':_0x368b('0xd'),'fields':[_0x368b('0xe'),_0x368b('0xf')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x82c4=['moment','bluebird','request-promise','rimraf','./intZohoField.attributes','define','ZohoField','int_zoho_fields','zoho_unique_index','idField','lodash','util','../../config/logger','api'];(function(_0x22ba2c,_0x2a8105){var _0x200b2e=function(_0x519821){while(--_0x519821){_0x22ba2c['push'](_0x22ba2c['shift']());}};_0x200b2e(++_0x2a8105);}(_0x82c4,0x1ca));var _0x482c=function(_0x20a558,_0x160e0e){_0x20a558=_0x20a558-0x0;var _0x53d3f7=_0x82c4[_0x20a558];return _0x53d3f7;};'use strict';var _=require(_0x482c('0x0'));var util=require(_0x482c('0x1'));var logger=require(_0x482c('0x2'))(_0x482c('0x3'));var moment=require(_0x482c('0x4'));var BPromise=require(_0x482c('0x5'));var rp=require(_0x482c('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x482c('0x7'));var config=require('../../config/environment');var attributes=require(_0x482c('0x8'));module['exports']=function(_0x477cf4,_0x5d7c76){return _0x477cf4[_0x482c('0x9')](_0x482c('0xa'),attributes,{'tableName':_0x482c('0xb'),'paranoid':![],'indexes':[{'name':_0x482c('0xc'),'fields':[_0x482c('0xd'),'FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 91eeabb..06a8456 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x271f=['../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','error','ZohoField,\x20%s,\x20%s','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x33caf9,_0x16d49f){var _0x5ee02f=function(_0x19cab4){while(--_0x19cab4){_0x33caf9['push'](_0x33caf9['shift']());}};_0x5ee02f(++_0x16d49f);}(_0x271f,0xa9));var _0xf271=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x271f[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0xf271('0x0'));var util=require(_0xf271('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xf271('0x2'));var fs=require('fs');var Redis=require(_0xf271('0x3'));var db=require(_0xf271('0x4'))['db'];var utils=require(_0xf271('0x5'));var logger=require(_0xf271('0x6'))('rpc');var config=require(_0xf271('0x7'));var jayson=require(_0xf271('0x8'));var client=jayson[_0xf271('0x9')][_0xf271('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x241fe8,_0x1414f7,_0x3a11be){return new BPromise(function(_0x336e82,_0x414698){return client[_0xf271('0xb')](_0x241fe8,_0x3a11be)[_0xf271('0xc')](function(_0x5dc2b2){logger[_0xf271('0xd')]('ZohoField,\x20%s,\x20%s',_0x1414f7,_0xf271('0xe'));logger[_0xf271('0xf')](_0xf271('0x10'),_0x1414f7,_0xf271('0xe'),JSON['stringify'](_0x5dc2b2));if(_0x5dc2b2['error']){if(_0x5dc2b2[_0xf271('0x11')]['code']===0x1f4){logger[_0xf271('0x11')](_0xf271('0x12'),_0x1414f7,_0x5dc2b2[_0xf271('0x11')][_0xf271('0x13')]);return _0x414698(_0x5dc2b2[_0xf271('0x11')][_0xf271('0x13')]);}logger[_0xf271('0x11')](_0xf271('0x12'),_0x1414f7,_0x5dc2b2[_0xf271('0x11')][_0xf271('0x13')]);return _0x336e82(_0x5dc2b2[_0xf271('0x11')]['message']);}else{logger[_0xf271('0xd')](_0xf271('0x12'),_0x1414f7,_0xf271('0xe'));_0x336e82(_0x5dc2b2[_0xf271('0x14')][_0xf271('0x13')]);}})[_0xf271('0x15')](function(_0x5264b3){logger[_0xf271('0x11')]('ZohoField,\x20%s,\x20%s',_0x1414f7,_0x5264b3);_0x414698(_0x5264b3);});});}
\ No newline at end of file
+var _0xf857=['jayson/promise','client','then','info','ZohoField,\x20%s,\x20%s','ZohoField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x154382,_0x5d2955){var _0x282216=function(_0x925c47){while(--_0x925c47){_0x154382['push'](_0x154382['shift']());}};_0x282216(++_0x5d2955);}(_0xf857,0x1d9));var _0x7f85=function(_0x427172,_0xfb874a){_0x427172=_0x427172-0x0;var _0x93f4da=_0xf857[_0x427172];return _0x93f4da;};'use strict';var _=require(_0x7f85('0x0'));var util=require(_0x7f85('0x1'));var moment=require(_0x7f85('0x2'));var BPromise=require('bluebird');var rs=require(_0x7f85('0x3'));var fs=require('fs');var Redis=require(_0x7f85('0x4'));var db=require(_0x7f85('0x5'))['db'];var utils=require(_0x7f85('0x6'));var logger=require(_0x7f85('0x7'))(_0x7f85('0x8'));var config=require(_0x7f85('0x9'));var jayson=require(_0x7f85('0xa'));var client=jayson[_0x7f85('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0xc593cc,_0x223b95,_0x297dba){return new BPromise(function(_0x37eacf,_0x49579b){return client['request'](_0xc593cc,_0x297dba)[_0x7f85('0xc')](function(_0x1764e9){logger[_0x7f85('0xd')](_0x7f85('0xe'),_0x223b95,'request\x20sent');logger['debug'](_0x7f85('0xf'),_0x223b95,_0x7f85('0x10'),JSON[_0x7f85('0x11')](_0x1764e9));if(_0x1764e9['error']){if(_0x1764e9[_0x7f85('0x12')][_0x7f85('0x13')]===0x1f4){logger[_0x7f85('0x12')](_0x7f85('0xe'),_0x223b95,_0x1764e9[_0x7f85('0x12')][_0x7f85('0x14')]);return _0x49579b(_0x1764e9[_0x7f85('0x12')][_0x7f85('0x14')]);}logger[_0x7f85('0x12')](_0x7f85('0xe'),_0x223b95,_0x1764e9[_0x7f85('0x12')][_0x7f85('0x14')]);return _0x37eacf(_0x1764e9[_0x7f85('0x12')][_0x7f85('0x14')]);}else{logger[_0x7f85('0xd')](_0x7f85('0xe'),_0x223b95,_0x7f85('0x10'));_0x37eacf(_0x1764e9[_0x7f85('0x15')][_0x7f85('0x14')]);}})[_0x7f85('0x16')](function(_0x378b2c){logger['error'](_0x7f85('0xe'),_0x223b95,_0x378b2c);_0x49579b(_0x378b2c);});});}
\ No newline at end of file
index 9193578..67804cb 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(_0x110dc7,_0x14f98a){var _0x46cc63=function(_0x420bdf){while(--_0x420bdf){_0x110dc7['push'](_0x110dc7['shift']());}};_0x46cc63(++_0x14f98a);}(_0xedd9,0xfc));var _0x9edd=function(_0xe1e407,_0x1d2142){_0xe1e407=_0xe1e407-0x0;var _0x5490d6=_0xedd9[_0xe1e407];return _0x5490d6;};'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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x3bcab6,_0x392b4f){var _0x219ebf=function(_0xc71c8b){while(--_0xc71c8b){_0x3bcab6['push'](_0x3bcab6['shift']());}};_0x219ebf(++_0x392b4f);}(_0xe706,0xa3));var _0x6e70=function(_0x453327,_0x3ebe4a){_0x453327=_0x453327-0x0;var _0x1d5a70=_0xe706[_0x453327];return _0x1d5a70;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router;
\ No newline at end of file
index 8e9d18c..15aa538 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3572=['BOOLEAN','state','sequelize','exports','unique_name_and_version','STRING','app.js','INTEGER'];(function(_0x4c445a,_0x4ee80f){var _0x2f611c=function(_0x4f3699){while(--_0x4f3699){_0x4c445a['push'](_0x4c445a['shift']());}};_0x2f611c(++_0x4ee80f);}(_0x3572,0x8a));var _0x2357=function(_0x4bb8c6,_0x199f2c){_0x4bb8c6=_0x4bb8c6-0x0;var _0x2870d7=_0x3572[_0x4bb8c6];return _0x2870d7;};'use strict';var Sequelize=require(_0x2357('0x0'));module[_0x2357('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x2357('0x2')},'version':{'type':Sequelize[_0x2357('0x3')],'allowNull':![],'unique':_0x2357('0x2')},'main':{'type':Sequelize[_0x2357('0x3')],'defaultValue':_0x2357('0x4')},'filename':{'type':Sequelize[_0x2357('0x3')]},'path':{'type':Sequelize[_0x2357('0x3')]},'type':{'type':Sequelize['STRING']},'size':{'type':Sequelize[_0x2357('0x5')]},'active':{'type':Sequelize[_0x2357('0x6')],'defaultValue':![]},'author':{'type':Sequelize[_0x2357('0x3')]},'logo':{'type':Sequelize[_0x2357('0x3')]},'state':{'type':Sequelize[_0x2357('0x3')],'unique':_0x2357('0x7')},'description':{'type':Sequelize[_0x2357('0x3')]},'title':{'type':Sequelize[_0x2357('0x3')]},'remoteUri':{'type':Sequelize[_0x2357('0x3')]},'link':{'type':Sequelize[_0x2357('0x3')],'defaultValue':'#'}};
\ No newline at end of file
+var _0x7b9b=['app.js','INTEGER','BOOLEAN','state','exports','unique_name_and_version','STRING'];(function(_0x181c12,_0x42241d){var _0x219ffd=function(_0x2808aa){while(--_0x2808aa){_0x181c12['push'](_0x181c12['shift']());}};_0x219ffd(++_0x42241d);}(_0x7b9b,0x97));var _0xb7b9=function(_0x1fd32e,_0x84c25b){_0x1fd32e=_0x1fd32e-0x0;var _0x593fa0=_0x7b9b[_0x1fd32e];return _0x593fa0;};'use strict';var Sequelize=require('sequelize');module[_0xb7b9('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xb7b9('0x1')},'version':{'type':Sequelize[_0xb7b9('0x2')],'allowNull':![],'unique':'unique_name_and_version'},'main':{'type':Sequelize[_0xb7b9('0x2')],'defaultValue':_0xb7b9('0x3')},'filename':{'type':Sequelize[_0xb7b9('0x2')]},'path':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xb7b9('0x2')]},'size':{'type':Sequelize[_0xb7b9('0x4')]},'active':{'type':Sequelize[_0xb7b9('0x5')],'defaultValue':![]},'author':{'type':Sequelize[_0xb7b9('0x2')]},'logo':{'type':Sequelize[_0xb7b9('0x2')]},'state':{'type':Sequelize[_0xb7b9('0x2')],'unique':_0xb7b9('0x6')},'description':{'type':Sequelize[_0xb7b9('0x2')]},'title':{'type':Sequelize[_0xb7b9('0x2')]},'remoteUri':{'type':Sequelize[_0xb7b9('0x2')]},'link':{'type':Sequelize[_0xb7b9('0x2')],'defaultValue':'#'}};
\ No newline at end of file
index fe7edb0..90b51e8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x01d9=['map','Integration','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','catch','show','params','includeAll','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','error','name','send','index'];(function(_0x812f08,_0x418044){var _0x2adc0e=function(_0x45d790){while(--_0x45d790){_0x812f08['push'](_0x812f08['shift']());}};_0x2adc0e(++_0x418044);}(_0x01d9,0x6c));var _0x901d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x01d9[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x901d('0x0'));var rimraf=require(_0x901d('0x1'));var zipdir=require(_0x901d('0x2'));var jsonpatch=require(_0x901d('0x3'));var rp=require('request-promise');var moment=require(_0x901d('0x4'));var BPromise=require(_0x901d('0x5'));var Mustache=require(_0x901d('0x6'));var util=require(_0x901d('0x7'));var path=require(_0x901d('0x8'));var sox=require(_0x901d('0x9'));var csv=require(_0x901d('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x901d('0xb'));var _=require(_0x901d('0xc'));var squel=require(_0x901d('0xd'));var crypto=require(_0x901d('0xe'));var jsforce=require(_0x901d('0xf'));var deskjs=require(_0x901d('0x10'));var toCsv=require(_0x901d('0xa'));var querystring=require(_0x901d('0x11'));var Papa=require(_0x901d('0x12'));var Redis=require(_0x901d('0x13'));var authService=require(_0x901d('0x14'));var qs=require(_0x901d('0x15'));var as=require(_0x901d('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x901d('0x17'))('api');var utils=require(_0x901d('0x18'));var config=require(_0x901d('0x19'));var licenseUtil=require(_0x901d('0x1a'));var db=require(_0x901d('0x1b'))['db'];function respondWithStatusCode(_0x15ebaf,_0x5d2345){_0x5d2345=_0x5d2345||0xcc;return function(_0x1d8117){if(_0x1d8117){return _0x15ebaf[_0x901d('0x1c')](_0x5d2345);}return _0x15ebaf[_0x901d('0x1d')](_0x5d2345)[_0x901d('0x1e')]();};}function respondWithResult(_0xb8869a,_0x14d99b){_0x14d99b=_0x14d99b||0xc8;return function(_0x530a2b){if(_0x530a2b){return _0xb8869a[_0x901d('0x1d')](_0x14d99b)[_0x901d('0x1f')](_0x530a2b);}};}function respondWithFilteredResult(_0x11b0cc,_0x17d451){return function(_0x1aba97){if(_0x1aba97){var _0x7dd5f4=typeof _0x17d451[_0x901d('0x20')]===_0x901d('0x21')&&typeof _0x17d451[_0x901d('0x22')]===_0x901d('0x21');var _0x28caae=_0x1aba97[_0x901d('0x23')];var _0x285353=_0x7dd5f4?0x0:_0x17d451[_0x901d('0x20')];var _0x38f42b=_0x7dd5f4?_0x1aba97[_0x901d('0x23')]:_0x17d451[_0x901d('0x20')]+_0x17d451[_0x901d('0x22')];var _0x57d518;if(_0x38f42b>=_0x28caae){_0x38f42b=_0x28caae;_0x57d518=0xc8;}else{_0x57d518=0xce;}_0x11b0cc[_0x901d('0x1d')](_0x57d518);return _0x11b0cc[_0x901d('0x24')]('Content-Range',_0x285353+'-'+_0x38f42b+'/'+_0x28caae)['json'](_0x1aba97);}return null;};}function patchUpdates(_0x496a06){return function(_0x53f8ae){try{jsonpatch[_0x901d('0x25')](_0x53f8ae,_0x496a06,!![]);}catch(_0x44ea6f){return BPromise['reject'](_0x44ea6f);}return _0x53f8ae[_0x901d('0x26')]();};}function saveUpdates(_0x3ea3f6,_0x488e24){return function(_0x20778b){if(_0x20778b){return _0x20778b[_0x901d('0x27')](_0x3ea3f6)[_0x901d('0x28')](function(_0x3f80b9){return _0x3f80b9;});}return null;};}function removeEntity(_0x1e7d36,_0x1818d3){return function(_0x46e5c6){if(_0x46e5c6){return _0x46e5c6[_0x901d('0x29')]()['then'](function(){_0x1e7d36[_0x901d('0x1d')](0xcc)[_0x901d('0x1e')]();});}};}function handleEntityNotFound(_0xbc89a5,_0x1f0ee5){return function(_0x557809){if(!_0x557809){_0xbc89a5[_0x901d('0x1c')](0x194);}return _0x557809;};}function handleError(_0x23fd43,_0x27f4ca){_0x27f4ca=_0x27f4ca||0x1f4;return function(_0x3cbe43){logger[_0x901d('0x2a')](_0x3cbe43['stack']);if(_0x3cbe43[_0x901d('0x2b')]){delete _0x3cbe43[_0x901d('0x2b')];}_0x23fd43[_0x901d('0x1d')](_0x27f4ca)[_0x901d('0x2c')](_0x3cbe43);};}exports[_0x901d('0x2d')]=function(_0x3de9b9,_0x48e86e){var _0xae6dfe={},_0x533038={},_0x128830={'count':0x0,'rows':[]};var _0x389fd9=_[_0x901d('0x2e')](db[_0x901d('0x2f')][_0x901d('0x30')],function(_0x20df02){return{'name':_0x20df02[_0x901d('0x31')],'type':_0x20df02[_0x901d('0x32')][_0x901d('0x33')]};});_0x533038[_0x901d('0x34')]=_[_0x901d('0x2e')](_0x389fd9,_0x901d('0x2b'));_0x533038[_0x901d('0x35')]=_[_0x901d('0x36')](_0x3de9b9[_0x901d('0x35')]);_0x533038['filters']=_[_0x901d('0x37')](_0x533038[_0x901d('0x34')],_0x533038[_0x901d('0x35')]);_0xae6dfe['attributes']=_[_0x901d('0x37')](_0x533038[_0x901d('0x34')],qs[_0x901d('0x38')](_0x3de9b9[_0x901d('0x35')][_0x901d('0x38')]));_0xae6dfe[_0x901d('0x39')]=_0xae6dfe[_0x901d('0x39')][_0x901d('0x3a')]?_0xae6dfe[_0x901d('0x39')]:_0x533038[_0x901d('0x34')];if(!_0x3de9b9['query']['hasOwnProperty'](_0x901d('0x3b'))){_0xae6dfe['limit']=qs[_0x901d('0x22')](_0x3de9b9[_0x901d('0x35')]['limit']);_0xae6dfe[_0x901d('0x20')]=qs[_0x901d('0x20')](_0x3de9b9[_0x901d('0x35')]['offset']);}_0xae6dfe[_0x901d('0x3c')]=qs[_0x901d('0x3d')](_0x3de9b9[_0x901d('0x35')][_0x901d('0x3d')]);_0xae6dfe[_0x901d('0x3e')]=qs[_0x901d('0x3f')](_[_0x901d('0x40')](_0x3de9b9[_0x901d('0x35')],_0x533038[_0x901d('0x3f')]),_0x389fd9);if(_0x3de9b9[_0x901d('0x35')][_0x901d('0x41')]){_0xae6dfe[_0x901d('0x3e')]=_[_0x901d('0x42')](_0xae6dfe[_0x901d('0x3e')],{'$or':_[_0x901d('0x2e')](_0x389fd9,function(_0x1644d8){if(_0x1644d8['type']!==_0x901d('0x43')){var _0x423cab={};_0x423cab[_0x1644d8['name']]={'$like':'%'+_0x3de9b9['query'][_0x901d('0x41')]+'%'};return _0x423cab;}})});}_0xae6dfe=_['merge']({},_0xae6dfe,_0x3de9b9[_0x901d('0x44')]);var _0x3d0556={'where':_0xae6dfe[_0x901d('0x3e')]};return db[_0x901d('0x2f')][_0x901d('0x23')](_0x3d0556)[_0x901d('0x28')](function(_0x5df4cb){_0x128830['count']=_0x5df4cb;if(_0x3de9b9['query']['includeAll']){_0xae6dfe[_0x901d('0x45')]=[{'all':!![]}];}return db[_0x901d('0x2f')]['findAll'](_0xae6dfe);})[_0x901d('0x28')](function(_0x22fc44){_0x128830['rows']=_0x22fc44;return _0x128830;})[_0x901d('0x28')](respondWithFilteredResult(_0x48e86e,_0xae6dfe))[_0x901d('0x46')](handleError(_0x48e86e,null));};exports[_0x901d('0x47')]=function(_0x2c1895,_0x53663d){var _0x5aeb41={'raw':![],'where':{'id':_0x2c1895[_0x901d('0x48')]['id']}},_0xa9c008={};_0xa9c008[_0x901d('0x34')]=_[_0x901d('0x36')](db[_0x901d('0x2f')][_0x901d('0x30')]);_0xa9c008[_0x901d('0x35')]=_[_0x901d('0x36')](_0x2c1895[_0x901d('0x35')]);_0xa9c008[_0x901d('0x3f')]=_[_0x901d('0x37')](_0xa9c008['model'],_0xa9c008[_0x901d('0x35')]);_0x5aeb41['attributes']=_[_0x901d('0x37')](_0xa9c008['model'],qs[_0x901d('0x38')](_0x2c1895['query'][_0x901d('0x38')]));_0x5aeb41[_0x901d('0x39')]=_0x5aeb41[_0x901d('0x39')][_0x901d('0x3a')]?_0x5aeb41[_0x901d('0x39')]:_0xa9c008[_0x901d('0x34')];if(_0x2c1895[_0x901d('0x35')][_0x901d('0x49')]){_0x5aeb41[_0x901d('0x45')]=[{'all':!![]}];}_0x5aeb41=_[_0x901d('0x42')]({},_0x5aeb41,_0x2c1895[_0x901d('0x44')]);return db['Integration'][_0x901d('0x4a')](_0x5aeb41)[_0x901d('0x28')](handleEntityNotFound(_0x53663d,null))[_0x901d('0x28')](respondWithResult(_0x53663d,null))[_0x901d('0x46')](handleError(_0x53663d,null));};exports[_0x901d('0x4b')]=function(_0x24b6fa,_0x27459b){return db[_0x901d('0x2f')][_0x901d('0x4b')](_0x24b6fa[_0x901d('0x4c')],{})[_0x901d('0x28')](respondWithResult(_0x27459b,0xc9))[_0x901d('0x46')](handleError(_0x27459b,null));};exports[_0x901d('0x27')]=function(_0x23f2a9,_0x4888e8){if(_0x23f2a9['body']['id']){delete _0x23f2a9[_0x901d('0x4c')]['id'];}return db[_0x901d('0x2f')][_0x901d('0x4a')]({'where':{'id':_0x23f2a9[_0x901d('0x48')]['id']}})[_0x901d('0x28')](handleEntityNotFound(_0x4888e8,null))['then'](saveUpdates(_0x23f2a9['body'],null))[_0x901d('0x28')](respondWithResult(_0x4888e8,null))[_0x901d('0x46')](handleError(_0x4888e8,null));};exports['destroy']=function(_0x23673d,_0x165207){return db['Integration'][_0x901d('0x4a')]({'where':{'id':_0x23673d['params']['id']}})[_0x901d('0x28')](handleEntityNotFound(_0x165207,null))[_0x901d('0x28')](removeEntity(_0x165207,null))[_0x901d('0x46')](handleError(_0x165207,null));};
\ No newline at end of file
+var _0x4888=['lodash','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','json','offset','limit','undefined','count','set','apply','reject','save','then','sendStatus','error','name','send','index','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','VIRTUAL','merge','Integration','includeAll','include','rows','catch','params','options','create','body','update','find','destroy','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra'];(function(_0x284240,_0x555b56){var _0x390667=function(_0x409454){while(--_0x409454){_0x284240['push'](_0x284240['shift']());}};_0x390667(++_0x555b56);}(_0x4888,0x198));var _0x8488=function(_0x44216d,_0x4938a7){_0x44216d=_0x44216d-0x0;var _0xeca523=_0x4888[_0x44216d];return _0xeca523;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8488('0x0'));var zipdir=require(_0x8488('0x1'));var jsonpatch=require(_0x8488('0x2'));var rp=require(_0x8488('0x3'));var moment=require(_0x8488('0x4'));var BPromise=require(_0x8488('0x5'));var Mustache=require(_0x8488('0x6'));var util=require('util');var path=require(_0x8488('0x7'));var sox=require(_0x8488('0x8'));var csv=require(_0x8488('0x9'));var ejs=require(_0x8488('0xa'));var fs=require('fs');var fs_extra=require(_0x8488('0xb'));var _=require(_0x8488('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x8488('0x9'));var querystring=require(_0x8488('0xd'));var Papa=require('papaparse');var Redis=require(_0x8488('0xe'));var authService=require(_0x8488('0xf'));var qs=require(_0x8488('0x10'));var as=require(_0x8488('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8488('0x12'))(_0x8488('0x13'));var utils=require(_0x8488('0x14'));var config=require(_0x8488('0x15'));var licenseUtil=require(_0x8488('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x14462e,_0x3d1f7a){_0x3d1f7a=_0x3d1f7a||0xcc;return function(_0x58f83d){if(_0x58f83d){return _0x14462e['sendStatus'](_0x3d1f7a);}return _0x14462e[_0x8488('0x17')](_0x3d1f7a)['end']();};}function respondWithResult(_0x214083,_0x4e94fc){_0x4e94fc=_0x4e94fc||0xc8;return function(_0x5161a3){if(_0x5161a3){return _0x214083[_0x8488('0x17')](_0x4e94fc)[_0x8488('0x18')](_0x5161a3);}};}function respondWithFilteredResult(_0x5700b,_0x2bcb7c){return function(_0x3b3cfa){if(_0x3b3cfa){var _0x8d3b3d=typeof _0x2bcb7c[_0x8488('0x19')]==='undefined'&&typeof _0x2bcb7c[_0x8488('0x1a')]===_0x8488('0x1b');var _0x3edfe4=_0x3b3cfa[_0x8488('0x1c')];var _0x60ae2f=_0x8d3b3d?0x0:_0x2bcb7c[_0x8488('0x19')];var _0x1aedb1=_0x8d3b3d?_0x3b3cfa[_0x8488('0x1c')]:_0x2bcb7c[_0x8488('0x19')]+_0x2bcb7c[_0x8488('0x1a')];var _0x10bfd6;if(_0x1aedb1>=_0x3edfe4){_0x1aedb1=_0x3edfe4;_0x10bfd6=0xc8;}else{_0x10bfd6=0xce;}_0x5700b[_0x8488('0x17')](_0x10bfd6);return _0x5700b[_0x8488('0x1d')]('Content-Range',_0x60ae2f+'-'+_0x1aedb1+'/'+_0x3edfe4)['json'](_0x3b3cfa);}return null;};}function patchUpdates(_0x340d6b){return function(_0x12d40f){try{jsonpatch[_0x8488('0x1e')](_0x12d40f,_0x340d6b,!![]);}catch(_0x3c9fc2){return BPromise[_0x8488('0x1f')](_0x3c9fc2);}return _0x12d40f[_0x8488('0x20')]();};}function saveUpdates(_0x43b672,_0x3c078c){return function(_0x39dd43){if(_0x39dd43){return _0x39dd43['update'](_0x43b672)[_0x8488('0x21')](function(_0x4e07e1){return _0x4e07e1;});}return null;};}function removeEntity(_0x140b0b,_0x1361a6){return function(_0x290b33){if(_0x290b33){return _0x290b33['destroy']()['then'](function(){_0x140b0b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x472624,_0x51fe30){return function(_0x58057a){if(!_0x58057a){_0x472624[_0x8488('0x22')](0x194);}return _0x58057a;};}function handleError(_0x2f350a,_0x2b3c97){_0x2b3c97=_0x2b3c97||0x1f4;return function(_0x6ebee0){logger[_0x8488('0x23')](_0x6ebee0['stack']);if(_0x6ebee0[_0x8488('0x24')]){delete _0x6ebee0[_0x8488('0x24')];}_0x2f350a[_0x8488('0x17')](_0x2b3c97)[_0x8488('0x25')](_0x6ebee0);};}exports[_0x8488('0x26')]=function(_0x27f5cf,_0x2c15ff){var _0x296b6c={},_0x368f9c={},_0x1d9317={'count':0x0,'rows':[]};var _0x888b24=_['map'](db['Integration']['rawAttributes'],function(_0x292fe8){return{'name':_0x292fe8[_0x8488('0x27')],'type':_0x292fe8[_0x8488('0x28')][_0x8488('0x29')]};});_0x368f9c[_0x8488('0x2a')]=_[_0x8488('0x2b')](_0x888b24,'name');_0x368f9c[_0x8488('0x2c')]=_[_0x8488('0x2d')](_0x27f5cf[_0x8488('0x2c')]);_0x368f9c[_0x8488('0x2e')]=_[_0x8488('0x2f')](_0x368f9c['model'],_0x368f9c[_0x8488('0x2c')]);_0x296b6c[_0x8488('0x30')]=_['intersection'](_0x368f9c[_0x8488('0x2a')],qs[_0x8488('0x31')](_0x27f5cf[_0x8488('0x2c')][_0x8488('0x31')]));_0x296b6c[_0x8488('0x30')]=_0x296b6c['attributes'][_0x8488('0x32')]?_0x296b6c[_0x8488('0x30')]:_0x368f9c[_0x8488('0x2a')];if(!_0x27f5cf['query'][_0x8488('0x33')]('nolimit')){_0x296b6c[_0x8488('0x1a')]=qs[_0x8488('0x1a')](_0x27f5cf[_0x8488('0x2c')][_0x8488('0x1a')]);_0x296b6c['offset']=qs[_0x8488('0x19')](_0x27f5cf[_0x8488('0x2c')][_0x8488('0x19')]);}_0x296b6c['order']=qs[_0x8488('0x34')](_0x27f5cf[_0x8488('0x2c')][_0x8488('0x34')]);_0x296b6c[_0x8488('0x35')]=qs[_0x8488('0x2e')](_[_0x8488('0x36')](_0x27f5cf[_0x8488('0x2c')],_0x368f9c[_0x8488('0x2e')]),_0x888b24);if(_0x27f5cf[_0x8488('0x2c')][_0x8488('0x37')]){_0x296b6c[_0x8488('0x35')]=_['merge'](_0x296b6c['where'],{'$or':_[_0x8488('0x2b')](_0x888b24,function(_0x36c17a){if(_0x36c17a[_0x8488('0x28')]!==_0x8488('0x38')){var _0x2d9fa1={};_0x2d9fa1[_0x36c17a[_0x8488('0x24')]]={'$like':'%'+_0x27f5cf[_0x8488('0x2c')][_0x8488('0x37')]+'%'};return _0x2d9fa1;}})});}_0x296b6c=_[_0x8488('0x39')]({},_0x296b6c,_0x27f5cf['options']);var _0xf5a0a0={'where':_0x296b6c[_0x8488('0x35')]};return db[_0x8488('0x3a')]['count'](_0xf5a0a0)[_0x8488('0x21')](function(_0xa50c4b){_0x1d9317[_0x8488('0x1c')]=_0xa50c4b;if(_0x27f5cf[_0x8488('0x2c')][_0x8488('0x3b')]){_0x296b6c[_0x8488('0x3c')]=[{'all':!![]}];}return db[_0x8488('0x3a')]['findAll'](_0x296b6c);})[_0x8488('0x21')](function(_0x1c33a1){_0x1d9317[_0x8488('0x3d')]=_0x1c33a1;return _0x1d9317;})['then'](respondWithFilteredResult(_0x2c15ff,_0x296b6c))[_0x8488('0x3e')](handleError(_0x2c15ff,null));};exports['show']=function(_0x40ee7e,_0x34b11b){var _0x5cbd11={'raw':![],'where':{'id':_0x40ee7e[_0x8488('0x3f')]['id']}},_0x22a3f3={};_0x22a3f3[_0x8488('0x2a')]=_[_0x8488('0x2d')](db[_0x8488('0x3a')]['rawAttributes']);_0x22a3f3[_0x8488('0x2c')]=_['keys'](_0x40ee7e[_0x8488('0x2c')]);_0x22a3f3[_0x8488('0x2e')]=_[_0x8488('0x2f')](_0x22a3f3[_0x8488('0x2a')],_0x22a3f3[_0x8488('0x2c')]);_0x5cbd11[_0x8488('0x30')]=_[_0x8488('0x2f')](_0x22a3f3[_0x8488('0x2a')],qs[_0x8488('0x31')](_0x40ee7e[_0x8488('0x2c')][_0x8488('0x31')]));_0x5cbd11[_0x8488('0x30')]=_0x5cbd11[_0x8488('0x30')][_0x8488('0x32')]?_0x5cbd11[_0x8488('0x30')]:_0x22a3f3[_0x8488('0x2a')];if(_0x40ee7e[_0x8488('0x2c')]['includeAll']){_0x5cbd11[_0x8488('0x3c')]=[{'all':!![]}];}_0x5cbd11=_[_0x8488('0x39')]({},_0x5cbd11,_0x40ee7e[_0x8488('0x40')]);return db[_0x8488('0x3a')]['find'](_0x5cbd11)[_0x8488('0x21')](handleEntityNotFound(_0x34b11b,null))[_0x8488('0x21')](respondWithResult(_0x34b11b,null))[_0x8488('0x3e')](handleError(_0x34b11b,null));};exports[_0x8488('0x41')]=function(_0x52042c,_0x1f0516){return db[_0x8488('0x3a')][_0x8488('0x41')](_0x52042c[_0x8488('0x42')],{})[_0x8488('0x21')](respondWithResult(_0x1f0516,0xc9))[_0x8488('0x3e')](handleError(_0x1f0516,null));};exports[_0x8488('0x43')]=function(_0x299d8e,_0x1bc2e1){if(_0x299d8e[_0x8488('0x42')]['id']){delete _0x299d8e[_0x8488('0x42')]['id'];}return db[_0x8488('0x3a')][_0x8488('0x44')]({'where':{'id':_0x299d8e['params']['id']}})['then'](handleEntityNotFound(_0x1bc2e1,null))[_0x8488('0x21')](saveUpdates(_0x299d8e[_0x8488('0x42')],null))[_0x8488('0x21')](respondWithResult(_0x1bc2e1,null))[_0x8488('0x3e')](handleError(_0x1bc2e1,null));};exports[_0x8488('0x45')]=function(_0x22d22c,_0x25f2dc){return db[_0x8488('0x3a')][_0x8488('0x44')]({'where':{'id':_0x22d22c['params']['id']}})[_0x8488('0x21')](handleEntityNotFound(_0x25f2dc,null))[_0x8488('0x21')](removeEntity(_0x25f2dc,null))['catch'](handleError(_0x25f2dc,null));};
\ No newline at end of file
index 464129d..40dc7bb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7cce=['util','../../config/logger','api','bluebird','request-promise','path','./integration.attributes','exports','Integration','integrations'];(function(_0x257495,_0x18269b){var _0x3849aa=function(_0x1ca94e){while(--_0x1ca94e){_0x257495['push'](_0x257495['shift']());}};_0x3849aa(++_0x18269b);}(_0x7cce,0x1d6));var _0xe7cc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7cce[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xe7cc('0x0'));var logger=require(_0xe7cc('0x1'))(_0xe7cc('0x2'));var moment=require('moment');var BPromise=require(_0xe7cc('0x3'));var rp=require(_0xe7cc('0x4'));var fs=require('fs');var path=require(_0xe7cc('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xe7cc('0x6'));module[_0xe7cc('0x7')]=function(_0x41ef7b,_0x58aa26){return _0x41ef7b['define'](_0xe7cc('0x8'),attributes,{'tableName':_0xe7cc('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x72d1=['exports','define','Integration','integrations','lodash','util','moment','request-promise','path','rimraf','../../config/environment','./integration.attributes'];(function(_0xd0a847,_0x72562b){var _0x2536ec=function(_0x20e4db){while(--_0x20e4db){_0xd0a847['push'](_0xd0a847['shift']());}};_0x2536ec(++_0x72562b);}(_0x72d1,0x13c));var _0x172d=function(_0x599d7f,_0xc586e8){_0x599d7f=_0x599d7f-0x0;var _0x3346d3=_0x72d1[_0x599d7f];return _0x3346d3;};'use strict';var _=require(_0x172d('0x0'));var util=require(_0x172d('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x172d('0x2'));var BPromise=require('bluebird');var rp=require(_0x172d('0x3'));var fs=require('fs');var path=require(_0x172d('0x4'));var rimraf=require(_0x172d('0x5'));var config=require(_0x172d('0x6'));var attributes=require(_0x172d('0x7'));module[_0x172d('0x8')]=function(_0x42f4e1,_0x515bdf){return _0x42f4e1[_0x172d('0x9')](_0x172d('0xa'),attributes,{'tableName':_0x172d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 7fc84d3..e27385b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4975=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','Integration,\x20%s,\x20%s','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring'];(function(_0x24061a,_0x1c9f4d){var _0x82054e=function(_0x2ec346){while(--_0x2ec346){_0x24061a['push'](_0x24061a['shift']());}};_0x82054e(++_0x1c9f4d);}(_0x4975,0x86));var _0x5497=function(_0x10b333,_0x301f3c){_0x10b333=_0x10b333-0x0;var _0x389ad7=_0x4975[_0x10b333];return _0x389ad7;};'use strict';var _=require(_0x5497('0x0'));var util=require('util');var moment=require(_0x5497('0x1'));var BPromise=require(_0x5497('0x2'));var rs=require(_0x5497('0x3'));var fs=require('fs');var Redis=require(_0x5497('0x4'));var db=require(_0x5497('0x5'))['db'];var utils=require(_0x5497('0x6'));var logger=require(_0x5497('0x7'))(_0x5497('0x8'));var config=require(_0x5497('0x9'));var jayson=require(_0x5497('0xa'));var client=jayson['client'][_0x5497('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4f563d,_0x1d0019,_0x674a2a){return new BPromise(function(_0x368e8b,_0x57f930){return client[_0x5497('0xc')](_0x4f563d,_0x674a2a)['then'](function(_0x1f63d8){logger[_0x5497('0xd')](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));logger[_0x5497('0x10')](_0x5497('0x11'),_0x1d0019,_0x5497('0xf'),JSON[_0x5497('0x12')](_0x1f63d8));if(_0x1f63d8['error']){if(_0x1f63d8['error']['code']===0x1f4){logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x57f930(_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);}logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x368e8b(_0x1f63d8['error'][_0x5497('0x14')]);}else{logger['info'](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));_0x368e8b(_0x1f63d8[_0x5497('0x15')][_0x5497('0x14')]);}})[_0x5497('0x16')](function(_0x4073e6){logger[_0x5497('0x13')]('Integration,\x20%s,\x20%s',_0x1d0019,_0x4073e6);_0x57f930(_0x4073e6);});});}
\ No newline at end of file
+var _0x0b0e=['Integration,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Integration,\x20%s,\x20%s','debug'];(function(_0x1d94d1,_0x347bb8){var _0x23c397=function(_0x489441){while(--_0x489441){_0x1d94d1['push'](_0x1d94d1['shift']());}};_0x23c397(++_0x347bb8);}(_0x0b0e,0x187));var _0xe0b0=function(_0x463a6e,_0x1b47b5){_0x463a6e=_0x463a6e-0x0;var _0x51d8c6=_0x0b0e[_0x463a6e];return _0x51d8c6;};'use strict';var _=require(_0xe0b0('0x0'));var util=require('util');var moment=require(_0xe0b0('0x1'));var BPromise=require('bluebird');var rs=require(_0xe0b0('0x2'));var fs=require('fs');var Redis=require(_0xe0b0('0x3'));var db=require(_0xe0b0('0x4'))['db'];var utils=require(_0xe0b0('0x5'));var logger=require(_0xe0b0('0x6'))(_0xe0b0('0x7'));var config=require(_0xe0b0('0x8'));var jayson=require(_0xe0b0('0x9'));var client=jayson[_0xe0b0('0xa')][_0xe0b0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x219b1c,_0x5cf9cc,_0x50be7f){return new BPromise(function(_0x11effc,_0x435060){return client[_0xe0b0('0xc')](_0x219b1c,_0x50be7f)[_0xe0b0('0xd')](function(_0x4c24f9){logger[_0xe0b0('0xe')](_0xe0b0('0xf'),_0x5cf9cc,'request\x20sent');logger[_0xe0b0('0x10')](_0xe0b0('0x11'),_0x5cf9cc,'request\x20sent',JSON[_0xe0b0('0x12')](_0x4c24f9));if(_0x4c24f9[_0xe0b0('0x13')]){if(_0x4c24f9[_0xe0b0('0x13')]['code']===0x1f4){logger[_0xe0b0('0x13')](_0xe0b0('0xf'),_0x5cf9cc,_0x4c24f9[_0xe0b0('0x13')][_0xe0b0('0x14')]);return _0x435060(_0x4c24f9[_0xe0b0('0x13')]['message']);}logger[_0xe0b0('0x13')](_0xe0b0('0xf'),_0x5cf9cc,_0x4c24f9[_0xe0b0('0x13')][_0xe0b0('0x14')]);return _0x11effc(_0x4c24f9[_0xe0b0('0x13')]['message']);}else{logger[_0xe0b0('0xe')]('Integration,\x20%s,\x20%s',_0x5cf9cc,_0xe0b0('0x15'));_0x11effc(_0x4c24f9[_0xe0b0('0x16')]['message']);}})[_0xe0b0('0x17')](function(_0x4a4cc0){logger[_0xe0b0('0x13')](_0xe0b0('0xf'),_0x5cf9cc,_0x4a4cc0);_0x435060(_0x4a4cc0);});});}
\ No newline at end of file
index d1d3913..6b8464c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdb28=['destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','create','put','update'];(function(_0x42245d,_0x51758f){var _0x4b211a=function(_0x2634e){while(--_0x2634e){_0x42245d['push'](_0x42245d['shift']());}};_0x4b211a(++_0x51758f);}(_0xdb28,0x106));var _0x8db2=function(_0x3899ff,_0x3511a1){_0x3899ff=_0x3899ff-0x0;var _0x594268=_0xdb28[_0x3899ff];return _0x594268;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var fs_extra=require(_0x8db2('0x5'));var auth=require(_0x8db2('0x6'));var interaction=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var controller=require('./integrationReport.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['post']('/',auth[_0x8db2('0xa')](),controller[_0x8db2('0xf')]);router[_0x8db2('0x10')]('/:id',auth[_0x8db2('0xa')](),controller[_0x8db2('0x11')]);router['delete'](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x12')]);module[_0x8db2('0x13')]=router;
\ No newline at end of file
+var _0x187d=['/:id','show','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./integrationReport.controller','isAuthenticated','index','get','/describe','describe'];(function(_0x26eb3d,_0x2cfde2){var _0x4bd0c1=function(_0xb650cb){while(--_0xb650cb){_0x26eb3d['push'](_0x26eb3d['shift']());}};_0x4bd0c1(++_0x2cfde2);}(_0x187d,0x93));var _0xd187=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0x187d[_0x4bfac3];return _0x15f0f2;};'use strict';var multer=require(_0xd187('0x0'));var util=require('util');var path=require(_0xd187('0x1'));var timeout=require(_0xd187('0x2'));var express=require(_0xd187('0x3'));var router=express[_0xd187('0x4')]();var fs_extra=require(_0xd187('0x5'));var auth=require(_0xd187('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd187('0x7'));var controller=require(_0xd187('0x8'));router['get']('/',auth[_0xd187('0x9')](),controller[_0xd187('0xa')]);router[_0xd187('0xb')](_0xd187('0xc'),auth[_0xd187('0x9')](),controller[_0xd187('0xd')]);router[_0xd187('0xb')](_0xd187('0xe'),auth['isAuthenticated'](),controller[_0xd187('0xf')]);router[_0xd187('0x10')]('/',auth[_0xd187('0x9')](),controller[_0xd187('0x11')]);router[_0xd187('0x12')](_0xd187('0xe'),auth['isAuthenticated'](),controller[_0xd187('0x13')]);router[_0xd187('0x14')](_0xd187('0xe'),auth['isAuthenticated'](),controller[_0xd187('0x15')]);module[_0xd187('0x16')]=router;
\ No newline at end of file
index f012d51..d2243cc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9b49=['TEXT','ENUM','SENT','SENDING','RECEIVED','sequelize','exports','STRING','INTEGER','DATE','BOOLEAN'];(function(_0x1b5aea,_0x3f04b7){var _0x15cfc6=function(_0x204e92){while(--_0x204e92){_0x1b5aea['push'](_0x1b5aea['shift']());}};_0x15cfc6(++_0x3f04b7);}(_0x9b49,0xb5));var _0x99b4=function(_0xdad237,_0x361a1d){_0xdad237=_0xdad237-0x0;var _0x15c575=_0x9b49[_0xdad237];return _0x15c575;};'use strict';var Sequelize=require(_0x99b4('0x0'));module[_0x99b4('0x1')]={'integration':{'type':Sequelize[_0x99b4('0x2')]},'eventChannel':{'type':Sequelize['STRING']},'exitStatus':{'type':Sequelize[_0x99b4('0x2')]},'ticketId':{'type':Sequelize['STRING']},'integrationId':{'type':Sequelize[_0x99b4('0x3')]},'contacts':{'type':Sequelize[_0x99b4('0x2')]},'uniqueid':{'type':Sequelize[_0x99b4('0x2')]},'calleridnum':{'type':Sequelize[_0x99b4('0x2')]},'calleridname':{'type':Sequelize[_0x99b4('0x2')]},'queue':{'type':Sequelize[_0x99b4('0x2')]},'interface':{'type':Sequelize[_0x99b4('0x2')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0x99b4('0x4')]},'agentconnectAt':{'type':Sequelize[_0x99b4('0x4')]},'holdtime':{'type':Sequelize[_0x99b4('0x3')]},'agentcomplete':{'type':Sequelize[_0x99b4('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize['DATE']},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize[_0x99b4('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0x99b4('0x2')]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdump':{'type':Sequelize[_0x99b4('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x99b4('0x4')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x99b4('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x99b4('0x2')]},'connectedlinenum':{'type':Sequelize[_0x99b4('0x2')]},'connectedlinename':{'type':Sequelize[_0x99b4('0x2')]},'language':{'type':Sequelize[_0x99b4('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x99b4('0x2')]},'exten':{'type':Sequelize[_0x99b4('0x2')]},'priority':{'type':Sequelize[_0x99b4('0x2')]},'destchannel':{'type':Sequelize[_0x99b4('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0x99b4('0x2')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0x99b4('0x2')]},'destlanguage':{'type':Sequelize[_0x99b4('0x2')]},'destaccountcode':{'type':Sequelize[_0x99b4('0x2')]},'destcontext':{'type':Sequelize[_0x99b4('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x99b4('0x2')]},'destuniqueid':{'type':Sequelize[_0x99b4('0x2')]},'messageId':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0x99b4('0x2')]},'subject':{'type':Sequelize[_0x99b4('0x2')]},'from':{'type':Sequelize[_0x99b4('0x2')]},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize['STRING']},'attachment':{'type':Sequelize[_0x99b4('0x6')]},'html':{'type':Sequelize[_0x99b4('0x6')]},'text':{'type':Sequelize['TEXT']},'status':{'type':Sequelize[_0x99b4('0x7')](_0x99b4('0x8'),_0x99b4('0x9'),_0x99b4('0xa'),'FAILED')},'url':{'type':Sequelize['STRING']},'app':{'type':Sequelize[_0x99b4('0x2')]},'appdata':{'type':Sequelize['STRING']},'projectId':{'type':Sequelize[_0x99b4('0x3')]}};
\ No newline at end of file
+var _0x070a=['TEXT','SENT','FAILED','exports','STRING','INTEGER','DATE','BOOLEAN'];(function(_0x108fb4,_0x57e935){var _0x277dd4=function(_0x301225){while(--_0x301225){_0x108fb4['push'](_0x108fb4['shift']());}};_0x277dd4(++_0x57e935);}(_0x070a,0xc3));var _0xa070=function(_0x4013f4,_0x133aaa){_0x4013f4=_0x4013f4-0x0;var _0x2bbf86=_0x070a[_0x4013f4];return _0x2bbf86;};'use strict';var Sequelize=require('sequelize');module[_0xa070('0x0')]={'integration':{'type':Sequelize[_0xa070('0x1')]},'eventChannel':{'type':Sequelize[_0xa070('0x1')]},'exitStatus':{'type':Sequelize[_0xa070('0x1')]},'ticketId':{'type':Sequelize[_0xa070('0x1')]},'integrationId':{'type':Sequelize[_0xa070('0x2')]},'contacts':{'type':Sequelize[_0xa070('0x1')]},'uniqueid':{'type':Sequelize[_0xa070('0x1')]},'calleridnum':{'type':Sequelize[_0xa070('0x1')]},'calleridname':{'type':Sequelize[_0xa070('0x1')]},'queue':{'type':Sequelize[_0xa070('0x1')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xa070('0x1')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0xa070('0x3')]},'holdtime':{'type':Sequelize[_0xa070('0x2')]},'agentcomplete':{'type':Sequelize[_0xa070('0x4')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0xa070('0x3')]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize[_0xa070('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0xa070('0x1')]},'agentringnoanswer':{'type':Sequelize[_0xa070('0x4')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0xa070('0x3')]},'agentdump':{'type':Sequelize[_0xa070('0x4')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize[_0xa070('0x1')]},'channel':{'type':Sequelize[_0xa070('0x1')]},'channelstate':{'type':Sequelize[_0xa070('0x2')]},'channelstatedesc':{'type':Sequelize[_0xa070('0x1')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xa070('0x1')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0xa070('0x1')]},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0xa070('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0xa070('0x1')]},'destcalleridnum':{'type':Sequelize[_0xa070('0x1')]},'destcalleridname':{'type':Sequelize[_0xa070('0x1')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0xa070('0x1')]},'destlanguage':{'type':Sequelize[_0xa070('0x1')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0xa070('0x1')]},'destuniqueid':{'type':Sequelize[_0xa070('0x1')]},'messageId':{'type':Sequelize[_0xa070('0x1')]},'inReplyTo':{'type':Sequelize[_0xa070('0x1')]},'subject':{'type':Sequelize[_0xa070('0x1')]},'from':{'type':Sequelize[_0xa070('0x1')]},'to':{'type':Sequelize[_0xa070('0x1')]},'cc':{'type':Sequelize[_0xa070('0x1')]},'attachment':{'type':Sequelize['TEXT']},'html':{'type':Sequelize[_0xa070('0x5')]},'text':{'type':Sequelize[_0xa070('0x5')]},'status':{'type':Sequelize['ENUM'](_0xa070('0x6'),'SENDING','RECEIVED',_0xa070('0x7'))},'url':{'type':Sequelize['STRING']},'app':{'type':Sequelize[_0xa070('0x1')]},'appdata':{'type':Sequelize[_0xa070('0x1')]},'projectId':{'type':Sequelize[_0xa070('0x2')]}};
\ No newline at end of file
index 65f28ac..b482bba 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3324=['to-csv','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','reject','save','update','then','error','name','send','index','map','IntegrationReport','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','sort','where','filters','filter','merge','options','includeAll','include','rows','catch','show','params','create','body','destroy','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js'];(function(_0x1da0e1,_0x407f7c){var _0x1f3a80=function(_0x35fafe){while(--_0x35fafe){_0x1da0e1['push'](_0x1da0e1['shift']());}};_0x1f3a80(++_0x407f7c);}(_0x3324,0x7d));var _0x4332=function(_0x4876b5,_0x44b2b6){_0x4876b5=_0x4876b5-0x0;var _0x40c6d7=_0x3324[_0x4876b5];return _0x40c6d7;};'use strict';var emlformat=require(_0x4332('0x0'));var rimraf=require(_0x4332('0x1'));var zipdir=require(_0x4332('0x2'));var jsonpatch=require(_0x4332('0x3'));var rp=require('request-promise');var moment=require(_0x4332('0x4'));var BPromise=require(_0x4332('0x5'));var Mustache=require(_0x4332('0x6'));var util=require(_0x4332('0x7'));var path=require('path');var sox=require(_0x4332('0x8'));var csv=require('to-csv');var ejs=require(_0x4332('0x9'));var fs=require('fs');var fs_extra=require(_0x4332('0xa'));var _=require(_0x4332('0xb'));var squel=require(_0x4332('0xc'));var crypto=require('crypto');var jsforce=require(_0x4332('0xd'));var deskjs=require(_0x4332('0xe'));var toCsv=require(_0x4332('0xf'));var querystring=require(_0x4332('0x10'));var Papa=require(_0x4332('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x4332('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x4332('0x13'))(_0x4332('0x14'));var utils=require('../../config/utils');var config=require(_0x4332('0x15'));var licenseUtil=require(_0x4332('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x26300c,_0x50b6cf){_0x50b6cf=_0x50b6cf||0xcc;return function(_0x3e794f){if(_0x3e794f){return _0x26300c[_0x4332('0x17')](_0x50b6cf);}return _0x26300c[_0x4332('0x18')](_0x50b6cf)[_0x4332('0x19')]();};}function respondWithResult(_0x16046b,_0x3e356a){_0x3e356a=_0x3e356a||0xc8;return function(_0x13ac46){if(_0x13ac46){return _0x16046b[_0x4332('0x18')](_0x3e356a)[_0x4332('0x1a')](_0x13ac46);}};}function respondWithFilteredResult(_0x1b028a,_0x371ba1){return function(_0x1cc0b8){if(_0x1cc0b8){var _0x4fece7=typeof _0x371ba1['offset']==='undefined'&&typeof _0x371ba1[_0x4332('0x1b')]===_0x4332('0x1c');var _0xa8b709=_0x1cc0b8[_0x4332('0x1d')];var _0x52d0c0=_0x4fece7?0x0:_0x371ba1[_0x4332('0x1e')];var _0x930b05=_0x4fece7?_0x1cc0b8[_0x4332('0x1d')]:_0x371ba1[_0x4332('0x1e')]+_0x371ba1[_0x4332('0x1b')];var _0x462f78;if(_0x930b05>=_0xa8b709){_0x930b05=_0xa8b709;_0x462f78=0xc8;}else{_0x462f78=0xce;}_0x1b028a[_0x4332('0x18')](_0x462f78);return _0x1b028a[_0x4332('0x1f')](_0x4332('0x20'),_0x52d0c0+'-'+_0x930b05+'/'+_0xa8b709)[_0x4332('0x1a')](_0x1cc0b8);}return null;};}function patchUpdates(_0x5bfec5){return function(_0x3ffd29){try{jsonpatch['apply'](_0x3ffd29,_0x5bfec5,!![]);}catch(_0x58aa87){return BPromise[_0x4332('0x21')](_0x58aa87);}return _0x3ffd29[_0x4332('0x22')]();};}function saveUpdates(_0x29c8ca,_0x48e8e5){return function(_0x56877c){if(_0x56877c){return _0x56877c[_0x4332('0x23')](_0x29c8ca)[_0x4332('0x24')](function(_0x1f2393){return _0x1f2393;});}return null;};}function removeEntity(_0x2c0ddd,_0x39cc54){return function(_0x505e7c){if(_0x505e7c){return _0x505e7c['destroy']()['then'](function(){_0x2c0ddd[_0x4332('0x18')](0xcc)[_0x4332('0x19')]();});}};}function handleEntityNotFound(_0x47b05f,_0x2128d9){return function(_0x26fe2e){if(!_0x26fe2e){_0x47b05f[_0x4332('0x17')](0x194);}return _0x26fe2e;};}function handleError(_0x2584f7,_0x1c14c8){_0x1c14c8=_0x1c14c8||0x1f4;return function(_0x26fe56){logger[_0x4332('0x25')](_0x26fe56['stack']);if(_0x26fe56[_0x4332('0x26')]){delete _0x26fe56['name'];}_0x2584f7[_0x4332('0x18')](_0x1c14c8)[_0x4332('0x27')](_0x26fe56);};}exports[_0x4332('0x28')]=function(_0x3f9a24,_0x51ec88){var _0x4d2ee0={},_0x57dc12={},_0xbe808c={'count':0x0,'rows':[]};var _0x2c19bc=_[_0x4332('0x29')](db[_0x4332('0x2a')][_0x4332('0x2b')],function(_0x1e78fe){return{'name':_0x1e78fe[_0x4332('0x2c')],'type':_0x1e78fe[_0x4332('0x2d')][_0x4332('0x2e')]};});_0x57dc12[_0x4332('0x2f')]=_[_0x4332('0x29')](_0x2c19bc,_0x4332('0x26'));_0x57dc12[_0x4332('0x30')]=_['keys'](_0x3f9a24[_0x4332('0x30')]);_0x57dc12['filters']=_[_0x4332('0x31')](_0x57dc12[_0x4332('0x2f')],_0x57dc12[_0x4332('0x30')]);_0x4d2ee0[_0x4332('0x32')]=_[_0x4332('0x31')](_0x57dc12[_0x4332('0x2f')],qs[_0x4332('0x33')](_0x3f9a24[_0x4332('0x30')][_0x4332('0x33')]));_0x4d2ee0['attributes']=_0x4d2ee0[_0x4332('0x32')][_0x4332('0x34')]?_0x4d2ee0['attributes']:_0x57dc12['model'];if(!_0x3f9a24[_0x4332('0x30')]['hasOwnProperty']('nolimit')){_0x4d2ee0[_0x4332('0x1b')]=qs[_0x4332('0x1b')](_0x3f9a24[_0x4332('0x30')][_0x4332('0x1b')]);_0x4d2ee0[_0x4332('0x1e')]=qs['offset'](_0x3f9a24['query']['offset']);}_0x4d2ee0['order']=qs['sort'](_0x3f9a24[_0x4332('0x30')][_0x4332('0x35')]);_0x4d2ee0[_0x4332('0x36')]=qs[_0x4332('0x37')](_['pick'](_0x3f9a24[_0x4332('0x30')],_0x57dc12['filters']),_0x2c19bc);if(_0x3f9a24[_0x4332('0x30')][_0x4332('0x38')]){_0x4d2ee0[_0x4332('0x36')]=_[_0x4332('0x39')](_0x4d2ee0[_0x4332('0x36')],{'$or':_[_0x4332('0x29')](_0x2c19bc,function(_0x42ee44){if(_0x42ee44[_0x4332('0x2d')]!=='VIRTUAL'){var _0x5b6af0={};_0x5b6af0[_0x42ee44['name']]={'$like':'%'+_0x3f9a24[_0x4332('0x30')][_0x4332('0x38')]+'%'};return _0x5b6af0;}})});}_0x4d2ee0=_['merge']({},_0x4d2ee0,_0x3f9a24[_0x4332('0x3a')]);var _0x5cdd46={'where':_0x4d2ee0['where']};return db[_0x4332('0x2a')][_0x4332('0x1d')](_0x5cdd46)[_0x4332('0x24')](function(_0x19891b){_0xbe808c['count']=_0x19891b;if(_0x3f9a24[_0x4332('0x30')][_0x4332('0x3b')]){_0x4d2ee0[_0x4332('0x3c')]=[{'all':!![]}];}return db['IntegrationReport']['findAll'](_0x4d2ee0);})[_0x4332('0x24')](function(_0x5a56cc){_0xbe808c[_0x4332('0x3d')]=_0x5a56cc;return _0xbe808c;})[_0x4332('0x24')](respondWithFilteredResult(_0x51ec88,_0x4d2ee0))[_0x4332('0x3e')](handleError(_0x51ec88,null));};exports[_0x4332('0x3f')]=function(_0x54c936,_0x262ce3){var _0x5845da={'raw':![],'where':{'id':_0x54c936[_0x4332('0x40')]['id']}},_0x58ad57={};_0x58ad57[_0x4332('0x2f')]=_['keys'](db[_0x4332('0x2a')]['rawAttributes']);_0x58ad57[_0x4332('0x30')]=_['keys'](_0x54c936[_0x4332('0x30')]);_0x58ad57[_0x4332('0x37')]=_[_0x4332('0x31')](_0x58ad57[_0x4332('0x2f')],_0x58ad57[_0x4332('0x30')]);_0x5845da[_0x4332('0x32')]=_[_0x4332('0x31')](_0x58ad57['model'],qs[_0x4332('0x33')](_0x54c936[_0x4332('0x30')][_0x4332('0x33')]));_0x5845da[_0x4332('0x32')]=_0x5845da[_0x4332('0x32')][_0x4332('0x34')]?_0x5845da[_0x4332('0x32')]:_0x58ad57['model'];if(_0x54c936['query'][_0x4332('0x3b')]){_0x5845da[_0x4332('0x3c')]=[{'all':!![]}];}_0x5845da=_[_0x4332('0x39')]({},_0x5845da,_0x54c936[_0x4332('0x3a')]);return db['IntegrationReport']['find'](_0x5845da)['then'](handleEntityNotFound(_0x262ce3,null))[_0x4332('0x24')](respondWithResult(_0x262ce3,null))['catch'](handleError(_0x262ce3,null));};exports[_0x4332('0x41')]=function(_0x4096eb,_0x296b9e){return db[_0x4332('0x2a')][_0x4332('0x41')](_0x4096eb[_0x4332('0x42')],{})[_0x4332('0x24')](respondWithResult(_0x296b9e,0xc9))[_0x4332('0x3e')](handleError(_0x296b9e,null));};exports[_0x4332('0x23')]=function(_0x2c3a16,_0x480f5f){if(_0x2c3a16[_0x4332('0x42')]['id']){delete _0x2c3a16[_0x4332('0x42')]['id'];}return db[_0x4332('0x2a')]['find']({'where':{'id':_0x2c3a16[_0x4332('0x40')]['id']}})['then'](handleEntityNotFound(_0x480f5f,null))[_0x4332('0x24')](saveUpdates(_0x2c3a16[_0x4332('0x42')],null))['then'](respondWithResult(_0x480f5f,null))[_0x4332('0x3e')](handleError(_0x480f5f,null));};exports[_0x4332('0x43')]=function(_0x13af0a,_0x4e8d1f){return db['IntegrationReport'][_0x4332('0x44')]({'where':{'id':_0x13af0a[_0x4332('0x40')]['id']}})[_0x4332('0x24')](handleEntityNotFound(_0x4e8d1f,null))['then'](removeEntity(_0x4e8d1f,null))[_0x4332('0x3e')](handleError(_0x4e8d1f,null));};exports[_0x4332('0x45')]=function(_0x73d6e1,_0x5b240a){return db[_0x4332('0x2a')][_0x4332('0x45')]()[_0x4332('0x24')](respondWithResult(_0x5b240a,null))[_0x4332('0x3e')](handleError(_0x5b240a,null));};
\ No newline at end of file
+var _0xf097=['path','sox','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','status','end','undefined','limit','count','offset','set','apply','reject','save','update','destroy','then','stack','name','map','IntegrationReport','rawAttributes','fieldName','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','type','include','findAll','rows','show','params','includeAll','options','find','catch','create','body','describe','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x1f9f37,_0x18776e){var _0x21c080=function(_0x4acb93){while(--_0x4acb93){_0x1f9f37['push'](_0x1f9f37['shift']());}};_0x21c080(++_0x18776e);}(_0xf097,0x1aa));var _0x7f09=function(_0x1010b4,_0x77783f){_0x1010b4=_0x1010b4-0x0;var _0x4b0bac=_0xf097[_0x1010b4];return _0x4b0bac;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7f09('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7f09('0x1'));var rp=require(_0x7f09('0x2'));var moment=require(_0x7f09('0x3'));var BPromise=require(_0x7f09('0x4'));var Mustache=require(_0x7f09('0x5'));var util=require('util');var path=require(_0x7f09('0x6'));var sox=require(_0x7f09('0x7'));var csv=require('to-csv');var ejs=require(_0x7f09('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7f09('0x9'));var squel=require(_0x7f09('0xa'));var crypto=require(_0x7f09('0xb'));var jsforce=require(_0x7f09('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x7f09('0xd'));var querystring=require(_0x7f09('0xe'));var Papa=require(_0x7f09('0xf'));var Redis=require(_0x7f09('0x10'));var authService=require(_0x7f09('0x11'));var qs=require(_0x7f09('0x12'));var as=require(_0x7f09('0x13'));var hardwareService=require(_0x7f09('0x14'));var logger=require('../../config/logger')(_0x7f09('0x15'));var utils=require('../../config/utils');var config=require(_0x7f09('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x7f09('0x17'))['db'];function respondWithStatusCode(_0x15ee59,_0x1b1dc5){_0x1b1dc5=_0x1b1dc5||0xcc;return function(_0xa217de){if(_0xa217de){return _0x15ee59['sendStatus'](_0x1b1dc5);}return _0x15ee59[_0x7f09('0x18')](_0x1b1dc5)[_0x7f09('0x19')]();};}function respondWithResult(_0x2964c7,_0x22785e){_0x22785e=_0x22785e||0xc8;return function(_0x934ce6){if(_0x934ce6){return _0x2964c7[_0x7f09('0x18')](_0x22785e)['json'](_0x934ce6);}};}function respondWithFilteredResult(_0xa054f,_0x12cfb6){return function(_0x5901f3){if(_0x5901f3){var _0x1d2f59=typeof _0x12cfb6['offset']===_0x7f09('0x1a')&&typeof _0x12cfb6[_0x7f09('0x1b')]===_0x7f09('0x1a');var _0x1b446e=_0x5901f3[_0x7f09('0x1c')];var _0x1d8c54=_0x1d2f59?0x0:_0x12cfb6[_0x7f09('0x1d')];var _0x18f64c=_0x1d2f59?_0x5901f3[_0x7f09('0x1c')]:_0x12cfb6[_0x7f09('0x1d')]+_0x12cfb6[_0x7f09('0x1b')];var _0x195d78;if(_0x18f64c>=_0x1b446e){_0x18f64c=_0x1b446e;_0x195d78=0xc8;}else{_0x195d78=0xce;}_0xa054f[_0x7f09('0x18')](_0x195d78);return _0xa054f[_0x7f09('0x1e')]('Content-Range',_0x1d8c54+'-'+_0x18f64c+'/'+_0x1b446e)['json'](_0x5901f3);}return null;};}function patchUpdates(_0x3c98c5){return function(_0xd7200d){try{jsonpatch[_0x7f09('0x1f')](_0xd7200d,_0x3c98c5,!![]);}catch(_0x3086eb){return BPromise[_0x7f09('0x20')](_0x3086eb);}return _0xd7200d[_0x7f09('0x21')]();};}function saveUpdates(_0x113022,_0x4cbfba){return function(_0x42cbdf){if(_0x42cbdf){return _0x42cbdf[_0x7f09('0x22')](_0x113022)['then'](function(_0x1a0c76){return _0x1a0c76;});}return null;};}function removeEntity(_0x49b64d,_0x1ade01){return function(_0x23855b){if(_0x23855b){return _0x23855b[_0x7f09('0x23')]()[_0x7f09('0x24')](function(){_0x49b64d[_0x7f09('0x18')](0xcc)[_0x7f09('0x19')]();});}};}function handleEntityNotFound(_0x46dce1,_0x2cd444){return function(_0x313559){if(!_0x313559){_0x46dce1['sendStatus'](0x194);}return _0x313559;};}function handleError(_0x406350,_0x53e2c7){_0x53e2c7=_0x53e2c7||0x1f4;return function(_0x42c9d0){logger['error'](_0x42c9d0[_0x7f09('0x25')]);if(_0x42c9d0[_0x7f09('0x26')]){delete _0x42c9d0[_0x7f09('0x26')];}_0x406350['status'](_0x53e2c7)['send'](_0x42c9d0);};}exports['index']=function(_0x5b023e,_0x5cd655){var _0x5bdba4={},_0x2bbe35={},_0x294b4b={'count':0x0,'rows':[]};var _0x47cdd2=_[_0x7f09('0x27')](db[_0x7f09('0x28')][_0x7f09('0x29')],function(_0xe22630){return{'name':_0xe22630[_0x7f09('0x2a')],'type':_0xe22630['type'][_0x7f09('0x2b')]};});_0x2bbe35[_0x7f09('0x2c')]=_[_0x7f09('0x27')](_0x47cdd2,'name');_0x2bbe35[_0x7f09('0x2d')]=_[_0x7f09('0x2e')](_0x5b023e[_0x7f09('0x2d')]);_0x2bbe35['filters']=_['intersection'](_0x2bbe35[_0x7f09('0x2c')],_0x2bbe35[_0x7f09('0x2d')]);_0x5bdba4[_0x7f09('0x2f')]=_[_0x7f09('0x30')](_0x2bbe35[_0x7f09('0x2c')],qs[_0x7f09('0x31')](_0x5b023e[_0x7f09('0x2d')]['fields']));_0x5bdba4['attributes']=_0x5bdba4[_0x7f09('0x2f')][_0x7f09('0x32')]?_0x5bdba4[_0x7f09('0x2f')]:_0x2bbe35[_0x7f09('0x2c')];if(!_0x5b023e['query'][_0x7f09('0x33')](_0x7f09('0x34'))){_0x5bdba4[_0x7f09('0x1b')]=qs[_0x7f09('0x1b')](_0x5b023e['query'][_0x7f09('0x1b')]);_0x5bdba4[_0x7f09('0x1d')]=qs['offset'](_0x5b023e[_0x7f09('0x2d')]['offset']);}_0x5bdba4[_0x7f09('0x35')]=qs[_0x7f09('0x36')](_0x5b023e[_0x7f09('0x2d')]['sort']);_0x5bdba4[_0x7f09('0x37')]=qs['filters'](_['pick'](_0x5b023e['query'],_0x2bbe35[_0x7f09('0x38')]),_0x47cdd2);if(_0x5b023e[_0x7f09('0x2d')][_0x7f09('0x39')]){_0x5bdba4[_0x7f09('0x37')]=_[_0x7f09('0x3a')](_0x5bdba4[_0x7f09('0x37')],{'$or':_[_0x7f09('0x27')](_0x47cdd2,function(_0xfef6c4){if(_0xfef6c4[_0x7f09('0x3b')]!=='VIRTUAL'){var _0x10e7e8={};_0x10e7e8[_0xfef6c4['name']]={'$like':'%'+_0x5b023e[_0x7f09('0x2d')]['filter']+'%'};return _0x10e7e8;}})});}_0x5bdba4=_[_0x7f09('0x3a')]({},_0x5bdba4,_0x5b023e['options']);var _0x358ef6={'where':_0x5bdba4['where']};return db[_0x7f09('0x28')]['count'](_0x358ef6)[_0x7f09('0x24')](function(_0x5bac44){_0x294b4b[_0x7f09('0x1c')]=_0x5bac44;if(_0x5b023e['query']['includeAll']){_0x5bdba4[_0x7f09('0x3c')]=[{'all':!![]}];}return db[_0x7f09('0x28')][_0x7f09('0x3d')](_0x5bdba4);})[_0x7f09('0x24')](function(_0x4b0642){_0x294b4b[_0x7f09('0x3e')]=_0x4b0642;return _0x294b4b;})['then'](respondWithFilteredResult(_0x5cd655,_0x5bdba4))['catch'](handleError(_0x5cd655,null));};exports[_0x7f09('0x3f')]=function(_0x34f339,_0x3efd7e){var _0x1061ea={'raw':![],'where':{'id':_0x34f339[_0x7f09('0x40')]['id']}},_0x35ae36={};_0x35ae36[_0x7f09('0x2c')]=_['keys'](db[_0x7f09('0x28')][_0x7f09('0x29')]);_0x35ae36[_0x7f09('0x2d')]=_[_0x7f09('0x2e')](_0x34f339[_0x7f09('0x2d')]);_0x35ae36[_0x7f09('0x38')]=_[_0x7f09('0x30')](_0x35ae36[_0x7f09('0x2c')],_0x35ae36[_0x7f09('0x2d')]);_0x1061ea[_0x7f09('0x2f')]=_[_0x7f09('0x30')](_0x35ae36[_0x7f09('0x2c')],qs[_0x7f09('0x31')](_0x34f339[_0x7f09('0x2d')][_0x7f09('0x31')]));_0x1061ea[_0x7f09('0x2f')]=_0x1061ea[_0x7f09('0x2f')][_0x7f09('0x32')]?_0x1061ea[_0x7f09('0x2f')]:_0x35ae36[_0x7f09('0x2c')];if(_0x34f339['query'][_0x7f09('0x41')]){_0x1061ea['include']=[{'all':!![]}];}_0x1061ea=_[_0x7f09('0x3a')]({},_0x1061ea,_0x34f339[_0x7f09('0x42')]);return db[_0x7f09('0x28')][_0x7f09('0x43')](_0x1061ea)[_0x7f09('0x24')](handleEntityNotFound(_0x3efd7e,null))[_0x7f09('0x24')](respondWithResult(_0x3efd7e,null))[_0x7f09('0x44')](handleError(_0x3efd7e,null));};exports[_0x7f09('0x45')]=function(_0x8cb242,_0x5de781){return db[_0x7f09('0x28')]['create'](_0x8cb242[_0x7f09('0x46')],{})[_0x7f09('0x24')](respondWithResult(_0x5de781,0xc9))[_0x7f09('0x44')](handleError(_0x5de781,null));};exports[_0x7f09('0x22')]=function(_0x8f2600,_0x19a5d7){if(_0x8f2600[_0x7f09('0x46')]['id']){delete _0x8f2600[_0x7f09('0x46')]['id'];}return db[_0x7f09('0x28')][_0x7f09('0x43')]({'where':{'id':_0x8f2600[_0x7f09('0x40')]['id']}})['then'](handleEntityNotFound(_0x19a5d7,null))[_0x7f09('0x24')](saveUpdates(_0x8f2600[_0x7f09('0x46')],null))[_0x7f09('0x24')](respondWithResult(_0x19a5d7,null))[_0x7f09('0x44')](handleError(_0x19a5d7,null));};exports[_0x7f09('0x23')]=function(_0x5de3da,_0x13a30a){return db['IntegrationReport']['find']({'where':{'id':_0x5de3da[_0x7f09('0x40')]['id']}})[_0x7f09('0x24')](handleEntityNotFound(_0x13a30a,null))[_0x7f09('0x24')](removeEntity(_0x13a30a,null))['catch'](handleError(_0x13a30a,null));};exports[_0x7f09('0x47')]=function(_0x5cb1e6,_0x25c99e){return db[_0x7f09('0x28')]['describe']()['then'](respondWithResult(_0x25c99e,null))[_0x7f09('0x44')](handleError(_0x25c99e,null));};
\ No newline at end of file
index 8f6b02d..328c390 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7f6e=['request-promise','rimraf','../../config/environment','./integrationReport.attributes','exports','define','IntegrationReport','report_integration','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x4fde08,_0x463a36){var _0x12e725=function(_0x2670c5){while(--_0x2670c5){_0x4fde08['push'](_0x4fde08['shift']());}};_0x12e725(++_0x463a36);}(_0x7f6e,0x94));var _0xe7f6=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0x7f6e[_0x46aff0];return _0x9d78cf;};'use strict';var _=require(_0xe7f6('0x0'));var util=require(_0xe7f6('0x1'));var logger=require(_0xe7f6('0x2'))(_0xe7f6('0x3'));var moment=require(_0xe7f6('0x4'));var BPromise=require(_0xe7f6('0x5'));var rp=require(_0xe7f6('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe7f6('0x7'));var config=require(_0xe7f6('0x8'));var attributes=require(_0xe7f6('0x9'));module[_0xe7f6('0xa')]=function(_0x52d632,_0x298863){return _0x52d632[_0xe7f6('0xb')](_0xe7f6('0xc'),attributes,{'tableName':_0xe7f6('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x46a5=['bluebird','request-promise','path','rimraf','./integrationReport.attributes','exports','define','IntegrationReport','report_integration','lodash','../../config/logger','api','moment'];(function(_0x5a5f1d,_0x3359d8){var _0x597cf4=function(_0x5456d2){while(--_0x5456d2){_0x5a5f1d['push'](_0x5a5f1d['shift']());}};_0x597cf4(++_0x3359d8);}(_0x46a5,0x7e));var _0x546a=function(_0x3539a4,_0x158e77){_0x3539a4=_0x3539a4-0x0;var _0x292388=_0x46a5[_0x3539a4];return _0x292388;};'use strict';var _=require(_0x546a('0x0'));var util=require('util');var logger=require(_0x546a('0x1'))(_0x546a('0x2'));var moment=require(_0x546a('0x3'));var BPromise=require(_0x546a('0x4'));var rp=require(_0x546a('0x5'));var fs=require('fs');var path=require(_0x546a('0x6'));var rimraf=require(_0x546a('0x7'));var config=require('../../config/environment');var attributes=require(_0x546a('0x8'));module[_0x546a('0x9')]=function(_0x458201,_0xed7103){return _0x458201[_0x546a('0xa')](_0x546a('0xb'),attributes,{'tableName':_0x546a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index f8377c6..1f60448 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5fab=['../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','IntegrationReport,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x43f301,_0x27d61b){var _0x34fd8f=function(_0xcbd6ed){while(--_0xcbd6ed){_0x43f301['push'](_0x43f301['shift']());}};_0x34fd8f(++_0x27d61b);}(_0x5fab,0x177));var _0xb5fa=function(_0x2ab365,_0xa3812e){_0x2ab365=_0x2ab365-0x0;var _0x49fef3=_0x5fab[_0x2ab365];return _0x49fef3;};'use strict';var _=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var moment=require('moment');var BPromise=require(_0xb5fa('0x2'));var rs=require(_0xb5fa('0x3'));var fs=require('fs');var Redis=require(_0xb5fa('0x4'));var db=require(_0xb5fa('0x5'))['db'];var utils=require(_0xb5fa('0x6'));var logger=require(_0xb5fa('0x7'))(_0xb5fa('0x8'));var config=require(_0xb5fa('0x9'));var jayson=require(_0xb5fa('0xa'));var client=jayson[_0xb5fa('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5d70f6,_0x2e3804,_0x1aec3e){return new BPromise(function(_0x9c7bce,_0x56d018){return client[_0xb5fa('0xc')](_0x5d70f6,_0x1aec3e)[_0xb5fa('0xd')](function(_0x2cf4a5){logger['info']('IntegrationReport,\x20%s,\x20%s',_0x2e3804,_0xb5fa('0xe'));logger[_0xb5fa('0xf')](_0xb5fa('0x10'),_0x2e3804,_0xb5fa('0xe'),JSON[_0xb5fa('0x11')](_0x2cf4a5));if(_0x2cf4a5[_0xb5fa('0x12')]){if(_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x13')]===0x1f4){logger[_0xb5fa('0x12')]('IntegrationReport,\x20%s,\x20%s',_0x2e3804,_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);return _0x56d018(_0x2cf4a5['error'][_0xb5fa('0x14')]);}logger['error'](_0xb5fa('0x15'),_0x2e3804,_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);return _0x9c7bce(_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);}else{logger['info']('IntegrationReport,\x20%s,\x20%s',_0x2e3804,_0xb5fa('0xe'));_0x9c7bce(_0x2cf4a5[_0xb5fa('0x16')][_0xb5fa('0x14')]);}})[_0xb5fa('0x17')](function(_0x56fe10){logger['error'](_0xb5fa('0x15'),_0x2e3804,_0x56fe10);_0x56d018(_0x56fe10);});});}
\ No newline at end of file
+var _0x687b=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils'];(function(_0x35e92e,_0x21581b){var _0x1205a8=function(_0x4325d8){while(--_0x4325d8){_0x35e92e['push'](_0x35e92e['shift']());}};_0x1205a8(++_0x21581b);}(_0x687b,0x14a));var _0xb687=function(_0x53b0f8,_0x459130){_0x53b0f8=_0x53b0f8-0x0;var _0x133415=_0x687b[_0x53b0f8];return _0x133415;};'use strict';var _=require(_0xb687('0x0'));var util=require(_0xb687('0x1'));var moment=require(_0xb687('0x2'));var BPromise=require(_0xb687('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb687('0x4'))['db'];var utils=require(_0xb687('0x5'));var logger=require(_0xb687('0x6'))(_0xb687('0x7'));var config=require(_0xb687('0x8'));var jayson=require(_0xb687('0x9'));var client=jayson[_0xb687('0xa')][_0xb687('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x47ffea,_0x27b750,_0x48942b){return new BPromise(function(_0x2aea59,_0xd40346){return client['request'](_0x47ffea,_0x48942b)[_0xb687('0xc')](function(_0x21e3ab){logger[_0xb687('0xd')](_0xb687('0xe'),_0x27b750,_0xb687('0xf'));logger[_0xb687('0x10')](_0xb687('0x11'),_0x27b750,_0xb687('0xf'),JSON[_0xb687('0x12')](_0x21e3ab));if(_0x21e3ab['error']){if(_0x21e3ab[_0xb687('0x13')][_0xb687('0x14')]===0x1f4){logger[_0xb687('0x13')](_0xb687('0xe'),_0x27b750,_0x21e3ab['error']['message']);return _0xd40346(_0x21e3ab[_0xb687('0x13')][_0xb687('0x15')]);}logger['error'](_0xb687('0xe'),_0x27b750,_0x21e3ab[_0xb687('0x13')][_0xb687('0x15')]);return _0x2aea59(_0x21e3ab[_0xb687('0x13')][_0xb687('0x15')]);}else{logger[_0xb687('0xd')](_0xb687('0xe'),_0x27b750,_0xb687('0xf'));_0x2aea59(_0x21e3ab[_0xb687('0x16')][_0xb687('0x15')]);}})[_0xb687('0x17')](function(_0x19bb29){logger['error'](_0xb687('0xe'),_0x27b750,_0x19bb29);_0xd40346(_0x19bb29);});});}
\ No newline at end of file
index ac82202..4e9275a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x31b9=['getIntervals','post','create','/:id/sub_intervals/create_many','addIntervals','put','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./interval.controller','get','isAuthenticated','index','/:id','/:id/sub_intervals'];(function(_0x48c2ae,_0x4cea90){var _0x8f7531=function(_0x126458){while(--_0x126458){_0x48c2ae['push'](_0x48c2ae['shift']());}};_0x8f7531(++_0x4cea90);}(_0x31b9,0x7c));var _0x931b=function(_0x7cf923,_0x2a21f7){_0x7cf923=_0x7cf923-0x0;var _0x48f48b=_0x31b9[_0x7cf923];return _0x48f48b;};'use strict';var multer=require(_0x931b('0x0'));var util=require(_0x931b('0x1'));var path=require('path');var timeout=require(_0x931b('0x2'));var express=require(_0x931b('0x3'));var router=express[_0x931b('0x4')]();var fs_extra=require(_0x931b('0x5'));var auth=require(_0x931b('0x6'));var interaction=require(_0x931b('0x7'));var config=require('../../config/environment');var controller=require(_0x931b('0x8'));router[_0x931b('0x9')]('/',auth[_0x931b('0xa')](),controller[_0x931b('0xb')]);router[_0x931b('0x9')](_0x931b('0xc'),auth[_0x931b('0xa')](),controller['show']);router[_0x931b('0x9')](_0x931b('0xd'),auth[_0x931b('0xa')](),controller[_0x931b('0xe')]);router[_0x931b('0xf')]('/',auth[_0x931b('0xa')](),controller[_0x931b('0x10')]);router[_0x931b('0xf')](_0x931b('0xd'),auth['isAuthenticated'](),controller['addInterval']);router['post'](_0x931b('0x11'),auth[_0x931b('0xa')](),controller[_0x931b('0x12')]);router[_0x931b('0x13')](_0x931b('0xc'),auth[_0x931b('0xa')](),controller['update']);router[_0x931b('0x14')](_0x931b('0xc'),auth['isAuthenticated'](),controller[_0x931b('0x15')]);module[_0x931b('0x16')]=router;
\ No newline at end of file
+var _0xea98=['Router','fs-extra','../../components/auth/service','../../config/environment','./interval.controller','get','isAuthenticated','index','show','/:id/sub_intervals','post','create','addInterval','addIntervals','put','update','delete','destroy','multer','util','path','express'];(function(_0x2e8f08,_0x8a7f2e){var _0x4b5fcb=function(_0x4a4723){while(--_0x4a4723){_0x2e8f08['push'](_0x2e8f08['shift']());}};_0x4b5fcb(++_0x8a7f2e);}(_0xea98,0xd8));var _0x8ea9=function(_0x2c9caa,_0x4ab15f){_0x2c9caa=_0x2c9caa-0x0;var _0x27bf35=_0xea98[_0x2c9caa];return _0x27bf35;};'use strict';var multer=require(_0x8ea9('0x0'));var util=require(_0x8ea9('0x1'));var path=require(_0x8ea9('0x2'));var timeout=require('connect-timeout');var express=require(_0x8ea9('0x3'));var router=express[_0x8ea9('0x4')]();var fs_extra=require(_0x8ea9('0x5'));var auth=require(_0x8ea9('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x8ea9('0x7'));var controller=require(_0x8ea9('0x8'));router[_0x8ea9('0x9')]('/',auth[_0x8ea9('0xa')](),controller[_0x8ea9('0xb')]);router[_0x8ea9('0x9')]('/:id',auth[_0x8ea9('0xa')](),controller[_0x8ea9('0xc')]);router[_0x8ea9('0x9')](_0x8ea9('0xd'),auth[_0x8ea9('0xa')](),controller['getIntervals']);router[_0x8ea9('0xe')]('/',auth[_0x8ea9('0xa')](),controller[_0x8ea9('0xf')]);router[_0x8ea9('0xe')](_0x8ea9('0xd'),auth[_0x8ea9('0xa')](),controller[_0x8ea9('0x10')]);router[_0x8ea9('0xe')]('/:id/sub_intervals/create_many',auth['isAuthenticated'](),controller[_0x8ea9('0x11')]);router[_0x8ea9('0x12')]('/:id',auth[_0x8ea9('0xa')](),controller[_0x8ea9('0x13')]);router[_0x8ea9('0x14')]('/:id',auth[_0x8ea9('0xa')](),controller[_0x8ea9('0x15')]);module['exports']=router;
\ No newline at end of file
index 0987edb..5574b5e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x219e=['sequelize','exports','STRING'];(function(_0x1344d6,_0x2181e6){var _0xf45b24=function(_0x2d90c1){while(--_0x2d90c1){_0x1344d6['push'](_0x1344d6['shift']());}};_0xf45b24(++_0x2181e6);}(_0x219e,0xc9));var _0xe219=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0x219e[_0xbd08b4];return _0x314f1e;};'use strict';var Sequelize=require(_0xe219('0x0'));module[_0xe219('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xe219('0x2')]},'interval':{'type':Sequelize[_0xe219('0x2')],'allowNull':!![]}};
\ No newline at end of file
+var _0xb542=['STRING','sequelize'];(function(_0x32f7d7,_0x54231b){var _0x133d09=function(_0x41a7ab){while(--_0x41a7ab){_0x32f7d7['push'](_0x32f7d7['shift']());}};_0x133d09(++_0x54231b);}(_0xb542,0x6b));var _0x2b54=function(_0x2cba1a,_0x13f55b){_0x2cba1a=_0x2cba1a-0x0;var _0x47e4ab=_0xb542[_0x2cba1a];return _0x47e4ab;};'use strict';var Sequelize=require(_0x2b54('0x0'));module['exports']={'name':{'type':Sequelize[_0x2b54('0x1')]},'description':{'type':Sequelize[_0x2b54('0x1')]},'interval':{'type':Sequelize['STRING'],'allowNull':!![]}};
\ No newline at end of file
index e7c36d4..b351ec4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x92c8=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','../../components/extensions/rewrite','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','update','then','destroy','Intervals','UserProfileResource','end','error','name','index','map','Interval','fieldName','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','rows','catch','show','params','rawAttributes','options','find','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addInterval','IntervalId','create','getIntervals','findOne','addIntervals','sequelize','bulkCreate','findAll','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce'];(function(_0x3b1648,_0x4504c0){var _0x44225e=function(_0x16481a){while(--_0x16481a){_0x3b1648['push'](_0x3b1648['shift']());}};_0x44225e(++_0x4504c0);}(_0x92c8,0xa4));var _0x892c=function(_0x183f33,_0x2b4ba9){_0x183f33=_0x183f33-0x0;var _0x1af642=_0x92c8[_0x183f33];return _0x1af642;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x892c('0x0'));var zipdir=require(_0x892c('0x1'));var jsonpatch=require(_0x892c('0x2'));var rp=require(_0x892c('0x3'));var moment=require('moment');var BPromise=require(_0x892c('0x4'));var Mustache=require(_0x892c('0x5'));var util=require(_0x892c('0x6'));var path=require(_0x892c('0x7'));var sox=require(_0x892c('0x8'));var csv=require(_0x892c('0x9'));var ejs=require(_0x892c('0xa'));var fs=require('fs');var fs_extra=require(_0x892c('0xb'));var _=require(_0x892c('0xc'));var squel=require(_0x892c('0xd'));var crypto=require(_0x892c('0xe'));var jsforce=require(_0x892c('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x892c('0x9'));var querystring=require('querystring');var Papa=require(_0x892c('0x10'));var Redis=require(_0x892c('0x11'));var authService=require(_0x892c('0x12'));var qs=require(_0x892c('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x892c('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x892c('0x15'));var licenseUtil=require(_0x892c('0x16'));var db=require(_0x892c('0x17'))['db'];var extensions=require(_0x892c('0x18'));function respondWithStatusCode(_0x26ac9b,_0x1fe4de){_0x1fe4de=_0x1fe4de||0xcc;return function(_0x222286){if(_0x222286){return _0x26ac9b[_0x892c('0x19')](_0x1fe4de);}return _0x26ac9b[_0x892c('0x1a')](_0x1fe4de)['end']();};}function respondWithResult(_0x4cfb7a,_0xb3d507){_0xb3d507=_0xb3d507||0xc8;return function(_0x280c2e){if(_0x280c2e){return _0x4cfb7a[_0x892c('0x1a')](_0xb3d507)[_0x892c('0x1b')](_0x280c2e);}};}function respondWithFilteredResult(_0x3351b9,_0x139632){return function(_0x1fda19){if(_0x1fda19){var _0x3fe8db=typeof _0x139632[_0x892c('0x1c')]===_0x892c('0x1d')&&typeof _0x139632['limit']===_0x892c('0x1d');var _0x38ad16=_0x1fda19['count'];var _0x507c14=_0x3fe8db?0x0:_0x139632[_0x892c('0x1c')];var _0x5b7199=_0x3fe8db?_0x1fda19[_0x892c('0x1e')]:_0x139632['offset']+_0x139632[_0x892c('0x1f')];var _0xd4e5e7;if(_0x5b7199>=_0x38ad16){_0x5b7199=_0x38ad16;_0xd4e5e7=0xc8;}else{_0xd4e5e7=0xce;}_0x3351b9[_0x892c('0x1a')](_0xd4e5e7);return _0x3351b9[_0x892c('0x20')](_0x892c('0x21'),_0x507c14+'-'+_0x5b7199+'/'+_0x38ad16)[_0x892c('0x1b')](_0x1fda19);}return null;};}function patchUpdates(_0x10c433){return function(_0x475881){try{jsonpatch[_0x892c('0x22')](_0x475881,_0x10c433,!![]);}catch(_0x2abc25){return BPromise['reject'](_0x2abc25);}return _0x475881['save']();};}function saveUpdates(_0x1c15f9,_0x54c15c){return function(_0x1c9da2){if(_0x1c9da2){return _0x1c9da2[_0x892c('0x23')](_0x1c15f9)[_0x892c('0x24')](function(_0x4434d9){return _0x4434d9;});}return null;};}function removeEntity(_0x2556da,_0x5eff15){return function(_0x36aaca){if(_0x36aaca){return _0x36aaca[_0x892c('0x25')]()[_0x892c('0x24')](function(){var _0x273d39=_0x36aaca['get']({'plain':!![]});var _0x5c0728=_0x892c('0x26');return db[_0x892c('0x27')][_0x892c('0x25')]({'where':{'type':_0x5c0728,'resourceId':_0x273d39['id']}})[_0x892c('0x24')](function(){return _0x36aaca;});})[_0x892c('0x24')](function(){_0x2556da['status'](0xcc)[_0x892c('0x28')]();});}};}function handleEntityNotFound(_0x55ff5a,_0x24455d){return function(_0x1bc77f){if(!_0x1bc77f){_0x55ff5a['sendStatus'](0x194);}return _0x1bc77f;};}function handleError(_0x413066,_0x20dda3){_0x20dda3=_0x20dda3||0x1f4;return function(_0x431e7b){logger[_0x892c('0x29')](_0x431e7b['stack']);if(_0x431e7b[_0x892c('0x2a')]){delete _0x431e7b['name'];}_0x413066['status'](_0x20dda3)['send'](_0x431e7b);};}exports[_0x892c('0x2b')]=function(_0x304e2d,_0x39bd01){var _0x130165={},_0x4a4ef1={},_0x4b2569={'count':0x0,'rows':[]};var _0x354248=_[_0x892c('0x2c')](db[_0x892c('0x2d')]['rawAttributes'],function(_0xd62240){return{'name':_0xd62240[_0x892c('0x2e')],'type':_0xd62240['type']['key']};});_0x4a4ef1[_0x892c('0x2f')]=_[_0x892c('0x2c')](_0x354248,_0x892c('0x2a'));_0x4a4ef1['query']=_[_0x892c('0x30')](_0x304e2d[_0x892c('0x31')]);_0x4a4ef1[_0x892c('0x32')]=_[_0x892c('0x33')](_0x4a4ef1[_0x892c('0x2f')],_0x4a4ef1[_0x892c('0x31')]);_0x130165[_0x892c('0x34')]=_[_0x892c('0x33')](_0x4a4ef1[_0x892c('0x2f')],qs[_0x892c('0x35')](_0x304e2d[_0x892c('0x31')][_0x892c('0x35')]));_0x130165[_0x892c('0x34')]=_0x130165[_0x892c('0x34')][_0x892c('0x36')]?_0x130165[_0x892c('0x34')]:_0x4a4ef1[_0x892c('0x2f')];if(!_0x304e2d['query'][_0x892c('0x37')](_0x892c('0x38'))){_0x130165[_0x892c('0x1f')]=qs['limit'](_0x304e2d[_0x892c('0x31')][_0x892c('0x1f')]);_0x130165[_0x892c('0x1c')]=qs['offset'](_0x304e2d[_0x892c('0x31')][_0x892c('0x1c')]);}_0x130165[_0x892c('0x39')]=qs[_0x892c('0x3a')](_0x304e2d[_0x892c('0x31')]['sort']);_0x130165[_0x892c('0x3b')]=qs['filters'](_[_0x892c('0x3c')](_0x304e2d[_0x892c('0x31')],_0x4a4ef1[_0x892c('0x32')]),_0x354248);if(_0x304e2d[_0x892c('0x31')][_0x892c('0x3d')]){_0x130165[_0x892c('0x3b')]=_[_0x892c('0x3e')](_0x130165[_0x892c('0x3b')],{'$or':_['map'](_0x354248,function(_0x3e266c){if(_0x3e266c[_0x892c('0x3f')]!==_0x892c('0x40')){var _0x499810={};_0x499810[_0x3e266c[_0x892c('0x2a')]]={'$like':'%'+_0x304e2d[_0x892c('0x31')][_0x892c('0x3d')]+'%'};return _0x499810;}})});}_0x130165=_[_0x892c('0x3e')]({},_0x130165,_0x304e2d['options']);var _0x11362a={'where':_0x130165['where']};return db[_0x892c('0x2d')][_0x892c('0x1e')](_0x11362a)[_0x892c('0x24')](function(_0x219258){_0x4b2569[_0x892c('0x1e')]=_0x219258;if(_0x304e2d[_0x892c('0x31')][_0x892c('0x41')]){_0x130165[_0x892c('0x42')]=[{'all':!![]}];}return db[_0x892c('0x2d')]['findAll'](_0x130165);})[_0x892c('0x24')](function(_0x4e6e59){_0x4b2569[_0x892c('0x43')]=_0x4e6e59;return _0x4b2569;})['then'](respondWithFilteredResult(_0x39bd01,_0x130165))[_0x892c('0x44')](handleError(_0x39bd01,null));};exports[_0x892c('0x45')]=function(_0x4fa39f,_0x4cd948){var _0xad0533={'raw':!![],'where':{'id':_0x4fa39f[_0x892c('0x46')]['id']}},_0x18d79f={};_0x18d79f[_0x892c('0x2f')]=_[_0x892c('0x30')](db[_0x892c('0x2d')][_0x892c('0x47')]);_0x18d79f[_0x892c('0x31')]=_['keys'](_0x4fa39f[_0x892c('0x31')]);_0x18d79f[_0x892c('0x32')]=_['intersection'](_0x18d79f['model'],_0x18d79f[_0x892c('0x31')]);_0xad0533[_0x892c('0x34')]=_['intersection'](_0x18d79f[_0x892c('0x2f')],qs['fields'](_0x4fa39f['query'][_0x892c('0x35')]));_0xad0533[_0x892c('0x34')]=_0xad0533[_0x892c('0x34')][_0x892c('0x36')]?_0xad0533[_0x892c('0x34')]:_0x18d79f['model'];if(_0x4fa39f[_0x892c('0x31')]['includeAll']){_0xad0533[_0x892c('0x42')]=[{'all':!![]}];}_0xad0533=_[_0x892c('0x3e')]({},_0xad0533,_0x4fa39f[_0x892c('0x48')]);return db[_0x892c('0x2d')][_0x892c('0x49')](_0xad0533)[_0x892c('0x24')](handleEntityNotFound(_0x4cd948,null))[_0x892c('0x24')](respondWithResult(_0x4cd948,null))['catch'](handleError(_0x4cd948,null));};exports['create']=function(_0x3f2f1f,_0x50ff4c){return db[_0x892c('0x2d')]['create'](_0x3f2f1f[_0x892c('0x4a')],{})[_0x892c('0x24')](function(_0xb20de8){var _0x5df7f6=_0x3f2f1f[_0x892c('0x4b')][_0x892c('0x4c')]({'plain':!![]});if(!_0x5df7f6)throw new Error(_0x892c('0x4d'));if(_0x5df7f6[_0x892c('0x4e')]===_0x892c('0x4b')){var _0x51e1e4=_0xb20de8[_0x892c('0x4c')]({'plain':!![]});var _0x502695=_0x892c('0x26');return db['UserProfileSection'][_0x892c('0x49')]({'where':{'name':_0x502695,'userProfileId':_0x5df7f6['userProfileId']},'raw':!![]})[_0x892c('0x24')](function(_0x4af9d6){if(_0x4af9d6&&_0x4af9d6[_0x892c('0x4f')]===0x0){return db[_0x892c('0x27')]['create']({'name':_0x51e1e4[_0x892c('0x2a')],'resourceId':_0x51e1e4['id'],'type':_0x4af9d6[_0x892c('0x2a')],'sectionId':_0x4af9d6['id']},{})[_0x892c('0x24')](function(){return _0xb20de8;});}else{return _0xb20de8;}})[_0x892c('0x44')](function(_0x4ab7ed){logger[_0x892c('0x29')](_0x892c('0x50'),_0x4ab7ed);throw _0x4ab7ed;});}return _0xb20de8;})[_0x892c('0x24')](respondWithResult(_0x50ff4c,0xc9))[_0x892c('0x44')](handleError(_0x50ff4c,null));};exports[_0x892c('0x23')]=function(_0x300c0e,_0xc3a823){if(_0x300c0e[_0x892c('0x4a')]['id']){delete _0x300c0e['body']['id'];}return db[_0x892c('0x2d')][_0x892c('0x49')]({'where':{'id':_0x300c0e[_0x892c('0x46')]['id']}})[_0x892c('0x24')](handleEntityNotFound(_0xc3a823,null))[_0x892c('0x24')](saveUpdates(_0x300c0e[_0x892c('0x4a')],null))[_0x892c('0x24')](respondWithResult(_0xc3a823,null))[_0x892c('0x44')](handleError(_0xc3a823,null));};exports[_0x892c('0x25')]=function(_0x13029d,_0xb2f48c){return db[_0x892c('0x2d')][_0x892c('0x49')]({'where':{'id':_0x13029d['params']['id']}})[_0x892c('0x24')](handleEntityNotFound(_0xb2f48c,null))[_0x892c('0x24')](removeEntity(_0xb2f48c,null))['catch'](handleError(_0xb2f48c,null));};exports[_0x892c('0x51')]=function(_0x34d5fc,_0x5f136e,_0xbe8839){if(_0x34d5fc[_0x892c('0x4a')]['id']){delete _0x34d5fc[_0x892c('0x4a')]['id'];}return db['Interval'][_0x892c('0x49')]({'where':{'id':_0x34d5fc[_0x892c('0x46')]['id']}})[_0x892c('0x24')](handleEntityNotFound(_0x5f136e,null))['then'](function(_0x1ae030){if(_0x1ae030){_0x34d5fc[_0x892c('0x4a')][_0x892c('0x52')]=_0x1ae030['id'];return db[_0x892c('0x2d')][_0x892c('0x53')](_0x34d5fc[_0x892c('0x4a')]);}})[_0x892c('0x24')](respondWithResult(_0x5f136e,null))[_0x892c('0x44')](handleError(_0x5f136e,null));};exports[_0x892c('0x54')]=function(_0x1bd4a5,_0x4a1e44,_0x2f0252){var _0x11fba3={};var _0x2f2a5f={};var _0x21e3e9;var _0x4eb46e;return db['Interval'][_0x892c('0x55')]({'where':{'id':_0x1bd4a5[_0x892c('0x46')]['id']}})['then'](handleEntityNotFound(_0x4a1e44,null))[_0x892c('0x24')](function(_0x18d966){if(_0x18d966){_0x21e3e9=_0x18d966;_0x2f2a5f[_0x892c('0x2f')]=_[_0x892c('0x30')](db[_0x892c('0x2d')][_0x892c('0x47')]);_0x2f2a5f[_0x892c('0x31')]=_['keys'](_0x1bd4a5[_0x892c('0x31')]);_0x2f2a5f[_0x892c('0x32')]=_[_0x892c('0x33')](_0x2f2a5f[_0x892c('0x2f')],_0x2f2a5f[_0x892c('0x31')]);_0x11fba3[_0x892c('0x34')]=_[_0x892c('0x33')](_0x2f2a5f['model'],qs['fields'](_0x1bd4a5[_0x892c('0x31')][_0x892c('0x35')]));_0x11fba3[_0x892c('0x34')]=_0x11fba3[_0x892c('0x34')][_0x892c('0x36')]?_0x11fba3['attributes']:_0x2f2a5f[_0x892c('0x2f')];_0x11fba3[_0x892c('0x39')]=qs['sort'](_0x1bd4a5[_0x892c('0x31')][_0x892c('0x3a')]);_0x11fba3['where']=qs[_0x892c('0x32')](_[_0x892c('0x3c')](_0x1bd4a5[_0x892c('0x31')],_0x2f2a5f[_0x892c('0x32')]));if(_0x1bd4a5[_0x892c('0x31')]['filter']){_0x11fba3[_0x892c('0x3b')]=_['merge'](_0x11fba3[_0x892c('0x3b')],{'$or':_[_0x892c('0x2c')](_0x11fba3['attributes'],function(_0x49129c){var _0x45ab1e={};_0x45ab1e[_0x49129c]={'$like':'%'+_0x1bd4a5['query'][_0x892c('0x3d')]+'%'};return _0x45ab1e;})});}_0x11fba3=_[_0x892c('0x3e')]({},_0x11fba3,_0x1bd4a5[_0x892c('0x48')]);return _0x21e3e9[_0x892c('0x54')](_0x11fba3);}})[_0x892c('0x24')](function(_0x11f4db){if(_0x11f4db){_0x4eb46e=_0x11f4db[_0x892c('0x36')];if(!_0x1bd4a5[_0x892c('0x31')][_0x892c('0x37')](_0x892c('0x38'))){_0x11fba3[_0x892c('0x1f')]=qs[_0x892c('0x1f')](_0x1bd4a5['query'][_0x892c('0x1f')]);_0x11fba3[_0x892c('0x1c')]=qs[_0x892c('0x1c')](_0x1bd4a5[_0x892c('0x31')][_0x892c('0x1c')]);}return _0x21e3e9[_0x892c('0x54')](_0x11fba3);}})['then'](function(_0x315094){if(_0x315094){return _0x315094?{'count':_0x4eb46e,'rows':_0x315094}:null;}})['then'](respondWithResult(_0x4a1e44,null))[_0x892c('0x44')](handleError(_0x4a1e44,null));};exports[_0x892c('0x56')]=function(_0x1f99e5,_0x2c48bc,_0x2bc658){return db[_0x892c('0x2d')][_0x892c('0x55')]({'where':{'id':_0x1f99e5['params']['id']}})[_0x892c('0x24')](handleEntityNotFound(_0x2c48bc,null))[_0x892c('0x24')](function(_0x346388){if(_0x346388){return db[_0x892c('0x57')]['transaction'](function(_0x23a888){return db['Interval'][_0x892c('0x25')]({'where':{'IntervalId':_0x1f99e5[_0x892c('0x46')]['id']},'transaction':_0x23a888})[_0x892c('0x24')](function(_0x5b2e28){var _0x4e102a=_[_0x892c('0x2c')](_0x1f99e5[_0x892c('0x4a')],function(_0x569b4f){delete _0x569b4f['id'];_0x569b4f['IntervalId']=_0x1f99e5['params']['id'];return _0x569b4f;});return db[_0x892c('0x2d')][_0x892c('0x58')](_0x4e102a,{'transaction':_0x23a888});});})[_0x892c('0x24')](function(){return db['Interval'][_0x892c('0x59')]({'where':{'IntervalId':_0x1f99e5[_0x892c('0x46')]['id']}});});}})['then'](respondWithResult(_0x2c48bc,null))[_0x892c('0x44')](handleError(_0x2c48bc,null));};
\ No newline at end of file
+var _0xf2e4=['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/environment','../../config/license/util','../../mysqldb','../../components/extensions/rewrite','sendStatus','end','status','offset','undefined','limit','count','set','json','apply','reject','save','update','destroy','then','get','Intervals','error','stack','name','send','map','Interval','rawAttributes','fieldName','type','key','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','show','keys','find','catch','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','params','getIntervals','findOne','addIntervals','sequelize','transaction','IntervalId','bulkCreate','findAll','rimraf','fast-json-patch','request-promise','moment','bluebird','util'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0xf2e4,0x17a));var _0x4f2e=function(_0x243d26,_0x36a724){_0x243d26=_0x243d26-0x0;var _0x187c2d=_0xf2e4[_0x243d26];return _0x187c2d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4f2e('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4f2e('0x1'));var rp=require(_0x4f2e('0x2'));var moment=require(_0x4f2e('0x3'));var BPromise=require(_0x4f2e('0x4'));var Mustache=require('mustache');var util=require(_0x4f2e('0x5'));var path=require(_0x4f2e('0x6'));var sox=require(_0x4f2e('0x7'));var csv=require(_0x4f2e('0x8'));var ejs=require(_0x4f2e('0x9'));var fs=require('fs');var fs_extra=require(_0x4f2e('0xa'));var _=require(_0x4f2e('0xb'));var squel=require(_0x4f2e('0xc'));var crypto=require(_0x4f2e('0xd'));var jsforce=require(_0x4f2e('0xe'));var deskjs=require(_0x4f2e('0xf'));var toCsv=require(_0x4f2e('0x8'));var querystring=require(_0x4f2e('0x10'));var Papa=require(_0x4f2e('0x11'));var Redis=require(_0x4f2e('0x12'));var authService=require(_0x4f2e('0x13'));var qs=require(_0x4f2e('0x14'));var as=require(_0x4f2e('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4f2e('0x16'))(_0x4f2e('0x17'));var utils=require('../../config/utils');var config=require(_0x4f2e('0x18'));var licenseUtil=require(_0x4f2e('0x19'));var db=require(_0x4f2e('0x1a'))['db'];var extensions=require(_0x4f2e('0x1b'));function respondWithStatusCode(_0x382a2e,_0x1d73e5){_0x1d73e5=_0x1d73e5||0xcc;return function(_0x342609){if(_0x342609){return _0x382a2e[_0x4f2e('0x1c')](_0x1d73e5);}return _0x382a2e['status'](_0x1d73e5)[_0x4f2e('0x1d')]();};}function respondWithResult(_0x553683,_0x4d26da){_0x4d26da=_0x4d26da||0xc8;return function(_0x485de7){if(_0x485de7){return _0x553683[_0x4f2e('0x1e')](_0x4d26da)['json'](_0x485de7);}};}function respondWithFilteredResult(_0x114902,_0x2cb02b){return function(_0x170a99){if(_0x170a99){var _0x3b4e53=typeof _0x2cb02b[_0x4f2e('0x1f')]===_0x4f2e('0x20')&&typeof _0x2cb02b[_0x4f2e('0x21')]==='undefined';var _0x2cddc5=_0x170a99['count'];var _0x112b96=_0x3b4e53?0x0:_0x2cb02b['offset'];var _0xa0a03f=_0x3b4e53?_0x170a99[_0x4f2e('0x22')]:_0x2cb02b[_0x4f2e('0x1f')]+_0x2cb02b[_0x4f2e('0x21')];var _0x214719;if(_0xa0a03f>=_0x2cddc5){_0xa0a03f=_0x2cddc5;_0x214719=0xc8;}else{_0x214719=0xce;}_0x114902[_0x4f2e('0x1e')](_0x214719);return _0x114902[_0x4f2e('0x23')]('Content-Range',_0x112b96+'-'+_0xa0a03f+'/'+_0x2cddc5)[_0x4f2e('0x24')](_0x170a99);}return null;};}function patchUpdates(_0x55e50c){return function(_0x5874d1){try{jsonpatch[_0x4f2e('0x25')](_0x5874d1,_0x55e50c,!![]);}catch(_0x947b8){return BPromise[_0x4f2e('0x26')](_0x947b8);}return _0x5874d1[_0x4f2e('0x27')]();};}function saveUpdates(_0x50d71a,_0x525667){return function(_0x92e108){if(_0x92e108){return _0x92e108[_0x4f2e('0x28')](_0x50d71a)['then'](function(_0x5ae2c6){return _0x5ae2c6;});}return null;};}function removeEntity(_0x465d64,_0x30f428){return function(_0x37863b){if(_0x37863b){return _0x37863b[_0x4f2e('0x29')]()[_0x4f2e('0x2a')](function(){var _0x2ebb61=_0x37863b[_0x4f2e('0x2b')]({'plain':!![]});var _0x2be284=_0x4f2e('0x2c');return db['UserProfileResource'][_0x4f2e('0x29')]({'where':{'type':_0x2be284,'resourceId':_0x2ebb61['id']}})[_0x4f2e('0x2a')](function(){return _0x37863b;});})[_0x4f2e('0x2a')](function(){_0x465d64[_0x4f2e('0x1e')](0xcc)[_0x4f2e('0x1d')]();});}};}function handleEntityNotFound(_0x293990,_0x2c8f32){return function(_0x3f90e3){if(!_0x3f90e3){_0x293990[_0x4f2e('0x1c')](0x194);}return _0x3f90e3;};}function handleError(_0x3703b7,_0x29a001){_0x29a001=_0x29a001||0x1f4;return function(_0x137982){logger[_0x4f2e('0x2d')](_0x137982[_0x4f2e('0x2e')]);if(_0x137982[_0x4f2e('0x2f')]){delete _0x137982[_0x4f2e('0x2f')];}_0x3703b7[_0x4f2e('0x1e')](_0x29a001)[_0x4f2e('0x30')](_0x137982);};}exports['index']=function(_0x4205c5,_0x42fef9){var _0x1fab16={},_0x367126={},_0x502cdf={'count':0x0,'rows':[]};var _0x30315c=_[_0x4f2e('0x31')](db[_0x4f2e('0x32')][_0x4f2e('0x33')],function(_0x437c14){return{'name':_0x437c14[_0x4f2e('0x34')],'type':_0x437c14[_0x4f2e('0x35')][_0x4f2e('0x36')]};});_0x367126[_0x4f2e('0x37')]=_[_0x4f2e('0x31')](_0x30315c,'name');_0x367126[_0x4f2e('0x38')]=_['keys'](_0x4205c5[_0x4f2e('0x38')]);_0x367126['filters']=_[_0x4f2e('0x39')](_0x367126[_0x4f2e('0x37')],_0x367126[_0x4f2e('0x38')]);_0x1fab16['attributes']=_['intersection'](_0x367126[_0x4f2e('0x37')],qs['fields'](_0x4205c5['query'][_0x4f2e('0x3a')]));_0x1fab16['attributes']=_0x1fab16[_0x4f2e('0x3b')][_0x4f2e('0x3c')]?_0x1fab16[_0x4f2e('0x3b')]:_0x367126[_0x4f2e('0x37')];if(!_0x4205c5[_0x4f2e('0x38')][_0x4f2e('0x3d')](_0x4f2e('0x3e'))){_0x1fab16['limit']=qs[_0x4f2e('0x21')](_0x4205c5[_0x4f2e('0x38')]['limit']);_0x1fab16[_0x4f2e('0x1f')]=qs[_0x4f2e('0x1f')](_0x4205c5[_0x4f2e('0x38')][_0x4f2e('0x1f')]);}_0x1fab16[_0x4f2e('0x3f')]=qs['sort'](_0x4205c5[_0x4f2e('0x38')][_0x4f2e('0x40')]);_0x1fab16[_0x4f2e('0x41')]=qs[_0x4f2e('0x42')](_[_0x4f2e('0x43')](_0x4205c5[_0x4f2e('0x38')],_0x367126[_0x4f2e('0x42')]),_0x30315c);if(_0x4205c5[_0x4f2e('0x38')][_0x4f2e('0x44')]){_0x1fab16[_0x4f2e('0x41')]=_[_0x4f2e('0x45')](_0x1fab16[_0x4f2e('0x41')],{'$or':_[_0x4f2e('0x31')](_0x30315c,function(_0x390535){if(_0x390535['type']!==_0x4f2e('0x46')){var _0x4f8b0d={};_0x4f8b0d[_0x390535[_0x4f2e('0x2f')]]={'$like':'%'+_0x4205c5[_0x4f2e('0x38')][_0x4f2e('0x44')]+'%'};return _0x4f8b0d;}})});}_0x1fab16=_['merge']({},_0x1fab16,_0x4205c5[_0x4f2e('0x47')]);var _0x562da1={'where':_0x1fab16['where']};return db[_0x4f2e('0x32')]['count'](_0x562da1)[_0x4f2e('0x2a')](function(_0x162919){_0x502cdf['count']=_0x162919;if(_0x4205c5[_0x4f2e('0x38')][_0x4f2e('0x48')]){_0x1fab16[_0x4f2e('0x49')]=[{'all':!![]}];}return db[_0x4f2e('0x32')]['findAll'](_0x1fab16);})['then'](function(_0x315e34){_0x502cdf[_0x4f2e('0x4a')]=_0x315e34;return _0x502cdf;})[_0x4f2e('0x2a')](respondWithFilteredResult(_0x42fef9,_0x1fab16))['catch'](handleError(_0x42fef9,null));};exports[_0x4f2e('0x4b')]=function(_0x4ae3e8,_0x108c3d){var _0x58400a={'raw':!![],'where':{'id':_0x4ae3e8['params']['id']}},_0x43b3d1={};_0x43b3d1[_0x4f2e('0x37')]=_['keys'](db['Interval'][_0x4f2e('0x33')]);_0x43b3d1[_0x4f2e('0x38')]=_[_0x4f2e('0x4c')](_0x4ae3e8[_0x4f2e('0x38')]);_0x43b3d1[_0x4f2e('0x42')]=_[_0x4f2e('0x39')](_0x43b3d1['model'],_0x43b3d1['query']);_0x58400a['attributes']=_[_0x4f2e('0x39')](_0x43b3d1[_0x4f2e('0x37')],qs[_0x4f2e('0x3a')](_0x4ae3e8['query'][_0x4f2e('0x3a')]));_0x58400a['attributes']=_0x58400a[_0x4f2e('0x3b')][_0x4f2e('0x3c')]?_0x58400a[_0x4f2e('0x3b')]:_0x43b3d1['model'];if(_0x4ae3e8['query'][_0x4f2e('0x48')]){_0x58400a['include']=[{'all':!![]}];}_0x58400a=_[_0x4f2e('0x45')]({},_0x58400a,_0x4ae3e8[_0x4f2e('0x47')]);return db['Interval'][_0x4f2e('0x4d')](_0x58400a)[_0x4f2e('0x2a')](handleEntityNotFound(_0x108c3d,null))[_0x4f2e('0x2a')](respondWithResult(_0x108c3d,null))[_0x4f2e('0x4e')](handleError(_0x108c3d,null));};exports['create']=function(_0x369da5,_0x1629c0){return db['Interval'][_0x4f2e('0x4f')](_0x369da5[_0x4f2e('0x50')],{})[_0x4f2e('0x2a')](function(_0x39c227){var _0x4be669=_0x369da5[_0x4f2e('0x51')][_0x4f2e('0x2b')]({'plain':!![]});if(!_0x4be669)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4be669[_0x4f2e('0x52')]===_0x4f2e('0x51')){var _0x4d8eb9=_0x39c227[_0x4f2e('0x2b')]({'plain':!![]});var _0x410a40=_0x4f2e('0x2c');return db[_0x4f2e('0x53')][_0x4f2e('0x4d')]({'where':{'name':_0x410a40,'userProfileId':_0x4be669[_0x4f2e('0x54')]},'raw':!![]})[_0x4f2e('0x2a')](function(_0x3c9823){if(_0x3c9823&&_0x3c9823[_0x4f2e('0x55')]===0x0){return db[_0x4f2e('0x56')][_0x4f2e('0x4f')]({'name':_0x4d8eb9[_0x4f2e('0x2f')],'resourceId':_0x4d8eb9['id'],'type':_0x3c9823[_0x4f2e('0x2f')],'sectionId':_0x3c9823['id']},{})['then'](function(){return _0x39c227;});}else{return _0x39c227;}})['catch'](function(_0x4a04fd){logger[_0x4f2e('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4a04fd);throw _0x4a04fd;});}return _0x39c227;})[_0x4f2e('0x2a')](respondWithResult(_0x1629c0,0xc9))[_0x4f2e('0x4e')](handleError(_0x1629c0,null));};exports['update']=function(_0x450c5a,_0x290634){if(_0x450c5a[_0x4f2e('0x50')]['id']){delete _0x450c5a['body']['id'];}return db['Interval'][_0x4f2e('0x4d')]({'where':{'id':_0x450c5a[_0x4f2e('0x57')]['id']}})[_0x4f2e('0x2a')](handleEntityNotFound(_0x290634,null))[_0x4f2e('0x2a')](saveUpdates(_0x450c5a[_0x4f2e('0x50')],null))[_0x4f2e('0x2a')](respondWithResult(_0x290634,null))[_0x4f2e('0x4e')](handleError(_0x290634,null));};exports['destroy']=function(_0x59a140,_0x32828e){return db['Interval'][_0x4f2e('0x4d')]({'where':{'id':_0x59a140[_0x4f2e('0x57')]['id']}})['then'](handleEntityNotFound(_0x32828e,null))[_0x4f2e('0x2a')](removeEntity(_0x32828e,null))[_0x4f2e('0x4e')](handleError(_0x32828e,null));};exports['addInterval']=function(_0x4a6fd1,_0xdd461a,_0x42e1dd){if(_0x4a6fd1[_0x4f2e('0x50')]['id']){delete _0x4a6fd1[_0x4f2e('0x50')]['id'];}return db['Interval'][_0x4f2e('0x4d')]({'where':{'id':_0x4a6fd1[_0x4f2e('0x57')]['id']}})[_0x4f2e('0x2a')](handleEntityNotFound(_0xdd461a,null))['then'](function(_0x385229){if(_0x385229){_0x4a6fd1[_0x4f2e('0x50')]['IntervalId']=_0x385229['id'];return db[_0x4f2e('0x32')][_0x4f2e('0x4f')](_0x4a6fd1[_0x4f2e('0x50')]);}})[_0x4f2e('0x2a')](respondWithResult(_0xdd461a,null))[_0x4f2e('0x4e')](handleError(_0xdd461a,null));};exports[_0x4f2e('0x58')]=function(_0x3811c4,_0x327dc9,_0x5176cc){var _0x45abc5={};var _0x5e6a72={};var _0x4f81da;var _0x1ef073;return db[_0x4f2e('0x32')][_0x4f2e('0x59')]({'where':{'id':_0x3811c4['params']['id']}})[_0x4f2e('0x2a')](handleEntityNotFound(_0x327dc9,null))[_0x4f2e('0x2a')](function(_0x4036b6){if(_0x4036b6){_0x4f81da=_0x4036b6;_0x5e6a72[_0x4f2e('0x37')]=_[_0x4f2e('0x4c')](db[_0x4f2e('0x32')][_0x4f2e('0x33')]);_0x5e6a72[_0x4f2e('0x38')]=_[_0x4f2e('0x4c')](_0x3811c4['query']);_0x5e6a72[_0x4f2e('0x42')]=_[_0x4f2e('0x39')](_0x5e6a72[_0x4f2e('0x37')],_0x5e6a72['query']);_0x45abc5[_0x4f2e('0x3b')]=_[_0x4f2e('0x39')](_0x5e6a72[_0x4f2e('0x37')],qs[_0x4f2e('0x3a')](_0x3811c4['query']['fields']));_0x45abc5[_0x4f2e('0x3b')]=_0x45abc5[_0x4f2e('0x3b')][_0x4f2e('0x3c')]?_0x45abc5[_0x4f2e('0x3b')]:_0x5e6a72[_0x4f2e('0x37')];_0x45abc5[_0x4f2e('0x3f')]=qs['sort'](_0x3811c4[_0x4f2e('0x38')][_0x4f2e('0x40')]);_0x45abc5['where']=qs[_0x4f2e('0x42')](_[_0x4f2e('0x43')](_0x3811c4[_0x4f2e('0x38')],_0x5e6a72[_0x4f2e('0x42')]));if(_0x3811c4['query'][_0x4f2e('0x44')]){_0x45abc5[_0x4f2e('0x41')]=_[_0x4f2e('0x45')](_0x45abc5[_0x4f2e('0x41')],{'$or':_[_0x4f2e('0x31')](_0x45abc5[_0x4f2e('0x3b')],function(_0x24824c){var _0x5cbfb8={};_0x5cbfb8[_0x24824c]={'$like':'%'+_0x3811c4[_0x4f2e('0x38')]['filter']+'%'};return _0x5cbfb8;})});}_0x45abc5=_[_0x4f2e('0x45')]({},_0x45abc5,_0x3811c4[_0x4f2e('0x47')]);return _0x4f81da['getIntervals'](_0x45abc5);}})['then'](function(_0x1f8273){if(_0x1f8273){_0x1ef073=_0x1f8273[_0x4f2e('0x3c')];if(!_0x3811c4[_0x4f2e('0x38')][_0x4f2e('0x3d')](_0x4f2e('0x3e'))){_0x45abc5['limit']=qs['limit'](_0x3811c4[_0x4f2e('0x38')][_0x4f2e('0x21')]);_0x45abc5[_0x4f2e('0x1f')]=qs[_0x4f2e('0x1f')](_0x3811c4[_0x4f2e('0x38')][_0x4f2e('0x1f')]);}return _0x4f81da[_0x4f2e('0x58')](_0x45abc5);}})[_0x4f2e('0x2a')](function(_0x350fb8){if(_0x350fb8){return _0x350fb8?{'count':_0x1ef073,'rows':_0x350fb8}:null;}})[_0x4f2e('0x2a')](respondWithResult(_0x327dc9,null))[_0x4f2e('0x4e')](handleError(_0x327dc9,null));};exports[_0x4f2e('0x5a')]=function(_0x53c09e,_0x7c803d,_0x39b1c9){return db[_0x4f2e('0x32')]['findOne']({'where':{'id':_0x53c09e[_0x4f2e('0x57')]['id']}})[_0x4f2e('0x2a')](handleEntityNotFound(_0x7c803d,null))[_0x4f2e('0x2a')](function(_0x3e245f){if(_0x3e245f){return db[_0x4f2e('0x5b')][_0x4f2e('0x5c')](function(_0x38ca36){return db[_0x4f2e('0x32')][_0x4f2e('0x29')]({'where':{'IntervalId':_0x53c09e[_0x4f2e('0x57')]['id']},'transaction':_0x38ca36})[_0x4f2e('0x2a')](function(_0x49cb00){var _0x577686=_[_0x4f2e('0x31')](_0x53c09e[_0x4f2e('0x50')],function(_0x3951ce){delete _0x3951ce['id'];_0x3951ce[_0x4f2e('0x5d')]=_0x53c09e[_0x4f2e('0x57')]['id'];return _0x3951ce;});return db[_0x4f2e('0x32')][_0x4f2e('0x5e')](_0x577686,{'transaction':_0x38ca36});});})[_0x4f2e('0x2a')](function(){return db[_0x4f2e('0x32')][_0x4f2e('0x5f')]({'where':{'IntervalId':_0x53c09e[_0x4f2e('0x57')]['id']}});});}})[_0x4f2e('0x2a')](respondWithResult(_0x7c803d,null))[_0x4f2e('0x4e')](handleError(_0x7c803d,null));};
\ No newline at end of file
index 0e1b25a..7e44526 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x89b6=['tools_intervals','rewrite','util','bluebird','request-promise','path','../../config/environment','./interval.attributes','../../components/extensions/rewrite','exports'];(function(_0x565df9,_0x5e4aa5){var _0x78beb7=function(_0xa7b8bd){while(--_0xa7b8bd){_0x565df9['push'](_0x565df9['shift']());}};_0x78beb7(++_0x5e4aa5);}(_0x89b6,0xf2));var _0x689b=function(_0xca6909,_0x31d421){_0xca6909=_0xca6909-0x0;var _0x44d08e=_0x89b6[_0xca6909];return _0x44d08e;};'use strict';var _=require('lodash');var util=require(_0x689b('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x689b('0x1'));var rp=require(_0x689b('0x2'));var fs=require('fs');var path=require(_0x689b('0x3'));var rimraf=require('rimraf');var config=require(_0x689b('0x4'));var attributes=require(_0x689b('0x5'));var extensions=require(_0x689b('0x6'));module[_0x689b('0x7')]=function(_0x81259,_0x1cdf26){return _0x81259['define']('Interval',attributes,{'tableName':_0x689b('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x120595,_0xdfbf5){extensions[_0x689b('0x9')](_0x81259,_0x120595);},'afterBulkCreate':function(_0x4eedfb,_0x42a944,_0x5753d8){_0x5753d8();extensions[_0x689b('0x9')](_0x81259,_0x4eedfb[0x0]);},'afterUpdate':function(_0x25d847,_0x130ae0){extensions['rewrite'](_0x81259,_0x25d847);},'afterDestroy':function(_0x309cd2,_0x30de27){extensions[_0x689b('0x9')](_0x81259,_0x309cd2);}}});};
\ No newline at end of file
+var _0xfb9f=['../../components/extensions/rewrite','exports','Interval','tools_intervals','rewrite','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x4955ae,_0x2276b2){var _0x2fb44d=function(_0x2082c7){while(--_0x2082c7){_0x4955ae['push'](_0x4955ae['shift']());}};_0x2fb44d(++_0x2276b2);}(_0xfb9f,0x8c));var _0xffb9=function(_0x32d0eb,_0x1882d6){_0x32d0eb=_0x32d0eb-0x0;var _0x494b6f=_0xfb9f[_0x32d0eb];return _0x494b6f;};'use strict';var _=require(_0xffb9('0x0'));var util=require(_0xffb9('0x1'));var logger=require(_0xffb9('0x2'))(_0xffb9('0x3'));var moment=require(_0xffb9('0x4'));var BPromise=require(_0xffb9('0x5'));var rp=require(_0xffb9('0x6'));var fs=require('fs');var path=require(_0xffb9('0x7'));var rimraf=require(_0xffb9('0x8'));var config=require(_0xffb9('0x9'));var attributes=require('./interval.attributes');var extensions=require(_0xffb9('0xa'));module[_0xffb9('0xb')]=function(_0x2f2090,_0x23e4e5){return _0x2f2090['define'](_0xffb9('0xc'),attributes,{'tableName':_0xffb9('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x43dd16,_0x5df9f3){extensions[_0xffb9('0xe')](_0x2f2090,_0x43dd16);},'afterBulkCreate':function(_0x467817,_0x14d69d,_0x179628){_0x179628();extensions[_0xffb9('0xe')](_0x2f2090,_0x467817[0x0]);},'afterUpdate':function(_0x5f0aaa,_0x184d2d){extensions[_0xffb9('0xe')](_0x2f2090,_0x5f0aaa);},'afterDestroy':function(_0x239e4a,_0x4e0214){extensions[_0xffb9('0xe')](_0x2f2090,_0x239e4a);}}});};
\ No newline at end of file
index a8f14e1..39ff446 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(_0x22663b,_0xc8c6e3){var _0x310d0a=function(_0x151e66){while(--_0x151e66){_0x22663b['push'](_0x22663b['shift']());}};_0x310d0a(++_0xc8c6e3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xa9e0[_0x29b609];return _0x54c952;};'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(_0x457b64,_0x49a219){var _0x437111=function(_0x3dad3d){while(--_0x3dad3d){_0x457b64['push'](_0x457b64['shift']());}};_0x437111(++_0x49a219);}(_0xa9e0,0x123));var _0x0a9e=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0xa9e0[_0x45e98e];return _0x374dba;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}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 31b5bda..35085aa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xadb5=['post','isAuthenticated','exports','Router','./jira.controller'];(function(_0x181906,_0x406a33){var _0x38f5ec=function(_0xe1707b){while(--_0xe1707b){_0x181906['push'](_0x181906['shift']());}};_0x38f5ec(++_0x406a33);}(_0xadb5,0xad));var _0x5adb=function(_0x290b62,_0x24c2a8){_0x290b62=_0x290b62-0x0;var _0x47c9e4=_0xadb5[_0x290b62];return _0x47c9e4;};'use strict';var express=require('express');var router=express[_0x5adb('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x5adb('0x1'));router[_0x5adb('0x2')]('/',auth[_0x5adb('0x3')](),controller['send']);module[_0x5adb('0x4')]=router;
\ No newline at end of file
+var _0xadb5=['post','isAuthenticated','exports','Router','./jira.controller'];(function(_0x57a002,_0x1197b9){var _0x278d89=function(_0x3fc91f){while(--_0x3fc91f){_0x57a002['push'](_0x57a002['shift']());}};_0x278d89(++_0x1197b9);}(_0xadb5,0xad));var _0x5adb=function(_0x1421bf,_0x102adb){_0x1421bf=_0x1421bf-0x0;var _0x2df471=_0xadb5[_0x1421bf];return _0x2df471;};'use strict';var express=require('express');var router=express[_0x5adb('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x5adb('0x1'));router[_0x5adb('0x2')]('/',auth[_0x5adb('0x3')](),controller['send']);module[_0x5adb('0x4')]=router;
\ No newline at end of file
index 765693a..a906184 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7c63=['\x20from\x20','description','issuetype','fields','email','customfield_11502','newToken','customfield_11503','name','customfield_11504','track.xcallymotion.com','POST','application/json','Basic\x20','toString','request','setEncoding','utf8','data','end','status','statusCode','error','json','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','send','body','headers','x-forwarded-for','connection','remoteAddress','socket','../../config/logger','api','support','3eAmWpBVP0','key','MOTGUI','Report'];(function(_0x1ccbcc,_0x5c948b){var _0x1e873f=function(_0x4f232e){while(--_0x4f232e){_0x1ccbcc['push'](_0x1ccbcc['shift']());}};_0x1e873f(++_0x5c948b);}(_0x7c63,0x71));var _0x37c6=function(_0x38baef,_0x4fba8a){_0x38baef=_0x38baef-0x0;var _0x398765=_0x7c63[_0x38baef];return _0x398765;};'use strict';var BPromise=require('bluebird');var https=require('https');var logger=require(_0x37c6('0x0'))(_0x37c6('0x1'));var USERNAME=_0x37c6('0x2');var PASSWORD=_0x37c6('0x3');function openIssue(_0x8ca682,_0x501237){var _0x518c31={'fields':{'project':{'key':_0x8ca682[_0x37c6('0x4')]||_0x37c6('0x5')},'summary':(_0x8ca682['summary']||_0x37c6('0x6'))+_0x37c6('0x7')+_0x8ca682['ip'],'description':_0x8ca682[_0x37c6('0x8')]||JSON['stringify'](_0x8ca682),'issuetype':{'name':_0x8ca682[_0x37c6('0x9')]||'Bug'}}};_0x518c31[_0x37c6('0xa')]['customfield_11500']=_0x8ca682[_0x37c6('0xb')];_0x518c31[_0x37c6('0xa')]['customfield_11501']=_0x8ca682['oldToken'];_0x518c31[_0x37c6('0xa')][_0x37c6('0xc')]=_0x8ca682[_0x37c6('0xd')];_0x518c31[_0x37c6('0xa')][_0x37c6('0xe')]=_0x8ca682[_0x37c6('0xf')];_0x518c31[_0x37c6('0xa')][_0x37c6('0x10')]=_0x8ca682['reason'];_0x518c31[_0x37c6('0xa')]['customfield_10102']=_0x8ca682['ip'];var _0x125c91={'host':_0x37c6('0x11'),'port':0x1bb,'path':'/rest/api/2/issue','method':_0x37c6('0x12'),'timeout':0x4e20,'headers':{'Content-Type':_0x37c6('0x13'),'Authorization':_0x37c6('0x14')+new Buffer(USERNAME+':'+PASSWORD)[_0x37c6('0x15')]('base64')}};var _0x3f0a3b=JSON['stringify'](_0x518c31);var _0x34f449=https[_0x37c6('0x16')](_0x125c91,function(_0x572435){_0x572435[_0x37c6('0x17')](_0x37c6('0x18'));var _0x35ae87='';_0x572435['on'](_0x37c6('0x19'),function(_0x2e9412){_0x35ae87+=_0x2e9412;});_0x572435['on'](_0x37c6('0x1a'),function(){if(_0x501237){return _0x501237[_0x37c6('0x1b')](_0x572435[_0x37c6('0x1c')])['json'](JSON['parse'](_0x35ae87));}});});_0x34f449['on'](_0x37c6('0x1d'),function(_0x21e01a){if(_0x501237){return _0x501237[_0x37c6('0x1b')](0x1f4)[_0x37c6('0x1e')]({'errors':[{'message':_0x37c6('0x1f'),'type':_0x37c6('0x20')}]});}});_0x34f449['write'](_0x3f0a3b);_0x34f449[_0x37c6('0x1a')]();}exports['openIssue']=openIssue;exports[_0x37c6('0x21')]=function(_0x238d23,_0x71dddc){_0x238d23[_0x37c6('0x22')]['ip']=_0x238d23[_0x37c6('0x23')][_0x37c6('0x24')]||_0x238d23[_0x37c6('0x25')][_0x37c6('0x26')]||_0x238d23[_0x37c6('0x27')][_0x37c6('0x26')]||_0x238d23[_0x37c6('0x25')]['socket']['remoteAddress'];return openIssue(_0x238d23[_0x37c6('0x22')],_0x71dddc);};
\ No newline at end of file
+var _0xc99e=['bluebird','https','../../config/logger','api','support','3eAmWpBVP0','key','MOTGUI','description','stringify','issuetype','Bug','fields','email','customfield_11501','customfield_11502','newToken','customfield_11503','name','customfield_11504','reason','customfield_10102','POST','application/json','Basic\x20','toString','setEncoding','utf8','end','status','json','parse','error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','openIssue','send','body','headers','x-forwarded-for','remoteAddress'];(function(_0x2f6828,_0x500886){var _0x48df7e=function(_0x25b766){while(--_0x25b766){_0x2f6828['push'](_0x2f6828['shift']());}};_0x48df7e(++_0x500886);}(_0xc99e,0x1ce));var _0xec99=function(_0x53433b,_0x144fa6){_0x53433b=_0x53433b-0x0;var _0x215546=_0xc99e[_0x53433b];return _0x215546;};'use strict';var BPromise=require(_0xec99('0x0'));var https=require(_0xec99('0x1'));var logger=require(_0xec99('0x2'))(_0xec99('0x3'));var USERNAME=_0xec99('0x4');var PASSWORD=_0xec99('0x5');function openIssue(_0x329980,_0x23982b){var _0x329264={'fields':{'project':{'key':_0x329980[_0xec99('0x6')]||_0xec99('0x7')},'summary':(_0x329980['summary']||'Report')+'\x20from\x20'+_0x329980['ip'],'description':_0x329980[_0xec99('0x8')]||JSON[_0xec99('0x9')](_0x329980),'issuetype':{'name':_0x329980[_0xec99('0xa')]||_0xec99('0xb')}}};_0x329264[_0xec99('0xc')]['customfield_11500']=_0x329980[_0xec99('0xd')];_0x329264['fields'][_0xec99('0xe')]=_0x329980['oldToken'];_0x329264[_0xec99('0xc')][_0xec99('0xf')]=_0x329980[_0xec99('0x10')];_0x329264['fields'][_0xec99('0x11')]=_0x329980[_0xec99('0x12')];_0x329264[_0xec99('0xc')][_0xec99('0x13')]=_0x329980[_0xec99('0x14')];_0x329264[_0xec99('0xc')][_0xec99('0x15')]=_0x329980['ip'];var _0x549cf2={'host':'track.xcallymotion.com','port':0x1bb,'path':'/rest/api/2/issue','method':_0xec99('0x16'),'timeout':0x4e20,'headers':{'Content-Type':_0xec99('0x17'),'Authorization':_0xec99('0x18')+new Buffer(USERNAME+':'+PASSWORD)[_0xec99('0x19')]('base64')}};var _0x3c12a8=JSON[_0xec99('0x9')](_0x329264);var _0xe13761=https['request'](_0x549cf2,function(_0x51e1eb){_0x51e1eb[_0xec99('0x1a')](_0xec99('0x1b'));var _0x617afb='';_0x51e1eb['on']('data',function(_0x32cf7f){_0x617afb+=_0x32cf7f;});_0x51e1eb['on'](_0xec99('0x1c'),function(){if(_0x23982b){return _0x23982b[_0xec99('0x1d')](_0x51e1eb['statusCode'])[_0xec99('0x1e')](JSON[_0xec99('0x1f')](_0x617afb));}});});_0xe13761['on'](_0xec99('0x20'),function(_0x1410a7){if(_0x23982b){return _0x23982b[_0xec99('0x1d')](0x1f4)[_0xec99('0x1e')]({'errors':[{'message':_0xec99('0x21'),'type':_0xec99('0x22')}]});}});_0xe13761[_0xec99('0x23')](_0x3c12a8);_0xe13761[_0xec99('0x1c')]();}exports[_0xec99('0x24')]=openIssue;exports[_0xec99('0x25')]=function(_0x182bac,_0x350d19){_0x182bac[_0xec99('0x26')]['ip']=_0x182bac[_0xec99('0x27')][_0xec99('0x28')]||_0x182bac['connection'][_0xec99('0x29')]||_0x182bac['socket'][_0xec99('0x29')]||_0x182bac['connection']['socket'][_0xec99('0x29')];return openIssue(_0x182bac[_0xec99('0x26')],_0x350d19);};
\ No newline at end of file
index c9045c7..213250d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xec56=['put','update','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create'];(function(_0x247cbe,_0x10e77b){var _0x41be9d=function(_0xaabb9e){while(--_0xaabb9e){_0x247cbe['push'](_0x247cbe['shift']());}};_0x41be9d(++_0x10e77b);}(_0xec56,0x1bd));var _0x6ec5=function(_0x3bcec8,_0x27160e){_0x3bcec8=_0x3bcec8-0x0;var _0x5d8594=_0xec56[_0x3bcec8];return _0x5d8594;};'use strict';var multer=require(_0x6ec5('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x6ec5('0x1'));var express=require(_0x6ec5('0x2'));var router=express[_0x6ec5('0x3')]();var fs_extra=require(_0x6ec5('0x4'));var auth=require(_0x6ec5('0x5'));var interaction=require(_0x6ec5('0x6'));var config=require(_0x6ec5('0x7'));var controller=require(_0x6ec5('0x8'));router[_0x6ec5('0x9')]('/',auth[_0x6ec5('0xa')](),controller[_0x6ec5('0xb')]);router[_0x6ec5('0x9')](_0x6ec5('0xc'),auth[_0x6ec5('0xa')](),controller[_0x6ec5('0xd')]);router[_0x6ec5('0x9')](_0x6ec5('0xe'),auth[_0x6ec5('0xa')](),controller[_0x6ec5('0xf')]);router['post']('/',auth[_0x6ec5('0xa')](),controller[_0x6ec5('0x10')]);router[_0x6ec5('0x11')](_0x6ec5('0xe'),auth[_0x6ec5('0xa')](),controller[_0x6ec5('0x12')]);router[_0x6ec5('0x13')]('/:id',auth[_0x6ec5('0xa')](),controller[_0x6ec5('0x14')]);module[_0x6ec5('0x15')]=router;
\ No newline at end of file
+var _0x0713=['delete','destroy','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post','create','put','update'];(function(_0x4346b8,_0x2ef4ec){var _0x55cc6c=function(_0x47b97c){while(--_0x47b97c){_0x4346b8['push'](_0x4346b8['shift']());}};_0x55cc6c(++_0x2ef4ec);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var controller=require(_0x3071('0x7'));router[_0x3071('0x8')]('/',auth[_0x3071('0x9')](),controller[_0x3071('0xa')]);router[_0x3071('0x8')](_0x3071('0xb'),auth[_0x3071('0x9')](),controller[_0x3071('0xc')]);router[_0x3071('0x8')](_0x3071('0xd'),auth[_0x3071('0x9')](),controller['show']);router[_0x3071('0xe')]('/',auth[_0x3071('0x9')](),controller[_0x3071('0xf')]);router[_0x3071('0x10')](_0x3071('0xd'),auth['isAuthenticated'](),controller[_0x3071('0x11')]);router[_0x3071('0x12')](_0x3071('0xd'),auth[_0x3071('0x9')](),controller[_0x3071('0x13')]);module['exports']=router;
\ No newline at end of file
index c9b7ec9..5208a6e 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(_0x5fc3ab,_0x23fb2b){_0x5fc3ab=_0x5fc3ab-0x0;var _0x390138=_0x7a54[_0x5fc3ab];return _0x390138;};'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(_0x346737,_0x3e6081){var _0x1ade2e=function(_0x15e50e){while(--_0x15e50e){_0x346737['push'](_0x346737['shift']());}};_0x1ade2e(++_0x3e6081);}(_0x7a54,0x106));var _0x47a5=function(_0x5415fa,_0xdb087f){_0x5415fa=_0x5415fa-0x0;var _0x4b7cc6=_0x7a54[_0x5415fa];return _0x4b7cc6;};'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 cc34d84..9317a30 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x741c=['apply','save','update','then','destroy','name','send','index','map','JscriptyAnswerReport','rawAttributes','fieldName','type','key','model','keys','intersection','query','fields','attributes','length','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','limit','count','offset','set','Content-Range'];(function(_0x43d9d4,_0x2cc7cc){var _0x350bfa=function(_0x2a464a){while(--_0x2a464a){_0x43d9d4['push'](_0x43d9d4['shift']());}};_0x350bfa(++_0x2cc7cc);}(_0x741c,0x196));var _0xc741=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x741c[_0x122ef9];return _0x42fba0;};'use strict';var emlformat=require(_0xc741('0x0'));var rimraf=require(_0xc741('0x1'));var zipdir=require(_0xc741('0x2'));var jsonpatch=require(_0xc741('0x3'));var rp=require(_0xc741('0x4'));var moment=require(_0xc741('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xc741('0x6'));var path=require('path');var sox=require(_0xc741('0x7'));var csv=require(_0xc741('0x8'));var ejs=require(_0xc741('0x9'));var fs=require('fs');var fs_extra=require(_0xc741('0xa'));var _=require(_0xc741('0xb'));var squel=require(_0xc741('0xc'));var crypto=require(_0xc741('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xc741('0xe'));var toCsv=require(_0xc741('0x8'));var querystring=require('querystring');var Papa=require(_0xc741('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xc741('0x10'));var as=require(_0xc741('0x11'));var hardwareService=require(_0xc741('0x12'));var logger=require(_0xc741('0x13'))(_0xc741('0x14'));var utils=require(_0xc741('0x15'));var config=require(_0xc741('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x51bc33,_0x12a073){_0x12a073=_0x12a073||0xcc;return function(_0x48bee3){if(_0x48bee3){return _0x51bc33[_0xc741('0x17')](_0x12a073);}return _0x51bc33[_0xc741('0x18')](_0x12a073)[_0xc741('0x19')]();};}function respondWithResult(_0x584b08,_0xde1da){_0xde1da=_0xde1da||0xc8;return function(_0x3d2f62){if(_0x3d2f62){return _0x584b08['status'](_0xde1da)[_0xc741('0x1a')](_0x3d2f62);}};}function respondWithFilteredResult(_0x3c7569,_0xd92df7){return function(_0x450179){if(_0x450179){var _0x21514e=typeof _0xd92df7['offset']==='undefined'&&typeof _0xd92df7[_0xc741('0x1b')]==='undefined';var _0x1c4f3a=_0x450179[_0xc741('0x1c')];var _0x575184=_0x21514e?0x0:_0xd92df7['offset'];var _0xebabc8=_0x21514e?_0x450179[_0xc741('0x1c')]:_0xd92df7[_0xc741('0x1d')]+_0xd92df7['limit'];var _0x19d598;if(_0xebabc8>=_0x1c4f3a){_0xebabc8=_0x1c4f3a;_0x19d598=0xc8;}else{_0x19d598=0xce;}_0x3c7569[_0xc741('0x18')](_0x19d598);return _0x3c7569[_0xc741('0x1e')](_0xc741('0x1f'),_0x575184+'-'+_0xebabc8+'/'+_0x1c4f3a)[_0xc741('0x1a')](_0x450179);}return null;};}function patchUpdates(_0xe0afe5){return function(_0x5ce5fa){try{jsonpatch[_0xc741('0x20')](_0x5ce5fa,_0xe0afe5,!![]);}catch(_0x2a74da){return BPromise['reject'](_0x2a74da);}return _0x5ce5fa[_0xc741('0x21')]();};}function saveUpdates(_0x52999b,_0x212c67){return function(_0x4b5b31){if(_0x4b5b31){return _0x4b5b31[_0xc741('0x22')](_0x52999b)[_0xc741('0x23')](function(_0x38e752){return _0x38e752;});}return null;};}function removeEntity(_0x5ca96f,_0x71c786){return function(_0x5a89bd){if(_0x5a89bd){return _0x5a89bd[_0xc741('0x24')]()[_0xc741('0x23')](function(){_0x5ca96f[_0xc741('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x53bdad,_0x4ac9e3){return function(_0x178a57){if(!_0x178a57){_0x53bdad[_0xc741('0x17')](0x194);}return _0x178a57;};}function handleError(_0x42461a,_0x3f6940){_0x3f6940=_0x3f6940||0x1f4;return function(_0x1f8723){logger['error'](_0x1f8723['stack']);if(_0x1f8723[_0xc741('0x25')]){delete _0x1f8723[_0xc741('0x25')];}_0x42461a[_0xc741('0x18')](_0x3f6940)[_0xc741('0x26')](_0x1f8723);};}exports[_0xc741('0x27')]=function(_0x378ab5,_0x4a4ad2){var _0x353729={},_0x2e960e={},_0x4cd23c={'count':0x0,'rows':[]};var _0x3797c5=_[_0xc741('0x28')](db[_0xc741('0x29')][_0xc741('0x2a')],function(_0x3b66ae){return{'name':_0x3b66ae[_0xc741('0x2b')],'type':_0x3b66ae[_0xc741('0x2c')][_0xc741('0x2d')]};});_0x2e960e[_0xc741('0x2e')]=_['map'](_0x3797c5,_0xc741('0x25'));_0x2e960e['query']=_[_0xc741('0x2f')](_0x378ab5['query']);_0x2e960e['filters']=_[_0xc741('0x30')](_0x2e960e[_0xc741('0x2e')],_0x2e960e[_0xc741('0x31')]);_0x353729['attributes']=_[_0xc741('0x30')](_0x2e960e[_0xc741('0x2e')],qs[_0xc741('0x32')](_0x378ab5['query'][_0xc741('0x32')]));_0x353729[_0xc741('0x33')]=_0x353729[_0xc741('0x33')][_0xc741('0x34')]?_0x353729[_0xc741('0x33')]:_0x2e960e[_0xc741('0x2e')];if(!_0x378ab5[_0xc741('0x31')]['hasOwnProperty']('nolimit')){_0x353729[_0xc741('0x1b')]=qs[_0xc741('0x1b')](_0x378ab5[_0xc741('0x31')][_0xc741('0x1b')]);_0x353729[_0xc741('0x1d')]=qs[_0xc741('0x1d')](_0x378ab5['query'][_0xc741('0x1d')]);}_0x353729[_0xc741('0x35')]=qs['sort'](_0x378ab5[_0xc741('0x31')][_0xc741('0x36')]);_0x353729[_0xc741('0x37')]=qs['filters'](_[_0xc741('0x38')](_0x378ab5[_0xc741('0x31')],_0x2e960e[_0xc741('0x39')]),_0x3797c5);if(_0x378ab5[_0xc741('0x31')][_0xc741('0x3a')]){_0x353729[_0xc741('0x37')]=_[_0xc741('0x3b')](_0x353729['where'],{'$or':_[_0xc741('0x28')](_0x3797c5,function(_0xafe7e7){if(_0xafe7e7[_0xc741('0x2c')]!==_0xc741('0x3c')){var _0x1e4433={};_0x1e4433[_0xafe7e7[_0xc741('0x25')]]={'$like':'%'+_0x378ab5[_0xc741('0x31')][_0xc741('0x3a')]+'%'};return _0x1e4433;}})});}_0x353729=_['merge']({},_0x353729,_0x378ab5[_0xc741('0x3d')]);var _0x17ba5a={'where':_0x353729[_0xc741('0x37')]};return db[_0xc741('0x29')]['count'](_0x17ba5a)[_0xc741('0x23')](function(_0x51ba7a){_0x4cd23c[_0xc741('0x1c')]=_0x51ba7a;if(_0x378ab5[_0xc741('0x31')][_0xc741('0x3e')]){_0x353729['include']=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0xc741('0x3f')](_0x353729);})[_0xc741('0x23')](function(_0x38087f){_0x4cd23c[_0xc741('0x40')]=_0x38087f;return _0x4cd23c;})[_0xc741('0x23')](respondWithFilteredResult(_0x4a4ad2,_0x353729))[_0xc741('0x41')](handleError(_0x4a4ad2,null));};exports[_0xc741('0x42')]=function(_0x324b53,_0x149a5e){var _0x2542aa={'raw':!![],'where':{'id':_0x324b53[_0xc741('0x43')]['id']}},_0x3d5a7f={};_0x3d5a7f[_0xc741('0x2e')]=_[_0xc741('0x2f')](db[_0xc741('0x29')][_0xc741('0x2a')]);_0x3d5a7f[_0xc741('0x31')]=_['keys'](_0x324b53[_0xc741('0x31')]);_0x3d5a7f['filters']=_[_0xc741('0x30')](_0x3d5a7f['model'],_0x3d5a7f[_0xc741('0x31')]);_0x2542aa[_0xc741('0x33')]=_['intersection'](_0x3d5a7f[_0xc741('0x2e')],qs[_0xc741('0x32')](_0x324b53['query'][_0xc741('0x32')]));_0x2542aa[_0xc741('0x33')]=_0x2542aa[_0xc741('0x33')][_0xc741('0x34')]?_0x2542aa[_0xc741('0x33')]:_0x3d5a7f[_0xc741('0x2e')];if(_0x324b53[_0xc741('0x31')]['includeAll']){_0x2542aa[_0xc741('0x44')]=[{'all':!![]}];}_0x2542aa=_['merge']({},_0x2542aa,_0x324b53['options']);return db[_0xc741('0x29')]['find'](_0x2542aa)[_0xc741('0x23')](handleEntityNotFound(_0x149a5e,null))[_0xc741('0x23')](respondWithResult(_0x149a5e,null))[_0xc741('0x41')](handleError(_0x149a5e,null));};exports[_0xc741('0x45')]=function(_0x4188a4,_0xb9934b){return db[_0xc741('0x29')][_0xc741('0x45')](_0x4188a4[_0xc741('0x46')],{})['then'](respondWithResult(_0xb9934b,0xc9))['catch'](handleError(_0xb9934b,null));};exports[_0xc741('0x22')]=function(_0x3268fa,_0x319198){if(_0x3268fa[_0xc741('0x46')]['id']){delete _0x3268fa['body']['id'];}return db[_0xc741('0x29')]['find']({'where':{'id':_0x3268fa[_0xc741('0x43')]['id']}})[_0xc741('0x23')](handleEntityNotFound(_0x319198,null))[_0xc741('0x23')](saveUpdates(_0x3268fa[_0xc741('0x46')],null))[_0xc741('0x23')](respondWithResult(_0x319198,null))[_0xc741('0x41')](handleError(_0x319198,null));};exports[_0xc741('0x24')]=function(_0x3a14dc,_0x420c1a){return db[_0xc741('0x29')][_0xc741('0x47')]({'where':{'id':_0x3a14dc[_0xc741('0x43')]['id']}})['then'](handleEntityNotFound(_0x420c1a,null))[_0xc741('0x23')](removeEntity(_0x420c1a,null))[_0xc741('0x41')](handleError(_0x420c1a,null));};exports[_0xc741('0x48')]=function(_0x5446ac,_0x29ec0b){return db[_0xc741('0x29')][_0xc741('0x48')]()[_0xc741('0x23')](respondWithResult(_0x29ec0b,null))['catch'](handleError(_0x29ec0b,null));};
\ No newline at end of file
+var _0x598a=['fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','where','merge','filter','options','JscriptyAnswerReport','include','findAll','rows','show','rawAttributes','includeAll','find','create','body','catch','update','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','error','name','send','index','map'];(function(_0x5144df,_0x5314ad){var _0xd04353=function(_0x36e7be){while(--_0x36e7be){_0x5144df['push'](_0x5144df['shift']());}};_0xd04353(++_0x5314ad);}(_0x598a,0xfb));var _0xa598=function(_0x50213c,_0x4cef54){_0x50213c=_0x50213c-0x0;var _0x1a45e5=_0x598a[_0x50213c];return _0x1a45e5;};'use strict';var emlformat=require(_0xa598('0x0'));var rimraf=require(_0xa598('0x1'));var zipdir=require(_0xa598('0x2'));var jsonpatch=require(_0xa598('0x3'));var rp=require(_0xa598('0x4'));var moment=require('moment');var BPromise=require(_0xa598('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xa598('0x6'));var csv=require(_0xa598('0x7'));var ejs=require(_0xa598('0x8'));var fs=require('fs');var fs_extra=require(_0xa598('0x9'));var _=require(_0xa598('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa598('0xb'));var deskjs=require(_0xa598('0xc'));var toCsv=require(_0xa598('0x7'));var querystring=require(_0xa598('0xd'));var Papa=require(_0xa598('0xe'));var Redis=require(_0xa598('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xa598('0x10'));var hardwareService=require(_0xa598('0x11'));var logger=require(_0xa598('0x12'))(_0xa598('0x13'));var utils=require(_0xa598('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xa598('0x15'));var db=require(_0xa598('0x16'))['db'];function respondWithStatusCode(_0x468710,_0x5041d4){_0x5041d4=_0x5041d4||0xcc;return function(_0xe8f905){if(_0xe8f905){return _0x468710['sendStatus'](_0x5041d4);}return _0x468710[_0xa598('0x17')](_0x5041d4)[_0xa598('0x18')]();};}function respondWithResult(_0xb3288a,_0x38afa9){_0x38afa9=_0x38afa9||0xc8;return function(_0x1949b5){if(_0x1949b5){return _0xb3288a[_0xa598('0x17')](_0x38afa9)[_0xa598('0x19')](_0x1949b5);}};}function respondWithFilteredResult(_0x41d3fe,_0x28534a){return function(_0x4b100b){if(_0x4b100b){var _0x88df86=typeof _0x28534a[_0xa598('0x1a')]===_0xa598('0x1b')&&typeof _0x28534a[_0xa598('0x1c')]===_0xa598('0x1b');var _0xecb39d=_0x4b100b[_0xa598('0x1d')];var _0x2746e3=_0x88df86?0x0:_0x28534a[_0xa598('0x1a')];var _0x44c872=_0x88df86?_0x4b100b['count']:_0x28534a[_0xa598('0x1a')]+_0x28534a[_0xa598('0x1c')];var _0x3fd5a4;if(_0x44c872>=_0xecb39d){_0x44c872=_0xecb39d;_0x3fd5a4=0xc8;}else{_0x3fd5a4=0xce;}_0x41d3fe[_0xa598('0x17')](_0x3fd5a4);return _0x41d3fe[_0xa598('0x1e')](_0xa598('0x1f'),_0x2746e3+'-'+_0x44c872+'/'+_0xecb39d)['json'](_0x4b100b);}return null;};}function patchUpdates(_0x56fc63){return function(_0x2923d5){try{jsonpatch['apply'](_0x2923d5,_0x56fc63,!![]);}catch(_0x3ac469){return BPromise[_0xa598('0x20')](_0x3ac469);}return _0x2923d5[_0xa598('0x21')]();};}function saveUpdates(_0x2222b0,_0x261868){return function(_0x24f4f0){if(_0x24f4f0){return _0x24f4f0['update'](_0x2222b0)[_0xa598('0x22')](function(_0x46d225){return _0x46d225;});}return null;};}function removeEntity(_0x470663,_0x14643d){return function(_0x802679){if(_0x802679){return _0x802679[_0xa598('0x23')]()[_0xa598('0x22')](function(){_0x470663[_0xa598('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x473d07,_0x414d2c){return function(_0x499565){if(!_0x499565){_0x473d07['sendStatus'](0x194);}return _0x499565;};}function handleError(_0x35b669,_0x559038){_0x559038=_0x559038||0x1f4;return function(_0x527c9f){logger[_0xa598('0x24')](_0x527c9f['stack']);if(_0x527c9f[_0xa598('0x25')]){delete _0x527c9f['name'];}_0x35b669['status'](_0x559038)[_0xa598('0x26')](_0x527c9f);};}exports[_0xa598('0x27')]=function(_0x554d3b,_0x16f00d){var _0x2823f7={},_0x3cdc59={},_0x29bfe3={'count':0x0,'rows':[]};var _0x523392=_[_0xa598('0x28')](db['JscriptyAnswerReport']['rawAttributes'],function(_0x587d11){return{'name':_0x587d11[_0xa598('0x29')],'type':_0x587d11['type'][_0xa598('0x2a')]};});_0x3cdc59[_0xa598('0x2b')]=_[_0xa598('0x28')](_0x523392,'name');_0x3cdc59[_0xa598('0x2c')]=_[_0xa598('0x2d')](_0x554d3b[_0xa598('0x2c')]);_0x3cdc59[_0xa598('0x2e')]=_[_0xa598('0x2f')](_0x3cdc59['model'],_0x3cdc59[_0xa598('0x2c')]);_0x2823f7[_0xa598('0x30')]=_[_0xa598('0x2f')](_0x3cdc59[_0xa598('0x2b')],qs['fields'](_0x554d3b[_0xa598('0x2c')][_0xa598('0x31')]));_0x2823f7['attributes']=_0x2823f7['attributes'][_0xa598('0x32')]?_0x2823f7[_0xa598('0x30')]:_0x3cdc59[_0xa598('0x2b')];if(!_0x554d3b['query'][_0xa598('0x33')](_0xa598('0x34'))){_0x2823f7['limit']=qs[_0xa598('0x1c')](_0x554d3b['query'][_0xa598('0x1c')]);_0x2823f7[_0xa598('0x1a')]=qs['offset'](_0x554d3b[_0xa598('0x2c')][_0xa598('0x1a')]);}_0x2823f7['order']=qs[_0xa598('0x35')](_0x554d3b[_0xa598('0x2c')][_0xa598('0x35')]);_0x2823f7['where']=qs[_0xa598('0x2e')](_[_0xa598('0x36')](_0x554d3b[_0xa598('0x2c')],_0x3cdc59['filters']),_0x523392);if(_0x554d3b[_0xa598('0x2c')]['filter']){_0x2823f7[_0xa598('0x37')]=_[_0xa598('0x38')](_0x2823f7[_0xa598('0x37')],{'$or':_['map'](_0x523392,function(_0x5bd98a){if(_0x5bd98a['type']!=='VIRTUAL'){var _0x3358ad={};_0x3358ad[_0x5bd98a[_0xa598('0x25')]]={'$like':'%'+_0x554d3b[_0xa598('0x2c')][_0xa598('0x39')]+'%'};return _0x3358ad;}})});}_0x2823f7=_[_0xa598('0x38')]({},_0x2823f7,_0x554d3b[_0xa598('0x3a')]);var _0x4526d7={'where':_0x2823f7[_0xa598('0x37')]};return db[_0xa598('0x3b')][_0xa598('0x1d')](_0x4526d7)['then'](function(_0x1833fb){_0x29bfe3[_0xa598('0x1d')]=_0x1833fb;if(_0x554d3b[_0xa598('0x2c')]['includeAll']){_0x2823f7[_0xa598('0x3c')]=[{'all':!![]}];}return db[_0xa598('0x3b')][_0xa598('0x3d')](_0x2823f7);})[_0xa598('0x22')](function(_0x307497){_0x29bfe3[_0xa598('0x3e')]=_0x307497;return _0x29bfe3;})['then'](respondWithFilteredResult(_0x16f00d,_0x2823f7))['catch'](handleError(_0x16f00d,null));};exports[_0xa598('0x3f')]=function(_0x10f2f7,_0x5a772d){var _0x45bc68={'raw':!![],'where':{'id':_0x10f2f7['params']['id']}},_0x54bb73={};_0x54bb73[_0xa598('0x2b')]=_['keys'](db[_0xa598('0x3b')][_0xa598('0x40')]);_0x54bb73[_0xa598('0x2c')]=_[_0xa598('0x2d')](_0x10f2f7[_0xa598('0x2c')]);_0x54bb73[_0xa598('0x2e')]=_[_0xa598('0x2f')](_0x54bb73[_0xa598('0x2b')],_0x54bb73[_0xa598('0x2c')]);_0x45bc68[_0xa598('0x30')]=_['intersection'](_0x54bb73[_0xa598('0x2b')],qs[_0xa598('0x31')](_0x10f2f7[_0xa598('0x2c')][_0xa598('0x31')]));_0x45bc68[_0xa598('0x30')]=_0x45bc68[_0xa598('0x30')][_0xa598('0x32')]?_0x45bc68['attributes']:_0x54bb73[_0xa598('0x2b')];if(_0x10f2f7[_0xa598('0x2c')][_0xa598('0x41')]){_0x45bc68[_0xa598('0x3c')]=[{'all':!![]}];}_0x45bc68=_[_0xa598('0x38')]({},_0x45bc68,_0x10f2f7[_0xa598('0x3a')]);return db[_0xa598('0x3b')][_0xa598('0x42')](_0x45bc68)['then'](handleEntityNotFound(_0x5a772d,null))[_0xa598('0x22')](respondWithResult(_0x5a772d,null))['catch'](handleError(_0x5a772d,null));};exports[_0xa598('0x43')]=function(_0x1ec7d8,_0x2710d){return db[_0xa598('0x3b')][_0xa598('0x43')](_0x1ec7d8[_0xa598('0x44')],{})[_0xa598('0x22')](respondWithResult(_0x2710d,0xc9))[_0xa598('0x45')](handleError(_0x2710d,null));};exports[_0xa598('0x46')]=function(_0x51e0e9,_0x57e82c){if(_0x51e0e9[_0xa598('0x44')]['id']){delete _0x51e0e9[_0xa598('0x44')]['id'];}return db[_0xa598('0x3b')][_0xa598('0x42')]({'where':{'id':_0x51e0e9['params']['id']}})['then'](handleEntityNotFound(_0x57e82c,null))['then'](saveUpdates(_0x51e0e9[_0xa598('0x44')],null))[_0xa598('0x22')](respondWithResult(_0x57e82c,null))['catch'](handleError(_0x57e82c,null));};exports['destroy']=function(_0x54b287,_0x315a01){return db[_0xa598('0x3b')][_0xa598('0x42')]({'where':{'id':_0x54b287[_0xa598('0x47')]['id']}})['then'](handleEntityNotFound(_0x315a01,null))[_0xa598('0x22')](removeEntity(_0x315a01,null))[_0xa598('0x45')](handleError(_0x315a01,null));};exports[_0xa598('0x48')]=function(_0x3a4ec4,_0x333182){return db[_0xa598('0x3b')][_0xa598('0x48')]()[_0xa598('0x22')](respondWithResult(_0x333182,null))[_0xa598('0x45')](handleError(_0x333182,null));};
\ No newline at end of file
index 1052d57..73cc570 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x39e1=['JscriptyAnswerReport','util','../../config/logger','api','moment','request-promise','path','exports'];(function(_0x5601e6,_0x3b4d6c){var _0x3a39ba=function(_0x4eb6e1){while(--_0x4eb6e1){_0x5601e6['push'](_0x5601e6['shift']());}};_0x3a39ba(++_0x3b4d6c);}(_0x39e1,0x169));var _0x139e=function(_0x470ed7,_0x3dfd47){_0x470ed7=_0x470ed7-0x0;var _0x451410=_0x39e1[_0x470ed7];return _0x451410;};'use strict';var _=require('lodash');var util=require(_0x139e('0x0'));var logger=require(_0x139e('0x1'))(_0x139e('0x2'));var moment=require(_0x139e('0x3'));var BPromise=require('bluebird');var rp=require(_0x139e('0x4'));var fs=require('fs');var path=require(_0x139e('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./jscriptyAnswerReport.attributes');module[_0x139e('0x6')]=function(_0x571e95,_0x5f4d73){return _0x571e95['define'](_0x139e('0x7'),attributes,{'tableName':'report_jscripty_answers','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6926=['./jscriptyAnswerReport.attributes','exports','define','JscriptyAnswerReport','report_jscripty_answers','lodash','util','api','request-promise','rimraf','../../config/environment'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x6926,0x1e9));var _0x6692=function(_0x53d56f,_0xbba3ad){_0x53d56f=_0x53d56f-0x0;var _0x7b6ebd=_0x6926[_0x53d56f];return _0x7b6ebd;};'use strict';var _=require(_0x6692('0x0'));var util=require(_0x6692('0x1'));var logger=require('../../config/logger')(_0x6692('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6692('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6692('0x4'));var config=require(_0x6692('0x5'));var attributes=require(_0x6692('0x6'));module[_0x6692('0x7')]=function(_0x63f3c2,_0x242781){return _0x63f3c2[_0x6692('0x8')](_0x6692('0x9'),attributes,{'tableName':_0x6692('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 1d30320..c28b9a8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0016=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','request\x20sent','code','error','JscriptyAnswerReport,\x20%s,\x20%s','message','result'];(function(_0x592307,_0x2b8719){var _0x244eb8=function(_0x3e7c78){while(--_0x3e7c78){_0x592307['push'](_0x592307['shift']());}};_0x244eb8(++_0x2b8719);}(_0x0016,0x105));var _0x6001=function(_0x36de10,_0xfe25e8){_0x36de10=_0x36de10-0x0;var _0x58100f=_0x0016[_0x36de10];return _0x58100f;};'use strict';var _=require(_0x6001('0x0'));var util=require('util');var moment=require(_0x6001('0x1'));var BPromise=require(_0x6001('0x2'));var rs=require(_0x6001('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6001('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x6001('0x5'))('rpc');var config=require(_0x6001('0x6'));var jayson=require(_0x6001('0x7'));var client=jayson[_0x6001('0x8')][_0x6001('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2d82b5,_0x575430,_0x12e90e){return new BPromise(function(_0x515740,_0x47be79){return client[_0x6001('0xa')](_0x2d82b5,_0x12e90e)['then'](function(_0x5a33a1){logger['info']('JscriptyAnswerReport,\x20%s,\x20%s',_0x575430,'request\x20sent');logger[_0x6001('0xb')](_0x6001('0xc'),_0x575430,_0x6001('0xd'),JSON['stringify'](_0x5a33a1));if(_0x5a33a1['error']){if(_0x5a33a1['error'][_0x6001('0xe')]===0x1f4){logger[_0x6001('0xf')](_0x6001('0x10'),_0x575430,_0x5a33a1[_0x6001('0xf')]['message']);return _0x47be79(_0x5a33a1[_0x6001('0xf')][_0x6001('0x11')]);}logger[_0x6001('0xf')](_0x6001('0x10'),_0x575430,_0x5a33a1[_0x6001('0xf')]['message']);return _0x515740(_0x5a33a1[_0x6001('0xf')][_0x6001('0x11')]);}else{logger['info'](_0x6001('0x10'),_0x575430,_0x6001('0xd'));_0x515740(_0x5a33a1[_0x6001('0x12')][_0x6001('0x11')]);}})[_0x6001('0x13')](function(_0x1aaf1a){logger['error']('JscriptyAnswerReport,\x20%s,\x20%s',_0x575430,_0x1aaf1a);_0x47be79(_0x1aaf1a);});});}
\ No newline at end of file
+var _0xd335=['http','request','then','info','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','JscriptyAnswerReport,\x20%s,\x20%s','message','request\x20sent','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x32b993,_0x1c5989){var _0x482780=function(_0x404179){while(--_0x404179){_0x32b993['push'](_0x32b993['shift']());}};_0x482780(++_0x1c5989);}(_0xd335,0x181));var _0x5d33=function(_0x407a66,_0x4f6984){_0x407a66=_0x407a66-0x0;var _0x121b0e=_0xd335[_0x407a66];return _0x121b0e;};'use strict';var _=require(_0x5d33('0x0'));var util=require('util');var moment=require(_0x5d33('0x1'));var BPromise=require(_0x5d33('0x2'));var rs=require(_0x5d33('0x3'));var fs=require('fs');var Redis=require(_0x5d33('0x4'));var db=require(_0x5d33('0x5'))['db'];var utils=require(_0x5d33('0x6'));var logger=require(_0x5d33('0x7'))(_0x5d33('0x8'));var config=require('../../config/environment');var jayson=require(_0x5d33('0x9'));var client=jayson[_0x5d33('0xa')][_0x5d33('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x17b723,_0x283f44,_0x303ebc){return new BPromise(function(_0x2e6ecf,_0x5c919d){return client[_0x5d33('0xc')](_0x17b723,_0x303ebc)[_0x5d33('0xd')](function(_0x5d49b7){logger[_0x5d33('0xe')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x283f44,'request\x20sent');logger['debug'](_0x5d33('0xf'),_0x283f44,'request\x20sent',JSON[_0x5d33('0x10')](_0x5d49b7));if(_0x5d49b7[_0x5d33('0x11')]){if(_0x5d49b7[_0x5d33('0x11')]['code']===0x1f4){logger[_0x5d33('0x11')](_0x5d33('0x12'),_0x283f44,_0x5d49b7['error'][_0x5d33('0x13')]);return _0x5c919d(_0x5d49b7[_0x5d33('0x11')][_0x5d33('0x13')]);}logger['error'](_0x5d33('0x12'),_0x283f44,_0x5d49b7[_0x5d33('0x11')][_0x5d33('0x13')]);return _0x2e6ecf(_0x5d49b7['error'][_0x5d33('0x13')]);}else{logger['info'](_0x5d33('0x12'),_0x283f44,_0x5d33('0x14'));_0x2e6ecf(_0x5d49b7[_0x5d33('0x15')][_0x5d33('0x13')]);}})['catch'](function(_0x43be2d){logger[_0x5d33('0x11')](_0x5d33('0x12'),_0x283f44,_0x43be2d);_0x5c919d(_0x43be2d);});});}
\ No newline at end of file
index f04de85..da64fcb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb7eb=['clone','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./jscriptyProject.controller','get','/:id','/:id/sessions','isAuthenticated','getSessions','/:id/answers','getAnswers','/:id/summary','30s','getSummary','create','post'];(function(_0x3df822,_0x299495){var _0x4e457d=function(_0x68a45f){while(--_0x68a45f){_0x3df822['push'](_0x3df822['shift']());}};_0x4e457d(++_0x299495);}(_0xb7eb,0xdd));var _0xbb7e=function(_0x9d8f74,_0x1bb19d){_0x9d8f74=_0x9d8f74-0x0;var _0x2802bd=_0xb7eb[_0x9d8f74];return _0x2802bd;};'use strict';var multer=require(_0xbb7e('0x0'));var util=require(_0xbb7e('0x1'));var path=require(_0xbb7e('0x2'));var timeout=require(_0xbb7e('0x3'));var express=require(_0xbb7e('0x4'));var router=express[_0xbb7e('0x5')]();var fs_extra=require(_0xbb7e('0x6'));var auth=require(_0xbb7e('0x7'));var interaction=require(_0xbb7e('0x8'));var config=require('../../config/environment');var controller=require(_0xbb7e('0x9'));router[_0xbb7e('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0xbb7e('0xa')](_0xbb7e('0xb'),auth['isAuthenticated'](),controller['show']);router['get'](_0xbb7e('0xc'),auth[_0xbb7e('0xd')](),controller[_0xbb7e('0xe')]);router['get'](_0xbb7e('0xf'),auth[_0xbb7e('0xd')](),controller[_0xbb7e('0x10')]);router[_0xbb7e('0xa')](_0xbb7e('0x11'),auth[_0xbb7e('0xd')](),timeout(_0xbb7e('0x12')),controller[_0xbb7e('0x13')]);router['post']('/',auth[_0xbb7e('0xd')](),controller[_0xbb7e('0x14')]);router[_0xbb7e('0x15')]('/:id/clone',auth[_0xbb7e('0xd')](),controller[_0xbb7e('0x16')]);router[_0xbb7e('0x17')](_0xbb7e('0xb'),auth[_0xbb7e('0xd')](),controller['update']);router[_0xbb7e('0x18')](_0xbb7e('0xb'),auth[_0xbb7e('0xd')](),controller[_0xbb7e('0x19')]);module[_0xbb7e('0x1a')]=router;
\ No newline at end of file
+var _0x63ca=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','get','isAuthenticated','index','/:id','/:id/sessions','getSessions','/:id/answers','getAnswers','/:id/summary','30s','getSummary','create','post','/:id/clone','clone','put','update','delete','destroy','exports','multer','util'];(function(_0x3e8ee9,_0x348e69){var _0x1e9fcf=function(_0x461bfd){while(--_0x461bfd){_0x3e8ee9['push'](_0x3e8ee9['shift']());}};_0x1e9fcf(++_0x348e69);}(_0x63ca,0x1de));var _0xa63c=function(_0x44a9fb,_0x5231f3){_0x44a9fb=_0x44a9fb-0x0;var _0x3b296e=_0x63ca[_0x44a9fb];return _0x3b296e;};'use strict';var multer=require(_0xa63c('0x0'));var util=require(_0xa63c('0x1'));var path=require(_0xa63c('0x2'));var timeout=require('connect-timeout');var express=require(_0xa63c('0x3'));var router=express[_0xa63c('0x4')]();var fs_extra=require(_0xa63c('0x5'));var auth=require(_0xa63c('0x6'));var interaction=require(_0xa63c('0x7'));var config=require(_0xa63c('0x8'));var controller=require(_0xa63c('0x9'));router[_0xa63c('0xa')]('/',auth[_0xa63c('0xb')](),controller[_0xa63c('0xc')]);router['get'](_0xa63c('0xd'),auth[_0xa63c('0xb')](),controller['show']);router[_0xa63c('0xa')](_0xa63c('0xe'),auth[_0xa63c('0xb')](),controller[_0xa63c('0xf')]);router[_0xa63c('0xa')](_0xa63c('0x10'),auth['isAuthenticated'](),controller[_0xa63c('0x11')]);router[_0xa63c('0xa')](_0xa63c('0x12'),auth['isAuthenticated'](),timeout(_0xa63c('0x13')),controller[_0xa63c('0x14')]);router['post']('/',auth[_0xa63c('0xb')](),controller[_0xa63c('0x15')]);router[_0xa63c('0x16')](_0xa63c('0x17'),auth[_0xa63c('0xb')](),controller[_0xa63c('0x18')]);router[_0xa63c('0x19')](_0xa63c('0xd'),auth[_0xa63c('0xb')](),controller[_0xa63c('0x1a')]);router[_0xa63c('0x1b')](_0xa63c('0xd'),auth['isAuthenticated'](),controller[_0xa63c('0x1c')]);module[_0xa63c('0x1d')]=router;
\ No newline at end of file
index 8516fd8..ed343f3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8860=['getDataValue','description','BOOLEAN','sequelize','lodash','exports','STRING','name','TEXT','long','isObjectLike','setDataValue','formData','stringify','isString','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}'];(function(_0x1f8078,_0x31a735){var _0x5e3fa0=function(_0x5a5474){while(--_0x5a5474){_0x1f8078['push'](_0x1f8078['shift']());}};_0x5e3fa0(++_0x31a735);}(_0x8860,0x1ac));var _0x0886=function(_0x5e2152,_0x172f3d){_0x5e2152=_0x5e2152-0x0;var _0x5ddcf6=_0x8860[_0x5e2152];return _0x5ddcf6;};'use strict';var Sequelize=require(_0x0886('0x0'));var _=require(_0x0886('0x1'));var util=require('util');module[_0x0886('0x2')]={'name':{'type':Sequelize[_0x0886('0x3')],'unique':_0x0886('0x4')},'description':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0x0886('0x5')](_0x0886('0x6')),'set':function(_0x2585d5){if(_[_0x0886('0x7')](_0x2585d5)){this[_0x0886('0x8')](_0x0886('0x9'),JSON[_0x0886('0xa')](_0x2585d5));}else if(_[_0x0886('0xb')](_0x2585d5)){this[_0x0886('0x8')]('formData',_0x2585d5);}else{this[_0x0886('0x8')]('formData',util[_0x0886('0xc')](_0x0886('0xd'),this['getDataValue'](_0x0886('0x4'))||'',this[_0x0886('0xe')](_0x0886('0xf'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x0886('0x10')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x0886('0x10')],'defaultValue':![]}};
\ No newline at end of file
+var _0x7686=['sequelize','util','exports','STRING','name','TEXT','long','isObjectLike','formData','stringify','setDataValue','format','getDataValue','BOOLEAN'];(function(_0x35ba5e,_0x57917e){var _0x59a09a=function(_0x3e904a){while(--_0x3e904a){_0x35ba5e['push'](_0x35ba5e['shift']());}};_0x59a09a(++_0x57917e);}(_0x7686,0x9a));var _0x6768=function(_0x2c7da8,_0x544b86){_0x2c7da8=_0x2c7da8-0x0;var _0x1b4179=_0x7686[_0x2c7da8];return _0x1b4179;};'use strict';var Sequelize=require(_0x6768('0x0'));var _=require('lodash');var util=require(_0x6768('0x1'));module[_0x6768('0x2')]={'name':{'type':Sequelize[_0x6768('0x3')],'unique':_0x6768('0x4')},'description':{'type':Sequelize[_0x6768('0x3')]},'formData':{'type':Sequelize[_0x6768('0x5')](_0x6768('0x6')),'set':function(_0x1ffa1a){if(_[_0x6768('0x7')](_0x1ffa1a)){this['setDataValue'](_0x6768('0x8'),JSON[_0x6768('0x9')](_0x1ffa1a));}else if(_['isString'](_0x1ffa1a)){this['setDataValue'](_0x6768('0x8'),_0x1ffa1a);}else{this[_0x6768('0xa')](_0x6768('0x8'),util[_0x6768('0xb')]('{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}',this[_0x6768('0xc')](_0x6768('0x4'))||'',this[_0x6768('0xc')]('description')||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x6768('0xd')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
index e0c143c..ca8d846 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x332b=['UserProfileResource','clone','params','options','omit','updatedAt','role','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','getSessions','JscriptySessionReport','pick','ProjectId','getAnswers','findOne','JscriptyAnswerReport','number','fromCharCode','apply','toString','indexOf','replace','getSummary','startTime','starttime','parse','questionId','question','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','isEmpty','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','Content-type','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','then','destroy','get','Projects','end','error','stack','name','send','index','JscriptyProject','rawAttributes','type','model','map','query','keys','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','includeAll','include','findAll','rows','catch','show','intersection','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x332b,0x1eb));var _0xb332=function(_0x10de2a,_0xc6eee8){_0x10de2a=_0x10de2a-0x0;var _0x2199fb=_0x332b[_0x10de2a];return _0x2199fb;};'use strict';var emlformat=require(_0xb332('0x0'));var rimraf=require(_0xb332('0x1'));var zipdir=require(_0xb332('0x2'));var jsonpatch=require(_0xb332('0x3'));var rp=require(_0xb332('0x4'));var moment=require(_0xb332('0x5'));var BPromise=require(_0xb332('0x6'));var Mustache=require(_0xb332('0x7'));var util=require(_0xb332('0x8'));var path=require('path');var sox=require(_0xb332('0x9'));var csv=require(_0xb332('0xa'));var ejs=require(_0xb332('0xb'));var fs=require('fs');var fs_extra=require(_0xb332('0xc'));var _=require(_0xb332('0xd'));var squel=require(_0xb332('0xe'));var crypto=require(_0xb332('0xf'));var jsforce=require(_0xb332('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xb332('0xa'));var querystring=require('querystring');var Papa=require(_0xb332('0x11'));var Redis=require(_0xb332('0x12'));var authService=require(_0xb332('0x13'));var qs=require(_0xb332('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xb332('0x15'));var licenseUtil=require(_0xb332('0x16'));var db=require(_0xb332('0x17'))['db'];function respondWithStatusCode(_0x5a1144,_0x43f8d2){_0x43f8d2=_0x43f8d2||0xcc;return function(_0x5380c0){if(_0x5380c0){return _0x5a1144[_0xb332('0x18')](_0x43f8d2);}return _0x5a1144['status'](_0x43f8d2)['end']();};}function respondWithResult(_0x42147a,_0x9947fb){_0x9947fb=_0x9947fb||0xc8;return function(_0x468292){if(_0x468292){return _0x42147a[_0xb332('0x19')](_0x9947fb)[_0xb332('0x1a')](_0x468292);}};}function respondWithFilteredResult(_0x215868,_0x38d264){return function(_0x1f7996){if(_0x1f7996){var _0x40aae8=typeof _0x38d264[_0xb332('0x1b')]===_0xb332('0x1c')&&typeof _0x38d264['limit']==='undefined';var _0x4a59cf=_0x1f7996[_0xb332('0x1d')];var _0x4ea85e=_0x40aae8?0x0:_0x38d264[_0xb332('0x1b')];var _0x5f31cd=_0x40aae8?_0x1f7996[_0xb332('0x1d')]:_0x38d264[_0xb332('0x1b')]+_0x38d264[_0xb332('0x1e')];var _0x949d67;if(_0x5f31cd>=_0x4a59cf){_0x5f31cd=_0x4a59cf;_0x949d67=0xc8;}else{_0x949d67=0xce;}_0x215868[_0xb332('0x19')](_0x949d67);return _0x215868[_0xb332('0x1f')]('Content-Range',_0x4ea85e+'-'+_0x5f31cd+'/'+_0x4a59cf)[_0xb332('0x1a')](_0x1f7996);}return null;};}function patchUpdates(_0x14dee6){return function(_0x229698){try{jsonpatch['apply'](_0x229698,_0x14dee6,!![]);}catch(_0x1db37b){return BPromise['reject'](_0x1db37b);}return _0x229698['save']();};}function saveUpdates(_0x3b4387,_0x10e543){return function(_0x2c4597){if(_0x2c4597){return _0x2c4597['update'](_0x3b4387)[_0xb332('0x20')](function(_0xfd1469){return _0xfd1469;});}return null;};}function removeEntity(_0x4934fe,_0x1e089a){return function(_0x5e076f){if(_0x5e076f){return _0x5e076f[_0xb332('0x21')]()[_0xb332('0x20')](function(){var _0x2cee2f=_0x5e076f[_0xb332('0x22')]({'plain':!![]});var _0x5b4199=_0xb332('0x23');return db['UserProfileResource']['destroy']({'where':{'type':_0x5b4199,'resourceId':_0x2cee2f['id']}})[_0xb332('0x20')](function(){return _0x5e076f;});})['then'](function(){_0x4934fe[_0xb332('0x19')](0xcc)[_0xb332('0x24')]();});}};}function handleEntityNotFound(_0x17fc02,_0x51e012){return function(_0x3dbbec){if(!_0x3dbbec){_0x17fc02['sendStatus'](0x194);}return _0x3dbbec;};}function handleError(_0x4343c2,_0x2e4e8f){_0x2e4e8f=_0x2e4e8f||0x1f4;return function(_0x3c8809){logger[_0xb332('0x25')](_0x3c8809[_0xb332('0x26')]);if(_0x3c8809[_0xb332('0x27')]){delete _0x3c8809['name'];}_0x4343c2[_0xb332('0x19')](_0x2e4e8f)[_0xb332('0x28')](_0x3c8809);};}exports[_0xb332('0x29')]=function(_0x28f187,_0x459489){var _0x3234ef={},_0x197adf={},_0x3c3996={'count':0x0,'rows':[]};var _0x28a062=_['map'](db[_0xb332('0x2a')][_0xb332('0x2b')],function(_0x11b263){return{'name':_0x11b263['fieldName'],'type':_0x11b263[_0xb332('0x2c')]['key']};});_0x197adf[_0xb332('0x2d')]=_[_0xb332('0x2e')](_0x28a062,_0xb332('0x27'));_0x197adf[_0xb332('0x2f')]=_[_0xb332('0x30')](_0x28f187[_0xb332('0x2f')]);_0x197adf['filters']=_['intersection'](_0x197adf[_0xb332('0x2d')],_0x197adf[_0xb332('0x2f')]);_0x3234ef[_0xb332('0x31')]=_['intersection'](_0x197adf[_0xb332('0x2d')],qs[_0xb332('0x32')](_0x28f187[_0xb332('0x2f')][_0xb332('0x32')]));_0x3234ef['attributes']=_0x3234ef[_0xb332('0x31')][_0xb332('0x33')]?_0x3234ef[_0xb332('0x31')]:_0x197adf[_0xb332('0x2d')];if(!_0x28f187[_0xb332('0x2f')][_0xb332('0x34')](_0xb332('0x35'))){_0x3234ef[_0xb332('0x1e')]=qs['limit'](_0x28f187[_0xb332('0x2f')][_0xb332('0x1e')]);_0x3234ef[_0xb332('0x1b')]=qs[_0xb332('0x1b')](_0x28f187[_0xb332('0x2f')][_0xb332('0x1b')]);}_0x3234ef[_0xb332('0x36')]=qs[_0xb332('0x37')](_0x28f187[_0xb332('0x2f')][_0xb332('0x37')]);_0x3234ef[_0xb332('0x38')]=qs[_0xb332('0x39')](_['pick'](_0x28f187[_0xb332('0x2f')],_0x197adf[_0xb332('0x39')]),_0x28a062);if(_0x28f187[_0xb332('0x2f')][_0xb332('0x3a')]){_0x3234ef[_0xb332('0x38')]=_['merge'](_0x3234ef[_0xb332('0x38')],{'$or':_[_0xb332('0x2e')](_0x28a062,function(_0x1ab8d7){if(_0x1ab8d7[_0xb332('0x2c')]!=='VIRTUAL'){var _0x3cff49={};_0x3cff49[_0x1ab8d7[_0xb332('0x27')]]={'$like':'%'+_0x28f187[_0xb332('0x2f')]['filter']+'%'};return _0x3cff49;}})});}_0x3234ef=_[_0xb332('0x3b')]({},_0x3234ef,_0x28f187['options']);var _0x218a0a={'where':_0x3234ef[_0xb332('0x38')]};return db[_0xb332('0x2a')][_0xb332('0x1d')](_0x218a0a)[_0xb332('0x20')](function(_0xe61d4c){_0x3c3996['count']=_0xe61d4c;if(_0x28f187[_0xb332('0x2f')][_0xb332('0x3c')]){_0x3234ef[_0xb332('0x3d')]=[{'all':!![]}];}return db[_0xb332('0x2a')][_0xb332('0x3e')](_0x3234ef);})[_0xb332('0x20')](function(_0x1de73f){_0x3c3996[_0xb332('0x3f')]=_0x1de73f;return _0x3c3996;})[_0xb332('0x20')](respondWithFilteredResult(_0x459489,_0x3234ef))[_0xb332('0x40')](handleError(_0x459489,null));};exports[_0xb332('0x41')]=function(_0x37071c,_0x5eb7f6){var _0x3dd63a={'raw':![],'where':{'id':_0x37071c['params']['id']}},_0x4028b0={};_0x4028b0[_0xb332('0x2d')]=_[_0xb332('0x30')](db['JscriptyProject']['rawAttributes']);_0x4028b0[_0xb332('0x2f')]=_['keys'](_0x37071c[_0xb332('0x2f')]);_0x4028b0['filters']=_[_0xb332('0x42')](_0x4028b0[_0xb332('0x2d')],_0x4028b0[_0xb332('0x2f')]);_0x3dd63a[_0xb332('0x31')]=_['intersection'](_0x4028b0[_0xb332('0x2d')],qs[_0xb332('0x32')](_0x37071c['query'][_0xb332('0x32')]));_0x3dd63a[_0xb332('0x31')]=_0x3dd63a[_0xb332('0x31')]['length']?_0x3dd63a[_0xb332('0x31')]:_0x4028b0[_0xb332('0x2d')];if(_0x37071c[_0xb332('0x2f')][_0xb332('0x3c')]){_0x3dd63a[_0xb332('0x3d')]=[{'all':!![]}];}_0x3dd63a=_[_0xb332('0x3b')]({},_0x3dd63a,_0x37071c['options']);return db[_0xb332('0x2a')][_0xb332('0x43')](_0x3dd63a)[_0xb332('0x20')](handleEntityNotFound(_0x5eb7f6,null))[_0xb332('0x20')](respondWithResult(_0x5eb7f6,null))[_0xb332('0x40')](handleError(_0x5eb7f6,null));};exports['create']=function(_0x2b9f3a,_0x572a9e){return db['JscriptyProject'][_0xb332('0x44')](_0x2b9f3a[_0xb332('0x45')],{})[_0xb332('0x20')](function(_0x51f2cf){var _0x4167d5=_0x2b9f3a[_0xb332('0x46')][_0xb332('0x22')]({'plain':!![]});if(!_0x4167d5)throw new Error(_0xb332('0x47'));if(_0x4167d5['role']===_0xb332('0x46')){var _0x1a5cd5=_0x51f2cf[_0xb332('0x22')]({'plain':!![]});var _0x4a4366=_0xb332('0x23');return db['UserProfileSection'][_0xb332('0x43')]({'where':{'name':_0x4a4366,'userProfileId':_0x4167d5[_0xb332('0x48')]},'raw':!![]})[_0xb332('0x20')](function(_0x327657){if(_0x327657&&_0x327657[_0xb332('0x49')]===0x0){return db[_0xb332('0x4a')]['create']({'name':_0x1a5cd5[_0xb332('0x27')],'resourceId':_0x1a5cd5['id'],'type':_0x327657['name'],'sectionId':_0x327657['id']},{})[_0xb332('0x20')](function(){return _0x51f2cf;});}else{return _0x51f2cf;}})[_0xb332('0x40')](function(_0xdc8734){logger[_0xb332('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xdc8734);throw _0xdc8734;});}return _0x51f2cf;})[_0xb332('0x20')](respondWithResult(_0x572a9e,0xc9))[_0xb332('0x40')](handleError(_0x572a9e,null));};exports[_0xb332('0x4b')]=function(_0x15bf7,_0x1c991a){var _0x5a25c6={'where':{'id':_0x15bf7[_0xb332('0x4c')]['id']}},_0x31f49e={};_0x31f49e[_0xb332('0x2d')]=_[_0xb332('0x30')](db[_0xb332('0x2a')]['rawAttributes']);_0x5a25c6[_0xb332('0x31')]=_[_0xb332('0x42')](_0x31f49e[_0xb332('0x2d')],qs['fields'](_0x15bf7[_0xb332('0x2f')][_0xb332('0x32')]));_0x5a25c6[_0xb332('0x31')]=_0x5a25c6[_0xb332('0x31')]['length']?_0x5a25c6[_0xb332('0x31')]:_0x31f49e[_0xb332('0x2d')];if(_0x15bf7[_0xb332('0x2f')][_0xb332('0x3c')]){_0x5a25c6[_0xb332('0x3d')]=[{'all':!![]}];}_0x5a25c6=_[_0xb332('0x3b')]({},_0x5a25c6,_0x15bf7[_0xb332('0x4d')]);return db[_0xb332('0x2a')]['find'](_0x5a25c6)[_0xb332('0x20')](handleEntityNotFound(_0x1c991a,null))[_0xb332('0x20')](function(_0x33dbea){if(_0x33dbea){var _0x3f6adf=_0x33dbea[_0xb332('0x22')]({'plain':!![]});_0x3f6adf=qs[_0xb332('0x4e')](_0x3f6adf,['id','createdAt',_0xb332('0x4f')]);_0x15bf7[_0xb332('0x45')]=_[_0xb332('0x4e')](_0x15bf7[_0xb332('0x45')],['id','createdAt',_0xb332('0x4f')]);return db[_0xb332('0x2a')]['create'](_[_0xb332('0x3b')](_0x3f6adf,_0x15bf7[_0xb332('0x45')]),{'include':_0x15bf7[_0xb332('0x2f')][_0xb332('0x3c')]?[{'all':!![]}]:undefined})[_0xb332('0x20')](function(_0x4ad24a){var _0x92dc7b=_0x15bf7[_0xb332('0x46')]['get']({'plain':!![]});if(!_0x92dc7b)throw new Error(_0xb332('0x47'));if(_0x92dc7b[_0xb332('0x50')]==='user'){var _0x3a268a=_0x4ad24a['get']({'plain':!![]});var _0x4fe292=_0xb332('0x23');return db['UserProfileSection'][_0xb332('0x43')]({'where':{'name':_0x4fe292,'userProfileId':_0x92dc7b[_0xb332('0x48')]},'raw':!![]})[_0xb332('0x20')](function(_0x4aca7b){if(_0x4aca7b&&_0x4aca7b[_0xb332('0x49')]===0x0){return db[_0xb332('0x4a')]['create']({'name':_0x3a268a[_0xb332('0x27')],'resourceId':_0x3a268a['id'],'type':_0x4aca7b['name'],'sectionId':_0x4aca7b['id']},{})[_0xb332('0x20')](function(){return _0x4ad24a;});}else{return _0x4ad24a;}})[_0xb332('0x40')](function(_0x8a142f){logger[_0xb332('0x25')](_0xb332('0x51'),_0x8a142f);throw _0x8a142f;});}return _0x4ad24a;});}})[_0xb332('0x20')](respondWithResult(_0x1c991a,0xc9))[_0xb332('0x40')](handleError(_0x1c991a,null));};exports[_0xb332('0x52')]=function(_0x3c2c70,_0x510dcd){if(_0x3c2c70['body']['id']){delete _0x3c2c70[_0xb332('0x45')]['id'];}return db[_0xb332('0x2a')][_0xb332('0x43')]({'where':{'id':_0x3c2c70[_0xb332('0x4c')]['id']}})[_0xb332('0x20')](handleEntityNotFound(_0x510dcd,null))[_0xb332('0x20')](saveUpdates(_0x3c2c70[_0xb332('0x45')],null))['then'](respondWithResult(_0x510dcd,null))[_0xb332('0x40')](handleError(_0x510dcd,null));};exports[_0xb332('0x21')]=function(_0x55500f,_0x132b7e){return db[_0xb332('0x2a')]['find']({'where':{'id':_0x55500f[_0xb332('0x4c')]['id']}})[_0xb332('0x20')](handleEntityNotFound(_0x132b7e,null))[_0xb332('0x20')](removeEntity(_0x132b7e,null))[_0xb332('0x40')](handleError(_0x132b7e,null));};exports[_0xb332('0x53')]=function(_0x47ddf2,_0x11a085,_0x3f833f){var _0x19b5ef={'raw':!![],'where':{}};var _0x6c7435={};var _0x52f8a9={'count':0x0,'rows':[]};return db['JscriptyProject']['findOne']({'where':{'id':_0x47ddf2['params']['id']}})[_0xb332('0x20')](handleEntityNotFound(_0x11a085,null))['then'](function(_0x2a416f){if(_0x2a416f){_0x6c7435[_0xb332('0x2d')]=_[_0xb332('0x30')](db[_0xb332('0x54')][_0xb332('0x2b')]);_0x6c7435['query']=_[_0xb332('0x30')](_0x47ddf2['query']);_0x6c7435['filters']=_[_0xb332('0x42')](_0x6c7435[_0xb332('0x2d')],_0x6c7435[_0xb332('0x2f')]);_0x19b5ef['attributes']=_[_0xb332('0x42')](_0x6c7435[_0xb332('0x2d')],qs[_0xb332('0x32')](_0x47ddf2[_0xb332('0x2f')][_0xb332('0x32')]));_0x19b5ef[_0xb332('0x31')]=_0x19b5ef[_0xb332('0x31')][_0xb332('0x33')]?_0x19b5ef[_0xb332('0x31')]:_0x6c7435['model'];if(!_0x47ddf2[_0xb332('0x2f')][_0xb332('0x34')]('nolimit')){_0x19b5ef[_0xb332('0x1e')]=qs[_0xb332('0x1e')](_0x47ddf2[_0xb332('0x2f')][_0xb332('0x1e')]);_0x19b5ef[_0xb332('0x1b')]=qs[_0xb332('0x1b')](_0x47ddf2['query'][_0xb332('0x1b')]);}_0x19b5ef[_0xb332('0x36')]=qs[_0xb332('0x37')](_0x47ddf2['query'][_0xb332('0x37')]);_0x19b5ef['where']=qs[_0xb332('0x39')](_[_0xb332('0x55')](_0x47ddf2[_0xb332('0x2f')],_0x6c7435[_0xb332('0x39')]));_0x19b5ef[_0xb332('0x38')][_0xb332('0x56')]=_0x2a416f['id'];if(_0x47ddf2[_0xb332('0x2f')][_0xb332('0x3a')]){_0x19b5ef['where']=_[_0xb332('0x3b')](_0x19b5ef[_0xb332('0x38')],{'$or':_[_0xb332('0x2e')](_0x19b5ef[_0xb332('0x31')],function(_0x82d7e7){var _0x4fcd31={};_0x4fcd31[_0x82d7e7]={'$like':'%'+_0x47ddf2[_0xb332('0x2f')]['filter']+'%'};return _0x4fcd31;})});}_0x19b5ef=_[_0xb332('0x3b')]({},_0x19b5ef,_0x47ddf2['options']);return db['JscriptySessionReport']['count']({'where':_0x19b5ef[_0xb332('0x38')]})[_0xb332('0x20')](function(_0x57d0cb){_0x52f8a9[_0xb332('0x1d')]=_0x57d0cb;if(_0x47ddf2[_0xb332('0x2f')][_0xb332('0x3c')]){_0x19b5ef[_0xb332('0x3d')]=[{'all':!![]}];}return db[_0xb332('0x54')][_0xb332('0x3e')](_0x19b5ef);})[_0xb332('0x20')](function(_0x591c31){_0x52f8a9['rows']=_0x591c31;return _0x52f8a9;});}})[_0xb332('0x20')](respondWithFilteredResult(_0x11a085,_0x19b5ef))[_0xb332('0x40')](handleError(_0x11a085,null));};exports[_0xb332('0x57')]=function(_0x354d67,_0x5f0242,_0x2ab2dc){var _0x361a63={'raw':!![],'where':{}};var _0xfb349f={};var _0x478d33={'count':0x0,'rows':[]};return db['JscriptyProject'][_0xb332('0x58')]({'where':{'id':_0x354d67[_0xb332('0x4c')]['id']}})['then'](handleEntityNotFound(_0x5f0242,null))[_0xb332('0x20')](function(_0xae5e68){if(_0xae5e68){_0xfb349f['model']=_[_0xb332('0x30')](db[_0xb332('0x59')][_0xb332('0x2b')]);_0xfb349f[_0xb332('0x2f')]=_[_0xb332('0x30')](_0x354d67['query']);_0xfb349f[_0xb332('0x39')]=_[_0xb332('0x42')](_0xfb349f[_0xb332('0x2d')],_0xfb349f[_0xb332('0x2f')]);_0x361a63['attributes']=_['intersection'](_0xfb349f[_0xb332('0x2d')],qs[_0xb332('0x32')](_0x354d67[_0xb332('0x2f')][_0xb332('0x32')]));_0x361a63['attributes']=_0x361a63[_0xb332('0x31')]['length']?_0x361a63[_0xb332('0x31')]:_0xfb349f[_0xb332('0x2d')];if(!_0x354d67[_0xb332('0x2f')][_0xb332('0x34')](_0xb332('0x35'))){_0x361a63[_0xb332('0x1e')]=qs['limit'](_0x354d67[_0xb332('0x2f')][_0xb332('0x1e')]);_0x361a63[_0xb332('0x1b')]=qs['offset'](_0x354d67[_0xb332('0x2f')][_0xb332('0x1b')]);}_0x361a63[_0xb332('0x36')]=qs[_0xb332('0x37')](_0x354d67[_0xb332('0x2f')][_0xb332('0x37')]);_0x361a63[_0xb332('0x38')]=qs[_0xb332('0x39')](_['pick'](_0x354d67[_0xb332('0x2f')],_0xfb349f['filters']));_0x361a63[_0xb332('0x38')][_0xb332('0x56')]=_0xae5e68['id'];if(_0x354d67[_0xb332('0x2f')][_0xb332('0x3a')]){_0x361a63['where']=_[_0xb332('0x3b')](_0x361a63[_0xb332('0x38')],{'$or':_[_0xb332('0x2e')](_0x361a63['attributes'],function(_0x4ba07f){var _0x182e5e={};_0x182e5e[_0x4ba07f]={'$like':'%'+_0x354d67[_0xb332('0x2f')][_0xb332('0x3a')]+'%'};return _0x182e5e;})});}_0x361a63=_[_0xb332('0x3b')]({},_0x361a63,_0x354d67['options']);return db[_0xb332('0x59')][_0xb332('0x1d')]({'where':_0x361a63[_0xb332('0x38')]})['then'](function(_0x35d9d2){_0x478d33[_0xb332('0x1d')]=_0x35d9d2;if(_0x354d67['query'][_0xb332('0x3c')]){_0x361a63[_0xb332('0x3d')]=[{'all':!![]}];}return db[_0xb332('0x59')]['findAll'](_0x361a63);})[_0xb332('0x20')](function(_0x182e98){_0x478d33['rows']=_0x182e98;return _0x478d33;});}})['then'](respondWithFilteredResult(_0x5f0242,_0x361a63))['catch'](handleError(_0x5f0242,null));};function char(_0x259552){return _0xb332('0x5a')===typeof _0x259552?String[_0xb332('0x5b')][_0xb332('0x5c')](null,arguments):_0x259552;}function needsEncapsulation(_0x25e317){return!!_0x25e317&&(_0x25e317[_0xb332('0x5d')]()[_0xb332('0x5e')](char(0xd))>=0x0||_0x25e317[_0xb332('0x5d')]()['indexOf'](char(0xa))>=0x0||_0x25e317[_0xb332('0x5d')]()[_0xb332('0x5e')](char(0x2c))>=0x0||_0x25e317[_0xb332('0x5d')]()['indexOf'](char(0x22))>=0x0);}function encapsulate(_0x105e8f){var _0x58d0ee=char(0x22),_0x112068='\x5c'+char(0x22),_0x3b5c66=_0x105e8f[_0xb332('0x5d')]()[_0xb332('0x5f')](new RegExp(_0x58d0ee,'g'),_0x112068);return _0x58d0ee+_0x3b5c66+_0x58d0ee;}exports[_0xb332('0x60')]=function(_0x48029f,_0x10dccd,_0x5a954a){var _0x336a92,_0xf62573;var _0x1079c8={'where':{'ProjectId':_0x48029f['params']['id']}};if(_0x48029f['query'][_0xb332('0x61')]){_0x1079c8['where'][_0xb332('0x62')]=JSON[_0xb332('0x63')](_0x48029f[_0xb332('0x2f')]['startTime']);}return db['JscriptySessionReport']['findAll'](_0x1079c8)[_0xb332('0x20')](handleEntityNotFound(_0x10dccd,null))[_0xb332('0x20')](function(_0x4a9a8c){if(_0x4a9a8c){_0x336a92=_0x4a9a8c;return db['JscriptyQuestionReport'][_0xb332('0x3e')]({'where':{'SessionId':{'$in':_[_0xb332('0x2e')](_0x336a92,'id')},'ProjectId':_0x48029f[_0xb332('0x4c')]['id']},'order':'-createdAt'});}})[_0xb332('0x20')](handleEntityNotFound(_0x10dccd,null))[_0xb332('0x20')](function(_0x1c7d47){if(_0x1c7d47){_0xf62573=_0x1c7d47;var _0x4e6525={};for(var _0xf9390d=0x0,_0x4bd440=_0xf62573[_0xb332('0x33')];_0xf9390d<_0x4bd440;_0xf9390d++){if(!_0x4e6525['hasOwnProperty'](_0xf62573[_0xf9390d]['questionId'])){_0x4e6525[_0xf62573[_0xf9390d][_0xb332('0x64')]]=needsEncapsulation(_0xf62573[_0xf9390d][_0xb332('0x65')])?encapsulate(_0xf62573[_0xf9390d]['question']):_0xf62573[_0xf9390d][_0xb332('0x65')];}}var _0x4e9be9=[],_0x40c011={};for(var _0x17684f=0x0,_0x1c0099=_0x336a92[_0xb332('0x33')];_0x17684f<_0x1c0099;_0x17684f++){_0x40c011={'ProjectId':_0x48029f[_0xb332('0x4c')]['id'],'SessionId':_0x336a92[_0x17684f]['id'],'StartTime':moment(_0x336a92[_0x17684f][_0xb332('0x62')])['format'](_0xb332('0x66'))};for(var _0x50f6eb=0x0,_0x29f5e6=_0xf62573[_0xb332('0x33')];_0x50f6eb<_0x29f5e6;_0x50f6eb++){if(_0xf62573[_0x50f6eb][_0xb332('0x67')]==_0x336a92[_0x17684f]['id']&&_0x4e6525[_0xb332('0x34')](_0xf62573[_0x50f6eb]['questionId'])){_0x40c011[_0x4e6525[_0xf62573[_0x50f6eb]['questionId']]]=_0xf62573[_0x50f6eb][_0xb332('0x68')];}}for(var _0x1fee40 in _0x4e6525){if(!_0x40c011['hasOwnProperty'](_0x4e6525[_0x1fee40])){_0x40c011[_0x4e6525[_0x1fee40]]=null;}}_0x4e9be9[_0xb332('0x69')](_0x40c011);}return _0x4e9be9;}})[_0xb332('0x20')](function(_0xede505){if(!_[_0xb332('0x6a')](_0xede505)){var _0x13c430=toCsv(_0xede505);var _0x26b353=Date[_0xb332('0x6b')]();fs[_0xb332('0x6c')](util['format'](_0xb332('0x6d'),_0x48029f[_0xb332('0x4c')]['id'],_0x26b353),_0x13c430);_0x10dccd[_0xb332('0x6e')](_0xb332('0x6f'),'attachment;\x20filename='+util['format']('Jscripty_Project_%d_Summary_%s.csv',_0x48029f[_0xb332('0x4c')]['id'],_0x26b353));_0x10dccd[_0xb332('0x6e')](_0xb332('0x70'),'text/csv');return _0x10dccd['download'](util['format'](_0xb332('0x6d'),_0x48029f[_0xb332('0x4c')]['id'],_0x26b353));}else{return _0x10dccd[_0xb332('0x18')](0xcc);}})[_0xb332('0x40')](handleError(_0x10dccd,null));};
\ No newline at end of file
+var _0x3cd0=['number','toString','indexOf','replace','startTime','starttime','JscriptyQuestionReport','questionId','question','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','isEmpty','writeFileSync','format','setHeader','Content-disposition','attachment;\x20filename=','Content-type','text/csv','download','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','update','then','destroy','get','Projects','sendStatus','error','stack','name','send','index','map','JscriptyProject','rawAttributes','fieldName','type','key','model','query','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filters','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','omit','createdAt','updatedAt','getSessions','JscriptySessionReport','hasOwnProperty','ProjectId','findOne','JscriptyAnswerReport'];(function(_0x56144a,_0x54ee8a){var _0x4e7919=function(_0x48bd2c){while(--_0x48bd2c){_0x56144a['push'](_0x56144a['shift']());}};_0x4e7919(++_0x54ee8a);}(_0x3cd0,0x8a));var _0x03cd=function(_0x1bf809,_0x536f55){_0x1bf809=_0x1bf809-0x0;var _0x1caa4e=_0x3cd0[_0x1bf809];return _0x1caa4e;};'use strict';var emlformat=require(_0x03cd('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x03cd('0x1'));var rp=require('request-promise');var moment=require(_0x03cd('0x2'));var BPromise=require(_0x03cd('0x3'));var Mustache=require(_0x03cd('0x4'));var util=require(_0x03cd('0x5'));var path=require(_0x03cd('0x6'));var sox=require('sox');var csv=require(_0x03cd('0x7'));var ejs=require(_0x03cd('0x8'));var fs=require('fs');var fs_extra=require(_0x03cd('0x9'));var _=require(_0x03cd('0xa'));var squel=require(_0x03cd('0xb'));var crypto=require('crypto');var jsforce=require(_0x03cd('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x03cd('0x7'));var querystring=require(_0x03cd('0xd'));var Papa=require(_0x03cd('0xe'));var Redis=require(_0x03cd('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x03cd('0x10'));var as=require(_0x03cd('0x11'));var hardwareService=require(_0x03cd('0x12'));var logger=require(_0x03cd('0x13'))(_0x03cd('0x14'));var utils=require(_0x03cd('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x03cd('0x16'))['db'];function respondWithStatusCode(_0x315a6c,_0xaa6a21){_0xaa6a21=_0xaa6a21||0xcc;return function(_0x1d88e6){if(_0x1d88e6){return _0x315a6c['sendStatus'](_0xaa6a21);}return _0x315a6c[_0x03cd('0x17')](_0xaa6a21)[_0x03cd('0x18')]();};}function respondWithResult(_0x5d0c1c,_0x4f8f17){_0x4f8f17=_0x4f8f17||0xc8;return function(_0x58c000){if(_0x58c000){return _0x5d0c1c[_0x03cd('0x17')](_0x4f8f17)[_0x03cd('0x19')](_0x58c000);}};}function respondWithFilteredResult(_0x17961d,_0x77b1bf){return function(_0x526102){if(_0x526102){var _0xdf7488=typeof _0x77b1bf[_0x03cd('0x1a')]===_0x03cd('0x1b')&&typeof _0x77b1bf[_0x03cd('0x1c')]===_0x03cd('0x1b');var _0x5ac997=_0x526102[_0x03cd('0x1d')];var _0x27de4f=_0xdf7488?0x0:_0x77b1bf[_0x03cd('0x1a')];var _0x12b3ea=_0xdf7488?_0x526102[_0x03cd('0x1d')]:_0x77b1bf['offset']+_0x77b1bf[_0x03cd('0x1c')];var _0xa1122b;if(_0x12b3ea>=_0x5ac997){_0x12b3ea=_0x5ac997;_0xa1122b=0xc8;}else{_0xa1122b=0xce;}_0x17961d[_0x03cd('0x17')](_0xa1122b);return _0x17961d[_0x03cd('0x1e')]('Content-Range',_0x27de4f+'-'+_0x12b3ea+'/'+_0x5ac997)[_0x03cd('0x19')](_0x526102);}return null;};}function patchUpdates(_0x4d0a58){return function(_0x1d51fa){try{jsonpatch[_0x03cd('0x1f')](_0x1d51fa,_0x4d0a58,!![]);}catch(_0x85ac1b){return BPromise['reject'](_0x85ac1b);}return _0x1d51fa['save']();};}function saveUpdates(_0x255c96,_0x19ad78){return function(_0x4e8ff6){if(_0x4e8ff6){return _0x4e8ff6[_0x03cd('0x20')](_0x255c96)[_0x03cd('0x21')](function(_0x56ec2b){return _0x56ec2b;});}return null;};}function removeEntity(_0x440df7,_0x514c11){return function(_0x4f1b33){if(_0x4f1b33){return _0x4f1b33[_0x03cd('0x22')]()[_0x03cd('0x21')](function(){var _0x103de4=_0x4f1b33[_0x03cd('0x23')]({'plain':!![]});var _0x5173e9=_0x03cd('0x24');return db['UserProfileResource']['destroy']({'where':{'type':_0x5173e9,'resourceId':_0x103de4['id']}})[_0x03cd('0x21')](function(){return _0x4f1b33;});})[_0x03cd('0x21')](function(){_0x440df7[_0x03cd('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4f8b00,_0x709473){return function(_0x4f7fb5){if(!_0x4f7fb5){_0x4f8b00[_0x03cd('0x25')](0x194);}return _0x4f7fb5;};}function handleError(_0x1e8e6e,_0x5b976d){_0x5b976d=_0x5b976d||0x1f4;return function(_0x13242a){logger[_0x03cd('0x26')](_0x13242a[_0x03cd('0x27')]);if(_0x13242a[_0x03cd('0x28')]){delete _0x13242a[_0x03cd('0x28')];}_0x1e8e6e['status'](_0x5b976d)[_0x03cd('0x29')](_0x13242a);};}exports[_0x03cd('0x2a')]=function(_0x3bc711,_0x1e8827){var _0x4e43c2={},_0x1a3b3e={},_0x1e2eff={'count':0x0,'rows':[]};var _0x2b9e23=_[_0x03cd('0x2b')](db[_0x03cd('0x2c')][_0x03cd('0x2d')],function(_0x27e8a1){return{'name':_0x27e8a1[_0x03cd('0x2e')],'type':_0x27e8a1[_0x03cd('0x2f')][_0x03cd('0x30')]};});_0x1a3b3e[_0x03cd('0x31')]=_[_0x03cd('0x2b')](_0x2b9e23,_0x03cd('0x28'));_0x1a3b3e['query']=_['keys'](_0x3bc711[_0x03cd('0x32')]);_0x1a3b3e['filters']=_[_0x03cd('0x33')](_0x1a3b3e[_0x03cd('0x31')],_0x1a3b3e['query']);_0x4e43c2['attributes']=_[_0x03cd('0x33')](_0x1a3b3e[_0x03cd('0x31')],qs[_0x03cd('0x34')](_0x3bc711[_0x03cd('0x32')]['fields']));_0x4e43c2[_0x03cd('0x35')]=_0x4e43c2[_0x03cd('0x35')][_0x03cd('0x36')]?_0x4e43c2[_0x03cd('0x35')]:_0x1a3b3e[_0x03cd('0x31')];if(!_0x3bc711[_0x03cd('0x32')]['hasOwnProperty'](_0x03cd('0x37'))){_0x4e43c2[_0x03cd('0x1c')]=qs[_0x03cd('0x1c')](_0x3bc711['query'][_0x03cd('0x1c')]);_0x4e43c2[_0x03cd('0x1a')]=qs[_0x03cd('0x1a')](_0x3bc711[_0x03cd('0x32')][_0x03cd('0x1a')]);}_0x4e43c2[_0x03cd('0x38')]=qs[_0x03cd('0x39')](_0x3bc711['query'][_0x03cd('0x39')]);_0x4e43c2[_0x03cd('0x3a')]=qs['filters'](_[_0x03cd('0x3b')](_0x3bc711[_0x03cd('0x32')],_0x1a3b3e[_0x03cd('0x3c')]),_0x2b9e23);if(_0x3bc711[_0x03cd('0x32')]['filter']){_0x4e43c2[_0x03cd('0x3a')]=_[_0x03cd('0x3d')](_0x4e43c2[_0x03cd('0x3a')],{'$or':_[_0x03cd('0x2b')](_0x2b9e23,function(_0x163600){if(_0x163600[_0x03cd('0x2f')]!==_0x03cd('0x3e')){var _0x161d43={};_0x161d43[_0x163600['name']]={'$like':'%'+_0x3bc711['query'][_0x03cd('0x3f')]+'%'};return _0x161d43;}})});}_0x4e43c2=_[_0x03cd('0x3d')]({},_0x4e43c2,_0x3bc711[_0x03cd('0x40')]);var _0x37591c={'where':_0x4e43c2[_0x03cd('0x3a')]};return db['JscriptyProject'][_0x03cd('0x1d')](_0x37591c)[_0x03cd('0x21')](function(_0x473e2f){_0x1e2eff[_0x03cd('0x1d')]=_0x473e2f;if(_0x3bc711[_0x03cd('0x32')][_0x03cd('0x41')]){_0x4e43c2[_0x03cd('0x42')]=[{'all':!![]}];}return db[_0x03cd('0x2c')][_0x03cd('0x43')](_0x4e43c2);})[_0x03cd('0x21')](function(_0x59de59){_0x1e2eff[_0x03cd('0x44')]=_0x59de59;return _0x1e2eff;})[_0x03cd('0x21')](respondWithFilteredResult(_0x1e8827,_0x4e43c2))[_0x03cd('0x45')](handleError(_0x1e8827,null));};exports[_0x03cd('0x46')]=function(_0x24a9ce,_0x841ec){var _0xe7c542={'raw':![],'where':{'id':_0x24a9ce['params']['id']}},_0x55edce={};_0x55edce[_0x03cd('0x31')]=_[_0x03cd('0x47')](db[_0x03cd('0x2c')][_0x03cd('0x2d')]);_0x55edce[_0x03cd('0x32')]=_[_0x03cd('0x47')](_0x24a9ce[_0x03cd('0x32')]);_0x55edce['filters']=_[_0x03cd('0x33')](_0x55edce[_0x03cd('0x31')],_0x55edce[_0x03cd('0x32')]);_0xe7c542[_0x03cd('0x35')]=_[_0x03cd('0x33')](_0x55edce[_0x03cd('0x31')],qs['fields'](_0x24a9ce['query']['fields']));_0xe7c542['attributes']=_0xe7c542[_0x03cd('0x35')][_0x03cd('0x36')]?_0xe7c542[_0x03cd('0x35')]:_0x55edce[_0x03cd('0x31')];if(_0x24a9ce[_0x03cd('0x32')][_0x03cd('0x41')]){_0xe7c542[_0x03cd('0x42')]=[{'all':!![]}];}_0xe7c542=_[_0x03cd('0x3d')]({},_0xe7c542,_0x24a9ce['options']);return db['JscriptyProject'][_0x03cd('0x48')](_0xe7c542)[_0x03cd('0x21')](handleEntityNotFound(_0x841ec,null))['then'](respondWithResult(_0x841ec,null))['catch'](handleError(_0x841ec,null));};exports['create']=function(_0xbb7b57,_0x2e10c4){return db['JscriptyProject'][_0x03cd('0x49')](_0xbb7b57[_0x03cd('0x4a')],{})[_0x03cd('0x21')](function(_0x5cc9ff){var _0x3c624d=_0xbb7b57[_0x03cd('0x4b')][_0x03cd('0x23')]({'plain':!![]});if(!_0x3c624d)throw new Error(_0x03cd('0x4c'));if(_0x3c624d[_0x03cd('0x4d')]==='user'){var _0x27107b=_0x5cc9ff[_0x03cd('0x23')]({'plain':!![]});var _0x197a97=_0x03cd('0x24');return db[_0x03cd('0x4e')][_0x03cd('0x48')]({'where':{'name':_0x197a97,'userProfileId':_0x3c624d[_0x03cd('0x4f')]},'raw':!![]})['then'](function(_0x1129f5){if(_0x1129f5&&_0x1129f5[_0x03cd('0x50')]===0x0){return db[_0x03cd('0x51')][_0x03cd('0x49')]({'name':_0x27107b[_0x03cd('0x28')],'resourceId':_0x27107b['id'],'type':_0x1129f5[_0x03cd('0x28')],'sectionId':_0x1129f5['id']},{})[_0x03cd('0x21')](function(){return _0x5cc9ff;});}else{return _0x5cc9ff;}})['catch'](function(_0x437429){logger[_0x03cd('0x26')](_0x03cd('0x52'),_0x437429);throw _0x437429;});}return _0x5cc9ff;})[_0x03cd('0x21')](respondWithResult(_0x2e10c4,0xc9))['catch'](handleError(_0x2e10c4,null));};exports[_0x03cd('0x53')]=function(_0x27871b,_0x1299eb){var _0x3d611b={'where':{'id':_0x27871b[_0x03cd('0x54')]['id']}},_0x40a22c={};_0x40a22c[_0x03cd('0x31')]=_[_0x03cd('0x47')](db[_0x03cd('0x2c')]['rawAttributes']);_0x3d611b[_0x03cd('0x35')]=_[_0x03cd('0x33')](_0x40a22c['model'],qs[_0x03cd('0x34')](_0x27871b['query']['fields']));_0x3d611b['attributes']=_0x3d611b[_0x03cd('0x35')][_0x03cd('0x36')]?_0x3d611b[_0x03cd('0x35')]:_0x40a22c[_0x03cd('0x31')];if(_0x27871b['query'][_0x03cd('0x41')]){_0x3d611b[_0x03cd('0x42')]=[{'all':!![]}];}_0x3d611b=_[_0x03cd('0x3d')]({},_0x3d611b,_0x27871b[_0x03cd('0x40')]);return db[_0x03cd('0x2c')][_0x03cd('0x48')](_0x3d611b)['then'](handleEntityNotFound(_0x1299eb,null))['then'](function(_0x4eedb2){if(_0x4eedb2){var _0x1a0f56=_0x4eedb2[_0x03cd('0x23')]({'plain':!![]});_0x1a0f56=qs[_0x03cd('0x55')](_0x1a0f56,['id',_0x03cd('0x56'),_0x03cd('0x57')]);_0x27871b[_0x03cd('0x4a')]=_[_0x03cd('0x55')](_0x27871b[_0x03cd('0x4a')],['id','createdAt',_0x03cd('0x57')]);return db[_0x03cd('0x2c')][_0x03cd('0x49')](_[_0x03cd('0x3d')](_0x1a0f56,_0x27871b[_0x03cd('0x4a')]),{'include':_0x27871b['query'][_0x03cd('0x41')]?[{'all':!![]}]:undefined})[_0x03cd('0x21')](function(_0x35899c){var _0x33667e=_0x27871b['user'][_0x03cd('0x23')]({'plain':!![]});if(!_0x33667e)throw new Error(_0x03cd('0x4c'));if(_0x33667e[_0x03cd('0x4d')]===_0x03cd('0x4b')){var _0x1225ba=_0x35899c[_0x03cd('0x23')]({'plain':!![]});var _0x2d47ac=_0x03cd('0x24');return db[_0x03cd('0x4e')]['find']({'where':{'name':_0x2d47ac,'userProfileId':_0x33667e['userProfileId']},'raw':!![]})[_0x03cd('0x21')](function(_0x28b109){if(_0x28b109&&_0x28b109[_0x03cd('0x50')]===0x0){return db['UserProfileResource']['create']({'name':_0x1225ba[_0x03cd('0x28')],'resourceId':_0x1225ba['id'],'type':_0x28b109[_0x03cd('0x28')],'sectionId':_0x28b109['id']},{})['then'](function(){return _0x35899c;});}else{return _0x35899c;}})[_0x03cd('0x45')](function(_0x122253){logger[_0x03cd('0x26')](_0x03cd('0x52'),_0x122253);throw _0x122253;});}return _0x35899c;});}})[_0x03cd('0x21')](respondWithResult(_0x1299eb,0xc9))[_0x03cd('0x45')](handleError(_0x1299eb,null));};exports[_0x03cd('0x20')]=function(_0xc012ca,_0x348393){if(_0xc012ca[_0x03cd('0x4a')]['id']){delete _0xc012ca[_0x03cd('0x4a')]['id'];}return db[_0x03cd('0x2c')]['find']({'where':{'id':_0xc012ca['params']['id']}})[_0x03cd('0x21')](handleEntityNotFound(_0x348393,null))[_0x03cd('0x21')](saveUpdates(_0xc012ca[_0x03cd('0x4a')],null))[_0x03cd('0x21')](respondWithResult(_0x348393,null))[_0x03cd('0x45')](handleError(_0x348393,null));};exports[_0x03cd('0x22')]=function(_0x5b5e3c,_0x35f1bb){return db[_0x03cd('0x2c')][_0x03cd('0x48')]({'where':{'id':_0x5b5e3c['params']['id']}})[_0x03cd('0x21')](handleEntityNotFound(_0x35f1bb,null))[_0x03cd('0x21')](removeEntity(_0x35f1bb,null))[_0x03cd('0x45')](handleError(_0x35f1bb,null));};exports[_0x03cd('0x58')]=function(_0x2bcfff,_0x5563b5,_0x453f4a){var _0x479271={'raw':!![],'where':{}};var _0x5a0c8f={};var _0x378f5f={'count':0x0,'rows':[]};return db[_0x03cd('0x2c')]['findOne']({'where':{'id':_0x2bcfff[_0x03cd('0x54')]['id']}})[_0x03cd('0x21')](handleEntityNotFound(_0x5563b5,null))['then'](function(_0x2d2921){if(_0x2d2921){_0x5a0c8f[_0x03cd('0x31')]=_[_0x03cd('0x47')](db[_0x03cd('0x59')][_0x03cd('0x2d')]);_0x5a0c8f[_0x03cd('0x32')]=_['keys'](_0x2bcfff[_0x03cd('0x32')]);_0x5a0c8f['filters']=_[_0x03cd('0x33')](_0x5a0c8f[_0x03cd('0x31')],_0x5a0c8f['query']);_0x479271[_0x03cd('0x35')]=_[_0x03cd('0x33')](_0x5a0c8f['model'],qs[_0x03cd('0x34')](_0x2bcfff[_0x03cd('0x32')][_0x03cd('0x34')]));_0x479271[_0x03cd('0x35')]=_0x479271['attributes']['length']?_0x479271[_0x03cd('0x35')]:_0x5a0c8f['model'];if(!_0x2bcfff['query'][_0x03cd('0x5a')](_0x03cd('0x37'))){_0x479271[_0x03cd('0x1c')]=qs[_0x03cd('0x1c')](_0x2bcfff[_0x03cd('0x32')]['limit']);_0x479271[_0x03cd('0x1a')]=qs[_0x03cd('0x1a')](_0x2bcfff[_0x03cd('0x32')][_0x03cd('0x1a')]);}_0x479271[_0x03cd('0x38')]=qs[_0x03cd('0x39')](_0x2bcfff['query'][_0x03cd('0x39')]);_0x479271['where']=qs[_0x03cd('0x3c')](_['pick'](_0x2bcfff['query'],_0x5a0c8f['filters']));_0x479271['where'][_0x03cd('0x5b')]=_0x2d2921['id'];if(_0x2bcfff[_0x03cd('0x32')][_0x03cd('0x3f')]){_0x479271[_0x03cd('0x3a')]=_[_0x03cd('0x3d')](_0x479271[_0x03cd('0x3a')],{'$or':_[_0x03cd('0x2b')](_0x479271['attributes'],function(_0x5e5168){var _0x4a2969={};_0x4a2969[_0x5e5168]={'$like':'%'+_0x2bcfff['query'][_0x03cd('0x3f')]+'%'};return _0x4a2969;})});}_0x479271=_[_0x03cd('0x3d')]({},_0x479271,_0x2bcfff['options']);return db[_0x03cd('0x59')][_0x03cd('0x1d')]({'where':_0x479271[_0x03cd('0x3a')]})['then'](function(_0x1e951e){_0x378f5f[_0x03cd('0x1d')]=_0x1e951e;if(_0x2bcfff[_0x03cd('0x32')]['includeAll']){_0x479271[_0x03cd('0x42')]=[{'all':!![]}];}return db['JscriptySessionReport'][_0x03cd('0x43')](_0x479271);})['then'](function(_0x5a278d){_0x378f5f['rows']=_0x5a278d;return _0x378f5f;});}})['then'](respondWithFilteredResult(_0x5563b5,_0x479271))[_0x03cd('0x45')](handleError(_0x5563b5,null));};exports['getAnswers']=function(_0x2edb21,_0x63ccbb,_0x612a8f){var _0x2663dc={'raw':!![],'where':{}};var _0x326b99={};var _0x3308c2={'count':0x0,'rows':[]};return db[_0x03cd('0x2c')][_0x03cd('0x5c')]({'where':{'id':_0x2edb21['params']['id']}})[_0x03cd('0x21')](handleEntityNotFound(_0x63ccbb,null))[_0x03cd('0x21')](function(_0x5b4d52){if(_0x5b4d52){_0x326b99['model']=_[_0x03cd('0x47')](db[_0x03cd('0x5d')][_0x03cd('0x2d')]);_0x326b99[_0x03cd('0x32')]=_[_0x03cd('0x47')](_0x2edb21['query']);_0x326b99[_0x03cd('0x3c')]=_['intersection'](_0x326b99[_0x03cd('0x31')],_0x326b99[_0x03cd('0x32')]);_0x2663dc[_0x03cd('0x35')]=_['intersection'](_0x326b99[_0x03cd('0x31')],qs[_0x03cd('0x34')](_0x2edb21[_0x03cd('0x32')]['fields']));_0x2663dc[_0x03cd('0x35')]=_0x2663dc[_0x03cd('0x35')][_0x03cd('0x36')]?_0x2663dc[_0x03cd('0x35')]:_0x326b99['model'];if(!_0x2edb21[_0x03cd('0x32')]['hasOwnProperty'](_0x03cd('0x37'))){_0x2663dc['limit']=qs[_0x03cd('0x1c')](_0x2edb21[_0x03cd('0x32')]['limit']);_0x2663dc[_0x03cd('0x1a')]=qs[_0x03cd('0x1a')](_0x2edb21[_0x03cd('0x32')][_0x03cd('0x1a')]);}_0x2663dc['order']=qs['sort'](_0x2edb21[_0x03cd('0x32')][_0x03cd('0x39')]);_0x2663dc[_0x03cd('0x3a')]=qs[_0x03cd('0x3c')](_[_0x03cd('0x3b')](_0x2edb21['query'],_0x326b99[_0x03cd('0x3c')]));_0x2663dc[_0x03cd('0x3a')]['ProjectId']=_0x5b4d52['id'];if(_0x2edb21[_0x03cd('0x32')][_0x03cd('0x3f')]){_0x2663dc[_0x03cd('0x3a')]=_[_0x03cd('0x3d')](_0x2663dc[_0x03cd('0x3a')],{'$or':_[_0x03cd('0x2b')](_0x2663dc['attributes'],function(_0x37a517){var _0x1c170e={};_0x1c170e[_0x37a517]={'$like':'%'+_0x2edb21['query'][_0x03cd('0x3f')]+'%'};return _0x1c170e;})});}_0x2663dc=_[_0x03cd('0x3d')]({},_0x2663dc,_0x2edb21[_0x03cd('0x40')]);return db[_0x03cd('0x5d')][_0x03cd('0x1d')]({'where':_0x2663dc[_0x03cd('0x3a')]})[_0x03cd('0x21')](function(_0x290b03){_0x3308c2[_0x03cd('0x1d')]=_0x290b03;if(_0x2edb21['query'][_0x03cd('0x41')]){_0x2663dc[_0x03cd('0x42')]=[{'all':!![]}];}return db[_0x03cd('0x5d')]['findAll'](_0x2663dc);})[_0x03cd('0x21')](function(_0x4991d7){_0x3308c2['rows']=_0x4991d7;return _0x3308c2;});}})[_0x03cd('0x21')](respondWithFilteredResult(_0x63ccbb,_0x2663dc))['catch'](handleError(_0x63ccbb,null));};function char(_0x2f8395){return _0x03cd('0x5e')===typeof _0x2f8395?String['fromCharCode']['apply'](null,arguments):_0x2f8395;}function needsEncapsulation(_0x307b0f){return!!_0x307b0f&&(_0x307b0f[_0x03cd('0x5f')]()[_0x03cd('0x60')](char(0xd))>=0x0||_0x307b0f[_0x03cd('0x5f')]()['indexOf'](char(0xa))>=0x0||_0x307b0f[_0x03cd('0x5f')]()[_0x03cd('0x60')](char(0x2c))>=0x0||_0x307b0f[_0x03cd('0x5f')]()[_0x03cd('0x60')](char(0x22))>=0x0);}function encapsulate(_0x420b20){var _0x4d995e=char(0x22),_0x4c98c2='\x5c'+char(0x22),_0x56be82=_0x420b20['toString']()[_0x03cd('0x61')](new RegExp(_0x4d995e,'g'),_0x4c98c2);return _0x4d995e+_0x56be82+_0x4d995e;}exports['getSummary']=function(_0x590cb3,_0x3a52f3,_0x29a2eb){var _0x8fa219,_0x32cf34;var _0x46ff2d={'where':{'ProjectId':_0x590cb3[_0x03cd('0x54')]['id']}};if(_0x590cb3[_0x03cd('0x32')][_0x03cd('0x62')]){_0x46ff2d[_0x03cd('0x3a')][_0x03cd('0x63')]=JSON['parse'](_0x590cb3[_0x03cd('0x32')][_0x03cd('0x62')]);}return db[_0x03cd('0x59')][_0x03cd('0x43')](_0x46ff2d)[_0x03cd('0x21')](handleEntityNotFound(_0x3a52f3,null))['then'](function(_0x19721f){if(_0x19721f){_0x8fa219=_0x19721f;return db[_0x03cd('0x64')][_0x03cd('0x43')]({'where':{'SessionId':{'$in':_[_0x03cd('0x2b')](_0x8fa219,'id')},'ProjectId':_0x590cb3[_0x03cd('0x54')]['id']},'order':'-createdAt'});}})[_0x03cd('0x21')](handleEntityNotFound(_0x3a52f3,null))['then'](function(_0x297afb){if(_0x297afb){_0x32cf34=_0x297afb;var _0x21deb7={};for(var _0x1cbd54=0x0,_0x3b3f88=_0x32cf34[_0x03cd('0x36')];_0x1cbd54<_0x3b3f88;_0x1cbd54++){if(!_0x21deb7[_0x03cd('0x5a')](_0x32cf34[_0x1cbd54][_0x03cd('0x65')])){_0x21deb7[_0x32cf34[_0x1cbd54]['questionId']]=needsEncapsulation(_0x32cf34[_0x1cbd54][_0x03cd('0x66')])?encapsulate(_0x32cf34[_0x1cbd54][_0x03cd('0x66')]):_0x32cf34[_0x1cbd54][_0x03cd('0x66')];}}var _0x428e58=[],_0x20654b={};for(var _0x595073=0x0,_0xe02492=_0x8fa219[_0x03cd('0x36')];_0x595073<_0xe02492;_0x595073++){_0x20654b={'ProjectId':_0x590cb3[_0x03cd('0x54')]['id'],'SessionId':_0x8fa219[_0x595073]['id'],'StartTime':moment(_0x8fa219[_0x595073][_0x03cd('0x63')])['format'](_0x03cd('0x67'))};for(var _0x177e76=0x0,_0x2f9489=_0x32cf34[_0x03cd('0x36')];_0x177e76<_0x2f9489;_0x177e76++){if(_0x32cf34[_0x177e76][_0x03cd('0x68')]==_0x8fa219[_0x595073]['id']&&_0x21deb7['hasOwnProperty'](_0x32cf34[_0x177e76][_0x03cd('0x65')])){_0x20654b[_0x21deb7[_0x32cf34[_0x177e76]['questionId']]]=_0x32cf34[_0x177e76][_0x03cd('0x69')];}}for(var _0x3df24d in _0x21deb7){if(!_0x20654b[_0x03cd('0x5a')](_0x21deb7[_0x3df24d])){_0x20654b[_0x21deb7[_0x3df24d]]=null;}}_0x428e58[_0x03cd('0x6a')](_0x20654b);}return _0x428e58;}})[_0x03cd('0x21')](function(_0x296563){if(!_[_0x03cd('0x6b')](_0x296563)){var _0xa487b3=toCsv(_0x296563);var _0x45342b=Date['now']();fs[_0x03cd('0x6c')](util[_0x03cd('0x6d')]('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x590cb3['params']['id'],_0x45342b),_0xa487b3);_0x3a52f3[_0x03cd('0x6e')](_0x03cd('0x6f'),_0x03cd('0x70')+util[_0x03cd('0x6d')]('Jscripty_Project_%d_Summary_%s.csv',_0x590cb3[_0x03cd('0x54')]['id'],_0x45342b));_0x3a52f3[_0x03cd('0x6e')](_0x03cd('0x71'),_0x03cd('0x72'));return _0x3a52f3[_0x03cd('0x73')](util[_0x03cd('0x6d')]('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x590cb3[_0x03cd('0x54')]['id'],_0x45342b));}else{return _0x3a52f3[_0x03cd('0x25')](0xcc);}})[_0x03cd('0x45')](handleError(_0x3a52f3,null));};
\ No newline at end of file
index 587cd22..3e0a5de 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa786=['moment','bluebird','request-promise','path','rimraf','./jscriptyProject.attributes','exports','define','JscriptyProject','jscripty_projects','../../config/logger','api'];(function(_0x26e197,_0x114794){var _0xc6691d=function(_0x3c4aec){while(--_0x3c4aec){_0x26e197['push'](_0x26e197['shift']());}};_0xc6691d(++_0x114794);}(_0xa786,0x1d2));var _0x6a78=function(_0x80e5b8,_0x1480b2){_0x80e5b8=_0x80e5b8-0x0;var _0x663549=_0xa786[_0x80e5b8];return _0x663549;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x6a78('0x0'))(_0x6a78('0x1'));var moment=require(_0x6a78('0x2'));var BPromise=require(_0x6a78('0x3'));var rp=require(_0x6a78('0x4'));var fs=require('fs');var path=require(_0x6a78('0x5'));var rimraf=require(_0x6a78('0x6'));var config=require('../../config/environment');var attributes=require(_0x6a78('0x7'));module[_0x6a78('0x8')]=function(_0xc0be8b,_0x45470e){return _0xc0be8b[_0x6a78('0x9')](_0x6a78('0xa'),attributes,{'tableName':_0x6a78('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0f4d=['api','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptyProject.attributes','exports','define','JscriptyProject'];(function(_0x4a53d,_0x58a95e){var _0x27410e=function(_0x38fc90){while(--_0x38fc90){_0x4a53d['push'](_0x4a53d['shift']());}};_0x27410e(++_0x58a95e);}(_0x0f4d,0x12c));var _0xd0f4=function(_0x345802,_0x44c1b5){_0x345802=_0x345802-0x0;var _0x2308a5=_0x0f4d[_0x345802];return _0x2308a5;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xd0f4('0x0'));var moment=require('moment');var BPromise=require(_0xd0f4('0x1'));var rp=require(_0xd0f4('0x2'));var fs=require('fs');var path=require(_0xd0f4('0x3'));var rimraf=require(_0xd0f4('0x4'));var config=require(_0xd0f4('0x5'));var attributes=require(_0xd0f4('0x6'));module[_0xd0f4('0x7')]=function(_0x1d9a9d,_0x531f85){return _0x1d9a9d[_0xd0f4('0x8')](_0xd0f4('0x9'),attributes,{'tableName':'jscripty_projects','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index e396a85..c1d1fcf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe706=['http','request','then','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0xc5a3be,_0x3e11cf){var _0x193c24=function(_0x136712){while(--_0x136712){_0xc5a3be['push'](_0xc5a3be['shift']());}};_0x193c24(++_0x3e11cf);}(_0xe706,0xa3));var _0x6e70=function(_0x4ce15c,_0x1bbcbd){_0x4ce15c=_0x4ce15c-0x0;var _0x5ee259=_0xe706[_0x4ce15c];return _0x5ee259;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var moment=require(_0x6e70('0x2'));var BPromise=require('bluebird');var rs=require(_0x6e70('0x3'));var fs=require('fs');var Redis=require(_0x6e70('0x4'));var db=require(_0x6e70('0x5'))['db'];var utils=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));var config=require(_0x6e70('0x9'));var jayson=require(_0x6e70('0xa'));var client=jayson[_0x6e70('0xb')][_0x6e70('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x36357b,_0x293ce7,_0x45a2d4){return new BPromise(function(_0x188ed3,_0x3c4843){return client[_0x6e70('0xd')](_0x36357b,_0x45a2d4)[_0x6e70('0xe')](function(_0x25e61c){logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,_0x6e70('0x11'));logger[_0x6e70('0x12')](_0x6e70('0x13'),_0x293ce7,_0x6e70('0x11'),JSON['stringify'](_0x25e61c));if(_0x25e61c['error']){if(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x15')]===0x1f4){logger[_0x6e70('0x14')](_0x6e70('0x10'),_0x293ce7,_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);return _0x3c4843(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);}logger['error']('JscriptyProject,\x20%s,\x20%s',_0x293ce7,_0x25e61c['error'][_0x6e70('0x16')]);return _0x188ed3(_0x25e61c['error']['message']);}else{logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,'request\x20sent');_0x188ed3(_0x25e61c[_0x6e70('0x17')]['message']);}})[_0x6e70('0x18')](function(_0x161f23){logger['error']('JscriptyProject,\x20%s,\x20%s',_0x293ce7,_0x161f23);_0x3c4843(_0x161f23);});});}
\ No newline at end of file
+var _0xf4eb=['JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x2398b8,_0x4acb6c){var _0x3b2af1=function(_0x57512a){while(--_0x57512a){_0x2398b8['push'](_0x2398b8['shift']());}};_0x3b2af1(++_0x4acb6c);}(_0xf4eb,0xec));var _0xbf4e=function(_0x36e3a9,_0x24b7b3){_0x36e3a9=_0x36e3a9-0x0;var _0x43ac05=_0xf4eb[_0x36e3a9];return _0x43ac05;};'use strict';var _=require(_0xbf4e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbf4e('0x1'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xbf4e('0x2'))(_0xbf4e('0x3'));var config=require(_0xbf4e('0x4'));var jayson=require(_0xbf4e('0x5'));var client=jayson[_0xbf4e('0x6')][_0xbf4e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x15b99f,_0x540736,_0x449d55){return new BPromise(function(_0x5013c2,_0x5e23d4){return client[_0xbf4e('0x8')](_0x15b99f,_0x449d55)[_0xbf4e('0x9')](function(_0xcc4097){logger[_0xbf4e('0xa')](_0xbf4e('0xb'),_0x540736,_0xbf4e('0xc'));logger[_0xbf4e('0xd')]('JscriptyProject,\x20%s,\x20%s,\x20%s',_0x540736,'request\x20sent',JSON[_0xbf4e('0xe')](_0xcc4097));if(_0xcc4097['error']){if(_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x10')]===0x1f4){logger['error'](_0xbf4e('0xb'),_0x540736,_0xcc4097['error']['message']);return _0x5e23d4(_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x11')]);}logger[_0xbf4e('0xf')](_0xbf4e('0xb'),_0x540736,_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x11')]);return _0x5013c2(_0xcc4097['error']['message']);}else{logger[_0xbf4e('0xa')](_0xbf4e('0xb'),_0x540736,_0xbf4e('0xc'));_0x5013c2(_0xcc4097['result'][_0xbf4e('0x11')]);}})[_0xbf4e('0x12')](function(_0x912fc0){logger[_0xbf4e('0xf')]('JscriptyProject,\x20%s,\x20%s',_0x540736,_0x912fc0);_0x5e23d4(_0x912fc0);});});}
\ No newline at end of file
index 6548770..dba5335 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb0a2=['../../config/environment','get','index','describe','/:id','show','post','isAuthenticated','update','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x6211ff,_0x1d6e82){var _0x54df31=function(_0x578c4d){while(--_0x578c4d){_0x6211ff['push'](_0x6211ff['shift']());}};_0x54df31(++_0x1d6e82);}(_0xb0a2,0x11b));var _0x2b0a=function(_0x5a3a8d,_0x1b5a21){_0x5a3a8d=_0x5a3a8d-0x0;var _0x381523=_0xb0a2[_0x5a3a8d];return _0x381523;};'use strict';var multer=require(_0x2b0a('0x0'));var util=require(_0x2b0a('0x1'));var path=require(_0x2b0a('0x2'));var timeout=require(_0x2b0a('0x3'));var express=require(_0x2b0a('0x4'));var router=express[_0x2b0a('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x2b0a('0x6'));var controller=require('./jscriptyQuestionReport.controller');router[_0x2b0a('0x7')]('/',auth['isAuthenticated'](),controller[_0x2b0a('0x8')]);router[_0x2b0a('0x7')]('/describe',auth['isAuthenticated'](),controller[_0x2b0a('0x9')]);router[_0x2b0a('0x7')](_0x2b0a('0xa'),auth['isAuthenticated'](),controller[_0x2b0a('0xb')]);router[_0x2b0a('0xc')]('/',auth[_0x2b0a('0xd')](),controller['create']);router['put'](_0x2b0a('0xa'),auth['isAuthenticated'](),controller[_0x2b0a('0xe')]);router['delete'](_0x2b0a('0xa'),auth[_0x2b0a('0xd')](),controller[_0x2b0a('0xf')]);module[_0x2b0a('0x10')]=router;
\ No newline at end of file
+var _0x7bd6=['show','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./jscriptyQuestionReport.controller','get','isAuthenticated','/:id'];(function(_0x72305e,_0xeea264){var _0xdcf144=function(_0x41812f){while(--_0x41812f){_0x72305e['push'](_0x72305e['shift']());}};_0xdcf144(++_0xeea264);}(_0x7bd6,0x15b));var _0x67bd=function(_0x124f88,_0x3ad501){_0x124f88=_0x124f88-0x0;var _0xed0e3b=_0x7bd6[_0x124f88];return _0xed0e3b;};'use strict';var multer=require(_0x67bd('0x0'));var util=require(_0x67bd('0x1'));var path=require(_0x67bd('0x2'));var timeout=require(_0x67bd('0x3'));var express=require(_0x67bd('0x4'));var router=express[_0x67bd('0x5')]();var fs_extra=require(_0x67bd('0x6'));var auth=require(_0x67bd('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x67bd('0x8'));var controller=require(_0x67bd('0x9'));router[_0x67bd('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x67bd('0xa')]('/describe',auth[_0x67bd('0xb')](),controller['describe']);router['get'](_0x67bd('0xc'),auth[_0x67bd('0xb')](),controller[_0x67bd('0xd')]);router[_0x67bd('0xe')]('/',auth[_0x67bd('0xb')](),controller['create']);router[_0x67bd('0xf')](_0x67bd('0xc'),auth[_0x67bd('0xb')](),controller[_0x67bd('0x10')]);router[_0x67bd('0x11')](_0x67bd('0xc'),auth[_0x67bd('0xb')](),controller[_0x67bd('0x12')]);module[_0x67bd('0x13')]=router;
\ No newline at end of file
index ee45e43..58f40b0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x21549c,_0x6d64d1){var _0x426cbd=function(_0x323f5b){while(--_0x323f5b){_0x21549c['push'](_0x21549c['shift']());}};_0x426cbd(++_0x6d64d1);}(_0x7a54,0x106));var _0x47a5=function(_0x19e4cd,_0x51b1c5){_0x19e4cd=_0x19e4cd-0x0;var _0x462b9c=_0x7a54[_0x19e4cd];return _0x462b9c;};'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(_0x35885a,_0x42fed7){var _0xe86249=function(_0x98edb3){while(--_0x98edb3){_0x35885a['push'](_0x35885a['shift']());}};_0xe86249(++_0x42fed7);}(_0x7a54,0x106));var _0x47a5=function(_0xdee4ea,_0xce37fe){_0xdee4ea=_0xdee4ea-0x0;var _0x52f14e=_0x7a54[_0xdee4ea];return _0x52f14e;};'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 8bb2076..573e239 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa1ab=['to-csv','querystring','../../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','save','update','then','error','name','send','JscriptyQuestionReport','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','findAll','rows','catch','include','find','create','body','params','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto'];(function(_0x3f68f2,_0x168716){var _0x181f22=function(_0x64374e){while(--_0x64374e){_0x3f68f2['push'](_0x3f68f2['shift']());}};_0x181f22(++_0x168716);}(_0xa1ab,0x116));var _0xba1a=function(_0x38ea0b,_0x5d470e){_0x38ea0b=_0x38ea0b-0x0;var _0x1c3e3e=_0xa1ab[_0x38ea0b];return _0x1c3e3e;};'use strict';var emlformat=require(_0xba1a('0x0'));var rimraf=require(_0xba1a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xba1a('0x2'));var rp=require(_0xba1a('0x3'));var moment=require(_0xba1a('0x4'));var BPromise=require(_0xba1a('0x5'));var Mustache=require(_0xba1a('0x6'));var util=require(_0xba1a('0x7'));var path=require(_0xba1a('0x8'));var sox=require(_0xba1a('0x9'));var csv=require('to-csv');var ejs=require(_0xba1a('0xa'));var fs=require('fs');var fs_extra=require(_0xba1a('0xb'));var _=require(_0xba1a('0xc'));var squel=require('squel');var crypto=require(_0xba1a('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xba1a('0xe'));var querystring=require(_0xba1a('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xba1a('0x10'));var as=require(_0xba1a('0x11'));var hardwareService=require(_0xba1a('0x12'));var logger=require(_0xba1a('0x13'))(_0xba1a('0x14'));var utils=require(_0xba1a('0x15'));var config=require(_0xba1a('0x16'));var licenseUtil=require(_0xba1a('0x17'));var db=require(_0xba1a('0x18'))['db'];function respondWithStatusCode(_0x2f1a9f,_0x1bc364){_0x1bc364=_0x1bc364||0xcc;return function(_0x201f4c){if(_0x201f4c){return _0x2f1a9f[_0xba1a('0x19')](_0x1bc364);}return _0x2f1a9f[_0xba1a('0x1a')](_0x1bc364)[_0xba1a('0x1b')]();};}function respondWithResult(_0xf7f688,_0x56d6ab){_0x56d6ab=_0x56d6ab||0xc8;return function(_0x3ebd19){if(_0x3ebd19){return _0xf7f688[_0xba1a('0x1a')](_0x56d6ab)['json'](_0x3ebd19);}};}function respondWithFilteredResult(_0x2ebc94,_0x479a41){return function(_0x59c13c){if(_0x59c13c){var _0x1067e3=typeof _0x479a41[_0xba1a('0x1c')]===_0xba1a('0x1d')&&typeof _0x479a41[_0xba1a('0x1e')]===_0xba1a('0x1d');var _0x5a2c04=_0x59c13c[_0xba1a('0x1f')];var _0x204966=_0x1067e3?0x0:_0x479a41[_0xba1a('0x1c')];var _0x2b2223=_0x1067e3?_0x59c13c[_0xba1a('0x1f')]:_0x479a41[_0xba1a('0x1c')]+_0x479a41['limit'];var _0x5f4302;if(_0x2b2223>=_0x5a2c04){_0x2b2223=_0x5a2c04;_0x5f4302=0xc8;}else{_0x5f4302=0xce;}_0x2ebc94[_0xba1a('0x1a')](_0x5f4302);return _0x2ebc94[_0xba1a('0x20')]('Content-Range',_0x204966+'-'+_0x2b2223+'/'+_0x5a2c04)[_0xba1a('0x21')](_0x59c13c);}return null;};}function patchUpdates(_0x40871a){return function(_0x3521c8){try{jsonpatch[_0xba1a('0x22')](_0x3521c8,_0x40871a,!![]);}catch(_0x316c31){return BPromise['reject'](_0x316c31);}return _0x3521c8[_0xba1a('0x23')]();};}function saveUpdates(_0x57f70e,_0x4bfe8a){return function(_0x42d179){if(_0x42d179){return _0x42d179[_0xba1a('0x24')](_0x57f70e)[_0xba1a('0x25')](function(_0x23047d){return _0x23047d;});}return null;};}function removeEntity(_0x2c82e6,_0x5810e6){return function(_0x59ef3a){if(_0x59ef3a){return _0x59ef3a['destroy']()['then'](function(){_0x2c82e6[_0xba1a('0x1a')](0xcc)[_0xba1a('0x1b')]();});}};}function handleEntityNotFound(_0x28e9ba,_0x212ee5){return function(_0x103425){if(!_0x103425){_0x28e9ba[_0xba1a('0x19')](0x194);}return _0x103425;};}function handleError(_0x1c9f14,_0x4fa841){_0x4fa841=_0x4fa841||0x1f4;return function(_0x2998dc){logger[_0xba1a('0x26')](_0x2998dc['stack']);if(_0x2998dc[_0xba1a('0x27')]){delete _0x2998dc[_0xba1a('0x27')];}_0x1c9f14[_0xba1a('0x1a')](_0x4fa841)[_0xba1a('0x28')](_0x2998dc);};}exports['index']=function(_0x30d06b,_0x4f6908){var _0x291eff={},_0x357be8={},_0xf08245={'count':0x0,'rows':[]};var _0x341307=_['map'](db[_0xba1a('0x29')][_0xba1a('0x2a')],function(_0x4f5966){return{'name':_0x4f5966[_0xba1a('0x2b')],'type':_0x4f5966[_0xba1a('0x2c')][_0xba1a('0x2d')]};});_0x357be8[_0xba1a('0x2e')]=_[_0xba1a('0x2f')](_0x341307,'name');_0x357be8[_0xba1a('0x30')]=_['keys'](_0x30d06b[_0xba1a('0x30')]);_0x357be8[_0xba1a('0x31')]=_[_0xba1a('0x32')](_0x357be8['model'],_0x357be8[_0xba1a('0x30')]);_0x291eff[_0xba1a('0x33')]=_['intersection'](_0x357be8[_0xba1a('0x2e')],qs['fields'](_0x30d06b['query'][_0xba1a('0x34')]));_0x291eff[_0xba1a('0x33')]=_0x291eff[_0xba1a('0x33')][_0xba1a('0x35')]?_0x291eff[_0xba1a('0x33')]:_0x357be8[_0xba1a('0x2e')];if(!_0x30d06b[_0xba1a('0x30')]['hasOwnProperty'](_0xba1a('0x36'))){_0x291eff[_0xba1a('0x1e')]=qs[_0xba1a('0x1e')](_0x30d06b[_0xba1a('0x30')]['limit']);_0x291eff[_0xba1a('0x1c')]=qs[_0xba1a('0x1c')](_0x30d06b[_0xba1a('0x30')][_0xba1a('0x1c')]);}_0x291eff[_0xba1a('0x37')]=qs['sort'](_0x30d06b[_0xba1a('0x30')][_0xba1a('0x38')]);_0x291eff[_0xba1a('0x39')]=qs['filters'](_[_0xba1a('0x3a')](_0x30d06b['query'],_0x357be8[_0xba1a('0x31')]),_0x341307);if(_0x30d06b[_0xba1a('0x30')]['filter']){_0x291eff['where']=_[_0xba1a('0x3b')](_0x291eff[_0xba1a('0x39')],{'$or':_[_0xba1a('0x2f')](_0x341307,function(_0x50629a){if(_0x50629a[_0xba1a('0x2c')]!==_0xba1a('0x3c')){var _0x466553={};_0x466553[_0x50629a[_0xba1a('0x27')]]={'$like':'%'+_0x30d06b['query'][_0xba1a('0x3d')]+'%'};return _0x466553;}})});}_0x291eff=_[_0xba1a('0x3b')]({},_0x291eff,_0x30d06b[_0xba1a('0x3e')]);var _0x218d19={'where':_0x291eff[_0xba1a('0x39')]};return db[_0xba1a('0x29')][_0xba1a('0x1f')](_0x218d19)['then'](function(_0xcbaf1f){_0xf08245['count']=_0xcbaf1f;if(_0x30d06b[_0xba1a('0x30')][_0xba1a('0x3f')]){_0x291eff['include']=[{'all':!![]}];}return db[_0xba1a('0x29')][_0xba1a('0x40')](_0x291eff);})[_0xba1a('0x25')](function(_0x207bfe){_0xf08245[_0xba1a('0x41')]=_0x207bfe;return _0xf08245;})[_0xba1a('0x25')](respondWithFilteredResult(_0x4f6908,_0x291eff))[_0xba1a('0x42')](handleError(_0x4f6908,null));};exports['show']=function(_0x4aee50,_0x2601ba){var _0x16208a={'raw':!![],'where':{'id':_0x4aee50['params']['id']}},_0x375b4e={};_0x375b4e[_0xba1a('0x2e')]=_['keys'](db['JscriptyQuestionReport'][_0xba1a('0x2a')]);_0x375b4e[_0xba1a('0x30')]=_['keys'](_0x4aee50['query']);_0x375b4e[_0xba1a('0x31')]=_[_0xba1a('0x32')](_0x375b4e[_0xba1a('0x2e')],_0x375b4e['query']);_0x16208a['attributes']=_[_0xba1a('0x32')](_0x375b4e[_0xba1a('0x2e')],qs[_0xba1a('0x34')](_0x4aee50[_0xba1a('0x30')][_0xba1a('0x34')]));_0x16208a['attributes']=_0x16208a['attributes']['length']?_0x16208a[_0xba1a('0x33')]:_0x375b4e[_0xba1a('0x2e')];if(_0x4aee50['query'][_0xba1a('0x3f')]){_0x16208a[_0xba1a('0x43')]=[{'all':!![]}];}_0x16208a=_[_0xba1a('0x3b')]({},_0x16208a,_0x4aee50[_0xba1a('0x3e')]);return db[_0xba1a('0x29')][_0xba1a('0x44')](_0x16208a)['then'](handleEntityNotFound(_0x2601ba,null))['then'](respondWithResult(_0x2601ba,null))[_0xba1a('0x42')](handleError(_0x2601ba,null));};exports[_0xba1a('0x45')]=function(_0x424d6b,_0x50e889){return db[_0xba1a('0x29')]['create'](_0x424d6b[_0xba1a('0x46')],{})['then'](respondWithResult(_0x50e889,0xc9))[_0xba1a('0x42')](handleError(_0x50e889,null));};exports[_0xba1a('0x24')]=function(_0x6be75,_0x225345){if(_0x6be75['body']['id']){delete _0x6be75[_0xba1a('0x46')]['id'];}return db[_0xba1a('0x29')]['find']({'where':{'id':_0x6be75[_0xba1a('0x47')]['id']}})[_0xba1a('0x25')](handleEntityNotFound(_0x225345,null))[_0xba1a('0x25')](saveUpdates(_0x6be75[_0xba1a('0x46')],null))['then'](respondWithResult(_0x225345,null))[_0xba1a('0x42')](handleError(_0x225345,null));};exports['destroy']=function(_0x520cc8,_0x2b6f08){return db[_0xba1a('0x29')][_0xba1a('0x44')]({'where':{'id':_0x520cc8[_0xba1a('0x47')]['id']}})[_0xba1a('0x25')](handleEntityNotFound(_0x2b6f08,null))['then'](removeEntity(_0x2b6f08,null))[_0xba1a('0x42')](handleError(_0x2b6f08,null));};exports['describe']=function(_0x593c5a,_0x36c5b7){return db[_0xba1a('0x29')][_0xba1a('0x48')]()[_0xba1a('0x25')](respondWithResult(_0x36c5b7,null))['catch'](handleError(_0x36c5b7,null));};
\ No newline at end of file
+var _0xcdc6=['map','VIRTUAL','filter','options','then','includeAll','findAll','catch','show','params','include','find','create','update','body','describe','eml-format','fast-json-patch','request-promise','moment','path','sox','fs-extra','lodash','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','destroy','name','send','index','JscriptyQuestionReport','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','nolimit','order','sort','where','pick','merge'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcdc6,0xee));var _0x6cdc=function(_0x335adc,_0x2f61ed){_0x335adc=_0x335adc-0x0;var _0x4e8739=_0xcdc6[_0x335adc];return _0x4e8739;};'use strict';var emlformat=require(_0x6cdc('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x6cdc('0x1'));var rp=require(_0x6cdc('0x2'));var moment=require(_0x6cdc('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x6cdc('0x4'));var sox=require(_0x6cdc('0x5'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6cdc('0x6'));var _=require(_0x6cdc('0x7'));var squel=require('squel');var crypto=require(_0x6cdc('0x8'));var jsforce=require('jsforce');var deskjs=require(_0x6cdc('0x9'));var toCsv=require(_0x6cdc('0xa'));var querystring=require(_0x6cdc('0xb'));var Papa=require(_0x6cdc('0xc'));var Redis=require(_0x6cdc('0xd'));var authService=require(_0x6cdc('0xe'));var qs=require(_0x6cdc('0xf'));var as=require(_0x6cdc('0x10'));var hardwareService=require(_0x6cdc('0x11'));var logger=require(_0x6cdc('0x12'))(_0x6cdc('0x13'));var utils=require(_0x6cdc('0x14'));var config=require(_0x6cdc('0x15'));var licenseUtil=require(_0x6cdc('0x16'));var db=require(_0x6cdc('0x17'))['db'];function respondWithStatusCode(_0x124b5f,_0x29a5be){_0x29a5be=_0x29a5be||0xcc;return function(_0x315e91){if(_0x315e91){return _0x124b5f[_0x6cdc('0x18')](_0x29a5be);}return _0x124b5f[_0x6cdc('0x19')](_0x29a5be)[_0x6cdc('0x1a')]();};}function respondWithResult(_0x290922,_0x5da817){_0x5da817=_0x5da817||0xc8;return function(_0x3eafdc){if(_0x3eafdc){return _0x290922[_0x6cdc('0x19')](_0x5da817)[_0x6cdc('0x1b')](_0x3eafdc);}};}function respondWithFilteredResult(_0x4522ab,_0x341d11){return function(_0x4fce63){if(_0x4fce63){var _0x344578=typeof _0x341d11[_0x6cdc('0x1c')]===_0x6cdc('0x1d')&&typeof _0x341d11[_0x6cdc('0x1e')]==='undefined';var _0x11ae53=_0x4fce63[_0x6cdc('0x1f')];var _0x591570=_0x344578?0x0:_0x341d11[_0x6cdc('0x1c')];var _0x5ad7d0=_0x344578?_0x4fce63[_0x6cdc('0x1f')]:_0x341d11[_0x6cdc('0x1c')]+_0x341d11['limit'];var _0x3f1c78;if(_0x5ad7d0>=_0x11ae53){_0x5ad7d0=_0x11ae53;_0x3f1c78=0xc8;}else{_0x3f1c78=0xce;}_0x4522ab[_0x6cdc('0x19')](_0x3f1c78);return _0x4522ab[_0x6cdc('0x20')](_0x6cdc('0x21'),_0x591570+'-'+_0x5ad7d0+'/'+_0x11ae53)[_0x6cdc('0x1b')](_0x4fce63);}return null;};}function patchUpdates(_0x5ca346){return function(_0x548f79){try{jsonpatch[_0x6cdc('0x22')](_0x548f79,_0x5ca346,!![]);}catch(_0x293212){return BPromise['reject'](_0x293212);}return _0x548f79[_0x6cdc('0x23')]();};}function saveUpdates(_0x4f4520,_0x31f328){return function(_0x27f8aa){if(_0x27f8aa){return _0x27f8aa['update'](_0x4f4520)['then'](function(_0x4c8e97){return _0x4c8e97;});}return null;};}function removeEntity(_0x91c2c1,_0x5eeef5){return function(_0x24dbde){if(_0x24dbde){return _0x24dbde[_0x6cdc('0x24')]()['then'](function(){_0x91c2c1[_0x6cdc('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1f3686,_0x366e03){return function(_0x446ee3){if(!_0x446ee3){_0x1f3686[_0x6cdc('0x18')](0x194);}return _0x446ee3;};}function handleError(_0x50c3c8,_0xe2f088){_0xe2f088=_0xe2f088||0x1f4;return function(_0x4a8a4b){logger['error'](_0x4a8a4b['stack']);if(_0x4a8a4b[_0x6cdc('0x25')]){delete _0x4a8a4b[_0x6cdc('0x25')];}_0x50c3c8[_0x6cdc('0x19')](_0xe2f088)[_0x6cdc('0x26')](_0x4a8a4b);};}exports[_0x6cdc('0x27')]=function(_0x5220d6,_0x4731f3){var _0x142b59={},_0x30fbc6={},_0x14a43d={'count':0x0,'rows':[]};var _0x155e32=_['map'](db[_0x6cdc('0x28')][_0x6cdc('0x29')],function(_0x159ce2){return{'name':_0x159ce2[_0x6cdc('0x2a')],'type':_0x159ce2[_0x6cdc('0x2b')][_0x6cdc('0x2c')]};});_0x30fbc6[_0x6cdc('0x2d')]=_['map'](_0x155e32,'name');_0x30fbc6['query']=_[_0x6cdc('0x2e')](_0x5220d6['query']);_0x30fbc6[_0x6cdc('0x2f')]=_[_0x6cdc('0x30')](_0x30fbc6[_0x6cdc('0x2d')],_0x30fbc6[_0x6cdc('0x31')]);_0x142b59[_0x6cdc('0x32')]=_['intersection'](_0x30fbc6['model'],qs['fields'](_0x5220d6['query'][_0x6cdc('0x33')]));_0x142b59['attributes']=_0x142b59[_0x6cdc('0x32')]['length']?_0x142b59[_0x6cdc('0x32')]:_0x30fbc6[_0x6cdc('0x2d')];if(!_0x5220d6[_0x6cdc('0x31')]['hasOwnProperty'](_0x6cdc('0x34'))){_0x142b59[_0x6cdc('0x1e')]=qs['limit'](_0x5220d6['query'][_0x6cdc('0x1e')]);_0x142b59[_0x6cdc('0x1c')]=qs[_0x6cdc('0x1c')](_0x5220d6[_0x6cdc('0x31')][_0x6cdc('0x1c')]);}_0x142b59[_0x6cdc('0x35')]=qs[_0x6cdc('0x36')](_0x5220d6[_0x6cdc('0x31')][_0x6cdc('0x36')]);_0x142b59[_0x6cdc('0x37')]=qs[_0x6cdc('0x2f')](_[_0x6cdc('0x38')](_0x5220d6[_0x6cdc('0x31')],_0x30fbc6[_0x6cdc('0x2f')]),_0x155e32);if(_0x5220d6[_0x6cdc('0x31')]['filter']){_0x142b59[_0x6cdc('0x37')]=_[_0x6cdc('0x39')](_0x142b59[_0x6cdc('0x37')],{'$or':_[_0x6cdc('0x3a')](_0x155e32,function(_0x57977f){if(_0x57977f[_0x6cdc('0x2b')]!==_0x6cdc('0x3b')){var _0x212d33={};_0x212d33[_0x57977f[_0x6cdc('0x25')]]={'$like':'%'+_0x5220d6[_0x6cdc('0x31')][_0x6cdc('0x3c')]+'%'};return _0x212d33;}})});}_0x142b59=_[_0x6cdc('0x39')]({},_0x142b59,_0x5220d6[_0x6cdc('0x3d')]);var _0x446325={'where':_0x142b59[_0x6cdc('0x37')]};return db[_0x6cdc('0x28')][_0x6cdc('0x1f')](_0x446325)[_0x6cdc('0x3e')](function(_0x2efafe){_0x14a43d[_0x6cdc('0x1f')]=_0x2efafe;if(_0x5220d6[_0x6cdc('0x31')][_0x6cdc('0x3f')]){_0x142b59['include']=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0x6cdc('0x40')](_0x142b59);})[_0x6cdc('0x3e')](function(_0x198188){_0x14a43d['rows']=_0x198188;return _0x14a43d;})['then'](respondWithFilteredResult(_0x4731f3,_0x142b59))[_0x6cdc('0x41')](handleError(_0x4731f3,null));};exports[_0x6cdc('0x42')]=function(_0x2fb9e2,_0xf77cbb){var _0xe48bac={'raw':!![],'where':{'id':_0x2fb9e2[_0x6cdc('0x43')]['id']}},_0x771d47={};_0x771d47['model']=_[_0x6cdc('0x2e')](db[_0x6cdc('0x28')][_0x6cdc('0x29')]);_0x771d47[_0x6cdc('0x31')]=_['keys'](_0x2fb9e2[_0x6cdc('0x31')]);_0x771d47['filters']=_[_0x6cdc('0x30')](_0x771d47[_0x6cdc('0x2d')],_0x771d47[_0x6cdc('0x31')]);_0xe48bac[_0x6cdc('0x32')]=_['intersection'](_0x771d47[_0x6cdc('0x2d')],qs[_0x6cdc('0x33')](_0x2fb9e2[_0x6cdc('0x31')][_0x6cdc('0x33')]));_0xe48bac[_0x6cdc('0x32')]=_0xe48bac[_0x6cdc('0x32')]['length']?_0xe48bac['attributes']:_0x771d47[_0x6cdc('0x2d')];if(_0x2fb9e2[_0x6cdc('0x31')]['includeAll']){_0xe48bac[_0x6cdc('0x44')]=[{'all':!![]}];}_0xe48bac=_[_0x6cdc('0x39')]({},_0xe48bac,_0x2fb9e2[_0x6cdc('0x3d')]);return db[_0x6cdc('0x28')][_0x6cdc('0x45')](_0xe48bac)['then'](handleEntityNotFound(_0xf77cbb,null))['then'](respondWithResult(_0xf77cbb,null))['catch'](handleError(_0xf77cbb,null));};exports['create']=function(_0x5d5010,_0x1f7e5a){return db[_0x6cdc('0x28')][_0x6cdc('0x46')](_0x5d5010['body'],{})['then'](respondWithResult(_0x1f7e5a,0xc9))[_0x6cdc('0x41')](handleError(_0x1f7e5a,null));};exports[_0x6cdc('0x47')]=function(_0x535f37,_0x364789){if(_0x535f37[_0x6cdc('0x48')]['id']){delete _0x535f37[_0x6cdc('0x48')]['id'];}return db[_0x6cdc('0x28')][_0x6cdc('0x45')]({'where':{'id':_0x535f37[_0x6cdc('0x43')]['id']}})[_0x6cdc('0x3e')](handleEntityNotFound(_0x364789,null))[_0x6cdc('0x3e')](saveUpdates(_0x535f37[_0x6cdc('0x48')],null))[_0x6cdc('0x3e')](respondWithResult(_0x364789,null))[_0x6cdc('0x41')](handleError(_0x364789,null));};exports[_0x6cdc('0x24')]=function(_0x1b5d38,_0x25c854){return db[_0x6cdc('0x28')][_0x6cdc('0x45')]({'where':{'id':_0x1b5d38['params']['id']}})[_0x6cdc('0x3e')](handleEntityNotFound(_0x25c854,null))[_0x6cdc('0x3e')](removeEntity(_0x25c854,null))[_0x6cdc('0x41')](handleError(_0x25c854,null));};exports['describe']=function(_0x2b5a7d,_0x513a31){return db[_0x6cdc('0x28')][_0x6cdc('0x49')]()[_0x6cdc('0x3e')](respondWithResult(_0x513a31,null))['catch'](handleError(_0x513a31,null));};
\ No newline at end of file
index 06a809e..7208118 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcd62=['bluebird','path','rimraf','../../config/environment','./jscriptyQuestionReport.attributes','exports','define','report_jscripty_questions','lodash','util','../../config/logger','api','moment'];(function(_0x1441dc,_0x13b67c){var _0xfdc18b=function(_0xbfd6ce){while(--_0xbfd6ce){_0x1441dc['push'](_0x1441dc['shift']());}};_0xfdc18b(++_0x13b67c);}(_0xcd62,0x10c));var _0x2cd6=function(_0x100a9d,_0x473efa){_0x100a9d=_0x100a9d-0x0;var _0x3d71ab=_0xcd62[_0x100a9d];return _0x3d71ab;};'use strict';var _=require(_0x2cd6('0x0'));var util=require(_0x2cd6('0x1'));var logger=require(_0x2cd6('0x2'))(_0x2cd6('0x3'));var moment=require(_0x2cd6('0x4'));var BPromise=require(_0x2cd6('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2cd6('0x6'));var rimraf=require(_0x2cd6('0x7'));var config=require(_0x2cd6('0x8'));var attributes=require(_0x2cd6('0x9'));module[_0x2cd6('0xa')]=function(_0x516a89,_0x4ca2b5){return _0x516a89[_0x2cd6('0xb')]('JscriptyQuestionReport',attributes,{'tableName':_0x2cd6('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2a2a=['moment','bluebird','request-promise','path','rimraf','./jscriptyQuestionReport.attributes','exports','define','JscriptyQuestionReport','report_jscripty_questions','lodash','util','../../config/logger','api'];(function(_0x133522,_0x1d2817){var _0x18219b=function(_0x39ffb8){while(--_0x39ffb8){_0x133522['push'](_0x133522['shift']());}};_0x18219b(++_0x1d2817);}(_0x2a2a,0x96));var _0xa2a2=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0x2a2a[_0xc4001c];return _0x49f7bc;};'use strict';var _=require(_0xa2a2('0x0'));var util=require(_0xa2a2('0x1'));var logger=require(_0xa2a2('0x2'))(_0xa2a2('0x3'));var moment=require(_0xa2a2('0x4'));var BPromise=require(_0xa2a2('0x5'));var rp=require(_0xa2a2('0x6'));var fs=require('fs');var path=require(_0xa2a2('0x7'));var rimraf=require(_0xa2a2('0x8'));var config=require('../../config/environment');var attributes=require(_0xa2a2('0x9'));module[_0xa2a2('0xa')]=function(_0x184b6b,_0x33777d){return _0x184b6b[_0xa2a2('0xb')](_0xa2a2('0xc'),attributes,{'tableName':_0xa2a2('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 4ab3fa3..cebca52 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x69d5=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird'];(function(_0x312100,_0x2e85e4){var _0x4771de=function(_0x336ab5){while(--_0x336ab5){_0x312100['push'](_0x312100['shift']());}};_0x4771de(++_0x2e85e4);}(_0x69d5,0x1d7));var _0x569d=function(_0x42cf9b,_0x4332cb){_0x42cf9b=_0x42cf9b-0x0;var _0x395274=_0x69d5[_0x42cf9b];return _0x395274;};'use strict';var _=require(_0x569d('0x0'));var util=require(_0x569d('0x1'));var moment=require(_0x569d('0x2'));var BPromise=require(_0x569d('0x3'));var rs=require(_0x569d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x569d('0x5'))['db'];var utils=require(_0x569d('0x6'));var logger=require(_0x569d('0x7'))(_0x569d('0x8'));var config=require(_0x569d('0x9'));var jayson=require(_0x569d('0xa'));var client=jayson[_0x569d('0xb')][_0x569d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x561b7b,_0x2dc4d4,_0x5e2c6d){return new BPromise(function(_0x57a698,_0x424062){return client[_0x569d('0xd')](_0x561b7b,_0x5e2c6d)[_0x569d('0xe')](function(_0x14a903){logger[_0x569d('0xf')](_0x569d('0x10'),_0x2dc4d4,_0x569d('0x11'));logger[_0x569d('0x12')](_0x569d('0x13'),_0x2dc4d4,_0x569d('0x11'),JSON[_0x569d('0x14')](_0x14a903));if(_0x14a903[_0x569d('0x15')]){if(_0x14a903['error'][_0x569d('0x16')]===0x1f4){logger['error'](_0x569d('0x10'),_0x2dc4d4,_0x14a903['error'][_0x569d('0x17')]);return _0x424062(_0x14a903['error']['message']);}logger[_0x569d('0x15')](_0x569d('0x10'),_0x2dc4d4,_0x14a903[_0x569d('0x15')][_0x569d('0x17')]);return _0x57a698(_0x14a903['error']['message']);}else{logger[_0x569d('0xf')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x2dc4d4,_0x569d('0x11'));_0x57a698(_0x14a903['result'][_0x569d('0x17')]);}})[_0x569d('0x18')](function(_0x5a09f4){logger[_0x569d('0x15')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x2dc4d4,_0x5a09f4);_0x424062(_0x5a09f4);});});}
\ No newline at end of file
+var _0x4265=['info','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','JscriptyQuestionReport,\x20%s,\x20%s','message','result','lodash','util','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','request'];(function(_0x3a9fc9,_0xa9fa32){var _0x50f586=function(_0xa8c702){while(--_0xa8c702){_0x3a9fc9['push'](_0x3a9fc9['shift']());}};_0x50f586(++_0xa9fa32);}(_0x4265,0x186));var _0x5426=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x4265[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x5426('0x0'));var util=require(_0x5426('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5426('0x2'));var fs=require('fs');var Redis=require(_0x5426('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5426('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x5426('0x5'));var jayson=require(_0x5426('0x6'));var client=jayson[_0x5426('0x7')][_0x5426('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x53515c,_0x56ab60,_0x5f04e0){return new BPromise(function(_0x531ba9,_0x25ee8e){return client[_0x5426('0x9')](_0x53515c,_0x5f04e0)['then'](function(_0x1fa0f8){logger[_0x5426('0xa')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x56ab60,'request\x20sent');logger[_0x5426('0xb')](_0x5426('0xc'),_0x56ab60,_0x5426('0xd'),JSON[_0x5426('0xe')](_0x1fa0f8));if(_0x1fa0f8['error']){if(_0x1fa0f8[_0x5426('0xf')][_0x5426('0x10')]===0x1f4){logger['error'](_0x5426('0x11'),_0x56ab60,_0x1fa0f8[_0x5426('0xf')][_0x5426('0x12')]);return _0x25ee8e(_0x1fa0f8[_0x5426('0xf')][_0x5426('0x12')]);}logger[_0x5426('0xf')](_0x5426('0x11'),_0x56ab60,_0x1fa0f8[_0x5426('0xf')][_0x5426('0x12')]);return _0x531ba9(_0x1fa0f8[_0x5426('0xf')][_0x5426('0x12')]);}else{logger[_0x5426('0xa')](_0x5426('0x11'),_0x56ab60,_0x5426('0xd'));_0x531ba9(_0x1fa0f8[_0x5426('0x13')]['message']);}})['catch'](function(_0x4b6cba){logger[_0x5426('0xf')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x56ab60,_0x4b6cba);_0x25ee8e(_0x4b6cba);});});}
\ No newline at end of file
index e28ea89..713ebe2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x98b9=['/:id','destroy','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','get','isAuthenticated','index','/describe','describe','show','/:id/questions','getQuestions','post','create','put'];(function(_0x5524a1,_0x37c171){var _0x4ea5e3=function(_0x493ee1){while(--_0x493ee1){_0x5524a1['push'](_0x5524a1['shift']());}};_0x4ea5e3(++_0x37c171);}(_0x98b9,0x120));var _0x998b=function(_0x128385,_0x5495dd){_0x128385=_0x128385-0x0;var _0xd342bc=_0x98b9[_0x128385];return _0xd342bc;};'use strict';var multer=require(_0x998b('0x0'));var util=require(_0x998b('0x1'));var path=require(_0x998b('0x2'));var timeout=require(_0x998b('0x3'));var express=require('express');var router=express[_0x998b('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x998b('0x5'));var interaction=require(_0x998b('0x6'));var config=require(_0x998b('0x7'));var controller=require(_0x998b('0x8'));router[_0x998b('0x9')]('/',auth[_0x998b('0xa')](),controller[_0x998b('0xb')]);router['get'](_0x998b('0xc'),auth[_0x998b('0xa')](),controller[_0x998b('0xd')]);router[_0x998b('0x9')]('/:id',auth[_0x998b('0xa')](),controller[_0x998b('0xe')]);router[_0x998b('0x9')](_0x998b('0xf'),auth[_0x998b('0xa')](),controller[_0x998b('0x10')]);router[_0x998b('0x11')]('/',auth['isAuthenticated'](),controller[_0x998b('0x12')]);router[_0x998b('0x13')]('/:id',auth[_0x998b('0xa')](),controller['update']);router['delete'](_0x998b('0x14'),auth[_0x998b('0xa')](),controller[_0x998b('0x15')]);module['exports']=router;
\ No newline at end of file
+var _0x30ba=['../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','isAuthenticated','get','describe','/:id','show','getQuestions','post','put','update','delete','destroy','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x30ba,0x1b3));var _0xa30b=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x30ba[_0x2641f9];return _0x585741;};'use strict';var multer=require('multer');var util=require(_0xa30b('0x0'));var path=require(_0xa30b('0x1'));var timeout=require(_0xa30b('0x2'));var express=require(_0xa30b('0x3'));var router=express[_0xa30b('0x4')]();var fs_extra=require(_0xa30b('0x5'));var auth=require(_0xa30b('0x6'));var interaction=require(_0xa30b('0x7'));var config=require(_0xa30b('0x8'));var controller=require(_0xa30b('0x9'));router['get']('/',auth[_0xa30b('0xa')](),controller['index']);router[_0xa30b('0xb')]('/describe',auth[_0xa30b('0xa')](),controller[_0xa30b('0xc')]);router[_0xa30b('0xb')](_0xa30b('0xd'),auth[_0xa30b('0xa')](),controller[_0xa30b('0xe')]);router[_0xa30b('0xb')]('/:id/questions',auth[_0xa30b('0xa')](),controller[_0xa30b('0xf')]);router[_0xa30b('0x10')]('/',auth[_0xa30b('0xa')](),controller['create']);router[_0xa30b('0x11')](_0xa30b('0xd'),auth[_0xa30b('0xa')](),controller[_0xa30b('0x12')]);router[_0xa30b('0x13')](_0xa30b('0xd'),auth[_0xa30b('0xa')](),controller[_0xa30b('0x14')]);module['exports']=router;
\ No newline at end of file
index bc10354..0c715b9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd566=['STRING','BOOLEAN','moment','sequelize','exports','DATE','setDataValue','starttime','endtime','format'];(function(_0x33d560,_0x780b8){var _0x1eaf0f=function(_0x45655d){while(--_0x45655d){_0x33d560['push'](_0x33d560['shift']());}};_0x1eaf0f(++_0x780b8);}(_0xd566,0x8e));var _0x6d56=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xd566[_0x42cae2];return _0x5f256f;};'use strict';var moment=require(_0x6d56('0x0'));var Sequelize=require(_0x6d56('0x1'));module[_0x6d56('0x2')]={'starttime':{'type':Sequelize[_0x6d56('0x3')],'set':function(_0x505be2){this[_0x6d56('0x4')](_0x6d56('0x5'),_0x505be2);this[_0x6d56('0x4')](_0x6d56('0x6'),moment()[_0x6d56('0x7')]('YYYY-MM-DD\x20HH:mm:ss'));}},'endtime':{'type':Sequelize['DATE']},'membername':{'type':Sequelize[_0x6d56('0x8')]},'projectname':{'type':Sequelize[_0x6d56('0x8')]},'queue':{'type':Sequelize[_0x6d56('0x8')]},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'completed':{'type':Sequelize[_0x6d56('0x9')],'defaultValue':![]}};
\ No newline at end of file
+var _0x7896=['starttime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','STRING','moment','sequelize','exports','DATE','setDataValue'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7896,0x127));var _0x6789=function(_0x5ac791,_0x504d37){_0x5ac791=_0x5ac791-0x0;var _0x9e3a19=_0x7896[_0x5ac791];return _0x9e3a19;};'use strict';var moment=require(_0x6789('0x0'));var Sequelize=require(_0x6789('0x1'));module[_0x6789('0x2')]={'starttime':{'type':Sequelize[_0x6789('0x3')],'set':function(_0x32e771){this[_0x6789('0x4')](_0x6789('0x5'),_0x32e771);this[_0x6789('0x4')](_0x6789('0x6'),moment()[_0x6789('0x7')](_0x6789('0x8')));}},'endtime':{'type':Sequelize[_0x6789('0x3')]},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize[_0x6789('0x9')]},'queue':{'type':Sequelize[_0x6789('0x9')]},'uniqueid':{'type':Sequelize[_0x6789('0x9')]},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x6789('0x9')]},'completed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
index ade1314..a677b72 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x95ee=['mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','name','send','index','JscriptySessionReport','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','sort','pick','filter','where','merge','map','type','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','create','body','update','find','describe','findOne','JscriptyQuestionReport','rawAttributes','SessionId','rimraf','fast-json-patch','request-promise','moment','bluebird'];(function(_0x4a53d,_0x58a95e){var _0x27410e=function(_0x38fc90){while(--_0x38fc90){_0x4a53d['push'](_0x4a53d['shift']());}};_0x27410e(++_0x58a95e);}(_0x95ee,0x18b));var _0xe95e=function(_0x263a74,_0xc31414){_0x263a74=_0x263a74-0x0;var _0x2aa86c=_0x95ee[_0x263a74];return _0x2aa86c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe95e('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe95e('0x1'));var rp=require(_0xe95e('0x2'));var moment=require(_0xe95e('0x3'));var BPromise=require(_0xe95e('0x4'));var Mustache=require(_0xe95e('0x5'));var util=require('util');var path=require(_0xe95e('0x6'));var sox=require(_0xe95e('0x7'));var csv=require(_0xe95e('0x8'));var ejs=require(_0xe95e('0x9'));var fs=require('fs');var fs_extra=require(_0xe95e('0xa'));var _=require(_0xe95e('0xb'));var squel=require(_0xe95e('0xc'));var crypto=require('crypto');var jsforce=require(_0xe95e('0xd'));var deskjs=require(_0xe95e('0xe'));var toCsv=require('to-csv');var querystring=require(_0xe95e('0xf'));var Papa=require(_0xe95e('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xe95e('0x11'));var as=require(_0xe95e('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe95e('0x13'))(_0xe95e('0x14'));var utils=require(_0xe95e('0x15'));var config=require(_0xe95e('0x16'));var licenseUtil=require(_0xe95e('0x17'));var db=require(_0xe95e('0x18'))['db'];function respondWithStatusCode(_0x120bd6,_0x30e307){_0x30e307=_0x30e307||0xcc;return function(_0x366d07){if(_0x366d07){return _0x120bd6[_0xe95e('0x19')](_0x30e307);}return _0x120bd6[_0xe95e('0x1a')](_0x30e307)[_0xe95e('0x1b')]();};}function respondWithResult(_0x282ce1,_0x130511){_0x130511=_0x130511||0xc8;return function(_0x37b203){if(_0x37b203){return _0x282ce1[_0xe95e('0x1a')](_0x130511)[_0xe95e('0x1c')](_0x37b203);}};}function respondWithFilteredResult(_0x227ed3,_0x289e04){return function(_0x1aa662){if(_0x1aa662){var _0x3dbb6b=typeof _0x289e04[_0xe95e('0x1d')]===_0xe95e('0x1e')&&typeof _0x289e04[_0xe95e('0x1f')]===_0xe95e('0x1e');var _0x18357f=_0x1aa662[_0xe95e('0x20')];var _0x1f2b9b=_0x3dbb6b?0x0:_0x289e04[_0xe95e('0x1d')];var _0x1aacff=_0x3dbb6b?_0x1aa662[_0xe95e('0x20')]:_0x289e04[_0xe95e('0x1d')]+_0x289e04[_0xe95e('0x1f')];var _0x4e3020;if(_0x1aacff>=_0x18357f){_0x1aacff=_0x18357f;_0x4e3020=0xc8;}else{_0x4e3020=0xce;}_0x227ed3[_0xe95e('0x1a')](_0x4e3020);return _0x227ed3[_0xe95e('0x21')](_0xe95e('0x22'),_0x1f2b9b+'-'+_0x1aacff+'/'+_0x18357f)[_0xe95e('0x1c')](_0x1aa662);}return null;};}function patchUpdates(_0xceeac5){return function(_0x134133){try{jsonpatch[_0xe95e('0x23')](_0x134133,_0xceeac5,!![]);}catch(_0xd8bd01){return BPromise[_0xe95e('0x24')](_0xd8bd01);}return _0x134133[_0xe95e('0x25')]();};}function saveUpdates(_0x53589a,_0x18be05){return function(_0x9e430a){if(_0x9e430a){return _0x9e430a['update'](_0x53589a)[_0xe95e('0x26')](function(_0x430b85){return _0x430b85;});}return null;};}function removeEntity(_0x419548,_0x307599){return function(_0x165f75){if(_0x165f75){return _0x165f75[_0xe95e('0x27')]()['then'](function(){_0x419548[_0xe95e('0x1a')](0xcc)[_0xe95e('0x1b')]();});}};}function handleEntityNotFound(_0xc98326,_0x299a9c){return function(_0x421076){if(!_0x421076){_0xc98326[_0xe95e('0x19')](0x194);}return _0x421076;};}function handleError(_0xf7f702,_0x20f0e9){_0x20f0e9=_0x20f0e9||0x1f4;return function(_0x32f3c1){logger['error'](_0x32f3c1['stack']);if(_0x32f3c1['name']){delete _0x32f3c1[_0xe95e('0x28')];}_0xf7f702['status'](_0x20f0e9)[_0xe95e('0x29')](_0x32f3c1);};}exports[_0xe95e('0x2a')]=function(_0x327bfc,_0x50f5ce){var _0x405208={},_0x59edb7={},_0x2dd655={'count':0x0,'rows':[]};var _0x2c330c=_['map'](db[_0xe95e('0x2b')]['rawAttributes'],function(_0x2cc393){return{'name':_0x2cc393[_0xe95e('0x2c')],'type':_0x2cc393['type'][_0xe95e('0x2d')]};});_0x59edb7[_0xe95e('0x2e')]=_['map'](_0x2c330c,_0xe95e('0x28'));_0x59edb7[_0xe95e('0x2f')]=_[_0xe95e('0x30')](_0x327bfc[_0xe95e('0x2f')]);_0x59edb7[_0xe95e('0x31')]=_[_0xe95e('0x32')](_0x59edb7[_0xe95e('0x2e')],_0x59edb7[_0xe95e('0x2f')]);_0x405208['attributes']=_[_0xe95e('0x32')](_0x59edb7[_0xe95e('0x2e')],qs['fields'](_0x327bfc[_0xe95e('0x2f')][_0xe95e('0x33')]));_0x405208[_0xe95e('0x34')]=_0x405208[_0xe95e('0x34')][_0xe95e('0x35')]?_0x405208[_0xe95e('0x34')]:_0x59edb7[_0xe95e('0x2e')];if(!_0x327bfc[_0xe95e('0x2f')]['hasOwnProperty'](_0xe95e('0x36'))){_0x405208[_0xe95e('0x1f')]=qs[_0xe95e('0x1f')](_0x327bfc['query'][_0xe95e('0x1f')]);_0x405208[_0xe95e('0x1d')]=qs[_0xe95e('0x1d')](_0x327bfc[_0xe95e('0x2f')]['offset']);}_0x405208['order']=qs['sort'](_0x327bfc[_0xe95e('0x2f')][_0xe95e('0x37')]);_0x405208['where']=qs[_0xe95e('0x31')](_[_0xe95e('0x38')](_0x327bfc[_0xe95e('0x2f')],_0x59edb7['filters']),_0x2c330c);if(_0x327bfc[_0xe95e('0x2f')][_0xe95e('0x39')]){_0x405208[_0xe95e('0x3a')]=_[_0xe95e('0x3b')](_0x405208[_0xe95e('0x3a')],{'$or':_[_0xe95e('0x3c')](_0x2c330c,function(_0x5773e9){if(_0x5773e9[_0xe95e('0x3d')]!==_0xe95e('0x3e')){var _0x3a67e5={};_0x3a67e5[_0x5773e9[_0xe95e('0x28')]]={'$like':'%'+_0x327bfc[_0xe95e('0x2f')]['filter']+'%'};return _0x3a67e5;}})});}_0x405208=_[_0xe95e('0x3b')]({},_0x405208,_0x327bfc[_0xe95e('0x3f')]);var _0x2371a0={'where':_0x405208['where']};return db[_0xe95e('0x2b')]['count'](_0x2371a0)[_0xe95e('0x26')](function(_0x44ceb8){_0x2dd655[_0xe95e('0x20')]=_0x44ceb8;if(_0x327bfc[_0xe95e('0x2f')][_0xe95e('0x40')]){_0x405208['include']=[{'all':!![]}];}return db[_0xe95e('0x2b')][_0xe95e('0x41')](_0x405208);})['then'](function(_0x2ac91e){_0x2dd655[_0xe95e('0x42')]=_0x2ac91e;return _0x2dd655;})[_0xe95e('0x26')](respondWithFilteredResult(_0x50f5ce,_0x405208))[_0xe95e('0x43')](handleError(_0x50f5ce,null));};exports[_0xe95e('0x44')]=function(_0x56f403,_0x5ba7dc){var _0x5c7246={'raw':!![],'where':{'id':_0x56f403[_0xe95e('0x45')]['id']}},_0x48a291={};_0x48a291[_0xe95e('0x2e')]=_['keys'](db['JscriptySessionReport']['rawAttributes']);_0x48a291[_0xe95e('0x2f')]=_[_0xe95e('0x30')](_0x56f403[_0xe95e('0x2f')]);_0x48a291[_0xe95e('0x31')]=_[_0xe95e('0x32')](_0x48a291['model'],_0x48a291[_0xe95e('0x2f')]);_0x5c7246[_0xe95e('0x34')]=_[_0xe95e('0x32')](_0x48a291[_0xe95e('0x2e')],qs[_0xe95e('0x33')](_0x56f403[_0xe95e('0x2f')][_0xe95e('0x33')]));_0x5c7246[_0xe95e('0x34')]=_0x5c7246['attributes'][_0xe95e('0x35')]?_0x5c7246['attributes']:_0x48a291[_0xe95e('0x2e')];if(_0x56f403[_0xe95e('0x2f')][_0xe95e('0x40')]){_0x5c7246[_0xe95e('0x46')]=[{'all':!![]}];}_0x5c7246=_[_0xe95e('0x3b')]({},_0x5c7246,_0x56f403[_0xe95e('0x3f')]);return db[_0xe95e('0x2b')]['find'](_0x5c7246)['then'](handleEntityNotFound(_0x5ba7dc,null))[_0xe95e('0x26')](respondWithResult(_0x5ba7dc,null))[_0xe95e('0x43')](handleError(_0x5ba7dc,null));};exports['create']=function(_0x1eefeb,_0x5a6b67){return db[_0xe95e('0x2b')][_0xe95e('0x47')](_0x1eefeb[_0xe95e('0x48')],{})[_0xe95e('0x26')](respondWithResult(_0x5a6b67,0xc9))[_0xe95e('0x43')](handleError(_0x5a6b67,null));};exports[_0xe95e('0x49')]=function(_0x181389,_0x59a289){if(_0x181389[_0xe95e('0x48')]['id']){delete _0x181389[_0xe95e('0x48')]['id'];}return db[_0xe95e('0x2b')][_0xe95e('0x4a')]({'where':{'id':_0x181389[_0xe95e('0x45')]['id']}})['then'](handleEntityNotFound(_0x59a289,null))['then'](saveUpdates(_0x181389['body'],null))[_0xe95e('0x26')](respondWithResult(_0x59a289,null))[_0xe95e('0x43')](handleError(_0x59a289,null));};exports[_0xe95e('0x27')]=function(_0x3c3aca,_0x102fff){return db[_0xe95e('0x2b')]['find']({'where':{'id':_0x3c3aca[_0xe95e('0x45')]['id']}})[_0xe95e('0x26')](handleEntityNotFound(_0x102fff,null))['then'](removeEntity(_0x102fff,null))[_0xe95e('0x43')](handleError(_0x102fff,null));};exports['describe']=function(_0x3a54fc,_0x2a1039){return db['JscriptySessionReport'][_0xe95e('0x4b')]()[_0xe95e('0x26')](respondWithResult(_0x2a1039,null))[_0xe95e('0x43')](handleError(_0x2a1039,null));};exports['getQuestions']=function(_0x59a86e,_0x5d208d,_0x3d4881){var _0x3598cc={'raw':!![],'where':{}};var _0x23a011={};var _0xbfdc75={'count':0x0,'rows':[]};return db[_0xe95e('0x2b')][_0xe95e('0x4c')]({'where':{'id':_0x59a86e[_0xe95e('0x45')]['id']}})[_0xe95e('0x26')](handleEntityNotFound(_0x5d208d,null))[_0xe95e('0x26')](function(_0x1e4271){if(_0x1e4271){_0x23a011[_0xe95e('0x2e')]=_['keys'](db[_0xe95e('0x4d')][_0xe95e('0x4e')]);_0x23a011[_0xe95e('0x2f')]=_['keys'](_0x59a86e[_0xe95e('0x2f')]);_0x23a011['filters']=_['intersection'](_0x23a011[_0xe95e('0x2e')],_0x23a011[_0xe95e('0x2f')]);_0x3598cc[_0xe95e('0x34')]=_[_0xe95e('0x32')](_0x23a011['model'],qs[_0xe95e('0x33')](_0x59a86e[_0xe95e('0x2f')][_0xe95e('0x33')]));_0x3598cc[_0xe95e('0x34')]=_0x3598cc[_0xe95e('0x34')][_0xe95e('0x35')]?_0x3598cc['attributes']:_0x23a011['model'];if(!_0x59a86e[_0xe95e('0x2f')]['hasOwnProperty'](_0xe95e('0x36'))){_0x3598cc[_0xe95e('0x1f')]=qs[_0xe95e('0x1f')](_0x59a86e[_0xe95e('0x2f')]['limit']);_0x3598cc['offset']=qs[_0xe95e('0x1d')](_0x59a86e['query']['offset']);}_0x3598cc['order']=qs[_0xe95e('0x37')](_0x59a86e[_0xe95e('0x2f')][_0xe95e('0x37')]);_0x3598cc[_0xe95e('0x3a')]=qs['filters'](_['pick'](_0x59a86e[_0xe95e('0x2f')],_0x23a011[_0xe95e('0x31')]));_0x3598cc[_0xe95e('0x3a')][_0xe95e('0x4f')]=_0x1e4271['id'];if(_0x59a86e[_0xe95e('0x2f')][_0xe95e('0x39')]){_0x3598cc[_0xe95e('0x3a')]=_[_0xe95e('0x3b')](_0x3598cc['where'],{'$or':_['map'](_0x3598cc[_0xe95e('0x34')],function(_0x87c7b2){var _0x25090a={};_0x25090a[_0x87c7b2]={'$like':'%'+_0x59a86e[_0xe95e('0x2f')][_0xe95e('0x39')]+'%'};return _0x25090a;})});}_0x3598cc=_['merge']({},_0x3598cc,_0x59a86e['options']);return db['JscriptyQuestionReport']['count']({'where':_0x3598cc['where']})['then'](function(_0x230b05){_0xbfdc75[_0xe95e('0x20')]=_0x230b05;if(_0x59a86e[_0xe95e('0x2f')][_0xe95e('0x40')]){_0x3598cc[_0xe95e('0x46')]=[{'all':!![]}];}return db[_0xe95e('0x4d')]['findAll'](_0x3598cc);})[_0xe95e('0x26')](function(_0xa16785){_0xbfdc75['rows']=_0xa16785;return _0xbfdc75;});}})['then'](respondWithFilteredResult(_0x5d208d,_0x3598cc))['catch'](handleError(_0x5d208d,null));};
\ No newline at end of file
+var _0x48bf=['where','pick','merge','type','filter','options','includeAll','include','rows','catch','params','body','find','describe','JscriptyQuestionReport','findAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','json','offset','limit','count','status','Content-Range','apply','reject','save','update','then','destroy','end','stack','name','send','map','JscriptySessionReport','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort'];(function(_0x64ff1c,_0x2eec47){var _0x44cce7=function(_0x6577ef){while(--_0x6577ef){_0x64ff1c['push'](_0x64ff1c['shift']());}};_0x44cce7(++_0x2eec47);}(_0x48bf,0xa4));var _0xf48b=function(_0x23e7c1,_0x35110c){_0x23e7c1=_0x23e7c1-0x0;var _0x1add43=_0x48bf[_0x23e7c1];return _0x1add43;};'use strict';var emlformat=require(_0xf48b('0x0'));var rimraf=require(_0xf48b('0x1'));var zipdir=require(_0xf48b('0x2'));var jsonpatch=require(_0xf48b('0x3'));var rp=require(_0xf48b('0x4'));var moment=require('moment');var BPromise=require(_0xf48b('0x5'));var Mustache=require(_0xf48b('0x6'));var util=require(_0xf48b('0x7'));var path=require(_0xf48b('0x8'));var sox=require(_0xf48b('0x9'));var csv=require(_0xf48b('0xa'));var ejs=require(_0xf48b('0xb'));var fs=require('fs');var fs_extra=require(_0xf48b('0xc'));var _=require(_0xf48b('0xd'));var squel=require(_0xf48b('0xe'));var crypto=require(_0xf48b('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xf48b('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xf48b('0x11'));var qs=require(_0xf48b('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf48b('0x13'));var logger=require(_0xf48b('0x14'))('api');var utils=require(_0xf48b('0x15'));var config=require(_0xf48b('0x16'));var licenseUtil=require(_0xf48b('0x17'));var db=require(_0xf48b('0x18'))['db'];function respondWithStatusCode(_0x483ac2,_0x47f5cf){_0x47f5cf=_0x47f5cf||0xcc;return function(_0x1fdeb6){if(_0x1fdeb6){return _0x483ac2[_0xf48b('0x19')](_0x47f5cf);}return _0x483ac2['status'](_0x47f5cf)['end']();};}function respondWithResult(_0x23698d,_0x5c6256){_0x5c6256=_0x5c6256||0xc8;return function(_0x555792){if(_0x555792){return _0x23698d['status'](_0x5c6256)[_0xf48b('0x1a')](_0x555792);}};}function respondWithFilteredResult(_0x50c231,_0x50af16){return function(_0x152397){if(_0x152397){var _0x2ba3ae=typeof _0x50af16[_0xf48b('0x1b')]==='undefined'&&typeof _0x50af16[_0xf48b('0x1c')]==='undefined';var _0x396daf=_0x152397['count'];var _0x3804d3=_0x2ba3ae?0x0:_0x50af16['offset'];var _0x28bc2a=_0x2ba3ae?_0x152397[_0xf48b('0x1d')]:_0x50af16['offset']+_0x50af16[_0xf48b('0x1c')];var _0x118ce7;if(_0x28bc2a>=_0x396daf){_0x28bc2a=_0x396daf;_0x118ce7=0xc8;}else{_0x118ce7=0xce;}_0x50c231[_0xf48b('0x1e')](_0x118ce7);return _0x50c231['set'](_0xf48b('0x1f'),_0x3804d3+'-'+_0x28bc2a+'/'+_0x396daf)['json'](_0x152397);}return null;};}function patchUpdates(_0x43a015){return function(_0x22354e){try{jsonpatch[_0xf48b('0x20')](_0x22354e,_0x43a015,!![]);}catch(_0x4e3553){return BPromise[_0xf48b('0x21')](_0x4e3553);}return _0x22354e[_0xf48b('0x22')]();};}function saveUpdates(_0x476736,_0xf089f4){return function(_0x55a48c){if(_0x55a48c){return _0x55a48c[_0xf48b('0x23')](_0x476736)[_0xf48b('0x24')](function(_0x4d4610){return _0x4d4610;});}return null;};}function removeEntity(_0x41cd09,_0x103bd8){return function(_0x5d60ea){if(_0x5d60ea){return _0x5d60ea[_0xf48b('0x25')]()[_0xf48b('0x24')](function(){_0x41cd09[_0xf48b('0x1e')](0xcc)[_0xf48b('0x26')]();});}};}function handleEntityNotFound(_0x19445a,_0xfbfe21){return function(_0x2bea70){if(!_0x2bea70){_0x19445a[_0xf48b('0x19')](0x194);}return _0x2bea70;};}function handleError(_0x1212d1,_0x52ce6a){_0x52ce6a=_0x52ce6a||0x1f4;return function(_0x22a99f){logger['error'](_0x22a99f[_0xf48b('0x27')]);if(_0x22a99f[_0xf48b('0x28')]){delete _0x22a99f[_0xf48b('0x28')];}_0x1212d1[_0xf48b('0x1e')](_0x52ce6a)[_0xf48b('0x29')](_0x22a99f);};}exports['index']=function(_0x476a85,_0x60f32){var _0x51a88c={},_0x1a8fc5={},_0x958ea4={'count':0x0,'rows':[]};var _0x22ce8a=_[_0xf48b('0x2a')](db[_0xf48b('0x2b')][_0xf48b('0x2c')],function(_0x5378c6){return{'name':_0x5378c6['fieldName'],'type':_0x5378c6['type'][_0xf48b('0x2d')]};});_0x1a8fc5[_0xf48b('0x2e')]=_[_0xf48b('0x2a')](_0x22ce8a,'name');_0x1a8fc5[_0xf48b('0x2f')]=_[_0xf48b('0x30')](_0x476a85['query']);_0x1a8fc5[_0xf48b('0x31')]=_[_0xf48b('0x32')](_0x1a8fc5[_0xf48b('0x2e')],_0x1a8fc5[_0xf48b('0x2f')]);_0x51a88c[_0xf48b('0x33')]=_[_0xf48b('0x32')](_0x1a8fc5[_0xf48b('0x2e')],qs[_0xf48b('0x34')](_0x476a85[_0xf48b('0x2f')][_0xf48b('0x34')]));_0x51a88c[_0xf48b('0x33')]=_0x51a88c[_0xf48b('0x33')][_0xf48b('0x35')]?_0x51a88c[_0xf48b('0x33')]:_0x1a8fc5[_0xf48b('0x2e')];if(!_0x476a85[_0xf48b('0x2f')][_0xf48b('0x36')](_0xf48b('0x37'))){_0x51a88c[_0xf48b('0x1c')]=qs[_0xf48b('0x1c')](_0x476a85['query'][_0xf48b('0x1c')]);_0x51a88c[_0xf48b('0x1b')]=qs['offset'](_0x476a85[_0xf48b('0x2f')][_0xf48b('0x1b')]);}_0x51a88c[_0xf48b('0x38')]=qs[_0xf48b('0x39')](_0x476a85[_0xf48b('0x2f')][_0xf48b('0x39')]);_0x51a88c[_0xf48b('0x3a')]=qs['filters'](_[_0xf48b('0x3b')](_0x476a85[_0xf48b('0x2f')],_0x1a8fc5[_0xf48b('0x31')]),_0x22ce8a);if(_0x476a85['query']['filter']){_0x51a88c[_0xf48b('0x3a')]=_[_0xf48b('0x3c')](_0x51a88c[_0xf48b('0x3a')],{'$or':_['map'](_0x22ce8a,function(_0x41be41){if(_0x41be41[_0xf48b('0x3d')]!=='VIRTUAL'){var _0x14c40b={};_0x14c40b[_0x41be41[_0xf48b('0x28')]]={'$like':'%'+_0x476a85[_0xf48b('0x2f')][_0xf48b('0x3e')]+'%'};return _0x14c40b;}})});}_0x51a88c=_[_0xf48b('0x3c')]({},_0x51a88c,_0x476a85[_0xf48b('0x3f')]);var _0x25d625={'where':_0x51a88c['where']};return db['JscriptySessionReport']['count'](_0x25d625)['then'](function(_0x15899b){_0x958ea4['count']=_0x15899b;if(_0x476a85[_0xf48b('0x2f')][_0xf48b('0x40')]){_0x51a88c[_0xf48b('0x41')]=[{'all':!![]}];}return db[_0xf48b('0x2b')]['findAll'](_0x51a88c);})[_0xf48b('0x24')](function(_0x3630e2){_0x958ea4[_0xf48b('0x42')]=_0x3630e2;return _0x958ea4;})[_0xf48b('0x24')](respondWithFilteredResult(_0x60f32,_0x51a88c))[_0xf48b('0x43')](handleError(_0x60f32,null));};exports['show']=function(_0x1dfd48,_0x493019){var _0x52e15b={'raw':!![],'where':{'id':_0x1dfd48[_0xf48b('0x44')]['id']}},_0x4e5734={};_0x4e5734[_0xf48b('0x2e')]=_[_0xf48b('0x30')](db['JscriptySessionReport']['rawAttributes']);_0x4e5734[_0xf48b('0x2f')]=_[_0xf48b('0x30')](_0x1dfd48[_0xf48b('0x2f')]);_0x4e5734['filters']=_[_0xf48b('0x32')](_0x4e5734[_0xf48b('0x2e')],_0x4e5734[_0xf48b('0x2f')]);_0x52e15b[_0xf48b('0x33')]=_[_0xf48b('0x32')](_0x4e5734[_0xf48b('0x2e')],qs[_0xf48b('0x34')](_0x1dfd48[_0xf48b('0x2f')][_0xf48b('0x34')]));_0x52e15b[_0xf48b('0x33')]=_0x52e15b[_0xf48b('0x33')][_0xf48b('0x35')]?_0x52e15b[_0xf48b('0x33')]:_0x4e5734['model'];if(_0x1dfd48['query'][_0xf48b('0x40')]){_0x52e15b['include']=[{'all':!![]}];}_0x52e15b=_[_0xf48b('0x3c')]({},_0x52e15b,_0x1dfd48['options']);return db[_0xf48b('0x2b')]['find'](_0x52e15b)[_0xf48b('0x24')](handleEntityNotFound(_0x493019,null))[_0xf48b('0x24')](respondWithResult(_0x493019,null))[_0xf48b('0x43')](handleError(_0x493019,null));};exports['create']=function(_0x1848dd,_0x3d5f6e){return db['JscriptySessionReport']['create'](_0x1848dd[_0xf48b('0x45')],{})[_0xf48b('0x24')](respondWithResult(_0x3d5f6e,0xc9))[_0xf48b('0x43')](handleError(_0x3d5f6e,null));};exports['update']=function(_0x112eca,_0x45c1e9){if(_0x112eca[_0xf48b('0x45')]['id']){delete _0x112eca['body']['id'];}return db[_0xf48b('0x2b')]['find']({'where':{'id':_0x112eca[_0xf48b('0x44')]['id']}})[_0xf48b('0x24')](handleEntityNotFound(_0x45c1e9,null))['then'](saveUpdates(_0x112eca[_0xf48b('0x45')],null))[_0xf48b('0x24')](respondWithResult(_0x45c1e9,null))[_0xf48b('0x43')](handleError(_0x45c1e9,null));};exports[_0xf48b('0x25')]=function(_0x53dba1,_0x579870){return db[_0xf48b('0x2b')][_0xf48b('0x46')]({'where':{'id':_0x53dba1['params']['id']}})[_0xf48b('0x24')](handleEntityNotFound(_0x579870,null))[_0xf48b('0x24')](removeEntity(_0x579870,null))[_0xf48b('0x43')](handleError(_0x579870,null));};exports['describe']=function(_0x491e82,_0x4f6d47){return db['JscriptySessionReport'][_0xf48b('0x47')]()[_0xf48b('0x24')](respondWithResult(_0x4f6d47,null))['catch'](handleError(_0x4f6d47,null));};exports['getQuestions']=function(_0x264767,_0x52031,_0xb269ad){var _0x5d1c06={'raw':!![],'where':{}};var _0x2e5467={};var _0x42e8cc={'count':0x0,'rows':[]};return db[_0xf48b('0x2b')]['findOne']({'where':{'id':_0x264767[_0xf48b('0x44')]['id']}})['then'](handleEntityNotFound(_0x52031,null))[_0xf48b('0x24')](function(_0x52446d){if(_0x52446d){_0x2e5467[_0xf48b('0x2e')]=_[_0xf48b('0x30')](db['JscriptyQuestionReport'][_0xf48b('0x2c')]);_0x2e5467['query']=_[_0xf48b('0x30')](_0x264767[_0xf48b('0x2f')]);_0x2e5467['filters']=_[_0xf48b('0x32')](_0x2e5467['model'],_0x2e5467[_0xf48b('0x2f')]);_0x5d1c06[_0xf48b('0x33')]=_['intersection'](_0x2e5467[_0xf48b('0x2e')],qs['fields'](_0x264767[_0xf48b('0x2f')]['fields']));_0x5d1c06['attributes']=_0x5d1c06['attributes'][_0xf48b('0x35')]?_0x5d1c06['attributes']:_0x2e5467[_0xf48b('0x2e')];if(!_0x264767[_0xf48b('0x2f')]['hasOwnProperty'](_0xf48b('0x37'))){_0x5d1c06['limit']=qs[_0xf48b('0x1c')](_0x264767[_0xf48b('0x2f')]['limit']);_0x5d1c06[_0xf48b('0x1b')]=qs['offset'](_0x264767[_0xf48b('0x2f')]['offset']);}_0x5d1c06[_0xf48b('0x38')]=qs['sort'](_0x264767['query'][_0xf48b('0x39')]);_0x5d1c06[_0xf48b('0x3a')]=qs[_0xf48b('0x31')](_['pick'](_0x264767[_0xf48b('0x2f')],_0x2e5467[_0xf48b('0x31')]));_0x5d1c06[_0xf48b('0x3a')]['SessionId']=_0x52446d['id'];if(_0x264767[_0xf48b('0x2f')][_0xf48b('0x3e')]){_0x5d1c06[_0xf48b('0x3a')]=_[_0xf48b('0x3c')](_0x5d1c06[_0xf48b('0x3a')],{'$or':_[_0xf48b('0x2a')](_0x5d1c06['attributes'],function(_0x34372c){var _0x38fc2c={};_0x38fc2c[_0x34372c]={'$like':'%'+_0x264767[_0xf48b('0x2f')]['filter']+'%'};return _0x38fc2c;})});}_0x5d1c06=_['merge']({},_0x5d1c06,_0x264767['options']);return db[_0xf48b('0x48')]['count']({'where':_0x5d1c06[_0xf48b('0x3a')]})[_0xf48b('0x24')](function(_0x4d739d){_0x42e8cc[_0xf48b('0x1d')]=_0x4d739d;if(_0x264767[_0xf48b('0x2f')][_0xf48b('0x40')]){_0x5d1c06[_0xf48b('0x41')]=[{'all':!![]}];}return db[_0xf48b('0x48')][_0xf48b('0x49')](_0x5d1c06);})[_0xf48b('0x24')](function(_0xb054de){_0x42e8cc['rows']=_0xb054de;return _0x42e8cc;});}})['then'](respondWithFilteredResult(_0x52031,_0x5d1c06))['catch'](handleError(_0x52031,null));};
\ No newline at end of file
index b2ff362..7d38067 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xed1c=['exports','JscriptySessionReport','report_jscripty_sessions','lodash','util','request-promise','path','rimraf','./jscriptySessionReport.attributes'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xed1c,0xe4));var _0xced1=function(_0x21b475,_0x518fdb){_0x21b475=_0x21b475-0x0;var _0x5ac52c=_0xed1c[_0x21b475];return _0x5ac52c;};'use strict';var _=require(_0xced1('0x0'));var util=require(_0xced1('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xced1('0x2'));var fs=require('fs');var path=require(_0xced1('0x3'));var rimraf=require(_0xced1('0x4'));var config=require('../../config/environment');var attributes=require(_0xced1('0x5'));module[_0xced1('0x6')]=function(_0x466657,_0x37b22b){return _0x466657['define'](_0xced1('0x7'),attributes,{'tableName':_0xced1('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xdc97=['path','../../config/environment','./jscriptySessionReport.attributes','exports','define','lodash','util','../../config/logger','moment','request-promise'];(function(_0x2c0d7b,_0x4ec918){var _0x3c769f=function(_0x13fb48){while(--_0x13fb48){_0x2c0d7b['push'](_0x2c0d7b['shift']());}};_0x3c769f(++_0x4ec918);}(_0xdc97,0x13b));var _0x7dc9=function(_0x786898,_0x57fd09){_0x786898=_0x786898-0x0;var _0x55ea4f=_0xdc97[_0x786898];return _0x55ea4f;};'use strict';var _=require(_0x7dc9('0x0'));var util=require(_0x7dc9('0x1'));var logger=require(_0x7dc9('0x2'))('api');var moment=require(_0x7dc9('0x3'));var BPromise=require('bluebird');var rp=require(_0x7dc9('0x4'));var fs=require('fs');var path=require(_0x7dc9('0x5'));var rimraf=require('rimraf');var config=require(_0x7dc9('0x6'));var attributes=require(_0x7dc9('0x7'));module[_0x7dc9('0x8')]=function(_0x3ba3ca,_0x589f02){return _0x3ba3ca[_0x7dc9('0x9')]('JscriptySessionReport',attributes,{'tableName':'report_jscripty_sessions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 56282ae..f6f3854 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x25e7=['JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','request','then','info'];(function(_0x807201,_0x16d0f1){var _0x2c2ac5=function(_0x27b290){while(--_0x27b290){_0x807201['push'](_0x807201['shift']());}};_0x2c2ac5(++_0x16d0f1);}(_0x25e7,0x1d6));var _0x725e=function(_0x51b2f1,_0x22c27a){_0x51b2f1=_0x51b2f1-0x0;var _0xf9ddf8=_0x25e7[_0x51b2f1];return _0xf9ddf8;};'use strict';var _=require(_0x725e('0x0'));var util=require(_0x725e('0x1'));var moment=require(_0x725e('0x2'));var BPromise=require(_0x725e('0x3'));var rs=require(_0x725e('0x4'));var fs=require('fs');var Redis=require(_0x725e('0x5'));var db=require(_0x725e('0x6'))['db'];var utils=require(_0x725e('0x7'));var logger=require(_0x725e('0x8'))(_0x725e('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x725e('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x481316,_0x111a50,_0x192c27){return new BPromise(function(_0x216b33,_0x67de0c){return client[_0x725e('0xb')](_0x481316,_0x192c27)[_0x725e('0xc')](function(_0x39858a){logger[_0x725e('0xd')](_0x725e('0xe'),_0x111a50,_0x725e('0xf'));logger[_0x725e('0x10')](_0x725e('0x11'),_0x111a50,'request\x20sent',JSON['stringify'](_0x39858a));if(_0x39858a[_0x725e('0x12')]){if(_0x39858a[_0x725e('0x12')]['code']===0x1f4){logger['error'](_0x725e('0xe'),_0x111a50,_0x39858a[_0x725e('0x12')]['message']);return _0x67de0c(_0x39858a[_0x725e('0x12')][_0x725e('0x13')]);}logger[_0x725e('0x12')]('JscriptySessionReport,\x20%s,\x20%s',_0x111a50,_0x39858a[_0x725e('0x12')][_0x725e('0x13')]);return _0x216b33(_0x39858a[_0x725e('0x12')][_0x725e('0x13')]);}else{logger[_0x725e('0xd')](_0x725e('0xe'),_0x111a50,'request\x20sent');_0x216b33(_0x39858a[_0x725e('0x14')][_0x725e('0x13')]);}})[_0x725e('0x15')](function(_0x54ac0f){logger[_0x725e('0x12')](_0x725e('0xe'),_0x111a50,_0x54ac0f);_0x67de0c(_0x54ac0f);});});}
\ No newline at end of file
+var _0x32b6=['JscriptySessionReport,\x20%s,\x20%s','message','info','lodash','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','debug','request\x20sent','stringify','error','code'];(function(_0xe34142,_0x44815c){var _0x2c246b=function(_0x5ed43e){while(--_0x5ed43e){_0xe34142['push'](_0xe34142['shift']());}};_0x2c246b(++_0x44815c);}(_0x32b6,0x1d1));var _0x632b=function(_0x285484,_0x399c62){_0x285484=_0x285484-0x0;var _0x1252fe=_0x32b6[_0x285484];return _0x1252fe;};'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']('JscriptySessionReport,\x20%s,\x20%s',_0x3bbf43,'request\x20sent');logger[_0x632b('0xd')]('JscriptySessionReport,\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')]('JscriptySessionReport,\x20%s,\x20%s',_0x3bbf43,_0x4fdef2);_0x33d711(_0x4fdef2);});});}
\ No newline at end of file
index ff1f09a..6f1673e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1f6f=['downloadLogFile','exports','multer','util','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','get','put','/:id','isAuthenticated','update','/download_log_file'];(function(_0x2d8d4f,_0x5527d0){var _0x502e9a=function(_0x20a1a0){while(--_0x20a1a0){_0x2d8d4f['push'](_0x2d8d4f['shift']());}};_0x502e9a(++_0x5527d0);}(_0x1f6f,0x1a6));var _0xf1f6=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x1f6f[_0x397e5f];return _0x5302b8;};'use strict';var multer=require(_0xf1f6('0x0'));var util=require(_0xf1f6('0x1'));var path=require('path');var timeout=require(_0xf1f6('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xf1f6('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xf1f6('0x4'));var config=require(_0xf1f6('0x5'));var controller=require('./license.controller');router[_0xf1f6('0x6')]('/',controller['index']);router[_0xf1f6('0x7')](_0xf1f6('0x8'),auth[_0xf1f6('0x9')](),controller[_0xf1f6('0xa')]);router[_0xf1f6('0x6')](_0xf1f6('0xb'),auth[_0xf1f6('0x9')](),controller[_0xf1f6('0xc')]);module[_0xf1f6('0xd')]=router;
\ No newline at end of file
+var _0xc4d2=['isAuthenticated','update','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./license.controller','get','put','/:id'];(function(_0x2cab41,_0x8ef8fd){var _0x35fb3c=function(_0x9d6fe5){while(--_0x9d6fe5){_0x2cab41['push'](_0x2cab41['shift']());}};_0x35fb3c(++_0x8ef8fd);}(_0xc4d2,0x6c));var _0x2c4d=function(_0x2051cd,_0x3e0072){_0x2051cd=_0x2051cd-0x0;var _0x28a8aa=_0xc4d2[_0x2051cd];return _0x28a8aa;};'use strict';var multer=require(_0x2c4d('0x0'));var util=require('util');var path=require(_0x2c4d('0x1'));var timeout=require(_0x2c4d('0x2'));var express=require(_0x2c4d('0x3'));var router=express['Router']();var fs_extra=require(_0x2c4d('0x4'));var auth=require(_0x2c4d('0x5'));var interaction=require(_0x2c4d('0x6'));var config=require(_0x2c4d('0x7'));var controller=require(_0x2c4d('0x8'));router[_0x2c4d('0x9')]('/',controller['index']);router[_0x2c4d('0xa')](_0x2c4d('0xb'),auth[_0x2c4d('0xc')](),controller[_0x2c4d('0xd')]);router[_0x2c4d('0x9')]('/download_log_file',auth[_0x2c4d('0xc')](),controller['downloadLogFile']);module[_0x2c4d('0xe')]=router;
\ No newline at end of file
index f0151e6..e2fa3f4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe29c=['TEXT','STRING','INTEGER','exports'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0xe29c,0x93));var _0xce29=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xe29c[_0x3bf83f];return _0x22c4a9;};'use strict';var Sequelize=require('sequelize');module[_0xce29('0x0')]={'license':{'type':Sequelize[_0xce29('0x1')]},'data1':{'type':Sequelize[_0xce29('0x2')]},'data2':{'type':Sequelize[_0xce29('0x2')]},'chatLicenseExceeded':{'type':Sequelize[_0xce29('0x3')],'defaultValue':0x0}};
\ No newline at end of file
+var _0xaef2=['STRING','sequelize','TEXT'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xaef2,0xe5));var _0x2aef=function(_0x4403e5,_0x32ddae){_0x4403e5=_0x4403e5-0x0;var _0x512114=_0xaef2[_0x4403e5];return _0x512114;};'use strict';var Sequelize=require(_0x2aef('0x0'));module['exports']={'license':{'type':Sequelize[_0x2aef('0x1')]},'data1':{'type':Sequelize[_0x2aef('0x2')]},'data2':{'type':Sequelize['STRING']},'chatLicenseExceeded':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
index 4189c46..737dfbd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9ba7=['catch','body','find','params','get','checkLicense','key','demo','downloadLogFile','license-info.log','join','/var','log','xcally','setHeader','Content-disposition','attachment;\x20filename=','set','text/plain','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','Content-Range','apply','reject','update','then','stack','name','index','keys','License','rawAttributes','query','model','attributes','intersection','fields','length','merge','options'];(function(_0x5e5649,_0x56e0a8){var _0x50c645=function(_0x264951){while(--_0x264951){_0x5e5649['push'](_0x5e5649['shift']());}};_0x50c645(++_0x56e0a8);}(_0x9ba7,0x1bd));var _0x79ba=function(_0x119d5a,_0x19b457){_0x119d5a=_0x119d5a-0x0;var _0x15bff4=_0x9ba7[_0x119d5a];return _0x15bff4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x79ba('0x0'));var zipdir=require(_0x79ba('0x1'));var jsonpatch=require(_0x79ba('0x2'));var rp=require(_0x79ba('0x3'));var moment=require(_0x79ba('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x79ba('0x5'));var path=require('path');var sox=require(_0x79ba('0x6'));var csv=require(_0x79ba('0x7'));var ejs=require(_0x79ba('0x8'));var fs=require('fs');var fs_extra=require(_0x79ba('0x9'));var _=require(_0x79ba('0xa'));var squel=require(_0x79ba('0xb'));var crypto=require('crypto');var jsforce=require(_0x79ba('0xc'));var deskjs=require(_0x79ba('0xd'));var toCsv=require('to-csv');var querystring=require(_0x79ba('0xe'));var Papa=require(_0x79ba('0xf'));var Redis=require(_0x79ba('0x10'));var authService=require(_0x79ba('0x11'));var qs=require(_0x79ba('0x12'));var as=require(_0x79ba('0x13'));var hardwareService=require(_0x79ba('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x79ba('0x15'));var config=require(_0x79ba('0x16'));var licenseUtil=require(_0x79ba('0x17'));var db=require(_0x79ba('0x18'))['db'];function respondWithStatusCode(_0x3f37c3,_0x361c3b){_0x361c3b=_0x361c3b||0xcc;return function(_0x333668){if(_0x333668){return _0x3f37c3[_0x79ba('0x19')](_0x361c3b);}return _0x3f37c3['status'](_0x361c3b)[_0x79ba('0x1a')]();};}function respondWithResult(_0xe54d6d,_0x5192b2){_0x5192b2=_0x5192b2||0xc8;return function(_0x5aea32){if(_0x5aea32){return _0xe54d6d[_0x79ba('0x1b')](_0x5192b2)[_0x79ba('0x1c')](_0x5aea32);}};}function respondWithFilteredResult(_0x3f9c9d,_0x575df5){return function(_0x53d274){if(_0x53d274){var _0x4f139a=typeof _0x575df5['offset']===_0x79ba('0x1d')&&typeof _0x575df5[_0x79ba('0x1e')]===_0x79ba('0x1d');var _0x166bc2=_0x53d274[_0x79ba('0x1f')];var _0x390b9a=_0x4f139a?0x0:_0x575df5[_0x79ba('0x20')];var _0x5c7d5e=_0x4f139a?_0x53d274[_0x79ba('0x1f')]:_0x575df5[_0x79ba('0x20')]+_0x575df5['limit'];var _0x53e990;if(_0x5c7d5e>=_0x166bc2){_0x5c7d5e=_0x166bc2;_0x53e990=0xc8;}else{_0x53e990=0xce;}_0x3f9c9d[_0x79ba('0x1b')](_0x53e990);return _0x3f9c9d['set'](_0x79ba('0x21'),_0x390b9a+'-'+_0x5c7d5e+'/'+_0x166bc2)[_0x79ba('0x1c')](_0x53d274);}return null;};}function patchUpdates(_0x18c11d){return function(_0x5ef5cd){try{jsonpatch[_0x79ba('0x22')](_0x5ef5cd,_0x18c11d,!![]);}catch(_0x4e5438){return BPromise[_0x79ba('0x23')](_0x4e5438);}return _0x5ef5cd['save']();};}function saveUpdates(_0x308042,_0x458cdf){return function(_0x5d6729){if(_0x5d6729){return _0x5d6729[_0x79ba('0x24')](_0x308042)[_0x79ba('0x25')](function(_0x4e5a12){return _0x4e5a12;});}return null;};}function removeEntity(_0x2470f7,_0x2fe39c){return function(_0x17c341){if(_0x17c341){return _0x17c341['destroy']()['then'](function(){_0x2470f7[_0x79ba('0x1b')](0xcc)[_0x79ba('0x1a')]();});}};}function handleEntityNotFound(_0x31620e,_0x47b16c){return function(_0x2507e8){if(!_0x2507e8){_0x31620e['sendStatus'](0x194);}return _0x2507e8;};}function handleError(_0x415b89,_0xd49a6d){_0xd49a6d=_0xd49a6d||0x1f4;return function(_0x4fb6b4){logger['error'](_0x4fb6b4[_0x79ba('0x26')]);if(_0x4fb6b4[_0x79ba('0x27')]){delete _0x4fb6b4[_0x79ba('0x27')];}_0x415b89[_0x79ba('0x1b')](_0xd49a6d)['send'](_0x4fb6b4);};}var utilLicense=require(_0x79ba('0x17'));exports[_0x79ba('0x28')]=function(_0x380a83,_0x2cccae){var _0x3cdcf1={'raw':!![],'where':{'id':0x1}},_0x27ad3e={};_0x27ad3e['model']=_[_0x79ba('0x29')](db[_0x79ba('0x2a')][_0x79ba('0x2b')]);_0x27ad3e[_0x79ba('0x2c')]=_['keys'](_0x380a83[_0x79ba('0x2c')]);_0x27ad3e['filters']=_['intersection'](_0x27ad3e[_0x79ba('0x2d')],_0x27ad3e[_0x79ba('0x2c')]);_0x3cdcf1[_0x79ba('0x2e')]=_[_0x79ba('0x2f')](_0x27ad3e['model'],qs[_0x79ba('0x30')](_0x380a83['query'][_0x79ba('0x30')]));_0x3cdcf1['attributes']=_0x3cdcf1['attributes'][_0x79ba('0x31')]?_0x3cdcf1[_0x79ba('0x2e')]:_0x27ad3e['model'];_0x3cdcf1=_[_0x79ba('0x32')]({},_0x3cdcf1,_0x380a83[_0x79ba('0x33')]);return utilLicense['getLicense'](_0x3cdcf1)['then'](respondWithResult(_0x2cccae,null))[_0x79ba('0x34')](handleError(_0x2cccae,null));};exports['update']=function(_0x2605d0,_0xeb526e){if(_0x2605d0[_0x79ba('0x35')]['id']){delete _0x2605d0[_0x79ba('0x35')]['id'];}return db[_0x79ba('0x2a')][_0x79ba('0x36')]({'where':{'id':_0x2605d0[_0x79ba('0x37')]['id']}})[_0x79ba('0x25')](handleEntityNotFound(_0xeb526e,null))['then'](function(_0x483e98){var _0x5d7d9a=_0x483e98[_0x79ba('0x38')]({'plain':!![]});return utilLicense[_0x79ba('0x39')](_0x5d7d9a,_0x2605d0[_0x79ba('0x35')][_0x79ba('0x3a')]);})[_0x79ba('0x25')](function(_0x3347a1){if(!_0x3347a1[_0x79ba('0x3b')]){return saveUpdates(_0x2605d0[_0x79ba('0x35')],null);}return _0x3347a1;})[_0x79ba('0x25')](respondWithResult(_0xeb526e,null))[_0x79ba('0x34')](handleError(_0xeb526e,null));};exports[_0x79ba('0x3c')]=function(_0x43a509,_0x3ef359){var _0x572434=_0x79ba('0x3d');var _0xd8cc3c=path[_0x79ba('0x3e')](_0x79ba('0x3f'),_0x79ba('0x40'),_0x79ba('0x41'),_0x572434);_0x3ef359[_0x79ba('0x42')](_0x79ba('0x43'),_0x79ba('0x44')+_0x572434);_0x3ef359[_0x79ba('0x45')]('Content-Type',_0x79ba('0x46'));_0x3ef359['download'](_0xd8cc3c);};
\ No newline at end of file
+var _0x0273=['limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','../../config/license/util','index','model','keys','License','query','filters','intersection','attributes','fields','options','getLicense','catch','body','params','get','checkLicense','downloadLogFile','license-info.log','join','/var','log','xcally','setHeader','Content-disposition','attachment;\x20filename=','Content-Type','text/plain','download','eml-format','rimraf','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/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined'];(function(_0x1848b8,_0x3759c0){var _0x353e3e=function(_0x328e60){while(--_0x328e60){_0x1848b8['push'](_0x1848b8['shift']());}};_0x353e3e(++_0x3759c0);}(_0x0273,0x111));var _0x3027=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0273[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x3027('0x0'));var rimraf=require(_0x3027('0x1'));var zipdir=require(_0x3027('0x2'));var jsonpatch=require(_0x3027('0x3'));var rp=require(_0x3027('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x3027('0x5'));var util=require(_0x3027('0x6'));var path=require(_0x3027('0x7'));var sox=require(_0x3027('0x8'));var csv=require(_0x3027('0x9'));var ejs=require(_0x3027('0xa'));var fs=require('fs');var fs_extra=require(_0x3027('0xb'));var _=require(_0x3027('0xc'));var squel=require(_0x3027('0xd'));var crypto=require(_0x3027('0xe'));var jsforce=require(_0x3027('0xf'));var deskjs=require(_0x3027('0x10'));var toCsv=require(_0x3027('0x9'));var querystring=require(_0x3027('0x11'));var Papa=require(_0x3027('0x12'));var Redis=require(_0x3027('0x13'));var authService=require(_0x3027('0x14'));var qs=require(_0x3027('0x15'));var as=require(_0x3027('0x16'));var hardwareService=require(_0x3027('0x17'));var logger=require(_0x3027('0x18'))(_0x3027('0x19'));var utils=require(_0x3027('0x1a'));var config=require(_0x3027('0x1b'));var licenseUtil=require('../../config/license/util');var db=require(_0x3027('0x1c'))['db'];function respondWithStatusCode(_0x225abc,_0x1f0491){_0x1f0491=_0x1f0491||0xcc;return function(_0x4c127a){if(_0x4c127a){return _0x225abc[_0x3027('0x1d')](_0x1f0491);}return _0x225abc[_0x3027('0x1e')](_0x1f0491)[_0x3027('0x1f')]();};}function respondWithResult(_0x481e38,_0x5b12af){_0x5b12af=_0x5b12af||0xc8;return function(_0x424d78){if(_0x424d78){return _0x481e38[_0x3027('0x1e')](_0x5b12af)[_0x3027('0x20')](_0x424d78);}};}function respondWithFilteredResult(_0x1b8bf8,_0x32220d){return function(_0xa77946){if(_0xa77946){var _0x450633=typeof _0x32220d[_0x3027('0x21')]===_0x3027('0x22')&&typeof _0x32220d[_0x3027('0x23')]===_0x3027('0x22');var _0x2e6952=_0xa77946[_0x3027('0x24')];var _0x536bea=_0x450633?0x0:_0x32220d[_0x3027('0x21')];var _0x24ba2f=_0x450633?_0xa77946[_0x3027('0x24')]:_0x32220d[_0x3027('0x21')]+_0x32220d[_0x3027('0x23')];var _0x4c696a;if(_0x24ba2f>=_0x2e6952){_0x24ba2f=_0x2e6952;_0x4c696a=0xc8;}else{_0x4c696a=0xce;}_0x1b8bf8['status'](_0x4c696a);return _0x1b8bf8[_0x3027('0x25')](_0x3027('0x26'),_0x536bea+'-'+_0x24ba2f+'/'+_0x2e6952)['json'](_0xa77946);}return null;};}function patchUpdates(_0x44ee83){return function(_0x6afb79){try{jsonpatch[_0x3027('0x27')](_0x6afb79,_0x44ee83,!![]);}catch(_0x3ac496){return BPromise[_0x3027('0x28')](_0x3ac496);}return _0x6afb79['save']();};}function saveUpdates(_0xab5c80,_0x106a33){return function(_0x309405){if(_0x309405){return _0x309405[_0x3027('0x29')](_0xab5c80)[_0x3027('0x2a')](function(_0x46a987){return _0x46a987;});}return null;};}function removeEntity(_0x1077e6,_0x340b71){return function(_0x4993dc){if(_0x4993dc){return _0x4993dc[_0x3027('0x2b')]()[_0x3027('0x2a')](function(){_0x1077e6[_0x3027('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3dded5,_0x107320){return function(_0x2dae0f){if(!_0x2dae0f){_0x3dded5[_0x3027('0x1d')](0x194);}return _0x2dae0f;};}function handleError(_0x2e0c76,_0x340a51){_0x340a51=_0x340a51||0x1f4;return function(_0x2ecc06){logger[_0x3027('0x2c')](_0x2ecc06[_0x3027('0x2d')]);if(_0x2ecc06[_0x3027('0x2e')]){delete _0x2ecc06['name'];}_0x2e0c76['status'](_0x340a51)[_0x3027('0x2f')](_0x2ecc06);};}var utilLicense=require(_0x3027('0x30'));exports[_0x3027('0x31')]=function(_0x5ab97b,_0x3e8547){var _0x5354f2={'raw':!![],'where':{'id':0x1}},_0x46d05f={};_0x46d05f[_0x3027('0x32')]=_[_0x3027('0x33')](db[_0x3027('0x34')]['rawAttributes']);_0x46d05f[_0x3027('0x35')]=_[_0x3027('0x33')](_0x5ab97b['query']);_0x46d05f[_0x3027('0x36')]=_[_0x3027('0x37')](_0x46d05f[_0x3027('0x32')],_0x46d05f[_0x3027('0x35')]);_0x5354f2[_0x3027('0x38')]=_['intersection'](_0x46d05f['model'],qs[_0x3027('0x39')](_0x5ab97b[_0x3027('0x35')][_0x3027('0x39')]));_0x5354f2['attributes']=_0x5354f2[_0x3027('0x38')]['length']?_0x5354f2['attributes']:_0x46d05f[_0x3027('0x32')];_0x5354f2=_['merge']({},_0x5354f2,_0x5ab97b[_0x3027('0x3a')]);return utilLicense[_0x3027('0x3b')](_0x5354f2)['then'](respondWithResult(_0x3e8547,null))[_0x3027('0x3c')](handleError(_0x3e8547,null));};exports['update']=function(_0x70e2a2,_0x47f6c0){if(_0x70e2a2[_0x3027('0x3d')]['id']){delete _0x70e2a2[_0x3027('0x3d')]['id'];}return db['License']['find']({'where':{'id':_0x70e2a2[_0x3027('0x3e')]['id']}})[_0x3027('0x2a')](handleEntityNotFound(_0x47f6c0,null))['then'](function(_0x2a7451){var _0x1723be=_0x2a7451[_0x3027('0x3f')]({'plain':!![]});return utilLicense[_0x3027('0x40')](_0x1723be,_0x70e2a2[_0x3027('0x3d')]['key']);})[_0x3027('0x2a')](function(_0x2def73){if(!_0x2def73['demo']){return saveUpdates(_0x70e2a2[_0x3027('0x3d')],null);}return _0x2def73;})[_0x3027('0x2a')](respondWithResult(_0x47f6c0,null))[_0x3027('0x3c')](handleError(_0x47f6c0,null));};exports[_0x3027('0x41')]=function(_0x129371,_0x1a9561){var _0x2e10e7=_0x3027('0x42');var _0x19bb08=path[_0x3027('0x43')](_0x3027('0x44'),_0x3027('0x45'),_0x3027('0x46'),_0x2e10e7);_0x1a9561[_0x3027('0x47')](_0x3027('0x48'),_0x3027('0x49')+_0x2e10e7);_0x1a9561[_0x3027('0x25')](_0x3027('0x4a'),_0x3027('0x4b'));_0x1a9561[_0x3027('0x4c')](_0x19bb08);};
\ No newline at end of file
index 23a6382..0d23ec3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x613d=['moment','request-promise','path','rimraf','../../config/environment','./license.attributes','exports','define','License','license','lodash','util','api'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x613d,0x99));var _0xd613=function(_0x59a0e4,_0x492f2c){_0x59a0e4=_0x59a0e4-0x0;var _0x64e2f9=_0x613d[_0x59a0e4];return _0x64e2f9;};'use strict';var _=require(_0xd613('0x0'));var util=require(_0xd613('0x1'));var logger=require('../../config/logger')(_0xd613('0x2'));var moment=require(_0xd613('0x3'));var BPromise=require('bluebird');var rp=require(_0xd613('0x4'));var fs=require('fs');var path=require(_0xd613('0x5'));var rimraf=require(_0xd613('0x6'));var config=require(_0xd613('0x7'));var attributes=require(_0xd613('0x8'));module[_0xd613('0x9')]=function(_0x10c530,_0x4c5f74){return _0x10c530[_0xd613('0xa')](_0xd613('0xb'),attributes,{'tableName':_0xd613('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5373=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./license.attributes','exports','License','license','util'];(function(_0x5c9e32,_0x4001ac){var _0x39ff71=function(_0x1aa4a0){while(--_0x1aa4a0){_0x5c9e32['push'](_0x5c9e32['shift']());}};_0x39ff71(++_0x4001ac);}(_0x5373,0x12a));var _0x3537=function(_0x308b5e,_0x29091c){_0x308b5e=_0x308b5e-0x0;var _0xa01f50=_0x5373[_0x308b5e];return _0xa01f50;};'use strict';var _=require('lodash');var util=require(_0x3537('0x0'));var logger=require(_0x3537('0x1'))(_0x3537('0x2'));var moment=require(_0x3537('0x3'));var BPromise=require(_0x3537('0x4'));var rp=require(_0x3537('0x5'));var fs=require('fs');var path=require(_0x3537('0x6'));var rimraf=require(_0x3537('0x7'));var config=require(_0x3537('0x8'));var attributes=require(_0x3537('0x9'));module[_0x3537('0xa')]=function(_0x3f4d2d,_0x202270){return _0x3f4d2d['define'](_0x3537('0xb'),attributes,{'tableName':_0x3537('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index eafbe22..fbebf7e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe5dc=['ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','request','then','info','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','stringify','error','code','License,\x20%s,\x20%s','message','catch','lodash','util','randomstring'];(function(_0x333d99,_0x87dd42){var _0x41c679=function(_0xae20f){while(--_0xae20f){_0x333d99['push'](_0x333d99['shift']());}};_0x41c679(++_0x87dd42);}(_0xe5dc,0x18c));var _0xce5d=function(_0x3f278a,_0x5170ac){_0x3f278a=_0x3f278a-0x0;var _0x3ef444=_0xe5dc[_0x3f278a];return _0x3ef444;};'use strict';var _=require(_0xce5d('0x0'));var util=require(_0xce5d('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xce5d('0x2'));var fs=require('fs');var Redis=require(_0xce5d('0x3'));var db=require(_0xce5d('0x4'))['db'];var utils=require(_0xce5d('0x5'));var logger=require(_0xce5d('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xce5d('0x7'));var client=jayson[_0xce5d('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x23d83b,_0x233f50,_0x44fb3e){return new BPromise(function(_0x2ce593,_0x129206){return client[_0xce5d('0x9')](_0x23d83b,_0x44fb3e)[_0xce5d('0xa')](function(_0x462145){logger[_0xce5d('0xb')]('License,\x20%s,\x20%s',_0x233f50,_0xce5d('0xc'));logger[_0xce5d('0xd')](_0xce5d('0xe'),_0x233f50,'request\x20sent',JSON[_0xce5d('0xf')](_0x462145));if(_0x462145[_0xce5d('0x10')]){if(_0x462145[_0xce5d('0x10')][_0xce5d('0x11')]===0x1f4){logger[_0xce5d('0x10')](_0xce5d('0x12'),_0x233f50,_0x462145[_0xce5d('0x10')][_0xce5d('0x13')]);return _0x129206(_0x462145[_0xce5d('0x10')]['message']);}logger[_0xce5d('0x10')](_0xce5d('0x12'),_0x233f50,_0x462145[_0xce5d('0x10')][_0xce5d('0x13')]);return _0x2ce593(_0x462145[_0xce5d('0x10')]['message']);}else{logger['info'](_0xce5d('0x12'),_0x233f50,_0xce5d('0xc'));_0x2ce593(_0x462145['result'][_0xce5d('0x13')]);}})[_0xce5d('0x14')](function(_0x31e0ac){logger['error'](_0xce5d('0x12'),_0x233f50,_0x31e0ac);_0x129206(_0x31e0ac);});});}
\ No newline at end of file
+var _0x95fd=['../../config/environment','jayson/promise','client','request','License,\x20%s,\x20%s','request\x20sent','License,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x2280f9,_0x20175f){var _0x59aebf=function(_0x4c0255){while(--_0x4c0255){_0x2280f9['push'](_0x2280f9['shift']());}};_0x59aebf(++_0x20175f);}(_0x95fd,0x10b));var _0xd95f=function(_0x376c57,_0x499d38){_0x376c57=_0x376c57-0x0;var _0x36cdf0=_0x95fd[_0x376c57];return _0x36cdf0;};'use strict';var _=require(_0xd95f('0x0'));var util=require(_0xd95f('0x1'));var moment=require(_0xd95f('0x2'));var BPromise=require(_0xd95f('0x3'));var rs=require(_0xd95f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd95f('0x5'))['db'];var utils=require(_0xd95f('0x6'));var logger=require(_0xd95f('0x7'))(_0xd95f('0x8'));var config=require(_0xd95f('0x9'));var jayson=require(_0xd95f('0xa'));var client=jayson[_0xd95f('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x293221,_0x10b093,_0x41b9fa){return new BPromise(function(_0x3e9ddc,_0x212151){return client[_0xd95f('0xc')](_0x293221,_0x41b9fa)['then'](function(_0x30ef7e){logger['info'](_0xd95f('0xd'),_0x10b093,_0xd95f('0xe'));logger['debug'](_0xd95f('0xf'),_0x10b093,_0xd95f('0xe'),JSON[_0xd95f('0x10')](_0x30ef7e));if(_0x30ef7e['error']){if(_0x30ef7e[_0xd95f('0x11')][_0xd95f('0x12')]===0x1f4){logger[_0xd95f('0x11')](_0xd95f('0xd'),_0x10b093,_0x30ef7e[_0xd95f('0x11')][_0xd95f('0x13')]);return _0x212151(_0x30ef7e['error'][_0xd95f('0x13')]);}logger['error']('License,\x20%s,\x20%s',_0x10b093,_0x30ef7e[_0xd95f('0x11')][_0xd95f('0x13')]);return _0x3e9ddc(_0x30ef7e[_0xd95f('0x11')][_0xd95f('0x13')]);}else{logger[_0xd95f('0x14')](_0xd95f('0xd'),_0x10b093,_0xd95f('0xe'));_0x3e9ddc(_0x30ef7e[_0xd95f('0x15')][_0xd95f('0x13')]);}})[_0xd95f('0x16')](function(_0x198a2d){logger[_0xd95f('0x11')](_0xd95f('0xd'),_0x10b093,_0x198a2d);_0x212151(_0x198a2d);});});}
\ No newline at end of file
index 428200a..2535887 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbb32=['post','create','/:id/interactions','addInteraction','addApplications','send','addAgents','/:id','delete','removeDispositions','removeAnswers','removeImap','removeSmtp','destroy','removeAgents','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/in_servers','getImap','/:id/out_servers','/:id/applications','getApplications','/:id/messages','getMessages','/:id/users','getAgents','addDisposition'];(function(_0x459a0a,_0x25c46f){var _0x4ab46c=function(_0x451a6a){while(--_0x451a6a){_0x459a0a['push'](_0x459a0a['shift']());}};_0x4ab46c(++_0x25c46f);}(_0xbb32,0xe7));var _0x2bb3=function(_0x119769,_0x32865d){_0x119769=_0x119769-0x0;var _0x105c19=_0xbb32[_0x119769];return _0x105c19;};'use strict';var multer=require('multer');var util=require(_0x2bb3('0x0'));var path=require(_0x2bb3('0x1'));var timeout=require(_0x2bb3('0x2'));var express=require('express');var router=express[_0x2bb3('0x3')]();var fs_extra=require(_0x2bb3('0x4'));var auth=require(_0x2bb3('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x2bb3('0x6'));var controller=require('./mailAccount.controller');router[_0x2bb3('0x7')]('/',auth[_0x2bb3('0x8')](),controller[_0x2bb3('0x9')]);router[_0x2bb3('0x7')](_0x2bb3('0xa'),auth[_0x2bb3('0x8')](),controller[_0x2bb3('0xb')]);router[_0x2bb3('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x2bb3('0xc')]);router['get'](_0x2bb3('0xd'),auth[_0x2bb3('0x8')](),controller[_0x2bb3('0xe')]);router[_0x2bb3('0x7')](_0x2bb3('0xf'),auth[_0x2bb3('0x8')](),controller[_0x2bb3('0x10')]);router[_0x2bb3('0x7')](_0x2bb3('0x11'),auth['isAuthenticated'](),controller[_0x2bb3('0x12')]);router['get'](_0x2bb3('0x13'),auth[_0x2bb3('0x8')](),controller['getSmtp']);router[_0x2bb3('0x7')]('/:id/interactions',auth['isAuthenticated'](),controller['getInteractions']);router['get'](_0x2bb3('0x14'),auth['isAuthenticated'](),controller[_0x2bb3('0x15')]);router[_0x2bb3('0x7')](_0x2bb3('0x16'),auth['isAuthenticated'](),controller[_0x2bb3('0x17')]);router[_0x2bb3('0x7')]('/:id/verify',auth[_0x2bb3('0x8')](),controller['verifySmtp']);router[_0x2bb3('0x7')](_0x2bb3('0x18'),auth[_0x2bb3('0x8')](),controller[_0x2bb3('0x19')]);router['post'](_0x2bb3('0xd'),auth['isAuthenticated'](),controller[_0x2bb3('0x1a')]);router[_0x2bb3('0x1b')](_0x2bb3('0xf'),auth[_0x2bb3('0x8')](),controller['addAnswer']);router[_0x2bb3('0x1b')]('/',auth['isAuthenticated'](),controller[_0x2bb3('0x1c')]);router['post'](_0x2bb3('0x11'),auth[_0x2bb3('0x8')](),controller['addImap']);router['post'](_0x2bb3('0x13'),auth[_0x2bb3('0x8')](),controller['addSmtp']);router[_0x2bb3('0x1b')](_0x2bb3('0x1d'),auth[_0x2bb3('0x8')](),controller[_0x2bb3('0x1e')]);router[_0x2bb3('0x1b')](_0x2bb3('0x14'),auth[_0x2bb3('0x8')](),controller[_0x2bb3('0x1f')]);router['post']('/:id/send',auth[_0x2bb3('0x8')](),controller[_0x2bb3('0x20')]);router[_0x2bb3('0x1b')](_0x2bb3('0x18'),auth[_0x2bb3('0x8')](),controller[_0x2bb3('0x21')]);router['put'](_0x2bb3('0x22'),auth['isAuthenticated'](),controller['update']);router[_0x2bb3('0x23')](_0x2bb3('0xd'),auth[_0x2bb3('0x8')](),controller[_0x2bb3('0x24')]);router[_0x2bb3('0x23')]('/:id/canned_answers',auth[_0x2bb3('0x8')](),controller[_0x2bb3('0x25')]);router[_0x2bb3('0x23')](_0x2bb3('0x11'),auth[_0x2bb3('0x8')](),controller[_0x2bb3('0x26')]);router[_0x2bb3('0x23')]('/:id/out_servers',auth[_0x2bb3('0x8')](),controller[_0x2bb3('0x27')]);router['delete'](_0x2bb3('0x22'),auth[_0x2bb3('0x8')](),controller[_0x2bb3('0x28')]);router['delete'](_0x2bb3('0x18'),auth['isAuthenticated'](),controller[_0x2bb3('0x29')]);module[_0x2bb3('0x2a')]=router;
\ No newline at end of file
+var _0x2d1d=['show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/in_servers','getImap','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','getApplications','/:id/messages','getMessages','/:id/verify','verifySmtp','/:id/users','getAgents','post','addDisposition','addAnswer','addImap','addSmtp','addApplications','/:id/send','send','update','delete','removeDispositions','removeAnswers','removeImap','destroy','removeAgents','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailAccount.controller','isAuthenticated','index','get','describe','/:id'];(function(_0x1f0873,_0x425151){var _0x5ba42d=function(_0x1fe478){while(--_0x1fe478){_0x1f0873['push'](_0x1f0873['shift']());}};_0x5ba42d(++_0x425151);}(_0x2d1d,0xb2));var _0xd2d1=function(_0xa4d38a,_0x149c93){_0xa4d38a=_0xa4d38a-0x0;var _0x450e43=_0x2d1d[_0xa4d38a];return _0x450e43;};'use strict';var multer=require(_0xd2d1('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xd2d1('0x1'));var express=require(_0xd2d1('0x2'));var router=express[_0xd2d1('0x3')]();var fs_extra=require(_0xd2d1('0x4'));var auth=require(_0xd2d1('0x5'));var interaction=require(_0xd2d1('0x6'));var config=require(_0xd2d1('0x7'));var controller=require(_0xd2d1('0x8'));router['get']('/',auth[_0xd2d1('0x9')](),controller[_0xd2d1('0xa')]);router[_0xd2d1('0xb')]('/describe',auth[_0xd2d1('0x9')](),controller[_0xd2d1('0xc')]);router[_0xd2d1('0xb')](_0xd2d1('0xd'),auth[_0xd2d1('0x9')](),controller[_0xd2d1('0xe')]);router[_0xd2d1('0xb')](_0xd2d1('0xf'),auth['isAuthenticated'](),controller[_0xd2d1('0x10')]);router['get'](_0xd2d1('0x11'),auth[_0xd2d1('0x9')](),controller[_0xd2d1('0x12')]);router[_0xd2d1('0xb')](_0xd2d1('0x13'),auth[_0xd2d1('0x9')](),controller[_0xd2d1('0x14')]);router[_0xd2d1('0xb')](_0xd2d1('0x15'),auth[_0xd2d1('0x9')](),controller[_0xd2d1('0x16')]);router[_0xd2d1('0xb')](_0xd2d1('0x17'),auth[_0xd2d1('0x9')](),controller[_0xd2d1('0x18')]);router['get']('/:id/applications',auth[_0xd2d1('0x9')](),controller[_0xd2d1('0x19')]);router[_0xd2d1('0xb')](_0xd2d1('0x1a'),auth['isAuthenticated'](),controller[_0xd2d1('0x1b')]);router[_0xd2d1('0xb')](_0xd2d1('0x1c'),auth[_0xd2d1('0x9')](),controller[_0xd2d1('0x1d')]);router[_0xd2d1('0xb')](_0xd2d1('0x1e'),auth[_0xd2d1('0x9')](),controller[_0xd2d1('0x1f')]);router[_0xd2d1('0x20')]('/:id/dispositions',auth[_0xd2d1('0x9')](),controller[_0xd2d1('0x21')]);router[_0xd2d1('0x20')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0xd2d1('0x22')]);router[_0xd2d1('0x20')]('/',auth['isAuthenticated'](),controller['create']);router[_0xd2d1('0x20')](_0xd2d1('0x13'),auth[_0xd2d1('0x9')](),controller[_0xd2d1('0x23')]);router[_0xd2d1('0x20')]('/:id/out_servers',auth[_0xd2d1('0x9')](),controller[_0xd2d1('0x24')]);router[_0xd2d1('0x20')](_0xd2d1('0x17'),auth['isAuthenticated'](),controller['addInteraction']);router[_0xd2d1('0x20')]('/:id/applications',auth['isAuthenticated'](),controller[_0xd2d1('0x25')]);router[_0xd2d1('0x20')](_0xd2d1('0x26'),auth[_0xd2d1('0x9')](),controller[_0xd2d1('0x27')]);router[_0xd2d1('0x20')](_0xd2d1('0x1e'),auth[_0xd2d1('0x9')](),controller['addAgents']);router['put'](_0xd2d1('0xd'),auth[_0xd2d1('0x9')](),controller[_0xd2d1('0x28')]);router[_0xd2d1('0x29')](_0xd2d1('0xf'),auth[_0xd2d1('0x9')](),controller[_0xd2d1('0x2a')]);router[_0xd2d1('0x29')](_0xd2d1('0x11'),auth['isAuthenticated'](),controller[_0xd2d1('0x2b')]);router[_0xd2d1('0x29')](_0xd2d1('0x13'),auth[_0xd2d1('0x9')](),controller[_0xd2d1('0x2c')]);router['delete'](_0xd2d1('0x15'),auth[_0xd2d1('0x9')](),controller['removeSmtp']);router[_0xd2d1('0x29')]('/:id',auth[_0xd2d1('0x9')](),controller[_0xd2d1('0x2d')]);router[_0xd2d1('0x29')](_0xd2d1('0x1e'),auth[_0xd2d1('0x9')](),controller[_0xd2d1('0x2e')]);module[_0xd2d1('0x2f')]=router;
\ No newline at end of file
index f2ab0e0..a60f388 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x91a2=['ENUM','gmail','hotmail','yahoo','getDataValue','provider','custom','sequelize','STRING','BOOLEAN','Arial,Helvetica,sans-serif','UNSIGNED','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue'];(function(_0x5d8d5f,_0x1adf93){var _0x10be5c=function(_0x6866bb){while(--_0x6866bb){_0x5d8d5f['push'](_0x5d8d5f['shift']());}};_0x10be5c(++_0x1adf93);}(_0x91a2,0x16f));var _0x291a=function(_0x260b48,_0x117977){_0x260b48=_0x260b48-0x0;var _0x3f730b=_0x91a2[_0x260b48];return _0x3f730b;};'use strict';var Sequelize=require(_0x291a('0x0'));module['exports']={'description':{'type':Sequelize[_0x291a('0x1')]},'name':{'type':Sequelize[_0x291a('0x1')],'allowNull':![]},'service':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x291a('0x2')],'defaultValue':!![]},'key':{'type':Sequelize[_0x291a('0x1')],'allowNull':![]},'template':{'type':Sequelize['TEXT']},'markAsUnread':{'type':Sequelize[_0x291a('0x2')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x291a('0x1')],'allowNull':![],'defaultValue':_0x291a('0x3')},'fontSize':{'type':Sequelize['INTEGER'](0x2)[_0x291a('0x4')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}<br/>Subject\x20:\x20{{message.subject}}';}},'notificationSound':{'type':Sequelize[_0x291a('0x2')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x291a('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x291a('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x291a('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x291a('0x2')],'defaultValue':![],'comment':_0x291a('0x6'),'set':function(_0x74b458){if(!_0x74b458)this[_0x291a('0x7')]('mandatoryDispositionPauseId',null);this[_0x291a('0x7')]('mandatoryDisposition',_0x74b458);}},'provider':{'type':Sequelize[_0x291a('0x8')](_0x291a('0x9'),_0x291a('0xa'),_0x291a('0xb'),'outlook365'),'defaultValue':null,'get':function(){if(!this[_0x291a('0xc')](_0x291a('0xd')))return'custom';return this[_0x291a('0xc')]('provider');},'set':function(_0x480cc9){if(_0x480cc9===_0x291a('0xe'))_0x480cc9=null;return this[_0x291a('0x7')](_0x291a('0xd'),_0x480cc9);}}};
\ No newline at end of file
+var _0x2bc3=['BOOLEAN','Arial,Helvetica,sans-serif','UNSIGNED','TEXT','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','ENUM','gmail','hotmail','outlook365','getDataValue','provider','custom','sequelize','STRING'];(function(_0x4a753f,_0x33f3e9){var _0x117385=function(_0x76c316){while(--_0x76c316){_0x4a753f['push'](_0x4a753f['shift']());}};_0x117385(++_0x33f3e9);}(_0x2bc3,0x1d2));var _0x32bc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2bc3[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x32bc('0x0'));module['exports']={'description':{'type':Sequelize[_0x32bc('0x1')]},'name':{'type':Sequelize[_0x32bc('0x1')],'allowNull':![]},'service':{'type':Sequelize[_0x32bc('0x2')],'defaultValue':![]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'key':{'type':Sequelize[_0x32bc('0x1')],'allowNull':![]},'template':{'type':Sequelize['TEXT']},'markAsUnread':{'type':Sequelize[_0x32bc('0x2')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x32bc('0x1')],'allowNull':![],'defaultValue':_0x32bc('0x3')},'fontSize':{'type':Sequelize['INTEGER'](0x2)[_0x32bc('0x4')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x32bc('0x5')],'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[_0x32bc('0x2')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x32bc('0x2')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x32bc('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x32bc('0x2')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x32bc('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x32bc('0x6')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x32bc('0x2')],'defaultValue':![],'comment':_0x32bc('0x7'),'set':function(_0x35fc43){if(!_0x35fc43)this[_0x32bc('0x8')](_0x32bc('0x9'),null);this[_0x32bc('0x8')](_0x32bc('0xa'),_0x35fc43);}},'provider':{'type':Sequelize[_0x32bc('0xb')](_0x32bc('0xc'),_0x32bc('0xd'),'yahoo',_0x32bc('0xe')),'defaultValue':null,'get':function(){if(!this[_0x32bc('0xf')](_0x32bc('0x10')))return'custom';return this[_0x32bc('0xf')](_0x32bc('0x10'));},'set':function(_0x18f15a){if(_0x18f15a===_0x32bc('0x11'))_0x18f15a=null;return this[_0x32bc('0x8')]('provider',_0x18f15a);}}};
\ No newline at end of file
index 5abe6f4..d91900a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2f90=['sendStatus','status','end','offset','undefined','limit','count','destroy','get','UserProfileResource','stack','name','send','gmail','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook.office365.com','Unknown\x20email\x20service\x20provider','smtp.mail.yahoo.com','smtp-mail.outlook.com','outlook365','user','username','password','modernAuthentication','CloudProviderId','pass','host','port','secure','service','authentication','Imap','Smtp','index','MailServerIn','MailServerOut','mandatoryDispositionPause','map','rawAttributes','type','key','model','keys','filters','intersection','query','attributes','hasOwnProperty','order','sort','pick','where','merge','VIRTUAL','filter','options','MailAccount','includeAll','include','findAll','rows','show','params','fields','length','find','update','body','Pause','Mail\x20Account\x20not\x20found','describe','create','findOne','MailAccountId','Disposition','removeDispositions','addAnswer','CannedAnswer','getAnswers','removeAnswers','ids','provider','ListId','isNil','active','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','MailAccounts','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','getSmtp','addSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction','omit','getInteractions','nolimit','CmContact','User','Owner','internal','Tag','Tags','tag','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','bulkCreate','findAndCountAll','getApplications','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','true','List','Contacts','updatedAt','DESC','CloudProvider','Smtp\x20configuration\x20not\x20found','from','email','attachments','join','root','server/files/attachments','basename','getSmtpOptions','sendMail','List\x20not\x20found','defaults','messageId','subject','attach','out','Interaction','MailMessage','Messages','VerifySmtp','verifySmtp','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','emit','userMailAccount:save','removeAgents','userMailAccount:remove','getAgents','moment','util','path','lodash','juice','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','jayson/promise','http','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','MailAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch'];(function(_0x4eedb3,_0x1f9a5d){var _0x487b81=function(_0x2fd8e1){while(--_0x2fd8e1){_0x4eedb3['push'](_0x4eedb3['shift']());}};_0x487b81(++_0x1f9a5d);}(_0x2f90,0x160));var _0x02f9=function(_0x1252e7,_0x44159d){_0x1252e7=_0x1252e7-0x0;var _0x31c4bc=_0x2f90[_0x1252e7];return _0x31c4bc;};'use strict';var moment=require(_0x02f9('0x0'));var BPromise=require('bluebird');var util=require(_0x02f9('0x1'));var path=require(_0x02f9('0x2'));var _=require(_0x02f9('0x3'));var juice=require(_0x02f9('0x4'));var Redis=require(_0x02f9('0x5'));var qs=require('../../components/parsers/qs');var logger=require(_0x02f9('0x6'))(_0x02f9('0x7'));var config=require(_0x02f9('0x8'));var db=require(_0x02f9('0x9'))['db'];config[_0x02f9('0xa')]=_['defaults'](config[_0x02f9('0xa')],{'host':_0x02f9('0xb'),'port':0x18eb});var socket=require(_0x02f9('0xc'))(new Redis(config[_0x02f9('0xa')]));require('./mailAccount.socket')['register'](socket);var jayson=require(_0x02f9('0xd'));var client=jayson['client'][_0x02f9('0xe')]({'port':0x232b});function respondWithRpcPromise(_0x4718cd,_0x3736a9,_0x528c4f,_0x44cad3){return new BPromise(function(_0x30257f,_0x4b7625){var _0x14b03=_0x44cad3||client;return _0x14b03[_0x02f9('0xf')](_0x4718cd,_0x528c4f)[_0x02f9('0x10')](function(_0x22148e){logger[_0x02f9('0x11')](_0x02f9('0x12'),_0x3736a9,_0x02f9('0x13'));logger['debug'](_0x02f9('0x14'),_0x3736a9,_0x02f9('0x13'),JSON['stringify'](_0x22148e));if(_0x22148e[_0x02f9('0x15')]){if(_0x22148e[_0x02f9('0x15')][_0x02f9('0x16')]===0x1f4){logger[_0x02f9('0x15')](_0x02f9('0x12'),_0x3736a9,_0x22148e[_0x02f9('0x15')][_0x02f9('0x17')]);return _0x4b7625(_0x22148e['error']['message']);}logger['error'](_0x02f9('0x12'),_0x3736a9,_0x22148e[_0x02f9('0x15')]['message']);return _0x30257f(_0x22148e['error'][_0x02f9('0x17')]);}else{logger['info']('MailAccount,\x20%s,\x20%s',_0x3736a9,_0x02f9('0x13'));_0x30257f(_0x22148e[_0x02f9('0x18')][_0x02f9('0x17')]);}})[_0x02f9('0x19')](function(_0x344f09){logger[_0x02f9('0x15')]('MailAccount,\x20%s,\x20%s',_0x3736a9,_0x344f09);_0x4b7625(_0x344f09);});});}function respondWithStatusCode(_0x555196,_0x5708f4){_0x5708f4=_0x5708f4||0xcc;return function(_0x32a334){if(_0x32a334){return _0x555196[_0x02f9('0x1a')](_0x5708f4);}return _0x555196[_0x02f9('0x1b')](_0x5708f4)[_0x02f9('0x1c')]();};}function respondWithResult(_0x449823,_0x50b595){_0x50b595=_0x50b595||0xc8;return function(_0x3be74a){if(_0x3be74a){return _0x449823[_0x02f9('0x1b')](_0x50b595)['json'](_0x3be74a);}};}function respondWithFilteredResult(_0x37e0c5,_0x522093){return function(_0x1dc091){if(_0x1dc091){var _0x27cd7c=typeof _0x522093[_0x02f9('0x1d')]===_0x02f9('0x1e')&&typeof _0x522093[_0x02f9('0x1f')]===_0x02f9('0x1e');var _0x462ef8=_0x1dc091[_0x02f9('0x20')];var _0x1f0df0=_0x27cd7c?0x0:_0x522093[_0x02f9('0x1d')];var _0x55c66a=_0x27cd7c?_0x1dc091['count']:_0x522093[_0x02f9('0x1d')]+_0x522093['limit'];var _0x41c82d;if(_0x55c66a>=_0x462ef8){_0x55c66a=_0x462ef8;_0x41c82d=0xc8;}else{_0x41c82d=0xce;}_0x37e0c5[_0x02f9('0x1b')](_0x41c82d);return _0x37e0c5['set']('Content-Range',_0x1f0df0+'-'+_0x55c66a+'/'+_0x462ef8)['json'](_0x1dc091);}return null;};}function saveUpdates(_0x383900){return function(_0x482929){if(_0x482929){return _0x482929['update'](_0x383900)[_0x02f9('0x10')](function(_0x428dfd){return _0x428dfd;});}return null;};}function removeEntity(_0x55244f){return function(_0x3f73ab){if(_0x3f73ab){return _0x3f73ab[_0x02f9('0x21')]()['then'](function(){var _0x5b1296=_0x3f73ab[_0x02f9('0x22')]({'plain':!![]});var _0x15f49e='MailAccounts';return db[_0x02f9('0x23')][_0x02f9('0x21')]({'where':{'type':_0x15f49e,'resourceId':_0x5b1296['id']}})['then'](function(){return _0x3f73ab;});})[_0x02f9('0x10')](function(){_0x55244f[_0x02f9('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x19580c){return function(_0x200d03){if(!_0x200d03){_0x19580c[_0x02f9('0x1a')](0x194);}return _0x200d03;};}function handleError(_0x3bdd38,_0x25ae32){_0x25ae32=_0x25ae32||0x1f4;return function(_0x21d8b4){logger[_0x02f9('0x15')](_0x21d8b4[_0x02f9('0x24')]);if(_0x21d8b4[_0x02f9('0x25')]){delete _0x21d8b4[_0x02f9('0x25')];}_0x3bdd38[_0x02f9('0x1b')](_0x25ae32)[_0x02f9('0x26')](_0x21d8b4);};}function getImapHost(_0x28f2ab){switch(_0x28f2ab){case _0x02f9('0x27'):return _0x02f9('0x28');case _0x02f9('0x29'):return _0x02f9('0x2a');case _0x02f9('0x2b'):return _0x02f9('0x2c');case'outlook365':return _0x02f9('0x2d');}throw new Error(_0x02f9('0x2e'),_0x28f2ab);}function getSmtpHost(_0x4e8969){switch(_0x4e8969){case _0x02f9('0x27'):return'smtp.gmail.com';case _0x02f9('0x29'):return _0x02f9('0x2f');case'hotmail':return _0x02f9('0x30');case _0x02f9('0x31'):return'smtp.office365.com';}throw new Error(_0x02f9('0x2e'),_0x4e8969);}function getAuthenticationOptions(_0x301ce9,_0x2293a0){var _0x5bf7fe={};var _0x509668={};if(_0x301ce9){_0x5bf7fe[_0x02f9('0x32')]=_0x509668[_0x02f9('0x32')]=_0x2293a0[_0x02f9('0x33')];_0x5bf7fe[_0x02f9('0x34')]=_0x509668['pass']=_0x2293a0['password'];if(_0x2293a0[_0x02f9('0x35')]){_0x5bf7fe['modernAuthentication']=_0x509668[_0x02f9('0x35')]=!![];_0x5bf7fe['CloudProviderId']=_0x509668[_0x02f9('0x36')]=_0x2293a0[_0x02f9('0x36')];_0x5bf7fe[_0x02f9('0x34')]=_0x509668[_0x02f9('0x37')]=null;}else{_0x5bf7fe[_0x02f9('0x36')]=_0x509668['CloudProviderId']=null;}_0x5bf7fe[_0x02f9('0x38')]=getImapHost(_0x301ce9);_0x5bf7fe[_0x02f9('0x39')]=0x3e1;_0x509668[_0x02f9('0x38')]=getSmtpHost(_0x301ce9);_0x509668['port']=0x24b;_0x509668[_0x02f9('0x3a')]=![];_0x5bf7fe[_0x02f9('0x3b')]=_0x509668[_0x02f9('0x3b')]=null;}else{if(_0x2293a0['authentication']){_0x5bf7fe[_0x02f9('0x32')]=_0x509668[_0x02f9('0x32')]=_0x2293a0[_0x02f9('0x33')];_0x5bf7fe['password']=_0x509668[_0x02f9('0x37')]=_0x2293a0[_0x02f9('0x34')];}else{_0x5bf7fe[_0x02f9('0x3c')]=_0x509668[_0x02f9('0x3c')]=![];_0x5bf7fe[_0x02f9('0x32')]=_0x509668['user']=null;_0x5bf7fe[_0x02f9('0x34')]=_0x509668[_0x02f9('0x37')]=null;}_0x5bf7fe[_0x02f9('0x38')]=_0x2293a0[_0x02f9('0x3d')][_0x02f9('0x38')];_0x5bf7fe['port']=_0x2293a0[_0x02f9('0x3d')][_0x02f9('0x39')];_0x509668[_0x02f9('0x38')]=_0x2293a0['Smtp']['host'];_0x509668[_0x02f9('0x39')]=_0x2293a0[_0x02f9('0x3e')][_0x02f9('0x39')];}return{'Imap':_0x5bf7fe,'Smtp':_0x509668};}exports[_0x02f9('0x3f')]=function(_0x8122cd,_0x14d568){var _0x575806={'include':[{'model':db[_0x02f9('0x40')],'as':_0x02f9('0x3d')},{'model':db[_0x02f9('0x41')],'as':_0x02f9('0x3e')},{'model':db['Pause'],'as':_0x02f9('0x42')}]},_0x271b08={},_0x35c91d={'count':0x0,'rows':[]};var _0x422803=_[_0x02f9('0x43')](db['MailAccount'][_0x02f9('0x44')],function(_0x428af9){return{'name':_0x428af9['fieldName'],'type':_0x428af9[_0x02f9('0x45')][_0x02f9('0x46')]};});_0x271b08[_0x02f9('0x47')]=_[_0x02f9('0x43')](_0x422803,_0x02f9('0x25'));_0x271b08['query']=_[_0x02f9('0x48')](_0x8122cd['query']);_0x271b08[_0x02f9('0x49')]=_[_0x02f9('0x4a')](_0x271b08['model'],_0x271b08[_0x02f9('0x4b')]);_0x575806['attributes']=_[_0x02f9('0x4a')](_0x271b08[_0x02f9('0x47')],qs['fields'](_0x8122cd['query']['fields']));_0x575806[_0x02f9('0x4c')]=_0x575806['attributes']['length']?_0x575806[_0x02f9('0x4c')]:_0x271b08[_0x02f9('0x47')];if(!_0x8122cd['query'][_0x02f9('0x4d')]('nolimit')){_0x575806[_0x02f9('0x1f')]=qs[_0x02f9('0x1f')](_0x8122cd[_0x02f9('0x4b')]['limit']);_0x575806[_0x02f9('0x1d')]=qs[_0x02f9('0x1d')](_0x8122cd['query']['offset']);}_0x575806[_0x02f9('0x4e')]=qs[_0x02f9('0x4f')](_0x8122cd[_0x02f9('0x4b')][_0x02f9('0x4f')]);_0x575806['where']=qs[_0x02f9('0x49')](_[_0x02f9('0x50')](_0x8122cd[_0x02f9('0x4b')],_0x271b08[_0x02f9('0x49')]),_0x422803);if(_0x8122cd[_0x02f9('0x4b')]['filter']){_0x575806[_0x02f9('0x51')]=_[_0x02f9('0x52')](_0x575806[_0x02f9('0x51')],{'$or':_['map'](_0x422803,function(_0x1dc669){if(_0x1dc669['type']!==_0x02f9('0x53')){var _0x35c39e={};_0x35c39e[_0x1dc669[_0x02f9('0x25')]]={'$like':'%'+_0x8122cd[_0x02f9('0x4b')][_0x02f9('0x54')]+'%'};return _0x35c39e;}})});}_0x575806=_['merge']({},_0x575806,_0x8122cd[_0x02f9('0x55')]);var _0x2ee20c={'where':_0x575806[_0x02f9('0x51')]};return db[_0x02f9('0x56')][_0x02f9('0x20')](_0x2ee20c)[_0x02f9('0x10')](function(_0x1944ee){_0x35c91d['count']=_0x1944ee;if(_0x8122cd[_0x02f9('0x4b')][_0x02f9('0x57')]){_0x575806[_0x02f9('0x58')]=[{'all':!![]}];}return db[_0x02f9('0x56')][_0x02f9('0x59')](_0x575806);})[_0x02f9('0x10')](function(_0x54bdbb){_0x35c91d[_0x02f9('0x5a')]=_0x54bdbb;return _0x35c91d;})[_0x02f9('0x10')](respondWithFilteredResult(_0x14d568,_0x575806))[_0x02f9('0x19')](handleError(_0x14d568,null));};exports[_0x02f9('0x5b')]=function(_0x417d06,_0x351d56){var _0x3cfb1e={'raw':![],'where':{'id':_0x417d06[_0x02f9('0x5c')]['id']},'include':[{'model':db[_0x02f9('0x40')],'as':_0x02f9('0x3d')},{'model':db[_0x02f9('0x41')],'as':_0x02f9('0x3e')},{'model':db['Pause'],'as':_0x02f9('0x42')}]},_0x3c342e={};_0x3c342e['model']=_[_0x02f9('0x48')](db['MailAccount']['rawAttributes']);_0x3c342e['query']=_[_0x02f9('0x48')](_0x417d06[_0x02f9('0x4b')]);_0x3c342e[_0x02f9('0x49')]=_[_0x02f9('0x4a')](_0x3c342e[_0x02f9('0x47')],_0x3c342e[_0x02f9('0x4b')]);_0x3cfb1e[_0x02f9('0x4c')]=_[_0x02f9('0x4a')](_0x3c342e[_0x02f9('0x47')],qs[_0x02f9('0x5d')](_0x417d06[_0x02f9('0x4b')]['fields']));_0x3cfb1e['attributes']=_0x3cfb1e[_0x02f9('0x4c')][_0x02f9('0x5e')]?_0x3cfb1e[_0x02f9('0x4c')]:_0x3c342e['model'];if(_0x417d06[_0x02f9('0x4b')]['includeAll']){_0x3cfb1e[_0x02f9('0x58')]=[{'all':!![]}];}_0x3cfb1e=_['merge']({},_0x3cfb1e,_0x417d06[_0x02f9('0x55')]);return db['MailAccount'][_0x02f9('0x5f')](_0x3cfb1e)[_0x02f9('0x10')](handleEntityNotFound(_0x351d56,null))['then'](respondWithResult(_0x351d56,null))[_0x02f9('0x19')](handleError(_0x351d56,null));};exports[_0x02f9('0x60')]=function(_0xabc0ac,_0x156a47){if(_0xabc0ac['body']['id']){delete _0xabc0ac[_0x02f9('0x61')]['id'];}var _0x4b31c7=_0xabc0ac[_0x02f9('0x61')]['provider']==='custom'?null:_0xabc0ac[_0x02f9('0x61')]['provider'];var _0x52b0ed=_0xabc0ac[_0x02f9('0x61')][_0x02f9('0x3d')]||{};var _0x1e1335=_0xabc0ac[_0x02f9('0x61')][_0x02f9('0x3e')]||{};if(_0x4b31c7){_0x52b0ed[_0x02f9('0x38')]=getImapHost(_0x4b31c7);_0x52b0ed[_0x02f9('0x39')]=0x3e1;_0x1e1335['host']=getSmtpHost(_0x4b31c7);_0x1e1335[_0x02f9('0x39')]=0x24b;_0x1e1335['secure']=![];}if(_0x1e1335[_0x02f9('0x35')]){_0x1e1335[_0x02f9('0x3a')]=![];}else{_0x1e1335['CloudProviderId']=null;}if(!_0x52b0ed[_0x02f9('0x35')])_0x52b0ed[_0x02f9('0x36')]=null;_0xabc0ac['body'][_0x02f9('0x3d')]=_0x52b0ed;_0xabc0ac[_0x02f9('0x61')]['Smtp']=_0x1e1335;return db[_0x02f9('0x56')][_0x02f9('0x5f')]({'where':{'id':_0xabc0ac[_0x02f9('0x5c')]['id']},'include':[{'model':db['MailServerIn'],'as':_0x02f9('0x3d')},{'model':db[_0x02f9('0x41')],'as':_0x02f9('0x3e')},{'model':db[_0x02f9('0x62')],'as':_0x02f9('0x42')}]})[_0x02f9('0x10')](handleEntityNotFound(_0x156a47,null))[_0x02f9('0x10')](function(_0xe8c866){if(!_0xe8c866)throw new Error(_0x02f9('0x63'));if(_0xe8c866['service'])delete _0xabc0ac[_0x02f9('0x61')][_0x02f9('0x3d')];return _0xe8c866;})['then'](saveUpdates(_0xabc0ac[_0x02f9('0x61')],null))[_0x02f9('0x10')](function(_0x221bab){if(!_0xabc0ac[_0x02f9('0x61')][_0x02f9('0x3d')])return _0x221bab;return db['MailServerIn']['update'](_0xabc0ac[_0x02f9('0x61')][_0x02f9('0x3d')],{'where':{'MailAccountId':_0x221bab['id']}})['then'](function(){return _0x221bab;});})[_0x02f9('0x10')](function(_0x4e2362){if(!_0xabc0ac[_0x02f9('0x61')][_0x02f9('0x3e')])return _0x4e2362;return db['MailServerOut'][_0x02f9('0x60')](_0xabc0ac[_0x02f9('0x61')]['Smtp'],{'where':{'MailAccountId':_0x4e2362['id']}})[_0x02f9('0x10')](function(){return _0x4e2362;});})[_0x02f9('0x10')](respondWithResult(_0x156a47,null))[_0x02f9('0x19')](handleError(_0x156a47,null));};exports[_0x02f9('0x64')]=function(_0x419252,_0x5d3476){return db['MailAccount'][_0x02f9('0x64')]()[_0x02f9('0x10')](respondWithResult(_0x5d3476,null))[_0x02f9('0x19')](handleError(_0x5d3476,null));};exports['addDisposition']=function(_0x48bc3b,_0x93a64c){if(_0x48bc3b[_0x02f9('0x61')]['id']){delete _0x48bc3b['body']['id'];}return db['MailAccount']['find']({'where':{'id':_0x48bc3b[_0x02f9('0x5c')]['id']}})[_0x02f9('0x10')](handleEntityNotFound(_0x93a64c,null))[_0x02f9('0x10')](function(_0xc725f1){if(_0xc725f1){_0x48bc3b[_0x02f9('0x61')]['MailAccountId']=_0xc725f1['id'];return db['Disposition'][_0x02f9('0x65')](_0x48bc3b['body']);}})['then'](respondWithResult(_0x93a64c,null))[_0x02f9('0x19')](handleError(_0x93a64c,null));};exports['getDispositions']=function(_0x590996,_0x12da5b){var _0x382ae8={'raw':![],'where':{}};var _0x23a4af={};var _0x1dc3f9={'count':0x0,'rows':[]};return db[_0x02f9('0x56')][_0x02f9('0x66')]({'where':{'id':_0x590996[_0x02f9('0x5c')]['id']}})[_0x02f9('0x10')](handleEntityNotFound(_0x12da5b,null))[_0x02f9('0x10')](function(_0x26181b){if(_0x26181b){_0x23a4af['model']=_[_0x02f9('0x48')](db['Disposition'][_0x02f9('0x44')]);_0x23a4af[_0x02f9('0x4b')]=_[_0x02f9('0x48')](_0x590996[_0x02f9('0x4b')]);_0x23a4af[_0x02f9('0x49')]=_['intersection'](_0x23a4af[_0x02f9('0x47')],_0x23a4af[_0x02f9('0x4b')]);_0x382ae8[_0x02f9('0x4c')]=_[_0x02f9('0x4a')](_0x23a4af[_0x02f9('0x47')],qs[_0x02f9('0x5d')](_0x590996['query'][_0x02f9('0x5d')]));_0x382ae8[_0x02f9('0x4c')]=_0x382ae8[_0x02f9('0x4c')][_0x02f9('0x5e')]?_0x382ae8[_0x02f9('0x4c')]:_0x23a4af[_0x02f9('0x47')];if(!_0x590996[_0x02f9('0x4b')]['hasOwnProperty']('nolimit')){_0x382ae8[_0x02f9('0x1f')]=qs[_0x02f9('0x1f')](_0x590996[_0x02f9('0x4b')][_0x02f9('0x1f')]);_0x382ae8[_0x02f9('0x1d')]=qs[_0x02f9('0x1d')](_0x590996[_0x02f9('0x4b')]['offset']);}_0x382ae8['order']=qs[_0x02f9('0x4f')](_0x590996[_0x02f9('0x4b')][_0x02f9('0x4f')]);_0x382ae8[_0x02f9('0x51')]=qs['filters'](_[_0x02f9('0x50')](_0x590996[_0x02f9('0x4b')],_0x23a4af[_0x02f9('0x49')]));_0x382ae8[_0x02f9('0x51')][_0x02f9('0x67')]=_0x26181b['id'];if(_0x590996[_0x02f9('0x4b')][_0x02f9('0x54')]){_0x382ae8['where']=_[_0x02f9('0x52')](_0x382ae8[_0x02f9('0x51')],{'$or':_[_0x02f9('0x43')](_0x382ae8[_0x02f9('0x4c')],function(_0x5e37ec){var _0x25eaea={};_0x25eaea[_0x5e37ec]={'$like':'%'+_0x590996[_0x02f9('0x4b')][_0x02f9('0x54')]+'%'};return _0x25eaea;})});}_0x382ae8=_[_0x02f9('0x52')]({},_0x382ae8,_0x590996['options']);return db[_0x02f9('0x68')][_0x02f9('0x20')]({'where':_0x382ae8[_0x02f9('0x51')]})[_0x02f9('0x10')](function(_0x41211c){_0x1dc3f9[_0x02f9('0x20')]=_0x41211c;if(_0x590996[_0x02f9('0x4b')][_0x02f9('0x57')]){_0x382ae8[_0x02f9('0x58')]=[{'all':!![]}];}return db[_0x02f9('0x68')][_0x02f9('0x59')](_0x382ae8);})[_0x02f9('0x10')](function(_0x28f877){_0x1dc3f9[_0x02f9('0x5a')]=_0x28f877;return _0x1dc3f9;});}})[_0x02f9('0x10')](respondWithFilteredResult(_0x12da5b,_0x382ae8))['catch'](handleError(_0x12da5b,null));};exports['removeDispositions']=function(_0x5b150f,_0x57849a){return db[_0x02f9('0x56')][_0x02f9('0x5f')]({'where':{'id':_0x5b150f[_0x02f9('0x5c')]['id']}})['then'](handleEntityNotFound(_0x57849a,null))['then'](function(_0x5f4ad9){if(_0x5f4ad9){return _0x5f4ad9[_0x02f9('0x69')](_0x5b150f[_0x02f9('0x4b')]['ids']);}})[_0x02f9('0x10')](respondWithStatusCode(_0x57849a,null))[_0x02f9('0x19')](handleError(_0x57849a,null));};exports[_0x02f9('0x6a')]=function(_0x24ead8,_0x363eb4){if(_0x24ead8[_0x02f9('0x61')]['id']){delete _0x24ead8[_0x02f9('0x61')]['id'];}return db[_0x02f9('0x56')][_0x02f9('0x5f')]({'where':{'id':_0x24ead8[_0x02f9('0x5c')]['id']}})[_0x02f9('0x10')](handleEntityNotFound(_0x363eb4,null))['then'](function(_0x1ba1d7){if(_0x1ba1d7){_0x24ead8[_0x02f9('0x61')][_0x02f9('0x67')]=_0x1ba1d7['id'];return db[_0x02f9('0x6b')][_0x02f9('0x65')](_0x24ead8[_0x02f9('0x61')]);}})[_0x02f9('0x10')](respondWithResult(_0x363eb4,null))[_0x02f9('0x19')](handleError(_0x363eb4,null));};exports[_0x02f9('0x6c')]=function(_0x53ff6b,_0x472dc7){var _0x57c8d2={'raw':![],'where':{}};var _0x1592f6={};var _0x576939={'count':0x0,'rows':[]};return db[_0x02f9('0x56')]['findOne']({'where':{'id':_0x53ff6b[_0x02f9('0x5c')]['id']}})[_0x02f9('0x10')](handleEntityNotFound(_0x472dc7,null))[_0x02f9('0x10')](function(_0x17afd5){if(_0x17afd5){_0x1592f6[_0x02f9('0x47')]=_['keys'](db['CannedAnswer']['rawAttributes']);_0x1592f6[_0x02f9('0x4b')]=_['keys'](_0x53ff6b[_0x02f9('0x4b')]);_0x1592f6[_0x02f9('0x49')]=_[_0x02f9('0x4a')](_0x1592f6[_0x02f9('0x47')],_0x1592f6[_0x02f9('0x4b')]);_0x57c8d2[_0x02f9('0x4c')]=_['intersection'](_0x1592f6[_0x02f9('0x47')],qs[_0x02f9('0x5d')](_0x53ff6b[_0x02f9('0x4b')][_0x02f9('0x5d')]));_0x57c8d2[_0x02f9('0x4c')]=_0x57c8d2[_0x02f9('0x4c')][_0x02f9('0x5e')]?_0x57c8d2['attributes']:_0x1592f6[_0x02f9('0x47')];if(!_0x53ff6b[_0x02f9('0x4b')][_0x02f9('0x4d')]('nolimit')){_0x57c8d2[_0x02f9('0x1f')]=qs[_0x02f9('0x1f')](_0x53ff6b[_0x02f9('0x4b')][_0x02f9('0x1f')]);_0x57c8d2['offset']=qs[_0x02f9('0x1d')](_0x53ff6b[_0x02f9('0x4b')]['offset']);}_0x57c8d2['order']=qs[_0x02f9('0x4f')](_0x53ff6b[_0x02f9('0x4b')]['sort']);_0x57c8d2[_0x02f9('0x51')]=qs['filters'](_[_0x02f9('0x50')](_0x53ff6b['query'],_0x1592f6[_0x02f9('0x49')]));_0x57c8d2['where'][_0x02f9('0x67')]=_0x17afd5['id'];if(_0x53ff6b['query'][_0x02f9('0x54')]){_0x57c8d2[_0x02f9('0x51')]=_[_0x02f9('0x52')](_0x57c8d2[_0x02f9('0x51')],{'$or':_[_0x02f9('0x43')](_0x57c8d2[_0x02f9('0x4c')],function(_0xdac600){var _0x2dec7f={};_0x2dec7f[_0xdac600]={'$like':'%'+_0x53ff6b['query'][_0x02f9('0x54')]+'%'};return _0x2dec7f;})});}_0x57c8d2=_['merge']({},_0x57c8d2,_0x53ff6b['options']);return db[_0x02f9('0x6b')][_0x02f9('0x20')]({'where':_0x57c8d2[_0x02f9('0x51')]})[_0x02f9('0x10')](function(_0x35309e){_0x576939[_0x02f9('0x20')]=_0x35309e;if(_0x53ff6b[_0x02f9('0x4b')]['includeAll']){_0x57c8d2[_0x02f9('0x58')]=[{'all':!![]}];}return db[_0x02f9('0x6b')][_0x02f9('0x59')](_0x57c8d2);})['then'](function(_0x153443){_0x576939[_0x02f9('0x5a')]=_0x153443;return _0x576939;});}})[_0x02f9('0x10')](respondWithFilteredResult(_0x472dc7,_0x57c8d2))[_0x02f9('0x19')](handleError(_0x472dc7,null));};exports[_0x02f9('0x6d')]=function(_0x890f3c,_0x2e0c2c){return db[_0x02f9('0x56')]['find']({'where':{'id':_0x890f3c[_0x02f9('0x5c')]['id']}})['then'](handleEntityNotFound(_0x2e0c2c,null))[_0x02f9('0x10')](function(_0x1915a1){if(_0x1915a1){return _0x1915a1[_0x02f9('0x6d')](_0x890f3c[_0x02f9('0x4b')][_0x02f9('0x6e')]);}})[_0x02f9('0x10')](respondWithStatusCode(_0x2e0c2c,null))[_0x02f9('0x19')](handleError(_0x2e0c2c,null));};exports[_0x02f9('0x65')]=function(_0x7e005c,_0x1b280d){var _0x7969b2={'name':_0x7e005c[_0x02f9('0x61')]['name'],'key':_0x7e005c[_0x02f9('0x61')][_0x02f9('0x46')],'provider':_0x7e005c['body'][_0x02f9('0x6f')]==='custom'?null:_0x7e005c[_0x02f9('0x61')][_0x02f9('0x6f')],'email':_0x7e005c[_0x02f9('0x61')]['email'],'ListId':_0x7e005c[_0x02f9('0x61')][_0x02f9('0x70')],'active':!_[_0x02f9('0x71')](_0x7e005c[_0x02f9('0x61')][_0x02f9('0x72')])?_0x7e005c[_0x02f9('0x61')]['active']:!![],'description':_0x7e005c['body']['description']||null};var _0x1e366c=getAuthenticationOptions(_0x7969b2[_0x02f9('0x6f')],_0x7e005c[_0x02f9('0x61')]);_0x7969b2[_0x02f9('0x3d')]=_0x1e366c[_0x02f9('0x3d')];_0x7969b2['Smtp']=_0x1e366c['Smtp'];return db[_0x02f9('0x56')][_0x02f9('0x65')](_0x7969b2,{'include':[{'model':db[_0x02f9('0x41')],'as':_0x02f9('0x3e')},{'model':db['MailServerIn'],'as':_0x02f9('0x3d')}]})[_0x02f9('0x10')](function(_0x396c7f){var _0x58dee7=_0x7e005c[_0x02f9('0x32')]['get']({'plain':!![]});if(!_0x58dee7)throw new Error(_0x02f9('0x73'));if(_0x58dee7[_0x02f9('0x74')]===_0x02f9('0x32')){var _0x929c80=_0x396c7f[_0x02f9('0x22')]({'plain':!![]});return db[_0x02f9('0x75')][_0x02f9('0x5f')]({'where':{'name':_0x02f9('0x76'),'userProfileId':_0x58dee7['userProfileId']},'raw':!![]})['then'](function(_0x3f51f2){if(_0x3f51f2&&_0x3f51f2['autoAssociation']===0x0){return db[_0x02f9('0x23')]['create']({'name':_0x929c80[_0x02f9('0x25')],'resourceId':_0x929c80['id'],'type':_0x3f51f2['name'],'sectionId':_0x3f51f2['id']},{})[_0x02f9('0x10')](function(){return _0x396c7f;});}else{return _0x396c7f;}})['catch'](function(_0xe4c427){logger[_0x02f9('0x15')](_0x02f9('0x77'),_0xe4c427);throw _0xe4c427;});}return _0x396c7f;})[_0x02f9('0x10')](respondWithResult(_0x1b280d,0xc9))[_0x02f9('0x19')](handleError(_0x1b280d,null));};exports[_0x02f9('0x78')]=function(_0x15423f,_0x67eb19){return db[_0x02f9('0x56')][_0x02f9('0x66')]({'where':{'id':_0x15423f[_0x02f9('0x5c')]['id']}})[_0x02f9('0x10')](handleEntityNotFound(_0x67eb19,null))[_0x02f9('0x10')](function(_0x3acd98){if(_0x3acd98){return _0x3acd98['getImap']();}return null;})[_0x02f9('0x10')](respondWithResult(_0x67eb19,null))[_0x02f9('0x19')](handleError(_0x67eb19,null));};exports[_0x02f9('0x79')]=function(_0xa8b3b8,_0x2690ff){if(_0xa8b3b8['body']['id']){delete _0xa8b3b8[_0x02f9('0x61')]['id'];}return db[_0x02f9('0x56')][_0x02f9('0x5f')]({'where':{'id':_0xa8b3b8[_0x02f9('0x5c')]['id']}})[_0x02f9('0x10')](handleEntityNotFound(_0x2690ff,null))[_0x02f9('0x10')](function(_0x3b98a6){if(_0x3b98a6){_0xa8b3b8[_0x02f9('0x61')]['MailAccountId']=_0x3b98a6['id'];return db[_0x02f9('0x40')][_0x02f9('0x65')](_0xa8b3b8['body']);}})[_0x02f9('0x10')](respondWithResult(_0x2690ff,null))[_0x02f9('0x19')](handleError(_0x2690ff,null));};exports[_0x02f9('0x7a')]=function(_0x569547,_0x276b00){return db['MailAccount']['findOne']({'where':{'id':_0x569547[_0x02f9('0x5c')]['id']}})['then'](handleEntityNotFound(_0x276b00,null))[_0x02f9('0x10')](function(_0x47480a){if(_0x47480a){return _0x47480a['setImap'](null);}return null;})[_0x02f9('0x10')](respondWithStatusCode(_0x276b00,null))[_0x02f9('0x19')](handleError(_0x276b00,null));};exports[_0x02f9('0x7b')]=function(_0x32c109,_0x65cdad){return db[_0x02f9('0x56')]['findOne']({'where':{'id':_0x32c109[_0x02f9('0x5c')]['id']}})[_0x02f9('0x10')](handleEntityNotFound(_0x65cdad,null))[_0x02f9('0x10')](function(_0x4f582b){if(_0x4f582b){return _0x4f582b[_0x02f9('0x7b')]();}return null;})[_0x02f9('0x10')](respondWithResult(_0x65cdad,null))[_0x02f9('0x19')](handleError(_0x65cdad,null));};exports[_0x02f9('0x7c')]=function(_0x263e47,_0x409711){if(_0x263e47[_0x02f9('0x61')]['id']){delete _0x263e47[_0x02f9('0x61')]['id'];}return db['MailAccount'][_0x02f9('0x5f')]({'where':{'id':_0x263e47[_0x02f9('0x5c')]['id']}})[_0x02f9('0x10')](handleEntityNotFound(_0x409711,null))[_0x02f9('0x10')](function(_0x20add5){if(_0x20add5){_0x263e47[_0x02f9('0x61')]['MailAccountId']=_0x20add5['id'];return db['MailServerOut']['create'](_0x263e47['body']);}})['then'](respondWithResult(_0x409711,null))[_0x02f9('0x19')](handleError(_0x409711,null));};exports[_0x02f9('0x7d')]=function(_0xeb82c8,_0x1e692f){return db['MailAccount']['findOne']({'where':{'id':_0xeb82c8[_0x02f9('0x5c')]['id']}})['then'](handleEntityNotFound(_0x1e692f,null))[_0x02f9('0x10')](function(_0x242199){if(_0x242199){return _0x242199[_0x02f9('0x7e')](null);}return null;})['then'](respondWithStatusCode(_0x1e692f,null))[_0x02f9('0x19')](handleError(_0x1e692f,null));};exports[_0x02f9('0x7f')]=function(_0x411e54,_0xd86979){return db[_0x02f9('0x80')][_0x02f9('0x5f')]({'where':{'id':_0x411e54[_0x02f9('0x5c')]['id']}})['then'](handleEntityNotFound(_0xd86979,null))[_0x02f9('0x10')](function(_0x3e796e){if(_0x3e796e){return _0x3e796e[_0x02f9('0x7f')](_0x411e54[_0x02f9('0x61')][_0x02f9('0x6e')],_[_0x02f9('0x81')](_0x411e54[_0x02f9('0x61')],[_0x02f9('0x6e'),'id'])||{});}})['then'](respondWithResult(_0xd86979,null))[_0x02f9('0x19')](handleError(_0xd86979,null));};exports[_0x02f9('0x82')]=function(_0x2ee8bb,_0x56dccd){var _0x332304={'raw':![],'where':{}};var _0x180dac={};var _0x23218d={'count':0x0,'rows':[]};return db[_0x02f9('0x56')][_0x02f9('0x66')]({'where':{'id':_0x2ee8bb[_0x02f9('0x5c')]['id']}})[_0x02f9('0x10')](handleEntityNotFound(_0x56dccd,null))['then'](function(_0x4ad7a7){if(_0x4ad7a7){_0x180dac[_0x02f9('0x47')]=_[_0x02f9('0x48')](db['MailInteraction'][_0x02f9('0x44')]);_0x180dac[_0x02f9('0x4b')]=_['keys'](_0x2ee8bb[_0x02f9('0x4b')]);_0x180dac[_0x02f9('0x49')]=_['intersection'](_0x180dac[_0x02f9('0x47')],_0x180dac[_0x02f9('0x4b')]);_0x332304['attributes']=_['intersection'](_0x180dac['model'],qs[_0x02f9('0x5d')](_0x2ee8bb['query']['fields']));_0x332304[_0x02f9('0x4c')]=_0x332304[_0x02f9('0x4c')][_0x02f9('0x5e')]?_0x332304['attributes']:_0x180dac[_0x02f9('0x47')];if(!_0x2ee8bb[_0x02f9('0x4b')]['hasOwnProperty'](_0x02f9('0x83'))){_0x332304['limit']=qs['limit'](_0x2ee8bb['query'][_0x02f9('0x1f')]);_0x332304[_0x02f9('0x1d')]=qs[_0x02f9('0x1d')](_0x2ee8bb[_0x02f9('0x4b')]['offset']);}_0x332304['order']=qs[_0x02f9('0x4f')](_0x2ee8bb[_0x02f9('0x4b')][_0x02f9('0x4f')]);_0x332304[_0x02f9('0x51')]=qs['filters'](_[_0x02f9('0x50')](_0x2ee8bb[_0x02f9('0x4b')],_0x180dac['filters']));_0x332304[_0x02f9('0x51')]['MailAccountId']=_0x4ad7a7['id'];if(_0x2ee8bb[_0x02f9('0x4b')][_0x02f9('0x54')]){_0x332304['where']=_[_0x02f9('0x52')](_0x332304[_0x02f9('0x51')],{'$or':_[_0x02f9('0x43')](_0x332304[_0x02f9('0x4c')],function(_0x5246f5){var _0xb4af1={};_0xb4af1[_0x5246f5]={'$like':'%'+_0x2ee8bb['query']['filter']+'%'};return _0xb4af1;})});}_0x332304=_[_0x02f9('0x52')]({},_0x332304,_0x2ee8bb[_0x02f9('0x55')]);return db[_0x02f9('0x80')]['count']({'where':_0x332304[_0x02f9('0x51')]})[_0x02f9('0x10')](function(_0x2c6537){_0x23218d[_0x02f9('0x20')]=_0x2c6537;if(_0x2ee8bb[_0x02f9('0x4b')]['includeAll']){_0x332304[_0x02f9('0x58')]=[{'model':db[_0x02f9('0x84')],'as':'Contact','required':![]},{'model':db[_0x02f9('0x85')],'as':_0x02f9('0x86'),'attributes':[_0x02f9('0x25'),'fullname',_0x02f9('0x87')],'required':![]},{'model':db[_0x02f9('0x88')],'as':_0x02f9('0x89'),'attributes':['id',_0x02f9('0x25'),'color'],'where':_0x2ee8bb['query'][_0x02f9('0x8a')]?{'id':_0x2ee8bb['query'][_0x02f9('0x8a')]}:undefined,'required':_0x2ee8bb[_0x02f9('0x4b')][_0x02f9('0x8a')]?!![]:![]}];}return db[_0x02f9('0x80')][_0x02f9('0x59')](_0x332304);})[_0x02f9('0x10')](function(_0x803615){_0x23218d[_0x02f9('0x5a')]=_0x803615;return _0x23218d;});}})[_0x02f9('0x10')](respondWithFilteredResult(_0x56dccd,_0x332304))[_0x02f9('0x19')](handleError(_0x56dccd,null));};exports['addApplications']=function addApplications(_0x1c764f,_0x122afc){var _0x217630=_0x1c764f[_0x02f9('0x5c')]['id'];var _0x5349ac=_0x1c764f[_0x02f9('0x61')];var _0x461e46=0xc8;var _0x5055c8=null;return db[_0x02f9('0x8b')][_0x02f9('0x8c')]({'isolationLevel':db['sequelize'][_0x02f9('0x8d')][_0x02f9('0x8e')][_0x02f9('0x8f')]},function(_0x19ac3c){return db['MailAccount'][_0x02f9('0x66')]({'where':{'id':_0x217630},'transaction':_0x19ac3c})[_0x02f9('0x10')](function(_0x503f48){if(_0x503f48){return db['MailApplication'][_0x02f9('0x21')]({'where':{'MailAccountId':_0x217630},'transaction':_0x19ac3c})[_0x02f9('0x10')](function(){var _0x467fa3=_[_0x02f9('0x43')](_0x5349ac,function(_0x5bfb14){_0x5bfb14[_0x02f9('0x67')]=_0x217630;return _0x5bfb14;});return db[_0x02f9('0x90')][_0x02f9('0x91')](_0x467fa3,{'transaction':_0x19ac3c});});}else{_0x461e46=0x194;_0x5055c8=[];}});})[_0x02f9('0x10')](function(){if(_0x461e46!==0x194){return db[_0x02f9('0x90')][_0x02f9('0x92')]({'where':{'MailAccountId':_0x217630},'order':'priority'})[_0x02f9('0x10')](function(_0x399228){_0x5055c8=_0x399228;});}})[_0x02f9('0x19')](function(_0x4188fe){_0x461e46=0x1f4;logger['error'](_0x4188fe['stack']);if(_0x4188fe['name']){delete _0x4188fe[_0x02f9('0x25')];}_0x5055c8=_0x4188fe;})['finally'](function(){if(_0x5055c8===null){_0x122afc[_0x02f9('0x1a')](_0x461e46);}else{if(_0x461e46===0x1f4){_0x122afc['status'](_0x461e46)[_0x02f9('0x26')](_0x5055c8);}else{_0x122afc[_0x02f9('0x1b')](_0x461e46)['json'](_0x5055c8);}}});};exports[_0x02f9('0x93')]=function(_0xc62b7c,_0x2fa39e){var _0x493c95={};var _0x49fca0={};var _0x20122d;var _0x278b89;return db['MailAccount']['findOne']({'where':{'id':_0xc62b7c[_0x02f9('0x5c')]['id']}})[_0x02f9('0x10')](handleEntityNotFound(_0x2fa39e,null))[_0x02f9('0x10')](function(_0x4abf42){if(_0x4abf42){_0x20122d=_0x4abf42;_0x49fca0['model']=_[_0x02f9('0x48')](db[_0x02f9('0x90')][_0x02f9('0x44')]);_0x49fca0[_0x02f9('0x4b')]=_[_0x02f9('0x48')](_0xc62b7c['query']);_0x49fca0[_0x02f9('0x49')]=_[_0x02f9('0x4a')](_0x49fca0[_0x02f9('0x47')],_0x49fca0[_0x02f9('0x4b')]);_0x493c95[_0x02f9('0x4c')]=_[_0x02f9('0x4a')](_0x49fca0[_0x02f9('0x47')],qs[_0x02f9('0x5d')](_0xc62b7c['query'][_0x02f9('0x5d')]));_0x493c95['attributes']=_0x493c95[_0x02f9('0x4c')]['length']?_0x493c95[_0x02f9('0x4c')]:_0x49fca0[_0x02f9('0x47')];_0x493c95[_0x02f9('0x4e')]=qs[_0x02f9('0x4f')](_0xc62b7c[_0x02f9('0x4b')][_0x02f9('0x4f')]);_0x493c95[_0x02f9('0x51')]=qs[_0x02f9('0x49')](_[_0x02f9('0x50')](_0xc62b7c[_0x02f9('0x4b')],_0x49fca0[_0x02f9('0x49')]));if(_0xc62b7c[_0x02f9('0x4b')][_0x02f9('0x54')]){_0x493c95['where']=_[_0x02f9('0x52')](_0x493c95[_0x02f9('0x51')],{'$or':_[_0x02f9('0x43')](_0x493c95[_0x02f9('0x4c')],function(_0x52135c){var _0x3d15c2={};_0x3d15c2[_0x52135c]={'$like':'%'+_0xc62b7c[_0x02f9('0x4b')]['filter']+'%'};return _0x3d15c2;})});}_0x493c95=_[_0x02f9('0x52')]({},_0x493c95,_0xc62b7c[_0x02f9('0x55')]);return _0x20122d['getApplications'](_0x493c95);}})[_0x02f9('0x10')](function(_0x21c576){if(_0x21c576){_0x278b89=_0x21c576['length'];if(!_0xc62b7c[_0x02f9('0x4b')]['hasOwnProperty']('nolimit')){_0x493c95[_0x02f9('0x1f')]=qs[_0x02f9('0x1f')](_0xc62b7c[_0x02f9('0x4b')][_0x02f9('0x1f')]);_0x493c95[_0x02f9('0x1d')]=qs[_0x02f9('0x1d')](_0xc62b7c['query'][_0x02f9('0x1d')]);}return _0x20122d['getApplications'](_0x493c95);}})['then'](function(_0x5e5a85){if(_0x5e5a85){return _0x5e5a85?{'count':_0x278b89,'rows':_0x5e5a85}:null;}})[_0x02f9('0x10')](respondWithResult(_0x2fa39e,null))[_0x02f9('0x19')](handleError(_0x2fa39e,null));};exports[_0x02f9('0x94')]=function(_0x2a8f86,_0x3b81fd){var _0x1649a0={'raw':!![],'where':{}};var _0x4aeab0={};var _0x280803={'count':0x0,'rows':[]};return db[_0x02f9('0x56')][_0x02f9('0x66')]({'where':{'id':_0x2a8f86[_0x02f9('0x5c')]['id']}})[_0x02f9('0x10')](handleEntityNotFound(_0x3b81fd,null))[_0x02f9('0x10')](function(_0xa8baf6){if(_0xa8baf6){_0x4aeab0['model']=_[_0x02f9('0x48')](db['MailMessage'][_0x02f9('0x44')]);_0x4aeab0[_0x02f9('0x4b')]=_[_0x02f9('0x48')](_0x2a8f86[_0x02f9('0x4b')]);_0x4aeab0[_0x02f9('0x49')]=_['intersection'](_0x4aeab0[_0x02f9('0x47')],_0x4aeab0['query']);_0x1649a0[_0x02f9('0x4c')]=_['intersection'](_0x4aeab0[_0x02f9('0x47')],qs[_0x02f9('0x5d')](_0x2a8f86[_0x02f9('0x4b')]['fields']));_0x1649a0[_0x02f9('0x4c')]=_0x1649a0[_0x02f9('0x4c')][_0x02f9('0x5e')]?_0x1649a0['attributes']:_0x4aeab0[_0x02f9('0x47')];if(!_0x2a8f86['query']['hasOwnProperty'](_0x02f9('0x83'))){_0x1649a0[_0x02f9('0x1f')]=qs['limit'](_0x2a8f86[_0x02f9('0x4b')]['limit']);_0x1649a0['offset']=qs[_0x02f9('0x1d')](_0x2a8f86[_0x02f9('0x4b')][_0x02f9('0x1d')]);}_0x1649a0[_0x02f9('0x4e')]=qs[_0x02f9('0x4f')](_0x2a8f86['query']['sort']);_0x1649a0[_0x02f9('0x51')]=qs[_0x02f9('0x49')](_['pick'](_0x2a8f86['query'],_0x4aeab0['filters']));_0x1649a0[_0x02f9('0x51')][_0x02f9('0x67')]=_0xa8baf6['id'];if(_0x2a8f86['query'][_0x02f9('0x54')]){_0x1649a0['where']=_[_0x02f9('0x52')](_0x1649a0[_0x02f9('0x51')],{'$or':_[_0x02f9('0x43')](_0x1649a0[_0x02f9('0x4c')],function(_0x2695bd){var _0x51e758={};_0x51e758[_0x2695bd]={'$like':'%'+_0x2a8f86[_0x02f9('0x4b')][_0x02f9('0x54')]+'%'};return _0x51e758;})});}if(_0x2a8f86[_0x02f9('0x4b')][_0x02f9('0x95')]){var _0x5a89c4=_0x2a8f86[_0x02f9('0x4b')][_0x02f9('0x95')][_0x02f9('0x96')](',');var _0x53889a={};_0x53889a[_0x5a89c4[0x0]]={'$gte':moment(_0x5a89c4[0x1])[_0x02f9('0x97')](_0x02f9('0x98'))};_0x1649a0[_0x02f9('0x51')]=_[_0x02f9('0x52')](_0x1649a0[_0x02f9('0x51')],_0x53889a);}_0x1649a0=_['merge']({},_0x1649a0,_0x2a8f86['options']);return db['MailMessage'][_0x02f9('0x20')]({'where':_0x1649a0[_0x02f9('0x51')]})[_0x02f9('0x10')](function(_0x12948d){_0x280803[_0x02f9('0x20')]=_0x12948d;if(_0x2a8f86[_0x02f9('0x4b')][_0x02f9('0x57')]){_0x1649a0[_0x02f9('0x58')]=[{'all':!![]}];}return db['MailMessage'][_0x02f9('0x59')](_0x1649a0);})[_0x02f9('0x10')](function(_0x219d78){if(_0x2a8f86[_0x02f9('0x4b')]['inlineCss']===_0x02f9('0x99')){for(var _0x58ef0f=0x0;_0x58ef0f<_0x219d78[_0x02f9('0x5e')];_0x58ef0f++){_0x219d78[_0x58ef0f][_0x02f9('0x61')]=juice(_0x219d78[_0x58ef0f][_0x02f9('0x61')]);}}_0x280803[_0x02f9('0x5a')]=_0x219d78;return _0x280803;});}})[_0x02f9('0x10')](respondWithFilteredResult(_0x3b81fd,_0x1649a0))[_0x02f9('0x19')](handleError(_0x3b81fd,null));};exports[_0x02f9('0x26')]=function(_0x3af10e,_0x1ab2a3){var _0x1ec565,_0x152160={},_0x55f1cb;if(_0x3af10e[_0x02f9('0x61')]['to']){_0x55f1cb=_0x3af10e[_0x02f9('0x61')]['to'][_0x02f9('0x96')](',')[0x0];}return db['MailAccount']['find']({'where':{'id':_0x3af10e[_0x02f9('0x5c')]['id']},'include':[{'model':db['CmList'],'as':_0x02f9('0x9a'),'include':[{'model':db['CmContact'],'as':_0x02f9('0x9b'),'where':{'email':_0x55f1cb},'limit':0x1,'order':[[_0x02f9('0x9c'),_0x02f9('0x9d')]]}]},{'model':db['MailServerOut'],'as':'Smtp','raw':!![],'include':[{'model':db[_0x02f9('0x9e')],'as':'CloudProvider','raw':!![]}]}]})[_0x02f9('0x10')](handleEntityNotFound(_0x1ab2a3,null))['then'](function(_0x3e318a){if(!_0x3e318a)return;_0x1ec565=_0x3e318a;if(!_0x3e318a[_0x02f9('0x3e')])throw new Error(_0x02f9('0x9f'));if(_[_0x02f9('0x71')](_0x3af10e[_0x02f9('0x61')][_0x02f9('0xa0')])){_0x3af10e['body'][_0x02f9('0xa0')]=util[_0x02f9('0x97')]('%s\x20<%s>',_0x3e318a[_0x02f9('0x25')],_0x3e318a[_0x02f9('0xa1')]||_0x3e318a['Smtp'][_0x02f9('0x32')]);}if(_0x3af10e[_0x02f9('0x61')][_0x02f9('0xa2')]&&_0x3af10e[_0x02f9('0x61')][_0x02f9('0xa2')]['length']){for(var _0x132b2c=0x0;_0x132b2c<_0x3af10e['body'][_0x02f9('0xa2')][_0x02f9('0x5e')];_0x132b2c+=0x1){_0x3af10e[_0x02f9('0x61')][_0x02f9('0xa2')][_0x132b2c]={'filename':_0x3af10e['body'][_0x02f9('0xa2')][_0x132b2c][_0x02f9('0x25')],'path':path[_0x02f9('0xa3')](config[_0x02f9('0xa4')],_0x02f9('0xa5'),_0x3af10e[_0x02f9('0x61')][_0x02f9('0xa2')][_0x132b2c][_0x02f9('0xa6')])};}}var _0x6a8554=_0x3e318a[_0x02f9('0xa7')]();return respondWithRpcPromise('SendMail',_0x02f9('0xa8'),{'account':_0x6a8554,'message':_0x3af10e['body']});})[_0x02f9('0x10')](function(_0x45f436){if(!_0x45f436)return;_0x152160=_0x45f436;if(!_0x1ec565[_0x02f9('0x9a')])throw new Error(_0x02f9('0xa9'));if(_0x1ec565[_0x02f9('0x9a')]['Contacts']['length'])return _0x1ec565[_0x02f9('0x9a')][_0x02f9('0x9b')][0x0];return db[_0x02f9('0x84')][_0x02f9('0x65')](_[_0x02f9('0xaa')](_0x3af10e['body'],{'firstName':_0x3af10e[_0x02f9('0x61')]['to'],'email':_0x3af10e[_0x02f9('0x61')]['to'],'phone':_0x3af10e['body']['to'],'ListId':_0x1ec565[_0x02f9('0x70')]}));})[_0x02f9('0x10')](function(_0x5d5727){if(!_0x5d5727)return;var _0x6553e7={'UserId':_0x3af10e['user']['id'],'ContactId':_0x5d5727['id'],'MailAccountId':_0x1ec565['id'],'inReplyTo':_0x152160[_0x02f9('0xab')],'to':_0x3af10e[_0x02f9('0x61')][_0x02f9('0xa0')],'cc':_0x3af10e['body']['cc'],'subject':_0x3af10e['body'][_0x02f9('0xac')],'attach':_0x3af10e['body'][_0x02f9('0xad')],'firstMsgDirection':_0x02f9('0xae'),'lastMsgAt':moment()[_0x02f9('0x97')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':_0x02f9('0xae'),'Messages':[_[_0x02f9('0x52')](_0x3af10e[_0x02f9('0x61')],{'messageId':_0x152160[_0x02f9('0xab')],'sentAt':moment()[_0x02f9('0x97')](_0x02f9('0x98')),'read':!![],'MailAccountId':_0x1ec565['id'],'UserId':_0x3af10e[_0x02f9('0x32')]['id'],'ContactId':_0x5d5727['id']})]};if(_0x3af10e['body'][_0x02f9('0xaf')]){_0x6553e7=_[_0x02f9('0x52')](_0x6553e7,_0x3af10e[_0x02f9('0x61')]['Interaction']);}return db['MailInteraction']['create'](_0x6553e7,{'include':[{'model':db[_0x02f9('0xb0')],'as':_0x02f9('0xb1')}]});})[_0x02f9('0x10')](respondWithResult(_0x1ab2a3,null))[_0x02f9('0x19')](handleError(_0x1ab2a3,null));};exports['verifySmtp']=function(_0xc33f06,_0xf7f22a){return db[_0x02f9('0x56')][_0x02f9('0x5f')]({'where':{'id':_0xc33f06[_0x02f9('0x5c')]['id']},'include':[{'model':db[_0x02f9('0x41')],'as':_0x02f9('0x3e'),'raw':!![],'include':[{'model':db[_0x02f9('0x9e')],'as':_0x02f9('0x9e'),'raw':!![]}]}]})[_0x02f9('0x10')](handleEntityNotFound(_0xf7f22a,null))[_0x02f9('0x10')](function(_0x1f86ec){if(!_0x1f86ec['Smtp'])return;var _0x571fc0=_0x1f86ec['getSmtpOptions']();return respondWithRpcPromise(_0x02f9('0xb2'),_0x02f9('0xb3'),{'account':_0x571fc0});})[_0x02f9('0x10')](respondWithResult(_0xf7f22a,null))['catch'](handleError(_0xf7f22a,null));};exports[_0x02f9('0x21')]=function(_0x2eb1c4,_0xe9f151){return db[_0x02f9('0x56')][_0x02f9('0x5f')]({'where':{'id':_0x2eb1c4[_0x02f9('0x5c')]['id']}})[_0x02f9('0x10')](handleEntityNotFound(_0xe9f151,null))[_0x02f9('0x10')](function(_0x2beb88){if(_0x2beb88&&_0x2beb88[_0x02f9('0x3b')]){throw new db['Sequelize'][(_0x02f9('0xb4'))](_0x02f9('0xb5'));}return _0x2beb88;})[_0x02f9('0x10')](removeEntity(_0xe9f151,null))[_0x02f9('0x19')](handleError(_0xe9f151,null));};exports[_0x02f9('0xb6')]=function(_0x39c144,_0x525e2a){return db[_0x02f9('0x56')][_0x02f9('0x5f')]({'where':{'id':_0x39c144[_0x02f9('0x5c')]['id']}})[_0x02f9('0x10')](handleEntityNotFound(_0x525e2a,null))['then'](function(_0x69060){if(_0x69060){return _0x69060['addAgents'](_0x39c144[_0x02f9('0x61')]['ids'],_[_0x02f9('0x81')](_0x39c144['body'],[_0x02f9('0x6e'),'id'])||{})[_0x02f9('0xb7')](function(_0x5b7daf){for(var _0x4dc14d=0x0;_0x4dc14d<_0x39c144[_0x02f9('0x61')]['ids'][_0x02f9('0x5e')];_0x4dc14d+=0x1){socket[_0x02f9('0xb8')](_0x02f9('0xb9'),{'UserId':Number(_0x39c144[_0x02f9('0x61')][_0x02f9('0x6e')][_0x4dc14d]),'MailAccountId':Number(_0x39c144[_0x02f9('0x5c')]['id'])});}return _0x5b7daf;});}})[_0x02f9('0x10')](respondWithResult(_0x525e2a,null))[_0x02f9('0x19')](handleError(_0x525e2a,null));};exports[_0x02f9('0xba')]=function(_0x19f3f9,_0x2b2675){return db[_0x02f9('0x56')][_0x02f9('0x5f')]({'where':{'id':_0x19f3f9['params']['id']}})[_0x02f9('0x10')](handleEntityNotFound(_0x2b2675,null))[_0x02f9('0x10')](function(_0x431218){if(_0x431218){return _0x431218[_0x02f9('0xba')](_0x19f3f9[_0x02f9('0x4b')][_0x02f9('0x6e')])[_0x02f9('0x10')](function(){if(_['isArray'](_0x19f3f9[_0x02f9('0x4b')]['ids'])){for(var _0x356188=0x0;_0x356188<_0x19f3f9[_0x02f9('0x4b')][_0x02f9('0x6e')][_0x02f9('0x5e')];_0x356188+=0x1){socket[_0x02f9('0xb8')](_0x02f9('0xbb'),{'UserId':Number(_0x19f3f9[_0x02f9('0x4b')][_0x02f9('0x6e')][_0x356188]),'MailAccountId':Number(_0x19f3f9[_0x02f9('0x5c')]['id'])});}}else{socket['emit'](_0x02f9('0xbb'),{'UserId':Number(_0x19f3f9[_0x02f9('0x4b')]['ids']),'MailAccountId':Number(_0x19f3f9[_0x02f9('0x5c')]['id'])});}});}})[_0x02f9('0x10')](respondWithStatusCode(_0x2b2675,null))[_0x02f9('0x19')](handleError(_0x2b2675,null));};exports[_0x02f9('0xbc')]=function(_0x2458c4,_0x4476cd){var _0x34b3f1={};var _0x5cfc33={};var _0x53486e;var _0x40fbc4;return db[_0x02f9('0x56')]['findOne']({'where':{'id':_0x2458c4[_0x02f9('0x5c')]['id']}})['then'](handleEntityNotFound(_0x4476cd,null))[_0x02f9('0x10')](function(_0x434973){if(_0x434973){_0x53486e=_0x434973;_0x5cfc33[_0x02f9('0x47')]=_[_0x02f9('0x48')](db[_0x02f9('0x85')][_0x02f9('0x44')]);_0x5cfc33['query']=_['keys'](_0x2458c4[_0x02f9('0x4b')]);_0x5cfc33[_0x02f9('0x49')]=_[_0x02f9('0x4a')](_0x5cfc33[_0x02f9('0x47')],_0x5cfc33[_0x02f9('0x4b')]);_0x34b3f1[_0x02f9('0x4c')]=_[_0x02f9('0x4a')](_0x5cfc33[_0x02f9('0x47')],qs[_0x02f9('0x5d')](_0x2458c4[_0x02f9('0x4b')][_0x02f9('0x5d')]));_0x34b3f1[_0x02f9('0x4c')]=_0x34b3f1[_0x02f9('0x4c')][_0x02f9('0x5e')]?_0x34b3f1[_0x02f9('0x4c')]:_0x5cfc33[_0x02f9('0x47')];_0x34b3f1[_0x02f9('0x4e')]=qs[_0x02f9('0x4f')](_0x2458c4[_0x02f9('0x4b')]['sort']);_0x34b3f1[_0x02f9('0x51')]=qs[_0x02f9('0x49')](_[_0x02f9('0x50')](_0x2458c4[_0x02f9('0x4b')],_0x5cfc33[_0x02f9('0x49')]));if(_0x2458c4[_0x02f9('0x4b')][_0x02f9('0x54')]){_0x34b3f1['where']=_[_0x02f9('0x52')](_0x34b3f1[_0x02f9('0x51')],{'$or':_[_0x02f9('0x43')](_0x34b3f1['attributes'],function(_0x17f247){var _0x4c33ab={};_0x4c33ab[_0x17f247]={'$like':'%'+_0x2458c4[_0x02f9('0x4b')][_0x02f9('0x54')]+'%'};return _0x4c33ab;})});}_0x34b3f1=_[_0x02f9('0x52')]({},_0x34b3f1,_0x2458c4[_0x02f9('0x55')]);return _0x53486e['getAgents'](_0x34b3f1);}})[_0x02f9('0x10')](function(_0x54a2ba){if(_0x54a2ba){_0x40fbc4=_0x54a2ba[_0x02f9('0x5e')];if(!_0x2458c4[_0x02f9('0x4b')][_0x02f9('0x4d')](_0x02f9('0x83'))){_0x34b3f1[_0x02f9('0x1f')]=qs[_0x02f9('0x1f')](_0x2458c4[_0x02f9('0x4b')][_0x02f9('0x1f')]);_0x34b3f1[_0x02f9('0x1d')]=qs[_0x02f9('0x1d')](_0x2458c4[_0x02f9('0x4b')][_0x02f9('0x1d')]);}return _0x53486e[_0x02f9('0xbc')](_0x34b3f1);}})[_0x02f9('0x10')](function(_0x276d5b){if(_0x276d5b){return _0x276d5b?{'count':_0x40fbc4,'rows':_0x276d5b}:null;}})['then'](respondWithResult(_0x4476cd,null))['catch'](handleError(_0x4476cd,null));};
\ No newline at end of file
+var _0x2fa1=['bluebird','util','path','lodash','juice','ioredis','../../config/logger','api','../../config/environment','redis','defaults','localhost','./mailAccount.socket','register','jayson/promise','client','http','request','then','MailAccount,\x20%s,\x20%s','MailAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','update','destroy','get','name','send','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook365','outlook.office365.com','smtp.gmail.com','smtp.mail.yahoo.com','smtp-mail.outlook.com','smtp.office365.com','Unknown\x20email\x20service\x20provider','user','pass','password','modernAuthentication','CloudProviderId','host','port','secure','service','authentication','Imap','Smtp','index','MailServerIn','MailServerOut','Pause','mandatoryDispositionPause','map','MailAccount','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','order','sort','where','pick','filter','merge','options','includeAll','include','rows','params','keys','rawAttributes','body','provider','find','Mail\x20Account\x20not\x20found','describe','addDisposition','MailAccountId','Disposition','getDispositions','findOne','hasOwnProperty','nolimit','findAll','removeDispositions','ids','addAnswer','CannedAnswer','custom','ListId','isNil','active','description','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','MailAccounts','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','setImap','getSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction','omit','getInteractions','CmContact','Contact','User','Owner','fullname','internal','Tags','color','tag','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','MailApplication','bulkCreate','findAndCountAll','priority','stack','getApplications','getMessages','MailMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','CmList','List','Contacts','updatedAt','DESC','CloudProvider','Smtp\x20configuration\x20not\x20found','from','%s\x20<%s>','email','attachments','join','root','server/files/attachments','basename','SendMail','sendMail','List\x20not\x20found','messageId','out','Interaction','verifySmtp','getSmtpOptions','VerifySmtp','Sequelize','ValidationError','addAgents','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','getAgents','moment'];(function(_0x135acd,_0x54411c){var _0x38269e=function(_0x176122){while(--_0x176122){_0x135acd['push'](_0x135acd['shift']());}};_0x38269e(++_0x54411c);}(_0x2fa1,0xc4));var _0x12fa=function(_0x3e5e05,_0x522c1d){_0x3e5e05=_0x3e5e05-0x0;var _0x1cdc9f=_0x2fa1[_0x3e5e05];return _0x1cdc9f;};'use strict';var moment=require(_0x12fa('0x0'));var BPromise=require(_0x12fa('0x1'));var util=require(_0x12fa('0x2'));var path=require(_0x12fa('0x3'));var _=require(_0x12fa('0x4'));var juice=require(_0x12fa('0x5'));var Redis=require(_0x12fa('0x6'));var qs=require('../../components/parsers/qs');var logger=require(_0x12fa('0x7'))(_0x12fa('0x8'));var config=require(_0x12fa('0x9'));var db=require('../../mysqldb')['db'];config[_0x12fa('0xa')]=_[_0x12fa('0xb')](config[_0x12fa('0xa')],{'host':_0x12fa('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x12fa('0xd'))[_0x12fa('0xe')](socket);var jayson=require(_0x12fa('0xf'));var client=jayson[_0x12fa('0x10')][_0x12fa('0x11')]({'port':0x232b});function respondWithRpcPromise(_0x2598d3,_0x258c51,_0x674004,_0x2e0d67){return new BPromise(function(_0x40b763,_0x50167c){var _0x1daf95=_0x2e0d67||client;return _0x1daf95[_0x12fa('0x12')](_0x2598d3,_0x674004)[_0x12fa('0x13')](function(_0xeaa9c7){logger['info'](_0x12fa('0x14'),_0x258c51,'request\x20sent');logger['debug'](_0x12fa('0x15'),_0x258c51,_0x12fa('0x16'),JSON['stringify'](_0xeaa9c7));if(_0xeaa9c7[_0x12fa('0x17')]){if(_0xeaa9c7[_0x12fa('0x17')][_0x12fa('0x18')]===0x1f4){logger[_0x12fa('0x17')](_0x12fa('0x14'),_0x258c51,_0xeaa9c7[_0x12fa('0x17')][_0x12fa('0x19')]);return _0x50167c(_0xeaa9c7[_0x12fa('0x17')][_0x12fa('0x19')]);}logger[_0x12fa('0x17')](_0x12fa('0x14'),_0x258c51,_0xeaa9c7[_0x12fa('0x17')][_0x12fa('0x19')]);return _0x40b763(_0xeaa9c7['error'][_0x12fa('0x19')]);}else{logger['info'](_0x12fa('0x14'),_0x258c51,_0x12fa('0x16'));_0x40b763(_0xeaa9c7[_0x12fa('0x1a')]['message']);}})[_0x12fa('0x1b')](function(_0x4f4ff6){logger[_0x12fa('0x17')](_0x12fa('0x14'),_0x258c51,_0x4f4ff6);_0x50167c(_0x4f4ff6);});});}function respondWithStatusCode(_0x1cd9e3,_0x59d324){_0x59d324=_0x59d324||0xcc;return function(_0x5d076b){if(_0x5d076b){return _0x1cd9e3[_0x12fa('0x1c')](_0x59d324);}return _0x1cd9e3[_0x12fa('0x1d')](_0x59d324)[_0x12fa('0x1e')]();};}function respondWithResult(_0x55750a,_0x2e4ae8){_0x2e4ae8=_0x2e4ae8||0xc8;return function(_0x19a39e){if(_0x19a39e){return _0x55750a['status'](_0x2e4ae8)[_0x12fa('0x1f')](_0x19a39e);}};}function respondWithFilteredResult(_0x58d3b1,_0x534ada){return function(_0x938685){if(_0x938685){var _0x1faf36=typeof _0x534ada['offset']===_0x12fa('0x20')&&typeof _0x534ada['limit']===_0x12fa('0x20');var _0x91709f=_0x938685[_0x12fa('0x21')];var _0x369dc4=_0x1faf36?0x0:_0x534ada[_0x12fa('0x22')];var _0x642636=_0x1faf36?_0x938685[_0x12fa('0x21')]:_0x534ada[_0x12fa('0x22')]+_0x534ada[_0x12fa('0x23')];var _0x21e472;if(_0x642636>=_0x91709f){_0x642636=_0x91709f;_0x21e472=0xc8;}else{_0x21e472=0xce;}_0x58d3b1[_0x12fa('0x1d')](_0x21e472);return _0x58d3b1[_0x12fa('0x24')](_0x12fa('0x25'),_0x369dc4+'-'+_0x642636+'/'+_0x91709f)[_0x12fa('0x1f')](_0x938685);}return null;};}function saveUpdates(_0x598e25){return function(_0x14f625){if(_0x14f625){return _0x14f625[_0x12fa('0x26')](_0x598e25)[_0x12fa('0x13')](function(_0xe86375){return _0xe86375;});}return null;};}function removeEntity(_0x338b90){return function(_0x441ad1){if(_0x441ad1){return _0x441ad1[_0x12fa('0x27')]()[_0x12fa('0x13')](function(){var _0x45fe97=_0x441ad1[_0x12fa('0x28')]({'plain':!![]});var _0x401a75='MailAccounts';return db['UserProfileResource'][_0x12fa('0x27')]({'where':{'type':_0x401a75,'resourceId':_0x45fe97['id']}})[_0x12fa('0x13')](function(){return _0x441ad1;});})[_0x12fa('0x13')](function(){_0x338b90[_0x12fa('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5dbdcb){return function(_0x3dc2fe){if(!_0x3dc2fe){_0x5dbdcb['sendStatus'](0x194);}return _0x3dc2fe;};}function handleError(_0x19e6e1,_0x22c1ce){_0x22c1ce=_0x22c1ce||0x1f4;return function(_0x5af093){logger['error'](_0x5af093['stack']);if(_0x5af093[_0x12fa('0x29')]){delete _0x5af093['name'];}_0x19e6e1['status'](_0x22c1ce)[_0x12fa('0x2a')](_0x5af093);};}function getImapHost(_0x219474){switch(_0x219474){case'gmail':return _0x12fa('0x2b');case _0x12fa('0x2c'):return _0x12fa('0x2d');case _0x12fa('0x2e'):return _0x12fa('0x2f');case _0x12fa('0x30'):return _0x12fa('0x31');}throw new Error('Unknown\x20email\x20service\x20provider',_0x219474);}function getSmtpHost(_0x42dad5){switch(_0x42dad5){case'gmail':return _0x12fa('0x32');case _0x12fa('0x2c'):return _0x12fa('0x33');case _0x12fa('0x2e'):return _0x12fa('0x34');case _0x12fa('0x30'):return _0x12fa('0x35');}throw new Error(_0x12fa('0x36'),_0x42dad5);}function getAuthenticationOptions(_0x187686,_0x1c9518){var _0x1f3a6b={};var _0x1c6c44={};if(_0x187686){_0x1f3a6b['user']=_0x1c6c44[_0x12fa('0x37')]=_0x1c9518['username'];_0x1f3a6b['password']=_0x1c6c44[_0x12fa('0x38')]=_0x1c9518[_0x12fa('0x39')];if(_0x1c9518[_0x12fa('0x3a')]){_0x1f3a6b[_0x12fa('0x3a')]=_0x1c6c44[_0x12fa('0x3a')]=!![];_0x1f3a6b['CloudProviderId']=_0x1c6c44['CloudProviderId']=_0x1c9518['CloudProviderId'];_0x1f3a6b['password']=_0x1c6c44[_0x12fa('0x38')]=null;}else{_0x1f3a6b[_0x12fa('0x3b')]=_0x1c6c44['CloudProviderId']=null;}_0x1f3a6b[_0x12fa('0x3c')]=getImapHost(_0x187686);_0x1f3a6b[_0x12fa('0x3d')]=0x3e1;_0x1c6c44[_0x12fa('0x3c')]=getSmtpHost(_0x187686);_0x1c6c44['port']=0x24b;_0x1c6c44[_0x12fa('0x3e')]=![];_0x1f3a6b[_0x12fa('0x3f')]=_0x1c6c44['service']=null;}else{if(_0x1c9518[_0x12fa('0x40')]){_0x1f3a6b['user']=_0x1c6c44[_0x12fa('0x37')]=_0x1c9518['username'];_0x1f3a6b[_0x12fa('0x39')]=_0x1c6c44['pass']=_0x1c9518['password'];}else{_0x1f3a6b[_0x12fa('0x40')]=_0x1c6c44[_0x12fa('0x40')]=![];_0x1f3a6b['user']=_0x1c6c44['user']=null;_0x1f3a6b[_0x12fa('0x39')]=_0x1c6c44[_0x12fa('0x38')]=null;}_0x1f3a6b[_0x12fa('0x3c')]=_0x1c9518[_0x12fa('0x41')][_0x12fa('0x3c')];_0x1f3a6b[_0x12fa('0x3d')]=_0x1c9518[_0x12fa('0x41')][_0x12fa('0x3d')];_0x1c6c44[_0x12fa('0x3c')]=_0x1c9518['Smtp'][_0x12fa('0x3c')];_0x1c6c44[_0x12fa('0x3d')]=_0x1c9518[_0x12fa('0x42')][_0x12fa('0x3d')];}return{'Imap':_0x1f3a6b,'Smtp':_0x1c6c44};}exports[_0x12fa('0x43')]=function(_0x2dd774,_0x54d768){var _0x190617={'include':[{'model':db[_0x12fa('0x44')],'as':_0x12fa('0x41')},{'model':db[_0x12fa('0x45')],'as':_0x12fa('0x42')},{'model':db[_0x12fa('0x46')],'as':_0x12fa('0x47')}]},_0x44a819={},_0x37cd1d={'count':0x0,'rows':[]};var _0x4db949=_[_0x12fa('0x48')](db[_0x12fa('0x49')]['rawAttributes'],function(_0x23f70a){return{'name':_0x23f70a[_0x12fa('0x4a')],'type':_0x23f70a[_0x12fa('0x4b')][_0x12fa('0x4c')]};});_0x44a819[_0x12fa('0x4d')]=_[_0x12fa('0x48')](_0x4db949,_0x12fa('0x29'));_0x44a819[_0x12fa('0x4e')]=_['keys'](_0x2dd774[_0x12fa('0x4e')]);_0x44a819[_0x12fa('0x4f')]=_['intersection'](_0x44a819[_0x12fa('0x4d')],_0x44a819[_0x12fa('0x4e')]);_0x190617[_0x12fa('0x50')]=_[_0x12fa('0x51')](_0x44a819[_0x12fa('0x4d')],qs[_0x12fa('0x52')](_0x2dd774[_0x12fa('0x4e')][_0x12fa('0x52')]));_0x190617[_0x12fa('0x50')]=_0x190617[_0x12fa('0x50')][_0x12fa('0x53')]?_0x190617[_0x12fa('0x50')]:_0x44a819[_0x12fa('0x4d')];if(!_0x2dd774['query']['hasOwnProperty']('nolimit')){_0x190617[_0x12fa('0x23')]=qs[_0x12fa('0x23')](_0x2dd774[_0x12fa('0x4e')][_0x12fa('0x23')]);_0x190617[_0x12fa('0x22')]=qs['offset'](_0x2dd774[_0x12fa('0x4e')][_0x12fa('0x22')]);}_0x190617[_0x12fa('0x54')]=qs[_0x12fa('0x55')](_0x2dd774['query']['sort']);_0x190617[_0x12fa('0x56')]=qs['filters'](_[_0x12fa('0x57')](_0x2dd774['query'],_0x44a819[_0x12fa('0x4f')]),_0x4db949);if(_0x2dd774[_0x12fa('0x4e')][_0x12fa('0x58')]){_0x190617['where']=_[_0x12fa('0x59')](_0x190617['where'],{'$or':_[_0x12fa('0x48')](_0x4db949,function(_0xb6659e){if(_0xb6659e[_0x12fa('0x4b')]!=='VIRTUAL'){var _0x53633b={};_0x53633b[_0xb6659e['name']]={'$like':'%'+_0x2dd774[_0x12fa('0x4e')][_0x12fa('0x58')]+'%'};return _0x53633b;}})});}_0x190617=_['merge']({},_0x190617,_0x2dd774[_0x12fa('0x5a')]);var _0x12e2ae={'where':_0x190617[_0x12fa('0x56')]};return db[_0x12fa('0x49')][_0x12fa('0x21')](_0x12e2ae)[_0x12fa('0x13')](function(_0x45a5f0){_0x37cd1d['count']=_0x45a5f0;if(_0x2dd774['query'][_0x12fa('0x5b')]){_0x190617[_0x12fa('0x5c')]=[{'all':!![]}];}return db[_0x12fa('0x49')]['findAll'](_0x190617);})[_0x12fa('0x13')](function(_0x4ffe9f){_0x37cd1d[_0x12fa('0x5d')]=_0x4ffe9f;return _0x37cd1d;})[_0x12fa('0x13')](respondWithFilteredResult(_0x54d768,_0x190617))[_0x12fa('0x1b')](handleError(_0x54d768,null));};exports['show']=function(_0x102d4e,_0x2015bd){var _0x4eda9c={'raw':![],'where':{'id':_0x102d4e[_0x12fa('0x5e')]['id']},'include':[{'model':db[_0x12fa('0x44')],'as':_0x12fa('0x41')},{'model':db['MailServerOut'],'as':_0x12fa('0x42')},{'model':db[_0x12fa('0x46')],'as':'mandatoryDispositionPause'}]},_0x11f098={};_0x11f098[_0x12fa('0x4d')]=_[_0x12fa('0x5f')](db[_0x12fa('0x49')][_0x12fa('0x60')]);_0x11f098['query']=_[_0x12fa('0x5f')](_0x102d4e[_0x12fa('0x4e')]);_0x11f098['filters']=_[_0x12fa('0x51')](_0x11f098[_0x12fa('0x4d')],_0x11f098[_0x12fa('0x4e')]);_0x4eda9c[_0x12fa('0x50')]=_[_0x12fa('0x51')](_0x11f098[_0x12fa('0x4d')],qs[_0x12fa('0x52')](_0x102d4e['query'][_0x12fa('0x52')]));_0x4eda9c[_0x12fa('0x50')]=_0x4eda9c[_0x12fa('0x50')][_0x12fa('0x53')]?_0x4eda9c[_0x12fa('0x50')]:_0x11f098[_0x12fa('0x4d')];if(_0x102d4e[_0x12fa('0x4e')]['includeAll']){_0x4eda9c[_0x12fa('0x5c')]=[{'all':!![]}];}_0x4eda9c=_[_0x12fa('0x59')]({},_0x4eda9c,_0x102d4e[_0x12fa('0x5a')]);return db['MailAccount']['find'](_0x4eda9c)[_0x12fa('0x13')](handleEntityNotFound(_0x2015bd,null))[_0x12fa('0x13')](respondWithResult(_0x2015bd,null))['catch'](handleError(_0x2015bd,null));};exports[_0x12fa('0x26')]=function(_0x41bab7,_0x11437e){if(_0x41bab7[_0x12fa('0x61')]['id']){delete _0x41bab7[_0x12fa('0x61')]['id'];}var _0x15c69b=_0x41bab7['body'][_0x12fa('0x62')]==='custom'?null:_0x41bab7[_0x12fa('0x61')][_0x12fa('0x62')];var _0x527146=_0x41bab7[_0x12fa('0x61')]['Imap']||{};var _0x238e77=_0x41bab7[_0x12fa('0x61')][_0x12fa('0x42')]||{};if(_0x15c69b){_0x527146['host']=getImapHost(_0x15c69b);_0x527146[_0x12fa('0x3d')]=0x3e1;_0x238e77[_0x12fa('0x3c')]=getSmtpHost(_0x15c69b);_0x238e77[_0x12fa('0x3d')]=0x24b;_0x238e77[_0x12fa('0x3e')]=![];}if(_0x238e77['modernAuthentication']){_0x238e77[_0x12fa('0x3e')]=![];}else{_0x238e77[_0x12fa('0x3b')]=null;}if(!_0x527146['modernAuthentication'])_0x527146[_0x12fa('0x3b')]=null;_0x41bab7['body'][_0x12fa('0x41')]=_0x527146;_0x41bab7[_0x12fa('0x61')][_0x12fa('0x42')]=_0x238e77;return db[_0x12fa('0x49')][_0x12fa('0x63')]({'where':{'id':_0x41bab7[_0x12fa('0x5e')]['id']},'include':[{'model':db[_0x12fa('0x44')],'as':_0x12fa('0x41')},{'model':db[_0x12fa('0x45')],'as':'Smtp'},{'model':db[_0x12fa('0x46')],'as':_0x12fa('0x47')}]})['then'](handleEntityNotFound(_0x11437e,null))['then'](function(_0x4820f2){if(!_0x4820f2)throw new Error(_0x12fa('0x64'));if(_0x4820f2[_0x12fa('0x3f')])delete _0x41bab7[_0x12fa('0x61')]['Imap'];return _0x4820f2;})[_0x12fa('0x13')](saveUpdates(_0x41bab7['body'],null))['then'](function(_0x3eb770){if(!_0x41bab7[_0x12fa('0x61')][_0x12fa('0x41')])return _0x3eb770;return db[_0x12fa('0x44')]['update'](_0x41bab7[_0x12fa('0x61')]['Imap'],{'where':{'MailAccountId':_0x3eb770['id']}})[_0x12fa('0x13')](function(){return _0x3eb770;});})[_0x12fa('0x13')](function(_0x4b1d6d){if(!_0x41bab7[_0x12fa('0x61')][_0x12fa('0x42')])return _0x4b1d6d;return db[_0x12fa('0x45')][_0x12fa('0x26')](_0x41bab7[_0x12fa('0x61')][_0x12fa('0x42')],{'where':{'MailAccountId':_0x4b1d6d['id']}})[_0x12fa('0x13')](function(){return _0x4b1d6d;});})['then'](respondWithResult(_0x11437e,null))[_0x12fa('0x1b')](handleError(_0x11437e,null));};exports[_0x12fa('0x65')]=function(_0x41d8c7,_0x126a0c){return db[_0x12fa('0x49')][_0x12fa('0x65')]()['then'](respondWithResult(_0x126a0c,null))[_0x12fa('0x1b')](handleError(_0x126a0c,null));};exports[_0x12fa('0x66')]=function(_0x3766ec,_0x2b5389){if(_0x3766ec['body']['id']){delete _0x3766ec[_0x12fa('0x61')]['id'];}return db[_0x12fa('0x49')][_0x12fa('0x63')]({'where':{'id':_0x3766ec['params']['id']}})['then'](handleEntityNotFound(_0x2b5389,null))['then'](function(_0x422c52){if(_0x422c52){_0x3766ec[_0x12fa('0x61')][_0x12fa('0x67')]=_0x422c52['id'];return db[_0x12fa('0x68')]['create'](_0x3766ec[_0x12fa('0x61')]);}})['then'](respondWithResult(_0x2b5389,null))[_0x12fa('0x1b')](handleError(_0x2b5389,null));};exports[_0x12fa('0x69')]=function(_0x2009c0,_0x51efbb){var _0x38de91={'raw':![],'where':{}};var _0x42ea78={};var _0x9e610e={'count':0x0,'rows':[]};return db[_0x12fa('0x49')][_0x12fa('0x6a')]({'where':{'id':_0x2009c0[_0x12fa('0x5e')]['id']}})[_0x12fa('0x13')](handleEntityNotFound(_0x51efbb,null))[_0x12fa('0x13')](function(_0xdd4f60){if(_0xdd4f60){_0x42ea78[_0x12fa('0x4d')]=_[_0x12fa('0x5f')](db[_0x12fa('0x68')]['rawAttributes']);_0x42ea78[_0x12fa('0x4e')]=_[_0x12fa('0x5f')](_0x2009c0['query']);_0x42ea78['filters']=_[_0x12fa('0x51')](_0x42ea78[_0x12fa('0x4d')],_0x42ea78[_0x12fa('0x4e')]);_0x38de91['attributes']=_[_0x12fa('0x51')](_0x42ea78[_0x12fa('0x4d')],qs[_0x12fa('0x52')](_0x2009c0['query'][_0x12fa('0x52')]));_0x38de91[_0x12fa('0x50')]=_0x38de91[_0x12fa('0x50')][_0x12fa('0x53')]?_0x38de91[_0x12fa('0x50')]:_0x42ea78[_0x12fa('0x4d')];if(!_0x2009c0[_0x12fa('0x4e')][_0x12fa('0x6b')](_0x12fa('0x6c'))){_0x38de91[_0x12fa('0x23')]=qs['limit'](_0x2009c0['query'][_0x12fa('0x23')]);_0x38de91[_0x12fa('0x22')]=qs[_0x12fa('0x22')](_0x2009c0[_0x12fa('0x4e')][_0x12fa('0x22')]);}_0x38de91[_0x12fa('0x54')]=qs['sort'](_0x2009c0['query'][_0x12fa('0x55')]);_0x38de91[_0x12fa('0x56')]=qs['filters'](_[_0x12fa('0x57')](_0x2009c0[_0x12fa('0x4e')],_0x42ea78[_0x12fa('0x4f')]));_0x38de91[_0x12fa('0x56')]['MailAccountId']=_0xdd4f60['id'];if(_0x2009c0[_0x12fa('0x4e')]['filter']){_0x38de91[_0x12fa('0x56')]=_[_0x12fa('0x59')](_0x38de91[_0x12fa('0x56')],{'$or':_[_0x12fa('0x48')](_0x38de91[_0x12fa('0x50')],function(_0x4c1d42){var _0x9c8208={};_0x9c8208[_0x4c1d42]={'$like':'%'+_0x2009c0[_0x12fa('0x4e')][_0x12fa('0x58')]+'%'};return _0x9c8208;})});}_0x38de91=_[_0x12fa('0x59')]({},_0x38de91,_0x2009c0[_0x12fa('0x5a')]);return db['Disposition'][_0x12fa('0x21')]({'where':_0x38de91[_0x12fa('0x56')]})[_0x12fa('0x13')](function(_0x12a0c9){_0x9e610e[_0x12fa('0x21')]=_0x12a0c9;if(_0x2009c0[_0x12fa('0x4e')]['includeAll']){_0x38de91['include']=[{'all':!![]}];}return db[_0x12fa('0x68')][_0x12fa('0x6d')](_0x38de91);})[_0x12fa('0x13')](function(_0x4fb31a){_0x9e610e[_0x12fa('0x5d')]=_0x4fb31a;return _0x9e610e;});}})[_0x12fa('0x13')](respondWithFilteredResult(_0x51efbb,_0x38de91))[_0x12fa('0x1b')](handleError(_0x51efbb,null));};exports[_0x12fa('0x6e')]=function(_0x56cf11,_0x302186){return db[_0x12fa('0x49')][_0x12fa('0x63')]({'where':{'id':_0x56cf11[_0x12fa('0x5e')]['id']}})[_0x12fa('0x13')](handleEntityNotFound(_0x302186,null))[_0x12fa('0x13')](function(_0x3f1a68){if(_0x3f1a68){return _0x3f1a68[_0x12fa('0x6e')](_0x56cf11[_0x12fa('0x4e')][_0x12fa('0x6f')]);}})[_0x12fa('0x13')](respondWithStatusCode(_0x302186,null))['catch'](handleError(_0x302186,null));};exports[_0x12fa('0x70')]=function(_0x53b838,_0x5a7453){if(_0x53b838[_0x12fa('0x61')]['id']){delete _0x53b838[_0x12fa('0x61')]['id'];}return db[_0x12fa('0x49')]['find']({'where':{'id':_0x53b838[_0x12fa('0x5e')]['id']}})[_0x12fa('0x13')](handleEntityNotFound(_0x5a7453,null))[_0x12fa('0x13')](function(_0x23ce0b){if(_0x23ce0b){_0x53b838[_0x12fa('0x61')][_0x12fa('0x67')]=_0x23ce0b['id'];return db[_0x12fa('0x71')]['create'](_0x53b838[_0x12fa('0x61')]);}})['then'](respondWithResult(_0x5a7453,null))['catch'](handleError(_0x5a7453,null));};exports['getAnswers']=function(_0x4b9099,_0x3f01dd){var _0x37a142={'raw':![],'where':{}};var _0x1cdf52={};var _0xbcacc2={'count':0x0,'rows':[]};return db[_0x12fa('0x49')][_0x12fa('0x6a')]({'where':{'id':_0x4b9099[_0x12fa('0x5e')]['id']}})[_0x12fa('0x13')](handleEntityNotFound(_0x3f01dd,null))[_0x12fa('0x13')](function(_0x1b9265){if(_0x1b9265){_0x1cdf52[_0x12fa('0x4d')]=_[_0x12fa('0x5f')](db[_0x12fa('0x71')][_0x12fa('0x60')]);_0x1cdf52[_0x12fa('0x4e')]=_[_0x12fa('0x5f')](_0x4b9099['query']);_0x1cdf52[_0x12fa('0x4f')]=_[_0x12fa('0x51')](_0x1cdf52['model'],_0x1cdf52[_0x12fa('0x4e')]);_0x37a142[_0x12fa('0x50')]=_[_0x12fa('0x51')](_0x1cdf52['model'],qs['fields'](_0x4b9099[_0x12fa('0x4e')][_0x12fa('0x52')]));_0x37a142[_0x12fa('0x50')]=_0x37a142[_0x12fa('0x50')][_0x12fa('0x53')]?_0x37a142[_0x12fa('0x50')]:_0x1cdf52[_0x12fa('0x4d')];if(!_0x4b9099[_0x12fa('0x4e')][_0x12fa('0x6b')](_0x12fa('0x6c'))){_0x37a142[_0x12fa('0x23')]=qs['limit'](_0x4b9099[_0x12fa('0x4e')][_0x12fa('0x23')]);_0x37a142[_0x12fa('0x22')]=qs['offset'](_0x4b9099[_0x12fa('0x4e')][_0x12fa('0x22')]);}_0x37a142[_0x12fa('0x54')]=qs[_0x12fa('0x55')](_0x4b9099[_0x12fa('0x4e')]['sort']);_0x37a142[_0x12fa('0x56')]=qs['filters'](_['pick'](_0x4b9099['query'],_0x1cdf52[_0x12fa('0x4f')]));_0x37a142[_0x12fa('0x56')][_0x12fa('0x67')]=_0x1b9265['id'];if(_0x4b9099[_0x12fa('0x4e')]['filter']){_0x37a142[_0x12fa('0x56')]=_[_0x12fa('0x59')](_0x37a142[_0x12fa('0x56')],{'$or':_['map'](_0x37a142[_0x12fa('0x50')],function(_0x525497){var _0xe3aee4={};_0xe3aee4[_0x525497]={'$like':'%'+_0x4b9099[_0x12fa('0x4e')][_0x12fa('0x58')]+'%'};return _0xe3aee4;})});}_0x37a142=_[_0x12fa('0x59')]({},_0x37a142,_0x4b9099[_0x12fa('0x5a')]);return db[_0x12fa('0x71')][_0x12fa('0x21')]({'where':_0x37a142[_0x12fa('0x56')]})[_0x12fa('0x13')](function(_0x5de2c3){_0xbcacc2[_0x12fa('0x21')]=_0x5de2c3;if(_0x4b9099[_0x12fa('0x4e')][_0x12fa('0x5b')]){_0x37a142[_0x12fa('0x5c')]=[{'all':!![]}];}return db[_0x12fa('0x71')][_0x12fa('0x6d')](_0x37a142);})[_0x12fa('0x13')](function(_0x3f0389){_0xbcacc2[_0x12fa('0x5d')]=_0x3f0389;return _0xbcacc2;});}})[_0x12fa('0x13')](respondWithFilteredResult(_0x3f01dd,_0x37a142))[_0x12fa('0x1b')](handleError(_0x3f01dd,null));};exports['removeAnswers']=function(_0x46e290,_0xe4910b){return db[_0x12fa('0x49')][_0x12fa('0x63')]({'where':{'id':_0x46e290[_0x12fa('0x5e')]['id']}})[_0x12fa('0x13')](handleEntityNotFound(_0xe4910b,null))[_0x12fa('0x13')](function(_0x409a64){if(_0x409a64){return _0x409a64['removeAnswers'](_0x46e290[_0x12fa('0x4e')][_0x12fa('0x6f')]);}})[_0x12fa('0x13')](respondWithStatusCode(_0xe4910b,null))['catch'](handleError(_0xe4910b,null));};exports['create']=function(_0x3073e5,_0x3d0f63){var _0x283c81={'name':_0x3073e5[_0x12fa('0x61')][_0x12fa('0x29')],'key':_0x3073e5['body'][_0x12fa('0x4c')],'provider':_0x3073e5['body'][_0x12fa('0x62')]===_0x12fa('0x72')?null:_0x3073e5[_0x12fa('0x61')][_0x12fa('0x62')],'email':_0x3073e5[_0x12fa('0x61')]['email'],'ListId':_0x3073e5['body'][_0x12fa('0x73')],'active':!_[_0x12fa('0x74')](_0x3073e5[_0x12fa('0x61')][_0x12fa('0x75')])?_0x3073e5[_0x12fa('0x61')][_0x12fa('0x75')]:!![],'description':_0x3073e5['body'][_0x12fa('0x76')]||null};var _0x315171=getAuthenticationOptions(_0x283c81[_0x12fa('0x62')],_0x3073e5[_0x12fa('0x61')]);_0x283c81[_0x12fa('0x41')]=_0x315171[_0x12fa('0x41')];_0x283c81['Smtp']=_0x315171[_0x12fa('0x42')];return db[_0x12fa('0x49')][_0x12fa('0x77')](_0x283c81,{'include':[{'model':db[_0x12fa('0x45')],'as':_0x12fa('0x42')},{'model':db[_0x12fa('0x44')],'as':'Imap'}]})['then'](function(_0x23384b){var _0x28d26d=_0x3073e5[_0x12fa('0x37')][_0x12fa('0x28')]({'plain':!![]});if(!_0x28d26d)throw new Error(_0x12fa('0x78'));if(_0x28d26d['role']===_0x12fa('0x37')){var _0x22929f=_0x23384b['get']({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0x12fa('0x79'),'userProfileId':_0x28d26d[_0x12fa('0x7a')]},'raw':!![]})[_0x12fa('0x13')](function(_0x4b3aa5){if(_0x4b3aa5&&_0x4b3aa5[_0x12fa('0x7b')]===0x0){return db['UserProfileResource'][_0x12fa('0x77')]({'name':_0x22929f[_0x12fa('0x29')],'resourceId':_0x22929f['id'],'type':_0x4b3aa5[_0x12fa('0x29')],'sectionId':_0x4b3aa5['id']},{})[_0x12fa('0x13')](function(){return _0x23384b;});}else{return _0x23384b;}})[_0x12fa('0x1b')](function(_0x360a23){logger[_0x12fa('0x17')](_0x12fa('0x7c'),_0x360a23);throw _0x360a23;});}return _0x23384b;})[_0x12fa('0x13')](respondWithResult(_0x3d0f63,0xc9))[_0x12fa('0x1b')](handleError(_0x3d0f63,null));};exports['getImap']=function(_0x197ad8,_0x14335f){return db[_0x12fa('0x49')][_0x12fa('0x6a')]({'where':{'id':_0x197ad8[_0x12fa('0x5e')]['id']}})[_0x12fa('0x13')](handleEntityNotFound(_0x14335f,null))[_0x12fa('0x13')](function(_0x2bb7e){if(_0x2bb7e){return _0x2bb7e[_0x12fa('0x7d')]();}return null;})['then'](respondWithResult(_0x14335f,null))['catch'](handleError(_0x14335f,null));};exports[_0x12fa('0x7e')]=function(_0x3f5be7,_0x556238){if(_0x3f5be7[_0x12fa('0x61')]['id']){delete _0x3f5be7[_0x12fa('0x61')]['id'];}return db[_0x12fa('0x49')][_0x12fa('0x63')]({'where':{'id':_0x3f5be7[_0x12fa('0x5e')]['id']}})['then'](handleEntityNotFound(_0x556238,null))[_0x12fa('0x13')](function(_0x1094d4){if(_0x1094d4){_0x3f5be7['body'][_0x12fa('0x67')]=_0x1094d4['id'];return db[_0x12fa('0x44')][_0x12fa('0x77')](_0x3f5be7[_0x12fa('0x61')]);}})[_0x12fa('0x13')](respondWithResult(_0x556238,null))[_0x12fa('0x1b')](handleError(_0x556238,null));};exports[_0x12fa('0x7f')]=function(_0x425152,_0x136ceb){return db[_0x12fa('0x49')][_0x12fa('0x6a')]({'where':{'id':_0x425152[_0x12fa('0x5e')]['id']}})[_0x12fa('0x13')](handleEntityNotFound(_0x136ceb,null))[_0x12fa('0x13')](function(_0x28ac77){if(_0x28ac77){return _0x28ac77[_0x12fa('0x80')](null);}return null;})[_0x12fa('0x13')](respondWithStatusCode(_0x136ceb,null))['catch'](handleError(_0x136ceb,null));};exports['getSmtp']=function(_0x48e42e,_0x1c0230){return db[_0x12fa('0x49')][_0x12fa('0x6a')]({'where':{'id':_0x48e42e[_0x12fa('0x5e')]['id']}})[_0x12fa('0x13')](handleEntityNotFound(_0x1c0230,null))[_0x12fa('0x13')](function(_0x3dc1f5){if(_0x3dc1f5){return _0x3dc1f5[_0x12fa('0x81')]();}return null;})['then'](respondWithResult(_0x1c0230,null))['catch'](handleError(_0x1c0230,null));};exports['addSmtp']=function(_0x4850e4,_0xd14ce1){if(_0x4850e4[_0x12fa('0x61')]['id']){delete _0x4850e4['body']['id'];}return db['MailAccount'][_0x12fa('0x63')]({'where':{'id':_0x4850e4['params']['id']}})[_0x12fa('0x13')](handleEntityNotFound(_0xd14ce1,null))[_0x12fa('0x13')](function(_0x264bef){if(_0x264bef){_0x4850e4[_0x12fa('0x61')][_0x12fa('0x67')]=_0x264bef['id'];return db[_0x12fa('0x45')][_0x12fa('0x77')](_0x4850e4[_0x12fa('0x61')]);}})[_0x12fa('0x13')](respondWithResult(_0xd14ce1,null))[_0x12fa('0x1b')](handleError(_0xd14ce1,null));};exports[_0x12fa('0x82')]=function(_0x2d1875,_0x38d2fb){return db[_0x12fa('0x49')][_0x12fa('0x6a')]({'where':{'id':_0x2d1875['params']['id']}})['then'](handleEntityNotFound(_0x38d2fb,null))['then'](function(_0x2ab19c){if(_0x2ab19c){return _0x2ab19c[_0x12fa('0x83')](null);}return null;})[_0x12fa('0x13')](respondWithStatusCode(_0x38d2fb,null))[_0x12fa('0x1b')](handleError(_0x38d2fb,null));};exports[_0x12fa('0x84')]=function(_0xa088d8,_0x5d5402){return db[_0x12fa('0x85')][_0x12fa('0x63')]({'where':{'id':_0xa088d8['params']['id']}})[_0x12fa('0x13')](handleEntityNotFound(_0x5d5402,null))[_0x12fa('0x13')](function(_0x255c2f){if(_0x255c2f){return _0x255c2f[_0x12fa('0x84')](_0xa088d8[_0x12fa('0x61')][_0x12fa('0x6f')],_[_0x12fa('0x86')](_0xa088d8[_0x12fa('0x61')],[_0x12fa('0x6f'),'id'])||{});}})[_0x12fa('0x13')](respondWithResult(_0x5d5402,null))['catch'](handleError(_0x5d5402,null));};exports[_0x12fa('0x87')]=function(_0x5bf5e8,_0x50d92b){var _0x2ca612={'raw':![],'where':{}};var _0x153819={};var _0x18f277={'count':0x0,'rows':[]};return db[_0x12fa('0x49')]['findOne']({'where':{'id':_0x5bf5e8[_0x12fa('0x5e')]['id']}})[_0x12fa('0x13')](handleEntityNotFound(_0x50d92b,null))[_0x12fa('0x13')](function(_0x2d475c){if(_0x2d475c){_0x153819[_0x12fa('0x4d')]=_[_0x12fa('0x5f')](db[_0x12fa('0x85')][_0x12fa('0x60')]);_0x153819[_0x12fa('0x4e')]=_['keys'](_0x5bf5e8[_0x12fa('0x4e')]);_0x153819[_0x12fa('0x4f')]=_[_0x12fa('0x51')](_0x153819[_0x12fa('0x4d')],_0x153819[_0x12fa('0x4e')]);_0x2ca612[_0x12fa('0x50')]=_[_0x12fa('0x51')](_0x153819[_0x12fa('0x4d')],qs['fields'](_0x5bf5e8[_0x12fa('0x4e')][_0x12fa('0x52')]));_0x2ca612[_0x12fa('0x50')]=_0x2ca612[_0x12fa('0x50')][_0x12fa('0x53')]?_0x2ca612['attributes']:_0x153819[_0x12fa('0x4d')];if(!_0x5bf5e8[_0x12fa('0x4e')][_0x12fa('0x6b')]('nolimit')){_0x2ca612[_0x12fa('0x23')]=qs['limit'](_0x5bf5e8['query'][_0x12fa('0x23')]);_0x2ca612[_0x12fa('0x22')]=qs[_0x12fa('0x22')](_0x5bf5e8[_0x12fa('0x4e')]['offset']);}_0x2ca612[_0x12fa('0x54')]=qs['sort'](_0x5bf5e8[_0x12fa('0x4e')]['sort']);_0x2ca612[_0x12fa('0x56')]=qs['filters'](_[_0x12fa('0x57')](_0x5bf5e8[_0x12fa('0x4e')],_0x153819[_0x12fa('0x4f')]));_0x2ca612[_0x12fa('0x56')][_0x12fa('0x67')]=_0x2d475c['id'];if(_0x5bf5e8[_0x12fa('0x4e')][_0x12fa('0x58')]){_0x2ca612[_0x12fa('0x56')]=_[_0x12fa('0x59')](_0x2ca612['where'],{'$or':_[_0x12fa('0x48')](_0x2ca612[_0x12fa('0x50')],function(_0x1082b4){var _0x2cbaeb={};_0x2cbaeb[_0x1082b4]={'$like':'%'+_0x5bf5e8['query'][_0x12fa('0x58')]+'%'};return _0x2cbaeb;})});}_0x2ca612=_[_0x12fa('0x59')]({},_0x2ca612,_0x5bf5e8[_0x12fa('0x5a')]);return db['MailInteraction']['count']({'where':_0x2ca612[_0x12fa('0x56')]})[_0x12fa('0x13')](function(_0x1a6118){_0x18f277[_0x12fa('0x21')]=_0x1a6118;if(_0x5bf5e8[_0x12fa('0x4e')]['includeAll']){_0x2ca612[_0x12fa('0x5c')]=[{'model':db[_0x12fa('0x88')],'as':_0x12fa('0x89'),'required':![]},{'model':db[_0x12fa('0x8a')],'as':_0x12fa('0x8b'),'attributes':[_0x12fa('0x29'),_0x12fa('0x8c'),_0x12fa('0x8d')],'required':![]},{'model':db['Tag'],'as':_0x12fa('0x8e'),'attributes':['id',_0x12fa('0x29'),_0x12fa('0x8f')],'where':_0x5bf5e8[_0x12fa('0x4e')]['tag']?{'id':_0x5bf5e8['query']['tag']}:undefined,'required':_0x5bf5e8[_0x12fa('0x4e')][_0x12fa('0x90')]?!![]:![]}];}return db['MailInteraction'][_0x12fa('0x6d')](_0x2ca612);})['then'](function(_0x4538aa){_0x18f277[_0x12fa('0x5d')]=_0x4538aa;return _0x18f277;});}})['then'](respondWithFilteredResult(_0x50d92b,_0x2ca612))[_0x12fa('0x1b')](handleError(_0x50d92b,null));};exports[_0x12fa('0x91')]=function addApplications(_0x53e46e,_0xb4a55c){var _0x5de13a=_0x53e46e['params']['id'];var _0x3dfd4e=_0x53e46e[_0x12fa('0x61')];var _0x5e029c=0xc8;var _0x56eb25=null;return db[_0x12fa('0x92')][_0x12fa('0x93')]({'isolationLevel':db['sequelize'][_0x12fa('0x94')][_0x12fa('0x95')]['READ_COMMITTED']},function(_0x3d3cd4){return db[_0x12fa('0x49')][_0x12fa('0x6a')]({'where':{'id':_0x5de13a},'transaction':_0x3d3cd4})[_0x12fa('0x13')](function(_0x188ca0){if(_0x188ca0){return db[_0x12fa('0x96')][_0x12fa('0x27')]({'where':{'MailAccountId':_0x5de13a},'transaction':_0x3d3cd4})[_0x12fa('0x13')](function(){var _0x20670a=_[_0x12fa('0x48')](_0x3dfd4e,function(_0x23d31){_0x23d31['MailAccountId']=_0x5de13a;return _0x23d31;});return db[_0x12fa('0x96')][_0x12fa('0x97')](_0x20670a,{'transaction':_0x3d3cd4});});}else{_0x5e029c=0x194;_0x56eb25=[];}});})[_0x12fa('0x13')](function(){if(_0x5e029c!==0x194){return db[_0x12fa('0x96')][_0x12fa('0x98')]({'where':{'MailAccountId':_0x5de13a},'order':_0x12fa('0x99')})[_0x12fa('0x13')](function(_0xc531ce){_0x56eb25=_0xc531ce;});}})['catch'](function(_0x1ac380){_0x5e029c=0x1f4;logger[_0x12fa('0x17')](_0x1ac380[_0x12fa('0x9a')]);if(_0x1ac380[_0x12fa('0x29')]){delete _0x1ac380[_0x12fa('0x29')];}_0x56eb25=_0x1ac380;})['finally'](function(){if(_0x56eb25===null){_0xb4a55c['sendStatus'](_0x5e029c);}else{if(_0x5e029c===0x1f4){_0xb4a55c['status'](_0x5e029c)[_0x12fa('0x2a')](_0x56eb25);}else{_0xb4a55c[_0x12fa('0x1d')](_0x5e029c)[_0x12fa('0x1f')](_0x56eb25);}}});};exports[_0x12fa('0x9b')]=function(_0x47058b,_0x2387ff){var _0x533de7={};var _0x5855c4={};var _0x540db3;var _0x48b86e;return db[_0x12fa('0x49')]['findOne']({'where':{'id':_0x47058b[_0x12fa('0x5e')]['id']}})[_0x12fa('0x13')](handleEntityNotFound(_0x2387ff,null))[_0x12fa('0x13')](function(_0x152c5c){if(_0x152c5c){_0x540db3=_0x152c5c;_0x5855c4[_0x12fa('0x4d')]=_[_0x12fa('0x5f')](db[_0x12fa('0x96')][_0x12fa('0x60')]);_0x5855c4[_0x12fa('0x4e')]=_['keys'](_0x47058b[_0x12fa('0x4e')]);_0x5855c4[_0x12fa('0x4f')]=_[_0x12fa('0x51')](_0x5855c4[_0x12fa('0x4d')],_0x5855c4[_0x12fa('0x4e')]);_0x533de7[_0x12fa('0x50')]=_[_0x12fa('0x51')](_0x5855c4['model'],qs[_0x12fa('0x52')](_0x47058b['query']['fields']));_0x533de7[_0x12fa('0x50')]=_0x533de7[_0x12fa('0x50')][_0x12fa('0x53')]?_0x533de7['attributes']:_0x5855c4['model'];_0x533de7[_0x12fa('0x54')]=qs[_0x12fa('0x55')](_0x47058b[_0x12fa('0x4e')][_0x12fa('0x55')]);_0x533de7[_0x12fa('0x56')]=qs[_0x12fa('0x4f')](_['pick'](_0x47058b[_0x12fa('0x4e')],_0x5855c4['filters']));if(_0x47058b[_0x12fa('0x4e')][_0x12fa('0x58')]){_0x533de7['where']=_[_0x12fa('0x59')](_0x533de7[_0x12fa('0x56')],{'$or':_[_0x12fa('0x48')](_0x533de7[_0x12fa('0x50')],function(_0x2c6b3c){var _0x1b2dd3={};_0x1b2dd3[_0x2c6b3c]={'$like':'%'+_0x47058b[_0x12fa('0x4e')][_0x12fa('0x58')]+'%'};return _0x1b2dd3;})});}_0x533de7=_[_0x12fa('0x59')]({},_0x533de7,_0x47058b[_0x12fa('0x5a')]);return _0x540db3['getApplications'](_0x533de7);}})[_0x12fa('0x13')](function(_0x578667){if(_0x578667){_0x48b86e=_0x578667[_0x12fa('0x53')];if(!_0x47058b['query'][_0x12fa('0x6b')]('nolimit')){_0x533de7[_0x12fa('0x23')]=qs['limit'](_0x47058b[_0x12fa('0x4e')]['limit']);_0x533de7[_0x12fa('0x22')]=qs[_0x12fa('0x22')](_0x47058b[_0x12fa('0x4e')][_0x12fa('0x22')]);}return _0x540db3['getApplications'](_0x533de7);}})[_0x12fa('0x13')](function(_0x5e12f1){if(_0x5e12f1){return _0x5e12f1?{'count':_0x48b86e,'rows':_0x5e12f1}:null;}})[_0x12fa('0x13')](respondWithResult(_0x2387ff,null))[_0x12fa('0x1b')](handleError(_0x2387ff,null));};exports[_0x12fa('0x9c')]=function(_0x3ee2d9,_0x26fed8){var _0x1c61db={'raw':!![],'where':{}};var _0x862366={};var _0x53dd91={'count':0x0,'rows':[]};return db[_0x12fa('0x49')][_0x12fa('0x6a')]({'where':{'id':_0x3ee2d9[_0x12fa('0x5e')]['id']}})[_0x12fa('0x13')](handleEntityNotFound(_0x26fed8,null))['then'](function(_0x2f8387){if(_0x2f8387){_0x862366[_0x12fa('0x4d')]=_[_0x12fa('0x5f')](db[_0x12fa('0x9d')][_0x12fa('0x60')]);_0x862366[_0x12fa('0x4e')]=_['keys'](_0x3ee2d9[_0x12fa('0x4e')]);_0x862366[_0x12fa('0x4f')]=_[_0x12fa('0x51')](_0x862366[_0x12fa('0x4d')],_0x862366['query']);_0x1c61db['attributes']=_['intersection'](_0x862366[_0x12fa('0x4d')],qs[_0x12fa('0x52')](_0x3ee2d9['query']['fields']));_0x1c61db[_0x12fa('0x50')]=_0x1c61db[_0x12fa('0x50')]['length']?_0x1c61db[_0x12fa('0x50')]:_0x862366[_0x12fa('0x4d')];if(!_0x3ee2d9[_0x12fa('0x4e')][_0x12fa('0x6b')](_0x12fa('0x6c'))){_0x1c61db[_0x12fa('0x23')]=qs['limit'](_0x3ee2d9[_0x12fa('0x4e')][_0x12fa('0x23')]);_0x1c61db[_0x12fa('0x22')]=qs[_0x12fa('0x22')](_0x3ee2d9[_0x12fa('0x4e')]['offset']);}_0x1c61db[_0x12fa('0x54')]=qs[_0x12fa('0x55')](_0x3ee2d9[_0x12fa('0x4e')][_0x12fa('0x55')]);_0x1c61db['where']=qs['filters'](_[_0x12fa('0x57')](_0x3ee2d9[_0x12fa('0x4e')],_0x862366[_0x12fa('0x4f')]));_0x1c61db[_0x12fa('0x56')][_0x12fa('0x67')]=_0x2f8387['id'];if(_0x3ee2d9[_0x12fa('0x4e')][_0x12fa('0x58')]){_0x1c61db[_0x12fa('0x56')]=_[_0x12fa('0x59')](_0x1c61db['where'],{'$or':_[_0x12fa('0x48')](_0x1c61db[_0x12fa('0x50')],function(_0x1c185b){var _0x383d16={};_0x383d16[_0x1c185b]={'$like':'%'+_0x3ee2d9[_0x12fa('0x4e')][_0x12fa('0x58')]+'%'};return _0x383d16;})});}if(_0x3ee2d9[_0x12fa('0x4e')][_0x12fa('0x9e')]){var _0x20316e=_0x3ee2d9[_0x12fa('0x4e')]['$gte'][_0x12fa('0x9f')](',');var _0x3a319f={};_0x3a319f[_0x20316e[0x0]]={'$gte':moment(_0x20316e[0x1])[_0x12fa('0xa0')](_0x12fa('0xa1'))};_0x1c61db[_0x12fa('0x56')]=_['merge'](_0x1c61db['where'],_0x3a319f);}_0x1c61db=_['merge']({},_0x1c61db,_0x3ee2d9[_0x12fa('0x5a')]);return db['MailMessage'][_0x12fa('0x21')]({'where':_0x1c61db['where']})[_0x12fa('0x13')](function(_0x43ee61){_0x53dd91[_0x12fa('0x21')]=_0x43ee61;if(_0x3ee2d9[_0x12fa('0x4e')]['includeAll']){_0x1c61db['include']=[{'all':!![]}];}return db['MailMessage'][_0x12fa('0x6d')](_0x1c61db);})[_0x12fa('0x13')](function(_0x1717e9){if(_0x3ee2d9[_0x12fa('0x4e')][_0x12fa('0xa2')]===_0x12fa('0xa3')){for(var _0x1d8755=0x0;_0x1d8755<_0x1717e9['length'];_0x1d8755++){_0x1717e9[_0x1d8755]['body']=juice(_0x1717e9[_0x1d8755][_0x12fa('0x61')]);}}_0x53dd91[_0x12fa('0x5d')]=_0x1717e9;return _0x53dd91;});}})[_0x12fa('0x13')](respondWithFilteredResult(_0x26fed8,_0x1c61db))[_0x12fa('0x1b')](handleError(_0x26fed8,null));};exports[_0x12fa('0x2a')]=function(_0x417239,_0x2d9343){var _0x4383cb,_0x8e9aac={},_0x63d0a9;if(_0x417239['body']['to']){_0x63d0a9=_0x417239[_0x12fa('0x61')]['to'][_0x12fa('0x9f')](',')[0x0];}return db[_0x12fa('0x49')]['find']({'where':{'id':_0x417239[_0x12fa('0x5e')]['id']},'include':[{'model':db[_0x12fa('0xa4')],'as':_0x12fa('0xa5'),'include':[{'model':db[_0x12fa('0x88')],'as':_0x12fa('0xa6'),'where':{'email':_0x63d0a9},'limit':0x1,'order':[[_0x12fa('0xa7'),_0x12fa('0xa8')]]}]},{'model':db[_0x12fa('0x45')],'as':_0x12fa('0x42'),'raw':!![],'include':[{'model':db[_0x12fa('0xa9')],'as':_0x12fa('0xa9'),'raw':!![]}]}]})[_0x12fa('0x13')](handleEntityNotFound(_0x2d9343,null))['then'](function(_0x23d9fb){if(!_0x23d9fb)return;_0x4383cb=_0x23d9fb;if(!_0x23d9fb[_0x12fa('0x42')])throw new Error(_0x12fa('0xaa'));if(_[_0x12fa('0x74')](_0x417239['body'][_0x12fa('0xab')])){_0x417239[_0x12fa('0x61')][_0x12fa('0xab')]=util[_0x12fa('0xa0')](_0x12fa('0xac'),_0x23d9fb[_0x12fa('0x29')],_0x23d9fb[_0x12fa('0xad')]||_0x23d9fb[_0x12fa('0x42')][_0x12fa('0x37')]);}if(_0x417239['body'][_0x12fa('0xae')]&&_0x417239[_0x12fa('0x61')]['attachments']['length']){for(var _0x440461=0x0;_0x440461<_0x417239[_0x12fa('0x61')][_0x12fa('0xae')][_0x12fa('0x53')];_0x440461+=0x1){_0x417239[_0x12fa('0x61')]['attachments'][_0x440461]={'filename':_0x417239[_0x12fa('0x61')][_0x12fa('0xae')][_0x440461][_0x12fa('0x29')],'path':path[_0x12fa('0xaf')](config[_0x12fa('0xb0')],_0x12fa('0xb1'),_0x417239['body'][_0x12fa('0xae')][_0x440461][_0x12fa('0xb2')])};}}var _0x23e776=_0x23d9fb['getSmtpOptions']();return respondWithRpcPromise(_0x12fa('0xb3'),_0x12fa('0xb4'),{'account':_0x23e776,'message':_0x417239[_0x12fa('0x61')]});})[_0x12fa('0x13')](function(_0x1c9b2c){if(!_0x1c9b2c)return;_0x8e9aac=_0x1c9b2c;if(!_0x4383cb[_0x12fa('0xa5')])throw new Error(_0x12fa('0xb5'));if(_0x4383cb['List'][_0x12fa('0xa6')][_0x12fa('0x53')])return _0x4383cb[_0x12fa('0xa5')][_0x12fa('0xa6')][0x0];return db[_0x12fa('0x88')][_0x12fa('0x77')](_[_0x12fa('0xb')](_0x417239['body'],{'firstName':_0x417239[_0x12fa('0x61')]['to'],'email':_0x417239[_0x12fa('0x61')]['to'],'phone':_0x417239[_0x12fa('0x61')]['to'],'ListId':_0x4383cb[_0x12fa('0x73')]}));})['then'](function(_0x9522e7){if(!_0x9522e7)return;var _0x6b9e9={'UserId':_0x417239[_0x12fa('0x37')]['id'],'ContactId':_0x9522e7['id'],'MailAccountId':_0x4383cb['id'],'inReplyTo':_0x8e9aac[_0x12fa('0xb6')],'to':_0x417239[_0x12fa('0x61')]['from'],'cc':_0x417239['body']['cc'],'subject':_0x417239[_0x12fa('0x61')]['subject'],'attach':_0x417239['body']['attach'],'firstMsgDirection':'out','lastMsgAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':_0x12fa('0xb7'),'Messages':[_[_0x12fa('0x59')](_0x417239[_0x12fa('0x61')],{'messageId':_0x8e9aac['messageId'],'sentAt':moment()[_0x12fa('0xa0')](_0x12fa('0xa1')),'read':!![],'MailAccountId':_0x4383cb['id'],'UserId':_0x417239['user']['id'],'ContactId':_0x9522e7['id']})]};if(_0x417239['body'][_0x12fa('0xb8')]){_0x6b9e9=_['merge'](_0x6b9e9,_0x417239[_0x12fa('0x61')][_0x12fa('0xb8')]);}return db[_0x12fa('0x85')][_0x12fa('0x77')](_0x6b9e9,{'include':[{'model':db[_0x12fa('0x9d')],'as':'Messages'}]});})[_0x12fa('0x13')](respondWithResult(_0x2d9343,null))[_0x12fa('0x1b')](handleError(_0x2d9343,null));};exports[_0x12fa('0xb9')]=function(_0x1a8e65,_0x5a8c2c){return db[_0x12fa('0x49')][_0x12fa('0x63')]({'where':{'id':_0x1a8e65['params']['id']},'include':[{'model':db[_0x12fa('0x45')],'as':_0x12fa('0x42'),'raw':!![],'include':[{'model':db[_0x12fa('0xa9')],'as':_0x12fa('0xa9'),'raw':!![]}]}]})['then'](handleEntityNotFound(_0x5a8c2c,null))[_0x12fa('0x13')](function(_0xcc2dee){if(!_0xcc2dee[_0x12fa('0x42')])return;var _0x84da29=_0xcc2dee[_0x12fa('0xba')]();return respondWithRpcPromise(_0x12fa('0xbb'),_0x12fa('0xb9'),{'account':_0x84da29});})[_0x12fa('0x13')](respondWithResult(_0x5a8c2c,null))[_0x12fa('0x1b')](handleError(_0x5a8c2c,null));};exports[_0x12fa('0x27')]=function(_0xf82fa5,_0xdcacac){return db[_0x12fa('0x49')][_0x12fa('0x63')]({'where':{'id':_0xf82fa5[_0x12fa('0x5e')]['id']}})['then'](handleEntityNotFound(_0xdcacac,null))['then'](function(_0x4fdf69){if(_0x4fdf69&&_0x4fdf69['service']){throw new db[(_0x12fa('0xbc'))][(_0x12fa('0xbd'))]('You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account');}return _0x4fdf69;})[_0x12fa('0x13')](removeEntity(_0xdcacac,null))['catch'](handleError(_0xdcacac,null));};exports[_0x12fa('0xbe')]=function(_0x768bd9,_0x461259){return db['MailAccount']['find']({'where':{'id':_0x768bd9[_0x12fa('0x5e')]['id']}})[_0x12fa('0x13')](handleEntityNotFound(_0x461259,null))['then'](function(_0xb88d7){if(_0xb88d7){return _0xb88d7[_0x12fa('0xbe')](_0x768bd9[_0x12fa('0x61')]['ids'],_['omit'](_0x768bd9[_0x12fa('0x61')],[_0x12fa('0x6f'),'id'])||{})['spread'](function(_0x3d68da){for(var _0x33d9be=0x0;_0x33d9be<_0x768bd9['body'][_0x12fa('0x6f')]['length'];_0x33d9be+=0x1){socket[_0x12fa('0xbf')](_0x12fa('0xc0'),{'UserId':Number(_0x768bd9[_0x12fa('0x61')][_0x12fa('0x6f')][_0x33d9be]),'MailAccountId':Number(_0x768bd9['params']['id'])});}return _0x3d68da;});}})[_0x12fa('0x13')](respondWithResult(_0x461259,null))[_0x12fa('0x1b')](handleError(_0x461259,null));};exports[_0x12fa('0xc1')]=function(_0x28de42,_0xc4f060){return db[_0x12fa('0x49')][_0x12fa('0x63')]({'where':{'id':_0x28de42[_0x12fa('0x5e')]['id']}})['then'](handleEntityNotFound(_0xc4f060,null))['then'](function(_0x10f943){if(_0x10f943){return _0x10f943[_0x12fa('0xc1')](_0x28de42[_0x12fa('0x4e')][_0x12fa('0x6f')])[_0x12fa('0x13')](function(){if(_[_0x12fa('0xc2')](_0x28de42['query']['ids'])){for(var _0x40f690=0x0;_0x40f690<_0x28de42[_0x12fa('0x4e')]['ids']['length'];_0x40f690+=0x1){socket[_0x12fa('0xbf')](_0x12fa('0xc3'),{'UserId':Number(_0x28de42['query'][_0x12fa('0x6f')][_0x40f690]),'MailAccountId':Number(_0x28de42[_0x12fa('0x5e')]['id'])});}}else{socket['emit'](_0x12fa('0xc3'),{'UserId':Number(_0x28de42[_0x12fa('0x4e')]['ids']),'MailAccountId':Number(_0x28de42['params']['id'])});}});}})[_0x12fa('0x13')](respondWithStatusCode(_0xc4f060,null))[_0x12fa('0x1b')](handleError(_0xc4f060,null));};exports[_0x12fa('0xc4')]=function(_0x508089,_0x1066ae){var _0x1bf3c4={};var _0x3115a8={};var _0x72dd3f;var _0x598810;return db[_0x12fa('0x49')][_0x12fa('0x6a')]({'where':{'id':_0x508089['params']['id']}})[_0x12fa('0x13')](handleEntityNotFound(_0x1066ae,null))[_0x12fa('0x13')](function(_0x43fe70){if(_0x43fe70){_0x72dd3f=_0x43fe70;_0x3115a8['model']=_['keys'](db[_0x12fa('0x8a')][_0x12fa('0x60')]);_0x3115a8['query']=_[_0x12fa('0x5f')](_0x508089['query']);_0x3115a8[_0x12fa('0x4f')]=_[_0x12fa('0x51')](_0x3115a8[_0x12fa('0x4d')],_0x3115a8[_0x12fa('0x4e')]);_0x1bf3c4['attributes']=_[_0x12fa('0x51')](_0x3115a8[_0x12fa('0x4d')],qs[_0x12fa('0x52')](_0x508089[_0x12fa('0x4e')][_0x12fa('0x52')]));_0x1bf3c4['attributes']=_0x1bf3c4[_0x12fa('0x50')][_0x12fa('0x53')]?_0x1bf3c4['attributes']:_0x3115a8['model'];_0x1bf3c4[_0x12fa('0x54')]=qs[_0x12fa('0x55')](_0x508089['query'][_0x12fa('0x55')]);_0x1bf3c4[_0x12fa('0x56')]=qs[_0x12fa('0x4f')](_[_0x12fa('0x57')](_0x508089['query'],_0x3115a8[_0x12fa('0x4f')]));if(_0x508089[_0x12fa('0x4e')]['filter']){_0x1bf3c4[_0x12fa('0x56')]=_['merge'](_0x1bf3c4[_0x12fa('0x56')],{'$or':_[_0x12fa('0x48')](_0x1bf3c4[_0x12fa('0x50')],function(_0x4c8672){var _0x1cccfa={};_0x1cccfa[_0x4c8672]={'$like':'%'+_0x508089['query']['filter']+'%'};return _0x1cccfa;})});}_0x1bf3c4=_[_0x12fa('0x59')]({},_0x1bf3c4,_0x508089[_0x12fa('0x5a')]);return _0x72dd3f[_0x12fa('0xc4')](_0x1bf3c4);}})[_0x12fa('0x13')](function(_0x5573d1){if(_0x5573d1){_0x598810=_0x5573d1[_0x12fa('0x53')];if(!_0x508089['query'][_0x12fa('0x6b')]('nolimit')){_0x1bf3c4[_0x12fa('0x23')]=qs[_0x12fa('0x23')](_0x508089[_0x12fa('0x4e')][_0x12fa('0x23')]);_0x1bf3c4['offset']=qs[_0x12fa('0x22')](_0x508089[_0x12fa('0x4e')][_0x12fa('0x22')]);}return _0x72dd3f[_0x12fa('0xc4')](_0x1bf3c4);}})[_0x12fa('0x13')](function(_0x948b3b){if(_0x948b3b){return _0x948b3b?{'count':_0x598810,'rows':_0x948b3b}:null;}})[_0x12fa('0x13')](respondWithResult(_0x1066ae,null))[_0x12fa('0x1b')](handleError(_0x1066ae,null));};
\ No newline at end of file
index 451d33b..01c6814 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2a82=['update','emit','hasOwnProperty','hook','exports','MailAccount'];(function(_0x5777d0,_0x2afcb3){var _0x258fb6=function(_0x3a148b){while(--_0x3a148b){_0x5777d0['push'](_0x5777d0['shift']());}};_0x258fb6(++_0x2afcb3);}(_0x2a82,0xb3));var _0x22a8=function(_0x5ed094,_0x4e3ce5){_0x5ed094=_0x5ed094-0x0;var _0x2bba90=_0x2a82[_0x5ed094];return _0x2bba90;};'use strict';var EventEmitter=require('events');var MailAccount=require('../../mysqldb')['db'][_0x22a8('0x0')];var MailAccountEvents=new EventEmitter();MailAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x22a8('0x1'),'afterDestroy':'remove'};function emitEvent(_0x2819b0){return function(_0x45444b,_0x2a02f6,_0x17d777){MailAccountEvents['emit'](_0x2819b0+':'+_0x45444b['id'],_0x45444b);MailAccountEvents[_0x22a8('0x2')](_0x2819b0,_0x45444b);_0x17d777(null);};}for(var e in events){if(events[_0x22a8('0x3')](e)){var event=events[e];MailAccount[_0x22a8('0x4')](e,emitEvent(event));}}module[_0x22a8('0x5')]=MailAccountEvents;
\ No newline at end of file
+var _0x77a9=['hasOwnProperty','events','MailAccount','save','update','remove','emit'];(function(_0x5e8c3e,_0x4bf1cc){var _0xdd8e99=function(_0x3b23e7){while(--_0x3b23e7){_0x5e8c3e['push'](_0x5e8c3e['shift']());}};_0xdd8e99(++_0x4bf1cc);}(_0x77a9,0x19e));var _0x977a=function(_0x61376b,_0x9d1123){_0x61376b=_0x61376b-0x0;var _0x9dc6fc=_0x77a9[_0x61376b];return _0x9dc6fc;};'use strict';var EventEmitter=require(_0x977a('0x0'));var MailAccount=require('../../mysqldb')['db'][_0x977a('0x1')];var MailAccountEvents=new EventEmitter();MailAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x977a('0x2'),'afterUpdate':_0x977a('0x3'),'afterDestroy':_0x977a('0x4')};function emitEvent(_0x368664){return function(_0x520cd7,_0x318fc8,_0xb755){MailAccountEvents[_0x977a('0x5')](_0x368664+':'+_0x520cd7['id'],_0x520cd7);MailAccountEvents[_0x977a('0x5')](_0x368664,_0x520cd7);_0xb755(null);};}for(var e in events){if(events[_0x977a('0x6')](e)){var event=events[e];MailAccount['hook'](e,emitEvent(event));}}module['exports']=MailAccountEvents;
\ No newline at end of file
index e987baf..65a47a2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf1ba=['provider','custom','service','host','Smtp','port','secure','authentication','modernAuthentication','Cloud\x20Provider\x20configuration\x20not\x20found','user','CloudProvider','data5','auth','pass','define','mail_accounts'];(function(_0x30d87a,_0xf3a07f){var _0x48f64b=function(_0x2078b7){while(--_0x2078b7){_0x30d87a['push'](_0x30d87a['shift']());}};_0x48f64b(++_0xf3a07f);}(_0xf1ba,0x130));var _0xaf1b=function(_0x23b6ab,_0x35b064){_0x23b6ab=_0x23b6ab-0x0;var _0x27a93d=_0xf1ba[_0x23b6ab];return _0x27a93d;};'use strict';var attributes=require('./mailAccount.attributes');module['exports']=function(_0x50065f){return _0x50065f[_0xaf1b('0x0')]('MailAccount',attributes,{'tableName':_0xaf1b('0x1'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x5f1c82=this;var _0x2238bb={'id':_0x5f1c82['id'],'tls':{'rejectUnauthorized':![]}};if(_0x5f1c82[_0xaf1b('0x2')]!==_0xaf1b('0x3')){_0x2238bb[_0xaf1b('0x4')]=_0x5f1c82[_0xaf1b('0x2')];}else{_0x2238bb[_0xaf1b('0x5')]=_0x5f1c82[_0xaf1b('0x6')][_0xaf1b('0x5')];_0x2238bb[_0xaf1b('0x7')]=_0x5f1c82[_0xaf1b('0x6')]['port'];_0x2238bb['secure']=_0x5f1c82[_0xaf1b('0x6')][_0xaf1b('0x8')];}if(_0x5f1c82['Smtp'][_0xaf1b('0x9')]){if(_0x5f1c82[_0xaf1b('0x6')][_0xaf1b('0xa')]){if(!_0x5f1c82['Smtp']['CloudProvider'])throw new Error(_0xaf1b('0xb'));_0x2238bb['auth']={'type':'OAuth2','user':_0x5f1c82[_0xaf1b('0x6')][_0xaf1b('0xc')],'accessToken':_0x5f1c82[_0xaf1b('0x6')][_0xaf1b('0xd')][_0xaf1b('0xe')]};}else{_0x2238bb[_0xaf1b('0xf')]={'user':_0x5f1c82[_0xaf1b('0x6')]['user'],'pass':_0x5f1c82[_0xaf1b('0x6')][_0xaf1b('0x10')]};}}return _0x2238bb;}}});};
\ No newline at end of file
+var _0xe583=['mail_accounts','provider','custom','service','host','port','Smtp','secure','modernAuthentication','CloudProvider','Cloud\x20Provider\x20configuration\x20not\x20found','auth','OAuth2','user','pass','./mailAccount.attributes','MailAccount'];(function(_0x40ac5e,_0x2de228){var _0x2839d6=function(_0x123d47){while(--_0x123d47){_0x40ac5e['push'](_0x40ac5e['shift']());}};_0x2839d6(++_0x2de228);}(_0xe583,0xfd));var _0x3e58=function(_0xd09668,_0x1435b2){_0xd09668=_0xd09668-0x0;var _0x68726=_0xe583[_0xd09668];return _0x68726;};'use strict';var attributes=require(_0x3e58('0x0'));module['exports']=function(_0x553d26){return _0x553d26['define'](_0x3e58('0x1'),attributes,{'tableName':_0x3e58('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x17b42c=this;var _0x138c81={'id':_0x17b42c['id'],'tls':{'rejectUnauthorized':![]}};if(_0x17b42c[_0x3e58('0x3')]!==_0x3e58('0x4')){_0x138c81[_0x3e58('0x5')]=_0x17b42c[_0x3e58('0x3')];}else{_0x138c81[_0x3e58('0x6')]=_0x17b42c['Smtp'][_0x3e58('0x6')];_0x138c81[_0x3e58('0x7')]=_0x17b42c[_0x3e58('0x8')]['port'];_0x138c81['secure']=_0x17b42c['Smtp'][_0x3e58('0x9')];}if(_0x17b42c['Smtp']['authentication']){if(_0x17b42c['Smtp'][_0x3e58('0xa')]){if(!_0x17b42c[_0x3e58('0x8')][_0x3e58('0xb')])throw new Error(_0x3e58('0xc'));_0x138c81[_0x3e58('0xd')]={'type':_0x3e58('0xe'),'user':_0x17b42c['Smtp'][_0x3e58('0xf')],'accessToken':_0x17b42c[_0x3e58('0x8')]['CloudProvider']['data5']};}else{_0x138c81[_0x3e58('0xd')]={'user':_0x17b42c[_0x3e58('0x8')][_0x3e58('0xf')],'pass':_0x17b42c['Smtp'][_0x3e58('0x10')]};}}return _0x138c81;}}});};
\ No newline at end of file
index e8cad7f..f8347eb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x687b=['originTo','originCc','ChatWebsiteId','originChannel','Attachment','Attachments','UserId','agent','name','waitForTheAssignedAgent','Start','startRouting','lodash','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./mailAccount.socket','request','then','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','limit','include','map','model','stringify','catch','ShowMailAccount','find','smtp','setDataValue','getSmtpOptions','NotifyMailAccount','mail','difference','keys','CmContact','rawAttributes','createdAt','CompanyId','body','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','from','account','Contacts','updatedAt','DESC','Applications','MailServerOut','Smtp','CloudProvider','List','omit','applications','list','orderBy','asc','length','close','autoclose','*,*,*,*','ListId','List\x20not\x20found','messageId','subject','attach','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','inReplyTo','create','spread','update','interaction','get','created','contact'];(function(_0x43f8ff,_0x43374a){var _0x3768cb=function(_0x22e6e6){while(--_0x22e6e6){_0x43f8ff['push'](_0x43f8ff['shift']());}};_0x3768cb(++_0x43374a);}(_0x687b,0x14a));var _0xb687=function(_0x1ee938,_0x22267f){_0x1ee938=_0x1ee938-0x0;var _0x3ebf3b=_0x687b[_0x1ee938];return _0x3ebf3b;};'use strict';var _=require(_0xb687('0x0'));var moment=require(_0xb687('0x1'));var BPromise=require(_0xb687('0x2'));var rs=require(_0xb687('0x3'));var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var logger=require(_0xb687('0x4'))(_0xb687('0x5'));var config=require(_0xb687('0x6'));var jayson=require(_0xb687('0x7'));var client=jayson[_0xb687('0x8')][_0xb687('0x9')]({'port':0x232c});config[_0xb687('0xa')]=_[_0xb687('0xb')](config[_0xb687('0xa')],{'host':_0xb687('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb687('0xa')]));require(_0xb687('0xd'))['register'](socket);function respondWithRpcPromise(_0x1a99c5,_0x21e3ab,_0x825ad){return new BPromise(function(_0x15dc9a,_0x404fdb){return client[_0xb687('0xe')](_0x1a99c5,_0x825ad)[_0xb687('0xf')](function(_0xaf4727){logger[_0xb687('0x10')]('MailAccount,\x20%s,\x20%s',_0x21e3ab,_0xb687('0x11'));logger[_0xb687('0x12')](_0xb687('0x13'),_0x21e3ab,_0xb687('0x11'),JSON['stringify'](_0xaf4727));if(_0xaf4727['error']){if(_0xaf4727[_0xb687('0x14')][_0xb687('0x15')]===0x1f4){logger['error'](_0xb687('0x16'),_0x21e3ab,_0xaf4727[_0xb687('0x14')][_0xb687('0x17')]);return _0x404fdb(_0xaf4727[_0xb687('0x14')][_0xb687('0x17')]);}logger[_0xb687('0x14')](_0xb687('0x16'),_0x21e3ab,_0xaf4727[_0xb687('0x14')][_0xb687('0x17')]);return _0x15dc9a(_0xaf4727[_0xb687('0x14')][_0xb687('0x17')]);}else{logger[_0xb687('0x10')]('MailAccount,\x20%s,\x20%s',_0x21e3ab,_0xb687('0x11'));_0x15dc9a(_0xaf4727[_0xb687('0x18')][_0xb687('0x17')]);}})['catch'](function(_0x48958d){logger[_0xb687('0x14')](_0xb687('0x16'),_0x21e3ab,_0x48958d);_0x404fdb(_0x48958d);});});}exports[_0xb687('0x19')]=function(_0x4b593b){var _0x42cdd2=this;return new Promise(function(_0x481f1d,_0x1bd2bf){return db[_0xb687('0x1a')][_0xb687('0x1b')]({'raw':_0x4b593b[_0xb687('0x1c')]?_0x4b593b['options'][_0xb687('0x1d')]===undefined?!![]:![]:!![],'where':_0x4b593b['options']?_0x4b593b[_0xb687('0x1c')][_0xb687('0x1e')]||null:null,'attributes':_0x4b593b[_0xb687('0x1c')]?_0x4b593b['options'][_0xb687('0x1f')]||null:null,'limit':_0x4b593b[_0xb687('0x1c')]?_0x4b593b[_0xb687('0x1c')][_0xb687('0x20')]||null:null,'include':_0x4b593b[_0xb687('0x1c')]?_0x4b593b[_0xb687('0x1c')][_0xb687('0x21')]?_[_0xb687('0x22')](_0x4b593b['options'][_0xb687('0x21')],function(_0x129347){return{'model':db[_0x129347[_0xb687('0x23')]],'as':_0x129347['as'],'attributes':_0x129347[_0xb687('0x1f')],'include':_0x129347[_0xb687('0x21')]?_[_0xb687('0x22')](_0x129347[_0xb687('0x21')],function(_0x3cb2f2){return{'model':db[_0x3cb2f2[_0xb687('0x23')]],'as':_0x3cb2f2['as'],'attributes':_0x3cb2f2[_0xb687('0x1f')],'include':_0x3cb2f2['include']?_[_0xb687('0x22')](_0x3cb2f2[_0xb687('0x21')],function(_0x392721){return{'model':db[_0x392721[_0xb687('0x23')]],'as':_0x392721['as'],'attributes':_0x392721[_0xb687('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xb687('0xf')](function(_0x4e9a06){logger[_0xb687('0x10')]('GetMailAccount',_0x4b593b);logger[_0xb687('0x12')](_0xb687('0x19'),_0x4b593b,JSON[_0xb687('0x24')](_0x4e9a06));_0x481f1d(_0x4e9a06);})[_0xb687('0x25')](function(_0x1ad3ef){logger[_0xb687('0x14')](_0xb687('0x19'),_0x1ad3ef['message'],_0x4b593b);_0x1bd2bf(_0x42cdd2[_0xb687('0x14')](0x1f4,_0x1ad3ef[_0xb687('0x17')]));});});};exports[_0xb687('0x26')]=function(_0x22cd1d){var _0xa18fec=this;return new Promise(function(_0x263834,_0x44be88){return db[_0xb687('0x1a')][_0xb687('0x27')]({'raw':_0x22cd1d[_0xb687('0x1c')]?_0x22cd1d[_0xb687('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x22cd1d['options']?_0x22cd1d[_0xb687('0x1c')][_0xb687('0x1e')]||null:null,'attributes':_0x22cd1d[_0xb687('0x1c')]?_0x22cd1d[_0xb687('0x1c')]['attributes']||null:null,'include':_0x22cd1d['options']?_0x22cd1d[_0xb687('0x1c')][_0xb687('0x21')]?_['map'](_0x22cd1d[_0xb687('0x1c')][_0xb687('0x21')],function(_0x548b83){return{'model':db[_0x548b83[_0xb687('0x23')]],'as':_0x548b83['as'],'attributes':_0x548b83['attributes'],'include':_0x548b83[_0xb687('0x21')]?_[_0xb687('0x22')](_0x548b83[_0xb687('0x21')],function(_0x3e146a){return{'model':db[_0x3e146a[_0xb687('0x23')]],'as':_0x3e146a['as'],'attributes':_0x3e146a[_0xb687('0x1f')],'include':_0x3e146a['include']?_[_0xb687('0x22')](_0x3e146a[_0xb687('0x21')],function(_0x2a73df){return{'model':db[_0x2a73df[_0xb687('0x23')]],'as':_0x2a73df['as'],'attributes':_0x2a73df['attributes']};}):[]};}):[]};}):[]:[]})[_0xb687('0xf')](function(_0x100f4a){if(_0x22cd1d[_0xb687('0x1c')][_0xb687('0x28')]===!![])_0x100f4a[_0xb687('0x29')]('smtpOptions',_0x100f4a[_0xb687('0x2a')]());logger[_0xb687('0x10')](_0xb687('0x26'),_0x22cd1d);logger[_0xb687('0x12')](_0xb687('0x26'),_0x22cd1d,JSON[_0xb687('0x24')](_0x100f4a));_0x263834(_0x100f4a);})['catch'](function(_0x5ad577){logger[_0xb687('0x14')]('ShowMailAccount',_0x5ad577[_0xb687('0x17')],_0x22cd1d);_0x44be88(_0xa18fec[_0xb687('0x14')](0x1f4,_0x5ad577['message']));});});};exports[_0xb687('0x2b')]=function(_0x2ce07a){var _0x57776b=this;return new Promise(function(_0x394b56,_0x28031e){var _0x127b25={'body':_0x2ce07a['body'],'channel':_0xb687('0x2c')};var _0x9cffb2=_[_0xb687('0x2d')](_[_0xb687('0x2e')](db[_0xb687('0x2f')][_0xb687('0x30')]),[_0xb687('0x31'),'updatedAt',_0xb687('0x32'),'ListId']);var _0x50fdb7=![];if(_0x2ce07a[_0xb687('0x33')]['id']){delete _0x2ce07a[_0xb687('0x33')]['id'];}if(_['isNil'](_0x2ce07a[_0xb687('0x33')]['from'])){return _0x28031e(_0x57776b[_0xb687('0x14')](0x1f4,_0xb687('0x34')));}if(_['isNil'](_0x2ce07a[_0xb687('0x33')][_0xb687('0x33')])||_0x2ce07a['body'][_0xb687('0x33')]===''){return _0x28031e(_0x57776b[_0xb687('0x14')](0x1f4,_0xb687('0x35')));}if(_[_0xb687('0x36')](_0x2ce07a[_0xb687('0x33')][_0xb687('0x37')])){return _0x28031e(_0x57776b[_0xb687('0x14')](0x1f4,_0xb687('0x38')+_0x9cffb2));}if(!_[_0xb687('0x39')](_0x9cffb2,_0x2ce07a[_0xb687('0x33')][_0xb687('0x37')])){return _0x28031e(_0x57776b[_0xb687('0x14')](0x1f4,'mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x9cffb2));}var _0x1ac373={};_0x1ac373[_0x2ce07a['body'][_0xb687('0x37')]]=_0x2ce07a[_0xb687('0x33')][_0xb687('0x3a')];return db[_0xb687('0x1a')][_0xb687('0x27')]({'where':{'id':_0x2ce07a[_0xb687('0x3b')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0xb687('0x2f')],'as':_0xb687('0x3c'),'where':_0x1ac373,'limit':0x1,'order':[[_0xb687('0x3d'),_0xb687('0x3e')]]}]},{'model':db['MailApplication'],'as':_0xb687('0x3f')},{'model':db[_0xb687('0x40')],'as':_0xb687('0x41'),'include':[{'model':db[_0xb687('0x42')],'as':'CloudProvider'}]}]})[_0xb687('0xf')](function(_0xfc4c5f){if(_0xfc4c5f&&_0xfc4c5f[_0xb687('0x43')]){var _0x401b99=_0xfc4c5f['get']({'plain':!![]});_0x127b25['account']=_[_0xb687('0x44')](_0x401b99,[_0xb687('0x3f'),_0xb687('0x43')]);_0x127b25['account']['smtpOptions']=_0xfc4c5f[_0xb687('0x2a')]();_0x127b25[_0xb687('0x45')]=_0x401b99[_0xb687('0x3f')];_0x127b25[_0xb687('0x46')]=_0x401b99[_0xb687('0x43')];_0x127b25[_0xb687('0x45')]=_[_0xb687('0x47')](_0x127b25[_0xb687('0x45')],['priority'],[_0xb687('0x48')]);if(_0x127b25[_0xb687('0x3b')]&&_0x127b25[_0xb687('0x3b')]['autoclose']){_0x127b25['applications']['push']({'id':0x0,'priority':_0x127b25['applications'][_0xb687('0x49')]+0x1,'app':_0xb687('0x4a'),'appdata':_0xb687('0x4b'),'interval':_0xb687('0x4c')});}if(_0x127b25[_0xb687('0x3b')][_0xb687('0x3f')]){delete _0x127b25[_0xb687('0x3b')][_0xb687('0x3f')];}if(_0x127b25[_0xb687('0x3b')][_0xb687('0x43')]){delete _0x127b25[_0xb687('0x3b')][_0xb687('0x43')];}if(_0x401b99[_0xb687('0x43')][_0xb687('0x3c')][_0xb687('0x49')]){return _0x401b99[_0xb687('0x43')][_0xb687('0x3c')][0x0];}var _0x4dca01=_['defaults'](_0x2ce07a[_0xb687('0x33')],{'firstName':_0x2ce07a[_0xb687('0x33')][_0xb687('0x3a')],'ListId':_0x401b99[_0xb687('0x4d')]});_0x4dca01[_0x2ce07a['body'][_0xb687('0x37')]]=_0x2ce07a[_0xb687('0x33')]['from'];return db[_0xb687('0x2f')]['create'](_0x4dca01);}else{throw new Error(_0xb687('0x4e'));}})[_0xb687('0xf')](function(_0x50fb31){_0x127b25['contact']=_0x50fb31;if(_0x50fb31){if(!_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')]['messageId']){_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')][_0xb687('0x4f')]=rs['generate']()+'\x20'+_0x2ce07a[_0xb687('0x33')]['message'][_0xb687('0x3a')];}var _0x1a31f6={'ContactId':_0x50fb31['id'],'MailAccountId':_0x2ce07a[_0xb687('0x3b')]['id'],'inReplyTo':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')]['messageId'],'to':_0x2ce07a['body'][_0xb687('0x17')]['from'],'cc':_0x2ce07a['body']['message']['cc'],'subject':_0x2ce07a['body'][_0xb687('0x17')][_0xb687('0x50')],'attach':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')][_0xb687('0x51')],'lastMsgAt':moment()[_0xb687('0x52')](_0xb687('0x53')),'lastMsgDirection':'in'};return db[_0xb687('0x54')][_0xb687('0x27')]({'where':{'closed':![],'MailAccountId':_0x2ce07a[_0xb687('0x3b')]['id']},'include':[{'model':db[_0xb687('0x55')],'as':'Messages','attributes':['messageId'],'where':{'messageId':_0x2ce07a[_0xb687('0x33')]['message'][_0xb687('0x56')]}}]})[_0xb687('0xf')](function(_0x1c031f){if(_0x1c031f){return[_0x1c031f,![]];}return db[_0xb687('0x54')][_0xb687('0x57')](_0x1a31f6)['then'](function(_0x22da49){return[_0x22da49,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0xb687('0x58')](function(_0x293281,_0x18993a){if(_0x293281){_0x50fdb7=_0x18993a;if(!_0x18993a){return _0x293281[_0xb687('0x59')]({'inReplyTo':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')][_0xb687('0x4f')],'to':_0x2ce07a['body'][_0xb687('0x17')][_0xb687('0x3a')],'cc':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')]['cc'],'subject':_0x2ce07a[_0xb687('0x33')]['message'][_0xb687('0x50')],'attach':_0x293281[_0xb687('0x51')]?_0x293281[_0xb687('0x51')]:_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')][_0xb687('0x51')],'substatus':null,'substatusAt':moment()[_0xb687('0x52')](_0xb687('0x53')),'lastMsgAt':moment()[_0xb687('0x52')](_0xb687('0x53')),'lastMsgDirection':'in'});}else{return _0x293281;}}})[_0xb687('0xf')](function(_0x48838a){_0x127b25[_0xb687('0x5a')]=_0x48838a[_0xb687('0x5b')]({'plain':!![]});_0x127b25[_0xb687('0x5a')][_0xb687('0x5c')]=_0x50fdb7;return db['MailMessage'][_0xb687('0x57')]({'body':_0x2ce07a[_0xb687('0x33')]['body'],'MailAccountId':_0x2ce07a[_0xb687('0x3b')]['id'],'MailInteractionId':_0x48838a['id'],'direction':'in','ContactId':_0x127b25[_0xb687('0x5d')]['id'],'messageId':_0x2ce07a[_0xb687('0x33')]['message'][_0xb687('0x4f')],'from':_0x2ce07a[_0xb687('0x33')]['message'][_0xb687('0x3a')],'to':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')]['to'],'cc':_0x2ce07a[_0xb687('0x33')]['message']['cc'],'subject':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')]['subject'],'attach':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')]['attach'],'Attachments':_0x2ce07a['body'][_0xb687('0x17')]['attachments'],'originTo':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')][_0xb687('0x5e')],'originCc':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')][_0xb687('0x5f')],'bcc':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')]['bcc'],'ChatWebsiteId':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')][_0xb687('0x60')]||null,'originChannel':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')][_0xb687('0x61')]||'Email','ChatOfflineMessageId':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')]['ChatOfflineMessageId']||null},{'include':[{'model':db[_0xb687('0x62')],'as':_0xb687('0x63')}]});})[_0xb687('0xf')](function(_0x1227fe){_0x127b25['message']=_0x1227fe;if(_0x127b25[_0xb687('0x5a')]['UserId']){return db['User'][_0xb687('0x27')]({'attributes':['id','name'],'where':{'id':_0x127b25['interaction'][_0xb687('0x64')]}})['then'](function(_0x137631){if(_0x137631){_0x127b25[_0xb687('0x45')]['unshift']({'id':0x0,'priority':0x0,'app':_0xb687('0x65'),'appdata':_0x137631[_0xb687('0x66')]+','+(_0x127b25['account'][_0xb687('0x67')]||0xa),'interval':_0xb687('0x4c')});}return respondWithRpcPromise(_0xb687('0x68'),_0xb687('0x69'),_0x127b25);});}return respondWithRpcPromise(_0xb687('0x68'),_0xb687('0x69'),_0x127b25);})[_0xb687('0xf')](function(_0x2ce516){_0x394b56(_0x2ce516);})[_0xb687('0x25')](function(_0x4092a0){_0x28031e(_0x57776b[_0xb687('0x14')](0x1f4,_0x4092a0['message']));});});};
\ No newline at end of file
+var _0x0295=['setDataValue','smtpOptions','getSmtpOptions','stringify','NotifyMailAccount','body','keys','CmContact','rawAttributes','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','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','CmList','List','Contacts','DESC','MailApplication','Applications','MailServerOut','Smtp','CloudProvider','get','omit','applications','priority','asc','autoclose','close','*,*,*,*','length','contact','messageId','generate','subject','attach','format','YYYY-MM-DD\x20HH:mm:ss','MailMessage','Messages','inReplyTo','MailInteraction','Contact\x20not\x20found','spread','update','created','create','attachments','originTo','originCc','bcc','originChannel','Email','ChatOfflineMessageId','Attachment','Attachments','interaction','UserId','User','name','agent','Start','startRouting','lodash','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','./mailAccount.socket','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','MailAccount,\x20%s,\x20%s,\x20%s','error','message','catch','GetMailAccount','MailAccount','findAll','options','attributes','limit','include','model','map','debug','ShowMailAccount','find','where','smtp'];(function(_0x239dba,_0x309e95){var _0x1ceb11=function(_0x14efe6){while(--_0x14efe6){_0x239dba['push'](_0x239dba['shift']());}};_0x1ceb11(++_0x309e95);}(_0x0295,0x1f0));var _0x5029=function(_0x67b075,_0x43557d){_0x67b075=_0x67b075-0x0;var _0x39d030=_0x0295[_0x67b075];return _0x39d030;};'use strict';var _=require(_0x5029('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5029('0x1'));var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var logger=require(_0x5029('0x2'))(_0x5029('0x3'));var config=require(_0x5029('0x4'));var jayson=require(_0x5029('0x5'));var client=jayson[_0x5029('0x6')][_0x5029('0x7')]({'port':0x232c});config[_0x5029('0x8')]=_[_0x5029('0x9')](config[_0x5029('0x8')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x5029('0xa'))['register'](socket);function respondWithRpcPromise(_0x1532e9,_0x5bccfc,_0x14d4ef){return new BPromise(function(_0x520bc3,_0x222ddb){return client[_0x5029('0xb')](_0x1532e9,_0x14d4ef)[_0x5029('0xc')](function(_0x52fa95){logger[_0x5029('0xd')](_0x5029('0xe'),_0x5bccfc,_0x5029('0xf'));logger['debug'](_0x5029('0x10'),_0x5bccfc,_0x5029('0xf'),JSON['stringify'](_0x52fa95));if(_0x52fa95['error']){if(_0x52fa95['error']['code']===0x1f4){logger[_0x5029('0x11')](_0x5029('0xe'),_0x5bccfc,_0x52fa95[_0x5029('0x11')][_0x5029('0x12')]);return _0x222ddb(_0x52fa95[_0x5029('0x11')][_0x5029('0x12')]);}logger[_0x5029('0x11')](_0x5029('0xe'),_0x5bccfc,_0x52fa95[_0x5029('0x11')][_0x5029('0x12')]);return _0x520bc3(_0x52fa95[_0x5029('0x11')][_0x5029('0x12')]);}else{logger[_0x5029('0xd')](_0x5029('0xe'),_0x5bccfc,_0x5029('0xf'));_0x520bc3(_0x52fa95['result'][_0x5029('0x12')]);}})[_0x5029('0x13')](function(_0x35de81){logger[_0x5029('0x11')](_0x5029('0xe'),_0x5bccfc,_0x35de81);_0x222ddb(_0x35de81);});});}exports[_0x5029('0x14')]=function(_0xaba461){var _0x4adbb3=this;return new Promise(function(_0x226a5c,_0x5696b1){return db[_0x5029('0x15')][_0x5029('0x16')]({'raw':_0xaba461[_0x5029('0x17')]?_0xaba461[_0x5029('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0xaba461['options']?_0xaba461[_0x5029('0x17')]['where']||null:null,'attributes':_0xaba461[_0x5029('0x17')]?_0xaba461[_0x5029('0x17')][_0x5029('0x18')]||null:null,'limit':_0xaba461[_0x5029('0x17')]?_0xaba461[_0x5029('0x17')][_0x5029('0x19')]||null:null,'include':_0xaba461[_0x5029('0x17')]?_0xaba461[_0x5029('0x17')][_0x5029('0x1a')]?_['map'](_0xaba461['options']['include'],function(_0x588d90){return{'model':db[_0x588d90[_0x5029('0x1b')]],'as':_0x588d90['as'],'attributes':_0x588d90['attributes'],'include':_0x588d90['include']?_[_0x5029('0x1c')](_0x588d90[_0x5029('0x1a')],function(_0x36d810){return{'model':db[_0x36d810['model']],'as':_0x36d810['as'],'attributes':_0x36d810[_0x5029('0x18')],'include':_0x36d810[_0x5029('0x1a')]?_['map'](_0x36d810[_0x5029('0x1a')],function(_0x31f0a0){return{'model':db[_0x31f0a0[_0x5029('0x1b')]],'as':_0x31f0a0['as'],'attributes':_0x31f0a0['attributes']};}):[]};}):[]};}):[]:[]})[_0x5029('0xc')](function(_0x251f99){logger[_0x5029('0xd')]('GetMailAccount',_0xaba461);logger[_0x5029('0x1d')](_0x5029('0x14'),_0xaba461,JSON['stringify'](_0x251f99));_0x226a5c(_0x251f99);})[_0x5029('0x13')](function(_0x25032b){logger[_0x5029('0x11')](_0x5029('0x14'),_0x25032b[_0x5029('0x12')],_0xaba461);_0x5696b1(_0x4adbb3[_0x5029('0x11')](0x1f4,_0x25032b[_0x5029('0x12')]));});});};exports[_0x5029('0x1e')]=function(_0x250156){var _0x22559a=this;return new Promise(function(_0x358a2b,_0x4519c8){return db['MailAccount'][_0x5029('0x1f')]({'raw':_0x250156['options']?_0x250156[_0x5029('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x250156['options']?_0x250156[_0x5029('0x17')][_0x5029('0x20')]||null:null,'attributes':_0x250156[_0x5029('0x17')]?_0x250156['options'][_0x5029('0x18')]||null:null,'include':_0x250156[_0x5029('0x17')]?_0x250156[_0x5029('0x17')][_0x5029('0x1a')]?_[_0x5029('0x1c')](_0x250156[_0x5029('0x17')][_0x5029('0x1a')],function(_0x22205e){return{'model':db[_0x22205e[_0x5029('0x1b')]],'as':_0x22205e['as'],'attributes':_0x22205e['attributes'],'include':_0x22205e[_0x5029('0x1a')]?_[_0x5029('0x1c')](_0x22205e[_0x5029('0x1a')],function(_0x1b3817){return{'model':db[_0x1b3817['model']],'as':_0x1b3817['as'],'attributes':_0x1b3817[_0x5029('0x18')],'include':_0x1b3817[_0x5029('0x1a')]?_[_0x5029('0x1c')](_0x1b3817['include'],function(_0x4904cc){return{'model':db[_0x4904cc[_0x5029('0x1b')]],'as':_0x4904cc['as'],'attributes':_0x4904cc[_0x5029('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x57784c){if(_0x250156[_0x5029('0x17')][_0x5029('0x21')]===!![])_0x57784c[_0x5029('0x22')](_0x5029('0x23'),_0x57784c[_0x5029('0x24')]());logger[_0x5029('0xd')](_0x5029('0x1e'),_0x250156);logger[_0x5029('0x1d')](_0x5029('0x1e'),_0x250156,JSON[_0x5029('0x25')](_0x57784c));_0x358a2b(_0x57784c);})[_0x5029('0x13')](function(_0xbdb3fa){logger[_0x5029('0x11')](_0x5029('0x1e'),_0xbdb3fa['message'],_0x250156);_0x4519c8(_0x22559a['error'](0x1f4,_0xbdb3fa[_0x5029('0x12')]));});});};exports[_0x5029('0x26')]=function(_0x423ed1){var _0x48c9eb=this;return new Promise(function(_0x32d8a3,_0x39b216){var _0x52572a={'body':_0x423ed1[_0x5029('0x27')],'channel':'mail'};var _0x506f0d=_['difference'](_[_0x5029('0x28')](db[_0x5029('0x29')][_0x5029('0x2a')]),[_0x5029('0x2b'),_0x5029('0x2c'),_0x5029('0x2d'),_0x5029('0x2e')]);var _0x1021ea=![];if(_0x423ed1[_0x5029('0x27')]['id']){delete _0x423ed1['body']['id'];}if(_[_0x5029('0x2f')](_0x423ed1[_0x5029('0x27')][_0x5029('0x30')])){return _0x39b216(_0x48c9eb[_0x5029('0x11')](0x1f4,_0x5029('0x31')));}if(_[_0x5029('0x2f')](_0x423ed1['body'][_0x5029('0x27')])||_0x423ed1[_0x5029('0x27')][_0x5029('0x27')]===''){return _0x39b216(_0x48c9eb[_0x5029('0x11')](0x1f4,_0x5029('0x32')));}if(_['isNil'](_0x423ed1[_0x5029('0x27')][_0x5029('0x33')])){return _0x39b216(_0x48c9eb[_0x5029('0x11')](0x1f4,_0x5029('0x34')+_0x506f0d));}if(!_[_0x5029('0x35')](_0x506f0d,_0x423ed1[_0x5029('0x27')][_0x5029('0x33')])){return _0x39b216(_0x48c9eb[_0x5029('0x11')](0x1f4,_0x5029('0x36')+_0x506f0d));}var _0x51514e={};_0x51514e[_0x423ed1[_0x5029('0x27')][_0x5029('0x33')]]=_0x423ed1[_0x5029('0x27')][_0x5029('0x30')];return db['MailAccount']['find']({'where':{'id':_0x423ed1[_0x5029('0x37')]['id']},'include':[{'model':db[_0x5029('0x38')],'as':_0x5029('0x39'),'include':[{'model':db[_0x5029('0x29')],'as':_0x5029('0x3a'),'where':_0x51514e,'limit':0x1,'order':[[_0x5029('0x2c'),_0x5029('0x3b')]]}]},{'model':db[_0x5029('0x3c')],'as':_0x5029('0x3d')},{'model':db[_0x5029('0x3e')],'as':_0x5029('0x3f'),'include':[{'model':db[_0x5029('0x40')],'as':_0x5029('0x40')}]}]})[_0x5029('0xc')](function(_0x3168bd){if(_0x3168bd&&_0x3168bd[_0x5029('0x39')]){var _0x10fc07=_0x3168bd[_0x5029('0x41')]({'plain':!![]});_0x52572a[_0x5029('0x37')]=_[_0x5029('0x42')](_0x10fc07,[_0x5029('0x3d'),'List']);_0x52572a[_0x5029('0x37')]['smtpOptions']=_0x3168bd[_0x5029('0x24')]();_0x52572a[_0x5029('0x43')]=_0x10fc07['Applications'];_0x52572a['list']=_0x10fc07[_0x5029('0x39')];_0x52572a['applications']=_['orderBy'](_0x52572a[_0x5029('0x43')],[_0x5029('0x44')],[_0x5029('0x45')]);if(_0x52572a['account']&&_0x52572a['account'][_0x5029('0x46')]){_0x52572a[_0x5029('0x43')]['push']({'id':0x0,'priority':_0x52572a[_0x5029('0x43')]['length']+0x1,'app':_0x5029('0x47'),'appdata':'autoclose','interval':_0x5029('0x48')});}if(_0x52572a[_0x5029('0x37')][_0x5029('0x3d')]){delete _0x52572a[_0x5029('0x37')][_0x5029('0x3d')];}if(_0x52572a[_0x5029('0x37')][_0x5029('0x39')]){delete _0x52572a[_0x5029('0x37')]['List'];}if(_0x10fc07[_0x5029('0x39')]['Contacts'][_0x5029('0x49')]){return _0x10fc07[_0x5029('0x39')]['Contacts'][0x0];}var _0x2a2da5=_['defaults'](_0x423ed1['body'],{'firstName':_0x423ed1['body'][_0x5029('0x30')],'ListId':_0x10fc07['ListId']});_0x2a2da5[_0x423ed1[_0x5029('0x27')][_0x5029('0x33')]]=_0x423ed1[_0x5029('0x27')]['from'];return db[_0x5029('0x29')]['create'](_0x2a2da5);}else{throw new Error('List\x20not\x20found');}})[_0x5029('0xc')](function(_0x98abd1){_0x52572a[_0x5029('0x4a')]=_0x98abd1;if(_0x98abd1){if(!_0x423ed1[_0x5029('0x27')][_0x5029('0x12')]['messageId']){_0x423ed1[_0x5029('0x27')][_0x5029('0x12')][_0x5029('0x4b')]=rs[_0x5029('0x4c')]()+'\x20'+_0x423ed1['body'][_0x5029('0x12')][_0x5029('0x30')];}var _0x4d4a2d={'ContactId':_0x98abd1['id'],'MailAccountId':_0x423ed1['account']['id'],'inReplyTo':_0x423ed1[_0x5029('0x27')][_0x5029('0x12')][_0x5029('0x4b')],'to':_0x423ed1[_0x5029('0x27')]['message'][_0x5029('0x30')],'cc':_0x423ed1[_0x5029('0x27')][_0x5029('0x12')]['cc'],'subject':_0x423ed1[_0x5029('0x27')][_0x5029('0x12')][_0x5029('0x4d')],'attach':_0x423ed1['body']['message'][_0x5029('0x4e')],'lastMsgAt':moment()[_0x5029('0x4f')](_0x5029('0x50')),'lastMsgDirection':'in'};return db['MailInteraction'][_0x5029('0x1f')]({'where':{'closed':![],'MailAccountId':_0x423ed1[_0x5029('0x37')]['id']},'include':[{'model':db[_0x5029('0x51')],'as':_0x5029('0x52'),'attributes':[_0x5029('0x4b')],'where':{'messageId':_0x423ed1['body'][_0x5029('0x12')][_0x5029('0x53')]}}]})[_0x5029('0xc')](function(_0x5bf867){if(_0x5bf867){return[_0x5bf867,![]];}return db[_0x5029('0x54')]['create'](_0x4d4a2d)[_0x5029('0xc')](function(_0x4f2f0c){return[_0x4f2f0c,!![]];});});}else{throw new Error(_0x5029('0x55'));}})[_0x5029('0x56')](function(_0x2ad2e3,_0x2f5301){if(_0x2ad2e3){_0x1021ea=_0x2f5301;if(!_0x2f5301){return _0x2ad2e3[_0x5029('0x57')]({'inReplyTo':_0x423ed1[_0x5029('0x27')]['message'][_0x5029('0x4b')],'to':_0x423ed1[_0x5029('0x27')][_0x5029('0x12')][_0x5029('0x30')],'cc':_0x423ed1[_0x5029('0x27')]['message']['cc'],'subject':_0x423ed1[_0x5029('0x27')]['message'][_0x5029('0x4d')],'attach':_0x2ad2e3['attach']?_0x2ad2e3[_0x5029('0x4e')]:_0x423ed1['body'][_0x5029('0x12')]['attach'],'substatus':null,'substatusAt':moment()['format'](_0x5029('0x50')),'lastMsgAt':moment()['format'](_0x5029('0x50')),'lastMsgDirection':'in'});}else{return _0x2ad2e3;}}})[_0x5029('0xc')](function(_0x382994){_0x52572a['interaction']=_0x382994[_0x5029('0x41')]({'plain':!![]});_0x52572a['interaction'][_0x5029('0x58')]=_0x1021ea;return db[_0x5029('0x51')][_0x5029('0x59')]({'body':_0x423ed1[_0x5029('0x27')][_0x5029('0x27')],'MailAccountId':_0x423ed1['account']['id'],'MailInteractionId':_0x382994['id'],'direction':'in','ContactId':_0x52572a[_0x5029('0x4a')]['id'],'messageId':_0x423ed1[_0x5029('0x27')]['message'][_0x5029('0x4b')],'from':_0x423ed1[_0x5029('0x27')][_0x5029('0x12')][_0x5029('0x30')],'to':_0x423ed1[_0x5029('0x27')][_0x5029('0x12')]['to'],'cc':_0x423ed1['body']['message']['cc'],'subject':_0x423ed1[_0x5029('0x27')]['message'][_0x5029('0x4d')],'attach':_0x423ed1[_0x5029('0x27')]['message'][_0x5029('0x4e')],'Attachments':_0x423ed1['body']['message'][_0x5029('0x5a')],'originTo':_0x423ed1[_0x5029('0x27')][_0x5029('0x12')][_0x5029('0x5b')],'originCc':_0x423ed1['body'][_0x5029('0x12')][_0x5029('0x5c')],'bcc':_0x423ed1['body'][_0x5029('0x12')][_0x5029('0x5d')],'ChatWebsiteId':_0x423ed1['body']['message']['ChatWebsiteId']||null,'originChannel':_0x423ed1[_0x5029('0x27')][_0x5029('0x12')][_0x5029('0x5e')]||_0x5029('0x5f'),'ChatOfflineMessageId':_0x423ed1[_0x5029('0x27')][_0x5029('0x12')][_0x5029('0x60')]||null},{'include':[{'model':db[_0x5029('0x61')],'as':_0x5029('0x62')}]});})['then'](function(_0x4bf5cf){_0x52572a[_0x5029('0x12')]=_0x4bf5cf;if(_0x52572a[_0x5029('0x63')][_0x5029('0x64')]){return db[_0x5029('0x65')][_0x5029('0x1f')]({'attributes':['id',_0x5029('0x66')],'where':{'id':_0x52572a[_0x5029('0x63')]['UserId']}})[_0x5029('0xc')](function(_0x3a0d6f){if(_0x3a0d6f){_0x52572a[_0x5029('0x43')]['unshift']({'id':0x0,'priority':0x0,'app':_0x5029('0x67'),'appdata':_0x3a0d6f[_0x5029('0x66')]+','+(_0x52572a[_0x5029('0x37')]['waitForTheAssignedAgent']||0xa),'interval':_0x5029('0x48')});}return respondWithRpcPromise(_0x5029('0x68'),_0x5029('0x69'),_0x52572a);});}return respondWithRpcPromise('Start',_0x5029('0x69'),_0x52572a);})[_0x5029('0xc')](function(_0x5a35bc){_0x32d8a3(_0x5a35bc);})[_0x5029('0x13')](function(_0x42d795){_0x39b216(_0x48c9eb[_0x5029('0x11')](0x1f4,_0x42d795[_0x5029('0x12')]));});});};
\ No newline at end of file
index 71cacb9..ab528be 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4202=['remove','update','emit','removeListener','register','length','mailAccount:','./mailAccount.events','save'];(function(_0x43adde,_0x569932){var _0x511279=function(_0x441a94){while(--_0x441a94){_0x43adde['push'](_0x43adde['shift']());}};_0x511279(++_0x569932);}(_0x4202,0xe8));var _0x2420=function(_0x5874ca,_0xf90b52){_0x5874ca=_0x5874ca-0x0;var _0x4b41d7=_0x4202[_0x5874ca];return _0x4b41d7;};'use strict';var MailAccountEvents=require(_0x2420('0x0'));var events=[_0x2420('0x1'),_0x2420('0x2'),_0x2420('0x3')];function createListener(_0x59e8f8,_0x1e9c77){return function(_0x58adad){_0x1e9c77[_0x2420('0x4')](_0x59e8f8,_0x58adad);};}function removeListener(_0xfbd3ab,_0xae4243){return function(){MailAccountEvents[_0x2420('0x5')](_0xfbd3ab,_0xae4243);};}exports[_0x2420('0x6')]=function(_0x4cacc4){for(var _0x2ae4ce=0x0,_0x59d3a6=events[_0x2420('0x7')];_0x2ae4ce<_0x59d3a6;_0x2ae4ce++){var _0x51a390=events[_0x2ae4ce];var _0x42ed64=createListener(_0x2420('0x8')+_0x51a390,_0x4cacc4);MailAccountEvents['on'](_0x51a390,_0x42ed64);}};
\ No newline at end of file
+var _0xd142=['register','length','./mailAccount.events','save','remove','update','emit','removeListener'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xd142,0x11a));var _0x2d14=function(_0xb4e052,_0x1d3cb6){_0xb4e052=_0xb4e052-0x0;var _0x5197e7=_0xd142[_0xb4e052];return _0x5197e7;};'use strict';var MailAccountEvents=require(_0x2d14('0x0'));var events=[_0x2d14('0x1'),_0x2d14('0x2'),_0x2d14('0x3')];function createListener(_0x504e32,_0x50b30a){return function(_0x1d9219){_0x50b30a[_0x2d14('0x4')](_0x504e32,_0x1d9219);};}function removeListener(_0x9f6796,_0x41da29){return function(){MailAccountEvents[_0x2d14('0x5')](_0x9f6796,_0x41da29);};}exports[_0x2d14('0x6')]=function(_0xb3acd1){for(var _0x5dd0e5=0x0,_0x5eb081=events[_0x2d14('0x7')];_0x5dd0e5<_0x5eb081;_0x5dd0e5++){var _0xba6306=events[_0x5dd0e5];var _0x1b2d92=createListener('mailAccount:'+_0xba6306,_0xb3acd1);MailAccountEvents['on'](_0xba6306,_0x1b2d92);}};
\ No newline at end of file
index 623efd1..f980c5f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe61a=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','./mailApplication.controller','get','/:id','isAuthenticated','show','put','update','delete','destroy','exports','multer','util','path'];(function(_0x5b144b,_0x29e58d){var _0x153a81=function(_0x27c1b4){while(--_0x27c1b4){_0x5b144b['push'](_0x5b144b['shift']());}};_0x153a81(++_0x29e58d);}(_0xe61a,0x8d));var _0xae61=function(_0x153b0b,_0x49b023){_0x153b0b=_0x153b0b-0x0;var _0x5607b9=_0xe61a[_0x153b0b];return _0x5607b9;};'use strict';var multer=require(_0xae61('0x0'));var util=require(_0xae61('0x1'));var path=require(_0xae61('0x2'));var timeout=require(_0xae61('0x3'));var express=require(_0xae61('0x4'));var router=express[_0xae61('0x5')]();var fs_extra=require(_0xae61('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xae61('0x7'));var config=require('../../config/environment');var controller=require(_0xae61('0x8'));router[_0xae61('0x9')](_0xae61('0xa'),auth[_0xae61('0xb')](),controller[_0xae61('0xc')]);router[_0xae61('0xd')](_0xae61('0xa'),auth['isAuthenticated'](),controller[_0xae61('0xe')]);router[_0xae61('0xf')]('/:id',auth[_0xae61('0xb')](),controller[_0xae61('0x10')]);module[_0xae61('0x11')]=router;
\ No newline at end of file
+var _0x02be=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./mailApplication.controller','/:id','isAuthenticated','show','put','delete','destroy'];(function(_0x4003fe,_0x38c382){var _0x5af37c=function(_0x112092){while(--_0x112092){_0x4003fe['push'](_0x4003fe['shift']());}};_0x5af37c(++_0x38c382);}(_0x02be,0x166));var _0xe02b=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x02be[_0x3ff085];return _0x2b68c3;};'use strict';var multer=require(_0xe02b('0x0'));var util=require(_0xe02b('0x1'));var path=require(_0xe02b('0x2'));var timeout=require(_0xe02b('0x3'));var express=require(_0xe02b('0x4'));var router=express[_0xe02b('0x5')]();var fs_extra=require(_0xe02b('0x6'));var auth=require(_0xe02b('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xe02b('0x8'));var controller=require(_0xe02b('0x9'));router['get'](_0xe02b('0xa'),auth[_0xe02b('0xb')](),controller[_0xe02b('0xc')]);router[_0xe02b('0xd')](_0xe02b('0xa'),auth['isAuthenticated'](),controller['update']);router[_0xe02b('0xe')](_0xe02b('0xa'),auth[_0xe02b('0xb')](),controller[_0xe02b('0xf')]);module[_0xe02b('0x10')]=router;
\ No newline at end of file
index 94cc881..0413b63 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdf14=['TEXT','sequelize','STRING','noop'];(function(_0xa153b1,_0x3fe7ed){var _0x60cfb=function(_0x469585){while(--_0x469585){_0xa153b1['push'](_0xa153b1['shift']());}};_0x60cfb(++_0x3fe7ed);}(_0xdf14,0xb5));var _0x4df1=function(_0x52c576,_0x24c2df){_0x52c576=_0x52c576-0x0;var _0x5d13f5=_0xdf14[_0x52c576];return _0x5d13f5;};'use strict';var Sequelize=require(_0x4df1('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x4df1('0x1')],'allowNull':![],'defaultValue':_0x4df1('0x2')},'appdata':{'type':Sequelize[_0x4df1('0x3')]()},'description':{'type':Sequelize[_0x4df1('0x1')]},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
+var _0xeb6b=['exports','INTEGER','STRING','noop','*,*,*,*','sequelize'];(function(_0x357b04,_0x3ceabd){var _0x56a565=function(_0x4e26f1){while(--_0x4e26f1){_0x357b04['push'](_0x357b04['shift']());}};_0x56a565(++_0x3ceabd);}(_0xeb6b,0xe3));var _0xbeb6=function(_0xe6be4e,_0x478957){_0xe6be4e=_0xe6be4e-0x0;var _0x182001=_0xeb6b[_0xe6be4e];return _0x182001;};'use strict';var Sequelize=require(_0xbeb6('0x0'));module[_0xbeb6('0x1')]={'priority':{'type':Sequelize[_0xbeb6('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xbeb6('0x3')],'allowNull':![],'defaultValue':_0xbeb6('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xbeb6('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xbeb6('0x5')}};
\ No newline at end of file
index 37a8410..e4e1190 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd8b0=['attributes','length','include','merge','find','catch','body','params','eml-format','rimraf','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','save','update','then','destroy','error','name','show','model','MailApplication','query','keys','intersection','fields'];(function(_0x267ad8,_0x8e8f9c){var _0x264e34=function(_0x5e329a){while(--_0x5e329a){_0x267ad8['push'](_0x267ad8['shift']());}};_0x264e34(++_0x8e8f9c);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var emlformat=require(_0x0d8b('0x0'));var rimraf=require(_0x0d8b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0d8b('0x2'));var BPromise=require(_0x0d8b('0x3'));var Mustache=require(_0x0d8b('0x4'));var util=require(_0x0d8b('0x5'));var path=require(_0x0d8b('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0d8b('0x7'));var fs=require('fs');var fs_extra=require(_0x0d8b('0x8'));var _=require(_0x0d8b('0x9'));var squel=require('squel');var crypto=require(_0x0d8b('0xa'));var jsforce=require(_0x0d8b('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x0d8b('0xc'));var querystring=require(_0x0d8b('0xd'));var Papa=require(_0x0d8b('0xe'));var Redis=require(_0x0d8b('0xf'));var authService=require(_0x0d8b('0x10'));var qs=require(_0x0d8b('0x11'));var as=require(_0x0d8b('0x12'));var hardwareService=require(_0x0d8b('0x13'));var logger=require('../../config/logger')(_0x0d8b('0x14'));var utils=require('../../config/utils');var config=require(_0x0d8b('0x15'));var licenseUtil=require(_0x0d8b('0x16'));var db=require(_0x0d8b('0x17'))['db'];function respondWithStatusCode(_0x92cdd8,_0x35a07b){_0x35a07b=_0x35a07b||0xcc;return function(_0x32bb1a){if(_0x32bb1a){return _0x92cdd8[_0x0d8b('0x18')](_0x35a07b);}return _0x92cdd8[_0x0d8b('0x19')](_0x35a07b)[_0x0d8b('0x1a')]();};}function respondWithResult(_0x2ce75e,_0x5ad086){_0x5ad086=_0x5ad086||0xc8;return function(_0xe65334){if(_0xe65334){return _0x2ce75e[_0x0d8b('0x19')](_0x5ad086)[_0x0d8b('0x1b')](_0xe65334);}};}function respondWithFilteredResult(_0x4f6f21,_0x23eb7b){return function(_0xa86349){if(_0xa86349){var _0x17f7df=typeof _0x23eb7b[_0x0d8b('0x1c')]===_0x0d8b('0x1d')&&typeof _0x23eb7b['limit']===_0x0d8b('0x1d');var _0x4586c2=_0xa86349[_0x0d8b('0x1e')];var _0x5fecbd=_0x17f7df?0x0:_0x23eb7b[_0x0d8b('0x1c')];var _0x18dd2d=_0x17f7df?_0xa86349[_0x0d8b('0x1e')]:_0x23eb7b[_0x0d8b('0x1c')]+_0x23eb7b['limit'];var _0x27512e;if(_0x18dd2d>=_0x4586c2){_0x18dd2d=_0x4586c2;_0x27512e=0xc8;}else{_0x27512e=0xce;}_0x4f6f21[_0x0d8b('0x19')](_0x27512e);return _0x4f6f21[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x5fecbd+'-'+_0x18dd2d+'/'+_0x4586c2)[_0x0d8b('0x1b')](_0xa86349);}return null;};}function patchUpdates(_0x5b709c){return function(_0x393beb){try{jsonpatch[_0x0d8b('0x21')](_0x393beb,_0x5b709c,!![]);}catch(_0x50ec1e){return BPromise['reject'](_0x50ec1e);}return _0x393beb[_0x0d8b('0x22')]();};}function saveUpdates(_0x54a9a7,_0x56c729){return function(_0x5527d8){if(_0x5527d8){return _0x5527d8[_0x0d8b('0x23')](_0x54a9a7)[_0x0d8b('0x24')](function(_0x214778){return _0x214778;});}return null;};}function removeEntity(_0x38efc8,_0x221071){return function(_0x2c64e2){if(_0x2c64e2){return _0x2c64e2[_0x0d8b('0x25')]()[_0x0d8b('0x24')](function(){_0x38efc8[_0x0d8b('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe8bbee,_0x4463ee){return function(_0x5363e3){if(!_0x5363e3){_0xe8bbee[_0x0d8b('0x18')](0x194);}return _0x5363e3;};}function handleError(_0x4a0ae4,_0x3dd149){_0x3dd149=_0x3dd149||0x1f4;return function(_0x234bdd){logger[_0x0d8b('0x26')](_0x234bdd['stack']);if(_0x234bdd['name']){delete _0x234bdd[_0x0d8b('0x27')];}_0x4a0ae4[_0x0d8b('0x19')](_0x3dd149)['send'](_0x234bdd);};}exports[_0x0d8b('0x28')]=function(_0x59aa83,_0x1b2b59){var _0x4b59e5={'raw':!![],'where':{'id':_0x59aa83['params']['id']}},_0x97050a={};_0x97050a[_0x0d8b('0x29')]=_['keys'](db[_0x0d8b('0x2a')]['rawAttributes']);_0x97050a[_0x0d8b('0x2b')]=_[_0x0d8b('0x2c')](_0x59aa83[_0x0d8b('0x2b')]);_0x97050a['filters']=_['intersection'](_0x97050a['model'],_0x97050a[_0x0d8b('0x2b')]);_0x4b59e5['attributes']=_[_0x0d8b('0x2d')](_0x97050a['model'],qs['fields'](_0x59aa83[_0x0d8b('0x2b')][_0x0d8b('0x2e')]));_0x4b59e5[_0x0d8b('0x2f')]=_0x4b59e5[_0x0d8b('0x2f')][_0x0d8b('0x30')]?_0x4b59e5[_0x0d8b('0x2f')]:_0x97050a[_0x0d8b('0x29')];if(_0x59aa83[_0x0d8b('0x2b')]['includeAll']){_0x4b59e5[_0x0d8b('0x31')]=[{'all':!![]}];}_0x4b59e5=_[_0x0d8b('0x32')]({},_0x4b59e5,_0x59aa83['options']);return db[_0x0d8b('0x2a')][_0x0d8b('0x33')](_0x4b59e5)[_0x0d8b('0x24')](handleEntityNotFound(_0x1b2b59,null))['then'](respondWithResult(_0x1b2b59,null))[_0x0d8b('0x34')](handleError(_0x1b2b59,null));};exports[_0x0d8b('0x23')]=function(_0x206157,_0x31ceba){if(_0x206157[_0x0d8b('0x35')]['id']){delete _0x206157['body']['id'];}return db[_0x0d8b('0x2a')][_0x0d8b('0x33')]({'where':{'id':_0x206157['params']['id']}})[_0x0d8b('0x24')](handleEntityNotFound(_0x31ceba,null))[_0x0d8b('0x24')](saveUpdates(_0x206157[_0x0d8b('0x35')],null))[_0x0d8b('0x24')](respondWithResult(_0x31ceba,null))[_0x0d8b('0x34')](handleError(_0x31ceba,null));};exports['destroy']=function(_0x497a71,_0x41b4f9){return db['MailApplication']['find']({'where':{'id':_0x497a71[_0x0d8b('0x36')]['id']}})[_0x0d8b('0x24')](handleEntityNotFound(_0x41b4f9,null))[_0x0d8b('0x24')](removeEntity(_0x41b4f9,null))[_0x0d8b('0x34')](handleError(_0x41b4f9,null));};
\ No newline at end of file
+var _0xbdb7=['update','error','stack','name','send','show','params','model','keys','MailApplication','query','filters','intersection','attributes','length','includeAll','merge','find','then','body','catch','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','save'];(function(_0x21353c,_0x2ea587){var _0xa99120=function(_0x557f33){while(--_0x557f33){_0x21353c['push'](_0x21353c['shift']());}};_0xa99120(++_0x2ea587);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x4442cc,_0x4b8f77){_0x4442cc=_0x4442cc-0x0;var _0x5efbbe=_0xbdb7[_0x4442cc];return _0x5efbbe;};'use strict';var emlformat=require(_0x7bdb('0x0'));var rimraf=require(_0x7bdb('0x1'));var zipdir=require(_0x7bdb('0x2'));var jsonpatch=require(_0x7bdb('0x3'));var rp=require(_0x7bdb('0x4'));var moment=require(_0x7bdb('0x5'));var BPromise=require(_0x7bdb('0x6'));var Mustache=require(_0x7bdb('0x7'));var util=require(_0x7bdb('0x8'));var path=require('path');var sox=require(_0x7bdb('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7bdb('0xa'));var _=require(_0x7bdb('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7bdb('0xc'));var deskjs=require(_0x7bdb('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7bdb('0xe'));var Redis=require(_0x7bdb('0xf'));var authService=require(_0x7bdb('0x10'));var qs=require(_0x7bdb('0x11'));var as=require(_0x7bdb('0x12'));var hardwareService=require(_0x7bdb('0x13'));var logger=require(_0x7bdb('0x14'))(_0x7bdb('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x7bdb('0x16'))['db'];function respondWithStatusCode(_0x25e3cb,_0x496613){_0x496613=_0x496613||0xcc;return function(_0x8d74ff){if(_0x8d74ff){return _0x25e3cb['sendStatus'](_0x496613);}return _0x25e3cb['status'](_0x496613)[_0x7bdb('0x17')]();};}function respondWithResult(_0x46dd4a,_0x4fd91a){_0x4fd91a=_0x4fd91a||0xc8;return function(_0x50eeca){if(_0x50eeca){return _0x46dd4a['status'](_0x4fd91a)[_0x7bdb('0x18')](_0x50eeca);}};}function respondWithFilteredResult(_0x195b2e,_0xe9919f){return function(_0x25d417){if(_0x25d417){var _0x31c909=typeof _0xe9919f[_0x7bdb('0x19')]===_0x7bdb('0x1a')&&typeof _0xe9919f[_0x7bdb('0x1b')]==='undefined';var _0x1c5750=_0x25d417[_0x7bdb('0x1c')];var _0x5723f4=_0x31c909?0x0:_0xe9919f[_0x7bdb('0x19')];var _0x4ffd4b=_0x31c909?_0x25d417[_0x7bdb('0x1c')]:_0xe9919f[_0x7bdb('0x19')]+_0xe9919f['limit'];var _0x3e5f8e;if(_0x4ffd4b>=_0x1c5750){_0x4ffd4b=_0x1c5750;_0x3e5f8e=0xc8;}else{_0x3e5f8e=0xce;}_0x195b2e[_0x7bdb('0x1d')](_0x3e5f8e);return _0x195b2e[_0x7bdb('0x1e')](_0x7bdb('0x1f'),_0x5723f4+'-'+_0x4ffd4b+'/'+_0x1c5750)[_0x7bdb('0x18')](_0x25d417);}return null;};}function patchUpdates(_0x5bfc35){return function(_0x49f353){try{jsonpatch[_0x7bdb('0x20')](_0x49f353,_0x5bfc35,!![]);}catch(_0xcb25f2){return BPromise['reject'](_0xcb25f2);}return _0x49f353[_0x7bdb('0x21')]();};}function saveUpdates(_0x118ea1,_0x346c72){return function(_0x3f53e7){if(_0x3f53e7){return _0x3f53e7[_0x7bdb('0x22')](_0x118ea1)['then'](function(_0x1d37ac){return _0x1d37ac;});}return null;};}function removeEntity(_0xdad53d,_0x40c447){return function(_0x3a456f){if(_0x3a456f){return _0x3a456f['destroy']()['then'](function(){_0xdad53d[_0x7bdb('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x47abaf,_0x4a9e02){return function(_0x2abef6){if(!_0x2abef6){_0x47abaf['sendStatus'](0x194);}return _0x2abef6;};}function handleError(_0x2b14bc,_0x72ba69){_0x72ba69=_0x72ba69||0x1f4;return function(_0x3ec129){logger[_0x7bdb('0x23')](_0x3ec129[_0x7bdb('0x24')]);if(_0x3ec129['name']){delete _0x3ec129[_0x7bdb('0x25')];}_0x2b14bc[_0x7bdb('0x1d')](_0x72ba69)[_0x7bdb('0x26')](_0x3ec129);};}exports[_0x7bdb('0x27')]=function(_0x371e8a,_0x2e8e65){var _0x1e9996={'raw':!![],'where':{'id':_0x371e8a[_0x7bdb('0x28')]['id']}},_0xd2d7be={};_0xd2d7be[_0x7bdb('0x29')]=_[_0x7bdb('0x2a')](db[_0x7bdb('0x2b')]['rawAttributes']);_0xd2d7be[_0x7bdb('0x2c')]=_[_0x7bdb('0x2a')](_0x371e8a[_0x7bdb('0x2c')]);_0xd2d7be[_0x7bdb('0x2d')]=_[_0x7bdb('0x2e')](_0xd2d7be['model'],_0xd2d7be[_0x7bdb('0x2c')]);_0x1e9996[_0x7bdb('0x2f')]=_[_0x7bdb('0x2e')](_0xd2d7be[_0x7bdb('0x29')],qs['fields'](_0x371e8a['query']['fields']));_0x1e9996[_0x7bdb('0x2f')]=_0x1e9996['attributes'][_0x7bdb('0x30')]?_0x1e9996['attributes']:_0xd2d7be[_0x7bdb('0x29')];if(_0x371e8a[_0x7bdb('0x2c')][_0x7bdb('0x31')]){_0x1e9996['include']=[{'all':!![]}];}_0x1e9996=_[_0x7bdb('0x32')]({},_0x1e9996,_0x371e8a['options']);return db['MailApplication'][_0x7bdb('0x33')](_0x1e9996)['then'](handleEntityNotFound(_0x2e8e65,null))[_0x7bdb('0x34')](respondWithResult(_0x2e8e65,null))['catch'](handleError(_0x2e8e65,null));};exports['update']=function(_0x206c26,_0x353b26){if(_0x206c26[_0x7bdb('0x35')]['id']){delete _0x206c26[_0x7bdb('0x35')]['id'];}return db[_0x7bdb('0x2b')][_0x7bdb('0x33')]({'where':{'id':_0x206c26['params']['id']}})[_0x7bdb('0x34')](handleEntityNotFound(_0x353b26,null))[_0x7bdb('0x34')](saveUpdates(_0x206c26[_0x7bdb('0x35')],null))[_0x7bdb('0x34')](respondWithResult(_0x353b26,null))[_0x7bdb('0x36')](handleError(_0x353b26,null));};exports[_0x7bdb('0x37')]=function(_0x228340,_0x2587af){return db[_0x7bdb('0x2b')]['find']({'where':{'id':_0x228340['params']['id']}})[_0x7bdb('0x34')](handleEntityNotFound(_0x2587af,null))[_0x7bdb('0x34')](removeEntity(_0x2587af,null))[_0x7bdb('0x36')](handleError(_0x2587af,null));};
\ No newline at end of file
index b9718b4..053775c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xac73=['bluebird','path','rimraf','./mailApplication.attributes','define','MailApplication','util','../../config/logger','api','moment'];(function(_0x39979b,_0x2111f9){var _0x560b41=function(_0x859cc0){while(--_0x859cc0){_0x39979b['push'](_0x39979b['shift']());}};_0x560b41(++_0x2111f9);}(_0xac73,0x1dc));var _0x3ac7=function(_0x16617d,_0x13eaba){_0x16617d=_0x16617d-0x0;var _0x2b0e2a=_0xac73[_0x16617d];return _0x2b0e2a;};'use strict';var _=require('lodash');var util=require(_0x3ac7('0x0'));var logger=require(_0x3ac7('0x1'))(_0x3ac7('0x2'));var moment=require(_0x3ac7('0x3'));var BPromise=require(_0x3ac7('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3ac7('0x5'));var rimraf=require(_0x3ac7('0x6'));var config=require('../../config/environment');var attributes=require(_0x3ac7('0x7'));module['exports']=function(_0x4dc55d,_0x9eef70){return _0x4dc55d[_0x3ac7('0x8')](_0x3ac7('0x9'),attributes,{'tableName':'mail_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x1fa3=['../../config/logger','api','moment','request-promise','path','rimraf','./mailApplication.attributes','define','MailApplication','mail_applications','utf8mb4','utf8mb4_unicode_ci','util'];(function(_0x57b6ae,_0x2ca66e){var _0x8d7f4a=function(_0x4e8523){while(--_0x4e8523){_0x57b6ae['push'](_0x57b6ae['shift']());}};_0x8d7f4a(++_0x2ca66e);}(_0x1fa3,0x144));var _0x31fa=function(_0x378977,_0x120516){_0x378977=_0x378977-0x0;var _0x313a76=_0x1fa3[_0x378977];return _0x313a76;};'use strict';var _=require('lodash');var util=require(_0x31fa('0x0'));var logger=require(_0x31fa('0x1'))(_0x31fa('0x2'));var moment=require(_0x31fa('0x3'));var BPromise=require('bluebird');var rp=require(_0x31fa('0x4'));var fs=require('fs');var path=require(_0x31fa('0x5'));var rimraf=require(_0x31fa('0x6'));var config=require('../../config/environment');var attributes=require(_0x31fa('0x7'));module['exports']=function(_0x27845f,_0x1753f3){return _0x27845f[_0x31fa('0x8')](_0x31fa('0x9'),attributes,{'tableName':_0x31fa('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x31fa('0xb'),'collate':_0x31fa('0xc')});};
\ No newline at end of file
index f448d8e..d3f2e5d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0016=['info','catch','UpdateMailApplication','MailApplication','update','body','options','where','attributes','then','stringify','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','request','request\x20sent','MailApplication,\x20%s,\x20%s,\x20%s','MailApplication,\x20%s,\x20%s','error','message'];(function(_0x3d905,_0x7b688d){var _0x3a990b=function(_0x5b79a6){while(--_0x5b79a6){_0x3d905['push'](_0x3d905['shift']());}};_0x3a990b(++_0x7b688d);}(_0x0016,0x113));var _0x6001=function(_0x35d4e9,_0x298c61){_0x35d4e9=_0x35d4e9-0x0;var _0x5c2770=_0x0016[_0x35d4e9];return _0x5c2770;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x6001('0x0'));var rs=require(_0x6001('0x1'));var fs=require('fs');var Redis=require(_0x6001('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6001('0x3'))(_0x6001('0x4'));var config=require(_0x6001('0x5'));var jayson=require(_0x6001('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x48b282,_0x5bc334,_0x52ac7e){return new BPromise(function(_0x449ed0,_0xda8f0b){return client[_0x6001('0x7')](_0x48b282,_0x52ac7e)['then'](function(_0x220e4e){logger['info']('MailApplication,\x20%s,\x20%s',_0x5bc334,_0x6001('0x8'));logger['debug'](_0x6001('0x9'),_0x5bc334,_0x6001('0x8'),JSON['stringify'](_0x220e4e));if(_0x220e4e['error']){if(_0x220e4e['error']['code']===0x1f4){logger['error'](_0x6001('0xa'),_0x5bc334,_0x220e4e[_0x6001('0xb')][_0x6001('0xc')]);return _0xda8f0b(_0x220e4e[_0x6001('0xb')][_0x6001('0xc')]);}logger[_0x6001('0xb')](_0x6001('0xa'),_0x5bc334,_0x220e4e['error']['message']);return _0x449ed0(_0x220e4e[_0x6001('0xb')][_0x6001('0xc')]);}else{logger[_0x6001('0xd')](_0x6001('0xa'),_0x5bc334,_0x6001('0x8'));_0x449ed0(_0x220e4e['result'][_0x6001('0xc')]);}})[_0x6001('0xe')](function(_0x15526b){logger[_0x6001('0xb')](_0x6001('0xa'),_0x5bc334,_0x15526b);_0xda8f0b(_0x15526b);});});}exports[_0x6001('0xf')]=function(_0x539a27){var _0x29fc59=this;return new Promise(function(_0x19f55f,_0x2a5583){return db[_0x6001('0x10')][_0x6001('0x11')](_0x539a27[_0x6001('0x12')],{'raw':_0x539a27['options']?_0x539a27[_0x6001('0x13')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x539a27[_0x6001('0x13')]?_0x539a27['options'][_0x6001('0x14')]||null:null,'attributes':_0x539a27[_0x6001('0x13')]?_0x539a27[_0x6001('0x13')][_0x6001('0x15')]||null:null,'limit':_0x539a27['options']?_0x539a27['options']['limit']||null:null})[_0x6001('0x16')](function(_0x44472f){logger[_0x6001('0xd')](_0x6001('0xf'),_0x539a27);logger['debug'](_0x6001('0xf'),_0x539a27,JSON[_0x6001('0x17')](_0x44472f));_0x19f55f(_0x44472f);})[_0x6001('0xe')](function(_0x12eefb){logger['error'](_0x6001('0xf'),_0x12eefb[_0x6001('0xc')],_0x539a27);_0x2a5583(_0x29fc59[_0x6001('0xb')](0x1f4,_0x12eefb[_0x6001('0xc')]));});});};
\ No newline at end of file
+var _0x8f92=['http','info','MailApplication,\x20%s,\x20%s','MailApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','MailApplication','body','options','raw','where','attributes','limit','then','UpdateMailApplication','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client'];(function(_0x2afccc,_0x443a1a){var _0x485666=function(_0x3ce6a8){while(--_0x3ce6a8){_0x2afccc['push'](_0x2afccc['shift']());}};_0x485666(++_0x443a1a);}(_0x8f92,0x15d));var _0x28f9=function(_0x3c02d8,_0x42d3e8){_0x3c02d8=_0x3c02d8-0x0;var _0x178444=_0x8f92[_0x3c02d8];return _0x178444;};'use strict';var _=require(_0x28f9('0x0'));var util=require(_0x28f9('0x1'));var moment=require(_0x28f9('0x2'));var BPromise=require(_0x28f9('0x3'));var rs=require(_0x28f9('0x4'));var fs=require('fs');var Redis=require(_0x28f9('0x5'));var db=require(_0x28f9('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x28f9('0x7'))(_0x28f9('0x8'));var config=require(_0x28f9('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x28f9('0xa')][_0x28f9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1488a1,_0x84ac35,_0x40ac1f){return new BPromise(function(_0xcf0f57,_0x1f5b5e){return client['request'](_0x1488a1,_0x40ac1f)['then'](function(_0x4cb4f2){logger[_0x28f9('0xc')](_0x28f9('0xd'),_0x84ac35,'request\x20sent');logger['debug'](_0x28f9('0xe'),_0x84ac35,_0x28f9('0xf'),JSON[_0x28f9('0x10')](_0x4cb4f2));if(_0x4cb4f2[_0x28f9('0x11')]){if(_0x4cb4f2[_0x28f9('0x11')][_0x28f9('0x12')]===0x1f4){logger[_0x28f9('0x11')](_0x28f9('0xd'),_0x84ac35,_0x4cb4f2['error'][_0x28f9('0x13')]);return _0x1f5b5e(_0x4cb4f2[_0x28f9('0x11')][_0x28f9('0x13')]);}logger[_0x28f9('0x11')](_0x28f9('0xd'),_0x84ac35,_0x4cb4f2['error']['message']);return _0xcf0f57(_0x4cb4f2[_0x28f9('0x11')][_0x28f9('0x13')]);}else{logger[_0x28f9('0xc')](_0x28f9('0xd'),_0x84ac35,'request\x20sent');_0xcf0f57(_0x4cb4f2[_0x28f9('0x14')]['message']);}})['catch'](function(_0x19f806){logger[_0x28f9('0x11')]('MailApplication,\x20%s,\x20%s',_0x84ac35,_0x19f806);_0x1f5b5e(_0x19f806);});});}exports['UpdateMailApplication']=function(_0x235b02){var _0x39a093=this;return new Promise(function(_0x4ab86f,_0xcf16cf){return db[_0x28f9('0x15')]['update'](_0x235b02[_0x28f9('0x16')],{'raw':_0x235b02[_0x28f9('0x17')]?_0x235b02[_0x28f9('0x17')][_0x28f9('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x235b02[_0x28f9('0x17')]?_0x235b02[_0x28f9('0x17')][_0x28f9('0x19')]||null:null,'attributes':_0x235b02[_0x28f9('0x17')]?_0x235b02['options'][_0x28f9('0x1a')]||null:null,'limit':_0x235b02['options']?_0x235b02[_0x28f9('0x17')][_0x28f9('0x1b')]||null:null})[_0x28f9('0x1c')](function(_0x1a1c5a){logger['info'](_0x28f9('0x1d'),_0x235b02);logger['debug'](_0x28f9('0x1d'),_0x235b02,JSON[_0x28f9('0x10')](_0x1a1c5a));_0x4ab86f(_0x1a1c5a);})['catch'](function(_0x363a8f){logger['error'](_0x28f9('0x1d'),_0x363a8f[_0x28f9('0x13')],_0x235b02);_0xcf16cf(_0x39a093[_0x28f9('0x11')](0x1f4,_0x363a8f[_0x28f9('0x13')]));});});};
\ No newline at end of file
index 7336df3..13c8577 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8883=['isAuthenticated','index','/describe','/:id','show','getMessages','create','post','/:id/messages','addMessage','tracked','mail','mailinteraction:addtags','addTags','put','mailinteraction:update','update','delete','destroy','/:id/tags','removeTags','Router','../../components/auth/service','../../components/interaction/service','./mailInteraction.controller','get'];(function(_0xd1c564,_0x37edcd){var _0x5119f3=function(_0x2aee98){while(--_0x2aee98){_0xd1c564['push'](_0xd1c564['shift']());}};_0x5119f3(++_0x37edcd);}(_0x8883,0x7d));var _0x3888=function(_0x2336b2,_0x2b75e4){_0x2336b2=_0x2336b2-0x0;var _0x4d8f46=_0x8883[_0x2336b2];return _0x4d8f46;};'use strict';var express=require('express');var router=express[_0x3888('0x0')]();var auth=require(_0x3888('0x1'));var interaction=require(_0x3888('0x2'));var controller=require(_0x3888('0x3'));router[_0x3888('0x4')]('/',auth[_0x3888('0x5')](),controller[_0x3888('0x6')]);router[_0x3888('0x4')](_0x3888('0x7'),auth[_0x3888('0x5')](),controller['describe']);router[_0x3888('0x4')](_0x3888('0x8'),auth[_0x3888('0x5')](),controller[_0x3888('0x9')]);router[_0x3888('0x4')]('/:id/messages',auth['isAuthenticated'](),controller[_0x3888('0xa')]);router['get']('/:id/download',auth['isAuthenticated'](),controller['download']);router['post']('/',auth[_0x3888('0x5')](),controller[_0x3888('0xb')]);router[_0x3888('0xc')](_0x3888('0xd'),auth[_0x3888('0x5')](),controller[_0x3888('0xe')]);router[_0x3888('0xc')]('/:id/tags',auth[_0x3888('0x5')](),interaction[_0x3888('0xf')](_0x3888('0x10'),_0x3888('0x11')),controller[_0x3888('0x12')]);router[_0x3888('0x13')](_0x3888('0x8'),auth[_0x3888('0x5')](),interaction[_0x3888('0xf')]('mail',_0x3888('0x14')),controller[_0x3888('0x15')]);router[_0x3888('0x16')](_0x3888('0x8'),auth[_0x3888('0x5')](),interaction[_0x3888('0xf')](_0x3888('0x10'),'mailinteraction:destroy'),controller[_0x3888('0x17')]);router['delete'](_0x3888('0x18'),auth[_0x3888('0x5')](),controller[_0x3888('0x19')]);module['exports']=router;
\ No newline at end of file
+var _0x675e=['describe','/:id','show','/:id/messages','isAuthenticated','/:id/download','post','addMessage','mailinteraction:addtags','put','tracked','mail','mailinteraction:update','update','delete','mailinteraction:destroy','/:id/tags','removeTags','exports','express','Router','../../components/auth/service','../../components/interaction/service','./mailInteraction.controller','index','get','/describe'];(function(_0x1815a5,_0x286537){var _0x31c7ed=function(_0x4c1c52){while(--_0x4c1c52){_0x1815a5['push'](_0x1815a5['shift']());}};_0x31c7ed(++_0x286537);}(_0x675e,0xb5));var _0xe675=function(_0x1f62c3,_0x1ff95b){_0x1f62c3=_0x1f62c3-0x0;var _0x385c1c=_0x675e[_0x1f62c3];return _0x385c1c;};'use strict';var express=require(_0xe675('0x0'));var router=express[_0xe675('0x1')]();var auth=require(_0xe675('0x2'));var interaction=require(_0xe675('0x3'));var controller=require(_0xe675('0x4'));router['get']('/',auth['isAuthenticated'](),controller[_0xe675('0x5')]);router[_0xe675('0x6')](_0xe675('0x7'),auth['isAuthenticated'](),controller[_0xe675('0x8')]);router['get'](_0xe675('0x9'),auth['isAuthenticated'](),controller[_0xe675('0xa')]);router[_0xe675('0x6')](_0xe675('0xb'),auth[_0xe675('0xc')](),controller['getMessages']);router[_0xe675('0x6')](_0xe675('0xd'),auth['isAuthenticated'](),controller['download']);router[_0xe675('0xe')]('/',auth[_0xe675('0xc')](),controller['create']);router[_0xe675('0xe')](_0xe675('0xb'),auth[_0xe675('0xc')](),controller[_0xe675('0xf')]);router[_0xe675('0xe')]('/:id/tags',auth[_0xe675('0xc')](),interaction['tracked']('mail',_0xe675('0x10')),controller['addTags']);router[_0xe675('0x11')](_0xe675('0x9'),auth[_0xe675('0xc')](),interaction[_0xe675('0x12')](_0xe675('0x13'),_0xe675('0x14')),controller[_0xe675('0x15')]);router[_0xe675('0x16')](_0xe675('0x9'),auth[_0xe675('0xc')](),interaction['tracked'](_0xe675('0x13'),_0xe675('0x17')),controller['destroy']);router[_0xe675('0x16')](_0xe675('0x18'),auth['isAuthenticated'](),controller[_0xe675('0x19')]);module[_0xe675('0x1a')]=router;
\ No newline at end of file
index a7c0187..045bcfe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd559=['iconv','exports','DATE','STRING','TEXT','BOOLEAN','ENUM','sequelize'];(function(_0x1f7cc5,_0x4456c0){var _0x1d4e1c=function(_0x48e2b8){while(--_0x48e2b8){_0x1f7cc5['push'](_0x1f7cc5['shift']());}};_0x1d4e1c(++_0x4456c0);}(_0xd559,0x97));var _0x9d55=function(_0x47024a,_0x2cc60a){_0x47024a=_0x47024a-0x0;var _0xc021b8=_0xd559[_0x47024a];return _0xc021b8;};'use strict';var Sequelize=require(_0x9d55('0x0'));var iconv=require(_0x9d55('0x1'));module[_0x9d55('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x9d55('0x3')]},'disposition':{'type':Sequelize[_0x9d55('0x4')]},'secondDisposition':{'type':Sequelize[_0x9d55('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x9d55('0x4')]},'inReplyTo':{'type':Sequelize[_0x9d55('0x4')](0x1fe)},'to':{'type':Sequelize[_0x9d55('0x4')]},'cc':{'type':Sequelize['TEXT']('long')},'subject':{'type':Sequelize[_0x9d55('0x5')]()},'attach':{'type':Sequelize[_0x9d55('0x6')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x9d55('0x3')]},'substatus':{'type':Sequelize[_0x9d55('0x4')](0x3c)},'substatusAt':{'type':Sequelize[_0x9d55('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x9d55('0x7')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x9d55('0x3')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0x6dff=['BOOLEAN','DATE','ENUM','out','sequelize','iconv','exports','STRING','TEXT'];(function(_0x86b219,_0x43038f){var _0x1f320c=function(_0x8cd63f){while(--_0x8cd63f){_0x86b219['push'](_0x86b219['shift']());}};_0x1f320c(++_0x43038f);}(_0x6dff,0x12d));var _0xf6df=function(_0x2c8411,_0x4c8332){_0x2c8411=_0x2c8411-0x0;var _0x4865ee=_0x6dff[_0x2c8411];return _0x4865ee;};'use strict';var Sequelize=require(_0xf6df('0x0'));var iconv=require(_0xf6df('0x1'));module[_0xf6df('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xf6df('0x3')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xf6df('0x3')]},'inReplyTo':{'type':Sequelize[_0xf6df('0x3')](0x1fe)},'to':{'type':Sequelize[_0xf6df('0x3')]},'cc':{'type':Sequelize[_0xf6df('0x4')]('long')},'subject':{'type':Sequelize[_0xf6df('0x4')]()},'attach':{'type':Sequelize[_0xf6df('0x5')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0xf6df('0x6')]},'substatus':{'type':Sequelize[_0xf6df('0x3')](0x3c)},'substatusAt':{'type':Sequelize[_0xf6df('0x6')]},'firstMsgDirection':{'type':Sequelize[_0xf6df('0x7')]('in',_0xf6df('0x8')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xf6df('0x7')]('in',_0xf6df('0x8')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
index d7de5bf..c725879 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5fc3=['hasOwnProperty','nolimit','sort','filters','select','field','color','from','tools_tags','u.fullname','ui.MailInteractionId','user_has_mail_interactions','left_join','users','u.id\x20=\x20ui.UserId','mail_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','mail_accounts','a.id\x20=\x20i.MailAccountId','mail_messages','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','parseSearch','sqlOperator','conditions','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?','find','ContactId','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?','buildExpression','some','compact','isEmpty','MailAccountId','where','i.MailAccountId\x20IN\x20?','createdAt','$gte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','Sequelize','QueryTypes','SELECT','clone','order','contactName','DESC','resolve','i.MailAccountId\x20IS\x20NOT\x20NULL','user','role','getMailAccounts','i.MailAccountId\x20IS\x20NULL','agent','toString','sequelize','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','Account.key','a.mandatoryDisposition','i.updatedAt','i.closedAt','i.lastMsgAt','i.subject','i.secondDisposition','i.thirdDisposition','i.substatus','i.to','i.ContactId','i.MailAccountId','i.UserId','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','c.mobile','Contact.mobile','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','ui.MailInteractionId\x20IN\x20?','groupBy','MailInteractionId','Setting','enableEmailPreview','all','rows','show','params','includeAll','merge','options','create','describe','addMessage','body','ids','getMessages','YYYY-MM-DD\x20HH:mm:ss','include','findAll','addTags','omit','spread','emit','removeTags','download','unix','server','files','join','root','attachments','transcript-%d-%s.zip','Attachments','Messages','bcc','subject','get','each','decode','format','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','basename','readFileSync','build','message%d.eml','unlinkSync','eml-format','rimraf','moment','bluebird','util','path','lodash','juice','ioredis','../../components/parsers/qs','api','../../mysqldb','html-entities','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','register','status','end','json','count','offset','limit','set','Content-Range','update','then','destroy','sendStatus','error','stack','name','send','Users','Tags','TagIds','forEach','push','MailMessage','findOne','out','-id','plainBody','lastMsgText','trimStart','catch','waiting','talking','unmanaged','total','closed','UserId','index','map','MailInteraction','rawAttributes','fieldName','type','model','keys','query','intersection','attributes','fields','length'];(function(_0x239904,_0x4b11e2){var _0x259609=function(_0x41d52a){while(--_0x41d52a){_0x239904['push'](_0x239904['shift']());}};_0x259609(++_0x4b11e2);}(_0x5fc3,0xa8));var _0x35fc=function(_0x423097,_0x8a09f4){_0x423097=_0x423097-0x0;var _0x3a73f1=_0x5fc3[_0x423097];return _0x3a73f1;};'use strict';var emlformat=require(_0x35fc('0x0'));var rimraf=require(_0x35fc('0x1'));var zipdir=require('zip-dir');var moment=require(_0x35fc('0x2'));var BPromise=require(_0x35fc('0x3'));var util=require(_0x35fc('0x4'));var path=require(_0x35fc('0x5'));var fs=require('fs');var _=require(_0x35fc('0x6'));var squel=require('squel');var juice=require(_0x35fc('0x7'));var Redis=require(_0x35fc('0x8'));var qs=require(_0x35fc('0x9'));var as=require('../../components/parsers/advancedSearch');var logger=require('../../config/logger')(_0x35fc('0xa'));var config=require('../../config/environment');var db=require(_0x35fc('0xb'))['db'];var htmlEntities=require(_0x35fc('0xc'));config[_0x35fc('0xd')]=_[_0x35fc('0xe')](config[_0x35fc('0xd')],{'host':_0x35fc('0xf'),'port':0x18eb});var socket=require(_0x35fc('0x10'))(new Redis(config['redis']));require(_0x35fc('0x11'))[_0x35fc('0x12')](socket);function respondWithStatusCode(_0x4fdca1,_0x471549){_0x471549=_0x471549||0xcc;return function(_0x33f491){if(_0x33f491){return _0x4fdca1['sendStatus'](_0x471549);}return _0x4fdca1[_0x35fc('0x13')](_0x471549)[_0x35fc('0x14')]();};}function respondWithResult(_0x5469f5,_0x4cbe74){_0x4cbe74=_0x4cbe74||0xc8;return function(_0x409357){if(_0x409357){return _0x5469f5['status'](_0x4cbe74)[_0x35fc('0x15')](_0x409357);}};}function respondWithFilteredResult(_0x22055e,_0x2a6ad2){return function(_0x29730f){if(_0x29730f){var _0x38d9f2=typeof _0x2a6ad2['offset']==='undefined'&&typeof _0x2a6ad2['limit']==='undefined';var _0x398b67=_0x29730f[_0x35fc('0x16')];var _0x53b898=_0x38d9f2?0x0:_0x2a6ad2[_0x35fc('0x17')];var _0x227a49=_0x38d9f2?_0x29730f[_0x35fc('0x16')]:_0x2a6ad2['offset']+_0x2a6ad2[_0x35fc('0x18')];var _0x45c8b7;if(_0x227a49>=_0x398b67){_0x227a49=_0x398b67;_0x45c8b7=0xc8;}else{_0x45c8b7=0xce;}_0x22055e['status'](_0x45c8b7);return _0x22055e[_0x35fc('0x19')](_0x35fc('0x1a'),_0x53b898+'-'+_0x227a49+'/'+_0x398b67)[_0x35fc('0x15')](_0x29730f);}return null;};}function saveUpdates(_0x5f56c6){return function(_0x1a86e9){if(_0x1a86e9){return _0x1a86e9[_0x35fc('0x1b')](_0x5f56c6)[_0x35fc('0x1c')](function(_0x488234){return _0x488234;});}return null;};}function removeEntity(_0x402cff){return function(_0x350a27){if(_0x350a27){return _0x350a27[_0x35fc('0x1d')]()[_0x35fc('0x1c')](function(){_0x402cff[_0x35fc('0x13')](0xcc)[_0x35fc('0x14')]();});}};}function handleEntityNotFound(_0x155016){return function(_0x3b05b0){if(!_0x3b05b0){_0x155016[_0x35fc('0x1e')](0x194);}return _0x3b05b0;};}function handleError(_0x427eae,_0x5bd2b8){_0x5bd2b8=_0x5bd2b8||0x1f4;return function(_0x323aee){logger[_0x35fc('0x1f')](_0x323aee[_0x35fc('0x20')]);if(_0x323aee[_0x35fc('0x21')]){delete _0x323aee[_0x35fc('0x21')];}_0x427eae['status'](_0x5bd2b8)[_0x35fc('0x22')](_0x323aee);};}function getInteractionUsers(_0x4c587a,_0x561bf8){return new BPromise(function(_0x265324,_0x5a93df){try{if(_0x561bf8[_0x4c587a['id']]){_0x4c587a[_0x35fc('0x23')]=_['map'](_0x561bf8[_0x4c587a['id']],function(_0x4086e9){return{'id':_0x4086e9['id'],'fullname':_0x4086e9['fullname']};});}}catch(_0x1bf180){_0x5a93df(_0x1bf180);}_0x265324(_0x4c587a);});}function getInteractionTags(_0xdfab9f,_0x5cb986){return new BPromise(function(_0x519264,_0x47774c){try{if(_0xdfab9f['TagIds']){_0xdfab9f[_0x35fc('0x24')]=[];_0xdfab9f[_0x35fc('0x25')]['split'](',')[_0x35fc('0x26')](function(_0x645eac){_0xdfab9f[_0x35fc('0x24')][_0x35fc('0x27')](_0x5cb986[_0x645eac]);});}delete _0xdfab9f[_0x35fc('0x25')];}catch(_0x134dfa){_0x47774c(_0x134dfa);}_0x519264(_0xdfab9f);});}function getLastMessageText(_0x11ccdb){return new BPromise(function(_0x451f0c,_0x54aedc){return db[_0x35fc('0x28')][_0x35fc('0x29')]({'where':{'$and':[{'MailInteractionId':_0x11ccdb['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x35fc('0x2a')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':['plainBody'],'order':_0x35fc('0x2b'),'raw':!![]})[_0x35fc('0x1c')](function(_0x3822a8){if(_0x3822a8&&_0x3822a8[_0x35fc('0x2c')]){_0x11ccdb[_0x35fc('0x2d')]=_[_0x35fc('0x2e')](_0x3822a8[_0x35fc('0x2c')]);}_0x451f0c(_0x11ccdb);})[_0x35fc('0x2f')](function(_0xf4dfab){_0x54aedc(_0xf4dfab);});});}function updateMailInteraction(_0x127bfc,_0x57072d,_0x5e0313,_0x114bc1){return new BPromise(function(_0x4af5fe,_0x37b394){return getInteractionUsers(_0x127bfc,_0x5e0313)[_0x35fc('0x1c')](function(_0x1c4b8b){return getInteractionTags(_0x1c4b8b,_0x57072d);})[_0x35fc('0x1c')](function(_0x271ba9){return getStateInteraction(_0x271ba9);})[_0x35fc('0x1c')](function(_0x4e43b4){if(_0x114bc1){_0x4af5fe(getLastMessageText(_0x4e43b4));}else{_0x4af5fe(_0x4e43b4);}})[_0x35fc('0x2f')](function(_0x330a14){_0x37b394(_0x330a14);});});}function getStateInteraction(_0x46b9ef){return new BPromise(function(_0x4441d8){_0x46b9ef[_0x35fc('0x30')]=0x0;_0x46b9ef[_0x35fc('0x31')]=0x0;_0x46b9ef['answered']=0x0;_0x46b9ef[_0x35fc('0x32')]=0x0;_0x46b9ef[_0x35fc('0x33')]=0x0;if(!_0x46b9ef[_0x35fc('0x34')]&&!_0x46b9ef['UserId']){_0x46b9ef[_0x35fc('0x30')]+=0x1;}if(!_0x46b9ef['closed']&&_0x46b9ef[_0x35fc('0x35')]){_0x46b9ef[_0x35fc('0x31')]+=0x1;if(_0x46b9ef[_0x35fc('0x30')]){_0x46b9ef[_0x35fc('0x30')]-=0x1;}}if(_0x46b9ef['closed']&&_0x46b9ef['UserId']){_0x46b9ef['answered']+=0x1;if(_0x46b9ef[_0x35fc('0x31')]){_0x46b9ef['talking']-=0x1;}}if(_0x46b9ef[_0x35fc('0x34')]&&!_0x46b9ef['UserId']){_0x46b9ef[_0x35fc('0x32')]+=0x1;if(_0x46b9ef[_0x35fc('0x30')]){_0x46b9ef[_0x35fc('0x30')]-=0x1;}}_0x46b9ef[_0x35fc('0x33')]+=0x1;_0x4441d8(_0x46b9ef);});}exports[_0x35fc('0x36')]=function(_0x3313fa,_0x9fe7d6){var _0x4ec0dc={},_0x4467f8={},_0x16087d={'count':0x0,'rows':[]};var _0x4e0ce3=_[_0x35fc('0x37')](db[_0x35fc('0x38')][_0x35fc('0x39')],function(_0x1d2ffe){return{'name':_0x1d2ffe[_0x35fc('0x3a')],'type':_0x1d2ffe[_0x35fc('0x3b')]['key']};});_0x4467f8[_0x35fc('0x3c')]=_[_0x35fc('0x37')](_0x4e0ce3,_0x35fc('0x21'));_0x4467f8['query']=_[_0x35fc('0x3d')](_0x3313fa[_0x35fc('0x3e')]);_0x4467f8['filters']=_[_0x35fc('0x3f')](_0x4467f8[_0x35fc('0x3c')],_0x4467f8[_0x35fc('0x3e')]);_0x4ec0dc[_0x35fc('0x40')]=_[_0x35fc('0x3f')](_0x4467f8[_0x35fc('0x3c')],qs[_0x35fc('0x41')](_0x3313fa[_0x35fc('0x3e')]['fields']));_0x4ec0dc['attributes']=_0x4ec0dc[_0x35fc('0x40')][_0x35fc('0x42')]?_0x4ec0dc['attributes']:_0x4467f8['model'];if(!_0x3313fa['query'][_0x35fc('0x43')](_0x35fc('0x44'))){_0x4ec0dc['limit']=qs[_0x35fc('0x18')](_0x3313fa[_0x35fc('0x3e')][_0x35fc('0x18')]);_0x4ec0dc[_0x35fc('0x17')]=qs['offset'](_0x3313fa['query']['offset']);}_0x4ec0dc['order']=qs['sort'](_0x3313fa[_0x35fc('0x3e')][_0x35fc('0x45')]);_0x4ec0dc['where']=qs[_0x35fc('0x46')](_['pick'](_0x3313fa[_0x35fc('0x3e')],_0x4467f8[_0x35fc('0x46')]),_0x4e0ce3);var _0x350237=[];var _0x2de5d1=squel[_0x35fc('0x47')]()['field']('id')[_0x35fc('0x48')](_0x35fc('0x21'))['field'](_0x35fc('0x49'))[_0x35fc('0x4a')](_0x35fc('0x4b'));var _0x211746=squel['select']()[_0x35fc('0x48')]('u.id')['field'](_0x35fc('0x4c'))[_0x35fc('0x48')](_0x35fc('0x4d'))[_0x35fc('0x4a')](_0x35fc('0x4e'),'ui')[_0x35fc('0x4f')](_0x35fc('0x50'),'u',_0x35fc('0x51'));var _0x4f555f=squel[_0x35fc('0x47')]()[_0x35fc('0x4a')](_0x35fc('0x52'),'i')[_0x35fc('0x4f')](_0x35fc('0x53'),'c',_0x35fc('0x54'))[_0x35fc('0x4f')](_0x35fc('0x50'),'o',_0x35fc('0x55'))[_0x35fc('0x4f')](_0x35fc('0x56'),'a',_0x35fc('0x57'))[_0x35fc('0x4f')](_0x35fc('0x58'),'me','me.MailInteractionId\x20=\x20i.id')['left_join'](_0x35fc('0x59'),'it',_0x35fc('0x5a'))[_0x35fc('0x4f')](_0x35fc('0x4b'),'t',_0x35fc('0x5b'));var _0x3e6494=squel['expr']();var _0x4f024c=[];var _0x388521=squel[_0x35fc('0x5c')]();var _0x395d63;if(_0x3313fa[_0x35fc('0x3e')]['search']){_0x395d63=as[_0x35fc('0x5d')](_0x3313fa[_0x35fc('0x3e')]['search']);var _0x199a00=_0x395d63[_0x35fc('0x5e')];for(var _0x590faa=0x0;_0x590faa<_0x395d63[_0x35fc('0x5f')][_0x35fc('0x42')];_0x590faa++){var _0x26118e=_0x395d63[_0x35fc('0x5f')][_0x590faa];var _0x5e4018='i';var _0x4de34b=_['find'](_0x4e0ce3,[_0x35fc('0x21'),_0x26118e[_0x35fc('0x48')]]);if(!_0x4de34b){switch(_0x26118e['field']){case _0x35fc('0x60'):if(_0x26118e[_0x35fc('0x61')]==0x1){_0x4f555f[_0x35fc('0x62')]('`'+_0x26118e[_0x35fc('0x48')]+_0x35fc('0x63'));}else{_0x4f555f['having']('`'+_0x26118e[_0x35fc('0x48')]+_0x35fc('0x64'));}break;case _0x35fc('0x65'):if(_0x26118e['operator']===_0x35fc('0x66')){if(_0x26118e[_0x35fc('0x61')]['split']('\x20')[_0x35fc('0x42')]>0x1){_0x3e6494[_0x199a00](_0x35fc('0x67'),qs[_0x35fc('0x68')](_0x26118e[_0x35fc('0x61')]),null);}else{var _0x314666='%'+_0x26118e[_0x35fc('0x61')]+'%';_0x3e6494[_0x199a00](_0x35fc('0x69'),_0x314666,_0x314666,_0x314666);}}else{_0x4de34b=_[_0x35fc('0x6a')](_0x4e0ce3,['name',_0x35fc('0x6b')]);_0x26118e[_0x35fc('0x48')]=_0x35fc('0x6b');_0x10dd1a=as['buildExpression'](_0x5e4018,_0x4de34b[_0x35fc('0x3b')],_0x26118e);_0x3e6494[_0x199a00](_0x10dd1a['text'],_0x10dd1a['value']['start'],_0x10dd1a[_0x35fc('0x61')][_0x35fc('0x14')]);}break;case _0x35fc('0x6c'):var _0x13901c=_0x26118e[_0x35fc('0x61')]['split'](',')['map'](function(_0x5353ea){return Number(_0x5353ea);});_0x13901c['forEach'](function(_0x51d231){_0x388521['or'](_0x35fc('0x6d'),'%,'+_0x51d231+',%');});_0x4f024c=_[_0x35fc('0x6e')](_0x4f024c,_0x13901c);break;case _0x35fc('0x6f'):if(_0x26118e[_0x35fc('0x70')]==='$substring'){_0x3e6494[_0x199a00](_0x35fc('0x71'),'%'+_0x26118e[_0x35fc('0x61')]+'%',null);}else{_0x4de34b=_[_0x35fc('0x6a')](_0x4e0ce3,[_0x35fc('0x21'),_0x35fc('0x35')]);_0x26118e[_0x35fc('0x48')]=_0x35fc('0x35');_0x10dd1a=as[_0x35fc('0x72')](_0x5e4018,_0x4de34b[_0x35fc('0x3b')],_0x26118e);_0x3e6494[_0x199a00](_0x10dd1a['text'],_0x10dd1a[_0x35fc('0x61')]['start'],_0x10dd1a[_0x35fc('0x61')][_0x35fc('0x14')]);}break;case _0x35fc('0x2c'):_0x10dd1a=as[_0x35fc('0x72')]('me',null,_0x26118e);_0x3e6494[_0x199a00](_0x10dd1a['text'],_0x10dd1a[_0x35fc('0x61')]['start'],_0x10dd1a['value']['end']);break;}}else{var _0x10dd1a=as['buildExpression'](_0x5e4018,_0x4de34b[_0x35fc('0x3b')],_0x26118e);_0x3e6494[_0x199a00](_0x10dd1a['text'],_0x10dd1a[_0x35fc('0x61')]['start'],_0x10dd1a[_0x35fc('0x61')][_0x35fc('0x14')]);}}}else{var _0x3400f0=_(_0x3313fa[_0x35fc('0x3e')])['keys']()[_0x35fc('0x37')](function(_0x1e2214){return _[_0x35fc('0x73')](_0x4e0ce3,['name',_0x1e2214])?_0x1e2214:undefined;})[_0x35fc('0x74')]()[_0x35fc('0x61')]();if(!_[_0x35fc('0x75')](_0x3400f0)){_0x3400f0[_0x35fc('0x26')](function(_0x1e4e15){if(_0x1e4e15===_0x35fc('0x76')){_0x4f555f[_0x35fc('0x77')](_0x35fc('0x78'),[]['concat'](_0x3313fa[_0x35fc('0x3e')][_0x1e4e15]));}else if(_0x1e4e15===_0x35fc('0x79')){var _0x2600d2=JSON['parse'](_0x3313fa[_0x35fc('0x3e')][_0x1e4e15])[_0x35fc('0x7a')];var _0x586729=JSON['parse'](_0x3313fa[_0x35fc('0x3e')][_0x1e4e15])['$lte'];_0x4f555f[_0x35fc('0x77')](_0x35fc('0x7b'),_0x2600d2,_0x586729);}else{if(_0x3313fa[_0x35fc('0x3e')][_0x1e4e15]===_0x35fc('0x7c')){_0x4f555f[_0x35fc('0x77')]('i.'+_0x1e4e15+_0x35fc('0x7d'));}else{_0x4f555f[_0x35fc('0x77')]('i.'+_0x1e4e15+_0x35fc('0x7e'),_0x3313fa[_0x35fc('0x3e')][_0x1e4e15]);}}});}if(_0x3313fa[_0x35fc('0x3e')][_0x35fc('0x7f')]){if(_0x3313fa[_0x35fc('0x3e')][_0x35fc('0x7f')]==0x1){_0x4f555f[_0x35fc('0x62')](_0x35fc('0x80'));}else{_0x4f555f[_0x35fc('0x62')](_0x35fc('0x81'));}}if(_0x3313fa[_0x35fc('0x3e')][_0x35fc('0x82')]){_0x4f024c=_[_0x35fc('0x83')](_0x3313fa['query'][_0x35fc('0x82')])?_0x3313fa['query'][_0x35fc('0x82')]:new Array(_0x3313fa[_0x35fc('0x3e')][_0x35fc('0x82')]);_0x4f024c[_0x35fc('0x26')](function(_0x25af78){_0x388521['or'](_0x35fc('0x6d'),'%,'+_0x25af78+',%');});}if(_0x3313fa[_0x35fc('0x3e')][_0x35fc('0x84')]){var _0x2fed7b=_0x3313fa[_0x35fc('0x3e')][_0x35fc('0x84')]['replace']('\x5c','\x5c\x5c')[_0x35fc('0x85')](/'/g,'\x27\x27');if(qs[_0x35fc('0x86')](_0x2fed7b)){_0x3e6494['or'](_0x35fc('0x87'),_0x2fed7b+'%');}else if(qs[_0x35fc('0x88')](_0x2fed7b)){_0x3e6494['or'](_0x35fc('0x89'),_0x2fed7b+'%');}else{_0x3e6494['or'](_0x35fc('0x8a'),qs['getFullTextValue'](_0x2fed7b))['or'](_0x35fc('0x8b'),qs[_0x35fc('0x68')](_0x2fed7b));}}}_0x4f555f[_0x35fc('0x77')](_0x3e6494);_0x4f555f[_0x35fc('0x8c')](_0x35fc('0x8d'));var _0x3e2a8e={'type':db[_0x35fc('0x8e')][_0x35fc('0x8f')][_0x35fc('0x90')],'raw':!![]};var _0x5f23d8=_0x4f555f[_0x35fc('0x91')]();_0x5f23d8['field'](_0x35fc('0x8d'));_0x5f23d8[_0x35fc('0x48')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x35fc('0x60'));if(_0x4ec0dc[_0x35fc('0x92')]){_0x4ec0dc[_0x35fc('0x92')][_0x35fc('0x26')](function(_0x4026cc){var _0x1a765f=_0x4026cc[0x0]===_0x35fc('0x93')?_0x4026cc[0x0]:'i.'+_0x4026cc[0x0];_0x4f555f[_0x35fc('0x92')](_0x1a765f,_0x4026cc[0x1]===_0x35fc('0x94')?![]:!![]);});}if(!_['isEmpty'](_0x4f024c)){_0x4f555f['having'](_0x388521);_0x5f23d8['where']('t.id\x20IN\x20?',_0x4f024c);}BPromise[_0x35fc('0x95')]()[_0x35fc('0x1c')](function(){if(!_0x395d63){if(_0x3313fa[_0x35fc('0x3e')][_0x35fc('0x76')])return;_0x5f23d8[_0x35fc('0x77')]('i.MailAccountId\x20IS\x20NOT\x20NULL');_0x4f555f[_0x35fc('0x77')](_0x35fc('0x96'));return;}if(_0x3313fa[_0x35fc('0x97')][_0x35fc('0x98')]!=='agent')return;return _0x3313fa[_0x35fc('0x97')][_0x35fc('0x99')]({'attributes':['id'],'raw':!![]})[_0x35fc('0x1c')](function(_0x595a89){if(_[_0x35fc('0x75')](_0x595a89)){_0x5f23d8[_0x35fc('0x77')](_0x35fc('0x9a'));_0x4f555f[_0x35fc('0x77')](_0x35fc('0x9a'));}else{_0x5f23d8[_0x35fc('0x77')](_0x35fc('0x78'),_[_0x35fc('0x37')](_0x595a89,'id'));_0x4f555f['where'](_0x35fc('0x78'),_[_0x35fc('0x37')](_0x595a89,'id'));}});})[_0x35fc('0x1c')](function(){if(_0x3313fa[_0x35fc('0x97')][_0x35fc('0x98')]===_0x35fc('0x9b')&&!_0x395d63&&!_0x3313fa['query'][_0x35fc('0x76')])return[];return db['sequelize']['query'](_0x5f23d8[_0x35fc('0x9c')](),_0x3e2a8e);})['then'](function(_0x1246c7){_0x16087d[_0x35fc('0x16')]=_0x1246c7[_0x35fc('0x42')];if(_0x16087d['count']===0x0)return[];return db[_0x35fc('0x9d')][_0x35fc('0x3e')](_0x2de5d1[_0x35fc('0x9c')](),_0x3e2a8e)[_0x35fc('0x1c')](function(_0x21f7e6){_0x350237=_['keyBy'](_0x21f7e6,'id');_0x3e2a8e=_['merge'](_0x3e2a8e,{'model':db['MailInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x3313fa[_0x35fc('0x3e')]['fields']){_0x4ec0dc[_0x35fc('0x40')][_0x35fc('0x26')](function(_0x391321){_0x4f555f[_0x35fc('0x48')]('i.'+_0x391321);});}else{_0x4f555f['field'](_0x35fc('0x9e'),_0x35fc('0x60'));_0x4f555f[_0x35fc('0x48')]('a.key',_0x35fc('0x9f'));_0x4f555f[_0x35fc('0x48')](_0x35fc('0xa0'),'Account.mandatoryDisposition');_0x4f555f['field']('CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20(\x27%\x27\x20+\x20a.email\x20+\x20\x27%\x27)\x20THEN\x20SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201)\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END',_0x35fc('0x93'));_0x4f555f[_0x35fc('0x48')](_0x35fc('0x8d'));_0x4f555f[_0x35fc('0x48')]('i.createdAt');_0x4f555f[_0x35fc('0x48')](_0x35fc('0xa1'));_0x4f555f['field']('i.closed');_0x4f555f[_0x35fc('0x48')](_0x35fc('0xa2'));_0x4f555f[_0x35fc('0x48')]('i.attach');_0x4f555f['field'](_0x35fc('0xa3'));_0x4f555f[_0x35fc('0x48')]('i.lastMsgDirection');_0x4f555f[_0x35fc('0x48')](_0x35fc('0xa4'));_0x4f555f[_0x35fc('0x48')]('i.disposition');_0x4f555f[_0x35fc('0x48')](_0x35fc('0xa5'));_0x4f555f[_0x35fc('0x48')](_0x35fc('0xa6'));_0x4f555f['field'](_0x35fc('0xa7'));_0x4f555f[_0x35fc('0x48')](_0x35fc('0xa8'));_0x4f555f['field'](_0x35fc('0xa9'));_0x4f555f[_0x35fc('0x48')](_0x35fc('0xaa'));_0x4f555f['field'](_0x35fc('0xab'));_0x4f555f[_0x35fc('0x48')]('c.firstName',_0x35fc('0xac'));_0x4f555f[_0x35fc('0x48')](_0x35fc('0xad'),_0x35fc('0xae'));_0x4f555f[_0x35fc('0x48')](_0x35fc('0xaf'),_0x35fc('0xb0'));_0x4f555f[_0x35fc('0x48')](_0x35fc('0xb1'),'Contact.phone');_0x4f555f[_0x35fc('0x48')](_0x35fc('0xb2'),_0x35fc('0xb3'));_0x4f555f[_0x35fc('0x48')]('c.fax',_0x35fc('0xb4'));_0x4f555f[_0x35fc('0x48')](_0x35fc('0xb5'),_0x35fc('0xb6'));_0x4f555f[_0x35fc('0x48')](_0x35fc('0xb7'),_0x35fc('0xb8'));_0x4f555f[_0x35fc('0x48')]('GROUP_CONCAT(DISTINCT\x20t.id)','TagIds');}if(_0x4ec0dc[_0x35fc('0x18')])_0x4f555f[_0x35fc('0x18')](_0x4ec0dc[_0x35fc('0x18')]);if(_0x4ec0dc['offset'])_0x4f555f[_0x35fc('0x17')](_0x4ec0dc[_0x35fc('0x17')]);return db[_0x35fc('0x9d')][_0x35fc('0x3e')](_0x4f555f['toString'](),_0x3e2a8e);})['then'](function(_0x379650){if(_0x379650['length']>0x0)_0x211746[_0x35fc('0x77')](_0x35fc('0xb9'),_['map'](_0x379650,'id'));return db['sequelize'][_0x35fc('0x3e')](_0x211746[_0x35fc('0x9c')](),_0x3e2a8e)[_0x35fc('0x1c')](function(_0x479e28){var _0x1bafe6=_[_0x35fc('0xba')](_0x479e28,_0x35fc('0xbb'));var _0x4cb4be=[];return db[_0x35fc('0xbc')][_0x35fc('0x29')]({'attributes':[_0x35fc('0xbd')],'raw':!![]})[_0x35fc('0x1c')](function(_0x5f374c){var _0x451cb8=_0x5f374c[_0x35fc('0xbd')];_0x379650[_0x35fc('0x26')](function(_0x2732a8){_0x4cb4be[_0x35fc('0x27')](updateMailInteraction(_0x2732a8,_0x350237,_0x1bafe6,_0x451cb8));});return BPromise[_0x35fc('0xbe')](_0x4cb4be);});});});})['then'](function(_0x22ba47){_0x16087d[_0x35fc('0xbf')]=_0x22ba47;return _0x16087d;})['then'](respondWithFilteredResult(_0x9fe7d6,_0x4ec0dc))[_0x35fc('0x2f')](handleError(_0x9fe7d6,null));};exports[_0x35fc('0xc0')]=function(_0x58feeb,_0x7c1b12){var _0x31541e={'raw':![],'where':{'id':_0x58feeb[_0x35fc('0xc1')]['id']}},_0x72a17a={};_0x72a17a[_0x35fc('0x3c')]=_['keys'](db[_0x35fc('0x38')][_0x35fc('0x39')]);_0x72a17a[_0x35fc('0x3e')]=_['keys'](_0x58feeb[_0x35fc('0x3e')]);_0x72a17a['filters']=_['intersection'](_0x72a17a[_0x35fc('0x3c')],_0x72a17a[_0x35fc('0x3e')]);_0x31541e[_0x35fc('0x40')]=_[_0x35fc('0x3f')](_0x72a17a[_0x35fc('0x3c')],qs['fields'](_0x58feeb[_0x35fc('0x3e')][_0x35fc('0x41')]));_0x31541e[_0x35fc('0x40')]=_0x31541e['attributes'][_0x35fc('0x42')]?_0x31541e[_0x35fc('0x40')]:_0x72a17a[_0x35fc('0x3c')];if(_0x58feeb[_0x35fc('0x3e')][_0x35fc('0xc2')]){_0x31541e['include']=[{'all':!![]}];}_0x31541e=_[_0x35fc('0xc3')]({},_0x31541e,_0x58feeb[_0x35fc('0xc4')]);return db['MailInteraction']['find'](_0x31541e)[_0x35fc('0x1c')](handleEntityNotFound(_0x7c1b12,null))[_0x35fc('0x1c')](respondWithResult(_0x7c1b12,null))[_0x35fc('0x2f')](handleError(_0x7c1b12,null));};exports[_0x35fc('0xc5')]=function(_0x405a43,_0x2b2a87){return db[_0x35fc('0x38')]['create'](_0x405a43['body'],{})[_0x35fc('0x1c')](respondWithResult(_0x2b2a87,0xc9))[_0x35fc('0x2f')](handleError(_0x2b2a87,null));};exports[_0x35fc('0x1b')]=function(_0x1a92fa,_0x1c3630){if(_0x1a92fa['body']['id']){delete _0x1a92fa['body']['id'];}return db[_0x35fc('0x38')][_0x35fc('0x6a')]({'where':{'id':_0x1a92fa[_0x35fc('0xc1')]['id']}})[_0x35fc('0x1c')](handleEntityNotFound(_0x1c3630,null))['then'](saveUpdates(_0x1a92fa['body'],null))[_0x35fc('0x1c')](respondWithResult(_0x1c3630,null))[_0x35fc('0x2f')](handleError(_0x1c3630,null));};exports[_0x35fc('0x1d')]=function(_0xd46d64,_0x51bd0c){return db['MailInteraction'][_0x35fc('0x6a')]({'where':{'id':_0xd46d64[_0x35fc('0xc1')]['id']}})['then'](handleEntityNotFound(_0x51bd0c,null))[_0x35fc('0x1c')](removeEntity(_0x51bd0c,null))[_0x35fc('0x2f')](handleError(_0x51bd0c,null));};exports[_0x35fc('0xc6')]=function(_0xc9f39b,_0x274337){return db[_0x35fc('0x38')][_0x35fc('0xc6')]()[_0x35fc('0x1c')](respondWithResult(_0x274337,null))[_0x35fc('0x2f')](handleError(_0x274337,null));};exports[_0x35fc('0xc7')]=function(_0x19ae76,_0x366a3b){return db[_0x35fc('0x28')][_0x35fc('0x6a')]({'where':{'id':_0x19ae76[_0x35fc('0xc1')]['id']}})[_0x35fc('0x1c')](handleEntityNotFound(_0x366a3b,null))['then'](function(_0x345026){if(_0x345026){return _0x345026['addMessage'](_0x19ae76[_0x35fc('0xc8')]['ids'],_['omit'](_0x19ae76[_0x35fc('0xc8')],[_0x35fc('0xc9'),'id'])||{});}})[_0x35fc('0x1c')](respondWithResult(_0x366a3b,null))['catch'](handleError(_0x366a3b,null));};exports[_0x35fc('0xca')]=function(_0x1a5446,_0xe9c7c2){var _0x888f44={'raw':![],'where':{}};var _0x5fc40d={};var _0x1f7090={'count':0x0,'rows':[]};return db['MailInteraction']['findOne']({'where':{'id':_0x1a5446[_0x35fc('0xc1')]['id']}})['then'](handleEntityNotFound(_0xe9c7c2,null))['then'](function(_0x262f9a){if(_0x262f9a){_0x5fc40d['model']=_['keys'](db['MailMessage'][_0x35fc('0x39')]);_0x5fc40d['query']=_[_0x35fc('0x3d')](_0x1a5446[_0x35fc('0x3e')]);_0x5fc40d[_0x35fc('0x46')]=_[_0x35fc('0x3f')](_0x5fc40d[_0x35fc('0x3c')],_0x5fc40d[_0x35fc('0x3e')]);_0x888f44['attributes']=_['intersection'](_0x5fc40d[_0x35fc('0x3c')],qs['fields'](_0x1a5446[_0x35fc('0x3e')][_0x35fc('0x41')]));_0x888f44['attributes']=_0x888f44['attributes']['length']?_0x888f44[_0x35fc('0x40')]:_0x5fc40d[_0x35fc('0x3c')];if(!_0x1a5446[_0x35fc('0x3e')][_0x35fc('0x43')](_0x35fc('0x44'))){_0x888f44[_0x35fc('0x18')]=qs[_0x35fc('0x18')](_0x1a5446[_0x35fc('0x3e')]['limit']);_0x888f44['offset']=qs['offset'](_0x1a5446['query'][_0x35fc('0x17')]);}_0x888f44['order']=qs[_0x35fc('0x45')](_0x1a5446['query'][_0x35fc('0x45')]);_0x888f44[_0x35fc('0x77')]=qs['filters'](_['pick'](_0x1a5446[_0x35fc('0x3e')],_0x5fc40d[_0x35fc('0x46')]));_0x888f44[_0x35fc('0x77')][_0x35fc('0xbb')]=_0x262f9a['id'];if(_0x1a5446[_0x35fc('0x3e')]['filter']){_0x888f44['where']=_[_0x35fc('0xc3')](_0x888f44['where'],{'$or':_[_0x35fc('0x37')](_0x888f44['attributes'],function(_0x29b1cc){var _0x2a2c9e={};_0x2a2c9e[_0x29b1cc]={'$like':'%'+_0x1a5446[_0x35fc('0x3e')][_0x35fc('0x84')]+'%'};return _0x2a2c9e;})});}if(_0x1a5446['query'][_0x35fc('0x7a')]){var _0x5a97e2=_0x1a5446[_0x35fc('0x3e')]['$gte']['split'](',');var _0x8261f4={};_0x8261f4[_0x5a97e2[0x0]]={'$gte':moment(_0x5a97e2[0x1])['format'](_0x35fc('0xcb'))};_0x888f44[_0x35fc('0x77')]=_[_0x35fc('0xc3')](_0x888f44[_0x35fc('0x77')],_0x8261f4);}_0x888f44=_[_0x35fc('0xc3')]({},_0x888f44,_0x1a5446[_0x35fc('0xc4')]);return db[_0x35fc('0x28')][_0x35fc('0x16')]({'where':_0x888f44[_0x35fc('0x77')]})['then'](function(_0x339bf6){_0x1f7090[_0x35fc('0x16')]=_0x339bf6;if(_0x1a5446[_0x35fc('0x3e')][_0x35fc('0xc2')]){_0x888f44[_0x35fc('0xcc')]=[{'all':!![]}];}return db[_0x35fc('0x28')][_0x35fc('0xcd')](_0x888f44);})[_0x35fc('0x1c')](function(_0x5a9d1b){if(_0x1a5446['query']['inlineCss']==='true'){for(var _0x5c8419=0x0;_0x5c8419<_0x5a9d1b[_0x35fc('0x42')];_0x5c8419++){_0x5a9d1b[_0x5c8419][_0x35fc('0xc8')]=juice(_0x5a9d1b[_0x5c8419][_0x35fc('0xc8')]);}}_0x1f7090[_0x35fc('0xbf')]=_0x5a9d1b;return _0x1f7090;});}})[_0x35fc('0x1c')](respondWithFilteredResult(_0xe9c7c2,_0x888f44))['catch'](handleError(_0xe9c7c2,null));};exports[_0x35fc('0xce')]=function(_0x2e636f,_0x85721d){return db[_0x35fc('0x38')][_0x35fc('0x6a')]({'where':{'id':_0x2e636f['params']['id']}})[_0x35fc('0x1c')](handleEntityNotFound(_0x85721d,null))[_0x35fc('0x1c')](function(_0x4188bc){if(_0x4188bc){return _0x4188bc['setTags'](_0x2e636f[_0x35fc('0xc8')][_0x35fc('0xc9')],_[_0x35fc('0xcf')](_0x2e636f[_0x35fc('0xc8')],[_0x35fc('0xc9'),'id'])||{})[_0x35fc('0xd0')](function(){return db[_0x35fc('0x6c')][_0x35fc('0xcd')]({'attributes':['id',_0x35fc('0x21'),_0x35fc('0x49')],'where':{'id':_0x2e636f[_0x35fc('0xc8')][_0x35fc('0xc9')]}});})[_0x35fc('0x1c')](function(_0x206f0b){socket[_0x35fc('0xd1')]('mailInteractionTags:save',{'id':Number(_0x2e636f['params']['id']),'tags':_0x206f0b||[]});return{'id':Number(_0x2e636f[_0x35fc('0xc1')]['id']),'tags':_0x206f0b||[]};});}})[_0x35fc('0x1c')](respondWithResult(_0x85721d,null))[_0x35fc('0x2f')](handleError(_0x85721d,null));};exports[_0x35fc('0xd2')]=function(_0x219be6,_0x2723b1){return db[_0x35fc('0x38')][_0x35fc('0x6a')]({'where':{'id':_0x219be6[_0x35fc('0xc1')]['id']}})[_0x35fc('0x1c')](handleEntityNotFound(_0x2723b1,null))[_0x35fc('0x1c')](function(_0x25457b){if(_0x25457b){return _0x25457b[_0x35fc('0xd2')](_0x219be6[_0x35fc('0x3e')][_0x35fc('0xc9')]);}})['then'](respondWithStatusCode(_0x2723b1,null))[_0x35fc('0x2f')](handleError(_0x2723b1,null));};exports[_0x35fc('0xd3')]=function(_0x14038c,_0x34e007){var _0x242d09=moment()[_0x35fc('0xd4')]()[_0x35fc('0x9c')]();var _0xa4c51a=path['join'](config['root'],_0x35fc('0xd5'),_0x35fc('0xd6'),'tmp');var _0xeb426d=path[_0x35fc('0xd7')](config[_0x35fc('0xd8')],_0x35fc('0xd5'),'files',_0x35fc('0xd9'));var _0x41f4b9=path[_0x35fc('0xd7')](_0xa4c51a,_0x242d09);var _0x295a64=util['format'](_0x35fc('0xda'),_0x14038c[_0x35fc('0xc1')]['id'],_0x242d09);var _0x4bf9a5=path[_0x35fc('0xd7')](_0xa4c51a,_0x295a64);var _0x3a1a0e=[];if(_0x14038c[_0x35fc('0x3e')]['attachments']){_0x3a1a0e[_0x35fc('0x27')]({'model':db['Attachment'],'as':_0x35fc('0xdb'),'raw':!![]});}var _0xe25a3a=[{'model':db['MailMessage'],'as':_0x35fc('0xdc'),'attributes':['id',_0x35fc('0xc8'),_0x35fc('0x4a'),'to','cc',_0x35fc('0xdd'),_0x35fc('0xde'),_0x35fc('0x79')],'where':{'secret':![]},'order':qs[_0x35fc('0x45')]('id'),'include':_0x3a1a0e}];return db['MailInteraction']['find']({'where':{'id':_0x14038c[_0x35fc('0xc1')]['id']},'include':_0xe25a3a})[_0x35fc('0x1c')](handleEntityNotFound(_0x34e007,null))[_0x35fc('0x1c')](function(_0x2ad9a3){if(_0x2ad9a3&&_0x2ad9a3[_0x35fc('0xdc')]){var _0x224498=_0x2ad9a3[_0x35fc('0xdf')]({'plain':!![]});fs['mkdirSync'](_0x41f4b9);return BPromise[_0x35fc('0xe0')](_0x224498[_0x35fc('0xdc')],function(_0x46b9b6,_0x4cdc31){var _0x46b4f9={'from':_0x46b9b6[_0x35fc('0x4a')],'to':_0x46b9b6['to'],'subject':_0x46b9b6[_0x35fc('0xde')],'html':htmlEntities[_0x35fc('0xe1')](_0x46b9b6[_0x35fc('0xc8')]),'headers':{'Date':moment(_0x46b9b6[_0x35fc('0x79')])[_0x35fc('0xe2')](_0x35fc('0xe3'))},'attachments':[]};if(_0x46b9b6['cc']){_0x46b4f9[_0x35fc('0xe4')]['Cc']=_0x46b9b6['cc'];}if(_0x46b9b6[_0x35fc('0xdd')]){_0x46b4f9[_0x35fc('0xe4')][_0x35fc('0xe5')]=_0x46b9b6[_0x35fc('0xdd')];}return new BPromise(function(_0x11281c,_0x33b69a){if(_0x46b9b6[_0x35fc('0xdb')]){for(var _0x26987e=0x0;_0x26987e<_0x46b9b6[_0x35fc('0xdb')][_0x35fc('0x42')];_0x26987e++){var _0x4949ed=_0x46b9b6[_0x35fc('0xdb')][_0x26987e];var _0x4f74ff=path[_0x35fc('0xd7')](_0xeb426d,_0x4949ed[_0x35fc('0xe6')]);if(fs['existsSync'](_0x4f74ff)){_0x46b4f9[_0x35fc('0xd9')][_0x35fc('0x27')]({'name':_0x4949ed[_0x35fc('0x21')],'contentType':_0x4949ed[_0x35fc('0x3b')],'data':fs[_0x35fc('0xe7')](_0x4f74ff)});}}}emlformat[_0x35fc('0xe8')](_0x46b4f9,function(_0x203208,_0x21786b){if(_0x203208)return _0x33b69a(_0x203208);fs['writeFileSync'](path[_0x35fc('0xd7')](_0x41f4b9,util[_0x35fc('0xe2')](_0x35fc('0xe9'),_0x4cdc31)),_0x21786b);return _0x11281c(_0x21786b);});});})[_0x35fc('0x1c')](function(){return new BPromise(function(_0x501111,_0x4dc276){zipdir(_0x41f4b9,{'saveTo':_0x4bf9a5},function(_0x51102c,_0x596945){if(_0x51102c)return _0x4dc276(_0x51102c);return _0x501111(_0x596945);});})[_0x35fc('0x1c')](function(){return new BPromise(function(_0x572d83,_0xcbabdf){rimraf(_0x41f4b9,function(_0x2475d6){if(_0x2475d6)_0xcbabdf(_0x2475d6);return _0x572d83();});});})[_0x35fc('0x1c')](function(){return _0x34e007[_0x35fc('0xd3')](_0x4bf9a5,_0x295a64,function(_0x1b9e94){if(!_0x1b9e94)fs[_0x35fc('0xea')](_0x4bf9a5);});});});}else{return _0x34e007[_0x35fc('0x1e')](0xc8);}})[_0x35fc('0x2f')](handleError(_0x34e007,null));};
\ No newline at end of file
+var _0x2b29=['i.MailAccountId\x20IN\x20?','concat','createdAt','$gte','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','Sequelize','SELECT','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','i.MailAccountId\x20IS\x20NOT\x20NULL','role','agent','user','getMailAccounts','i.MailAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20(\x27%\x27\x20+\x20a.email\x20+\x20\x27%\x27)\x20THEN\x20SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201)\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.createdAt','i.closed','i.closedAt','i.lastMsgAt','i.lastMsgDirection','i.subject','i.disposition','i.secondDisposition','i.thirdDisposition','i.substatus','i.MailAccountId','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','Contact.phone','c.mobile','Contact.mobile','c.fax','o.fullname','Owner.fullname','GROUP_CONCAT(DISTINCT\x20t.id)','ui.MailInteractionId\x20IN\x20?','Setting','findOne','enableEmailPreview','all','rows','params','keys','include','create','body','describe','addMessage','MailMessage','omit','ids','getMessages','nolimit','pick','MailInteractionId','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','findAll','inlineCss','true','setTags','color','emit','mailInteractionTags:save','download','unix','join','root','server','files','attachments','transcript-%d-%s.zip','subject','Messages','decode','headers','bcc','Bcc','Attachments','basename','existsSync','readFileSync','build','writeFileSync','unlinkSync','rimraf','zip-dir','moment','bluebird','path','lodash','squel','juice','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','./mailInteraction.socket','register','sendStatus','end','status','json','undefined','count','offset','set','Content-Range','update','then','destroy','error','name','send','Users','map','fullname','TagIds','Tags','split','push','out','plainBody','-id','lastMsgText','trimStart','catch','waiting','answered','total','closed','UserId','talking','index','MailInteraction','rawAttributes','fieldName','type','key','query','filters','intersection','attributes','fields','model','hasOwnProperty','limit','order','sort','where','select','field','from','tools_tags','u.id','u.fullname','ui.MailInteractionId','user_has_mail_interactions','left_join','users','u.id\x20=\x20ui.UserId','mail_interactions','o.id\x20=\x20i.UserId','mail_messages','me.MailInteractionId\x20=\x20i.id','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','expr','search','parseSearch','sqlOperator','conditions','length','find','unreadMessages','value','`\x20=\x200','having','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','ContactId','buildExpression','text','start','Tag','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','some','compact','isEmpty','MailAccountId'];(function(_0x323042,_0x3f2395){var _0x3559e7=function(_0x46d18e){while(--_0x46d18e){_0x323042['push'](_0x323042['shift']());}};_0x3559e7(++_0x3f2395);}(_0x2b29,0x163));var _0x92b2=function(_0x31406d,_0x12258e){_0x31406d=_0x31406d-0x0;var _0xf6bd42=_0x2b29[_0x31406d];return _0xf6bd42;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x92b2('0x0'));var zipdir=require(_0x92b2('0x1'));var moment=require(_0x92b2('0x2'));var BPromise=require(_0x92b2('0x3'));var util=require('util');var path=require(_0x92b2('0x4'));var fs=require('fs');var _=require(_0x92b2('0x5'));var squel=require(_0x92b2('0x6'));var juice=require(_0x92b2('0x7'));var Redis=require(_0x92b2('0x8'));var qs=require(_0x92b2('0x9'));var as=require('../../components/parsers/advancedSearch');var logger=require(_0x92b2('0xa'))('api');var config=require(_0x92b2('0xb'));var db=require(_0x92b2('0xc'))['db'];var htmlEntities=require('html-entities');config[_0x92b2('0xd')]=_[_0x92b2('0xe')](config[_0x92b2('0xd')],{'host':_0x92b2('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x92b2('0xd')]));require(_0x92b2('0x10'))[_0x92b2('0x11')](socket);function respondWithStatusCode(_0x1ef7f3,_0x2949e0){_0x2949e0=_0x2949e0||0xcc;return function(_0x421889){if(_0x421889){return _0x1ef7f3[_0x92b2('0x12')](_0x2949e0);}return _0x1ef7f3['status'](_0x2949e0)[_0x92b2('0x13')]();};}function respondWithResult(_0x2c0d0f,_0x160e75){_0x160e75=_0x160e75||0xc8;return function(_0x58b009){if(_0x58b009){return _0x2c0d0f[_0x92b2('0x14')](_0x160e75)[_0x92b2('0x15')](_0x58b009);}};}function respondWithFilteredResult(_0x3c5db1,_0x4d597b){return function(_0x12c2d1){if(_0x12c2d1){var _0x179834=typeof _0x4d597b['offset']===_0x92b2('0x16')&&typeof _0x4d597b['limit']===_0x92b2('0x16');var _0x2be641=_0x12c2d1[_0x92b2('0x17')];var _0x4899fa=_0x179834?0x0:_0x4d597b['offset'];var _0xbb9cef=_0x179834?_0x12c2d1['count']:_0x4d597b[_0x92b2('0x18')]+_0x4d597b['limit'];var _0x42872b;if(_0xbb9cef>=_0x2be641){_0xbb9cef=_0x2be641;_0x42872b=0xc8;}else{_0x42872b=0xce;}_0x3c5db1[_0x92b2('0x14')](_0x42872b);return _0x3c5db1[_0x92b2('0x19')](_0x92b2('0x1a'),_0x4899fa+'-'+_0xbb9cef+'/'+_0x2be641)[_0x92b2('0x15')](_0x12c2d1);}return null;};}function saveUpdates(_0x3dfd47){return function(_0x1cb43e){if(_0x1cb43e){return _0x1cb43e[_0x92b2('0x1b')](_0x3dfd47)[_0x92b2('0x1c')](function(_0xa08831){return _0xa08831;});}return null;};}function removeEntity(_0xfd81c5){return function(_0x3bdda8){if(_0x3bdda8){return _0x3bdda8[_0x92b2('0x1d')]()[_0x92b2('0x1c')](function(){_0xfd81c5[_0x92b2('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x46078b){return function(_0x546c1c){if(!_0x546c1c){_0x46078b[_0x92b2('0x12')](0x194);}return _0x546c1c;};}function handleError(_0xe6f05f,_0x2b372c){_0x2b372c=_0x2b372c||0x1f4;return function(_0x1e09b6){logger[_0x92b2('0x1e')](_0x1e09b6['stack']);if(_0x1e09b6['name']){delete _0x1e09b6[_0x92b2('0x1f')];}_0xe6f05f[_0x92b2('0x14')](_0x2b372c)[_0x92b2('0x20')](_0x1e09b6);};}function getInteractionUsers(_0x386a80,_0x5a6c76){return new BPromise(function(_0x30a205,_0x15faf5){try{if(_0x5a6c76[_0x386a80['id']]){_0x386a80[_0x92b2('0x21')]=_[_0x92b2('0x22')](_0x5a6c76[_0x386a80['id']],function(_0x573df3){return{'id':_0x573df3['id'],'fullname':_0x573df3[_0x92b2('0x23')]};});}}catch(_0x57c1ff){_0x15faf5(_0x57c1ff);}_0x30a205(_0x386a80);});}function getInteractionTags(_0x183f81,_0x4a587f){return new BPromise(function(_0x5e9688,_0x105270){try{if(_0x183f81[_0x92b2('0x24')]){_0x183f81[_0x92b2('0x25')]=[];_0x183f81['TagIds'][_0x92b2('0x26')](',')['forEach'](function(_0x124a0d){_0x183f81[_0x92b2('0x25')][_0x92b2('0x27')](_0x4a587f[_0x124a0d]);});}delete _0x183f81[_0x92b2('0x24')];}catch(_0x368998){_0x105270(_0x368998);}_0x5e9688(_0x183f81);});}function getLastMessageText(_0x7b6e4e){return new BPromise(function(_0x3b676f,_0x515a62){return db['MailMessage']['findOne']({'where':{'$and':[{'MailInteractionId':_0x7b6e4e['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x92b2('0x28')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0x92b2('0x29')],'order':_0x92b2('0x2a'),'raw':!![]})['then'](function(_0x5d2e5f){if(_0x5d2e5f&&_0x5d2e5f[_0x92b2('0x29')]){_0x7b6e4e[_0x92b2('0x2b')]=_[_0x92b2('0x2c')](_0x5d2e5f[_0x92b2('0x29')]);}_0x3b676f(_0x7b6e4e);})[_0x92b2('0x2d')](function(_0x56802f){_0x515a62(_0x56802f);});});}function updateMailInteraction(_0x5378fb,_0x49cb88,_0x22ea02,_0x16361a){return new BPromise(function(_0x5f4e09,_0xf7083e){return getInteractionUsers(_0x5378fb,_0x22ea02)[_0x92b2('0x1c')](function(_0x10f817){return getInteractionTags(_0x10f817,_0x49cb88);})[_0x92b2('0x1c')](function(_0x1f5d72){return getStateInteraction(_0x1f5d72);})[_0x92b2('0x1c')](function(_0x212590){if(_0x16361a){_0x5f4e09(getLastMessageText(_0x212590));}else{_0x5f4e09(_0x212590);}})[_0x92b2('0x2d')](function(_0x5edf58){_0xf7083e(_0x5edf58);});});}function getStateInteraction(_0x21e052){return new BPromise(function(_0x226875){_0x21e052[_0x92b2('0x2e')]=0x0;_0x21e052['talking']=0x0;_0x21e052[_0x92b2('0x2f')]=0x0;_0x21e052['unmanaged']=0x0;_0x21e052[_0x92b2('0x30')]=0x0;if(!_0x21e052[_0x92b2('0x31')]&&!_0x21e052['UserId']){_0x21e052['waiting']+=0x1;}if(!_0x21e052[_0x92b2('0x31')]&&_0x21e052[_0x92b2('0x32')]){_0x21e052['talking']+=0x1;if(_0x21e052['waiting']){_0x21e052[_0x92b2('0x2e')]-=0x1;}}if(_0x21e052[_0x92b2('0x31')]&&_0x21e052['UserId']){_0x21e052[_0x92b2('0x2f')]+=0x1;if(_0x21e052[_0x92b2('0x33')]){_0x21e052[_0x92b2('0x33')]-=0x1;}}if(_0x21e052['closed']&&!_0x21e052[_0x92b2('0x32')]){_0x21e052['unmanaged']+=0x1;if(_0x21e052[_0x92b2('0x2e')]){_0x21e052[_0x92b2('0x2e')]-=0x1;}}_0x21e052[_0x92b2('0x30')]+=0x1;_0x226875(_0x21e052);});}exports[_0x92b2('0x34')]=function(_0x181b88,_0x333fd1){var _0x49c37f={},_0x9822b3={},_0x35ca4d={'count':0x0,'rows':[]};var _0x5d1d48=_[_0x92b2('0x22')](db[_0x92b2('0x35')][_0x92b2('0x36')],function(_0xf5f958){return{'name':_0xf5f958[_0x92b2('0x37')],'type':_0xf5f958[_0x92b2('0x38')][_0x92b2('0x39')]};});_0x9822b3['model']=_[_0x92b2('0x22')](_0x5d1d48,'name');_0x9822b3[_0x92b2('0x3a')]=_['keys'](_0x181b88[_0x92b2('0x3a')]);_0x9822b3[_0x92b2('0x3b')]=_[_0x92b2('0x3c')](_0x9822b3['model'],_0x9822b3[_0x92b2('0x3a')]);_0x49c37f[_0x92b2('0x3d')]=_[_0x92b2('0x3c')](_0x9822b3['model'],qs[_0x92b2('0x3e')](_0x181b88[_0x92b2('0x3a')][_0x92b2('0x3e')]));_0x49c37f[_0x92b2('0x3d')]=_0x49c37f['attributes']['length']?_0x49c37f['attributes']:_0x9822b3[_0x92b2('0x3f')];if(!_0x181b88[_0x92b2('0x3a')][_0x92b2('0x40')]('nolimit')){_0x49c37f[_0x92b2('0x41')]=qs['limit'](_0x181b88[_0x92b2('0x3a')][_0x92b2('0x41')]);_0x49c37f[_0x92b2('0x18')]=qs[_0x92b2('0x18')](_0x181b88[_0x92b2('0x3a')][_0x92b2('0x18')]);}_0x49c37f[_0x92b2('0x42')]=qs[_0x92b2('0x43')](_0x181b88[_0x92b2('0x3a')][_0x92b2('0x43')]);_0x49c37f[_0x92b2('0x44')]=qs[_0x92b2('0x3b')](_['pick'](_0x181b88[_0x92b2('0x3a')],_0x9822b3['filters']),_0x5d1d48);var _0x191e15=[];var _0x524630=squel[_0x92b2('0x45')]()[_0x92b2('0x46')]('id')[_0x92b2('0x46')]('name')[_0x92b2('0x46')]('color')[_0x92b2('0x47')](_0x92b2('0x48'));var _0x56c02a=squel[_0x92b2('0x45')]()[_0x92b2('0x46')](_0x92b2('0x49'))[_0x92b2('0x46')](_0x92b2('0x4a'))[_0x92b2('0x46')](_0x92b2('0x4b'))[_0x92b2('0x47')](_0x92b2('0x4c'),'ui')[_0x92b2('0x4d')](_0x92b2('0x4e'),'u',_0x92b2('0x4f'));var _0x3b85e2=squel[_0x92b2('0x45')]()['from'](_0x92b2('0x50'),'i')[_0x92b2('0x4d')]('cm_contacts','c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join'](_0x92b2('0x4e'),'o',_0x92b2('0x51'))['left_join']('mail_accounts','a','a.id\x20=\x20i.MailAccountId')[_0x92b2('0x4d')](_0x92b2('0x52'),'me',_0x92b2('0x53'))[_0x92b2('0x4d')](_0x92b2('0x54'),'it',_0x92b2('0x55'))[_0x92b2('0x4d')](_0x92b2('0x48'),'t','t.id\x20=\x20it.TagId');var _0x595b48=squel['expr']();var _0x32fa61=[];var _0x4d3f8f=squel[_0x92b2('0x56')]();var _0x5e5100;if(_0x181b88[_0x92b2('0x3a')][_0x92b2('0x57')]){_0x5e5100=as[_0x92b2('0x58')](_0x181b88[_0x92b2('0x3a')]['search']);var _0xe6ff4f=_0x5e5100[_0x92b2('0x59')];for(var _0x32ce92=0x0;_0x32ce92<_0x5e5100[_0x92b2('0x5a')][_0x92b2('0x5b')];_0x32ce92++){var _0x39a59a=_0x5e5100[_0x92b2('0x5a')][_0x32ce92];var _0x1ca5b3='i';var _0x30ff03=_[_0x92b2('0x5c')](_0x5d1d48,[_0x92b2('0x1f'),_0x39a59a[_0x92b2('0x46')]]);if(!_0x30ff03){switch(_0x39a59a[_0x92b2('0x46')]){case _0x92b2('0x5d'):if(_0x39a59a[_0x92b2('0x5e')]==0x1){_0x3b85e2['having']('`'+_0x39a59a['field']+_0x92b2('0x5f'));}else{_0x3b85e2[_0x92b2('0x60')]('`'+_0x39a59a[_0x92b2('0x46')]+'`\x20>\x200');}break;case _0x92b2('0x61'):if(_0x39a59a[_0x92b2('0x62')]===_0x92b2('0x63')){if(_0x39a59a[_0x92b2('0x5e')][_0x92b2('0x26')]('\x20')[_0x92b2('0x5b')]>0x1){_0x595b48[_0xe6ff4f](_0x92b2('0x64'),qs['getFullTextValue'](_0x39a59a[_0x92b2('0x5e')]),null);}else{var _0x27e273='%'+_0x39a59a[_0x92b2('0x5e')]+'%';_0x595b48[_0xe6ff4f]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x27e273,_0x27e273,_0x27e273);}}else{_0x30ff03=_[_0x92b2('0x5c')](_0x5d1d48,[_0x92b2('0x1f'),'ContactId']);_0x39a59a['field']=_0x92b2('0x65');_0x16fd27=as[_0x92b2('0x66')](_0x1ca5b3,_0x30ff03['type'],_0x39a59a);_0x595b48[_0xe6ff4f](_0x16fd27[_0x92b2('0x67')],_0x16fd27[_0x92b2('0x5e')][_0x92b2('0x68')],_0x16fd27[_0x92b2('0x5e')][_0x92b2('0x13')]);}break;case _0x92b2('0x69'):var _0x21d3d0=_0x39a59a[_0x92b2('0x5e')][_0x92b2('0x26')](',')[_0x92b2('0x22')](function(_0x4d4e90){return Number(_0x4d4e90);});_0x21d3d0[_0x92b2('0x6a')](function(_0x169126){_0x4d3f8f['or'](_0x92b2('0x6b'),'%,'+_0x169126+',%');});_0x32fa61=_[_0x92b2('0x6c')](_0x32fa61,_0x21d3d0);break;case _0x92b2('0x6d'):if(_0x39a59a['operator']==='$substring'){_0x595b48[_0xe6ff4f](_0x92b2('0x6e'),'%'+_0x39a59a[_0x92b2('0x5e')]+'%',null);}else{_0x30ff03=_[_0x92b2('0x5c')](_0x5d1d48,[_0x92b2('0x1f'),_0x92b2('0x32')]);_0x39a59a[_0x92b2('0x46')]=_0x92b2('0x32');_0x16fd27=as['buildExpression'](_0x1ca5b3,_0x30ff03[_0x92b2('0x38')],_0x39a59a);_0x595b48[_0xe6ff4f](_0x16fd27[_0x92b2('0x67')],_0x16fd27['value'][_0x92b2('0x68')],_0x16fd27['value'][_0x92b2('0x13')]);}break;case _0x92b2('0x29'):_0x16fd27=as[_0x92b2('0x66')]('me',null,_0x39a59a);_0x595b48[_0xe6ff4f](_0x16fd27['text'],_0x16fd27['value'][_0x92b2('0x68')],_0x16fd27['value']['end']);break;}}else{var _0x16fd27=as[_0x92b2('0x66')](_0x1ca5b3,_0x30ff03[_0x92b2('0x38')],_0x39a59a);_0x595b48[_0xe6ff4f](_0x16fd27[_0x92b2('0x67')],_0x16fd27[_0x92b2('0x5e')][_0x92b2('0x68')],_0x16fd27[_0x92b2('0x5e')]['end']);}}}else{var _0x3ba3ca=_(_0x181b88[_0x92b2('0x3a')])['keys']()[_0x92b2('0x22')](function(_0x43661b){return _[_0x92b2('0x6f')](_0x5d1d48,[_0x92b2('0x1f'),_0x43661b])?_0x43661b:undefined;})[_0x92b2('0x70')]()['value']();if(!_[_0x92b2('0x71')](_0x3ba3ca)){_0x3ba3ca[_0x92b2('0x6a')](function(_0x479a59){if(_0x479a59===_0x92b2('0x72')){_0x3b85e2[_0x92b2('0x44')](_0x92b2('0x73'),[][_0x92b2('0x74')](_0x181b88[_0x92b2('0x3a')][_0x479a59]));}else if(_0x479a59===_0x92b2('0x75')){var _0x1b7f9d=JSON['parse'](_0x181b88[_0x92b2('0x3a')][_0x479a59])[_0x92b2('0x76')];var _0xf14365=JSON[_0x92b2('0x77')](_0x181b88['query'][_0x479a59])[_0x92b2('0x78')];_0x3b85e2[_0x92b2('0x44')](_0x92b2('0x79'),_0x1b7f9d,_0xf14365);}else{if(_0x181b88[_0x92b2('0x3a')][_0x479a59]==='null'){_0x3b85e2[_0x92b2('0x44')]('i.'+_0x479a59+_0x92b2('0x7a'));}else{_0x3b85e2[_0x92b2('0x44')]('i.'+_0x479a59+_0x92b2('0x7b'),_0x181b88[_0x92b2('0x3a')][_0x479a59]);}}});}if(_0x181b88[_0x92b2('0x3a')][_0x92b2('0x7c')]){if(_0x181b88[_0x92b2('0x3a')][_0x92b2('0x7c')]==0x1){_0x3b85e2[_0x92b2('0x60')](_0x92b2('0x7d'));}else{_0x3b85e2[_0x92b2('0x60')](_0x92b2('0x7e'));}}if(_0x181b88[_0x92b2('0x3a')][_0x92b2('0x7f')]){_0x32fa61=_[_0x92b2('0x80')](_0x181b88[_0x92b2('0x3a')][_0x92b2('0x7f')])?_0x181b88[_0x92b2('0x3a')][_0x92b2('0x7f')]:new Array(_0x181b88[_0x92b2('0x3a')][_0x92b2('0x7f')]);_0x32fa61['forEach'](function(_0x4c49af){_0x4d3f8f['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x4c49af+',%');});}if(_0x181b88['query'][_0x92b2('0x81')]){var _0x12a079=_0x181b88[_0x92b2('0x3a')]['filter'][_0x92b2('0x82')]('\x5c','\x5c\x5c')[_0x92b2('0x82')](/'/g,'\x27\x27');if(qs[_0x92b2('0x83')](_0x12a079)){_0x595b48['or'](_0x92b2('0x84'),_0x12a079+'%');}else if(qs['isEmail'](_0x12a079)){_0x595b48['or'](_0x92b2('0x85'),_0x12a079+'%');}else{_0x595b48['or'](_0x92b2('0x86'),qs[_0x92b2('0x87')](_0x12a079))['or'](_0x92b2('0x88'),qs[_0x92b2('0x87')](_0x12a079));}}}_0x3b85e2[_0x92b2('0x44')](_0x595b48);_0x3b85e2[_0x92b2('0x89')](_0x92b2('0x8a'));var _0x8fcd9a={'type':db[_0x92b2('0x8b')]['QueryTypes'][_0x92b2('0x8c')],'raw':!![]};var _0x20f6d0=_0x3b85e2['clone']();_0x20f6d0[_0x92b2('0x46')](_0x92b2('0x8a'));_0x20f6d0[_0x92b2('0x46')](_0x92b2('0x8d'),_0x92b2('0x5d'));if(_0x49c37f[_0x92b2('0x42')]){_0x49c37f[_0x92b2('0x42')][_0x92b2('0x6a')](function(_0x131788){var _0x248f80=_0x131788[0x0]===_0x92b2('0x8e')?_0x131788[0x0]:'i.'+_0x131788[0x0];_0x3b85e2[_0x92b2('0x42')](_0x248f80,_0x131788[0x1]===_0x92b2('0x8f')?![]:!![]);});}if(!_[_0x92b2('0x71')](_0x32fa61)){_0x3b85e2[_0x92b2('0x60')](_0x4d3f8f);_0x20f6d0[_0x92b2('0x44')](_0x92b2('0x90'),_0x32fa61);}BPromise['resolve']()[_0x92b2('0x1c')](function(){if(!_0x5e5100){if(_0x181b88[_0x92b2('0x3a')][_0x92b2('0x72')])return;_0x20f6d0[_0x92b2('0x44')]('i.MailAccountId\x20IS\x20NOT\x20NULL');_0x3b85e2['where'](_0x92b2('0x91'));return;}if(_0x181b88['user'][_0x92b2('0x92')]!==_0x92b2('0x93'))return;return _0x181b88[_0x92b2('0x94')][_0x92b2('0x95')]({'attributes':['id'],'raw':!![]})[_0x92b2('0x1c')](function(_0x225580){if(_[_0x92b2('0x71')](_0x225580)){_0x20f6d0[_0x92b2('0x44')]('i.MailAccountId\x20IS\x20NULL');_0x3b85e2[_0x92b2('0x44')](_0x92b2('0x96'));}else{_0x20f6d0['where'](_0x92b2('0x73'),_['map'](_0x225580,'id'));_0x3b85e2[_0x92b2('0x44')]('i.MailAccountId\x20IN\x20?',_[_0x92b2('0x22')](_0x225580,'id'));}});})[_0x92b2('0x1c')](function(){if(_0x181b88[_0x92b2('0x94')][_0x92b2('0x92')]===_0x92b2('0x93')&&!_0x5e5100&&!_0x181b88[_0x92b2('0x3a')][_0x92b2('0x72')])return[];return db[_0x92b2('0x97')]['query'](_0x20f6d0[_0x92b2('0x98')](),_0x8fcd9a);})['then'](function(_0x42dae7){_0x35ca4d[_0x92b2('0x17')]=_0x42dae7[_0x92b2('0x5b')];if(_0x35ca4d[_0x92b2('0x17')]===0x0)return[];return db[_0x92b2('0x97')][_0x92b2('0x3a')](_0x524630[_0x92b2('0x98')](),_0x8fcd9a)['then'](function(_0xed7f70){_0x191e15=_[_0x92b2('0x99')](_0xed7f70,'id');_0x8fcd9a=_[_0x92b2('0x9a')](_0x8fcd9a,{'model':db[_0x92b2('0x35')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x181b88['query'][_0x92b2('0x3e')]){_0x49c37f['attributes'][_0x92b2('0x6a')](function(_0x11315a){_0x3b85e2[_0x92b2('0x46')]('i.'+_0x11315a);});}else{_0x3b85e2[_0x92b2('0x46')](_0x92b2('0x8d'),_0x92b2('0x5d'));_0x3b85e2[_0x92b2('0x46')](_0x92b2('0x9b'),_0x92b2('0x9c'));_0x3b85e2['field'](_0x92b2('0x9d'),_0x92b2('0x9e'));_0x3b85e2['field'](_0x92b2('0x9f'),'contactName');_0x3b85e2[_0x92b2('0x46')](_0x92b2('0x8a'));_0x3b85e2[_0x92b2('0x46')](_0x92b2('0xa0'));_0x3b85e2[_0x92b2('0x46')]('i.updatedAt');_0x3b85e2[_0x92b2('0x46')](_0x92b2('0xa1'));_0x3b85e2[_0x92b2('0x46')](_0x92b2('0xa2'));_0x3b85e2[_0x92b2('0x46')]('i.attach');_0x3b85e2[_0x92b2('0x46')](_0x92b2('0xa3'));_0x3b85e2[_0x92b2('0x46')](_0x92b2('0xa4'));_0x3b85e2[_0x92b2('0x46')](_0x92b2('0xa5'));_0x3b85e2[_0x92b2('0x46')](_0x92b2('0xa6'));_0x3b85e2[_0x92b2('0x46')](_0x92b2('0xa7'));_0x3b85e2['field'](_0x92b2('0xa8'));_0x3b85e2['field'](_0x92b2('0xa9'));_0x3b85e2[_0x92b2('0x46')]('i.to');_0x3b85e2[_0x92b2('0x46')]('i.ContactId');_0x3b85e2[_0x92b2('0x46')](_0x92b2('0xaa'));_0x3b85e2[_0x92b2('0x46')]('i.UserId');_0x3b85e2[_0x92b2('0x46')](_0x92b2('0xab'),_0x92b2('0xac'));_0x3b85e2[_0x92b2('0x46')](_0x92b2('0xad'),_0x92b2('0xae'));_0x3b85e2['field'](_0x92b2('0xaf'),_0x92b2('0xb0'));_0x3b85e2['field']('c.phone',_0x92b2('0xb1'));_0x3b85e2[_0x92b2('0x46')](_0x92b2('0xb2'),_0x92b2('0xb3'));_0x3b85e2[_0x92b2('0x46')](_0x92b2('0xb4'),'Contact.fax');_0x3b85e2[_0x92b2('0x46')](_0x92b2('0xb5'),_0x92b2('0xb6'));_0x3b85e2[_0x92b2('0x46')]('o.internal','Owner.internal');_0x3b85e2['field'](_0x92b2('0xb7'),_0x92b2('0x24'));}if(_0x49c37f[_0x92b2('0x41')])_0x3b85e2[_0x92b2('0x41')](_0x49c37f['limit']);if(_0x49c37f['offset'])_0x3b85e2[_0x92b2('0x18')](_0x49c37f[_0x92b2('0x18')]);return db['sequelize'][_0x92b2('0x3a')](_0x3b85e2[_0x92b2('0x98')](),_0x8fcd9a);})['then'](function(_0x20a362){if(_0x20a362[_0x92b2('0x5b')]>0x0)_0x56c02a[_0x92b2('0x44')](_0x92b2('0xb8'),_[_0x92b2('0x22')](_0x20a362,'id'));return db[_0x92b2('0x97')][_0x92b2('0x3a')](_0x56c02a[_0x92b2('0x98')](),_0x8fcd9a)[_0x92b2('0x1c')](function(_0x4d32dc){var _0x1d61ea=_['groupBy'](_0x4d32dc,'MailInteractionId');var _0x1f7493=[];return db[_0x92b2('0xb9')][_0x92b2('0xba')]({'attributes':[_0x92b2('0xbb')],'raw':!![]})['then'](function(_0x56e25d){var _0x4dba37=_0x56e25d[_0x92b2('0xbb')];_0x20a362[_0x92b2('0x6a')](function(_0xd82833){_0x1f7493[_0x92b2('0x27')](updateMailInteraction(_0xd82833,_0x191e15,_0x1d61ea,_0x4dba37));});return BPromise[_0x92b2('0xbc')](_0x1f7493);});});});})[_0x92b2('0x1c')](function(_0x1e0d61){_0x35ca4d[_0x92b2('0xbd')]=_0x1e0d61;return _0x35ca4d;})['then'](respondWithFilteredResult(_0x333fd1,_0x49c37f))['catch'](handleError(_0x333fd1,null));};exports['show']=function(_0x40ec20,_0x24dc07){var _0x300f25={'raw':![],'where':{'id':_0x40ec20[_0x92b2('0xbe')]['id']}},_0x40002d={};_0x40002d[_0x92b2('0x3f')]=_[_0x92b2('0xbf')](db[_0x92b2('0x35')][_0x92b2('0x36')]);_0x40002d[_0x92b2('0x3a')]=_[_0x92b2('0xbf')](_0x40ec20[_0x92b2('0x3a')]);_0x40002d['filters']=_[_0x92b2('0x3c')](_0x40002d['model'],_0x40002d[_0x92b2('0x3a')]);_0x300f25['attributes']=_[_0x92b2('0x3c')](_0x40002d[_0x92b2('0x3f')],qs['fields'](_0x40ec20[_0x92b2('0x3a')][_0x92b2('0x3e')]));_0x300f25[_0x92b2('0x3d')]=_0x300f25[_0x92b2('0x3d')]['length']?_0x300f25[_0x92b2('0x3d')]:_0x40002d[_0x92b2('0x3f')];if(_0x40ec20[_0x92b2('0x3a')]['includeAll']){_0x300f25[_0x92b2('0xc0')]=[{'all':!![]}];}_0x300f25=_[_0x92b2('0x9a')]({},_0x300f25,_0x40ec20['options']);return db[_0x92b2('0x35')][_0x92b2('0x5c')](_0x300f25)['then'](handleEntityNotFound(_0x24dc07,null))[_0x92b2('0x1c')](respondWithResult(_0x24dc07,null))[_0x92b2('0x2d')](handleError(_0x24dc07,null));};exports[_0x92b2('0xc1')]=function(_0x47fb98,_0x55c58f){return db['MailInteraction'][_0x92b2('0xc1')](_0x47fb98[_0x92b2('0xc2')],{})[_0x92b2('0x1c')](respondWithResult(_0x55c58f,0xc9))['catch'](handleError(_0x55c58f,null));};exports[_0x92b2('0x1b')]=function(_0x2dc8f4,_0xd1db27){if(_0x2dc8f4[_0x92b2('0xc2')]['id']){delete _0x2dc8f4[_0x92b2('0xc2')]['id'];}return db[_0x92b2('0x35')][_0x92b2('0x5c')]({'where':{'id':_0x2dc8f4['params']['id']}})[_0x92b2('0x1c')](handleEntityNotFound(_0xd1db27,null))[_0x92b2('0x1c')](saveUpdates(_0x2dc8f4[_0x92b2('0xc2')],null))[_0x92b2('0x1c')](respondWithResult(_0xd1db27,null))[_0x92b2('0x2d')](handleError(_0xd1db27,null));};exports['destroy']=function(_0x3568b7,_0x139a86){return db[_0x92b2('0x35')]['find']({'where':{'id':_0x3568b7[_0x92b2('0xbe')]['id']}})[_0x92b2('0x1c')](handleEntityNotFound(_0x139a86,null))[_0x92b2('0x1c')](removeEntity(_0x139a86,null))['catch'](handleError(_0x139a86,null));};exports[_0x92b2('0xc3')]=function(_0x194fff,_0x42c47f){return db[_0x92b2('0x35')][_0x92b2('0xc3')]()[_0x92b2('0x1c')](respondWithResult(_0x42c47f,null))[_0x92b2('0x2d')](handleError(_0x42c47f,null));};exports[_0x92b2('0xc4')]=function(_0x1c2571,_0x520d2c){return db[_0x92b2('0xc5')][_0x92b2('0x5c')]({'where':{'id':_0x1c2571[_0x92b2('0xbe')]['id']}})[_0x92b2('0x1c')](handleEntityNotFound(_0x520d2c,null))[_0x92b2('0x1c')](function(_0x1308d8){if(_0x1308d8){return _0x1308d8[_0x92b2('0xc4')](_0x1c2571[_0x92b2('0xc2')]['ids'],_[_0x92b2('0xc6')](_0x1c2571[_0x92b2('0xc2')],[_0x92b2('0xc7'),'id'])||{});}})[_0x92b2('0x1c')](respondWithResult(_0x520d2c,null))[_0x92b2('0x2d')](handleError(_0x520d2c,null));};exports[_0x92b2('0xc8')]=function(_0x286553,_0x353535){var _0x346a38={'raw':![],'where':{}};var _0x10cec6={};var _0x4f97cd={'count':0x0,'rows':[]};return db[_0x92b2('0x35')][_0x92b2('0xba')]({'where':{'id':_0x286553[_0x92b2('0xbe')]['id']}})[_0x92b2('0x1c')](handleEntityNotFound(_0x353535,null))[_0x92b2('0x1c')](function(_0x26d5ae){if(_0x26d5ae){_0x10cec6[_0x92b2('0x3f')]=_[_0x92b2('0xbf')](db[_0x92b2('0xc5')][_0x92b2('0x36')]);_0x10cec6[_0x92b2('0x3a')]=_['keys'](_0x286553[_0x92b2('0x3a')]);_0x10cec6['filters']=_[_0x92b2('0x3c')](_0x10cec6[_0x92b2('0x3f')],_0x10cec6[_0x92b2('0x3a')]);_0x346a38[_0x92b2('0x3d')]=_[_0x92b2('0x3c')](_0x10cec6[_0x92b2('0x3f')],qs[_0x92b2('0x3e')](_0x286553[_0x92b2('0x3a')][_0x92b2('0x3e')]));_0x346a38['attributes']=_0x346a38['attributes'][_0x92b2('0x5b')]?_0x346a38['attributes']:_0x10cec6[_0x92b2('0x3f')];if(!_0x286553['query'][_0x92b2('0x40')](_0x92b2('0xc9'))){_0x346a38[_0x92b2('0x41')]=qs[_0x92b2('0x41')](_0x286553['query']['limit']);_0x346a38[_0x92b2('0x18')]=qs['offset'](_0x286553[_0x92b2('0x3a')]['offset']);}_0x346a38[_0x92b2('0x42')]=qs['sort'](_0x286553[_0x92b2('0x3a')]['sort']);_0x346a38['where']=qs[_0x92b2('0x3b')](_[_0x92b2('0xca')](_0x286553[_0x92b2('0x3a')],_0x10cec6[_0x92b2('0x3b')]));_0x346a38[_0x92b2('0x44')][_0x92b2('0xcb')]=_0x26d5ae['id'];if(_0x286553['query'][_0x92b2('0x81')]){_0x346a38['where']=_[_0x92b2('0x9a')](_0x346a38['where'],{'$or':_[_0x92b2('0x22')](_0x346a38[_0x92b2('0x3d')],function(_0x2b639e){var _0x1ad83f={};_0x1ad83f[_0x2b639e]={'$like':'%'+_0x286553[_0x92b2('0x3a')][_0x92b2('0x81')]+'%'};return _0x1ad83f;})});}if(_0x286553[_0x92b2('0x3a')]['$gte']){var _0x3d9ac2=_0x286553[_0x92b2('0x3a')][_0x92b2('0x76')][_0x92b2('0x26')](',');var _0x350761={};_0x350761[_0x3d9ac2[0x0]]={'$gte':moment(_0x3d9ac2[0x1])[_0x92b2('0xcc')](_0x92b2('0xcd'))};_0x346a38[_0x92b2('0x44')]=_[_0x92b2('0x9a')](_0x346a38[_0x92b2('0x44')],_0x350761);}_0x346a38=_[_0x92b2('0x9a')]({},_0x346a38,_0x286553['options']);return db[_0x92b2('0xc5')][_0x92b2('0x17')]({'where':_0x346a38[_0x92b2('0x44')]})[_0x92b2('0x1c')](function(_0x163c4e){_0x4f97cd[_0x92b2('0x17')]=_0x163c4e;if(_0x286553['query'][_0x92b2('0xce')]){_0x346a38[_0x92b2('0xc0')]=[{'all':!![]}];}return db['MailMessage'][_0x92b2('0xcf')](_0x346a38);})[_0x92b2('0x1c')](function(_0xf49624){if(_0x286553[_0x92b2('0x3a')][_0x92b2('0xd0')]===_0x92b2('0xd1')){for(var _0x587d41=0x0;_0x587d41<_0xf49624[_0x92b2('0x5b')];_0x587d41++){_0xf49624[_0x587d41][_0x92b2('0xc2')]=juice(_0xf49624[_0x587d41][_0x92b2('0xc2')]);}}_0x4f97cd['rows']=_0xf49624;return _0x4f97cd;});}})[_0x92b2('0x1c')](respondWithFilteredResult(_0x353535,_0x346a38))[_0x92b2('0x2d')](handleError(_0x353535,null));};exports['addTags']=function(_0xb62792,_0x3743c0){return db[_0x92b2('0x35')][_0x92b2('0x5c')]({'where':{'id':_0xb62792['params']['id']}})[_0x92b2('0x1c')](handleEntityNotFound(_0x3743c0,null))[_0x92b2('0x1c')](function(_0x4d0935){if(_0x4d0935){return _0x4d0935[_0x92b2('0xd2')](_0xb62792[_0x92b2('0xc2')][_0x92b2('0xc7')],_[_0x92b2('0xc6')](_0xb62792['body'],[_0x92b2('0xc7'),'id'])||{})['spread'](function(){return db[_0x92b2('0x69')][_0x92b2('0xcf')]({'attributes':['id',_0x92b2('0x1f'),_0x92b2('0xd3')],'where':{'id':_0xb62792[_0x92b2('0xc2')][_0x92b2('0xc7')]}});})[_0x92b2('0x1c')](function(_0x2ba04d){socket[_0x92b2('0xd4')](_0x92b2('0xd5'),{'id':Number(_0xb62792[_0x92b2('0xbe')]['id']),'tags':_0x2ba04d||[]});return{'id':Number(_0xb62792[_0x92b2('0xbe')]['id']),'tags':_0x2ba04d||[]};});}})[_0x92b2('0x1c')](respondWithResult(_0x3743c0,null))[_0x92b2('0x2d')](handleError(_0x3743c0,null));};exports['removeTags']=function(_0x92fe34,_0x4d7d7f){return db['MailInteraction'][_0x92b2('0x5c')]({'where':{'id':_0x92fe34[_0x92b2('0xbe')]['id']}})[_0x92b2('0x1c')](handleEntityNotFound(_0x4d7d7f,null))[_0x92b2('0x1c')](function(_0x5a3871){if(_0x5a3871){return _0x5a3871['removeTags'](_0x92fe34[_0x92b2('0x3a')][_0x92b2('0xc7')]);}})[_0x92b2('0x1c')](respondWithStatusCode(_0x4d7d7f,null))['catch'](handleError(_0x4d7d7f,null));};exports[_0x92b2('0xd6')]=function(_0x6442ab,_0x595c31){var _0x1d267e=moment()[_0x92b2('0xd7')]()['toString']();var _0x59d2fb=path[_0x92b2('0xd8')](config[_0x92b2('0xd9')],_0x92b2('0xda'),_0x92b2('0xdb'),'tmp');var _0x4608a3=path[_0x92b2('0xd8')](config[_0x92b2('0xd9')],_0x92b2('0xda'),_0x92b2('0xdb'),_0x92b2('0xdc'));var _0x353b20=path[_0x92b2('0xd8')](_0x59d2fb,_0x1d267e);var _0x39631d=util[_0x92b2('0xcc')](_0x92b2('0xdd'),_0x6442ab[_0x92b2('0xbe')]['id'],_0x1d267e);var _0x23154f=path[_0x92b2('0xd8')](_0x59d2fb,_0x39631d);var _0x3e2690=[];if(_0x6442ab[_0x92b2('0x3a')][_0x92b2('0xdc')]){_0x3e2690[_0x92b2('0x27')]({'model':db['Attachment'],'as':'Attachments','raw':!![]});}var _0x27264c=[{'model':db[_0x92b2('0xc5')],'as':'Messages','attributes':['id','body',_0x92b2('0x47'),'to','cc','bcc',_0x92b2('0xde'),_0x92b2('0x75')],'where':{'secret':![]},'order':qs['sort']('id'),'include':_0x3e2690}];return db[_0x92b2('0x35')]['find']({'where':{'id':_0x6442ab[_0x92b2('0xbe')]['id']},'include':_0x27264c})[_0x92b2('0x1c')](handleEntityNotFound(_0x595c31,null))[_0x92b2('0x1c')](function(_0x23769f){if(_0x23769f&&_0x23769f[_0x92b2('0xdf')]){var _0x3d29e7=_0x23769f['get']({'plain':!![]});fs['mkdirSync'](_0x353b20);return BPromise['each'](_0x3d29e7['Messages'],function(_0x289ff9,_0x4f0a1c){var _0x1f0587={'from':_0x289ff9['from'],'to':_0x289ff9['to'],'subject':_0x289ff9[_0x92b2('0xde')],'html':htmlEntities[_0x92b2('0xe0')](_0x289ff9[_0x92b2('0xc2')]),'headers':{'Date':moment(_0x289ff9[_0x92b2('0x75')])['format']('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x289ff9['cc']){_0x1f0587[_0x92b2('0xe1')]['Cc']=_0x289ff9['cc'];}if(_0x289ff9[_0x92b2('0xe2')]){_0x1f0587[_0x92b2('0xe1')][_0x92b2('0xe3')]=_0x289ff9[_0x92b2('0xe2')];}return new BPromise(function(_0x14b22f,_0x3fab75){if(_0x289ff9['Attachments']){for(var _0xcc380b=0x0;_0xcc380b<_0x289ff9[_0x92b2('0xe4')][_0x92b2('0x5b')];_0xcc380b++){var _0x4ad0ed=_0x289ff9[_0x92b2('0xe4')][_0xcc380b];var _0x3e28c2=path[_0x92b2('0xd8')](_0x4608a3,_0x4ad0ed[_0x92b2('0xe5')]);if(fs[_0x92b2('0xe6')](_0x3e28c2)){_0x1f0587[_0x92b2('0xdc')][_0x92b2('0x27')]({'name':_0x4ad0ed[_0x92b2('0x1f')],'contentType':_0x4ad0ed[_0x92b2('0x38')],'data':fs[_0x92b2('0xe7')](_0x3e28c2)});}}}emlformat[_0x92b2('0xe8')](_0x1f0587,function(_0x305068,_0x5b41d6){if(_0x305068)return _0x3fab75(_0x305068);fs[_0x92b2('0xe9')](path[_0x92b2('0xd8')](_0x353b20,util[_0x92b2('0xcc')]('message%d.eml',_0x4f0a1c)),_0x5b41d6);return _0x14b22f(_0x5b41d6);});});})[_0x92b2('0x1c')](function(){return new BPromise(function(_0x2f3714,_0x27d6f3){zipdir(_0x353b20,{'saveTo':_0x23154f},function(_0x3460ea,_0xf0b185){if(_0x3460ea)return _0x27d6f3(_0x3460ea);return _0x2f3714(_0xf0b185);});})[_0x92b2('0x1c')](function(){return new BPromise(function(_0x291be6,_0xdf415a){rimraf(_0x353b20,function(_0x3bc7e0){if(_0x3bc7e0)_0xdf415a(_0x3bc7e0);return _0x291be6();});});})[_0x92b2('0x1c')](function(){return _0x595c31['download'](_0x23154f,_0x39631d,function(_0x13b75d){if(!_0x13b75d)fs[_0x92b2('0xea')](_0x23154f);});});});}else{return _0x595c31['sendStatus'](0xc8);}})[_0x92b2('0x2d')](handleError(_0x595c31,null));};
\ No newline at end of file
index faf3896..1f1a2ed 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x358a=['map','findAll','unreadMessages','length','emit','catch','hook','exports','events','../../mysqldb','MailMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users'];(function(_0x362947,_0x18005a){var _0x1c3d31=function(_0xfdc5e7){while(--_0xfdc5e7){_0x362947['push'](_0x362947['shift']());}};_0x1c3d31(++_0x18005a);}(_0x358a,0xd9));var _0xa358=function(_0x38ad79,_0x5e49e4){_0x38ad79=_0x38ad79-0x0;var _0xd4d59f=_0x358a[_0x38ad79];return _0xd4d59f;};'use strict';var EventEmitter=require(_0xa358('0x0'));var MailInteraction=require(_0xa358('0x1'))['db']['MailInteraction'];var MailMessage=require(_0xa358('0x1'))['db'][_0xa358('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0xa358('0x3')](0x0);var events={'afterCreate':_0xa358('0x4'),'afterUpdate':_0xa358('0x5'),'afterDestroy':_0xa358('0x6')};function emitEvent(_0x56a26d){return function(_0x3f1d73,_0xc6b259,_0x2aa510){_0x3f1d73[_0xa358('0x7')]({'attributes':['id'],'raw':!![]})[_0xa358('0x8')](function(_0x2eb9b4){_0x3f1d73[_0xa358('0x9')](_0xa358('0xa'),_0x2eb9b4[_0xa358('0xb')](function(_0x1ae28f){return{'id':_0x1ae28f['id']};}));return MailMessage[_0xa358('0xc')]({'where':{'MailInteractionId':_0x3f1d73['id'],'direction':'in','read':![]},'raw':!![]});})[_0xa358('0x8')](function(_0x5566c9){_0x3f1d73[_0xa358('0x9')](_0xa358('0xd'),_0x5566c9[_0xa358('0xe')]);MailInteractionEvents[_0xa358('0xf')](_0x56a26d+':'+_0x3f1d73['id'],_0x3f1d73);MailInteractionEvents[_0xa358('0xf')](_0x56a26d,_0x3f1d73);_0x2aa510(null);})[_0xa358('0x10')](_0x2aa510(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailInteraction[_0xa358('0x11')](e,emitEvent(event));}}module[_0xa358('0x12')]=MailInteractionEvents;
\ No newline at end of file
+var _0x303f=['catch','hasOwnProperty','exports','events','../../mysqldb','MailMessage','setMaxListeners','save','update','getUsers','then','Users','findAll','setDataValue','unreadMessages','length','emit'];(function(_0x59a570,_0x5f4965){var _0x28cffe=function(_0x3abdf6){while(--_0x3abdf6){_0x59a570['push'](_0x59a570['shift']());}};_0x28cffe(++_0x5f4965);}(_0x303f,0xbe));var _0xf303=function(_0x3ec87b,_0x367df7){_0x3ec87b=_0x3ec87b-0x0;var _0x1389dd=_0x303f[_0x3ec87b];return _0x1389dd;};'use strict';var EventEmitter=require(_0xf303('0x0'));var MailInteraction=require('../../mysqldb')['db']['MailInteraction'];var MailMessage=require(_0xf303('0x1'))['db'][_0xf303('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0xf303('0x3')](0x0);var events={'afterCreate':_0xf303('0x4'),'afterUpdate':_0xf303('0x5'),'afterDestroy':'remove'};function emitEvent(_0x567ba1){return function(_0x38b08d,_0x2fb8ed,_0x8e3b27){_0x38b08d[_0xf303('0x6')]({'attributes':['id'],'raw':!![]})[_0xf303('0x7')](function(_0x1b29d2){_0x38b08d['setDataValue'](_0xf303('0x8'),_0x1b29d2['map'](function(_0x4df6da){return{'id':_0x4df6da['id']};}));return MailMessage[_0xf303('0x9')]({'where':{'MailInteractionId':_0x38b08d['id'],'direction':'in','read':![]},'raw':!![]});})[_0xf303('0x7')](function(_0x531cb3){_0x38b08d[_0xf303('0xa')](_0xf303('0xb'),_0x531cb3[_0xf303('0xc')]);MailInteractionEvents['emit'](_0x567ba1+':'+_0x38b08d['id'],_0x38b08d);MailInteractionEvents[_0xf303('0xd')](_0x567ba1,_0x38b08d);_0x8e3b27(null);})[_0xf303('0xe')](_0x8e3b27(null));};}for(var e in events){if(events[_0xf303('0xf')](e)){var event=events[e];MailInteraction['hook'](e,emitEvent(event));}}module[_0xf303('0x10')]=MailInteractionEvents;
\ No newline at end of file
index b778502..c37e454 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0f36=['get','then','utf8mb4','lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./mailInteraction.attributes','define','MailInteraction','fti_mail_interactions','subject','FULLTEXT','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','changed','substatus','models'];(function(_0x1cb18a,_0x33167a){var _0x22442e=function(_0x46c611){while(--_0x46c611){_0x1cb18a['push'](_0x1cb18a['shift']());}};_0x22442e(++_0x33167a);}(_0x0f36,0xcb));var _0x60f3=function(_0x238b4b,_0x2fe72d){_0x238b4b=_0x238b4b-0x0;var _0x4fe904=_0x0f36[_0x238b4b];return _0x4fe904;};'use strict';var _=require(_0x60f3('0x0'));var util=require(_0x60f3('0x1'));var logger=require(_0x60f3('0x2'))('api');var moment=require(_0x60f3('0x3'));var BPromise=require('bluebird');var rp=require(_0x60f3('0x4'));var fs=require('fs');var path=require(_0x60f3('0x5'));var rimraf=require(_0x60f3('0x6'));var config=require(_0x60f3('0x7'));var attributes=require(_0x60f3('0x8'));module['exports']=function(_0x4e3319,_0x1d6609){return _0x4e3319[_0x60f3('0x9')](_0x60f3('0xa'),attributes,{'tableName':'mail_interactions','paranoid':![],'indexes':[{'name':_0x60f3('0xb'),'fields':[_0x60f3('0xc'),'to'],'type':_0x60f3('0xd')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x1868ba,_0x318999,_0x1f6414){if(_0x1868ba['substatus']){_0x1868ba[_0x60f3('0xe')]=moment()[_0x60f3('0xf')](_0x60f3('0x10'));}if(_0x1868ba[_0x60f3('0x11')]){_0x1868ba[_0x60f3('0x12')]=moment()[_0x60f3('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}_0x1f6414(null,_0x318999);},'beforeUpdate':function(_0x55971d,_0x40e1bf,_0x2d0e19){if(_0x55971d[_0x60f3('0x13')]('substatus')){_0x55971d[_0x60f3('0xe')]=_0x55971d['substatus']?moment()[_0x60f3('0xf')](_0x60f3('0x10')):null;}if(_0x55971d[_0x60f3('0x13')](_0x60f3('0x11'))){_0x55971d['closedAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x55971d[_0x60f3('0x14')]=null;_0x55971d[_0x60f3('0xe')]=null;}_0x2d0e19(null,_0x55971d);},'afterUpdate':function(_0x5cb11a,_0xd58075,_0x54c569){var _0x249d34=_0x4e3319[_0x60f3('0x15')];var _0x348964=_0x5cb11a[_0x60f3('0x16')]({'plain':!![]});if(_0x348964[_0x60f3('0x11')]){return _0x249d34['MailMessage']['update']({'read':!![]},{'where':{'MailInteractionId':_0x348964['id']}})[_0x60f3('0x17')](function(){_0x54c569();})['catch'](function(_0x1c4f99){_0x54c569(_0x1c4f99);});}else{_0x54c569();}}},'charset':_0x60f3('0x18'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x86e8=['bluebird','request-promise','path','rimraf','../../config/environment','./mailInteraction.attributes','exports','define','fti_mail_interactions','subject','FULLTEXT','substatus','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','changed','models','get','MailMessage','update','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment'];(function(_0x464120,_0x51ce4d){var _0x3927bb=function(_0xb23ff2){while(--_0xb23ff2){_0x464120['push'](_0x464120['shift']());}};_0x3927bb(++_0x51ce4d);}(_0x86e8,0xdc));var _0x886e=function(_0x4af9bb,_0x387e44){_0x4af9bb=_0x4af9bb-0x0;var _0x326ccc=_0x86e8[_0x4af9bb];return _0x326ccc;};'use strict';var _=require(_0x886e('0x0'));var util=require(_0x886e('0x1'));var logger=require('../../config/logger')(_0x886e('0x2'));var moment=require(_0x886e('0x3'));var BPromise=require(_0x886e('0x4'));var rp=require(_0x886e('0x5'));var fs=require('fs');var path=require(_0x886e('0x6'));var rimraf=require(_0x886e('0x7'));var config=require(_0x886e('0x8'));var attributes=require(_0x886e('0x9'));module[_0x886e('0xa')]=function(_0xb1862d,_0x263bce){return _0xb1862d[_0x886e('0xb')]('MailInteraction',attributes,{'tableName':'mail_interactions','paranoid':![],'indexes':[{'name':_0x886e('0xc'),'fields':[_0x886e('0xd'),'to'],'type':_0x886e('0xe')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x45efaf,_0x77a17a,_0x88227b){if(_0x45efaf[_0x886e('0xf')]){_0x45efaf[_0x886e('0x10')]=moment()[_0x886e('0x11')](_0x886e('0x12'));}if(_0x45efaf[_0x886e('0x13')]){_0x45efaf[_0x886e('0x14')]=moment()[_0x886e('0x11')](_0x886e('0x12'));}_0x88227b(null,_0x77a17a);},'beforeUpdate':function(_0x6f52e9,_0x57ce7a,_0x3f5060){if(_0x6f52e9['changed'](_0x886e('0xf'))){_0x6f52e9['substatusAt']=_0x6f52e9[_0x886e('0xf')]?moment()['format'](_0x886e('0x12')):null;}if(_0x6f52e9[_0x886e('0x15')](_0x886e('0x13'))){_0x6f52e9[_0x886e('0x14')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x6f52e9[_0x886e('0xf')]=null;_0x6f52e9[_0x886e('0x10')]=null;}_0x3f5060(null,_0x6f52e9);},'afterUpdate':function(_0x36cd39,_0x968142,_0x523d54){var _0x53679f=_0xb1862d[_0x886e('0x16')];var _0x51e87f=_0x36cd39[_0x886e('0x17')]({'plain':!![]});if(_0x51e87f['closed']){return _0x53679f[_0x886e('0x18')][_0x886e('0x19')]({'read':!![]},{'where':{'MailInteractionId':_0x51e87f['id']}})['then'](function(){_0x523d54();})['catch'](function(_0x5d2982){_0x523d54(_0x5d2982);});}else{_0x523d54();}}},'charset':_0x886e('0x1a'),'collate':_0x886e('0x1b')});};
\ No newline at end of file
index 517af99..d1e1087 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfdbd=['catch','UpdateMailInteraction','MailInteraction','body','options','where','limit','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','localhost','socket.io-emitter','./mailInteraction.socket','register','then','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result'];(function(_0x19753b,_0x3bcf46){var _0x11b4b4=function(_0x2800ae){while(--_0x2800ae){_0x19753b['push'](_0x19753b['shift']());}};_0x11b4b4(++_0x3bcf46);}(_0xfdbd,0xf0));var _0xdfdb=function(_0x2731f0,_0x126b1b){_0x2731f0=_0x2731f0-0x0;var _0x36a180=_0xfdbd[_0x2731f0];return _0x36a180;};'use strict';var _=require(_0xdfdb('0x0'));var util=require(_0xdfdb('0x1'));var moment=require(_0xdfdb('0x2'));var BPromise=require(_0xdfdb('0x3'));var rs=require(_0xdfdb('0x4'));var fs=require('fs');var Redis=require(_0xdfdb('0x5'));var db=require(_0xdfdb('0x6'))['db'];var utils=require(_0xdfdb('0x7'));var logger=require(_0xdfdb('0x8'))('rpc');var config=require(_0xdfdb('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xdfdb('0xa')][_0xdfdb('0xb')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0xdfdb('0xc'),'port':0x18eb});var socket=require(_0xdfdb('0xd'))(new Redis(config['redis']));require(_0xdfdb('0xe'))[_0xdfdb('0xf')](socket);function respondWithRpcPromise(_0x24eb73,_0x27ddcd,_0x3a44a9){return new BPromise(function(_0x1ace28,_0x2bb8d4){return client['request'](_0x24eb73,_0x3a44a9)[_0xdfdb('0x10')](function(_0x1972db){logger['info'](_0xdfdb('0x11'),_0x27ddcd,_0xdfdb('0x12'));logger[_0xdfdb('0x13')](_0xdfdb('0x14'),_0x27ddcd,_0xdfdb('0x12'),JSON[_0xdfdb('0x15')](_0x1972db));if(_0x1972db[_0xdfdb('0x16')]){if(_0x1972db[_0xdfdb('0x16')]['code']===0x1f4){logger['error'](_0xdfdb('0x11'),_0x27ddcd,_0x1972db['error'][_0xdfdb('0x17')]);return _0x2bb8d4(_0x1972db[_0xdfdb('0x16')][_0xdfdb('0x17')]);}logger[_0xdfdb('0x16')](_0xdfdb('0x11'),_0x27ddcd,_0x1972db[_0xdfdb('0x16')]['message']);return _0x1ace28(_0x1972db['error'][_0xdfdb('0x17')]);}else{logger[_0xdfdb('0x18')](_0xdfdb('0x11'),_0x27ddcd,'request\x20sent');_0x1ace28(_0x1972db[_0xdfdb('0x19')][_0xdfdb('0x17')]);}})[_0xdfdb('0x1a')](function(_0xd60a30){logger[_0xdfdb('0x16')](_0xdfdb('0x11'),_0x27ddcd,_0xd60a30);_0x2bb8d4(_0xd60a30);});});}exports[_0xdfdb('0x1b')]=function(_0x29a639){var _0x5b8cb5=this;return new Promise(function(_0x14638a,_0xb7417c){return db[_0xdfdb('0x1c')]['update'](_0x29a639[_0xdfdb('0x1d')],{'raw':_0x29a639[_0xdfdb('0x1e')]?_0x29a639[_0xdfdb('0x1e')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x29a639[_0xdfdb('0x1e')]?_0x29a639[_0xdfdb('0x1e')][_0xdfdb('0x1f')]||null:null,'attributes':_0x29a639['options']?_0x29a639[_0xdfdb('0x1e')]['attributes']||null:null,'limit':_0x29a639[_0xdfdb('0x1e')]?_0x29a639[_0xdfdb('0x1e')][_0xdfdb('0x20')]||null:null})[_0xdfdb('0x10')](function(_0x4f69cf){logger[_0xdfdb('0x18')](_0xdfdb('0x1b'),_0x29a639);logger[_0xdfdb('0x13')](_0xdfdb('0x1b'),_0x29a639,JSON[_0xdfdb('0x15')](_0x4f69cf));_0x14638a(_0x4f69cf);})[_0xdfdb('0x1a')](function(_0x57d24f){logger[_0xdfdb('0x16')](_0xdfdb('0x1b'),_0x57d24f[_0xdfdb('0x17')],_0x29a639);_0xb7417c(_0x5b8cb5['error'](0x1f4,_0x57d24f[_0xdfdb('0x17')]));});});};exports['AddTagsToMailInteraction']=function(_0xd0cef0){return new Promise(function(_0x1aec66,_0x19c36f){return db['MailInteraction']['find']({'where':_0xd0cef0[_0xdfdb('0x1e')]?_0xd0cef0[_0xdfdb('0x1e')][_0xdfdb('0x1f')]||null:null})[_0xdfdb('0x10')](function(_0x371b69){if(_0x371b69){return _0x371b69[_0xdfdb('0x21')](_0xd0cef0['body'][_0xdfdb('0x22')],_[_0xdfdb('0x23')](_0xd0cef0[_0xdfdb('0x1d')],[_0xdfdb('0x22'),'id'])||{});}})[_0xdfdb('0x24')](function(_0x157de8){logger[_0xdfdb('0x18')](_0xdfdb('0x25'),_0xd0cef0);logger[_0xdfdb('0x13')](_0xdfdb('0x25'),_0xd0cef0,JSON[_0xdfdb('0x15')](_0x157de8));_0x1aec66(_0x157de8);})['catch'](function(_0x4dadad){logger[_0xdfdb('0x16')]('AddTags',_0x4dadad[_0xdfdb('0x17')],_0xd0cef0);_0x19c36f(_this[_0xdfdb('0x16')](0x1f4,_0x4dadad[_0xdfdb('0x17')]));});});};
\ No newline at end of file
+var _0xe90c=['MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','MailInteraction','update','body','options','where','attributes','UpdateMailInteraction','AddTagsToMailInteraction','find','omit','ids','AddTags','lodash','util','moment','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','socket.io-emitter','register','request','then','info','MailInteraction,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x24eaf6,_0x1535ee){var _0x534bb9=function(_0x41dbbb){while(--_0x41dbbb){_0x24eaf6['push'](_0x24eaf6['shift']());}};_0x534bb9(++_0x1535ee);}(_0xe90c,0x153));var _0xce90=function(_0x518b25,_0x32d489){_0x518b25=_0x518b25-0x0;var _0x4faabe=_0xe90c[_0x518b25];return _0x4faabe;};'use strict';var _=require(_0xce90('0x0'));var util=require(_0xce90('0x1'));var moment=require(_0xce90('0x2'));var BPromise=require('bluebird');var rs=require(_0xce90('0x3'));var fs=require('fs');var Redis=require(_0xce90('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xce90('0x5'))(_0xce90('0x6'));var config=require(_0xce90('0x7'));var jayson=require(_0xce90('0x8'));var client=jayson[_0xce90('0x9')][_0xce90('0xa')]({'port':0x232a});config['redis']=_[_0xce90('0xb')](config[_0xce90('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xce90('0xd'))(new Redis(config['redis']));require('./mailInteraction.socket')[_0xce90('0xe')](socket);function respondWithRpcPromise(_0x3f04df,_0x213131,_0x458d26){return new BPromise(function(_0x218e97,_0xf90b1){return client[_0xce90('0xf')](_0x3f04df,_0x458d26)[_0xce90('0x10')](function(_0x3ee3c6){logger[_0xce90('0x11')](_0xce90('0x12'),_0x213131,_0xce90('0x13'));logger[_0xce90('0x14')](_0xce90('0x15'),_0x213131,_0xce90('0x13'),JSON[_0xce90('0x16')](_0x3ee3c6));if(_0x3ee3c6[_0xce90('0x17')]){if(_0x3ee3c6['error'][_0xce90('0x18')]===0x1f4){logger['error']('MailInteraction,\x20%s,\x20%s',_0x213131,_0x3ee3c6['error']['message']);return _0xf90b1(_0x3ee3c6[_0xce90('0x17')][_0xce90('0x19')]);}logger['error'](_0xce90('0x12'),_0x213131,_0x3ee3c6[_0xce90('0x17')][_0xce90('0x19')]);return _0x218e97(_0x3ee3c6[_0xce90('0x17')][_0xce90('0x19')]);}else{logger[_0xce90('0x11')](_0xce90('0x12'),_0x213131,'request\x20sent');_0x218e97(_0x3ee3c6[_0xce90('0x1a')][_0xce90('0x19')]);}})[_0xce90('0x1b')](function(_0x595ee6){logger[_0xce90('0x17')](_0xce90('0x12'),_0x213131,_0x595ee6);_0xf90b1(_0x595ee6);});});}exports['UpdateMailInteraction']=function(_0x1a53fd){var _0x1e8ba3=this;return new Promise(function(_0x426c36,_0x4e0890){return db[_0xce90('0x1c')][_0xce90('0x1d')](_0x1a53fd[_0xce90('0x1e')],{'raw':_0x1a53fd['options']?_0x1a53fd[_0xce90('0x1f')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1a53fd[_0xce90('0x1f')]?_0x1a53fd[_0xce90('0x1f')][_0xce90('0x20')]||null:null,'attributes':_0x1a53fd['options']?_0x1a53fd['options'][_0xce90('0x21')]||null:null,'limit':_0x1a53fd['options']?_0x1a53fd['options']['limit']||null:null})[_0xce90('0x10')](function(_0x5242ea){logger[_0xce90('0x11')](_0xce90('0x22'),_0x1a53fd);logger[_0xce90('0x14')]('UpdateMailInteraction',_0x1a53fd,JSON[_0xce90('0x16')](_0x5242ea));_0x426c36(_0x5242ea);})[_0xce90('0x1b')](function(_0x40a77e){logger[_0xce90('0x17')]('UpdateMailInteraction',_0x40a77e[_0xce90('0x19')],_0x1a53fd);_0x4e0890(_0x1e8ba3[_0xce90('0x17')](0x1f4,_0x40a77e['message']));});});};exports[_0xce90('0x23')]=function(_0x56a239){return new Promise(function(_0x107e28,_0x54edf3){return db[_0xce90('0x1c')][_0xce90('0x24')]({'where':_0x56a239[_0xce90('0x1f')]?_0x56a239[_0xce90('0x1f')][_0xce90('0x20')]||null:null})[_0xce90('0x10')](function(_0x38cf8c){if(_0x38cf8c){return _0x38cf8c['addTags'](_0x56a239['body']['ids'],_[_0xce90('0x25')](_0x56a239[_0xce90('0x1e')],[_0xce90('0x26'),'id'])||{});}})['spread'](function(_0x665d5c){logger[_0xce90('0x11')](_0xce90('0x27'),_0x56a239);logger[_0xce90('0x14')]('AddTags',_0x56a239,JSON[_0xce90('0x16')](_0x665d5c));_0x107e28(_0x665d5c);})[_0xce90('0x1b')](function(_0x2a570f){logger[_0xce90('0x17')](_0xce90('0x27'),_0x2a570f[_0xce90('0x19')],_0x56a239);_0x54edf3(_this[_0xce90('0x17')](0x1f4,_0x2a570f[_0xce90('0x19')]));});});};
\ No newline at end of file
index 82d2a1c..8a5e240 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0917=['update','emit','removeListener','length','mailInteraction:','remove'];(function(_0x21f4fc,_0x3c8aa9){var _0x1a3218=function(_0x2c46e0){while(--_0x2c46e0){_0x21f4fc['push'](_0x21f4fc['shift']());}};_0x1a3218(++_0x3c8aa9);}(_0x0917,0x16d));var _0x7091=function(_0x38d8e2,_0x48603c){_0x38d8e2=_0x38d8e2-0x0;var _0x5afbee=_0x0917[_0x38d8e2];return _0x5afbee;};'use strict';var MailInteractionEvents=require('./mailInteraction.events');var events=['save',_0x7091('0x0'),_0x7091('0x1')];function createListener(_0xbc6c79,_0x3f77d9){return function(_0x47699c){_0x3f77d9[_0x7091('0x2')](_0xbc6c79,_0x47699c);};}function removeListener(_0x545dec,_0x5e8288){return function(){MailInteractionEvents[_0x7091('0x3')](_0x545dec,_0x5e8288);};}exports['register']=function(_0x4b70ca){for(var _0x311c82=0x0,_0x39ff9c=events[_0x7091('0x4')];_0x311c82<_0x39ff9c;_0x311c82++){var _0x3e7a5a=events[_0x311c82];var _0xf495c=createListener(_0x7091('0x5')+_0x3e7a5a,_0x4b70ca);MailInteractionEvents['on'](_0x3e7a5a,_0xf495c);}};
\ No newline at end of file
+var _0x575f=['register','mailInteraction:','save','remove','emit'];(function(_0x4bb66f,_0x3cd682){var _0xf2772f=function(_0x2e3698){while(--_0x2e3698){_0x4bb66f['push'](_0x4bb66f['shift']());}};_0xf2772f(++_0x3cd682);}(_0x575f,0x1c9));var _0xf575=function(_0x4f7ed7,_0x46e8ac){_0x4f7ed7=_0x4f7ed7-0x0;var _0x46e8e5=_0x575f[_0x4f7ed7];return _0x46e8e5;};'use strict';var MailInteractionEvents=require('./mailInteraction.events');var events=[_0xf575('0x0'),_0xf575('0x1'),'update'];function createListener(_0x1f70d2,_0x190c64){return function(_0x296c12){_0x190c64[_0xf575('0x2')](_0x1f70d2,_0x296c12);};}function removeListener(_0x3a3426,_0x774c06){return function(){MailInteractionEvents['removeListener'](_0x3a3426,_0x774c06);};}exports[_0xf575('0x3')]=function(_0x2050f9){for(var _0x2a7873=0x0,_0x513ab3=events['length'];_0x2a7873<_0x513ab3;_0x2a7873++){var _0x3c13ea=events[_0x2a7873];var _0x3c3e84=createListener(_0xf575('0x4')+_0x3c13ea,_0x2050f9);MailInteractionEvents['on'](_0x3c13ea,_0x3c3e84);}};
\ No newline at end of file
index e106c1a..8129ca8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd813=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailMessage.controller','get','isAuthenticated','index','/describe','/:id','show','download','post','mail','update','/:id/accept','accept','/:id/reject','delete','exports','path','connect-timeout'];(function(_0x543084,_0x4337f5){var _0x306a57=function(_0x2769ed){while(--_0x2769ed){_0x543084['push'](_0x543084['shift']());}};_0x306a57(++_0x4337f5);}(_0xd813,0x19c));var _0x3d81=function(_0x5d043c,_0xff15e4){_0x5d043c=_0x5d043c-0x0;var _0x422b57=_0xd813[_0x5d043c];return _0x422b57;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3d81('0x0'));var timeout=require(_0x3d81('0x1'));var express=require(_0x3d81('0x2'));var router=express[_0x3d81('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x3d81('0x4'));var interaction=require(_0x3d81('0x5'));var config=require(_0x3d81('0x6'));var controller=require(_0x3d81('0x7'));router[_0x3d81('0x8')]('/',auth[_0x3d81('0x9')](),controller[_0x3d81('0xa')]);router[_0x3d81('0x8')](_0x3d81('0xb'),auth[_0x3d81('0x9')](),controller['describe']);router[_0x3d81('0x8')](_0x3d81('0xc'),auth[_0x3d81('0x9')](),controller[_0x3d81('0xd')]);router[_0x3d81('0x8')]('/:id/download',auth[_0x3d81('0x9')](),controller[_0x3d81('0xe')]);router[_0x3d81('0xf')]('/',auth[_0x3d81('0x9')](),interaction['tracked'](_0x3d81('0x10'),'mailmessage:create'),controller['create']);router['put'](_0x3d81('0xc'),auth[_0x3d81('0x9')](),controller[_0x3d81('0x11')]);router['put'](_0x3d81('0x12'),auth[_0x3d81('0x9')](),controller[_0x3d81('0x13')]);router['put'](_0x3d81('0x14'),auth[_0x3d81('0x9')](),controller['reject']);router[_0x3d81('0x15')](_0x3d81('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x3d81('0x16')]=router;
\ No newline at end of file
+var _0x9be2=['/:id/download','download','post','tracked','mail','mailmessage:create','create','put','/:id/accept','accept','/:id/reject','delete','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x1ea506,_0x218207){var _0x1d03d4=function(_0x1fe842){while(--_0x1fe842){_0x1ea506['push'](_0x1ea506['shift']());}};_0x1d03d4(++_0x218207);}(_0x9be2,0x85));var _0x29be=function(_0x45d198,_0x3066d6){_0x45d198=_0x45d198-0x0;var _0x3f0137=_0x9be2[_0x45d198];return _0x3f0137;};'use strict';var multer=require(_0x29be('0x0'));var util=require(_0x29be('0x1'));var path=require(_0x29be('0x2'));var timeout=require('connect-timeout');var express=require(_0x29be('0x3'));var router=express[_0x29be('0x4')]();var fs_extra=require(_0x29be('0x5'));var auth=require(_0x29be('0x6'));var interaction=require(_0x29be('0x7'));var config=require(_0x29be('0x8'));var controller=require(_0x29be('0x9'));router[_0x29be('0xa')]('/',auth[_0x29be('0xb')](),controller[_0x29be('0xc')]);router[_0x29be('0xa')](_0x29be('0xd'),auth['isAuthenticated'](),controller[_0x29be('0xe')]);router['get'](_0x29be('0xf'),auth[_0x29be('0xb')](),controller[_0x29be('0x10')]);router[_0x29be('0xa')](_0x29be('0x11'),auth[_0x29be('0xb')](),controller[_0x29be('0x12')]);router[_0x29be('0x13')]('/',auth[_0x29be('0xb')](),interaction[_0x29be('0x14')](_0x29be('0x15'),_0x29be('0x16')),controller[_0x29be('0x17')]);router[_0x29be('0x18')](_0x29be('0xf'),auth[_0x29be('0xb')](),controller['update']);router[_0x29be('0x18')](_0x29be('0x19'),auth[_0x29be('0xb')](),controller[_0x29be('0x1a')]);router[_0x29be('0x18')](_0x29be('0x1b'),auth['isAuthenticated'](),controller['reject']);router[_0x29be('0x1c')](_0x29be('0xf'),auth[_0x29be('0xb')](),controller[_0x29be('0x1d')]);module['exports']=router;
\ No newline at end of file
index 169f2cb..aaa65b2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8d84=['ENUM','out','DATE','INTEGER','Email','Chat','sequelize','lodash','long','TEXT'];(function(_0xe50651,_0x78b476){var _0xc8931c=function(_0x1c2902){while(--_0x1c2902){_0xe50651['push'](_0xe50651['shift']());}};_0xc8931c(++_0x78b476);}(_0x8d84,0x114));var _0x48d8=function(_0x53964b,_0x1b60eb){_0x53964b=_0x53964b-0x0;var _0x26a71d=_0x8d84[_0x53964b];return _0x26a71d;};'use strict';var Sequelize=require(_0x48d8('0x0'));var _=require(_0x48d8('0x1'));module['exports']={'body':{'type':Sequelize['TEXT'](_0x48d8('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x48d8('0x3')]('medium')},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x48d8('0x4')]('in',_0x48d8('0x5')),'defaultValue':_0x48d8('0x5'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0x1fe)},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize['TEXT'](_0x48d8('0x2'))},'cc':{'type':Sequelize['TEXT'](_0x48d8('0x2'))},'bcc':{'type':Sequelize[_0x48d8('0x3')](_0x48d8('0x2'))},'subject':{'type':Sequelize[_0x48d8('0x3')]},'sentAt':{'type':Sequelize[_0x48d8('0x6')]},'attach':{'type':Sequelize[_0x48d8('0x7')],'defaultValue':0x0},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'readAt':{'type':Sequelize[_0x48d8('0x6')]},'originTo':{'type':Sequelize['TEXT'](_0x48d8('0x2'))},'originCc':{'type':Sequelize[_0x48d8('0x3')](_0x48d8('0x2'))},'originChannel':{'type':Sequelize[_0x48d8('0x4')](_0x48d8('0x8'),_0x48d8('0x9')),'defaultValue':_0x48d8('0x8'),'allowNull':![]}};
\ No newline at end of file
+var _0x0c74=['long','TEXT','medium','BOOLEAN','out','STRING','DATE','INTEGER','ENUM','Email','Chat','lodash','exports'];(function(_0x5131eb,_0x5e8b21){var _0x4cf620=function(_0x197a46){while(--_0x197a46){_0x5131eb['push'](_0x5131eb['shift']());}};_0x4cf620(++_0x5e8b21);}(_0x0c74,0xc1));var _0x40c7=function(_0x3884b7,_0x37682d){_0x3884b7=_0x3884b7-0x0;var _0x598253=_0x0c74[_0x3884b7];return _0x598253;};'use strict';var Sequelize=require('sequelize');var _=require(_0x40c7('0x0'));module[_0x40c7('0x1')]={'body':{'type':Sequelize['TEXT'](_0x40c7('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x40c7('0x3')](_0x40c7('0x4'))},'read':{'type':Sequelize[_0x40c7('0x5')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x40c7('0x6')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0x40c7('0x7')](0x1fe)},'from':{'type':Sequelize[_0x40c7('0x7')]},'to':{'type':Sequelize[_0x40c7('0x3')]('long')},'cc':{'type':Sequelize[_0x40c7('0x3')](_0x40c7('0x2'))},'bcc':{'type':Sequelize['TEXT'](_0x40c7('0x2'))},'subject':{'type':Sequelize[_0x40c7('0x3')]},'sentAt':{'type':Sequelize[_0x40c7('0x8')]},'attach':{'type':Sequelize[_0x40c7('0x9')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x40c7('0x5')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x40c7('0x8')]},'originTo':{'type':Sequelize[_0x40c7('0x3')](_0x40c7('0x2'))},'originCc':{'type':Sequelize[_0x40c7('0x3')](_0x40c7('0x2'))},'originChannel':{'type':Sequelize[_0x40c7('0xa')](_0x40c7('0xb'),_0x40c7('0xc')),'defaultValue':'Email','allowNull':![]}};
\ No newline at end of file
index f80a965..694f213 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfb78=['limit','count','Content-Range','update','end','sendStatus','name','send','index','fieldName','type','key','model','map','query','keys','intersection','fields','length','hasOwnProperty','nolimit','sort','filters','pick','filter','where','merge','VIRTUAL','options','then','includeAll','include','MailMessage','findAll','rows','show','params','rawAttributes','attributes','find','body','describe','create','out','secret','split','MailAccount','findOne','MailAccountId','CmList','Contacts','updatedAt','MailServerOut','Smtp','CloudProvider','getSmtpOptions','attachments','join','root','List','CmContact','ListId','List\x20not\x20found','SendMail','messageId','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','MailInteractionId','read1stAt','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','fullname','email','internal','interface','format','SIP/%s','channel','motionChannel','event','fromString','EventManager','acceptmessage','mail','MailInteraction','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','User','reject','rejectmessage','download','server','tmp','files','message-%s.eml','from','bcc','subject','Attachment','decode','createdAt','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','Attachments','basename','push','readFileSync','build','writeFileSync','unlinkSync','eml-format','bluebird','ioredis','../../components/parsers/qs','api','../../config/logger','mail-interactions','../../config/environment','../../mysqldb','redis','defaults','html-entities','./mailMessage.socket','register','jayson/promise','client','http','request','MailMessage,\x20%s,\x20%s','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','status','json','offset','undefined'];(function(_0x4a53d,_0x58a95e){var _0x27410e=function(_0x38fc90){while(--_0x38fc90){_0x4a53d['push'](_0x4a53d['shift']());}};_0x27410e(++_0x58a95e);}(_0xfb78,0x7e));var _0x8fb7=function(_0x426711,_0x12264c){_0x426711=_0x426711-0x0;var _0x592991=_0xfb78[_0x426711];return _0x592991;};'use strict';var emlformat=require(_0x8fb7('0x0'));var moment=require('moment');var BPromise=require(_0x8fb7('0x1'));var util=require('util');var path=require('path');var fs=require('fs');var _=require('lodash');var Redis=require(_0x8fb7('0x2'));var htmlToText=require('html-to-text');var qs=require(_0x8fb7('0x3'));var logger=require('../../config/logger')(_0x8fb7('0x4'));var interaction_log=require(_0x8fb7('0x5'))(_0x8fb7('0x6'));var config=require(_0x8fb7('0x7'));var db=require(_0x8fb7('0x8'))['db'];config[_0x8fb7('0x9')]=_[_0x8fb7('0xa')](config[_0x8fb7('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8fb7('0x9')]));var htmlEntities=require(_0x8fb7('0xb'));require(_0x8fb7('0xc'))[_0x8fb7('0xd')](socket);var jayson=require(_0x8fb7('0xe'));var client=jayson[_0x8fb7('0xf')][_0x8fb7('0x10')]({'port':0x232c});var client9003=jayson[_0x8fb7('0xf')][_0x8fb7('0x10')]({'port':0x232b});var client9002=jayson[_0x8fb7('0xf')][_0x8fb7('0x10')]({'port':0x232a});function respondWithRpcPromise(_0x58c62c,_0x2b7dbb,_0x1d1183,_0x30bb5d){return new BPromise(function(_0x4f37e7,_0x39a844){var _0x1df352=_0x30bb5d||client;return _0x1df352[_0x8fb7('0x11')](_0x58c62c,_0x1d1183)['then'](function(_0x11ed7b){logger['info'](_0x8fb7('0x12'),_0x2b7dbb,'request\x20sent');logger[_0x8fb7('0x13')](_0x8fb7('0x14'),_0x2b7dbb,'request\x20sent',JSON[_0x8fb7('0x15')](_0x11ed7b));if(_0x11ed7b[_0x8fb7('0x16')]){if(_0x11ed7b[_0x8fb7('0x16')][_0x8fb7('0x17')]===0x1f4){logger[_0x8fb7('0x16')](_0x8fb7('0x12'),_0x2b7dbb,_0x11ed7b['error'][_0x8fb7('0x18')]);return _0x39a844(_0x11ed7b[_0x8fb7('0x16')]['message']);}logger[_0x8fb7('0x16')]('MailMessage,\x20%s,\x20%s',_0x2b7dbb,_0x11ed7b[_0x8fb7('0x16')][_0x8fb7('0x18')]);return _0x4f37e7(_0x11ed7b[_0x8fb7('0x16')]['message']);}else{logger[_0x8fb7('0x19')](_0x8fb7('0x12'),_0x2b7dbb,'request\x20sent');_0x4f37e7(_0x11ed7b[_0x8fb7('0x1a')]['message']);}})[_0x8fb7('0x1b')](function(_0xebb2d7){logger[_0x8fb7('0x16')](_0x8fb7('0x12'),_0x2b7dbb,_0xebb2d7);_0x39a844(_0xebb2d7);});});}function respondWithResult(_0x5cdc67,_0xefe176){_0xefe176=_0xefe176||0xc8;return function(_0x26934d){if(_0x26934d){return _0x5cdc67[_0x8fb7('0x1c')](_0xefe176)[_0x8fb7('0x1d')](_0x26934d);}};}function respondWithFilteredResult(_0x491ebf,_0x2a8c8b){return function(_0x44707){if(_0x44707){var _0x2d9576=typeof _0x2a8c8b[_0x8fb7('0x1e')]===_0x8fb7('0x1f')&&typeof _0x2a8c8b[_0x8fb7('0x20')]===_0x8fb7('0x1f');var _0x367375=_0x44707[_0x8fb7('0x21')];var _0x16b93f=_0x2d9576?0x0:_0x2a8c8b[_0x8fb7('0x1e')];var _0x144806=_0x2d9576?_0x44707['count']:_0x2a8c8b[_0x8fb7('0x1e')]+_0x2a8c8b[_0x8fb7('0x20')];var _0x393c5a;if(_0x144806>=_0x367375){_0x144806=_0x367375;_0x393c5a=0xc8;}else{_0x393c5a=0xce;}_0x491ebf[_0x8fb7('0x1c')](_0x393c5a);return _0x491ebf['set'](_0x8fb7('0x22'),_0x16b93f+'-'+_0x144806+'/'+_0x367375)[_0x8fb7('0x1d')](_0x44707);}return null;};}function saveUpdates(_0x32147e){return function(_0x75fe7b){if(_0x75fe7b){return _0x75fe7b[_0x8fb7('0x23')](_0x32147e)['then'](function(_0x25c095){return _0x25c095;});}return null;};}function removeEntity(_0x541838){return function(_0x2174ee){if(_0x2174ee){return _0x2174ee['destroy']()['then'](function(){_0x541838[_0x8fb7('0x1c')](0xcc)[_0x8fb7('0x24')]();});}};}function handleEntityNotFound(_0x126b27){return function(_0x3db7d5){if(!_0x3db7d5){_0x126b27[_0x8fb7('0x25')](0x194);}return _0x3db7d5;};}function handleError(_0x2bbdbf,_0x4d1807){_0x4d1807=_0x4d1807||0x1f4;return function(_0x394c9c){logger['error'](_0x394c9c['stack']);if(_0x394c9c[_0x8fb7('0x26')]){delete _0x394c9c[_0x8fb7('0x26')];}_0x2bbdbf[_0x8fb7('0x1c')](_0x4d1807)[_0x8fb7('0x27')](_0x394c9c);};}exports[_0x8fb7('0x28')]=function(_0x3f6a46,_0x57c4fb){var _0x1522cb={},_0x7fcecd={},_0x304fbb={'count':0x0,'rows':[]};var _0x25c474=_['map'](db['MailMessage']['rawAttributes'],function(_0x3ba729){return{'name':_0x3ba729[_0x8fb7('0x29')],'type':_0x3ba729[_0x8fb7('0x2a')][_0x8fb7('0x2b')]};});_0x7fcecd[_0x8fb7('0x2c')]=_[_0x8fb7('0x2d')](_0x25c474,_0x8fb7('0x26'));_0x7fcecd[_0x8fb7('0x2e')]=_[_0x8fb7('0x2f')](_0x3f6a46[_0x8fb7('0x2e')]);_0x7fcecd['filters']=_[_0x8fb7('0x30')](_0x7fcecd[_0x8fb7('0x2c')],_0x7fcecd[_0x8fb7('0x2e')]);_0x1522cb['attributes']=_[_0x8fb7('0x30')](_0x7fcecd['model'],qs[_0x8fb7('0x31')](_0x3f6a46[_0x8fb7('0x2e')][_0x8fb7('0x31')]));_0x1522cb['attributes']=_0x1522cb['attributes'][_0x8fb7('0x32')]?_0x1522cb['attributes']:_0x7fcecd['model'];if(!_0x3f6a46[_0x8fb7('0x2e')][_0x8fb7('0x33')](_0x8fb7('0x34'))){_0x1522cb[_0x8fb7('0x20')]=qs[_0x8fb7('0x20')](_0x3f6a46[_0x8fb7('0x2e')][_0x8fb7('0x20')]);_0x1522cb[_0x8fb7('0x1e')]=qs[_0x8fb7('0x1e')](_0x3f6a46[_0x8fb7('0x2e')][_0x8fb7('0x1e')]);}_0x1522cb['order']=qs[_0x8fb7('0x35')](_0x3f6a46['query']['sort']);_0x1522cb['where']=qs[_0x8fb7('0x36')](_[_0x8fb7('0x37')](_0x3f6a46['query'],_0x7fcecd[_0x8fb7('0x36')]),_0x25c474);if(_0x3f6a46[_0x8fb7('0x2e')][_0x8fb7('0x38')]){_0x1522cb[_0x8fb7('0x39')]=_[_0x8fb7('0x3a')](_0x1522cb[_0x8fb7('0x39')],{'$or':_[_0x8fb7('0x2d')](_0x25c474,function(_0x3646b0){if(_0x3646b0[_0x8fb7('0x2a')]!==_0x8fb7('0x3b')){var _0x728880={};_0x728880[_0x3646b0[_0x8fb7('0x26')]]={'$like':'%'+_0x3f6a46[_0x8fb7('0x2e')]['filter']+'%'};return _0x728880;}})});}_0x1522cb=_[_0x8fb7('0x3a')]({},_0x1522cb,_0x3f6a46[_0x8fb7('0x3c')]);var _0x39c28a={'where':_0x1522cb[_0x8fb7('0x39')]};return db['MailMessage'][_0x8fb7('0x21')](_0x39c28a)[_0x8fb7('0x3d')](function(_0x4db3a1){_0x304fbb[_0x8fb7('0x21')]=_0x4db3a1;if(_0x3f6a46[_0x8fb7('0x2e')][_0x8fb7('0x3e')]){_0x1522cb[_0x8fb7('0x3f')]=[{'all':!![]}];}return db[_0x8fb7('0x40')][_0x8fb7('0x41')](_0x1522cb);})[_0x8fb7('0x3d')](function(_0x53cca4){_0x304fbb[_0x8fb7('0x42')]=_0x53cca4;return _0x304fbb;})[_0x8fb7('0x3d')](respondWithFilteredResult(_0x57c4fb,_0x1522cb))[_0x8fb7('0x1b')](handleError(_0x57c4fb,null));};exports[_0x8fb7('0x43')]=function(_0x49fed0,_0x5ea2e2){var _0x47388d={'raw':!![],'where':{'id':_0x49fed0[_0x8fb7('0x44')]['id']}},_0x382617={};_0x382617[_0x8fb7('0x2c')]=_[_0x8fb7('0x2f')](db[_0x8fb7('0x40')][_0x8fb7('0x45')]);_0x382617['query']=_['keys'](_0x49fed0[_0x8fb7('0x2e')]);_0x382617[_0x8fb7('0x36')]=_['intersection'](_0x382617[_0x8fb7('0x2c')],_0x382617['query']);_0x47388d['attributes']=_[_0x8fb7('0x30')](_0x382617[_0x8fb7('0x2c')],qs['fields'](_0x49fed0['query'][_0x8fb7('0x31')]));_0x47388d[_0x8fb7('0x46')]=_0x47388d[_0x8fb7('0x46')][_0x8fb7('0x32')]?_0x47388d[_0x8fb7('0x46')]:_0x382617[_0x8fb7('0x2c')];if(_0x49fed0['query'][_0x8fb7('0x3e')]){_0x47388d[_0x8fb7('0x3f')]=[{'all':!![]}];}_0x47388d=_[_0x8fb7('0x3a')]({},_0x47388d,_0x49fed0['options']);return db['MailMessage'][_0x8fb7('0x47')](_0x47388d)[_0x8fb7('0x3d')](handleEntityNotFound(_0x5ea2e2,null))['then'](respondWithResult(_0x5ea2e2,null))[_0x8fb7('0x1b')](handleError(_0x5ea2e2,null));};exports[_0x8fb7('0x23')]=function(_0x3c7179,_0x416f9f){if(_0x3c7179[_0x8fb7('0x48')]['id']){delete _0x3c7179[_0x8fb7('0x48')]['id'];}return db[_0x8fb7('0x40')][_0x8fb7('0x47')]({'where':{'id':_0x3c7179[_0x8fb7('0x44')]['id']}})[_0x8fb7('0x3d')](handleEntityNotFound(_0x416f9f,null))['then'](saveUpdates(_0x3c7179['body'],null))['then'](respondWithResult(_0x416f9f,null))[_0x8fb7('0x1b')](handleError(_0x416f9f,null));};exports['destroy']=function(_0xb067ce,_0x4aac75){return db[_0x8fb7('0x40')][_0x8fb7('0x47')]({'where':{'id':_0xb067ce[_0x8fb7('0x44')]['id']}})['then'](handleEntityNotFound(_0x4aac75,null))['then'](removeEntity(_0x4aac75,null))[_0x8fb7('0x1b')](handleError(_0x4aac75,null));};exports[_0x8fb7('0x49')]=function(_0xf00ae6,_0x49feb3){return db[_0x8fb7('0x40')][_0x8fb7('0x49')]()['then'](respondWithResult(_0x49feb3,null))[_0x8fb7('0x1b')](handleError(_0x49feb3,null));};exports[_0x8fb7('0x4a')]=function(_0x46b887,_0x54deba){return db[_0x8fb7('0x40')][_0x8fb7('0x4a')](_0x46b887[_0x8fb7('0x48')])[_0x8fb7('0x3d')](function(_0x54f9f4){if(_0x54f9f4){if(_0x54f9f4['direction']===_0x8fb7('0x4b')&&!_0x54f9f4[_0x8fb7('0x4c')]){var _0x40d014,_0x16d152,_0x1bf168;if(_0x46b887[_0x8fb7('0x48')]['to']){_0x16d152=_0x46b887[_0x8fb7('0x48')]['to'][_0x8fb7('0x4d')](',')[0x0];}return db[_0x8fb7('0x4e')][_0x8fb7('0x4f')]({'where':{'id':_0x54f9f4[_0x8fb7('0x50')]},'include':[{'model':db[_0x8fb7('0x51')],'as':'List','include':[{'model':db['CmContact'],'as':_0x8fb7('0x52'),'where':{'email':_0x16d152},'limit':0x1,'order':[[_0x8fb7('0x53'),'DESC']]}]},{'model':db[_0x8fb7('0x54')],'as':_0x8fb7('0x55'),'raw':!![],'include':[{'model':db[_0x8fb7('0x56')],'as':_0x8fb7('0x56'),'raw':!![]}]}]})[_0x8fb7('0x3d')](function(_0x9ca11c){_0x40d014=_0x9ca11c;if(!_0x40d014||!_0x40d014[_0x8fb7('0x55')])return;var _0x3d586e=_0x40d014[_0x8fb7('0x57')]();if(_0x46b887[_0x8fb7('0x48')][_0x8fb7('0x58')]&&_0x46b887[_0x8fb7('0x48')][_0x8fb7('0x58')][_0x8fb7('0x32')]){for(var _0x460601=0x0;_0x460601<_0x46b887[_0x8fb7('0x48')][_0x8fb7('0x58')][_0x8fb7('0x32')];_0x460601+=0x1){_0x46b887['body'][_0x8fb7('0x58')][_0x460601]={'filename':_0x46b887[_0x8fb7('0x48')][_0x8fb7('0x58')][_0x460601][_0x8fb7('0x26')],'path':path[_0x8fb7('0x59')](config[_0x8fb7('0x5a')],'server/files/attachments',_0x46b887[_0x8fb7('0x48')]['attachments'][_0x460601]['basename'])};}}_0x1bf168={'account':_0x3d586e,'message':_0x46b887[_0x8fb7('0x48')]};return;})[_0x8fb7('0x3d')](function(){if(_0x40d014['List']){if(_0x40d014[_0x8fb7('0x5b')][_0x8fb7('0x52')]['length']){return _0x40d014[_0x8fb7('0x5b')]['Contacts'][0x0];}else{return db[_0x8fb7('0x5c')][_0x8fb7('0x4a')](_[_0x8fb7('0xa')](_0x46b887[_0x8fb7('0x48')],{'firstName':_0x46b887[_0x8fb7('0x48')]['to'],'email':_0x46b887[_0x8fb7('0x48')]['to'],'phone':_0x46b887[_0x8fb7('0x48')]['to'],'ListId':_0x40d014[_0x8fb7('0x5d')]}));}}else{throw new Error(_0x8fb7('0x5e'));}})[_0x8fb7('0x3d')](function(){if(_0x1bf168){return respondWithRpcPromise(_0x8fb7('0x5f'),'sendMail',_0x1bf168,client9003)[_0x8fb7('0x3d')](function(_0x15df3a){return _0x54f9f4[_0x8fb7('0x23')]({'read':!![],'messageId':_0x15df3a[_0x8fb7('0x60')],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')});})['catch'](function(_0xa212de){logger[_0x8fb7('0x16')]('%s',JSON['stringify'](_0xa212de));return _0x54f9f4;});}return _0x54f9f4;});}return _0x54f9f4;}})[_0x8fb7('0x3d')](respondWithResult(_0x54deba,0xc9))['catch'](handleError(_0x54deba,null));};exports['accept']=function(_0x50b5b2,_0x50a985){var _0x5b8180={'agent':{},'channel':'mail'};if(_0x50b5b2[_0x8fb7('0x48')]['id']){delete _0x50b5b2[_0x8fb7('0x48')]['id'];}_0x50b5b2[_0x8fb7('0x48')]['read']=!![];_0x50b5b2['body'][_0x8fb7('0x61')]=moment()['format'](_0x8fb7('0x62'));_0x50b5b2[_0x8fb7('0x48')]['UserId']=_0x50b5b2['body'][_0x8fb7('0x63')]||_0x50b5b2['user']['id'];_0x5b8180[_0x8fb7('0x64')]['id']=_0x50b5b2['body']['UserId'];return db[_0x8fb7('0x40')]['find']({'where':{'id':_0x50b5b2[_0x8fb7('0x44')]['id'],'UserId':null}})[_0x8fb7('0x3d')](handleEntityNotFound(_0x50a985,null))[_0x8fb7('0x3d')](saveUpdates(_0x50b5b2[_0x8fb7('0x48')],null))['then'](function(_0x3cab0a){if(_0x3cab0a){_0x5b8180[_0x8fb7('0x18')]=_0x3cab0a[_0x8fb7('0x65')]({'plain':!![]});return db['MailInteraction']['find']({'where':{'id':_0x3cab0a[_0x8fb7('0x66')]}});}return null;})[_0x8fb7('0x3d')](handleEntityNotFound(_0x50a985,null))[_0x8fb7('0x3d')](function(_0x2448ec){if(_0x2448ec){return _0x2448ec[_0x8fb7('0x23')]({'UserId':_0x50b5b2['body'][_0x8fb7('0x63')],'read1stAt':_['isNil'](_0x2448ec[_0x8fb7('0x67')])?moment()['format'](_0x8fb7('0x62')):undefined});}return null;})[_0x8fb7('0x3d')](function(_0x36cdf8){if(_0x36cdf8){_0x5b8180[_0x8fb7('0x68')]=_0x36cdf8[_0x8fb7('0x65')]({'plain':!![]});interaction_log[_0x8fb7('0x19')](_0x8fb7('0x69'),_0x50b5b2[_0x8fb7('0x6a')]['id'],_0x50b5b2[_0x8fb7('0x6a')][_0x8fb7('0x26')],_0x50b5b2[_0x8fb7('0x6a')][_0x8fb7('0x6b')],_0x5b8180[_0x8fb7('0x68')]['id'],_0x50b5b2[_0x8fb7('0x48')]?JSON[_0x8fb7('0x15')](_0x50b5b2[_0x8fb7('0x48')]):_0x8fb7('0x6c'));return respondWithRpcPromise(_0x8fb7('0x6d'),'acceptMessage',_0x5b8180);}return null;})['then'](function(_0x5d1f44){var _0x366c8f='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x5d1f44[_0x8fb7('0x18')][_0x8fb7('0x6e')];return db[_0x8fb7('0x6f')][_0x8fb7('0x2e')](_0x366c8f,{'type':db[_0x8fb7('0x70')][_0x8fb7('0x71')][_0x8fb7('0x72')],'raw':!![]})[_0x8fb7('0x3d')](function(_0x49f2ed){return _0x49f2ed;});})['then'](function(_0x2add52){if(_0x2add52){_0x5b8180['message'][_0x8fb7('0x73')]=_0x2add52[0x0];if(!_0x50b5b2[_0x8fb7('0x48')][_0x8fb7('0x63')])return;return db['User']['find']({'where':{'id':_0x50b5b2[_0x8fb7('0x48')][_0x8fb7('0x63')],'role':_0x8fb7('0x64')},'attributes':['id','name',_0x8fb7('0x74'),_0x8fb7('0x75'),_0x8fb7('0x76')],'raw':!![]});}return null;})[_0x8fb7('0x3d')](function(_0x15e0e6){if(!_0x15e0e6)return null;_0x5b8180['message'][_0x8fb7('0x64')]=_0x15e0e6;return _0x5b8180;})['then'](function(_0x84c5cc){if(_0x84c5cc){if(_0x50b5b2['body']['manual']){_0x5b8180[_0x8fb7('0x18')][_0x8fb7('0x77')]=util[_0x8fb7('0x78')](_0x8fb7('0x79'),_0x50b5b2[_0x8fb7('0x6a')]['name']);_0x5b8180[_0x8fb7('0x18')][_0x8fb7('0x7a')]=_0x5b8180[_0x8fb7('0x7a')];_0x5b8180['message'][_0x8fb7('0x7b')]=_0x5b8180['channel'];_0x5b8180['message'][_0x8fb7('0x7c')]='accept';_0x5b8180[_0x8fb7('0x18')][_0x8fb7('0x48')]=htmlToText[_0x8fb7('0x7d')](_0x5b8180['message'][_0x8fb7('0x48')]);return respondWithRpcPromise('EventManager',_0x8fb7('0x7e'),{'event':_0x8fb7('0x7f'),'message':_0x5b8180[_0x8fb7('0x18')]},client9002)[_0x8fb7('0x3d')](function(){return _0x5b8180;});}return _0x5b8180;}return null;})[_0x8fb7('0x3d')](respondWithResult(_0x50a985,null))[_0x8fb7('0x1b')](handleError(_0x50a985,null));};exports['reject']=function(_0x1eab13,_0x9ff4fd){var _0x3c11e3={'agent':{},'channel':_0x8fb7('0x80')};if(_0x1eab13[_0x8fb7('0x48')]['id']){delete _0x1eab13['body']['id'];}_0x1eab13[_0x8fb7('0x48')][_0x8fb7('0x63')]=_0x1eab13[_0x8fb7('0x48')][_0x8fb7('0x63')]||_0x1eab13[_0x8fb7('0x6a')]['id'];_0x3c11e3[_0x8fb7('0x64')]['id']=_0x1eab13[_0x8fb7('0x48')][_0x8fb7('0x63')];return db[_0x8fb7('0x40')]['find']({'where':{'id':_0x1eab13['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x9ff4fd,null))[_0x8fb7('0x3d')](function(_0x2e643a){if(_0x2e643a){_0x3c11e3[_0x8fb7('0x18')]=_0x2e643a[_0x8fb7('0x65')]({'plain':!![]});return db[_0x8fb7('0x81')][_0x8fb7('0x47')]({'where':{'id':_0x2e643a['MailInteractionId']}});}return null;})[_0x8fb7('0x3d')](handleEntityNotFound(_0x9ff4fd,null))[_0x8fb7('0x3d')](function(_0xc8f550){if(_0xc8f550){_0x3c11e3[_0x8fb7('0x68')]=_0xc8f550[_0x8fb7('0x65')]({'plain':!![]});interaction_log['info'](_0x8fb7('0x82'),_0x1eab13[_0x8fb7('0x6a')]['id'],_0x1eab13[_0x8fb7('0x6a')][_0x8fb7('0x26')],_0x1eab13[_0x8fb7('0x6a')]['role'],_0x3c11e3[_0x8fb7('0x68')]['id'],_0x1eab13[_0x8fb7('0x48')]?JSON[_0x8fb7('0x15')](_0x1eab13['body']):_0x8fb7('0x6c'));return respondWithRpcPromise(_0x8fb7('0x83'),_0x8fb7('0x84'),_0x3c11e3);}return null;})['then'](function(_0x35fa36){var _0x2ac142=_0x8fb7('0x85')+_0x35fa36[_0x8fb7('0x18')][_0x8fb7('0x6e')];return db[_0x8fb7('0x6f')]['query'](_0x2ac142,{'type':db[_0x8fb7('0x70')][_0x8fb7('0x71')][_0x8fb7('0x72')],'raw':!![]})[_0x8fb7('0x3d')](function(_0x5af620){return _0x5af620;});})[_0x8fb7('0x3d')](function(_0x542418){if(_0x542418){_0x3c11e3[_0x8fb7('0x18')][_0x8fb7('0x73')]=_0x542418[0x0];if(!_0x1eab13[_0x8fb7('0x48')][_0x8fb7('0x63')])return;return db[_0x8fb7('0x86')]['find']({'where':{'id':_0x1eab13[_0x8fb7('0x48')][_0x8fb7('0x63')],'role':'agent'},'attributes':['id',_0x8fb7('0x26'),_0x8fb7('0x74'),_0x8fb7('0x75'),_0x8fb7('0x76')],'raw':!![]});}return null;})[_0x8fb7('0x3d')](function(_0x558a66){if(!_0x558a66)return null;_0x3c11e3[_0x8fb7('0x18')][_0x8fb7('0x64')]=_0x558a66;return _0x3c11e3;})['then'](function(_0x2606c6){if(_0x2606c6){_0x2606c6[_0x8fb7('0x18')][_0x8fb7('0x77')]=util[_0x8fb7('0x78')](_0x8fb7('0x79'),_0x1eab13[_0x8fb7('0x6a')]['name']);_0x2606c6['message'][_0x8fb7('0x7a')]=_0x3c11e3[_0x8fb7('0x7a')];_0x2606c6[_0x8fb7('0x18')][_0x8fb7('0x7b')]=_0x3c11e3[_0x8fb7('0x7a')];_0x2606c6[_0x8fb7('0x18')][_0x8fb7('0x7c')]=_0x8fb7('0x87');_0x2606c6[_0x8fb7('0x18')][_0x8fb7('0x48')]=htmlToText[_0x8fb7('0x7d')](_0x3c11e3[_0x8fb7('0x18')][_0x8fb7('0x48')]);respondWithRpcPromise('EventManager','EventManager',{'event':_0x8fb7('0x88'),'message':_0x2606c6[_0x8fb7('0x18')]},client9002);return _0x3c11e3;}return null;})[_0x8fb7('0x3d')](respondWithResult(_0x9ff4fd,null))[_0x8fb7('0x1b')](handleError(_0x9ff4fd,null));};exports[_0x8fb7('0x89')]=function(_0x223f0b,_0x23672d){var _0x3d6fa2=moment()['unix']()['toString']();var _0x571680=path[_0x8fb7('0x59')](config[_0x8fb7('0x5a')],_0x8fb7('0x8a'),'files',_0x8fb7('0x8b'));var _0x589107=path[_0x8fb7('0x59')](config[_0x8fb7('0x5a')],_0x8fb7('0x8a'),_0x8fb7('0x8c'),'attachments');var _0x32904a=util[_0x8fb7('0x78')](_0x8fb7('0x8d'),_0x3d6fa2);return db[_0x8fb7('0x40')][_0x8fb7('0x47')]({'where':{'id':_0x223f0b[_0x8fb7('0x44')]['id']},'attributes':['id',_0x8fb7('0x48'),_0x8fb7('0x8e'),'to','cc',_0x8fb7('0x8f'),_0x8fb7('0x90'),'createdAt'],'include':_0x223f0b[_0x8fb7('0x2e')][_0x8fb7('0x58')]?[{'model':db[_0x8fb7('0x91')],'as':'Attachments'}]:undefined})['then'](handleEntityNotFound(_0x23672d,null))[_0x8fb7('0x3d')](function(_0x2bb095){if(_0x2bb095){var _0x25a6bd=_0x2bb095;var _0x4a1dc9={'from':_0x25a6bd[_0x8fb7('0x8e')],'to':_0x25a6bd['to'],'subject':_0x25a6bd[_0x8fb7('0x90')],'html':htmlEntities[_0x8fb7('0x92')](_0x25a6bd[_0x8fb7('0x48')]),'headers':{'Date':moment(_0x25a6bd[_0x8fb7('0x93')])['format'](_0x8fb7('0x94'))},'attachments':[]};if(_0x2bb095['cc']){_0x4a1dc9[_0x8fb7('0x95')]['Cc']=_0x2bb095['cc'];}if(_0x2bb095[_0x8fb7('0x8f')]){_0x4a1dc9[_0x8fb7('0x95')][_0x8fb7('0x96')]=_0x2bb095['bcc'];}return new BPromise(function(_0x33ea58,_0x300c3){if(_0x2bb095[_0x8fb7('0x97')]){for(var _0x40832e=0x0;_0x40832e<_0x2bb095[_0x8fb7('0x97')][_0x8fb7('0x32')];_0x40832e++){var _0x4b791f=_0x2bb095[_0x8fb7('0x97')][_0x40832e];var _0x3fcae6=path[_0x8fb7('0x59')](_0x589107,_0x4b791f[_0x8fb7('0x98')]);if(fs['existsSync'](_0x3fcae6)){_0x4a1dc9[_0x8fb7('0x58')][_0x8fb7('0x99')]({'name':_0x4b791f[_0x8fb7('0x26')],'contentType':_0x4b791f['type'],'data':fs[_0x8fb7('0x9a')](_0x3fcae6)});}}}emlformat[_0x8fb7('0x9b')](_0x4a1dc9,function(_0x570009,_0x3c360b){if(_0x570009)return _0x300c3(_0x570009);fs[_0x8fb7('0x9c')](path['join'](_0x571680,_0x32904a),_0x3c360b);return _0x33ea58(_0x3c360b);});});}})[_0x8fb7('0x3d')](function(_0x2b9c6c){if(_0x2b9c6c){return _0x23672d['download'](path[_0x8fb7('0x59')](_0x571680,_0x32904a),_0x32904a,function(_0xf7bf77){if(!_0xf7bf77)fs[_0x8fb7('0x9d')](path[_0x8fb7('0x59')](_0x571680,_0x32904a));});}})[_0x8fb7('0x1b')](handleError(_0x23672d,null));};
\ No newline at end of file
+var _0x395a=['MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','MailMessage,\x20%s,\x20%s','message','json','offset','undefined','limit','count','status','set','update','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','MailMessage','includeAll','findAll','rows','catch','show','params','length','include','find','body','describe','create','MailAccount','MailAccountId','CmList','List','Contacts','DESC','MailServerOut','Smtp','CloudProvider','attachments','join','root','basename','CmContact','ListId','List\x20not\x20found','messageId','format','YYYY-MM-DD\x20HH:mm:ss','accept','readAt','UserId','agent','get','MailInteraction','MailInteractionId','isNil','read1stAt','interaction','[MAILMESSAGE: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','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','fromString','EventManager','mail','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','reject','rejectmessage','download','unix','toString','server','files','tmp','message-%s.eml','from','subject','createdAt','Attachment','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','bcc','Bcc','Attachments','existsSync','push','readFileSync','build','writeFileSync','unlinkSync','eml-format','moment','util','path','lodash','ioredis','html-to-text','../../components/parsers/qs','../../config/logger','api','../../config/environment','redis','defaults','./mailMessage.socket','client','http','request','then','info','request\x20sent','debug'];(function(_0x436ee8,_0x65122d){var _0x6e79a9=function(_0x1e3aab){while(--_0x1e3aab){_0x436ee8['push'](_0x436ee8['shift']());}};_0x6e79a9(++_0x65122d);}(_0x395a,0x84));var _0xa395=function(_0x4a0e68,_0x45c08c){_0x4a0e68=_0x4a0e68-0x0;var _0x4fb274=_0x395a[_0x4a0e68];return _0x4fb274;};'use strict';var emlformat=require(_0xa395('0x0'));var moment=require(_0xa395('0x1'));var BPromise=require('bluebird');var util=require(_0xa395('0x2'));var path=require(_0xa395('0x3'));var fs=require('fs');var _=require(_0xa395('0x4'));var Redis=require(_0xa395('0x5'));var htmlToText=require(_0xa395('0x6'));var qs=require(_0xa395('0x7'));var logger=require(_0xa395('0x8'))(_0xa395('0x9'));var interaction_log=require(_0xa395('0x8'))('mail-interactions');var config=require(_0xa395('0xa'));var db=require('../../mysqldb')['db'];config[_0xa395('0xb')]=_[_0xa395('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));var htmlEntities=require('html-entities');require(_0xa395('0xd'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0xa395('0xe')][_0xa395('0xf')]({'port':0x232c});var client9003=jayson[_0xa395('0xe')][_0xa395('0xf')]({'port':0x232b});var client9002=jayson[_0xa395('0xe')][_0xa395('0xf')]({'port':0x232a});function respondWithRpcPromise(_0x3ddd38,_0x2e98be,_0x2dffd9,_0x7c954){return new BPromise(function(_0x3350a0,_0x4ae5d0){var _0x3d72b8=_0x7c954||client;return _0x3d72b8[_0xa395('0x10')](_0x3ddd38,_0x2dffd9)[_0xa395('0x11')](function(_0xee4088){logger[_0xa395('0x12')]('MailMessage,\x20%s,\x20%s',_0x2e98be,_0xa395('0x13'));logger[_0xa395('0x14')](_0xa395('0x15'),_0x2e98be,_0xa395('0x13'),JSON[_0xa395('0x16')](_0xee4088));if(_0xee4088[_0xa395('0x17')]){if(_0xee4088['error']['code']===0x1f4){logger['error'](_0xa395('0x18'),_0x2e98be,_0xee4088[_0xa395('0x17')][_0xa395('0x19')]);return _0x4ae5d0(_0xee4088['error'][_0xa395('0x19')]);}logger[_0xa395('0x17')](_0xa395('0x18'),_0x2e98be,_0xee4088[_0xa395('0x17')][_0xa395('0x19')]);return _0x3350a0(_0xee4088['error'][_0xa395('0x19')]);}else{logger[_0xa395('0x12')](_0xa395('0x18'),_0x2e98be,'request\x20sent');_0x3350a0(_0xee4088['result'][_0xa395('0x19')]);}})['catch'](function(_0x445658){logger[_0xa395('0x17')](_0xa395('0x18'),_0x2e98be,_0x445658);_0x4ae5d0(_0x445658);});});}function respondWithResult(_0x521ffe,_0x909600){_0x909600=_0x909600||0xc8;return function(_0x10a903){if(_0x10a903){return _0x521ffe['status'](_0x909600)[_0xa395('0x1a')](_0x10a903);}};}function respondWithFilteredResult(_0x341a0b,_0x58245b){return function(_0x5a65ff){if(_0x5a65ff){var _0x36cc04=typeof _0x58245b[_0xa395('0x1b')]===_0xa395('0x1c')&&typeof _0x58245b[_0xa395('0x1d')]==='undefined';var _0x28f5aa=_0x5a65ff['count'];var _0x5f4ee7=_0x36cc04?0x0:_0x58245b['offset'];var _0x5b9672=_0x36cc04?_0x5a65ff[_0xa395('0x1e')]:_0x58245b[_0xa395('0x1b')]+_0x58245b[_0xa395('0x1d')];var _0x4db8fa;if(_0x5b9672>=_0x28f5aa){_0x5b9672=_0x28f5aa;_0x4db8fa=0xc8;}else{_0x4db8fa=0xce;}_0x341a0b[_0xa395('0x1f')](_0x4db8fa);return _0x341a0b[_0xa395('0x20')]('Content-Range',_0x5f4ee7+'-'+_0x5b9672+'/'+_0x28f5aa)[_0xa395('0x1a')](_0x5a65ff);}return null;};}function saveUpdates(_0x224397){return function(_0x1b1b8c){if(_0x1b1b8c){return _0x1b1b8c[_0xa395('0x21')](_0x224397)[_0xa395('0x11')](function(_0x400295){return _0x400295;});}return null;};}function removeEntity(_0x42cda3){return function(_0x2ea8d0){if(_0x2ea8d0){return _0x2ea8d0[_0xa395('0x22')]()['then'](function(){_0x42cda3[_0xa395('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4131d6){return function(_0x267ea4){if(!_0x267ea4){_0x4131d6['sendStatus'](0x194);}return _0x267ea4;};}function handleError(_0x197382,_0x690964){_0x690964=_0x690964||0x1f4;return function(_0x2383bb){logger[_0xa395('0x17')](_0x2383bb[_0xa395('0x23')]);if(_0x2383bb[_0xa395('0x24')]){delete _0x2383bb[_0xa395('0x24')];}_0x197382[_0xa395('0x1f')](_0x690964)[_0xa395('0x25')](_0x2383bb);};}exports[_0xa395('0x26')]=function(_0x521a39,_0x2b09ef){var _0x4ad3a5={},_0x120155={},_0xaf704={'count':0x0,'rows':[]};var _0x8521ae=_[_0xa395('0x27')](db['MailMessage'][_0xa395('0x28')],function(_0x371e91){return{'name':_0x371e91[_0xa395('0x29')],'type':_0x371e91[_0xa395('0x2a')]['key']};});_0x120155[_0xa395('0x2b')]=_[_0xa395('0x27')](_0x8521ae,_0xa395('0x24'));_0x120155[_0xa395('0x2c')]=_[_0xa395('0x2d')](_0x521a39[_0xa395('0x2c')]);_0x120155[_0xa395('0x2e')]=_[_0xa395('0x2f')](_0x120155[_0xa395('0x2b')],_0x120155[_0xa395('0x2c')]);_0x4ad3a5[_0xa395('0x30')]=_['intersection'](_0x120155[_0xa395('0x2b')],qs[_0xa395('0x31')](_0x521a39['query'][_0xa395('0x31')]));_0x4ad3a5['attributes']=_0x4ad3a5['attributes']['length']?_0x4ad3a5[_0xa395('0x30')]:_0x120155[_0xa395('0x2b')];if(!_0x521a39[_0xa395('0x2c')]['hasOwnProperty'](_0xa395('0x32'))){_0x4ad3a5[_0xa395('0x1d')]=qs[_0xa395('0x1d')](_0x521a39[_0xa395('0x2c')]['limit']);_0x4ad3a5[_0xa395('0x1b')]=qs['offset'](_0x521a39[_0xa395('0x2c')][_0xa395('0x1b')]);}_0x4ad3a5[_0xa395('0x33')]=qs[_0xa395('0x34')](_0x521a39[_0xa395('0x2c')][_0xa395('0x34')]);_0x4ad3a5[_0xa395('0x35')]=qs['filters'](_[_0xa395('0x36')](_0x521a39['query'],_0x120155[_0xa395('0x2e')]),_0x8521ae);if(_0x521a39[_0xa395('0x2c')][_0xa395('0x37')]){_0x4ad3a5[_0xa395('0x35')]=_[_0xa395('0x38')](_0x4ad3a5[_0xa395('0x35')],{'$or':_[_0xa395('0x27')](_0x8521ae,function(_0x140380){if(_0x140380['type']!==_0xa395('0x39')){var _0x48dfb3={};_0x48dfb3[_0x140380[_0xa395('0x24')]]={'$like':'%'+_0x521a39[_0xa395('0x2c')][_0xa395('0x37')]+'%'};return _0x48dfb3;}})});}_0x4ad3a5=_[_0xa395('0x38')]({},_0x4ad3a5,_0x521a39[_0xa395('0x3a')]);var _0x53d25c={'where':_0x4ad3a5['where']};return db[_0xa395('0x3b')][_0xa395('0x1e')](_0x53d25c)[_0xa395('0x11')](function(_0x5dc0f7){_0xaf704[_0xa395('0x1e')]=_0x5dc0f7;if(_0x521a39[_0xa395('0x2c')][_0xa395('0x3c')]){_0x4ad3a5['include']=[{'all':!![]}];}return db[_0xa395('0x3b')][_0xa395('0x3d')](_0x4ad3a5);})[_0xa395('0x11')](function(_0x1d29e1){_0xaf704[_0xa395('0x3e')]=_0x1d29e1;return _0xaf704;})['then'](respondWithFilteredResult(_0x2b09ef,_0x4ad3a5))[_0xa395('0x3f')](handleError(_0x2b09ef,null));};exports[_0xa395('0x40')]=function(_0x4c4089,_0x587cfb){var _0x457c5c={'raw':!![],'where':{'id':_0x4c4089[_0xa395('0x41')]['id']}},_0x5d06ae={};_0x5d06ae[_0xa395('0x2b')]=_['keys'](db[_0xa395('0x3b')][_0xa395('0x28')]);_0x5d06ae[_0xa395('0x2c')]=_['keys'](_0x4c4089['query']);_0x5d06ae['filters']=_['intersection'](_0x5d06ae[_0xa395('0x2b')],_0x5d06ae[_0xa395('0x2c')]);_0x457c5c['attributes']=_[_0xa395('0x2f')](_0x5d06ae['model'],qs[_0xa395('0x31')](_0x4c4089[_0xa395('0x2c')]['fields']));_0x457c5c['attributes']=_0x457c5c['attributes'][_0xa395('0x42')]?_0x457c5c['attributes']:_0x5d06ae[_0xa395('0x2b')];if(_0x4c4089['query'][_0xa395('0x3c')]){_0x457c5c[_0xa395('0x43')]=[{'all':!![]}];}_0x457c5c=_[_0xa395('0x38')]({},_0x457c5c,_0x4c4089[_0xa395('0x3a')]);return db[_0xa395('0x3b')][_0xa395('0x44')](_0x457c5c)['then'](handleEntityNotFound(_0x587cfb,null))[_0xa395('0x11')](respondWithResult(_0x587cfb,null))[_0xa395('0x3f')](handleError(_0x587cfb,null));};exports['update']=function(_0x1de7fe,_0x45908a){if(_0x1de7fe['body']['id']){delete _0x1de7fe['body']['id'];}return db[_0xa395('0x3b')][_0xa395('0x44')]({'where':{'id':_0x1de7fe[_0xa395('0x41')]['id']}})[_0xa395('0x11')](handleEntityNotFound(_0x45908a,null))[_0xa395('0x11')](saveUpdates(_0x1de7fe[_0xa395('0x45')],null))['then'](respondWithResult(_0x45908a,null))[_0xa395('0x3f')](handleError(_0x45908a,null));};exports[_0xa395('0x22')]=function(_0x52c6ff,_0x3dfe62){return db[_0xa395('0x3b')][_0xa395('0x44')]({'where':{'id':_0x52c6ff[_0xa395('0x41')]['id']}})[_0xa395('0x11')](handleEntityNotFound(_0x3dfe62,null))['then'](removeEntity(_0x3dfe62,null))[_0xa395('0x3f')](handleError(_0x3dfe62,null));};exports[_0xa395('0x46')]=function(_0x54f92a,_0x15bf28){return db[_0xa395('0x3b')][_0xa395('0x46')]()['then'](respondWithResult(_0x15bf28,null))['catch'](handleError(_0x15bf28,null));};exports[_0xa395('0x47')]=function(_0x45fe64,_0x422608){return db[_0xa395('0x3b')][_0xa395('0x47')](_0x45fe64[_0xa395('0x45')])[_0xa395('0x11')](function(_0x333330){if(_0x333330){if(_0x333330['direction']==='out'&&!_0x333330['secret']){var _0x1d83e5,_0x37feb8,_0x104cc6;if(_0x45fe64['body']['to']){_0x37feb8=_0x45fe64[_0xa395('0x45')]['to']['split'](',')[0x0];}return db[_0xa395('0x48')]['findOne']({'where':{'id':_0x333330[_0xa395('0x49')]},'include':[{'model':db[_0xa395('0x4a')],'as':_0xa395('0x4b'),'include':[{'model':db['CmContact'],'as':_0xa395('0x4c'),'where':{'email':_0x37feb8},'limit':0x1,'order':[['updatedAt',_0xa395('0x4d')]]}]},{'model':db[_0xa395('0x4e')],'as':_0xa395('0x4f'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0xa395('0x50'),'raw':!![]}]}]})[_0xa395('0x11')](function(_0x5dbfdd){_0x1d83e5=_0x5dbfdd;if(!_0x1d83e5||!_0x1d83e5[_0xa395('0x4f')])return;var _0x5c68a6=_0x1d83e5['getSmtpOptions']();if(_0x45fe64[_0xa395('0x45')][_0xa395('0x51')]&&_0x45fe64[_0xa395('0x45')][_0xa395('0x51')][_0xa395('0x42')]){for(var _0x18cc20=0x0;_0x18cc20<_0x45fe64['body']['attachments'][_0xa395('0x42')];_0x18cc20+=0x1){_0x45fe64[_0xa395('0x45')][_0xa395('0x51')][_0x18cc20]={'filename':_0x45fe64['body'][_0xa395('0x51')][_0x18cc20][_0xa395('0x24')],'path':path[_0xa395('0x52')](config[_0xa395('0x53')],'server/files/attachments',_0x45fe64[_0xa395('0x45')]['attachments'][_0x18cc20][_0xa395('0x54')])};}}_0x104cc6={'account':_0x5c68a6,'message':_0x45fe64[_0xa395('0x45')]};return;})[_0xa395('0x11')](function(){if(_0x1d83e5[_0xa395('0x4b')]){if(_0x1d83e5[_0xa395('0x4b')][_0xa395('0x4c')][_0xa395('0x42')]){return _0x1d83e5['List'][_0xa395('0x4c')][0x0];}else{return db[_0xa395('0x55')][_0xa395('0x47')](_[_0xa395('0xc')](_0x45fe64[_0xa395('0x45')],{'firstName':_0x45fe64[_0xa395('0x45')]['to'],'email':_0x45fe64['body']['to'],'phone':_0x45fe64['body']['to'],'ListId':_0x1d83e5[_0xa395('0x56')]}));}}else{throw new Error(_0xa395('0x57'));}})[_0xa395('0x11')](function(){if(_0x104cc6){return respondWithRpcPromise('SendMail','sendMail',_0x104cc6,client9003)['then'](function(_0x3b30d1){return _0x333330[_0xa395('0x21')]({'read':!![],'messageId':_0x3b30d1[_0xa395('0x58')],'sentAt':moment()[_0xa395('0x59')](_0xa395('0x5a'))});})['catch'](function(_0x1e141c){logger[_0xa395('0x17')]('%s',JSON[_0xa395('0x16')](_0x1e141c));return _0x333330;});}return _0x333330;});}return _0x333330;}})[_0xa395('0x11')](respondWithResult(_0x422608,0xc9))[_0xa395('0x3f')](handleError(_0x422608,null));};exports[_0xa395('0x5b')]=function(_0x39204d,_0x4adf42){var _0x6b268f={'agent':{},'channel':'mail'};if(_0x39204d[_0xa395('0x45')]['id']){delete _0x39204d[_0xa395('0x45')]['id'];}_0x39204d[_0xa395('0x45')]['read']=!![];_0x39204d[_0xa395('0x45')][_0xa395('0x5c')]=moment()['format'](_0xa395('0x5a'));_0x39204d[_0xa395('0x45')][_0xa395('0x5d')]=_0x39204d[_0xa395('0x45')]['UserId']||_0x39204d['user']['id'];_0x6b268f[_0xa395('0x5e')]['id']=_0x39204d[_0xa395('0x45')][_0xa395('0x5d')];return db[_0xa395('0x3b')][_0xa395('0x44')]({'where':{'id':_0x39204d[_0xa395('0x41')]['id'],'UserId':null}})[_0xa395('0x11')](handleEntityNotFound(_0x4adf42,null))[_0xa395('0x11')](saveUpdates(_0x39204d[_0xa395('0x45')],null))[_0xa395('0x11')](function(_0x4fdbe7){if(_0x4fdbe7){_0x6b268f['message']=_0x4fdbe7[_0xa395('0x5f')]({'plain':!![]});return db[_0xa395('0x60')][_0xa395('0x44')]({'where':{'id':_0x4fdbe7[_0xa395('0x61')]}});}return null;})[_0xa395('0x11')](handleEntityNotFound(_0x4adf42,null))[_0xa395('0x11')](function(_0x1d8769){if(_0x1d8769){return _0x1d8769[_0xa395('0x21')]({'UserId':_0x39204d[_0xa395('0x45')][_0xa395('0x5d')],'read1stAt':_[_0xa395('0x62')](_0x1d8769[_0xa395('0x63')])?moment()['format'](_0xa395('0x5a')):undefined});}return null;})['then'](function(_0x1a98b2){if(_0x1a98b2){_0x6b268f[_0xa395('0x64')]=_0x1a98b2[_0xa395('0x5f')]({'plain':!![]});interaction_log[_0xa395('0x12')](_0xa395('0x65'),_0x39204d[_0xa395('0x66')]['id'],_0x39204d[_0xa395('0x66')][_0xa395('0x24')],_0x39204d['user'][_0xa395('0x67')],_0x6b268f[_0xa395('0x64')]['id'],_0x39204d[_0xa395('0x45')]?JSON[_0xa395('0x16')](_0x39204d[_0xa395('0x45')]):_0xa395('0x68'));return respondWithRpcPromise(_0xa395('0x69'),'acceptMessage',_0x6b268f);}return null;})['then'](function(_0x2b9525){var _0x27ef08=_0xa395('0x6a')+_0x2b9525[_0xa395('0x19')][_0xa395('0x6b')];return db[_0xa395('0x6c')][_0xa395('0x2c')](_0x27ef08,{'type':db[_0xa395('0x6d')][_0xa395('0x6e')][_0xa395('0x6f')],'raw':!![]})[_0xa395('0x11')](function(_0x793bf8){return _0x793bf8;});})[_0xa395('0x11')](function(_0x269ad9){if(_0x269ad9){_0x6b268f[_0xa395('0x19')][_0xa395('0x70')]=_0x269ad9[0x0];if(!_0x39204d['body'][_0xa395('0x5d')])return;return db[_0xa395('0x71')][_0xa395('0x44')]({'where':{'id':_0x39204d[_0xa395('0x45')][_0xa395('0x5d')],'role':'agent'},'attributes':['id',_0xa395('0x24'),_0xa395('0x72'),_0xa395('0x73'),_0xa395('0x74')],'raw':!![]});}return null;})['then'](function(_0x562018){if(!_0x562018)return null;_0x6b268f[_0xa395('0x19')][_0xa395('0x5e')]=_0x562018;return _0x6b268f;})[_0xa395('0x11')](function(_0x5a7296){if(_0x5a7296){if(_0x39204d[_0xa395('0x45')][_0xa395('0x75')]){_0x6b268f[_0xa395('0x19')][_0xa395('0x76')]=util['format'](_0xa395('0x77'),_0x39204d[_0xa395('0x66')]['name']);_0x6b268f[_0xa395('0x19')]['channel']=_0x6b268f[_0xa395('0x78')];_0x6b268f['message'][_0xa395('0x79')]=_0x6b268f[_0xa395('0x78')];_0x6b268f[_0xa395('0x19')][_0xa395('0x7a')]=_0xa395('0x5b');_0x6b268f[_0xa395('0x19')][_0xa395('0x45')]=htmlToText[_0xa395('0x7b')](_0x6b268f['message'][_0xa395('0x45')]);return respondWithRpcPromise(_0xa395('0x7c'),_0xa395('0x7c'),{'event':'acceptmessage','message':_0x6b268f['message']},client9002)[_0xa395('0x11')](function(){return _0x6b268f;});}return _0x6b268f;}return null;})[_0xa395('0x11')](respondWithResult(_0x4adf42,null))[_0xa395('0x3f')](handleError(_0x4adf42,null));};exports['reject']=function(_0x5e5b0e,_0x25183e){var _0x364ed8={'agent':{},'channel':_0xa395('0x7d')};if(_0x5e5b0e[_0xa395('0x45')]['id']){delete _0x5e5b0e[_0xa395('0x45')]['id'];}_0x5e5b0e['body'][_0xa395('0x5d')]=_0x5e5b0e[_0xa395('0x45')][_0xa395('0x5d')]||_0x5e5b0e['user']['id'];_0x364ed8[_0xa395('0x5e')]['id']=_0x5e5b0e[_0xa395('0x45')][_0xa395('0x5d')];return db['MailMessage'][_0xa395('0x44')]({'where':{'id':_0x5e5b0e[_0xa395('0x41')]['id'],'UserId':null}})[_0xa395('0x11')](handleEntityNotFound(_0x25183e,null))[_0xa395('0x11')](function(_0x498ea0){if(_0x498ea0){_0x364ed8['message']=_0x498ea0['get']({'plain':!![]});return db['MailInteraction'][_0xa395('0x44')]({'where':{'id':_0x498ea0['MailInteractionId']}});}return null;})[_0xa395('0x11')](handleEntityNotFound(_0x25183e,null))[_0xa395('0x11')](function(_0x2d0faf){if(_0x2d0faf){_0x364ed8[_0xa395('0x64')]=_0x2d0faf[_0xa395('0x5f')]({'plain':!![]});interaction_log[_0xa395('0x12')](_0xa395('0x7e'),_0x5e5b0e[_0xa395('0x66')]['id'],_0x5e5b0e['user'][_0xa395('0x24')],_0x5e5b0e[_0xa395('0x66')][_0xa395('0x67')],_0x364ed8[_0xa395('0x64')]['id'],_0x5e5b0e['body']?JSON[_0xa395('0x16')](_0x5e5b0e[_0xa395('0x45')]):'null');return respondWithRpcPromise(_0xa395('0x7f'),'rejectMessage',_0x364ed8);}return null;})[_0xa395('0x11')](function(_0xd0b316){var _0x39a32f=_0xa395('0x6a')+_0xd0b316[_0xa395('0x19')][_0xa395('0x6b')];return db[_0xa395('0x6c')][_0xa395('0x2c')](_0x39a32f,{'type':db['Sequelize'][_0xa395('0x6e')]['SELECT'],'raw':!![]})[_0xa395('0x11')](function(_0x3a79e9){return _0x3a79e9;});})['then'](function(_0x3ea544){if(_0x3ea544){_0x364ed8[_0xa395('0x19')][_0xa395('0x70')]=_0x3ea544[0x0];if(!_0x5e5b0e[_0xa395('0x45')][_0xa395('0x5d')])return;return db[_0xa395('0x71')]['find']({'where':{'id':_0x5e5b0e['body'][_0xa395('0x5d')],'role':_0xa395('0x5e')},'attributes':['id',_0xa395('0x24'),_0xa395('0x72'),_0xa395('0x73'),_0xa395('0x74')],'raw':!![]});}return null;})['then'](function(_0x114d7d){if(!_0x114d7d)return null;_0x364ed8['message'][_0xa395('0x5e')]=_0x114d7d;return _0x364ed8;})[_0xa395('0x11')](function(_0x1bd098){if(_0x1bd098){_0x1bd098[_0xa395('0x19')][_0xa395('0x76')]=util[_0xa395('0x59')](_0xa395('0x77'),_0x5e5b0e[_0xa395('0x66')][_0xa395('0x24')]);_0x1bd098[_0xa395('0x19')]['channel']=_0x364ed8[_0xa395('0x78')];_0x1bd098[_0xa395('0x19')][_0xa395('0x79')]=_0x364ed8[_0xa395('0x78')];_0x1bd098[_0xa395('0x19')]['event']=_0xa395('0x80');_0x1bd098[_0xa395('0x19')]['body']=htmlToText['fromString'](_0x364ed8[_0xa395('0x19')][_0xa395('0x45')]);respondWithRpcPromise(_0xa395('0x7c'),_0xa395('0x7c'),{'event':_0xa395('0x81'),'message':_0x1bd098[_0xa395('0x19')]},client9002);return _0x364ed8;}return null;})[_0xa395('0x11')](respondWithResult(_0x25183e,null))['catch'](handleError(_0x25183e,null));};exports[_0xa395('0x82')]=function(_0x1e68c6,_0x498bb2){var _0x3d9fa6=moment()[_0xa395('0x83')]()[_0xa395('0x84')]();var _0x56e0e4=path[_0xa395('0x52')](config[_0xa395('0x53')],_0xa395('0x85'),_0xa395('0x86'),_0xa395('0x87'));var _0x366aef=path[_0xa395('0x52')](config[_0xa395('0x53')],_0xa395('0x85'),'files',_0xa395('0x51'));var _0x351c6f=util['format'](_0xa395('0x88'),_0x3d9fa6);return db['MailMessage']['find']({'where':{'id':_0x1e68c6[_0xa395('0x41')]['id']},'attributes':['id',_0xa395('0x45'),_0xa395('0x89'),'to','cc','bcc',_0xa395('0x8a'),_0xa395('0x8b')],'include':_0x1e68c6['query'][_0xa395('0x51')]?[{'model':db[_0xa395('0x8c')],'as':'Attachments'}]:undefined})['then'](handleEntityNotFound(_0x498bb2,null))[_0xa395('0x11')](function(_0x39a7df){if(_0x39a7df){var _0x470d9c=_0x39a7df;var _0x223307={'from':_0x470d9c[_0xa395('0x89')],'to':_0x470d9c['to'],'subject':_0x470d9c[_0xa395('0x8a')],'html':htmlEntities[_0xa395('0x8d')](_0x470d9c[_0xa395('0x45')]),'headers':{'Date':moment(_0x470d9c[_0xa395('0x8b')])[_0xa395('0x59')](_0xa395('0x8e'))},'attachments':[]};if(_0x39a7df['cc']){_0x223307[_0xa395('0x8f')]['Cc']=_0x39a7df['cc'];}if(_0x39a7df[_0xa395('0x90')]){_0x223307[_0xa395('0x8f')][_0xa395('0x91')]=_0x39a7df[_0xa395('0x90')];}return new BPromise(function(_0x4aebb5,_0x29f21e){if(_0x39a7df['Attachments']){for(var _0x4538e6=0x0;_0x4538e6<_0x39a7df['Attachments'][_0xa395('0x42')];_0x4538e6++){var _0x34d3d0=_0x39a7df[_0xa395('0x92')][_0x4538e6];var _0x273387=path[_0xa395('0x52')](_0x366aef,_0x34d3d0['basename']);if(fs[_0xa395('0x93')](_0x273387)){_0x223307[_0xa395('0x51')][_0xa395('0x94')]({'name':_0x34d3d0[_0xa395('0x24')],'contentType':_0x34d3d0['type'],'data':fs[_0xa395('0x95')](_0x273387)});}}}emlformat[_0xa395('0x96')](_0x223307,function(_0x4b9697,_0x29a143){if(_0x4b9697)return _0x29f21e(_0x4b9697);fs[_0xa395('0x97')](path[_0xa395('0x52')](_0x56e0e4,_0x351c6f),_0x29a143);return _0x4aebb5(_0x29a143);});});}})['then'](function(_0x389f46){if(_0x389f46){return _0x498bb2[_0xa395('0x82')](path['join'](_0x56e0e4,_0x351c6f),_0x351c6f,function(_0x1e125e){if(!_0x1e125e)fs[_0xa395('0x98')](path[_0xa395('0x52')](_0x56e0e4,_0x351c6f));});}})[_0xa395('0x3f')](handleError(_0x498bb2,null));};
\ No newline at end of file
index f893d19..ced21a8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8142=['update','remove','emit','hasOwnProperty','exports','events','setMaxListeners','save'];(function(_0x599609,_0x1c598e){var _0x3d40fa=function(_0x27be1c){while(--_0x27be1c){_0x599609['push'](_0x599609['shift']());}};_0x3d40fa(++_0x1c598e);}(_0x8142,0x145));var _0x2814=function(_0x2a0350,_0x249319){_0x2a0350=_0x2a0350-0x0;var _0x425220=_0x8142[_0x2a0350];return _0x425220;};'use strict';var EventEmitter=require(_0x2814('0x0'));var MailMessage=require('../../mysqldb')['db']['MailMessage'];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x2814('0x1')](0x0);var events={'afterCreate':_0x2814('0x2'),'afterUpdate':_0x2814('0x3'),'afterDestroy':_0x2814('0x4')};function emitEvent(_0x2dc45){return function(_0x4e6d4c,_0x372dd2,_0x4c919b){MailMessageEvents[_0x2814('0x5')](_0x2dc45+':'+_0x4e6d4c['id'],_0x4e6d4c);MailMessageEvents['emit'](_0x2dc45,_0x4e6d4c);_0x4c919b(null);};}for(var e in events){if(events[_0x2814('0x6')](e)){var event=events[e];MailMessage['hook'](e,emitEvent(event));}}module[_0x2814('0x7')]=MailMessageEvents;
\ No newline at end of file
+var _0xe8d0=['exports','../../mysqldb','setMaxListeners','save','update','emit','hasOwnProperty','hook'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xe8d0,0x1e1));var _0x0e8d=function(_0x2fd0cd,_0x785b12){_0x2fd0cd=_0x2fd0cd-0x0;var _0x34aed7=_0xe8d0[_0x2fd0cd];return _0x34aed7;};'use strict';var EventEmitter=require('events');var MailMessage=require(_0x0e8d('0x0'))['db']['MailMessage'];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x0e8d('0x1')](0x0);var events={'afterCreate':_0x0e8d('0x2'),'afterUpdate':_0x0e8d('0x3'),'afterDestroy':'remove'};function emitEvent(_0xd308a7){return function(_0x3a2a85,_0x2f7ce0,_0x3401cf){MailMessageEvents['emit'](_0xd308a7+':'+_0x3a2a85['id'],_0x3a2a85);MailMessageEvents[_0x0e8d('0x4')](_0xd308a7,_0x3a2a85);_0x3401cf(null);};}for(var e in events){if(events[_0x0e8d('0x5')](e)){var event=events[e];MailMessage[_0x0e8d('0x6')](e,emitEvent(event));}}module[_0x0e8d('0x7')]=MailMessageEvents;
\ No newline at end of file
index 53696f9..f542080 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xceb5=['bluebird','html-to-text','path','rimraf','./mailMessage.attributes','exports','define','MailMessage','mail_messages','messageId','fti_mail_messages','plainBody','subject','FULLTEXT','body','models','direction','toLowerCase','secret','isNil','UserId','findOne','MailInteractionId','update','createdAt','error','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger'];(function(_0x488a13,_0x1983d9){var _0x2c29d4=function(_0x3a063e){while(--_0x3a063e){_0x488a13['push'](_0x488a13['shift']());}};_0x2c29d4(++_0x1983d9);}(_0xceb5,0xd0));var _0x5ceb=function(_0x30b0d8,_0x57470c){_0x30b0d8=_0x30b0d8-0x0;var _0x459c09=_0xceb5[_0x30b0d8];return _0x459c09;};'use strict';var _=require('lodash');var util=require(_0x5ceb('0x0'));var logger=require(_0x5ceb('0x1'))('api');var moment=require('moment');var BPromise=require(_0x5ceb('0x2'));var rp=require('request-promise');var htmlToText=require(_0x5ceb('0x3'));var fs=require('fs');var path=require(_0x5ceb('0x4'));var rimraf=require(_0x5ceb('0x5'));var config=require('../../config/environment');var attributes=require(_0x5ceb('0x6'));module[_0x5ceb('0x7')]=function(_0x3f0c28,_0x50577d){return _0x3f0c28[_0x5ceb('0x8')](_0x5ceb('0x9'),attributes,{'tableName':_0x5ceb('0xa'),'paranoid':![],'indexes':[{'name':_0x5ceb('0xb'),'fields':[_0x5ceb('0xb')]},{'name':_0x5ceb('0xc'),'fields':[_0x5ceb('0xd'),_0x5ceb('0xe')],'type':_0x5ceb('0xf')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0xecde28,_0x1f4921,_0x4756dc){if(_0xecde28[_0x5ceb('0x10')]){_0xecde28['plainBody']=htmlToText['fromString'](_0xecde28[_0x5ceb('0x10')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x4756dc(null,_0x1f4921);},'afterCreate':function(_0x2d9ec8,_0x30bfca,_0x13b6b6){var _0x491cff=_0x3f0c28[_0x5ceb('0x11')];var _0x5a9bbb=_0x2d9ec8['get']({'plain':!![]});if(_0x5a9bbb[_0x5ceb('0x12')][_0x5ceb('0x13')]()==='in'||_0x5a9bbb[_0x5ceb('0x12')][_0x5ceb('0x13')]()==='out'&&!_0x5a9bbb[_0x5ceb('0x14')]&&!_[_0x5ceb('0x15')](_0x5a9bbb[_0x5ceb('0x16')])){_0x491cff['MailInteraction'][_0x5ceb('0x17')]({'where':{'id':_0x5a9bbb[_0x5ceb('0x18')]}})['then'](function(_0x3b9118){if(_0x3b9118){_0x3b9118[_0x5ceb('0x19')]({'lastMsgAt':_0x5a9bbb[_0x5ceb('0x1a')],'lastMsgDirection':_0x5a9bbb['direction']['toLowerCase']()});}})['catch'](function(_0x16b392){console[_0x5ceb('0x1b')](_0x16b392);});}_0x13b6b6();}},'charset':_0x5ceb('0x1c'),'collate':_0x5ceb('0x1d')});};
\ No newline at end of file
+var _0xa233=['bluebird','request-promise','html-to-text','path','../../config/environment','exports','define','mail_messages','messageId','plainBody','subject','body','models','get','direction','toLowerCase','UserId','MailInteraction','then','update','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x3656fa,_0x3d5b57){var _0x346e3a=function(_0x359e37){while(--_0x359e37){_0x3656fa['push'](_0x3656fa['shift']());}};_0x346e3a(++_0x3d5b57);}(_0xa233,0x126));var _0x3a23=function(_0x80cbf8,_0x1e006f){_0x80cbf8=_0x80cbf8-0x0;var _0x5ce7bd=_0xa233[_0x80cbf8];return _0x5ce7bd;};'use strict';var _=require(_0x3a23('0x0'));var util=require(_0x3a23('0x1'));var logger=require(_0x3a23('0x2'))('api');var moment=require('moment');var BPromise=require(_0x3a23('0x3'));var rp=require(_0x3a23('0x4'));var htmlToText=require(_0x3a23('0x5'));var fs=require('fs');var path=require(_0x3a23('0x6'));var rimraf=require('rimraf');var config=require(_0x3a23('0x7'));var attributes=require('./mailMessage.attributes');module[_0x3a23('0x8')]=function(_0x1ebe99,_0x59fb04){return _0x1ebe99[_0x3a23('0x9')]('MailMessage',attributes,{'tableName':_0x3a23('0xa'),'paranoid':![],'indexes':[{'name':_0x3a23('0xb'),'fields':[_0x3a23('0xb')]},{'name':'fti_mail_messages','fields':[_0x3a23('0xc'),_0x3a23('0xd')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x1d3b83,_0xba1a3,_0x3a9ee7){if(_0x1d3b83[_0x3a23('0xe')]){_0x1d3b83[_0x3a23('0xc')]=htmlToText['fromString'](_0x1d3b83[_0x3a23('0xe')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x3a9ee7(null,_0xba1a3);},'afterCreate':function(_0x42fb4b,_0x5deb57,_0x36794b){var _0x13312c=_0x1ebe99[_0x3a23('0xf')];var _0x29e48f=_0x42fb4b[_0x3a23('0x10')]({'plain':!![]});if(_0x29e48f[_0x3a23('0x11')][_0x3a23('0x12')]()==='in'||_0x29e48f[_0x3a23('0x11')]['toLowerCase']()==='out'&&!_0x29e48f['secret']&&!_['isNil'](_0x29e48f[_0x3a23('0x13')])){_0x13312c[_0x3a23('0x14')]['findOne']({'where':{'id':_0x29e48f['MailInteractionId']}})[_0x3a23('0x15')](function(_0x58290b){if(_0x58290b){_0x58290b[_0x3a23('0x16')]({'lastMsgAt':_0x29e48f['createdAt'],'lastMsgDirection':_0x29e48f[_0x3a23('0x11')]['toLowerCase']()});}})[_0x3a23('0x17')](function(_0x4e0f31){console[_0x3a23('0x18')](_0x4e0f31);});}_0x36794b();}},'charset':_0x3a23('0x19'),'collate':_0x3a23('0x1a')});};
\ No newline at end of file
index 20d0c7a..7e9c09a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdd4f=['request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateMailMessage','MailMessage','create','body','options','raw','lodash','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','./mailMessage.socket','register','request','then','info','MailMessage,\x20%s,\x20%s'];(function(_0x2e6dbf,_0x57dd06){var _0x2680e5=function(_0x4018f4){while(--_0x4018f4){_0x2e6dbf['push'](_0x2e6dbf['shift']());}};_0x2680e5(++_0x57dd06);}(_0xdd4f,0x1ce));var _0xfdd4=function(_0x1060af,_0x5f2d56){_0x1060af=_0x1060af-0x0;var _0x267105=_0xdd4f[_0x1060af];return _0x267105;};'use strict';var _=require(_0xfdd4('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xfdd4('0x1'));var fs=require('fs');var Redis=require(_0xfdd4('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xfdd4('0x3'));var logger=require(_0xfdd4('0x4'))(_0xfdd4('0x5'));var config=require('../../config/environment');var jayson=require(_0xfdd4('0x6'));var client=jayson[_0xfdd4('0x7')][_0xfdd4('0x8')]({'port':0x232a});config[_0xfdd4('0x9')]=_[_0xfdd4('0xa')](config['redis'],{'host':_0xfdd4('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfdd4('0x9')]));require(_0xfdd4('0xc'))[_0xfdd4('0xd')](socket);function respondWithRpcPromise(_0x4ee02f,_0x3d06c9,_0x4b4f1d){return new BPromise(function(_0x27a9f3,_0x3ce77a){return client[_0xfdd4('0xe')](_0x4ee02f,_0x4b4f1d)[_0xfdd4('0xf')](function(_0x35e22d){logger[_0xfdd4('0x10')](_0xfdd4('0x11'),_0x3d06c9,_0xfdd4('0x12'));logger[_0xfdd4('0x13')](_0xfdd4('0x14'),_0x3d06c9,_0xfdd4('0x12'),JSON['stringify'](_0x35e22d));if(_0x35e22d[_0xfdd4('0x15')]){if(_0x35e22d[_0xfdd4('0x15')][_0xfdd4('0x16')]===0x1f4){logger['error'](_0xfdd4('0x11'),_0x3d06c9,_0x35e22d['error'][_0xfdd4('0x17')]);return _0x3ce77a(_0x35e22d[_0xfdd4('0x15')][_0xfdd4('0x17')]);}logger[_0xfdd4('0x15')](_0xfdd4('0x11'),_0x3d06c9,_0x35e22d['error']['message']);return _0x27a9f3(_0x35e22d['error'][_0xfdd4('0x17')]);}else{logger[_0xfdd4('0x10')](_0xfdd4('0x11'),_0x3d06c9,_0xfdd4('0x12'));_0x27a9f3(_0x35e22d[_0xfdd4('0x18')][_0xfdd4('0x17')]);}})[_0xfdd4('0x19')](function(_0x2ffd5f){logger[_0xfdd4('0x15')]('MailMessage,\x20%s,\x20%s',_0x3d06c9,_0x2ffd5f);_0x3ce77a(_0x2ffd5f);});});}exports[_0xfdd4('0x1a')]=function(_0x3e8eac){var _0x2dc51c=this;return new Promise(function(_0x36e611,_0x1454f1){return db[_0xfdd4('0x1b')][_0xfdd4('0x1c')](_0x3e8eac[_0xfdd4('0x1d')],{'raw':_0x3e8eac['options']?_0x3e8eac[_0xfdd4('0x1e')][_0xfdd4('0x1f')]===undefined?!![]:![]:!![]})[_0xfdd4('0xf')](function(_0x16e81b){logger[_0xfdd4('0x10')](_0xfdd4('0x1a'),_0x3e8eac);logger[_0xfdd4('0x13')](_0xfdd4('0x1a'),_0x3e8eac,JSON['stringify'](_0x16e81b));_0x36e611(_0x16e81b);})[_0xfdd4('0x19')](function(_0x1112e8){logger[_0xfdd4('0x15')]('CreateMailMessage',_0x1112e8[_0xfdd4('0x17')],_0x3e8eac);_0x1454f1(_0x2dc51c[_0xfdd4('0x15')](0x1f4,_0x1112e8[_0xfdd4('0x17')]));});});};
\ No newline at end of file
+var _0x1775=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./mailMessage.socket','register','request','then','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','MailMessage','create','body','options','raw','CreateMailMessage','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x3747ae,_0x408e61){var _0x339035=function(_0x83be87){while(--_0x83be87){_0x3747ae['push'](_0x3747ae['shift']());}};_0x339035(++_0x408e61);}(_0x1775,0x1db));var _0x5177=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x1775[_0xa464c9];return _0x3d73c4;};'use strict';var _=require('lodash');var util=require(_0x5177('0x0'));var moment=require(_0x5177('0x1'));var BPromise=require(_0x5177('0x2'));var rs=require(_0x5177('0x3'));var fs=require('fs');var Redis=require(_0x5177('0x4'));var db=require(_0x5177('0x5'))['db'];var utils=require(_0x5177('0x6'));var logger=require(_0x5177('0x7'))(_0x5177('0x8'));var config=require(_0x5177('0x9'));var jayson=require(_0x5177('0xa'));var client=jayson[_0x5177('0xb')][_0x5177('0xc')]({'port':0x232a});config[_0x5177('0xd')]=_[_0x5177('0xe')](config[_0x5177('0xd')],{'host':_0x5177('0xf'),'port':0x18eb});var socket=require(_0x5177('0x10'))(new Redis(config[_0x5177('0xd')]));require(_0x5177('0x11'))[_0x5177('0x12')](socket);function respondWithRpcPromise(_0x206035,_0x5bdca9,_0x4ae3d2){return new BPromise(function(_0x13c7f6,_0x1d7116){return client[_0x5177('0x13')](_0x206035,_0x4ae3d2)[_0x5177('0x14')](function(_0x301db2){logger['info'](_0x5177('0x15'),_0x5bdca9,_0x5177('0x16'));logger[_0x5177('0x17')](_0x5177('0x18'),_0x5bdca9,_0x5177('0x16'),JSON[_0x5177('0x19')](_0x301db2));if(_0x301db2[_0x5177('0x1a')]){if(_0x301db2[_0x5177('0x1a')][_0x5177('0x1b')]===0x1f4){logger[_0x5177('0x1a')](_0x5177('0x15'),_0x5bdca9,_0x301db2[_0x5177('0x1a')][_0x5177('0x1c')]);return _0x1d7116(_0x301db2[_0x5177('0x1a')][_0x5177('0x1c')]);}logger[_0x5177('0x1a')](_0x5177('0x15'),_0x5bdca9,_0x301db2[_0x5177('0x1a')][_0x5177('0x1c')]);return _0x13c7f6(_0x301db2['error'][_0x5177('0x1c')]);}else{logger[_0x5177('0x1d')](_0x5177('0x15'),_0x5bdca9,_0x5177('0x16'));_0x13c7f6(_0x301db2['result'][_0x5177('0x1c')]);}})[_0x5177('0x1e')](function(_0x13d5d4){logger['error'](_0x5177('0x15'),_0x5bdca9,_0x13d5d4);_0x1d7116(_0x13d5d4);});});}exports['CreateMailMessage']=function(_0xc2b2b5){var _0xe221b3=this;return new Promise(function(_0x219744,_0x27b732){return db[_0x5177('0x1f')][_0x5177('0x20')](_0xc2b2b5[_0x5177('0x21')],{'raw':_0xc2b2b5[_0x5177('0x22')]?_0xc2b2b5[_0x5177('0x22')][_0x5177('0x23')]===undefined?!![]:![]:!![]})[_0x5177('0x14')](function(_0x3b0c37){logger['info'](_0x5177('0x24'),_0xc2b2b5);logger['debug'](_0x5177('0x24'),_0xc2b2b5,JSON[_0x5177('0x19')](_0x3b0c37));_0x219744(_0x3b0c37);})[_0x5177('0x1e')](function(_0x2d51d0){logger['error'](_0x5177('0x24'),_0x2d51d0['message'],_0xc2b2b5);_0x27b732(_0xe221b3['error'](0x1f4,_0x2d51d0[_0x5177('0x1c')]));});});};
\ No newline at end of file
index 31cafa5..e66f67c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2812=['mailMessage:','./mailMessage.events','save','remove','update','register','length'];(function(_0x42020e,_0x4b92fb){var _0x561551=function(_0xf8216){while(--_0xf8216){_0x42020e['push'](_0x42020e['shift']());}};_0x561551(++_0x4b92fb);}(_0x2812,0xda));var _0x2281=function(_0x1655bb,_0x5a82ae){_0x1655bb=_0x1655bb-0x0;var _0x5e2020=_0x2812[_0x1655bb];return _0x5e2020;};'use strict';var MailMessageEvents=require(_0x2281('0x0'));var events=[_0x2281('0x1'),_0x2281('0x2'),_0x2281('0x3')];function createListener(_0x4430cb,_0x42cd7f){return function(_0x38ec84){_0x42cd7f['emit'](_0x4430cb,_0x38ec84);};}function removeListener(_0x929d18,_0x2029ed){return function(){MailMessageEvents['removeListener'](_0x929d18,_0x2029ed);};}exports[_0x2281('0x4')]=function(_0x2bae98){for(var _0x303557=0x0,_0x725e92=events[_0x2281('0x5')];_0x303557<_0x725e92;_0x303557++){var _0x939293=events[_0x303557];var _0x2d67b5=createListener(_0x2281('0x6')+_0x939293,_0x2bae98);MailMessageEvents['on'](_0x939293,_0x2d67b5);}};
\ No newline at end of file
+var _0x2137=['./mailMessage.events','save','remove','emit'];(function(_0x3cf24a,_0xec10a9){var _0x389355=function(_0x8f4d96){while(--_0x8f4d96){_0x3cf24a['push'](_0x3cf24a['shift']());}};_0x389355(++_0xec10a9);}(_0x2137,0x134));var _0x7213=function(_0xca2c30,_0x2e91b5){_0xca2c30=_0xca2c30-0x0;var _0x13efb=_0x2137[_0xca2c30];return _0x13efb;};'use strict';var MailMessageEvents=require(_0x7213('0x0'));var events=[_0x7213('0x1'),_0x7213('0x2'),'update'];function createListener(_0x4aaabf,_0x200474){return function(_0x55023e){_0x200474[_0x7213('0x3')](_0x4aaabf,_0x55023e);};}function removeListener(_0x421016,_0x15c165){return function(){MailMessageEvents['removeListener'](_0x421016,_0x15c165);};}exports['register']=function(_0x4f36f0){for(var _0x2cf2d6=0x0,_0x3aa8a3=events['length'];_0x2cf2d6<_0x3aa8a3;_0x2cf2d6++){var _0x2cd831=events[_0x2cf2d6];var _0x2ad93f=createListener('mailMessage:'+_0x2cd831,_0x4f36f0);MailMessageEvents['on'](_0x2cd831,_0x2ad93f);}};
\ No newline at end of file
index 6dfba53..5088fc4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x617a=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueue.controller','get','isAuthenticated','index','/describe','show','/:id/members','getMembers','/:id/teams','/:id/users','getAgents','create','post','addTeams','addAgents','put','/:id','update','delete','removeTeams','removeAgents','exports','util','path','connect-timeout'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x617a,0x171));var _0xa617=function(_0x7f20a4,_0x4d7811){_0x7f20a4=_0x7f20a4-0x0;var _0x4d8b7f=_0x617a[_0x7f20a4];return _0x4d8b7f;};'use strict';var multer=require('multer');var util=require(_0xa617('0x0'));var path=require(_0xa617('0x1'));var timeout=require(_0xa617('0x2'));var express=require(_0xa617('0x3'));var router=express[_0xa617('0x4')]();var fs_extra=require(_0xa617('0x5'));var auth=require(_0xa617('0x6'));var interaction=require(_0xa617('0x7'));var config=require(_0xa617('0x8'));var controller=require(_0xa617('0x9'));router[_0xa617('0xa')]('/',auth[_0xa617('0xb')](),controller[_0xa617('0xc')]);router['get'](_0xa617('0xd'),auth[_0xa617('0xb')](),controller['describe']);router[_0xa617('0xa')]('/:id',auth[_0xa617('0xb')](),controller[_0xa617('0xe')]);router[_0xa617('0xa')](_0xa617('0xf'),auth[_0xa617('0xb')](),controller[_0xa617('0x10')]);router[_0xa617('0xa')](_0xa617('0x11'),auth['isAuthenticated'](),controller['getTeams']);router[_0xa617('0xa')](_0xa617('0x12'),auth[_0xa617('0xb')](),controller[_0xa617('0x13')]);router['post']('/',auth[_0xa617('0xb')](),controller[_0xa617('0x14')]);router[_0xa617('0x15')](_0xa617('0x11'),auth['isAuthenticated'](),controller[_0xa617('0x16')]);router[_0xa617('0x15')](_0xa617('0x12'),auth['isAuthenticated'](),controller[_0xa617('0x17')]);router[_0xa617('0x18')](_0xa617('0x19'),auth[_0xa617('0xb')](),controller[_0xa617('0x1a')]);router[_0xa617('0x1b')](_0xa617('0x19'),auth[_0xa617('0xb')](),controller['destroy']);router['delete']('/:id/teams',auth['isAuthenticated'](),controller[_0xa617('0x1c')]);router[_0xa617('0x1b')](_0xa617('0x12'),auth[_0xa617('0xb')](),controller[_0xa617('0x1d')]);module[_0xa617('0x1e')]=router;
\ No newline at end of file
+var _0x6871=['show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueue.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x6871,0xe1));var _0x1687=function(_0x9dbbe,_0x1e6779){_0x9dbbe=_0x9dbbe-0x0;var _0x997d51=_0x6871[_0x9dbbe];return _0x997d51;};'use strict';var multer=require(_0x1687('0x0'));var util=require(_0x1687('0x1'));var path=require('path');var timeout=require(_0x1687('0x2'));var express=require(_0x1687('0x3'));var router=express[_0x1687('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x1687('0x5'));var interaction=require(_0x1687('0x6'));var config=require(_0x1687('0x7'));var controller=require(_0x1687('0x8'));router[_0x1687('0x9')]('/',auth[_0x1687('0xa')](),controller[_0x1687('0xb')]);router[_0x1687('0x9')](_0x1687('0xc'),auth[_0x1687('0xa')](),controller[_0x1687('0xd')]);router['get'](_0x1687('0xe'),auth[_0x1687('0xa')](),controller[_0x1687('0xf')]);router[_0x1687('0x9')](_0x1687('0x10'),auth['isAuthenticated'](),controller['getMembers']);router['get'](_0x1687('0x11'),auth[_0x1687('0xa')](),controller[_0x1687('0x12')]);router[_0x1687('0x9')](_0x1687('0x13'),auth[_0x1687('0xa')](),controller[_0x1687('0x14')]);router[_0x1687('0x15')]('/',auth[_0x1687('0xa')](),controller[_0x1687('0x16')]);router['post'](_0x1687('0x11'),auth[_0x1687('0xa')](),controller[_0x1687('0x17')]);router[_0x1687('0x15')](_0x1687('0x13'),auth[_0x1687('0xa')](),controller[_0x1687('0x18')]);router[_0x1687('0x19')](_0x1687('0xe'),auth[_0x1687('0xa')](),controller[_0x1687('0x1a')]);router[_0x1687('0x1b')](_0x1687('0xe'),auth[_0x1687('0xa')](),controller[_0x1687('0x1c')]);router[_0x1687('0x1b')](_0x1687('0x11'),auth[_0x1687('0xa')](),controller['removeTeams']);router[_0x1687('0x1b')](_0x1687('0x13'),auth[_0x1687('0xa')](),controller['removeAgents']);module[_0x1687('0x1d')]=router;
\ No newline at end of file
index 360a20d..17640ed 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8743=['name','INTEGER','ENUM','rrmemory','exports','STRING'];(function(_0x220c68,_0x10e0f0){var _0x24f07d=function(_0x3b23c0){while(--_0x3b23c0){_0x220c68['push'](_0x220c68['shift']());}};_0x24f07d(++_0x10e0f0);}(_0x8743,0x7c));var _0x3874=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0x8743[_0x2b10c6];return _0x3789d2;};'use strict';var Sequelize=require('sequelize');module[_0x3874('0x0')]={'name':{'type':Sequelize[_0x3874('0x1')],'unique':_0x3874('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x3874('0x1')]},'timeout':{'type':Sequelize[_0x3874('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x3874('0x4')](_0x3874('0x5'),'beepall','roundrobin')}};
\ No newline at end of file
+var _0x2391=['STRING','name','INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize','exports'];(function(_0x1d5382,_0x1546f1){var _0x1dee83=function(_0x31e27a){while(--_0x31e27a){_0x1d5382['push'](_0x1d5382['shift']());}};_0x1dee83(++_0x1546f1);}(_0x2391,0x1a5));var _0x1239=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0x2391[_0xc6be3a];return _0x56a310;};'use strict';var Sequelize=require(_0x1239('0x0'));module[_0x1239('0x1')]={'name':{'type':Sequelize[_0x1239('0x2')],'unique':_0x1239('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x1239('0x2')]},'timeout':{'type':Sequelize[_0x1239('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x1239('0x5')](_0x1239('0x6'),_0x1239('0x7'),_0x1239('0x8'))}};
\ No newline at end of file
index b59ff4f..b866967 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5d31=['mailPause','updatedAt','getTeams','Team','addTeams','ids','online','voicePause','interface','flatMap','Agents','sequelize','transaction','each','findOrCreate','forEach','emit','userMailQueue:save','removeTeams','select','from','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','SELECT','every','TeamId','includes','all','union','value','isEmpty','removeAgents','addAgents','omit','spread','userMailQueue:remove','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','register','sendStatus','end','json','offset','undefined','count','limit','Content-Range','reject','save','update','then','get','UserProfileResource','status','error','stack','name','send','MailQueue','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','params','destroy','describe','getMembers','findOne','UserMailQueue','order','MailQueueId','User','findAndCountAll','agent','createdAt','format','%s/%s','SIP'];(function(_0x413bc9,_0x2fc41b){var _0xba3b5e=function(_0x391540){while(--_0x391540){_0x413bc9['push'](_0x413bc9['shift']());}};_0xba3b5e(++_0x2fc41b);}(_0x5d31,0xb7));var _0x15d3=function(_0xb77dd4,_0x371dd8){_0xb77dd4=_0xb77dd4-0x0;var _0x29db3c=_0x5d31[_0xb77dd4];return _0x29db3c;};'use strict';var emlformat=require(_0x15d3('0x0'));var rimraf=require(_0x15d3('0x1'));var zipdir=require(_0x15d3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x15d3('0x3'));var moment=require(_0x15d3('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x15d3('0x5'));var util=require('util');var path=require('path');var sox=require(_0x15d3('0x6'));var csv=require(_0x15d3('0x7'));var ejs=require(_0x15d3('0x8'));var fs=require('fs');var fs_extra=require(_0x15d3('0x9'));var _=require(_0x15d3('0xa'));var squel=require(_0x15d3('0xb'));var crypto=require('crypto');var jsforce=require(_0x15d3('0xc'));var deskjs=require(_0x15d3('0xd'));var toCsv=require(_0x15d3('0x7'));var querystring=require('querystring');var Papa=require(_0x15d3('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x15d3('0xf'));var as=require(_0x15d3('0x10'));var hardwareService=require(_0x15d3('0x11'));var logger=require(_0x15d3('0x12'))(_0x15d3('0x13'));var utils=require(_0x15d3('0x14'));var config=require(_0x15d3('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x15d3('0x16'))['db'];config[_0x15d3('0x17')]=_[_0x15d3('0x18')](config[_0x15d3('0x17')],{'host':_0x15d3('0x19'),'port':0x18eb});var socket=require(_0x15d3('0x1a'))(new Redis(config['redis']));require(_0x15d3('0x1b'))[_0x15d3('0x1c')](socket);function respondWithStatusCode(_0x466f82,_0x4b2f4a){_0x4b2f4a=_0x4b2f4a||0xcc;return function(_0x4fda77){if(_0x4fda77){return _0x466f82[_0x15d3('0x1d')](_0x4b2f4a);}return _0x466f82['status'](_0x4b2f4a)[_0x15d3('0x1e')]();};}function respondWithResult(_0xcbfd71,_0x382154){_0x382154=_0x382154||0xc8;return function(_0x2f6c32){if(_0x2f6c32){return _0xcbfd71['status'](_0x382154)[_0x15d3('0x1f')](_0x2f6c32);}};}function respondWithFilteredResult(_0x121692,_0x25a67e){return function(_0x42940f){if(_0x42940f){var _0x389bd5=typeof _0x25a67e[_0x15d3('0x20')]===_0x15d3('0x21')&&typeof _0x25a67e['limit']===_0x15d3('0x21');var _0x3225a4=_0x42940f[_0x15d3('0x22')];var _0x482fe7=_0x389bd5?0x0:_0x25a67e['offset'];var _0x1edff1=_0x389bd5?_0x42940f[_0x15d3('0x22')]:_0x25a67e[_0x15d3('0x20')]+_0x25a67e[_0x15d3('0x23')];var _0x148c40;if(_0x1edff1>=_0x3225a4){_0x1edff1=_0x3225a4;_0x148c40=0xc8;}else{_0x148c40=0xce;}_0x121692['status'](_0x148c40);return _0x121692['set'](_0x15d3('0x24'),_0x482fe7+'-'+_0x1edff1+'/'+_0x3225a4)[_0x15d3('0x1f')](_0x42940f);}return null;};}function patchUpdates(_0x28af7b){return function(_0x445192){try{jsonpatch['apply'](_0x445192,_0x28af7b,!![]);}catch(_0x1b7174){return BPromise[_0x15d3('0x25')](_0x1b7174);}return _0x445192[_0x15d3('0x26')]();};}function saveUpdates(_0x5178e1,_0x1e3fd9){return function(_0x333b39){if(_0x333b39){return _0x333b39[_0x15d3('0x27')](_0x5178e1)[_0x15d3('0x28')](function(_0x426932){return _0x426932;});}return null;};}function removeEntity(_0x6baf8c,_0x2a3e77){return function(_0x43351a){if(_0x43351a){return _0x43351a['destroy']()['then'](function(){var _0x4ee291=_0x43351a[_0x15d3('0x29')]({'plain':!![]});var _0x5867fe='MailQueues';return db[_0x15d3('0x2a')]['destroy']({'where':{'type':_0x5867fe,'resourceId':_0x4ee291['id']}})[_0x15d3('0x28')](function(){return _0x43351a;});})[_0x15d3('0x28')](function(){_0x6baf8c[_0x15d3('0x2b')](0xcc)[_0x15d3('0x1e')]();});}};}function handleEntityNotFound(_0x181f56,_0x2f39bb){return function(_0x590646){if(!_0x590646){_0x181f56[_0x15d3('0x1d')](0x194);}return _0x590646;};}function handleError(_0x26329f,_0x5744c3){_0x5744c3=_0x5744c3||0x1f4;return function(_0x15a591){logger[_0x15d3('0x2c')](_0x15a591[_0x15d3('0x2d')]);if(_0x15a591['name']){delete _0x15a591[_0x15d3('0x2e')];}_0x26329f[_0x15d3('0x2b')](_0x5744c3)[_0x15d3('0x2f')](_0x15a591);};}exports['index']=function(_0x2c7856,_0x3841a0){var _0x300569={},_0x295ef1={},_0x4694dd={'count':0x0,'rows':[]};var _0x3afbd6=_['map'](db[_0x15d3('0x30')][_0x15d3('0x31')],function(_0x497800){return{'name':_0x497800[_0x15d3('0x32')],'type':_0x497800[_0x15d3('0x33')][_0x15d3('0x34')]};});_0x295ef1[_0x15d3('0x35')]=_[_0x15d3('0x36')](_0x3afbd6,'name');_0x295ef1[_0x15d3('0x37')]=_[_0x15d3('0x38')](_0x2c7856[_0x15d3('0x37')]);_0x295ef1[_0x15d3('0x39')]=_[_0x15d3('0x3a')](_0x295ef1['model'],_0x295ef1[_0x15d3('0x37')]);_0x300569[_0x15d3('0x3b')]=_[_0x15d3('0x3a')](_0x295ef1[_0x15d3('0x35')],qs[_0x15d3('0x3c')](_0x2c7856[_0x15d3('0x37')]['fields']));_0x300569[_0x15d3('0x3b')]=_0x300569['attributes'][_0x15d3('0x3d')]?_0x300569[_0x15d3('0x3b')]:_0x295ef1[_0x15d3('0x35')];if(!_0x2c7856[_0x15d3('0x37')][_0x15d3('0x3e')](_0x15d3('0x3f'))){_0x300569[_0x15d3('0x23')]=qs[_0x15d3('0x23')](_0x2c7856[_0x15d3('0x37')][_0x15d3('0x23')]);_0x300569['offset']=qs['offset'](_0x2c7856[_0x15d3('0x37')][_0x15d3('0x20')]);}_0x300569['order']=qs[_0x15d3('0x40')](_0x2c7856[_0x15d3('0x37')][_0x15d3('0x40')]);_0x300569[_0x15d3('0x41')]=qs['filters'](_[_0x15d3('0x42')](_0x2c7856[_0x15d3('0x37')],_0x295ef1[_0x15d3('0x39')]),_0x3afbd6);if(_0x2c7856[_0x15d3('0x37')][_0x15d3('0x43')]){_0x300569[_0x15d3('0x41')]=_[_0x15d3('0x44')](_0x300569[_0x15d3('0x41')],{'$or':_['map'](_0x3afbd6,function(_0x2307e0){if(_0x2307e0[_0x15d3('0x33')]!==_0x15d3('0x45')){var _0x2f3a16={};_0x2f3a16[_0x2307e0[_0x15d3('0x2e')]]={'$like':'%'+_0x2c7856['query'][_0x15d3('0x43')]+'%'};return _0x2f3a16;}})});}_0x300569=_[_0x15d3('0x44')]({},_0x300569,_0x2c7856[_0x15d3('0x46')]);var _0x16cea3={'where':_0x300569[_0x15d3('0x41')]};return db['MailQueue'][_0x15d3('0x22')](_0x16cea3)[_0x15d3('0x28')](function(_0x409ebb){_0x4694dd[_0x15d3('0x22')]=_0x409ebb;if(_0x2c7856[_0x15d3('0x37')][_0x15d3('0x47')]){_0x300569[_0x15d3('0x48')]=[{'all':!![]}];}return db['MailQueue'][_0x15d3('0x49')](_0x300569);})[_0x15d3('0x28')](function(_0x2386fa){_0x4694dd[_0x15d3('0x4a')]=_0x2386fa;return _0x4694dd;})[_0x15d3('0x28')](respondWithFilteredResult(_0x3841a0,_0x300569))[_0x15d3('0x4b')](handleError(_0x3841a0,null));};exports['show']=function(_0x4204a0,_0x5a2d23){var _0x2ac0ad={'raw':!![],'where':{'id':_0x4204a0['params']['id']}},_0x56e47a={};_0x56e47a[_0x15d3('0x35')]=_[_0x15d3('0x38')](db[_0x15d3('0x30')]['rawAttributes']);_0x56e47a[_0x15d3('0x37')]=_[_0x15d3('0x38')](_0x4204a0[_0x15d3('0x37')]);_0x56e47a[_0x15d3('0x39')]=_[_0x15d3('0x3a')](_0x56e47a['model'],_0x56e47a[_0x15d3('0x37')]);_0x2ac0ad[_0x15d3('0x3b')]=_[_0x15d3('0x3a')](_0x56e47a[_0x15d3('0x35')],qs[_0x15d3('0x3c')](_0x4204a0['query'][_0x15d3('0x3c')]));_0x2ac0ad[_0x15d3('0x3b')]=_0x2ac0ad[_0x15d3('0x3b')][_0x15d3('0x3d')]?_0x2ac0ad[_0x15d3('0x3b')]:_0x56e47a['model'];if(_0x4204a0[_0x15d3('0x37')][_0x15d3('0x47')]){_0x2ac0ad[_0x15d3('0x48')]=[{'all':!![]}];}_0x2ac0ad=_[_0x15d3('0x44')]({},_0x2ac0ad,_0x4204a0[_0x15d3('0x46')]);return db[_0x15d3('0x30')][_0x15d3('0x4c')](_0x2ac0ad)[_0x15d3('0x28')](handleEntityNotFound(_0x5a2d23,null))[_0x15d3('0x28')](respondWithResult(_0x5a2d23,null))[_0x15d3('0x4b')](handleError(_0x5a2d23,null));};exports[_0x15d3('0x4d')]=function(_0x1d697f,_0x419d16){return db[_0x15d3('0x30')][_0x15d3('0x4d')](_0x1d697f[_0x15d3('0x4e')],{})[_0x15d3('0x28')](function(_0x126c56){var _0x1c8546=_0x1d697f[_0x15d3('0x4f')]['get']({'plain':!![]});if(!_0x1c8546)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1c8546[_0x15d3('0x50')]===_0x15d3('0x4f')){var _0x5bdd0f=_0x126c56[_0x15d3('0x29')]({'plain':!![]});var _0x3042a='MailQueues';return db[_0x15d3('0x51')]['find']({'where':{'name':_0x3042a,'userProfileId':_0x1c8546[_0x15d3('0x52')]},'raw':!![]})[_0x15d3('0x28')](function(_0x4b08f7){if(_0x4b08f7&&_0x4b08f7[_0x15d3('0x53')]===0x0){return db[_0x15d3('0x2a')]['create']({'name':_0x5bdd0f['name'],'resourceId':_0x5bdd0f['id'],'type':_0x4b08f7[_0x15d3('0x2e')],'sectionId':_0x4b08f7['id']},{})[_0x15d3('0x28')](function(){return _0x126c56;});}else{return _0x126c56;}})['catch'](function(_0x2401ce){logger[_0x15d3('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2401ce);throw _0x2401ce;});}return _0x126c56;})[_0x15d3('0x28')](respondWithResult(_0x419d16,0xc9))[_0x15d3('0x4b')](handleError(_0x419d16,null));};exports['update']=function(_0x13af4b,_0x2652e3){if(_0x13af4b[_0x15d3('0x4e')]['id']){delete _0x13af4b[_0x15d3('0x4e')]['id'];}return db[_0x15d3('0x30')]['find']({'where':{'id':_0x13af4b[_0x15d3('0x54')]['id']}})[_0x15d3('0x28')](handleEntityNotFound(_0x2652e3,null))[_0x15d3('0x28')](saveUpdates(_0x13af4b[_0x15d3('0x4e')],null))['then'](respondWithResult(_0x2652e3,null))[_0x15d3('0x4b')](handleError(_0x2652e3,null));};exports[_0x15d3('0x55')]=function(_0x38f543,_0x30e042){return db['MailQueue'][_0x15d3('0x4c')]({'where':{'id':_0x38f543[_0x15d3('0x54')]['id']}})['then'](handleEntityNotFound(_0x30e042,null))[_0x15d3('0x28')](removeEntity(_0x30e042,null))[_0x15d3('0x4b')](handleError(_0x30e042,null));};exports[_0x15d3('0x56')]=function(_0x411066,_0x52c641){return db[_0x15d3('0x30')][_0x15d3('0x56')]()[_0x15d3('0x28')](respondWithResult(_0x52c641,null))[_0x15d3('0x4b')](handleError(_0x52c641,null));};exports[_0x15d3('0x57')]=function(_0x5d8669,_0x104a70,_0x5315f8){var _0x288886={'raw':!![],'where':{}},_0x5852cc={},_0x107a96;return db[_0x15d3('0x30')][_0x15d3('0x58')]({'where':{'id':_0x5d8669[_0x15d3('0x54')]['id']}})[_0x15d3('0x28')](handleEntityNotFound(_0x104a70,null))[_0x15d3('0x28')](function(_0x19b21e){if(_0x19b21e){_0x107a96=_0x19b21e[_0x15d3('0x29')]({'plain':!![]});_0x5852cc[_0x15d3('0x35')]=_[_0x15d3('0x38')](db[_0x15d3('0x59')][_0x15d3('0x31')]);_0x5852cc[_0x15d3('0x37')]=_[_0x15d3('0x38')](_0x5d8669[_0x15d3('0x37')]);_0x5852cc[_0x15d3('0x39')]=_[_0x15d3('0x3a')](_0x5852cc['model'],_0x5852cc[_0x15d3('0x37')]);_0x288886[_0x15d3('0x3b')]=_[_0x15d3('0x3a')](_0x5852cc[_0x15d3('0x35')],qs['fields'](_0x5d8669[_0x15d3('0x37')][_0x15d3('0x3c')]));_0x288886[_0x15d3('0x3b')]=_0x288886[_0x15d3('0x3b')][_0x15d3('0x3d')]?_0x288886['attributes']:_0x5852cc[_0x15d3('0x35')];if(!_0x5d8669[_0x15d3('0x37')][_0x15d3('0x3e')]('nolimit')){_0x288886[_0x15d3('0x23')]=qs[_0x15d3('0x23')](_0x5d8669['query'][_0x15d3('0x23')]);_0x288886[_0x15d3('0x20')]=qs[_0x15d3('0x20')](_0x5d8669[_0x15d3('0x37')][_0x15d3('0x20')]);}_0x288886[_0x15d3('0x5a')]=qs['sort'](_0x5d8669['query'][_0x15d3('0x40')]);_0x288886['where']=qs[_0x15d3('0x39')](_[_0x15d3('0x42')](_0x5d8669[_0x15d3('0x37')],_0x5852cc[_0x15d3('0x39')]));_0x288886[_0x15d3('0x41')][_0x15d3('0x5b')]=_0x19b21e['id'];if(_0x5d8669['query'][_0x15d3('0x43')]){_0x288886[_0x15d3('0x41')]=_['merge'](_0x288886['where'],{'$or':_[_0x15d3('0x36')](_0x288886['attributes'],function(_0x2663c7){var _0x125769={};_0x125769[_0x2663c7]={'$like':'%'+_0x5d8669['query']['filter']+'%'};return _0x125769;})});}_0x288886=_[_0x15d3('0x44')]({},_0x288886,_0x5d8669['options']);return db[_0x15d3('0x59')][_0x15d3('0x49')](_0x288886);}})[_0x15d3('0x28')](function(_0x1aad78){if(_0x1aad78){return db[_0x15d3('0x5c')][_0x15d3('0x5d')]({'where':{'id':_[_0x15d3('0x36')](_0x1aad78,'UserId'),'role':_0x15d3('0x5e')},'attributes':['id',_0x15d3('0x2e'),'mailPause','updatedAt',_0x15d3('0x5f')]});}})[_0x15d3('0x28')](function(_0x8ce278){if(_0x8ce278){return{'count':_0x8ce278['count'],'rows':_[_0x15d3('0x36')](_0x8ce278[_0x15d3('0x4a')],function(_0x4da728){return{'membername':_0x4da728['name'],'UserId':_0x4da728['id'],'queue_name':_0x107a96[_0x15d3('0x2e')],'MailQueueId':_0x107a96['id'],'interface':util[_0x15d3('0x60')](_0x15d3('0x61'),_0x15d3('0x62'),_0x4da728[_0x15d3('0x2e')]),'penalty':0x0,'paused':_0x4da728[_0x15d3('0x63')],'createdAt':_0x4da728[_0x15d3('0x5f')],'updatedAt':_0x4da728[_0x15d3('0x64')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x15d3('0x28')](respondWithFilteredResult(_0x104a70,_0x288886))[_0x15d3('0x4b')](handleError(_0x104a70,null));};exports[_0x15d3('0x65')]=function(_0x1b0c60,_0x3ffdd3,_0x3211a5){var _0x260669={};var _0x48d123={};var _0x420fed;var _0x39d5aa;return db['MailQueue'][_0x15d3('0x58')]({'where':{'id':_0x1b0c60[_0x15d3('0x54')]['id']}})[_0x15d3('0x28')](handleEntityNotFound(_0x3ffdd3,null))[_0x15d3('0x28')](function(_0x280e5e){if(_0x280e5e){_0x420fed=_0x280e5e;_0x48d123[_0x15d3('0x35')]=_['keys'](db[_0x15d3('0x66')]['rawAttributes']);_0x48d123[_0x15d3('0x37')]=_['keys'](_0x1b0c60['query']);_0x48d123[_0x15d3('0x39')]=_[_0x15d3('0x3a')](_0x48d123[_0x15d3('0x35')],_0x48d123['query']);_0x260669[_0x15d3('0x3b')]=_[_0x15d3('0x3a')](_0x48d123['model'],qs[_0x15d3('0x3c')](_0x1b0c60[_0x15d3('0x37')][_0x15d3('0x3c')]));_0x260669['attributes']=_0x260669['attributes']['length']?_0x260669[_0x15d3('0x3b')]:_0x48d123['model'];_0x260669['order']=qs[_0x15d3('0x40')](_0x1b0c60[_0x15d3('0x37')][_0x15d3('0x40')]);_0x260669[_0x15d3('0x41')]=qs[_0x15d3('0x39')](_[_0x15d3('0x42')](_0x1b0c60['query'],_0x48d123[_0x15d3('0x39')]));if(_0x1b0c60[_0x15d3('0x37')][_0x15d3('0x43')]){_0x260669[_0x15d3('0x41')]=_[_0x15d3('0x44')](_0x260669['where'],{'$or':_[_0x15d3('0x36')](_0x260669[_0x15d3('0x3b')],function(_0x4e22d5){var _0x136422={};_0x136422[_0x4e22d5]={'$like':'%'+_0x1b0c60[_0x15d3('0x37')][_0x15d3('0x43')]+'%'};return _0x136422;})});}_0x260669=_[_0x15d3('0x44')]({},_0x260669,_0x1b0c60[_0x15d3('0x46')]);return _0x420fed[_0x15d3('0x65')](_0x260669);}})[_0x15d3('0x28')](function(_0x997c2d){if(_0x997c2d){_0x39d5aa=_0x997c2d[_0x15d3('0x3d')];if(!_0x1b0c60['query'][_0x15d3('0x3e')](_0x15d3('0x3f'))){_0x260669['limit']=qs['limit'](_0x1b0c60['query'][_0x15d3('0x23')]);_0x260669['offset']=qs[_0x15d3('0x20')](_0x1b0c60[_0x15d3('0x37')]['offset']);}return _0x420fed[_0x15d3('0x65')](_0x260669);}})['then'](function(_0x130435){if(_0x130435){return _0x130435?{'count':_0x39d5aa,'rows':_0x130435}:null;}})[_0x15d3('0x28')](respondWithResult(_0x3ffdd3,null))[_0x15d3('0x4b')](handleError(_0x3ffdd3,null));};exports[_0x15d3('0x67')]=function(_0x468514,_0x8cd511,_0x3bfb91){var _0x4fd93a=_0x468514[_0x15d3('0x4e')][_0x15d3('0x68')];return db[_0x15d3('0x66')][_0x15d3('0x49')]({'where':{'id':_0x4fd93a},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0x15d3('0x2e'),_0x15d3('0x69'),_0x15d3('0x6a'),_0x15d3('0x6b')],'raw':!![]}]})['then'](function(_0x100b9c){if(_0x100b9c){var _0x460a95=_[_0x15d3('0x6c')](_0x100b9c,function(_0x490168){var _0x51e505=_0x490168[_0x15d3('0x29')]({'plain':!![]});return _0x51e505[_0x15d3('0x6d')];});return db['MailQueue'][_0x15d3('0x4c')]({'where':{'id':_0x468514[_0x15d3('0x54')]['id']}})['then'](function(_0xfcad0b){return db[_0x15d3('0x6e')][_0x15d3('0x6f')](function(_0xefec5){return _0xfcad0b[_0x15d3('0x67')](_0x4fd93a,{'transaction':_0xefec5})[_0x15d3('0x28')](function(){return BPromise[_0x15d3('0x70')](_0x460a95,function(_0x11d1c9){return db[_0x15d3('0x59')][_0x15d3('0x71')]({'where':{'UserId':_0x11d1c9['id'],'MailQueueId':_0x468514['params']['id']},'transaction':_0xefec5});});})[_0x15d3('0x28')](function(){_0x460a95[_0x15d3('0x72')](function(_0x20142f){socket[_0x15d3('0x73')](_0x15d3('0x74'),{'UserId':_0x20142f['id'],'MailQueueId':_0xfcad0b['id']});});});});});}})[_0x15d3('0x28')](respondWithStatusCode(_0x8cd511,null))['catch'](handleError(_0x8cd511,null));};exports[_0x15d3('0x75')]=function(_0x1a0263,_0x2ae289,_0x3b8b72){return db['Team'][_0x15d3('0x49')]({'where':{'id':_0x1a0263[_0x15d3('0x37')][_0x15d3('0x68')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x15d3('0x6d'),'attributes':['id'],'raw':!![]}]})[_0x15d3('0x28')](handleEntityNotFound(_0x2ae289,null))['then'](function(_0x46e4a){var _0x2f9f3a=_['map'](_0x46e4a,'id');var _0xc13e4b=[];var _0x181401=[];var _0x2a340f=squel[_0x15d3('0x76')]();_0x2a340f['field']('tq.TeamId')[_0x15d3('0x77')]('team_has_mail_queues','tq')['join'](_0x15d3('0x78'),'ut',_0x15d3('0x79'))[_0x15d3('0x41')](_0x15d3('0x7a'),_0x1a0263['params']['id']);for(var _0x59daf4=0x0;_0x59daf4<_0x46e4a[_0x15d3('0x3d')];_0x59daf4+=0x1){let _0x57a520=_0x46e4a[_0x59daf4];for(var _0x21192d=0x0;_0x21192d<_0x57a520[_0x15d3('0x6d')]['length'];_0x21192d+=0x1){let _0x13eabd=_0x57a520[_0x15d3('0x6d')][_0x21192d];var _0x5b952a=_0x2a340f[_0x15d3('0x7b')]();_0x5b952a[_0x15d3('0x41')](_0x15d3('0x7c'),_0x13eabd['id']);_0x181401[_0x15d3('0x7d')](db['sequelize'][_0x15d3('0x37')](_0x5b952a[_0x15d3('0x7e')](),{'type':db[_0x15d3('0x6e')]['QueryTypes'][_0x15d3('0x7f')]})[_0x15d3('0x28')](function(_0x384763){if(_0x384763[_0x15d3('0x3d')]===0x1){return _0x13eabd['id'];}else{var _0x478125=_[_0x15d3('0x80')](_['map'](_0x384763,_0x15d3('0x81')),function(_0xdead0){return _[_0x15d3('0x82')](_0x2f9f3a,_0xdead0);});if(_0x478125){return _0x13eabd['id'];}}}));}}return BPromise[_0x15d3('0x83')](_0x181401)[_0x15d3('0x28')](function(_0x34b395){_0xc13e4b=_(_0xc13e4b)[_0x15d3('0x84')](_0x34b395)['compact']()[_0x15d3('0x85')]();return db[_0x15d3('0x30')]['find']({'where':{'id':_0x1a0263[_0x15d3('0x54')]['id']}})[_0x15d3('0x28')](function(_0x2a3409){return db[_0x15d3('0x6e')][_0x15d3('0x6f')](function(_0x55f762){return _0x2a3409[_0x15d3('0x75')](_0x1a0263[_0x15d3('0x37')][_0x15d3('0x68')],{'transaction':_0x55f762})[_0x15d3('0x28')](function(){if(!_[_0x15d3('0x86')](_0xc13e4b)){return _0x2a3409[_0x15d3('0x87')](_0xc13e4b,{'transaction':_0x55f762});}})[_0x15d3('0x28')](function(){_0xc13e4b[_0x15d3('0x72')](function(_0x15e34f){socket[_0x15d3('0x73')]('userMailQueue:remove',{'UserId':_0x15e34f,'MailQueueId':_0x2a3409['id']});});});});});});})['then'](respondWithStatusCode(_0x2ae289,null))[_0x15d3('0x4b')](handleError(_0x2ae289,null));};exports[_0x15d3('0x88')]=function(_0x30b033,_0x5ce41c,_0xf4abe8){return db[_0x15d3('0x30')][_0x15d3('0x4c')]({'where':{'id':_0x30b033[_0x15d3('0x54')]['id']}})[_0x15d3('0x28')](handleEntityNotFound(_0x5ce41c,null))[_0x15d3('0x28')](function(_0x32b865){if(_0x32b865){return _0x32b865['addAgents'](_0x30b033[_0x15d3('0x4e')][_0x15d3('0x68')],_[_0x15d3('0x89')](_0x30b033[_0x15d3('0x4e')],[_0x15d3('0x68'),'id'])||{})[_0x15d3('0x8a')](function(_0x39ea87){for(var _0x667606=0x0;_0x667606<_0x30b033[_0x15d3('0x4e')]['ids'][_0x15d3('0x3d')];_0x667606+=0x1){socket[_0x15d3('0x73')](_0x15d3('0x74'),{'UserId':Number(_0x30b033[_0x15d3('0x4e')][_0x15d3('0x68')][_0x667606]),'MailQueueId':Number(_0x30b033[_0x15d3('0x54')]['id'])});}return _0x39ea87;});}})[_0x15d3('0x28')](respondWithResult(_0x5ce41c,null))['catch'](handleError(_0x5ce41c,null));};exports[_0x15d3('0x87')]=function(_0xb4bb72,_0x3456b3,_0x2833c0){return db[_0x15d3('0x30')][_0x15d3('0x4c')]({'where':{'id':_0xb4bb72['params']['id']}})[_0x15d3('0x28')](handleEntityNotFound(_0x3456b3,null))['then'](function(_0x219f4d){if(_0x219f4d){return _0x219f4d[_0x15d3('0x87')](_0xb4bb72[_0x15d3('0x37')][_0x15d3('0x68')])[_0x15d3('0x28')](function(){if(_['isArray'](_0xb4bb72[_0x15d3('0x37')][_0x15d3('0x68')])){for(var _0x59c1b7=0x0;_0x59c1b7<_0xb4bb72[_0x15d3('0x37')][_0x15d3('0x68')][_0x15d3('0x3d')];_0x59c1b7+=0x1){socket[_0x15d3('0x73')](_0x15d3('0x8b'),{'UserId':Number(_0xb4bb72['query'][_0x15d3('0x68')][_0x59c1b7]),'MailQueueId':Number(_0xb4bb72[_0x15d3('0x54')]['id'])});}}else{socket[_0x15d3('0x73')](_0x15d3('0x8b'),{'UserId':Number(_0xb4bb72['query'][_0x15d3('0x68')]),'MailQueueId':Number(_0xb4bb72[_0x15d3('0x54')]['id'])});}});}})[_0x15d3('0x28')](respondWithStatusCode(_0x3456b3,null))['catch'](handleError(_0x3456b3,null));};exports['getAgents']=function(_0x27b244,_0x83cb5c,_0x50ffaa){var _0x31ba35={};var _0x15a2b9={};var _0x5b661f;var _0xd37ca3;return db[_0x15d3('0x30')][_0x15d3('0x58')]({'where':{'id':_0x27b244[_0x15d3('0x54')]['id']}})[_0x15d3('0x28')](handleEntityNotFound(_0x83cb5c,null))[_0x15d3('0x28')](function(_0x19ceca){if(_0x19ceca){_0x5b661f=_0x19ceca;_0x15a2b9[_0x15d3('0x35')]=_[_0x15d3('0x38')](db['User']['rawAttributes']);_0x15a2b9[_0x15d3('0x37')]=_[_0x15d3('0x38')](_0x27b244[_0x15d3('0x37')]);_0x15a2b9[_0x15d3('0x39')]=_[_0x15d3('0x3a')](_0x15a2b9[_0x15d3('0x35')],_0x15a2b9['query']);_0x31ba35[_0x15d3('0x3b')]=_['intersection'](_0x15a2b9['model'],qs[_0x15d3('0x3c')](_0x27b244[_0x15d3('0x37')]['fields']));_0x31ba35[_0x15d3('0x3b')]=_0x31ba35[_0x15d3('0x3b')][_0x15d3('0x3d')]?_0x31ba35[_0x15d3('0x3b')]:_0x15a2b9[_0x15d3('0x35')];_0x31ba35[_0x15d3('0x5a')]=qs['sort'](_0x27b244[_0x15d3('0x37')][_0x15d3('0x40')]);_0x31ba35[_0x15d3('0x41')]=qs['filters'](_[_0x15d3('0x42')](_0x27b244[_0x15d3('0x37')],_0x15a2b9['filters']));if(_0x27b244[_0x15d3('0x37')]['filter']){_0x31ba35[_0x15d3('0x41')]=_[_0x15d3('0x44')](_0x31ba35[_0x15d3('0x41')],{'$or':_[_0x15d3('0x36')](_0x31ba35[_0x15d3('0x3b')],function(_0x581b3c){var _0x378694={};_0x378694[_0x581b3c]={'$like':'%'+_0x27b244[_0x15d3('0x37')][_0x15d3('0x43')]+'%'};return _0x378694;})});}_0x31ba35=_[_0x15d3('0x44')]({},_0x31ba35,_0x27b244[_0x15d3('0x46')]);return _0x5b661f[_0x15d3('0x8c')](_0x31ba35);}})[_0x15d3('0x28')](function(_0x343f1c){if(_0x343f1c){_0xd37ca3=_0x343f1c[_0x15d3('0x3d')];if(!_0x27b244[_0x15d3('0x37')][_0x15d3('0x3e')](_0x15d3('0x3f'))){_0x31ba35[_0x15d3('0x23')]=qs['limit'](_0x27b244[_0x15d3('0x37')][_0x15d3('0x23')]);_0x31ba35['offset']=qs['offset'](_0x27b244[_0x15d3('0x37')][_0x15d3('0x20')]);}return _0x5b661f[_0x15d3('0x8c')](_0x31ba35);}})[_0x15d3('0x28')](function(_0x8bf245){if(_0x8bf245){return _0x8bf245?{'count':_0xd37ca3,'rows':_0x8bf245}:null;}})[_0x15d3('0x28')](respondWithResult(_0x83cb5c,null))['catch'](handleError(_0x83cb5c,null));};
\ No newline at end of file
+var _0xfa47=['compact','removeAgents','userMailQueue:remove','addAgents','spread','isArray','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','register','end','status','json','offset','limit','count','set','Content-Range','apply','reject','then','get','MailQueues','UserProfileResource','destroy','error','stack','send','index','map','MailQueue','rawAttributes','fieldName','type','key','model','name','query','keys','intersection','attributes','fields','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','findAll','rows','catch','show','params','length','includeAll','include','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','findOne','UserMailQueue','nolimit','MailQueueId','User','mailPause','createdAt','format','updatedAt','getTeams','Team','ids','online','voicePause','interface','Agents','sequelize','transaction','addTeams','each','forEach','emit','userMailQueue:save','removeTeams','field','tq.TeamId','from','team_has_mail_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','push','QueryTypes','SELECT','every','TeamId','all','union'];(function(_0x48e51c,_0x4accf5){var _0x4b880f=function(_0x4ef20f){while(--_0x4ef20f){_0x48e51c['push'](_0x48e51c['shift']());}};_0x4b880f(++_0x4accf5);}(_0xfa47,0x91));var _0x7fa4=function(_0x4232d8,_0x13fd09){_0x4232d8=_0x4232d8-0x0;var _0x324de2=_0xfa47[_0x4232d8];return _0x324de2;};'use strict';var emlformat=require(_0x7fa4('0x0'));var rimraf=require(_0x7fa4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7fa4('0x2'));var rp=require(_0x7fa4('0x3'));var moment=require(_0x7fa4('0x4'));var BPromise=require(_0x7fa4('0x5'));var Mustache=require('mustache');var util=require(_0x7fa4('0x6'));var path=require(_0x7fa4('0x7'));var sox=require(_0x7fa4('0x8'));var csv=require(_0x7fa4('0x9'));var ejs=require(_0x7fa4('0xa'));var fs=require('fs');var fs_extra=require(_0x7fa4('0xb'));var _=require(_0x7fa4('0xc'));var squel=require(_0x7fa4('0xd'));var crypto=require('crypto');var jsforce=require(_0x7fa4('0xe'));var deskjs=require(_0x7fa4('0xf'));var toCsv=require(_0x7fa4('0x9'));var querystring=require(_0x7fa4('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x7fa4('0x11'));var qs=require(_0x7fa4('0x12'));var as=require(_0x7fa4('0x13'));var hardwareService=require(_0x7fa4('0x14'));var logger=require(_0x7fa4('0x15'))(_0x7fa4('0x16'));var utils=require(_0x7fa4('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x7fa4('0x18'));var db=require(_0x7fa4('0x19'))['db'];config['redis']=_[_0x7fa4('0x1a')](config[_0x7fa4('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0x7fa4('0x1c'))(new Redis(config[_0x7fa4('0x1b')]));require('./mailQueue.socket')[_0x7fa4('0x1d')](socket);function respondWithStatusCode(_0x42fe53,_0x25af16){_0x25af16=_0x25af16||0xcc;return function(_0x432b7d){if(_0x432b7d){return _0x42fe53['sendStatus'](_0x25af16);}return _0x42fe53['status'](_0x25af16)[_0x7fa4('0x1e')]();};}function respondWithResult(_0x420bfa,_0x42c2d7){_0x42c2d7=_0x42c2d7||0xc8;return function(_0x549ee3){if(_0x549ee3){return _0x420bfa[_0x7fa4('0x1f')](_0x42c2d7)[_0x7fa4('0x20')](_0x549ee3);}};}function respondWithFilteredResult(_0x27fab3,_0x3b2d51){return function(_0x2126e6){if(_0x2126e6){var _0x138411=typeof _0x3b2d51[_0x7fa4('0x21')]==='undefined'&&typeof _0x3b2d51[_0x7fa4('0x22')]==='undefined';var _0x35e7d3=_0x2126e6[_0x7fa4('0x23')];var _0x28bf44=_0x138411?0x0:_0x3b2d51[_0x7fa4('0x21')];var _0xdc7f65=_0x138411?_0x2126e6[_0x7fa4('0x23')]:_0x3b2d51[_0x7fa4('0x21')]+_0x3b2d51[_0x7fa4('0x22')];var _0x44916b;if(_0xdc7f65>=_0x35e7d3){_0xdc7f65=_0x35e7d3;_0x44916b=0xc8;}else{_0x44916b=0xce;}_0x27fab3['status'](_0x44916b);return _0x27fab3[_0x7fa4('0x24')](_0x7fa4('0x25'),_0x28bf44+'-'+_0xdc7f65+'/'+_0x35e7d3)[_0x7fa4('0x20')](_0x2126e6);}return null;};}function patchUpdates(_0x8badb6){return function(_0x130b80){try{jsonpatch[_0x7fa4('0x26')](_0x130b80,_0x8badb6,!![]);}catch(_0x708637){return BPromise[_0x7fa4('0x27')](_0x708637);}return _0x130b80['save']();};}function saveUpdates(_0x5cb106,_0x3578ab){return function(_0x37145e){if(_0x37145e){return _0x37145e['update'](_0x5cb106)[_0x7fa4('0x28')](function(_0x1c2f00){return _0x1c2f00;});}return null;};}function removeEntity(_0x26f4d8,_0x399ef2){return function(_0x337509){if(_0x337509){return _0x337509['destroy']()[_0x7fa4('0x28')](function(){var _0x5af76a=_0x337509[_0x7fa4('0x29')]({'plain':!![]});var _0x797f18=_0x7fa4('0x2a');return db[_0x7fa4('0x2b')][_0x7fa4('0x2c')]({'where':{'type':_0x797f18,'resourceId':_0x5af76a['id']}})[_0x7fa4('0x28')](function(){return _0x337509;});})[_0x7fa4('0x28')](function(){_0x26f4d8[_0x7fa4('0x1f')](0xcc)[_0x7fa4('0x1e')]();});}};}function handleEntityNotFound(_0x41e839,_0x11fc0b){return function(_0x19b1ef){if(!_0x19b1ef){_0x41e839['sendStatus'](0x194);}return _0x19b1ef;};}function handleError(_0x5689d1,_0x1d8c12){_0x1d8c12=_0x1d8c12||0x1f4;return function(_0x1d1958){logger[_0x7fa4('0x2d')](_0x1d1958[_0x7fa4('0x2e')]);if(_0x1d1958['name']){delete _0x1d1958['name'];}_0x5689d1[_0x7fa4('0x1f')](_0x1d8c12)[_0x7fa4('0x2f')](_0x1d1958);};}exports[_0x7fa4('0x30')]=function(_0x2c56b4,_0x59e36d){var _0x11ad4d={},_0x1847c0={},_0x1b2828={'count':0x0,'rows':[]};var _0x211d26=_[_0x7fa4('0x31')](db[_0x7fa4('0x32')][_0x7fa4('0x33')],function(_0x30faac){return{'name':_0x30faac[_0x7fa4('0x34')],'type':_0x30faac[_0x7fa4('0x35')][_0x7fa4('0x36')]};});_0x1847c0[_0x7fa4('0x37')]=_['map'](_0x211d26,_0x7fa4('0x38'));_0x1847c0[_0x7fa4('0x39')]=_[_0x7fa4('0x3a')](_0x2c56b4['query']);_0x1847c0['filters']=_[_0x7fa4('0x3b')](_0x1847c0[_0x7fa4('0x37')],_0x1847c0[_0x7fa4('0x39')]);_0x11ad4d[_0x7fa4('0x3c')]=_[_0x7fa4('0x3b')](_0x1847c0[_0x7fa4('0x37')],qs[_0x7fa4('0x3d')](_0x2c56b4[_0x7fa4('0x39')][_0x7fa4('0x3d')]));_0x11ad4d[_0x7fa4('0x3c')]=_0x11ad4d['attributes']['length']?_0x11ad4d[_0x7fa4('0x3c')]:_0x1847c0[_0x7fa4('0x37')];if(!_0x2c56b4['query'][_0x7fa4('0x3e')]('nolimit')){_0x11ad4d[_0x7fa4('0x22')]=qs[_0x7fa4('0x22')](_0x2c56b4['query'][_0x7fa4('0x22')]);_0x11ad4d['offset']=qs[_0x7fa4('0x21')](_0x2c56b4[_0x7fa4('0x39')][_0x7fa4('0x21')]);}_0x11ad4d[_0x7fa4('0x3f')]=qs['sort'](_0x2c56b4[_0x7fa4('0x39')][_0x7fa4('0x40')]);_0x11ad4d[_0x7fa4('0x41')]=qs[_0x7fa4('0x42')](_[_0x7fa4('0x43')](_0x2c56b4['query'],_0x1847c0[_0x7fa4('0x42')]),_0x211d26);if(_0x2c56b4[_0x7fa4('0x39')][_0x7fa4('0x44')]){_0x11ad4d[_0x7fa4('0x41')]=_[_0x7fa4('0x45')](_0x11ad4d[_0x7fa4('0x41')],{'$or':_['map'](_0x211d26,function(_0x1ed5f2){if(_0x1ed5f2[_0x7fa4('0x35')]!==_0x7fa4('0x46')){var _0xc4cb39={};_0xc4cb39[_0x1ed5f2[_0x7fa4('0x38')]]={'$like':'%'+_0x2c56b4['query'][_0x7fa4('0x44')]+'%'};return _0xc4cb39;}})});}_0x11ad4d=_[_0x7fa4('0x45')]({},_0x11ad4d,_0x2c56b4[_0x7fa4('0x47')]);var _0x2cdd4d={'where':_0x11ad4d[_0x7fa4('0x41')]};return db[_0x7fa4('0x32')]['count'](_0x2cdd4d)[_0x7fa4('0x28')](function(_0xbe539c){_0x1b2828['count']=_0xbe539c;if(_0x2c56b4[_0x7fa4('0x39')]['includeAll']){_0x11ad4d['include']=[{'all':!![]}];}return db['MailQueue'][_0x7fa4('0x48')](_0x11ad4d);})[_0x7fa4('0x28')](function(_0x463de7){_0x1b2828[_0x7fa4('0x49')]=_0x463de7;return _0x1b2828;})[_0x7fa4('0x28')](respondWithFilteredResult(_0x59e36d,_0x11ad4d))[_0x7fa4('0x4a')](handleError(_0x59e36d,null));};exports[_0x7fa4('0x4b')]=function(_0x14460b,_0x1db4bc){var _0x3ccc73={'raw':!![],'where':{'id':_0x14460b[_0x7fa4('0x4c')]['id']}},_0x17460e={};_0x17460e['model']=_[_0x7fa4('0x3a')](db[_0x7fa4('0x32')][_0x7fa4('0x33')]);_0x17460e['query']=_[_0x7fa4('0x3a')](_0x14460b[_0x7fa4('0x39')]);_0x17460e[_0x7fa4('0x42')]=_[_0x7fa4('0x3b')](_0x17460e[_0x7fa4('0x37')],_0x17460e['query']);_0x3ccc73['attributes']=_['intersection'](_0x17460e[_0x7fa4('0x37')],qs[_0x7fa4('0x3d')](_0x14460b[_0x7fa4('0x39')][_0x7fa4('0x3d')]));_0x3ccc73['attributes']=_0x3ccc73[_0x7fa4('0x3c')][_0x7fa4('0x4d')]?_0x3ccc73[_0x7fa4('0x3c')]:_0x17460e[_0x7fa4('0x37')];if(_0x14460b['query'][_0x7fa4('0x4e')]){_0x3ccc73[_0x7fa4('0x4f')]=[{'all':!![]}];}_0x3ccc73=_[_0x7fa4('0x45')]({},_0x3ccc73,_0x14460b[_0x7fa4('0x47')]);return db[_0x7fa4('0x32')]['find'](_0x3ccc73)[_0x7fa4('0x28')](handleEntityNotFound(_0x1db4bc,null))[_0x7fa4('0x28')](respondWithResult(_0x1db4bc,null))['catch'](handleError(_0x1db4bc,null));};exports[_0x7fa4('0x50')]=function(_0x3cbef8,_0x3fc3ac){return db['MailQueue'][_0x7fa4('0x50')](_0x3cbef8[_0x7fa4('0x51')],{})['then'](function(_0x5512f9){var _0x189cca=_0x3cbef8[_0x7fa4('0x52')]['get']({'plain':!![]});if(!_0x189cca)throw new Error(_0x7fa4('0x53'));if(_0x189cca['role']===_0x7fa4('0x52')){var _0x5d0e28=_0x5512f9[_0x7fa4('0x29')]({'plain':!![]});var _0x349350=_0x7fa4('0x2a');return db[_0x7fa4('0x54')][_0x7fa4('0x55')]({'where':{'name':_0x349350,'userProfileId':_0x189cca[_0x7fa4('0x56')]},'raw':!![]})[_0x7fa4('0x28')](function(_0x381f6b){if(_0x381f6b&&_0x381f6b[_0x7fa4('0x57')]===0x0){return db[_0x7fa4('0x2b')][_0x7fa4('0x50')]({'name':_0x5d0e28[_0x7fa4('0x38')],'resourceId':_0x5d0e28['id'],'type':_0x381f6b[_0x7fa4('0x38')],'sectionId':_0x381f6b['id']},{})[_0x7fa4('0x28')](function(){return _0x5512f9;});}else{return _0x5512f9;}})[_0x7fa4('0x4a')](function(_0xc7afc3){logger[_0x7fa4('0x2d')](_0x7fa4('0x58'),_0xc7afc3);throw _0xc7afc3;});}return _0x5512f9;})[_0x7fa4('0x28')](respondWithResult(_0x3fc3ac,0xc9))[_0x7fa4('0x4a')](handleError(_0x3fc3ac,null));};exports[_0x7fa4('0x59')]=function(_0x5b5447,_0x168942){if(_0x5b5447['body']['id']){delete _0x5b5447['body']['id'];}return db[_0x7fa4('0x32')][_0x7fa4('0x55')]({'where':{'id':_0x5b5447[_0x7fa4('0x4c')]['id']}})['then'](handleEntityNotFound(_0x168942,null))['then'](saveUpdates(_0x5b5447[_0x7fa4('0x51')],null))[_0x7fa4('0x28')](respondWithResult(_0x168942,null))['catch'](handleError(_0x168942,null));};exports[_0x7fa4('0x2c')]=function(_0x288cb1,_0x3e7ebb){return db['MailQueue']['find']({'where':{'id':_0x288cb1['params']['id']}})[_0x7fa4('0x28')](handleEntityNotFound(_0x3e7ebb,null))[_0x7fa4('0x28')](removeEntity(_0x3e7ebb,null))['catch'](handleError(_0x3e7ebb,null));};exports[_0x7fa4('0x5a')]=function(_0x5a2a2c,_0x194831){return db['MailQueue'][_0x7fa4('0x5a')]()[_0x7fa4('0x28')](respondWithResult(_0x194831,null))[_0x7fa4('0x4a')](handleError(_0x194831,null));};exports['getMembers']=function(_0xa6009d,_0xb30df7,_0x2f18ca){var _0x3aaf21={'raw':!![],'where':{}},_0x18b325={},_0x3580b4;return db[_0x7fa4('0x32')][_0x7fa4('0x5b')]({'where':{'id':_0xa6009d['params']['id']}})[_0x7fa4('0x28')](handleEntityNotFound(_0xb30df7,null))[_0x7fa4('0x28')](function(_0x4154f6){if(_0x4154f6){_0x3580b4=_0x4154f6[_0x7fa4('0x29')]({'plain':!![]});_0x18b325['model']=_[_0x7fa4('0x3a')](db[_0x7fa4('0x5c')]['rawAttributes']);_0x18b325[_0x7fa4('0x39')]=_[_0x7fa4('0x3a')](_0xa6009d[_0x7fa4('0x39')]);_0x18b325['filters']=_[_0x7fa4('0x3b')](_0x18b325[_0x7fa4('0x37')],_0x18b325['query']);_0x3aaf21['attributes']=_[_0x7fa4('0x3b')](_0x18b325[_0x7fa4('0x37')],qs[_0x7fa4('0x3d')](_0xa6009d['query']['fields']));_0x3aaf21['attributes']=_0x3aaf21[_0x7fa4('0x3c')][_0x7fa4('0x4d')]?_0x3aaf21['attributes']:_0x18b325[_0x7fa4('0x37')];if(!_0xa6009d['query'][_0x7fa4('0x3e')](_0x7fa4('0x5d'))){_0x3aaf21[_0x7fa4('0x22')]=qs['limit'](_0xa6009d[_0x7fa4('0x39')][_0x7fa4('0x22')]);_0x3aaf21[_0x7fa4('0x21')]=qs[_0x7fa4('0x21')](_0xa6009d[_0x7fa4('0x39')][_0x7fa4('0x21')]);}_0x3aaf21['order']=qs['sort'](_0xa6009d[_0x7fa4('0x39')][_0x7fa4('0x40')]);_0x3aaf21[_0x7fa4('0x41')]=qs['filters'](_['pick'](_0xa6009d[_0x7fa4('0x39')],_0x18b325[_0x7fa4('0x42')]));_0x3aaf21['where'][_0x7fa4('0x5e')]=_0x4154f6['id'];if(_0xa6009d[_0x7fa4('0x39')][_0x7fa4('0x44')]){_0x3aaf21['where']=_[_0x7fa4('0x45')](_0x3aaf21[_0x7fa4('0x41')],{'$or':_[_0x7fa4('0x31')](_0x3aaf21[_0x7fa4('0x3c')],function(_0x36644d){var _0x1079c7={};_0x1079c7[_0x36644d]={'$like':'%'+_0xa6009d[_0x7fa4('0x39')]['filter']+'%'};return _0x1079c7;})});}_0x3aaf21=_[_0x7fa4('0x45')]({},_0x3aaf21,_0xa6009d[_0x7fa4('0x47')]);return db['UserMailQueue'][_0x7fa4('0x48')](_0x3aaf21);}})[_0x7fa4('0x28')](function(_0x5a0a7d){if(_0x5a0a7d){return db[_0x7fa4('0x5f')]['findAndCountAll']({'where':{'id':_[_0x7fa4('0x31')](_0x5a0a7d,'UserId'),'role':'agent'},'attributes':['id',_0x7fa4('0x38'),_0x7fa4('0x60'),'updatedAt',_0x7fa4('0x61')]});}})[_0x7fa4('0x28')](function(_0x6a0f1){if(_0x6a0f1){return{'count':_0x6a0f1[_0x7fa4('0x23')],'rows':_[_0x7fa4('0x31')](_0x6a0f1['rows'],function(_0x5ae2c3){return{'membername':_0x5ae2c3[_0x7fa4('0x38')],'UserId':_0x5ae2c3['id'],'queue_name':_0x3580b4[_0x7fa4('0x38')],'MailQueueId':_0x3580b4['id'],'interface':util[_0x7fa4('0x62')]('%s/%s','SIP',_0x5ae2c3[_0x7fa4('0x38')]),'penalty':0x0,'paused':_0x5ae2c3[_0x7fa4('0x60')],'createdAt':_0x5ae2c3[_0x7fa4('0x61')],'updatedAt':_0x5ae2c3[_0x7fa4('0x63')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x7fa4('0x28')](respondWithFilteredResult(_0xb30df7,_0x3aaf21))[_0x7fa4('0x4a')](handleError(_0xb30df7,null));};exports[_0x7fa4('0x64')]=function(_0x443a03,_0x406df3,_0xc753a7){var _0x4f1142={};var _0x3f9922={};var _0x38aed7;var _0x20cb0c;return db['MailQueue']['findOne']({'where':{'id':_0x443a03[_0x7fa4('0x4c')]['id']}})['then'](handleEntityNotFound(_0x406df3,null))[_0x7fa4('0x28')](function(_0x3c79f2){if(_0x3c79f2){_0x38aed7=_0x3c79f2;_0x3f9922['model']=_['keys'](db[_0x7fa4('0x65')]['rawAttributes']);_0x3f9922[_0x7fa4('0x39')]=_['keys'](_0x443a03[_0x7fa4('0x39')]);_0x3f9922[_0x7fa4('0x42')]=_[_0x7fa4('0x3b')](_0x3f9922[_0x7fa4('0x37')],_0x3f9922['query']);_0x4f1142[_0x7fa4('0x3c')]=_[_0x7fa4('0x3b')](_0x3f9922['model'],qs[_0x7fa4('0x3d')](_0x443a03['query']['fields']));_0x4f1142[_0x7fa4('0x3c')]=_0x4f1142[_0x7fa4('0x3c')][_0x7fa4('0x4d')]?_0x4f1142['attributes']:_0x3f9922[_0x7fa4('0x37')];_0x4f1142[_0x7fa4('0x3f')]=qs['sort'](_0x443a03[_0x7fa4('0x39')][_0x7fa4('0x40')]);_0x4f1142['where']=qs[_0x7fa4('0x42')](_['pick'](_0x443a03[_0x7fa4('0x39')],_0x3f9922[_0x7fa4('0x42')]));if(_0x443a03[_0x7fa4('0x39')][_0x7fa4('0x44')]){_0x4f1142[_0x7fa4('0x41')]=_[_0x7fa4('0x45')](_0x4f1142[_0x7fa4('0x41')],{'$or':_[_0x7fa4('0x31')](_0x4f1142[_0x7fa4('0x3c')],function(_0x5c2dad){var _0x18fea6={};_0x18fea6[_0x5c2dad]={'$like':'%'+_0x443a03[_0x7fa4('0x39')]['filter']+'%'};return _0x18fea6;})});}_0x4f1142=_['merge']({},_0x4f1142,_0x443a03['options']);return _0x38aed7['getTeams'](_0x4f1142);}})['then'](function(_0x5227d0){if(_0x5227d0){_0x20cb0c=_0x5227d0[_0x7fa4('0x4d')];if(!_0x443a03['query'][_0x7fa4('0x3e')]('nolimit')){_0x4f1142[_0x7fa4('0x22')]=qs['limit'](_0x443a03[_0x7fa4('0x39')][_0x7fa4('0x22')]);_0x4f1142[_0x7fa4('0x21')]=qs[_0x7fa4('0x21')](_0x443a03[_0x7fa4('0x39')][_0x7fa4('0x21')]);}return _0x38aed7[_0x7fa4('0x64')](_0x4f1142);}})[_0x7fa4('0x28')](function(_0x1163be){if(_0x1163be){return _0x1163be?{'count':_0x20cb0c,'rows':_0x1163be}:null;}})[_0x7fa4('0x28')](respondWithResult(_0x406df3,null))['catch'](handleError(_0x406df3,null));};exports['addTeams']=function(_0x59af7a,_0x91281c,_0x21413f){var _0x52ff7b=_0x59af7a[_0x7fa4('0x51')][_0x7fa4('0x66')];return db[_0x7fa4('0x65')][_0x7fa4('0x48')]({'where':{'id':_0x52ff7b},'attributes':['id'],'include':[{'model':db[_0x7fa4('0x5f')],'as':'Agents','attributes':['id','name',_0x7fa4('0x67'),_0x7fa4('0x68'),_0x7fa4('0x69')],'raw':!![]}]})['then'](function(_0x3310ab){if(_0x3310ab){var _0x47f6b5=_['flatMap'](_0x3310ab,function(_0x551ab3){var _0x4f1c2d=_0x551ab3[_0x7fa4('0x29')]({'plain':!![]});return _0x4f1c2d[_0x7fa4('0x6a')];});return db[_0x7fa4('0x32')][_0x7fa4('0x55')]({'where':{'id':_0x59af7a[_0x7fa4('0x4c')]['id']}})['then'](function(_0x1d4f14){return db[_0x7fa4('0x6b')][_0x7fa4('0x6c')](function(_0x185554){return _0x1d4f14[_0x7fa4('0x6d')](_0x52ff7b,{'transaction':_0x185554})[_0x7fa4('0x28')](function(){return BPromise[_0x7fa4('0x6e')](_0x47f6b5,function(_0x286eff){return db[_0x7fa4('0x5c')]['findOrCreate']({'where':{'UserId':_0x286eff['id'],'MailQueueId':_0x59af7a['params']['id']},'transaction':_0x185554});});})[_0x7fa4('0x28')](function(){_0x47f6b5[_0x7fa4('0x6f')](function(_0x1fff31){socket[_0x7fa4('0x70')](_0x7fa4('0x71'),{'UserId':_0x1fff31['id'],'MailQueueId':_0x1d4f14['id']});});});});});}})[_0x7fa4('0x28')](respondWithStatusCode(_0x91281c,null))[_0x7fa4('0x4a')](handleError(_0x91281c,null));};exports[_0x7fa4('0x72')]=function(_0x179e50,_0x40291c,_0x49e78e){return db['Team'][_0x7fa4('0x48')]({'where':{'id':_0x179e50['query'][_0x7fa4('0x66')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x7fa4('0x6a'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x40291c,null))[_0x7fa4('0x28')](function(_0x313725){var _0x2b320a=_[_0x7fa4('0x31')](_0x313725,'id');var _0x1819d2=[];var _0x26e0d9=[];var _0x2964f5=squel['select']();_0x2964f5[_0x7fa4('0x73')](_0x7fa4('0x74'))[_0x7fa4('0x75')](_0x7fa4('0x76'),'tq')[_0x7fa4('0x77')](_0x7fa4('0x78'),'ut',_0x7fa4('0x79'))[_0x7fa4('0x41')](_0x7fa4('0x7a'),_0x179e50[_0x7fa4('0x4c')]['id']);for(var _0x2a4866=0x0;_0x2a4866<_0x313725[_0x7fa4('0x4d')];_0x2a4866+=0x1){let _0x5d26a6=_0x313725[_0x2a4866];for(var _0xe11c42=0x0;_0xe11c42<_0x5d26a6['Agents'][_0x7fa4('0x4d')];_0xe11c42+=0x1){let _0x4b2e17=_0x5d26a6[_0x7fa4('0x6a')][_0xe11c42];var _0xf80837=_0x2964f5[_0x7fa4('0x7b')]();_0xf80837[_0x7fa4('0x41')]('ut.UserId\x20=\x20?',_0x4b2e17['id']);_0x26e0d9[_0x7fa4('0x7c')](db[_0x7fa4('0x6b')]['query'](_0xf80837['toString'](),{'type':db[_0x7fa4('0x6b')][_0x7fa4('0x7d')][_0x7fa4('0x7e')]})[_0x7fa4('0x28')](function(_0x67921a){if(_0x67921a[_0x7fa4('0x4d')]===0x1){return _0x4b2e17['id'];}else{var _0xed57ea=_[_0x7fa4('0x7f')](_[_0x7fa4('0x31')](_0x67921a,_0x7fa4('0x80')),function(_0x59087c){return _['includes'](_0x2b320a,_0x59087c);});if(_0xed57ea){return _0x4b2e17['id'];}}}));}}return BPromise[_0x7fa4('0x81')](_0x26e0d9)[_0x7fa4('0x28')](function(_0x1cc1f8){_0x1819d2=_(_0x1819d2)[_0x7fa4('0x82')](_0x1cc1f8)[_0x7fa4('0x83')]()['value']();return db[_0x7fa4('0x32')]['find']({'where':{'id':_0x179e50[_0x7fa4('0x4c')]['id']}})[_0x7fa4('0x28')](function(_0x28bfee){return db[_0x7fa4('0x6b')][_0x7fa4('0x6c')](function(_0x5593eb){return _0x28bfee['removeTeams'](_0x179e50['query'][_0x7fa4('0x66')],{'transaction':_0x5593eb})[_0x7fa4('0x28')](function(){if(!_['isEmpty'](_0x1819d2)){return _0x28bfee[_0x7fa4('0x84')](_0x1819d2,{'transaction':_0x5593eb});}})[_0x7fa4('0x28')](function(){_0x1819d2[_0x7fa4('0x6f')](function(_0x53e386){socket['emit'](_0x7fa4('0x85'),{'UserId':_0x53e386,'MailQueueId':_0x28bfee['id']});});});});});});})[_0x7fa4('0x28')](respondWithStatusCode(_0x40291c,null))[_0x7fa4('0x4a')](handleError(_0x40291c,null));};exports[_0x7fa4('0x86')]=function(_0x25652c,_0x506e45,_0x5f2eb0){return db[_0x7fa4('0x32')]['find']({'where':{'id':_0x25652c[_0x7fa4('0x4c')]['id']}})[_0x7fa4('0x28')](handleEntityNotFound(_0x506e45,null))[_0x7fa4('0x28')](function(_0x320c41){if(_0x320c41){return _0x320c41[_0x7fa4('0x86')](_0x25652c[_0x7fa4('0x51')]['ids'],_['omit'](_0x25652c[_0x7fa4('0x51')],['ids','id'])||{})[_0x7fa4('0x87')](function(_0x230a75){for(var _0x20fea8=0x0;_0x20fea8<_0x25652c[_0x7fa4('0x51')][_0x7fa4('0x66')][_0x7fa4('0x4d')];_0x20fea8+=0x1){socket['emit']('userMailQueue:save',{'UserId':Number(_0x25652c[_0x7fa4('0x51')]['ids'][_0x20fea8]),'MailQueueId':Number(_0x25652c[_0x7fa4('0x4c')]['id'])});}return _0x230a75;});}})['then'](respondWithResult(_0x506e45,null))[_0x7fa4('0x4a')](handleError(_0x506e45,null));};exports[_0x7fa4('0x84')]=function(_0x5cf3ad,_0x20b3e5,_0x3b2fcb){return db[_0x7fa4('0x32')][_0x7fa4('0x55')]({'where':{'id':_0x5cf3ad[_0x7fa4('0x4c')]['id']}})[_0x7fa4('0x28')](handleEntityNotFound(_0x20b3e5,null))[_0x7fa4('0x28')](function(_0x39b0e6){if(_0x39b0e6){return _0x39b0e6[_0x7fa4('0x84')](_0x5cf3ad[_0x7fa4('0x39')]['ids'])[_0x7fa4('0x28')](function(){if(_[_0x7fa4('0x88')](_0x5cf3ad['query'][_0x7fa4('0x66')])){for(var _0x3f49ae=0x0;_0x3f49ae<_0x5cf3ad[_0x7fa4('0x39')][_0x7fa4('0x66')]['length'];_0x3f49ae+=0x1){socket['emit']('userMailQueue:remove',{'UserId':Number(_0x5cf3ad['query']['ids'][_0x3f49ae]),'MailQueueId':Number(_0x5cf3ad[_0x7fa4('0x4c')]['id'])});}}else{socket['emit'](_0x7fa4('0x85'),{'UserId':Number(_0x5cf3ad['query'][_0x7fa4('0x66')]),'MailQueueId':Number(_0x5cf3ad['params']['id'])});}});}})[_0x7fa4('0x28')](respondWithStatusCode(_0x20b3e5,null))[_0x7fa4('0x4a')](handleError(_0x20b3e5,null));};exports[_0x7fa4('0x89')]=function(_0x76fe63,_0x3e5e35,_0x3b41){var _0x59365d={};var _0x3ef910={};var _0x4ef0fb;var _0x55193a;return db['MailQueue'][_0x7fa4('0x5b')]({'where':{'id':_0x76fe63[_0x7fa4('0x4c')]['id']}})[_0x7fa4('0x28')](handleEntityNotFound(_0x3e5e35,null))[_0x7fa4('0x28')](function(_0x31df9e){if(_0x31df9e){_0x4ef0fb=_0x31df9e;_0x3ef910['model']=_[_0x7fa4('0x3a')](db[_0x7fa4('0x5f')][_0x7fa4('0x33')]);_0x3ef910[_0x7fa4('0x39')]=_[_0x7fa4('0x3a')](_0x76fe63[_0x7fa4('0x39')]);_0x3ef910['filters']=_[_0x7fa4('0x3b')](_0x3ef910[_0x7fa4('0x37')],_0x3ef910[_0x7fa4('0x39')]);_0x59365d['attributes']=_[_0x7fa4('0x3b')](_0x3ef910['model'],qs[_0x7fa4('0x3d')](_0x76fe63[_0x7fa4('0x39')]['fields']));_0x59365d[_0x7fa4('0x3c')]=_0x59365d['attributes']['length']?_0x59365d['attributes']:_0x3ef910[_0x7fa4('0x37')];_0x59365d[_0x7fa4('0x3f')]=qs[_0x7fa4('0x40')](_0x76fe63[_0x7fa4('0x39')][_0x7fa4('0x40')]);_0x59365d[_0x7fa4('0x41')]=qs[_0x7fa4('0x42')](_[_0x7fa4('0x43')](_0x76fe63[_0x7fa4('0x39')],_0x3ef910['filters']));if(_0x76fe63[_0x7fa4('0x39')]['filter']){_0x59365d[_0x7fa4('0x41')]=_[_0x7fa4('0x45')](_0x59365d['where'],{'$or':_[_0x7fa4('0x31')](_0x59365d['attributes'],function(_0x4d3f94){var _0x47cc60={};_0x47cc60[_0x4d3f94]={'$like':'%'+_0x76fe63['query']['filter']+'%'};return _0x47cc60;})});}_0x59365d=_[_0x7fa4('0x45')]({},_0x59365d,_0x76fe63[_0x7fa4('0x47')]);return _0x4ef0fb[_0x7fa4('0x89')](_0x59365d);}})[_0x7fa4('0x28')](function(_0x1d7646){if(_0x1d7646){_0x55193a=_0x1d7646[_0x7fa4('0x4d')];if(!_0x76fe63[_0x7fa4('0x39')][_0x7fa4('0x3e')](_0x7fa4('0x5d'))){_0x59365d[_0x7fa4('0x22')]=qs[_0x7fa4('0x22')](_0x76fe63[_0x7fa4('0x39')][_0x7fa4('0x22')]);_0x59365d[_0x7fa4('0x21')]=qs[_0x7fa4('0x21')](_0x76fe63[_0x7fa4('0x39')]['offset']);}return _0x4ef0fb[_0x7fa4('0x89')](_0x59365d);}})['then'](function(_0x3c7b99){if(_0x3c7b99){return _0x3c7b99?{'count':_0x55193a,'rows':_0x3c7b99}:null;}})[_0x7fa4('0x28')](respondWithResult(_0x3e5e35,null))[_0x7fa4('0x4a')](handleError(_0x3e5e35,null));};
\ No newline at end of file
index d6942ac..aeed911 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x843e=['setMaxListeners','remove','emit','hook','events','../../mysqldb'];(function(_0x529f1c,_0x437ed1){var _0x4d57ab=function(_0x39d479){while(--_0x39d479){_0x529f1c['push'](_0x529f1c['shift']());}};_0x4d57ab(++_0x437ed1);}(_0x843e,0x160));var _0xe843=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x843e[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0xe843('0x0'));var MailQueue=require(_0xe843('0x1'))['db']['MailQueue'];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0xe843('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xe843('0x3')};function emitEvent(_0x195270){return function(_0x6d8a2e,_0x1a30de,_0x17d793){MailQueueEvents[_0xe843('0x4')](_0x195270+':'+_0x6d8a2e['id'],_0x6d8a2e);MailQueueEvents[_0xe843('0x4')](_0x195270,_0x6d8a2e);_0x17d793(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailQueue[_0xe843('0x5')](e,emitEvent(event));}}module['exports']=MailQueueEvents;
\ No newline at end of file
+var _0x78df=['../../mysqldb','MailQueue','save','update','emit'];(function(_0x47b15f,_0x103e93){var _0x55bf25=function(_0x51fe7f){while(--_0x51fe7f){_0x47b15f['push'](_0x47b15f['shift']());}};_0x55bf25(++_0x103e93);}(_0x78df,0x186));var _0xf78d=function(_0x3a4d33,_0x1f00ec){_0x3a4d33=_0x3a4d33-0x0;var _0x278ebe=_0x78df[_0x3a4d33];return _0x278ebe;};'use strict';var EventEmitter=require('events');var MailQueue=require(_0xf78d('0x0'))['db'][_0xf78d('0x1')];var MailQueueEvents=new EventEmitter();MailQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf78d('0x2'),'afterUpdate':_0xf78d('0x3'),'afterDestroy':'remove'};function emitEvent(_0x5b4036){return function(_0x3f0de5,_0x4dd70b,_0x1bbb3b){MailQueueEvents[_0xf78d('0x4')](_0x5b4036+':'+_0x3f0de5['id'],_0x3f0de5);MailQueueEvents[_0xf78d('0x4')](_0x5b4036,_0x3f0de5);_0x1bbb3b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailQueue['hook'](e,emitEvent(event));}}module['exports']=MailQueueEvents;
\ No newline at end of file
index 842f2f8..000a058 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc3f7=['mail_queues','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailQueue.attributes','exports','MailQueue'];(function(_0x138ac4,_0x1decf7){var _0x52b740=function(_0x2684b9){while(--_0x2684b9){_0x138ac4['push'](_0x138ac4['shift']());}};_0x52b740(++_0x1decf7);}(_0xc3f7,0x83));var _0x7c3f=function(_0x4166fe,_0x313c65){_0x4166fe=_0x4166fe-0x0;var _0x14d5bd=_0xc3f7[_0x4166fe];return _0x14d5bd;};'use strict';var _=require(_0x7c3f('0x0'));var util=require('util');var logger=require(_0x7c3f('0x1'))(_0x7c3f('0x2'));var moment=require(_0x7c3f('0x3'));var BPromise=require(_0x7c3f('0x4'));var rp=require(_0x7c3f('0x5'));var fs=require('fs');var path=require(_0x7c3f('0x6'));var rimraf=require(_0x7c3f('0x7'));var config=require(_0x7c3f('0x8'));var attributes=require(_0x7c3f('0x9'));module[_0x7c3f('0xa')]=function(_0x3df822,_0xfd9bf1){return _0x3df822['define'](_0x7c3f('0xb'),attributes,{'tableName':_0x7c3f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2b7c=['moment','request-promise','rimraf','exports','MailQueue','util','../../config/logger','api'];(function(_0xda5128,_0x5c54e0){var _0x16fb58=function(_0x44ad44){while(--_0x44ad44){_0xda5128['push'](_0xda5128['shift']());}};_0x16fb58(++_0x5c54e0);}(_0x2b7c,0xa5));var _0xc2b7=function(_0xebc4e2,_0x140809){_0xebc4e2=_0xebc4e2-0x0;var _0x30ccfd=_0x2b7c[_0xebc4e2];return _0x30ccfd;};'use strict';var _=require('lodash');var util=require(_0xc2b7('0x0'));var logger=require(_0xc2b7('0x1'))(_0xc2b7('0x2'));var moment=require(_0xc2b7('0x3'));var BPromise=require('bluebird');var rp=require(_0xc2b7('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc2b7('0x5'));var config=require('../../config/environment');var attributes=require('./mailQueue.attributes');module[_0xc2b7('0x6')]=function(_0x565a63,_0x44b602){return _0x565a63['define'](_0xc2b7('0x7'),attributes,{'tableName':'mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 4ce539f..1861d72 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xde2c=['include','model','GetMailQueue','catch','ShowMailQueue','find','then','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','./mailQueue.socket','register','info','MailQueue,\x20%s,\x20%s','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','MailQueue','raw','options','where','attributes','limit','map'];(function(_0x19439b,_0xe276f){var _0x54cc8d=function(_0x231f1f){while(--_0x231f1f){_0x19439b['push'](_0x19439b['shift']());}};_0x54cc8d(++_0xe276f);}(_0xde2c,0x7f));var _0xcde2=function(_0xef8146,_0x459c34){_0xef8146=_0xef8146-0x0;var _0x5a6cb0=_0xde2c[_0xef8146];return _0x5a6cb0;};'use strict';var _=require(_0xcde2('0x0'));var util=require(_0xcde2('0x1'));var moment=require(_0xcde2('0x2'));var BPromise=require(_0xcde2('0x3'));var rs=require(_0xcde2('0x4'));var fs=require('fs');var Redis=require(_0xcde2('0x5'));var db=require(_0xcde2('0x6'))['db'];var utils=require(_0xcde2('0x7'));var logger=require('../../config/logger')(_0xcde2('0x8'));var config=require(_0xcde2('0x9'));var jayson=require(_0xcde2('0xa'));var client=jayson[_0xcde2('0xb')][_0xcde2('0xc')]({'port':0x232a});config['redis']=_[_0xcde2('0xd')](config[_0xcde2('0xe')],{'host':_0xcde2('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xcde2('0x10'))[_0xcde2('0x11')](socket);function respondWithRpcPromise(_0x4e9749,_0x181a73,_0x29f7e0){return new BPromise(function(_0x12a287,_0x127358){return client['request'](_0x4e9749,_0x29f7e0)['then'](function(_0x25677f){logger[_0xcde2('0x12')](_0xcde2('0x13'),_0x181a73,_0xcde2('0x14'));logger[_0xcde2('0x15')](_0xcde2('0x16'),_0x181a73,'request\x20sent',JSON[_0xcde2('0x17')](_0x25677f));if(_0x25677f['error']){if(_0x25677f[_0xcde2('0x18')]['code']===0x1f4){logger['error'](_0xcde2('0x13'),_0x181a73,_0x25677f[_0xcde2('0x18')][_0xcde2('0x19')]);return _0x127358(_0x25677f[_0xcde2('0x18')][_0xcde2('0x19')]);}logger['error'](_0xcde2('0x13'),_0x181a73,_0x25677f['error'][_0xcde2('0x19')]);return _0x12a287(_0x25677f[_0xcde2('0x18')][_0xcde2('0x19')]);}else{logger[_0xcde2('0x12')]('MailQueue,\x20%s,\x20%s',_0x181a73,'request\x20sent');_0x12a287(_0x25677f['result'][_0xcde2('0x19')]);}})['catch'](function(_0x285ac7){logger[_0xcde2('0x18')](_0xcde2('0x13'),_0x181a73,_0x285ac7);_0x127358(_0x285ac7);});});}exports['GetMailQueue']=function(_0x3ea61c){var _0x24d76f=this;return new Promise(function(_0x208368,_0x3c1d7e){return db[_0xcde2('0x1a')]['findAll']({'raw':_0x3ea61c['options']?_0x3ea61c['options'][_0xcde2('0x1b')]===undefined?!![]:![]:!![],'where':_0x3ea61c[_0xcde2('0x1c')]?_0x3ea61c[_0xcde2('0x1c')][_0xcde2('0x1d')]||null:null,'attributes':_0x3ea61c[_0xcde2('0x1c')]?_0x3ea61c['options'][_0xcde2('0x1e')]||null:null,'limit':_0x3ea61c['options']?_0x3ea61c[_0xcde2('0x1c')][_0xcde2('0x1f')]||null:null,'include':_0x3ea61c[_0xcde2('0x1c')]?_0x3ea61c['options']['include']?_[_0xcde2('0x20')](_0x3ea61c[_0xcde2('0x1c')][_0xcde2('0x21')],function(_0x217ec9){return{'model':db[_0x217ec9[_0xcde2('0x22')]],'as':_0x217ec9['as'],'attributes':_0x217ec9['attributes'],'include':_0x217ec9[_0xcde2('0x21')]?_[_0xcde2('0x20')](_0x217ec9[_0xcde2('0x21')],function(_0x513965){return{'model':db[_0x513965[_0xcde2('0x22')]],'as':_0x513965['as'],'attributes':_0x513965[_0xcde2('0x1e')],'include':_0x513965[_0xcde2('0x21')]?_[_0xcde2('0x20')](_0x513965[_0xcde2('0x21')],function(_0x5b2b7){return{'model':db[_0x5b2b7[_0xcde2('0x22')]],'as':_0x5b2b7['as'],'attributes':_0x5b2b7[_0xcde2('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3c3c01){logger['info'](_0xcde2('0x23'),_0x3ea61c);logger[_0xcde2('0x15')](_0xcde2('0x23'),_0x3ea61c,JSON['stringify'](_0x3c3c01));_0x208368(_0x3c3c01);})[_0xcde2('0x24')](function(_0x28fedd){logger['error'](_0xcde2('0x23'),_0x28fedd[_0xcde2('0x19')],_0x3ea61c);_0x3c1d7e(_0x24d76f[_0xcde2('0x18')](0x1f4,_0x28fedd[_0xcde2('0x19')]));});});};exports[_0xcde2('0x25')]=function(_0xb689cd){var _0x11b817=this;return new Promise(function(_0x41fdac,_0x5c08f0){return db[_0xcde2('0x1a')][_0xcde2('0x26')]({'raw':_0xb689cd[_0xcde2('0x1c')]?_0xb689cd[_0xcde2('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0xb689cd[_0xcde2('0x1c')]?_0xb689cd[_0xcde2('0x1c')][_0xcde2('0x1d')]||null:null,'attributes':_0xb689cd[_0xcde2('0x1c')]?_0xb689cd['options'][_0xcde2('0x1e')]||null:null,'include':_0xb689cd[_0xcde2('0x1c')]?_0xb689cd[_0xcde2('0x1c')][_0xcde2('0x21')]?_['map'](_0xb689cd[_0xcde2('0x1c')][_0xcde2('0x21')],function(_0xbde4f4){return{'model':db[_0xbde4f4[_0xcde2('0x22')]],'as':_0xbde4f4['as'],'attributes':_0xbde4f4[_0xcde2('0x1e')],'include':_0xbde4f4['include']?_[_0xcde2('0x20')](_0xbde4f4[_0xcde2('0x21')],function(_0x1144eb){return{'model':db[_0x1144eb[_0xcde2('0x22')]],'as':_0x1144eb['as'],'attributes':_0x1144eb['attributes'],'include':_0x1144eb['include']?_[_0xcde2('0x20')](_0x1144eb[_0xcde2('0x21')],function(_0x40e1e2){return{'model':db[_0x40e1e2[_0xcde2('0x22')]],'as':_0x40e1e2['as'],'attributes':_0x40e1e2[_0xcde2('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xcde2('0x27')](function(_0x5f1a87){logger[_0xcde2('0x12')](_0xcde2('0x25'),_0xb689cd);logger['debug'](_0xcde2('0x25'),_0xb689cd,JSON[_0xcde2('0x17')](_0x5f1a87));_0x41fdac(_0x5f1a87);})[_0xcde2('0x24')](function(_0x51a0a6){logger[_0xcde2('0x18')]('ShowMailQueue',_0x51a0a6['message'],_0xb689cd);_0x5c08f0(_0x11b817[_0xcde2('0x18')](0x1f4,_0x51a0a6[_0xcde2('0x19')]));});});};
\ No newline at end of file
+var _0xec2c=['model','map','catch','ShowMailQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','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','result','GetMailQueue','MailQueue','findAll','raw','options','where','attributes','limit','include'];(function(_0x5d331,_0x5ae1a6){var _0x5ead4d=function(_0x2f35e9){while(--_0x2f35e9){_0x5d331['push'](_0x5d331['shift']());}};_0x5ead4d(++_0x5ae1a6);}(_0xec2c,0x191));var _0xcec2=function(_0x15a93a,_0x4822e4){_0x15a93a=_0x15a93a-0x0;var _0x592780=_0xec2c[_0x15a93a];return _0x592780;};'use strict';var _=require(_0xcec2('0x0'));var util=require(_0xcec2('0x1'));var moment=require(_0xcec2('0x2'));var BPromise=require(_0xcec2('0x3'));var rs=require(_0xcec2('0x4'));var fs=require('fs');var Redis=require(_0xcec2('0x5'));var db=require(_0xcec2('0x6'))['db'];var utils=require(_0xcec2('0x7'));var logger=require(_0xcec2('0x8'))(_0xcec2('0x9'));var config=require(_0xcec2('0xa'));var jayson=require(_0xcec2('0xb'));var client=jayson['client'][_0xcec2('0xc')]({'port':0x232a});config[_0xcec2('0xd')]=_['defaults'](config[_0xcec2('0xd')],{'host':_0xcec2('0xe'),'port':0x18eb});var socket=require(_0xcec2('0xf'))(new Redis(config['redis']));require(_0xcec2('0x10'))[_0xcec2('0x11')](socket);function respondWithRpcPromise(_0x17b926,_0xa4aa82,_0x54e657){return new BPromise(function(_0xc47236,_0x5eaa4e){return client[_0xcec2('0x12')](_0x17b926,_0x54e657)[_0xcec2('0x13')](function(_0x3d2310){logger['info'](_0xcec2('0x14'),_0xa4aa82,_0xcec2('0x15'));logger[_0xcec2('0x16')](_0xcec2('0x17'),_0xa4aa82,_0xcec2('0x15'),JSON[_0xcec2('0x18')](_0x3d2310));if(_0x3d2310[_0xcec2('0x19')]){if(_0x3d2310[_0xcec2('0x19')][_0xcec2('0x1a')]===0x1f4){logger[_0xcec2('0x19')](_0xcec2('0x14'),_0xa4aa82,_0x3d2310[_0xcec2('0x19')]['message']);return _0x5eaa4e(_0x3d2310['error'][_0xcec2('0x1b')]);}logger[_0xcec2('0x19')](_0xcec2('0x14'),_0xa4aa82,_0x3d2310[_0xcec2('0x19')]['message']);return _0xc47236(_0x3d2310[_0xcec2('0x19')][_0xcec2('0x1b')]);}else{logger[_0xcec2('0x1c')](_0xcec2('0x14'),_0xa4aa82,_0xcec2('0x15'));_0xc47236(_0x3d2310[_0xcec2('0x1d')][_0xcec2('0x1b')]);}})['catch'](function(_0x210d75){logger[_0xcec2('0x19')]('MailQueue,\x20%s,\x20%s',_0xa4aa82,_0x210d75);_0x5eaa4e(_0x210d75);});});}exports[_0xcec2('0x1e')]=function(_0x4b4be6){var _0x556c88=this;return new Promise(function(_0x249007,_0x579733){return db[_0xcec2('0x1f')][_0xcec2('0x20')]({'raw':_0x4b4be6['options']?_0x4b4be6['options'][_0xcec2('0x21')]===undefined?!![]:![]:!![],'where':_0x4b4be6[_0xcec2('0x22')]?_0x4b4be6[_0xcec2('0x22')][_0xcec2('0x23')]||null:null,'attributes':_0x4b4be6[_0xcec2('0x22')]?_0x4b4be6[_0xcec2('0x22')][_0xcec2('0x24')]||null:null,'limit':_0x4b4be6[_0xcec2('0x22')]?_0x4b4be6['options'][_0xcec2('0x25')]||null:null,'include':_0x4b4be6['options']?_0x4b4be6[_0xcec2('0x22')]['include']?_['map'](_0x4b4be6[_0xcec2('0x22')][_0xcec2('0x26')],function(_0x4c5d3a){return{'model':db[_0x4c5d3a[_0xcec2('0x27')]],'as':_0x4c5d3a['as'],'attributes':_0x4c5d3a['attributes'],'include':_0x4c5d3a['include']?_['map'](_0x4c5d3a[_0xcec2('0x26')],function(_0x4a5401){return{'model':db[_0x4a5401[_0xcec2('0x27')]],'as':_0x4a5401['as'],'attributes':_0x4a5401[_0xcec2('0x24')],'include':_0x4a5401[_0xcec2('0x26')]?_[_0xcec2('0x28')](_0x4a5401[_0xcec2('0x26')],function(_0x3cec64){return{'model':db[_0x3cec64[_0xcec2('0x27')]],'as':_0x3cec64['as'],'attributes':_0x3cec64['attributes']};}):[]};}):[]};}):[]:[]})[_0xcec2('0x13')](function(_0x427be3){logger['info'](_0xcec2('0x1e'),_0x4b4be6);logger[_0xcec2('0x16')](_0xcec2('0x1e'),_0x4b4be6,JSON[_0xcec2('0x18')](_0x427be3));_0x249007(_0x427be3);})[_0xcec2('0x29')](function(_0x5f333c){logger[_0xcec2('0x19')]('GetMailQueue',_0x5f333c['message'],_0x4b4be6);_0x579733(_0x556c88[_0xcec2('0x19')](0x1f4,_0x5f333c[_0xcec2('0x1b')]));});});};exports[_0xcec2('0x2a')]=function(_0x255b12){var _0x430b3a=this;return new Promise(function(_0x49552c,_0x534f57){return db[_0xcec2('0x1f')][_0xcec2('0x2b')]({'raw':_0x255b12['options']?_0x255b12[_0xcec2('0x22')][_0xcec2('0x21')]===undefined?!![]:![]:!![],'where':_0x255b12[_0xcec2('0x22')]?_0x255b12[_0xcec2('0x22')][_0xcec2('0x23')]||null:null,'attributes':_0x255b12[_0xcec2('0x22')]?_0x255b12[_0xcec2('0x22')]['attributes']||null:null,'include':_0x255b12[_0xcec2('0x22')]?_0x255b12['options'][_0xcec2('0x26')]?_[_0xcec2('0x28')](_0x255b12[_0xcec2('0x22')][_0xcec2('0x26')],function(_0x559025){return{'model':db[_0x559025[_0xcec2('0x27')]],'as':_0x559025['as'],'attributes':_0x559025[_0xcec2('0x24')],'include':_0x559025[_0xcec2('0x26')]?_[_0xcec2('0x28')](_0x559025[_0xcec2('0x26')],function(_0x5f1149){return{'model':db[_0x5f1149['model']],'as':_0x5f1149['as'],'attributes':_0x5f1149[_0xcec2('0x24')],'include':_0x5f1149[_0xcec2('0x26')]?_[_0xcec2('0x28')](_0x5f1149[_0xcec2('0x26')],function(_0x31878c){return{'model':db[_0x31878c['model']],'as':_0x31878c['as'],'attributes':_0x31878c[_0xcec2('0x24')]};}):[]};}):[]};}):[]:[]})[_0xcec2('0x13')](function(_0x10c554){logger[_0xcec2('0x1c')](_0xcec2('0x2a'),_0x255b12);logger['debug']('ShowMailQueue',_0x255b12,JSON[_0xcec2('0x18')](_0x10c554));_0x49552c(_0x10c554);})['catch'](function(_0x34175a){logger[_0xcec2('0x19')](_0xcec2('0x2a'),_0x34175a[_0xcec2('0x1b')],_0x255b12);_0x534f57(_0x430b3a['error'](0x1f4,_0x34175a[_0xcec2('0x1b')]));});});};
\ No newline at end of file
index aee0f1a..10df772 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5d9f=['remove','update','emit','removeListener','length','./mailQueue.events','save'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x5d9f,0x15c));var _0xf5d9=function(_0x206e92,_0x75d4da){_0x206e92=_0x206e92-0x0;var _0xd69fdc=_0x5d9f[_0x206e92];return _0xd69fdc;};'use strict';var MailQueueEvents=require(_0xf5d9('0x0'));var events=[_0xf5d9('0x1'),_0xf5d9('0x2'),_0xf5d9('0x3')];function createListener(_0x120b14,_0x541b0e){return function(_0x1d1aab){_0x541b0e[_0xf5d9('0x4')](_0x120b14,_0x1d1aab);};}function removeListener(_0x494d3c,_0x185d0b){return function(){MailQueueEvents[_0xf5d9('0x5')](_0x494d3c,_0x185d0b);};}exports['register']=function(_0x2dd3aa){for(var _0x20289b=0x0,_0x580f66=events[_0xf5d9('0x6')];_0x20289b<_0x580f66;_0x20289b++){var _0x4d5316=events[_0x20289b];var _0x5ff653=createListener('mailQueue:'+_0x4d5316,_0x2dd3aa);MailQueueEvents['on'](_0x4d5316,_0x5ff653);}};
\ No newline at end of file
+var _0x98e7=['length','mailQueue:','save','remove','update','emit','register'];(function(_0x2d09df,_0x105345){var _0x1237a0=function(_0x352736){while(--_0x352736){_0x2d09df['push'](_0x2d09df['shift']());}};_0x1237a0(++_0x105345);}(_0x98e7,0x1c2));var _0x798e=function(_0xddfbdc,_0x561a0b){_0xddfbdc=_0xddfbdc-0x0;var _0x395d72=_0x98e7[_0xddfbdc];return _0x395d72;};'use strict';var MailQueueEvents=require('./mailQueue.events');var events=[_0x798e('0x0'),_0x798e('0x1'),_0x798e('0x2')];function createListener(_0x4478b2,_0x320e4d){return function(_0x1571c4){_0x320e4d[_0x798e('0x3')](_0x4478b2,_0x1571c4);};}function removeListener(_0x5e750c,_0x808ffe){return function(){MailQueueEvents['removeListener'](_0x5e750c,_0x808ffe);};}exports[_0x798e('0x4')]=function(_0x1b5f85){for(var _0x2119a8=0x0,_0x155f0c=events[_0x798e('0x5')];_0x2119a8<_0x155f0c;_0x2119a8++){var _0x1a60d5=events[_0x2119a8];var _0x4c48db=createListener(_0x798e('0x6')+_0x1a60d5,_0x1b5f85);MailQueueEvents['on'](_0x1a60d5,_0x4c48db);}};
\ No newline at end of file
index 6be88ad..ff34bae 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x00aa=['get','isAuthenticated','/describe','describe','/:id','show','create','put','delete','destroy','exports','multer','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x36beac,_0x55a397){var _0x1ef5cb=function(_0x427fa9){while(--_0x427fa9){_0x36beac['push'](_0x36beac['shift']());}};_0x1ef5cb(++_0x55a397);}(_0x00aa,0x1a9));var _0xa00a=function(_0x48d6a3,_0x37c848){_0x48d6a3=_0x48d6a3-0x0;var _0x38bfa0=_0x00aa[_0x48d6a3];return _0x38bfa0;};'use strict';var multer=require(_0xa00a('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xa00a('0x1'));var express=require(_0xa00a('0x2'));var router=express['Router']();var fs_extra=require(_0xa00a('0x3'));var auth=require(_0xa00a('0x4'));var interaction=require(_0xa00a('0x5'));var config=require(_0xa00a('0x6'));var controller=require('./mailQueueReport.controller');router[_0xa00a('0x7')]('/',auth[_0xa00a('0x8')](),controller['index']);router[_0xa00a('0x7')](_0xa00a('0x9'),auth[_0xa00a('0x8')](),controller[_0xa00a('0xa')]);router[_0xa00a('0x7')](_0xa00a('0xb'),auth[_0xa00a('0x8')](),controller[_0xa00a('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0xa00a('0xd')]);router[_0xa00a('0xe')](_0xa00a('0xb'),auth[_0xa00a('0x8')](),controller['update']);router[_0xa00a('0xf')](_0xa00a('0xb'),auth[_0xa00a('0x8')](),controller[_0xa00a('0x10')]);module[_0xa00a('0x11')]=router;
\ No newline at end of file
+var _0xf346=['../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','show','post','create','put','/:id','update','delete','destroy','exports','path','connect-timeout','Router','fs-extra'];(function(_0x454018,_0x46e33a){var _0x24697d=function(_0x3ec647){while(--_0x3ec647){_0x454018['push'](_0x454018['shift']());}};_0x24697d(++_0x46e33a);}(_0xf346,0x178));var _0x6f34=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0xf346[_0xa148b7];return _0x51efd3;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x6f34('0x0'));var timeout=require(_0x6f34('0x1'));var express=require('express');var router=express[_0x6f34('0x2')]();var fs_extra=require(_0x6f34('0x3'));var auth=require(_0x6f34('0x4'));var interaction=require(_0x6f34('0x5'));var config=require(_0x6f34('0x6'));var controller=require('./mailQueueReport.controller');router['get']('/',auth[_0x6f34('0x7')](),controller[_0x6f34('0x8')]);router[_0x6f34('0x9')]('/describe',auth[_0x6f34('0x7')](),controller[_0x6f34('0xa')]);router[_0x6f34('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x6f34('0xb')]);router[_0x6f34('0xc')]('/',auth[_0x6f34('0x7')](),controller[_0x6f34('0xd')]);router[_0x6f34('0xe')](_0x6f34('0xf'),auth[_0x6f34('0x7')](),controller[_0x6f34('0x10')]);router[_0x6f34('0x11')](_0x6f34('0xf'),auth['isAuthenticated'](),controller[_0x6f34('0x12')]);module[_0x6f34('0x13')]=router;
\ No newline at end of file
index f8f8857..456e042 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x734a=['exports','STRING','DATE','moment'];(function(_0x2fe081,_0x2446ee){var _0x521c99=function(_0x5cb397){while(--_0x5cb397){_0x2fe081['push'](_0x2fe081['shift']());}};_0x521c99(++_0x2446ee);}(_0x734a,0x83));var _0xa734=function(_0x3766f4,_0x580673){_0x3766f4=_0x3766f4-0x0;var _0x183f88=_0x734a[_0x3766f4];return _0x183f88;};'use strict';var moment=require(_0xa734('0x0'));var Sequelize=require('sequelize');module[_0xa734('0x1')]={'uniqueid':{'type':Sequelize[_0xa734('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xa734('0x2')]},'joinAt':{'type':Sequelize[_0xa734('0x3')]},'leaveAt':{'type':Sequelize[_0xa734('0x3')]},'acceptAt':{'type':Sequelize[_0xa734('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x9789=['sequelize','exports','STRING','DATE','moment'];(function(_0x41c99a,_0x12414d){var _0x303bf9=function(_0x219646){while(--_0x219646){_0x41c99a['push'](_0x41c99a['shift']());}};_0x303bf9(++_0x12414d);}(_0x9789,0x1bc));var _0x9978=function(_0x9842c1,_0x1edf79){_0x9842c1=_0x9842c1-0x0;var _0x5ba376=_0x9789[_0x9842c1];return _0x5ba376;};'use strict';var moment=require(_0x9978('0x0'));var Sequelize=require(_0x9978('0x1'));module[_0x9978('0x2')]={'uniqueid':{'type':Sequelize[_0x9978('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x9978('0x3')]},'joinAt':{'type':Sequelize[_0x9978('0x4')]},'leaveAt':{'type':Sequelize[_0x9978('0x4')]},'acceptAt':{'type':Sequelize[_0x9978('0x4')]},'exitAt':{'type':Sequelize[_0x9978('0x4')]},'reason':{'type':Sequelize[_0x9978('0x3')]}};
\ No newline at end of file
index d0fa64f..a693269 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd4a2=['describe','eml-format','fast-json-patch','moment','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','map','MailQueueReport','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','findAll','rows','catch','show','params','includeAll','include','find','create','body'];(function(_0x328fed,_0x4e87f4){var _0x1c11b4=function(_0x24d829){while(--_0x24d829){_0x328fed['push'](_0x328fed['shift']());}};_0x1c11b4(++_0x4e87f4);}(_0xd4a2,0x173));var _0x2d4a=function(_0x2b294e,_0x17db84){_0x2b294e=_0x2b294e-0x0;var _0x3614fc=_0xd4a2[_0x2b294e];return _0x3614fc;};'use strict';var emlformat=require(_0x2d4a('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x2d4a('0x1'));var rp=require('request-promise');var moment=require(_0x2d4a('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x2d4a('0x3'));var util=require('util');var path=require(_0x2d4a('0x4'));var sox=require(_0x2d4a('0x5'));var csv=require(_0x2d4a('0x6'));var ejs=require(_0x2d4a('0x7'));var fs=require('fs');var fs_extra=require(_0x2d4a('0x8'));var _=require('lodash');var squel=require(_0x2d4a('0x9'));var crypto=require(_0x2d4a('0xa'));var jsforce=require(_0x2d4a('0xb'));var deskjs=require(_0x2d4a('0xc'));var toCsv=require(_0x2d4a('0x6'));var querystring=require(_0x2d4a('0xd'));var Papa=require(_0x2d4a('0xe'));var Redis=require(_0x2d4a('0xf'));var authService=require(_0x2d4a('0x10'));var qs=require(_0x2d4a('0x11'));var as=require(_0x2d4a('0x12'));var hardwareService=require(_0x2d4a('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x2d4a('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x2d4a('0x15'));var db=require(_0x2d4a('0x16'))['db'];function respondWithStatusCode(_0x45b9fb,_0x5ac803){_0x5ac803=_0x5ac803||0xcc;return function(_0x2f785f){if(_0x2f785f){return _0x45b9fb[_0x2d4a('0x17')](_0x5ac803);}return _0x45b9fb[_0x2d4a('0x18')](_0x5ac803)[_0x2d4a('0x19')]();};}function respondWithResult(_0x544622,_0x4be8b4){_0x4be8b4=_0x4be8b4||0xc8;return function(_0x2a1d0f){if(_0x2a1d0f){return _0x544622['status'](_0x4be8b4)[_0x2d4a('0x1a')](_0x2a1d0f);}};}function respondWithFilteredResult(_0x175bda,_0x11896d){return function(_0x3a3156){if(_0x3a3156){var _0x4c5287=typeof _0x11896d[_0x2d4a('0x1b')]==='undefined'&&typeof _0x11896d[_0x2d4a('0x1c')]==='undefined';var _0x435687=_0x3a3156[_0x2d4a('0x1d')];var _0x2188b2=_0x4c5287?0x0:_0x11896d[_0x2d4a('0x1b')];var _0x498956=_0x4c5287?_0x3a3156['count']:_0x11896d['offset']+_0x11896d[_0x2d4a('0x1c')];var _0x1966d1;if(_0x498956>=_0x435687){_0x498956=_0x435687;_0x1966d1=0xc8;}else{_0x1966d1=0xce;}_0x175bda[_0x2d4a('0x18')](_0x1966d1);return _0x175bda[_0x2d4a('0x1e')](_0x2d4a('0x1f'),_0x2188b2+'-'+_0x498956+'/'+_0x435687)[_0x2d4a('0x1a')](_0x3a3156);}return null;};}function patchUpdates(_0x56445a){return function(_0x49f378){try{jsonpatch[_0x2d4a('0x20')](_0x49f378,_0x56445a,!![]);}catch(_0x1f3e17){return BPromise[_0x2d4a('0x21')](_0x1f3e17);}return _0x49f378[_0x2d4a('0x22')]();};}function saveUpdates(_0x1a2d20,_0x2e7736){return function(_0x22dd0b){if(_0x22dd0b){return _0x22dd0b[_0x2d4a('0x23')](_0x1a2d20)['then'](function(_0x26e7b8){return _0x26e7b8;});}return null;};}function removeEntity(_0x3240a2,_0x2c3799){return function(_0x42d813){if(_0x42d813){return _0x42d813[_0x2d4a('0x24')]()[_0x2d4a('0x25')](function(){_0x3240a2[_0x2d4a('0x18')](0xcc)[_0x2d4a('0x19')]();});}};}function handleEntityNotFound(_0x54c910,_0x544b9b){return function(_0x5cc7d8){if(!_0x5cc7d8){_0x54c910[_0x2d4a('0x17')](0x194);}return _0x5cc7d8;};}function handleError(_0x5029f3,_0x410f7d){_0x410f7d=_0x410f7d||0x1f4;return function(_0x3a2fd3){logger[_0x2d4a('0x26')](_0x3a2fd3[_0x2d4a('0x27')]);if(_0x3a2fd3[_0x2d4a('0x28')]){delete _0x3a2fd3[_0x2d4a('0x28')];}_0x5029f3[_0x2d4a('0x18')](_0x410f7d)[_0x2d4a('0x29')](_0x3a2fd3);};}exports['index']=function(_0x436f53,_0x5ce262){var _0x221602={},_0x9bac28={},_0xc497ce={'count':0x0,'rows':[]};var _0x20b87d=_[_0x2d4a('0x2a')](db[_0x2d4a('0x2b')][_0x2d4a('0x2c')],function(_0x2e8063){return{'name':_0x2e8063['fieldName'],'type':_0x2e8063[_0x2d4a('0x2d')][_0x2d4a('0x2e')]};});_0x9bac28[_0x2d4a('0x2f')]=_[_0x2d4a('0x2a')](_0x20b87d,_0x2d4a('0x28'));_0x9bac28['query']=_[_0x2d4a('0x30')](_0x436f53[_0x2d4a('0x31')]);_0x9bac28[_0x2d4a('0x32')]=_[_0x2d4a('0x33')](_0x9bac28[_0x2d4a('0x2f')],_0x9bac28['query']);_0x221602[_0x2d4a('0x34')]=_[_0x2d4a('0x33')](_0x9bac28[_0x2d4a('0x2f')],qs[_0x2d4a('0x35')](_0x436f53[_0x2d4a('0x31')][_0x2d4a('0x35')]));_0x221602['attributes']=_0x221602[_0x2d4a('0x34')][_0x2d4a('0x36')]?_0x221602[_0x2d4a('0x34')]:_0x9bac28[_0x2d4a('0x2f')];if(!_0x436f53[_0x2d4a('0x31')]['hasOwnProperty'](_0x2d4a('0x37'))){_0x221602[_0x2d4a('0x1c')]=qs['limit'](_0x436f53[_0x2d4a('0x31')][_0x2d4a('0x1c')]);_0x221602[_0x2d4a('0x1b')]=qs[_0x2d4a('0x1b')](_0x436f53[_0x2d4a('0x31')][_0x2d4a('0x1b')]);}_0x221602['order']=qs[_0x2d4a('0x38')](_0x436f53[_0x2d4a('0x31')][_0x2d4a('0x38')]);_0x221602[_0x2d4a('0x39')]=qs[_0x2d4a('0x32')](_[_0x2d4a('0x3a')](_0x436f53['query'],_0x9bac28['filters']),_0x20b87d);if(_0x436f53[_0x2d4a('0x31')]['filter']){_0x221602[_0x2d4a('0x39')]=_[_0x2d4a('0x3b')](_0x221602['where'],{'$or':_[_0x2d4a('0x2a')](_0x20b87d,function(_0x275598){if(_0x275598[_0x2d4a('0x2d')]!==_0x2d4a('0x3c')){var _0x67bce3={};_0x67bce3[_0x275598[_0x2d4a('0x28')]]={'$like':'%'+_0x436f53[_0x2d4a('0x31')][_0x2d4a('0x3d')]+'%'};return _0x67bce3;}})});}_0x221602=_[_0x2d4a('0x3b')]({},_0x221602,_0x436f53[_0x2d4a('0x3e')]);var _0x3bb0cc={'where':_0x221602['where']};return db[_0x2d4a('0x2b')][_0x2d4a('0x1d')](_0x3bb0cc)[_0x2d4a('0x25')](function(_0x2f1635){_0xc497ce[_0x2d4a('0x1d')]=_0x2f1635;if(_0x436f53['query']['includeAll']){_0x221602['include']=[{'all':!![]}];}return db['MailQueueReport'][_0x2d4a('0x3f')](_0x221602);})[_0x2d4a('0x25')](function(_0xf39020){_0xc497ce[_0x2d4a('0x40')]=_0xf39020;return _0xc497ce;})['then'](respondWithFilteredResult(_0x5ce262,_0x221602))[_0x2d4a('0x41')](handleError(_0x5ce262,null));};exports[_0x2d4a('0x42')]=function(_0x5e9704,_0x189d2a){var _0x13b0f0={'raw':!![],'where':{'id':_0x5e9704[_0x2d4a('0x43')]['id']}},_0x8a9375={};_0x8a9375[_0x2d4a('0x2f')]=_[_0x2d4a('0x30')](db['MailQueueReport'][_0x2d4a('0x2c')]);_0x8a9375[_0x2d4a('0x31')]=_[_0x2d4a('0x30')](_0x5e9704[_0x2d4a('0x31')]);_0x8a9375[_0x2d4a('0x32')]=_[_0x2d4a('0x33')](_0x8a9375['model'],_0x8a9375[_0x2d4a('0x31')]);_0x13b0f0[_0x2d4a('0x34')]=_[_0x2d4a('0x33')](_0x8a9375['model'],qs[_0x2d4a('0x35')](_0x5e9704['query'][_0x2d4a('0x35')]));_0x13b0f0[_0x2d4a('0x34')]=_0x13b0f0[_0x2d4a('0x34')][_0x2d4a('0x36')]?_0x13b0f0[_0x2d4a('0x34')]:_0x8a9375['model'];if(_0x5e9704['query'][_0x2d4a('0x44')]){_0x13b0f0[_0x2d4a('0x45')]=[{'all':!![]}];}_0x13b0f0=_['merge']({},_0x13b0f0,_0x5e9704[_0x2d4a('0x3e')]);return db['MailQueueReport'][_0x2d4a('0x46')](_0x13b0f0)[_0x2d4a('0x25')](handleEntityNotFound(_0x189d2a,null))[_0x2d4a('0x25')](respondWithResult(_0x189d2a,null))['catch'](handleError(_0x189d2a,null));};exports[_0x2d4a('0x47')]=function(_0x541b93,_0x3806b8){return db[_0x2d4a('0x2b')][_0x2d4a('0x47')](_0x541b93[_0x2d4a('0x48')],{})[_0x2d4a('0x25')](respondWithResult(_0x3806b8,0xc9))[_0x2d4a('0x41')](handleError(_0x3806b8,null));};exports[_0x2d4a('0x23')]=function(_0x2b2f4b,_0x1ffb96){if(_0x2b2f4b[_0x2d4a('0x48')]['id']){delete _0x2b2f4b[_0x2d4a('0x48')]['id'];}return db['MailQueueReport'][_0x2d4a('0x46')]({'where':{'id':_0x2b2f4b[_0x2d4a('0x43')]['id']}})[_0x2d4a('0x25')](handleEntityNotFound(_0x1ffb96,null))[_0x2d4a('0x25')](saveUpdates(_0x2b2f4b[_0x2d4a('0x48')],null))['then'](respondWithResult(_0x1ffb96,null))[_0x2d4a('0x41')](handleError(_0x1ffb96,null));};exports[_0x2d4a('0x24')]=function(_0x2123e8,_0x440625){return db[_0x2d4a('0x2b')]['find']({'where':{'id':_0x2123e8['params']['id']}})[_0x2d4a('0x25')](handleEntityNotFound(_0x440625,null))[_0x2d4a('0x25')](removeEntity(_0x440625,null))['catch'](handleError(_0x440625,null));};exports[_0x2d4a('0x49')]=function(_0x33f413,_0x7f0807){return db[_0x2d4a('0x2b')]['describe']()[_0x2d4a('0x25')](respondWithResult(_0x7f0807,null))['catch'](handleError(_0x7f0807,null));};
\ No newline at end of file
+var _0x0295=['params','intersection','include','find','create','body','eml-format','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','MailQueueReport','includeAll','rows','catch','show'];(function(_0x77853f,_0xf6ee23){var _0x49270f=function(_0x4fc18b){while(--_0x4fc18b){_0x77853f['push'](_0x77853f['shift']());}};_0x49270f(++_0xf6ee23);}(_0x0295,0x1f0));var _0x5029=function(_0x2831cf,_0x24babf){_0x2831cf=_0x2831cf-0x0;var _0x5ec206=_0x0295[_0x2831cf];return _0x5ec206;};'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['MailQueueReport'][_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['MailQueueReport'][_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')](_0x3dfc08[_0x5029('0x45')],{})[_0x5029('0x20')](respondWithResult(_0x2bb7fc,0xc9))[_0x5029('0x3e')](handleError(_0x2bb7fc,null));};exports[_0x5029('0x1f')]=function(_0x18f1f5,_0x3168bd){if(_0x18f1f5[_0x5029('0x45')]['id']){delete _0x18f1f5[_0x5029('0x45')]['id'];}return db[_0x5029('0x3b')][_0x5029('0x43')]({'where':{'id':_0x18f1f5[_0x5029('0x40')]['id']}})[_0x5029('0x20')](handleEntityNotFound(_0x3168bd,null))['then'](saveUpdates(_0x18f1f5[_0x5029('0x45')],null))['then'](respondWithResult(_0x3168bd,null))[_0x5029('0x3e')](handleError(_0x3168bd,null));};exports[_0x5029('0x21')]=function(_0x4d788a,_0x5343c6){return db[_0x5029('0x3b')]['find']({'where':{'id':_0x4d788a['params']['id']}})[_0x5029('0x20')](handleEntityNotFound(_0x5343c6,null))[_0x5029('0x20')](removeEntity(_0x5343c6,null))[_0x5029('0x3e')](handleError(_0x5343c6,null));};exports['describe']=function(_0x544fb3,_0x1510bb){return db[_0x5029('0x3b')]['describe']()[_0x5029('0x20')](respondWithResult(_0x1510bb,null))['catch'](handleError(_0x1510bb,null));};
\ No newline at end of file
index 3c80359..0064e2a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd3a7=['util','../../config/logger','api','moment','request-promise','path','../../config/environment','exports','define','uniqueid','lodash'];(function(_0x35bffe,_0x3431cd){var _0x3bbd3c=function(_0x149689){while(--_0x149689){_0x35bffe['push'](_0x35bffe['shift']());}};_0x3bbd3c(++_0x3431cd);}(_0xd3a7,0x107));var _0x7d3a=function(_0x4df195,_0x673fc7){_0x4df195=_0x4df195-0x0;var _0xee39b=_0xd3a7[_0x4df195];return _0xee39b;};'use strict';var _=require(_0x7d3a('0x0'));var util=require(_0x7d3a('0x1'));var logger=require(_0x7d3a('0x2'))(_0x7d3a('0x3'));var moment=require(_0x7d3a('0x4'));var BPromise=require('bluebird');var rp=require(_0x7d3a('0x5'));var fs=require('fs');var path=require(_0x7d3a('0x6'));var rimraf=require('rimraf');var config=require(_0x7d3a('0x7'));var attributes=require('./mailQueueReport.attributes');module[_0x7d3a('0x8')]=function(_0x1471d0,_0x18ea62){return _0x1471d0[_0x7d3a('0x9')]('MailQueueReport',attributes,{'tableName':'report_mail_queue','paranoid':![],'indexes':[{'name':_0x7d3a('0xa'),'fields':[_0x7d3a('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x2b55=['request-promise','../../config/environment','./mailQueueReport.attributes','exports','define','MailQueueReport','report_mail_queue','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x34f184,_0x342406){var _0x28afd8=function(_0x41810f){while(--_0x41810f){_0x34f184['push'](_0x34f184['shift']());}};_0x28afd8(++_0x342406);}(_0x2b55,0x180));var _0x52b5=function(_0x1674e0,_0xd107e7){_0x1674e0=_0x1674e0-0x0;var _0x36fc3f=_0x2b55[_0x1674e0];return _0x36fc3f;};'use strict';var _=require(_0x52b5('0x0'));var util=require(_0x52b5('0x1'));var logger=require(_0x52b5('0x2'))(_0x52b5('0x3'));var moment=require(_0x52b5('0x4'));var BPromise=require(_0x52b5('0x5'));var rp=require(_0x52b5('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x52b5('0x7'));var attributes=require(_0x52b5('0x8'));module[_0x52b5('0x9')]=function(_0x3ac793,_0x3582ad){return _0x3ac793[_0x52b5('0xa')](_0x52b5('0xb'),attributes,{'tableName':_0x52b5('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
index 1ad5159..e01b2e3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-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(_0x50d95a,_0x3af2ff){var _0x21d04f=function(_0x296282){while(--_0x296282){_0x50d95a['push'](_0x50d95a['shift']());}};_0x21d04f(++_0x3af2ff);}(_0xadb5,0xad));var _0x5adb=function(_0x44f289,_0x814005){_0x44f289=_0x44f289-0x0;var _0x388fe8=_0xadb5[_0x44f289];return _0x388fe8;};'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
+var _0x1261=['../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','MailQueueReport,\x20%s,\x20%s','request\x20sent','MailQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','CreateMailQueueReport','body','options','raw','stringify','MailQueueReport','update','where','UpdateMailQueueReport','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x3f4853,_0x135ca9){var _0xc09554=function(_0x4ce2a4){while(--_0x4ce2a4){_0x3f4853['push'](_0x3f4853['shift']());}};_0xc09554(++_0x135ca9);}(_0x1261,0x144));var _0x1126=function(_0x59ae8f,_0x148344){_0x59ae8f=_0x59ae8f-0x0;var _0x3900b5=_0x1261[_0x59ae8f];return _0x3900b5;};'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')]('MailQueueReport,\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['MailQueueReport']['create'](_0x4a7b49[_0x1126('0x16')],{'raw':_0x4a7b49['options']?_0x4a7b49[_0x1126('0x17')][_0x1126('0x18')]===undefined?!![]:![]:!![]})[_0x1126('0xc')](function(_0x54400a){logger[_0x1126('0xd')]('CreateMailQueueReport',_0x4a7b49);logger['debug'](_0x1126('0x15'),_0x4a7b49,JSON[_0x1126('0x19')](_0x54400a));_0x22ae0b(_0x54400a);})[_0x1126('0x14')](function(_0x36d254){logger['error'](_0x1126('0x15'),_0x36d254[_0x1126('0x13')],_0x4a7b49);_0x2b2487(_0x4d2b38['error'](0x1f4,_0x36d254[_0x1126('0x13')]));});});};exports['UpdateMailQueueReport']=function(_0x529dd9){var _0x4b57ab=this;return new Promise(function(_0x2199d9,_0x15bcc3){return db[_0x1126('0x1a')][_0x1126('0x1b')](_0x529dd9[_0x1126('0x16')],{'raw':_0x529dd9[_0x1126('0x17')]?_0x529dd9[_0x1126('0x17')][_0x1126('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x529dd9['options']?_0x529dd9[_0x1126('0x17')][_0x1126('0x1c')]||null:null,'attributes':_0x529dd9[_0x1126('0x17')]?_0x529dd9['options']['attributes']||null:null,'limit':_0x529dd9[_0x1126('0x17')]?_0x529dd9[_0x1126('0x17')]['limit']||null:null})[_0x1126('0xc')](function(_0x23d2bc){logger['info'](_0x1126('0x1d'),_0x529dd9);logger['debug'](_0x1126('0x1d'),_0x529dd9,JSON['stringify'](_0x23d2bc));_0x2199d9(_0x23d2bc);})[_0x1126('0x14')](function(_0x583ce6){logger[_0x1126('0x11')]('UpdateMailQueueReport',_0x583ce6['message'],_0x529dd9);_0x15bcc3(_0x4b57ab['error'](0x1f4,_0x583ce6[_0x1126('0x13')]));});});};
\ No newline at end of file
index 0c245b5..d78fe66 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(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0xa9e0[_0x5447fd];return _0x15b28a;};'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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x255ac0,_0x3f6645){var _0x437bf1=function(_0x5baff0){while(--_0x5baff0){_0x255ac0['push'](_0x255ac0['shift']());}};_0x437bf1(++_0x3f6645);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router;
\ No newline at end of file
index 650eea5..1254c7f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x63a6=['exports','STRING','BOOLEAN','INTEGER','INBOX'];(function(_0x34e6ee,_0x35c1d7){var _0x4f7231=function(_0x255c91){while(--_0x255c91){_0x34e6ee['push'](_0x34e6ee['shift']());}};_0x4f7231(++_0x35c1d7);}(_0x63a6,0x1c7));var _0x663a=function(_0xcfd89f,_0x106e8f){_0xcfd89f=_0xcfd89f-0x0;var _0x59acd4=_0x63a6[_0xcfd89f];return _0x59acd4;};'use strict';var Sequelize=require('sequelize');module[_0x663a('0x0')]={'description':{'type':Sequelize[_0x663a('0x1')]},'host':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0x663a('0x2')],'defaultValue':!![]},'user':{'type':Sequelize[_0x663a('0x1')]},'password':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x663a('0x3')]},'tls':{'type':Sequelize[_0x663a('0x2')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x663a('0x1')],'defaultValue':_0x663a('0x4')},'connTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'authTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'service':{'type':Sequelize['STRING']},'modernAuthentication':{'type':Sequelize[_0x663a('0x2')],'defaultValue':![]}};
\ No newline at end of file
+var _0x7847=['STRING','INTEGER','INBOX','BOOLEAN','sequelize','exports'];(function(_0x509857,_0x3933e7){var _0xc6da17=function(_0x5111bd){while(--_0x5111bd){_0x509857['push'](_0x509857['shift']());}};_0xc6da17(++_0x3933e7);}(_0x7847,0xca));var _0x7784=function(_0x133296,_0xe8ff9a){_0x133296=_0x133296-0x0;var _0x193517=_0x7847[_0x133296];return _0x193517;};'use strict';var Sequelize=require(_0x7784('0x0'));module[_0x7784('0x1')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x7784('0x2')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'user':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x7784('0x2')]},'port':{'type':Sequelize[_0x7784('0x3')]},'tls':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x7784('0x2')],'defaultValue':_0x7784('0x4')},'connTimeout':{'type':Sequelize[_0x7784('0x3')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x7784('0x3')],'defaultValue':0x5},'service':{'type':Sequelize[_0x7784('0x2')]},'modernAuthentication':{'type':Sequelize[_0x7784('0x5')],'defaultValue':![]}};
\ No newline at end of file
index 4d20814..4708ccc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9880=['./mailServerIn.attributes','define','MailServerIn','mail_servers_in','lodash','../../config/logger','moment','bluebird','path'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x9880,0x148));var _0x0988=function(_0x1af0e5,_0x152990){_0x1af0e5=_0x1af0e5-0x0;var _0x3c444a=_0x9880[_0x1af0e5];return _0x3c444a;};'use strict';var _=require(_0x0988('0x0'));var util=require('util');var logger=require(_0x0988('0x1'))('api');var moment=require(_0x0988('0x2'));var BPromise=require(_0x0988('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0988('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x0988('0x5'));module['exports']=function(_0x4736f2,_0x4743b6){return _0x4736f2[_0x0988('0x6')](_0x0988('0x7'),attributes,{'tableName':_0x0988('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa537=['../../config/environment','MailServerIn','api','moment','request-promise','rimraf'];(function(_0x3cd1d9,_0x1a9dce){var _0x1beba6=function(_0x4be48f){while(--_0x4be48f){_0x3cd1d9['push'](_0x3cd1d9['shift']());}};_0x1beba6(++_0x1a9dce);}(_0xa537,0x19a));var _0x7a53=function(_0x8ef5e4,_0x391cc8){_0x8ef5e4=_0x8ef5e4-0x0;var _0x5d59a3=_0xa537[_0x8ef5e4];return _0x5d59a3;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x7a53('0x0'));var moment=require(_0x7a53('0x1'));var BPromise=require('bluebird');var rp=require(_0x7a53('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7a53('0x3'));var config=require(_0x7a53('0x4'));var attributes=require('./mailServerIn.attributes');module['exports']=function(_0x2c90a8,_0x1cb85b){return _0x2c90a8['define'](_0x7a53('0x5'),attributes,{'tableName':'mail_servers_in','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index c8097b2..2b44d4b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf69b=['options','where','attributes','limit','include','map','model','debug','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','info','MailServerIn,\x20%s,\x20%s','request\x20sent','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetMailServerIn','MailServerIn','findAll'];(function(_0x26894b,_0x5f1ba6){var _0x35bdf6=function(_0x3eed9e){while(--_0x3eed9e){_0x26894b['push'](_0x26894b['shift']());}};_0x35bdf6(++_0x5f1ba6);}(_0xf69b,0xc8));var _0xbf69=function(_0x240039,_0x30397b){_0x240039=_0x240039-0x0;var _0x55458=_0xf69b[_0x240039];return _0x55458;};'use strict';var _=require('lodash');var util=require(_0xbf69('0x0'));var moment=require('moment');var BPromise=require(_0xbf69('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbf69('0x2'));var db=require(_0xbf69('0x3'))['db'];var utils=require(_0xbf69('0x4'));var logger=require('../../config/logger')(_0xbf69('0x5'));var config=require('../../config/environment');var jayson=require(_0xbf69('0x6'));var client=jayson[_0xbf69('0x7')][_0xbf69('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x642645,_0x1af327,_0x4e3088){return new BPromise(function(_0x1fec31,_0x3a4504){return client[_0xbf69('0x9')](_0x642645,_0x4e3088)[_0xbf69('0xa')](function(_0x516ebe){logger[_0xbf69('0xb')](_0xbf69('0xc'),_0x1af327,_0xbf69('0xd'));logger['debug'](_0xbf69('0xe'),_0x1af327,_0xbf69('0xd'),JSON[_0xbf69('0xf')](_0x516ebe));if(_0x516ebe[_0xbf69('0x10')]){if(_0x516ebe['error'][_0xbf69('0x11')]===0x1f4){logger[_0xbf69('0x10')](_0xbf69('0xc'),_0x1af327,_0x516ebe[_0xbf69('0x10')][_0xbf69('0x12')]);return _0x3a4504(_0x516ebe['error']['message']);}logger[_0xbf69('0x10')]('MailServerIn,\x20%s,\x20%s',_0x1af327,_0x516ebe['error']['message']);return _0x1fec31(_0x516ebe[_0xbf69('0x10')][_0xbf69('0x12')]);}else{logger[_0xbf69('0xb')]('MailServerIn,\x20%s,\x20%s',_0x1af327,_0xbf69('0xd'));_0x1fec31(_0x516ebe[_0xbf69('0x13')][_0xbf69('0x12')]);}})[_0xbf69('0x14')](function(_0x45312f){logger[_0xbf69('0x10')](_0xbf69('0xc'),_0x1af327,_0x45312f);_0x3a4504(_0x45312f);});});}exports[_0xbf69('0x15')]=function(_0x307fbb){var _0x3ad726=this;return new Promise(function(_0x41e749,_0x26be42){return db[_0xbf69('0x16')][_0xbf69('0x17')]({'raw':_0x307fbb[_0xbf69('0x18')]?_0x307fbb[_0xbf69('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x307fbb[_0xbf69('0x18')]?_0x307fbb[_0xbf69('0x18')][_0xbf69('0x19')]||null:null,'attributes':_0x307fbb['options']?_0x307fbb[_0xbf69('0x18')][_0xbf69('0x1a')]||null:null,'limit':_0x307fbb[_0xbf69('0x18')]?_0x307fbb['options'][_0xbf69('0x1b')]||null:null,'include':_0x307fbb[_0xbf69('0x18')]?_0x307fbb[_0xbf69('0x18')][_0xbf69('0x1c')]?_[_0xbf69('0x1d')](_0x307fbb[_0xbf69('0x18')]['include'],function(_0x14b4b0){return{'model':db[_0x14b4b0['model']],'as':_0x14b4b0['as'],'attributes':_0x14b4b0[_0xbf69('0x1a')],'include':_0x14b4b0['include']?_[_0xbf69('0x1d')](_0x14b4b0[_0xbf69('0x1c')],function(_0x10b9c0){return{'model':db[_0x10b9c0[_0xbf69('0x1e')]],'as':_0x10b9c0['as'],'attributes':_0x10b9c0[_0xbf69('0x1a')],'include':_0x10b9c0[_0xbf69('0x1c')]?_[_0xbf69('0x1d')](_0x10b9c0[_0xbf69('0x1c')],function(_0x7ad809){return{'model':db[_0x7ad809[_0xbf69('0x1e')]],'as':_0x7ad809['as'],'attributes':_0x7ad809[_0xbf69('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xbf69('0xa')](function(_0x3993f6){logger[_0xbf69('0xb')]('GetMailServerIn',_0x307fbb);logger[_0xbf69('0x1f')](_0xbf69('0x15'),_0x307fbb,JSON[_0xbf69('0xf')](_0x3993f6));_0x41e749(_0x3993f6);})[_0xbf69('0x14')](function(_0x1711f7){logger[_0xbf69('0x10')](_0xbf69('0x15'),_0x1711f7['message'],_0x307fbb);_0x26be42(_0x3ad726[_0xbf69('0x10')](0x1f4,_0x1711f7[_0xbf69('0x12')]));});});};
\ No newline at end of file
+var _0x9d11=['MailServerIn,\x20%s,\x20%s,\x20%s','error','code','MailServerIn,\x20%s,\x20%s','message','result','catch','GetMailServerIn','MailServerIn','options','raw','where','attributes','include','map','model','then','stringify','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','info','request\x20sent','debug'];(function(_0x168473,_0x2fda9a){var _0xf69eb4=function(_0x30ca7f){while(--_0x30ca7f){_0x168473['push'](_0x168473['shift']());}};_0xf69eb4(++_0x2fda9a);}(_0x9d11,0xb7));var _0x19d1=function(_0x3c6dce,_0x5424dd){_0x3c6dce=_0x3c6dce-0x0;var _0x1450e9=_0x9d11[_0x3c6dce];return _0x1450e9;};'use strict';var _=require(_0x19d1('0x0'));var util=require(_0x19d1('0x1'));var moment=require(_0x19d1('0x2'));var BPromise=require(_0x19d1('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x19d1('0x4'));var db=require(_0x19d1('0x5'))['db'];var utils=require(_0x19d1('0x6'));var logger=require(_0x19d1('0x7'))(_0x19d1('0x8'));var config=require(_0x19d1('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x19d1('0xa')][_0x19d1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4b624c,_0x16eaf9,_0x3dbe9f){return new BPromise(function(_0x2d9f9e,_0x3e2181){return client['request'](_0x4b624c,_0x3dbe9f)['then'](function(_0xc947ce){logger[_0x19d1('0xc')]('MailServerIn,\x20%s,\x20%s',_0x16eaf9,_0x19d1('0xd'));logger[_0x19d1('0xe')](_0x19d1('0xf'),_0x16eaf9,'request\x20sent',JSON['stringify'](_0xc947ce));if(_0xc947ce['error']){if(_0xc947ce[_0x19d1('0x10')][_0x19d1('0x11')]===0x1f4){logger[_0x19d1('0x10')](_0x19d1('0x12'),_0x16eaf9,_0xc947ce['error']['message']);return _0x3e2181(_0xc947ce[_0x19d1('0x10')]['message']);}logger['error'](_0x19d1('0x12'),_0x16eaf9,_0xc947ce[_0x19d1('0x10')][_0x19d1('0x13')]);return _0x2d9f9e(_0xc947ce[_0x19d1('0x10')][_0x19d1('0x13')]);}else{logger[_0x19d1('0xc')](_0x19d1('0x12'),_0x16eaf9,'request\x20sent');_0x2d9f9e(_0xc947ce[_0x19d1('0x14')][_0x19d1('0x13')]);}})[_0x19d1('0x15')](function(_0x5b5c4c){logger[_0x19d1('0x10')](_0x19d1('0x12'),_0x16eaf9,_0x5b5c4c);_0x3e2181(_0x5b5c4c);});});}exports[_0x19d1('0x16')]=function(_0x3df779){var _0x3144eb=this;return new Promise(function(_0xae72c5,_0x5c92bc){return db[_0x19d1('0x17')]['findAll']({'raw':_0x3df779['options']?_0x3df779[_0x19d1('0x18')][_0x19d1('0x19')]===undefined?!![]:![]:!![],'where':_0x3df779[_0x19d1('0x18')]?_0x3df779[_0x19d1('0x18')][_0x19d1('0x1a')]||null:null,'attributes':_0x3df779['options']?_0x3df779['options'][_0x19d1('0x1b')]||null:null,'limit':_0x3df779[_0x19d1('0x18')]?_0x3df779['options']['limit']||null:null,'include':_0x3df779[_0x19d1('0x18')]?_0x3df779[_0x19d1('0x18')][_0x19d1('0x1c')]?_[_0x19d1('0x1d')](_0x3df779[_0x19d1('0x18')][_0x19d1('0x1c')],function(_0x57ad20){return{'model':db[_0x57ad20[_0x19d1('0x1e')]],'as':_0x57ad20['as'],'attributes':_0x57ad20[_0x19d1('0x1b')],'include':_0x57ad20[_0x19d1('0x1c')]?_['map'](_0x57ad20[_0x19d1('0x1c')],function(_0x1bb261){return{'model':db[_0x1bb261[_0x19d1('0x1e')]],'as':_0x1bb261['as'],'attributes':_0x1bb261[_0x19d1('0x1b')],'include':_0x1bb261[_0x19d1('0x1c')]?_[_0x19d1('0x1d')](_0x1bb261[_0x19d1('0x1c')],function(_0x2d83a6){return{'model':db[_0x2d83a6[_0x19d1('0x1e')]],'as':_0x2d83a6['as'],'attributes':_0x2d83a6[_0x19d1('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x19d1('0x1f')](function(_0x3ceda9){logger[_0x19d1('0xc')](_0x19d1('0x16'),_0x3df779);logger[_0x19d1('0xe')](_0x19d1('0x16'),_0x3df779,JSON[_0x19d1('0x20')](_0x3ceda9));_0xae72c5(_0x3ceda9);})['catch'](function(_0x2b186e){logger[_0x19d1('0x10')](_0x19d1('0x16'),_0x2b186e[_0x19d1('0x13')],_0x3df779);_0x5c92bc(_0x3144eb[_0x19d1('0x10')](0x1f4,_0x2b186e[_0x19d1('0x13')]));});});};
\ No newline at end of file
index 98e3a24..bb48724 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(_0x24237f,_0x4cf32c){var _0x48298e=function(_0x3f7511){while(--_0x3f7511){_0x24237f['push'](_0x24237f['shift']());}};_0x48298e(++_0x4cf32c);}(_0x7a54,0x106));var _0x47a5=function(_0x25444c,_0x43dca7){_0x25444c=_0x25444c-0x0;var _0x515261=_0x7a54[_0x25444c];return _0x515261;};'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(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x7a54,0x106));var _0x47a5=function(_0x418750,_0x167faf){_0x418750=_0x418750-0x0;var _0x292eac=_0x7a54[_0x418750];return _0x292eac;};'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 82fb9b8..a929cda 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x373d=['STRING','BOOLEAN','sequelize'];(function(_0x22bae4,_0x22474b){var _0x2047b6=function(_0x849589){while(--_0x849589){_0x22bae4['push'](_0x22bae4['shift']());}};_0x2047b6(++_0x22474b);}(_0x373d,0x1e2));var _0xd373=function(_0xb72431,_0x19948f){_0xb72431=_0xb72431-0x0;var _0x123b77=_0x373d[_0xb72431];return _0x123b77;};'use strict';var Sequelize=require(_0xd373('0x0'));module['exports']={'description':{'type':Sequelize[_0xd373('0x1')]},'host':{'type':Sequelize[_0xd373('0x1')]},'user':{'type':Sequelize[_0xd373('0x1')]},'pass':{'type':Sequelize[_0xd373('0x1')]},'port':{'type':Sequelize['INTEGER']},'secure':{'type':Sequelize[_0xd373('0x2')],'defaultValue':![]},'service':{'type':Sequelize[_0xd373('0x1')]},'authentication':{'type':Sequelize[_0xd373('0x2')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0x4fc2=['STRING','INTEGER','BOOLEAN','sequelize','exports'];(function(_0x13cc39,_0x4e8ab2){var _0x2cfbc5=function(_0x1e61ea){while(--_0x1e61ea){_0x13cc39['push'](_0x13cc39['shift']());}};_0x2cfbc5(++_0x4e8ab2);}(_0x4fc2,0x111));var _0x24fc=function(_0x50bc98,_0x1e99b8){_0x50bc98=_0x50bc98-0x0;var _0x34163b=_0x4fc2[_0x50bc98];return _0x34163b;};'use strict';var Sequelize=require(_0x24fc('0x0'));module[_0x24fc('0x1')]={'description':{'type':Sequelize[_0x24fc('0x2')]},'host':{'type':Sequelize[_0x24fc('0x2')]},'user':{'type':Sequelize['STRING']},'pass':{'type':Sequelize[_0x24fc('0x2')]},'port':{'type':Sequelize[_0x24fc('0x3')]},'secure':{'type':Sequelize[_0x24fc('0x4')],'defaultValue':![]},'service':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0x24fc('0x4')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0x24fc('0x4')],'defaultValue':![]}};
\ No newline at end of file
index cca1d08..5fd34a8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8712=['ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','sendStatus','error','stack','name','send','index','fieldName','map','query','keys','intersection','model','fields','attributes','length','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','MailServerOut','findAll','rows','params','rawAttributes','includeAll','include','find','catch','create','body','destroy','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse'];(function(_0x46f3c2,_0x9220a3){var _0x2e5936=function(_0x320de3){while(--_0x320de3){_0x46f3c2['push'](_0x46f3c2['shift']());}};_0x2e5936(++_0x9220a3);}(_0x8712,0x19f));var _0x2871=function(_0x449947,_0xa1148b){_0x449947=_0x449947-0x0;var _0xbb7c79=_0x8712[_0x449947];return _0xbb7c79;};'use strict';var emlformat=require(_0x2871('0x0'));var rimraf=require(_0x2871('0x1'));var zipdir=require(_0x2871('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2871('0x3'));var moment=require(_0x2871('0x4'));var BPromise=require(_0x2871('0x5'));var Mustache=require(_0x2871('0x6'));var util=require(_0x2871('0x7'));var path=require('path');var sox=require(_0x2871('0x8'));var csv=require(_0x2871('0x9'));var ejs=require(_0x2871('0xa'));var fs=require('fs');var fs_extra=require(_0x2871('0xb'));var _=require('lodash');var squel=require(_0x2871('0xc'));var crypto=require(_0x2871('0xd'));var jsforce=require(_0x2871('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x2871('0xf'));var Papa=require(_0x2871('0x10'));var Redis=require(_0x2871('0x11'));var authService=require(_0x2871('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2871('0x13'));var logger=require(_0x2871('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x2871('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x2871('0x16'))['db'];function respondWithStatusCode(_0x217b1f,_0x1d4282){_0x1d4282=_0x1d4282||0xcc;return function(_0x1029f8){if(_0x1029f8){return _0x217b1f['sendStatus'](_0x1d4282);}return _0x217b1f[_0x2871('0x17')](_0x1d4282)['end']();};}function respondWithResult(_0x337e8c,_0xbd09dc){_0xbd09dc=_0xbd09dc||0xc8;return function(_0x46c107){if(_0x46c107){return _0x337e8c[_0x2871('0x17')](_0xbd09dc)[_0x2871('0x18')](_0x46c107);}};}function respondWithFilteredResult(_0x5afd5d,_0x5ae24c){return function(_0x50c737){if(_0x50c737){var _0x11b32f=typeof _0x5ae24c['offset']===_0x2871('0x19')&&typeof _0x5ae24c[_0x2871('0x1a')]==='undefined';var _0x1be1dc=_0x50c737[_0x2871('0x1b')];var _0x49958e=_0x11b32f?0x0:_0x5ae24c[_0x2871('0x1c')];var _0x17ee9b=_0x11b32f?_0x50c737[_0x2871('0x1b')]:_0x5ae24c['offset']+_0x5ae24c[_0x2871('0x1a')];var _0x87c5d5;if(_0x17ee9b>=_0x1be1dc){_0x17ee9b=_0x1be1dc;_0x87c5d5=0xc8;}else{_0x87c5d5=0xce;}_0x5afd5d[_0x2871('0x17')](_0x87c5d5);return _0x5afd5d[_0x2871('0x1d')](_0x2871('0x1e'),_0x49958e+'-'+_0x17ee9b+'/'+_0x1be1dc)[_0x2871('0x18')](_0x50c737);}return null;};}function patchUpdates(_0x513b99){return function(_0x1c7810){try{jsonpatch[_0x2871('0x1f')](_0x1c7810,_0x513b99,!![]);}catch(_0x594c28){return BPromise[_0x2871('0x20')](_0x594c28);}return _0x1c7810['save']();};}function saveUpdates(_0x16ca12,_0xa3e55c){return function(_0x53ee96){if(_0x53ee96){return _0x53ee96[_0x2871('0x21')](_0x16ca12)[_0x2871('0x22')](function(_0x3e63d5){return _0x3e63d5;});}return null;};}function removeEntity(_0x2b01c6,_0x8e9f79){return function(_0x50bdca){if(_0x50bdca){return _0x50bdca['destroy']()[_0x2871('0x22')](function(){_0x2b01c6[_0x2871('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e2449,_0xa13ba4){return function(_0x25a03d){if(!_0x25a03d){_0x3e2449[_0x2871('0x23')](0x194);}return _0x25a03d;};}function handleError(_0x44978e,_0x5c406d){_0x5c406d=_0x5c406d||0x1f4;return function(_0x599acf){logger[_0x2871('0x24')](_0x599acf[_0x2871('0x25')]);if(_0x599acf[_0x2871('0x26')]){delete _0x599acf[_0x2871('0x26')];}_0x44978e[_0x2871('0x17')](_0x5c406d)[_0x2871('0x27')](_0x599acf);};}exports[_0x2871('0x28')]=function(_0x305d48,_0x415856){var _0x1faa5b={},_0x550d3b={},_0x5393f3={'count':0x0,'rows':[]};var _0x535a30=_['map'](db['MailServerOut']['rawAttributes'],function(_0xdba57f){return{'name':_0xdba57f[_0x2871('0x29')],'type':_0xdba57f['type']['key']};});_0x550d3b['model']=_[_0x2871('0x2a')](_0x535a30,'name');_0x550d3b[_0x2871('0x2b')]=_[_0x2871('0x2c')](_0x305d48[_0x2871('0x2b')]);_0x550d3b['filters']=_[_0x2871('0x2d')](_0x550d3b['model'],_0x550d3b['query']);_0x1faa5b['attributes']=_['intersection'](_0x550d3b[_0x2871('0x2e')],qs[_0x2871('0x2f')](_0x305d48['query'][_0x2871('0x2f')]));_0x1faa5b[_0x2871('0x30')]=_0x1faa5b[_0x2871('0x30')][_0x2871('0x31')]?_0x1faa5b[_0x2871('0x30')]:_0x550d3b[_0x2871('0x2e')];if(!_0x305d48[_0x2871('0x2b')]['hasOwnProperty'](_0x2871('0x32'))){_0x1faa5b[_0x2871('0x1a')]=qs[_0x2871('0x1a')](_0x305d48[_0x2871('0x2b')][_0x2871('0x1a')]);_0x1faa5b[_0x2871('0x1c')]=qs[_0x2871('0x1c')](_0x305d48[_0x2871('0x2b')]['offset']);}_0x1faa5b[_0x2871('0x33')]=qs[_0x2871('0x34')](_0x305d48['query'][_0x2871('0x34')]);_0x1faa5b['where']=qs[_0x2871('0x35')](_[_0x2871('0x36')](_0x305d48['query'],_0x550d3b[_0x2871('0x35')]),_0x535a30);if(_0x305d48[_0x2871('0x2b')][_0x2871('0x37')]){_0x1faa5b[_0x2871('0x38')]=_[_0x2871('0x39')](_0x1faa5b[_0x2871('0x38')],{'$or':_[_0x2871('0x2a')](_0x535a30,function(_0x3f74c8){if(_0x3f74c8['type']!==_0x2871('0x3a')){var _0x52790f={};_0x52790f[_0x3f74c8['name']]={'$like':'%'+_0x305d48['query'][_0x2871('0x37')]+'%'};return _0x52790f;}})});}_0x1faa5b=_[_0x2871('0x39')]({},_0x1faa5b,_0x305d48[_0x2871('0x3b')]);var _0x3a8d61={'where':_0x1faa5b[_0x2871('0x38')]};return db[_0x2871('0x3c')][_0x2871('0x1b')](_0x3a8d61)[_0x2871('0x22')](function(_0x12a21c){_0x5393f3['count']=_0x12a21c;if(_0x305d48[_0x2871('0x2b')]['includeAll']){_0x1faa5b['include']=[{'all':!![]}];}return db['MailServerOut'][_0x2871('0x3d')](_0x1faa5b);})[_0x2871('0x22')](function(_0x4e0b8a){_0x5393f3[_0x2871('0x3e')]=_0x4e0b8a;return _0x5393f3;})[_0x2871('0x22')](respondWithFilteredResult(_0x415856,_0x1faa5b))['catch'](handleError(_0x415856,null));};exports['show']=function(_0x3e6eb2,_0x3f2ae9){var _0x4d9ff6={'raw':!![],'where':{'id':_0x3e6eb2[_0x2871('0x3f')]['id']}},_0x3ec5c7={};_0x3ec5c7[_0x2871('0x2e')]=_['keys'](db['MailServerOut'][_0x2871('0x40')]);_0x3ec5c7[_0x2871('0x2b')]=_['keys'](_0x3e6eb2['query']);_0x3ec5c7[_0x2871('0x35')]=_[_0x2871('0x2d')](_0x3ec5c7[_0x2871('0x2e')],_0x3ec5c7['query']);_0x4d9ff6[_0x2871('0x30')]=_[_0x2871('0x2d')](_0x3ec5c7[_0x2871('0x2e')],qs[_0x2871('0x2f')](_0x3e6eb2[_0x2871('0x2b')][_0x2871('0x2f')]));_0x4d9ff6[_0x2871('0x30')]=_0x4d9ff6[_0x2871('0x30')][_0x2871('0x31')]?_0x4d9ff6[_0x2871('0x30')]:_0x3ec5c7[_0x2871('0x2e')];if(_0x3e6eb2[_0x2871('0x2b')][_0x2871('0x41')]){_0x4d9ff6[_0x2871('0x42')]=[{'all':!![]}];}_0x4d9ff6=_['merge']({},_0x4d9ff6,_0x3e6eb2[_0x2871('0x3b')]);return db[_0x2871('0x3c')][_0x2871('0x43')](_0x4d9ff6)['then'](handleEntityNotFound(_0x3f2ae9,null))[_0x2871('0x22')](respondWithResult(_0x3f2ae9,null))[_0x2871('0x44')](handleError(_0x3f2ae9,null));};exports['create']=function(_0x4b1f23,_0x35b2b3){return db['MailServerOut'][_0x2871('0x45')](_0x4b1f23['body'],{})[_0x2871('0x22')](respondWithResult(_0x35b2b3,0xc9))[_0x2871('0x44')](handleError(_0x35b2b3,null));};exports['update']=function(_0x5c9311,_0x547c61){if(_0x5c9311[_0x2871('0x46')]['id']){delete _0x5c9311[_0x2871('0x46')]['id'];}return db[_0x2871('0x3c')][_0x2871('0x43')]({'where':{'id':_0x5c9311[_0x2871('0x3f')]['id']}})[_0x2871('0x22')](handleEntityNotFound(_0x547c61,null))[_0x2871('0x22')](saveUpdates(_0x5c9311[_0x2871('0x46')],null))[_0x2871('0x22')](respondWithResult(_0x547c61,null))[_0x2871('0x44')](handleError(_0x547c61,null));};exports[_0x2871('0x47')]=function(_0x5e47a5,_0x45de89){return db['MailServerOut'][_0x2871('0x43')]({'where':{'id':_0x5e47a5[_0x2871('0x3f')]['id']}})[_0x2871('0x22')](handleEntityNotFound(_0x45de89,null))[_0x2871('0x22')](removeEntity(_0x45de89,null))['catch'](handleError(_0x45de89,null));};
\ No newline at end of file
+var _0xc43a=['include','MailServerOut','find','body','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','status','sendStatus','error','name','send','map','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filters','pick','where','VIRTUAL','filter','merge','options','includeAll','findAll','rows','catch','show','params','rawAttributes'];(function(_0x447508,_0x5bb274){var _0x18bcc1=function(_0x3565b1){while(--_0x3565b1){_0x447508['push'](_0x447508['shift']());}};_0x18bcc1(++_0x5bb274);}(_0xc43a,0xe5));var _0xac43=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc43a[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xac43('0x0'));var rimraf=require(_0xac43('0x1'));var zipdir=require(_0xac43('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xac43('0x3'));var BPromise=require(_0xac43('0x4'));var Mustache=require(_0xac43('0x5'));var util=require(_0xac43('0x6'));var path=require(_0xac43('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xac43('0x8'));var fs=require('fs');var fs_extra=require(_0xac43('0x9'));var _=require(_0xac43('0xa'));var squel=require(_0xac43('0xb'));var crypto=require(_0xac43('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xac43('0xd'));var querystring=require(_0xac43('0xe'));var Papa=require(_0xac43('0xf'));var Redis=require(_0xac43('0x10'));var authService=require(_0xac43('0x11'));var qs=require(_0xac43('0x12'));var as=require(_0xac43('0x13'));var hardwareService=require(_0xac43('0x14'));var logger=require(_0xac43('0x15'))(_0xac43('0x16'));var utils=require(_0xac43('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xac43('0x18'))['db'];function respondWithStatusCode(_0x20209b,_0x55b12d){_0x55b12d=_0x55b12d||0xcc;return function(_0x2b48d6){if(_0x2b48d6){return _0x20209b['sendStatus'](_0x55b12d);}return _0x20209b['status'](_0x55b12d)[_0xac43('0x19')]();};}function respondWithResult(_0x316cfd,_0x553c40){_0x553c40=_0x553c40||0xc8;return function(_0xd362b8){if(_0xd362b8){return _0x316cfd['status'](_0x553c40)[_0xac43('0x1a')](_0xd362b8);}};}function respondWithFilteredResult(_0xf1db14,_0x564bdd){return function(_0x2f4eb7){if(_0x2f4eb7){var _0x1f3a82=typeof _0x564bdd['offset']===_0xac43('0x1b')&&typeof _0x564bdd[_0xac43('0x1c')]==='undefined';var _0x590a49=_0x2f4eb7[_0xac43('0x1d')];var _0x4f6052=_0x1f3a82?0x0:_0x564bdd['offset'];var _0x4126af=_0x1f3a82?_0x2f4eb7['count']:_0x564bdd[_0xac43('0x1e')]+_0x564bdd[_0xac43('0x1c')];var _0x2e35c1;if(_0x4126af>=_0x590a49){_0x4126af=_0x590a49;_0x2e35c1=0xc8;}else{_0x2e35c1=0xce;}_0xf1db14['status'](_0x2e35c1);return _0xf1db14[_0xac43('0x1f')](_0xac43('0x20'),_0x4f6052+'-'+_0x4126af+'/'+_0x590a49)[_0xac43('0x1a')](_0x2f4eb7);}return null;};}function patchUpdates(_0x267642){return function(_0x26280c){try{jsonpatch[_0xac43('0x21')](_0x26280c,_0x267642,!![]);}catch(_0x1a887d){return BPromise[_0xac43('0x22')](_0x1a887d);}return _0x26280c[_0xac43('0x23')]();};}function saveUpdates(_0x287ffd,_0x43d07c){return function(_0x28ec11){if(_0x28ec11){return _0x28ec11[_0xac43('0x24')](_0x287ffd)[_0xac43('0x25')](function(_0x5ae802){return _0x5ae802;});}return null;};}function removeEntity(_0x119808,_0x46d57b){return function(_0x3405a8){if(_0x3405a8){return _0x3405a8['destroy']()[_0xac43('0x25')](function(){_0x119808[_0xac43('0x26')](0xcc)[_0xac43('0x19')]();});}};}function handleEntityNotFound(_0x1c7473,_0x58aa35){return function(_0x539778){if(!_0x539778){_0x1c7473[_0xac43('0x27')](0x194);}return _0x539778;};}function handleError(_0x1ee73a,_0x5b099c){_0x5b099c=_0x5b099c||0x1f4;return function(_0x30082e){logger[_0xac43('0x28')](_0x30082e['stack']);if(_0x30082e[_0xac43('0x29')]){delete _0x30082e['name'];}_0x1ee73a[_0xac43('0x26')](_0x5b099c)[_0xac43('0x2a')](_0x30082e);};}exports['index']=function(_0x28855e,_0x562471){var _0xd998bd={},_0x24a1c7={},_0x3f0b08={'count':0x0,'rows':[]};var _0x50452b=_[_0xac43('0x2b')](db['MailServerOut']['rawAttributes'],function(_0x800765){return{'name':_0x800765[_0xac43('0x2c')],'type':_0x800765[_0xac43('0x2d')][_0xac43('0x2e')]};});_0x24a1c7[_0xac43('0x2f')]=_[_0xac43('0x2b')](_0x50452b,_0xac43('0x29'));_0x24a1c7[_0xac43('0x30')]=_[_0xac43('0x31')](_0x28855e[_0xac43('0x30')]);_0x24a1c7['filters']=_[_0xac43('0x32')](_0x24a1c7['model'],_0x24a1c7[_0xac43('0x30')]);_0xd998bd[_0xac43('0x33')]=_[_0xac43('0x32')](_0x24a1c7['model'],qs[_0xac43('0x34')](_0x28855e['query'][_0xac43('0x34')]));_0xd998bd[_0xac43('0x33')]=_0xd998bd[_0xac43('0x33')][_0xac43('0x35')]?_0xd998bd[_0xac43('0x33')]:_0x24a1c7[_0xac43('0x2f')];if(!_0x28855e[_0xac43('0x30')][_0xac43('0x36')](_0xac43('0x37'))){_0xd998bd['limit']=qs[_0xac43('0x1c')](_0x28855e[_0xac43('0x30')][_0xac43('0x1c')]);_0xd998bd[_0xac43('0x1e')]=qs[_0xac43('0x1e')](_0x28855e['query'][_0xac43('0x1e')]);}_0xd998bd['order']=qs[_0xac43('0x38')](_0x28855e[_0xac43('0x30')][_0xac43('0x38')]);_0xd998bd['where']=qs[_0xac43('0x39')](_[_0xac43('0x3a')](_0x28855e[_0xac43('0x30')],_0x24a1c7[_0xac43('0x39')]),_0x50452b);if(_0x28855e[_0xac43('0x30')]['filter']){_0xd998bd[_0xac43('0x3b')]=_['merge'](_0xd998bd['where'],{'$or':_['map'](_0x50452b,function(_0x3c44d8){if(_0x3c44d8['type']!==_0xac43('0x3c')){var _0x3f660c={};_0x3f660c[_0x3c44d8['name']]={'$like':'%'+_0x28855e[_0xac43('0x30')][_0xac43('0x3d')]+'%'};return _0x3f660c;}})});}_0xd998bd=_[_0xac43('0x3e')]({},_0xd998bd,_0x28855e[_0xac43('0x3f')]);var _0x50fb02={'where':_0xd998bd['where']};return db['MailServerOut']['count'](_0x50fb02)[_0xac43('0x25')](function(_0x2b5911){_0x3f0b08[_0xac43('0x1d')]=_0x2b5911;if(_0x28855e[_0xac43('0x30')][_0xac43('0x40')]){_0xd998bd['include']=[{'all':!![]}];}return db['MailServerOut'][_0xac43('0x41')](_0xd998bd);})[_0xac43('0x25')](function(_0x231dc9){_0x3f0b08[_0xac43('0x42')]=_0x231dc9;return _0x3f0b08;})['then'](respondWithFilteredResult(_0x562471,_0xd998bd))[_0xac43('0x43')](handleError(_0x562471,null));};exports[_0xac43('0x44')]=function(_0x50a061,_0x118981){var _0x40c4b7={'raw':!![],'where':{'id':_0x50a061[_0xac43('0x45')]['id']}},_0x31c0c0={};_0x31c0c0[_0xac43('0x2f')]=_[_0xac43('0x31')](db['MailServerOut'][_0xac43('0x46')]);_0x31c0c0['query']=_['keys'](_0x50a061[_0xac43('0x30')]);_0x31c0c0[_0xac43('0x39')]=_[_0xac43('0x32')](_0x31c0c0[_0xac43('0x2f')],_0x31c0c0[_0xac43('0x30')]);_0x40c4b7[_0xac43('0x33')]=_[_0xac43('0x32')](_0x31c0c0['model'],qs['fields'](_0x50a061[_0xac43('0x30')][_0xac43('0x34')]));_0x40c4b7['attributes']=_0x40c4b7[_0xac43('0x33')][_0xac43('0x35')]?_0x40c4b7[_0xac43('0x33')]:_0x31c0c0[_0xac43('0x2f')];if(_0x50a061[_0xac43('0x30')]['includeAll']){_0x40c4b7[_0xac43('0x47')]=[{'all':!![]}];}_0x40c4b7=_['merge']({},_0x40c4b7,_0x50a061['options']);return db[_0xac43('0x48')][_0xac43('0x49')](_0x40c4b7)[_0xac43('0x25')](handleEntityNotFound(_0x118981,null))[_0xac43('0x25')](respondWithResult(_0x118981,null))[_0xac43('0x43')](handleError(_0x118981,null));};exports['create']=function(_0x4e15db,_0x5129b0){return db[_0xac43('0x48')]['create'](_0x4e15db[_0xac43('0x4a')],{})['then'](respondWithResult(_0x5129b0,0xc9))[_0xac43('0x43')](handleError(_0x5129b0,null));};exports[_0xac43('0x24')]=function(_0x585bb9,_0x46f05d){if(_0x585bb9['body']['id']){delete _0x585bb9['body']['id'];}return db[_0xac43('0x48')]['find']({'where':{'id':_0x585bb9[_0xac43('0x45')]['id']}})[_0xac43('0x25')](handleEntityNotFound(_0x46f05d,null))[_0xac43('0x25')](saveUpdates(_0x585bb9[_0xac43('0x4a')],null))['then'](respondWithResult(_0x46f05d,null))[_0xac43('0x43')](handleError(_0x46f05d,null));};exports['destroy']=function(_0xc14576,_0x2b6708){return db[_0xac43('0x48')][_0xac43('0x49')]({'where':{'id':_0xc14576[_0xac43('0x45')]['id']}})[_0xac43('0x25')](handleEntityNotFound(_0x2b6708,null))[_0xac43('0x25')](removeEntity(_0x2b6708,null))[_0xac43('0x43')](handleError(_0x2b6708,null));};
\ No newline at end of file
index c95a945..e633f74 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb3bc=['rimraf','../../config/environment','./mailServerOut.attributes','exports','MailServerOut','mail_servers_out','lodash','api','moment','bluebird','request-promise','path'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xb3bc,0x126));var _0xcb3b=function(_0x980070,_0x3ec3ff){_0x980070=_0x980070-0x0;var _0x7e5509=_0xb3bc[_0x980070];return _0x7e5509;};'use strict';var _=require(_0xcb3b('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xcb3b('0x1'));var moment=require(_0xcb3b('0x2'));var BPromise=require(_0xcb3b('0x3'));var rp=require(_0xcb3b('0x4'));var fs=require('fs');var path=require(_0xcb3b('0x5'));var rimraf=require(_0xcb3b('0x6'));var config=require(_0xcb3b('0x7'));var attributes=require(_0xcb3b('0x8'));module[_0xcb3b('0x9')]=function(_0x5d6a77,_0x30b903){return _0x5d6a77['define'](_0xcb3b('0xa'),attributes,{'tableName':_0xcb3b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x74f6=['moment','bluebird','rimraf','../../config/environment','./mailServerOut.attributes','exports','define','MailServerOut','mail_servers_out','lodash','util','../../config/logger'];(function(_0x24a478,_0x512c3c){var _0x35120e=function(_0x4b739f){while(--_0x4b739f){_0x24a478['push'](_0x24a478['shift']());}};_0x35120e(++_0x512c3c);}(_0x74f6,0x11d));var _0x674f=function(_0x35c77a,_0x3fc993){_0x35c77a=_0x35c77a-0x0;var _0x571eaf=_0x74f6[_0x35c77a];return _0x571eaf;};'use strict';var _=require(_0x674f('0x0'));var util=require(_0x674f('0x1'));var logger=require(_0x674f('0x2'))('api');var moment=require(_0x674f('0x3'));var BPromise=require(_0x674f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x674f('0x5'));var config=require(_0x674f('0x6'));var attributes=require(_0x674f('0x7'));module[_0x674f('0x8')]=function(_0x4a5954,_0xe1b3a3){return _0x4a5954[_0x674f('0x9')](_0x674f('0xa'),attributes,{'tableName':_0x674f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 1dca072..697677f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1261=['then','info','MailServerOut,\x20%s,\x20%s','request\x20sent','MailServerOut,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x28e018,_0xc5620b){var _0x22a148=function(_0x2d5aaa){while(--_0x2d5aaa){_0x28e018['push'](_0x28e018['shift']());}};_0x22a148(++_0xc5620b);}(_0x1261,0x144));var _0x1126=function(_0x170eb7,_0x1ac59b){_0x170eb7=_0x170eb7-0x0;var _0x4dfeac=_0x1261[_0x170eb7];return _0x4dfeac;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('MailServerOut,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});}
\ No newline at end of file
+var _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','MailServerOut,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0xcb85f2,_0x1291a0){var _0x8a89de=function(_0x11a48e){while(--_0x11a48e){_0xcb85f2['push'](_0xcb85f2['shift']());}};_0x8a89de(++_0x1291a0);}(_0xdb28,0x106));var _0x8db2=function(_0x475597,_0x58645c){_0x475597=_0x475597-0x0;var _0x38bff7=_0xdb28[_0x475597];return _0x38bff7;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});}
\ No newline at end of file
index 6be4dbe..fd76e92 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6383=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','create','update','delete','destroy','multer','util'];(function(_0x4c66fa,_0x2c942d){var _0x3a97ec=function(_0x5a0396){while(--_0x5a0396){_0x4c66fa['push'](_0x4c66fa['shift']());}};_0x3a97ec(++_0x2c942d);}(_0x6383,0x83));var _0x3638=function(_0x342dd4,_0x5d972e){_0x342dd4=_0x342dd4-0x0;var _0x485f2a=_0x6383[_0x342dd4];return _0x485f2a;};'use strict';var multer=require(_0x3638('0x0'));var util=require(_0x3638('0x1'));var path=require(_0x3638('0x2'));var timeout=require(_0x3638('0x3'));var express=require('express');var router=express[_0x3638('0x4')]();var fs_extra=require(_0x3638('0x5'));var auth=require(_0x3638('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x3638('0x7'));var controller=require('./mailSubstatus.controller');router[_0x3638('0x8')]('/',auth[_0x3638('0x9')](),controller[_0x3638('0xa')]);router[_0x3638('0x8')](_0x3638('0xb'),auth[_0x3638('0x9')](),controller[_0x3638('0xc')]);router[_0x3638('0x8')](_0x3638('0xd'),auth[_0x3638('0x9')](),controller[_0x3638('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x3638('0xf')]);router['put'](_0x3638('0xd'),auth[_0x3638('0x9')](),controller[_0x3638('0x10')]);router[_0x3638('0x11')](_0x3638('0xd'),auth[_0x3638('0x9')](),controller[_0x3638('0x12')]);module['exports']=router;
\ No newline at end of file
+var _0x943e=['../../components/interaction/service','../../config/environment','./mailSubstatus.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','create','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x21c28b,_0x158a0e){var _0x1ffc57=function(_0x381b56){while(--_0x381b56){_0x21c28b['push'](_0x21c28b['shift']());}};_0x1ffc57(++_0x158a0e);}(_0x943e,0xc2));var _0xe943=function(_0x1ec0b1,_0x1b2c4c){_0x1ec0b1=_0x1ec0b1-0x0;var _0xb892fb=_0x943e[_0x1ec0b1];return _0xb892fb;};'use strict';var multer=require(_0xe943('0x0'));var util=require('util');var path=require(_0xe943('0x1'));var timeout=require(_0xe943('0x2'));var express=require(_0xe943('0x3'));var router=express[_0xe943('0x4')]();var fs_extra=require(_0xe943('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xe943('0x6'));var config=require(_0xe943('0x7'));var controller=require(_0xe943('0x8'));router[_0xe943('0x9')]('/',auth['isAuthenticated'](),controller[_0xe943('0xa')]);router[_0xe943('0x9')](_0xe943('0xb'),auth[_0xe943('0xc')](),controller[_0xe943('0xd')]);router[_0xe943('0x9')](_0xe943('0xe'),auth[_0xe943('0xc')](),controller[_0xe943('0xf')]);router[_0xe943('0x10')]('/',auth[_0xe943('0xc')](),controller[_0xe943('0x11')]);router['put'](_0xe943('0xe'),auth[_0xe943('0xc')](),controller['update']);router[_0xe943('0x12')](_0xe943('0xe'),auth[_0xe943('0xc')](),controller[_0xe943('0x13')]);module['exports']=router;
\ No newline at end of file
index 5a8dbe0..92a2a9d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xed1c=['sequelize','exports'];(function(_0x1eae21,_0x13cf05){var _0x3dd3f8=function(_0x597a87){while(--_0x597a87){_0x1eae21['push'](_0x1eae21['shift']());}};_0x3dd3f8(++_0x13cf05);}(_0xed1c,0xe4));var _0xced1=function(_0x1c4e9e,_0x53a357){_0x1c4e9e=_0x1c4e9e-0x0;var _0x1663d9=_0xed1c[_0x1c4e9e];return _0x1663d9;};'use strict';var Sequelize=require(_0xced1('0x0'));module[_0xced1('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xfc46=['name','sequelize','STRING'];(function(_0x40240a,_0x25f72f){var _0xc49eb2=function(_0x38d5f2){while(--_0x38d5f2){_0x40240a['push'](_0x40240a['shift']());}};_0xc49eb2(++_0x25f72f);}(_0xfc46,0x9a));var _0x6fc4=function(_0xd2d54,_0x5329f7){_0xd2d54=_0xd2d54-0x0;var _0x78b113=_0xfc46[_0xd2d54];return _0x78b113;};'use strict';var Sequelize=require(_0x6fc4('0x0'));module['exports']={'name':{'type':Sequelize[_0x6fc4('0x1')],'unique':_0x6fc4('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x6fc4('0x1')]}};
\ No newline at end of file
index bc3799c..eefcf37 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc367=['key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','findAll','rows','show','params','includeAll','include','find','create','body','catch','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','end','stack','name','MailSubstatus','rawAttributes','fieldName','type'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xc367,0x67));var _0x7c36=function(_0x41def0,_0x5ebd2d){_0x41def0=_0x41def0-0x0;var _0x5527cb=_0xc367[_0x41def0];return _0x5527cb;};'use strict';var emlformat=require(_0x7c36('0x0'));var rimraf=require(_0x7c36('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7c36('0x2'));var rp=require(_0x7c36('0x3'));var moment=require(_0x7c36('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x7c36('0x5'));var util=require('util');var path=require(_0x7c36('0x6'));var sox=require('sox');var csv=require(_0x7c36('0x7'));var ejs=require(_0x7c36('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7c36('0x9'));var squel=require('squel');var crypto=require(_0x7c36('0xa'));var jsforce=require(_0x7c36('0xb'));var deskjs=require(_0x7c36('0xc'));var toCsv=require(_0x7c36('0x7'));var querystring=require(_0x7c36('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x7c36('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x7c36('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7c36('0x10'))(_0x7c36('0x11'));var utils=require('../../config/utils');var config=require(_0x7c36('0x12'));var licenseUtil=require(_0x7c36('0x13'));var db=require(_0x7c36('0x14'))['db'];function respondWithStatusCode(_0x3c90e2,_0x14ea5e){_0x14ea5e=_0x14ea5e||0xcc;return function(_0x42d58d){if(_0x42d58d){return _0x3c90e2[_0x7c36('0x15')](_0x14ea5e);}return _0x3c90e2[_0x7c36('0x16')](_0x14ea5e)['end']();};}function respondWithResult(_0x527b30,_0xc4b7a0){_0xc4b7a0=_0xc4b7a0||0xc8;return function(_0x1fa1be){if(_0x1fa1be){return _0x527b30[_0x7c36('0x16')](_0xc4b7a0)['json'](_0x1fa1be);}};}function respondWithFilteredResult(_0x4105f9,_0x4aacd4){return function(_0x44ecd7){if(_0x44ecd7){var _0x23e609=typeof _0x4aacd4[_0x7c36('0x17')]===_0x7c36('0x18')&&typeof _0x4aacd4[_0x7c36('0x19')]===_0x7c36('0x18');var _0xbc79a=_0x44ecd7[_0x7c36('0x1a')];var _0x1b611c=_0x23e609?0x0:_0x4aacd4[_0x7c36('0x17')];var _0x3448a0=_0x23e609?_0x44ecd7[_0x7c36('0x1a')]:_0x4aacd4[_0x7c36('0x17')]+_0x4aacd4[_0x7c36('0x19')];var _0x413a30;if(_0x3448a0>=_0xbc79a){_0x3448a0=_0xbc79a;_0x413a30=0xc8;}else{_0x413a30=0xce;}_0x4105f9['status'](_0x413a30);return _0x4105f9[_0x7c36('0x1b')](_0x7c36('0x1c'),_0x1b611c+'-'+_0x3448a0+'/'+_0xbc79a)[_0x7c36('0x1d')](_0x44ecd7);}return null;};}function patchUpdates(_0x23ba2d){return function(_0x4ca569){try{jsonpatch[_0x7c36('0x1e')](_0x4ca569,_0x23ba2d,!![]);}catch(_0x5ee12d){return BPromise[_0x7c36('0x1f')](_0x5ee12d);}return _0x4ca569[_0x7c36('0x20')]();};}function saveUpdates(_0xa4993b,_0x5179c6){return function(_0x2df780){if(_0x2df780){return _0x2df780[_0x7c36('0x21')](_0xa4993b)[_0x7c36('0x22')](function(_0x326116){return _0x326116;});}return null;};}function removeEntity(_0x5abb11,_0x347e2a){return function(_0x5768ff){if(_0x5768ff){return _0x5768ff[_0x7c36('0x23')]()[_0x7c36('0x22')](function(){_0x5abb11[_0x7c36('0x16')](0xcc)[_0x7c36('0x24')]();});}};}function handleEntityNotFound(_0x21b8e0,_0xad0cf){return function(_0x5f56af){if(!_0x5f56af){_0x21b8e0[_0x7c36('0x15')](0x194);}return _0x5f56af;};}function handleError(_0x203fcf,_0x8b996e){_0x8b996e=_0x8b996e||0x1f4;return function(_0x1eb8f1){logger['error'](_0x1eb8f1[_0x7c36('0x25')]);if(_0x1eb8f1[_0x7c36('0x26')]){delete _0x1eb8f1[_0x7c36('0x26')];}_0x203fcf[_0x7c36('0x16')](_0x8b996e)['send'](_0x1eb8f1);};}exports['index']=function(_0x54fb51,_0x1fd7c9){var _0x276481={},_0x444179={},_0x58291c={'count':0x0,'rows':[]};var _0x12e426=_['map'](db[_0x7c36('0x27')][_0x7c36('0x28')],function(_0x4d7ae4){return{'name':_0x4d7ae4[_0x7c36('0x29')],'type':_0x4d7ae4[_0x7c36('0x2a')][_0x7c36('0x2b')]};});_0x444179[_0x7c36('0x2c')]=_[_0x7c36('0x2d')](_0x12e426,'name');_0x444179[_0x7c36('0x2e')]=_[_0x7c36('0x2f')](_0x54fb51[_0x7c36('0x2e')]);_0x444179['filters']=_[_0x7c36('0x30')](_0x444179[_0x7c36('0x2c')],_0x444179[_0x7c36('0x2e')]);_0x276481[_0x7c36('0x31')]=_['intersection'](_0x444179[_0x7c36('0x2c')],qs[_0x7c36('0x32')](_0x54fb51['query'][_0x7c36('0x32')]));_0x276481[_0x7c36('0x31')]=_0x276481['attributes'][_0x7c36('0x33')]?_0x276481[_0x7c36('0x31')]:_0x444179[_0x7c36('0x2c')];if(!_0x54fb51[_0x7c36('0x2e')][_0x7c36('0x34')]('nolimit')){_0x276481['limit']=qs[_0x7c36('0x19')](_0x54fb51['query'][_0x7c36('0x19')]);_0x276481[_0x7c36('0x17')]=qs[_0x7c36('0x17')](_0x54fb51[_0x7c36('0x2e')][_0x7c36('0x17')]);}_0x276481[_0x7c36('0x35')]=qs[_0x7c36('0x36')](_0x54fb51['query']['sort']);_0x276481['where']=qs[_0x7c36('0x37')](_[_0x7c36('0x38')](_0x54fb51[_0x7c36('0x2e')],_0x444179[_0x7c36('0x37')]),_0x12e426);if(_0x54fb51[_0x7c36('0x2e')][_0x7c36('0x39')]){_0x276481[_0x7c36('0x3a')]=_[_0x7c36('0x3b')](_0x276481[_0x7c36('0x3a')],{'$or':_[_0x7c36('0x2d')](_0x12e426,function(_0xba5979){if(_0xba5979[_0x7c36('0x2a')]!==_0x7c36('0x3c')){var _0x4240d1={};_0x4240d1[_0xba5979[_0x7c36('0x26')]]={'$like':'%'+_0x54fb51[_0x7c36('0x2e')][_0x7c36('0x39')]+'%'};return _0x4240d1;}})});}_0x276481=_['merge']({},_0x276481,_0x54fb51[_0x7c36('0x3d')]);var _0x4ff8a8={'where':_0x276481[_0x7c36('0x3a')]};return db[_0x7c36('0x27')][_0x7c36('0x1a')](_0x4ff8a8)['then'](function(_0x5b766f){_0x58291c[_0x7c36('0x1a')]=_0x5b766f;if(_0x54fb51[_0x7c36('0x2e')]['includeAll']){_0x276481['include']=[{'all':!![]}];}return db[_0x7c36('0x27')][_0x7c36('0x3e')](_0x276481);})[_0x7c36('0x22')](function(_0x148497){_0x58291c[_0x7c36('0x3f')]=_0x148497;return _0x58291c;})[_0x7c36('0x22')](respondWithFilteredResult(_0x1fd7c9,_0x276481))['catch'](handleError(_0x1fd7c9,null));};exports[_0x7c36('0x40')]=function(_0x4d2d49,_0x654cd2){var _0x3b1e96={'raw':!![],'where':{'id':_0x4d2d49[_0x7c36('0x41')]['id']}},_0xf65906={};_0xf65906[_0x7c36('0x2c')]=_[_0x7c36('0x2f')](db[_0x7c36('0x27')][_0x7c36('0x28')]);_0xf65906[_0x7c36('0x2e')]=_[_0x7c36('0x2f')](_0x4d2d49[_0x7c36('0x2e')]);_0xf65906[_0x7c36('0x37')]=_[_0x7c36('0x30')](_0xf65906[_0x7c36('0x2c')],_0xf65906[_0x7c36('0x2e')]);_0x3b1e96[_0x7c36('0x31')]=_[_0x7c36('0x30')](_0xf65906[_0x7c36('0x2c')],qs[_0x7c36('0x32')](_0x4d2d49['query'][_0x7c36('0x32')]));_0x3b1e96[_0x7c36('0x31')]=_0x3b1e96[_0x7c36('0x31')][_0x7c36('0x33')]?_0x3b1e96[_0x7c36('0x31')]:_0xf65906[_0x7c36('0x2c')];if(_0x4d2d49[_0x7c36('0x2e')][_0x7c36('0x42')]){_0x3b1e96[_0x7c36('0x43')]=[{'all':!![]}];}_0x3b1e96=_[_0x7c36('0x3b')]({},_0x3b1e96,_0x4d2d49['options']);return db[_0x7c36('0x27')][_0x7c36('0x44')](_0x3b1e96)[_0x7c36('0x22')](handleEntityNotFound(_0x654cd2,null))[_0x7c36('0x22')](respondWithResult(_0x654cd2,null))['catch'](handleError(_0x654cd2,null));};exports[_0x7c36('0x45')]=function(_0x1a9a39,_0x219d35){return db[_0x7c36('0x27')]['create'](_0x1a9a39[_0x7c36('0x46')],{})[_0x7c36('0x22')](respondWithResult(_0x219d35,0xc9))[_0x7c36('0x47')](handleError(_0x219d35,null));};exports[_0x7c36('0x21')]=function(_0x301ad4,_0x38ca05){if(_0x301ad4['body']['id']){delete _0x301ad4[_0x7c36('0x46')]['id'];}return db['MailSubstatus']['find']({'where':{'id':_0x301ad4[_0x7c36('0x41')]['id']}})[_0x7c36('0x22')](handleEntityNotFound(_0x38ca05,null))[_0x7c36('0x22')](saveUpdates(_0x301ad4['body'],null))[_0x7c36('0x22')](respondWithResult(_0x38ca05,null))[_0x7c36('0x47')](handleError(_0x38ca05,null));};exports[_0x7c36('0x23')]=function(_0x21dd50,_0xea8e97){return db[_0x7c36('0x27')][_0x7c36('0x44')]({'where':{'id':_0x21dd50[_0x7c36('0x41')]['id']}})[_0x7c36('0x22')](handleEntityNotFound(_0xea8e97,null))[_0x7c36('0x22')](removeEntity(_0xea8e97,null))[_0x7c36('0x47')](handleError(_0xea8e97,null));};exports[_0x7c36('0x48')]=function(_0x4dbaee,_0x43198c){return db[_0x7c36('0x27')][_0x7c36('0x48')]()['then'](respondWithResult(_0x43198c,null))[_0x7c36('0x47')](handleError(_0x43198c,null));};
\ No newline at end of file
+var _0x5dbf=['update','then','destroy','error','stack','name','index','MailSubstatus','rawAttributes','fieldName','type','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','filter','where','merge','map','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','describe','rimraf','fast-json-patch','moment','mustache','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','count','limit','set','Content-Range','apply'];(function(_0x162939,_0x56203f){var _0x5bb0d8=function(_0x17d6d1){while(--_0x17d6d1){_0x162939['push'](_0x162939['shift']());}};_0x5bb0d8(++_0x56203f);}(_0x5dbf,0x1c5));var _0xf5db=function(_0x18d56e,_0x147bc4){_0x18d56e=_0x18d56e-0x0;var _0x58753f=_0x5dbf[_0x18d56e];return _0x58753f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf5db('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf5db('0x1'));var rp=require('request-promise');var moment=require(_0xf5db('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xf5db('0x3'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xf5db('0x4'));var ejs=require(_0xf5db('0x5'));var fs=require('fs');var fs_extra=require(_0xf5db('0x6'));var _=require(_0xf5db('0x7'));var squel=require('squel');var crypto=require(_0xf5db('0x8'));var jsforce=require('jsforce');var deskjs=require(_0xf5db('0x9'));var toCsv=require(_0xf5db('0x4'));var querystring=require('querystring');var Papa=require(_0xf5db('0xa'));var Redis=require(_0xf5db('0xb'));var authService=require(_0xf5db('0xc'));var qs=require('../../components/parsers/qs');var as=require(_0xf5db('0xd'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf5db('0xe'))(_0xf5db('0xf'));var utils=require(_0xf5db('0x10'));var config=require(_0xf5db('0x11'));var licenseUtil=require('../../config/license/util');var db=require(_0xf5db('0x12'))['db'];function respondWithStatusCode(_0x4fd934,_0xaa9569){_0xaa9569=_0xaa9569||0xcc;return function(_0x39e4b6){if(_0x39e4b6){return _0x4fd934[_0xf5db('0x13')](_0xaa9569);}return _0x4fd934[_0xf5db('0x14')](_0xaa9569)[_0xf5db('0x15')]();};}function respondWithResult(_0x329059,_0x1f03b1){_0x1f03b1=_0x1f03b1||0xc8;return function(_0x4298a9){if(_0x4298a9){return _0x329059[_0xf5db('0x14')](_0x1f03b1)[_0xf5db('0x16')](_0x4298a9);}};}function respondWithFilteredResult(_0x2f3baa,_0x380ec6){return function(_0xc29dae){if(_0xc29dae){var _0x24408e=typeof _0x380ec6[_0xf5db('0x17')]===_0xf5db('0x18')&&typeof _0x380ec6['limit']===_0xf5db('0x18');var _0x4f693e=_0xc29dae[_0xf5db('0x19')];var _0x8d2dd2=_0x24408e?0x0:_0x380ec6[_0xf5db('0x17')];var _0x49d67c=_0x24408e?_0xc29dae['count']:_0x380ec6['offset']+_0x380ec6[_0xf5db('0x1a')];var _0x1360b2;if(_0x49d67c>=_0x4f693e){_0x49d67c=_0x4f693e;_0x1360b2=0xc8;}else{_0x1360b2=0xce;}_0x2f3baa[_0xf5db('0x14')](_0x1360b2);return _0x2f3baa[_0xf5db('0x1b')](_0xf5db('0x1c'),_0x8d2dd2+'-'+_0x49d67c+'/'+_0x4f693e)['json'](_0xc29dae);}return null;};}function patchUpdates(_0x1af98a){return function(_0x29b897){try{jsonpatch[_0xf5db('0x1d')](_0x29b897,_0x1af98a,!![]);}catch(_0x1a2448){return BPromise['reject'](_0x1a2448);}return _0x29b897['save']();};}function saveUpdates(_0x3f2789,_0x144da9){return function(_0x20cab7){if(_0x20cab7){return _0x20cab7[_0xf5db('0x1e')](_0x3f2789)[_0xf5db('0x1f')](function(_0x27b692){return _0x27b692;});}return null;};}function removeEntity(_0x5d3725,_0x1ba985){return function(_0x114719){if(_0x114719){return _0x114719[_0xf5db('0x20')]()[_0xf5db('0x1f')](function(){_0x5d3725[_0xf5db('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5a57d6,_0x5c3898){return function(_0x4de1b8){if(!_0x4de1b8){_0x5a57d6[_0xf5db('0x13')](0x194);}return _0x4de1b8;};}function handleError(_0x1391ea,_0x5a374e){_0x5a374e=_0x5a374e||0x1f4;return function(_0x187564){logger[_0xf5db('0x21')](_0x187564[_0xf5db('0x22')]);if(_0x187564[_0xf5db('0x23')]){delete _0x187564[_0xf5db('0x23')];}_0x1391ea[_0xf5db('0x14')](_0x5a374e)['send'](_0x187564);};}exports[_0xf5db('0x24')]=function(_0x43b346,_0x538507){var _0x457da8={},_0x4a397b={},_0x43f188={'count':0x0,'rows':[]};var _0x55195e=_['map'](db[_0xf5db('0x25')][_0xf5db('0x26')],function(_0x6fdb0f){return{'name':_0x6fdb0f[_0xf5db('0x27')],'type':_0x6fdb0f[_0xf5db('0x28')]['key']};});_0x4a397b['model']=_['map'](_0x55195e,'name');_0x4a397b[_0xf5db('0x29')]=_[_0xf5db('0x2a')](_0x43b346['query']);_0x4a397b[_0xf5db('0x2b')]=_[_0xf5db('0x2c')](_0x4a397b[_0xf5db('0x2d')],_0x4a397b[_0xf5db('0x29')]);_0x457da8['attributes']=_[_0xf5db('0x2c')](_0x4a397b['model'],qs['fields'](_0x43b346[_0xf5db('0x29')][_0xf5db('0x2e')]));_0x457da8[_0xf5db('0x2f')]=_0x457da8[_0xf5db('0x2f')][_0xf5db('0x30')]?_0x457da8[_0xf5db('0x2f')]:_0x4a397b[_0xf5db('0x2d')];if(!_0x43b346['query'][_0xf5db('0x31')]('nolimit')){_0x457da8[_0xf5db('0x1a')]=qs[_0xf5db('0x1a')](_0x43b346[_0xf5db('0x29')][_0xf5db('0x1a')]);_0x457da8[_0xf5db('0x17')]=qs[_0xf5db('0x17')](_0x43b346[_0xf5db('0x29')][_0xf5db('0x17')]);}_0x457da8[_0xf5db('0x32')]=qs[_0xf5db('0x33')](_0x43b346[_0xf5db('0x29')][_0xf5db('0x33')]);_0x457da8['where']=qs[_0xf5db('0x2b')](_['pick'](_0x43b346[_0xf5db('0x29')],_0x4a397b[_0xf5db('0x2b')]),_0x55195e);if(_0x43b346['query'][_0xf5db('0x34')]){_0x457da8[_0xf5db('0x35')]=_[_0xf5db('0x36')](_0x457da8[_0xf5db('0x35')],{'$or':_[_0xf5db('0x37')](_0x55195e,function(_0x24b549){if(_0x24b549['type']!==_0xf5db('0x38')){var _0x3a2173={};_0x3a2173[_0x24b549[_0xf5db('0x23')]]={'$like':'%'+_0x43b346[_0xf5db('0x29')][_0xf5db('0x34')]+'%'};return _0x3a2173;}})});}_0x457da8=_[_0xf5db('0x36')]({},_0x457da8,_0x43b346[_0xf5db('0x39')]);var _0x4c042e={'where':_0x457da8['where']};return db['MailSubstatus'][_0xf5db('0x19')](_0x4c042e)[_0xf5db('0x1f')](function(_0x38c86f){_0x43f188[_0xf5db('0x19')]=_0x38c86f;if(_0x43b346['query']['includeAll']){_0x457da8[_0xf5db('0x3a')]=[{'all':!![]}];}return db['MailSubstatus'][_0xf5db('0x3b')](_0x457da8);})[_0xf5db('0x1f')](function(_0x56f2e9){_0x43f188[_0xf5db('0x3c')]=_0x56f2e9;return _0x43f188;})[_0xf5db('0x1f')](respondWithFilteredResult(_0x538507,_0x457da8))[_0xf5db('0x3d')](handleError(_0x538507,null));};exports[_0xf5db('0x3e')]=function(_0x5b9746,_0x1505bd){var _0x2baba5={'raw':!![],'where':{'id':_0x5b9746[_0xf5db('0x3f')]['id']}},_0x59604f={};_0x59604f[_0xf5db('0x2d')]=_[_0xf5db('0x2a')](db[_0xf5db('0x25')]['rawAttributes']);_0x59604f[_0xf5db('0x29')]=_[_0xf5db('0x2a')](_0x5b9746['query']);_0x59604f[_0xf5db('0x2b')]=_[_0xf5db('0x2c')](_0x59604f[_0xf5db('0x2d')],_0x59604f[_0xf5db('0x29')]);_0x2baba5[_0xf5db('0x2f')]=_[_0xf5db('0x2c')](_0x59604f[_0xf5db('0x2d')],qs[_0xf5db('0x2e')](_0x5b9746[_0xf5db('0x29')][_0xf5db('0x2e')]));_0x2baba5['attributes']=_0x2baba5[_0xf5db('0x2f')][_0xf5db('0x30')]?_0x2baba5[_0xf5db('0x2f')]:_0x59604f[_0xf5db('0x2d')];if(_0x5b9746[_0xf5db('0x29')][_0xf5db('0x40')]){_0x2baba5[_0xf5db('0x3a')]=[{'all':!![]}];}_0x2baba5=_[_0xf5db('0x36')]({},_0x2baba5,_0x5b9746[_0xf5db('0x39')]);return db[_0xf5db('0x25')][_0xf5db('0x41')](_0x2baba5)['then'](handleEntityNotFound(_0x1505bd,null))[_0xf5db('0x1f')](respondWithResult(_0x1505bd,null))[_0xf5db('0x3d')](handleError(_0x1505bd,null));};exports[_0xf5db('0x42')]=function(_0x2a46c8,_0x4ce531){return db['MailSubstatus']['create'](_0x2a46c8[_0xf5db('0x43')],{})[_0xf5db('0x1f')](respondWithResult(_0x4ce531,0xc9))[_0xf5db('0x3d')](handleError(_0x4ce531,null));};exports[_0xf5db('0x1e')]=function(_0x2dd5bb,_0x5e966a){if(_0x2dd5bb[_0xf5db('0x43')]['id']){delete _0x2dd5bb['body']['id'];}return db['MailSubstatus'][_0xf5db('0x41')]({'where':{'id':_0x2dd5bb[_0xf5db('0x3f')]['id']}})[_0xf5db('0x1f')](handleEntityNotFound(_0x5e966a,null))['then'](saveUpdates(_0x2dd5bb[_0xf5db('0x43')],null))['then'](respondWithResult(_0x5e966a,null))[_0xf5db('0x3d')](handleError(_0x5e966a,null));};exports[_0xf5db('0x20')]=function(_0x3e879c,_0x4e7aed){return db[_0xf5db('0x25')]['find']({'where':{'id':_0x3e879c[_0xf5db('0x3f')]['id']}})[_0xf5db('0x1f')](handleEntityNotFound(_0x4e7aed,null))[_0xf5db('0x1f')](removeEntity(_0x4e7aed,null))[_0xf5db('0x3d')](handleError(_0x4e7aed,null));};exports[_0xf5db('0x44')]=function(_0xa529d3,_0x4fab7a){return db[_0xf5db('0x25')][_0xf5db('0x44')]()[_0xf5db('0x1f')](respondWithResult(_0x4fab7a,null))[_0xf5db('0x3d')](handleError(_0x4fab7a,null));};
\ No newline at end of file
index 3a76ae8..607cdd9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc552=['setMaxListeners','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0xc552,0x8e));var _0x2c55=function(_0x4697fa,_0x21c841){_0x4697fa=_0x4697fa-0x0;var _0x390950=_0xc552[_0x4697fa];return _0x390950;};'use strict';var EventEmitter=require(_0x2c55('0x0'));var MailSubstatus=require(_0x2c55('0x1'))['db']['MailSubstatus'];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0x2c55('0x2')](0x0);var events={'afterUpdate':'update'};function emitEvent(_0x2daf09){return function(_0x2805ea,_0x5839f6,_0x1172ac){MailSubstatusEvents['emit'](_0x2daf09+':'+_0x2805ea['id'],_0x2805ea);MailSubstatusEvents[_0x2c55('0x3')](_0x2daf09,_0x2805ea);_0x1172ac(null);};}for(var e in events){if(events[_0x2c55('0x4')](e)){var event=events[e];MailSubstatus['hook'](e,emitEvent(event));}}module[_0x2c55('0x5')]=MailSubstatusEvents;
\ No newline at end of file
+var _0xe877=['MailSubstatus','setMaxListeners','update','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0x534565,_0x3b8611){var _0x2c110f=function(_0x25eba0){while(--_0x25eba0){_0x534565['push'](_0x534565['shift']());}};_0x2c110f(++_0x3b8611);}(_0xe877,0x1d4));var _0x7e87=function(_0xc7b670,_0xa03560){_0xc7b670=_0xc7b670-0x0;var _0x1179e2=_0xe877[_0xc7b670];return _0x1179e2;};'use strict';var EventEmitter=require('events');var MailSubstatus=require(_0x7e87('0x0'))['db'][_0x7e87('0x1')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0x7e87('0x2')](0x0);var events={'afterUpdate':_0x7e87('0x3')};function emitEvent(_0x496429){return function(_0x266ad7,_0xde186,_0x20093f){MailSubstatusEvents['emit'](_0x496429+':'+_0x266ad7['id'],_0x266ad7);MailSubstatusEvents['emit'](_0x496429,_0x266ad7);_0x20093f(null);};}for(var e in events){if(events[_0x7e87('0x4')](e)){var event=events[e];MailSubstatus[_0x7e87('0x5')](e,emitEvent(event));}}module[_0x7e87('0x6')]=MailSubstatusEvents;
\ No newline at end of file
index e7db964..7d2b43c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x783a=['MailSubstatus','mail_substatuses','Condition','update','name','mailSubstatus','_previousDataValues','then','./mailSubstatus.attributes','exports','models','define'];(function(_0x1f0603,_0x33299c){var _0xcd6984=function(_0x22aae4){while(--_0x22aae4){_0x1f0603['push'](_0x1f0603['shift']());}};_0xcd6984(++_0x33299c);}(_0x783a,0x140));var _0xa783=function(_0x31b350,_0x390f8e){_0x31b350=_0x31b350-0x0;var _0x236041=_0x783a[_0x31b350];return _0x236041;};'use strict';var attributes=require(_0xa783('0x0'));module[_0xa783('0x1')]=function(_0xaaeac0){var _0x21a34f=_0xaaeac0[_0xa783('0x2')];return _0xaaeac0[_0xa783('0x3')](_0xa783('0x4'),attributes,{'tableName':_0xa783('0x5'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x1b2d21,_0x1ba503,_0x25c996){return _0x21a34f[_0xa783('0x6')][_0xa783('0x7')]({'value':_0x1b2d21[_0xa783('0x8')]},{'where':{'field':_0xa783('0x9'),'value':_0x1b2d21[_0xa783('0xa')][_0xa783('0x8')]}})[_0xa783('0xb')](function(){_0x25c996();})['catch'](function(_0x39d35d){_0x25c996(_0x39d35d);});}}});};
\ No newline at end of file
+var _0xb83b=['then','catch','exports','define','MailSubstatus','mail_substatuses','Condition','name','mailSubstatus','_previousDataValues'];(function(_0x3c22e0,_0x1dc6ea){var _0x215811=function(_0x1b453c){while(--_0x1b453c){_0x3c22e0['push'](_0x3c22e0['shift']());}};_0x215811(++_0x1dc6ea);}(_0xb83b,0xca));var _0xbb83=function(_0x4f881d,_0x44766e){_0x4f881d=_0x4f881d-0x0;var _0x46da1c=_0xb83b[_0x4f881d];return _0x46da1c;};'use strict';var attributes=require('./mailSubstatus.attributes');module[_0xbb83('0x0')]=function(_0x44a900){var _0x5940d0=_0x44a900['models'];return _0x44a900[_0xbb83('0x1')](_0xbb83('0x2'),attributes,{'tableName':_0xbb83('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x57729b,_0x268480,_0x46477c){return _0x5940d0[_0xbb83('0x4')]['update']({'value':_0x57729b[_0xbb83('0x5')]},{'where':{'field':_0xbb83('0x6'),'value':_0x57729b[_0xbb83('0x7')]['name']}})[_0xbb83('0x8')](function(){_0x46477c();})[_0xbb83('0x9')](function(_0x2fa272){_0x46477c(_0x2fa272);});}}});};
\ No newline at end of file
index a91ee8f..a6ff18b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf596=['message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','http','then','info','request\x20sent','debug','stringify','error','code','MailSubstatus,\x20%s,\x20%s'];(function(_0x4d3983,_0x4eca6d){var _0x55e6c5=function(_0x2c1acb){while(--_0x2c1acb){_0x4d3983['push'](_0x4d3983['shift']());}};_0x55e6c5(++_0x4eca6d);}(_0xf596,0xa2));var _0x6f59=function(_0x128c31,_0x22a5b3){_0x128c31=_0x128c31-0x0;var _0x328b91=_0xf596[_0x128c31];return _0x328b91;};'use strict';var _=require(_0x6f59('0x0'));var util=require(_0x6f59('0x1'));var moment=require(_0x6f59('0x2'));var BPromise=require(_0x6f59('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6f59('0x4'));var db=require(_0x6f59('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x6f59('0x6'))(_0x6f59('0x7'));var config=require('../../config/environment');var jayson=require(_0x6f59('0x8'));var client=jayson['client'][_0x6f59('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x273f7f,_0x268c55,_0x4d28bb){return new BPromise(function(_0x52d912,_0x17ddc6){return client['request'](_0x273f7f,_0x4d28bb)[_0x6f59('0xa')](function(_0x5bae40){logger[_0x6f59('0xb')]('MailSubstatus,\x20%s,\x20%s',_0x268c55,_0x6f59('0xc'));logger[_0x6f59('0xd')]('MailSubstatus,\x20%s,\x20%s,\x20%s',_0x268c55,_0x6f59('0xc'),JSON[_0x6f59('0xe')](_0x5bae40));if(_0x5bae40[_0x6f59('0xf')]){if(_0x5bae40['error'][_0x6f59('0x10')]===0x1f4){logger[_0x6f59('0xf')](_0x6f59('0x11'),_0x268c55,_0x5bae40[_0x6f59('0xf')]['message']);return _0x17ddc6(_0x5bae40['error']['message']);}logger[_0x6f59('0xf')](_0x6f59('0x11'),_0x268c55,_0x5bae40[_0x6f59('0xf')]['message']);return _0x52d912(_0x5bae40[_0x6f59('0xf')][_0x6f59('0x12')]);}else{logger[_0x6f59('0xb')](_0x6f59('0x11'),_0x268c55,_0x6f59('0xc'));_0x52d912(_0x5bae40['result'][_0x6f59('0x12')]);}})[_0x6f59('0x13')](function(_0x5522da){logger[_0x6f59('0xf')](_0x6f59('0x11'),_0x268c55,_0x5522da);_0x17ddc6(_0x5522da);});});}
\ No newline at end of file
+var _0x3f27=['../../config/utils','jayson/promise','client','http','request','then','info','MailSubstatus,\x20%s,\x20%s','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','request\x20sent','code','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb'];(function(_0x2080a3,_0x48acfa){var _0x8d7d17=function(_0x2dbc06){while(--_0x2dbc06){_0x2080a3['push'](_0x2080a3['shift']());}};_0x8d7d17(++_0x48acfa);}(_0x3f27,0x1f4));var _0x73f2=function(_0x51e3ac,_0x2bc9d7){_0x51e3ac=_0x51e3ac-0x0;var _0x3d69da=_0x3f27[_0x51e3ac];return _0x3d69da;};'use strict';var _=require(_0x73f2('0x0'));var util=require(_0x73f2('0x1'));var moment=require(_0x73f2('0x2'));var BPromise=require(_0x73f2('0x3'));var rs=require(_0x73f2('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x73f2('0x5'))['db'];var utils=require(_0x73f2('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x73f2('0x7'));var client=jayson[_0x73f2('0x8')][_0x73f2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4aa8ec,_0x10af7a,_0x5efe60){return new BPromise(function(_0x521fc9,_0xa2ea48){return client[_0x73f2('0xa')](_0x4aa8ec,_0x5efe60)[_0x73f2('0xb')](function(_0x3bf117){logger[_0x73f2('0xc')](_0x73f2('0xd'),_0x10af7a,'request\x20sent');logger[_0x73f2('0xe')](_0x73f2('0xf'),_0x10af7a,_0x73f2('0x10'),JSON['stringify'](_0x3bf117));if(_0x3bf117['error']){if(_0x3bf117['error'][_0x73f2('0x11')]===0x1f4){logger[_0x73f2('0x12')](_0x73f2('0xd'),_0x10af7a,_0x3bf117[_0x73f2('0x12')][_0x73f2('0x13')]);return _0xa2ea48(_0x3bf117[_0x73f2('0x12')][_0x73f2('0x13')]);}logger['error']('MailSubstatus,\x20%s,\x20%s',_0x10af7a,_0x3bf117[_0x73f2('0x12')][_0x73f2('0x13')]);return _0x521fc9(_0x3bf117['error']['message']);}else{logger[_0x73f2('0xc')](_0x73f2('0xd'),_0x10af7a,_0x73f2('0x10'));_0x521fc9(_0x3bf117[_0x73f2('0x14')][_0x73f2('0x13')]);}})[_0x73f2('0x15')](function(_0x32e9c6){logger[_0x73f2('0x12')](_0x73f2('0xd'),_0x10af7a,_0x32e9c6);_0xa2ea48(_0x32e9c6);});});}
\ No newline at end of file
index b0f4103..5ab0eb9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x397f=['path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./mailTransferReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','create','put','update','destroy'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x397f,0x19e));var _0xf397=function(_0x1ced32,_0x1e959a){_0x1ced32=_0x1ced32-0x0;var _0xb6cc84=_0x397f[_0x1ced32];return _0xb6cc84;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xf397('0x0'));var timeout=require(_0xf397('0x1'));var express=require(_0xf397('0x2'));var router=express[_0xf397('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xf397('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xf397('0x5'));var controller=require(_0xf397('0x6'));router[_0xf397('0x7')]('/',auth[_0xf397('0x8')](),controller[_0xf397('0x9')]);router[_0xf397('0x7')](_0xf397('0xa'),auth[_0xf397('0x8')](),controller['describe']);router[_0xf397('0x7')](_0xf397('0xb'),auth[_0xf397('0x8')](),controller[_0xf397('0xc')]);router[_0xf397('0xd')]('/',auth['isAuthenticated'](),controller[_0xf397('0xe')]);router[_0xf397('0xf')]('/:id',auth[_0xf397('0x8')](),controller[_0xf397('0x10')]);router['delete']('/:id',auth[_0xf397('0x8')](),controller[_0xf397('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0xffa4=['../../components/interaction/service','./mailTransferReport.controller','get','isAuthenticated','index','/describe','describe','show','create','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x513bd8,_0x1f84d0){var _0x2df002=function(_0xfca186){while(--_0xfca186){_0x513bd8['push'](_0x513bd8['shift']());}};_0x2df002(++_0x1f84d0);}(_0xffa4,0x116));var _0x4ffa=function(_0x3aff64,_0x55b017){_0x3aff64=_0x3aff64-0x0;var _0x1343d9=_0xffa4[_0x3aff64];return _0x1343d9;};'use strict';var multer=require(_0x4ffa('0x0'));var util=require(_0x4ffa('0x1'));var path=require(_0x4ffa('0x2'));var timeout=require(_0x4ffa('0x3'));var express=require(_0x4ffa('0x4'));var router=express[_0x4ffa('0x5')]();var fs_extra=require(_0x4ffa('0x6'));var auth=require(_0x4ffa('0x7'));var interaction=require(_0x4ffa('0x8'));var config=require('../../config/environment');var controller=require(_0x4ffa('0x9'));router[_0x4ffa('0xa')]('/',auth[_0x4ffa('0xb')](),controller[_0x4ffa('0xc')]);router[_0x4ffa('0xa')](_0x4ffa('0xd'),auth[_0x4ffa('0xb')](),controller[_0x4ffa('0xe')]);router[_0x4ffa('0xa')]('/:id',auth[_0x4ffa('0xb')](),controller[_0x4ffa('0xf')]);router['post']('/',auth[_0x4ffa('0xb')](),controller[_0x4ffa('0x10')]);router['put'](_0x4ffa('0x11'),auth[_0x4ffa('0xb')](),controller[_0x4ffa('0x12')]);router[_0x4ffa('0x13')]('/:id',auth[_0x4ffa('0xb')](),controller[_0x4ffa('0x14')]);module[_0x4ffa('0x15')]=router;
\ No newline at end of file
index d516cf7..5701945 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['account','queue','DATE','NOW','moment','sequelize','exports'];(function(_0x1cb690,_0x5592e3){var _0x3bebd4=function(_0x266301){while(--_0x266301){_0x1cb690['push'](_0x1cb690['shift']());}};_0x3bebd4(++_0x5592e3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0xa9e0[_0x376b45];return _0x2341b3;};'use strict';var moment=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x3'),'agent',_0x0a9e('0x4')),'allowNull':![],'defaultValue':_0x0a9e('0x4')},'transferredAt':{'type':Sequelize[_0x0a9e('0x5')],'allowNull':![],'defaultValue':Sequelize[_0x0a9e('0x6')]}};
\ No newline at end of file
+var _0x00bb=['moment','sequelize','exports','ENUM','agent','queue','DATE','NOW'];(function(_0x5d1cec,_0x1e712a){var _0x3e0a52=function(_0x20dbe5){while(--_0x20dbe5){_0x5d1cec['push'](_0x5d1cec['shift']());}};_0x3e0a52(++_0x1e712a);}(_0x00bb,0x1d8));var _0xb00b=function(_0x42245d,_0x51758f){_0x42245d=_0x42245d-0x0;var _0x4b211a=_0x00bb[_0x42245d];return _0x4b211a;};'use strict';var moment=require(_0xb00b('0x0'));var Sequelize=require(_0xb00b('0x1'));module[_0xb00b('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xb00b('0x3')]('account',_0xb00b('0x4'),_0xb00b('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0xb00b('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xb00b('0x7')]}};
\ No newline at end of file
index 3a7936e..df9d627 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0b19=['rawAttributes','fieldName','type','key','model','map','keys','query','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','merge','MailTransferReport','includeAll','include','findAll','show','params','options','catch','create','body','find','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','error','stack','name'];(function(_0x1b8b66,_0x2f9a50){var _0x795e0c=function(_0x37cc70){while(--_0x37cc70){_0x1b8b66['push'](_0x1b8b66['shift']());}};_0x795e0c(++_0x2f9a50);}(_0x0b19,0x1d6));var _0x90b1=function(_0x648163,_0x241576){_0x648163=_0x648163-0x0;var _0x199d4d=_0x0b19[_0x648163];return _0x199d4d;};'use strict';var emlformat=require(_0x90b1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x90b1('0x1'));var jsonpatch=require(_0x90b1('0x2'));var rp=require(_0x90b1('0x3'));var moment=require(_0x90b1('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x90b1('0x5'));var util=require(_0x90b1('0x6'));var path=require(_0x90b1('0x7'));var sox=require('sox');var csv=require(_0x90b1('0x8'));var ejs=require(_0x90b1('0x9'));var fs=require('fs');var fs_extra=require(_0x90b1('0xa'));var _=require(_0x90b1('0xb'));var squel=require('squel');var crypto=require(_0x90b1('0xc'));var jsforce=require(_0x90b1('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x90b1('0x8'));var querystring=require('querystring');var Papa=require(_0x90b1('0xe'));var Redis=require('ioredis');var authService=require(_0x90b1('0xf'));var qs=require(_0x90b1('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x90b1('0x11'));var logger=require(_0x90b1('0x12'))(_0x90b1('0x13'));var utils=require(_0x90b1('0x14'));var config=require(_0x90b1('0x15'));var licenseUtil=require(_0x90b1('0x16'));var db=require(_0x90b1('0x17'))['db'];function respondWithStatusCode(_0x15a40d,_0x1fb772){_0x1fb772=_0x1fb772||0xcc;return function(_0x3dea78){if(_0x3dea78){return _0x15a40d[_0x90b1('0x18')](_0x1fb772);}return _0x15a40d[_0x90b1('0x19')](_0x1fb772)[_0x90b1('0x1a')]();};}function respondWithResult(_0x74b741,_0x2ec330){_0x2ec330=_0x2ec330||0xc8;return function(_0x1b5dfb){if(_0x1b5dfb){return _0x74b741[_0x90b1('0x19')](_0x2ec330)[_0x90b1('0x1b')](_0x1b5dfb);}};}function respondWithFilteredResult(_0x473766,_0x12fcb2){return function(_0x4e9274){if(_0x4e9274){var _0x15f56f=typeof _0x12fcb2[_0x90b1('0x1c')]===_0x90b1('0x1d')&&typeof _0x12fcb2[_0x90b1('0x1e')]===_0x90b1('0x1d');var _0x271238=_0x4e9274[_0x90b1('0x1f')];var _0x44d130=_0x15f56f?0x0:_0x12fcb2[_0x90b1('0x1c')];var _0x324c92=_0x15f56f?_0x4e9274['count']:_0x12fcb2[_0x90b1('0x1c')]+_0x12fcb2[_0x90b1('0x1e')];var _0x406cda;if(_0x324c92>=_0x271238){_0x324c92=_0x271238;_0x406cda=0xc8;}else{_0x406cda=0xce;}_0x473766['status'](_0x406cda);return _0x473766[_0x90b1('0x20')]('Content-Range',_0x44d130+'-'+_0x324c92+'/'+_0x271238)[_0x90b1('0x1b')](_0x4e9274);}return null;};}function patchUpdates(_0x491443){return function(_0x96c2e1){try{jsonpatch[_0x90b1('0x21')](_0x96c2e1,_0x491443,!![]);}catch(_0x3eb47a){return BPromise['reject'](_0x3eb47a);}return _0x96c2e1[_0x90b1('0x22')]();};}function saveUpdates(_0x3a9838,_0x1d0abb){return function(_0x10636b){if(_0x10636b){return _0x10636b[_0x90b1('0x23')](_0x3a9838)[_0x90b1('0x24')](function(_0x304570){return _0x304570;});}return null;};}function removeEntity(_0x42867d,_0x52d2aa){return function(_0xadbfab){if(_0xadbfab){return _0xadbfab[_0x90b1('0x25')]()[_0x90b1('0x24')](function(){_0x42867d[_0x90b1('0x19')](0xcc)[_0x90b1('0x1a')]();});}};}function handleEntityNotFound(_0x41f53d,_0x545c78){return function(_0x3afbb1){if(!_0x3afbb1){_0x41f53d[_0x90b1('0x18')](0x194);}return _0x3afbb1;};}function handleError(_0x57e0d6,_0x58f7f1){_0x58f7f1=_0x58f7f1||0x1f4;return function(_0x380000){logger[_0x90b1('0x26')](_0x380000[_0x90b1('0x27')]);if(_0x380000[_0x90b1('0x28')]){delete _0x380000[_0x90b1('0x28')];}_0x57e0d6['status'](_0x58f7f1)['send'](_0x380000);};}exports['index']=function(_0x67ca37,_0x1d4423){var _0x4eaec2={},_0x2719b={},_0x26246e={'count':0x0,'rows':[]};var _0x553549=_['map'](db['MailTransferReport'][_0x90b1('0x29')],function(_0x39fc86){return{'name':_0x39fc86[_0x90b1('0x2a')],'type':_0x39fc86[_0x90b1('0x2b')][_0x90b1('0x2c')]};});_0x2719b[_0x90b1('0x2d')]=_[_0x90b1('0x2e')](_0x553549,_0x90b1('0x28'));_0x2719b['query']=_[_0x90b1('0x2f')](_0x67ca37[_0x90b1('0x30')]);_0x2719b[_0x90b1('0x31')]=_['intersection'](_0x2719b[_0x90b1('0x2d')],_0x2719b[_0x90b1('0x30')]);_0x4eaec2[_0x90b1('0x32')]=_[_0x90b1('0x33')](_0x2719b[_0x90b1('0x2d')],qs[_0x90b1('0x34')](_0x67ca37[_0x90b1('0x30')]['fields']));_0x4eaec2[_0x90b1('0x32')]=_0x4eaec2['attributes'][_0x90b1('0x35')]?_0x4eaec2[_0x90b1('0x32')]:_0x2719b[_0x90b1('0x2d')];if(!_0x67ca37['query']['hasOwnProperty'](_0x90b1('0x36'))){_0x4eaec2['limit']=qs[_0x90b1('0x1e')](_0x67ca37[_0x90b1('0x30')][_0x90b1('0x1e')]);_0x4eaec2[_0x90b1('0x1c')]=qs['offset'](_0x67ca37[_0x90b1('0x30')][_0x90b1('0x1c')]);}_0x4eaec2[_0x90b1('0x37')]=qs[_0x90b1('0x38')](_0x67ca37[_0x90b1('0x30')]['sort']);_0x4eaec2[_0x90b1('0x39')]=qs['filters'](_[_0x90b1('0x3a')](_0x67ca37[_0x90b1('0x30')],_0x2719b[_0x90b1('0x31')]),_0x553549);if(_0x67ca37[_0x90b1('0x30')][_0x90b1('0x3b')]){_0x4eaec2[_0x90b1('0x39')]=_[_0x90b1('0x3c')](_0x4eaec2[_0x90b1('0x39')],{'$or':_[_0x90b1('0x2e')](_0x553549,function(_0x59fa21){if(_0x59fa21[_0x90b1('0x2b')]!=='VIRTUAL'){var _0x491e6f={};_0x491e6f[_0x59fa21['name']]={'$like':'%'+_0x67ca37[_0x90b1('0x30')][_0x90b1('0x3b')]+'%'};return _0x491e6f;}})});}_0x4eaec2=_[_0x90b1('0x3c')]({},_0x4eaec2,_0x67ca37['options']);var _0x52108a={'where':_0x4eaec2['where']};return db[_0x90b1('0x3d')]['count'](_0x52108a)[_0x90b1('0x24')](function(_0x902f3f){_0x26246e[_0x90b1('0x1f')]=_0x902f3f;if(_0x67ca37[_0x90b1('0x30')][_0x90b1('0x3e')]){_0x4eaec2[_0x90b1('0x3f')]=[{'all':!![]}];}return db[_0x90b1('0x3d')][_0x90b1('0x40')](_0x4eaec2);})[_0x90b1('0x24')](function(_0x3171bc){_0x26246e['rows']=_0x3171bc;return _0x26246e;})[_0x90b1('0x24')](respondWithFilteredResult(_0x1d4423,_0x4eaec2))['catch'](handleError(_0x1d4423,null));};exports[_0x90b1('0x41')]=function(_0x2c5baa,_0x180bb1){var _0x20638e={'raw':!![],'where':{'id':_0x2c5baa[_0x90b1('0x42')]['id']}},_0x5c4457={};_0x5c4457['model']=_[_0x90b1('0x2f')](db[_0x90b1('0x3d')][_0x90b1('0x29')]);_0x5c4457[_0x90b1('0x30')]=_[_0x90b1('0x2f')](_0x2c5baa[_0x90b1('0x30')]);_0x5c4457[_0x90b1('0x31')]=_[_0x90b1('0x33')](_0x5c4457[_0x90b1('0x2d')],_0x5c4457[_0x90b1('0x30')]);_0x20638e[_0x90b1('0x32')]=_[_0x90b1('0x33')](_0x5c4457[_0x90b1('0x2d')],qs[_0x90b1('0x34')](_0x2c5baa[_0x90b1('0x30')][_0x90b1('0x34')]));_0x20638e[_0x90b1('0x32')]=_0x20638e[_0x90b1('0x32')][_0x90b1('0x35')]?_0x20638e[_0x90b1('0x32')]:_0x5c4457['model'];if(_0x2c5baa[_0x90b1('0x30')][_0x90b1('0x3e')]){_0x20638e[_0x90b1('0x3f')]=[{'all':!![]}];}_0x20638e=_[_0x90b1('0x3c')]({},_0x20638e,_0x2c5baa[_0x90b1('0x43')]);return db['MailTransferReport']['find'](_0x20638e)[_0x90b1('0x24')](handleEntityNotFound(_0x180bb1,null))[_0x90b1('0x24')](respondWithResult(_0x180bb1,null))[_0x90b1('0x44')](handleError(_0x180bb1,null));};exports[_0x90b1('0x45')]=function(_0x81c145,_0x53ad28){return db[_0x90b1('0x3d')][_0x90b1('0x45')](_0x81c145[_0x90b1('0x46')],{})[_0x90b1('0x24')](respondWithResult(_0x53ad28,0xc9))[_0x90b1('0x44')](handleError(_0x53ad28,null));};exports[_0x90b1('0x23')]=function(_0x3bb164,_0x15803a){if(_0x3bb164[_0x90b1('0x46')]['id']){delete _0x3bb164[_0x90b1('0x46')]['id'];}return db[_0x90b1('0x3d')][_0x90b1('0x47')]({'where':{'id':_0x3bb164[_0x90b1('0x42')]['id']}})['then'](handleEntityNotFound(_0x15803a,null))['then'](saveUpdates(_0x3bb164['body'],null))[_0x90b1('0x24')](respondWithResult(_0x15803a,null))[_0x90b1('0x44')](handleError(_0x15803a,null));};exports['destroy']=function(_0x4ca78e,_0x54bc56){return db[_0x90b1('0x3d')][_0x90b1('0x47')]({'where':{'id':_0x4ca78e[_0x90b1('0x42')]['id']}})[_0x90b1('0x24')](handleEntityNotFound(_0x54bc56,null))[_0x90b1('0x24')](removeEntity(_0x54bc56,null))['catch'](handleError(_0x54bc56,null));};exports[_0x90b1('0x48')]=function(_0x50dcb2,_0x2803c4){return db[_0x90b1('0x3d')][_0x90b1('0x48')]()[_0x90b1('0x24')](respondWithResult(_0x2803c4,null))[_0x90b1('0x44')](handleError(_0x2803c4,null));};
\ No newline at end of file
+var _0x6a15=['desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','destroy','error','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','sort','where','pick','filter','merge','VIRTUAL','options','MailTransferReport','include','findAll','rows','catch','show','params','includeAll','find','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','squel','crypto'];(function(_0x24237f,_0x4cf32c){var _0x48298e=function(_0x3f7511){while(--_0x3f7511){_0x24237f['push'](_0x24237f['shift']());}};_0x48298e(++_0x4cf32c);}(_0x6a15,0x10e));var _0x56a1=function(_0x36749d,_0x1c87cd){_0x36749d=_0x36749d-0x0;var _0x4cd973=_0x6a15[_0x36749d];return _0x4cd973;};'use strict';var emlformat=require(_0x56a1('0x0'));var rimraf=require(_0x56a1('0x1'));var zipdir=require(_0x56a1('0x2'));var jsonpatch=require(_0x56a1('0x3'));var rp=require(_0x56a1('0x4'));var moment=require(_0x56a1('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x56a1('0x6'));var path=require(_0x56a1('0x7'));var sox=require(_0x56a1('0x8'));var csv=require(_0x56a1('0x9'));var ejs=require(_0x56a1('0xa'));var fs=require('fs');var fs_extra=require(_0x56a1('0xb'));var _=require('lodash');var squel=require(_0x56a1('0xc'));var crypto=require(_0x56a1('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x56a1('0xe'));var toCsv=require(_0x56a1('0x9'));var querystring=require('querystring');var Papa=require(_0x56a1('0xf'));var Redis=require(_0x56a1('0x10'));var authService=require(_0x56a1('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x56a1('0x12'));var logger=require('../../config/logger')(_0x56a1('0x13'));var utils=require(_0x56a1('0x14'));var config=require(_0x56a1('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x56a1('0x16'))['db'];function respondWithStatusCode(_0x1f9a86,_0xb6c89){_0xb6c89=_0xb6c89||0xcc;return function(_0x863d30){if(_0x863d30){return _0x1f9a86[_0x56a1('0x17')](_0xb6c89);}return _0x1f9a86[_0x56a1('0x18')](_0xb6c89)[_0x56a1('0x19')]();};}function respondWithResult(_0x57c39c,_0x88d334){_0x88d334=_0x88d334||0xc8;return function(_0x1e29c9){if(_0x1e29c9){return _0x57c39c[_0x56a1('0x18')](_0x88d334)[_0x56a1('0x1a')](_0x1e29c9);}};}function respondWithFilteredResult(_0x3d844b,_0x433e24){return function(_0xd5d328){if(_0xd5d328){var _0x40138a=typeof _0x433e24['offset']===_0x56a1('0x1b')&&typeof _0x433e24[_0x56a1('0x1c')]===_0x56a1('0x1b');var _0x2efe0c=_0xd5d328[_0x56a1('0x1d')];var _0x2f1d54=_0x40138a?0x0:_0x433e24[_0x56a1('0x1e')];var _0x5230e8=_0x40138a?_0xd5d328[_0x56a1('0x1d')]:_0x433e24[_0x56a1('0x1e')]+_0x433e24['limit'];var _0x28cb04;if(_0x5230e8>=_0x2efe0c){_0x5230e8=_0x2efe0c;_0x28cb04=0xc8;}else{_0x28cb04=0xce;}_0x3d844b[_0x56a1('0x18')](_0x28cb04);return _0x3d844b['set'](_0x56a1('0x1f'),_0x2f1d54+'-'+_0x5230e8+'/'+_0x2efe0c)[_0x56a1('0x1a')](_0xd5d328);}return null;};}function patchUpdates(_0x431d61){return function(_0x33aa8c){try{jsonpatch[_0x56a1('0x20')](_0x33aa8c,_0x431d61,!![]);}catch(_0x1ec344){return BPromise[_0x56a1('0x21')](_0x1ec344);}return _0x33aa8c[_0x56a1('0x22')]();};}function saveUpdates(_0x587139,_0x11faf9){return function(_0x4df13d){if(_0x4df13d){return _0x4df13d[_0x56a1('0x23')](_0x587139)[_0x56a1('0x24')](function(_0x3c85d7){return _0x3c85d7;});}return null;};}function removeEntity(_0x2aadcb,_0x2372ac){return function(_0x262d00){if(_0x262d00){return _0x262d00[_0x56a1('0x25')]()[_0x56a1('0x24')](function(){_0x2aadcb[_0x56a1('0x18')](0xcc)[_0x56a1('0x19')]();});}};}function handleEntityNotFound(_0x39c139,_0x8558e8){return function(_0x3c2397){if(!_0x3c2397){_0x39c139[_0x56a1('0x17')](0x194);}return _0x3c2397;};}function handleError(_0x43add6,_0x5f14c7){_0x5f14c7=_0x5f14c7||0x1f4;return function(_0x3bcae3){logger[_0x56a1('0x26')](_0x3bcae3['stack']);if(_0x3bcae3['name']){delete _0x3bcae3[_0x56a1('0x27')];}_0x43add6['status'](_0x5f14c7)[_0x56a1('0x28')](_0x3bcae3);};}exports['index']=function(_0x2cc4a1,_0x6e9819){var _0x93fa90={},_0x2d5724={},_0x5e471f={'count':0x0,'rows':[]};var _0x2f83ce=_[_0x56a1('0x29')](db['MailTransferReport'][_0x56a1('0x2a')],function(_0xc4d1f2){return{'name':_0xc4d1f2[_0x56a1('0x2b')],'type':_0xc4d1f2[_0x56a1('0x2c')][_0x56a1('0x2d')]};});_0x2d5724[_0x56a1('0x2e')]=_['map'](_0x2f83ce,_0x56a1('0x27'));_0x2d5724[_0x56a1('0x2f')]=_[_0x56a1('0x30')](_0x2cc4a1['query']);_0x2d5724[_0x56a1('0x31')]=_[_0x56a1('0x32')](_0x2d5724[_0x56a1('0x2e')],_0x2d5724[_0x56a1('0x2f')]);_0x93fa90['attributes']=_['intersection'](_0x2d5724['model'],qs[_0x56a1('0x33')](_0x2cc4a1[_0x56a1('0x2f')][_0x56a1('0x33')]));_0x93fa90[_0x56a1('0x34')]=_0x93fa90[_0x56a1('0x34')]['length']?_0x93fa90[_0x56a1('0x34')]:_0x2d5724[_0x56a1('0x2e')];if(!_0x2cc4a1[_0x56a1('0x2f')]['hasOwnProperty']('nolimit')){_0x93fa90[_0x56a1('0x1c')]=qs[_0x56a1('0x1c')](_0x2cc4a1[_0x56a1('0x2f')][_0x56a1('0x1c')]);_0x93fa90[_0x56a1('0x1e')]=qs['offset'](_0x2cc4a1[_0x56a1('0x2f')][_0x56a1('0x1e')]);}_0x93fa90['order']=qs[_0x56a1('0x35')](_0x2cc4a1[_0x56a1('0x2f')][_0x56a1('0x35')]);_0x93fa90[_0x56a1('0x36')]=qs['filters'](_[_0x56a1('0x37')](_0x2cc4a1[_0x56a1('0x2f')],_0x2d5724[_0x56a1('0x31')]),_0x2f83ce);if(_0x2cc4a1[_0x56a1('0x2f')][_0x56a1('0x38')]){_0x93fa90[_0x56a1('0x36')]=_[_0x56a1('0x39')](_0x93fa90['where'],{'$or':_[_0x56a1('0x29')](_0x2f83ce,function(_0x3bc37a){if(_0x3bc37a[_0x56a1('0x2c')]!==_0x56a1('0x3a')){var _0xf09235={};_0xf09235[_0x3bc37a[_0x56a1('0x27')]]={'$like':'%'+_0x2cc4a1[_0x56a1('0x2f')][_0x56a1('0x38')]+'%'};return _0xf09235;}})});}_0x93fa90=_[_0x56a1('0x39')]({},_0x93fa90,_0x2cc4a1[_0x56a1('0x3b')]);var _0x387861={'where':_0x93fa90[_0x56a1('0x36')]};return db[_0x56a1('0x3c')]['count'](_0x387861)[_0x56a1('0x24')](function(_0x217fe3){_0x5e471f['count']=_0x217fe3;if(_0x2cc4a1['query']['includeAll']){_0x93fa90[_0x56a1('0x3d')]=[{'all':!![]}];}return db[_0x56a1('0x3c')][_0x56a1('0x3e')](_0x93fa90);})['then'](function(_0x1e4bd2){_0x5e471f[_0x56a1('0x3f')]=_0x1e4bd2;return _0x5e471f;})['then'](respondWithFilteredResult(_0x6e9819,_0x93fa90))[_0x56a1('0x40')](handleError(_0x6e9819,null));};exports[_0x56a1('0x41')]=function(_0x263752,_0x1b6dad){var _0x36b45b={'raw':!![],'where':{'id':_0x263752[_0x56a1('0x42')]['id']}},_0x245921={};_0x245921[_0x56a1('0x2e')]=_[_0x56a1('0x30')](db[_0x56a1('0x3c')]['rawAttributes']);_0x245921[_0x56a1('0x2f')]=_[_0x56a1('0x30')](_0x263752['query']);_0x245921[_0x56a1('0x31')]=_[_0x56a1('0x32')](_0x245921[_0x56a1('0x2e')],_0x245921[_0x56a1('0x2f')]);_0x36b45b[_0x56a1('0x34')]=_[_0x56a1('0x32')](_0x245921[_0x56a1('0x2e')],qs[_0x56a1('0x33')](_0x263752[_0x56a1('0x2f')]['fields']));_0x36b45b[_0x56a1('0x34')]=_0x36b45b[_0x56a1('0x34')]['length']?_0x36b45b['attributes']:_0x245921[_0x56a1('0x2e')];if(_0x263752['query'][_0x56a1('0x43')]){_0x36b45b[_0x56a1('0x3d')]=[{'all':!![]}];}_0x36b45b=_[_0x56a1('0x39')]({},_0x36b45b,_0x263752['options']);return db['MailTransferReport'][_0x56a1('0x44')](_0x36b45b)[_0x56a1('0x24')](handleEntityNotFound(_0x1b6dad,null))['then'](respondWithResult(_0x1b6dad,null))[_0x56a1('0x40')](handleError(_0x1b6dad,null));};exports['create']=function(_0x1f41a7,_0x4c2690){return db['MailTransferReport']['create'](_0x1f41a7[_0x56a1('0x45')],{})[_0x56a1('0x24')](respondWithResult(_0x4c2690,0xc9))[_0x56a1('0x40')](handleError(_0x4c2690,null));};exports[_0x56a1('0x23')]=function(_0x537489,_0x262e00){if(_0x537489[_0x56a1('0x45')]['id']){delete _0x537489[_0x56a1('0x45')]['id'];}return db[_0x56a1('0x3c')][_0x56a1('0x44')]({'where':{'id':_0x537489[_0x56a1('0x42')]['id']}})[_0x56a1('0x24')](handleEntityNotFound(_0x262e00,null))[_0x56a1('0x24')](saveUpdates(_0x537489[_0x56a1('0x45')],null))['then'](respondWithResult(_0x262e00,null))['catch'](handleError(_0x262e00,null));};exports[_0x56a1('0x25')]=function(_0x287272,_0x13a98e){return db[_0x56a1('0x3c')][_0x56a1('0x44')]({'where':{'id':_0x287272['params']['id']}})[_0x56a1('0x24')](handleEntityNotFound(_0x13a98e,null))[_0x56a1('0x24')](removeEntity(_0x13a98e,null))[_0x56a1('0x40')](handleError(_0x13a98e,null));};exports[_0x56a1('0x46')]=function(_0x1d5a79,_0x490539){return db[_0x56a1('0x3c')]['describe']()[_0x56a1('0x24')](respondWithResult(_0x490539,null))[_0x56a1('0x40')](handleError(_0x490539,null));};
\ No newline at end of file
index 36d8efc..69f9532 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x567c=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailTransferReport.attributes','exports','define','MailTransferReport','report_mail_transfer','uniqueid','lodash','util','../../config/logger'];(function(_0x55d4e,_0x84a9d0){var _0x23dbb8=function(_0x5c0a10){while(--_0x5c0a10){_0x55d4e['push'](_0x55d4e['shift']());}};_0x23dbb8(++_0x84a9d0);}(_0x567c,0x8d));var _0xc567=function(_0x340686,_0x514392){_0x340686=_0x340686-0x0;var _0x4fa566=_0x567c[_0x340686];return _0x4fa566;};'use strict';var _=require(_0xc567('0x0'));var util=require(_0xc567('0x1'));var logger=require(_0xc567('0x2'))(_0xc567('0x3'));var moment=require(_0xc567('0x4'));var BPromise=require(_0xc567('0x5'));var rp=require(_0xc567('0x6'));var fs=require('fs');var path=require(_0xc567('0x7'));var rimraf=require(_0xc567('0x8'));var config=require(_0xc567('0x9'));var attributes=require(_0xc567('0xa'));module[_0xc567('0xb')]=function(_0x3e8830,_0x250e4b){return _0x3e8830[_0xc567('0xc')](_0xc567('0xd'),attributes,{'tableName':_0xc567('0xe'),'paranoid':![],'indexes':[{'name':_0xc567('0xf'),'fields':[_0xc567('0xf')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xf6c1=['api','moment','request-promise','rimraf','../../config/environment','./mailTransferReport.attributes','exports','MailTransferReport','report_mail_transfer','uniqueid','../../config/logger'];(function(_0x2078df,_0xc00387){var _0x577018=function(_0x5479b6){while(--_0x5479b6){_0x2078df['push'](_0x2078df['shift']());}};_0x577018(++_0xc00387);}(_0xf6c1,0x99));var _0x1f6c=function(_0x3dc41e,_0x11b6c5){_0x3dc41e=_0x3dc41e-0x0;var _0x2b98de=_0xf6c1[_0x3dc41e];return _0x2b98de;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1f6c('0x0'))(_0x1f6c('0x1'));var moment=require(_0x1f6c('0x2'));var BPromise=require('bluebird');var rp=require(_0x1f6c('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1f6c('0x4'));var config=require(_0x1f6c('0x5'));var attributes=require(_0x1f6c('0x6'));module[_0x1f6c('0x7')]=function(_0x25e99a,_0x3ab17e){return _0x25e99a['define'](_0x1f6c('0x8'),attributes,{'tableName':_0x1f6c('0x9'),'paranoid':![],'indexes':[{'name':_0x1f6c('0xa'),'fields':[_0x1f6c('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
index 2841b6d..b2ceb84 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcdf1=['request\x20sent','debug','error','MailTransferReport,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','then','info'];(function(_0xdfff00,_0x10dd77){var _0x340c27=function(_0x323c0e){while(--_0x323c0e){_0xdfff00['push'](_0xdfff00['shift']());}};_0x340c27(++_0x10dd77);}(_0xcdf1,0x11e));var _0x1cdf=function(_0x36401a,_0x2fcab4){_0x36401a=_0x36401a-0x0;var _0x4f5f58=_0xcdf1[_0x36401a];return _0x4f5f58;};'use strict';var _=require(_0x1cdf('0x0'));var util=require(_0x1cdf('0x1'));var moment=require(_0x1cdf('0x2'));var BPromise=require(_0x1cdf('0x3'));var rs=require(_0x1cdf('0x4'));var fs=require('fs');var Redis=require(_0x1cdf('0x5'));var db=require(_0x1cdf('0x6'))['db'];var utils=require(_0x1cdf('0x7'));var logger=require(_0x1cdf('0x8'))(_0x1cdf('0x9'));var config=require('../../config/environment');var jayson=require(_0x1cdf('0xa'));var client=jayson[_0x1cdf('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x492856,_0x93b342,_0x3e50bf){return new BPromise(function(_0x137a67,_0x258fdd){return client['request'](_0x492856,_0x3e50bf)[_0x1cdf('0xc')](function(_0x44725f){logger[_0x1cdf('0xd')]('MailTransferReport,\x20%s,\x20%s',_0x93b342,_0x1cdf('0xe'));logger[_0x1cdf('0xf')]('MailTransferReport,\x20%s,\x20%s,\x20%s',_0x93b342,'request\x20sent',JSON['stringify'](_0x44725f));if(_0x44725f[_0x1cdf('0x10')]){if(_0x44725f[_0x1cdf('0x10')]['code']===0x1f4){logger[_0x1cdf('0x10')](_0x1cdf('0x11'),_0x93b342,_0x44725f['error'][_0x1cdf('0x12')]);return _0x258fdd(_0x44725f[_0x1cdf('0x10')][_0x1cdf('0x12')]);}logger[_0x1cdf('0x10')](_0x1cdf('0x11'),_0x93b342,_0x44725f[_0x1cdf('0x10')][_0x1cdf('0x12')]);return _0x137a67(_0x44725f[_0x1cdf('0x10')][_0x1cdf('0x12')]);}else{logger[_0x1cdf('0xd')](_0x1cdf('0x11'),_0x93b342,_0x1cdf('0xe'));_0x137a67(_0x44725f['result'][_0x1cdf('0x12')]);}})[_0x1cdf('0x13')](function(_0x3295c2){logger[_0x1cdf('0x10')](_0x1cdf('0x11'),_0x93b342,_0x3295c2);_0x258fdd(_0x3295c2);});});}
\ No newline at end of file
+var _0x022f=['MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x2d3381,_0x5b6dd0){var _0x134051=function(_0x2780c3){while(--_0x2780c3){_0x2d3381['push'](_0x2d3381['shift']());}};_0x134051(++_0x5b6dd0);}(_0x022f,0x155));var _0xf022=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x022f[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xf022('0x0'));var util=require(_0xf022('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xf022('0x2'));var fs=require('fs');var Redis=require(_0xf022('0x3'));var db=require(_0xf022('0x4'))['db'];var utils=require(_0xf022('0x5'));var logger=require(_0xf022('0x6'))(_0xf022('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xf022('0x8')][_0xf022('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4e65ff,_0x36d122,_0xcdc815){return new BPromise(function(_0x15a5d0,_0x4ab2a2){return client[_0xf022('0xa')](_0x4e65ff,_0xcdc815)[_0xf022('0xb')](function(_0x1675b3){logger[_0xf022('0xc')](_0xf022('0xd'),_0x36d122,_0xf022('0xe'));logger[_0xf022('0xf')](_0xf022('0x10'),_0x36d122,_0xf022('0xe'),JSON[_0xf022('0x11')](_0x1675b3));if(_0x1675b3[_0xf022('0x12')]){if(_0x1675b3[_0xf022('0x12')][_0xf022('0x13')]===0x1f4){logger[_0xf022('0x12')]('MailTransferReport,\x20%s,\x20%s',_0x36d122,_0x1675b3[_0xf022('0x12')][_0xf022('0x14')]);return _0x4ab2a2(_0x1675b3['error'][_0xf022('0x14')]);}logger['error'](_0xf022('0xd'),_0x36d122,_0x1675b3[_0xf022('0x12')][_0xf022('0x14')]);return _0x15a5d0(_0x1675b3[_0xf022('0x12')][_0xf022('0x14')]);}else{logger['info'](_0xf022('0xd'),_0x36d122,_0xf022('0xe'));_0x15a5d0(_0x1675b3['result']['message']);}})['catch'](function(_0x3829de){logger[_0xf022('0x12')](_0xf022('0xd'),_0x36d122,_0x3829de);_0x4ab2a2(_0x3829de);});});}
\ No newline at end of file
index 5c25553..33f1adb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbb57=['post','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./memberReport.controller','get','index','/describe','isAuthenticated','/:id','show'];(function(_0x1a8f86,_0x5ed9c4){var _0x20d876=function(_0x596e1b){while(--_0x596e1b){_0x1a8f86['push'](_0x1a8f86['shift']());}};_0x20d876(++_0x5ed9c4);}(_0xbb57,0x180));var _0x7bb5=function(_0x650c25,_0x4db6d4){_0x650c25=_0x650c25-0x0;var _0x18bd14=_0xbb57[_0x650c25];return _0x18bd14;};'use strict';var multer=require('multer');var util=require(_0x7bb5('0x0'));var path=require(_0x7bb5('0x1'));var timeout=require(_0x7bb5('0x2'));var express=require(_0x7bb5('0x3'));var router=express[_0x7bb5('0x4')]();var fs_extra=require(_0x7bb5('0x5'));var auth=require(_0x7bb5('0x6'));var interaction=require(_0x7bb5('0x7'));var config=require('../../config/environment');var controller=require(_0x7bb5('0x8'));router[_0x7bb5('0x9')]('/',auth['isAuthenticated'](),controller[_0x7bb5('0xa')]);router['get'](_0x7bb5('0xb'),auth[_0x7bb5('0xc')](),controller['describe']);router[_0x7bb5('0x9')](_0x7bb5('0xd'),auth[_0x7bb5('0xc')](),controller[_0x7bb5('0xe')]);router[_0x7bb5('0xf')]('/',auth[_0x7bb5('0xc')](),controller['create']);router[_0x7bb5('0x10')](_0x7bb5('0xd'),auth[_0x7bb5('0xc')](),controller[_0x7bb5('0x11')]);router[_0x7bb5('0x12')]('/:id',auth[_0x7bb5('0xc')](),controller[_0x7bb5('0x13')]);module[_0x7bb5('0x14')]=router;
\ No newline at end of file
+var _0xaf92=['index','/describe','/:id','show','post','update','delete','destroy','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','get','isAuthenticated'];(function(_0x36a469,_0x59d84c){var _0x3347fc=function(_0x3860e7){while(--_0x3860e7){_0x36a469['push'](_0x36a469['shift']());}};_0x3347fc(++_0x59d84c);}(_0xaf92,0x1c2));var _0x2af9=function(_0x40ba3b,_0x5deccd){_0x40ba3b=_0x40ba3b-0x0;var _0xdf5e7e=_0xaf92[_0x40ba3b];return _0xdf5e7e;};'use strict';var multer=require(_0x2af9('0x0'));var util=require(_0x2af9('0x1'));var path=require(_0x2af9('0x2'));var timeout=require(_0x2af9('0x3'));var express=require('express');var router=express[_0x2af9('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2af9('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x2af9('0x6'));var controller=require('./memberReport.controller');router[_0x2af9('0x7')]('/',auth[_0x2af9('0x8')](),controller[_0x2af9('0x9')]);router[_0x2af9('0x7')](_0x2af9('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x2af9('0x7')](_0x2af9('0xb'),auth['isAuthenticated'](),controller[_0x2af9('0xc')]);router[_0x2af9('0xd')]('/',auth[_0x2af9('0x8')](),controller['create']);router['put'](_0x2af9('0xb'),auth[_0x2af9('0x8')](),controller[_0x2af9('0xe')]);router[_0x2af9('0xf')](_0x2af9('0xb'),auth['isAuthenticated'](),controller[_0x2af9('0x10')]);module['exports']=router;
\ No newline at end of file
index 7940ed4..47e5ea4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5fea=['talk:[start]','talk:[destination]','talk:[dial\x20string]','talk:[queue]','moment','exports','STRING','INTEGER','getDataValue','enterAt','diff','seconds','setDataValue','exitAt'];(function(_0x114b7c,_0xc4b93b){var _0x47185f=function(_0x5b4cfa){while(--_0x5b4cfa){_0x114b7c['push'](_0x114b7c['shift']());}};_0x47185f(++_0xc4b93b);}(_0x5fea,0x82));var _0xa5fe=function(_0x2a0183,_0x3fc93c){_0x2a0183=_0x2a0183-0x0;var _0x158c3a=_0x5fea[_0x2a0183];return _0x158c3a;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xa5fe('0x0'));module[_0xa5fe('0x1')]={'channel':{'type':Sequelize[_0xa5fe('0x2')]},'membername':{'type':Sequelize[_0xa5fe('0x2')]},'interface':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xa5fe('0x2')],'defaultValue':'DEFAULT\x20PAUSE','comment':'LOGIN,\x20PAUSE,\x20TALKING'},'duration':{'type':Sequelize[_0xa5fe('0x3')]},'enterAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE'],'set':function(_0x118419){var _0x92f58d=moment(_0x118419);var _0x32fe56=moment(this[_0xa5fe('0x4')](_0xa5fe('0x5')));var _0x4ba5d9=_0x92f58d[_0xa5fe('0x6')](_0x32fe56,_0xa5fe('0x7'));this[_0xa5fe('0x8')](_0xa5fe('0x9'),_0x118419);this[_0xa5fe('0x8')]('duration',_0x4ba5d9>=0x0?_0x4ba5d9:null);}},'data1':{'type':Sequelize[_0xa5fe('0x2')],'comment':'talk:[inbound,\x20outbound],\x20pause:[reason]'},'data2':{'type':Sequelize[_0xa5fe('0x2')],'comment':_0xa5fe('0xa')},'data3':{'type':Sequelize[_0xa5fe('0x2')],'comment':_0xa5fe('0xb')},'data4':{'type':Sequelize[_0xa5fe('0x2')],'comment':_0xa5fe('0xc')},'data5':{'type':Sequelize['STRING'],'comment':_0xa5fe('0xd')},'role':{'type':Sequelize[_0xa5fe('0x2')]},'internal':{'type':Sequelize[_0xa5fe('0x3')]},'uniqueid':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x6a60=['talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[destination]','talk:[dial\x20string]','talk:[queue]','moment','exports','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','getDataValue','enterAt','setDataValue','duration'];(function(_0x5ab5ea,_0x304980){var _0x27bc3d=function(_0x2d3dc7){while(--_0x2d3dc7){_0x5ab5ea['push'](_0x5ab5ea['shift']());}};_0x27bc3d(++_0x304980);}(_0x6a60,0x103));var _0x06a6=function(_0x23cbbe,_0x240b33){_0x23cbbe=_0x23cbbe-0x0;var _0x292a79=_0x6a60[_0x23cbbe];return _0x292a79;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x06a6('0x0'));module[_0x06a6('0x1')]={'channel':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x06a6('0x2')]},'interface':{'type':Sequelize[_0x06a6('0x2')]},'type':{'type':Sequelize[_0x06a6('0x2')],'defaultValue':_0x06a6('0x3'),'comment':_0x06a6('0x4')},'duration':{'type':Sequelize[_0x06a6('0x5')]},'enterAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x06a6('0x6')],'set':function(_0x39f1c5){var _0x5d426a=moment(_0x39f1c5);var _0x10f577=moment(this[_0x06a6('0x7')](_0x06a6('0x8')));var _0x58cbad=_0x5d426a['diff'](_0x10f577,'seconds');this[_0x06a6('0x9')]('exitAt',_0x39f1c5);this[_0x06a6('0x9')](_0x06a6('0xa'),_0x58cbad>=0x0?_0x58cbad:null);}},'data1':{'type':Sequelize['STRING'],'comment':_0x06a6('0xb')},'data2':{'type':Sequelize[_0x06a6('0x2')],'comment':'talk:[start]'},'data3':{'type':Sequelize['STRING'],'comment':_0x06a6('0xc')},'data4':{'type':Sequelize[_0x06a6('0x2')],'comment':_0x06a6('0xd')},'data5':{'type':Sequelize['STRING'],'comment':_0x06a6('0xe')},'role':{'type':Sequelize['STRING']},'internal':{'type':Sequelize[_0x06a6('0x5')]},'uniqueid':{'type':Sequelize[_0x06a6('0x2')]}};
\ No newline at end of file
index 119c4f0..b5bad36 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3e74=['show','params','options','find','catch','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','end','json','undefined','limit','offset','count','status','set','Content-Range','apply','save','update','then','destroy','sendStatus','name','send','index','map','MemberReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows'];(function(_0x17c84b,_0x209fb2){var _0x168720=function(_0xdafa7f){while(--_0xdafa7f){_0x17c84b['push'](_0x17c84b['shift']());}};_0x168720(++_0x209fb2);}(_0x3e74,0x175));var _0x43e7=function(_0x44f960,_0x59f4fd){_0x44f960=_0x44f960-0x0;var _0x25585a=_0x3e74[_0x44f960];return _0x25585a;};'use strict';var emlformat=require(_0x43e7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x43e7('0x1'));var jsonpatch=require(_0x43e7('0x2'));var rp=require(_0x43e7('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x43e7('0x4'));var util=require('util');var path=require(_0x43e7('0x5'));var sox=require(_0x43e7('0x6'));var csv=require(_0x43e7('0x7'));var ejs=require(_0x43e7('0x8'));var fs=require('fs');var fs_extra=require(_0x43e7('0x9'));var _=require('lodash');var squel=require(_0x43e7('0xa'));var crypto=require(_0x43e7('0xb'));var jsforce=require(_0x43e7('0xc'));var deskjs=require(_0x43e7('0xd'));var toCsv=require(_0x43e7('0x7'));var querystring=require('querystring');var Papa=require(_0x43e7('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x43e7('0xf'));var as=require(_0x43e7('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x43e7('0x11'))('api');var utils=require(_0x43e7('0x12'));var config=require(_0x43e7('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x43e7('0x14'))['db'];function respondWithStatusCode(_0xc960ea,_0x2718d3){_0x2718d3=_0x2718d3||0xcc;return function(_0x3bb83f){if(_0x3bb83f){return _0xc960ea['sendStatus'](_0x2718d3);}return _0xc960ea['status'](_0x2718d3)[_0x43e7('0x15')]();};}function respondWithResult(_0x21fdd3,_0x44b0bd){_0x44b0bd=_0x44b0bd||0xc8;return function(_0x51b974){if(_0x51b974){return _0x21fdd3['status'](_0x44b0bd)[_0x43e7('0x16')](_0x51b974);}};}function respondWithFilteredResult(_0x14c146,_0x203378){return function(_0x328445){if(_0x328445){var _0x4de324=typeof _0x203378['offset']===_0x43e7('0x17')&&typeof _0x203378[_0x43e7('0x18')]===_0x43e7('0x17');var _0x5d346f=_0x328445['count'];var _0x446986=_0x4de324?0x0:_0x203378[_0x43e7('0x19')];var _0x9037d3=_0x4de324?_0x328445[_0x43e7('0x1a')]:_0x203378[_0x43e7('0x19')]+_0x203378[_0x43e7('0x18')];var _0x619236;if(_0x9037d3>=_0x5d346f){_0x9037d3=_0x5d346f;_0x619236=0xc8;}else{_0x619236=0xce;}_0x14c146[_0x43e7('0x1b')](_0x619236);return _0x14c146[_0x43e7('0x1c')](_0x43e7('0x1d'),_0x446986+'-'+_0x9037d3+'/'+_0x5d346f)[_0x43e7('0x16')](_0x328445);}return null;};}function patchUpdates(_0x177ee1){return function(_0x4b5d64){try{jsonpatch[_0x43e7('0x1e')](_0x4b5d64,_0x177ee1,!![]);}catch(_0x3c6625){return BPromise['reject'](_0x3c6625);}return _0x4b5d64[_0x43e7('0x1f')]();};}function saveUpdates(_0x3e281e,_0x3945bb){return function(_0x28aacc){if(_0x28aacc){return _0x28aacc[_0x43e7('0x20')](_0x3e281e)[_0x43e7('0x21')](function(_0x54a9e7){return _0x54a9e7;});}return null;};}function removeEntity(_0x454359,_0x4eea52){return function(_0x4c9df3){if(_0x4c9df3){return _0x4c9df3[_0x43e7('0x22')]()[_0x43e7('0x21')](function(){_0x454359['status'](0xcc)[_0x43e7('0x15')]();});}};}function handleEntityNotFound(_0x4ca5cf,_0x326dab){return function(_0x5c5e67){if(!_0x5c5e67){_0x4ca5cf[_0x43e7('0x23')](0x194);}return _0x5c5e67;};}function handleError(_0x1b5f50,_0x20888b){_0x20888b=_0x20888b||0x1f4;return function(_0x405f85){logger['error'](_0x405f85['stack']);if(_0x405f85[_0x43e7('0x24')]){delete _0x405f85['name'];}_0x1b5f50[_0x43e7('0x1b')](_0x20888b)[_0x43e7('0x25')](_0x405f85);};}exports[_0x43e7('0x26')]=function(_0xb1fc63,_0x5087d7){var _0x33a1a5={},_0x4690a6={},_0x45b675={'count':0x0,'rows':[]};var _0x50f9f5=_[_0x43e7('0x27')](db[_0x43e7('0x28')][_0x43e7('0x29')],function(_0x31b2a6){return{'name':_0x31b2a6[_0x43e7('0x2a')],'type':_0x31b2a6[_0x43e7('0x2b')][_0x43e7('0x2c')]};});_0x4690a6[_0x43e7('0x2d')]=_[_0x43e7('0x27')](_0x50f9f5,_0x43e7('0x24'));_0x4690a6['query']=_[_0x43e7('0x2e')](_0xb1fc63[_0x43e7('0x2f')]);_0x4690a6[_0x43e7('0x30')]=_[_0x43e7('0x31')](_0x4690a6[_0x43e7('0x2d')],_0x4690a6['query']);_0x33a1a5[_0x43e7('0x32')]=_[_0x43e7('0x31')](_0x4690a6[_0x43e7('0x2d')],qs[_0x43e7('0x33')](_0xb1fc63['query']['fields']));_0x33a1a5['attributes']=_0x33a1a5[_0x43e7('0x32')][_0x43e7('0x34')]?_0x33a1a5[_0x43e7('0x32')]:_0x4690a6[_0x43e7('0x2d')];if(!_0xb1fc63[_0x43e7('0x2f')][_0x43e7('0x35')]('nolimit')){_0x33a1a5['limit']=qs['limit'](_0xb1fc63['query']['limit']);_0x33a1a5['offset']=qs['offset'](_0xb1fc63[_0x43e7('0x2f')]['offset']);}_0x33a1a5[_0x43e7('0x36')]=qs[_0x43e7('0x37')](_0xb1fc63[_0x43e7('0x2f')][_0x43e7('0x37')]);_0x33a1a5[_0x43e7('0x38')]=qs[_0x43e7('0x30')](_[_0x43e7('0x39')](_0xb1fc63['query'],_0x4690a6['filters']),_0x50f9f5);if(_0xb1fc63['query'][_0x43e7('0x3a')]){_0x33a1a5[_0x43e7('0x38')]=_[_0x43e7('0x3b')](_0x33a1a5[_0x43e7('0x38')],{'$or':_[_0x43e7('0x27')](_0x50f9f5,function(_0x1ed538){if(_0x1ed538[_0x43e7('0x2b')]!==_0x43e7('0x3c')){var _0x55c798={};_0x55c798[_0x1ed538[_0x43e7('0x24')]]={'$like':'%'+_0xb1fc63[_0x43e7('0x2f')]['filter']+'%'};return _0x55c798;}})});}_0x33a1a5=_[_0x43e7('0x3b')]({},_0x33a1a5,_0xb1fc63['options']);var _0x44d8e4={'where':_0x33a1a5[_0x43e7('0x38')]};return db[_0x43e7('0x28')][_0x43e7('0x1a')](_0x44d8e4)[_0x43e7('0x21')](function(_0x234d8f){_0x45b675['count']=_0x234d8f;if(_0xb1fc63['query'][_0x43e7('0x3d')]){_0x33a1a5[_0x43e7('0x3e')]=[{'all':!![]}];}return db[_0x43e7('0x28')][_0x43e7('0x3f')](_0x33a1a5);})[_0x43e7('0x21')](function(_0x4a4a85){_0x45b675[_0x43e7('0x40')]=_0x4a4a85;return _0x45b675;})[_0x43e7('0x21')](respondWithFilteredResult(_0x5087d7,_0x33a1a5))['catch'](handleError(_0x5087d7,null));};exports[_0x43e7('0x41')]=function(_0x51a69c,_0x2ad8ef){var _0x504101={'raw':!![],'where':{'id':_0x51a69c[_0x43e7('0x42')]['id']}},_0x3d81ae={};_0x3d81ae[_0x43e7('0x2d')]=_[_0x43e7('0x2e')](db['MemberReport']['rawAttributes']);_0x3d81ae[_0x43e7('0x2f')]=_[_0x43e7('0x2e')](_0x51a69c[_0x43e7('0x2f')]);_0x3d81ae[_0x43e7('0x30')]=_['intersection'](_0x3d81ae['model'],_0x3d81ae['query']);_0x504101[_0x43e7('0x32')]=_['intersection'](_0x3d81ae[_0x43e7('0x2d')],qs['fields'](_0x51a69c['query'][_0x43e7('0x33')]));_0x504101['attributes']=_0x504101[_0x43e7('0x32')][_0x43e7('0x34')]?_0x504101[_0x43e7('0x32')]:_0x3d81ae[_0x43e7('0x2d')];if(_0x51a69c['query'][_0x43e7('0x3d')]){_0x504101[_0x43e7('0x3e')]=[{'all':!![]}];}_0x504101=_[_0x43e7('0x3b')]({},_0x504101,_0x51a69c[_0x43e7('0x43')]);return db[_0x43e7('0x28')][_0x43e7('0x44')](_0x504101)['then'](handleEntityNotFound(_0x2ad8ef,null))['then'](respondWithResult(_0x2ad8ef,null))[_0x43e7('0x45')](handleError(_0x2ad8ef,null));};exports[_0x43e7('0x46')]=function(_0x212841,_0x4c00a8){return db['MemberReport']['create'](_0x212841[_0x43e7('0x47')],{})[_0x43e7('0x21')](respondWithResult(_0x4c00a8,0xc9))['catch'](handleError(_0x4c00a8,null));};exports[_0x43e7('0x20')]=function(_0x47686e,_0x3c96fe){if(_0x47686e['body']['id']){delete _0x47686e['body']['id'];}return db['MemberReport']['find']({'where':{'id':_0x47686e[_0x43e7('0x42')]['id']}})[_0x43e7('0x21')](handleEntityNotFound(_0x3c96fe,null))['then'](saveUpdates(_0x47686e[_0x43e7('0x47')],null))[_0x43e7('0x21')](respondWithResult(_0x3c96fe,null))[_0x43e7('0x45')](handleError(_0x3c96fe,null));};exports[_0x43e7('0x22')]=function(_0x4a0ce5,_0x2718d5){return db['MemberReport']['find']({'where':{'id':_0x4a0ce5[_0x43e7('0x42')]['id']}})[_0x43e7('0x21')](handleEntityNotFound(_0x2718d5,null))[_0x43e7('0x21')](removeEntity(_0x2718d5,null))[_0x43e7('0x45')](handleError(_0x2718d5,null));};exports[_0x43e7('0x48')]=function(_0x2351cf,_0x1cd87c){return db[_0x43e7('0x28')][_0x43e7('0x48')]()[_0x43e7('0x21')](respondWithResult(_0x1cd87c,null))['catch'](handleError(_0x1cd87c,null));};
\ No newline at end of file
+var _0x55ca=['merge','filter','includeAll','include','findAll','rawAttributes','options','create','body','find','params','catch','destroy','describe','eml-format','rimraf','moment','bluebird','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/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','reject','update','then','end','sendStatus','error','stack','name','send','index','map','MemberReport','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x55ca,0x126));var _0xa55c=function(_0x47f395,_0x18a997){_0x47f395=_0x47f395-0x0;var _0x577a61=_0x55ca[_0x47f395];return _0x577a61;};'use strict';var emlformat=require(_0xa55c('0x0'));var rimraf=require(_0xa55c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa55c('0x2'));var BPromise=require(_0xa55c('0x3'));var Mustache=require('mustache');var util=require(_0xa55c('0x4'));var path=require(_0xa55c('0x5'));var sox=require(_0xa55c('0x6'));var csv=require(_0xa55c('0x7'));var ejs=require(_0xa55c('0x8'));var fs=require('fs');var fs_extra=require(_0xa55c('0x9'));var _=require(_0xa55c('0xa'));var squel=require('squel');var crypto=require(_0xa55c('0xb'));var jsforce=require(_0xa55c('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa55c('0x7'));var querystring=require(_0xa55c('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa55c('0xe'));var qs=require(_0xa55c('0xf'));var as=require(_0xa55c('0x10'));var hardwareService=require(_0xa55c('0x11'));var logger=require(_0xa55c('0x12'))(_0xa55c('0x13'));var utils=require(_0xa55c('0x14'));var config=require(_0xa55c('0x15'));var licenseUtil=require(_0xa55c('0x16'));var db=require(_0xa55c('0x17'))['db'];function respondWithStatusCode(_0x5d47ff,_0x59d84a){_0x59d84a=_0x59d84a||0xcc;return function(_0x2a35be){if(_0x2a35be){return _0x5d47ff['sendStatus'](_0x59d84a);}return _0x5d47ff['status'](_0x59d84a)['end']();};}function respondWithResult(_0x18ee85,_0x3930e4){_0x3930e4=_0x3930e4||0xc8;return function(_0x462cd6){if(_0x462cd6){return _0x18ee85[_0xa55c('0x18')](_0x3930e4)[_0xa55c('0x19')](_0x462cd6);}};}function respondWithFilteredResult(_0x247e77,_0x4e0b2f){return function(_0x3ccf65){if(_0x3ccf65){var _0x3dcf4f=typeof _0x4e0b2f[_0xa55c('0x1a')]===_0xa55c('0x1b')&&typeof _0x4e0b2f[_0xa55c('0x1c')]===_0xa55c('0x1b');var _0x51590e=_0x3ccf65[_0xa55c('0x1d')];var _0x24783b=_0x3dcf4f?0x0:_0x4e0b2f['offset'];var _0x3d4c9e=_0x3dcf4f?_0x3ccf65[_0xa55c('0x1d')]:_0x4e0b2f[_0xa55c('0x1a')]+_0x4e0b2f[_0xa55c('0x1c')];var _0x23a1ae;if(_0x3d4c9e>=_0x51590e){_0x3d4c9e=_0x51590e;_0x23a1ae=0xc8;}else{_0x23a1ae=0xce;}_0x247e77[_0xa55c('0x18')](_0x23a1ae);return _0x247e77['set']('Content-Range',_0x24783b+'-'+_0x3d4c9e+'/'+_0x51590e)[_0xa55c('0x19')](_0x3ccf65);}return null;};}function patchUpdates(_0x3776ac){return function(_0xade4c4){try{jsonpatch['apply'](_0xade4c4,_0x3776ac,!![]);}catch(_0x383d92){return BPromise[_0xa55c('0x1e')](_0x383d92);}return _0xade4c4['save']();};}function saveUpdates(_0x187a87,_0x133096){return function(_0x940f28){if(_0x940f28){return _0x940f28[_0xa55c('0x1f')](_0x187a87)[_0xa55c('0x20')](function(_0x49ed04){return _0x49ed04;});}return null;};}function removeEntity(_0x1fc828,_0x504c24){return function(_0x5ba836){if(_0x5ba836){return _0x5ba836['destroy']()[_0xa55c('0x20')](function(){_0x1fc828['status'](0xcc)[_0xa55c('0x21')]();});}};}function handleEntityNotFound(_0x190757,_0x3f64de){return function(_0xf0e574){if(!_0xf0e574){_0x190757[_0xa55c('0x22')](0x194);}return _0xf0e574;};}function handleError(_0x170ba4,_0x1da633){_0x1da633=_0x1da633||0x1f4;return function(_0x11e7f7){logger[_0xa55c('0x23')](_0x11e7f7[_0xa55c('0x24')]);if(_0x11e7f7[_0xa55c('0x25')]){delete _0x11e7f7['name'];}_0x170ba4[_0xa55c('0x18')](_0x1da633)[_0xa55c('0x26')](_0x11e7f7);};}exports[_0xa55c('0x27')]=function(_0x906caa,_0x5d940d){var _0x1377b0={},_0x22f6b6={},_0x1b8388={'count':0x0,'rows':[]};var _0x201941=_[_0xa55c('0x28')](db[_0xa55c('0x29')]['rawAttributes'],function(_0x23e698){return{'name':_0x23e698['fieldName'],'type':_0x23e698[_0xa55c('0x2a')][_0xa55c('0x2b')]};});_0x22f6b6[_0xa55c('0x2c')]=_[_0xa55c('0x28')](_0x201941,'name');_0x22f6b6[_0xa55c('0x2d')]=_[_0xa55c('0x2e')](_0x906caa[_0xa55c('0x2d')]);_0x22f6b6[_0xa55c('0x2f')]=_[_0xa55c('0x30')](_0x22f6b6[_0xa55c('0x2c')],_0x22f6b6[_0xa55c('0x2d')]);_0x1377b0[_0xa55c('0x31')]=_[_0xa55c('0x30')](_0x22f6b6[_0xa55c('0x2c')],qs[_0xa55c('0x32')](_0x906caa['query']['fields']));_0x1377b0[_0xa55c('0x31')]=_0x1377b0[_0xa55c('0x31')]['length']?_0x1377b0[_0xa55c('0x31')]:_0x22f6b6[_0xa55c('0x2c')];if(!_0x906caa[_0xa55c('0x2d')][_0xa55c('0x33')](_0xa55c('0x34'))){_0x1377b0[_0xa55c('0x1c')]=qs[_0xa55c('0x1c')](_0x906caa[_0xa55c('0x2d')][_0xa55c('0x1c')]);_0x1377b0['offset']=qs['offset'](_0x906caa['query'][_0xa55c('0x1a')]);}_0x1377b0[_0xa55c('0x35')]=qs[_0xa55c('0x36')](_0x906caa['query'][_0xa55c('0x36')]);_0x1377b0['where']=qs[_0xa55c('0x2f')](_['pick'](_0x906caa[_0xa55c('0x2d')],_0x22f6b6[_0xa55c('0x2f')]),_0x201941);if(_0x906caa[_0xa55c('0x2d')]['filter']){_0x1377b0[_0xa55c('0x37')]=_[_0xa55c('0x38')](_0x1377b0['where'],{'$or':_[_0xa55c('0x28')](_0x201941,function(_0x194e78){if(_0x194e78['type']!=='VIRTUAL'){var _0x235f6b={};_0x235f6b[_0x194e78['name']]={'$like':'%'+_0x906caa[_0xa55c('0x2d')][_0xa55c('0x39')]+'%'};return _0x235f6b;}})});}_0x1377b0=_['merge']({},_0x1377b0,_0x906caa['options']);var _0x5e50b6={'where':_0x1377b0['where']};return db[_0xa55c('0x29')][_0xa55c('0x1d')](_0x5e50b6)[_0xa55c('0x20')](function(_0x99c4f8){_0x1b8388[_0xa55c('0x1d')]=_0x99c4f8;if(_0x906caa['query'][_0xa55c('0x3a')]){_0x1377b0[_0xa55c('0x3b')]=[{'all':!![]}];}return db[_0xa55c('0x29')][_0xa55c('0x3c')](_0x1377b0);})[_0xa55c('0x20')](function(_0x23cef5){_0x1b8388['rows']=_0x23cef5;return _0x1b8388;})[_0xa55c('0x20')](respondWithFilteredResult(_0x5d940d,_0x1377b0))['catch'](handleError(_0x5d940d,null));};exports['show']=function(_0x404e7f,_0x1f63d8){var _0x496920={'raw':!![],'where':{'id':_0x404e7f['params']['id']}},_0x2bd98b={};_0x2bd98b['model']=_[_0xa55c('0x2e')](db[_0xa55c('0x29')][_0xa55c('0x3d')]);_0x2bd98b['query']=_[_0xa55c('0x2e')](_0x404e7f[_0xa55c('0x2d')]);_0x2bd98b['filters']=_[_0xa55c('0x30')](_0x2bd98b['model'],_0x2bd98b[_0xa55c('0x2d')]);_0x496920[_0xa55c('0x31')]=_['intersection'](_0x2bd98b[_0xa55c('0x2c')],qs[_0xa55c('0x32')](_0x404e7f['query'][_0xa55c('0x32')]));_0x496920[_0xa55c('0x31')]=_0x496920[_0xa55c('0x31')]['length']?_0x496920[_0xa55c('0x31')]:_0x2bd98b['model'];if(_0x404e7f[_0xa55c('0x2d')][_0xa55c('0x3a')]){_0x496920[_0xa55c('0x3b')]=[{'all':!![]}];}_0x496920=_['merge']({},_0x496920,_0x404e7f[_0xa55c('0x3e')]);return db[_0xa55c('0x29')]['find'](_0x496920)[_0xa55c('0x20')](handleEntityNotFound(_0x1f63d8,null))[_0xa55c('0x20')](respondWithResult(_0x1f63d8,null))['catch'](handleError(_0x1f63d8,null));};exports[_0xa55c('0x3f')]=function(_0xd3fe78,_0x52f9a7){return db[_0xa55c('0x29')][_0xa55c('0x3f')](_0xd3fe78[_0xa55c('0x40')],{})[_0xa55c('0x20')](respondWithResult(_0x52f9a7,0xc9))['catch'](handleError(_0x52f9a7,null));};exports[_0xa55c('0x1f')]=function(_0x58a7ea,_0x2157d6){if(_0x58a7ea[_0xa55c('0x40')]['id']){delete _0x58a7ea[_0xa55c('0x40')]['id'];}return db['MemberReport'][_0xa55c('0x41')]({'where':{'id':_0x58a7ea[_0xa55c('0x42')]['id']}})['then'](handleEntityNotFound(_0x2157d6,null))[_0xa55c('0x20')](saveUpdates(_0x58a7ea[_0xa55c('0x40')],null))[_0xa55c('0x20')](respondWithResult(_0x2157d6,null))[_0xa55c('0x43')](handleError(_0x2157d6,null));};exports[_0xa55c('0x44')]=function(_0x1c84d9,_0x1e1293){return db[_0xa55c('0x29')][_0xa55c('0x41')]({'where':{'id':_0x1c84d9[_0xa55c('0x42')]['id']}})['then'](handleEntityNotFound(_0x1e1293,null))[_0xa55c('0x20')](removeEntity(_0x1e1293,null))[_0xa55c('0x43')](handleError(_0x1e1293,null));};exports[_0xa55c('0x45')]=function(_0x4f73b6,_0x4c3095){return db[_0xa55c('0x29')]['describe']()[_0xa55c('0x20')](respondWithResult(_0x4c3095,null))['catch'](handleError(_0x4c3095,null));};
\ No newline at end of file
index 85a9dd3..497b122 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0146=['../../config/environment','exports','define','membername_interface','interface','util','../../config/logger','moment','request-promise','path','rimraf'];(function(_0x282ccc,_0x5d66a1){var _0x27c2dd=function(_0x58431a){while(--_0x58431a){_0x282ccc['push'](_0x282ccc['shift']());}};_0x27c2dd(++_0x5d66a1);}(_0x0146,0x118));var _0x6014=function(_0x5ef905,_0x564b87){_0x5ef905=_0x5ef905-0x0;var _0x367808=_0x0146[_0x5ef905];return _0x367808;};'use strict';var _=require('lodash');var util=require(_0x6014('0x0'));var logger=require(_0x6014('0x1'))('api');var moment=require(_0x6014('0x2'));var BPromise=require('bluebird');var rp=require(_0x6014('0x3'));var fs=require('fs');var path=require(_0x6014('0x4'));var rimraf=require(_0x6014('0x5'));var config=require(_0x6014('0x6'));var attributes=require('./memberReport.attributes');module[_0x6014('0x7')]=function(_0xcd7dd6,_0x53f9a9){return _0xcd7dd6[_0x6014('0x8')]('MemberReport',attributes,{'tableName':'report_member','paranoid':![],'indexes':[{'name':_0x6014('0x9'),'fields':['membername',_0x6014('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xe495=['rimraf','../../config/environment','./memberReport.attributes','exports','MemberReport','report_member','membername_interface','membername','interface','lodash','../../config/logger','api','moment','request-promise'];(function(_0x3664e0,_0x1cfec0){var _0x11b14e=function(_0x34b439){while(--_0x34b439){_0x3664e0['push'](_0x3664e0['shift']());}};_0x11b14e(++_0x1cfec0);}(_0xe495,0x12f));var _0x5e49=function(_0x342baa,_0x4a110f){_0x342baa=_0x342baa-0x0;var _0x1208f3=_0xe495[_0x342baa];return _0x1208f3;};'use strict';var _=require(_0x5e49('0x0'));var util=require('util');var logger=require(_0x5e49('0x1'))(_0x5e49('0x2'));var moment=require(_0x5e49('0x3'));var BPromise=require('bluebird');var rp=require(_0x5e49('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5e49('0x5'));var config=require(_0x5e49('0x6'));var attributes=require(_0x5e49('0x7'));module[_0x5e49('0x8')]=function(_0x1e0e9d,_0x304a4b){return _0x1e0e9d['define'](_0x5e49('0x9'),attributes,{'tableName':_0x5e49('0xa'),'paranoid':![],'indexes':[{'name':_0x5e49('0xb'),'fields':[_0x5e49('0xc'),_0x5e49('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
index fb37509..636828b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa6bb=['limit','include','map','model','GetMemberReport','stringify','CreateMemberReport','create','body','UpdateMemberReport','update','raw','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','MemberReport,\x20%s,\x20%s','debug','MemberReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','MemberReport','findAll','options','attributes'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0xa6bb,0x12c));var _0xba6b=function(_0x214d0b,_0x13c0f5){_0x214d0b=_0x214d0b-0x0;var _0x2d677e=_0xa6bb[_0x214d0b];return _0x2d677e;};'use strict';var _=require('lodash');var util=require(_0xba6b('0x0'));var moment=require(_0xba6b('0x1'));var BPromise=require(_0xba6b('0x2'));var rs=require(_0xba6b('0x3'));var fs=require('fs');var Redis=require(_0xba6b('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xba6b('0x5'))(_0xba6b('0x6'));var config=require(_0xba6b('0x7'));var jayson=require(_0xba6b('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2a00d6,_0x4f6c6c,_0x2f305e){return new BPromise(function(_0x5506d6,_0x55f5c3){return client[_0xba6b('0x9')](_0x2a00d6,_0x2f305e)[_0xba6b('0xa')](function(_0x2cab30){logger[_0xba6b('0xb')](_0xba6b('0xc'),_0x4f6c6c,'request\x20sent');logger[_0xba6b('0xd')](_0xba6b('0xe'),_0x4f6c6c,_0xba6b('0xf'),JSON['stringify'](_0x2cab30));if(_0x2cab30[_0xba6b('0x10')]){if(_0x2cab30[_0xba6b('0x10')][_0xba6b('0x11')]===0x1f4){logger[_0xba6b('0x10')]('MemberReport,\x20%s,\x20%s',_0x4f6c6c,_0x2cab30[_0xba6b('0x10')]['message']);return _0x55f5c3(_0x2cab30[_0xba6b('0x10')][_0xba6b('0x12')]);}logger[_0xba6b('0x10')](_0xba6b('0xc'),_0x4f6c6c,_0x2cab30[_0xba6b('0x10')]['message']);return _0x5506d6(_0x2cab30[_0xba6b('0x10')][_0xba6b('0x12')]);}else{logger['info'](_0xba6b('0xc'),_0x4f6c6c,_0xba6b('0xf'));_0x5506d6(_0x2cab30['result']['message']);}})[_0xba6b('0x13')](function(_0x5b32cd){logger['error']('MemberReport,\x20%s,\x20%s',_0x4f6c6c,_0x5b32cd);_0x55f5c3(_0x5b32cd);});});}exports['GetMemberReport']=function(_0x4be059){var _0x16b130=this;return new Promise(function(_0x34aa97,_0x2738fd){return db[_0xba6b('0x14')][_0xba6b('0x15')]({'raw':_0x4be059[_0xba6b('0x16')]?_0x4be059[_0xba6b('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x4be059[_0xba6b('0x16')]?_0x4be059['options']['where']||null:null,'attributes':_0x4be059[_0xba6b('0x16')]?_0x4be059[_0xba6b('0x16')][_0xba6b('0x17')]||null:null,'limit':_0x4be059[_0xba6b('0x16')]?_0x4be059['options'][_0xba6b('0x18')]||null:null,'include':_0x4be059[_0xba6b('0x16')]?_0x4be059['options'][_0xba6b('0x19')]?_[_0xba6b('0x1a')](_0x4be059[_0xba6b('0x16')][_0xba6b('0x19')],function(_0x426641){return{'model':db[_0x426641['model']],'as':_0x426641['as'],'attributes':_0x426641['attributes'],'include':_0x426641['include']?_['map'](_0x426641[_0xba6b('0x19')],function(_0x2525f8){return{'model':db[_0x2525f8[_0xba6b('0x1b')]],'as':_0x2525f8['as'],'attributes':_0x2525f8[_0xba6b('0x17')],'include':_0x2525f8[_0xba6b('0x19')]?_[_0xba6b('0x1a')](_0x2525f8['include'],function(_0x876e58){return{'model':db[_0x876e58[_0xba6b('0x1b')]],'as':_0x876e58['as'],'attributes':_0x876e58[_0xba6b('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x47574c){logger[_0xba6b('0xb')]('GetMemberReport',_0x4be059);logger[_0xba6b('0xd')](_0xba6b('0x1c'),_0x4be059,JSON[_0xba6b('0x1d')](_0x47574c));_0x34aa97(_0x47574c);})[_0xba6b('0x13')](function(_0x506f14){logger['error'](_0xba6b('0x1c'),_0x506f14['message'],_0x4be059);_0x2738fd(_0x16b130[_0xba6b('0x10')](0x1f4,_0x506f14['message']));});});};exports[_0xba6b('0x1e')]=function(_0x53649d){var _0x429954=this;return new Promise(function(_0x5008c1,_0x205af9){return db[_0xba6b('0x14')][_0xba6b('0x1f')](_0x53649d[_0xba6b('0x20')],{'raw':_0x53649d['options']?_0x53649d[_0xba6b('0x16')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x1b7468){logger[_0xba6b('0xb')]('CreateMemberReport',_0x53649d);logger[_0xba6b('0xd')]('CreateMemberReport',_0x53649d,JSON['stringify'](_0x1b7468));_0x5008c1(_0x1b7468);})[_0xba6b('0x13')](function(_0x1edfdb){logger[_0xba6b('0x10')](_0xba6b('0x1e'),_0x1edfdb[_0xba6b('0x12')],_0x53649d);_0x205af9(_0x429954['error'](0x1f4,_0x1edfdb[_0xba6b('0x12')]));});});};exports[_0xba6b('0x21')]=function(_0x356454){var _0xd39097=this;return new Promise(function(_0x27f665,_0x1cd27a){return db[_0xba6b('0x14')][_0xba6b('0x22')](_0x356454[_0xba6b('0x20')],{'raw':_0x356454['options']?_0x356454[_0xba6b('0x16')][_0xba6b('0x23')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x356454[_0xba6b('0x16')]?_0x356454[_0xba6b('0x16')]['where']||null:null,'attributes':_0x356454['options']?_0x356454[_0xba6b('0x16')][_0xba6b('0x17')]||null:null,'limit':_0x356454[_0xba6b('0x16')]?_0x356454[_0xba6b('0x16')]['limit']||null:null})[_0xba6b('0xa')](function(_0x400e11){logger['info'](_0xba6b('0x21'),_0x356454);logger['debug'](_0xba6b('0x21'),_0x356454,JSON[_0xba6b('0x1d')](_0x400e11));_0x27f665(_0x400e11);})[_0xba6b('0x13')](function(_0x53f5c6){logger[_0xba6b('0x10')](_0xba6b('0x21'),_0x53f5c6['message'],_0x356454);_0x1cd27a(_0xd39097[_0xba6b('0x10')](0x1f4,_0x53f5c6['message']));});});};
\ No newline at end of file
+var _0x37cc=['http','request','then','info','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','code','MemberReport,\x20%s,\x20%s','message','result','catch','findAll','options','raw','attributes','include','map','model','GetMemberReport','CreateMemberReport','MemberReport','body','UpdateMemberReport','update','where','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x500e23,_0x51b03a){var _0x342ee8=function(_0x5287d5){while(--_0x5287d5){_0x500e23['push'](_0x500e23['shift']());}};_0x342ee8(++_0x51b03a);}(_0x37cc,0x185));var _0xc37c=function(_0x24513e,_0x43ea88){_0x24513e=_0x24513e-0x0;var _0x43fbe4=_0x37cc[_0x24513e];return _0x43fbe4;};'use strict';var _=require(_0xc37c('0x0'));var util=require(_0xc37c('0x1'));var moment=require(_0xc37c('0x2'));var BPromise=require(_0xc37c('0x3'));var rs=require(_0xc37c('0x4'));var fs=require('fs');var Redis=require(_0xc37c('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xc37c('0x6'))(_0xc37c('0x7'));var config=require(_0xc37c('0x8'));var jayson=require(_0xc37c('0x9'));var client=jayson[_0xc37c('0xa')][_0xc37c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xd8f098,_0x1eaa97,_0x3c5c63){return new BPromise(function(_0x483c8d,_0x15a756){return client[_0xc37c('0xc')](_0xd8f098,_0x3c5c63)[_0xc37c('0xd')](function(_0x3526b5){logger[_0xc37c('0xe')]('MemberReport,\x20%s,\x20%s',_0x1eaa97,_0xc37c('0xf'));logger[_0xc37c('0x10')](_0xc37c('0x11'),_0x1eaa97,_0xc37c('0xf'),JSON[_0xc37c('0x12')](_0x3526b5));if(_0x3526b5[_0xc37c('0x13')]){if(_0x3526b5[_0xc37c('0x13')][_0xc37c('0x14')]===0x1f4){logger[_0xc37c('0x13')](_0xc37c('0x15'),_0x1eaa97,_0x3526b5[_0xc37c('0x13')]['message']);return _0x15a756(_0x3526b5['error'][_0xc37c('0x16')]);}logger[_0xc37c('0x13')](_0xc37c('0x15'),_0x1eaa97,_0x3526b5[_0xc37c('0x13')][_0xc37c('0x16')]);return _0x483c8d(_0x3526b5[_0xc37c('0x13')]['message']);}else{logger[_0xc37c('0xe')]('MemberReport,\x20%s,\x20%s',_0x1eaa97,_0xc37c('0xf'));_0x483c8d(_0x3526b5[_0xc37c('0x17')][_0xc37c('0x16')]);}})[_0xc37c('0x18')](function(_0x674ccf){logger['error']('MemberReport,\x20%s,\x20%s',_0x1eaa97,_0x674ccf);_0x15a756(_0x674ccf);});});}exports['GetMemberReport']=function(_0x2d6129){var _0x5c7bd2=this;return new Promise(function(_0x370c2f,_0x1f8679){return db['MemberReport'][_0xc37c('0x19')]({'raw':_0x2d6129[_0xc37c('0x1a')]?_0x2d6129[_0xc37c('0x1a')][_0xc37c('0x1b')]===undefined?!![]:![]:!![],'where':_0x2d6129['options']?_0x2d6129[_0xc37c('0x1a')]['where']||null:null,'attributes':_0x2d6129[_0xc37c('0x1a')]?_0x2d6129[_0xc37c('0x1a')][_0xc37c('0x1c')]||null:null,'limit':_0x2d6129[_0xc37c('0x1a')]?_0x2d6129[_0xc37c('0x1a')]['limit']||null:null,'include':_0x2d6129[_0xc37c('0x1a')]?_0x2d6129[_0xc37c('0x1a')][_0xc37c('0x1d')]?_[_0xc37c('0x1e')](_0x2d6129[_0xc37c('0x1a')][_0xc37c('0x1d')],function(_0x15a392){return{'model':db[_0x15a392[_0xc37c('0x1f')]],'as':_0x15a392['as'],'attributes':_0x15a392[_0xc37c('0x1c')],'include':_0x15a392[_0xc37c('0x1d')]?_[_0xc37c('0x1e')](_0x15a392[_0xc37c('0x1d')],function(_0x3076fc){return{'model':db[_0x3076fc['model']],'as':_0x3076fc['as'],'attributes':_0x3076fc[_0xc37c('0x1c')],'include':_0x3076fc[_0xc37c('0x1d')]?_[_0xc37c('0x1e')](_0x3076fc[_0xc37c('0x1d')],function(_0x53f062){return{'model':db[_0x53f062[_0xc37c('0x1f')]],'as':_0x53f062['as'],'attributes':_0x53f062[_0xc37c('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xc37c('0xd')](function(_0xbd5d3a){logger[_0xc37c('0xe')](_0xc37c('0x20'),_0x2d6129);logger[_0xc37c('0x10')](_0xc37c('0x20'),_0x2d6129,JSON['stringify'](_0xbd5d3a));_0x370c2f(_0xbd5d3a);})[_0xc37c('0x18')](function(_0x466094){logger[_0xc37c('0x13')](_0xc37c('0x20'),_0x466094[_0xc37c('0x16')],_0x2d6129);_0x1f8679(_0x5c7bd2[_0xc37c('0x13')](0x1f4,_0x466094[_0xc37c('0x16')]));});});};exports[_0xc37c('0x21')]=function(_0x2c59df){var _0x472d58=this;return new Promise(function(_0x224641,_0x169b27){return db[_0xc37c('0x22')]['create'](_0x2c59df[_0xc37c('0x23')],{'raw':_0x2c59df[_0xc37c('0x1a')]?_0x2c59df['options']['raw']===undefined?!![]:![]:!![]})[_0xc37c('0xd')](function(_0x3b9ac4){logger[_0xc37c('0xe')]('CreateMemberReport',_0x2c59df);logger[_0xc37c('0x10')]('CreateMemberReport',_0x2c59df,JSON[_0xc37c('0x12')](_0x3b9ac4));_0x224641(_0x3b9ac4);})[_0xc37c('0x18')](function(_0x58429b){logger[_0xc37c('0x13')](_0xc37c('0x21'),_0x58429b[_0xc37c('0x16')],_0x2c59df);_0x169b27(_0x472d58[_0xc37c('0x13')](0x1f4,_0x58429b[_0xc37c('0x16')]));});});};exports[_0xc37c('0x24')]=function(_0x445f07){var _0x5432fe=this;return new Promise(function(_0x5142bd,_0xef4b6c){return db[_0xc37c('0x22')][_0xc37c('0x25')](_0x445f07[_0xc37c('0x23')],{'raw':_0x445f07['options']?_0x445f07[_0xc37c('0x1a')][_0xc37c('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x445f07[_0xc37c('0x1a')]?_0x445f07['options'][_0xc37c('0x26')]||null:null,'attributes':_0x445f07[_0xc37c('0x1a')]?_0x445f07['options'][_0xc37c('0x1c')]||null:null,'limit':_0x445f07[_0xc37c('0x1a')]?_0x445f07['options'][_0xc37c('0x27')]||null:null})[_0xc37c('0xd')](function(_0x17dd56){logger[_0xc37c('0xe')](_0xc37c('0x24'),_0x445f07);logger[_0xc37c('0x10')](_0xc37c('0x24'),_0x445f07,JSON[_0xc37c('0x12')](_0x17dd56));_0x5142bd(_0x17dd56);})[_0xc37c('0x18')](function(_0x188f2c){logger[_0xc37c('0x13')](_0xc37c('0x24'),_0x188f2c[_0xc37c('0x16')],_0x445f07);_0xef4b6c(_0x5432fe[_0xc37c('0x13')](0x1f4,_0x188f2c[_0xc37c('0x16')]));});});};
\ No newline at end of file
index fca0965..10171c7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x389b=['../../components/auth/service','../../components/interaction/service','../../config/environment','./migration.controller','get','index','exports','path','connect-timeout','express','Router','fs-extra'];(function(_0x3cebfc,_0x32c1c2){var _0x126265=function(_0x18588e){while(--_0x18588e){_0x3cebfc['push'](_0x3cebfc['shift']());}};_0x126265(++_0x32c1c2);}(_0x389b,0xa3));var _0xb389=function(_0x2ae8d6,_0x4d7876){_0x2ae8d6=_0x2ae8d6-0x0;var _0x3d5145=_0x389b[_0x2ae8d6];return _0x3d5145;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xb389('0x0'));var timeout=require(_0xb389('0x1'));var express=require(_0xb389('0x2'));var router=express[_0xb389('0x3')]();var fs_extra=require(_0xb389('0x4'));var auth=require(_0xb389('0x5'));var interaction=require(_0xb389('0x6'));var config=require(_0xb389('0x7'));var controller=require(_0xb389('0x8'));router[_0xb389('0x9')]('/',controller[_0xb389('0xa')]);module[_0xb389('0xb')]=router;
\ No newline at end of file
+var _0xef7c=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./migration.controller','get','exports','multer','util','path','connect-timeout'];(function(_0x5bf152,_0x2884b3){var _0x5d1230=function(_0x40a921){while(--_0x40a921){_0x5bf152['push'](_0x5bf152['shift']());}};_0x5d1230(++_0x2884b3);}(_0xef7c,0xa5));var _0xcef7=function(_0x3fff8f,_0x5e2f51){_0x3fff8f=_0x3fff8f-0x0;var _0x18988c=_0xef7c[_0x3fff8f];return _0x18988c;};'use strict';var multer=require(_0xcef7('0x0'));var util=require(_0xcef7('0x1'));var path=require(_0xcef7('0x2'));var timeout=require(_0xcef7('0x3'));var express=require(_0xcef7('0x4'));var router=express[_0xcef7('0x5')]();var fs_extra=require(_0xcef7('0x6'));var auth=require(_0xcef7('0x7'));var interaction=require(_0xcef7('0x8'));var config=require(_0xcef7('0x9'));var controller=require(_0xcef7('0xa'));router[_0xcef7('0xb')]('/',controller['index']);module[_0xcef7('0xc')]=router;
\ No newline at end of file
index 976bfe9..1314049 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x18eb=['exports','STRING','sequelize'];(function(_0x390efc,_0x130a77){var _0x1c953e=function(_0x414afc){while(--_0x414afc){_0x390efc['push'](_0x390efc['shift']());}};_0x1c953e(++_0x130a77);}(_0x18eb,0xdd));var _0xb18e=function(_0x323b6f,_0x3294ad){_0x323b6f=_0x323b6f-0x0;var _0x1ce633=_0x18eb[_0x323b6f];return _0x1ce633;};'use strict';var Sequelize=require(_0xb18e('0x0'));module[_0xb18e('0x1')]={'version':{'type':Sequelize[_0xb18e('0x2')],'unique':'version'}};
\ No newline at end of file
+var _0x23e1=['exports','STRING'];(function(_0x26528a,_0x29ddd0){var _0x53716b=function(_0x53722d){while(--_0x53722d){_0x26528a['push'](_0x26528a['shift']());}};_0x53716b(++_0x29ddd0);}(_0x23e1,0x18a));var _0x123e=function(_0x594185,_0xa7bda0){_0x594185=_0x594185-0x0;var _0x2a7052=_0x23e1[_0x594185];return _0x2a7052;};'use strict';var Sequelize=require('sequelize');module[_0x123e('0x0')]={'version':{'type':Sequelize[_0x123e('0x1')],'unique':'version'}};
\ No newline at end of file
index d1e3ea0..2be83ad 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x113e=['nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','include','rows','catch','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','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','offset','status','Content-Range','apply','save','update','then','error','stack','name','index','Migration','rawAttributes','fieldName','key','map','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty'];(function(_0x25bca6,_0xe415ea){var _0x3f8d02=function(_0x3e581b){while(--_0x3e581b){_0x25bca6['push'](_0x25bca6['shift']());}};_0x3f8d02(++_0xe415ea);}(_0x113e,0xe5));var _0xe113=function(_0x26462c,_0xd20a35){_0x26462c=_0x26462c-0x0;var _0x509a42=_0x113e[_0x26462c];return _0x509a42;};'use strict';var emlformat=require(_0xe113('0x0'));var rimraf=require(_0xe113('0x1'));var zipdir=require(_0xe113('0x2'));var jsonpatch=require(_0xe113('0x3'));var rp=require(_0xe113('0x4'));var moment=require(_0xe113('0x5'));var BPromise=require(_0xe113('0x6'));var Mustache=require(_0xe113('0x7'));var util=require(_0xe113('0x8'));var path=require(_0xe113('0x9'));var sox=require(_0xe113('0xa'));var csv=require(_0xe113('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe113('0xc'));var _=require(_0xe113('0xd'));var squel=require(_0xe113('0xe'));var crypto=require(_0xe113('0xf'));var jsforce=require(_0xe113('0x10'));var deskjs=require(_0xe113('0x11'));var toCsv=require(_0xe113('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xe113('0x12'));var authService=require(_0xe113('0x13'));var qs=require(_0xe113('0x14'));var as=require(_0xe113('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe113('0x16'))(_0xe113('0x17'));var utils=require(_0xe113('0x18'));var config=require(_0xe113('0x19'));var licenseUtil=require(_0xe113('0x1a'));var db=require(_0xe113('0x1b'))['db'];function respondWithStatusCode(_0x30d8e1,_0x2ca685){_0x2ca685=_0x2ca685||0xcc;return function(_0x5a57a3){if(_0x5a57a3){return _0x30d8e1[_0xe113('0x1c')](_0x2ca685);}return _0x30d8e1['status'](_0x2ca685)[_0xe113('0x1d')]();};}function respondWithResult(_0x17df8c,_0x552be1){_0x552be1=_0x552be1||0xc8;return function(_0x30a440){if(_0x30a440){return _0x17df8c['status'](_0x552be1)[_0xe113('0x1e')](_0x30a440);}};}function respondWithFilteredResult(_0x455487,_0x2b6b98){return function(_0x535792){if(_0x535792){var _0x485805=typeof _0x2b6b98['offset']===_0xe113('0x1f')&&typeof _0x2b6b98[_0xe113('0x20')]===_0xe113('0x1f');var _0x19de8a=_0x535792[_0xe113('0x21')];var _0x3aae8b=_0x485805?0x0:_0x2b6b98['offset'];var _0x45f0a5=_0x485805?_0x535792[_0xe113('0x21')]:_0x2b6b98[_0xe113('0x22')]+_0x2b6b98[_0xe113('0x20')];var _0x1df5c5;if(_0x45f0a5>=_0x19de8a){_0x45f0a5=_0x19de8a;_0x1df5c5=0xc8;}else{_0x1df5c5=0xce;}_0x455487[_0xe113('0x23')](_0x1df5c5);return _0x455487['set'](_0xe113('0x24'),_0x3aae8b+'-'+_0x45f0a5+'/'+_0x19de8a)['json'](_0x535792);}return null;};}function patchUpdates(_0xbdcf20){return function(_0x25f9c3){try{jsonpatch[_0xe113('0x25')](_0x25f9c3,_0xbdcf20,!![]);}catch(_0x1b906f){return BPromise['reject'](_0x1b906f);}return _0x25f9c3[_0xe113('0x26')]();};}function saveUpdates(_0x3b2d9c,_0x4b2338){return function(_0x2e41bc){if(_0x2e41bc){return _0x2e41bc[_0xe113('0x27')](_0x3b2d9c)['then'](function(_0xee196f){return _0xee196f;});}return null;};}function removeEntity(_0x1f4113,_0x3f54a3){return function(_0x17b9fd){if(_0x17b9fd){return _0x17b9fd['destroy']()[_0xe113('0x28')](function(){_0x1f4113['status'](0xcc)[_0xe113('0x1d')]();});}};}function handleEntityNotFound(_0x3187dd,_0x4cfff8){return function(_0xaac49f){if(!_0xaac49f){_0x3187dd[_0xe113('0x1c')](0x194);}return _0xaac49f;};}function handleError(_0x54ea8d,_0x3fa4f2){_0x3fa4f2=_0x3fa4f2||0x1f4;return function(_0xca14f6){logger[_0xe113('0x29')](_0xca14f6[_0xe113('0x2a')]);if(_0xca14f6['name']){delete _0xca14f6[_0xe113('0x2b')];}_0x54ea8d['status'](_0x3fa4f2)['send'](_0xca14f6);};}exports[_0xe113('0x2c')]=function(_0x1a10ec,_0x3ff5ec){var _0x11d813={},_0xd85630={},_0x25cdcd={'count':0x0,'rows':[]};var _0x4afd9e=_['map'](db[_0xe113('0x2d')][_0xe113('0x2e')],function(_0x54b291){return{'name':_0x54b291[_0xe113('0x2f')],'type':_0x54b291['type'][_0xe113('0x30')]};});_0xd85630['model']=_[_0xe113('0x31')](_0x4afd9e,_0xe113('0x2b'));_0xd85630[_0xe113('0x32')]=_[_0xe113('0x33')](_0x1a10ec[_0xe113('0x32')]);_0xd85630[_0xe113('0x34')]=_[_0xe113('0x35')](_0xd85630[_0xe113('0x36')],_0xd85630[_0xe113('0x32')]);_0x11d813['attributes']=_[_0xe113('0x35')](_0xd85630['model'],qs[_0xe113('0x37')](_0x1a10ec[_0xe113('0x32')]['fields']));_0x11d813['attributes']=_0x11d813[_0xe113('0x38')][_0xe113('0x39')]?_0x11d813[_0xe113('0x38')]:_0xd85630[_0xe113('0x36')];if(!_0x1a10ec['query'][_0xe113('0x3a')](_0xe113('0x3b'))){_0x11d813[_0xe113('0x20')]=qs[_0xe113('0x20')](_0x1a10ec[_0xe113('0x32')][_0xe113('0x20')]);_0x11d813[_0xe113('0x22')]=qs[_0xe113('0x22')](_0x1a10ec[_0xe113('0x32')][_0xe113('0x22')]);}_0x11d813[_0xe113('0x3c')]=qs['sort'](_0x1a10ec[_0xe113('0x32')][_0xe113('0x3d')]);_0x11d813[_0xe113('0x3e')]=qs[_0xe113('0x34')](_[_0xe113('0x3f')](_0x1a10ec[_0xe113('0x32')],_0xd85630[_0xe113('0x34')]),_0x4afd9e);if(_0x1a10ec[_0xe113('0x32')][_0xe113('0x40')]){_0x11d813[_0xe113('0x3e')]=_[_0xe113('0x41')](_0x11d813['where'],{'$or':_['map'](_0x4afd9e,function(_0x5b775a){if(_0x5b775a[_0xe113('0x42')]!==_0xe113('0x43')){var _0x19d222={};_0x19d222[_0x5b775a['name']]={'$like':'%'+_0x1a10ec['query'][_0xe113('0x40')]+'%'};return _0x19d222;}})});}_0x11d813=_[_0xe113('0x41')]({},_0x11d813,_0x1a10ec[_0xe113('0x44')]);var _0x313365={'where':_0x11d813[_0xe113('0x3e')]};return db['Migration'][_0xe113('0x21')](_0x313365)[_0xe113('0x28')](function(_0x21dc93){_0x25cdcd[_0xe113('0x21')]=_0x21dc93;if(_0x1a10ec[_0xe113('0x32')]['includeAll']){_0x11d813[_0xe113('0x45')]=[{'all':!![]}];}return db[_0xe113('0x2d')]['findAll'](_0x11d813);})['then'](function(_0x376f0d){_0x25cdcd[_0xe113('0x46')]=_0x376f0d;return _0x25cdcd;})['then'](respondWithFilteredResult(_0x3ff5ec,_0x11d813))[_0xe113('0x47')](handleError(_0x3ff5ec,null));};
\ No newline at end of file
+var _0x04a5=['destroy','then','error','stack','name','send','map','Migration','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','rows','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','status','end','undefined','limit','count','offset','Content-Range','json','apply','reject','save'];(function(_0x5239fc,_0x51f919){var _0x2c2aa5=function(_0x2f12ef){while(--_0x2f12ef){_0x5239fc['push'](_0x5239fc['shift']());}};_0x2c2aa5(++_0x51f919);}(_0x04a5,0x9a));var _0x504a=function(_0x5a5c11,_0x358f6b){_0x5a5c11=_0x5a5c11-0x0;var _0x5d6ba7=_0x04a5[_0x5a5c11];return _0x5d6ba7;};'use strict';var emlformat=require(_0x504a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x504a('0x1'));var jsonpatch=require(_0x504a('0x2'));var rp=require(_0x504a('0x3'));var moment=require('moment');var BPromise=require(_0x504a('0x4'));var Mustache=require(_0x504a('0x5'));var util=require('util');var path=require('path');var sox=require(_0x504a('0x6'));var csv=require(_0x504a('0x7'));var ejs=require(_0x504a('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x504a('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x504a('0xa'));var deskjs=require(_0x504a('0xb'));var toCsv=require(_0x504a('0x7'));var querystring=require(_0x504a('0xc'));var Papa=require('papaparse');var Redis=require(_0x504a('0xd'));var authService=require(_0x504a('0xe'));var qs=require(_0x504a('0xf'));var as=require(_0x504a('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x504a('0x11'))(_0x504a('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x504a('0x13'));var db=require(_0x504a('0x14'))['db'];function respondWithStatusCode(_0x47f18f,_0x4f81ad){_0x4f81ad=_0x4f81ad||0xcc;return function(_0x5e9d82){if(_0x5e9d82){return _0x47f18f['sendStatus'](_0x4f81ad);}return _0x47f18f[_0x504a('0x15')](_0x4f81ad)[_0x504a('0x16')]();};}function respondWithResult(_0x402630,_0x35d5a6){_0x35d5a6=_0x35d5a6||0xc8;return function(_0xb304a2){if(_0xb304a2){return _0x402630['status'](_0x35d5a6)['json'](_0xb304a2);}};}function respondWithFilteredResult(_0x104659,_0x450ec4){return function(_0x399227){if(_0x399227){var _0xe4a226=typeof _0x450ec4['offset']===_0x504a('0x17')&&typeof _0x450ec4[_0x504a('0x18')]===_0x504a('0x17');var _0x161381=_0x399227[_0x504a('0x19')];var _0x1f3b58=_0xe4a226?0x0:_0x450ec4['offset'];var _0x1c35f9=_0xe4a226?_0x399227['count']:_0x450ec4[_0x504a('0x1a')]+_0x450ec4['limit'];var _0xc8f1c9;if(_0x1c35f9>=_0x161381){_0x1c35f9=_0x161381;_0xc8f1c9=0xc8;}else{_0xc8f1c9=0xce;}_0x104659['status'](_0xc8f1c9);return _0x104659['set'](_0x504a('0x1b'),_0x1f3b58+'-'+_0x1c35f9+'/'+_0x161381)[_0x504a('0x1c')](_0x399227);}return null;};}function patchUpdates(_0x19ba63){return function(_0x5c3b82){try{jsonpatch[_0x504a('0x1d')](_0x5c3b82,_0x19ba63,!![]);}catch(_0x25d44a){return BPromise[_0x504a('0x1e')](_0x25d44a);}return _0x5c3b82[_0x504a('0x1f')]();};}function saveUpdates(_0xf17a6e,_0x45a12f){return function(_0x268ae6){if(_0x268ae6){return _0x268ae6['update'](_0xf17a6e)['then'](function(_0x1129b7){return _0x1129b7;});}return null;};}function removeEntity(_0x3f090c,_0x5d76f8){return function(_0x586c3d){if(_0x586c3d){return _0x586c3d[_0x504a('0x20')]()[_0x504a('0x21')](function(){_0x3f090c['status'](0xcc)[_0x504a('0x16')]();});}};}function handleEntityNotFound(_0x59e1a2,_0x37e193){return function(_0x5630b1){if(!_0x5630b1){_0x59e1a2['sendStatus'](0x194);}return _0x5630b1;};}function handleError(_0x2881d0,_0x345bb2){_0x345bb2=_0x345bb2||0x1f4;return function(_0x3e5c0c){logger[_0x504a('0x22')](_0x3e5c0c[_0x504a('0x23')]);if(_0x3e5c0c[_0x504a('0x24')]){delete _0x3e5c0c['name'];}_0x2881d0['status'](_0x345bb2)[_0x504a('0x25')](_0x3e5c0c);};}exports['index']=function(_0x20f907,_0x35248f){var _0x182e74={},_0x49960d={},_0x4627d7={'count':0x0,'rows':[]};var _0x32053f=_[_0x504a('0x26')](db[_0x504a('0x27')][_0x504a('0x28')],function(_0x2e972f){return{'name':_0x2e972f[_0x504a('0x29')],'type':_0x2e972f['type'][_0x504a('0x2a')]};});_0x49960d[_0x504a('0x2b')]=_[_0x504a('0x26')](_0x32053f,_0x504a('0x24'));_0x49960d[_0x504a('0x2c')]=_[_0x504a('0x2d')](_0x20f907[_0x504a('0x2c')]);_0x49960d[_0x504a('0x2e')]=_[_0x504a('0x2f')](_0x49960d[_0x504a('0x2b')],_0x49960d[_0x504a('0x2c')]);_0x182e74[_0x504a('0x30')]=_[_0x504a('0x2f')](_0x49960d[_0x504a('0x2b')],qs[_0x504a('0x31')](_0x20f907['query'][_0x504a('0x31')]));_0x182e74[_0x504a('0x30')]=_0x182e74[_0x504a('0x30')]['length']?_0x182e74[_0x504a('0x30')]:_0x49960d[_0x504a('0x2b')];if(!_0x20f907[_0x504a('0x2c')][_0x504a('0x32')]('nolimit')){_0x182e74[_0x504a('0x18')]=qs[_0x504a('0x18')](_0x20f907['query'][_0x504a('0x18')]);_0x182e74['offset']=qs['offset'](_0x20f907['query'][_0x504a('0x1a')]);}_0x182e74[_0x504a('0x33')]=qs[_0x504a('0x34')](_0x20f907[_0x504a('0x2c')][_0x504a('0x34')]);_0x182e74[_0x504a('0x35')]=qs[_0x504a('0x2e')](_[_0x504a('0x36')](_0x20f907[_0x504a('0x2c')],_0x49960d[_0x504a('0x2e')]),_0x32053f);if(_0x20f907['query'][_0x504a('0x37')]){_0x182e74[_0x504a('0x35')]=_[_0x504a('0x38')](_0x182e74[_0x504a('0x35')],{'$or':_[_0x504a('0x26')](_0x32053f,function(_0x1caf5a){if(_0x1caf5a[_0x504a('0x39')]!==_0x504a('0x3a')){var _0x55571c={};_0x55571c[_0x1caf5a[_0x504a('0x24')]]={'$like':'%'+_0x20f907[_0x504a('0x2c')][_0x504a('0x37')]+'%'};return _0x55571c;}})});}_0x182e74=_[_0x504a('0x38')]({},_0x182e74,_0x20f907['options']);var _0x13c6aa={'where':_0x182e74[_0x504a('0x35')]};return db['Migration'][_0x504a('0x19')](_0x13c6aa)[_0x504a('0x21')](function(_0x57289d){_0x4627d7[_0x504a('0x19')]=_0x57289d;if(_0x20f907[_0x504a('0x2c')][_0x504a('0x3b')]){_0x182e74[_0x504a('0x3c')]=[{'all':!![]}];}return db[_0x504a('0x27')]['findAll'](_0x182e74);})[_0x504a('0x21')](function(_0x38b4e5){_0x4627d7[_0x504a('0x3d')]=_0x38b4e5;return _0x4627d7;})[_0x504a('0x21')](respondWithFilteredResult(_0x35248f,_0x182e74))['catch'](handleError(_0x35248f,null));};
\ No newline at end of file
index 2820e48..a44d299 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd14b=['Migration','migrations','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./migration.attributes','exports','define'];(function(_0x2d03ad,_0x31b8d8){var _0x26bc20=function(_0x21e2e3){while(--_0x21e2e3){_0x2d03ad['push'](_0x2d03ad['shift']());}};_0x26bc20(++_0x31b8d8);}(_0xd14b,0x13a));var _0xbd14=function(_0x550ac4,_0x1f0436){_0x550ac4=_0x550ac4-0x0;var _0x3b1091=_0xd14b[_0x550ac4];return _0x3b1091;};'use strict';var _=require(_0xbd14('0x0'));var util=require(_0xbd14('0x1'));var logger=require(_0xbd14('0x2'))(_0xbd14('0x3'));var moment=require('moment');var BPromise=require(_0xbd14('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbd14('0x5'));var rimraf=require(_0xbd14('0x6'));var config=require(_0xbd14('0x7'));var attributes=require(_0xbd14('0x8'));module[_0xbd14('0x9')]=function(_0xdd85b7,_0x85eac1){return _0xdd85b7[_0xbd14('0xa')](_0xbd14('0xb'),attributes,{'tableName':_0xbd14('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3830=['migrations','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports','Migration'];(function(_0x54edc9,_0x345f01){var _0x2ae7a9=function(_0x24a545){while(--_0x24a545){_0x54edc9['push'](_0x54edc9['shift']());}};_0x2ae7a9(++_0x345f01);}(_0x3830,0x12a));var _0x0383=function(_0x2e409e,_0x2d227e){_0x2e409e=_0x2e409e-0x0;var _0xe6e039=_0x3830[_0x2e409e];return _0xe6e039;};'use strict';var _=require('lodash');var util=require(_0x0383('0x0'));var logger=require(_0x0383('0x1'))(_0x0383('0x2'));var moment=require(_0x0383('0x3'));var BPromise=require(_0x0383('0x4'));var rp=require(_0x0383('0x5'));var fs=require('fs');var path=require(_0x0383('0x6'));var rimraf=require('rimraf');var config=require(_0x0383('0x7'));var attributes=require('./migration.attributes');module[_0x0383('0x8')]=function(_0x57cb3d,_0x49b507){return _0x57cb3d['define'](_0x0383('0x9'),attributes,{'tableName':_0x0383('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 6e0a79b..775ffaa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6f7a=['http','request','then','info','debug','Migration,\x20%s,\x20%s,\x20%s','stringify','error','code','Migration,\x20%s,\x20%s','message','request\x20sent','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x492b1c,_0x58840e){var _0xfd2d4c=function(_0x468aa){while(--_0x468aa){_0x492b1c['push'](_0x492b1c['shift']());}};_0xfd2d4c(++_0x58840e);}(_0x6f7a,0x1ae));var _0xa6f7=function(_0x44606d,_0x3119ec){_0x44606d=_0x44606d-0x0;var _0x61b76f=_0x6f7a[_0x44606d];return _0x61b76f;};'use strict';var _=require(_0xa6f7('0x0'));var util=require(_0xa6f7('0x1'));var moment=require(_0xa6f7('0x2'));var BPromise=require(_0xa6f7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa6f7('0x4'));var db=require(_0xa6f7('0x5'))['db'];var utils=require(_0xa6f7('0x6'));var logger=require(_0xa6f7('0x7'))(_0xa6f7('0x8'));var config=require(_0xa6f7('0x9'));var jayson=require(_0xa6f7('0xa'));var client=jayson[_0xa6f7('0xb')][_0xa6f7('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x335aaa,_0x1a06d1,_0x481a8c){return new BPromise(function(_0x4b4f9e,_0x30f2a7){return client[_0xa6f7('0xd')](_0x335aaa,_0x481a8c)[_0xa6f7('0xe')](function(_0x362404){logger[_0xa6f7('0xf')]('Migration,\x20%s,\x20%s',_0x1a06d1,'request\x20sent');logger[_0xa6f7('0x10')](_0xa6f7('0x11'),_0x1a06d1,'request\x20sent',JSON[_0xa6f7('0x12')](_0x362404));if(_0x362404['error']){if(_0x362404[_0xa6f7('0x13')][_0xa6f7('0x14')]===0x1f4){logger[_0xa6f7('0x13')](_0xa6f7('0x15'),_0x1a06d1,_0x362404['error'][_0xa6f7('0x16')]);return _0x30f2a7(_0x362404['error'][_0xa6f7('0x16')]);}logger[_0xa6f7('0x13')](_0xa6f7('0x15'),_0x1a06d1,_0x362404['error'][_0xa6f7('0x16')]);return _0x4b4f9e(_0x362404['error'][_0xa6f7('0x16')]);}else{logger['info'](_0xa6f7('0x15'),_0x1a06d1,_0xa6f7('0x17'));_0x4b4f9e(_0x362404[_0xa6f7('0x18')]['message']);}})[_0xa6f7('0x19')](function(_0x22635e){logger[_0xa6f7('0x13')](_0xa6f7('0x15'),_0x1a06d1,_0x22635e);_0x30f2a7(_0x22635e);});});}
\ No newline at end of file
+var _0xc94f=['../../config/utils','../../config/logger','rpc','../../config/environment','request','then','info','debug','Migration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','Migration,\x20%s,\x20%s','message','catch','lodash','moment','bluebird','ioredis'];(function(_0x5c0f9d,_0x3750a1){var _0x4fe4af=function(_0x4c73be){while(--_0x4c73be){_0x5c0f9d['push'](_0x5c0f9d['shift']());}};_0x4fe4af(++_0x3750a1);}(_0xc94f,0xcd));var _0xfc94=function(_0x367253,_0x15d9fb){_0x367253=_0x367253-0x0;var _0x150e8e=_0xc94f[_0x367253];return _0x150e8e;};'use strict';var _=require(_0xfc94('0x0'));var util=require('util');var moment=require(_0xfc94('0x1'));var BPromise=require(_0xfc94('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfc94('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xfc94('0x4'));var logger=require(_0xfc94('0x5'))(_0xfc94('0x6'));var config=require(_0xfc94('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x402ee9,_0xff28ad,_0x4dc395){return new BPromise(function(_0xe044e8,_0x47afb8){return client[_0xfc94('0x8')](_0x402ee9,_0x4dc395)[_0xfc94('0x9')](function(_0x4212af){logger[_0xfc94('0xa')]('Migration,\x20%s,\x20%s',_0xff28ad,'request\x20sent');logger[_0xfc94('0xb')](_0xfc94('0xc'),_0xff28ad,_0xfc94('0xd'),JSON[_0xfc94('0xe')](_0x4212af));if(_0x4212af[_0xfc94('0xf')]){if(_0x4212af[_0xfc94('0xf')]['code']===0x1f4){logger['error'](_0xfc94('0x10'),_0xff28ad,_0x4212af[_0xfc94('0xf')][_0xfc94('0x11')]);return _0x47afb8(_0x4212af[_0xfc94('0xf')]['message']);}logger[_0xfc94('0xf')](_0xfc94('0x10'),_0xff28ad,_0x4212af[_0xfc94('0xf')][_0xfc94('0x11')]);return _0xe044e8(_0x4212af[_0xfc94('0xf')]['message']);}else{logger[_0xfc94('0xa')]('Migration,\x20%s,\x20%s',_0xff28ad,_0xfc94('0xd'));_0xe044e8(_0x4212af['result'][_0xfc94('0x11')]);}})[_0xfc94('0x12')](function(_0x2f7bd6){logger['error'](_0xfc94('0x10'),_0xff28ad,_0x2f7bd6);_0x47afb8(_0x2f7bd6);});});}
\ No newline at end of file
index 332e86b..006fd49 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x27fb=['path','express','fs-extra','../../components/auth/service','../../components/interaction/service','./network.controller','isAuthenticated','index','get','/:id','post','put','update','exports','multer','util'];(function(_0x2c4a8b,_0x33a904){var _0x319a6a=function(_0x23eb50){while(--_0x23eb50){_0x2c4a8b['push'](_0x2c4a8b['shift']());}};_0x319a6a(++_0x33a904);}(_0x27fb,0x1de));var _0xb27f=function(_0x8f472b,_0x39ef2c){_0x8f472b=_0x8f472b-0x0;var _0x3c79e4=_0x27fb[_0x8f472b];return _0x3c79e4;};'use strict';var multer=require(_0xb27f('0x0'));var util=require(_0xb27f('0x1'));var path=require(_0xb27f('0x2'));var timeout=require('connect-timeout');var express=require(_0xb27f('0x3'));var router=express['Router']();var fs_extra=require(_0xb27f('0x4'));var auth=require(_0xb27f('0x5'));var interaction=require(_0xb27f('0x6'));var config=require('../../config/environment');var controller=require(_0xb27f('0x7'));router['get']('/',auth[_0xb27f('0x8')](),controller[_0xb27f('0x9')]);router[_0xb27f('0xa')](_0xb27f('0xb'),auth[_0xb27f('0x8')](),controller['show']);router[_0xb27f('0xc')]('/',auth[_0xb27f('0x8')](),controller['create']);router[_0xb27f('0xd')](_0xb27f('0xb'),auth[_0xb27f('0x8')](),controller[_0xb27f('0xe')]);router['delete'](_0xb27f('0xb'),auth[_0xb27f('0x8')](),controller['destroy']);module[_0xb27f('0xf')]=router;
\ No newline at end of file
+var _0x87e5=['../../components/auth/service','../../components/interaction/service','../../config/environment','./network.controller','get','index','/:id','isAuthenticated','show','update','delete','destroy','exports','multer','util','connect-timeout','express','fs-extra'];(function(_0x5c2320,_0x543863){var _0x50d333=function(_0x474731){while(--_0x474731){_0x5c2320['push'](_0x5c2320['shift']());}};_0x50d333(++_0x543863);}(_0x87e5,0xc1));var _0x587e=function(_0x4f1ee6,_0x3a0ac1){_0x4f1ee6=_0x4f1ee6-0x0;var _0x331ef3=_0x87e5[_0x4f1ee6];return _0x331ef3;};'use strict';var multer=require(_0x587e('0x0'));var util=require(_0x587e('0x1'));var path=require('path');var timeout=require(_0x587e('0x2'));var express=require(_0x587e('0x3'));var router=express['Router']();var fs_extra=require(_0x587e('0x4'));var auth=require(_0x587e('0x5'));var interaction=require(_0x587e('0x6'));var config=require(_0x587e('0x7'));var controller=require(_0x587e('0x8'));router[_0x587e('0x9')]('/',auth['isAuthenticated'](),controller[_0x587e('0xa')]);router[_0x587e('0x9')](_0x587e('0xb'),auth[_0x587e('0xc')](),controller[_0x587e('0xd')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['put']('/:id',auth[_0x587e('0xc')](),controller[_0x587e('0xe')]);router[_0x587e('0xf')](_0x587e('0xb'),auth[_0x587e('0xc')](),controller[_0x587e('0x10')]);module[_0x587e('0x11')]=router;
\ No newline at end of file
index 496495a..dcfd9b8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfbd9=['turn','STRING','sequelize','externip'];(function(_0x5793be,_0x12fafd){var _0x3b5b5f=function(_0x550ec3){while(--_0x550ec3){_0x5793be['push'](_0x5793be['shift']());}};_0x3b5b5f(++_0x12fafd);}(_0xfbd9,0x8a));var _0x9fbd=function(_0x2d0072,_0x35bf77){_0x2d0072=_0x2d0072-0x0;var _0x17c532=_0xfbd9[_0x2d0072];return _0x17c532;};'use strict';var Sequelize=require(_0x9fbd('0x0'));module['exports']={'type':{'type':Sequelize['ENUM']('localnet',_0x9fbd('0x1'),'stun',_0x9fbd('0x2'))},'value':{'type':Sequelize[_0x9fbd('0x3')]},'username':{'type':Sequelize[_0x9fbd('0x3')]},'password':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x9e21=['stun','turn','STRING','sequelize','exports','ENUM','localnet','externip'];(function(_0x5af71b,_0x49f005){var _0x2bc83e=function(_0x14e999){while(--_0x14e999){_0x5af71b['push'](_0x5af71b['shift']());}};_0x2bc83e(++_0x49f005);}(_0x9e21,0x113));var _0x19e2=function(_0x75dc87,_0x6be1f2){_0x75dc87=_0x75dc87-0x0;var _0x24b41d=_0x9e21[_0x75dc87];return _0x24b41d;};'use strict';var Sequelize=require(_0x19e2('0x0'));module[_0x19e2('0x1')]={'type':{'type':Sequelize[_0x19e2('0x2')](_0x19e2('0x3'),_0x19e2('0x4'),_0x19e2('0x5'),_0x19e2('0x6'))},'value':{'type':Sequelize[_0x19e2('0x7')]},'username':{'type':Sequelize[_0x19e2('0x7')]},'password':{'type':Sequelize[_0x19e2('0x7')]}};
\ No newline at end of file
index 5e6592b..5f04a1b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x04a5=['save','update','destroy','end','stack','name','map','Network','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','sort','filters','pick','where','count','includeAll','include','findAll','rows','show','params','merge','options','find','create','transaction','body','toUpperCase','STUN','join','root','server/files/templates/stun_multiple.ejs','utf8','render','/etc/asterisk/stun_xcally.conf','res_stun_monitor.so','readFileSync','server/files/templates/turn_multiple.ejs','writeFileSync','/etc/asterisk/turn_xcally.conf','Reload','server/files/templates/network.ejs','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','sequelize','format','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','then','info','Network,\x20%s,\x20%s','debug','Network,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','sendStatus','status','offset','undefined','limit','set','Content-Range','json','apply','reject'];(function(_0x28fbe3,_0x4ac6f8){var _0x45db6a=function(_0x296ecb){while(--_0x296ecb){_0x28fbe3['push'](_0x28fbe3['shift']());}};_0x45db6a(++_0x4ac6f8);}(_0x04a5,0x9a));var _0x504a=function(_0xf4add4,_0x5b9cc1){_0xf4add4=_0xf4add4-0x0;var _0x1c42fb=_0x04a5[_0xf4add4];return _0x1c42fb;};'use strict';var emlformat=require(_0x504a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x504a('0x1'));var jsonpatch=require(_0x504a('0x2'));var rp=require(_0x504a('0x3'));var moment=require('moment');var BPromise=require(_0x504a('0x4'));var Mustache=require(_0x504a('0x5'));var util=require('util');var path=require('path');var sox=require(_0x504a('0x6'));var csv=require(_0x504a('0x7'));var ejs=require(_0x504a('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x504a('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x504a('0xa'));var deskjs=require(_0x504a('0xb'));var toCsv=require(_0x504a('0x7'));var querystring=require(_0x504a('0xc'));var Papa=require('papaparse');var Redis=require(_0x504a('0xd'));var authService=require(_0x504a('0xe'));var qs=require(_0x504a('0xf'));var as=require(_0x504a('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x504a('0x11'))(_0x504a('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x504a('0x13'));var db=require(_0x504a('0x14'))['db'];var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5e5f87,_0x1e0643,_0x43f7d2,_0x402630){return new BPromise(function(_0x35d5a6,_0xb304a2){var _0x5d2a8a=_0x402630||client;return _0x5d2a8a['request'](_0x5e5f87,_0x43f7d2)[_0x504a('0x15')](function(_0x450ec4){logger[_0x504a('0x16')](_0x504a('0x17'),_0x1e0643,'request\x20sent');logger[_0x504a('0x18')](_0x504a('0x19'),_0x1e0643,_0x504a('0x1a'),JSON[_0x504a('0x1b')](_0x450ec4));if(_0x450ec4[_0x504a('0x1c')]){if(_0x450ec4[_0x504a('0x1c')]['code']===0x1f4){logger[_0x504a('0x1c')]('Network,\x20%s,\x20%s',_0x1e0643,_0x450ec4[_0x504a('0x1c')]['message']);return _0xb304a2(_0x450ec4[_0x504a('0x1c')]['message']);}logger['error'](_0x504a('0x17'),_0x1e0643,_0x450ec4[_0x504a('0x1c')][_0x504a('0x1d')]);return _0x35d5a6(_0x450ec4['error'][_0x504a('0x1d')]);}else{logger[_0x504a('0x16')](_0x504a('0x17'),_0x1e0643,_0x504a('0x1a'));_0x35d5a6(_0x450ec4[_0x504a('0x1e')][_0x504a('0x1d')]);}})[_0x504a('0x1f')](function(_0x53bac4){logger['error'](_0x504a('0x17'),_0x1e0643,_0x53bac4);_0xb304a2(_0x53bac4);});});}function respondWithStatusCode(_0x3f090c,_0x5d76f8){_0x5d76f8=_0x5d76f8||0xcc;return function(_0x586c3d){if(_0x586c3d){return _0x3f090c[_0x504a('0x20')](_0x5d76f8);}return _0x3f090c[_0x504a('0x21')](_0x5d76f8)['end']();};}function respondWithResult(_0x28391f,_0x59e1a2){_0x59e1a2=_0x59e1a2||0xc8;return function(_0x37e193){if(_0x37e193){return _0x28391f['status'](_0x59e1a2)['json'](_0x37e193);}};}function respondWithFilteredResult(_0x2881d0,_0x345bb2){return function(_0x3e5c0c){if(_0x3e5c0c){var _0x182af9=typeof _0x345bb2[_0x504a('0x22')]===_0x504a('0x23')&&typeof _0x345bb2['limit']==='undefined';var _0x346673=_0x3e5c0c['count'];var _0x20f907=_0x182af9?0x0:_0x345bb2[_0x504a('0x22')];var _0x182e74=_0x182af9?_0x3e5c0c['count']:_0x345bb2[_0x504a('0x22')]+_0x345bb2[_0x504a('0x24')];var _0xfdbf3c;if(_0x182e74>=_0x346673){_0x182e74=_0x346673;_0xfdbf3c=0xc8;}else{_0xfdbf3c=0xce;}_0x2881d0[_0x504a('0x21')](_0xfdbf3c);return _0x2881d0[_0x504a('0x25')](_0x504a('0x26'),_0x20f907+'-'+_0x182e74+'/'+_0x346673)[_0x504a('0x27')](_0x3e5c0c);}return null;};}function patchUpdates(_0x501903){return function(_0x38259b){try{jsonpatch[_0x504a('0x28')](_0x38259b,_0x501903,!![]);}catch(_0x23d9d1){return BPromise[_0x504a('0x29')](_0x23d9d1);}return _0x38259b[_0x504a('0x2a')]();};}function saveUpdates(_0x2dd134,_0x2eb26d){return function(_0x23db51){if(_0x23db51){return _0x23db51[_0x504a('0x2b')](_0x2dd134)[_0x504a('0x15')](function(_0xe36dcc){return _0xe36dcc;});}return null;};}function removeEntity(_0x7c6a5b,_0x2bfe14){return function(_0x23cc62){if(_0x23cc62){return _0x23cc62[_0x504a('0x2c')]()['then'](function(){_0x7c6a5b[_0x504a('0x21')](0xcc)[_0x504a('0x2d')]();});}};}function handleEntityNotFound(_0x134f08,_0x4df4a3){return function(_0xe63dd4){if(!_0xe63dd4){_0x134f08[_0x504a('0x20')](0x194);}return _0xe63dd4;};}function handleError(_0x28d905,_0x33871d){_0x33871d=_0x33871d||0x1f4;return function(_0x542d9b){logger[_0x504a('0x1c')](_0x542d9b[_0x504a('0x2e')]);if(_0x542d9b['name']){delete _0x542d9b[_0x504a('0x2f')];}_0x28d905['status'](_0x33871d)['send'](_0x542d9b);};}exports['index']=function(_0x2b72a1,_0x2a9f10){var _0x204a4b={},_0x1a7652={},_0x19380d={'count':0x0,'rows':[]};var _0xcb237e=_[_0x504a('0x30')](db[_0x504a('0x31')][_0x504a('0x32')],function(_0x44adbe){return{'name':_0x44adbe['fieldName'],'type':_0x44adbe[_0x504a('0x33')][_0x504a('0x34')]};});_0x1a7652[_0x504a('0x35')]=_[_0x504a('0x30')](_0xcb237e,_0x504a('0x2f'));_0x1a7652[_0x504a('0x36')]=_[_0x504a('0x37')](_0x2b72a1[_0x504a('0x36')]);_0x1a7652['filters']=_[_0x504a('0x38')](_0x1a7652[_0x504a('0x35')],_0x1a7652[_0x504a('0x36')]);_0x204a4b[_0x504a('0x39')]=_['intersection'](_0x1a7652[_0x504a('0x35')],qs[_0x504a('0x3a')](_0x2b72a1['query'][_0x504a('0x3a')]));_0x204a4b[_0x504a('0x39')]=_0x204a4b['attributes'][_0x504a('0x3b')]?_0x204a4b[_0x504a('0x39')]:_0x1a7652[_0x504a('0x35')];if(!_0x2b72a1[_0x504a('0x36')][_0x504a('0x3c')]('nolimit')){_0x204a4b[_0x504a('0x24')]=qs[_0x504a('0x24')](_0x2b72a1[_0x504a('0x36')][_0x504a('0x24')]);_0x204a4b['offset']=qs[_0x504a('0x22')](_0x2b72a1[_0x504a('0x36')][_0x504a('0x22')]);}_0x204a4b['order']=qs[_0x504a('0x3d')](_0x2b72a1['query'][_0x504a('0x3d')]);_0x204a4b['where']=qs[_0x504a('0x3e')](_[_0x504a('0x3f')](_0x2b72a1[_0x504a('0x36')],_0x1a7652[_0x504a('0x3e')]),_0xcb237e);if(_0x2b72a1[_0x504a('0x36')]['filter']){_0x204a4b[_0x504a('0x40')]=_['merge'](_0x204a4b[_0x504a('0x40')],{'$or':_[_0x504a('0x30')](_0xcb237e,function(_0x541298){if(_0x541298[_0x504a('0x33')]!=='VIRTUAL'){var _0x511be8={};_0x511be8[_0x541298['name']]={'$like':'%'+_0x2b72a1[_0x504a('0x36')]['filter']+'%'};return _0x511be8;}})});}_0x204a4b=_['merge']({},_0x204a4b,_0x2b72a1['options']);var _0x326cea={'where':_0x204a4b[_0x504a('0x40')]};return db[_0x504a('0x31')][_0x504a('0x41')](_0x326cea)[_0x504a('0x15')](function(_0xfeb20e){_0x19380d['count']=_0xfeb20e;if(_0x2b72a1[_0x504a('0x36')][_0x504a('0x42')]){_0x204a4b[_0x504a('0x43')]=[{'all':!![]}];}return db[_0x504a('0x31')][_0x504a('0x44')](_0x204a4b);})['then'](function(_0x3a57c0){_0x19380d[_0x504a('0x45')]=_0x3a57c0;return _0x19380d;})['then'](respondWithFilteredResult(_0x2a9f10,_0x204a4b))[_0x504a('0x1f')](handleError(_0x2a9f10,null));};exports[_0x504a('0x46')]=function(_0x416cb0,_0x2464a8){var _0x700e49={'raw':!![],'where':{'id':_0x416cb0[_0x504a('0x47')]['id']}},_0x22857c={};_0x22857c[_0x504a('0x35')]=_['keys'](db[_0x504a('0x31')][_0x504a('0x32')]);_0x22857c[_0x504a('0x36')]=_[_0x504a('0x37')](_0x416cb0['query']);_0x22857c['filters']=_['intersection'](_0x22857c[_0x504a('0x35')],_0x22857c[_0x504a('0x36')]);_0x700e49['attributes']=_[_0x504a('0x38')](_0x22857c[_0x504a('0x35')],qs[_0x504a('0x3a')](_0x416cb0[_0x504a('0x36')][_0x504a('0x3a')]));_0x700e49[_0x504a('0x39')]=_0x700e49[_0x504a('0x39')][_0x504a('0x3b')]?_0x700e49[_0x504a('0x39')]:_0x22857c[_0x504a('0x35')];if(_0x416cb0[_0x504a('0x36')][_0x504a('0x42')]){_0x700e49[_0x504a('0x43')]=[{'all':!![]}];}_0x700e49=_[_0x504a('0x48')]({},_0x700e49,_0x416cb0[_0x504a('0x49')]);return db['Network'][_0x504a('0x4a')](_0x700e49)[_0x504a('0x15')](handleEntityNotFound(_0x2464a8,null))[_0x504a('0x15')](respondWithResult(_0x2464a8,null))['catch'](handleError(_0x2464a8,null));};exports[_0x504a('0x4b')]=function(_0x3d7b78,_0x4311ad,_0x27cbb2){var _0x4128f2;return db['sequelize'][_0x504a('0x4c')](function(_0x49cfeb){return db[_0x504a('0x31')][_0x504a('0x4b')](_0x3d7b78[_0x504a('0x4d')],{'raw':!![]})['then'](function(_0x5fecf5){_0x4128f2=_0x5fecf5;return db[_0x504a('0x31')][_0x504a('0x44')]({'where':{'type':_0x3d7b78['body'][_0x504a('0x33')]},'raw':!![]});})[_0x504a('0x15')](function(_0x45e185){if(_0x4128f2['type'][_0x504a('0x4e')]()==_0x504a('0x4f')){var _0x220be9=fs['readFileSync'](path[_0x504a('0x50')](config[_0x504a('0x51')],_0x504a('0x52')),_0x504a('0x53'));var _0x42a3cf=ejs[_0x504a('0x54')](_0x220be9,{'networks':_0x45e185||[]});fs['writeFileSync'](_0x504a('0x55'),_0x42a3cf);return respondWithRpcPromise('Reload','create',{'module':_0x504a('0x56')});}else if(_0x4128f2[_0x504a('0x33')]['toUpperCase']()=='TURN'){var _0x382a46=fs[_0x504a('0x57')](path[_0x504a('0x50')](config['root'],_0x504a('0x58')),_0x504a('0x53'));var _0x183763=ejs[_0x504a('0x54')](_0x382a46,{'networks':_0x45e185||[]});fs[_0x504a('0x59')](_0x504a('0x5a'),_0x183763);return respondWithRpcPromise(_0x504a('0x5b'),'create',{'module':_0x504a('0x56')});}else{var _0xd52533=fs[_0x504a('0x57')](path[_0x504a('0x50')](config[_0x504a('0x51')],_0x504a('0x5c')),_0x504a('0x53'));var _0x518d84=ejs[_0x504a('0x54')](_0xd52533,{'networks':_0x45e185||[]});fs['writeFileSync'](util['format'](_0x504a('0x5d'),_0x3d7b78[_0x504a('0x4d')][_0x504a('0x33')][_0x504a('0x5e')]()),_0x518d84);return respondWithRpcPromise(_0x504a('0x5b'),_0x504a('0x4b'),{'module':_0x504a('0x5f')});}return null;})[_0x504a('0x15')](function(){return _0x4128f2;});})[_0x504a('0x15')](respondWithResult(_0x4311ad,0xc9))[_0x504a('0x1f')](handleError(_0x4311ad,null));};exports[_0x504a('0x2b')]=function(_0x48c420,_0x3863b7,_0x26fe23){var _0x307b08;return db[_0x504a('0x60')][_0x504a('0x4c')](function(_0x49cbe3){return db[_0x504a('0x31')]['find']({'where':{'id':_0x48c420[_0x504a('0x47')]['id']}})[_0x504a('0x15')](handleEntityNotFound(_0x3863b7,null))[_0x504a('0x15')](saveUpdates(_0x48c420[_0x504a('0x4d')],null))[_0x504a('0x15')](function(_0x2bcc92){if(_0x2bcc92){_0x307b08=_0x2bcc92;return db[_0x504a('0x31')][_0x504a('0x44')]({'where':{'type':_0x307b08['type']},'raw':!![]});}return null;})[_0x504a('0x15')](function(_0x4a4be2){if(_0x307b08[_0x504a('0x33')][_0x504a('0x4e')]()==_0x504a('0x4f')){var _0x39d77e=fs['readFileSync'](path[_0x504a('0x50')](config[_0x504a('0x51')],_0x504a('0x52')),_0x504a('0x53'));var _0x2c214c=ejs[_0x504a('0x54')](_0x39d77e,{'networks':_0x4a4be2||[]});fs['writeFileSync']('/etc/asterisk/stun_xcally.conf',_0x2c214c);return respondWithRpcPromise(_0x504a('0x5b'),_0x504a('0x2b'),{'module':_0x504a('0x56')});}else if(_0x307b08[_0x504a('0x33')][_0x504a('0x4e')]()=='TURN'){var _0x18213b=fs[_0x504a('0x57')](path[_0x504a('0x50')](config[_0x504a('0x51')],_0x504a('0x58')),_0x504a('0x53'));var _0x25528f=ejs[_0x504a('0x54')](_0x18213b,{'networks':_0x4a4be2||[]});fs[_0x504a('0x59')](_0x504a('0x5a'),_0x25528f);return respondWithRpcPromise(_0x504a('0x5b'),'update',{'module':_0x504a('0x56')});}else{var _0x24364d=fs[_0x504a('0x57')](path[_0x504a('0x50')](config[_0x504a('0x51')],_0x504a('0x5c')),_0x504a('0x53'));var _0x47a920=ejs[_0x504a('0x54')](_0x24364d,{'networks':_0x4a4be2||[]});fs[_0x504a('0x59')](util[_0x504a('0x61')]('/etc/asterisk/sip_xcally_%s.conf',_0x48c420['body'][_0x504a('0x33')][_0x504a('0x5e')]()),_0x47a920);return respondWithRpcPromise(_0x504a('0x5b'),_0x504a('0x2b'),{'module':_0x504a('0x5f')});}return null;})['then'](function(_0x3d7602){if(_0x3d7602){return _0x307b08;}return null;});})[_0x504a('0x15')](respondWithResult(_0x3863b7,null))[_0x504a('0x1f')](handleError(_0x3863b7,null));};exports['destroy']=function(_0x31c991,_0x17e9e9,_0x125012){var _0x24ee40;return db[_0x504a('0x31')][_0x504a('0x4a')]({'where':{'id':_0x31c991[_0x504a('0x47')]['id']}})[_0x504a('0x15')](function(_0x47763b){_0x24ee40=_0x47763b;return _0x47763b;})[_0x504a('0x15')](handleEntityNotFound(_0x17e9e9,null))['then'](removeEntity(_0x17e9e9,null))['then'](function(){if(_0x24ee40){return db[_0x504a('0x31')]['findAll']({'where':{'type':_0x24ee40[_0x504a('0x33')]},'raw':!![]});}})['then'](function(_0x40a952){if(_0x24ee40[_0x504a('0x33')]['toUpperCase']()==_0x504a('0x4f')){var _0x5766cf=fs[_0x504a('0x57')](path[_0x504a('0x50')](config['root'],_0x504a('0x52')),_0x504a('0x53'));var _0xc1bd7f=ejs[_0x504a('0x54')](_0x5766cf,{'networks':_0x40a952||[]});fs['writeFileSync'](_0x504a('0x55'),_0xc1bd7f);return respondWithRpcPromise(_0x504a('0x5b'),_0x504a('0x2c'),{'module':_0x504a('0x56')});}else if(_0x24ee40[_0x504a('0x33')][_0x504a('0x4e')]()=='TURN'){var _0x5dd2c4=fs['readFileSync'](path['join'](config[_0x504a('0x51')],'server/files/templates/turn_multiple.ejs'),_0x504a('0x53'));var _0x332dee=ejs['render'](_0x5dd2c4,{'networks':_0x40a952||[]});fs[_0x504a('0x59')](_0x504a('0x5a'),_0x332dee);return respondWithRpcPromise(_0x504a('0x5b'),_0x504a('0x2c'),{'module':_0x504a('0x56')});}else{var _0x20de4f=fs[_0x504a('0x57')](path[_0x504a('0x50')](config['root'],_0x504a('0x5c')),_0x504a('0x53'));var _0x22dbb8=ejs[_0x504a('0x54')](_0x20de4f,{'networks':_0x40a952||[]});fs[_0x504a('0x59')](util['format']('/etc/asterisk/sip_xcally_%s.conf',_0x31c991[_0x504a('0x4d')][_0x504a('0x33')][_0x504a('0x5e')]()),_0x22dbb8);return respondWithRpcPromise('Reload',_0x504a('0x2c'),{'module':_0x504a('0x5f')});}return null;})['catch'](handleError(_0x17e9e9,null));};
\ No newline at end of file
+var _0x1155=['map','query','keys','filters','attributes','intersection','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','Network','includeAll','include','findAll','show','params','rawAttributes','fields','find','create','sequelize','transaction','body','toUpperCase','STUN','readFileSync','join','root','server/files/templates/stun_multiple.ejs','utf8','render','/etc/asterisk/stun_xcally.conf','Reload','res_stun_monitor.so','server/files/templates/turn_multiple.ejs','writeFileSync','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','TURN','format','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','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','client','http','then','info','debug','Network,\x20%s,\x20%s,\x20%s','request\x20sent','error','Network,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','destroy','stack','name','index','fieldName','type','key','model'];(function(_0x167e93,_0x4c12c6){var _0x4390fe=function(_0x30fe05){while(--_0x30fe05){_0x167e93['push'](_0x167e93['shift']());}};_0x4390fe(++_0x4c12c6);}(_0x1155,0x1dd));var _0x5115=function(_0x33f68b,_0x4ae870){_0x33f68b=_0x33f68b-0x0;var _0x557c04=_0x1155[_0x33f68b];return _0x557c04;};'use strict';var emlformat=require(_0x5115('0x0'));var rimraf=require(_0x5115('0x1'));var zipdir=require(_0x5115('0x2'));var jsonpatch=require(_0x5115('0x3'));var rp=require(_0x5115('0x4'));var moment=require(_0x5115('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x5115('0x6'));var util=require(_0x5115('0x7'));var path=require(_0x5115('0x8'));var sox=require(_0x5115('0x9'));var csv=require(_0x5115('0xa'));var ejs=require(_0x5115('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x5115('0xc'));var jsforce=require(_0x5115('0xd'));var deskjs=require(_0x5115('0xe'));var toCsv=require(_0x5115('0xa'));var querystring=require(_0x5115('0xf'));var Papa=require(_0x5115('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x5115('0x11'));var as=require(_0x5115('0x12'));var hardwareService=require(_0x5115('0x13'));var logger=require(_0x5115('0x14'))(_0x5115('0x15'));var utils=require(_0x5115('0x16'));var config=require(_0x5115('0x17'));var licenseUtil=require(_0x5115('0x18'));var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var client=jayson[_0x5115('0x19')][_0x5115('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x5092ee,_0x41a6e0,_0x4df1c8,_0x2be779){return new BPromise(function(_0x5a1fa6,_0x72bc56){var _0x4666e2=_0x2be779||client;return _0x4666e2['request'](_0x5092ee,_0x4df1c8)[_0x5115('0x1b')](function(_0x3bc897){logger[_0x5115('0x1c')]('Network,\x20%s,\x20%s',_0x41a6e0,'request\x20sent');logger[_0x5115('0x1d')](_0x5115('0x1e'),_0x41a6e0,_0x5115('0x1f'),JSON['stringify'](_0x3bc897));if(_0x3bc897[_0x5115('0x20')]){if(_0x3bc897[_0x5115('0x20')]['code']===0x1f4){logger[_0x5115('0x20')](_0x5115('0x21'),_0x41a6e0,_0x3bc897[_0x5115('0x20')][_0x5115('0x22')]);return _0x72bc56(_0x3bc897['error'][_0x5115('0x22')]);}logger['error']('Network,\x20%s,\x20%s',_0x41a6e0,_0x3bc897[_0x5115('0x20')]['message']);return _0x5a1fa6(_0x3bc897[_0x5115('0x20')][_0x5115('0x22')]);}else{logger['info'](_0x5115('0x21'),_0x41a6e0,_0x5115('0x1f'));_0x5a1fa6(_0x3bc897[_0x5115('0x23')]['message']);}})[_0x5115('0x24')](function(_0x5926b8){logger['error']('Network,\x20%s,\x20%s',_0x41a6e0,_0x5926b8);_0x72bc56(_0x5926b8);});});}function respondWithStatusCode(_0x5ca073,_0x48188a){_0x48188a=_0x48188a||0xcc;return function(_0x1ed148){if(_0x1ed148){return _0x5ca073[_0x5115('0x25')](_0x48188a);}return _0x5ca073[_0x5115('0x26')](_0x48188a)[_0x5115('0x27')]();};}function respondWithResult(_0x1deb75,_0x1dfa71){_0x1dfa71=_0x1dfa71||0xc8;return function(_0x4bd892){if(_0x4bd892){return _0x1deb75[_0x5115('0x26')](_0x1dfa71)[_0x5115('0x28')](_0x4bd892);}};}function respondWithFilteredResult(_0x1976fb,_0x542959){return function(_0x550d59){if(_0x550d59){var _0x200da8=typeof _0x542959[_0x5115('0x29')]===_0x5115('0x2a')&&typeof _0x542959['limit']===_0x5115('0x2a');var _0x2746c2=_0x550d59[_0x5115('0x2b')];var _0x39927f=_0x200da8?0x0:_0x542959[_0x5115('0x29')];var _0x37704e=_0x200da8?_0x550d59[_0x5115('0x2b')]:_0x542959[_0x5115('0x29')]+_0x542959[_0x5115('0x2c')];var _0x54a503;if(_0x37704e>=_0x2746c2){_0x37704e=_0x2746c2;_0x54a503=0xc8;}else{_0x54a503=0xce;}_0x1976fb[_0x5115('0x26')](_0x54a503);return _0x1976fb[_0x5115('0x2d')](_0x5115('0x2e'),_0x39927f+'-'+_0x37704e+'/'+_0x2746c2)[_0x5115('0x28')](_0x550d59);}return null;};}function patchUpdates(_0xe068f6){return function(_0x40d718){try{jsonpatch[_0x5115('0x2f')](_0x40d718,_0xe068f6,!![]);}catch(_0x115567){return BPromise[_0x5115('0x30')](_0x115567);}return _0x40d718['save']();};}function saveUpdates(_0x216bb5,_0x256826){return function(_0x28b6a2){if(_0x28b6a2){return _0x28b6a2[_0x5115('0x31')](_0x216bb5)['then'](function(_0x13ebda){return _0x13ebda;});}return null;};}function removeEntity(_0x46f20e,_0x1d0a2d){return function(_0x2474f6){if(_0x2474f6){return _0x2474f6[_0x5115('0x32')]()[_0x5115('0x1b')](function(){_0x46f20e['status'](0xcc)[_0x5115('0x27')]();});}};}function handleEntityNotFound(_0x1cba8e,_0x4f19c5){return function(_0x497b6){if(!_0x497b6){_0x1cba8e['sendStatus'](0x194);}return _0x497b6;};}function handleError(_0x39ca60,_0x5b0c58){_0x5b0c58=_0x5b0c58||0x1f4;return function(_0x1fdef6){logger[_0x5115('0x20')](_0x1fdef6[_0x5115('0x33')]);if(_0x1fdef6['name']){delete _0x1fdef6[_0x5115('0x34')];}_0x39ca60[_0x5115('0x26')](_0x5b0c58)['send'](_0x1fdef6);};}exports[_0x5115('0x35')]=function(_0x49473d,_0x1b411e){var _0x48fc15={},_0x3b6503={},_0x3a5f6b={'count':0x0,'rows':[]};var _0x36e8e2=_['map'](db['Network']['rawAttributes'],function(_0xc354d5){return{'name':_0xc354d5[_0x5115('0x36')],'type':_0xc354d5[_0x5115('0x37')][_0x5115('0x38')]};});_0x3b6503[_0x5115('0x39')]=_[_0x5115('0x3a')](_0x36e8e2,_0x5115('0x34'));_0x3b6503[_0x5115('0x3b')]=_[_0x5115('0x3c')](_0x49473d['query']);_0x3b6503[_0x5115('0x3d')]=_['intersection'](_0x3b6503[_0x5115('0x39')],_0x3b6503['query']);_0x48fc15[_0x5115('0x3e')]=_[_0x5115('0x3f')](_0x3b6503['model'],qs['fields'](_0x49473d[_0x5115('0x3b')]['fields']));_0x48fc15[_0x5115('0x3e')]=_0x48fc15['attributes'][_0x5115('0x40')]?_0x48fc15[_0x5115('0x3e')]:_0x3b6503['model'];if(!_0x49473d[_0x5115('0x3b')][_0x5115('0x41')](_0x5115('0x42'))){_0x48fc15[_0x5115('0x2c')]=qs[_0x5115('0x2c')](_0x49473d[_0x5115('0x3b')][_0x5115('0x2c')]);_0x48fc15['offset']=qs[_0x5115('0x29')](_0x49473d[_0x5115('0x3b')][_0x5115('0x29')]);}_0x48fc15['order']=qs[_0x5115('0x43')](_0x49473d[_0x5115('0x3b')]['sort']);_0x48fc15[_0x5115('0x44')]=qs[_0x5115('0x3d')](_[_0x5115('0x45')](_0x49473d[_0x5115('0x3b')],_0x3b6503[_0x5115('0x3d')]),_0x36e8e2);if(_0x49473d['query'][_0x5115('0x46')]){_0x48fc15[_0x5115('0x44')]=_['merge'](_0x48fc15['where'],{'$or':_[_0x5115('0x3a')](_0x36e8e2,function(_0xd611ef){if(_0xd611ef[_0x5115('0x37')]!==_0x5115('0x47')){var _0x410a41={};_0x410a41[_0xd611ef[_0x5115('0x34')]]={'$like':'%'+_0x49473d['query']['filter']+'%'};return _0x410a41;}})});}_0x48fc15=_[_0x5115('0x48')]({},_0x48fc15,_0x49473d[_0x5115('0x49')]);var _0x24fa48={'where':_0x48fc15[_0x5115('0x44')]};return db[_0x5115('0x4a')]['count'](_0x24fa48)[_0x5115('0x1b')](function(_0x989417){_0x3a5f6b[_0x5115('0x2b')]=_0x989417;if(_0x49473d[_0x5115('0x3b')][_0x5115('0x4b')]){_0x48fc15[_0x5115('0x4c')]=[{'all':!![]}];}return db[_0x5115('0x4a')][_0x5115('0x4d')](_0x48fc15);})[_0x5115('0x1b')](function(_0x4c5024){_0x3a5f6b['rows']=_0x4c5024;return _0x3a5f6b;})[_0x5115('0x1b')](respondWithFilteredResult(_0x1b411e,_0x48fc15))['catch'](handleError(_0x1b411e,null));};exports[_0x5115('0x4e')]=function(_0x5a68ba,_0x10589b){var _0x2e0f80={'raw':!![],'where':{'id':_0x5a68ba[_0x5115('0x4f')]['id']}},_0x11a7cb={};_0x11a7cb[_0x5115('0x39')]=_[_0x5115('0x3c')](db[_0x5115('0x4a')][_0x5115('0x50')]);_0x11a7cb[_0x5115('0x3b')]=_[_0x5115('0x3c')](_0x5a68ba[_0x5115('0x3b')]);_0x11a7cb[_0x5115('0x3d')]=_[_0x5115('0x3f')](_0x11a7cb[_0x5115('0x39')],_0x11a7cb[_0x5115('0x3b')]);_0x2e0f80[_0x5115('0x3e')]=_['intersection'](_0x11a7cb['model'],qs[_0x5115('0x51')](_0x5a68ba[_0x5115('0x3b')]['fields']));_0x2e0f80[_0x5115('0x3e')]=_0x2e0f80[_0x5115('0x3e')][_0x5115('0x40')]?_0x2e0f80['attributes']:_0x11a7cb['model'];if(_0x5a68ba[_0x5115('0x3b')]['includeAll']){_0x2e0f80[_0x5115('0x4c')]=[{'all':!![]}];}_0x2e0f80=_[_0x5115('0x48')]({},_0x2e0f80,_0x5a68ba[_0x5115('0x49')]);return db[_0x5115('0x4a')][_0x5115('0x52')](_0x2e0f80)[_0x5115('0x1b')](handleEntityNotFound(_0x10589b,null))[_0x5115('0x1b')](respondWithResult(_0x10589b,null))[_0x5115('0x24')](handleError(_0x10589b,null));};exports[_0x5115('0x53')]=function(_0x1b622c,_0x1446a5,_0x1f3441){var _0x571dac;return db[_0x5115('0x54')][_0x5115('0x55')](function(_0x90a52d){return db[_0x5115('0x4a')][_0x5115('0x53')](_0x1b622c['body'],{'raw':!![]})['then'](function(_0x808751){_0x571dac=_0x808751;return db[_0x5115('0x4a')][_0x5115('0x4d')]({'where':{'type':_0x1b622c[_0x5115('0x56')][_0x5115('0x37')]},'raw':!![]});})[_0x5115('0x1b')](function(_0x46de59){if(_0x571dac[_0x5115('0x37')][_0x5115('0x57')]()==_0x5115('0x58')){var _0xc74495=fs[_0x5115('0x59')](path[_0x5115('0x5a')](config[_0x5115('0x5b')],_0x5115('0x5c')),_0x5115('0x5d'));var _0x2d8371=ejs[_0x5115('0x5e')](_0xc74495,{'networks':_0x46de59||[]});fs['writeFileSync'](_0x5115('0x5f'),_0x2d8371);return respondWithRpcPromise(_0x5115('0x60'),_0x5115('0x53'),{'module':_0x5115('0x61')});}else if(_0x571dac[_0x5115('0x37')][_0x5115('0x57')]()=='TURN'){var _0x20c1fe=fs[_0x5115('0x59')](path[_0x5115('0x5a')](config[_0x5115('0x5b')],_0x5115('0x62')),_0x5115('0x5d'));var _0x366db9=ejs[_0x5115('0x5e')](_0x20c1fe,{'networks':_0x46de59||[]});fs[_0x5115('0x63')]('/etc/asterisk/turn_xcally.conf',_0x366db9);return respondWithRpcPromise('Reload','create',{'module':_0x5115('0x61')});}else{var _0x1ad185=fs[_0x5115('0x59')](path['join'](config[_0x5115('0x5b')],'server/files/templates/network.ejs'),'utf8');var _0x3e9aa9=ejs[_0x5115('0x5e')](_0x1ad185,{'networks':_0x46de59||[]});fs[_0x5115('0x63')](util['format'](_0x5115('0x64'),_0x1b622c[_0x5115('0x56')][_0x5115('0x37')][_0x5115('0x65')]()),_0x3e9aa9);return respondWithRpcPromise('Reload',_0x5115('0x53'),{'module':_0x5115('0x66')});}return null;})[_0x5115('0x1b')](function(){return _0x571dac;});})[_0x5115('0x1b')](respondWithResult(_0x1446a5,0xc9))[_0x5115('0x24')](handleError(_0x1446a5,null));};exports[_0x5115('0x31')]=function(_0x5945f6,_0x5e2abd,_0x2c5bbe){var _0x58708e;return db[_0x5115('0x54')]['transaction'](function(_0x38cb3e){return db[_0x5115('0x4a')][_0x5115('0x52')]({'where':{'id':_0x5945f6['params']['id']}})['then'](handleEntityNotFound(_0x5e2abd,null))[_0x5115('0x1b')](saveUpdates(_0x5945f6[_0x5115('0x56')],null))[_0x5115('0x1b')](function(_0x51b594){if(_0x51b594){_0x58708e=_0x51b594;return db[_0x5115('0x4a')][_0x5115('0x4d')]({'where':{'type':_0x58708e[_0x5115('0x37')]},'raw':!![]});}return null;})[_0x5115('0x1b')](function(_0x460d1f){if(_0x58708e[_0x5115('0x37')][_0x5115('0x57')]()==_0x5115('0x58')){var _0x2b918d=fs[_0x5115('0x59')](path[_0x5115('0x5a')](config[_0x5115('0x5b')],_0x5115('0x5c')),_0x5115('0x5d'));var _0xd4a992=ejs[_0x5115('0x5e')](_0x2b918d,{'networks':_0x460d1f||[]});fs['writeFileSync'](_0x5115('0x5f'),_0xd4a992);return respondWithRpcPromise('Reload','update',{'module':_0x5115('0x61')});}else if(_0x58708e[_0x5115('0x37')]['toUpperCase']()==_0x5115('0x67')){var _0x5f0373=fs[_0x5115('0x59')](path['join'](config[_0x5115('0x5b')],_0x5115('0x62')),_0x5115('0x5d'));var _0x398165=ejs[_0x5115('0x5e')](_0x5f0373,{'networks':_0x460d1f||[]});fs[_0x5115('0x63')]('/etc/asterisk/turn_xcally.conf',_0x398165);return respondWithRpcPromise(_0x5115('0x60'),'update',{'module':_0x5115('0x61')});}else{var _0x2b7caf=fs['readFileSync'](path[_0x5115('0x5a')](config[_0x5115('0x5b')],'server/files/templates/network.ejs'),_0x5115('0x5d'));var _0x234742=ejs[_0x5115('0x5e')](_0x2b7caf,{'networks':_0x460d1f||[]});fs[_0x5115('0x63')](util[_0x5115('0x68')](_0x5115('0x64'),_0x5945f6[_0x5115('0x56')]['type'][_0x5115('0x65')]()),_0x234742);return respondWithRpcPromise(_0x5115('0x60'),_0x5115('0x31'),{'module':_0x5115('0x66')});}return null;})['then'](function(_0x2da470){if(_0x2da470){return _0x58708e;}return null;});})['then'](respondWithResult(_0x5e2abd,null))[_0x5115('0x24')](handleError(_0x5e2abd,null));};exports[_0x5115('0x32')]=function(_0x579508,_0x524f92,_0x267418){var _0x5366ea;return db[_0x5115('0x4a')][_0x5115('0x52')]({'where':{'id':_0x579508[_0x5115('0x4f')]['id']}})[_0x5115('0x1b')](function(_0x6aed2d){_0x5366ea=_0x6aed2d;return _0x6aed2d;})['then'](handleEntityNotFound(_0x524f92,null))[_0x5115('0x1b')](removeEntity(_0x524f92,null))[_0x5115('0x1b')](function(){if(_0x5366ea){return db[_0x5115('0x4a')][_0x5115('0x4d')]({'where':{'type':_0x5366ea[_0x5115('0x37')]},'raw':!![]});}})['then'](function(_0x873a07){if(_0x5366ea[_0x5115('0x37')][_0x5115('0x57')]()==_0x5115('0x58')){var _0x3d773d=fs['readFileSync'](path[_0x5115('0x5a')](config['root'],_0x5115('0x5c')),_0x5115('0x5d'));var _0x9ce926=ejs[_0x5115('0x5e')](_0x3d773d,{'networks':_0x873a07||[]});fs[_0x5115('0x63')]('/etc/asterisk/stun_xcally.conf',_0x9ce926);return respondWithRpcPromise(_0x5115('0x60'),'destroy',{'module':_0x5115('0x61')});}else if(_0x5366ea[_0x5115('0x37')]['toUpperCase']()=='TURN'){var _0xd80dc1=fs[_0x5115('0x59')](path[_0x5115('0x5a')](config[_0x5115('0x5b')],'server/files/templates/turn_multiple.ejs'),_0x5115('0x5d'));var _0x152aa4=ejs['render'](_0xd80dc1,{'networks':_0x873a07||[]});fs[_0x5115('0x63')](_0x5115('0x69'),_0x152aa4);return respondWithRpcPromise(_0x5115('0x60'),_0x5115('0x32'),{'module':_0x5115('0x61')});}else{var _0x2ddb23=fs[_0x5115('0x59')](path[_0x5115('0x5a')](config[_0x5115('0x5b')],_0x5115('0x6a')),'utf8');var _0xdfd918=ejs[_0x5115('0x5e')](_0x2ddb23,{'networks':_0x873a07||[]});fs[_0x5115('0x63')](util[_0x5115('0x68')](_0x5115('0x64'),_0x579508[_0x5115('0x56')][_0x5115('0x37')][_0x5115('0x65')]()),_0xdfd918);return respondWithRpcPromise('Reload',_0x5115('0x32'),{'module':_0x5115('0x66')});}return null;})['catch'](handleError(_0x524f92,null));};
\ No newline at end of file
index b7dc78a..7e12945 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0a12=['util','bluebird','path','rimraf','../../config/environment','./network.attributes','exports','network'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x0a12,0xb8));var _0x20a1=function(_0x5834bc,_0x3d4801){_0x5834bc=_0x5834bc-0x0;var _0x3e183a=_0x0a12[_0x5834bc];return _0x3e183a;};'use strict';var _=require('lodash');var util=require(_0x20a1('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x20a1('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x20a1('0x2'));var rimraf=require(_0x20a1('0x3'));var config=require(_0x20a1('0x4'));var attributes=require(_0x20a1('0x5'));module[_0x20a1('0x6')]=function(_0x2e0ad3,_0x1fedd2){return _0x2e0ad3['define']('Network',attributes,{'tableName':_0x20a1('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe706=['request-promise','path','rimraf','../../config/environment','./network.attributes','exports','define','Network','network','lodash','util','../../config/logger','moment','bluebird'];(function(_0x9bc81a,_0x27e610){var _0x486940=function(_0x21b44f){while(--_0x21b44f){_0x9bc81a['push'](_0x9bc81a['shift']());}};_0x486940(++_0x27e610);}(_0xe706,0xa3));var _0x6e70=function(_0x4b48af,_0x4ad5b9){_0x4b48af=_0x4b48af-0x0;var _0x64ac44=_0xe706[_0x4b48af];return _0x64ac44;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));module[_0x6e70('0xa')]=function(_0x1b0389,_0x4381d1){return _0x1b0389[_0x6e70('0xb')](_0x6e70('0xc'),attributes,{'tableName':_0x6e70('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index ae66ec7..e0ff325 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(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x7a54,0x106));var _0x47a5=function(_0x2d42bc,_0xbba9b){_0x2d42bc=_0x2d42bc-0x0;var _0x38a648=_0x7a54[_0x2d42bc];return _0x38a648;};'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(_0x4ad4d6,_0x4471f6){var _0x33ff91=function(_0xed2719){while(--_0xed2719){_0x4ad4d6['push'](_0x4ad4d6['shift']());}};_0x33ff91(++_0x4471f6);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var 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 466bf66..287beec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdfff=['./openchannelAccount.controller','get','isAuthenticated','/describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','getAgents','post','create','addDisposition','addAnswer','/:id/notify','notify','addApplications','/:id/users','addAgents','send','put','delete','destroy','removeAnswers','exports','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x4f0fd2,_0x1c9fe7){var _0x138371=function(_0x3243ab){while(--_0x3243ab){_0x4f0fd2['push'](_0x4f0fd2['shift']());}};_0x138371(++_0x1c9fe7);}(_0xdfff,0x11a));var _0xfdff=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xdfff[_0x14add3];return _0x4a174f;};'use strict';var multer=require('multer');var util=require(_0xfdff('0x0'));var path=require('path');var timeout=require(_0xfdff('0x1'));var express=require(_0xfdff('0x2'));var router=express['Router']();var fs_extra=require(_0xfdff('0x3'));var auth=require(_0xfdff('0x4'));var interaction=require(_0xfdff('0x5'));var config=require('../../config/environment');var controller=require(_0xfdff('0x6'));router[_0xfdff('0x7')]('/',auth[_0xfdff('0x8')](),controller['index']);router[_0xfdff('0x7')](_0xfdff('0x9'),auth[_0xfdff('0x8')](),controller['describe']);router[_0xfdff('0x7')](_0xfdff('0xa'),auth[_0xfdff('0x8')](),controller[_0xfdff('0xb')]);router[_0xfdff('0x7')](_0xfdff('0xc'),auth[_0xfdff('0x8')](),controller[_0xfdff('0xd')]);router[_0xfdff('0x7')](_0xfdff('0xe'),auth['isAuthenticated'](),controller[_0xfdff('0xf')]);router[_0xfdff('0x7')](_0xfdff('0x10'),auth['isAuthenticated'](),controller[_0xfdff('0x11')]);router[_0xfdff('0x7')](_0xfdff('0x12'),auth[_0xfdff('0x8')](),controller[_0xfdff('0x13')]);router['get']('/:id/users',auth[_0xfdff('0x8')](),controller[_0xfdff('0x14')]);router[_0xfdff('0x15')]('/',auth['isAuthenticated'](),controller[_0xfdff('0x16')]);router[_0xfdff('0x15')](_0xfdff('0xc'),auth['isAuthenticated'](),controller[_0xfdff('0x17')]);router['post']('/:id/canned_answers',auth['isAuthenticated'](),controller[_0xfdff('0x18')]);router[_0xfdff('0x15')](_0xfdff('0x19'),controller[_0xfdff('0x1a')]);router[_0xfdff('0x15')](_0xfdff('0x10'),auth['isAuthenticated'](),controller[_0xfdff('0x1b')]);router['post'](_0xfdff('0x1c'),auth[_0xfdff('0x8')](),controller[_0xfdff('0x1d')]);router['post']('/:id/send',auth['isAuthenticated'](),controller[_0xfdff('0x1e')]);router[_0xfdff('0x1f')](_0xfdff('0xa'),auth['isAuthenticated'](),controller['update']);router[_0xfdff('0x20')](_0xfdff('0xa'),auth[_0xfdff('0x8')](),controller[_0xfdff('0x21')]);router[_0xfdff('0x20')](_0xfdff('0xc'),auth[_0xfdff('0x8')](),controller['removeDispositions']);router[_0xfdff('0x20')](_0xfdff('0xe'),auth[_0xfdff('0x8')](),controller[_0xfdff('0x22')]);router['delete'](_0xfdff('0x1c'),auth[_0xfdff('0x8')](),controller['removeAgents']);module[_0xfdff('0x23')]=router;
\ No newline at end of file
+var _0xe790=['util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/applications','getApplications','create','post','addDisposition','addAnswer','/:id/notify','notify','addApplications','addAgents','/:id/send','send','/:id','update','delete','removeDispositions','removeAnswers','removeAgents','multer'];(function(_0x1dc6d4,_0x1d8ffa){var _0xa5ee8b=function(_0x177311){while(--_0x177311){_0x1dc6d4['push'](_0x1dc6d4['shift']());}};_0xa5ee8b(++_0x1d8ffa);}(_0xe790,0x1db));var _0x0e79=function(_0x354098,_0x1f6485){_0x354098=_0x354098-0x0;var _0x162432=_0xe790[_0x354098];return _0x162432;};'use strict';var multer=require(_0x0e79('0x0'));var util=require(_0x0e79('0x1'));var path=require(_0x0e79('0x2'));var timeout=require(_0x0e79('0x3'));var express=require('express');var router=express[_0x0e79('0x4')]();var fs_extra=require(_0x0e79('0x5'));var auth=require(_0x0e79('0x6'));var interaction=require(_0x0e79('0x7'));var config=require('../../config/environment');var controller=require('./openchannelAccount.controller');router[_0x0e79('0x8')]('/',auth[_0x0e79('0x9')](),controller[_0x0e79('0xa')]);router[_0x0e79('0x8')]('/describe',auth[_0x0e79('0x9')](),controller[_0x0e79('0xb')]);router['get']('/:id',auth[_0x0e79('0x9')](),controller[_0x0e79('0xc')]);router[_0x0e79('0x8')](_0x0e79('0xd'),auth[_0x0e79('0x9')](),controller[_0x0e79('0xe')]);router[_0x0e79('0x8')](_0x0e79('0xf'),auth['isAuthenticated'](),controller['getAnswers']);router[_0x0e79('0x8')](_0x0e79('0x10'),auth['isAuthenticated'](),controller[_0x0e79('0x11')]);router[_0x0e79('0x8')]('/:id/interactions',auth[_0x0e79('0x9')](),controller['getInteractions']);router['get']('/:id/users',auth[_0x0e79('0x9')](),controller['getAgents']);router['post']('/',auth[_0x0e79('0x9')](),controller[_0x0e79('0x12')]);router[_0x0e79('0x13')](_0x0e79('0xd'),auth[_0x0e79('0x9')](),controller[_0x0e79('0x14')]);router[_0x0e79('0x13')](_0x0e79('0xf'),auth[_0x0e79('0x9')](),controller[_0x0e79('0x15')]);router[_0x0e79('0x13')](_0x0e79('0x16'),controller[_0x0e79('0x17')]);router['post']('/:id/applications',auth['isAuthenticated'](),controller[_0x0e79('0x18')]);router[_0x0e79('0x13')]('/:id/users',auth[_0x0e79('0x9')](),controller[_0x0e79('0x19')]);router[_0x0e79('0x13')](_0x0e79('0x1a'),auth[_0x0e79('0x9')](),controller[_0x0e79('0x1b')]);router['put'](_0x0e79('0x1c'),auth[_0x0e79('0x9')](),controller[_0x0e79('0x1d')]);router[_0x0e79('0x1e')](_0x0e79('0x1c'),auth['isAuthenticated'](),controller['destroy']);router[_0x0e79('0x1e')](_0x0e79('0xd'),auth[_0x0e79('0x9')](),controller[_0x0e79('0x1f')]);router[_0x0e79('0x1e')](_0x0e79('0xf'),auth[_0x0e79('0x9')](),controller[_0x0e79('0x20')]);router[_0x0e79('0x1e')]('/:id/users',auth[_0x0e79('0x9')](),controller[_0x0e79('0x21')]);module['exports']=router;
\ No newline at end of file
index 6a30c3e..c9abf8a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4be1=['Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','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(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4be1,0xe0));var _0x14be=function(_0x255c48,_0x2a4449){_0x255c48=_0x255c48-0x0;var _0xaebda3=_0x4be1[_0x255c48];return _0xaebda3;};'use strict';var Sequelize=require(_0x14be('0x0'));var rs=require(_0x14be('0x1'));module[_0x14be('0x2')]={'name':{'type':Sequelize[_0x14be('0x3')],'unique':_0x14be('0x4'),'allowNull':![]},'description':{'type':Sequelize[_0x14be('0x3')]},'token':{'type':Sequelize[_0x14be('0x3')],'defaultValue':function(){return rs[_0x14be('0x5')]();}},'replyUri':{'type':Sequelize['STRING'],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x14be('0x3')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x14be('0x6');}},'notificationSound':{'type':Sequelize[_0x14be('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x14be('0x7')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x14be('0x3')]},'queueTransfer':{'type':Sequelize[_0x14be('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x14be('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x14be('0x9')},'mandatoryDisposition':{'type':Sequelize[_0x14be('0x7')],'defaultValue':![],'comment':_0x14be('0xa'),'set':function(_0x30167a){if(!_0x30167a)this['setDataValue']('mandatoryDispositionPauseId',null);this[_0x14be('0xb')](_0x14be('0xc'),_0x30167a);}}};
\ No newline at end of file
+var _0x9009=['BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING','name'];(function(_0xb88a95,_0xa788ef){var _0x41ede4=function(_0x107311){while(--_0x107311){_0xb88a95['push'](_0xb88a95['shift']());}};_0x41ede4(++_0xa788ef);}(_0x9009,0x1c9));var _0x9900=function(_0x4450c3,_0x38bf4e){_0x4450c3=_0x4450c3-0x0;var _0x49d621=_0x9009[_0x4450c3];return _0x49d621;};'use strict';var Sequelize=require(_0x9900('0x0'));var rs=require(_0x9900('0x1'));module[_0x9900('0x2')]={'name':{'type':Sequelize[_0x9900('0x3')],'unique':_0x9900('0x4'),'allowNull':![]},'description':{'type':Sequelize[_0x9900('0x3')]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs['generate']();}},'replyUri':{'type':Sequelize[_0x9900('0x3')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x9900('0x3')],'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[_0x9900('0x5')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x9900('0x5')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x9900('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x9900('0x3')]},'queueTransfer':{'type':Sequelize[_0x9900('0x5')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x9900('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x9900('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x9900('0x7'),'set':function(_0x4ab758){if(!_0x4ab758)this[_0x9900('0x8')](_0x9900('0x9'),null);this[_0x9900('0x8')](_0x9900('0xa'),_0x4ab758);}}};
\ No newline at end of file
index 5087cd6..38a09d3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7b2b=['finally','getApplications','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','color','tag','addAgents','omit','emit','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','hasOwnProperty','Messages','dataValues','eml-format','rimraf','fast-json-patch','moment','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register','jayson/promise','client','http','request','then','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','sendStatus','json','offset','undefined','count','limit','status','apply','reject','save','destroy','get','OpenchannelAccounts','UserProfileResource','end','stack','name','send','index','mandatoryDispositionPause','map','rawAttributes','fieldName','key','model','query','keys','attributes','intersection','fields','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','OpenchannelAccount','includeAll','include','findAll','rows','show','params','Pause','find','create','body','user','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','addDisposition','OpenchannelAccountId','Disposition','getDispositions','length','removeDispositions','ids','addAnswer','CannedAnswer','findOne','removeAnswers','notify','openchannel','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','updatedAt','createdAt','CompanyId','ListId','from','from\x20is\x20mandatory','isNil','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','DESC','OpenchannelApplication','account','applications','Applications','list','orderBy','asc','Contacts','contact','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','messageId','interaction','created','autoclose','push','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','unshift','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','addApplications','sequelize','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','findAndCountAll','priority'];(function(_0x44946b,_0xf874ec){var _0x249bc4=function(_0x40a23e){while(--_0x40a23e){_0x44946b['push'](_0x44946b['shift']());}};_0x249bc4(++_0xf874ec);}(_0x7b2b,0x195));var _0xb7b2=function(_0x39843a,_0x5288b3){_0x39843a=_0x39843a-0x0;var _0x175eb6=_0x7b2b[_0x39843a];return _0x175eb6;};'use strict';var emlformat=require(_0xb7b2('0x0'));var rimraf=require(_0xb7b2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb7b2('0x2'));var rp=require('request-promise');var moment=require(_0xb7b2('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xb7b2('0x4'));var util=require('util');var path=require('path');var sox=require(_0xb7b2('0x5'));var csv=require(_0xb7b2('0x6'));var ejs=require(_0xb7b2('0x7'));var fs=require('fs');var fs_extra=require(_0xb7b2('0x8'));var _=require(_0xb7b2('0x9'));var squel=require(_0xb7b2('0xa'));var crypto=require(_0xb7b2('0xb'));var jsforce=require(_0xb7b2('0xc'));var deskjs=require(_0xb7b2('0xd'));var toCsv=require(_0xb7b2('0x6'));var querystring=require(_0xb7b2('0xe'));var Papa=require(_0xb7b2('0xf'));var Redis=require('ioredis');var authService=require(_0xb7b2('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb7b2('0x11'));var logger=require(_0xb7b2('0x12'))(_0xb7b2('0x13'));var utils=require(_0xb7b2('0x14'));var config=require(_0xb7b2('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xb7b2('0x16'))['db'];config[_0xb7b2('0x17')]=_[_0xb7b2('0x18')](config['redis'],{'host':_0xb7b2('0x19'),'port':0x18eb});var socket=require(_0xb7b2('0x1a'))(new Redis(config['redis']));require(_0xb7b2('0x1b'))[_0xb7b2('0x1c')](socket);var jayson=require(_0xb7b2('0x1d'));var client=jayson[_0xb7b2('0x1e')][_0xb7b2('0x1f')]({'port':0x232c});var client9002=jayson[_0xb7b2('0x1e')]['http']({'port':0x232a});function respondWithRpcPromise(_0x50aab3,_0x61de83,_0x3b3d65,_0x28c009){return new BPromise(function(_0x1f3952,_0x5cb2b0){var _0x47c783=_0x28c009||client;return _0x47c783[_0xb7b2('0x20')](_0x50aab3,_0x3b3d65)[_0xb7b2('0x21')](function(_0x1b50a7){logger['info'](_0xb7b2('0x22'),_0x61de83,_0xb7b2('0x23'));logger[_0xb7b2('0x24')](_0xb7b2('0x25'),_0x61de83,'request\x20sent',JSON[_0xb7b2('0x26')](_0x1b50a7));if(_0x1b50a7[_0xb7b2('0x27')]){if(_0x1b50a7['error']['code']===0x1f4){logger['error'](_0xb7b2('0x22'),_0x61de83,_0x1b50a7[_0xb7b2('0x27')][_0xb7b2('0x28')]);return _0x5cb2b0(_0x1b50a7[_0xb7b2('0x27')][_0xb7b2('0x28')]);}logger[_0xb7b2('0x27')](_0xb7b2('0x22'),_0x61de83,_0x1b50a7['error']['message']);return _0x1f3952(_0x1b50a7[_0xb7b2('0x27')][_0xb7b2('0x28')]);}else{logger[_0xb7b2('0x29')](_0xb7b2('0x22'),_0x61de83,'request\x20sent');_0x1f3952(_0x1b50a7[_0xb7b2('0x2a')][_0xb7b2('0x28')]);}})[_0xb7b2('0x2b')](function(_0x347bb3){logger[_0xb7b2('0x27')](_0xb7b2('0x22'),_0x61de83,_0x347bb3);_0x5cb2b0(_0x347bb3);});});}function respondWithStatusCode(_0x3b95a4,_0x4cf1ef){_0x4cf1ef=_0x4cf1ef||0xcc;return function(_0x2f1998){if(_0x2f1998){return _0x3b95a4[_0xb7b2('0x2c')](_0x4cf1ef);}return _0x3b95a4['status'](_0x4cf1ef)['end']();};}function respondWithResult(_0x53bfca,_0x505b7a){_0x505b7a=_0x505b7a||0xc8;return function(_0x47269e){if(_0x47269e){return _0x53bfca['status'](_0x505b7a)[_0xb7b2('0x2d')](_0x47269e);}};}function respondWithFilteredResult(_0x28f386,_0x4bca73){return function(_0x3f7abd){if(_0x3f7abd){var _0xaaa10a=typeof _0x4bca73[_0xb7b2('0x2e')]===_0xb7b2('0x2f')&&typeof _0x4bca73['limit']==='undefined';var _0x443fd0=_0x3f7abd[_0xb7b2('0x30')];var _0x43cc25=_0xaaa10a?0x0:_0x4bca73[_0xb7b2('0x2e')];var _0x4a9a5d=_0xaaa10a?_0x3f7abd[_0xb7b2('0x30')]:_0x4bca73[_0xb7b2('0x2e')]+_0x4bca73[_0xb7b2('0x31')];var _0x5f19e4;if(_0x4a9a5d>=_0x443fd0){_0x4a9a5d=_0x443fd0;_0x5f19e4=0xc8;}else{_0x5f19e4=0xce;}_0x28f386[_0xb7b2('0x32')](_0x5f19e4);return _0x28f386['set']('Content-Range',_0x43cc25+'-'+_0x4a9a5d+'/'+_0x443fd0)['json'](_0x3f7abd);}return null;};}function patchUpdates(_0x17cf5d){return function(_0x22be0d){try{jsonpatch[_0xb7b2('0x33')](_0x22be0d,_0x17cf5d,!![]);}catch(_0x1ea119){return BPromise[_0xb7b2('0x34')](_0x1ea119);}return _0x22be0d[_0xb7b2('0x35')]();};}function saveUpdates(_0x56c728,_0x4891d2){return function(_0x175ee9){if(_0x175ee9){return _0x175ee9['update'](_0x56c728)[_0xb7b2('0x21')](function(_0x8299bc){return _0x8299bc;});}return null;};}function removeEntity(_0x2c544c,_0x185a44){return function(_0x3f0bc9){if(_0x3f0bc9){return _0x3f0bc9[_0xb7b2('0x36')]()['then'](function(){var _0x122832=_0x3f0bc9[_0xb7b2('0x37')]({'plain':!![]});var _0x5a39be=_0xb7b2('0x38');return db[_0xb7b2('0x39')][_0xb7b2('0x36')]({'where':{'type':_0x5a39be,'resourceId':_0x122832['id']}})['then'](function(){return _0x3f0bc9;});})['then'](function(){_0x2c544c['status'](0xcc)[_0xb7b2('0x3a')]();});}};}function handleEntityNotFound(_0x1026bb,_0x5bec81){return function(_0x91935f){if(!_0x91935f){_0x1026bb[_0xb7b2('0x2c')](0x194);}return _0x91935f;};}function handleError(_0x1b4857,_0x213d6c){_0x213d6c=_0x213d6c||0x1f4;return function(_0xd18948){logger[_0xb7b2('0x27')](_0xd18948[_0xb7b2('0x3b')]);if(_0xd18948[_0xb7b2('0x3c')]){delete _0xd18948[_0xb7b2('0x3c')];}_0x1b4857[_0xb7b2('0x32')](_0x213d6c)[_0xb7b2('0x3d')](_0xd18948);};}exports[_0xb7b2('0x3e')]=function(_0xe0f8ae,_0x3b66d8){var _0x35e2d9={'include':[{'model':db['Pause'],'as':_0xb7b2('0x3f')}]},_0x2734f8={},_0x10c606={'count':0x0,'rows':[]};var _0x456baf=_[_0xb7b2('0x40')](db['OpenchannelAccount'][_0xb7b2('0x41')],function(_0x1858ec){return{'name':_0x1858ec[_0xb7b2('0x42')],'type':_0x1858ec['type'][_0xb7b2('0x43')]};});_0x2734f8[_0xb7b2('0x44')]=_[_0xb7b2('0x40')](_0x456baf,_0xb7b2('0x3c'));_0x2734f8[_0xb7b2('0x45')]=_[_0xb7b2('0x46')](_0xe0f8ae[_0xb7b2('0x45')]);_0x2734f8['filters']=_['intersection'](_0x2734f8[_0xb7b2('0x44')],_0x2734f8[_0xb7b2('0x45')]);_0x35e2d9[_0xb7b2('0x47')]=_[_0xb7b2('0x48')](_0x2734f8[_0xb7b2('0x44')],qs[_0xb7b2('0x49')](_0xe0f8ae[_0xb7b2('0x45')][_0xb7b2('0x49')]));_0x35e2d9['attributes']=_0x35e2d9[_0xb7b2('0x47')]['length']?_0x35e2d9[_0xb7b2('0x47')]:_0x2734f8[_0xb7b2('0x44')];if(!_0xe0f8ae['query']['hasOwnProperty'](_0xb7b2('0x4a'))){_0x35e2d9[_0xb7b2('0x31')]=qs[_0xb7b2('0x31')](_0xe0f8ae[_0xb7b2('0x45')]['limit']);_0x35e2d9[_0xb7b2('0x2e')]=qs['offset'](_0xe0f8ae[_0xb7b2('0x45')][_0xb7b2('0x2e')]);}_0x35e2d9[_0xb7b2('0x4b')]=qs[_0xb7b2('0x4c')](_0xe0f8ae[_0xb7b2('0x45')]['sort']);_0x35e2d9[_0xb7b2('0x4d')]=qs[_0xb7b2('0x4e')](_[_0xb7b2('0x4f')](_0xe0f8ae[_0xb7b2('0x45')],_0x2734f8[_0xb7b2('0x4e')]),_0x456baf);if(_0xe0f8ae[_0xb7b2('0x45')][_0xb7b2('0x50')]){_0x35e2d9[_0xb7b2('0x4d')]=_[_0xb7b2('0x51')](_0x35e2d9[_0xb7b2('0x4d')],{'$or':_[_0xb7b2('0x40')](_0x456baf,function(_0x54bedb){if(_0x54bedb['type']!==_0xb7b2('0x52')){var _0x5b181d={};_0x5b181d[_0x54bedb[_0xb7b2('0x3c')]]={'$like':'%'+_0xe0f8ae[_0xb7b2('0x45')]['filter']+'%'};return _0x5b181d;}})});}_0x35e2d9=_[_0xb7b2('0x51')]({},_0x35e2d9,_0xe0f8ae[_0xb7b2('0x53')]);var _0x19c691={'where':_0x35e2d9[_0xb7b2('0x4d')]};return db[_0xb7b2('0x54')][_0xb7b2('0x30')](_0x19c691)[_0xb7b2('0x21')](function(_0x383e0f){_0x10c606[_0xb7b2('0x30')]=_0x383e0f;if(_0xe0f8ae[_0xb7b2('0x45')][_0xb7b2('0x55')]){_0x35e2d9[_0xb7b2('0x56')]=[{'all':!![]}];}return db[_0xb7b2('0x54')][_0xb7b2('0x57')](_0x35e2d9);})[_0xb7b2('0x21')](function(_0x2ce3a2){_0x10c606[_0xb7b2('0x58')]=_0x2ce3a2;return _0x10c606;})['then'](respondWithFilteredResult(_0x3b66d8,_0x35e2d9))[_0xb7b2('0x2b')](handleError(_0x3b66d8,null));};exports[_0xb7b2('0x59')]=function(_0x44759e,_0xe33e02){var _0x327d9b={'raw':![],'where':{'id':_0x44759e[_0xb7b2('0x5a')]['id']},'include':[{'model':db[_0xb7b2('0x5b')],'as':_0xb7b2('0x3f')}]},_0x46ad0f={};_0x46ad0f[_0xb7b2('0x44')]=_[_0xb7b2('0x46')](db[_0xb7b2('0x54')][_0xb7b2('0x41')]);_0x46ad0f[_0xb7b2('0x45')]=_[_0xb7b2('0x46')](_0x44759e['query']);_0x46ad0f['filters']=_[_0xb7b2('0x48')](_0x46ad0f['model'],_0x46ad0f[_0xb7b2('0x45')]);_0x327d9b['attributes']=_[_0xb7b2('0x48')](_0x46ad0f[_0xb7b2('0x44')],qs[_0xb7b2('0x49')](_0x44759e['query']['fields']));_0x327d9b[_0xb7b2('0x47')]=_0x327d9b[_0xb7b2('0x47')]['length']?_0x327d9b[_0xb7b2('0x47')]:_0x46ad0f[_0xb7b2('0x44')];if(_0x44759e[_0xb7b2('0x45')][_0xb7b2('0x55')]){_0x327d9b[_0xb7b2('0x56')]=[{'all':!![]}];}_0x327d9b=_[_0xb7b2('0x51')]({},_0x327d9b,_0x44759e['options']);return db[_0xb7b2('0x54')][_0xb7b2('0x5c')](_0x327d9b)['then'](handleEntityNotFound(_0xe33e02,null))['then'](respondWithResult(_0xe33e02,null))[_0xb7b2('0x2b')](handleError(_0xe33e02,null));};exports['create']=function(_0x1199d7,_0x11777a){return db['OpenchannelAccount'][_0xb7b2('0x5d')](_0x1199d7[_0xb7b2('0x5e')],{})['then'](function(_0x2e712c){var _0x599a00=_0x1199d7[_0xb7b2('0x5f')]['get']({'plain':!![]});if(!_0x599a00)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x599a00['role']===_0xb7b2('0x5f')){var _0x5e76a3=_0x2e712c['get']({'plain':!![]});var _0x352c46='OpenchannelAccounts';return db['UserProfileSection'][_0xb7b2('0x5c')]({'where':{'name':_0x352c46,'userProfileId':_0x599a00['userProfileId']},'raw':!![]})[_0xb7b2('0x21')](function(_0x14e2c2){if(_0x14e2c2&&_0x14e2c2[_0xb7b2('0x60')]===0x0){return db[_0xb7b2('0x39')]['create']({'name':_0x5e76a3[_0xb7b2('0x3c')],'resourceId':_0x5e76a3['id'],'type':_0x14e2c2['name'],'sectionId':_0x14e2c2['id']},{})[_0xb7b2('0x21')](function(){return _0x2e712c;});}else{return _0x2e712c;}})[_0xb7b2('0x2b')](function(_0x580e10){logger[_0xb7b2('0x27')](_0xb7b2('0x61'),_0x580e10);throw _0x580e10;});}return _0x2e712c;})[_0xb7b2('0x21')](respondWithResult(_0x11777a,0xc9))[_0xb7b2('0x2b')](handleError(_0x11777a,null));};exports[_0xb7b2('0x62')]=function(_0x91209c,_0x72c483){if(_0x91209c[_0xb7b2('0x5e')]['id']){delete _0x91209c[_0xb7b2('0x5e')]['id'];}return db[_0xb7b2('0x54')][_0xb7b2('0x5c')]({'where':{'id':_0x91209c['params']['id']},'include':[{'model':db[_0xb7b2('0x5b')],'as':_0xb7b2('0x3f')}]})['then'](handleEntityNotFound(_0x72c483,null))['then'](saveUpdates(_0x91209c['body'],null))['then'](respondWithResult(_0x72c483,null))[_0xb7b2('0x2b')](handleError(_0x72c483,null));};exports['destroy']=function(_0xfd59c2,_0x2413f3){return db[_0xb7b2('0x54')][_0xb7b2('0x5c')]({'where':{'id':_0xfd59c2[_0xb7b2('0x5a')]['id']}})['then'](handleEntityNotFound(_0x2413f3,null))['then'](removeEntity(_0x2413f3,null))['catch'](handleError(_0x2413f3,null));};exports[_0xb7b2('0x63')]=function(_0x33e44c,_0x440226){return db[_0xb7b2('0x54')]['describe']()['then'](respondWithResult(_0x440226,null))[_0xb7b2('0x2b')](handleError(_0x440226,null));};exports[_0xb7b2('0x64')]=function(_0x2921a7,_0x5ed77b,_0x4da403){if(_0x2921a7[_0xb7b2('0x5e')]['id']){delete _0x2921a7[_0xb7b2('0x5e')]['id'];}return db[_0xb7b2('0x54')][_0xb7b2('0x5c')]({'where':{'id':_0x2921a7[_0xb7b2('0x5a')]['id']}})[_0xb7b2('0x21')](handleEntityNotFound(_0x5ed77b,null))[_0xb7b2('0x21')](function(_0x206b55){if(_0x206b55){_0x2921a7['body'][_0xb7b2('0x65')]=_0x206b55['id'];return db[_0xb7b2('0x66')][_0xb7b2('0x5d')](_0x2921a7[_0xb7b2('0x5e')]);}})['then'](respondWithResult(_0x5ed77b,null))[_0xb7b2('0x2b')](handleError(_0x5ed77b,null));};exports[_0xb7b2('0x67')]=function(_0x3ed87f,_0xbefb5c,_0x483ac4){var _0x20893c={'raw':![],'where':{}};var _0x5890ae={};var _0x51b9f2={'count':0x0,'rows':[]};return db[_0xb7b2('0x54')]['findOne']({'where':{'id':_0x3ed87f[_0xb7b2('0x5a')]['id']}})[_0xb7b2('0x21')](handleEntityNotFound(_0xbefb5c,null))[_0xb7b2('0x21')](function(_0x4119c2){if(_0x4119c2){_0x5890ae[_0xb7b2('0x44')]=_[_0xb7b2('0x46')](db[_0xb7b2('0x66')]['rawAttributes']);_0x5890ae[_0xb7b2('0x45')]=_[_0xb7b2('0x46')](_0x3ed87f['query']);_0x5890ae[_0xb7b2('0x4e')]=_[_0xb7b2('0x48')](_0x5890ae['model'],_0x5890ae[_0xb7b2('0x45')]);_0x20893c[_0xb7b2('0x47')]=_[_0xb7b2('0x48')](_0x5890ae['model'],qs[_0xb7b2('0x49')](_0x3ed87f[_0xb7b2('0x45')][_0xb7b2('0x49')]));_0x20893c['attributes']=_0x20893c[_0xb7b2('0x47')][_0xb7b2('0x68')]?_0x20893c['attributes']:_0x5890ae[_0xb7b2('0x44')];if(!_0x3ed87f['query']['hasOwnProperty']('nolimit')){_0x20893c['limit']=qs[_0xb7b2('0x31')](_0x3ed87f['query'][_0xb7b2('0x31')]);_0x20893c['offset']=qs[_0xb7b2('0x2e')](_0x3ed87f[_0xb7b2('0x45')]['offset']);}_0x20893c[_0xb7b2('0x4b')]=qs['sort'](_0x3ed87f[_0xb7b2('0x45')][_0xb7b2('0x4c')]);_0x20893c[_0xb7b2('0x4d')]=qs[_0xb7b2('0x4e')](_[_0xb7b2('0x4f')](_0x3ed87f['query'],_0x5890ae[_0xb7b2('0x4e')]));_0x20893c[_0xb7b2('0x4d')][_0xb7b2('0x65')]=_0x4119c2['id'];if(_0x3ed87f[_0xb7b2('0x45')]['filter']){_0x20893c['where']=_[_0xb7b2('0x51')](_0x20893c[_0xb7b2('0x4d')],{'$or':_['map'](_0x20893c[_0xb7b2('0x47')],function(_0x50df77){var _0x503556={};_0x503556[_0x50df77]={'$like':'%'+_0x3ed87f['query'][_0xb7b2('0x50')]+'%'};return _0x503556;})});}_0x20893c=_['merge']({},_0x20893c,_0x3ed87f[_0xb7b2('0x53')]);return db[_0xb7b2('0x66')][_0xb7b2('0x30')]({'where':_0x20893c[_0xb7b2('0x4d')]})[_0xb7b2('0x21')](function(_0x141bf2){_0x51b9f2['count']=_0x141bf2;if(_0x3ed87f['query'][_0xb7b2('0x55')]){_0x20893c[_0xb7b2('0x56')]=[{'all':!![]}];}return db[_0xb7b2('0x66')][_0xb7b2('0x57')](_0x20893c);})[_0xb7b2('0x21')](function(_0x545ff2){_0x51b9f2[_0xb7b2('0x58')]=_0x545ff2;return _0x51b9f2;});}})[_0xb7b2('0x21')](respondWithFilteredResult(_0xbefb5c,_0x20893c))[_0xb7b2('0x2b')](handleError(_0xbefb5c,null));};exports[_0xb7b2('0x69')]=function(_0x28c377,_0x5b4e17,_0x6ada88){return db['OpenchannelAccount'][_0xb7b2('0x5c')]({'where':{'id':_0x28c377[_0xb7b2('0x5a')]['id']}})[_0xb7b2('0x21')](handleEntityNotFound(_0x5b4e17,null))[_0xb7b2('0x21')](function(_0x4b7da2){if(_0x4b7da2){return _0x4b7da2['removeDispositions'](_0x28c377[_0xb7b2('0x45')][_0xb7b2('0x6a')]);}})[_0xb7b2('0x21')](respondWithStatusCode(_0x5b4e17,null))[_0xb7b2('0x2b')](handleError(_0x5b4e17,null));};exports[_0xb7b2('0x6b')]=function(_0x24a660,_0xf70d74,_0xd7bb7c){if(_0x24a660[_0xb7b2('0x5e')]['id']){delete _0x24a660['body']['id'];}return db[_0xb7b2('0x54')][_0xb7b2('0x5c')]({'where':{'id':_0x24a660[_0xb7b2('0x5a')]['id']}})['then'](handleEntityNotFound(_0xf70d74,null))[_0xb7b2('0x21')](function(_0x412043){if(_0x412043){_0x24a660[_0xb7b2('0x5e')]['OpenchannelAccountId']=_0x412043['id'];return db[_0xb7b2('0x6c')][_0xb7b2('0x5d')](_0x24a660[_0xb7b2('0x5e')]);}})[_0xb7b2('0x21')](respondWithResult(_0xf70d74,null))['catch'](handleError(_0xf70d74,null));};exports['getAnswers']=function(_0x4c1346,_0x317312,_0x3b0e6d){var _0x30f05d={'raw':![],'where':{}};var _0x4e4747={};var _0x2f0b37={'count':0x0,'rows':[]};return db[_0xb7b2('0x54')][_0xb7b2('0x6d')]({'where':{'id':_0x4c1346[_0xb7b2('0x5a')]['id']}})[_0xb7b2('0x21')](handleEntityNotFound(_0x317312,null))[_0xb7b2('0x21')](function(_0x84d75c){if(_0x84d75c){_0x4e4747[_0xb7b2('0x44')]=_[_0xb7b2('0x46')](db['CannedAnswer'][_0xb7b2('0x41')]);_0x4e4747[_0xb7b2('0x45')]=_[_0xb7b2('0x46')](_0x4c1346[_0xb7b2('0x45')]);_0x4e4747['filters']=_[_0xb7b2('0x48')](_0x4e4747['model'],_0x4e4747['query']);_0x30f05d[_0xb7b2('0x47')]=_[_0xb7b2('0x48')](_0x4e4747[_0xb7b2('0x44')],qs['fields'](_0x4c1346[_0xb7b2('0x45')][_0xb7b2('0x49')]));_0x30f05d['attributes']=_0x30f05d[_0xb7b2('0x47')]['length']?_0x30f05d[_0xb7b2('0x47')]:_0x4e4747[_0xb7b2('0x44')];if(!_0x4c1346[_0xb7b2('0x45')]['hasOwnProperty'](_0xb7b2('0x4a'))){_0x30f05d[_0xb7b2('0x31')]=qs['limit'](_0x4c1346[_0xb7b2('0x45')][_0xb7b2('0x31')]);_0x30f05d[_0xb7b2('0x2e')]=qs[_0xb7b2('0x2e')](_0x4c1346[_0xb7b2('0x45')]['offset']);}_0x30f05d[_0xb7b2('0x4b')]=qs[_0xb7b2('0x4c')](_0x4c1346[_0xb7b2('0x45')][_0xb7b2('0x4c')]);_0x30f05d[_0xb7b2('0x4d')]=qs[_0xb7b2('0x4e')](_[_0xb7b2('0x4f')](_0x4c1346[_0xb7b2('0x45')],_0x4e4747[_0xb7b2('0x4e')]));_0x30f05d['where'][_0xb7b2('0x65')]=_0x84d75c['id'];if(_0x4c1346[_0xb7b2('0x45')][_0xb7b2('0x50')]){_0x30f05d['where']=_[_0xb7b2('0x51')](_0x30f05d[_0xb7b2('0x4d')],{'$or':_[_0xb7b2('0x40')](_0x30f05d[_0xb7b2('0x47')],function(_0x524987){var _0x712af6={};_0x712af6[_0x524987]={'$like':'%'+_0x4c1346[_0xb7b2('0x45')][_0xb7b2('0x50')]+'%'};return _0x712af6;})});}_0x30f05d=_[_0xb7b2('0x51')]({},_0x30f05d,_0x4c1346['options']);return db['CannedAnswer'][_0xb7b2('0x30')]({'where':_0x30f05d['where']})[_0xb7b2('0x21')](function(_0x26a170){_0x2f0b37[_0xb7b2('0x30')]=_0x26a170;if(_0x4c1346['query']['includeAll']){_0x30f05d[_0xb7b2('0x56')]=[{'all':!![]}];}return db[_0xb7b2('0x6c')][_0xb7b2('0x57')](_0x30f05d);})[_0xb7b2('0x21')](function(_0x19e2a2){_0x2f0b37[_0xb7b2('0x58')]=_0x19e2a2;return _0x2f0b37;});}})['then'](respondWithFilteredResult(_0x317312,_0x30f05d))['catch'](handleError(_0x317312,null));};exports[_0xb7b2('0x6e')]=function(_0x3547ee,_0x2ea562,_0x5dc287){return db['OpenchannelAccount'][_0xb7b2('0x5c')]({'where':{'id':_0x3547ee[_0xb7b2('0x5a')]['id']}})[_0xb7b2('0x21')](handleEntityNotFound(_0x2ea562,null))[_0xb7b2('0x21')](function(_0x3e3891){if(_0x3e3891){return _0x3e3891[_0xb7b2('0x6e')](_0x3547ee['query'][_0xb7b2('0x6a')]);}})[_0xb7b2('0x21')](respondWithStatusCode(_0x2ea562,null))[_0xb7b2('0x2b')](handleError(_0x2ea562,null));};exports[_0xb7b2('0x6f')]=function(_0x13dcb5,_0x5ea387,_0x38ab97){var _0x292212={'body':_0x13dcb5[_0xb7b2('0x5e')],'channel':_0xb7b2('0x70')};var _0x20cc92=[];var _0x28872f=[];var _0x49a408={};var _0x4fb46b=![];return db[_0xb7b2('0x71')]['describe']()['then'](function(_0x261115){if(!_0x261115){throw new db[(_0xb7b2('0x72'))][(_0xb7b2('0x73'))](_0xb7b2('0x74'));}_0x20cc92=_[_0xb7b2('0x75')](_[_0xb7b2('0x46')](_0x261115),['createdAt',_0xb7b2('0x76')]);_0x28872f=_[_0xb7b2('0x75')](_[_0xb7b2('0x46')](_0x261115),[_0xb7b2('0x77'),_0xb7b2('0x76'),_0xb7b2('0x78'),_0xb7b2('0x79')]);if(_0x13dcb5[_0xb7b2('0x5e')]['id']){delete _0x13dcb5[_0xb7b2('0x5e')]['id'];}if(_['isNil'](_0x13dcb5[_0xb7b2('0x5e')][_0xb7b2('0x7a')])){throw new db['Sequelize'][(_0xb7b2('0x73'))](_0xb7b2('0x7b'));}if(_[_0xb7b2('0x7c')](_0x13dcb5[_0xb7b2('0x5e')]['body'])||_0x13dcb5[_0xb7b2('0x5e')]['body']===''){throw new db[(_0xb7b2('0x72'))][(_0xb7b2('0x73'))](_0xb7b2('0x7d'));}if(_[_0xb7b2('0x7c')](_0x13dcb5[_0xb7b2('0x5e')][_0xb7b2('0x7e')])){throw new db[(_0xb7b2('0x72'))][(_0xb7b2('0x73'))](_0xb7b2('0x7f')+_0x28872f);}if(!_[_0xb7b2('0x80')](_0x28872f,_0x13dcb5[_0xb7b2('0x5e')]['mapKey'])){throw new db[(_0xb7b2('0x72'))][(_0xb7b2('0x73'))](_0xb7b2('0x81')+_0x28872f);}_0x49a408[_0x13dcb5[_0xb7b2('0x5e')][_0xb7b2('0x7e')]]=_0x13dcb5[_0xb7b2('0x5e')][_0xb7b2('0x7a')];})[_0xb7b2('0x21')](function(){return db['OpenchannelAccount']['find']({'where':{'id':_0x13dcb5[_0xb7b2('0x5a')]['id']},'include':[{'model':db[_0xb7b2('0x82')],'as':_0xb7b2('0x83'),'include':[{'model':db[_0xb7b2('0x71')],'as':'Contacts','where':_0x49a408,'limit':0x1,'order':[['updatedAt',_0xb7b2('0x84')]]}]},{'model':db[_0xb7b2('0x85')],'as':'Applications'}]});})[_0xb7b2('0x21')](handleEntityNotFound(_0x5ea387,null))['then'](function(_0x3766e0){if(_0x3766e0&&_0x3766e0[_0xb7b2('0x83')]){_0x292212[_0xb7b2('0x86')]=_0x3766e0;_0x292212[_0xb7b2('0x87')]=_0x3766e0[_0xb7b2('0x88')];_0x292212[_0xb7b2('0x89')]=_0x3766e0[_0xb7b2('0x83')];_0x292212[_0xb7b2('0x87')]=_[_0xb7b2('0x8a')](_0x292212[_0xb7b2('0x87')],['priority'],[_0xb7b2('0x8b')]);if(_0x292212['account']['Applications']){delete _0x292212['account'][_0xb7b2('0x88')];}if(_0x292212[_0xb7b2('0x86')]['List']&&_0x292212[_0xb7b2('0x86')][_0xb7b2('0x83')][_0xb7b2('0x8c')][_0xb7b2('0x68')]){return _0x292212[_0xb7b2('0x86')][_0xb7b2('0x83')][_0xb7b2('0x8c')][0x0];}var _0xf4837b=_[_0xb7b2('0x18')](_0x13dcb5['body'],{'firstName':_0x13dcb5[_0xb7b2('0x5e')][_0xb7b2('0x7a')],'ListId':_0x3766e0[_0xb7b2('0x79')]});_0xf4837b[_0x13dcb5[_0xb7b2('0x5e')]['mapKey']]=_0x13dcb5[_0xb7b2('0x5e')][_0xb7b2('0x7a')];return db[_0xb7b2('0x71')][_0xb7b2('0x5d')](_0xf4837b,{'fields':_0x20cc92,'raw':!![]});}})[_0xb7b2('0x21')](handleEntityNotFound(_0x5ea387,null))[_0xb7b2('0x21')](function(_0x4ef923){_0x292212[_0xb7b2('0x8d')]=_0x4ef923;if(_0x4ef923){var _0x4f78e5={'ContactId':_0x4ef923['id'],'OpenchannelAccountId':_0x13dcb5[_0xb7b2('0x5a')]['id'],'from':(_0x4ef923[_0xb7b2('0x8e')]||'')+'\x20'+(_0x4ef923[_0xb7b2('0x8f')]||'')};var _0x48cd24={'OpenchannelAccountId':_0x13dcb5[_0xb7b2('0x5a')]['id'],'closed':![]};if(_0x13dcb5[_0xb7b2('0x5e')][_0xb7b2('0x90')]){_0x48cd24[_0xb7b2('0x90')]=_0x13dcb5[_0xb7b2('0x5e')][_0xb7b2('0x90')];return db[_0xb7b2('0x91')][_0xb7b2('0x5c')]({'where':_0x48cd24})[_0xb7b2('0x21')](function(_0x440130){if(_0x440130){return[_0x440130,![]];}_0x4f78e5['threadId']=_0x13dcb5[_0xb7b2('0x5e')][_0xb7b2('0x90')];_0x4f78e5['externalUrl']=_0x13dcb5['body'][_0xb7b2('0x92')];return db['OpenchannelInteraction'][_0xb7b2('0x5d')](_0x4f78e5)['then'](function(_0x1167a1){return[_0x1167a1,!![]];});});}else{_0x48cd24[_0xb7b2('0x90')]=null;}_0x48cd24[_0xb7b2('0x93')]=_0x4ef923['id'];return db['OpenchannelInteraction']['find']({'where':_0x48cd24})['then'](function(_0x29b6b2){if(_0x29b6b2){return[_0x29b6b2,![]];}return db['OpenchannelInteraction'][_0xb7b2('0x5d')](_0x4f78e5)['then'](function(_0x40c941){return[_0x40c941,!![]];});});}})[_0xb7b2('0x94')](function(_0x576780,_0x3ee9e0){if(_0x576780){_0x4fb46b=_0x3ee9e0;if(!_0x3ee9e0){var _0x4288d5={'from':(_0x292212[_0xb7b2('0x8d')][_0xb7b2('0x8e')]||'')+'\x20'+(_0x292212[_0xb7b2('0x8d')][_0xb7b2('0x8f')]||'')};if(_0x13dcb5['body']['threadId']&&_0x13dcb5['body']['messageId']&&_0x13dcb5[_0xb7b2('0x5e')][_0xb7b2('0x90')]!=_0x13dcb5['body'][_0xb7b2('0x95')]){_0x4288d5[_0xb7b2('0x90')]=_0x13dcb5[_0xb7b2('0x5e')][_0xb7b2('0x95')];}return _0x576780[_0xb7b2('0x62')](_0x4288d5);}else{return _0x576780;}}})[_0xb7b2('0x21')](function(_0x262f91){_0x292212['interaction']=_0x262f91[_0xb7b2('0x37')]({'plain':!![]});_0x292212[_0xb7b2('0x96')]['created']=_0x4fb46b;if(_0x292212[_0xb7b2('0x96')][_0xb7b2('0x97')]){if(_0x292212[_0xb7b2('0x86')][_0xb7b2('0x98')]){_0x292212['applications'][_0xb7b2('0x99')]({'id':0x0,'priority':_0x292212['applications'][_0xb7b2('0x68')]+0x1,'app':'close','appdata':'unmanaged','interval':_0xb7b2('0x9a')});}}return db[_0xb7b2('0x9b')][_0xb7b2('0x5d')]({'body':_0x13dcb5[_0xb7b2('0x5e')][_0xb7b2('0x5e')],'OpenchannelAccountId':_0x13dcb5[_0xb7b2('0x5a')]['id'],'OpenchannelInteractionId':_0x262f91['id'],'direction':'in','ContactId':_0x292212[_0xb7b2('0x8d')]['id'],'AttachmentId':_0x13dcb5['body'][_0xb7b2('0x9c')]});})[_0xb7b2('0x21')](function(_0x54de78){_0x292212[_0xb7b2('0x28')]=_0x54de78;if(_0x292212['interaction'][_0xb7b2('0x9d')]){return db['User'][_0xb7b2('0x5c')]({'attributes':['id',_0xb7b2('0x3c')],'where':{'id':_0x292212[_0xb7b2('0x96')]['UserId']}})[_0xb7b2('0x21')](function(_0x22fab7){if(_0x22fab7){_0x292212['applications'][_0xb7b2('0x9e')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x22fab7[_0xb7b2('0x3c')]+','+(_0x292212[_0xb7b2('0x86')][_0xb7b2('0x9f')]||0xa),'interval':'*,*,*,*'});_0x292212[_0xb7b2('0xa0')]=![];}return respondWithRpcPromise(_0xb7b2('0xa1'),_0xb7b2('0xa2'),_0x292212);});}return respondWithRpcPromise(_0xb7b2('0xa1'),_0xb7b2('0xa2'),_0x292212);})[_0xb7b2('0x21')](function(_0x5a496c){respondWithRpcPromise('EventManager',_0xb7b2('0xa3'),{'event':_0xb7b2('0x6f'),'message':_0x5a496c},client9002);return _0x5a496c;})['then'](respondWithResult(_0x5ea387,null))['catch'](handleError(_0x5ea387,null));};exports[_0xb7b2('0xa4')]=function(_0x574592,_0x499ca2){var _0x19d24b=_0x574592[_0xb7b2('0x5a')]['id'];var _0x4dd321=_0x574592[_0xb7b2('0x5e')];var _0x520755=0xc8;var _0x4d727e=null;return db[_0xb7b2('0xa5')]['transaction']({'isolationLevel':db[_0xb7b2('0xa5')]['Transaction'][_0xb7b2('0xa6')][_0xb7b2('0xa7')]},function(_0x475bcb){return db[_0xb7b2('0x54')][_0xb7b2('0x6d')]({'where':{'id':_0x19d24b},'transaction':_0x475bcb})['then'](function(_0x6022e0){if(_0x6022e0){return db[_0xb7b2('0x85')][_0xb7b2('0x36')]({'where':{'OpenchannelAccountId':_0x19d24b},'transaction':_0x475bcb})[_0xb7b2('0x21')](function(){var _0x441783=_[_0xb7b2('0x40')](_0x4dd321,function(_0xeef424){_0xeef424[_0xb7b2('0x65')]=_0x19d24b;return _0xeef424;});return db[_0xb7b2('0x85')][_0xb7b2('0xa8')](_0x441783,{'transaction':_0x475bcb});});}else{_0x520755=0x194;_0x4d727e=[];}});})[_0xb7b2('0x21')](function(){if(_0x520755!==0x194){return db[_0xb7b2('0x85')][_0xb7b2('0xa9')]({'where':{'OpenchannelAccountId':_0x19d24b},'order':_0xb7b2('0xaa')})[_0xb7b2('0x21')](function(_0x25a129){_0x4d727e=_0x25a129;});}})[_0xb7b2('0x2b')](function(_0x60194d){_0x520755=0x1f4;logger[_0xb7b2('0x27')](_0x60194d[_0xb7b2('0x3b')]);if(_0x60194d[_0xb7b2('0x3c')]){delete _0x60194d[_0xb7b2('0x3c')];}_0x4d727e=_0x60194d;})[_0xb7b2('0xab')](function(){if(_0x4d727e===null){_0x499ca2[_0xb7b2('0x2c')](_0x520755);}else{if(_0x520755===0x1f4){_0x499ca2[_0xb7b2('0x32')](_0x520755)[_0xb7b2('0x3d')](_0x4d727e);}else{_0x499ca2[_0xb7b2('0x32')](_0x520755)['json'](_0x4d727e);}}});};exports['getApplications']=function(_0x63733c,_0x9bdc5b,_0x1b799f){var _0x2dce0e={};var _0x3dca73={};var _0xf51d5f;var _0x2831ee;return db[_0xb7b2('0x54')][_0xb7b2('0x6d')]({'where':{'id':_0x63733c[_0xb7b2('0x5a')]['id']}})[_0xb7b2('0x21')](handleEntityNotFound(_0x9bdc5b,null))['then'](function(_0x28bf50){if(_0x28bf50){_0xf51d5f=_0x28bf50;_0x3dca73[_0xb7b2('0x44')]=_[_0xb7b2('0x46')](db[_0xb7b2('0x85')]['rawAttributes']);_0x3dca73[_0xb7b2('0x45')]=_['keys'](_0x63733c[_0xb7b2('0x45')]);_0x3dca73['filters']=_[_0xb7b2('0x48')](_0x3dca73['model'],_0x3dca73[_0xb7b2('0x45')]);_0x2dce0e[_0xb7b2('0x47')]=_['intersection'](_0x3dca73[_0xb7b2('0x44')],qs['fields'](_0x63733c[_0xb7b2('0x45')]['fields']));_0x2dce0e[_0xb7b2('0x47')]=_0x2dce0e[_0xb7b2('0x47')][_0xb7b2('0x68')]?_0x2dce0e['attributes']:_0x3dca73['model'];_0x2dce0e[_0xb7b2('0x4b')]=qs[_0xb7b2('0x4c')](_0x63733c[_0xb7b2('0x45')][_0xb7b2('0x4c')]);_0x2dce0e[_0xb7b2('0x4d')]=qs[_0xb7b2('0x4e')](_[_0xb7b2('0x4f')](_0x63733c[_0xb7b2('0x45')],_0x3dca73['filters']));if(_0x63733c[_0xb7b2('0x45')]['filter']){_0x2dce0e[_0xb7b2('0x4d')]=_['merge'](_0x2dce0e['where'],{'$or':_['map'](_0x2dce0e[_0xb7b2('0x47')],function(_0x91153f){var _0x3405c1={};_0x3405c1[_0x91153f]={'$like':'%'+_0x63733c['query'][_0xb7b2('0x50')]+'%'};return _0x3405c1;})});}_0x2dce0e=_['merge']({},_0x2dce0e,_0x63733c['options']);return _0xf51d5f['getApplications'](_0x2dce0e);}})[_0xb7b2('0x21')](function(_0x322b7c){if(_0x322b7c){_0x2831ee=_0x322b7c[_0xb7b2('0x68')];if(!_0x63733c['query']['hasOwnProperty'](_0xb7b2('0x4a'))){_0x2dce0e[_0xb7b2('0x31')]=qs[_0xb7b2('0x31')](_0x63733c[_0xb7b2('0x45')][_0xb7b2('0x31')]);_0x2dce0e[_0xb7b2('0x2e')]=qs[_0xb7b2('0x2e')](_0x63733c[_0xb7b2('0x45')][_0xb7b2('0x2e')]);}return _0xf51d5f[_0xb7b2('0xac')](_0x2dce0e);}})['then'](function(_0x554c29){if(_0x554c29){return _0x554c29?{'count':_0x2831ee,'rows':_0x554c29}:null;}})[_0xb7b2('0x21')](respondWithResult(_0x9bdc5b,null))[_0xb7b2('0x2b')](handleError(_0x9bdc5b,null));};exports[_0xb7b2('0xad')]=function(_0x3b8b,_0x5743c7,_0x206626){var _0x16a03e={'raw':![],'where':{}};var _0x294a55={};var _0x1cf9cf={'count':0x0,'rows':[]};return db[_0xb7b2('0x54')][_0xb7b2('0x6d')]({'where':{'id':_0x3b8b[_0xb7b2('0x5a')]['id']}})[_0xb7b2('0x21')](handleEntityNotFound(_0x5743c7,null))['then'](function(_0xb7def3){if(_0xb7def3){_0x294a55[_0xb7b2('0x44')]=_[_0xb7b2('0x46')](db[_0xb7b2('0x91')]['rawAttributes']);_0x294a55[_0xb7b2('0x45')]=_[_0xb7b2('0x46')](_0x3b8b['query']);_0x294a55['filters']=_[_0xb7b2('0x48')](_0x294a55[_0xb7b2('0x44')],_0x294a55[_0xb7b2('0x45')]);_0x16a03e['attributes']=_[_0xb7b2('0x48')](_0x294a55[_0xb7b2('0x44')],qs[_0xb7b2('0x49')](_0x3b8b[_0xb7b2('0x45')][_0xb7b2('0x49')]));_0x16a03e['attributes']=_0x16a03e[_0xb7b2('0x47')][_0xb7b2('0x68')]?_0x16a03e[_0xb7b2('0x47')]:_0x294a55['model'];if(!_0x3b8b[_0xb7b2('0x45')]['hasOwnProperty'](_0xb7b2('0x4a'))){_0x16a03e[_0xb7b2('0x31')]=qs[_0xb7b2('0x31')](_0x3b8b['query']['limit']);_0x16a03e[_0xb7b2('0x2e')]=qs[_0xb7b2('0x2e')](_0x3b8b[_0xb7b2('0x45')][_0xb7b2('0x2e')]);}_0x16a03e[_0xb7b2('0x4b')]=qs[_0xb7b2('0x4c')](_0x3b8b[_0xb7b2('0x45')][_0xb7b2('0x4c')]);_0x16a03e[_0xb7b2('0x4d')]=qs['filters'](_[_0xb7b2('0x4f')](_0x3b8b[_0xb7b2('0x45')],_0x294a55['filters']));_0x16a03e['where']['OpenchannelAccountId']=_0xb7def3['id'];if(_0x3b8b[_0xb7b2('0x45')]['filter']){_0x16a03e['where']=_[_0xb7b2('0x51')](_0x16a03e[_0xb7b2('0x4d')],{'$or':_['map'](_0x16a03e[_0xb7b2('0x47')],function(_0x18a296){var _0x20b303={};_0x20b303[_0x18a296]={'$like':'%'+_0x3b8b['query']['filter']+'%'};return _0x20b303;})});}_0x16a03e=_['merge']({},_0x16a03e,_0x3b8b[_0xb7b2('0x53')]);return db['OpenchannelInteraction']['count']({'where':_0x16a03e[_0xb7b2('0x4d')]})[_0xb7b2('0x21')](function(_0x14450c){_0x1cf9cf[_0xb7b2('0x30')]=_0x14450c;if(_0x3b8b[_0xb7b2('0x45')][_0xb7b2('0x55')]){_0x16a03e[_0xb7b2('0x56')]=[{'model':db[_0xb7b2('0x71')],'as':_0xb7b2('0xae'),'required':![]},{'model':db['User'],'as':_0xb7b2('0xaf'),'attributes':[_0xb7b2('0x3c'),_0xb7b2('0xb0'),_0xb7b2('0xb1')],'required':![]},{'model':db[_0xb7b2('0xb2')],'as':_0xb7b2('0xb3'),'attributes':['id',_0xb7b2('0x3c'),_0xb7b2('0xb4')],'where':_0x3b8b['query'][_0xb7b2('0xb5')]?{'id':_0x3b8b[_0xb7b2('0x45')][_0xb7b2('0xb5')]}:undefined,'required':_0x3b8b[_0xb7b2('0x45')][_0xb7b2('0xb5')]?!![]:![]}];}return db[_0xb7b2('0x91')]['findAll'](_0x16a03e);})['then'](function(_0x23dab6){_0x1cf9cf[_0xb7b2('0x58')]=_0x23dab6;return _0x1cf9cf;});}})[_0xb7b2('0x21')](respondWithFilteredResult(_0x5743c7,_0x16a03e))[_0xb7b2('0x2b')](handleError(_0x5743c7,null));};exports[_0xb7b2('0xb6')]=function(_0x4e5ed3,_0x42cdcc,_0x434c62){return db['OpenchannelAccount'][_0xb7b2('0x5c')]({'where':{'id':_0x4e5ed3['params']['id']}})['then'](handleEntityNotFound(_0x42cdcc,null))['then'](function(_0x32adb8){if(_0x32adb8){return _0x32adb8['addAgents'](_0x4e5ed3[_0xb7b2('0x5e')]['ids'],_[_0xb7b2('0xb7')](_0x4e5ed3[_0xb7b2('0x5e')],[_0xb7b2('0x6a'),'id'])||{})['spread'](function(_0x347268){for(var _0x450c69=0x0;_0x450c69<_0x4e5ed3['body'][_0xb7b2('0x6a')][_0xb7b2('0x68')];_0x450c69+=0x1){socket[_0xb7b2('0xb8')]('userOpenchannelAccount:save',{'UserId':Number(_0x4e5ed3[_0xb7b2('0x5e')][_0xb7b2('0x6a')][_0x450c69]),'OpenchannelAccountId':Number(_0x4e5ed3['params']['id'])});}return _0x347268;});}})[_0xb7b2('0x21')](respondWithResult(_0x42cdcc,null))['catch'](handleError(_0x42cdcc,null));};exports[_0xb7b2('0xb9')]=function(_0x541c1c,_0x102951,_0x4fa794){return db[_0xb7b2('0x54')][_0xb7b2('0x5c')]({'where':{'id':_0x541c1c[_0xb7b2('0x5a')]['id']}})['then'](handleEntityNotFound(_0x102951,null))[_0xb7b2('0x21')](function(_0x54121c){if(_0x54121c){return _0x54121c[_0xb7b2('0xb9')](_0x541c1c['query'][_0xb7b2('0x6a')])[_0xb7b2('0x21')](function(){if(_[_0xb7b2('0xba')](_0x541c1c['query'][_0xb7b2('0x6a')])){for(var _0x24fdce=0x0;_0x24fdce<_0x541c1c[_0xb7b2('0x45')][_0xb7b2('0x6a')][_0xb7b2('0x68')];_0x24fdce+=0x1){socket[_0xb7b2('0xb8')](_0xb7b2('0xbb'),{'UserId':Number(_0x541c1c[_0xb7b2('0x45')][_0xb7b2('0x6a')][_0x24fdce]),'OpenchannelAccountId':Number(_0x541c1c[_0xb7b2('0x5a')]['id'])});}}else{socket[_0xb7b2('0xb8')]('userOpenchannelAccount:remove',{'UserId':Number(_0x541c1c['query'][_0xb7b2('0x6a')]),'OpenchannelAccountId':Number(_0x541c1c[_0xb7b2('0x5a')]['id'])});}});}})[_0xb7b2('0x21')](respondWithStatusCode(_0x102951,null))[_0xb7b2('0x2b')](handleError(_0x102951,null));};exports['getAgents']=function(_0x2409d4,_0x37cf51,_0x470094){var _0x5a771e={};var _0x5e3c97={};var _0x51c6f4;var _0x19b51b;return db['OpenchannelAccount']['findOne']({'where':{'id':_0x2409d4['params']['id']}})[_0xb7b2('0x21')](handleEntityNotFound(_0x37cf51,null))['then'](function(_0x483e3c){if(_0x483e3c){_0x51c6f4=_0x483e3c;_0x5e3c97[_0xb7b2('0x44')]=_[_0xb7b2('0x46')](db['User']['rawAttributes']);_0x5e3c97[_0xb7b2('0x45')]=_[_0xb7b2('0x46')](_0x2409d4['query']);_0x5e3c97[_0xb7b2('0x4e')]=_['intersection'](_0x5e3c97[_0xb7b2('0x44')],_0x5e3c97['query']);_0x5a771e[_0xb7b2('0x47')]=_[_0xb7b2('0x48')](_0x5e3c97[_0xb7b2('0x44')],qs[_0xb7b2('0x49')](_0x2409d4[_0xb7b2('0x45')][_0xb7b2('0x49')]));_0x5a771e[_0xb7b2('0x47')]=_0x5a771e['attributes']['length']?_0x5a771e['attributes']:_0x5e3c97[_0xb7b2('0x44')];_0x5a771e[_0xb7b2('0x4b')]=qs[_0xb7b2('0x4c')](_0x2409d4['query'][_0xb7b2('0x4c')]);_0x5a771e[_0xb7b2('0x4d')]=qs[_0xb7b2('0x4e')](_[_0xb7b2('0x4f')](_0x2409d4[_0xb7b2('0x45')],_0x5e3c97[_0xb7b2('0x4e')]));if(_0x2409d4['query'][_0xb7b2('0x50')]){_0x5a771e[_0xb7b2('0x4d')]=_[_0xb7b2('0x51')](_0x5a771e['where'],{'$or':_[_0xb7b2('0x40')](_0x5a771e[_0xb7b2('0x47')],function(_0x36cf7b){var _0x2ad838={};_0x2ad838[_0x36cf7b]={'$like':'%'+_0x2409d4['query']['filter']+'%'};return _0x2ad838;})});}_0x5a771e=_[_0xb7b2('0x51')]({},_0x5a771e,_0x2409d4[_0xb7b2('0x53')]);return _0x51c6f4[_0xb7b2('0xbc')](_0x5a771e);}})[_0xb7b2('0x21')](function(_0x21e25c){if(_0x21e25c){_0x19b51b=_0x21e25c[_0xb7b2('0x68')];if(!_0x2409d4[_0xb7b2('0x45')][_0xb7b2('0xbd')]('nolimit')){_0x5a771e[_0xb7b2('0x31')]=qs[_0xb7b2('0x31')](_0x2409d4[_0xb7b2('0x45')][_0xb7b2('0x31')]);_0x5a771e[_0xb7b2('0x2e')]=qs[_0xb7b2('0x2e')](_0x2409d4[_0xb7b2('0x45')][_0xb7b2('0x2e')]);}return _0x51c6f4[_0xb7b2('0xbc')](_0x5a771e);}})[_0xb7b2('0x21')](function(_0x4d9fb7){if(_0x4d9fb7){return _0x4d9fb7?{'count':_0x19b51b,'rows':_0x4d9fb7}:null;}})[_0xb7b2('0x21')](respondWithResult(_0x37cf51,null))[_0xb7b2('0x2b')](handleError(_0x37cf51,null));};exports['send']=function(_0x23e7fc,_0x4b54f9,_0x1e2988){var _0x2a40f9,_0x4442df,_0x401997;if(_[_0xb7b2('0x7c')](_0x23e7fc[_0xb7b2('0x5e')][_0xb7b2('0x5e')])||_0x23e7fc[_0xb7b2('0x5e')]['body']===''){throw new db[(_0xb7b2('0x72'))][(_0xb7b2('0x73'))](_0xb7b2('0x7d'));}if(_[_0xb7b2('0x7c')](_0x23e7fc[_0xb7b2('0x5e')]['to'])){}_0x2a40f9=_0x23e7fc[_0xb7b2('0x5e')]['to'];return db['OpenchannelAccount']['findOne']({'where':{'id':_0x23e7fc[_0xb7b2('0x5a')]['id']}})['then'](handleEntityNotFound(_0x4b54f9,null))[_0xb7b2('0x21')](function(_0x272907){if(_0x272907){return db[_0xb7b2('0x54')]['find']({'where':{'id':_0x272907['id']},'include':[{'model':db['CmList'],'as':_0xb7b2('0x83'),'include':[{'model':db['CmContact'],'as':'Contacts','where':{[_0x272907['mapKey']]:_0x2a40f9},'limit':0x1,'order':[[_0xb7b2('0x76'),_0xb7b2('0x84')]]}]}]})[_0xb7b2('0x21')](handleEntityNotFound(_0x4b54f9,null))[_0xb7b2('0x21')](function(_0xe24488){if(_0xe24488&&_0xe24488[_0xb7b2('0x83')]){_0x4442df=_0xe24488[_0xb7b2('0x37')]({'plain':!![]});if(_0x4442df[_0xb7b2('0x83')]&&_0x4442df[_0xb7b2('0x83')]['Contacts'][_0xb7b2('0x68')]){return _0x4442df[_0xb7b2('0x83')]['Contacts'][0x0];}return db[_0xb7b2('0x71')]['create'](_[_0xb7b2('0x18')](_0x23e7fc[_0xb7b2('0x5e')],{'firstName':_0x2a40f9,[_0xe24488[_0xb7b2('0x7e')]]:_0x2a40f9,'phone':_0x2a40f9,'ListId':_0x4442df[_0xb7b2('0x79')]}));}})['then'](handleEntityNotFound(_0x4b54f9,null))[_0xb7b2('0x21')](function(_0x480e08){if(_0x480e08){_0x401997=_0x480e08;return db[_0xb7b2('0x91')]['find']({'where':{'ContactId':_0x401997['id'],'closed':![],'OpenchannelAccountId':_0x4442df['id']}})[_0xb7b2('0x21')](function(_0x166647){if(_0x166647){return[_0x166647,![]];}return db[_0xb7b2('0x91')][_0xb7b2('0x5d')]({'UserId':_0x23e7fc['user']['id'],'ContactId':_0x401997['id'],'OpenchannelAccountId':_0x4442df['id'],'lastMsgDirection':'out','Messages':[_[_0xb7b2('0x51')](_0x23e7fc[_0xb7b2('0x5e')],{'read':![],'body':_0x23e7fc[_0xb7b2('0x5e')][_0xb7b2('0x5e')],'OpenchannelAccountId':_0x4442df['id'],'UserId':_0x23e7fc[_0xb7b2('0x5f')]['id'],'ContactId':_0x401997['id']})]},{'include':[{'model':db[_0xb7b2('0x9b')],'as':_0xb7b2('0xbe')}]})[_0xb7b2('0x21')](function(_0x406080){return[_0x406080,!![]];});});}})[_0xb7b2('0x94')](function(_0x57ef86,_0x5dff8a){if(_0x5dff8a){return _0x57ef86;}return db[_0xb7b2('0x9b')][_0xb7b2('0x5d')](_[_0xb7b2('0x51')](_0x23e7fc[_0xb7b2('0x5e')],{'read':![],'body':_0x23e7fc[_0xb7b2('0x5e')][_0xb7b2('0x5e')],'OpenchannelAccountId':_0x4442df['id'],'OpenchannelInteractionId':_0x57ef86['id'],'UserId':_0x23e7fc[_0xb7b2('0x5f')]['id'],'ContactId':_0x401997['id']}))['then'](function(_0x1c2c9d){_0x57ef86['dataValues'][_0xb7b2('0xbe')]=[];_0x57ef86[_0xb7b2('0xbf')][_0xb7b2('0xbe')][_0xb7b2('0x99')](_0x1c2c9d[_0xb7b2('0xbf')]);return _0x57ef86;});});}})[_0xb7b2('0x21')](respondWithResult(_0x4b54f9,null))[_0xb7b2('0x2b')](handleError(_0x4b54f9,null));};
\ No newline at end of file
+var _0x7279=['then','destroy','get','UserProfileResource','name','send','index','Pause','map','OpenchannelAccount','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','options','includeAll','include','findAll','rows','show','params','mandatoryDispositionPause','keys','merge','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','OpenchannelAccounts','UserProfileSection','userProfileId','autoAssociation','update','describe','addDisposition','OpenchannelAccountId','Disposition','getDispositions','findOne','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','notify','openchannel','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','isNil','from','from\x20is\x20mandatory','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','List','Contacts','DESC','OpenchannelApplication','Applications','applications','list','orderBy','priority','asc','account','contact','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','messageId','interaction','created','close','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','User','agent','waitForTheAssignedAgent','forcedOwnership','startRouting','EventManager','addApplications','transaction','sequelize','Transaction','READ_COMMITTED','bulkCreate','findAndCountAll','finally','getApplications','getInteractions','Contact','Owner','internal','Tag','Tags','color','tag','addAgents','omit','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','body\x20is\x20mandatory\x20and\x20not\x20empty','CmList','Messages','push','dataValues','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','jayson/promise','client','request','info','request\x20sent','debug','stringify','error','code','OpenchannelAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','save'];(function(_0x4a9d1e,_0x20784c){var _0x5bca6a=function(_0x1d6c24){while(--_0x1d6c24){_0x4a9d1e['push'](_0x4a9d1e['shift']());}};_0x5bca6a(++_0x20784c);}(_0x7279,0x8a));var _0x9727=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7279[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x9727('0x0'));var rimraf=require(_0x9727('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9727('0x2'));var rp=require(_0x9727('0x3'));var moment=require(_0x9727('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9727('0x5'));var util=require(_0x9727('0x6'));var path=require(_0x9727('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x9727('0x8'));var fs=require('fs');var fs_extra=require(_0x9727('0x9'));var _=require(_0x9727('0xa'));var squel=require(_0x9727('0xb'));var crypto=require(_0x9727('0xc'));var jsforce=require(_0x9727('0xd'));var deskjs=require(_0x9727('0xe'));var toCsv=require(_0x9727('0xf'));var querystring=require(_0x9727('0x10'));var Papa=require(_0x9727('0x11'));var Redis=require(_0x9727('0x12'));var authService=require(_0x9727('0x13'));var qs=require(_0x9727('0x14'));var as=require(_0x9727('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9727('0x16'))(_0x9727('0x17'));var utils=require('../../config/utils');var config=require(_0x9727('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x9727('0x19'))['db'];config[_0x9727('0x1a')]=_[_0x9727('0x1b')](config[_0x9727('0x1a')],{'host':_0x9727('0x1c'),'port':0x18eb});var socket=require(_0x9727('0x1d'))(new Redis(config['redis']));require(_0x9727('0x1e'))['register'](socket);var jayson=require(_0x9727('0x1f'));var client=jayson[_0x9727('0x20')]['http']({'port':0x232c});var client9002=jayson[_0x9727('0x20')]['http']({'port':0x232a});function respondWithRpcPromise(_0x178487,_0x352fa6,_0x3fd179,_0x6cce6f){return new BPromise(function(_0x5bd642,_0x28d289){var _0x296aa1=_0x6cce6f||client;return _0x296aa1[_0x9727('0x21')](_0x178487,_0x3fd179)['then'](function(_0x266b2d){logger[_0x9727('0x22')]('OpenchannelAccount,\x20%s,\x20%s',_0x352fa6,_0x9727('0x23'));logger[_0x9727('0x24')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x352fa6,_0x9727('0x23'),JSON[_0x9727('0x25')](_0x266b2d));if(_0x266b2d[_0x9727('0x26')]){if(_0x266b2d[_0x9727('0x26')][_0x9727('0x27')]===0x1f4){logger[_0x9727('0x26')](_0x9727('0x28'),_0x352fa6,_0x266b2d[_0x9727('0x26')]['message']);return _0x28d289(_0x266b2d[_0x9727('0x26')][_0x9727('0x29')]);}logger[_0x9727('0x26')]('OpenchannelAccount,\x20%s,\x20%s',_0x352fa6,_0x266b2d['error'][_0x9727('0x29')]);return _0x5bd642(_0x266b2d[_0x9727('0x26')]['message']);}else{logger[_0x9727('0x22')](_0x9727('0x28'),_0x352fa6,_0x9727('0x23'));_0x5bd642(_0x266b2d[_0x9727('0x2a')][_0x9727('0x29')]);}})[_0x9727('0x2b')](function(_0x502a87){logger[_0x9727('0x26')](_0x9727('0x28'),_0x352fa6,_0x502a87);_0x28d289(_0x502a87);});});}function respondWithStatusCode(_0x3d5be9,_0x17ae6c){_0x17ae6c=_0x17ae6c||0xcc;return function(_0x249982){if(_0x249982){return _0x3d5be9[_0x9727('0x2c')](_0x17ae6c);}return _0x3d5be9[_0x9727('0x2d')](_0x17ae6c)[_0x9727('0x2e')]();};}function respondWithResult(_0x27f8d9,_0x1a2e3f){_0x1a2e3f=_0x1a2e3f||0xc8;return function(_0x333be4){if(_0x333be4){return _0x27f8d9['status'](_0x1a2e3f)[_0x9727('0x2f')](_0x333be4);}};}function respondWithFilteredResult(_0x2f18e5,_0x3d13d2){return function(_0x11c3b8){if(_0x11c3b8){var _0x1fb0ab=typeof _0x3d13d2['offset']===_0x9727('0x30')&&typeof _0x3d13d2[_0x9727('0x31')]===_0x9727('0x30');var _0x44320f=_0x11c3b8[_0x9727('0x32')];var _0x5c9552=_0x1fb0ab?0x0:_0x3d13d2[_0x9727('0x33')];var _0x65efcf=_0x1fb0ab?_0x11c3b8[_0x9727('0x32')]:_0x3d13d2[_0x9727('0x33')]+_0x3d13d2[_0x9727('0x31')];var _0x570887;if(_0x65efcf>=_0x44320f){_0x65efcf=_0x44320f;_0x570887=0xc8;}else{_0x570887=0xce;}_0x2f18e5[_0x9727('0x2d')](_0x570887);return _0x2f18e5[_0x9727('0x34')]('Content-Range',_0x5c9552+'-'+_0x65efcf+'/'+_0x44320f)['json'](_0x11c3b8);}return null;};}function patchUpdates(_0x53df62){return function(_0x321660){try{jsonpatch[_0x9727('0x35')](_0x321660,_0x53df62,!![]);}catch(_0x483484){return BPromise[_0x9727('0x36')](_0x483484);}return _0x321660[_0x9727('0x37')]();};}function saveUpdates(_0xf4f18,_0x215b12){return function(_0x3e1fde){if(_0x3e1fde){return _0x3e1fde['update'](_0xf4f18)[_0x9727('0x38')](function(_0x30609b){return _0x30609b;});}return null;};}function removeEntity(_0x5cce68,_0x260c46){return function(_0x389f74){if(_0x389f74){return _0x389f74[_0x9727('0x39')]()[_0x9727('0x38')](function(){var _0x929e86=_0x389f74[_0x9727('0x3a')]({'plain':!![]});var _0x99e844='OpenchannelAccounts';return db[_0x9727('0x3b')]['destroy']({'where':{'type':_0x99e844,'resourceId':_0x929e86['id']}})['then'](function(){return _0x389f74;});})[_0x9727('0x38')](function(){_0x5cce68['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x259137,_0x1c053f){return function(_0x161f19){if(!_0x161f19){_0x259137[_0x9727('0x2c')](0x194);}return _0x161f19;};}function handleError(_0xe9ba01,_0x8fc202){_0x8fc202=_0x8fc202||0x1f4;return function(_0x48d3c0){logger[_0x9727('0x26')](_0x48d3c0['stack']);if(_0x48d3c0[_0x9727('0x3c')]){delete _0x48d3c0[_0x9727('0x3c')];}_0xe9ba01[_0x9727('0x2d')](_0x8fc202)[_0x9727('0x3d')](_0x48d3c0);};}exports[_0x9727('0x3e')]=function(_0x16329d,_0xde616){var _0x429d58={'include':[{'model':db[_0x9727('0x3f')],'as':'mandatoryDispositionPause'}]},_0x3ad4aa={},_0x552620={'count':0x0,'rows':[]};var _0x3ce58b=_[_0x9727('0x40')](db[_0x9727('0x41')][_0x9727('0x42')],function(_0x43eaf7){return{'name':_0x43eaf7[_0x9727('0x43')],'type':_0x43eaf7[_0x9727('0x44')]['key']};});_0x3ad4aa[_0x9727('0x45')]=_['map'](_0x3ce58b,_0x9727('0x3c'));_0x3ad4aa['query']=_['keys'](_0x16329d[_0x9727('0x46')]);_0x3ad4aa[_0x9727('0x47')]=_[_0x9727('0x48')](_0x3ad4aa['model'],_0x3ad4aa[_0x9727('0x46')]);_0x429d58[_0x9727('0x49')]=_[_0x9727('0x48')](_0x3ad4aa[_0x9727('0x45')],qs[_0x9727('0x4a')](_0x16329d['query'][_0x9727('0x4a')]));_0x429d58[_0x9727('0x49')]=_0x429d58['attributes'][_0x9727('0x4b')]?_0x429d58['attributes']:_0x3ad4aa['model'];if(!_0x16329d[_0x9727('0x46')][_0x9727('0x4c')](_0x9727('0x4d'))){_0x429d58[_0x9727('0x31')]=qs[_0x9727('0x31')](_0x16329d[_0x9727('0x46')][_0x9727('0x31')]);_0x429d58[_0x9727('0x33')]=qs[_0x9727('0x33')](_0x16329d[_0x9727('0x46')]['offset']);}_0x429d58[_0x9727('0x4e')]=qs[_0x9727('0x4f')](_0x16329d[_0x9727('0x46')]['sort']);_0x429d58[_0x9727('0x50')]=qs[_0x9727('0x47')](_[_0x9727('0x51')](_0x16329d['query'],_0x3ad4aa[_0x9727('0x47')]),_0x3ce58b);if(_0x16329d[_0x9727('0x46')][_0x9727('0x52')]){_0x429d58[_0x9727('0x50')]=_['merge'](_0x429d58[_0x9727('0x50')],{'$or':_['map'](_0x3ce58b,function(_0x526959){if(_0x526959[_0x9727('0x44')]!=='VIRTUAL'){var _0x8652f8={};_0x8652f8[_0x526959['name']]={'$like':'%'+_0x16329d[_0x9727('0x46')][_0x9727('0x52')]+'%'};return _0x8652f8;}})});}_0x429d58=_['merge']({},_0x429d58,_0x16329d[_0x9727('0x53')]);var _0x2d39f7={'where':_0x429d58['where']};return db[_0x9727('0x41')][_0x9727('0x32')](_0x2d39f7)[_0x9727('0x38')](function(_0x144990){_0x552620[_0x9727('0x32')]=_0x144990;if(_0x16329d['query'][_0x9727('0x54')]){_0x429d58[_0x9727('0x55')]=[{'all':!![]}];}return db[_0x9727('0x41')][_0x9727('0x56')](_0x429d58);})[_0x9727('0x38')](function(_0x53ca02){_0x552620[_0x9727('0x57')]=_0x53ca02;return _0x552620;})['then'](respondWithFilteredResult(_0xde616,_0x429d58))[_0x9727('0x2b')](handleError(_0xde616,null));};exports[_0x9727('0x58')]=function(_0x43e4d1,_0x38aa54){var _0xfc310b={'raw':![],'where':{'id':_0x43e4d1[_0x9727('0x59')]['id']},'include':[{'model':db['Pause'],'as':_0x9727('0x5a')}]},_0x32a76e={};_0x32a76e[_0x9727('0x45')]=_[_0x9727('0x5b')](db[_0x9727('0x41')]['rawAttributes']);_0x32a76e[_0x9727('0x46')]=_[_0x9727('0x5b')](_0x43e4d1[_0x9727('0x46')]);_0x32a76e['filters']=_['intersection'](_0x32a76e[_0x9727('0x45')],_0x32a76e[_0x9727('0x46')]);_0xfc310b['attributes']=_[_0x9727('0x48')](_0x32a76e[_0x9727('0x45')],qs['fields'](_0x43e4d1['query'][_0x9727('0x4a')]));_0xfc310b[_0x9727('0x49')]=_0xfc310b[_0x9727('0x49')][_0x9727('0x4b')]?_0xfc310b[_0x9727('0x49')]:_0x32a76e[_0x9727('0x45')];if(_0x43e4d1[_0x9727('0x46')][_0x9727('0x54')]){_0xfc310b[_0x9727('0x55')]=[{'all':!![]}];}_0xfc310b=_[_0x9727('0x5c')]({},_0xfc310b,_0x43e4d1[_0x9727('0x53')]);return db[_0x9727('0x41')][_0x9727('0x5d')](_0xfc310b)[_0x9727('0x38')](handleEntityNotFound(_0x38aa54,null))[_0x9727('0x38')](respondWithResult(_0x38aa54,null))[_0x9727('0x2b')](handleError(_0x38aa54,null));};exports[_0x9727('0x5e')]=function(_0x543581,_0x56d2a5){return db['OpenchannelAccount']['create'](_0x543581[_0x9727('0x5f')],{})[_0x9727('0x38')](function(_0x3b295a){var _0x3e4f31=_0x543581['user'][_0x9727('0x3a')]({'plain':!![]});if(!_0x3e4f31)throw new Error(_0x9727('0x60'));if(_0x3e4f31[_0x9727('0x61')]===_0x9727('0x62')){var _0x32977a=_0x3b295a['get']({'plain':!![]});var _0x47bf41=_0x9727('0x63');return db[_0x9727('0x64')][_0x9727('0x5d')]({'where':{'name':_0x47bf41,'userProfileId':_0x3e4f31[_0x9727('0x65')]},'raw':!![]})[_0x9727('0x38')](function(_0x41bf81){if(_0x41bf81&&_0x41bf81[_0x9727('0x66')]===0x0){return db['UserProfileResource']['create']({'name':_0x32977a[_0x9727('0x3c')],'resourceId':_0x32977a['id'],'type':_0x41bf81['name'],'sectionId':_0x41bf81['id']},{})[_0x9727('0x38')](function(){return _0x3b295a;});}else{return _0x3b295a;}})[_0x9727('0x2b')](function(_0x1f555a){logger[_0x9727('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1f555a);throw _0x1f555a;});}return _0x3b295a;})[_0x9727('0x38')](respondWithResult(_0x56d2a5,0xc9))['catch'](handleError(_0x56d2a5,null));};exports[_0x9727('0x67')]=function(_0x39cad7,_0x1b606e){if(_0x39cad7[_0x9727('0x5f')]['id']){delete _0x39cad7[_0x9727('0x5f')]['id'];}return db['OpenchannelAccount'][_0x9727('0x5d')]({'where':{'id':_0x39cad7[_0x9727('0x59')]['id']},'include':[{'model':db[_0x9727('0x3f')],'as':_0x9727('0x5a')}]})[_0x9727('0x38')](handleEntityNotFound(_0x1b606e,null))[_0x9727('0x38')](saveUpdates(_0x39cad7[_0x9727('0x5f')],null))[_0x9727('0x38')](respondWithResult(_0x1b606e,null))['catch'](handleError(_0x1b606e,null));};exports[_0x9727('0x39')]=function(_0x370afd,_0x15f948){return db[_0x9727('0x41')][_0x9727('0x5d')]({'where':{'id':_0x370afd['params']['id']}})[_0x9727('0x38')](handleEntityNotFound(_0x15f948,null))[_0x9727('0x38')](removeEntity(_0x15f948,null))[_0x9727('0x2b')](handleError(_0x15f948,null));};exports[_0x9727('0x68')]=function(_0xb512ef,_0x5e1d40){return db['OpenchannelAccount']['describe']()[_0x9727('0x38')](respondWithResult(_0x5e1d40,null))[_0x9727('0x2b')](handleError(_0x5e1d40,null));};exports[_0x9727('0x69')]=function(_0x3aabd3,_0x3c3eb5,_0x27eb69){if(_0x3aabd3['body']['id']){delete _0x3aabd3[_0x9727('0x5f')]['id'];}return db[_0x9727('0x41')][_0x9727('0x5d')]({'where':{'id':_0x3aabd3[_0x9727('0x59')]['id']}})['then'](handleEntityNotFound(_0x3c3eb5,null))[_0x9727('0x38')](function(_0x40cce5){if(_0x40cce5){_0x3aabd3[_0x9727('0x5f')][_0x9727('0x6a')]=_0x40cce5['id'];return db[_0x9727('0x6b')][_0x9727('0x5e')](_0x3aabd3[_0x9727('0x5f')]);}})[_0x9727('0x38')](respondWithResult(_0x3c3eb5,null))[_0x9727('0x2b')](handleError(_0x3c3eb5,null));};exports[_0x9727('0x6c')]=function(_0x61c742,_0x321b61,_0x367779){var _0x290a1f={'raw':![],'where':{}};var _0x6e8ced={};var _0x16f3cc={'count':0x0,'rows':[]};return db[_0x9727('0x41')][_0x9727('0x6d')]({'where':{'id':_0x61c742['params']['id']}})[_0x9727('0x38')](handleEntityNotFound(_0x321b61,null))[_0x9727('0x38')](function(_0x595c5a){if(_0x595c5a){_0x6e8ced[_0x9727('0x45')]=_['keys'](db[_0x9727('0x6b')][_0x9727('0x42')]);_0x6e8ced[_0x9727('0x46')]=_[_0x9727('0x5b')](_0x61c742[_0x9727('0x46')]);_0x6e8ced[_0x9727('0x47')]=_['intersection'](_0x6e8ced[_0x9727('0x45')],_0x6e8ced[_0x9727('0x46')]);_0x290a1f[_0x9727('0x49')]=_[_0x9727('0x48')](_0x6e8ced[_0x9727('0x45')],qs['fields'](_0x61c742[_0x9727('0x46')][_0x9727('0x4a')]));_0x290a1f['attributes']=_0x290a1f['attributes']['length']?_0x290a1f[_0x9727('0x49')]:_0x6e8ced[_0x9727('0x45')];if(!_0x61c742['query'][_0x9727('0x4c')](_0x9727('0x4d'))){_0x290a1f[_0x9727('0x31')]=qs[_0x9727('0x31')](_0x61c742['query']['limit']);_0x290a1f[_0x9727('0x33')]=qs[_0x9727('0x33')](_0x61c742['query'][_0x9727('0x33')]);}_0x290a1f['order']=qs[_0x9727('0x4f')](_0x61c742['query']['sort']);_0x290a1f[_0x9727('0x50')]=qs[_0x9727('0x47')](_[_0x9727('0x51')](_0x61c742['query'],_0x6e8ced[_0x9727('0x47')]));_0x290a1f[_0x9727('0x50')][_0x9727('0x6a')]=_0x595c5a['id'];if(_0x61c742[_0x9727('0x46')][_0x9727('0x52')]){_0x290a1f[_0x9727('0x50')]=_[_0x9727('0x5c')](_0x290a1f[_0x9727('0x50')],{'$or':_['map'](_0x290a1f['attributes'],function(_0x413661){var _0x46d8fd={};_0x46d8fd[_0x413661]={'$like':'%'+_0x61c742['query'][_0x9727('0x52')]+'%'};return _0x46d8fd;})});}_0x290a1f=_[_0x9727('0x5c')]({},_0x290a1f,_0x61c742[_0x9727('0x53')]);return db[_0x9727('0x6b')][_0x9727('0x32')]({'where':_0x290a1f[_0x9727('0x50')]})[_0x9727('0x38')](function(_0x2ebbc9){_0x16f3cc[_0x9727('0x32')]=_0x2ebbc9;if(_0x61c742[_0x9727('0x46')]['includeAll']){_0x290a1f[_0x9727('0x55')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x290a1f);})[_0x9727('0x38')](function(_0x4d06e0){_0x16f3cc[_0x9727('0x57')]=_0x4d06e0;return _0x16f3cc;});}})[_0x9727('0x38')](respondWithFilteredResult(_0x321b61,_0x290a1f))[_0x9727('0x2b')](handleError(_0x321b61,null));};exports[_0x9727('0x6e')]=function(_0x55a5e6,_0x5d81f0,_0x401a9f){return db[_0x9727('0x41')][_0x9727('0x5d')]({'where':{'id':_0x55a5e6[_0x9727('0x59')]['id']}})[_0x9727('0x38')](handleEntityNotFound(_0x5d81f0,null))['then'](function(_0x451905){if(_0x451905){return _0x451905[_0x9727('0x6e')](_0x55a5e6[_0x9727('0x46')][_0x9727('0x6f')]);}})[_0x9727('0x38')](respondWithStatusCode(_0x5d81f0,null))[_0x9727('0x2b')](handleError(_0x5d81f0,null));};exports[_0x9727('0x70')]=function(_0x146574,_0x4703f3,_0x11c074){if(_0x146574['body']['id']){delete _0x146574[_0x9727('0x5f')]['id'];}return db[_0x9727('0x41')][_0x9727('0x5d')]({'where':{'id':_0x146574[_0x9727('0x59')]['id']}})[_0x9727('0x38')](handleEntityNotFound(_0x4703f3,null))[_0x9727('0x38')](function(_0x51fc45){if(_0x51fc45){_0x146574[_0x9727('0x5f')][_0x9727('0x6a')]=_0x51fc45['id'];return db[_0x9727('0x71')][_0x9727('0x5e')](_0x146574[_0x9727('0x5f')]);}})[_0x9727('0x38')](respondWithResult(_0x4703f3,null))[_0x9727('0x2b')](handleError(_0x4703f3,null));};exports[_0x9727('0x72')]=function(_0x4179ad,_0x301276,_0x1c9c8d){var _0x8e692e={'raw':![],'where':{}};var _0x16f6e9={};var _0x4671fa={'count':0x0,'rows':[]};return db[_0x9727('0x41')][_0x9727('0x6d')]({'where':{'id':_0x4179ad[_0x9727('0x59')]['id']}})[_0x9727('0x38')](handleEntityNotFound(_0x301276,null))[_0x9727('0x38')](function(_0xba0e1b){if(_0xba0e1b){_0x16f6e9[_0x9727('0x45')]=_[_0x9727('0x5b')](db[_0x9727('0x71')][_0x9727('0x42')]);_0x16f6e9[_0x9727('0x46')]=_[_0x9727('0x5b')](_0x4179ad[_0x9727('0x46')]);_0x16f6e9['filters']=_[_0x9727('0x48')](_0x16f6e9[_0x9727('0x45')],_0x16f6e9[_0x9727('0x46')]);_0x8e692e[_0x9727('0x49')]=_[_0x9727('0x48')](_0x16f6e9[_0x9727('0x45')],qs[_0x9727('0x4a')](_0x4179ad[_0x9727('0x46')][_0x9727('0x4a')]));_0x8e692e[_0x9727('0x49')]=_0x8e692e['attributes']['length']?_0x8e692e[_0x9727('0x49')]:_0x16f6e9[_0x9727('0x45')];if(!_0x4179ad[_0x9727('0x46')]['hasOwnProperty']('nolimit')){_0x8e692e[_0x9727('0x31')]=qs[_0x9727('0x31')](_0x4179ad[_0x9727('0x46')][_0x9727('0x31')]);_0x8e692e[_0x9727('0x33')]=qs[_0x9727('0x33')](_0x4179ad[_0x9727('0x46')][_0x9727('0x33')]);}_0x8e692e['order']=qs[_0x9727('0x4f')](_0x4179ad[_0x9727('0x46')][_0x9727('0x4f')]);_0x8e692e['where']=qs['filters'](_['pick'](_0x4179ad[_0x9727('0x46')],_0x16f6e9[_0x9727('0x47')]));_0x8e692e[_0x9727('0x50')][_0x9727('0x6a')]=_0xba0e1b['id'];if(_0x4179ad['query']['filter']){_0x8e692e[_0x9727('0x50')]=_[_0x9727('0x5c')](_0x8e692e[_0x9727('0x50')],{'$or':_['map'](_0x8e692e[_0x9727('0x49')],function(_0x2432c2){var _0xdedfde={};_0xdedfde[_0x2432c2]={'$like':'%'+_0x4179ad[_0x9727('0x46')][_0x9727('0x52')]+'%'};return _0xdedfde;})});}_0x8e692e=_[_0x9727('0x5c')]({},_0x8e692e,_0x4179ad['options']);return db[_0x9727('0x71')][_0x9727('0x32')]({'where':_0x8e692e[_0x9727('0x50')]})[_0x9727('0x38')](function(_0x383e33){_0x4671fa['count']=_0x383e33;if(_0x4179ad[_0x9727('0x46')][_0x9727('0x54')]){_0x8e692e[_0x9727('0x55')]=[{'all':!![]}];}return db[_0x9727('0x71')][_0x9727('0x56')](_0x8e692e);})['then'](function(_0x3dee1c){_0x4671fa[_0x9727('0x57')]=_0x3dee1c;return _0x4671fa;});}})['then'](respondWithFilteredResult(_0x301276,_0x8e692e))['catch'](handleError(_0x301276,null));};exports[_0x9727('0x73')]=function(_0x3be966,_0x817438,_0x1a50af){return db['OpenchannelAccount'][_0x9727('0x5d')]({'where':{'id':_0x3be966[_0x9727('0x59')]['id']}})[_0x9727('0x38')](handleEntityNotFound(_0x817438,null))[_0x9727('0x38')](function(_0x489c3f){if(_0x489c3f){return _0x489c3f[_0x9727('0x73')](_0x3be966[_0x9727('0x46')][_0x9727('0x6f')]);}})[_0x9727('0x38')](respondWithStatusCode(_0x817438,null))[_0x9727('0x2b')](handleError(_0x817438,null));};exports[_0x9727('0x74')]=function(_0x3cf58c,_0xf1455,_0x10a2bc){var _0x38629c={'body':_0x3cf58c[_0x9727('0x5f')],'channel':_0x9727('0x75')};var _0x929929=[];var _0x446036=[];var _0x414a35={};var _0x47ccda=![];return db[_0x9727('0x76')]['describe']()[_0x9727('0x38')](function(_0x3c9138){if(!_0x3c9138){throw new db[(_0x9727('0x77'))][(_0x9727('0x78'))](_0x9727('0x79'));}_0x929929=_[_0x9727('0x7a')](_[_0x9727('0x5b')](_0x3c9138),[_0x9727('0x7b'),_0x9727('0x7c')]);_0x446036=_[_0x9727('0x7a')](_[_0x9727('0x5b')](_0x3c9138),[_0x9727('0x7b'),_0x9727('0x7c'),'CompanyId',_0x9727('0x7d')]);if(_0x3cf58c[_0x9727('0x5f')]['id']){delete _0x3cf58c[_0x9727('0x5f')]['id'];}if(_[_0x9727('0x7e')](_0x3cf58c['body'][_0x9727('0x7f')])){throw new db['Sequelize']['ValidationError'](_0x9727('0x80'));}if(_[_0x9727('0x7e')](_0x3cf58c[_0x9727('0x5f')][_0x9727('0x5f')])||_0x3cf58c[_0x9727('0x5f')]['body']===''){throw new db['Sequelize']['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x9727('0x7e')](_0x3cf58c[_0x9727('0x5f')][_0x9727('0x81')])){throw new db[(_0x9727('0x77'))][(_0x9727('0x78'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x446036);}if(!_[_0x9727('0x82')](_0x446036,_0x3cf58c[_0x9727('0x5f')]['mapKey'])){throw new db[(_0x9727('0x77'))][(_0x9727('0x78'))](_0x9727('0x83')+_0x446036);}_0x414a35[_0x3cf58c[_0x9727('0x5f')]['mapKey']]=_0x3cf58c['body'][_0x9727('0x7f')];})['then'](function(){return db[_0x9727('0x41')][_0x9727('0x5d')]({'where':{'id':_0x3cf58c['params']['id']},'include':[{'model':db['CmList'],'as':_0x9727('0x84'),'include':[{'model':db[_0x9727('0x76')],'as':_0x9727('0x85'),'where':_0x414a35,'limit':0x1,'order':[[_0x9727('0x7c'),_0x9727('0x86')]]}]},{'model':db[_0x9727('0x87')],'as':_0x9727('0x88')}]});})[_0x9727('0x38')](handleEntityNotFound(_0xf1455,null))[_0x9727('0x38')](function(_0x235ff9){if(_0x235ff9&&_0x235ff9[_0x9727('0x84')]){_0x38629c['account']=_0x235ff9;_0x38629c[_0x9727('0x89')]=_0x235ff9['Applications'];_0x38629c[_0x9727('0x8a')]=_0x235ff9[_0x9727('0x84')];_0x38629c['applications']=_[_0x9727('0x8b')](_0x38629c[_0x9727('0x89')],[_0x9727('0x8c')],[_0x9727('0x8d')]);if(_0x38629c[_0x9727('0x8e')][_0x9727('0x88')]){delete _0x38629c[_0x9727('0x8e')]['Applications'];}if(_0x38629c[_0x9727('0x8e')][_0x9727('0x84')]&&_0x38629c['account'][_0x9727('0x84')]['Contacts']['length']){return _0x38629c[_0x9727('0x8e')]['List'][_0x9727('0x85')][0x0];}var _0x1baaf1=_[_0x9727('0x1b')](_0x3cf58c[_0x9727('0x5f')],{'firstName':_0x3cf58c['body'][_0x9727('0x7f')],'ListId':_0x235ff9[_0x9727('0x7d')]});_0x1baaf1[_0x3cf58c[_0x9727('0x5f')][_0x9727('0x81')]]=_0x3cf58c['body'][_0x9727('0x7f')];return db[_0x9727('0x76')][_0x9727('0x5e')](_0x1baaf1,{'fields':_0x929929,'raw':!![]});}})[_0x9727('0x38')](handleEntityNotFound(_0xf1455,null))[_0x9727('0x38')](function(_0x3c0162){_0x38629c[_0x9727('0x8f')]=_0x3c0162;if(_0x3c0162){var _0x4e4154={'ContactId':_0x3c0162['id'],'OpenchannelAccountId':_0x3cf58c[_0x9727('0x59')]['id'],'from':(_0x3c0162['firstName']||'')+'\x20'+(_0x3c0162[_0x9727('0x90')]||'')};var _0xe3f546={'OpenchannelAccountId':_0x3cf58c['params']['id'],'closed':![]};if(_0x3cf58c[_0x9727('0x5f')][_0x9727('0x91')]){_0xe3f546[_0x9727('0x91')]=_0x3cf58c[_0x9727('0x5f')]['threadId'];return db[_0x9727('0x92')]['find']({'where':_0xe3f546})[_0x9727('0x38')](function(_0x15ff15){if(_0x15ff15){return[_0x15ff15,![]];}_0x4e4154['threadId']=_0x3cf58c[_0x9727('0x5f')][_0x9727('0x91')];_0x4e4154[_0x9727('0x93')]=_0x3cf58c[_0x9727('0x5f')]['externalUrl'];return db['OpenchannelInteraction'][_0x9727('0x5e')](_0x4e4154)[_0x9727('0x38')](function(_0x435d17){return[_0x435d17,!![]];});});}else{_0xe3f546['threadId']=null;}_0xe3f546[_0x9727('0x94')]=_0x3c0162['id'];return db[_0x9727('0x92')]['find']({'where':_0xe3f546})['then'](function(_0x3a5471){if(_0x3a5471){return[_0x3a5471,![]];}return db[_0x9727('0x92')][_0x9727('0x5e')](_0x4e4154)[_0x9727('0x38')](function(_0x44349c){return[_0x44349c,!![]];});});}})[_0x9727('0x95')](function(_0x1431cf,_0x25f9b3){if(_0x1431cf){_0x47ccda=_0x25f9b3;if(!_0x25f9b3){var _0xa1acd1={'from':(_0x38629c['contact']['firstName']||'')+'\x20'+(_0x38629c['contact'][_0x9727('0x90')]||'')};if(_0x3cf58c[_0x9727('0x5f')][_0x9727('0x91')]&&_0x3cf58c['body'][_0x9727('0x96')]&&_0x3cf58c[_0x9727('0x5f')]['threadId']!=_0x3cf58c['body']['messageId']){_0xa1acd1[_0x9727('0x91')]=_0x3cf58c['body'][_0x9727('0x96')];}return _0x1431cf['update'](_0xa1acd1);}else{return _0x1431cf;}}})['then'](function(_0x21705c){_0x38629c['interaction']=_0x21705c['get']({'plain':!![]});_0x38629c[_0x9727('0x97')][_0x9727('0x98')]=_0x47ccda;if(_0x38629c['interaction'][_0x9727('0x98')]){if(_0x38629c[_0x9727('0x8e')]['autoclose']){_0x38629c['applications']['push']({'id':0x0,'priority':_0x38629c[_0x9727('0x89')][_0x9727('0x4b')]+0x1,'app':_0x9727('0x99'),'appdata':'unmanaged','interval':_0x9727('0x9a')});}}return db[_0x9727('0x9b')][_0x9727('0x5e')]({'body':_0x3cf58c['body'][_0x9727('0x5f')],'OpenchannelAccountId':_0x3cf58c[_0x9727('0x59')]['id'],'OpenchannelInteractionId':_0x21705c['id'],'direction':'in','ContactId':_0x38629c[_0x9727('0x8f')]['id'],'AttachmentId':_0x3cf58c[_0x9727('0x5f')][_0x9727('0x9c')]});})[_0x9727('0x38')](function(_0x5cd4e7){_0x38629c['message']=_0x5cd4e7;if(_0x38629c[_0x9727('0x97')][_0x9727('0x9d')]){return db[_0x9727('0x9e')][_0x9727('0x5d')]({'attributes':['id',_0x9727('0x3c')],'where':{'id':_0x38629c[_0x9727('0x97')][_0x9727('0x9d')]}})['then'](function(_0x1d149a){if(_0x1d149a){_0x38629c[_0x9727('0x89')]['unshift']({'id':0x0,'priority':0x0,'app':_0x9727('0x9f'),'appdata':_0x1d149a[_0x9727('0x3c')]+','+(_0x38629c[_0x9727('0x8e')][_0x9727('0xa0')]||0xa),'interval':_0x9727('0x9a')});_0x38629c[_0x9727('0xa1')]=![];}return respondWithRpcPromise('Start',_0x9727('0xa2'),_0x38629c);});}return respondWithRpcPromise('Start','startRouting',_0x38629c);})[_0x9727('0x38')](function(_0x73e07f){respondWithRpcPromise('EventManager',_0x9727('0xa3'),{'event':_0x9727('0x74'),'message':_0x73e07f},client9002);return _0x73e07f;})['then'](respondWithResult(_0xf1455,null))['catch'](handleError(_0xf1455,null));};exports[_0x9727('0xa4')]=function(_0x4d23c1,_0x1a77dc){var _0x5cc92f=_0x4d23c1[_0x9727('0x59')]['id'];var _0x26fd55=_0x4d23c1[_0x9727('0x5f')];var _0x293590=0xc8;var _0x1a10c4=null;return db['sequelize'][_0x9727('0xa5')]({'isolationLevel':db[_0x9727('0xa6')][_0x9727('0xa7')]['ISOLATION_LEVELS'][_0x9727('0xa8')]},function(_0x598614){return db[_0x9727('0x41')][_0x9727('0x6d')]({'where':{'id':_0x5cc92f},'transaction':_0x598614})[_0x9727('0x38')](function(_0x1b127c){if(_0x1b127c){return db[_0x9727('0x87')][_0x9727('0x39')]({'where':{'OpenchannelAccountId':_0x5cc92f},'transaction':_0x598614})[_0x9727('0x38')](function(){var _0x3c4b9e=_[_0x9727('0x40')](_0x26fd55,function(_0x33b8cf){_0x33b8cf['OpenchannelAccountId']=_0x5cc92f;return _0x33b8cf;});return db[_0x9727('0x87')][_0x9727('0xa9')](_0x3c4b9e,{'transaction':_0x598614});});}else{_0x293590=0x194;_0x1a10c4=[];}});})['then'](function(){if(_0x293590!==0x194){return db[_0x9727('0x87')][_0x9727('0xaa')]({'where':{'OpenchannelAccountId':_0x5cc92f},'order':_0x9727('0x8c')})[_0x9727('0x38')](function(_0x2c8b50){_0x1a10c4=_0x2c8b50;});}})['catch'](function(_0xf1d97b){_0x293590=0x1f4;logger[_0x9727('0x26')](_0xf1d97b['stack']);if(_0xf1d97b[_0x9727('0x3c')]){delete _0xf1d97b[_0x9727('0x3c')];}_0x1a10c4=_0xf1d97b;})[_0x9727('0xab')](function(){if(_0x1a10c4===null){_0x1a77dc['sendStatus'](_0x293590);}else{if(_0x293590===0x1f4){_0x1a77dc[_0x9727('0x2d')](_0x293590)[_0x9727('0x3d')](_0x1a10c4);}else{_0x1a77dc[_0x9727('0x2d')](_0x293590)[_0x9727('0x2f')](_0x1a10c4);}}});};exports[_0x9727('0xac')]=function(_0x1f8709,_0x3766a3,_0x277209){var _0x897f2a={};var _0x4fafac={};var _0x177371;var _0x1642b4;return db['OpenchannelAccount']['findOne']({'where':{'id':_0x1f8709[_0x9727('0x59')]['id']}})['then'](handleEntityNotFound(_0x3766a3,null))[_0x9727('0x38')](function(_0x25ac8b){if(_0x25ac8b){_0x177371=_0x25ac8b;_0x4fafac[_0x9727('0x45')]=_['keys'](db[_0x9727('0x87')][_0x9727('0x42')]);_0x4fafac[_0x9727('0x46')]=_[_0x9727('0x5b')](_0x1f8709[_0x9727('0x46')]);_0x4fafac[_0x9727('0x47')]=_[_0x9727('0x48')](_0x4fafac[_0x9727('0x45')],_0x4fafac['query']);_0x897f2a[_0x9727('0x49')]=_[_0x9727('0x48')](_0x4fafac['model'],qs[_0x9727('0x4a')](_0x1f8709[_0x9727('0x46')][_0x9727('0x4a')]));_0x897f2a['attributes']=_0x897f2a[_0x9727('0x49')][_0x9727('0x4b')]?_0x897f2a[_0x9727('0x49')]:_0x4fafac['model'];_0x897f2a[_0x9727('0x4e')]=qs['sort'](_0x1f8709[_0x9727('0x46')][_0x9727('0x4f')]);_0x897f2a[_0x9727('0x50')]=qs[_0x9727('0x47')](_[_0x9727('0x51')](_0x1f8709[_0x9727('0x46')],_0x4fafac[_0x9727('0x47')]));if(_0x1f8709[_0x9727('0x46')]['filter']){_0x897f2a[_0x9727('0x50')]=_[_0x9727('0x5c')](_0x897f2a[_0x9727('0x50')],{'$or':_[_0x9727('0x40')](_0x897f2a[_0x9727('0x49')],function(_0x24d8a3){var _0x194e67={};_0x194e67[_0x24d8a3]={'$like':'%'+_0x1f8709[_0x9727('0x46')][_0x9727('0x52')]+'%'};return _0x194e67;})});}_0x897f2a=_[_0x9727('0x5c')]({},_0x897f2a,_0x1f8709[_0x9727('0x53')]);return _0x177371[_0x9727('0xac')](_0x897f2a);}})[_0x9727('0x38')](function(_0x43cff8){if(_0x43cff8){_0x1642b4=_0x43cff8[_0x9727('0x4b')];if(!_0x1f8709[_0x9727('0x46')]['hasOwnProperty']('nolimit')){_0x897f2a[_0x9727('0x31')]=qs[_0x9727('0x31')](_0x1f8709[_0x9727('0x46')][_0x9727('0x31')]);_0x897f2a['offset']=qs[_0x9727('0x33')](_0x1f8709[_0x9727('0x46')][_0x9727('0x33')]);}return _0x177371[_0x9727('0xac')](_0x897f2a);}})[_0x9727('0x38')](function(_0x2071cd){if(_0x2071cd){return _0x2071cd?{'count':_0x1642b4,'rows':_0x2071cd}:null;}})[_0x9727('0x38')](respondWithResult(_0x3766a3,null))[_0x9727('0x2b')](handleError(_0x3766a3,null));};exports[_0x9727('0xad')]=function(_0x483b93,_0x2baabd,_0x11ebcc){var _0x4463fe={'raw':![],'where':{}};var _0x1d8428={};var _0x1abb14={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x9727('0x6d')]({'where':{'id':_0x483b93[_0x9727('0x59')]['id']}})[_0x9727('0x38')](handleEntityNotFound(_0x2baabd,null))[_0x9727('0x38')](function(_0x557f73){if(_0x557f73){_0x1d8428[_0x9727('0x45')]=_[_0x9727('0x5b')](db[_0x9727('0x92')]['rawAttributes']);_0x1d8428[_0x9727('0x46')]=_[_0x9727('0x5b')](_0x483b93[_0x9727('0x46')]);_0x1d8428[_0x9727('0x47')]=_['intersection'](_0x1d8428[_0x9727('0x45')],_0x1d8428['query']);_0x4463fe[_0x9727('0x49')]=_[_0x9727('0x48')](_0x1d8428[_0x9727('0x45')],qs[_0x9727('0x4a')](_0x483b93[_0x9727('0x46')][_0x9727('0x4a')]));_0x4463fe['attributes']=_0x4463fe['attributes']['length']?_0x4463fe[_0x9727('0x49')]:_0x1d8428['model'];if(!_0x483b93[_0x9727('0x46')][_0x9727('0x4c')](_0x9727('0x4d'))){_0x4463fe['limit']=qs[_0x9727('0x31')](_0x483b93[_0x9727('0x46')][_0x9727('0x31')]);_0x4463fe['offset']=qs[_0x9727('0x33')](_0x483b93[_0x9727('0x46')][_0x9727('0x33')]);}_0x4463fe[_0x9727('0x4e')]=qs[_0x9727('0x4f')](_0x483b93['query']['sort']);_0x4463fe[_0x9727('0x50')]=qs[_0x9727('0x47')](_[_0x9727('0x51')](_0x483b93[_0x9727('0x46')],_0x1d8428[_0x9727('0x47')]));_0x4463fe[_0x9727('0x50')][_0x9727('0x6a')]=_0x557f73['id'];if(_0x483b93['query'][_0x9727('0x52')]){_0x4463fe[_0x9727('0x50')]=_[_0x9727('0x5c')](_0x4463fe[_0x9727('0x50')],{'$or':_[_0x9727('0x40')](_0x4463fe['attributes'],function(_0x3e99f5){var _0x165e70={};_0x165e70[_0x3e99f5]={'$like':'%'+_0x483b93[_0x9727('0x46')][_0x9727('0x52')]+'%'};return _0x165e70;})});}_0x4463fe=_[_0x9727('0x5c')]({},_0x4463fe,_0x483b93[_0x9727('0x53')]);return db[_0x9727('0x92')][_0x9727('0x32')]({'where':_0x4463fe['where']})['then'](function(_0xb743fd){_0x1abb14[_0x9727('0x32')]=_0xb743fd;if(_0x483b93[_0x9727('0x46')][_0x9727('0x54')]){_0x4463fe[_0x9727('0x55')]=[{'model':db[_0x9727('0x76')],'as':_0x9727('0xae'),'required':![]},{'model':db[_0x9727('0x9e')],'as':_0x9727('0xaf'),'attributes':[_0x9727('0x3c'),'fullname',_0x9727('0xb0')],'required':![]},{'model':db[_0x9727('0xb1')],'as':_0x9727('0xb2'),'attributes':['id',_0x9727('0x3c'),_0x9727('0xb3')],'where':_0x483b93[_0x9727('0x46')]['tag']?{'id':_0x483b93['query'][_0x9727('0xb4')]}:undefined,'required':_0x483b93[_0x9727('0x46')]['tag']?!![]:![]}];}return db[_0x9727('0x92')]['findAll'](_0x4463fe);})[_0x9727('0x38')](function(_0x36d45a){_0x1abb14[_0x9727('0x57')]=_0x36d45a;return _0x1abb14;});}})[_0x9727('0x38')](respondWithFilteredResult(_0x2baabd,_0x4463fe))[_0x9727('0x2b')](handleError(_0x2baabd,null));};exports[_0x9727('0xb5')]=function(_0x1e3476,_0x32f763,_0xee9a29){return db['OpenchannelAccount']['find']({'where':{'id':_0x1e3476[_0x9727('0x59')]['id']}})[_0x9727('0x38')](handleEntityNotFound(_0x32f763,null))['then'](function(_0x37ab4d){if(_0x37ab4d){return _0x37ab4d[_0x9727('0xb5')](_0x1e3476[_0x9727('0x5f')][_0x9727('0x6f')],_[_0x9727('0xb6')](_0x1e3476[_0x9727('0x5f')],[_0x9727('0x6f'),'id'])||{})['spread'](function(_0x477c5b){for(var _0x35297f=0x0;_0x35297f<_0x1e3476[_0x9727('0x5f')][_0x9727('0x6f')][_0x9727('0x4b')];_0x35297f+=0x1){socket[_0x9727('0xb7')](_0x9727('0xb8'),{'UserId':Number(_0x1e3476[_0x9727('0x5f')][_0x9727('0x6f')][_0x35297f]),'OpenchannelAccountId':Number(_0x1e3476[_0x9727('0x59')]['id'])});}return _0x477c5b;});}})[_0x9727('0x38')](respondWithResult(_0x32f763,null))['catch'](handleError(_0x32f763,null));};exports[_0x9727('0xb9')]=function(_0x15a494,_0x2f41e7,_0x4055f5){return db['OpenchannelAccount'][_0x9727('0x5d')]({'where':{'id':_0x15a494[_0x9727('0x59')]['id']}})[_0x9727('0x38')](handleEntityNotFound(_0x2f41e7,null))[_0x9727('0x38')](function(_0x171133){if(_0x171133){return _0x171133[_0x9727('0xb9')](_0x15a494[_0x9727('0x46')][_0x9727('0x6f')])[_0x9727('0x38')](function(){if(_[_0x9727('0xba')](_0x15a494['query']['ids'])){for(var _0x56db18=0x0;_0x56db18<_0x15a494['query'][_0x9727('0x6f')][_0x9727('0x4b')];_0x56db18+=0x1){socket[_0x9727('0xb7')](_0x9727('0xbb'),{'UserId':Number(_0x15a494[_0x9727('0x46')][_0x9727('0x6f')][_0x56db18]),'OpenchannelAccountId':Number(_0x15a494[_0x9727('0x59')]['id'])});}}else{socket['emit']('userOpenchannelAccount:remove',{'UserId':Number(_0x15a494[_0x9727('0x46')][_0x9727('0x6f')]),'OpenchannelAccountId':Number(_0x15a494[_0x9727('0x59')]['id'])});}});}})['then'](respondWithStatusCode(_0x2f41e7,null))['catch'](handleError(_0x2f41e7,null));};exports[_0x9727('0xbc')]=function(_0x59e052,_0x19abce,_0x22bb65){var _0x9813b7={};var _0x4268a={};var _0x5e7af7;var _0x5392b5;return db[_0x9727('0x41')][_0x9727('0x6d')]({'where':{'id':_0x59e052[_0x9727('0x59')]['id']}})['then'](handleEntityNotFound(_0x19abce,null))['then'](function(_0xc73c73){if(_0xc73c73){_0x5e7af7=_0xc73c73;_0x4268a[_0x9727('0x45')]=_[_0x9727('0x5b')](db[_0x9727('0x9e')][_0x9727('0x42')]);_0x4268a[_0x9727('0x46')]=_[_0x9727('0x5b')](_0x59e052[_0x9727('0x46')]);_0x4268a[_0x9727('0x47')]=_[_0x9727('0x48')](_0x4268a['model'],_0x4268a[_0x9727('0x46')]);_0x9813b7[_0x9727('0x49')]=_[_0x9727('0x48')](_0x4268a[_0x9727('0x45')],qs[_0x9727('0x4a')](_0x59e052[_0x9727('0x46')][_0x9727('0x4a')]));_0x9813b7[_0x9727('0x49')]=_0x9813b7['attributes']['length']?_0x9813b7['attributes']:_0x4268a[_0x9727('0x45')];_0x9813b7['order']=qs['sort'](_0x59e052['query'][_0x9727('0x4f')]);_0x9813b7[_0x9727('0x50')]=qs[_0x9727('0x47')](_['pick'](_0x59e052[_0x9727('0x46')],_0x4268a['filters']));if(_0x59e052[_0x9727('0x46')]['filter']){_0x9813b7[_0x9727('0x50')]=_[_0x9727('0x5c')](_0x9813b7[_0x9727('0x50')],{'$or':_[_0x9727('0x40')](_0x9813b7[_0x9727('0x49')],function(_0xaa3928){var _0x2a35eb={};_0x2a35eb[_0xaa3928]={'$like':'%'+_0x59e052[_0x9727('0x46')]['filter']+'%'};return _0x2a35eb;})});}_0x9813b7=_[_0x9727('0x5c')]({},_0x9813b7,_0x59e052[_0x9727('0x53')]);return _0x5e7af7[_0x9727('0xbc')](_0x9813b7);}})[_0x9727('0x38')](function(_0x466dd7){if(_0x466dd7){_0x5392b5=_0x466dd7[_0x9727('0x4b')];if(!_0x59e052[_0x9727('0x46')][_0x9727('0x4c')](_0x9727('0x4d'))){_0x9813b7[_0x9727('0x31')]=qs['limit'](_0x59e052[_0x9727('0x46')]['limit']);_0x9813b7[_0x9727('0x33')]=qs[_0x9727('0x33')](_0x59e052[_0x9727('0x46')]['offset']);}return _0x5e7af7[_0x9727('0xbc')](_0x9813b7);}})['then'](function(_0x396f58){if(_0x396f58){return _0x396f58?{'count':_0x5392b5,'rows':_0x396f58}:null;}})[_0x9727('0x38')](respondWithResult(_0x19abce,null))[_0x9727('0x2b')](handleError(_0x19abce,null));};exports[_0x9727('0x3d')]=function(_0xe223c6,_0x5f1ad3,_0x92dac){var _0x1418db,_0x4c8ded,_0x50fbbe;if(_[_0x9727('0x7e')](_0xe223c6[_0x9727('0x5f')]['body'])||_0xe223c6[_0x9727('0x5f')][_0x9727('0x5f')]===''){throw new db[(_0x9727('0x77'))]['ValidationError'](_0x9727('0xbd'));}if(_[_0x9727('0x7e')](_0xe223c6[_0x9727('0x5f')]['to'])){}_0x1418db=_0xe223c6[_0x9727('0x5f')]['to'];return db[_0x9727('0x41')][_0x9727('0x6d')]({'where':{'id':_0xe223c6['params']['id']}})[_0x9727('0x38')](handleEntityNotFound(_0x5f1ad3,null))['then'](function(_0x2c49c1){if(_0x2c49c1){return db[_0x9727('0x41')][_0x9727('0x5d')]({'where':{'id':_0x2c49c1['id']},'include':[{'model':db[_0x9727('0xbe')],'as':'List','include':[{'model':db['CmContact'],'as':'Contacts','where':{[_0x2c49c1[_0x9727('0x81')]]:_0x1418db},'limit':0x1,'order':[[_0x9727('0x7c'),_0x9727('0x86')]]}]}]})[_0x9727('0x38')](handleEntityNotFound(_0x5f1ad3,null))[_0x9727('0x38')](function(_0x41ee7a){if(_0x41ee7a&&_0x41ee7a[_0x9727('0x84')]){_0x4c8ded=_0x41ee7a['get']({'plain':!![]});if(_0x4c8ded[_0x9727('0x84')]&&_0x4c8ded['List'][_0x9727('0x85')]['length']){return _0x4c8ded[_0x9727('0x84')][_0x9727('0x85')][0x0];}return db[_0x9727('0x76')][_0x9727('0x5e')](_[_0x9727('0x1b')](_0xe223c6['body'],{'firstName':_0x1418db,[_0x41ee7a[_0x9727('0x81')]]:_0x1418db,'phone':_0x1418db,'ListId':_0x4c8ded[_0x9727('0x7d')]}));}})[_0x9727('0x38')](handleEntityNotFound(_0x5f1ad3,null))[_0x9727('0x38')](function(_0x2d684d){if(_0x2d684d){_0x50fbbe=_0x2d684d;return db[_0x9727('0x92')][_0x9727('0x5d')]({'where':{'ContactId':_0x50fbbe['id'],'closed':![],'OpenchannelAccountId':_0x4c8ded['id']}})['then'](function(_0x48d277){if(_0x48d277){return[_0x48d277,![]];}return db['OpenchannelInteraction'][_0x9727('0x5e')]({'UserId':_0xe223c6[_0x9727('0x62')]['id'],'ContactId':_0x50fbbe['id'],'OpenchannelAccountId':_0x4c8ded['id'],'lastMsgDirection':'out','Messages':[_['merge'](_0xe223c6[_0x9727('0x5f')],{'read':![],'body':_0xe223c6['body'][_0x9727('0x5f')],'OpenchannelAccountId':_0x4c8ded['id'],'UserId':_0xe223c6[_0x9727('0x62')]['id'],'ContactId':_0x50fbbe['id']})]},{'include':[{'model':db['OpenchannelMessage'],'as':'Messages'}]})['then'](function(_0x4d1ff8){return[_0x4d1ff8,!![]];});});}})[_0x9727('0x95')](function(_0x25dc16,_0x4f56ba){if(_0x4f56ba){return _0x25dc16;}return db[_0x9727('0x9b')][_0x9727('0x5e')](_[_0x9727('0x5c')](_0xe223c6[_0x9727('0x5f')],{'read':![],'body':_0xe223c6[_0x9727('0x5f')][_0x9727('0x5f')],'OpenchannelAccountId':_0x4c8ded['id'],'OpenchannelInteractionId':_0x25dc16['id'],'UserId':_0xe223c6[_0x9727('0x62')]['id'],'ContactId':_0x50fbbe['id']}))[_0x9727('0x38')](function(_0x37b34a){_0x25dc16['dataValues'][_0x9727('0xbf')]=[];_0x25dc16['dataValues'][_0x9727('0xbf')][_0x9727('0xc0')](_0x37b34a[_0x9727('0xc1')]);return _0x25dc16;});});}})[_0x9727('0x38')](respondWithResult(_0x5f1ad3,null))[_0x9727('0x2b')](handleError(_0x5f1ad3,null));};
\ No newline at end of file
index 98224c7..12b59e1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelAccount','update','emit'];(function(_0x515afd,_0x1a1e91){var _0x536d53=function(_0x1d3a89){while(--_0x1d3a89){_0x515afd['push'](_0x515afd['shift']());}};_0x536d53(++_0x1a1e91);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0xa9e0[_0x5037ab];return _0x512adb;};'use strict';var EventEmitter=require(_0x0a9e('0x0'));var OpenchannelAccount=require(_0x0a9e('0x1'))['db'][_0x0a9e('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x0a9e('0x3'),'afterDestroy':'remove'};function emitEvent(_0x333808){return function(_0x432180,_0x2ab90b,_0x991246){OpenchannelAccountEvents[_0x0a9e('0x4')](_0x333808+':'+_0x432180['id'],_0x432180);OpenchannelAccountEvents['emit'](_0x333808,_0x432180);_0x991246(null);};}for(var e in events){if(events[_0x0a9e('0x5')](e)){var event=events[e];OpenchannelAccount[_0x0a9e('0x6')](e,emitEvent(event));}}module[_0x0a9e('0x7')]=OpenchannelAccountEvents;
\ No newline at end of file
+var _0x3c81=['hook','exports','events','../../mysqldb','setMaxListeners','save','emit','hasOwnProperty'];(function(_0x5756c6,_0x58290a){var _0x4b5806=function(_0x193246){while(--_0x193246){_0x5756c6['push'](_0x5756c6['shift']());}};_0x4b5806(++_0x58290a);}(_0x3c81,0x102));var _0x13c8=function(_0x13daef,_0x293062){_0x13daef=_0x13daef-0x0;var _0x2b55ad=_0x3c81[_0x13daef];return _0x2b55ad;};'use strict';var EventEmitter=require(_0x13c8('0x0'));var OpenchannelAccount=require(_0x13c8('0x1'))['db']['OpenchannelAccount'];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x13c8('0x2')](0x0);var events={'afterCreate':_0x13c8('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x5c3ba4){return function(_0x548599,_0x101d4f,_0x3ec886){OpenchannelAccountEvents[_0x13c8('0x4')](_0x5c3ba4+':'+_0x548599['id'],_0x548599);OpenchannelAccountEvents[_0x13c8('0x4')](_0x5c3ba4,_0x548599);_0x3ec886(null);};}for(var e in events){if(events[_0x13c8('0x5')](e)){var event=events[e];OpenchannelAccount[_0x13c8('0x6')](e,emitEvent(event));}}module[_0x13c8('0x7')]=OpenchannelAccountEvents;
\ No newline at end of file
index 01fbede..d898522 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(_0x449af0,_0x1402d4){var _0x309350=function(_0x117fbd){while(--_0x117fbd){_0x449af0['push'](_0x449af0['shift']());}};_0x309350(++_0x1402d4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xa9e0[_0x1ac595];return _0x455fff;};'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(_0x1e0604,_0x1f06ea){var _0x26bd68=function(_0x256806){while(--_0x256806){_0x1e0604['push'](_0x1e0604['shift']());}};_0x26bd68(++_0x1f06ea);}(_0xa9e0,0x123));var _0x0a9e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xa9e0[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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 e40fcc5..a172ac1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6f2f=['socket.io-emitter','./openchannelAccount.socket','register','request','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','ioredis','../../config/logger','rpc','../../config/environment','http','redis','defaults','localhost'];(function(_0xa457d7,_0x280103){var _0x588bb8=function(_0x230163){while(--_0x230163){_0xa457d7['push'](_0xa457d7['shift']());}};_0x588bb8(++_0x280103);}(_0x6f2f,0xbe));var _0xf6f2=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0x6f2f[_0x50a0c2];return _0x5ebadd;};'use strict';var _=require(_0xf6f2('0x0'));var util=require(_0xf6f2('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf6f2('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xf6f2('0x3'))(_0xf6f2('0x4'));var config=require(_0xf6f2('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0xf6f2('0x6')]({'port':0x232a});config[_0xf6f2('0x7')]=_[_0xf6f2('0x8')](config[_0xf6f2('0x7')],{'host':_0xf6f2('0x9'),'port':0x18eb});var socket=require(_0xf6f2('0xa'))(new Redis(config[_0xf6f2('0x7')]));require(_0xf6f2('0xb'))[_0xf6f2('0xc')](socket);function respondWithRpcPromise(_0x17ffd2,_0x55a260,_0x109271){return new BPromise(function(_0x266c6e,_0x2a4325){return client[_0xf6f2('0xd')](_0x17ffd2,_0x109271)['then'](function(_0x4ca76a){logger['info'](_0xf6f2('0xe'),_0x55a260,_0xf6f2('0xf'));logger[_0xf6f2('0x10')](_0xf6f2('0x11'),_0x55a260,_0xf6f2('0xf'),JSON[_0xf6f2('0x12')](_0x4ca76a));if(_0x4ca76a['error']){if(_0x4ca76a[_0xf6f2('0x13')][_0xf6f2('0x14')]===0x1f4){logger[_0xf6f2('0x13')](_0xf6f2('0xe'),_0x55a260,_0x4ca76a[_0xf6f2('0x13')]['message']);return _0x2a4325(_0x4ca76a[_0xf6f2('0x13')][_0xf6f2('0x15')]);}logger[_0xf6f2('0x13')](_0xf6f2('0xe'),_0x55a260,_0x4ca76a[_0xf6f2('0x13')][_0xf6f2('0x15')]);return _0x266c6e(_0x4ca76a[_0xf6f2('0x13')][_0xf6f2('0x15')]);}else{logger[_0xf6f2('0x16')](_0xf6f2('0xe'),_0x55a260,_0xf6f2('0xf'));_0x266c6e(_0x4ca76a[_0xf6f2('0x17')][_0xf6f2('0x15')]);}})[_0xf6f2('0x18')](function(_0xb05611){logger['error']('OpenchannelAccount,\x20%s,\x20%s',_0x55a260,_0xb05611);_0x2a4325(_0xb05611);});});}
\ No newline at end of file
+var _0x5c00=['code','message','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','./openchannelAccount.socket','register','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x5d4044,_0x48360d){var _0x5da77f=function(_0x4c75e6){while(--_0x4c75e6){_0x5d4044['push'](_0x5d4044['shift']());}};_0x5da77f(++_0x48360d);}(_0x5c00,0x17e));var _0x05c0=function(_0x1b925b,_0x1ab3c9){_0x1b925b=_0x1b925b-0x0;var _0x275f07=_0x5c00[_0x1b925b];return _0x275f07;};'use strict';var _=require(_0x05c0('0x0'));var util=require(_0x05c0('0x1'));var moment=require(_0x05c0('0x2'));var BPromise=require('bluebird');var rs=require(_0x05c0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x05c0('0x4'))['db'];var utils=require(_0x05c0('0x5'));var logger=require(_0x05c0('0x6'))(_0x05c0('0x7'));var config=require('../../config/environment');var jayson=require(_0x05c0('0x8'));var client=jayson[_0x05c0('0x9')][_0x05c0('0xa')]({'port':0x232a});config[_0x05c0('0xb')]=_['defaults'](config[_0x05c0('0xb')],{'host':_0x05c0('0xc'),'port':0x18eb});var socket=require(_0x05c0('0xd'))(new Redis(config['redis']));require(_0x05c0('0xe'))[_0x05c0('0xf')](socket);function respondWithRpcPromise(_0x996d6b,_0x321c09,_0x273b2d){return new BPromise(function(_0x1edbb,_0x5226c5){return client['request'](_0x996d6b,_0x273b2d)[_0x05c0('0x10')](function(_0x516a66){logger[_0x05c0('0x11')](_0x05c0('0x12'),_0x321c09,_0x05c0('0x13'));logger['debug'](_0x05c0('0x14'),_0x321c09,'request\x20sent',JSON[_0x05c0('0x15')](_0x516a66));if(_0x516a66[_0x05c0('0x16')]){if(_0x516a66[_0x05c0('0x16')][_0x05c0('0x17')]===0x1f4){logger[_0x05c0('0x16')](_0x05c0('0x12'),_0x321c09,_0x516a66[_0x05c0('0x16')][_0x05c0('0x18')]);return _0x5226c5(_0x516a66['error'][_0x05c0('0x18')]);}logger[_0x05c0('0x16')](_0x05c0('0x12'),_0x321c09,_0x516a66[_0x05c0('0x16')][_0x05c0('0x18')]);return _0x1edbb(_0x516a66[_0x05c0('0x16')][_0x05c0('0x18')]);}else{logger[_0x05c0('0x11')](_0x05c0('0x12'),_0x321c09,'request\x20sent');_0x1edbb(_0x516a66[_0x05c0('0x19')][_0x05c0('0x18')]);}})[_0x05c0('0x1a')](function(_0x54fef0){logger[_0x05c0('0x16')](_0x05c0('0x12'),_0x321c09,_0x54fef0);_0x5226c5(_0x54fef0);});});}
\ No newline at end of file
index cb064ef..4e37f22 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbca8=['openchannelAccount:','./openchannelAccount.events','save','remove','update','emit','register'];(function(_0x323c59,_0x2fa7f5){var _0x4b2831=function(_0x11c3b3){while(--_0x11c3b3){_0x323c59['push'](_0x323c59['shift']());}};_0x4b2831(++_0x2fa7f5);}(_0xbca8,0xcc));var _0x8bca=function(_0x58c862,_0x55652b){_0x58c862=_0x58c862-0x0;var _0x4a56ce=_0xbca8[_0x58c862];return _0x4a56ce;};'use strict';var OpenchannelAccountEvents=require(_0x8bca('0x0'));var events=[_0x8bca('0x1'),_0x8bca('0x2'),_0x8bca('0x3')];function createListener(_0x17db5b,_0x51da56){return function(_0x129f58){_0x51da56[_0x8bca('0x4')](_0x17db5b,_0x129f58);};}function removeListener(_0x34d392,_0x5cafc7){return function(){OpenchannelAccountEvents['removeListener'](_0x34d392,_0x5cafc7);};}exports[_0x8bca('0x5')]=function(_0x2ecf60){for(var _0x318474=0x0,_0x348ddd=events['length'];_0x318474<_0x348ddd;_0x318474++){var _0x3fdccf=events[_0x318474];var _0x38e241=createListener(_0x8bca('0x6')+_0x3fdccf,_0x2ecf60);OpenchannelAccountEvents['on'](_0x3fdccf,_0x38e241);}};
\ No newline at end of file
+var _0x894f=['./openchannelAccount.events','save','remove','update','emit','removeListener','register','length','openchannelAccount:'];(function(_0x50e7e0,_0x5affce){var _0x1a0307=function(_0x32d343){while(--_0x32d343){_0x50e7e0['push'](_0x50e7e0['shift']());}};_0x1a0307(++_0x5affce);}(_0x894f,0x14d));var _0xf894=function(_0x3a918b,_0x2ce2c2){_0x3a918b=_0x3a918b-0x0;var _0x43fb65=_0x894f[_0x3a918b];return _0x43fb65;};'use strict';var OpenchannelAccountEvents=require(_0xf894('0x0'));var events=[_0xf894('0x1'),_0xf894('0x2'),_0xf894('0x3')];function createListener(_0x4d2b83,_0x4e1a16){return function(_0x26f3da){_0x4e1a16[_0xf894('0x4')](_0x4d2b83,_0x26f3da);};}function removeListener(_0x4b6a61,_0x5e768a){return function(){OpenchannelAccountEvents[_0xf894('0x5')](_0x4b6a61,_0x5e768a);};}exports[_0xf894('0x6')]=function(_0x4e2af3){for(var _0x5814d3=0x0,_0x23a9fc=events[_0xf894('0x7')];_0x5814d3<_0x23a9fc;_0x5814d3++){var _0x56d9d6=events[_0x5814d3];var _0x190cb1=createListener(_0xf894('0x8')+_0x56d9d6,_0x4e2af3);OpenchannelAccountEvents['on'](_0x56d9d6,_0x190cb1);}};
\ No newline at end of file
index 691d1d7..8a7578a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb440=['delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../config/environment','isAuthenticated','get','/:id','show','create','put'];(function(_0x48c615,_0x4cc757){var _0x3d9e22=function(_0x1ee9f2){while(--_0x1ee9f2){_0x48c615['push'](_0x48c615['shift']());}};_0x3d9e22(++_0x4cc757);}(_0xb440,0x73));var _0x0b44=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb440[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x0b44('0x0'));var util=require(_0x0b44('0x1'));var path=require(_0x0b44('0x2'));var timeout=require('connect-timeout');var express=require(_0x0b44('0x3'));var router=express[_0x0b44('0x4')]();var fs_extra=require(_0x0b44('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x0b44('0x6'));var controller=require('./openchannelApplication.controller');router['get']('/',auth[_0x0b44('0x7')](),controller['index']);router[_0x0b44('0x8')](_0x0b44('0x9'),auth[_0x0b44('0x7')](),controller[_0x0b44('0xa')]);router['post']('/',auth[_0x0b44('0x7')](),controller[_0x0b44('0xb')]);router[_0x0b44('0xc')](_0x0b44('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x0b44('0xd')](_0x0b44('0x9'),auth['isAuthenticated'](),controller[_0x0b44('0xe')]);module[_0x0b44('0xf')]=router;
\ No newline at end of file
+var _0xdb8a=['update','delete','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','index','/:id','isAuthenticated','show','create','put'];(function(_0x29d915,_0x54a040){var _0x160f86=function(_0x237dfa){while(--_0x237dfa){_0x29d915['push'](_0x29d915['shift']());}};_0x160f86(++_0x54a040);}(_0xdb8a,0xe0));var _0xadb8=function(_0x3cf070,_0x4c430e){_0x3cf070=_0x3cf070-0x0;var _0x3d835c=_0xdb8a[_0x3cf070];return _0x3d835c;};'use strict';var multer=require(_0xadb8('0x0'));var util=require(_0xadb8('0x1'));var path=require(_0xadb8('0x2'));var timeout=require('connect-timeout');var express=require(_0xadb8('0x3'));var router=express['Router']();var fs_extra=require(_0xadb8('0x4'));var auth=require(_0xadb8('0x5'));var interaction=require(_0xadb8('0x6'));var config=require(_0xadb8('0x7'));var controller=require(_0xadb8('0x8'));router[_0xadb8('0x9')]('/',auth['isAuthenticated'](),controller[_0xadb8('0xa')]);router[_0xadb8('0x9')](_0xadb8('0xb'),auth[_0xadb8('0xc')](),controller[_0xadb8('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0xadb8('0xe')]);router[_0xadb8('0xf')](_0xadb8('0xb'),auth[_0xadb8('0xc')](),controller[_0xadb8('0x10')]);router[_0xadb8('0x11')]('/:id',auth[_0xadb8('0xc')](),controller[_0xadb8('0x12')]);module[_0xadb8('0x13')]=router;
\ No newline at end of file
index c4f9b91..aa2d02c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7162=['TEXT','*,*,*,*','STRING','noop'];(function(_0x5c762b,_0x43a550){var _0x598859=function(_0x1f80bd){while(--_0x1f80bd){_0x5c762b['push'](_0x5c762b['shift']());}};_0x598859(++_0x43a550);}(_0x7162,0x8a));var _0x2716=function(_0x1978e7,_0x1ead4a){_0x1978e7=_0x1978e7-0x0;var _0x42a536=_0x7162[_0x1978e7];return _0x42a536;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x2716('0x0')],'allowNull':![],'defaultValue':_0x2716('0x1')},'appdata':{'type':Sequelize[_0x2716('0x2')]()},'description':{'type':Sequelize[_0x2716('0x0')]},'interval':{'type':Sequelize[_0x2716('0x0')],'defaultValue':_0x2716('0x3')}};
\ No newline at end of file
+var _0xd48f=['STRING','noop','TEXT','exports','INTEGER'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xd48f,0x8a));var _0xfd48=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xd48f[_0x57b54c];return _0x59cc19;};'use strict';var Sequelize=require('sequelize');module[_0xfd48('0x0')]={'priority':{'type':Sequelize[_0xfd48('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xfd48('0x2')],'allowNull':![],'defaultValue':_0xfd48('0x3')},'appdata':{'type':Sequelize[_0xfd48('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xfd48('0x2')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
index acb7e58..e9020fa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc809=['sox','ejs','fs-extra','lodash','crypto','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','reject','save','then','error','stack','name','index','map','OpenchannelApplication','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','merge','VIRTUAL','include','show','params','rawAttributes','options','catch','body','find','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path'];(function(_0x56d39a,_0x179054){var _0x17f97e=function(_0x497dd0){while(--_0x497dd0){_0x56d39a['push'](_0x56d39a['shift']());}};_0x17f97e(++_0x179054);}(_0xc809,0x81));var _0x9c80=function(_0x5788af,_0x1ce926){_0x5788af=_0x5788af-0x0;var _0x4c1e00=_0xc809[_0x5788af];return _0x4c1e00;};'use strict';var emlformat=require(_0x9c80('0x0'));var rimraf=require(_0x9c80('0x1'));var zipdir=require(_0x9c80('0x2'));var jsonpatch=require(_0x9c80('0x3'));var rp=require('request-promise');var moment=require(_0x9c80('0x4'));var BPromise=require(_0x9c80('0x5'));var Mustache=require(_0x9c80('0x6'));var util=require(_0x9c80('0x7'));var path=require(_0x9c80('0x8'));var sox=require(_0x9c80('0x9'));var csv=require('to-csv');var ejs=require(_0x9c80('0xa'));var fs=require('fs');var fs_extra=require(_0x9c80('0xb'));var _=require(_0x9c80('0xc'));var squel=require('squel');var crypto=require(_0x9c80('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x9c80('0xe'));var querystring=require(_0x9c80('0xf'));var Papa=require(_0x9c80('0x10'));var Redis=require(_0x9c80('0x11'));var authService=require(_0x9c80('0x12'));var qs=require(_0x9c80('0x13'));var as=require(_0x9c80('0x14'));var hardwareService=require(_0x9c80('0x15'));var logger=require(_0x9c80('0x16'))(_0x9c80('0x17'));var utils=require(_0x9c80('0x18'));var config=require(_0x9c80('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x9c80('0x1a'))['db'];function respondWithStatusCode(_0x1d9a82,_0x128b88){_0x128b88=_0x128b88||0xcc;return function(_0xc27806){if(_0xc27806){return _0x1d9a82['sendStatus'](_0x128b88);}return _0x1d9a82[_0x9c80('0x1b')](_0x128b88)[_0x9c80('0x1c')]();};}function respondWithResult(_0x45e698,_0x19ce86){_0x19ce86=_0x19ce86||0xc8;return function(_0x1479e9){if(_0x1479e9){return _0x45e698[_0x9c80('0x1b')](_0x19ce86)[_0x9c80('0x1d')](_0x1479e9);}};}function respondWithFilteredResult(_0x1932d0,_0x171fdc){return function(_0x16a349){if(_0x16a349){var _0x1f7017=typeof _0x171fdc[_0x9c80('0x1e')]===_0x9c80('0x1f')&&typeof _0x171fdc[_0x9c80('0x20')]===_0x9c80('0x1f');var _0x25f3c9=_0x16a349[_0x9c80('0x21')];var _0x3a05d5=_0x1f7017?0x0:_0x171fdc[_0x9c80('0x1e')];var _0x1d8216=_0x1f7017?_0x16a349[_0x9c80('0x21')]:_0x171fdc[_0x9c80('0x1e')]+_0x171fdc[_0x9c80('0x20')];var _0x9bc4d6;if(_0x1d8216>=_0x25f3c9){_0x1d8216=_0x25f3c9;_0x9bc4d6=0xc8;}else{_0x9bc4d6=0xce;}_0x1932d0[_0x9c80('0x1b')](_0x9bc4d6);return _0x1932d0[_0x9c80('0x22')]('Content-Range',_0x3a05d5+'-'+_0x1d8216+'/'+_0x25f3c9)[_0x9c80('0x1d')](_0x16a349);}return null;};}function patchUpdates(_0x8fdf0a){return function(_0x4a9e40){try{jsonpatch[_0x9c80('0x23')](_0x4a9e40,_0x8fdf0a,!![]);}catch(_0xdae4d8){return BPromise[_0x9c80('0x24')](_0xdae4d8);}return _0x4a9e40[_0x9c80('0x25')]();};}function saveUpdates(_0x416f07,_0x3900c5){return function(_0x2ddd37){if(_0x2ddd37){return _0x2ddd37['update'](_0x416f07)[_0x9c80('0x26')](function(_0x517709){return _0x517709;});}return null;};}function removeEntity(_0x1d476c,_0x3bf955){return function(_0x263763){if(_0x263763){return _0x263763['destroy']()[_0x9c80('0x26')](function(){_0x1d476c['status'](0xcc)[_0x9c80('0x1c')]();});}};}function handleEntityNotFound(_0x31a56b,_0x10c00b){return function(_0x53a899){if(!_0x53a899){_0x31a56b['sendStatus'](0x194);}return _0x53a899;};}function handleError(_0x1d7953,_0x36f2d4){_0x36f2d4=_0x36f2d4||0x1f4;return function(_0x2b878a){logger[_0x9c80('0x27')](_0x2b878a[_0x9c80('0x28')]);if(_0x2b878a[_0x9c80('0x29')]){delete _0x2b878a[_0x9c80('0x29')];}_0x1d7953[_0x9c80('0x1b')](_0x36f2d4)['send'](_0x2b878a);};}exports[_0x9c80('0x2a')]=function(_0x1b553b,_0x32bebd){var _0x5e0428={},_0x96d3f4={},_0x484384={'count':0x0,'rows':[]};var _0x58de3e=_[_0x9c80('0x2b')](db[_0x9c80('0x2c')]['rawAttributes'],function(_0xd09d6f){return{'name':_0xd09d6f[_0x9c80('0x2d')],'type':_0xd09d6f[_0x9c80('0x2e')]['key']};});_0x96d3f4[_0x9c80('0x2f')]=_[_0x9c80('0x2b')](_0x58de3e,_0x9c80('0x29'));_0x96d3f4[_0x9c80('0x30')]=_[_0x9c80('0x31')](_0x1b553b[_0x9c80('0x30')]);_0x96d3f4[_0x9c80('0x32')]=_[_0x9c80('0x33')](_0x96d3f4[_0x9c80('0x2f')],_0x96d3f4[_0x9c80('0x30')]);_0x5e0428[_0x9c80('0x34')]=_[_0x9c80('0x33')](_0x96d3f4[_0x9c80('0x2f')],qs[_0x9c80('0x35')](_0x1b553b['query'][_0x9c80('0x35')]));_0x5e0428[_0x9c80('0x34')]=_0x5e0428[_0x9c80('0x34')][_0x9c80('0x36')]?_0x5e0428['attributes']:_0x96d3f4['model'];if(!_0x1b553b[_0x9c80('0x30')][_0x9c80('0x37')](_0x9c80('0x38'))){_0x5e0428['limit']=qs[_0x9c80('0x20')](_0x1b553b[_0x9c80('0x30')]['limit']);_0x5e0428[_0x9c80('0x1e')]=qs[_0x9c80('0x1e')](_0x1b553b['query'][_0x9c80('0x1e')]);}_0x5e0428['order']=qs[_0x9c80('0x39')](_0x1b553b[_0x9c80('0x30')][_0x9c80('0x39')]);_0x5e0428[_0x9c80('0x3a')]=qs[_0x9c80('0x32')](_['pick'](_0x1b553b[_0x9c80('0x30')],_0x96d3f4[_0x9c80('0x32')]),_0x58de3e);if(_0x1b553b[_0x9c80('0x30')]['filter']){_0x5e0428[_0x9c80('0x3a')]=_[_0x9c80('0x3b')](_0x5e0428[_0x9c80('0x3a')],{'$or':_[_0x9c80('0x2b')](_0x58de3e,function(_0x39b31a){if(_0x39b31a['type']!==_0x9c80('0x3c')){var _0x418925={};_0x418925[_0x39b31a[_0x9c80('0x29')]]={'$like':'%'+_0x1b553b['query']['filter']+'%'};return _0x418925;}})});}_0x5e0428=_[_0x9c80('0x3b')]({},_0x5e0428,_0x1b553b['options']);var _0x49a720={'where':_0x5e0428['where']};return db['OpenchannelApplication'][_0x9c80('0x21')](_0x49a720)[_0x9c80('0x26')](function(_0x1e05c9){_0x484384[_0x9c80('0x21')]=_0x1e05c9;if(_0x1b553b['query']['includeAll']){_0x5e0428[_0x9c80('0x3d')]=[{'all':!![]}];}return db[_0x9c80('0x2c')]['findAll'](_0x5e0428);})[_0x9c80('0x26')](function(_0x3c0a94){_0x484384['rows']=_0x3c0a94;return _0x484384;})[_0x9c80('0x26')](respondWithFilteredResult(_0x32bebd,_0x5e0428))['catch'](handleError(_0x32bebd,null));};exports[_0x9c80('0x3e')]=function(_0x35d167,_0x37afa3){var _0x497c3b={'raw':!![],'where':{'id':_0x35d167[_0x9c80('0x3f')]['id']}},_0x2b482c={};_0x2b482c[_0x9c80('0x2f')]=_['keys'](db[_0x9c80('0x2c')][_0x9c80('0x40')]);_0x2b482c[_0x9c80('0x30')]=_[_0x9c80('0x31')](_0x35d167[_0x9c80('0x30')]);_0x2b482c[_0x9c80('0x32')]=_[_0x9c80('0x33')](_0x2b482c[_0x9c80('0x2f')],_0x2b482c[_0x9c80('0x30')]);_0x497c3b[_0x9c80('0x34')]=_[_0x9c80('0x33')](_0x2b482c[_0x9c80('0x2f')],qs[_0x9c80('0x35')](_0x35d167[_0x9c80('0x30')][_0x9c80('0x35')]));_0x497c3b[_0x9c80('0x34')]=_0x497c3b[_0x9c80('0x34')][_0x9c80('0x36')]?_0x497c3b['attributes']:_0x2b482c['model'];if(_0x35d167[_0x9c80('0x30')]['includeAll']){_0x497c3b[_0x9c80('0x3d')]=[{'all':!![]}];}_0x497c3b=_[_0x9c80('0x3b')]({},_0x497c3b,_0x35d167[_0x9c80('0x41')]);return db['OpenchannelApplication']['find'](_0x497c3b)[_0x9c80('0x26')](handleEntityNotFound(_0x37afa3,null))[_0x9c80('0x26')](respondWithResult(_0x37afa3,null))[_0x9c80('0x42')](handleError(_0x37afa3,null));};exports['create']=function(_0x5ac95d,_0x290412){return db[_0x9c80('0x2c')]['create'](_0x5ac95d[_0x9c80('0x43')],{})['then'](respondWithResult(_0x290412,0xc9))[_0x9c80('0x42')](handleError(_0x290412,null));};exports['update']=function(_0x46c8d0,_0x2192a2){if(_0x46c8d0[_0x9c80('0x43')]['id']){delete _0x46c8d0[_0x9c80('0x43')]['id'];}return db[_0x9c80('0x2c')][_0x9c80('0x44')]({'where':{'id':_0x46c8d0[_0x9c80('0x3f')]['id']}})[_0x9c80('0x26')](handleEntityNotFound(_0x2192a2,null))[_0x9c80('0x26')](saveUpdates(_0x46c8d0[_0x9c80('0x43')],null))[_0x9c80('0x26')](respondWithResult(_0x2192a2,null))['catch'](handleError(_0x2192a2,null));};exports['destroy']=function(_0x48b99c,_0x4d37d9){return db[_0x9c80('0x2c')][_0x9c80('0x44')]({'where':{'id':_0x48b99c[_0x9c80('0x3f')]['id']}})[_0x9c80('0x26')](handleEntityNotFound(_0x4d37d9,null))[_0x9c80('0x26')](removeEntity(_0x4d37d9,null))[_0x9c80('0x42')](handleError(_0x4d37d9,null));};
\ No newline at end of file
+var _0x12e5=['create','body','params','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','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','end','error','stack','name','index','map','OpenchannelApplication','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','order','sort','filter','where','VIRTUAL','merge','options','includeAll','include','rows','show','find','catch'];(function(_0x2bc369,_0x452b0a){var _0x3bfbf9=function(_0x503a73){while(--_0x503a73){_0x2bc369['push'](_0x2bc369['shift']());}};_0x3bfbf9(++_0x452b0a);}(_0x12e5,0x1cb));var _0x512e=function(_0x4004bd,_0x5bb9ce){_0x4004bd=_0x4004bd-0x0;var _0x23291c=_0x12e5[_0x4004bd];return _0x23291c;};'use strict';var emlformat=require(_0x512e('0x0'));var rimraf=require(_0x512e('0x1'));var zipdir=require(_0x512e('0x2'));var jsonpatch=require(_0x512e('0x3'));var rp=require(_0x512e('0x4'));var moment=require(_0x512e('0x5'));var BPromise=require(_0x512e('0x6'));var Mustache=require(_0x512e('0x7'));var util=require('util');var path=require(_0x512e('0x8'));var sox=require(_0x512e('0x9'));var csv=require(_0x512e('0xa'));var ejs=require(_0x512e('0xb'));var fs=require('fs');var fs_extra=require(_0x512e('0xc'));var _=require(_0x512e('0xd'));var squel=require(_0x512e('0xe'));var crypto=require('crypto');var jsforce=require(_0x512e('0xf'));var deskjs=require(_0x512e('0x10'));var toCsv=require('to-csv');var querystring=require(_0x512e('0x11'));var Papa=require(_0x512e('0x12'));var Redis=require(_0x512e('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x512e('0x14'));var as=require(_0x512e('0x15'));var hardwareService=require(_0x512e('0x16'));var logger=require(_0x512e('0x17'))(_0x512e('0x18'));var utils=require(_0x512e('0x19'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x512e('0x1a'))['db'];function respondWithStatusCode(_0x5d9f38,_0x2f215a){_0x2f215a=_0x2f215a||0xcc;return function(_0x401d63){if(_0x401d63){return _0x5d9f38[_0x512e('0x1b')](_0x2f215a);}return _0x5d9f38['status'](_0x2f215a)['end']();};}function respondWithResult(_0x170d2c,_0x5be9de){_0x5be9de=_0x5be9de||0xc8;return function(_0x35971a){if(_0x35971a){return _0x170d2c[_0x512e('0x1c')](_0x5be9de)[_0x512e('0x1d')](_0x35971a);}};}function respondWithFilteredResult(_0x238685,_0x4007e9){return function(_0x565b5a){if(_0x565b5a){var _0x2af39b=typeof _0x4007e9[_0x512e('0x1e')]===_0x512e('0x1f')&&typeof _0x4007e9[_0x512e('0x20')]===_0x512e('0x1f');var _0x490924=_0x565b5a[_0x512e('0x21')];var _0x3c99a7=_0x2af39b?0x0:_0x4007e9[_0x512e('0x1e')];var _0x34bd9f=_0x2af39b?_0x565b5a[_0x512e('0x21')]:_0x4007e9[_0x512e('0x1e')]+_0x4007e9[_0x512e('0x20')];var _0x4dddd0;if(_0x34bd9f>=_0x490924){_0x34bd9f=_0x490924;_0x4dddd0=0xc8;}else{_0x4dddd0=0xce;}_0x238685[_0x512e('0x1c')](_0x4dddd0);return _0x238685[_0x512e('0x22')](_0x512e('0x23'),_0x3c99a7+'-'+_0x34bd9f+'/'+_0x490924)[_0x512e('0x1d')](_0x565b5a);}return null;};}function patchUpdates(_0x38df0e){return function(_0x318079){try{jsonpatch['apply'](_0x318079,_0x38df0e,!![]);}catch(_0x442808){return BPromise[_0x512e('0x24')](_0x442808);}return _0x318079[_0x512e('0x25')]();};}function saveUpdates(_0x3e21ff,_0x5dacea){return function(_0x33a47e){if(_0x33a47e){return _0x33a47e[_0x512e('0x26')](_0x3e21ff)[_0x512e('0x27')](function(_0x3f9bac){return _0x3f9bac;});}return null;};}function removeEntity(_0x3249c4,_0x47174f){return function(_0x34d56a){if(_0x34d56a){return _0x34d56a[_0x512e('0x28')]()[_0x512e('0x27')](function(){_0x3249c4[_0x512e('0x1c')](0xcc)[_0x512e('0x29')]();});}};}function handleEntityNotFound(_0xbedd71,_0x4aa511){return function(_0x12bf30){if(!_0x12bf30){_0xbedd71['sendStatus'](0x194);}return _0x12bf30;};}function handleError(_0x3997fe,_0x26ae85){_0x26ae85=_0x26ae85||0x1f4;return function(_0x7a63e9){logger[_0x512e('0x2a')](_0x7a63e9[_0x512e('0x2b')]);if(_0x7a63e9['name']){delete _0x7a63e9[_0x512e('0x2c')];}_0x3997fe[_0x512e('0x1c')](_0x26ae85)['send'](_0x7a63e9);};}exports[_0x512e('0x2d')]=function(_0x5a3ae6,_0x68bbf9){var _0x145a03={},_0x2f3752={},_0x1af970={'count':0x0,'rows':[]};var _0x1a421e=_[_0x512e('0x2e')](db[_0x512e('0x2f')][_0x512e('0x30')],function(_0x1671d1){return{'name':_0x1671d1[_0x512e('0x31')],'type':_0x1671d1[_0x512e('0x32')][_0x512e('0x33')]};});_0x2f3752[_0x512e('0x34')]=_[_0x512e('0x2e')](_0x1a421e,'name');_0x2f3752['query']=_[_0x512e('0x35')](_0x5a3ae6[_0x512e('0x36')]);_0x2f3752[_0x512e('0x37')]=_[_0x512e('0x38')](_0x2f3752['model'],_0x2f3752[_0x512e('0x36')]);_0x145a03['attributes']=_[_0x512e('0x38')](_0x2f3752['model'],qs['fields'](_0x5a3ae6[_0x512e('0x36')][_0x512e('0x39')]));_0x145a03[_0x512e('0x3a')]=_0x145a03[_0x512e('0x3a')][_0x512e('0x3b')]?_0x145a03['attributes']:_0x2f3752['model'];if(!_0x5a3ae6['query']['hasOwnProperty']('nolimit')){_0x145a03[_0x512e('0x20')]=qs['limit'](_0x5a3ae6[_0x512e('0x36')][_0x512e('0x20')]);_0x145a03[_0x512e('0x1e')]=qs[_0x512e('0x1e')](_0x5a3ae6[_0x512e('0x36')][_0x512e('0x1e')]);}_0x145a03[_0x512e('0x3c')]=qs[_0x512e('0x3d')](_0x5a3ae6[_0x512e('0x36')][_0x512e('0x3d')]);_0x145a03['where']=qs[_0x512e('0x37')](_['pick'](_0x5a3ae6['query'],_0x2f3752['filters']),_0x1a421e);if(_0x5a3ae6[_0x512e('0x36')][_0x512e('0x3e')]){_0x145a03['where']=_['merge'](_0x145a03[_0x512e('0x3f')],{'$or':_[_0x512e('0x2e')](_0x1a421e,function(_0x2f1ac6){if(_0x2f1ac6['type']!==_0x512e('0x40')){var _0x6d07cb={};_0x6d07cb[_0x2f1ac6['name']]={'$like':'%'+_0x5a3ae6['query'][_0x512e('0x3e')]+'%'};return _0x6d07cb;}})});}_0x145a03=_[_0x512e('0x41')]({},_0x145a03,_0x5a3ae6[_0x512e('0x42')]);var _0x578b12={'where':_0x145a03[_0x512e('0x3f')]};return db['OpenchannelApplication'][_0x512e('0x21')](_0x578b12)[_0x512e('0x27')](function(_0x5e3eed){_0x1af970['count']=_0x5e3eed;if(_0x5a3ae6['query'][_0x512e('0x43')]){_0x145a03[_0x512e('0x44')]=[{'all':!![]}];}return db[_0x512e('0x2f')]['findAll'](_0x145a03);})[_0x512e('0x27')](function(_0x235380){_0x1af970[_0x512e('0x45')]=_0x235380;return _0x1af970;})['then'](respondWithFilteredResult(_0x68bbf9,_0x145a03))['catch'](handleError(_0x68bbf9,null));};exports[_0x512e('0x46')]=function(_0x5ade8e,_0x2c8f07){var _0x3d7d1e={'raw':!![],'where':{'id':_0x5ade8e['params']['id']}},_0x29d16b={};_0x29d16b[_0x512e('0x34')]=_[_0x512e('0x35')](db['OpenchannelApplication'][_0x512e('0x30')]);_0x29d16b[_0x512e('0x36')]=_[_0x512e('0x35')](_0x5ade8e['query']);_0x29d16b['filters']=_[_0x512e('0x38')](_0x29d16b[_0x512e('0x34')],_0x29d16b['query']);_0x3d7d1e[_0x512e('0x3a')]=_[_0x512e('0x38')](_0x29d16b[_0x512e('0x34')],qs['fields'](_0x5ade8e[_0x512e('0x36')][_0x512e('0x39')]));_0x3d7d1e[_0x512e('0x3a')]=_0x3d7d1e[_0x512e('0x3a')][_0x512e('0x3b')]?_0x3d7d1e[_0x512e('0x3a')]:_0x29d16b['model'];if(_0x5ade8e[_0x512e('0x36')][_0x512e('0x43')]){_0x3d7d1e[_0x512e('0x44')]=[{'all':!![]}];}_0x3d7d1e=_['merge']({},_0x3d7d1e,_0x5ade8e[_0x512e('0x42')]);return db[_0x512e('0x2f')][_0x512e('0x47')](_0x3d7d1e)['then'](handleEntityNotFound(_0x2c8f07,null))[_0x512e('0x27')](respondWithResult(_0x2c8f07,null))[_0x512e('0x48')](handleError(_0x2c8f07,null));};exports['create']=function(_0x16e48f,_0x5093c6){return db[_0x512e('0x2f')][_0x512e('0x49')](_0x16e48f[_0x512e('0x4a')],{})['then'](respondWithResult(_0x5093c6,0xc9))['catch'](handleError(_0x5093c6,null));};exports[_0x512e('0x26')]=function(_0x2c249c,_0x1f8549){if(_0x2c249c[_0x512e('0x4a')]['id']){delete _0x2c249c[_0x512e('0x4a')]['id'];}return db[_0x512e('0x2f')][_0x512e('0x47')]({'where':{'id':_0x2c249c[_0x512e('0x4b')]['id']}})[_0x512e('0x27')](handleEntityNotFound(_0x1f8549,null))[_0x512e('0x27')](saveUpdates(_0x2c249c[_0x512e('0x4a')],null))[_0x512e('0x27')](respondWithResult(_0x1f8549,null))[_0x512e('0x48')](handleError(_0x1f8549,null));};exports[_0x512e('0x28')]=function(_0x343d47,_0x246d53){return db[_0x512e('0x2f')][_0x512e('0x47')]({'where':{'id':_0x343d47['params']['id']}})[_0x512e('0x27')](handleEntityNotFound(_0x246d53,null))[_0x512e('0x27')](removeEntity(_0x246d53,null))[_0x512e('0x48')](handleError(_0x246d53,null));};
\ No newline at end of file
index 2a1ec84..e9812a9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x92f1=['api','moment','bluebird','path','./openchannelApplication.attributes','define','OpenchannelApplication','openchannel_applications','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x56b76c,_0x1fc860){var _0x53a063=function(_0x45d453){while(--_0x45d453){_0x56b76c['push'](_0x56b76c['shift']());}};_0x53a063(++_0x1fc860);}(_0x92f1,0x75));var _0x192f=function(_0x541150,_0x125e91){_0x541150=_0x541150-0x0;var _0x72b148=_0x92f1[_0x541150];return _0x72b148;};'use strict';var _=require(_0x192f('0x0'));var util=require(_0x192f('0x1'));var logger=require(_0x192f('0x2'))(_0x192f('0x3'));var moment=require(_0x192f('0x4'));var BPromise=require(_0x192f('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x192f('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x192f('0x7'));module['exports']=function(_0x3311a7,_0x3474ae){return _0x3311a7[_0x192f('0x8')](_0x192f('0x9'),attributes,{'tableName':_0x192f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x192f('0xb')});};
\ No newline at end of file
+var _0xf364=['util','../../config/logger','api','bluebird','../../config/environment','./openchannelApplication.attributes','define','OpenchannelApplication','openchannel_applications','utf8mb4_unicode_ci'];(function(_0x126fd5,_0x4026a8){var _0x309889=function(_0x3a6186){while(--_0x3a6186){_0x126fd5['push'](_0x126fd5['shift']());}};_0x309889(++_0x4026a8);}(_0xf364,0xe6));var _0x4f36=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xf364[_0x6c993a];return _0x27f547;};'use strict';var _=require('lodash');var util=require(_0x4f36('0x0'));var logger=require(_0x4f36('0x1'))(_0x4f36('0x2'));var moment=require('moment');var BPromise=require(_0x4f36('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x4f36('0x4'));var attributes=require(_0x4f36('0x5'));module['exports']=function(_0x367c5a,_0x53f4ba){return _0x367c5a[_0x4f36('0x6')](_0x4f36('0x7'),attributes,{'tableName':_0x4f36('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x4f36('0x9')});};
\ No newline at end of file
index a224eac..d9c2e61 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x09af=['moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','UpdateOpenchannelApplication','OpenchannelApplication','update','body','options','raw','where','attributes','limit','debug','stringify','lodash'];(function(_0x299467,_0x315b8c){var _0x419220=function(_0x2f8765){while(--_0x2f8765){_0x299467['push'](_0x299467['shift']());}};_0x419220(++_0x315b8c);}(_0x09af,0x10d));var _0xf09a=function(_0x17cfb6,_0x207227){_0x17cfb6=_0x17cfb6-0x0;var _0x3d8db3=_0x09af[_0x17cfb6];return _0x3d8db3;};'use strict';var _=require(_0xf09a('0x0'));var util=require('util');var moment=require(_0xf09a('0x1'));var BPromise=require(_0xf09a('0x2'));var rs=require(_0xf09a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xf09a('0x4'));var logger=require('../../config/logger')(_0xf09a('0x5'));var config=require(_0xf09a('0x6'));var jayson=require(_0xf09a('0x7'));var client=jayson[_0xf09a('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x49d801,_0x2ebba2,_0x5a108b){return new BPromise(function(_0x34dea0,_0x3f9c0b){return client[_0xf09a('0x9')](_0x49d801,_0x5a108b)[_0xf09a('0xa')](function(_0x34bfc8){logger[_0xf09a('0xb')](_0xf09a('0xc'),_0x2ebba2,_0xf09a('0xd'));logger['debug']('OpenchannelApplication,\x20%s,\x20%s,\x20%s',_0x2ebba2,'request\x20sent',JSON['stringify'](_0x34bfc8));if(_0x34bfc8[_0xf09a('0xe')]){if(_0x34bfc8[_0xf09a('0xe')][_0xf09a('0xf')]===0x1f4){logger[_0xf09a('0xe')](_0xf09a('0xc'),_0x2ebba2,_0x34bfc8[_0xf09a('0xe')]['message']);return _0x3f9c0b(_0x34bfc8[_0xf09a('0xe')][_0xf09a('0x10')]);}logger['error'](_0xf09a('0xc'),_0x2ebba2,_0x34bfc8[_0xf09a('0xe')][_0xf09a('0x10')]);return _0x34dea0(_0x34bfc8[_0xf09a('0xe')]['message']);}else{logger[_0xf09a('0xb')](_0xf09a('0xc'),_0x2ebba2,_0xf09a('0xd'));_0x34dea0(_0x34bfc8[_0xf09a('0x11')][_0xf09a('0x10')]);}})[_0xf09a('0x12')](function(_0x304c20){logger['error'](_0xf09a('0xc'),_0x2ebba2,_0x304c20);_0x3f9c0b(_0x304c20);});});}exports[_0xf09a('0x13')]=function(_0x35d1ef){var _0x203692=this;return new Promise(function(_0x43b6b1,_0xca61b4){return db[_0xf09a('0x14')][_0xf09a('0x15')](_0x35d1ef[_0xf09a('0x16')],{'raw':_0x35d1ef[_0xf09a('0x17')]?_0x35d1ef[_0xf09a('0x17')][_0xf09a('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x35d1ef['options']?_0x35d1ef[_0xf09a('0x17')][_0xf09a('0x19')]||null:null,'attributes':_0x35d1ef[_0xf09a('0x17')]?_0x35d1ef[_0xf09a('0x17')][_0xf09a('0x1a')]||null:null,'limit':_0x35d1ef[_0xf09a('0x17')]?_0x35d1ef[_0xf09a('0x17')][_0xf09a('0x1b')]||null:null})[_0xf09a('0xa')](function(_0x4e1728){logger[_0xf09a('0xb')](_0xf09a('0x13'),_0x35d1ef);logger[_0xf09a('0x1c')](_0xf09a('0x13'),_0x35d1ef,JSON[_0xf09a('0x1d')](_0x4e1728));_0x43b6b1(_0x4e1728);})[_0xf09a('0x12')](function(_0x254ac4){logger['error'](_0xf09a('0x13'),_0x254ac4[_0xf09a('0x10')],_0x35d1ef);_0xca61b4(_0x203692['error'](0x1f4,_0x254ac4[_0xf09a('0x10')]));});});};
\ No newline at end of file
+var _0x3c4e=['OpenchannelApplication','update','body','options','where','attributes','limit','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','UpdateOpenchannelApplication'];(function(_0x23c879,_0x573f13){var _0x2dcfb4=function(_0x64947f){while(--_0x64947f){_0x23c879['push'](_0x23c879['shift']());}};_0x2dcfb4(++_0x573f13);}(_0x3c4e,0x7b));var _0xe3c4=function(_0x38c3f3,_0x544c71){_0x38c3f3=_0x38c3f3-0x0;var _0x285b99=_0x3c4e[_0x38c3f3];return _0x285b99;};'use strict';var _=require(_0xe3c4('0x0'));var util=require(_0xe3c4('0x1'));var moment=require(_0xe3c4('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe3c4('0x3'));var db=require(_0xe3c4('0x4'))['db'];var utils=require(_0xe3c4('0x5'));var logger=require(_0xe3c4('0x6'))('rpc');var config=require(_0xe3c4('0x7'));var jayson=require(_0xe3c4('0x8'));var client=jayson[_0xe3c4('0x9')][_0xe3c4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xe6a97b,_0x38c6ad,_0x3a71e7){return new BPromise(function(_0x2e004c,_0x26447c){return client['request'](_0xe6a97b,_0x3a71e7)['then'](function(_0x1ec883){logger[_0xe3c4('0xb')](_0xe3c4('0xc'),_0x38c6ad,_0xe3c4('0xd'));logger[_0xe3c4('0xe')](_0xe3c4('0xf'),_0x38c6ad,_0xe3c4('0xd'),JSON[_0xe3c4('0x10')](_0x1ec883));if(_0x1ec883[_0xe3c4('0x11')]){if(_0x1ec883[_0xe3c4('0x11')][_0xe3c4('0x12')]===0x1f4){logger[_0xe3c4('0x11')](_0xe3c4('0xc'),_0x38c6ad,_0x1ec883[_0xe3c4('0x11')][_0xe3c4('0x13')]);return _0x26447c(_0x1ec883[_0xe3c4('0x11')][_0xe3c4('0x13')]);}logger[_0xe3c4('0x11')](_0xe3c4('0xc'),_0x38c6ad,_0x1ec883[_0xe3c4('0x11')]['message']);return _0x2e004c(_0x1ec883[_0xe3c4('0x11')][_0xe3c4('0x13')]);}else{logger[_0xe3c4('0xb')](_0xe3c4('0xc'),_0x38c6ad,_0xe3c4('0xd'));_0x2e004c(_0x1ec883['result'][_0xe3c4('0x13')]);}})[_0xe3c4('0x14')](function(_0x2389a4){logger['error'](_0xe3c4('0xc'),_0x38c6ad,_0x2389a4);_0x26447c(_0x2389a4);});});}exports[_0xe3c4('0x15')]=function(_0x2688c6){var _0x456e3d=this;return new Promise(function(_0x91538d,_0x22442f){return db[_0xe3c4('0x16')][_0xe3c4('0x17')](_0x2688c6[_0xe3c4('0x18')],{'raw':_0x2688c6[_0xe3c4('0x19')]?_0x2688c6[_0xe3c4('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2688c6[_0xe3c4('0x19')]?_0x2688c6['options'][_0xe3c4('0x1a')]||null:null,'attributes':_0x2688c6['options']?_0x2688c6[_0xe3c4('0x19')][_0xe3c4('0x1b')]||null:null,'limit':_0x2688c6[_0xe3c4('0x19')]?_0x2688c6[_0xe3c4('0x19')][_0xe3c4('0x1c')]||null:null})['then'](function(_0x424f16){logger['info'](_0xe3c4('0x15'),_0x2688c6);logger[_0xe3c4('0xe')](_0xe3c4('0x15'),_0x2688c6,JSON['stringify'](_0x424f16));_0x91538d(_0x424f16);})['catch'](function(_0x1fcd51){logger['error'](_0xe3c4('0x15'),_0x1fcd51['message'],_0x2688c6);_0x22442f(_0x456e3d[_0xe3c4('0x11')](0x1f4,_0x1fcd51[_0xe3c4('0x13')]));});});};
\ No newline at end of file
index 72c07cc..4f8c344 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xee39=['openchannelinteraction:addtags','addTags','openchannelinteraction:update','openchannelinteraction:destroy','destroy','delete','removeTags','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/download','post','create','/:id/messages','/:id/tags','tracked','openchannel'];(function(_0x3d5c38,_0x346b1b){var _0x291fc2=function(_0x41883f){while(--_0x41883f){_0x3d5c38['push'](_0x3d5c38['shift']());}};_0x291fc2(++_0x346b1b);}(_0xee39,0xbb));var _0x9ee3=function(_0x4c62f3,_0x469cf0){_0x4c62f3=_0x4c62f3-0x0;var _0x42e94a=_0xee39[_0x4c62f3];return _0x42e94a;};'use strict';var multer=require(_0x9ee3('0x0'));var util=require('util');var path=require(_0x9ee3('0x1'));var timeout=require(_0x9ee3('0x2'));var express=require(_0x9ee3('0x3'));var router=express[_0x9ee3('0x4')]();var fs_extra=require(_0x9ee3('0x5'));var auth=require(_0x9ee3('0x6'));var interaction=require(_0x9ee3('0x7'));var config=require(_0x9ee3('0x8'));var controller=require(_0x9ee3('0x9'));router[_0x9ee3('0xa')]('/',auth[_0x9ee3('0xb')](),controller['index']);router['get'](_0x9ee3('0xc'),auth[_0x9ee3('0xb')](),controller[_0x9ee3('0xd')]);router[_0x9ee3('0xa')](_0x9ee3('0xe'),auth[_0x9ee3('0xb')](),controller[_0x9ee3('0xf')]);router[_0x9ee3('0xa')]('/:id/messages',auth[_0x9ee3('0xb')](),controller['getMessages']);router[_0x9ee3('0xa')](_0x9ee3('0x10'),auth[_0x9ee3('0xb')](),controller['download']);router[_0x9ee3('0x11')]('/',auth[_0x9ee3('0xb')](),controller[_0x9ee3('0x12')]);router[_0x9ee3('0x11')](_0x9ee3('0x13'),auth['isAuthenticated'](),controller['addMessage']);router[_0x9ee3('0x11')](_0x9ee3('0x14'),auth[_0x9ee3('0xb')](),interaction[_0x9ee3('0x15')](_0x9ee3('0x16'),_0x9ee3('0x17')),controller[_0x9ee3('0x18')]);router['put'](_0x9ee3('0xe'),auth[_0x9ee3('0xb')](),interaction[_0x9ee3('0x15')](_0x9ee3('0x16'),_0x9ee3('0x19')),controller['update']);router['delete'](_0x9ee3('0xe'),auth[_0x9ee3('0xb')](),interaction[_0x9ee3('0x15')]('openchannel',_0x9ee3('0x1a')),controller[_0x9ee3('0x1b')]);router[_0x9ee3('0x1c')](_0x9ee3('0x14'),auth[_0x9ee3('0xb')](),controller[_0x9ee3('0x1d')]);module['exports']=router;
\ No newline at end of file
+var _0xa059=['get','index','/describe','describe','show','/:id/messages','isAuthenticated','getMessages','/:id/download','download','create','post','addMessage','/:id/tags','tracked','openchannelinteraction:addtags','/:id','openchannel','update','delete','openchannelinteraction:destroy','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./openchannelInteraction.controller'];(function(_0xf4add4,_0x5b9cc1){var _0x1c42fb=function(_0x2674c1){while(--_0x2674c1){_0xf4add4['push'](_0xf4add4['shift']());}};_0x1c42fb(++_0x5b9cc1);}(_0xa059,0x14d));var _0x9a05=function(_0x5d0b1f,_0x280300){_0x5d0b1f=_0x5d0b1f-0x0;var _0x3f1eb2=_0xa059[_0x5d0b1f];return _0x3f1eb2;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9a05('0x0'));var timeout=require(_0x9a05('0x1'));var express=require(_0x9a05('0x2'));var router=express[_0x9a05('0x3')]();var fs_extra=require(_0x9a05('0x4'));var auth=require(_0x9a05('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x9a05('0x6'));var controller=require(_0x9a05('0x7'));router[_0x9a05('0x8')]('/',auth['isAuthenticated'](),controller[_0x9a05('0x9')]);router[_0x9a05('0x8')](_0x9a05('0xa'),auth['isAuthenticated'](),controller[_0x9a05('0xb')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x9a05('0xc')]);router[_0x9a05('0x8')](_0x9a05('0xd'),auth[_0x9a05('0xe')](),controller[_0x9a05('0xf')]);router[_0x9a05('0x8')](_0x9a05('0x10'),auth[_0x9a05('0xe')](),controller[_0x9a05('0x11')]);router['post']('/',auth[_0x9a05('0xe')](),controller[_0x9a05('0x12')]);router[_0x9a05('0x13')](_0x9a05('0xd'),auth[_0x9a05('0xe')](),controller[_0x9a05('0x14')]);router[_0x9a05('0x13')](_0x9a05('0x15'),auth['isAuthenticated'](),interaction[_0x9a05('0x16')]('openchannel',_0x9a05('0x17')),controller['addTags']);router['put'](_0x9a05('0x18'),auth[_0x9a05('0xe')](),interaction[_0x9a05('0x16')](_0x9a05('0x19'),'openchannelinteraction:update'),controller[_0x9a05('0x1a')]);router[_0x9a05('0x1b')](_0x9a05('0x18'),auth[_0x9a05('0xe')](),interaction['tracked'](_0x9a05('0x19'),_0x9a05('0x1c')),controller[_0x9a05('0x1d')]);router[_0x9a05('0x1b')](_0x9a05('0x15'),auth[_0x9a05('0xe')](),controller['removeTags']);module[_0x9a05('0x1e')]=router;
\ No newline at end of file
index aa4c8d9..8d3ff60 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6732=['DATE','STRING','ENUM','out','sequelize','exports','BOOLEAN'];(function(_0x1daaa9,_0x220393){var _0x1dd221=function(_0x492c61){while(--_0x492c61){_0x1daaa9['push'](_0x1daaa9['shift']());}};_0x1dd221(++_0x220393);}(_0x6732,0x66));var _0x2673=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6732[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x2673('0x0'));module[_0x2673('0x1')]={'closed':{'type':Sequelize[_0x2673('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x2673('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x2673('0x4')]},'thirdDisposition':{'type':Sequelize[_0x2673('0x4')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x2673('0x3')]},'threadId':{'type':Sequelize[_0x2673('0x4')]},'externalUrl':{'type':Sequelize['STRING']},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x2673('0x5')]('in',_0x2673('0x6')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x2673('0x4')]},'autoreplyExecuted':{'type':Sequelize[_0x2673('0x2')],'defaultValue':![]}};
\ No newline at end of file
+var _0xdfea=['exports','DATE','STRING','out','BOOLEAN','sequelize'];(function(_0x537f11,_0x8bb9c4){var _0x52a997=function(_0x658551){while(--_0x658551){_0x537f11['push'](_0x537f11['shift']());}};_0x52a997(++_0x8bb9c4);}(_0xdfea,0x1cd));var _0xadfe=function(_0x1451a0,_0x5a61d0){_0x1451a0=_0x1451a0-0x0;var _0x4ca2fc=_0xdfea[_0x1451a0];return _0x4ca2fc;};'use strict';var Sequelize=require(_0xadfe('0x0'));module[_0xadfe('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xadfe('0x2')]},'disposition':{'type':Sequelize[_0xadfe('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xadfe('0x3')]},'note':{'type':Sequelize[_0xadfe('0x3')]},'read1stAt':{'type':Sequelize[_0xadfe('0x2')]},'threadId':{'type':Sequelize[_0xadfe('0x3')]},'externalUrl':{'type':Sequelize['STRING']},'lastMsgAt':{'type':Sequelize[_0xadfe('0x2')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xadfe('0x4')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0xadfe('0x3')]},'autoreplyExecuted':{'type':Sequelize[_0xadfe('0x5')],'defaultValue':![]}};
\ No newline at end of file
index 0105058..d13d012 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x02b0=['openchannel_interactions','cm_contacts','openchannel_accounts','a.id\x20=\x20i.OpenchannelAccountId','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id','openchannel_interaction_has_tags','expr','parseSearch','search','sqlOperator','conditions','find','value','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','type','keys','some','OpenchannelAccountId','i.OpenchannelAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','having','tag','isArray','filter','replace','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','i.from\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','QueryTypes','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','contactName','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','agent','getOpenchannelAccounts','isEmpty','i.OpenchannelAccountId\x20IS\x20NULL','sequelize','toString','a.key','Account.key','Account.mandatoryDisposition','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.OpenchannelInteractionId\x20IN\x20?','groupBy','OpenchannelInteractionId','all','rows','show','params','include','merge','create','update','body','describe','addMessage','OpenchannelMessage','ids','getMessages','findOne','YYYY-MM-DD\x20HH:mm:ss','includeAll','findAll','setTags','omit','spread','emit','openchannelInteractionTags:save','removeTags','download','server','tmp','join','root','files','format','transcript-%d-%s.zip','CmContact','firstName','lastName','attachments','Attachment','Messages','direction','secret','Account','Owner','get','mkdirSync','Openchannel','N.A.','closedAt','disposition','Private','basename','out','System','renderFile','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','unlinkSync','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','register','sendStatus','end','json','offset','undefined','count','status','set','Content-Range','reject','save','destroy','then','error','stack','name','send','Users','map','fullname','TagIds','split','forEach','Tags','push','catch','waiting','talking','answered','unmanaged','closed','UserId','total','index','OpenchannelInteraction','rawAttributes','fieldName','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','where','pick','select','field','from','tools_tags','u.fullname','user_has_openchannel_interactions','left_join','users','u.id\x20=\x20ui.UserId'];(function(_0xd0ec9c,_0x5eca72){var _0x2086cb=function(_0x42f557){while(--_0x42f557){_0xd0ec9c['push'](_0xd0ec9c['shift']());}};_0x2086cb(++_0x5eca72);}(_0x02b0,0x182));var _0x002b=function(_0x1ce2aa,_0x373e09){_0x1ce2aa=_0x1ce2aa-0x0;var _0x375643=_0x02b0[_0x1ce2aa];return _0x375643;};'use strict';var emlformat=require(_0x002b('0x0'));var rimraf=require(_0x002b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x002b('0x2'));var rp=require(_0x002b('0x3'));var moment=require(_0x002b('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x002b('0x5'));var util=require('util');var path=require(_0x002b('0x6'));var sox=require(_0x002b('0x7'));var csv=require(_0x002b('0x8'));var ejs=require(_0x002b('0x9'));var fs=require('fs');var fs_extra=require(_0x002b('0xa'));var _=require(_0x002b('0xb'));var squel=require(_0x002b('0xc'));var crypto=require(_0x002b('0xd'));var jsforce=require(_0x002b('0xe'));var deskjs=require(_0x002b('0xf'));var toCsv=require(_0x002b('0x8'));var querystring=require(_0x002b('0x10'));var Papa=require(_0x002b('0x11'));var Redis=require(_0x002b('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x002b('0x13'));var as=require(_0x002b('0x14'));var pdf=require(_0x002b('0x15'));var hardwareService=require(_0x002b('0x16'));var logger=require(_0x002b('0x17'))(_0x002b('0x18'));var utils=require('../../config/utils');var config=require(_0x002b('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x002b('0x1a')]=_[_0x002b('0x1b')](config['redis'],{'host':_0x002b('0x1c'),'port':0x18eb});var socket=require(_0x002b('0x1d'))(new Redis(config[_0x002b('0x1a')]));require('./openchannelInteraction.socket')[_0x002b('0x1e')](socket);function respondWithStatusCode(_0x36ca77,_0x4feb58){_0x4feb58=_0x4feb58||0xcc;return function(_0x3a9944){if(_0x3a9944){return _0x36ca77[_0x002b('0x1f')](_0x4feb58);}return _0x36ca77['status'](_0x4feb58)[_0x002b('0x20')]();};}function respondWithResult(_0x41a3eb,_0xbff43e){_0xbff43e=_0xbff43e||0xc8;return function(_0x285369){if(_0x285369){return _0x41a3eb['status'](_0xbff43e)[_0x002b('0x21')](_0x285369);}};}function respondWithFilteredResult(_0x324032,_0x169729){return function(_0x22b3bd){if(_0x22b3bd){var _0x3965dc=typeof _0x169729[_0x002b('0x22')]===_0x002b('0x23')&&typeof _0x169729['limit']===_0x002b('0x23');var _0x47f085=_0x22b3bd[_0x002b('0x24')];var _0x312456=_0x3965dc?0x0:_0x169729[_0x002b('0x22')];var _0x366abc=_0x3965dc?_0x22b3bd[_0x002b('0x24')]:_0x169729['offset']+_0x169729['limit'];var _0x307119;if(_0x366abc>=_0x47f085){_0x366abc=_0x47f085;_0x307119=0xc8;}else{_0x307119=0xce;}_0x324032[_0x002b('0x25')](_0x307119);return _0x324032[_0x002b('0x26')](_0x002b('0x27'),_0x312456+'-'+_0x366abc+'/'+_0x47f085)[_0x002b('0x21')](_0x22b3bd);}return null;};}function patchUpdates(_0x117cb6){return function(_0x3d646a){try{jsonpatch['apply'](_0x3d646a,_0x117cb6,!![]);}catch(_0xc9641b){return BPromise[_0x002b('0x28')](_0xc9641b);}return _0x3d646a[_0x002b('0x29')]();};}function saveUpdates(_0x5bad1f,_0x7aa48b){return function(_0x515089){if(_0x515089){return _0x515089['update'](_0x5bad1f)['then'](function(_0x3f4321){return _0x3f4321;});}return null;};}function removeEntity(_0x4259f8,_0x2f887f){return function(_0x4b6f82){if(_0x4b6f82){return _0x4b6f82[_0x002b('0x2a')]()[_0x002b('0x2b')](function(){_0x4259f8[_0x002b('0x25')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3633f5,_0x4cb065){return function(_0x4b4111){if(!_0x4b4111){_0x3633f5[_0x002b('0x1f')](0x194);}return _0x4b4111;};}function handleError(_0xaf87dd,_0x498c8b){_0x498c8b=_0x498c8b||0x1f4;return function(_0x525360){logger[_0x002b('0x2c')](_0x525360[_0x002b('0x2d')]);if(_0x525360[_0x002b('0x2e')]){delete _0x525360[_0x002b('0x2e')];}_0xaf87dd[_0x002b('0x25')](_0x498c8b)[_0x002b('0x2f')](_0x525360);};}function getInteractionUsers(_0x78f860,_0x3f8d65){return new BPromise(function(_0x2e1662,_0x557bbe){try{if(_0x3f8d65[_0x78f860['id']]){_0x78f860[_0x002b('0x30')]=_[_0x002b('0x31')](_0x3f8d65[_0x78f860['id']],function(_0xe72b45){return{'id':_0xe72b45['id'],'fullname':_0xe72b45[_0x002b('0x32')]};});}}catch(_0x15527){_0x557bbe(_0x15527);}_0x2e1662(_0x78f860);});}function getInteractionTags(_0x3dcfd9,_0x4229dc){return new BPromise(function(_0x989e43,_0x5796bb){try{if(_0x3dcfd9[_0x002b('0x33')]){_0x3dcfd9['Tags']=[];_0x3dcfd9['TagIds'][_0x002b('0x34')](',')[_0x002b('0x35')](function(_0x434f4a){_0x3dcfd9[_0x002b('0x36')][_0x002b('0x37')](_0x4229dc[_0x434f4a]);});}delete _0x3dcfd9[_0x002b('0x33')];}catch(_0x5b7bb2){_0x5796bb(_0x5b7bb2);}_0x989e43(_0x3dcfd9);});}function updateOpenchannelInteraction(_0x217ed5,_0x53686e,_0x5b0352){return new BPromise(function(_0x3123fe,_0x445f59){return getInteractionUsers(_0x217ed5,_0x5b0352)[_0x002b('0x2b')](function(_0x22f2c4){return getInteractionTags(_0x22f2c4,_0x53686e);})[_0x002b('0x2b')](function(_0x1977d9){return getStateInteraction(_0x1977d9);})[_0x002b('0x2b')](function(_0x31c7b9){_0x3123fe(_0x31c7b9);})[_0x002b('0x38')](function(_0x4cf036){_0x445f59(_0x4cf036);});});}function getStateInteraction(_0x3d3173){return new BPromise(function(_0x3db9bd){_0x3d3173[_0x002b('0x39')]=0x0;_0x3d3173[_0x002b('0x3a')]=0x0;_0x3d3173[_0x002b('0x3b')]=0x0;_0x3d3173[_0x002b('0x3c')]=0x0;_0x3d3173['total']=0x0;if(!_0x3d3173[_0x002b('0x3d')]&&!_0x3d3173['UserId']){_0x3d3173['waiting']+=0x1;}if(!_0x3d3173[_0x002b('0x3d')]&&_0x3d3173['UserId']){_0x3d3173[_0x002b('0x3a')]+=0x1;if(_0x3d3173[_0x002b('0x39')]){_0x3d3173[_0x002b('0x39')]-=0x1;}}if(_0x3d3173['closed']&&_0x3d3173[_0x002b('0x3e')]){_0x3d3173[_0x002b('0x3b')]+=0x1;if(_0x3d3173[_0x002b('0x3a')]){_0x3d3173[_0x002b('0x3a')]-=0x1;}}if(_0x3d3173[_0x002b('0x3d')]&&!_0x3d3173[_0x002b('0x3e')]){_0x3d3173['unmanaged']+=0x1;if(_0x3d3173[_0x002b('0x39')]){_0x3d3173[_0x002b('0x39')]-=0x1;}}_0x3d3173[_0x002b('0x3f')]+=0x1;_0x3db9bd(_0x3d3173);});}exports[_0x002b('0x40')]=function(_0x2ea8f9,_0x147183){var _0x2119c7={},_0x2a6c98={},_0x485db3={'count':0x0,'rows':[]};var _0x2d0f7e=_['map'](db[_0x002b('0x41')][_0x002b('0x42')],function(_0x24bb40){return{'name':_0x24bb40[_0x002b('0x43')],'type':_0x24bb40['type']['key']};});_0x2a6c98[_0x002b('0x44')]=_['map'](_0x2d0f7e,_0x002b('0x2e'));_0x2a6c98[_0x002b('0x45')]=_['keys'](_0x2ea8f9[_0x002b('0x45')]);_0x2a6c98[_0x002b('0x46')]=_[_0x002b('0x47')](_0x2a6c98[_0x002b('0x44')],_0x2a6c98[_0x002b('0x45')]);_0x2119c7[_0x002b('0x48')]=_['intersection'](_0x2a6c98[_0x002b('0x44')],qs[_0x002b('0x49')](_0x2ea8f9['query'][_0x002b('0x49')]));_0x2119c7[_0x002b('0x48')]=_0x2119c7[_0x002b('0x48')][_0x002b('0x4a')]?_0x2119c7['attributes']:_0x2a6c98[_0x002b('0x44')];if(!_0x2ea8f9[_0x002b('0x45')][_0x002b('0x4b')](_0x002b('0x4c'))){_0x2119c7[_0x002b('0x4d')]=qs[_0x002b('0x4d')](_0x2ea8f9['query'][_0x002b('0x4d')]);_0x2119c7[_0x002b('0x22')]=qs[_0x002b('0x22')](_0x2ea8f9[_0x002b('0x45')]['offset']);}_0x2119c7[_0x002b('0x4e')]=qs['sort'](_0x2ea8f9[_0x002b('0x45')]['sort']);_0x2119c7[_0x002b('0x4f')]=qs[_0x002b('0x46')](_[_0x002b('0x50')](_0x2ea8f9['query'],_0x2a6c98[_0x002b('0x46')]),_0x2d0f7e);var _0x1b4eb8=[];var _0x19cda1=squel[_0x002b('0x51')]()[_0x002b('0x52')]('id')[_0x002b('0x52')](_0x002b('0x2e'))['field']('color')[_0x002b('0x53')](_0x002b('0x54'));var _0x48008c=squel['select']()[_0x002b('0x52')]('u.id')[_0x002b('0x52')](_0x002b('0x55'))['field']('ui.OpenchannelInteractionId')[_0x002b('0x53')](_0x002b('0x56'),'ui')[_0x002b('0x57')](_0x002b('0x58'),'u',_0x002b('0x59'));var _0x7abe0f=squel[_0x002b('0x51')]()[_0x002b('0x53')](_0x002b('0x5a'),'i')[_0x002b('0x57')](_0x002b('0x5b'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join'](_0x002b('0x58'),'o','o.id\x20=\x20i.UserId')['left_join'](_0x002b('0x5c'),'a',_0x002b('0x5d'))[_0x002b('0x57')](_0x002b('0x5e'),'me',_0x002b('0x5f'))[_0x002b('0x57')](_0x002b('0x60'),'it','it.OpenchannelInteractionId\x20=\x20i.id')[_0x002b('0x57')](_0x002b('0x54'),'t','t.id\x20=\x20it.TagId');var _0x48eb88=squel[_0x002b('0x61')]();var _0x477ba1=[];var _0x544688=squel[_0x002b('0x61')]();var _0x105ef6;if(_0x2ea8f9[_0x002b('0x45')]['search']){_0x105ef6=as[_0x002b('0x62')](_0x2ea8f9['query'][_0x002b('0x63')]);var _0x56678b=_0x105ef6[_0x002b('0x64')];for(var _0x526e97=0x0;_0x526e97<_0x105ef6[_0x002b('0x65')][_0x002b('0x4a')];_0x526e97++){var _0xe80bb3=_0x105ef6['conditions'][_0x526e97];var _0x4e7900='i';var _0xb7bda6=_[_0x002b('0x66')](_0x2d0f7e,[_0x002b('0x2e'),_0xe80bb3[_0x002b('0x52')]]);if(!_0xb7bda6){switch(_0xe80bb3[_0x002b('0x52')]){case'unreadMessages':if(_0xe80bb3[_0x002b('0x67')]==0x1){_0x7abe0f['having']('`'+_0xe80bb3[_0x002b('0x52')]+_0x002b('0x68'));}else{_0x7abe0f['having']('`'+_0xe80bb3[_0x002b('0x52')]+_0x002b('0x69'));}break;case _0x002b('0x6a'):if(_0xe80bb3[_0x002b('0x6b')]===_0x002b('0x6c')){if(_0xe80bb3[_0x002b('0x67')][_0x002b('0x34')]('\x20')[_0x002b('0x4a')]>0x1){_0x48eb88[_0x56678b](_0x002b('0x6d'),qs[_0x002b('0x6e')](_0xe80bb3[_0x002b('0x67')]),null);}else{var _0x3c7b49='%'+_0xe80bb3['value']+'%';_0x48eb88[_0x56678b](_0x002b('0x6f'),_0x3c7b49,_0x3c7b49,_0x3c7b49);}}else{_0xb7bda6=_['find'](_0x2d0f7e,[_0x002b('0x2e'),_0x002b('0x70')]);_0xe80bb3[_0x002b('0x52')]='ContactId';_0x4a9b57=as[_0x002b('0x71')](_0x4e7900,_0xb7bda6['type'],_0xe80bb3);_0x48eb88[_0x56678b](_0x4a9b57[_0x002b('0x72')],_0x4a9b57[_0x002b('0x67')][_0x002b('0x73')],_0x4a9b57['value'][_0x002b('0x20')]);}break;case _0x002b('0x74'):var _0xa4cf16=_0xe80bb3[_0x002b('0x67')][_0x002b('0x34')](',')[_0x002b('0x31')](function(_0x373e90){return Number(_0x373e90);});_0xa4cf16[_0x002b('0x35')](function(_0x33566a){_0x544688['or'](_0x002b('0x75'),'%,'+_0x33566a+',%');});_0x477ba1=_[_0x002b('0x76')](_0x477ba1,_0xa4cf16);break;case _0x002b('0x77'):if(_0xe80bb3[_0x002b('0x6b')]===_0x002b('0x6c')){_0x48eb88[_0x56678b]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0xe80bb3[_0x002b('0x67')]+'%',null);}else{_0xb7bda6=_[_0x002b('0x66')](_0x2d0f7e,[_0x002b('0x2e'),_0x002b('0x3e')]);_0xe80bb3['field']='UserId';_0x4a9b57=as[_0x002b('0x71')](_0x4e7900,_0xb7bda6[_0x002b('0x78')],_0xe80bb3);_0x48eb88[_0x56678b](_0x4a9b57['text'],_0x4a9b57[_0x002b('0x67')][_0x002b('0x73')],_0x4a9b57[_0x002b('0x67')]['end']);}break;case'body':_0x4a9b57=as['buildExpression']('me',null,_0xe80bb3);_0x48eb88[_0x56678b](_0x4a9b57[_0x002b('0x72')],_0x4a9b57['value'][_0x002b('0x73')],_0x4a9b57[_0x002b('0x67')]['end']);break;}}else{var _0x4a9b57=as[_0x002b('0x71')](_0x4e7900,_0xb7bda6[_0x002b('0x78')],_0xe80bb3);_0x48eb88[_0x56678b](_0x4a9b57['text'],_0x4a9b57[_0x002b('0x67')][_0x002b('0x73')],_0x4a9b57[_0x002b('0x67')][_0x002b('0x20')]);}}}else{var _0x1b94cb=_(_0x2ea8f9[_0x002b('0x45')])[_0x002b('0x79')]()[_0x002b('0x31')](function(_0x94cee7){return _[_0x002b('0x7a')](_0x2d0f7e,[_0x002b('0x2e'),_0x94cee7])?_0x94cee7:undefined;})['compact']()[_0x002b('0x67')]();if(!_['isEmpty'](_0x1b94cb)){_0x1b94cb[_0x002b('0x35')](function(_0x40dd74){if(_0x40dd74===_0x002b('0x7b')){_0x7abe0f[_0x002b('0x4f')](_0x002b('0x7c'),[][_0x002b('0x7d')](_0x2ea8f9['query'][_0x40dd74]));}else if(_0x40dd74===_0x002b('0x7e')){var _0xbf674e=JSON[_0x002b('0x7f')](_0x2ea8f9['query'][_0x40dd74])[_0x002b('0x80')];var _0x28a9e6=JSON[_0x002b('0x7f')](_0x2ea8f9['query'][_0x40dd74])[_0x002b('0x81')];_0x7abe0f['where'](_0x002b('0x82'),_0xbf674e,_0x28a9e6);}else{if(_0x2ea8f9[_0x002b('0x45')][_0x40dd74]===_0x002b('0x83')){_0x7abe0f[_0x002b('0x4f')]('i.'+_0x40dd74+_0x002b('0x84'));}else{_0x7abe0f[_0x002b('0x4f')]('i.'+_0x40dd74+_0x002b('0x85'),_0x2ea8f9[_0x002b('0x45')][_0x40dd74]);}}});}if(_0x2ea8f9[_0x002b('0x45')][_0x002b('0x86')]){if(_0x2ea8f9[_0x002b('0x45')][_0x002b('0x86')]==0x1){_0x7abe0f['having']('`unreadMessages`\x20=\x200');}else{_0x7abe0f[_0x002b('0x87')]('`unreadMessages`\x20>\x200');}}if(_0x2ea8f9['query'][_0x002b('0x88')]){_0x477ba1=_[_0x002b('0x89')](_0x2ea8f9[_0x002b('0x45')][_0x002b('0x88')])?_0x2ea8f9['query'][_0x002b('0x88')]:new Array(_0x2ea8f9['query'][_0x002b('0x88')]);_0x477ba1[_0x002b('0x35')](function(_0x50f205){_0x544688['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x50f205+',%');});}if(_0x2ea8f9['query'][_0x002b('0x8a')]){var _0x510329=_0x2ea8f9[_0x002b('0x45')][_0x002b('0x8a')][_0x002b('0x8b')]('\x5c','\x5c\x5c')[_0x002b('0x8b')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x510329)){_0x48eb88['or'](_0x002b('0x8c'),_0x510329+'%');}else{_0x48eb88['or'](_0x002b('0x8d'),qs[_0x002b('0x6e')](_0x510329))['or'](_0x002b('0x8e'),_0x510329+'%')['or'](_0x002b('0x8f'),_0x510329+'%');}}}_0x7abe0f[_0x002b('0x4f')](_0x48eb88);_0x7abe0f[_0x002b('0x90')]('i.id');var _0x30df7f={'type':db['Sequelize'][_0x002b('0x91')]['SELECT'],'raw':!![]};var _0x19c1ca=_0x7abe0f['clone']();_0x19c1ca['field']('i.id');_0x19c1ca['field'](_0x002b('0x92'),_0x002b('0x93'));if(_0x2119c7[_0x002b('0x4e')]){_0x2119c7[_0x002b('0x4e')][_0x002b('0x35')](function(_0x3f5c82){var _0x42cfea=_0x3f5c82[0x0]===_0x002b('0x94')?_0x3f5c82[0x0]:'i.'+_0x3f5c82[0x0];_0x7abe0f[_0x002b('0x4e')](_0x42cfea,_0x3f5c82[0x1]==='DESC'?![]:!![]);});}if(!_['isEmpty'](_0x477ba1)){_0x7abe0f[_0x002b('0x87')](_0x544688);_0x19c1ca[_0x002b('0x4f')]('t.id\x20IN\x20?',_0x477ba1);}BPromise['resolve']()['then'](function(){if(!_0x105ef6){if(_0x2ea8f9[_0x002b('0x45')]['OpenchannelAccountId'])return;_0x19c1ca[_0x002b('0x4f')]('i.OpenchannelAccountId\x20IS\x20NOT\x20NULL');_0x7abe0f[_0x002b('0x4f')](_0x002b('0x95'));return;}if(_0x2ea8f9[_0x002b('0x96')]['role']!==_0x002b('0x97'))return;return _0x2ea8f9[_0x002b('0x96')][_0x002b('0x98')]({'attributes':['id'],'raw':!![]})[_0x002b('0x2b')](function(_0x20afd5){if(_[_0x002b('0x99')](_0x20afd5)){_0x19c1ca[_0x002b('0x4f')](_0x002b('0x9a'));_0x7abe0f[_0x002b('0x4f')]('i.OpenchannelAccountId\x20IS\x20NULL');}else{_0x19c1ca[_0x002b('0x4f')](_0x002b('0x7c'),_[_0x002b('0x31')](_0x20afd5,'id'));_0x7abe0f[_0x002b('0x4f')](_0x002b('0x7c'),_[_0x002b('0x31')](_0x20afd5,'id'));}});})['then'](function(){if(_0x2ea8f9[_0x002b('0x96')]['role']==='agent'&&!_0x105ef6&&!_0x2ea8f9[_0x002b('0x45')][_0x002b('0x7b')])return[];return db[_0x002b('0x9b')]['query'](_0x19c1ca[_0x002b('0x9c')](),_0x30df7f);})[_0x002b('0x2b')](function(_0x129cb9){_0x485db3['count']=_0x129cb9[_0x002b('0x4a')];if(_0x485db3[_0x002b('0x24')]===0x0)return[];return db[_0x002b('0x9b')][_0x002b('0x45')](_0x19cda1['toString'](),_0x30df7f)[_0x002b('0x2b')](function(_0x2cba33){_0x1b4eb8=_['keyBy'](_0x2cba33,'id');_0x30df7f=_['merge'](_0x30df7f,{'model':db['OpenchannelInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2ea8f9[_0x002b('0x45')]['fields']){_0x2119c7[_0x002b('0x48')][_0x002b('0x35')](function(_0x1dd26e){_0x7abe0f[_0x002b('0x52')]('i.'+_0x1dd26e);});}else{_0x7abe0f[_0x002b('0x52')](_0x002b('0x92'),'unreadMessages');_0x7abe0f[_0x002b('0x52')](_0x002b('0x9d'),_0x002b('0x9e'));_0x7abe0f['field']('a.mandatoryDisposition',_0x002b('0x9f'));_0x7abe0f[_0x002b('0x52')](_0x002b('0xa0'),'contactName');_0x7abe0f[_0x002b('0x52')](_0x002b('0xa1'));_0x7abe0f[_0x002b('0x52')](_0x002b('0xa2'),_0x002b('0xa3'));_0x7abe0f[_0x002b('0x52')](_0x002b('0xa4'),'Contact.lastName');_0x7abe0f[_0x002b('0x52')](_0x002b('0xa5'),_0x002b('0xa6'));_0x7abe0f[_0x002b('0x52')](_0x002b('0xa7'),_0x002b('0xa8'));_0x7abe0f[_0x002b('0x52')](_0x002b('0xa9'),_0x002b('0xaa'));_0x7abe0f[_0x002b('0x52')](_0x002b('0xab'),_0x002b('0xac'));_0x7abe0f['field'](_0x002b('0xad'),_0x002b('0xae'));_0x7abe0f[_0x002b('0x52')](_0x002b('0xaf'),'Owner.internal');_0x7abe0f['field'](_0x002b('0xb0'),_0x002b('0x33'));}if(_0x2119c7[_0x002b('0x4d')])_0x7abe0f[_0x002b('0x4d')](_0x2119c7[_0x002b('0x4d')]);if(_0x2119c7['offset'])_0x7abe0f[_0x002b('0x22')](_0x2119c7['offset']);return db[_0x002b('0x9b')][_0x002b('0x45')](_0x7abe0f['toString'](),_0x30df7f);})[_0x002b('0x2b')](function(_0x155352){if(_0x155352[_0x002b('0x4a')]>0x0)_0x48008c['where'](_0x002b('0xb1'),_[_0x002b('0x31')](_0x155352,'id'));return db[_0x002b('0x9b')][_0x002b('0x45')](_0x48008c[_0x002b('0x9c')](),_0x30df7f)[_0x002b('0x2b')](function(_0x4c10c4){var _0x409307=_[_0x002b('0xb2')](_0x4c10c4,_0x002b('0xb3'));var _0x2272d8=[];_0x155352[_0x002b('0x35')](function(_0x48926e){_0x2272d8[_0x002b('0x37')](updateOpenchannelInteraction(_0x48926e,_0x1b4eb8,_0x409307));});return BPromise[_0x002b('0xb4')](_0x2272d8);});});})[_0x002b('0x2b')](function(_0x306f48){_0x485db3[_0x002b('0xb5')]=_0x306f48;return _0x485db3;})[_0x002b('0x2b')](respondWithFilteredResult(_0x147183,_0x2119c7))[_0x002b('0x38')](handleError(_0x147183,null));};exports[_0x002b('0xb6')]=function(_0x3f0550,_0x289804){var _0x19c51b={};if(_0x3f0550[_0x002b('0x45')][_0x002b('0x78')]&&_0x3f0550['query']['type']===_0x002b('0x53')){_0x19c51b[_0x002b('0x53')]=_0x3f0550['params']['id'];}else{_0x19c51b['id']=_0x3f0550[_0x002b('0xb7')]['id'];}var _0x10882d={'raw':![],'where':_0x19c51b},_0x28605e={};_0x28605e[_0x002b('0x44')]=_['keys'](db[_0x002b('0x41')][_0x002b('0x42')]);_0x28605e[_0x002b('0x45')]=_[_0x002b('0x79')](_0x3f0550[_0x002b('0x45')]);_0x28605e[_0x002b('0x46')]=_[_0x002b('0x47')](_0x28605e[_0x002b('0x44')],_0x28605e[_0x002b('0x45')]);_0x10882d[_0x002b('0x48')]=_[_0x002b('0x47')](_0x28605e['model'],qs[_0x002b('0x49')](_0x3f0550['query'][_0x002b('0x49')]));_0x10882d['attributes']=_0x10882d[_0x002b('0x48')]['length']?_0x10882d[_0x002b('0x48')]:_0x28605e['model'];if(_0x3f0550['query']['includeAll']){_0x10882d[_0x002b('0xb8')]=[{'all':!![]}];}_0x10882d=_[_0x002b('0xb9')]({},_0x10882d,_0x3f0550['options']);return db[_0x002b('0x41')][_0x002b('0x66')](_0x10882d)[_0x002b('0x2b')](handleEntityNotFound(_0x289804,null))[_0x002b('0x2b')](respondWithResult(_0x289804,null))[_0x002b('0x38')](handleError(_0x289804,null));};exports[_0x002b('0xba')]=function(_0x479f65,_0x1cebf2){return db[_0x002b('0x41')][_0x002b('0xba')](_0x479f65['body'],{})[_0x002b('0x2b')](respondWithResult(_0x1cebf2,0xc9))[_0x002b('0x38')](handleError(_0x1cebf2,null));};exports[_0x002b('0xbb')]=function(_0x4999a3,_0x5e930c){if(_0x4999a3[_0x002b('0xbc')]['id']){delete _0x4999a3[_0x002b('0xbc')]['id'];}return db[_0x002b('0x41')][_0x002b('0x66')]({'where':{'id':_0x4999a3[_0x002b('0xb7')]['id']}})[_0x002b('0x2b')](handleEntityNotFound(_0x5e930c,null))[_0x002b('0x2b')](saveUpdates(_0x4999a3[_0x002b('0xbc')],null))[_0x002b('0x2b')](respondWithResult(_0x5e930c,null))[_0x002b('0x38')](handleError(_0x5e930c,null));};exports['destroy']=function(_0x34bf88,_0x286eb2){return db[_0x002b('0x41')]['find']({'where':{'id':_0x34bf88['params']['id']}})[_0x002b('0x2b')](handleEntityNotFound(_0x286eb2,null))[_0x002b('0x2b')](removeEntity(_0x286eb2,null))[_0x002b('0x38')](handleError(_0x286eb2,null));};exports[_0x002b('0xbd')]=function(_0x18e658,_0x28dec6){return db[_0x002b('0x41')][_0x002b('0xbd')]()[_0x002b('0x2b')](respondWithResult(_0x28dec6,null))[_0x002b('0x38')](handleError(_0x28dec6,null));};exports[_0x002b('0xbe')]=function(_0x5b23c3,_0x36af3d,_0x3c7912){return db[_0x002b('0xbf')]['find']({'where':{'id':_0x5b23c3[_0x002b('0xb7')]['id']}})[_0x002b('0x2b')](handleEntityNotFound(_0x36af3d,null))[_0x002b('0x2b')](function(_0x1764eb){if(_0x1764eb){return _0x1764eb[_0x002b('0xbe')](_0x5b23c3[_0x002b('0xbc')][_0x002b('0xc0')],_['omit'](_0x5b23c3['body'],[_0x002b('0xc0'),'id'])||{});}})[_0x002b('0x2b')](respondWithResult(_0x36af3d,null))['catch'](handleError(_0x36af3d,null));};exports[_0x002b('0xc1')]=function(_0x54841e,_0x2478da,_0x5e1539){var _0x2ead19={'raw':![],'where':{}};var _0x102bff={};var _0x32d6fc={'count':0x0,'rows':[]};return db[_0x002b('0x41')][_0x002b('0xc2')]({'where':{'id':_0x54841e[_0x002b('0xb7')]['id']}})[_0x002b('0x2b')](handleEntityNotFound(_0x2478da,null))['then'](function(_0x131f5c){if(_0x131f5c){_0x102bff[_0x002b('0x44')]=_[_0x002b('0x79')](db['OpenchannelMessage'][_0x002b('0x42')]);_0x102bff[_0x002b('0x45')]=_[_0x002b('0x79')](_0x54841e['query']);_0x102bff[_0x002b('0x46')]=_[_0x002b('0x47')](_0x102bff['model'],_0x102bff[_0x002b('0x45')]);_0x2ead19['attributes']=_['intersection'](_0x102bff['model'],qs[_0x002b('0x49')](_0x54841e['query']['fields']));_0x2ead19[_0x002b('0x48')]=_0x2ead19[_0x002b('0x48')][_0x002b('0x4a')]?_0x2ead19[_0x002b('0x48')]:_0x102bff[_0x002b('0x44')];if(!_0x54841e[_0x002b('0x45')][_0x002b('0x4b')]('nolimit')){_0x2ead19[_0x002b('0x4d')]=qs[_0x002b('0x4d')](_0x54841e[_0x002b('0x45')][_0x002b('0x4d')]);_0x2ead19[_0x002b('0x22')]=qs[_0x002b('0x22')](_0x54841e[_0x002b('0x45')][_0x002b('0x22')]);}_0x2ead19[_0x002b('0x4e')]=qs['sort'](_0x54841e[_0x002b('0x45')]['sort']);_0x2ead19['where']=qs[_0x002b('0x46')](_[_0x002b('0x50')](_0x54841e[_0x002b('0x45')],_0x102bff[_0x002b('0x46')]));_0x2ead19[_0x002b('0x4f')][_0x002b('0xb3')]=_0x131f5c['id'];if(_0x54841e[_0x002b('0x45')][_0x002b('0x8a')]){_0x2ead19[_0x002b('0x4f')]=_[_0x002b('0xb9')](_0x2ead19[_0x002b('0x4f')],{'$or':_[_0x002b('0x31')](_0x2ead19[_0x002b('0x48')],function(_0x3e39d5){var _0x5587fb={};_0x5587fb[_0x3e39d5]={'$like':'%'+_0x54841e['query'][_0x002b('0x8a')]+'%'};return _0x5587fb;})});}if(_0x54841e[_0x002b('0x45')][_0x002b('0x80')]){var _0x170a02=_0x54841e[_0x002b('0x45')][_0x002b('0x80')]['split'](',');var _0x589ed3={};_0x589ed3[_0x170a02[0x0]]={'$gte':moment(_0x170a02[0x1])['format'](_0x002b('0xc3'))};_0x2ead19[_0x002b('0x4f')]=_[_0x002b('0xb9')](_0x2ead19['where'],_0x589ed3);}_0x2ead19=_['merge']({},_0x2ead19,_0x54841e['options']);return db[_0x002b('0xbf')]['count']({'where':_0x2ead19[_0x002b('0x4f')]})[_0x002b('0x2b')](function(_0x41603f){_0x32d6fc[_0x002b('0x24')]=_0x41603f;if(_0x54841e['query'][_0x002b('0xc4')]){_0x2ead19['include']=[{'all':!![]}];}return db['OpenchannelMessage'][_0x002b('0xc5')](_0x2ead19);})[_0x002b('0x2b')](function(_0x3446e6){_0x32d6fc[_0x002b('0xb5')]=_0x3446e6;return _0x32d6fc;});}})[_0x002b('0x2b')](respondWithFilteredResult(_0x2478da,_0x2ead19))[_0x002b('0x38')](handleError(_0x2478da,null));};exports['addTags']=function(_0x54021d,_0x3f3543,_0x13ee2e){return db['OpenchannelInteraction']['find']({'where':{'id':_0x54021d['params']['id']}})[_0x002b('0x2b')](handleEntityNotFound(_0x3f3543,null))['then'](function(_0x308528){if(_0x308528){return _0x308528[_0x002b('0xc6')](_0x54021d[_0x002b('0xbc')][_0x002b('0xc0')],_[_0x002b('0xc7')](_0x54021d[_0x002b('0xbc')],[_0x002b('0xc0'),'id'])||{})[_0x002b('0xc8')](function(){return db[_0x002b('0x74')][_0x002b('0xc5')]({'attributes':['id',_0x002b('0x2e'),'color'],'where':{'id':_0x54021d[_0x002b('0xbc')][_0x002b('0xc0')]}});})[_0x002b('0x2b')](function(_0x3eb822){socket[_0x002b('0xc9')](_0x002b('0xca'),{'id':Number(_0x54021d[_0x002b('0xb7')]['id']),'tags':_0x3eb822||[]});return{'id':Number(_0x54021d['params']['id']),'tags':_0x3eb822||[]};});}})['then'](respondWithResult(_0x3f3543,null))['catch'](handleError(_0x3f3543,null));};exports[_0x002b('0xcb')]=function(_0x437ed2,_0x494f87,_0x4af54e){return db[_0x002b('0x41')][_0x002b('0x66')]({'where':{'id':_0x437ed2[_0x002b('0xb7')]['id']}})[_0x002b('0x2b')](handleEntityNotFound(_0x494f87,null))[_0x002b('0x2b')](function(_0x504f6d){if(_0x504f6d){return _0x504f6d['removeTags'](_0x437ed2['query'][_0x002b('0xc0')]);}})[_0x002b('0x2b')](respondWithStatusCode(_0x494f87,null))[_0x002b('0x38')](handleError(_0x494f87,null));};exports[_0x002b('0xcc')]=function(_0x4aecd6,_0x2276fb){var _0x441010=moment()['unix']()[_0x002b('0x9c')]();var _0x4e2fc3=path['join'](config['root'],_0x002b('0xcd'),'files',_0x002b('0xce'));var _0x44ee53=path[_0x002b('0xcf')](config[_0x002b('0xd0')],_0x002b('0xcd'),_0x002b('0xd1'),'attachments');var _0x381870=path[_0x002b('0xcf')](_0x4e2fc3,_0x441010);var _0x26163a=util[_0x002b('0xd2')](_0x002b('0xd3'),_0x4aecd6['params']['id'],_0x441010);var _0xa6632b=path[_0x002b('0xcf')](_0x4e2fc3,_0x26163a);var _0x14e3bc=[];_0x14e3bc[_0x002b('0x37')]({'model':db[_0x002b('0x77')],'as':_0x002b('0x77'),'attributes':['id','fullname'],'raw':!![]});_0x14e3bc['push']({'model':db[_0x002b('0xd4')],'as':_0x002b('0x6a'),'attributes':['id',_0x002b('0xd5'),_0x002b('0xd6')],'raw':!![]});if(_0x4aecd6[_0x002b('0x45')][_0x002b('0xd7')]){_0x14e3bc['push']({'model':db[_0x002b('0xd8')],'as':_0x002b('0xd8'),'raw':!![]});}var _0x54ca2f=[{'model':db['OpenchannelMessage'],'as':_0x002b('0xd9'),'attributes':['id',_0x002b('0xbc'),_0x002b('0x7e'),_0x002b('0xda'),_0x002b('0xdb'),'read'],'include':_0x14e3bc}];_0x54ca2f[_0x002b('0x37')]({'model':db['OpenchannelAccount'],'as':_0x002b('0xdc'),'attributes':['id','name']});_0x54ca2f[_0x002b('0x37')]({'model':db['User'],'as':_0x002b('0xdd'),'attributes':['id',_0x002b('0x32')]});return db[_0x002b('0x41')][_0x002b('0x66')]({'where':{'id':_0x4aecd6[_0x002b('0xb7')]['id']},'include':_0x54ca2f})['then'](handleEntityNotFound(_0x2276fb,null))[_0x002b('0x2b')](function(_0x19f1a9){if(_0x19f1a9){var _0x18167b=_0x19f1a9[_0x002b('0xde')]({'plain':!![]});fs[_0x002b('0xdf')](_0x381870);var _0x1e5433={'channel':_0x002b('0xe0'),'account':_0x18167b[_0x002b('0xdc')][_0x002b('0x2e')],'agent':_0x18167b[_0x002b('0xdd')]?_0x18167b[_0x002b('0xdd')]['fullname']:_0x002b('0xe1'),'createdAt':moment(_0x18167b[_0x002b('0x7e')])['format'](_0x002b('0xc3'))[_0x002b('0x9c')](),'closedAt':_0x18167b[_0x002b('0x3d')]?moment(_0x18167b[_0x002b('0xe2')])['format'](_0x002b('0xc3'))[_0x002b('0x9c')]():'','disposition':_0x18167b[_0x002b('0xe3')],'visibility':_0x18167b['threadId']?'Public':_0x002b('0xe4'),'messages':_(_0x18167b[_0x002b('0xd9')])[_0x002b('0x8a')]({'secret':![]})['map'](function(_0x325d73){if(_0x325d73[_0x002b('0xd8')]){var _0x15e792=path['join'](_0x44ee53,_0x325d73['Attachment'][_0x002b('0xe5')]);if(fs['existsSync'](_0x15e792)){fs['createReadStream'](_0x15e792)['pipe'](fs['createWriteStream'](path[_0x002b('0xcf')](_0x381870,_0x325d73[_0x002b('0xd8')]['basename'])));}}return{'date':moment(_0x325d73[_0x002b('0x7e')])[_0x002b('0xd2')](_0x002b('0xc3'))[_0x002b('0x9c')](),'sender':_0x325d73[_0x002b('0xda')]===_0x002b('0xe6')?_0x325d73[_0x002b('0x77')]?_0x325d73[_0x002b('0x77')][_0x002b('0x32')]:_0x002b('0xe7'):_0x325d73[_0x002b('0x6a')]['firstName']+(_0x325d73[_0x002b('0x6a')][_0x002b('0xd6')]?'\x20'+_0x325d73[_0x002b('0x6a')][_0x002b('0xd6')]:''),'body':_0x325d73[_0x002b('0xd8')]?_0x325d73[_0x002b('0xd8')]['basename']:_0x325d73['body'],'direction':_0x325d73['direction']===_0x002b('0xe6')?'A':'C','secret':_0x325d73[_0x002b('0xdb')],'read':_0x325d73['read'],'attachment':_0x325d73[_0x002b('0xd8')]};})[_0x002b('0x67')]()};return ejs[_0x002b('0xe8')](path[_0x002b('0xcf')](config['root'],_0x002b('0xcd'),'views',_0x002b('0xe9')),{'interaction':_0x1e5433})[_0x002b('0x2b')](function(_0x7f9cf7){var _0x4c0f12=path[_0x002b('0xcf')](_0x381870,_0x002b('0xea')+_0x18167b['id']+'-'+_0x441010+_0x002b('0xeb'));var _0x29bb57={'path':_0x4c0f12,'channel':'Openchannel','interactionId':_0x18167b['id']};return pdf[_0x002b('0xec')](_0x7f9cf7,_0x29bb57);})[_0x002b('0x2b')](function(){return new BPromise(function(_0x42744e,_0x1d3e5a){zipdir(_0x381870,{'saveTo':_0xa6632b},function(_0x202b2a,_0x1bd0f8){if(_0x202b2a)return _0x1d3e5a(_0x202b2a);return _0x42744e(_0x1bd0f8);});})['then'](function(){return new BPromise(function(_0x3ca5fb,_0x5a9353){rimraf(_0x381870,function(_0x4e8d04){if(_0x4e8d04)_0x5a9353(_0x4e8d04);return _0x3ca5fb();});});})['then'](function(){return _0x2276fb[_0x002b('0xcc')](_0xa6632b,_0x26163a,function(_0x13fdd9){if(_0x13fdd9){console['log']('err',_0x13fdd9);}else{fs[_0x002b('0xed')](_0xa6632b);}});});});}else{return _0x2276fb[_0x002b('0x1f')](0xc8);}})[_0x002b('0x38')](handleError(_0x2276fb,null));};
\ No newline at end of file
+var _0xfc9b=['localhost','socket.io-emitter','./openchannelInteraction.socket','register','status','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','destroy','end','sendStatus','name','Users','map','fullname','TagIds','Tags','split','push','then','catch','unmanaged','total','closed','UserId','waiting','talking','answered','index','rawAttributes','type','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','select','field','color','from','tools_tags','u.fullname','ui.OpenchannelInteractionId','user_has_openchannel_interactions','left_join','users','u.id\x20=\x20ui.UserId','openchannel_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','openchannel_accounts','a.id\x20=\x20i.OpenchannelAccountId','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id','openchannel_interaction_has_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','unreadMessages','having','operator','value','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','buildExpression','text','start','Tag','union','User','$substring','isEmpty','OpenchannelAccountId','i.OpenchannelAccountId\x20IN\x20?','concat','createdAt','parse','$gte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','read','`unreadMessages`\x20>\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','i.from\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','Sequelize','QueryTypes','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','forEach','contactName','DESC','t.id\x20IN\x20?','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','role','user','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','agent','sequelize','toString','merge','OpenchannelInteraction','Account.key','a.mandatoryDisposition','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','c.firstName','c.lastName','Contact.lastName','c.email','c.phone','c.mobile','c.fax','Contact.fax','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.OpenchannelInteractionId\x20IN\x20?','groupBy','OpenchannelInteractionId','all','rows','show','params','intersection','includeAll','include','options','create','body','describe','addMessage','OpenchannelMessage','ids','omit','getMessages','findOne','pick','findAll','setTags','emit','openchannelInteractionTags:save','removeTags','join','root','files','tmp','server','attachments','format','transcript-%d-%s.zip','CmContact','Contact','firstName','lastName','Attachment','direction','Owner','get','mkdirSync','Openchannel','Account','YYYY-MM-DD\x20HH:mm:ss','closedAt','disposition','threadId','Public','Private','Messages','basename','existsSync','createReadStream','pipe','createWriteStream','out','System','secret','renderFile','views','transcript-','.pdf','log','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis'];(function(_0x1e3d0f,_0x5a231f){var _0x14853a=function(_0x1d42d1){while(--_0x1d42d1){_0x1e3d0f['push'](_0x1e3d0f['shift']());}};_0x14853a(++_0x5a231f);}(_0xfc9b,0xd1));var _0xbfc9=function(_0x486ebf,_0x52042a){_0x486ebf=_0x486ebf-0x0;var _0x2a10aa=_0xfc9b[_0x486ebf];return _0x2a10aa;};'use strict';var emlformat=require(_0xbfc9('0x0'));var rimraf=require(_0xbfc9('0x1'));var zipdir=require(_0xbfc9('0x2'));var jsonpatch=require(_0xbfc9('0x3'));var rp=require('request-promise');var moment=require(_0xbfc9('0x4'));var BPromise=require(_0xbfc9('0x5'));var Mustache=require(_0xbfc9('0x6'));var util=require(_0xbfc9('0x7'));var path=require(_0xbfc9('0x8'));var sox=require(_0xbfc9('0x9'));var csv=require('to-csv');var ejs=require(_0xbfc9('0xa'));var fs=require('fs');var fs_extra=require(_0xbfc9('0xb'));var _=require(_0xbfc9('0xc'));var squel=require(_0xbfc9('0xd'));var crypto=require(_0xbfc9('0xe'));var jsforce=require(_0xbfc9('0xf'));var deskjs=require(_0xbfc9('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xbfc9('0x11'));var Redis=require(_0xbfc9('0x12'));var authService=require(_0xbfc9('0x13'));var qs=require(_0xbfc9('0x14'));var as=require(_0xbfc9('0x15'));var pdf=require(_0xbfc9('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xbfc9('0x17'));var utils=require(_0xbfc9('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xbfc9('0x19'));var db=require(_0xbfc9('0x1a'))['db'];config['redis']=_[_0xbfc9('0x1b')](config[_0xbfc9('0x1c')],{'host':_0xbfc9('0x1d'),'port':0x18eb});var socket=require(_0xbfc9('0x1e'))(new Redis(config[_0xbfc9('0x1c')]));require(_0xbfc9('0x1f'))[_0xbfc9('0x20')](socket);function respondWithStatusCode(_0x6baba5,_0x2d2dfc){_0x2d2dfc=_0x2d2dfc||0xcc;return function(_0xc2e397){if(_0xc2e397){return _0x6baba5['sendStatus'](_0x2d2dfc);}return _0x6baba5[_0xbfc9('0x21')](_0x2d2dfc)['end']();};}function respondWithResult(_0x4f285c,_0x125a27){_0x125a27=_0x125a27||0xc8;return function(_0x8e7fb0){if(_0x8e7fb0){return _0x4f285c[_0xbfc9('0x21')](_0x125a27)[_0xbfc9('0x22')](_0x8e7fb0);}};}function respondWithFilteredResult(_0x5d1274,_0x45b006){return function(_0x29b190){if(_0x29b190){var _0x2ff6f3=typeof _0x45b006[_0xbfc9('0x23')]==='undefined'&&typeof _0x45b006[_0xbfc9('0x24')]===_0xbfc9('0x25');var _0x2c9871=_0x29b190[_0xbfc9('0x26')];var _0x5a266c=_0x2ff6f3?0x0:_0x45b006[_0xbfc9('0x23')];var _0x370b58=_0x2ff6f3?_0x29b190[_0xbfc9('0x26')]:_0x45b006[_0xbfc9('0x23')]+_0x45b006[_0xbfc9('0x24')];var _0x15d2d3;if(_0x370b58>=_0x2c9871){_0x370b58=_0x2c9871;_0x15d2d3=0xc8;}else{_0x15d2d3=0xce;}_0x5d1274['status'](_0x15d2d3);return _0x5d1274[_0xbfc9('0x27')](_0xbfc9('0x28'),_0x5a266c+'-'+_0x370b58+'/'+_0x2c9871)[_0xbfc9('0x22')](_0x29b190);}return null;};}function patchUpdates(_0x12f3f1){return function(_0x24de44){try{jsonpatch['apply'](_0x24de44,_0x12f3f1,!![]);}catch(_0x5063c6){return BPromise[_0xbfc9('0x29')](_0x5063c6);}return _0x24de44[_0xbfc9('0x2a')]();};}function saveUpdates(_0x493d68,_0x19e76a){return function(_0x5cb890){if(_0x5cb890){return _0x5cb890[_0xbfc9('0x2b')](_0x493d68)['then'](function(_0x1d88a9){return _0x1d88a9;});}return null;};}function removeEntity(_0x464070,_0x5790b6){return function(_0x452dff){if(_0x452dff){return _0x452dff[_0xbfc9('0x2c')]()['then'](function(){_0x464070['status'](0xcc)[_0xbfc9('0x2d')]();});}};}function handleEntityNotFound(_0x5eafda,_0x278f99){return function(_0x5abe79){if(!_0x5abe79){_0x5eafda[_0xbfc9('0x2e')](0x194);}return _0x5abe79;};}function handleError(_0x2fd467,_0x675f42){_0x675f42=_0x675f42||0x1f4;return function(_0xe88a3f){logger['error'](_0xe88a3f['stack']);if(_0xe88a3f[_0xbfc9('0x2f')]){delete _0xe88a3f[_0xbfc9('0x2f')];}_0x2fd467[_0xbfc9('0x21')](_0x675f42)['send'](_0xe88a3f);};}function getInteractionUsers(_0x7084c4,_0x556d7e){return new BPromise(function(_0x492e19,_0x19d3da){try{if(_0x556d7e[_0x7084c4['id']]){_0x7084c4[_0xbfc9('0x30')]=_[_0xbfc9('0x31')](_0x556d7e[_0x7084c4['id']],function(_0x49e608){return{'id':_0x49e608['id'],'fullname':_0x49e608[_0xbfc9('0x32')]};});}}catch(_0x254dbc){_0x19d3da(_0x254dbc);}_0x492e19(_0x7084c4);});}function getInteractionTags(_0x3a3714,_0x35847e){return new BPromise(function(_0x20b6a6,_0x42a448){try{if(_0x3a3714[_0xbfc9('0x33')]){_0x3a3714[_0xbfc9('0x34')]=[];_0x3a3714[_0xbfc9('0x33')][_0xbfc9('0x35')](',')['forEach'](function(_0xfc191d){_0x3a3714[_0xbfc9('0x34')][_0xbfc9('0x36')](_0x35847e[_0xfc191d]);});}delete _0x3a3714[_0xbfc9('0x33')];}catch(_0x1070aa){_0x42a448(_0x1070aa);}_0x20b6a6(_0x3a3714);});}function updateOpenchannelInteraction(_0x238f50,_0x1236f4,_0x3c8d60){return new BPromise(function(_0x16233e,_0x10e006){return getInteractionUsers(_0x238f50,_0x3c8d60)[_0xbfc9('0x37')](function(_0x216d9b){return getInteractionTags(_0x216d9b,_0x1236f4);})[_0xbfc9('0x37')](function(_0x3f1882){return getStateInteraction(_0x3f1882);})[_0xbfc9('0x37')](function(_0x17a5c9){_0x16233e(_0x17a5c9);})[_0xbfc9('0x38')](function(_0x53aeaf){_0x10e006(_0x53aeaf);});});}function getStateInteraction(_0x349510){return new BPromise(function(_0x469b2e){_0x349510['waiting']=0x0;_0x349510['talking']=0x0;_0x349510['answered']=0x0;_0x349510[_0xbfc9('0x39')]=0x0;_0x349510[_0xbfc9('0x3a')]=0x0;if(!_0x349510[_0xbfc9('0x3b')]&&!_0x349510[_0xbfc9('0x3c')]){_0x349510[_0xbfc9('0x3d')]+=0x1;}if(!_0x349510[_0xbfc9('0x3b')]&&_0x349510[_0xbfc9('0x3c')]){_0x349510[_0xbfc9('0x3e')]+=0x1;if(_0x349510[_0xbfc9('0x3d')]){_0x349510['waiting']-=0x1;}}if(_0x349510[_0xbfc9('0x3b')]&&_0x349510[_0xbfc9('0x3c')]){_0x349510[_0xbfc9('0x3f')]+=0x1;if(_0x349510['talking']){_0x349510[_0xbfc9('0x3e')]-=0x1;}}if(_0x349510[_0xbfc9('0x3b')]&&!_0x349510[_0xbfc9('0x3c')]){_0x349510[_0xbfc9('0x39')]+=0x1;if(_0x349510[_0xbfc9('0x3d')]){_0x349510[_0xbfc9('0x3d')]-=0x1;}}_0x349510[_0xbfc9('0x3a')]+=0x1;_0x469b2e(_0x349510);});}exports[_0xbfc9('0x40')]=function(_0x32c397,_0x52d8db){var _0x6cdd57={},_0x280f5f={},_0x2773ba={'count':0x0,'rows':[]};var _0xe57fb=_[_0xbfc9('0x31')](db['OpenchannelInteraction'][_0xbfc9('0x41')],function(_0x46c0f7){return{'name':_0x46c0f7['fieldName'],'type':_0x46c0f7[_0xbfc9('0x42')]['key']};});_0x280f5f[_0xbfc9('0x43')]=_[_0xbfc9('0x31')](_0xe57fb,'name');_0x280f5f[_0xbfc9('0x44')]=_[_0xbfc9('0x45')](_0x32c397[_0xbfc9('0x44')]);_0x280f5f[_0xbfc9('0x46')]=_['intersection'](_0x280f5f[_0xbfc9('0x43')],_0x280f5f[_0xbfc9('0x44')]);_0x6cdd57[_0xbfc9('0x47')]=_['intersection'](_0x280f5f[_0xbfc9('0x43')],qs[_0xbfc9('0x48')](_0x32c397[_0xbfc9('0x44')][_0xbfc9('0x48')]));_0x6cdd57['attributes']=_0x6cdd57[_0xbfc9('0x47')][_0xbfc9('0x49')]?_0x6cdd57['attributes']:_0x280f5f[_0xbfc9('0x43')];if(!_0x32c397['query'][_0xbfc9('0x4a')](_0xbfc9('0x4b'))){_0x6cdd57[_0xbfc9('0x24')]=qs[_0xbfc9('0x24')](_0x32c397[_0xbfc9('0x44')][_0xbfc9('0x24')]);_0x6cdd57[_0xbfc9('0x23')]=qs['offset'](_0x32c397['query']['offset']);}_0x6cdd57[_0xbfc9('0x4c')]=qs[_0xbfc9('0x4d')](_0x32c397[_0xbfc9('0x44')]['sort']);_0x6cdd57[_0xbfc9('0x4e')]=qs[_0xbfc9('0x46')](_['pick'](_0x32c397['query'],_0x280f5f[_0xbfc9('0x46')]),_0xe57fb);var _0x5f1771=[];var _0x2e0835=squel[_0xbfc9('0x4f')]()['field']('id')[_0xbfc9('0x50')](_0xbfc9('0x2f'))[_0xbfc9('0x50')](_0xbfc9('0x51'))[_0xbfc9('0x52')](_0xbfc9('0x53'));var _0x58238d=squel[_0xbfc9('0x4f')]()[_0xbfc9('0x50')]('u.id')[_0xbfc9('0x50')](_0xbfc9('0x54'))['field'](_0xbfc9('0x55'))['from'](_0xbfc9('0x56'),'ui')[_0xbfc9('0x57')](_0xbfc9('0x58'),'u',_0xbfc9('0x59'));var _0x28eabb=squel[_0xbfc9('0x4f')]()['from'](_0xbfc9('0x5a'),'i')['left_join'](_0xbfc9('0x5b'),'c',_0xbfc9('0x5c'))['left_join'](_0xbfc9('0x58'),'o',_0xbfc9('0x5d'))[_0xbfc9('0x57')](_0xbfc9('0x5e'),'a',_0xbfc9('0x5f'))[_0xbfc9('0x57')](_0xbfc9('0x60'),'me',_0xbfc9('0x61'))[_0xbfc9('0x57')](_0xbfc9('0x62'),'it','it.OpenchannelInteractionId\x20=\x20i.id')['left_join'](_0xbfc9('0x53'),'t',_0xbfc9('0x63'));var _0x563bde=squel[_0xbfc9('0x64')]();var _0x1ea311=[];var _0x70c0e8=squel[_0xbfc9('0x64')]();var _0x4ce147;if(_0x32c397[_0xbfc9('0x44')][_0xbfc9('0x65')]){_0x4ce147=as[_0xbfc9('0x66')](_0x32c397[_0xbfc9('0x44')][_0xbfc9('0x65')]);var _0x13fceb=_0x4ce147[_0xbfc9('0x67')];for(var _0x55ce33=0x0;_0x55ce33<_0x4ce147[_0xbfc9('0x68')]['length'];_0x55ce33++){var _0x67a84f=_0x4ce147[_0xbfc9('0x68')][_0x55ce33];var _0x52c2e1='i';var _0x5c8c9a=_['find'](_0xe57fb,[_0xbfc9('0x2f'),_0x67a84f[_0xbfc9('0x50')]]);if(!_0x5c8c9a){switch(_0x67a84f[_0xbfc9('0x50')]){case _0xbfc9('0x69'):if(_0x67a84f['value']==0x1){_0x28eabb['having']('`'+_0x67a84f[_0xbfc9('0x50')]+'`\x20=\x200');}else{_0x28eabb[_0xbfc9('0x6a')]('`'+_0x67a84f['field']+'`\x20>\x200');}break;case'Contact':if(_0x67a84f[_0xbfc9('0x6b')]==='$substring'){if(_0x67a84f[_0xbfc9('0x6c')][_0xbfc9('0x35')]('\x20')['length']>0x1){_0x563bde[_0x13fceb](_0xbfc9('0x6d'),qs['getFullTextValue'](_0x67a84f[_0xbfc9('0x6c')]),null);}else{var _0xf8247d='%'+_0x67a84f['value']+'%';_0x563bde[_0x13fceb](_0xbfc9('0x6e'),_0xf8247d,_0xf8247d,_0xf8247d);}}else{_0x5c8c9a=_[_0xbfc9('0x6f')](_0xe57fb,[_0xbfc9('0x2f'),_0xbfc9('0x70')]);_0x67a84f[_0xbfc9('0x50')]=_0xbfc9('0x70');_0x2288f8=as[_0xbfc9('0x71')](_0x52c2e1,_0x5c8c9a[_0xbfc9('0x42')],_0x67a84f);_0x563bde[_0x13fceb](_0x2288f8[_0xbfc9('0x72')],_0x2288f8['value'][_0xbfc9('0x73')],_0x2288f8[_0xbfc9('0x6c')][_0xbfc9('0x2d')]);}break;case _0xbfc9('0x74'):var _0x466d21=_0x67a84f[_0xbfc9('0x6c')][_0xbfc9('0x35')](',')['map'](function(_0x16377f){return Number(_0x16377f);});_0x466d21['forEach'](function(_0x2bbd5c){_0x70c0e8['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x2bbd5c+',%');});_0x1ea311=_[_0xbfc9('0x75')](_0x1ea311,_0x466d21);break;case _0xbfc9('0x76'):if(_0x67a84f[_0xbfc9('0x6b')]===_0xbfc9('0x77')){_0x563bde[_0x13fceb]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x67a84f[_0xbfc9('0x6c')]+'%',null);}else{_0x5c8c9a=_[_0xbfc9('0x6f')](_0xe57fb,[_0xbfc9('0x2f'),'UserId']);_0x67a84f['field']='UserId';_0x2288f8=as['buildExpression'](_0x52c2e1,_0x5c8c9a['type'],_0x67a84f);_0x563bde[_0x13fceb](_0x2288f8[_0xbfc9('0x72')],_0x2288f8[_0xbfc9('0x6c')][_0xbfc9('0x73')],_0x2288f8[_0xbfc9('0x6c')][_0xbfc9('0x2d')]);}break;case'body':_0x2288f8=as[_0xbfc9('0x71')]('me',null,_0x67a84f);_0x563bde[_0x13fceb](_0x2288f8[_0xbfc9('0x72')],_0x2288f8[_0xbfc9('0x6c')]['start'],_0x2288f8[_0xbfc9('0x6c')]['end']);break;}}else{var _0x2288f8=as[_0xbfc9('0x71')](_0x52c2e1,_0x5c8c9a[_0xbfc9('0x42')],_0x67a84f);_0x563bde[_0x13fceb](_0x2288f8[_0xbfc9('0x72')],_0x2288f8[_0xbfc9('0x6c')][_0xbfc9('0x73')],_0x2288f8[_0xbfc9('0x6c')][_0xbfc9('0x2d')]);}}}else{var _0x29eae8=_(_0x32c397[_0xbfc9('0x44')])[_0xbfc9('0x45')]()[_0xbfc9('0x31')](function(_0x58990c){return _['some'](_0xe57fb,['name',_0x58990c])?_0x58990c:undefined;})['compact']()[_0xbfc9('0x6c')]();if(!_[_0xbfc9('0x78')](_0x29eae8)){_0x29eae8['forEach'](function(_0x32f894){if(_0x32f894===_0xbfc9('0x79')){_0x28eabb[_0xbfc9('0x4e')](_0xbfc9('0x7a'),[][_0xbfc9('0x7b')](_0x32c397[_0xbfc9('0x44')][_0x32f894]));}else if(_0x32f894===_0xbfc9('0x7c')){var _0x5c754a=JSON[_0xbfc9('0x7d')](_0x32c397['query'][_0x32f894])[_0xbfc9('0x7e')];var _0x27ac11=JSON[_0xbfc9('0x7d')](_0x32c397[_0xbfc9('0x44')][_0x32f894])['$lte'];_0x28eabb[_0xbfc9('0x4e')](_0xbfc9('0x7f'),_0x5c754a,_0x27ac11);}else{if(_0x32c397[_0xbfc9('0x44')][_0x32f894]===_0xbfc9('0x80')){_0x28eabb[_0xbfc9('0x4e')]('i.'+_0x32f894+'\x20IS\x20NULL');}else{_0x28eabb[_0xbfc9('0x4e')]('i.'+_0x32f894+'\x20=\x20?',_0x32c397[_0xbfc9('0x44')][_0x32f894]);}}});}if(_0x32c397['query']['read']){if(_0x32c397[_0xbfc9('0x44')][_0xbfc9('0x81')]==0x1){_0x28eabb[_0xbfc9('0x6a')]('`unreadMessages`\x20=\x200');}else{_0x28eabb[_0xbfc9('0x6a')](_0xbfc9('0x82'));}}if(_0x32c397[_0xbfc9('0x44')][_0xbfc9('0x83')]){_0x1ea311=_[_0xbfc9('0x84')](_0x32c397[_0xbfc9('0x44')]['tag'])?_0x32c397[_0xbfc9('0x44')][_0xbfc9('0x83')]:new Array(_0x32c397[_0xbfc9('0x44')][_0xbfc9('0x83')]);_0x1ea311['forEach'](function(_0x31edf2){_0x70c0e8['or'](_0xbfc9('0x85'),'%,'+_0x31edf2+',%');});}if(_0x32c397[_0xbfc9('0x44')][_0xbfc9('0x86')]){var _0x15c59d=_0x32c397[_0xbfc9('0x44')][_0xbfc9('0x86')][_0xbfc9('0x87')]('\x5c','\x5c\x5c')[_0xbfc9('0x87')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x15c59d)){_0x563bde['or']('i.id\x20LIKE\x20?',_0x15c59d+'%');}else{_0x563bde['or'](_0xbfc9('0x88'),qs[_0xbfc9('0x89')](_0x15c59d))['or'](_0xbfc9('0x8a'),_0x15c59d+'%')['or'](_0xbfc9('0x8b'),_0x15c59d+'%');}}}_0x28eabb['where'](_0x563bde);_0x28eabb[_0xbfc9('0x8c')]('i.id');var _0x5b8659={'type':db[_0xbfc9('0x8d')][_0xbfc9('0x8e')]['SELECT'],'raw':!![]};var _0x207abc=_0x28eabb['clone']();_0x207abc['field']('i.id');_0x207abc[_0xbfc9('0x50')](_0xbfc9('0x8f'),_0xbfc9('0x69'));if(_0x6cdd57[_0xbfc9('0x4c')]){_0x6cdd57[_0xbfc9('0x4c')][_0xbfc9('0x90')](function(_0x4cf80c){var _0xae928a=_0x4cf80c[0x0]===_0xbfc9('0x91')?_0x4cf80c[0x0]:'i.'+_0x4cf80c[0x0];_0x28eabb[_0xbfc9('0x4c')](_0xae928a,_0x4cf80c[0x1]===_0xbfc9('0x92')?![]:!![]);});}if(!_[_0xbfc9('0x78')](_0x1ea311)){_0x28eabb['having'](_0x70c0e8);_0x207abc['where'](_0xbfc9('0x93'),_0x1ea311);}BPromise['resolve']()['then'](function(){if(!_0x4ce147){if(_0x32c397[_0xbfc9('0x44')][_0xbfc9('0x79')])return;_0x207abc[_0xbfc9('0x4e')](_0xbfc9('0x94'));_0x28eabb[_0xbfc9('0x4e')](_0xbfc9('0x94'));return;}if(_0x32c397['user'][_0xbfc9('0x95')]!=='agent')return;return _0x32c397[_0xbfc9('0x96')][_0xbfc9('0x97')]({'attributes':['id'],'raw':!![]})[_0xbfc9('0x37')](function(_0x119223){if(_[_0xbfc9('0x78')](_0x119223)){_0x207abc['where'](_0xbfc9('0x98'));_0x28eabb[_0xbfc9('0x4e')](_0xbfc9('0x98'));}else{_0x207abc['where'](_0xbfc9('0x7a'),_[_0xbfc9('0x31')](_0x119223,'id'));_0x28eabb[_0xbfc9('0x4e')](_0xbfc9('0x7a'),_[_0xbfc9('0x31')](_0x119223,'id'));}});})[_0xbfc9('0x37')](function(){if(_0x32c397[_0xbfc9('0x96')][_0xbfc9('0x95')]===_0xbfc9('0x99')&&!_0x4ce147&&!_0x32c397[_0xbfc9('0x44')][_0xbfc9('0x79')])return[];return db[_0xbfc9('0x9a')][_0xbfc9('0x44')](_0x207abc[_0xbfc9('0x9b')](),_0x5b8659);})[_0xbfc9('0x37')](function(_0x54da6e){_0x2773ba[_0xbfc9('0x26')]=_0x54da6e[_0xbfc9('0x49')];if(_0x2773ba[_0xbfc9('0x26')]===0x0)return[];return db[_0xbfc9('0x9a')][_0xbfc9('0x44')](_0x2e0835['toString'](),_0x5b8659)[_0xbfc9('0x37')](function(_0x23286d){_0x5f1771=_['keyBy'](_0x23286d,'id');_0x5b8659=_[_0xbfc9('0x9c')](_0x5b8659,{'model':db[_0xbfc9('0x9d')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x32c397[_0xbfc9('0x44')][_0xbfc9('0x48')]){_0x6cdd57[_0xbfc9('0x47')][_0xbfc9('0x90')](function(_0xd5fe5b){_0x28eabb[_0xbfc9('0x50')]('i.'+_0xd5fe5b);});}else{_0x28eabb[_0xbfc9('0x50')](_0xbfc9('0x8f'),_0xbfc9('0x69'));_0x28eabb[_0xbfc9('0x50')]('a.key',_0xbfc9('0x9e'));_0x28eabb[_0xbfc9('0x50')](_0xbfc9('0x9f'),'Account.mandatoryDisposition');_0x28eabb[_0xbfc9('0x50')](_0xbfc9('0xa0'),'contactName');_0x28eabb[_0xbfc9('0x50')]('i.*');_0x28eabb[_0xbfc9('0x50')](_0xbfc9('0xa1'),'Contact.firstName');_0x28eabb[_0xbfc9('0x50')](_0xbfc9('0xa2'),_0xbfc9('0xa3'));_0x28eabb['field'](_0xbfc9('0xa4'),'Contact.email');_0x28eabb[_0xbfc9('0x50')](_0xbfc9('0xa5'),'Contact.phone');_0x28eabb[_0xbfc9('0x50')](_0xbfc9('0xa6'),'Contact.mobile');_0x28eabb[_0xbfc9('0x50')](_0xbfc9('0xa7'),_0xbfc9('0xa8'));_0x28eabb[_0xbfc9('0x50')]('o.fullname','Owner.fullname');_0x28eabb[_0xbfc9('0x50')](_0xbfc9('0xa9'),'Owner.internal');_0x28eabb['field'](_0xbfc9('0xaa'),'TagIds');}if(_0x6cdd57[_0xbfc9('0x24')])_0x28eabb[_0xbfc9('0x24')](_0x6cdd57[_0xbfc9('0x24')]);if(_0x6cdd57[_0xbfc9('0x23')])_0x28eabb[_0xbfc9('0x23')](_0x6cdd57[_0xbfc9('0x23')]);return db[_0xbfc9('0x9a')][_0xbfc9('0x44')](_0x28eabb['toString'](),_0x5b8659);})[_0xbfc9('0x37')](function(_0x1da842){if(_0x1da842['length']>0x0)_0x58238d[_0xbfc9('0x4e')](_0xbfc9('0xab'),_[_0xbfc9('0x31')](_0x1da842,'id'));return db['sequelize'][_0xbfc9('0x44')](_0x58238d['toString'](),_0x5b8659)[_0xbfc9('0x37')](function(_0x3b8d5f){var _0x52449d=_[_0xbfc9('0xac')](_0x3b8d5f,_0xbfc9('0xad'));var _0x5da0af=[];_0x1da842[_0xbfc9('0x90')](function(_0x16f605){_0x5da0af['push'](updateOpenchannelInteraction(_0x16f605,_0x5f1771,_0x52449d));});return BPromise[_0xbfc9('0xae')](_0x5da0af);});});})[_0xbfc9('0x37')](function(_0x485795){_0x2773ba[_0xbfc9('0xaf')]=_0x485795;return _0x2773ba;})[_0xbfc9('0x37')](respondWithFilteredResult(_0x52d8db,_0x6cdd57))[_0xbfc9('0x38')](handleError(_0x52d8db,null));};exports[_0xbfc9('0xb0')]=function(_0x2124df,_0x290968){var _0x2e99f8={};if(_0x2124df[_0xbfc9('0x44')][_0xbfc9('0x42')]&&_0x2124df[_0xbfc9('0x44')][_0xbfc9('0x42')]==='from'){_0x2e99f8[_0xbfc9('0x52')]=_0x2124df[_0xbfc9('0xb1')]['id'];}else{_0x2e99f8['id']=_0x2124df[_0xbfc9('0xb1')]['id'];}var _0x32bc3b={'raw':![],'where':_0x2e99f8},_0x122088={};_0x122088[_0xbfc9('0x43')]=_['keys'](db['OpenchannelInteraction'][_0xbfc9('0x41')]);_0x122088[_0xbfc9('0x44')]=_['keys'](_0x2124df['query']);_0x122088[_0xbfc9('0x46')]=_[_0xbfc9('0xb2')](_0x122088[_0xbfc9('0x43')],_0x122088[_0xbfc9('0x44')]);_0x32bc3b[_0xbfc9('0x47')]=_['intersection'](_0x122088[_0xbfc9('0x43')],qs['fields'](_0x2124df[_0xbfc9('0x44')][_0xbfc9('0x48')]));_0x32bc3b[_0xbfc9('0x47')]=_0x32bc3b['attributes'][_0xbfc9('0x49')]?_0x32bc3b['attributes']:_0x122088[_0xbfc9('0x43')];if(_0x2124df[_0xbfc9('0x44')][_0xbfc9('0xb3')]){_0x32bc3b[_0xbfc9('0xb4')]=[{'all':!![]}];}_0x32bc3b=_[_0xbfc9('0x9c')]({},_0x32bc3b,_0x2124df[_0xbfc9('0xb5')]);return db[_0xbfc9('0x9d')][_0xbfc9('0x6f')](_0x32bc3b)['then'](handleEntityNotFound(_0x290968,null))['then'](respondWithResult(_0x290968,null))[_0xbfc9('0x38')](handleError(_0x290968,null));};exports[_0xbfc9('0xb6')]=function(_0xb1f160,_0x4fc611){return db[_0xbfc9('0x9d')][_0xbfc9('0xb6')](_0xb1f160[_0xbfc9('0xb7')],{})[_0xbfc9('0x37')](respondWithResult(_0x4fc611,0xc9))[_0xbfc9('0x38')](handleError(_0x4fc611,null));};exports[_0xbfc9('0x2b')]=function(_0x4b8c58,_0x494679){if(_0x4b8c58[_0xbfc9('0xb7')]['id']){delete _0x4b8c58[_0xbfc9('0xb7')]['id'];}return db[_0xbfc9('0x9d')][_0xbfc9('0x6f')]({'where':{'id':_0x4b8c58[_0xbfc9('0xb1')]['id']}})['then'](handleEntityNotFound(_0x494679,null))[_0xbfc9('0x37')](saveUpdates(_0x4b8c58['body'],null))['then'](respondWithResult(_0x494679,null))['catch'](handleError(_0x494679,null));};exports['destroy']=function(_0x4fefaf,_0x2ef4ac){return db[_0xbfc9('0x9d')]['find']({'where':{'id':_0x4fefaf[_0xbfc9('0xb1')]['id']}})[_0xbfc9('0x37')](handleEntityNotFound(_0x2ef4ac,null))[_0xbfc9('0x37')](removeEntity(_0x2ef4ac,null))['catch'](handleError(_0x2ef4ac,null));};exports['describe']=function(_0x3b155b,_0x3390d6){return db[_0xbfc9('0x9d')][_0xbfc9('0xb8')]()[_0xbfc9('0x37')](respondWithResult(_0x3390d6,null))[_0xbfc9('0x38')](handleError(_0x3390d6,null));};exports[_0xbfc9('0xb9')]=function(_0x15af3b,_0x1bc741,_0x1a4913){return db[_0xbfc9('0xba')]['find']({'where':{'id':_0x15af3b[_0xbfc9('0xb1')]['id']}})[_0xbfc9('0x37')](handleEntityNotFound(_0x1bc741,null))[_0xbfc9('0x37')](function(_0x52b314){if(_0x52b314){return _0x52b314[_0xbfc9('0xb9')](_0x15af3b[_0xbfc9('0xb7')][_0xbfc9('0xbb')],_[_0xbfc9('0xbc')](_0x15af3b[_0xbfc9('0xb7')],['ids','id'])||{});}})['then'](respondWithResult(_0x1bc741,null))[_0xbfc9('0x38')](handleError(_0x1bc741,null));};exports[_0xbfc9('0xbd')]=function(_0x3d7be5,_0x2061c3,_0x37e7a5){var _0x4d96cb={'raw':![],'where':{}};var _0x26c671={};var _0x4ab4a3={'count':0x0,'rows':[]};return db['OpenchannelInteraction'][_0xbfc9('0xbe')]({'where':{'id':_0x3d7be5['params']['id']}})['then'](handleEntityNotFound(_0x2061c3,null))['then'](function(_0x1a983a){if(_0x1a983a){_0x26c671[_0xbfc9('0x43')]=_[_0xbfc9('0x45')](db[_0xbfc9('0xba')][_0xbfc9('0x41')]);_0x26c671[_0xbfc9('0x44')]=_[_0xbfc9('0x45')](_0x3d7be5[_0xbfc9('0x44')]);_0x26c671['filters']=_[_0xbfc9('0xb2')](_0x26c671[_0xbfc9('0x43')],_0x26c671[_0xbfc9('0x44')]);_0x4d96cb[_0xbfc9('0x47')]=_[_0xbfc9('0xb2')](_0x26c671[_0xbfc9('0x43')],qs[_0xbfc9('0x48')](_0x3d7be5['query'][_0xbfc9('0x48')]));_0x4d96cb['attributes']=_0x4d96cb[_0xbfc9('0x47')]['length']?_0x4d96cb[_0xbfc9('0x47')]:_0x26c671[_0xbfc9('0x43')];if(!_0x3d7be5[_0xbfc9('0x44')]['hasOwnProperty'](_0xbfc9('0x4b'))){_0x4d96cb[_0xbfc9('0x24')]=qs[_0xbfc9('0x24')](_0x3d7be5[_0xbfc9('0x44')][_0xbfc9('0x24')]);_0x4d96cb[_0xbfc9('0x23')]=qs['offset'](_0x3d7be5[_0xbfc9('0x44')]['offset']);}_0x4d96cb['order']=qs[_0xbfc9('0x4d')](_0x3d7be5[_0xbfc9('0x44')][_0xbfc9('0x4d')]);_0x4d96cb[_0xbfc9('0x4e')]=qs[_0xbfc9('0x46')](_[_0xbfc9('0xbf')](_0x3d7be5['query'],_0x26c671[_0xbfc9('0x46')]));_0x4d96cb[_0xbfc9('0x4e')][_0xbfc9('0xad')]=_0x1a983a['id'];if(_0x3d7be5[_0xbfc9('0x44')][_0xbfc9('0x86')]){_0x4d96cb[_0xbfc9('0x4e')]=_[_0xbfc9('0x9c')](_0x4d96cb[_0xbfc9('0x4e')],{'$or':_['map'](_0x4d96cb[_0xbfc9('0x47')],function(_0x556382){var _0x10621d={};_0x10621d[_0x556382]={'$like':'%'+_0x3d7be5[_0xbfc9('0x44')][_0xbfc9('0x86')]+'%'};return _0x10621d;})});}if(_0x3d7be5[_0xbfc9('0x44')][_0xbfc9('0x7e')]){var _0x3267a6=_0x3d7be5[_0xbfc9('0x44')][_0xbfc9('0x7e')]['split'](',');var _0x56cb58={};_0x56cb58[_0x3267a6[0x0]]={'$gte':moment(_0x3267a6[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x4d96cb[_0xbfc9('0x4e')]=_[_0xbfc9('0x9c')](_0x4d96cb['where'],_0x56cb58);}_0x4d96cb=_[_0xbfc9('0x9c')]({},_0x4d96cb,_0x3d7be5['options']);return db[_0xbfc9('0xba')][_0xbfc9('0x26')]({'where':_0x4d96cb[_0xbfc9('0x4e')]})[_0xbfc9('0x37')](function(_0x16992d){_0x4ab4a3['count']=_0x16992d;if(_0x3d7be5['query']['includeAll']){_0x4d96cb[_0xbfc9('0xb4')]=[{'all':!![]}];}return db[_0xbfc9('0xba')][_0xbfc9('0xc0')](_0x4d96cb);})[_0xbfc9('0x37')](function(_0x16ce0b){_0x4ab4a3[_0xbfc9('0xaf')]=_0x16ce0b;return _0x4ab4a3;});}})[_0xbfc9('0x37')](respondWithFilteredResult(_0x2061c3,_0x4d96cb))['catch'](handleError(_0x2061c3,null));};exports['addTags']=function(_0x41f775,_0x193baf,_0x22c333){return db['OpenchannelInteraction'][_0xbfc9('0x6f')]({'where':{'id':_0x41f775[_0xbfc9('0xb1')]['id']}})[_0xbfc9('0x37')](handleEntityNotFound(_0x193baf,null))[_0xbfc9('0x37')](function(_0x185c28){if(_0x185c28){return _0x185c28[_0xbfc9('0xc1')](_0x41f775[_0xbfc9('0xb7')][_0xbfc9('0xbb')],_[_0xbfc9('0xbc')](_0x41f775['body'],['ids','id'])||{})['spread'](function(){return db[_0xbfc9('0x74')][_0xbfc9('0xc0')]({'attributes':['id','name',_0xbfc9('0x51')],'where':{'id':_0x41f775[_0xbfc9('0xb7')][_0xbfc9('0xbb')]}});})['then'](function(_0x3b497e){socket[_0xbfc9('0xc2')](_0xbfc9('0xc3'),{'id':Number(_0x41f775['params']['id']),'tags':_0x3b497e||[]});return{'id':Number(_0x41f775[_0xbfc9('0xb1')]['id']),'tags':_0x3b497e||[]};});}})[_0xbfc9('0x37')](respondWithResult(_0x193baf,null))['catch'](handleError(_0x193baf,null));};exports[_0xbfc9('0xc4')]=function(_0x3303e5,_0x445841,_0x573a92){return db[_0xbfc9('0x9d')][_0xbfc9('0x6f')]({'where':{'id':_0x3303e5[_0xbfc9('0xb1')]['id']}})[_0xbfc9('0x37')](handleEntityNotFound(_0x445841,null))[_0xbfc9('0x37')](function(_0x12379f){if(_0x12379f){return _0x12379f[_0xbfc9('0xc4')](_0x3303e5['query'][_0xbfc9('0xbb')]);}})['then'](respondWithStatusCode(_0x445841,null))[_0xbfc9('0x38')](handleError(_0x445841,null));};exports['download']=function(_0x53db4f,_0x1ea78d){var _0x5222da=moment()['unix']()[_0xbfc9('0x9b')]();var _0x1d9a03=path[_0xbfc9('0xc5')](config[_0xbfc9('0xc6')],'server',_0xbfc9('0xc7'),_0xbfc9('0xc8'));var _0x1f1ebe=path[_0xbfc9('0xc5')](config[_0xbfc9('0xc6')],_0xbfc9('0xc9'),_0xbfc9('0xc7'),_0xbfc9('0xca'));var _0x2f50f5=path[_0xbfc9('0xc5')](_0x1d9a03,_0x5222da);var _0x32ce9a=util[_0xbfc9('0xcb')](_0xbfc9('0xcc'),_0x53db4f[_0xbfc9('0xb1')]['id'],_0x5222da);var _0xcd3a61=path[_0xbfc9('0xc5')](_0x1d9a03,_0x32ce9a);var _0x28e508=[];_0x28e508[_0xbfc9('0x36')]({'model':db[_0xbfc9('0x76')],'as':_0xbfc9('0x76'),'attributes':['id','fullname'],'raw':!![]});_0x28e508[_0xbfc9('0x36')]({'model':db[_0xbfc9('0xcd')],'as':_0xbfc9('0xce'),'attributes':['id',_0xbfc9('0xcf'),_0xbfc9('0xd0')],'raw':!![]});if(_0x53db4f['query'][_0xbfc9('0xca')]){_0x28e508['push']({'model':db[_0xbfc9('0xd1')],'as':_0xbfc9('0xd1'),'raw':!![]});}var _0x3bafa8=[{'model':db[_0xbfc9('0xba')],'as':'Messages','attributes':['id',_0xbfc9('0xb7'),_0xbfc9('0x7c'),_0xbfc9('0xd2'),'secret',_0xbfc9('0x81')],'include':_0x28e508}];_0x3bafa8[_0xbfc9('0x36')]({'model':db['OpenchannelAccount'],'as':'Account','attributes':['id','name']});_0x3bafa8[_0xbfc9('0x36')]({'model':db['User'],'as':_0xbfc9('0xd3'),'attributes':['id','fullname']});return db[_0xbfc9('0x9d')]['find']({'where':{'id':_0x53db4f['params']['id']},'include':_0x3bafa8})['then'](handleEntityNotFound(_0x1ea78d,null))[_0xbfc9('0x37')](function(_0x5198aa){if(_0x5198aa){var _0x2767e8=_0x5198aa[_0xbfc9('0xd4')]({'plain':!![]});fs[_0xbfc9('0xd5')](_0x2f50f5);var _0x1b3494={'channel':_0xbfc9('0xd6'),'account':_0x2767e8[_0xbfc9('0xd7')][_0xbfc9('0x2f')],'agent':_0x2767e8[_0xbfc9('0xd3')]?_0x2767e8[_0xbfc9('0xd3')][_0xbfc9('0x32')]:'N.A.','createdAt':moment(_0x2767e8['createdAt'])['format'](_0xbfc9('0xd8'))['toString'](),'closedAt':_0x2767e8[_0xbfc9('0x3b')]?moment(_0x2767e8[_0xbfc9('0xd9')])[_0xbfc9('0xcb')](_0xbfc9('0xd8'))[_0xbfc9('0x9b')]():'','disposition':_0x2767e8[_0xbfc9('0xda')],'visibility':_0x2767e8[_0xbfc9('0xdb')]?_0xbfc9('0xdc'):_0xbfc9('0xdd'),'messages':_(_0x2767e8[_0xbfc9('0xde')])[_0xbfc9('0x86')]({'secret':![]})['map'](function(_0x57fb2e){if(_0x57fb2e[_0xbfc9('0xd1')]){var _0x2ccb75=path['join'](_0x1f1ebe,_0x57fb2e[_0xbfc9('0xd1')][_0xbfc9('0xdf')]);if(fs[_0xbfc9('0xe0')](_0x2ccb75)){fs[_0xbfc9('0xe1')](_0x2ccb75)[_0xbfc9('0xe2')](fs[_0xbfc9('0xe3')](path[_0xbfc9('0xc5')](_0x2f50f5,_0x57fb2e['Attachment'][_0xbfc9('0xdf')])));}}return{'date':moment(_0x57fb2e[_0xbfc9('0x7c')])[_0xbfc9('0xcb')](_0xbfc9('0xd8'))['toString'](),'sender':_0x57fb2e[_0xbfc9('0xd2')]===_0xbfc9('0xe4')?_0x57fb2e[_0xbfc9('0x76')]?_0x57fb2e[_0xbfc9('0x76')][_0xbfc9('0x32')]:_0xbfc9('0xe5'):_0x57fb2e[_0xbfc9('0xce')][_0xbfc9('0xcf')]+(_0x57fb2e[_0xbfc9('0xce')][_0xbfc9('0xd0')]?'\x20'+_0x57fb2e['Contact']['lastName']:''),'body':_0x57fb2e['Attachment']?_0x57fb2e['Attachment'][_0xbfc9('0xdf')]:_0x57fb2e['body'],'direction':_0x57fb2e['direction']===_0xbfc9('0xe4')?'A':'C','secret':_0x57fb2e[_0xbfc9('0xe6')],'read':_0x57fb2e[_0xbfc9('0x81')],'attachment':_0x57fb2e[_0xbfc9('0xd1')]};})['value']()};return ejs[_0xbfc9('0xe7')](path['join'](config[_0xbfc9('0xc6')],'server',_0xbfc9('0xe8'),'downloadInteraction.ejs'),{'interaction':_0x1b3494})[_0xbfc9('0x37')](function(_0x4dffef){var _0x2a5a87=path[_0xbfc9('0xc5')](_0x2f50f5,_0xbfc9('0xe9')+_0x2767e8['id']+'-'+_0x5222da+_0xbfc9('0xea'));var _0x5b773d={'path':_0x2a5a87,'channel':_0xbfc9('0xd6'),'interactionId':_0x2767e8['id']};return pdf['createPdfFromHTML'](_0x4dffef,_0x5b773d);})[_0xbfc9('0x37')](function(){return new BPromise(function(_0x176d93,_0x1eea4f){zipdir(_0x2f50f5,{'saveTo':_0xcd3a61},function(_0x32580e,_0x5a79de){if(_0x32580e)return _0x1eea4f(_0x32580e);return _0x176d93(_0x5a79de);});})[_0xbfc9('0x37')](function(){return new BPromise(function(_0x2772d5,_0x4c8207){rimraf(_0x2f50f5,function(_0xf5f493){if(_0xf5f493)_0x4c8207(_0xf5f493);return _0x2772d5();});});})[_0xbfc9('0x37')](function(){return _0x1ea78d['download'](_0xcd3a61,_0x32ce9a,function(_0x269e55){if(_0x269e55){console[_0xbfc9('0xeb')](_0xbfc9('0xec'),_0x269e55);}else{fs[_0xbfc9('0xed')](_0xcd3a61);}});});});}else{return _0x1ea78d[_0xbfc9('0x2e')](0xc8);}})[_0xbfc9('0x38')](handleError(_0x1ea78d,null));};
\ No newline at end of file
index 73cffa5..e55b8ad 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x866c=['getUsers','then','setDataValue','Users','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','OpenchannelInteraction','../../mysqldb','OpenchannelMessage','setMaxListeners','update','remove'];(function(_0x31e48f,_0x319a31){var _0x36d6c2=function(_0x32c259){while(--_0x32c259){_0x31e48f['push'](_0x31e48f['shift']());}};_0x36d6c2(++_0x319a31);}(_0x866c,0xa4));var _0xc866=function(_0x17c0b4,_0x126886){_0x17c0b4=_0x17c0b4-0x0;var _0x6e45e6=_0x866c[_0x17c0b4];return _0x6e45e6;};'use strict';var EventEmitter=require(_0xc866('0x0'));var OpenchannelInteraction=require('../../mysqldb')['db'][_0xc866('0x1')];var OpenchannelMessage=require(_0xc866('0x2'))['db'][_0xc866('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0xc866('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0xc866('0x5'),'afterDestroy':_0xc866('0x6')};function emitEvent(_0x60e50f){return function(_0x5cd63b,_0x3448db,_0x3d6cb1){_0x5cd63b[_0xc866('0x7')]({'attributes':['id'],'raw':!![]})[_0xc866('0x8')](function(_0x25cfb1){_0x5cd63b[_0xc866('0x9')](_0xc866('0xa'),_0x25cfb1['map'](function(_0x2e8737){return{'id':_0x2e8737['id']};}));return OpenchannelMessage[_0xc866('0xb')]({'where':{'OpenchannelInteractionId':_0x5cd63b['id'],'direction':'in','read':![]},'raw':!![]});})[_0xc866('0x8')](function(_0x34a7ec){_0x5cd63b[_0xc866('0x9')](_0xc866('0xc'),_0x34a7ec[_0xc866('0xd')]);OpenchannelInteractionEvents[_0xc866('0xe')](_0x60e50f+':'+_0x5cd63b['id'],_0x5cd63b);OpenchannelInteractionEvents[_0xc866('0xe')](_0x60e50f,_0x5cd63b);_0x3d6cb1(null);})[_0xc866('0xf')](_0x3d6cb1(null));};}for(var e in events){if(events[_0xc866('0x10')](e)){var event=events[e];OpenchannelInteraction[_0xc866('0x11')](e,emitEvent(event));}}module[_0xc866('0x12')]=OpenchannelInteractionEvents;
\ No newline at end of file
+var _0x82f9=['../../mysqldb','OpenchannelInteraction','OpenchannelMessage','setMaxListeners','save','update','remove','then','setDataValue','Users','map','unreadMessages','length','emit','catch','hasOwnProperty','hook','events'];(function(_0x43bd3c,_0x3bd12d){var _0x1cbb21=function(_0x30d12e){while(--_0x30d12e){_0x43bd3c['push'](_0x43bd3c['shift']());}};_0x1cbb21(++_0x3bd12d);}(_0x82f9,0x7d));var _0x982f=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0x82f9[_0x3b5250];return _0xc844a1;};'use strict';var EventEmitter=require(_0x982f('0x0'));var OpenchannelInteraction=require(_0x982f('0x1'))['db'][_0x982f('0x2')];var OpenchannelMessage=require(_0x982f('0x1'))['db'][_0x982f('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x982f('0x4')](0x0);var events={'afterCreate':_0x982f('0x5'),'afterUpdate':_0x982f('0x6'),'afterDestroy':_0x982f('0x7')};function emitEvent(_0x314345){return function(_0x2cd5bb,_0x277127,_0x2181af){_0x2cd5bb['getUsers']({'attributes':['id'],'raw':!![]})[_0x982f('0x8')](function(_0x137b38){_0x2cd5bb[_0x982f('0x9')](_0x982f('0xa'),_0x137b38[_0x982f('0xb')](function(_0x880c4c){return{'id':_0x880c4c['id']};}));return OpenchannelMessage['findAll']({'where':{'OpenchannelInteractionId':_0x2cd5bb['id'],'direction':'in','read':![]},'raw':!![]});})[_0x982f('0x8')](function(_0x248ac9){_0x2cd5bb[_0x982f('0x9')](_0x982f('0xc'),_0x248ac9[_0x982f('0xd')]);OpenchannelInteractionEvents[_0x982f('0xe')](_0x314345+':'+_0x2cd5bb['id'],_0x2cd5bb);OpenchannelInteractionEvents['emit'](_0x314345,_0x2cd5bb);_0x2181af(null);})[_0x982f('0xf')](_0x2181af(null));};}for(var e in events){if(events[_0x982f('0x10')](e)){var event=events[e];OpenchannelInteraction[_0x982f('0x11')](e,emitEvent(event));}}module['exports']=OpenchannelInteractionEvents;
\ No newline at end of file
index ff0314a..4f95ae4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6b2a=['exports','define','OpenchannelInteraction','openchannel_interactions','utf8mb4','utf8mb4_unicode_ci','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','bluebird','path','../../config/environment','./openchannelInteraction.attributes'];(function(_0xc195c7,_0x5a609d){var _0x58c78c=function(_0xdf3228){while(--_0xdf3228){_0xc195c7['push'](_0xc195c7['shift']());}};_0x58c78c(++_0x5a609d);}(_0x6b2a,0xeb));var _0xa6b2=function(_0x27aafe,_0x53f25f){_0x27aafe=_0x27aafe-0x0;var _0x2cecae=_0x6b2a[_0x27aafe];return _0x2cecae;};'use strict';var _=require(_0xa6b2('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xa6b2('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa6b2('0x2'));var rimraf=require('rimraf');var config=require(_0xa6b2('0x3'));var attributes=require(_0xa6b2('0x4'));module[_0xa6b2('0x5')]=function(_0x3d478a,_0x572763){return _0x3d478a[_0xa6b2('0x6')](_0xa6b2('0x7'),attributes,{'tableName':_0xa6b2('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa6b2('0x9'),'collate':_0xa6b2('0xa'),'hooks':{'beforeUpdate':function(_0x67c60e,_0x301dec,_0xb6bf8a){if(_0x67c60e[_0xa6b2('0xb')](_0xa6b2('0xc'))){_0x67c60e[_0xa6b2('0xd')]=moment()[_0xa6b2('0xe')](_0xa6b2('0xf'));}_0xb6bf8a(null,_0x67c60e);}}});};
\ No newline at end of file
+var _0x9979=['openchannel_interactions','utf8mb4_unicode_ci','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','define','OpenchannelInteraction'];(function(_0x311185,_0x2f990b){var _0x27cad3=function(_0xe0119e){while(--_0xe0119e){_0x311185['push'](_0x311185['shift']());}};_0x27cad3(++_0x2f990b);}(_0x9979,0x166));var _0x9997=function(_0x1b24e4,_0x51977b){_0x1b24e4=_0x1b24e4-0x0;var _0x1573fe=_0x9979[_0x1b24e4];return _0x1573fe;};'use strict';var _=require(_0x9997('0x0'));var util=require(_0x9997('0x1'));var logger=require(_0x9997('0x2'))(_0x9997('0x3'));var moment=require(_0x9997('0x4'));var BPromise=require(_0x9997('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9997('0x6'));var rimraf=require('rimraf');var config=require(_0x9997('0x7'));var attributes=require('./openchannelInteraction.attributes');module['exports']=function(_0x58765c,_0x573fa9){return _0x58765c[_0x9997('0x8')](_0x9997('0x9'),attributes,{'tableName':_0x9997('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x9997('0xb'),'hooks':{'beforeUpdate':function(_0x5a32a2,_0x201228,_0x4a4283){if(_0x5a32a2[_0x9997('0xc')]('closed')){_0x5a32a2[_0x9997('0xd')]=moment()[_0x9997('0xe')](_0x9997('0xf'));}_0x4a4283(null,_0x5a32a2);}}});};
\ No newline at end of file
index c60be94..3c84fc8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x122c=['moment','../../mysqldb','../../config/utils','../../config/logger','rpc','http','defaults','redis','localhost','./openchannelInteraction.socket','register','request','then','info','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','code','error','OpenchannelInteraction,\x20%s,\x20%s','message','result','UpdateOpenchannelInteraction','OpenchannelInteraction','update','options','raw','where','attributes','limit','catch','find','addTags','ids','omit','body','spread','AddTags','util'];(function(_0x525dbd,_0x5b75cd){var _0x1a8ff0=function(_0x471ff0){while(--_0x471ff0){_0x525dbd['push'](_0x525dbd['shift']());}};_0x1a8ff0(++_0x5b75cd);}(_0x122c,0x9f));var _0xc122=function(_0x12a395,_0x1cf7c9){_0x12a395=_0x12a395-0x0;var _0x3486a6=_0x122c[_0x12a395];return _0x3486a6;};'use strict';var _=require('lodash');var util=require(_0xc122('0x0'));var moment=require(_0xc122('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc122('0x2'))['db'];var utils=require(_0xc122('0x3'));var logger=require(_0xc122('0x4'))(_0xc122('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xc122('0x6')]({'port':0x232a});config['redis']=_[_0xc122('0x7')](config[_0xc122('0x8')],{'host':_0xc122('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc122('0x8')]));require(_0xc122('0xa'))[_0xc122('0xb')](socket);function respondWithRpcPromise(_0x237082,_0x30f4fe,_0x3759ec){return new BPromise(function(_0x3de71a,_0x4f6fcc){return client[_0xc122('0xc')](_0x237082,_0x3759ec)[_0xc122('0xd')](function(_0x554fd3){logger[_0xc122('0xe')]('OpenchannelInteraction,\x20%s,\x20%s',_0x30f4fe,_0xc122('0xf'));logger[_0xc122('0x10')](_0xc122('0x11'),_0x30f4fe,_0xc122('0xf'),JSON[_0xc122('0x12')](_0x554fd3));if(_0x554fd3['error']){if(_0x554fd3['error'][_0xc122('0x13')]===0x1f4){logger[_0xc122('0x14')]('OpenchannelInteraction,\x20%s,\x20%s',_0x30f4fe,_0x554fd3[_0xc122('0x14')]['message']);return _0x4f6fcc(_0x554fd3[_0xc122('0x14')]['message']);}logger[_0xc122('0x14')](_0xc122('0x15'),_0x30f4fe,_0x554fd3['error']['message']);return _0x3de71a(_0x554fd3[_0xc122('0x14')][_0xc122('0x16')]);}else{logger['info']('OpenchannelInteraction,\x20%s,\x20%s',_0x30f4fe,_0xc122('0xf'));_0x3de71a(_0x554fd3[_0xc122('0x17')][_0xc122('0x16')]);}})['catch'](function(_0x305ccf){logger[_0xc122('0x14')](_0xc122('0x15'),_0x30f4fe,_0x305ccf);_0x4f6fcc(_0x305ccf);});});}exports[_0xc122('0x18')]=function(_0x24576f){var _0x39223e=this;return new Promise(function(_0x441337,_0x55d638){return db[_0xc122('0x19')][_0xc122('0x1a')](_0x24576f['body'],{'raw':_0x24576f[_0xc122('0x1b')]?_0x24576f[_0xc122('0x1b')][_0xc122('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x24576f[_0xc122('0x1b')]?_0x24576f[_0xc122('0x1b')][_0xc122('0x1d')]||null:null,'attributes':_0x24576f[_0xc122('0x1b')]?_0x24576f[_0xc122('0x1b')][_0xc122('0x1e')]||null:null,'limit':_0x24576f[_0xc122('0x1b')]?_0x24576f[_0xc122('0x1b')][_0xc122('0x1f')]||null:null})['then'](function(_0x397403){logger[_0xc122('0xe')](_0xc122('0x18'),_0x24576f);logger[_0xc122('0x10')](_0xc122('0x18'),_0x24576f,JSON['stringify'](_0x397403));_0x441337(_0x397403);})[_0xc122('0x20')](function(_0xff528a){logger[_0xc122('0x14')]('UpdateOpenchannelInteraction',_0xff528a['message'],_0x24576f);_0x55d638(_0x39223e['error'](0x1f4,_0xff528a[_0xc122('0x16')]));});});};exports['AddTagsToOpenchannelInteraction']=function(_0x5cea99){return new Promise(function(_0x29d79b,_0x16213c){return db[_0xc122('0x19')][_0xc122('0x21')]({'where':_0x5cea99[_0xc122('0x1b')]?_0x5cea99[_0xc122('0x1b')]['where']||null:null})[_0xc122('0xd')](function(_0x59e8a2){if(_0x59e8a2){return _0x59e8a2[_0xc122('0x22')](_0x5cea99['body'][_0xc122('0x23')],_[_0xc122('0x24')](_0x5cea99[_0xc122('0x25')],[_0xc122('0x23'),'id'])||{});}})[_0xc122('0x26')](function(_0x4f810f){logger[_0xc122('0xe')]('AddTags',_0x5cea99);logger['debug'](_0xc122('0x27'),_0x5cea99,JSON[_0xc122('0x12')](_0x4f810f));_0x29d79b(_0x4f810f);})[_0xc122('0x20')](function(_0x4ae882){logger['error'](_0xc122('0x27'),_0x4ae882[_0xc122('0x16')],_0x5cea99);_0x16213c(_this['error'](0x1f4,_0x4ae882[_0xc122('0x16')]));});});};
\ No newline at end of file
+var _0x72b4=['redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','request','then','info','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','OpenchannelInteraction,\x20%s,\x20%s','message','result','catch','body','options','raw','where','attributes','UpdateOpenchannelInteraction','AddTagsToOpenchannelInteraction','find','addTags','ids','omit','spread','AddTags','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x5d3379,_0x33e21b){var _0xacfdb4=function(_0x18b910){while(--_0x18b910){_0x5d3379['push'](_0x5d3379['shift']());}};_0xacfdb4(++_0x33e21b);}(_0x72b4,0x19a));var _0x472b=function(_0x4e752e,_0x479543){_0x4e752e=_0x4e752e-0x0;var _0x2392b0=_0x72b4[_0x4e752e];return _0x2392b0;};'use strict';var _=require('lodash');var util=require(_0x472b('0x0'));var moment=require(_0x472b('0x1'));var BPromise=require(_0x472b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x472b('0x3'));var db=require(_0x472b('0x4'))['db'];var utils=require(_0x472b('0x5'));var logger=require(_0x472b('0x6'))('rpc');var config=require(_0x472b('0x7'));var jayson=require(_0x472b('0x8'));var client=jayson[_0x472b('0x9')]['http']({'port':0x232a});config[_0x472b('0xa')]=_[_0x472b('0xb')](config[_0x472b('0xa')],{'host':_0x472b('0xc'),'port':0x18eb});var socket=require(_0x472b('0xd'))(new Redis(config[_0x472b('0xa')]));require(_0x472b('0xe'))[_0x472b('0xf')](socket);function respondWithRpcPromise(_0x725580,_0x4ae6f5,_0x18b8cf){return new BPromise(function(_0x335893,_0x484c6f){return client[_0x472b('0x10')](_0x725580,_0x18b8cf)[_0x472b('0x11')](function(_0x18caba){logger[_0x472b('0x12')]('OpenchannelInteraction,\x20%s,\x20%s',_0x4ae6f5,'request\x20sent');logger[_0x472b('0x13')](_0x472b('0x14'),_0x4ae6f5,_0x472b('0x15'),JSON[_0x472b('0x16')](_0x18caba));if(_0x18caba[_0x472b('0x17')]){if(_0x18caba[_0x472b('0x17')][_0x472b('0x18')]===0x1f4){logger[_0x472b('0x17')](_0x472b('0x19'),_0x4ae6f5,_0x18caba['error'][_0x472b('0x1a')]);return _0x484c6f(_0x18caba[_0x472b('0x17')][_0x472b('0x1a')]);}logger['error']('OpenchannelInteraction,\x20%s,\x20%s',_0x4ae6f5,_0x18caba['error'][_0x472b('0x1a')]);return _0x335893(_0x18caba[_0x472b('0x17')]['message']);}else{logger[_0x472b('0x12')](_0x472b('0x19'),_0x4ae6f5,'request\x20sent');_0x335893(_0x18caba[_0x472b('0x1b')][_0x472b('0x1a')]);}})[_0x472b('0x1c')](function(_0xe21264){logger[_0x472b('0x17')](_0x472b('0x19'),_0x4ae6f5,_0xe21264);_0x484c6f(_0xe21264);});});}exports['UpdateOpenchannelInteraction']=function(_0x318fdb){var _0x497105=this;return new Promise(function(_0x512911,_0x33e8e0){return db['OpenchannelInteraction']['update'](_0x318fdb[_0x472b('0x1d')],{'raw':_0x318fdb[_0x472b('0x1e')]?_0x318fdb[_0x472b('0x1e')][_0x472b('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x318fdb[_0x472b('0x1e')]?_0x318fdb[_0x472b('0x1e')][_0x472b('0x20')]||null:null,'attributes':_0x318fdb['options']?_0x318fdb[_0x472b('0x1e')][_0x472b('0x21')]||null:null,'limit':_0x318fdb['options']?_0x318fdb[_0x472b('0x1e')]['limit']||null:null})[_0x472b('0x11')](function(_0x31b2cb){logger[_0x472b('0x12')](_0x472b('0x22'),_0x318fdb);logger['debug']('UpdateOpenchannelInteraction',_0x318fdb,JSON[_0x472b('0x16')](_0x31b2cb));_0x512911(_0x31b2cb);})['catch'](function(_0x1c91e0){logger[_0x472b('0x17')](_0x472b('0x22'),_0x1c91e0[_0x472b('0x1a')],_0x318fdb);_0x33e8e0(_0x497105[_0x472b('0x17')](0x1f4,_0x1c91e0[_0x472b('0x1a')]));});});};exports[_0x472b('0x23')]=function(_0x29feb7){return new Promise(function(_0x1f8fbf,_0x312b1d){return db['OpenchannelInteraction'][_0x472b('0x24')]({'where':_0x29feb7['options']?_0x29feb7['options'][_0x472b('0x20')]||null:null})[_0x472b('0x11')](function(_0x45caa9){if(_0x45caa9){return _0x45caa9[_0x472b('0x25')](_0x29feb7['body'][_0x472b('0x26')],_[_0x472b('0x27')](_0x29feb7['body'],[_0x472b('0x26'),'id'])||{});}})[_0x472b('0x28')](function(_0x181c7c){logger[_0x472b('0x12')](_0x472b('0x29'),_0x29feb7);logger[_0x472b('0x13')](_0x472b('0x29'),_0x29feb7,JSON[_0x472b('0x16')](_0x181c7c));_0x1f8fbf(_0x181c7c);})['catch'](function(_0x5a76da){logger['error'](_0x472b('0x29'),_0x5a76da['message'],_0x29feb7);_0x312b1d(_this['error'](0x1f4,_0x5a76da[_0x472b('0x1a')]));});});};
\ No newline at end of file
index 16052a2..71b8b9f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc537=['update','emit','removeListener','register','openchannelInteraction:','./openchannelInteraction.events','save','remove'];(function(_0x5eed57,_0x36dfae){var _0x18a0af=function(_0x470671){while(--_0x470671){_0x5eed57['push'](_0x5eed57['shift']());}};_0x18a0af(++_0x36dfae);}(_0xc537,0x185));var _0x7c53=function(_0x3e61a7,_0x5a39b3){_0x3e61a7=_0x3e61a7-0x0;var _0x17b501=_0xc537[_0x3e61a7];return _0x17b501;};'use strict';var OpenchannelInteractionEvents=require(_0x7c53('0x0'));var events=[_0x7c53('0x1'),_0x7c53('0x2'),_0x7c53('0x3')];function createListener(_0x433ef9,_0x3abed2){return function(_0x4fcba3){_0x3abed2[_0x7c53('0x4')](_0x433ef9,_0x4fcba3);};}function removeListener(_0x4c8864,_0x5599c4){return function(){OpenchannelInteractionEvents[_0x7c53('0x5')](_0x4c8864,_0x5599c4);};}exports[_0x7c53('0x6')]=function(_0x44a3ae){for(var _0x517024=0x0,_0x1713c5=events['length'];_0x517024<_0x1713c5;_0x517024++){var _0x21a552=events[_0x517024];var _0x55148c=createListener(_0x7c53('0x7')+_0x21a552,_0x44a3ae);OpenchannelInteractionEvents['on'](_0x21a552,_0x55148c);}};
\ No newline at end of file
+var _0x3a4d=['update','emit','removeListener','register','length','openchannelInteraction:','./openchannelInteraction.events','remove'];(function(_0x3f338e,_0x16e8dc){var _0x4857bb=function(_0xf63eb0){while(--_0xf63eb0){_0x3f338e['push'](_0x3f338e['shift']());}};_0x4857bb(++_0x16e8dc);}(_0x3a4d,0x166));var _0xd3a4=function(_0x2c2a8e,_0x1dfe39){_0x2c2a8e=_0x2c2a8e-0x0;var _0x3b9e38=_0x3a4d[_0x2c2a8e];return _0x3b9e38;};'use strict';var OpenchannelInteractionEvents=require(_0xd3a4('0x0'));var events=['save',_0xd3a4('0x1'),_0xd3a4('0x2')];function createListener(_0x5a6a9f,_0x3986e3){return function(_0x4c34ce){_0x3986e3[_0xd3a4('0x3')](_0x5a6a9f,_0x4c34ce);};}function removeListener(_0x53511b,_0x40efed){return function(){OpenchannelInteractionEvents[_0xd3a4('0x4')](_0x53511b,_0x40efed);};}exports[_0xd3a4('0x5')]=function(_0x18a3f2){for(var _0x29e268=0x0,_0x24a746=events[_0xd3a4('0x6')];_0x29e268<_0x24a746;_0x29e268++){var _0x593228=events[_0x29e268];var _0x42fca7=createListener(_0xd3a4('0x7')+_0x593228,_0x18a3f2);OpenchannelInteractionEvents['on'](_0x593228,_0x42fca7);}};
\ No newline at end of file
index 66387cb..7a5fd64 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0713=['get','isAuthenticated','index','/describe','describe','/:id','post','tracked','openchannel','openchannelmessage:create','put','update','accept','/:id/reject','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./openchannelMessage.controller'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var controller=require(_0x3071('0x7'));router[_0x3071('0x8')]('/',auth[_0x3071('0x9')](),controller[_0x3071('0xa')]);router[_0x3071('0x8')](_0x3071('0xb'),auth[_0x3071('0x9')](),controller[_0x3071('0xc')]);router[_0x3071('0x8')](_0x3071('0xd'),auth[_0x3071('0x9')](),controller['show']);router[_0x3071('0xe')]('/',auth[_0x3071('0x9')](),interaction[_0x3071('0xf')](_0x3071('0x10'),_0x3071('0x11')),controller['create']);router[_0x3071('0x12')](_0x3071('0xd'),auth[_0x3071('0x9')](),controller[_0x3071('0x13')]);router[_0x3071('0x12')]('/:id/accept',auth['isAuthenticated'](),controller[_0x3071('0x14')]);router['put'](_0x3071('0x15'),auth[_0x3071('0x9')](),controller['reject']);router[_0x3071('0x16')]('/:id',auth[_0x3071('0x9')](),controller[_0x3071('0x17')]);module[_0x3071('0x18')]=router;
\ No newline at end of file
+var _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','post','tracked','openchannel','create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports'];(function(_0x201643,_0x214e15){var _0x47a3d8=function(_0x4e1852){while(--_0x4e1852){_0x201643['push'](_0x201643['shift']());}};_0x47a3d8(++_0x214e15);}(_0xedd9,0xfc));var _0x9edd=function(_0x304aa9,_0x12823b){_0x304aa9=_0x304aa9-0x0;var _0x43b9dd=_0xedd9[_0x304aa9];return _0x43b9dd;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');var controller=require(_0x9edd('0x8'));router[_0x9edd('0x9')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0xb')]);router['get'](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0xd')]);router[_0x9edd('0x9')](_0x9edd('0xe'),auth[_0x9edd('0xa')](),controller['show']);router[_0x9edd('0xf')]('/',auth['isAuthenticated'](),interaction[_0x9edd('0x10')](_0x9edd('0x11'),'openchannelmessage:create'),controller[_0x9edd('0x12')]);router[_0x9edd('0x13')]('/:id',auth[_0x9edd('0xa')](),controller[_0x9edd('0x14')]);router[_0x9edd('0x13')](_0x9edd('0x15'),auth[_0x9edd('0xa')](),controller[_0x9edd('0x16')]);router[_0x9edd('0x13')](_0x9edd('0x17'),auth['isAuthenticated'](),controller[_0x9edd('0x18')]);router[_0x9edd('0x19')](_0x9edd('0xe'),auth[_0x9edd('0xa')](),controller[_0x9edd('0x1a')]);module[_0x9edd('0x1b')]=router;
\ No newline at end of file
index bb0672c..ae31e47 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8130=['BOOLEAN','ENUM','out','STRING','sequelize','exports','medium'];(function(_0x329243,_0x2ff8a6){var _0x48b323=function(_0x1d53ea){while(--_0x1d53ea){_0x329243['push'](_0x329243['shift']());}};_0x48b323(++_0x2ff8a6);}(_0x8130,0x146));var _0x0813=function(_0x1746d9,_0x28ba59){_0x1746d9=_0x1746d9-0x0;var _0x1be4d2=_0x8130[_0x1746d9];return _0x1be4d2;};'use strict';var Sequelize=require(_0x0813('0x0'));module[_0x0813('0x1')]={'body':{'type':Sequelize['TEXT'](_0x0813('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x0813('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x0813('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x0813('0x4')]('in',_0x0813('0x5')),'defaultValue':_0x0813('0x5'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0x0813('0x6')]},'providerResponse':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x453b=['BOOLEAN','ENUM','out','DATE','STRING','sequelize','exports','TEXT','medium'];(function(_0x4b33e7,_0x37151a){var _0x37dfd9=function(_0x1be923){while(--_0x1be923){_0x4b33e7['push'](_0x4b33e7['shift']());}};_0x37dfd9(++_0x37151a);}(_0x453b,0x164));var _0xb453=function(_0x5ad220,_0x27407e){_0x5ad220=_0x5ad220-0x0;var _0xdec77d=_0x453b[_0x5ad220];return _0xdec77d;};'use strict';var Sequelize=require(_0xb453('0x0'));module[_0xb453('0x1')]={'body':{'type':Sequelize[_0xb453('0x2')](_0xb453('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xb453('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0xb453('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xb453('0x5')]('in',_0xb453('0x6')),'defaultValue':_0xb453('0x6'),'allowNull':![]},'readAt':{'type':Sequelize[_0xb453('0x7')]},'providerName':{'type':Sequelize[_0xb453('0x8')]},'providerResponse':{'type':Sequelize[_0xb453('0x2')]}};
\ No newline at end of file
index ebd84c4..ac82cee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xee05=['interaction','user','role','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','contact','User','agent','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','EventManager','acceptmessage','openchannel','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','event','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','ejs','fs-extra','squel','crypto','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','./openchannelMessage.socket','jayson/promise','client','info','request\x20sent','debug','stringify','error','code','OpenchannelMessage,\x20%s,\x20%s','message','result','catch','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','sendStatus','stack','name','OpenchannelMessage','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','includeAll','include','findAll','rows','show','params','options','create','body','find','destroy','describe','openchannel-interactions','accept','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','get','OpenchannelInteraction','OpenchannelInteractionId','isNil','read1stAt'];(function(_0x5447fd,_0x52a6b5){var _0x15b28a=function(_0x370d4f){while(--_0x370d4f){_0x5447fd['push'](_0x5447fd['shift']());}};_0x15b28a(++_0x52a6b5);}(_0xee05,0x9f));var _0x5ee0=function(_0x2d71e7,_0x18ba25){_0x2d71e7=_0x2d71e7-0x0;var _0x31c5b8=_0xee05[_0x2d71e7];return _0x31c5b8;};'use strict';var emlformat=require(_0x5ee0('0x0'));var rimraf=require(_0x5ee0('0x1'));var zipdir=require(_0x5ee0('0x2'));var jsonpatch=require(_0x5ee0('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5ee0('0x4'));var Mustache=require(_0x5ee0('0x5'));var util=require(_0x5ee0('0x6'));var path=require(_0x5ee0('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x5ee0('0x8'));var fs=require('fs');var fs_extra=require(_0x5ee0('0x9'));var _=require('lodash');var squel=require(_0x5ee0('0xa'));var crypto=require(_0x5ee0('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x5ee0('0xc'));var Papa=require(_0x5ee0('0xd'));var Redis=require(_0x5ee0('0xe'));var authService=require(_0x5ee0('0xf'));var qs=require(_0x5ee0('0x10'));var as=require(_0x5ee0('0x11'));var hardwareService=require(_0x5ee0('0x12'));var logger=require(_0x5ee0('0x13'))('api');var utils=require(_0x5ee0('0x14'));var config=require(_0x5ee0('0x15'));var licenseUtil=require(_0x5ee0('0x16'));var db=require(_0x5ee0('0x17'))['db'];config[_0x5ee0('0x18')]=_[_0x5ee0('0x19')](config[_0x5ee0('0x18')],{'host':_0x5ee0('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5ee0('0x18')]));require(_0x5ee0('0x1b'))['register'](socket);var jayson=require(_0x5ee0('0x1c'));var client=jayson[_0x5ee0('0x1d')]['http']({'port':0x232c});var client9002=jayson[_0x5ee0('0x1d')]['http']({'port':0x232a});function respondWithRpcPromise(_0x704214,_0x33ceae,_0x3fb6d3,_0x12c889){return new BPromise(function(_0x523658,_0x213fc0){var _0xea93cc=_0x12c889||client;return _0xea93cc['request'](_0x704214,_0x3fb6d3)['then'](function(_0xf53508){logger[_0x5ee0('0x1e')]('OpenchannelMessage,\x20%s,\x20%s',_0x33ceae,_0x5ee0('0x1f'));logger[_0x5ee0('0x20')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x33ceae,_0x5ee0('0x1f'),JSON[_0x5ee0('0x21')](_0xf53508));if(_0xf53508[_0x5ee0('0x22')]){if(_0xf53508['error'][_0x5ee0('0x23')]===0x1f4){logger[_0x5ee0('0x22')](_0x5ee0('0x24'),_0x33ceae,_0xf53508[_0x5ee0('0x22')][_0x5ee0('0x25')]);return _0x213fc0(_0xf53508[_0x5ee0('0x22')][_0x5ee0('0x25')]);}logger[_0x5ee0('0x22')](_0x5ee0('0x24'),_0x33ceae,_0xf53508[_0x5ee0('0x22')][_0x5ee0('0x25')]);return _0x523658(_0xf53508[_0x5ee0('0x22')]['message']);}else{logger[_0x5ee0('0x1e')](_0x5ee0('0x24'),_0x33ceae,_0x5ee0('0x1f'));_0x523658(_0xf53508[_0x5ee0('0x26')]['message']);}})[_0x5ee0('0x27')](function(_0x2dad98){logger[_0x5ee0('0x22')](_0x5ee0('0x24'),_0x33ceae,_0x2dad98);_0x213fc0(_0x2dad98);});});}function respondWithStatusCode(_0x171cec,_0x253f83){_0x253f83=_0x253f83||0xcc;return function(_0x441173){if(_0x441173){return _0x171cec['sendStatus'](_0x253f83);}return _0x171cec[_0x5ee0('0x28')](_0x253f83)[_0x5ee0('0x29')]();};}function respondWithResult(_0x5b4590,_0x4b8c99){_0x4b8c99=_0x4b8c99||0xc8;return function(_0x4e6a1c){if(_0x4e6a1c){return _0x5b4590[_0x5ee0('0x28')](_0x4b8c99)[_0x5ee0('0x2a')](_0x4e6a1c);}};}function respondWithFilteredResult(_0x4abe7d,_0x17eede){return function(_0x2ce1cf){if(_0x2ce1cf){var _0x250dab=typeof _0x17eede['offset']===_0x5ee0('0x2b')&&typeof _0x17eede[_0x5ee0('0x2c')]===_0x5ee0('0x2b');var _0x179597=_0x2ce1cf[_0x5ee0('0x2d')];var _0x40e077=_0x250dab?0x0:_0x17eede[_0x5ee0('0x2e')];var _0x8f1956=_0x250dab?_0x2ce1cf[_0x5ee0('0x2d')]:_0x17eede[_0x5ee0('0x2e')]+_0x17eede[_0x5ee0('0x2c')];var _0x157d5b;if(_0x8f1956>=_0x179597){_0x8f1956=_0x179597;_0x157d5b=0xc8;}else{_0x157d5b=0xce;}_0x4abe7d[_0x5ee0('0x28')](_0x157d5b);return _0x4abe7d[_0x5ee0('0x2f')](_0x5ee0('0x30'),_0x40e077+'-'+_0x8f1956+'/'+_0x179597)[_0x5ee0('0x2a')](_0x2ce1cf);}return null;};}function patchUpdates(_0x5bba71){return function(_0x25319d){try{jsonpatch['apply'](_0x25319d,_0x5bba71,!![]);}catch(_0x461bd1){return BPromise[_0x5ee0('0x31')](_0x461bd1);}return _0x25319d[_0x5ee0('0x32')]();};}function saveUpdates(_0x2a6e0d,_0x333f30){return function(_0x15b050){if(_0x15b050){return _0x15b050[_0x5ee0('0x33')](_0x2a6e0d)['then'](function(_0x3d0143){return _0x3d0143;});}return null;};}function removeEntity(_0xc5b686,_0x940d1c){return function(_0x17c75d){if(_0x17c75d){return _0x17c75d['destroy']()[_0x5ee0('0x34')](function(){_0xc5b686[_0x5ee0('0x28')](0xcc)[_0x5ee0('0x29')]();});}};}function handleEntityNotFound(_0x2d44cb,_0x1f8e59){return function(_0x35815d){if(!_0x35815d){_0x2d44cb[_0x5ee0('0x35')](0x194);}return _0x35815d;};}function handleError(_0x462869,_0x3fa2d6){_0x3fa2d6=_0x3fa2d6||0x1f4;return function(_0x556fcf){logger[_0x5ee0('0x22')](_0x556fcf[_0x5ee0('0x36')]);if(_0x556fcf[_0x5ee0('0x37')]){delete _0x556fcf['name'];}_0x462869['status'](_0x3fa2d6)['send'](_0x556fcf);};}exports['index']=function(_0x343b08,_0x2ad37b){var _0x27aa11={},_0x82968f={},_0x5dd6c1={'count':0x0,'rows':[]};var _0x17c9a3=_['map'](db[_0x5ee0('0x38')][_0x5ee0('0x39')],function(_0x301517){return{'name':_0x301517[_0x5ee0('0x3a')],'type':_0x301517[_0x5ee0('0x3b')]['key']};});_0x82968f[_0x5ee0('0x3c')]=_['map'](_0x17c9a3,'name');_0x82968f[_0x5ee0('0x3d')]=_[_0x5ee0('0x3e')](_0x343b08[_0x5ee0('0x3d')]);_0x82968f[_0x5ee0('0x3f')]=_[_0x5ee0('0x40')](_0x82968f[_0x5ee0('0x3c')],_0x82968f[_0x5ee0('0x3d')]);_0x27aa11[_0x5ee0('0x41')]=_[_0x5ee0('0x40')](_0x82968f[_0x5ee0('0x3c')],qs['fields'](_0x343b08[_0x5ee0('0x3d')][_0x5ee0('0x42')]));_0x27aa11[_0x5ee0('0x41')]=_0x27aa11[_0x5ee0('0x41')][_0x5ee0('0x43')]?_0x27aa11[_0x5ee0('0x41')]:_0x82968f[_0x5ee0('0x3c')];if(!_0x343b08[_0x5ee0('0x3d')][_0x5ee0('0x44')](_0x5ee0('0x45'))){_0x27aa11[_0x5ee0('0x2c')]=qs[_0x5ee0('0x2c')](_0x343b08[_0x5ee0('0x3d')][_0x5ee0('0x2c')]);_0x27aa11['offset']=qs[_0x5ee0('0x2e')](_0x343b08[_0x5ee0('0x3d')][_0x5ee0('0x2e')]);}_0x27aa11[_0x5ee0('0x46')]=qs[_0x5ee0('0x47')](_0x343b08[_0x5ee0('0x3d')]['sort']);_0x27aa11[_0x5ee0('0x48')]=qs[_0x5ee0('0x3f')](_[_0x5ee0('0x49')](_0x343b08[_0x5ee0('0x3d')],_0x82968f[_0x5ee0('0x3f')]),_0x17c9a3);if(_0x343b08[_0x5ee0('0x3d')][_0x5ee0('0x4a')]){_0x27aa11['where']=_[_0x5ee0('0x4b')](_0x27aa11[_0x5ee0('0x48')],{'$or':_[_0x5ee0('0x4c')](_0x17c9a3,function(_0xe71971){if(_0xe71971[_0x5ee0('0x3b')]!=='VIRTUAL'){var _0x4941e4={};_0x4941e4[_0xe71971[_0x5ee0('0x37')]]={'$like':'%'+_0x343b08[_0x5ee0('0x3d')]['filter']+'%'};return _0x4941e4;}})});}_0x27aa11=_[_0x5ee0('0x4b')]({},_0x27aa11,_0x343b08['options']);var _0x33adeb={'where':_0x27aa11[_0x5ee0('0x48')]};return db[_0x5ee0('0x38')][_0x5ee0('0x2d')](_0x33adeb)[_0x5ee0('0x34')](function(_0x5c3754){_0x5dd6c1[_0x5ee0('0x2d')]=_0x5c3754;if(_0x343b08['query'][_0x5ee0('0x4d')]){_0x27aa11[_0x5ee0('0x4e')]=[{'all':!![]}];}return db[_0x5ee0('0x38')][_0x5ee0('0x4f')](_0x27aa11);})[_0x5ee0('0x34')](function(_0x2f3558){_0x5dd6c1[_0x5ee0('0x50')]=_0x2f3558;return _0x5dd6c1;})[_0x5ee0('0x34')](respondWithFilteredResult(_0x2ad37b,_0x27aa11))[_0x5ee0('0x27')](handleError(_0x2ad37b,null));};exports[_0x5ee0('0x51')]=function(_0x1c2e42,_0x3305f6){var _0x473d0b={'raw':!![],'where':{'id':_0x1c2e42[_0x5ee0('0x52')]['id']}},_0x12fb3b={};_0x12fb3b[_0x5ee0('0x3c')]=_[_0x5ee0('0x3e')](db[_0x5ee0('0x38')][_0x5ee0('0x39')]);_0x12fb3b['query']=_[_0x5ee0('0x3e')](_0x1c2e42[_0x5ee0('0x3d')]);_0x12fb3b['filters']=_['intersection'](_0x12fb3b[_0x5ee0('0x3c')],_0x12fb3b[_0x5ee0('0x3d')]);_0x473d0b[_0x5ee0('0x41')]=_[_0x5ee0('0x40')](_0x12fb3b['model'],qs[_0x5ee0('0x42')](_0x1c2e42[_0x5ee0('0x3d')]['fields']));_0x473d0b['attributes']=_0x473d0b[_0x5ee0('0x41')]['length']?_0x473d0b['attributes']:_0x12fb3b[_0x5ee0('0x3c')];if(_0x1c2e42[_0x5ee0('0x3d')][_0x5ee0('0x4d')]){_0x473d0b[_0x5ee0('0x4e')]=[{'all':!![]}];}_0x473d0b=_[_0x5ee0('0x4b')]({},_0x473d0b,_0x1c2e42[_0x5ee0('0x53')]);return db[_0x5ee0('0x38')]['find'](_0x473d0b)[_0x5ee0('0x34')](handleEntityNotFound(_0x3305f6,null))[_0x5ee0('0x34')](respondWithResult(_0x3305f6,null))[_0x5ee0('0x27')](handleError(_0x3305f6,null));};exports[_0x5ee0('0x54')]=function(_0x26e4bf,_0x4d4081){return db[_0x5ee0('0x38')][_0x5ee0('0x54')](_0x26e4bf[_0x5ee0('0x55')],{})[_0x5ee0('0x34')](respondWithResult(_0x4d4081,0xc9))[_0x5ee0('0x27')](handleError(_0x4d4081,null));};exports[_0x5ee0('0x33')]=function(_0x516c5d,_0x1a6243){if(_0x516c5d[_0x5ee0('0x55')]['id']){delete _0x516c5d[_0x5ee0('0x55')]['id'];}return db['OpenchannelMessage'][_0x5ee0('0x56')]({'where':{'id':_0x516c5d[_0x5ee0('0x52')]['id']}})[_0x5ee0('0x34')](handleEntityNotFound(_0x1a6243,null))[_0x5ee0('0x34')](saveUpdates(_0x516c5d[_0x5ee0('0x55')],null))[_0x5ee0('0x34')](respondWithResult(_0x1a6243,null))[_0x5ee0('0x27')](handleError(_0x1a6243,null));};exports[_0x5ee0('0x57')]=function(_0x14d3fd,_0x7a20eb){return db[_0x5ee0('0x38')][_0x5ee0('0x56')]({'where':{'id':_0x14d3fd[_0x5ee0('0x52')]['id']}})[_0x5ee0('0x34')](handleEntityNotFound(_0x7a20eb,null))['then'](removeEntity(_0x7a20eb,null))[_0x5ee0('0x27')](handleError(_0x7a20eb,null));};exports['describe']=function(_0x499b09,_0xdf0bd6){return db[_0x5ee0('0x38')][_0x5ee0('0x58')]()[_0x5ee0('0x34')](respondWithResult(_0xdf0bd6,null))[_0x5ee0('0x27')](handleError(_0xdf0bd6,null));};var interaction_log=require(_0x5ee0('0x13'))(_0x5ee0('0x59'));exports[_0x5ee0('0x5a')]=function(_0x3cb289,_0x1a3d3b,_0x36215a){var _0x29d9ff={'agent':{},'channel':'openchannel'};if(_0x3cb289['body']['id']){delete _0x3cb289[_0x5ee0('0x55')]['id'];}_0x3cb289[_0x5ee0('0x55')][_0x5ee0('0x5b')]=!![];_0x3cb289[_0x5ee0('0x55')][_0x5ee0('0x5c')]=moment()[_0x5ee0('0x5d')](_0x5ee0('0x5e'));_0x3cb289[_0x5ee0('0x55')][_0x5ee0('0x5f')]=_0x3cb289['body']['UserId']||_0x3cb289['user']['id'];_0x29d9ff['agent']['id']=_0x3cb289[_0x5ee0('0x55')]['UserId'];return db[_0x5ee0('0x38')][_0x5ee0('0x56')]({'where':{'id':_0x3cb289[_0x5ee0('0x52')]['id'],'UserId':null}})[_0x5ee0('0x34')](handleEntityNotFound(_0x1a3d3b,null))['then'](saveUpdates(_0x3cb289[_0x5ee0('0x55')],null))['then'](function(_0x3f1e98){if(_0x3f1e98){_0x29d9ff['message']=_0x3f1e98[_0x5ee0('0x60')]({'plain':!![]});return db[_0x5ee0('0x61')][_0x5ee0('0x56')]({'where':{'id':_0x3f1e98[_0x5ee0('0x62')]}});}return null;})[_0x5ee0('0x34')](handleEntityNotFound(_0x1a3d3b,null))[_0x5ee0('0x34')](function(_0x27b855){if(_0x27b855){return _0x27b855[_0x5ee0('0x33')]({'UserId':_0x3cb289[_0x5ee0('0x55')][_0x5ee0('0x5f')],'read1stAt':_[_0x5ee0('0x63')](_0x27b855[_0x5ee0('0x64')])?moment()[_0x5ee0('0x5d')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x5ee0('0x34')](function(_0x3729c9){if(_0x3729c9){_0x29d9ff[_0x5ee0('0x65')]=_0x3729c9[_0x5ee0('0x60')]({'plain':!![]});interaction_log[_0x5ee0('0x1e')]('[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x3cb289[_0x5ee0('0x66')]['id'],_0x3cb289[_0x5ee0('0x66')][_0x5ee0('0x37')],_0x3cb289[_0x5ee0('0x66')][_0x5ee0('0x67')],_0x29d9ff[_0x5ee0('0x65')]['id'],_0x3cb289[_0x5ee0('0x55')]?JSON[_0x5ee0('0x21')](_0x3cb289[_0x5ee0('0x55')]):'null');return respondWithRpcPromise(_0x5ee0('0x68'),'acceptMessage',_0x29d9ff);}return null;})[_0x5ee0('0x34')](function(_0x53f60e){var _0x1f8dd0=_0x5ee0('0x69')+_0x53f60e[_0x5ee0('0x25')][_0x5ee0('0x6a')];return db[_0x5ee0('0x6b')][_0x5ee0('0x3d')](_0x1f8dd0,{'type':db[_0x5ee0('0x6c')][_0x5ee0('0x6d')]['SELECT'],'raw':!![]})[_0x5ee0('0x34')](function(_0x30f81c){return _0x30f81c;});})['then'](function(_0x2e05a0){if(_0x2e05a0){_0x29d9ff['message'][_0x5ee0('0x6e')]=_0x2e05a0[0x0];if(!_0x3cb289['body'][_0x5ee0('0x5f')])return;return db[_0x5ee0('0x6f')][_0x5ee0('0x56')]({'where':{'id':_0x3cb289[_0x5ee0('0x55')][_0x5ee0('0x5f')],'role':_0x5ee0('0x70')},'attributes':['id','name',_0x5ee0('0x71'),_0x5ee0('0x72'),_0x5ee0('0x73')],'raw':!![]});}return null;})[_0x5ee0('0x34')](function(_0x4af25f){if(!_0x4af25f)return null;_0x29d9ff[_0x5ee0('0x25')][_0x5ee0('0x70')]=_0x4af25f;return _0x29d9ff;})[_0x5ee0('0x34')](function(_0x4dac41){if(_0x4dac41){if(_0x3cb289[_0x5ee0('0x55')][_0x5ee0('0x74')]){_0x29d9ff[_0x5ee0('0x25')][_0x5ee0('0x75')]=util[_0x5ee0('0x5d')](_0x5ee0('0x76'),_0x3cb289[_0x5ee0('0x66')][_0x5ee0('0x37')]);_0x29d9ff[_0x5ee0('0x25')][_0x5ee0('0x77')]=_0x29d9ff[_0x5ee0('0x77')];_0x29d9ff[_0x5ee0('0x25')][_0x5ee0('0x78')]=_0x29d9ff[_0x5ee0('0x77')];_0x29d9ff[_0x5ee0('0x25')]['event']=_0x5ee0('0x5a');return respondWithRpcPromise(_0x5ee0('0x79'),_0x5ee0('0x79'),{'event':_0x5ee0('0x7a'),'message':_0x29d9ff[_0x5ee0('0x25')]},client9002)[_0x5ee0('0x34')](function(){return _0x29d9ff;});}return _0x29d9ff;}return null;})[_0x5ee0('0x34')](respondWithResult(_0x1a3d3b,null))['catch'](handleError(_0x1a3d3b,null));};var interaction_log=require('../../config/logger')(_0x5ee0('0x59'));exports[_0x5ee0('0x31')]=function(_0x306d2b,_0x454a40,_0x19e3a7){var _0x448074={'agent':{},'channel':_0x5ee0('0x7b')};if(_0x306d2b['body']['id']){delete _0x306d2b['body']['id'];}_0x306d2b[_0x5ee0('0x55')][_0x5ee0('0x5f')]=_0x306d2b[_0x5ee0('0x55')][_0x5ee0('0x5f')]||_0x306d2b[_0x5ee0('0x66')]['id'];_0x448074[_0x5ee0('0x70')]['id']=_0x306d2b[_0x5ee0('0x55')][_0x5ee0('0x5f')];return db[_0x5ee0('0x38')][_0x5ee0('0x56')]({'where':{'id':_0x306d2b[_0x5ee0('0x52')]['id'],'UserId':null}})[_0x5ee0('0x34')](handleEntityNotFound(_0x454a40,null))['then'](function(_0x150986){if(_0x150986){_0x448074[_0x5ee0('0x25')]=_0x150986[_0x5ee0('0x60')]({'plain':!![]});return db[_0x5ee0('0x61')][_0x5ee0('0x56')]({'where':{'id':_0x150986[_0x5ee0('0x62')]}});}return null;})[_0x5ee0('0x34')](handleEntityNotFound(_0x454a40,null))['then'](function(_0x291daa){if(_0x291daa){_0x448074[_0x5ee0('0x65')]=_0x291daa['get']({'plain':!![]});interaction_log[_0x5ee0('0x1e')](_0x5ee0('0x7c'),_0x306d2b[_0x5ee0('0x66')]['id'],_0x306d2b[_0x5ee0('0x66')][_0x5ee0('0x37')],_0x306d2b[_0x5ee0('0x66')][_0x5ee0('0x67')],_0x448074[_0x5ee0('0x65')]['id'],_0x306d2b[_0x5ee0('0x55')]?JSON[_0x5ee0('0x21')](_0x306d2b['body']):_0x5ee0('0x7d'));return respondWithRpcPromise(_0x5ee0('0x7e'),_0x5ee0('0x7f'),_0x448074);}return null;})[_0x5ee0('0x34')](function(_0x1d7256){var _0x373564='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x1d7256[_0x5ee0('0x25')][_0x5ee0('0x6a')];return db[_0x5ee0('0x6b')]['query'](_0x373564,{'type':db[_0x5ee0('0x6c')][_0x5ee0('0x6d')]['SELECT'],'raw':!![]})[_0x5ee0('0x34')](function(_0x37198e){return _0x37198e;});})[_0x5ee0('0x34')](function(_0x3ee506){if(_0x3ee506){_0x448074[_0x5ee0('0x25')]['contact']=_0x3ee506[0x0];if(!_0x306d2b['body']['UserId'])return;return db[_0x5ee0('0x6f')][_0x5ee0('0x56')]({'where':{'id':_0x306d2b[_0x5ee0('0x55')][_0x5ee0('0x5f')],'role':'agent'},'attributes':['id',_0x5ee0('0x37'),_0x5ee0('0x71'),_0x5ee0('0x72'),'internal'],'raw':!![]});}return null;})[_0x5ee0('0x34')](function(_0x1d0dbe){if(!_0x1d0dbe)return null;_0x448074['message'][_0x5ee0('0x70')]=_0x1d0dbe;return _0x448074;})[_0x5ee0('0x34')](function(_0xeaedc2){if(_0xeaedc2){_0xeaedc2[_0x5ee0('0x25')][_0x5ee0('0x75')]=util[_0x5ee0('0x5d')](_0x5ee0('0x76'),_0x306d2b[_0x5ee0('0x66')][_0x5ee0('0x37')]);_0xeaedc2[_0x5ee0('0x25')]['channel']=_0x448074['channel'];_0xeaedc2[_0x5ee0('0x25')][_0x5ee0('0x78')]=_0x448074[_0x5ee0('0x77')];_0xeaedc2[_0x5ee0('0x25')][_0x5ee0('0x80')]=_0x5ee0('0x31');respondWithRpcPromise(_0x5ee0('0x79'),'EventManager',{'event':_0x5ee0('0x81'),'message':_0xeaedc2[_0x5ee0('0x25')]},client9002);return _0x448074;}return null;})[_0x5ee0('0x34')](respondWithResult(_0x454a40,null))[_0x5ee0('0x27')](handleError(_0x454a40,null));};
\ No newline at end of file
+var _0x8178=['EventManager','acceptmessage','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','sequelize','fullname','SIP/%s','rejectmessage','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','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','redis','defaults','socket.io-emitter','./openchannelMessage.socket','jayson/promise','client','http','request','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','update','destroy','stack','name','index','map','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','type','VIRTUAL','OpenchannelMessage','includeAll','include','findAll','rows','show','params','find','create','body','catch','describe','openchannel-interactions','accept','openchannel','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','OpenchannelInteraction','OpenchannelInteractionId','isNil','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','SELECT','contact','User','email','internal','manual','interface','user','channel','motionChannel','event'];(function(_0x55291a,_0x814018){var _0x3c870c=function(_0x1fd787){while(--_0x1fd787){_0x55291a['push'](_0x55291a['shift']());}};_0x3c870c(++_0x814018);}(_0x8178,0x8f));var _0x8817=function(_0x420781,_0x99f6db){_0x420781=_0x420781-0x0;var _0xa1e054=_0x8178[_0x420781];return _0xa1e054;};'use strict';var emlformat=require(_0x8817('0x0'));var rimraf=require(_0x8817('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8817('0x2'));var rp=require(_0x8817('0x3'));var moment=require('moment');var BPromise=require(_0x8817('0x4'));var Mustache=require(_0x8817('0x5'));var util=require(_0x8817('0x6'));var path=require(_0x8817('0x7'));var sox=require('sox');var csv=require(_0x8817('0x8'));var ejs=require(_0x8817('0x9'));var fs=require('fs');var fs_extra=require(_0x8817('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x8817('0xb'));var deskjs=require(_0x8817('0xc'));var toCsv=require(_0x8817('0x8'));var querystring=require(_0x8817('0xd'));var Papa=require(_0x8817('0xe'));var Redis=require(_0x8817('0xf'));var authService=require(_0x8817('0x10'));var qs=require(_0x8817('0x11'));var as=require(_0x8817('0x12'));var hardwareService=require(_0x8817('0x13'));var logger=require(_0x8817('0x14'))(_0x8817('0x15'));var utils=require(_0x8817('0x16'));var config=require(_0x8817('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x8817('0x18'))['db'];config[_0x8817('0x19')]=_[_0x8817('0x1a')](config[_0x8817('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x8817('0x1b'))(new Redis(config['redis']));require(_0x8817('0x1c'))['register'](socket);var jayson=require(_0x8817('0x1d'));var client=jayson[_0x8817('0x1e')][_0x8817('0x1f')]({'port':0x232c});var client9002=jayson[_0x8817('0x1e')][_0x8817('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x35c775,_0x421f79,_0x28c19e,_0x54eed1){return new BPromise(function(_0x339aba,_0x10b73a){var _0x415e99=_0x54eed1||client;return _0x415e99[_0x8817('0x20')](_0x35c775,_0x28c19e)[_0x8817('0x21')](function(_0x34931f){logger[_0x8817('0x22')](_0x8817('0x23'),_0x421f79,_0x8817('0x24'));logger[_0x8817('0x25')](_0x8817('0x26'),_0x421f79,_0x8817('0x24'),JSON[_0x8817('0x27')](_0x34931f));if(_0x34931f[_0x8817('0x28')]){if(_0x34931f['error'][_0x8817('0x29')]===0x1f4){logger[_0x8817('0x28')](_0x8817('0x23'),_0x421f79,_0x34931f['error'][_0x8817('0x2a')]);return _0x10b73a(_0x34931f[_0x8817('0x28')][_0x8817('0x2a')]);}logger[_0x8817('0x28')](_0x8817('0x23'),_0x421f79,_0x34931f[_0x8817('0x28')]['message']);return _0x339aba(_0x34931f[_0x8817('0x28')][_0x8817('0x2a')]);}else{logger['info'](_0x8817('0x23'),_0x421f79,_0x8817('0x24'));_0x339aba(_0x34931f[_0x8817('0x2b')][_0x8817('0x2a')]);}})['catch'](function(_0x128202){logger[_0x8817('0x28')](_0x8817('0x23'),_0x421f79,_0x128202);_0x10b73a(_0x128202);});});}function respondWithStatusCode(_0x4f98dd,_0x3fdf38){_0x3fdf38=_0x3fdf38||0xcc;return function(_0x4fa00c){if(_0x4fa00c){return _0x4f98dd[_0x8817('0x2c')](_0x3fdf38);}return _0x4f98dd[_0x8817('0x2d')](_0x3fdf38)[_0x8817('0x2e')]();};}function respondWithResult(_0x22fc13,_0x4046f0){_0x4046f0=_0x4046f0||0xc8;return function(_0x33d56c){if(_0x33d56c){return _0x22fc13['status'](_0x4046f0)[_0x8817('0x2f')](_0x33d56c);}};}function respondWithFilteredResult(_0x3bb0b5,_0x27fa91){return function(_0xcc4da8){if(_0xcc4da8){var _0x323b63=typeof _0x27fa91['offset']===_0x8817('0x30')&&typeof _0x27fa91[_0x8817('0x31')]==='undefined';var _0x4ab6f3=_0xcc4da8[_0x8817('0x32')];var _0x258978=_0x323b63?0x0:_0x27fa91[_0x8817('0x33')];var _0x11387f=_0x323b63?_0xcc4da8[_0x8817('0x32')]:_0x27fa91[_0x8817('0x33')]+_0x27fa91[_0x8817('0x31')];var _0x55693f;if(_0x11387f>=_0x4ab6f3){_0x11387f=_0x4ab6f3;_0x55693f=0xc8;}else{_0x55693f=0xce;}_0x3bb0b5[_0x8817('0x2d')](_0x55693f);return _0x3bb0b5[_0x8817('0x34')](_0x8817('0x35'),_0x258978+'-'+_0x11387f+'/'+_0x4ab6f3)['json'](_0xcc4da8);}return null;};}function patchUpdates(_0x5ed06e){return function(_0x32af42){try{jsonpatch['apply'](_0x32af42,_0x5ed06e,!![]);}catch(_0x30180e){return BPromise[_0x8817('0x36')](_0x30180e);}return _0x32af42['save']();};}function saveUpdates(_0x1c8f25,_0x2959e1){return function(_0x299000){if(_0x299000){return _0x299000[_0x8817('0x37')](_0x1c8f25)[_0x8817('0x21')](function(_0x53b7bf){return _0x53b7bf;});}return null;};}function removeEntity(_0x365c13,_0xf2ff73){return function(_0x53b2d9){if(_0x53b2d9){return _0x53b2d9[_0x8817('0x38')]()[_0x8817('0x21')](function(){_0x365c13['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1218d4,_0x224c07){return function(_0x19ded2){if(!_0x19ded2){_0x1218d4['sendStatus'](0x194);}return _0x19ded2;};}function handleError(_0x60199d,_0x5bc03b){_0x5bc03b=_0x5bc03b||0x1f4;return function(_0x4e3170){logger[_0x8817('0x28')](_0x4e3170[_0x8817('0x39')]);if(_0x4e3170[_0x8817('0x3a')]){delete _0x4e3170[_0x8817('0x3a')];}_0x60199d[_0x8817('0x2d')](_0x5bc03b)['send'](_0x4e3170);};}exports[_0x8817('0x3b')]=function(_0x5f05e0,_0x3ac66f){var _0xc446ab={},_0x497aa8={},_0x9acef7={'count':0x0,'rows':[]};var _0x52bfcb=_[_0x8817('0x3c')](db['OpenchannelMessage'][_0x8817('0x3d')],function(_0x11f52d){return{'name':_0x11f52d['fieldName'],'type':_0x11f52d['type'][_0x8817('0x3e')]};});_0x497aa8[_0x8817('0x3f')]=_[_0x8817('0x3c')](_0x52bfcb,'name');_0x497aa8[_0x8817('0x40')]=_[_0x8817('0x41')](_0x5f05e0[_0x8817('0x40')]);_0x497aa8[_0x8817('0x42')]=_[_0x8817('0x43')](_0x497aa8[_0x8817('0x3f')],_0x497aa8[_0x8817('0x40')]);_0xc446ab[_0x8817('0x44')]=_[_0x8817('0x43')](_0x497aa8['model'],qs[_0x8817('0x45')](_0x5f05e0[_0x8817('0x40')]['fields']));_0xc446ab[_0x8817('0x44')]=_0xc446ab[_0x8817('0x44')][_0x8817('0x46')]?_0xc446ab[_0x8817('0x44')]:_0x497aa8['model'];if(!_0x5f05e0[_0x8817('0x40')][_0x8817('0x47')](_0x8817('0x48'))){_0xc446ab['limit']=qs[_0x8817('0x31')](_0x5f05e0[_0x8817('0x40')][_0x8817('0x31')]);_0xc446ab['offset']=qs[_0x8817('0x33')](_0x5f05e0[_0x8817('0x40')][_0x8817('0x33')]);}_0xc446ab[_0x8817('0x49')]=qs[_0x8817('0x4a')](_0x5f05e0[_0x8817('0x40')]['sort']);_0xc446ab['where']=qs[_0x8817('0x42')](_[_0x8817('0x4b')](_0x5f05e0[_0x8817('0x40')],_0x497aa8[_0x8817('0x42')]),_0x52bfcb);if(_0x5f05e0[_0x8817('0x40')][_0x8817('0x4c')]){_0xc446ab['where']=_[_0x8817('0x4d')](_0xc446ab[_0x8817('0x4e')],{'$or':_[_0x8817('0x3c')](_0x52bfcb,function(_0x3d194e){if(_0x3d194e[_0x8817('0x4f')]!==_0x8817('0x50')){var _0x20caec={};_0x20caec[_0x3d194e[_0x8817('0x3a')]]={'$like':'%'+_0x5f05e0['query']['filter']+'%'};return _0x20caec;}})});}_0xc446ab=_['merge']({},_0xc446ab,_0x5f05e0['options']);var _0x4bfd51={'where':_0xc446ab[_0x8817('0x4e')]};return db[_0x8817('0x51')][_0x8817('0x32')](_0x4bfd51)[_0x8817('0x21')](function(_0x294438){_0x9acef7[_0x8817('0x32')]=_0x294438;if(_0x5f05e0['query'][_0x8817('0x52')]){_0xc446ab[_0x8817('0x53')]=[{'all':!![]}];}return db[_0x8817('0x51')][_0x8817('0x54')](_0xc446ab);})[_0x8817('0x21')](function(_0x2f9eb5){_0x9acef7[_0x8817('0x55')]=_0x2f9eb5;return _0x9acef7;})[_0x8817('0x21')](respondWithFilteredResult(_0x3ac66f,_0xc446ab))['catch'](handleError(_0x3ac66f,null));};exports[_0x8817('0x56')]=function(_0x390d47,_0x513bf3){var _0x3b0f36={'raw':!![],'where':{'id':_0x390d47[_0x8817('0x57')]['id']}},_0x209458={};_0x209458[_0x8817('0x3f')]=_[_0x8817('0x41')](db[_0x8817('0x51')][_0x8817('0x3d')]);_0x209458['query']=_[_0x8817('0x41')](_0x390d47[_0x8817('0x40')]);_0x209458[_0x8817('0x42')]=_['intersection'](_0x209458[_0x8817('0x3f')],_0x209458[_0x8817('0x40')]);_0x3b0f36[_0x8817('0x44')]=_[_0x8817('0x43')](_0x209458[_0x8817('0x3f')],qs['fields'](_0x390d47[_0x8817('0x40')][_0x8817('0x45')]));_0x3b0f36['attributes']=_0x3b0f36[_0x8817('0x44')][_0x8817('0x46')]?_0x3b0f36['attributes']:_0x209458[_0x8817('0x3f')];if(_0x390d47['query'][_0x8817('0x52')]){_0x3b0f36[_0x8817('0x53')]=[{'all':!![]}];}_0x3b0f36=_[_0x8817('0x4d')]({},_0x3b0f36,_0x390d47['options']);return db[_0x8817('0x51')][_0x8817('0x58')](_0x3b0f36)[_0x8817('0x21')](handleEntityNotFound(_0x513bf3,null))[_0x8817('0x21')](respondWithResult(_0x513bf3,null))['catch'](handleError(_0x513bf3,null));};exports[_0x8817('0x59')]=function(_0x5b5cbd,_0x824c1a){return db[_0x8817('0x51')][_0x8817('0x59')](_0x5b5cbd[_0x8817('0x5a')],{})['then'](respondWithResult(_0x824c1a,0xc9))[_0x8817('0x5b')](handleError(_0x824c1a,null));};exports[_0x8817('0x37')]=function(_0x770ee2,_0x5afd8b){if(_0x770ee2['body']['id']){delete _0x770ee2[_0x8817('0x5a')]['id'];}return db['OpenchannelMessage'][_0x8817('0x58')]({'where':{'id':_0x770ee2[_0x8817('0x57')]['id']}})['then'](handleEntityNotFound(_0x5afd8b,null))[_0x8817('0x21')](saveUpdates(_0x770ee2[_0x8817('0x5a')],null))['then'](respondWithResult(_0x5afd8b,null))[_0x8817('0x5b')](handleError(_0x5afd8b,null));};exports[_0x8817('0x38')]=function(_0x299c14,_0x53b570){return db['OpenchannelMessage']['find']({'where':{'id':_0x299c14[_0x8817('0x57')]['id']}})[_0x8817('0x21')](handleEntityNotFound(_0x53b570,null))[_0x8817('0x21')](removeEntity(_0x53b570,null))[_0x8817('0x5b')](handleError(_0x53b570,null));};exports[_0x8817('0x5c')]=function(_0x5d9635,_0x17c2da){return db[_0x8817('0x51')][_0x8817('0x5c')]()[_0x8817('0x21')](respondWithResult(_0x17c2da,null))['catch'](handleError(_0x17c2da,null));};var interaction_log=require(_0x8817('0x14'))(_0x8817('0x5d'));exports[_0x8817('0x5e')]=function(_0xd2837c,_0x5e4fad,_0x1e47dd){var _0x56ecd5={'agent':{},'channel':_0x8817('0x5f')};if(_0xd2837c['body']['id']){delete _0xd2837c[_0x8817('0x5a')]['id'];}_0xd2837c[_0x8817('0x5a')]['read']=!![];_0xd2837c[_0x8817('0x5a')]['readAt']=moment()[_0x8817('0x60')](_0x8817('0x61'));_0xd2837c[_0x8817('0x5a')][_0x8817('0x62')]=_0xd2837c[_0x8817('0x5a')][_0x8817('0x62')]||_0xd2837c['user']['id'];_0x56ecd5[_0x8817('0x63')]['id']=_0xd2837c[_0x8817('0x5a')][_0x8817('0x62')];return db['OpenchannelMessage'][_0x8817('0x58')]({'where':{'id':_0xd2837c['params']['id'],'UserId':null}})[_0x8817('0x21')](handleEntityNotFound(_0x5e4fad,null))['then'](saveUpdates(_0xd2837c[_0x8817('0x5a')],null))[_0x8817('0x21')](function(_0x395e84){if(_0x395e84){_0x56ecd5[_0x8817('0x2a')]=_0x395e84[_0x8817('0x64')]({'plain':!![]});return db[_0x8817('0x65')]['find']({'where':{'id':_0x395e84[_0x8817('0x66')]}});}return null;})[_0x8817('0x21')](handleEntityNotFound(_0x5e4fad,null))[_0x8817('0x21')](function(_0x44246b){if(_0x44246b){return _0x44246b['update']({'UserId':_0xd2837c[_0x8817('0x5a')][_0x8817('0x62')],'read1stAt':_[_0x8817('0x67')](_0x44246b['read1stAt'])?moment()[_0x8817('0x60')](_0x8817('0x61')):undefined});}return null;})[_0x8817('0x21')](function(_0xdb0e9d){if(_0xdb0e9d){_0x56ecd5[_0x8817('0x68')]=_0xdb0e9d[_0x8817('0x64')]({'plain':!![]});interaction_log[_0x8817('0x22')](_0x8817('0x69'),_0xd2837c['user']['id'],_0xd2837c['user'][_0x8817('0x3a')],_0xd2837c['user'][_0x8817('0x6a')],_0x56ecd5[_0x8817('0x68')]['id'],_0xd2837c[_0x8817('0x5a')]?JSON[_0x8817('0x27')](_0xd2837c[_0x8817('0x5a')]):_0x8817('0x6b'));return respondWithRpcPromise(_0x8817('0x6c'),_0x8817('0x6d'),_0x56ecd5);}return null;})['then'](function(_0x4083bf){var _0xe22bea=_0x8817('0x6e')+_0x4083bf[_0x8817('0x2a')][_0x8817('0x6f')];return db['sequelize'][_0x8817('0x40')](_0xe22bea,{'type':db[_0x8817('0x70')][_0x8817('0x71')][_0x8817('0x72')],'raw':!![]})[_0x8817('0x21')](function(_0x5e9122){return _0x5e9122;});})[_0x8817('0x21')](function(_0x114346){if(_0x114346){_0x56ecd5[_0x8817('0x2a')][_0x8817('0x73')]=_0x114346[0x0];if(!_0xd2837c[_0x8817('0x5a')][_0x8817('0x62')])return;return db[_0x8817('0x74')][_0x8817('0x58')]({'where':{'id':_0xd2837c['body'][_0x8817('0x62')],'role':'agent'},'attributes':['id',_0x8817('0x3a'),'fullname',_0x8817('0x75'),_0x8817('0x76')],'raw':!![]});}return null;})['then'](function(_0x225587){if(!_0x225587)return null;_0x56ecd5[_0x8817('0x2a')]['agent']=_0x225587;return _0x56ecd5;})[_0x8817('0x21')](function(_0x28c77d){if(_0x28c77d){if(_0xd2837c['body'][_0x8817('0x77')]){_0x56ecd5[_0x8817('0x2a')][_0x8817('0x78')]=util[_0x8817('0x60')]('SIP/%s',_0xd2837c[_0x8817('0x79')][_0x8817('0x3a')]);_0x56ecd5[_0x8817('0x2a')][_0x8817('0x7a')]=_0x56ecd5[_0x8817('0x7a')];_0x56ecd5[_0x8817('0x2a')][_0x8817('0x7b')]=_0x56ecd5[_0x8817('0x7a')];_0x56ecd5[_0x8817('0x2a')][_0x8817('0x7c')]='accept';return respondWithRpcPromise(_0x8817('0x7d'),_0x8817('0x7d'),{'event':_0x8817('0x7e'),'message':_0x56ecd5['message']},client9002)['then'](function(){return _0x56ecd5;});}return _0x56ecd5;}return null;})['then'](respondWithResult(_0x5e4fad,null))[_0x8817('0x5b')](handleError(_0x5e4fad,null));};var interaction_log=require(_0x8817('0x14'))(_0x8817('0x5d'));exports['reject']=function(_0x4951b9,_0x5ee935,_0x40c333){var _0x3efd2a={'agent':{},'channel':'openchannel'};if(_0x4951b9[_0x8817('0x5a')]['id']){delete _0x4951b9[_0x8817('0x5a')]['id'];}_0x4951b9[_0x8817('0x5a')][_0x8817('0x62')]=_0x4951b9[_0x8817('0x5a')][_0x8817('0x62')]||_0x4951b9['user']['id'];_0x3efd2a[_0x8817('0x63')]['id']=_0x4951b9[_0x8817('0x5a')][_0x8817('0x62')];return db[_0x8817('0x51')]['find']({'where':{'id':_0x4951b9[_0x8817('0x57')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x5ee935,null))[_0x8817('0x21')](function(_0x4753d5){if(_0x4753d5){_0x3efd2a['message']=_0x4753d5[_0x8817('0x64')]({'plain':!![]});return db[_0x8817('0x65')][_0x8817('0x58')]({'where':{'id':_0x4753d5[_0x8817('0x66')]}});}return null;})[_0x8817('0x21')](handleEntityNotFound(_0x5ee935,null))[_0x8817('0x21')](function(_0x44418){if(_0x44418){_0x3efd2a['interaction']=_0x44418[_0x8817('0x64')]({'plain':!![]});interaction_log[_0x8817('0x22')](_0x8817('0x7f'),_0x4951b9[_0x8817('0x79')]['id'],_0x4951b9[_0x8817('0x79')][_0x8817('0x3a')],_0x4951b9[_0x8817('0x79')][_0x8817('0x6a')],_0x3efd2a['interaction']['id'],_0x4951b9[_0x8817('0x5a')]?JSON[_0x8817('0x27')](_0x4951b9[_0x8817('0x5a')]):_0x8817('0x6b'));return respondWithRpcPromise(_0x8817('0x80'),_0x8817('0x81'),_0x3efd2a);}return null;})[_0x8817('0x21')](function(_0x3ea57d){var _0x4b2e74=_0x8817('0x6e')+_0x3ea57d[_0x8817('0x2a')]['ContactId'];return db[_0x8817('0x82')][_0x8817('0x40')](_0x4b2e74,{'type':db[_0x8817('0x70')][_0x8817('0x71')]['SELECT'],'raw':!![]})[_0x8817('0x21')](function(_0x344c54){return _0x344c54;});})[_0x8817('0x21')](function(_0x11a8c3){if(_0x11a8c3){_0x3efd2a[_0x8817('0x2a')][_0x8817('0x73')]=_0x11a8c3[0x0];if(!_0x4951b9[_0x8817('0x5a')][_0x8817('0x62')])return;return db['User']['find']({'where':{'id':_0x4951b9['body'][_0x8817('0x62')],'role':'agent'},'attributes':['id',_0x8817('0x3a'),_0x8817('0x83'),_0x8817('0x75'),'internal'],'raw':!![]});}return null;})[_0x8817('0x21')](function(_0x468a5f){if(!_0x468a5f)return null;_0x3efd2a[_0x8817('0x2a')][_0x8817('0x63')]=_0x468a5f;return _0x3efd2a;})['then'](function(_0x555477){if(_0x555477){_0x555477['message'][_0x8817('0x78')]=util[_0x8817('0x60')](_0x8817('0x84'),_0x4951b9[_0x8817('0x79')][_0x8817('0x3a')]);_0x555477[_0x8817('0x2a')][_0x8817('0x7a')]=_0x3efd2a[_0x8817('0x7a')];_0x555477[_0x8817('0x2a')][_0x8817('0x7b')]=_0x3efd2a[_0x8817('0x7a')];_0x555477['message'][_0x8817('0x7c')]=_0x8817('0x36');respondWithRpcPromise('EventManager',_0x8817('0x7d'),{'event':_0x8817('0x85'),'message':_0x555477['message']},client9002);return _0x3efd2a;}return null;})['then'](respondWithResult(_0x5ee935,null))['catch'](handleError(_0x5ee935,null));};
\ No newline at end of file
index a79e70f..a8b002f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf123=['../../mysqldb','OpenchannelMessage','setMaxListeners','emit','exports'];(function(_0xd49707,_0x51bf26){var _0x44ea22=function(_0x4c6592){while(--_0x4c6592){_0xd49707['push'](_0xd49707['shift']());}};_0x44ea22(++_0x51bf26);}(_0xf123,0x64));var _0x3f12=function(_0xb3b452,_0x582e8e){_0xb3b452=_0xb3b452-0x0;var _0x238983=_0xf123[_0xb3b452];return _0x238983;};'use strict';var EventEmitter=require('events');var OpenchannelMessage=require(_0x3f12('0x0'))['db'][_0x3f12('0x1')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x3f12('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x15b941){return function(_0x3272b4,_0x42dd26,_0x4a3a05){OpenchannelMessageEvents[_0x3f12('0x3')](_0x15b941+':'+_0x3272b4['id'],_0x3272b4);OpenchannelMessageEvents['emit'](_0x15b941,_0x3272b4);_0x4a3a05(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelMessage['hook'](e,emitEvent(event));}}module[_0x3f12('0x4')]=OpenchannelMessageEvents;
\ No newline at end of file
+var _0x9143=['../../mysqldb','OpenchannelMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x1dc068,_0x659b68){var _0x3c6e14=function(_0x2392df){while(--_0x2392df){_0x1dc068['push'](_0x1dc068['shift']());}};_0x3c6e14(++_0x659b68);}(_0x9143,0x7e));var _0x3914=function(_0x130304,_0x424608){_0x130304=_0x130304-0x0;var _0xb85c4c=_0x9143[_0x130304];return _0xb85c4c;};'use strict';var EventEmitter=require('events');var OpenchannelMessage=require(_0x3914('0x0'))['db'][_0x3914('0x1')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x3914('0x2')](0x0);var events={'afterCreate':_0x3914('0x3'),'afterUpdate':_0x3914('0x4'),'afterDestroy':_0x3914('0x5')};function emitEvent(_0x48c75e){return function(_0x581937,_0x1c3739,_0x489535){OpenchannelMessageEvents[_0x3914('0x6')](_0x48c75e+':'+_0x581937['id'],_0x581937);OpenchannelMessageEvents[_0x3914('0x6')](_0x48c75e,_0x581937);_0x489535(null);};}for(var e in events){if(events[_0x3914('0x7')](e)){var event=events[e];OpenchannelMessage[_0x3914('0x8')](e,emitEvent(event));}}module['exports']=OpenchannelMessageEvents;
\ No newline at end of file
index cfbd55a..2e614c4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8e3f=['get','direction','toLowerCase','out','isNil','UserId','OpenchannelInteraction','findOne','then','update','catch','error','secret','CmContact','describe','OpenchannelAccount','find','OpenchannelAccountId','OpenchannelInteractionId','Contact','keys','replyUri','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','Interactions','length','Interaction','omit','POST','method','GET','info','Message\x20%d\x20forwarded\x20to\x20%s','threadId','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','openchannel_messages','fti_openchannel_messages','body','FULLTEXT','models'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8e3f,0xc1));var _0xf8e3=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x8e3f[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0xf8e3('0x0'));var util=require(_0xf8e3('0x1'));var logger=require(_0xf8e3('0x2'))('api');var moment=require(_0xf8e3('0x3'));var BPromise=require(_0xf8e3('0x4'));var rp=require(_0xf8e3('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf8e3('0x6'));var config=require(_0xf8e3('0x7'));var attributes=require('./openchannelMessage.attributes');module[_0xf8e3('0x8')]=function(_0xb21f8d,_0x2621c5){return _0xb21f8d[_0xf8e3('0x9')]('OpenchannelMessage',attributes,{'tableName':_0xf8e3('0xa'),'paranoid':![],'indexes':[{'name':_0xf8e3('0xb'),'fields':[_0xf8e3('0xc')],'type':_0xf8e3('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x38f8e8,_0x4055e2,_0x299a7e){var _0x2a3b59=_0xb21f8d[_0xf8e3('0xe')];var _0x2bc3cd=_0x38f8e8[_0xf8e3('0xf')]({'plain':!![]});if(_0x2bc3cd[_0xf8e3('0x10')]['toLowerCase']()==='in'||_0x2bc3cd[_0xf8e3('0x10')][_0xf8e3('0x11')]()===_0xf8e3('0x12')&&!_0x2bc3cd['secret']&&!_[_0xf8e3('0x13')](_0x2bc3cd[_0xf8e3('0x14')])){_0x2a3b59[_0xf8e3('0x15')][_0xf8e3('0x16')]({'where':{'id':_0x2bc3cd['OpenchannelInteractionId']}})[_0xf8e3('0x17')](function(_0xa856f5){if(_0xa856f5){_0xa856f5[_0xf8e3('0x18')]({'lastMsgAt':_0x2bc3cd['createdAt'],'lastMsgDirection':_0x2bc3cd[_0xf8e3('0x10')]['toLowerCase']()});}})[_0xf8e3('0x19')](function(_0x40c196){console[_0xf8e3('0x1a')](_0x40c196);});}if(_0x2bc3cd['direction']==='out'&&!_0x2bc3cd[_0xf8e3('0x1b')]){var _0x385dde;_0x2a3b59[_0xf8e3('0x1c')][_0xf8e3('0x1d')]()[_0xf8e3('0x17')](function(_0x11d4cc){return _0x2a3b59[_0xf8e3('0x1e')][_0xf8e3('0x1f')]({'where':{'id':_0x2bc3cd[_0xf8e3('0x20')]},'include':[{'model':_0x2a3b59[_0xf8e3('0x15')],'as':'Interactions','where':{'id':_0x2bc3cd[_0xf8e3('0x21')]},'limit':0x1,'include':[{'model':_0x2a3b59[_0xf8e3('0x1c')],'as':_0xf8e3('0x22'),'attributes':_[_0xf8e3('0x23')](_0x11d4cc)}]}]});})[_0xf8e3('0x17')](function(_0x11c58e){_0x385dde=_0x11c58e[_0xf8e3('0xf')]({'plain':!![]});if(_0x385dde&&_0x385dde[_0xf8e3('0x24')]){logger['info'](_0xf8e3('0x25'),_0xf8e3('0x26'),util[_0xf8e3('0x27')](_0xf8e3('0x28'),_0x2bc3cd['id'],_0x385dde['replyUri']));if(_0x385dde[_0xf8e3('0x29')]&&_0x385dde['Interactions'][_0xf8e3('0x2a')]){_0x2bc3cd[_0xf8e3('0x2b')]=_[_0xf8e3('0x2c')](_0x385dde[_0xf8e3('0x29')][0x0],_0xf8e3('0x22'));_0x2bc3cd[_0xf8e3('0x22')]=_0x385dde['Interactions'][0x0][_0xf8e3('0x22')];}var _0x4055e2={'method':_0xf8e3('0x2d'),'uri':encodeURI(_0x385dde[_0xf8e3('0x24')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x4055e2[_0xf8e3('0x2e')]){case _0xf8e3('0x2f'):_0x4055e2['qs']=_0x2bc3cd;break;case _0xf8e3('0x2d'):_0x4055e2[_0xf8e3('0xc')]=_0x2bc3cd;break;}return rp(_0x4055e2)['then'](function(_0x356e0a){logger[_0xf8e3('0x30')](_0xf8e3('0x25'),_0xf8e3('0x26'),util[_0xf8e3('0x27')](_0xf8e3('0x31'),_0x2bc3cd['id'],_0x385dde[_0xf8e3('0x24')]));if(_0x356e0a[_0xf8e3('0xc')]['threadId']&&_0x356e0a[_0xf8e3('0xc')][_0xf8e3('0x32')]!=_0x2bc3cd[_0xf8e3('0x2b')][_0xf8e3('0x32')]){return _0x2a3b59['OpenchannelInteraction'][_0xf8e3('0x18')]({'threadId':_0x356e0a[_0xf8e3('0xc')][_0xf8e3('0x32')]},{'logging':!![],'where':{'id':_0x2bc3cd[_0xf8e3('0x2b')]['id']}});}else{return;}})[_0xf8e3('0x17')](function(){return _0x38f8e8[_0xf8e3('0x18')]({'read':!![]});})[_0xf8e3('0x19')](function(_0x18c8ae){logger['error'](_0xf8e3('0x25'),_0xf8e3('0x26'),util['inspect'](_0x18c8ae,{'showHidden':![],'depth':null}));_0x299a7e();});}else{_0x299a7e();}})['finally'](function(){_0x299a7e();});}else{_0x299a7e();}}},'charset':'utf8mb4','collate':_0xf8e3('0x33')});};
\ No newline at end of file
+var _0x5c00=['afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','replyUri','length','omit','POST','GET','info','OpenchannelMessage,\x20%s,\x20%s','Message\x20%d\x20forwarded\x20to\x20%s','threadId','Interaction','OpenchannelInteraction','catch','inspect','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','exports','define','openchannel_messages','fti_openchannel_messages','body','models','toLowerCase','out','secret','UserId','findOne','OpenchannelInteractionId','then','update','createdAt','direction','error','CmContact','describe','OpenchannelAccount','find','OpenchannelAccountId','Interactions','Contact','keys','get'];(function(_0x16d9a7,_0x290bec){var _0x17532e=function(_0x3e8cc2){while(--_0x3e8cc2){_0x16d9a7['push'](_0x16d9a7['shift']());}};_0x17532e(++_0x290bec);}(_0x5c00,0x17e));var _0x05c0=function(_0x44c7a2,_0x449be7){_0x44c7a2=_0x44c7a2-0x0;var _0x3efc90=_0x5c00[_0x44c7a2];return _0x3efc90;};'use strict';var _=require(_0x05c0('0x0'));var util=require(_0x05c0('0x1'));var logger=require(_0x05c0('0x2'))('api');var moment=require(_0x05c0('0x3'));var BPromise=require('bluebird');var rp=require(_0x05c0('0x4'));var fs=require('fs');var path=require(_0x05c0('0x5'));var rimraf=require(_0x05c0('0x6'));var config=require(_0x05c0('0x7'));var attributes=require('./openchannelMessage.attributes');module[_0x05c0('0x8')]=function(_0x3521fe,_0x261624){return _0x3521fe[_0x05c0('0x9')]('OpenchannelMessage',attributes,{'tableName':_0x05c0('0xa'),'paranoid':![],'indexes':[{'name':_0x05c0('0xb'),'fields':[_0x05c0('0xc')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x32a795,_0x32cdfa,_0x996d6b){var _0x321c09=_0x3521fe[_0x05c0('0xd')];var _0x1edbb=_0x32a795['get']({'plain':!![]});if(_0x1edbb['direction'][_0x05c0('0xe')]()==='in'||_0x1edbb['direction'][_0x05c0('0xe')]()===_0x05c0('0xf')&&!_0x1edbb[_0x05c0('0x10')]&&!_['isNil'](_0x1edbb[_0x05c0('0x11')])){_0x321c09['OpenchannelInteraction'][_0x05c0('0x12')]({'where':{'id':_0x1edbb[_0x05c0('0x13')]}})[_0x05c0('0x14')](function(_0x12deeb){if(_0x12deeb){_0x12deeb[_0x05c0('0x15')]({'lastMsgAt':_0x1edbb[_0x05c0('0x16')],'lastMsgDirection':_0x1edbb[_0x05c0('0x17')][_0x05c0('0xe')]()});}})['catch'](function(_0x238e25){console[_0x05c0('0x18')](_0x238e25);});}if(_0x1edbb[_0x05c0('0x17')]===_0x05c0('0xf')&&!_0x1edbb[_0x05c0('0x10')]){var _0x40153e;_0x321c09[_0x05c0('0x19')][_0x05c0('0x1a')]()[_0x05c0('0x14')](function(_0x521cbd){return _0x321c09[_0x05c0('0x1b')][_0x05c0('0x1c')]({'where':{'id':_0x1edbb[_0x05c0('0x1d')]},'include':[{'model':_0x321c09['OpenchannelInteraction'],'as':_0x05c0('0x1e'),'where':{'id':_0x1edbb[_0x05c0('0x13')]},'limit':0x1,'include':[{'model':_0x321c09[_0x05c0('0x19')],'as':_0x05c0('0x1f'),'attributes':_[_0x05c0('0x20')](_0x521cbd)}]}]});})['then'](function(_0x407c1f){_0x40153e=_0x407c1f[_0x05c0('0x21')]({'plain':!![]});if(_0x40153e&&_0x40153e['replyUri']){logger['info']('OpenchannelMessage,\x20%s,\x20%s',_0x05c0('0x22'),util[_0x05c0('0x23')](_0x05c0('0x24'),_0x1edbb['id'],_0x40153e[_0x05c0('0x25')]));if(_0x40153e[_0x05c0('0x1e')]&&_0x40153e[_0x05c0('0x1e')][_0x05c0('0x26')]){_0x1edbb['Interaction']=_[_0x05c0('0x27')](_0x40153e[_0x05c0('0x1e')][0x0],'Contact');_0x1edbb['Contact']=_0x40153e['Interactions'][0x0]['Contact'];}var _0x32cdfa={'method':_0x05c0('0x28'),'uri':encodeURI(_0x40153e[_0x05c0('0x25')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x32cdfa['method']){case _0x05c0('0x29'):_0x32cdfa['qs']=_0x1edbb;break;case _0x05c0('0x28'):_0x32cdfa[_0x05c0('0xc')]=_0x1edbb;break;}return rp(_0x32cdfa)[_0x05c0('0x14')](function(_0x58769a){logger[_0x05c0('0x2a')](_0x05c0('0x2b'),_0x05c0('0x22'),util[_0x05c0('0x23')](_0x05c0('0x2c'),_0x1edbb['id'],_0x40153e[_0x05c0('0x25')]));if(_0x58769a['body']['threadId']&&_0x58769a[_0x05c0('0xc')][_0x05c0('0x2d')]!=_0x1edbb[_0x05c0('0x2e')][_0x05c0('0x2d')]){return _0x321c09[_0x05c0('0x2f')][_0x05c0('0x15')]({'threadId':_0x58769a[_0x05c0('0xc')][_0x05c0('0x2d')]},{'logging':!![],'where':{'id':_0x1edbb[_0x05c0('0x2e')]['id']}});}else{return;}})[_0x05c0('0x14')](function(){return _0x32a795[_0x05c0('0x15')]({'read':!![]});})[_0x05c0('0x30')](function(_0x50f03d){logger['error'](_0x05c0('0x2b'),_0x05c0('0x22'),util[_0x05c0('0x31')](_0x50f03d,{'showHidden':![],'depth':null}));_0x996d6b();});}else{_0x996d6b();}})['finally'](function(){_0x996d6b();});}else{_0x996d6b();}}},'charset':_0x05c0('0x32'),'collate':_0x05c0('0x33')});};
\ No newline at end of file
index c0d808e..1f4edd8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0b0e=['message','result','OpenchannelMessage','create','body','options','CreateOpenchannelMessage','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./openchannelMessage.socket','then','info','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelMessage,\x20%s,\x20%s'];(function(_0x36b8ed,_0x115d27){var _0x4cbdf7=function(_0x16c74e){while(--_0x16c74e){_0x36b8ed['push'](_0x36b8ed['shift']());}};_0x4cbdf7(++_0x115d27);}(_0x0b0e,0x187));var _0xe0b0=function(_0x346737,_0x3e6081){_0x346737=_0x346737-0x0;var _0x1ade2e=_0x0b0e[_0x346737];return _0x1ade2e;};'use strict';var _=require(_0xe0b0('0x0'));var util=require('util');var moment=require(_0xe0b0('0x1'));var BPromise=require('bluebird');var rs=require(_0xe0b0('0x2'));var fs=require('fs');var Redis=require(_0xe0b0('0x3'));var db=require(_0xe0b0('0x4'))['db'];var utils=require(_0xe0b0('0x5'));var logger=require(_0xe0b0('0x6'))(_0xe0b0('0x7'));var config=require(_0xe0b0('0x8'));var jayson=require(_0xe0b0('0x9'));var client=jayson[_0xe0b0('0xa')][_0xe0b0('0xb')]({'port':0x232a});config[_0xe0b0('0xc')]=_['defaults'](config['redis'],{'host':_0xe0b0('0xd'),'port':0x18eb});var socket=require(_0xe0b0('0xe'))(new Redis(config[_0xe0b0('0xc')]));require(_0xe0b0('0xf'))['register'](socket);function respondWithRpcPromise(_0x338e7c,_0x1dd3b8,_0x553d4f){return new BPromise(function(_0x1fef28,_0x2f32b6){return client['request'](_0x338e7c,_0x553d4f)[_0xe0b0('0x10')](function(_0x2cdad2){logger[_0xe0b0('0x11')]('OpenchannelMessage,\x20%s,\x20%s',_0x1dd3b8,_0xe0b0('0x12'));logger[_0xe0b0('0x13')](_0xe0b0('0x14'),_0x1dd3b8,_0xe0b0('0x12'),JSON[_0xe0b0('0x15')](_0x2cdad2));if(_0x2cdad2['error']){if(_0x2cdad2[_0xe0b0('0x16')][_0xe0b0('0x17')]===0x1f4){logger[_0xe0b0('0x16')](_0xe0b0('0x18'),_0x1dd3b8,_0x2cdad2[_0xe0b0('0x16')]['message']);return _0x2f32b6(_0x2cdad2[_0xe0b0('0x16')]['message']);}logger[_0xe0b0('0x16')](_0xe0b0('0x18'),_0x1dd3b8,_0x2cdad2['error'][_0xe0b0('0x19')]);return _0x1fef28(_0x2cdad2['error'][_0xe0b0('0x19')]);}else{logger[_0xe0b0('0x11')]('OpenchannelMessage,\x20%s,\x20%s',_0x1dd3b8,'request\x20sent');_0x1fef28(_0x2cdad2[_0xe0b0('0x1a')]['message']);}})['catch'](function(_0x4bce65){logger[_0xe0b0('0x16')]('OpenchannelMessage,\x20%s,\x20%s',_0x1dd3b8,_0x4bce65);_0x2f32b6(_0x4bce65);});});}exports['CreateOpenchannelMessage']=function(_0x10cde1){var _0x59dff5=this;return new Promise(function(_0x472286,_0x5dba2f){return db[_0xe0b0('0x1b')][_0xe0b0('0x1c')](_0x10cde1[_0xe0b0('0x1d')],{'raw':_0x10cde1[_0xe0b0('0x1e')]?_0x10cde1[_0xe0b0('0x1e')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x2fa820){logger['info'](_0xe0b0('0x1f'),_0x10cde1);logger[_0xe0b0('0x13')]('CreateOpenchannelMessage',_0x10cde1,JSON[_0xe0b0('0x15')](_0x2fa820));_0x472286(_0x2fa820);})['catch'](function(_0x2208d0){logger['error'](_0xe0b0('0x1f'),_0x2208d0['message'],_0x10cde1);_0x5dba2f(_0x59dff5[_0xe0b0('0x16')](0x1f4,_0x2208d0['message']));});});};
\ No newline at end of file
+var _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(_0x47230d,_0x3bb8b5){var _0x3099aa=function(_0x365f63){while(--_0x365f63){_0x47230d['push'](_0x47230d['shift']());}};_0x3099aa(++_0x3bb8b5);}(_0x5f2f,0x73));var _0xf5f2=function(_0x1dbf67,_0x353051){_0x1dbf67=_0x1dbf67-0x0;var _0x13a4e9=_0x5f2f[_0x1dbf67];return _0x13a4e9;};'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 6cfc6e9..d7f8a3b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x24ca=['removeListener','register','length','openchannelMessage:','./openchannelMessage.events','remove','update','emit'];(function(_0x392be3,_0xf1d603){var _0x1453b2=function(_0x5bdce8){while(--_0x5bdce8){_0x392be3['push'](_0x392be3['shift']());}};_0x1453b2(++_0xf1d603);}(_0x24ca,0x1bc));var _0xa24c=function(_0x2ae2ad,_0xac5b0c){_0x2ae2ad=_0x2ae2ad-0x0;var _0x26dbd7=_0x24ca[_0x2ae2ad];return _0x26dbd7;};'use strict';var OpenchannelMessageEvents=require(_0xa24c('0x0'));var events=['save',_0xa24c('0x1'),_0xa24c('0x2')];function createListener(_0x4defb1,_0x5876d6){return function(_0x18497e){_0x5876d6[_0xa24c('0x3')](_0x4defb1,_0x18497e);};}function removeListener(_0x195e60,_0x28aa2f){return function(){OpenchannelMessageEvents[_0xa24c('0x4')](_0x195e60,_0x28aa2f);};}exports[_0xa24c('0x5')]=function(_0xf0511){for(var _0x3c0aaa=0x0,_0x2dd348=events[_0xa24c('0x6')];_0x3c0aaa<_0x2dd348;_0x3c0aaa++){var _0x9a5013=events[_0x3c0aaa];var _0x481196=createListener(_0xa24c('0x7')+_0x9a5013,_0xf0511);OpenchannelMessageEvents['on'](_0x9a5013,_0x481196);}};
\ No newline at end of file
+var _0x004c=['./openchannelMessage.events','save','remove','update','emit','removeListener','openchannelMessage:'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x004c,0x85));var _0xc004=function(_0x176329,_0x568c84){_0x176329=_0x176329-0x0;var _0x31997c=_0x004c[_0x176329];return _0x31997c;};'use strict';var OpenchannelMessageEvents=require(_0xc004('0x0'));var events=[_0xc004('0x1'),_0xc004('0x2'),_0xc004('0x3')];function createListener(_0x4c7289,_0x3b45e9){return function(_0x4016c5){_0x3b45e9[_0xc004('0x4')](_0x4c7289,_0x4016c5);};}function removeListener(_0x38a8b9,_0x571646){return function(){OpenchannelMessageEvents[_0xc004('0x5')](_0x38a8b9,_0x571646);};}exports['register']=function(_0x2c7142){for(var _0x25a58b=0x0,_0x5ef023=events['length'];_0x25a58b<_0x5ef023;_0x25a58b++){var _0x1b5007=events[_0x25a58b];var _0x46dcf9=createListener(_0xc004('0x6')+_0x1b5007,_0x2c7142);OpenchannelMessageEvents['on'](_0x1b5007,_0x46dcf9);}};
\ No newline at end of file
index 7ab8b40..f31f438 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3393=['addAgents','update','destroy','delete','removeTeams','removeAgents','exports','multer','util','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./openchannelQueue.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','/:id/users','getAgents','post','create','addTeams'];(function(_0xe53b37,_0x370a11){var _0x507c22=function(_0x31f0a9){while(--_0x31f0a9){_0xe53b37['push'](_0xe53b37['shift']());}};_0x507c22(++_0x370a11);}(_0x3393,0x146));var _0x3339=function(_0x286b23,_0x1e85fd){_0x286b23=_0x286b23-0x0;var _0x2116c0=_0x3393[_0x286b23];return _0x2116c0;};'use strict';var multer=require(_0x3339('0x0'));var util=require(_0x3339('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x3339('0x2'));var router=express[_0x3339('0x3')]();var fs_extra=require(_0x3339('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3339('0x5'));var config=require(_0x3339('0x6'));var controller=require(_0x3339('0x7'));router[_0x3339('0x8')]('/',auth[_0x3339('0x9')](),controller['index']);router[_0x3339('0x8')](_0x3339('0xa'),auth['isAuthenticated'](),controller[_0x3339('0xb')]);router['get'](_0x3339('0xc'),auth[_0x3339('0x9')](),controller[_0x3339('0xd')]);router[_0x3339('0x8')](_0x3339('0xe'),auth[_0x3339('0x9')](),controller[_0x3339('0xf')]);router[_0x3339('0x8')](_0x3339('0x10'),auth[_0x3339('0x9')](),controller['getTeams']);router['get'](_0x3339('0x11'),auth[_0x3339('0x9')](),controller[_0x3339('0x12')]);router[_0x3339('0x13')]('/',auth[_0x3339('0x9')](),controller[_0x3339('0x14')]);router[_0x3339('0x13')](_0x3339('0x10'),auth[_0x3339('0x9')](),controller[_0x3339('0x15')]);router['post'](_0x3339('0x11'),auth['isAuthenticated'](),controller[_0x3339('0x16')]);router['put']('/:id',auth[_0x3339('0x9')](),controller[_0x3339('0x17')]);router['delete'](_0x3339('0xc'),auth[_0x3339('0x9')](),controller[_0x3339('0x18')]);router[_0x3339('0x19')](_0x3339('0x10'),auth[_0x3339('0x9')](),controller[_0x3339('0x1a')]);router[_0x3339('0x19')](_0x3339('0x11'),auth[_0x3339('0x9')](),controller[_0x3339('0x1b')]);module[_0x3339('0x1c')]=router;
\ No newline at end of file
+var _0x426b=['getTeams','/:id/users','getAgents','post','create','addTeams','put','update','delete','removeTeams','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueue.controller','get','isAuthenticated','index','describe','/:id','show','/:id/members','getMembers','/:id/teams'];(function(_0x3a0598,_0x5871fe){var _0x3c9326=function(_0x140ee7){while(--_0x140ee7){_0x3a0598['push'](_0x3a0598['shift']());}};_0x3c9326(++_0x5871fe);}(_0x426b,0x193));var _0xb426=function(_0x240eee,_0x249118){_0x240eee=_0x240eee-0x0;var _0x411632=_0x426b[_0x240eee];return _0x411632;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xb426('0x0'));var timeout=require(_0xb426('0x1'));var express=require(_0xb426('0x2'));var router=express[_0xb426('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xb426('0x4'));var interaction=require(_0xb426('0x5'));var config=require(_0xb426('0x6'));var controller=require(_0xb426('0x7'));router[_0xb426('0x8')]('/',auth[_0xb426('0x9')](),controller[_0xb426('0xa')]);router['get']('/describe',auth[_0xb426('0x9')](),controller[_0xb426('0xb')]);router['get'](_0xb426('0xc'),auth[_0xb426('0x9')](),controller[_0xb426('0xd')]);router['get'](_0xb426('0xe'),auth[_0xb426('0x9')](),controller[_0xb426('0xf')]);router[_0xb426('0x8')](_0xb426('0x10'),auth[_0xb426('0x9')](),controller[_0xb426('0x11')]);router[_0xb426('0x8')](_0xb426('0x12'),auth[_0xb426('0x9')](),controller[_0xb426('0x13')]);router[_0xb426('0x14')]('/',auth[_0xb426('0x9')](),controller[_0xb426('0x15')]);router[_0xb426('0x14')](_0xb426('0x10'),auth[_0xb426('0x9')](),controller[_0xb426('0x16')]);router['post']('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router[_0xb426('0x17')](_0xb426('0xc'),auth[_0xb426('0x9')](),controller[_0xb426('0x18')]);router[_0xb426('0x19')]('/:id',auth[_0xb426('0x9')](),controller['destroy']);router[_0xb426('0x19')]('/:id/teams',auth['isAuthenticated'](),controller[_0xb426('0x1a')]);router[_0xb426('0x19')](_0xb426('0x12'),auth['isAuthenticated'](),controller['removeAgents']);module[_0xb426('0x1b')]=router;
\ No newline at end of file
index c11bbd1..6450c35 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x35e7=['beepall','roundrobin','sequelize','exports','STRING','name','INTEGER','ENUM','rrmemory'];(function(_0x5a069e,_0x55e9d7){var _0x298a0a=function(_0x5dea86){while(--_0x5dea86){_0x5a069e['push'](_0x5a069e['shift']());}};_0x298a0a(++_0x55e9d7);}(_0x35e7,0x1bb));var _0x735e=function(_0x9cd4c3,_0x1c9b2c){_0x9cd4c3=_0x9cd4c3-0x0;var _0x4c9025=_0x35e7[_0x9cd4c3];return _0x4c9025;};'use strict';var Sequelize=require(_0x735e('0x0'));module[_0x735e('0x1')]={'name':{'type':Sequelize[_0x735e('0x2')],'unique':_0x735e('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x735e('0x2')]},'timeout':{'type':Sequelize[_0x735e('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x735e('0x5')](_0x735e('0x6'),_0x735e('0x7'),_0x735e('0x8'))}};
\ No newline at end of file
+var _0xaac8=['rrmemory','roundrobin','sequelize','STRING','name','INTEGER'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xaac8,0x1a6));var _0x8aac=function(_0x4a53d,_0x58a95e){_0x4a53d=_0x4a53d-0x0;var _0x27410e=_0xaac8[_0x4a53d];return _0x27410e;};'use strict';var Sequelize=require(_0x8aac('0x0'));module['exports']={'name':{'type':Sequelize[_0x8aac('0x1')],'unique':_0x8aac('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x8aac('0x1')]},'timeout':{'type':Sequelize[_0x8aac('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x8aac('0x4'),'beepall',_0x8aac('0x5'))}};
\ No newline at end of file
index 10ba96f..bb4e056 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb3c6=['fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./openchannelQueue.socket','register','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','get','OpenchannelQueues','UserProfileResource','sendStatus','error','name','OpenchannelQueue','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','describe','UserOpenchannelQueue','OpenchannelQueueId','UserId','agent','openchannelPause','updatedAt','createdAt','format','%s/%s','getTeams','findOne','addTeams','ids','Team','Agents','online','voicePause','interface','transaction','emit','userOpenchannelQueue:save','removeTeams','User','select','field','tq.TeamId','from','team_has_openchannel_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','push','sequelize','QueryTypes','SELECT','every','includes','union','compact','removeAgents','userOpenchannelQueue:remove','addAgents','isArray','getAgents','eml-format','zip-dir'];(function(_0x2d1efc,_0x56cd3e){var _0xc0a55f=function(_0x32d589){while(--_0x32d589){_0x2d1efc['push'](_0x2d1efc['shift']());}};_0xc0a55f(++_0x56cd3e);}(_0xb3c6,0x82));var _0x6b3c=function(_0xb13d17,_0x1cd499){_0xb13d17=_0xb13d17-0x0;var _0x23c99e=_0xb3c6[_0xb13d17];return _0x23c99e;};'use strict';var emlformat=require(_0x6b3c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6b3c('0x1'));var jsonpatch=require(_0x6b3c('0x2'));var rp=require(_0x6b3c('0x3'));var moment=require(_0x6b3c('0x4'));var BPromise=require(_0x6b3c('0x5'));var Mustache=require(_0x6b3c('0x6'));var util=require(_0x6b3c('0x7'));var path=require(_0x6b3c('0x8'));var sox=require(_0x6b3c('0x9'));var csv=require(_0x6b3c('0xa'));var ejs=require(_0x6b3c('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6b3c('0xc'));var squel=require(_0x6b3c('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x6b3c('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x6b3c('0xe'));var authService=require(_0x6b3c('0xf'));var qs=require(_0x6b3c('0x10'));var as=require(_0x6b3c('0x11'));var hardwareService=require(_0x6b3c('0x12'));var logger=require(_0x6b3c('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x6b3c('0x14'));var db=require(_0x6b3c('0x15'))['db'];config[_0x6b3c('0x16')]=_['defaults'](config[_0x6b3c('0x16')],{'host':_0x6b3c('0x17'),'port':0x18eb});var socket=require(_0x6b3c('0x18'))(new Redis(config['redis']));require(_0x6b3c('0x19'))[_0x6b3c('0x1a')](socket);function respondWithStatusCode(_0x3e81c5,_0x1efac8){_0x1efac8=_0x1efac8||0xcc;return function(_0x4ed671){if(_0x4ed671){return _0x3e81c5['sendStatus'](_0x1efac8);}return _0x3e81c5[_0x6b3c('0x1b')](_0x1efac8)[_0x6b3c('0x1c')]();};}function respondWithResult(_0x2f3aa6,_0x2cf64b){_0x2cf64b=_0x2cf64b||0xc8;return function(_0x158618){if(_0x158618){return _0x2f3aa6[_0x6b3c('0x1b')](_0x2cf64b)[_0x6b3c('0x1d')](_0x158618);}};}function respondWithFilteredResult(_0x352f8c,_0xaec809){return function(_0x1809b9){if(_0x1809b9){var _0x4ade7d=typeof _0xaec809[_0x6b3c('0x1e')]===_0x6b3c('0x1f')&&typeof _0xaec809['limit']===_0x6b3c('0x1f');var _0x38dd14=_0x1809b9['count'];var _0x392434=_0x4ade7d?0x0:_0xaec809[_0x6b3c('0x1e')];var _0x3a2dcb=_0x4ade7d?_0x1809b9[_0x6b3c('0x20')]:_0xaec809['offset']+_0xaec809[_0x6b3c('0x21')];var _0x7f0e7a;if(_0x3a2dcb>=_0x38dd14){_0x3a2dcb=_0x38dd14;_0x7f0e7a=0xc8;}else{_0x7f0e7a=0xce;}_0x352f8c[_0x6b3c('0x1b')](_0x7f0e7a);return _0x352f8c[_0x6b3c('0x22')](_0x6b3c('0x23'),_0x392434+'-'+_0x3a2dcb+'/'+_0x38dd14)[_0x6b3c('0x1d')](_0x1809b9);}return null;};}function patchUpdates(_0x15b217){return function(_0x100e13){try{jsonpatch[_0x6b3c('0x24')](_0x100e13,_0x15b217,!![]);}catch(_0x28b5a2){return BPromise[_0x6b3c('0x25')](_0x28b5a2);}return _0x100e13['save']();};}function saveUpdates(_0x15a17d,_0x32a3ba){return function(_0x179790){if(_0x179790){return _0x179790[_0x6b3c('0x26')](_0x15a17d)[_0x6b3c('0x27')](function(_0x390da3){return _0x390da3;});}return null;};}function removeEntity(_0x146a43,_0x2af36f){return function(_0x28e422){if(_0x28e422){return _0x28e422['destroy']()['then'](function(){var _0x4dfab7=_0x28e422[_0x6b3c('0x28')]({'plain':!![]});var _0x9ab60d=_0x6b3c('0x29');return db[_0x6b3c('0x2a')]['destroy']({'where':{'type':_0x9ab60d,'resourceId':_0x4dfab7['id']}})[_0x6b3c('0x27')](function(){return _0x28e422;});})[_0x6b3c('0x27')](function(){_0x146a43[_0x6b3c('0x1b')](0xcc)[_0x6b3c('0x1c')]();});}};}function handleEntityNotFound(_0x452a0e,_0x29861e){return function(_0x412b06){if(!_0x412b06){_0x452a0e[_0x6b3c('0x2b')](0x194);}return _0x412b06;};}function handleError(_0x2c19ec,_0x9ad88){_0x9ad88=_0x9ad88||0x1f4;return function(_0x20cc0f){logger[_0x6b3c('0x2c')](_0x20cc0f['stack']);if(_0x20cc0f[_0x6b3c('0x2d')]){delete _0x20cc0f['name'];}_0x2c19ec[_0x6b3c('0x1b')](_0x9ad88)['send'](_0x20cc0f);};}exports['index']=function(_0x56bc65,_0x1cbdc9){var _0x385b72={},_0x25d951={},_0x8de6b4={'count':0x0,'rows':[]};var _0x20bda8=_['map'](db[_0x6b3c('0x2e')][_0x6b3c('0x2f')],function(_0x27c2bd){return{'name':_0x27c2bd[_0x6b3c('0x30')],'type':_0x27c2bd[_0x6b3c('0x31')][_0x6b3c('0x32')]};});_0x25d951[_0x6b3c('0x33')]=_[_0x6b3c('0x34')](_0x20bda8,_0x6b3c('0x2d'));_0x25d951[_0x6b3c('0x35')]=_['keys'](_0x56bc65[_0x6b3c('0x35')]);_0x25d951[_0x6b3c('0x36')]=_[_0x6b3c('0x37')](_0x25d951[_0x6b3c('0x33')],_0x25d951['query']);_0x385b72[_0x6b3c('0x38')]=_['intersection'](_0x25d951[_0x6b3c('0x33')],qs[_0x6b3c('0x39')](_0x56bc65[_0x6b3c('0x35')][_0x6b3c('0x39')]));_0x385b72[_0x6b3c('0x38')]=_0x385b72[_0x6b3c('0x38')][_0x6b3c('0x3a')]?_0x385b72[_0x6b3c('0x38')]:_0x25d951[_0x6b3c('0x33')];if(!_0x56bc65['query'][_0x6b3c('0x3b')](_0x6b3c('0x3c'))){_0x385b72['limit']=qs[_0x6b3c('0x21')](_0x56bc65[_0x6b3c('0x35')][_0x6b3c('0x21')]);_0x385b72[_0x6b3c('0x1e')]=qs[_0x6b3c('0x1e')](_0x56bc65['query'][_0x6b3c('0x1e')]);}_0x385b72[_0x6b3c('0x3d')]=qs['sort'](_0x56bc65[_0x6b3c('0x35')][_0x6b3c('0x3e')]);_0x385b72[_0x6b3c('0x3f')]=qs[_0x6b3c('0x36')](_[_0x6b3c('0x40')](_0x56bc65[_0x6b3c('0x35')],_0x25d951[_0x6b3c('0x36')]),_0x20bda8);if(_0x56bc65[_0x6b3c('0x35')][_0x6b3c('0x41')]){_0x385b72['where']=_[_0x6b3c('0x42')](_0x385b72[_0x6b3c('0x3f')],{'$or':_[_0x6b3c('0x34')](_0x20bda8,function(_0x5af7bf){if(_0x5af7bf[_0x6b3c('0x31')]!==_0x6b3c('0x43')){var _0x28a3c5={};_0x28a3c5[_0x5af7bf[_0x6b3c('0x2d')]]={'$like':'%'+_0x56bc65[_0x6b3c('0x35')][_0x6b3c('0x41')]+'%'};return _0x28a3c5;}})});}_0x385b72=_['merge']({},_0x385b72,_0x56bc65[_0x6b3c('0x44')]);var _0xeaa250={'where':_0x385b72[_0x6b3c('0x3f')]};return db[_0x6b3c('0x2e')][_0x6b3c('0x20')](_0xeaa250)[_0x6b3c('0x27')](function(_0x19a8a6){_0x8de6b4[_0x6b3c('0x20')]=_0x19a8a6;if(_0x56bc65['query'][_0x6b3c('0x45')]){_0x385b72[_0x6b3c('0x46')]=[{'all':!![]}];}return db[_0x6b3c('0x2e')][_0x6b3c('0x47')](_0x385b72);})[_0x6b3c('0x27')](function(_0x55fe65){_0x8de6b4[_0x6b3c('0x48')]=_0x55fe65;return _0x8de6b4;})[_0x6b3c('0x27')](respondWithFilteredResult(_0x1cbdc9,_0x385b72))[_0x6b3c('0x49')](handleError(_0x1cbdc9,null));};exports[_0x6b3c('0x4a')]=function(_0x52d462,_0x192487){var _0x37af40={'raw':!![],'where':{'id':_0x52d462[_0x6b3c('0x4b')]['id']}},_0x54e9fc={};_0x54e9fc[_0x6b3c('0x33')]=_[_0x6b3c('0x4c')](db[_0x6b3c('0x2e')]['rawAttributes']);_0x54e9fc[_0x6b3c('0x35')]=_[_0x6b3c('0x4c')](_0x52d462[_0x6b3c('0x35')]);_0x54e9fc['filters']=_[_0x6b3c('0x37')](_0x54e9fc[_0x6b3c('0x33')],_0x54e9fc[_0x6b3c('0x35')]);_0x37af40[_0x6b3c('0x38')]=_['intersection'](_0x54e9fc[_0x6b3c('0x33')],qs[_0x6b3c('0x39')](_0x52d462[_0x6b3c('0x35')][_0x6b3c('0x39')]));_0x37af40[_0x6b3c('0x38')]=_0x37af40[_0x6b3c('0x38')][_0x6b3c('0x3a')]?_0x37af40[_0x6b3c('0x38')]:_0x54e9fc['model'];if(_0x52d462[_0x6b3c('0x35')]['includeAll']){_0x37af40[_0x6b3c('0x46')]=[{'all':!![]}];}_0x37af40=_['merge']({},_0x37af40,_0x52d462['options']);return db[_0x6b3c('0x2e')]['find'](_0x37af40)[_0x6b3c('0x27')](handleEntityNotFound(_0x192487,null))['then'](respondWithResult(_0x192487,null))[_0x6b3c('0x49')](handleError(_0x192487,null));};exports['create']=function(_0x2ff8f3,_0x15efd5){return db['OpenchannelQueue']['create'](_0x2ff8f3[_0x6b3c('0x4d')],{})['then'](function(_0x3fd5f3){var _0x561fb4=_0x2ff8f3[_0x6b3c('0x4e')][_0x6b3c('0x28')]({'plain':!![]});if(!_0x561fb4)throw new Error(_0x6b3c('0x4f'));if(_0x561fb4[_0x6b3c('0x50')]===_0x6b3c('0x4e')){var _0x57fcbf=_0x3fd5f3[_0x6b3c('0x28')]({'plain':!![]});var _0x33f0a='OpenchannelQueues';return db['UserProfileSection']['find']({'where':{'name':_0x33f0a,'userProfileId':_0x561fb4[_0x6b3c('0x51')]},'raw':!![]})[_0x6b3c('0x27')](function(_0x428aed){if(_0x428aed&&_0x428aed[_0x6b3c('0x52')]===0x0){return db[_0x6b3c('0x2a')][_0x6b3c('0x53')]({'name':_0x57fcbf['name'],'resourceId':_0x57fcbf['id'],'type':_0x428aed[_0x6b3c('0x2d')],'sectionId':_0x428aed['id']},{})[_0x6b3c('0x27')](function(){return _0x3fd5f3;});}else{return _0x3fd5f3;}})[_0x6b3c('0x49')](function(_0x4e4bdc){logger[_0x6b3c('0x2c')](_0x6b3c('0x54'),_0x4e4bdc);throw _0x4e4bdc;});}return _0x3fd5f3;})['then'](respondWithResult(_0x15efd5,0xc9))[_0x6b3c('0x49')](handleError(_0x15efd5,null));};exports[_0x6b3c('0x26')]=function(_0x46be6c,_0x4a3d60){if(_0x46be6c[_0x6b3c('0x4d')]['id']){delete _0x46be6c['body']['id'];}return db[_0x6b3c('0x2e')][_0x6b3c('0x55')]({'where':{'id':_0x46be6c[_0x6b3c('0x4b')]['id']}})[_0x6b3c('0x27')](handleEntityNotFound(_0x4a3d60,null))[_0x6b3c('0x27')](saveUpdates(_0x46be6c['body'],null))[_0x6b3c('0x27')](respondWithResult(_0x4a3d60,null))['catch'](handleError(_0x4a3d60,null));};exports['destroy']=function(_0x52d769,_0x5c0f3a){return db[_0x6b3c('0x2e')][_0x6b3c('0x55')]({'where':{'id':_0x52d769[_0x6b3c('0x4b')]['id']}})[_0x6b3c('0x27')](handleEntityNotFound(_0x5c0f3a,null))[_0x6b3c('0x27')](removeEntity(_0x5c0f3a,null))[_0x6b3c('0x49')](handleError(_0x5c0f3a,null));};exports[_0x6b3c('0x56')]=function(_0x1ebded,_0x13bd57){return db[_0x6b3c('0x2e')][_0x6b3c('0x56')]()[_0x6b3c('0x27')](respondWithResult(_0x13bd57,null))[_0x6b3c('0x49')](handleError(_0x13bd57,null));};exports['getMembers']=function(_0x51ba11,_0x5dbe6c,_0x1b28a3){var _0x1c7cde={'raw':!![],'where':{}},_0xdb6895={},_0x5c5728;return db[_0x6b3c('0x2e')]['findOne']({'where':{'id':_0x51ba11['params']['id']}})[_0x6b3c('0x27')](handleEntityNotFound(_0x5dbe6c,null))[_0x6b3c('0x27')](function(_0x2ba965){if(_0x2ba965){_0x5c5728=_0x2ba965['get']({'plain':!![]});_0xdb6895[_0x6b3c('0x33')]=_[_0x6b3c('0x4c')](db[_0x6b3c('0x57')][_0x6b3c('0x2f')]);_0xdb6895[_0x6b3c('0x35')]=_['keys'](_0x51ba11[_0x6b3c('0x35')]);_0xdb6895[_0x6b3c('0x36')]=_[_0x6b3c('0x37')](_0xdb6895[_0x6b3c('0x33')],_0xdb6895[_0x6b3c('0x35')]);_0x1c7cde[_0x6b3c('0x38')]=_[_0x6b3c('0x37')](_0xdb6895[_0x6b3c('0x33')],qs[_0x6b3c('0x39')](_0x51ba11[_0x6b3c('0x35')][_0x6b3c('0x39')]));_0x1c7cde['attributes']=_0x1c7cde['attributes']['length']?_0x1c7cde[_0x6b3c('0x38')]:_0xdb6895[_0x6b3c('0x33')];if(!_0x51ba11[_0x6b3c('0x35')][_0x6b3c('0x3b')]('nolimit')){_0x1c7cde[_0x6b3c('0x21')]=qs['limit'](_0x51ba11[_0x6b3c('0x35')][_0x6b3c('0x21')]);_0x1c7cde['offset']=qs[_0x6b3c('0x1e')](_0x51ba11[_0x6b3c('0x35')]['offset']);}_0x1c7cde['order']=qs[_0x6b3c('0x3e')](_0x51ba11[_0x6b3c('0x35')][_0x6b3c('0x3e')]);_0x1c7cde[_0x6b3c('0x3f')]=qs['filters'](_['pick'](_0x51ba11[_0x6b3c('0x35')],_0xdb6895[_0x6b3c('0x36')]));_0x1c7cde['where'][_0x6b3c('0x58')]=_0x2ba965['id'];if(_0x51ba11[_0x6b3c('0x35')][_0x6b3c('0x41')]){_0x1c7cde['where']=_[_0x6b3c('0x42')](_0x1c7cde['where'],{'$or':_[_0x6b3c('0x34')](_0x1c7cde[_0x6b3c('0x38')],function(_0x23c08c){var _0xa86eaf={};_0xa86eaf[_0x23c08c]={'$like':'%'+_0x51ba11[_0x6b3c('0x35')][_0x6b3c('0x41')]+'%'};return _0xa86eaf;})});}_0x1c7cde=_['merge']({},_0x1c7cde,_0x51ba11[_0x6b3c('0x44')]);return db[_0x6b3c('0x57')][_0x6b3c('0x47')](_0x1c7cde);}})[_0x6b3c('0x27')](function(_0xee5c27){if(_0xee5c27){return db['User']['findAndCountAll']({'where':{'id':_['map'](_0xee5c27,_0x6b3c('0x59')),'role':_0x6b3c('0x5a')},'attributes':['id',_0x6b3c('0x2d'),_0x6b3c('0x5b'),_0x6b3c('0x5c'),_0x6b3c('0x5d')]});}})[_0x6b3c('0x27')](function(_0x26a7c5){if(_0x26a7c5){return{'count':_0x26a7c5['count'],'rows':_[_0x6b3c('0x34')](_0x26a7c5[_0x6b3c('0x48')],function(_0xf682e1){return{'membername':_0xf682e1[_0x6b3c('0x2d')],'UserId':_0xf682e1['id'],'queue_name':_0x5c5728[_0x6b3c('0x2d')],'OpenchannelQueueId':_0x5c5728['id'],'interface':util[_0x6b3c('0x5e')](_0x6b3c('0x5f'),'SIP',_0xf682e1['name']),'penalty':0x0,'paused':_0xf682e1[_0x6b3c('0x5b')],'createdAt':_0xf682e1['createdAt'],'updatedAt':_0xf682e1[_0x6b3c('0x5c')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x6b3c('0x27')](respondWithFilteredResult(_0x5dbe6c,_0x1c7cde))[_0x6b3c('0x49')](handleError(_0x5dbe6c,null));};exports[_0x6b3c('0x60')]=function(_0x2d1ae2,_0x3aa534,_0x17edb1){var _0x44f565={};var _0x564b85={};var _0x39c082;var _0x3b88f9;return db[_0x6b3c('0x2e')][_0x6b3c('0x61')]({'where':{'id':_0x2d1ae2[_0x6b3c('0x4b')]['id']}})[_0x6b3c('0x27')](handleEntityNotFound(_0x3aa534,null))[_0x6b3c('0x27')](function(_0x7f5abd){if(_0x7f5abd){_0x39c082=_0x7f5abd;_0x564b85[_0x6b3c('0x33')]=_['keys'](db['Team'][_0x6b3c('0x2f')]);_0x564b85[_0x6b3c('0x35')]=_[_0x6b3c('0x4c')](_0x2d1ae2[_0x6b3c('0x35')]);_0x564b85[_0x6b3c('0x36')]=_['intersection'](_0x564b85[_0x6b3c('0x33')],_0x564b85[_0x6b3c('0x35')]);_0x44f565[_0x6b3c('0x38')]=_[_0x6b3c('0x37')](_0x564b85[_0x6b3c('0x33')],qs[_0x6b3c('0x39')](_0x2d1ae2[_0x6b3c('0x35')][_0x6b3c('0x39')]));_0x44f565['attributes']=_0x44f565[_0x6b3c('0x38')][_0x6b3c('0x3a')]?_0x44f565['attributes']:_0x564b85['model'];_0x44f565[_0x6b3c('0x3d')]=qs[_0x6b3c('0x3e')](_0x2d1ae2['query'][_0x6b3c('0x3e')]);_0x44f565[_0x6b3c('0x3f')]=qs[_0x6b3c('0x36')](_['pick'](_0x2d1ae2[_0x6b3c('0x35')],_0x564b85[_0x6b3c('0x36')]));if(_0x2d1ae2[_0x6b3c('0x35')]['filter']){_0x44f565['where']=_[_0x6b3c('0x42')](_0x44f565[_0x6b3c('0x3f')],{'$or':_['map'](_0x44f565[_0x6b3c('0x38')],function(_0x2c2fc8){var _0x50293f={};_0x50293f[_0x2c2fc8]={'$like':'%'+_0x2d1ae2['query']['filter']+'%'};return _0x50293f;})});}_0x44f565=_[_0x6b3c('0x42')]({},_0x44f565,_0x2d1ae2[_0x6b3c('0x44')]);return _0x39c082[_0x6b3c('0x60')](_0x44f565);}})[_0x6b3c('0x27')](function(_0x4a437a){if(_0x4a437a){_0x3b88f9=_0x4a437a['length'];if(!_0x2d1ae2[_0x6b3c('0x35')]['hasOwnProperty'](_0x6b3c('0x3c'))){_0x44f565['limit']=qs[_0x6b3c('0x21')](_0x2d1ae2['query'][_0x6b3c('0x21')]);_0x44f565[_0x6b3c('0x1e')]=qs[_0x6b3c('0x1e')](_0x2d1ae2[_0x6b3c('0x35')][_0x6b3c('0x1e')]);}return _0x39c082[_0x6b3c('0x60')](_0x44f565);}})[_0x6b3c('0x27')](function(_0x531b6f){if(_0x531b6f){return _0x531b6f?{'count':_0x3b88f9,'rows':_0x531b6f}:null;}})['then'](respondWithResult(_0x3aa534,null))[_0x6b3c('0x49')](handleError(_0x3aa534,null));};exports[_0x6b3c('0x62')]=function(_0x34344d,_0x48e35e,_0x33a2ad){var _0xf48b08=_0x34344d[_0x6b3c('0x4d')][_0x6b3c('0x63')];return db[_0x6b3c('0x64')]['findAll']({'where':{'id':_0xf48b08},'attributes':['id'],'include':[{'model':db['User'],'as':_0x6b3c('0x65'),'attributes':['id',_0x6b3c('0x2d'),_0x6b3c('0x66'),_0x6b3c('0x67'),_0x6b3c('0x68')],'raw':!![]}]})[_0x6b3c('0x27')](function(_0x4f4389){if(_0x4f4389){var _0x54326b=_['flatMap'](_0x4f4389,function(_0x158c77){var _0x36c826=_0x158c77[_0x6b3c('0x28')]({'plain':!![]});return _0x36c826[_0x6b3c('0x65')];});return db['OpenchannelQueue'][_0x6b3c('0x55')]({'where':{'id':_0x34344d['params']['id']}})[_0x6b3c('0x27')](function(_0x4af54e){return db['sequelize'][_0x6b3c('0x69')](function(_0x5d7500){return _0x4af54e['addTeams'](_0xf48b08,{'transaction':_0x5d7500})[_0x6b3c('0x27')](function(){return BPromise['each'](_0x54326b,function(_0x47f8dd){return db['UserOpenchannelQueue']['findOrCreate']({'where':{'UserId':_0x47f8dd['id'],'OpenchannelQueueId':_0x34344d['params']['id']},'transaction':_0x5d7500});});})[_0x6b3c('0x27')](function(){_0x54326b['forEach'](function(_0x9769d0){socket[_0x6b3c('0x6a')](_0x6b3c('0x6b'),{'UserId':_0x9769d0['id'],'OpenchannelQueueId':_0x4af54e['id']});});});});});}})[_0x6b3c('0x27')](respondWithStatusCode(_0x48e35e,null))[_0x6b3c('0x49')](handleError(_0x48e35e,null));};exports[_0x6b3c('0x6c')]=function(_0x45505a,_0x4ddcd1,_0x574c32){return db[_0x6b3c('0x64')][_0x6b3c('0x47')]({'where':{'id':_0x45505a[_0x6b3c('0x35')][_0x6b3c('0x63')]},'attributes':['id'],'include':[{'model':db[_0x6b3c('0x6d')],'as':_0x6b3c('0x65'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x4ddcd1,null))[_0x6b3c('0x27')](function(_0x248769){var _0x117d8a=_[_0x6b3c('0x34')](_0x248769,'id');var _0x39a428=[];var _0x45878f=[];var _0x39f947=squel[_0x6b3c('0x6e')]();_0x39f947[_0x6b3c('0x6f')](_0x6b3c('0x70'))[_0x6b3c('0x71')](_0x6b3c('0x72'),'tq')[_0x6b3c('0x73')](_0x6b3c('0x74'),'ut',_0x6b3c('0x75'))[_0x6b3c('0x3f')](_0x6b3c('0x76'),_0x45505a[_0x6b3c('0x4b')]['id']);for(var _0x104388=0x0;_0x104388<_0x248769[_0x6b3c('0x3a')];_0x104388+=0x1){let _0xf25af6=_0x248769[_0x104388];for(var _0x937a2a=0x0;_0x937a2a<_0xf25af6['Agents'][_0x6b3c('0x3a')];_0x937a2a+=0x1){let _0x1cf174=_0xf25af6[_0x6b3c('0x65')][_0x937a2a];var _0x1584a7=_0x39f947['clone']();_0x1584a7[_0x6b3c('0x3f')]('ut.UserId\x20=\x20?',_0x1cf174['id']);_0x45878f[_0x6b3c('0x77')](db['sequelize'][_0x6b3c('0x35')](_0x1584a7['toString'](),{'type':db[_0x6b3c('0x78')][_0x6b3c('0x79')][_0x6b3c('0x7a')]})[_0x6b3c('0x27')](function(_0x1d3046){if(_0x1d3046[_0x6b3c('0x3a')]===0x1){return _0x1cf174['id'];}else{var _0x93315=_[_0x6b3c('0x7b')](_[_0x6b3c('0x34')](_0x1d3046,'TeamId'),function(_0x43f154){return _[_0x6b3c('0x7c')](_0x117d8a,_0x43f154);});if(_0x93315){return _0x1cf174['id'];}}}));}}return BPromise['all'](_0x45878f)['then'](function(_0x141730){_0x39a428=_(_0x39a428)[_0x6b3c('0x7d')](_0x141730)[_0x6b3c('0x7e')]()['value']();return db[_0x6b3c('0x2e')][_0x6b3c('0x55')]({'where':{'id':_0x45505a[_0x6b3c('0x4b')]['id']}})[_0x6b3c('0x27')](function(_0x1b1d5d){return db[_0x6b3c('0x78')][_0x6b3c('0x69')](function(_0x4da1ea){return _0x1b1d5d[_0x6b3c('0x6c')](_0x45505a[_0x6b3c('0x35')][_0x6b3c('0x63')],{'transaction':_0x4da1ea})[_0x6b3c('0x27')](function(){if(!_['isEmpty'](_0x39a428)){return _0x1b1d5d[_0x6b3c('0x7f')](_0x39a428,{'transaction':_0x4da1ea});}})[_0x6b3c('0x27')](function(){_0x39a428['forEach'](function(_0x4869a4){socket['emit'](_0x6b3c('0x80'),{'UserId':_0x4869a4,'OpenchannelQueueId':_0x1b1d5d['id']});});});});});});})['then'](respondWithStatusCode(_0x4ddcd1,null))[_0x6b3c('0x49')](handleError(_0x4ddcd1,null));};exports[_0x6b3c('0x81')]=function(_0x280454,_0x2cf27d,_0x1f5994){return db[_0x6b3c('0x2e')][_0x6b3c('0x55')]({'where':{'id':_0x280454['params']['id']}})[_0x6b3c('0x27')](handleEntityNotFound(_0x2cf27d,null))[_0x6b3c('0x27')](function(_0x24b982){if(_0x24b982){return _0x24b982['addAgents'](_0x280454['body'][_0x6b3c('0x63')],_['omit'](_0x280454['body'],[_0x6b3c('0x63'),'id'])||{})['spread'](function(_0x203ea4){for(var _0x245390=0x0;_0x245390<_0x280454['body'][_0x6b3c('0x63')][_0x6b3c('0x3a')];_0x245390+=0x1){socket['emit']('userOpenchannelQueue:save',{'UserId':Number(_0x280454[_0x6b3c('0x4d')][_0x6b3c('0x63')][_0x245390]),'OpenchannelQueueId':Number(_0x280454[_0x6b3c('0x4b')]['id'])});}return _0x203ea4;});}})['then'](respondWithResult(_0x2cf27d,null))['catch'](handleError(_0x2cf27d,null));};exports['removeAgents']=function(_0x47060a,_0x4e3e9b,_0x513fc0){return db['OpenchannelQueue']['find']({'where':{'id':_0x47060a[_0x6b3c('0x4b')]['id']}})[_0x6b3c('0x27')](handleEntityNotFound(_0x4e3e9b,null))[_0x6b3c('0x27')](function(_0x49bde6){if(_0x49bde6){return _0x49bde6[_0x6b3c('0x7f')](_0x47060a[_0x6b3c('0x35')][_0x6b3c('0x63')])[_0x6b3c('0x27')](function(){if(_[_0x6b3c('0x82')](_0x47060a[_0x6b3c('0x35')][_0x6b3c('0x63')])){for(var _0x3da5dc=0x0;_0x3da5dc<_0x47060a[_0x6b3c('0x35')][_0x6b3c('0x63')][_0x6b3c('0x3a')];_0x3da5dc+=0x1){socket[_0x6b3c('0x6a')]('userOpenchannelQueue:remove',{'UserId':Number(_0x47060a[_0x6b3c('0x35')][_0x6b3c('0x63')][_0x3da5dc]),'OpenchannelQueueId':Number(_0x47060a[_0x6b3c('0x4b')]['id'])});}}else{socket[_0x6b3c('0x6a')]('userOpenchannelQueue:remove',{'UserId':Number(_0x47060a[_0x6b3c('0x35')]['ids']),'OpenchannelQueueId':Number(_0x47060a[_0x6b3c('0x4b')]['id'])});}});}})[_0x6b3c('0x27')](respondWithStatusCode(_0x4e3e9b,null))[_0x6b3c('0x49')](handleError(_0x4e3e9b,null));};exports[_0x6b3c('0x83')]=function(_0x20736a,_0x557f55,_0x5248f1){var _0x16ba0f={};var _0x5cebd0={};var _0x2e6ff9;var _0x1b0de4;return db['OpenchannelQueue'][_0x6b3c('0x61')]({'where':{'id':_0x20736a[_0x6b3c('0x4b')]['id']}})[_0x6b3c('0x27')](handleEntityNotFound(_0x557f55,null))[_0x6b3c('0x27')](function(_0x4c1c08){if(_0x4c1c08){_0x2e6ff9=_0x4c1c08;_0x5cebd0[_0x6b3c('0x33')]=_[_0x6b3c('0x4c')](db[_0x6b3c('0x6d')][_0x6b3c('0x2f')]);_0x5cebd0[_0x6b3c('0x35')]=_['keys'](_0x20736a[_0x6b3c('0x35')]);_0x5cebd0[_0x6b3c('0x36')]=_['intersection'](_0x5cebd0[_0x6b3c('0x33')],_0x5cebd0[_0x6b3c('0x35')]);_0x16ba0f[_0x6b3c('0x38')]=_[_0x6b3c('0x37')](_0x5cebd0['model'],qs['fields'](_0x20736a[_0x6b3c('0x35')][_0x6b3c('0x39')]));_0x16ba0f[_0x6b3c('0x38')]=_0x16ba0f[_0x6b3c('0x38')][_0x6b3c('0x3a')]?_0x16ba0f['attributes']:_0x5cebd0[_0x6b3c('0x33')];_0x16ba0f[_0x6b3c('0x3d')]=qs[_0x6b3c('0x3e')](_0x20736a[_0x6b3c('0x35')][_0x6b3c('0x3e')]);_0x16ba0f[_0x6b3c('0x3f')]=qs[_0x6b3c('0x36')](_[_0x6b3c('0x40')](_0x20736a[_0x6b3c('0x35')],_0x5cebd0[_0x6b3c('0x36')]));if(_0x20736a[_0x6b3c('0x35')]['filter']){_0x16ba0f[_0x6b3c('0x3f')]=_[_0x6b3c('0x42')](_0x16ba0f['where'],{'$or':_[_0x6b3c('0x34')](_0x16ba0f['attributes'],function(_0x58eb2f){var _0x2a73fe={};_0x2a73fe[_0x58eb2f]={'$like':'%'+_0x20736a[_0x6b3c('0x35')][_0x6b3c('0x41')]+'%'};return _0x2a73fe;})});}_0x16ba0f=_['merge']({},_0x16ba0f,_0x20736a[_0x6b3c('0x44')]);return _0x2e6ff9[_0x6b3c('0x83')](_0x16ba0f);}})[_0x6b3c('0x27')](function(_0x38e0cd){if(_0x38e0cd){_0x1b0de4=_0x38e0cd[_0x6b3c('0x3a')];if(!_0x20736a['query'][_0x6b3c('0x3b')](_0x6b3c('0x3c'))){_0x16ba0f[_0x6b3c('0x21')]=qs[_0x6b3c('0x21')](_0x20736a[_0x6b3c('0x35')][_0x6b3c('0x21')]);_0x16ba0f[_0x6b3c('0x1e')]=qs[_0x6b3c('0x1e')](_0x20736a['query']['offset']);}return _0x2e6ff9[_0x6b3c('0x83')](_0x16ba0f);}})['then'](function(_0x56ac0b){if(_0x56ac0b){return _0x56ac0b?{'count':_0x1b0de4,'rows':_0x56ac0b}:null;}})['then'](respondWithResult(_0x557f55,null))[_0x6b3c('0x49')](handleError(_0x557f55,null));};
\ No newline at end of file
+var _0x10b3=['sort','pick','filter','merge','type','VIRTUAL','where','includeAll','findAll','rows','catch','show','params','include','options','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','describe','getMembers','UserOpenchannelQueue','nolimit','OpenchannelQueueId','User','findAndCountAll','UserId','agent','openchannelPause','createdAt','format','updatedAt','findOne','Team','getTeams','ids','Agents','online','interface','flatMap','sequelize','transaction','addTeams','each','findOrCreate','forEach','emit','userOpenchannelQueue:save','removeTeams','select','field','from','team_has_openchannel_queues','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','SELECT','every','TeamId','all','union','compact','value','isEmpty','addAgents','spread','removeAgents','isArray','userOpenchannelQueue:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','./openchannelQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','save','update','then','destroy','get','OpenchannelQueues','error','stack','name','send','index','map','OpenchannelQueue','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order'];(function(_0x22ccc0,_0x914457){var _0xe2af6a=function(_0x55aa01){while(--_0x55aa01){_0x22ccc0['push'](_0x22ccc0['shift']());}};_0xe2af6a(++_0x914457);}(_0x10b3,0x1ee));var _0x310b=function(_0xa28154,_0x259c85){_0xa28154=_0xa28154-0x0;var _0x2bc7a2=_0x10b3[_0xa28154];return _0x2bc7a2;};'use strict';var emlformat=require(_0x310b('0x0'));var rimraf=require(_0x310b('0x1'));var zipdir=require(_0x310b('0x2'));var jsonpatch=require(_0x310b('0x3'));var rp=require('request-promise');var moment=require(_0x310b('0x4'));var BPromise=require(_0x310b('0x5'));var Mustache=require('mustache');var util=require(_0x310b('0x6'));var path=require(_0x310b('0x7'));var sox=require(_0x310b('0x8'));var csv=require(_0x310b('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x310b('0xa'));var _=require(_0x310b('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x310b('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x310b('0x9'));var querystring=require(_0x310b('0xd'));var Papa=require(_0x310b('0xe'));var Redis=require(_0x310b('0xf'));var authService=require(_0x310b('0x10'));var qs=require(_0x310b('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x310b('0x12'))(_0x310b('0x13'));var utils=require(_0x310b('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x310b('0x15'));var db=require(_0x310b('0x16'))['db'];config[_0x310b('0x17')]=_[_0x310b('0x18')](config['redis'],{'host':_0x310b('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x310b('0x17')]));require(_0x310b('0x1a'))[_0x310b('0x1b')](socket);function respondWithStatusCode(_0x59fb01,_0x3c331b){_0x3c331b=_0x3c331b||0xcc;return function(_0x433359){if(_0x433359){return _0x59fb01[_0x310b('0x1c')](_0x3c331b);}return _0x59fb01[_0x310b('0x1d')](_0x3c331b)[_0x310b('0x1e')]();};}function respondWithResult(_0x569c6c,_0x1d7fb6){_0x1d7fb6=_0x1d7fb6||0xc8;return function(_0xc856e5){if(_0xc856e5){return _0x569c6c['status'](_0x1d7fb6)[_0x310b('0x1f')](_0xc856e5);}};}function respondWithFilteredResult(_0x43d2ba,_0x43c824){return function(_0x21c84a){if(_0x21c84a){var _0x2847e1=typeof _0x43c824[_0x310b('0x20')]===_0x310b('0x21')&&typeof _0x43c824[_0x310b('0x22')]===_0x310b('0x21');var _0x334622=_0x21c84a[_0x310b('0x23')];var _0x2a980e=_0x2847e1?0x0:_0x43c824[_0x310b('0x20')];var _0x7b959b=_0x2847e1?_0x21c84a[_0x310b('0x23')]:_0x43c824[_0x310b('0x20')]+_0x43c824[_0x310b('0x22')];var _0x564eee;if(_0x7b959b>=_0x334622){_0x7b959b=_0x334622;_0x564eee=0xc8;}else{_0x564eee=0xce;}_0x43d2ba[_0x310b('0x1d')](_0x564eee);return _0x43d2ba[_0x310b('0x24')]('Content-Range',_0x2a980e+'-'+_0x7b959b+'/'+_0x334622)[_0x310b('0x1f')](_0x21c84a);}return null;};}function patchUpdates(_0x28ff60){return function(_0x21310a){try{jsonpatch['apply'](_0x21310a,_0x28ff60,!![]);}catch(_0x43a479){return BPromise['reject'](_0x43a479);}return _0x21310a[_0x310b('0x25')]();};}function saveUpdates(_0x448048,_0x32451c){return function(_0x40af92){if(_0x40af92){return _0x40af92[_0x310b('0x26')](_0x448048)[_0x310b('0x27')](function(_0x37b1bd){return _0x37b1bd;});}return null;};}function removeEntity(_0x54e716,_0xd939c2){return function(_0x5d9a6e){if(_0x5d9a6e){return _0x5d9a6e[_0x310b('0x28')]()['then'](function(){var _0x54486e=_0x5d9a6e[_0x310b('0x29')]({'plain':!![]});var _0x589fbc=_0x310b('0x2a');return db['UserProfileResource'][_0x310b('0x28')]({'where':{'type':_0x589fbc,'resourceId':_0x54486e['id']}})[_0x310b('0x27')](function(){return _0x5d9a6e;});})['then'](function(){_0x54e716[_0x310b('0x1d')](0xcc)[_0x310b('0x1e')]();});}};}function handleEntityNotFound(_0x5b4c0f,_0x2177e8){return function(_0x28b623){if(!_0x28b623){_0x5b4c0f[_0x310b('0x1c')](0x194);}return _0x28b623;};}function handleError(_0xfaae40,_0x2bcebb){_0x2bcebb=_0x2bcebb||0x1f4;return function(_0x53fe6a){logger[_0x310b('0x2b')](_0x53fe6a[_0x310b('0x2c')]);if(_0x53fe6a[_0x310b('0x2d')]){delete _0x53fe6a[_0x310b('0x2d')];}_0xfaae40[_0x310b('0x1d')](_0x2bcebb)[_0x310b('0x2e')](_0x53fe6a);};}exports[_0x310b('0x2f')]=function(_0x3e62c8,_0x2be7ab){var _0x347667={},_0x507a43={},_0x267d9c={'count':0x0,'rows':[]};var _0x55e01e=_[_0x310b('0x30')](db[_0x310b('0x31')][_0x310b('0x32')],function(_0x22e934){return{'name':_0x22e934[_0x310b('0x33')],'type':_0x22e934['type']['key']};});_0x507a43[_0x310b('0x34')]=_[_0x310b('0x30')](_0x55e01e,_0x310b('0x2d'));_0x507a43[_0x310b('0x35')]=_[_0x310b('0x36')](_0x3e62c8['query']);_0x507a43[_0x310b('0x37')]=_[_0x310b('0x38')](_0x507a43[_0x310b('0x34')],_0x507a43[_0x310b('0x35')]);_0x347667[_0x310b('0x39')]=_[_0x310b('0x38')](_0x507a43[_0x310b('0x34')],qs[_0x310b('0x3a')](_0x3e62c8[_0x310b('0x35')]['fields']));_0x347667[_0x310b('0x39')]=_0x347667['attributes'][_0x310b('0x3b')]?_0x347667[_0x310b('0x39')]:_0x507a43[_0x310b('0x34')];if(!_0x3e62c8[_0x310b('0x35')][_0x310b('0x3c')]('nolimit')){_0x347667['limit']=qs[_0x310b('0x22')](_0x3e62c8['query']['limit']);_0x347667['offset']=qs[_0x310b('0x20')](_0x3e62c8[_0x310b('0x35')][_0x310b('0x20')]);}_0x347667[_0x310b('0x3d')]=qs[_0x310b('0x3e')](_0x3e62c8[_0x310b('0x35')][_0x310b('0x3e')]);_0x347667['where']=qs[_0x310b('0x37')](_[_0x310b('0x3f')](_0x3e62c8[_0x310b('0x35')],_0x507a43['filters']),_0x55e01e);if(_0x3e62c8[_0x310b('0x35')][_0x310b('0x40')]){_0x347667['where']=_[_0x310b('0x41')](_0x347667['where'],{'$or':_[_0x310b('0x30')](_0x55e01e,function(_0x29d3cc){if(_0x29d3cc[_0x310b('0x42')]!==_0x310b('0x43')){var _0x5699e4={};_0x5699e4[_0x29d3cc[_0x310b('0x2d')]]={'$like':'%'+_0x3e62c8[_0x310b('0x35')][_0x310b('0x40')]+'%'};return _0x5699e4;}})});}_0x347667=_['merge']({},_0x347667,_0x3e62c8['options']);var _0x2c058e={'where':_0x347667[_0x310b('0x44')]};return db['OpenchannelQueue'][_0x310b('0x23')](_0x2c058e)[_0x310b('0x27')](function(_0x1731d1){_0x267d9c['count']=_0x1731d1;if(_0x3e62c8[_0x310b('0x35')][_0x310b('0x45')]){_0x347667['include']=[{'all':!![]}];}return db[_0x310b('0x31')][_0x310b('0x46')](_0x347667);})[_0x310b('0x27')](function(_0x208b3b){_0x267d9c[_0x310b('0x47')]=_0x208b3b;return _0x267d9c;})[_0x310b('0x27')](respondWithFilteredResult(_0x2be7ab,_0x347667))[_0x310b('0x48')](handleError(_0x2be7ab,null));};exports[_0x310b('0x49')]=function(_0x283834,_0x3829dd){var _0x48f738={'raw':!![],'where':{'id':_0x283834[_0x310b('0x4a')]['id']}},_0x290019={};_0x290019[_0x310b('0x34')]=_[_0x310b('0x36')](db[_0x310b('0x31')]['rawAttributes']);_0x290019[_0x310b('0x35')]=_['keys'](_0x283834[_0x310b('0x35')]);_0x290019[_0x310b('0x37')]=_[_0x310b('0x38')](_0x290019[_0x310b('0x34')],_0x290019['query']);_0x48f738['attributes']=_[_0x310b('0x38')](_0x290019[_0x310b('0x34')],qs['fields'](_0x283834['query'][_0x310b('0x3a')]));_0x48f738[_0x310b('0x39')]=_0x48f738['attributes']['length']?_0x48f738[_0x310b('0x39')]:_0x290019['model'];if(_0x283834['query'][_0x310b('0x45')]){_0x48f738[_0x310b('0x4b')]=[{'all':!![]}];}_0x48f738=_[_0x310b('0x41')]({},_0x48f738,_0x283834[_0x310b('0x4c')]);return db[_0x310b('0x31')]['find'](_0x48f738)[_0x310b('0x27')](handleEntityNotFound(_0x3829dd,null))[_0x310b('0x27')](respondWithResult(_0x3829dd,null))[_0x310b('0x48')](handleError(_0x3829dd,null));};exports[_0x310b('0x4d')]=function(_0x3a2123,_0x2114b7){return db[_0x310b('0x31')][_0x310b('0x4d')](_0x3a2123[_0x310b('0x4e')],{})['then'](function(_0x417049){var _0x3d3c21=_0x3a2123['user']['get']({'plain':!![]});if(!_0x3d3c21)throw new Error(_0x310b('0x4f'));if(_0x3d3c21[_0x310b('0x50')]==='user'){var _0x2761c7=_0x417049[_0x310b('0x29')]({'plain':!![]});var _0x17f1bb='OpenchannelQueues';return db[_0x310b('0x51')]['find']({'where':{'name':_0x17f1bb,'userProfileId':_0x3d3c21[_0x310b('0x52')]},'raw':!![]})[_0x310b('0x27')](function(_0x21e63e){if(_0x21e63e&&_0x21e63e['autoAssociation']===0x0){return db[_0x310b('0x53')][_0x310b('0x4d')]({'name':_0x2761c7[_0x310b('0x2d')],'resourceId':_0x2761c7['id'],'type':_0x21e63e[_0x310b('0x2d')],'sectionId':_0x21e63e['id']},{})[_0x310b('0x27')](function(){return _0x417049;});}else{return _0x417049;}})[_0x310b('0x48')](function(_0x5b2566){logger['error'](_0x310b('0x54'),_0x5b2566);throw _0x5b2566;});}return _0x417049;})[_0x310b('0x27')](respondWithResult(_0x2114b7,0xc9))[_0x310b('0x48')](handleError(_0x2114b7,null));};exports[_0x310b('0x26')]=function(_0x14eba6,_0x3b4083){if(_0x14eba6[_0x310b('0x4e')]['id']){delete _0x14eba6[_0x310b('0x4e')]['id'];}return db[_0x310b('0x31')][_0x310b('0x55')]({'where':{'id':_0x14eba6[_0x310b('0x4a')]['id']}})[_0x310b('0x27')](handleEntityNotFound(_0x3b4083,null))[_0x310b('0x27')](saveUpdates(_0x14eba6[_0x310b('0x4e')],null))[_0x310b('0x27')](respondWithResult(_0x3b4083,null))[_0x310b('0x48')](handleError(_0x3b4083,null));};exports['destroy']=function(_0xef6960,_0x580a83){return db['OpenchannelQueue'][_0x310b('0x55')]({'where':{'id':_0xef6960['params']['id']}})[_0x310b('0x27')](handleEntityNotFound(_0x580a83,null))[_0x310b('0x27')](removeEntity(_0x580a83,null))['catch'](handleError(_0x580a83,null));};exports[_0x310b('0x56')]=function(_0x589561,_0x3f7e0a){return db[_0x310b('0x31')][_0x310b('0x56')]()[_0x310b('0x27')](respondWithResult(_0x3f7e0a,null))['catch'](handleError(_0x3f7e0a,null));};exports[_0x310b('0x57')]=function(_0xd2c1d6,_0x5d8cc8,_0x13ed42){var _0xe4d30c={'raw':!![],'where':{}},_0x39ed10={},_0x55d5ea;return db['OpenchannelQueue']['findOne']({'where':{'id':_0xd2c1d6['params']['id']}})[_0x310b('0x27')](handleEntityNotFound(_0x5d8cc8,null))[_0x310b('0x27')](function(_0xd52fb1){if(_0xd52fb1){_0x55d5ea=_0xd52fb1[_0x310b('0x29')]({'plain':!![]});_0x39ed10[_0x310b('0x34')]=_[_0x310b('0x36')](db[_0x310b('0x58')]['rawAttributes']);_0x39ed10[_0x310b('0x35')]=_[_0x310b('0x36')](_0xd2c1d6[_0x310b('0x35')]);_0x39ed10[_0x310b('0x37')]=_[_0x310b('0x38')](_0x39ed10[_0x310b('0x34')],_0x39ed10[_0x310b('0x35')]);_0xe4d30c[_0x310b('0x39')]=_[_0x310b('0x38')](_0x39ed10[_0x310b('0x34')],qs['fields'](_0xd2c1d6[_0x310b('0x35')][_0x310b('0x3a')]));_0xe4d30c[_0x310b('0x39')]=_0xe4d30c[_0x310b('0x39')]['length']?_0xe4d30c[_0x310b('0x39')]:_0x39ed10[_0x310b('0x34')];if(!_0xd2c1d6[_0x310b('0x35')]['hasOwnProperty'](_0x310b('0x59'))){_0xe4d30c['limit']=qs['limit'](_0xd2c1d6[_0x310b('0x35')][_0x310b('0x22')]);_0xe4d30c[_0x310b('0x20')]=qs[_0x310b('0x20')](_0xd2c1d6[_0x310b('0x35')][_0x310b('0x20')]);}_0xe4d30c['order']=qs['sort'](_0xd2c1d6['query']['sort']);_0xe4d30c['where']=qs[_0x310b('0x37')](_[_0x310b('0x3f')](_0xd2c1d6[_0x310b('0x35')],_0x39ed10[_0x310b('0x37')]));_0xe4d30c[_0x310b('0x44')][_0x310b('0x5a')]=_0xd52fb1['id'];if(_0xd2c1d6[_0x310b('0x35')][_0x310b('0x40')]){_0xe4d30c[_0x310b('0x44')]=_['merge'](_0xe4d30c[_0x310b('0x44')],{'$or':_[_0x310b('0x30')](_0xe4d30c[_0x310b('0x39')],function(_0x2bd82e){var _0x2b62f1={};_0x2b62f1[_0x2bd82e]={'$like':'%'+_0xd2c1d6['query'][_0x310b('0x40')]+'%'};return _0x2b62f1;})});}_0xe4d30c=_[_0x310b('0x41')]({},_0xe4d30c,_0xd2c1d6[_0x310b('0x4c')]);return db[_0x310b('0x58')][_0x310b('0x46')](_0xe4d30c);}})[_0x310b('0x27')](function(_0x327ae3){if(_0x327ae3){return db[_0x310b('0x5b')][_0x310b('0x5c')]({'where':{'id':_[_0x310b('0x30')](_0x327ae3,_0x310b('0x5d')),'role':_0x310b('0x5e')},'attributes':['id',_0x310b('0x2d'),_0x310b('0x5f'),'updatedAt',_0x310b('0x60')]});}})[_0x310b('0x27')](function(_0x18bd0b){if(_0x18bd0b){return{'count':_0x18bd0b['count'],'rows':_[_0x310b('0x30')](_0x18bd0b[_0x310b('0x47')],function(_0x2217f7){return{'membername':_0x2217f7[_0x310b('0x2d')],'UserId':_0x2217f7['id'],'queue_name':_0x55d5ea[_0x310b('0x2d')],'OpenchannelQueueId':_0x55d5ea['id'],'interface':util[_0x310b('0x61')]('%s/%s','SIP',_0x2217f7[_0x310b('0x2d')]),'penalty':0x0,'paused':_0x2217f7[_0x310b('0x5f')],'createdAt':_0x2217f7['createdAt'],'updatedAt':_0x2217f7[_0x310b('0x62')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x310b('0x27')](respondWithFilteredResult(_0x5d8cc8,_0xe4d30c))[_0x310b('0x48')](handleError(_0x5d8cc8,null));};exports['getTeams']=function(_0x341dac,_0x58090b,_0x51163b){var _0x4169b9={};var _0xd14a2c={};var _0x42ff60;var _0x2910e4;return db['OpenchannelQueue'][_0x310b('0x63')]({'where':{'id':_0x341dac[_0x310b('0x4a')]['id']}})[_0x310b('0x27')](handleEntityNotFound(_0x58090b,null))[_0x310b('0x27')](function(_0x5eab74){if(_0x5eab74){_0x42ff60=_0x5eab74;_0xd14a2c[_0x310b('0x34')]=_['keys'](db[_0x310b('0x64')][_0x310b('0x32')]);_0xd14a2c[_0x310b('0x35')]=_[_0x310b('0x36')](_0x341dac['query']);_0xd14a2c[_0x310b('0x37')]=_[_0x310b('0x38')](_0xd14a2c[_0x310b('0x34')],_0xd14a2c[_0x310b('0x35')]);_0x4169b9[_0x310b('0x39')]=_['intersection'](_0xd14a2c['model'],qs[_0x310b('0x3a')](_0x341dac[_0x310b('0x35')]['fields']));_0x4169b9['attributes']=_0x4169b9[_0x310b('0x39')][_0x310b('0x3b')]?_0x4169b9[_0x310b('0x39')]:_0xd14a2c['model'];_0x4169b9[_0x310b('0x3d')]=qs[_0x310b('0x3e')](_0x341dac[_0x310b('0x35')][_0x310b('0x3e')]);_0x4169b9[_0x310b('0x44')]=qs[_0x310b('0x37')](_['pick'](_0x341dac[_0x310b('0x35')],_0xd14a2c[_0x310b('0x37')]));if(_0x341dac[_0x310b('0x35')][_0x310b('0x40')]){_0x4169b9[_0x310b('0x44')]=_[_0x310b('0x41')](_0x4169b9[_0x310b('0x44')],{'$or':_['map'](_0x4169b9[_0x310b('0x39')],function(_0x2acfad){var _0x2501b3={};_0x2501b3[_0x2acfad]={'$like':'%'+_0x341dac['query']['filter']+'%'};return _0x2501b3;})});}_0x4169b9=_[_0x310b('0x41')]({},_0x4169b9,_0x341dac[_0x310b('0x4c')]);return _0x42ff60['getTeams'](_0x4169b9);}})[_0x310b('0x27')](function(_0x5e64cb){if(_0x5e64cb){_0x2910e4=_0x5e64cb[_0x310b('0x3b')];if(!_0x341dac[_0x310b('0x35')][_0x310b('0x3c')]('nolimit')){_0x4169b9[_0x310b('0x22')]=qs[_0x310b('0x22')](_0x341dac[_0x310b('0x35')]['limit']);_0x4169b9['offset']=qs[_0x310b('0x20')](_0x341dac[_0x310b('0x35')][_0x310b('0x20')]);}return _0x42ff60[_0x310b('0x65')](_0x4169b9);}})['then'](function(_0x12a14c){if(_0x12a14c){return _0x12a14c?{'count':_0x2910e4,'rows':_0x12a14c}:null;}})[_0x310b('0x27')](respondWithResult(_0x58090b,null))[_0x310b('0x48')](handleError(_0x58090b,null));};exports['addTeams']=function(_0x5b80f7,_0x2dbd58,_0x33d769){var _0x20ed2e=_0x5b80f7['body'][_0x310b('0x66')];return db[_0x310b('0x64')][_0x310b('0x46')]({'where':{'id':_0x20ed2e},'attributes':['id'],'include':[{'model':db[_0x310b('0x5b')],'as':_0x310b('0x67'),'attributes':['id','name',_0x310b('0x68'),'voicePause',_0x310b('0x69')],'raw':!![]}]})[_0x310b('0x27')](function(_0x2e4808){if(_0x2e4808){var _0x1da338=_[_0x310b('0x6a')](_0x2e4808,function(_0x1e7a37){var _0x3af333=_0x1e7a37[_0x310b('0x29')]({'plain':!![]});return _0x3af333[_0x310b('0x67')];});return db[_0x310b('0x31')][_0x310b('0x55')]({'where':{'id':_0x5b80f7[_0x310b('0x4a')]['id']}})[_0x310b('0x27')](function(_0x5a84ed){return db[_0x310b('0x6b')][_0x310b('0x6c')](function(_0x33db31){return _0x5a84ed[_0x310b('0x6d')](_0x20ed2e,{'transaction':_0x33db31})[_0x310b('0x27')](function(){return BPromise[_0x310b('0x6e')](_0x1da338,function(_0x5e8b64){return db[_0x310b('0x58')][_0x310b('0x6f')]({'where':{'UserId':_0x5e8b64['id'],'OpenchannelQueueId':_0x5b80f7['params']['id']},'transaction':_0x33db31});});})[_0x310b('0x27')](function(){_0x1da338[_0x310b('0x70')](function(_0x2e099c){socket[_0x310b('0x71')](_0x310b('0x72'),{'UserId':_0x2e099c['id'],'OpenchannelQueueId':_0x5a84ed['id']});});});});});}})[_0x310b('0x27')](respondWithStatusCode(_0x2dbd58,null))[_0x310b('0x48')](handleError(_0x2dbd58,null));};exports[_0x310b('0x73')]=function(_0x439484,_0x55937a,_0x237156){return db[_0x310b('0x64')]['findAll']({'where':{'id':_0x439484[_0x310b('0x35')][_0x310b('0x66')]},'attributes':['id'],'include':[{'model':db[_0x310b('0x5b')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x310b('0x27')](handleEntityNotFound(_0x55937a,null))['then'](function(_0x41945b){var _0x247113=_[_0x310b('0x30')](_0x41945b,'id');var _0x2c59e0=[];var _0x2a71cc=[];var _0x332b4a=squel[_0x310b('0x74')]();_0x332b4a[_0x310b('0x75')]('tq.TeamId')[_0x310b('0x76')](_0x310b('0x77'),'tq')['join']('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0x310b('0x44')](_0x310b('0x78'),_0x439484[_0x310b('0x4a')]['id']);for(var _0x2c4670=0x0;_0x2c4670<_0x41945b[_0x310b('0x3b')];_0x2c4670+=0x1){let _0x48bfe8=_0x41945b[_0x2c4670];for(var _0x372d1c=0x0;_0x372d1c<_0x48bfe8[_0x310b('0x67')][_0x310b('0x3b')];_0x372d1c+=0x1){let _0x5af13e=_0x48bfe8['Agents'][_0x372d1c];var _0x475852=_0x332b4a[_0x310b('0x79')]();_0x475852['where'](_0x310b('0x7a'),_0x5af13e['id']);_0x2a71cc[_0x310b('0x7b')](db[_0x310b('0x6b')][_0x310b('0x35')](_0x475852[_0x310b('0x7c')](),{'type':db[_0x310b('0x6b')]['QueryTypes'][_0x310b('0x7d')]})['then'](function(_0x584e51){if(_0x584e51[_0x310b('0x3b')]===0x1){return _0x5af13e['id'];}else{var _0x22fb90=_[_0x310b('0x7e')](_['map'](_0x584e51,_0x310b('0x7f')),function(_0x1e6467){return _['includes'](_0x247113,_0x1e6467);});if(_0x22fb90){return _0x5af13e['id'];}}}));}}return BPromise[_0x310b('0x80')](_0x2a71cc)[_0x310b('0x27')](function(_0x1aff02){_0x2c59e0=_(_0x2c59e0)[_0x310b('0x81')](_0x1aff02)[_0x310b('0x82')]()[_0x310b('0x83')]();return db[_0x310b('0x31')][_0x310b('0x55')]({'where':{'id':_0x439484[_0x310b('0x4a')]['id']}})[_0x310b('0x27')](function(_0x46b810){return db[_0x310b('0x6b')][_0x310b('0x6c')](function(_0x588f9c){return _0x46b810['removeTeams'](_0x439484[_0x310b('0x35')][_0x310b('0x66')],{'transaction':_0x588f9c})['then'](function(){if(!_[_0x310b('0x84')](_0x2c59e0)){return _0x46b810['removeAgents'](_0x2c59e0,{'transaction':_0x588f9c});}})[_0x310b('0x27')](function(){_0x2c59e0['forEach'](function(_0x465d2e){socket[_0x310b('0x71')]('userOpenchannelQueue:remove',{'UserId':_0x465d2e,'OpenchannelQueueId':_0x46b810['id']});});});});});});})[_0x310b('0x27')](respondWithStatusCode(_0x55937a,null))[_0x310b('0x48')](handleError(_0x55937a,null));};exports[_0x310b('0x85')]=function(_0x10b9f1,_0x1d5242,_0x3d247a){return db['OpenchannelQueue'][_0x310b('0x55')]({'where':{'id':_0x10b9f1[_0x310b('0x4a')]['id']}})['then'](handleEntityNotFound(_0x1d5242,null))[_0x310b('0x27')](function(_0x25982f){if(_0x25982f){return _0x25982f[_0x310b('0x85')](_0x10b9f1[_0x310b('0x4e')][_0x310b('0x66')],_['omit'](_0x10b9f1[_0x310b('0x4e')],[_0x310b('0x66'),'id'])||{})[_0x310b('0x86')](function(_0x336e43){for(var _0x1d0b5f=0x0;_0x1d0b5f<_0x10b9f1[_0x310b('0x4e')][_0x310b('0x66')][_0x310b('0x3b')];_0x1d0b5f+=0x1){socket['emit'](_0x310b('0x72'),{'UserId':Number(_0x10b9f1[_0x310b('0x4e')][_0x310b('0x66')][_0x1d0b5f]),'OpenchannelQueueId':Number(_0x10b9f1[_0x310b('0x4a')]['id'])});}return _0x336e43;});}})[_0x310b('0x27')](respondWithResult(_0x1d5242,null))[_0x310b('0x48')](handleError(_0x1d5242,null));};exports[_0x310b('0x87')]=function(_0x11bcfd,_0x41da67,_0x1b7f65){return db[_0x310b('0x31')]['find']({'where':{'id':_0x11bcfd[_0x310b('0x4a')]['id']}})[_0x310b('0x27')](handleEntityNotFound(_0x41da67,null))[_0x310b('0x27')](function(_0x2bb331){if(_0x2bb331){return _0x2bb331['removeAgents'](_0x11bcfd[_0x310b('0x35')][_0x310b('0x66')])[_0x310b('0x27')](function(){if(_[_0x310b('0x88')](_0x11bcfd[_0x310b('0x35')][_0x310b('0x66')])){for(var _0x1e197c=0x0;_0x1e197c<_0x11bcfd[_0x310b('0x35')][_0x310b('0x66')][_0x310b('0x3b')];_0x1e197c+=0x1){socket[_0x310b('0x71')](_0x310b('0x89'),{'UserId':Number(_0x11bcfd[_0x310b('0x35')][_0x310b('0x66')][_0x1e197c]),'OpenchannelQueueId':Number(_0x11bcfd['params']['id'])});}}else{socket[_0x310b('0x71')](_0x310b('0x89'),{'UserId':Number(_0x11bcfd[_0x310b('0x35')][_0x310b('0x66')]),'OpenchannelQueueId':Number(_0x11bcfd[_0x310b('0x4a')]['id'])});}});}})['then'](respondWithStatusCode(_0x41da67,null))[_0x310b('0x48')](handleError(_0x41da67,null));};exports[_0x310b('0x8a')]=function(_0x480b05,_0x40eae1,_0x32219d){var _0x2f0d0f={};var _0x1fe0a3={};var _0x113060;var _0x247e4c;return db['OpenchannelQueue'][_0x310b('0x63')]({'where':{'id':_0x480b05[_0x310b('0x4a')]['id']}})[_0x310b('0x27')](handleEntityNotFound(_0x40eae1,null))['then'](function(_0x2565fc){if(_0x2565fc){_0x113060=_0x2565fc;_0x1fe0a3[_0x310b('0x34')]=_[_0x310b('0x36')](db[_0x310b('0x5b')]['rawAttributes']);_0x1fe0a3[_0x310b('0x35')]=_[_0x310b('0x36')](_0x480b05[_0x310b('0x35')]);_0x1fe0a3[_0x310b('0x37')]=_[_0x310b('0x38')](_0x1fe0a3['model'],_0x1fe0a3['query']);_0x2f0d0f[_0x310b('0x39')]=_[_0x310b('0x38')](_0x1fe0a3[_0x310b('0x34')],qs[_0x310b('0x3a')](_0x480b05[_0x310b('0x35')][_0x310b('0x3a')]));_0x2f0d0f[_0x310b('0x39')]=_0x2f0d0f['attributes'][_0x310b('0x3b')]?_0x2f0d0f[_0x310b('0x39')]:_0x1fe0a3[_0x310b('0x34')];_0x2f0d0f[_0x310b('0x3d')]=qs[_0x310b('0x3e')](_0x480b05[_0x310b('0x35')][_0x310b('0x3e')]);_0x2f0d0f[_0x310b('0x44')]=qs['filters'](_[_0x310b('0x3f')](_0x480b05[_0x310b('0x35')],_0x1fe0a3['filters']));if(_0x480b05[_0x310b('0x35')][_0x310b('0x40')]){_0x2f0d0f[_0x310b('0x44')]=_[_0x310b('0x41')](_0x2f0d0f[_0x310b('0x44')],{'$or':_[_0x310b('0x30')](_0x2f0d0f[_0x310b('0x39')],function(_0x5786a5){var _0x3165be={};_0x3165be[_0x5786a5]={'$like':'%'+_0x480b05['query'][_0x310b('0x40')]+'%'};return _0x3165be;})});}_0x2f0d0f=_[_0x310b('0x41')]({},_0x2f0d0f,_0x480b05[_0x310b('0x4c')]);return _0x113060[_0x310b('0x8a')](_0x2f0d0f);}})[_0x310b('0x27')](function(_0x521713){if(_0x521713){_0x247e4c=_0x521713[_0x310b('0x3b')];if(!_0x480b05[_0x310b('0x35')][_0x310b('0x3c')](_0x310b('0x59'))){_0x2f0d0f[_0x310b('0x22')]=qs[_0x310b('0x22')](_0x480b05['query']['limit']);_0x2f0d0f[_0x310b('0x20')]=qs[_0x310b('0x20')](_0x480b05[_0x310b('0x35')][_0x310b('0x20')]);}return _0x113060[_0x310b('0x8a')](_0x2f0d0f);}})[_0x310b('0x27')](function(_0x16ad0b){if(_0x16ad0b){return _0x16ad0b?{'count':_0x247e4c,'rows':_0x16ad0b}:null;}})[_0x310b('0x27')](respondWithResult(_0x40eae1,null))[_0x310b('0x48')](handleError(_0x40eae1,null));};
\ No newline at end of file
index 7b75698..6f5b5bf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6d18=['events','OpenchannelQueue','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x9ee589,_0x5ba110){var _0x5cf795=function(_0x49e5c5){while(--_0x49e5c5){_0x9ee589['push'](_0x9ee589['shift']());}};_0x5cf795(++_0x5ba110);}(_0x6d18,0x7e));var _0x86d1=function(_0x443bb2,_0x27cfaf){_0x443bb2=_0x443bb2-0x0;var _0x39d037=_0x6d18[_0x443bb2];return _0x39d037;};'use strict';var EventEmitter=require(_0x86d1('0x0'));var OpenchannelQueue=require('../../mysqldb')['db'][_0x86d1('0x1')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x86d1('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x86d1('0x3'),'afterDestroy':_0x86d1('0x4')};function emitEvent(_0x50951e){return function(_0x330b3a,_0x3dec98,_0x5433b5){OpenchannelQueueEvents[_0x86d1('0x5')](_0x50951e+':'+_0x330b3a['id'],_0x330b3a);OpenchannelQueueEvents[_0x86d1('0x5')](_0x50951e,_0x330b3a);_0x5433b5(null);};}for(var e in events){if(events[_0x86d1('0x6')](e)){var event=events[e];OpenchannelQueue[_0x86d1('0x7')](e,emitEvent(event));}}module[_0x86d1('0x8')]=OpenchannelQueueEvents;
\ No newline at end of file
+var _0x9297=['emit','hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners'];(function(_0x3a7f7b,_0x22f0f8){var _0x48b64b=function(_0x57ac88){while(--_0x57ac88){_0x3a7f7b['push'](_0x3a7f7b['shift']());}};_0x48b64b(++_0x22f0f8);}(_0x9297,0x172));var _0x7929=function(_0xe60131,_0x1316fb){_0xe60131=_0xe60131-0x0;var _0x4c6124=_0x9297[_0xe60131];return _0x4c6124;};'use strict';var EventEmitter=require('events');var OpenchannelQueue=require(_0x7929('0x0'))['db']['OpenchannelQueue'];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x7929('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x5bc6a6){return function(_0x23fe9c,_0x2bee00,_0x4f1543){OpenchannelQueueEvents[_0x7929('0x2')](_0x5bc6a6+':'+_0x23fe9c['id'],_0x23fe9c);OpenchannelQueueEvents[_0x7929('0x2')](_0x5bc6a6,_0x23fe9c);_0x4f1543(null);};}for(var e in events){if(events[_0x7929('0x3')](e)){var event=events[e];OpenchannelQueue[_0x7929('0x4')](e,emitEvent(event));}}module[_0x7929('0x5')]=OpenchannelQueueEvents;
\ No newline at end of file
index db13bf6..0523ae9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x78b8=['exports','openchannel_queues','lodash','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./openchannelQueue.attributes'];(function(_0xa9d560,_0x2f615e){var _0x48d8c2=function(_0x44fb51){while(--_0x44fb51){_0xa9d560['push'](_0xa9d560['shift']());}};_0x48d8c2(++_0x2f615e);}(_0x78b8,0x188));var _0x878b=function(_0x4f138a,_0x57aede){_0x4f138a=_0x4f138a-0x0;var _0x5e2001=_0x78b8[_0x4f138a];return _0x5e2001;};'use strict';var _=require(_0x878b('0x0'));var util=require('util');var logger=require(_0x878b('0x1'))(_0x878b('0x2'));var moment=require(_0x878b('0x3'));var BPromise=require(_0x878b('0x4'));var rp=require(_0x878b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x878b('0x6'));var attributes=require(_0x878b('0x7'));module[_0x878b('0x8')]=function(_0x9ead24,_0xfa2c3){return _0x9ead24['define']('OpenchannelQueue',attributes,{'tableName':_0x878b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd139=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueue.attributes','exports','define','OpenchannelQueue','openchannel_queues','lodash','util'];(function(_0x5665b6,_0x5678d0){var _0x2196ce=function(_0x2166e4){while(--_0x2166e4){_0x5665b6['push'](_0x5665b6['shift']());}};_0x2196ce(++_0x5678d0);}(_0xd139,0x76));var _0x9d13=function(_0x555374,_0x4a7e37){_0x555374=_0x555374-0x0;var _0x3a5e0e=_0xd139[_0x555374];return _0x3a5e0e;};'use strict';var _=require(_0x9d13('0x0'));var util=require(_0x9d13('0x1'));var logger=require(_0x9d13('0x2'))(_0x9d13('0x3'));var moment=require(_0x9d13('0x4'));var BPromise=require(_0x9d13('0x5'));var rp=require(_0x9d13('0x6'));var fs=require('fs');var path=require(_0x9d13('0x7'));var rimraf=require(_0x9d13('0x8'));var config=require(_0x9d13('0x9'));var attributes=require(_0x9d13('0xa'));module[_0x9d13('0xb')]=function(_0x5063a2,_0x36d362){return _0x5063a2[_0x9d13('0xc')](_0x9d13('0xd'),attributes,{'tableName':_0x9d13('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 99d5988..809bd4a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x31ee=['message','result','catch','options','raw','where','attributes','limit','map','model','include','GetOpenchannelQueue','stringify','OpenchannelQueue','find','ShowOpenchannelQueue','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./openchannelQueue.socket','then','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','error'];(function(_0x23e26c,_0x501919){var _0x5deb1b=function(_0x1f5298){while(--_0x1f5298){_0x23e26c['push'](_0x23e26c['shift']());}};_0x5deb1b(++_0x501919);}(_0x31ee,0x166));var _0xe31e=function(_0x53c30e,_0x336fc0){_0x53c30e=_0x53c30e-0x0;var _0x31852e=_0x31ee[_0x53c30e];return _0x31852e;};'use strict';var _=require('lodash');var util=require(_0xe31e('0x0'));var moment=require('moment');var BPromise=require(_0xe31e('0x1'));var rs=require(_0xe31e('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe31e('0x3'))['db'];var utils=require(_0xe31e('0x4'));var logger=require(_0xe31e('0x5'))(_0xe31e('0x6'));var config=require(_0xe31e('0x7'));var jayson=require(_0xe31e('0x8'));var client=jayson[_0xe31e('0x9')][_0xe31e('0xa')]({'port':0x232a});config[_0xe31e('0xb')]=_[_0xe31e('0xc')](config[_0xe31e('0xb')],{'host':_0xe31e('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe31e('0xb')]));require(_0xe31e('0xe'))['register'](socket);function respondWithRpcPromise(_0xf74c85,_0x329e81,_0x4f32ff){return new BPromise(function(_0x3efc00,_0xc8ff74){return client['request'](_0xf74c85,_0x4f32ff)[_0xe31e('0xf')](function(_0x48cefb){logger[_0xe31e('0x10')](_0xe31e('0x11'),_0x329e81,_0xe31e('0x12'));logger[_0xe31e('0x13')](_0xe31e('0x14'),_0x329e81,_0xe31e('0x12'),JSON['stringify'](_0x48cefb));if(_0x48cefb[_0xe31e('0x15')]){if(_0x48cefb['error']['code']===0x1f4){logger[_0xe31e('0x15')]('OpenchannelQueue,\x20%s,\x20%s',_0x329e81,_0x48cefb['error']['message']);return _0xc8ff74(_0x48cefb[_0xe31e('0x15')]['message']);}logger[_0xe31e('0x15')]('OpenchannelQueue,\x20%s,\x20%s',_0x329e81,_0x48cefb[_0xe31e('0x15')]['message']);return _0x3efc00(_0x48cefb[_0xe31e('0x15')][_0xe31e('0x16')]);}else{logger[_0xe31e('0x10')](_0xe31e('0x11'),_0x329e81,_0xe31e('0x12'));_0x3efc00(_0x48cefb[_0xe31e('0x17')][_0xe31e('0x16')]);}})[_0xe31e('0x18')](function(_0x517813){logger['error'](_0xe31e('0x11'),_0x329e81,_0x517813);_0xc8ff74(_0x517813);});});}exports['GetOpenchannelQueue']=function(_0x166135){var _0x1ecb74=this;return new Promise(function(_0x11a8eb,_0x4ba763){return db['OpenchannelQueue']['findAll']({'raw':_0x166135[_0xe31e('0x19')]?_0x166135[_0xe31e('0x19')][_0xe31e('0x1a')]===undefined?!![]:![]:!![],'where':_0x166135[_0xe31e('0x19')]?_0x166135[_0xe31e('0x19')][_0xe31e('0x1b')]||null:null,'attributes':_0x166135['options']?_0x166135[_0xe31e('0x19')][_0xe31e('0x1c')]||null:null,'limit':_0x166135[_0xe31e('0x19')]?_0x166135[_0xe31e('0x19')][_0xe31e('0x1d')]||null:null,'include':_0x166135['options']?_0x166135[_0xe31e('0x19')]['include']?_[_0xe31e('0x1e')](_0x166135[_0xe31e('0x19')]['include'],function(_0x588414){return{'model':db[_0x588414[_0xe31e('0x1f')]],'as':_0x588414['as'],'attributes':_0x588414[_0xe31e('0x1c')],'include':_0x588414['include']?_[_0xe31e('0x1e')](_0x588414[_0xe31e('0x20')],function(_0xac72ef){return{'model':db[_0xac72ef[_0xe31e('0x1f')]],'as':_0xac72ef['as'],'attributes':_0xac72ef['attributes'],'include':_0xac72ef[_0xe31e('0x20')]?_['map'](_0xac72ef[_0xe31e('0x20')],function(_0x52946f){return{'model':db[_0x52946f[_0xe31e('0x1f')]],'as':_0x52946f['as'],'attributes':_0x52946f[_0xe31e('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xe31e('0xf')](function(_0x550bc1){logger[_0xe31e('0x10')](_0xe31e('0x21'),_0x166135);logger['debug']('GetOpenchannelQueue',_0x166135,JSON[_0xe31e('0x22')](_0x550bc1));_0x11a8eb(_0x550bc1);})[_0xe31e('0x18')](function(_0x337d4c){logger[_0xe31e('0x15')]('GetOpenchannelQueue',_0x337d4c[_0xe31e('0x16')],_0x166135);_0x4ba763(_0x1ecb74['error'](0x1f4,_0x337d4c[_0xe31e('0x16')]));});});};exports['ShowOpenchannelQueue']=function(_0x2a092a){var _0x2acece=this;return new Promise(function(_0x385b8c,_0x1e4846){return db[_0xe31e('0x23')][_0xe31e('0x24')]({'raw':_0x2a092a[_0xe31e('0x19')]?_0x2a092a[_0xe31e('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x2a092a[_0xe31e('0x19')]?_0x2a092a[_0xe31e('0x19')]['where']||null:null,'attributes':_0x2a092a['options']?_0x2a092a['options']['attributes']||null:null,'include':_0x2a092a[_0xe31e('0x19')]?_0x2a092a['options'][_0xe31e('0x20')]?_[_0xe31e('0x1e')](_0x2a092a[_0xe31e('0x19')][_0xe31e('0x20')],function(_0x59aa54){return{'model':db[_0x59aa54[_0xe31e('0x1f')]],'as':_0x59aa54['as'],'attributes':_0x59aa54[_0xe31e('0x1c')],'include':_0x59aa54[_0xe31e('0x20')]?_[_0xe31e('0x1e')](_0x59aa54[_0xe31e('0x20')],function(_0x3b6e3c){return{'model':db[_0x3b6e3c[_0xe31e('0x1f')]],'as':_0x3b6e3c['as'],'attributes':_0x3b6e3c[_0xe31e('0x1c')],'include':_0x3b6e3c[_0xe31e('0x20')]?_[_0xe31e('0x1e')](_0x3b6e3c[_0xe31e('0x20')],function(_0x5e0c3a){return{'model':db[_0x5e0c3a[_0xe31e('0x1f')]],'as':_0x5e0c3a['as'],'attributes':_0x5e0c3a[_0xe31e('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xe31e('0xf')](function(_0x23eb95){logger['info'](_0xe31e('0x25'),_0x2a092a);logger[_0xe31e('0x13')]('ShowOpenchannelQueue',_0x2a092a,JSON[_0xe31e('0x22')](_0x23eb95));_0x385b8c(_0x23eb95);})[_0xe31e('0x18')](function(_0x29037d){logger['error'](_0xe31e('0x25'),_0x29037d[_0xe31e('0x16')],_0x2a092a);_0x1e4846(_0x2acece[_0xe31e('0x15')](0x1f4,_0x29037d['message']));});});};
\ No newline at end of file
+var _0xea3a=['raw','where','attributes','include','map','model','find','ShowOpenchannelQueue','lodash','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','request','then','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetOpenchannelQueue','OpenchannelQueue','options'];(function(_0x9861ff,_0x41fb17){var _0x48852b=function(_0x557001){while(--_0x557001){_0x9861ff['push'](_0x9861ff['shift']());}};_0x48852b(++_0x41fb17);}(_0xea3a,0xec));var _0xaea3=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xea3a[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0xaea3('0x0'));var util=require('util');var moment=require(_0xaea3('0x1'));var BPromise=require(_0xaea3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xaea3('0x3'));var db=require(_0xaea3('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xaea3('0x5'));var config=require(_0xaea3('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xaea3('0x7')][_0xaea3('0x8')]({'port':0x232a});config[_0xaea3('0x9')]=_[_0xaea3('0xa')](config[_0xaea3('0x9')],{'host':_0xaea3('0xb'),'port':0x18eb});var socket=require(_0xaea3('0xc'))(new Redis(config[_0xaea3('0x9')]));require(_0xaea3('0xd'))[_0xaea3('0xe')](socket);function respondWithRpcPromise(_0x5a6728,_0x3d37ca,_0x3f02ef){return new BPromise(function(_0x5e9e79,_0x2db10f){return client[_0xaea3('0xf')](_0x5a6728,_0x3f02ef)[_0xaea3('0x10')](function(_0x2c3e4e){logger[_0xaea3('0x11')](_0xaea3('0x12'),_0x3d37ca,_0xaea3('0x13'));logger[_0xaea3('0x14')](_0xaea3('0x15'),_0x3d37ca,_0xaea3('0x13'),JSON[_0xaea3('0x16')](_0x2c3e4e));if(_0x2c3e4e[_0xaea3('0x17')]){if(_0x2c3e4e[_0xaea3('0x17')][_0xaea3('0x18')]===0x1f4){logger[_0xaea3('0x17')](_0xaea3('0x12'),_0x3d37ca,_0x2c3e4e['error'][_0xaea3('0x19')]);return _0x2db10f(_0x2c3e4e[_0xaea3('0x17')][_0xaea3('0x19')]);}logger[_0xaea3('0x17')]('OpenchannelQueue,\x20%s,\x20%s',_0x3d37ca,_0x2c3e4e['error'][_0xaea3('0x19')]);return _0x5e9e79(_0x2c3e4e[_0xaea3('0x17')]['message']);}else{logger[_0xaea3('0x11')](_0xaea3('0x12'),_0x3d37ca,_0xaea3('0x13'));_0x5e9e79(_0x2c3e4e['result'][_0xaea3('0x19')]);}})[_0xaea3('0x1a')](function(_0xbaa9d3){logger['error']('OpenchannelQueue,\x20%s,\x20%s',_0x3d37ca,_0xbaa9d3);_0x2db10f(_0xbaa9d3);});});}exports[_0xaea3('0x1b')]=function(_0x591042){var _0x230bf1=this;return new Promise(function(_0x155250,_0x218492){return db[_0xaea3('0x1c')]['findAll']({'raw':_0x591042['options']?_0x591042[_0xaea3('0x1d')][_0xaea3('0x1e')]===undefined?!![]:![]:!![],'where':_0x591042[_0xaea3('0x1d')]?_0x591042['options'][_0xaea3('0x1f')]||null:null,'attributes':_0x591042[_0xaea3('0x1d')]?_0x591042[_0xaea3('0x1d')][_0xaea3('0x20')]||null:null,'limit':_0x591042[_0xaea3('0x1d')]?_0x591042[_0xaea3('0x1d')]['limit']||null:null,'include':_0x591042[_0xaea3('0x1d')]?_0x591042[_0xaea3('0x1d')][_0xaea3('0x21')]?_[_0xaea3('0x22')](_0x591042[_0xaea3('0x1d')][_0xaea3('0x21')],function(_0x3ea9f1){return{'model':db[_0x3ea9f1[_0xaea3('0x23')]],'as':_0x3ea9f1['as'],'attributes':_0x3ea9f1[_0xaea3('0x20')],'include':_0x3ea9f1[_0xaea3('0x21')]?_['map'](_0x3ea9f1['include'],function(_0x5ced76){return{'model':db[_0x5ced76[_0xaea3('0x23')]],'as':_0x5ced76['as'],'attributes':_0x5ced76[_0xaea3('0x20')],'include':_0x5ced76['include']?_[_0xaea3('0x22')](_0x5ced76[_0xaea3('0x21')],function(_0x396bec){return{'model':db[_0x396bec[_0xaea3('0x23')]],'as':_0x396bec['as'],'attributes':_0x396bec['attributes']};}):[]};}):[]};}):[]:[]})[_0xaea3('0x10')](function(_0x2efd91){logger[_0xaea3('0x11')](_0xaea3('0x1b'),_0x591042);logger['debug'](_0xaea3('0x1b'),_0x591042,JSON[_0xaea3('0x16')](_0x2efd91));_0x155250(_0x2efd91);})[_0xaea3('0x1a')](function(_0x56ad60){logger['error'](_0xaea3('0x1b'),_0x56ad60[_0xaea3('0x19')],_0x591042);_0x218492(_0x230bf1['error'](0x1f4,_0x56ad60[_0xaea3('0x19')]));});});};exports['ShowOpenchannelQueue']=function(_0x521b9b){var _0x35e0c0=this;return new Promise(function(_0x3fb476,_0x25047a){return db[_0xaea3('0x1c')][_0xaea3('0x24')]({'raw':_0x521b9b[_0xaea3('0x1d')]?_0x521b9b['options'][_0xaea3('0x1e')]===undefined?!![]:![]:!![],'where':_0x521b9b[_0xaea3('0x1d')]?_0x521b9b[_0xaea3('0x1d')][_0xaea3('0x1f')]||null:null,'attributes':_0x521b9b[_0xaea3('0x1d')]?_0x521b9b[_0xaea3('0x1d')][_0xaea3('0x20')]||null:null,'include':_0x521b9b[_0xaea3('0x1d')]?_0x521b9b[_0xaea3('0x1d')][_0xaea3('0x21')]?_[_0xaea3('0x22')](_0x521b9b[_0xaea3('0x1d')][_0xaea3('0x21')],function(_0x2433d6){return{'model':db[_0x2433d6[_0xaea3('0x23')]],'as':_0x2433d6['as'],'attributes':_0x2433d6[_0xaea3('0x20')],'include':_0x2433d6[_0xaea3('0x21')]?_['map'](_0x2433d6[_0xaea3('0x21')],function(_0x4b04a3){return{'model':db[_0x4b04a3[_0xaea3('0x23')]],'as':_0x4b04a3['as'],'attributes':_0x4b04a3[_0xaea3('0x20')],'include':_0x4b04a3[_0xaea3('0x21')]?_[_0xaea3('0x22')](_0x4b04a3[_0xaea3('0x21')],function(_0x55aa34){return{'model':db[_0x55aa34[_0xaea3('0x23')]],'as':_0x55aa34['as'],'attributes':_0x55aa34['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x20baad){logger[_0xaea3('0x11')](_0xaea3('0x25'),_0x521b9b);logger[_0xaea3('0x14')](_0xaea3('0x25'),_0x521b9b,JSON[_0xaea3('0x16')](_0x20baad));_0x3fb476(_0x20baad);})[_0xaea3('0x1a')](function(_0x2a5140){logger[_0xaea3('0x17')](_0xaea3('0x25'),_0x2a5140[_0xaea3('0x19')],_0x521b9b);_0x25047a(_0x35e0c0['error'](0x1f4,_0x2a5140['message']));});});};
\ No newline at end of file
index 99a5d5e..4a7ceef 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3f35=['update','removeListener','register','openchannelQueue:','./openchannelQueue.events','save','remove'];(function(_0x274f6f,_0x541c09){var _0x66fe2=function(_0x4aa452){while(--_0x4aa452){_0x274f6f['push'](_0x274f6f['shift']());}};_0x66fe2(++_0x541c09);}(_0x3f35,0x115));var _0x53f3=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x3f35[_0xa464c9];return _0x3d73c4;};'use strict';var OpenchannelQueueEvents=require(_0x53f3('0x0'));var events=[_0x53f3('0x1'),_0x53f3('0x2'),_0x53f3('0x3')];function createListener(_0x571180,_0x5bc881){return function(_0x553662){_0x5bc881['emit'](_0x571180,_0x553662);};}function removeListener(_0x629713,_0x4de45d){return function(){OpenchannelQueueEvents[_0x53f3('0x4')](_0x629713,_0x4de45d);};}exports[_0x53f3('0x5')]=function(_0x13226b){for(var _0x4f9dcb=0x0,_0x4f07cd=events['length'];_0x4f9dcb<_0x4f07cd;_0x4f9dcb++){var _0x156b29=events[_0x4f9dcb];var _0x520f58=createListener(_0x53f3('0x6')+_0x156b29,_0x13226b);OpenchannelQueueEvents['on'](_0x156b29,_0x520f58);}};
\ No newline at end of file
+var _0x8c77=['openchannelQueue:','./openchannelQueue.events','removeListener','register'];(function(_0x5e92a8,_0x35f3ba){var _0x17aa8=function(_0x22d568){while(--_0x22d568){_0x5e92a8['push'](_0x5e92a8['shift']());}};_0x17aa8(++_0x35f3ba);}(_0x8c77,0xf9));var _0x78c7=function(_0x4c3a4d,_0x96a6bb){_0x4c3a4d=_0x4c3a4d-0x0;var _0x2f29aa=_0x8c77[_0x4c3a4d];return _0x2f29aa;};'use strict';var OpenchannelQueueEvents=require(_0x78c7('0x0'));var events=['save','remove','update'];function createListener(_0x1d4a95,_0x995809){return function(_0x34f887){_0x995809['emit'](_0x1d4a95,_0x34f887);};}function removeListener(_0xed4b18,_0x2359d9){return function(){OpenchannelQueueEvents[_0x78c7('0x1')](_0xed4b18,_0x2359d9);};}exports[_0x78c7('0x2')]=function(_0x39cbf1){for(var _0x39f227=0x0,_0x53580c=events['length'];_0x39f227<_0x53580c;_0x39f227++){var _0x214bb0=events[_0x39f227];var _0x4d5529=createListener(_0x78c7('0x3')+_0x214bb0,_0x39cbf1);OpenchannelQueueEvents['on'](_0x214bb0,_0x4d5529);}};
\ No newline at end of file
index 230ae87..005a656 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x671c=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','post','create','put','/:id','delete','destroy','exports','multer','path'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x671c,0x163));var _0xc671=function(_0x4e0de3,_0x306197){_0x4e0de3=_0x4e0de3-0x0;var _0x377965=_0x671c[_0x4e0de3];return _0x377965;};'use strict';var multer=require(_0xc671('0x0'));var util=require('util');var path=require(_0xc671('0x1'));var timeout=require(_0xc671('0x2'));var express=require(_0xc671('0x3'));var router=express[_0xc671('0x4')]();var fs_extra=require(_0xc671('0x5'));var auth=require(_0xc671('0x6'));var interaction=require(_0xc671('0x7'));var config=require(_0xc671('0x8'));var controller=require('./openchannelQueueReport.controller');router[_0xc671('0x9')]('/',auth[_0xc671('0xa')](),controller[_0xc671('0xb')]);router[_0xc671('0x9')](_0xc671('0xc'),auth[_0xc671('0xa')](),controller[_0xc671('0xd')]);router[_0xc671('0x9')]('/:id',auth[_0xc671('0xa')](),controller['show']);router[_0xc671('0xe')]('/',auth[_0xc671('0xa')](),controller[_0xc671('0xf')]);router[_0xc671('0x10')](_0xc671('0x11'),auth[_0xc671('0xa')](),controller['update']);router[_0xc671('0x12')](_0xc671('0x11'),auth[_0xc671('0xa')](),controller[_0xc671('0x13')]);module[_0xc671('0x14')]=router;
\ No newline at end of file
+var _0x547a=['/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','isAuthenticated','get','/describe','describe'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x547a,0x1d5));var _0xa547=function(_0x1f12ad,_0x2529c7){_0x1f12ad=_0x1f12ad-0x0;var _0x154727=_0x547a[_0x1f12ad];return _0x154727;};'use strict';var multer=require(_0xa547('0x0'));var util=require(_0xa547('0x1'));var path=require(_0xa547('0x2'));var timeout=require(_0xa547('0x3'));var express=require(_0xa547('0x4'));var router=express['Router']();var fs_extra=require(_0xa547('0x5'));var auth=require(_0xa547('0x6'));var interaction=require(_0xa547('0x7'));var config=require(_0xa547('0x8'));var controller=require(_0xa547('0x9'));router['get']('/',auth[_0xa547('0xa')](),controller['index']);router[_0xa547('0xb')](_0xa547('0xc'),auth[_0xa547('0xa')](),controller[_0xa547('0xd')]);router[_0xa547('0xb')](_0xa547('0xe'),auth['isAuthenticated'](),controller[_0xa547('0xf')]);router[_0xa547('0x10')]('/',auth[_0xa547('0xa')](),controller[_0xa547('0x11')]);router[_0xa547('0x12')](_0xa547('0xe'),auth[_0xa547('0xa')](),controller[_0xa547('0x13')]);router[_0xa547('0x14')](_0xa547('0xe'),auth[_0xa547('0xa')](),controller[_0xa547('0x15')]);module[_0xa547('0x16')]=router;
\ No newline at end of file
index 699d792..2cf84aa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe3e8=['moment','sequelize','exports','STRING','DATE'];(function(_0x12d44c,_0xf11296){var _0x4fde20=function(_0x3c1ad6){while(--_0x3c1ad6){_0x12d44c['push'](_0x12d44c['shift']());}};_0x4fde20(++_0xf11296);}(_0xe3e8,0x181));var _0x8e3e=function(_0x28d18d,_0x55896b){_0x28d18d=_0x28d18d-0x0;var _0x470640=_0xe3e8[_0x28d18d];return _0x470640;};'use strict';var moment=require(_0x8e3e('0x0'));var Sequelize=require(_0x8e3e('0x1'));module[_0x8e3e('0x2')]={'uniqueid':{'type':Sequelize[_0x8e3e('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x8e3e('0x3')]},'joinAt':{'type':Sequelize[_0x8e3e('0x4')]},'leaveAt':{'type':Sequelize[_0x8e3e('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x1353=['sequelize','exports','STRING','DATE','moment'];(function(_0x14705b,_0x32b5ef){var _0x59d4a8=function(_0x598a83){while(--_0x598a83){_0x14705b['push'](_0x14705b['shift']());}};_0x59d4a8(++_0x32b5ef);}(_0x1353,0xb3));var _0x3135=function(_0x5f3f88,_0x562baf){_0x5f3f88=_0x5f3f88-0x0;var _0xd08119=_0x1353[_0x5f3f88];return _0xd08119;};'use strict';var moment=require(_0x3135('0x0'));var Sequelize=require(_0x3135('0x1'));module[_0x3135('0x2')]={'uniqueid':{'type':Sequelize[_0x3135('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x3135('0x3')]},'joinAt':{'type':Sequelize[_0x3135('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x3135('0x4')]},'exitAt':{'type':Sequelize[_0x3135('0x4')]},'reason':{'type':Sequelize[_0x3135('0x3')]}};
\ No newline at end of file
index 9d6032b..d3377e3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x261b=['sort','where','merge','filter','options','include','findAll','rows','catch','show','OpenchannelQueueReport','includeAll','create','body','find','params','describe','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','end','error','stack','name','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit'];(function(_0x4d12ef,_0x3ae382){var _0x588013=function(_0x441b85){while(--_0x441b85){_0x4d12ef['push'](_0x4d12ef['shift']());}};_0x588013(++_0x3ae382);}(_0x261b,0x1df));var _0xb261=function(_0x1225f9,_0x21344d){_0x1225f9=_0x1225f9-0x0;var _0x4cddd2=_0x261b[_0x1225f9];return _0x4cddd2;};'use strict';var emlformat=require(_0xb261('0x0'));var rimraf=require(_0xb261('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb261('0x2'));var rp=require(_0xb261('0x3'));var moment=require('moment');var BPromise=require(_0xb261('0x4'));var Mustache=require(_0xb261('0x5'));var util=require('util');var path=require(_0xb261('0x6'));var sox=require(_0xb261('0x7'));var csv=require(_0xb261('0x8'));var ejs=require(_0xb261('0x9'));var fs=require('fs');var fs_extra=require(_0xb261('0xa'));var _=require(_0xb261('0xb'));var squel=require('squel');var crypto=require(_0xb261('0xc'));var jsforce=require(_0xb261('0xd'));var deskjs=require(_0xb261('0xe'));var toCsv=require('to-csv');var querystring=require(_0xb261('0xf'));var Papa=require(_0xb261('0x10'));var Redis=require(_0xb261('0x11'));var authService=require(_0xb261('0x12'));var qs=require(_0xb261('0x13'));var as=require(_0xb261('0x14'));var hardwareService=require(_0xb261('0x15'));var logger=require(_0xb261('0x16'))(_0xb261('0x17'));var utils=require(_0xb261('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xb261('0x19'));var db=require(_0xb261('0x1a'))['db'];function respondWithStatusCode(_0x38b99b,_0x3e5317){_0x3e5317=_0x3e5317||0xcc;return function(_0x4d5e9a){if(_0x4d5e9a){return _0x38b99b[_0xb261('0x1b')](_0x3e5317);}return _0x38b99b[_0xb261('0x1c')](_0x3e5317)['end']();};}function respondWithResult(_0x240498,_0x1c1207){_0x1c1207=_0x1c1207||0xc8;return function(_0x1b0abe){if(_0x1b0abe){return _0x240498[_0xb261('0x1c')](_0x1c1207)['json'](_0x1b0abe);}};}function respondWithFilteredResult(_0xe0e0e7,_0x24249f){return function(_0x4da351){if(_0x4da351){var _0x2d57d7=typeof _0x24249f[_0xb261('0x1d')]===_0xb261('0x1e')&&typeof _0x24249f[_0xb261('0x1f')]===_0xb261('0x1e');var _0xc1149b=_0x4da351['count'];var _0x3ad5cb=_0x2d57d7?0x0:_0x24249f[_0xb261('0x1d')];var _0x1eda51=_0x2d57d7?_0x4da351[_0xb261('0x20')]:_0x24249f[_0xb261('0x1d')]+_0x24249f['limit'];var _0x2a0b5c;if(_0x1eda51>=_0xc1149b){_0x1eda51=_0xc1149b;_0x2a0b5c=0xc8;}else{_0x2a0b5c=0xce;}_0xe0e0e7[_0xb261('0x1c')](_0x2a0b5c);return _0xe0e0e7[_0xb261('0x21')](_0xb261('0x22'),_0x3ad5cb+'-'+_0x1eda51+'/'+_0xc1149b)[_0xb261('0x23')](_0x4da351);}return null;};}function patchUpdates(_0x362790){return function(_0x1639a8){try{jsonpatch[_0xb261('0x24')](_0x1639a8,_0x362790,!![]);}catch(_0x1726f3){return BPromise[_0xb261('0x25')](_0x1726f3);}return _0x1639a8[_0xb261('0x26')]();};}function saveUpdates(_0x524f76,_0x7ddff5){return function(_0x447871){if(_0x447871){return _0x447871[_0xb261('0x27')](_0x524f76)[_0xb261('0x28')](function(_0x308462){return _0x308462;});}return null;};}function removeEntity(_0x17006d,_0x4ff5cf){return function(_0x42592b){if(_0x42592b){return _0x42592b['destroy']()[_0xb261('0x28')](function(){_0x17006d[_0xb261('0x1c')](0xcc)[_0xb261('0x29')]();});}};}function handleEntityNotFound(_0x593a92,_0x21c249){return function(_0x273206){if(!_0x273206){_0x593a92['sendStatus'](0x194);}return _0x273206;};}function handleError(_0x47c94f,_0x4fe850){_0x4fe850=_0x4fe850||0x1f4;return function(_0x55c2a9){logger[_0xb261('0x2a')](_0x55c2a9[_0xb261('0x2b')]);if(_0x55c2a9[_0xb261('0x2c')]){delete _0x55c2a9[_0xb261('0x2c')];}_0x47c94f['status'](_0x4fe850)['send'](_0x55c2a9);};}exports[_0xb261('0x2d')]=function(_0x235735,_0x5b16b0){var _0x5b1c36={},_0x12d871={},_0x443c84={'count':0x0,'rows':[]};var _0x3fcda4=_[_0xb261('0x2e')](db['OpenchannelQueueReport'][_0xb261('0x2f')],function(_0x49e005){return{'name':_0x49e005['fieldName'],'type':_0x49e005[_0xb261('0x30')][_0xb261('0x31')]};});_0x12d871[_0xb261('0x32')]=_['map'](_0x3fcda4,_0xb261('0x2c'));_0x12d871[_0xb261('0x33')]=_[_0xb261('0x34')](_0x235735[_0xb261('0x33')]);_0x12d871[_0xb261('0x35')]=_[_0xb261('0x36')](_0x12d871[_0xb261('0x32')],_0x12d871[_0xb261('0x33')]);_0x5b1c36[_0xb261('0x37')]=_[_0xb261('0x36')](_0x12d871[_0xb261('0x32')],qs[_0xb261('0x38')](_0x235735[_0xb261('0x33')][_0xb261('0x38')]));_0x5b1c36[_0xb261('0x37')]=_0x5b1c36[_0xb261('0x37')][_0xb261('0x39')]?_0x5b1c36[_0xb261('0x37')]:_0x12d871['model'];if(!_0x235735[_0xb261('0x33')][_0xb261('0x3a')](_0xb261('0x3b'))){_0x5b1c36[_0xb261('0x1f')]=qs['limit'](_0x235735[_0xb261('0x33')][_0xb261('0x1f')]);_0x5b1c36[_0xb261('0x1d')]=qs[_0xb261('0x1d')](_0x235735['query']['offset']);}_0x5b1c36['order']=qs[_0xb261('0x3c')](_0x235735[_0xb261('0x33')][_0xb261('0x3c')]);_0x5b1c36['where']=qs[_0xb261('0x35')](_['pick'](_0x235735[_0xb261('0x33')],_0x12d871[_0xb261('0x35')]),_0x3fcda4);if(_0x235735[_0xb261('0x33')]['filter']){_0x5b1c36[_0xb261('0x3d')]=_[_0xb261('0x3e')](_0x5b1c36[_0xb261('0x3d')],{'$or':_[_0xb261('0x2e')](_0x3fcda4,function(_0x2d2f93){if(_0x2d2f93['type']!=='VIRTUAL'){var _0x3c3a78={};_0x3c3a78[_0x2d2f93[_0xb261('0x2c')]]={'$like':'%'+_0x235735[_0xb261('0x33')][_0xb261('0x3f')]+'%'};return _0x3c3a78;}})});}_0x5b1c36=_[_0xb261('0x3e')]({},_0x5b1c36,_0x235735[_0xb261('0x40')]);var _0x4c8c16={'where':_0x5b1c36[_0xb261('0x3d')]};return db['OpenchannelQueueReport']['count'](_0x4c8c16)['then'](function(_0xdf8690){_0x443c84['count']=_0xdf8690;if(_0x235735[_0xb261('0x33')]['includeAll']){_0x5b1c36[_0xb261('0x41')]=[{'all':!![]}];}return db['OpenchannelQueueReport'][_0xb261('0x42')](_0x5b1c36);})[_0xb261('0x28')](function(_0x42258d){_0x443c84[_0xb261('0x43')]=_0x42258d;return _0x443c84;})['then'](respondWithFilteredResult(_0x5b16b0,_0x5b1c36))[_0xb261('0x44')](handleError(_0x5b16b0,null));};exports[_0xb261('0x45')]=function(_0x17abad,_0x37fe96){var _0x371915={'raw':!![],'where':{'id':_0x17abad['params']['id']}},_0x2abaaf={};_0x2abaaf[_0xb261('0x32')]=_['keys'](db[_0xb261('0x46')][_0xb261('0x2f')]);_0x2abaaf[_0xb261('0x33')]=_[_0xb261('0x34')](_0x17abad[_0xb261('0x33')]);_0x2abaaf[_0xb261('0x35')]=_[_0xb261('0x36')](_0x2abaaf[_0xb261('0x32')],_0x2abaaf[_0xb261('0x33')]);_0x371915[_0xb261('0x37')]=_['intersection'](_0x2abaaf[_0xb261('0x32')],qs[_0xb261('0x38')](_0x17abad[_0xb261('0x33')]['fields']));_0x371915[_0xb261('0x37')]=_0x371915[_0xb261('0x37')]['length']?_0x371915['attributes']:_0x2abaaf['model'];if(_0x17abad[_0xb261('0x33')][_0xb261('0x47')]){_0x371915['include']=[{'all':!![]}];}_0x371915=_['merge']({},_0x371915,_0x17abad[_0xb261('0x40')]);return db['OpenchannelQueueReport']['find'](_0x371915)[_0xb261('0x28')](handleEntityNotFound(_0x37fe96,null))['then'](respondWithResult(_0x37fe96,null))[_0xb261('0x44')](handleError(_0x37fe96,null));};exports['create']=function(_0x30b920,_0x4eca4e){return db[_0xb261('0x46')][_0xb261('0x48')](_0x30b920[_0xb261('0x49')],{})[_0xb261('0x28')](respondWithResult(_0x4eca4e,0xc9))['catch'](handleError(_0x4eca4e,null));};exports[_0xb261('0x27')]=function(_0x3e6164,_0x4e8a42){if(_0x3e6164[_0xb261('0x49')]['id']){delete _0x3e6164[_0xb261('0x49')]['id'];}return db[_0xb261('0x46')][_0xb261('0x4a')]({'where':{'id':_0x3e6164[_0xb261('0x4b')]['id']}})[_0xb261('0x28')](handleEntityNotFound(_0x4e8a42,null))[_0xb261('0x28')](saveUpdates(_0x3e6164[_0xb261('0x49')],null))[_0xb261('0x28')](respondWithResult(_0x4e8a42,null))['catch'](handleError(_0x4e8a42,null));};exports['destroy']=function(_0x2c793c,_0x7aa757){return db[_0xb261('0x46')]['find']({'where':{'id':_0x2c793c['params']['id']}})[_0xb261('0x28')](handleEntityNotFound(_0x7aa757,null))[_0xb261('0x28')](removeEntity(_0x7aa757,null))[_0xb261('0x44')](handleError(_0x7aa757,null));};exports[_0xb261('0x4c')]=function(_0x1b7372,_0x2947d1){return db[_0xb261('0x46')][_0xb261('0x4c')]()[_0xb261('0x28')](respondWithResult(_0x2947d1,null))[_0xb261('0x44')](handleError(_0x2947d1,null));};
\ No newline at end of file
+var _0xfd9d=['hasOwnProperty','sort','pick','filter','merge','map','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','destroy','end','error','stack','name','OpenchannelQueueReport','type','model','query','keys','filters','intersection','attributes','fields','length'];(function(_0x3b307c,_0x240cd1){var _0x4a33ad=function(_0x1441ba){while(--_0x1441ba){_0x3b307c['push'](_0x3b307c['shift']());}};_0x4a33ad(++_0x240cd1);}(_0xfd9d,0x1c3));var _0xdfd9=function(_0x45f951,_0x2750c8){_0x45f951=_0x45f951-0x0;var _0x24756c=_0xfd9d[_0x45f951];return _0x24756c;};'use strict';var emlformat=require(_0xdfd9('0x0'));var rimraf=require(_0xdfd9('0x1'));var zipdir=require(_0xdfd9('0x2'));var jsonpatch=require(_0xdfd9('0x3'));var rp=require(_0xdfd9('0x4'));var moment=require('moment');var BPromise=require(_0xdfd9('0x5'));var Mustache=require(_0xdfd9('0x6'));var util=require(_0xdfd9('0x7'));var path=require(_0xdfd9('0x8'));var sox=require(_0xdfd9('0x9'));var csv=require(_0xdfd9('0xa'));var ejs=require(_0xdfd9('0xb'));var fs=require('fs');var fs_extra=require(_0xdfd9('0xc'));var _=require(_0xdfd9('0xd'));var squel=require(_0xdfd9('0xe'));var crypto=require(_0xdfd9('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xdfd9('0x10'));var Papa=require(_0xdfd9('0x11'));var Redis=require(_0xdfd9('0x12'));var authService=require(_0xdfd9('0x13'));var qs=require(_0xdfd9('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdfd9('0x15'));var logger=require('../../config/logger')(_0xdfd9('0x16'));var utils=require(_0xdfd9('0x17'));var config=require(_0xdfd9('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5ba16a,_0x5843f4){_0x5843f4=_0x5843f4||0xcc;return function(_0x5e5f14){if(_0x5e5f14){return _0x5ba16a[_0xdfd9('0x19')](_0x5843f4);}return _0x5ba16a[_0xdfd9('0x1a')](_0x5843f4)['end']();};}function respondWithResult(_0x18f51e,_0x16fb48){_0x16fb48=_0x16fb48||0xc8;return function(_0x41330f){if(_0x41330f){return _0x18f51e['status'](_0x16fb48)['json'](_0x41330f);}};}function respondWithFilteredResult(_0x4cc9b0,_0x2538c5){return function(_0x29b2e4){if(_0x29b2e4){var _0x530bf6=typeof _0x2538c5[_0xdfd9('0x1b')]===_0xdfd9('0x1c')&&typeof _0x2538c5[_0xdfd9('0x1d')]===_0xdfd9('0x1c');var _0x36211d=_0x29b2e4[_0xdfd9('0x1e')];var _0x980174=_0x530bf6?0x0:_0x2538c5[_0xdfd9('0x1b')];var _0x12fe5f=_0x530bf6?_0x29b2e4[_0xdfd9('0x1e')]:_0x2538c5[_0xdfd9('0x1b')]+_0x2538c5['limit'];var _0x4e7724;if(_0x12fe5f>=_0x36211d){_0x12fe5f=_0x36211d;_0x4e7724=0xc8;}else{_0x4e7724=0xce;}_0x4cc9b0[_0xdfd9('0x1a')](_0x4e7724);return _0x4cc9b0['set'](_0xdfd9('0x1f'),_0x980174+'-'+_0x12fe5f+'/'+_0x36211d)[_0xdfd9('0x20')](_0x29b2e4);}return null;};}function patchUpdates(_0x1a0bd3){return function(_0x5b0e6e){try{jsonpatch[_0xdfd9('0x21')](_0x5b0e6e,_0x1a0bd3,!![]);}catch(_0x1b144f){return BPromise[_0xdfd9('0x22')](_0x1b144f);}return _0x5b0e6e[_0xdfd9('0x23')]();};}function saveUpdates(_0x7dca60,_0x4d3eaa){return function(_0x319dd2){if(_0x319dd2){return _0x319dd2[_0xdfd9('0x24')](_0x7dca60)[_0xdfd9('0x25')](function(_0x4d8d03){return _0x4d8d03;});}return null;};}function removeEntity(_0x2570ba,_0x5a0008){return function(_0x242484){if(_0x242484){return _0x242484[_0xdfd9('0x26')]()[_0xdfd9('0x25')](function(){_0x2570ba[_0xdfd9('0x1a')](0xcc)[_0xdfd9('0x27')]();});}};}function handleEntityNotFound(_0x26fa98,_0x9879e9){return function(_0x3a0504){if(!_0x3a0504){_0x26fa98[_0xdfd9('0x19')](0x194);}return _0x3a0504;};}function handleError(_0x460535,_0x2c1ea1){_0x2c1ea1=_0x2c1ea1||0x1f4;return function(_0x5e0b54){logger[_0xdfd9('0x28')](_0x5e0b54[_0xdfd9('0x29')]);if(_0x5e0b54[_0xdfd9('0x2a')]){delete _0x5e0b54[_0xdfd9('0x2a')];}_0x460535[_0xdfd9('0x1a')](_0x2c1ea1)['send'](_0x5e0b54);};}exports['index']=function(_0x138710,_0x1a1326){var _0x53d4fe={},_0x5d8e86={},_0x18264a={'count':0x0,'rows':[]};var _0x4a18ea=_['map'](db[_0xdfd9('0x2b')]['rawAttributes'],function(_0x1fb422){return{'name':_0x1fb422['fieldName'],'type':_0x1fb422[_0xdfd9('0x2c')]['key']};});_0x5d8e86[_0xdfd9('0x2d')]=_['map'](_0x4a18ea,_0xdfd9('0x2a'));_0x5d8e86[_0xdfd9('0x2e')]=_[_0xdfd9('0x2f')](_0x138710[_0xdfd9('0x2e')]);_0x5d8e86[_0xdfd9('0x30')]=_[_0xdfd9('0x31')](_0x5d8e86[_0xdfd9('0x2d')],_0x5d8e86['query']);_0x53d4fe[_0xdfd9('0x32')]=_[_0xdfd9('0x31')](_0x5d8e86[_0xdfd9('0x2d')],qs[_0xdfd9('0x33')](_0x138710[_0xdfd9('0x2e')][_0xdfd9('0x33')]));_0x53d4fe[_0xdfd9('0x32')]=_0x53d4fe[_0xdfd9('0x32')][_0xdfd9('0x34')]?_0x53d4fe[_0xdfd9('0x32')]:_0x5d8e86[_0xdfd9('0x2d')];if(!_0x138710['query'][_0xdfd9('0x35')]('nolimit')){_0x53d4fe[_0xdfd9('0x1d')]=qs[_0xdfd9('0x1d')](_0x138710['query'][_0xdfd9('0x1d')]);_0x53d4fe[_0xdfd9('0x1b')]=qs['offset'](_0x138710[_0xdfd9('0x2e')]['offset']);}_0x53d4fe['order']=qs[_0xdfd9('0x36')](_0x138710[_0xdfd9('0x2e')][_0xdfd9('0x36')]);_0x53d4fe['where']=qs[_0xdfd9('0x30')](_[_0xdfd9('0x37')](_0x138710['query'],_0x5d8e86['filters']),_0x4a18ea);if(_0x138710['query'][_0xdfd9('0x38')]){_0x53d4fe['where']=_[_0xdfd9('0x39')](_0x53d4fe['where'],{'$or':_[_0xdfd9('0x3a')](_0x4a18ea,function(_0x221258){if(_0x221258[_0xdfd9('0x2c')]!=='VIRTUAL'){var _0x455f9a={};_0x455f9a[_0x221258[_0xdfd9('0x2a')]]={'$like':'%'+_0x138710['query'][_0xdfd9('0x38')]+'%'};return _0x455f9a;}})});}_0x53d4fe=_[_0xdfd9('0x39')]({},_0x53d4fe,_0x138710[_0xdfd9('0x3b')]);var _0x4f3dee={'where':_0x53d4fe['where']};return db[_0xdfd9('0x2b')][_0xdfd9('0x1e')](_0x4f3dee)[_0xdfd9('0x25')](function(_0x4cd292){_0x18264a[_0xdfd9('0x1e')]=_0x4cd292;if(_0x138710[_0xdfd9('0x2e')][_0xdfd9('0x3c')]){_0x53d4fe[_0xdfd9('0x3d')]=[{'all':!![]}];}return db['OpenchannelQueueReport'][_0xdfd9('0x3e')](_0x53d4fe);})[_0xdfd9('0x25')](function(_0x137212){_0x18264a[_0xdfd9('0x3f')]=_0x137212;return _0x18264a;})['then'](respondWithFilteredResult(_0x1a1326,_0x53d4fe))[_0xdfd9('0x40')](handleError(_0x1a1326,null));};exports[_0xdfd9('0x41')]=function(_0x4b72dc,_0x324417){var _0x478f51={'raw':!![],'where':{'id':_0x4b72dc[_0xdfd9('0x42')]['id']}},_0x5c7dfc={};_0x5c7dfc[_0xdfd9('0x2d')]=_[_0xdfd9('0x2f')](db[_0xdfd9('0x2b')][_0xdfd9('0x43')]);_0x5c7dfc[_0xdfd9('0x2e')]=_[_0xdfd9('0x2f')](_0x4b72dc[_0xdfd9('0x2e')]);_0x5c7dfc[_0xdfd9('0x30')]=_['intersection'](_0x5c7dfc[_0xdfd9('0x2d')],_0x5c7dfc['query']);_0x478f51[_0xdfd9('0x32')]=_['intersection'](_0x5c7dfc[_0xdfd9('0x2d')],qs[_0xdfd9('0x33')](_0x4b72dc['query']['fields']));_0x478f51['attributes']=_0x478f51[_0xdfd9('0x32')][_0xdfd9('0x34')]?_0x478f51[_0xdfd9('0x32')]:_0x5c7dfc[_0xdfd9('0x2d')];if(_0x4b72dc[_0xdfd9('0x2e')]['includeAll']){_0x478f51[_0xdfd9('0x3d')]=[{'all':!![]}];}_0x478f51=_[_0xdfd9('0x39')]({},_0x478f51,_0x4b72dc[_0xdfd9('0x3b')]);return db[_0xdfd9('0x2b')][_0xdfd9('0x44')](_0x478f51)[_0xdfd9('0x25')](handleEntityNotFound(_0x324417,null))[_0xdfd9('0x25')](respondWithResult(_0x324417,null))[_0xdfd9('0x40')](handleError(_0x324417,null));};exports['create']=function(_0x18b847,_0x7cd677){return db[_0xdfd9('0x2b')][_0xdfd9('0x45')](_0x18b847[_0xdfd9('0x46')],{})[_0xdfd9('0x25')](respondWithResult(_0x7cd677,0xc9))['catch'](handleError(_0x7cd677,null));};exports[_0xdfd9('0x24')]=function(_0x472940,_0x4267ee){if(_0x472940['body']['id']){delete _0x472940['body']['id'];}return db[_0xdfd9('0x2b')][_0xdfd9('0x44')]({'where':{'id':_0x472940[_0xdfd9('0x42')]['id']}})[_0xdfd9('0x25')](handleEntityNotFound(_0x4267ee,null))[_0xdfd9('0x25')](saveUpdates(_0x472940[_0xdfd9('0x46')],null))[_0xdfd9('0x25')](respondWithResult(_0x4267ee,null))[_0xdfd9('0x40')](handleError(_0x4267ee,null));};exports[_0xdfd9('0x26')]=function(_0x38584f,_0x18593c){return db['OpenchannelQueueReport'][_0xdfd9('0x44')]({'where':{'id':_0x38584f['params']['id']}})[_0xdfd9('0x25')](handleEntityNotFound(_0x18593c,null))[_0xdfd9('0x25')](removeEntity(_0x18593c,null))[_0xdfd9('0x40')](handleError(_0x18593c,null));};exports[_0xdfd9('0x47')]=function(_0x4ef39a,_0x16b53d){return db[_0xdfd9('0x2b')][_0xdfd9('0x47')]()[_0xdfd9('0x25')](respondWithResult(_0x16b53d,null))[_0xdfd9('0x40')](handleError(_0x16b53d,null));};
\ No newline at end of file
index 37bcf1a..3909ebf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x814b=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','uniqueid','lodash','util'];(function(_0x37b7b6,_0x165a5c){var _0x10c4c3=function(_0x16d71e){while(--_0x16d71e){_0x37b7b6['push'](_0x37b7b6['shift']());}};_0x10c4c3(++_0x165a5c);}(_0x814b,0x1a2));var _0xb814=function(_0x524ce0,_0x3670b2){_0x524ce0=_0x524ce0-0x0;var _0x38299f=_0x814b[_0x524ce0];return _0x38299f;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var logger=require(_0xb814('0x2'))(_0xb814('0x3'));var moment=require(_0xb814('0x4'));var BPromise=require(_0xb814('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb814('0x6'));var rimraf=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var attributes=require(_0xb814('0x9'));module[_0xb814('0xa')]=function(_0x322a70,_0x53e507){return _0x322a70[_0xb814('0xb')](_0xb814('0xc'),attributes,{'tableName':'report_openchannel_queue','paranoid':![],'indexes':[{'name':_0xb814('0xd'),'fields':[_0xb814('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x1261=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','define','report_openchannel_queue','uniqueid','util'];(function(_0x2e0565,_0x26be83){var _0x24624a=function(_0x5a53d2){while(--_0x5a53d2){_0x2e0565['push'](_0x2e0565['shift']());}};_0x24624a(++_0x26be83);}(_0x1261,0x144));var _0x1126=function(_0x1a8469,_0x2ffccf){_0x1a8469=_0x1a8469-0x0;var _0x19c2dd=_0x1261[_0x1a8469];return _0x19c2dd;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var logger=require(_0x1126('0x1'))(_0x1126('0x2'));var moment=require(_0x1126('0x3'));var BPromise=require(_0x1126('0x4'));var rp=require(_0x1126('0x5'));var fs=require('fs');var path=require(_0x1126('0x6'));var rimraf=require(_0x1126('0x7'));var config=require(_0x1126('0x8'));var attributes=require(_0x1126('0x9'));module['exports']=function(_0x5c68c8,_0x40ba58){return _0x5c68c8[_0x1126('0xa')]('OpenchannelQueueReport',attributes,{'tableName':_0x1126('0xb'),'paranoid':![],'indexes':[{'name':_0x1126('0xc'),'fields':[_0x1126('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
index f3ac233..449978c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8caf=['OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','options','raw','then','UpdateOpenchannelQueueReport','update','body','where','attributes','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x1f2f61,_0x586f2f){var _0x10dabc=function(_0x3233b5){while(--_0x3233b5){_0x1f2f61['push'](_0x1f2f61['shift']());}};_0x10dabc(++_0x586f2f);}(_0x8caf,0x1ab));var _0xf8ca=function(_0x4e68aa,_0x77632d){_0x4e68aa=_0x4e68aa-0x0;var _0xfe0a56=_0x8caf[_0x4e68aa];return _0xfe0a56;};'use strict';var _=require('lodash');var util=require(_0xf8ca('0x0'));var moment=require(_0xf8ca('0x1'));var BPromise=require(_0xf8ca('0x2'));var rs=require(_0xf8ca('0x3'));var fs=require('fs');var Redis=require(_0xf8ca('0x4'));var db=require(_0xf8ca('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xf8ca('0x6'))(_0xf8ca('0x7'));var config=require(_0xf8ca('0x8'));var jayson=require(_0xf8ca('0x9'));var client=jayson[_0xf8ca('0xa')][_0xf8ca('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x562eea,_0x773b9f,_0x3abd58){return new BPromise(function(_0x3a91d3,_0x31300c){return client['request'](_0x562eea,_0x3abd58)['then'](function(_0x3a9674){logger['info'](_0xf8ca('0xc'),_0x773b9f,_0xf8ca('0xd'));logger[_0xf8ca('0xe')](_0xf8ca('0xf'),_0x773b9f,'request\x20sent',JSON[_0xf8ca('0x10')](_0x3a9674));if(_0x3a9674[_0xf8ca('0x11')]){if(_0x3a9674[_0xf8ca('0x11')][_0xf8ca('0x12')]===0x1f4){logger['error'](_0xf8ca('0xc'),_0x773b9f,_0x3a9674[_0xf8ca('0x11')]['message']);return _0x31300c(_0x3a9674[_0xf8ca('0x11')][_0xf8ca('0x13')]);}logger[_0xf8ca('0x11')](_0xf8ca('0xc'),_0x773b9f,_0x3a9674[_0xf8ca('0x11')][_0xf8ca('0x13')]);return _0x3a91d3(_0x3a9674[_0xf8ca('0x11')][_0xf8ca('0x13')]);}else{logger[_0xf8ca('0x14')](_0xf8ca('0xc'),_0x773b9f,'request\x20sent');_0x3a91d3(_0x3a9674[_0xf8ca('0x15')][_0xf8ca('0x13')]);}})[_0xf8ca('0x16')](function(_0x12e8f0){logger[_0xf8ca('0x11')](_0xf8ca('0xc'),_0x773b9f,_0x12e8f0);_0x31300c(_0x12e8f0);});});}exports[_0xf8ca('0x17')]=function(_0x127119){var _0x50e805=this;return new Promise(function(_0x237f44,_0x3b5400){return db[_0xf8ca('0x18')][_0xf8ca('0x19')](_0x127119['body'],{'raw':_0x127119[_0xf8ca('0x1a')]?_0x127119[_0xf8ca('0x1a')][_0xf8ca('0x1b')]===undefined?!![]:![]:!![]})[_0xf8ca('0x1c')](function(_0x18e8da){logger[_0xf8ca('0x14')]('CreateOpenchannelQueueReport',_0x127119);logger[_0xf8ca('0xe')]('CreateOpenchannelQueueReport',_0x127119,JSON[_0xf8ca('0x10')](_0x18e8da));_0x237f44(_0x18e8da);})[_0xf8ca('0x16')](function(_0x179a48){logger[_0xf8ca('0x11')](_0xf8ca('0x17'),_0x179a48[_0xf8ca('0x13')],_0x127119);_0x3b5400(_0x50e805['error'](0x1f4,_0x179a48['message']));});});};exports[_0xf8ca('0x1d')]=function(_0x1d746a){var _0x4962a5=this;return new Promise(function(_0x55b944,_0x4357a2){return db[_0xf8ca('0x18')][_0xf8ca('0x1e')](_0x1d746a[_0xf8ca('0x1f')],{'raw':_0x1d746a[_0xf8ca('0x1a')]?_0x1d746a[_0xf8ca('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1d746a[_0xf8ca('0x1a')]?_0x1d746a[_0xf8ca('0x1a')][_0xf8ca('0x20')]||null:null,'attributes':_0x1d746a[_0xf8ca('0x1a')]?_0x1d746a[_0xf8ca('0x1a')][_0xf8ca('0x21')]||null:null,'limit':_0x1d746a[_0xf8ca('0x1a')]?_0x1d746a['options']['limit']||null:null})[_0xf8ca('0x1c')](function(_0x873e43){logger[_0xf8ca('0x14')]('UpdateOpenchannelQueueReport',_0x1d746a);logger[_0xf8ca('0xe')]('UpdateOpenchannelQueueReport',_0x1d746a,JSON['stringify'](_0x873e43));_0x55b944(_0x873e43);})[_0xf8ca('0x16')](function(_0x22b4a9){logger[_0xf8ca('0x11')]('UpdateOpenchannelQueueReport',_0x22b4a9[_0xf8ca('0x13')],_0x1d746a);_0x4357a2(_0x4962a5[_0xf8ca('0x11')](0x1f4,_0x22b4a9['message']));});});};
\ 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(_0x33bc9e,_0x295da1){var _0xef97c9=function(_0x1fc3ca){while(--_0x1fc3ca){_0x33bc9e['push'](_0x33bc9e['shift']());}};_0xef97c9(++_0x295da1);}(_0x32b6,0x1d1));var _0x632b=function(_0x3bc010,_0x2f61e1){_0x3bc010=_0x3bc010-0x0;var _0x137d79=_0x32b6[_0x3bc010];return _0x137d79;};'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 ecf634e..611d2af 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xff54=['../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','/describe','/:id','show','post','put','update','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x441f64,_0xf8d0c1){var _0x50f21a=function(_0x4b83be){while(--_0x4b83be){_0x441f64['push'](_0x441f64['shift']());}};_0x50f21a(++_0xf8d0c1);}(_0xff54,0x1d9));var _0x4ff5=function(_0x26a3cb,_0x2972fd){_0x26a3cb=_0x26a3cb-0x0;var _0x1b4c1a=_0xff54[_0x26a3cb];return _0x1b4c1a;};'use strict';var multer=require('multer');var util=require(_0x4ff5('0x0'));var path=require('path');var timeout=require(_0x4ff5('0x1'));var express=require(_0x4ff5('0x2'));var router=express[_0x4ff5('0x3')]();var fs_extra=require(_0x4ff5('0x4'));var auth=require(_0x4ff5('0x5'));var interaction=require(_0x4ff5('0x6'));var config=require(_0x4ff5('0x7'));var controller=require(_0x4ff5('0x8'));router[_0x4ff5('0x9')]('/',auth[_0x4ff5('0xa')](),controller['index']);router['get'](_0x4ff5('0xb'),auth[_0x4ff5('0xa')](),controller['describe']);router[_0x4ff5('0x9')](_0x4ff5('0xc'),auth[_0x4ff5('0xa')](),controller[_0x4ff5('0xd')]);router[_0x4ff5('0xe')]('/',auth[_0x4ff5('0xa')](),controller['create']);router[_0x4ff5('0xf')](_0x4ff5('0xc'),auth[_0x4ff5('0xa')](),controller[_0x4ff5('0x10')]);router[_0x4ff5('0x11')](_0x4ff5('0xc'),auth[_0x4ff5('0xa')](),controller[_0x4ff5('0x12')]);module[_0x4ff5('0x13')]=router;
\ No newline at end of file
+var _0xcdc3=['connect-timeout','express','Router','fs-extra','../../components/auth/service','./openchannelTransferReport.controller','get','isAuthenticated','index','describe','show','/:id','update','delete','destroy','multer','util'];(function(_0x280fdd,_0x258d03){var _0x1af49a=function(_0x35617e){while(--_0x35617e){_0x280fdd['push'](_0x280fdd['shift']());}};_0x1af49a(++_0x258d03);}(_0xcdc3,0x1b8));var _0x3cdc=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0xcdc3[_0x2be8c2];return _0x97f531;};'use strict';var multer=require(_0x3cdc('0x0'));var util=require(_0x3cdc('0x1'));var path=require('path');var timeout=require(_0x3cdc('0x2'));var express=require(_0x3cdc('0x3'));var router=express[_0x3cdc('0x4')]();var fs_extra=require(_0x3cdc('0x5'));var auth=require(_0x3cdc('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x3cdc('0x7'));router[_0x3cdc('0x8')]('/',auth[_0x3cdc('0x9')](),controller[_0x3cdc('0xa')]);router[_0x3cdc('0x8')]('/describe',auth[_0x3cdc('0x9')](),controller[_0x3cdc('0xb')]);router[_0x3cdc('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x3cdc('0xc')]);router['post']('/',auth[_0x3cdc('0x9')](),controller['create']);router['put'](_0x3cdc('0xd'),auth[_0x3cdc('0x9')](),controller[_0x3cdc('0xe')]);router[_0x3cdc('0xf')](_0x3cdc('0xd'),auth[_0x3cdc('0x9')](),controller[_0x3cdc('0x10')]);module['exports']=router;
\ No newline at end of file
index 1b82967..ed04007 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['account','queue','DATE','NOW','moment','sequelize','exports'];(function(_0x25ad30,_0x4d9cb8){var _0x97c45e=function(_0x2f3b62){while(--_0x2f3b62){_0x25ad30['push'](_0x25ad30['shift']());}};_0x97c45e(++_0x4d9cb8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0xa9e0[_0x298ed3];return _0x5aad28;};'use strict';var moment=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x3'),'agent',_0x0a9e('0x4')),'allowNull':![],'defaultValue':_0x0a9e('0x4')},'transferredAt':{'type':Sequelize[_0x0a9e('0x5')],'allowNull':![],'defaultValue':Sequelize[_0x0a9e('0x6')]}};
\ No newline at end of file
+var _0x9bde=['NOW','sequelize','STRING','account','agent','queue','DATE'];(function(_0x4cd21c,_0x35fa45){var _0x5d8e5e=function(_0x3af223){while(--_0x3af223){_0x4cd21c['push'](_0x4cd21c['shift']());}};_0x5d8e5e(++_0x35fa45);}(_0x9bde,0xe1));var _0xe9bd=function(_0xfbba39,_0x21094e){_0xfbba39=_0xfbba39-0x0;var _0x1c51bb=_0x9bde[_0xfbba39];return _0x1c51bb;};'use strict';var moment=require('moment');var Sequelize=require(_0xe9bd('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xe9bd('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xe9bd('0x2'),_0xe9bd('0x3'),_0xe9bd('0x4')),'allowNull':![],'defaultValue':_0xe9bd('0x4')},'transferredAt':{'type':Sequelize[_0xe9bd('0x5')],'allowNull':![],'defaultValue':Sequelize[_0xe9bd('0x6')]}};
\ No newline at end of file
index 7063695..83bb9f8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4186=['attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','merge','options','include','rows','catch','params','keys','rawAttributes','includeAll','find','create','body','destroy','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','update','then','error','stack','name','send','index','map','OpenchannelTransferReport','fieldName','type','model','query','intersection','fields'];(function(_0x3253be,_0x219f96){var _0x48324b=function(_0x428a5e){while(--_0x428a5e){_0x3253be['push'](_0x3253be['shift']());}};_0x48324b(++_0x219f96);}(_0x4186,0x1d2));var _0x6418=function(_0x313c96,_0x3cee6e){_0x313c96=_0x313c96-0x0;var _0x522f53=_0x4186[_0x313c96];return _0x522f53;};'use strict';var emlformat=require(_0x6418('0x0'));var rimraf=require(_0x6418('0x1'));var zipdir=require(_0x6418('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6418('0x3'));var moment=require(_0x6418('0x4'));var BPromise=require(_0x6418('0x5'));var Mustache=require(_0x6418('0x6'));var util=require(_0x6418('0x7'));var path=require(_0x6418('0x8'));var sox=require(_0x6418('0x9'));var csv=require('to-csv');var ejs=require(_0x6418('0xa'));var fs=require('fs');var fs_extra=require(_0x6418('0xb'));var _=require(_0x6418('0xc'));var squel=require(_0x6418('0xd'));var crypto=require(_0x6418('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x6418('0xf'));var querystring=require('querystring');var Papa=require(_0x6418('0x10'));var Redis=require(_0x6418('0x11'));var authService=require(_0x6418('0x12'));var qs=require(_0x6418('0x13'));var as=require(_0x6418('0x14'));var hardwareService=require(_0x6418('0x15'));var logger=require(_0x6418('0x16'))(_0x6418('0x17'));var utils=require('../../config/utils');var config=require(_0x6418('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x6418('0x19'))['db'];function respondWithStatusCode(_0x27ab70,_0x513917){_0x513917=_0x513917||0xcc;return function(_0x4a7f8b){if(_0x4a7f8b){return _0x27ab70[_0x6418('0x1a')](_0x513917);}return _0x27ab70[_0x6418('0x1b')](_0x513917)[_0x6418('0x1c')]();};}function respondWithResult(_0x3a4245,_0x261011){_0x261011=_0x261011||0xc8;return function(_0x14d349){if(_0x14d349){return _0x3a4245['status'](_0x261011)[_0x6418('0x1d')](_0x14d349);}};}function respondWithFilteredResult(_0x1466a0,_0x1af1a9){return function(_0x1a4ed5){if(_0x1a4ed5){var _0x223ecf=typeof _0x1af1a9['offset']===_0x6418('0x1e')&&typeof _0x1af1a9[_0x6418('0x1f')]===_0x6418('0x1e');var _0xe859b1=_0x1a4ed5[_0x6418('0x20')];var _0x4d6ef1=_0x223ecf?0x0:_0x1af1a9[_0x6418('0x21')];var _0x420d1b=_0x223ecf?_0x1a4ed5['count']:_0x1af1a9[_0x6418('0x21')]+_0x1af1a9['limit'];var _0x5e2dd5;if(_0x420d1b>=_0xe859b1){_0x420d1b=_0xe859b1;_0x5e2dd5=0xc8;}else{_0x5e2dd5=0xce;}_0x1466a0[_0x6418('0x1b')](_0x5e2dd5);return _0x1466a0['set'](_0x6418('0x22'),_0x4d6ef1+'-'+_0x420d1b+'/'+_0xe859b1)[_0x6418('0x1d')](_0x1a4ed5);}return null;};}function patchUpdates(_0x252cc4){return function(_0x2aad96){try{jsonpatch[_0x6418('0x23')](_0x2aad96,_0x252cc4,!![]);}catch(_0x9efbfa){return BPromise[_0x6418('0x24')](_0x9efbfa);}return _0x2aad96['save']();};}function saveUpdates(_0x503a57,_0x5469c6){return function(_0x3ac741){if(_0x3ac741){return _0x3ac741[_0x6418('0x25')](_0x503a57)[_0x6418('0x26')](function(_0x3ab712){return _0x3ab712;});}return null;};}function removeEntity(_0x13c586,_0xc71154){return function(_0x55314a){if(_0x55314a){return _0x55314a['destroy']()[_0x6418('0x26')](function(){_0x13c586[_0x6418('0x1b')](0xcc)[_0x6418('0x1c')]();});}};}function handleEntityNotFound(_0x3fbd49,_0x5613b8){return function(_0x338305){if(!_0x338305){_0x3fbd49[_0x6418('0x1a')](0x194);}return _0x338305;};}function handleError(_0x4fba2a,_0x586625){_0x586625=_0x586625||0x1f4;return function(_0x88abce){logger[_0x6418('0x27')](_0x88abce[_0x6418('0x28')]);if(_0x88abce[_0x6418('0x29')]){delete _0x88abce[_0x6418('0x29')];}_0x4fba2a['status'](_0x586625)[_0x6418('0x2a')](_0x88abce);};}exports[_0x6418('0x2b')]=function(_0x2f88e4,_0x4bb021){var _0x3e55a0={},_0x4bf09b={},_0x58a1a4={'count':0x0,'rows':[]};var _0x3a2e86=_[_0x6418('0x2c')](db[_0x6418('0x2d')]['rawAttributes'],function(_0x529b78){return{'name':_0x529b78[_0x6418('0x2e')],'type':_0x529b78[_0x6418('0x2f')]['key']};});_0x4bf09b[_0x6418('0x30')]=_[_0x6418('0x2c')](_0x3a2e86,_0x6418('0x29'));_0x4bf09b[_0x6418('0x31')]=_['keys'](_0x2f88e4[_0x6418('0x31')]);_0x4bf09b['filters']=_[_0x6418('0x32')](_0x4bf09b['model'],_0x4bf09b[_0x6418('0x31')]);_0x3e55a0['attributes']=_[_0x6418('0x32')](_0x4bf09b['model'],qs[_0x6418('0x33')](_0x2f88e4['query']['fields']));_0x3e55a0[_0x6418('0x34')]=_0x3e55a0[_0x6418('0x34')][_0x6418('0x35')]?_0x3e55a0[_0x6418('0x34')]:_0x4bf09b['model'];if(!_0x2f88e4[_0x6418('0x31')][_0x6418('0x36')](_0x6418('0x37'))){_0x3e55a0[_0x6418('0x1f')]=qs['limit'](_0x2f88e4[_0x6418('0x31')][_0x6418('0x1f')]);_0x3e55a0[_0x6418('0x21')]=qs['offset'](_0x2f88e4[_0x6418('0x31')]['offset']);}_0x3e55a0[_0x6418('0x38')]=qs[_0x6418('0x39')](_0x2f88e4[_0x6418('0x31')][_0x6418('0x39')]);_0x3e55a0[_0x6418('0x3a')]=qs['filters'](_[_0x6418('0x3b')](_0x2f88e4[_0x6418('0x31')],_0x4bf09b[_0x6418('0x3c')]),_0x3a2e86);if(_0x2f88e4[_0x6418('0x31')]['filter']){_0x3e55a0['where']=_[_0x6418('0x3d')](_0x3e55a0[_0x6418('0x3a')],{'$or':_[_0x6418('0x2c')](_0x3a2e86,function(_0x3af362){if(_0x3af362[_0x6418('0x2f')]!=='VIRTUAL'){var _0x1a7e4e={};_0x1a7e4e[_0x3af362[_0x6418('0x29')]]={'$like':'%'+_0x2f88e4[_0x6418('0x31')]['filter']+'%'};return _0x1a7e4e;}})});}_0x3e55a0=_['merge']({},_0x3e55a0,_0x2f88e4[_0x6418('0x3e')]);var _0x509a16={'where':_0x3e55a0[_0x6418('0x3a')]};return db[_0x6418('0x2d')][_0x6418('0x20')](_0x509a16)[_0x6418('0x26')](function(_0x3a7067){_0x58a1a4[_0x6418('0x20')]=_0x3a7067;if(_0x2f88e4[_0x6418('0x31')]['includeAll']){_0x3e55a0[_0x6418('0x3f')]=[{'all':!![]}];}return db[_0x6418('0x2d')]['findAll'](_0x3e55a0);})[_0x6418('0x26')](function(_0x1718c5){_0x58a1a4[_0x6418('0x40')]=_0x1718c5;return _0x58a1a4;})[_0x6418('0x26')](respondWithFilteredResult(_0x4bb021,_0x3e55a0))[_0x6418('0x41')](handleError(_0x4bb021,null));};exports['show']=function(_0x3791a0,_0x4a54fb){var _0x22e098={'raw':!![],'where':{'id':_0x3791a0[_0x6418('0x42')]['id']}},_0x458043={};_0x458043[_0x6418('0x30')]=_[_0x6418('0x43')](db['OpenchannelTransferReport'][_0x6418('0x44')]);_0x458043[_0x6418('0x31')]=_[_0x6418('0x43')](_0x3791a0['query']);_0x458043[_0x6418('0x3c')]=_[_0x6418('0x32')](_0x458043['model'],_0x458043[_0x6418('0x31')]);_0x22e098[_0x6418('0x34')]=_[_0x6418('0x32')](_0x458043[_0x6418('0x30')],qs[_0x6418('0x33')](_0x3791a0[_0x6418('0x31')]['fields']));_0x22e098[_0x6418('0x34')]=_0x22e098[_0x6418('0x34')]['length']?_0x22e098[_0x6418('0x34')]:_0x458043[_0x6418('0x30')];if(_0x3791a0[_0x6418('0x31')][_0x6418('0x45')]){_0x22e098[_0x6418('0x3f')]=[{'all':!![]}];}_0x22e098=_['merge']({},_0x22e098,_0x3791a0[_0x6418('0x3e')]);return db[_0x6418('0x2d')][_0x6418('0x46')](_0x22e098)[_0x6418('0x26')](handleEntityNotFound(_0x4a54fb,null))[_0x6418('0x26')](respondWithResult(_0x4a54fb,null))[_0x6418('0x41')](handleError(_0x4a54fb,null));};exports[_0x6418('0x47')]=function(_0x1f981c,_0x3af577){return db[_0x6418('0x2d')][_0x6418('0x47')](_0x1f981c[_0x6418('0x48')],{})[_0x6418('0x26')](respondWithResult(_0x3af577,0xc9))['catch'](handleError(_0x3af577,null));};exports[_0x6418('0x25')]=function(_0x52dd96,_0x3e3f08){if(_0x52dd96['body']['id']){delete _0x52dd96['body']['id'];}return db['OpenchannelTransferReport'][_0x6418('0x46')]({'where':{'id':_0x52dd96[_0x6418('0x42')]['id']}})['then'](handleEntityNotFound(_0x3e3f08,null))[_0x6418('0x26')](saveUpdates(_0x52dd96[_0x6418('0x48')],null))[_0x6418('0x26')](respondWithResult(_0x3e3f08,null))[_0x6418('0x41')](handleError(_0x3e3f08,null));};exports[_0x6418('0x49')]=function(_0xe4376c,_0x2f708f){return db[_0x6418('0x2d')]['find']({'where':{'id':_0xe4376c['params']['id']}})['then'](handleEntityNotFound(_0x2f708f,null))[_0x6418('0x26')](removeEntity(_0x2f708f,null))['catch'](handleError(_0x2f708f,null));};exports['describe']=function(_0x4c11df,_0x94e698){return db['OpenchannelTransferReport']['describe']()[_0x6418('0x26')](respondWithResult(_0x94e698,null))[_0x6418('0x41')](handleError(_0x94e698,null));};
\ No newline at end of file
+var _0x6b24=['describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','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/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','update','then','destroy','stack','name','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','OpenchannelTransferReport','includeAll','include','findAll','params','length','find','catch','create','body'];(function(_0x4657b4,_0x170028){var _0x547baf=function(_0x34b771){while(--_0x34b771){_0x4657b4['push'](_0x4657b4['shift']());}};_0x547baf(++_0x170028);}(_0x6b24,0x95));var _0x46b2=function(_0x2c2390,_0x37ef1c){_0x2c2390=_0x2c2390-0x0;var _0x478b7e=_0x6b24[_0x2c2390];return _0x478b7e;};'use strict';var emlformat=require(_0x46b2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x46b2('0x1'));var jsonpatch=require(_0x46b2('0x2'));var rp=require(_0x46b2('0x3'));var moment=require(_0x46b2('0x4'));var BPromise=require(_0x46b2('0x5'));var Mustache=require(_0x46b2('0x6'));var util=require(_0x46b2('0x7'));var path=require(_0x46b2('0x8'));var sox=require('sox');var csv=require(_0x46b2('0x9'));var ejs=require(_0x46b2('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x46b2('0xb'));var squel=require(_0x46b2('0xc'));var crypto=require(_0x46b2('0xd'));var jsforce=require(_0x46b2('0xe'));var deskjs=require(_0x46b2('0xf'));var toCsv=require(_0x46b2('0x9'));var querystring=require('querystring');var Papa=require(_0x46b2('0x10'));var Redis=require(_0x46b2('0x11'));var authService=require(_0x46b2('0x12'));var qs=require(_0x46b2('0x13'));var as=require(_0x46b2('0x14'));var hardwareService=require(_0x46b2('0x15'));var logger=require(_0x46b2('0x16'))(_0x46b2('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x46b2('0x18'));var db=require(_0x46b2('0x19'))['db'];function respondWithStatusCode(_0x212ee5,_0x503226){_0x503226=_0x503226||0xcc;return function(_0x177173){if(_0x177173){return _0x212ee5[_0x46b2('0x1a')](_0x503226);}return _0x212ee5[_0x46b2('0x1b')](_0x503226)[_0x46b2('0x1c')]();};}function respondWithResult(_0x1c4c71,_0x287708){_0x287708=_0x287708||0xc8;return function(_0x38ef29){if(_0x38ef29){return _0x1c4c71[_0x46b2('0x1b')](_0x287708)[_0x46b2('0x1d')](_0x38ef29);}};}function respondWithFilteredResult(_0x227284,_0xd98172){return function(_0x5a055b){if(_0x5a055b){var _0x2c4b07=typeof _0xd98172[_0x46b2('0x1e')]===_0x46b2('0x1f')&&typeof _0xd98172[_0x46b2('0x20')]===_0x46b2('0x1f');var _0x4bbf05=_0x5a055b[_0x46b2('0x21')];var _0xa14dcb=_0x2c4b07?0x0:_0xd98172[_0x46b2('0x1e')];var _0x259c02=_0x2c4b07?_0x5a055b[_0x46b2('0x21')]:_0xd98172[_0x46b2('0x1e')]+_0xd98172[_0x46b2('0x20')];var _0x4b1219;if(_0x259c02>=_0x4bbf05){_0x259c02=_0x4bbf05;_0x4b1219=0xc8;}else{_0x4b1219=0xce;}_0x227284[_0x46b2('0x1b')](_0x4b1219);return _0x227284[_0x46b2('0x22')]('Content-Range',_0xa14dcb+'-'+_0x259c02+'/'+_0x4bbf05)[_0x46b2('0x1d')](_0x5a055b);}return null;};}function patchUpdates(_0xfd9019){return function(_0x56e436){try{jsonpatch[_0x46b2('0x23')](_0x56e436,_0xfd9019,!![]);}catch(_0x2e7f2c){return BPromise[_0x46b2('0x24')](_0x2e7f2c);}return _0x56e436['save']();};}function saveUpdates(_0x445740,_0x48e26c){return function(_0x35bd96){if(_0x35bd96){return _0x35bd96[_0x46b2('0x25')](_0x445740)[_0x46b2('0x26')](function(_0xf0a6e1){return _0xf0a6e1;});}return null;};}function removeEntity(_0x16392d,_0x135f7b){return function(_0x3aa369){if(_0x3aa369){return _0x3aa369[_0x46b2('0x27')]()[_0x46b2('0x26')](function(){_0x16392d['status'](0xcc)[_0x46b2('0x1c')]();});}};}function handleEntityNotFound(_0xb05201,_0x5709f8){return function(_0x177c52){if(!_0x177c52){_0xb05201['sendStatus'](0x194);}return _0x177c52;};}function handleError(_0x2c7c63,_0x2b7788){_0x2b7788=_0x2b7788||0x1f4;return function(_0x25e036){logger['error'](_0x25e036[_0x46b2('0x28')]);if(_0x25e036['name']){delete _0x25e036[_0x46b2('0x29')];}_0x2c7c63[_0x46b2('0x1b')](_0x2b7788)['send'](_0x25e036);};}exports['index']=function(_0x2290b0,_0x118570){var _0x3efa9c={},_0x5c9703={},_0x3db815={'count':0x0,'rows':[]};var _0x363a35=_[_0x46b2('0x2a')](db['OpenchannelTransferReport'][_0x46b2('0x2b')],function(_0x9aaa58){return{'name':_0x9aaa58[_0x46b2('0x2c')],'type':_0x9aaa58[_0x46b2('0x2d')][_0x46b2('0x2e')]};});_0x5c9703['model']=_[_0x46b2('0x2a')](_0x363a35,'name');_0x5c9703[_0x46b2('0x2f')]=_[_0x46b2('0x30')](_0x2290b0[_0x46b2('0x2f')]);_0x5c9703[_0x46b2('0x31')]=_[_0x46b2('0x32')](_0x5c9703[_0x46b2('0x33')],_0x5c9703['query']);_0x3efa9c[_0x46b2('0x34')]=_['intersection'](_0x5c9703[_0x46b2('0x33')],qs[_0x46b2('0x35')](_0x2290b0['query']['fields']));_0x3efa9c['attributes']=_0x3efa9c[_0x46b2('0x34')]['length']?_0x3efa9c['attributes']:_0x5c9703[_0x46b2('0x33')];if(!_0x2290b0[_0x46b2('0x2f')][_0x46b2('0x36')](_0x46b2('0x37'))){_0x3efa9c[_0x46b2('0x20')]=qs['limit'](_0x2290b0['query'][_0x46b2('0x20')]);_0x3efa9c[_0x46b2('0x1e')]=qs[_0x46b2('0x1e')](_0x2290b0[_0x46b2('0x2f')]['offset']);}_0x3efa9c[_0x46b2('0x38')]=qs[_0x46b2('0x39')](_0x2290b0['query']['sort']);_0x3efa9c[_0x46b2('0x3a')]=qs[_0x46b2('0x31')](_[_0x46b2('0x3b')](_0x2290b0[_0x46b2('0x2f')],_0x5c9703['filters']),_0x363a35);if(_0x2290b0[_0x46b2('0x2f')]['filter']){_0x3efa9c[_0x46b2('0x3a')]=_[_0x46b2('0x3c')](_0x3efa9c[_0x46b2('0x3a')],{'$or':_[_0x46b2('0x2a')](_0x363a35,function(_0x4f3ae4){if(_0x4f3ae4[_0x46b2('0x2d')]!=='VIRTUAL'){var _0x13405d={};_0x13405d[_0x4f3ae4[_0x46b2('0x29')]]={'$like':'%'+_0x2290b0[_0x46b2('0x2f')][_0x46b2('0x3d')]+'%'};return _0x13405d;}})});}_0x3efa9c=_[_0x46b2('0x3c')]({},_0x3efa9c,_0x2290b0[_0x46b2('0x3e')]);var _0x46277f={'where':_0x3efa9c[_0x46b2('0x3a')]};return db[_0x46b2('0x3f')][_0x46b2('0x21')](_0x46277f)[_0x46b2('0x26')](function(_0x3ddbc3){_0x3db815[_0x46b2('0x21')]=_0x3ddbc3;if(_0x2290b0[_0x46b2('0x2f')][_0x46b2('0x40')]){_0x3efa9c[_0x46b2('0x41')]=[{'all':!![]}];}return db[_0x46b2('0x3f')][_0x46b2('0x42')](_0x3efa9c);})[_0x46b2('0x26')](function(_0x26feb6){_0x3db815['rows']=_0x26feb6;return _0x3db815;})[_0x46b2('0x26')](respondWithFilteredResult(_0x118570,_0x3efa9c))['catch'](handleError(_0x118570,null));};exports['show']=function(_0x132e8b,_0x3fc22a){var _0x2f4899={'raw':!![],'where':{'id':_0x132e8b[_0x46b2('0x43')]['id']}},_0x138a1e={};_0x138a1e[_0x46b2('0x33')]=_['keys'](db[_0x46b2('0x3f')][_0x46b2('0x2b')]);_0x138a1e[_0x46b2('0x2f')]=_['keys'](_0x132e8b[_0x46b2('0x2f')]);_0x138a1e[_0x46b2('0x31')]=_['intersection'](_0x138a1e['model'],_0x138a1e[_0x46b2('0x2f')]);_0x2f4899[_0x46b2('0x34')]=_[_0x46b2('0x32')](_0x138a1e[_0x46b2('0x33')],qs[_0x46b2('0x35')](_0x132e8b[_0x46b2('0x2f')][_0x46b2('0x35')]));_0x2f4899['attributes']=_0x2f4899[_0x46b2('0x34')][_0x46b2('0x44')]?_0x2f4899[_0x46b2('0x34')]:_0x138a1e['model'];if(_0x132e8b[_0x46b2('0x2f')]['includeAll']){_0x2f4899[_0x46b2('0x41')]=[{'all':!![]}];}_0x2f4899=_[_0x46b2('0x3c')]({},_0x2f4899,_0x132e8b[_0x46b2('0x3e')]);return db[_0x46b2('0x3f')][_0x46b2('0x45')](_0x2f4899)['then'](handleEntityNotFound(_0x3fc22a,null))[_0x46b2('0x26')](respondWithResult(_0x3fc22a,null))[_0x46b2('0x46')](handleError(_0x3fc22a,null));};exports[_0x46b2('0x47')]=function(_0x33bce9,_0x366932){return db[_0x46b2('0x3f')][_0x46b2('0x47')](_0x33bce9[_0x46b2('0x48')],{})[_0x46b2('0x26')](respondWithResult(_0x366932,0xc9))[_0x46b2('0x46')](handleError(_0x366932,null));};exports[_0x46b2('0x25')]=function(_0xc64c41,_0xa13213){if(_0xc64c41[_0x46b2('0x48')]['id']){delete _0xc64c41[_0x46b2('0x48')]['id'];}return db[_0x46b2('0x3f')][_0x46b2('0x45')]({'where':{'id':_0xc64c41[_0x46b2('0x43')]['id']}})[_0x46b2('0x26')](handleEntityNotFound(_0xa13213,null))[_0x46b2('0x26')](saveUpdates(_0xc64c41[_0x46b2('0x48')],null))[_0x46b2('0x26')](respondWithResult(_0xa13213,null))[_0x46b2('0x46')](handleError(_0xa13213,null));};exports[_0x46b2('0x27')]=function(_0x368ae7,_0x14edfb){return db['OpenchannelTransferReport'][_0x46b2('0x45')]({'where':{'id':_0x368ae7[_0x46b2('0x43')]['id']}})[_0x46b2('0x26')](handleEntityNotFound(_0x14edfb,null))[_0x46b2('0x26')](removeEntity(_0x14edfb,null))[_0x46b2('0x46')](handleError(_0x14edfb,null));};exports[_0x46b2('0x49')]=function(_0x2d353f,_0x1dad45){return db[_0x46b2('0x3f')][_0x46b2('0x49')]()['then'](respondWithResult(_0x1dad45,null))[_0x46b2('0x46')](handleError(_0x1dad45,null));};
\ No newline at end of file
index 39e0648..bb63051 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa1bd=['define','report_openchannel_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelTransferReport.attributes','exports'];(function(_0xfd7c2c,_0x121db4){var _0x115364=function(_0x3b4592){while(--_0x3b4592){_0xfd7c2c['push'](_0xfd7c2c['shift']());}};_0x115364(++_0x121db4);}(_0xa1bd,0xf3));var _0xda1b=function(_0x4f21c4,_0x960024){_0x4f21c4=_0x4f21c4-0x0;var _0x2f9fa6=_0xa1bd[_0x4f21c4];return _0x2f9fa6;};'use strict';var _=require(_0xda1b('0x0'));var util=require(_0xda1b('0x1'));var logger=require(_0xda1b('0x2'))(_0xda1b('0x3'));var moment=require(_0xda1b('0x4'));var BPromise=require(_0xda1b('0x5'));var rp=require(_0xda1b('0x6'));var fs=require('fs');var path=require(_0xda1b('0x7'));var rimraf=require(_0xda1b('0x8'));var config=require(_0xda1b('0x9'));var attributes=require(_0xda1b('0xa'));module[_0xda1b('0xb')]=function(_0x5dd853,_0x3fc7ce){return _0x5dd853[_0xda1b('0xc')]('OpenchannelTransferReport',attributes,{'tableName':_0xda1b('0xd'),'paranoid':![],'indexes':[{'name':_0xda1b('0xe'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0xe9b0=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelTransferReport.attributes','exports','define','report_openchannel_transfer','uniqueid','lodash','util'];(function(_0x2306f7,_0xef6e9d){var _0x2a22f6=function(_0x46a124){while(--_0x46a124){_0x2306f7['push'](_0x2306f7['shift']());}};_0x2a22f6(++_0xef6e9d);}(_0xe9b0,0xee));var _0x0e9b=function(_0x4a83f4,_0x50f589){_0x4a83f4=_0x4a83f4-0x0;var _0x1fc810=_0xe9b0[_0x4a83f4];return _0x1fc810;};'use strict';var _=require(_0x0e9b('0x0'));var util=require(_0x0e9b('0x1'));var logger=require(_0x0e9b('0x2'))(_0x0e9b('0x3'));var moment=require(_0x0e9b('0x4'));var BPromise=require(_0x0e9b('0x5'));var rp=require(_0x0e9b('0x6'));var fs=require('fs');var path=require(_0x0e9b('0x7'));var rimraf=require(_0x0e9b('0x8'));var config=require(_0x0e9b('0x9'));var attributes=require(_0x0e9b('0xa'));module[_0x0e9b('0xb')]=function(_0xddbf13,_0xa43546){return _0xddbf13[_0x0e9b('0xc')]('OpenchannelTransferReport',attributes,{'tableName':_0x0e9b('0xd'),'paranoid':![],'indexes':[{'name':_0x0e9b('0xe'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
index 67f349d..963facb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xae30=['result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','stringify','error','message','info'];(function(_0x4dca20,_0x54277b){var _0x43124a=function(_0x354808){while(--_0x354808){_0x4dca20['push'](_0x4dca20['shift']());}};_0x43124a(++_0x54277b);}(_0xae30,0x10a));var _0x0ae3=function(_0x255be9,_0x3345d9){_0x255be9=_0x255be9-0x0;var _0x34fedf=_0xae30[_0x255be9];return _0x34fedf;};'use strict';var _=require(_0x0ae3('0x0'));var util=require(_0x0ae3('0x1'));var moment=require(_0x0ae3('0x2'));var BPromise=require('bluebird');var rs=require(_0x0ae3('0x3'));var fs=require('fs');var Redis=require(_0x0ae3('0x4'));var db=require(_0x0ae3('0x5'))['db'];var utils=require(_0x0ae3('0x6'));var logger=require('../../config/logger')(_0x0ae3('0x7'));var config=require(_0x0ae3('0x8'));var jayson=require(_0x0ae3('0x9'));var client=jayson[_0x0ae3('0xa')][_0x0ae3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xda3853,_0x2b81f4,_0x15b7e2){return new BPromise(function(_0x32ea6e,_0x34e783){return client[_0x0ae3('0xc')](_0xda3853,_0x15b7e2)[_0x0ae3('0xd')](function(_0x32ca2c){logger['info'](_0x0ae3('0xe'),_0x2b81f4,_0x0ae3('0xf'));logger['debug']('OpenchannelTransferReport,\x20%s,\x20%s,\x20%s',_0x2b81f4,_0x0ae3('0xf'),JSON[_0x0ae3('0x10')](_0x32ca2c));if(_0x32ca2c[_0x0ae3('0x11')]){if(_0x32ca2c[_0x0ae3('0x11')]['code']===0x1f4){logger['error'](_0x0ae3('0xe'),_0x2b81f4,_0x32ca2c[_0x0ae3('0x11')]['message']);return _0x34e783(_0x32ca2c['error'][_0x0ae3('0x12')]);}logger['error'](_0x0ae3('0xe'),_0x2b81f4,_0x32ca2c[_0x0ae3('0x11')][_0x0ae3('0x12')]);return _0x32ea6e(_0x32ca2c[_0x0ae3('0x11')][_0x0ae3('0x12')]);}else{logger[_0x0ae3('0x13')](_0x0ae3('0xe'),_0x2b81f4,'request\x20sent');_0x32ea6e(_0x32ca2c[_0x0ae3('0x14')]['message']);}})[_0x0ae3('0x15')](function(_0x254a0f){logger[_0x0ae3('0x11')](_0x0ae3('0xe'),_0x2b81f4,_0x254a0f);_0x34e783(_0x254a0f);});});}
\ No newline at end of file
+var _0x90b5=['http','request','then','info','OpenchannelTransferReport,\x20%s,\x20%s','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client'];(function(_0x256e32,_0x4013bc){var _0x464070=function(_0x449398){while(--_0x449398){_0x256e32['push'](_0x256e32['shift']());}};_0x464070(++_0x4013bc);}(_0x90b5,0x139));var _0x590b=function(_0x56471c,_0x17ea5e){_0x56471c=_0x56471c-0x0;var _0x265a1d=_0x90b5[_0x56471c];return _0x265a1d;};'use strict';var _=require(_0x590b('0x0'));var util=require('util');var moment=require(_0x590b('0x1'));var BPromise=require(_0x590b('0x2'));var rs=require(_0x590b('0x3'));var fs=require('fs');var Redis=require(_0x590b('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x590b('0x5'))(_0x590b('0x6'));var config=require('../../config/environment');var jayson=require(_0x590b('0x7'));var client=jayson[_0x590b('0x8')][_0x590b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5e54fe,_0x30bc6e,_0x3663a0){return new BPromise(function(_0x3ec156,_0x9c408b){return client[_0x590b('0xa')](_0x5e54fe,_0x3663a0)[_0x590b('0xb')](function(_0x2103c0){logger[_0x590b('0xc')](_0x590b('0xd'),_0x30bc6e,'request\x20sent');logger[_0x590b('0xe')](_0x590b('0xf'),_0x30bc6e,'request\x20sent',JSON[_0x590b('0x10')](_0x2103c0));if(_0x2103c0['error']){if(_0x2103c0[_0x590b('0x11')][_0x590b('0x12')]===0x1f4){logger[_0x590b('0x11')](_0x590b('0xd'),_0x30bc6e,_0x2103c0['error'][_0x590b('0x13')]);return _0x9c408b(_0x2103c0[_0x590b('0x11')][_0x590b('0x13')]);}logger[_0x590b('0x11')](_0x590b('0xd'),_0x30bc6e,_0x2103c0[_0x590b('0x11')][_0x590b('0x13')]);return _0x3ec156(_0x2103c0[_0x590b('0x11')][_0x590b('0x13')]);}else{logger[_0x590b('0xc')](_0x590b('0xd'),_0x30bc6e,_0x590b('0x14'));_0x3ec156(_0x2103c0[_0x590b('0x15')][_0x590b('0x13')]);}})[_0x590b('0x16')](function(_0x4f2512){logger[_0x590b('0x11')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x30bc6e,_0x4f2512);_0x9c408b(_0x4f2512);});});}
\ No newline at end of file
index e81d60c..1b51322 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc1b4=['index','get','post','create','/:id','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./pause.controller','isAuthenticated'];(function(_0xb725be,_0x45bd01){var _0x2f2424=function(_0x2566ca){while(--_0x2566ca){_0xb725be['push'](_0xb725be['shift']());}};_0x2f2424(++_0x45bd01);}(_0xc1b4,0x1bd));var _0x4c1b=function(_0x32ebd1,_0x20f0a8){_0x32ebd1=_0x32ebd1-0x0;var _0x56580e=_0xc1b4[_0x32ebd1];return _0x56580e;};'use strict';var multer=require(_0x4c1b('0x0'));var util=require(_0x4c1b('0x1'));var path=require(_0x4c1b('0x2'));var timeout=require(_0x4c1b('0x3'));var express=require(_0x4c1b('0x4'));var router=express[_0x4c1b('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x4c1b('0x6'));var interaction=require(_0x4c1b('0x7'));var config=require(_0x4c1b('0x8'));var controller=require(_0x4c1b('0x9'));router['get']('/',auth[_0x4c1b('0xa')](),controller[_0x4c1b('0xb')]);router[_0x4c1b('0xc')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x4c1b('0xd')]('/',auth[_0x4c1b('0xa')](),controller[_0x4c1b('0xe')]);router['put'](_0x4c1b('0xf'),auth[_0x4c1b('0xa')](),controller[_0x4c1b('0x10')]);router[_0x4c1b('0x11')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x4c1b('0x12')]=router;
\ No newline at end of file
+var _0x4e94=['exports','multer','util','connect-timeout','express','../../components/auth/service','../../config/environment','index','get','/:id','show','post','create','put','isAuthenticated','update','destroy'];(function(_0x55d380,_0x58437e){var _0x1dbeb3=function(_0x3edc66){while(--_0x3edc66){_0x55d380['push'](_0x55d380['shift']());}};_0x1dbeb3(++_0x58437e);}(_0x4e94,0x155));var _0x44e9=function(_0x5e8c7c,_0x3429c6){_0x5e8c7c=_0x5e8c7c-0x0;var _0x48f7bd=_0x4e94[_0x5e8c7c];return _0x48f7bd;};'use strict';var multer=require(_0x44e9('0x0'));var util=require(_0x44e9('0x1'));var path=require('path');var timeout=require(_0x44e9('0x2'));var express=require(_0x44e9('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x44e9('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x44e9('0x5'));var controller=require('./pause.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x44e9('0x6')]);router[_0x44e9('0x7')](_0x44e9('0x8'),auth['isAuthenticated'](),controller[_0x44e9('0x9')]);router[_0x44e9('0xa')]('/',auth['isAuthenticated'](),controller[_0x44e9('0xb')]);router[_0x44e9('0xc')](_0x44e9('0x8'),auth[_0x44e9('0xd')](),controller[_0x44e9('0xe')]);router['delete'](_0x44e9('0x8'),auth[_0x44e9('0xd')](),controller[_0x44e9('0xf')]);module[_0x44e9('0x10')]=router;
\ No newline at end of file
index 064d231..f73ae70 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xebd2=['exports','name','STRING'];(function(_0x18ff48,_0x1263b0){var _0x129bf8=function(_0x7d1ab3){while(--_0x7d1ab3){_0x18ff48['push'](_0x18ff48['shift']());}};_0x129bf8(++_0x1263b0);}(_0xebd2,0x1f2));var _0x2ebd=function(_0x1a6e55,_0x1a5d04){_0x1a6e55=_0x1a6e55-0x0;var _0x37bb38=_0xebd2[_0x1a6e55];return _0x37bb38;};'use strict';var Sequelize=require('sequelize');module[_0x2ebd('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x2ebd('0x1'),'allowNull':![]},'description':{'type':Sequelize[_0x2ebd('0x2')]}};
\ No newline at end of file
+var _0xd33f=['name','sequelize','STRING'];(function(_0x3a0d83,_0x2d3bb5){var _0x7330ba=function(_0x41508a){while(--_0x41508a){_0x3a0d83['push'](_0x3a0d83['shift']());}};_0x7330ba(++_0x2d3bb5);}(_0xd33f,0x151));var _0xfd33=function(_0x5959c9,_0x2ed153){_0x5959c9=_0x5959c9-0x0;var _0x4ffcbc=_0xd33f[_0x5959c9];return _0x4ffcbc;};'use strict';var Sequelize=require(_0xfd33('0x0'));module['exports']={'name':{'type':Sequelize[_0xfd33('0x1')],'unique':_0xfd33('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0xfd33('0x1')]}};
\ No newline at end of file
index 352342a..f52a678 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbb7c=['Content-Range','apply','reject','save','then','destroy','get','Pauses','UserProfileResource','sendStatus','stack','name','send','index','map','Pause','rawAttributes','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xbb7c,0xe0));var _0xcbb7=function(_0x1d4403,_0x2522e9){_0x1d4403=_0x1d4403-0x0;var _0x46dc7c=_0xbb7c[_0x1d4403];return _0x46dc7c;};'use strict';var emlformat=require(_0xcbb7('0x0'));var rimraf=require(_0xcbb7('0x1'));var zipdir=require(_0xcbb7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcbb7('0x3'));var moment=require(_0xcbb7('0x4'));var BPromise=require(_0xcbb7('0x5'));var Mustache=require(_0xcbb7('0x6'));var util=require(_0xcbb7('0x7'));var path=require('path');var sox=require(_0xcbb7('0x8'));var csv=require(_0xcbb7('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcbb7('0xa'));var _=require(_0xcbb7('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xcbb7('0xc'));var deskjs=require(_0xcbb7('0xd'));var toCsv=require(_0xcbb7('0x9'));var querystring=require(_0xcbb7('0xe'));var Papa=require(_0xcbb7('0xf'));var Redis=require(_0xcbb7('0x10'));var authService=require(_0xcbb7('0x11'));var qs=require(_0xcbb7('0x12'));var as=require(_0xcbb7('0x13'));var hardwareService=require(_0xcbb7('0x14'));var logger=require(_0xcbb7('0x15'))('api');var utils=require(_0xcbb7('0x16'));var config=require(_0xcbb7('0x17'));var licenseUtil=require(_0xcbb7('0x18'));var db=require(_0xcbb7('0x19'))['db'];function respondWithStatusCode(_0x31d5ba,_0x29e4c6){_0x29e4c6=_0x29e4c6||0xcc;return function(_0xcbff2){if(_0xcbff2){return _0x31d5ba['sendStatus'](_0x29e4c6);}return _0x31d5ba[_0xcbb7('0x1a')](_0x29e4c6)[_0xcbb7('0x1b')]();};}function respondWithResult(_0x25f2ec,_0x5a6b7c){_0x5a6b7c=_0x5a6b7c||0xc8;return function(_0xc5805f){if(_0xc5805f){return _0x25f2ec[_0xcbb7('0x1a')](_0x5a6b7c)[_0xcbb7('0x1c')](_0xc5805f);}};}function respondWithFilteredResult(_0xb1c1fa,_0x516592){return function(_0x2e7538){if(_0x2e7538){var _0x13fdfd=typeof _0x516592[_0xcbb7('0x1d')]===_0xcbb7('0x1e')&&typeof _0x516592[_0xcbb7('0x1f')]==='undefined';var _0x5d504f=_0x2e7538[_0xcbb7('0x20')];var _0x5bdbe9=_0x13fdfd?0x0:_0x516592[_0xcbb7('0x1d')];var _0x5bc1e8=_0x13fdfd?_0x2e7538[_0xcbb7('0x20')]:_0x516592[_0xcbb7('0x1d')]+_0x516592[_0xcbb7('0x1f')];var _0x451cc1;if(_0x5bc1e8>=_0x5d504f){_0x5bc1e8=_0x5d504f;_0x451cc1=0xc8;}else{_0x451cc1=0xce;}_0xb1c1fa[_0xcbb7('0x1a')](_0x451cc1);return _0xb1c1fa[_0xcbb7('0x21')](_0xcbb7('0x22'),_0x5bdbe9+'-'+_0x5bc1e8+'/'+_0x5d504f)['json'](_0x2e7538);}return null;};}function patchUpdates(_0x74a4db){return function(_0x49f59f){try{jsonpatch[_0xcbb7('0x23')](_0x49f59f,_0x74a4db,!![]);}catch(_0x1deba2){return BPromise[_0xcbb7('0x24')](_0x1deba2);}return _0x49f59f[_0xcbb7('0x25')]();};}function saveUpdates(_0x59e058,_0x37a124){return function(_0x24f99d){if(_0x24f99d){return _0x24f99d['update'](_0x59e058)[_0xcbb7('0x26')](function(_0x5dc761){return _0x5dc761;});}return null;};}function removeEntity(_0x2c10e8,_0xf396b6){return function(_0x273d42){if(_0x273d42){return _0x273d42[_0xcbb7('0x27')]()['then'](function(){var _0x27ae91=_0x273d42[_0xcbb7('0x28')]({'plain':!![]});var _0xbe339=_0xcbb7('0x29');return db[_0xcbb7('0x2a')][_0xcbb7('0x27')]({'where':{'type':_0xbe339,'resourceId':_0x27ae91['id']}})[_0xcbb7('0x26')](function(){return _0x273d42;});})[_0xcbb7('0x26')](function(){_0x2c10e8[_0xcbb7('0x1a')](0xcc)[_0xcbb7('0x1b')]();});}};}function handleEntityNotFound(_0x47c9a6,_0x3f372d){return function(_0x175fa7){if(!_0x175fa7){_0x47c9a6[_0xcbb7('0x2b')](0x194);}return _0x175fa7;};}function handleError(_0x3e067d,_0x1d30e2){_0x1d30e2=_0x1d30e2||0x1f4;return function(_0x210af9){logger['error'](_0x210af9[_0xcbb7('0x2c')]);if(_0x210af9[_0xcbb7('0x2d')]){delete _0x210af9[_0xcbb7('0x2d')];}_0x3e067d[_0xcbb7('0x1a')](_0x1d30e2)[_0xcbb7('0x2e')](_0x210af9);};}exports[_0xcbb7('0x2f')]=function(_0x20e1d8,_0x2dddda){var _0x467042={},_0x5e1458={},_0x1f90ac={'count':0x0,'rows':[]};var _0x5e94b7=_[_0xcbb7('0x30')](db[_0xcbb7('0x31')][_0xcbb7('0x32')],function(_0x2e32b7){return{'name':_0x2e32b7['fieldName'],'type':_0x2e32b7['type']['key']};});_0x5e1458[_0xcbb7('0x33')]=_[_0xcbb7('0x30')](_0x5e94b7,_0xcbb7('0x2d'));_0x5e1458[_0xcbb7('0x34')]=_[_0xcbb7('0x35')](_0x20e1d8['query']);_0x5e1458[_0xcbb7('0x36')]=_[_0xcbb7('0x37')](_0x5e1458[_0xcbb7('0x33')],_0x5e1458[_0xcbb7('0x34')]);_0x467042[_0xcbb7('0x38')]=_[_0xcbb7('0x37')](_0x5e1458['model'],qs[_0xcbb7('0x39')](_0x20e1d8['query'][_0xcbb7('0x39')]));_0x467042[_0xcbb7('0x38')]=_0x467042['attributes']['length']?_0x467042['attributes']:_0x5e1458['model'];if(!_0x20e1d8[_0xcbb7('0x34')][_0xcbb7('0x3a')](_0xcbb7('0x3b'))){_0x467042[_0xcbb7('0x1f')]=qs[_0xcbb7('0x1f')](_0x20e1d8[_0xcbb7('0x34')]['limit']);_0x467042[_0xcbb7('0x1d')]=qs[_0xcbb7('0x1d')](_0x20e1d8[_0xcbb7('0x34')]['offset']);}_0x467042[_0xcbb7('0x3c')]=qs[_0xcbb7('0x3d')](_0x20e1d8[_0xcbb7('0x34')][_0xcbb7('0x3d')]);_0x467042[_0xcbb7('0x3e')]=qs[_0xcbb7('0x36')](_[_0xcbb7('0x3f')](_0x20e1d8[_0xcbb7('0x34')],_0x5e1458['filters']),_0x5e94b7);if(_0x20e1d8[_0xcbb7('0x34')]['filter']){_0x467042['where']=_[_0xcbb7('0x40')](_0x467042[_0xcbb7('0x3e')],{'$or':_['map'](_0x5e94b7,function(_0x34f200){if(_0x34f200[_0xcbb7('0x41')]!==_0xcbb7('0x42')){var _0x3efdfd={};_0x3efdfd[_0x34f200['name']]={'$like':'%'+_0x20e1d8[_0xcbb7('0x34')]['filter']+'%'};return _0x3efdfd;}})});}_0x467042=_[_0xcbb7('0x40')]({},_0x467042,_0x20e1d8[_0xcbb7('0x43')]);var _0x5d63b2={'where':_0x467042[_0xcbb7('0x3e')]};return db['Pause'][_0xcbb7('0x20')](_0x5d63b2)[_0xcbb7('0x26')](function(_0x542755){_0x1f90ac['count']=_0x542755;if(_0x20e1d8[_0xcbb7('0x34')][_0xcbb7('0x44')]){_0x467042[_0xcbb7('0x45')]=[{'all':!![]}];}return db[_0xcbb7('0x31')][_0xcbb7('0x46')](_0x467042);})[_0xcbb7('0x26')](function(_0x5b0cba){_0x1f90ac[_0xcbb7('0x47')]=_0x5b0cba;return _0x1f90ac;})[_0xcbb7('0x26')](respondWithFilteredResult(_0x2dddda,_0x467042))['catch'](handleError(_0x2dddda,null));};exports[_0xcbb7('0x48')]=function(_0x244d32,_0x130305){var _0x237101={'raw':!![],'where':{'id':_0x244d32[_0xcbb7('0x49')]['id']}},_0x29fa3c={};_0x29fa3c[_0xcbb7('0x33')]=_[_0xcbb7('0x35')](db[_0xcbb7('0x31')]['rawAttributes']);_0x29fa3c['query']=_[_0xcbb7('0x35')](_0x244d32['query']);_0x29fa3c[_0xcbb7('0x36')]=_[_0xcbb7('0x37')](_0x29fa3c[_0xcbb7('0x33')],_0x29fa3c[_0xcbb7('0x34')]);_0x237101[_0xcbb7('0x38')]=_['intersection'](_0x29fa3c[_0xcbb7('0x33')],qs['fields'](_0x244d32[_0xcbb7('0x34')][_0xcbb7('0x39')]));_0x237101['attributes']=_0x237101['attributes']['length']?_0x237101[_0xcbb7('0x38')]:_0x29fa3c[_0xcbb7('0x33')];if(_0x244d32[_0xcbb7('0x34')][_0xcbb7('0x44')]){_0x237101[_0xcbb7('0x45')]=[{'all':!![]}];}_0x237101=_[_0xcbb7('0x40')]({},_0x237101,_0x244d32['options']);return db[_0xcbb7('0x31')][_0xcbb7('0x4a')](_0x237101)[_0xcbb7('0x26')](handleEntityNotFound(_0x130305,null))['then'](respondWithResult(_0x130305,null))[_0xcbb7('0x4b')](handleError(_0x130305,null));};exports[_0xcbb7('0x4c')]=function(_0x3e9cd2,_0x203521){return db['Pause'][_0xcbb7('0x4c')](_0x3e9cd2[_0xcbb7('0x4d')],{})[_0xcbb7('0x26')](function(_0x36f624){var _0x347ba0=_0x3e9cd2[_0xcbb7('0x4e')]['get']({'plain':!![]});if(!_0x347ba0)throw new Error(_0xcbb7('0x4f'));if(_0x347ba0[_0xcbb7('0x50')]==='user'){var _0x5bef9e=_0x36f624[_0xcbb7('0x28')]({'plain':!![]});var _0x516074=_0xcbb7('0x29');return db[_0xcbb7('0x51')][_0xcbb7('0x4a')]({'where':{'name':_0x516074,'userProfileId':_0x347ba0[_0xcbb7('0x52')]},'raw':!![]})[_0xcbb7('0x26')](function(_0x4f8605){if(_0x4f8605&&_0x4f8605[_0xcbb7('0x53')]===0x0){return db[_0xcbb7('0x2a')][_0xcbb7('0x4c')]({'name':_0x5bef9e[_0xcbb7('0x2d')],'resourceId':_0x5bef9e['id'],'type':_0x4f8605[_0xcbb7('0x2d')],'sectionId':_0x4f8605['id']},{})[_0xcbb7('0x26')](function(){return _0x36f624;});}else{return _0x36f624;}})['catch'](function(_0x4561e9){logger[_0xcbb7('0x54')](_0xcbb7('0x55'),_0x4561e9);throw _0x4561e9;});}return _0x36f624;})[_0xcbb7('0x26')](respondWithResult(_0x203521,0xc9))[_0xcbb7('0x4b')](handleError(_0x203521,null));};exports['update']=function(_0x2d80c1,_0x11a48e){if(_0x2d80c1['body']['id']){delete _0x2d80c1[_0xcbb7('0x4d')]['id'];}return db[_0xcbb7('0x31')][_0xcbb7('0x4a')]({'where':{'id':_0x2d80c1[_0xcbb7('0x49')]['id']}})['then'](handleEntityNotFound(_0x11a48e,null))['then'](saveUpdates(_0x2d80c1[_0xcbb7('0x4d')],null))[_0xcbb7('0x26')](respondWithResult(_0x11a48e,null))[_0xcbb7('0x4b')](handleError(_0x11a48e,null));};exports[_0xcbb7('0x27')]=function(_0x1f3ac9,_0x230238){return db[_0xcbb7('0x31')][_0xcbb7('0x4a')]({'where':{'id':_0x1f3ac9[_0xcbb7('0x49')]['id']}})['then'](handleEntityNotFound(_0x230238,null))[_0xcbb7('0x26')](removeEntity(_0x230238,null))['catch'](handleError(_0x230238,null));};
\ No newline at end of file
+var _0x8fb2=['intersection','model','query','attributes','fields','nolimit','order','sort','filters','filter','where','merge','map','Pause','include','findAll','rows','catch','show','params','length','includeAll','options','create','body','user','UserProfileSection','find','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','destroy','then','get','Pauses','error','stack','name','send','rawAttributes','fieldName','type','key','keys'];(function(_0x2a61c5,_0x18f617){var _0x3fd8ac=function(_0xf9e440){while(--_0xf9e440){_0x2a61c5['push'](_0x2a61c5['shift']());}};_0x3fd8ac(++_0x18f617);}(_0x8fb2,0x116));var _0x28fb=function(_0x496319,_0xfa089){_0x496319=_0x496319-0x0;var _0xf58e5e=_0x8fb2[_0x496319];return _0xf58e5e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x28fb('0x0'));var zipdir=require(_0x28fb('0x1'));var jsonpatch=require(_0x28fb('0x2'));var rp=require(_0x28fb('0x3'));var moment=require(_0x28fb('0x4'));var BPromise=require(_0x28fb('0x5'));var Mustache=require(_0x28fb('0x6'));var util=require(_0x28fb('0x7'));var path=require(_0x28fb('0x8'));var sox=require(_0x28fb('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x28fb('0xa'));var squel=require(_0x28fb('0xb'));var crypto=require(_0x28fb('0xc'));var jsforce=require(_0x28fb('0xd'));var deskjs=require(_0x28fb('0xe'));var toCsv=require('to-csv');var querystring=require(_0x28fb('0xf'));var Papa=require(_0x28fb('0x10'));var Redis=require(_0x28fb('0x11'));var authService=require(_0x28fb('0x12'));var qs=require(_0x28fb('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x28fb('0x14'));var logger=require(_0x28fb('0x15'))('api');var utils=require(_0x28fb('0x16'));var config=require(_0x28fb('0x17'));var licenseUtil=require(_0x28fb('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x515ce9,_0x6ccac4){_0x6ccac4=_0x6ccac4||0xcc;return function(_0x1b6ec9){if(_0x1b6ec9){return _0x515ce9[_0x28fb('0x19')](_0x6ccac4);}return _0x515ce9[_0x28fb('0x1a')](_0x6ccac4)[_0x28fb('0x1b')]();};}function respondWithResult(_0x37177e,_0x5d41c7){_0x5d41c7=_0x5d41c7||0xc8;return function(_0x1764b8){if(_0x1764b8){return _0x37177e['status'](_0x5d41c7)[_0x28fb('0x1c')](_0x1764b8);}};}function respondWithFilteredResult(_0x34b271,_0x1d793c){return function(_0x22788a){if(_0x22788a){var _0x4272b3=typeof _0x1d793c[_0x28fb('0x1d')]===_0x28fb('0x1e')&&typeof _0x1d793c[_0x28fb('0x1f')]===_0x28fb('0x1e');var _0x336f99=_0x22788a[_0x28fb('0x20')];var _0xb150fe=_0x4272b3?0x0:_0x1d793c[_0x28fb('0x1d')];var _0x1b7b7e=_0x4272b3?_0x22788a[_0x28fb('0x20')]:_0x1d793c[_0x28fb('0x1d')]+_0x1d793c[_0x28fb('0x1f')];var _0xcbbf03;if(_0x1b7b7e>=_0x336f99){_0x1b7b7e=_0x336f99;_0xcbbf03=0xc8;}else{_0xcbbf03=0xce;}_0x34b271[_0x28fb('0x1a')](_0xcbbf03);return _0x34b271[_0x28fb('0x21')]('Content-Range',_0xb150fe+'-'+_0x1b7b7e+'/'+_0x336f99)[_0x28fb('0x1c')](_0x22788a);}return null;};}function patchUpdates(_0xfa4ff3){return function(_0x1c4bdc){try{jsonpatch[_0x28fb('0x22')](_0x1c4bdc,_0xfa4ff3,!![]);}catch(_0x3c3e78){return BPromise[_0x28fb('0x23')](_0x3c3e78);}return _0x1c4bdc[_0x28fb('0x24')]();};}function saveUpdates(_0x5a41dd,_0x2ab0ba){return function(_0x46b247){if(_0x46b247){return _0x46b247['update'](_0x5a41dd)['then'](function(_0x25f346){return _0x25f346;});}return null;};}function removeEntity(_0x175b4d,_0x2110d7){return function(_0x346be9){if(_0x346be9){return _0x346be9[_0x28fb('0x25')]()[_0x28fb('0x26')](function(){var _0x1234c0=_0x346be9[_0x28fb('0x27')]({'plain':!![]});var _0x280eda=_0x28fb('0x28');return db['UserProfileResource'][_0x28fb('0x25')]({'where':{'type':_0x280eda,'resourceId':_0x1234c0['id']}})[_0x28fb('0x26')](function(){return _0x346be9;});})['then'](function(){_0x175b4d[_0x28fb('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ca8ec,_0x24b451){return function(_0x1ca95a){if(!_0x1ca95a){_0x2ca8ec[_0x28fb('0x19')](0x194);}return _0x1ca95a;};}function handleError(_0x45e78a,_0x24ed96){_0x24ed96=_0x24ed96||0x1f4;return function(_0x323522){logger[_0x28fb('0x29')](_0x323522[_0x28fb('0x2a')]);if(_0x323522[_0x28fb('0x2b')]){delete _0x323522[_0x28fb('0x2b')];}_0x45e78a[_0x28fb('0x1a')](_0x24ed96)[_0x28fb('0x2c')](_0x323522);};}exports['index']=function(_0x49ddfc,_0x1bb95c){var _0x4ec29f={},_0x22e0b9={},_0x18322e={'count':0x0,'rows':[]};var _0x56ad66=_['map'](db['Pause'][_0x28fb('0x2d')],function(_0x4de3c2){return{'name':_0x4de3c2[_0x28fb('0x2e')],'type':_0x4de3c2[_0x28fb('0x2f')][_0x28fb('0x30')]};});_0x22e0b9['model']=_['map'](_0x56ad66,'name');_0x22e0b9['query']=_[_0x28fb('0x31')](_0x49ddfc['query']);_0x22e0b9['filters']=_[_0x28fb('0x32')](_0x22e0b9[_0x28fb('0x33')],_0x22e0b9[_0x28fb('0x34')]);_0x4ec29f[_0x28fb('0x35')]=_['intersection'](_0x22e0b9['model'],qs['fields'](_0x49ddfc[_0x28fb('0x34')][_0x28fb('0x36')]));_0x4ec29f[_0x28fb('0x35')]=_0x4ec29f['attributes']['length']?_0x4ec29f[_0x28fb('0x35')]:_0x22e0b9[_0x28fb('0x33')];if(!_0x49ddfc[_0x28fb('0x34')]['hasOwnProperty'](_0x28fb('0x37'))){_0x4ec29f[_0x28fb('0x1f')]=qs[_0x28fb('0x1f')](_0x49ddfc['query']['limit']);_0x4ec29f[_0x28fb('0x1d')]=qs[_0x28fb('0x1d')](_0x49ddfc[_0x28fb('0x34')]['offset']);}_0x4ec29f[_0x28fb('0x38')]=qs[_0x28fb('0x39')](_0x49ddfc[_0x28fb('0x34')][_0x28fb('0x39')]);_0x4ec29f['where']=qs[_0x28fb('0x3a')](_['pick'](_0x49ddfc['query'],_0x22e0b9[_0x28fb('0x3a')]),_0x56ad66);if(_0x49ddfc[_0x28fb('0x34')][_0x28fb('0x3b')]){_0x4ec29f[_0x28fb('0x3c')]=_[_0x28fb('0x3d')](_0x4ec29f[_0x28fb('0x3c')],{'$or':_[_0x28fb('0x3e')](_0x56ad66,function(_0x1550fa){if(_0x1550fa[_0x28fb('0x2f')]!=='VIRTUAL'){var _0x497baf={};_0x497baf[_0x1550fa[_0x28fb('0x2b')]]={'$like':'%'+_0x49ddfc[_0x28fb('0x34')][_0x28fb('0x3b')]+'%'};return _0x497baf;}})});}_0x4ec29f=_[_0x28fb('0x3d')]({},_0x4ec29f,_0x49ddfc['options']);var _0x166654={'where':_0x4ec29f['where']};return db[_0x28fb('0x3f')][_0x28fb('0x20')](_0x166654)[_0x28fb('0x26')](function(_0x41d8db){_0x18322e[_0x28fb('0x20')]=_0x41d8db;if(_0x49ddfc['query']['includeAll']){_0x4ec29f[_0x28fb('0x40')]=[{'all':!![]}];}return db[_0x28fb('0x3f')][_0x28fb('0x41')](_0x4ec29f);})['then'](function(_0x107f2b){_0x18322e[_0x28fb('0x42')]=_0x107f2b;return _0x18322e;})['then'](respondWithFilteredResult(_0x1bb95c,_0x4ec29f))[_0x28fb('0x43')](handleError(_0x1bb95c,null));};exports[_0x28fb('0x44')]=function(_0xa0febc,_0x5ad293){var _0x2a0158={'raw':!![],'where':{'id':_0xa0febc[_0x28fb('0x45')]['id']}},_0x1ec453={};_0x1ec453[_0x28fb('0x33')]=_[_0x28fb('0x31')](db[_0x28fb('0x3f')]['rawAttributes']);_0x1ec453[_0x28fb('0x34')]=_[_0x28fb('0x31')](_0xa0febc[_0x28fb('0x34')]);_0x1ec453[_0x28fb('0x3a')]=_[_0x28fb('0x32')](_0x1ec453[_0x28fb('0x33')],_0x1ec453[_0x28fb('0x34')]);_0x2a0158[_0x28fb('0x35')]=_[_0x28fb('0x32')](_0x1ec453['model'],qs[_0x28fb('0x36')](_0xa0febc['query'][_0x28fb('0x36')]));_0x2a0158[_0x28fb('0x35')]=_0x2a0158['attributes'][_0x28fb('0x46')]?_0x2a0158[_0x28fb('0x35')]:_0x1ec453[_0x28fb('0x33')];if(_0xa0febc[_0x28fb('0x34')][_0x28fb('0x47')]){_0x2a0158[_0x28fb('0x40')]=[{'all':!![]}];}_0x2a0158=_['merge']({},_0x2a0158,_0xa0febc[_0x28fb('0x48')]);return db[_0x28fb('0x3f')]['find'](_0x2a0158)[_0x28fb('0x26')](handleEntityNotFound(_0x5ad293,null))[_0x28fb('0x26')](respondWithResult(_0x5ad293,null))[_0x28fb('0x43')](handleError(_0x5ad293,null));};exports[_0x28fb('0x49')]=function(_0x50863e,_0x4d4c94){return db[_0x28fb('0x3f')][_0x28fb('0x49')](_0x50863e[_0x28fb('0x4a')],{})['then'](function(_0x13aad0){var _0x1129fe=_0x50863e[_0x28fb('0x4b')][_0x28fb('0x27')]({'plain':!![]});if(!_0x1129fe)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1129fe['role']===_0x28fb('0x4b')){var _0x19668c=_0x13aad0['get']({'plain':!![]});var _0x1c20d1='Pauses';return db[_0x28fb('0x4c')][_0x28fb('0x4d')]({'where':{'name':_0x1c20d1,'userProfileId':_0x1129fe['userProfileId']},'raw':!![]})['then'](function(_0x1435c7){if(_0x1435c7&&_0x1435c7[_0x28fb('0x4e')]===0x0){return db[_0x28fb('0x4f')][_0x28fb('0x49')]({'name':_0x19668c['name'],'resourceId':_0x19668c['id'],'type':_0x1435c7[_0x28fb('0x2b')],'sectionId':_0x1435c7['id']},{})[_0x28fb('0x26')](function(){return _0x13aad0;});}else{return _0x13aad0;}})['catch'](function(_0x3c79ff){logger[_0x28fb('0x29')](_0x28fb('0x50'),_0x3c79ff);throw _0x3c79ff;});}return _0x13aad0;})[_0x28fb('0x26')](respondWithResult(_0x4d4c94,0xc9))['catch'](handleError(_0x4d4c94,null));};exports[_0x28fb('0x51')]=function(_0x2ca003,_0x46d736){if(_0x2ca003['body']['id']){delete _0x2ca003['body']['id'];}return db[_0x28fb('0x3f')]['find']({'where':{'id':_0x2ca003[_0x28fb('0x45')]['id']}})['then'](handleEntityNotFound(_0x46d736,null))[_0x28fb('0x26')](saveUpdates(_0x2ca003[_0x28fb('0x4a')],null))[_0x28fb('0x26')](respondWithResult(_0x46d736,null))[_0x28fb('0x43')](handleError(_0x46d736,null));};exports[_0x28fb('0x25')]=function(_0x7e088e,_0x60cbb6){return db['Pause'][_0x28fb('0x4d')]({'where':{'id':_0x7e088e['params']['id']}})[_0x28fb('0x26')](handleEntityNotFound(_0x60cbb6,null))[_0x28fb('0x26')](removeEntity(_0x60cbb6,null))[_0x28fb('0x43')](handleError(_0x60cbb6,null));};
\ No newline at end of file
index 303ec2e..cf4fa1c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8ef6=['exports','define','Pause','tools_pauses','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./pause.attributes'];(function(_0x39cabf,_0xa08eec){var _0x33fd1c=function(_0x50e8b5){while(--_0x50e8b5){_0x39cabf['push'](_0x39cabf['shift']());}};_0x33fd1c(++_0xa08eec);}(_0x8ef6,0xf2));var _0x68ef=function(_0x30c48b,_0x362e9b){_0x30c48b=_0x30c48b-0x0;var _0x5920b5=_0x8ef6[_0x30c48b];return _0x5920b5;};'use strict';var _=require(_0x68ef('0x0'));var util=require(_0x68ef('0x1'));var logger=require(_0x68ef('0x2'))(_0x68ef('0x3'));var moment=require(_0x68ef('0x4'));var BPromise=require(_0x68ef('0x5'));var rp=require(_0x68ef('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x68ef('0x7'));var config=require(_0x68ef('0x8'));var attributes=require(_0x68ef('0x9'));module[_0x68ef('0xa')]=function(_0x4d26e3,_0x4f77f3){return _0x4d26e3[_0x68ef('0xb')](_0x68ef('0xc'),attributes,{'tableName':_0x68ef('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6aa7=['Pause','tools_pauses','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','define'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x6aa7,0x178));var _0x76aa=function(_0x4a5e99,_0x142ebb){_0x4a5e99=_0x4a5e99-0x0;var _0x1d4f4c=_0x6aa7[_0x4a5e99];return _0x1d4f4c;};'use strict';var _=require(_0x76aa('0x0'));var util=require('util');var logger=require(_0x76aa('0x1'))(_0x76aa('0x2'));var moment=require(_0x76aa('0x3'));var BPromise=require(_0x76aa('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x76aa('0x5'));var rimraf=require(_0x76aa('0x6'));var config=require(_0x76aa('0x7'));var attributes=require('./pause.attributes');module['exports']=function(_0x1aceaa,_0x4d53f6){return _0x1aceaa[_0x76aa('0x8')](_0x76aa('0x9'),attributes,{'tableName':_0x76aa('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 8d27e33..f217ee8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['message','request\x20sent','result','catch','Pause','find','options','raw','where','attributes','map','include','model','ShowPause','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Pause,\x20%s,\x20%s','debug','stringify','error','code'];(function(_0x401b0a,_0x267abd){var _0x267a10=function(_0x239880){while(--_0x239880){_0x401b0a['push'](_0x401b0a['shift']());}};_0x267a10(++_0x267abd);}(_0x7a54,0x106));var _0x47a5=function(_0x2fc0c6,_0x40b9d3){_0x2fc0c6=_0x2fc0c6-0x0;var _0x1af360=_0x7a54[_0x2fc0c6];return _0x1af360;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Pause,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['ShowPause']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')]({'raw':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')][_0x47a5('0x18')]===undefined?!![]:![]:!![],'where':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x19')]||null:null,'attributes':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x1a')]||null:null,'include':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')]['include']?_[_0x47a5('0x1b')](_0x5247fd[_0x47a5('0x17')][_0x47a5('0x1c')],function(_0x7a9f9e){return{'model':db[_0x7a9f9e['model']],'as':_0x7a9f9e['as'],'attributes':_0x7a9f9e[_0x47a5('0x1a')],'include':_0x7a9f9e[_0x47a5('0x1c')]?_['map'](_0x7a9f9e[_0x47a5('0x1c')],function(_0xc4cd63){return{'model':db[_0xc4cd63[_0x47a5('0x1d')]],'as':_0xc4cd63['as'],'attributes':_0xc4cd63[_0x47a5('0x1a')],'include':_0xc4cd63[_0x47a5('0x1c')]?_['map'](_0xc4cd63['include'],function(_0x136745){return{'model':db[_0x136745['model']],'as':_0x136745['as'],'attributes':_0x136745[_0x47a5('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x23cb77){logger[_0x47a5('0xb')](_0x47a5('0x1e'),_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1e'),_0x5247fd,JSON[_0x47a5('0xe')](_0x23cb77));_0xaf70a6(_0x23cb77);})[_0x47a5('0x14')](function(_0x136b14){logger[_0x47a5('0xf')](_0x47a5('0x1e'),_0x136b14[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81[_0x47a5('0xf')](0x1f4,_0x136b14[_0x47a5('0x11')]));});});};
\ No newline at end of file
+var _0xb10b=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Pause,\x20%s,\x20%s','Pause,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','ShowPause','Pause','find','options','raw','where','attributes','map','include','model','debug'];(function(_0xeecb19,_0x5d5ee1){var _0x252c6f=function(_0xeb774d){while(--_0xeb774d){_0xeecb19['push'](_0xeecb19['shift']());}};_0x252c6f(++_0x5d5ee1);}(_0xb10b,0x12a));var _0xbb10=function(_0x306646,_0xdc2e1b){_0x306646=_0x306646-0x0;var _0x40bd8d=_0xb10b[_0x306646];return _0x40bd8d;};'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 18fc96f..3c94201 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcea2=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','./plugin.controller','isAuthenticated','get','/webhook','webhookGet','/:id','/:id/download','download','diskStorage','server/files/plugins','originalname','replace','format','%s-%s%s','extname','post','single','file','upload','put','update','delete','multer','path'];(function(_0x54606d,_0x946716){var _0x110b14=function(_0x58a2b1){while(--_0x58a2b1){_0x54606d['push'](_0x54606d['shift']());}};_0x110b14(++_0x946716);}(_0xcea2,0x15a));var _0x2cea=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0xcea2[_0x278e3c];return _0x3e2d9b;};'use strict';var multer=require(_0x2cea('0x0'));var util=require('util');var path=require(_0x2cea('0x1'));var timeout=require('connect-timeout');var express=require(_0x2cea('0x2'));var router=express[_0x2cea('0x3')]();var fs_extra=require(_0x2cea('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2cea('0x5'));var config=require(_0x2cea('0x6'));var controller=require(_0x2cea('0x7'));router['get']('/',auth[_0x2cea('0x8')](),controller['index']);router[_0x2cea('0x9')](_0x2cea('0xa'),controller[_0x2cea('0xb')]);router[_0x2cea('0x9')](_0x2cea('0xc'),auth[_0x2cea('0x8')](),controller['show']);router[_0x2cea('0x9')](_0x2cea('0xd'),auth[_0x2cea('0x8')](),controller[_0x2cea('0xe')]);var upload=multer({'storage':multer[_0x2cea('0xf')]({'destination':function(_0x439c4d,_0x4298a4,_0x1c9142){_0x1c9142(null,path['join'](config['root'],_0x2cea('0x10')));},'filename':function(_0x2db0ff,_0x528c1d,_0x4bd265){_0x528c1d[_0x2cea('0x11')]=_0x528c1d['originalname'][_0x2cea('0x12')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x4bd265(null,util[_0x2cea('0x13')](_0x2cea('0x14'),path['basename'](_0x528c1d['originalname'],path['extname'](_0x528c1d[_0x2cea('0x11')])),Date['now'](),path[_0x2cea('0x15')](_0x528c1d[_0x2cea('0x11')])));}})});router[_0x2cea('0x16')]('/',upload[_0x2cea('0x17')](_0x2cea('0x18')),controller[_0x2cea('0x19')]);router[_0x2cea('0x16')](_0x2cea('0xa'),controller['webhookPost']);router[_0x2cea('0x1a')](_0x2cea('0xc'),auth[_0x2cea('0x8')](),controller[_0x2cea('0x1b')]);router[_0x2cea('0x1c')](_0x2cea('0xc'),auth['isAuthenticated'](),controller[_0x2cea('0x1c')]);module['exports']=router;
\ No newline at end of file
+var _0xac9d=['put','update','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/webhook','webhookGet','/:id','show','/:id/download','download','diskStorage','root','server/files/plugins','originalname','replace','format','%s-%s%s','extname','post','single','file','upload'];(function(_0xea343d,_0x311197){var _0x2c6e9c=function(_0x454bd6){while(--_0x454bd6){_0xea343d['push'](_0xea343d['shift']());}};_0x2c6e9c(++_0x311197);}(_0xac9d,0x14d));var _0xdac9=function(_0x5ce4e3,_0x42cb9a){_0x5ce4e3=_0x5ce4e3-0x0;var _0x42248f=_0xac9d[_0x5ce4e3];return _0x42248f;};'use strict';var multer=require(_0xdac9('0x0'));var util=require(_0xdac9('0x1'));var path=require(_0xdac9('0x2'));var timeout=require(_0xdac9('0x3'));var express=require(_0xdac9('0x4'));var router=express[_0xdac9('0x5')]();var fs_extra=require(_0xdac9('0x6'));var auth=require(_0xdac9('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xdac9('0x8'));var controller=require('./plugin.controller');router[_0xdac9('0x9')]('/',auth[_0xdac9('0xa')](),controller[_0xdac9('0xb')]);router[_0xdac9('0x9')](_0xdac9('0xc'),controller[_0xdac9('0xd')]);router['get'](_0xdac9('0xe'),auth['isAuthenticated'](),controller[_0xdac9('0xf')]);router[_0xdac9('0x9')](_0xdac9('0x10'),auth[_0xdac9('0xa')](),controller[_0xdac9('0x11')]);var upload=multer({'storage':multer[_0xdac9('0x12')]({'destination':function(_0x255627,_0x1b604a,_0xbb5615){_0xbb5615(null,path['join'](config[_0xdac9('0x13')],_0xdac9('0x14')));},'filename':function(_0x5a9bde,_0x3d8e97,_0xeddbc1){_0x3d8e97[_0xdac9('0x15')]=_0x3d8e97['originalname'][_0xdac9('0x16')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0xeddbc1(null,util[_0xdac9('0x17')](_0xdac9('0x18'),path['basename'](_0x3d8e97['originalname'],path[_0xdac9('0x19')](_0x3d8e97[_0xdac9('0x15')])),Date['now'](),path[_0xdac9('0x19')](_0x3d8e97[_0xdac9('0x15')])));}})});router[_0xdac9('0x1a')]('/',upload[_0xdac9('0x1b')](_0xdac9('0x1c')),controller[_0xdac9('0x1d')]);router[_0xdac9('0x1a')](_0xdac9('0xc'),controller['webhookPost']);router[_0xdac9('0x1e')](_0xdac9('0xe'),auth['isAuthenticated'](),controller[_0xdac9('0x1f')]);router[_0xdac9('0x20')](_0xdac9('0xe'),auth[_0xdac9('0xa')](),controller['delete']);module['exports']=router;
\ No newline at end of file
index c419a77..03cd274 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfb9e=['exports','STRING','ENUM','html','script','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','agentOnly','always','never'];(function(_0x3d792a,_0x5ce72d){var _0x2af23e=function(_0x50b840){while(--_0x50b840){_0x3d792a['push'](_0x3d792a['shift']());}};_0x2af23e(++_0x5ce72d);}(_0xfb9e,0xa8));var _0xefb9=function(_0x10d6f5,_0x140245){_0x10d6f5=_0x10d6f5-0x0;var _0x484db4=_0xfb9e[_0x10d6f5];return _0x484db4;};'use strict';var Sequelize=require('sequelize');module[_0xefb9('0x0')]={'name':{'type':Sequelize[_0xefb9('0x1')]},'type':{'type':Sequelize[_0xefb9('0x2')](_0xefb9('0x3'),_0xefb9('0x4'))},'description':{'type':Sequelize[_0xefb9('0x5')]},'version':{'type':Sequelize['TEXT']},'path':{'type':Sequelize['STRING'],'comment':_0xefb9('0x6')},'active':{'type':Sequelize[_0xefb9('0x7')],'defaultValue':0x0,'comment':_0xefb9('0x8')},'sidebar':{'type':Sequelize[_0xefb9('0x2')]('adminOnly',_0xefb9('0x9'),_0xefb9('0xa'),_0xefb9('0xb')),'defaultValue':_0xefb9('0xa'),'comment':'Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.'},'icon':{'type':Sequelize[_0xefb9('0x1')]},'adminUrl':{'type':Sequelize[_0xefb9('0x1')]},'agentUrl':{'type':Sequelize[_0xefb9('0x1')]},'scriptName':{'type':Sequelize[_0xefb9('0x1')]},'scriptPath':{'type':Sequelize[_0xefb9('0x1')]}};
\ No newline at end of file
+var _0x9772=['BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','agentOnly','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','STRING','ENUM','html','script','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.'];(function(_0x37af10,_0x4827a7){var _0x76baed=function(_0x194428){while(--_0x194428){_0x37af10['push'](_0x37af10['shift']());}};_0x76baed(++_0x4827a7);}(_0x9772,0xe7));var _0x2977=function(_0x4a53d,_0x58a95e){_0x4a53d=_0x4a53d-0x0;var _0x27410e=_0x9772[_0x4a53d];return _0x27410e;};'use strict';var Sequelize=require(_0x2977('0x0'));module['exports']={'name':{'type':Sequelize[_0x2977('0x1')]},'type':{'type':Sequelize[_0x2977('0x2')](_0x2977('0x3'),_0x2977('0x4'))},'description':{'type':Sequelize['TEXT']},'version':{'type':Sequelize[_0x2977('0x5')]},'path':{'type':Sequelize['STRING'],'comment':_0x2977('0x6')},'active':{'type':Sequelize[_0x2977('0x7')],'defaultValue':0x0,'comment':_0x2977('0x8')},'sidebar':{'type':Sequelize[_0x2977('0x2')](_0x2977('0x9'),_0x2977('0xa'),_0x2977('0xb'),_0x2977('0xc')),'defaultValue':_0x2977('0xb'),'comment':_0x2977('0xd')},'icon':{'type':Sequelize[_0x2977('0x1')]},'adminUrl':{'type':Sequelize[_0x2977('0x1')]},'agentUrl':{'type':Sequelize[_0x2977('0x1')]},'scriptName':{'type':Sequelize[_0x2977('0x1')]},'scriptPath':{'type':Sequelize[_0x2977('0x1')]}};
\ No newline at end of file
index 9add58d..7c9d745 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc76b=['Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','isFile','isDirectory','Plugin\x20manifest\x20missing','readFileSync','manifest.json','parse','undefined','Invalid\x20manifest:\x20type\x20missing','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','Invalid\x20manifest:\x20views\x20missing','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','sidebar','always','icon','version','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','Warning:\x20agent\x20view\x20not\x20specified','body','userProfileId','role','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','unlinkSync','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','json','encoding','method','%s%s','headers','content-length','content-type','set','statusCode','webhookPost','http://localhost:','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','crypto','desk.js','querystring','papaparse','archiver','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','register','sendStatus','status','offset','limit','reject','save','update','destroy','then','get','Plugins','UserProfileResource','end','error','stack','name','send','map','Plugin','rawAttributes','fieldName','type','key','query','intersection','model','attributes','fields','length','nolimit','sort','filters','filter','merge','VIRTUAL','count','includeAll','findAll','rows','catch','show','params','keys','options','find','download','join','root','format','%s.zip','basename','warning','code','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','server/files/plugins','dirname','node_modules/**/*','attachments/**/*','finalize','close','existsSync','Plugin\x20not\x20found','info','Download\x20completed','Temporary\x20file\x20removed','upload','file','filename','extname','Plugin\x20upload\x20filepath:\x20%s'];(function(_0x13b3b5,_0x52d8d8){var _0x337cd0=function(_0x31fbdf){while(--_0x31fbdf){_0x13b3b5['push'](_0x13b3b5['shift']());}};_0x337cd0(++_0x52d8d8);}(_0xc76b,0x185));var _0xbc76=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xc76b[_0x3947c9];return _0x2e7871;};'use strict';var emlformat=require(_0xbc76('0x0'));var rimraf=require(_0xbc76('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbc76('0x2'));var rp=require(_0xbc76('0x3'));var moment=require(_0xbc76('0x4'));var BPromise=require(_0xbc76('0x5'));var Mustache=require(_0xbc76('0x6'));var util=require(_0xbc76('0x7'));var path=require(_0xbc76('0x8'));var sox=require('sox');var csv=require(_0xbc76('0x9'));var ejs=require(_0xbc76('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xbc76('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xbc76('0xc'));var toCsv=require(_0xbc76('0x9'));var querystring=require(_0xbc76('0xd'));var Papa=require(_0xbc76('0xe'));var extract=require('extract-zip');var rimraf=require(_0xbc76('0x1'));var archiver=require(_0xbc76('0xf'));var Redis=require(_0xbc76('0x10'));var authService=require(_0xbc76('0x11'));var qs=require(_0xbc76('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbc76('0x13'));var logger=require(_0xbc76('0x14'))(_0xbc76('0x15'));var utils=require(_0xbc76('0x16'));var config=require(_0xbc76('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xbc76('0x18'))['db'];config[_0xbc76('0x19')]=_[_0xbc76('0x1a')](config[_0xbc76('0x19')],{'host':_0xbc76('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./plugin.socket')[_0xbc76('0x1c')](socket);function respondWithStatusCode(_0x472f04,_0xe76140){_0xe76140=_0xe76140||0xcc;return function(_0x2a6d44){if(_0x2a6d44){return _0x472f04[_0xbc76('0x1d')](_0xe76140);}return _0x472f04[_0xbc76('0x1e')](_0xe76140)['end']();};}function respondWithResult(_0x443271,_0xd10903){_0xd10903=_0xd10903||0xc8;return function(_0x55635e){if(_0x55635e){return _0x443271[_0xbc76('0x1e')](_0xd10903)['json'](_0x55635e);}};}function respondWithFilteredResult(_0x341f1b,_0x49e8df){return function(_0x3fecb6){if(_0x3fecb6){var _0x54e11e=typeof _0x49e8df[_0xbc76('0x1f')]==='undefined'&&typeof _0x49e8df[_0xbc76('0x20')]==='undefined';var _0x325daf=_0x3fecb6['count'];var _0x483645=_0x54e11e?0x0:_0x49e8df[_0xbc76('0x1f')];var _0x454499=_0x54e11e?_0x3fecb6['count']:_0x49e8df['offset']+_0x49e8df[_0xbc76('0x20')];var _0x2e359c;if(_0x454499>=_0x325daf){_0x454499=_0x325daf;_0x2e359c=0xc8;}else{_0x2e359c=0xce;}_0x341f1b['status'](_0x2e359c);return _0x341f1b['set']('Content-Range',_0x483645+'-'+_0x454499+'/'+_0x325daf)['json'](_0x3fecb6);}return null;};}function patchUpdates(_0x68084){return function(_0x5ec085){try{jsonpatch['apply'](_0x5ec085,_0x68084,!![]);}catch(_0x583fa7){return BPromise[_0xbc76('0x21')](_0x583fa7);}return _0x5ec085[_0xbc76('0x22')]();};}function saveUpdates(_0x27145d,_0x587f8f){return function(_0x20daac){if(_0x20daac){return _0x20daac[_0xbc76('0x23')](_0x27145d)['then'](function(_0x1e413e){return _0x1e413e;});}return null;};}function removeEntity(_0x22b976,_0x66f7d9){return function(_0x2a733a){if(_0x2a733a){return _0x2a733a[_0xbc76('0x24')]()[_0xbc76('0x25')](function(){var _0x419b13=_0x2a733a[_0xbc76('0x26')]({'plain':!![]});var _0x4cdd4f=_0xbc76('0x27');return db[_0xbc76('0x28')][_0xbc76('0x24')]({'where':{'type':_0x4cdd4f,'resourceId':_0x419b13['id']}})['then'](function(){return _0x2a733a;});})[_0xbc76('0x25')](function(){_0x22b976['status'](0xcc)[_0xbc76('0x29')]();});}};}function handleEntityNotFound(_0x38daf6,_0xf4998b){return function(_0x210ddf){if(!_0x210ddf){_0x38daf6[_0xbc76('0x1d')](0x194);}return _0x210ddf;};}function handleError(_0x2dc7d1,_0x4424f3){_0x4424f3=_0x4424f3||0x1f4;return function(_0x2fad49){logger[_0xbc76('0x2a')](_0x2fad49[_0xbc76('0x2b')]);if(_0x2fad49['name']){delete _0x2fad49[_0xbc76('0x2c')];}_0x2dc7d1[_0xbc76('0x1e')](_0x4424f3)[_0xbc76('0x2d')](_0x2fad49);};}exports['index']=function(_0x5a848d,_0x31eca2){var _0x35b17d={},_0x2cb06d={},_0x948cc0={'count':0x0,'rows':[]};var _0x621bfc=_[_0xbc76('0x2e')](db[_0xbc76('0x2f')][_0xbc76('0x30')],function(_0x196d7a){return{'name':_0x196d7a[_0xbc76('0x31')],'type':_0x196d7a[_0xbc76('0x32')][_0xbc76('0x33')]};});_0x2cb06d['model']=_[_0xbc76('0x2e')](_0x621bfc,_0xbc76('0x2c'));_0x2cb06d['query']=_['keys'](_0x5a848d[_0xbc76('0x34')]);_0x2cb06d['filters']=_[_0xbc76('0x35')](_0x2cb06d[_0xbc76('0x36')],_0x2cb06d[_0xbc76('0x34')]);_0x35b17d[_0xbc76('0x37')]=_['intersection'](_0x2cb06d[_0xbc76('0x36')],qs['fields'](_0x5a848d[_0xbc76('0x34')][_0xbc76('0x38')]));_0x35b17d[_0xbc76('0x37')]=_0x35b17d['attributes'][_0xbc76('0x39')]?_0x35b17d['attributes']:_0x2cb06d[_0xbc76('0x36')];if(!_0x5a848d['query']['hasOwnProperty'](_0xbc76('0x3a'))){_0x35b17d[_0xbc76('0x20')]=qs[_0xbc76('0x20')](_0x5a848d[_0xbc76('0x34')][_0xbc76('0x20')]);_0x35b17d['offset']=qs[_0xbc76('0x1f')](_0x5a848d['query'][_0xbc76('0x1f')]);}_0x35b17d['order']=qs[_0xbc76('0x3b')](_0x5a848d['query'][_0xbc76('0x3b')]);_0x35b17d['where']=qs[_0xbc76('0x3c')](_['pick'](_0x5a848d['query'],_0x2cb06d[_0xbc76('0x3c')]),_0x621bfc);if(_0x5a848d[_0xbc76('0x34')][_0xbc76('0x3d')]){_0x35b17d['where']=_[_0xbc76('0x3e')](_0x35b17d['where'],{'$or':_['map'](_0x621bfc,function(_0x219cd3){if(_0x219cd3[_0xbc76('0x32')]!==_0xbc76('0x3f')){var _0xaa202d={};_0xaa202d[_0x219cd3['name']]={'$like':'%'+_0x5a848d['query'][_0xbc76('0x3d')]+'%'};return _0xaa202d;}})});}_0x35b17d=_['merge']({},_0x35b17d,_0x5a848d['options']);var _0x256906={'where':_0x35b17d['where']};return db[_0xbc76('0x2f')][_0xbc76('0x40')](_0x256906)[_0xbc76('0x25')](function(_0x2115f1){_0x948cc0[_0xbc76('0x40')]=_0x2115f1;if(_0x5a848d['query'][_0xbc76('0x41')]){_0x35b17d['include']=[{'all':!![]}];}return db[_0xbc76('0x2f')][_0xbc76('0x42')](_0x35b17d);})['then'](function(_0x360afb){_0x948cc0[_0xbc76('0x43')]=_0x360afb;return _0x948cc0;})[_0xbc76('0x25')](respondWithFilteredResult(_0x31eca2,_0x35b17d))[_0xbc76('0x44')](handleError(_0x31eca2,null));};exports[_0xbc76('0x45')]=function(_0x19fe32,_0x42034f){var _0x3bc4e7={'raw':!![],'where':{'id':_0x19fe32[_0xbc76('0x46')]['id']}},_0xa3ab03={};_0xa3ab03[_0xbc76('0x36')]=_[_0xbc76('0x47')](db[_0xbc76('0x2f')][_0xbc76('0x30')]);_0xa3ab03[_0xbc76('0x34')]=_[_0xbc76('0x47')](_0x19fe32[_0xbc76('0x34')]);_0xa3ab03[_0xbc76('0x3c')]=_[_0xbc76('0x35')](_0xa3ab03[_0xbc76('0x36')],_0xa3ab03[_0xbc76('0x34')]);_0x3bc4e7[_0xbc76('0x37')]=_[_0xbc76('0x35')](_0xa3ab03['model'],qs[_0xbc76('0x38')](_0x19fe32[_0xbc76('0x34')][_0xbc76('0x38')]));_0x3bc4e7[_0xbc76('0x37')]=_0x3bc4e7[_0xbc76('0x37')][_0xbc76('0x39')]?_0x3bc4e7['attributes']:_0xa3ab03['model'];if(_0x19fe32[_0xbc76('0x34')][_0xbc76('0x41')]){_0x3bc4e7['include']=[{'all':!![]}];}_0x3bc4e7=_[_0xbc76('0x3e')]({},_0x3bc4e7,_0x19fe32[_0xbc76('0x48')]);return db[_0xbc76('0x2f')][_0xbc76('0x49')](_0x3bc4e7)['then'](handleEntityNotFound(_0x42034f,null))[_0xbc76('0x25')](respondWithResult(_0x42034f,null))['catch'](handleError(_0x42034f,null));};exports[_0xbc76('0x4a')]=function(_0x44a9b7,_0x5b37d5,_0x9a0410){return db[_0xbc76('0x2f')]['find']({'where':{'id':_0x44a9b7[_0xbc76('0x46')]['id']},'attributes':[_0xbc76('0x2c'),_0xbc76('0x8')],'raw':!![]})['then'](handleEntityNotFound(_0x5b37d5,null))[_0xbc76('0x25')](function(_0x5a194c){if(_0x5a194c){var _0x504352=path[_0xbc76('0x4b')](config[_0xbc76('0x4c')],'server/files/plugins',util[_0xbc76('0x4d')](_0xbc76('0x4e'),path[_0xbc76('0x4f')](_0x5a194c['path'])));var _0x10f435=fs['createWriteStream'](_0x504352);var _0x263983=archiver('zip',{'zlib':{'level':0x9}});_0x263983['on'](_0xbc76('0x50'),function(_0x2fe304){if(_0x2fe304[_0xbc76('0x51')]==='ENOENT'){logger[_0xbc76('0x2a')](_0x2fe304);}else{throw new db[(_0xbc76('0x52'))][(_0xbc76('0x53'))](_0xbc76('0x54'));}});_0x263983['on']('error',function(_0x52a9a4){throw new db[(_0xbc76('0x52'))]['Error']('Error\x20while\x20generating\x20the\x20zip\x20archive');});_0x263983[_0xbc76('0x55')](_0x10f435);_0x263983[_0xbc76('0x56')]('**/*',{'cwd':path['join'](config[_0xbc76('0x4c')],_0xbc76('0x57'),path[_0xbc76('0x58')](_0x5a194c[_0xbc76('0x8')])),'ignore':[path[_0xbc76('0x4b')](path[_0xbc76('0x4f')](_0x5a194c[_0xbc76('0x8')]),_0xbc76('0x59')),path[_0xbc76('0x4b')](path[_0xbc76('0x4f')](_0x5a194c[_0xbc76('0x8')]),_0xbc76('0x5a'))],'nodir':!![]})[_0xbc76('0x5b')]();_0x10f435['on'](_0xbc76('0x5c'),function(){if(!fs[_0xbc76('0x5d')](_0x504352)){throw new db[(_0xbc76('0x52'))][(_0xbc76('0x53'))](_0xbc76('0x5e'));}return _0x5b37d5[_0xbc76('0x4a')](_0x504352,util[_0xbc76('0x4d')]('%s.zip',path[_0xbc76('0x4f')](_0x5a194c['path'])),function(_0x54c169){if(_0x54c169){throw new db[(_0xbc76('0x52'))][(_0xbc76('0x53'))]('Error\x20while\x20downloading\x20the\x20plugin');}fs['unlinkSync'](_0x504352);logger[_0xbc76('0x5f')](_0xbc76('0x60'));logger[_0xbc76('0x5f')](_0xbc76('0x61'));});});}return null;})[_0xbc76('0x44')](handleError(_0x5b37d5,null));};exports[_0xbc76('0x62')]=function(_0x5cef67,_0x46da20,_0x26132c){var _0x1275ac=path['basename'](_0x5cef67[_0xbc76('0x63')][_0xbc76('0x64')],path[_0xbc76('0x65')](_0x5cef67[_0xbc76('0x63')][_0xbc76('0x64')]));var _0x29562e=path[_0xbc76('0x4b')](config[_0xbc76('0x4c')],_0xbc76('0x57'),_0x5cef67[_0xbc76('0x63')][_0xbc76('0x64')]);var _0xdf0d5d=path[_0xbc76('0x4b')](config[_0xbc76('0x4c')],_0xbc76('0x57'),_0x1275ac);logger[_0xbc76('0x5f')](_0xbc76('0x66'),_0x29562e);logger[_0xbc76('0x5f')](_0xbc76('0x67'),_0xdf0d5d);try{fs[_0xbc76('0x68')](_0x29562e,parseInt(_0xbc76('0x69'),0x8));extract(_0x29562e,{'dir':_0xdf0d5d},function(_0x55a46d){if(_0x55a46d){logger[_0xbc76('0x2a')](_0x55a46d);handleError(_0x55a46d,!![]);};var _0x1d198e=fs[_0xbc76('0x6a')](_0xdf0d5d);if(_0x1d198e['length']>0x1){removeReferences(_0x29562e,_0xdf0d5d);logger[_0xbc76('0x2a')](_0xbc76('0x6b'));return _0x26132c(new Error(_0xbc76('0x6b')));}var _0x2b644d=fs['lstatSync'](path[_0xbc76('0x4b')](_0xdf0d5d,_0x1d198e[0x0]));if(_0x2b644d[_0xbc76('0x6c')]()){removeReferences(_0x29562e,_0xdf0d5d);logger[_0xbc76('0x2a')](_0xbc76('0x6b'));return _0x26132c(new Error(_0xbc76('0x6b')));}if(_0x2b644d[_0xbc76('0x6d')]()){var _0x486e4e=fs[_0xbc76('0x6a')](path[_0xbc76('0x4b')](_0xdf0d5d,_0x1d198e[0x0]));if(_0x486e4e['length']===0x0){removeReferences(_0x29562e,_0xdf0d5d);logger[_0xbc76('0x2a')](_0xbc76('0x6b'));return _0x26132c(new Error(_0xbc76('0x6b')));}var _0x1eee44=_0x486e4e['some'](function(_0x33ef29){return _0x33ef29==='manifest.json';});if(!_0x1eee44){return _0x26132c(new Error(_0xbc76('0x6e')));}var _0x5f50eb=fs[_0xbc76('0x6f')](path[_0xbc76('0x4b')](_0xdf0d5d,_0x1d198e[0x0],_0xbc76('0x70')));var _0x3c92c0=JSON[_0xbc76('0x71')](_0x5f50eb);if('undefined'==typeof _0x3c92c0[_0xbc76('0x2c')]){return _0x26132c(new Error('Invalid\x20manifest:\x20name\x20missing'));}if(_0xbc76('0x72')==typeof _0x3c92c0[_0xbc76('0x32')]){return _0x26132c(new Error(_0xbc76('0x73')));}if(_0xbc76('0x72')==typeof _0x3c92c0['version']){return _0x26132c(new Error('Invalid\x20manifest:\x20version\x20not\x20specified'));}if(_0xbc76('0x72')==typeof _0x3c92c0[_0xbc76('0x74')]){return _0x26132c(new Error(_0xbc76('0x75')));}if(_0x3c92c0['type']===_0xbc76('0x76')){if(_0xbc76('0x72')==typeof _0x3c92c0[_0xbc76('0x74')][_0xbc76('0x77')]){return _0x26132c(new Error(_0xbc76('0x78')));}if(_0xbc76('0x72')==typeof _0x3c92c0[_0xbc76('0x74')][_0xbc76('0x77')][_0xbc76('0x79')]&&_0xbc76('0x72')==typeof _0x3c92c0[_0xbc76('0x74')][_0xbc76('0x77')][_0xbc76('0x7a')]){return _0x26132c(new Error(_0xbc76('0x7b')));}}else if(_0x3c92c0['type']===_0xbc76('0x7c')){if(_0xbc76('0x72')==typeof _0x3c92c0[_0xbc76('0x74')][_0xbc76('0x7d')]){return _0x26132c(new Error('Invalid\x20manifest:\x20script\x20name\x20missing'));}if('undefined'==typeof _0x3c92c0[_0xbc76('0x74')][_0xbc76('0x7e')]){return _0x26132c(new Error(_0xbc76('0x7f')));}}else{return _0x26132c(new Error(_0xbc76('0x80')));}var _0x3c5a3d=_0x3c92c0[_0xbc76('0x2c')];var _0x3cb9cb=_0x3c92c0['description'];var _0x3cb03e=_0x3c92c0[_0xbc76('0x32')];var _0x55c89f=_0x3c92c0[_0xbc76('0x81')]?_0x3c92c0['sidebar']:_0xbc76('0x82');var _0x25a767=_0x3c92c0[_0xbc76('0x83')]?_0x3c92c0[_0xbc76('0x83')]:'icon-apps';var _0x539056='';var _0x5bcb6e='';var _0x550240='';var _0x5eaf29='';var _0x51ae86=_0x3c92c0[_0xbc76('0x84')];if(_0x3cb03e===_0xbc76('0x76')){if(_0xbc76('0x72')!=typeof _0x3c92c0[_0xbc76('0x74')][_0xbc76('0x77')][_0xbc76('0x79')]){var _0x2ce22a=_0x3c92c0['parameters'][_0xbc76('0x77')][_0xbc76('0x79')];if(!/^(f|ht)tps?:\/\//i[_0xbc76('0x85')](_0x2ce22a)){_0x539056=path[_0xbc76('0x4b')](_0xbc76('0x86'),_0x1275ac,_0x1d198e[0x0],_0x2ce22a);}else{_0x539056=_0x2ce22a;}}else{logger[_0xbc76('0x5f')](_0xbc76('0x87'));}if(_0xbc76('0x72')!=typeof _0x3c92c0[_0xbc76('0x74')]['views'][_0xbc76('0x7a')]){var _0x4b9a04=_0x3c92c0[_0xbc76('0x74')][_0xbc76('0x77')][_0xbc76('0x7a')];if(!/^(f|ht)tps?:\/\//i['test'](_0x4b9a04)){_0x5bcb6e=path['join'](_0xbc76('0x86'),_0x1275ac,_0x1d198e[0x0],_0x4b9a04);}else{_0x5bcb6e=_0x4b9a04;}}else{logger['info'](_0xbc76('0x88'));}}else if(_0x3cb03e===_0xbc76('0x7c')){_0x550240=_0x3c92c0[_0xbc76('0x74')]['scriptName'];_0x5eaf29=_0x3c92c0[_0xbc76('0x74')][_0xbc76('0x7e')];if(_0xbc76('0x72')!=typeof _0x3c92c0[_0xbc76('0x74')][_0xbc76('0x77')]){if(_0xbc76('0x72')!=typeof _0x3c92c0[_0xbc76('0x74')][_0xbc76('0x77')][_0xbc76('0x79')]){var _0x2ce22a=_0x3c92c0['parameters'][_0xbc76('0x77')]['admin'];if(!/^(f|ht)tps?:\/\//i['test'](_0x2ce22a)){_0x539056=path[_0xbc76('0x4b')](_0xbc76('0x86'),_0x1275ac,_0x1d198e[0x0],_0x2ce22a);}else{_0x539056=_0x2ce22a;}}if(_0xbc76('0x72')!=typeof _0x3c92c0[_0xbc76('0x74')][_0xbc76('0x77')][_0xbc76('0x7a')]){var _0x4b9a04=_0x3c92c0[_0xbc76('0x74')][_0xbc76('0x77')]['agent'];if(!/^(f|ht)tps?:\/\//i['test'](_0x4b9a04)){_0x5bcb6e=path[_0xbc76('0x4b')](_0xbc76('0x86'),_0x1275ac,_0x1d198e[0x0],_0x4b9a04);}else{_0x5bcb6e=_0x4b9a04;}}}}var _0xe27040={'name':_0x3c5a3d,'description':_0x3cb9cb,'path':path['join'](_0x1275ac,_0x1d198e[0x0]),'type':_0x3cb03e,'sidebar':_0x55c89f,'icon':_0x25a767,'adminUrl':_0x539056,'agentUrl':_0x5bcb6e,'scriptName':_0x550240,'scriptPath':_0x5eaf29,'version':_0x51ae86};removeReferences(_0x29562e,null);return db['Plugin']['create'](_0xe27040)[_0xbc76('0x25')](function(_0x43753f){var _0x2b057e={'role':_0x5cef67[_0xbc76('0x89')]['role'],'userProfileId':_0x5cef67[_0xbc76('0x89')][_0xbc76('0x8a')]};if(!_0x2b057e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2b057e[_0xbc76('0x8b')]===_0xbc76('0x8c')){var _0x232380=_0x43753f[_0xbc76('0x26')]({'plain':!![]});return db[_0xbc76('0x8d')][_0xbc76('0x49')]({'where':{'name':_0xbc76('0x27'),'userProfileId':_0x2b057e['userProfileId']},'raw':!![]})[_0xbc76('0x25')](function(_0x4420f1){if(_0x4420f1&&_0x4420f1[_0xbc76('0x8e')]===0x0){return db[_0xbc76('0x28')]['create']({'name':_0x232380['name'],'resourceId':_0x232380['id'],'type':_0x4420f1[_0xbc76('0x2c')],'sectionId':_0x4420f1['id']},{})[_0xbc76('0x25')](function(){return _0x43753f;});}else{return _0x43753f;}})[_0xbc76('0x44')](function(_0xe36a3e){logger[_0xbc76('0x2a')](_0xbc76('0x8f'),_0xe36a3e);throw _0xe36a3e;});}return _0x43753f;})['then'](respondWithResult(_0x46da20,null))[_0xbc76('0x44')](handleError(_0x46da20,null));}});}catch(_0x193782){_0x46da20[_0xbc76('0x1e')](0x1f4)[_0xbc76('0x2d')](_0x193782);}};function removeReferences(_0x3e542a,_0x22354c){try{if(_0x3e542a){fs[_0xbc76('0x90')](_0x3e542a);logger[_0xbc76('0x5f')](_0xbc76('0x91'));}if(_0x22354c){rimraf(_0x22354c,function(){});logger['info'](_0xbc76('0x92'));}}catch(_0x55c811){logger[_0xbc76('0x2a')](_0x55c811);}}exports[_0xbc76('0x23')]=function(_0x344938,_0x40f719,_0x1afeeb){return db['Plugin'][_0xbc76('0x49')]({'where':{'id':_0x344938[_0xbc76('0x46')]['id']}})[_0xbc76('0x25')](handleEntityNotFound(_0x40f719,null))[_0xbc76('0x25')](saveUpdates(_0x344938['body'],null))['then'](respondWithResult(_0x40f719,null))[_0xbc76('0x44')](handleError(_0x40f719,null));};exports['delete']=function(_0x620c7c,_0x42ac7f,_0x3a71e4){return db['Plugin'][_0xbc76('0x49')]({'where':{'id':_0x620c7c[_0xbc76('0x46')]['id']}})['then'](function(_0x42cc32){if(_0x42cc32){return _0x42cc32['destroy']();}})[_0xbc76('0x25')](function(_0x1099fb){rimraf(path['join'](config[_0xbc76('0x4c')],'server/files/plugins',path[_0xbc76('0x58')](_0x1099fb[_0xbc76('0x8')])),function(){});return _0x1099fb;})[_0xbc76('0x25')](handleEntityNotFound(_0x42ac7f,null))['then'](respondWithStatusCode(_0x42ac7f,null))['catch'](handleError(_0x42ac7f,null));};exports[_0xbc76('0x93')]=function(_0xda0458,_0x4b5a9a,_0x4e63f1){return BPromise[_0xbc76('0x94')]()[_0xbc76('0x25')](function(){if(!_0xda0458[_0xbc76('0x34')][_0xbc76('0x8')]){throw new Error(_0xbc76('0x95'));}if(!_0xda0458['query'][_0xbc76('0x96')]){throw new Error(_0xbc76('0x97'));}var _0xa9cdd3=_0xda0458['query'][_0xbc76('0x98')]?_0xda0458[_0xbc76('0x34')][_0xbc76('0x98')]+':'+_0xda0458[_0xbc76('0x34')][_0xbc76('0x96')]:'http://localhost:'+_0xda0458[_0xbc76('0x34')][_0xbc76('0x96')];var _0x248eb7=_0xda0458[_0xbc76('0x34')]['json']?_0xda0458[_0xbc76('0x34')][_0xbc76('0x99')]:!![];var _0x387e0d=_0xda0458[_0xbc76('0x34')]['encoding']?_0xda0458[_0xbc76('0x34')][_0xbc76('0x9a')]:null;var _0x422e0d={'method':_0xda0458[_0xbc76('0x9b')],'uri':util[_0xbc76('0x4d')](_0xbc76('0x9c'),_0xa9cdd3,_0xda0458['query'][_0xbc76('0x8')]),'json':_0x248eb7,'resolveWithFullResponse':!![],'encoding':_0x387e0d,'qs':_0xda0458['query']};if(_0xda0458[_0xbc76('0x9d')]){_0x422e0d['headers']=_0xda0458[_0xbc76('0x9d')];if(_0x422e0d[_0xbc76('0x9d')][_0xbc76('0x9e')]){delete _0x422e0d[_0xbc76('0x9d')][_0xbc76('0x9e')];}}if(_0x422e0d['headers'][_0xbc76('0x9f')]){delete _0x422e0d[_0xbc76('0x9d')][_0xbc76('0x9f')];}return rp(_0x422e0d);})['then'](function(_0x5af82e){if(_0x5af82e){_0x4b5a9a[_0xbc76('0xa0')](_0x5af82e['headers']);logger[_0xbc76('0x5f')](_0x5af82e['body']);if(_['endsWith'](_0xda0458[_0xbc76('0x34')][_0xbc76('0x8')],_0xbc76('0x4a'))&&_0x5af82e[_0xbc76('0xa1')]==0x1f4){return _0x4b5a9a['sendStatus'](_0x5af82e[_0xbc76('0xa1')]);}else{return _0x4b5a9a[_0xbc76('0x1e')](_0x5af82e[_0xbc76('0xa1')])['send'](_0x5af82e[_0xbc76('0x89')]);}}else{return _0x4b5a9a[_0xbc76('0x1d')](0xc8);}})[_0xbc76('0x44')](handleError(_0x4b5a9a,null));};exports[_0xbc76('0xa2')]=function(_0x24aafa,_0x2f09e9,_0x5223e3){return BPromise[_0xbc76('0x94')]()[_0xbc76('0x25')](function(){if(!_0x24aafa[_0xbc76('0x34')][_0xbc76('0x8')]){throw new Error(_0xbc76('0x95'));}if(!_0x24aafa[_0xbc76('0x34')]['port']){throw new Error(_0xbc76('0x97'));}var _0x5ef01b=_0x24aafa[_0xbc76('0x34')][_0xbc76('0x98')]?_0x24aafa[_0xbc76('0x34')]['hostname']+':'+_0x24aafa[_0xbc76('0x34')]['port']:_0xbc76('0xa3')+_0x24aafa['query']['port'];var _0x1c73ef=_0x24aafa[_0xbc76('0x34')][_0xbc76('0x99')]?_0x24aafa[_0xbc76('0x34')][_0xbc76('0x99')]:!![];var _0x21c696=_0x24aafa[_0xbc76('0x34')][_0xbc76('0x9a')]?_0x24aafa['query'][_0xbc76('0x9a')]:null;var _0x2303a8={'method':_0x24aafa[_0xbc76('0x9b')],'uri':util[_0xbc76('0x4d')]('%s%s',_0x5ef01b,_0x24aafa[_0xbc76('0x34')][_0xbc76('0x8')]),'json':_0x1c73ef,'resolveWithFullResponse':!![],'encoding':_0x21c696,'body':_0x24aafa[_0xbc76('0x89')]};if(_0x24aafa[_0xbc76('0x9d')]){_0x2303a8[_0xbc76('0x9d')]=_0x24aafa[_0xbc76('0x9d')];if(_0x2303a8[_0xbc76('0x9d')]['content-length']){delete _0x2303a8[_0xbc76('0x9d')][_0xbc76('0x9e')];}}if(_0x2303a8['headers'][_0xbc76('0x9f')]){delete _0x2303a8[_0xbc76('0x9d')]['content-type'];}return rp(_0x2303a8);})['then'](function(_0x2f94ea){if(_0x2f94ea){_0x2f09e9[_0xbc76('0xa0')](_0x2f94ea[_0xbc76('0x9d')]);logger[_0xbc76('0x5f')](_0x2f94ea[_0xbc76('0x89')]);return _0x2f09e9['status'](_0x2f94ea[_0xbc76('0xa1')])[_0xbc76('0x2d')](_0x2f94ea[_0xbc76('0x89')]);}else{return _0x2f09e9[_0xbc76('0x1d')](0xc8);}})[_0xbc76('0x44')](handleError(_0x2f09e9,null));};
\ No newline at end of file
+var _0x257a=['find','params','path','server/files/plugins','format','%s.zip','basename','createWriteStream','zip','warning','ENOENT','Error\x20while\x20generating\x20the\x20zip\x20archive','Sequelize','Error','pipe','glob','**/*','join','root','node_modules/**/*','attachments/**/*','finalize','close','existsSync','Plugin\x20not\x20found','download','unlinkSync','info','Download\x20completed','upload','file','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','isDirectory','some','manifest.json','Plugin\x20manifest\x20missing','parse','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','views','Invalid\x20manifest:\x20views\x20missing','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','description','sidebar','always','icon','html','plugins','Warning:\x20admin\x20view\x20not\x20specified','test','admin','create','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','send','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','delete','dirname','webhookGet','resolve','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','encoding','%s%s','headers','content-length','content-type','endsWith','statusCode','webhookPost','\x27PATH\x27\x20parameter\x20not\x20specified','http://localhost:','method','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','extract-zip','archiver','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./plugin.socket','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','then','get','Plugins','UserProfileResource','error','stack','name','index','map','rawAttributes','fieldName','type','key','query','filters','intersection','attributes','model','fields','length','nolimit','order','sort','filter','where','merge','VIRTUAL','options','Plugin','includeAll','include','findAll','rows','catch','keys'];(function(_0x44feb5,_0x3f7964){var _0x45e3b8=function(_0x2848be){while(--_0x2848be){_0x44feb5['push'](_0x44feb5['shift']());}};_0x45e3b8(++_0x3f7964);}(_0x257a,0x111));var _0xa257=function(_0x11cc41,_0x3c30ab){_0x11cc41=_0x11cc41-0x0;var _0x474e9e=_0x257a[_0x11cc41];return _0x474e9e;};'use strict';var emlformat=require(_0xa257('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa257('0x1'));var jsonpatch=require(_0xa257('0x2'));var rp=require(_0xa257('0x3'));var moment=require(_0xa257('0x4'));var BPromise=require(_0xa257('0x5'));var Mustache=require(_0xa257('0x6'));var util=require('util');var path=require('path');var sox=require(_0xa257('0x7'));var csv=require(_0xa257('0x8'));var ejs=require(_0xa257('0x9'));var fs=require('fs');var fs_extra=require(_0xa257('0xa'));var _=require(_0xa257('0xb'));var squel=require(_0xa257('0xc'));var crypto=require(_0xa257('0xd'));var jsforce=require(_0xa257('0xe'));var deskjs=require(_0xa257('0xf'));var toCsv=require(_0xa257('0x8'));var querystring=require(_0xa257('0x10'));var Papa=require(_0xa257('0x11'));var extract=require(_0xa257('0x12'));var rimraf=require('rimraf');var archiver=require(_0xa257('0x13'));var Redis=require(_0xa257('0x14'));var authService=require(_0xa257('0x15'));var qs=require('../../components/parsers/qs');var as=require(_0xa257('0x16'));var hardwareService=require(_0xa257('0x17'));var logger=require(_0xa257('0x18'))(_0xa257('0x19'));var utils=require(_0xa257('0x1a'));var config=require(_0xa257('0x1b'));var licenseUtil=require(_0xa257('0x1c'));var db=require(_0xa257('0x1d'))['db'];config[_0xa257('0x1e')]=_[_0xa257('0x1f')](config[_0xa257('0x1e')],{'host':_0xa257('0x20'),'port':0x18eb});var socket=require(_0xa257('0x21'))(new Redis(config[_0xa257('0x1e')]));require(_0xa257('0x22'))['register'](socket);function respondWithStatusCode(_0x2e3ca6,_0x22960b){_0x22960b=_0x22960b||0xcc;return function(_0x303c89){if(_0x303c89){return _0x2e3ca6[_0xa257('0x23')](_0x22960b);}return _0x2e3ca6[_0xa257('0x24')](_0x22960b)[_0xa257('0x25')]();};}function respondWithResult(_0x4537e8,_0x40bbd7){_0x40bbd7=_0x40bbd7||0xc8;return function(_0xde8f09){if(_0xde8f09){return _0x4537e8['status'](_0x40bbd7)[_0xa257('0x26')](_0xde8f09);}};}function respondWithFilteredResult(_0xf9d7f0,_0xb4832a){return function(_0x246d7d){if(_0x246d7d){var _0x3cca04=typeof _0xb4832a[_0xa257('0x27')]==='undefined'&&typeof _0xb4832a[_0xa257('0x28')]===_0xa257('0x29');var _0x5740c0=_0x246d7d['count'];var _0x493f8c=_0x3cca04?0x0:_0xb4832a[_0xa257('0x27')];var _0x1aa681=_0x3cca04?_0x246d7d[_0xa257('0x2a')]:_0xb4832a[_0xa257('0x27')]+_0xb4832a['limit'];var _0x59d983;if(_0x1aa681>=_0x5740c0){_0x1aa681=_0x5740c0;_0x59d983=0xc8;}else{_0x59d983=0xce;}_0xf9d7f0[_0xa257('0x24')](_0x59d983);return _0xf9d7f0[_0xa257('0x2b')](_0xa257('0x2c'),_0x493f8c+'-'+_0x1aa681+'/'+_0x5740c0)['json'](_0x246d7d);}return null;};}function patchUpdates(_0x239e27){return function(_0x3c0257){try{jsonpatch[_0xa257('0x2d')](_0x3c0257,_0x239e27,!![]);}catch(_0x39eb43){return BPromise[_0xa257('0x2e')](_0x39eb43);}return _0x3c0257[_0xa257('0x2f')]();};}function saveUpdates(_0x17c513,_0x466cc0){return function(_0xbbaad4){if(_0xbbaad4){return _0xbbaad4[_0xa257('0x30')](_0x17c513)['then'](function(_0x3c28df){return _0x3c28df;});}return null;};}function removeEntity(_0x1d4f9a,_0x5dbb74){return function(_0x45e6c5){if(_0x45e6c5){return _0x45e6c5[_0xa257('0x31')]()[_0xa257('0x32')](function(){var _0x3671bc=_0x45e6c5[_0xa257('0x33')]({'plain':!![]});var _0x35cd28=_0xa257('0x34');return db[_0xa257('0x35')][_0xa257('0x31')]({'where':{'type':_0x35cd28,'resourceId':_0x3671bc['id']}})['then'](function(){return _0x45e6c5;});})['then'](function(){_0x1d4f9a['status'](0xcc)[_0xa257('0x25')]();});}};}function handleEntityNotFound(_0x3b7390,_0x361097){return function(_0x1f0a08){if(!_0x1f0a08){_0x3b7390[_0xa257('0x23')](0x194);}return _0x1f0a08;};}function handleError(_0xda0e3c,_0xc3ad4b){_0xc3ad4b=_0xc3ad4b||0x1f4;return function(_0x4aa471){logger[_0xa257('0x36')](_0x4aa471[_0xa257('0x37')]);if(_0x4aa471[_0xa257('0x38')]){delete _0x4aa471['name'];}_0xda0e3c['status'](_0xc3ad4b)['send'](_0x4aa471);};}exports[_0xa257('0x39')]=function(_0xff5fd1,_0x2e338d){var _0x512275={},_0x569a75={},_0x243709={'count':0x0,'rows':[]};var _0x3001e9=_[_0xa257('0x3a')](db['Plugin'][_0xa257('0x3b')],function(_0x54aaf1){return{'name':_0x54aaf1[_0xa257('0x3c')],'type':_0x54aaf1[_0xa257('0x3d')][_0xa257('0x3e')]};});_0x569a75['model']=_[_0xa257('0x3a')](_0x3001e9,_0xa257('0x38'));_0x569a75[_0xa257('0x3f')]=_['keys'](_0xff5fd1['query']);_0x569a75[_0xa257('0x40')]=_[_0xa257('0x41')](_0x569a75['model'],_0x569a75['query']);_0x512275[_0xa257('0x42')]=_[_0xa257('0x41')](_0x569a75[_0xa257('0x43')],qs[_0xa257('0x44')](_0xff5fd1[_0xa257('0x3f')][_0xa257('0x44')]));_0x512275[_0xa257('0x42')]=_0x512275[_0xa257('0x42')][_0xa257('0x45')]?_0x512275[_0xa257('0x42')]:_0x569a75['model'];if(!_0xff5fd1[_0xa257('0x3f')]['hasOwnProperty'](_0xa257('0x46'))){_0x512275['limit']=qs[_0xa257('0x28')](_0xff5fd1[_0xa257('0x3f')]['limit']);_0x512275[_0xa257('0x27')]=qs['offset'](_0xff5fd1[_0xa257('0x3f')]['offset']);}_0x512275[_0xa257('0x47')]=qs[_0xa257('0x48')](_0xff5fd1[_0xa257('0x3f')][_0xa257('0x48')]);_0x512275['where']=qs[_0xa257('0x40')](_['pick'](_0xff5fd1[_0xa257('0x3f')],_0x569a75['filters']),_0x3001e9);if(_0xff5fd1[_0xa257('0x3f')][_0xa257('0x49')]){_0x512275[_0xa257('0x4a')]=_[_0xa257('0x4b')](_0x512275[_0xa257('0x4a')],{'$or':_['map'](_0x3001e9,function(_0x265e7f){if(_0x265e7f['type']!==_0xa257('0x4c')){var _0x24e1c7={};_0x24e1c7[_0x265e7f['name']]={'$like':'%'+_0xff5fd1[_0xa257('0x3f')][_0xa257('0x49')]+'%'};return _0x24e1c7;}})});}_0x512275=_['merge']({},_0x512275,_0xff5fd1[_0xa257('0x4d')]);var _0x35e560={'where':_0x512275['where']};return db[_0xa257('0x4e')]['count'](_0x35e560)[_0xa257('0x32')](function(_0x29383b){_0x243709[_0xa257('0x2a')]=_0x29383b;if(_0xff5fd1['query'][_0xa257('0x4f')]){_0x512275[_0xa257('0x50')]=[{'all':!![]}];}return db[_0xa257('0x4e')][_0xa257('0x51')](_0x512275);})[_0xa257('0x32')](function(_0x295334){_0x243709[_0xa257('0x52')]=_0x295334;return _0x243709;})[_0xa257('0x32')](respondWithFilteredResult(_0x2e338d,_0x512275))[_0xa257('0x53')](handleError(_0x2e338d,null));};exports['show']=function(_0x170dcc,_0x511294){var _0x441ac5={'raw':!![],'where':{'id':_0x170dcc['params']['id']}},_0x2a4dd5={};_0x2a4dd5[_0xa257('0x43')]=_['keys'](db['Plugin']['rawAttributes']);_0x2a4dd5['query']=_[_0xa257('0x54')](_0x170dcc[_0xa257('0x3f')]);_0x2a4dd5[_0xa257('0x40')]=_['intersection'](_0x2a4dd5['model'],_0x2a4dd5['query']);_0x441ac5[_0xa257('0x42')]=_[_0xa257('0x41')](_0x2a4dd5[_0xa257('0x43')],qs[_0xa257('0x44')](_0x170dcc['query'][_0xa257('0x44')]));_0x441ac5[_0xa257('0x42')]=_0x441ac5[_0xa257('0x42')][_0xa257('0x45')]?_0x441ac5[_0xa257('0x42')]:_0x2a4dd5[_0xa257('0x43')];if(_0x170dcc['query'][_0xa257('0x4f')]){_0x441ac5[_0xa257('0x50')]=[{'all':!![]}];}_0x441ac5=_[_0xa257('0x4b')]({},_0x441ac5,_0x170dcc[_0xa257('0x4d')]);return db[_0xa257('0x4e')][_0xa257('0x55')](_0x441ac5)[_0xa257('0x32')](handleEntityNotFound(_0x511294,null))[_0xa257('0x32')](respondWithResult(_0x511294,null))[_0xa257('0x53')](handleError(_0x511294,null));};exports['download']=function(_0x2554be,_0x56f9ae,_0x134a00){return db[_0xa257('0x4e')][_0xa257('0x55')]({'where':{'id':_0x2554be[_0xa257('0x56')]['id']},'attributes':[_0xa257('0x38'),_0xa257('0x57')],'raw':!![]})['then'](handleEntityNotFound(_0x56f9ae,null))['then'](function(_0x300423){if(_0x300423){var _0x1e63af=path['join'](config['root'],_0xa257('0x58'),util[_0xa257('0x59')](_0xa257('0x5a'),path[_0xa257('0x5b')](_0x300423[_0xa257('0x57')])));var _0x408c19=fs[_0xa257('0x5c')](_0x1e63af);var _0x2eefd0=archiver(_0xa257('0x5d'),{'zlib':{'level':0x9}});_0x2eefd0['on'](_0xa257('0x5e'),function(_0xf62213){if(_0xf62213['code']===_0xa257('0x5f')){logger[_0xa257('0x36')](_0xf62213);}else{throw new db['Sequelize']['Error'](_0xa257('0x60'));}});_0x2eefd0['on'](_0xa257('0x36'),function(_0x4ca7cc){throw new db[(_0xa257('0x61'))][(_0xa257('0x62'))](_0xa257('0x60'));});_0x2eefd0[_0xa257('0x63')](_0x408c19);_0x2eefd0[_0xa257('0x64')](_0xa257('0x65'),{'cwd':path[_0xa257('0x66')](config[_0xa257('0x67')],_0xa257('0x58'),path['dirname'](_0x300423['path'])),'ignore':[path['join'](path['basename'](_0x300423[_0xa257('0x57')]),_0xa257('0x68')),path[_0xa257('0x66')](path[_0xa257('0x5b')](_0x300423[_0xa257('0x57')]),_0xa257('0x69'))],'nodir':!![]})[_0xa257('0x6a')]();_0x408c19['on'](_0xa257('0x6b'),function(){if(!fs[_0xa257('0x6c')](_0x1e63af)){throw new db['Sequelize'][(_0xa257('0x62'))](_0xa257('0x6d'));}return _0x56f9ae[_0xa257('0x6e')](_0x1e63af,util[_0xa257('0x59')](_0xa257('0x5a'),path[_0xa257('0x5b')](_0x300423['path'])),function(_0x4f86c6){if(_0x4f86c6){throw new db['Sequelize'][(_0xa257('0x62'))]('Error\x20while\x20downloading\x20the\x20plugin');}fs[_0xa257('0x6f')](_0x1e63af);logger[_0xa257('0x70')](_0xa257('0x71'));logger['info']('Temporary\x20file\x20removed');});});}return null;})[_0xa257('0x53')](handleError(_0x56f9ae,null));};exports[_0xa257('0x72')]=function(_0x3c8ec9,_0x5e36c3,_0x368c2e){var _0x5eb9ab=path[_0xa257('0x5b')](_0x3c8ec9[_0xa257('0x73')]['filename'],path['extname'](_0x3c8ec9[_0xa257('0x73')]['filename']));var _0x3e82e4=path[_0xa257('0x66')](config['root'],_0xa257('0x58'),_0x3c8ec9[_0xa257('0x73')]['filename']);var _0x3513fe=path[_0xa257('0x66')](config['root'],'server/files/plugins',_0x5eb9ab);logger[_0xa257('0x70')](_0xa257('0x74'),_0x3e82e4);logger[_0xa257('0x70')](_0xa257('0x75'),_0x3513fe);try{fs[_0xa257('0x76')](_0x3e82e4,parseInt(_0xa257('0x77'),0x8));extract(_0x3e82e4,{'dir':_0x3513fe},function(_0xea933e){if(_0xea933e){logger[_0xa257('0x36')](_0xea933e);handleError(_0xea933e,!![]);};var _0x309a2d=fs[_0xa257('0x78')](_0x3513fe);if(_0x309a2d[_0xa257('0x45')]>0x1){removeReferences(_0x3e82e4,_0x3513fe);logger['error'](_0xa257('0x79'));return _0x368c2e(new Error(_0xa257('0x79')));}var _0x5602f7=fs['lstatSync'](path['join'](_0x3513fe,_0x309a2d[0x0]));if(_0x5602f7['isFile']()){removeReferences(_0x3e82e4,_0x3513fe);logger['error']('Invalid\x20plugin\x20structure');return _0x368c2e(new Error(_0xa257('0x79')));}if(_0x5602f7[_0xa257('0x7a')]()){var _0x3ad7f2=fs[_0xa257('0x78')](path['join'](_0x3513fe,_0x309a2d[0x0]));if(_0x3ad7f2[_0xa257('0x45')]===0x0){removeReferences(_0x3e82e4,_0x3513fe);logger[_0xa257('0x36')]('Invalid\x20plugin\x20structure');return _0x368c2e(new Error(_0xa257('0x79')));}var _0x534010=_0x3ad7f2[_0xa257('0x7b')](function(_0x580885){return _0x580885===_0xa257('0x7c');});if(!_0x534010){return _0x368c2e(new Error(_0xa257('0x7d')));}var _0xf4b00d=fs['readFileSync'](path['join'](_0x3513fe,_0x309a2d[0x0],_0xa257('0x7c')));var _0x394bac=JSON[_0xa257('0x7e')](_0xf4b00d);if('undefined'==typeof _0x394bac['name']){return _0x368c2e(new Error(_0xa257('0x7f')));}if(_0xa257('0x29')==typeof _0x394bac[_0xa257('0x3d')]){return _0x368c2e(new Error(_0xa257('0x80')));}if('undefined'==typeof _0x394bac[_0xa257('0x81')]){return _0x368c2e(new Error(_0xa257('0x82')));}if('undefined'==typeof _0x394bac[_0xa257('0x83')]){return _0x368c2e(new Error('Invalid\x20manifest:\x20parameters\x20missing'));}if(_0x394bac[_0xa257('0x3d')]==='html'){if(_0xa257('0x29')==typeof _0x394bac[_0xa257('0x83')][_0xa257('0x84')]){return _0x368c2e(new Error(_0xa257('0x85')));}if(_0xa257('0x29')==typeof _0x394bac[_0xa257('0x83')][_0xa257('0x84')]['admin']&&_0xa257('0x29')==typeof _0x394bac['parameters']['views'][_0xa257('0x86')]){return _0x368c2e(new Error(_0xa257('0x87')));}}else if(_0x394bac[_0xa257('0x3d')]===_0xa257('0x88')){if(_0xa257('0x29')==typeof _0x394bac['parameters'][_0xa257('0x89')]){return _0x368c2e(new Error(_0xa257('0x8a')));}if('undefined'==typeof _0x394bac[_0xa257('0x83')][_0xa257('0x8b')]){return _0x368c2e(new Error(_0xa257('0x8c')));}}else{return _0x368c2e(new Error('Invalid\x20manifest:\x20invalid\x20type'));}var _0x2161c2=_0x394bac[_0xa257('0x38')];var _0x131252=_0x394bac[_0xa257('0x8d')];var _0x3fbb1a=_0x394bac[_0xa257('0x3d')];var _0x26a0a1=_0x394bac[_0xa257('0x8e')]?_0x394bac[_0xa257('0x8e')]:_0xa257('0x8f');var _0xd556b1=_0x394bac['icon']?_0x394bac[_0xa257('0x90')]:'icon-apps';var _0x52430f='';var _0x520e05='';var _0x13250c='';var _0x5c1b56='';var _0x165923=_0x394bac[_0xa257('0x81')];if(_0x3fbb1a===_0xa257('0x91')){if('undefined'!=typeof _0x394bac[_0xa257('0x83')][_0xa257('0x84')]['admin']){var _0x4265ab=_0x394bac[_0xa257('0x83')][_0xa257('0x84')]['admin'];if(!/^(f|ht)tps?:\/\//i['test'](_0x4265ab)){_0x52430f=path[_0xa257('0x66')](_0xa257('0x92'),_0x5eb9ab,_0x309a2d[0x0],_0x4265ab);}else{_0x52430f=_0x4265ab;}}else{logger[_0xa257('0x70')](_0xa257('0x93'));}if('undefined'!=typeof _0x394bac[_0xa257('0x83')][_0xa257('0x84')]['agent']){var _0x27f636=_0x394bac[_0xa257('0x83')][_0xa257('0x84')][_0xa257('0x86')];if(!/^(f|ht)tps?:\/\//i[_0xa257('0x94')](_0x27f636)){_0x520e05=path[_0xa257('0x66')](_0xa257('0x92'),_0x5eb9ab,_0x309a2d[0x0],_0x27f636);}else{_0x520e05=_0x27f636;}}else{logger[_0xa257('0x70')]('Warning:\x20agent\x20view\x20not\x20specified');}}else if(_0x3fbb1a===_0xa257('0x88')){_0x13250c=_0x394bac[_0xa257('0x83')][_0xa257('0x89')];_0x5c1b56=_0x394bac[_0xa257('0x83')][_0xa257('0x8b')];if(_0xa257('0x29')!=typeof _0x394bac[_0xa257('0x83')][_0xa257('0x84')]){if(_0xa257('0x29')!=typeof _0x394bac[_0xa257('0x83')][_0xa257('0x84')][_0xa257('0x95')]){var _0x4265ab=_0x394bac['parameters'][_0xa257('0x84')]['admin'];if(!/^(f|ht)tps?:\/\//i[_0xa257('0x94')](_0x4265ab)){_0x52430f=path[_0xa257('0x66')](_0xa257('0x92'),_0x5eb9ab,_0x309a2d[0x0],_0x4265ab);}else{_0x52430f=_0x4265ab;}}if(_0xa257('0x29')!=typeof _0x394bac[_0xa257('0x83')][_0xa257('0x84')][_0xa257('0x86')]){var _0x27f636=_0x394bac[_0xa257('0x83')]['views'][_0xa257('0x86')];if(!/^(f|ht)tps?:\/\//i[_0xa257('0x94')](_0x27f636)){_0x520e05=path['join']('plugins',_0x5eb9ab,_0x309a2d[0x0],_0x27f636);}else{_0x520e05=_0x27f636;}}}}var _0x1d4303={'name':_0x2161c2,'description':_0x131252,'path':path[_0xa257('0x66')](_0x5eb9ab,_0x309a2d[0x0]),'type':_0x3fbb1a,'sidebar':_0x26a0a1,'icon':_0xd556b1,'adminUrl':_0x52430f,'agentUrl':_0x520e05,'scriptName':_0x13250c,'scriptPath':_0x5c1b56,'version':_0x165923};removeReferences(_0x3e82e4,null);return db[_0xa257('0x4e')][_0xa257('0x96')](_0x1d4303)['then'](function(_0x289201){var _0x11f09b={'role':_0x3c8ec9[_0xa257('0x97')]['role'],'userProfileId':_0x3c8ec9[_0xa257('0x97')][_0xa257('0x98')]};if(!_0x11f09b)throw new Error(_0xa257('0x99'));if(_0x11f09b[_0xa257('0x9a')]===_0xa257('0x9b')){var _0xd51b75=_0x289201[_0xa257('0x33')]({'plain':!![]});return db[_0xa257('0x9c')][_0xa257('0x55')]({'where':{'name':_0xa257('0x34'),'userProfileId':_0x11f09b[_0xa257('0x98')]},'raw':!![]})[_0xa257('0x32')](function(_0x26494a){if(_0x26494a&&_0x26494a['autoAssociation']===0x0){return db['UserProfileResource'][_0xa257('0x96')]({'name':_0xd51b75['name'],'resourceId':_0xd51b75['id'],'type':_0x26494a['name'],'sectionId':_0x26494a['id']},{})[_0xa257('0x32')](function(){return _0x289201;});}else{return _0x289201;}})[_0xa257('0x53')](function(_0x19903b){logger[_0xa257('0x36')](_0xa257('0x9d'),_0x19903b);throw _0x19903b;});}return _0x289201;})[_0xa257('0x32')](respondWithResult(_0x5e36c3,null))[_0xa257('0x53')](handleError(_0x5e36c3,null));}});}catch(_0x439bbc){_0x5e36c3[_0xa257('0x24')](0x1f4)[_0xa257('0x9e')](_0x439bbc);}};function removeReferences(_0x42fa54,_0x3e09f5){try{if(_0x42fa54){fs['unlinkSync'](_0x42fa54);logger['info'](_0xa257('0x9f'));}if(_0x3e09f5){rimraf(_0x3e09f5,function(){});logger[_0xa257('0x70')](_0xa257('0xa0'));}}catch(_0x55566f){logger[_0xa257('0x36')](_0x55566f);}}exports['update']=function(_0x2cc3bf,_0x962381,_0x5db64c){return db[_0xa257('0x4e')][_0xa257('0x55')]({'where':{'id':_0x2cc3bf[_0xa257('0x56')]['id']}})['then'](handleEntityNotFound(_0x962381,null))[_0xa257('0x32')](saveUpdates(_0x2cc3bf[_0xa257('0x97')],null))[_0xa257('0x32')](respondWithResult(_0x962381,null))[_0xa257('0x53')](handleError(_0x962381,null));};exports[_0xa257('0xa1')]=function(_0x5f5b71,_0x2740d6,_0xfd039b){return db['Plugin']['find']({'where':{'id':_0x5f5b71[_0xa257('0x56')]['id']}})[_0xa257('0x32')](function(_0x25e603){if(_0x25e603){return _0x25e603[_0xa257('0x31')]();}})[_0xa257('0x32')](function(_0x3d0691){rimraf(path[_0xa257('0x66')](config[_0xa257('0x67')],_0xa257('0x58'),path[_0xa257('0xa2')](_0x3d0691[_0xa257('0x57')])),function(){});return _0x3d0691;})[_0xa257('0x32')](handleEntityNotFound(_0x2740d6,null))[_0xa257('0x32')](respondWithStatusCode(_0x2740d6,null))[_0xa257('0x53')](handleError(_0x2740d6,null));};exports[_0xa257('0xa3')]=function(_0x548881,_0x422a88,_0x19eb75){return BPromise[_0xa257('0xa4')]()[_0xa257('0x32')](function(){if(!_0x548881['query'][_0xa257('0x57')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x548881[_0xa257('0x3f')][_0xa257('0xa5')]){throw new Error(_0xa257('0xa6'));}var _0x19a2fd=_0x548881[_0xa257('0x3f')][_0xa257('0xa7')]?_0x548881[_0xa257('0x3f')][_0xa257('0xa7')]+':'+_0x548881[_0xa257('0x3f')]['port']:'http://localhost:'+_0x548881['query'][_0xa257('0xa5')];var _0x1e0193=_0x548881[_0xa257('0x3f')]['json']?_0x548881[_0xa257('0x3f')][_0xa257('0x26')]:!![];var _0x21141=_0x548881[_0xa257('0x3f')][_0xa257('0xa8')]?_0x548881[_0xa257('0x3f')][_0xa257('0xa8')]:null;var _0xaeaa50={'method':_0x548881['method'],'uri':util[_0xa257('0x59')](_0xa257('0xa9'),_0x19a2fd,_0x548881[_0xa257('0x3f')][_0xa257('0x57')]),'json':_0x1e0193,'resolveWithFullResponse':!![],'encoding':_0x21141,'qs':_0x548881[_0xa257('0x3f')]};if(_0x548881['headers']){_0xaeaa50[_0xa257('0xaa')]=_0x548881[_0xa257('0xaa')];if(_0xaeaa50['headers'][_0xa257('0xab')]){delete _0xaeaa50[_0xa257('0xaa')][_0xa257('0xab')];}}if(_0xaeaa50[_0xa257('0xaa')]['content-type']){delete _0xaeaa50[_0xa257('0xaa')][_0xa257('0xac')];}return rp(_0xaeaa50);})[_0xa257('0x32')](function(_0x237e92){if(_0x237e92){_0x422a88[_0xa257('0x2b')](_0x237e92['headers']);logger[_0xa257('0x70')](_0x237e92[_0xa257('0x97')]);if(_[_0xa257('0xad')](_0x548881[_0xa257('0x3f')][_0xa257('0x57')],_0xa257('0x6e'))&&_0x237e92['statusCode']==0x1f4){return _0x422a88[_0xa257('0x23')](_0x237e92[_0xa257('0xae')]);}else{return _0x422a88[_0xa257('0x24')](_0x237e92[_0xa257('0xae')])['send'](_0x237e92[_0xa257('0x97')]);}}else{return _0x422a88[_0xa257('0x23')](0xc8);}})[_0xa257('0x53')](handleError(_0x422a88,null));};exports[_0xa257('0xaf')]=function(_0x34fbac,_0x2d4fe4,_0x9023b5){return BPromise[_0xa257('0xa4')]()['then'](function(){if(!_0x34fbac[_0xa257('0x3f')][_0xa257('0x57')]){throw new Error(_0xa257('0xb0'));}if(!_0x34fbac[_0xa257('0x3f')][_0xa257('0xa5')]){throw new Error(_0xa257('0xa6'));}var _0x511c17=_0x34fbac[_0xa257('0x3f')][_0xa257('0xa7')]?_0x34fbac['query']['hostname']+':'+_0x34fbac[_0xa257('0x3f')]['port']:_0xa257('0xb1')+_0x34fbac[_0xa257('0x3f')]['port'];var _0x1f7631=_0x34fbac['query'][_0xa257('0x26')]?_0x34fbac[_0xa257('0x3f')][_0xa257('0x26')]:!![];var _0x4f99d0=_0x34fbac[_0xa257('0x3f')]['encoding']?_0x34fbac[_0xa257('0x3f')][_0xa257('0xa8')]:null;var _0x38203c={'method':_0x34fbac[_0xa257('0xb2')],'uri':util[_0xa257('0x59')](_0xa257('0xa9'),_0x511c17,_0x34fbac[_0xa257('0x3f')]['path']),'json':_0x1f7631,'resolveWithFullResponse':!![],'encoding':_0x4f99d0,'body':_0x34fbac[_0xa257('0x97')]};if(_0x34fbac['headers']){_0x38203c[_0xa257('0xaa')]=_0x34fbac[_0xa257('0xaa')];if(_0x38203c[_0xa257('0xaa')]['content-length']){delete _0x38203c[_0xa257('0xaa')][_0xa257('0xab')];}}if(_0x38203c[_0xa257('0xaa')][_0xa257('0xac')]){delete _0x38203c['headers']['content-type'];}return rp(_0x38203c);})[_0xa257('0x32')](function(_0x4aca07){if(_0x4aca07){_0x2d4fe4[_0xa257('0x2b')](_0x4aca07[_0xa257('0xaa')]);logger[_0xa257('0x70')](_0x4aca07['body']);return _0x2d4fe4[_0xa257('0x24')](_0x4aca07[_0xa257('0xae')])[_0xa257('0x9e')](_0x4aca07[_0xa257('0x97')]);}else{return _0x2d4fe4['sendStatus'](0xc8);}})['catch'](handleError(_0x2d4fe4,null));};
\ No newline at end of file
index 1d2290a..ce11068 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf3a7=['hasOwnProperty','hook','exports','../../mysqldb','Plugin','setMaxListeners','save','update','remove','emit'];(function(_0xe43595,_0x1712ef){var _0x27c695=function(_0x2c3ea5){while(--_0x2c3ea5){_0xe43595['push'](_0xe43595['shift']());}};_0x27c695(++_0x1712ef);}(_0xf3a7,0x99));var _0x7f3a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf3a7[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require('events');var Plugin=require(_0x7f3a('0x0'))['db'][_0x7f3a('0x1')];var PluginEvents=new EventEmitter();PluginEvents[_0x7f3a('0x2')](0x0);var events={'afterCreate':_0x7f3a('0x3'),'afterUpdate':_0x7f3a('0x4'),'afterDestroy':_0x7f3a('0x5')};function emitEvent(_0x3dae59){return function(_0x332a7a,_0x25cdee,_0x3285ad){PluginEvents['emit'](_0x3dae59+':'+_0x332a7a['id'],_0x332a7a);PluginEvents[_0x7f3a('0x6')](_0x3dae59,_0x332a7a);_0x3285ad(null);};}for(var e in events){if(events[_0x7f3a('0x7')](e)){var event=events[e];Plugin[_0x7f3a('0x8')](e,emitEvent(event));}}module[_0x7f3a('0x9')]=PluginEvents;
\ No newline at end of file
+var _0x9c63=['hasOwnProperty','hook','exports','events','../../mysqldb','Plugin','setMaxListeners','save','remove','emit'];(function(_0x5c8827,_0x5bc5d7){var _0x50ffd5=function(_0x4121bc){while(--_0x4121bc){_0x5c8827['push'](_0x5c8827['shift']());}};_0x50ffd5(++_0x5bc5d7);}(_0x9c63,0x1a7));var _0x39c6=function(_0x3f2cf8,_0x1a4511){_0x3f2cf8=_0x3f2cf8-0x0;var _0x48205a=_0x9c63[_0x3f2cf8];return _0x48205a;};'use strict';var EventEmitter=require(_0x39c6('0x0'));var Plugin=require(_0x39c6('0x1'))['db'][_0x39c6('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0x39c6('0x3')](0x0);var events={'afterCreate':_0x39c6('0x4'),'afterUpdate':'update','afterDestroy':_0x39c6('0x5')};function emitEvent(_0x3061bc){return function(_0x521670,_0x59c413,_0x562c8f){PluginEvents[_0x39c6('0x6')](_0x3061bc+':'+_0x521670['id'],_0x521670);PluginEvents[_0x39c6('0x6')](_0x3061bc,_0x521670);_0x562c8f(null);};}for(var e in events){if(events[_0x39c6('0x7')](e)){var event=events[e];Plugin[_0x39c6('0x8')](e,emitEvent(event));}}module[_0x39c6('0x9')]=PluginEvents;
\ No newline at end of file
index c65caf7..cf843ac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe747=['request-promise','path','rimraf','../../config/environment','./plugin.attributes','define','Plugin','lodash','util','api'];(function(_0xc8a931,_0x260690){var _0x28bd27=function(_0x591b9f){while(--_0x591b9f){_0xc8a931['push'](_0xc8a931['shift']());}};_0x28bd27(++_0x260690);}(_0xe747,0x13d));var _0x7e74=function(_0x3d21cf,_0x58a53e){_0x3d21cf=_0x3d21cf-0x0;var _0xeb18b1=_0xe747[_0x3d21cf];return _0xeb18b1;};'use strict';var _=require(_0x7e74('0x0'));var util=require(_0x7e74('0x1'));var logger=require('../../config/logger')(_0x7e74('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x7e74('0x3'));var fs=require('fs');var path=require(_0x7e74('0x4'));var rimraf=require(_0x7e74('0x5'));var config=require(_0x7e74('0x6'));var attributes=require(_0x7e74('0x7'));module['exports']=function(_0x33b887,_0x141853){return _0x33b887[_0x7e74('0x8')](_0x7e74('0x9'),attributes,{'tableName':'plugins','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc4aa=['plugins','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./plugin.attributes','define'];(function(_0x3bef2c,_0x5a86fd){var _0x331503=function(_0x463430){while(--_0x463430){_0x3bef2c['push'](_0x3bef2c['shift']());}};_0x331503(++_0x5a86fd);}(_0xc4aa,0x1a1));var _0xac4a=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0xc4aa[_0x3511d3];return _0x5d6321;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var logger=require(_0xac4a('0x2'))(_0xac4a('0x3'));var moment=require(_0xac4a('0x4'));var BPromise=require(_0xac4a('0x5'));var rp=require(_0xac4a('0x6'));var fs=require('fs');var path=require(_0xac4a('0x7'));var rimraf=require(_0xac4a('0x8'));var config=require(_0xac4a('0x9'));var attributes=require(_0xac4a('0xa'));module['exports']=function(_0x404681,_0x5c543a){return _0x404681[_0xac4a('0xb')]('Plugin',attributes,{'tableName':_0xac4a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 50edc07..901d303 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6bc9=['request','then','Plugin,\x20%s,\x20%s','request\x20sent','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreatePlugin','Plugin','create','options','raw','debug','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','redis','defaults','localhost','./plugin.socket','register'];(function(_0x3fd65f,_0x779dba){var _0x4d68a0=function(_0x1a9d07){while(--_0x1a9d07){_0x3fd65f['push'](_0x3fd65f['shift']());}};_0x4d68a0(++_0x779dba);}(_0x6bc9,0x1cc));var _0x96bc=function(_0x5e2751,_0x518a55){_0x5e2751=_0x5e2751-0x0;var _0x139a39=_0x6bc9[_0x5e2751];return _0x139a39;};'use strict';var _=require(_0x96bc('0x0'));var util=require(_0x96bc('0x1'));var moment=require(_0x96bc('0x2'));var BPromise=require(_0x96bc('0x3'));var rs=require(_0x96bc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x96bc('0x5'))['db'];var utils=require(_0x96bc('0x6'));var logger=require(_0x96bc('0x7'))(_0x96bc('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x96bc('0x9')][_0x96bc('0xa')]({'port':0x232a});config[_0x96bc('0xb')]=_[_0x96bc('0xc')](config[_0x96bc('0xb')],{'host':_0x96bc('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x96bc('0xb')]));require(_0x96bc('0xe'))[_0x96bc('0xf')](socket);function respondWithRpcPromise(_0x2cbbd3,_0x452b58,_0x121aa8){return new BPromise(function(_0x4b6886,_0xe9f06e){return client[_0x96bc('0x10')](_0x2cbbd3,_0x121aa8)[_0x96bc('0x11')](function(_0x64e908){logger['info'](_0x96bc('0x12'),_0x452b58,_0x96bc('0x13'));logger['debug'](_0x96bc('0x14'),_0x452b58,_0x96bc('0x13'),JSON[_0x96bc('0x15')](_0x64e908));if(_0x64e908[_0x96bc('0x16')]){if(_0x64e908['error'][_0x96bc('0x17')]===0x1f4){logger['error'](_0x96bc('0x12'),_0x452b58,_0x64e908['error'][_0x96bc('0x18')]);return _0xe9f06e(_0x64e908[_0x96bc('0x16')][_0x96bc('0x18')]);}logger[_0x96bc('0x16')](_0x96bc('0x12'),_0x452b58,_0x64e908[_0x96bc('0x16')][_0x96bc('0x18')]);return _0x4b6886(_0x64e908[_0x96bc('0x16')][_0x96bc('0x18')]);}else{logger[_0x96bc('0x19')](_0x96bc('0x12'),_0x452b58,'request\x20sent');_0x4b6886(_0x64e908[_0x96bc('0x1a')][_0x96bc('0x18')]);}})[_0x96bc('0x1b')](function(_0x46e987){logger['error'](_0x96bc('0x12'),_0x452b58,_0x46e987);_0xe9f06e(_0x46e987);});});}exports[_0x96bc('0x1c')]=function(_0x2376d5){var _0x1ca922=this;return new Promise(function(_0x1e4715,_0x394cbf){return db[_0x96bc('0x1d')][_0x96bc('0x1e')](_0x2376d5['body'],{'raw':_0x2376d5[_0x96bc('0x1f')]?_0x2376d5[_0x96bc('0x1f')][_0x96bc('0x20')]===undefined?!![]:![]:!![]})[_0x96bc('0x11')](function(_0x3c3d4e){logger[_0x96bc('0x19')](_0x96bc('0x1c'),_0x2376d5);logger[_0x96bc('0x21')](_0x96bc('0x1c'),_0x2376d5,JSON['stringify'](_0x3c3d4e));_0x1e4715(_0x3c3d4e);})['catch'](function(_0x45e8f1){logger[_0x96bc('0x16')](_0x96bc('0x1c'),_0x45e8f1[_0x96bc('0x18')],_0x2376d5);_0x394cbf(_0x1ca922[_0x96bc('0x16')](0x1f4,_0x45e8f1[_0x96bc('0x18')]));});});};
\ No newline at end of file
+var _0x1a9e=['defaults','redis','socket.io-emitter','./plugin.socket','register','then','info','Plugin,\x20%s,\x20%s','request\x20sent','debug','error','code','message','CreatePlugin','create','body','options','raw','stringify','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x3dd410,_0x5a29c6){var _0x37eaef=function(_0x445719){while(--_0x445719){_0x3dd410['push'](_0x3dd410['shift']());}};_0x37eaef(++_0x5a29c6);}(_0x1a9e,0x188));var _0xe1a9=function(_0x3179b2,_0x311eb2){_0x3179b2=_0x3179b2-0x0;var _0x5ce88f=_0x1a9e[_0x3179b2];return _0x5ce88f;};'use strict';var _=require(_0xe1a9('0x0'));var util=require(_0xe1a9('0x1'));var moment=require('moment');var BPromise=require(_0xe1a9('0x2'));var rs=require(_0xe1a9('0x3'));var fs=require('fs');var Redis=require(_0xe1a9('0x4'));var db=require(_0xe1a9('0x5'))['db'];var utils=require(_0xe1a9('0x6'));var logger=require(_0xe1a9('0x7'))(_0xe1a9('0x8'));var config=require('../../config/environment');var jayson=require(_0xe1a9('0x9'));var client=jayson[_0xe1a9('0xa')]['http']({'port':0x232a});config['redis']=_[_0xe1a9('0xb')](config[_0xe1a9('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xe1a9('0xd'))(new Redis(config[_0xe1a9('0xc')]));require(_0xe1a9('0xe'))[_0xe1a9('0xf')](socket);function respondWithRpcPromise(_0x20565c,_0x5abb84,_0x1d95c6){return new BPromise(function(_0x566560,_0x2cc896){return client['request'](_0x20565c,_0x1d95c6)[_0xe1a9('0x10')](function(_0x177909){logger[_0xe1a9('0x11')](_0xe1a9('0x12'),_0x5abb84,_0xe1a9('0x13'));logger[_0xe1a9('0x14')]('Plugin,\x20%s,\x20%s,\x20%s',_0x5abb84,_0xe1a9('0x13'),JSON['stringify'](_0x177909));if(_0x177909['error']){if(_0x177909[_0xe1a9('0x15')][_0xe1a9('0x16')]===0x1f4){logger['error'](_0xe1a9('0x12'),_0x5abb84,_0x177909[_0xe1a9('0x15')][_0xe1a9('0x17')]);return _0x2cc896(_0x177909[_0xe1a9('0x15')]['message']);}logger[_0xe1a9('0x15')]('Plugin,\x20%s,\x20%s',_0x5abb84,_0x177909[_0xe1a9('0x15')][_0xe1a9('0x17')]);return _0x566560(_0x177909[_0xe1a9('0x15')][_0xe1a9('0x17')]);}else{logger[_0xe1a9('0x11')](_0xe1a9('0x12'),_0x5abb84,_0xe1a9('0x13'));_0x566560(_0x177909['result'][_0xe1a9('0x17')]);}})['catch'](function(_0x5235ee){logger[_0xe1a9('0x15')](_0xe1a9('0x12'),_0x5abb84,_0x5235ee);_0x2cc896(_0x5235ee);});});}exports[_0xe1a9('0x18')]=function(_0x48a3de){var _0x4e217e=this;return new Promise(function(_0x3dc1ee,_0x3cb20f){return db['Plugin'][_0xe1a9('0x19')](_0x48a3de[_0xe1a9('0x1a')],{'raw':_0x48a3de[_0xe1a9('0x1b')]?_0x48a3de[_0xe1a9('0x1b')][_0xe1a9('0x1c')]===undefined?!![]:![]:!![]})[_0xe1a9('0x10')](function(_0x44218d){logger[_0xe1a9('0x11')](_0xe1a9('0x18'),_0x48a3de);logger[_0xe1a9('0x14')](_0xe1a9('0x18'),_0x48a3de,JSON[_0xe1a9('0x1d')](_0x44218d));_0x3dc1ee(_0x44218d);})[_0xe1a9('0x1e')](function(_0x3c5504){logger[_0xe1a9('0x15')](_0xe1a9('0x18'),_0x3c5504[_0xe1a9('0x17')],_0x48a3de);_0x3cb20f(_0x4e217e['error'](0x1f4,_0x3c5504[_0xe1a9('0x17')]));});});};
\ No newline at end of file
index e9f0022..4800040 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0f6d=['update','emit','removeListener','register','length','./plugin.events','save','remove'];(function(_0x23523d,_0xd160b6){var _0x53fe22=function(_0x5dba8c){while(--_0x5dba8c){_0x23523d['push'](_0x23523d['shift']());}};_0x53fe22(++_0xd160b6);}(_0x0f6d,0x1c5));var _0xd0f6=function(_0x57474e,_0x4178b8){_0x57474e=_0x57474e-0x0;var _0xfaae8c=_0x0f6d[_0x57474e];return _0xfaae8c;};'use strict';var PluginEvents=require(_0xd0f6('0x0'));var events=[_0xd0f6('0x1'),_0xd0f6('0x2'),_0xd0f6('0x3')];function createListener(_0x53bbd7,_0x542a80){return function(_0x6bb8fc){_0x542a80[_0xd0f6('0x4')](_0x53bbd7,_0x6bb8fc);};}function removeListener(_0x125198,_0x4d951d){return function(){PluginEvents[_0xd0f6('0x5')](_0x125198,_0x4d951d);};}exports[_0xd0f6('0x6')]=function(_0x75217a){for(var _0x27d41a=0x0,_0x214b4d=events[_0xd0f6('0x7')];_0x27d41a<_0x214b4d;_0x27d41a++){var _0x1d34ad=events[_0x27d41a];var _0x2ba35a=createListener('plugin:'+_0x1d34ad,_0x75217a);PluginEvents['on'](_0x1d34ad,_0x2ba35a);}};
\ No newline at end of file
+var _0xaec3=['plugin:','./plugin.events','save','remove','update','emit','register'];(function(_0xf71120,_0x25b7f9){var _0xbe2fd3=function(_0x1acbdd){while(--_0x1acbdd){_0xf71120['push'](_0xf71120['shift']());}};_0xbe2fd3(++_0x25b7f9);}(_0xaec3,0xb0));var _0x3aec=function(_0x32d307,_0x2edaf2){_0x32d307=_0x32d307-0x0;var _0x5bd95a=_0xaec3[_0x32d307];return _0x5bd95a;};'use strict';var PluginEvents=require(_0x3aec('0x0'));var events=[_0x3aec('0x1'),_0x3aec('0x2'),_0x3aec('0x3')];function createListener(_0xac741e,_0x120c5f){return function(_0x199833){_0x120c5f[_0x3aec('0x4')](_0xac741e,_0x199833);};}function removeListener(_0x3c39e0,_0x385674){return function(){PluginEvents['removeListener'](_0x3c39e0,_0x385674);};}exports[_0x3aec('0x5')]=function(_0x391abb){for(var _0x325609=0x0,_0x1c45dc=events['length'];_0x325609<_0x1c45dc;_0x325609++){var _0x429d4f=events[_0x325609];var _0x485169=createListener(_0x3aec('0x6')+_0x429d4f,_0x391abb);PluginEvents['on'](_0x429d4f,_0x485169);}};
\ No newline at end of file
index e3536e7..a518827 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(_0x536076,_0x4c5460){var _0x246902=function(_0x3101ca){while(--_0x3101ca){_0x536076['push'](_0x536076['shift']());}};_0x246902(++_0x4c5460);}(_0xa9e0,0x123));var _0x0a9e=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xa9e0[_0x19e35c];return _0x3e1fe8;};'use strict';var express=require(_0x0a9e('0x0'));var router=express[_0x0a9e('0x1')]();var auth=require(_0x0a9e('0x2'));var controller=require('./pm2.controller');router['get']('/',auth[_0x0a9e('0x3')](),controller['index']);router[_0x0a9e('0x4')](_0x0a9e('0x5'),auth[_0x0a9e('0x3')](),controller[_0x0a9e('0x6')]);router[_0x0a9e('0x7')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x8')]);router[_0x0a9e('0x9')](_0x0a9e('0x5'),auth['isAuthenticated'](),controller['update']);router[_0x0a9e('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);module[_0x0a9e('0xc')]=router;
\ No newline at end of file
+var _0xa9e0=['create','put','delete','destroy','exports','express','Router','../../components/auth/service','isAuthenticated','get','/:id','show','post'];(function(_0x822d13,_0xf4287f){var _0x500c63=function(_0x5a28a1){while(--_0x5a28a1){_0x822d13['push'](_0x822d13['shift']());}};_0x500c63(++_0xf4287f);}(_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 aa5cc75..fb81dba 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x579c=['express','catch','show','describe','params','body','script','join','../../files/plugins','cwd','chdir','dirname','start','status','Missing\x20name\x20and/or\x20path','restart','stop','hasOwnProperty','Unknown\x20status','destroy','delete','dump','Unknown\x20id','lodash','../../config/pm2','../../config/logger','api','path','exec','sendStatus','json','error','stack','name','send','npm\x20install','info','index','then'];(function(_0x4d6a98,_0x1c82ec){var _0x371554=function(_0x5635ba){while(--_0x5635ba){_0x4d6a98['push'](_0x4d6a98['shift']());}};_0x371554(++_0x1c82ec);}(_0x579c,0xda));var _0xc579=function(_0x243266,_0x5aa8a3){_0x243266=_0x243266-0x0;var _0x50a8a=_0x579c[_0x243266];return _0x50a8a;};'use strict';var _=require(_0xc579('0x0'));var pm2=require(_0xc579('0x1'));var logger=require(_0xc579('0x2'))(_0xc579('0x3'));var path=require(_0xc579('0x4'));var exec=require('child_process')[_0xc579('0x5')];var BPromise=require('bluebird');function handleEntityNotFound(_0x21a0a2,_0x3b913c){return function(_0x1ce62b){if(!_0x1ce62b){_0x21a0a2[_0xc579('0x6')](0x194);;}return _0x1ce62b;};}function respondWithResult(_0x124ee5,_0x1bd276){_0x1bd276=_0x1bd276||0xc8;return function(_0x2e451b){if(_0x2e451b){return _0x124ee5['status'](_0x1bd276)[_0xc579('0x7')](_0x2e451b);}return null;};}function handleError(_0x293c4a,_0x2ce949){_0x2ce949=_0x2ce949||0x1f4;return function(_0x2361fc){logger[_0xc579('0x8')](_0x2361fc[_0xc579('0x9')]);if(_0x2361fc[_0xc579('0xa')]){delete _0x2361fc[_0xc579('0xa')];}_0x293c4a['status'](_0x2ce949)[_0xc579('0xb')](_0x2361fc);};}function execChildProcess(){return new BPromise(function(_0x2048bc,_0x17e37f){exec(_0xc579('0xc'),function(_0x9e3fd3,_0x4577a2,_0x2a8e70){logger[_0xc579('0xd')](_0x4577a2);logger[_0xc579('0xd')](_0x2a8e70);if(_0x9e3fd3){logger[_0xc579('0x8')](_0x9e3fd3);return _0x17e37f(_0x9e3fd3);}return _0x2048bc(_0x4577a2);});});}exports[_0xc579('0xe')]=function(_0x4ac675,_0x177314){return pm2['list']()[_0xc579('0xf')](function(_0x59243e){if(_0x59243e){var _0x424e15=_['reject'](_0x59243e,function(_0x44cd32){return _0x44cd32['name']===_0xc579('0x10')||_0x44cd32[_0xc579('0xa')]==='motion2';});return{'rows':_0x424e15,'count':_0x424e15['length']};}return null;})[_0xc579('0xf')](respondWithResult(_0x177314,null))[_0xc579('0x11')](handleError(_0x177314,null));};exports[_0xc579('0x12')]=function(_0x414ee7,_0x7d5865){return pm2[_0xc579('0x13')](_0x414ee7[_0xc579('0x14')]['id'])[_0xc579('0xf')](respondWithResult(_0x7d5865,null))[_0xc579('0xf')](handleEntityNotFound(_0x7d5865,null))[_0xc579('0x11')](handleError(_0x7d5865,null));};exports['create']=function(_0x463f5e,_0x2b7d74){if(_0x463f5e['body'][_0xc579('0xa')]&&_0x463f5e[_0xc579('0x15')][_0xc579('0x16')]){var _0x6501bc=path[_0xc579('0x17')](__dirname,_0xc579('0x18'),_0x463f5e[_0xc579('0x15')][_0xc579('0x16')]);var _0x55781e=process[_0xc579('0x19')]();process[_0xc579('0x1a')](path[_0xc579('0x1b')](_0x6501bc));return execChildProcess()[_0xc579('0xf')](function(_0x1da86e){process['chdir'](_0x55781e);return pm2[_0xc579('0x1c')]({'name':_0x463f5e[_0xc579('0x15')][_0xc579('0xa')],'script':_0x6501bc});})['then'](function(_0x45e1ac){pm2['dump']();return _0x45e1ac[0x0];})[_0xc579('0xf')](respondWithResult(_0x2b7d74,0xc9))[_0xc579('0x11')](handleError(_0x2b7d74,null));}else{return _0x2b7d74[_0xc579('0x1d')](0x1f4)['send']({'message':_0xc579('0x1e')});}};exports['update']=function(_0x532b33,_0x56439a){if(_0x532b33[_0xc579('0x15')]['id']){delete _0x532b33[_0xc579('0x15')]['id'];}var _0xfdbb73={'online':_0xc579('0x1f'),'stopped':_0xc579('0x20')};if(_0xfdbb73[_0xc579('0x21')](_0x532b33[_0xc579('0x15')]['status'])){return pm2[_0xfdbb73[_0x532b33['body'][_0xc579('0x1d')]]](_0x532b33['params']['id'])[_0xc579('0xf')](respondWithResult(_0x56439a,0xc8))[_0xc579('0x11')](handleError(_0x56439a,null));}else{return _0x56439a[_0xc579('0x1d')](0x1f4)[_0xc579('0xb')]({'message':_0xc579('0x22')});}};exports[_0xc579('0x23')]=function(_0x45e6a3,_0x133d08){if(_0x45e6a3['body']['id']){delete _0x45e6a3[_0xc579('0x15')]['id'];}if(_0x45e6a3[_0xc579('0x14')]['id']){return pm2[_0xc579('0x24')](_0x45e6a3[_0xc579('0x14')]['id'])['then'](function(_0x57299e){pm2[_0xc579('0x25')]();return _0x57299e[0x0];})['then'](respondWithResult(_0x133d08,null))[_0xc579('0x11')](handleError(_0x133d08,null));}else{return _0x133d08[_0xc579('0x1d')](0x1f4)[_0xc579('0xb')]({'message':_0xc579('0x26')});}};
\ No newline at end of file
+var _0xdace=['path','exec','bluebird','sendStatus','status','json','error','stack','send','npm\x20install','info','index','list','then','reject','name','express','length','catch','show','create','body','script','join','../../files/plugins','chdir','dirname','start','dump','Missing\x20name\x20and/or\x20path','update','restart','stop','params','Unknown\x20status','destroy','Unknown\x20id','lodash','../../config/logger','api'];(function(_0x1e65db,_0x44a530){var _0x3d9d4d=function(_0x4b7e9a){while(--_0x4b7e9a){_0x1e65db['push'](_0x1e65db['shift']());}};_0x3d9d4d(++_0x44a530);}(_0xdace,0xc5));var _0xedac=function(_0x365e54,_0x44be74){_0x365e54=_0x365e54-0x0;var _0x13317a=_0xdace[_0x365e54];return _0x13317a;};'use strict';var _=require(_0xedac('0x0'));var pm2=require('../../config/pm2');var logger=require(_0xedac('0x1'))(_0xedac('0x2'));var path=require(_0xedac('0x3'));var exec=require('child_process')[_0xedac('0x4')];var BPromise=require(_0xedac('0x5'));function handleEntityNotFound(_0x15d3bd,_0xefb142){return function(_0x5a97c0){if(!_0x5a97c0){_0x15d3bd[_0xedac('0x6')](0x194);;}return _0x5a97c0;};}function respondWithResult(_0x1cba89,_0x39328a){_0x39328a=_0x39328a||0xc8;return function(_0x5ecbd3){if(_0x5ecbd3){return _0x1cba89[_0xedac('0x7')](_0x39328a)[_0xedac('0x8')](_0x5ecbd3);}return null;};}function handleError(_0x162eea,_0x53fa43){_0x53fa43=_0x53fa43||0x1f4;return function(_0x27243f){logger[_0xedac('0x9')](_0x27243f[_0xedac('0xa')]);if(_0x27243f['name']){delete _0x27243f['name'];}_0x162eea[_0xedac('0x7')](_0x53fa43)[_0xedac('0xb')](_0x27243f);};}function execChildProcess(){return new BPromise(function(_0x57e1bf,_0x4d6a29){exec(_0xedac('0xc'),function(_0x25395d,_0x57f637,_0x261401){logger['info'](_0x57f637);logger[_0xedac('0xd')](_0x261401);if(_0x25395d){logger[_0xedac('0x9')](_0x25395d);return _0x4d6a29(_0x25395d);}return _0x57e1bf(_0x57f637);});});}exports[_0xedac('0xe')]=function(_0x342186,_0x9a79a0){return pm2[_0xedac('0xf')]()[_0xedac('0x10')](function(_0x11f0b0){if(_0x11f0b0){var _0x593030=_[_0xedac('0x11')](_0x11f0b0,function(_0x4651d4){return _0x4651d4[_0xedac('0x12')]===_0xedac('0x13')||_0x4651d4[_0xedac('0x12')]==='motion2';});return{'rows':_0x593030,'count':_0x593030[_0xedac('0x14')]};}return null;})['then'](respondWithResult(_0x9a79a0,null))[_0xedac('0x15')](handleError(_0x9a79a0,null));};exports[_0xedac('0x16')]=function(_0xdad128,_0xba0c93){return pm2['describe'](_0xdad128['params']['id'])[_0xedac('0x10')](respondWithResult(_0xba0c93,null))[_0xedac('0x10')](handleEntityNotFound(_0xba0c93,null))[_0xedac('0x15')](handleError(_0xba0c93,null));};exports[_0xedac('0x17')]=function(_0x5a5438,_0x4a699b){if(_0x5a5438[_0xedac('0x18')][_0xedac('0x12')]&&_0x5a5438[_0xedac('0x18')][_0xedac('0x19')]){var _0x2f5eee=path[_0xedac('0x1a')](__dirname,_0xedac('0x1b'),_0x5a5438[_0xedac('0x18')]['script']);var _0x4593e8=process['cwd']();process[_0xedac('0x1c')](path[_0xedac('0x1d')](_0x2f5eee));return execChildProcess()['then'](function(_0x46e09d){process[_0xedac('0x1c')](_0x4593e8);return pm2[_0xedac('0x1e')]({'name':_0x5a5438[_0xedac('0x18')][_0xedac('0x12')],'script':_0x2f5eee});})[_0xedac('0x10')](function(_0x5d7c31){pm2[_0xedac('0x1f')]();return _0x5d7c31[0x0];})[_0xedac('0x10')](respondWithResult(_0x4a699b,0xc9))[_0xedac('0x15')](handleError(_0x4a699b,null));}else{return _0x4a699b[_0xedac('0x7')](0x1f4)[_0xedac('0xb')]({'message':_0xedac('0x20')});}};exports[_0xedac('0x21')]=function(_0x26c6f7,_0x409825){if(_0x26c6f7[_0xedac('0x18')]['id']){delete _0x26c6f7['body']['id'];}var _0x25d7f5={'online':_0xedac('0x22'),'stopped':_0xedac('0x23')};if(_0x25d7f5['hasOwnProperty'](_0x26c6f7[_0xedac('0x18')]['status'])){return pm2[_0x25d7f5[_0x26c6f7['body'][_0xedac('0x7')]]](_0x26c6f7[_0xedac('0x24')]['id'])[_0xedac('0x10')](respondWithResult(_0x409825,0xc8))[_0xedac('0x15')](handleError(_0x409825,null));}else{return _0x409825['status'](0x1f4)['send']({'message':_0xedac('0x25')});}};exports[_0xedac('0x26')]=function(_0x24b182,_0x2ee8d7){if(_0x24b182[_0xedac('0x18')]['id']){delete _0x24b182[_0xedac('0x18')]['id'];}if(_0x24b182[_0xedac('0x24')]['id']){return pm2['delete'](_0x24b182[_0xedac('0x24')]['id'])[_0xedac('0x10')](function(_0x2cbe33){pm2['dump']();return _0x2cbe33[0x0];})[_0xedac('0x10')](respondWithResult(_0x2ee8d7,null))[_0xedac('0x15')](handleError(_0x2ee8d7,null));}else{return _0x2ee8d7['status'](0x1f4)[_0xedac('0xb')]({'message':_0xedac('0x27')});}};
\ No newline at end of file
index 07f4d56..4f025c2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3a93=['exports','express','Router','../../components/auth/service','get','/agents','isAuthenticated','/queues'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3a93,0xc1));var _0x33a9=function(_0x2e4f2c,_0x43622f){_0x2e4f2c=_0x2e4f2c-0x0;var _0x5932c7=_0x3a93[_0x2e4f2c];return _0x5932c7;};'use strict';var express=require(_0x33a9('0x0'));var router=express[_0x33a9('0x1')]();var auth=require(_0x33a9('0x2'));var controller=require('./realtime.controller');router[_0x33a9('0x3')](_0x33a9('0x4'),auth[_0x33a9('0x5')](),controller['getAgents']);router['get'](_0x33a9('0x6'),auth[_0x33a9('0x5')](),controller['getQueues']);module[_0x33a9('0x7')]=router;
\ No newline at end of file
+var _0xc96f=['./realtime.controller','get','/agents','isAuthenticated','/queues','getQueues','exports','express','Router','../../components/auth/service'];(function(_0x233716,_0x346676){var _0x302298=function(_0x53d84c){while(--_0x53d84c){_0x233716['push'](_0x233716['shift']());}};_0x302298(++_0x346676);}(_0xc96f,0x133));var _0xfc96=function(_0x3a2287,_0x1dba3c){_0x3a2287=_0x3a2287-0x0;var _0x413405=_0xc96f[_0x3a2287];return _0x413405;};'use strict';var express=require(_0xfc96('0x0'));var router=express[_0xfc96('0x1')]();var auth=require(_0xfc96('0x2'));var controller=require(_0xfc96('0x3'));router[_0xfc96('0x4')](_0xfc96('0x5'),auth[_0xfc96('0x6')](),controller['getAgents']);router[_0xfc96('0x4')](_0xfc96('0x7'),auth['isAuthenticated'](),controller[_0xfc96('0x8')]);module[_0xfc96('0x9')]=router;
\ No newline at end of file
index e744522..ee70b63 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb0d2=['catch','talking','push','pTalking','originated','message','dialActive','dialMethod','Trunk','startProgressive','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','dialPredictiveInterval','dialPredictiveIntervalMinThreshold','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgTalktime','get','agents','paused','loggedInDb','loggedIn','available','busy','outbound','find','pick','queue','length','some','connectedlinenum','internal','toString','getMembers','UserId','online','voiceStatus','Queue','Pause','findAll','startCase','idle','unknown','unavailable','ringing','isNil','chatPause','faxPause','mailPause','openchannelPause','smsPause','voicePause','whatsappPause','every','filter','pause','chatStatus','faxStatus','mailStatus','openchannelStatus','smsStatus','whatsappStatus','*pause','mail','chat','openchannel','fax','whatsapp','includes','toLowerCase','isArray','map','findOne','getAgents','all','flatten','uniq','value','split','fields','order','startsWith','DESC','ASC','sort','globalStatus','pauseType','userpic','lastLoginAt','lastPauseAt','address','chatCapacity','openchannelCapacity','faxCapacity','openchannelCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity','faxCurrentCapacity','chatStatusTime','openchannelStatusTime','smsStatusTime','whatsappStatusTime','destconnectedlinenum','screenrecording','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','routealias','resolve','query','channel','globalQueueFilter','User','rawAttributes','fieldName','type','key','role','agent','getOptions','raw','isEmpty','where','user','userProfileId','findAndCountAll','merge','omit','globalStatusFilter','pauseTypeFilter','getQueues','QueueCampaigns','UserProfile','getResources','rows','util','lodash','jayson/promise','../../components/parsers/qs','../../config/logger','../../mysqldb','client','http','undefined','limit','count','offset','status','error','stack','name','send','request','Agents','then','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','voice','Queues','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues'];(function(_0xa8d84f,_0x512e08){var _0x220939=function(_0x496f6d){while(--_0x496f6d){_0xa8d84f['push'](_0xa8d84f['shift']());}};_0x220939(++_0x512e08);}(_0xb0d2,0x88));var _0x2b0d=function(_0x56ed68,_0x2463b0){_0x56ed68=_0x56ed68-0x0;var _0x2da680=_0xb0d2[_0x56ed68];return _0x2da680;};'use strict';var util=require(_0x2b0d('0x0'));var _=require(_0x2b0d('0x1'));var jayson=require(_0x2b0d('0x2'));var qs=require(_0x2b0d('0x3'));var logger=require(_0x2b0d('0x4'))('api');var db=require(_0x2b0d('0x5'))['db'];var amiClient=jayson[_0x2b0d('0x6')][_0x2b0d('0x7')]({'port':0x232a});var routingClient=jayson['client'][_0x2b0d('0x7')]({'port':0x232c});function respondWithFilteredResult(_0x3aba6e,_0x4cf378){return function(_0x217892){if(_0x217892){var _0x4b6d46=typeof _0x4cf378['offset']===_0x2b0d('0x8')&&typeof _0x4cf378[_0x2b0d('0x9')]==='undefined';var _0x4eb6d5=_0x217892[_0x2b0d('0xa')];var _0x18eefc=_0x4b6d46?0x0:_0x4cf378[_0x2b0d('0xb')];var _0x3a75c2=_0x4b6d46?_0x217892[_0x2b0d('0xa')]:_0x4cf378['offset']+_0x4cf378['limit'];var _0x5c5646;if(_0x3a75c2>=_0x4eb6d5){_0x3a75c2=_0x4eb6d5;_0x5c5646=0xc8;}else{_0x5c5646=0xce;}_0x3aba6e[_0x2b0d('0xc')](_0x5c5646);return _0x3aba6e['set']('Content-Range',_0x18eefc+'-'+_0x3a75c2+'/'+_0x4eb6d5)['json'](_0x217892);}return null;};}function handleError(_0x2432a6,_0x2c46e5){_0x2c46e5=_0x2c46e5||0x1f4;return function(_0x91e35c){logger[_0x2b0d('0xd')](_0x91e35c[_0x2b0d('0xe')]);if(_0x91e35c[_0x2b0d('0xf')]){delete _0x91e35c[_0x2b0d('0xf')];}_0x2432a6[_0x2b0d('0xc')](_0x2c46e5)[_0x2b0d('0x10')](_0x91e35c);};}function getRealtimeAgents(){return new Promise(function(_0x1f1cac,_0x43db54){return amiClient[_0x2b0d('0x11')](_0x2b0d('0x12'),{})[_0x2b0d('0x13')](function(_0x5a1aee){if(_0x5a1aee[_0x2b0d('0xd')])throw new Error(_0x2b0d('0x14'));var _0x29431f=_0x5a1aee[_0x2b0d('0x15')];return routingClient[_0x2b0d('0x11')](_0x2b0d('0x12'),{})['then'](function(_0x4835b7){if(_0x4835b7[_0x2b0d('0xd')])throw new Error(_0x2b0d('0x16'));var _0xc824f7=_0x4835b7[_0x2b0d('0x15')];return _0x1f1cac(_['merge']({},_0x29431f,_0xc824f7));});})['catch'](function(_0x3e4af4){_0x43db54(_0x3e4af4);});});}function getRealtimeQueues(_0x2c3574,_0x3175f4){return new Promise(function(_0x52edab,_0x11e14b){var _0x2c5443=_0x3175f4===_0x2b0d('0x17')?amiClient:routingClient;return _0x2c5443[_0x2b0d('0x11')](_['startCase'](_0x3175f4)+_0x2b0d('0x18'),_0x2c3574)[_0x2b0d('0x13')](function(_0x266f95){if(_0x266f95[_0x2b0d('0xd')])throw new Error(util[_0x2b0d('0x19')](_0x2b0d('0x1a'),_0x3175f4));return _0x52edab(_0x266f95[_0x2b0d('0x15')]);})[_0x2b0d('0x1b')](function(_0x161b95){_0x11e14b(_0x161b95);});});}function getRealtimeVoiceQueueChannels(){return new Promise(function(_0x542437,_0x2cfac4){return amiClient[_0x2b0d('0x11')]('VoiceQueuesChannels',{})[_0x2b0d('0x13')](function(_0x373d14){if(_0x373d14[_0x2b0d('0xd')])throw new Error('Unable\x20to\x20retrieve\x20voice\x20queues\x20channels');return _0x542437(_0x373d14[_0x2b0d('0x15')]);})[_0x2b0d('0x1b')](function(_0xefa7bf){_0x2cfac4(_0xefa7bf);});});}function initializeQueues(_0x546e18,_0x20048c,_0x5af18f,_0x3d4707){var _0x4efd08=['loggedIn','available','waiting',_0x2b0d('0x1c'),'paused'];if(_0x5af18f===_0x2b0d('0x17')&&_0x3d4707==='outbound'){_0x4efd08[_0x2b0d('0x1d')](_0x2b0d('0x1e'),_0x2b0d('0x1f'),_0x2b0d('0x20'),_0x2b0d('0x21'),_0x2b0d('0x22'),_0x2b0d('0x23'),'startPredictive',_0x2b0d('0x24'),_0x2b0d('0x25'),_0x2b0d('0x26'),_0x2b0d('0x27'),'erlangBusyFactor',_0x2b0d('0x28'),'dialPredictiveIntervalMaxThreshold',_0x2b0d('0x29'),'predictiveIntervalAvailable',_0x2b0d('0x2a'),_0x2b0d('0x2b'),'predictiveIntervalDroppedCallsTimeout',_0x2b0d('0x2c'),'predictiveIntervalAvgHoldtime',_0x2b0d('0x2d'));}return _0x546e18['map'](function(_0x124847){var _0x2732df=_0x124847[_0x2b0d('0x2e')]({'plain':!![]});_0x2732df[_0x2b0d('0x2f')]=[];_0x2732df[_0x2b0d('0x30')]=0x0;_0x2732df[_0x2b0d('0x31')]=0x0;_0x2732df[_0x2b0d('0x32')]=0x0;_0x2732df[_0x2b0d('0x33')]=0x0;_0x2732df['waiting']=0x0;if(_0x5af18f===_0x2b0d('0x17')){_0x2732df[_0x2b0d('0x1c')]=0x0;_0x2732df[_0x2b0d('0x34')]=0x0;if(_0x3d4707===_0x2b0d('0x35')){_0x2732df[_0x2b0d('0x1e')]=0x0;_0x2732df[_0x2b0d('0x1f')]=0x0;}}var _0x12583f=_[_0x2b0d('0x36')](_0x20048c,['id',_0x2732df['id']]);if(_0x12583f)_['merge'](_0x2732df,_[_0x2b0d('0x37')](_0x12583f,_0x4efd08));return _0x2732df;});}function updateAgentVoiceStatus(_0xa128d7,_0x538f01,_0x22b88e){var _0x354a73=_['filter'](_0x22b88e,[_0x2b0d('0x38'),_0x538f01[_0x2b0d('0xf')]]);if(_0x354a73[_0x2b0d('0x39')]===0x0)return _0xa128d7[_0x2b0d('0x34')]=!![];if(_[_0x2b0d('0x3a')](_0x354a73,[_0x2b0d('0x3b'),_0xa128d7[_0x2b0d('0x3c')][_0x2b0d('0x3d')]()]))return _0xa128d7[_0x2b0d('0x1c')]=!![];if(!_0xa128d7[_0x2b0d('0x1c')])return _0xa128d7[_0x2b0d('0x34')]=!![];}function getVoiceQueueAgents(_0x31ee3e,_0xc277a2,_0x161016,_0x5c9641){var _0x573113=_[_0x2b0d('0x36')](_0xc277a2,['id',_0x31ee3e['id']]);if(!_0x573113)return _0x31ee3e;return _0x573113[_0x2b0d('0x3e')]({'raw':!![]})[_0x2b0d('0x13')](function(_0x2aa5fb){for(var _0x585f99=0x0;_0x585f99<_0x2aa5fb[_0x2b0d('0x39')];_0x585f99++){var _0x2d1533=_[_0x2b0d('0x36')](_0x161016,['id',_0x2aa5fb[_0x585f99][_0x2b0d('0x3f')]]);if(!_0x2d1533){_0x2d1533={'id':_0x2aa5fb[_0x585f99][_0x2b0d('0x3f')],'name':_0x2aa5fb[_0x585f99]['UserId'],'accountcode':'','online':![]};}var _0x109779={'id':_0x2d1533['id'],'name':_0x2d1533[_0x2b0d('0xf')],'internal':_0x2d1533['accountcode'],'online':Boolean(_0x2d1533[_0x2b0d('0x40')]),'paused':Boolean(_0x2aa5fb[_0x585f99]['paused'])};if(_0x2d1533[_0x2b0d('0x41')]===_0x2b0d('0x1c'))updateAgentVoiceStatus(_0x109779,_0x31ee3e,_0x5c9641);if(_0x109779[_0x2b0d('0x40')])_0x31ee3e[_0x2b0d('0x31')]++;if(_0x109779[_0x2b0d('0x34')])_0x31ee3e[_0x2b0d('0x34')]++;if(_0x109779[_0x2b0d('0x30')]&&!_0x109779['busy']&&!_0x109779[_0x2b0d('0x1c')])_0x31ee3e['paused']++;_0x31ee3e[_0x2b0d('0x2f')][_0x2b0d('0x1d')](_0x109779);}return _0x31ee3e;});}function getQueueAgents(_0x3b3090,_0x2fc0ad,_0x3ce527){var _0x23cedf='User'+_['startCase'](_0x3ce527)+_0x2b0d('0x42');var _0x4b7011=_0x3ce527+_0x2b0d('0x43');return db[_0x23cedf][_0x2b0d('0x44')]({'where':{[_[_0x2b0d('0x45')](_0x3ce527)+'QueueId']:_0x3b3090['id']},'raw':!![]})[_0x2b0d('0x13')](function(_0x37c657){for(var _0x4a5079=0x0;_0x4a5079<_0x37c657[_0x2b0d('0x39')];_0x4a5079++){var _0x2c24fd=_[_0x2b0d('0x36')](_0x2fc0ad,['id',_0x37c657[_0x4a5079][_0x2b0d('0x3f')]]);if(!_0x2c24fd){_0x2c24fd={'id':_0x37c657[_0x4a5079]['UserId'],'name':_0x37c657[_0x4a5079][_0x2b0d('0x3f')],'online':![],['pauseField']:![]};}var _0x200bbe={'id':_0x2c24fd['id'],'name':_0x2c24fd['name'],'online':Boolean(_0x2c24fd['online']),'paused':Boolean(_0x2c24fd[_0x4b7011])};if(_0x200bbe[_0x2b0d('0x40')])_0x3b3090[_0x2b0d('0x31')]++;_0x3b3090[_0x2b0d('0x2f')]['push'](_0x200bbe);}return _0x3b3090;});}function isIdle(_0x4fe977){return _0x4fe977===_0x2b0d('0x46')||_0x4fe977===_0x2b0d('0x47')||_0x4fe977===_0x2b0d('0x48')||_0x4fe977===_0x2b0d('0x49')||_[_0x2b0d('0x4a')](_0x4fe977);}function isAgentPaused(_0x118ba8,_0x29b575){var _0x42091c=[_0x118ba8[_0x2b0d('0x4b')],_0x118ba8[_0x2b0d('0x4c')],_0x118ba8[_0x2b0d('0x4d')],_0x118ba8[_0x2b0d('0x4e')],_0x118ba8[_0x2b0d('0x4f')],_0x118ba8[_0x2b0d('0x50')],_0x118ba8[_0x2b0d('0x51')]];if(!_0x29b575)return _[_0x2b0d('0x52')](_0x42091c);var _0x43f438=_[_0x2b0d('0x53')](_0x42091c);return _0x43f438[_0x2b0d('0x39')]>0x0&&_0x43f438[_0x2b0d('0x39')]<_0x42091c['length']?!![]:![];}function isAgentIdle(_0x58f046){if(_0x58f046['voiceStatus']!==_0x2b0d('0x46')&&_0x58f046[_0x2b0d('0x50')]){_0x58f046[_0x2b0d('0x41')]=_0x2b0d('0x54');return![];}return _['every']([_0x58f046[_0x2b0d('0x55')],_0x58f046[_0x2b0d('0x56')],_0x58f046[_0x2b0d('0x57')],_0x58f046[_0x2b0d('0x58')],_0x58f046[_0x2b0d('0x59')],_0x58f046[_0x2b0d('0x41')],_0x58f046[_0x2b0d('0x5a')]],isIdle);}function getAgentStatus(_0x1879f8){var _0x466520=_0x2b0d('0x47');if(isAgentPaused(_0x1879f8))_0x466520=_0x2b0d('0x54');else if(isAgentPaused(_0x1879f8,!![]))_0x466520=_0x2b0d('0x5b');else if(isAgentIdle(_0x1879f8))_0x466520=_0x2b0d('0x46');else _0x466520=_0x2b0d('0x34');return _0x466520;}function validateChannel(_0x3b0bce){var _0x49f42f=[_0x2b0d('0x5c'),_0x2b0d('0x5d'),'sms',_0x2b0d('0x5e'),_0x2b0d('0x5f'),_0x2b0d('0x60'),_0x2b0d('0x17')];if(!_[_0x2b0d('0x61')](_0x49f42f,_0x3b0bce[_0x2b0d('0x62')]()))throw new Error('Invalid\x20channel');return _0x3b0bce[_0x2b0d('0x62')]();}function getFilteredAgentIds(_0x2049f2,_0x17ea97){var _0x206c4c=_[_0x2b0d('0x63')](_0x2049f2)?_0x2049f2:[_0x2049f2];var _0x499d69=_[_0x2b0d('0x64')](_0x206c4c,function(_0x1673f2){return db[_0x17ea97][_0x2b0d('0x65')]({'where':{'name':_0x1673f2}})['then'](function(_0x3bef6a){if(!_0x3bef6a)return[];return _0x3bef6a[_0x2b0d('0x66')]({'attributes':['id'],'raw':!![]});});});return Promise[_0x2b0d('0x67')](_0x499d69)[_0x2b0d('0x13')](function(_0x148ce5){var _0x9f118a=_(_0x148ce5)[_0x2b0d('0x68')]()[_0x2b0d('0x64')]('id')[_0x2b0d('0x69')]()[_0x2b0d('0x6a')]();return _0x9f118a;});}function getUpdatedSortOptions(_0x25f7db){var _0x106caf={'fields':[],'order':null};var _0x36a081=_0x25f7db[_0x2b0d('0x6b')](',');_0x106caf[_0x2b0d('0x6c')]=_[_0x2b0d('0x53')](_0x36a081,function(_0x41686c){if(!_0x41686c[_0x2b0d('0x61')]('globalStatus'))return!![];_0x106caf[_0x2b0d('0x6d')]=_[_0x2b0d('0x6e')](_0x41686c,'-')?_0x2b0d('0x6f'):_0x2b0d('0x70');return![];});return _0x106caf;}function orderAgentsByStatus(_0x122a35,_0x305cee){return _0x122a35[_0x2b0d('0x71')](function(_0x401133,_0x337f86){if(_0x401133[_0x2b0d('0x72')]===_0x337f86['globalStatus']&&_0x401133[_0x2b0d('0x72')]===_0x2b0d('0x54')){if(_0x305cee===_0x2b0d('0x6f'))return(_0x401133[_0x2b0d('0x73')]||'')<(_0x337f86[_0x2b0d('0x73')]||'')?0x1:-0x1;return _0x401133[_0x2b0d('0x73')]<_0x337f86[_0x2b0d('0x73')]?-0x1:0x1;}else{if(_0x305cee===_0x2b0d('0x6f'))return _0x401133[_0x2b0d('0x72')]<_0x337f86[_0x2b0d('0x72')]?0x1:-0x1;return _0x401133['globalStatus']<_0x337f86[_0x2b0d('0x72')]?-0x1:0x1;}});}exports['getAgents']=function(_0x114e0e,_0x177f6b){var _0xd89cb0={'count':0x0,'rows':[]},_0x44253c={},_0x1223e6,_0x110934,_0x5b20eb,_0x5bf6f4,_0x3756ca=[_0x2b0d('0x74'),_0x2b0d('0x40'),_0x2b0d('0x75'),_0x2b0d('0x76'),_0x2b0d('0x73'),'lastPauseAt',_0x2b0d('0x3c'),_0x2b0d('0x77'),_0x2b0d('0x4b'),'openchannelPause',_0x2b0d('0x4d'),_0x2b0d('0x4f'),'whatsappPause',_0x2b0d('0x4c'),_0x2b0d('0x50'),_0x2b0d('0x78'),_0x2b0d('0x79'),'mailCapacity','smsCapacity','whatsappCapacity',_0x2b0d('0x7a'),'chatCurrentCapacity',_0x2b0d('0x7b'),_0x2b0d('0x7c'),_0x2b0d('0x7d'),'whatsappCurrentCapacity',_0x2b0d('0x7e'),_0x2b0d('0x55'),'openchannelStatus',_0x2b0d('0x57'),_0x2b0d('0x59'),_0x2b0d('0x5a'),_0x2b0d('0x56'),_0x2b0d('0x41'),_0x2b0d('0x7f'),_0x2b0d('0x80'),'mailStatusTime',_0x2b0d('0x81'),_0x2b0d('0x82'),'faxStatusTime','voiceStatusTime','queue',_0x2b0d('0x83'),_0x2b0d('0x84'),_0x2b0d('0x85'),_0x2b0d('0x86'),_0x2b0d('0x87')],_0x5ca7d7=[_0x2b0d('0x4b'),_0x2b0d('0x4e'),_0x2b0d('0x4d'),_0x2b0d('0x4f'),_0x2b0d('0x51'),_0x2b0d('0x4c'),_0x2b0d('0x50'),'online'];Promise[_0x2b0d('0x88')]()[_0x2b0d('0x13')](function(){if(_0x114e0e[_0x2b0d('0x89')][_0x2b0d('0x8a')])_0x1223e6=validateChannel(_0x114e0e[_0x2b0d('0x89')]['channel']);if(!_0x114e0e[_0x2b0d('0x89')][_0x2b0d('0x71')]||!_0x114e0e['query'][_0x2b0d('0x71')][_0x2b0d('0x61')]('globalStatus'))return;var _0x156fdf=getUpdatedSortOptions(_0x114e0e[_0x2b0d('0x89')][_0x2b0d('0x71')]);_0x114e0e['query']['sort']=_0x156fdf[_0x2b0d('0x6c')]['join'](',');_0x110934=_0x156fdf[_0x2b0d('0x6d')];})[_0x2b0d('0x13')](function(){if(!_0x114e0e[_0x2b0d('0x89')][_0x2b0d('0x8b')])return[];var _0x579c8a=_[_0x2b0d('0x45')](_0x1223e6)+_0x2b0d('0x42');return getFilteredAgentIds(_0x114e0e['query'][_0x2b0d('0x8b')],_0x579c8a);})['then'](function(_0x5a8f54){var _0x242679=_[_0x2b0d('0x64')](db[_0x2b0d('0x8c')][_0x2b0d('0x8d')],function(_0x708bda){return{'name':_0x708bda[_0x2b0d('0x8e')],'type':_0x708bda[_0x2b0d('0x8f')][_0x2b0d('0x90')]};});_0x114e0e[_0x2b0d('0x89')][_0x2b0d('0x91')]=_0x2b0d('0x92');_0x114e0e[_0x2b0d('0x89')]['online']=!![];_0x44253c=qs[_0x2b0d('0x93')](_0x242679,_0x114e0e);_0x44253c[_0x2b0d('0x94')]=!![];if(!_[_0x2b0d('0x95')](_0x5a8f54)){_0x44253c[_0x2b0d('0x96')]=_['merge'](_0x44253c['where'],{'$and':[{'id':{'$in':_0x5a8f54}}]});}else if(!_[_0x2b0d('0x95')](_0x114e0e[_0x2b0d('0x89')][_0x2b0d('0x8b')])){return _0xd89cb0;}if(_0x114e0e[_0x2b0d('0x97')][_0x2b0d('0x91')]===_0x2b0d('0x97')){var _0x1888dc={'params':{'id':_0x114e0e['user'][_0x2b0d('0x98')]},'query':{'section':'Agents','role':_0x2b0d('0x92'),'online':!![],'nolimit':_0x114e0e[_0x2b0d('0x89')]['nolimit'],'sort':_0x114e0e[_0x2b0d('0x89')]['sort'],'filter':_0x114e0e['query'][_0x2b0d('0x53')],'raw':!![],'ids':_0x5a8f54}};return db['UserProfile']['getResources'](_0x1888dc);}return db['User'][_0x2b0d('0x99')](_0x44253c);})[_0x2b0d('0x13')](function(_0x30657f){_0xd89cb0[_0x2b0d('0xa')]=_0x30657f[_0x2b0d('0xa')];_0x5b20eb=_0x30657f['rows'];return getRealtimeAgents();})[_0x2b0d('0x13')](function(_0x3edf05){_0x5bf6f4=_0x3edf05['rows'];return _0x5b20eb[_0x2b0d('0x64')](function(_0x4ca696){var _0x46ec19=_[_0x2b0d('0x36')](_0x5bf6f4,['id',_0x4ca696['id']]);if(_0x46ec19)_[_0x2b0d('0x9a')](_0x4ca696,_[_0x2b0d('0x37')](_[_0x2b0d('0x9b')](_0x46ec19,_0x5ca7d7),_0x3756ca));_0x4ca696[_0x2b0d('0x72')]=getAgentStatus(_0x4ca696);return _0x4ca696;});})[_0x2b0d('0x13')](function(_0x642bcb){var _0x5b70b4;if(_0x114e0e[_0x2b0d('0x89')][_0x2b0d('0x9c')]){_0x5b70b4=_['filter'](_0x642bcb,['globalStatus',_0x114e0e['query'][_0x2b0d('0x9c')]]);if(_0x114e0e['query'][_0x2b0d('0x9d')]){_0x5b70b4=_[_0x2b0d('0x53')](_0x5b70b4,['pauseType',_0x114e0e[_0x2b0d('0x89')][_0x2b0d('0x9d')]]);}}if(_0x5b70b4)_0x642bcb=_0x5b70b4;if(!_0x110934)return _0x642bcb;return orderAgentsByStatus(_0x642bcb,_0x110934);})[_0x2b0d('0x13')](function(_0x15bdb4){_0xd89cb0['rows']=_0x15bdb4;return _0xd89cb0;})[_0x2b0d('0x13')](respondWithFilteredResult(_0x177f6b,_0x44253c))['catch'](handleError(_0x177f6b,null));};exports[_0x2b0d('0x9e')]=function(_0x39ee5f,_0x4d6245){var _0x4820bf={'count':0x0,'rows':[]},_0x5ccb4a={},_0x1e562a,_0x2c7a60,_0x11be57,_0x539a05,_0x35bbee;Promise['resolve']()[_0x2b0d('0x13')](function(){if(_0x39ee5f[_0x2b0d('0x89')]['channel'])_0x1e562a=validateChannel(_0x39ee5f[_0x2b0d('0x89')][_0x2b0d('0x8a')]);var _0xa14601=_[_0x2b0d('0x45')](_0x1e562a)+_0x2b0d('0x42');var _0x16e069=_[_0x2b0d('0x64')](db[_0xa14601][_0x2b0d('0x8d')],function(_0x1e135b){return{'name':_0x1e135b[_0x2b0d('0x8e')],'type':_0x1e135b['type'][_0x2b0d('0x90')]};});_0x5ccb4a=qs[_0x2b0d('0x93')](_0x16e069,_0x39ee5f);if(_0x39ee5f[_0x2b0d('0x97')]['role']===_0x2b0d('0x97')){var _0x4bf676={'params':{'id':_0x39ee5f[_0x2b0d('0x97')]['userProfileId']},'query':{'section':_0x1e562a===_0x2b0d('0x17')&&_0x39ee5f['query'][_0x2b0d('0x8f')]===_0x2b0d('0x35')?_0x2b0d('0x9f'):_[_0x2b0d('0x45')](_0x1e562a)+'Queues','type':_0x39ee5f['query']['type'],'nolimit':!![],'sort':_0x2b0d('0xf'),'filter':_0x39ee5f[_0x2b0d('0x89')][_0x2b0d('0x53')]}};return db[_0x2b0d('0xa0')][_0x2b0d('0xa1')](_0x4bf676);}return db[_0xa14601][_0x2b0d('0x99')](_0x5ccb4a);})[_0x2b0d('0x13')](function(_0x3a4931){_0x4820bf['count']=_0x3a4931[_0x2b0d('0xa')];_0x2c7a60=_0x3a4931[_0x2b0d('0xa2')];return getRealtimeQueues(_0x39ee5f,_0x1e562a);})[_0x2b0d('0x13')](function(_0x1aab7c){_0x539a05=_0x1aab7c['rows'];return getRealtimeAgents();})[_0x2b0d('0x13')](function(_0x141dfb){_0x11be57=_0x141dfb[_0x2b0d('0xa2')];if(_0x1e562a!=_0x2b0d('0x17'))return;return getRealtimeVoiceQueueChannels();})['then'](function(_0x58e8e3){_0x35bbee=_0x58e8e3?_0x58e8e3[_0x2b0d('0xa2')]:[];return initializeQueues(_0x2c7a60,_0x539a05,_0x1e562a,_0x39ee5f[_0x2b0d('0x89')][_0x2b0d('0x8f')]);})['then'](function(_0x2b146a){var _0x3e2114=_0x2b146a[_0x2b0d('0x64')](function(_0xf6dd6a){if(_0x1e562a===_0x2b0d('0x17'))return getVoiceQueueAgents(_0xf6dd6a,_0x2c7a60,_0x11be57,_0x35bbee);else return getQueueAgents(_0xf6dd6a,_0x11be57,_0x1e562a);});return Promise['all'](_0x3e2114);})[_0x2b0d('0x13')](function(_0x49a7fe){_0x4820bf[_0x2b0d('0xa2')]=_0x49a7fe;return _0x4820bf;})[_0x2b0d('0x13')](respondWithFilteredResult(_0x4d6245,_0x5ccb4a))[_0x2b0d('0x1b')](handleError(_0x4d6245,null));};
\ No newline at end of file
+var _0x8e61=['getOptions','raw','isEmpty','where','user','role','userProfileId','nolimit','getResources','findAndCountAll','rows','pick','omit','globalStatusFilter','pauseTypeFilter','Queue','rawAttributes','Queues','UserProfile','util','lodash','jayson/promise','../../components/parsers/qs','../../config/logger','client','http','offset','undefined','limit','count','status','Content-Range','json','error','stack','name','send','request','Agents','then','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','voice','startCase','format','VoiceQueuesChannels','Unable\x20to\x20retrieve\x20voice\x20queues\x20channels','catch','loggedIn','waiting','talking','paused','outbound','push','pTalking','originated','message','Trunk','startProgressive','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgTalktime','map','get','agents','loggedInDb','busy','find','merge','filter','queue','length','some','internal','getMembers','UserId','accountcode','voiceStatus','online','User','Pause','findAll','QueueId','idle','unknown','unavailable','ringing','isNil','chatPause','openchannelPause','smsPause','voicePause','whatsappPause','every','pause','faxStatus','mailStatus','openchannelStatus','smsStatus','whatsappStatus','*pause','chat','sms','openchannel','fax','whatsapp','includes','toLowerCase','Invalid\x20channel','findOne','all','flatten','uniq','value','split','fields','order','startsWith','DESC','ASC','sort','globalStatus','pauseType','getAgents','userpic','lastPauseAt','address','mailPause','faxPause','chatCapacity','openchannelCapacity','smsCapacity','whatsappCapacity','chatCurrentCapacity','openchannelCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity','faxCurrentCapacity','chatStatus','chatStatusTime','openchannelStatusTime','smsStatusTime','whatsappStatusTime','faxStatusTime','voiceStatusTime','destconnectedlinenum','screenrecording','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','routealias','resolve','query','channel','join','globalQueueFilter','fieldName','type','key','agent'];(function(_0x7e2a57,_0x736dc4){var _0x38bcef=function(_0x35a4e1){while(--_0x35a4e1){_0x7e2a57['push'](_0x7e2a57['shift']());}};_0x38bcef(++_0x736dc4);}(_0x8e61,0x163));var _0x18e6=function(_0x55e08b,_0x421620){_0x55e08b=_0x55e08b-0x0;var _0xd1a7ff=_0x8e61[_0x55e08b];return _0xd1a7ff;};'use strict';var util=require(_0x18e6('0x0'));var _=require(_0x18e6('0x1'));var jayson=require(_0x18e6('0x2'));var qs=require(_0x18e6('0x3'));var logger=require(_0x18e6('0x4'))('api');var db=require('../../mysqldb')['db'];var amiClient=jayson[_0x18e6('0x5')][_0x18e6('0x6')]({'port':0x232a});var routingClient=jayson[_0x18e6('0x5')][_0x18e6('0x6')]({'port':0x232c});function respondWithFilteredResult(_0x30b72d,_0x11ae26){return function(_0x62fd3){if(_0x62fd3){var _0x1c313e=typeof _0x11ae26[_0x18e6('0x7')]===_0x18e6('0x8')&&typeof _0x11ae26[_0x18e6('0x9')]===_0x18e6('0x8');var _0x1f8263=_0x62fd3['count'];var _0x5d4021=_0x1c313e?0x0:_0x11ae26[_0x18e6('0x7')];var _0x2a66bc=_0x1c313e?_0x62fd3[_0x18e6('0xa')]:_0x11ae26[_0x18e6('0x7')]+_0x11ae26[_0x18e6('0x9')];var _0x47c1be;if(_0x2a66bc>=_0x1f8263){_0x2a66bc=_0x1f8263;_0x47c1be=0xc8;}else{_0x47c1be=0xce;}_0x30b72d[_0x18e6('0xb')](_0x47c1be);return _0x30b72d['set'](_0x18e6('0xc'),_0x5d4021+'-'+_0x2a66bc+'/'+_0x1f8263)[_0x18e6('0xd')](_0x62fd3);}return null;};}function handleError(_0x8dd62,_0x29ac6b){_0x29ac6b=_0x29ac6b||0x1f4;return function(_0x5a75f1){logger[_0x18e6('0xe')](_0x5a75f1[_0x18e6('0xf')]);if(_0x5a75f1[_0x18e6('0x10')]){delete _0x5a75f1[_0x18e6('0x10')];}_0x8dd62[_0x18e6('0xb')](_0x29ac6b)[_0x18e6('0x11')](_0x5a75f1);};}function getRealtimeAgents(){return new Promise(function(_0x3a69e4,_0x1dbcc6){return amiClient[_0x18e6('0x12')](_0x18e6('0x13'),{})[_0x18e6('0x14')](function(_0x730dc9){if(_0x730dc9[_0x18e6('0xe')])throw new Error(_0x18e6('0x15'));var _0x253ac7=_0x730dc9[_0x18e6('0x16')];return routingClient['request'](_0x18e6('0x13'),{})[_0x18e6('0x14')](function(_0x2a4d3b){if(_0x2a4d3b[_0x18e6('0xe')])throw new Error(_0x18e6('0x17'));var _0x36ad6f=_0x2a4d3b[_0x18e6('0x16')];return _0x3a69e4(_['merge']({},_0x253ac7,_0x36ad6f));});})['catch'](function(_0x298d06){_0x1dbcc6(_0x298d06);});});}function getRealtimeQueues(_0x5827c5,_0x4ad6fe){return new Promise(function(_0x468506,_0x4c756a){var _0x3a88ec=_0x4ad6fe===_0x18e6('0x18')?amiClient:routingClient;return _0x3a88ec[_0x18e6('0x12')](_[_0x18e6('0x19')](_0x4ad6fe)+'Queues',_0x5827c5)['then'](function(_0x12ea33){if(_0x12ea33[_0x18e6('0xe')])throw new Error(util[_0x18e6('0x1a')]('Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues',_0x4ad6fe));return _0x468506(_0x12ea33[_0x18e6('0x16')]);})['catch'](function(_0x30b225){_0x4c756a(_0x30b225);});});}function getRealtimeVoiceQueueChannels(){return new Promise(function(_0x55691c,_0x443d3d){return amiClient['request'](_0x18e6('0x1b'),{})[_0x18e6('0x14')](function(_0x35d3de){if(_0x35d3de['error'])throw new Error(_0x18e6('0x1c'));return _0x55691c(_0x35d3de[_0x18e6('0x16')]);})[_0x18e6('0x1d')](function(_0x1571e0){_0x443d3d(_0x1571e0);});});}function initializeQueues(_0x58a24c,_0x5b609d,_0x1088ec,_0x12ca10){var _0x139779=[_0x18e6('0x1e'),'available',_0x18e6('0x1f'),_0x18e6('0x20'),_0x18e6('0x21')];if(_0x1088ec===_0x18e6('0x18')&&_0x12ca10===_0x18e6('0x22')){_0x139779[_0x18e6('0x23')](_0x18e6('0x24'),_0x18e6('0x25'),_0x18e6('0x26'),'dialActive','dialMethod',_0x18e6('0x27'),'startPredictive',_0x18e6('0x28'),_0x18e6('0x29'),'erlangCallToSecond',_0x18e6('0x2a'),_0x18e6('0x2b'),_0x18e6('0x2c'),'dialPredictiveIntervalMaxThreshold',_0x18e6('0x2d'),_0x18e6('0x2e'),_0x18e6('0x2f'),_0x18e6('0x30'),_0x18e6('0x31'),_0x18e6('0x32'),'predictiveIntervalAvgHoldtime',_0x18e6('0x33'));}return _0x58a24c[_0x18e6('0x34')](function(_0x5b6af3){var _0x4c2aa6=_0x5b6af3[_0x18e6('0x35')]({'plain':!![]});_0x4c2aa6[_0x18e6('0x36')]=[];_0x4c2aa6[_0x18e6('0x21')]=0x0;_0x4c2aa6[_0x18e6('0x37')]=0x0;_0x4c2aa6[_0x18e6('0x1e')]=0x0;_0x4c2aa6['available']=0x0;_0x4c2aa6['waiting']=0x0;if(_0x1088ec==='voice'){_0x4c2aa6[_0x18e6('0x20')]=0x0;_0x4c2aa6[_0x18e6('0x38')]=0x0;if(_0x12ca10===_0x18e6('0x22')){_0x4c2aa6[_0x18e6('0x24')]=0x0;_0x4c2aa6['originated']=0x0;}}var _0x1b4e58=_[_0x18e6('0x39')](_0x5b609d,['id',_0x4c2aa6['id']]);if(_0x1b4e58)_[_0x18e6('0x3a')](_0x4c2aa6,_['pick'](_0x1b4e58,_0x139779));return _0x4c2aa6;});}function updateAgentVoiceStatus(_0x38f130,_0x452ada,_0x28b451){var _0x50db10=_[_0x18e6('0x3b')](_0x28b451,[_0x18e6('0x3c'),_0x452ada[_0x18e6('0x10')]]);if(_0x50db10[_0x18e6('0x3d')]===0x0)return _0x38f130['busy']=!![];if(_[_0x18e6('0x3e')](_0x50db10,['connectedlinenum',_0x38f130[_0x18e6('0x3f')]['toString']()]))return _0x38f130[_0x18e6('0x20')]=!![];if(!_0x38f130[_0x18e6('0x20')])return _0x38f130[_0x18e6('0x38')]=!![];}function getVoiceQueueAgents(_0x4e75da,_0x598119,_0x4416e1,_0x7f381a){var _0x55c728=_['find'](_0x598119,['id',_0x4e75da['id']]);if(!_0x55c728)return _0x4e75da;return _0x55c728[_0x18e6('0x40')]({'raw':!![]})['then'](function(_0x3ef0e0){for(var _0x33a526=0x0;_0x33a526<_0x3ef0e0[_0x18e6('0x3d')];_0x33a526++){var _0x2ae697=_[_0x18e6('0x39')](_0x4416e1,['id',_0x3ef0e0[_0x33a526][_0x18e6('0x41')]]);if(!_0x2ae697){_0x2ae697={'id':_0x3ef0e0[_0x33a526][_0x18e6('0x41')],'name':_0x3ef0e0[_0x33a526][_0x18e6('0x41')],'accountcode':'','online':![]};}var _0x185ff8={'id':_0x2ae697['id'],'name':_0x2ae697[_0x18e6('0x10')],'internal':_0x2ae697[_0x18e6('0x42')],'online':Boolean(_0x2ae697['online']),'paused':Boolean(_0x3ef0e0[_0x33a526][_0x18e6('0x21')])};if(_0x2ae697[_0x18e6('0x43')]===_0x18e6('0x20'))updateAgentVoiceStatus(_0x185ff8,_0x4e75da,_0x7f381a);if(_0x185ff8[_0x18e6('0x44')])_0x4e75da[_0x18e6('0x37')]++;if(_0x185ff8[_0x18e6('0x38')])_0x4e75da[_0x18e6('0x38')]++;if(_0x185ff8[_0x18e6('0x21')]&&!_0x185ff8[_0x18e6('0x38')]&&!_0x185ff8[_0x18e6('0x20')])_0x4e75da[_0x18e6('0x21')]++;_0x4e75da[_0x18e6('0x36')][_0x18e6('0x23')](_0x185ff8);}return _0x4e75da;});}function getQueueAgents(_0x341ae4,_0x386a45,_0x259057){var _0x30257f=_0x18e6('0x45')+_[_0x18e6('0x19')](_0x259057)+'Queue';var _0xa48fbf=_0x259057+_0x18e6('0x46');return db[_0x30257f][_0x18e6('0x47')]({'where':{[_['startCase'](_0x259057)+_0x18e6('0x48')]:_0x341ae4['id']},'raw':!![]})[_0x18e6('0x14')](function(_0x5d9b22){for(var _0x13e5cf=0x0;_0x13e5cf<_0x5d9b22[_0x18e6('0x3d')];_0x13e5cf++){var _0x12c6c6=_[_0x18e6('0x39')](_0x386a45,['id',_0x5d9b22[_0x13e5cf][_0x18e6('0x41')]]);if(!_0x12c6c6){_0x12c6c6={'id':_0x5d9b22[_0x13e5cf][_0x18e6('0x41')],'name':_0x5d9b22[_0x13e5cf][_0x18e6('0x41')],'online':![],['pauseField']:![]};}var _0x34e910={'id':_0x12c6c6['id'],'name':_0x12c6c6['name'],'online':Boolean(_0x12c6c6[_0x18e6('0x44')]),'paused':Boolean(_0x12c6c6[_0xa48fbf])};if(_0x34e910['online'])_0x341ae4[_0x18e6('0x37')]++;_0x341ae4[_0x18e6('0x36')][_0x18e6('0x23')](_0x34e910);}return _0x341ae4;});}function isIdle(_0x493310){return _0x493310===_0x18e6('0x49')||_0x493310===_0x18e6('0x4a')||_0x493310===_0x18e6('0x4b')||_0x493310===_0x18e6('0x4c')||_[_0x18e6('0x4d')](_0x493310);}function isAgentPaused(_0x48f0cf,_0x55a74c){var _0x3dd299=[_0x48f0cf[_0x18e6('0x4e')],_0x48f0cf['faxPause'],_0x48f0cf['mailPause'],_0x48f0cf[_0x18e6('0x4f')],_0x48f0cf[_0x18e6('0x50')],_0x48f0cf[_0x18e6('0x51')],_0x48f0cf[_0x18e6('0x52')]];if(!_0x55a74c)return _[_0x18e6('0x53')](_0x3dd299);var _0x38e6a7=_[_0x18e6('0x3b')](_0x3dd299);return _0x38e6a7['length']>0x0&&_0x38e6a7[_0x18e6('0x3d')]<_0x3dd299[_0x18e6('0x3d')]?!![]:![];}function isAgentIdle(_0x343d88){if(_0x343d88[_0x18e6('0x43')]!==_0x18e6('0x49')&&_0x343d88[_0x18e6('0x51')]){_0x343d88[_0x18e6('0x43')]=_0x18e6('0x54');return![];}return _[_0x18e6('0x53')]([_0x343d88['chatStatus'],_0x343d88[_0x18e6('0x55')],_0x343d88[_0x18e6('0x56')],_0x343d88[_0x18e6('0x57')],_0x343d88[_0x18e6('0x58')],_0x343d88[_0x18e6('0x43')],_0x343d88[_0x18e6('0x59')]],isIdle);}function getAgentStatus(_0x2a369d){var _0x54eaa3=_0x18e6('0x4a');if(isAgentPaused(_0x2a369d))_0x54eaa3=_0x18e6('0x54');else if(isAgentPaused(_0x2a369d,!![]))_0x54eaa3=_0x18e6('0x5a');else if(isAgentIdle(_0x2a369d))_0x54eaa3=_0x18e6('0x49');else _0x54eaa3=_0x18e6('0x38');return _0x54eaa3;}function validateChannel(_0x141a83){var _0x2ebc18=['mail',_0x18e6('0x5b'),_0x18e6('0x5c'),_0x18e6('0x5d'),_0x18e6('0x5e'),_0x18e6('0x5f'),_0x18e6('0x18')];if(!_[_0x18e6('0x60')](_0x2ebc18,_0x141a83[_0x18e6('0x61')]()))throw new Error(_0x18e6('0x62'));return _0x141a83[_0x18e6('0x61')]();}function getFilteredAgentIds(_0x587811,_0x49c348){var _0x53d6a0=_['isArray'](_0x587811)?_0x587811:[_0x587811];var _0x32b77a=_[_0x18e6('0x34')](_0x53d6a0,function(_0x554277){return db[_0x49c348][_0x18e6('0x63')]({'where':{'name':_0x554277}})[_0x18e6('0x14')](function(_0x3d9150){if(!_0x3d9150)return[];return _0x3d9150['getAgents']({'attributes':['id'],'raw':!![]});});});return Promise[_0x18e6('0x64')](_0x32b77a)['then'](function(_0x31abf9){var _0x594d91=_(_0x31abf9)[_0x18e6('0x65')]()[_0x18e6('0x34')]('id')[_0x18e6('0x66')]()[_0x18e6('0x67')]();return _0x594d91;});}function getUpdatedSortOptions(_0x27e225){var _0x361575={'fields':[],'order':null};var _0x294fa1=_0x27e225[_0x18e6('0x68')](',');_0x361575[_0x18e6('0x69')]=_[_0x18e6('0x3b')](_0x294fa1,function(_0x587246){if(!_0x587246[_0x18e6('0x60')]('globalStatus'))return!![];_0x361575[_0x18e6('0x6a')]=_[_0x18e6('0x6b')](_0x587246,'-')?_0x18e6('0x6c'):_0x18e6('0x6d');return![];});return _0x361575;}function orderAgentsByStatus(_0x3c0d5c,_0x1fd977){return _0x3c0d5c[_0x18e6('0x6e')](function(_0x26c6e7,_0x3e6050){if(_0x26c6e7[_0x18e6('0x6f')]===_0x3e6050[_0x18e6('0x6f')]&&_0x26c6e7['globalStatus']==='pause'){if(_0x1fd977==='DESC')return(_0x26c6e7[_0x18e6('0x70')]||'')<(_0x3e6050[_0x18e6('0x70')]||'')?0x1:-0x1;return _0x26c6e7[_0x18e6('0x70')]<_0x3e6050['pauseType']?-0x1:0x1;}else{if(_0x1fd977===_0x18e6('0x6c'))return _0x26c6e7['globalStatus']<_0x3e6050[_0x18e6('0x6f')]?0x1:-0x1;return _0x26c6e7[_0x18e6('0x6f')]<_0x3e6050[_0x18e6('0x6f')]?-0x1:0x1;}});}exports[_0x18e6('0x71')]=function(_0x2d9feb,_0x120a7f){var _0x2c6534={'count':0x0,'rows':[]},_0x2cb922={},_0x1526b0,_0x1c1f35,_0x3f97f6,_0x436264,_0x48114a=[_0x18e6('0x72'),_0x18e6('0x44'),'lastLoginAt','lastPauseAt',_0x18e6('0x70'),_0x18e6('0x73'),_0x18e6('0x3f'),_0x18e6('0x74'),_0x18e6('0x4e'),'openchannelPause',_0x18e6('0x75'),'smsPause',_0x18e6('0x52'),_0x18e6('0x76'),_0x18e6('0x51'),_0x18e6('0x77'),_0x18e6('0x78'),'mailCapacity',_0x18e6('0x79'),_0x18e6('0x7a'),'faxCapacity',_0x18e6('0x7b'),_0x18e6('0x7c'),_0x18e6('0x7d'),_0x18e6('0x7e'),'whatsappCurrentCapacity',_0x18e6('0x7f'),_0x18e6('0x80'),'openchannelStatus',_0x18e6('0x56'),_0x18e6('0x58'),_0x18e6('0x59'),_0x18e6('0x55'),_0x18e6('0x43'),_0x18e6('0x81'),_0x18e6('0x82'),'mailStatusTime',_0x18e6('0x83'),_0x18e6('0x84'),_0x18e6('0x85'),_0x18e6('0x86'),_0x18e6('0x3c'),_0x18e6('0x87'),_0x18e6('0x88'),_0x18e6('0x89'),_0x18e6('0x8a'),_0x18e6('0x8b')],_0x365da6=[_0x18e6('0x4e'),_0x18e6('0x4f'),_0x18e6('0x75'),'smsPause',_0x18e6('0x52'),_0x18e6('0x76'),_0x18e6('0x51'),_0x18e6('0x44')];Promise[_0x18e6('0x8c')]()[_0x18e6('0x14')](function(){if(_0x2d9feb[_0x18e6('0x8d')][_0x18e6('0x8e')])_0x1526b0=validateChannel(_0x2d9feb['query'][_0x18e6('0x8e')]);if(!_0x2d9feb['query'][_0x18e6('0x6e')]||!_0x2d9feb[_0x18e6('0x8d')]['sort'][_0x18e6('0x60')](_0x18e6('0x6f')))return;var _0x33a674=getUpdatedSortOptions(_0x2d9feb[_0x18e6('0x8d')][_0x18e6('0x6e')]);_0x2d9feb['query'][_0x18e6('0x6e')]=_0x33a674[_0x18e6('0x69')][_0x18e6('0x8f')](',');_0x1c1f35=_0x33a674[_0x18e6('0x6a')];})[_0x18e6('0x14')](function(){if(!_0x2d9feb[_0x18e6('0x8d')][_0x18e6('0x90')])return[];var _0xc624b9=_[_0x18e6('0x19')](_0x1526b0)+'Queue';return getFilteredAgentIds(_0x2d9feb[_0x18e6('0x8d')][_0x18e6('0x90')],_0xc624b9);})[_0x18e6('0x14')](function(_0x1f6100){var _0x2ffd3d=_[_0x18e6('0x34')](db[_0x18e6('0x45')]['rawAttributes'],function(_0x15ba34){return{'name':_0x15ba34[_0x18e6('0x91')],'type':_0x15ba34[_0x18e6('0x92')][_0x18e6('0x93')]};});_0x2d9feb[_0x18e6('0x8d')]['role']=_0x18e6('0x94');_0x2d9feb[_0x18e6('0x8d')][_0x18e6('0x44')]=!![];_0x2cb922=qs[_0x18e6('0x95')](_0x2ffd3d,_0x2d9feb);_0x2cb922[_0x18e6('0x96')]=!![];if(!_[_0x18e6('0x97')](_0x1f6100)){_0x2cb922[_0x18e6('0x98')]=_[_0x18e6('0x3a')](_0x2cb922[_0x18e6('0x98')],{'$and':[{'id':{'$in':_0x1f6100}}]});}else if(!_['isEmpty'](_0x2d9feb[_0x18e6('0x8d')][_0x18e6('0x90')])){return _0x2c6534;}if(_0x2d9feb[_0x18e6('0x99')][_0x18e6('0x9a')]===_0x18e6('0x99')){var _0x1b6840={'params':{'id':_0x2d9feb['user'][_0x18e6('0x9b')]},'query':{'section':_0x18e6('0x13'),'role':_0x18e6('0x94'),'online':!![],'nolimit':_0x2d9feb[_0x18e6('0x8d')][_0x18e6('0x9c')],'sort':_0x2d9feb[_0x18e6('0x8d')][_0x18e6('0x6e')],'filter':_0x2d9feb[_0x18e6('0x8d')][_0x18e6('0x3b')],'raw':!![],'ids':_0x1f6100}};return db['UserProfile'][_0x18e6('0x9d')](_0x1b6840);}return db[_0x18e6('0x45')][_0x18e6('0x9e')](_0x2cb922);})[_0x18e6('0x14')](function(_0x4b7b58){_0x2c6534[_0x18e6('0xa')]=_0x4b7b58[_0x18e6('0xa')];_0x3f97f6=_0x4b7b58[_0x18e6('0x9f')];return getRealtimeAgents();})[_0x18e6('0x14')](function(_0x828689){_0x436264=_0x828689[_0x18e6('0x9f')];return _0x3f97f6[_0x18e6('0x34')](function(_0x5a3bbb){var _0x1571cc=_['find'](_0x436264,['id',_0x5a3bbb['id']]);if(_0x1571cc)_[_0x18e6('0x3a')](_0x5a3bbb,_[_0x18e6('0xa0')](_[_0x18e6('0xa1')](_0x1571cc,_0x365da6),_0x48114a));_0x5a3bbb['globalStatus']=getAgentStatus(_0x5a3bbb);return _0x5a3bbb;});})[_0x18e6('0x14')](function(_0x2a430b){var _0x1da7e2;if(_0x2d9feb['query'][_0x18e6('0xa2')]){_0x1da7e2=_[_0x18e6('0x3b')](_0x2a430b,['globalStatus',_0x2d9feb['query'][_0x18e6('0xa2')]]);if(_0x2d9feb[_0x18e6('0x8d')][_0x18e6('0xa3')]){_0x1da7e2=_[_0x18e6('0x3b')](_0x1da7e2,[_0x18e6('0x70'),_0x2d9feb['query'][_0x18e6('0xa3')]]);}}if(_0x1da7e2)_0x2a430b=_0x1da7e2;if(!_0x1c1f35)return _0x2a430b;return orderAgentsByStatus(_0x2a430b,_0x1c1f35);})['then'](function(_0x4c1e30){_0x2c6534[_0x18e6('0x9f')]=_0x4c1e30;return _0x2c6534;})[_0x18e6('0x14')](respondWithFilteredResult(_0x120a7f,_0x2cb922))[_0x18e6('0x1d')](handleError(_0x120a7f,null));};exports['getQueues']=function(_0x3de6a3,_0x4e8bb8){var _0x93efa5={'count':0x0,'rows':[]},_0x63cb6b={},_0x4416f9,_0x52e171,_0x4c438d,_0xe4f8b5,_0x23b100;Promise[_0x18e6('0x8c')]()['then'](function(){if(_0x3de6a3[_0x18e6('0x8d')]['channel'])_0x4416f9=validateChannel(_0x3de6a3[_0x18e6('0x8d')][_0x18e6('0x8e')]);var _0x45e1bb=_[_0x18e6('0x19')](_0x4416f9)+_0x18e6('0xa4');var _0x3d337e=_['map'](db[_0x45e1bb][_0x18e6('0xa5')],function(_0x48c621){return{'name':_0x48c621[_0x18e6('0x91')],'type':_0x48c621[_0x18e6('0x92')][_0x18e6('0x93')]};});_0x63cb6b=qs[_0x18e6('0x95')](_0x3d337e,_0x3de6a3);if(_0x3de6a3['user']['role']===_0x18e6('0x99')){var _0x158ecf={'params':{'id':_0x3de6a3[_0x18e6('0x99')][_0x18e6('0x9b')]},'query':{'section':_0x4416f9===_0x18e6('0x18')&&_0x3de6a3[_0x18e6('0x8d')][_0x18e6('0x92')]===_0x18e6('0x22')?'QueueCampaigns':_[_0x18e6('0x19')](_0x4416f9)+_0x18e6('0xa6'),'type':_0x3de6a3[_0x18e6('0x8d')][_0x18e6('0x92')],'nolimit':!![],'sort':'name','filter':_0x3de6a3[_0x18e6('0x8d')]['filter']}};return db[_0x18e6('0xa7')]['getResources'](_0x158ecf);}return db[_0x45e1bb][_0x18e6('0x9e')](_0x63cb6b);})[_0x18e6('0x14')](function(_0x11c699){_0x93efa5['count']=_0x11c699[_0x18e6('0xa')];_0x52e171=_0x11c699['rows'];return getRealtimeQueues(_0x3de6a3,_0x4416f9);})[_0x18e6('0x14')](function(_0x4acd2f){_0xe4f8b5=_0x4acd2f[_0x18e6('0x9f')];return getRealtimeAgents();})['then'](function(_0x1f73e0){_0x4c438d=_0x1f73e0[_0x18e6('0x9f')];if(_0x4416f9!='voice')return;return getRealtimeVoiceQueueChannels();})['then'](function(_0x5697f2){_0x23b100=_0x5697f2?_0x5697f2['rows']:[];return initializeQueues(_0x52e171,_0xe4f8b5,_0x4416f9,_0x3de6a3['query'][_0x18e6('0x92')]);})[_0x18e6('0x14')](function(_0x3ab6a5){var _0x22aff4=_0x3ab6a5['map'](function(_0x1a26ce){if(_0x4416f9===_0x18e6('0x18'))return getVoiceQueueAgents(_0x1a26ce,_0x52e171,_0x4c438d,_0x23b100);else return getQueueAgents(_0x1a26ce,_0x4c438d,_0x4416f9);});return Promise['all'](_0x22aff4);})[_0x18e6('0x14')](function(_0x250470){_0x93efa5[_0x18e6('0x9f')]=_0x250470;return _0x93efa5;})[_0x18e6('0x14')](respondWithFilteredResult(_0x4e8bb8,_0x63cb6b))[_0x18e6('0x1d')](handleError(_0x4e8bb8,null));};
\ No newline at end of file
index 29ca5c9..6a5c0d5 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(_0x4cb3d0,_0x276b07){var _0x543540=function(_0x456b67){while(--_0x456b67){_0x4cb3d0['push'](_0x4cb3d0['shift']());}};_0x543540(++_0x276b07);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router;
\ No newline at end of file
+var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x3108ca,_0xb853be){var _0x493305=function(_0x472101){while(--_0x472101){_0x3108ca['push'](_0x3108ca['shift']());}};_0x493305(++_0xb853be);}(_0xa9e0,0x123));var _0x0a9e=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0xa9e0[_0x187ee1];return _0x388160;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router;
\ No newline at end of file
index 9df832c..ec2d3e5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9fd4=['exports','INTEGER','STRING','DATE','sequelize'];(function(_0x336e7a,_0x211e1a){var _0x3764db=function(_0x19fdbd){while(--_0x19fdbd){_0x336e7a['push'](_0x336e7a['shift']());}};_0x3764db(++_0x211e1a);}(_0x9fd4,0x16c));var _0x49fd=function(_0x511a19,_0x417e36){_0x511a19=_0x511a19-0x0;var _0x499aa6=_0x9fd4[_0x511a19];return _0x499aa6;};'use strict';var Sequelize=require(_0x49fd('0x0'));module[_0x49fd('0x1')]={'state':{'type':Sequelize[_0x49fd('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x49fd('0x3')]},'scheduledat':{'type':Sequelize[_0x49fd('0x4')]},'uniqueid':{'type':Sequelize[_0x49fd('0x3')]},'starttime':{'type':Sequelize[_0x49fd('0x4')]},'responsetime':{'type':Sequelize[_0x49fd('0x4')]},'ringtime':{'type':Sequelize[_0x49fd('0x2')],'defaultValue':0x0},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x49fd('0x3')]}};
\ No newline at end of file
+var _0x423b=['STRING','exports'];(function(_0x1f7e2a,_0x4c7d0c){var _0xb8bf77=function(_0x30b9cb){while(--_0x30b9cb){_0x1f7e2a['push'](_0x1f7e2a['shift']());}};_0xb8bf77(++_0x4c7d0c);}(_0x423b,0x12b));var _0xb423=function(_0x1762b4,_0x33d836){_0x1762b4=_0x1762b4-0x0;var _0x29beda=_0x423b[_0x1762b4];return _0x29beda;};'use strict';var Sequelize=require('sequelize');module[_0xb423('0x0')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0xb423('0x1')]},'scheduledat':{'type':Sequelize['DATE']},'uniqueid':{'type':Sequelize[_0xb423('0x1')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'campaign':{'type':Sequelize[_0xb423('0x1')]},'campaigntype':{'type':Sequelize[_0xb423('0x1')]},'membername':{'type':Sequelize['STRING']}};
\ No newline at end of file
index d9209b6..bc4d983 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfa57=['util','moment','bluebird','request-promise','path','../../config/environment','./reportAgentPreview.attributes','exports','define','ReportAgentPreview','report_agent_preview','lodash'];(function(_0x26da89,_0x264785){var _0xc95b7b=function(_0x230e5b){while(--_0x230e5b){_0x26da89['push'](_0x26da89['shift']());}};_0xc95b7b(++_0x264785);}(_0xfa57,0x17f));var _0x7fa5=function(_0x4e27b7,_0x5a7aed){_0x4e27b7=_0x4e27b7-0x0;var _0x2e7285=_0xfa57[_0x4e27b7];return _0x2e7285;};'use strict';var _=require(_0x7fa5('0x0'));var util=require(_0x7fa5('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x7fa5('0x2'));var BPromise=require(_0x7fa5('0x3'));var rp=require(_0x7fa5('0x4'));var fs=require('fs');var path=require(_0x7fa5('0x5'));var rimraf=require('rimraf');var config=require(_0x7fa5('0x6'));var attributes=require(_0x7fa5('0x7'));module[_0x7fa5('0x8')]=function(_0x123e08,_0x3bfcb8){return _0x123e08[_0x7fa5('0x9')](_0x7fa5('0xa'),attributes,{'tableName':_0x7fa5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7d92=['moment','bluebird','path','rimraf','../../config/environment','./reportAgentPreview.attributes','define','ReportAgentPreview','report_agent_preview','../../config/logger','api'];(function(_0x3757c1,_0x37c2c0){var _0x5e13a7=function(_0x3dfb3f){while(--_0x3dfb3f){_0x3757c1['push'](_0x3757c1['shift']());}};_0x5e13a7(++_0x37c2c0);}(_0x7d92,0x1d7));var _0x27d9=function(_0x288f5e,_0x205edd){_0x288f5e=_0x288f5e-0x0;var _0x476cc9=_0x7d92[_0x288f5e];return _0x476cc9;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x27d9('0x0'))(_0x27d9('0x1'));var moment=require(_0x27d9('0x2'));var BPromise=require(_0x27d9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x27d9('0x4'));var rimraf=require(_0x27d9('0x5'));var config=require(_0x27d9('0x6'));var attributes=require(_0x27d9('0x7'));module['exports']=function(_0x2f1e17,_0xd969be){return _0x2f1e17[_0x27d9('0x8')](_0x27d9('0x9'),attributes,{'tableName':_0x27d9('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 26f4de9..3de82e2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x72b7=['options','raw','CreateReportAgentPreview','util','bluebird','randomstring','../../config/utils','../../config/logger','jayson/promise','client','request','then','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','ReportAgentPreview','create','body'];(function(_0x2f8623,_0x5ea121){var _0x40cec2=function(_0x4524ca){while(--_0x4524ca){_0x2f8623['push'](_0x2f8623['shift']());}};_0x40cec2(++_0x5ea121);}(_0x72b7,0x193));var _0x772b=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x72b7[_0x17d9e3];return _0x14192d;};'use strict';var _=require('lodash');var util=require(_0x772b('0x0'));var moment=require('moment');var BPromise=require(_0x772b('0x1'));var rs=require(_0x772b('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x772b('0x3'));var logger=require(_0x772b('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0x772b('0x5'));var client=jayson[_0x772b('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5e8317,_0x9f8073,_0x486bd4){return new BPromise(function(_0x3e409b,_0x5d5d05){return client[_0x772b('0x7')](_0x5e8317,_0x486bd4)[_0x772b('0x8')](function(_0x2bf68e){logger[_0x772b('0x9')](_0x772b('0xa'),_0x9f8073,_0x772b('0xb'));logger[_0x772b('0xc')]('ReportAgentPreview,\x20%s,\x20%s,\x20%s',_0x9f8073,_0x772b('0xb'),JSON[_0x772b('0xd')](_0x2bf68e));if(_0x2bf68e[_0x772b('0xe')]){if(_0x2bf68e[_0x772b('0xe')][_0x772b('0xf')]===0x1f4){logger['error'](_0x772b('0xa'),_0x9f8073,_0x2bf68e['error']['message']);return _0x5d5d05(_0x2bf68e['error'][_0x772b('0x10')]);}logger[_0x772b('0xe')](_0x772b('0xa'),_0x9f8073,_0x2bf68e[_0x772b('0xe')][_0x772b('0x10')]);return _0x3e409b(_0x2bf68e['error'][_0x772b('0x10')]);}else{logger['info'](_0x772b('0xa'),_0x9f8073,_0x772b('0xb'));_0x3e409b(_0x2bf68e[_0x772b('0x11')][_0x772b('0x10')]);}})[_0x772b('0x12')](function(_0x511da0){logger[_0x772b('0xe')](_0x772b('0xa'),_0x9f8073,_0x511da0);_0x5d5d05(_0x511da0);});});}exports['CreateReportAgentPreview']=function(_0x6d5f1e){var _0x2481e6=this;return new Promise(function(_0x2f5b41,_0xdad5b6){return db[_0x772b('0x13')][_0x772b('0x14')](_0x6d5f1e[_0x772b('0x15')],{'raw':_0x6d5f1e[_0x772b('0x16')]?_0x6d5f1e[_0x772b('0x16')][_0x772b('0x17')]===undefined?!![]:![]:!![]})[_0x772b('0x8')](function(_0x582f1f){logger[_0x772b('0x9')](_0x772b('0x18'),_0x6d5f1e);logger[_0x772b('0xc')](_0x772b('0x18'),_0x6d5f1e,JSON[_0x772b('0xd')](_0x582f1f));_0x2f5b41(_0x582f1f);})['catch'](function(_0x509860){logger['error'](_0x772b('0x18'),_0x509860[_0x772b('0x10')],_0x6d5f1e);_0xdad5b6(_0x2481e6['error'](0x1f4,_0x509860[_0x772b('0x10')]));});});};
\ No newline at end of file
+var _0x7622=['then','info','ReportAgentPreview,\x20%s,\x20%s','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','CreateReportAgentPreview','create','body','options','raw','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x105d5b,_0xc1441){var _0x5d36a4=function(_0x20f018){while(--_0x20f018){_0x105d5b['push'](_0x105d5b['shift']());}};_0x5d36a4(++_0xc1441);}(_0x7622,0x132));var _0x2762=function(_0x49894c,_0x4f01f5){_0x49894c=_0x49894c-0x0;var _0x2aa221=_0x7622[_0x49894c];return _0x2aa221;};'use strict';var _=require(_0x2762('0x0'));var util=require(_0x2762('0x1'));var moment=require(_0x2762('0x2'));var BPromise=require('bluebird');var rs=require(_0x2762('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2762('0x4'))['db'];var utils=require(_0x2762('0x5'));var logger=require(_0x2762('0x6'))(_0x2762('0x7'));var config=require(_0x2762('0x8'));var jayson=require(_0x2762('0x9'));var client=jayson[_0x2762('0xa')][_0x2762('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x40509a,_0x132c88,_0x46ba5b){return new BPromise(function(_0x83508e,_0x4369e3){return client[_0x2762('0xc')](_0x40509a,_0x46ba5b)[_0x2762('0xd')](function(_0x158274){logger[_0x2762('0xe')](_0x2762('0xf'),_0x132c88,'request\x20sent');logger[_0x2762('0x10')](_0x2762('0x11'),_0x132c88,_0x2762('0x12'),JSON[_0x2762('0x13')](_0x158274));if(_0x158274[_0x2762('0x14')]){if(_0x158274[_0x2762('0x14')]['code']===0x1f4){logger['error'](_0x2762('0xf'),_0x132c88,_0x158274['error'][_0x2762('0x15')]);return _0x4369e3(_0x158274[_0x2762('0x14')][_0x2762('0x15')]);}logger[_0x2762('0x14')]('ReportAgentPreview,\x20%s,\x20%s',_0x132c88,_0x158274[_0x2762('0x14')]['message']);return _0x83508e(_0x158274[_0x2762('0x14')][_0x2762('0x15')]);}else{logger['info'](_0x2762('0xf'),_0x132c88,_0x2762('0x12'));_0x83508e(_0x158274[_0x2762('0x16')][_0x2762('0x15')]);}})[_0x2762('0x17')](function(_0x4de5f8){logger[_0x2762('0x14')](_0x2762('0xf'),_0x132c88,_0x4de5f8);_0x4369e3(_0x4de5f8);});});}exports[_0x2762('0x18')]=function(_0x5ada02){var _0xa5e55f=this;return new Promise(function(_0x282628,_0x55c317){return db['ReportAgentPreview'][_0x2762('0x19')](_0x5ada02[_0x2762('0x1a')],{'raw':_0x5ada02[_0x2762('0x1b')]?_0x5ada02[_0x2762('0x1b')][_0x2762('0x1c')]===undefined?!![]:![]:!![]})[_0x2762('0xd')](function(_0x2439ab){logger[_0x2762('0xe')](_0x2762('0x18'),_0x5ada02);logger[_0x2762('0x10')](_0x2762('0x18'),_0x5ada02,JSON['stringify'](_0x2439ab));_0x282628(_0x2439ab);})[_0x2762('0x17')](function(_0x3fa59c){logger[_0x2762('0x14')](_0x2762('0x18'),_0x3fa59c['message'],_0x5ada02);_0x55c317(_0xa5e55f['error'](0x1f4,_0x3fa59c[_0x2762('0x15')]));});});};
\ No newline at end of file
index 829e99f..b471b7b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x14ca=['faxQueuesWaitingInteractions','post','queueNotify','mail','showMailQueues','/chat/queues/:id/notify','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','fax','openchannel','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','whatsapp','showSmsQueues','showWhatsappQueues','/agents/:id/notify','agentNotify','exports','multer','util','express','../../components/auth/service','get','/voice/channels','voiceChannels','/voice/channels/:uniqueid/mixmonitor','isAuthenticated','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','/chat/queues','/mail/queues','/mail/accounts','mailAccounts','openchannelQueues','smsQueues','/whatsapp/queues','whatsappQueues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','updateVoiceQueue','outbound','/outbound/channels','/agents','/agents/:id/capacity','agentCapacity','/telephones','telephones','/trunks','trunks','campaigns','faxAccounts','/chat/queues/waitinginteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions'];(function(_0x4dde3f,_0x24ff20){var _0x5437cc=function(_0xbe91cd){while(--_0xbe91cd){_0x4dde3f['push'](_0x4dde3f['shift']());}};_0x5437cc(++_0x24ff20);}(_0x14ca,0x148));var _0xa14c=function(_0x31c796,_0x2e3c7f){_0x31c796=_0x31c796-0x0;var _0x128356=_0x14ca[_0x31c796];return _0x128356;};'use strict';var multer=require(_0xa14c('0x0'));var util=require(_0xa14c('0x1'));var path=require('path');var express=require(_0xa14c('0x2'));var router=express['Router']();var auth=require(_0xa14c('0x3'));var controller=require('./rpc.controller');router[_0xa14c('0x4')](_0xa14c('0x5'),auth['isAuthenticated'](),controller[_0xa14c('0x6')]);router[_0xa14c('0x4')](_0xa14c('0x7'),auth[_0xa14c('0x8')](),controller['voiceChannelMixMonitor']);router[_0xa14c('0x4')](_0xa14c('0x9'),auth[_0xa14c('0x8')](),controller[_0xa14c('0xa')]);router[_0xa14c('0x4')](_0xa14c('0xb'),auth[_0xa14c('0x8')](),controller[_0xa14c('0xc')]);router[_0xa14c('0x4')](_0xa14c('0xd'),auth[_0xa14c('0x8')](),controller['chatQueues']);router['get'](_0xa14c('0xe'),auth['isAuthenticated'](),controller['mailQueues']);router[_0xa14c('0x4')](_0xa14c('0xf'),auth['isAuthenticated'](),controller[_0xa14c('0x10')]);router[_0xa14c('0x4')]('/openchannel/queues',auth[_0xa14c('0x8')](),controller[_0xa14c('0x11')]);router[_0xa14c('0x4')]('/sms/queues',auth[_0xa14c('0x8')](),controller[_0xa14c('0x12')]);router[_0xa14c('0x4')](_0xa14c('0x13'),auth[_0xa14c('0x8')](),controller[_0xa14c('0x14')]);router['get'](_0xa14c('0x15'),auth[_0xa14c('0x8')](),controller[_0xa14c('0x16')]);router[_0xa14c('0x4')](_0xa14c('0x17'),auth['isAuthenticated'](),controller[_0xa14c('0x18')]);router['get'](_0xa14c('0x19'),auth['isAuthenticated'](),controller['voiceQueuesChannels']);router[_0xa14c('0x4')](_0xa14c('0x1a'),auth[_0xa14c('0x8')](),controller[_0xa14c('0x1b')]);router['get'](_0xa14c('0x1c'),auth['isAuthenticated'](),controller[_0xa14c('0x1d')]);router[_0xa14c('0x4')](_0xa14c('0x1e'),auth[_0xa14c('0x8')](),controller[_0xa14c('0x1f')]);router['get'](_0xa14c('0x20'),auth[_0xa14c('0x8')](),controller[_0xa14c('0x21')]);router['put'](_0xa14c('0x20'),auth[_0xa14c('0x8')](),controller[_0xa14c('0x22')]);router[_0xa14c('0x4')]('/outbound',auth[_0xa14c('0x8')](),controller[_0xa14c('0x23')]);router[_0xa14c('0x4')](_0xa14c('0x24'),auth[_0xa14c('0x8')](),controller['outboundChannels']);router[_0xa14c('0x4')](_0xa14c('0x25'),auth['isAuthenticated'](),controller['agents']);router['put'](_0xa14c('0x26'),auth[_0xa14c('0x8')](),controller[_0xa14c('0x27')]);router[_0xa14c('0x4')](_0xa14c('0x28'),auth[_0xa14c('0x8')](),controller[_0xa14c('0x29')]);router[_0xa14c('0x4')](_0xa14c('0x2a'),auth[_0xa14c('0x8')](),controller[_0xa14c('0x2b')]);router['get']('/campaigns',auth[_0xa14c('0x8')](),controller[_0xa14c('0x2c')]);router[_0xa14c('0x4')]('/fax/accounts',auth[_0xa14c('0x8')](),controller[_0xa14c('0x2d')]);router[_0xa14c('0x4')](_0xa14c('0x2e'),auth[_0xa14c('0x8')](),controller['chatQueuesWaitingInteractions']);router[_0xa14c('0x4')](_0xa14c('0x2f'),auth['isAuthenticated'](),controller[_0xa14c('0x30')]);router[_0xa14c('0x4')](_0xa14c('0x31'),auth[_0xa14c('0x8')](),controller[_0xa14c('0x32')]);router['get'](_0xa14c('0x33'),auth[_0xa14c('0x8')](),controller[_0xa14c('0x34')]);router[_0xa14c('0x4')]('/sms/queues/waitinginteractions',auth[_0xa14c('0x8')](),controller[_0xa14c('0x35')]);router[_0xa14c('0x4')](_0xa14c('0x36'),auth[_0xa14c('0x8')](),controller[_0xa14c('0x37')]);router[_0xa14c('0x4')](_0xa14c('0x38'),auth[_0xa14c('0x8')](),controller[_0xa14c('0x39')]);router[_0xa14c('0x3a')]('/mail/queues/:id/notify',auth[_0xa14c('0x8')](),controller[_0xa14c('0x3b')](_0xa14c('0x3c')));router[_0xa14c('0x4')]('/mail/queues/:id',auth[_0xa14c('0x8')](),controller[_0xa14c('0x3d')]);router['post'](_0xa14c('0x3e'),auth[_0xa14c('0x8')](),controller[_0xa14c('0x3b')]('chat'));router[_0xa14c('0x4')](_0xa14c('0x3f'),auth['isAuthenticated'](),controller[_0xa14c('0x40')]);router[_0xa14c('0x3a')](_0xa14c('0x41'),auth[_0xa14c('0x8')](),controller['queueNotify'](_0xa14c('0x42')));router[_0xa14c('0x4')]('/fax/queues/:id',auth[_0xa14c('0x8')](),controller['showFaxQueues']);router['post']('/openchannel/queues/:id/notify',auth[_0xa14c('0x8')](),controller[_0xa14c('0x3b')](_0xa14c('0x43')));router['get'](_0xa14c('0x44'),auth['isAuthenticated'](),controller[_0xa14c('0x45')]);router[_0xa14c('0x3a')](_0xa14c('0x46'),auth[_0xa14c('0x8')](),controller[_0xa14c('0x3b')]('sms'));router[_0xa14c('0x3a')]('/whatsapp/queues/:id/notify',auth[_0xa14c('0x8')](),controller[_0xa14c('0x3b')](_0xa14c('0x47')));router['get']('/sms/queues/:id',auth['isAuthenticated'](),controller[_0xa14c('0x48')]);router['get']('/whatsapp/queues/:id',auth['isAuthenticated'](),controller[_0xa14c('0x49')]);router['post'](_0xa14c('0x4a'),auth[_0xa14c('0x8')](),controller[_0xa14c('0x4b')]);module[_0xa14c('0x4c')]=router;
\ No newline at end of file
+var _0xe695=['openchannelQueuesWaitingInteractions','/fax/queues/waitinginteractions','queueNotify','mail','/mail/queues/:id','showMailQueues','post','/chat/queues/:id/notify','chat','showChatQueues','/fax/queues/:id/notify','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','openchannel','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','/agents/:id/notify','exports','multer','util','path','express','Router','../../components/auth/service','./rpc.controller','/voice/channels','isAuthenticated','voiceChannels','get','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','/chat/queues','/mail/queues','/mail/accounts','mailAccounts','openchannelQueues','/sms/queues','/whatsapp/queues','whatsappQueues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','/voice/queues/channels/:uniqueid/redirect/:exten','/voice/queues/:id','updateVoiceQueue','/outbound','outbound','/outbound/channels','outboundChannels','/agents','agents','put','agentCapacity','/telephones','telephones','/trunks','trunks','/campaigns','campaigns','/fax/accounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions'];(function(_0x4b3442,_0x18576b){var _0x347e03=function(_0x21e76b){while(--_0x21e76b){_0x4b3442['push'](_0x4b3442['shift']());}};_0x347e03(++_0x18576b);}(_0xe695,0x19d));var _0x5e69=function(_0x281d91,_0x6a5c03){_0x281d91=_0x281d91-0x0;var _0x36ba6c=_0xe695[_0x281d91];return _0x36ba6c;};'use strict';var multer=require(_0x5e69('0x0'));var util=require(_0x5e69('0x1'));var path=require(_0x5e69('0x2'));var express=require(_0x5e69('0x3'));var router=express[_0x5e69('0x4')]();var auth=require(_0x5e69('0x5'));var controller=require(_0x5e69('0x6'));router['get'](_0x5e69('0x7'),auth[_0x5e69('0x8')](),controller[_0x5e69('0x9')]);router[_0x5e69('0xa')](_0x5e69('0xb'),auth['isAuthenticated'](),controller[_0x5e69('0xc')]);router['get'](_0x5e69('0xd'),auth[_0x5e69('0x8')](),controller[_0x5e69('0xe')]);router[_0x5e69('0xa')](_0x5e69('0xf'),auth[_0x5e69('0x8')](),controller[_0x5e69('0x10')]);router['get'](_0x5e69('0x11'),auth[_0x5e69('0x8')](),controller['chatQueues']);router['get'](_0x5e69('0x12'),auth['isAuthenticated'](),controller['mailQueues']);router[_0x5e69('0xa')](_0x5e69('0x13'),auth[_0x5e69('0x8')](),controller[_0x5e69('0x14')]);router[_0x5e69('0xa')]('/openchannel/queues',auth['isAuthenticated'](),controller[_0x5e69('0x15')]);router[_0x5e69('0xa')](_0x5e69('0x16'),auth['isAuthenticated'](),controller['smsQueues']);router[_0x5e69('0xa')](_0x5e69('0x17'),auth['isAuthenticated'](),controller[_0x5e69('0x18')]);router[_0x5e69('0xa')](_0x5e69('0x19'),auth[_0x5e69('0x8')](),controller[_0x5e69('0x1a')]);router[_0x5e69('0xa')](_0x5e69('0x1b'),auth['isAuthenticated'](),controller[_0x5e69('0x1c')]);router[_0x5e69('0xa')](_0x5e69('0x1d'),auth[_0x5e69('0x8')](),controller[_0x5e69('0x1e')]);router['get']('/voice/queues/channels/:uniqueid',auth[_0x5e69('0x8')](),controller[_0x5e69('0x1f')]);router['get'](_0x5e69('0x20'),auth[_0x5e69('0x8')](),controller['voiceQueuesChannelHangup']);router['get'](_0x5e69('0x21'),auth[_0x5e69('0x8')](),controller['voiceQueuesChannelRedirect']);router['get'](_0x5e69('0x22'),auth[_0x5e69('0x8')](),controller['showVoiceQueues']);router['put']('/voice/queues/:id',auth[_0x5e69('0x8')](),controller[_0x5e69('0x23')]);router[_0x5e69('0xa')](_0x5e69('0x24'),auth[_0x5e69('0x8')](),controller[_0x5e69('0x25')]);router['get'](_0x5e69('0x26'),auth[_0x5e69('0x8')](),controller[_0x5e69('0x27')]);router[_0x5e69('0xa')](_0x5e69('0x28'),auth[_0x5e69('0x8')](),controller[_0x5e69('0x29')]);router[_0x5e69('0x2a')]('/agents/:id/capacity',auth[_0x5e69('0x8')](),controller[_0x5e69('0x2b')]);router[_0x5e69('0xa')](_0x5e69('0x2c'),auth[_0x5e69('0x8')](),controller[_0x5e69('0x2d')]);router[_0x5e69('0xa')](_0x5e69('0x2e'),auth[_0x5e69('0x8')](),controller[_0x5e69('0x2f')]);router[_0x5e69('0xa')](_0x5e69('0x30'),auth['isAuthenticated'](),controller[_0x5e69('0x31')]);router[_0x5e69('0xa')](_0x5e69('0x32'),auth[_0x5e69('0x8')](),controller['faxAccounts']);router[_0x5e69('0xa')](_0x5e69('0x33'),auth['isAuthenticated'](),controller[_0x5e69('0x34')]);router[_0x5e69('0xa')](_0x5e69('0x35'),auth['isAuthenticated'](),controller[_0x5e69('0x36')]);router['get']('/openchannel/queues/waitinginteractions',auth[_0x5e69('0x8')](),controller[_0x5e69('0x37')]);router[_0x5e69('0xa')]('/openchannel/queues/:id/waitinginteractions',auth['isAuthenticated'](),controller['openchannelQueuesIdWaitingInteractions']);router[_0x5e69('0xa')]('/sms/queues/waitinginteractions',auth['isAuthenticated'](),controller['smsQueuesWaitingInteractions']);router[_0x5e69('0xa')]('/whatsapp/queues/waitinginteractions',auth[_0x5e69('0x8')](),controller['whatsappQueuesWaitingInteractions']);router[_0x5e69('0xa')](_0x5e69('0x38'),auth[_0x5e69('0x8')](),controller['faxQueuesWaitingInteractions']);router['post']('/mail/queues/:id/notify',auth[_0x5e69('0x8')](),controller[_0x5e69('0x39')](_0x5e69('0x3a')));router[_0x5e69('0xa')](_0x5e69('0x3b'),auth[_0x5e69('0x8')](),controller[_0x5e69('0x3c')]);router[_0x5e69('0x3d')](_0x5e69('0x3e'),auth['isAuthenticated'](),controller[_0x5e69('0x39')](_0x5e69('0x3f')));router[_0x5e69('0xa')]('/chat/queues/:id',auth[_0x5e69('0x8')](),controller[_0x5e69('0x40')]);router[_0x5e69('0x3d')](_0x5e69('0x41'),auth[_0x5e69('0x8')](),controller[_0x5e69('0x39')]('fax'));router['get'](_0x5e69('0x42'),auth[_0x5e69('0x8')](),controller[_0x5e69('0x43')]);router[_0x5e69('0x3d')](_0x5e69('0x44'),auth[_0x5e69('0x8')](),controller[_0x5e69('0x39')](_0x5e69('0x45')));router[_0x5e69('0xa')]('/openchannel/queues/:id',auth[_0x5e69('0x8')](),controller['showOpenchannelQueues']);router[_0x5e69('0x3d')]('/sms/queues/:id/notify',auth[_0x5e69('0x8')](),controller[_0x5e69('0x39')]('sms'));router[_0x5e69('0x3d')](_0x5e69('0x46'),auth[_0x5e69('0x8')](),controller[_0x5e69('0x39')](_0x5e69('0x47')));router['get'](_0x5e69('0x48'),auth['isAuthenticated'](),controller[_0x5e69('0x49')]);router['get'](_0x5e69('0x4a'),auth['isAuthenticated'](),controller[_0x5e69('0x4b')]);router[_0x5e69('0x3d')](_0x5e69('0x4c'),auth[_0x5e69('0x8')](),controller['agentNotify']);module[_0x5e69('0x4d')]=router;
\ No newline at end of file
index 7a78bb9..d528d52 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x207c=['moment','lodash','util','../../mysqldb','../../config/logger','api','jayson/promise','http','then','error','code','result','status','json','sendStatus','stack','name','isNil','rows','find','voiceChannels','VoiceChannels','query','catch','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','params','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','voiceQueues','VoiceQueues','showVoiceQueues','updateVoiceQueue','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelRedirect','Outbound','outboundChannels','agents','Agents','interaction','user','hasOwnProperty','MemberReport','length','format','YYYY-MM-DD\x20HH:mm:ss','findOrCreate','INTERACTION','interface','agent','capacity','telephones','Telephones','trunks','Trunks','campaigns','Campaigns','chatQueues','showChatQueues','ChatQueues','mailQueues','showMailQueues','MailQueues','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','smsQueues','SmsQueues','whatsappQueues','WhatsappQueues','faxQueues','showFaxQueues','FaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','map','queue_id','value','filter','indexOf','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','capitalize','chat','Account','Queue','findOne','Message','messageId','Interaction','queue','QueueId','TransferReport','create','Start','queueTransferTimeout','agentNotify','channel','Channel\x20field\x20is\x20mandatory','Website','User','\x20Message\x20not\x20found','MessageId','From','*,*,*,*'];(function(_0x556460,_0x59f420){var _0x51cca7=function(_0x44c080){while(--_0x44c080){_0x556460['push'](_0x556460['shift']());}};_0x51cca7(++_0x59f420);}(_0x207c,0x1e8));var _0xc207=function(_0x12b1a6,_0x22df2d){_0x12b1a6=_0x12b1a6-0x0;var _0x5813d3=_0x207c[_0x12b1a6];return _0x5813d3;};'use strict';var BPromise=require('bluebird');var moment=require(_0xc207('0x0'));var _=require(_0xc207('0x1'));var util=require(_0xc207('0x2'));var db=require(_0xc207('0x3'))['db'];var logger=require(_0xc207('0x4'))(_0xc207('0x5'));var jayson=require(_0xc207('0x6'));var amiClient=jayson['client'][_0xc207('0x7')]({'port':0x232a});var mailClient=jayson['client']['http']({'port':0x232b});var routingClient=jayson['client'][_0xc207('0x7')]({'port':0x232c});function respondWithRpcPromise(_0x314561,_0x3395e4,_0x59ff6f){return new BPromise(function(_0x25cb97,_0xad159b){var _0x3c579f=_0x59ff6f?_0x59ff6f:amiClient;return _0x3c579f['request'](_0x314561,_0x3395e4)[_0xc207('0x8')](function(_0x817576){if(_0x817576[_0xc207('0x9')]){if(_0x817576[_0xc207('0x9')][_0xc207('0xa')]===0x1f4){return _0xad159b(_0x817576[_0xc207('0x9')]['message']);}return _0x25cb97(_0x817576['error']['message']);}else{_0x25cb97(_0x817576[_0xc207('0xb')]);}})['catch'](function(_0x2741f3){_0xad159b(_0x2741f3);});});}function respondWithResult(_0x2782ce,_0x59d401){_0x59d401=_0x59d401||0xc8;return function(_0x3e1108){if(_0x3e1108){return _0x2782ce[_0xc207('0xc')](_0x59d401)[_0xc207('0xd')](_0x3e1108);}return _0x2782ce[_0xc207('0xe')](0x194);};}function handleError(_0xe993a0,_0x51e967){_0x51e967=_0x51e967||0x1f4;return function(_0xc62672){logger[_0xc207('0x9')](_0xc62672[_0xc207('0xf')]);if(_0xc62672[_0xc207('0x10')]){delete _0xc62672['name'];}_0xe993a0['status'](_0x51e967)['send'](_0xc62672);};}function findById(_0x1cebfa){return function(_0x6e793d){if(!_[_0xc207('0x11')](_0x1cebfa)&&!_[_0xc207('0x11')](_0x6e793d)&&!_['isNil'](_0x6e793d[_0xc207('0x12')])){return _[_0xc207('0x13')](_0x6e793d[_0xc207('0x12')],function(_0x5f288e){return _0x5f288e['id']==_0x1cebfa;});}return null;};}exports[_0xc207('0x14')]=function(_0x488cc0,_0x42c8ba){return respondWithRpcPromise(_0xc207('0x15'),_0x488cc0[_0xc207('0x16')])[_0xc207('0x8')](respondWithResult(_0x42c8ba,null))[_0xc207('0x17')](handleError(_0x42c8ba,null));};exports[_0xc207('0x18')]=function(_0x35c0b0,_0x464dea){return respondWithRpcPromise(_0xc207('0x19'),_[_0xc207('0x1a')](_0x35c0b0[_0xc207('0x16')],_0x35c0b0[_0xc207('0x1b')]))[_0xc207('0x8')](respondWithResult(_0x464dea,null))['catch'](handleError(_0x464dea,null));};exports[_0xc207('0x1c')]=function(_0x5cda23,_0x2e89c5){return respondWithRpcPromise(_0xc207('0x1d'),_[_0xc207('0x1a')](_0x5cda23[_0xc207('0x16')],_0x5cda23[_0xc207('0x1b')]))[_0xc207('0x8')](respondWithResult(_0x2e89c5,null))[_0xc207('0x17')](handleError(_0x2e89c5,null));};exports[_0xc207('0x1e')]=function(_0xa52138,_0x2385f7){return respondWithRpcPromise(_0xc207('0x1f'),_0xa52138[_0xc207('0x16')])[_0xc207('0x8')](respondWithResult(_0x2385f7,null))[_0xc207('0x17')](handleError(_0x2385f7,null));};exports[_0xc207('0x20')]=function(_0x56a066,_0x1e1440){return respondWithRpcPromise('VoiceQueues',_0x56a066['query'])[_0xc207('0x8')](findById(_0x56a066[_0xc207('0x1b')]['id']))[_0xc207('0x8')](respondWithResult(_0x1e1440,null))[_0xc207('0x17')](handleError(_0x1e1440,null));};exports[_0xc207('0x21')]=function(_0x478af7,_0xe5e848){return respondWithRpcPromise(_0xc207('0x22'),_[_0xc207('0x1a')](_0x478af7[_0xc207('0x23')],_0x478af7[_0xc207('0x1b')]))[_0xc207('0x8')](respondWithResult(_0xe5e848,null))[_0xc207('0x17')](handleError(_0xe5e848,null));};exports[_0xc207('0x24')]=function(_0xc6a7ce,_0x3f79e8){return respondWithRpcPromise(_0xc207('0x25'),_[_0xc207('0x1a')](_0xc6a7ce[_0xc207('0x16')],_0xc6a7ce['params']))[_0xc207('0x8')](respondWithResult(_0x3f79e8,null))[_0xc207('0x17')](handleError(_0x3f79e8,null));};exports[_0xc207('0x26')]=function(_0x448df1,_0x24df00){return respondWithRpcPromise(_0xc207('0x27'),_0x448df1['query'])[_0xc207('0x8')](respondWithResult(_0x24df00,null))[_0xc207('0x17')](handleError(_0x24df00,null));};exports[_0xc207('0x28')]=function(_0x1d12fa,_0x58e906){return respondWithRpcPromise(_0xc207('0x29'),_[_0xc207('0x1a')](_0x1d12fa[_0xc207('0x16')],_0x1d12fa[_0xc207('0x1b')]))[_0xc207('0x8')](respondWithResult(_0x58e906,null))[_0xc207('0x17')](handleError(_0x58e906,null));};exports[_0xc207('0x2a')]=function(_0x458de9,_0x586776){return respondWithRpcPromise('VoiceQueuesChannelHangup',_['merge'](_0x458de9[_0xc207('0x16')],_0x458de9[_0xc207('0x1b')]))[_0xc207('0x8')](respondWithResult(_0x586776,null))[_0xc207('0x17')](handleError(_0x586776,null));};exports['voiceQueuesChannelRedirect']=function(_0x3bfbf4,_0x433c0f){return respondWithRpcPromise(_0xc207('0x2b'),_[_0xc207('0x1a')](_0x3bfbf4[_0xc207('0x16')],_0x3bfbf4['params']))[_0xc207('0x8')](respondWithResult(_0x433c0f,null))[_0xc207('0x17')](handleError(_0x433c0f,null));};exports['outbound']=function(_0x21dd42,_0x49bada){return respondWithRpcPromise(_0xc207('0x2c'),_0x21dd42[_0xc207('0x16')])['then'](respondWithResult(_0x49bada,null))[_0xc207('0x17')](handleError(_0x49bada,null));};exports[_0xc207('0x2d')]=function(_0x3313b1,_0x502dde){return respondWithRpcPromise('OutboundChannels',_0x3313b1[_0xc207('0x16')])[_0xc207('0x8')](respondWithResult(_0x502dde,null))[_0xc207('0x17')](handleError(_0x502dde,null));};exports[_0xc207('0x2e')]=function(_0x4c3e29,_0x3a6f45){var _0x47cdc4;return respondWithRpcPromise('Agents',_0x4c3e29['query'])['then'](function(_0x20cb64){_0x47cdc4=_0x20cb64;return respondWithRpcPromise(_0xc207('0x2f'),_0x4c3e29[_0xc207('0x16')],routingClient);})['then'](function(_0x1dd71e){return _[_0xc207('0x1a')]({},_0x1dd71e,_0x47cdc4);})[_0xc207('0x8')](respondWithResult(_0x3a6f45,null))[_0xc207('0x17')](handleError(_0x3a6f45,null));};exports['agentCapacity']=function(_0x47d43a,_0x223349){if(_0x47d43a[_0xc207('0x23')]&&_0x47d43a[_0xc207('0x23')][_0xc207('0x30')]&&_0x47d43a['user']&&_0x47d43a[_0xc207('0x31')][_0xc207('0x10')]){for(var _0x3a935a in _0x47d43a[_0xc207('0x23')][_0xc207('0x30')]){if(_0x47d43a[_0xc207('0x23')][_0xc207('0x30')][_0xc207('0x32')](_0x3a935a)){db[_0xc207('0x33')]['findAll']({'where':{'channel':_0x3a935a,'membername':_0x47d43a[_0xc207('0x31')][_0xc207('0x10')],'type':'INTERACTION','exitAt':null,'uniqueid':_0x47d43a[_0xc207('0x23')][_0xc207('0x30')][_0x3a935a]&&_0x47d43a[_0xc207('0x23')][_0xc207('0x30')][_0x3a935a][_0xc207('0x34')]?{'$notIn':_0x47d43a['body'][_0xc207('0x30')][_0x3a935a]}:{'$ne':null}}})[_0xc207('0x8')](function(_0x17da25){var _0x5b50cf=moment()[_0xc207('0x35')](_0xc207('0x36'));for(var _0x2967ad=0x0,_0x45536e=_0x17da25['length'];_0x2967ad<_0x45536e;_0x2967ad+=0x1){_0x17da25[_0x2967ad]['updateAttributes']({'exitAt':_0x5b50cf});}});for(var _0x11ce5a=0x0;_0x11ce5a<_0x47d43a[_0xc207('0x23')][_0xc207('0x30')][_0x3a935a][_0xc207('0x34')];_0x11ce5a+=0x1){db[_0xc207('0x33')][_0xc207('0x37')]({'where':{'channel':_0x3a935a,'membername':_0x47d43a[_0xc207('0x31')][_0xc207('0x10')],'type':_0xc207('0x38'),'uniqueid':_0x47d43a[_0xc207('0x23')][_0xc207('0x30')][_0x3a935a][_0x11ce5a],'exitAt':null},'defaults':{'channel':_0x3a935a,'membername':_0x47d43a[_0xc207('0x31')]['name'],'interface':_['isNil'](_0x47d43a[_0xc207('0x31')][_0xc207('0x39')])?util[_0xc207('0x35')]('SIP/%s',_0x47d43a[_0xc207('0x31')][_0xc207('0x10')]):_0x47d43a[_0xc207('0x31')][_0xc207('0x39')],'type':'INTERACTION','enterAt':moment()[_0xc207('0x35')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0xc207('0x3a'),'internal':_0x47d43a['user']['internal'],'uniqueid':_0x47d43a[_0xc207('0x23')][_0xc207('0x30')][_0x3a935a][_0x11ce5a]}});}}}}return respondWithRpcPromise('AgentCapacity',{'id':_0x47d43a['params']['id'],'capacity':_0x47d43a['body'][_0xc207('0x3b')]},routingClient)[_0xc207('0x8')](respondWithResult(_0x223349,null))[_0xc207('0x17')](handleError(_0x223349,null));};exports[_0xc207('0x3c')]=function(_0x173acf,_0x35e967){return respondWithRpcPromise(_0xc207('0x3d'),_0x173acf[_0xc207('0x16')])['then'](respondWithResult(_0x35e967,null))[_0xc207('0x17')](handleError(_0x35e967,null));};exports[_0xc207('0x3e')]=function(_0x5aedd3,_0x55e0c5){return respondWithRpcPromise(_0xc207('0x3f'),_0x5aedd3['query'])['then'](respondWithResult(_0x55e0c5,null))[_0xc207('0x17')](handleError(_0x55e0c5,null));};exports[_0xc207('0x40')]=function(_0x356c8c,_0x3b2448){return respondWithRpcPromise(_0xc207('0x41'),_0x356c8c[_0xc207('0x16')])[_0xc207('0x8')](respondWithResult(_0x3b2448,null))[_0xc207('0x17')](handleError(_0x3b2448,null));};exports[_0xc207('0x42')]=function(_0x278717,_0x2fcfee){return respondWithRpcPromise('ChatQueues',_0x278717['query'],routingClient)[_0xc207('0x8')](respondWithResult(_0x2fcfee,null))[_0xc207('0x17')](handleError(_0x2fcfee,null));};exports[_0xc207('0x43')]=function(_0x313580,_0xaff7a0){return respondWithRpcPromise(_0xc207('0x44'),_0x313580[_0xc207('0x16')],routingClient)[_0xc207('0x8')](findById(_0x313580[_0xc207('0x1b')]['id']))['then'](respondWithResult(_0xaff7a0,null))[_0xc207('0x17')](handleError(_0xaff7a0,null));};exports[_0xc207('0x45')]=function(_0x19637d,_0x6d387e){return respondWithRpcPromise('MailQueues',_0x19637d[_0xc207('0x16')],routingClient)[_0xc207('0x8')](respondWithResult(_0x6d387e,null))[_0xc207('0x17')](handleError(_0x6d387e,null));};exports[_0xc207('0x46')]=function(_0x464263,_0x45ad58){return respondWithRpcPromise(_0xc207('0x47'),_0x464263['query'],routingClient)[_0xc207('0x8')](findById(_0x464263[_0xc207('0x1b')]['id']))[_0xc207('0x8')](respondWithResult(_0x45ad58,null))[_0xc207('0x17')](handleError(_0x45ad58,null));};exports['mailAccounts']=function(_0xc7812,_0x4f4b58){return respondWithRpcPromise('MailAccounts',_0xc7812[_0xc207('0x16')],mailClient)[_0xc207('0x8')](respondWithResult(_0x4f4b58,null))[_0xc207('0x17')](handleError(_0x4f4b58,null));};exports[_0xc207('0x48')]=function(_0x441d5f,_0x3b1b4c){return respondWithRpcPromise(_0xc207('0x49'),_0x441d5f[_0xc207('0x16')],routingClient)[_0xc207('0x8')](respondWithResult(_0x3b1b4c,null))[_0xc207('0x17')](handleError(_0x3b1b4c,null));};exports[_0xc207('0x4a')]=function(_0x2f97bf,_0x416e85){return respondWithRpcPromise(_0xc207('0x49'),_0x2f97bf[_0xc207('0x16')],routingClient)['then'](findById(_0x2f97bf[_0xc207('0x1b')]['id']))['then'](respondWithResult(_0x416e85,null))[_0xc207('0x17')](handleError(_0x416e85,null));};exports[_0xc207('0x4b')]=function(_0x2ade23,_0x52dec1){return respondWithRpcPromise('SmsQueues',_0x2ade23[_0xc207('0x16')],routingClient)[_0xc207('0x8')](respondWithResult(_0x52dec1,null))[_0xc207('0x17')](handleError(_0x52dec1,null));};exports['showSmsQueues']=function(_0x31182c,_0x1cefa3){return respondWithRpcPromise(_0xc207('0x4c'),_0x31182c['query'],routingClient)['then'](findById(_0x31182c[_0xc207('0x1b')]['id']))['then'](respondWithResult(_0x1cefa3,null))[_0xc207('0x17')](handleError(_0x1cefa3,null));};exports[_0xc207('0x4d')]=function(_0x3cca53,_0x4b197){return respondWithRpcPromise(_0xc207('0x4e'),_0x3cca53[_0xc207('0x16')],routingClient)[_0xc207('0x8')](respondWithResult(_0x4b197,null))[_0xc207('0x17')](handleError(_0x4b197,null));};exports['showWhatsappQueues']=function(_0x289f7c,_0x85ecad){return respondWithRpcPromise(_0xc207('0x4e'),_0x289f7c[_0xc207('0x16')],routingClient)[_0xc207('0x8')](findById(_0x289f7c[_0xc207('0x1b')]['id']))[_0xc207('0x8')](respondWithResult(_0x85ecad,null))[_0xc207('0x17')](handleError(_0x85ecad,null));};exports[_0xc207('0x4f')]=function(_0x28f467,_0x203686){return respondWithRpcPromise('FaxQueues',_0x28f467[_0xc207('0x16')],routingClient)[_0xc207('0x8')](respondWithResult(_0x203686,null))[_0xc207('0x17')](handleError(_0x203686,null));};exports[_0xc207('0x50')]=function(_0x584a40,_0x586c41){return respondWithRpcPromise(_0xc207('0x51'),_0x584a40[_0xc207('0x16')],routingClient)[_0xc207('0x8')](findById(_0x584a40[_0xc207('0x1b')]['id']))['then'](respondWithResult(_0x586c41,null))[_0xc207('0x17')](handleError(_0x586c41,null));};exports[_0xc207('0x52')]=function(_0x440fc2,_0x5a04d5){return respondWithRpcPromise(_0xc207('0x53'),_0x440fc2[_0xc207('0x16')])[_0xc207('0x8')](respondWithResult(_0x5a04d5,null))['catch'](handleError(_0x5a04d5,null));};exports[_0xc207('0x54')]=function(_0x488c1f,_0x1290e4){return respondWithRpcPromise('ChatQueuesWaitingInteractions',_0x488c1f[_0xc207('0x16')],routingClient)[_0xc207('0x8')](respondWithResult(_0x1290e4,null))['catch'](handleError(_0x1290e4,null));};exports[_0xc207('0x55')]=function(_0x4c0ef0,_0x446fe8){return respondWithRpcPromise(_0xc207('0x56'),_0x4c0ef0[_0xc207('0x16')],routingClient)[_0xc207('0x8')](respondWithResult(_0x446fe8,null))[_0xc207('0x17')](handleError(_0x446fe8,null));};exports['openchannelQueuesWaitingInteractions']=function(_0x4b9342,_0x3d1659){return respondWithRpcPromise(_0xc207('0x57'),_0x4b9342['query'],routingClient)[_0xc207('0x8')](respondWithResult(_0x3d1659,null))[_0xc207('0x17')](handleError(_0x3d1659,null));};exports['openchannelQueuesIdWaitingInteractions']=function(_0x10ab93,_0x13954e){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x10ab93[_0xc207('0x16')],routingClient)[_0xc207('0x8')](function(_0x3748de){if(_0x10ab93[_0xc207('0x16')][_0xc207('0x58')]!==undefined){var _0xef037c=_(_0x3748de['rows'])['filter']([_0x10ab93[_0xc207('0x16')][_0xc207('0x58')],_0x10ab93[_0xc207('0x1b')]['id']])[_0xc207('0x59')](_0xc207('0x5a'))['uniq']()[_0xc207('0x5b')]();return _0x3748de['rows'][_0xc207('0x5c')](function(_0x97f43){return _0xef037c[_0xc207('0x5d')](_0x97f43[_0xc207('0x5a')])>-0x1;});}else{return _0x3748de[_0xc207('0x12')][_0xc207('0x5c')](function(_0x49ebe1){return _0x49ebe1[_0xc207('0x5a')]===parseInt(_0x10ab93[_0xc207('0x1b')]['id']);});}})['then'](respondWithResult(_0x13954e,null))[_0xc207('0x17')](handleError(_0x13954e,null));};exports[_0xc207('0x5e')]=function(_0x36e8b1,_0x3cb12d){return respondWithRpcPromise(_0xc207('0x5f'),_0x36e8b1[_0xc207('0x16')],routingClient)[_0xc207('0x8')](respondWithResult(_0x3cb12d,null))[_0xc207('0x17')](handleError(_0x3cb12d,null));};exports[_0xc207('0x60')]=function(_0x281c71,_0x473560){return respondWithRpcPromise(_0xc207('0x61'),_0x281c71[_0xc207('0x16')],routingClient)['then'](respondWithResult(_0x473560,null))[_0xc207('0x17')](handleError(_0x473560,null));};exports[_0xc207('0x62')]=function(_0x2f4efd,_0x266e65){return respondWithRpcPromise('FaxQueuesWaitingInteractions',_0x2f4efd[_0xc207('0x16')],routingClient)['then'](respondWithResult(_0x266e65,null))[_0xc207('0x17')](handleError(_0x266e65,null));};exports['queueNotify']=function(_0x53cb21){return function(_0x2967e6,_0x220293){var _0x383f83,_0x3adfeb;var _0x20089a=_[_0xc207('0x63')](_0x53cb21);var _0x51b775=_0x53cb21===_0xc207('0x64')?'Website':_0xc207('0x65');return db[_0x20089a+_0xc207('0x66')][_0xc207('0x67')]({'raw':!![],'where':{'id':_0x2967e6[_0xc207('0x1b')]['id']}})['then'](function(_0x25731c){if(_[_0xc207('0x11')](_0x25731c)){throw new Error(_0x20089a+'\x20Queue\x20not\x20found');}_0x383f83=_0x25731c;return db[_0x20089a+_0xc207('0x68')][_0xc207('0x67')]({'where':{'id':_0x2967e6[_0xc207('0x23')][_0xc207('0x69')]},'include':[{'model':db[_0x20089a+'Interaction'],'as':_0xc207('0x6a')},{'model':db[_0x20089a+_0x51b775],'as':_0xc207('0x65')}]});})[_0xc207('0x8')](function(_0x297ee0){if(_['isNil'](_0x297ee0)){throw new Error(_0x20089a+'\x20Message\x20not\x20found');}_0x3adfeb=_0x297ee0;return _0x297ee0['update']({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x273b30={'uniqueid':_0x53cb21+'.'+_0x3adfeb['id']+'.'+_0x3adfeb[_0xc207('0x6a')]['id'],'FromUserId':_0x2967e6[_0xc207('0x31')]['id'],'type':_0xc207('0x6b')};_0x273b30[_0x20089a+'MessageId']=_0x3adfeb['id'];_0x273b30[_0x20089a+'InteractionId']=_0x3adfeb[_0xc207('0x6a')]['id'];_0x273b30['From'+_0x20089a+_0x51b775+'Id']=_0x3adfeb['Account']['id'];_0x273b30['To'+_0x20089a+_0xc207('0x6c')]=_0x383f83['id'];return db[_0x20089a+_0xc207('0x6d')][_0xc207('0x6e')](_0x273b30);})[_0xc207('0x8')](function(){return respondWithRpcPromise(_0xc207('0x6f'),{'channel':_0x53cb21,'interaction':_0x3adfeb['Interaction'],'message':_0x3adfeb,'account':_0x3adfeb[_0xc207('0x65')],'applications':[{'id':0x0,'priority':0x1,'app':'queue','appdata':_0x383f83[_0xc207('0x10')]+','+(_0x3adfeb[_0xc207('0x65')][_0xc207('0x70')]||0x12c),'interval':'*,*,*,*'}]},routingClient);})['then'](respondWithResult(_0x220293,null))[_0xc207('0x17')](handleError(_0x220293,null));};};exports[_0xc207('0x71')]=function(_0x1841a4,_0x7d4f9c){var _0x4e5b1c,_0x4d05e5;if(_[_0xc207('0x11')](_0x1841a4['body'][_0xc207('0x72')])){throw new Error(_0xc207('0x73'));}var _0x211884=_0x1841a4[_0xc207('0x23')][_0xc207('0x72')];var _0x5a7bc9=_[_0xc207('0x63')](_0x211884);var _0x328016=_0x211884===_0xc207('0x64')?_0xc207('0x74'):_0xc207('0x65');return db[_0xc207('0x75')][_0xc207('0x67')]({'raw':!![],'where':{'id':_0x1841a4[_0xc207('0x1b')]['id'],'role':_0xc207('0x3a')}})[_0xc207('0x8')](function(_0x48213b){if(_[_0xc207('0x11')](_0x48213b)){throw new Error('Agent\x20not\x20found');}_0x4e5b1c=_0x48213b;return db[_0x5a7bc9+'Message'][_0xc207('0x67')]({'where':{'id':_0x1841a4[_0xc207('0x23')]['messageId']},'include':[{'model':db[_0x5a7bc9+'Interaction'],'as':_0xc207('0x6a')},{'model':db[_0x5a7bc9+_0x328016],'as':_0xc207('0x65')}]});})[_0xc207('0x8')](function(_0x41b655){if(_['isNil'](_0x41b655)){throw new Error(_0x5a7bc9+_0xc207('0x76'));}_0x4d05e5=_0x41b655;return _0x41b655['update']({'read':0x0,'readAt':null,'UserId':null});})[_0xc207('0x8')](function(){var _0x1c7886={'uniqueid':_0x211884+'.'+_0x4d05e5['id']+'.'+_0x4d05e5[_0xc207('0x6a')]['id'],'FromUserId':_0x1841a4[_0xc207('0x31')]['id'],'type':_0xc207('0x6b'),'ToUserId':_0x4e5b1c['id']};_0x1c7886[_0x5a7bc9+_0xc207('0x77')]=_0x4d05e5['id'];_0x1c7886[_0x5a7bc9+'InteractionId']=_0x4d05e5[_0xc207('0x6a')]['id'];_0x1c7886[_0xc207('0x78')+_0x5a7bc9+_0x328016+'Id']=_0x4d05e5['Account']['id'];return db[_0x5a7bc9+'TransferReport']['create'](_0x1c7886);})['then'](function(){return respondWithRpcPromise('Start',{'channel':_0x211884,'interaction':_0x4d05e5[_0xc207('0x6a')],'message':_0x4d05e5,'account':_0x4d05e5[_0xc207('0x65')],'applications':[{'id':0x0,'priority':0x1,'app':_0xc207('0x3a'),'appdata':_0x4e5b1c['name']+','+(_0x4d05e5[_0xc207('0x65')]['agentTransferTimeout']||0x12c),'interval':_0xc207('0x79')}]},routingClient);})[_0xc207('0x8')](respondWithResult(_0x7d4f9c,null))[_0xc207('0x17')](handleError(_0x7d4f9c,null));};
\ No newline at end of file
+var _0x2675=['request','error','result','catch','status','json','sendStatus','name','send','isNil','rows','find','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','then','voiceChannelStopMixMonitor','params','voiceQueues','VoiceQueues','updateVoiceQueue','body','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','merge','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outbound','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','interaction','user','hasOwnProperty','findAll','INTERACTION','length','format','MemberReport','findOrCreate','interface','SIP/%s','YYYY-MM-DD\x20HH:mm:ss','agent','internal','AgentCapacity','telephones','Telephones','trunks','Trunks','Campaigns','ChatQueues','showChatQueues','mailQueues','MailQueues','showMailQueues','mailAccounts','MailAccounts','showOpenchannelQueues','OpenchannelQueues','smsQueues','SmsQueues','showSmsQueues','whatsappQueues','WhatsappQueues','showWhatsappQueues','FaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','filter','type','map','queue_id','indexOf','SmsQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','chat','Website','Account','Queue','\x20Queue\x20not\x20found','messageId','Interaction','\x20Message\x20not\x20found','update','queue','MessageId','InteractionId','QueueId','TransferReport','create','Start','queueTransferTimeout','*,*,*,*','agentNotify','channel','Agent\x20not\x20found','Message','findOne','agentTransferTimeout','bluebird','../../mysqldb','../../config/logger','jayson/promise','client','http'];(function(_0x379c3e,_0x5c9d34){var _0x20fa30=function(_0x5cd11f){while(--_0x5cd11f){_0x379c3e['push'](_0x379c3e['shift']());}};_0x20fa30(++_0x5c9d34);}(_0x2675,0x75));var _0x5267=function(_0x14fc6d,_0x8dbe60){_0x14fc6d=_0x14fc6d-0x0;var _0x2fdf68=_0x2675[_0x14fc6d];return _0x2fdf68;};'use strict';var BPromise=require(_0x5267('0x0'));var moment=require('moment');var _=require('lodash');var util=require('util');var db=require(_0x5267('0x1'))['db'];var logger=require(_0x5267('0x2'))('api');var jayson=require(_0x5267('0x3'));var amiClient=jayson[_0x5267('0x4')]['http']({'port':0x232a});var mailClient=jayson[_0x5267('0x4')][_0x5267('0x5')]({'port':0x232b});var routingClient=jayson[_0x5267('0x4')][_0x5267('0x5')]({'port':0x232c});function respondWithRpcPromise(_0x20f065,_0xc56cd5,_0x527c16){return new BPromise(function(_0x9e0a27,_0x46bfdf){var _0x506fd7=_0x527c16?_0x527c16:amiClient;return _0x506fd7[_0x5267('0x6')](_0x20f065,_0xc56cd5)['then'](function(_0x3ff4e9){if(_0x3ff4e9[_0x5267('0x7')]){if(_0x3ff4e9[_0x5267('0x7')]['code']===0x1f4){return _0x46bfdf(_0x3ff4e9[_0x5267('0x7')]['message']);}return _0x9e0a27(_0x3ff4e9[_0x5267('0x7')]['message']);}else{_0x9e0a27(_0x3ff4e9[_0x5267('0x8')]);}})[_0x5267('0x9')](function(_0x268a8a){_0x46bfdf(_0x268a8a);});});}function respondWithResult(_0x1f9be3,_0x1d7090){_0x1d7090=_0x1d7090||0xc8;return function(_0x1171b9){if(_0x1171b9){return _0x1f9be3[_0x5267('0xa')](_0x1d7090)[_0x5267('0xb')](_0x1171b9);}return _0x1f9be3[_0x5267('0xc')](0x194);};}function handleError(_0x1e2d3b,_0x16e5a7){_0x16e5a7=_0x16e5a7||0x1f4;return function(_0x29349a){logger[_0x5267('0x7')](_0x29349a['stack']);if(_0x29349a['name']){delete _0x29349a[_0x5267('0xd')];}_0x1e2d3b[_0x5267('0xa')](_0x16e5a7)[_0x5267('0xe')](_0x29349a);};}function findById(_0x3f5344){return function(_0x46b2c2){if(!_[_0x5267('0xf')](_0x3f5344)&&!_[_0x5267('0xf')](_0x46b2c2)&&!_[_0x5267('0xf')](_0x46b2c2[_0x5267('0x10')])){return _[_0x5267('0x11')](_0x46b2c2[_0x5267('0x10')],function(_0x1ab03){return _0x1ab03['id']==_0x3f5344;});}return null;};}exports['voiceChannels']=function(_0x18f32e,_0x2afd38){return respondWithRpcPromise('VoiceChannels',_0x18f32e[_0x5267('0x12')])['then'](respondWithResult(_0x2afd38,null))[_0x5267('0x9')](handleError(_0x2afd38,null));};exports[_0x5267('0x13')]=function(_0x39c0c3,_0x2a9f99){return respondWithRpcPromise(_0x5267('0x14'),_['merge'](_0x39c0c3[_0x5267('0x12')],_0x39c0c3['params']))[_0x5267('0x15')](respondWithResult(_0x2a9f99,null))[_0x5267('0x9')](handleError(_0x2a9f99,null));};exports[_0x5267('0x16')]=function(_0x56dd95,_0x499f19){return respondWithRpcPromise('VoiceChannelStopMixMonitor',_['merge'](_0x56dd95['query'],_0x56dd95[_0x5267('0x17')]))[_0x5267('0x15')](respondWithResult(_0x499f19,null))[_0x5267('0x9')](handleError(_0x499f19,null));};exports[_0x5267('0x18')]=function(_0x11c8ea,_0x40d1be){return respondWithRpcPromise(_0x5267('0x19'),_0x11c8ea[_0x5267('0x12')])[_0x5267('0x15')](respondWithResult(_0x40d1be,null))['catch'](handleError(_0x40d1be,null));};exports['showVoiceQueues']=function(_0x354111,_0x472938){return respondWithRpcPromise('VoiceQueues',_0x354111[_0x5267('0x12')])['then'](findById(_0x354111['params']['id']))[_0x5267('0x15')](respondWithResult(_0x472938,null))[_0x5267('0x9')](handleError(_0x472938,null));};exports[_0x5267('0x1a')]=function(_0x2d2ace,_0x33c431){return respondWithRpcPromise('UpdateVoiceQueue',_['merge'](_0x2d2ace[_0x5267('0x1b')],_0x2d2ace[_0x5267('0x17')]))[_0x5267('0x15')](respondWithResult(_0x33c431,null))['catch'](handleError(_0x33c431,null));};exports['voiceQueuesPreview']=function(_0xbe7922,_0x3ef2a8){return respondWithRpcPromise(_0x5267('0x1c'),_['merge'](_0xbe7922['query'],_0xbe7922[_0x5267('0x17')]))[_0x5267('0x15')](respondWithResult(_0x3ef2a8,null))[_0x5267('0x9')](handleError(_0x3ef2a8,null));};exports[_0x5267('0x1d')]=function(_0x5bbb83,_0x33e456){return respondWithRpcPromise(_0x5267('0x1e'),_0x5bbb83[_0x5267('0x12')])[_0x5267('0x15')](respondWithResult(_0x33e456,null))[_0x5267('0x9')](handleError(_0x33e456,null));};exports[_0x5267('0x1f')]=function(_0x341bae,_0x1dda95){return respondWithRpcPromise('VoiceQueuesChannel',_['merge'](_0x341bae[_0x5267('0x12')],_0x341bae['params']))[_0x5267('0x15')](respondWithResult(_0x1dda95,null))[_0x5267('0x9')](handleError(_0x1dda95,null));};exports[_0x5267('0x20')]=function(_0x3a729c,_0x4ac4a0){return respondWithRpcPromise(_0x5267('0x21'),_[_0x5267('0x22')](_0x3a729c[_0x5267('0x12')],_0x3a729c[_0x5267('0x17')]))[_0x5267('0x15')](respondWithResult(_0x4ac4a0,null))[_0x5267('0x9')](handleError(_0x4ac4a0,null));};exports[_0x5267('0x23')]=function(_0xa0ea89,_0x484b77){return respondWithRpcPromise(_0x5267('0x24'),_['merge'](_0xa0ea89[_0x5267('0x12')],_0xa0ea89[_0x5267('0x17')]))[_0x5267('0x15')](respondWithResult(_0x484b77,null))[_0x5267('0x9')](handleError(_0x484b77,null));};exports[_0x5267('0x25')]=function(_0x33ecd7,_0x465ad9){return respondWithRpcPromise('Outbound',_0x33ecd7[_0x5267('0x12')])[_0x5267('0x15')](respondWithResult(_0x465ad9,null))[_0x5267('0x9')](handleError(_0x465ad9,null));};exports[_0x5267('0x26')]=function(_0x82cea7,_0x21eabf){return respondWithRpcPromise(_0x5267('0x27'),_0x82cea7['query'])[_0x5267('0x15')](respondWithResult(_0x21eabf,null))['catch'](handleError(_0x21eabf,null));};exports[_0x5267('0x28')]=function(_0x5c0cdf,_0x4dee66){var _0x51bddd;return respondWithRpcPromise(_0x5267('0x29'),_0x5c0cdf['query'])[_0x5267('0x15')](function(_0x146476){_0x51bddd=_0x146476;return respondWithRpcPromise(_0x5267('0x29'),_0x5c0cdf[_0x5267('0x12')],routingClient);})['then'](function(_0x456b33){return _[_0x5267('0x22')]({},_0x456b33,_0x51bddd);})['then'](respondWithResult(_0x4dee66,null))['catch'](handleError(_0x4dee66,null));};exports[_0x5267('0x2a')]=function(_0x560cdf,_0x12df83){if(_0x560cdf[_0x5267('0x1b')]&&_0x560cdf[_0x5267('0x1b')][_0x5267('0x2b')]&&_0x560cdf[_0x5267('0x2c')]&&_0x560cdf[_0x5267('0x2c')][_0x5267('0xd')]){for(var _0x5697b3 in _0x560cdf['body'][_0x5267('0x2b')]){if(_0x560cdf['body'][_0x5267('0x2b')][_0x5267('0x2d')](_0x5697b3)){db['MemberReport'][_0x5267('0x2e')]({'where':{'channel':_0x5697b3,'membername':_0x560cdf[_0x5267('0x2c')][_0x5267('0xd')],'type':_0x5267('0x2f'),'exitAt':null,'uniqueid':_0x560cdf[_0x5267('0x1b')][_0x5267('0x2b')][_0x5697b3]&&_0x560cdf[_0x5267('0x1b')][_0x5267('0x2b')][_0x5697b3][_0x5267('0x30')]?{'$notIn':_0x560cdf['body'][_0x5267('0x2b')][_0x5697b3]}:{'$ne':null}}})[_0x5267('0x15')](function(_0x19b015){var _0x45241a=moment()[_0x5267('0x31')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x3d15ac=0x0,_0x4e0132=_0x19b015[_0x5267('0x30')];_0x3d15ac<_0x4e0132;_0x3d15ac+=0x1){_0x19b015[_0x3d15ac]['updateAttributes']({'exitAt':_0x45241a});}});for(var _0x4ae9f9=0x0;_0x4ae9f9<_0x560cdf[_0x5267('0x1b')]['interaction'][_0x5697b3][_0x5267('0x30')];_0x4ae9f9+=0x1){db[_0x5267('0x32')][_0x5267('0x33')]({'where':{'channel':_0x5697b3,'membername':_0x560cdf[_0x5267('0x2c')]['name'],'type':_0x5267('0x2f'),'uniqueid':_0x560cdf['body']['interaction'][_0x5697b3][_0x4ae9f9],'exitAt':null},'defaults':{'channel':_0x5697b3,'membername':_0x560cdf[_0x5267('0x2c')][_0x5267('0xd')],'interface':_['isNil'](_0x560cdf['user'][_0x5267('0x34')])?util[_0x5267('0x31')](_0x5267('0x35'),_0x560cdf[_0x5267('0x2c')][_0x5267('0xd')]):_0x560cdf[_0x5267('0x2c')][_0x5267('0x34')],'type':_0x5267('0x2f'),'enterAt':moment()[_0x5267('0x31')](_0x5267('0x36')),'role':_0x5267('0x37'),'internal':_0x560cdf[_0x5267('0x2c')][_0x5267('0x38')],'uniqueid':_0x560cdf[_0x5267('0x1b')]['interaction'][_0x5697b3][_0x4ae9f9]}});}}}}return respondWithRpcPromise(_0x5267('0x39'),{'id':_0x560cdf[_0x5267('0x17')]['id'],'capacity':_0x560cdf[_0x5267('0x1b')]['capacity']},routingClient)[_0x5267('0x15')](respondWithResult(_0x12df83,null))[_0x5267('0x9')](handleError(_0x12df83,null));};exports[_0x5267('0x3a')]=function(_0x2a97f1,_0x119546){return respondWithRpcPromise(_0x5267('0x3b'),_0x2a97f1['query'])[_0x5267('0x15')](respondWithResult(_0x119546,null))['catch'](handleError(_0x119546,null));};exports[_0x5267('0x3c')]=function(_0x30fcd2,_0xa49fd7){return respondWithRpcPromise(_0x5267('0x3d'),_0x30fcd2[_0x5267('0x12')])[_0x5267('0x15')](respondWithResult(_0xa49fd7,null))[_0x5267('0x9')](handleError(_0xa49fd7,null));};exports['campaigns']=function(_0x57ca8f,_0x200855){return respondWithRpcPromise(_0x5267('0x3e'),_0x57ca8f['query'])[_0x5267('0x15')](respondWithResult(_0x200855,null))['catch'](handleError(_0x200855,null));};exports['chatQueues']=function(_0x1eeb21,_0x79cee1){return respondWithRpcPromise(_0x5267('0x3f'),_0x1eeb21[_0x5267('0x12')],routingClient)[_0x5267('0x15')](respondWithResult(_0x79cee1,null))[_0x5267('0x9')](handleError(_0x79cee1,null));};exports[_0x5267('0x40')]=function(_0x3fd8f9,_0xf0b5a9){return respondWithRpcPromise(_0x5267('0x3f'),_0x3fd8f9['query'],routingClient)[_0x5267('0x15')](findById(_0x3fd8f9[_0x5267('0x17')]['id']))[_0x5267('0x15')](respondWithResult(_0xf0b5a9,null))[_0x5267('0x9')](handleError(_0xf0b5a9,null));};exports[_0x5267('0x41')]=function(_0x34c205,_0x552211){return respondWithRpcPromise(_0x5267('0x42'),_0x34c205['query'],routingClient)[_0x5267('0x15')](respondWithResult(_0x552211,null))[_0x5267('0x9')](handleError(_0x552211,null));};exports[_0x5267('0x43')]=function(_0x4a72c3,_0x1593ce){return respondWithRpcPromise(_0x5267('0x42'),_0x4a72c3[_0x5267('0x12')],routingClient)[_0x5267('0x15')](findById(_0x4a72c3[_0x5267('0x17')]['id']))[_0x5267('0x15')](respondWithResult(_0x1593ce,null))['catch'](handleError(_0x1593ce,null));};exports[_0x5267('0x44')]=function(_0x190d02,_0x186667){return respondWithRpcPromise(_0x5267('0x45'),_0x190d02['query'],mailClient)['then'](respondWithResult(_0x186667,null))[_0x5267('0x9')](handleError(_0x186667,null));};exports['openchannelQueues']=function(_0x3f5cda,_0x47059c){return respondWithRpcPromise('OpenchannelQueues',_0x3f5cda['query'],routingClient)[_0x5267('0x15')](respondWithResult(_0x47059c,null))[_0x5267('0x9')](handleError(_0x47059c,null));};exports[_0x5267('0x46')]=function(_0x537f75,_0x457dca){return respondWithRpcPromise(_0x5267('0x47'),_0x537f75[_0x5267('0x12')],routingClient)[_0x5267('0x15')](findById(_0x537f75['params']['id']))['then'](respondWithResult(_0x457dca,null))['catch'](handleError(_0x457dca,null));};exports[_0x5267('0x48')]=function(_0x2457a3,_0x45ee25){return respondWithRpcPromise(_0x5267('0x49'),_0x2457a3[_0x5267('0x12')],routingClient)[_0x5267('0x15')](respondWithResult(_0x45ee25,null))[_0x5267('0x9')](handleError(_0x45ee25,null));};exports[_0x5267('0x4a')]=function(_0x486b02,_0x1ddfad){return respondWithRpcPromise(_0x5267('0x49'),_0x486b02['query'],routingClient)[_0x5267('0x15')](findById(_0x486b02[_0x5267('0x17')]['id']))[_0x5267('0x15')](respondWithResult(_0x1ddfad,null))[_0x5267('0x9')](handleError(_0x1ddfad,null));};exports[_0x5267('0x4b')]=function(_0xde1ecd,_0x4915f4){return respondWithRpcPromise(_0x5267('0x4c'),_0xde1ecd[_0x5267('0x12')],routingClient)[_0x5267('0x15')](respondWithResult(_0x4915f4,null))[_0x5267('0x9')](handleError(_0x4915f4,null));};exports[_0x5267('0x4d')]=function(_0xd9bcf9,_0x4aac32){return respondWithRpcPromise(_0x5267('0x4c'),_0xd9bcf9[_0x5267('0x12')],routingClient)[_0x5267('0x15')](findById(_0xd9bcf9[_0x5267('0x17')]['id']))[_0x5267('0x15')](respondWithResult(_0x4aac32,null))[_0x5267('0x9')](handleError(_0x4aac32,null));};exports['faxQueues']=function(_0x283423,_0x41299c){return respondWithRpcPromise(_0x5267('0x4e'),_0x283423[_0x5267('0x12')],routingClient)['then'](respondWithResult(_0x41299c,null))['catch'](handleError(_0x41299c,null));};exports['showFaxQueues']=function(_0x910f97,_0x5cca85){return respondWithRpcPromise(_0x5267('0x4e'),_0x910f97['query'],routingClient)[_0x5267('0x15')](findById(_0x910f97[_0x5267('0x17')]['id']))[_0x5267('0x15')](respondWithResult(_0x5cca85,null))[_0x5267('0x9')](handleError(_0x5cca85,null));};exports[_0x5267('0x4f')]=function(_0xa92aa5,_0x21338f){return respondWithRpcPromise(_0x5267('0x50'),_0xa92aa5['query'])['then'](respondWithResult(_0x21338f,null))['catch'](handleError(_0x21338f,null));};exports[_0x5267('0x51')]=function(_0x28a101,_0x2ab2be){return respondWithRpcPromise(_0x5267('0x52'),_0x28a101['query'],routingClient)[_0x5267('0x15')](respondWithResult(_0x2ab2be,null))[_0x5267('0x9')](handleError(_0x2ab2be,null));};exports[_0x5267('0x53')]=function(_0xc3ac3f,_0x5a0e73){return respondWithRpcPromise(_0x5267('0x54'),_0xc3ac3f[_0x5267('0x12')],routingClient)['then'](respondWithResult(_0x5a0e73,null))[_0x5267('0x9')](handleError(_0x5a0e73,null));};exports[_0x5267('0x55')]=function(_0x4a9995,_0x47e235){return respondWithRpcPromise(_0x5267('0x56'),_0x4a9995[_0x5267('0x12')],routingClient)['then'](respondWithResult(_0x47e235,null))['catch'](handleError(_0x47e235,null));};exports[_0x5267('0x57')]=function(_0x2e7f8a,_0x35b302){return respondWithRpcPromise(_0x5267('0x56'),_0x2e7f8a[_0x5267('0x12')],routingClient)['then'](function(_0x4643ae){if(_0x2e7f8a[_0x5267('0x12')]['type']!==undefined){var _0x26c628=_(_0x4643ae[_0x5267('0x10')])[_0x5267('0x58')]([_0x2e7f8a[_0x5267('0x12')][_0x5267('0x59')],_0x2e7f8a[_0x5267('0x17')]['id']])[_0x5267('0x5a')](_0x5267('0x5b'))['uniq']()['value']();return _0x4643ae[_0x5267('0x10')][_0x5267('0x58')](function(_0x3f729f){return _0x26c628[_0x5267('0x5c')](_0x3f729f['queue_id'])>-0x1;});}else{return _0x4643ae[_0x5267('0x10')]['filter'](function(_0x2988a1){return _0x2988a1[_0x5267('0x5b')]===parseInt(_0x2e7f8a[_0x5267('0x17')]['id']);});}})[_0x5267('0x15')](respondWithResult(_0x35b302,null))['catch'](handleError(_0x35b302,null));};exports['smsQueuesWaitingInteractions']=function(_0x3a67a0,_0x3e2cf5){return respondWithRpcPromise(_0x5267('0x5d'),_0x3a67a0[_0x5267('0x12')],routingClient)[_0x5267('0x15')](respondWithResult(_0x3e2cf5,null))[_0x5267('0x9')](handleError(_0x3e2cf5,null));};exports['whatsappQueuesWaitingInteractions']=function(_0x1b8d72,_0x4a05c9){return respondWithRpcPromise(_0x5267('0x5e'),_0x1b8d72['query'],routingClient)[_0x5267('0x15')](respondWithResult(_0x4a05c9,null))[_0x5267('0x9')](handleError(_0x4a05c9,null));};exports[_0x5267('0x5f')]=function(_0x87aa90,_0x164cc1){return respondWithRpcPromise(_0x5267('0x60'),_0x87aa90[_0x5267('0x12')],routingClient)[_0x5267('0x15')](respondWithResult(_0x164cc1,null))[_0x5267('0x9')](handleError(_0x164cc1,null));};exports[_0x5267('0x61')]=function(_0x555c8){return function(_0x531bb9,_0x40c7b5){var _0x14baf4,_0x4d9ec9;var _0xde179f=_[_0x5267('0x62')](_0x555c8);var _0x3ebda6=_0x555c8===_0x5267('0x63')?_0x5267('0x64'):_0x5267('0x65');return db[_0xde179f+_0x5267('0x66')]['findOne']({'raw':!![],'where':{'id':_0x531bb9[_0x5267('0x17')]['id']}})[_0x5267('0x15')](function(_0x2543a4){if(_[_0x5267('0xf')](_0x2543a4)){throw new Error(_0xde179f+_0x5267('0x67'));}_0x14baf4=_0x2543a4;return db[_0xde179f+'Message']['findOne']({'where':{'id':_0x531bb9[_0x5267('0x1b')][_0x5267('0x68')]},'include':[{'model':db[_0xde179f+_0x5267('0x69')],'as':_0x5267('0x69')},{'model':db[_0xde179f+_0x3ebda6],'as':'Account'}]});})[_0x5267('0x15')](function(_0x3cc775){if(_[_0x5267('0xf')](_0x3cc775)){throw new Error(_0xde179f+_0x5267('0x6a'));}_0x4d9ec9=_0x3cc775;return _0x3cc775[_0x5267('0x6b')]({'read':0x0,'readAt':null,'UserId':null});})[_0x5267('0x15')](function(){var _0x2b38f2={'uniqueid':_0x555c8+'.'+_0x4d9ec9['id']+'.'+_0x4d9ec9[_0x5267('0x69')]['id'],'FromUserId':_0x531bb9[_0x5267('0x2c')]['id'],'type':_0x5267('0x6c')};_0x2b38f2[_0xde179f+_0x5267('0x6d')]=_0x4d9ec9['id'];_0x2b38f2[_0xde179f+_0x5267('0x6e')]=_0x4d9ec9[_0x5267('0x69')]['id'];_0x2b38f2['From'+_0xde179f+_0x3ebda6+'Id']=_0x4d9ec9[_0x5267('0x65')]['id'];_0x2b38f2['To'+_0xde179f+_0x5267('0x6f')]=_0x14baf4['id'];return db[_0xde179f+_0x5267('0x70')][_0x5267('0x71')](_0x2b38f2);})[_0x5267('0x15')](function(){return respondWithRpcPromise(_0x5267('0x72'),{'channel':_0x555c8,'interaction':_0x4d9ec9[_0x5267('0x69')],'message':_0x4d9ec9,'account':_0x4d9ec9[_0x5267('0x65')],'applications':[{'id':0x0,'priority':0x1,'app':_0x5267('0x6c'),'appdata':_0x14baf4[_0x5267('0xd')]+','+(_0x4d9ec9[_0x5267('0x65')][_0x5267('0x73')]||0x12c),'interval':_0x5267('0x74')}]},routingClient);})[_0x5267('0x15')](respondWithResult(_0x40c7b5,null))[_0x5267('0x9')](handleError(_0x40c7b5,null));};};exports[_0x5267('0x75')]=function(_0x28884b,_0x35a4a3){var _0x7ecf0e,_0x676556;if(_[_0x5267('0xf')](_0x28884b[_0x5267('0x1b')][_0x5267('0x76')])){throw new Error('Channel\x20field\x20is\x20mandatory');}var _0x339f3f=_0x28884b[_0x5267('0x1b')][_0x5267('0x76')];var _0x405eb4=_[_0x5267('0x62')](_0x339f3f);var _0x557749=_0x339f3f===_0x5267('0x63')?_0x5267('0x64'):'Account';return db['User']['findOne']({'raw':!![],'where':{'id':_0x28884b[_0x5267('0x17')]['id'],'role':'agent'}})[_0x5267('0x15')](function(_0x54422c){if(_['isNil'](_0x54422c)){throw new Error(_0x5267('0x77'));}_0x7ecf0e=_0x54422c;return db[_0x405eb4+_0x5267('0x78')][_0x5267('0x79')]({'where':{'id':_0x28884b[_0x5267('0x1b')][_0x5267('0x68')]},'include':[{'model':db[_0x405eb4+'Interaction'],'as':'Interaction'},{'model':db[_0x405eb4+_0x557749],'as':_0x5267('0x65')}]});})[_0x5267('0x15')](function(_0x1a6245){if(_[_0x5267('0xf')](_0x1a6245)){throw new Error(_0x405eb4+_0x5267('0x6a'));}_0x676556=_0x1a6245;return _0x1a6245['update']({'read':0x0,'readAt':null,'UserId':null});})[_0x5267('0x15')](function(){var _0x5bece1={'uniqueid':_0x339f3f+'.'+_0x676556['id']+'.'+_0x676556['Interaction']['id'],'FromUserId':_0x28884b[_0x5267('0x2c')]['id'],'type':'queue','ToUserId':_0x7ecf0e['id']};_0x5bece1[_0x405eb4+'MessageId']=_0x676556['id'];_0x5bece1[_0x405eb4+_0x5267('0x6e')]=_0x676556[_0x5267('0x69')]['id'];_0x5bece1['From'+_0x405eb4+_0x557749+'Id']=_0x676556['Account']['id'];return db[_0x405eb4+'TransferReport'][_0x5267('0x71')](_0x5bece1);})['then'](function(){return respondWithRpcPromise(_0x5267('0x72'),{'channel':_0x339f3f,'interaction':_0x676556['Interaction'],'message':_0x676556,'account':_0x676556[_0x5267('0x65')],'applications':[{'id':0x0,'priority':0x1,'app':_0x5267('0x37'),'appdata':_0x7ecf0e['name']+','+(_0x676556[_0x5267('0x65')][_0x5267('0x7a')]||0x12c),'interval':_0x5267('0x74')}]},routingClient);})[_0x5267('0x15')](respondWithResult(_0x35a4a3,null))[_0x5267('0x9')](handleError(_0x35a4a3,null));};
\ No newline at end of file
index bb8a1ad..257ef29 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3f9b=['../../components/interaction/service','./schedule.controller','get','isAuthenticated','index','/:id','show','/:id/run','post','create','update','exports','multer','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x215e65,_0x183f97){var _0xa85842=function(_0x43bf45){while(--_0x43bf45){_0x215e65['push'](_0x215e65['shift']());}};_0xa85842(++_0x183f97);}(_0x3f9b,0xc7));var _0xb3f9=function(_0x6c5c62,_0x38ffa1){_0x6c5c62=_0x6c5c62-0x0;var _0x45d7ea=_0x3f9b[_0x6c5c62];return _0x45d7ea;};'use strict';var multer=require(_0xb3f9('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xb3f9('0x1'));var express=require('express');var router=express[_0xb3f9('0x2')]();var fs_extra=require(_0xb3f9('0x3'));var auth=require(_0xb3f9('0x4'));var interaction=require(_0xb3f9('0x5'));var config=require('../../config/environment');var controller=require(_0xb3f9('0x6'));router[_0xb3f9('0x7')]('/',auth[_0xb3f9('0x8')](),controller[_0xb3f9('0x9')]);router[_0xb3f9('0x7')](_0xb3f9('0xa'),auth['isAuthenticated'](),controller[_0xb3f9('0xb')]);router['get'](_0xb3f9('0xc'),auth[_0xb3f9('0x8')](),controller['run']);router[_0xb3f9('0xd')]('/',auth[_0xb3f9('0x8')](),controller[_0xb3f9('0xe')]);router['put'](_0xb3f9('0xa'),auth[_0xb3f9('0x8')](),controller[_0xb3f9('0xf')]);router['delete'](_0xb3f9('0xa'),auth[_0xb3f9('0x8')](),controller['destroy']);module[_0xb3f9('0x10')]=router;
\ No newline at end of file
+var _0x3182=['../../components/auth/service','./schedule.controller','index','get','isAuthenticated','show','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','fs-extra'];(function(_0x264545,_0x214037){var _0x114d10=function(_0x9e3461){while(--_0x9e3461){_0x264545['push'](_0x264545['shift']());}};_0x114d10(++_0x214037);}(_0x3182,0x11c));var _0x2318=function(_0x5ef66a,_0x46e98e){_0x5ef66a=_0x5ef66a-0x0;var _0x73f45c=_0x3182[_0x5ef66a];return _0x73f45c;};'use strict';var multer=require(_0x2318('0x0'));var util=require(_0x2318('0x1'));var path=require(_0x2318('0x2'));var timeout=require(_0x2318('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x2318('0x4'));var auth=require(_0x2318('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x2318('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x2318('0x7')]);router[_0x2318('0x8')]('/:id',auth[_0x2318('0x9')](),controller[_0x2318('0xa')]);router[_0x2318('0x8')]('/:id/run',auth[_0x2318('0x9')](),controller['run']);router[_0x2318('0xb')]('/',auth[_0x2318('0x9')](),controller[_0x2318('0xc')]);router['put']('/:id',auth[_0x2318('0x9')](),controller[_0x2318('0xd')]);router[_0x2318('0xe')]('/:id',auth[_0x2318('0x9')](),controller[_0x2318('0xf')]);module[_0x2318('0x10')]=router;
\ No newline at end of file
index 5b9dbe3..1b38d77 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2ab0=['exports','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM','years','quarters','days','minutes','csv','pdf','xlsx','custom','default','TEXT','sequelize'];(function(_0x4b6c1c,_0x4d566b){var _0x49fe39=function(_0x192756){while(--_0x192756){_0x4b6c1c['push'](_0x4b6c1c['shift']());}};_0x49fe39(++_0x4d566b);}(_0x2ab0,0xc5));var _0x02ab=function(_0x4ae625,_0xf396d0){_0x4ae625=_0x4ae625-0x0;var _0x31accf=_0x2ab0[_0x4ae625];return _0x31accf;};'use strict';var Sequelize=require(_0x02ab('0x0'));module[_0x02ab('0x1')]={'name':{'type':Sequelize[_0x02ab('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x02ab('0x2')]},'active':{'type':Sequelize[_0x02ab('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x02ab('0x2')],'allowNull':![],'defaultValue':_0x02ab('0x4')},'startAt':{'type':Sequelize['DATE'],'allowNull':![]},'endAt':{'type':Sequelize[_0x02ab('0x5')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x02ab('0x6')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x02ab('0x7')](_0x02ab('0x8'),_0x02ab('0x9'),'months','weeks',_0x02ab('0xa'),'hours',_0x02ab('0xb')),'allowNull':![],'defaultValue':_0x02ab('0xa')},'output':{'type':Sequelize[_0x02ab('0x7')](_0x02ab('0xc'),_0x02ab('0xd'),_0x02ab('0xe')),'allowNull':![],'defaultValue':_0x02ab('0xc')},'type':{'type':Sequelize[_0x02ab('0x7')](_0x02ab('0xf'),_0x02ab('0x10')),'allowNull':![],'defaultValue':_0x02ab('0xf')},'sendMail':{'type':Sequelize[_0x02ab('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0x02ab('0x2')]},'cc':{'type':Sequelize[_0x02ab('0x11')]},'bcc':{'type':Sequelize[_0x02ab('0x11')]},'sendIfEmpty':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
+var _0x1685=['weeks','days','hours','minutes','csv','pdf','xlsx','default','custom','BOOLEAN','TEXT','sequelize','exports','STRING','0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM','quarters','months'];(function(_0x19e377,_0x4dbe7d){var _0x1bd5ea=function(_0x46a527){while(--_0x46a527){_0x19e377['push'](_0x19e377['shift']());}};_0x1bd5ea(++_0x4dbe7d);}(_0x1685,0x97));var _0x5168=function(_0x29d915,_0x54a040){_0x29d915=_0x29d915-0x0;var _0x160f86=_0x1685[_0x29d915];return _0x160f86;};'use strict';var Sequelize=require(_0x5168('0x0'));module[_0x5168('0x1')]={'name':{'type':Sequelize[_0x5168('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x5168('0x2')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x5168('0x2')],'allowNull':![],'defaultValue':_0x5168('0x3')},'startAt':{'type':Sequelize[_0x5168('0x4')],'allowNull':![]},'endAt':{'type':Sequelize[_0x5168('0x4')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x5168('0x5')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x5168('0x6')]('years',_0x5168('0x7'),_0x5168('0x8'),_0x5168('0x9'),_0x5168('0xa'),_0x5168('0xb'),_0x5168('0xc')),'allowNull':![],'defaultValue':_0x5168('0xa')},'output':{'type':Sequelize[_0x5168('0x6')](_0x5168('0xd'),_0x5168('0xe'),_0x5168('0xf')),'allowNull':![],'defaultValue':_0x5168('0xd')},'type':{'type':Sequelize[_0x5168('0x6')]('custom',_0x5168('0x10')),'allowNull':![],'defaultValue':_0x5168('0x11')},'sendMail':{'type':Sequelize[_0x5168('0x12')],'defaultValue':![]},'email':{'type':Sequelize[_0x5168('0x2')]},'cc':{'type':Sequelize['TEXT']},'bcc':{'type':Sequelize[_0x5168('0x13')]},'sendIfEmpty':{'type':Sequelize[_0x5168('0x12')],'defaultValue':!![]}};
\ No newline at end of file
index abea49f..6a55b5b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6665=['../../mysqldb','sendStatus','json','undefined','limit','count','offset','status','set','Content-Range','apply','reject','save','update','then','get','Scheduler','UserProfileResource','destroy','error','stack','name','send','index','map','Schedule','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','merge','VIRTUAL','filter','options','where','includeAll','include','findAll','catch','show','params','find','create','body','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','run','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','fs-extra','lodash','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x4f77e2,_0x135d8e){var _0x41a339=function(_0x5398f2){while(--_0x5398f2){_0x4f77e2['push'](_0x4f77e2['shift']());}};_0x41a339(++_0x135d8e);}(_0x6665,0xe5));var _0x5666=function(_0x2cf2e9,_0xd58ea1){_0x2cf2e9=_0x2cf2e9-0x0;var _0xd3670d=_0x6665[_0x2cf2e9];return _0xd3670d;};'use strict';var emlformat=require(_0x5666('0x0'));var rimraf=require(_0x5666('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5666('0x2'));var rp=require(_0x5666('0x3'));var moment=require(_0x5666('0x4'));var BPromise=require(_0x5666('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x5666('0x6'));var sox=require(_0x5666('0x7'));var csv=require(_0x5666('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5666('0x9'));var _=require(_0x5666('0xa'));var squel=require('squel');var crypto=require(_0x5666('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x5666('0xc'));var toCsv=require(_0x5666('0x8'));var querystring=require(_0x5666('0xd'));var Papa=require('papaparse');var Redis=require(_0x5666('0xe'));var authService=require(_0x5666('0xf'));var qs=require(_0x5666('0x10'));var as=require(_0x5666('0x11'));var hardwareService=require(_0x5666('0x12'));var logger=require(_0x5666('0x13'))('api');var utils=require(_0x5666('0x14'));var config=require(_0x5666('0x15'));var licenseUtil=require(_0x5666('0x16'));var db=require(_0x5666('0x17'))['db'];function respondWithStatusCode(_0x599e99,_0x2e84e2){_0x2e84e2=_0x2e84e2||0xcc;return function(_0x25e9ae){if(_0x25e9ae){return _0x599e99[_0x5666('0x18')](_0x2e84e2);}return _0x599e99['status'](_0x2e84e2)['end']();};}function respondWithResult(_0x3050b3,_0x154f6a){_0x154f6a=_0x154f6a||0xc8;return function(_0x5dfbb3){if(_0x5dfbb3){return _0x3050b3['status'](_0x154f6a)[_0x5666('0x19')](_0x5dfbb3);}};}function respondWithFilteredResult(_0x227dca,_0x658bbd){return function(_0x127dd5){if(_0x127dd5){var _0x33ed99=typeof _0x658bbd['offset']===_0x5666('0x1a')&&typeof _0x658bbd[_0x5666('0x1b')]===_0x5666('0x1a');var _0x3c7e00=_0x127dd5[_0x5666('0x1c')];var _0x800b7f=_0x33ed99?0x0:_0x658bbd[_0x5666('0x1d')];var _0x39097a=_0x33ed99?_0x127dd5[_0x5666('0x1c')]:_0x658bbd['offset']+_0x658bbd[_0x5666('0x1b')];var _0xbc958e;if(_0x39097a>=_0x3c7e00){_0x39097a=_0x3c7e00;_0xbc958e=0xc8;}else{_0xbc958e=0xce;}_0x227dca[_0x5666('0x1e')](_0xbc958e);return _0x227dca[_0x5666('0x1f')](_0x5666('0x20'),_0x800b7f+'-'+_0x39097a+'/'+_0x3c7e00)[_0x5666('0x19')](_0x127dd5);}return null;};}function patchUpdates(_0x22c587){return function(_0x157f36){try{jsonpatch[_0x5666('0x21')](_0x157f36,_0x22c587,!![]);}catch(_0x2f0576){return BPromise[_0x5666('0x22')](_0x2f0576);}return _0x157f36[_0x5666('0x23')]();};}function saveUpdates(_0x3e8a06,_0x24ab01){return function(_0x31c3ad){if(_0x31c3ad){return _0x31c3ad[_0x5666('0x24')](_0x3e8a06)[_0x5666('0x25')](function(_0x2513af){return _0x2513af;});}return null;};}function removeEntity(_0x239c89,_0x2fa354){return function(_0x3a8d1e){if(_0x3a8d1e){return _0x3a8d1e['destroy']()[_0x5666('0x25')](function(){var _0x318037=_0x3a8d1e[_0x5666('0x26')]({'plain':!![]});var _0x5320bf=_0x5666('0x27');return db[_0x5666('0x28')][_0x5666('0x29')]({'where':{'type':_0x5320bf,'resourceId':_0x318037['id']}})[_0x5666('0x25')](function(){return _0x3a8d1e;});})['then'](function(){_0x239c89[_0x5666('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x6f40e5,_0x3dccd3){return function(_0x229c61){if(!_0x229c61){_0x6f40e5[_0x5666('0x18')](0x194);}return _0x229c61;};}function handleError(_0x17378b,_0x3a109a){_0x3a109a=_0x3a109a||0x1f4;return function(_0x5a14f9){logger[_0x5666('0x2a')](_0x5a14f9[_0x5666('0x2b')]);if(_0x5a14f9[_0x5666('0x2c')]){delete _0x5a14f9['name'];}_0x17378b[_0x5666('0x1e')](_0x3a109a)[_0x5666('0x2d')](_0x5a14f9);};}exports[_0x5666('0x2e')]=function(_0x5f09d6,_0xef254a){var _0x21c82b={},_0x1fa5e6={},_0x1091c1={'count':0x0,'rows':[]};var _0x46264f=_[_0x5666('0x2f')](db[_0x5666('0x30')]['rawAttributes'],function(_0x3488c7){return{'name':_0x3488c7[_0x5666('0x31')],'type':_0x3488c7[_0x5666('0x32')][_0x5666('0x33')]};});_0x1fa5e6[_0x5666('0x34')]=_[_0x5666('0x2f')](_0x46264f,_0x5666('0x2c'));_0x1fa5e6[_0x5666('0x35')]=_[_0x5666('0x36')](_0x5f09d6[_0x5666('0x35')]);_0x1fa5e6[_0x5666('0x37')]=_[_0x5666('0x38')](_0x1fa5e6[_0x5666('0x34')],_0x1fa5e6['query']);_0x21c82b[_0x5666('0x39')]=_['intersection'](_0x1fa5e6['model'],qs[_0x5666('0x3a')](_0x5f09d6[_0x5666('0x35')]['fields']));_0x21c82b[_0x5666('0x39')]=_0x21c82b[_0x5666('0x39')][_0x5666('0x3b')]?_0x21c82b[_0x5666('0x39')]:_0x1fa5e6[_0x5666('0x34')];if(!_0x5f09d6['query'][_0x5666('0x3c')]('nolimit')){_0x21c82b[_0x5666('0x1b')]=qs[_0x5666('0x1b')](_0x5f09d6['query'][_0x5666('0x1b')]);_0x21c82b[_0x5666('0x1d')]=qs[_0x5666('0x1d')](_0x5f09d6[_0x5666('0x35')]['offset']);}_0x21c82b[_0x5666('0x3d')]=qs[_0x5666('0x3e')](_0x5f09d6[_0x5666('0x35')][_0x5666('0x3e')]);_0x21c82b['where']=qs['filters'](_[_0x5666('0x3f')](_0x5f09d6[_0x5666('0x35')],_0x1fa5e6[_0x5666('0x37')]),_0x46264f);if(_0x5f09d6[_0x5666('0x35')]['filter']){_0x21c82b['where']=_[_0x5666('0x40')](_0x21c82b['where'],{'$or':_['map'](_0x46264f,function(_0x58bda5){if(_0x58bda5[_0x5666('0x32')]!==_0x5666('0x41')){var _0x382d22={};_0x382d22[_0x58bda5[_0x5666('0x2c')]]={'$like':'%'+_0x5f09d6['query'][_0x5666('0x42')]+'%'};return _0x382d22;}})});}_0x21c82b=_[_0x5666('0x40')]({},_0x21c82b,_0x5f09d6[_0x5666('0x43')]);var _0x197c40={'where':_0x21c82b[_0x5666('0x44')]};return db[_0x5666('0x30')]['count'](_0x197c40)[_0x5666('0x25')](function(_0x1433c9){_0x1091c1['count']=_0x1433c9;if(_0x5f09d6[_0x5666('0x35')][_0x5666('0x45')]){_0x21c82b[_0x5666('0x46')]=[{'all':!![]}];}return db[_0x5666('0x30')][_0x5666('0x47')](_0x21c82b);})['then'](function(_0x3a74da){_0x1091c1['rows']=_0x3a74da;return _0x1091c1;})[_0x5666('0x25')](respondWithFilteredResult(_0xef254a,_0x21c82b))[_0x5666('0x48')](handleError(_0xef254a,null));};exports[_0x5666('0x49')]=function(_0x4b4b6b,_0x55aae3){var _0x5dfaf7={'raw':![],'where':{'id':_0x4b4b6b[_0x5666('0x4a')]['id']}},_0xa29577={};_0xa29577[_0x5666('0x34')]=_[_0x5666('0x36')](db[_0x5666('0x30')]['rawAttributes']);_0xa29577[_0x5666('0x35')]=_[_0x5666('0x36')](_0x4b4b6b[_0x5666('0x35')]);_0xa29577[_0x5666('0x37')]=_[_0x5666('0x38')](_0xa29577[_0x5666('0x34')],_0xa29577[_0x5666('0x35')]);_0x5dfaf7[_0x5666('0x39')]=_[_0x5666('0x38')](_0xa29577[_0x5666('0x34')],qs['fields'](_0x4b4b6b[_0x5666('0x35')]['fields']));_0x5dfaf7[_0x5666('0x39')]=_0x5dfaf7[_0x5666('0x39')][_0x5666('0x3b')]?_0x5dfaf7[_0x5666('0x39')]:_0xa29577['model'];if(_0x4b4b6b[_0x5666('0x35')]['includeAll']){_0x5dfaf7[_0x5666('0x46')]=[{'all':!![]}];}_0x5dfaf7=_[_0x5666('0x40')]({},_0x5dfaf7,_0x4b4b6b['options']);return db[_0x5666('0x30')][_0x5666('0x4b')](_0x5dfaf7)[_0x5666('0x25')](handleEntityNotFound(_0x55aae3,null))[_0x5666('0x25')](respondWithResult(_0x55aae3,null))[_0x5666('0x48')](handleError(_0x55aae3,null));};exports[_0x5666('0x4c')]=function(_0x44f2ff,_0x5c8bb0){return db['Schedule'][_0x5666('0x4c')](_0x44f2ff[_0x5666('0x4d')],{})[_0x5666('0x25')](function(_0x192611){var _0x9125de=_0x44f2ff[_0x5666('0x4e')][_0x5666('0x26')]({'plain':!![]});if(!_0x9125de)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x9125de['role']===_0x5666('0x4e')){var _0x31d327=_0x192611[_0x5666('0x26')]({'plain':!![]});var _0x198cb0=_0x5666('0x27');return db[_0x5666('0x4f')][_0x5666('0x4b')]({'where':{'name':_0x198cb0,'userProfileId':_0x9125de[_0x5666('0x50')]},'raw':!![]})[_0x5666('0x25')](function(_0x5d8166){if(_0x5d8166&&_0x5d8166[_0x5666('0x51')]===0x0){return db[_0x5666('0x28')][_0x5666('0x4c')]({'name':_0x31d327[_0x5666('0x2c')],'resourceId':_0x31d327['id'],'type':_0x5d8166[_0x5666('0x2c')],'sectionId':_0x5d8166['id']},{})[_0x5666('0x25')](function(){return _0x192611;});}else{return _0x192611;}})[_0x5666('0x48')](function(_0x49876c){logger[_0x5666('0x2a')](_0x5666('0x52'),_0x49876c);throw _0x49876c;});}return _0x192611;})[_0x5666('0x25')](respondWithResult(_0x5c8bb0,0xc9))[_0x5666('0x48')](handleError(_0x5c8bb0,null));};exports['update']=function(_0xd75edc,_0x1a6eee){if(_0xd75edc[_0x5666('0x4d')]['id']){delete _0xd75edc[_0x5666('0x4d')]['id'];}return db[_0x5666('0x30')][_0x5666('0x4b')]({'where':{'id':_0xd75edc[_0x5666('0x4a')]['id']}})[_0x5666('0x25')](handleEntityNotFound(_0x1a6eee,null))[_0x5666('0x25')](saveUpdates(_0xd75edc[_0x5666('0x4d')],null))['then'](respondWithResult(_0x1a6eee,null))[_0x5666('0x48')](handleError(_0x1a6eee,null));};exports[_0x5666('0x29')]=function(_0x235a95,_0x309f43){return db[_0x5666('0x30')][_0x5666('0x4b')]({'where':{'id':_0x235a95[_0x5666('0x4a')]['id']}})['then'](handleEntityNotFound(_0x309f43,null))[_0x5666('0x25')](removeEntity(_0x309f43,null))['catch'](handleError(_0x309f43,null));};exports['run']=function(_0x27d98e,_0xf4bec,_0x49bbd){var _0x23d6c5=require('../../config/schedule');return db['Schedule'][_0x5666('0x4b')]({'where':{'id':_0x27d98e['params']['id']},'raw':!![]})[_0x5666('0x25')](handleEntityNotFound(_0xf4bec,null))[_0x5666('0x25')](function(){_0x23d6c5[_0x5666('0x53')](_0x27d98e[_0x5666('0x4a')]['id']);})[_0x5666('0x25')](respondWithStatusCode(_0xf4bec,null))[_0x5666('0x48')](handleError(_0xf4bec,null));};
\ No newline at end of file
+var _0x47b8=['../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','get','Scheduler','destroy','name','send','index','map','Schedule','rawAttributes','fieldName','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','where','pick','merge','type','filter','options','includeAll','include','findAll','rows','catch','params','keys','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','../../config/schedule','run','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','querystring','papaparse','ioredis'];(function(_0x4e5b9a,_0x27cecc){var _0x44adb3=function(_0x548618){while(--_0x548618){_0x4e5b9a['push'](_0x4e5b9a['shift']());}};_0x44adb3(++_0x27cecc);}(_0x47b8,0xf1));var _0x847b=function(_0x56ef45,_0x40f56b){_0x56ef45=_0x56ef45-0x0;var _0x3dabd4=_0x47b8[_0x56ef45];return _0x3dabd4;};'use strict';var emlformat=require(_0x847b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x847b('0x1'));var jsonpatch=require(_0x847b('0x2'));var rp=require('request-promise');var moment=require(_0x847b('0x3'));var BPromise=require(_0x847b('0x4'));var Mustache=require(_0x847b('0x5'));var util=require(_0x847b('0x6'));var path=require(_0x847b('0x7'));var sox=require(_0x847b('0x8'));var csv=require(_0x847b('0x9'));var ejs=require(_0x847b('0xa'));var fs=require('fs');var fs_extra=require(_0x847b('0xb'));var _=require('lodash');var squel=require(_0x847b('0xc'));var crypto=require(_0x847b('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x847b('0xe'));var Papa=require(_0x847b('0xf'));var Redis=require(_0x847b('0x10'));var authService=require(_0x847b('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x847b('0x12'));var hardwareService=require(_0x847b('0x13'));var logger=require(_0x847b('0x14'))('api');var utils=require(_0x847b('0x15'));var config=require(_0x847b('0x16'));var licenseUtil=require(_0x847b('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x263481,_0x56d6fe){_0x56d6fe=_0x56d6fe||0xcc;return function(_0x9050af){if(_0x9050af){return _0x263481[_0x847b('0x18')](_0x56d6fe);}return _0x263481[_0x847b('0x19')](_0x56d6fe)[_0x847b('0x1a')]();};}function respondWithResult(_0x1b7777,_0x89e880){_0x89e880=_0x89e880||0xc8;return function(_0x6a9034){if(_0x6a9034){return _0x1b7777[_0x847b('0x19')](_0x89e880)[_0x847b('0x1b')](_0x6a9034);}};}function respondWithFilteredResult(_0x433446,_0x1e5251){return function(_0x1544fe){if(_0x1544fe){var _0x4b87c3=typeof _0x1e5251['offset']==='undefined'&&typeof _0x1e5251[_0x847b('0x1c')]===_0x847b('0x1d');var _0x480964=_0x1544fe[_0x847b('0x1e')];var _0x2a903c=_0x4b87c3?0x0:_0x1e5251[_0x847b('0x1f')];var _0x518ae7=_0x4b87c3?_0x1544fe[_0x847b('0x1e')]:_0x1e5251[_0x847b('0x1f')]+_0x1e5251[_0x847b('0x1c')];var _0x355d4;if(_0x518ae7>=_0x480964){_0x518ae7=_0x480964;_0x355d4=0xc8;}else{_0x355d4=0xce;}_0x433446['status'](_0x355d4);return _0x433446[_0x847b('0x20')](_0x847b('0x21'),_0x2a903c+'-'+_0x518ae7+'/'+_0x480964)[_0x847b('0x1b')](_0x1544fe);}return null;};}function patchUpdates(_0x1819d8){return function(_0x2e9d65){try{jsonpatch[_0x847b('0x22')](_0x2e9d65,_0x1819d8,!![]);}catch(_0xdeb27f){return BPromise[_0x847b('0x23')](_0xdeb27f);}return _0x2e9d65[_0x847b('0x24')]();};}function saveUpdates(_0x44d37c,_0x4e33b0){return function(_0x4ea7a6){if(_0x4ea7a6){return _0x4ea7a6[_0x847b('0x25')](_0x44d37c)['then'](function(_0x526402){return _0x526402;});}return null;};}function removeEntity(_0x4197ef,_0xdeac3f){return function(_0x223d51){if(_0x223d51){return _0x223d51['destroy']()[_0x847b('0x26')](function(){var _0x408b54=_0x223d51[_0x847b('0x27')]({'plain':!![]});var _0x54bfda=_0x847b('0x28');return db['UserProfileResource'][_0x847b('0x29')]({'where':{'type':_0x54bfda,'resourceId':_0x408b54['id']}})['then'](function(){return _0x223d51;});})[_0x847b('0x26')](function(){_0x4197ef['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x372efc,_0x408a49){return function(_0x521ff9){if(!_0x521ff9){_0x372efc[_0x847b('0x18')](0x194);}return _0x521ff9;};}function handleError(_0x9486c5,_0x46caee){_0x46caee=_0x46caee||0x1f4;return function(_0x2edc98){logger['error'](_0x2edc98['stack']);if(_0x2edc98['name']){delete _0x2edc98[_0x847b('0x2a')];}_0x9486c5[_0x847b('0x19')](_0x46caee)[_0x847b('0x2b')](_0x2edc98);};}exports[_0x847b('0x2c')]=function(_0x10976c,_0x4be801){var _0x2780c0={},_0x281112={},_0x27b5fc={'count':0x0,'rows':[]};var _0x1fe598=_[_0x847b('0x2d')](db[_0x847b('0x2e')][_0x847b('0x2f')],function(_0x5119b6){return{'name':_0x5119b6[_0x847b('0x30')],'type':_0x5119b6['type'][_0x847b('0x31')]};});_0x281112[_0x847b('0x32')]=_[_0x847b('0x2d')](_0x1fe598,_0x847b('0x2a'));_0x281112[_0x847b('0x33')]=_['keys'](_0x10976c[_0x847b('0x33')]);_0x281112[_0x847b('0x34')]=_['intersection'](_0x281112[_0x847b('0x32')],_0x281112['query']);_0x2780c0[_0x847b('0x35')]=_[_0x847b('0x36')](_0x281112[_0x847b('0x32')],qs[_0x847b('0x37')](_0x10976c[_0x847b('0x33')][_0x847b('0x37')]));_0x2780c0[_0x847b('0x35')]=_0x2780c0[_0x847b('0x35')][_0x847b('0x38')]?_0x2780c0[_0x847b('0x35')]:_0x281112['model'];if(!_0x10976c['query'][_0x847b('0x39')](_0x847b('0x3a'))){_0x2780c0['limit']=qs['limit'](_0x10976c[_0x847b('0x33')][_0x847b('0x1c')]);_0x2780c0[_0x847b('0x1f')]=qs[_0x847b('0x1f')](_0x10976c[_0x847b('0x33')][_0x847b('0x1f')]);}_0x2780c0[_0x847b('0x3b')]=qs['sort'](_0x10976c[_0x847b('0x33')]['sort']);_0x2780c0[_0x847b('0x3c')]=qs['filters'](_[_0x847b('0x3d')](_0x10976c['query'],_0x281112[_0x847b('0x34')]),_0x1fe598);if(_0x10976c[_0x847b('0x33')]['filter']){_0x2780c0[_0x847b('0x3c')]=_[_0x847b('0x3e')](_0x2780c0[_0x847b('0x3c')],{'$or':_[_0x847b('0x2d')](_0x1fe598,function(_0x833590){if(_0x833590[_0x847b('0x3f')]!=='VIRTUAL'){var _0x4053e2={};_0x4053e2[_0x833590[_0x847b('0x2a')]]={'$like':'%'+_0x10976c[_0x847b('0x33')][_0x847b('0x40')]+'%'};return _0x4053e2;}})});}_0x2780c0=_[_0x847b('0x3e')]({},_0x2780c0,_0x10976c[_0x847b('0x41')]);var _0x5b96e7={'where':_0x2780c0[_0x847b('0x3c')]};return db['Schedule'][_0x847b('0x1e')](_0x5b96e7)[_0x847b('0x26')](function(_0x39834c){_0x27b5fc[_0x847b('0x1e')]=_0x39834c;if(_0x10976c['query'][_0x847b('0x42')]){_0x2780c0[_0x847b('0x43')]=[{'all':!![]}];}return db[_0x847b('0x2e')][_0x847b('0x44')](_0x2780c0);})[_0x847b('0x26')](function(_0x4372f7){_0x27b5fc[_0x847b('0x45')]=_0x4372f7;return _0x27b5fc;})[_0x847b('0x26')](respondWithFilteredResult(_0x4be801,_0x2780c0))[_0x847b('0x46')](handleError(_0x4be801,null));};exports['show']=function(_0x1ad935,_0x1accdb){var _0x5c4645={'raw':![],'where':{'id':_0x1ad935[_0x847b('0x47')]['id']}},_0x442f34={};_0x442f34['model']=_[_0x847b('0x48')](db[_0x847b('0x2e')][_0x847b('0x2f')]);_0x442f34[_0x847b('0x33')]=_[_0x847b('0x48')](_0x1ad935[_0x847b('0x33')]);_0x442f34[_0x847b('0x34')]=_['intersection'](_0x442f34[_0x847b('0x32')],_0x442f34['query']);_0x5c4645[_0x847b('0x35')]=_[_0x847b('0x36')](_0x442f34[_0x847b('0x32')],qs[_0x847b('0x37')](_0x1ad935[_0x847b('0x33')]['fields']));_0x5c4645[_0x847b('0x35')]=_0x5c4645[_0x847b('0x35')][_0x847b('0x38')]?_0x5c4645[_0x847b('0x35')]:_0x442f34['model'];if(_0x1ad935[_0x847b('0x33')]['includeAll']){_0x5c4645['include']=[{'all':!![]}];}_0x5c4645=_[_0x847b('0x3e')]({},_0x5c4645,_0x1ad935[_0x847b('0x41')]);return db[_0x847b('0x2e')][_0x847b('0x49')](_0x5c4645)['then'](handleEntityNotFound(_0x1accdb,null))[_0x847b('0x26')](respondWithResult(_0x1accdb,null))[_0x847b('0x46')](handleError(_0x1accdb,null));};exports[_0x847b('0x4a')]=function(_0x77da3c,_0x22cd1c){return db[_0x847b('0x2e')][_0x847b('0x4a')](_0x77da3c[_0x847b('0x4b')],{})[_0x847b('0x26')](function(_0x2ecd08){var _0x87c065=_0x77da3c['user']['get']({'plain':!![]});if(!_0x87c065)throw new Error(_0x847b('0x4c'));if(_0x87c065[_0x847b('0x4d')]==='user'){var _0x318efd=_0x2ecd08[_0x847b('0x27')]({'plain':!![]});var _0xeedf42=_0x847b('0x28');return db[_0x847b('0x4e')][_0x847b('0x49')]({'where':{'name':_0xeedf42,'userProfileId':_0x87c065[_0x847b('0x4f')]},'raw':!![]})[_0x847b('0x26')](function(_0x559f92){if(_0x559f92&&_0x559f92[_0x847b('0x50')]===0x0){return db[_0x847b('0x51')][_0x847b('0x4a')]({'name':_0x318efd[_0x847b('0x2a')],'resourceId':_0x318efd['id'],'type':_0x559f92[_0x847b('0x2a')],'sectionId':_0x559f92['id']},{})[_0x847b('0x26')](function(){return _0x2ecd08;});}else{return _0x2ecd08;}})['catch'](function(_0x115c74){logger[_0x847b('0x52')](_0x847b('0x53'),_0x115c74);throw _0x115c74;});}return _0x2ecd08;})['then'](respondWithResult(_0x22cd1c,0xc9))[_0x847b('0x46')](handleError(_0x22cd1c,null));};exports[_0x847b('0x25')]=function(_0x3b19cc,_0x5529d2){if(_0x3b19cc['body']['id']){delete _0x3b19cc[_0x847b('0x4b')]['id'];}return db[_0x847b('0x2e')][_0x847b('0x49')]({'where':{'id':_0x3b19cc[_0x847b('0x47')]['id']}})[_0x847b('0x26')](handleEntityNotFound(_0x5529d2,null))[_0x847b('0x26')](saveUpdates(_0x3b19cc[_0x847b('0x4b')],null))['then'](respondWithResult(_0x5529d2,null))[_0x847b('0x46')](handleError(_0x5529d2,null));};exports[_0x847b('0x29')]=function(_0x53b5e1,_0x5a3519){return db[_0x847b('0x2e')][_0x847b('0x49')]({'where':{'id':_0x53b5e1[_0x847b('0x47')]['id']}})[_0x847b('0x26')](handleEntityNotFound(_0x5a3519,null))[_0x847b('0x26')](removeEntity(_0x5a3519,null))[_0x847b('0x46')](handleError(_0x5a3519,null));};exports['run']=function(_0x1c0cec,_0x3356ef,_0x596a70){var _0x347f1e=require(_0x847b('0x54'));return db[_0x847b('0x2e')]['find']({'where':{'id':_0x1c0cec[_0x847b('0x47')]['id']},'raw':!![]})[_0x847b('0x26')](handleEntityNotFound(_0x3356ef,null))[_0x847b('0x26')](function(){_0x347f1e[_0x847b('0x55')](_0x1c0cec[_0x847b('0x47')]['id']);})['then'](respondWithStatusCode(_0x3356ef,null))['catch'](handleError(_0x3356ef,null));};
\ No newline at end of file
index 22d3650..238bd9f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4031=['define','Schedule','util','../../config/logger','api','moment','request-promise','path','rimraf','./schedule.attributes','exports'];(function(_0x4c7bc7,_0x6e8304){var _0x41b761=function(_0x1f3c08){while(--_0x1f3c08){_0x4c7bc7['push'](_0x4c7bc7['shift']());}};_0x41b761(++_0x6e8304);}(_0x4031,0x65));var _0x1403=function(_0x52f44f,_0x460185){_0x52f44f=_0x52f44f-0x0;var _0x4e39d2=_0x4031[_0x52f44f];return _0x4e39d2;};'use strict';var _=require('lodash');var util=require(_0x1403('0x0'));var logger=require(_0x1403('0x1'))(_0x1403('0x2'));var moment=require(_0x1403('0x3'));var BPromise=require('bluebird');var rp=require(_0x1403('0x4'));var fs=require('fs');var path=require(_0x1403('0x5'));var rimraf=require(_0x1403('0x6'));var config=require('../../config/environment');var attributes=require(_0x1403('0x7'));module[_0x1403('0x8')]=function(_0x1cefa4,_0x3d454d){return _0x1cefa4[_0x1403('0x9')](_0x1403('0xa'),attributes,{'tableName':'tools_schedules','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb8d9=['rimraf','../../config/environment','./schedule.attributes','define','Schedule','tools_schedules','util','moment','bluebird','request-promise','path'];(function(_0x306760,_0x1a5492){var _0x48e68d=function(_0x5464d8){while(--_0x5464d8){_0x306760['push'](_0x306760['shift']());}};_0x48e68d(++_0x1a5492);}(_0xb8d9,0xd7));var _0x9b8d=function(_0x52e1f8,_0x8bb901){_0x52e1f8=_0x52e1f8-0x0;var _0x5c699b=_0xb8d9[_0x52e1f8];return _0x5c699b;};'use strict';var _=require('lodash');var util=require(_0x9b8d('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x9b8d('0x1'));var BPromise=require(_0x9b8d('0x2'));var rp=require(_0x9b8d('0x3'));var fs=require('fs');var path=require(_0x9b8d('0x4'));var rimraf=require(_0x9b8d('0x5'));var config=require(_0x9b8d('0x6'));var attributes=require(_0x9b8d('0x7'));module['exports']=function(_0x4c0e7c,_0x20648a){return _0x4c0e7c[_0x9b8d('0x8')](_0x9b8d('0x9'),attributes,{'tableName':_0x9b8d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index ecc2b5c..20efd3c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdd3a=['bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','then','request\x20sent','Schedule,\x20%s,\x20%s,\x20%s','stringify','error','code','Schedule,\x20%s,\x20%s','message','info','result','lodash','util','moment'];(function(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0xdd3a,0x7b));var _0xadd3=function(_0x16744f,_0xf236b4){_0x16744f=_0x16744f-0x0;var _0x124c01=_0xdd3a[_0x16744f];return _0x124c01;};'use strict';var _=require(_0xadd3('0x0'));var util=require(_0xadd3('0x1'));var moment=require(_0xadd3('0x2'));var BPromise=require(_0xadd3('0x3'));var rs=require(_0xadd3('0x4'));var fs=require('fs');var Redis=require(_0xadd3('0x5'));var db=require(_0xadd3('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xadd3('0x7'))(_0xadd3('0x8'));var config=require(_0xadd3('0x9'));var jayson=require(_0xadd3('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x15482e,_0x2f6d35,_0x29a258){return new BPromise(function(_0x1466bf,_0x2be84c){return client['request'](_0x15482e,_0x29a258)[_0xadd3('0xb')](function(_0x2f95a4){logger['info']('Schedule,\x20%s,\x20%s',_0x2f6d35,_0xadd3('0xc'));logger['debug'](_0xadd3('0xd'),_0x2f6d35,_0xadd3('0xc'),JSON[_0xadd3('0xe')](_0x2f95a4));if(_0x2f95a4[_0xadd3('0xf')]){if(_0x2f95a4[_0xadd3('0xf')][_0xadd3('0x10')]===0x1f4){logger[_0xadd3('0xf')](_0xadd3('0x11'),_0x2f6d35,_0x2f95a4[_0xadd3('0xf')][_0xadd3('0x12')]);return _0x2be84c(_0x2f95a4[_0xadd3('0xf')][_0xadd3('0x12')]);}logger[_0xadd3('0xf')](_0xadd3('0x11'),_0x2f6d35,_0x2f95a4[_0xadd3('0xf')][_0xadd3('0x12')]);return _0x1466bf(_0x2f95a4[_0xadd3('0xf')][_0xadd3('0x12')]);}else{logger[_0xadd3('0x13')](_0xadd3('0x11'),_0x2f6d35,_0xadd3('0xc'));_0x1466bf(_0x2f95a4[_0xadd3('0x14')]['message']);}})['catch'](function(_0x12ebdc){logger[_0xadd3('0xf')](_0xadd3('0x11'),_0x2f6d35,_0x12ebdc);_0x2be84c(_0x12ebdc);});});}
\ No newline at end of file
+var _0x1eb5=['Schedule,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','then','info','Schedule,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0x1eb5,0x1ea));var _0x51eb=function(_0x6a4600,_0xd66588){_0x6a4600=_0x6a4600-0x0;var _0x354544=_0x1eb5[_0x6a4600];return _0x354544;};'use strict';var _=require('lodash');var util=require(_0x51eb('0x0'));var moment=require(_0x51eb('0x1'));var BPromise=require('bluebird');var rs=require(_0x51eb('0x2'));var fs=require('fs');var Redis=require(_0x51eb('0x3'));var db=require(_0x51eb('0x4'))['db'];var utils=require(_0x51eb('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x51eb('0x6'));var jayson=require(_0x51eb('0x7'));var client=jayson['client'][_0x51eb('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x9ae382,_0x129b1b,_0x5b7caf){return new BPromise(function(_0x2040eb,_0xb6b1a2){return client['request'](_0x9ae382,_0x5b7caf)[_0x51eb('0x9')](function(_0x2be185){logger[_0x51eb('0xa')](_0x51eb('0xb'),_0x129b1b,_0x51eb('0xc'));logger[_0x51eb('0xd')](_0x51eb('0xe'),_0x129b1b,_0x51eb('0xc'),JSON[_0x51eb('0xf')](_0x2be185));if(_0x2be185[_0x51eb('0x10')]){if(_0x2be185[_0x51eb('0x10')][_0x51eb('0x11')]===0x1f4){logger[_0x51eb('0x10')]('Schedule,\x20%s,\x20%s',_0x129b1b,_0x2be185['error'][_0x51eb('0x12')]);return _0xb6b1a2(_0x2be185[_0x51eb('0x10')]['message']);}logger[_0x51eb('0x10')](_0x51eb('0xb'),_0x129b1b,_0x2be185[_0x51eb('0x10')][_0x51eb('0x12')]);return _0x2040eb(_0x2be185[_0x51eb('0x10')]['message']);}else{logger[_0x51eb('0xa')](_0x51eb('0xb'),_0x129b1b,'request\x20sent');_0x2040eb(_0x2be185[_0x51eb('0x13')][_0x51eb('0x12')]);}})[_0x51eb('0x14')](function(_0x2a3c74){logger[_0x51eb('0x10')](_0x51eb('0xb'),_0x129b1b,_0x2a3c74);_0xb6b1a2(_0x2a3c74);});});}
\ No newline at end of file
index 6917f4c..5fba6fc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd801=['./screenRecording.controller','isAuthenticated','index','get','/:id','show','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x10688a,_0x562495){var _0x3d0e76=function(_0x33e261){while(--_0x33e261){_0x10688a['push'](_0x10688a['shift']());}};_0x3d0e76(++_0x562495);}(_0xd801,0xe8));var _0x1d80=function(_0x5396d4,_0x86297a){_0x5396d4=_0x5396d4-0x0;var _0x9fa122=_0xd801[_0x5396d4];return _0x9fa122;};'use strict';var multer=require('multer');var util=require(_0x1d80('0x0'));var path=require(_0x1d80('0x1'));var timeout=require(_0x1d80('0x2'));var express=require(_0x1d80('0x3'));var router=express[_0x1d80('0x4')]();var fs_extra=require(_0x1d80('0x5'));var auth=require(_0x1d80('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x1d80('0x7'));var controller=require(_0x1d80('0x8'));router['get']('/',auth[_0x1d80('0x9')](),controller[_0x1d80('0xa')]);router['get']('/describe',auth[_0x1d80('0x9')](),controller['describe']);router[_0x1d80('0xb')](_0x1d80('0xc'),auth[_0x1d80('0x9')](),controller[_0x1d80('0xd')]);router['get']('/:id/download',auth[_0x1d80('0x9')](),controller['download']);router['post']('/',auth['isAuthenticated'](),controller[_0x1d80('0xe')]);router[_0x1d80('0xf')](_0x1d80('0xc'),auth[_0x1d80('0x9')](),controller[_0x1d80('0x10')]);router[_0x1d80('0x11')]('/:id',auth[_0x1d80('0x9')](),controller[_0x1d80('0x12')]);module[_0x1d80('0x13')]=router;
\ No newline at end of file
+var _0xe7f6=['../../components/auth/service','get','index','isAuthenticated','describe','/:id','show','/:id/download','download','post','create','delete','destroy','util','connect-timeout','express','fs-extra'];(function(_0x49d1a,_0x20c151){var _0x4c4b1c=function(_0x402833){while(--_0x402833){_0x49d1a['push'](_0x49d1a['shift']());}};_0x4c4b1c(++_0x20c151);}(_0xe7f6,0x1c7));var _0x6e7f=function(_0x1b2422,_0x1e98d4){_0x1b2422=_0x1b2422-0x0;var _0x376573=_0xe7f6[_0x1b2422];return _0x376573;};'use strict';var multer=require('multer');var util=require(_0x6e7f('0x0'));var path=require('path');var timeout=require(_0x6e7f('0x1'));var express=require(_0x6e7f('0x2'));var router=express['Router']();var fs_extra=require(_0x6e7f('0x3'));var auth=require(_0x6e7f('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./screenRecording.controller');router[_0x6e7f('0x5')]('/',auth['isAuthenticated'](),controller[_0x6e7f('0x6')]);router[_0x6e7f('0x5')]('/describe',auth[_0x6e7f('0x7')](),controller[_0x6e7f('0x8')]);router[_0x6e7f('0x5')](_0x6e7f('0x9'),auth['isAuthenticated'](),controller[_0x6e7f('0xa')]);router['get'](_0x6e7f('0xb'),auth['isAuthenticated'](),controller[_0x6e7f('0xc')]);router[_0x6e7f('0xd')]('/',auth['isAuthenticated'](),controller[_0x6e7f('0xe')]);router['put']('/:id',auth[_0x6e7f('0x7')](),controller['update']);router[_0x6e7f('0xf')](_0x6e7f('0x9'),auth[_0x6e7f('0x7')](),controller[_0x6e7f('0x10')]);module['exports']=router;
\ No newline at end of file
index 1ea5a0c..48f9dd1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8d62=['DATE','format','MM-DD-YYYY\x20HH:mm','toString','createdAt','updatedAt','moment','path','../../config/environment','exports','VIRTUAL','getDataValue','value','extname','STRING','replace','setDataValue','INTEGER','startedAt','subtract','closedAt','duration'];(function(_0x374977,_0x4250c0){var _0x350028=function(_0xfe4fce){while(--_0xfe4fce){_0x374977['push'](_0x374977['shift']());}};_0x350028(++_0x4250c0);}(_0x8d62,0xf8));var _0x28d6=function(_0x330e5b,_0x59f48f){_0x330e5b=_0x330e5b-0x0;var _0x43c863=_0x8d62[_0x330e5b];return _0x43c863;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x28d6('0x0'));var path=require(_0x28d6('0x1'));var config=require(_0x28d6('0x2'));module[_0x28d6('0x3')]={'format':{'type':Sequelize[_0x28d6('0x4')],'get':function(){return this[_0x28d6('0x5')](_0x28d6('0x6'))?path[_0x28d6('0x7')](this[_0x28d6('0x5')](_0x28d6('0x6'))):undefined;}},'interactionid':{'type':Sequelize[_0x28d6('0x8')]},'channel':{'type':Sequelize[_0x28d6('0x8')]},'value':{'type':Sequelize[_0x28d6('0x8')],'set':function(_0xe8aa7b){var _0x5c8a27=_0xe8aa7b[_0x28d6('0x9')](/\\/g,'/');this[_0x28d6('0xa')](_0x28d6('0x6'),_0x5c8a27);}},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x28d6('0xb')],'set':function(_0x4b564f){this[_0x28d6('0xa')](_0x28d6('0xc'),moment()[_0x28d6('0xd')](_0x4b564f,'ms'));this[_0x28d6('0xa')](_0x28d6('0xe'),moment());this['setDataValue'](_0x28d6('0xf'),_0x4b564f);}},'startedAt':{'type':Sequelize[_0x28d6('0x10')],'get':function(){return moment(this[_0x28d6('0x5')](_0x28d6('0xc')))[_0x28d6('0x11')](_0x28d6('0x12'))[_0x28d6('0x13')]();}},'closedAt':{'type':Sequelize[_0x28d6('0x10')],'get':function(){return moment(this['getDataValue'](_0x28d6('0xe')))[_0x28d6('0x11')](_0x28d6('0x12'))['toString']();}},'createdAt':{'type':Sequelize[_0x28d6('0x10')],'get':function(){return moment(this['getDataValue'](_0x28d6('0x14')))[_0x28d6('0x11')]('MM-DD-YYYY\x20HH:mm')[_0x28d6('0x13')]();}},'updatedAt':{'type':Sequelize[_0x28d6('0x10')],'get':function(){return moment(this[_0x28d6('0x5')](_0x28d6('0x15')))[_0x28d6('0x11')]('MM-DD-YYYY\x20HH:mm')[_0x28d6('0x13')]();}}};
\ No newline at end of file
+var _0x5464=['startedAt','closedAt','DATE','format','toString','updatedAt','MM-DD-YYYY\x20HH:mm','sequelize','moment','path','exports','getDataValue','extname','value','STRING','replace','setDataValue','INTEGER'];(function(_0x403237,_0x4c9b77){var _0x5df195=function(_0xa97c44){while(--_0xa97c44){_0x403237['push'](_0x403237['shift']());}};_0x5df195(++_0x4c9b77);}(_0x5464,0x15d));var _0x4546=function(_0x132b06,_0x38c964){_0x132b06=_0x132b06-0x0;var _0x1ed430=_0x5464[_0x132b06];return _0x1ed430;};'use strict';var Sequelize=require(_0x4546('0x0'));var moment=require(_0x4546('0x1'));var path=require(_0x4546('0x2'));var config=require('../../config/environment');module[_0x4546('0x3')]={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x4546('0x4')]('value')?path[_0x4546('0x5')](this[_0x4546('0x4')](_0x4546('0x6'))):undefined;}},'interactionid':{'type':Sequelize[_0x4546('0x7')]},'channel':{'type':Sequelize['STRING']},'value':{'type':Sequelize['STRING'],'set':function(_0x5c5e09){var _0x224c7c=_0x5c5e09[_0x4546('0x8')](/\\/g,'/');this[_0x4546('0x9')](_0x4546('0x6'),_0x224c7c);}},'rating':{'type':Sequelize[_0x4546('0xa')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x4546('0xa')],'set':function(_0x11d63e){this[_0x4546('0x9')](_0x4546('0xb'),moment()['subtract'](_0x11d63e,'ms'));this[_0x4546('0x9')](_0x4546('0xc'),moment());this[_0x4546('0x9')]('duration',_0x11d63e);}},'startedAt':{'type':Sequelize[_0x4546('0xd')],'get':function(){return moment(this[_0x4546('0x4')](_0x4546('0xb')))[_0x4546('0xe')]('MM-DD-YYYY\x20HH:mm')['toString']();}},'closedAt':{'type':Sequelize[_0x4546('0xd')],'get':function(){return moment(this['getDataValue']('closedAt'))['format']('MM-DD-YYYY\x20HH:mm')['toString']();}},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x4546('0x4')]('createdAt'))[_0x4546('0xe')]('MM-DD-YYYY\x20HH:mm')[_0x4546('0xf')]();}},'updatedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x4546('0x4')](_0x4546('0x10')))[_0x4546('0xe')](_0x4546('0x11'))[_0x4546('0xf')]();}}};
\ No newline at end of file
index 89a8a0c..955b35b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3e74=['to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','end','json','undefined','limit','offset','count','status','set','Content-Range','apply','save','update','then','destroy','sendStatus','name','send','index','map','ScreenRecording','rawAttributes','fieldName','type','key','model','differenceBy','format','query','keys','filters','attributes','intersection','fields','length','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','show','params','catch','create','body','duration','createdAt','closedAt','describe','download','../../components/encryptor','uniqueid','find','value','join','root','decryptFile','secrets','server/files/screen_recordings','Sequelize','ValidationError','filename','unlink','Not\x20found','isNil','Entity\x20not\x20found','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','existsSync','eml-format','zip-dir','fast-json-patch','request-promise','mustache','path','sox'];(function(_0x423d62,_0x561776){var _0x521691=function(_0x171fb0){while(--_0x171fb0){_0x423d62['push'](_0x423d62['shift']());}};_0x521691(++_0x561776);}(_0x3e74,0x175));var _0x43e7=function(_0x15e0ba,_0xb20543){_0x15e0ba=_0x15e0ba-0x0;var _0x3d36e2=_0x3e74[_0x15e0ba];return _0x3d36e2;};'use strict';var emlformat=require(_0x43e7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x43e7('0x1'));var jsonpatch=require(_0x43e7('0x2'));var rp=require(_0x43e7('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x43e7('0x4'));var util=require('util');var path=require(_0x43e7('0x5'));var sox=require(_0x43e7('0x6'));var csv=require(_0x43e7('0x7'));var ejs=require(_0x43e7('0x8'));var fs=require('fs');var fs_extra=require(_0x43e7('0x9'));var _=require('lodash');var squel=require(_0x43e7('0xa'));var crypto=require(_0x43e7('0xb'));var jsforce=require(_0x43e7('0xc'));var deskjs=require(_0x43e7('0xd'));var toCsv=require(_0x43e7('0x7'));var querystring=require('querystring');var Papa=require(_0x43e7('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x43e7('0xf'));var as=require(_0x43e7('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x43e7('0x11'))('api');var utils=require(_0x43e7('0x12'));var config=require(_0x43e7('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x43e7('0x14'))['db'];function respondWithStatusCode(_0xc960ea,_0x2718d3){_0x2718d3=_0x2718d3||0xcc;return function(_0x3bb83f){if(_0x3bb83f){return _0xc960ea['sendStatus'](_0x2718d3);}return _0xc960ea['status'](_0x2718d3)[_0x43e7('0x15')]();};}function respondWithResult(_0x21fdd3,_0x44b0bd){_0x44b0bd=_0x44b0bd||0xc8;return function(_0x51b974){if(_0x51b974){return _0x21fdd3['status'](_0x44b0bd)[_0x43e7('0x16')](_0x51b974);}};}function respondWithFilteredResult(_0x14c146,_0x203378){return function(_0x328445){if(_0x328445){var _0x4de324=typeof _0x203378['offset']===_0x43e7('0x17')&&typeof _0x203378[_0x43e7('0x18')]===_0x43e7('0x17');var _0x5d346f=_0x328445['count'];var _0x446986=_0x4de324?0x0:_0x203378[_0x43e7('0x19')];var _0x9037d3=_0x4de324?_0x328445[_0x43e7('0x1a')]:_0x203378[_0x43e7('0x19')]+_0x203378[_0x43e7('0x18')];var _0x619236;if(_0x9037d3>=_0x5d346f){_0x9037d3=_0x5d346f;_0x619236=0xc8;}else{_0x619236=0xce;}_0x14c146[_0x43e7('0x1b')](_0x619236);return _0x14c146[_0x43e7('0x1c')](_0x43e7('0x1d'),_0x446986+'-'+_0x9037d3+'/'+_0x5d346f)[_0x43e7('0x16')](_0x328445);}return null;};}function patchUpdates(_0x177ee1){return function(_0x4b5d64){try{jsonpatch[_0x43e7('0x1e')](_0x4b5d64,_0x177ee1,!![]);}catch(_0x3c6625){return BPromise['reject'](_0x3c6625);}return _0x4b5d64[_0x43e7('0x1f')]();};}function saveUpdates(_0x3e281e,_0x3945bb){return function(_0x28aacc){if(_0x28aacc){return _0x28aacc[_0x43e7('0x20')](_0x3e281e)[_0x43e7('0x21')](function(_0x54a9e7){return _0x54a9e7;});}return null;};}function removeEntity(_0x454359,_0x4eea52){return function(_0x4c9df3){if(_0x4c9df3){return _0x4c9df3[_0x43e7('0x22')]()[_0x43e7('0x21')](function(){_0x454359['status'](0xcc)[_0x43e7('0x15')]();});}};}function handleEntityNotFound(_0x4ca5cf,_0x326dab){return function(_0x5c5e67){if(!_0x5c5e67){_0x4ca5cf[_0x43e7('0x23')](0x194);}return _0x5c5e67;};}function handleError(_0x1b5f50,_0x20888b){_0x20888b=_0x20888b||0x1f4;return function(_0x405f85){logger['error'](_0x405f85['stack']);if(_0x405f85[_0x43e7('0x24')]){delete _0x405f85['name'];}_0x1b5f50[_0x43e7('0x1b')](_0x20888b)[_0x43e7('0x25')](_0x405f85);};}exports[_0x43e7('0x26')]=function(_0xb1fc63,_0x5087d7){var _0x33a1a5={},_0x4690a6={},_0x45b675={'count':0x0,'rows':[]};var _0x50f9f5=_[_0x43e7('0x27')](db[_0x43e7('0x28')][_0x43e7('0x29')],function(_0x31b2a6){return{'name':_0x31b2a6[_0x43e7('0x2a')],'type':_0x31b2a6[_0x43e7('0x2b')][_0x43e7('0x2c')]};});_0x4690a6[_0x43e7('0x2d')]=_[_0x43e7('0x2e')](_[_0x43e7('0x27')](_0x50f9f5,'name'),[_0x43e7('0x2f')]);_0x4690a6[_0x43e7('0x30')]=_[_0x43e7('0x31')](_0xb1fc63[_0x43e7('0x30')]);_0x4690a6[_0x43e7('0x32')]=_['intersection'](_0x4690a6[_0x43e7('0x2d')],_0x4690a6[_0x43e7('0x30')]);_0x33a1a5[_0x43e7('0x33')]=_[_0x43e7('0x34')](_0x4690a6['model'],qs['fields'](_0xb1fc63['query'][_0x43e7('0x35')]));_0x33a1a5[_0x43e7('0x33')]=_0x33a1a5[_0x43e7('0x33')][_0x43e7('0x36')]?_0x33a1a5[_0x43e7('0x33')]:_0x4690a6[_0x43e7('0x2d')];if(!_0xb1fc63['query']['hasOwnProperty']('nolimit')){_0x33a1a5['limit']=qs['limit'](_0xb1fc63['query']['limit']);_0x33a1a5[_0x43e7('0x19')]=qs['offset'](_0xb1fc63[_0x43e7('0x30')][_0x43e7('0x19')]);}_0x33a1a5[_0x43e7('0x37')]=qs[_0x43e7('0x38')](_0xb1fc63[_0x43e7('0x30')][_0x43e7('0x38')]);_0x33a1a5[_0x43e7('0x39')]=qs['filters'](_['pick'](_0xb1fc63['query'],_0x4690a6[_0x43e7('0x32')]),_0x50f9f5);if(_0xb1fc63[_0x43e7('0x30')][_0x43e7('0x3a')]){_0x33a1a5[_0x43e7('0x39')]=_[_0x43e7('0x3b')](_0x33a1a5[_0x43e7('0x39')],{'$or':_[_0x43e7('0x27')](_0x50f9f5,function(_0x2ffd43){if(_0x2ffd43['type']!==_0x43e7('0x3c')){var _0x2b0ffe={};_0x2b0ffe[_0x2ffd43['name']]={'$like':'%'+_0xb1fc63[_0x43e7('0x30')]['filter']+'%'};return _0x2b0ffe;}})});}_0x33a1a5=_[_0x43e7('0x3b')]({},_0x33a1a5,_0xb1fc63[_0x43e7('0x3d')]);var _0x1c6f45={'where':_0x33a1a5[_0x43e7('0x39')]};return db[_0x43e7('0x28')][_0x43e7('0x1a')](_0x1c6f45)['then'](function(_0x574a93){_0x45b675[_0x43e7('0x1a')]=_0x574a93;if(_0xb1fc63[_0x43e7('0x30')][_0x43e7('0x3e')]){_0x33a1a5[_0x43e7('0x3f')]=[{'all':!![]}];}return db[_0x43e7('0x28')]['findAll'](_0x33a1a5);})[_0x43e7('0x21')](function(_0x4227c4){_0x45b675['rows']=_0x4227c4;return _0x45b675;})[_0x43e7('0x21')](respondWithFilteredResult(_0x5087d7,_0x33a1a5))['catch'](handleError(_0x5087d7,null));};exports[_0x43e7('0x40')]=function(_0x504101,_0x3d81ae){var _0x3b4235={'raw':![],'where':{'id':_0x504101[_0x43e7('0x41')]['id']}},_0x3a5807={};_0x3a5807['model']=_['keys'](db[_0x43e7('0x28')][_0x43e7('0x29')]);_0x3a5807[_0x43e7('0x30')]=_[_0x43e7('0x31')](_0x504101['query']);_0x3a5807['filters']=_['intersection'](_0x3a5807[_0x43e7('0x2d')],_0x3a5807['query']);_0x3b4235[_0x43e7('0x33')]=_['intersection'](_0x3a5807['model'],qs[_0x43e7('0x35')](_0x504101['query'][_0x43e7('0x35')]));_0x3b4235[_0x43e7('0x33')]=_0x3b4235[_0x43e7('0x33')][_0x43e7('0x36')]?_0x3b4235['attributes']:_0x3a5807[_0x43e7('0x2d')];if(_0x504101[_0x43e7('0x30')][_0x43e7('0x3e')]){_0x3b4235[_0x43e7('0x3f')]=[{'all':!![]}];}_0x3b4235=_[_0x43e7('0x3b')]({},_0x3b4235,_0x504101[_0x43e7('0x3d')]);return db['ScreenRecording']['find'](_0x3b4235)[_0x43e7('0x21')](handleEntityNotFound(_0x3d81ae,null))[_0x43e7('0x21')](respondWithResult(_0x3d81ae,null))[_0x43e7('0x42')](handleError(_0x3d81ae,null));};exports['create']=function(_0x5c1c18,_0x56489b){return db[_0x43e7('0x28')][_0x43e7('0x43')](_0x5c1c18['body'],{})[_0x43e7('0x21')](respondWithResult(_0x56489b,0xc9))[_0x43e7('0x42')](handleError(_0x56489b,null));};exports[_0x43e7('0x20')]=function(_0x560329,_0x593155){if(_0x560329['body']['id']){delete _0x560329['body']['id'];}delete _0x560329[_0x43e7('0x44')][_0x43e7('0x45')];delete _0x560329['body'][_0x43e7('0x46')];delete _0x560329[_0x43e7('0x44')][_0x43e7('0x47')];delete _0x560329[_0x43e7('0x44')]['value'];return db[_0x43e7('0x28')]['find']({'where':{'id':_0x560329['params']['id']}})[_0x43e7('0x21')](handleEntityNotFound(_0x593155,null))[_0x43e7('0x21')](saveUpdates(_0x560329[_0x43e7('0x44')],null))[_0x43e7('0x21')](respondWithResult(_0x593155,null))[_0x43e7('0x42')](handleError(_0x593155,null));};exports[_0x43e7('0x48')]=function(_0x1cd87c,_0x256ddd){return db[_0x43e7('0x28')][_0x43e7('0x48')]()['then'](respondWithResult(_0x256ddd,null))[_0x43e7('0x42')](handleError(_0x256ddd,null));};exports[_0x43e7('0x49')]=function(_0x499c03,_0x39e3ca,_0x4e6f6d){var _0x35b799=require(_0x43e7('0x4a'));var _0x34e2ec=![];var _0x1f561f={};if(_0x499c03[_0x43e7('0x30')]['type']&&_0x499c03['query'][_0x43e7('0x2b')]===_0x43e7('0x4b')){_0x1f561f[_0x43e7('0x4b')]=_0x499c03[_0x43e7('0x41')]['id'];}else{_0x1f561f['id']=_0x499c03[_0x43e7('0x41')]['id'];}return db[_0x43e7('0x28')][_0x43e7('0x4c')]({'where':_0x1f561f,'attributes':['id',_0x43e7('0x4d')],'raw':!![]})[_0x43e7('0x21')](handleEntityNotFound(_0x39e3ca,null))[_0x43e7('0x21')](function(_0x312306){if(_0x312306){var _0x4ace49=path[_0x43e7('0x4e')](config[_0x43e7('0x4f')],'server/files/screen_recordings',_0x312306[_0x43e7('0x4d')]);var _0x220bf2=util[_0x43e7('0x2f')]('%s.cypher',_0x4ace49);if(fs['existsSync'](_0x220bf2)){_0x34e2ec=!![];return _0x35b799[_0x43e7('0x50')](_0x220bf2,_0x4ace49,config[_0x43e7('0x51')]['recording'])[_0x43e7('0x21')](function(){return _0x312306;});}return _0x312306;}})['then'](function(_0x49a6ce){if(_0x49a6ce){var _0x1fa3f6=path[_0x43e7('0x4e')](config[_0x43e7('0x4f')],_0x43e7('0x52'),_0x49a6ce[_0x43e7('0x4d')]);if(!fs['existsSync'](_0x1fa3f6)){throw new db[(_0x43e7('0x53'))][(_0x43e7('0x54'))]('ScreenRecording\x20not\x20found');}if(_0x49a6ce[_0x43e7('0x55')]){return _0x39e3ca[_0x43e7('0x49')](_0x1fa3f6,_0x49a6ce[_0x43e7('0x55')]+path['extname'](_0x1fa3f6),function(){if(_0x34e2ec){fs['unlink'](_0x1fa3f6);}});}else{return _0x39e3ca['download'](_0x1fa3f6,function(_0x2ada55){if(_0x34e2ec){fs[_0x43e7('0x56')](_0x1fa3f6);}});}}})[_0x43e7('0x42')](function(_0x3a6404){if(_0x3a6404['message']==='ScreenRecording\x20not\x20found'){_0x39e3ca[_0x43e7('0x1b')](0x194)[_0x43e7('0x25')](_0x43e7('0x57'));}else{return handleError(_0x39e3ca,null);}});};exports[_0x43e7('0x22')]=function(_0x5ea0db,_0x4438c0){return db[_0x43e7('0x28')][_0x43e7('0x4c')]({'where':{'id':_0x5ea0db[_0x43e7('0x41')]['id']}})[_0x43e7('0x21')](function(_0xd41e79){if(_[_0x43e7('0x58')](_0xd41e79)){throw new ReferenceError(_0x43e7('0x59'));}return _0xd41e79;})[_0x43e7('0x21')](function(_0x381208){var _0x252f00=path['join'](config['root'],_0x43e7('0x52'),_0x381208['value']);logger['info']('cancellazione\x20fisica\x20documento\x20%s',_0x252f00);if(!_[_0x43e7('0x58')](_0x381208[_0x43e7('0x4d')])&&fs['existsSync'](_0x252f00)){logger[_0x43e7('0x5a')](_0x43e7('0x5b')+_0x252f00+_0x43e7('0x5c'));fs['unlinkSync'](_0x252f00);}_0x252f00=_0x252f00+_0x43e7('0x5d');if(!_[_0x43e7('0x58')](_0x381208[_0x43e7('0x4d')])&&fs[_0x43e7('0x5e')](_0x252f00)){logger[_0x43e7('0x5a')](_0x43e7('0x5b')+_0x252f00+_0x43e7('0x5c'));fs['unlinkSync'](_0x252f00);}return _0x381208;})[_0x43e7('0x21')](function(_0x40d0c0){if(!_0x40d0c0)throw new InternalError();return _0x40d0c0[_0x43e7('0x22')]();})['then'](function(){_0x4438c0['status'](0xcc)[_0x43e7('0x15')]();})['catch'](handleError(_0x4438c0,null));};
\ No newline at end of file
+var _0x4c4e=['findAll','rows','catch','params','keys','find','create','body','duration','createdAt','closedAt','describe','download','../../components/encryptor','uniqueid','value','join','root','server/files/screen_recordings','%s.cypher','existsSync','secrets','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','message','send','Not\x20found','isNil','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','destroy','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','sendStatus','name','index','map','ScreenRecording','rawAttributes','type','key','model','differenceBy','format','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','options','includeAll','include'];(function(_0x4a53d,_0x58a95e){var _0x27410e=function(_0x38fc90){while(--_0x38fc90){_0x4a53d['push'](_0x4a53d['shift']());}};_0x27410e(++_0x58a95e);}(_0x4c4e,0x152));var _0xe4c4=function(_0x389bfd,_0x5e3767){_0x389bfd=_0x389bfd-0x0;var _0x53464f=_0x4c4e[_0x389bfd];return _0x53464f;};'use strict';var emlformat=require(_0xe4c4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe4c4('0x1'));var jsonpatch=require(_0xe4c4('0x2'));var rp=require(_0xe4c4('0x3'));var moment=require('moment');var BPromise=require(_0xe4c4('0x4'));var Mustache=require(_0xe4c4('0x5'));var util=require(_0xe4c4('0x6'));var path=require('path');var sox=require(_0xe4c4('0x7'));var csv=require('to-csv');var ejs=require(_0xe4c4('0x8'));var fs=require('fs');var fs_extra=require(_0xe4c4('0x9'));var _=require(_0xe4c4('0xa'));var squel=require(_0xe4c4('0xb'));var crypto=require(_0xe4c4('0xc'));var jsforce=require(_0xe4c4('0xd'));var deskjs=require(_0xe4c4('0xe'));var toCsv=require(_0xe4c4('0xf'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xe4c4('0x10'));var authService=require(_0xe4c4('0x11'));var qs=require(_0xe4c4('0x12'));var as=require(_0xe4c4('0x13'));var hardwareService=require(_0xe4c4('0x14'));var logger=require(_0xe4c4('0x15'))('api');var utils=require(_0xe4c4('0x16'));var config=require(_0xe4c4('0x17'));var licenseUtil=require(_0xe4c4('0x18'));var db=require(_0xe4c4('0x19'))['db'];function respondWithStatusCode(_0x50bfab,_0x262083){_0x262083=_0x262083||0xcc;return function(_0x115802){if(_0x115802){return _0x50bfab['sendStatus'](_0x262083);}return _0x50bfab[_0xe4c4('0x1a')](_0x262083)[_0xe4c4('0x1b')]();};}function respondWithResult(_0x5aa89b,_0x42ce9e){_0x42ce9e=_0x42ce9e||0xc8;return function(_0x29766a){if(_0x29766a){return _0x5aa89b['status'](_0x42ce9e)[_0xe4c4('0x1c')](_0x29766a);}};}function respondWithFilteredResult(_0x465c9b,_0x26ea05){return function(_0x40a36e){if(_0x40a36e){var _0x19e59b=typeof _0x26ea05[_0xe4c4('0x1d')]===_0xe4c4('0x1e')&&typeof _0x26ea05[_0xe4c4('0x1f')]===_0xe4c4('0x1e');var _0x36b10c=_0x40a36e[_0xe4c4('0x20')];var _0x42242c=_0x19e59b?0x0:_0x26ea05[_0xe4c4('0x1d')];var _0x43a9ce=_0x19e59b?_0x40a36e[_0xe4c4('0x20')]:_0x26ea05['offset']+_0x26ea05[_0xe4c4('0x1f')];var _0x24f946;if(_0x43a9ce>=_0x36b10c){_0x43a9ce=_0x36b10c;_0x24f946=0xc8;}else{_0x24f946=0xce;}_0x465c9b[_0xe4c4('0x1a')](_0x24f946);return _0x465c9b[_0xe4c4('0x21')]('Content-Range',_0x42242c+'-'+_0x43a9ce+'/'+_0x36b10c)[_0xe4c4('0x1c')](_0x40a36e);}return null;};}function patchUpdates(_0x1cad5d){return function(_0x1727eb){try{jsonpatch[_0xe4c4('0x22')](_0x1727eb,_0x1cad5d,!![]);}catch(_0x2c5aea){return BPromise[_0xe4c4('0x23')](_0x2c5aea);}return _0x1727eb[_0xe4c4('0x24')]();};}function saveUpdates(_0x393c96,_0x21bbb1){return function(_0x1a7690){if(_0x1a7690){return _0x1a7690[_0xe4c4('0x25')](_0x393c96)[_0xe4c4('0x26')](function(_0x138ead){return _0x138ead;});}return null;};}function removeEntity(_0x1db719,_0x15873e){return function(_0x59498e){if(_0x59498e){return _0x59498e['destroy']()[_0xe4c4('0x26')](function(){_0x1db719['status'](0xcc)[_0xe4c4('0x1b')]();});}};}function handleEntityNotFound(_0x5374fd,_0x3adfcb){return function(_0x5efc4c){if(!_0x5efc4c){_0x5374fd[_0xe4c4('0x27')](0x194);}return _0x5efc4c;};}function handleError(_0x583393,_0xba53ef){_0xba53ef=_0xba53ef||0x1f4;return function(_0x4a0199){logger['error'](_0x4a0199['stack']);if(_0x4a0199['name']){delete _0x4a0199[_0xe4c4('0x28')];}_0x583393['status'](_0xba53ef)['send'](_0x4a0199);};}exports[_0xe4c4('0x29')]=function(_0x11deab,_0x4bb911){var _0x57ba43={},_0x7428ad={},_0x33de43={'count':0x0,'rows':[]};var _0x4aa6c1=_[_0xe4c4('0x2a')](db[_0xe4c4('0x2b')][_0xe4c4('0x2c')],function(_0x48060e){return{'name':_0x48060e['fieldName'],'type':_0x48060e[_0xe4c4('0x2d')][_0xe4c4('0x2e')]};});_0x7428ad[_0xe4c4('0x2f')]=_[_0xe4c4('0x30')](_['map'](_0x4aa6c1,'name'),[_0xe4c4('0x31')]);_0x7428ad[_0xe4c4('0x32')]=_['keys'](_0x11deab[_0xe4c4('0x32')]);_0x7428ad[_0xe4c4('0x33')]=_[_0xe4c4('0x34')](_0x7428ad['model'],_0x7428ad[_0xe4c4('0x32')]);_0x57ba43['attributes']=_[_0xe4c4('0x34')](_0x7428ad[_0xe4c4('0x2f')],qs[_0xe4c4('0x35')](_0x11deab[_0xe4c4('0x32')][_0xe4c4('0x35')]));_0x57ba43[_0xe4c4('0x36')]=_0x57ba43[_0xe4c4('0x36')][_0xe4c4('0x37')]?_0x57ba43[_0xe4c4('0x36')]:_0x7428ad[_0xe4c4('0x2f')];if(!_0x11deab[_0xe4c4('0x32')][_0xe4c4('0x38')]('nolimit')){_0x57ba43[_0xe4c4('0x1f')]=qs[_0xe4c4('0x1f')](_0x11deab[_0xe4c4('0x32')]['limit']);_0x57ba43[_0xe4c4('0x1d')]=qs[_0xe4c4('0x1d')](_0x11deab[_0xe4c4('0x32')]['offset']);}_0x57ba43[_0xe4c4('0x39')]=qs[_0xe4c4('0x3a')](_0x11deab[_0xe4c4('0x32')][_0xe4c4('0x3a')]);_0x57ba43[_0xe4c4('0x3b')]=qs[_0xe4c4('0x33')](_[_0xe4c4('0x3c')](_0x11deab[_0xe4c4('0x32')],_0x7428ad[_0xe4c4('0x33')]),_0x4aa6c1);if(_0x11deab[_0xe4c4('0x32')]['filter']){_0x57ba43[_0xe4c4('0x3b')]=_[_0xe4c4('0x3d')](_0x57ba43[_0xe4c4('0x3b')],{'$or':_[_0xe4c4('0x2a')](_0x4aa6c1,function(_0x4c5551){if(_0x4c5551[_0xe4c4('0x2d')]!==_0xe4c4('0x3e')){var _0x4e6bd9={};_0x4e6bd9[_0x4c5551[_0xe4c4('0x28')]]={'$like':'%'+_0x11deab[_0xe4c4('0x32')]['filter']+'%'};return _0x4e6bd9;}})});}_0x57ba43=_[_0xe4c4('0x3d')]({},_0x57ba43,_0x11deab[_0xe4c4('0x3f')]);var _0x127bcd={'where':_0x57ba43[_0xe4c4('0x3b')]};return db[_0xe4c4('0x2b')][_0xe4c4('0x20')](_0x127bcd)[_0xe4c4('0x26')](function(_0x43201e){_0x33de43[_0xe4c4('0x20')]=_0x43201e;if(_0x11deab[_0xe4c4('0x32')][_0xe4c4('0x40')]){_0x57ba43[_0xe4c4('0x41')]=[{'all':!![]}];}return db['ScreenRecording'][_0xe4c4('0x42')](_0x57ba43);})[_0xe4c4('0x26')](function(_0x2b306d){_0x33de43[_0xe4c4('0x43')]=_0x2b306d;return _0x33de43;})[_0xe4c4('0x26')](respondWithFilteredResult(_0x4bb911,_0x57ba43))[_0xe4c4('0x44')](handleError(_0x4bb911,null));};exports['show']=function(_0x312a49,_0x526bef){var _0xca07dc={'raw':![],'where':{'id':_0x312a49[_0xe4c4('0x45')]['id']}},_0x3c067a={};_0x3c067a[_0xe4c4('0x2f')]=_[_0xe4c4('0x46')](db['ScreenRecording']['rawAttributes']);_0x3c067a[_0xe4c4('0x32')]=_[_0xe4c4('0x46')](_0x312a49[_0xe4c4('0x32')]);_0x3c067a['filters']=_[_0xe4c4('0x34')](_0x3c067a[_0xe4c4('0x2f')],_0x3c067a[_0xe4c4('0x32')]);_0xca07dc[_0xe4c4('0x36')]=_['intersection'](_0x3c067a[_0xe4c4('0x2f')],qs[_0xe4c4('0x35')](_0x312a49[_0xe4c4('0x32')][_0xe4c4('0x35')]));_0xca07dc[_0xe4c4('0x36')]=_0xca07dc[_0xe4c4('0x36')][_0xe4c4('0x37')]?_0xca07dc[_0xe4c4('0x36')]:_0x3c067a[_0xe4c4('0x2f')];if(_0x312a49['query'][_0xe4c4('0x40')]){_0xca07dc['include']=[{'all':!![]}];}_0xca07dc=_[_0xe4c4('0x3d')]({},_0xca07dc,_0x312a49[_0xe4c4('0x3f')]);return db[_0xe4c4('0x2b')][_0xe4c4('0x47')](_0xca07dc)[_0xe4c4('0x26')](handleEntityNotFound(_0x526bef,null))[_0xe4c4('0x26')](respondWithResult(_0x526bef,null))[_0xe4c4('0x44')](handleError(_0x526bef,null));};exports[_0xe4c4('0x48')]=function(_0x36f8ad,_0x18fb82){return db[_0xe4c4('0x2b')][_0xe4c4('0x48')](_0x36f8ad[_0xe4c4('0x49')],{})[_0xe4c4('0x26')](respondWithResult(_0x18fb82,0xc9))['catch'](handleError(_0x18fb82,null));};exports['update']=function(_0xe0e351,_0x198961){if(_0xe0e351['body']['id']){delete _0xe0e351[_0xe4c4('0x49')]['id'];}delete _0xe0e351[_0xe4c4('0x49')][_0xe4c4('0x4a')];delete _0xe0e351[_0xe4c4('0x49')][_0xe4c4('0x4b')];delete _0xe0e351['body'][_0xe4c4('0x4c')];delete _0xe0e351[_0xe4c4('0x49')]['value'];return db[_0xe4c4('0x2b')][_0xe4c4('0x47')]({'where':{'id':_0xe0e351['params']['id']}})[_0xe4c4('0x26')](handleEntityNotFound(_0x198961,null))['then'](saveUpdates(_0xe0e351[_0xe4c4('0x49')],null))[_0xe4c4('0x26')](respondWithResult(_0x198961,null))[_0xe4c4('0x44')](handleError(_0x198961,null));};exports[_0xe4c4('0x4d')]=function(_0x12eaed,_0x525534){return db[_0xe4c4('0x2b')][_0xe4c4('0x4d')]()[_0xe4c4('0x26')](respondWithResult(_0x525534,null))[_0xe4c4('0x44')](handleError(_0x525534,null));};exports[_0xe4c4('0x4e')]=function(_0x32a50e,_0x3ddcbe,_0x3aa205){var _0x1a96ba=require(_0xe4c4('0x4f'));var _0x1fe354=![];var _0x1940e3={};if(_0x32a50e[_0xe4c4('0x32')][_0xe4c4('0x2d')]&&_0x32a50e[_0xe4c4('0x32')][_0xe4c4('0x2d')]==='uniqueid'){_0x1940e3[_0xe4c4('0x50')]=_0x32a50e[_0xe4c4('0x45')]['id'];}else{_0x1940e3['id']=_0x32a50e[_0xe4c4('0x45')]['id'];}return db['ScreenRecording'][_0xe4c4('0x47')]({'where':_0x1940e3,'attributes':['id',_0xe4c4('0x51')],'raw':!![]})[_0xe4c4('0x26')](handleEntityNotFound(_0x3ddcbe,null))['then'](function(_0x45f959){if(_0x45f959){var _0x485c50=path[_0xe4c4('0x52')](config[_0xe4c4('0x53')],_0xe4c4('0x54'),_0x45f959['value']);var _0x479361=util[_0xe4c4('0x31')](_0xe4c4('0x55'),_0x485c50);if(fs[_0xe4c4('0x56')](_0x479361)){_0x1fe354=!![];return _0x1a96ba['decryptFile'](_0x479361,_0x485c50,config[_0xe4c4('0x57')]['recording'])['then'](function(){return _0x45f959;});}return _0x45f959;}})['then'](function(_0x4e08ec){if(_0x4e08ec){var _0x1ca931=path[_0xe4c4('0x52')](config[_0xe4c4('0x53')],_0xe4c4('0x54'),_0x4e08ec[_0xe4c4('0x51')]);if(!fs[_0xe4c4('0x56')](_0x1ca931)){throw new db['Sequelize'][(_0xe4c4('0x58'))](_0xe4c4('0x59'));}if(_0x4e08ec[_0xe4c4('0x5a')]){return _0x3ddcbe[_0xe4c4('0x4e')](_0x1ca931,_0x4e08ec[_0xe4c4('0x5a')]+path[_0xe4c4('0x5b')](_0x1ca931),function(){if(_0x1fe354){fs['unlink'](_0x1ca931);}});}else{return _0x3ddcbe['download'](_0x1ca931,function(_0x27599b){if(_0x1fe354){fs[_0xe4c4('0x5c')](_0x1ca931);}});}}})[_0xe4c4('0x44')](function(_0x3c8e44){if(_0x3c8e44[_0xe4c4('0x5d')]===_0xe4c4('0x59')){_0x3ddcbe[_0xe4c4('0x1a')](0x194)[_0xe4c4('0x5e')](_0xe4c4('0x5f'));}else{return handleError(_0x3ddcbe,null);}});};exports['destroy']=function(_0x59f033,_0x5a4138){return db['ScreenRecording'][_0xe4c4('0x47')]({'where':{'id':_0x59f033[_0xe4c4('0x45')]['id']}})[_0xe4c4('0x26')](function(_0x58f2dd){if(_[_0xe4c4('0x60')](_0x58f2dd)){throw new ReferenceError('Entity\x20not\x20found');}return _0x58f2dd;})[_0xe4c4('0x26')](function(_0x56ead3){var _0x5d6c0a=path[_0xe4c4('0x52')](config[_0xe4c4('0x53')],_0xe4c4('0x54'),_0x56ead3['value']);logger['info']('cancellazione\x20fisica\x20documento\x20%s',_0x5d6c0a);if(!_[_0xe4c4('0x60')](_0x56ead3[_0xe4c4('0x51')])&&fs['existsSync'](_0x5d6c0a)){logger[_0xe4c4('0x61')](_0xe4c4('0x62')+_0x5d6c0a+_0xe4c4('0x63'));fs['unlinkSync'](_0x5d6c0a);}_0x5d6c0a=_0x5d6c0a+'.cypher';if(!_[_0xe4c4('0x60')](_0x56ead3[_0xe4c4('0x51')])&&fs[_0xe4c4('0x56')](_0x5d6c0a)){logger[_0xe4c4('0x61')](_0xe4c4('0x62')+_0x5d6c0a+_0xe4c4('0x63'));fs['unlinkSync'](_0x5d6c0a);}return _0x56ead3;})[_0xe4c4('0x26')](function(_0x1bddd5){if(!_0x1bddd5)throw new InternalError();return _0x1bddd5[_0xe4c4('0x64')]();})['then'](function(){_0x5a4138[_0xe4c4('0x1a')](0xcc)[_0xe4c4('0x1b')]();})[_0xe4c4('0x44')](handleError(_0x5a4138,null));};
\ No newline at end of file
index 93803a6..fe3d6da 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x15f5=['path','rimraf','../../config/environment','exports','ScreenRecording','screen_recordings','interactionid','util','../../config/logger','api','moment','request-promise'];(function(_0x11be52,_0x2ef4f4){var _0x5b0bf8=function(_0x3659b6){while(--_0x3659b6){_0x11be52['push'](_0x11be52['shift']());}};_0x5b0bf8(++_0x2ef4f4);}(_0x15f5,0x1b7));var _0x515f=function(_0x1f0230,_0x84e43){_0x1f0230=_0x1f0230-0x0;var _0xc5e8c8=_0x15f5[_0x1f0230];return _0xc5e8c8;};'use strict';var _=require('lodash');var util=require(_0x515f('0x0'));var logger=require(_0x515f('0x1'))(_0x515f('0x2'));var moment=require(_0x515f('0x3'));var BPromise=require('bluebird');var rp=require(_0x515f('0x4'));var fs=require('fs');var path=require(_0x515f('0x5'));var rimraf=require(_0x515f('0x6'));var config=require(_0x515f('0x7'));var attributes=require('./screenRecording.attributes');module[_0x515f('0x8')]=function(_0x5bb933,_0x535cee){return _0x5bb933['define'](_0x515f('0x9'),attributes,{'tableName':_0x515f('0xa'),'paranoid':![],'indexes':[{'name':_0x515f('0xb'),'fields':['interactionid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x09e8=['./screenRecording.attributes','exports','ScreenRecording','screen_recordings','interactionid','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0x09e8,0x13d));var _0x809e=function(_0x1e9e5c,_0x13fb10){_0x1e9e5c=_0x1e9e5c-0x0;var _0x191cb9=_0x09e8[_0x1e9e5c];return _0x191cb9;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x809e('0x0'))('api');var moment=require(_0x809e('0x1'));var BPromise=require(_0x809e('0x2'));var rp=require(_0x809e('0x3'));var fs=require('fs');var path=require(_0x809e('0x4'));var rimraf=require(_0x809e('0x5'));var config=require(_0x809e('0x6'));var attributes=require(_0x809e('0x7'));module[_0x809e('0x8')]=function(_0xb15b4b,_0x266042){return _0xb15b4b['define'](_0x809e('0x9'),attributes,{'tableName':_0x809e('0xa'),'paranoid':![],'indexes':[{'name':_0x809e('0xb'),'fields':[_0x809e('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
index 40018b9..317ed9a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2456=['util','moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','ScreenRecording,\x20%s,\x20%s','message','result','catch','lodash'];(function(_0x5c81fd,_0x143aef){var _0x2d8c1b=function(_0x3d6cef){while(--_0x3d6cef){_0x5c81fd['push'](_0x5c81fd['shift']());}};_0x2d8c1b(++_0x143aef);}(_0x2456,0x17f));var _0x6245=function(_0x3b1c0b,_0x3e5f1b){_0x3b1c0b=_0x3b1c0b-0x0;var _0x270d3a=_0x2456[_0x3b1c0b];return _0x270d3a;};'use strict';var _=require(_0x6245('0x0'));var util=require(_0x6245('0x1'));var moment=require(_0x6245('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6245('0x3'));var db=require(_0x6245('0x4'))['db'];var utils=require(_0x6245('0x5'));var logger=require('../../config/logger')(_0x6245('0x6'));var config=require(_0x6245('0x7'));var jayson=require(_0x6245('0x8'));var client=jayson[_0x6245('0x9')][_0x6245('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1921ef,_0x528613,_0x5358f5){return new BPromise(function(_0x55ddcc,_0x3e28f4){return client[_0x6245('0xb')](_0x1921ef,_0x5358f5)[_0x6245('0xc')](function(_0x39d15c){logger[_0x6245('0xd')]('ScreenRecording,\x20%s,\x20%s',_0x528613,_0x6245('0xe'));logger[_0x6245('0xf')](_0x6245('0x10'),_0x528613,_0x6245('0xe'),JSON[_0x6245('0x11')](_0x39d15c));if(_0x39d15c[_0x6245('0x12')]){if(_0x39d15c[_0x6245('0x12')][_0x6245('0x13')]===0x1f4){logger[_0x6245('0x12')](_0x6245('0x14'),_0x528613,_0x39d15c['error'][_0x6245('0x15')]);return _0x3e28f4(_0x39d15c[_0x6245('0x12')][_0x6245('0x15')]);}logger['error'](_0x6245('0x14'),_0x528613,_0x39d15c[_0x6245('0x12')][_0x6245('0x15')]);return _0x55ddcc(_0x39d15c[_0x6245('0x12')][_0x6245('0x15')]);}else{logger[_0x6245('0xd')](_0x6245('0x14'),_0x528613,_0x6245('0xe'));_0x55ddcc(_0x39d15c[_0x6245('0x16')][_0x6245('0x15')]);}})[_0x6245('0x17')](function(_0x35dc1f){logger[_0x6245('0x12')](_0x6245('0x14'),_0x528613,_0x35dc1f);_0x3e28f4(_0x35dc1f);});});}
\ No newline at end of file
+var _0xfd18=['error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','request','then','ScreenRecording,\x20%s,\x20%s','request\x20sent','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','code'];(function(_0x550d07,_0x2d456e){var _0x125d2b=function(_0x19f0bb){while(--_0x19f0bb){_0x550d07['push'](_0x550d07['shift']());}};_0x125d2b(++_0x2d456e);}(_0xfd18,0xac));var _0x8fd1=function(_0x24502f,_0x134350){_0x24502f=_0x24502f-0x0;var _0x402fd9=_0xfd18[_0x24502f];return _0x402fd9;};'use strict';var _=require(_0x8fd1('0x0'));var util=require('util');var moment=require(_0x8fd1('0x1'));var BPromise=require(_0x8fd1('0x2'));var rs=require(_0x8fd1('0x3'));var fs=require('fs');var Redis=require(_0x8fd1('0x4'));var db=require(_0x8fd1('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x8fd1('0x6'))(_0x8fd1('0x7'));var config=require(_0x8fd1('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x8fd1('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x179ba9,_0x10c34a,_0x98b6e2){return new BPromise(function(_0x26e85b,_0x29c16e){return client[_0x8fd1('0xa')](_0x179ba9,_0x98b6e2)[_0x8fd1('0xb')](function(_0x36eae8){logger['info'](_0x8fd1('0xc'),_0x10c34a,_0x8fd1('0xd'));logger['debug'](_0x8fd1('0xe'),_0x10c34a,_0x8fd1('0xd'),JSON[_0x8fd1('0xf')](_0x36eae8));if(_0x36eae8['error']){if(_0x36eae8['error'][_0x8fd1('0x10')]===0x1f4){logger[_0x8fd1('0x11')](_0x8fd1('0xc'),_0x10c34a,_0x36eae8['error'][_0x8fd1('0x12')]);return _0x29c16e(_0x36eae8[_0x8fd1('0x11')][_0x8fd1('0x12')]);}logger['error'](_0x8fd1('0xc'),_0x10c34a,_0x36eae8['error'][_0x8fd1('0x12')]);return _0x26e85b(_0x36eae8['error'][_0x8fd1('0x12')]);}else{logger['info']('ScreenRecording,\x20%s,\x20%s',_0x10c34a,'request\x20sent');_0x26e85b(_0x36eae8[_0x8fd1('0x13')][_0x8fd1('0x12')]);}})[_0x8fd1('0x14')](function(_0x1b06a8){logger[_0x8fd1('0x11')](_0x8fd1('0xc'),_0x10c34a,_0x1b06a8);_0x29c16e(_0x1b06a8);});});}
\ No newline at end of file
index f7c6b0b..fafd6d7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5c88=['logo','extname','originalname','post','single','addLogo','join','logologin','/:id/logo_login','file','addLogoLogin','preferred','addPreferred','favicon','addFavicon','put','update','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','get','isAuthenticated','index','/now','getDate','/:id','show','/:id/logo','/:id/gdpr','/:id/preferred','getPreferred','/:id/favicon','diskStorage','root','server/files/images/logos/','format','%s%s'];(function(_0x270cb1,_0x5e80e3){var _0x30bf86=function(_0x5debc6){while(--_0x5debc6){_0x270cb1['push'](_0x270cb1['shift']());}};_0x30bf86(++_0x5e80e3);}(_0x5c88,0xf3));var _0x85c8=function(_0x42025b,_0x2c635a){_0x42025b=_0x42025b-0x0;var _0xc991fc=_0x5c88[_0x42025b];return _0xc991fc;};'use strict';var multer=require(_0x85c8('0x0'));var util=require(_0x85c8('0x1'));var path=require(_0x85c8('0x2'));var timeout=require(_0x85c8('0x3'));var express=require(_0x85c8('0x4'));var router=express['Router']();var fs_extra=require(_0x85c8('0x5'));var auth=require(_0x85c8('0x6'));var interaction=require(_0x85c8('0x7'));var config=require(_0x85c8('0x8'));var controller=require(_0x85c8('0x9'));router[_0x85c8('0xa')]('/',auth[_0x85c8('0xb')](),controller[_0x85c8('0xc')]);router[_0x85c8('0xa')](_0x85c8('0xd'),controller[_0x85c8('0xe')]);router['get'](_0x85c8('0xf'),controller[_0x85c8('0x10')]);router['get'](_0x85c8('0x11'),controller['getLogo']);router[_0x85c8('0xa')]('/:id/logo_login',controller['getLogoLogin']);router[_0x85c8('0xa')](_0x85c8('0x12'),controller['gdpr']);router[_0x85c8('0xa')](_0x85c8('0x13'),controller[_0x85c8('0x14')]);router[_0x85c8('0xa')](_0x85c8('0x15'),controller['getFavicon']);var upload=multer({'storage':multer[_0x85c8('0x16')]({'destination':function(_0x274c5,_0x5c536c,_0x268b07){_0x268b07(null,path['join'](config[_0x85c8('0x17')],_0x85c8('0x18')));},'filename':function(_0x53afcb,_0x1b0980,_0x2230c7){_0x2230c7(null,util[_0x85c8('0x19')](_0x85c8('0x1a'),_0x85c8('0x1b'),path[_0x85c8('0x1c')](_0x1b0980[_0x85c8('0x1d')])));}})});router[_0x85c8('0x1e')](_0x85c8('0x11'),upload[_0x85c8('0x1f')]('file'),controller[_0x85c8('0x20')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3c6225,_0x3789ac,_0x3b3efe){_0x3b3efe(null,path[_0x85c8('0x21')](config[_0x85c8('0x17')],_0x85c8('0x18')));},'filename':function(_0x1091d4,_0x135f1c,_0x516b48){_0x516b48(null,util[_0x85c8('0x19')](_0x85c8('0x1a'),_0x85c8('0x22'),path['extname'](_0x135f1c[_0x85c8('0x1d')])));}})});router[_0x85c8('0x1e')](_0x85c8('0x23'),upload[_0x85c8('0x1f')](_0x85c8('0x24')),controller[_0x85c8('0x25')]);var upload=multer({'storage':multer[_0x85c8('0x16')]({'destination':function(_0x58b186,_0x67c19a,_0x38c85e){_0x38c85e(null,path[_0x85c8('0x21')](config[_0x85c8('0x17')],_0x85c8('0x18')));},'filename':function(_0x9c2716,_0x805ab5,_0xeb4b90){_0xeb4b90(null,util[_0x85c8('0x19')](_0x85c8('0x1a'),_0x85c8('0x26'),path[_0x85c8('0x1c')](_0x805ab5[_0x85c8('0x1d')])));}})});router[_0x85c8('0x1e')](_0x85c8('0x13'),upload[_0x85c8('0x1f')]('file'),controller[_0x85c8('0x27')]);var upload=multer({'storage':multer[_0x85c8('0x16')]({'destination':function(_0x2a5570,_0x5826f9,_0x53fb34){_0x53fb34(null,path[_0x85c8('0x21')](config[_0x85c8('0x17')],'server/files/images/logos/'));},'filename':function(_0x2aeb2a,_0x2c2af1,_0x36343d){_0x36343d(null,util['format'](_0x85c8('0x1a'),_0x85c8('0x28'),path[_0x85c8('0x1c')](_0x2c2af1[_0x85c8('0x1d')])));}})});router[_0x85c8('0x1e')](_0x85c8('0x15'),upload[_0x85c8('0x1f')](_0x85c8('0x24')),controller[_0x85c8('0x29')]);router[_0x85c8('0x2a')](_0x85c8('0xf'),auth[_0x85c8('0xb')](),controller[_0x85c8('0x2b')]);module[_0x85c8('0x2c')]=router;
\ No newline at end of file
+var _0xf1ed=['logologin','/:id/logo_login','single','addLogoLogin','preferred','addPreferred','favicon','addFavicon','put','isAuthenticated','update','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','index','get','/now','getDate','/:id','/:id/logo','getLogoLogin','gdpr','/:id/preferred','getPreferred','getFavicon','diskStorage','root','format','%s%s','logo','extname','originalname','post','file','addLogo','join','server/files/images/logos/'];(function(_0x412c8f,_0x11ec94){var _0x27c005=function(_0x127059){while(--_0x127059){_0x412c8f['push'](_0x412c8f['shift']());}};_0x27c005(++_0x11ec94);}(_0xf1ed,0x1f0));var _0xdf1e=function(_0x5e07c1,_0x2b8af5){_0x5e07c1=_0x5e07c1-0x0;var _0xfdb978=_0xf1ed[_0x5e07c1];return _0xfdb978;};'use strict';var multer=require(_0xdf1e('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xdf1e('0x1'));var express=require(_0xdf1e('0x2'));var router=express[_0xdf1e('0x3')]();var fs_extra=require(_0xdf1e('0x4'));var auth=require(_0xdf1e('0x5'));var interaction=require(_0xdf1e('0x6'));var config=require(_0xdf1e('0x7'));var controller=require(_0xdf1e('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xdf1e('0x9')]);router[_0xdf1e('0xa')](_0xdf1e('0xb'),controller[_0xdf1e('0xc')]);router[_0xdf1e('0xa')](_0xdf1e('0xd'),controller['show']);router[_0xdf1e('0xa')](_0xdf1e('0xe'),controller['getLogo']);router[_0xdf1e('0xa')]('/:id/logo_login',controller[_0xdf1e('0xf')]);router[_0xdf1e('0xa')]('/:id/gdpr',controller[_0xdf1e('0x10')]);router['get'](_0xdf1e('0x11'),controller[_0xdf1e('0x12')]);router[_0xdf1e('0xa')]('/:id/favicon',controller[_0xdf1e('0x13')]);var upload=multer({'storage':multer[_0xdf1e('0x14')]({'destination':function(_0x2ca615,_0x4646bf,_0xbc0f5d){_0xbc0f5d(null,path['join'](config[_0xdf1e('0x15')],'server/files/images/logos/'));},'filename':function(_0x36d696,_0x40ec68,_0x5bc221){_0x5bc221(null,util[_0xdf1e('0x16')](_0xdf1e('0x17'),_0xdf1e('0x18'),path[_0xdf1e('0x19')](_0x40ec68[_0xdf1e('0x1a')])));}})});router[_0xdf1e('0x1b')](_0xdf1e('0xe'),upload['single'](_0xdf1e('0x1c')),controller[_0xdf1e('0x1d')]);var upload=multer({'storage':multer[_0xdf1e('0x14')]({'destination':function(_0x53fc4c,_0x4df5a1,_0x3bc87a){_0x3bc87a(null,path[_0xdf1e('0x1e')](config['root'],_0xdf1e('0x1f')));},'filename':function(_0x5be6c8,_0x6292c9,_0x1a4a53){_0x1a4a53(null,util[_0xdf1e('0x16')]('%s%s',_0xdf1e('0x20'),path[_0xdf1e('0x19')](_0x6292c9[_0xdf1e('0x1a')])));}})});router[_0xdf1e('0x1b')](_0xdf1e('0x21'),upload[_0xdf1e('0x22')](_0xdf1e('0x1c')),controller[_0xdf1e('0x23')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x35d5c5,_0x5c661e,_0x46fa38){_0x46fa38(null,path['join'](config[_0xdf1e('0x15')],_0xdf1e('0x1f')));},'filename':function(_0x5a3931,_0x395c5f,_0x49a700){_0x49a700(null,util['format'](_0xdf1e('0x17'),_0xdf1e('0x24'),path['extname'](_0x395c5f['originalname'])));}})});router[_0xdf1e('0x1b')]('/:id/preferred',upload[_0xdf1e('0x22')](_0xdf1e('0x1c')),controller[_0xdf1e('0x25')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x149b10,_0x38db04,_0x165970){_0x165970(null,path['join'](config[_0xdf1e('0x15')],_0xdf1e('0x1f')));},'filename':function(_0x67fb5b,_0x4236c6,_0x10623f){_0x10623f(null,util['format'](_0xdf1e('0x17'),_0xdf1e('0x26'),path[_0xdf1e('0x19')](_0x4236c6[_0xdf1e('0x1a')])));}})});router[_0xdf1e('0x1b')]('/:id/favicon',upload[_0xdf1e('0x22')]('file'),controller[_0xdf1e('0x27')]);router[_0xdf1e('0x28')]('/:id',auth[_0xdf1e('0x29')](),controller[_0xdf1e('0x2a')]);module[_0xdf1e('0x2b')]=router;
\ No newline at end of file
index d794af6..44421b4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6888=['https://www.xcally.com/bar/phonebar/autoupdater.xml','alternate','UNSIGNED','sequelize','INTEGER','min_internal','min_mailbox','STRING','BOOLEAN'];(function(_0x3fa49f,_0x598c31){var _0x43b99c=function(_0xbc5769){while(--_0xbc5769){_0x3fa49f['push'](_0x3fa49f['shift']());}};_0x43b99c(++_0x598c31);}(_0x6888,0xd2));var _0x8688=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0x6888[_0x68c979];return _0x4f0001;};'use strict';var Sequelize=require(_0x8688('0x0'));module['exports']={'min_internal':{'type':Sequelize[_0x8688('0x1')](0xb),'unique':_0x8688('0x2'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x8688('0x1')](0xb),'unique':_0x8688('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0x8688('0x1')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x8688('0x4')],'defaultValue':'/var/opt/motion2/server/files/sounds/converted'},'logo':{'type':Sequelize['STRING']},'defaultLogo':{'type':Sequelize[_0x8688('0x5')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x8688('0x4')]},'defaultLoginLogo':{'type':Sequelize[_0x8688('0x5')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x8688('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x8688('0x5')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x8688('0x5')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0x8688('0x4')]},'turnaddr':{'type':Sequelize[_0x8688('0x4')]},'turnusername':{'type':Sequelize[_0x8688('0x4')]},'turnpassword':{'type':Sequelize[_0x8688('0x4')]},'pageTitle':{'type':Sequelize[_0x8688('0x4')]},'defaultPageTitle':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x8688('0x1')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x8688('0x5')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x8688('0x4')],'defaultValue':_0x8688('0x6')},'enableEmailPreview':{'type':Sequelize[_0x8688('0x5')],'defaultValue':![]},'split':{'type':Sequelize[_0x8688('0x5')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0x8688('0x1')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x8688('0x1')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x8688('0x1')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0x8688('0x7')},'chatTimeout':{'type':Sequelize[_0x8688('0x1')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x8688('0x5')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x8688('0x4')]},'defaultPreferred':{'type':Sequelize[_0x8688('0x5')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x8688('0x5')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x8688('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x8688('0x1')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x8688('0x1')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x8688('0x4')]},'defaultFavicon':{'type':Sequelize[_0x8688('0x5')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x8688('0x1')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x8688('0x5')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0x8688('0x1')]},'transcribeRegion':{'type':Sequelize[_0x8688('0x4')]},'sentiment':{'type':Sequelize[_0x8688('0x5')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0x8688('0x5')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x8688('0x1')]},'sentimentRegion':{'type':Sequelize[_0x8688('0x4')]},'language':{'type':Sequelize['STRING']},'bucket':{'type':Sequelize['STRING']},'googleSsoEnabled':{'type':Sequelize[_0x8688('0x5')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x8688('0x5')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize['INTEGER'](0x2)[_0x8688('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x8688('0x1')](0x2)[_0x8688('0x8')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x8688('0x1')](0x2)[_0x8688('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x8688('0x1')](0x2)[_0x8688('0x8')],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x8688('0x5')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x8688('0x1')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x8688('0x1')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize[_0x8688('0x1')],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x8688('0x5')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0x8688('0x5')],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'disabledCookie':{'type':Sequelize[_0x8688('0x5')],'defaultValue':![]},'limitTabs':{'type':Sequelize[_0x8688('0x1')],'defaultValue':0x14}};
\ No newline at end of file
+var _0x2b4a=['INTEGER','min_internal','min_mailbox','STRING','BOOLEAN','https://www.xcally.com/bar/phonebar/autoupdater.xml','alternate','UNSIGNED','sequelize','exports'];(function(_0x4745ba,_0x1091a0){var _0x517710=function(_0x11aebd){while(--_0x11aebd){_0x4745ba['push'](_0x4745ba['shift']());}};_0x517710(++_0x1091a0);}(_0x2b4a,0x13e));var _0xa2b4=function(_0x40b3f2,_0x2c4f5f){_0x40b3f2=_0x40b3f2-0x0;var _0x4ce90c=_0x2b4a[_0x40b3f2];return _0x4ce90c;};'use strict';var Sequelize=require(_0xa2b4('0x0'));module[_0xa2b4('0x1')]={'min_internal':{'type':Sequelize[_0xa2b4('0x2')](0xb),'unique':_0xa2b4('0x3'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0xa2b4('0x2')](0xb),'unique':_0xa2b4('0x4'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0xa2b4('0x2')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0xa2b4('0x5')],'defaultValue':'/var/opt/motion2/server/files/sounds/converted'},'logo':{'type':Sequelize[_0xa2b4('0x5')]},'defaultLogo':{'type':Sequelize[_0xa2b4('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0xa2b4('0x5')]},'defaultLoginLogo':{'type':Sequelize[_0xa2b4('0x6')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize['STRING']},'defaultHeaderWhiteLabel':{'type':Sequelize[_0xa2b4('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0xa2b4('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0xa2b4('0x5')]},'turnaddr':{'type':Sequelize[_0xa2b4('0x5')]},'turnusername':{'type':Sequelize[_0xa2b4('0x5')]},'turnpassword':{'type':Sequelize[_0xa2b4('0x5')]},'pageTitle':{'type':Sequelize[_0xa2b4('0x5')]},'defaultPageTitle':{'type':Sequelize[_0xa2b4('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0xa2b4('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize['STRING'],'defaultValue':_0xa2b4('0x7')},'enableEmailPreview':{'type':Sequelize[_0xa2b4('0x6')],'defaultValue':![]},'split':{'type':Sequelize[_0xa2b4('0x6')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0xa2b4('0x2')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0xa2b4('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0xa2b4('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0xa2b4('0x5')],'defaultValue':_0xa2b4('0x8')},'chatTimeout':{'type':Sequelize[_0xa2b4('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0xa2b4('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0xa2b4('0x5')]},'defaultPreferred':{'type':Sequelize[_0xa2b4('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0xa2b4('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0xa2b4('0x5')]},'allowedLoginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0xa2b4('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0xa2b4('0x5')]},'defaultFavicon':{'type':Sequelize[_0xa2b4('0x6')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0xa2b4('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0xa2b4('0x6')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0xa2b4('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize['INTEGER']},'transcribeRegion':{'type':Sequelize[_0xa2b4('0x5')]},'sentiment':{'type':Sequelize[_0xa2b4('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0xa2b4('0x6')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0xa2b4('0x2')]},'sentimentRegion':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xa2b4('0x5')]},'bucket':{'type':Sequelize[_0xa2b4('0x5')]},'googleSsoEnabled':{'type':Sequelize[_0xa2b4('0x6')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0xa2b4('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0xa2b4('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize['INTEGER'](0x2)[_0xa2b4('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0xa2b4('0x2')](0x2)[_0xa2b4('0x9')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0xa2b4('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0xa2b4('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize[_0xa2b4('0x2')],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0xa2b4('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0xa2b4('0x2')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize[_0xa2b4('0x2')],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0xa2b4('0x6')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0xa2b4('0x6')],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'disabledCookie':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'limitTabs':{'type':Sequelize['INTEGER'],'defaultValue':0x14}};
\ No newline at end of file
index a29e61d..69c2390 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x76ff=['keys','intersection','options','find','update','body','addLogo','file','logo','filename','addLogoLogin','loginLogo','getLogo','server/files/images/logos','getLicense','favicon','defaultPreferred','defaultFavicon','existsSync','join','root','toLower','default_logo.svg','default','upperFirst','custom','Sequelize','\x20not\x20found','download','getLogoLogin','preferred','defaultLogo','defaultLoginLogo','default_loginLogo.svg','ValidationError','gdpr','securePassword','addPreferred','default_preferred.png','getFavicon','default_favicon.ico','getDate','now','utcOffset','format','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','Setting,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','catch','sendStatus','status','limit','undefined','count','offset','set','Content-Range','apply','reject','save','destroy','end','stack','name','send','map','Setting','rawAttributes','fieldName','type','key','model','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','includeAll','rows','show','params'];(function(_0x3989e7,_0x313c56){var _0x195862=function(_0x3f325d){while(--_0x3f325d){_0x3989e7['push'](_0x3989e7['shift']());}};_0x195862(++_0x313c56);}(_0x76ff,0xa8));var _0xf76f=function(_0xa25090,_0x3aeac8){_0xa25090=_0xa25090-0x0;var _0x234c7d=_0x76ff[_0xa25090];return _0x234c7d;};'use strict';var emlformat=require(_0xf76f('0x0'));var rimraf=require(_0xf76f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xf76f('0x2'));var moment=require('moment');var BPromise=require(_0xf76f('0x3'));var Mustache=require(_0xf76f('0x4'));var util=require(_0xf76f('0x5'));var path=require(_0xf76f('0x6'));var sox=require(_0xf76f('0x7'));var csv=require(_0xf76f('0x8'));var ejs=require(_0xf76f('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf76f('0xa'));var squel=require(_0xf76f('0xb'));var crypto=require('crypto');var jsforce=require(_0xf76f('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xf76f('0x8'));var querystring=require('querystring');var Papa=require(_0xf76f('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xf76f('0xe'));var as=require(_0xf76f('0xf'));var hardwareService=require(_0xf76f('0x10'));var logger=require(_0xf76f('0x11'))(_0xf76f('0x12'));var utils=require(_0xf76f('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xf76f('0x14'));var db=require(_0xf76f('0x15'))['db'];var jayson=require(_0xf76f('0x16'));var client=jayson[_0xf76f('0x17')][_0xf76f('0x18')]({'port':0x232a});function respondWithRpcPromise(_0x21fbba,_0x8aadc7,_0x19f55a,_0x48982b){return new BPromise(function(_0x3dd357,_0x10a5b0){var _0x2b9e57=_0x48982b||client;return _0x2b9e57[_0xf76f('0x19')](_0x21fbba,_0x19f55a)[_0xf76f('0x1a')](function(_0x377299){logger[_0xf76f('0x1b')](_0xf76f('0x1c'),_0x8aadc7,'request\x20sent');logger[_0xf76f('0x1d')]('Setting,\x20%s,\x20%s,\x20%s',_0x8aadc7,_0xf76f('0x1e'),JSON[_0xf76f('0x1f')](_0x377299));if(_0x377299[_0xf76f('0x20')]){if(_0x377299[_0xf76f('0x20')]['code']===0x1f4){logger[_0xf76f('0x20')](_0xf76f('0x1c'),_0x8aadc7,_0x377299[_0xf76f('0x20')]['message']);return _0x10a5b0(_0x377299[_0xf76f('0x20')][_0xf76f('0x21')]);}logger[_0xf76f('0x20')](_0xf76f('0x1c'),_0x8aadc7,_0x377299[_0xf76f('0x20')][_0xf76f('0x21')]);return _0x3dd357(_0x377299[_0xf76f('0x20')][_0xf76f('0x21')]);}else{logger[_0xf76f('0x1b')](_0xf76f('0x1c'),_0x8aadc7,_0xf76f('0x1e'));_0x3dd357(_0x377299[_0xf76f('0x22')][_0xf76f('0x21')]);}})[_0xf76f('0x23')](function(_0x59e89d){logger[_0xf76f('0x20')](_0xf76f('0x1c'),_0x8aadc7,_0x59e89d);_0x10a5b0(_0x59e89d);});});}function respondWithStatusCode(_0x1f5814,_0x4a158e){_0x4a158e=_0x4a158e||0xcc;return function(_0x53e7b7){if(_0x53e7b7){return _0x1f5814[_0xf76f('0x24')](_0x4a158e);}return _0x1f5814[_0xf76f('0x25')](_0x4a158e)['end']();};}function respondWithResult(_0x2bc203,_0x57bfa2){_0x57bfa2=_0x57bfa2||0xc8;return function(_0x512406){if(_0x512406){return _0x2bc203[_0xf76f('0x25')](_0x57bfa2)['json'](_0x512406);}};}function respondWithFilteredResult(_0x5f05e2,_0x4e8ff4){return function(_0x502a79){if(_0x502a79){var _0x5cf825=typeof _0x4e8ff4['offset']==='undefined'&&typeof _0x4e8ff4[_0xf76f('0x26')]===_0xf76f('0x27');var _0xb2d062=_0x502a79[_0xf76f('0x28')];var _0x5b22a0=_0x5cf825?0x0:_0x4e8ff4[_0xf76f('0x29')];var _0x44f731=_0x5cf825?_0x502a79[_0xf76f('0x28')]:_0x4e8ff4[_0xf76f('0x29')]+_0x4e8ff4[_0xf76f('0x26')];var _0x102074;if(_0x44f731>=_0xb2d062){_0x44f731=_0xb2d062;_0x102074=0xc8;}else{_0x102074=0xce;}_0x5f05e2[_0xf76f('0x25')](_0x102074);return _0x5f05e2[_0xf76f('0x2a')](_0xf76f('0x2b'),_0x5b22a0+'-'+_0x44f731+'/'+_0xb2d062)['json'](_0x502a79);}return null;};}function patchUpdates(_0x2e0955){return function(_0x4f1fe6){try{jsonpatch[_0xf76f('0x2c')](_0x4f1fe6,_0x2e0955,!![]);}catch(_0x5b027d){return BPromise[_0xf76f('0x2d')](_0x5b027d);}return _0x4f1fe6[_0xf76f('0x2e')]();};}function saveUpdates(_0x4acd0e,_0x2d3939){return function(_0x904b6c){if(_0x904b6c){return _0x904b6c['update'](_0x4acd0e)[_0xf76f('0x1a')](function(_0x3571c3){return _0x3571c3;});}return null;};}function removeEntity(_0x30db0f,_0x2d97c0){return function(_0x5a50c7){if(_0x5a50c7){return _0x5a50c7[_0xf76f('0x2f')]()[_0xf76f('0x1a')](function(){_0x30db0f[_0xf76f('0x25')](0xcc)[_0xf76f('0x30')]();});}};}function handleEntityNotFound(_0x530806,_0x254cc0){return function(_0x200aed){if(!_0x200aed){_0x530806[_0xf76f('0x24')](0x194);}return _0x200aed;};}function handleError(_0x227456,_0x173b5b){_0x173b5b=_0x173b5b||0x1f4;return function(_0x25afaa){logger['error'](_0x25afaa[_0xf76f('0x31')]);if(_0x25afaa[_0xf76f('0x32')]){delete _0x25afaa[_0xf76f('0x32')];}_0x227456['status'](_0x173b5b)[_0xf76f('0x33')](_0x25afaa);};}exports['index']=function(_0x17835c,_0x2ae7bb){var _0x2e2d01={},_0x5af909={},_0x12b419={'count':0x0,'rows':[]};var _0xd1ac30=_[_0xf76f('0x34')](db[_0xf76f('0x35')][_0xf76f('0x36')],function(_0x231568){return{'name':_0x231568[_0xf76f('0x37')],'type':_0x231568[_0xf76f('0x38')][_0xf76f('0x39')]};});_0x5af909[_0xf76f('0x3a')]=_[_0xf76f('0x34')](_0xd1ac30,_0xf76f('0x32'));_0x5af909[_0xf76f('0x3b')]=_['keys'](_0x17835c[_0xf76f('0x3b')]);_0x5af909['filters']=_['intersection'](_0x5af909[_0xf76f('0x3a')],_0x5af909[_0xf76f('0x3b')]);_0x2e2d01[_0xf76f('0x3c')]=_['intersection'](_0x5af909[_0xf76f('0x3a')],qs[_0xf76f('0x3d')](_0x17835c[_0xf76f('0x3b')][_0xf76f('0x3d')]));_0x2e2d01[_0xf76f('0x3c')]=_0x2e2d01[_0xf76f('0x3c')][_0xf76f('0x3e')]?_0x2e2d01[_0xf76f('0x3c')]:_0x5af909[_0xf76f('0x3a')];if(!_0x17835c[_0xf76f('0x3b')][_0xf76f('0x3f')](_0xf76f('0x40'))){_0x2e2d01['limit']=qs[_0xf76f('0x26')](_0x17835c['query'][_0xf76f('0x26')]);_0x2e2d01[_0xf76f('0x29')]=qs[_0xf76f('0x29')](_0x17835c[_0xf76f('0x3b')][_0xf76f('0x29')]);}_0x2e2d01[_0xf76f('0x41')]=qs['sort'](_0x17835c[_0xf76f('0x3b')][_0xf76f('0x42')]);_0x2e2d01[_0xf76f('0x43')]=qs[_0xf76f('0x44')](_['pick'](_0x17835c[_0xf76f('0x3b')],_0x5af909['filters']),_0xd1ac30);if(_0x17835c[_0xf76f('0x3b')][_0xf76f('0x45')]){_0x2e2d01[_0xf76f('0x43')]=_[_0xf76f('0x46')](_0x2e2d01[_0xf76f('0x43')],{'$or':_[_0xf76f('0x34')](_0xd1ac30,function(_0x51e0c8){if(_0x51e0c8['type']!==_0xf76f('0x47')){var _0x1dded9={};_0x1dded9[_0x51e0c8['name']]={'$like':'%'+_0x17835c[_0xf76f('0x3b')][_0xf76f('0x45')]+'%'};return _0x1dded9;}})});}_0x2e2d01=_[_0xf76f('0x46')]({},_0x2e2d01,_0x17835c['options']);var _0x7e9cb6={'where':_0x2e2d01[_0xf76f('0x43')]};return db[_0xf76f('0x35')][_0xf76f('0x28')](_0x7e9cb6)[_0xf76f('0x1a')](function(_0x5736d2){_0x12b419[_0xf76f('0x28')]=_0x5736d2;if(_0x17835c[_0xf76f('0x3b')][_0xf76f('0x48')]){_0x2e2d01['include']=[{'all':!![]}];}return db[_0xf76f('0x35')]['findAll'](_0x2e2d01);})[_0xf76f('0x1a')](function(_0x522ee2){_0x12b419[_0xf76f('0x49')]=_0x522ee2;return _0x12b419;})['then'](respondWithFilteredResult(_0x2ae7bb,_0x2e2d01))[_0xf76f('0x23')](handleError(_0x2ae7bb,null));};exports[_0xf76f('0x4a')]=function(_0xce30ee,_0x20fbbc){var _0x4076db={'raw':![],'where':{'id':_0xce30ee[_0xf76f('0x4b')]['id']}},_0x3a5831={};_0x3a5831[_0xf76f('0x3a')]=_[_0xf76f('0x4c')](db[_0xf76f('0x35')]['rawAttributes']);_0x3a5831[_0xf76f('0x3b')]=_[_0xf76f('0x4c')](_0xce30ee[_0xf76f('0x3b')]);_0x3a5831[_0xf76f('0x44')]=_[_0xf76f('0x4d')](_0x3a5831[_0xf76f('0x3a')],_0x3a5831[_0xf76f('0x3b')]);_0x4076db[_0xf76f('0x3c')]=_[_0xf76f('0x4d')](_0x3a5831['model'],qs['fields'](_0xce30ee[_0xf76f('0x3b')]['fields']));_0x4076db['attributes']=_0x4076db[_0xf76f('0x3c')][_0xf76f('0x3e')]?_0x4076db[_0xf76f('0x3c')]:_0x3a5831[_0xf76f('0x3a')];if(_0xce30ee[_0xf76f('0x3b')][_0xf76f('0x48')]){_0x4076db['include']=[{'all':!![]}];}_0x4076db=_['merge']({},_0x4076db,_0xce30ee[_0xf76f('0x4e')]);return db['Setting'][_0xf76f('0x4f')](_0x4076db)[_0xf76f('0x1a')](handleEntityNotFound(_0x20fbbc,null))[_0xf76f('0x1a')](respondWithResult(_0x20fbbc,null))[_0xf76f('0x23')](handleError(_0x20fbbc,null));};exports[_0xf76f('0x50')]=function(_0x51abb,_0x5afb03){if(_0x51abb[_0xf76f('0x51')]['id']){delete _0x51abb[_0xf76f('0x51')]['id'];}return db['Setting'][_0xf76f('0x4f')]({'where':{'id':_0x51abb[_0xf76f('0x4b')]['id']}})[_0xf76f('0x1a')](handleEntityNotFound(_0x5afb03,null))[_0xf76f('0x1a')](saveUpdates(_0x51abb[_0xf76f('0x51')],null))[_0xf76f('0x1a')](respondWithResult(_0x5afb03,null))[_0xf76f('0x23')](handleError(_0x5afb03,null));};exports[_0xf76f('0x52')]=function(_0x4b3ce5,_0x5b13b8,_0x19f6a7){if(_0x4b3ce5[_0xf76f('0x53')]&&_0x4b3ce5[_0xf76f('0x53')]['filename']){_0x4b3ce5[_0xf76f('0x51')][_0xf76f('0x54')]=_0x4b3ce5[_0xf76f('0x53')][_0xf76f('0x55')];}return db[_0xf76f('0x35')][_0xf76f('0x4f')]({'where':{'id':_0x4b3ce5[_0xf76f('0x4b')]['id']}})[_0xf76f('0x1a')](handleEntityNotFound(_0x5b13b8,null))['then'](saveUpdates(_0x4b3ce5[_0xf76f('0x51')],null))[_0xf76f('0x1a')](respondWithResult(_0x5b13b8,null))[_0xf76f('0x23')](handleError(_0x5b13b8,null));};exports[_0xf76f('0x56')]=function(_0x37dc61,_0x3898df,_0x434585){if(_0x37dc61['file']&&_0x37dc61[_0xf76f('0x53')][_0xf76f('0x55')]){_0x37dc61[_0xf76f('0x51')][_0xf76f('0x57')]=_0x37dc61[_0xf76f('0x53')][_0xf76f('0x55')];}return db[_0xf76f('0x35')][_0xf76f('0x4f')]({'where':{'id':_0x37dc61[_0xf76f('0x4b')]['id']}})[_0xf76f('0x1a')](handleEntityNotFound(_0x3898df,null))[_0xf76f('0x1a')](saveUpdates(_0x37dc61[_0xf76f('0x51')],null))[_0xf76f('0x1a')](respondWithResult(_0x3898df,null))['catch'](handleError(_0x3898df,null));};var utilLicense=require('../../config/license/util');exports[_0xf76f('0x58')]=function(_0x5c6dc0,_0x3f9668,_0x17375e){var _0x3d6cf9=_0xf76f('0x59');var _0x38d642={'custom':![]};return utilLicense[_0xf76f('0x5a')]()[_0xf76f('0x1a')](function(_0x531577){if(_0x531577){_0x38d642=_0x531577;}return db[_0xf76f('0x35')]['find']({'where':{'id':_0x5c6dc0[_0xf76f('0x4b')]['id']},'attributes':[_0xf76f('0x54'),_0xf76f('0x57'),'preferred',_0xf76f('0x5b'),'defaultLogo','defaultLoginLogo',_0xf76f('0x5c'),_0xf76f('0x5d')],'raw':!![]});})[_0xf76f('0x1a')](handleEntityNotFound(_0x3f9668,null))['then'](function(_0xdd61d1){if(_0xdd61d1){var _0x175590=_0xdd61d1[_0xf76f('0x54')]&&fs[_0xf76f('0x5e')](path[_0xf76f('0x5f')](config[_0xf76f('0x60')],_0x3d6cf9,_[_0xf76f('0x61')](_0xdd61d1[_0xf76f('0x54')])))?path['join'](config['root'],_0x3d6cf9,_[_0xf76f('0x61')](_0xdd61d1['logo'])):path['join'](config[_0xf76f('0x60')],_0x3d6cf9,_[_0xf76f('0x61')](_0xf76f('0x62')));var _0x16b79e=_0xf76f('0x63')+_[_0xf76f('0x64')](_0xf76f('0x54'));if(_0xdd61d1[_0x16b79e]||!_0x38d642[_0xf76f('0x65')]){_0x175590=path[_0xf76f('0x5f')](config['root'],_0x3d6cf9,_[_0xf76f('0x61')]('default_logo.svg'));}if(!fs[_0xf76f('0x5e')](_0x175590)){throw new db[(_0xf76f('0x66'))]['ValidationError'](_[_0xf76f('0x64')]('logo')+_0xf76f('0x67'));}return _0x3f9668[_0xf76f('0x68')](_0x175590);}})[_0xf76f('0x23')](handleError(_0x3f9668,null));};var utilLicense=require('../../config/license/util');exports[_0xf76f('0x69')]=function(_0x16d449,_0x3569b7,_0x5972ba){var _0x43f501=_0xf76f('0x59');var _0x33198e={'custom':![]};return utilLicense[_0xf76f('0x5a')]()[_0xf76f('0x1a')](function(_0x5b88ec){if(_0x5b88ec){_0x33198e=_0x5b88ec;}return db[_0xf76f('0x35')][_0xf76f('0x4f')]({'where':{'id':_0x16d449[_0xf76f('0x4b')]['id']},'attributes':[_0xf76f('0x54'),_0xf76f('0x57'),_0xf76f('0x6a'),_0xf76f('0x5b'),_0xf76f('0x6b'),_0xf76f('0x6c'),_0xf76f('0x5c'),_0xf76f('0x5d')],'raw':!![]});})['then'](handleEntityNotFound(_0x3569b7,null))[_0xf76f('0x1a')](function(_0x13f0d6){if(_0x13f0d6){var _0x1f8fc8=_0x13f0d6[_0xf76f('0x57')]&&fs[_0xf76f('0x5e')](path[_0xf76f('0x5f')](config[_0xf76f('0x60')],_0x43f501,_['toLower'](_0x13f0d6['loginLogo'])))?path[_0xf76f('0x5f')](config[_0xf76f('0x60')],_0x43f501,_[_0xf76f('0x61')](_0x13f0d6['loginLogo'])):path['join'](config['root'],_0x43f501,_[_0xf76f('0x61')](_0xf76f('0x6d')));var _0x22bc4b=_0xf76f('0x63')+_['upperFirst'](_0xf76f('0x57'));if(_0x13f0d6[_0x22bc4b]||!_0x33198e[_0xf76f('0x65')]){_0x1f8fc8=path[_0xf76f('0x5f')](config[_0xf76f('0x60')],_0x43f501,_['toLower']('default_loginLogo.svg'));}if(!fs['existsSync'](_0x1f8fc8)){throw new db['Sequelize'][(_0xf76f('0x6e'))](_[_0xf76f('0x64')](_0xf76f('0x57'))+'\x20not\x20found');}return _0x3569b7[_0xf76f('0x68')](_0x1f8fc8);}})[_0xf76f('0x23')](handleError(_0x3569b7,null));};exports[_0xf76f('0x6f')]=function(_0x2c8587,_0x40c1dc){return db['Setting'][_0xf76f('0x4f')]({'where':{'id':_0x2c8587['params']['id']},'attributes':[_0xf76f('0x70')]})[_0xf76f('0x1a')](respondWithResult(_0x40c1dc,null))[_0xf76f('0x23')](handleError(_0x40c1dc,null));};exports[_0xf76f('0x71')]=function(_0x29cbb7,_0x139264,_0x1774ab){if(_0x29cbb7[_0xf76f('0x53')]&&_0x29cbb7[_0xf76f('0x53')][_0xf76f('0x55')]){_0x29cbb7[_0xf76f('0x51')][_0xf76f('0x6a')]=_0x29cbb7[_0xf76f('0x53')][_0xf76f('0x55')];}return db[_0xf76f('0x35')][_0xf76f('0x4f')]({'where':{'id':_0x29cbb7[_0xf76f('0x4b')]['id']}})[_0xf76f('0x1a')](handleEntityNotFound(_0x139264,null))['then'](saveUpdates(_0x29cbb7[_0xf76f('0x51')],null))[_0xf76f('0x1a')](respondWithResult(_0x139264,null))[_0xf76f('0x23')](handleError(_0x139264,null));};var utilLicense=require(_0xf76f('0x14'));exports['getPreferred']=function(_0x3eadee,_0x4f9708,_0x4739ff){var _0x34ffa1=_0xf76f('0x59');var _0x1a152={'custom':![]};return utilLicense[_0xf76f('0x5a')]()[_0xf76f('0x1a')](function(_0x467960){if(_0x467960){_0x1a152=_0x467960;}return db[_0xf76f('0x35')][_0xf76f('0x4f')]({'where':{'id':_0x3eadee[_0xf76f('0x4b')]['id']},'attributes':[_0xf76f('0x54'),'loginLogo','preferred','favicon',_0xf76f('0x6b'),'defaultLoginLogo',_0xf76f('0x5c'),_0xf76f('0x5d')],'raw':!![]});})['then'](handleEntityNotFound(_0x4f9708,null))['then'](function(_0x52b481){if(_0x52b481){var _0x316595=_0x52b481[_0xf76f('0x6a')]&&fs['existsSync'](path[_0xf76f('0x5f')](config[_0xf76f('0x60')],_0x34ffa1,_['toLower'](_0x52b481[_0xf76f('0x6a')])))?path[_0xf76f('0x5f')](config['root'],_0x34ffa1,_[_0xf76f('0x61')](_0x52b481[_0xf76f('0x6a')])):path[_0xf76f('0x5f')](config[_0xf76f('0x60')],_0x34ffa1,_['toLower'](_0xf76f('0x72')));var _0x5d053d='default'+_[_0xf76f('0x64')](_0xf76f('0x6a'));if(_0x52b481[_0x5d053d]||!_0x1a152['custom']||!_0x1a152[_0xf76f('0x6a')]){_0x316595=path[_0xf76f('0x5f')](config[_0xf76f('0x60')],_0x34ffa1,_[_0xf76f('0x61')](_0xf76f('0x72')));}if(!fs['existsSync'](_0x316595)){throw new db['Sequelize'][(_0xf76f('0x6e'))](_[_0xf76f('0x64')](_0xf76f('0x6a'))+_0xf76f('0x67'));}return _0x4f9708[_0xf76f('0x68')](_0x316595);}})[_0xf76f('0x23')](handleError(_0x4f9708,null));};exports['addFavicon']=function(_0x3da971,_0x56d979,_0xba9afd){if(_0x3da971['file']&&_0x3da971['file'][_0xf76f('0x55')]){_0x3da971[_0xf76f('0x51')][_0xf76f('0x5b')]=_0x3da971[_0xf76f('0x53')][_0xf76f('0x55')];}return db[_0xf76f('0x35')][_0xf76f('0x4f')]({'where':{'id':_0x3da971['params']['id']}})[_0xf76f('0x1a')](handleEntityNotFound(_0x56d979,null))['then'](saveUpdates(_0x3da971[_0xf76f('0x51')],null))[_0xf76f('0x1a')](respondWithResult(_0x56d979,null))[_0xf76f('0x23')](handleError(_0x56d979,null));};var utilLicense=require('../../config/license/util');exports[_0xf76f('0x73')]=function(_0xffafbe,_0x26bce8,_0x35e5e2){var _0x3ce65c=_0xf76f('0x59');var _0xaa9ff0={'custom':![]};return utilLicense[_0xf76f('0x5a')]()[_0xf76f('0x1a')](function(_0x22adf6){if(_0x22adf6){_0xaa9ff0=_0x22adf6;}return db[_0xf76f('0x35')][_0xf76f('0x4f')]({'where':{'id':_0xffafbe['params']['id']},'attributes':[_0xf76f('0x54'),_0xf76f('0x57'),_0xf76f('0x6a'),'favicon','defaultLogo',_0xf76f('0x6c'),_0xf76f('0x5c'),_0xf76f('0x5d')],'raw':!![]});})['then'](handleEntityNotFound(_0x26bce8,null))[_0xf76f('0x1a')](function(_0x306eb6){if(_0x306eb6){var _0x5321c6=_0x306eb6[_0xf76f('0x5b')]&&fs[_0xf76f('0x5e')](path[_0xf76f('0x5f')](config[_0xf76f('0x60')],_0x3ce65c,_[_0xf76f('0x61')](_0x306eb6[_0xf76f('0x5b')])))?path[_0xf76f('0x5f')](config[_0xf76f('0x60')],_0x3ce65c,_[_0xf76f('0x61')](_0x306eb6[_0xf76f('0x5b')])):path['join'](config[_0xf76f('0x60')],_0x3ce65c,_[_0xf76f('0x61')]('default_favicon.ico'));var _0x1570d4=_0xf76f('0x63')+_['upperFirst']('favicon');if(_0x306eb6[_0x1570d4]||!_0xaa9ff0[_0xf76f('0x65')]){_0x5321c6=path[_0xf76f('0x5f')](config[_0xf76f('0x60')],_0x3ce65c,_[_0xf76f('0x61')](_0xf76f('0x74')));}if(!fs[_0xf76f('0x5e')](_0x5321c6)){throw new db['Sequelize'][(_0xf76f('0x6e'))](_[_0xf76f('0x64')](_0xf76f('0x5b'))+'\x20not\x20found');}return _0x26bce8[_0xf76f('0x68')](_0x5321c6);}})[_0xf76f('0x23')](handleError(_0x26bce8,null));};exports[_0xf76f('0x75')]=function(_0x461245,_0x5c8dad){var _0x2fde99={'offset':moment()['utcOffset']()};_0x2fde99[_0xf76f('0x76')]=moment()[_0xf76f('0x77')](_0x2fde99[_0xf76f('0x29')])[_0xf76f('0x78')](_0xf76f('0x79'));return _0x5c8dad[_0xf76f('0x25')](0xc8)[_0xf76f('0x33')](_0x2fde99);};
\ No newline at end of file
+var _0xe20e=['getLogo','getLicense','logo','loginLogo','preferred','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','join','toLower','root','default_logo.svg','Sequelize','ValidationError','upperFirst','\x20not\x20found','download','getLogoLogin','server/files/images/logos','default_loginLogo.svg','custom','securePassword','addPreferred','default_preferred.png','default','addFavicon','default_favicon.ico','getDate','utcOffset','send','eml-format','rimraf','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','info','Setting,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','result','sendStatus','status','limit','undefined','count','offset','set','Content-Range','json','apply','save','update','then','destroy','end','stack','name','index','map','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','Setting','includeAll','findAll','rows','catch','show','params','keys','rawAttributes','length','include','find','body','addLogo','file','filename','addLogoLogin'];(function(_0x450ed3,_0x30596a){var _0x31a133=function(_0x4e0e8f){while(--_0x4e0e8f){_0x450ed3['push'](_0x450ed3['shift']());}};_0x31a133(++_0x30596a);}(_0xe20e,0x195));var _0xee20=function(_0x198add,_0x239d3c){_0x198add=_0x198add-0x0;var _0x35bfaa=_0xe20e[_0x198add];return _0x35bfaa;};'use strict';var emlformat=require(_0xee20('0x0'));var rimraf=require(_0xee20('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xee20('0x2'));var rp=require(_0xee20('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xee20('0x4'));var util=require('util');var path=require(_0xee20('0x5'));var sox=require(_0xee20('0x6'));var csv=require(_0xee20('0x7'));var ejs=require(_0xee20('0x8'));var fs=require('fs');var fs_extra=require(_0xee20('0x9'));var _=require(_0xee20('0xa'));var squel=require(_0xee20('0xb'));var crypto=require(_0xee20('0xc'));var jsforce=require(_0xee20('0xd'));var deskjs=require(_0xee20('0xe'));var toCsv=require(_0xee20('0x7'));var querystring=require(_0xee20('0xf'));var Papa=require('papaparse');var Redis=require(_0xee20('0x10'));var authService=require(_0xee20('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xee20('0x12'));var logger=require(_0xee20('0x13'))(_0xee20('0x14'));var utils=require(_0xee20('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xee20('0x16'));var db=require(_0xee20('0x17'))['db'];var jayson=require(_0xee20('0x18'));var client=jayson[_0xee20('0x19')][_0xee20('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x3d61e8,_0x190e86,_0x5eb7b7,_0x3da816){return new BPromise(function(_0x4e1e75,_0x3f6df3){var _0x18e765=_0x3da816||client;return _0x18e765[_0xee20('0x1b')](_0x3d61e8,_0x5eb7b7)['then'](function(_0x6a910e){logger[_0xee20('0x1c')](_0xee20('0x1d'),_0x190e86,_0xee20('0x1e'));logger[_0xee20('0x1f')]('Setting,\x20%s,\x20%s,\x20%s',_0x190e86,_0xee20('0x1e'),JSON[_0xee20('0x20')](_0x6a910e));if(_0x6a910e['error']){if(_0x6a910e['error'][_0xee20('0x21')]===0x1f4){logger['error'](_0xee20('0x1d'),_0x190e86,_0x6a910e[_0xee20('0x22')][_0xee20('0x23')]);return _0x3f6df3(_0x6a910e[_0xee20('0x22')][_0xee20('0x23')]);}logger['error']('Setting,\x20%s,\x20%s',_0x190e86,_0x6a910e[_0xee20('0x22')][_0xee20('0x23')]);return _0x4e1e75(_0x6a910e[_0xee20('0x22')]['message']);}else{logger[_0xee20('0x1c')](_0xee20('0x1d'),_0x190e86,_0xee20('0x1e'));_0x4e1e75(_0x6a910e[_0xee20('0x24')][_0xee20('0x23')]);}})['catch'](function(_0x337826){logger['error'](_0xee20('0x1d'),_0x190e86,_0x337826);_0x3f6df3(_0x337826);});});}function respondWithStatusCode(_0x4b4134,_0x53a158){_0x53a158=_0x53a158||0xcc;return function(_0xc9af6c){if(_0xc9af6c){return _0x4b4134[_0xee20('0x25')](_0x53a158);}return _0x4b4134[_0xee20('0x26')](_0x53a158)['end']();};}function respondWithResult(_0x47b507,_0x5d0db3){_0x5d0db3=_0x5d0db3||0xc8;return function(_0x1030de){if(_0x1030de){return _0x47b507[_0xee20('0x26')](_0x5d0db3)['json'](_0x1030de);}};}function respondWithFilteredResult(_0x989704,_0x256250){return function(_0xc0e06b){if(_0xc0e06b){var _0x789af8=typeof _0x256250['offset']==='undefined'&&typeof _0x256250[_0xee20('0x27')]===_0xee20('0x28');var _0x378f40=_0xc0e06b[_0xee20('0x29')];var _0x1c3ccf=_0x789af8?0x0:_0x256250[_0xee20('0x2a')];var _0x5c2079=_0x789af8?_0xc0e06b[_0xee20('0x29')]:_0x256250[_0xee20('0x2a')]+_0x256250[_0xee20('0x27')];var _0x5d994a;if(_0x5c2079>=_0x378f40){_0x5c2079=_0x378f40;_0x5d994a=0xc8;}else{_0x5d994a=0xce;}_0x989704[_0xee20('0x26')](_0x5d994a);return _0x989704[_0xee20('0x2b')](_0xee20('0x2c'),_0x1c3ccf+'-'+_0x5c2079+'/'+_0x378f40)[_0xee20('0x2d')](_0xc0e06b);}return null;};}function patchUpdates(_0x458cd9){return function(_0x18cb44){try{jsonpatch[_0xee20('0x2e')](_0x18cb44,_0x458cd9,!![]);}catch(_0x47ac08){return BPromise['reject'](_0x47ac08);}return _0x18cb44[_0xee20('0x2f')]();};}function saveUpdates(_0x151425,_0x5c0078){return function(_0x31cf1a){if(_0x31cf1a){return _0x31cf1a[_0xee20('0x30')](_0x151425)[_0xee20('0x31')](function(_0x3f01d2){return _0x3f01d2;});}return null;};}function removeEntity(_0xd41556,_0x516633){return function(_0x5e49d6){if(_0x5e49d6){return _0x5e49d6[_0xee20('0x32')]()['then'](function(){_0xd41556[_0xee20('0x26')](0xcc)[_0xee20('0x33')]();});}};}function handleEntityNotFound(_0x1f0b8b,_0x1ec302){return function(_0x358e39){if(!_0x358e39){_0x1f0b8b[_0xee20('0x25')](0x194);}return _0x358e39;};}function handleError(_0xe9f98,_0x3bd190){_0x3bd190=_0x3bd190||0x1f4;return function(_0x33a779){logger['error'](_0x33a779[_0xee20('0x34')]);if(_0x33a779[_0xee20('0x35')]){delete _0x33a779[_0xee20('0x35')];}_0xe9f98[_0xee20('0x26')](_0x3bd190)['send'](_0x33a779);};}exports[_0xee20('0x36')]=function(_0x2b52b1,_0x657da7){var _0x4fc165={},_0x348c4f={},_0x806f13={'count':0x0,'rows':[]};var _0x3a212c=_[_0xee20('0x37')](db['Setting']['rawAttributes'],function(_0x3c4628){return{'name':_0x3c4628['fieldName'],'type':_0x3c4628[_0xee20('0x38')][_0xee20('0x39')]};});_0x348c4f[_0xee20('0x3a')]=_[_0xee20('0x37')](_0x3a212c,_0xee20('0x35'));_0x348c4f[_0xee20('0x3b')]=_['keys'](_0x2b52b1[_0xee20('0x3b')]);_0x348c4f[_0xee20('0x3c')]=_['intersection'](_0x348c4f[_0xee20('0x3a')],_0x348c4f[_0xee20('0x3b')]);_0x4fc165['attributes']=_[_0xee20('0x3d')](_0x348c4f[_0xee20('0x3a')],qs[_0xee20('0x3e')](_0x2b52b1['query']['fields']));_0x4fc165['attributes']=_0x4fc165[_0xee20('0x3f')]['length']?_0x4fc165[_0xee20('0x3f')]:_0x348c4f[_0xee20('0x3a')];if(!_0x2b52b1[_0xee20('0x3b')][_0xee20('0x40')](_0xee20('0x41'))){_0x4fc165[_0xee20('0x27')]=qs[_0xee20('0x27')](_0x2b52b1[_0xee20('0x3b')]['limit']);_0x4fc165['offset']=qs[_0xee20('0x2a')](_0x2b52b1[_0xee20('0x3b')][_0xee20('0x2a')]);}_0x4fc165[_0xee20('0x42')]=qs[_0xee20('0x43')](_0x2b52b1['query'][_0xee20('0x43')]);_0x4fc165[_0xee20('0x44')]=qs['filters'](_[_0xee20('0x45')](_0x2b52b1[_0xee20('0x3b')],_0x348c4f[_0xee20('0x3c')]),_0x3a212c);if(_0x2b52b1[_0xee20('0x3b')][_0xee20('0x46')]){_0x4fc165[_0xee20('0x44')]=_[_0xee20('0x47')](_0x4fc165[_0xee20('0x44')],{'$or':_[_0xee20('0x37')](_0x3a212c,function(_0x546de4){if(_0x546de4[_0xee20('0x38')]!==_0xee20('0x48')){var _0x9f556f={};_0x9f556f[_0x546de4['name']]={'$like':'%'+_0x2b52b1[_0xee20('0x3b')][_0xee20('0x46')]+'%'};return _0x9f556f;}})});}_0x4fc165=_[_0xee20('0x47')]({},_0x4fc165,_0x2b52b1[_0xee20('0x49')]);var _0x494b9b={'where':_0x4fc165['where']};return db[_0xee20('0x4a')][_0xee20('0x29')](_0x494b9b)['then'](function(_0x4e20c8){_0x806f13[_0xee20('0x29')]=_0x4e20c8;if(_0x2b52b1['query'][_0xee20('0x4b')]){_0x4fc165['include']=[{'all':!![]}];}return db['Setting'][_0xee20('0x4c')](_0x4fc165);})[_0xee20('0x31')](function(_0x597d10){_0x806f13[_0xee20('0x4d')]=_0x597d10;return _0x806f13;})[_0xee20('0x31')](respondWithFilteredResult(_0x657da7,_0x4fc165))[_0xee20('0x4e')](handleError(_0x657da7,null));};exports[_0xee20('0x4f')]=function(_0x3cac09,_0x10a5c4){var _0x4842aa={'raw':![],'where':{'id':_0x3cac09[_0xee20('0x50')]['id']}},_0x177240={};_0x177240['model']=_[_0xee20('0x51')](db[_0xee20('0x4a')][_0xee20('0x52')]);_0x177240[_0xee20('0x3b')]=_['keys'](_0x3cac09['query']);_0x177240[_0xee20('0x3c')]=_[_0xee20('0x3d')](_0x177240[_0xee20('0x3a')],_0x177240[_0xee20('0x3b')]);_0x4842aa[_0xee20('0x3f')]=_[_0xee20('0x3d')](_0x177240[_0xee20('0x3a')],qs[_0xee20('0x3e')](_0x3cac09[_0xee20('0x3b')][_0xee20('0x3e')]));_0x4842aa[_0xee20('0x3f')]=_0x4842aa[_0xee20('0x3f')][_0xee20('0x53')]?_0x4842aa[_0xee20('0x3f')]:_0x177240['model'];if(_0x3cac09[_0xee20('0x3b')][_0xee20('0x4b')]){_0x4842aa[_0xee20('0x54')]=[{'all':!![]}];}_0x4842aa=_[_0xee20('0x47')]({},_0x4842aa,_0x3cac09[_0xee20('0x49')]);return db['Setting'][_0xee20('0x55')](_0x4842aa)[_0xee20('0x31')](handleEntityNotFound(_0x10a5c4,null))[_0xee20('0x31')](respondWithResult(_0x10a5c4,null))[_0xee20('0x4e')](handleError(_0x10a5c4,null));};exports[_0xee20('0x30')]=function(_0x2fde89,_0x2e3ccc){if(_0x2fde89[_0xee20('0x56')]['id']){delete _0x2fde89['body']['id'];}return db[_0xee20('0x4a')][_0xee20('0x55')]({'where':{'id':_0x2fde89[_0xee20('0x50')]['id']}})[_0xee20('0x31')](handleEntityNotFound(_0x2e3ccc,null))[_0xee20('0x31')](saveUpdates(_0x2fde89[_0xee20('0x56')],null))['then'](respondWithResult(_0x2e3ccc,null))['catch'](handleError(_0x2e3ccc,null));};exports[_0xee20('0x57')]=function(_0x318a1d,_0x5c6288,_0x4c0501){if(_0x318a1d[_0xee20('0x58')]&&_0x318a1d['file'][_0xee20('0x59')]){_0x318a1d['body']['logo']=_0x318a1d[_0xee20('0x58')][_0xee20('0x59')];}return db[_0xee20('0x4a')]['find']({'where':{'id':_0x318a1d[_0xee20('0x50')]['id']}})[_0xee20('0x31')](handleEntityNotFound(_0x5c6288,null))['then'](saveUpdates(_0x318a1d[_0xee20('0x56')],null))[_0xee20('0x31')](respondWithResult(_0x5c6288,null))['catch'](handleError(_0x5c6288,null));};exports[_0xee20('0x5a')]=function(_0x34c846,_0x2f2012,_0x2884b8){if(_0x34c846['file']&&_0x34c846[_0xee20('0x58')][_0xee20('0x59')]){_0x34c846[_0xee20('0x56')]['loginLogo']=_0x34c846[_0xee20('0x58')][_0xee20('0x59')];}return db[_0xee20('0x4a')]['find']({'where':{'id':_0x34c846[_0xee20('0x50')]['id']}})[_0xee20('0x31')](handleEntityNotFound(_0x2f2012,null))[_0xee20('0x31')](saveUpdates(_0x34c846['body'],null))[_0xee20('0x31')](respondWithResult(_0x2f2012,null))['catch'](handleError(_0x2f2012,null));};var utilLicense=require(_0xee20('0x16'));exports[_0xee20('0x5b')]=function(_0x4ad4cf,_0x232002,_0x362084){var _0x39aa5e='server/files/images/logos';var _0x5a3759={'custom':![]};return utilLicense[_0xee20('0x5c')]()[_0xee20('0x31')](function(_0x42e8f5){if(_0x42e8f5){_0x5a3759=_0x42e8f5;}return db[_0xee20('0x4a')][_0xee20('0x55')]({'where':{'id':_0x4ad4cf['params']['id']},'attributes':[_0xee20('0x5d'),_0xee20('0x5e'),_0xee20('0x5f'),_0xee20('0x60'),_0xee20('0x61'),_0xee20('0x62'),_0xee20('0x63'),_0xee20('0x64')],'raw':!![]});})['then'](handleEntityNotFound(_0x232002,null))[_0xee20('0x31')](function(_0x38f94a){if(_0x38f94a){var _0x34c3e1=_0x38f94a['logo']&&fs[_0xee20('0x65')](path[_0xee20('0x66')](config['root'],_0x39aa5e,_[_0xee20('0x67')](_0x38f94a[_0xee20('0x5d')])))?path[_0xee20('0x66')](config[_0xee20('0x68')],_0x39aa5e,_[_0xee20('0x67')](_0x38f94a[_0xee20('0x5d')])):path[_0xee20('0x66')](config['root'],_0x39aa5e,_[_0xee20('0x67')]('default_logo.svg'));var _0x5bac94='default'+_['upperFirst'](_0xee20('0x5d'));if(_0x38f94a[_0x5bac94]||!_0x5a3759['custom']){_0x34c3e1=path[_0xee20('0x66')](config[_0xee20('0x68')],_0x39aa5e,_[_0xee20('0x67')](_0xee20('0x69')));}if(!fs['existsSync'](_0x34c3e1)){throw new db[(_0xee20('0x6a'))][(_0xee20('0x6b'))](_[_0xee20('0x6c')](_0xee20('0x5d'))+_0xee20('0x6d'));}return _0x232002[_0xee20('0x6e')](_0x34c3e1);}})[_0xee20('0x4e')](handleError(_0x232002,null));};var utilLicense=require(_0xee20('0x16'));exports[_0xee20('0x6f')]=function(_0x44c842,_0x250908,_0x58d1d2){var _0x418ba4=_0xee20('0x70');var _0x3881dc={'custom':![]};return utilLicense[_0xee20('0x5c')]()[_0xee20('0x31')](function(_0x22b507){if(_0x22b507){_0x3881dc=_0x22b507;}return db[_0xee20('0x4a')][_0xee20('0x55')]({'where':{'id':_0x44c842[_0xee20('0x50')]['id']},'attributes':[_0xee20('0x5d'),'loginLogo','preferred','favicon',_0xee20('0x61'),_0xee20('0x62'),_0xee20('0x63'),_0xee20('0x64')],'raw':!![]});})[_0xee20('0x31')](handleEntityNotFound(_0x250908,null))[_0xee20('0x31')](function(_0x15b51a){if(_0x15b51a){var _0x4b1d45=_0x15b51a[_0xee20('0x5e')]&&fs[_0xee20('0x65')](path['join'](config['root'],_0x418ba4,_['toLower'](_0x15b51a[_0xee20('0x5e')])))?path[_0xee20('0x66')](config[_0xee20('0x68')],_0x418ba4,_['toLower'](_0x15b51a['loginLogo'])):path['join'](config[_0xee20('0x68')],_0x418ba4,_[_0xee20('0x67')](_0xee20('0x71')));var _0x5b67db='default'+_[_0xee20('0x6c')]('loginLogo');if(_0x15b51a[_0x5b67db]||!_0x3881dc[_0xee20('0x72')]){_0x4b1d45=path['join'](config[_0xee20('0x68')],_0x418ba4,_[_0xee20('0x67')](_0xee20('0x71')));}if(!fs['existsSync'](_0x4b1d45)){throw new db[(_0xee20('0x6a'))][(_0xee20('0x6b'))](_[_0xee20('0x6c')](_0xee20('0x5e'))+'\x20not\x20found');}return _0x250908[_0xee20('0x6e')](_0x4b1d45);}})[_0xee20('0x4e')](handleError(_0x250908,null));};exports['gdpr']=function(_0x5c74d7,_0x28e804){return db[_0xee20('0x4a')]['find']({'where':{'id':_0x5c74d7['params']['id']},'attributes':[_0xee20('0x73')]})[_0xee20('0x31')](respondWithResult(_0x28e804,null))[_0xee20('0x4e')](handleError(_0x28e804,null));};exports[_0xee20('0x74')]=function(_0x16ac4b,_0x2b61c6,_0x50142a){if(_0x16ac4b[_0xee20('0x58')]&&_0x16ac4b[_0xee20('0x58')]['filename']){_0x16ac4b[_0xee20('0x56')][_0xee20('0x5f')]=_0x16ac4b[_0xee20('0x58')][_0xee20('0x59')];}return db[_0xee20('0x4a')][_0xee20('0x55')]({'where':{'id':_0x16ac4b[_0xee20('0x50')]['id']}})[_0xee20('0x31')](handleEntityNotFound(_0x2b61c6,null))[_0xee20('0x31')](saveUpdates(_0x16ac4b['body'],null))[_0xee20('0x31')](respondWithResult(_0x2b61c6,null))[_0xee20('0x4e')](handleError(_0x2b61c6,null));};var utilLicense=require(_0xee20('0x16'));exports['getPreferred']=function(_0x2d8866,_0x176382,_0x25ad10){var _0x63ea68=_0xee20('0x70');var _0x4ecaa4={'custom':![]};return utilLicense[_0xee20('0x5c')]()['then'](function(_0x5257b5){if(_0x5257b5){_0x4ecaa4=_0x5257b5;}return db[_0xee20('0x4a')][_0xee20('0x55')]({'where':{'id':_0x2d8866[_0xee20('0x50')]['id']},'attributes':[_0xee20('0x5d'),_0xee20('0x5e'),_0xee20('0x5f'),_0xee20('0x60'),_0xee20('0x61'),_0xee20('0x62'),'defaultPreferred','defaultFavicon'],'raw':!![]});})['then'](handleEntityNotFound(_0x176382,null))[_0xee20('0x31')](function(_0x235edd){if(_0x235edd){var _0x5d6302=_0x235edd[_0xee20('0x5f')]&&fs['existsSync'](path[_0xee20('0x66')](config[_0xee20('0x68')],_0x63ea68,_[_0xee20('0x67')](_0x235edd[_0xee20('0x5f')])))?path[_0xee20('0x66')](config[_0xee20('0x68')],_0x63ea68,_[_0xee20('0x67')](_0x235edd[_0xee20('0x5f')])):path[_0xee20('0x66')](config[_0xee20('0x68')],_0x63ea68,_[_0xee20('0x67')](_0xee20('0x75')));var _0x5e54ba=_0xee20('0x76')+_[_0xee20('0x6c')](_0xee20('0x5f'));if(_0x235edd[_0x5e54ba]||!_0x4ecaa4[_0xee20('0x72')]||!_0x4ecaa4[_0xee20('0x5f')]){_0x5d6302=path[_0xee20('0x66')](config['root'],_0x63ea68,_['toLower'](_0xee20('0x75')));}if(!fs[_0xee20('0x65')](_0x5d6302)){throw new db[(_0xee20('0x6a'))]['ValidationError'](_[_0xee20('0x6c')](_0xee20('0x5f'))+_0xee20('0x6d'));}return _0x176382[_0xee20('0x6e')](_0x5d6302);}})[_0xee20('0x4e')](handleError(_0x176382,null));};exports[_0xee20('0x77')]=function(_0xf14001,_0x30dc05,_0x1190c0){if(_0xf14001[_0xee20('0x58')]&&_0xf14001[_0xee20('0x58')][_0xee20('0x59')]){_0xf14001[_0xee20('0x56')][_0xee20('0x60')]=_0xf14001[_0xee20('0x58')]['filename'];}return db[_0xee20('0x4a')][_0xee20('0x55')]({'where':{'id':_0xf14001['params']['id']}})[_0xee20('0x31')](handleEntityNotFound(_0x30dc05,null))[_0xee20('0x31')](saveUpdates(_0xf14001['body'],null))['then'](respondWithResult(_0x30dc05,null))[_0xee20('0x4e')](handleError(_0x30dc05,null));};var utilLicense=require(_0xee20('0x16'));exports['getFavicon']=function(_0x200477,_0x21bf71,_0x414c39){var _0x1dadc7=_0xee20('0x70');var _0x53cff0={'custom':![]};return utilLicense[_0xee20('0x5c')]()[_0xee20('0x31')](function(_0x4e4cee){if(_0x4e4cee){_0x53cff0=_0x4e4cee;}return db[_0xee20('0x4a')]['find']({'where':{'id':_0x200477[_0xee20('0x50')]['id']},'attributes':[_0xee20('0x5d'),_0xee20('0x5e'),_0xee20('0x5f'),_0xee20('0x60'),_0xee20('0x61'),_0xee20('0x62'),_0xee20('0x63'),_0xee20('0x64')],'raw':!![]});})[_0xee20('0x31')](handleEntityNotFound(_0x21bf71,null))[_0xee20('0x31')](function(_0x123804){if(_0x123804){var _0x3cd103=_0x123804[_0xee20('0x60')]&&fs[_0xee20('0x65')](path[_0xee20('0x66')](config[_0xee20('0x68')],_0x1dadc7,_[_0xee20('0x67')](_0x123804[_0xee20('0x60')])))?path[_0xee20('0x66')](config[_0xee20('0x68')],_0x1dadc7,_[_0xee20('0x67')](_0x123804[_0xee20('0x60')])):path[_0xee20('0x66')](config[_0xee20('0x68')],_0x1dadc7,_[_0xee20('0x67')](_0xee20('0x78')));var _0x2055da=_0xee20('0x76')+_[_0xee20('0x6c')](_0xee20('0x60'));if(_0x123804[_0x2055da]||!_0x53cff0[_0xee20('0x72')]){_0x3cd103=path[_0xee20('0x66')](config[_0xee20('0x68')],_0x1dadc7,_[_0xee20('0x67')](_0xee20('0x78')));}if(!fs[_0xee20('0x65')](_0x3cd103)){throw new db[(_0xee20('0x6a'))][(_0xee20('0x6b'))](_[_0xee20('0x6c')]('favicon')+_0xee20('0x6d'));}return _0x21bf71[_0xee20('0x6e')](_0x3cd103);}})['catch'](handleError(_0x21bf71,null));};exports[_0xee20('0x79')]=function(_0xb47286,_0x4c8b5c){var _0x29f341={'offset':moment()[_0xee20('0x7a')]()};_0x29f341['now']=moment()[_0xee20('0x7a')](_0x29f341['offset'])['format']('YYYY-MM-DD\x20HH:mm:ss:SSS');return _0x4c8b5c[_0xee20('0x26')](0xc8)[_0xee20('0x7b')](_0x29f341);};
\ No newline at end of file
index 72bd862..63b9bc7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['exports','define','Setting','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./setting.attributes'];(function(_0xda464c,_0x26e47d){var _0x19e222=function(_0x1ec605){while(--_0x1ec605){_0xda464c['push'](_0xda464c['shift']());}};_0x19e222(++_0x26e47d);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'settings','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x34e8=['settings','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./setting.attributes','exports','Setting'];(function(_0x414243,_0x44b27c){var _0x4710e0=function(_0x1d52a5){while(--_0x1d52a5){_0x414243['push'](_0x414243['shift']());}};_0x4710e0(++_0x44b27c);}(_0x34e8,0x12c));var _0x834e=function(_0x59e2b0,_0x1fc0f8){_0x59e2b0=_0x59e2b0-0x0;var _0x5df164=_0x34e8[_0x59e2b0];return _0x5df164;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var logger=require(_0x834e('0x2'))(_0x834e('0x3'));var moment=require('moment');var BPromise=require(_0x834e('0x4'));var rp=require(_0x834e('0x5'));var fs=require('fs');var path=require(_0x834e('0x6'));var rimraf=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var attributes=require(_0x834e('0x9'));module[_0x834e('0xa')]=function(_0x4a2018,_0x858aa1){return _0x4a2018['define'](_0x834e('0xb'),attributes,{'tableName':_0x834e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index dc3870c..fe1842a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe393=['request\x20sent','debug','stringify','error','message','result','ShowSetting','find','options','raw','attributes','map','include','model','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','Setting,\x20%s,\x20%s'];(function(_0x2de631,_0x50076f){var _0x31d217=function(_0x49c5f2){while(--_0x49c5f2){_0x2de631['push'](_0x2de631['shift']());}};_0x31d217(++_0x50076f);}(_0xe393,0x145));var _0x3e39=function(_0x2d034d,_0x532a40){_0x2d034d=_0x2d034d-0x0;var _0x286474=_0xe393[_0x2d034d];return _0x286474;};'use strict';var _=require(_0x3e39('0x0'));var util=require(_0x3e39('0x1'));var moment=require(_0x3e39('0x2'));var BPromise=require(_0x3e39('0x3'));var rs=require(_0x3e39('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3e39('0x5'))['db'];var utils=require(_0x3e39('0x6'));var logger=require(_0x3e39('0x7'))(_0x3e39('0x8'));var config=require('../../config/environment');var jayson=require(_0x3e39('0x9'));var client=jayson[_0x3e39('0xa')][_0x3e39('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x863149,_0x12e5ec,_0x26290d){return new BPromise(function(_0x585504,_0x169d65){return client[_0x3e39('0xc')](_0x863149,_0x26290d)[_0x3e39('0xd')](function(_0x503e2f){logger[_0x3e39('0xe')](_0x3e39('0xf'),_0x12e5ec,_0x3e39('0x10'));logger[_0x3e39('0x11')]('Setting,\x20%s,\x20%s,\x20%s',_0x12e5ec,_0x3e39('0x10'),JSON[_0x3e39('0x12')](_0x503e2f));if(_0x503e2f[_0x3e39('0x13')]){if(_0x503e2f[_0x3e39('0x13')]['code']===0x1f4){logger['error']('Setting,\x20%s,\x20%s',_0x12e5ec,_0x503e2f['error'][_0x3e39('0x14')]);return _0x169d65(_0x503e2f[_0x3e39('0x13')]['message']);}logger['error'](_0x3e39('0xf'),_0x12e5ec,_0x503e2f[_0x3e39('0x13')][_0x3e39('0x14')]);return _0x585504(_0x503e2f[_0x3e39('0x13')][_0x3e39('0x14')]);}else{logger[_0x3e39('0xe')]('Setting,\x20%s,\x20%s',_0x12e5ec,_0x3e39('0x10'));_0x585504(_0x503e2f[_0x3e39('0x15')]['message']);}})['catch'](function(_0x371d0b){logger[_0x3e39('0x13')](_0x3e39('0xf'),_0x12e5ec,_0x371d0b);_0x169d65(_0x371d0b);});});}exports[_0x3e39('0x16')]=function(_0x14792a){var _0x307ba5=this;return new Promise(function(_0x51cc7e,_0x1dfbe9){return db['Setting'][_0x3e39('0x17')]({'raw':_0x14792a['options']?_0x14792a[_0x3e39('0x18')][_0x3e39('0x19')]===undefined?!![]:![]:!![],'where':_0x14792a[_0x3e39('0x18')]?_0x14792a[_0x3e39('0x18')]['where']||null:null,'attributes':_0x14792a[_0x3e39('0x18')]?_0x14792a[_0x3e39('0x18')][_0x3e39('0x1a')]||null:null,'include':_0x14792a[_0x3e39('0x18')]?_0x14792a[_0x3e39('0x18')]['include']?_[_0x3e39('0x1b')](_0x14792a[_0x3e39('0x18')][_0x3e39('0x1c')],function(_0x23a412){return{'model':db[_0x23a412[_0x3e39('0x1d')]],'as':_0x23a412['as'],'attributes':_0x23a412[_0x3e39('0x1a')],'include':_0x23a412['include']?_[_0x3e39('0x1b')](_0x23a412[_0x3e39('0x1c')],function(_0x1952f3){return{'model':db[_0x1952f3[_0x3e39('0x1d')]],'as':_0x1952f3['as'],'attributes':_0x1952f3[_0x3e39('0x1a')],'include':_0x1952f3[_0x3e39('0x1c')]?_['map'](_0x1952f3[_0x3e39('0x1c')],function(_0x2cc9b9){return{'model':db[_0x2cc9b9[_0x3e39('0x1d')]],'as':_0x2cc9b9['as'],'attributes':_0x2cc9b9['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x32ee36){logger[_0x3e39('0xe')](_0x3e39('0x16'),_0x14792a);logger[_0x3e39('0x11')](_0x3e39('0x16'),_0x14792a,JSON[_0x3e39('0x12')](_0x32ee36));_0x51cc7e(_0x32ee36);})[_0x3e39('0x1e')](function(_0x2491ef){logger['error'](_0x3e39('0x16'),_0x2491ef[_0x3e39('0x14')],_0x14792a);_0x1dfbe9(_0x307ba5[_0x3e39('0x13')](0x1f4,_0x2491ef[_0x3e39('0x14')]));});});};
\ No newline at end of file
+var _0xc45e=['rpc','../../config/environment','jayson/promise','client','http','request','info','debug','error','code','Setting,\x20%s,\x20%s','message','request\x20sent','result','catch','Setting','find','options','attributes','include','map','model','ShowSetting','util','moment','bluebird','../../config/utils','../../config/logger'];(function(_0x4aa517,_0x13ae45){var _0x70934=function(_0x442951){while(--_0x442951){_0x4aa517['push'](_0x4aa517['shift']());}};_0x70934(++_0x13ae45);}(_0xc45e,0x1d7));var _0xec45=function(_0x26defd,_0x1f54bd){_0x26defd=_0x26defd-0x0;var _0x42d085=_0xc45e[_0x26defd];return _0x42d085;};'use strict';var _=require('lodash');var util=require(_0xec45('0x0'));var moment=require(_0xec45('0x1'));var BPromise=require(_0xec45('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xec45('0x3'));var logger=require(_0xec45('0x4'))(_0xec45('0x5'));var config=require(_0xec45('0x6'));var jayson=require(_0xec45('0x7'));var client=jayson[_0xec45('0x8')][_0xec45('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x158e95,_0x52bb18,_0x2ca060){return new BPromise(function(_0x386ed9,_0x5313bc){return client[_0xec45('0xa')](_0x158e95,_0x2ca060)['then'](function(_0x2661da){logger[_0xec45('0xb')]('Setting,\x20%s,\x20%s',_0x52bb18,'request\x20sent');logger[_0xec45('0xc')]('Setting,\x20%s,\x20%s,\x20%s',_0x52bb18,'request\x20sent',JSON['stringify'](_0x2661da));if(_0x2661da[_0xec45('0xd')]){if(_0x2661da['error'][_0xec45('0xe')]===0x1f4){logger[_0xec45('0xd')](_0xec45('0xf'),_0x52bb18,_0x2661da[_0xec45('0xd')][_0xec45('0x10')]);return _0x5313bc(_0x2661da[_0xec45('0xd')][_0xec45('0x10')]);}logger['error']('Setting,\x20%s,\x20%s',_0x52bb18,_0x2661da['error'][_0xec45('0x10')]);return _0x386ed9(_0x2661da[_0xec45('0xd')]['message']);}else{logger[_0xec45('0xb')](_0xec45('0xf'),_0x52bb18,_0xec45('0x11'));_0x386ed9(_0x2661da[_0xec45('0x12')][_0xec45('0x10')]);}})[_0xec45('0x13')](function(_0x39f920){logger[_0xec45('0xd')](_0xec45('0xf'),_0x52bb18,_0x39f920);_0x5313bc(_0x39f920);});});}exports['ShowSetting']=function(_0x5d7dc4){var _0x3a64bb=this;return new Promise(function(_0x1b9fcc,_0x183173){return db[_0xec45('0x14')][_0xec45('0x15')]({'raw':_0x5d7dc4[_0xec45('0x16')]?_0x5d7dc4[_0xec45('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x5d7dc4['options']?_0x5d7dc4[_0xec45('0x16')]['where']||null:null,'attributes':_0x5d7dc4[_0xec45('0x16')]?_0x5d7dc4[_0xec45('0x16')][_0xec45('0x17')]||null:null,'include':_0x5d7dc4[_0xec45('0x16')]?_0x5d7dc4[_0xec45('0x16')][_0xec45('0x18')]?_[_0xec45('0x19')](_0x5d7dc4[_0xec45('0x16')][_0xec45('0x18')],function(_0x2dd9f8){return{'model':db[_0x2dd9f8['model']],'as':_0x2dd9f8['as'],'attributes':_0x2dd9f8[_0xec45('0x17')],'include':_0x2dd9f8[_0xec45('0x18')]?_[_0xec45('0x19')](_0x2dd9f8[_0xec45('0x18')],function(_0x518a50){return{'model':db[_0x518a50[_0xec45('0x1a')]],'as':_0x518a50['as'],'attributes':_0x518a50['attributes'],'include':_0x518a50[_0xec45('0x18')]?_[_0xec45('0x19')](_0x518a50['include'],function(_0x5361e1){return{'model':db[_0x5361e1['model']],'as':_0x5361e1['as'],'attributes':_0x5361e1['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1be4cc){logger[_0xec45('0xb')](_0xec45('0x1b'),_0x5d7dc4);logger[_0xec45('0xc')]('ShowSetting',_0x5d7dc4,JSON['stringify'](_0x1be4cc));_0x1b9fcc(_0x1be4cc);})[_0xec45('0x13')](function(_0x47a8a5){logger['error']('ShowSetting',_0x47a8a5[_0xec45('0x10')],_0x5d7dc4);_0x183173(_0x3a64bb[_0xec45('0xd')](0x1f4,_0x47a8a5['message']));});});};
\ No newline at end of file
index 656e52b..33d3c76 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8ef6=['addApplications','/:id/send','send','status','update','delete','destroy','removeAgents','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','/describe','isAuthenticated','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','/:id/status','statusGet','/:id/users','getAgents','create','post','addDisposition','addAnswer','notify'];(function(_0x3e597f,_0x1eabdc){var _0x5b0ca9=function(_0x1ba3f4){while(--_0x1ba3f4){_0x3e597f['push'](_0x3e597f['shift']());}};_0x5b0ca9(++_0x1eabdc);}(_0x8ef6,0xf2));var _0x68ef=function(_0x5f05e6,_0x15f1ef){_0x5f05e6=_0x5f05e6-0x0;var _0x24a03a=_0x8ef6[_0x5f05e6];return _0x24a03a;};'use strict';var multer=require(_0x68ef('0x0'));var util=require(_0x68ef('0x1'));var path=require(_0x68ef('0x2'));var timeout=require(_0x68ef('0x3'));var express=require(_0x68ef('0x4'));var router=express[_0x68ef('0x5')]();var fs_extra=require(_0x68ef('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x68ef('0x7'));var config=require(_0x68ef('0x8'));var controller=require(_0x68ef('0x9'));router[_0x68ef('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x68ef('0xa')](_0x68ef('0xb'),auth[_0x68ef('0xc')](),controller['describe']);router[_0x68ef('0xa')](_0x68ef('0xd'),auth[_0x68ef('0xc')](),controller[_0x68ef('0xe')]);router[_0x68ef('0xa')](_0x68ef('0xf'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x10')]);router[_0x68ef('0xa')](_0x68ef('0x11'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x12')]);router['get'](_0x68ef('0x13'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x14')]);router[_0x68ef('0xa')](_0x68ef('0x15'),auth[_0x68ef('0xc')](),controller['getInteractions']);router[_0x68ef('0xa')](_0x68ef('0x16'),controller[_0x68ef('0x17')]);router['get'](_0x68ef('0x18'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x19')]);router['post']('/',auth[_0x68ef('0xc')](),controller[_0x68ef('0x1a')]);router[_0x68ef('0x1b')](_0x68ef('0xf'),auth['isAuthenticated'](),controller[_0x68ef('0x1c')]);router['post']('/:id/canned_answers',auth[_0x68ef('0xc')](),controller[_0x68ef('0x1d')]);router['post']('/:id/notify',controller[_0x68ef('0x1e')]);router[_0x68ef('0x1b')](_0x68ef('0x13'),auth['isAuthenticated'](),controller[_0x68ef('0x1f')]);router[_0x68ef('0x1b')](_0x68ef('0x20'),auth['isAuthenticated'](),controller[_0x68ef('0x21')]);router[_0x68ef('0x1b')]('/:id/status',controller[_0x68ef('0x22')]);router[_0x68ef('0x1b')](_0x68ef('0x18'),auth['isAuthenticated'](),controller['addAgents']);router['put'](_0x68ef('0xd'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x23')]);router[_0x68ef('0x24')](_0x68ef('0xd'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x25')]);router[_0x68ef('0x24')](_0x68ef('0xf'),auth[_0x68ef('0xc')](),controller['removeDispositions']);router[_0x68ef('0x24')]('/:id/canned_answers',auth['isAuthenticated'](),controller['removeAnswers']);router[_0x68ef('0x24')](_0x68ef('0x18'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x26')]);module['exports']=router;
\ No newline at end of file
+var _0x9957=['getInteractions','statusGet','/:id/users','getAgents','post','create','addDisposition','/:id/canned_answers','addAnswer','addApplications','/:id/status','status','addAgents','/:id','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsAccount.controller','get','isAuthenticated','index','/describe','describe','show','/:id/dispositions','getDispositions','getAnswers','/:id/applications','getApplications','/:id/interactions'];(function(_0x34190e,_0x50ecc7){var _0x41a4e6=function(_0x4a9ad9){while(--_0x4a9ad9){_0x34190e['push'](_0x34190e['shift']());}};_0x41a4e6(++_0x50ecc7);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/canned_answers',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x9')](_0x7995('0x14'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router['get']('/:id/status',controller[_0x7995('0x16')]);router[_0x7995('0x9')](_0x7995('0x17'),auth[_0x7995('0xa')](),controller[_0x7995('0x18')]);router[_0x7995('0x19')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x1a')]);router['post'](_0x7995('0xf'),auth['isAuthenticated'](),controller[_0x7995('0x1b')]);router[_0x7995('0x19')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x1d')]);router[_0x7995('0x19')]('/:id/notify',controller['notify']);router[_0x7995('0x19')]('/:id/applications',auth['isAuthenticated'](),controller[_0x7995('0x1e')]);router[_0x7995('0x19')]('/:id/send',auth[_0x7995('0xa')](),controller['send']);router['post'](_0x7995('0x1f'),controller[_0x7995('0x20')]);router[_0x7995('0x19')](_0x7995('0x17'),auth[_0x7995('0xa')](),controller[_0x7995('0x21')]);router['put'](_0x7995('0x22'),auth[_0x7995('0xa')](),controller[_0x7995('0x23')]);router[_0x7995('0x24')](_0x7995('0x22'),auth[_0x7995('0xa')](),controller[_0x7995('0x25')]);router[_0x7995('0x24')]('/:id/dispositions',auth[_0x7995('0xa')](),controller[_0x7995('0x26')]);router[_0x7995('0x24')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x27')]);router['delete'](_0x7995('0x17'),auth['isAuthenticated'](),controller[_0x7995('0x28')]);module[_0x7995('0x29')]=router;
\ No newline at end of file
index 045b4d7..0cc9747 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1078=['exports','STRING','name','clicksend','plivo','bandwidth','infobip','intelepeer','ENUM','BOOLEAN','TEXT','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId'];(function(_0x593022,_0x5054a7){var _0x4f40a6=function(_0x282af0){while(--_0x282af0){_0x593022['push'](_0x593022['shift']());}};_0x4f40a6(++_0x5054a7);}(_0x1078,0x170));var _0x8107=function(_0x3ca054,_0x45cbc9){_0x3ca054=_0x3ca054-0x0;var _0xcbf963=_0x1078[_0x3ca054];return _0xcbf963;};'use strict';var Sequelize=require('sequelize');var rs=require('randomstring');module[_0x8107('0x0')]={'name':{'type':Sequelize[_0x8107('0x1')],'unique':_0x8107('0x2'),'allowNull':![]},'key':{'type':Sequelize[_0x8107('0x1')],'allowNull':![]},'remote':{'type':Sequelize[_0x8107('0x1')],'allowNull':![]},'token':{'type':Sequelize[_0x8107('0x1')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0x8107('0x1')]},'type':{'type':Sequelize['ENUM']('twilio','skebby','connectel',_0x8107('0x3'),_0x8107('0x4'),'clickatell',_0x8107('0x5'),'csc',_0x8107('0x6'),_0x8107('0x7'))},'accountSid':{'type':Sequelize[_0x8107('0x1')]},'authId':{'type':Sequelize[_0x8107('0x1')]},'authToken':{'type':Sequelize[_0x8107('0x1')]},'smsMethod':{'type':Sequelize[_0x8107('0x8')]('SI','TI','GP')},'username':{'type':Sequelize[_0x8107('0x1')]},'password':{'type':Sequelize['STRING']},'apiKey':{'type':Sequelize['STRING']},'applicationId':{'type':Sequelize[_0x8107('0x1')]},'accountId':{'type':Sequelize[_0x8107('0x1')]},'senderString':{'type':Sequelize[_0x8107('0x1')]},'deliveryReport':{'type':Sequelize[_0x8107('0x9')],'defaultValue':![]},'description':{'type':Sequelize[_0x8107('0x1')]},'notificationTemplate':{'type':Sequelize[_0x8107('0xa')],'defaultValue':function(){return _0x8107('0xb');}},'notificationSound':{'type':Sequelize[_0x8107('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x8107('0x9')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x8107('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x8107('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x8107('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x8107('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize['STRING']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x8107('0xc')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x8107('0x9')],'defaultValue':![],'comment':_0x8107('0xd'),'set':function(_0x32ce0d){if(!_0x32ce0d)this[_0x8107('0xe')](_0x8107('0xf'),null);this[_0x8107('0xe')]('mandatoryDisposition',_0x32ce0d);}}};
\ No newline at end of file
+var _0x03c5=['Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING','name','ENUM','skebby','connectel','clicksend','plivo','clickatell','bandwidth','csc','infobip','BOOLEAN','TEXT'];(function(_0x2be82a,_0x16f028){var _0x4dcfb3=function(_0x205d67){while(--_0x205d67){_0x2be82a['push'](_0x2be82a['shift']());}};_0x4dcfb3(++_0x16f028);}(_0x03c5,0x149));var _0x503c=function(_0x1a37e3,_0x5db8f6){_0x1a37e3=_0x1a37e3-0x0;var _0x4db78a=_0x03c5[_0x1a37e3];return _0x4db78a;};'use strict';var Sequelize=require(_0x503c('0x0'));var rs=require(_0x503c('0x1'));module[_0x503c('0x2')]={'name':{'type':Sequelize[_0x503c('0x3')],'unique':_0x503c('0x4'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize[_0x503c('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0x503c('0x3')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0x503c('0x3')]},'type':{'type':Sequelize[_0x503c('0x5')]('twilio',_0x503c('0x6'),_0x503c('0x7'),_0x503c('0x8'),_0x503c('0x9'),_0x503c('0xa'),_0x503c('0xb'),_0x503c('0xc'),_0x503c('0xd'),'intelepeer')},'accountSid':{'type':Sequelize[_0x503c('0x3')]},'authId':{'type':Sequelize[_0x503c('0x3')]},'authToken':{'type':Sequelize[_0x503c('0x3')]},'smsMethod':{'type':Sequelize[_0x503c('0x5')]('SI','TI','GP')},'username':{'type':Sequelize[_0x503c('0x3')]},'password':{'type':Sequelize[_0x503c('0x3')]},'apiKey':{'type':Sequelize[_0x503c('0x3')]},'applicationId':{'type':Sequelize[_0x503c('0x3')]},'accountId':{'type':Sequelize[_0x503c('0x3')]},'senderString':{'type':Sequelize[_0x503c('0x3')]},'deliveryReport':{'type':Sequelize[_0x503c('0xe')],'defaultValue':![]},'description':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x503c('0xf')],'defaultValue':function(){return _0x503c('0x10');}},'notificationSound':{'type':Sequelize[_0x503c('0xe')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x503c('0xe')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x503c('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x503c('0xe')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x503c('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x503c('0x3')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x503c('0x11')],'comment':_0x503c('0x12')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x503c('0x13'),'set':function(_0x5ecd28){if(!_0x5ecd28)this[_0x503c('0x14')](_0x503c('0x15'),null);this[_0x503c('0x14')](_0x503c('0x16'),_0x5ecd28);}}};
\ No newline at end of file
index da81c28..fbfb8cd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1439=['mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','Contacts','DESC','list','omit','contact','SmsInteraction','interaction','created','autoclose','push','close','*,*,*,*','SmsMessage','ContactId','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','Start','startRouting','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','sequelize','transaction','Transaction','ISOLATION_LEVELS','bulkCreate','findAndCountAll','finally','getApplications','pick','getInteractions','Contact','Owner','internal','color','tag','to\x20is\x20mandatory','CmList','List','Messages','spread','dataValues','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','requestid','statusInt','status_code','groupName','DELIVERED','redif','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','message-delivered','DELIVRD','ACCEPTD','statusGet','state','message-id','addAgents','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','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','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','socket.io-emitter','./smsAccount.socket','register','client','http','request','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','update','destroy','then','get','UserProfileResource','stack','name','send','Pause','mandatoryDispositionPause','map','SmsAccount','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','SmsAccounts','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','SmsAccountId','getDispositions','Disposition','removeDispositions','addAnswer','CannedAnswer','getAnswers','findOne','nolimit','removeAnswers','ids','sms','SmsApplication','account','applications','orderBy','priority','asc','Applications','CmContact','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','twilio','from','From','Body','MessageSid','skebby','connectel','clicksend','messageId','message_id','plivo','Text','infobip','results','text','csc','originatingAddress','segmentedMessage','clickatell','fromNumber','bandwidth','intelepeer','refid','isNil','from\x20is\x20mandatory','Sequelize','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1439,0x12f));var _0x9143=function(_0x227a60,_0x5a0e5b){_0x227a60=_0x227a60-0x0;var _0x3df658=_0x1439[_0x227a60];return _0x3df658;};'use strict';var emlformat=require(_0x9143('0x0'));var rimraf=require(_0x9143('0x1'));var zipdir=require(_0x9143('0x2'));var jsonpatch=require(_0x9143('0x3'));var rp=require(_0x9143('0x4'));var moment=require(_0x9143('0x5'));var BPromise=require(_0x9143('0x6'));var Mustache=require(_0x9143('0x7'));var util=require(_0x9143('0x8'));var path=require(_0x9143('0x9'));var sox=require(_0x9143('0xa'));var csv=require(_0x9143('0xb'));var ejs=require(_0x9143('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9143('0xd'));var squel=require(_0x9143('0xe'));var crypto=require(_0x9143('0xf'));var jsforce=require(_0x9143('0x10'));var deskjs=require(_0x9143('0x11'));var toCsv=require(_0x9143('0xb'));var querystring=require(_0x9143('0x12'));var Papa=require(_0x9143('0x13'));var Redis=require(_0x9143('0x14'));var authService=require(_0x9143('0x15'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9143('0x16'));var logger=require(_0x9143('0x17'))(_0x9143('0x18'));var utils=require(_0x9143('0x19'));var config=require(_0x9143('0x1a'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x9143('0x1b')]=_[_0x9143('0x1c')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x9143('0x1d'))(new Redis(config[_0x9143('0x1b')]));require(_0x9143('0x1e'))[_0x9143('0x1f')](socket);var jayson=require('jayson/promise');var client=jayson[_0x9143('0x20')][_0x9143('0x21')]({'port':0x232c});function respondWithRpcPromise(_0x145ca8,_0x3f5dfc,_0x453206,_0x4d2d86){return new BPromise(function(_0x4ffdd6,_0xc8dc1b){var _0x12d44a=_0x4d2d86||client;return _0x12d44a[_0x9143('0x22')](_0x145ca8,_0x453206)['then'](function(_0x12050d){logger[_0x9143('0x23')](_0x9143('0x24'),_0x3f5dfc,_0x9143('0x25'));logger[_0x9143('0x26')](_0x9143('0x27'),_0x3f5dfc,_0x9143('0x25'),JSON[_0x9143('0x28')](_0x12050d));if(_0x12050d[_0x9143('0x29')]){if(_0x12050d[_0x9143('0x29')][_0x9143('0x2a')]===0x1f4){logger[_0x9143('0x29')](_0x9143('0x24'),_0x3f5dfc,_0x12050d[_0x9143('0x29')]['message']);return _0xc8dc1b(_0x12050d['error'][_0x9143('0x2b')]);}logger[_0x9143('0x29')]('SmsAccount,\x20%s,\x20%s',_0x3f5dfc,_0x12050d[_0x9143('0x29')][_0x9143('0x2b')]);return _0x4ffdd6(_0x12050d[_0x9143('0x29')][_0x9143('0x2b')]);}else{logger[_0x9143('0x23')](_0x9143('0x24'),_0x3f5dfc,_0x9143('0x25'));_0x4ffdd6(_0x12050d['result'][_0x9143('0x2b')]);}})[_0x9143('0x2c')](function(_0x58bd24){logger[_0x9143('0x29')](_0x9143('0x24'),_0x3f5dfc,_0x58bd24);_0xc8dc1b(_0x58bd24);});});}function respondWithStatusCode(_0x1ce14b,_0x7926ad){_0x7926ad=_0x7926ad||0xcc;return function(_0x81311){if(_0x81311){return _0x1ce14b[_0x9143('0x2d')](_0x7926ad);}return _0x1ce14b[_0x9143('0x2e')](_0x7926ad)[_0x9143('0x2f')]();};}function respondWithResult(_0x14ebeb,_0xa9d736){_0xa9d736=_0xa9d736||0xc8;return function(_0x4547eb){if(_0x4547eb){return _0x14ebeb[_0x9143('0x2e')](_0xa9d736)[_0x9143('0x30')](_0x4547eb);}};}function respondWithFilteredResult(_0x4b5f22,_0x5213a4){return function(_0x7d5e4d){if(_0x7d5e4d){var _0x29a8d3=typeof _0x5213a4['offset']===_0x9143('0x31')&&typeof _0x5213a4[_0x9143('0x32')]==='undefined';var _0x44017b=_0x7d5e4d['count'];var _0x266278=_0x29a8d3?0x0:_0x5213a4[_0x9143('0x33')];var _0x755385=_0x29a8d3?_0x7d5e4d[_0x9143('0x34')]:_0x5213a4[_0x9143('0x33')]+_0x5213a4[_0x9143('0x32')];var _0x10638a;if(_0x755385>=_0x44017b){_0x755385=_0x44017b;_0x10638a=0xc8;}else{_0x10638a=0xce;}_0x4b5f22[_0x9143('0x2e')](_0x10638a);return _0x4b5f22[_0x9143('0x35')](_0x9143('0x36'),_0x266278+'-'+_0x755385+'/'+_0x44017b)[_0x9143('0x30')](_0x7d5e4d);}return null;};}function patchUpdates(_0x1ce978){return function(_0x506041){try{jsonpatch[_0x9143('0x37')](_0x506041,_0x1ce978,!![]);}catch(_0x8d9ae){return BPromise[_0x9143('0x38')](_0x8d9ae);}return _0x506041[_0x9143('0x39')]();};}function saveUpdates(_0x145434,_0x4bbb0d){return function(_0xf48ddb){if(_0xf48ddb){return _0xf48ddb[_0x9143('0x3a')](_0x145434)['then'](function(_0x19b47f){return _0x19b47f;});}return null;};}function removeEntity(_0x4205ac,_0x228e56){return function(_0x10f052){if(_0x10f052){return _0x10f052[_0x9143('0x3b')]()[_0x9143('0x3c')](function(){var _0x2d11d0=_0x10f052[_0x9143('0x3d')]({'plain':!![]});var _0x3450d1='SmsAccounts';return db[_0x9143('0x3e')][_0x9143('0x3b')]({'where':{'type':_0x3450d1,'resourceId':_0x2d11d0['id']}})[_0x9143('0x3c')](function(){return _0x10f052;});})['then'](function(){_0x4205ac[_0x9143('0x2e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x36a016,_0x3247a8){return function(_0x1f3412){if(!_0x1f3412){_0x36a016[_0x9143('0x2d')](0x194);}return _0x1f3412;};}function handleError(_0x5b93dd,_0x1d7c4c){_0x1d7c4c=_0x1d7c4c||0x1f4;return function(_0x9983b4){logger['error'](_0x9983b4[_0x9143('0x3f')]);if(_0x9983b4[_0x9143('0x40')]){delete _0x9983b4[_0x9143('0x40')];}_0x5b93dd['status'](_0x1d7c4c)[_0x9143('0x41')](_0x9983b4);};}exports['index']=function(_0x58246b,_0x14a660){var _0x5b7558={'include':[{'model':db[_0x9143('0x42')],'as':_0x9143('0x43')}]},_0x540e6e={},_0x5dbabf={'count':0x0,'rows':[]};var _0x265ad5=_[_0x9143('0x44')](db[_0x9143('0x45')][_0x9143('0x46')],function(_0x100814){return{'name':_0x100814['fieldName'],'type':_0x100814['type'][_0x9143('0x47')]};});_0x540e6e[_0x9143('0x48')]=_[_0x9143('0x44')](_0x265ad5,_0x9143('0x40'));_0x540e6e[_0x9143('0x49')]=_[_0x9143('0x4a')](_0x58246b[_0x9143('0x49')]);_0x540e6e[_0x9143('0x4b')]=_[_0x9143('0x4c')](_0x540e6e[_0x9143('0x48')],_0x540e6e[_0x9143('0x49')]);_0x5b7558[_0x9143('0x4d')]=_[_0x9143('0x4c')](_0x540e6e['model'],qs['fields'](_0x58246b[_0x9143('0x49')][_0x9143('0x4e')]));_0x5b7558[_0x9143('0x4d')]=_0x5b7558['attributes'][_0x9143('0x4f')]?_0x5b7558[_0x9143('0x4d')]:_0x540e6e[_0x9143('0x48')];if(!_0x58246b[_0x9143('0x49')][_0x9143('0x50')]('nolimit')){_0x5b7558[_0x9143('0x32')]=qs[_0x9143('0x32')](_0x58246b['query'][_0x9143('0x32')]);_0x5b7558[_0x9143('0x33')]=qs[_0x9143('0x33')](_0x58246b[_0x9143('0x49')][_0x9143('0x33')]);}_0x5b7558[_0x9143('0x51')]=qs[_0x9143('0x52')](_0x58246b[_0x9143('0x49')]['sort']);_0x5b7558[_0x9143('0x53')]=qs[_0x9143('0x4b')](_['pick'](_0x58246b[_0x9143('0x49')],_0x540e6e[_0x9143('0x4b')]),_0x265ad5);if(_0x58246b['query']['filter']){_0x5b7558[_0x9143('0x53')]=_[_0x9143('0x54')](_0x5b7558[_0x9143('0x53')],{'$or':_[_0x9143('0x44')](_0x265ad5,function(_0x3477a7){if(_0x3477a7[_0x9143('0x55')]!==_0x9143('0x56')){var _0x2460a2={};_0x2460a2[_0x3477a7[_0x9143('0x40')]]={'$like':'%'+_0x58246b[_0x9143('0x49')][_0x9143('0x57')]+'%'};return _0x2460a2;}})});}_0x5b7558=_['merge']({},_0x5b7558,_0x58246b[_0x9143('0x58')]);var _0x40d67c={'where':_0x5b7558[_0x9143('0x53')]};return db[_0x9143('0x45')]['count'](_0x40d67c)[_0x9143('0x3c')](function(_0x4ad80c){_0x5dbabf[_0x9143('0x34')]=_0x4ad80c;if(_0x58246b[_0x9143('0x49')][_0x9143('0x59')]){_0x5b7558[_0x9143('0x5a')]=[{'all':!![]}];}return db['SmsAccount'][_0x9143('0x5b')](_0x5b7558);})[_0x9143('0x3c')](function(_0x1eec61){_0x5dbabf[_0x9143('0x5c')]=_0x1eec61;return _0x5dbabf;})[_0x9143('0x3c')](respondWithFilteredResult(_0x14a660,_0x5b7558))['catch'](handleError(_0x14a660,null));};exports[_0x9143('0x5d')]=function(_0x2aacc9,_0x37c394){var _0x3015bc={'raw':![],'where':{'id':_0x2aacc9[_0x9143('0x5e')]['id']},'include':[{'model':db[_0x9143('0x42')],'as':'mandatoryDispositionPause'}]},_0x374e36={};_0x374e36[_0x9143('0x48')]=_['keys'](db[_0x9143('0x45')]['rawAttributes']);_0x374e36[_0x9143('0x49')]=_[_0x9143('0x4a')](_0x2aacc9[_0x9143('0x49')]);_0x374e36[_0x9143('0x4b')]=_[_0x9143('0x4c')](_0x374e36[_0x9143('0x48')],_0x374e36[_0x9143('0x49')]);_0x3015bc[_0x9143('0x4d')]=_[_0x9143('0x4c')](_0x374e36[_0x9143('0x48')],qs[_0x9143('0x4e')](_0x2aacc9[_0x9143('0x49')]['fields']));_0x3015bc[_0x9143('0x4d')]=_0x3015bc[_0x9143('0x4d')][_0x9143('0x4f')]?_0x3015bc[_0x9143('0x4d')]:_0x374e36[_0x9143('0x48')];if(_0x2aacc9[_0x9143('0x49')]['includeAll']){_0x3015bc['include']=[{'all':!![]}];}_0x3015bc=_['merge']({},_0x3015bc,_0x2aacc9[_0x9143('0x58')]);return db[_0x9143('0x45')][_0x9143('0x5f')](_0x3015bc)[_0x9143('0x3c')](handleEntityNotFound(_0x37c394,null))[_0x9143('0x3c')](respondWithResult(_0x37c394,null))[_0x9143('0x2c')](handleError(_0x37c394,null));};exports[_0x9143('0x60')]=function(_0x957f63,_0x58b71b){return db[_0x9143('0x45')][_0x9143('0x60')](_0x957f63[_0x9143('0x61')],{})['then'](function(_0x29cb36){var _0x382f53=_0x957f63[_0x9143('0x62')][_0x9143('0x3d')]({'plain':!![]});if(!_0x382f53)throw new Error(_0x9143('0x63'));if(_0x382f53[_0x9143('0x64')]===_0x9143('0x62')){var _0x594034=_0x29cb36[_0x9143('0x3d')]({'plain':!![]});var _0x2e7a45=_0x9143('0x65');return db[_0x9143('0x66')][_0x9143('0x5f')]({'where':{'name':_0x2e7a45,'userProfileId':_0x382f53[_0x9143('0x67')]},'raw':!![]})[_0x9143('0x3c')](function(_0x2a60e8){if(_0x2a60e8&&_0x2a60e8[_0x9143('0x68')]===0x0){return db[_0x9143('0x3e')]['create']({'name':_0x594034['name'],'resourceId':_0x594034['id'],'type':_0x2a60e8[_0x9143('0x40')],'sectionId':_0x2a60e8['id']},{})['then'](function(){return _0x29cb36;});}else{return _0x29cb36;}})[_0x9143('0x2c')](function(_0xc4fb54){logger[_0x9143('0x29')](_0x9143('0x69'),_0xc4fb54);throw _0xc4fb54;});}return _0x29cb36;})[_0x9143('0x3c')](respondWithResult(_0x58b71b,0xc9))[_0x9143('0x2c')](handleError(_0x58b71b,null));};exports[_0x9143('0x3a')]=function(_0x41080e,_0x4c8fdd){if(_0x41080e[_0x9143('0x61')]['id']){delete _0x41080e[_0x9143('0x61')]['id'];}return db[_0x9143('0x45')][_0x9143('0x5f')]({'where':{'id':_0x41080e['params']['id']},'include':[{'model':db[_0x9143('0x42')],'as':_0x9143('0x43')}]})[_0x9143('0x3c')](handleEntityNotFound(_0x4c8fdd,null))[_0x9143('0x3c')](saveUpdates(_0x41080e[_0x9143('0x61')],null))['then'](respondWithResult(_0x4c8fdd,null))['catch'](handleError(_0x4c8fdd,null));};exports['destroy']=function(_0x52aa96,_0x150a80){return db[_0x9143('0x45')][_0x9143('0x5f')]({'where':{'id':_0x52aa96[_0x9143('0x5e')]['id']}})[_0x9143('0x3c')](handleEntityNotFound(_0x150a80,null))[_0x9143('0x3c')](removeEntity(_0x150a80,null))[_0x9143('0x2c')](handleError(_0x150a80,null));};exports[_0x9143('0x6a')]=function(_0x2b93ec,_0x25ae29){return db['SmsAccount'][_0x9143('0x6a')]()[_0x9143('0x3c')](respondWithResult(_0x25ae29,null))[_0x9143('0x2c')](handleError(_0x25ae29,null));};exports[_0x9143('0x6b')]=function(_0x33b1d3,_0x162d1d,_0x22672b){if(_0x33b1d3[_0x9143('0x61')]['id']){delete _0x33b1d3[_0x9143('0x61')]['id'];}return db['SmsAccount']['find']({'where':{'id':_0x33b1d3[_0x9143('0x5e')]['id']}})[_0x9143('0x3c')](handleEntityNotFound(_0x162d1d,null))[_0x9143('0x3c')](function(_0x21cd97){if(_0x21cd97){_0x33b1d3[_0x9143('0x61')][_0x9143('0x6c')]=_0x21cd97['id'];return db['Disposition'][_0x9143('0x60')](_0x33b1d3['body']);}})['then'](respondWithResult(_0x162d1d,null))['catch'](handleError(_0x162d1d,null));};exports[_0x9143('0x6d')]=function(_0x58c165,_0x387bce,_0x5d9867){var _0x48eb70={'raw':![],'where':{}};var _0x2fc4f4={};var _0x1634eb={'count':0x0,'rows':[]};return db[_0x9143('0x45')]['findOne']({'where':{'id':_0x58c165[_0x9143('0x5e')]['id']}})[_0x9143('0x3c')](handleEntityNotFound(_0x387bce,null))['then'](function(_0x350b6d){if(_0x350b6d){_0x2fc4f4[_0x9143('0x48')]=_['keys'](db[_0x9143('0x6e')][_0x9143('0x46')]);_0x2fc4f4[_0x9143('0x49')]=_[_0x9143('0x4a')](_0x58c165[_0x9143('0x49')]);_0x2fc4f4[_0x9143('0x4b')]=_['intersection'](_0x2fc4f4['model'],_0x2fc4f4[_0x9143('0x49')]);_0x48eb70[_0x9143('0x4d')]=_[_0x9143('0x4c')](_0x2fc4f4['model'],qs['fields'](_0x58c165[_0x9143('0x49')]['fields']));_0x48eb70['attributes']=_0x48eb70['attributes']['length']?_0x48eb70[_0x9143('0x4d')]:_0x2fc4f4['model'];if(!_0x58c165[_0x9143('0x49')][_0x9143('0x50')]('nolimit')){_0x48eb70[_0x9143('0x32')]=qs[_0x9143('0x32')](_0x58c165[_0x9143('0x49')][_0x9143('0x32')]);_0x48eb70[_0x9143('0x33')]=qs[_0x9143('0x33')](_0x58c165[_0x9143('0x49')][_0x9143('0x33')]);}_0x48eb70[_0x9143('0x51')]=qs['sort'](_0x58c165[_0x9143('0x49')][_0x9143('0x52')]);_0x48eb70['where']=qs[_0x9143('0x4b')](_['pick'](_0x58c165['query'],_0x2fc4f4[_0x9143('0x4b')]));_0x48eb70['where']['SmsAccountId']=_0x350b6d['id'];if(_0x58c165['query'][_0x9143('0x57')]){_0x48eb70['where']=_[_0x9143('0x54')](_0x48eb70['where'],{'$or':_[_0x9143('0x44')](_0x48eb70[_0x9143('0x4d')],function(_0x2ded22){var _0x5378ef={};_0x5378ef[_0x2ded22]={'$like':'%'+_0x58c165[_0x9143('0x49')][_0x9143('0x57')]+'%'};return _0x5378ef;})});}_0x48eb70=_[_0x9143('0x54')]({},_0x48eb70,_0x58c165[_0x9143('0x58')]);return db['Disposition']['count']({'where':_0x48eb70['where']})['then'](function(_0x32aab9){_0x1634eb[_0x9143('0x34')]=_0x32aab9;if(_0x58c165[_0x9143('0x49')][_0x9143('0x59')]){_0x48eb70[_0x9143('0x5a')]=[{'all':!![]}];}return db[_0x9143('0x6e')][_0x9143('0x5b')](_0x48eb70);})['then'](function(_0x5013fe){_0x1634eb[_0x9143('0x5c')]=_0x5013fe;return _0x1634eb;});}})['then'](respondWithFilteredResult(_0x387bce,_0x48eb70))[_0x9143('0x2c')](handleError(_0x387bce,null));};exports[_0x9143('0x6f')]=function(_0x3b135c,_0x555531,_0x125ca0){return db[_0x9143('0x45')][_0x9143('0x5f')]({'where':{'id':_0x3b135c[_0x9143('0x5e')]['id']}})[_0x9143('0x3c')](handleEntityNotFound(_0x555531,null))[_0x9143('0x3c')](function(_0x46ef59){if(_0x46ef59){return _0x46ef59[_0x9143('0x6f')](_0x3b135c[_0x9143('0x49')]['ids']);}})[_0x9143('0x3c')](respondWithStatusCode(_0x555531,null))[_0x9143('0x2c')](handleError(_0x555531,null));};exports[_0x9143('0x70')]=function(_0x4b5c02,_0x25b114,_0xbf2b6a){if(_0x4b5c02[_0x9143('0x61')]['id']){delete _0x4b5c02['body']['id'];}return db[_0x9143('0x45')][_0x9143('0x5f')]({'where':{'id':_0x4b5c02[_0x9143('0x5e')]['id']}})['then'](handleEntityNotFound(_0x25b114,null))[_0x9143('0x3c')](function(_0x1f84d8){if(_0x1f84d8){_0x4b5c02[_0x9143('0x61')]['SmsAccountId']=_0x1f84d8['id'];return db[_0x9143('0x71')][_0x9143('0x60')](_0x4b5c02[_0x9143('0x61')]);}})[_0x9143('0x3c')](respondWithResult(_0x25b114,null))[_0x9143('0x2c')](handleError(_0x25b114,null));};exports[_0x9143('0x72')]=function(_0x733f69,_0x4f2f19,_0x4cf2f0){var _0x3864b1={'raw':![],'where':{}};var _0x1d156e={};var _0x2de678={'count':0x0,'rows':[]};return db[_0x9143('0x45')][_0x9143('0x73')]({'where':{'id':_0x733f69[_0x9143('0x5e')]['id']}})[_0x9143('0x3c')](handleEntityNotFound(_0x4f2f19,null))[_0x9143('0x3c')](function(_0x15c349){if(_0x15c349){_0x1d156e['model']=_['keys'](db['CannedAnswer'][_0x9143('0x46')]);_0x1d156e[_0x9143('0x49')]=_[_0x9143('0x4a')](_0x733f69[_0x9143('0x49')]);_0x1d156e['filters']=_[_0x9143('0x4c')](_0x1d156e[_0x9143('0x48')],_0x1d156e[_0x9143('0x49')]);_0x3864b1['attributes']=_[_0x9143('0x4c')](_0x1d156e[_0x9143('0x48')],qs['fields'](_0x733f69[_0x9143('0x49')]['fields']));_0x3864b1[_0x9143('0x4d')]=_0x3864b1[_0x9143('0x4d')]['length']?_0x3864b1[_0x9143('0x4d')]:_0x1d156e['model'];if(!_0x733f69[_0x9143('0x49')][_0x9143('0x50')](_0x9143('0x74'))){_0x3864b1[_0x9143('0x32')]=qs[_0x9143('0x32')](_0x733f69['query']['limit']);_0x3864b1[_0x9143('0x33')]=qs[_0x9143('0x33')](_0x733f69['query'][_0x9143('0x33')]);}_0x3864b1[_0x9143('0x51')]=qs[_0x9143('0x52')](_0x733f69[_0x9143('0x49')][_0x9143('0x52')]);_0x3864b1[_0x9143('0x53')]=qs[_0x9143('0x4b')](_['pick'](_0x733f69[_0x9143('0x49')],_0x1d156e['filters']));_0x3864b1[_0x9143('0x53')][_0x9143('0x6c')]=_0x15c349['id'];if(_0x733f69[_0x9143('0x49')][_0x9143('0x57')]){_0x3864b1['where']=_[_0x9143('0x54')](_0x3864b1[_0x9143('0x53')],{'$or':_[_0x9143('0x44')](_0x3864b1[_0x9143('0x4d')],function(_0x19d766){var _0xe7e539={};_0xe7e539[_0x19d766]={'$like':'%'+_0x733f69['query'][_0x9143('0x57')]+'%'};return _0xe7e539;})});}_0x3864b1=_['merge']({},_0x3864b1,_0x733f69[_0x9143('0x58')]);return db[_0x9143('0x71')][_0x9143('0x34')]({'where':_0x3864b1[_0x9143('0x53')]})[_0x9143('0x3c')](function(_0x1f1a47){_0x2de678[_0x9143('0x34')]=_0x1f1a47;if(_0x733f69[_0x9143('0x49')][_0x9143('0x59')]){_0x3864b1[_0x9143('0x5a')]=[{'all':!![]}];}return db[_0x9143('0x71')][_0x9143('0x5b')](_0x3864b1);})[_0x9143('0x3c')](function(_0x4253f2){_0x2de678[_0x9143('0x5c')]=_0x4253f2;return _0x2de678;});}})[_0x9143('0x3c')](respondWithFilteredResult(_0x4f2f19,_0x3864b1))['catch'](handleError(_0x4f2f19,null));};exports[_0x9143('0x75')]=function(_0x3d7715,_0x5267e3,_0x2ab21e){return db[_0x9143('0x45')][_0x9143('0x5f')]({'where':{'id':_0x3d7715[_0x9143('0x5e')]['id']}})[_0x9143('0x3c')](handleEntityNotFound(_0x5267e3,null))['then'](function(_0x31d5fc){if(_0x31d5fc){return _0x31d5fc['removeAnswers'](_0x3d7715[_0x9143('0x49')][_0x9143('0x76')]);}})['then'](respondWithStatusCode(_0x5267e3,null))[_0x9143('0x2c')](handleError(_0x5267e3,null));};exports['notify']=function(_0x1b88a5,_0x3f3cf5,_0x4f90c2){var _0x11a8a0={'channel':_0x9143('0x77')};var _0x6d33a5=[];var _0x5814e6=[];var _0xc8fc94={};return db[_0x9143('0x45')][_0x9143('0x5f')]({'where':{'id':_0x1b88a5['params']['id']},'include':[{'model':db[_0x9143('0x78')],'as':'Applications'}]})[_0x9143('0x3c')](handleEntityNotFound(_0x3f3cf5,null))[_0x9143('0x3c')](function(_0xb23ead){_0x11a8a0[_0x9143('0x79')]=_0xb23ead;_0x11a8a0[_0x9143('0x7a')]=_[_0x9143('0x7b')](_0xb23ead['Applications'],[_0x9143('0x7c')],[_0x9143('0x7d')]);if(_0x11a8a0[_0x9143('0x79')][_0x9143('0x7e')]){delete _0x11a8a0[_0x9143('0x79')][_0x9143('0x7e')];}return db[_0x9143('0x7f')]['describe']();})[_0x9143('0x3c')](function(_0x195b78){if(!_0x195b78){throw new db['Sequelize'][(_0x9143('0x80'))](_0x9143('0x81'));}_0x6d33a5=_[_0x9143('0x82')](_[_0x9143('0x4a')](_0x195b78),[_0x9143('0x83'),_0x9143('0x84')]);_0x5814e6=_[_0x9143('0x82')](_[_0x9143('0x4a')](_0x195b78),[_0x9143('0x83'),_0x9143('0x84'),'CompanyId',_0x9143('0x85')]);_0x11a8a0[_0x9143('0x61')]={'mapKey':'mobile'};if(_0x11a8a0[_0x9143('0x79')][_0x9143('0x55')]){switch(_0x11a8a0['account']['type']){case _0x9143('0x86'):_0x11a8a0[_0x9143('0x61')][_0x9143('0x87')]=_0x1b88a5['body'][_0x9143('0x88')];_0x11a8a0['body'][_0x9143('0x61')]=_0x1b88a5['body'][_0x9143('0x89')];_0x11a8a0[_0x9143('0x61')]['messageId']=_0x1b88a5[_0x9143('0x61')][_0x9143('0x8a')];break;case _0x9143('0x8b'):_0x11a8a0[_0x9143('0x61')]['from']='+'+_0x1b88a5[_0x9143('0x61')]['sender'];_0x11a8a0[_0x9143('0x61')][_0x9143('0x61')]=_0x1b88a5['body']['text'];break;case _0x9143('0x8c'):_0x11a8a0[_0x9143('0x61')][_0x9143('0x87')]=_0x1b88a5['body'][_0x9143('0x87')];_0x11a8a0['body']['body']=_0x1b88a5['body'][_0x9143('0x2b')];break;case _0x9143('0x8d'):_0x11a8a0[_0x9143('0x61')][_0x9143('0x87')]=_0x1b88a5[_0x9143('0x61')][_0x9143('0x87')];_0x11a8a0['body'][_0x9143('0x61')]=_0x1b88a5[_0x9143('0x61')][_0x9143('0x61')];_0x11a8a0[_0x9143('0x61')][_0x9143('0x8e')]=_0x1b88a5[_0x9143('0x61')][_0x9143('0x8f')];break;case _0x9143('0x90'):_0x11a8a0[_0x9143('0x61')]['from']=_0x1b88a5['body'][_0x9143('0x88')];_0x11a8a0['body']['body']=_0x1b88a5[_0x9143('0x61')][_0x9143('0x91')];_0x11a8a0['body']['messageId']=_0x1b88a5[_0x9143('0x61')]['MessageUUID'];break;case _0x9143('0x92'):_0x11a8a0[_0x9143('0x61')][_0x9143('0x87')]='+'+_0x1b88a5['body'][_0x9143('0x93')][0x0][_0x9143('0x87')];_0x11a8a0[_0x9143('0x61')][_0x9143('0x61')]=_0x1b88a5[_0x9143('0x61')]['results'][0x0][_0x9143('0x94')];_0x11a8a0[_0x9143('0x61')][_0x9143('0x8e')]=_0x1b88a5[_0x9143('0x61')]['results'][0x0][_0x9143('0x8e')];break;case _0x9143('0x95'):_0x11a8a0['body'][_0x9143('0x87')]=_0x1b88a5[_0x9143('0x61')][_0x9143('0x96')];_0x11a8a0[_0x9143('0x61')]['body']=_0x1b88a5[_0x9143('0x61')][_0x9143('0x97')][_0x9143('0x2b')];break;case _0x9143('0x98'):_0x11a8a0[_0x9143('0x61')][_0x9143('0x87')]=_0x1b88a5[_0x9143('0x61')][_0x9143('0x99')];_0x11a8a0[_0x9143('0x61')]['body']=_0x1b88a5['body']['text'];_0x11a8a0[_0x9143('0x61')][_0x9143('0x8e')]=_0x1b88a5[_0x9143('0x61')]['replyMessageId'];break;case _0x9143('0x9a'):_0x11a8a0[_0x9143('0x61')][_0x9143('0x8e')]=_0x1b88a5[_0x9143('0x61')][0x0][_0x9143('0x2b')]['id'];_0x11a8a0['body'][_0x9143('0x87')]=_0x1b88a5[_0x9143('0x61')][0x0][_0x9143('0x2b')][_0x9143('0x87')];_0x11a8a0[_0x9143('0x61')][_0x9143('0x61')]=_0x1b88a5[_0x9143('0x61')][0x0][_0x9143('0x2b')][_0x9143('0x94')];break;case _0x9143('0x9b'):_0x11a8a0[_0x9143('0x61')][_0x9143('0x87')]=_0x1b88a5['body'][_0x9143('0x87')];_0x11a8a0['body'][_0x9143('0x61')]=_0x1b88a5[_0x9143('0x61')][_0x9143('0x2b')];_0x11a8a0[_0x9143('0x61')][_0x9143('0x8e')]=_0x1b88a5[_0x9143('0x61')][_0x9143('0x9c')];break;}}if(_0x11a8a0[_0x9143('0x61')]['id']){delete _0x11a8a0[_0x9143('0x61')]['id'];}if(_[_0x9143('0x9d')](_0x11a8a0[_0x9143('0x61')]['from'])){throw new db['Sequelize'][(_0x9143('0x80'))](_0x9143('0x9e'));}if(_['isNil'](_0x11a8a0[_0x9143('0x61')][_0x9143('0x61')])||_0x11a8a0[_0x9143('0x61')][_0x9143('0x61')]===''){throw new db[(_0x9143('0x9f'))][(_0x9143('0x80'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x9143('0x9d')](_0x11a8a0[_0x9143('0x61')]['mapKey'])){throw new db[(_0x9143('0x9f'))][(_0x9143('0x80'))](_0x9143('0xa0')+_0x5814e6);}if(!_['includes'](_0x5814e6,_0x11a8a0[_0x9143('0x61')]['mapKey'])){throw new db[(_0x9143('0x9f'))]['ValidationError'](_0x9143('0xa1')+_0x5814e6);}_0xc8fc94[_0x11a8a0[_0x9143('0x61')]['mapKey']]=_0x11a8a0[_0x9143('0x61')][_0x9143('0x87')];return db['CmList'][_0x9143('0x5f')]({'where':{'id':_0x11a8a0[_0x9143('0x79')]['ListId']},'include':[{'model':db[_0x9143('0x7f')],'as':_0x9143('0xa2'),'where':_0xc8fc94,'limit':0x1,'order':[['updatedAt',_0x9143('0xa3')]]}]});})[_0x9143('0x3c')](handleEntityNotFound(_0x3f3cf5,null))['then'](function(_0xd96626){if(_0xd96626){_0x11a8a0[_0x9143('0xa4')]=_[_0x9143('0xa5')](_0xd96626,[_0x9143('0xa2')]);if(_0xd96626[_0x9143('0xa2')][_0x9143('0x4f')]){return _0xd96626[_0x9143('0xa2')][0x0];}var _0x1cacdf=_[_0x9143('0x1c')](_0x11a8a0[_0x9143('0x61')],{'firstName':_0x11a8a0[_0x9143('0x61')][_0x9143('0x87')],'ListId':_0xd96626['id']});_0x1cacdf[_0x11a8a0[_0x9143('0x61')]['mapKey']]=_0x11a8a0[_0x9143('0x61')][_0x9143('0x87')];return db['CmContact'][_0x9143('0x60')](_0x1cacdf,{'fields':_0x6d33a5,'raw':!![]});}})[_0x9143('0x3c')](handleEntityNotFound(_0x3f3cf5,null))[_0x9143('0x3c')](function(_0x2c134c){if(_0x2c134c){_0x11a8a0[_0x9143('0xa6')]=_0x2c134c;var _0x4b82fd={'ContactId':_0x2c134c['id'],'phone':_0x11a8a0[_0x9143('0x61')][_0x9143('0x87')],'SmsAccountId':_0x1b88a5[_0x9143('0x5e')]['id']};var _0x299c77={'ContactId':_0x2c134c['id'],'SmsAccountId':_0x1b88a5[_0x9143('0x5e')]['id'],'closed':![]};return db['SmsInteraction']['find']({'where':_0x299c77})[_0x9143('0x3c')](function(_0x45efaf){if(_0x45efaf){return[_0x45efaf,![]];}return db[_0x9143('0xa7')][_0x9143('0x60')](_0x4b82fd)[_0x9143('0x3c')](function(_0x1cb11d){return[_0x1cb11d,!![]];});});}})['spread'](function(_0x41f123,_0x4053bd){_0x11a8a0[_0x9143('0xa8')]=_0x41f123[_0x9143('0x3d')]({'plain':!![]});_0x11a8a0[_0x9143('0xa8')][_0x9143('0xa9')]=![];if(_0x4053bd){if(_0x11a8a0['account'][_0x9143('0xaa')]){_0x11a8a0['applications'][_0x9143('0xab')]({'id':0x0,'priority':_0x11a8a0['applications'][_0x9143('0x4f')]+0x1,'app':_0x9143('0xac'),'appdata':'unmanaged','interval':_0x9143('0xad')});}_0x11a8a0[_0x9143('0xa8')][_0x9143('0xa9')]=!![];}return db[_0x9143('0xae')][_0x9143('0x60')]({'phone':_0x11a8a0['body'][_0x9143('0x87')],'messageId':_0x11a8a0['body']['messageId'],'body':_0x11a8a0['body']['body'],'SmsAccountId':_0x1b88a5[_0x9143('0x5e')]['id'],'SmsInteractionId':_0x41f123['id'],'direction':'in','ContactId':_0x41f123[_0x9143('0xaf')],'AttachmentId':_0x11a8a0[_0x9143('0x61')][_0x9143('0xb0')]});})[_0x9143('0x3c')](function(_0x3eef4a){_0x11a8a0[_0x9143('0x2b')]=_0x3eef4a;if(_0x11a8a0['interaction'][_0x9143('0xb1')]){return db[_0x9143('0xb2')]['find']({'attributes':['id',_0x9143('0x40')],'where':{'id':_0x11a8a0[_0x9143('0xa8')][_0x9143('0xb1')]}})[_0x9143('0x3c')](function(_0x56f167){if(_0x56f167){_0x11a8a0[_0x9143('0x7a')][_0x9143('0xb3')]({'id':0x0,'priority':0x0,'app':_0x9143('0xb4'),'appdata':_0x56f167[_0x9143('0x40')]+','+(_0x11a8a0[_0x9143('0x79')][_0x9143('0xb5')]||0xa),'interval':_0x9143('0xad')});}return respondWithRpcPromise(_0x9143('0xb6'),_0x9143('0xb7'),_0x11a8a0);});}return respondWithRpcPromise(_0x9143('0xb6'),_0x9143('0xb7'),_0x11a8a0);})[_0x9143('0x3c')](function(_0x31d2e5){if(_0x31d2e5){var _0x2f2541=0xc8;var _0x4e4511='receiveMessage';logger[_0x9143('0x23')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x4e4511,_0x2f2541,_0x9143('0xb8'));logger['debug'](_0x9143('0xb9'),_0x4e4511,_0x2f2541,'entity\x20found',JSON[_0x9143('0x28')](_0x31d2e5));if(_0x11a8a0['account'][_0x9143('0x55')]===_0x9143('0x86')){return _0x3f3cf5[_0x9143('0x2e')](_0x2f2541)[_0x9143('0x35')](_0x9143('0xba'),'text/xml')[_0x9143('0x41')]('<?xml\x20version=\x221.0\x22\x20encoding=\x22UTF-8\x22?>\x0a<Response></Response>');}else{return _0x3f3cf5[_0x9143('0x2e')](_0x2f2541)[_0x9143('0x30')](_0x31d2e5);}}})[_0x9143('0x2c')](handleError(_0x3f3cf5,null));};exports['addApplications']=function(_0x51c53b,_0x19bcc9){var _0x2cffc0=_0x51c53b[_0x9143('0x5e')]['id'];var _0x328969=_0x51c53b['body'];var _0x1c603d=0xc8;var _0x12df5d=null;return db[_0x9143('0xbb')][_0x9143('0xbc')]({'isolationLevel':db[_0x9143('0xbb')][_0x9143('0xbd')][_0x9143('0xbe')]['READ_COMMITTED']},function(_0x330744){return db['SmsAccount'][_0x9143('0x73')]({'where':{'id':_0x2cffc0},'transaction':_0x330744})[_0x9143('0x3c')](function(_0x26e7ff){if(_0x26e7ff){return db[_0x9143('0x78')]['destroy']({'where':{'SmsAccountId':_0x2cffc0},'transaction':_0x330744})[_0x9143('0x3c')](function(){var _0x46d08b=_[_0x9143('0x44')](_0x328969,function(_0x151e43){_0x151e43[_0x9143('0x6c')]=_0x2cffc0;return _0x151e43;});return db['SmsApplication'][_0x9143('0xbf')](_0x46d08b,{'transaction':_0x330744});});}else{_0x1c603d=0x194;_0x12df5d=[];}});})[_0x9143('0x3c')](function(){if(_0x1c603d!==0x194){return db['SmsApplication'][_0x9143('0xc0')]({'where':{'SmsAccountId':_0x2cffc0},'order':'priority'})[_0x9143('0x3c')](function(_0x4486d6){_0x12df5d=_0x4486d6;});}})['catch'](function(_0x311d58){_0x1c603d=0x1f4;logger[_0x9143('0x29')](_0x311d58[_0x9143('0x3f')]);if(_0x311d58[_0x9143('0x40')]){delete _0x311d58[_0x9143('0x40')];}_0x12df5d=_0x311d58;})[_0x9143('0xc1')](function(){if(_0x12df5d===null){_0x19bcc9[_0x9143('0x2d')](_0x1c603d);}else{if(_0x1c603d===0x1f4){_0x19bcc9['status'](_0x1c603d)[_0x9143('0x41')](_0x12df5d);}else{_0x19bcc9['status'](_0x1c603d)[_0x9143('0x30')](_0x12df5d);}}});};exports[_0x9143('0xc2')]=function(_0xd6b640,_0x486782,_0x25bec0){var _0x100a85={};var _0x518ec5={};var _0x1b3ea8;var _0x34fa42;return db[_0x9143('0x45')][_0x9143('0x73')]({'where':{'id':_0xd6b640['params']['id']}})[_0x9143('0x3c')](handleEntityNotFound(_0x486782,null))[_0x9143('0x3c')](function(_0x481372){if(_0x481372){_0x1b3ea8=_0x481372;_0x518ec5[_0x9143('0x48')]=_[_0x9143('0x4a')](db[_0x9143('0x78')][_0x9143('0x46')]);_0x518ec5[_0x9143('0x49')]=_[_0x9143('0x4a')](_0xd6b640[_0x9143('0x49')]);_0x518ec5[_0x9143('0x4b')]=_['intersection'](_0x518ec5[_0x9143('0x48')],_0x518ec5['query']);_0x100a85[_0x9143('0x4d')]=_['intersection'](_0x518ec5[_0x9143('0x48')],qs[_0x9143('0x4e')](_0xd6b640[_0x9143('0x49')][_0x9143('0x4e')]));_0x100a85['attributes']=_0x100a85['attributes']['length']?_0x100a85[_0x9143('0x4d')]:_0x518ec5[_0x9143('0x48')];_0x100a85[_0x9143('0x51')]=qs['sort'](_0xd6b640['query']['sort']);_0x100a85[_0x9143('0x53')]=qs['filters'](_[_0x9143('0xc3')](_0xd6b640[_0x9143('0x49')],_0x518ec5[_0x9143('0x4b')]));if(_0xd6b640[_0x9143('0x49')]['filter']){_0x100a85[_0x9143('0x53')]=_['merge'](_0x100a85['where'],{'$or':_['map'](_0x100a85[_0x9143('0x4d')],function(_0x1034f8){var _0x2c93ed={};_0x2c93ed[_0x1034f8]={'$like':'%'+_0xd6b640[_0x9143('0x49')][_0x9143('0x57')]+'%'};return _0x2c93ed;})});}_0x100a85=_[_0x9143('0x54')]({},_0x100a85,_0xd6b640[_0x9143('0x58')]);return _0x1b3ea8[_0x9143('0xc2')](_0x100a85);}})['then'](function(_0x2ec840){if(_0x2ec840){_0x34fa42=_0x2ec840[_0x9143('0x4f')];if(!_0xd6b640[_0x9143('0x49')][_0x9143('0x50')](_0x9143('0x74'))){_0x100a85[_0x9143('0x32')]=qs['limit'](_0xd6b640['query'][_0x9143('0x32')]);_0x100a85[_0x9143('0x33')]=qs[_0x9143('0x33')](_0xd6b640[_0x9143('0x49')][_0x9143('0x33')]);}return _0x1b3ea8[_0x9143('0xc2')](_0x100a85);}})['then'](function(_0x4bd4e8){if(_0x4bd4e8){return _0x4bd4e8?{'count':_0x34fa42,'rows':_0x4bd4e8}:null;}})[_0x9143('0x3c')](respondWithResult(_0x486782,null))[_0x9143('0x2c')](handleError(_0x486782,null));};exports[_0x9143('0xc4')]=function(_0x5d48df,_0x54e5c2,_0x48b74e){var _0x4aac0d={'raw':![],'where':{}};var _0x144aa3={};var _0x222b3a={'count':0x0,'rows':[]};return db[_0x9143('0x45')]['findOne']({'where':{'id':_0x5d48df['params']['id']}})[_0x9143('0x3c')](handleEntityNotFound(_0x54e5c2,null))['then'](function(_0x493a6f){if(_0x493a6f){_0x144aa3[_0x9143('0x48')]=_[_0x9143('0x4a')](db[_0x9143('0xa7')][_0x9143('0x46')]);_0x144aa3['query']=_[_0x9143('0x4a')](_0x5d48df[_0x9143('0x49')]);_0x144aa3[_0x9143('0x4b')]=_[_0x9143('0x4c')](_0x144aa3[_0x9143('0x48')],_0x144aa3[_0x9143('0x49')]);_0x4aac0d[_0x9143('0x4d')]=_[_0x9143('0x4c')](_0x144aa3[_0x9143('0x48')],qs[_0x9143('0x4e')](_0x5d48df[_0x9143('0x49')][_0x9143('0x4e')]));_0x4aac0d[_0x9143('0x4d')]=_0x4aac0d[_0x9143('0x4d')][_0x9143('0x4f')]?_0x4aac0d[_0x9143('0x4d')]:_0x144aa3['model'];if(!_0x5d48df['query'][_0x9143('0x50')](_0x9143('0x74'))){_0x4aac0d[_0x9143('0x32')]=qs[_0x9143('0x32')](_0x5d48df['query'][_0x9143('0x32')]);_0x4aac0d[_0x9143('0x33')]=qs['offset'](_0x5d48df[_0x9143('0x49')]['offset']);}_0x4aac0d[_0x9143('0x51')]=qs['sort'](_0x5d48df[_0x9143('0x49')][_0x9143('0x52')]);_0x4aac0d[_0x9143('0x53')]=qs[_0x9143('0x4b')](_[_0x9143('0xc3')](_0x5d48df[_0x9143('0x49')],_0x144aa3['filters']));_0x4aac0d['where']['SmsAccountId']=_0x493a6f['id'];if(_0x5d48df[_0x9143('0x49')][_0x9143('0x57')]){_0x4aac0d['where']=_['merge'](_0x4aac0d[_0x9143('0x53')],{'$or':_[_0x9143('0x44')](_0x4aac0d[_0x9143('0x4d')],function(_0x4c6185){var _0x2e9fda={};_0x2e9fda[_0x4c6185]={'$like':'%'+_0x5d48df[_0x9143('0x49')][_0x9143('0x57')]+'%'};return _0x2e9fda;})});}_0x4aac0d=_[_0x9143('0x54')]({},_0x4aac0d,_0x5d48df[_0x9143('0x58')]);return db['SmsInteraction'][_0x9143('0x34')]({'where':_0x4aac0d[_0x9143('0x53')]})[_0x9143('0x3c')](function(_0x51a061){_0x222b3a['count']=_0x51a061;if(_0x5d48df[_0x9143('0x49')][_0x9143('0x59')]){_0x4aac0d[_0x9143('0x5a')]=[{'model':db[_0x9143('0x7f')],'as':_0x9143('0xc5'),'required':![]},{'model':db[_0x9143('0xb2')],'as':_0x9143('0xc6'),'attributes':[_0x9143('0x40'),'fullname',_0x9143('0xc7')],'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0x9143('0x40'),_0x9143('0xc8')],'where':_0x5d48df[_0x9143('0x49')][_0x9143('0xc9')]?{'id':_0x5d48df[_0x9143('0x49')][_0x9143('0xc9')]}:undefined,'required':_0x5d48df[_0x9143('0x49')][_0x9143('0xc9')]?!![]:![]}];}return db[_0x9143('0xa7')][_0x9143('0x5b')](_0x4aac0d);})[_0x9143('0x3c')](function(_0x5b5108){_0x222b3a[_0x9143('0x5c')]=_0x5b5108;return _0x222b3a;});}})['then'](respondWithFilteredResult(_0x54e5c2,_0x4aac0d))['catch'](handleError(_0x54e5c2,null));};exports[_0x9143('0x41')]=function(_0x19cdd4,_0x3e0dad,_0x1e643a){var _0x273d21,_0xb87659,_0x290466;if(_[_0x9143('0x9d')](_0x19cdd4['body'][_0x9143('0x61')])||_0x19cdd4['body'][_0x9143('0x61')]===''){throw new db[(_0x9143('0x9f'))][(_0x9143('0x80'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x9143('0x9d')](_0x19cdd4[_0x9143('0x61')]['to'])){throw new db[(_0x9143('0x9f'))][(_0x9143('0x80'))](_0x9143('0xca'));}_0x273d21=_0x19cdd4[_0x9143('0x61')]['to'];return db[_0x9143('0x45')][_0x9143('0x5f')]({'where':{'id':_0x19cdd4['params']['id']},'include':[{'model':db[_0x9143('0xcb')],'as':'List','include':[{'model':db[_0x9143('0x7f')],'as':_0x9143('0xa2'),'where':{'mobile':_0x273d21},'limit':0x1,'order':[['updatedAt',_0x9143('0xa3')]]}]}]})[_0x9143('0x3c')](handleEntityNotFound(_0x3e0dad,null))[_0x9143('0x3c')](function(_0x207208){if(_0x207208&&_0x207208[_0x9143('0xcc')]){_0xb87659=_0x207208['get']({'plain':!![]});if(_0xb87659[_0x9143('0xcc')]&&_0xb87659['List'][_0x9143('0xa2')][_0x9143('0x4f')]){return _0xb87659[_0x9143('0xcc')][_0x9143('0xa2')][0x0];}return db[_0x9143('0x7f')][_0x9143('0x60')](_['defaults'](_0x19cdd4[_0x9143('0x61')],{'firstName':_0x273d21,'mobile':_0x273d21,'phone':_0x273d21,'ListId':_0xb87659['ListId']}));}})['then'](handleEntityNotFound(_0x3e0dad,null))[_0x9143('0x3c')](function(_0x15b5b8){if(_0x15b5b8){_0x290466=_0x15b5b8;return db[_0x9143('0xa7')][_0x9143('0x5f')]({'where':{'ContactId':_0x290466['id'],'closed':![],'SmsAccountId':_0xb87659['id']}})['then'](function(_0x2a1340){if(_0x2a1340){return[_0x2a1340,![]];}return db['SmsInteraction'][_0x9143('0x60')]({'UserId':_0x19cdd4['user']['id'],'ContactId':_0x290466['id'],'SmsAccountId':_0xb87659['id'],'phone':_0x273d21,'firstMsgDirection':'out','Messages':[_['merge'](_0x19cdd4[_0x9143('0x61')],{'read':![],'body':_0x19cdd4[_0x9143('0x61')][_0x9143('0x61')],'phone':_0x273d21,'SmsAccountId':_0xb87659['id'],'UserId':_0x19cdd4['user']['id'],'ContactId':_0x290466['id']})]},{'include':[{'model':db['SmsMessage'],'as':_0x9143('0xcd')}]})['then'](function(_0x44b424){return[_0x44b424,!![]];});});}})[_0x9143('0xce')](function(_0x1bc6ca,_0x40f1dd){if(_0x40f1dd){return _0x1bc6ca;}return db[_0x9143('0xae')][_0x9143('0x60')](_[_0x9143('0x54')](_0x19cdd4[_0x9143('0x61')],{'read':![],'body':_0x19cdd4[_0x9143('0x61')]['body'],'phone':_0x273d21,'SmsAccountId':_0xb87659['id'],'SmsInteractionId':_0x1bc6ca['id'],'UserId':_0x19cdd4[_0x9143('0x62')]['id'],'ContactId':_0x290466['id']}))[_0x9143('0x3c')](function(_0x5c1ea4){_0x1bc6ca[_0x9143('0xcf')][_0x9143('0xcd')]=[];_0x1bc6ca['dataValues']['Messages'][_0x9143('0xab')](_0x5c1ea4['dataValues']);return _0x1bc6ca;});})[_0x9143('0x3c')](respondWithResult(_0x3e0dad,null))[_0x9143('0x2c')](handleError(_0x3e0dad,null));};exports['status']=function(_0x269507,_0x2c4cd4,_0xea953){if(_0x269507[_0x9143('0x61')]['id']){delete _0x269507[_0x9143('0x61')]['id'];}var _0x8442c5,_0x2f7695,_0x32ab6a;return db['SmsAccount']['find']({'where':{'id':_0x269507[_0x9143('0x5e')]['id']}})[_0x9143('0x3c')](handleEntityNotFound(_0x2c4cd4,null))[_0x9143('0x3c')](function(_0x555f9c){if(_0x555f9c){_0x32ab6a=_0x555f9c;logger[_0x9143('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x9143('0x2e'),_0x9143('0xd0'),_0x555f9c[_0x9143('0x55')],util[_0x9143('0xd1')](_0x269507[_0x9143('0x61')],{'showHidden':![],'depth':null}));switch(_0x555f9c[_0x9143('0x55')]){case _0x9143('0x8b'):if(_0x269507['body']['skebby_dispatch_id']&&_0x269507['body']['status']){_0x2f7695=_0x269507[_0x9143('0x61')][_0x9143('0x2e')];return db[_0x9143('0xae')][_0x9143('0x5f')]({'where':{'messageId':_0x269507['body'][_0x9143('0xd2')]}});}break;case'connectel':if(_0x269507[_0x9143('0x61')][_0x9143('0xd3')]&&_0x269507[_0x9143('0x61')][_0x9143('0xd4')]){_0x2f7695=_0x269507[_0x9143('0x61')]['statusInt'];return db[_0x9143('0xae')]['find']({'where':{'messageId':_0x269507[_0x9143('0x61')]['requestid']}});}break;case _0x9143('0x8d'):if(_0x269507['body'][_0x9143('0x8f')]&&_0x269507['body'][_0x9143('0xd5')]){_0x2f7695=_0x269507[_0x9143('0x61')][_0x9143('0xd5')];return db[_0x9143('0xae')][_0x9143('0x5f')]({'where':{'messageId':_0x269507[_0x9143('0x61')][_0x9143('0x8f')]}});}break;case _0x9143('0x92'):var _0x539602=_0x269507[_0x9143('0x61')][_0x9143('0x93')][0x0];if(_0x539602[_0x9143('0x8e')]&&_0x539602['status'][_0x9143('0xd6')]===_0x9143('0xd7')){_0x2f7695=_0x539602[_0x9143('0x2e')][_0x9143('0xd6')];return db[_0x9143('0xae')]['find']({'where':{'messageId':_0x539602['messageId']}});}break;case'clickatell':if(_0x269507[_0x9143('0x61')][_0x9143('0x8e')]&&_0x269507['body']['status']){_0x2f7695=_0x269507[_0x9143('0x61')][_0x9143('0x2e')];return db[_0x9143('0xae')]['find']({'where':{'messageId':_0x269507[_0x9143('0x61')][_0x9143('0x8e')]}});}break;case _0x9143('0x9a'):if(_0x269507[_0x9143('0x61')][0x0][_0x9143('0x2b')]['id']){_0x2f7695=_0x269507['body'][0x0]['type'];return db['SmsMessage'][_0x9143('0x5f')]({'where':{'messageId':_0x269507[_0x9143('0x61')][0x0][_0x9143('0x2b')]['id']}});}break;case _0x9143('0x9b'):if(_0x269507['body'][_0x9143('0xd8')]&&_0x269507[_0x9143('0x61')][_0x9143('0x2e')]){_0x2f7695=_0x269507[_0x9143('0x61')][_0x9143('0x2e')];return db[_0x9143('0xae')][_0x9143('0x5f')]({'where':{'messageId':_0x269507[_0x9143('0x61')][_0x9143('0xd8')]}});}break;}}})['then'](handleEntityNotFound(_0x2c4cd4,null))[_0x9143('0x3c')](function(_0x187572){if(_0x187572){_0x8442c5=_0x187572;switch(_0x32ab6a[_0x9143('0x55')]){case _0x9143('0x8b'):if(_0x2f7695==='DELIVERED'){return _0x8442c5['update']({'read':!![]});}else{logger['error'](_0x9143('0x27'),'status',_0x9143('0x8b'),util['inspect'](_0x269507[_0x9143('0x61')],{'showHidden':![],'depth':null}));}break;case _0x9143('0x8c'):if(_0x2f7695==='1'){return _0x8442c5['update']({'read':!![]});}else{logger[_0x9143('0x29')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x9143('0x2e'),_0x9143('0x8b'),util['inspect'](_0x269507[_0x9143('0x61')],{'showHidden':![],'depth':null}));}break;case _0x9143('0x8d'):if(!_0x269507[_0x9143('0x61')]['error_code']&&_0x2f7695>=0xc8&&_0x2f7695<=0xce){return _0x8442c5[_0x9143('0x3a')]({'read':!![]});}else{logger[_0x9143('0x29')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x9143('0x8d'),util[_0x9143('0xd1')](_0x269507[_0x9143('0x61')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x1c4b84=_0x269507[_0x9143('0x61')]['results'][0x0];if(_0x1c4b84['status'][_0x9143('0xd6')]===_0x9143('0xd7')){return _0x8442c5[_0x9143('0x3a')]({'read':!![]});}else{logger[_0x9143('0x29')](_0x9143('0x27'),_0x9143('0x2e'),_0x9143('0x92'),util[_0x9143('0xd1')](_0x269507[_0x9143('0x61')],{'showHidden':![],'depth':null}));}break;case _0x9143('0x98'):if(_0x2f7695==_0x9143('0xd9')||_0x2f7695==_0x9143('0xda')){return _0x8442c5['update']({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s','status','clickatell',util[_0x9143('0xd1')](_0x269507[_0x9143('0x61')],{'showHidden':![],'depth':null}));}break;case _0x9143('0x9a'):if(_0x2f7695==_0x9143('0xdb')){return _0x8442c5[_0x9143('0x3a')]({'read':!![]});}else{logger['error'](_0x9143('0x27'),_0x9143('0x2e'),'bandwidth',util['inspect'](_0x269507[_0x9143('0x61')],{'showHidden':![],'depth':null}));}break;case _0x9143('0x9b'):if(_0x2f7695===_0x9143('0xdc')||_0x2f7695===_0x9143('0xdd')){return _0x8442c5[_0x9143('0x3a')]({'read':!![]});}else{logger['error'](_0x9143('0x27'),_0x9143('0x2e'),'intelepeer',util['inspect'](_0x269507[_0x9143('0x61')],{'showHidden':![],'depth':null}));}break;}return _0x8442c5;}})[_0x9143('0x3c')](respondWithResult(_0x2c4cd4,null))['catch'](handleError(_0x2c4cd4,null));};exports[_0x9143('0xde')]=function(_0x1490e7,_0x42615f,_0x54c56f){var _0x41f4fe,_0x2c1244,_0x170b8e;return db[_0x9143('0x45')]['find']({'where':{'id':_0x1490e7[_0x9143('0x5e')]['id']}})[_0x9143('0x3c')](handleEntityNotFound(_0x42615f,null))['then'](function(_0x38a5b8){if(_0x38a5b8){_0x170b8e=_0x38a5b8;logger[_0x9143('0x26')](_0x9143('0x27'),_0x9143('0x2e'),_0x9143('0xd0'),_0x38a5b8['type'],util[_0x9143('0xd1')](_0x1490e7[_0x9143('0x49')],{'showHidden':![],'depth':null}));switch(_0x38a5b8[_0x9143('0x55')]){case _0x9143('0x95'):if(_0x1490e7['query']['message-id']&&_0x1490e7['query'][_0x9143('0xdf')]){_0x2c1244=_0x1490e7['query'][_0x9143('0xdf')];return db[_0x9143('0xae')][_0x9143('0x5f')]({'where':{'messageId':_0x1490e7[_0x9143('0x49')][_0x9143('0xe0')]}});}break;}}})[_0x9143('0x3c')](handleEntityNotFound(_0x42615f,null))[_0x9143('0x3c')](function(_0x5d8879){if(_0x5d8879){_0x41f4fe=_0x5d8879;switch(_0x170b8e[_0x9143('0x55')]){case'csc':if(_0x2c1244==='2'||_0x2c1244==='6'){return _0x41f4fe['update']({'read':!![]});}else{logger[_0x9143('0x29')](_0x9143('0x27'),_0x9143('0x2e'),_0x9143('0x95'),util[_0x9143('0xd1')](_0x1490e7['query'],{'showHidden':![],'depth':null}));};break;}return _0x41f4fe;}})[_0x9143('0x3c')](respondWithResult(_0x42615f,null))[_0x9143('0x2c')](handleError(_0x42615f,null));};exports[_0x9143('0xe1')]=function(_0x5a8a50,_0x42516f,_0x3ddbce){return db['SmsAccount']['find']({'where':{'id':_0x5a8a50[_0x9143('0x5e')]['id']}})[_0x9143('0x3c')](handleEntityNotFound(_0x42516f,null))[_0x9143('0x3c')](function(_0x2514fc){if(_0x2514fc){return _0x2514fc[_0x9143('0xe1')](_0x5a8a50[_0x9143('0x61')]['ids'],_[_0x9143('0xa5')](_0x5a8a50[_0x9143('0x61')],[_0x9143('0x76'),'id'])||{})['spread'](function(_0x45c1a5){for(var _0x2af85a=0x0;_0x2af85a<_0x5a8a50[_0x9143('0x61')][_0x9143('0x76')][_0x9143('0x4f')];_0x2af85a+=0x1){socket[_0x9143('0xe2')](_0x9143('0xe3'),{'UserId':Number(_0x5a8a50[_0x9143('0x61')]['ids'][_0x2af85a]),'SmsAccountId':Number(_0x5a8a50[_0x9143('0x5e')]['id'])});}return _0x45c1a5;});}})[_0x9143('0x3c')](respondWithResult(_0x42516f,null))['catch'](handleError(_0x42516f,null));};exports[_0x9143('0xe4')]=function(_0x58d04f,_0x3996eb,_0x53eebe){return db[_0x9143('0x45')][_0x9143('0x5f')]({'where':{'id':_0x58d04f[_0x9143('0x5e')]['id']}})['then'](handleEntityNotFound(_0x3996eb,null))[_0x9143('0x3c')](function(_0x357480){if(_0x357480){return _0x357480[_0x9143('0xe4')](_0x58d04f['query']['ids'])['then'](function(){if(_[_0x9143('0xe5')](_0x58d04f[_0x9143('0x49')][_0x9143('0x76')])){for(var _0xdf9a4c=0x0;_0xdf9a4c<_0x58d04f['query'][_0x9143('0x76')][_0x9143('0x4f')];_0xdf9a4c+=0x1){socket[_0x9143('0xe2')]('userSmsAccount:remove',{'UserId':Number(_0x58d04f['query'][_0x9143('0x76')][_0xdf9a4c]),'SmsAccountId':Number(_0x58d04f[_0x9143('0x5e')]['id'])});}}else{socket[_0x9143('0xe2')](_0x9143('0xe6'),{'UserId':Number(_0x58d04f[_0x9143('0x49')][_0x9143('0x76')]),'SmsAccountId':Number(_0x58d04f[_0x9143('0x5e')]['id'])});}});}})[_0x9143('0x3c')](respondWithStatusCode(_0x3996eb,null))[_0x9143('0x2c')](handleError(_0x3996eb,null));};exports[_0x9143('0xe7')]=function(_0x4ccfbe,_0x2d1d88,_0x4afe8f){var _0x59cb86={};var _0x35a661={};var _0x4958c2;var _0xa7ebe0;return db[_0x9143('0x45')][_0x9143('0x73')]({'where':{'id':_0x4ccfbe[_0x9143('0x5e')]['id']}})[_0x9143('0x3c')](handleEntityNotFound(_0x2d1d88,null))[_0x9143('0x3c')](function(_0x371be9){if(_0x371be9){_0x4958c2=_0x371be9;_0x35a661[_0x9143('0x48')]=_[_0x9143('0x4a')](db['User'][_0x9143('0x46')]);_0x35a661[_0x9143('0x49')]=_['keys'](_0x4ccfbe[_0x9143('0x49')]);_0x35a661[_0x9143('0x4b')]=_[_0x9143('0x4c')](_0x35a661[_0x9143('0x48')],_0x35a661['query']);_0x59cb86['attributes']=_[_0x9143('0x4c')](_0x35a661[_0x9143('0x48')],qs[_0x9143('0x4e')](_0x4ccfbe[_0x9143('0x49')][_0x9143('0x4e')]));_0x59cb86[_0x9143('0x4d')]=_0x59cb86['attributes'][_0x9143('0x4f')]?_0x59cb86['attributes']:_0x35a661[_0x9143('0x48')];_0x59cb86[_0x9143('0x51')]=qs[_0x9143('0x52')](_0x4ccfbe['query']['sort']);_0x59cb86['where']=qs[_0x9143('0x4b')](_[_0x9143('0xc3')](_0x4ccfbe[_0x9143('0x49')],_0x35a661[_0x9143('0x4b')]));if(_0x4ccfbe[_0x9143('0x49')]['filter']){_0x59cb86['where']=_[_0x9143('0x54')](_0x59cb86['where'],{'$or':_['map'](_0x59cb86[_0x9143('0x4d')],function(_0x500e87){var _0x1742ad={};_0x1742ad[_0x500e87]={'$like':'%'+_0x4ccfbe[_0x9143('0x49')][_0x9143('0x57')]+'%'};return _0x1742ad;})});}_0x59cb86=_[_0x9143('0x54')]({},_0x59cb86,_0x4ccfbe['options']);return _0x4958c2['getAgents'](_0x59cb86);}})[_0x9143('0x3c')](function(_0x25e2bf){if(_0x25e2bf){_0xa7ebe0=_0x25e2bf['length'];if(!_0x4ccfbe[_0x9143('0x49')]['hasOwnProperty'](_0x9143('0x74'))){_0x59cb86[_0x9143('0x32')]=qs['limit'](_0x4ccfbe[_0x9143('0x49')][_0x9143('0x32')]);_0x59cb86['offset']=qs[_0x9143('0x33')](_0x4ccfbe[_0x9143('0x49')]['offset']);}return _0x4958c2[_0x9143('0xe7')](_0x59cb86);}})[_0x9143('0x3c')](function(_0x2e0831){if(_0x2e0831){return _0x2e0831?{'count':_0xa7ebe0,'rows':_0x2e0831}:null;}})[_0x9143('0x3c')](respondWithResult(_0x2d1d88,null))[_0x9143('0x2c')](handleError(_0x2d1d88,null));};
\ No newline at end of file
+var _0x3ec5=['close','unmanaged','created','SmsMessage','ContactId','AttachmentId','UserId','User','unshift','agent','*,*,*,*','Start','receiveMessage','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','send','<?xml\x20version=\x221.0\x22\x20encoding=\x22UTF-8\x22?>\x0a<Response></Response>','addApplications','transaction','sequelize','Transaction','bulkCreate','priority','finally','getApplications','getInteractions','fullname','internal','Tag','Tags','color','tag','CmList','List','user','dataValues','Messages','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','connectel','requestid','statusInt','message_id','status_code','infobip','DELIVERED','groupName','intelepeer','redif','error_code','DELIVERED_TO_GATEWAY','message-delivered','DELIVRD','ACCEPTD','statusGet','state','message-id','addAgents','removeAgents','isArray','userSmsAccount:remove','emit','getAgents','eml-format','fast-json-patch','request-promise','moment','bluebird','util','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','jayson/promise','http','request','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','then','get','SmsAccounts','UserProfileResource','destroy','stack','Pause','mandatoryDispositionPause','map','SmsAccount','fieldName','key','model','name','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','pick','filter','where','type','includeAll','include','findAll','rows','show','params','keys','options','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','describe','addDisposition','SmsAccountId','Disposition','getDispositions','findOne','rawAttributes','length','sort','merge','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','notify','sms','SmsApplication','Applications','account','applications','orderBy','asc','CmContact','Sequelize','no\x20available\x20attributes','difference','updatedAt','createdAt','CompanyId','ListId','mobile','twilio','From','messageId','MessageSid','skebby','from','sender','text','clicksend','Text','results','csc','originatingAddress','clickatell','replyMessageId','bandwidth','isNil','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','Contacts','DESC','list','omit','contact','SmsInteraction','spread','interaction','push'];(function(_0x491fbe,_0x549481){var _0xf95c87=function(_0xfd8ba4){while(--_0xfd8ba4){_0x491fbe['push'](_0x491fbe['shift']());}};_0xf95c87(++_0x549481);}(_0x3ec5,0x123));var _0x53ec=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x3ec5[_0x501510];return _0x1e6ee5;};'use strict';var emlformat=require(_0x53ec('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x53ec('0x1'));var rp=require(_0x53ec('0x2'));var moment=require(_0x53ec('0x3'));var BPromise=require(_0x53ec('0x4'));var Mustache=require('mustache');var util=require(_0x53ec('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x53ec('0x6'));var ejs=require(_0x53ec('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x53ec('0x8'));var squel=require(_0x53ec('0x9'));var crypto=require(_0x53ec('0xa'));var jsforce=require(_0x53ec('0xb'));var deskjs=require(_0x53ec('0xc'));var toCsv=require(_0x53ec('0x6'));var querystring=require(_0x53ec('0xd'));var Papa=require(_0x53ec('0xe'));var Redis=require(_0x53ec('0xf'));var authService=require(_0x53ec('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x53ec('0x11'));var hardwareService=require(_0x53ec('0x12'));var logger=require('../../config/logger')(_0x53ec('0x13'));var utils=require(_0x53ec('0x14'));var config=require(_0x53ec('0x15'));var licenseUtil=require(_0x53ec('0x16'));var db=require(_0x53ec('0x17'))['db'];config[_0x53ec('0x18')]=_[_0x53ec('0x19')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x53ec('0x18')]));require('./smsAccount.socket')['register'](socket);var jayson=require(_0x53ec('0x1a'));var client=jayson['client'][_0x53ec('0x1b')]({'port':0x232c});function respondWithRpcPromise(_0x2c7185,_0x4cdd9e,_0x2c0234,_0x321a32){return new BPromise(function(_0x25183c,_0x33bfab){var _0x462db9=_0x321a32||client;return _0x462db9[_0x53ec('0x1c')](_0x2c7185,_0x2c0234)['then'](function(_0x1fe65e){logger[_0x53ec('0x1d')](_0x53ec('0x1e'),_0x4cdd9e,_0x53ec('0x1f'));logger[_0x53ec('0x20')](_0x53ec('0x21'),_0x4cdd9e,'request\x20sent',JSON[_0x53ec('0x22')](_0x1fe65e));if(_0x1fe65e['error']){if(_0x1fe65e['error'][_0x53ec('0x23')]===0x1f4){logger[_0x53ec('0x24')](_0x53ec('0x1e'),_0x4cdd9e,_0x1fe65e[_0x53ec('0x24')][_0x53ec('0x25')]);return _0x33bfab(_0x1fe65e['error'][_0x53ec('0x25')]);}logger[_0x53ec('0x24')](_0x53ec('0x1e'),_0x4cdd9e,_0x1fe65e[_0x53ec('0x24')]['message']);return _0x25183c(_0x1fe65e[_0x53ec('0x24')][_0x53ec('0x25')]);}else{logger[_0x53ec('0x1d')](_0x53ec('0x1e'),_0x4cdd9e,'request\x20sent');_0x25183c(_0x1fe65e[_0x53ec('0x26')]['message']);}})[_0x53ec('0x27')](function(_0x4a306b){logger['error']('SmsAccount,\x20%s,\x20%s',_0x4cdd9e,_0x4a306b);_0x33bfab(_0x4a306b);});});}function respondWithStatusCode(_0x300754,_0x3f3d73){_0x3f3d73=_0x3f3d73||0xcc;return function(_0x50357b){if(_0x50357b){return _0x300754[_0x53ec('0x28')](_0x3f3d73);}return _0x300754[_0x53ec('0x29')](_0x3f3d73)[_0x53ec('0x2a')]();};}function respondWithResult(_0x5460c7,_0xf061c9){_0xf061c9=_0xf061c9||0xc8;return function(_0x3f689c){if(_0x3f689c){return _0x5460c7[_0x53ec('0x29')](_0xf061c9)['json'](_0x3f689c);}};}function respondWithFilteredResult(_0x1ef8ac,_0x4062b2){return function(_0x3a899a){if(_0x3a899a){var _0x454b21=typeof _0x4062b2[_0x53ec('0x2b')]===_0x53ec('0x2c')&&typeof _0x4062b2['limit']===_0x53ec('0x2c');var _0x2487e1=_0x3a899a['count'];var _0xd72d42=_0x454b21?0x0:_0x4062b2[_0x53ec('0x2b')];var _0x5e5441=_0x454b21?_0x3a899a[_0x53ec('0x2d')]:_0x4062b2[_0x53ec('0x2b')]+_0x4062b2[_0x53ec('0x2e')];var _0x3efb05;if(_0x5e5441>=_0x2487e1){_0x5e5441=_0x2487e1;_0x3efb05=0xc8;}else{_0x3efb05=0xce;}_0x1ef8ac['status'](_0x3efb05);return _0x1ef8ac[_0x53ec('0x2f')](_0x53ec('0x30'),_0xd72d42+'-'+_0x5e5441+'/'+_0x2487e1)[_0x53ec('0x31')](_0x3a899a);}return null;};}function patchUpdates(_0x14a627){return function(_0x1cb93b){try{jsonpatch[_0x53ec('0x32')](_0x1cb93b,_0x14a627,!![]);}catch(_0x12cb74){return BPromise[_0x53ec('0x33')](_0x12cb74);}return _0x1cb93b[_0x53ec('0x34')]();};}function saveUpdates(_0x3b3930,_0x57d35e){return function(_0x4e8c15){if(_0x4e8c15){return _0x4e8c15[_0x53ec('0x35')](_0x3b3930)[_0x53ec('0x36')](function(_0x43f915){return _0x43f915;});}return null;};}function removeEntity(_0x36aea4,_0x55448b){return function(_0x5be86c){if(_0x5be86c){return _0x5be86c['destroy']()[_0x53ec('0x36')](function(){var _0x288694=_0x5be86c[_0x53ec('0x37')]({'plain':!![]});var _0x3f0e16=_0x53ec('0x38');return db[_0x53ec('0x39')][_0x53ec('0x3a')]({'where':{'type':_0x3f0e16,'resourceId':_0x288694['id']}})['then'](function(){return _0x5be86c;});})[_0x53ec('0x36')](function(){_0x36aea4[_0x53ec('0x29')](0xcc)[_0x53ec('0x2a')]();});}};}function handleEntityNotFound(_0x536354,_0x1f2c0b){return function(_0x15a5fb){if(!_0x15a5fb){_0x536354[_0x53ec('0x28')](0x194);}return _0x15a5fb;};}function handleError(_0x504d2c,_0x47cf76){_0x47cf76=_0x47cf76||0x1f4;return function(_0x31ffe7){logger[_0x53ec('0x24')](_0x31ffe7[_0x53ec('0x3b')]);if(_0x31ffe7['name']){delete _0x31ffe7['name'];}_0x504d2c[_0x53ec('0x29')](_0x47cf76)['send'](_0x31ffe7);};}exports['index']=function(_0x1987fb,_0x1ba72e){var _0x468e0e={'include':[{'model':db[_0x53ec('0x3c')],'as':_0x53ec('0x3d')}]},_0x5f138c={},_0x5d2205={'count':0x0,'rows':[]};var _0x3e35db=_[_0x53ec('0x3e')](db[_0x53ec('0x3f')]['rawAttributes'],function(_0x2aee60){return{'name':_0x2aee60[_0x53ec('0x40')],'type':_0x2aee60['type'][_0x53ec('0x41')]};});_0x5f138c[_0x53ec('0x42')]=_[_0x53ec('0x3e')](_0x3e35db,_0x53ec('0x43'));_0x5f138c[_0x53ec('0x44')]=_['keys'](_0x1987fb[_0x53ec('0x44')]);_0x5f138c[_0x53ec('0x45')]=_[_0x53ec('0x46')](_0x5f138c[_0x53ec('0x42')],_0x5f138c['query']);_0x468e0e[_0x53ec('0x47')]=_[_0x53ec('0x46')](_0x5f138c[_0x53ec('0x42')],qs[_0x53ec('0x48')](_0x1987fb[_0x53ec('0x44')][_0x53ec('0x48')]));_0x468e0e[_0x53ec('0x47')]=_0x468e0e[_0x53ec('0x47')]['length']?_0x468e0e[_0x53ec('0x47')]:_0x5f138c[_0x53ec('0x42')];if(!_0x1987fb[_0x53ec('0x44')][_0x53ec('0x49')](_0x53ec('0x4a'))){_0x468e0e[_0x53ec('0x2e')]=qs[_0x53ec('0x2e')](_0x1987fb[_0x53ec('0x44')][_0x53ec('0x2e')]);_0x468e0e[_0x53ec('0x2b')]=qs[_0x53ec('0x2b')](_0x1987fb[_0x53ec('0x44')]['offset']);}_0x468e0e[_0x53ec('0x4b')]=qs['sort'](_0x1987fb[_0x53ec('0x44')]['sort']);_0x468e0e['where']=qs[_0x53ec('0x45')](_[_0x53ec('0x4c')](_0x1987fb['query'],_0x5f138c[_0x53ec('0x45')]),_0x3e35db);if(_0x1987fb[_0x53ec('0x44')][_0x53ec('0x4d')]){_0x468e0e[_0x53ec('0x4e')]=_['merge'](_0x468e0e[_0x53ec('0x4e')],{'$or':_[_0x53ec('0x3e')](_0x3e35db,function(_0x363139){if(_0x363139[_0x53ec('0x4f')]!=='VIRTUAL'){var _0x2e78b8={};_0x2e78b8[_0x363139[_0x53ec('0x43')]]={'$like':'%'+_0x1987fb[_0x53ec('0x44')]['filter']+'%'};return _0x2e78b8;}})});}_0x468e0e=_['merge']({},_0x468e0e,_0x1987fb['options']);var _0x4aebdd={'where':_0x468e0e[_0x53ec('0x4e')]};return db[_0x53ec('0x3f')][_0x53ec('0x2d')](_0x4aebdd)['then'](function(_0x1f9db9){_0x5d2205[_0x53ec('0x2d')]=_0x1f9db9;if(_0x1987fb[_0x53ec('0x44')][_0x53ec('0x50')]){_0x468e0e[_0x53ec('0x51')]=[{'all':!![]}];}return db[_0x53ec('0x3f')][_0x53ec('0x52')](_0x468e0e);})[_0x53ec('0x36')](function(_0x4f623f){_0x5d2205[_0x53ec('0x53')]=_0x4f623f;return _0x5d2205;})['then'](respondWithFilteredResult(_0x1ba72e,_0x468e0e))['catch'](handleError(_0x1ba72e,null));};exports[_0x53ec('0x54')]=function(_0x32974a,_0x4bbb01){var _0xced58a={'raw':![],'where':{'id':_0x32974a[_0x53ec('0x55')]['id']},'include':[{'model':db['Pause'],'as':_0x53ec('0x3d')}]},_0x5f2a6f={};_0x5f2a6f['model']=_[_0x53ec('0x56')](db[_0x53ec('0x3f')]['rawAttributes']);_0x5f2a6f[_0x53ec('0x44')]=_[_0x53ec('0x56')](_0x32974a[_0x53ec('0x44')]);_0x5f2a6f['filters']=_[_0x53ec('0x46')](_0x5f2a6f['model'],_0x5f2a6f[_0x53ec('0x44')]);_0xced58a[_0x53ec('0x47')]=_[_0x53ec('0x46')](_0x5f2a6f[_0x53ec('0x42')],qs['fields'](_0x32974a['query'][_0x53ec('0x48')]));_0xced58a['attributes']=_0xced58a[_0x53ec('0x47')]['length']?_0xced58a['attributes']:_0x5f2a6f['model'];if(_0x32974a[_0x53ec('0x44')][_0x53ec('0x50')]){_0xced58a[_0x53ec('0x51')]=[{'all':!![]}];}_0xced58a=_['merge']({},_0xced58a,_0x32974a[_0x53ec('0x57')]);return db[_0x53ec('0x3f')]['find'](_0xced58a)[_0x53ec('0x36')](handleEntityNotFound(_0x4bbb01,null))[_0x53ec('0x36')](respondWithResult(_0x4bbb01,null))[_0x53ec('0x27')](handleError(_0x4bbb01,null));};exports[_0x53ec('0x58')]=function(_0x5011c5,_0x1b6bbf){return db[_0x53ec('0x3f')][_0x53ec('0x58')](_0x5011c5[_0x53ec('0x59')],{})[_0x53ec('0x36')](function(_0x4c9021){var _0x3fcf71=_0x5011c5['user']['get']({'plain':!![]});if(!_0x3fcf71)throw new Error(_0x53ec('0x5a'));if(_0x3fcf71[_0x53ec('0x5b')]==='user'){var _0x48378c=_0x4c9021[_0x53ec('0x37')]({'plain':!![]});var _0x34329d=_0x53ec('0x38');return db[_0x53ec('0x5c')]['find']({'where':{'name':_0x34329d,'userProfileId':_0x3fcf71[_0x53ec('0x5d')]},'raw':!![]})[_0x53ec('0x36')](function(_0x5788e1){if(_0x5788e1&&_0x5788e1[_0x53ec('0x5e')]===0x0){return db[_0x53ec('0x39')]['create']({'name':_0x48378c[_0x53ec('0x43')],'resourceId':_0x48378c['id'],'type':_0x5788e1['name'],'sectionId':_0x5788e1['id']},{})[_0x53ec('0x36')](function(){return _0x4c9021;});}else{return _0x4c9021;}})[_0x53ec('0x27')](function(_0xc96231){logger[_0x53ec('0x24')](_0x53ec('0x5f'),_0xc96231);throw _0xc96231;});}return _0x4c9021;})[_0x53ec('0x36')](respondWithResult(_0x1b6bbf,0xc9))[_0x53ec('0x27')](handleError(_0x1b6bbf,null));};exports[_0x53ec('0x35')]=function(_0x610be6,_0x1fd8c0){if(_0x610be6['body']['id']){delete _0x610be6[_0x53ec('0x59')]['id'];}return db['SmsAccount'][_0x53ec('0x60')]({'where':{'id':_0x610be6['params']['id']},'include':[{'model':db[_0x53ec('0x3c')],'as':'mandatoryDispositionPause'}]})[_0x53ec('0x36')](handleEntityNotFound(_0x1fd8c0,null))[_0x53ec('0x36')](saveUpdates(_0x610be6[_0x53ec('0x59')],null))[_0x53ec('0x36')](respondWithResult(_0x1fd8c0,null))[_0x53ec('0x27')](handleError(_0x1fd8c0,null));};exports[_0x53ec('0x3a')]=function(_0x5e0a08,_0x1cf8ad){return db[_0x53ec('0x3f')][_0x53ec('0x60')]({'where':{'id':_0x5e0a08[_0x53ec('0x55')]['id']}})['then'](handleEntityNotFound(_0x1cf8ad,null))[_0x53ec('0x36')](removeEntity(_0x1cf8ad,null))[_0x53ec('0x27')](handleError(_0x1cf8ad,null));};exports['describe']=function(_0x5d0ee0,_0x182f7b){return db['SmsAccount'][_0x53ec('0x61')]()[_0x53ec('0x36')](respondWithResult(_0x182f7b,null))[_0x53ec('0x27')](handleError(_0x182f7b,null));};exports[_0x53ec('0x62')]=function(_0x40d8b1,_0x479565,_0x111019){if(_0x40d8b1[_0x53ec('0x59')]['id']){delete _0x40d8b1['body']['id'];}return db[_0x53ec('0x3f')][_0x53ec('0x60')]({'where':{'id':_0x40d8b1[_0x53ec('0x55')]['id']}})[_0x53ec('0x36')](handleEntityNotFound(_0x479565,null))[_0x53ec('0x36')](function(_0x38ab61){if(_0x38ab61){_0x40d8b1[_0x53ec('0x59')][_0x53ec('0x63')]=_0x38ab61['id'];return db[_0x53ec('0x64')]['create'](_0x40d8b1['body']);}})['then'](respondWithResult(_0x479565,null))[_0x53ec('0x27')](handleError(_0x479565,null));};exports[_0x53ec('0x65')]=function(_0x206f60,_0x2ba288,_0x3feae5){var _0x3660aa={'raw':![],'where':{}};var _0x4b44e2={};var _0x6c005b={'count':0x0,'rows':[]};return db['SmsAccount'][_0x53ec('0x66')]({'where':{'id':_0x206f60[_0x53ec('0x55')]['id']}})[_0x53ec('0x36')](handleEntityNotFound(_0x2ba288,null))['then'](function(_0x25dd96){if(_0x25dd96){_0x4b44e2[_0x53ec('0x42')]=_[_0x53ec('0x56')](db['Disposition'][_0x53ec('0x67')]);_0x4b44e2[_0x53ec('0x44')]=_['keys'](_0x206f60[_0x53ec('0x44')]);_0x4b44e2[_0x53ec('0x45')]=_[_0x53ec('0x46')](_0x4b44e2[_0x53ec('0x42')],_0x4b44e2[_0x53ec('0x44')]);_0x3660aa[_0x53ec('0x47')]=_['intersection'](_0x4b44e2[_0x53ec('0x42')],qs[_0x53ec('0x48')](_0x206f60[_0x53ec('0x44')][_0x53ec('0x48')]));_0x3660aa[_0x53ec('0x47')]=_0x3660aa[_0x53ec('0x47')][_0x53ec('0x68')]?_0x3660aa[_0x53ec('0x47')]:_0x4b44e2[_0x53ec('0x42')];if(!_0x206f60[_0x53ec('0x44')][_0x53ec('0x49')](_0x53ec('0x4a'))){_0x3660aa['limit']=qs['limit'](_0x206f60[_0x53ec('0x44')][_0x53ec('0x2e')]);_0x3660aa['offset']=qs[_0x53ec('0x2b')](_0x206f60['query'][_0x53ec('0x2b')]);}_0x3660aa['order']=qs[_0x53ec('0x69')](_0x206f60[_0x53ec('0x44')]['sort']);_0x3660aa[_0x53ec('0x4e')]=qs[_0x53ec('0x45')](_['pick'](_0x206f60['query'],_0x4b44e2[_0x53ec('0x45')]));_0x3660aa[_0x53ec('0x4e')]['SmsAccountId']=_0x25dd96['id'];if(_0x206f60[_0x53ec('0x44')][_0x53ec('0x4d')]){_0x3660aa['where']=_[_0x53ec('0x6a')](_0x3660aa[_0x53ec('0x4e')],{'$or':_[_0x53ec('0x3e')](_0x3660aa[_0x53ec('0x47')],function(_0x42049e){var _0x17e16b={};_0x17e16b[_0x42049e]={'$like':'%'+_0x206f60[_0x53ec('0x44')][_0x53ec('0x4d')]+'%'};return _0x17e16b;})});}_0x3660aa=_[_0x53ec('0x6a')]({},_0x3660aa,_0x206f60[_0x53ec('0x57')]);return db[_0x53ec('0x64')][_0x53ec('0x2d')]({'where':_0x3660aa[_0x53ec('0x4e')]})[_0x53ec('0x36')](function(_0x4f591e){_0x6c005b['count']=_0x4f591e;if(_0x206f60[_0x53ec('0x44')][_0x53ec('0x50')]){_0x3660aa[_0x53ec('0x51')]=[{'all':!![]}];}return db[_0x53ec('0x64')][_0x53ec('0x52')](_0x3660aa);})[_0x53ec('0x36')](function(_0x14c303){_0x6c005b['rows']=_0x14c303;return _0x6c005b;});}})['then'](respondWithFilteredResult(_0x2ba288,_0x3660aa))[_0x53ec('0x27')](handleError(_0x2ba288,null));};exports[_0x53ec('0x6b')]=function(_0x2e944a,_0x5e384e,_0x3a3835){return db[_0x53ec('0x3f')][_0x53ec('0x60')]({'where':{'id':_0x2e944a[_0x53ec('0x55')]['id']}})['then'](handleEntityNotFound(_0x5e384e,null))[_0x53ec('0x36')](function(_0x388008){if(_0x388008){return _0x388008['removeDispositions'](_0x2e944a[_0x53ec('0x44')][_0x53ec('0x6c')]);}})[_0x53ec('0x36')](respondWithStatusCode(_0x5e384e,null))[_0x53ec('0x27')](handleError(_0x5e384e,null));};exports[_0x53ec('0x6d')]=function(_0x52f8b2,_0x26c0c8,_0x2853fa){if(_0x52f8b2['body']['id']){delete _0x52f8b2[_0x53ec('0x59')]['id'];}return db[_0x53ec('0x3f')]['find']({'where':{'id':_0x52f8b2[_0x53ec('0x55')]['id']}})[_0x53ec('0x36')](handleEntityNotFound(_0x26c0c8,null))[_0x53ec('0x36')](function(_0xeb0ce8){if(_0xeb0ce8){_0x52f8b2[_0x53ec('0x59')][_0x53ec('0x63')]=_0xeb0ce8['id'];return db[_0x53ec('0x6e')][_0x53ec('0x58')](_0x52f8b2['body']);}})[_0x53ec('0x36')](respondWithResult(_0x26c0c8,null))['catch'](handleError(_0x26c0c8,null));};exports[_0x53ec('0x6f')]=function(_0x6de380,_0x545252,_0x409942){var _0x2af6ce={'raw':![],'where':{}};var _0x5e2348={};var _0x47944c={'count':0x0,'rows':[]};return db[_0x53ec('0x3f')]['findOne']({'where':{'id':_0x6de380['params']['id']}})['then'](handleEntityNotFound(_0x545252,null))[_0x53ec('0x36')](function(_0x12a910){if(_0x12a910){_0x5e2348[_0x53ec('0x42')]=_[_0x53ec('0x56')](db[_0x53ec('0x6e')][_0x53ec('0x67')]);_0x5e2348[_0x53ec('0x44')]=_['keys'](_0x6de380[_0x53ec('0x44')]);_0x5e2348['filters']=_[_0x53ec('0x46')](_0x5e2348[_0x53ec('0x42')],_0x5e2348[_0x53ec('0x44')]);_0x2af6ce['attributes']=_['intersection'](_0x5e2348['model'],qs['fields'](_0x6de380[_0x53ec('0x44')][_0x53ec('0x48')]));_0x2af6ce[_0x53ec('0x47')]=_0x2af6ce[_0x53ec('0x47')]['length']?_0x2af6ce[_0x53ec('0x47')]:_0x5e2348['model'];if(!_0x6de380[_0x53ec('0x44')][_0x53ec('0x49')]('nolimit')){_0x2af6ce[_0x53ec('0x2e')]=qs[_0x53ec('0x2e')](_0x6de380[_0x53ec('0x44')][_0x53ec('0x2e')]);_0x2af6ce[_0x53ec('0x2b')]=qs[_0x53ec('0x2b')](_0x6de380['query']['offset']);}_0x2af6ce[_0x53ec('0x4b')]=qs[_0x53ec('0x69')](_0x6de380[_0x53ec('0x44')][_0x53ec('0x69')]);_0x2af6ce[_0x53ec('0x4e')]=qs[_0x53ec('0x45')](_[_0x53ec('0x4c')](_0x6de380['query'],_0x5e2348[_0x53ec('0x45')]));_0x2af6ce[_0x53ec('0x4e')][_0x53ec('0x63')]=_0x12a910['id'];if(_0x6de380[_0x53ec('0x44')][_0x53ec('0x4d')]){_0x2af6ce['where']=_['merge'](_0x2af6ce[_0x53ec('0x4e')],{'$or':_[_0x53ec('0x3e')](_0x2af6ce['attributes'],function(_0x44b02e){var _0x377460={};_0x377460[_0x44b02e]={'$like':'%'+_0x6de380[_0x53ec('0x44')][_0x53ec('0x4d')]+'%'};return _0x377460;})});}_0x2af6ce=_['merge']({},_0x2af6ce,_0x6de380[_0x53ec('0x57')]);return db[_0x53ec('0x6e')][_0x53ec('0x2d')]({'where':_0x2af6ce['where']})[_0x53ec('0x36')](function(_0x40e1c0){_0x47944c['count']=_0x40e1c0;if(_0x6de380[_0x53ec('0x44')][_0x53ec('0x50')]){_0x2af6ce['include']=[{'all':!![]}];}return db[_0x53ec('0x6e')]['findAll'](_0x2af6ce);})[_0x53ec('0x36')](function(_0x1dce22){_0x47944c[_0x53ec('0x53')]=_0x1dce22;return _0x47944c;});}})['then'](respondWithFilteredResult(_0x545252,_0x2af6ce))['catch'](handleError(_0x545252,null));};exports[_0x53ec('0x70')]=function(_0x5aec6e,_0x333f7d,_0x4d5296){return db[_0x53ec('0x3f')][_0x53ec('0x60')]({'where':{'id':_0x5aec6e[_0x53ec('0x55')]['id']}})[_0x53ec('0x36')](handleEntityNotFound(_0x333f7d,null))[_0x53ec('0x36')](function(_0x283f59){if(_0x283f59){return _0x283f59[_0x53ec('0x70')](_0x5aec6e['query'][_0x53ec('0x6c')]);}})[_0x53ec('0x36')](respondWithStatusCode(_0x333f7d,null))[_0x53ec('0x27')](handleError(_0x333f7d,null));};exports[_0x53ec('0x71')]=function(_0x548314,_0xfcbf10,_0x4e14fd){var _0x566a9d={'channel':_0x53ec('0x72')};var _0x3453f5=[];var _0x51e8e5=[];var _0x237e24={};return db[_0x53ec('0x3f')][_0x53ec('0x60')]({'where':{'id':_0x548314['params']['id']},'include':[{'model':db[_0x53ec('0x73')],'as':_0x53ec('0x74')}]})[_0x53ec('0x36')](handleEntityNotFound(_0xfcbf10,null))['then'](function(_0x57b1cc){_0x566a9d[_0x53ec('0x75')]=_0x57b1cc;_0x566a9d[_0x53ec('0x76')]=_[_0x53ec('0x77')](_0x57b1cc[_0x53ec('0x74')],['priority'],[_0x53ec('0x78')]);if(_0x566a9d[_0x53ec('0x75')][_0x53ec('0x74')]){delete _0x566a9d[_0x53ec('0x75')]['Applications'];}return db[_0x53ec('0x79')][_0x53ec('0x61')]();})[_0x53ec('0x36')](function(_0x507547){if(!_0x507547){throw new db[(_0x53ec('0x7a'))]['ValidationError'](_0x53ec('0x7b'));}_0x3453f5=_[_0x53ec('0x7c')](_[_0x53ec('0x56')](_0x507547),['createdAt',_0x53ec('0x7d')]);_0x51e8e5=_['difference'](_[_0x53ec('0x56')](_0x507547),[_0x53ec('0x7e'),_0x53ec('0x7d'),_0x53ec('0x7f'),_0x53ec('0x80')]);_0x566a9d['body']={'mapKey':_0x53ec('0x81')};if(_0x566a9d[_0x53ec('0x75')][_0x53ec('0x4f')]){switch(_0x566a9d['account']['type']){case _0x53ec('0x82'):_0x566a9d['body']['from']=_0x548314['body'][_0x53ec('0x83')];_0x566a9d['body']['body']=_0x548314['body']['Body'];_0x566a9d['body'][_0x53ec('0x84')]=_0x548314[_0x53ec('0x59')][_0x53ec('0x85')];break;case _0x53ec('0x86'):_0x566a9d[_0x53ec('0x59')][_0x53ec('0x87')]='+'+_0x548314['body'][_0x53ec('0x88')];_0x566a9d[_0x53ec('0x59')][_0x53ec('0x59')]=_0x548314['body'][_0x53ec('0x89')];break;case'connectel':_0x566a9d['body']['from']=_0x548314[_0x53ec('0x59')][_0x53ec('0x87')];_0x566a9d['body']['body']=_0x548314[_0x53ec('0x59')][_0x53ec('0x25')];break;case _0x53ec('0x8a'):_0x566a9d[_0x53ec('0x59')][_0x53ec('0x87')]=_0x548314[_0x53ec('0x59')]['from'];_0x566a9d[_0x53ec('0x59')][_0x53ec('0x59')]=_0x548314['body'][_0x53ec('0x59')];_0x566a9d[_0x53ec('0x59')][_0x53ec('0x84')]=_0x548314[_0x53ec('0x59')]['message_id'];break;case'plivo':_0x566a9d[_0x53ec('0x59')][_0x53ec('0x87')]=_0x548314[_0x53ec('0x59')][_0x53ec('0x83')];_0x566a9d[_0x53ec('0x59')]['body']=_0x548314[_0x53ec('0x59')][_0x53ec('0x8b')];_0x566a9d[_0x53ec('0x59')][_0x53ec('0x84')]=_0x548314[_0x53ec('0x59')]['MessageUUID'];break;case'infobip':_0x566a9d[_0x53ec('0x59')][_0x53ec('0x87')]='+'+_0x548314[_0x53ec('0x59')][_0x53ec('0x8c')][0x0][_0x53ec('0x87')];_0x566a9d[_0x53ec('0x59')][_0x53ec('0x59')]=_0x548314[_0x53ec('0x59')]['results'][0x0]['text'];_0x566a9d['body'][_0x53ec('0x84')]=_0x548314[_0x53ec('0x59')][_0x53ec('0x8c')][0x0]['messageId'];break;case _0x53ec('0x8d'):_0x566a9d[_0x53ec('0x59')][_0x53ec('0x87')]=_0x548314['body'][_0x53ec('0x8e')];_0x566a9d[_0x53ec('0x59')]['body']=_0x548314[_0x53ec('0x59')]['segmentedMessage'][_0x53ec('0x25')];break;case _0x53ec('0x8f'):_0x566a9d[_0x53ec('0x59')]['from']=_0x548314[_0x53ec('0x59')]['fromNumber'];_0x566a9d[_0x53ec('0x59')]['body']=_0x548314[_0x53ec('0x59')][_0x53ec('0x89')];_0x566a9d[_0x53ec('0x59')][_0x53ec('0x84')]=_0x548314[_0x53ec('0x59')][_0x53ec('0x90')];break;case _0x53ec('0x91'):_0x566a9d[_0x53ec('0x59')][_0x53ec('0x84')]=_0x548314[_0x53ec('0x59')][0x0][_0x53ec('0x25')]['id'];_0x566a9d['body'][_0x53ec('0x87')]=_0x548314['body'][0x0]['message'][_0x53ec('0x87')];_0x566a9d[_0x53ec('0x59')][_0x53ec('0x59')]=_0x548314['body'][0x0]['message'][_0x53ec('0x89')];break;case'intelepeer':_0x566a9d[_0x53ec('0x59')][_0x53ec('0x87')]=_0x548314[_0x53ec('0x59')][_0x53ec('0x87')];_0x566a9d['body'][_0x53ec('0x59')]=_0x548314[_0x53ec('0x59')][_0x53ec('0x25')];_0x566a9d['body'][_0x53ec('0x84')]=_0x548314['body']['refid'];break;}}if(_0x566a9d['body']['id']){delete _0x566a9d[_0x53ec('0x59')]['id'];}if(_[_0x53ec('0x92')](_0x566a9d[_0x53ec('0x59')][_0x53ec('0x87')])){throw new db[(_0x53ec('0x7a'))][(_0x53ec('0x93'))](_0x53ec('0x94'));}if(_[_0x53ec('0x92')](_0x566a9d['body'][_0x53ec('0x59')])||_0x566a9d[_0x53ec('0x59')][_0x53ec('0x59')]===''){throw new db[(_0x53ec('0x7a'))][(_0x53ec('0x93'))](_0x53ec('0x95'));}if(_['isNil'](_0x566a9d[_0x53ec('0x59')]['mapKey'])){throw new db[(_0x53ec('0x7a'))][(_0x53ec('0x93'))](_0x53ec('0x96')+_0x51e8e5);}if(!_['includes'](_0x51e8e5,_0x566a9d[_0x53ec('0x59')][_0x53ec('0x97')])){throw new db['Sequelize'][(_0x53ec('0x93'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x51e8e5);}_0x237e24[_0x566a9d['body'][_0x53ec('0x97')]]=_0x566a9d[_0x53ec('0x59')][_0x53ec('0x87')];return db['CmList'][_0x53ec('0x60')]({'where':{'id':_0x566a9d[_0x53ec('0x75')]['ListId']},'include':[{'model':db[_0x53ec('0x79')],'as':_0x53ec('0x98'),'where':_0x237e24,'limit':0x1,'order':[['updatedAt',_0x53ec('0x99')]]}]});})[_0x53ec('0x36')](handleEntityNotFound(_0xfcbf10,null))['then'](function(_0x2f6622){if(_0x2f6622){_0x566a9d[_0x53ec('0x9a')]=_[_0x53ec('0x9b')](_0x2f6622,['Contacts']);if(_0x2f6622[_0x53ec('0x98')]['length']){return _0x2f6622[_0x53ec('0x98')][0x0];}var _0x60e5df=_['defaults'](_0x566a9d[_0x53ec('0x59')],{'firstName':_0x566a9d[_0x53ec('0x59')][_0x53ec('0x87')],'ListId':_0x2f6622['id']});_0x60e5df[_0x566a9d[_0x53ec('0x59')][_0x53ec('0x97')]]=_0x566a9d[_0x53ec('0x59')]['from'];return db[_0x53ec('0x79')]['create'](_0x60e5df,{'fields':_0x3453f5,'raw':!![]});}})[_0x53ec('0x36')](handleEntityNotFound(_0xfcbf10,null))[_0x53ec('0x36')](function(_0x46c47a){if(_0x46c47a){_0x566a9d[_0x53ec('0x9c')]=_0x46c47a;var _0x5309e9={'ContactId':_0x46c47a['id'],'phone':_0x566a9d[_0x53ec('0x59')][_0x53ec('0x87')],'SmsAccountId':_0x548314['params']['id']};var _0x15b470={'ContactId':_0x46c47a['id'],'SmsAccountId':_0x548314[_0x53ec('0x55')]['id'],'closed':![]};return db[_0x53ec('0x9d')][_0x53ec('0x60')]({'where':_0x15b470})[_0x53ec('0x36')](function(_0x5769ec){if(_0x5769ec){return[_0x5769ec,![]];}return db['SmsInteraction'][_0x53ec('0x58')](_0x5309e9)[_0x53ec('0x36')](function(_0x5110fb){return[_0x5110fb,!![]];});});}})[_0x53ec('0x9e')](function(_0x348655,_0x54f091){_0x566a9d[_0x53ec('0x9f')]=_0x348655[_0x53ec('0x37')]({'plain':!![]});_0x566a9d[_0x53ec('0x9f')]['created']=![];if(_0x54f091){if(_0x566a9d[_0x53ec('0x75')]['autoclose']){_0x566a9d[_0x53ec('0x76')][_0x53ec('0xa0')]({'id':0x0,'priority':_0x566a9d[_0x53ec('0x76')]['length']+0x1,'app':_0x53ec('0xa1'),'appdata':_0x53ec('0xa2'),'interval':'*,*,*,*'});}_0x566a9d[_0x53ec('0x9f')][_0x53ec('0xa3')]=!![];}return db[_0x53ec('0xa4')][_0x53ec('0x58')]({'phone':_0x566a9d['body'][_0x53ec('0x87')],'messageId':_0x566a9d[_0x53ec('0x59')][_0x53ec('0x84')],'body':_0x566a9d[_0x53ec('0x59')][_0x53ec('0x59')],'SmsAccountId':_0x548314[_0x53ec('0x55')]['id'],'SmsInteractionId':_0x348655['id'],'direction':'in','ContactId':_0x348655[_0x53ec('0xa5')],'AttachmentId':_0x566a9d[_0x53ec('0x59')][_0x53ec('0xa6')]});})[_0x53ec('0x36')](function(_0x1aa3f0){_0x566a9d['message']=_0x1aa3f0;if(_0x566a9d[_0x53ec('0x9f')][_0x53ec('0xa7')]){return db[_0x53ec('0xa8')][_0x53ec('0x60')]({'attributes':['id',_0x53ec('0x43')],'where':{'id':_0x566a9d[_0x53ec('0x9f')][_0x53ec('0xa7')]}})[_0x53ec('0x36')](function(_0x2325bf){if(_0x2325bf){_0x566a9d['applications'][_0x53ec('0xa9')]({'id':0x0,'priority':0x0,'app':_0x53ec('0xaa'),'appdata':_0x2325bf[_0x53ec('0x43')]+','+(_0x566a9d['account']['waitForTheAssignedAgent']||0xa),'interval':_0x53ec('0xab')});}return respondWithRpcPromise('Start','startRouting',_0x566a9d);});}return respondWithRpcPromise(_0x53ec('0xac'),'startRouting',_0x566a9d);})[_0x53ec('0x36')](function(_0x596cb9){if(_0x596cb9){var _0x1d5152=0xc8;var _0x4b2005=_0x53ec('0xad');logger['info'](_0x53ec('0x21'),_0x4b2005,_0x1d5152,_0x53ec('0xae'));logger[_0x53ec('0x20')](_0x53ec('0xaf'),_0x4b2005,_0x1d5152,'entity\x20found',JSON[_0x53ec('0x22')](_0x596cb9));if(_0x566a9d['account']['type']===_0x53ec('0x82')){return _0xfcbf10[_0x53ec('0x29')](_0x1d5152)[_0x53ec('0x2f')](_0x53ec('0xb0'),'text/xml')[_0x53ec('0xb1')](_0x53ec('0xb2'));}else{return _0xfcbf10[_0x53ec('0x29')](_0x1d5152)[_0x53ec('0x31')](_0x596cb9);}}})[_0x53ec('0x27')](handleError(_0xfcbf10,null));};exports[_0x53ec('0xb3')]=function(_0x2b6756,_0x1fc91b){var _0x3ad15d=_0x2b6756[_0x53ec('0x55')]['id'];var _0x1311d6=_0x2b6756[_0x53ec('0x59')];var _0x1cc11d=0xc8;var _0x1c8acf=null;return db['sequelize'][_0x53ec('0xb4')]({'isolationLevel':db[_0x53ec('0xb5')][_0x53ec('0xb6')]['ISOLATION_LEVELS']['READ_COMMITTED']},function(_0xd4f97){return db[_0x53ec('0x3f')][_0x53ec('0x66')]({'where':{'id':_0x3ad15d},'transaction':_0xd4f97})['then'](function(_0x49e06e){if(_0x49e06e){return db[_0x53ec('0x73')][_0x53ec('0x3a')]({'where':{'SmsAccountId':_0x3ad15d},'transaction':_0xd4f97})['then'](function(){var _0x267eb8=_[_0x53ec('0x3e')](_0x1311d6,function(_0x23e0db){_0x23e0db[_0x53ec('0x63')]=_0x3ad15d;return _0x23e0db;});return db['SmsApplication'][_0x53ec('0xb7')](_0x267eb8,{'transaction':_0xd4f97});});}else{_0x1cc11d=0x194;_0x1c8acf=[];}});})['then'](function(){if(_0x1cc11d!==0x194){return db[_0x53ec('0x73')]['findAndCountAll']({'where':{'SmsAccountId':_0x3ad15d},'order':_0x53ec('0xb8')})[_0x53ec('0x36')](function(_0x574356){_0x1c8acf=_0x574356;});}})[_0x53ec('0x27')](function(_0x52d1c4){_0x1cc11d=0x1f4;logger[_0x53ec('0x24')](_0x52d1c4[_0x53ec('0x3b')]);if(_0x52d1c4[_0x53ec('0x43')]){delete _0x52d1c4[_0x53ec('0x43')];}_0x1c8acf=_0x52d1c4;})[_0x53ec('0xb9')](function(){if(_0x1c8acf===null){_0x1fc91b[_0x53ec('0x28')](_0x1cc11d);}else{if(_0x1cc11d===0x1f4){_0x1fc91b['status'](_0x1cc11d)['send'](_0x1c8acf);}else{_0x1fc91b[_0x53ec('0x29')](_0x1cc11d)[_0x53ec('0x31')](_0x1c8acf);}}});};exports[_0x53ec('0xba')]=function(_0x1fb2ec,_0x5029d6,_0x447b90){var _0x45e433={};var _0x3c468f={};var _0x18494c;var _0xe139ff;return db['SmsAccount'][_0x53ec('0x66')]({'where':{'id':_0x1fb2ec['params']['id']}})[_0x53ec('0x36')](handleEntityNotFound(_0x5029d6,null))['then'](function(_0x1502de){if(_0x1502de){_0x18494c=_0x1502de;_0x3c468f[_0x53ec('0x42')]=_[_0x53ec('0x56')](db['SmsApplication']['rawAttributes']);_0x3c468f['query']=_[_0x53ec('0x56')](_0x1fb2ec[_0x53ec('0x44')]);_0x3c468f[_0x53ec('0x45')]=_[_0x53ec('0x46')](_0x3c468f['model'],_0x3c468f[_0x53ec('0x44')]);_0x45e433[_0x53ec('0x47')]=_[_0x53ec('0x46')](_0x3c468f[_0x53ec('0x42')],qs['fields'](_0x1fb2ec[_0x53ec('0x44')][_0x53ec('0x48')]));_0x45e433[_0x53ec('0x47')]=_0x45e433[_0x53ec('0x47')][_0x53ec('0x68')]?_0x45e433[_0x53ec('0x47')]:_0x3c468f[_0x53ec('0x42')];_0x45e433[_0x53ec('0x4b')]=qs[_0x53ec('0x69')](_0x1fb2ec[_0x53ec('0x44')]['sort']);_0x45e433['where']=qs['filters'](_[_0x53ec('0x4c')](_0x1fb2ec[_0x53ec('0x44')],_0x3c468f[_0x53ec('0x45')]));if(_0x1fb2ec[_0x53ec('0x44')][_0x53ec('0x4d')]){_0x45e433[_0x53ec('0x4e')]=_[_0x53ec('0x6a')](_0x45e433[_0x53ec('0x4e')],{'$or':_['map'](_0x45e433[_0x53ec('0x47')],function(_0x1c154a){var _0x4219ef={};_0x4219ef[_0x1c154a]={'$like':'%'+_0x1fb2ec[_0x53ec('0x44')]['filter']+'%'};return _0x4219ef;})});}_0x45e433=_[_0x53ec('0x6a')]({},_0x45e433,_0x1fb2ec[_0x53ec('0x57')]);return _0x18494c[_0x53ec('0xba')](_0x45e433);}})[_0x53ec('0x36')](function(_0x10acb5){if(_0x10acb5){_0xe139ff=_0x10acb5[_0x53ec('0x68')];if(!_0x1fb2ec[_0x53ec('0x44')][_0x53ec('0x49')](_0x53ec('0x4a'))){_0x45e433[_0x53ec('0x2e')]=qs[_0x53ec('0x2e')](_0x1fb2ec[_0x53ec('0x44')][_0x53ec('0x2e')]);_0x45e433['offset']=qs[_0x53ec('0x2b')](_0x1fb2ec['query'][_0x53ec('0x2b')]);}return _0x18494c['getApplications'](_0x45e433);}})[_0x53ec('0x36')](function(_0x468f5b){if(_0x468f5b){return _0x468f5b?{'count':_0xe139ff,'rows':_0x468f5b}:null;}})[_0x53ec('0x36')](respondWithResult(_0x5029d6,null))[_0x53ec('0x27')](handleError(_0x5029d6,null));};exports[_0x53ec('0xbb')]=function(_0x37a116,_0x49049a,_0x1a4f01){var _0x2cc4a2={'raw':![],'where':{}};var _0x4f49b9={};var _0x52cb50={'count':0x0,'rows':[]};return db[_0x53ec('0x3f')][_0x53ec('0x66')]({'where':{'id':_0x37a116[_0x53ec('0x55')]['id']}})[_0x53ec('0x36')](handleEntityNotFound(_0x49049a,null))['then'](function(_0x1c5bd8){if(_0x1c5bd8){_0x4f49b9[_0x53ec('0x42')]=_[_0x53ec('0x56')](db['SmsInteraction'][_0x53ec('0x67')]);_0x4f49b9['query']=_[_0x53ec('0x56')](_0x37a116['query']);_0x4f49b9['filters']=_[_0x53ec('0x46')](_0x4f49b9[_0x53ec('0x42')],_0x4f49b9[_0x53ec('0x44')]);_0x2cc4a2[_0x53ec('0x47')]=_[_0x53ec('0x46')](_0x4f49b9[_0x53ec('0x42')],qs[_0x53ec('0x48')](_0x37a116['query']['fields']));_0x2cc4a2['attributes']=_0x2cc4a2[_0x53ec('0x47')][_0x53ec('0x68')]?_0x2cc4a2['attributes']:_0x4f49b9['model'];if(!_0x37a116[_0x53ec('0x44')]['hasOwnProperty'](_0x53ec('0x4a'))){_0x2cc4a2[_0x53ec('0x2e')]=qs['limit'](_0x37a116[_0x53ec('0x44')][_0x53ec('0x2e')]);_0x2cc4a2[_0x53ec('0x2b')]=qs[_0x53ec('0x2b')](_0x37a116[_0x53ec('0x44')]['offset']);}_0x2cc4a2['order']=qs['sort'](_0x37a116[_0x53ec('0x44')][_0x53ec('0x69')]);_0x2cc4a2[_0x53ec('0x4e')]=qs[_0x53ec('0x45')](_[_0x53ec('0x4c')](_0x37a116[_0x53ec('0x44')],_0x4f49b9[_0x53ec('0x45')]));_0x2cc4a2['where'][_0x53ec('0x63')]=_0x1c5bd8['id'];if(_0x37a116[_0x53ec('0x44')]['filter']){_0x2cc4a2[_0x53ec('0x4e')]=_['merge'](_0x2cc4a2[_0x53ec('0x4e')],{'$or':_[_0x53ec('0x3e')](_0x2cc4a2[_0x53ec('0x47')],function(_0x3e6118){var _0x52c0b8={};_0x52c0b8[_0x3e6118]={'$like':'%'+_0x37a116[_0x53ec('0x44')]['filter']+'%'};return _0x52c0b8;})});}_0x2cc4a2=_['merge']({},_0x2cc4a2,_0x37a116[_0x53ec('0x57')]);return db[_0x53ec('0x9d')][_0x53ec('0x2d')]({'where':_0x2cc4a2[_0x53ec('0x4e')]})[_0x53ec('0x36')](function(_0x15b574){_0x52cb50['count']=_0x15b574;if(_0x37a116[_0x53ec('0x44')][_0x53ec('0x50')]){_0x2cc4a2[_0x53ec('0x51')]=[{'model':db[_0x53ec('0x79')],'as':'Contact','required':![]},{'model':db[_0x53ec('0xa8')],'as':'Owner','attributes':['name',_0x53ec('0xbc'),_0x53ec('0xbd')],'required':![]},{'model':db[_0x53ec('0xbe')],'as':_0x53ec('0xbf'),'attributes':['id','name',_0x53ec('0xc0')],'where':_0x37a116[_0x53ec('0x44')][_0x53ec('0xc1')]?{'id':_0x37a116[_0x53ec('0x44')][_0x53ec('0xc1')]}:undefined,'required':_0x37a116[_0x53ec('0x44')][_0x53ec('0xc1')]?!![]:![]}];}return db[_0x53ec('0x9d')][_0x53ec('0x52')](_0x2cc4a2);})[_0x53ec('0x36')](function(_0x312a33){_0x52cb50['rows']=_0x312a33;return _0x52cb50;});}})[_0x53ec('0x36')](respondWithFilteredResult(_0x49049a,_0x2cc4a2))[_0x53ec('0x27')](handleError(_0x49049a,null));};exports['send']=function(_0x4d3204,_0x2e3322,_0x21aef2){var _0x33296b,_0x472751,_0x4cc884;if(_[_0x53ec('0x92')](_0x4d3204[_0x53ec('0x59')]['body'])||_0x4d3204[_0x53ec('0x59')]['body']===''){throw new db[(_0x53ec('0x7a'))][(_0x53ec('0x93'))](_0x53ec('0x95'));}if(_['isNil'](_0x4d3204[_0x53ec('0x59')]['to'])){throw new db['Sequelize'][(_0x53ec('0x93'))]('to\x20is\x20mandatory');}_0x33296b=_0x4d3204[_0x53ec('0x59')]['to'];return db[_0x53ec('0x3f')][_0x53ec('0x60')]({'where':{'id':_0x4d3204['params']['id']},'include':[{'model':db[_0x53ec('0xc2')],'as':'List','include':[{'model':db['CmContact'],'as':'Contacts','where':{'mobile':_0x33296b},'limit':0x1,'order':[[_0x53ec('0x7d'),_0x53ec('0x99')]]}]}]})[_0x53ec('0x36')](handleEntityNotFound(_0x2e3322,null))[_0x53ec('0x36')](function(_0x3e550f){if(_0x3e550f&&_0x3e550f['List']){_0x472751=_0x3e550f[_0x53ec('0x37')]({'plain':!![]});if(_0x472751[_0x53ec('0xc3')]&&_0x472751['List'][_0x53ec('0x98')][_0x53ec('0x68')]){return _0x472751[_0x53ec('0xc3')][_0x53ec('0x98')][0x0];}return db[_0x53ec('0x79')][_0x53ec('0x58')](_[_0x53ec('0x19')](_0x4d3204[_0x53ec('0x59')],{'firstName':_0x33296b,'mobile':_0x33296b,'phone':_0x33296b,'ListId':_0x472751['ListId']}));}})[_0x53ec('0x36')](handleEntityNotFound(_0x2e3322,null))[_0x53ec('0x36')](function(_0x4b67f5){if(_0x4b67f5){_0x4cc884=_0x4b67f5;return db['SmsInteraction'][_0x53ec('0x60')]({'where':{'ContactId':_0x4cc884['id'],'closed':![],'SmsAccountId':_0x472751['id']}})[_0x53ec('0x36')](function(_0x5106fb){if(_0x5106fb){return[_0x5106fb,![]];}return db[_0x53ec('0x9d')][_0x53ec('0x58')]({'UserId':_0x4d3204[_0x53ec('0xc4')]['id'],'ContactId':_0x4cc884['id'],'SmsAccountId':_0x472751['id'],'phone':_0x33296b,'firstMsgDirection':'out','Messages':[_['merge'](_0x4d3204['body'],{'read':![],'body':_0x4d3204[_0x53ec('0x59')][_0x53ec('0x59')],'phone':_0x33296b,'SmsAccountId':_0x472751['id'],'UserId':_0x4d3204['user']['id'],'ContactId':_0x4cc884['id']})]},{'include':[{'model':db['SmsMessage'],'as':'Messages'}]})[_0x53ec('0x36')](function(_0x2c1d07){return[_0x2c1d07,!![]];});});}})['spread'](function(_0x1352a8,_0x585dac){if(_0x585dac){return _0x1352a8;}return db[_0x53ec('0xa4')][_0x53ec('0x58')](_[_0x53ec('0x6a')](_0x4d3204[_0x53ec('0x59')],{'read':![],'body':_0x4d3204[_0x53ec('0x59')][_0x53ec('0x59')],'phone':_0x33296b,'SmsAccountId':_0x472751['id'],'SmsInteractionId':_0x1352a8['id'],'UserId':_0x4d3204[_0x53ec('0xc4')]['id'],'ContactId':_0x4cc884['id']}))[_0x53ec('0x36')](function(_0x2a7cbe){_0x1352a8[_0x53ec('0xc5')][_0x53ec('0xc6')]=[];_0x1352a8[_0x53ec('0xc5')][_0x53ec('0xc6')][_0x53ec('0xa0')](_0x2a7cbe['dataValues']);return _0x1352a8;});})[_0x53ec('0x36')](respondWithResult(_0x2e3322,null))[_0x53ec('0x27')](handleError(_0x2e3322,null));};exports[_0x53ec('0x29')]=function(_0x12ed40,_0x398ec1,_0x44c280){if(_0x12ed40[_0x53ec('0x59')]['id']){delete _0x12ed40[_0x53ec('0x59')]['id'];}var _0x2fa6d6,_0x2e0ad0,_0x5f1c09;return db[_0x53ec('0x3f')][_0x53ec('0x60')]({'where':{'id':_0x12ed40[_0x53ec('0x55')]['id']}})['then'](handleEntityNotFound(_0x398ec1,null))['then'](function(_0x536550){if(_0x536550){_0x5f1c09=_0x536550;logger[_0x53ec('0x20')](_0x53ec('0x21'),_0x53ec('0x29'),_0x53ec('0xc7'),_0x536550[_0x53ec('0x4f')],util[_0x53ec('0xc8')](_0x12ed40[_0x53ec('0x59')],{'showHidden':![],'depth':null}));switch(_0x536550[_0x53ec('0x4f')]){case'skebby':if(_0x12ed40[_0x53ec('0x59')][_0x53ec('0xc9')]&&_0x12ed40['body'][_0x53ec('0x29')]){_0x2e0ad0=_0x12ed40[_0x53ec('0x59')][_0x53ec('0x29')];return db[_0x53ec('0xa4')][_0x53ec('0x60')]({'where':{'messageId':_0x12ed40['body'][_0x53ec('0xc9')]}});}break;case _0x53ec('0xca'):if(_0x12ed40[_0x53ec('0x59')][_0x53ec('0xcb')]&&_0x12ed40[_0x53ec('0x59')][_0x53ec('0xcc')]){_0x2e0ad0=_0x12ed40['body'][_0x53ec('0xcc')];return db[_0x53ec('0xa4')]['find']({'where':{'messageId':_0x12ed40[_0x53ec('0x59')][_0x53ec('0xcb')]}});}break;case _0x53ec('0x8a'):if(_0x12ed40[_0x53ec('0x59')][_0x53ec('0xcd')]&&_0x12ed40[_0x53ec('0x59')][_0x53ec('0xce')]){_0x2e0ad0=_0x12ed40['body'][_0x53ec('0xce')];return db[_0x53ec('0xa4')][_0x53ec('0x60')]({'where':{'messageId':_0x12ed40[_0x53ec('0x59')][_0x53ec('0xcd')]}});}break;case _0x53ec('0xcf'):var _0x55d984=_0x12ed40[_0x53ec('0x59')][_0x53ec('0x8c')][0x0];if(_0x55d984[_0x53ec('0x84')]&&_0x55d984[_0x53ec('0x29')]['groupName']===_0x53ec('0xd0')){_0x2e0ad0=_0x55d984[_0x53ec('0x29')][_0x53ec('0xd1')];return db['SmsMessage']['find']({'where':{'messageId':_0x55d984['messageId']}});}break;case'clickatell':if(_0x12ed40[_0x53ec('0x59')][_0x53ec('0x84')]&&_0x12ed40[_0x53ec('0x59')][_0x53ec('0x29')]){_0x2e0ad0=_0x12ed40['body'][_0x53ec('0x29')];return db[_0x53ec('0xa4')]['find']({'where':{'messageId':_0x12ed40['body']['messageId']}});}break;case _0x53ec('0x91'):if(_0x12ed40[_0x53ec('0x59')][0x0][_0x53ec('0x25')]['id']){_0x2e0ad0=_0x12ed40[_0x53ec('0x59')][0x0][_0x53ec('0x4f')];return db[_0x53ec('0xa4')][_0x53ec('0x60')]({'where':{'messageId':_0x12ed40[_0x53ec('0x59')][0x0][_0x53ec('0x25')]['id']}});}break;case _0x53ec('0xd2'):if(_0x12ed40[_0x53ec('0x59')][_0x53ec('0xd3')]&&_0x12ed40[_0x53ec('0x59')][_0x53ec('0x29')]){_0x2e0ad0=_0x12ed40[_0x53ec('0x59')][_0x53ec('0x29')];return db['SmsMessage']['find']({'where':{'messageId':_0x12ed40[_0x53ec('0x59')][_0x53ec('0xd3')]}});}break;}}})['then'](handleEntityNotFound(_0x398ec1,null))[_0x53ec('0x36')](function(_0x59aa28){if(_0x59aa28){_0x2fa6d6=_0x59aa28;switch(_0x5f1c09['type']){case _0x53ec('0x86'):if(_0x2e0ad0===_0x53ec('0xd0')){return _0x2fa6d6['update']({'read':!![]});}else{logger[_0x53ec('0x24')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x53ec('0x29'),'skebby',util[_0x53ec('0xc8')](_0x12ed40[_0x53ec('0x59')],{'showHidden':![],'depth':null}));}break;case _0x53ec('0xca'):if(_0x2e0ad0==='1'){return _0x2fa6d6[_0x53ec('0x35')]({'read':!![]});}else{logger[_0x53ec('0x24')](_0x53ec('0x21'),_0x53ec('0x29'),_0x53ec('0x86'),util[_0x53ec('0xc8')](_0x12ed40[_0x53ec('0x59')],{'showHidden':![],'depth':null}));}break;case _0x53ec('0x8a'):if(!_0x12ed40[_0x53ec('0x59')][_0x53ec('0xd4')]&&_0x2e0ad0>=0xc8&&_0x2e0ad0<=0xce){return _0x2fa6d6[_0x53ec('0x35')]({'read':!![]});}else{logger[_0x53ec('0x24')](_0x53ec('0x21'),'status',_0x53ec('0x8a'),util[_0x53ec('0xc8')](_0x12ed40[_0x53ec('0x59')],{'showHidden':![],'depth':null}));}break;case _0x53ec('0xcf'):var _0x4f4f77=_0x12ed40[_0x53ec('0x59')][_0x53ec('0x8c')][0x0];if(_0x4f4f77[_0x53ec('0x29')]['groupName']===_0x53ec('0xd0')){return _0x2fa6d6[_0x53ec('0x35')]({'read':!![]});}else{logger[_0x53ec('0x24')](_0x53ec('0x21'),'status',_0x53ec('0xcf'),util['inspect'](_0x12ed40['body'],{'showHidden':![],'depth':null}));}break;case _0x53ec('0x8f'):if(_0x2e0ad0==_0x53ec('0xd5')||_0x2e0ad0=='RECEIVED_BY_RECIPIENT'){return _0x2fa6d6[_0x53ec('0x35')]({'read':!![]});}else{logger[_0x53ec('0x24')](_0x53ec('0x21'),'status','clickatell',util[_0x53ec('0xc8')](_0x12ed40[_0x53ec('0x59')],{'showHidden':![],'depth':null}));}break;case _0x53ec('0x91'):if(_0x2e0ad0==_0x53ec('0xd6')){return _0x2fa6d6['update']({'read':!![]});}else{logger[_0x53ec('0x24')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x53ec('0x29'),_0x53ec('0x91'),util['inspect'](_0x12ed40['body'],{'showHidden':![],'depth':null}));}break;case'intelepeer':if(_0x2e0ad0===_0x53ec('0xd7')||_0x2e0ad0===_0x53ec('0xd8')){return _0x2fa6d6[_0x53ec('0x35')]({'read':!![]});}else{logger[_0x53ec('0x24')](_0x53ec('0x21'),_0x53ec('0x29'),'intelepeer',util[_0x53ec('0xc8')](_0x12ed40[_0x53ec('0x59')],{'showHidden':![],'depth':null}));}break;}return _0x2fa6d6;}})[_0x53ec('0x36')](respondWithResult(_0x398ec1,null))[_0x53ec('0x27')](handleError(_0x398ec1,null));};exports[_0x53ec('0xd9')]=function(_0x4f62c4,_0x573f2b,_0x303f69){var _0x31848a,_0x401c94,_0x347238;return db[_0x53ec('0x3f')]['find']({'where':{'id':_0x4f62c4['params']['id']}})[_0x53ec('0x36')](handleEntityNotFound(_0x573f2b,null))[_0x53ec('0x36')](function(_0x35baed){if(_0x35baed){_0x347238=_0x35baed;logger[_0x53ec('0x20')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x53ec('0x29'),_0x53ec('0xc7'),_0x35baed[_0x53ec('0x4f')],util[_0x53ec('0xc8')](_0x4f62c4[_0x53ec('0x44')],{'showHidden':![],'depth':null}));switch(_0x35baed[_0x53ec('0x4f')]){case'csc':if(_0x4f62c4[_0x53ec('0x44')]['message-id']&&_0x4f62c4[_0x53ec('0x44')]['state']){_0x401c94=_0x4f62c4[_0x53ec('0x44')][_0x53ec('0xda')];return db[_0x53ec('0xa4')][_0x53ec('0x60')]({'where':{'messageId':_0x4f62c4['query'][_0x53ec('0xdb')]}});}break;}}})[_0x53ec('0x36')](handleEntityNotFound(_0x573f2b,null))[_0x53ec('0x36')](function(_0x2d6e9c){if(_0x2d6e9c){_0x31848a=_0x2d6e9c;switch(_0x347238[_0x53ec('0x4f')]){case'csc':if(_0x401c94==='2'||_0x401c94==='6'){return _0x31848a[_0x53ec('0x35')]({'read':!![]});}else{logger[_0x53ec('0x24')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x53ec('0x29'),_0x53ec('0x8d'),util[_0x53ec('0xc8')](_0x4f62c4['query'],{'showHidden':![],'depth':null}));};break;}return _0x31848a;}})[_0x53ec('0x36')](respondWithResult(_0x573f2b,null))[_0x53ec('0x27')](handleError(_0x573f2b,null));};exports['addAgents']=function(_0x94f403,_0x36df7b,_0x5c4dd4){return db[_0x53ec('0x3f')][_0x53ec('0x60')]({'where':{'id':_0x94f403[_0x53ec('0x55')]['id']}})[_0x53ec('0x36')](handleEntityNotFound(_0x36df7b,null))['then'](function(_0x342665){if(_0x342665){return _0x342665[_0x53ec('0xdc')](_0x94f403[_0x53ec('0x59')][_0x53ec('0x6c')],_[_0x53ec('0x9b')](_0x94f403[_0x53ec('0x59')],['ids','id'])||{})[_0x53ec('0x9e')](function(_0x230fa5){for(var _0x179ae8=0x0;_0x179ae8<_0x94f403[_0x53ec('0x59')][_0x53ec('0x6c')][_0x53ec('0x68')];_0x179ae8+=0x1){socket['emit']('userSmsAccount:save',{'UserId':Number(_0x94f403['body'][_0x53ec('0x6c')][_0x179ae8]),'SmsAccountId':Number(_0x94f403[_0x53ec('0x55')]['id'])});}return _0x230fa5;});}})[_0x53ec('0x36')](respondWithResult(_0x36df7b,null))[_0x53ec('0x27')](handleError(_0x36df7b,null));};exports['removeAgents']=function(_0x4e403d,_0x5ace6a,_0x5367b7){return db[_0x53ec('0x3f')]['find']({'where':{'id':_0x4e403d[_0x53ec('0x55')]['id']}})[_0x53ec('0x36')](handleEntityNotFound(_0x5ace6a,null))[_0x53ec('0x36')](function(_0x2392f9){if(_0x2392f9){return _0x2392f9[_0x53ec('0xdd')](_0x4e403d['query']['ids'])[_0x53ec('0x36')](function(){if(_[_0x53ec('0xde')](_0x4e403d[_0x53ec('0x44')]['ids'])){for(var _0x53c823=0x0;_0x53c823<_0x4e403d[_0x53ec('0x44')][_0x53ec('0x6c')][_0x53ec('0x68')];_0x53c823+=0x1){socket['emit'](_0x53ec('0xdf'),{'UserId':Number(_0x4e403d[_0x53ec('0x44')][_0x53ec('0x6c')][_0x53c823]),'SmsAccountId':Number(_0x4e403d[_0x53ec('0x55')]['id'])});}}else{socket[_0x53ec('0xe0')](_0x53ec('0xdf'),{'UserId':Number(_0x4e403d[_0x53ec('0x44')]['ids']),'SmsAccountId':Number(_0x4e403d[_0x53ec('0x55')]['id'])});}});}})[_0x53ec('0x36')](respondWithStatusCode(_0x5ace6a,null))[_0x53ec('0x27')](handleError(_0x5ace6a,null));};exports[_0x53ec('0xe1')]=function(_0x779083,_0x3834eb,_0xc2e031){var _0x5e3572={};var _0x3d611b={};var _0x2cb5cd;var _0x21c4c3;return db['SmsAccount'][_0x53ec('0x66')]({'where':{'id':_0x779083[_0x53ec('0x55')]['id']}})[_0x53ec('0x36')](handleEntityNotFound(_0x3834eb,null))['then'](function(_0x588735){if(_0x588735){_0x2cb5cd=_0x588735;_0x3d611b['model']=_[_0x53ec('0x56')](db[_0x53ec('0xa8')][_0x53ec('0x67')]);_0x3d611b[_0x53ec('0x44')]=_[_0x53ec('0x56')](_0x779083['query']);_0x3d611b[_0x53ec('0x45')]=_[_0x53ec('0x46')](_0x3d611b[_0x53ec('0x42')],_0x3d611b[_0x53ec('0x44')]);_0x5e3572['attributes']=_['intersection'](_0x3d611b[_0x53ec('0x42')],qs[_0x53ec('0x48')](_0x779083['query'][_0x53ec('0x48')]));_0x5e3572[_0x53ec('0x47')]=_0x5e3572['attributes']['length']?_0x5e3572[_0x53ec('0x47')]:_0x3d611b[_0x53ec('0x42')];_0x5e3572['order']=qs[_0x53ec('0x69')](_0x779083[_0x53ec('0x44')][_0x53ec('0x69')]);_0x5e3572['where']=qs['filters'](_[_0x53ec('0x4c')](_0x779083[_0x53ec('0x44')],_0x3d611b[_0x53ec('0x45')]));if(_0x779083[_0x53ec('0x44')][_0x53ec('0x4d')]){_0x5e3572[_0x53ec('0x4e')]=_[_0x53ec('0x6a')](_0x5e3572[_0x53ec('0x4e')],{'$or':_[_0x53ec('0x3e')](_0x5e3572[_0x53ec('0x47')],function(_0x39c432){var _0x202d8d={};_0x202d8d[_0x39c432]={'$like':'%'+_0x779083['query'][_0x53ec('0x4d')]+'%'};return _0x202d8d;})});}_0x5e3572=_['merge']({},_0x5e3572,_0x779083[_0x53ec('0x57')]);return _0x2cb5cd[_0x53ec('0xe1')](_0x5e3572);}})[_0x53ec('0x36')](function(_0x11f0c5){if(_0x11f0c5){_0x21c4c3=_0x11f0c5['length'];if(!_0x779083[_0x53ec('0x44')][_0x53ec('0x49')](_0x53ec('0x4a'))){_0x5e3572[_0x53ec('0x2e')]=qs[_0x53ec('0x2e')](_0x779083[_0x53ec('0x44')]['limit']);_0x5e3572['offset']=qs[_0x53ec('0x2b')](_0x779083[_0x53ec('0x44')][_0x53ec('0x2b')]);}return _0x2cb5cd[_0x53ec('0xe1')](_0x5e3572);}})[_0x53ec('0x36')](function(_0x415e63){if(_0x415e63){return _0x415e63?{'count':_0x21c4c3,'rows':_0x415e63}:null;}})['then'](respondWithResult(_0x3834eb,null))['catch'](handleError(_0x3834eb,null));};
\ No newline at end of file
index 722aff4..f7d8b93 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xba65=['hook','SmsAccount','save','update','emit','hasOwnProperty'];(function(_0x43cc8b,_0x5ce84b){var _0x3dbff9=function(_0x3bf7a4){while(--_0x3bf7a4){_0x43cc8b['push'](_0x43cc8b['shift']());}};_0x3dbff9(++_0x5ce84b);}(_0xba65,0x8b));var _0x5ba6=function(_0x42bafd,_0x3f0fe3){_0x42bafd=_0x42bafd-0x0;var _0x2ed705=_0xba65[_0x42bafd];return _0x2ed705;};'use strict';var EventEmitter=require('events');var SmsAccount=require('../../mysqldb')['db'][_0x5ba6('0x0')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x5ba6('0x1'),'afterUpdate':_0x5ba6('0x2'),'afterDestroy':'remove'};function emitEvent(_0x27ffcc){return function(_0x37e0dc,_0x27a88e,_0x588bcc){SmsAccountEvents[_0x5ba6('0x3')](_0x27ffcc+':'+_0x37e0dc['id'],_0x37e0dc);SmsAccountEvents[_0x5ba6('0x3')](_0x27ffcc,_0x37e0dc);_0x588bcc(null);};}for(var e in events){if(events[_0x5ba6('0x4')](e)){var event=events[e];SmsAccount[_0x5ba6('0x5')](e,emitEvent(event));}}module['exports']=SmsAccountEvents;
\ No newline at end of file
+var _0x725e=['emit','hasOwnProperty','hook','exports','SmsAccount','setMaxListeners','update'];(function(_0x4a96ef,_0x5c1383){var _0x330714=function(_0x1bc221){while(--_0x1bc221){_0x4a96ef['push'](_0x4a96ef['shift']());}};_0x330714(++_0x5c1383);}(_0x725e,0x1ee));var _0xe725=function(_0x2f21ad,_0x5a2d09){_0x2f21ad=_0x2f21ad-0x0;var _0x3f56d3=_0x725e[_0x2f21ad];return _0x3f56d3;};'use strict';var EventEmitter=require('events');var SmsAccount=require('../../mysqldb')['db'][_0xe725('0x0')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0xe725('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0xe725('0x2'),'afterDestroy':'remove'};function emitEvent(_0x46f8f0){return function(_0x2cd64b,_0x30a1d6,_0x5b74e7){SmsAccountEvents['emit'](_0x46f8f0+':'+_0x2cd64b['id'],_0x2cd64b);SmsAccountEvents[_0xe725('0x3')](_0x46f8f0,_0x2cd64b);_0x5b74e7(null);};}for(var e in events){if(events[_0xe725('0x4')](e)){var event=events[e];SmsAccount[_0xe725('0x5')](e,emitEvent(event));}}module[_0xe725('0x6')]=SmsAccountEvents;
\ No newline at end of file
index a7e6695..83edbad 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe63c=['request-promise','./smsAccount.attributes','SmsAccount','lodash','util','api','moment','bluebird'];(function(_0x421c56,_0x4efd00){var _0x49b244=function(_0x5cd079){while(--_0x5cd079){_0x421c56['push'](_0x421c56['shift']());}};_0x49b244(++_0x4efd00);}(_0xe63c,0xc3));var _0xce63=function(_0xa82c60,_0x3f05bf){_0xa82c60=_0xa82c60-0x0;var _0x291fef=_0xe63c[_0xa82c60];return _0x291fef;};'use strict';var _=require(_0xce63('0x0'));var util=require(_0xce63('0x1'));var logger=require('../../config/logger')(_0xce63('0x2'));var moment=require(_0xce63('0x3'));var BPromise=require(_0xce63('0x4'));var rp=require(_0xce63('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xce63('0x6'));module['exports']=function(_0xc94b4b,_0x24a824){return _0xc94b4b['define'](_0xce63('0x7'),attributes,{'tableName':'sms_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa55c=['api','request-promise','path','rimraf','./smsAccount.attributes','exports','define','SmsAccount','sms_accounts','lodash','util','../../config/logger'];(function(_0x388da2,_0x571cad){var _0x2b1a45=function(_0x10f0e2){while(--_0x10f0e2){_0x388da2['push'](_0x388da2['shift']());}};_0x2b1a45(++_0x571cad);}(_0xa55c,0x69));var _0xca55=function(_0x2d5d40,_0x4e4f9c){_0x2d5d40=_0x2d5d40-0x0;var _0x489833=_0xa55c[_0x2d5d40];return _0x489833;};'use strict';var _=require(_0xca55('0x0'));var util=require(_0xca55('0x1'));var logger=require(_0xca55('0x2'))(_0xca55('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xca55('0x4'));var fs=require('fs');var path=require(_0xca55('0x5'));var rimraf=require(_0xca55('0x6'));var config=require('../../config/environment');var attributes=require(_0xca55('0x7'));module[_0xca55('0x8')]=function(_0x20701f,_0x1ff8e9){return _0x20701f[_0xca55('0x9')](_0xca55('0xa'),attributes,{'tableName':_0xca55('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 138660a..783af49 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaa93=['../../config/environment','jayson/promise','client','http','defaults','redis','localhost','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','ShowSmsAccount','find','options','attributes','include','map','model','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc'];(function(_0x1785e8,_0x492aac){var _0x5e6021=function(_0x312e79){while(--_0x312e79){_0x1785e8['push'](_0x1785e8['shift']());}};_0x5e6021(++_0x492aac);}(_0xaa93,0x19c));var _0x3aa9=function(_0x584088,_0x3da671){_0x584088=_0x584088-0x0;var _0x39e62a=_0xaa93[_0x584088];return _0x39e62a;};'use strict';var _=require(_0x3aa9('0x0'));var util=require(_0x3aa9('0x1'));var moment=require(_0x3aa9('0x2'));var BPromise=require(_0x3aa9('0x3'));var rs=require(_0x3aa9('0x4'));var fs=require('fs');var Redis=require(_0x3aa9('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x3aa9('0x6'));var logger=require('../../config/logger')(_0x3aa9('0x7'));var config=require(_0x3aa9('0x8'));var jayson=require(_0x3aa9('0x9'));var client=jayson[_0x3aa9('0xa')][_0x3aa9('0xb')]({'port':0x232a});config['redis']=_[_0x3aa9('0xc')](config[_0x3aa9('0xd')],{'host':_0x3aa9('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3aa9('0xd')]));require('./smsAccount.socket')['register'](socket);function respondWithRpcPromise(_0x13dd63,_0x335623,_0x152c83){return new BPromise(function(_0xe863f1,_0x22b7a8){return client[_0x3aa9('0xf')](_0x13dd63,_0x152c83)[_0x3aa9('0x10')](function(_0x6e2b9){logger[_0x3aa9('0x11')](_0x3aa9('0x12'),_0x335623,_0x3aa9('0x13'));logger[_0x3aa9('0x14')](_0x3aa9('0x15'),_0x335623,'request\x20sent',JSON['stringify'](_0x6e2b9));if(_0x6e2b9[_0x3aa9('0x16')]){if(_0x6e2b9['error'][_0x3aa9('0x17')]===0x1f4){logger[_0x3aa9('0x16')](_0x3aa9('0x12'),_0x335623,_0x6e2b9[_0x3aa9('0x16')][_0x3aa9('0x18')]);return _0x22b7a8(_0x6e2b9[_0x3aa9('0x16')][_0x3aa9('0x18')]);}logger['error'](_0x3aa9('0x12'),_0x335623,_0x6e2b9['error']['message']);return _0xe863f1(_0x6e2b9[_0x3aa9('0x16')][_0x3aa9('0x18')]);}else{logger['info']('SmsAccount,\x20%s,\x20%s',_0x335623,_0x3aa9('0x13'));_0xe863f1(_0x6e2b9[_0x3aa9('0x19')][_0x3aa9('0x18')]);}})[_0x3aa9('0x1a')](function(_0x5f3d06){logger[_0x3aa9('0x16')](_0x3aa9('0x12'),_0x335623,_0x5f3d06);_0x22b7a8(_0x5f3d06);});});}exports[_0x3aa9('0x1b')]=function(_0x5cea24){var _0x5873eb=this;return new Promise(function(_0x7a1d89,_0x1f5e0f){return db['SmsAccount'][_0x3aa9('0x1c')]({'raw':_0x5cea24[_0x3aa9('0x1d')]?_0x5cea24[_0x3aa9('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x5cea24[_0x3aa9('0x1d')]?_0x5cea24[_0x3aa9('0x1d')]['where']||null:null,'attributes':_0x5cea24[_0x3aa9('0x1d')]?_0x5cea24[_0x3aa9('0x1d')][_0x3aa9('0x1e')]||null:null,'include':_0x5cea24['options']?_0x5cea24[_0x3aa9('0x1d')][_0x3aa9('0x1f')]?_[_0x3aa9('0x20')](_0x5cea24[_0x3aa9('0x1d')][_0x3aa9('0x1f')],function(_0x1b1c72){return{'model':db[_0x1b1c72['model']],'as':_0x1b1c72['as'],'attributes':_0x1b1c72[_0x3aa9('0x1e')],'include':_0x1b1c72['include']?_[_0x3aa9('0x20')](_0x1b1c72[_0x3aa9('0x1f')],function(_0x59838a){return{'model':db[_0x59838a[_0x3aa9('0x21')]],'as':_0x59838a['as'],'attributes':_0x59838a[_0x3aa9('0x1e')],'include':_0x59838a['include']?_['map'](_0x59838a[_0x3aa9('0x1f')],function(_0x42d94d){return{'model':db[_0x42d94d[_0x3aa9('0x21')]],'as':_0x42d94d['as'],'attributes':_0x42d94d[_0x3aa9('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x3aa9('0x10')](function(_0xf8ab0c){logger[_0x3aa9('0x11')](_0x3aa9('0x1b'),_0x5cea24);logger[_0x3aa9('0x14')]('ShowSmsAccount',_0x5cea24,JSON[_0x3aa9('0x22')](_0xf8ab0c));_0x7a1d89(_0xf8ab0c);})[_0x3aa9('0x1a')](function(_0x2fc058){logger[_0x3aa9('0x16')](_0x3aa9('0x1b'),_0x2fc058[_0x3aa9('0x18')],_0x5cea24);_0x1f5e0f(_0x5873eb[_0x3aa9('0x16')](0x1f4,_0x2fc058['message']));});});};
\ No newline at end of file
+var _0xc036=['catch','SmsAccount','find','options','where','attributes','map','include','model','ShowSmsAccount','bluebird','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','redis','defaults','localhost','./smsAccount.socket','register','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x5b4801,_0x5a2209){var _0x512826=function(_0xfd44eb){while(--_0xfd44eb){_0x5b4801['push'](_0x5b4801['shift']());}};_0x512826(++_0x5a2209);}(_0xc036,0x15e));var _0x6c03=function(_0xa4a9b3,_0x3b271c){_0xa4a9b3=_0xa4a9b3-0x0;var _0xb7a49e=_0xc036[_0xa4a9b3];return _0xb7a49e;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x6c03('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6c03('0x1'));var db=require(_0x6c03('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x6c03('0x3'))('rpc');var config=require('../../config/environment');var jayson=require(_0x6c03('0x4'));var client=jayson[_0x6c03('0x5')][_0x6c03('0x6')]({'port':0x232a});config[_0x6c03('0x7')]=_[_0x6c03('0x8')](config[_0x6c03('0x7')],{'host':_0x6c03('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6c03('0x7')]));require(_0x6c03('0xa'))[_0x6c03('0xb')](socket);function respondWithRpcPromise(_0x5ae37f,_0x5b30fa,_0x29384b){return new BPromise(function(_0xa834f1,_0xef46c9){return client[_0x6c03('0xc')](_0x5ae37f,_0x29384b)[_0x6c03('0xd')](function(_0x13783e){logger[_0x6c03('0xe')](_0x6c03('0xf'),_0x5b30fa,_0x6c03('0x10'));logger[_0x6c03('0x11')](_0x6c03('0x12'),_0x5b30fa,_0x6c03('0x10'),JSON[_0x6c03('0x13')](_0x13783e));if(_0x13783e[_0x6c03('0x14')]){if(_0x13783e[_0x6c03('0x14')][_0x6c03('0x15')]===0x1f4){logger['error'](_0x6c03('0xf'),_0x5b30fa,_0x13783e[_0x6c03('0x14')][_0x6c03('0x16')]);return _0xef46c9(_0x13783e[_0x6c03('0x14')][_0x6c03('0x16')]);}logger['error'](_0x6c03('0xf'),_0x5b30fa,_0x13783e[_0x6c03('0x14')][_0x6c03('0x16')]);return _0xa834f1(_0x13783e[_0x6c03('0x14')][_0x6c03('0x16')]);}else{logger['info'](_0x6c03('0xf'),_0x5b30fa,_0x6c03('0x10'));_0xa834f1(_0x13783e[_0x6c03('0x17')][_0x6c03('0x16')]);}})[_0x6c03('0x18')](function(_0x4cf608){logger[_0x6c03('0x14')]('SmsAccount,\x20%s,\x20%s',_0x5b30fa,_0x4cf608);_0xef46c9(_0x4cf608);});});}exports['ShowSmsAccount']=function(_0x24f4b3){var _0x49e8cd=this;return new Promise(function(_0x337d70,_0x2b3bb0){return db[_0x6c03('0x19')][_0x6c03('0x1a')]({'raw':_0x24f4b3['options']?_0x24f4b3[_0x6c03('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x24f4b3[_0x6c03('0x1b')]?_0x24f4b3[_0x6c03('0x1b')][_0x6c03('0x1c')]||null:null,'attributes':_0x24f4b3['options']?_0x24f4b3['options'][_0x6c03('0x1d')]||null:null,'include':_0x24f4b3[_0x6c03('0x1b')]?_0x24f4b3[_0x6c03('0x1b')]['include']?_[_0x6c03('0x1e')](_0x24f4b3[_0x6c03('0x1b')][_0x6c03('0x1f')],function(_0x3de394){return{'model':db[_0x3de394[_0x6c03('0x20')]],'as':_0x3de394['as'],'attributes':_0x3de394[_0x6c03('0x1d')],'include':_0x3de394['include']?_['map'](_0x3de394[_0x6c03('0x1f')],function(_0x3c9010){return{'model':db[_0x3c9010[_0x6c03('0x20')]],'as':_0x3c9010['as'],'attributes':_0x3c9010[_0x6c03('0x1d')],'include':_0x3c9010[_0x6c03('0x1f')]?_['map'](_0x3c9010[_0x6c03('0x1f')],function(_0x53d084){return{'model':db[_0x53d084['model']],'as':_0x53d084['as'],'attributes':_0x53d084['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x23aa10){logger['info'](_0x6c03('0x21'),_0x24f4b3);logger[_0x6c03('0x11')](_0x6c03('0x21'),_0x24f4b3,JSON[_0x6c03('0x13')](_0x23aa10));_0x337d70(_0x23aa10);})[_0x6c03('0x18')](function(_0x2a864b){logger[_0x6c03('0x14')](_0x6c03('0x21'),_0x2a864b[_0x6c03('0x16')],_0x24f4b3);_0x2b3bb0(_0x49e8cd['error'](0x1f4,_0x2a864b[_0x6c03('0x16')]));});});};
\ No newline at end of file
index 08b46f1..e4e806e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xa9e0[_0x4cf98e];return _0x1623ac;};'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(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0xa9e0[_0x5c351c];return _0x26f3b3;};'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 d1fc6eb..f3c5301 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x55ca=['update','delete','/:id','destroy','exports','multer','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','show','create'];(function(_0x34034f,_0x512882){var _0x1e2485=function(_0x5ef6d9){while(--_0x5ef6d9){_0x34034f['push'](_0x34034f['shift']());}};_0x1e2485(++_0x512882);}(_0x55ca,0x126));var _0xa55c=function(_0x5a27fe,_0x43993b){_0x5a27fe=_0x5a27fe-0x0;var _0x121c88=_0x55ca[_0x5a27fe];return _0x121c88;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var fs_extra=require(_0xa55c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var controller=require(_0xa55c('0x6'));router[_0xa55c('0x7')]('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0x9')]);router[_0xa55c('0x7')]('/:id',auth[_0xa55c('0x8')](),controller[_0xa55c('0xa')]);router['post']('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0xb')]);router['put']('/:id',auth[_0xa55c('0x8')](),controller[_0xa55c('0xc')]);router[_0xa55c('0xd')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xf')]);module[_0xa55c('0x10')]=router;
\ No newline at end of file
+var _0x008c=['exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','post','put','/:id'];(function(_0x468bc4,_0x24e709){var _0x5c0ce8=function(_0x33f7ad){while(--_0x33f7ad){_0x468bc4['push'](_0x468bc4['shift']());}};_0x5c0ce8(++_0x24e709);}(_0x008c,0x188));var _0xc008=function(_0x5e77db,_0x356d1c){_0x5e77db=_0x5e77db-0x0;var _0x34b675=_0x008c[_0x5e77db];return _0x34b675;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var fs_extra=require(_0xc008('0x5'));var auth=require(_0xc008('0x6'));var interaction=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var controller=require(_0xc008('0x9'));router[_0xc008('0xa')]('/',auth[_0xc008('0xb')](),controller[_0xc008('0xc')]);router[_0xc008('0xa')]('/:id',auth[_0xc008('0xb')](),controller['show']);router[_0xc008('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xc008('0xe')](_0xc008('0xf'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xc008('0xf'),auth[_0xc008('0xb')](),controller['destroy']);module[_0xc008('0x10')]=router;
\ No newline at end of file
index 38e7db5..cbcba06 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa021=['sequelize','exports','STRING','*,*,*,*'];(function(_0x4abd3b,_0x236a54){var _0x1e0cfc=function(_0x4715c1){while(--_0x4715c1){_0x4abd3b['push'](_0x4abd3b['shift']());}};_0x1e0cfc(++_0x236a54);}(_0xa021,0x9c));var _0x1a02=function(_0x4e6fb2,_0x3cf23e){_0x4e6fb2=_0x4e6fb2-0x0;var _0x2f1636=_0xa021[_0x4e6fb2];return _0x2f1636;};'use strict';var Sequelize=require(_0x1a02('0x0'));module[_0x1a02('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x1a02('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x1a02('0x2')]},'interval':{'type':Sequelize[_0x1a02('0x2')],'defaultValue':_0x1a02('0x3')}};
\ No newline at end of file
+var _0x98e0=['*,*,*,*','sequelize','STRING','noop'];(function(_0x47edc4,_0x550a5d){var _0x159758=function(_0x993c8a){while(--_0x993c8a){_0x47edc4['push'](_0x47edc4['shift']());}};_0x159758(++_0x550a5d);}(_0x98e0,0xa5));var _0x098e=function(_0x1ac3f8,_0x1bc731){_0x1ac3f8=_0x1ac3f8-0x0;var _0x327937=_0x98e0[_0x1ac3f8];return _0x327937;};'use strict';var Sequelize=require(_0x098e('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x098e('0x1')],'allowNull':![],'defaultValue':_0x098e('0x2')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x098e('0x1')]},'interval':{'type':Sequelize[_0x098e('0x1')],'defaultValue':_0x098e('0x3')}};
\ No newline at end of file
index e45e493..fe02aee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdd51=['index','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','SmsApplication','count','include','findAll','rows','catch','show','params','find','create','body','eml-format','rimraf','zip-dir','request-promise','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','offset','undefined','limit','set','Content-Range','json','reject','save','destroy','then','end','error','name','send'];(function(_0x4a28c3,_0x142914){var _0xecb9f8=function(_0x3b8ee3){while(--_0x3b8ee3){_0x4a28c3['push'](_0x4a28c3['shift']());}};_0xecb9f8(++_0x142914);}(_0xdd51,0x189));var _0x1dd5=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0xdd51[_0x334841];return _0x5beb4b;};'use strict';var emlformat=require(_0x1dd5('0x0'));var rimraf=require(_0x1dd5('0x1'));var zipdir=require(_0x1dd5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1dd5('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x1dd5('0x4'));var util=require(_0x1dd5('0x5'));var path=require(_0x1dd5('0x6'));var sox=require(_0x1dd5('0x7'));var csv=require('to-csv');var ejs=require(_0x1dd5('0x8'));var fs=require('fs');var fs_extra=require(_0x1dd5('0x9'));var _=require(_0x1dd5('0xa'));var squel=require(_0x1dd5('0xb'));var crypto=require(_0x1dd5('0xc'));var jsforce=require(_0x1dd5('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x1dd5('0xe'));var querystring=require(_0x1dd5('0xf'));var Papa=require(_0x1dd5('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x1dd5('0x11'));var as=require(_0x1dd5('0x12'));var hardwareService=require(_0x1dd5('0x13'));var logger=require('../../config/logger')(_0x1dd5('0x14'));var utils=require(_0x1dd5('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x1dd5('0x16'))['db'];function respondWithStatusCode(_0x271aa2,_0x25529a){_0x25529a=_0x25529a||0xcc;return function(_0x555f5e){if(_0x555f5e){return _0x271aa2[_0x1dd5('0x17')](_0x25529a);}return _0x271aa2[_0x1dd5('0x18')](_0x25529a)['end']();};}function respondWithResult(_0x143144,_0x44f5d4){_0x44f5d4=_0x44f5d4||0xc8;return function(_0x26059f){if(_0x26059f){return _0x143144['status'](_0x44f5d4)['json'](_0x26059f);}};}function respondWithFilteredResult(_0x14bca3,_0x3a6227){return function(_0x3c580f){if(_0x3c580f){var _0x91806d=typeof _0x3a6227[_0x1dd5('0x19')]===_0x1dd5('0x1a')&&typeof _0x3a6227[_0x1dd5('0x1b')]===_0x1dd5('0x1a');var _0x2f9340=_0x3c580f['count'];var _0x8d8804=_0x91806d?0x0:_0x3a6227[_0x1dd5('0x19')];var _0x31b80c=_0x91806d?_0x3c580f['count']:_0x3a6227[_0x1dd5('0x19')]+_0x3a6227[_0x1dd5('0x1b')];var _0x1843a4;if(_0x31b80c>=_0x2f9340){_0x31b80c=_0x2f9340;_0x1843a4=0xc8;}else{_0x1843a4=0xce;}_0x14bca3[_0x1dd5('0x18')](_0x1843a4);return _0x14bca3[_0x1dd5('0x1c')](_0x1dd5('0x1d'),_0x8d8804+'-'+_0x31b80c+'/'+_0x2f9340)[_0x1dd5('0x1e')](_0x3c580f);}return null;};}function patchUpdates(_0x5f056b){return function(_0x2c3f7b){try{jsonpatch['apply'](_0x2c3f7b,_0x5f056b,!![]);}catch(_0x5e1c9f){return BPromise[_0x1dd5('0x1f')](_0x5e1c9f);}return _0x2c3f7b[_0x1dd5('0x20')]();};}function saveUpdates(_0x2a5996,_0x598709){return function(_0x1cf307){if(_0x1cf307){return _0x1cf307['update'](_0x2a5996)['then'](function(_0x135ddc){return _0x135ddc;});}return null;};}function removeEntity(_0x16a3da,_0x27b2ec){return function(_0x23eb95){if(_0x23eb95){return _0x23eb95[_0x1dd5('0x21')]()[_0x1dd5('0x22')](function(){_0x16a3da[_0x1dd5('0x18')](0xcc)[_0x1dd5('0x23')]();});}};}function handleEntityNotFound(_0x4b91f2,_0xee35fe){return function(_0xc8dc37){if(!_0xc8dc37){_0x4b91f2['sendStatus'](0x194);}return _0xc8dc37;};}function handleError(_0x589316,_0x4603ea){_0x4603ea=_0x4603ea||0x1f4;return function(_0xfa3714){logger[_0x1dd5('0x24')](_0xfa3714['stack']);if(_0xfa3714[_0x1dd5('0x25')]){delete _0xfa3714[_0x1dd5('0x25')];}_0x589316['status'](_0x4603ea)[_0x1dd5('0x26')](_0xfa3714);};}exports[_0x1dd5('0x27')]=function(_0x2beda4,_0x43efbf){var _0x270f98={},_0x544059={},_0x40973a={'count':0x0,'rows':[]};var _0x354dd2=_['map'](db['SmsApplication'][_0x1dd5('0x28')],function(_0x285b3e){return{'name':_0x285b3e[_0x1dd5('0x29')],'type':_0x285b3e[_0x1dd5('0x2a')]['key']};});_0x544059[_0x1dd5('0x2b')]=_[_0x1dd5('0x2c')](_0x354dd2,_0x1dd5('0x25'));_0x544059[_0x1dd5('0x2d')]=_[_0x1dd5('0x2e')](_0x2beda4['query']);_0x544059[_0x1dd5('0x2f')]=_[_0x1dd5('0x30')](_0x544059['model'],_0x544059['query']);_0x270f98['attributes']=_['intersection'](_0x544059['model'],qs[_0x1dd5('0x31')](_0x2beda4[_0x1dd5('0x2d')]['fields']));_0x270f98[_0x1dd5('0x32')]=_0x270f98['attributes'][_0x1dd5('0x33')]?_0x270f98[_0x1dd5('0x32')]:_0x544059[_0x1dd5('0x2b')];if(!_0x2beda4['query'][_0x1dd5('0x34')]('nolimit')){_0x270f98['limit']=qs[_0x1dd5('0x1b')](_0x2beda4[_0x1dd5('0x2d')][_0x1dd5('0x1b')]);_0x270f98['offset']=qs[_0x1dd5('0x19')](_0x2beda4[_0x1dd5('0x2d')][_0x1dd5('0x19')]);}_0x270f98[_0x1dd5('0x35')]=qs[_0x1dd5('0x36')](_0x2beda4['query']['sort']);_0x270f98[_0x1dd5('0x37')]=qs[_0x1dd5('0x2f')](_[_0x1dd5('0x38')](_0x2beda4[_0x1dd5('0x2d')],_0x544059[_0x1dd5('0x2f')]),_0x354dd2);if(_0x2beda4['query']['filter']){_0x270f98[_0x1dd5('0x37')]=_[_0x1dd5('0x39')](_0x270f98[_0x1dd5('0x37')],{'$or':_[_0x1dd5('0x2c')](_0x354dd2,function(_0x3ab3d2){if(_0x3ab3d2['type']!==_0x1dd5('0x3a')){var _0x3e8515={};_0x3e8515[_0x3ab3d2[_0x1dd5('0x25')]]={'$like':'%'+_0x2beda4[_0x1dd5('0x2d')][_0x1dd5('0x3b')]+'%'};return _0x3e8515;}})});}_0x270f98=_['merge']({},_0x270f98,_0x2beda4[_0x1dd5('0x3c')]);var _0xe64cf5={'where':_0x270f98[_0x1dd5('0x37')]};return db[_0x1dd5('0x3d')]['count'](_0xe64cf5)[_0x1dd5('0x22')](function(_0x3924b9){_0x40973a[_0x1dd5('0x3e')]=_0x3924b9;if(_0x2beda4[_0x1dd5('0x2d')]['includeAll']){_0x270f98[_0x1dd5('0x3f')]=[{'all':!![]}];}return db['SmsApplication'][_0x1dd5('0x40')](_0x270f98);})[_0x1dd5('0x22')](function(_0x2062a7){_0x40973a[_0x1dd5('0x41')]=_0x2062a7;return _0x40973a;})[_0x1dd5('0x22')](respondWithFilteredResult(_0x43efbf,_0x270f98))[_0x1dd5('0x42')](handleError(_0x43efbf,null));};exports[_0x1dd5('0x43')]=function(_0x46aebf,_0x48df01){var _0x26bfe5={'raw':!![],'where':{'id':_0x46aebf[_0x1dd5('0x44')]['id']}},_0x1d1743={};_0x1d1743[_0x1dd5('0x2b')]=_[_0x1dd5('0x2e')](db['SmsApplication'][_0x1dd5('0x28')]);_0x1d1743[_0x1dd5('0x2d')]=_[_0x1dd5('0x2e')](_0x46aebf['query']);_0x1d1743['filters']=_['intersection'](_0x1d1743[_0x1dd5('0x2b')],_0x1d1743[_0x1dd5('0x2d')]);_0x26bfe5[_0x1dd5('0x32')]=_[_0x1dd5('0x30')](_0x1d1743[_0x1dd5('0x2b')],qs['fields'](_0x46aebf[_0x1dd5('0x2d')]['fields']));_0x26bfe5[_0x1dd5('0x32')]=_0x26bfe5[_0x1dd5('0x32')]['length']?_0x26bfe5[_0x1dd5('0x32')]:_0x1d1743[_0x1dd5('0x2b')];if(_0x46aebf['query']['includeAll']){_0x26bfe5[_0x1dd5('0x3f')]=[{'all':!![]}];}_0x26bfe5=_['merge']({},_0x26bfe5,_0x46aebf[_0x1dd5('0x3c')]);return db[_0x1dd5('0x3d')][_0x1dd5('0x45')](_0x26bfe5)['then'](handleEntityNotFound(_0x48df01,null))['then'](respondWithResult(_0x48df01,null))[_0x1dd5('0x42')](handleError(_0x48df01,null));};exports['create']=function(_0x47b647,_0x393d60){return db[_0x1dd5('0x3d')][_0x1dd5('0x46')](_0x47b647[_0x1dd5('0x47')],{})[_0x1dd5('0x22')](respondWithResult(_0x393d60,0xc9))['catch'](handleError(_0x393d60,null));};exports['update']=function(_0x22ad68,_0x4e8456){if(_0x22ad68[_0x1dd5('0x47')]['id']){delete _0x22ad68[_0x1dd5('0x47')]['id'];}return db[_0x1dd5('0x3d')]['find']({'where':{'id':_0x22ad68[_0x1dd5('0x44')]['id']}})[_0x1dd5('0x22')](handleEntityNotFound(_0x4e8456,null))[_0x1dd5('0x22')](saveUpdates(_0x22ad68[_0x1dd5('0x47')],null))[_0x1dd5('0x22')](respondWithResult(_0x4e8456,null))[_0x1dd5('0x42')](handleError(_0x4e8456,null));};exports[_0x1dd5('0x21')]=function(_0x31af04,_0x42d157){return db[_0x1dd5('0x3d')][_0x1dd5('0x45')]({'where':{'id':_0x31af04[_0x1dd5('0x44')]['id']}})[_0x1dd5('0x22')](handleEntityNotFound(_0x42d157,null))[_0x1dd5('0x22')](removeEntity(_0x42d157,null))[_0x1dd5('0x42')](handleError(_0x42d157,null));};
\ No newline at end of file
+var _0x7aae=['model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','options','findAll','rows','catch','show','params','includeAll','include','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','end','offset','undefined','limit','count','status','Content-Range','json','apply','reject','save','update','destroy','then','sendStatus','error','stack','name','send','index','SmsApplication','rawAttributes','type','key'];(function(_0x5be52f,_0x24a872){var _0x529c08=function(_0x3d2370){while(--_0x3d2370){_0x5be52f['push'](_0x5be52f['shift']());}};_0x529c08(++_0x24a872);}(_0x7aae,0x14c));var _0xe7aa=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x7aae[_0x3b380d];return _0x54502b;};'use strict';var emlformat=require(_0xe7aa('0x0'));var rimraf=require(_0xe7aa('0x1'));var zipdir=require(_0xe7aa('0x2'));var jsonpatch=require(_0xe7aa('0x3'));var rp=require('request-promise');var moment=require(_0xe7aa('0x4'));var BPromise=require(_0xe7aa('0x5'));var Mustache=require('mustache');var util=require(_0xe7aa('0x6'));var path=require(_0xe7aa('0x7'));var sox=require(_0xe7aa('0x8'));var csv=require(_0xe7aa('0x9'));var ejs=require(_0xe7aa('0xa'));var fs=require('fs');var fs_extra=require(_0xe7aa('0xb'));var _=require(_0xe7aa('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xe7aa('0xd'));var toCsv=require(_0xe7aa('0x9'));var querystring=require(_0xe7aa('0xe'));var Papa=require(_0xe7aa('0xf'));var Redis=require('ioredis');var authService=require(_0xe7aa('0x10'));var qs=require(_0xe7aa('0x11'));var as=require(_0xe7aa('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe7aa('0x13'))(_0xe7aa('0x14'));var utils=require(_0xe7aa('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xe7aa('0x16'));var db=require(_0xe7aa('0x17'))['db'];function respondWithStatusCode(_0x46b4bb,_0x259002){_0x259002=_0x259002||0xcc;return function(_0x62a688){if(_0x62a688){return _0x46b4bb['sendStatus'](_0x259002);}return _0x46b4bb['status'](_0x259002)[_0xe7aa('0x18')]();};}function respondWithResult(_0x3bc746,_0x49b578){_0x49b578=_0x49b578||0xc8;return function(_0x45ecd1){if(_0x45ecd1){return _0x3bc746['status'](_0x49b578)['json'](_0x45ecd1);}};}function respondWithFilteredResult(_0x353300,_0x355f4b){return function(_0x1c5c9b){if(_0x1c5c9b){var _0x4529cf=typeof _0x355f4b[_0xe7aa('0x19')]===_0xe7aa('0x1a')&&typeof _0x355f4b[_0xe7aa('0x1b')]==='undefined';var _0x312e64=_0x1c5c9b[_0xe7aa('0x1c')];var _0x5c5242=_0x4529cf?0x0:_0x355f4b[_0xe7aa('0x19')];var _0x46610c=_0x4529cf?_0x1c5c9b['count']:_0x355f4b[_0xe7aa('0x19')]+_0x355f4b['limit'];var _0x638431;if(_0x46610c>=_0x312e64){_0x46610c=_0x312e64;_0x638431=0xc8;}else{_0x638431=0xce;}_0x353300[_0xe7aa('0x1d')](_0x638431);return _0x353300['set'](_0xe7aa('0x1e'),_0x5c5242+'-'+_0x46610c+'/'+_0x312e64)[_0xe7aa('0x1f')](_0x1c5c9b);}return null;};}function patchUpdates(_0x3bd64c){return function(_0x374206){try{jsonpatch[_0xe7aa('0x20')](_0x374206,_0x3bd64c,!![]);}catch(_0x30e8ab){return BPromise[_0xe7aa('0x21')](_0x30e8ab);}return _0x374206[_0xe7aa('0x22')]();};}function saveUpdates(_0x35e314,_0xc0c1cd){return function(_0xccd9cb){if(_0xccd9cb){return _0xccd9cb[_0xe7aa('0x23')](_0x35e314)['then'](function(_0x111beb){return _0x111beb;});}return null;};}function removeEntity(_0x114731,_0x1cc349){return function(_0x4320ba){if(_0x4320ba){return _0x4320ba[_0xe7aa('0x24')]()[_0xe7aa('0x25')](function(){_0x114731[_0xe7aa('0x1d')](0xcc)[_0xe7aa('0x18')]();});}};}function handleEntityNotFound(_0xd51e9,_0x2470cf){return function(_0x553da3){if(!_0x553da3){_0xd51e9[_0xe7aa('0x26')](0x194);}return _0x553da3;};}function handleError(_0xe55a79,_0x25b2cb){_0x25b2cb=_0x25b2cb||0x1f4;return function(_0x2ab1d2){logger[_0xe7aa('0x27')](_0x2ab1d2[_0xe7aa('0x28')]);if(_0x2ab1d2[_0xe7aa('0x29')]){delete _0x2ab1d2[_0xe7aa('0x29')];}_0xe55a79[_0xe7aa('0x1d')](_0x25b2cb)[_0xe7aa('0x2a')](_0x2ab1d2);};}exports[_0xe7aa('0x2b')]=function(_0x4c8221,_0x374b6f){var _0x5f1a07={},_0x26a55f={},_0x416ca3={'count':0x0,'rows':[]};var _0x5b6687=_['map'](db[_0xe7aa('0x2c')][_0xe7aa('0x2d')],function(_0x4a5ed4){return{'name':_0x4a5ed4['fieldName'],'type':_0x4a5ed4[_0xe7aa('0x2e')][_0xe7aa('0x2f')]};});_0x26a55f[_0xe7aa('0x30')]=_['map'](_0x5b6687,_0xe7aa('0x29'));_0x26a55f[_0xe7aa('0x31')]=_[_0xe7aa('0x32')](_0x4c8221[_0xe7aa('0x31')]);_0x26a55f[_0xe7aa('0x33')]=_[_0xe7aa('0x34')](_0x26a55f['model'],_0x26a55f['query']);_0x5f1a07['attributes']=_[_0xe7aa('0x34')](_0x26a55f['model'],qs[_0xe7aa('0x35')](_0x4c8221[_0xe7aa('0x31')][_0xe7aa('0x35')]));_0x5f1a07[_0xe7aa('0x36')]=_0x5f1a07['attributes'][_0xe7aa('0x37')]?_0x5f1a07[_0xe7aa('0x36')]:_0x26a55f[_0xe7aa('0x30')];if(!_0x4c8221['query'][_0xe7aa('0x38')](_0xe7aa('0x39'))){_0x5f1a07[_0xe7aa('0x1b')]=qs[_0xe7aa('0x1b')](_0x4c8221[_0xe7aa('0x31')][_0xe7aa('0x1b')]);_0x5f1a07[_0xe7aa('0x19')]=qs[_0xe7aa('0x19')](_0x4c8221[_0xe7aa('0x31')]['offset']);}_0x5f1a07[_0xe7aa('0x3a')]=qs['sort'](_0x4c8221[_0xe7aa('0x31')][_0xe7aa('0x3b')]);_0x5f1a07[_0xe7aa('0x3c')]=qs[_0xe7aa('0x33')](_[_0xe7aa('0x3d')](_0x4c8221[_0xe7aa('0x31')],_0x26a55f[_0xe7aa('0x33')]),_0x5b6687);if(_0x4c8221['query'][_0xe7aa('0x3e')]){_0x5f1a07[_0xe7aa('0x3c')]=_[_0xe7aa('0x3f')](_0x5f1a07['where'],{'$or':_[_0xe7aa('0x40')](_0x5b6687,function(_0x5b3405){if(_0x5b3405[_0xe7aa('0x2e')]!=='VIRTUAL'){var _0x1b9755={};_0x1b9755[_0x5b3405[_0xe7aa('0x29')]]={'$like':'%'+_0x4c8221['query']['filter']+'%'};return _0x1b9755;}})});}_0x5f1a07=_[_0xe7aa('0x3f')]({},_0x5f1a07,_0x4c8221[_0xe7aa('0x41')]);var _0x195889={'where':_0x5f1a07['where']};return db[_0xe7aa('0x2c')][_0xe7aa('0x1c')](_0x195889)[_0xe7aa('0x25')](function(_0x4d0076){_0x416ca3[_0xe7aa('0x1c')]=_0x4d0076;if(_0x4c8221[_0xe7aa('0x31')]['includeAll']){_0x5f1a07['include']=[{'all':!![]}];}return db[_0xe7aa('0x2c')][_0xe7aa('0x42')](_0x5f1a07);})['then'](function(_0x41c006){_0x416ca3[_0xe7aa('0x43')]=_0x41c006;return _0x416ca3;})['then'](respondWithFilteredResult(_0x374b6f,_0x5f1a07))[_0xe7aa('0x44')](handleError(_0x374b6f,null));};exports[_0xe7aa('0x45')]=function(_0x173090,_0x12f84f){var _0x103b18={'raw':!![],'where':{'id':_0x173090[_0xe7aa('0x46')]['id']}},_0x3b83e5={};_0x3b83e5[_0xe7aa('0x30')]=_['keys'](db['SmsApplication'][_0xe7aa('0x2d')]);_0x3b83e5[_0xe7aa('0x31')]=_[_0xe7aa('0x32')](_0x173090['query']);_0x3b83e5[_0xe7aa('0x33')]=_['intersection'](_0x3b83e5[_0xe7aa('0x30')],_0x3b83e5[_0xe7aa('0x31')]);_0x103b18['attributes']=_[_0xe7aa('0x34')](_0x3b83e5[_0xe7aa('0x30')],qs[_0xe7aa('0x35')](_0x173090['query'][_0xe7aa('0x35')]));_0x103b18[_0xe7aa('0x36')]=_0x103b18[_0xe7aa('0x36')]['length']?_0x103b18['attributes']:_0x3b83e5['model'];if(_0x173090['query'][_0xe7aa('0x47')]){_0x103b18[_0xe7aa('0x48')]=[{'all':!![]}];}_0x103b18=_[_0xe7aa('0x3f')]({},_0x103b18,_0x173090['options']);return db[_0xe7aa('0x2c')]['find'](_0x103b18)[_0xe7aa('0x25')](handleEntityNotFound(_0x12f84f,null))[_0xe7aa('0x25')](respondWithResult(_0x12f84f,null))['catch'](handleError(_0x12f84f,null));};exports[_0xe7aa('0x49')]=function(_0x3334d9,_0x507a01){return db[_0xe7aa('0x2c')][_0xe7aa('0x49')](_0x3334d9[_0xe7aa('0x4a')],{})[_0xe7aa('0x25')](respondWithResult(_0x507a01,0xc9))[_0xe7aa('0x44')](handleError(_0x507a01,null));};exports['update']=function(_0x48e02b,_0x291a87){if(_0x48e02b[_0xe7aa('0x4a')]['id']){delete _0x48e02b[_0xe7aa('0x4a')]['id'];}return db[_0xe7aa('0x2c')][_0xe7aa('0x4b')]({'where':{'id':_0x48e02b[_0xe7aa('0x46')]['id']}})[_0xe7aa('0x25')](handleEntityNotFound(_0x291a87,null))[_0xe7aa('0x25')](saveUpdates(_0x48e02b[_0xe7aa('0x4a')],null))[_0xe7aa('0x25')](respondWithResult(_0x291a87,null))[_0xe7aa('0x44')](handleError(_0x291a87,null));};exports[_0xe7aa('0x24')]=function(_0x1f952f,_0x2671f0){return db[_0xe7aa('0x2c')][_0xe7aa('0x4b')]({'where':{'id':_0x1f952f[_0xe7aa('0x46')]['id']}})[_0xe7aa('0x25')](handleEntityNotFound(_0x2671f0,null))[_0xe7aa('0x25')](removeEntity(_0x2671f0,null))['catch'](handleError(_0x2671f0,null));};
\ No newline at end of file
index b3dbb34..c664c0d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3e4c=['./smsApplication.attributes','define','SmsApplication','sms_applications','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment'];(function(_0x5a04d0,_0x51da66){var _0x323a07=function(_0x334167){while(--_0x334167){_0x5a04d0['push'](_0x5a04d0['shift']());}};_0x323a07(++_0x51da66);}(_0x3e4c,0xfd));var _0xc3e4=function(_0x623ab9,_0x459d12){_0x623ab9=_0x623ab9-0x0;var _0x2b2f3d=_0x3e4c[_0x623ab9];return _0x2b2f3d;};'use strict';var _=require('lodash');var util=require(_0xc3e4('0x0'));var logger=require(_0xc3e4('0x1'))(_0xc3e4('0x2'));var moment=require(_0xc3e4('0x3'));var BPromise=require(_0xc3e4('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xc3e4('0x5'));var config=require(_0xc3e4('0x6'));var attributes=require(_0xc3e4('0x7'));module['exports']=function(_0x1e9acb,_0x5d046d){return _0x1e9acb[_0xc3e4('0x8')](_0xc3e4('0x9'),attributes,{'tableName':_0xc3e4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc3e4('0xb'),'collate':_0xc3e4('0xc')});};
\ No newline at end of file
+var _0x99ce=['bluebird','request-promise','path','rimraf','exports','define','SmsApplication','sms_applications','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment'];(function(_0x2d2c16,_0x4e88b6){var _0x53f2fb=function(_0x6b6dac){while(--_0x6b6dac){_0x2d2c16['push'](_0x2d2c16['shift']());}};_0x53f2fb(++_0x4e88b6);}(_0x99ce,0x168));var _0xe99c=function(_0x563107,_0x29cd4a){_0x563107=_0x563107-0x0;var _0x4a47ef=_0x99ce[_0x563107];return _0x4a47ef;};'use strict';var _=require(_0xe99c('0x0'));var util=require('util');var logger=require(_0xe99c('0x1'))(_0xe99c('0x2'));var moment=require(_0xe99c('0x3'));var BPromise=require(_0xe99c('0x4'));var rp=require(_0xe99c('0x5'));var fs=require('fs');var path=require(_0xe99c('0x6'));var rimraf=require(_0xe99c('0x7'));var config=require('../../config/environment');var attributes=require('./smsApplication.attributes');module[_0xe99c('0x8')]=function(_0x37d978,_0x2f7d1b){return _0x37d978[_0xe99c('0x9')](_0xe99c('0xa'),attributes,{'tableName':_0xe99c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe99c('0xc'),'collate':_0xe99c('0xd')});};
\ No newline at end of file
index 177a6f1..4f51d4f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf1f9=['catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x26e0f7,_0x4368ac){var _0x129f81=function(_0x1b0355){while(--_0x1b0355){_0x26e0f7['push'](_0x26e0f7['shift']());}};_0x129f81(++_0x4368ac);}(_0xf1f9,0x1cd));var _0x9f1f=function(_0x3550b6,_0x236487){_0x3550b6=_0x3550b6-0x0;var _0x2452ca=_0xf1f9[_0x3550b6];return _0x2452ca;};'use strict';var _=require(_0x9f1f('0x0'));var util=require(_0x9f1f('0x1'));var moment=require(_0x9f1f('0x2'));var BPromise=require(_0x9f1f('0x3'));var rs=require(_0x9f1f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9f1f('0x5'))['db'];var utils=require(_0x9f1f('0x6'));var logger=require(_0x9f1f('0x7'))(_0x9f1f('0x8'));var config=require(_0x9f1f('0x9'));var jayson=require(_0x9f1f('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x363d26,_0x373b98,_0x117fa5){return new BPromise(function(_0x12309e,_0x4e6054){return client[_0x9f1f('0xb')](_0x363d26,_0x117fa5)[_0x9f1f('0xc')](function(_0x3efac2){logger[_0x9f1f('0xd')](_0x9f1f('0xe'),_0x373b98,_0x9f1f('0xf'));logger[_0x9f1f('0x10')](_0x9f1f('0x11'),_0x373b98,'request\x20sent',JSON[_0x9f1f('0x12')](_0x3efac2));if(_0x3efac2[_0x9f1f('0x13')]){if(_0x3efac2[_0x9f1f('0x13')]['code']===0x1f4){logger['error'](_0x9f1f('0xe'),_0x373b98,_0x3efac2['error'][_0x9f1f('0x14')]);return _0x4e6054(_0x3efac2[_0x9f1f('0x13')][_0x9f1f('0x14')]);}logger[_0x9f1f('0x13')](_0x9f1f('0xe'),_0x373b98,_0x3efac2[_0x9f1f('0x13')][_0x9f1f('0x14')]);return _0x12309e(_0x3efac2['error'][_0x9f1f('0x14')]);}else{logger['info'](_0x9f1f('0xe'),_0x373b98,_0x9f1f('0xf'));_0x12309e(_0x3efac2[_0x9f1f('0x15')][_0x9f1f('0x14')]);}})[_0x9f1f('0x16')](function(_0x5645fc){logger[_0x9f1f('0x13')](_0x9f1f('0xe'),_0x373b98,_0x5645fc);_0x4e6054(_0x5645fc);});});}
\ No newline at end of file
+var _0x1399=['message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','SmsApplication,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x3e0ba7,_0x354fcb){var _0x4ceb9d=function(_0xebbdac){while(--_0xebbdac){_0x3e0ba7['push'](_0x3e0ba7['shift']());}};_0x4ceb9d(++_0x354fcb);}(_0x1399,0x16c));var _0x9139=function(_0x533db2,_0x5613ba){_0x533db2=_0x533db2-0x0;var _0x9e98f9=_0x1399[_0x533db2];return _0x9e98f9;};'use strict';var _=require(_0x9139('0x0'));var util=require(_0x9139('0x1'));var moment=require('moment');var BPromise=require(_0x9139('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9139('0x3'));var db=require(_0x9139('0x4'))['db'];var utils=require(_0x9139('0x5'));var logger=require(_0x9139('0x6'))(_0x9139('0x7'));var config=require(_0x9139('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x9139('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x11d2ed,_0x4d5d1e,_0x51832d){return new BPromise(function(_0x11a03f,_0x59aec5){return client['request'](_0x11d2ed,_0x51832d)[_0x9139('0xa')](function(_0x385e2c){logger['info'](_0x9139('0xb'),_0x4d5d1e,_0x9139('0xc'));logger['debug']('SmsApplication,\x20%s,\x20%s,\x20%s',_0x4d5d1e,_0x9139('0xc'),JSON[_0x9139('0xd')](_0x385e2c));if(_0x385e2c[_0x9139('0xe')]){if(_0x385e2c[_0x9139('0xe')][_0x9139('0xf')]===0x1f4){logger['error']('SmsApplication,\x20%s,\x20%s',_0x4d5d1e,_0x385e2c['error'][_0x9139('0x10')]);return _0x59aec5(_0x385e2c['error'][_0x9139('0x10')]);}logger[_0x9139('0xe')](_0x9139('0xb'),_0x4d5d1e,_0x385e2c[_0x9139('0xe')]['message']);return _0x11a03f(_0x385e2c[_0x9139('0xe')]['message']);}else{logger['info']('SmsApplication,\x20%s,\x20%s',_0x4d5d1e,_0x9139('0xc'));_0x11a03f(_0x385e2c[_0x9139('0x11')][_0x9139('0x10')]);}})[_0x9139('0x12')](function(_0x18801b){logger[_0x9139('0xe')]('SmsApplication,\x20%s,\x20%s',_0x4d5d1e,_0x18801b);_0x59aec5(_0x18801b);});});}
\ No newline at end of file
index 4e4689b..04677d0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8603=['sms','addTags','put','/:id','smsinteraction:update','update','delete','destroy','removeTags','exports','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./smsInteraction.controller','isAuthenticated','index','get','/describe','show','/:id/messages','/:id/download','download','post','create','addMessage','/:id/tags','tracked'];(function(_0x18624e,_0x172c43){var _0x41ef95=function(_0x587da8){while(--_0x587da8){_0x18624e['push'](_0x18624e['shift']());}};_0x41ef95(++_0x172c43);}(_0x8603,0x190));var _0x3860=function(_0x14fd4e,_0x27c587){_0x14fd4e=_0x14fd4e-0x0;var _0x4a73d2=_0x8603[_0x14fd4e];return _0x4a73d2;};'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['describe']);router['get']('/:id',auth[_0x3860('0x7')](),controller[_0x3860('0xb')]);router['get'](_0x3860('0xc'),auth[_0x3860('0x7')](),controller['getMessages']);router[_0x3860('0x9')](_0x3860('0xd'),auth['isAuthenticated'](),controller[_0x3860('0xe')]);router[_0x3860('0xf')]('/',auth['isAuthenticated'](),controller[_0x3860('0x10')]);router[_0x3860('0xf')](_0x3860('0xc'),auth[_0x3860('0x7')](),controller[_0x3860('0x11')]);router[_0x3860('0xf')](_0x3860('0x12'),auth[_0x3860('0x7')](),interaction[_0x3860('0x13')](_0x3860('0x14'),'smsinteraction:addtags'),controller[_0x3860('0x15')]);router[_0x3860('0x16')](_0x3860('0x17'),auth[_0x3860('0x7')](),interaction[_0x3860('0x13')](_0x3860('0x14'),_0x3860('0x18')),controller[_0x3860('0x19')]);router[_0x3860('0x1a')](_0x3860('0x17'),auth[_0x3860('0x7')](),interaction[_0x3860('0x13')]('sms','smsinteraction:destroy'),controller[_0x3860('0x1b')]);router[_0x3860('0x1a')](_0x3860('0x12'),auth['isAuthenticated'](),controller[_0x3860('0x1c')]);module[_0x3860('0x1d')]=router;
\ No newline at end of file
+var _0x36ee=['../../config/environment','./smsInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','smsinteraction:addtags','addTags','put','tracked','sms','smsinteraction:update','update','delete','smsinteraction:destroy','/:id/tags','removeTags','exports','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x52e28d,_0x4f0959){var _0x3946d7=function(_0x24d525){while(--_0x24d525){_0x52e28d['push'](_0x52e28d['shift']());}};_0x3946d7(++_0x4f0959);}(_0x36ee,0xe8));var _0xe36e=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x36ee[_0x3bf83f];return _0x22c4a9;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe36e('0x0'));var timeout=require('connect-timeout');var express=require(_0xe36e('0x1'));var router=express[_0xe36e('0x2')]();var fs_extra=require(_0xe36e('0x3'));var auth=require(_0xe36e('0x4'));var interaction=require(_0xe36e('0x5'));var config=require(_0xe36e('0x6'));var controller=require(_0xe36e('0x7'));router[_0xe36e('0x8')]('/',auth[_0xe36e('0x9')](),controller[_0xe36e('0xa')]);router[_0xe36e('0x8')](_0xe36e('0xb'),auth['isAuthenticated'](),controller[_0xe36e('0xc')]);router['get'](_0xe36e('0xd'),auth[_0xe36e('0x9')](),controller[_0xe36e('0xe')]);router['get'](_0xe36e('0xf'),auth['isAuthenticated'](),controller[_0xe36e('0x10')]);router[_0xe36e('0x8')](_0xe36e('0x11'),auth[_0xe36e('0x9')](),controller[_0xe36e('0x12')]);router[_0xe36e('0x13')]('/',auth[_0xe36e('0x9')](),controller[_0xe36e('0x14')]);router['post'](_0xe36e('0xf'),auth[_0xe36e('0x9')](),controller[_0xe36e('0x15')]);router[_0xe36e('0x13')]('/:id/tags',auth[_0xe36e('0x9')](),interaction['tracked']('sms',_0xe36e('0x16')),controller[_0xe36e('0x17')]);router[_0xe36e('0x18')](_0xe36e('0xd'),auth[_0xe36e('0x9')](),interaction[_0xe36e('0x19')](_0xe36e('0x1a'),_0xe36e('0x1b')),controller[_0xe36e('0x1c')]);router[_0xe36e('0x1d')]('/:id',auth[_0xe36e('0x9')](),interaction[_0xe36e('0x19')]('sms',_0xe36e('0x1e')),controller['destroy']);router[_0xe36e('0x1d')](_0xe36e('0x1f'),auth['isAuthenticated'](),controller[_0xe36e('0x20')]);module[_0xe36e('0x21')]=router;
\ No newline at end of file
index 7e2ae7b..0b603b2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x24ca=['ENUM','out','sequelize','BOOLEAN','STRING','DATE'];(function(_0x19fbf6,_0x1ab109){var _0xe389a6=function(_0x1cdc4b){while(--_0x1cdc4b){_0x19fbf6['push'](_0x19fbf6['shift']());}};_0xe389a6(++_0x1ab109);}(_0x24ca,0x8c));var _0xa24c=function(_0x260b48,_0x117977){_0x260b48=_0x260b48-0x0;var _0x3f730b=_0x24ca[_0x260b48];return _0x3f730b;};'use strict';var Sequelize=require(_0xa24c('0x0'));var moment=require('moment');module['exports']={'closed':{'type':Sequelize[_0xa24c('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xa24c('0x2')]},'secondDisposition':{'type':Sequelize[_0xa24c('0x2')]},'thirdDisposition':{'type':Sequelize[_0xa24c('0x2')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0xa24c('0x2')]},'read1stAt':{'type':Sequelize[_0xa24c('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xa24c('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xa24c('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xa24c('0x1')],'defaultValue':![]}};
\ No newline at end of file
+var _0x8c32=['sequelize','moment','exports','BOOLEAN','DATE','STRING','ENUM','out'];(function(_0x2a7210,_0x2f3d23){var _0x460766=function(_0xd575dd){while(--_0xd575dd){_0x2a7210['push'](_0x2a7210['shift']());}};_0x460766(++_0x2f3d23);}(_0x8c32,0x130));var _0x28c3=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x8c32[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0x28c3('0x0'));var moment=require(_0x28c3('0x1'));module[_0x28c3('0x2')]={'closed':{'type':Sequelize[_0x28c3('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x28c3('0x4')]},'disposition':{'type':Sequelize[_0x28c3('0x5')]},'secondDisposition':{'type':Sequelize[_0x28c3('0x5')]},'thirdDisposition':{'type':Sequelize[_0x28c3('0x5')]},'note':{'type':Sequelize[_0x28c3('0x5')]},'phone':{'type':Sequelize[_0x28c3('0x5')]},'read1stAt':{'type':Sequelize[_0x28c3('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x28c3('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x28c3('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x28c3('0x6')]('in',_0x28c3('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x28c3('0x3')],'defaultValue':![]}};
\ No newline at end of file
index b6e61b0..b0792e0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd6ee=['redis','localhost','./smsInteraction.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','map','fullname','TagIds','Tags','split','push','catch','waiting','talking','answered','unmanaged','total','UserId','closed','index','SmsInteraction','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','select','field','u.fullname','ui.SmsInteractionId','from','user_has_sms_interactions','left_join','users','u.id\x20=\x20ui.UserId','sms_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','sms_accounts','a.id\x20=\x20i.SmsAccountId','sms_messages','sms_interaction_has_tags','it.SmsInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','conditions','length','find','unreadMessages','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','value','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','body','compact','isEmpty','SmsAccountId','i.SmsAccountId\x20IN\x20?','createdAt','$gte','parse','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','tag','isArray','filter','replace','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','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)','DESC','t.id\x20IN\x20?','resolve','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','role','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','agent','sequelize','toString','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','c.firstName','Contact.firstName','Contact.lastName','c.email','Contact.email','c.phone','c.mobile','Contact.mobile','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.SmsInteractionId\x20IN\x20?','groupBy','SmsInteractionId','all','rows','show','includeAll','include','options','params','describe','SmsMessage','ids','omit','hasOwnProperty','pick','format','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','setTags','spread','emit','smsInteractionTags:save','removeTags','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','User','lastName','SmsAccount','get','mkdirSync','Sms','Account','Owner','N.A.','closedAt','disposition','Messages','out','System','direction','secret','renderFile','views','downloadInteraction.ejs','transcript-','createPdfFromHTML','err','unlinkSync','rimraf','zip-dir','moment','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xd6ee,0xcf));var _0xed6e=function(_0x4c1429,_0x13b2bb){_0x4c1429=_0x4c1429-0x0;var _0xd96ded=_0xd6ee[_0x4c1429];return _0xd96ded;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xed6e('0x0'));var zipdir=require(_0xed6e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xed6e('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xed6e('0x3'));var path=require(_0xed6e('0x4'));var sox=require(_0xed6e('0x5'));var csv=require('to-csv');var ejs=require(_0xed6e('0x6'));var fs=require('fs');var fs_extra=require(_0xed6e('0x7'));var _=require(_0xed6e('0x8'));var squel=require(_0xed6e('0x9'));var crypto=require(_0xed6e('0xa'));var jsforce=require(_0xed6e('0xb'));var deskjs=require(_0xed6e('0xc'));var toCsv=require('to-csv');var querystring=require(_0xed6e('0xd'));var Papa=require('papaparse');var Redis=require(_0xed6e('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xed6e('0xf'));var pdf=require('../../components/export/pdf');var hardwareService=require(_0xed6e('0x10'));var logger=require('../../config/logger')(_0xed6e('0x11'));var utils=require(_0xed6e('0x12'));var config=require(_0xed6e('0x13'));var licenseUtil=require(_0xed6e('0x14'));var db=require(_0xed6e('0x15'))['db'];config[_0xed6e('0x16')]=_['defaults'](config[_0xed6e('0x16')],{'host':_0xed6e('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xed6e('0x16')]));require(_0xed6e('0x18'))[_0xed6e('0x19')](socket);function respondWithStatusCode(_0x534c71,_0x91e0dc){_0x91e0dc=_0x91e0dc||0xcc;return function(_0x4c3983){if(_0x4c3983){return _0x534c71[_0xed6e('0x1a')](_0x91e0dc);}return _0x534c71[_0xed6e('0x1b')](_0x91e0dc)['end']();};}function respondWithResult(_0x284b32,_0x491edb){_0x491edb=_0x491edb||0xc8;return function(_0xfb4a60){if(_0xfb4a60){return _0x284b32['status'](_0x491edb)[_0xed6e('0x1c')](_0xfb4a60);}};}function respondWithFilteredResult(_0x43f948,_0x15f72e){return function(_0x2a6175){if(_0x2a6175){var _0x33bcf6=typeof _0x15f72e[_0xed6e('0x1d')]===_0xed6e('0x1e')&&typeof _0x15f72e[_0xed6e('0x1f')]===_0xed6e('0x1e');var _0x22e5f3=_0x2a6175[_0xed6e('0x20')];var _0x3d5cc8=_0x33bcf6?0x0:_0x15f72e['offset'];var _0x37e65b=_0x33bcf6?_0x2a6175[_0xed6e('0x20')]:_0x15f72e[_0xed6e('0x1d')]+_0x15f72e[_0xed6e('0x1f')];var _0xebbde5;if(_0x37e65b>=_0x22e5f3){_0x37e65b=_0x22e5f3;_0xebbde5=0xc8;}else{_0xebbde5=0xce;}_0x43f948[_0xed6e('0x1b')](_0xebbde5);return _0x43f948[_0xed6e('0x21')](_0xed6e('0x22'),_0x3d5cc8+'-'+_0x37e65b+'/'+_0x22e5f3)[_0xed6e('0x1c')](_0x2a6175);}return null;};}function patchUpdates(_0x3f0afa){return function(_0x5b1d69){try{jsonpatch[_0xed6e('0x23')](_0x5b1d69,_0x3f0afa,!![]);}catch(_0x4869b7){return BPromise[_0xed6e('0x24')](_0x4869b7);}return _0x5b1d69[_0xed6e('0x25')]();};}function saveUpdates(_0xfe6a72,_0x159324){return function(_0x35c352){if(_0x35c352){return _0x35c352[_0xed6e('0x26')](_0xfe6a72)[_0xed6e('0x27')](function(_0x586684){return _0x586684;});}return null;};}function removeEntity(_0x4d17fd,_0x197983){return function(_0x2213d2){if(_0x2213d2){return _0x2213d2[_0xed6e('0x28')]()[_0xed6e('0x27')](function(){_0x4d17fd[_0xed6e('0x1b')](0xcc)[_0xed6e('0x29')]();});}};}function handleEntityNotFound(_0x56f2b2,_0x53b3ac){return function(_0x21a631){if(!_0x21a631){_0x56f2b2['sendStatus'](0x194);}return _0x21a631;};}function handleError(_0xa92228,_0x47fc08){_0x47fc08=_0x47fc08||0x1f4;return function(_0xe27ba6){logger[_0xed6e('0x2a')](_0xe27ba6[_0xed6e('0x2b')]);if(_0xe27ba6[_0xed6e('0x2c')]){delete _0xe27ba6['name'];}_0xa92228[_0xed6e('0x1b')](_0x47fc08)[_0xed6e('0x2d')](_0xe27ba6);};}function getInteractionUsers(_0x2b48d4,_0x35e7e4){return new BPromise(function(_0x53b72e,_0x411457){try{if(_0x35e7e4[_0x2b48d4['id']]){_0x2b48d4['Users']=_[_0xed6e('0x2e')](_0x35e7e4[_0x2b48d4['id']],function(_0x286d6a){return{'id':_0x286d6a['id'],'fullname':_0x286d6a[_0xed6e('0x2f')]};});}}catch(_0x49064d){_0x411457(_0x49064d);}_0x53b72e(_0x2b48d4);});}function getInteractionTags(_0x34dab1,_0x27a12e){return new BPromise(function(_0x1b4f6f,_0x2564c6){try{if(_0x34dab1[_0xed6e('0x30')]){_0x34dab1[_0xed6e('0x31')]=[];_0x34dab1[_0xed6e('0x30')][_0xed6e('0x32')](',')['forEach'](function(_0x3a945b){_0x34dab1['Tags'][_0xed6e('0x33')](_0x27a12e[_0x3a945b]);});}delete _0x34dab1['TagIds'];}catch(_0x54f81b){_0x2564c6(_0x54f81b);}_0x1b4f6f(_0x34dab1);});}function updateSmsInteraction(_0x11e97e,_0x53a4d5,_0x228c3f){return new BPromise(function(_0x48f5e2,_0x1f89df){return getInteractionUsers(_0x11e97e,_0x228c3f)[_0xed6e('0x27')](function(_0x302b23){return getInteractionTags(_0x302b23,_0x53a4d5);})[_0xed6e('0x27')](function(_0x20e5ce){return getStateInteraction(_0x20e5ce);})[_0xed6e('0x27')](function(_0x113425){_0x48f5e2(_0x113425);})[_0xed6e('0x34')](function(_0x2ab774){_0x1f89df(_0x2ab774);});});}function getStateInteraction(_0x306ae6){return new BPromise(function(_0x544a73){_0x306ae6[_0xed6e('0x35')]=0x0;_0x306ae6[_0xed6e('0x36')]=0x0;_0x306ae6[_0xed6e('0x37')]=0x0;_0x306ae6[_0xed6e('0x38')]=0x0;_0x306ae6[_0xed6e('0x39')]=0x0;if(!_0x306ae6['closed']&&!_0x306ae6['UserId']){_0x306ae6['waiting']+=0x1;}if(!_0x306ae6['closed']&&_0x306ae6[_0xed6e('0x3a')]){_0x306ae6['talking']+=0x1;if(_0x306ae6[_0xed6e('0x35')]){_0x306ae6['waiting']-=0x1;}}if(_0x306ae6['closed']&&_0x306ae6[_0xed6e('0x3a')]){_0x306ae6[_0xed6e('0x37')]+=0x1;if(_0x306ae6['talking']){_0x306ae6['talking']-=0x1;}}if(_0x306ae6[_0xed6e('0x3b')]&&!_0x306ae6[_0xed6e('0x3a')]){_0x306ae6[_0xed6e('0x38')]+=0x1;if(_0x306ae6['waiting']){_0x306ae6[_0xed6e('0x35')]-=0x1;}}_0x306ae6[_0xed6e('0x39')]+=0x1;_0x544a73(_0x306ae6);});}exports[_0xed6e('0x3c')]=function(_0x3ba8ce,_0x366d75){var _0x5de59b={},_0x18f340={},_0x545bcc={'count':0x0,'rows':[]};var _0x555f0c=_[_0xed6e('0x2e')](db[_0xed6e('0x3d')][_0xed6e('0x3e')],function(_0x582ea4){return{'name':_0x582ea4['fieldName'],'type':_0x582ea4[_0xed6e('0x3f')][_0xed6e('0x40')]};});_0x18f340[_0xed6e('0x41')]=_['map'](_0x555f0c,_0xed6e('0x2c'));_0x18f340[_0xed6e('0x42')]=_[_0xed6e('0x43')](_0x3ba8ce[_0xed6e('0x42')]);_0x18f340[_0xed6e('0x44')]=_[_0xed6e('0x45')](_0x18f340[_0xed6e('0x41')],_0x18f340[_0xed6e('0x42')]);_0x5de59b[_0xed6e('0x46')]=_[_0xed6e('0x45')](_0x18f340['model'],qs[_0xed6e('0x47')](_0x3ba8ce[_0xed6e('0x42')][_0xed6e('0x47')]));_0x5de59b[_0xed6e('0x46')]=_0x5de59b[_0xed6e('0x46')]['length']?_0x5de59b['attributes']:_0x18f340['model'];if(!_0x3ba8ce['query']['hasOwnProperty'](_0xed6e('0x48'))){_0x5de59b[_0xed6e('0x1f')]=qs[_0xed6e('0x1f')](_0x3ba8ce['query'][_0xed6e('0x1f')]);_0x5de59b[_0xed6e('0x1d')]=qs[_0xed6e('0x1d')](_0x3ba8ce[_0xed6e('0x42')]['offset']);}_0x5de59b[_0xed6e('0x49')]=qs['sort'](_0x3ba8ce[_0xed6e('0x42')][_0xed6e('0x4a')]);_0x5de59b[_0xed6e('0x4b')]=qs[_0xed6e('0x44')](_['pick'](_0x3ba8ce[_0xed6e('0x42')],_0x18f340[_0xed6e('0x44')]),_0x555f0c);var _0x3bdfc9=[];var _0x3f30f2=squel[_0xed6e('0x4c')]()[_0xed6e('0x4d')]('id')[_0xed6e('0x4d')](_0xed6e('0x2c'))[_0xed6e('0x4d')]('color')['from']('tools_tags');var _0x1df0f3=squel['select']()['field']('u.id')[_0xed6e('0x4d')](_0xed6e('0x4e'))['field'](_0xed6e('0x4f'))[_0xed6e('0x50')](_0xed6e('0x51'),'ui')[_0xed6e('0x52')](_0xed6e('0x53'),'u',_0xed6e('0x54'));var _0x50e341=squel[_0xed6e('0x4c')]()['from'](_0xed6e('0x55'),'i')['left_join'](_0xed6e('0x56'),'c',_0xed6e('0x57'))[_0xed6e('0x52')](_0xed6e('0x53'),'o','o.id\x20=\x20i.UserId')[_0xed6e('0x52')](_0xed6e('0x58'),'a',_0xed6e('0x59'))[_0xed6e('0x52')](_0xed6e('0x5a'),'me','me.SmsInteractionId\x20=\x20i.id')['left_join'](_0xed6e('0x5b'),'it',_0xed6e('0x5c'))[_0xed6e('0x52')]('tools_tags','t',_0xed6e('0x5d'));var _0x125ad0=squel['expr']();var _0x287807=[];var _0x2b9ea0=squel[_0xed6e('0x5e')]();var _0x4a1da7;if(_0x3ba8ce[_0xed6e('0x42')]['search']){_0x4a1da7=as['parseSearch'](_0x3ba8ce['query'][_0xed6e('0x5f')]);var _0x703ae7=_0x4a1da7['sqlOperator'];for(var _0x704966=0x0;_0x704966<_0x4a1da7[_0xed6e('0x60')][_0xed6e('0x61')];_0x704966++){var _0x1330d9=_0x4a1da7[_0xed6e('0x60')][_0x704966];var _0x4fc0d3='i';var _0x13e62b=_[_0xed6e('0x62')](_0x555f0c,['name',_0x1330d9[_0xed6e('0x4d')]]);if(!_0x13e62b){switch(_0x1330d9[_0xed6e('0x4d')]){case _0xed6e('0x63'):if(_0x1330d9['value']==0x1){_0x50e341[_0xed6e('0x64')]('`'+_0x1330d9['field']+_0xed6e('0x65'));}else{_0x50e341[_0xed6e('0x64')]('`'+_0x1330d9[_0xed6e('0x4d')]+_0xed6e('0x66'));}break;case _0xed6e('0x67'):if(_0x1330d9[_0xed6e('0x68')]===_0xed6e('0x69')){if(_0x1330d9[_0xed6e('0x6a')][_0xed6e('0x32')]('\x20')[_0xed6e('0x61')]>0x1){_0x125ad0[_0x703ae7](_0xed6e('0x6b'),qs[_0xed6e('0x6c')](_0x1330d9['value']),null);}else{var _0x6db3bb='%'+_0x1330d9[_0xed6e('0x6a')]+'%';_0x125ad0[_0x703ae7](_0xed6e('0x6d'),_0x6db3bb,_0x6db3bb,_0x6db3bb);}}else{_0x13e62b=_[_0xed6e('0x62')](_0x555f0c,[_0xed6e('0x2c'),_0xed6e('0x6e')]);_0x1330d9[_0xed6e('0x4d')]=_0xed6e('0x6e');_0x53cfea=as[_0xed6e('0x6f')](_0x4fc0d3,_0x13e62b['type'],_0x1330d9);_0x125ad0[_0x703ae7](_0x53cfea[_0xed6e('0x70')],_0x53cfea['value'][_0xed6e('0x71')],_0x53cfea['value'][_0xed6e('0x29')]);}break;case _0xed6e('0x72'):var _0x3e35cd=_0x1330d9[_0xed6e('0x6a')]['split'](',')['map'](function(_0x115116){return Number(_0x115116);});_0x3e35cd[_0xed6e('0x73')](function(_0x31255f){_0x2b9ea0['or'](_0xed6e('0x74'),'%,'+_0x31255f+',%');});_0x287807=_[_0xed6e('0x75')](_0x287807,_0x3e35cd);break;case'User':if(_0x1330d9[_0xed6e('0x68')]==='$substring'){_0x125ad0[_0x703ae7](_0xed6e('0x76'),'%'+_0x1330d9['value']+'%',null);}else{_0x13e62b=_[_0xed6e('0x62')](_0x555f0c,[_0xed6e('0x2c'),_0xed6e('0x3a')]);_0x1330d9[_0xed6e('0x4d')]=_0xed6e('0x3a');_0x53cfea=as[_0xed6e('0x6f')](_0x4fc0d3,_0x13e62b[_0xed6e('0x3f')],_0x1330d9);_0x125ad0[_0x703ae7](_0x53cfea['text'],_0x53cfea[_0xed6e('0x6a')][_0xed6e('0x71')],_0x53cfea[_0xed6e('0x6a')][_0xed6e('0x29')]);}break;case _0xed6e('0x77'):_0x53cfea=as[_0xed6e('0x6f')]('me',null,_0x1330d9);_0x125ad0[_0x703ae7](_0x53cfea[_0xed6e('0x70')],_0x53cfea['value'][_0xed6e('0x71')],_0x53cfea[_0xed6e('0x6a')][_0xed6e('0x29')]);break;}}else{var _0x53cfea=as[_0xed6e('0x6f')](_0x4fc0d3,_0x13e62b['type'],_0x1330d9);_0x125ad0[_0x703ae7](_0x53cfea[_0xed6e('0x70')],_0x53cfea[_0xed6e('0x6a')]['start'],_0x53cfea[_0xed6e('0x6a')]['end']);}}}else{var _0x3f11a2=_(_0x3ba8ce[_0xed6e('0x42')])[_0xed6e('0x43')]()[_0xed6e('0x2e')](function(_0x2fe726){return _['some'](_0x555f0c,['name',_0x2fe726])?_0x2fe726:undefined;})[_0xed6e('0x78')]()[_0xed6e('0x6a')]();if(!_[_0xed6e('0x79')](_0x3f11a2)){_0x3f11a2[_0xed6e('0x73')](function(_0x240656){if(_0x240656===_0xed6e('0x7a')){_0x50e341['where'](_0xed6e('0x7b'),[]['concat'](_0x3ba8ce[_0xed6e('0x42')][_0x240656]));}else if(_0x240656===_0xed6e('0x7c')){var _0x4f2c18=JSON['parse'](_0x3ba8ce['query'][_0x240656])[_0xed6e('0x7d')];var _0x20c4f3=JSON[_0xed6e('0x7e')](_0x3ba8ce[_0xed6e('0x42')][_0x240656])['$lte'];_0x50e341[_0xed6e('0x4b')](_0xed6e('0x7f'),_0x4f2c18,_0x20c4f3);}else{if(_0x3ba8ce[_0xed6e('0x42')][_0x240656]==='null'){_0x50e341[_0xed6e('0x4b')]('i.'+_0x240656+_0xed6e('0x80'));}else{_0x50e341[_0xed6e('0x4b')]('i.'+_0x240656+_0xed6e('0x81'),_0x3ba8ce[_0xed6e('0x42')][_0x240656]);}}});}if(_0x3ba8ce[_0xed6e('0x42')][_0xed6e('0x82')]){if(_0x3ba8ce[_0xed6e('0x42')]['read']==0x1){_0x50e341['having'](_0xed6e('0x83'));}else{_0x50e341[_0xed6e('0x64')]('`unreadMessages`\x20>\x200');}}if(_0x3ba8ce[_0xed6e('0x42')][_0xed6e('0x84')]){_0x287807=_[_0xed6e('0x85')](_0x3ba8ce[_0xed6e('0x42')][_0xed6e('0x84')])?_0x3ba8ce[_0xed6e('0x42')][_0xed6e('0x84')]:new Array(_0x3ba8ce[_0xed6e('0x42')][_0xed6e('0x84')]);_0x287807[_0xed6e('0x73')](function(_0x89d7a4){_0x2b9ea0['or'](_0xed6e('0x74'),'%,'+_0x89d7a4+',%');});}if(_0x3ba8ce[_0xed6e('0x42')]['filter']){var _0x4568d3=_0x3ba8ce['query'][_0xed6e('0x86')][_0xed6e('0x87')]('\x5c','\x5c\x5c')[_0xed6e('0x87')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x4568d3)){_0x125ad0['or'](_0xed6e('0x88'),_0x4568d3+'%')['or'](_0xed6e('0x89'),_0x4568d3+'%');}else{_0x125ad0['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x4568d3))['or'](_0xed6e('0x8a'),_0x4568d3+'%');}}}_0x50e341[_0xed6e('0x4b')](_0x125ad0);_0x50e341[_0xed6e('0x8b')](_0xed6e('0x8c'));var _0x33d7d7={'type':db[_0xed6e('0x8d')][_0xed6e('0x8e')][_0xed6e('0x8f')],'raw':!![]};var _0x38d28e=_0x50e341['clone']();_0x38d28e[_0xed6e('0x4d')](_0xed6e('0x8c'));_0x38d28e[_0xed6e('0x4d')](_0xed6e('0x90'),_0xed6e('0x63'));if(_0x5de59b[_0xed6e('0x49')]){_0x5de59b[_0xed6e('0x49')][_0xed6e('0x73')](function(_0x10aea7){var _0x33c702=_0x10aea7[0x0]==='contactName'?_0x10aea7[0x0]:'i.'+_0x10aea7[0x0];_0x50e341[_0xed6e('0x49')](_0x33c702,_0x10aea7[0x1]===_0xed6e('0x91')?![]:!![]);});}if(!_['isEmpty'](_0x287807)){_0x50e341[_0xed6e('0x64')](_0x2b9ea0);_0x38d28e[_0xed6e('0x4b')](_0xed6e('0x92'),_0x287807);}BPromise[_0xed6e('0x93')]()[_0xed6e('0x27')](function(){if(!_0x4a1da7){if(_0x3ba8ce[_0xed6e('0x42')][_0xed6e('0x7a')])return;_0x38d28e[_0xed6e('0x4b')](_0xed6e('0x94'));_0x50e341[_0xed6e('0x4b')](_0xed6e('0x94'));return;}if(_0x3ba8ce[_0xed6e('0x95')][_0xed6e('0x96')]!=='agent')return;return _0x3ba8ce[_0xed6e('0x95')][_0xed6e('0x97')]({'attributes':['id'],'raw':!![]})[_0xed6e('0x27')](function(_0x3ad640){if(_[_0xed6e('0x79')](_0x3ad640)){_0x38d28e[_0xed6e('0x4b')](_0xed6e('0x98'));_0x50e341['where']('i.SmsAccountId\x20IS\x20NULL');}else{_0x38d28e[_0xed6e('0x4b')](_0xed6e('0x7b'),_[_0xed6e('0x2e')](_0x3ad640,'id'));_0x50e341[_0xed6e('0x4b')]('i.SmsAccountId\x20IN\x20?',_[_0xed6e('0x2e')](_0x3ad640,'id'));}});})[_0xed6e('0x27')](function(){if(_0x3ba8ce[_0xed6e('0x95')][_0xed6e('0x96')]===_0xed6e('0x99')&&!_0x4a1da7&&!_0x3ba8ce['query'][_0xed6e('0x7a')])return[];return db[_0xed6e('0x9a')][_0xed6e('0x42')](_0x38d28e['toString'](),_0x33d7d7);})[_0xed6e('0x27')](function(_0x297954){_0x545bcc[_0xed6e('0x20')]=_0x297954[_0xed6e('0x61')];if(_0x545bcc[_0xed6e('0x20')]===0x0)return[];return db[_0xed6e('0x9a')][_0xed6e('0x42')](_0x3f30f2[_0xed6e('0x9b')](),_0x33d7d7)[_0xed6e('0x27')](function(_0x2b80d0){_0x3bdfc9=_['keyBy'](_0x2b80d0,'id');_0x33d7d7=_[_0xed6e('0x9c')](_0x33d7d7,{'model':db['SmsInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x3ba8ce['query'][_0xed6e('0x47')]){_0x5de59b[_0xed6e('0x46')]['forEach'](function(_0x321ab5){_0x50e341[_0xed6e('0x4d')]('i.'+_0x321ab5);});}else{_0x50e341['field'](_0xed6e('0x90'),_0xed6e('0x63'));_0x50e341[_0xed6e('0x4d')](_0xed6e('0x9d'),_0xed6e('0x9e'));_0x50e341[_0xed6e('0x4d')]('a.mandatoryDisposition',_0xed6e('0x9f'));_0x50e341[_0xed6e('0x4d')](_0xed6e('0xa0'),'contactName');_0x50e341['field']('i.*');_0x50e341[_0xed6e('0x4d')](_0xed6e('0xa1'),_0xed6e('0xa2'));_0x50e341[_0xed6e('0x4d')]('c.lastName',_0xed6e('0xa3'));_0x50e341[_0xed6e('0x4d')](_0xed6e('0xa4'),_0xed6e('0xa5'));_0x50e341[_0xed6e('0x4d')](_0xed6e('0xa6'),'Contact.phone');_0x50e341['field'](_0xed6e('0xa7'),_0xed6e('0xa8'));_0x50e341[_0xed6e('0x4d')]('c.fax','Contact.fax');_0x50e341[_0xed6e('0x4d')](_0xed6e('0xa9'),_0xed6e('0xaa'));_0x50e341['field'](_0xed6e('0xab'),_0xed6e('0xac'));_0x50e341['field'](_0xed6e('0xad'),_0xed6e('0x30'));}if(_0x5de59b[_0xed6e('0x1f')])_0x50e341[_0xed6e('0x1f')](_0x5de59b[_0xed6e('0x1f')]);if(_0x5de59b[_0xed6e('0x1d')])_0x50e341[_0xed6e('0x1d')](_0x5de59b[_0xed6e('0x1d')]);return db[_0xed6e('0x9a')][_0xed6e('0x42')](_0x50e341[_0xed6e('0x9b')](),_0x33d7d7);})['then'](function(_0x2fb381){if(_0x2fb381['length']>0x0)_0x1df0f3[_0xed6e('0x4b')](_0xed6e('0xae'),_[_0xed6e('0x2e')](_0x2fb381,'id'));return db[_0xed6e('0x9a')]['query'](_0x1df0f3['toString'](),_0x33d7d7)['then'](function(_0xdff6c2){var _0x13bc3c=_[_0xed6e('0xaf')](_0xdff6c2,_0xed6e('0xb0'));var _0x1a1ac3=[];_0x2fb381[_0xed6e('0x73')](function(_0x944dc9){_0x1a1ac3[_0xed6e('0x33')](updateSmsInteraction(_0x944dc9,_0x3bdfc9,_0x13bc3c));});return BPromise[_0xed6e('0xb1')](_0x1a1ac3);});});})[_0xed6e('0x27')](function(_0x36c013){_0x545bcc[_0xed6e('0xb2')]=_0x36c013;return _0x545bcc;})['then'](respondWithFilteredResult(_0x366d75,_0x5de59b))[_0xed6e('0x34')](handleError(_0x366d75,null));};exports[_0xed6e('0xb3')]=function(_0x385e20,_0x1177c3){var _0x5aacdc={'raw':![],'where':{'id':_0x385e20['params']['id']}},_0x4bd9de={};_0x4bd9de[_0xed6e('0x41')]=_['keys'](db['SmsInteraction'][_0xed6e('0x3e')]);_0x4bd9de[_0xed6e('0x42')]=_['keys'](_0x385e20[_0xed6e('0x42')]);_0x4bd9de['filters']=_[_0xed6e('0x45')](_0x4bd9de[_0xed6e('0x41')],_0x4bd9de['query']);_0x5aacdc[_0xed6e('0x46')]=_[_0xed6e('0x45')](_0x4bd9de[_0xed6e('0x41')],qs[_0xed6e('0x47')](_0x385e20[_0xed6e('0x42')]['fields']));_0x5aacdc[_0xed6e('0x46')]=_0x5aacdc[_0xed6e('0x46')][_0xed6e('0x61')]?_0x5aacdc[_0xed6e('0x46')]:_0x4bd9de[_0xed6e('0x41')];if(_0x385e20[_0xed6e('0x42')][_0xed6e('0xb4')]){_0x5aacdc[_0xed6e('0xb5')]=[{'all':!![]}];}_0x5aacdc=_['merge']({},_0x5aacdc,_0x385e20[_0xed6e('0xb6')]);return db[_0xed6e('0x3d')]['find'](_0x5aacdc)[_0xed6e('0x27')](handleEntityNotFound(_0x1177c3,null))[_0xed6e('0x27')](respondWithResult(_0x1177c3,null))[_0xed6e('0x34')](handleError(_0x1177c3,null));};exports['create']=function(_0x1e216a,_0x315aa0){return db[_0xed6e('0x3d')]['create'](_0x1e216a[_0xed6e('0x77')],{})[_0xed6e('0x27')](respondWithResult(_0x315aa0,0xc9))[_0xed6e('0x34')](handleError(_0x315aa0,null));};exports[_0xed6e('0x26')]=function(_0x25171b,_0x3ead46){if(_0x25171b[_0xed6e('0x77')]['id']){delete _0x25171b[_0xed6e('0x77')]['id'];}return db[_0xed6e('0x3d')][_0xed6e('0x62')]({'where':{'id':_0x25171b[_0xed6e('0xb7')]['id']}})['then'](handleEntityNotFound(_0x3ead46,null))[_0xed6e('0x27')](saveUpdates(_0x25171b['body'],null))[_0xed6e('0x27')](respondWithResult(_0x3ead46,null))[_0xed6e('0x34')](handleError(_0x3ead46,null));};exports[_0xed6e('0x28')]=function(_0xd64a46,_0x569eff){return db[_0xed6e('0x3d')][_0xed6e('0x62')]({'where':{'id':_0xd64a46['params']['id']}})[_0xed6e('0x27')](handleEntityNotFound(_0x569eff,null))[_0xed6e('0x27')](removeEntity(_0x569eff,null))['catch'](handleError(_0x569eff,null));};exports[_0xed6e('0xb8')]=function(_0x4dc28b,_0x22dbc8){return db[_0xed6e('0x3d')]['describe']()[_0xed6e('0x27')](respondWithResult(_0x22dbc8,null))['catch'](handleError(_0x22dbc8,null));};exports['addMessage']=function(_0x461d4c,_0x2791bf,_0x361916){return db[_0xed6e('0xb9')][_0xed6e('0x62')]({'where':{'id':_0x461d4c[_0xed6e('0xb7')]['id']}})[_0xed6e('0x27')](handleEntityNotFound(_0x2791bf,null))[_0xed6e('0x27')](function(_0x56b29f){if(_0x56b29f){return _0x56b29f['addMessage'](_0x461d4c[_0xed6e('0x77')][_0xed6e('0xba')],_[_0xed6e('0xbb')](_0x461d4c[_0xed6e('0x77')],[_0xed6e('0xba'),'id'])||{});}})[_0xed6e('0x27')](respondWithResult(_0x2791bf,null))[_0xed6e('0x34')](handleError(_0x2791bf,null));};exports['getMessages']=function(_0x15592c,_0x4893fe,_0x463bf3){var _0x5b8c85={'raw':![],'where':{}};var _0x16d3f6={};var _0x1d988e={'count':0x0,'rows':[]};return db['SmsInteraction']['findOne']({'where':{'id':_0x15592c[_0xed6e('0xb7')]['id']}})[_0xed6e('0x27')](handleEntityNotFound(_0x4893fe,null))[_0xed6e('0x27')](function(_0x49fbe5){if(_0x49fbe5){_0x16d3f6[_0xed6e('0x41')]=_['keys'](db[_0xed6e('0xb9')]['rawAttributes']);_0x16d3f6[_0xed6e('0x42')]=_['keys'](_0x15592c[_0xed6e('0x42')]);_0x16d3f6[_0xed6e('0x44')]=_[_0xed6e('0x45')](_0x16d3f6[_0xed6e('0x41')],_0x16d3f6[_0xed6e('0x42')]);_0x5b8c85['attributes']=_[_0xed6e('0x45')](_0x16d3f6[_0xed6e('0x41')],qs[_0xed6e('0x47')](_0x15592c[_0xed6e('0x42')][_0xed6e('0x47')]));_0x5b8c85[_0xed6e('0x46')]=_0x5b8c85['attributes'][_0xed6e('0x61')]?_0x5b8c85['attributes']:_0x16d3f6[_0xed6e('0x41')];if(!_0x15592c[_0xed6e('0x42')][_0xed6e('0xbc')](_0xed6e('0x48'))){_0x5b8c85['limit']=qs[_0xed6e('0x1f')](_0x15592c[_0xed6e('0x42')][_0xed6e('0x1f')]);_0x5b8c85[_0xed6e('0x1d')]=qs['offset'](_0x15592c[_0xed6e('0x42')][_0xed6e('0x1d')]);}_0x5b8c85['order']=qs[_0xed6e('0x4a')](_0x15592c['query'][_0xed6e('0x4a')]);_0x5b8c85[_0xed6e('0x4b')]=qs['filters'](_[_0xed6e('0xbd')](_0x15592c['query'],_0x16d3f6['filters']));_0x5b8c85[_0xed6e('0x4b')][_0xed6e('0xb0')]=_0x49fbe5['id'];if(_0x15592c[_0xed6e('0x42')]['filter']){_0x5b8c85[_0xed6e('0x4b')]=_[_0xed6e('0x9c')](_0x5b8c85[_0xed6e('0x4b')],{'$or':_[_0xed6e('0x2e')](_0x5b8c85[_0xed6e('0x46')],function(_0x48f3ad){var _0x4a5bdf={};_0x4a5bdf[_0x48f3ad]={'$like':'%'+_0x15592c[_0xed6e('0x42')][_0xed6e('0x86')]+'%'};return _0x4a5bdf;})});}if(_0x15592c[_0xed6e('0x42')][_0xed6e('0x7d')]){var _0x5ddb11=_0x15592c[_0xed6e('0x42')][_0xed6e('0x7d')]['split'](',');var _0x3f49da={};_0x3f49da[_0x5ddb11[0x0]]={'$gte':moment(_0x5ddb11[0x1])[_0xed6e('0xbe')](_0xed6e('0xbf'))};_0x5b8c85[_0xed6e('0x4b')]=_['merge'](_0x5b8c85[_0xed6e('0x4b')],_0x3f49da);}_0x5b8c85=_[_0xed6e('0x9c')]({},_0x5b8c85,_0x15592c[_0xed6e('0xb6')]);return db['SmsMessage']['count']({'where':_0x5b8c85[_0xed6e('0x4b')]})[_0xed6e('0x27')](function(_0x6022b4){_0x1d988e[_0xed6e('0x20')]=_0x6022b4;if(_0x15592c[_0xed6e('0x42')][_0xed6e('0xb4')]){_0x5b8c85[_0xed6e('0xb5')]=[{'all':!![]}];}return db[_0xed6e('0xb9')][_0xed6e('0xc0')](_0x5b8c85);})[_0xed6e('0x27')](function(_0x12dcb9){_0x1d988e[_0xed6e('0xb2')]=_0x12dcb9;return _0x1d988e;});}})['then'](respondWithFilteredResult(_0x4893fe,_0x5b8c85))[_0xed6e('0x34')](handleError(_0x4893fe,null));};exports[_0xed6e('0xc1')]=function(_0x33db37,_0x2f6029,_0x1e8290){return db[_0xed6e('0x3d')][_0xed6e('0x62')]({'where':{'id':_0x33db37[_0xed6e('0xb7')]['id']}})['then'](handleEntityNotFound(_0x2f6029,null))[_0xed6e('0x27')](function(_0x242e17){if(_0x242e17){return _0x242e17[_0xed6e('0xc2')](_0x33db37['body']['ids'],_[_0xed6e('0xbb')](_0x33db37['body'],[_0xed6e('0xba'),'id'])||{})[_0xed6e('0xc3')](function(){return db['Tag'][_0xed6e('0xc0')]({'attributes':['id',_0xed6e('0x2c'),'color'],'where':{'id':_0x33db37[_0xed6e('0x77')]['ids']}});})[_0xed6e('0x27')](function(_0x45946c){socket[_0xed6e('0xc4')](_0xed6e('0xc5'),{'id':Number(_0x33db37[_0xed6e('0xb7')]['id']),'tags':_0x45946c||[]});return{'id':Number(_0x33db37[_0xed6e('0xb7')]['id']),'tags':_0x45946c||[]};});}})[_0xed6e('0x27')](respondWithResult(_0x2f6029,null))['catch'](handleError(_0x2f6029,null));};exports[_0xed6e('0xc6')]=function(_0x4d5601,_0xb27eed,_0x1fecee){return db['SmsInteraction']['find']({'where':{'id':_0x4d5601['params']['id']}})[_0xed6e('0x27')](handleEntityNotFound(_0xb27eed,null))[_0xed6e('0x27')](function(_0x16898c){if(_0x16898c){return _0x16898c[_0xed6e('0xc6')](_0x4d5601[_0xed6e('0x42')][_0xed6e('0xba')]);}})['then'](respondWithStatusCode(_0xb27eed,null))[_0xed6e('0x34')](handleError(_0xb27eed,null));};exports['download']=function(_0x313c0c,_0xc9629d){var _0x20e4c6=moment()['unix']()[_0xed6e('0x9b')]();var _0x440eb2=path[_0xed6e('0xc7')](config[_0xed6e('0xc8')],_0xed6e('0xc9'),_0xed6e('0xca'),_0xed6e('0xcb'));var _0x137b78=path[_0xed6e('0xc7')](config[_0xed6e('0xc8')],'server',_0xed6e('0xca'),_0xed6e('0xcc'));var _0x4a1371=path[_0xed6e('0xc7')](_0x440eb2,_0x20e4c6);var _0x2141b1=util['format'](_0xed6e('0xcd'),_0x313c0c[_0xed6e('0xb7')]['id'],_0x20e4c6);var _0x3b7ad7=path[_0xed6e('0xc7')](_0x440eb2,_0x2141b1);var _0x24a11c=[];_0x24a11c['push']({'model':db['User'],'as':_0xed6e('0xce'),'attributes':['id','fullname'],'raw':!![]});_0x24a11c[_0xed6e('0x33')]({'model':db['CmContact'],'as':_0xed6e('0x67'),'attributes':['id','firstName',_0xed6e('0xcf')],'raw':!![]});var _0x102923=[{'model':db[_0xed6e('0xb9')],'as':'Messages','attributes':['id',_0xed6e('0x77'),_0xed6e('0x7c'),'direction','secret',_0xed6e('0x82')],'include':_0x24a11c}];_0x102923[_0xed6e('0x33')]({'model':db[_0xed6e('0xd0')],'as':'Account','attributes':['id',_0xed6e('0x2c')]});_0x102923['push']({'model':db[_0xed6e('0xce')],'as':'Owner','attributes':['id',_0xed6e('0x2f')]});return db['SmsInteraction'][_0xed6e('0x62')]({'where':{'id':_0x313c0c['params']['id']},'include':_0x102923})[_0xed6e('0x27')](handleEntityNotFound(_0xc9629d,null))['then'](function(_0x3f4fb1){if(_0x3f4fb1){var _0x23175a=_0x3f4fb1[_0xed6e('0xd1')]({'plain':!![]});fs[_0xed6e('0xd2')](_0x4a1371);var _0x158d80={'channel':_0xed6e('0xd3'),'account':_0x23175a[_0xed6e('0xd4')]['name'],'agent':_0x23175a[_0xed6e('0xd5')]?_0x23175a['Owner'][_0xed6e('0x2f')]:_0xed6e('0xd6'),'createdAt':moment(_0x23175a[_0xed6e('0x7c')])['format'](_0xed6e('0xbf'))[_0xed6e('0x9b')](),'closedAt':_0x23175a[_0xed6e('0x3b')]?moment(_0x23175a[_0xed6e('0xd7')])['format'](_0xed6e('0xbf'))[_0xed6e('0x9b')]():'','disposition':_0x23175a[_0xed6e('0xd8')],'messages':_(_0x23175a[_0xed6e('0xd9')])[_0xed6e('0x86')]({'secret':![]})[_0xed6e('0x2e')](function(_0xff3dcf){return{'date':moment(_0xff3dcf[_0xed6e('0x7c')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0xed6e('0x9b')](),'sender':_0xff3dcf['direction']===_0xed6e('0xda')?_0xff3dcf[_0xed6e('0xce')]?_0xff3dcf[_0xed6e('0xce')][_0xed6e('0x2f')]:_0xed6e('0xdb'):_0xff3dcf[_0xed6e('0x67')]['firstName']+(_0xff3dcf[_0xed6e('0x67')][_0xed6e('0xcf')]?'\x20'+_0xff3dcf[_0xed6e('0x67')]['lastName']:''),'body':_0xff3dcf[_0xed6e('0x77')],'direction':_0xff3dcf[_0xed6e('0xdc')]==='out'?'A':'C','secret':_0xff3dcf[_0xed6e('0xdd')],'read':_0xff3dcf['read']};})[_0xed6e('0x6a')]()};return ejs[_0xed6e('0xde')](path[_0xed6e('0xc7')](config[_0xed6e('0xc8')],_0xed6e('0xc9'),_0xed6e('0xdf'),_0xed6e('0xe0')),{'interaction':_0x158d80})[_0xed6e('0x27')](function(_0x134879){var _0x1f7172=path['join'](_0x4a1371,_0xed6e('0xe1')+_0x23175a['id']+'-'+_0x20e4c6+'.pdf');var _0x47d1a1={'path':_0x1f7172,'channel':'Sms','interactionId':_0x23175a['id']};return pdf[_0xed6e('0xe2')](_0x134879,_0x47d1a1);})[_0xed6e('0x27')](function(){return new BPromise(function(_0x7fbbc9,_0x364a2d){zipdir(_0x4a1371,{'saveTo':_0x3b7ad7},function(_0x484e07,_0x4733fb){if(_0x484e07)return _0x364a2d(_0x484e07);return _0x7fbbc9(_0x4733fb);});})[_0xed6e('0x27')](function(){return new BPromise(function(_0x3ff99a,_0x1d27cf){rimraf(_0x4a1371,function(_0x5bb17e){if(_0x5bb17e)_0x1d27cf(_0x5bb17e);return _0x3ff99a();});});})[_0xed6e('0x27')](function(){return _0xc9629d['download'](_0x3b7ad7,_0x2141b1,function(_0x275863){if(_0x275863){console['log'](_0xed6e('0xe3'),_0x275863);}else{fs[_0xed6e('0xe4')](_0x3b7ad7);}});});});}else{return _0xc9629d['sendStatus'](0xc8);}})[_0xed6e('0x34')](handleError(_0xc9629d,null));};
\ No newline at end of file
+var _0x556d=['type','text','start','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','body','some','isEmpty','SmsAccountId','where','i.SmsAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','filter','replace','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','group','Sequelize','QueryTypes','SELECT','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','c.fax','Contact.fax','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.SmsInteractionId\x20IN\x20?','groupBy','SmsInteractionId','all','rows','catch','show','params','include','create','describe','SmsMessage','addMessage','ids','omit','getMessages','findOne','hasOwnProperty','format','YYYY-MM-DD\x20HH:mm:ss','options','findAll','addTags','setTags','spread','Tag','color','emit','smsInteractionTags:save','removeTags','download','unix','join','server','files','tmp','root','attachments','transcript-%d-%s.zip','CmContact','Messages','direction','secret','SmsAccount','Account','Owner','mkdirSync','Sms','N.A.','closedAt','disposition','out','System','firstName','lastName','renderFile','views','transcript-','.pdf','createPdfFromHTML','log','err','unlinkSync','eml-format','rimraf','zip-dir','request-promise','moment','mustache','sox','to-csv','ejs','lodash','crypto','desk.js','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','redis','./smsInteraction.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','error','stack','name','send','Users','map','fullname','TagIds','Tags','split','forEach','push','then','waiting','talking','answered','unmanaged','total','UserId','closed','index','SmsInteraction','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','select','field','from','tools_tags','u.id','ui.SmsInteractionId','user_has_sms_interactions','left_join','users','u.id\x20=\x20ui.UserId','sms_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','sms_accounts','sms_messages','me.SmsInteractionId\x20=\x20i.id','sms_interaction_has_tags','it.SmsInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','unreadMessages','having','`\x20>\x200','Contact','operator','value','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','buildExpression'];(function(_0x235d52,_0x481f71){var _0x56a0fd=function(_0x19ce4b){while(--_0x19ce4b){_0x235d52['push'](_0x235d52['shift']());}};_0x56a0fd(++_0x481f71);}(_0x556d,0x83));var _0xd556=function(_0x454ff3,_0x5e1dec){_0x454ff3=_0x454ff3-0x0;var _0xe48eaa=_0x556d[_0x454ff3];return _0xe48eaa;};'use strict';var emlformat=require(_0xd556('0x0'));var rimraf=require(_0xd556('0x1'));var zipdir=require(_0xd556('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd556('0x3'));var moment=require(_0xd556('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd556('0x5'));var util=require('util');var path=require('path');var sox=require(_0xd556('0x6'));var csv=require(_0xd556('0x7'));var ejs=require(_0xd556('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd556('0x9'));var squel=require('squel');var crypto=require(_0xd556('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xd556('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xd556('0xc'));var qs=require('../../components/parsers/qs');var as=require(_0xd556('0xd'));var pdf=require('../../components/export/pdf');var hardwareService=require('../../config/license/hardware');var logger=require(_0xd556('0xe'))(_0xd556('0xf'));var utils=require('../../config/utils');var config=require(_0xd556('0x10'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xd556('0x11')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd556('0x11')]));require(_0xd556('0x12'))[_0xd556('0x13')](socket);function respondWithStatusCode(_0x2b2a46,_0x18282f){_0x18282f=_0x18282f||0xcc;return function(_0x3553fc){if(_0x3553fc){return _0x2b2a46[_0xd556('0x14')](_0x18282f);}return _0x2b2a46[_0xd556('0x15')](_0x18282f)[_0xd556('0x16')]();};}function respondWithResult(_0x560a3e,_0x5a3a79){_0x5a3a79=_0x5a3a79||0xc8;return function(_0x1e1514){if(_0x1e1514){return _0x560a3e[_0xd556('0x15')](_0x5a3a79)[_0xd556('0x17')](_0x1e1514);}};}function respondWithFilteredResult(_0x4b586d,_0x5c5371){return function(_0x3b4d26){if(_0x3b4d26){var _0x2a7eaa=typeof _0x5c5371[_0xd556('0x18')]===_0xd556('0x19')&&typeof _0x5c5371[_0xd556('0x1a')]==='undefined';var _0x9fb511=_0x3b4d26['count'];var _0x4a8903=_0x2a7eaa?0x0:_0x5c5371[_0xd556('0x18')];var _0x5b0e8b=_0x2a7eaa?_0x3b4d26[_0xd556('0x1b')]:_0x5c5371[_0xd556('0x18')]+_0x5c5371['limit'];var _0x25c6f0;if(_0x5b0e8b>=_0x9fb511){_0x5b0e8b=_0x9fb511;_0x25c6f0=0xc8;}else{_0x25c6f0=0xce;}_0x4b586d[_0xd556('0x15')](_0x25c6f0);return _0x4b586d[_0xd556('0x1c')](_0xd556('0x1d'),_0x4a8903+'-'+_0x5b0e8b+'/'+_0x9fb511)['json'](_0x3b4d26);}return null;};}function patchUpdates(_0x4c25f7){return function(_0x3a7c45){try{jsonpatch[_0xd556('0x1e')](_0x3a7c45,_0x4c25f7,!![]);}catch(_0x38a9ae){return BPromise[_0xd556('0x1f')](_0x38a9ae);}return _0x3a7c45[_0xd556('0x20')]();};}function saveUpdates(_0x48d64b,_0x5c1b96){return function(_0x50fa5d){if(_0x50fa5d){return _0x50fa5d[_0xd556('0x21')](_0x48d64b)['then'](function(_0x518f2b){return _0x518f2b;});}return null;};}function removeEntity(_0x54152,_0x51b64e){return function(_0x174a38){if(_0x174a38){return _0x174a38[_0xd556('0x22')]()['then'](function(){_0x54152[_0xd556('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x389066,_0x1c40d2){return function(_0x89db01){if(!_0x89db01){_0x389066['sendStatus'](0x194);}return _0x89db01;};}function handleError(_0x2fd9ea,_0x28a0c8){_0x28a0c8=_0x28a0c8||0x1f4;return function(_0x49635f){logger[_0xd556('0x23')](_0x49635f[_0xd556('0x24')]);if(_0x49635f[_0xd556('0x25')]){delete _0x49635f[_0xd556('0x25')];}_0x2fd9ea[_0xd556('0x15')](_0x28a0c8)[_0xd556('0x26')](_0x49635f);};}function getInteractionUsers(_0x163e5d,_0x2f08cb){return new BPromise(function(_0x539e93,_0x510486){try{if(_0x2f08cb[_0x163e5d['id']]){_0x163e5d[_0xd556('0x27')]=_[_0xd556('0x28')](_0x2f08cb[_0x163e5d['id']],function(_0x13fbec){return{'id':_0x13fbec['id'],'fullname':_0x13fbec[_0xd556('0x29')]};});}}catch(_0x8dcd01){_0x510486(_0x8dcd01);}_0x539e93(_0x163e5d);});}function getInteractionTags(_0x3ae8ca,_0x210385){return new BPromise(function(_0x236381,_0x377871){try{if(_0x3ae8ca[_0xd556('0x2a')]){_0x3ae8ca[_0xd556('0x2b')]=[];_0x3ae8ca[_0xd556('0x2a')][_0xd556('0x2c')](',')[_0xd556('0x2d')](function(_0x2efeeb){_0x3ae8ca['Tags'][_0xd556('0x2e')](_0x210385[_0x2efeeb]);});}delete _0x3ae8ca[_0xd556('0x2a')];}catch(_0x2cfc96){_0x377871(_0x2cfc96);}_0x236381(_0x3ae8ca);});}function updateSmsInteraction(_0xdb97f4,_0x575388,_0x570e92){return new BPromise(function(_0x46874a,_0x577693){return getInteractionUsers(_0xdb97f4,_0x570e92)[_0xd556('0x2f')](function(_0x4852d6){return getInteractionTags(_0x4852d6,_0x575388);})[_0xd556('0x2f')](function(_0x5687fc){return getStateInteraction(_0x5687fc);})[_0xd556('0x2f')](function(_0x3e7faf){_0x46874a(_0x3e7faf);})['catch'](function(_0x180308){_0x577693(_0x180308);});});}function getStateInteraction(_0x3b4722){return new BPromise(function(_0x5c6517){_0x3b4722[_0xd556('0x30')]=0x0;_0x3b4722[_0xd556('0x31')]=0x0;_0x3b4722[_0xd556('0x32')]=0x0;_0x3b4722[_0xd556('0x33')]=0x0;_0x3b4722[_0xd556('0x34')]=0x0;if(!_0x3b4722['closed']&&!_0x3b4722[_0xd556('0x35')]){_0x3b4722[_0xd556('0x30')]+=0x1;}if(!_0x3b4722[_0xd556('0x36')]&&_0x3b4722[_0xd556('0x35')]){_0x3b4722[_0xd556('0x31')]+=0x1;if(_0x3b4722[_0xd556('0x30')]){_0x3b4722[_0xd556('0x30')]-=0x1;}}if(_0x3b4722['closed']&&_0x3b4722['UserId']){_0x3b4722[_0xd556('0x32')]+=0x1;if(_0x3b4722['talking']){_0x3b4722['talking']-=0x1;}}if(_0x3b4722[_0xd556('0x36')]&&!_0x3b4722[_0xd556('0x35')]){_0x3b4722[_0xd556('0x33')]+=0x1;if(_0x3b4722[_0xd556('0x30')]){_0x3b4722['waiting']-=0x1;}}_0x3b4722[_0xd556('0x34')]+=0x1;_0x5c6517(_0x3b4722);});}exports[_0xd556('0x37')]=function(_0x54ada0,_0x3d72d0){var _0x4a7472={},_0x50a547={},_0x4cd680={'count':0x0,'rows':[]};var _0x1eccab=_[_0xd556('0x28')](db[_0xd556('0x38')][_0xd556('0x39')],function(_0x6b077c){return{'name':_0x6b077c[_0xd556('0x3a')],'type':_0x6b077c['type']['key']};});_0x50a547[_0xd556('0x3b')]=_[_0xd556('0x28')](_0x1eccab,'name');_0x50a547[_0xd556('0x3c')]=_[_0xd556('0x3d')](_0x54ada0[_0xd556('0x3c')]);_0x50a547[_0xd556('0x3e')]=_[_0xd556('0x3f')](_0x50a547[_0xd556('0x3b')],_0x50a547[_0xd556('0x3c')]);_0x4a7472[_0xd556('0x40')]=_['intersection'](_0x50a547[_0xd556('0x3b')],qs[_0xd556('0x41')](_0x54ada0[_0xd556('0x3c')]['fields']));_0x4a7472[_0xd556('0x40')]=_0x4a7472[_0xd556('0x40')][_0xd556('0x42')]?_0x4a7472['attributes']:_0x50a547['model'];if(!_0x54ada0[_0xd556('0x3c')]['hasOwnProperty'](_0xd556('0x43'))){_0x4a7472[_0xd556('0x1a')]=qs['limit'](_0x54ada0[_0xd556('0x3c')]['limit']);_0x4a7472[_0xd556('0x18')]=qs['offset'](_0x54ada0[_0xd556('0x3c')][_0xd556('0x18')]);}_0x4a7472[_0xd556('0x44')]=qs[_0xd556('0x45')](_0x54ada0[_0xd556('0x3c')]['sort']);_0x4a7472['where']=qs[_0xd556('0x3e')](_[_0xd556('0x46')](_0x54ada0[_0xd556('0x3c')],_0x50a547['filters']),_0x1eccab);var _0x3da533=[];var _0x5b7d75=squel[_0xd556('0x47')]()[_0xd556('0x48')]('id')[_0xd556('0x48')]('name')[_0xd556('0x48')]('color')[_0xd556('0x49')](_0xd556('0x4a'));var _0xc09ec6=squel[_0xd556('0x47')]()[_0xd556('0x48')](_0xd556('0x4b'))[_0xd556('0x48')]('u.fullname')['field'](_0xd556('0x4c'))[_0xd556('0x49')](_0xd556('0x4d'),'ui')[_0xd556('0x4e')](_0xd556('0x4f'),'u',_0xd556('0x50'));var _0x459f39=squel[_0xd556('0x47')]()[_0xd556('0x49')](_0xd556('0x51'),'i')[_0xd556('0x4e')](_0xd556('0x52'),'c',_0xd556('0x53'))[_0xd556('0x4e')](_0xd556('0x4f'),'o',_0xd556('0x54'))['left_join'](_0xd556('0x55'),'a','a.id\x20=\x20i.SmsAccountId')[_0xd556('0x4e')](_0xd556('0x56'),'me',_0xd556('0x57'))[_0xd556('0x4e')](_0xd556('0x58'),'it',_0xd556('0x59'))[_0xd556('0x4e')](_0xd556('0x4a'),'t',_0xd556('0x5a'));var _0x13b3c1=squel['expr']();var _0x4c2853=[];var _0x2faab0=squel[_0xd556('0x5b')]();var _0x37cbdc;if(_0x54ada0[_0xd556('0x3c')][_0xd556('0x5c')]){_0x37cbdc=as['parseSearch'](_0x54ada0[_0xd556('0x3c')][_0xd556('0x5c')]);var _0x50e723=_0x37cbdc[_0xd556('0x5d')];for(var _0x19ce54=0x0;_0x19ce54<_0x37cbdc[_0xd556('0x5e')][_0xd556('0x42')];_0x19ce54++){var _0x345188=_0x37cbdc[_0xd556('0x5e')][_0x19ce54];var _0x10fde5='i';var _0x5129a2=_['find'](_0x1eccab,[_0xd556('0x25'),_0x345188[_0xd556('0x48')]]);if(!_0x5129a2){switch(_0x345188[_0xd556('0x48')]){case _0xd556('0x5f'):if(_0x345188['value']==0x1){_0x459f39[_0xd556('0x60')]('`'+_0x345188[_0xd556('0x48')]+'`\x20=\x200');}else{_0x459f39[_0xd556('0x60')]('`'+_0x345188[_0xd556('0x48')]+_0xd556('0x61'));}break;case _0xd556('0x62'):if(_0x345188[_0xd556('0x63')]==='$substring'){if(_0x345188[_0xd556('0x64')][_0xd556('0x2c')]('\x20')[_0xd556('0x42')]>0x1){_0x13b3c1[_0x50e723](_0xd556('0x65'),qs['getFullTextValue'](_0x345188[_0xd556('0x64')]),null);}else{var _0x296b29='%'+_0x345188[_0xd556('0x64')]+'%';_0x13b3c1[_0x50e723](_0xd556('0x66'),_0x296b29,_0x296b29,_0x296b29);}}else{_0x5129a2=_[_0xd556('0x67')](_0x1eccab,[_0xd556('0x25'),_0xd556('0x68')]);_0x345188[_0xd556('0x48')]=_0xd556('0x68');_0x22b037=as[_0xd556('0x69')](_0x10fde5,_0x5129a2[_0xd556('0x6a')],_0x345188);_0x13b3c1[_0x50e723](_0x22b037[_0xd556('0x6b')],_0x22b037[_0xd556('0x64')][_0xd556('0x6c')],_0x22b037[_0xd556('0x64')][_0xd556('0x16')]);}break;case'Tag':var _0x570db0=_0x345188[_0xd556('0x64')][_0xd556('0x2c')](',')[_0xd556('0x28')](function(_0x3181aa){return Number(_0x3181aa);});_0x570db0['forEach'](function(_0x481928){_0x2faab0['or'](_0xd556('0x6d'),'%,'+_0x481928+',%');});_0x4c2853=_['union'](_0x4c2853,_0x570db0);break;case _0xd556('0x6e'):if(_0x345188[_0xd556('0x63')]==='$substring'){_0x13b3c1[_0x50e723](_0xd556('0x6f'),'%'+_0x345188[_0xd556('0x64')]+'%',null);}else{_0x5129a2=_['find'](_0x1eccab,[_0xd556('0x25'),_0xd556('0x35')]);_0x345188[_0xd556('0x48')]='UserId';_0x22b037=as[_0xd556('0x69')](_0x10fde5,_0x5129a2[_0xd556('0x6a')],_0x345188);_0x13b3c1[_0x50e723](_0x22b037[_0xd556('0x6b')],_0x22b037[_0xd556('0x64')][_0xd556('0x6c')],_0x22b037['value']['end']);}break;case _0xd556('0x70'):_0x22b037=as[_0xd556('0x69')]('me',null,_0x345188);_0x13b3c1[_0x50e723](_0x22b037[_0xd556('0x6b')],_0x22b037['value'][_0xd556('0x6c')],_0x22b037[_0xd556('0x64')][_0xd556('0x16')]);break;}}else{var _0x22b037=as[_0xd556('0x69')](_0x10fde5,_0x5129a2['type'],_0x345188);_0x13b3c1[_0x50e723](_0x22b037['text'],_0x22b037['value'][_0xd556('0x6c')],_0x22b037[_0xd556('0x64')]['end']);}}}else{var _0x4c68e2=_(_0x54ada0['query'])[_0xd556('0x3d')]()['map'](function(_0x2fa6ad){return _[_0xd556('0x71')](_0x1eccab,[_0xd556('0x25'),_0x2fa6ad])?_0x2fa6ad:undefined;})['compact']()[_0xd556('0x64')]();if(!_[_0xd556('0x72')](_0x4c68e2)){_0x4c68e2['forEach'](function(_0x502fb1){if(_0x502fb1===_0xd556('0x73')){_0x459f39[_0xd556('0x74')](_0xd556('0x75'),[][_0xd556('0x76')](_0x54ada0[_0xd556('0x3c')][_0x502fb1]));}else if(_0x502fb1===_0xd556('0x77')){var _0xa3ce5c=JSON[_0xd556('0x78')](_0x54ada0[_0xd556('0x3c')][_0x502fb1])[_0xd556('0x79')];var _0x15b946=JSON['parse'](_0x54ada0['query'][_0x502fb1])[_0xd556('0x7a')];_0x459f39[_0xd556('0x74')](_0xd556('0x7b'),_0xa3ce5c,_0x15b946);}else{if(_0x54ada0['query'][_0x502fb1]===_0xd556('0x7c')){_0x459f39['where']('i.'+_0x502fb1+_0xd556('0x7d'));}else{_0x459f39[_0xd556('0x74')]('i.'+_0x502fb1+'\x20=\x20?',_0x54ada0['query'][_0x502fb1]);}}});}if(_0x54ada0[_0xd556('0x3c')]['read']){if(_0x54ada0[_0xd556('0x3c')][_0xd556('0x7e')]==0x1){_0x459f39['having'](_0xd556('0x7f'));}else{_0x459f39[_0xd556('0x60')](_0xd556('0x80'));}}if(_0x54ada0['query'][_0xd556('0x81')]){_0x4c2853=_['isArray'](_0x54ada0[_0xd556('0x3c')][_0xd556('0x81')])?_0x54ada0[_0xd556('0x3c')][_0xd556('0x81')]:new Array(_0x54ada0[_0xd556('0x3c')][_0xd556('0x81')]);_0x4c2853[_0xd556('0x2d')](function(_0xf27e2b){_0x2faab0['or'](_0xd556('0x6d'),'%,'+_0xf27e2b+',%');});}if(_0x54ada0[_0xd556('0x3c')][_0xd556('0x82')]){var _0x5e8378=_0x54ada0[_0xd556('0x3c')]['filter'][_0xd556('0x83')]('\x5c','\x5c\x5c')[_0xd556('0x83')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x5e8378)){_0x13b3c1['or'](_0xd556('0x84'),_0x5e8378+'%')['or']('i.phone\x20LIKE\x20?',_0x5e8378+'%');}else{_0x13b3c1['or'](_0xd556('0x85'),qs[_0xd556('0x86')](_0x5e8378))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x5e8378+'%');}}}_0x459f39[_0xd556('0x74')](_0x13b3c1);_0x459f39[_0xd556('0x87')]('i.id');var _0x27370f={'type':db[_0xd556('0x88')][_0xd556('0x89')][_0xd556('0x8a')],'raw':!![]};var _0x4983fa=_0x459f39[_0xd556('0x8b')]();_0x4983fa['field'](_0xd556('0x8c'));_0x4983fa[_0xd556('0x48')](_0xd556('0x8d'),_0xd556('0x5f'));if(_0x4a7472[_0xd556('0x44')]){_0x4a7472[_0xd556('0x44')]['forEach'](function(_0x2038f2){var _0x3b43b4=_0x2038f2[0x0]===_0xd556('0x8e')?_0x2038f2[0x0]:'i.'+_0x2038f2[0x0];_0x459f39['order'](_0x3b43b4,_0x2038f2[0x1]===_0xd556('0x8f')?![]:!![]);});}if(!_[_0xd556('0x72')](_0x4c2853)){_0x459f39[_0xd556('0x60')](_0x2faab0);_0x4983fa[_0xd556('0x74')](_0xd556('0x90'),_0x4c2853);}BPromise['resolve']()['then'](function(){if(!_0x37cbdc){if(_0x54ada0[_0xd556('0x3c')]['SmsAccountId'])return;_0x4983fa[_0xd556('0x74')](_0xd556('0x91'));_0x459f39[_0xd556('0x74')](_0xd556('0x91'));return;}if(_0x54ada0[_0xd556('0x92')][_0xd556('0x93')]!==_0xd556('0x94'))return;return _0x54ada0[_0xd556('0x92')][_0xd556('0x95')]({'attributes':['id'],'raw':!![]})[_0xd556('0x2f')](function(_0x5f5c25){if(_[_0xd556('0x72')](_0x5f5c25)){_0x4983fa[_0xd556('0x74')](_0xd556('0x96'));_0x459f39[_0xd556('0x74')](_0xd556('0x96'));}else{_0x4983fa[_0xd556('0x74')](_0xd556('0x75'),_[_0xd556('0x28')](_0x5f5c25,'id'));_0x459f39['where'](_0xd556('0x75'),_['map'](_0x5f5c25,'id'));}});})[_0xd556('0x2f')](function(){if(_0x54ada0['user'][_0xd556('0x93')]==='agent'&&!_0x37cbdc&&!_0x54ada0[_0xd556('0x3c')][_0xd556('0x73')])return[];return db[_0xd556('0x97')][_0xd556('0x3c')](_0x4983fa[_0xd556('0x98')](),_0x27370f);})[_0xd556('0x2f')](function(_0x314f9e){_0x4cd680[_0xd556('0x1b')]=_0x314f9e[_0xd556('0x42')];if(_0x4cd680[_0xd556('0x1b')]===0x0)return[];return db[_0xd556('0x97')][_0xd556('0x3c')](_0x5b7d75[_0xd556('0x98')](),_0x27370f)[_0xd556('0x2f')](function(_0x595394){_0x3da533=_[_0xd556('0x99')](_0x595394,'id');_0x27370f=_[_0xd556('0x9a')](_0x27370f,{'model':db['SmsInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x54ada0[_0xd556('0x3c')][_0xd556('0x41')]){_0x4a7472['attributes'][_0xd556('0x2d')](function(_0x50cd3d){_0x459f39['field']('i.'+_0x50cd3d);});}else{_0x459f39[_0xd556('0x48')](_0xd556('0x8d'),_0xd556('0x5f'));_0x459f39[_0xd556('0x48')](_0xd556('0x9b'),'Account.key');_0x459f39[_0xd556('0x48')](_0xd556('0x9c'),_0xd556('0x9d'));_0x459f39['field'](_0xd556('0x9e'),_0xd556('0x8e'));_0x459f39[_0xd556('0x48')](_0xd556('0x9f'));_0x459f39[_0xd556('0x48')](_0xd556('0xa0'),_0xd556('0xa1'));_0x459f39['field'](_0xd556('0xa2'),_0xd556('0xa3'));_0x459f39[_0xd556('0x48')](_0xd556('0xa4'),_0xd556('0xa5'));_0x459f39['field'](_0xd556('0xa6'),_0xd556('0xa7'));_0x459f39[_0xd556('0x48')](_0xd556('0xa8'),'Contact.mobile');_0x459f39[_0xd556('0x48')](_0xd556('0xa9'),_0xd556('0xaa'));_0x459f39[_0xd556('0x48')]('o.fullname',_0xd556('0xab'));_0x459f39[_0xd556('0x48')]('o.internal',_0xd556('0xac'));_0x459f39['field'](_0xd556('0xad'),_0xd556('0x2a'));}if(_0x4a7472[_0xd556('0x1a')])_0x459f39[_0xd556('0x1a')](_0x4a7472['limit']);if(_0x4a7472['offset'])_0x459f39['offset'](_0x4a7472[_0xd556('0x18')]);return db['sequelize']['query'](_0x459f39[_0xd556('0x98')](),_0x27370f);})[_0xd556('0x2f')](function(_0x4253ab){if(_0x4253ab['length']>0x0)_0xc09ec6[_0xd556('0x74')](_0xd556('0xae'),_[_0xd556('0x28')](_0x4253ab,'id'));return db[_0xd556('0x97')][_0xd556('0x3c')](_0xc09ec6[_0xd556('0x98')](),_0x27370f)[_0xd556('0x2f')](function(_0x45ab1e){var _0x50d885=_[_0xd556('0xaf')](_0x45ab1e,_0xd556('0xb0'));var _0x16f313=[];_0x4253ab[_0xd556('0x2d')](function(_0x3c2557){_0x16f313['push'](updateSmsInteraction(_0x3c2557,_0x3da533,_0x50d885));});return BPromise[_0xd556('0xb1')](_0x16f313);});});})[_0xd556('0x2f')](function(_0x1568ca){_0x4cd680[_0xd556('0xb2')]=_0x1568ca;return _0x4cd680;})['then'](respondWithFilteredResult(_0x3d72d0,_0x4a7472))[_0xd556('0xb3')](handleError(_0x3d72d0,null));};exports[_0xd556('0xb4')]=function(_0x3b5ca0,_0x9667ce){var _0x341638={'raw':![],'where':{'id':_0x3b5ca0[_0xd556('0xb5')]['id']}},_0x421f14={};_0x421f14[_0xd556('0x3b')]=_[_0xd556('0x3d')](db[_0xd556('0x38')][_0xd556('0x39')]);_0x421f14[_0xd556('0x3c')]=_[_0xd556('0x3d')](_0x3b5ca0[_0xd556('0x3c')]);_0x421f14[_0xd556('0x3e')]=_[_0xd556('0x3f')](_0x421f14[_0xd556('0x3b')],_0x421f14[_0xd556('0x3c')]);_0x341638['attributes']=_[_0xd556('0x3f')](_0x421f14[_0xd556('0x3b')],qs[_0xd556('0x41')](_0x3b5ca0[_0xd556('0x3c')]['fields']));_0x341638[_0xd556('0x40')]=_0x341638['attributes']['length']?_0x341638['attributes']:_0x421f14[_0xd556('0x3b')];if(_0x3b5ca0['query']['includeAll']){_0x341638[_0xd556('0xb6')]=[{'all':!![]}];}_0x341638=_[_0xd556('0x9a')]({},_0x341638,_0x3b5ca0['options']);return db[_0xd556('0x38')][_0xd556('0x67')](_0x341638)[_0xd556('0x2f')](handleEntityNotFound(_0x9667ce,null))[_0xd556('0x2f')](respondWithResult(_0x9667ce,null))['catch'](handleError(_0x9667ce,null));};exports[_0xd556('0xb7')]=function(_0x82de28,_0x4d4768){return db[_0xd556('0x38')][_0xd556('0xb7')](_0x82de28[_0xd556('0x70')],{})[_0xd556('0x2f')](respondWithResult(_0x4d4768,0xc9))[_0xd556('0xb3')](handleError(_0x4d4768,null));};exports[_0xd556('0x21')]=function(_0x3488c5,_0x4e35c9){if(_0x3488c5[_0xd556('0x70')]['id']){delete _0x3488c5[_0xd556('0x70')]['id'];}return db[_0xd556('0x38')]['find']({'where':{'id':_0x3488c5['params']['id']}})[_0xd556('0x2f')](handleEntityNotFound(_0x4e35c9,null))[_0xd556('0x2f')](saveUpdates(_0x3488c5['body'],null))[_0xd556('0x2f')](respondWithResult(_0x4e35c9,null))[_0xd556('0xb3')](handleError(_0x4e35c9,null));};exports['destroy']=function(_0x45372f,_0x314d0e){return db[_0xd556('0x38')][_0xd556('0x67')]({'where':{'id':_0x45372f[_0xd556('0xb5')]['id']}})['then'](handleEntityNotFound(_0x314d0e,null))['then'](removeEntity(_0x314d0e,null))[_0xd556('0xb3')](handleError(_0x314d0e,null));};exports[_0xd556('0xb8')]=function(_0x4ade3e,_0x4d40ee){return db[_0xd556('0x38')]['describe']()['then'](respondWithResult(_0x4d40ee,null))['catch'](handleError(_0x4d40ee,null));};exports['addMessage']=function(_0x3b40b7,_0x5aa62e,_0x3d3a24){return db[_0xd556('0xb9')][_0xd556('0x67')]({'where':{'id':_0x3b40b7[_0xd556('0xb5')]['id']}})[_0xd556('0x2f')](handleEntityNotFound(_0x5aa62e,null))[_0xd556('0x2f')](function(_0x531426){if(_0x531426){return _0x531426[_0xd556('0xba')](_0x3b40b7[_0xd556('0x70')][_0xd556('0xbb')],_[_0xd556('0xbc')](_0x3b40b7[_0xd556('0x70')],['ids','id'])||{});}})[_0xd556('0x2f')](respondWithResult(_0x5aa62e,null))['catch'](handleError(_0x5aa62e,null));};exports[_0xd556('0xbd')]=function(_0x26c2bc,_0x42c37b,_0xc128a2){var _0x8c42e8={'raw':![],'where':{}};var _0x518a7c={};var _0x380a4f={'count':0x0,'rows':[]};return db[_0xd556('0x38')][_0xd556('0xbe')]({'where':{'id':_0x26c2bc['params']['id']}})[_0xd556('0x2f')](handleEntityNotFound(_0x42c37b,null))['then'](function(_0xf3c3ae){if(_0xf3c3ae){_0x518a7c[_0xd556('0x3b')]=_[_0xd556('0x3d')](db[_0xd556('0xb9')][_0xd556('0x39')]);_0x518a7c[_0xd556('0x3c')]=_[_0xd556('0x3d')](_0x26c2bc[_0xd556('0x3c')]);_0x518a7c[_0xd556('0x3e')]=_[_0xd556('0x3f')](_0x518a7c[_0xd556('0x3b')],_0x518a7c['query']);_0x8c42e8[_0xd556('0x40')]=_[_0xd556('0x3f')](_0x518a7c['model'],qs['fields'](_0x26c2bc[_0xd556('0x3c')][_0xd556('0x41')]));_0x8c42e8[_0xd556('0x40')]=_0x8c42e8[_0xd556('0x40')]['length']?_0x8c42e8['attributes']:_0x518a7c['model'];if(!_0x26c2bc['query'][_0xd556('0xbf')](_0xd556('0x43'))){_0x8c42e8[_0xd556('0x1a')]=qs[_0xd556('0x1a')](_0x26c2bc[_0xd556('0x3c')][_0xd556('0x1a')]);_0x8c42e8[_0xd556('0x18')]=qs['offset'](_0x26c2bc[_0xd556('0x3c')][_0xd556('0x18')]);}_0x8c42e8['order']=qs[_0xd556('0x45')](_0x26c2bc[_0xd556('0x3c')][_0xd556('0x45')]);_0x8c42e8[_0xd556('0x74')]=qs[_0xd556('0x3e')](_[_0xd556('0x46')](_0x26c2bc[_0xd556('0x3c')],_0x518a7c[_0xd556('0x3e')]));_0x8c42e8['where'][_0xd556('0xb0')]=_0xf3c3ae['id'];if(_0x26c2bc[_0xd556('0x3c')]['filter']){_0x8c42e8[_0xd556('0x74')]=_[_0xd556('0x9a')](_0x8c42e8[_0xd556('0x74')],{'$or':_[_0xd556('0x28')](_0x8c42e8[_0xd556('0x40')],function(_0x210086){var _0x236358={};_0x236358[_0x210086]={'$like':'%'+_0x26c2bc[_0xd556('0x3c')][_0xd556('0x82')]+'%'};return _0x236358;})});}if(_0x26c2bc[_0xd556('0x3c')][_0xd556('0x79')]){var _0x5478b6=_0x26c2bc['query'][_0xd556('0x79')][_0xd556('0x2c')](',');var _0x38fef6={};_0x38fef6[_0x5478b6[0x0]]={'$gte':moment(_0x5478b6[0x1])[_0xd556('0xc0')](_0xd556('0xc1'))};_0x8c42e8[_0xd556('0x74')]=_['merge'](_0x8c42e8[_0xd556('0x74')],_0x38fef6);}_0x8c42e8=_['merge']({},_0x8c42e8,_0x26c2bc[_0xd556('0xc2')]);return db[_0xd556('0xb9')][_0xd556('0x1b')]({'where':_0x8c42e8[_0xd556('0x74')]})['then'](function(_0x13a59e){_0x380a4f['count']=_0x13a59e;if(_0x26c2bc[_0xd556('0x3c')]['includeAll']){_0x8c42e8[_0xd556('0xb6')]=[{'all':!![]}];}return db[_0xd556('0xb9')][_0xd556('0xc3')](_0x8c42e8);})['then'](function(_0x5ca5cd){_0x380a4f[_0xd556('0xb2')]=_0x5ca5cd;return _0x380a4f;});}})['then'](respondWithFilteredResult(_0x42c37b,_0x8c42e8))[_0xd556('0xb3')](handleError(_0x42c37b,null));};exports[_0xd556('0xc4')]=function(_0x101e90,_0x2402ae,_0x2506dc){return db[_0xd556('0x38')][_0xd556('0x67')]({'where':{'id':_0x101e90[_0xd556('0xb5')]['id']}})[_0xd556('0x2f')](handleEntityNotFound(_0x2402ae,null))['then'](function(_0xed7da4){if(_0xed7da4){return _0xed7da4[_0xd556('0xc5')](_0x101e90[_0xd556('0x70')][_0xd556('0xbb')],_['omit'](_0x101e90[_0xd556('0x70')],[_0xd556('0xbb'),'id'])||{})[_0xd556('0xc6')](function(){return db[_0xd556('0xc7')][_0xd556('0xc3')]({'attributes':['id','name',_0xd556('0xc8')],'where':{'id':_0x101e90[_0xd556('0x70')]['ids']}});})['then'](function(_0x2f81f2){socket[_0xd556('0xc9')](_0xd556('0xca'),{'id':Number(_0x101e90[_0xd556('0xb5')]['id']),'tags':_0x2f81f2||[]});return{'id':Number(_0x101e90[_0xd556('0xb5')]['id']),'tags':_0x2f81f2||[]};});}})[_0xd556('0x2f')](respondWithResult(_0x2402ae,null))[_0xd556('0xb3')](handleError(_0x2402ae,null));};exports[_0xd556('0xcb')]=function(_0x186f44,_0x123aa4,_0x5008b6){return db[_0xd556('0x38')][_0xd556('0x67')]({'where':{'id':_0x186f44[_0xd556('0xb5')]['id']}})['then'](handleEntityNotFound(_0x123aa4,null))[_0xd556('0x2f')](function(_0x1ac034){if(_0x1ac034){return _0x1ac034[_0xd556('0xcb')](_0x186f44[_0xd556('0x3c')][_0xd556('0xbb')]);}})[_0xd556('0x2f')](respondWithStatusCode(_0x123aa4,null))['catch'](handleError(_0x123aa4,null));};exports[_0xd556('0xcc')]=function(_0x2fcc67,_0x430cc7){var _0x4754e0=moment()[_0xd556('0xcd')]()[_0xd556('0x98')]();var _0x586f17=path[_0xd556('0xce')](config['root'],_0xd556('0xcf'),_0xd556('0xd0'),_0xd556('0xd1'));var _0x4e5f8e=path[_0xd556('0xce')](config[_0xd556('0xd2')],_0xd556('0xcf'),_0xd556('0xd0'),_0xd556('0xd3'));var _0x191818=path[_0xd556('0xce')](_0x586f17,_0x4754e0);var _0xcb4013=util[_0xd556('0xc0')](_0xd556('0xd4'),_0x2fcc67[_0xd556('0xb5')]['id'],_0x4754e0);var _0x477a79=path[_0xd556('0xce')](_0x586f17,_0xcb4013);var _0x1b3932=[];_0x1b3932[_0xd556('0x2e')]({'model':db[_0xd556('0x6e')],'as':_0xd556('0x6e'),'attributes':['id',_0xd556('0x29')],'raw':!![]});_0x1b3932[_0xd556('0x2e')]({'model':db[_0xd556('0xd5')],'as':_0xd556('0x62'),'attributes':['id','firstName','lastName'],'raw':!![]});var _0x464369=[{'model':db[_0xd556('0xb9')],'as':_0xd556('0xd6'),'attributes':['id',_0xd556('0x70'),_0xd556('0x77'),_0xd556('0xd7'),_0xd556('0xd8'),_0xd556('0x7e')],'include':_0x1b3932}];_0x464369[_0xd556('0x2e')]({'model':db[_0xd556('0xd9')],'as':_0xd556('0xda'),'attributes':['id','name']});_0x464369[_0xd556('0x2e')]({'model':db[_0xd556('0x6e')],'as':_0xd556('0xdb'),'attributes':['id',_0xd556('0x29')]});return db[_0xd556('0x38')][_0xd556('0x67')]({'where':{'id':_0x2fcc67[_0xd556('0xb5')]['id']},'include':_0x464369})[_0xd556('0x2f')](handleEntityNotFound(_0x430cc7,null))[_0xd556('0x2f')](function(_0x324c89){if(_0x324c89){var _0x49614e=_0x324c89['get']({'plain':!![]});fs[_0xd556('0xdc')](_0x191818);var _0x1c4983={'channel':_0xd556('0xdd'),'account':_0x49614e[_0xd556('0xda')][_0xd556('0x25')],'agent':_0x49614e[_0xd556('0xdb')]?_0x49614e['Owner'][_0xd556('0x29')]:_0xd556('0xde'),'createdAt':moment(_0x49614e[_0xd556('0x77')])['format'](_0xd556('0xc1'))[_0xd556('0x98')](),'closedAt':_0x49614e[_0xd556('0x36')]?moment(_0x49614e[_0xd556('0xdf')])[_0xd556('0xc0')](_0xd556('0xc1'))['toString']():'','disposition':_0x49614e[_0xd556('0xe0')],'messages':_(_0x49614e[_0xd556('0xd6')])[_0xd556('0x82')]({'secret':![]})[_0xd556('0x28')](function(_0x3e04a7){return{'date':moment(_0x3e04a7[_0xd556('0x77')])[_0xd556('0xc0')](_0xd556('0xc1'))[_0xd556('0x98')](),'sender':_0x3e04a7[_0xd556('0xd7')]===_0xd556('0xe1')?_0x3e04a7[_0xd556('0x6e')]?_0x3e04a7[_0xd556('0x6e')]['fullname']:_0xd556('0xe2'):_0x3e04a7[_0xd556('0x62')][_0xd556('0xe3')]+(_0x3e04a7[_0xd556('0x62')][_0xd556('0xe4')]?'\x20'+_0x3e04a7[_0xd556('0x62')]['lastName']:''),'body':_0x3e04a7['body'],'direction':_0x3e04a7[_0xd556('0xd7')]===_0xd556('0xe1')?'A':'C','secret':_0x3e04a7[_0xd556('0xd8')],'read':_0x3e04a7[_0xd556('0x7e')]};})[_0xd556('0x64')]()};return ejs[_0xd556('0xe5')](path[_0xd556('0xce')](config[_0xd556('0xd2')],'server',_0xd556('0xe6'),'downloadInteraction.ejs'),{'interaction':_0x1c4983})[_0xd556('0x2f')](function(_0x53188e){var _0x1d065a=path[_0xd556('0xce')](_0x191818,_0xd556('0xe7')+_0x49614e['id']+'-'+_0x4754e0+_0xd556('0xe8'));var _0x3a14db={'path':_0x1d065a,'channel':_0xd556('0xdd'),'interactionId':_0x49614e['id']};return pdf[_0xd556('0xe9')](_0x53188e,_0x3a14db);})[_0xd556('0x2f')](function(){return new BPromise(function(_0x554696,_0x380cca){zipdir(_0x191818,{'saveTo':_0x477a79},function(_0x55c5d3,_0xa0058f){if(_0x55c5d3)return _0x380cca(_0x55c5d3);return _0x554696(_0xa0058f);});})['then'](function(){return new BPromise(function(_0x4c98ff,_0x27145f){rimraf(_0x191818,function(_0x55970e){if(_0x55970e)_0x27145f(_0x55970e);return _0x4c98ff();});});})[_0xd556('0x2f')](function(){return _0x430cc7['download'](_0x477a79,_0xcb4013,function(_0x22b7b7){if(_0x22b7b7){console[_0xd556('0xea')](_0xd556('0xeb'),_0x22b7b7);}else{fs[_0xd556('0xec')](_0x477a79);}});});});}else{return _0x430cc7[_0xd556('0x14')](0xc8);}})[_0xd556('0xb3')](handleError(_0x430cc7,null));};
\ No newline at end of file
index cb0817b..5e216b1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7708=['hook','exports','events','../../mysqldb','remove','getUsers','then','setDataValue','Users','map','length','emit','catch'];(function(_0x3f81ac,_0x1bd843){var _0x42f220=function(_0x2cd06f){while(--_0x2cd06f){_0x3f81ac['push'](_0x3f81ac['shift']());}};_0x42f220(++_0x1bd843);}(_0x7708,0x188));var _0x8770=function(_0x3e961c,_0x5747e7){_0x3e961c=_0x3e961c-0x0;var _0x474f9c=_0x7708[_0x3e961c];return _0x474f9c;};'use strict';var EventEmitter=require(_0x8770('0x0'));var SmsInteraction=require(_0x8770('0x1'))['db']['SmsInteraction'];var SmsMessage=require(_0x8770('0x1'))['db']['SmsMessage'];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x8770('0x2')};function emitEvent(_0x1a796d){return function(_0x577b13,_0x40d401,_0x50bab7){_0x577b13[_0x8770('0x3')]({'attributes':['id'],'raw':!![]})[_0x8770('0x4')](function(_0x2b0295){_0x577b13[_0x8770('0x5')](_0x8770('0x6'),_0x2b0295[_0x8770('0x7')](function(_0x2d4a1d){return{'id':_0x2d4a1d['id']};}));return SmsMessage['findAll']({'where':{'SmsInteractionId':_0x577b13['id'],'direction':'in','read':![]},'raw':!![]});})[_0x8770('0x4')](function(_0x2ca830){_0x577b13[_0x8770('0x5')]('unreadMessages',_0x2ca830[_0x8770('0x8')]);SmsInteractionEvents[_0x8770('0x9')](_0x1a796d+':'+_0x577b13['id'],_0x577b13);SmsInteractionEvents[_0x8770('0x9')](_0x1a796d,_0x577b13);_0x50bab7(null);})[_0x8770('0xa')](_0x50bab7(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsInteraction[_0x8770('0xb')](e,emitEvent(event));}}module[_0x8770('0xc')]=SmsInteractionEvents;
\ No newline at end of file
+var _0x1775=['map','findAll','length','emit','catch','hasOwnProperty','exports','../../mysqldb','SmsInteraction','SmsMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users'];(function(_0x5c4aa8,_0x55b4dc){var _0x8ab9e4=function(_0x7b0ce2){while(--_0x7b0ce2){_0x5c4aa8['push'](_0x5c4aa8['shift']());}};_0x8ab9e4(++_0x55b4dc);}(_0x1775,0x1db));var _0x5177=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x1775[_0x502c7d];return _0x30b7ed;};'use strict';var EventEmitter=require('events');var SmsInteraction=require(_0x5177('0x0'))['db'][_0x5177('0x1')];var SmsMessage=require(_0x5177('0x0'))['db'][_0x5177('0x2')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x5177('0x3')](0x0);var events={'afterCreate':_0x5177('0x4'),'afterUpdate':_0x5177('0x5'),'afterDestroy':_0x5177('0x6')};function emitEvent(_0x359401){return function(_0x51275f,_0x159a20,_0x2c5c42){_0x51275f[_0x5177('0x7')]({'attributes':['id'],'raw':!![]})[_0x5177('0x8')](function(_0x300b43){_0x51275f[_0x5177('0x9')](_0x5177('0xa'),_0x300b43[_0x5177('0xb')](function(_0x16e7a7){return{'id':_0x16e7a7['id']};}));return SmsMessage[_0x5177('0xc')]({'where':{'SmsInteractionId':_0x51275f['id'],'direction':'in','read':![]},'raw':!![]});})[_0x5177('0x8')](function(_0x206035){_0x51275f['setDataValue']('unreadMessages',_0x206035[_0x5177('0xd')]);SmsInteractionEvents[_0x5177('0xe')](_0x359401+':'+_0x51275f['id'],_0x51275f);SmsInteractionEvents[_0x5177('0xe')](_0x359401,_0x51275f);_0x2c5c42(null);})[_0x5177('0xf')](_0x2c5c42(null));};}for(var e in events){if(events[_0x5177('0x10')](e)){var event=events[e];SmsInteraction['hook'](e,emitEvent(event));}}module[_0x5177('0x11')]=SmsInteractionEvents;
\ No newline at end of file
index 3364e3e..c0c92fa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7bd4=['closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./smsInteraction.attributes','define','SmsInteraction','sms_interactions','changed','closed'];(function(_0x14d5d4,_0x306d19){var _0x50988a=function(_0x2f67f8){while(--_0x2f67f8){_0x14d5d4['push'](_0x14d5d4['shift']());}};_0x50988a(++_0x306d19);}(_0x7bd4,0xbe));var _0x47bd=function(_0x310bbd,_0x2ef0be){_0x310bbd=_0x310bbd-0x0;var _0x56af29=_0x7bd4[_0x310bbd];return _0x56af29;};'use strict';var _=require(_0x47bd('0x0'));var util=require(_0x47bd('0x1'));var logger=require(_0x47bd('0x2'))(_0x47bd('0x3'));var moment=require(_0x47bd('0x4'));var BPromise=require(_0x47bd('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x47bd('0x6'));var config=require(_0x47bd('0x7'));var attributes=require(_0x47bd('0x8'));module['exports']=function(_0x1c575f,_0x52d484){return _0x1c575f[_0x47bd('0x9')](_0x47bd('0xa'),attributes,{'tableName':_0x47bd('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x31a9da,_0x134432,_0x29c1b8){if(_0x31a9da[_0x47bd('0xc')](_0x47bd('0xd'))){_0x31a9da[_0x47bd('0xe')]=moment()[_0x47bd('0xf')](_0x47bd('0x10'));}_0x29c1b8(null,_0x31a9da);}}});};
\ No newline at end of file
+var _0x4d2b=['closed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsInteraction.attributes','exports','define','SmsInteraction','sms_interactions','changed'];(function(_0x4e39e0,_0x5317d2){var _0x48bfb0=function(_0x2d2f3f){while(--_0x2d2f3f){_0x4e39e0['push'](_0x4e39e0['shift']());}};_0x48bfb0(++_0x5317d2);}(_0x4d2b,0x1cb));var _0xb4d2=function(_0x3823d1,_0x9e2a08){_0x3823d1=_0x3823d1-0x0;var _0x35c3a0=_0x4d2b[_0x3823d1];return _0x35c3a0;};'use strict';var _=require(_0xb4d2('0x0'));var util=require(_0xb4d2('0x1'));var logger=require(_0xb4d2('0x2'))(_0xb4d2('0x3'));var moment=require(_0xb4d2('0x4'));var BPromise=require(_0xb4d2('0x5'));var rp=require(_0xb4d2('0x6'));var fs=require('fs');var path=require(_0xb4d2('0x7'));var rimraf=require(_0xb4d2('0x8'));var config=require(_0xb4d2('0x9'));var attributes=require(_0xb4d2('0xa'));module[_0xb4d2('0xb')]=function(_0x526451,_0x2b0a00){return _0x526451[_0xb4d2('0xc')](_0xb4d2('0xd'),attributes,{'tableName':_0xb4d2('0xe'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x48c62d,_0x1a1d42,_0x203ca2){if(_0x48c62d[_0xb4d2('0xf')](_0xb4d2('0x10'))){_0x48c62d['closedAt']=moment()[_0xb4d2('0x11')](_0xb4d2('0x12'));}_0x203ca2(null,_0x48c62d);}}});};
\ No newline at end of file
index a17fc03..faaa5d1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6f05=['ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','redis','localhost','socket.io-emitter','./smsInteraction.socket','request','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','update','options','raw','where','attributes','UpdateSmsInteraction','catch','AddTagsToSmsInteraction','SmsInteraction','find','addTags','body'];(function(_0x37d870,_0x43470b){var _0x4b2c5f=function(_0x2018bd){while(--_0x2018bd){_0x37d870['push'](_0x37d870['shift']());}};_0x4b2c5f(++_0x43470b);}(_0x6f05,0x162));var _0x56f0=function(_0x676a08,_0x29a171){_0x676a08=_0x676a08-0x0;var _0x50f485=_0x6f05[_0x676a08];return _0x50f485;};'use strict';var _=require(_0x56f0('0x0'));var util=require(_0x56f0('0x1'));var moment=require(_0x56f0('0x2'));var BPromise=require(_0x56f0('0x3'));var rs=require(_0x56f0('0x4'));var fs=require('fs');var Redis=require(_0x56f0('0x5'));var db=require(_0x56f0('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x56f0('0x7'))(_0x56f0('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x56f0('0x9')]['http']({'port':0x232a});config[_0x56f0('0xa')]=_['defaults'](config['redis'],{'host':_0x56f0('0xb'),'port':0x18eb});var socket=require(_0x56f0('0xc'))(new Redis(config[_0x56f0('0xa')]));require(_0x56f0('0xd'))['register'](socket);function respondWithRpcPromise(_0x19b4f8,_0x2b6a57,_0x440ada){return new BPromise(function(_0x1c8e02,_0x2f9f68){return client[_0x56f0('0xe')](_0x19b4f8,_0x440ada)['then'](function(_0x4db0d3){logger['info'](_0x56f0('0xf'),_0x2b6a57,_0x56f0('0x10'));logger[_0x56f0('0x11')](_0x56f0('0x12'),_0x2b6a57,_0x56f0('0x10'),JSON[_0x56f0('0x13')](_0x4db0d3));if(_0x4db0d3[_0x56f0('0x14')]){if(_0x4db0d3['error']['code']===0x1f4){logger[_0x56f0('0x14')]('SmsInteraction,\x20%s,\x20%s',_0x2b6a57,_0x4db0d3['error']['message']);return _0x2f9f68(_0x4db0d3[_0x56f0('0x14')][_0x56f0('0x15')]);}logger[_0x56f0('0x14')]('SmsInteraction,\x20%s,\x20%s',_0x2b6a57,_0x4db0d3[_0x56f0('0x14')][_0x56f0('0x15')]);return _0x1c8e02(_0x4db0d3[_0x56f0('0x14')][_0x56f0('0x15')]);}else{logger[_0x56f0('0x16')]('SmsInteraction,\x20%s,\x20%s',_0x2b6a57,'request\x20sent');_0x1c8e02(_0x4db0d3[_0x56f0('0x17')]['message']);}})['catch'](function(_0x2f5124){logger[_0x56f0('0x14')]('SmsInteraction,\x20%s,\x20%s',_0x2b6a57,_0x2f5124);_0x2f9f68(_0x2f5124);});});}exports['UpdateSmsInteraction']=function(_0x3beb8d){var _0x2883d7=this;return new Promise(function(_0x46991c,_0x5285f8){return db['SmsInteraction'][_0x56f0('0x18')](_0x3beb8d['body'],{'raw':_0x3beb8d[_0x56f0('0x19')]?_0x3beb8d['options'][_0x56f0('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3beb8d[_0x56f0('0x19')]?_0x3beb8d['options'][_0x56f0('0x1b')]||null:null,'attributes':_0x3beb8d[_0x56f0('0x19')]?_0x3beb8d[_0x56f0('0x19')][_0x56f0('0x1c')]||null:null,'limit':_0x3beb8d[_0x56f0('0x19')]?_0x3beb8d[_0x56f0('0x19')]['limit']||null:null})['then'](function(_0x36dc7a){logger[_0x56f0('0x16')](_0x56f0('0x1d'),_0x3beb8d);logger['debug'](_0x56f0('0x1d'),_0x3beb8d,JSON['stringify'](_0x36dc7a));_0x46991c(_0x36dc7a);})[_0x56f0('0x1e')](function(_0x580887){logger[_0x56f0('0x14')](_0x56f0('0x1d'),_0x580887['message'],_0x3beb8d);_0x5285f8(_0x2883d7[_0x56f0('0x14')](0x1f4,_0x580887[_0x56f0('0x15')]));});});};exports[_0x56f0('0x1f')]=function(_0x48e577){return new Promise(function(_0xabe948,_0x21be84){return db[_0x56f0('0x20')][_0x56f0('0x21')]({'where':_0x48e577[_0x56f0('0x19')]?_0x48e577[_0x56f0('0x19')][_0x56f0('0x1b')]||null:null})['then'](function(_0x198569){if(_0x198569){return _0x198569[_0x56f0('0x22')](_0x48e577[_0x56f0('0x23')][_0x56f0('0x24')],_['omit'](_0x48e577[_0x56f0('0x23')],[_0x56f0('0x24'),'id'])||{});}})[_0x56f0('0x25')](function(_0x17cb31){logger[_0x56f0('0x16')]('AddTags',_0x48e577);logger[_0x56f0('0x11')](_0x56f0('0x26'),_0x48e577,JSON[_0x56f0('0x13')](_0x17cb31));_0xabe948(_0x17cb31);})['catch'](function(_0x46dfb7){logger['error'](_0x56f0('0x26'),_0x46dfb7[_0x56f0('0x15')],_0x48e577);_0x21be84(_this['error'](0x1f4,_0x46dfb7[_0x56f0('0x15')]));});});};
\ No newline at end of file
+var _0x0f4c=['code','message','result','UpdateSmsInteraction','update','body','options','raw','attributes','debug','stringify','catch','AddTagsToSmsInteraction','find','where','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','request','then','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','error'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0x0f4c,0xe1));var _0xc0f4=function(_0x5ad771,_0x34186f){_0x5ad771=_0x5ad771-0x0;var _0x5b5dce=_0x0f4c[_0x5ad771];return _0x5b5dce;};'use strict';var _=require(_0xc0f4('0x0'));var util=require(_0xc0f4('0x1'));var moment=require(_0xc0f4('0x2'));var BPromise=require(_0xc0f4('0x3'));var rs=require(_0xc0f4('0x4'));var fs=require('fs');var Redis=require(_0xc0f4('0x5'));var db=require(_0xc0f4('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xc0f4('0x7'))('rpc');var config=require(_0xc0f4('0x8'));var jayson=require(_0xc0f4('0x9'));var client=jayson['client'][_0xc0f4('0xa')]({'port':0x232a});config[_0xc0f4('0xb')]=_[_0xc0f4('0xc')](config[_0xc0f4('0xb')],{'host':_0xc0f4('0xd'),'port':0x18eb});var socket=require(_0xc0f4('0xe'))(new Redis(config['redis']));require('./smsInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x1ad533,_0x2b96d8,_0x280830){return new BPromise(function(_0x44609a,_0x105cf5){return client[_0xc0f4('0xf')](_0x1ad533,_0x280830)[_0xc0f4('0x10')](function(_0x2fce06){logger[_0xc0f4('0x11')](_0xc0f4('0x12'),_0x2b96d8,_0xc0f4('0x13'));logger['debug']('SmsInteraction,\x20%s,\x20%s,\x20%s',_0x2b96d8,_0xc0f4('0x13'),JSON['stringify'](_0x2fce06));if(_0x2fce06['error']){if(_0x2fce06[_0xc0f4('0x14')][_0xc0f4('0x15')]===0x1f4){logger[_0xc0f4('0x14')](_0xc0f4('0x12'),_0x2b96d8,_0x2fce06[_0xc0f4('0x14')][_0xc0f4('0x16')]);return _0x105cf5(_0x2fce06[_0xc0f4('0x14')][_0xc0f4('0x16')]);}logger[_0xc0f4('0x14')](_0xc0f4('0x12'),_0x2b96d8,_0x2fce06[_0xc0f4('0x14')][_0xc0f4('0x16')]);return _0x44609a(_0x2fce06[_0xc0f4('0x14')]['message']);}else{logger[_0xc0f4('0x11')]('SmsInteraction,\x20%s,\x20%s',_0x2b96d8,_0xc0f4('0x13'));_0x44609a(_0x2fce06[_0xc0f4('0x17')][_0xc0f4('0x16')]);}})['catch'](function(_0x1be93e){logger[_0xc0f4('0x14')]('SmsInteraction,\x20%s,\x20%s',_0x2b96d8,_0x1be93e);_0x105cf5(_0x1be93e);});});}exports[_0xc0f4('0x18')]=function(_0x4761d6){var _0x50d4b2=this;return new Promise(function(_0x265c4c,_0x9b83c9){return db['SmsInteraction'][_0xc0f4('0x19')](_0x4761d6[_0xc0f4('0x1a')],{'raw':_0x4761d6['options']?_0x4761d6[_0xc0f4('0x1b')][_0xc0f4('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4761d6['options']?_0x4761d6[_0xc0f4('0x1b')]['where']||null:null,'attributes':_0x4761d6[_0xc0f4('0x1b')]?_0x4761d6['options'][_0xc0f4('0x1d')]||null:null,'limit':_0x4761d6[_0xc0f4('0x1b')]?_0x4761d6[_0xc0f4('0x1b')]['limit']||null:null})[_0xc0f4('0x10')](function(_0x3187cc){logger['info'](_0xc0f4('0x18'),_0x4761d6);logger[_0xc0f4('0x1e')](_0xc0f4('0x18'),_0x4761d6,JSON[_0xc0f4('0x1f')](_0x3187cc));_0x265c4c(_0x3187cc);})[_0xc0f4('0x20')](function(_0x4d29fd){logger[_0xc0f4('0x14')](_0xc0f4('0x18'),_0x4d29fd['message'],_0x4761d6);_0x9b83c9(_0x50d4b2[_0xc0f4('0x14')](0x1f4,_0x4d29fd[_0xc0f4('0x16')]));});});};exports[_0xc0f4('0x21')]=function(_0x4018ee){return new Promise(function(_0x7ab64b,_0x49373a){return db['SmsInteraction'][_0xc0f4('0x22')]({'where':_0x4018ee[_0xc0f4('0x1b')]?_0x4018ee[_0xc0f4('0x1b')][_0xc0f4('0x23')]||null:null})['then'](function(_0x22dcc4){if(_0x22dcc4){return _0x22dcc4[_0xc0f4('0x24')](_0x4018ee[_0xc0f4('0x1a')][_0xc0f4('0x25')],_[_0xc0f4('0x26')](_0x4018ee[_0xc0f4('0x1a')],[_0xc0f4('0x25'),'id'])||{});}})[_0xc0f4('0x27')](function(_0x2ce1b6){logger[_0xc0f4('0x11')](_0xc0f4('0x28'),_0x4018ee);logger[_0xc0f4('0x1e')](_0xc0f4('0x28'),_0x4018ee,JSON[_0xc0f4('0x1f')](_0x2ce1b6));_0x7ab64b(_0x2ce1b6);})[_0xc0f4('0x20')](function(_0x7593b){logger[_0xc0f4('0x14')](_0xc0f4('0x28'),_0x7593b['message'],_0x4018ee);_0x49373a(_this[_0xc0f4('0x14')](0x1f4,_0x7593b['message']));});});};
\ No newline at end of file
index 5cc51f6..158f191 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9d34=['smsInteraction:','save','remove','update','emit','register'];(function(_0x5c6e33,_0x2ad20b){var _0x2622cf=function(_0x4148c1){while(--_0x4148c1){_0x5c6e33['push'](_0x5c6e33['shift']());}};_0x2622cf(++_0x2ad20b);}(_0x9d34,0x1b7));var _0x49d3=function(_0x5b62d9,_0x1f8f24){_0x5b62d9=_0x5b62d9-0x0;var _0x4c57a8=_0x9d34[_0x5b62d9];return _0x4c57a8;};'use strict';var SmsInteractionEvents=require('./smsInteraction.events');var events=[_0x49d3('0x0'),_0x49d3('0x1'),_0x49d3('0x2')];function createListener(_0x4a4f0d,_0x558118){return function(_0x1b5700){_0x558118[_0x49d3('0x3')](_0x4a4f0d,_0x1b5700);};}function removeListener(_0x2dfa48,_0x11721f){return function(){SmsInteractionEvents['removeListener'](_0x2dfa48,_0x11721f);};}exports[_0x49d3('0x4')]=function(_0x5ca06f){for(var _0x414aaf=0x0,_0x3c24a3=events['length'];_0x414aaf<_0x3c24a3;_0x414aaf++){var _0x1f280c=events[_0x414aaf];var _0x439990=createListener(_0x49d3('0x5')+_0x1f280c,_0x5ca06f);SmsInteractionEvents['on'](_0x1f280c,_0x439990);}};
\ No newline at end of file
+var _0xbe08=['./smsInteraction.events','save','remove','update','length','smsInteraction:'];(function(_0x2763f2,_0x416af8){var _0x3ef471=function(_0x288aa2){while(--_0x288aa2){_0x2763f2['push'](_0x2763f2['shift']());}};_0x3ef471(++_0x416af8);}(_0xbe08,0x102));var _0x8be0=function(_0x5e2d91,_0x54ae3e){_0x5e2d91=_0x5e2d91-0x0;var _0x54438f=_0xbe08[_0x5e2d91];return _0x54438f;};'use strict';var SmsInteractionEvents=require(_0x8be0('0x0'));var events=[_0x8be0('0x1'),_0x8be0('0x2'),_0x8be0('0x3')];function createListener(_0x41e233,_0x2ff8e6){return function(_0x5b2824){_0x2ff8e6['emit'](_0x41e233,_0x5b2824);};}function removeListener(_0x32b0b0,_0xcee118){return function(){SmsInteractionEvents['removeListener'](_0x32b0b0,_0xcee118);};}exports['register']=function(_0x5ae2bc){for(var _0x14652c=0x0,_0xc20ba6=events[_0x8be0('0x4')];_0x14652c<_0xc20ba6;_0x14652c++){var _0x287634=events[_0x14652c];var _0x294a34=createListener(_0x8be0('0x5')+_0x287634,_0x5ae2bc);SmsInteractionEvents['on'](_0x287634,_0x294a34);}};
\ No newline at end of file
index f5239bd..9c88321 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3c1a=['../../components/interaction/service','./smsMessage.controller','get','isAuthenticated','index','describe','/:id','post','create','/:id/status','status','put','/:id/accept','accept','/:id/reject','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x43d31b,_0x670376){var _0x5541c8=function(_0x1bca5d){while(--_0x1bca5d){_0x43d31b['push'](_0x43d31b['shift']());}};_0x5541c8(++_0x670376);}(_0x3c1a,0xda));var _0xa3c1=function(_0x35f83e,_0x30ec55){_0x35f83e=_0x35f83e-0x0;var _0x249b05=_0x3c1a[_0x35f83e];return _0x249b05;};'use strict';var multer=require(_0xa3c1('0x0'));var util=require(_0xa3c1('0x1'));var path=require(_0xa3c1('0x2'));var timeout=require(_0xa3c1('0x3'));var express=require(_0xa3c1('0x4'));var router=express[_0xa3c1('0x5')]();var fs_extra=require(_0xa3c1('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xa3c1('0x7'));var config=require('../../config/environment');var controller=require(_0xa3c1('0x8'));router[_0xa3c1('0x9')]('/',auth[_0xa3c1('0xa')](),controller[_0xa3c1('0xb')]);router['get']('/describe',auth[_0xa3c1('0xa')](),controller[_0xa3c1('0xc')]);router[_0xa3c1('0x9')](_0xa3c1('0xd'),auth[_0xa3c1('0xa')](),controller['show']);router[_0xa3c1('0xe')]('/',auth['isAuthenticated'](),interaction['tracked']('sms','smsmessage:create'),controller[_0xa3c1('0xf')]);router[_0xa3c1('0xe')](_0xa3c1('0x10'),controller[_0xa3c1('0x11')]);router[_0xa3c1('0x12')](_0xa3c1('0xd'),auth[_0xa3c1('0xa')](),controller['update']);router[_0xa3c1('0x12')](_0xa3c1('0x13'),auth[_0xa3c1('0xa')](),controller[_0xa3c1('0x14')]);router[_0xa3c1('0x12')](_0xa3c1('0x15'),auth[_0xa3c1('0xa')](),controller['reject']);router[_0xa3c1('0x16')](_0xa3c1('0xd'),auth['isAuthenticated'](),controller[_0xa3c1('0x17')]);module[_0xa3c1('0x18')]=router;
\ No newline at end of file
+var _0x69a4=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsMessage.controller','get','index','isAuthenticated','describe','/:id','post','tracked','sms','smsmessage:create','create','/:id/status','put','update','accept','/:id/reject','reject','delete','destroy','exports','multer','path','connect-timeout','express','Router'];(function(_0x26a393,_0x1d9e55){var _0x2040a4=function(_0x2edf66){while(--_0x2edf66){_0x26a393['push'](_0x26a393['shift']());}};_0x2040a4(++_0x1d9e55);}(_0x69a4,0x1cb));var _0x469a=function(_0x2e787c,_0x5d253a){_0x2e787c=_0x2e787c-0x0;var _0x568a7a=_0x69a4[_0x2e787c];return _0x568a7a;};'use strict';var multer=require(_0x469a('0x0'));var util=require('util');var path=require(_0x469a('0x1'));var timeout=require(_0x469a('0x2'));var express=require(_0x469a('0x3'));var router=express[_0x469a('0x4')]();var fs_extra=require(_0x469a('0x5'));var auth=require(_0x469a('0x6'));var interaction=require(_0x469a('0x7'));var config=require(_0x469a('0x8'));var controller=require(_0x469a('0x9'));router[_0x469a('0xa')]('/',auth['isAuthenticated'](),controller[_0x469a('0xb')]);router['get']('/describe',auth[_0x469a('0xc')](),controller[_0x469a('0xd')]);router[_0x469a('0xa')](_0x469a('0xe'),auth[_0x469a('0xc')](),controller['show']);router[_0x469a('0xf')]('/',auth[_0x469a('0xc')](),interaction[_0x469a('0x10')](_0x469a('0x11'),_0x469a('0x12')),controller[_0x469a('0x13')]);router[_0x469a('0xf')](_0x469a('0x14'),controller['status']);router[_0x469a('0x15')](_0x469a('0xe'),auth['isAuthenticated'](),controller[_0x469a('0x16')]);router[_0x469a('0x15')]('/:id/accept',auth[_0x469a('0xc')](),controller[_0x469a('0x17')]);router[_0x469a('0x15')](_0x469a('0x18'),auth[_0x469a('0xc')](),controller[_0x469a('0x19')]);router[_0x469a('0x1a')](_0x469a('0xe'),auth['isAuthenticated'](),controller[_0x469a('0x1b')]);module[_0x469a('0x1c')]=router;
\ No newline at end of file
index b961a83..be795ad 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa398=['out','STRING','medium','BOOLEAN','ENUM'];(function(_0x251bc9,_0x562b4b){var _0x3a472=function(_0x2ed154){while(--_0x2ed154){_0x251bc9['push'](_0x251bc9['shift']());}};_0x3a472(++_0x562b4b);}(_0xa398,0xbb));var _0x8a39=function(_0x275ddc,_0x5d40ea){_0x275ddc=_0x275ddc-0x0;var _0xdb72eb=_0xa398[_0x275ddc];return _0xdb72eb;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize['TEXT'](_0x8a39('0x0')),'allowNull':![]},'read':{'type':Sequelize[_0x8a39('0x1')],'defaultValue':![]},'direction':{'type':Sequelize[_0x8a39('0x2')]('in','out'),'defaultValue':_0x8a39('0x3'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0x8a39('0x4')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0x8a39('0x1')],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0xe52b=['STRING','DATE','sequelize','exports','TEXT','medium','BOOLEAN','ENUM'];(function(_0x1572de,_0x256ee0){var _0x145ec6=function(_0x2bb7a7){while(--_0x2bb7a7){_0x1572de['push'](_0x1572de['shift']());}};_0x145ec6(++_0x256ee0);}(_0xe52b,0x132));var _0xbe52=function(_0x5a6874,_0x32fd97){_0x5a6874=_0x5a6874-0x0;var _0x2888b4=_0xe52b[_0x5a6874];return _0x2888b4;};'use strict';var Sequelize=require(_0xbe52('0x0'));module[_0xbe52('0x1')]={'body':{'type':Sequelize[_0xbe52('0x2')](_0xbe52('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xbe52('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xbe52('0x5')]('in','out'),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0xbe52('0x6')]},'readAt':{'type':Sequelize[_0xbe52('0x7')]},'secret':{'type':Sequelize[_0xbe52('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xbe52('0x2')]}};
\ No newline at end of file
index 198b464..cc93c90 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf8fa=['EventManager','acceptmessage','sms-interactions','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','Sequelize','interface','SIP/%s','SmsAccountId','received\x20delivery\x20report\x20from','inspect','MessageSid','SmsAccount,\x20%s,\x20%s,\x20%s','twilio','plivo','MessageUUID','messageId','indexOf','delivered','Status','plivio','infobip','results','groupName','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','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','./smsMessage.socket','register','jayson/promise','client','http','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','sendStatus','name','send','SmsMessage','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','pick','where','merge','type','filter','options','includeAll','include','params','rawAttributes','create','body','find','destroy','describe','accept','sms','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','SmsInteraction','SmsInteractionId','isNil','read1stAt','interaction','get','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','AcceptMessage','acceptMessage','ContactId','QueryTypes','SELECT','contact','User','fullname','email','internal','manual','format','channel','motionChannel','event'];(function(_0x2fe4e6,_0x39f94e){var _0x331d75=function(_0x346bdf){while(--_0x346bdf){_0x2fe4e6['push'](_0x2fe4e6['shift']());}};_0x331d75(++_0x39f94e);}(_0xf8fa,0x13e));var _0xaf8f=function(_0x46798f,_0x43e696){_0x46798f=_0x46798f-0x0;var _0x1bf67c=_0xf8fa[_0x46798f];return _0x1bf67c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xaf8f('0x0'));var zipdir=require(_0xaf8f('0x1'));var jsonpatch=require(_0xaf8f('0x2'));var rp=require(_0xaf8f('0x3'));var moment=require('moment');var BPromise=require(_0xaf8f('0x4'));var Mustache=require('mustache');var util=require(_0xaf8f('0x5'));var path=require(_0xaf8f('0x6'));var sox=require(_0xaf8f('0x7'));var csv=require('to-csv');var ejs=require(_0xaf8f('0x8'));var fs=require('fs');var fs_extra=require(_0xaf8f('0x9'));var _=require(_0xaf8f('0xa'));var squel=require(_0xaf8f('0xb'));var crypto=require(_0xaf8f('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xaf8f('0xd'));var Papa=require(_0xaf8f('0xe'));var Redis=require(_0xaf8f('0xf'));var authService=require(_0xaf8f('0x10'));var qs=require(_0xaf8f('0x11'));var as=require(_0xaf8f('0x12'));var hardwareService=require(_0xaf8f('0x13'));var logger=require(_0xaf8f('0x14'))('api');var utils=require(_0xaf8f('0x15'));var config=require(_0xaf8f('0x16'));var licenseUtil=require(_0xaf8f('0x17'));var db=require(_0xaf8f('0x18'))['db'];config[_0xaf8f('0x19')]=_[_0xaf8f('0x1a')](config[_0xaf8f('0x19')],{'host':_0xaf8f('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xaf8f('0x1c'))[_0xaf8f('0x1d')](socket);var jayson=require(_0xaf8f('0x1e'));var client=jayson[_0xaf8f('0x1f')][_0xaf8f('0x20')]({'port':0x232c});var client9002=jayson[_0xaf8f('0x1f')][_0xaf8f('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x6d09b5,_0x115a07,_0x3b6c97,_0x1eca30){return new BPromise(function(_0x5dcd39,_0x1fefe9){var _0x5c9ca9=_0x1eca30||client;return _0x5c9ca9[_0xaf8f('0x21')](_0x6d09b5,_0x3b6c97)[_0xaf8f('0x22')](function(_0x575b0f){logger[_0xaf8f('0x23')](_0xaf8f('0x24'),_0x115a07,_0xaf8f('0x25'));logger[_0xaf8f('0x26')](_0xaf8f('0x27'),_0x115a07,'request\x20sent',JSON[_0xaf8f('0x28')](_0x575b0f));if(_0x575b0f[_0xaf8f('0x29')]){if(_0x575b0f[_0xaf8f('0x29')]['code']===0x1f4){logger[_0xaf8f('0x29')](_0xaf8f('0x24'),_0x115a07,_0x575b0f[_0xaf8f('0x29')][_0xaf8f('0x2a')]);return _0x1fefe9(_0x575b0f[_0xaf8f('0x29')][_0xaf8f('0x2a')]);}logger[_0xaf8f('0x29')]('SmsMessage,\x20%s,\x20%s',_0x115a07,_0x575b0f[_0xaf8f('0x29')][_0xaf8f('0x2a')]);return _0x5dcd39(_0x575b0f[_0xaf8f('0x29')][_0xaf8f('0x2a')]);}else{logger[_0xaf8f('0x23')]('SmsMessage,\x20%s,\x20%s',_0x115a07,_0xaf8f('0x25'));_0x5dcd39(_0x575b0f[_0xaf8f('0x2b')]['message']);}})[_0xaf8f('0x2c')](function(_0x503b4c){logger['error'](_0xaf8f('0x24'),_0x115a07,_0x503b4c);_0x1fefe9(_0x503b4c);});});}function respondWithStatusCode(_0x5b47b3,_0x219b42){_0x219b42=_0x219b42||0xcc;return function(_0x1213b3){if(_0x1213b3){return _0x5b47b3['sendStatus'](_0x219b42);}return _0x5b47b3[_0xaf8f('0x2d')](_0x219b42)[_0xaf8f('0x2e')]();};}function respondWithResult(_0x5a8512,_0x34929b){_0x34929b=_0x34929b||0xc8;return function(_0x20be3e){if(_0x20be3e){return _0x5a8512['status'](_0x34929b)[_0xaf8f('0x2f')](_0x20be3e);}};}function respondWithFilteredResult(_0x18dc27,_0x18dc8b){return function(_0x847716){if(_0x847716){var _0x5ba3a7=typeof _0x18dc8b[_0xaf8f('0x30')]===_0xaf8f('0x31')&&typeof _0x18dc8b[_0xaf8f('0x32')]==='undefined';var _0x4d03f6=_0x847716[_0xaf8f('0x33')];var _0x2ffe83=_0x5ba3a7?0x0:_0x18dc8b[_0xaf8f('0x30')];var _0x35c8f9=_0x5ba3a7?_0x847716['count']:_0x18dc8b[_0xaf8f('0x30')]+_0x18dc8b[_0xaf8f('0x32')];var _0x2510cf;if(_0x35c8f9>=_0x4d03f6){_0x35c8f9=_0x4d03f6;_0x2510cf=0xc8;}else{_0x2510cf=0xce;}_0x18dc27[_0xaf8f('0x2d')](_0x2510cf);return _0x18dc27[_0xaf8f('0x34')](_0xaf8f('0x35'),_0x2ffe83+'-'+_0x35c8f9+'/'+_0x4d03f6)[_0xaf8f('0x2f')](_0x847716);}return null;};}function patchUpdates(_0x8093e3){return function(_0x336323){try{jsonpatch[_0xaf8f('0x36')](_0x336323,_0x8093e3,!![]);}catch(_0x59a914){return BPromise[_0xaf8f('0x37')](_0x59a914);}return _0x336323[_0xaf8f('0x38')]();};}function saveUpdates(_0x1f47e8,_0x5d44c2){return function(_0x2964c0){if(_0x2964c0){return _0x2964c0[_0xaf8f('0x39')](_0x1f47e8)['then'](function(_0xbad50){return _0xbad50;});}return null;};}function removeEntity(_0xd8fb7c,_0x35eb36){return function(_0x1fc777){if(_0x1fc777){return _0x1fc777['destroy']()[_0xaf8f('0x22')](function(){_0xd8fb7c['status'](0xcc)[_0xaf8f('0x2e')]();});}};}function handleEntityNotFound(_0x5a9e59,_0x5ed362){return function(_0x1bb609){if(!_0x1bb609){_0x5a9e59[_0xaf8f('0x3a')](0x194);}return _0x1bb609;};}function handleError(_0x4f0fd0,_0x4eebb3){_0x4eebb3=_0x4eebb3||0x1f4;return function(_0x2e96d1){logger['error'](_0x2e96d1['stack']);if(_0x2e96d1[_0xaf8f('0x3b')]){delete _0x2e96d1['name'];}_0x4f0fd0[_0xaf8f('0x2d')](_0x4eebb3)[_0xaf8f('0x3c')](_0x2e96d1);};}exports['index']=function(_0x397da6,_0x502e95){var _0x4c4861={},_0x2777cd={},_0xcfea56={'count':0x0,'rows':[]};var _0x34300c=_['map'](db[_0xaf8f('0x3d')]['rawAttributes'],function(_0x3bd443){return{'name':_0x3bd443['fieldName'],'type':_0x3bd443['type'][_0xaf8f('0x3e')]};});_0x2777cd[_0xaf8f('0x3f')]=_['map'](_0x34300c,_0xaf8f('0x3b'));_0x2777cd[_0xaf8f('0x40')]=_[_0xaf8f('0x41')](_0x397da6[_0xaf8f('0x40')]);_0x2777cd[_0xaf8f('0x42')]=_[_0xaf8f('0x43')](_0x2777cd[_0xaf8f('0x3f')],_0x2777cd[_0xaf8f('0x40')]);_0x4c4861[_0xaf8f('0x44')]=_[_0xaf8f('0x43')](_0x2777cd[_0xaf8f('0x3f')],qs[_0xaf8f('0x45')](_0x397da6[_0xaf8f('0x40')]['fields']));_0x4c4861[_0xaf8f('0x44')]=_0x4c4861['attributes'][_0xaf8f('0x46')]?_0x4c4861[_0xaf8f('0x44')]:_0x2777cd[_0xaf8f('0x3f')];if(!_0x397da6[_0xaf8f('0x40')][_0xaf8f('0x47')](_0xaf8f('0x48'))){_0x4c4861[_0xaf8f('0x32')]=qs[_0xaf8f('0x32')](_0x397da6[_0xaf8f('0x40')][_0xaf8f('0x32')]);_0x4c4861[_0xaf8f('0x30')]=qs[_0xaf8f('0x30')](_0x397da6[_0xaf8f('0x40')][_0xaf8f('0x30')]);}_0x4c4861[_0xaf8f('0x49')]=qs['sort'](_0x397da6['query']['sort']);_0x4c4861['where']=qs['filters'](_[_0xaf8f('0x4a')](_0x397da6[_0xaf8f('0x40')],_0x2777cd['filters']),_0x34300c);if(_0x397da6[_0xaf8f('0x40')]['filter']){_0x4c4861[_0xaf8f('0x4b')]=_[_0xaf8f('0x4c')](_0x4c4861[_0xaf8f('0x4b')],{'$or':_['map'](_0x34300c,function(_0x3d0d4f){if(_0x3d0d4f[_0xaf8f('0x4d')]!=='VIRTUAL'){var _0x29cb1f={};_0x29cb1f[_0x3d0d4f[_0xaf8f('0x3b')]]={'$like':'%'+_0x397da6[_0xaf8f('0x40')][_0xaf8f('0x4e')]+'%'};return _0x29cb1f;}})});}_0x4c4861=_[_0xaf8f('0x4c')]({},_0x4c4861,_0x397da6[_0xaf8f('0x4f')]);var _0x2384d9={'where':_0x4c4861[_0xaf8f('0x4b')]};return db['SmsMessage'][_0xaf8f('0x33')](_0x2384d9)[_0xaf8f('0x22')](function(_0x4236a0){_0xcfea56[_0xaf8f('0x33')]=_0x4236a0;if(_0x397da6['query'][_0xaf8f('0x50')]){_0x4c4861[_0xaf8f('0x51')]=[{'all':!![]}];}return db[_0xaf8f('0x3d')]['findAll'](_0x4c4861);})[_0xaf8f('0x22')](function(_0x6b119){_0xcfea56['rows']=_0x6b119;return _0xcfea56;})[_0xaf8f('0x22')](respondWithFilteredResult(_0x502e95,_0x4c4861))['catch'](handleError(_0x502e95,null));};exports['show']=function(_0x59820a,_0xcaab58){var _0x2446b8={'raw':!![],'where':{'id':_0x59820a[_0xaf8f('0x52')]['id']}},_0x152ec1={};_0x152ec1[_0xaf8f('0x3f')]=_[_0xaf8f('0x41')](db['SmsMessage'][_0xaf8f('0x53')]);_0x152ec1[_0xaf8f('0x40')]=_[_0xaf8f('0x41')](_0x59820a[_0xaf8f('0x40')]);_0x152ec1['filters']=_['intersection'](_0x152ec1[_0xaf8f('0x3f')],_0x152ec1[_0xaf8f('0x40')]);_0x2446b8['attributes']=_[_0xaf8f('0x43')](_0x152ec1['model'],qs[_0xaf8f('0x45')](_0x59820a[_0xaf8f('0x40')][_0xaf8f('0x45')]));_0x2446b8[_0xaf8f('0x44')]=_0x2446b8[_0xaf8f('0x44')]['length']?_0x2446b8[_0xaf8f('0x44')]:_0x152ec1['model'];if(_0x59820a[_0xaf8f('0x40')]['includeAll']){_0x2446b8[_0xaf8f('0x51')]=[{'all':!![]}];}_0x2446b8=_[_0xaf8f('0x4c')]({},_0x2446b8,_0x59820a[_0xaf8f('0x4f')]);return db[_0xaf8f('0x3d')]['find'](_0x2446b8)[_0xaf8f('0x22')](handleEntityNotFound(_0xcaab58,null))[_0xaf8f('0x22')](respondWithResult(_0xcaab58,null))[_0xaf8f('0x2c')](handleError(_0xcaab58,null));};exports[_0xaf8f('0x54')]=function(_0x9591c3,_0x127d58){return db[_0xaf8f('0x3d')]['create'](_0x9591c3[_0xaf8f('0x55')],{})[_0xaf8f('0x22')](respondWithResult(_0x127d58,0xc9))['catch'](handleError(_0x127d58,null));};exports[_0xaf8f('0x39')]=function(_0x1cca8e,_0x7125ce){if(_0x1cca8e['body']['id']){delete _0x1cca8e['body']['id'];}return db[_0xaf8f('0x3d')][_0xaf8f('0x56')]({'where':{'id':_0x1cca8e[_0xaf8f('0x52')]['id']}})[_0xaf8f('0x22')](handleEntityNotFound(_0x7125ce,null))[_0xaf8f('0x22')](saveUpdates(_0x1cca8e['body'],null))['then'](respondWithResult(_0x7125ce,null))[_0xaf8f('0x2c')](handleError(_0x7125ce,null));};exports[_0xaf8f('0x57')]=function(_0x5a67b9,_0x2c4d6c){return db['SmsMessage']['find']({'where':{'id':_0x5a67b9[_0xaf8f('0x52')]['id']}})[_0xaf8f('0x22')](handleEntityNotFound(_0x2c4d6c,null))[_0xaf8f('0x22')](removeEntity(_0x2c4d6c,null))['catch'](handleError(_0x2c4d6c,null));};exports[_0xaf8f('0x58')]=function(_0x49098a,_0xaf6cca){return db['SmsMessage']['describe']()[_0xaf8f('0x22')](respondWithResult(_0xaf6cca,null))[_0xaf8f('0x2c')](handleError(_0xaf6cca,null));};var interaction_log=require(_0xaf8f('0x14'))('sms-interactions');exports[_0xaf8f('0x59')]=function(_0x1b46a1,_0x151f74,_0x58c4bf){var _0x514cb3={'agent':{},'channel':_0xaf8f('0x5a')};if(_0x1b46a1[_0xaf8f('0x55')]['id']){delete _0x1b46a1['body']['id'];}_0x1b46a1[_0xaf8f('0x55')][_0xaf8f('0x5b')]=!![];_0x1b46a1[_0xaf8f('0x55')][_0xaf8f('0x5c')]=moment()['format'](_0xaf8f('0x5d'));_0x1b46a1[_0xaf8f('0x55')][_0xaf8f('0x5e')]=_0x1b46a1['body'][_0xaf8f('0x5e')]||_0x1b46a1[_0xaf8f('0x5f')]['id'];_0x514cb3[_0xaf8f('0x60')]['id']=_0x1b46a1[_0xaf8f('0x55')][_0xaf8f('0x5e')];return db[_0xaf8f('0x3d')][_0xaf8f('0x56')]({'where':{'id':_0x1b46a1[_0xaf8f('0x52')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x151f74,null))[_0xaf8f('0x22')](saveUpdates(_0x1b46a1[_0xaf8f('0x55')],null))[_0xaf8f('0x22')](function(_0x48c30a){if(_0x48c30a){_0x514cb3['message']=_0x48c30a['get']({'plain':!![]});return db[_0xaf8f('0x61')][_0xaf8f('0x56')]({'where':{'id':_0x48c30a[_0xaf8f('0x62')]}});}return null;})[_0xaf8f('0x22')](handleEntityNotFound(_0x151f74,null))[_0xaf8f('0x22')](function(_0x28fa49){if(_0x28fa49){return _0x28fa49[_0xaf8f('0x39')]({'UserId':_0x1b46a1['body'][_0xaf8f('0x5e')],'read1stAt':_[_0xaf8f('0x63')](_0x28fa49[_0xaf8f('0x64')])?moment()['format'](_0xaf8f('0x5d')):undefined});}return null;})[_0xaf8f('0x22')](function(_0x2b8d72){if(_0x2b8d72){_0x514cb3[_0xaf8f('0x65')]=_0x2b8d72[_0xaf8f('0x66')]({'plain':!![]});interaction_log[_0xaf8f('0x23')](_0xaf8f('0x67'),_0x1b46a1[_0xaf8f('0x5f')]['id'],_0x1b46a1[_0xaf8f('0x5f')]['name'],_0x1b46a1[_0xaf8f('0x5f')]['role'],_0x514cb3['interaction']['id'],_0x1b46a1[_0xaf8f('0x55')]?JSON[_0xaf8f('0x28')](_0x1b46a1[_0xaf8f('0x55')]):_0xaf8f('0x68'));return respondWithRpcPromise(_0xaf8f('0x69'),_0xaf8f('0x6a'),_0x514cb3);}return null;})[_0xaf8f('0x22')](function(_0x5e740c){var _0xf83a62='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x5e740c[_0xaf8f('0x2a')][_0xaf8f('0x6b')];return db['sequelize'][_0xaf8f('0x40')](_0xf83a62,{'type':db['Sequelize'][_0xaf8f('0x6c')][_0xaf8f('0x6d')],'raw':!![]})[_0xaf8f('0x22')](function(_0x2d09ac){return _0x2d09ac;});})[_0xaf8f('0x22')](function(_0x4a057c){if(_0x4a057c){_0x514cb3['message'][_0xaf8f('0x6e')]=_0x4a057c[0x0];if(!_0x1b46a1[_0xaf8f('0x55')][_0xaf8f('0x5e')])return;return db[_0xaf8f('0x6f')][_0xaf8f('0x56')]({'where':{'id':_0x1b46a1['body'][_0xaf8f('0x5e')],'role':'agent'},'attributes':['id',_0xaf8f('0x3b'),_0xaf8f('0x70'),_0xaf8f('0x71'),_0xaf8f('0x72')],'raw':!![]});}return null;})[_0xaf8f('0x22')](function(_0x2b1c47){if(!_0x2b1c47)return null;_0x514cb3[_0xaf8f('0x2a')][_0xaf8f('0x60')]=_0x2b1c47;return _0x514cb3;})[_0xaf8f('0x22')](function(_0x5c7f04){if(_0x5c7f04){if(_0x1b46a1['body'][_0xaf8f('0x73')]){_0x514cb3[_0xaf8f('0x2a')]['interface']=util[_0xaf8f('0x74')]('SIP/%s',_0x1b46a1[_0xaf8f('0x5f')]['name']);_0x514cb3[_0xaf8f('0x2a')][_0xaf8f('0x75')]=_0x514cb3['channel'];_0x514cb3[_0xaf8f('0x2a')][_0xaf8f('0x76')]=_0x514cb3[_0xaf8f('0x75')];_0x514cb3[_0xaf8f('0x2a')][_0xaf8f('0x77')]='accept';return respondWithRpcPromise(_0xaf8f('0x78'),'EventManager',{'event':_0xaf8f('0x79'),'message':_0x514cb3[_0xaf8f('0x2a')]},client9002)[_0xaf8f('0x22')](function(){return _0x514cb3;});}return _0x514cb3;}return null;})[_0xaf8f('0x22')](respondWithResult(_0x151f74,null))[_0xaf8f('0x2c')](handleError(_0x151f74,null));};var interaction_log=require(_0xaf8f('0x14'))(_0xaf8f('0x7a'));exports['reject']=function(_0x4e9640,_0x3a3e79,_0x518b34){var _0xe447bc={'agent':{},'channel':_0xaf8f('0x5a')};if(_0x4e9640[_0xaf8f('0x55')]['id']){delete _0x4e9640['body']['id'];}_0x4e9640['body']['UserId']=_0x4e9640[_0xaf8f('0x55')][_0xaf8f('0x5e')]||_0x4e9640[_0xaf8f('0x5f')]['id'];_0xe447bc[_0xaf8f('0x60')]['id']=_0x4e9640[_0xaf8f('0x55')][_0xaf8f('0x5e')];return db[_0xaf8f('0x3d')][_0xaf8f('0x56')]({'where':{'id':_0x4e9640['params']['id'],'UserId':null}})[_0xaf8f('0x22')](handleEntityNotFound(_0x3a3e79,null))[_0xaf8f('0x22')](function(_0xc6929f){if(_0xc6929f){_0xe447bc[_0xaf8f('0x2a')]=_0xc6929f[_0xaf8f('0x66')]({'plain':!![]});return db[_0xaf8f('0x61')][_0xaf8f('0x56')]({'where':{'id':_0xc6929f[_0xaf8f('0x62')]}});}return null;})[_0xaf8f('0x22')](handleEntityNotFound(_0x3a3e79,null))[_0xaf8f('0x22')](function(_0x2edf6f){if(_0x2edf6f){_0xe447bc['interaction']=_0x2edf6f[_0xaf8f('0x66')]({'plain':!![]});interaction_log[_0xaf8f('0x23')](_0xaf8f('0x7b'),_0x4e9640['user']['id'],_0x4e9640['user']['name'],_0x4e9640[_0xaf8f('0x5f')][_0xaf8f('0x7c')],_0xe447bc[_0xaf8f('0x65')]['id'],_0x4e9640['body']?JSON[_0xaf8f('0x28')](_0x4e9640[_0xaf8f('0x55')]):_0xaf8f('0x68'));return respondWithRpcPromise('RejectMessage',_0xaf8f('0x7d'),_0xe447bc);}return null;})[_0xaf8f('0x22')](function(_0x42e499){var _0x3b6221=_0xaf8f('0x7e')+_0x42e499[_0xaf8f('0x2a')]['ContactId'];return db['sequelize'][_0xaf8f('0x40')](_0x3b6221,{'type':db[_0xaf8f('0x7f')][_0xaf8f('0x6c')][_0xaf8f('0x6d')],'raw':!![]})[_0xaf8f('0x22')](function(_0x3cf761){return _0x3cf761;});})[_0xaf8f('0x22')](function(_0xc574be){if(_0xc574be){_0xe447bc[_0xaf8f('0x2a')][_0xaf8f('0x6e')]=_0xc574be[0x0];if(!_0x4e9640['body'][_0xaf8f('0x5e')])return;return db[_0xaf8f('0x6f')]['find']({'where':{'id':_0x4e9640[_0xaf8f('0x55')][_0xaf8f('0x5e')],'role':_0xaf8f('0x60')},'attributes':['id','name','fullname',_0xaf8f('0x71'),_0xaf8f('0x72')],'raw':!![]});}return null;})['then'](function(_0x445bf6){if(!_0x445bf6)return null;_0xe447bc['message']['agent']=_0x445bf6;return _0xe447bc;})[_0xaf8f('0x22')](function(_0x47de34){if(_0x47de34){_0x47de34[_0xaf8f('0x2a')][_0xaf8f('0x80')]=util[_0xaf8f('0x74')](_0xaf8f('0x81'),_0x4e9640[_0xaf8f('0x5f')][_0xaf8f('0x3b')]);_0x47de34['message'][_0xaf8f('0x75')]=_0xe447bc[_0xaf8f('0x75')];_0x47de34[_0xaf8f('0x2a')][_0xaf8f('0x76')]=_0xe447bc[_0xaf8f('0x75')];_0x47de34[_0xaf8f('0x2a')][_0xaf8f('0x77')]=_0xaf8f('0x37');respondWithRpcPromise(_0xaf8f('0x78'),_0xaf8f('0x78'),{'event':'rejectmessage','message':_0x47de34[_0xaf8f('0x2a')]},client9002);return _0xe447bc;}return null;})['then'](respondWithResult(_0x3a3e79,null))[_0xaf8f('0x2c')](handleError(_0x3a3e79,null));};exports[_0xaf8f('0x2d')]=function(_0x12cf19,_0x352b8a,_0x154568){if(_0x12cf19[_0xaf8f('0x55')]['id']){delete _0x12cf19[_0xaf8f('0x55')]['id'];}var _0x4db305;return db[_0xaf8f('0x3d')]['find']({'where':{'id':_0x12cf19[_0xaf8f('0x52')]['id']}})[_0xaf8f('0x22')](handleEntityNotFound(_0x352b8a,null))[_0xaf8f('0x22')](function(_0x2b2a88){if(_0x2b2a88){_0x4db305=_0x2b2a88;return db['SmsAccount'][_0xaf8f('0x56')]({'where':{'id':_0x2b2a88[_0xaf8f('0x82')]}});}})[_0xaf8f('0x22')](handleEntityNotFound(_0x352b8a,null))['then'](function(_0x4c2235){if(_0x4c2235){logger[_0xaf8f('0x26')](_0xaf8f('0x27'),_0xaf8f('0x2d'),_0xaf8f('0x83'),_0x4c2235[_0xaf8f('0x4d')],util[_0xaf8f('0x84')](_0x12cf19['body'],{'showHidden':![],'depth':null}));switch(_0x4c2235[_0xaf8f('0x4d')]){case'twilio':if(_0x12cf19['body'][_0xaf8f('0x85')]&&_0x12cf19[_0xaf8f('0x55')][_0xaf8f('0x85')]===_0x4db305['messageId']){return _0x4db305[_0xaf8f('0x39')]({'read':!![]});}else{logger[_0xaf8f('0x29')](_0xaf8f('0x86'),_0xaf8f('0x2d'),_0xaf8f('0x87'),util[_0xaf8f('0x84')](_0x12cf19[_0xaf8f('0x55')],{'showHidden':![],'depth':null}));}break;case _0xaf8f('0x88'):if(_0x12cf19[_0xaf8f('0x55')][_0xaf8f('0x89')]&&_0x12cf19[_0xaf8f('0x55')][_0xaf8f('0x89')]===_0x4db305[_0xaf8f('0x8a')]&&_[_0xaf8f('0x8b')](['sent',_0xaf8f('0x8c')],_0x12cf19[_0xaf8f('0x55')][_0xaf8f('0x8d')])>=0x0){return _0x4db305[_0xaf8f('0x39')]({'read':!![]});}else{logger[_0xaf8f('0x29')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xaf8f('0x2d'),_0xaf8f('0x8e'),util[_0xaf8f('0x84')](_0x12cf19[_0xaf8f('0x55')],{'showHidden':![],'depth':null}));}break;case _0xaf8f('0x8f'):var _0x2d6fd3=_0x12cf19[_0xaf8f('0x55')][_0xaf8f('0x90')][0x0];if(_0x2d6fd3[_0xaf8f('0x2d')][_0xaf8f('0x91')]==='DELIVERED'){return _0x4db305[_0xaf8f('0x39')]({'read':!![]});}else{logger[_0xaf8f('0x29')](_0xaf8f('0x86'),_0xaf8f('0x2d'),'infobip',util[_0xaf8f('0x84')](_0x12cf19[_0xaf8f('0x55')],{'showHidden':![],'depth':null}));}break;}return _0x4db305;}})[_0xaf8f('0x22')](respondWithResult(_0x352b8a,null))[_0xaf8f('0x2c')](handleError(_0x352b8a,null));};
\ No newline at end of file
+var _0xe643=['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','./smsMessage.socket','register','jayson/promise','request','then','info','request\x20sent','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsMessage,\x20%s,\x20%s','message','result','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','query','keys','filters','intersection','attributes','model','length','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','SmsMessage','findAll','rows','catch','show','fields','find','create','body','params','destroy','describe','sms-interactions','sms','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','get','SmsInteraction','SmsInteractionId','isNil','read1stAt','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','interaction','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','Sequelize','QueryTypes','agent','email','internal','manual','SIP/%s','channel','motionChannel','EventManager','acceptmessage','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','ContactId','sequelize','SELECT','contact','User','interface','event','rejectmessage','SmsAccountId','debug','received\x20delivery\x20report\x20from','inspect','twilio','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','MessageUUID','delivered','plivio','infobip','groupName','DELIVERED','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse'];(function(_0x40f521,_0xf2a143){var _0x1c5f53=function(_0x332878){while(--_0x332878){_0x40f521['push'](_0x40f521['shift']());}};_0x1c5f53(++_0xf2a143);}(_0xe643,0x84));var _0x3e64=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0xe643[_0x2be8c2];return _0x97f531;};'use strict';var emlformat=require(_0x3e64('0x0'));var rimraf=require(_0x3e64('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3e64('0x2'));var rp=require('request-promise');var moment=require(_0x3e64('0x3'));var BPromise=require(_0x3e64('0x4'));var Mustache=require(_0x3e64('0x5'));var util=require(_0x3e64('0x6'));var path=require(_0x3e64('0x7'));var sox=require('sox');var csv=require(_0x3e64('0x8'));var ejs=require(_0x3e64('0x9'));var fs=require('fs');var fs_extra=require(_0x3e64('0xa'));var _=require(_0x3e64('0xb'));var squel=require(_0x3e64('0xc'));var crypto=require(_0x3e64('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x3e64('0xe'));var toCsv=require(_0x3e64('0x8'));var querystring=require(_0x3e64('0xf'));var Papa=require(_0x3e64('0x10'));var Redis=require(_0x3e64('0x11'));var authService=require(_0x3e64('0x12'));var qs=require(_0x3e64('0x13'));var as=require(_0x3e64('0x14'));var hardwareService=require(_0x3e64('0x15'));var logger=require(_0x3e64('0x16'))('api');var utils=require(_0x3e64('0x17'));var config=require(_0x3e64('0x18'));var licenseUtil=require(_0x3e64('0x19'));var db=require(_0x3e64('0x1a'))['db'];config[_0x3e64('0x1b')]=_[_0x3e64('0x1c')](config[_0x3e64('0x1b')],{'host':_0x3e64('0x1d'),'port':0x18eb});var socket=require(_0x3e64('0x1e'))(new Redis(config['redis']));require(_0x3e64('0x1f'))[_0x3e64('0x20')](socket);var jayson=require(_0x3e64('0x21'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4a8488,_0x4d58da,_0x3764fb,_0x2a4a2b){return new BPromise(function(_0x3992db,_0x1770a7){var _0x395fd6=_0x2a4a2b||client;return _0x395fd6[_0x3e64('0x22')](_0x4a8488,_0x3764fb)[_0x3e64('0x23')](function(_0x4659e8){logger[_0x3e64('0x24')]('SmsMessage,\x20%s,\x20%s',_0x4d58da,_0x3e64('0x25'));logger['debug'](_0x3e64('0x26'),_0x4d58da,_0x3e64('0x25'),JSON[_0x3e64('0x27')](_0x4659e8));if(_0x4659e8['error']){if(_0x4659e8[_0x3e64('0x28')][_0x3e64('0x29')]===0x1f4){logger[_0x3e64('0x28')](_0x3e64('0x2a'),_0x4d58da,_0x4659e8[_0x3e64('0x28')][_0x3e64('0x2b')]);return _0x1770a7(_0x4659e8[_0x3e64('0x28')]['message']);}logger['error'](_0x3e64('0x2a'),_0x4d58da,_0x4659e8[_0x3e64('0x28')][_0x3e64('0x2b')]);return _0x3992db(_0x4659e8[_0x3e64('0x28')][_0x3e64('0x2b')]);}else{logger[_0x3e64('0x24')](_0x3e64('0x2a'),_0x4d58da,_0x3e64('0x25'));_0x3992db(_0x4659e8[_0x3e64('0x2c')][_0x3e64('0x2b')]);}})['catch'](function(_0x308448){logger[_0x3e64('0x28')](_0x3e64('0x2a'),_0x4d58da,_0x308448);_0x1770a7(_0x308448);});});}function respondWithStatusCode(_0x37eb70,_0x284179){_0x284179=_0x284179||0xcc;return function(_0x13db72){if(_0x13db72){return _0x37eb70['sendStatus'](_0x284179);}return _0x37eb70[_0x3e64('0x2d')](_0x284179)[_0x3e64('0x2e')]();};}function respondWithResult(_0x5e7614,_0x32e35b){_0x32e35b=_0x32e35b||0xc8;return function(_0x30b402){if(_0x30b402){return _0x5e7614['status'](_0x32e35b)[_0x3e64('0x2f')](_0x30b402);}};}function respondWithFilteredResult(_0x1355e0,_0x35597f){return function(_0x30f7a2){if(_0x30f7a2){var _0x3933a9=typeof _0x35597f[_0x3e64('0x30')]===_0x3e64('0x31')&&typeof _0x35597f[_0x3e64('0x32')]===_0x3e64('0x31');var _0x5e7dd7=_0x30f7a2[_0x3e64('0x33')];var _0x2c4362=_0x3933a9?0x0:_0x35597f[_0x3e64('0x30')];var _0xcc78bf=_0x3933a9?_0x30f7a2[_0x3e64('0x33')]:_0x35597f[_0x3e64('0x30')]+_0x35597f[_0x3e64('0x32')];var _0x17eff9;if(_0xcc78bf>=_0x5e7dd7){_0xcc78bf=_0x5e7dd7;_0x17eff9=0xc8;}else{_0x17eff9=0xce;}_0x1355e0[_0x3e64('0x2d')](_0x17eff9);return _0x1355e0[_0x3e64('0x34')](_0x3e64('0x35'),_0x2c4362+'-'+_0xcc78bf+'/'+_0x5e7dd7)['json'](_0x30f7a2);}return null;};}function patchUpdates(_0x24d3fa){return function(_0x15feff){try{jsonpatch[_0x3e64('0x36')](_0x15feff,_0x24d3fa,!![]);}catch(_0x48fecd){return BPromise[_0x3e64('0x37')](_0x48fecd);}return _0x15feff[_0x3e64('0x38')]();};}function saveUpdates(_0x268cd9,_0x237860){return function(_0x1926ac){if(_0x1926ac){return _0x1926ac[_0x3e64('0x39')](_0x268cd9)[_0x3e64('0x23')](function(_0x5972bf){return _0x5972bf;});}return null;};}function removeEntity(_0x205518,_0x31bf5d){return function(_0x163e4e){if(_0x163e4e){return _0x163e4e['destroy']()['then'](function(){_0x205518[_0x3e64('0x2d')](0xcc)[_0x3e64('0x2e')]();});}};}function handleEntityNotFound(_0x426a8d,_0x13033c){return function(_0x17bfda){if(!_0x17bfda){_0x426a8d[_0x3e64('0x3a')](0x194);}return _0x17bfda;};}function handleError(_0x28c336,_0x7fa1a4){_0x7fa1a4=_0x7fa1a4||0x1f4;return function(_0x586ae6){logger[_0x3e64('0x28')](_0x586ae6[_0x3e64('0x3b')]);if(_0x586ae6[_0x3e64('0x3c')]){delete _0x586ae6[_0x3e64('0x3c')];}_0x28c336[_0x3e64('0x2d')](_0x7fa1a4)[_0x3e64('0x3d')](_0x586ae6);};}exports[_0x3e64('0x3e')]=function(_0x592a6c,_0x1d096f){var _0x3aa01f={},_0xc5a8c7={},_0x5bceba={'count':0x0,'rows':[]};var _0x46383d=_[_0x3e64('0x3f')](db['SmsMessage'][_0x3e64('0x40')],function(_0x3b88f0){return{'name':_0x3b88f0[_0x3e64('0x41')],'type':_0x3b88f0[_0x3e64('0x42')]['key']};});_0xc5a8c7['model']=_[_0x3e64('0x3f')](_0x46383d,_0x3e64('0x3c'));_0xc5a8c7[_0x3e64('0x43')]=_[_0x3e64('0x44')](_0x592a6c['query']);_0xc5a8c7[_0x3e64('0x45')]=_[_0x3e64('0x46')](_0xc5a8c7['model'],_0xc5a8c7['query']);_0x3aa01f[_0x3e64('0x47')]=_[_0x3e64('0x46')](_0xc5a8c7[_0x3e64('0x48')],qs['fields'](_0x592a6c[_0x3e64('0x43')]['fields']));_0x3aa01f['attributes']=_0x3aa01f[_0x3e64('0x47')][_0x3e64('0x49')]?_0x3aa01f[_0x3e64('0x47')]:_0xc5a8c7[_0x3e64('0x48')];if(!_0x592a6c['query']['hasOwnProperty'](_0x3e64('0x4a'))){_0x3aa01f[_0x3e64('0x32')]=qs['limit'](_0x592a6c[_0x3e64('0x43')][_0x3e64('0x32')]);_0x3aa01f[_0x3e64('0x30')]=qs[_0x3e64('0x30')](_0x592a6c[_0x3e64('0x43')][_0x3e64('0x30')]);}_0x3aa01f[_0x3e64('0x4b')]=qs[_0x3e64('0x4c')](_0x592a6c[_0x3e64('0x43')][_0x3e64('0x4c')]);_0x3aa01f['where']=qs['filters'](_[_0x3e64('0x4d')](_0x592a6c[_0x3e64('0x43')],_0xc5a8c7['filters']),_0x46383d);if(_0x592a6c['query'][_0x3e64('0x4e')]){_0x3aa01f[_0x3e64('0x4f')]=_[_0x3e64('0x50')](_0x3aa01f[_0x3e64('0x4f')],{'$or':_[_0x3e64('0x3f')](_0x46383d,function(_0x4912d7){if(_0x4912d7[_0x3e64('0x42')]!==_0x3e64('0x51')){var _0x32a1c9={};_0x32a1c9[_0x4912d7[_0x3e64('0x3c')]]={'$like':'%'+_0x592a6c['query']['filter']+'%'};return _0x32a1c9;}})});}_0x3aa01f=_['merge']({},_0x3aa01f,_0x592a6c[_0x3e64('0x52')]);var _0x1b9bc0={'where':_0x3aa01f[_0x3e64('0x4f')]};return db['SmsMessage'][_0x3e64('0x33')](_0x1b9bc0)[_0x3e64('0x23')](function(_0x21914f){_0x5bceba[_0x3e64('0x33')]=_0x21914f;if(_0x592a6c[_0x3e64('0x43')][_0x3e64('0x53')]){_0x3aa01f[_0x3e64('0x54')]=[{'all':!![]}];}return db[_0x3e64('0x55')][_0x3e64('0x56')](_0x3aa01f);})['then'](function(_0x386bed){_0x5bceba[_0x3e64('0x57')]=_0x386bed;return _0x5bceba;})[_0x3e64('0x23')](respondWithFilteredResult(_0x1d096f,_0x3aa01f))[_0x3e64('0x58')](handleError(_0x1d096f,null));};exports[_0x3e64('0x59')]=function(_0x1b4488,_0x5a5ae3){var _0x482509={'raw':!![],'where':{'id':_0x1b4488['params']['id']}},_0x519dcd={};_0x519dcd[_0x3e64('0x48')]=_[_0x3e64('0x44')](db['SmsMessage'][_0x3e64('0x40')]);_0x519dcd[_0x3e64('0x43')]=_['keys'](_0x1b4488['query']);_0x519dcd[_0x3e64('0x45')]=_['intersection'](_0x519dcd[_0x3e64('0x48')],_0x519dcd['query']);_0x482509[_0x3e64('0x47')]=_[_0x3e64('0x46')](_0x519dcd[_0x3e64('0x48')],qs[_0x3e64('0x5a')](_0x1b4488[_0x3e64('0x43')][_0x3e64('0x5a')]));_0x482509[_0x3e64('0x47')]=_0x482509[_0x3e64('0x47')][_0x3e64('0x49')]?_0x482509[_0x3e64('0x47')]:_0x519dcd[_0x3e64('0x48')];if(_0x1b4488['query']['includeAll']){_0x482509['include']=[{'all':!![]}];}_0x482509=_[_0x3e64('0x50')]({},_0x482509,_0x1b4488[_0x3e64('0x52')]);return db[_0x3e64('0x55')][_0x3e64('0x5b')](_0x482509)[_0x3e64('0x23')](handleEntityNotFound(_0x5a5ae3,null))[_0x3e64('0x23')](respondWithResult(_0x5a5ae3,null))['catch'](handleError(_0x5a5ae3,null));};exports[_0x3e64('0x5c')]=function(_0x245091,_0x670dfd){return db[_0x3e64('0x55')]['create'](_0x245091[_0x3e64('0x5d')],{})[_0x3e64('0x23')](respondWithResult(_0x670dfd,0xc9))[_0x3e64('0x58')](handleError(_0x670dfd,null));};exports[_0x3e64('0x39')]=function(_0x128279,_0x1db8ef){if(_0x128279[_0x3e64('0x5d')]['id']){delete _0x128279[_0x3e64('0x5d')]['id'];}return db[_0x3e64('0x55')][_0x3e64('0x5b')]({'where':{'id':_0x128279[_0x3e64('0x5e')]['id']}})['then'](handleEntityNotFound(_0x1db8ef,null))[_0x3e64('0x23')](saveUpdates(_0x128279[_0x3e64('0x5d')],null))[_0x3e64('0x23')](respondWithResult(_0x1db8ef,null))[_0x3e64('0x58')](handleError(_0x1db8ef,null));};exports[_0x3e64('0x5f')]=function(_0x1fc719,_0x114845){return db[_0x3e64('0x55')][_0x3e64('0x5b')]({'where':{'id':_0x1fc719['params']['id']}})[_0x3e64('0x23')](handleEntityNotFound(_0x114845,null))[_0x3e64('0x23')](removeEntity(_0x114845,null))[_0x3e64('0x58')](handleError(_0x114845,null));};exports[_0x3e64('0x60')]=function(_0x15cf0c,_0x517443){return db['SmsMessage']['describe']()[_0x3e64('0x23')](respondWithResult(_0x517443,null))['catch'](handleError(_0x517443,null));};var interaction_log=require(_0x3e64('0x16'))(_0x3e64('0x61'));exports['accept']=function(_0x5e9bb2,_0x2c1092,_0x3af98b){var _0x5f65c5={'agent':{},'channel':_0x3e64('0x62')};if(_0x5e9bb2[_0x3e64('0x5d')]['id']){delete _0x5e9bb2[_0x3e64('0x5d')]['id'];}_0x5e9bb2[_0x3e64('0x5d')][_0x3e64('0x63')]=!![];_0x5e9bb2[_0x3e64('0x5d')]['readAt']=moment()[_0x3e64('0x64')](_0x3e64('0x65'));_0x5e9bb2[_0x3e64('0x5d')][_0x3e64('0x66')]=_0x5e9bb2['body'][_0x3e64('0x66')]||_0x5e9bb2['user']['id'];_0x5f65c5['agent']['id']=_0x5e9bb2[_0x3e64('0x5d')][_0x3e64('0x66')];return db['SmsMessage'][_0x3e64('0x5b')]({'where':{'id':_0x5e9bb2[_0x3e64('0x5e')]['id'],'UserId':null}})[_0x3e64('0x23')](handleEntityNotFound(_0x2c1092,null))[_0x3e64('0x23')](saveUpdates(_0x5e9bb2[_0x3e64('0x5d')],null))[_0x3e64('0x23')](function(_0x2280fe){if(_0x2280fe){_0x5f65c5[_0x3e64('0x2b')]=_0x2280fe[_0x3e64('0x67')]({'plain':!![]});return db[_0x3e64('0x68')][_0x3e64('0x5b')]({'where':{'id':_0x2280fe[_0x3e64('0x69')]}});}return null;})[_0x3e64('0x23')](handleEntityNotFound(_0x2c1092,null))[_0x3e64('0x23')](function(_0x2fd355){if(_0x2fd355){return _0x2fd355[_0x3e64('0x39')]({'UserId':_0x5e9bb2[_0x3e64('0x5d')][_0x3e64('0x66')],'read1stAt':_[_0x3e64('0x6a')](_0x2fd355[_0x3e64('0x6b')])?moment()['format'](_0x3e64('0x65')):undefined});}return null;})[_0x3e64('0x23')](function(_0x43e427){if(_0x43e427){_0x5f65c5['interaction']=_0x43e427[_0x3e64('0x67')]({'plain':!![]});interaction_log[_0x3e64('0x24')](_0x3e64('0x6c'),_0x5e9bb2[_0x3e64('0x6d')]['id'],_0x5e9bb2[_0x3e64('0x6d')]['name'],_0x5e9bb2[_0x3e64('0x6d')][_0x3e64('0x6e')],_0x5f65c5[_0x3e64('0x6f')]['id'],_0x5e9bb2['body']?JSON[_0x3e64('0x27')](_0x5e9bb2[_0x3e64('0x5d')]):_0x3e64('0x70'));return respondWithRpcPromise(_0x3e64('0x71'),'acceptMessage',_0x5f65c5);}return null;})[_0x3e64('0x23')](function(_0x5116f5){var _0x295717=_0x3e64('0x72')+_0x5116f5[_0x3e64('0x2b')]['ContactId'];return db['sequelize'][_0x3e64('0x43')](_0x295717,{'type':db[_0x3e64('0x73')][_0x3e64('0x74')]['SELECT'],'raw':!![]})['then'](function(_0x5bd453){return _0x5bd453;});})[_0x3e64('0x23')](function(_0x1a2593){if(_0x1a2593){_0x5f65c5[_0x3e64('0x2b')]['contact']=_0x1a2593[0x0];if(!_0x5e9bb2[_0x3e64('0x5d')][_0x3e64('0x66')])return;return db['User'][_0x3e64('0x5b')]({'where':{'id':_0x5e9bb2['body'][_0x3e64('0x66')],'role':_0x3e64('0x75')},'attributes':['id','name','fullname',_0x3e64('0x76'),_0x3e64('0x77')],'raw':!![]});}return null;})[_0x3e64('0x23')](function(_0x1bee64){if(!_0x1bee64)return null;_0x5f65c5[_0x3e64('0x2b')][_0x3e64('0x75')]=_0x1bee64;return _0x5f65c5;})['then'](function(_0x55e27d){if(_0x55e27d){if(_0x5e9bb2[_0x3e64('0x5d')][_0x3e64('0x78')]){_0x5f65c5[_0x3e64('0x2b')]['interface']=util[_0x3e64('0x64')](_0x3e64('0x79'),_0x5e9bb2[_0x3e64('0x6d')][_0x3e64('0x3c')]);_0x5f65c5[_0x3e64('0x2b')][_0x3e64('0x7a')]=_0x5f65c5[_0x3e64('0x7a')];_0x5f65c5[_0x3e64('0x2b')][_0x3e64('0x7b')]=_0x5f65c5[_0x3e64('0x7a')];_0x5f65c5[_0x3e64('0x2b')]['event']='accept';return respondWithRpcPromise(_0x3e64('0x7c'),'EventManager',{'event':_0x3e64('0x7d'),'message':_0x5f65c5[_0x3e64('0x2b')]},client9002)[_0x3e64('0x23')](function(){return _0x5f65c5;});}return _0x5f65c5;}return null;})[_0x3e64('0x23')](respondWithResult(_0x2c1092,null))[_0x3e64('0x58')](handleError(_0x2c1092,null));};var interaction_log=require(_0x3e64('0x16'))('sms-interactions');exports['reject']=function(_0x166493,_0x3be9f3,_0x4ad7ff){var _0xeeb231={'agent':{},'channel':_0x3e64('0x62')};if(_0x166493[_0x3e64('0x5d')]['id']){delete _0x166493[_0x3e64('0x5d')]['id'];}_0x166493[_0x3e64('0x5d')][_0x3e64('0x66')]=_0x166493['body']['UserId']||_0x166493[_0x3e64('0x6d')]['id'];_0xeeb231[_0x3e64('0x75')]['id']=_0x166493['body'][_0x3e64('0x66')];return db[_0x3e64('0x55')][_0x3e64('0x5b')]({'where':{'id':_0x166493[_0x3e64('0x5e')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x3be9f3,null))[_0x3e64('0x23')](function(_0x3346a9){if(_0x3346a9){_0xeeb231[_0x3e64('0x2b')]=_0x3346a9[_0x3e64('0x67')]({'plain':!![]});return db[_0x3e64('0x68')][_0x3e64('0x5b')]({'where':{'id':_0x3346a9['SmsInteractionId']}});}return null;})[_0x3e64('0x23')](handleEntityNotFound(_0x3be9f3,null))['then'](function(_0x4bf60c){if(_0x4bf60c){_0xeeb231[_0x3e64('0x6f')]=_0x4bf60c['get']({'plain':!![]});interaction_log[_0x3e64('0x24')](_0x3e64('0x7e'),_0x166493[_0x3e64('0x6d')]['id'],_0x166493[_0x3e64('0x6d')]['name'],_0x166493[_0x3e64('0x6d')][_0x3e64('0x6e')],_0xeeb231[_0x3e64('0x6f')]['id'],_0x166493[_0x3e64('0x5d')]?JSON[_0x3e64('0x27')](_0x166493[_0x3e64('0x5d')]):_0x3e64('0x70'));return respondWithRpcPromise('RejectMessage',_0x3e64('0x7f'),_0xeeb231);}return null;})[_0x3e64('0x23')](function(_0x36795b){var _0x4f8685=_0x3e64('0x72')+_0x36795b[_0x3e64('0x2b')][_0x3e64('0x80')];return db[_0x3e64('0x81')]['query'](_0x4f8685,{'type':db[_0x3e64('0x73')][_0x3e64('0x74')][_0x3e64('0x82')],'raw':!![]})[_0x3e64('0x23')](function(_0xede73a){return _0xede73a;});})['then'](function(_0x3cd566){if(_0x3cd566){_0xeeb231[_0x3e64('0x2b')][_0x3e64('0x83')]=_0x3cd566[0x0];if(!_0x166493[_0x3e64('0x5d')][_0x3e64('0x66')])return;return db[_0x3e64('0x84')][_0x3e64('0x5b')]({'where':{'id':_0x166493['body']['UserId'],'role':_0x3e64('0x75')},'attributes':['id','name','fullname',_0x3e64('0x76'),_0x3e64('0x77')],'raw':!![]});}return null;})[_0x3e64('0x23')](function(_0x1265ae){if(!_0x1265ae)return null;_0xeeb231[_0x3e64('0x2b')]['agent']=_0x1265ae;return _0xeeb231;})[_0x3e64('0x23')](function(_0x51d03b){if(_0x51d03b){_0x51d03b[_0x3e64('0x2b')][_0x3e64('0x85')]=util[_0x3e64('0x64')](_0x3e64('0x79'),_0x166493[_0x3e64('0x6d')][_0x3e64('0x3c')]);_0x51d03b[_0x3e64('0x2b')][_0x3e64('0x7a')]=_0xeeb231[_0x3e64('0x7a')];_0x51d03b[_0x3e64('0x2b')][_0x3e64('0x7b')]=_0xeeb231['channel'];_0x51d03b[_0x3e64('0x2b')][_0x3e64('0x86')]=_0x3e64('0x37');respondWithRpcPromise(_0x3e64('0x7c'),_0x3e64('0x7c'),{'event':_0x3e64('0x87'),'message':_0x51d03b['message']},client9002);return _0xeeb231;}return null;})[_0x3e64('0x23')](respondWithResult(_0x3be9f3,null))[_0x3e64('0x58')](handleError(_0x3be9f3,null));};exports[_0x3e64('0x2d')]=function(_0x1008f6,_0x495f96,_0x2b3e71){if(_0x1008f6[_0x3e64('0x5d')]['id']){delete _0x1008f6['body']['id'];}var _0xebd0c3;return db[_0x3e64('0x55')][_0x3e64('0x5b')]({'where':{'id':_0x1008f6[_0x3e64('0x5e')]['id']}})[_0x3e64('0x23')](handleEntityNotFound(_0x495f96,null))[_0x3e64('0x23')](function(_0x4c6185){if(_0x4c6185){_0xebd0c3=_0x4c6185;return db['SmsAccount'][_0x3e64('0x5b')]({'where':{'id':_0x4c6185[_0x3e64('0x88')]}});}})[_0x3e64('0x23')](handleEntityNotFound(_0x495f96,null))[_0x3e64('0x23')](function(_0x3faf07){if(_0x3faf07){logger[_0x3e64('0x89')](_0x3e64('0x26'),_0x3e64('0x2d'),_0x3e64('0x8a'),_0x3faf07['type'],util[_0x3e64('0x8b')](_0x1008f6[_0x3e64('0x5d')],{'showHidden':![],'depth':null}));switch(_0x3faf07[_0x3e64('0x42')]){case _0x3e64('0x8c'):if(_0x1008f6[_0x3e64('0x5d')]['MessageSid']&&_0x1008f6['body']['MessageSid']===_0xebd0c3[_0x3e64('0x8d')]){return _0xebd0c3[_0x3e64('0x39')]({'read':!![]});}else{logger[_0x3e64('0x28')](_0x3e64('0x8e'),_0x3e64('0x2d'),_0x3e64('0x8c'),util[_0x3e64('0x8b')](_0x1008f6[_0x3e64('0x5d')],{'showHidden':![],'depth':null}));}break;case'plivo':if(_0x1008f6[_0x3e64('0x5d')][_0x3e64('0x8f')]&&_0x1008f6[_0x3e64('0x5d')][_0x3e64('0x8f')]===_0xebd0c3[_0x3e64('0x8d')]&&_['indexOf'](['sent',_0x3e64('0x90')],_0x1008f6[_0x3e64('0x5d')]['Status'])>=0x0){return _0xebd0c3[_0x3e64('0x39')]({'read':!![]});}else{logger[_0x3e64('0x28')](_0x3e64('0x8e'),_0x3e64('0x2d'),_0x3e64('0x91'),util[_0x3e64('0x8b')](_0x1008f6['body'],{'showHidden':![],'depth':null}));}break;case _0x3e64('0x92'):var _0x1304a4=_0x1008f6[_0x3e64('0x5d')]['results'][0x0];if(_0x1304a4[_0x3e64('0x2d')][_0x3e64('0x93')]===_0x3e64('0x94')){return _0xebd0c3['update']({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x3e64('0x2d'),_0x3e64('0x92'),util[_0x3e64('0x8b')](_0x1008f6['body'],{'showHidden':![],'depth':null}));}break;}return _0xebd0c3;}})[_0x3e64('0x23')](respondWithResult(_0x495f96,null))[_0x3e64('0x58')](handleError(_0x495f96,null));};
\ No newline at end of file
index 3f2d5b3..5b190ba 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x23a4=['save','update','remove','emit','hasOwnProperty','hook','exports','events','setMaxListeners'];(function(_0x3c6125,_0x3b2a9c){var _0x2f47b8=function(_0x214650){while(--_0x214650){_0x3c6125['push'](_0x3c6125['shift']());}};_0x2f47b8(++_0x3b2a9c);}(_0x23a4,0x15d));var _0x423a=function(_0x23bb23,_0x456f95){_0x23bb23=_0x23bb23-0x0;var _0x5241b2=_0x23a4[_0x23bb23];return _0x5241b2;};'use strict';var EventEmitter=require(_0x423a('0x0'));var SmsMessage=require('../../mysqldb')['db']['SmsMessage'];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x423a('0x1')](0x0);var events={'afterCreate':_0x423a('0x2'),'afterUpdate':_0x423a('0x3'),'afterDestroy':_0x423a('0x4')};function emitEvent(_0x121e34){return function(_0x33a9b1,_0x1254aa,_0x5ccf43){SmsMessageEvents[_0x423a('0x5')](_0x121e34+':'+_0x33a9b1['id'],_0x33a9b1);SmsMessageEvents['emit'](_0x121e34,_0x33a9b1);_0x5ccf43(null);};}for(var e in events){if(events[_0x423a('0x6')](e)){var event=events[e];SmsMessage[_0x423a('0x7')](e,emitEvent(event));}}module[_0x423a('0x8')]=SmsMessageEvents;
\ No newline at end of file
+var _0x2cd4=['hook','exports','events','../../mysqldb','SmsMessage','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x480393,_0x5a7a1c){var _0x1e856a=function(_0x5df0c6){while(--_0x5df0c6){_0x480393['push'](_0x480393['shift']());}};_0x1e856a(++_0x5a7a1c);}(_0x2cd4,0x124));var _0x42cd=function(_0x2351c4,_0x1dca54){_0x2351c4=_0x2351c4-0x0;var _0x1dd3f8=_0x2cd4[_0x2351c4];return _0x1dd3f8;};'use strict';var EventEmitter=require(_0x42cd('0x0'));var SmsMessage=require(_0x42cd('0x1'))['db'][_0x42cd('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x42cd('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x42cd('0x4'),'afterDestroy':_0x42cd('0x5')};function emitEvent(_0x531b56){return function(_0x3038e5,_0x1f4cac,_0x27076d){SmsMessageEvents[_0x42cd('0x6')](_0x531b56+':'+_0x3038e5['id'],_0x3038e5);SmsMessageEvents[_0x42cd('0x6')](_0x531b56,_0x3038e5);_0x27076d(null);};}for(var e in events){if(events[_0x42cd('0x7')](e)){var event=events[e];SmsMessage[_0x42cd('0x8')](e,emitEvent(event));}}module[_0x42cd('0x9')]=SmsMessageEvents;
\ No newline at end of file
index 47b7746..a9ffe11 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x30cc=['https://api.plivo.com/v1/Account/%s/Message/','message_uuid','infobip','baseUrl','/sms/2/text/advanced','application/json','IBSSO\x20','Missing\x20parameters:\x20base_url','apiKey','login','text','keys','length','createHash','md5','digest','hex','signature=','GET','/external/get/send.php?','csc','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','uuid','UTF-8','bandwidth','%s:%s','https://messaging.bandwidth.com/api/v2/users/','/messages','applicationId','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','https://api.intelepeer.com/_rest/v4/app/sms/mdr','message','refid','status','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./smsMessage.attributes','define','SmsMessage','messageId','fti_sms_messages','FULLTEXT','models','get','direction','toLowerCase','secret','isNil','UserId','SmsInteractionId','findOne','then','update','createdAt','catch','error','out','SmsAccount','find','SmsAccountId','type','twilio','accountSid','authToken','phone','messages','create','body','remote','/api/sms/messages/','/status?token=','token','sid','SmsMessage,\x20%s,\x20%s,\x20%s','inspect','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','password','smsMethod','sender','login?username=','username','&password=','split','sms','user_key','session_key','total_sent','internal_order_id','deliveryReport','Missing\x20parameters:\x20username,\x20password','senderString','POST','https://smsapi.connectel.se/api/v2/send/','requestid','read','connectel','clicksend','xCALLY\x20Motion','format','Basic\x20%s','toString','base64','http_code','data','queued_count','head','clickSend','plivo','authId'];(function(_0x44985c,_0x43748b){var _0x52b848=function(_0x5a453e){while(--_0x5a453e){_0x44985c['push'](_0x44985c['shift']());}};_0x52b848(++_0x43748b);}(_0x30cc,0x129));var _0xc30c=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0x30cc[_0x5d4607];return _0x5e4a86;};'use strict';var _=require(_0xc30c('0x0'));var util=require(_0xc30c('0x1'));var logger=require(_0xc30c('0x2'))(_0xc30c('0x3'));var moment=require('moment');var BPromise=require(_0xc30c('0x4'));var rp=require(_0xc30c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc30c('0x6'));var config=require(_0xc30c('0x7'));var attributes=require(_0xc30c('0x8'));module['exports']=function(_0x49c89b,_0x13cc2c){return _0x49c89b[_0xc30c('0x9')](_0xc30c('0xa'),attributes,{'tableName':'sms_messages','paranoid':![],'indexes':[{'name':'messageId','fields':[_0xc30c('0xb')]},{'name':_0xc30c('0xc'),'fields':['body'],'type':_0xc30c('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x12dd57,_0x210ff1,_0x4a6e79){var _0x4f251d=_0x49c89b[_0xc30c('0xe')];var _0x32bc2d=_0x12dd57[_0xc30c('0xf')]({'plain':!![]});if(_0x32bc2d[_0xc30c('0x10')]['toLowerCase']()==='in'||_0x32bc2d[_0xc30c('0x10')][_0xc30c('0x11')]()==='out'&&!_0x32bc2d[_0xc30c('0x12')]&&!_[_0xc30c('0x13')](_0x32bc2d[_0xc30c('0x14')])&&!_[_0xc30c('0x13')](_0x32bc2d[_0xc30c('0x15')])){_0x4f251d['SmsInteraction'][_0xc30c('0x16')]({'where':{'id':_0x32bc2d[_0xc30c('0x15')]}})[_0xc30c('0x17')](function(_0x2f0c23){if(_0x2f0c23){_0x2f0c23[_0xc30c('0x18')]({'lastMsgAt':_0x32bc2d[_0xc30c('0x19')],'lastMsgDirection':_0x32bc2d['direction']['toLowerCase']()});}})[_0xc30c('0x1a')](function(_0x3f4e73){console[_0xc30c('0x1b')](_0x3f4e73);});}if(_0x32bc2d['direction']===_0xc30c('0x1c')&&!_0x32bc2d[_0xc30c('0x12')]){var _0x16aada;_0x4f251d[_0xc30c('0x1d')][_0xc30c('0x1e')]({'where':{'id':_0x32bc2d[_0xc30c('0x1f')]},'raw':!![]})['then'](function(_0x4a2e3a){_0x16aada=_0x4a2e3a;if(_0x16aada&&_0x16aada[_0xc30c('0x20')]){switch(_0x16aada[_0xc30c('0x20')]){case _0xc30c('0x21'):var _0x7dabf0=require(_0xc30c('0x21'));if(_0x16aada[_0xc30c('0x22')]&&_0x16aada[_0xc30c('0x23')]&&_0x16aada[_0xc30c('0x24')]){var _0x513690=new _0x7dabf0(_0x16aada['accountSid'],_0x16aada[_0xc30c('0x23')]);_0x513690[_0xc30c('0x25')][_0xc30c('0x26')]({'body':_0x32bc2d[_0xc30c('0x27')],'to':_0x32bc2d['phone'],'from':_0x16aada[_0xc30c('0x24')],'statusCallback':_0x16aada[_0xc30c('0x28')]+_0xc30c('0x29')+_0x32bc2d['id']+_0xc30c('0x2a')+_0x16aada[_0xc30c('0x2b')]})[_0xc30c('0x17')](function(_0x4d65a6){if(_0x4d65a6['sid']){return _0x12dd57[_0xc30c('0x18')]({'messageId':_0x4d65a6[_0xc30c('0x2c')]});}})[_0xc30c('0x1a')](function(_0x6b12be){logger[_0xc30c('0x1b')](_0xc30c('0x2d'),'afterCreate',_0xc30c('0x21'),util[_0xc30c('0x2e')](_0x6b12be,{'showHidden':![],'depth':null}));});}else{logger[_0xc30c('0x1b')](_0xc30c('0x2d'),_0xc30c('0x2f'),'twilio',_0xc30c('0x30'));}break;case _0xc30c('0x31'):var _0x59ca89=_0xc30c('0x32');if(_0x16aada['username']&&_0x16aada[_0xc30c('0x33')]){var _0x4c6351={'recipient':[_0x32bc2d[_0xc30c('0x24')]],'message':_0x32bc2d[_0xc30c('0x27')],'message_type':_0x16aada[_0xc30c('0x34')]};if(_0x16aada[_0xc30c('0x34')]&&_0x16aada[_0xc30c('0x34')]!=='SI'){_0x4c6351[_0xc30c('0x35')]=_0x16aada['phone'];}var _0x6acf3={'url':_0x59ca89+_0xc30c('0x36')+_0x16aada[_0xc30c('0x37')]+_0xc30c('0x38')+_0x16aada[_0xc30c('0x33')],'method':'GET'};rp(_0x6acf3)[_0xc30c('0x17')](function(_0x3bd8f8){var _0x1e078c=_0x3bd8f8[_0xc30c('0x39')](';');var _0x63de10={'user_key':_0x1e078c[0x0],'session_key':_0x1e078c[0x1]};_0x6acf3={'url':_0x59ca89+_0xc30c('0x3a'),'method':'POST','headers':{'user_key':_0x63de10[_0xc30c('0x3b')],'Session_key':_0x63de10[_0xc30c('0x3c')]},'json':!![],'body':_0x4c6351};return rp(_0x6acf3);})[_0xc30c('0x17')](function(_0x39bee3){if(_0x39bee3[_0xc30c('0x3d')]>=0x1){var _0x396985={'messageId':_0x39bee3[_0xc30c('0x3e')]};if(_0x16aada[_0xc30c('0x34')]!=='GP'||!_0x16aada[_0xc30c('0x3f')]){_0x396985['read']=!![];}return _0x12dd57[_0xc30c('0x18')](_0x396985);}else{return logger['error'](_0xc30c('0x2d'),_0xc30c('0x2f'),_0xc30c('0x31'),util[_0xc30c('0x2e')](_0x39bee3,{'showHidden':![],'depth':null}));}})[_0xc30c('0x1a')](function(_0x5c4d54){return logger[_0xc30c('0x1b')](_0xc30c('0x2d'),_0xc30c('0x2f'),_0xc30c('0x31'),util['inspect'](_0x5c4d54,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xc30c('0x2d'),_0xc30c('0x2f'),_0xc30c('0x31'),_0xc30c('0x40'));}break;case'connectel':if(_0x16aada[_0xc30c('0x23')]){var _0x301d6a={'recipient':_0x32bc2d[_0xc30c('0x24')],'message':_0x32bc2d[_0xc30c('0x27')],'sender':_0x16aada[_0xc30c('0x41')]||_0x16aada[_0xc30c('0x24')],'authorization':_0x16aada[_0xc30c('0x23')]};var _0x210ff1={'method':_0xc30c('0x42'),'uri':_0xc30c('0x43'),'body':_0x301d6a,'json':!![]};rp(_0x210ff1)['then'](function(_0x28b3ee){var _0x377005={'messageId':_0x28b3ee[_0xc30c('0x44')]};if(!_0x16aada[_0xc30c('0x3f')]){_0x377005[_0xc30c('0x45')]=!![];}return _0x12dd57['update'](_0x377005);})[_0xc30c('0x1a')](function(_0x5eec86){logger[_0xc30c('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xc30c('0x2f'),'connectel',util[_0xc30c('0x2e')](_0x5eec86,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xc30c('0x2f'),_0xc30c('0x46'),'Missing\x20parameters:\x20authToken');}break;case _0xc30c('0x47'):if(_0x16aada[_0xc30c('0x37')]&&_0x16aada[_0xc30c('0x33')]){var _0x301d6a={'messages':[{'source':_0xc30c('0x48'),'to':_0x32bc2d[_0xc30c('0x24')],'body':_0x32bc2d[_0xc30c('0x27')],'from':_0x16aada['senderString']||_0x16aada[_0xc30c('0x24')]}]};var _0x5d0731=util[_0xc30c('0x49')]('%s:%s',_0x16aada[_0xc30c('0x37')],_0x16aada[_0xc30c('0x33')]);var _0x210ff1={'method':_0xc30c('0x42'),'uri':'https://rest.clicksend.com/v3/sms/send','body':_0x301d6a,'headers':{'Authorization':util[_0xc30c('0x49')](_0xc30c('0x4a'),new Buffer(_0x5d0731)[_0xc30c('0x4b')](_0xc30c('0x4c')))},'json':!![]};rp(_0x210ff1)[_0xc30c('0x17')](function(_0x4d1ecf){if(_0x4d1ecf[_0xc30c('0x4d')]>=0xc8&&_0x4d1ecf[_0xc30c('0x4d')]<=0xce){if(_0x4d1ecf[_0xc30c('0x4e')]&&_0x4d1ecf['data'][_0xc30c('0x4f')]>0x0){var _0x220fd7=_[_0xc30c('0x50')](_0x4d1ecf[_0xc30c('0x4e')]['messages']);var _0x3faaf6={'messageId':_0x220fd7['message_id']};if(!_0x16aada['deliveryReport']){_0x3faaf6[_0xc30c('0x45')]=!![];}return _0x12dd57[_0xc30c('0x18')](_0x3faaf6);}else{logger[_0xc30c('0x1b')](_0xc30c('0x2d'),_0xc30c('0x2f'),_0xc30c('0x51'),util['inspect'](_0x4d1ecf,{'showHidden':![],'depth':null}));}}else{logger[_0xc30c('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xc30c('0x2f'),'clickSend',util[_0xc30c('0x2e')](_0x4d1ecf,{'showHidden':![],'depth':null}));}})[_0xc30c('0x1a')](function(_0x71bb42){logger['error'](_0xc30c('0x2d'),_0xc30c('0x2f'),_0xc30c('0x51'),util[_0xc30c('0x2e')](_0x71bb42,{'showHidden':![],'depth':null}));});}else{logger[_0xc30c('0x1b')](_0xc30c('0x2d'),_0xc30c('0x2f'),_0xc30c('0x51'),_0xc30c('0x40'));}break;case _0xc30c('0x52'):if(_0x16aada[_0xc30c('0x53')]&&_0x16aada[_0xc30c('0x23')]){var _0x301d6a={'dst':_0x32bc2d[_0xc30c('0x24')],'text':_0x32bc2d[_0xc30c('0x27')],'src':_0x16aada[_0xc30c('0x41')]||_0x16aada[_0xc30c('0x24')],'url':_0x16aada[_0xc30c('0x28')]+_0xc30c('0x29')+_0x32bc2d['id']+_0xc30c('0x2a')+_0x16aada[_0xc30c('0x2b')]};var _0x5d0731=util[_0xc30c('0x49')]('%s:%s',_0x16aada['authId'],_0x16aada[_0xc30c('0x23')]);var _0x210ff1={'method':_0xc30c('0x42'),'uri':util[_0xc30c('0x49')](_0xc30c('0x54'),_0x16aada[_0xc30c('0x53')]),'body':_0x301d6a,'headers':{'Authorization':util['format']('Basic\x20%s',new Buffer(_0x5d0731)[_0xc30c('0x4b')](_0xc30c('0x4c')))},'json':!![]};rp(_0x210ff1)['then'](function(_0x46f6da){var _0x42efe5={'messageId':_0x46f6da[_0xc30c('0x55')][0x0]};return _0x12dd57[_0xc30c('0x18')](_0x42efe5);})['catch'](function(_0x2eb45b){logger[_0xc30c('0x1b')](_0xc30c('0x2d'),_0xc30c('0x2f'),_0xc30c('0x52'),util[_0xc30c('0x2e')](_0x2eb45b,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xc30c('0x2d'),'afterCreate','plivo','Missing\x20parameters:\x20authId,\x20authToken');}break;case _0xc30c('0x56'):if(_0x16aada['username']&&_0x16aada[_0xc30c('0x33')]){if(_0x16aada[_0xc30c('0x57')]){var _0xa0007d={'method':'POST','uri':_0x16aada[_0xc30c('0x57')]+'/auth/1/session','body':{'username':_0x16aada[_0xc30c('0x37')],'password':_0x16aada[_0xc30c('0x33')]},'json':!![]};return rp(_0xa0007d)['then'](function(_0x58beeb){var _0x3ea6c5={'method':'POST','uri':_0x16aada['baseUrl']+_0xc30c('0x58'),'body':{'messages':[{'from':_0x16aada[_0xc30c('0x24')],'destinations':[{'to':_0x32bc2d[_0xc30c('0x24')]}],'text':_0x32bc2d['body'],'notifyUrl':_0x16aada[_0xc30c('0x28')]+'/api/sms/messages/'+_0x32bc2d['id']+_0xc30c('0x2a')+_0x16aada[_0xc30c('0x2b')],'notifyContentType':_0xc30c('0x59'),'callbackData':_0x16aada[_0xc30c('0x24')]+';'+_0x32bc2d[_0xc30c('0x27')]}]},'headers':{'Authorization':_0xc30c('0x5a')+_0x58beeb[_0xc30c('0x2b')]},'json':!![]};return rp(_0x3ea6c5)['then'](function(_0x28d625){if(_0x28d625[_0xc30c('0x25')]){var _0x2c73e9={'messageId':_0x28d625[_0xc30c('0x25')][0x0][_0xc30c('0xb')]};if(!_0x16aada[_0xc30c('0x3f')]){_0x2c73e9[_0xc30c('0x45')]=!![];}return _0x12dd57[_0xc30c('0x18')](_0x2c73e9);}else{return logger['error'](_0xc30c('0x2d'),_0xc30c('0x2f'),_0xc30c('0x56'),util[_0xc30c('0x2e')](_0x28d625,{'showHidden':![],'depth':null}));}});})[_0xc30c('0x1a')](function(_0x2b03c7){return logger[_0xc30c('0x1b')](_0xc30c('0x2d'),_0xc30c('0x2f'),_0xc30c('0x56'),util[_0xc30c('0x2e')](_0x2b03c7,{'showHidden':![],'depth':null}));});}else{logger[_0xc30c('0x1b')](_0xc30c('0x2d'),_0xc30c('0x2f'),_0xc30c('0x56'),_0xc30c('0x5b'));}}else{logger[_0xc30c('0x1b')](_0xc30c('0x2d'),'afterCreate',_0xc30c('0x56'),'Missing\x20parameters:\x20username,\x20password');}break;case'csc':var _0x200a79=require('crypto');if(_0x16aada[_0xc30c('0x5c')]){var _0x4e9629={};_0x4e9629[_0xc30c('0x5d')]=_0x16aada[_0xc30c('0x37')];_0x4e9629['phone']=_0x32bc2d[_0xc30c('0x24')];_0x4e9629[_0xc30c('0x35')]=_0x16aada[_0xc30c('0x24')];_0x4e9629[_0xc30c('0x5e')]=_0x32bc2d[_0xc30c('0x27')];_0x4e9629['timestamp']=+new Date();var _0x23d67e='';var _0x5ae1e9='';var _0x48539b=Object[_0xc30c('0x5f')](_0x4e9629);_0x48539b['sort']();for(var _0xc96da5=0x0;_0xc96da5<_0x48539b[_0xc30c('0x60')];_0xc96da5++){if(_0x23d67e!=''){_0x23d67e+='&';}_0x23d67e+=_0x48539b[_0xc96da5]+'='+encodeURIComponent(_0x4e9629[_0x48539b[_0xc96da5]]);_0x5ae1e9+=_0x4e9629[_0x48539b[_0xc96da5]];}_0x5ae1e9+=_0x16aada[_0xc30c('0x5c')];_0x5ae1e9=_0x200a79[_0xc30c('0x61')](_0xc30c('0x62'))[_0xc30c('0x18')](_0x5ae1e9)[_0xc30c('0x63')](_0xc30c('0x64'));if(_0x23d67e!==''){_0x23d67e+='&';}_0x23d67e+=_0xc30c('0x65')+_0x5ae1e9;var _0x6acf3={'method':_0xc30c('0x66'),'uri':_0x16aada[_0xc30c('0x57')]+_0xc30c('0x67')+_0x23d67e,'json':!![]};return rp(_0x6acf3)[_0xc30c('0x17')](function(_0x4fed36){var _0x399251=Object[_0xc30c('0x5f')](_0x4fed36);if(_0x4fed36[_0x399251[0x0]][_0xc30c('0x1b')]&&parseInt(_0x4fed36[_0x399251[0x0]][_0xc30c('0x1b')])===0x0){var _0x3c705b={'messageId':_0x4fed36[_0x399251[0x0]]['id_sms']};if(!_0x16aada['deliveryReport']){_0x3c705b[_0xc30c('0x45')]=!![];}return _0x12dd57['update'](_0x3c705b);}else{return logger[_0xc30c('0x1b')](_0xc30c('0x2d'),_0xc30c('0x2f'),_0xc30c('0x68'),util[_0xc30c('0x2e')](_0x4fed36['error'],{'showHidden':![],'depth':null}));}})['catch'](function(_0x510479){return logger[_0xc30c('0x1b')](_0xc30c('0x2d'),_0xc30c('0x2f'),_0xc30c('0x68'),util[_0xc30c('0x2e')](_0x510479,{'showHidden':![],'depth':null}));});}else{logger[_0xc30c('0x1b')](_0xc30c('0x2d'),_0xc30c('0x2f'),'csc',_0xc30c('0x69'));}break;case _0xc30c('0x6a'):if(_0x16aada[_0xc30c('0x5c')]){var _0xc6d7f3={'method':_0xc30c('0x42'),'uri':_0xc30c('0x6b'),'headers':{'Authorization':_0x16aada['apiKey']},'body':{'content':_0x32bc2d[_0xc30c('0x27')],'to':[_0x32bc2d['phone']],'from':_0x16aada['phone'],'binary':![],'clientMessageId':_0xc30c('0x6c'),'charset':_0xc30c('0x6d')},'json':!![]};rp(_0xc6d7f3)[_0xc30c('0x17')](function(_0x442b8b){if(!_0x442b8b['error']){var _0x1b3242={'messageId':_0x442b8b[_0xc30c('0x25')][0x0]['apiMessageId']};if(!_0x16aada['deliveryReport']){_0x1b3242['read']=!![];}return _0x12dd57[_0xc30c('0x18')](_0x1b3242);}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xc30c('0x2f'),'clickatell',util['inspect'](_0x442b8b[_0xc30c('0x1b')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x27d545){return logger[_0xc30c('0x1b')](_0xc30c('0x2d'),_0xc30c('0x2f'),_0xc30c('0x6a'),util[_0xc30c('0x2e')](_0x27d545,{'showHidden':![],'depth':null}));});}else{logger[_0xc30c('0x1b')](_0xc30c('0x2d'),_0xc30c('0x2f'),_0xc30c('0x6a'),_0xc30c('0x69'));}break;case _0xc30c('0x6e'):if(_0x16aada[_0xc30c('0x37')]&&_0x16aada[_0xc30c('0x33')]){var _0x5d0731=util[_0xc30c('0x49')](_0xc30c('0x6f'),_0x16aada[_0xc30c('0x37')],_0x16aada[_0xc30c('0x33')]);var _0x210ff1={'method':_0xc30c('0x42'),'uri':_0xc30c('0x70')+_0x16aada['accountId']+_0xc30c('0x71'),'body':{'to':[_0x32bc2d[_0xc30c('0x24')]],'text':_0x32bc2d['body'],'from':_0x16aada['phone'],'applicationId':_0x16aada[_0xc30c('0x72')]},'headers':{'Authorization':util['format'](_0xc30c('0x4a'),new Buffer(_0x5d0731)['toString']('base64'))},'json':!![]};rp(_0x210ff1)[_0xc30c('0x17')](function(_0x29933d){if(_0x29933d['id']){var _0x8763d6={'messageId':_0x29933d['id']};return _0x12dd57[_0xc30c('0x18')](_0x8763d6);}else{logger[_0xc30c('0x1b')](_0xc30c('0x2d'),_0xc30c('0x2f'),'bandwidth',util[_0xc30c('0x2e')](_0x29933d,{'showHidden':![],'depth':null}));}})['catch'](function(_0x4c792f){logger['error'](_0xc30c('0x2d'),_0xc30c('0x2f'),_0xc30c('0x6e'),util['inspect'](_0x4c792f,{'showHidden':![],'depth':null}));});}else{logger[_0xc30c('0x1b')](_0xc30c('0x2d'),_0xc30c('0x2f'),_0xc30c('0x6e'),_0xc30c('0x40'));}break;case _0xc30c('0x73'):if(_0x16aada['apiKey']){var _0x5eeda3={};var _0x6acf3={'method':_0xc30c('0x42'),'uri':_0xc30c('0x74'),'headers':{'Authorization':_0xc30c('0x75')+_0x16aada['apiKey'],'Content-Type':'application/json'},'body':{'from':_0x16aada[_0xc30c('0x24')],'to':_0x32bc2d[_0xc30c('0x24')],'text':_0x32bc2d[_0xc30c('0x27')]},'json':!![]};return rp(_0x6acf3)[_0xc30c('0x17')](function(_0x247ccc){if(_0x247ccc[_0xc30c('0x76')]==0xca){_0x5eeda3['message']=_0x247ccc;var _0x1280ee={'method':_0xc30c('0x42'),'uri':_0xc30c('0x77'),'headers':{'Authorization':_0xc30c('0x75')+_0x16aada[_0xc30c('0x5c')],'Content-Type':_0xc30c('0x59')},'body':{'refid':_0x5eeda3[_0xc30c('0x78')][_0xc30c('0x79')]},'json':!![]};return rp(_0x1280ee)[_0xc30c('0x17')](function(_0x404ccb){_0x5eeda3[_0xc30c('0x7a')]=_0x404ccb;var _0x22e0b6={'messageId':_0x5eeda3['message'][_0xc30c('0x79')],'read':!![]};return _0x12dd57['update'](_0x22e0b6);});}else{return logger['error'](_0xc30c('0x2d'),'afterCreate',_0xc30c('0x73'),util[_0xc30c('0x2e')](_0x247ccc,{'showHidden':![],'depth':null}));}})['catch'](function(_0x2504da){return logger['error'](_0xc30c('0x2d'),'afterCreate',_0xc30c('0x73'),util[_0xc30c('0x2e')](_0x2504da,{'showHidden':![],'depth':null}));});}else{return logger[_0xc30c('0x1b')](_0xc30c('0x2d'),_0xc30c('0x2f'),_0xc30c('0x73'),_0xc30c('0x7b'));}break;}}})[_0xc30c('0x7c')](function(){_0x4a6e79();});}else{_0x4a6e79();}}},'charset':_0xc30c('0x7d'),'collate':_0xc30c('0x7e')});};
\ No newline at end of file
+var _0x4fd1=['findOne','createdAt','catch','error','out','find','SmsAccountId','type','twilio','authToken','phone','create','body','remote','/api/sms/messages/','token','then','sid','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','sender','login?username=','&password=','GET','split','session_key','total_sent','internal_order_id','deliveryReport','read','update','Missing\x20parameters:\x20username,\x20password','connectel','senderString','POST','https://smsapi.connectel.se/api/v2/send/','requestid','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','format','%s:%s','https://rest.clicksend.com/v3/sms/send','toString','base64','http_code','data','queued_count','head','messages','message_id','clickSend','plivo','authId','/status?token=','https://api.plivo.com/v1/Account/%s/Message/','Basic\x20%s','baseUrl','/sms/2/text/advanced','IBSSO\x20','infobip','Missing\x20parameters:\x20base_url','csc','apiKey','text','timestamp','keys','sort','length','hex','signature=','clickatell','https://platform.clickatell.com/messages','apiMessageId','Missing\x20parameters:\x20apiKey','bandwidth','https://messaging.bandwidth.com/api/v2/users/','accountId','applicationId','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','application/json','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','status','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./smsMessage.attributes','exports','messageId','fti_sms_messages','FULLTEXT','models','get','direction','toLowerCase','secret','UserId','isNil','SmsInteractionId','SmsInteraction'];(function(_0x3bc983,_0xfc52db){var _0x41d8c0=function(_0x4e32f2){while(--_0x4e32f2){_0x3bc983['push'](_0x3bc983['shift']());}};_0x41d8c0(++_0xfc52db);}(_0x4fd1,0x1ce));var _0x14fd=function(_0x4d328e,_0x8a1f7a){_0x4d328e=_0x4d328e-0x0;var _0x309cb1=_0x4fd1[_0x4d328e];return _0x309cb1;};'use strict';var _=require(_0x14fd('0x0'));var util=require(_0x14fd('0x1'));var logger=require('../../config/logger')(_0x14fd('0x2'));var moment=require('moment');var BPromise=require(_0x14fd('0x3'));var rp=require(_0x14fd('0x4'));var fs=require('fs');var path=require(_0x14fd('0x5'));var rimraf=require(_0x14fd('0x6'));var config=require(_0x14fd('0x7'));var attributes=require(_0x14fd('0x8'));module[_0x14fd('0x9')]=function(_0x4ab78f,_0x241592){return _0x4ab78f['define']('SmsMessage',attributes,{'tableName':'sms_messages','paranoid':![],'indexes':[{'name':_0x14fd('0xa'),'fields':[_0x14fd('0xa')]},{'name':_0x14fd('0xb'),'fields':['body'],'type':_0x14fd('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x49a610,_0x1d176c,_0x48b580){var _0x17d889=_0x4ab78f[_0x14fd('0xd')];var _0x205baf=_0x49a610[_0x14fd('0xe')]({'plain':!![]});if(_0x205baf[_0x14fd('0xf')][_0x14fd('0x10')]()==='in'||_0x205baf[_0x14fd('0xf')][_0x14fd('0x10')]()==='out'&&!_0x205baf[_0x14fd('0x11')]&&!_['isNil'](_0x205baf[_0x14fd('0x12')])&&!_[_0x14fd('0x13')](_0x205baf[_0x14fd('0x14')])){_0x17d889[_0x14fd('0x15')][_0x14fd('0x16')]({'where':{'id':_0x205baf[_0x14fd('0x14')]}})['then'](function(_0x35d86a){if(_0x35d86a){_0x35d86a['update']({'lastMsgAt':_0x205baf[_0x14fd('0x17')],'lastMsgDirection':_0x205baf[_0x14fd('0xf')][_0x14fd('0x10')]()});}})[_0x14fd('0x18')](function(_0x4f799a){console[_0x14fd('0x19')](_0x4f799a);});}if(_0x205baf[_0x14fd('0xf')]===_0x14fd('0x1a')&&!_0x205baf[_0x14fd('0x11')]){var _0x2bf5c4;_0x17d889['SmsAccount'][_0x14fd('0x1b')]({'where':{'id':_0x205baf[_0x14fd('0x1c')]},'raw':!![]})['then'](function(_0x276f4b){_0x2bf5c4=_0x276f4b;if(_0x2bf5c4&&_0x2bf5c4[_0x14fd('0x1d')]){switch(_0x2bf5c4['type']){case _0x14fd('0x1e'):var _0x4e9b69=require(_0x14fd('0x1e'));if(_0x2bf5c4['accountSid']&&_0x2bf5c4[_0x14fd('0x1f')]&&_0x2bf5c4[_0x14fd('0x20')]){var _0x2d1440=new _0x4e9b69(_0x2bf5c4['accountSid'],_0x2bf5c4['authToken']);_0x2d1440['messages'][_0x14fd('0x21')]({'body':_0x205baf[_0x14fd('0x22')],'to':_0x205baf[_0x14fd('0x20')],'from':_0x2bf5c4[_0x14fd('0x20')],'statusCallback':_0x2bf5c4[_0x14fd('0x23')]+_0x14fd('0x24')+_0x205baf['id']+'/status?token='+_0x2bf5c4[_0x14fd('0x25')]})[_0x14fd('0x26')](function(_0x149815){if(_0x149815[_0x14fd('0x27')]){return _0x49a610['update']({'messageId':_0x149815[_0x14fd('0x27')]});}})[_0x14fd('0x18')](function(_0x4e6813){logger[_0x14fd('0x19')](_0x14fd('0x28'),_0x14fd('0x29'),'twilio',util[_0x14fd('0x2a')](_0x4e6813,{'showHidden':![],'depth':null}));});}else{logger[_0x14fd('0x19')](_0x14fd('0x28'),_0x14fd('0x29'),_0x14fd('0x1e'),_0x14fd('0x2b'));}break;case _0x14fd('0x2c'):var _0x4094b5=_0x14fd('0x2d');if(_0x2bf5c4[_0x14fd('0x2e')]&&_0x2bf5c4[_0x14fd('0x2f')]){var _0xd6c536={'recipient':[_0x205baf[_0x14fd('0x20')]],'message':_0x205baf['body'],'message_type':_0x2bf5c4[_0x14fd('0x30')]};if(_0x2bf5c4['smsMethod']&&_0x2bf5c4[_0x14fd('0x30')]!=='SI'){_0xd6c536[_0x14fd('0x31')]=_0x2bf5c4[_0x14fd('0x20')];}var _0x16777b={'url':_0x4094b5+_0x14fd('0x32')+_0x2bf5c4['username']+_0x14fd('0x33')+_0x2bf5c4['password'],'method':_0x14fd('0x34')};rp(_0x16777b)[_0x14fd('0x26')](function(_0x1a786b){var _0x1f6290=_0x1a786b[_0x14fd('0x35')](';');var _0x1c25ed={'user_key':_0x1f6290[0x0],'session_key':_0x1f6290[0x1]};_0x16777b={'url':_0x4094b5+'sms','method':'POST','headers':{'user_key':_0x1c25ed['user_key'],'Session_key':_0x1c25ed[_0x14fd('0x36')]},'json':!![],'body':_0xd6c536};return rp(_0x16777b);})[_0x14fd('0x26')](function(_0x504c79){if(_0x504c79[_0x14fd('0x37')]>=0x1){var _0x4677f6={'messageId':_0x504c79[_0x14fd('0x38')]};if(_0x2bf5c4[_0x14fd('0x30')]!=='GP'||!_0x2bf5c4[_0x14fd('0x39')]){_0x4677f6[_0x14fd('0x3a')]=!![];}return _0x49a610[_0x14fd('0x3b')](_0x4677f6);}else{return logger['error'](_0x14fd('0x28'),_0x14fd('0x29'),_0x14fd('0x2c'),util[_0x14fd('0x2a')](_0x504c79,{'showHidden':![],'depth':null}));}})[_0x14fd('0x18')](function(_0x346b9e){return logger['error'](_0x14fd('0x28'),_0x14fd('0x29'),_0x14fd('0x2c'),util[_0x14fd('0x2a')](_0x346b9e,{'showHidden':![],'depth':null}));});}else{logger[_0x14fd('0x19')](_0x14fd('0x28'),_0x14fd('0x29'),'skebby',_0x14fd('0x3c'));}break;case _0x14fd('0x3d'):if(_0x2bf5c4[_0x14fd('0x1f')]){var _0x4b23d2={'recipient':_0x205baf[_0x14fd('0x20')],'message':_0x205baf[_0x14fd('0x22')],'sender':_0x2bf5c4[_0x14fd('0x3e')]||_0x2bf5c4['phone'],'authorization':_0x2bf5c4[_0x14fd('0x1f')]};var _0x1d176c={'method':_0x14fd('0x3f'),'uri':_0x14fd('0x40'),'body':_0x4b23d2,'json':!![]};rp(_0x1d176c)[_0x14fd('0x26')](function(_0x1bc45c){var _0x2158d5={'messageId':_0x1bc45c[_0x14fd('0x41')]};if(!_0x2bf5c4[_0x14fd('0x39')]){_0x2158d5[_0x14fd('0x3a')]=!![];}return _0x49a610[_0x14fd('0x3b')](_0x2158d5);})[_0x14fd('0x18')](function(_0x2ba9c1){logger['error'](_0x14fd('0x28'),_0x14fd('0x29'),_0x14fd('0x3d'),util[_0x14fd('0x2a')](_0x2ba9c1,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x14fd('0x3d'),_0x14fd('0x42'));}break;case _0x14fd('0x43'):if(_0x2bf5c4[_0x14fd('0x2e')]&&_0x2bf5c4[_0x14fd('0x2f')]){var _0x4b23d2={'messages':[{'source':_0x14fd('0x44'),'to':_0x205baf[_0x14fd('0x20')],'body':_0x205baf[_0x14fd('0x22')],'from':_0x2bf5c4[_0x14fd('0x3e')]||_0x2bf5c4['phone']}]};var _0x5b18d6=util[_0x14fd('0x45')](_0x14fd('0x46'),_0x2bf5c4[_0x14fd('0x2e')],_0x2bf5c4[_0x14fd('0x2f')]);var _0x1d176c={'method':_0x14fd('0x3f'),'uri':_0x14fd('0x47'),'body':_0x4b23d2,'headers':{'Authorization':util[_0x14fd('0x45')]('Basic\x20%s',new Buffer(_0x5b18d6)[_0x14fd('0x48')](_0x14fd('0x49')))},'json':!![]};rp(_0x1d176c)[_0x14fd('0x26')](function(_0x1d8772){if(_0x1d8772['http_code']>=0xc8&&_0x1d8772[_0x14fd('0x4a')]<=0xce){if(_0x1d8772[_0x14fd('0x4b')]&&_0x1d8772[_0x14fd('0x4b')][_0x14fd('0x4c')]>0x0){var _0x20b81b=_[_0x14fd('0x4d')](_0x1d8772[_0x14fd('0x4b')][_0x14fd('0x4e')]);var _0x5db50a={'messageId':_0x20b81b[_0x14fd('0x4f')]};if(!_0x2bf5c4[_0x14fd('0x39')]){_0x5db50a[_0x14fd('0x3a')]=!![];}return _0x49a610['update'](_0x5db50a);}else{logger[_0x14fd('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x14fd('0x50'),util['inspect'](_0x1d8772,{'showHidden':![],'depth':null}));}}else{logger[_0x14fd('0x19')](_0x14fd('0x28'),_0x14fd('0x29'),_0x14fd('0x50'),util[_0x14fd('0x2a')](_0x1d8772,{'showHidden':![],'depth':null}));}})[_0x14fd('0x18')](function(_0x317d9a){logger[_0x14fd('0x19')](_0x14fd('0x28'),_0x14fd('0x29'),_0x14fd('0x50'),util[_0x14fd('0x2a')](_0x317d9a,{'showHidden':![],'depth':null}));});}else{logger[_0x14fd('0x19')](_0x14fd('0x28'),_0x14fd('0x29'),_0x14fd('0x50'),_0x14fd('0x3c'));}break;case _0x14fd('0x51'):if(_0x2bf5c4[_0x14fd('0x52')]&&_0x2bf5c4['authToken']){var _0x4b23d2={'dst':_0x205baf[_0x14fd('0x20')],'text':_0x205baf['body'],'src':_0x2bf5c4[_0x14fd('0x3e')]||_0x2bf5c4[_0x14fd('0x20')],'url':_0x2bf5c4[_0x14fd('0x23')]+_0x14fd('0x24')+_0x205baf['id']+_0x14fd('0x53')+_0x2bf5c4[_0x14fd('0x25')]};var _0x5b18d6=util[_0x14fd('0x45')]('%s:%s',_0x2bf5c4[_0x14fd('0x52')],_0x2bf5c4[_0x14fd('0x1f')]);var _0x1d176c={'method':_0x14fd('0x3f'),'uri':util[_0x14fd('0x45')](_0x14fd('0x54'),_0x2bf5c4[_0x14fd('0x52')]),'body':_0x4b23d2,'headers':{'Authorization':util[_0x14fd('0x45')](_0x14fd('0x55'),new Buffer(_0x5b18d6)[_0x14fd('0x48')](_0x14fd('0x49')))},'json':!![]};rp(_0x1d176c)[_0x14fd('0x26')](function(_0x5ef3c0){var _0x3b8c63={'messageId':_0x5ef3c0['message_uuid'][0x0]};return _0x49a610[_0x14fd('0x3b')](_0x3b8c63);})['catch'](function(_0x1f008f){logger[_0x14fd('0x19')](_0x14fd('0x28'),'afterCreate',_0x14fd('0x51'),util['inspect'](_0x1f008f,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x14fd('0x29'),_0x14fd('0x51'),'Missing\x20parameters:\x20authId,\x20authToken');}break;case'infobip':if(_0x2bf5c4[_0x14fd('0x2e')]&&_0x2bf5c4[_0x14fd('0x2f')]){if(_0x2bf5c4[_0x14fd('0x56')]){var _0x36df90={'method':_0x14fd('0x3f'),'uri':_0x2bf5c4[_0x14fd('0x56')]+'/auth/1/session','body':{'username':_0x2bf5c4[_0x14fd('0x2e')],'password':_0x2bf5c4[_0x14fd('0x2f')]},'json':!![]};return rp(_0x36df90)[_0x14fd('0x26')](function(_0x423aa9){var _0x154418={'method':_0x14fd('0x3f'),'uri':_0x2bf5c4[_0x14fd('0x56')]+_0x14fd('0x57'),'body':{'messages':[{'from':_0x2bf5c4[_0x14fd('0x20')],'destinations':[{'to':_0x205baf[_0x14fd('0x20')]}],'text':_0x205baf[_0x14fd('0x22')],'notifyUrl':_0x2bf5c4[_0x14fd('0x23')]+'/api/sms/messages/'+_0x205baf['id']+_0x14fd('0x53')+_0x2bf5c4[_0x14fd('0x25')],'notifyContentType':'application/json','callbackData':_0x2bf5c4['phone']+';'+_0x205baf[_0x14fd('0x22')]}]},'headers':{'Authorization':_0x14fd('0x58')+_0x423aa9[_0x14fd('0x25')]},'json':!![]};return rp(_0x154418)['then'](function(_0x3f1de6){if(_0x3f1de6[_0x14fd('0x4e')]){var _0xa9a2b3={'messageId':_0x3f1de6[_0x14fd('0x4e')][0x0][_0x14fd('0xa')]};if(!_0x2bf5c4[_0x14fd('0x39')]){_0xa9a2b3[_0x14fd('0x3a')]=!![];}return _0x49a610[_0x14fd('0x3b')](_0xa9a2b3);}else{return logger[_0x14fd('0x19')](_0x14fd('0x28'),'afterCreate',_0x14fd('0x59'),util['inspect'](_0x3f1de6,{'showHidden':![],'depth':null}));}});})[_0x14fd('0x18')](function(_0x360e54){return logger[_0x14fd('0x19')](_0x14fd('0x28'),_0x14fd('0x29'),_0x14fd('0x59'),util[_0x14fd('0x2a')](_0x360e54,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x14fd('0x28'),'afterCreate','infobip',_0x14fd('0x5a'));}}else{logger[_0x14fd('0x19')](_0x14fd('0x28'),_0x14fd('0x29'),_0x14fd('0x59'),_0x14fd('0x3c'));}break;case _0x14fd('0x5b'):var _0x4721db=require('crypto');if(_0x2bf5c4[_0x14fd('0x5c')]){var _0x5df274={};_0x5df274['login']=_0x2bf5c4[_0x14fd('0x2e')];_0x5df274[_0x14fd('0x20')]=_0x205baf[_0x14fd('0x20')];_0x5df274['sender']=_0x2bf5c4[_0x14fd('0x20')];_0x5df274[_0x14fd('0x5d')]=_0x205baf[_0x14fd('0x22')];_0x5df274[_0x14fd('0x5e')]=+new Date();var _0x4b5a1c='';var _0x4a5944='';var _0x28af2f=Object[_0x14fd('0x5f')](_0x5df274);_0x28af2f[_0x14fd('0x60')]();for(var _0x1666d6=0x0;_0x1666d6<_0x28af2f[_0x14fd('0x61')];_0x1666d6++){if(_0x4b5a1c!=''){_0x4b5a1c+='&';}_0x4b5a1c+=_0x28af2f[_0x1666d6]+'='+encodeURIComponent(_0x5df274[_0x28af2f[_0x1666d6]]);_0x4a5944+=_0x5df274[_0x28af2f[_0x1666d6]];}_0x4a5944+=_0x2bf5c4[_0x14fd('0x5c')];_0x4a5944=_0x4721db['createHash']('md5')['update'](_0x4a5944)['digest'](_0x14fd('0x62'));if(_0x4b5a1c!==''){_0x4b5a1c+='&';}_0x4b5a1c+=_0x14fd('0x63')+_0x4a5944;var _0x16777b={'method':_0x14fd('0x34'),'uri':_0x2bf5c4[_0x14fd('0x56')]+'/external/get/send.php?'+_0x4b5a1c,'json':!![]};return rp(_0x16777b)['then'](function(_0x114929){var _0x411f91=Object['keys'](_0x114929);if(_0x114929[_0x411f91[0x0]]['error']&&parseInt(_0x114929[_0x411f91[0x0]][_0x14fd('0x19')])===0x0){var _0x927795={'messageId':_0x114929[_0x411f91[0x0]]['id_sms']};if(!_0x2bf5c4['deliveryReport']){_0x927795['read']=!![];}return _0x49a610[_0x14fd('0x3b')](_0x927795);}else{return logger[_0x14fd('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x14fd('0x29'),_0x14fd('0x5b'),util[_0x14fd('0x2a')](_0x114929[_0x14fd('0x19')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x2a54f8){return logger[_0x14fd('0x19')](_0x14fd('0x28'),'afterCreate',_0x14fd('0x5b'),util[_0x14fd('0x2a')](_0x2a54f8,{'showHidden':![],'depth':null}));});}else{logger[_0x14fd('0x19')](_0x14fd('0x28'),_0x14fd('0x29'),_0x14fd('0x5b'),'Missing\x20parameters:\x20apiKey');}break;case _0x14fd('0x64'):if(_0x2bf5c4[_0x14fd('0x5c')]){var _0x52467e={'method':_0x14fd('0x3f'),'uri':_0x14fd('0x65'),'headers':{'Authorization':_0x2bf5c4[_0x14fd('0x5c')]},'body':{'content':_0x205baf['body'],'to':[_0x205baf[_0x14fd('0x20')]],'from':_0x2bf5c4[_0x14fd('0x20')],'binary':![],'clientMessageId':'uuid','charset':'UTF-8'},'json':!![]};rp(_0x52467e)[_0x14fd('0x26')](function(_0x36244e){if(!_0x36244e[_0x14fd('0x19')]){var _0x1b960e={'messageId':_0x36244e[_0x14fd('0x4e')][0x0][_0x14fd('0x66')]};if(!_0x2bf5c4[_0x14fd('0x39')]){_0x1b960e[_0x14fd('0x3a')]=!![];}return _0x49a610[_0x14fd('0x3b')](_0x1b960e);}else{return logger[_0x14fd('0x19')](_0x14fd('0x28'),_0x14fd('0x29'),_0x14fd('0x64'),util[_0x14fd('0x2a')](_0x36244e[_0x14fd('0x19')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x8ce680){return logger[_0x14fd('0x19')](_0x14fd('0x28'),'afterCreate','clickatell',util[_0x14fd('0x2a')](_0x8ce680,{'showHidden':![],'depth':null}));});}else{logger[_0x14fd('0x19')](_0x14fd('0x28'),_0x14fd('0x29'),_0x14fd('0x64'),_0x14fd('0x67'));}break;case _0x14fd('0x68'):if(_0x2bf5c4[_0x14fd('0x2e')]&&_0x2bf5c4[_0x14fd('0x2f')]){var _0x5b18d6=util[_0x14fd('0x45')](_0x14fd('0x46'),_0x2bf5c4[_0x14fd('0x2e')],_0x2bf5c4[_0x14fd('0x2f')]);var _0x1d176c={'method':_0x14fd('0x3f'),'uri':_0x14fd('0x69')+_0x2bf5c4[_0x14fd('0x6a')]+'/messages','body':{'to':[_0x205baf[_0x14fd('0x20')]],'text':_0x205baf['body'],'from':_0x2bf5c4[_0x14fd('0x20')],'applicationId':_0x2bf5c4[_0x14fd('0x6b')]},'headers':{'Authorization':util['format'](_0x14fd('0x55'),new Buffer(_0x5b18d6)[_0x14fd('0x48')](_0x14fd('0x49')))},'json':!![]};rp(_0x1d176c)[_0x14fd('0x26')](function(_0x5830c1){if(_0x5830c1['id']){var _0xa1ceda={'messageId':_0x5830c1['id']};return _0x49a610[_0x14fd('0x3b')](_0xa1ceda);}else{logger[_0x14fd('0x19')](_0x14fd('0x28'),'afterCreate',_0x14fd('0x68'),util['inspect'](_0x5830c1,{'showHidden':![],'depth':null}));}})['catch'](function(_0x3bee7e){logger[_0x14fd('0x19')](_0x14fd('0x28'),_0x14fd('0x29'),_0x14fd('0x68'),util[_0x14fd('0x2a')](_0x3bee7e,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x14fd('0x28'),_0x14fd('0x29'),'bandwidth','Missing\x20parameters:\x20username,\x20password');}break;case _0x14fd('0x6c'):if(_0x2bf5c4[_0x14fd('0x5c')]){var _0x480af8={};var _0x16777b={'method':_0x14fd('0x3f'),'uri':_0x14fd('0x6d'),'headers':{'Authorization':_0x14fd('0x6e')+_0x2bf5c4[_0x14fd('0x5c')],'Content-Type':_0x14fd('0x6f')},'body':{'from':_0x2bf5c4[_0x14fd('0x20')],'to':_0x205baf[_0x14fd('0x20')],'text':_0x205baf[_0x14fd('0x22')]},'json':!![]};return rp(_0x16777b)['then'](function(_0x117e45){if(_0x117e45[_0x14fd('0x70')]==0xca){_0x480af8[_0x14fd('0x71')]=_0x117e45;var _0x21b422={'method':_0x14fd('0x3f'),'uri':_0x14fd('0x72'),'headers':{'Authorization':_0x14fd('0x6e')+_0x2bf5c4[_0x14fd('0x5c')],'Content-Type':'application/json'},'body':{'refid':_0x480af8['message'][_0x14fd('0x73')]},'json':!![]};return rp(_0x21b422)[_0x14fd('0x26')](function(_0x309d77){_0x480af8[_0x14fd('0x74')]=_0x309d77;var _0x2563a4={'messageId':_0x480af8[_0x14fd('0x71')][_0x14fd('0x73')],'read':!![]};return _0x49a610[_0x14fd('0x3b')](_0x2563a4);});}else{return logger[_0x14fd('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x14fd('0x29'),_0x14fd('0x6c'),util[_0x14fd('0x2a')](_0x117e45,{'showHidden':![],'depth':null}));}})[_0x14fd('0x18')](function(_0x4f1484){return logger[_0x14fd('0x19')](_0x14fd('0x28'),_0x14fd('0x29'),_0x14fd('0x6c'),util[_0x14fd('0x2a')](_0x4f1484,{'showHidden':![],'depth':null}));});}else{return logger[_0x14fd('0x19')](_0x14fd('0x28'),_0x14fd('0x29'),_0x14fd('0x6c'),_0x14fd('0x75'));}break;}}})[_0x14fd('0x76')](function(){_0x48b580();});}else{_0x48b580();}}},'charset':_0x14fd('0x77'),'collate':_0x14fd('0x78')});};
\ No newline at end of file
index 2659cfd..a9204a9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe680=['options','raw','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','./smsMessage.socket','register','then','info','SmsMessage,\x20%s,\x20%s','debug','SmsMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','CreateSmsMessage','body'];(function(_0x327dc3,_0x3e78d2){var _0x599437=function(_0x1fbad5){while(--_0x1fbad5){_0x327dc3['push'](_0x327dc3['shift']());}};_0x599437(++_0x3e78d2);}(_0xe680,0xea));var _0x0e68=function(_0x5489c4,_0x1e7a17){_0x5489c4=_0x5489c4-0x0;var _0x2c4624=_0xe680[_0x5489c4];return _0x2c4624;};'use strict';var _=require(_0x0e68('0x0'));var util=require('util');var moment=require(_0x0e68('0x1'));var BPromise=require(_0x0e68('0x2'));var rs=require(_0x0e68('0x3'));var fs=require('fs');var Redis=require(_0x0e68('0x4'));var db=require(_0x0e68('0x5'))['db'];var utils=require(_0x0e68('0x6'));var logger=require('../../config/logger')(_0x0e68('0x7'));var config=require(_0x0e68('0x8'));var jayson=require(_0x0e68('0x9'));var client=jayson['client'][_0x0e68('0xa')]({'port':0x232a});config['redis']=_[_0x0e68('0xb')](config[_0x0e68('0xc')],{'host':_0x0e68('0xd'),'port':0x18eb});var socket=require(_0x0e68('0xe'))(new Redis(config['redis']));require(_0x0e68('0xf'))[_0x0e68('0x10')](socket);function respondWithRpcPromise(_0x3d25d7,_0x4b29bd,_0xe4e6b4){return new BPromise(function(_0x45ad2c,_0x1c006e){return client['request'](_0x3d25d7,_0xe4e6b4)[_0x0e68('0x11')](function(_0x3f1701){logger[_0x0e68('0x12')](_0x0e68('0x13'),_0x4b29bd,'request\x20sent');logger[_0x0e68('0x14')](_0x0e68('0x15'),_0x4b29bd,_0x0e68('0x16'),JSON[_0x0e68('0x17')](_0x3f1701));if(_0x3f1701[_0x0e68('0x18')]){if(_0x3f1701[_0x0e68('0x18')][_0x0e68('0x19')]===0x1f4){logger[_0x0e68('0x18')]('SmsMessage,\x20%s,\x20%s',_0x4b29bd,_0x3f1701[_0x0e68('0x18')][_0x0e68('0x1a')]);return _0x1c006e(_0x3f1701['error'][_0x0e68('0x1a')]);}logger[_0x0e68('0x18')](_0x0e68('0x13'),_0x4b29bd,_0x3f1701[_0x0e68('0x18')]['message']);return _0x45ad2c(_0x3f1701['error'][_0x0e68('0x1a')]);}else{logger['info']('SmsMessage,\x20%s,\x20%s',_0x4b29bd,_0x0e68('0x16'));_0x45ad2c(_0x3f1701[_0x0e68('0x1b')]['message']);}})['catch'](function(_0x2ac0dd){logger[_0x0e68('0x18')](_0x0e68('0x13'),_0x4b29bd,_0x2ac0dd);_0x1c006e(_0x2ac0dd);});});}exports[_0x0e68('0x1c')]=function(_0x3548c0){var _0x4074eb=this;return new Promise(function(_0x250079,_0x587d9f){return db['SmsMessage']['create'](_0x3548c0[_0x0e68('0x1d')],{'raw':_0x3548c0['options']?_0x3548c0[_0x0e68('0x1e')][_0x0e68('0x1f')]===undefined?!![]:![]:!![]})[_0x0e68('0x11')](function(_0x4d0d5a){logger['info'](_0x0e68('0x1c'),_0x3548c0);logger[_0x0e68('0x14')](_0x0e68('0x1c'),_0x3548c0,JSON[_0x0e68('0x17')](_0x4d0d5a));_0x250079(_0x4d0d5a);})[_0x0e68('0x20')](function(_0x3deb8c){logger[_0x0e68('0x18')](_0x0e68('0x1c'),_0x3deb8c['message'],_0x3548c0);_0x587d9f(_0x4074eb[_0x0e68('0x18')](0x1f4,_0x3deb8c[_0x0e68('0x1a')]));});});};
\ No newline at end of file
+var _0x731b=['debug','SmsMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','SmsMessage,\x20%s,\x20%s','message','result','catch','CreateSmsMessage','SmsMessage','create','body','options','then','stringify','util','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','redis','socket.io-emitter','./smsMessage.socket','register','info'];(function(_0x1f644d,_0x348a35){var _0x1a6315=function(_0x1e4a14){while(--_0x1e4a14){_0x1f644d['push'](_0x1f644d['shift']());}};_0x1a6315(++_0x348a35);}(_0x731b,0xb7));var _0xb731=function(_0x430d51,_0x39d7f6){_0x430d51=_0x430d51-0x0;var _0x193d79=_0x731b[_0x430d51];return _0x193d79;};'use strict';var _=require('lodash');var util=require(_0xb731('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb731('0x1'));var fs=require('fs');var Redis=require(_0xb731('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xb731('0x3'));var logger=require(_0xb731('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0xb731('0x5'));var client=jayson[_0xb731('0x6')][_0xb731('0x7')]({'port':0x232a});config[_0xb731('0x8')]=_['defaults'](config[_0xb731('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0xb731('0x9'))(new Redis(config[_0xb731('0x8')]));require(_0xb731('0xa'))[_0xb731('0xb')](socket);function respondWithRpcPromise(_0xe7f691,_0x286064,_0x3cc756){return new BPromise(function(_0x1e9bec,_0x4cb541){return client['request'](_0xe7f691,_0x3cc756)['then'](function(_0x3d4f7a){logger[_0xb731('0xc')]('SmsMessage,\x20%s,\x20%s',_0x286064,'request\x20sent');logger[_0xb731('0xd')](_0xb731('0xe'),_0x286064,_0xb731('0xf'),JSON['stringify'](_0x3d4f7a));if(_0x3d4f7a[_0xb731('0x10')]){if(_0x3d4f7a[_0xb731('0x10')]['code']===0x1f4){logger['error'](_0xb731('0x11'),_0x286064,_0x3d4f7a[_0xb731('0x10')][_0xb731('0x12')]);return _0x4cb541(_0x3d4f7a[_0xb731('0x10')][_0xb731('0x12')]);}logger[_0xb731('0x10')](_0xb731('0x11'),_0x286064,_0x3d4f7a[_0xb731('0x10')][_0xb731('0x12')]);return _0x1e9bec(_0x3d4f7a[_0xb731('0x10')][_0xb731('0x12')]);}else{logger['info'](_0xb731('0x11'),_0x286064,_0xb731('0xf'));_0x1e9bec(_0x3d4f7a[_0xb731('0x13')][_0xb731('0x12')]);}})[_0xb731('0x14')](function(_0x1f0887){logger['error'](_0xb731('0x11'),_0x286064,_0x1f0887);_0x4cb541(_0x1f0887);});});}exports[_0xb731('0x15')]=function(_0x300e48){var _0x3e3d21=this;return new Promise(function(_0xce3487,_0x13abd2){return db[_0xb731('0x16')][_0xb731('0x17')](_0x300e48[_0xb731('0x18')],{'raw':_0x300e48[_0xb731('0x19')]?_0x300e48[_0xb731('0x19')]['raw']===undefined?!![]:![]:!![]})[_0xb731('0x1a')](function(_0x217cc5){logger[_0xb731('0xc')]('CreateSmsMessage',_0x300e48);logger[_0xb731('0xd')]('CreateSmsMessage',_0x300e48,JSON[_0xb731('0x1b')](_0x217cc5));_0xce3487(_0x217cc5);})['catch'](function(_0xad7231){logger[_0xb731('0x10')](_0xb731('0x15'),_0xad7231['message'],_0x300e48);_0x13abd2(_0x3e3d21[_0xb731('0x10')](0x1f4,_0xad7231[_0xb731('0x12')]));});});};
\ No newline at end of file
index f587204..7f990d2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4799=['./smsMessage.events','save','remove','update','removeListener','register','smsMessage:'];(function(_0x2a1dd1,_0x3794df){var _0x132c45=function(_0x42b666){while(--_0x42b666){_0x2a1dd1['push'](_0x2a1dd1['shift']());}};_0x132c45(++_0x3794df);}(_0x4799,0x126));var _0x9479=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x4799[_0x321bb2];return _0x9c12ed;};'use strict';var SmsMessageEvents=require(_0x9479('0x0'));var events=[_0x9479('0x1'),_0x9479('0x2'),_0x9479('0x3')];function createListener(_0x546a5b,_0x11487e){return function(_0x21da47){_0x11487e['emit'](_0x546a5b,_0x21da47);};}function removeListener(_0x754d1c,_0x75a690){return function(){SmsMessageEvents[_0x9479('0x4')](_0x754d1c,_0x75a690);};}exports[_0x9479('0x5')]=function(_0x404e4b){for(var _0x127ad0=0x0,_0x5331a8=events['length'];_0x127ad0<_0x5331a8;_0x127ad0++){var _0x5affb3=events[_0x127ad0];var _0x116611=createListener(_0x9479('0x6')+_0x5affb3,_0x404e4b);SmsMessageEvents['on'](_0x5affb3,_0x116611);}};
\ No newline at end of file
+var _0xd49f=['./smsMessage.events','remove','update','emit','register','length','smsMessage:'];(function(_0xdeccbe,_0x44f608){var _0x43fafd=function(_0x58b227){while(--_0x58b227){_0xdeccbe['push'](_0xdeccbe['shift']());}};_0x43fafd(++_0x44f608);}(_0xd49f,0x8c));var _0xfd49=function(_0x30c48d,_0x25e828){_0x30c48d=_0x30c48d-0x0;var _0x2c64aa=_0xd49f[_0x30c48d];return _0x2c64aa;};'use strict';var SmsMessageEvents=require(_0xfd49('0x0'));var events=['save',_0xfd49('0x1'),_0xfd49('0x2')];function createListener(_0x1a2253,_0x5d9d97){return function(_0x41c31d){_0x5d9d97[_0xfd49('0x3')](_0x1a2253,_0x41c31d);};}function removeListener(_0x1004d0,_0x695171){return function(){SmsMessageEvents['removeListener'](_0x1004d0,_0x695171);};}exports[_0xfd49('0x4')]=function(_0x237df1){for(var _0x26b0eb=0x0,_0xf6a01c=events[_0xfd49('0x5')];_0x26b0eb<_0xf6a01c;_0x26b0eb++){var _0x578103=events[_0x26b0eb];var _0x5cf2b4=createListener(_0xfd49('0x6')+_0x578103,_0x237df1);SmsMessageEvents['on'](_0x578103,_0x5cf2b4);}};
\ No newline at end of file
index 2f9b70b..7c2c3da 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9a02=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','getAgents','post','create','addAgents','put','delete','removeTeams','/:id/users','removeAgents','multer','util','connect-timeout'];(function(_0x73ba1f,_0x588ccb){var _0x2e2725=function(_0x145578){while(--_0x145578){_0x73ba1f['push'](_0x73ba1f['shift']());}};_0x2e2725(++_0x588ccb);}(_0x9a02,0x19d));var _0x29a0=function(_0x127fa0,_0xd4ba74){_0x127fa0=_0x127fa0-0x0;var _0x4fe232=_0x9a02[_0x127fa0];return _0x4fe232;};'use strict';var multer=require(_0x29a0('0x0'));var util=require(_0x29a0('0x1'));var path=require('path');var timeout=require(_0x29a0('0x2'));var express=require('express');var router=express[_0x29a0('0x3')]();var fs_extra=require(_0x29a0('0x4'));var auth=require(_0x29a0('0x5'));var interaction=require(_0x29a0('0x6'));var config=require(_0x29a0('0x7'));var controller=require('./smsQueue.controller');router['get']('/',auth[_0x29a0('0x8')](),controller[_0x29a0('0x9')]);router[_0x29a0('0xa')]('/describe',auth['isAuthenticated'](),controller['describe']);router['get'](_0x29a0('0xb'),auth[_0x29a0('0x8')](),controller[_0x29a0('0xc')]);router[_0x29a0('0xa')](_0x29a0('0xd'),auth[_0x29a0('0x8')](),controller[_0x29a0('0xe')]);router[_0x29a0('0xa')](_0x29a0('0xf'),auth[_0x29a0('0x8')](),controller[_0x29a0('0x10')]);router[_0x29a0('0xa')]('/:id/users',auth[_0x29a0('0x8')](),controller[_0x29a0('0x11')]);router[_0x29a0('0x12')]('/',auth['isAuthenticated'](),controller[_0x29a0('0x13')]);router[_0x29a0('0x12')]('/:id/teams',auth[_0x29a0('0x8')](),controller['addTeams']);router[_0x29a0('0x12')]('/:id/users',auth[_0x29a0('0x8')](),controller[_0x29a0('0x14')]);router[_0x29a0('0x15')](_0x29a0('0xb'),auth[_0x29a0('0x8')](),controller['update']);router[_0x29a0('0x16')](_0x29a0('0xb'),auth['isAuthenticated'](),controller['destroy']);router[_0x29a0('0x16')](_0x29a0('0xf'),auth[_0x29a0('0x8')](),controller[_0x29a0('0x17')]);router[_0x29a0('0x16')](_0x29a0('0x18'),auth[_0x29a0('0x8')](),controller[_0x29a0('0x19')]);module['exports']=router;
\ No newline at end of file
+var _0x669e=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueue.controller','get','isAuthenticated','index','/describe','describe','/:id/members','getMembers','/:id/teams','getTeams','post','create','addTeams','/:id/users','addAgents','put','update','destroy','delete','removeTeams','removeAgents','exports','multer','connect-timeout','Router'];(function(_0x214621,_0x2dfad1){var _0x2a9d70=function(_0x1c46cf){while(--_0x1c46cf){_0x214621['push'](_0x214621['shift']());}};_0x2a9d70(++_0x2dfad1);}(_0x669e,0x13c));var _0xe669=function(_0x4016f5,_0x2c286a){_0x4016f5=_0x4016f5-0x0;var _0x357185=_0x669e[_0x4016f5];return _0x357185;};'use strict';var multer=require(_0xe669('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xe669('0x1'));var express=require('express');var router=express[_0xe669('0x2')]();var fs_extra=require(_0xe669('0x3'));var auth=require(_0xe669('0x4'));var interaction=require(_0xe669('0x5'));var config=require(_0xe669('0x6'));var controller=require(_0xe669('0x7'));router[_0xe669('0x8')]('/',auth[_0xe669('0x9')](),controller[_0xe669('0xa')]);router[_0xe669('0x8')](_0xe669('0xb'),auth[_0xe669('0x9')](),controller[_0xe669('0xc')]);router[_0xe669('0x8')]('/:id',auth[_0xe669('0x9')](),controller['show']);router[_0xe669('0x8')](_0xe669('0xd'),auth[_0xe669('0x9')](),controller[_0xe669('0xe')]);router[_0xe669('0x8')](_0xe669('0xf'),auth['isAuthenticated'](),controller[_0xe669('0x10')]);router['get']('/:id/users',auth[_0xe669('0x9')](),controller['getAgents']);router[_0xe669('0x11')]('/',auth[_0xe669('0x9')](),controller[_0xe669('0x12')]);router[_0xe669('0x11')](_0xe669('0xf'),auth[_0xe669('0x9')](),controller[_0xe669('0x13')]);router['post'](_0xe669('0x14'),auth['isAuthenticated'](),controller[_0xe669('0x15')]);router[_0xe669('0x16')]('/:id',auth[_0xe669('0x9')](),controller[_0xe669('0x17')]);router['delete']('/:id',auth[_0xe669('0x9')](),controller[_0xe669('0x18')]);router[_0xe669('0x19')](_0xe669('0xf'),auth['isAuthenticated'](),controller[_0xe669('0x1a')]);router[_0xe669('0x19')](_0xe669('0x14'),auth[_0xe669('0x9')](),controller[_0xe669('0x1b')]);module[_0xe669('0x1c')]=router;
\ No newline at end of file
index 7f6377d..14d2545 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf5da=['STRING','name','INTEGER','ENUM','rrmemory','beepall','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf5da,0x68));var _0xaf5d=function(_0x4d35f3,_0x19ba66){_0x4d35f3=_0x4d35f3-0x0;var _0x382fea=_0xf5da[_0x4d35f3];return _0x382fea;};'use strict';var Sequelize=require('sequelize');module[_0xaf5d('0x0')]={'name':{'type':Sequelize[_0xaf5d('0x1')],'unique':_0xaf5d('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xaf5d('0x1')]},'timeout':{'type':Sequelize[_0xaf5d('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xaf5d('0x4')](_0xaf5d('0x5'),_0xaf5d('0x6'),'roundrobin')}};
\ No newline at end of file
+var _0xf0dd=['INTEGER','ENUM','rrmemory','roundrobin','sequelize','exports','STRING','name'];(function(_0x13342f,_0x3d6303){var _0x2fc1fc=function(_0x2d991f){while(--_0x2d991f){_0x13342f['push'](_0x13342f['shift']());}};_0x2fc1fc(++_0x3d6303);}(_0xf0dd,0x184));var _0xdf0d=function(_0x5d1305,_0x316ad2){_0x5d1305=_0x5d1305-0x0;var _0x3368aa=_0xf0dd[_0x5d1305];return _0x3368aa;};'use strict';var Sequelize=require(_0xdf0d('0x0'));module[_0xdf0d('0x1')]={'name':{'type':Sequelize[_0xdf0d('0x2')],'unique':_0xdf0d('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xdf0d('0x2')]},'timeout':{'type':Sequelize[_0xdf0d('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xdf0d('0x5')](_0xdf0d('0x6'),'beepall',_0xdf0d('0x7'))}};
\ No newline at end of file
index 4d64918..4a61171 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf169=['save','update','then','SmsQueues','UserProfileResource','destroy','stack','name','index','SmsQueue','rawAttributes','fieldName','type','key','map','query','keys','filters','fields','attributes','length','model','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','findAll','rows','catch','show','params','intersection','includeAll','include','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserSmsQueue','SmsQueueId','findAndCountAll','UserId','agent','smsPause','updatedAt','createdAt','format','%s/%s','SIP','Team','getTeams','addTeams','ids','User','Agents','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','userSmsQueue:save','removeTeams','field','tq.TeamId','from','team_has_sms_queues','join','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','includes','all','compact','value','isEmpty','removeAgents','userSmsQueue:remove','addAgents','omit','spread','getAgents','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./smsQueue.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range'];(function(_0x2bfa9b,_0x37452f){var _0x5ea3e1=function(_0x102741){while(--_0x102741){_0x2bfa9b['push'](_0x2bfa9b['shift']());}};_0x5ea3e1(++_0x37452f);}(_0xf169,0x192));var _0x9f16=function(_0x32dbdb,_0x426ed9){_0x32dbdb=_0x32dbdb-0x0;var _0x1c7dd1=_0xf169[_0x32dbdb];return _0x1c7dd1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9f16('0x0'));var zipdir=require(_0x9f16('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9f16('0x2'));var moment=require(_0x9f16('0x3'));var BPromise=require(_0x9f16('0x4'));var Mustache=require(_0x9f16('0x5'));var util=require(_0x9f16('0x6'));var path=require(_0x9f16('0x7'));var sox=require(_0x9f16('0x8'));var csv=require(_0x9f16('0x9'));var ejs=require(_0x9f16('0xa'));var fs=require('fs');var fs_extra=require(_0x9f16('0xb'));var _=require('lodash');var squel=require(_0x9f16('0xc'));var crypto=require(_0x9f16('0xd'));var jsforce=require(_0x9f16('0xe'));var deskjs=require(_0x9f16('0xf'));var toCsv=require('to-csv');var querystring=require(_0x9f16('0x10'));var Papa=require(_0x9f16('0x11'));var Redis=require(_0x9f16('0x12'));var authService=require(_0x9f16('0x13'));var qs=require(_0x9f16('0x14'));var as=require(_0x9f16('0x15'));var hardwareService=require(_0x9f16('0x16'));var logger=require('../../config/logger')(_0x9f16('0x17'));var utils=require('../../config/utils');var config=require(_0x9f16('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x9f16('0x19'))['db'];config['redis']=_[_0x9f16('0x1a')](config[_0x9f16('0x1b')],{'host':_0x9f16('0x1c'),'port':0x18eb});var socket=require(_0x9f16('0x1d'))(new Redis(config[_0x9f16('0x1b')]));require(_0x9f16('0x1e'))[_0x9f16('0x1f')](socket);function respondWithStatusCode(_0x5c3a42,_0x29beb2){_0x29beb2=_0x29beb2||0xcc;return function(_0x55df1f){if(_0x55df1f){return _0x5c3a42[_0x9f16('0x20')](_0x29beb2);}return _0x5c3a42[_0x9f16('0x21')](_0x29beb2)[_0x9f16('0x22')]();};}function respondWithResult(_0x59b915,_0xf36a1){_0xf36a1=_0xf36a1||0xc8;return function(_0x11d5e3){if(_0x11d5e3){return _0x59b915[_0x9f16('0x21')](_0xf36a1)[_0x9f16('0x23')](_0x11d5e3);}};}function respondWithFilteredResult(_0xda637d,_0x2c6b7e){return function(_0x12cdfb){if(_0x12cdfb){var _0x4349a2=typeof _0x2c6b7e[_0x9f16('0x24')]==='undefined'&&typeof _0x2c6b7e['limit']===_0x9f16('0x25');var _0x6ba7dd=_0x12cdfb[_0x9f16('0x26')];var _0x1e5be9=_0x4349a2?0x0:_0x2c6b7e[_0x9f16('0x24')];var _0x24be35=_0x4349a2?_0x12cdfb[_0x9f16('0x26')]:_0x2c6b7e[_0x9f16('0x24')]+_0x2c6b7e[_0x9f16('0x27')];var _0x2b204c;if(_0x24be35>=_0x6ba7dd){_0x24be35=_0x6ba7dd;_0x2b204c=0xc8;}else{_0x2b204c=0xce;}_0xda637d[_0x9f16('0x21')](_0x2b204c);return _0xda637d[_0x9f16('0x28')](_0x9f16('0x29'),_0x1e5be9+'-'+_0x24be35+'/'+_0x6ba7dd)[_0x9f16('0x23')](_0x12cdfb);}return null;};}function patchUpdates(_0x4f2bb9){return function(_0x5d91b6){try{jsonpatch['apply'](_0x5d91b6,_0x4f2bb9,!![]);}catch(_0x3583c2){return BPromise['reject'](_0x3583c2);}return _0x5d91b6[_0x9f16('0x2a')]();};}function saveUpdates(_0x5e4dd8,_0x529e61){return function(_0x3c747e){if(_0x3c747e){return _0x3c747e[_0x9f16('0x2b')](_0x5e4dd8)[_0x9f16('0x2c')](function(_0x506301){return _0x506301;});}return null;};}function removeEntity(_0x1e851a,_0x234bcc){return function(_0x318188){if(_0x318188){return _0x318188['destroy']()[_0x9f16('0x2c')](function(){var _0x532646=_0x318188['get']({'plain':!![]});var _0x124b88=_0x9f16('0x2d');return db[_0x9f16('0x2e')][_0x9f16('0x2f')]({'where':{'type':_0x124b88,'resourceId':_0x532646['id']}})[_0x9f16('0x2c')](function(){return _0x318188;});})[_0x9f16('0x2c')](function(){_0x1e851a['status'](0xcc)[_0x9f16('0x22')]();});}};}function handleEntityNotFound(_0x53101e,_0x1fb70f){return function(_0x436934){if(!_0x436934){_0x53101e['sendStatus'](0x194);}return _0x436934;};}function handleError(_0x9cedbf,_0xe0eebd){_0xe0eebd=_0xe0eebd||0x1f4;return function(_0xbb7f7e){logger['error'](_0xbb7f7e[_0x9f16('0x30')]);if(_0xbb7f7e[_0x9f16('0x31')]){delete _0xbb7f7e['name'];}_0x9cedbf[_0x9f16('0x21')](_0xe0eebd)['send'](_0xbb7f7e);};}exports[_0x9f16('0x32')]=function(_0xafeb89,_0x1d2b08){var _0x1dc5b7={},_0x58c0ea={},_0x87b18f={'count':0x0,'rows':[]};var _0xd46c0b=_['map'](db[_0x9f16('0x33')][_0x9f16('0x34')],function(_0x71aa18){return{'name':_0x71aa18[_0x9f16('0x35')],'type':_0x71aa18[_0x9f16('0x36')][_0x9f16('0x37')]};});_0x58c0ea['model']=_[_0x9f16('0x38')](_0xd46c0b,_0x9f16('0x31'));_0x58c0ea[_0x9f16('0x39')]=_[_0x9f16('0x3a')](_0xafeb89[_0x9f16('0x39')]);_0x58c0ea[_0x9f16('0x3b')]=_['intersection'](_0x58c0ea['model'],_0x58c0ea[_0x9f16('0x39')]);_0x1dc5b7['attributes']=_['intersection'](_0x58c0ea['model'],qs['fields'](_0xafeb89['query'][_0x9f16('0x3c')]));_0x1dc5b7[_0x9f16('0x3d')]=_0x1dc5b7[_0x9f16('0x3d')][_0x9f16('0x3e')]?_0x1dc5b7['attributes']:_0x58c0ea[_0x9f16('0x3f')];if(!_0xafeb89[_0x9f16('0x39')][_0x9f16('0x40')](_0x9f16('0x41'))){_0x1dc5b7[_0x9f16('0x27')]=qs[_0x9f16('0x27')](_0xafeb89['query']['limit']);_0x1dc5b7[_0x9f16('0x24')]=qs[_0x9f16('0x24')](_0xafeb89[_0x9f16('0x39')][_0x9f16('0x24')]);}_0x1dc5b7[_0x9f16('0x42')]=qs[_0x9f16('0x43')](_0xafeb89['query'][_0x9f16('0x43')]);_0x1dc5b7[_0x9f16('0x44')]=qs['filters'](_[_0x9f16('0x45')](_0xafeb89[_0x9f16('0x39')],_0x58c0ea[_0x9f16('0x3b')]),_0xd46c0b);if(_0xafeb89['query'][_0x9f16('0x46')]){_0x1dc5b7['where']=_['merge'](_0x1dc5b7['where'],{'$or':_[_0x9f16('0x38')](_0xd46c0b,function(_0x3d1f53){if(_0x3d1f53['type']!==_0x9f16('0x47')){var _0x377e48={};_0x377e48[_0x3d1f53['name']]={'$like':'%'+_0xafeb89[_0x9f16('0x39')][_0x9f16('0x46')]+'%'};return _0x377e48;}})});}_0x1dc5b7=_[_0x9f16('0x48')]({},_0x1dc5b7,_0xafeb89[_0x9f16('0x49')]);var _0x15e0ad={'where':_0x1dc5b7[_0x9f16('0x44')]};return db[_0x9f16('0x33')][_0x9f16('0x26')](_0x15e0ad)['then'](function(_0x44d5d1){_0x87b18f[_0x9f16('0x26')]=_0x44d5d1;if(_0xafeb89['query']['includeAll']){_0x1dc5b7['include']=[{'all':!![]}];}return db[_0x9f16('0x33')][_0x9f16('0x4a')](_0x1dc5b7);})[_0x9f16('0x2c')](function(_0x3bde74){_0x87b18f[_0x9f16('0x4b')]=_0x3bde74;return _0x87b18f;})[_0x9f16('0x2c')](respondWithFilteredResult(_0x1d2b08,_0x1dc5b7))[_0x9f16('0x4c')](handleError(_0x1d2b08,null));};exports[_0x9f16('0x4d')]=function(_0x53d2bd,_0x2ecea9){var _0x51fc6a={'raw':!![],'where':{'id':_0x53d2bd[_0x9f16('0x4e')]['id']}},_0x5c6ed5={};_0x5c6ed5['model']=_[_0x9f16('0x3a')](db[_0x9f16('0x33')][_0x9f16('0x34')]);_0x5c6ed5[_0x9f16('0x39')]=_[_0x9f16('0x3a')](_0x53d2bd[_0x9f16('0x39')]);_0x5c6ed5[_0x9f16('0x3b')]=_['intersection'](_0x5c6ed5['model'],_0x5c6ed5[_0x9f16('0x39')]);_0x51fc6a[_0x9f16('0x3d')]=_[_0x9f16('0x4f')](_0x5c6ed5['model'],qs[_0x9f16('0x3c')](_0x53d2bd[_0x9f16('0x39')][_0x9f16('0x3c')]));_0x51fc6a[_0x9f16('0x3d')]=_0x51fc6a['attributes'][_0x9f16('0x3e')]?_0x51fc6a[_0x9f16('0x3d')]:_0x5c6ed5[_0x9f16('0x3f')];if(_0x53d2bd[_0x9f16('0x39')][_0x9f16('0x50')]){_0x51fc6a[_0x9f16('0x51')]=[{'all':!![]}];}_0x51fc6a=_[_0x9f16('0x48')]({},_0x51fc6a,_0x53d2bd[_0x9f16('0x49')]);return db['SmsQueue']['find'](_0x51fc6a)[_0x9f16('0x2c')](handleEntityNotFound(_0x2ecea9,null))[_0x9f16('0x2c')](respondWithResult(_0x2ecea9,null))[_0x9f16('0x4c')](handleError(_0x2ecea9,null));};exports['create']=function(_0x8f51ac,_0x4dd370){return db['SmsQueue'][_0x9f16('0x52')](_0x8f51ac[_0x9f16('0x53')],{})[_0x9f16('0x2c')](function(_0x109d6d){var _0x15c352=_0x8f51ac['user'][_0x9f16('0x54')]({'plain':!![]});if(!_0x15c352)throw new Error(_0x9f16('0x55'));if(_0x15c352[_0x9f16('0x56')]===_0x9f16('0x57')){var _0x373a33=_0x109d6d[_0x9f16('0x54')]({'plain':!![]});var _0x7e19eb=_0x9f16('0x2d');return db[_0x9f16('0x58')][_0x9f16('0x59')]({'where':{'name':_0x7e19eb,'userProfileId':_0x15c352['userProfileId']},'raw':!![]})['then'](function(_0x148adc){if(_0x148adc&&_0x148adc[_0x9f16('0x5a')]===0x0){return db[_0x9f16('0x2e')][_0x9f16('0x52')]({'name':_0x373a33['name'],'resourceId':_0x373a33['id'],'type':_0x148adc['name'],'sectionId':_0x148adc['id']},{})[_0x9f16('0x2c')](function(){return _0x109d6d;});}else{return _0x109d6d;}})[_0x9f16('0x4c')](function(_0x28e116){logger[_0x9f16('0x5b')](_0x9f16('0x5c'),_0x28e116);throw _0x28e116;});}return _0x109d6d;})[_0x9f16('0x2c')](respondWithResult(_0x4dd370,0xc9))['catch'](handleError(_0x4dd370,null));};exports[_0x9f16('0x2b')]=function(_0x167e4b,_0x3673c4){if(_0x167e4b['body']['id']){delete _0x167e4b[_0x9f16('0x53')]['id'];}return db[_0x9f16('0x33')][_0x9f16('0x59')]({'where':{'id':_0x167e4b[_0x9f16('0x4e')]['id']}})[_0x9f16('0x2c')](handleEntityNotFound(_0x3673c4,null))[_0x9f16('0x2c')](saveUpdates(_0x167e4b[_0x9f16('0x53')],null))[_0x9f16('0x2c')](respondWithResult(_0x3673c4,null))[_0x9f16('0x4c')](handleError(_0x3673c4,null));};exports[_0x9f16('0x2f')]=function(_0x161370,_0x36734e){return db[_0x9f16('0x33')][_0x9f16('0x59')]({'where':{'id':_0x161370[_0x9f16('0x4e')]['id']}})[_0x9f16('0x2c')](handleEntityNotFound(_0x36734e,null))[_0x9f16('0x2c')](removeEntity(_0x36734e,null))[_0x9f16('0x4c')](handleError(_0x36734e,null));};exports[_0x9f16('0x5d')]=function(_0x33008c,_0x1faa7c){return db[_0x9f16('0x33')][_0x9f16('0x5d')]()[_0x9f16('0x2c')](respondWithResult(_0x1faa7c,null))['catch'](handleError(_0x1faa7c,null));};exports[_0x9f16('0x5e')]=function(_0x35974f,_0x74c99a,_0x481a61){var _0x1a985a={'raw':!![],'where':{}},_0x35a7e6={},_0xd5a33c;return db[_0x9f16('0x33')][_0x9f16('0x5f')]({'where':{'id':_0x35974f['params']['id']}})[_0x9f16('0x2c')](handleEntityNotFound(_0x74c99a,null))[_0x9f16('0x2c')](function(_0x161141){if(_0x161141){_0xd5a33c=_0x161141[_0x9f16('0x54')]({'plain':!![]});_0x35a7e6['model']=_[_0x9f16('0x3a')](db[_0x9f16('0x60')][_0x9f16('0x34')]);_0x35a7e6[_0x9f16('0x39')]=_['keys'](_0x35974f[_0x9f16('0x39')]);_0x35a7e6[_0x9f16('0x3b')]=_[_0x9f16('0x4f')](_0x35a7e6['model'],_0x35a7e6[_0x9f16('0x39')]);_0x1a985a[_0x9f16('0x3d')]=_['intersection'](_0x35a7e6[_0x9f16('0x3f')],qs['fields'](_0x35974f[_0x9f16('0x39')][_0x9f16('0x3c')]));_0x1a985a[_0x9f16('0x3d')]=_0x1a985a[_0x9f16('0x3d')][_0x9f16('0x3e')]?_0x1a985a[_0x9f16('0x3d')]:_0x35a7e6['model'];if(!_0x35974f[_0x9f16('0x39')][_0x9f16('0x40')](_0x9f16('0x41'))){_0x1a985a[_0x9f16('0x27')]=qs[_0x9f16('0x27')](_0x35974f[_0x9f16('0x39')][_0x9f16('0x27')]);_0x1a985a['offset']=qs[_0x9f16('0x24')](_0x35974f[_0x9f16('0x39')]['offset']);}_0x1a985a['order']=qs['sort'](_0x35974f[_0x9f16('0x39')][_0x9f16('0x43')]);_0x1a985a[_0x9f16('0x44')]=qs[_0x9f16('0x3b')](_[_0x9f16('0x45')](_0x35974f[_0x9f16('0x39')],_0x35a7e6[_0x9f16('0x3b')]));_0x1a985a[_0x9f16('0x44')][_0x9f16('0x61')]=_0x161141['id'];if(_0x35974f[_0x9f16('0x39')][_0x9f16('0x46')]){_0x1a985a[_0x9f16('0x44')]=_[_0x9f16('0x48')](_0x1a985a[_0x9f16('0x44')],{'$or':_['map'](_0x1a985a[_0x9f16('0x3d')],function(_0x19d75e){var _0x18f0aa={};_0x18f0aa[_0x19d75e]={'$like':'%'+_0x35974f[_0x9f16('0x39')]['filter']+'%'};return _0x18f0aa;})});}_0x1a985a=_[_0x9f16('0x48')]({},_0x1a985a,_0x35974f[_0x9f16('0x49')]);return db[_0x9f16('0x60')][_0x9f16('0x4a')](_0x1a985a);}})[_0x9f16('0x2c')](function(_0x53535e){if(_0x53535e){return db['User'][_0x9f16('0x62')]({'where':{'id':_['map'](_0x53535e,_0x9f16('0x63')),'role':_0x9f16('0x64')},'attributes':['id','name',_0x9f16('0x65'),_0x9f16('0x66'),_0x9f16('0x67')]});}})[_0x9f16('0x2c')](function(_0x527ad9){if(_0x527ad9){return{'count':_0x527ad9[_0x9f16('0x26')],'rows':_[_0x9f16('0x38')](_0x527ad9[_0x9f16('0x4b')],function(_0x1d3850){return{'membername':_0x1d3850[_0x9f16('0x31')],'UserId':_0x1d3850['id'],'queue_name':_0xd5a33c[_0x9f16('0x31')],'SmsQueueId':_0xd5a33c['id'],'interface':util[_0x9f16('0x68')](_0x9f16('0x69'),_0x9f16('0x6a'),_0x1d3850[_0x9f16('0x31')]),'penalty':0x0,'paused':_0x1d3850[_0x9f16('0x65')],'createdAt':_0x1d3850[_0x9f16('0x67')],'updatedAt':_0x1d3850[_0x9f16('0x66')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x74c99a,_0x1a985a))[_0x9f16('0x4c')](handleError(_0x74c99a,null));};exports['getTeams']=function(_0x4eae89,_0x24a667,_0x469955){var _0x28c7ce={};var _0x419481={};var _0x1fcb32;var _0x350e5c;return db[_0x9f16('0x33')]['findOne']({'where':{'id':_0x4eae89[_0x9f16('0x4e')]['id']}})[_0x9f16('0x2c')](handleEntityNotFound(_0x24a667,null))['then'](function(_0x31369e){if(_0x31369e){_0x1fcb32=_0x31369e;_0x419481[_0x9f16('0x3f')]=_[_0x9f16('0x3a')](db[_0x9f16('0x6b')][_0x9f16('0x34')]);_0x419481[_0x9f16('0x39')]=_[_0x9f16('0x3a')](_0x4eae89[_0x9f16('0x39')]);_0x419481[_0x9f16('0x3b')]=_[_0x9f16('0x4f')](_0x419481[_0x9f16('0x3f')],_0x419481[_0x9f16('0x39')]);_0x28c7ce[_0x9f16('0x3d')]=_[_0x9f16('0x4f')](_0x419481[_0x9f16('0x3f')],qs['fields'](_0x4eae89[_0x9f16('0x39')][_0x9f16('0x3c')]));_0x28c7ce[_0x9f16('0x3d')]=_0x28c7ce[_0x9f16('0x3d')]['length']?_0x28c7ce['attributes']:_0x419481['model'];_0x28c7ce['order']=qs['sort'](_0x4eae89[_0x9f16('0x39')]['sort']);_0x28c7ce[_0x9f16('0x44')]=qs['filters'](_[_0x9f16('0x45')](_0x4eae89['query'],_0x419481[_0x9f16('0x3b')]));if(_0x4eae89[_0x9f16('0x39')][_0x9f16('0x46')]){_0x28c7ce[_0x9f16('0x44')]=_[_0x9f16('0x48')](_0x28c7ce[_0x9f16('0x44')],{'$or':_['map'](_0x28c7ce[_0x9f16('0x3d')],function(_0x9707d6){var _0x44575e={};_0x44575e[_0x9707d6]={'$like':'%'+_0x4eae89['query'][_0x9f16('0x46')]+'%'};return _0x44575e;})});}_0x28c7ce=_[_0x9f16('0x48')]({},_0x28c7ce,_0x4eae89[_0x9f16('0x49')]);return _0x1fcb32[_0x9f16('0x6c')](_0x28c7ce);}})[_0x9f16('0x2c')](function(_0x23b202){if(_0x23b202){_0x350e5c=_0x23b202[_0x9f16('0x3e')];if(!_0x4eae89[_0x9f16('0x39')][_0x9f16('0x40')]('nolimit')){_0x28c7ce[_0x9f16('0x27')]=qs[_0x9f16('0x27')](_0x4eae89[_0x9f16('0x39')][_0x9f16('0x27')]);_0x28c7ce[_0x9f16('0x24')]=qs[_0x9f16('0x24')](_0x4eae89[_0x9f16('0x39')][_0x9f16('0x24')]);}return _0x1fcb32['getTeams'](_0x28c7ce);}})[_0x9f16('0x2c')](function(_0x27ac86){if(_0x27ac86){return _0x27ac86?{'count':_0x350e5c,'rows':_0x27ac86}:null;}})[_0x9f16('0x2c')](respondWithResult(_0x24a667,null))['catch'](handleError(_0x24a667,null));};exports[_0x9f16('0x6d')]=function(_0x12bf0a,_0x521e59,_0x157e7a){var _0x286839=_0x12bf0a[_0x9f16('0x53')][_0x9f16('0x6e')];return db[_0x9f16('0x6b')][_0x9f16('0x4a')]({'where':{'id':_0x286839},'attributes':['id'],'include':[{'model':db[_0x9f16('0x6f')],'as':_0x9f16('0x70'),'attributes':['id',_0x9f16('0x31'),'online',_0x9f16('0x71'),_0x9f16('0x72')],'raw':!![]}]})['then'](function(_0x55db9b){if(_0x55db9b){var _0x13c495=_[_0x9f16('0x73')](_0x55db9b,function(_0x36d05f){var _0x12bfa8=_0x36d05f[_0x9f16('0x54')]({'plain':!![]});return _0x12bfa8['Agents'];});return db[_0x9f16('0x33')]['find']({'where':{'id':_0x12bf0a[_0x9f16('0x4e')]['id']}})['then'](function(_0x314d9c){return db[_0x9f16('0x74')][_0x9f16('0x75')](function(_0x5a377e){return _0x314d9c[_0x9f16('0x6d')](_0x286839,{'transaction':_0x5a377e})[_0x9f16('0x2c')](function(){return BPromise[_0x9f16('0x76')](_0x13c495,function(_0x1c05cf){return db['UserSmsQueue'][_0x9f16('0x77')]({'where':{'UserId':_0x1c05cf['id'],'SmsQueueId':_0x12bf0a[_0x9f16('0x4e')]['id']},'transaction':_0x5a377e});});})[_0x9f16('0x2c')](function(){_0x13c495[_0x9f16('0x78')](function(_0x45b105){socket[_0x9f16('0x79')](_0x9f16('0x7a'),{'UserId':_0x45b105['id'],'SmsQueueId':_0x314d9c['id']});});});});});}})[_0x9f16('0x2c')](respondWithStatusCode(_0x521e59,null))[_0x9f16('0x4c')](handleError(_0x521e59,null));};exports[_0x9f16('0x7b')]=function(_0x25e3f7,_0x3e00d7,_0xe79f8b){return db[_0x9f16('0x6b')][_0x9f16('0x4a')]({'where':{'id':_0x25e3f7[_0x9f16('0x39')]['ids']},'attributes':['id'],'include':[{'model':db[_0x9f16('0x6f')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x3e00d7,null))['then'](function(_0x165bd8){var _0x18c841=_['map'](_0x165bd8,'id');var _0x117671=[];var _0x2ec5b6=[];var _0x5c60ca=squel['select']();_0x5c60ca[_0x9f16('0x7c')](_0x9f16('0x7d'))[_0x9f16('0x7e')](_0x9f16('0x7f'),'tq')[_0x9f16('0x80')]('user_has_teams','ut',_0x9f16('0x81'))[_0x9f16('0x44')](_0x9f16('0x82'),_0x25e3f7[_0x9f16('0x4e')]['id']);for(var _0x42ceb8=0x0;_0x42ceb8<_0x165bd8[_0x9f16('0x3e')];_0x42ceb8+=0x1){let _0x4783eb=_0x165bd8[_0x42ceb8];for(var _0x20836f=0x0;_0x20836f<_0x4783eb[_0x9f16('0x70')][_0x9f16('0x3e')];_0x20836f+=0x1){let _0x161c8=_0x4783eb[_0x9f16('0x70')][_0x20836f];var _0x58162a=_0x5c60ca[_0x9f16('0x83')]();_0x58162a[_0x9f16('0x44')](_0x9f16('0x84'),_0x161c8['id']);_0x2ec5b6['push'](db[_0x9f16('0x74')][_0x9f16('0x39')](_0x58162a[_0x9f16('0x85')](),{'type':db[_0x9f16('0x74')][_0x9f16('0x86')][_0x9f16('0x87')]})[_0x9f16('0x2c')](function(_0x1ad42f){if(_0x1ad42f[_0x9f16('0x3e')]===0x1){return _0x161c8['id'];}else{var _0x149b50=_[_0x9f16('0x88')](_[_0x9f16('0x38')](_0x1ad42f,'TeamId'),function(_0x2fe5ac){return _[_0x9f16('0x89')](_0x18c841,_0x2fe5ac);});if(_0x149b50){return _0x161c8['id'];}}}));}}return BPromise[_0x9f16('0x8a')](_0x2ec5b6)['then'](function(_0x59166d){_0x117671=_(_0x117671)['union'](_0x59166d)[_0x9f16('0x8b')]()[_0x9f16('0x8c')]();return db[_0x9f16('0x33')][_0x9f16('0x59')]({'where':{'id':_0x25e3f7[_0x9f16('0x4e')]['id']}})[_0x9f16('0x2c')](function(_0x32933a){return db[_0x9f16('0x74')]['transaction'](function(_0x330705){return _0x32933a['removeTeams'](_0x25e3f7[_0x9f16('0x39')][_0x9f16('0x6e')],{'transaction':_0x330705})[_0x9f16('0x2c')](function(){if(!_[_0x9f16('0x8d')](_0x117671)){return _0x32933a[_0x9f16('0x8e')](_0x117671,{'transaction':_0x330705});}})[_0x9f16('0x2c')](function(){_0x117671[_0x9f16('0x78')](function(_0x37d6f9){socket[_0x9f16('0x79')](_0x9f16('0x8f'),{'UserId':_0x37d6f9,'SmsQueueId':_0x32933a['id']});});});});});});})[_0x9f16('0x2c')](respondWithStatusCode(_0x3e00d7,null))[_0x9f16('0x4c')](handleError(_0x3e00d7,null));};exports[_0x9f16('0x90')]=function(_0x559103,_0x4072b1,_0x422821){return db[_0x9f16('0x33')][_0x9f16('0x59')]({'where':{'id':_0x559103[_0x9f16('0x4e')]['id']}})[_0x9f16('0x2c')](handleEntityNotFound(_0x4072b1,null))[_0x9f16('0x2c')](function(_0x55f75b){if(_0x55f75b){return _0x55f75b['addAgents'](_0x559103[_0x9f16('0x53')][_0x9f16('0x6e')],_[_0x9f16('0x91')](_0x559103[_0x9f16('0x53')],['ids','id'])||{})[_0x9f16('0x92')](function(_0x46c2b3){for(var _0x1f4fae=0x0;_0x1f4fae<_0x559103[_0x9f16('0x53')][_0x9f16('0x6e')]['length'];_0x1f4fae+=0x1){socket[_0x9f16('0x79')](_0x9f16('0x7a'),{'UserId':Number(_0x559103[_0x9f16('0x53')]['ids'][_0x1f4fae]),'SmsQueueId':Number(_0x559103[_0x9f16('0x4e')]['id'])});}return _0x46c2b3;});}})[_0x9f16('0x2c')](respondWithResult(_0x4072b1,null))[_0x9f16('0x4c')](handleError(_0x4072b1,null));};exports[_0x9f16('0x8e')]=function(_0x1339a4,_0x36b1e5,_0x3ef2bb){return db['SmsQueue'][_0x9f16('0x59')]({'where':{'id':_0x1339a4[_0x9f16('0x4e')]['id']}})[_0x9f16('0x2c')](handleEntityNotFound(_0x36b1e5,null))[_0x9f16('0x2c')](function(_0x302db5){if(_0x302db5){return _0x302db5[_0x9f16('0x8e')](_0x1339a4[_0x9f16('0x39')][_0x9f16('0x6e')])[_0x9f16('0x2c')](function(){if(_['isArray'](_0x1339a4[_0x9f16('0x39')]['ids'])){for(var _0xcb9fd0=0x0;_0xcb9fd0<_0x1339a4['query'][_0x9f16('0x6e')][_0x9f16('0x3e')];_0xcb9fd0+=0x1){socket[_0x9f16('0x79')](_0x9f16('0x8f'),{'UserId':Number(_0x1339a4[_0x9f16('0x39')][_0x9f16('0x6e')][_0xcb9fd0]),'SmsQueueId':Number(_0x1339a4['params']['id'])});}}else{socket[_0x9f16('0x79')]('userSmsQueue:remove',{'UserId':Number(_0x1339a4[_0x9f16('0x39')][_0x9f16('0x6e')]),'SmsQueueId':Number(_0x1339a4[_0x9f16('0x4e')]['id'])});}});}})[_0x9f16('0x2c')](respondWithStatusCode(_0x36b1e5,null))[_0x9f16('0x4c')](handleError(_0x36b1e5,null));};exports[_0x9f16('0x93')]=function(_0x546dfd,_0x420919,_0x3b61eb){var _0x5d21f7={};var _0xdc874a={};var _0x494272;var _0x8d2d5d;return db[_0x9f16('0x33')][_0x9f16('0x5f')]({'where':{'id':_0x546dfd[_0x9f16('0x4e')]['id']}})[_0x9f16('0x2c')](handleEntityNotFound(_0x420919,null))[_0x9f16('0x2c')](function(_0x5e1e34){if(_0x5e1e34){_0x494272=_0x5e1e34;_0xdc874a[_0x9f16('0x3f')]=_[_0x9f16('0x3a')](db[_0x9f16('0x6f')]['rawAttributes']);_0xdc874a[_0x9f16('0x39')]=_[_0x9f16('0x3a')](_0x546dfd[_0x9f16('0x39')]);_0xdc874a[_0x9f16('0x3b')]=_['intersection'](_0xdc874a[_0x9f16('0x3f')],_0xdc874a[_0x9f16('0x39')]);_0x5d21f7[_0x9f16('0x3d')]=_[_0x9f16('0x4f')](_0xdc874a[_0x9f16('0x3f')],qs[_0x9f16('0x3c')](_0x546dfd['query'][_0x9f16('0x3c')]));_0x5d21f7[_0x9f16('0x3d')]=_0x5d21f7[_0x9f16('0x3d')][_0x9f16('0x3e')]?_0x5d21f7[_0x9f16('0x3d')]:_0xdc874a[_0x9f16('0x3f')];_0x5d21f7[_0x9f16('0x42')]=qs[_0x9f16('0x43')](_0x546dfd['query'][_0x9f16('0x43')]);_0x5d21f7['where']=qs[_0x9f16('0x3b')](_['pick'](_0x546dfd[_0x9f16('0x39')],_0xdc874a[_0x9f16('0x3b')]));if(_0x546dfd[_0x9f16('0x39')][_0x9f16('0x46')]){_0x5d21f7[_0x9f16('0x44')]=_[_0x9f16('0x48')](_0x5d21f7['where'],{'$or':_[_0x9f16('0x38')](_0x5d21f7[_0x9f16('0x3d')],function(_0x1be051){var _0x3c5140={};_0x3c5140[_0x1be051]={'$like':'%'+_0x546dfd[_0x9f16('0x39')][_0x9f16('0x46')]+'%'};return _0x3c5140;})});}_0x5d21f7=_[_0x9f16('0x48')]({},_0x5d21f7,_0x546dfd[_0x9f16('0x49')]);return _0x494272[_0x9f16('0x93')](_0x5d21f7);}})['then'](function(_0x541c04){if(_0x541c04){_0x8d2d5d=_0x541c04[_0x9f16('0x3e')];if(!_0x546dfd[_0x9f16('0x39')]['hasOwnProperty']('nolimit')){_0x5d21f7[_0x9f16('0x27')]=qs[_0x9f16('0x27')](_0x546dfd['query'][_0x9f16('0x27')]);_0x5d21f7[_0x9f16('0x24')]=qs[_0x9f16('0x24')](_0x546dfd[_0x9f16('0x39')]['offset']);}return _0x494272[_0x9f16('0x93')](_0x5d21f7);}})[_0x9f16('0x2c')](function(_0x299e50){if(_0x299e50){return _0x299e50?{'count':_0x8d2d5d,'rows':_0x299e50}:null;}})[_0x9f16('0x2c')](respondWithResult(_0x420919,null))[_0x9f16('0x4c')](handleError(_0x420919,null));};
\ No newline at end of file
+var _0xb442=['crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./smsQueue.socket','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','save','update','then','get','SmsQueues','UserProfileResource','destroy','stack','name','send','index','map','type','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','SmsQueue','includeAll','findAll','catch','show','params','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserSmsQueue','pick','SmsQueueId','User','findAndCountAll','agent','createdAt','rows','format','%s/%s','SIP','smsPause','updatedAt','getTeams','Team','addTeams','ids','Agents','voicePause','flatMap','sequelize','findOrCreate','emit','userSmsQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_sms_queues','join','user_has_teams','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','union','compact','transaction','isEmpty','removeAgents','forEach','userSmsQueue:remove','addAgents','omit','spread','isArray','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','sox','ejs'];(function(_0x11d8cb,_0x47b580){var _0x326c6d=function(_0x172670){while(--_0x172670){_0x11d8cb['push'](_0x11d8cb['shift']());}};_0x326c6d(++_0x47b580);}(_0xb442,0x7d));var _0x2b44=function(_0x1a3e33,_0xe419f4){_0x1a3e33=_0x1a3e33-0x0;var _0x545085=_0xb442[_0x1a3e33];return _0x545085;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2b44('0x0'));var zipdir=require(_0x2b44('0x1'));var jsonpatch=require(_0x2b44('0x2'));var rp=require(_0x2b44('0x3'));var moment=require(_0x2b44('0x4'));var BPromise=require(_0x2b44('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x2b44('0x6'));var csv=require('to-csv');var ejs=require(_0x2b44('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x2b44('0x8'));var jsforce=require(_0x2b44('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x2b44('0xa'));var querystring=require(_0x2b44('0xb'));var Papa=require(_0x2b44('0xc'));var Redis=require('ioredis');var authService=require(_0x2b44('0xd'));var qs=require(_0x2b44('0xe'));var as=require(_0x2b44('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x2b44('0x10'));var config=require(_0x2b44('0x11'));var licenseUtil=require(_0x2b44('0x12'));var db=require(_0x2b44('0x13'))['db'];config[_0x2b44('0x14')]=_[_0x2b44('0x15')](config[_0x2b44('0x14')],{'host':_0x2b44('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2b44('0x14')]));require(_0x2b44('0x17'))['register'](socket);function respondWithStatusCode(_0x581104,_0x1632ac){_0x1632ac=_0x1632ac||0xcc;return function(_0x5a945e){if(_0x5a945e){return _0x581104[_0x2b44('0x18')](_0x1632ac);}return _0x581104[_0x2b44('0x19')](_0x1632ac)[_0x2b44('0x1a')]();};}function respondWithResult(_0x5c929e,_0x56bbb1){_0x56bbb1=_0x56bbb1||0xc8;return function(_0x4e09f8){if(_0x4e09f8){return _0x5c929e[_0x2b44('0x19')](_0x56bbb1)[_0x2b44('0x1b')](_0x4e09f8);}};}function respondWithFilteredResult(_0x2de760,_0x1a7d34){return function(_0x27a948){if(_0x27a948){var _0x5170ba=typeof _0x1a7d34[_0x2b44('0x1c')]==='undefined'&&typeof _0x1a7d34[_0x2b44('0x1d')]===_0x2b44('0x1e');var _0x59d52b=_0x27a948[_0x2b44('0x1f')];var _0xaf8cc3=_0x5170ba?0x0:_0x1a7d34[_0x2b44('0x1c')];var _0xf488f6=_0x5170ba?_0x27a948[_0x2b44('0x1f')]:_0x1a7d34[_0x2b44('0x1c')]+_0x1a7d34['limit'];var _0x1a8cc8;if(_0xf488f6>=_0x59d52b){_0xf488f6=_0x59d52b;_0x1a8cc8=0xc8;}else{_0x1a8cc8=0xce;}_0x2de760[_0x2b44('0x19')](_0x1a8cc8);return _0x2de760['set'](_0x2b44('0x20'),_0xaf8cc3+'-'+_0xf488f6+'/'+_0x59d52b)[_0x2b44('0x1b')](_0x27a948);}return null;};}function patchUpdates(_0x160e50){return function(_0x12040d){try{jsonpatch['apply'](_0x12040d,_0x160e50,!![]);}catch(_0x3865de){return BPromise['reject'](_0x3865de);}return _0x12040d[_0x2b44('0x21')]();};}function saveUpdates(_0x17dff1,_0x4a0718){return function(_0x3db329){if(_0x3db329){return _0x3db329[_0x2b44('0x22')](_0x17dff1)[_0x2b44('0x23')](function(_0x4e59f1){return _0x4e59f1;});}return null;};}function removeEntity(_0x42f955,_0x354aad){return function(_0x4438f6){if(_0x4438f6){return _0x4438f6['destroy']()['then'](function(){var _0x28454a=_0x4438f6[_0x2b44('0x24')]({'plain':!![]});var _0x59fc38=_0x2b44('0x25');return db[_0x2b44('0x26')][_0x2b44('0x27')]({'where':{'type':_0x59fc38,'resourceId':_0x28454a['id']}})['then'](function(){return _0x4438f6;});})['then'](function(){_0x42f955[_0x2b44('0x19')](0xcc)[_0x2b44('0x1a')]();});}};}function handleEntityNotFound(_0x2fc253,_0x13e618){return function(_0x59cb09){if(!_0x59cb09){_0x2fc253[_0x2b44('0x18')](0x194);}return _0x59cb09;};}function handleError(_0x4e6a6e,_0x23becf){_0x23becf=_0x23becf||0x1f4;return function(_0x2fa8a2){logger['error'](_0x2fa8a2[_0x2b44('0x28')]);if(_0x2fa8a2[_0x2b44('0x29')]){delete _0x2fa8a2['name'];}_0x4e6a6e[_0x2b44('0x19')](_0x23becf)[_0x2b44('0x2a')](_0x2fa8a2);};}exports[_0x2b44('0x2b')]=function(_0x102326,_0x2c88d1){var _0x2b358d={},_0x156551={},_0xc9a384={'count':0x0,'rows':[]};var _0x57f781=_[_0x2b44('0x2c')](db['SmsQueue']['rawAttributes'],function(_0x4bf280){return{'name':_0x4bf280['fieldName'],'type':_0x4bf280[_0x2b44('0x2d')][_0x2b44('0x2e')]};});_0x156551['model']=_[_0x2b44('0x2c')](_0x57f781,_0x2b44('0x29'));_0x156551['query']=_[_0x2b44('0x2f')](_0x102326[_0x2b44('0x30')]);_0x156551[_0x2b44('0x31')]=_[_0x2b44('0x32')](_0x156551[_0x2b44('0x33')],_0x156551[_0x2b44('0x30')]);_0x2b358d[_0x2b44('0x34')]=_[_0x2b44('0x32')](_0x156551[_0x2b44('0x33')],qs[_0x2b44('0x35')](_0x102326['query']['fields']));_0x2b358d[_0x2b44('0x34')]=_0x2b358d[_0x2b44('0x34')][_0x2b44('0x36')]?_0x2b358d[_0x2b44('0x34')]:_0x156551[_0x2b44('0x33')];if(!_0x102326[_0x2b44('0x30')][_0x2b44('0x37')](_0x2b44('0x38'))){_0x2b358d[_0x2b44('0x1d')]=qs[_0x2b44('0x1d')](_0x102326[_0x2b44('0x30')][_0x2b44('0x1d')]);_0x2b358d[_0x2b44('0x1c')]=qs[_0x2b44('0x1c')](_0x102326[_0x2b44('0x30')]['offset']);}_0x2b358d[_0x2b44('0x39')]=qs[_0x2b44('0x3a')](_0x102326[_0x2b44('0x30')][_0x2b44('0x3a')]);_0x2b358d[_0x2b44('0x3b')]=qs[_0x2b44('0x31')](_['pick'](_0x102326[_0x2b44('0x30')],_0x156551['filters']),_0x57f781);if(_0x102326[_0x2b44('0x30')][_0x2b44('0x3c')]){_0x2b358d[_0x2b44('0x3b')]=_[_0x2b44('0x3d')](_0x2b358d['where'],{'$or':_['map'](_0x57f781,function(_0x231ebd){if(_0x231ebd[_0x2b44('0x2d')]!==_0x2b44('0x3e')){var _0xf434e6={};_0xf434e6[_0x231ebd['name']]={'$like':'%'+_0x102326[_0x2b44('0x30')][_0x2b44('0x3c')]+'%'};return _0xf434e6;}})});}_0x2b358d=_[_0x2b44('0x3d')]({},_0x2b358d,_0x102326[_0x2b44('0x3f')]);var _0x49bb01={'where':_0x2b358d[_0x2b44('0x3b')]};return db[_0x2b44('0x40')][_0x2b44('0x1f')](_0x49bb01)['then'](function(_0x701ca3){_0xc9a384[_0x2b44('0x1f')]=_0x701ca3;if(_0x102326[_0x2b44('0x30')][_0x2b44('0x41')]){_0x2b358d['include']=[{'all':!![]}];}return db[_0x2b44('0x40')][_0x2b44('0x42')](_0x2b358d);})[_0x2b44('0x23')](function(_0x582f39){_0xc9a384['rows']=_0x582f39;return _0xc9a384;})['then'](respondWithFilteredResult(_0x2c88d1,_0x2b358d))[_0x2b44('0x43')](handleError(_0x2c88d1,null));};exports[_0x2b44('0x44')]=function(_0x106669,_0x460828){var _0x20ba8c={'raw':!![],'where':{'id':_0x106669[_0x2b44('0x45')]['id']}},_0x50ede0={};_0x50ede0['model']=_[_0x2b44('0x2f')](db[_0x2b44('0x40')][_0x2b44('0x46')]);_0x50ede0[_0x2b44('0x30')]=_['keys'](_0x106669[_0x2b44('0x30')]);_0x50ede0[_0x2b44('0x31')]=_[_0x2b44('0x32')](_0x50ede0[_0x2b44('0x33')],_0x50ede0[_0x2b44('0x30')]);_0x20ba8c[_0x2b44('0x34')]=_[_0x2b44('0x32')](_0x50ede0[_0x2b44('0x33')],qs[_0x2b44('0x35')](_0x106669[_0x2b44('0x30')]['fields']));_0x20ba8c[_0x2b44('0x34')]=_0x20ba8c[_0x2b44('0x34')][_0x2b44('0x36')]?_0x20ba8c[_0x2b44('0x34')]:_0x50ede0[_0x2b44('0x33')];if(_0x106669[_0x2b44('0x30')][_0x2b44('0x41')]){_0x20ba8c['include']=[{'all':!![]}];}_0x20ba8c=_['merge']({},_0x20ba8c,_0x106669[_0x2b44('0x3f')]);return db['SmsQueue'][_0x2b44('0x47')](_0x20ba8c)[_0x2b44('0x23')](handleEntityNotFound(_0x460828,null))['then'](respondWithResult(_0x460828,null))['catch'](handleError(_0x460828,null));};exports[_0x2b44('0x48')]=function(_0x20a0a3,_0x1b05c){return db[_0x2b44('0x40')][_0x2b44('0x48')](_0x20a0a3[_0x2b44('0x49')],{})[_0x2b44('0x23')](function(_0x2e2633){var _0x14acbc=_0x20a0a3[_0x2b44('0x4a')][_0x2b44('0x24')]({'plain':!![]});if(!_0x14acbc)throw new Error(_0x2b44('0x4b'));if(_0x14acbc[_0x2b44('0x4c')]===_0x2b44('0x4a')){var _0x5a8562=_0x2e2633[_0x2b44('0x24')]({'plain':!![]});var _0x325881='SmsQueues';return db['UserProfileSection'][_0x2b44('0x47')]({'where':{'name':_0x325881,'userProfileId':_0x14acbc[_0x2b44('0x4d')]},'raw':!![]})[_0x2b44('0x23')](function(_0xdd3623){if(_0xdd3623&&_0xdd3623[_0x2b44('0x4e')]===0x0){return db[_0x2b44('0x26')][_0x2b44('0x48')]({'name':_0x5a8562[_0x2b44('0x29')],'resourceId':_0x5a8562['id'],'type':_0xdd3623[_0x2b44('0x29')],'sectionId':_0xdd3623['id']},{})[_0x2b44('0x23')](function(){return _0x2e2633;});}else{return _0x2e2633;}})['catch'](function(_0x30e48f){logger[_0x2b44('0x4f')](_0x2b44('0x50'),_0x30e48f);throw _0x30e48f;});}return _0x2e2633;})[_0x2b44('0x23')](respondWithResult(_0x1b05c,0xc9))['catch'](handleError(_0x1b05c,null));};exports[_0x2b44('0x22')]=function(_0x6a068c,_0x130430){if(_0x6a068c['body']['id']){delete _0x6a068c[_0x2b44('0x49')]['id'];}return db['SmsQueue'][_0x2b44('0x47')]({'where':{'id':_0x6a068c[_0x2b44('0x45')]['id']}})['then'](handleEntityNotFound(_0x130430,null))['then'](saveUpdates(_0x6a068c[_0x2b44('0x49')],null))[_0x2b44('0x23')](respondWithResult(_0x130430,null))[_0x2b44('0x43')](handleError(_0x130430,null));};exports[_0x2b44('0x27')]=function(_0x4c7042,_0x4bb8f9){return db[_0x2b44('0x40')][_0x2b44('0x47')]({'where':{'id':_0x4c7042['params']['id']}})[_0x2b44('0x23')](handleEntityNotFound(_0x4bb8f9,null))[_0x2b44('0x23')](removeEntity(_0x4bb8f9,null))['catch'](handleError(_0x4bb8f9,null));};exports[_0x2b44('0x51')]=function(_0x2c1837,_0x101d0b){return db[_0x2b44('0x40')][_0x2b44('0x51')]()[_0x2b44('0x23')](respondWithResult(_0x101d0b,null))[_0x2b44('0x43')](handleError(_0x101d0b,null));};exports[_0x2b44('0x52')]=function(_0x526dfe,_0x8ae48,_0x20d703){var _0x5ea40e={'raw':!![],'where':{}},_0x46e9ee={},_0x171500;return db['SmsQueue'][_0x2b44('0x53')]({'where':{'id':_0x526dfe[_0x2b44('0x45')]['id']}})[_0x2b44('0x23')](handleEntityNotFound(_0x8ae48,null))['then'](function(_0x196885){if(_0x196885){_0x171500=_0x196885[_0x2b44('0x24')]({'plain':!![]});_0x46e9ee[_0x2b44('0x33')]=_[_0x2b44('0x2f')](db[_0x2b44('0x54')][_0x2b44('0x46')]);_0x46e9ee[_0x2b44('0x30')]=_[_0x2b44('0x2f')](_0x526dfe['query']);_0x46e9ee['filters']=_[_0x2b44('0x32')](_0x46e9ee[_0x2b44('0x33')],_0x46e9ee[_0x2b44('0x30')]);_0x5ea40e[_0x2b44('0x34')]=_[_0x2b44('0x32')](_0x46e9ee[_0x2b44('0x33')],qs[_0x2b44('0x35')](_0x526dfe[_0x2b44('0x30')]['fields']));_0x5ea40e[_0x2b44('0x34')]=_0x5ea40e['attributes']['length']?_0x5ea40e[_0x2b44('0x34')]:_0x46e9ee[_0x2b44('0x33')];if(!_0x526dfe['query'][_0x2b44('0x37')](_0x2b44('0x38'))){_0x5ea40e[_0x2b44('0x1d')]=qs['limit'](_0x526dfe['query'][_0x2b44('0x1d')]);_0x5ea40e[_0x2b44('0x1c')]=qs[_0x2b44('0x1c')](_0x526dfe[_0x2b44('0x30')][_0x2b44('0x1c')]);}_0x5ea40e[_0x2b44('0x39')]=qs['sort'](_0x526dfe[_0x2b44('0x30')][_0x2b44('0x3a')]);_0x5ea40e[_0x2b44('0x3b')]=qs[_0x2b44('0x31')](_[_0x2b44('0x55')](_0x526dfe[_0x2b44('0x30')],_0x46e9ee[_0x2b44('0x31')]));_0x5ea40e[_0x2b44('0x3b')][_0x2b44('0x56')]=_0x196885['id'];if(_0x526dfe[_0x2b44('0x30')][_0x2b44('0x3c')]){_0x5ea40e[_0x2b44('0x3b')]=_['merge'](_0x5ea40e['where'],{'$or':_['map'](_0x5ea40e['attributes'],function(_0x42ba77){var _0xcc0739={};_0xcc0739[_0x42ba77]={'$like':'%'+_0x526dfe['query'][_0x2b44('0x3c')]+'%'};return _0xcc0739;})});}_0x5ea40e=_[_0x2b44('0x3d')]({},_0x5ea40e,_0x526dfe[_0x2b44('0x3f')]);return db['UserSmsQueue'][_0x2b44('0x42')](_0x5ea40e);}})[_0x2b44('0x23')](function(_0x2a9603){if(_0x2a9603){return db[_0x2b44('0x57')][_0x2b44('0x58')]({'where':{'id':_['map'](_0x2a9603,'UserId'),'role':_0x2b44('0x59')},'attributes':['id','name','smsPause','updatedAt',_0x2b44('0x5a')]});}})[_0x2b44('0x23')](function(_0x12f005){if(_0x12f005){return{'count':_0x12f005[_0x2b44('0x1f')],'rows':_[_0x2b44('0x2c')](_0x12f005[_0x2b44('0x5b')],function(_0x19ee9f){return{'membername':_0x19ee9f[_0x2b44('0x29')],'UserId':_0x19ee9f['id'],'queue_name':_0x171500[_0x2b44('0x29')],'SmsQueueId':_0x171500['id'],'interface':util[_0x2b44('0x5c')](_0x2b44('0x5d'),_0x2b44('0x5e'),_0x19ee9f[_0x2b44('0x29')]),'penalty':0x0,'paused':_0x19ee9f[_0x2b44('0x5f')],'createdAt':_0x19ee9f['createdAt'],'updatedAt':_0x19ee9f[_0x2b44('0x60')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x2b44('0x23')](respondWithFilteredResult(_0x8ae48,_0x5ea40e))['catch'](handleError(_0x8ae48,null));};exports[_0x2b44('0x61')]=function(_0x215818,_0xe11163,_0x2b259e){var _0x2c5464={};var _0x36f1c0={};var _0x3783fa;var _0x42cbfa;return db[_0x2b44('0x40')][_0x2b44('0x53')]({'where':{'id':_0x215818[_0x2b44('0x45')]['id']}})[_0x2b44('0x23')](handleEntityNotFound(_0xe11163,null))['then'](function(_0x1349a8){if(_0x1349a8){_0x3783fa=_0x1349a8;_0x36f1c0[_0x2b44('0x33')]=_[_0x2b44('0x2f')](db[_0x2b44('0x62')]['rawAttributes']);_0x36f1c0[_0x2b44('0x30')]=_[_0x2b44('0x2f')](_0x215818[_0x2b44('0x30')]);_0x36f1c0['filters']=_[_0x2b44('0x32')](_0x36f1c0[_0x2b44('0x33')],_0x36f1c0[_0x2b44('0x30')]);_0x2c5464[_0x2b44('0x34')]=_[_0x2b44('0x32')](_0x36f1c0[_0x2b44('0x33')],qs[_0x2b44('0x35')](_0x215818[_0x2b44('0x30')][_0x2b44('0x35')]));_0x2c5464['attributes']=_0x2c5464[_0x2b44('0x34')][_0x2b44('0x36')]?_0x2c5464[_0x2b44('0x34')]:_0x36f1c0['model'];_0x2c5464[_0x2b44('0x39')]=qs[_0x2b44('0x3a')](_0x215818[_0x2b44('0x30')]['sort']);_0x2c5464[_0x2b44('0x3b')]=qs[_0x2b44('0x31')](_['pick'](_0x215818[_0x2b44('0x30')],_0x36f1c0[_0x2b44('0x31')]));if(_0x215818['query'][_0x2b44('0x3c')]){_0x2c5464[_0x2b44('0x3b')]=_[_0x2b44('0x3d')](_0x2c5464[_0x2b44('0x3b')],{'$or':_[_0x2b44('0x2c')](_0x2c5464[_0x2b44('0x34')],function(_0x1b7f5f){var _0x4b73c4={};_0x4b73c4[_0x1b7f5f]={'$like':'%'+_0x215818[_0x2b44('0x30')][_0x2b44('0x3c')]+'%'};return _0x4b73c4;})});}_0x2c5464=_['merge']({},_0x2c5464,_0x215818[_0x2b44('0x3f')]);return _0x3783fa['getTeams'](_0x2c5464);}})[_0x2b44('0x23')](function(_0x4000bd){if(_0x4000bd){_0x42cbfa=_0x4000bd['length'];if(!_0x215818[_0x2b44('0x30')][_0x2b44('0x37')](_0x2b44('0x38'))){_0x2c5464[_0x2b44('0x1d')]=qs[_0x2b44('0x1d')](_0x215818[_0x2b44('0x30')]['limit']);_0x2c5464['offset']=qs[_0x2b44('0x1c')](_0x215818['query'][_0x2b44('0x1c')]);}return _0x3783fa[_0x2b44('0x61')](_0x2c5464);}})[_0x2b44('0x23')](function(_0x49be45){if(_0x49be45){return _0x49be45?{'count':_0x42cbfa,'rows':_0x49be45}:null;}})[_0x2b44('0x23')](respondWithResult(_0xe11163,null))['catch'](handleError(_0xe11163,null));};exports[_0x2b44('0x63')]=function(_0x296aa7,_0x3265b1,_0x3347b9){var _0x4a6ac1=_0x296aa7[_0x2b44('0x49')][_0x2b44('0x64')];return db[_0x2b44('0x62')][_0x2b44('0x42')]({'where':{'id':_0x4a6ac1},'attributes':['id'],'include':[{'model':db[_0x2b44('0x57')],'as':_0x2b44('0x65'),'attributes':['id',_0x2b44('0x29'),'online',_0x2b44('0x66'),'interface'],'raw':!![]}]})[_0x2b44('0x23')](function(_0xb6ecf7){if(_0xb6ecf7){var _0x436666=_[_0x2b44('0x67')](_0xb6ecf7,function(_0x425a50){var _0x3d3f0e=_0x425a50[_0x2b44('0x24')]({'plain':!![]});return _0x3d3f0e[_0x2b44('0x65')];});return db[_0x2b44('0x40')][_0x2b44('0x47')]({'where':{'id':_0x296aa7[_0x2b44('0x45')]['id']}})[_0x2b44('0x23')](function(_0xf44a91){return db[_0x2b44('0x68')]['transaction'](function(_0x1f5ae4){return _0xf44a91[_0x2b44('0x63')](_0x4a6ac1,{'transaction':_0x1f5ae4})[_0x2b44('0x23')](function(){return BPromise['each'](_0x436666,function(_0x1a4798){return db[_0x2b44('0x54')][_0x2b44('0x69')]({'where':{'UserId':_0x1a4798['id'],'SmsQueueId':_0x296aa7[_0x2b44('0x45')]['id']},'transaction':_0x1f5ae4});});})[_0x2b44('0x23')](function(){_0x436666['forEach'](function(_0x4b651c){socket[_0x2b44('0x6a')](_0x2b44('0x6b'),{'UserId':_0x4b651c['id'],'SmsQueueId':_0xf44a91['id']});});});});});}})['then'](respondWithStatusCode(_0x3265b1,null))[_0x2b44('0x43')](handleError(_0x3265b1,null));};exports[_0x2b44('0x6c')]=function(_0x5c8f76,_0x496231,_0xec756){return db[_0x2b44('0x62')]['findAll']({'where':{'id':_0x5c8f76[_0x2b44('0x30')]['ids']},'attributes':['id'],'include':[{'model':db[_0x2b44('0x57')],'as':_0x2b44('0x65'),'attributes':['id'],'raw':!![]}]})[_0x2b44('0x23')](handleEntityNotFound(_0x496231,null))['then'](function(_0x5cddf4){var _0x1e1729=_[_0x2b44('0x2c')](_0x5cddf4,'id');var _0xd39e03=[];var _0x4c5ddf=[];var _0x310fa3=squel[_0x2b44('0x6d')]();_0x310fa3[_0x2b44('0x6e')](_0x2b44('0x6f'))[_0x2b44('0x70')](_0x2b44('0x71'),'tq')[_0x2b44('0x72')](_0x2b44('0x73'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x2b44('0x3b')]('SmsQueueId\x20=\x20?',_0x5c8f76[_0x2b44('0x45')]['id']);for(var _0x4f4ddb=0x0;_0x4f4ddb<_0x5cddf4[_0x2b44('0x36')];_0x4f4ddb+=0x1){let _0x11a890=_0x5cddf4[_0x4f4ddb];for(var _0x464171=0x0;_0x464171<_0x11a890[_0x2b44('0x65')]['length'];_0x464171+=0x1){let _0x206122=_0x11a890[_0x2b44('0x65')][_0x464171];var _0x123dc5=_0x310fa3['clone']();_0x123dc5[_0x2b44('0x3b')](_0x2b44('0x74'),_0x206122['id']);_0x4c5ddf[_0x2b44('0x75')](db[_0x2b44('0x68')][_0x2b44('0x30')](_0x123dc5['toString'](),{'type':db[_0x2b44('0x68')][_0x2b44('0x76')][_0x2b44('0x77')]})['then'](function(_0x245150){if(_0x245150[_0x2b44('0x36')]===0x1){return _0x206122['id'];}else{var _0x1a0862=_[_0x2b44('0x78')](_['map'](_0x245150,'TeamId'),function(_0x415e39){return _['includes'](_0x1e1729,_0x415e39);});if(_0x1a0862){return _0x206122['id'];}}}));}}return BPromise['all'](_0x4c5ddf)[_0x2b44('0x23')](function(_0x4f536f){_0xd39e03=_(_0xd39e03)[_0x2b44('0x79')](_0x4f536f)[_0x2b44('0x7a')]()['value']();return db[_0x2b44('0x40')][_0x2b44('0x47')]({'where':{'id':_0x5c8f76[_0x2b44('0x45')]['id']}})[_0x2b44('0x23')](function(_0x105d4f){return db[_0x2b44('0x68')][_0x2b44('0x7b')](function(_0x188d4e){return _0x105d4f[_0x2b44('0x6c')](_0x5c8f76[_0x2b44('0x30')][_0x2b44('0x64')],{'transaction':_0x188d4e})[_0x2b44('0x23')](function(){if(!_[_0x2b44('0x7c')](_0xd39e03)){return _0x105d4f[_0x2b44('0x7d')](_0xd39e03,{'transaction':_0x188d4e});}})[_0x2b44('0x23')](function(){_0xd39e03[_0x2b44('0x7e')](function(_0x16cabc){socket[_0x2b44('0x6a')](_0x2b44('0x7f'),{'UserId':_0x16cabc,'SmsQueueId':_0x105d4f['id']});});});});});});})[_0x2b44('0x23')](respondWithStatusCode(_0x496231,null))[_0x2b44('0x43')](handleError(_0x496231,null));};exports[_0x2b44('0x80')]=function(_0x471063,_0x2ee32d,_0x32affd){return db[_0x2b44('0x40')][_0x2b44('0x47')]({'where':{'id':_0x471063[_0x2b44('0x45')]['id']}})[_0x2b44('0x23')](handleEntityNotFound(_0x2ee32d,null))[_0x2b44('0x23')](function(_0x540a8a){if(_0x540a8a){return _0x540a8a[_0x2b44('0x80')](_0x471063[_0x2b44('0x49')][_0x2b44('0x64')],_[_0x2b44('0x81')](_0x471063[_0x2b44('0x49')],[_0x2b44('0x64'),'id'])||{})[_0x2b44('0x82')](function(_0xfbed98){for(var _0x217b9b=0x0;_0x217b9b<_0x471063[_0x2b44('0x49')][_0x2b44('0x64')]['length'];_0x217b9b+=0x1){socket[_0x2b44('0x6a')]('userSmsQueue:save',{'UserId':Number(_0x471063[_0x2b44('0x49')][_0x2b44('0x64')][_0x217b9b]),'SmsQueueId':Number(_0x471063[_0x2b44('0x45')]['id'])});}return _0xfbed98;});}})['then'](respondWithResult(_0x2ee32d,null))[_0x2b44('0x43')](handleError(_0x2ee32d,null));};exports[_0x2b44('0x7d')]=function(_0x1d9a65,_0x354525,_0x5c8cb5){return db[_0x2b44('0x40')][_0x2b44('0x47')]({'where':{'id':_0x1d9a65[_0x2b44('0x45')]['id']}})[_0x2b44('0x23')](handleEntityNotFound(_0x354525,null))[_0x2b44('0x23')](function(_0x51e345){if(_0x51e345){return _0x51e345[_0x2b44('0x7d')](_0x1d9a65[_0x2b44('0x30')]['ids'])['then'](function(){if(_[_0x2b44('0x83')](_0x1d9a65[_0x2b44('0x30')][_0x2b44('0x64')])){for(var _0x167926=0x0;_0x167926<_0x1d9a65[_0x2b44('0x30')]['ids']['length'];_0x167926+=0x1){socket[_0x2b44('0x6a')](_0x2b44('0x7f'),{'UserId':Number(_0x1d9a65['query'][_0x2b44('0x64')][_0x167926]),'SmsQueueId':Number(_0x1d9a65['params']['id'])});}}else{socket[_0x2b44('0x6a')]('userSmsQueue:remove',{'UserId':Number(_0x1d9a65[_0x2b44('0x30')]['ids']),'SmsQueueId':Number(_0x1d9a65['params']['id'])});}});}})[_0x2b44('0x23')](respondWithStatusCode(_0x354525,null))['catch'](handleError(_0x354525,null));};exports['getAgents']=function(_0x27bf80,_0x2d233d,_0x1b2340){var _0x44024b={};var _0x3b5a90={};var _0x54eed0;var _0x770e58;return db[_0x2b44('0x40')][_0x2b44('0x53')]({'where':{'id':_0x27bf80['params']['id']}})[_0x2b44('0x23')](handleEntityNotFound(_0x2d233d,null))[_0x2b44('0x23')](function(_0x51818a){if(_0x51818a){_0x54eed0=_0x51818a;_0x3b5a90['model']=_[_0x2b44('0x2f')](db[_0x2b44('0x57')][_0x2b44('0x46')]);_0x3b5a90[_0x2b44('0x30')]=_['keys'](_0x27bf80[_0x2b44('0x30')]);_0x3b5a90[_0x2b44('0x31')]=_[_0x2b44('0x32')](_0x3b5a90[_0x2b44('0x33')],_0x3b5a90[_0x2b44('0x30')]);_0x44024b[_0x2b44('0x34')]=_[_0x2b44('0x32')](_0x3b5a90[_0x2b44('0x33')],qs[_0x2b44('0x35')](_0x27bf80['query'][_0x2b44('0x35')]));_0x44024b[_0x2b44('0x34')]=_0x44024b[_0x2b44('0x34')][_0x2b44('0x36')]?_0x44024b[_0x2b44('0x34')]:_0x3b5a90[_0x2b44('0x33')];_0x44024b[_0x2b44('0x39')]=qs[_0x2b44('0x3a')](_0x27bf80[_0x2b44('0x30')][_0x2b44('0x3a')]);_0x44024b['where']=qs[_0x2b44('0x31')](_[_0x2b44('0x55')](_0x27bf80[_0x2b44('0x30')],_0x3b5a90[_0x2b44('0x31')]));if(_0x27bf80[_0x2b44('0x30')][_0x2b44('0x3c')]){_0x44024b[_0x2b44('0x3b')]=_[_0x2b44('0x3d')](_0x44024b[_0x2b44('0x3b')],{'$or':_[_0x2b44('0x2c')](_0x44024b['attributes'],function(_0x28a8d4){var _0x3ec114={};_0x3ec114[_0x28a8d4]={'$like':'%'+_0x27bf80[_0x2b44('0x30')][_0x2b44('0x3c')]+'%'};return _0x3ec114;})});}_0x44024b=_['merge']({},_0x44024b,_0x27bf80[_0x2b44('0x3f')]);return _0x54eed0['getAgents'](_0x44024b);}})[_0x2b44('0x23')](function(_0x2ebbbe){if(_0x2ebbbe){_0x770e58=_0x2ebbbe[_0x2b44('0x36')];if(!_0x27bf80[_0x2b44('0x30')][_0x2b44('0x37')](_0x2b44('0x38'))){_0x44024b['limit']=qs[_0x2b44('0x1d')](_0x27bf80['query']['limit']);_0x44024b[_0x2b44('0x1c')]=qs[_0x2b44('0x1c')](_0x27bf80[_0x2b44('0x30')][_0x2b44('0x1c')]);}return _0x54eed0[_0x2b44('0x84')](_0x44024b);}})[_0x2b44('0x23')](function(_0x5efc84){if(_0x5efc84){return _0x5efc84?{'count':_0x770e58,'rows':_0x5efc84}:null;}})[_0x2b44('0x23')](respondWithResult(_0x2d233d,null))[_0x2b44('0x43')](handleError(_0x2d233d,null));};
\ No newline at end of file
index 3cf6ff5..5345277 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x55c9=['save','update','remove','emit','events','../../mysqldb','SmsQueue','setMaxListeners'];(function(_0x72d7f3,_0xa83ab3){var _0x30fcb3=function(_0x574f04){while(--_0x574f04){_0x72d7f3['push'](_0x72d7f3['shift']());}};_0x30fcb3(++_0xa83ab3);}(_0x55c9,0x6c));var _0x955c=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x55c9[_0x4565bf];return _0x5610ba;};'use strict';var EventEmitter=require(_0x955c('0x0'));var SmsQueue=require(_0x955c('0x1'))['db'][_0x955c('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x955c('0x3')](0x0);var events={'afterCreate':_0x955c('0x4'),'afterUpdate':_0x955c('0x5'),'afterDestroy':_0x955c('0x6')};function emitEvent(_0x848915){return function(_0x472b7e,_0x3b1cb5,_0x26787b){SmsQueueEvents[_0x955c('0x7')](_0x848915+':'+_0x472b7e['id'],_0x472b7e);SmsQueueEvents[_0x955c('0x7')](_0x848915,_0x472b7e);_0x26787b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsQueue['hook'](e,emitEvent(event));}}module['exports']=SmsQueueEvents;
\ No newline at end of file
+var _0x5f8a=['setMaxListeners','save','update','remove','emit','events','../../mysqldb','SmsQueue'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x5f8a,0x185));var _0xa5f8=function(_0x2a7b8e,_0x50ffce){_0x2a7b8e=_0x2a7b8e-0x0;var _0x29b5c8=_0x5f8a[_0x2a7b8e];return _0x29b5c8;};'use strict';var EventEmitter=require(_0xa5f8('0x0'));var SmsQueue=require(_0xa5f8('0x1'))['db'][_0xa5f8('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xa5f8('0x3')](0x0);var events={'afterCreate':_0xa5f8('0x4'),'afterUpdate':_0xa5f8('0x5'),'afterDestroy':_0xa5f8('0x6')};function emitEvent(_0x7c63b3){return function(_0x28dd79,_0x2cddf2,_0x5cfbc4){SmsQueueEvents[_0xa5f8('0x7')](_0x7c63b3+':'+_0x28dd79['id'],_0x28dd79);SmsQueueEvents['emit'](_0x7c63b3,_0x28dd79);_0x5cfbc4(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsQueue['hook'](e,emitEvent(event));}}module['exports']=SmsQueueEvents;
\ No newline at end of file
index ed4100a..dd9b16a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xea23=['api','bluebird','request-promise','rimraf','./smsQueue.attributes','define','SmsQueue','sms_queues','lodash','util'];(function(_0x4c0d98,_0x2ad90b){var _0x113b95=function(_0x51741d){while(--_0x51741d){_0x4c0d98['push'](_0x4c0d98['shift']());}};_0x113b95(++_0x2ad90b);}(_0xea23,0x9e));var _0x3ea2=function(_0x5c23a8,_0x22a6c2){_0x5c23a8=_0x5c23a8-0x0;var _0x96a2e5=_0xea23[_0x5c23a8];return _0x96a2e5;};'use strict';var _=require(_0x3ea2('0x0'));var util=require(_0x3ea2('0x1'));var logger=require('../../config/logger')(_0x3ea2('0x2'));var moment=require('moment');var BPromise=require(_0x3ea2('0x3'));var rp=require(_0x3ea2('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3ea2('0x5'));var config=require('../../config/environment');var attributes=require(_0x3ea2('0x6'));module['exports']=function(_0x2b5416,_0x4c7cda){return _0x2b5416[_0x3ea2('0x7')](_0x3ea2('0x8'),attributes,{'tableName':_0x3ea2('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9d4a=['rimraf','../../config/environment','exports','util','api','moment','request-promise','path'];(function(_0x32f7d7,_0x54231b){var _0x133d09=function(_0x41a7ab){while(--_0x41a7ab){_0x32f7d7['push'](_0x32f7d7['shift']());}};_0x133d09(++_0x54231b);}(_0x9d4a,0x8b));var _0xa9d4=function(_0x17e0df,_0x532a4f){_0x17e0df=_0x17e0df-0x0;var _0x335714=_0x9d4a[_0x17e0df];return _0x335714;};'use strict';var _=require('lodash');var util=require(_0xa9d4('0x0'));var logger=require('../../config/logger')(_0xa9d4('0x1'));var moment=require(_0xa9d4('0x2'));var BPromise=require('bluebird');var rp=require(_0xa9d4('0x3'));var fs=require('fs');var path=require(_0xa9d4('0x4'));var rimraf=require(_0xa9d4('0x5'));var config=require(_0xa9d4('0x6'));var attributes=require('./smsQueue.attributes');module[_0xa9d4('0x7')]=function(_0x7a049b,_0x47b601){return _0x7a049b['define']('SmsQueue',attributes,{'tableName':'sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 85f45eb..0e9f08c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7da7=['jayson/promise','client','http','defaults','redis','socket.io-emitter','./smsQueue.socket','register','request','then','info','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetSmsQueue','SmsQueue','findAll','options','where','attributes','limit','map','include','model','find','ShowSmsQueue','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x21863a,_0x2d8389){var _0x18d3b9=function(_0x4e0ca0){while(--_0x4e0ca0){_0x21863a['push'](_0x21863a['shift']());}};_0x18d3b9(++_0x2d8389);}(_0x7da7,0x70));var _0x77da=function(_0x19b84f,_0x48765e){_0x19b84f=_0x19b84f-0x0;var _0x18067b=_0x7da7[_0x19b84f];return _0x18067b;};'use strict';var _=require(_0x77da('0x0'));var util=require(_0x77da('0x1'));var moment=require('moment');var BPromise=require(_0x77da('0x2'));var rs=require(_0x77da('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x77da('0x4'))['db'];var utils=require(_0x77da('0x5'));var logger=require('../../config/logger')(_0x77da('0x6'));var config=require(_0x77da('0x7'));var jayson=require(_0x77da('0x8'));var client=jayson[_0x77da('0x9')][_0x77da('0xa')]({'port':0x232a});config['redis']=_[_0x77da('0xb')](config[_0x77da('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x77da('0xd'))(new Redis(config[_0x77da('0xc')]));require(_0x77da('0xe'))[_0x77da('0xf')](socket);function respondWithRpcPromise(_0x4b8772,_0x3dc1db,_0x505a0e){return new BPromise(function(_0x213762,_0x57deb8){return client[_0x77da('0x10')](_0x4b8772,_0x505a0e)[_0x77da('0x11')](function(_0x236de2){logger[_0x77da('0x12')](_0x77da('0x13'),_0x3dc1db,_0x77da('0x14'));logger[_0x77da('0x15')]('SmsQueue,\x20%s,\x20%s,\x20%s',_0x3dc1db,_0x77da('0x14'),JSON[_0x77da('0x16')](_0x236de2));if(_0x236de2[_0x77da('0x17')]){if(_0x236de2[_0x77da('0x17')][_0x77da('0x18')]===0x1f4){logger['error'](_0x77da('0x13'),_0x3dc1db,_0x236de2[_0x77da('0x17')][_0x77da('0x19')]);return _0x57deb8(_0x236de2['error'][_0x77da('0x19')]);}logger['error'](_0x77da('0x13'),_0x3dc1db,_0x236de2[_0x77da('0x17')][_0x77da('0x19')]);return _0x213762(_0x236de2[_0x77da('0x17')]['message']);}else{logger[_0x77da('0x12')]('SmsQueue,\x20%s,\x20%s',_0x3dc1db,'request\x20sent');_0x213762(_0x236de2[_0x77da('0x1a')][_0x77da('0x19')]);}})[_0x77da('0x1b')](function(_0x375564){logger[_0x77da('0x17')](_0x77da('0x13'),_0x3dc1db,_0x375564);_0x57deb8(_0x375564);});});}exports[_0x77da('0x1c')]=function(_0x21b209){var _0x80c7eb=this;return new Promise(function(_0x3ad026,_0x573207){return db[_0x77da('0x1d')][_0x77da('0x1e')]({'raw':_0x21b209[_0x77da('0x1f')]?_0x21b209[_0x77da('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x21b209['options']?_0x21b209['options'][_0x77da('0x20')]||null:null,'attributes':_0x21b209[_0x77da('0x1f')]?_0x21b209[_0x77da('0x1f')][_0x77da('0x21')]||null:null,'limit':_0x21b209['options']?_0x21b209[_0x77da('0x1f')][_0x77da('0x22')]||null:null,'include':_0x21b209['options']?_0x21b209['options']['include']?_[_0x77da('0x23')](_0x21b209[_0x77da('0x1f')][_0x77da('0x24')],function(_0x5b3e07){return{'model':db[_0x5b3e07[_0x77da('0x25')]],'as':_0x5b3e07['as'],'attributes':_0x5b3e07['attributes'],'include':_0x5b3e07[_0x77da('0x24')]?_['map'](_0x5b3e07[_0x77da('0x24')],function(_0x26c319){return{'model':db[_0x26c319[_0x77da('0x25')]],'as':_0x26c319['as'],'attributes':_0x26c319[_0x77da('0x21')],'include':_0x26c319[_0x77da('0x24')]?_['map'](_0x26c319[_0x77da('0x24')],function(_0x33ee2a){return{'model':db[_0x33ee2a[_0x77da('0x25')]],'as':_0x33ee2a['as'],'attributes':_0x33ee2a['attributes']};}):[]};}):[]};}):[]:[]})[_0x77da('0x11')](function(_0x302bfc){logger[_0x77da('0x12')](_0x77da('0x1c'),_0x21b209);logger[_0x77da('0x15')](_0x77da('0x1c'),_0x21b209,JSON[_0x77da('0x16')](_0x302bfc));_0x3ad026(_0x302bfc);})[_0x77da('0x1b')](function(_0xd045f1){logger[_0x77da('0x17')](_0x77da('0x1c'),_0xd045f1[_0x77da('0x19')],_0x21b209);_0x573207(_0x80c7eb[_0x77da('0x17')](0x1f4,_0xd045f1[_0x77da('0x19')]));});});};exports['ShowSmsQueue']=function(_0x21de8c){var _0x54d4b3=this;return new Promise(function(_0x2b746b,_0x30a8ee){return db['SmsQueue'][_0x77da('0x26')]({'raw':_0x21de8c['options']?_0x21de8c[_0x77da('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x21de8c['options']?_0x21de8c[_0x77da('0x1f')][_0x77da('0x20')]||null:null,'attributes':_0x21de8c[_0x77da('0x1f')]?_0x21de8c[_0x77da('0x1f')][_0x77da('0x21')]||null:null,'include':_0x21de8c[_0x77da('0x1f')]?_0x21de8c[_0x77da('0x1f')][_0x77da('0x24')]?_[_0x77da('0x23')](_0x21de8c[_0x77da('0x1f')]['include'],function(_0x3b7d58){return{'model':db[_0x3b7d58[_0x77da('0x25')]],'as':_0x3b7d58['as'],'attributes':_0x3b7d58['attributes'],'include':_0x3b7d58[_0x77da('0x24')]?_[_0x77da('0x23')](_0x3b7d58[_0x77da('0x24')],function(_0x58e3d3){return{'model':db[_0x58e3d3[_0x77da('0x25')]],'as':_0x58e3d3['as'],'attributes':_0x58e3d3[_0x77da('0x21')],'include':_0x58e3d3[_0x77da('0x24')]?_[_0x77da('0x23')](_0x58e3d3[_0x77da('0x24')],function(_0x5a413a){return{'model':db[_0x5a413a[_0x77da('0x25')]],'as':_0x5a413a['as'],'attributes':_0x5a413a['attributes']};}):[]};}):[]};}):[]:[]})[_0x77da('0x11')](function(_0x419d42){logger['info'](_0x77da('0x27'),_0x21de8c);logger[_0x77da('0x15')](_0x77da('0x27'),_0x21de8c,JSON[_0x77da('0x16')](_0x419d42));_0x2b746b(_0x419d42);})[_0x77da('0x1b')](function(_0x2e7054){logger[_0x77da('0x17')](_0x77da('0x27'),_0x2e7054[_0x77da('0x19')],_0x21de8c);_0x30a8ee(_0x54d4b3[_0x77da('0x17')](0x1f4,_0x2e7054[_0x77da('0x19')]));});});};
\ No newline at end of file
+var _0x11ee=['model','attributes','GetSmsQueue','ShowSmsQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./smsQueue.socket','register','request','then','info','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','SmsQueue','options','raw','where','include','map'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x11ee,0xf5));var _0xe11e=function(_0x427217,_0x4039b1){_0x427217=_0x427217-0x0;var _0x5b28fb=_0x11ee[_0x427217];return _0x5b28fb;};'use strict';var _=require(_0xe11e('0x0'));var util=require(_0xe11e('0x1'));var moment=require(_0xe11e('0x2'));var BPromise=require(_0xe11e('0x3'));var rs=require(_0xe11e('0x4'));var fs=require('fs');var Redis=require(_0xe11e('0x5'));var db=require(_0xe11e('0x6'))['db'];var utils=require(_0xe11e('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xe11e('0x8'));var jayson=require(_0xe11e('0x9'));var client=jayson[_0xe11e('0xa')]['http']({'port':0x232a});config[_0xe11e('0xb')]=_['defaults'](config[_0xe11e('0xb')],{'host':_0xe11e('0xc'),'port':0x18eb});var socket=require(_0xe11e('0xd'))(new Redis(config[_0xe11e('0xb')]));require(_0xe11e('0xe'))[_0xe11e('0xf')](socket);function respondWithRpcPromise(_0x7b2177,_0x38d87a,_0x668573){return new BPromise(function(_0x653545,_0x2e7e87){return client[_0xe11e('0x10')](_0x7b2177,_0x668573)[_0xe11e('0x11')](function(_0x2b20e0){logger[_0xe11e('0x12')](_0xe11e('0x13'),_0x38d87a,_0xe11e('0x14'));logger[_0xe11e('0x15')](_0xe11e('0x16'),_0x38d87a,_0xe11e('0x14'),JSON[_0xe11e('0x17')](_0x2b20e0));if(_0x2b20e0[_0xe11e('0x18')]){if(_0x2b20e0[_0xe11e('0x18')][_0xe11e('0x19')]===0x1f4){logger[_0xe11e('0x18')](_0xe11e('0x13'),_0x38d87a,_0x2b20e0[_0xe11e('0x18')]['message']);return _0x2e7e87(_0x2b20e0[_0xe11e('0x18')][_0xe11e('0x1a')]);}logger['error']('SmsQueue,\x20%s,\x20%s',_0x38d87a,_0x2b20e0['error'][_0xe11e('0x1a')]);return _0x653545(_0x2b20e0[_0xe11e('0x18')][_0xe11e('0x1a')]);}else{logger[_0xe11e('0x12')]('SmsQueue,\x20%s,\x20%s',_0x38d87a,_0xe11e('0x14'));_0x653545(_0x2b20e0[_0xe11e('0x1b')][_0xe11e('0x1a')]);}})[_0xe11e('0x1c')](function(_0x4098cf){logger[_0xe11e('0x18')]('SmsQueue,\x20%s,\x20%s',_0x38d87a,_0x4098cf);_0x2e7e87(_0x4098cf);});});}exports['GetSmsQueue']=function(_0x56c990){var _0x306a6e=this;return new Promise(function(_0x362600,_0xb7395a){return db[_0xe11e('0x1d')]['findAll']({'raw':_0x56c990[_0xe11e('0x1e')]?_0x56c990['options'][_0xe11e('0x1f')]===undefined?!![]:![]:!![],'where':_0x56c990[_0xe11e('0x1e')]?_0x56c990[_0xe11e('0x1e')][_0xe11e('0x20')]||null:null,'attributes':_0x56c990[_0xe11e('0x1e')]?_0x56c990[_0xe11e('0x1e')]['attributes']||null:null,'limit':_0x56c990['options']?_0x56c990['options']['limit']||null:null,'include':_0x56c990[_0xe11e('0x1e')]?_0x56c990[_0xe11e('0x1e')][_0xe11e('0x21')]?_[_0xe11e('0x22')](_0x56c990[_0xe11e('0x1e')][_0xe11e('0x21')],function(_0x531ae0){return{'model':db[_0x531ae0['model']],'as':_0x531ae0['as'],'attributes':_0x531ae0['attributes'],'include':_0x531ae0['include']?_[_0xe11e('0x22')](_0x531ae0[_0xe11e('0x21')],function(_0x2a815f){return{'model':db[_0x2a815f[_0xe11e('0x23')]],'as':_0x2a815f['as'],'attributes':_0x2a815f[_0xe11e('0x24')],'include':_0x2a815f['include']?_['map'](_0x2a815f[_0xe11e('0x21')],function(_0x92338a){return{'model':db[_0x92338a[_0xe11e('0x23')]],'as':_0x92338a['as'],'attributes':_0x92338a['attributes']};}):[]};}):[]};}):[]:[]})[_0xe11e('0x11')](function(_0xae7ecd){logger['info'](_0xe11e('0x25'),_0x56c990);logger[_0xe11e('0x15')]('GetSmsQueue',_0x56c990,JSON[_0xe11e('0x17')](_0xae7ecd));_0x362600(_0xae7ecd);})[_0xe11e('0x1c')](function(_0x28456a){logger['error'](_0xe11e('0x25'),_0x28456a[_0xe11e('0x1a')],_0x56c990);_0xb7395a(_0x306a6e[_0xe11e('0x18')](0x1f4,_0x28456a[_0xe11e('0x1a')]));});});};exports[_0xe11e('0x26')]=function(_0x3298d2){var _0x236b3e=this;return new Promise(function(_0x193649,_0x495f8c){return db[_0xe11e('0x1d')][_0xe11e('0x27')]({'raw':_0x3298d2[_0xe11e('0x1e')]?_0x3298d2[_0xe11e('0x1e')][_0xe11e('0x1f')]===undefined?!![]:![]:!![],'where':_0x3298d2[_0xe11e('0x1e')]?_0x3298d2[_0xe11e('0x1e')][_0xe11e('0x20')]||null:null,'attributes':_0x3298d2['options']?_0x3298d2['options'][_0xe11e('0x24')]||null:null,'include':_0x3298d2['options']?_0x3298d2[_0xe11e('0x1e')]['include']?_[_0xe11e('0x22')](_0x3298d2[_0xe11e('0x1e')]['include'],function(_0x3f5f4f){return{'model':db[_0x3f5f4f[_0xe11e('0x23')]],'as':_0x3f5f4f['as'],'attributes':_0x3f5f4f['attributes'],'include':_0x3f5f4f[_0xe11e('0x21')]?_['map'](_0x3f5f4f['include'],function(_0x9627f3){return{'model':db[_0x9627f3[_0xe11e('0x23')]],'as':_0x9627f3['as'],'attributes':_0x9627f3['attributes'],'include':_0x9627f3[_0xe11e('0x21')]?_[_0xe11e('0x22')](_0x9627f3[_0xe11e('0x21')],function(_0xc2d5f8){return{'model':db[_0xc2d5f8['model']],'as':_0xc2d5f8['as'],'attributes':_0xc2d5f8[_0xe11e('0x24')]};}):[]};}):[]};}):[]:[]})[_0xe11e('0x11')](function(_0x3a6cca){logger[_0xe11e('0x12')](_0xe11e('0x26'),_0x3298d2);logger['debug']('ShowSmsQueue',_0x3298d2,JSON[_0xe11e('0x17')](_0x3a6cca));_0x193649(_0x3a6cca);})[_0xe11e('0x1c')](function(_0x5cd9d0){logger[_0xe11e('0x18')](_0xe11e('0x26'),_0x5cd9d0[_0xe11e('0x1a')],_0x3298d2);_0x495f8c(_0x236b3e['error'](0x1f4,_0x5cd9d0[_0xe11e('0x1a')]));});});};
\ No newline at end of file
index 07806e3..d300d1e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x07a5=['update','emit','removeListener','register','length','smsQueue:','save','remove'];(function(_0x3e551f,_0x16fe50){var _0x363e1f=function(_0x249aea){while(--_0x249aea){_0x3e551f['push'](_0x3e551f['shift']());}};_0x363e1f(++_0x16fe50);}(_0x07a5,0xd6));var _0x507a=function(_0x2416b9,_0x313d5d){_0x2416b9=_0x2416b9-0x0;var _0x9eefeb=_0x07a5[_0x2416b9];return _0x9eefeb;};'use strict';var SmsQueueEvents=require('./smsQueue.events');var events=[_0x507a('0x0'),_0x507a('0x1'),_0x507a('0x2')];function createListener(_0x147886,_0x678f29){return function(_0x27a0fd){_0x678f29[_0x507a('0x3')](_0x147886,_0x27a0fd);};}function removeListener(_0x1ebf9a,_0x35b6dd){return function(){SmsQueueEvents[_0x507a('0x4')](_0x1ebf9a,_0x35b6dd);};}exports[_0x507a('0x5')]=function(_0x4b7f17){for(var _0x221148=0x0,_0x200004=events[_0x507a('0x6')];_0x221148<_0x200004;_0x221148++){var _0x539417=events[_0x221148];var _0x43466a=createListener(_0x507a('0x7')+_0x539417,_0x4b7f17);SmsQueueEvents['on'](_0x539417,_0x43466a);}};
\ No newline at end of file
+var _0xd826=['length','remove','update','emit'];(function(_0xd649da,_0x550951){var _0x59510c=function(_0xa5cb42){while(--_0xa5cb42){_0xd649da['push'](_0xd649da['shift']());}};_0x59510c(++_0x550951);}(_0xd826,0x89));var _0x6d82=function(_0x4c5e80,_0x4cc743){_0x4c5e80=_0x4c5e80-0x0;var _0x445cda=_0xd826[_0x4c5e80];return _0x445cda;};'use strict';var SmsQueueEvents=require('./smsQueue.events');var events=['save',_0x6d82('0x0'),_0x6d82('0x1')];function createListener(_0x2a1832,_0x5c713f){return function(_0x38629b){_0x5c713f[_0x6d82('0x2')](_0x2a1832,_0x38629b);};}function removeListener(_0x20a096,_0x4f8067){return function(){SmsQueueEvents['removeListener'](_0x20a096,_0x4f8067);};}exports['register']=function(_0x14349f){for(var _0x29d8fe=0x0,_0xd1febb=events[_0x6d82('0x3')];_0x29d8fe<_0xd1febb;_0x29d8fe++){var _0x80f8be=events[_0x29d8fe];var _0xe99613=createListener('smsQueue:'+_0x80f8be,_0x14349f);SmsQueueEvents['on'](_0x80f8be,_0xe99613);}};
\ No newline at end of file
index 3bb832b..2fe04d4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcf67=['util','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','post','create','put','/:id','update','delete','destroy','exports','multer'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xcf67,0x1ed));var _0x7cf6=function(_0xed5f9c,_0x5a25cd){_0xed5f9c=_0xed5f9c-0x0;var _0x3a1c43=_0xcf67[_0xed5f9c];return _0x3a1c43;};'use strict';var multer=require(_0x7cf6('0x0'));var util=require(_0x7cf6('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x7cf6('0x2'));var router=express['Router']();var fs_extra=require(_0x7cf6('0x3'));var auth=require(_0x7cf6('0x4'));var interaction=require(_0x7cf6('0x5'));var config=require(_0x7cf6('0x6'));var controller=require('./smsQueueReport.controller');router[_0x7cf6('0x7')]('/',auth['isAuthenticated'](),controller[_0x7cf6('0x8')]);router[_0x7cf6('0x7')](_0x7cf6('0x9'),auth[_0x7cf6('0xa')](),controller['describe']);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0x7cf6('0xb')]('/',auth[_0x7cf6('0xa')](),controller[_0x7cf6('0xc')]);router[_0x7cf6('0xd')](_0x7cf6('0xe'),auth[_0x7cf6('0xa')](),controller[_0x7cf6('0xf')]);router[_0x7cf6('0x10')](_0x7cf6('0xe'),auth[_0x7cf6('0xa')](),controller[_0x7cf6('0x11')]);module[_0x7cf6('0x12')]=router;
\ No newline at end of file
+var _0x0f42=['exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueueReport.controller','get','isAuthenticated','describe','/:id','show','post','create','put','delete','destroy'];(function(_0xfedc72,_0x292f02){var _0x2c7c78=function(_0x12fbf1){while(--_0x12fbf1){_0xfedc72['push'](_0xfedc72['shift']());}};_0x2c7c78(++_0x292f02);}(_0x0f42,0xc9));var _0x20f4=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x0f42[_0x13d07a];return _0x5ee0ee;};'use strict';var multer=require(_0x20f4('0x0'));var util=require(_0x20f4('0x1'));var path=require(_0x20f4('0x2'));var timeout=require(_0x20f4('0x3'));var express=require('express');var router=express[_0x20f4('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x20f4('0x5'));var interaction=require(_0x20f4('0x6'));var config=require(_0x20f4('0x7'));var controller=require(_0x20f4('0x8'));router[_0x20f4('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x20f4('0x9')]('/describe',auth[_0x20f4('0xa')](),controller[_0x20f4('0xb')]);router[_0x20f4('0x9')](_0x20f4('0xc'),auth[_0x20f4('0xa')](),controller[_0x20f4('0xd')]);router[_0x20f4('0xe')]('/',auth[_0x20f4('0xa')](),controller[_0x20f4('0xf')]);router[_0x20f4('0x10')]('/:id',auth[_0x20f4('0xa')](),controller['update']);router[_0x20f4('0x11')]('/:id',auth[_0x20f4('0xa')](),controller[_0x20f4('0x12')]);module[_0x20f4('0x13')]=router;
\ No newline at end of file
index 7ddad81..955da52 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x01ad=['DATE','STRING','moment','exports'];(function(_0x25897f,_0x10055e){var _0x2d0106=function(_0x599150){while(--_0x599150){_0x25897f['push'](_0x25897f['shift']());}};_0x2d0106(++_0x10055e);}(_0x01ad,0xd2));var _0xd01a=function(_0xdaf736,_0xd8c667){_0xdaf736=_0xdaf736-0x0;var _0x1090b3=_0x01ad[_0xdaf736];return _0x1090b3;};'use strict';var moment=require(_0xd01a('0x0'));var Sequelize=require('sequelize');module[_0xd01a('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xd01a('0x2')]},'leaveAt':{'type':Sequelize[_0xd01a('0x2')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xd01a('0x2')]},'reason':{'type':Sequelize[_0xd01a('0x3')]}};
\ No newline at end of file
+var _0x5388=['sequelize','STRING','DATE'];(function(_0x456032,_0x1a799d){var _0x1a53cd=function(_0x162cc8){while(--_0x162cc8){_0x456032['push'](_0x456032['shift']());}};_0x1a53cd(++_0x1a799d);}(_0x5388,0x159));var _0x8538=function(_0x18ce11,_0x135cc0){_0x18ce11=_0x18ce11-0x0;var _0x3bea1d=_0x5388[_0x18ce11];return _0x3bea1d;};'use strict';var moment=require('moment');var Sequelize=require(_0x8538('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x8538('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x8538('0x1')]},'joinAt':{'type':Sequelize[_0x8538('0x2')]},'leaveAt':{'type':Sequelize[_0x8538('0x2')]},'acceptAt':{'type':Sequelize[_0x8538('0x2')]},'exitAt':{'type':Sequelize[_0x8538('0x2')]},'reason':{'type':Sequelize[_0x8538('0x1')]}};
\ No newline at end of file
index a3f59c1..7f241fa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7647=['pick','filter','merge','includeAll','include','findAll','rows','catch','show','params','keys','options','create','body','find','describe','eml-format','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/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','update','then','destroy','error','stack','name','index','SmsQueueReport','rawAttributes','type','key','model','map','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters'];(function(_0x25d2fb,_0x18a774){var _0x1ded53=function(_0x4c0715){while(--_0x4c0715){_0x25d2fb['push'](_0x25d2fb['shift']());}};_0x1ded53(++_0x18a774);}(_0x7647,0xf7));var _0x7764=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x7647[_0x199572];return _0x13cfa3;};'use strict';var emlformat=require(_0x7764('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7764('0x1'));var jsonpatch=require(_0x7764('0x2'));var rp=require('request-promise');var moment=require(_0x7764('0x3'));var BPromise=require(_0x7764('0x4'));var Mustache=require('mustache');var util=require(_0x7764('0x5'));var path=require(_0x7764('0x6'));var sox=require(_0x7764('0x7'));var csv=require(_0x7764('0x8'));var ejs=require(_0x7764('0x9'));var fs=require('fs');var fs_extra=require(_0x7764('0xa'));var _=require(_0x7764('0xb'));var squel=require(_0x7764('0xc'));var crypto=require(_0x7764('0xd'));var jsforce=require(_0x7764('0xe'));var deskjs=require(_0x7764('0xf'));var toCsv=require(_0x7764('0x8'));var querystring=require(_0x7764('0x10'));var Papa=require(_0x7764('0x11'));var Redis=require('ioredis');var authService=require(_0x7764('0x12'));var qs=require(_0x7764('0x13'));var as=require(_0x7764('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7764('0x15'))(_0x7764('0x16'));var utils=require(_0x7764('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x7764('0x18'));var db=require(_0x7764('0x19'))['db'];function respondWithStatusCode(_0x4bca38,_0x4d2810){_0x4d2810=_0x4d2810||0xcc;return function(_0x4e08d7){if(_0x4e08d7){return _0x4bca38[_0x7764('0x1a')](_0x4d2810);}return _0x4bca38[_0x7764('0x1b')](_0x4d2810)[_0x7764('0x1c')]();};}function respondWithResult(_0x3be3e8,_0x5d2e5a){_0x5d2e5a=_0x5d2e5a||0xc8;return function(_0x4eeaa8){if(_0x4eeaa8){return _0x3be3e8['status'](_0x5d2e5a)[_0x7764('0x1d')](_0x4eeaa8);}};}function respondWithFilteredResult(_0x5701c5,_0x2bed1d){return function(_0x2c7ee7){if(_0x2c7ee7){var _0x2751b1=typeof _0x2bed1d[_0x7764('0x1e')]===_0x7764('0x1f')&&typeof _0x2bed1d['limit']==='undefined';var _0x2b3548=_0x2c7ee7[_0x7764('0x20')];var _0x59e1a0=_0x2751b1?0x0:_0x2bed1d[_0x7764('0x1e')];var _0x9abc79=_0x2751b1?_0x2c7ee7[_0x7764('0x20')]:_0x2bed1d[_0x7764('0x1e')]+_0x2bed1d[_0x7764('0x21')];var _0x41c6b1;if(_0x9abc79>=_0x2b3548){_0x9abc79=_0x2b3548;_0x41c6b1=0xc8;}else{_0x41c6b1=0xce;}_0x5701c5[_0x7764('0x1b')](_0x41c6b1);return _0x5701c5[_0x7764('0x22')](_0x7764('0x23'),_0x59e1a0+'-'+_0x9abc79+'/'+_0x2b3548)['json'](_0x2c7ee7);}return null;};}function patchUpdates(_0x1f34bb){return function(_0x387f57){try{jsonpatch[_0x7764('0x24')](_0x387f57,_0x1f34bb,!![]);}catch(_0x52abd3){return BPromise['reject'](_0x52abd3);}return _0x387f57['save']();};}function saveUpdates(_0x2eaab4,_0x4bea31){return function(_0x4f11e1){if(_0x4f11e1){return _0x4f11e1[_0x7764('0x25')](_0x2eaab4)[_0x7764('0x26')](function(_0x3ad6b2){return _0x3ad6b2;});}return null;};}function removeEntity(_0x18a7bf,_0x567f5c){return function(_0x51f319){if(_0x51f319){return _0x51f319[_0x7764('0x27')]()['then'](function(){_0x18a7bf['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1fde66,_0xd5763f){return function(_0x2f5466){if(!_0x2f5466){_0x1fde66[_0x7764('0x1a')](0x194);}return _0x2f5466;};}function handleError(_0xe19861,_0x362136){_0x362136=_0x362136||0x1f4;return function(_0x48e66c){logger[_0x7764('0x28')](_0x48e66c[_0x7764('0x29')]);if(_0x48e66c[_0x7764('0x2a')]){delete _0x48e66c[_0x7764('0x2a')];}_0xe19861[_0x7764('0x1b')](_0x362136)['send'](_0x48e66c);};}exports[_0x7764('0x2b')]=function(_0x353601,_0x551603){var _0x28516a={},_0x1b6393={},_0x11e37e={'count':0x0,'rows':[]};var _0x5f2e4a=_['map'](db[_0x7764('0x2c')][_0x7764('0x2d')],function(_0x224fa6){return{'name':_0x224fa6['fieldName'],'type':_0x224fa6[_0x7764('0x2e')][_0x7764('0x2f')]};});_0x1b6393[_0x7764('0x30')]=_[_0x7764('0x31')](_0x5f2e4a,_0x7764('0x2a'));_0x1b6393[_0x7764('0x32')]=_['keys'](_0x353601['query']);_0x1b6393['filters']=_['intersection'](_0x1b6393[_0x7764('0x30')],_0x1b6393[_0x7764('0x32')]);_0x28516a['attributes']=_[_0x7764('0x33')](_0x1b6393[_0x7764('0x30')],qs['fields'](_0x353601[_0x7764('0x32')][_0x7764('0x34')]));_0x28516a[_0x7764('0x35')]=_0x28516a[_0x7764('0x35')][_0x7764('0x36')]?_0x28516a[_0x7764('0x35')]:_0x1b6393[_0x7764('0x30')];if(!_0x353601['query'][_0x7764('0x37')](_0x7764('0x38'))){_0x28516a[_0x7764('0x21')]=qs[_0x7764('0x21')](_0x353601['query'][_0x7764('0x21')]);_0x28516a[_0x7764('0x1e')]=qs[_0x7764('0x1e')](_0x353601[_0x7764('0x32')][_0x7764('0x1e')]);}_0x28516a[_0x7764('0x39')]=qs[_0x7764('0x3a')](_0x353601[_0x7764('0x32')][_0x7764('0x3a')]);_0x28516a[_0x7764('0x3b')]=qs[_0x7764('0x3c')](_[_0x7764('0x3d')](_0x353601[_0x7764('0x32')],_0x1b6393[_0x7764('0x3c')]),_0x5f2e4a);if(_0x353601[_0x7764('0x32')]['filter']){_0x28516a[_0x7764('0x3b')]=_['merge'](_0x28516a['where'],{'$or':_[_0x7764('0x31')](_0x5f2e4a,function(_0x53b365){if(_0x53b365[_0x7764('0x2e')]!=='VIRTUAL'){var _0x1d424f={};_0x1d424f[_0x53b365[_0x7764('0x2a')]]={'$like':'%'+_0x353601[_0x7764('0x32')][_0x7764('0x3e')]+'%'};return _0x1d424f;}})});}_0x28516a=_[_0x7764('0x3f')]({},_0x28516a,_0x353601['options']);var _0x528435={'where':_0x28516a[_0x7764('0x3b')]};return db[_0x7764('0x2c')]['count'](_0x528435)[_0x7764('0x26')](function(_0x26bb3a){_0x11e37e[_0x7764('0x20')]=_0x26bb3a;if(_0x353601[_0x7764('0x32')][_0x7764('0x40')]){_0x28516a[_0x7764('0x41')]=[{'all':!![]}];}return db[_0x7764('0x2c')][_0x7764('0x42')](_0x28516a);})['then'](function(_0x4cec18){_0x11e37e[_0x7764('0x43')]=_0x4cec18;return _0x11e37e;})[_0x7764('0x26')](respondWithFilteredResult(_0x551603,_0x28516a))[_0x7764('0x44')](handleError(_0x551603,null));};exports[_0x7764('0x45')]=function(_0x5d6b57,_0x5531ad){var _0x3693d7={'raw':!![],'where':{'id':_0x5d6b57[_0x7764('0x46')]['id']}},_0xe0048b={};_0xe0048b[_0x7764('0x30')]=_[_0x7764('0x47')](db[_0x7764('0x2c')]['rawAttributes']);_0xe0048b[_0x7764('0x32')]=_[_0x7764('0x47')](_0x5d6b57[_0x7764('0x32')]);_0xe0048b[_0x7764('0x3c')]=_['intersection'](_0xe0048b[_0x7764('0x30')],_0xe0048b[_0x7764('0x32')]);_0x3693d7['attributes']=_[_0x7764('0x33')](_0xe0048b[_0x7764('0x30')],qs[_0x7764('0x34')](_0x5d6b57[_0x7764('0x32')][_0x7764('0x34')]));_0x3693d7['attributes']=_0x3693d7['attributes']['length']?_0x3693d7['attributes']:_0xe0048b[_0x7764('0x30')];if(_0x5d6b57[_0x7764('0x32')]['includeAll']){_0x3693d7[_0x7764('0x41')]=[{'all':!![]}];}_0x3693d7=_[_0x7764('0x3f')]({},_0x3693d7,_0x5d6b57[_0x7764('0x48')]);return db[_0x7764('0x2c')]['find'](_0x3693d7)[_0x7764('0x26')](handleEntityNotFound(_0x5531ad,null))[_0x7764('0x26')](respondWithResult(_0x5531ad,null))[_0x7764('0x44')](handleError(_0x5531ad,null));};exports[_0x7764('0x49')]=function(_0x34c1f4,_0x4289cd){return db['SmsQueueReport'][_0x7764('0x49')](_0x34c1f4[_0x7764('0x4a')],{})[_0x7764('0x26')](respondWithResult(_0x4289cd,0xc9))['catch'](handleError(_0x4289cd,null));};exports[_0x7764('0x25')]=function(_0x22e917,_0x3fc7d9){if(_0x22e917[_0x7764('0x4a')]['id']){delete _0x22e917[_0x7764('0x4a')]['id'];}return db[_0x7764('0x2c')]['find']({'where':{'id':_0x22e917[_0x7764('0x46')]['id']}})[_0x7764('0x26')](handleEntityNotFound(_0x3fc7d9,null))[_0x7764('0x26')](saveUpdates(_0x22e917['body'],null))[_0x7764('0x26')](respondWithResult(_0x3fc7d9,null))['catch'](handleError(_0x3fc7d9,null));};exports['destroy']=function(_0x423cf9,_0x546ad2){return db[_0x7764('0x2c')][_0x7764('0x4b')]({'where':{'id':_0x423cf9['params']['id']}})[_0x7764('0x26')](handleEntityNotFound(_0x546ad2,null))[_0x7764('0x26')](removeEntity(_0x546ad2,null))[_0x7764('0x44')](handleError(_0x546ad2,null));};exports[_0x7764('0x4c')]=function(_0x4799c0,_0x3ace00){return db[_0x7764('0x2c')][_0x7764('0x4c')]()[_0x7764('0x26')](respondWithResult(_0x3ace00,null))[_0x7764('0x44')](handleError(_0x3ace00,null));};
\ No newline at end of file
+var _0xb45f=['attributes','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','update','destroy','describe','eml-format','rimraf','zip-dir','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','then','error','stack','SmsQueueReport','rawAttributes','fieldName','type','key','model','map','name','query','keys','filters','intersection','fields'];(function(_0xc8a931,_0x260690){var _0x28bd27=function(_0x591b9f){while(--_0x591b9f){_0xc8a931['push'](_0xc8a931['shift']());}};_0x28bd27(++_0x260690);}(_0xb45f,0x147));var _0xfb45=function(_0x3e6b6a,_0x139e5a){_0x3e6b6a=_0x3e6b6a-0x0;var _0x571b54=_0xb45f[_0x3e6b6a];return _0x571b54;};'use strict';var emlformat=require(_0xfb45('0x0'));var rimraf=require(_0xfb45('0x1'));var zipdir=require(_0xfb45('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xfb45('0x3'));var BPromise=require(_0xfb45('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xfb45('0x5'));var sox=require(_0xfb45('0x6'));var csv=require(_0xfb45('0x7'));var ejs=require(_0xfb45('0x8'));var fs=require('fs');var fs_extra=require(_0xfb45('0x9'));var _=require(_0xfb45('0xa'));var squel=require('squel');var crypto=require(_0xfb45('0xb'));var jsforce=require(_0xfb45('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xfb45('0x7'));var querystring=require(_0xfb45('0xd'));var Papa=require(_0xfb45('0xe'));var Redis=require(_0xfb45('0xf'));var authService=require(_0xfb45('0x10'));var qs=require(_0xfb45('0x11'));var as=require(_0xfb45('0x12'));var hardwareService=require(_0xfb45('0x13'));var logger=require('../../config/logger')(_0xfb45('0x14'));var utils=require(_0xfb45('0x15'));var config=require(_0xfb45('0x16'));var licenseUtil=require(_0xfb45('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2a357b,_0x18713b){_0x18713b=_0x18713b||0xcc;return function(_0x1ff57a){if(_0x1ff57a){return _0x2a357b[_0xfb45('0x18')](_0x18713b);}return _0x2a357b[_0xfb45('0x19')](_0x18713b)[_0xfb45('0x1a')]();};}function respondWithResult(_0xcb87bf,_0x50e589){_0x50e589=_0x50e589||0xc8;return function(_0x10f854){if(_0x10f854){return _0xcb87bf[_0xfb45('0x19')](_0x50e589)['json'](_0x10f854);}};}function respondWithFilteredResult(_0x2877c4,_0x3e2c60){return function(_0x283c59){if(_0x283c59){var _0x4d8710=typeof _0x3e2c60[_0xfb45('0x1b')]===_0xfb45('0x1c')&&typeof _0x3e2c60[_0xfb45('0x1d')]==='undefined';var _0x33530d=_0x283c59[_0xfb45('0x1e')];var _0xdece6f=_0x4d8710?0x0:_0x3e2c60[_0xfb45('0x1b')];var _0x36581b=_0x4d8710?_0x283c59['count']:_0x3e2c60[_0xfb45('0x1b')]+_0x3e2c60[_0xfb45('0x1d')];var _0x267953;if(_0x36581b>=_0x33530d){_0x36581b=_0x33530d;_0x267953=0xc8;}else{_0x267953=0xce;}_0x2877c4[_0xfb45('0x19')](_0x267953);return _0x2877c4[_0xfb45('0x1f')](_0xfb45('0x20'),_0xdece6f+'-'+_0x36581b+'/'+_0x33530d)[_0xfb45('0x21')](_0x283c59);}return null;};}function patchUpdates(_0x4e190c){return function(_0x546aef){try{jsonpatch[_0xfb45('0x22')](_0x546aef,_0x4e190c,!![]);}catch(_0x288ab8){return BPromise[_0xfb45('0x23')](_0x288ab8);}return _0x546aef[_0xfb45('0x24')]();};}function saveUpdates(_0x41b2fb,_0x5cac2e){return function(_0xb8cd33){if(_0xb8cd33){return _0xb8cd33['update'](_0x41b2fb)['then'](function(_0x589731){return _0x589731;});}return null;};}function removeEntity(_0x225ab0,_0x2cf106){return function(_0x2da695){if(_0x2da695){return _0x2da695['destroy']()[_0xfb45('0x25')](function(){_0x225ab0[_0xfb45('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c7953,_0x40d09a){return function(_0x341c26){if(!_0x341c26){_0x3c7953['sendStatus'](0x194);}return _0x341c26;};}function handleError(_0x784e56,_0x46f6e4){_0x46f6e4=_0x46f6e4||0x1f4;return function(_0x3e38aa){logger[_0xfb45('0x26')](_0x3e38aa[_0xfb45('0x27')]);if(_0x3e38aa['name']){delete _0x3e38aa['name'];}_0x784e56['status'](_0x46f6e4)['send'](_0x3e38aa);};}exports['index']=function(_0x786e4a,_0x2ddfcb){var _0x2a1d54={},_0x33a67f={},_0x5e0d53={'count':0x0,'rows':[]};var _0x5ebdb5=_['map'](db[_0xfb45('0x28')][_0xfb45('0x29')],function(_0x2b323f){return{'name':_0x2b323f[_0xfb45('0x2a')],'type':_0x2b323f[_0xfb45('0x2b')][_0xfb45('0x2c')]};});_0x33a67f[_0xfb45('0x2d')]=_[_0xfb45('0x2e')](_0x5ebdb5,_0xfb45('0x2f'));_0x33a67f[_0xfb45('0x30')]=_[_0xfb45('0x31')](_0x786e4a[_0xfb45('0x30')]);_0x33a67f[_0xfb45('0x32')]=_[_0xfb45('0x33')](_0x33a67f[_0xfb45('0x2d')],_0x33a67f[_0xfb45('0x30')]);_0x2a1d54['attributes']=_[_0xfb45('0x33')](_0x33a67f[_0xfb45('0x2d')],qs[_0xfb45('0x34')](_0x786e4a[_0xfb45('0x30')]['fields']));_0x2a1d54[_0xfb45('0x35')]=_0x2a1d54['attributes'][_0xfb45('0x36')]?_0x2a1d54[_0xfb45('0x35')]:_0x33a67f[_0xfb45('0x2d')];if(!_0x786e4a['query'][_0xfb45('0x37')]('nolimit')){_0x2a1d54[_0xfb45('0x1d')]=qs['limit'](_0x786e4a['query'][_0xfb45('0x1d')]);_0x2a1d54[_0xfb45('0x1b')]=qs['offset'](_0x786e4a[_0xfb45('0x30')][_0xfb45('0x1b')]);}_0x2a1d54['order']=qs[_0xfb45('0x38')](_0x786e4a[_0xfb45('0x30')][_0xfb45('0x38')]);_0x2a1d54[_0xfb45('0x39')]=qs[_0xfb45('0x32')](_[_0xfb45('0x3a')](_0x786e4a[_0xfb45('0x30')],_0x33a67f[_0xfb45('0x32')]),_0x5ebdb5);if(_0x786e4a[_0xfb45('0x30')][_0xfb45('0x3b')]){_0x2a1d54[_0xfb45('0x39')]=_[_0xfb45('0x3c')](_0x2a1d54['where'],{'$or':_['map'](_0x5ebdb5,function(_0x5f0850){if(_0x5f0850[_0xfb45('0x2b')]!==_0xfb45('0x3d')){var _0x13f3a1={};_0x13f3a1[_0x5f0850[_0xfb45('0x2f')]]={'$like':'%'+_0x786e4a['query'][_0xfb45('0x3b')]+'%'};return _0x13f3a1;}})});}_0x2a1d54=_['merge']({},_0x2a1d54,_0x786e4a[_0xfb45('0x3e')]);var _0x40ffb3={'where':_0x2a1d54['where']};return db[_0xfb45('0x28')]['count'](_0x40ffb3)[_0xfb45('0x25')](function(_0x4bb39e){_0x5e0d53[_0xfb45('0x1e')]=_0x4bb39e;if(_0x786e4a[_0xfb45('0x30')][_0xfb45('0x3f')]){_0x2a1d54[_0xfb45('0x40')]=[{'all':!![]}];}return db['SmsQueueReport'][_0xfb45('0x41')](_0x2a1d54);})[_0xfb45('0x25')](function(_0x210694){_0x5e0d53[_0xfb45('0x42')]=_0x210694;return _0x5e0d53;})['then'](respondWithFilteredResult(_0x2ddfcb,_0x2a1d54))[_0xfb45('0x43')](handleError(_0x2ddfcb,null));};exports[_0xfb45('0x44')]=function(_0x515398,_0x9a3490){var _0x59dbe8={'raw':!![],'where':{'id':_0x515398[_0xfb45('0x45')]['id']}},_0x3aca5e={};_0x3aca5e[_0xfb45('0x2d')]=_[_0xfb45('0x31')](db[_0xfb45('0x28')][_0xfb45('0x29')]);_0x3aca5e[_0xfb45('0x30')]=_[_0xfb45('0x31')](_0x515398[_0xfb45('0x30')]);_0x3aca5e[_0xfb45('0x32')]=_[_0xfb45('0x33')](_0x3aca5e[_0xfb45('0x2d')],_0x3aca5e[_0xfb45('0x30')]);_0x59dbe8[_0xfb45('0x35')]=_['intersection'](_0x3aca5e['model'],qs[_0xfb45('0x34')](_0x515398['query'][_0xfb45('0x34')]));_0x59dbe8[_0xfb45('0x35')]=_0x59dbe8[_0xfb45('0x35')]['length']?_0x59dbe8[_0xfb45('0x35')]:_0x3aca5e[_0xfb45('0x2d')];if(_0x515398[_0xfb45('0x30')]['includeAll']){_0x59dbe8[_0xfb45('0x40')]=[{'all':!![]}];}_0x59dbe8=_[_0xfb45('0x3c')]({},_0x59dbe8,_0x515398['options']);return db[_0xfb45('0x28')][_0xfb45('0x46')](_0x59dbe8)[_0xfb45('0x25')](handleEntityNotFound(_0x9a3490,null))[_0xfb45('0x25')](respondWithResult(_0x9a3490,null))[_0xfb45('0x43')](handleError(_0x9a3490,null));};exports[_0xfb45('0x47')]=function(_0x39938d,_0x542228){return db[_0xfb45('0x28')][_0xfb45('0x47')](_0x39938d[_0xfb45('0x48')],{})[_0xfb45('0x25')](respondWithResult(_0x542228,0xc9))[_0xfb45('0x43')](handleError(_0x542228,null));};exports[_0xfb45('0x49')]=function(_0x5c39f9,_0x5cbe9b){if(_0x5c39f9[_0xfb45('0x48')]['id']){delete _0x5c39f9['body']['id'];}return db[_0xfb45('0x28')]['find']({'where':{'id':_0x5c39f9[_0xfb45('0x45')]['id']}})[_0xfb45('0x25')](handleEntityNotFound(_0x5cbe9b,null))[_0xfb45('0x25')](saveUpdates(_0x5c39f9['body'],null))[_0xfb45('0x25')](respondWithResult(_0x5cbe9b,null))[_0xfb45('0x43')](handleError(_0x5cbe9b,null));};exports[_0xfb45('0x4a')]=function(_0x3db2f1,_0x43b32c){return db['SmsQueueReport'][_0xfb45('0x46')]({'where':{'id':_0x3db2f1[_0xfb45('0x45')]['id']}})[_0xfb45('0x25')](handleEntityNotFound(_0x43b32c,null))[_0xfb45('0x25')](removeEntity(_0x43b32c,null))[_0xfb45('0x43')](handleError(_0x43b32c,null));};exports[_0xfb45('0x4b')]=function(_0x4bf2c0,_0x4f3ebd){return db[_0xfb45('0x28')]['describe']()['then'](respondWithResult(_0x4f3ebd,null))['catch'](handleError(_0x4f3ebd,null));};
\ No newline at end of file
index d6a85a1..6905728 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsQueueReport.attributes','exports','define','SmsQueueReport','report_sms_queue','uniqueid','lodash','util'];(function(_0x16a758,_0x1828b5){var _0x45168b=function(_0x4606df){while(--_0x4606df){_0x16a758['push'](_0x16a758['shift']());}};_0x45168b(++_0x1828b5);}(_0xe706,0xa3));var _0x6e70=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0xe706[_0x618414];return _0x21c19a;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));module[_0x6e70('0xa')]=function(_0x1b0389,_0x4381d1){return _0x1b0389[_0x6e70('0xb')](_0x6e70('0xc'),attributes,{'tableName':_0x6e70('0xd'),'paranoid':![],'indexes':[{'name':_0x6e70('0xe'),'fields':[_0x6e70('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xd8b0=['define','report_sms_queue','uniqueid','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x19311e,_0x4face1){var _0x363155=function(_0x55d6c7){while(--_0x55d6c7){_0x19311e['push'](_0x19311e['shift']());}};_0x363155(++_0x4face1);}(_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('./smsQueueReport.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('SmsQueueReport',attributes,{'tableName':_0x0d8b('0x8'),'paranoid':![],'indexes':[{'name':_0x0d8b('0x9'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
index bddf355..3440330 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5b8d=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','info','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','error','code','SmsQueueReport,\x20%s,\x20%s','message','catch','CreateSmsQueueReport','SmsQueueReport','options','raw','then','stringify','UpdateSmsQueueReport','update','body','where','limit','util','moment','randomstring','ioredis'];(function(_0x3d0308,_0x54a870){var _0x5adbae=function(_0x3a61af){while(--_0x3a61af){_0x3d0308['push'](_0x3d0308['shift']());}};_0x5adbae(++_0x54a870);}(_0x5b8d,0x182));var _0xd5b8=function(_0x5882ad,_0x1ce986){_0x5882ad=_0x5882ad-0x0;var _0x361c4c=_0x5b8d[_0x5882ad];return _0x361c4c;};'use strict';var _=require('lodash');var util=require(_0xd5b8('0x0'));var moment=require(_0xd5b8('0x1'));var BPromise=require('bluebird');var rs=require(_0xd5b8('0x2'));var fs=require('fs');var Redis=require(_0xd5b8('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xd5b8('0x4'));var logger=require(_0xd5b8('0x5'))('rpc');var config=require(_0xd5b8('0x6'));var jayson=require(_0xd5b8('0x7'));var client=jayson[_0xd5b8('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3017ce,_0x161b6e,_0x173e4b){return new BPromise(function(_0x11b347,_0x7ce965){return client[_0xd5b8('0x9')](_0x3017ce,_0x173e4b)['then'](function(_0x589dec){logger[_0xd5b8('0xa')]('SmsQueueReport,\x20%s,\x20%s',_0x161b6e,_0xd5b8('0xb'));logger[_0xd5b8('0xc')](_0xd5b8('0xd'),_0x161b6e,_0xd5b8('0xb'),JSON['stringify'](_0x589dec));if(_0x589dec[_0xd5b8('0xe')]){if(_0x589dec[_0xd5b8('0xe')][_0xd5b8('0xf')]===0x1f4){logger[_0xd5b8('0xe')](_0xd5b8('0x10'),_0x161b6e,_0x589dec[_0xd5b8('0xe')]['message']);return _0x7ce965(_0x589dec['error']['message']);}logger[_0xd5b8('0xe')]('SmsQueueReport,\x20%s,\x20%s',_0x161b6e,_0x589dec[_0xd5b8('0xe')]['message']);return _0x11b347(_0x589dec[_0xd5b8('0xe')][_0xd5b8('0x11')]);}else{logger[_0xd5b8('0xa')]('SmsQueueReport,\x20%s,\x20%s',_0x161b6e,_0xd5b8('0xb'));_0x11b347(_0x589dec['result'][_0xd5b8('0x11')]);}})[_0xd5b8('0x12')](function(_0x331922){logger[_0xd5b8('0xe')](_0xd5b8('0x10'),_0x161b6e,_0x331922);_0x7ce965(_0x331922);});});}exports[_0xd5b8('0x13')]=function(_0x5b718a){var _0x363963=this;return new Promise(function(_0x2fcd8a,_0x331fe4){return db[_0xd5b8('0x14')]['create'](_0x5b718a['body'],{'raw':_0x5b718a[_0xd5b8('0x15')]?_0x5b718a[_0xd5b8('0x15')][_0xd5b8('0x16')]===undefined?!![]:![]:!![]})[_0xd5b8('0x17')](function(_0x2b1bb7){logger[_0xd5b8('0xa')](_0xd5b8('0x13'),_0x5b718a);logger[_0xd5b8('0xc')](_0xd5b8('0x13'),_0x5b718a,JSON[_0xd5b8('0x18')](_0x2b1bb7));_0x2fcd8a(_0x2b1bb7);})[_0xd5b8('0x12')](function(_0x347c6a){logger[_0xd5b8('0xe')](_0xd5b8('0x13'),_0x347c6a[_0xd5b8('0x11')],_0x5b718a);_0x331fe4(_0x363963[_0xd5b8('0xe')](0x1f4,_0x347c6a[_0xd5b8('0x11')]));});});};exports[_0xd5b8('0x19')]=function(_0x5710f3){var _0x574a36=this;return new Promise(function(_0x47cc7a,_0x5e9d65){return db['SmsQueueReport'][_0xd5b8('0x1a')](_0x5710f3[_0xd5b8('0x1b')],{'raw':_0x5710f3[_0xd5b8('0x15')]?_0x5710f3[_0xd5b8('0x15')][_0xd5b8('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5710f3['options']?_0x5710f3[_0xd5b8('0x15')][_0xd5b8('0x1c')]||null:null,'attributes':_0x5710f3[_0xd5b8('0x15')]?_0x5710f3[_0xd5b8('0x15')]['attributes']||null:null,'limit':_0x5710f3[_0xd5b8('0x15')]?_0x5710f3[_0xd5b8('0x15')][_0xd5b8('0x1d')]||null:null})[_0xd5b8('0x17')](function(_0x5eabe7){logger[_0xd5b8('0xa')](_0xd5b8('0x19'),_0x5710f3);logger[_0xd5b8('0xc')](_0xd5b8('0x19'),_0x5710f3,JSON['stringify'](_0x5eabe7));_0x47cc7a(_0x5eabe7);})[_0xd5b8('0x12')](function(_0x449659){logger[_0xd5b8('0xe')](_0xd5b8('0x19'),_0x449659[_0xd5b8('0x11')],_0x5710f3);_0x5e9d65(_0x574a36[_0xd5b8('0xe')](0x1f4,_0x449659['message']));});});};
\ No newline at end of file
+var _0x7f32=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','error','code','SmsQueueReport,\x20%s,\x20%s','message','info','result','CreateSmsQueueReport','SmsQueueReport','create','body','options','catch','UpdateSmsQueueReport','update','where','attributes','limit','stringify','lodash','bluebird'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x7f32,0x174));var _0x27f3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7f32[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x27f3('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x27f3('0x1'));var rs=require(_0x27f3('0x2'));var fs=require('fs');var Redis=require(_0x27f3('0x3'));var db=require(_0x27f3('0x4'))['db'];var utils=require(_0x27f3('0x5'));var logger=require('../../config/logger')(_0x27f3('0x6'));var config=require(_0x27f3('0x7'));var jayson=require(_0x27f3('0x8'));var client=jayson[_0x27f3('0x9')][_0x27f3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3ba3d4,_0x250fd5,_0x400387){return new BPromise(function(_0x381f7a,_0x10d9c2){return client[_0x27f3('0xb')](_0x3ba3d4,_0x400387)[_0x27f3('0xc')](function(_0x1cec35){logger['info']('SmsQueueReport,\x20%s,\x20%s',_0x250fd5,_0x27f3('0xd'));logger[_0x27f3('0xe')](_0x27f3('0xf'),_0x250fd5,_0x27f3('0xd'),JSON['stringify'](_0x1cec35));if(_0x1cec35[_0x27f3('0x10')]){if(_0x1cec35['error'][_0x27f3('0x11')]===0x1f4){logger[_0x27f3('0x10')](_0x27f3('0x12'),_0x250fd5,_0x1cec35['error'][_0x27f3('0x13')]);return _0x10d9c2(_0x1cec35[_0x27f3('0x10')]['message']);}logger[_0x27f3('0x10')]('SmsQueueReport,\x20%s,\x20%s',_0x250fd5,_0x1cec35[_0x27f3('0x10')][_0x27f3('0x13')]);return _0x381f7a(_0x1cec35[_0x27f3('0x10')]['message']);}else{logger[_0x27f3('0x14')](_0x27f3('0x12'),_0x250fd5,_0x27f3('0xd'));_0x381f7a(_0x1cec35[_0x27f3('0x15')][_0x27f3('0x13')]);}})['catch'](function(_0x53e837){logger[_0x27f3('0x10')]('SmsQueueReport,\x20%s,\x20%s',_0x250fd5,_0x53e837);_0x10d9c2(_0x53e837);});});}exports[_0x27f3('0x16')]=function(_0x2aab48){var _0x214fcf=this;return new Promise(function(_0x2d54e6,_0x37290d){return db[_0x27f3('0x17')][_0x27f3('0x18')](_0x2aab48[_0x27f3('0x19')],{'raw':_0x2aab48[_0x27f3('0x1a')]?_0x2aab48[_0x27f3('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0x27f3('0xc')](function(_0x53ec17){logger[_0x27f3('0x14')]('CreateSmsQueueReport',_0x2aab48);logger[_0x27f3('0xe')]('CreateSmsQueueReport',_0x2aab48,JSON['stringify'](_0x53ec17));_0x2d54e6(_0x53ec17);})[_0x27f3('0x1b')](function(_0x30eac4){logger['error'](_0x27f3('0x16'),_0x30eac4[_0x27f3('0x13')],_0x2aab48);_0x37290d(_0x214fcf[_0x27f3('0x10')](0x1f4,_0x30eac4[_0x27f3('0x13')]));});});};exports[_0x27f3('0x1c')]=function(_0x4c7a61){var _0xa9e943=this;return new Promise(function(_0x4dad46,_0x20a39e){return db['SmsQueueReport'][_0x27f3('0x1d')](_0x4c7a61[_0x27f3('0x19')],{'raw':_0x4c7a61[_0x27f3('0x1a')]?_0x4c7a61['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4c7a61[_0x27f3('0x1a')]?_0x4c7a61[_0x27f3('0x1a')][_0x27f3('0x1e')]||null:null,'attributes':_0x4c7a61[_0x27f3('0x1a')]?_0x4c7a61['options'][_0x27f3('0x1f')]||null:null,'limit':_0x4c7a61[_0x27f3('0x1a')]?_0x4c7a61[_0x27f3('0x1a')][_0x27f3('0x20')]||null:null})[_0x27f3('0xc')](function(_0x2b2c38){logger[_0x27f3('0x14')]('UpdateSmsQueueReport',_0x4c7a61);logger['debug'](_0x27f3('0x1c'),_0x4c7a61,JSON[_0x27f3('0x21')](_0x2b2c38));_0x4dad46(_0x2b2c38);})[_0x27f3('0x1b')](function(_0x5359ab){logger[_0x27f3('0x10')](_0x27f3('0x1c'),_0x5359ab[_0x27f3('0x13')],_0x4c7a61);_0x20a39e(_0xa9e943[_0x27f3('0x10')](0x1f4,_0x5359ab[_0x27f3('0x13')]));});});};
\ No newline at end of file
index 257e8c4..4701d79 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8a28=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./smsTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','destroy'];(function(_0x3f7f44,_0x1a1a90){var _0x923127=function(_0x21c566){while(--_0x21c566){_0x3f7f44['push'](_0x3f7f44['shift']());}};_0x923127(++_0x1a1a90);}(_0x8a28,0xfd));var _0x88a2=function(_0x34021d,_0x753aa6){_0x34021d=_0x34021d-0x0;var _0x16597b=_0x8a28[_0x34021d];return _0x16597b;};'use strict';var multer=require(_0x88a2('0x0'));var util=require(_0x88a2('0x1'));var path=require(_0x88a2('0x2'));var timeout=require(_0x88a2('0x3'));var express=require(_0x88a2('0x4'));var router=express[_0x88a2('0x5')]();var fs_extra=require(_0x88a2('0x6'));var auth=require(_0x88a2('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x88a2('0x8'));var controller=require(_0x88a2('0x9'));router[_0x88a2('0xa')]('/',auth[_0x88a2('0xb')](),controller[_0x88a2('0xc')]);router['get'](_0x88a2('0xd'),auth['isAuthenticated'](),controller[_0x88a2('0xe')]);router[_0x88a2('0xa')](_0x88a2('0xf'),auth[_0x88a2('0xb')](),controller[_0x88a2('0x10')]);router[_0x88a2('0x11')]('/',auth[_0x88a2('0xb')](),controller[_0x88a2('0x12')]);router[_0x88a2('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x88a2('0x14')]);router[_0x88a2('0x15')](_0x88a2('0xf'),auth[_0x88a2('0xb')](),controller[_0x88a2('0x16')]);module['exports']=router;
\ No newline at end of file
+var _0x7d9f=['isAuthenticated','describe','/:id','show','post','put','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','index','get'];(function(_0x13e741,_0x5d3c24){var _0x3f8bb3=function(_0x4440a0){while(--_0x4440a0){_0x13e741['push'](_0x13e741['shift']());}};_0x3f8bb3(++_0x5d3c24);}(_0x7d9f,0x15c));var _0xf7d9=function(_0xcb56d2,_0x18c194){_0xcb56d2=_0xcb56d2-0x0;var _0x57bed4=_0x7d9f[_0xcb56d2];return _0x57bed4;};'use strict';var multer=require(_0xf7d9('0x0'));var util=require(_0xf7d9('0x1'));var path=require(_0xf7d9('0x2'));var timeout=require(_0xf7d9('0x3'));var express=require(_0xf7d9('0x4'));var router=express['Router']();var fs_extra=require(_0xf7d9('0x5'));var auth=require(_0xf7d9('0x6'));var interaction=require(_0xf7d9('0x7'));var config=require(_0xf7d9('0x8'));var controller=require(_0xf7d9('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0xf7d9('0xa')]);router[_0xf7d9('0xb')]('/describe',auth[_0xf7d9('0xc')](),controller[_0xf7d9('0xd')]);router['get'](_0xf7d9('0xe'),auth['isAuthenticated'](),controller[_0xf7d9('0xf')]);router[_0xf7d9('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0xf7d9('0x11')](_0xf7d9('0xe'),auth[_0xf7d9('0xc')](),controller['update']);router['delete'](_0xf7d9('0xe'),auth[_0xf7d9('0xc')](),controller[_0xf7d9('0x12')]);module[_0xf7d9('0x13')]=router;
\ No newline at end of file
index 626e848..93a15e8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0x1ea909,_0x19b136){var _0x279ef6=function(_0x3e0713){while(--_0x3e0713){_0x1ea909['push'](_0x1ea909['shift']());}};_0x279ef6(++_0x19b136);}(_0x70e0,0x17b));var _0x070e=function(_0x1a0a77,_0x169a7a){_0x1a0a77=_0x1a0a77-0x0;var _0x44a66c=_0x70e0[_0x1a0a77];return _0x44a66c;};'use strict';var moment=require(_0x070e('0x0'));var Sequelize=require(_0x070e('0x1'));module[_0x070e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x070e('0x3'),_0x070e('0x4'),_0x070e('0x5')),'allowNull':![],'defaultValue':_0x070e('0x5')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x070e('0x6')]}};
\ No newline at end of file
+var _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0x5562ee,_0x34876b){var _0x19d24e=function(_0x1aa944){while(--_0x1aa944){_0x5562ee['push'](_0x5562ee['shift']());}};_0x19d24e(++_0x34876b);}(_0x70e0,0x17b));var _0x070e=function(_0x4ea3e7,_0x2c59d4){_0x4ea3e7=_0x4ea3e7-0x0;var _0x2269eb=_0x70e0[_0x4ea3e7];return _0x2269eb;};'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 ef46302..8a9746f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1ee0=['fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','count','includeAll','include','findAll','rows','catch','show','params','length','create','body','find','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','set','Content-Range','reject','save','update','then','stack','name','index','map','SmsTransferReport','rawAttributes'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x1ee0,0xfb));var _0x01ee=function(_0x1988f1,_0x290a23){_0x1988f1=_0x1988f1-0x0;var _0x3c848e=_0x1ee0[_0x1988f1];return _0x3c848e;};'use strict';var emlformat=require(_0x01ee('0x0'));var rimraf=require(_0x01ee('0x1'));var zipdir=require(_0x01ee('0x2'));var jsonpatch=require(_0x01ee('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x01ee('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x01ee('0x5'));var csv=require('to-csv');var ejs=require(_0x01ee('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x01ee('0x7'));var squel=require(_0x01ee('0x8'));var crypto=require(_0x01ee('0x9'));var jsforce=require(_0x01ee('0xa'));var deskjs=require(_0x01ee('0xb'));var toCsv=require(_0x01ee('0xc'));var querystring=require(_0x01ee('0xd'));var Papa=require('papaparse');var Redis=require(_0x01ee('0xe'));var authService=require(_0x01ee('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x01ee('0x10'));var hardwareService=require(_0x01ee('0x11'));var logger=require('../../config/logger')(_0x01ee('0x12'));var utils=require(_0x01ee('0x13'));var config=require(_0x01ee('0x14'));var licenseUtil=require(_0x01ee('0x15'));var db=require(_0x01ee('0x16'))['db'];function respondWithStatusCode(_0x23f84e,_0x2dfa7e){_0x2dfa7e=_0x2dfa7e||0xcc;return function(_0x35010a){if(_0x35010a){return _0x23f84e[_0x01ee('0x17')](_0x2dfa7e);}return _0x23f84e[_0x01ee('0x18')](_0x2dfa7e)[_0x01ee('0x19')]();};}function respondWithResult(_0x1ed127,_0x1a21f3){_0x1a21f3=_0x1a21f3||0xc8;return function(_0x2cb1a5){if(_0x2cb1a5){return _0x1ed127[_0x01ee('0x18')](_0x1a21f3)['json'](_0x2cb1a5);}};}function respondWithFilteredResult(_0x37e0ee,_0x17488c){return function(_0x411864){if(_0x411864){var _0x15567e=typeof _0x17488c[_0x01ee('0x1a')]===_0x01ee('0x1b')&&typeof _0x17488c[_0x01ee('0x1c')]==='undefined';var _0x4f0e61=_0x411864['count'];var _0x44e910=_0x15567e?0x0:_0x17488c[_0x01ee('0x1a')];var _0x8718e4=_0x15567e?_0x411864['count']:_0x17488c['offset']+_0x17488c[_0x01ee('0x1c')];var _0x529184;if(_0x8718e4>=_0x4f0e61){_0x8718e4=_0x4f0e61;_0x529184=0xc8;}else{_0x529184=0xce;}_0x37e0ee[_0x01ee('0x18')](_0x529184);return _0x37e0ee[_0x01ee('0x1d')](_0x01ee('0x1e'),_0x44e910+'-'+_0x8718e4+'/'+_0x4f0e61)['json'](_0x411864);}return null;};}function patchUpdates(_0x36a1ea){return function(_0x2e0ee1){try{jsonpatch['apply'](_0x2e0ee1,_0x36a1ea,!![]);}catch(_0x1b53ce){return BPromise[_0x01ee('0x1f')](_0x1b53ce);}return _0x2e0ee1[_0x01ee('0x20')]();};}function saveUpdates(_0x197a67,_0x3daca4){return function(_0xca3563){if(_0xca3563){return _0xca3563[_0x01ee('0x21')](_0x197a67)[_0x01ee('0x22')](function(_0x51c71e){return _0x51c71e;});}return null;};}function removeEntity(_0x4da6a2,_0x2ce82f){return function(_0x33f6f0){if(_0x33f6f0){return _0x33f6f0['destroy']()[_0x01ee('0x22')](function(){_0x4da6a2[_0x01ee('0x18')](0xcc)[_0x01ee('0x19')]();});}};}function handleEntityNotFound(_0x1ac704,_0x5b290e){return function(_0x268774){if(!_0x268774){_0x1ac704[_0x01ee('0x17')](0x194);}return _0x268774;};}function handleError(_0x1f5c0b,_0x33f34a){_0x33f34a=_0x33f34a||0x1f4;return function(_0x207364){logger['error'](_0x207364[_0x01ee('0x23')]);if(_0x207364[_0x01ee('0x24')]){delete _0x207364[_0x01ee('0x24')];}_0x1f5c0b[_0x01ee('0x18')](_0x33f34a)['send'](_0x207364);};}exports[_0x01ee('0x25')]=function(_0xc385f2,_0xa103ff){var _0x58ecd7={},_0x3aaa04={},_0x10adc1={'count':0x0,'rows':[]};var _0x451323=_[_0x01ee('0x26')](db[_0x01ee('0x27')][_0x01ee('0x28')],function(_0x7130d4){return{'name':_0x7130d4[_0x01ee('0x29')],'type':_0x7130d4[_0x01ee('0x2a')][_0x01ee('0x2b')]};});_0x3aaa04[_0x01ee('0x2c')]=_[_0x01ee('0x26')](_0x451323,_0x01ee('0x24'));_0x3aaa04['query']=_[_0x01ee('0x2d')](_0xc385f2['query']);_0x3aaa04[_0x01ee('0x2e')]=_[_0x01ee('0x2f')](_0x3aaa04['model'],_0x3aaa04[_0x01ee('0x30')]);_0x58ecd7[_0x01ee('0x31')]=_[_0x01ee('0x2f')](_0x3aaa04[_0x01ee('0x2c')],qs[_0x01ee('0x32')](_0xc385f2[_0x01ee('0x30')][_0x01ee('0x32')]));_0x58ecd7['attributes']=_0x58ecd7['attributes']['length']?_0x58ecd7['attributes']:_0x3aaa04[_0x01ee('0x2c')];if(!_0xc385f2[_0x01ee('0x30')][_0x01ee('0x33')](_0x01ee('0x34'))){_0x58ecd7['limit']=qs['limit'](_0xc385f2[_0x01ee('0x30')][_0x01ee('0x1c')]);_0x58ecd7[_0x01ee('0x1a')]=qs[_0x01ee('0x1a')](_0xc385f2[_0x01ee('0x30')][_0x01ee('0x1a')]);}_0x58ecd7['order']=qs['sort'](_0xc385f2[_0x01ee('0x30')][_0x01ee('0x35')]);_0x58ecd7[_0x01ee('0x36')]=qs[_0x01ee('0x2e')](_[_0x01ee('0x37')](_0xc385f2[_0x01ee('0x30')],_0x3aaa04[_0x01ee('0x2e')]),_0x451323);if(_0xc385f2[_0x01ee('0x30')]['filter']){_0x58ecd7[_0x01ee('0x36')]=_['merge'](_0x58ecd7['where'],{'$or':_[_0x01ee('0x26')](_0x451323,function(_0x2f9b00){if(_0x2f9b00['type']!=='VIRTUAL'){var _0x23a5f2={};_0x23a5f2[_0x2f9b00[_0x01ee('0x24')]]={'$like':'%'+_0xc385f2[_0x01ee('0x30')][_0x01ee('0x38')]+'%'};return _0x23a5f2;}})});}_0x58ecd7=_[_0x01ee('0x39')]({},_0x58ecd7,_0xc385f2[_0x01ee('0x3a')]);var _0x141448={'where':_0x58ecd7[_0x01ee('0x36')]};return db[_0x01ee('0x27')][_0x01ee('0x3b')](_0x141448)[_0x01ee('0x22')](function(_0x447a0c){_0x10adc1['count']=_0x447a0c;if(_0xc385f2[_0x01ee('0x30')][_0x01ee('0x3c')]){_0x58ecd7[_0x01ee('0x3d')]=[{'all':!![]}];}return db[_0x01ee('0x27')][_0x01ee('0x3e')](_0x58ecd7);})[_0x01ee('0x22')](function(_0x44c5a9){_0x10adc1[_0x01ee('0x3f')]=_0x44c5a9;return _0x10adc1;})[_0x01ee('0x22')](respondWithFilteredResult(_0xa103ff,_0x58ecd7))[_0x01ee('0x40')](handleError(_0xa103ff,null));};exports[_0x01ee('0x41')]=function(_0x3b2910,_0x5967cc){var _0x1b4420={'raw':!![],'where':{'id':_0x3b2910[_0x01ee('0x42')]['id']}},_0x20ebae={};_0x20ebae[_0x01ee('0x2c')]=_[_0x01ee('0x2d')](db[_0x01ee('0x27')][_0x01ee('0x28')]);_0x20ebae[_0x01ee('0x30')]=_['keys'](_0x3b2910['query']);_0x20ebae['filters']=_[_0x01ee('0x2f')](_0x20ebae[_0x01ee('0x2c')],_0x20ebae[_0x01ee('0x30')]);_0x1b4420[_0x01ee('0x31')]=_[_0x01ee('0x2f')](_0x20ebae['model'],qs[_0x01ee('0x32')](_0x3b2910[_0x01ee('0x30')][_0x01ee('0x32')]));_0x1b4420[_0x01ee('0x31')]=_0x1b4420['attributes'][_0x01ee('0x43')]?_0x1b4420[_0x01ee('0x31')]:_0x20ebae[_0x01ee('0x2c')];if(_0x3b2910[_0x01ee('0x30')][_0x01ee('0x3c')]){_0x1b4420['include']=[{'all':!![]}];}_0x1b4420=_[_0x01ee('0x39')]({},_0x1b4420,_0x3b2910[_0x01ee('0x3a')]);return db[_0x01ee('0x27')]['find'](_0x1b4420)['then'](handleEntityNotFound(_0x5967cc,null))[_0x01ee('0x22')](respondWithResult(_0x5967cc,null))[_0x01ee('0x40')](handleError(_0x5967cc,null));};exports[_0x01ee('0x44')]=function(_0x449dab,_0x5ef2e7){return db['SmsTransferReport'][_0x01ee('0x44')](_0x449dab[_0x01ee('0x45')],{})[_0x01ee('0x22')](respondWithResult(_0x5ef2e7,0xc9))[_0x01ee('0x40')](handleError(_0x5ef2e7,null));};exports[_0x01ee('0x21')]=function(_0xc3a7cc,_0x32373c){if(_0xc3a7cc[_0x01ee('0x45')]['id']){delete _0xc3a7cc['body']['id'];}return db[_0x01ee('0x27')][_0x01ee('0x46')]({'where':{'id':_0xc3a7cc[_0x01ee('0x42')]['id']}})[_0x01ee('0x22')](handleEntityNotFound(_0x32373c,null))[_0x01ee('0x22')](saveUpdates(_0xc3a7cc[_0x01ee('0x45')],null))[_0x01ee('0x22')](respondWithResult(_0x32373c,null))[_0x01ee('0x40')](handleError(_0x32373c,null));};exports[_0x01ee('0x47')]=function(_0x3996ff,_0x2bae23){return db[_0x01ee('0x27')][_0x01ee('0x46')]({'where':{'id':_0x3996ff[_0x01ee('0x42')]['id']}})[_0x01ee('0x22')](handleEntityNotFound(_0x2bae23,null))[_0x01ee('0x22')](removeEntity(_0x2bae23,null))['catch'](handleError(_0x2bae23,null));};exports[_0x01ee('0x48')]=function(_0x2efff2,_0x2dc808){return db[_0x01ee('0x27')]['describe']()[_0x01ee('0x22')](respondWithResult(_0x2dc808,null))['catch'](handleError(_0x2dc808,null));};
\ No newline at end of file
+var _0xeaf3=['fields','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','keys','find','create','update','body','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','destroy','then','end','name','index','map','SmsTransferReport','rawAttributes','fieldName','type','model','query','filters','intersection','attributes'];(function(_0x345b41,_0x56502f){var _0x20ca7e=function(_0x336530){while(--_0x336530){_0x345b41['push'](_0x345b41['shift']());}};_0x20ca7e(++_0x56502f);}(_0xeaf3,0x1cd));var _0x3eaf=function(_0xb2faaa,_0x4c913a){_0xb2faaa=_0xb2faaa-0x0;var _0x3b3602=_0xeaf3[_0xb2faaa];return _0x3b3602;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3eaf('0x0'));var jsonpatch=require(_0x3eaf('0x1'));var rp=require(_0x3eaf('0x2'));var moment=require(_0x3eaf('0x3'));var BPromise=require(_0x3eaf('0x4'));var Mustache=require('mustache');var util=require(_0x3eaf('0x5'));var path=require(_0x3eaf('0x6'));var sox=require(_0x3eaf('0x7'));var csv=require(_0x3eaf('0x8'));var ejs=require(_0x3eaf('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x3eaf('0xa'));var deskjs=require(_0x3eaf('0xb'));var toCsv=require(_0x3eaf('0x8'));var querystring=require(_0x3eaf('0xc'));var Papa=require(_0x3eaf('0xd'));var Redis=require(_0x3eaf('0xe'));var authService=require(_0x3eaf('0xf'));var qs=require(_0x3eaf('0x10'));var as=require(_0x3eaf('0x11'));var hardwareService=require(_0x3eaf('0x12'));var logger=require(_0x3eaf('0x13'))(_0x3eaf('0x14'));var utils=require('../../config/utils');var config=require(_0x3eaf('0x15'));var licenseUtil=require(_0x3eaf('0x16'));var db=require(_0x3eaf('0x17'))['db'];function respondWithStatusCode(_0x384799,_0x8e9f10){_0x8e9f10=_0x8e9f10||0xcc;return function(_0x564e23){if(_0x564e23){return _0x384799[_0x3eaf('0x18')](_0x8e9f10);}return _0x384799['status'](_0x8e9f10)['end']();};}function respondWithResult(_0x96fd49,_0x4183a9){_0x4183a9=_0x4183a9||0xc8;return function(_0x55daa8){if(_0x55daa8){return _0x96fd49[_0x3eaf('0x19')](_0x4183a9)['json'](_0x55daa8);}};}function respondWithFilteredResult(_0x471329,_0x4cdb46){return function(_0x40aed4){if(_0x40aed4){var _0x4e6ccf=typeof _0x4cdb46[_0x3eaf('0x1a')]===_0x3eaf('0x1b')&&typeof _0x4cdb46[_0x3eaf('0x1c')]===_0x3eaf('0x1b');var _0x24f1e4=_0x40aed4[_0x3eaf('0x1d')];var _0x74297f=_0x4e6ccf?0x0:_0x4cdb46['offset'];var _0x1f5116=_0x4e6ccf?_0x40aed4[_0x3eaf('0x1d')]:_0x4cdb46[_0x3eaf('0x1a')]+_0x4cdb46[_0x3eaf('0x1c')];var _0xc630e6;if(_0x1f5116>=_0x24f1e4){_0x1f5116=_0x24f1e4;_0xc630e6=0xc8;}else{_0xc630e6=0xce;}_0x471329[_0x3eaf('0x19')](_0xc630e6);return _0x471329[_0x3eaf('0x1e')](_0x3eaf('0x1f'),_0x74297f+'-'+_0x1f5116+'/'+_0x24f1e4)[_0x3eaf('0x20')](_0x40aed4);}return null;};}function patchUpdates(_0x3aba68){return function(_0x1963e2){try{jsonpatch[_0x3eaf('0x21')](_0x1963e2,_0x3aba68,!![]);}catch(_0x5c17d7){return BPromise[_0x3eaf('0x22')](_0x5c17d7);}return _0x1963e2['save']();};}function saveUpdates(_0x52e943,_0x55d263){return function(_0x51986a){if(_0x51986a){return _0x51986a['update'](_0x52e943)['then'](function(_0x3d74d7){return _0x3d74d7;});}return null;};}function removeEntity(_0x83eb7a,_0x6e6fbd){return function(_0x3e8f98){if(_0x3e8f98){return _0x3e8f98[_0x3eaf('0x23')]()[_0x3eaf('0x24')](function(){_0x83eb7a['status'](0xcc)[_0x3eaf('0x25')]();});}};}function handleEntityNotFound(_0x37d59f,_0x533318){return function(_0x4af317){if(!_0x4af317){_0x37d59f[_0x3eaf('0x18')](0x194);}return _0x4af317;};}function handleError(_0x21a1b9,_0xea0baf){_0xea0baf=_0xea0baf||0x1f4;return function(_0x2cc0e2){logger['error'](_0x2cc0e2['stack']);if(_0x2cc0e2[_0x3eaf('0x26')]){delete _0x2cc0e2['name'];}_0x21a1b9[_0x3eaf('0x19')](_0xea0baf)['send'](_0x2cc0e2);};}exports[_0x3eaf('0x27')]=function(_0x160c36,_0x35a3c9){var _0x3202ae={},_0x1fe50b={},_0x5ed880={'count':0x0,'rows':[]};var _0x36f158=_[_0x3eaf('0x28')](db[_0x3eaf('0x29')][_0x3eaf('0x2a')],function(_0x13dfa8){return{'name':_0x13dfa8[_0x3eaf('0x2b')],'type':_0x13dfa8[_0x3eaf('0x2c')]['key']};});_0x1fe50b[_0x3eaf('0x2d')]=_[_0x3eaf('0x28')](_0x36f158,_0x3eaf('0x26'));_0x1fe50b[_0x3eaf('0x2e')]=_['keys'](_0x160c36[_0x3eaf('0x2e')]);_0x1fe50b[_0x3eaf('0x2f')]=_[_0x3eaf('0x30')](_0x1fe50b[_0x3eaf('0x2d')],_0x1fe50b[_0x3eaf('0x2e')]);_0x3202ae[_0x3eaf('0x31')]=_[_0x3eaf('0x30')](_0x1fe50b[_0x3eaf('0x2d')],qs[_0x3eaf('0x32')](_0x160c36['query'][_0x3eaf('0x32')]));_0x3202ae[_0x3eaf('0x31')]=_0x3202ae[_0x3eaf('0x31')][_0x3eaf('0x33')]?_0x3202ae[_0x3eaf('0x31')]:_0x1fe50b[_0x3eaf('0x2d')];if(!_0x160c36[_0x3eaf('0x2e')]['hasOwnProperty'](_0x3eaf('0x34'))){_0x3202ae[_0x3eaf('0x1c')]=qs[_0x3eaf('0x1c')](_0x160c36['query']['limit']);_0x3202ae[_0x3eaf('0x1a')]=qs[_0x3eaf('0x1a')](_0x160c36[_0x3eaf('0x2e')][_0x3eaf('0x1a')]);}_0x3202ae[_0x3eaf('0x35')]=qs[_0x3eaf('0x36')](_0x160c36[_0x3eaf('0x2e')]['sort']);_0x3202ae[_0x3eaf('0x37')]=qs[_0x3eaf('0x2f')](_[_0x3eaf('0x38')](_0x160c36[_0x3eaf('0x2e')],_0x1fe50b['filters']),_0x36f158);if(_0x160c36[_0x3eaf('0x2e')][_0x3eaf('0x39')]){_0x3202ae[_0x3eaf('0x37')]=_['merge'](_0x3202ae[_0x3eaf('0x37')],{'$or':_['map'](_0x36f158,function(_0x5d3a56){if(_0x5d3a56[_0x3eaf('0x2c')]!==_0x3eaf('0x3a')){var _0x1e4561={};_0x1e4561[_0x5d3a56[_0x3eaf('0x26')]]={'$like':'%'+_0x160c36['query'][_0x3eaf('0x39')]+'%'};return _0x1e4561;}})});}_0x3202ae=_[_0x3eaf('0x3b')]({},_0x3202ae,_0x160c36['options']);var _0x14ff2d={'where':_0x3202ae['where']};return db[_0x3eaf('0x29')][_0x3eaf('0x1d')](_0x14ff2d)[_0x3eaf('0x24')](function(_0x19e4f6){_0x5ed880[_0x3eaf('0x1d')]=_0x19e4f6;if(_0x160c36[_0x3eaf('0x2e')][_0x3eaf('0x3c')]){_0x3202ae[_0x3eaf('0x3d')]=[{'all':!![]}];}return db[_0x3eaf('0x29')][_0x3eaf('0x3e')](_0x3202ae);})['then'](function(_0x3e14fc){_0x5ed880[_0x3eaf('0x3f')]=_0x3e14fc;return _0x5ed880;})['then'](respondWithFilteredResult(_0x35a3c9,_0x3202ae))[_0x3eaf('0x40')](handleError(_0x35a3c9,null));};exports[_0x3eaf('0x41')]=function(_0x5b9a61,_0x3360c0){var _0x1f4b46={'raw':!![],'where':{'id':_0x5b9a61[_0x3eaf('0x42')]['id']}},_0x274d3b={};_0x274d3b['model']=_[_0x3eaf('0x43')](db[_0x3eaf('0x29')][_0x3eaf('0x2a')]);_0x274d3b['query']=_[_0x3eaf('0x43')](_0x5b9a61[_0x3eaf('0x2e')]);_0x274d3b[_0x3eaf('0x2f')]=_[_0x3eaf('0x30')](_0x274d3b[_0x3eaf('0x2d')],_0x274d3b['query']);_0x1f4b46[_0x3eaf('0x31')]=_[_0x3eaf('0x30')](_0x274d3b[_0x3eaf('0x2d')],qs[_0x3eaf('0x32')](_0x5b9a61[_0x3eaf('0x2e')][_0x3eaf('0x32')]));_0x1f4b46[_0x3eaf('0x31')]=_0x1f4b46[_0x3eaf('0x31')][_0x3eaf('0x33')]?_0x1f4b46[_0x3eaf('0x31')]:_0x274d3b[_0x3eaf('0x2d')];if(_0x5b9a61['query'][_0x3eaf('0x3c')]){_0x1f4b46[_0x3eaf('0x3d')]=[{'all':!![]}];}_0x1f4b46=_[_0x3eaf('0x3b')]({},_0x1f4b46,_0x5b9a61['options']);return db[_0x3eaf('0x29')][_0x3eaf('0x44')](_0x1f4b46)[_0x3eaf('0x24')](handleEntityNotFound(_0x3360c0,null))[_0x3eaf('0x24')](respondWithResult(_0x3360c0,null))['catch'](handleError(_0x3360c0,null));};exports[_0x3eaf('0x45')]=function(_0x46152c,_0x4e30de){return db[_0x3eaf('0x29')]['create'](_0x46152c['body'],{})[_0x3eaf('0x24')](respondWithResult(_0x4e30de,0xc9))[_0x3eaf('0x40')](handleError(_0x4e30de,null));};exports[_0x3eaf('0x46')]=function(_0x535d10,_0x156e0d){if(_0x535d10[_0x3eaf('0x47')]['id']){delete _0x535d10[_0x3eaf('0x47')]['id'];}return db[_0x3eaf('0x29')][_0x3eaf('0x44')]({'where':{'id':_0x535d10[_0x3eaf('0x42')]['id']}})[_0x3eaf('0x24')](handleEntityNotFound(_0x156e0d,null))[_0x3eaf('0x24')](saveUpdates(_0x535d10['body'],null))[_0x3eaf('0x24')](respondWithResult(_0x156e0d,null))['catch'](handleError(_0x156e0d,null));};exports[_0x3eaf('0x23')]=function(_0x21f6a7,_0x4fdf38){return db[_0x3eaf('0x29')][_0x3eaf('0x44')]({'where':{'id':_0x21f6a7[_0x3eaf('0x42')]['id']}})[_0x3eaf('0x24')](handleEntityNotFound(_0x4fdf38,null))[_0x3eaf('0x24')](removeEntity(_0x4fdf38,null))['catch'](handleError(_0x4fdf38,null));};exports[_0x3eaf('0x48')]=function(_0x52e944,_0x5b1bae){return db[_0x3eaf('0x29')][_0x3eaf('0x48')]()[_0x3eaf('0x24')](respondWithResult(_0x5b1bae,null))[_0x3eaf('0x40')](handleError(_0x5b1bae,null));};
\ No newline at end of file
index 35dca3e..85cbbe6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcda7=['request-promise','path','rimraf','../../config/environment','exports','SmsTransferReport','report_sms_transfer','uniqueid','api','moment','bluebird'];(function(_0x339e71,_0x7c414a){var _0x58d0e5=function(_0x4fb1e4){while(--_0x4fb1e4){_0x339e71['push'](_0x339e71['shift']());}};_0x58d0e5(++_0x7c414a);}(_0xcda7,0xce));var _0x7cda=function(_0x380e14,_0x5a4ed7){_0x380e14=_0x380e14-0x0;var _0x3b9474=_0xcda7[_0x380e14];return _0x3b9474;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x7cda('0x0'));var moment=require(_0x7cda('0x1'));var BPromise=require(_0x7cda('0x2'));var rp=require(_0x7cda('0x3'));var fs=require('fs');var path=require(_0x7cda('0x4'));var rimraf=require(_0x7cda('0x5'));var config=require(_0x7cda('0x6'));var attributes=require('./smsTransferReport.attributes');module[_0x7cda('0x7')]=function(_0x369ad3,_0x5699e5){return _0x369ad3['define'](_0x7cda('0x8'),attributes,{'tableName':_0x7cda('0x9'),'paranoid':![],'indexes':[{'name':_0x7cda('0xa'),'fields':[_0x7cda('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x9ff4=['moment','bluebird','request-promise','rimraf','../../config/environment','./smsTransferReport.attributes','exports','define','SmsTransferReport','uniqueid','api'];(function(_0x2d9e27,_0x5965b2){var _0xd35381=function(_0x343d18){while(--_0x343d18){_0x2d9e27['push'](_0x2d9e27['shift']());}};_0xd35381(++_0x5965b2);}(_0x9ff4,0x196));var _0x49ff=function(_0x13e657,_0x5a0279){_0x13e657=_0x13e657-0x0;var _0x1a08a0=_0x9ff4[_0x13e657];return _0x1a08a0;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x49ff('0x0'));var moment=require(_0x49ff('0x1'));var BPromise=require(_0x49ff('0x2'));var rp=require(_0x49ff('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x49ff('0x4'));var config=require(_0x49ff('0x5'));var attributes=require(_0x49ff('0x6'));module[_0x49ff('0x7')]=function(_0x153755,_0x22febd){return _0x153755[_0x49ff('0x8')](_0x49ff('0x9'),attributes,{'tableName':'report_sms_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x49ff('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
index 13f8e75..3626eb4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc090=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','then','SmsTransferReport,\x20%s,\x20%s','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info'];(function(_0x58afd5,_0x534a48){var _0x3e503b=function(_0x27ba44){while(--_0x27ba44){_0x58afd5['push'](_0x58afd5['shift']());}};_0x3e503b(++_0x534a48);}(_0xc090,0x112));var _0x0c09=function(_0x5af0e0,_0x5f5d4f){_0x5af0e0=_0x5af0e0-0x0;var _0x2f51c2=_0xc090[_0x5af0e0];return _0x2f51c2;};'use strict';var _=require(_0x0c09('0x0'));var util=require(_0x0c09('0x1'));var moment=require(_0x0c09('0x2'));var BPromise=require(_0x0c09('0x3'));var rs=require(_0x0c09('0x4'));var fs=require('fs');var Redis=require(_0x0c09('0x5'));var db=require(_0x0c09('0x6'))['db'];var utils=require(_0x0c09('0x7'));var logger=require(_0x0c09('0x8'))('rpc');var config=require(_0x0c09('0x9'));var jayson=require(_0x0c09('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4c2143,_0x4bfe8a,_0x1f1a58){return new BPromise(function(_0x2854d8,_0x34e5f0){return client['request'](_0x4c2143,_0x1f1a58)[_0x0c09('0xb')](function(_0x45ec93){logger['info'](_0x0c09('0xc'),_0x4bfe8a,'request\x20sent');logger[_0x0c09('0xd')](_0x0c09('0xe'),_0x4bfe8a,_0x0c09('0xf'),JSON[_0x0c09('0x10')](_0x45ec93));if(_0x45ec93['error']){if(_0x45ec93['error']['code']===0x1f4){logger[_0x0c09('0x11')]('SmsTransferReport,\x20%s,\x20%s',_0x4bfe8a,_0x45ec93['error'][_0x0c09('0x12')]);return _0x34e5f0(_0x45ec93['error'][_0x0c09('0x12')]);}logger[_0x0c09('0x11')](_0x0c09('0xc'),_0x4bfe8a,_0x45ec93[_0x0c09('0x11')][_0x0c09('0x12')]);return _0x2854d8(_0x45ec93[_0x0c09('0x11')][_0x0c09('0x12')]);}else{logger[_0x0c09('0x13')](_0x0c09('0xc'),_0x4bfe8a,_0x0c09('0xf'));_0x2854d8(_0x45ec93['result'][_0x0c09('0x12')]);}})[_0x0c09('0x14')](function(_0x173f4c){logger[_0x0c09('0x11')](_0x0c09('0xc'),_0x4bfe8a,_0x173f4c);_0x34e5f0(_0x173f4c);});});}
\ No newline at end of file
+var _0x9d92=['info','result','catch','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','SmsTransferReport,\x20%s,\x20%s','message'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x9d92,0xdf));var _0x29d9=function(_0x2850c0,_0x1363a7){_0x2850c0=_0x2850c0-0x0;var _0x21e830=_0x9d92[_0x2850c0];return _0x21e830;};'use strict';var _=require(_0x29d9('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x29d9('0x1'));var rs=require(_0x29d9('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x29d9('0x3'))['db'];var utils=require(_0x29d9('0x4'));var logger=require(_0x29d9('0x5'))(_0x29d9('0x6'));var config=require(_0x29d9('0x7'));var jayson=require(_0x29d9('0x8'));var client=jayson[_0x29d9('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x209595,_0x2f6ac2,_0x392265){return new BPromise(function(_0x5aeb53,_0x26cd90){return client[_0x29d9('0xa')](_0x209595,_0x392265)[_0x29d9('0xb')](function(_0x55b0a5){logger['info']('SmsTransferReport,\x20%s,\x20%s',_0x2f6ac2,'request\x20sent');logger[_0x29d9('0xc')](_0x29d9('0xd'),_0x2f6ac2,_0x29d9('0xe'),JSON['stringify'](_0x55b0a5));if(_0x55b0a5[_0x29d9('0xf')]){if(_0x55b0a5[_0x29d9('0xf')][_0x29d9('0x10')]===0x1f4){logger[_0x29d9('0xf')]('SmsTransferReport,\x20%s,\x20%s',_0x2f6ac2,_0x55b0a5[_0x29d9('0xf')]['message']);return _0x26cd90(_0x55b0a5['error']['message']);}logger[_0x29d9('0xf')](_0x29d9('0x11'),_0x2f6ac2,_0x55b0a5[_0x29d9('0xf')][_0x29d9('0x12')]);return _0x5aeb53(_0x55b0a5['error'][_0x29d9('0x12')]);}else{logger[_0x29d9('0x13')](_0x29d9('0x11'),_0x2f6ac2,_0x29d9('0xe'));_0x5aeb53(_0x55b0a5[_0x29d9('0x14')][_0x29d9('0x12')]);}})[_0x29d9('0x15')](function(_0x327c5f){logger[_0x29d9('0xf')](_0x29d9('0x11'),_0x2f6ac2,_0x327c5f);_0x26cd90(_0x327c5f);});});}
\ No newline at end of file
index efc3502..15e34a8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe17c=['extname','now','single','file','create','put','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','/:id/download','download','diskStorage','root','server/files/sounds/original/','originalname','replace','basename'];(function(_0x4c3321,_0x4213a6){var _0x54208f=function(_0x2ec1ba){while(--_0x2ec1ba){_0x4c3321['push'](_0x4c3321['shift']());}};_0x54208f(++_0x4213a6);}(_0xe17c,0x1ed));var _0xce17=function(_0x9d41c3,_0x4f0b4e){_0x9d41c3=_0x9d41c3-0x0;var _0x53ea8b=_0xe17c[_0x9d41c3];return _0x53ea8b;};'use strict';var multer=require('multer');var util=require(_0xce17('0x0'));var path=require(_0xce17('0x1'));var timeout=require(_0xce17('0x2'));var express=require(_0xce17('0x3'));var router=express[_0xce17('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xce17('0x5'));var interaction=require(_0xce17('0x6'));var config=require(_0xce17('0x7'));var controller=require('./sound.controller');router[_0xce17('0x8')]('/',auth['isAuthenticated'](),controller[_0xce17('0x9')]);router[_0xce17('0x8')](_0xce17('0xa'),auth[_0xce17('0xb')](),controller['show']);router[_0xce17('0x8')](_0xce17('0xc'),auth[_0xce17('0xb')](),controller[_0xce17('0xd')]);var upload=multer({'storage':multer[_0xce17('0xe')]({'destination':function(_0x292303,_0xa12448,_0x14ff0d){_0x14ff0d(null,path['join'](config[_0xce17('0xf')],_0xce17('0x10')));},'filename':function(_0x5b7b38,_0x3da700,_0x24c012){_0x3da700[_0xce17('0x11')]=_0x3da700['originalname'][_0xce17('0x12')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x24c012(null,util['format']('%s-%s%s',path[_0xce17('0x13')](_0x3da700[_0xce17('0x11')],path[_0xce17('0x14')](_0x3da700[_0xce17('0x11')])),Date[_0xce17('0x15')](),path['extname'](_0x3da700[_0xce17('0x11')])));}})});router['post']('/',upload[_0xce17('0x16')](_0xce17('0x17')),controller[_0xce17('0x18')]);router[_0xce17('0x19')](_0xce17('0xa'),auth[_0xce17('0xb')](),controller['update']);router['delete'](_0xce17('0xa'),auth[_0xce17('0xb')](),controller['delete']);module[_0xce17('0x1a')]=router;
\ No newline at end of file
+var _0xe5cf=['now','extname','file','create','put','/:id','update','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./sound.controller','get','index','show','/:id/download','isAuthenticated','download','diskStorage','join','root','originalname','replace','format','%s-%s%s'];(function(_0xc8a266,_0x1d5932){var _0x289b0f=function(_0x4eba24){while(--_0x4eba24){_0xc8a266['push'](_0xc8a266['shift']());}};_0x289b0f(++_0x1d5932);}(_0xe5cf,0x164));var _0xfe5c=function(_0x1d9c05,_0x54e8b){_0x1d9c05=_0x1d9c05-0x0;var _0x48f471=_0xe5cf[_0x1d9c05];return _0x48f471;};'use strict';var multer=require('multer');var util=require(_0xfe5c('0x0'));var path=require('path');var timeout=require(_0xfe5c('0x1'));var express=require(_0xfe5c('0x2'));var router=express[_0xfe5c('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xfe5c('0x4'));var interaction=require(_0xfe5c('0x5'));var config=require(_0xfe5c('0x6'));var controller=require(_0xfe5c('0x7'));router[_0xfe5c('0x8')]('/',auth['isAuthenticated'](),controller[_0xfe5c('0x9')]);router[_0xfe5c('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xfe5c('0xa')]);router[_0xfe5c('0x8')](_0xfe5c('0xb'),auth[_0xfe5c('0xc')](),controller[_0xfe5c('0xd')]);var upload=multer({'storage':multer[_0xfe5c('0xe')]({'destination':function(_0x3ed7ca,_0x1c36a5,_0x28fcad){_0x28fcad(null,path[_0xfe5c('0xf')](config[_0xfe5c('0x10')],'server/files/sounds/original/'));},'filename':function(_0x19b4ba,_0x4c6777,_0x53b2ea){_0x4c6777[_0xfe5c('0x11')]=_0x4c6777[_0xfe5c('0x11')][_0xfe5c('0x12')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x53b2ea(null,util[_0xfe5c('0x13')](_0xfe5c('0x14'),path['basename'](_0x4c6777['originalname'],path['extname'](_0x4c6777[_0xfe5c('0x11')])),Date[_0xfe5c('0x15')](),path[_0xfe5c('0x16')](_0x4c6777[_0xfe5c('0x11')])));}})});router['post']('/',upload['single'](_0xfe5c('0x17')),controller[_0xfe5c('0x18')]);router[_0xfe5c('0x19')](_0xfe5c('0x1a'),auth[_0xfe5c('0xc')](),controller[_0xfe5c('0x1b')]);router['delete'](_0xfe5c('0x1a'),auth[_0xfe5c('0xc')](),controller['delete']);module[_0xfe5c('0x1c')]=router;
\ No newline at end of file
index b1b82a8..ab8feb4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcdfe=['exports','STRING','name','FLOAT','BIGINT','INTEGER','sequelize'];(function(_0x494d1f,_0x3f72ff){var _0x457b6e=function(_0x38cb16){while(--_0x38cb16){_0x494d1f['push'](_0x494d1f['shift']());}};_0x457b6e(++_0x3f72ff);}(_0xcdfe,0x172));var _0xecdf=function(_0x3e0f76,_0x23e220){_0x3e0f76=_0x3e0f76-0x0;var _0x464126=_0xcdfe[_0x3e0f76];return _0x464126;};'use strict';var Sequelize=require(_0xecdf('0x0'));module[_0xecdf('0x1')]={'name':{'type':Sequelize[_0xecdf('0x2')],'unique':_0xecdf('0x3'),'allowNull':![]},'save_name':{'type':Sequelize['STRING']},'display_name':{'type':Sequelize[_0xecdf('0x2')],'defaultValue':''},'description':{'type':Sequelize['STRING']},'original_format':{'type':Sequelize[_0xecdf('0x2')]},'original_duration':{'type':Sequelize[_0xecdf('0x4')]},'original_sampleCount':{'type':Sequelize[_0xecdf('0x5')]},'original_channelCount':{'type':Sequelize[_0xecdf('0x6')]},'original_bitRate':{'type':Sequelize[_0xecdf('0x5')]},'original_sampleRate':{'type':Sequelize[_0xecdf('0x6')]},'converted_format':{'type':Sequelize[_0xecdf('0x2')]},'converted_duration':{'type':Sequelize[_0xecdf('0x4')]},'converted_sampleCount':{'type':Sequelize[_0xecdf('0x5')]},'converted_channelCount':{'type':Sequelize[_0xecdf('0x6')]},'converted_bitRate':{'type':Sequelize[_0xecdf('0x5')]},'converted_sampleRate':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0x4633=['INTEGER','BIGINT','sequelize','exports','STRING','FLOAT'];(function(_0x3bf2d5,_0x36116c){var _0x29e958=function(_0x18ba76){while(--_0x18ba76){_0x3bf2d5['push'](_0x3bf2d5['shift']());}};_0x29e958(++_0x36116c);}(_0x4633,0x68));var _0x3463=function(_0x29c917,_0x296875){_0x29c917=_0x29c917-0x0;var _0x24301e=_0x4633[_0x29c917];return _0x24301e;};'use strict';var Sequelize=require(_0x3463('0x0'));module[_0x3463('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'save_name':{'type':Sequelize[_0x3463('0x2')]},'display_name':{'type':Sequelize[_0x3463('0x2')],'defaultValue':''},'description':{'type':Sequelize[_0x3463('0x2')]},'original_format':{'type':Sequelize[_0x3463('0x2')]},'original_duration':{'type':Sequelize[_0x3463('0x3')]},'original_sampleCount':{'type':Sequelize['BIGINT']},'original_channelCount':{'type':Sequelize[_0x3463('0x4')]},'original_bitRate':{'type':Sequelize[_0x3463('0x5')]},'original_sampleRate':{'type':Sequelize[_0x3463('0x4')]},'converted_format':{'type':Sequelize['STRING']},'converted_duration':{'type':Sequelize[_0x3463('0x3')]},'converted_sampleCount':{'type':Sequelize[_0x3463('0x5')]},'converted_channelCount':{'type':Sequelize[_0x3463('0x4')]},'converted_bitRate':{'type':Sequelize['BIGINT']},'converted_sampleRate':{'type':Sequelize[_0x3463('0x4')]}};
\ No newline at end of file
index ba4034b..5d75e4a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa01f=['chmodSync','role','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','update','pick','description','original_format','eml-format','rimraf','zip-dir','fast-json-patch','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','then','get','Sounds','destroy','sendStatus','error','stack','name','index','Sound','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','filter','where','merge','options','includeAll','include','catch','params','find','download','save_name','converted_format','existsSync','server/files/sounds/converted','Sound\x20not\x20found','join','root','format','%s.%s','create','basename','file','originalname','extname','filename','substring','wav','server/files/sounds/original','info','Sound\x20upload\x20destination:\x20%s','0777','transcode','unlinkSync','send','src','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_channelCount','converted_bitRate','converted_sampleRate'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xa01f,0x176));var _0xfa01=function(_0x5e36d1,_0x471178){_0x5e36d1=_0x5e36d1-0x0;var _0x950b9e=_0xa01f[_0x5e36d1];return _0x950b9e;};'use strict';var emlformat=require(_0xfa01('0x0'));var rimraf=require(_0xfa01('0x1'));var zipdir=require(_0xfa01('0x2'));var jsonpatch=require(_0xfa01('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xfa01('0x4'));var util=require('util');var path=require(_0xfa01('0x5'));var sox=require(_0xfa01('0x6'));var csv=require(_0xfa01('0x7'));var ejs=require(_0xfa01('0x8'));var fs=require('fs');var fs_extra=require(_0xfa01('0x9'));var _=require(_0xfa01('0xa'));var squel=require(_0xfa01('0xb'));var crypto=require(_0xfa01('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xfa01('0x7'));var querystring=require('querystring');var Papa=require(_0xfa01('0xd'));var Redis=require(_0xfa01('0xe'));var authService=require(_0xfa01('0xf'));var qs=require(_0xfa01('0x10'));var as=require(_0xfa01('0x11'));var hardwareService=require(_0xfa01('0x12'));var logger=require(_0xfa01('0x13'))('api');var utils=require('../../config/utils');var config=require(_0xfa01('0x14'));var licenseUtil=require(_0xfa01('0x15'));var db=require(_0xfa01('0x16'))['db'];function respondWithStatusCode(_0x6930db,_0x4c0734){_0x4c0734=_0x4c0734||0xcc;return function(_0x3d5179){if(_0x3d5179){return _0x6930db['sendStatus'](_0x4c0734);}return _0x6930db[_0xfa01('0x17')](_0x4c0734)[_0xfa01('0x18')]();};}function respondWithResult(_0x921b06,_0x48fdb6){_0x48fdb6=_0x48fdb6||0xc8;return function(_0x1ccdf7){if(_0x1ccdf7){return _0x921b06[_0xfa01('0x17')](_0x48fdb6)[_0xfa01('0x19')](_0x1ccdf7);}};}function respondWithFilteredResult(_0x375a96,_0x581ef2){return function(_0x28c044){if(_0x28c044){var _0x22683a=typeof _0x581ef2[_0xfa01('0x1a')]===_0xfa01('0x1b')&&typeof _0x581ef2['limit']===_0xfa01('0x1b');var _0x15195d=_0x28c044[_0xfa01('0x1c')];var _0xa7aec8=_0x22683a?0x0:_0x581ef2[_0xfa01('0x1a')];var _0x1a31fd=_0x22683a?_0x28c044['count']:_0x581ef2[_0xfa01('0x1a')]+_0x581ef2[_0xfa01('0x1d')];var _0x3044dc;if(_0x1a31fd>=_0x15195d){_0x1a31fd=_0x15195d;_0x3044dc=0xc8;}else{_0x3044dc=0xce;}_0x375a96[_0xfa01('0x17')](_0x3044dc);return _0x375a96[_0xfa01('0x1e')](_0xfa01('0x1f'),_0xa7aec8+'-'+_0x1a31fd+'/'+_0x15195d)[_0xfa01('0x19')](_0x28c044);}return null;};}function patchUpdates(_0x467fd7){return function(_0x56e50c){try{jsonpatch['apply'](_0x56e50c,_0x467fd7,!![]);}catch(_0x3e7e86){return BPromise[_0xfa01('0x20')](_0x3e7e86);}return _0x56e50c[_0xfa01('0x21')]();};}function saveUpdates(_0x5c7bf6,_0x5f1efc){return function(_0x33f61b){if(_0x33f61b){return _0x33f61b['update'](_0x5c7bf6)[_0xfa01('0x22')](function(_0x22d904){return _0x22d904;});}return null;};}function removeEntity(_0x5ee69a,_0x5c0895){return function(_0x358e7d){if(_0x358e7d){return _0x358e7d['destroy']()[_0xfa01('0x22')](function(){var _0x4a5208=_0x358e7d[_0xfa01('0x23')]({'plain':!![]});var _0x462b96=_0xfa01('0x24');return db['UserProfileResource'][_0xfa01('0x25')]({'where':{'type':_0x462b96,'resourceId':_0x4a5208['id']}})[_0xfa01('0x22')](function(){return _0x358e7d;});})[_0xfa01('0x22')](function(){_0x5ee69a[_0xfa01('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0xbdc12,_0x4b323b){return function(_0x2a54ca){if(!_0x2a54ca){_0xbdc12[_0xfa01('0x26')](0x194);}return _0x2a54ca;};}function handleError(_0x12854e,_0x906428){_0x906428=_0x906428||0x1f4;return function(_0x1e1f47){logger[_0xfa01('0x27')](_0x1e1f47[_0xfa01('0x28')]);if(_0x1e1f47['name']){delete _0x1e1f47[_0xfa01('0x29')];}_0x12854e[_0xfa01('0x17')](_0x906428)['send'](_0x1e1f47);};}exports[_0xfa01('0x2a')]=function(_0x36b057,_0x5583bd){var _0x5536e5={},_0x42ef35={},_0x3a99d9={'count':0x0,'rows':[]};var _0x75d009=_['map'](db[_0xfa01('0x2b')][_0xfa01('0x2c')],function(_0x358688){return{'name':_0x358688[_0xfa01('0x2d')],'type':_0x358688[_0xfa01('0x2e')][_0xfa01('0x2f')]};});_0x42ef35[_0xfa01('0x30')]=_[_0xfa01('0x31')](_0x75d009,_0xfa01('0x29'));_0x42ef35[_0xfa01('0x32')]=_[_0xfa01('0x33')](_0x36b057[_0xfa01('0x32')]);_0x42ef35[_0xfa01('0x34')]=_[_0xfa01('0x35')](_0x42ef35[_0xfa01('0x30')],_0x42ef35[_0xfa01('0x32')]);_0x5536e5[_0xfa01('0x36')]=_[_0xfa01('0x35')](_0x42ef35[_0xfa01('0x30')],qs[_0xfa01('0x37')](_0x36b057[_0xfa01('0x32')][_0xfa01('0x37')]));_0x5536e5[_0xfa01('0x36')]=_0x5536e5[_0xfa01('0x36')][_0xfa01('0x38')]?_0x5536e5[_0xfa01('0x36')]:_0x42ef35[_0xfa01('0x30')];if(!_0x36b057[_0xfa01('0x32')][_0xfa01('0x39')]('nolimit')){_0x5536e5[_0xfa01('0x1d')]=qs[_0xfa01('0x1d')](_0x36b057[_0xfa01('0x32')][_0xfa01('0x1d')]);_0x5536e5[_0xfa01('0x1a')]=qs[_0xfa01('0x1a')](_0x36b057['query']['offset']);}_0x5536e5['order']=qs[_0xfa01('0x3a')](_0x36b057[_0xfa01('0x32')][_0xfa01('0x3a')]);_0x5536e5['where']=qs[_0xfa01('0x34')](_['pick'](_0x36b057[_0xfa01('0x32')],_0x42ef35[_0xfa01('0x34')]),_0x75d009);if(_0x36b057[_0xfa01('0x32')][_0xfa01('0x3b')]){_0x5536e5[_0xfa01('0x3c')]=_['merge'](_0x5536e5[_0xfa01('0x3c')],{'$or':_[_0xfa01('0x31')](_0x75d009,function(_0x57e6f9){if(_0x57e6f9[_0xfa01('0x2e')]!=='VIRTUAL'){var _0x18ddf5={};_0x18ddf5[_0x57e6f9['name']]={'$like':'%'+_0x36b057['query'][_0xfa01('0x3b')]+'%'};return _0x18ddf5;}})});}_0x5536e5=_[_0xfa01('0x3d')]({},_0x5536e5,_0x36b057[_0xfa01('0x3e')]);var _0x3de178={'where':_0x5536e5[_0xfa01('0x3c')]};return db[_0xfa01('0x2b')]['count'](_0x3de178)[_0xfa01('0x22')](function(_0x438caa){_0x3a99d9['count']=_0x438caa;if(_0x36b057[_0xfa01('0x32')][_0xfa01('0x3f')]){_0x5536e5[_0xfa01('0x40')]=[{'all':!![]}];}return db[_0xfa01('0x2b')]['findAll'](_0x5536e5);})[_0xfa01('0x22')](function(_0x5513a9){_0x3a99d9['rows']=_0x5513a9;return _0x3a99d9;})[_0xfa01('0x22')](respondWithFilteredResult(_0x5583bd,_0x5536e5))[_0xfa01('0x41')](handleError(_0x5583bd,null));};exports['show']=function(_0xcd884,_0x2219b9){var _0x45764d={'raw':!![],'where':{'id':_0xcd884[_0xfa01('0x42')]['id']}},_0x147faa={};_0x147faa[_0xfa01('0x30')]=_[_0xfa01('0x33')](db[_0xfa01('0x2b')][_0xfa01('0x2c')]);_0x147faa['query']=_[_0xfa01('0x33')](_0xcd884[_0xfa01('0x32')]);_0x147faa[_0xfa01('0x34')]=_[_0xfa01('0x35')](_0x147faa[_0xfa01('0x30')],_0x147faa[_0xfa01('0x32')]);_0x45764d[_0xfa01('0x36')]=_[_0xfa01('0x35')](_0x147faa[_0xfa01('0x30')],qs[_0xfa01('0x37')](_0xcd884['query'][_0xfa01('0x37')]));_0x45764d[_0xfa01('0x36')]=_0x45764d['attributes'][_0xfa01('0x38')]?_0x45764d[_0xfa01('0x36')]:_0x147faa[_0xfa01('0x30')];if(_0xcd884[_0xfa01('0x32')][_0xfa01('0x3f')]){_0x45764d[_0xfa01('0x40')]=[{'all':!![]}];}_0x45764d=_[_0xfa01('0x3d')]({},_0x45764d,_0xcd884[_0xfa01('0x3e')]);return db[_0xfa01('0x2b')][_0xfa01('0x43')](_0x45764d)[_0xfa01('0x22')](handleEntityNotFound(_0x2219b9,null))[_0xfa01('0x22')](respondWithResult(_0x2219b9,null))[_0xfa01('0x41')](handleError(_0x2219b9,null));};exports[_0xfa01('0x44')]=function(_0x5989f7,_0x4e4751,_0x44f4f3){return db[_0xfa01('0x2b')][_0xfa01('0x43')]({'where':{'id':_0x5989f7[_0xfa01('0x42')]['id']},'attributes':['name',_0xfa01('0x45'),_0xfa01('0x46')],'raw':!![]})[_0xfa01('0x22')](handleEntityNotFound(_0x4e4751,null))[_0xfa01('0x22')](function(_0x452765){if(_0x452765){if(!fs[_0xfa01('0x47')](path['join'](config['root'],_0xfa01('0x48'),_0x452765[_0xfa01('0x45')]+'.'+_0x452765[_0xfa01('0x46')]))){throw new db['Sequelize']['ValidationError'](_0xfa01('0x49'));}return _0x4e4751[_0xfa01('0x44')](path[_0xfa01('0x4a')](config[_0xfa01('0x4b')],_0xfa01('0x48'),util[_0xfa01('0x4c')](_0xfa01('0x4d'),_0x452765[_0xfa01('0x45')],_0x452765[_0xfa01('0x46')])),util[_0xfa01('0x4c')](_0xfa01('0x4d'),_0x452765[_0xfa01('0x29')],_0x452765[_0xfa01('0x46')]));}return null;})[_0xfa01('0x41')](handleError(_0x4e4751,null));};exports[_0xfa01('0x4e')]=function(_0x5f55c0,_0x4cc00d,_0x491285){var _0x43750a={'name':path[_0xfa01('0x4f')](_0x5f55c0[_0xfa01('0x50')][_0xfa01('0x51')],path[_0xfa01('0x52')](_0x5f55c0['file'][_0xfa01('0x51')])),'save_name':path['basename'](_0x5f55c0['file'][_0xfa01('0x53')],path[_0xfa01('0x52')](_0x5f55c0['file'][_0xfa01('0x53')])),'original_format':path[_0xfa01('0x52')](_0x5f55c0['file'][_0xfa01('0x51')])[_0xfa01('0x54')](0x1),'converted_format':_0xfa01('0x55')};var _0x10a1ef=path[_0xfa01('0x4a')](config['root'],_0xfa01('0x56'),_0x5f55c0[_0xfa01('0x50')]['filename']);var _0x4f5158=path[_0xfa01('0x4a')](config['root'],_0xfa01('0x48'),util['format']('%s.%s',path[_0xfa01('0x4f')](_0x5f55c0['file'][_0xfa01('0x53')],path[_0xfa01('0x52')](_0x5f55c0['file']['filename'])),_0x43750a[_0xfa01('0x46')]));logger['info']('Sound\x20upload\x20filepath:\x20%s',_0x10a1ef);logger[_0xfa01('0x57')](_0xfa01('0x58'),_0x4f5158);try{fs['chmodSync'](_0x10a1ef,parseInt(_0xfa01('0x59'),0x8));var _0x55022f=sox[_0xfa01('0x5a')](_0x10a1ef,_0x4f5158,{'sampleRate':0x1f40,'format':_0xfa01('0x55'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x55022f['on'](_0xfa01('0x27'),function(_0x121559){fs[_0xfa01('0x5b')](_0x10a1ef);_0x4cc00d['status'](0x1f4)[_0xfa01('0x5c')](_0x121559);});_0x55022f['on'](_0xfa01('0x5d'),function(_0x3a9939){_0x43750a[_0xfa01('0x5e')]=isNaN(_0x3a9939['duration'])?null:_0x3a9939[_0xfa01('0x5f')]*0x3e8;_0x43750a[_0xfa01('0x60')]=isNaN(_0x3a9939[_0xfa01('0x61')])?null:_0x3a9939[_0xfa01('0x61')];_0x43750a[_0xfa01('0x62')]=isNaN(_0x3a9939[_0xfa01('0x63')])?null:_0x3a9939[_0xfa01('0x63')];_0x43750a[_0xfa01('0x64')]=isNaN(_0x3a9939['bitRate'])?null:_0x3a9939[_0xfa01('0x65')];_0x43750a[_0xfa01('0x66')]=isNaN(_0x3a9939[_0xfa01('0x67')])?null:_0x3a9939[_0xfa01('0x67')];});_0x55022f['on'](_0xfa01('0x68'),function(_0x12e6bd){_0x43750a[_0xfa01('0x69')]=isNaN(_0x12e6bd[_0xfa01('0x5f')])?null:_0x12e6bd[_0xfa01('0x5f')]*0x3e8;_0x43750a[_0xfa01('0x6a')]=isNaN(_0x12e6bd[_0xfa01('0x61')])?null:_0x12e6bd[_0xfa01('0x61')];_0x43750a[_0xfa01('0x6b')]=isNaN(_0x12e6bd[_0xfa01('0x63')])?null:_0x12e6bd[_0xfa01('0x63')];_0x43750a[_0xfa01('0x6c')]=isNaN(_0x12e6bd[_0xfa01('0x65')])?null:_0x12e6bd[_0xfa01('0x65')];_0x43750a[_0xfa01('0x6d')]=isNaN(_0x12e6bd[_0xfa01('0x67')])?null:_0x12e6bd[_0xfa01('0x67')];});_0x55022f['on'](_0xfa01('0x18'),function(){fs[_0xfa01('0x6e')](_0x4f5158,parseInt(_0xfa01('0x59'),0x8));return db['Sound']['create'](_0x43750a)[_0xfa01('0x22')](function(_0x2e8251){var _0x3a922e={'role':_0x5f55c0['body'][_0xfa01('0x6f')],'userProfileId':_0x5f55c0[_0xfa01('0x70')][_0xfa01('0x71')]};if(!_0x3a922e)throw new Error(_0xfa01('0x72'));if(_0x3a922e['role']==='user'){var _0x1f9ff3=_0x2e8251[_0xfa01('0x23')]({'plain':!![]});return db[_0xfa01('0x73')][_0xfa01('0x43')]({'where':{'name':_0xfa01('0x24'),'userProfileId':_0x3a922e[_0xfa01('0x71')]},'raw':!![]})[_0xfa01('0x22')](function(_0x1bd45e){if(_0x1bd45e&&_0x1bd45e[_0xfa01('0x74')]===0x0){return db['UserProfileResource'][_0xfa01('0x4e')]({'name':_0x1f9ff3[_0xfa01('0x29')],'resourceId':_0x1f9ff3['id'],'type':_0x1bd45e['name'],'sectionId':_0x1bd45e['id']},{})[_0xfa01('0x22')](function(){return _0x2e8251;});}else{return _0x2e8251;}})[_0xfa01('0x41')](function(_0x44c607){logger[_0xfa01('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x44c607);throw _0x44c607;});}return _0x2e8251;})['then'](respondWithResult(_0x4cc00d,null))[_0xfa01('0x41')](handleError(_0x4cc00d,null));});_0x55022f['start']();}catch(_0x314b40){_0x4cc00d[_0xfa01('0x17')](0x1f4)[_0xfa01('0x5c')](_0x314b40);}};exports[_0xfa01('0x75')]=function(_0x2e6607,_0x4fcb35,_0x20f7fa){return db[_0xfa01('0x2b')]['find']({'where':{'id':_0x2e6607['params']['id']}})[_0xfa01('0x22')](handleEntityNotFound(_0x4fcb35,null))[_0xfa01('0x22')](saveUpdates(_[_0xfa01('0x76')](_0x2e6607[_0xfa01('0x70')],['name',_0xfa01('0x77')]),null))[_0xfa01('0x22')](respondWithResult(_0x4fcb35,null))['catch'](handleError(_0x4fcb35,null));};exports['delete']=function(_0x1cbd99,_0x2a014e,_0x500368){return db[_0xfa01('0x2b')]['find']({'where':{'id':_0x1cbd99[_0xfa01('0x42')]['id']}})['then'](function(_0x5d8f20){if(_0x5d8f20){return _0x5d8f20[_0xfa01('0x25')]();}})[_0xfa01('0x22')](function(_0x263dcd){var _0x1305fb=path[_0xfa01('0x4a')](config['root'],_0xfa01('0x56'),util['format']('%s.%s',_0x263dcd[_0xfa01('0x45')],_0x263dcd[_0xfa01('0x78')]));var _0x2420aa=path[_0xfa01('0x4a')](config['root'],_0xfa01('0x48'),util['format']('%s.%s',_0x263dcd['save_name'],_0x263dcd[_0xfa01('0x46')]));fs['unlinkSync'](_0x1305fb);fs[_0xfa01('0x5b')](_0x2420aa);return _0x263dcd;})[_0xfa01('0x22')](function(_0xd74665){if(_0xd74665){return _0x2a014e[_0xfa01('0x17')](0xcc)[_0xfa01('0x18')]();}})['then'](handleEntityNotFound(_0x2a014e,null))[_0xfa01('0x41')](handleError(_0x2a014e,null));};
\ No newline at end of file
+var _0x3115=['offset','undefined','limit','count','set','reject','save','update','then','Sounds','UserProfileResource','error','stack','name','send','index','map','Sound','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','filter','includeAll','include','findAll','catch','show','params','intersection','options','find','save_name','converted_format','existsSync','root','server/files/sounds/converted','ValidationError','Sound\x20not\x20found','download','join','%s.%s','basename','file','originalname','extname','filename','substring','server/files/sounds/original','format','Sound\x20upload\x20filepath:\x20%s','info','chmodSync','0777','transcode','wav','unlinkSync','src','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_channelCount','converted_bitRate','converted_sampleRate','create','body','role','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','pick','description','delete','destroy','original_format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json'];(function(_0x5ec251,_0x4b6f6f){var _0x5c1561=function(_0x2bb102){while(--_0x2bb102){_0x5ec251['push'](_0x5ec251['shift']());}};_0x5c1561(++_0x4b6f6f);}(_0x3115,0x64));var _0x5311=function(_0x554611,_0x11ced4){_0x554611=_0x554611-0x0;var _0x4fbc11=_0x3115[_0x554611];return _0x4fbc11;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5311('0x0'));var zipdir=require(_0x5311('0x1'));var jsonpatch=require(_0x5311('0x2'));var rp=require(_0x5311('0x3'));var moment=require(_0x5311('0x4'));var BPromise=require(_0x5311('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x5311('0x6'));var sox=require(_0x5311('0x7'));var csv=require(_0x5311('0x8'));var ejs=require(_0x5311('0x9'));var fs=require('fs');var fs_extra=require(_0x5311('0xa'));var _=require(_0x5311('0xb'));var squel=require(_0x5311('0xc'));var crypto=require(_0x5311('0xd'));var jsforce=require(_0x5311('0xe'));var deskjs=require(_0x5311('0xf'));var toCsv=require(_0x5311('0x8'));var querystring=require(_0x5311('0x10'));var Papa=require('papaparse');var Redis=require(_0x5311('0x11'));var authService=require(_0x5311('0x12'));var qs=require(_0x5311('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5311('0x14'));var logger=require('../../config/logger')(_0x5311('0x15'));var utils=require('../../config/utils');var config=require(_0x5311('0x16'));var licenseUtil=require(_0x5311('0x17'));var db=require(_0x5311('0x18'))['db'];function respondWithStatusCode(_0x59113b,_0x51f0d3){_0x51f0d3=_0x51f0d3||0xcc;return function(_0x11a7b){if(_0x11a7b){return _0x59113b[_0x5311('0x19')](_0x51f0d3);}return _0x59113b['status'](_0x51f0d3)[_0x5311('0x1a')]();};}function respondWithResult(_0x560267,_0x4afd00){_0x4afd00=_0x4afd00||0xc8;return function(_0x2c0c3a){if(_0x2c0c3a){return _0x560267[_0x5311('0x1b')](_0x4afd00)[_0x5311('0x1c')](_0x2c0c3a);}};}function respondWithFilteredResult(_0x49bec6,_0x64c863){return function(_0x15bfa9){if(_0x15bfa9){var _0x4b29a1=typeof _0x64c863[_0x5311('0x1d')]===_0x5311('0x1e')&&typeof _0x64c863[_0x5311('0x1f')]===_0x5311('0x1e');var _0x29f119=_0x15bfa9[_0x5311('0x20')];var _0x272b1d=_0x4b29a1?0x0:_0x64c863[_0x5311('0x1d')];var _0x10b749=_0x4b29a1?_0x15bfa9['count']:_0x64c863[_0x5311('0x1d')]+_0x64c863[_0x5311('0x1f')];var _0x247b88;if(_0x10b749>=_0x29f119){_0x10b749=_0x29f119;_0x247b88=0xc8;}else{_0x247b88=0xce;}_0x49bec6[_0x5311('0x1b')](_0x247b88);return _0x49bec6[_0x5311('0x21')]('Content-Range',_0x272b1d+'-'+_0x10b749+'/'+_0x29f119)['json'](_0x15bfa9);}return null;};}function patchUpdates(_0x3bd988){return function(_0x190e0d){try{jsonpatch['apply'](_0x190e0d,_0x3bd988,!![]);}catch(_0x1fe290){return BPromise[_0x5311('0x22')](_0x1fe290);}return _0x190e0d[_0x5311('0x23')]();};}function saveUpdates(_0x1149f6,_0x17e93b){return function(_0x4df02b){if(_0x4df02b){return _0x4df02b[_0x5311('0x24')](_0x1149f6)[_0x5311('0x25')](function(_0x52ab8f){return _0x52ab8f;});}return null;};}function removeEntity(_0x1839d1,_0x21aeab){return function(_0x55e033){if(_0x55e033){return _0x55e033['destroy']()[_0x5311('0x25')](function(){var _0x937461=_0x55e033['get']({'plain':!![]});var _0x276b0f=_0x5311('0x26');return db[_0x5311('0x27')]['destroy']({'where':{'type':_0x276b0f,'resourceId':_0x937461['id']}})[_0x5311('0x25')](function(){return _0x55e033;});})['then'](function(){_0x1839d1['status'](0xcc)[_0x5311('0x1a')]();});}};}function handleEntityNotFound(_0xb45c20,_0x2951fd){return function(_0xbdfc22){if(!_0xbdfc22){_0xb45c20[_0x5311('0x19')](0x194);}return _0xbdfc22;};}function handleError(_0x294432,_0x36cfbf){_0x36cfbf=_0x36cfbf||0x1f4;return function(_0x3dd772){logger[_0x5311('0x28')](_0x3dd772[_0x5311('0x29')]);if(_0x3dd772[_0x5311('0x2a')]){delete _0x3dd772[_0x5311('0x2a')];}_0x294432['status'](_0x36cfbf)[_0x5311('0x2b')](_0x3dd772);};}exports[_0x5311('0x2c')]=function(_0x258630,_0x205eea){var _0x597813={},_0x3eb0f9={},_0x53c8d0={'count':0x0,'rows':[]};var _0x4aef27=_[_0x5311('0x2d')](db[_0x5311('0x2e')]['rawAttributes'],function(_0x151185){return{'name':_0x151185[_0x5311('0x2f')],'type':_0x151185[_0x5311('0x30')][_0x5311('0x31')]};});_0x3eb0f9[_0x5311('0x32')]=_[_0x5311('0x2d')](_0x4aef27,_0x5311('0x2a'));_0x3eb0f9[_0x5311('0x33')]=_[_0x5311('0x34')](_0x258630[_0x5311('0x33')]);_0x3eb0f9[_0x5311('0x35')]=_['intersection'](_0x3eb0f9[_0x5311('0x32')],_0x3eb0f9['query']);_0x597813[_0x5311('0x36')]=_['intersection'](_0x3eb0f9[_0x5311('0x32')],qs[_0x5311('0x37')](_0x258630[_0x5311('0x33')][_0x5311('0x37')]));_0x597813[_0x5311('0x36')]=_0x597813[_0x5311('0x36')][_0x5311('0x38')]?_0x597813[_0x5311('0x36')]:_0x3eb0f9[_0x5311('0x32')];if(!_0x258630[_0x5311('0x33')][_0x5311('0x39')](_0x5311('0x3a'))){_0x597813['limit']=qs[_0x5311('0x1f')](_0x258630['query'][_0x5311('0x1f')]);_0x597813[_0x5311('0x1d')]=qs[_0x5311('0x1d')](_0x258630['query'][_0x5311('0x1d')]);}_0x597813[_0x5311('0x3b')]=qs[_0x5311('0x3c')](_0x258630['query'][_0x5311('0x3c')]);_0x597813[_0x5311('0x3d')]=qs[_0x5311('0x35')](_['pick'](_0x258630[_0x5311('0x33')],_0x3eb0f9[_0x5311('0x35')]),_0x4aef27);if(_0x258630[_0x5311('0x33')]['filter']){_0x597813['where']=_[_0x5311('0x3e')](_0x597813[_0x5311('0x3d')],{'$or':_[_0x5311('0x2d')](_0x4aef27,function(_0x17cf4d){if(_0x17cf4d[_0x5311('0x30')]!=='VIRTUAL'){var _0xdb1b13={};_0xdb1b13[_0x17cf4d[_0x5311('0x2a')]]={'$like':'%'+_0x258630[_0x5311('0x33')][_0x5311('0x3f')]+'%'};return _0xdb1b13;}})});}_0x597813=_[_0x5311('0x3e')]({},_0x597813,_0x258630['options']);var _0x3cd228={'where':_0x597813[_0x5311('0x3d')]};return db[_0x5311('0x2e')][_0x5311('0x20')](_0x3cd228)[_0x5311('0x25')](function(_0x3859e9){_0x53c8d0[_0x5311('0x20')]=_0x3859e9;if(_0x258630[_0x5311('0x33')][_0x5311('0x40')]){_0x597813[_0x5311('0x41')]=[{'all':!![]}];}return db[_0x5311('0x2e')][_0x5311('0x42')](_0x597813);})[_0x5311('0x25')](function(_0x5bd726){_0x53c8d0['rows']=_0x5bd726;return _0x53c8d0;})[_0x5311('0x25')](respondWithFilteredResult(_0x205eea,_0x597813))[_0x5311('0x43')](handleError(_0x205eea,null));};exports[_0x5311('0x44')]=function(_0x12cb55,_0x20f190){var _0x316aa2={'raw':!![],'where':{'id':_0x12cb55[_0x5311('0x45')]['id']}},_0x9d8a85={};_0x9d8a85[_0x5311('0x32')]=_[_0x5311('0x34')](db[_0x5311('0x2e')]['rawAttributes']);_0x9d8a85[_0x5311('0x33')]=_[_0x5311('0x34')](_0x12cb55[_0x5311('0x33')]);_0x9d8a85[_0x5311('0x35')]=_[_0x5311('0x46')](_0x9d8a85[_0x5311('0x32')],_0x9d8a85['query']);_0x316aa2[_0x5311('0x36')]=_[_0x5311('0x46')](_0x9d8a85[_0x5311('0x32')],qs[_0x5311('0x37')](_0x12cb55['query'][_0x5311('0x37')]));_0x316aa2[_0x5311('0x36')]=_0x316aa2[_0x5311('0x36')][_0x5311('0x38')]?_0x316aa2[_0x5311('0x36')]:_0x9d8a85[_0x5311('0x32')];if(_0x12cb55['query'][_0x5311('0x40')]){_0x316aa2[_0x5311('0x41')]=[{'all':!![]}];}_0x316aa2=_[_0x5311('0x3e')]({},_0x316aa2,_0x12cb55[_0x5311('0x47')]);return db[_0x5311('0x2e')][_0x5311('0x48')](_0x316aa2)['then'](handleEntityNotFound(_0x20f190,null))[_0x5311('0x25')](respondWithResult(_0x20f190,null))['catch'](handleError(_0x20f190,null));};exports['download']=function(_0x58e4ec,_0x35ea1d,_0x4b8751){return db[_0x5311('0x2e')][_0x5311('0x48')]({'where':{'id':_0x58e4ec[_0x5311('0x45')]['id']},'attributes':[_0x5311('0x2a'),_0x5311('0x49'),_0x5311('0x4a')],'raw':!![]})[_0x5311('0x25')](handleEntityNotFound(_0x35ea1d,null))[_0x5311('0x25')](function(_0x53febe){if(_0x53febe){if(!fs[_0x5311('0x4b')](path['join'](config[_0x5311('0x4c')],_0x5311('0x4d'),_0x53febe[_0x5311('0x49')]+'.'+_0x53febe[_0x5311('0x4a')]))){throw new db['Sequelize'][(_0x5311('0x4e'))](_0x5311('0x4f'));}return _0x35ea1d[_0x5311('0x50')](path[_0x5311('0x51')](config['root'],'server/files/sounds/converted',util['format']('%s.%s',_0x53febe[_0x5311('0x49')],_0x53febe[_0x5311('0x4a')])),util['format'](_0x5311('0x52'),_0x53febe[_0x5311('0x2a')],_0x53febe[_0x5311('0x4a')]));}return null;})[_0x5311('0x43')](handleError(_0x35ea1d,null));};exports['create']=function(_0x50efa4,_0x5c5441,_0x1aa6cf){var _0x3b0425={'name':path[_0x5311('0x53')](_0x50efa4[_0x5311('0x54')][_0x5311('0x55')],path[_0x5311('0x56')](_0x50efa4[_0x5311('0x54')][_0x5311('0x55')])),'save_name':path['basename'](_0x50efa4[_0x5311('0x54')][_0x5311('0x57')],path[_0x5311('0x56')](_0x50efa4[_0x5311('0x54')][_0x5311('0x57')])),'original_format':path[_0x5311('0x56')](_0x50efa4[_0x5311('0x54')][_0x5311('0x55')])[_0x5311('0x58')](0x1),'converted_format':'wav'};var _0x133362=path['join'](config[_0x5311('0x4c')],_0x5311('0x59'),_0x50efa4[_0x5311('0x54')]['filename']);var _0x56ed4e=path[_0x5311('0x51')](config['root'],_0x5311('0x4d'),util[_0x5311('0x5a')](_0x5311('0x52'),path[_0x5311('0x53')](_0x50efa4[_0x5311('0x54')][_0x5311('0x57')],path[_0x5311('0x56')](_0x50efa4['file']['filename'])),_0x3b0425[_0x5311('0x4a')]));logger['info'](_0x5311('0x5b'),_0x133362);logger[_0x5311('0x5c')]('Sound\x20upload\x20destination:\x20%s',_0x56ed4e);try{fs[_0x5311('0x5d')](_0x133362,parseInt(_0x5311('0x5e'),0x8));var _0x306f79=sox[_0x5311('0x5f')](_0x133362,_0x56ed4e,{'sampleRate':0x1f40,'format':_0x5311('0x60'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x306f79['on'](_0x5311('0x28'),function(_0x2ce156){fs[_0x5311('0x61')](_0x133362);_0x5c5441[_0x5311('0x1b')](0x1f4)[_0x5311('0x2b')](_0x2ce156);});_0x306f79['on'](_0x5311('0x62'),function(_0x44ebb5){_0x3b0425[_0x5311('0x63')]=isNaN(_0x44ebb5[_0x5311('0x64')])?null:_0x44ebb5[_0x5311('0x64')]*0x3e8;_0x3b0425[_0x5311('0x65')]=isNaN(_0x44ebb5['sampleCount'])?null:_0x44ebb5[_0x5311('0x66')];_0x3b0425[_0x5311('0x67')]=isNaN(_0x44ebb5[_0x5311('0x68')])?null:_0x44ebb5['channelCount'];_0x3b0425['original_bitRate']=isNaN(_0x44ebb5[_0x5311('0x69')])?null:_0x44ebb5[_0x5311('0x69')];_0x3b0425[_0x5311('0x6a')]=isNaN(_0x44ebb5[_0x5311('0x6b')])?null:_0x44ebb5['sampleRate'];});_0x306f79['on'](_0x5311('0x6c'),function(_0x56e810){_0x3b0425[_0x5311('0x6d')]=isNaN(_0x56e810[_0x5311('0x64')])?null:_0x56e810[_0x5311('0x64')]*0x3e8;_0x3b0425[_0x5311('0x6e')]=isNaN(_0x56e810[_0x5311('0x66')])?null:_0x56e810[_0x5311('0x66')];_0x3b0425[_0x5311('0x6f')]=isNaN(_0x56e810['channelCount'])?null:_0x56e810[_0x5311('0x68')];_0x3b0425[_0x5311('0x70')]=isNaN(_0x56e810[_0x5311('0x69')])?null:_0x56e810['bitRate'];_0x3b0425[_0x5311('0x71')]=isNaN(_0x56e810['sampleRate'])?null:_0x56e810[_0x5311('0x6b')];});_0x306f79['on'](_0x5311('0x1a'),function(){fs['chmodSync'](_0x56ed4e,parseInt(_0x5311('0x5e'),0x8));return db[_0x5311('0x2e')][_0x5311('0x72')](_0x3b0425)['then'](function(_0x2eb5f4){var _0x309632={'role':_0x50efa4[_0x5311('0x73')][_0x5311('0x74')],'userProfileId':_0x50efa4[_0x5311('0x73')]['userProfileId']};if(!_0x309632)throw new Error(_0x5311('0x75'));if(_0x309632[_0x5311('0x74')]===_0x5311('0x76')){var _0x4f495c=_0x2eb5f4['get']({'plain':!![]});return db[_0x5311('0x77')]['find']({'where':{'name':_0x5311('0x26'),'userProfileId':_0x309632[_0x5311('0x78')]},'raw':!![]})[_0x5311('0x25')](function(_0x450183){if(_0x450183&&_0x450183[_0x5311('0x79')]===0x0){return db['UserProfileResource'][_0x5311('0x72')]({'name':_0x4f495c[_0x5311('0x2a')],'resourceId':_0x4f495c['id'],'type':_0x450183['name'],'sectionId':_0x450183['id']},{})['then'](function(){return _0x2eb5f4;});}else{return _0x2eb5f4;}})[_0x5311('0x43')](function(_0x645b0d){logger['error'](_0x5311('0x7a'),_0x645b0d);throw _0x645b0d;});}return _0x2eb5f4;})[_0x5311('0x25')](respondWithResult(_0x5c5441,null))['catch'](handleError(_0x5c5441,null));});_0x306f79[_0x5311('0x7b')]();}catch(_0x21d47c){_0x5c5441['status'](0x1f4)[_0x5311('0x2b')](_0x21d47c);}};exports[_0x5311('0x24')]=function(_0x1b8991,_0x22eb2a,_0x54748b){return db[_0x5311('0x2e')]['find']({'where':{'id':_0x1b8991[_0x5311('0x45')]['id']}})[_0x5311('0x25')](handleEntityNotFound(_0x22eb2a,null))[_0x5311('0x25')](saveUpdates(_[_0x5311('0x7c')](_0x1b8991[_0x5311('0x73')],[_0x5311('0x2a'),_0x5311('0x7d')]),null))[_0x5311('0x25')](respondWithResult(_0x22eb2a,null))[_0x5311('0x43')](handleError(_0x22eb2a,null));};exports[_0x5311('0x7e')]=function(_0x8cd00c,_0x1c3f89,_0x404d14){return db[_0x5311('0x2e')][_0x5311('0x48')]({'where':{'id':_0x8cd00c[_0x5311('0x45')]['id']}})[_0x5311('0x25')](function(_0x490b80){if(_0x490b80){return _0x490b80[_0x5311('0x7f')]();}})[_0x5311('0x25')](function(_0x2651e5){var _0x1a3b36=path[_0x5311('0x51')](config[_0x5311('0x4c')],_0x5311('0x59'),util[_0x5311('0x5a')](_0x5311('0x52'),_0x2651e5['save_name'],_0x2651e5[_0x5311('0x80')]));var _0x1ac0d7=path[_0x5311('0x51')](config[_0x5311('0x4c')],'server/files/sounds/converted',util[_0x5311('0x5a')](_0x5311('0x52'),_0x2651e5[_0x5311('0x49')],_0x2651e5['converted_format']));fs[_0x5311('0x61')](_0x1a3b36);fs[_0x5311('0x61')](_0x1ac0d7);return _0x2651e5;})[_0x5311('0x25')](function(_0x4bdb0a){if(_0x4bdb0a){return _0x1c3f89[_0x5311('0x1b')](0xcc)[_0x5311('0x1a')]();}})[_0x5311('0x25')](handleEntityNotFound(_0x1c3f89,null))[_0x5311('0x43')](handleError(_0x1c3f89,null));};
\ No newline at end of file
index aac2e35..8e45157 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7b79=['tools_sounds','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./sound.attributes','define','Sound'];(function(_0x12274e,_0x394c2e){var _0x1940a9=function(_0x2e3d62){while(--_0x2e3d62){_0x12274e['push'](_0x12274e['shift']());}};_0x1940a9(++_0x394c2e);}(_0x7b79,0x9d));var _0x97b7=function(_0x3503ca,_0x32bb78){_0x3503ca=_0x3503ca-0x0;var _0x593ae5=_0x7b79[_0x3503ca];return _0x593ae5;};'use strict';var _=require(_0x97b7('0x0'));var util=require(_0x97b7('0x1'));var logger=require(_0x97b7('0x2'))(_0x97b7('0x3'));var moment=require(_0x97b7('0x4'));var BPromise=require(_0x97b7('0x5'));var rp=require(_0x97b7('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x97b7('0x7'));var config=require(_0x97b7('0x8'));var attributes=require(_0x97b7('0x9'));module['exports']=function(_0x2d2cd3,_0x2df176){return _0x2d2cd3[_0x97b7('0xa')](_0x97b7('0xb'),attributes,{'tableName':_0x97b7('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe765=['define','Sound','tools_sounds','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x5e9396,_0x161fdd){var _0x4172e3=function(_0x4acd42){while(--_0x4acd42){_0x5e9396['push'](_0x5e9396['shift']());}};_0x4172e3(++_0x161fdd);}(_0xe765,0x6f));var _0x5e76=function(_0x5def54,_0xc0ed23){_0x5def54=_0x5def54-0x0;var _0x1385fb=_0xe765[_0x5def54];return _0x1385fb;};'use strict';var _=require(_0x5e76('0x0'));var util=require(_0x5e76('0x1'));var logger=require(_0x5e76('0x2'))(_0x5e76('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5e76('0x4'));var fs=require('fs');var path=require(_0x5e76('0x5'));var rimraf=require(_0x5e76('0x6'));var config=require(_0x5e76('0x7'));var attributes=require('./sound.attributes');module[_0x5e76('0x8')]=function(_0x23a1dd,_0x3835ad){return _0x23a1dd[_0x5e76('0x9')](_0x5e76('0xa'),attributes,{'tableName':_0x5e76('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 75f220f..a18613b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xca3d=['include','map','model','debug','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','stringify','error','code','message','info','catch','Sound,\x20%s,\x20%s','ShowSound','find','options','raw','where','attributes'];(function(_0x211bc3,_0x5860c8){var _0x34c9a2=function(_0x4bfa37){while(--_0x4bfa37){_0x211bc3['push'](_0x211bc3['shift']());}};_0x34c9a2(++_0x5860c8);}(_0xca3d,0x80));var _0xdca3=function(_0x527ce8,_0x122695){_0x527ce8=_0x527ce8-0x0;var _0x2a8a56=_0xca3d[_0x527ce8];return _0x2a8a56;};'use strict';var _=require('lodash');var util=require(_0xdca3('0x0'));var moment=require(_0xdca3('0x1'));var BPromise=require(_0xdca3('0x2'));var rs=require(_0xdca3('0x3'));var fs=require('fs');var Redis=require(_0xdca3('0x4'));var db=require(_0xdca3('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xdca3('0x6'))('rpc');var config=require(_0xdca3('0x7'));var jayson=require(_0xdca3('0x8'));var client=jayson[_0xdca3('0x9')][_0xdca3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5bed36,_0x18e8a8,_0x8235c2){return new BPromise(function(_0x327ad6,_0x49ac78){return client[_0xdca3('0xb')](_0x5bed36,_0x8235c2)[_0xdca3('0xc')](function(_0x385ae9){logger['info']('Sound,\x20%s,\x20%s',_0x18e8a8,_0xdca3('0xd'));logger['debug']('Sound,\x20%s,\x20%s,\x20%s',_0x18e8a8,_0xdca3('0xd'),JSON[_0xdca3('0xe')](_0x385ae9));if(_0x385ae9[_0xdca3('0xf')]){if(_0x385ae9['error'][_0xdca3('0x10')]===0x1f4){logger[_0xdca3('0xf')]('Sound,\x20%s,\x20%s',_0x18e8a8,_0x385ae9[_0xdca3('0xf')][_0xdca3('0x11')]);return _0x49ac78(_0x385ae9['error'][_0xdca3('0x11')]);}logger['error']('Sound,\x20%s,\x20%s',_0x18e8a8,_0x385ae9[_0xdca3('0xf')][_0xdca3('0x11')]);return _0x327ad6(_0x385ae9[_0xdca3('0xf')][_0xdca3('0x11')]);}else{logger[_0xdca3('0x12')]('Sound,\x20%s,\x20%s',_0x18e8a8,'request\x20sent');_0x327ad6(_0x385ae9['result'][_0xdca3('0x11')]);}})[_0xdca3('0x13')](function(_0x3ef322){logger[_0xdca3('0xf')](_0xdca3('0x14'),_0x18e8a8,_0x3ef322);_0x49ac78(_0x3ef322);});});}exports[_0xdca3('0x15')]=function(_0x43818e){var _0x4a29ff=this;return new Promise(function(_0x3be3ea,_0x52b9af){return db['Sound'][_0xdca3('0x16')]({'raw':_0x43818e['options']?_0x43818e[_0xdca3('0x17')][_0xdca3('0x18')]===undefined?!![]:![]:!![],'where':_0x43818e[_0xdca3('0x17')]?_0x43818e[_0xdca3('0x17')][_0xdca3('0x19')]||null:null,'attributes':_0x43818e[_0xdca3('0x17')]?_0x43818e[_0xdca3('0x17')][_0xdca3('0x1a')]||null:null,'include':_0x43818e['options']?_0x43818e[_0xdca3('0x17')][_0xdca3('0x1b')]?_[_0xdca3('0x1c')](_0x43818e[_0xdca3('0x17')]['include'],function(_0x451fa3){return{'model':db[_0x451fa3[_0xdca3('0x1d')]],'as':_0x451fa3['as'],'attributes':_0x451fa3[_0xdca3('0x1a')],'include':_0x451fa3[_0xdca3('0x1b')]?_[_0xdca3('0x1c')](_0x451fa3[_0xdca3('0x1b')],function(_0x4d1b82){return{'model':db[_0x4d1b82[_0xdca3('0x1d')]],'as':_0x4d1b82['as'],'attributes':_0x4d1b82['attributes'],'include':_0x4d1b82[_0xdca3('0x1b')]?_['map'](_0x4d1b82[_0xdca3('0x1b')],function(_0xf6f17b){return{'model':db[_0xf6f17b[_0xdca3('0x1d')]],'as':_0xf6f17b['as'],'attributes':_0xf6f17b['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x11b977){logger[_0xdca3('0x12')](_0xdca3('0x15'),_0x43818e);logger[_0xdca3('0x1e')](_0xdca3('0x15'),_0x43818e,JSON['stringify'](_0x11b977));_0x3be3ea(_0x11b977);})[_0xdca3('0x13')](function(_0x5953b3){logger[_0xdca3('0xf')](_0xdca3('0x15'),_0x5953b3[_0xdca3('0x11')],_0x43818e);_0x52b9af(_0x4a29ff[_0xdca3('0xf')](0x1f4,_0x5953b3[_0xdca3('0x11')]));});});};
\ No newline at end of file
+var _0xed19=['request','info','Sound,\x20%s,\x20%s','debug','Sound,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','ShowSound','options','where','attributes','model','map','include','then','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xed19,0xe6));var _0x9ed1=function(_0x4b9c83,_0x3e6e05){_0x4b9c83=_0x4b9c83-0x0;var _0x2ee121=_0xed19[_0x4b9c83];return _0x2ee121;};'use strict';var _=require(_0x9ed1('0x0'));var util=require(_0x9ed1('0x1'));var moment=require(_0x9ed1('0x2'));var BPromise=require(_0x9ed1('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9ed1('0x4'));var db=require(_0x9ed1('0x5'))['db'];var utils=require(_0x9ed1('0x6'));var logger=require(_0x9ed1('0x7'))('rpc');var config=require(_0x9ed1('0x8'));var jayson=require(_0x9ed1('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4d063e,_0x53617b,_0x179c8a){return new BPromise(function(_0x5cd6a0,_0x2b2111){return client[_0x9ed1('0xa')](_0x4d063e,_0x179c8a)['then'](function(_0x1d790a){logger[_0x9ed1('0xb')](_0x9ed1('0xc'),_0x53617b,'request\x20sent');logger[_0x9ed1('0xd')](_0x9ed1('0xe'),_0x53617b,_0x9ed1('0xf'),JSON[_0x9ed1('0x10')](_0x1d790a));if(_0x1d790a[_0x9ed1('0x11')]){if(_0x1d790a[_0x9ed1('0x11')][_0x9ed1('0x12')]===0x1f4){logger[_0x9ed1('0x11')](_0x9ed1('0xc'),_0x53617b,_0x1d790a[_0x9ed1('0x11')][_0x9ed1('0x13')]);return _0x2b2111(_0x1d790a[_0x9ed1('0x11')][_0x9ed1('0x13')]);}logger[_0x9ed1('0x11')]('Sound,\x20%s,\x20%s',_0x53617b,_0x1d790a['error'][_0x9ed1('0x13')]);return _0x5cd6a0(_0x1d790a[_0x9ed1('0x11')][_0x9ed1('0x13')]);}else{logger[_0x9ed1('0xb')](_0x9ed1('0xc'),_0x53617b,_0x9ed1('0xf'));_0x5cd6a0(_0x1d790a[_0x9ed1('0x14')]['message']);}})[_0x9ed1('0x15')](function(_0x1f2974){logger['error'](_0x9ed1('0xc'),_0x53617b,_0x1f2974);_0x2b2111(_0x1f2974);});});}exports[_0x9ed1('0x16')]=function(_0x4d1d58){var _0x4e6119=this;return new Promise(function(_0x2052b6,_0x262049){return db['Sound']['find']({'raw':_0x4d1d58[_0x9ed1('0x17')]?_0x4d1d58[_0x9ed1('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x4d1d58[_0x9ed1('0x17')]?_0x4d1d58['options'][_0x9ed1('0x18')]||null:null,'attributes':_0x4d1d58['options']?_0x4d1d58[_0x9ed1('0x17')][_0x9ed1('0x19')]||null:null,'include':_0x4d1d58[_0x9ed1('0x17')]?_0x4d1d58[_0x9ed1('0x17')]['include']?_['map'](_0x4d1d58[_0x9ed1('0x17')]['include'],function(_0x19dc61){return{'model':db[_0x19dc61[_0x9ed1('0x1a')]],'as':_0x19dc61['as'],'attributes':_0x19dc61['attributes'],'include':_0x19dc61['include']?_[_0x9ed1('0x1b')](_0x19dc61[_0x9ed1('0x1c')],function(_0x4e75ca){return{'model':db[_0x4e75ca[_0x9ed1('0x1a')]],'as':_0x4e75ca['as'],'attributes':_0x4e75ca[_0x9ed1('0x19')],'include':_0x4e75ca[_0x9ed1('0x1c')]?_[_0x9ed1('0x1b')](_0x4e75ca[_0x9ed1('0x1c')],function(_0x305cc4){return{'model':db[_0x305cc4['model']],'as':_0x305cc4['as'],'attributes':_0x305cc4[_0x9ed1('0x19')]};}):[]};}):[]};}):[]:[]})[_0x9ed1('0x1d')](function(_0x244de6){logger['info'](_0x9ed1('0x16'),_0x4d1d58);logger[_0x9ed1('0xd')](_0x9ed1('0x16'),_0x4d1d58,JSON[_0x9ed1('0x10')](_0x244de6));_0x2052b6(_0x244de6);})[_0x9ed1('0x15')](function(_0x4de7bc){logger[_0x9ed1('0x11')](_0x9ed1('0x16'),_0x4de7bc['message'],_0x4d1d58);_0x262049(_0x4e6119[_0x9ed1('0x11')](0x1f4,_0x4de7bc[_0x9ed1('0x13')]));});});};
\ No newline at end of file
index 60625d3..18ee469 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4fc2=['show','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./squareMessage.controller','isAuthenticated','index','/:id'];(function(_0x5de532,_0x2941c4){var _0x4e9192=function(_0x548a81){while(--_0x548a81){_0x5de532['push'](_0x5de532['shift']());}};_0x4e9192(++_0x2941c4);}(_0x4fc2,0x111));var _0x24fc=function(_0x48f440,_0x205b56){_0x48f440=_0x48f440-0x0;var _0xcc60f=_0x4fc2[_0x48f440];return _0xcc60f;};'use strict';var multer=require(_0x24fc('0x0'));var util=require(_0x24fc('0x1'));var path=require(_0x24fc('0x2'));var timeout=require(_0x24fc('0x3'));var express=require('express');var router=express[_0x24fc('0x4')]();var fs_extra=require(_0x24fc('0x5'));var auth=require(_0x24fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x24fc('0x7'));var controller=require(_0x24fc('0x8'));router['get']('/',auth[_0x24fc('0x9')](),controller[_0x24fc('0xa')]);router['get'](_0x24fc('0xb'),auth[_0x24fc('0x9')](),controller[_0x24fc('0xc')]);router[_0x24fc('0xd')]('/',auth[_0x24fc('0x9')](),controller[_0x24fc('0xe')]);router['put'](_0x24fc('0xb'),auth[_0x24fc('0x9')](),controller[_0x24fc('0xf')]);router[_0x24fc('0x10')](_0x24fc('0xb'),auth[_0x24fc('0x9')](),controller[_0x24fc('0x11')]);module[_0x24fc('0x12')]=router;
\ No newline at end of file
+var _0x757a=['destroy','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareMessage.controller','get','index','isAuthenticated','show','post','create','/:id','update','delete'];(function(_0x39686b,_0x6117a1){var _0x5db8fe=function(_0x243ea8){while(--_0x243ea8){_0x39686b['push'](_0x39686b['shift']());}};_0x5db8fe(++_0x6117a1);}(_0x757a,0xde));var _0xa757=function(_0x5aa925,_0x3df970){_0x5aa925=_0x5aa925-0x0;var _0x3a3b35=_0x757a[_0x5aa925];return _0x3a3b35;};'use strict';var multer=require('multer');var util=require(_0xa757('0x0'));var path=require(_0xa757('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xa757('0x2'));var auth=require(_0xa757('0x3'));var interaction=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var controller=require(_0xa757('0x6'));router[_0xa757('0x7')]('/',auth['isAuthenticated'](),controller[_0xa757('0x8')]);router[_0xa757('0x7')]('/:id',auth[_0xa757('0x9')](),controller[_0xa757('0xa')]);router[_0xa757('0xb')]('/',auth[_0xa757('0x9')](),controller[_0xa757('0xc')]);router['put'](_0xa757('0xd'),auth[_0xa757('0x9')](),controller[_0xa757('0xe')]);router[_0xa757('0xf')](_0xa757('0xd'),auth[_0xa757('0x9')](),controller[_0xa757('0x10')]);module['exports']=router;
\ No newline at end of file
index 9d2b274..b7b6fd8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x83c7=['STRING','TEXT','medium','out','sequelize','exports'];(function(_0x2386e,_0x58f7e9){var _0x557b5d=function(_0x31feac){while(--_0x31feac){_0x2386e['push'](_0x2386e['shift']());}};_0x557b5d(++_0x58f7e9);}(_0x83c7,0xc4));var _0x783c=function(_0x55c54b,_0x48bcca){_0x55c54b=_0x55c54b-0x0;var _0x1f144a=_0x83c7[_0x55c54b];return _0x1f144a;};'use strict';var Sequelize=require(_0x783c('0x0'));module[_0x783c('0x1')]={'uniqueid':{'type':Sequelize[_0x783c('0x2')]},'body':{'type':Sequelize[_0x783c('0x3')](_0x783c('0x4')),'allowNull':![]},'direction':{'type':Sequelize['ENUM']('in',_0x783c('0x5')),'defaultValue':_0x783c('0x5'),'allowNull':![]},'providerName':{'type':Sequelize[_0x783c('0x2')]},'providerResponse':{'type':Sequelize[_0x783c('0x3')]}};
\ No newline at end of file
+var _0x5109=['medium','ENUM','out','exports','STRING','TEXT'];(function(_0x3a294e,_0x5770d2){var _0x40832f=function(_0x12c18d){while(--_0x12c18d){_0x3a294e['push'](_0x3a294e['shift']());}};_0x40832f(++_0x5770d2);}(_0x5109,0x135));var _0x9510=function(_0x59d019,_0x3d42b2){_0x59d019=_0x59d019-0x0;var _0x192cbb=_0x5109[_0x59d019];return _0x192cbb;};'use strict';var Sequelize=require('sequelize');module[_0x9510('0x0')]={'uniqueid':{'type':Sequelize[_0x9510('0x1')]},'body':{'type':Sequelize[_0x9510('0x2')](_0x9510('0x3')),'allowNull':![]},'direction':{'type':Sequelize[_0x9510('0x4')]('in',_0x9510('0x5')),'defaultValue':_0x9510('0x5'),'allowNull':![]},'providerName':{'type':Sequelize[_0x9510('0x1')]},'providerResponse':{'type':Sequelize[_0x9510('0x2')]}};
\ No newline at end of file
index 10ca86a..33bd681 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe056=['create','body','destroy','zip-dir','fast-json-patch','request-promise','bluebird','util','path','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','Content-Range','json','apply','reject','save','update','then','stack','name','send','map','SquareMessage','fieldName','type','model','keys','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','options','includeAll','include','findAll','rows','params','fields','merge','find','catch'];(function(_0x51d346,_0x59bfd5){var _0x39f2c3=function(_0x380e7d){while(--_0x380e7d){_0x51d346['push'](_0x51d346['shift']());}};_0x39f2c3(++_0x59bfd5);}(_0xe056,0xdb));var _0x6e05=function(_0x1dc24d,_0x541fa4){_0x1dc24d=_0x1dc24d-0x0;var _0x5d7fb2=_0xe056[_0x1dc24d];return _0x5d7fb2;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x6e05('0x0'));var jsonpatch=require(_0x6e05('0x1'));var rp=require(_0x6e05('0x2'));var moment=require('moment');var BPromise=require(_0x6e05('0x3'));var Mustache=require('mustache');var util=require(_0x6e05('0x4'));var path=require(_0x6e05('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6e05('0x6'));var _=require(_0x6e05('0x7'));var squel=require(_0x6e05('0x8'));var crypto=require('crypto');var jsforce=require(_0x6e05('0x9'));var deskjs=require(_0x6e05('0xa'));var toCsv=require(_0x6e05('0xb'));var querystring=require(_0x6e05('0xc'));var Papa=require(_0x6e05('0xd'));var Redis=require('ioredis');var authService=require(_0x6e05('0xe'));var qs=require(_0x6e05('0xf'));var as=require(_0x6e05('0x10'));var hardwareService=require(_0x6e05('0x11'));var logger=require(_0x6e05('0x12'))(_0x6e05('0x13'));var utils=require('../../config/utils');var config=require(_0x6e05('0x14'));var licenseUtil=require(_0x6e05('0x15'));var db=require(_0x6e05('0x16'))['db'];function respondWithStatusCode(_0x5eaf38,_0x111a7c){_0x111a7c=_0x111a7c||0xcc;return function(_0x41ce19){if(_0x41ce19){return _0x5eaf38[_0x6e05('0x17')](_0x111a7c);}return _0x5eaf38[_0x6e05('0x18')](_0x111a7c)[_0x6e05('0x19')]();};}function respondWithResult(_0x4f4fab,_0x20afe3){_0x20afe3=_0x20afe3||0xc8;return function(_0x291d2c){if(_0x291d2c){return _0x4f4fab['status'](_0x20afe3)['json'](_0x291d2c);}};}function respondWithFilteredResult(_0x37b270,_0x45567a){return function(_0xb0c230){if(_0xb0c230){var _0x5c778b=typeof _0x45567a[_0x6e05('0x1a')]==='undefined'&&typeof _0x45567a[_0x6e05('0x1b')]===_0x6e05('0x1c');var _0x517326=_0xb0c230['count'];var _0x9d1e04=_0x5c778b?0x0:_0x45567a[_0x6e05('0x1a')];var _0x4418c6=_0x5c778b?_0xb0c230[_0x6e05('0x1d')]:_0x45567a[_0x6e05('0x1a')]+_0x45567a['limit'];var _0x13d0aa;if(_0x4418c6>=_0x517326){_0x4418c6=_0x517326;_0x13d0aa=0xc8;}else{_0x13d0aa=0xce;}_0x37b270['status'](_0x13d0aa);return _0x37b270['set'](_0x6e05('0x1e'),_0x9d1e04+'-'+_0x4418c6+'/'+_0x517326)[_0x6e05('0x1f')](_0xb0c230);}return null;};}function patchUpdates(_0xe49265){return function(_0x3d9c12){try{jsonpatch[_0x6e05('0x20')](_0x3d9c12,_0xe49265,!![]);}catch(_0x31c52e){return BPromise[_0x6e05('0x21')](_0x31c52e);}return _0x3d9c12[_0x6e05('0x22')]();};}function saveUpdates(_0x488055,_0x1438a6){return function(_0x4db161){if(_0x4db161){return _0x4db161[_0x6e05('0x23')](_0x488055)[_0x6e05('0x24')](function(_0x3eb6e4){return _0x3eb6e4;});}return null;};}function removeEntity(_0x5988b5,_0x5dc6dc){return function(_0x447d4b){if(_0x447d4b){return _0x447d4b['destroy']()[_0x6e05('0x24')](function(){_0x5988b5[_0x6e05('0x18')](0xcc)[_0x6e05('0x19')]();});}};}function handleEntityNotFound(_0x3444ea,_0x3a268b){return function(_0x19f3a6){if(!_0x19f3a6){_0x3444ea[_0x6e05('0x17')](0x194);}return _0x19f3a6;};}function handleError(_0x5d7701,_0x3b8842){_0x3b8842=_0x3b8842||0x1f4;return function(_0x3bdfef){logger['error'](_0x3bdfef[_0x6e05('0x25')]);if(_0x3bdfef[_0x6e05('0x26')]){delete _0x3bdfef['name'];}_0x5d7701['status'](_0x3b8842)[_0x6e05('0x27')](_0x3bdfef);};}exports['index']=function(_0x2d421f,_0x3c2504){var _0x4c8852={},_0x4e15c7={},_0x3f19f7={'count':0x0,'rows':[]};var _0x15138d=_[_0x6e05('0x28')](db[_0x6e05('0x29')]['rawAttributes'],function(_0x2bc108){return{'name':_0x2bc108[_0x6e05('0x2a')],'type':_0x2bc108[_0x6e05('0x2b')]['key']};});_0x4e15c7[_0x6e05('0x2c')]=_['map'](_0x15138d,'name');_0x4e15c7['query']=_[_0x6e05('0x2d')](_0x2d421f[_0x6e05('0x2e')]);_0x4e15c7[_0x6e05('0x2f')]=_[_0x6e05('0x30')](_0x4e15c7[_0x6e05('0x2c')],_0x4e15c7[_0x6e05('0x2e')]);_0x4c8852[_0x6e05('0x31')]=_['intersection'](_0x4e15c7[_0x6e05('0x2c')],qs['fields'](_0x2d421f[_0x6e05('0x2e')]['fields']));_0x4c8852[_0x6e05('0x31')]=_0x4c8852['attributes'][_0x6e05('0x32')]?_0x4c8852['attributes']:_0x4e15c7[_0x6e05('0x2c')];if(!_0x2d421f['query'][_0x6e05('0x33')](_0x6e05('0x34'))){_0x4c8852[_0x6e05('0x1b')]=qs[_0x6e05('0x1b')](_0x2d421f[_0x6e05('0x2e')][_0x6e05('0x1b')]);_0x4c8852['offset']=qs[_0x6e05('0x1a')](_0x2d421f[_0x6e05('0x2e')][_0x6e05('0x1a')]);}_0x4c8852[_0x6e05('0x35')]=qs['sort'](_0x2d421f['query'][_0x6e05('0x36')]);_0x4c8852['where']=qs[_0x6e05('0x2f')](_[_0x6e05('0x37')](_0x2d421f[_0x6e05('0x2e')],_0x4e15c7[_0x6e05('0x2f')]),_0x15138d);if(_0x2d421f['query'][_0x6e05('0x38')]){_0x4c8852['where']=_['merge'](_0x4c8852[_0x6e05('0x39')],{'$or':_['map'](_0x15138d,function(_0x547950){if(_0x547950[_0x6e05('0x2b')]!==_0x6e05('0x3a')){var _0x2ec523={};_0x2ec523[_0x547950[_0x6e05('0x26')]]={'$like':'%'+_0x2d421f['query'][_0x6e05('0x38')]+'%'};return _0x2ec523;}})});}_0x4c8852=_['merge']({},_0x4c8852,_0x2d421f[_0x6e05('0x3b')]);var _0x3cf0e5={'where':_0x4c8852['where']};return db[_0x6e05('0x29')][_0x6e05('0x1d')](_0x3cf0e5)[_0x6e05('0x24')](function(_0x2498b7){_0x3f19f7['count']=_0x2498b7;if(_0x2d421f['query'][_0x6e05('0x3c')]){_0x4c8852[_0x6e05('0x3d')]=[{'all':!![]}];}return db[_0x6e05('0x29')][_0x6e05('0x3e')](_0x4c8852);})[_0x6e05('0x24')](function(_0x5df453){_0x3f19f7[_0x6e05('0x3f')]=_0x5df453;return _0x3f19f7;})['then'](respondWithFilteredResult(_0x3c2504,_0x4c8852))['catch'](handleError(_0x3c2504,null));};exports['show']=function(_0x4a4f56,_0xeabd51){var _0x562dd8={'raw':!![],'where':{'id':_0x4a4f56[_0x6e05('0x40')]['id']}},_0x506515={};_0x506515[_0x6e05('0x2c')]=_[_0x6e05('0x2d')](db[_0x6e05('0x29')]['rawAttributes']);_0x506515[_0x6e05('0x2e')]=_['keys'](_0x4a4f56[_0x6e05('0x2e')]);_0x506515['filters']=_[_0x6e05('0x30')](_0x506515['model'],_0x506515[_0x6e05('0x2e')]);_0x562dd8['attributes']=_[_0x6e05('0x30')](_0x506515[_0x6e05('0x2c')],qs[_0x6e05('0x41')](_0x4a4f56['query']['fields']));_0x562dd8[_0x6e05('0x31')]=_0x562dd8[_0x6e05('0x31')]['length']?_0x562dd8[_0x6e05('0x31')]:_0x506515[_0x6e05('0x2c')];if(_0x4a4f56[_0x6e05('0x2e')][_0x6e05('0x3c')]){_0x562dd8[_0x6e05('0x3d')]=[{'all':!![]}];}_0x562dd8=_[_0x6e05('0x42')]({},_0x562dd8,_0x4a4f56[_0x6e05('0x3b')]);return db[_0x6e05('0x29')][_0x6e05('0x43')](_0x562dd8)[_0x6e05('0x24')](handleEntityNotFound(_0xeabd51,null))[_0x6e05('0x24')](respondWithResult(_0xeabd51,null))[_0x6e05('0x44')](handleError(_0xeabd51,null));};exports[_0x6e05('0x45')]=function(_0x3dc9d9,_0x30f81c){return db[_0x6e05('0x29')]['create'](_0x3dc9d9[_0x6e05('0x46')],{})[_0x6e05('0x24')](respondWithResult(_0x30f81c,0xc9))[_0x6e05('0x44')](handleError(_0x30f81c,null));};exports[_0x6e05('0x23')]=function(_0x5aada1,_0x5158cb){if(_0x5aada1[_0x6e05('0x46')]['id']){delete _0x5aada1['body']['id'];}return db[_0x6e05('0x29')][_0x6e05('0x43')]({'where':{'id':_0x5aada1[_0x6e05('0x40')]['id']}})[_0x6e05('0x24')](handleEntityNotFound(_0x5158cb,null))['then'](saveUpdates(_0x5aada1[_0x6e05('0x46')],null))[_0x6e05('0x24')](respondWithResult(_0x5158cb,null))[_0x6e05('0x44')](handleError(_0x5158cb,null));};exports[_0x6e05('0x47')]=function(_0x2e6cc1,_0x518ae6){return db[_0x6e05('0x29')][_0x6e05('0x43')]({'where':{'id':_0x2e6cc1['params']['id']}})[_0x6e05('0x24')](handleEntityNotFound(_0x518ae6,null))[_0x6e05('0x24')](removeEntity(_0x518ae6,null))[_0x6e05('0x44')](handleError(_0x518ae6,null));};
\ No newline at end of file
+var _0x5ea2=['find','create','body','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','reject','update','destroy','then','error','stack','name','send','index','map','SquareMessage','rawAttributes','type','key','keys','query','filters','intersection','model','fields','attributes','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length'];(function(_0xb1cf84,_0x813740){var _0x4bad2e=function(_0x53e6f2){while(--_0x53e6f2){_0xb1cf84['push'](_0xb1cf84['shift']());}};_0x4bad2e(++_0x813740);}(_0x5ea2,0x99));var _0x25ea=function(_0x22f447,_0x1fd994){_0x22f447=_0x22f447-0x0;var _0x5edd6a=_0x5ea2[_0x22f447];return _0x5edd6a;};'use strict';var emlformat=require(_0x25ea('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x25ea('0x1'));var rp=require(_0x25ea('0x2'));var moment=require(_0x25ea('0x3'));var BPromise=require(_0x25ea('0x4'));var Mustache=require(_0x25ea('0x5'));var util=require('util');var path=require(_0x25ea('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x25ea('0x7'));var fs=require('fs');var fs_extra=require(_0x25ea('0x8'));var _=require(_0x25ea('0x9'));var squel=require(_0x25ea('0xa'));var crypto=require(_0x25ea('0xb'));var jsforce=require(_0x25ea('0xc'));var deskjs=require(_0x25ea('0xd'));var toCsv=require(_0x25ea('0xe'));var querystring=require(_0x25ea('0xf'));var Papa=require('papaparse');var Redis=require(_0x25ea('0x10'));var authService=require(_0x25ea('0x11'));var qs=require(_0x25ea('0x12'));var as=require(_0x25ea('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x25ea('0x14'))(_0x25ea('0x15'));var utils=require(_0x25ea('0x16'));var config=require(_0x25ea('0x17'));var licenseUtil=require(_0x25ea('0x18'));var db=require(_0x25ea('0x19'))['db'];function respondWithStatusCode(_0x5b3906,_0x5e1059){_0x5e1059=_0x5e1059||0xcc;return function(_0x138c9a){if(_0x138c9a){return _0x5b3906[_0x25ea('0x1a')](_0x5e1059);}return _0x5b3906['status'](_0x5e1059)[_0x25ea('0x1b')]();};}function respondWithResult(_0x20e171,_0x1e247c){_0x1e247c=_0x1e247c||0xc8;return function(_0x190d5a){if(_0x190d5a){return _0x20e171[_0x25ea('0x1c')](_0x1e247c)[_0x25ea('0x1d')](_0x190d5a);}};}function respondWithFilteredResult(_0x488600,_0x16c2e8){return function(_0x81c080){if(_0x81c080){var _0x4c60a0=typeof _0x16c2e8[_0x25ea('0x1e')]===_0x25ea('0x1f')&&typeof _0x16c2e8[_0x25ea('0x20')]===_0x25ea('0x1f');var _0x2e69c8=_0x81c080[_0x25ea('0x21')];var _0x586d4d=_0x4c60a0?0x0:_0x16c2e8[_0x25ea('0x1e')];var _0x454b8e=_0x4c60a0?_0x81c080[_0x25ea('0x21')]:_0x16c2e8[_0x25ea('0x1e')]+_0x16c2e8[_0x25ea('0x20')];var _0x1cc187;if(_0x454b8e>=_0x2e69c8){_0x454b8e=_0x2e69c8;_0x1cc187=0xc8;}else{_0x1cc187=0xce;}_0x488600[_0x25ea('0x1c')](_0x1cc187);return _0x488600['set'](_0x25ea('0x22'),_0x586d4d+'-'+_0x454b8e+'/'+_0x2e69c8)[_0x25ea('0x1d')](_0x81c080);}return null;};}function patchUpdates(_0x5578fe){return function(_0x13884d){try{jsonpatch['apply'](_0x13884d,_0x5578fe,!![]);}catch(_0x5c7b0a){return BPromise[_0x25ea('0x23')](_0x5c7b0a);}return _0x13884d['save']();};}function saveUpdates(_0x3f89a9,_0x3fdde6){return function(_0x445100){if(_0x445100){return _0x445100[_0x25ea('0x24')](_0x3f89a9)['then'](function(_0x56d5ee){return _0x56d5ee;});}return null;};}function removeEntity(_0x35fee2,_0xf34d84){return function(_0x4ee5e6){if(_0x4ee5e6){return _0x4ee5e6[_0x25ea('0x25')]()[_0x25ea('0x26')](function(){_0x35fee2['status'](0xcc)[_0x25ea('0x1b')]();});}};}function handleEntityNotFound(_0x2b5351,_0x5b9780){return function(_0x260e8a){if(!_0x260e8a){_0x2b5351[_0x25ea('0x1a')](0x194);}return _0x260e8a;};}function handleError(_0x2fe961,_0x39de65){_0x39de65=_0x39de65||0x1f4;return function(_0x20c65b){logger[_0x25ea('0x27')](_0x20c65b[_0x25ea('0x28')]);if(_0x20c65b[_0x25ea('0x29')]){delete _0x20c65b[_0x25ea('0x29')];}_0x2fe961[_0x25ea('0x1c')](_0x39de65)[_0x25ea('0x2a')](_0x20c65b);};}exports[_0x25ea('0x2b')]=function(_0x46520a,_0x55020d){var _0x4cb7a5={},_0x3599c3={},_0x21c4fc={'count':0x0,'rows':[]};var _0x576f56=_[_0x25ea('0x2c')](db[_0x25ea('0x2d')][_0x25ea('0x2e')],function(_0x5e47a8){return{'name':_0x5e47a8['fieldName'],'type':_0x5e47a8[_0x25ea('0x2f')][_0x25ea('0x30')]};});_0x3599c3['model']=_[_0x25ea('0x2c')](_0x576f56,_0x25ea('0x29'));_0x3599c3['query']=_[_0x25ea('0x31')](_0x46520a[_0x25ea('0x32')]);_0x3599c3[_0x25ea('0x33')]=_[_0x25ea('0x34')](_0x3599c3['model'],_0x3599c3[_0x25ea('0x32')]);_0x4cb7a5['attributes']=_[_0x25ea('0x34')](_0x3599c3[_0x25ea('0x35')],qs[_0x25ea('0x36')](_0x46520a[_0x25ea('0x32')]['fields']));_0x4cb7a5['attributes']=_0x4cb7a5[_0x25ea('0x37')]['length']?_0x4cb7a5[_0x25ea('0x37')]:_0x3599c3[_0x25ea('0x35')];if(!_0x46520a['query'][_0x25ea('0x38')]('nolimit')){_0x4cb7a5['limit']=qs[_0x25ea('0x20')](_0x46520a[_0x25ea('0x32')][_0x25ea('0x20')]);_0x4cb7a5[_0x25ea('0x1e')]=qs[_0x25ea('0x1e')](_0x46520a[_0x25ea('0x32')]['offset']);}_0x4cb7a5['order']=qs['sort'](_0x46520a[_0x25ea('0x32')][_0x25ea('0x39')]);_0x4cb7a5[_0x25ea('0x3a')]=qs[_0x25ea('0x33')](_[_0x25ea('0x3b')](_0x46520a['query'],_0x3599c3[_0x25ea('0x33')]),_0x576f56);if(_0x46520a[_0x25ea('0x32')][_0x25ea('0x3c')]){_0x4cb7a5[_0x25ea('0x3a')]=_[_0x25ea('0x3d')](_0x4cb7a5['where'],{'$or':_[_0x25ea('0x2c')](_0x576f56,function(_0x29d456){if(_0x29d456[_0x25ea('0x2f')]!==_0x25ea('0x3e')){var _0x27e7e1={};_0x27e7e1[_0x29d456[_0x25ea('0x29')]]={'$like':'%'+_0x46520a[_0x25ea('0x32')][_0x25ea('0x3c')]+'%'};return _0x27e7e1;}})});}_0x4cb7a5=_[_0x25ea('0x3d')]({},_0x4cb7a5,_0x46520a[_0x25ea('0x3f')]);var _0x521905={'where':_0x4cb7a5[_0x25ea('0x3a')]};return db[_0x25ea('0x2d')][_0x25ea('0x21')](_0x521905)[_0x25ea('0x26')](function(_0x152179){_0x21c4fc[_0x25ea('0x21')]=_0x152179;if(_0x46520a[_0x25ea('0x32')][_0x25ea('0x40')]){_0x4cb7a5[_0x25ea('0x41')]=[{'all':!![]}];}return db[_0x25ea('0x2d')][_0x25ea('0x42')](_0x4cb7a5);})['then'](function(_0x12e85a){_0x21c4fc[_0x25ea('0x43')]=_0x12e85a;return _0x21c4fc;})['then'](respondWithFilteredResult(_0x55020d,_0x4cb7a5))[_0x25ea('0x44')](handleError(_0x55020d,null));};exports[_0x25ea('0x45')]=function(_0x77f88f,_0xf5cb77){var _0x62acdb={'raw':!![],'where':{'id':_0x77f88f[_0x25ea('0x46')]['id']}},_0x307cc8={};_0x307cc8[_0x25ea('0x35')]=_[_0x25ea('0x31')](db[_0x25ea('0x2d')][_0x25ea('0x2e')]);_0x307cc8[_0x25ea('0x32')]=_[_0x25ea('0x31')](_0x77f88f[_0x25ea('0x32')]);_0x307cc8[_0x25ea('0x33')]=_['intersection'](_0x307cc8[_0x25ea('0x35')],_0x307cc8[_0x25ea('0x32')]);_0x62acdb[_0x25ea('0x37')]=_[_0x25ea('0x34')](_0x307cc8[_0x25ea('0x35')],qs[_0x25ea('0x36')](_0x77f88f[_0x25ea('0x32')][_0x25ea('0x36')]));_0x62acdb[_0x25ea('0x37')]=_0x62acdb['attributes'][_0x25ea('0x47')]?_0x62acdb['attributes']:_0x307cc8[_0x25ea('0x35')];if(_0x77f88f[_0x25ea('0x32')][_0x25ea('0x40')]){_0x62acdb[_0x25ea('0x41')]=[{'all':!![]}];}_0x62acdb=_[_0x25ea('0x3d')]({},_0x62acdb,_0x77f88f[_0x25ea('0x3f')]);return db[_0x25ea('0x2d')][_0x25ea('0x48')](_0x62acdb)['then'](handleEntityNotFound(_0xf5cb77,null))[_0x25ea('0x26')](respondWithResult(_0xf5cb77,null))['catch'](handleError(_0xf5cb77,null));};exports[_0x25ea('0x49')]=function(_0x2c7b1d,_0x2e2ec6){return db[_0x25ea('0x2d')][_0x25ea('0x49')](_0x2c7b1d[_0x25ea('0x4a')],{})[_0x25ea('0x26')](respondWithResult(_0x2e2ec6,0xc9))['catch'](handleError(_0x2e2ec6,null));};exports[_0x25ea('0x24')]=function(_0x3d1590,_0x517fb0){if(_0x3d1590[_0x25ea('0x4a')]['id']){delete _0x3d1590['body']['id'];}return db[_0x25ea('0x2d')][_0x25ea('0x48')]({'where':{'id':_0x3d1590[_0x25ea('0x46')]['id']}})[_0x25ea('0x26')](handleEntityNotFound(_0x517fb0,null))[_0x25ea('0x26')](saveUpdates(_0x3d1590['body'],null))['then'](respondWithResult(_0x517fb0,null))[_0x25ea('0x44')](handleError(_0x517fb0,null));};exports[_0x25ea('0x25')]=function(_0x3e5ff4,_0x2e8d3c){return db[_0x25ea('0x2d')][_0x25ea('0x48')]({'where':{'id':_0x3e5ff4[_0x25ea('0x46')]['id']}})[_0x25ea('0x26')](handleEntityNotFound(_0x2e8d3c,null))[_0x25ea('0x26')](removeEntity(_0x2e8d3c,null))[_0x25ea('0x44')](handleError(_0x2e8d3c,null));};
\ No newline at end of file
index a2cd346..f52d055 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcff8=['exports','square_messages','util','moment','bluebird','request-promise','path'];(function(_0x7a5723,_0x36f84b){var _0x4f8545=function(_0x4e228e){while(--_0x4e228e){_0x7a5723['push'](_0x7a5723['shift']());}};_0x4f8545(++_0x36f84b);}(_0xcff8,0x11a));var _0x8cff=function(_0x191b8d,_0x3b84f5){_0x191b8d=_0x191b8d-0x0;var _0x45d383=_0xcff8[_0x191b8d];return _0x45d383;};'use strict';var _=require('lodash');var util=require(_0x8cff('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x8cff('0x1'));var BPromise=require(_0x8cff('0x2'));var rp=require(_0x8cff('0x3'));var fs=require('fs');var path=require(_0x8cff('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./squareMessage.attributes');module[_0x8cff('0x5')]=function(_0x420aeb,_0x2aa1a8){return _0x420aeb['define']('SquareMessage',attributes,{'tableName':_0x8cff('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf17d=['request-promise','path','rimraf','./squareMessage.attributes','exports','define','SquareMessage','square_messages','../../config/logger','api','bluebird'];(function(_0x51e1ac,_0x3004af){var _0x42b479=function(_0x2f3c16){while(--_0x2f3c16){_0x51e1ac['push'](_0x51e1ac['shift']());}};_0x42b479(++_0x3004af);}(_0xf17d,0xa2));var _0xdf17=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xf17d[_0x3ab51d];return _0x29a04e;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xdf17('0x0'))(_0xdf17('0x1'));var moment=require('moment');var BPromise=require(_0xdf17('0x2'));var rp=require(_0xdf17('0x3'));var fs=require('fs');var path=require(_0xdf17('0x4'));var rimraf=require(_0xdf17('0x5'));var config=require('../../config/environment');var attributes=require(_0xdf17('0x6'));module[_0xdf17('0x7')]=function(_0x49dd50,_0x2dee05){return _0x49dd50[_0xdf17('0x8')](_0xdf17('0x9'),attributes,{'tableName':_0xdf17('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 24011e0..b46b94a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6f5e=['message','result','catch','SquareMessage','create','options','raw','CreateSquareMessage','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x2adfbd,_0x486dc0){var _0x22620c=function(_0x232744){while(--_0x232744){_0x2adfbd['push'](_0x2adfbd['shift']());}};_0x22620c(++_0x486dc0);}(_0x6f5e,0x12a));var _0xe6f5=function(_0x2d93b2,_0x5e37b7){_0x2d93b2=_0x2d93b2-0x0;var _0x4922b6=_0x6f5e[_0x2d93b2];return _0x4922b6;};'use strict';var _=require(_0xe6f5('0x0'));var util=require(_0xe6f5('0x1'));var moment=require(_0xe6f5('0x2'));var BPromise=require(_0xe6f5('0x3'));var rs=require(_0xe6f5('0x4'));var fs=require('fs');var Redis=require(_0xe6f5('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xe6f5('0x6'));var logger=require(_0xe6f5('0x7'))(_0xe6f5('0x8'));var config=require(_0xe6f5('0x9'));var jayson=require(_0xe6f5('0xa'));var client=jayson[_0xe6f5('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x405291,_0x562fda,_0x2b0d07){return new BPromise(function(_0x13cd28,_0x17082a){return client[_0xe6f5('0xc')](_0x405291,_0x2b0d07)[_0xe6f5('0xd')](function(_0x35b69a){logger[_0xe6f5('0xe')](_0xe6f5('0xf'),_0x562fda,_0xe6f5('0x10'));logger[_0xe6f5('0x11')](_0xe6f5('0x12'),_0x562fda,_0xe6f5('0x10'),JSON['stringify'](_0x35b69a));if(_0x35b69a[_0xe6f5('0x13')]){if(_0x35b69a[_0xe6f5('0x13')][_0xe6f5('0x14')]===0x1f4){logger['error'](_0xe6f5('0xf'),_0x562fda,_0x35b69a[_0xe6f5('0x13')][_0xe6f5('0x15')]);return _0x17082a(_0x35b69a[_0xe6f5('0x13')][_0xe6f5('0x15')]);}logger[_0xe6f5('0x13')](_0xe6f5('0xf'),_0x562fda,_0x35b69a['error'][_0xe6f5('0x15')]);return _0x13cd28(_0x35b69a['error'][_0xe6f5('0x15')]);}else{logger[_0xe6f5('0xe')]('SquareMessage,\x20%s,\x20%s',_0x562fda,_0xe6f5('0x10'));_0x13cd28(_0x35b69a[_0xe6f5('0x16')][_0xe6f5('0x15')]);}})[_0xe6f5('0x17')](function(_0x549a3c){logger[_0xe6f5('0x13')](_0xe6f5('0xf'),_0x562fda,_0x549a3c);_0x17082a(_0x549a3c);});});}exports['CreateSquareMessage']=function(_0x28c280){var _0x242f3b=this;return new Promise(function(_0x56a6cc,_0x27261c){return db[_0xe6f5('0x18')][_0xe6f5('0x19')](_0x28c280['body'],{'raw':_0x28c280[_0xe6f5('0x1a')]?_0x28c280[_0xe6f5('0x1a')][_0xe6f5('0x1b')]===undefined?!![]:![]:!![]})[_0xe6f5('0xd')](function(_0x450292){logger[_0xe6f5('0xe')](_0xe6f5('0x1c'),_0x28c280);logger['debug']('CreateSquareMessage',_0x28c280,JSON['stringify'](_0x450292));_0x56a6cc(_0x450292);})[_0xe6f5('0x17')](function(_0x49a62a){logger[_0xe6f5('0x13')]('CreateSquareMessage',_0x49a62a[_0xe6f5('0x15')],_0x28c280);_0x27261c(_0x242f3b[_0xe6f5('0x13')](0x1f4,_0x49a62a[_0xe6f5('0x15')]));});});};
\ No newline at end of file
+var _0x7341=['request\x20sent','stringify','error','code','message','result','SquareMessage','create','CreateSquareMessage','catch','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','request','then','info','SquareMessage,\x20%s,\x20%s','debug','SquareMessage,\x20%s,\x20%s,\x20%s'];(function(_0x4e7fd0,_0x29cccd){var _0x1de972=function(_0x430190){while(--_0x430190){_0x4e7fd0['push'](_0x4e7fd0['shift']());}};_0x1de972(++_0x29cccd);}(_0x7341,0xe2));var _0x1734=function(_0x563e60,_0x3c3e32){_0x563e60=_0x563e60-0x0;var _0x5855d1=_0x7341[_0x563e60];return _0x5855d1;};'use strict';var _=require(_0x1734('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x1734('0x1'));var rs=require(_0x1734('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1734('0x3'))['db'];var utils=require(_0x1734('0x4'));var logger=require(_0x1734('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x1734('0x6'));var client=jayson[_0x1734('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0xbc88a1,_0x42e4ec,_0x124cd2){return new BPromise(function(_0x3177bf,_0x3974c2){return client[_0x1734('0x8')](_0xbc88a1,_0x124cd2)[_0x1734('0x9')](function(_0x36c038){logger[_0x1734('0xa')](_0x1734('0xb'),_0x42e4ec,'request\x20sent');logger[_0x1734('0xc')](_0x1734('0xd'),_0x42e4ec,_0x1734('0xe'),JSON[_0x1734('0xf')](_0x36c038));if(_0x36c038['error']){if(_0x36c038[_0x1734('0x10')][_0x1734('0x11')]===0x1f4){logger[_0x1734('0x10')](_0x1734('0xb'),_0x42e4ec,_0x36c038[_0x1734('0x10')][_0x1734('0x12')]);return _0x3974c2(_0x36c038[_0x1734('0x10')][_0x1734('0x12')]);}logger[_0x1734('0x10')](_0x1734('0xb'),_0x42e4ec,_0x36c038[_0x1734('0x10')][_0x1734('0x12')]);return _0x3177bf(_0x36c038[_0x1734('0x10')][_0x1734('0x12')]);}else{logger[_0x1734('0xa')](_0x1734('0xb'),_0x42e4ec,_0x1734('0xe'));_0x3177bf(_0x36c038[_0x1734('0x13')][_0x1734('0x12')]);}})['catch'](function(_0x25340){logger[_0x1734('0x10')]('SquareMessage,\x20%s,\x20%s',_0x42e4ec,_0x25340);_0x3974c2(_0x25340);});});}exports['CreateSquareMessage']=function(_0x4350ab){var _0x18d4ca=this;return new Promise(function(_0x36ce14,_0x1c9b51){return db[_0x1734('0x14')][_0x1734('0x15')](_0x4350ab['body'],{'raw':_0x4350ab['options']?_0x4350ab['options']['raw']===undefined?!![]:![]:!![]})[_0x1734('0x9')](function(_0x46609e){logger[_0x1734('0xa')](_0x1734('0x16'),_0x4350ab);logger[_0x1734('0xc')](_0x1734('0x16'),_0x4350ab,JSON[_0x1734('0xf')](_0x46609e));_0x36ce14(_0x46609e);})[_0x1734('0x17')](function(_0x265795){logger[_0x1734('0x10')](_0x1734('0x16'),_0x265795[_0x1734('0x12')],_0x4350ab);_0x1c9b51(_0x18d4ca[_0x1734('0x10')](0x1f4,_0x265795[_0x1734('0x12')]));});});};
\ No newline at end of file
index aa97781..2d5a5d5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa64b=['exports','multer','util','path','fs-extra','../../components/interaction/service','../../config/environment','./squareOdbc.controller','get','isAuthenticated','index','/:id','show','15s','post','create','put','update','delete','destroy'];(function(_0x13fda0,_0x416e7f){var _0x1c1614=function(_0x168cb2){while(--_0x168cb2){_0x13fda0['push'](_0x13fda0['shift']());}};_0x1c1614(++_0x416e7f);}(_0xa64b,0x155));var _0xba64=function(_0x347096,_0x50f42c){_0x347096=_0x347096-0x0;var _0x54ffa7=_0xa64b[_0x347096];return _0x54ffa7;};'use strict';var multer=require(_0xba64('0x0'));var util=require(_0xba64('0x1'));var path=require(_0xba64('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xba64('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xba64('0x4'));var config=require(_0xba64('0x5'));var controller=require(_0xba64('0x6'));router[_0xba64('0x7')]('/',auth[_0xba64('0x8')](),controller[_0xba64('0x9')]);router['get'](_0xba64('0xa'),auth[_0xba64('0x8')](),controller[_0xba64('0xb')]);router['get']('/:id/test',auth['isAuthenticated'](),timeout(_0xba64('0xc')),controller['test']);router[_0xba64('0xd')]('/',auth[_0xba64('0x8')](),controller[_0xba64('0xe')]);router[_0xba64('0xf')](_0xba64('0xa'),auth['isAuthenticated'](),controller[_0xba64('0x10')]);router[_0xba64('0x11')](_0xba64('0xa'),auth[_0xba64('0x8')](),controller[_0xba64('0x12')]);module[_0xba64('0x13')]=router;
\ No newline at end of file
+var _0xbcb9=['./squareOdbc.controller','get','isAuthenticated','index','show','/:id/test','15s','test','post','create','/:id','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0xad50b,_0x37a971){var _0x1c643d=function(_0x15712e){while(--_0x15712e){_0xad50b['push'](_0xad50b['shift']());}};_0x1c643d(++_0x37a971);}(_0xbcb9,0x1dc));var _0x9bcb=function(_0x402ec9,_0xd2b9f9){_0x402ec9=_0x402ec9-0x0;var _0x507158=_0xbcb9[_0x402ec9];return _0x507158;};'use strict';var multer=require(_0x9bcb('0x0'));var util=require('util');var path=require(_0x9bcb('0x1'));var timeout=require(_0x9bcb('0x2'));var express=require(_0x9bcb('0x3'));var router=express[_0x9bcb('0x4')]();var fs_extra=require(_0x9bcb('0x5'));var auth=require(_0x9bcb('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x9bcb('0x7'));router[_0x9bcb('0x8')]('/',auth[_0x9bcb('0x9')](),controller[_0x9bcb('0xa')]);router['get']('/:id',auth[_0x9bcb('0x9')](),controller[_0x9bcb('0xb')]);router[_0x9bcb('0x8')](_0x9bcb('0xc'),auth[_0x9bcb('0x9')](),timeout(_0x9bcb('0xd')),controller[_0x9bcb('0xe')]);router[_0x9bcb('0xf')]('/',auth[_0x9bcb('0x9')](),controller[_0x9bcb('0x10')]);router['put'](_0x9bcb('0x11'),auth['isAuthenticated'](),controller['update']);router[_0x9bcb('0x12')](_0x9bcb('0x11'),auth['isAuthenticated'](),controller[_0x9bcb('0x13')]);module[_0x9bcb('0x14')]=router;
\ No newline at end of file
index 171f828..da9f723 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3a63=['exports','STRING','name','sequelize'];(function(_0x4dab14,_0x164ea0){var _0xf41aa=function(_0x305d50){while(--_0x305d50){_0x4dab14['push'](_0x4dab14['shift']());}};_0xf41aa(++_0x164ea0);}(_0x3a63,0xf7));var _0x33a6=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x3a63[_0x502c7d];return _0x30b7ed;};'use strict';var Sequelize=require(_0x33a6('0x0'));module[_0x33a6('0x1')]={'name':{'type':Sequelize[_0x33a6('0x2')],'unique':_0x33a6('0x3'),'allowNull':![]},'dsn':{'type':Sequelize[_0x33a6('0x2')]},'description':{'type':Sequelize[_0x33a6('0x2')]}};
\ No newline at end of file
+var _0x411d=['exports','STRING','name','sequelize'];(function(_0x47e70e,_0x4b6911){var _0x2468ef=function(_0xedd248){while(--_0xedd248){_0x47e70e['push'](_0x47e70e['shift']());}};_0x2468ef(++_0x4b6911);}(_0x411d,0xb7));var _0xd411=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x411d[_0x17d9e3];return _0x14192d;};'use strict';var Sequelize=require(_0xd411('0x0'));module[_0xd411('0x1')]={'name':{'type':Sequelize[_0xd411('0x2')],'unique':_0xd411('0x3'),'allowNull':![]},'dsn':{'type':Sequelize[_0xd411('0x2')]},'description':{'type':Sequelize[_0xd411('0x2')]}};
\ No newline at end of file
index 5f5ba51..b6dead4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5527=['nolimit','limit','sort','pick','filter','where','merge','options','includeAll','include','rows','catch','show','params','rawAttributes','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','autoAssociation','dsn','odbc','openSync','closeSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','count','set','Content-Range','apply','reject','update','then','destroy','ODBC','UserProfileResource','error','index','map','SquareOdbc','type','key','name','keys','query','filters','intersection','model','attributes','fields','length'];(function(_0x255b1b,_0x342dac){var _0x258229=function(_0x4a3914){while(--_0x4a3914){_0x255b1b['push'](_0x255b1b['shift']());}};_0x258229(++_0x342dac);}(_0x5527,0x162));var _0x7552=function(_0x59d0ae,_0x5b2685){_0x59d0ae=_0x59d0ae-0x0;var _0x1d3617=_0x5527[_0x59d0ae];return _0x1d3617;};'use strict';var emlformat=require(_0x7552('0x0'));var rimraf=require(_0x7552('0x1'));var zipdir=require(_0x7552('0x2'));var jsonpatch=require(_0x7552('0x3'));var rp=require(_0x7552('0x4'));var moment=require(_0x7552('0x5'));var BPromise=require(_0x7552('0x6'));var Mustache=require(_0x7552('0x7'));var util=require(_0x7552('0x8'));var path=require(_0x7552('0x9'));var sox=require(_0x7552('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7552('0xb'));var squel=require(_0x7552('0xc'));var crypto=require(_0x7552('0xd'));var jsforce=require(_0x7552('0xe'));var deskjs=require(_0x7552('0xf'));var toCsv=require(_0x7552('0x10'));var querystring=require(_0x7552('0x11'));var Papa=require('papaparse');var Redis=require(_0x7552('0x12'));var authService=require(_0x7552('0x13'));var qs=require(_0x7552('0x14'));var as=require(_0x7552('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7552('0x16'))(_0x7552('0x17'));var utils=require(_0x7552('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x7552('0x19'))['db'];function respondWithStatusCode(_0x1dc9b1,_0x3201eb){_0x3201eb=_0x3201eb||0xcc;return function(_0xf042e7){if(_0xf042e7){return _0x1dc9b1[_0x7552('0x1a')](_0x3201eb);}return _0x1dc9b1[_0x7552('0x1b')](_0x3201eb)[_0x7552('0x1c')]();};}function respondWithResult(_0x5f0740,_0x308197){_0x308197=_0x308197||0xc8;return function(_0x6e9c8f){if(_0x6e9c8f){return _0x5f0740[_0x7552('0x1b')](_0x308197)[_0x7552('0x1d')](_0x6e9c8f);}};}function respondWithFilteredResult(_0x2d9ef9,_0x10f0f2){return function(_0x501a48){if(_0x501a48){var _0x33f857=typeof _0x10f0f2[_0x7552('0x1e')]==='undefined'&&typeof _0x10f0f2['limit']==='undefined';var _0x3b1314=_0x501a48[_0x7552('0x1f')];var _0x59bc51=_0x33f857?0x0:_0x10f0f2[_0x7552('0x1e')];var _0x489e11=_0x33f857?_0x501a48[_0x7552('0x1f')]:_0x10f0f2['offset']+_0x10f0f2['limit'];var _0x3b7dd0;if(_0x489e11>=_0x3b1314){_0x489e11=_0x3b1314;_0x3b7dd0=0xc8;}else{_0x3b7dd0=0xce;}_0x2d9ef9['status'](_0x3b7dd0);return _0x2d9ef9[_0x7552('0x20')](_0x7552('0x21'),_0x59bc51+'-'+_0x489e11+'/'+_0x3b1314)[_0x7552('0x1d')](_0x501a48);}return null;};}function patchUpdates(_0x11f5ee){return function(_0x58143f){try{jsonpatch[_0x7552('0x22')](_0x58143f,_0x11f5ee,!![]);}catch(_0x30a461){return BPromise[_0x7552('0x23')](_0x30a461);}return _0x58143f['save']();};}function saveUpdates(_0x12148f,_0x10104d){return function(_0xfed475){if(_0xfed475){return _0xfed475[_0x7552('0x24')](_0x12148f)[_0x7552('0x25')](function(_0x5e8747){return _0x5e8747;});}return null;};}function removeEntity(_0x55a43c,_0x4d9eea){return function(_0x1f2dde){if(_0x1f2dde){return _0x1f2dde[_0x7552('0x26')]()[_0x7552('0x25')](function(){var _0x2c11f5=_0x1f2dde['get']({'plain':!![]});var _0x3063dd=_0x7552('0x27');return db[_0x7552('0x28')]['destroy']({'where':{'type':_0x3063dd,'resourceId':_0x2c11f5['id']}})[_0x7552('0x25')](function(){return _0x1f2dde;});})[_0x7552('0x25')](function(){_0x55a43c['status'](0xcc)[_0x7552('0x1c')]();});}};}function handleEntityNotFound(_0x14a86b,_0x27c580){return function(_0x4209b7){if(!_0x4209b7){_0x14a86b[_0x7552('0x1a')](0x194);}return _0x4209b7;};}function handleError(_0x5cb1cf,_0x3d6445){_0x3d6445=_0x3d6445||0x1f4;return function(_0x365a1e){logger[_0x7552('0x29')](_0x365a1e['stack']);if(_0x365a1e['name']){delete _0x365a1e['name'];}_0x5cb1cf[_0x7552('0x1b')](_0x3d6445)['send'](_0x365a1e);};}exports[_0x7552('0x2a')]=function(_0x197ec6,_0x4eacd8){var _0x30dd3a={},_0x43b1a8={},_0xbc4804={'count':0x0,'rows':[]};var _0x578e98=_[_0x7552('0x2b')](db[_0x7552('0x2c')]['rawAttributes'],function(_0x4382ef){return{'name':_0x4382ef['fieldName'],'type':_0x4382ef[_0x7552('0x2d')][_0x7552('0x2e')]};});_0x43b1a8['model']=_[_0x7552('0x2b')](_0x578e98,_0x7552('0x2f'));_0x43b1a8['query']=_[_0x7552('0x30')](_0x197ec6[_0x7552('0x31')]);_0x43b1a8[_0x7552('0x32')]=_[_0x7552('0x33')](_0x43b1a8[_0x7552('0x34')],_0x43b1a8['query']);_0x30dd3a[_0x7552('0x35')]=_[_0x7552('0x33')](_0x43b1a8[_0x7552('0x34')],qs['fields'](_0x197ec6[_0x7552('0x31')][_0x7552('0x36')]));_0x30dd3a[_0x7552('0x35')]=_0x30dd3a[_0x7552('0x35')][_0x7552('0x37')]?_0x30dd3a[_0x7552('0x35')]:_0x43b1a8[_0x7552('0x34')];if(!_0x197ec6[_0x7552('0x31')]['hasOwnProperty'](_0x7552('0x38'))){_0x30dd3a[_0x7552('0x39')]=qs[_0x7552('0x39')](_0x197ec6[_0x7552('0x31')][_0x7552('0x39')]);_0x30dd3a[_0x7552('0x1e')]=qs['offset'](_0x197ec6[_0x7552('0x31')][_0x7552('0x1e')]);}_0x30dd3a['order']=qs[_0x7552('0x3a')](_0x197ec6[_0x7552('0x31')][_0x7552('0x3a')]);_0x30dd3a['where']=qs['filters'](_[_0x7552('0x3b')](_0x197ec6[_0x7552('0x31')],_0x43b1a8[_0x7552('0x32')]),_0x578e98);if(_0x197ec6[_0x7552('0x31')][_0x7552('0x3c')]){_0x30dd3a[_0x7552('0x3d')]=_['merge'](_0x30dd3a[_0x7552('0x3d')],{'$or':_[_0x7552('0x2b')](_0x578e98,function(_0x5a7457){if(_0x5a7457['type']!=='VIRTUAL'){var _0x56f9dd={};_0x56f9dd[_0x5a7457[_0x7552('0x2f')]]={'$like':'%'+_0x197ec6[_0x7552('0x31')]['filter']+'%'};return _0x56f9dd;}})});}_0x30dd3a=_[_0x7552('0x3e')]({},_0x30dd3a,_0x197ec6[_0x7552('0x3f')]);var _0x22eeb5={'where':_0x30dd3a[_0x7552('0x3d')]};return db['SquareOdbc'][_0x7552('0x1f')](_0x22eeb5)[_0x7552('0x25')](function(_0x41d0c6){_0xbc4804[_0x7552('0x1f')]=_0x41d0c6;if(_0x197ec6[_0x7552('0x31')][_0x7552('0x40')]){_0x30dd3a[_0x7552('0x41')]=[{'all':!![]}];}return db[_0x7552('0x2c')]['findAll'](_0x30dd3a);})[_0x7552('0x25')](function(_0x4855e5){_0xbc4804[_0x7552('0x42')]=_0x4855e5;return _0xbc4804;})[_0x7552('0x25')](respondWithFilteredResult(_0x4eacd8,_0x30dd3a))[_0x7552('0x43')](handleError(_0x4eacd8,null));};exports[_0x7552('0x44')]=function(_0x43ba5c,_0x319ef3){var _0x364168={'raw':!![],'where':{'id':_0x43ba5c[_0x7552('0x45')]['id']}},_0x2f8258={};_0x2f8258[_0x7552('0x34')]=_[_0x7552('0x30')](db[_0x7552('0x2c')][_0x7552('0x46')]);_0x2f8258[_0x7552('0x31')]=_['keys'](_0x43ba5c['query']);_0x2f8258['filters']=_[_0x7552('0x33')](_0x2f8258[_0x7552('0x34')],_0x2f8258[_0x7552('0x31')]);_0x364168[_0x7552('0x35')]=_[_0x7552('0x33')](_0x2f8258[_0x7552('0x34')],qs[_0x7552('0x36')](_0x43ba5c['query'][_0x7552('0x36')]));_0x364168['attributes']=_0x364168['attributes']['length']?_0x364168['attributes']:_0x2f8258[_0x7552('0x34')];if(_0x43ba5c[_0x7552('0x31')]['includeAll']){_0x364168[_0x7552('0x41')]=[{'all':!![]}];}_0x364168=_[_0x7552('0x3e')]({},_0x364168,_0x43ba5c[_0x7552('0x3f')]);return db[_0x7552('0x2c')][_0x7552('0x47')](_0x364168)[_0x7552('0x25')](handleEntityNotFound(_0x319ef3,null))[_0x7552('0x25')](respondWithResult(_0x319ef3,null))[_0x7552('0x43')](handleError(_0x319ef3,null));};exports['create']=function(_0xa1df81,_0x454313){return db[_0x7552('0x2c')][_0x7552('0x48')](_0xa1df81[_0x7552('0x49')],{})[_0x7552('0x25')](function(_0x54ce85){var _0x16478f=_0xa1df81['user'][_0x7552('0x4a')]({'plain':!![]});if(!_0x16478f)throw new Error(_0x7552('0x4b'));if(_0x16478f['role']===_0x7552('0x4c')){var _0x53e959=_0x54ce85[_0x7552('0x4a')]({'plain':!![]});var _0x4b99fa=_0x7552('0x27');return db['UserProfileSection'][_0x7552('0x47')]({'where':{'name':_0x4b99fa,'userProfileId':_0x16478f['userProfileId']},'raw':!![]})[_0x7552('0x25')](function(_0x1ef278){if(_0x1ef278&&_0x1ef278[_0x7552('0x4d')]===0x0){return db['UserProfileResource'][_0x7552('0x48')]({'name':_0x53e959['name'],'resourceId':_0x53e959['id'],'type':_0x1ef278[_0x7552('0x2f')],'sectionId':_0x1ef278['id']},{})[_0x7552('0x25')](function(){return _0x54ce85;});}else{return _0x54ce85;}})['catch'](function(_0x57dc48){logger[_0x7552('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x57dc48);throw _0x57dc48;});}return _0x54ce85;})[_0x7552('0x25')](respondWithResult(_0x454313,0xc9))[_0x7552('0x43')](handleError(_0x454313,null));};exports[_0x7552('0x24')]=function(_0x480a35,_0x5398dc){if(_0x480a35[_0x7552('0x49')]['id']){delete _0x480a35[_0x7552('0x49')]['id'];}return db[_0x7552('0x2c')][_0x7552('0x47')]({'where':{'id':_0x480a35['params']['id']}})[_0x7552('0x25')](handleEntityNotFound(_0x5398dc,null))[_0x7552('0x25')](saveUpdates(_0x480a35[_0x7552('0x49')],null))[_0x7552('0x25')](respondWithResult(_0x5398dc,null))['catch'](handleError(_0x5398dc,null));};exports[_0x7552('0x26')]=function(_0x36d4f3,_0x4758ba){return db[_0x7552('0x2c')][_0x7552('0x47')]({'where':{'id':_0x36d4f3['params']['id']}})[_0x7552('0x25')](handleEntityNotFound(_0x4758ba,null))[_0x7552('0x25')](removeEntity(_0x4758ba,null))[_0x7552('0x43')](handleError(_0x4758ba,null));};exports['test']=function(_0x3a71b,_0x80752c,_0x339d2c){var _0x4bdbe5;return db[_0x7552('0x2c')][_0x7552('0x47')]({'where':{'id':_0x3a71b['params']['id']},'attributes':['id',_0x7552('0x4e')]})[_0x7552('0x25')](handleEntityNotFound(_0x80752c,null))[_0x7552('0x25')](function(_0x435b7d){if(_0x435b7d){var _0x538da6=require(_0x7552('0x4f'))();_0x538da6[_0x7552('0x50')](_0x435b7d[_0x7552('0x4e')]);_0x538da6[_0x7552('0x51')]();return _0x435b7d;}})[_0x7552('0x25')](respondWithResult(_0x80752c,null))[_0x7552('0x43')](handleError(_0x80752c,null));};
\ No newline at end of file
+var _0x58f6=['papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','limit','count','offset','Content-Range','json','apply','reject','save','update','destroy','then','get','UserProfileResource','error','stack','name','send','index','SquareOdbc','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','include','findAll','rows','params','options','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','test','dsn','odbc','openSync','closeSync','eml-format','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring'];(function(_0x45bb22,_0x10db4d){var _0x439f64=function(_0x206988){while(--_0x206988){_0x45bb22['push'](_0x45bb22['shift']());}};_0x439f64(++_0x10db4d);}(_0x58f6,0x1e5));var _0x658f=function(_0x2ac104,_0xbe9850){_0x2ac104=_0x2ac104-0x0;var _0x19d241=_0x58f6[_0x2ac104];return _0x19d241;};'use strict';var emlformat=require(_0x658f('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x658f('0x1'));var BPromise=require(_0x658f('0x2'));var Mustache=require(_0x658f('0x3'));var util=require('util');var path=require(_0x658f('0x4'));var sox=require(_0x658f('0x5'));var csv=require(_0x658f('0x6'));var ejs=require(_0x658f('0x7'));var fs=require('fs');var fs_extra=require(_0x658f('0x8'));var _=require(_0x658f('0x9'));var squel=require('squel');var crypto=require(_0x658f('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x658f('0xb'));var toCsv=require('to-csv');var querystring=require(_0x658f('0xc'));var Papa=require(_0x658f('0xd'));var Redis=require(_0x658f('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x658f('0xf'));var as=require(_0x658f('0x10'));var hardwareService=require(_0x658f('0x11'));var logger=require(_0x658f('0x12'))(_0x658f('0x13'));var utils=require(_0x658f('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x658f('0x15'));var db=require(_0x658f('0x16'))['db'];function respondWithStatusCode(_0x3fd221,_0x2220f2){_0x2220f2=_0x2220f2||0xcc;return function(_0x4242a6){if(_0x4242a6){return _0x3fd221[_0x658f('0x17')](_0x2220f2);}return _0x3fd221[_0x658f('0x18')](_0x2220f2)[_0x658f('0x19')]();};}function respondWithResult(_0x18c4b9,_0x2f9f69){_0x2f9f69=_0x2f9f69||0xc8;return function(_0x136a3d){if(_0x136a3d){return _0x18c4b9[_0x658f('0x18')](_0x2f9f69)['json'](_0x136a3d);}};}function respondWithFilteredResult(_0x3b6c56,_0x44603a){return function(_0xa870dc){if(_0xa870dc){var _0x263978=typeof _0x44603a['offset']==='undefined'&&typeof _0x44603a[_0x658f('0x1a')]==='undefined';var _0x3f486e=_0xa870dc[_0x658f('0x1b')];var _0x483fcd=_0x263978?0x0:_0x44603a[_0x658f('0x1c')];var _0x5bac8b=_0x263978?_0xa870dc[_0x658f('0x1b')]:_0x44603a[_0x658f('0x1c')]+_0x44603a[_0x658f('0x1a')];var _0x4cf70a;if(_0x5bac8b>=_0x3f486e){_0x5bac8b=_0x3f486e;_0x4cf70a=0xc8;}else{_0x4cf70a=0xce;}_0x3b6c56[_0x658f('0x18')](_0x4cf70a);return _0x3b6c56['set'](_0x658f('0x1d'),_0x483fcd+'-'+_0x5bac8b+'/'+_0x3f486e)[_0x658f('0x1e')](_0xa870dc);}return null;};}function patchUpdates(_0x319948){return function(_0x53b8c2){try{jsonpatch[_0x658f('0x1f')](_0x53b8c2,_0x319948,!![]);}catch(_0xd68577){return BPromise[_0x658f('0x20')](_0xd68577);}return _0x53b8c2[_0x658f('0x21')]();};}function saveUpdates(_0x3682b3,_0x70987){return function(_0x2a1918){if(_0x2a1918){return _0x2a1918[_0x658f('0x22')](_0x3682b3)['then'](function(_0x48bab3){return _0x48bab3;});}return null;};}function removeEntity(_0x110194,_0x4517a3){return function(_0x5d9fe4){if(_0x5d9fe4){return _0x5d9fe4[_0x658f('0x23')]()[_0x658f('0x24')](function(){var _0x31b37f=_0x5d9fe4[_0x658f('0x25')]({'plain':!![]});var _0xd72910='ODBC';return db[_0x658f('0x26')]['destroy']({'where':{'type':_0xd72910,'resourceId':_0x31b37f['id']}})['then'](function(){return _0x5d9fe4;});})[_0x658f('0x24')](function(){_0x110194[_0x658f('0x18')](0xcc)[_0x658f('0x19')]();});}};}function handleEntityNotFound(_0x3e6d0d,_0x25f215){return function(_0x2b4325){if(!_0x2b4325){_0x3e6d0d[_0x658f('0x17')](0x194);}return _0x2b4325;};}function handleError(_0x4fb1f9,_0x4e35f2){_0x4e35f2=_0x4e35f2||0x1f4;return function(_0x3abadf){logger[_0x658f('0x27')](_0x3abadf[_0x658f('0x28')]);if(_0x3abadf[_0x658f('0x29')]){delete _0x3abadf[_0x658f('0x29')];}_0x4fb1f9[_0x658f('0x18')](_0x4e35f2)[_0x658f('0x2a')](_0x3abadf);};}exports[_0x658f('0x2b')]=function(_0x238e43,_0x17ee3c){var _0x59ba89={},_0x9d16c3={},_0x486418={'count':0x0,'rows':[]};var _0x3ed88e=_['map'](db[_0x658f('0x2c')][_0x658f('0x2d')],function(_0x18a010){return{'name':_0x18a010[_0x658f('0x2e')],'type':_0x18a010[_0x658f('0x2f')]['key']};});_0x9d16c3[_0x658f('0x30')]=_['map'](_0x3ed88e,_0x658f('0x29'));_0x9d16c3[_0x658f('0x31')]=_[_0x658f('0x32')](_0x238e43['query']);_0x9d16c3[_0x658f('0x33')]=_[_0x658f('0x34')](_0x9d16c3[_0x658f('0x30')],_0x9d16c3['query']);_0x59ba89[_0x658f('0x35')]=_[_0x658f('0x34')](_0x9d16c3['model'],qs[_0x658f('0x36')](_0x238e43['query'][_0x658f('0x36')]));_0x59ba89[_0x658f('0x35')]=_0x59ba89[_0x658f('0x35')]['length']?_0x59ba89['attributes']:_0x9d16c3['model'];if(!_0x238e43[_0x658f('0x31')][_0x658f('0x37')](_0x658f('0x38'))){_0x59ba89[_0x658f('0x1a')]=qs['limit'](_0x238e43[_0x658f('0x31')][_0x658f('0x1a')]);_0x59ba89[_0x658f('0x1c')]=qs[_0x658f('0x1c')](_0x238e43[_0x658f('0x31')][_0x658f('0x1c')]);}_0x59ba89[_0x658f('0x39')]=qs[_0x658f('0x3a')](_0x238e43[_0x658f('0x31')][_0x658f('0x3a')]);_0x59ba89[_0x658f('0x3b')]=qs[_0x658f('0x33')](_[_0x658f('0x3c')](_0x238e43[_0x658f('0x31')],_0x9d16c3[_0x658f('0x33')]),_0x3ed88e);if(_0x238e43[_0x658f('0x31')][_0x658f('0x3d')]){_0x59ba89['where']=_[_0x658f('0x3e')](_0x59ba89[_0x658f('0x3b')],{'$or':_['map'](_0x3ed88e,function(_0x407370){if(_0x407370[_0x658f('0x2f')]!=='VIRTUAL'){var _0x5b7575={};_0x5b7575[_0x407370[_0x658f('0x29')]]={'$like':'%'+_0x238e43['query'][_0x658f('0x3d')]+'%'};return _0x5b7575;}})});}_0x59ba89=_[_0x658f('0x3e')]({},_0x59ba89,_0x238e43['options']);var _0x203b4a={'where':_0x59ba89[_0x658f('0x3b')]};return db[_0x658f('0x2c')][_0x658f('0x1b')](_0x203b4a)[_0x658f('0x24')](function(_0x36758d){_0x486418[_0x658f('0x1b')]=_0x36758d;if(_0x238e43[_0x658f('0x31')][_0x658f('0x3f')]){_0x59ba89[_0x658f('0x40')]=[{'all':!![]}];}return db[_0x658f('0x2c')][_0x658f('0x41')](_0x59ba89);})[_0x658f('0x24')](function(_0x59989a){_0x486418[_0x658f('0x42')]=_0x59989a;return _0x486418;})['then'](respondWithFilteredResult(_0x17ee3c,_0x59ba89))['catch'](handleError(_0x17ee3c,null));};exports['show']=function(_0x439676,_0x30bc46){var _0x3af6fa={'raw':!![],'where':{'id':_0x439676[_0x658f('0x43')]['id']}},_0x458c61={};_0x458c61['model']=_[_0x658f('0x32')](db['SquareOdbc'][_0x658f('0x2d')]);_0x458c61[_0x658f('0x31')]=_['keys'](_0x439676[_0x658f('0x31')]);_0x458c61['filters']=_['intersection'](_0x458c61[_0x658f('0x30')],_0x458c61[_0x658f('0x31')]);_0x3af6fa[_0x658f('0x35')]=_[_0x658f('0x34')](_0x458c61[_0x658f('0x30')],qs['fields'](_0x439676[_0x658f('0x31')][_0x658f('0x36')]));_0x3af6fa[_0x658f('0x35')]=_0x3af6fa[_0x658f('0x35')]['length']?_0x3af6fa['attributes']:_0x458c61[_0x658f('0x30')];if(_0x439676['query'][_0x658f('0x3f')]){_0x3af6fa[_0x658f('0x40')]=[{'all':!![]}];}_0x3af6fa=_[_0x658f('0x3e')]({},_0x3af6fa,_0x439676[_0x658f('0x44')]);return db['SquareOdbc'][_0x658f('0x45')](_0x3af6fa)[_0x658f('0x24')](handleEntityNotFound(_0x30bc46,null))[_0x658f('0x24')](respondWithResult(_0x30bc46,null))[_0x658f('0x46')](handleError(_0x30bc46,null));};exports[_0x658f('0x47')]=function(_0x5a4043,_0x69990e){return db[_0x658f('0x2c')][_0x658f('0x47')](_0x5a4043[_0x658f('0x48')],{})[_0x658f('0x24')](function(_0x5fff8){var _0x682ccf=_0x5a4043['user'][_0x658f('0x25')]({'plain':!![]});if(!_0x682ccf)throw new Error(_0x658f('0x49'));if(_0x682ccf['role']===_0x658f('0x4a')){var _0x1b041d=_0x5fff8['get']({'plain':!![]});var _0x38a9c6='ODBC';return db[_0x658f('0x4b')]['find']({'where':{'name':_0x38a9c6,'userProfileId':_0x682ccf[_0x658f('0x4c')]},'raw':!![]})[_0x658f('0x24')](function(_0x43bba8){if(_0x43bba8&&_0x43bba8['autoAssociation']===0x0){return db[_0x658f('0x26')][_0x658f('0x47')]({'name':_0x1b041d['name'],'resourceId':_0x1b041d['id'],'type':_0x43bba8[_0x658f('0x29')],'sectionId':_0x43bba8['id']},{})['then'](function(){return _0x5fff8;});}else{return _0x5fff8;}})[_0x658f('0x46')](function(_0x1a236c){logger[_0x658f('0x27')](_0x658f('0x4d'),_0x1a236c);throw _0x1a236c;});}return _0x5fff8;})[_0x658f('0x24')](respondWithResult(_0x69990e,0xc9))[_0x658f('0x46')](handleError(_0x69990e,null));};exports[_0x658f('0x22')]=function(_0x2d5eee,_0x1962c2){if(_0x2d5eee[_0x658f('0x48')]['id']){delete _0x2d5eee['body']['id'];}return db[_0x658f('0x2c')][_0x658f('0x45')]({'where':{'id':_0x2d5eee[_0x658f('0x43')]['id']}})['then'](handleEntityNotFound(_0x1962c2,null))[_0x658f('0x24')](saveUpdates(_0x2d5eee[_0x658f('0x48')],null))[_0x658f('0x24')](respondWithResult(_0x1962c2,null))[_0x658f('0x46')](handleError(_0x1962c2,null));};exports[_0x658f('0x23')]=function(_0x5b343b,_0x303cf4){return db['SquareOdbc'][_0x658f('0x45')]({'where':{'id':_0x5b343b[_0x658f('0x43')]['id']}})['then'](handleEntityNotFound(_0x303cf4,null))[_0x658f('0x24')](removeEntity(_0x303cf4,null))[_0x658f('0x46')](handleError(_0x303cf4,null));};exports[_0x658f('0x4e')]=function(_0x533e79,_0x4d43e9,_0x4052e3){var _0x487d73;return db[_0x658f('0x2c')][_0x658f('0x45')]({'where':{'id':_0x533e79[_0x658f('0x43')]['id']},'attributes':['id',_0x658f('0x4f')]})['then'](handleEntityNotFound(_0x4d43e9,null))[_0x658f('0x24')](function(_0x1d590f){if(_0x1d590f){var _0x17eb09=require(_0x658f('0x50'))();_0x17eb09[_0x658f('0x51')](_0x1d590f['dsn']);_0x17eb09[_0x658f('0x52')]();return _0x1d590f;}})['then'](respondWithResult(_0x4d43e9,null))[_0x658f('0x46')](handleError(_0x4d43e9,null));};
\ No newline at end of file
index f8c9378..ce6b4e3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x56b0=['square_odbc','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareOdbc.attributes','define'];(function(_0x131c0a,_0x2c6e59){var _0xd98b2c=function(_0x51c98f){while(--_0x51c98f){_0x131c0a['push'](_0x131c0a['shift']());}};_0xd98b2c(++_0x2c6e59);}(_0x56b0,0x15d));var _0x056b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x56b0[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x056b('0x0'));var logger=require(_0x056b('0x1'))(_0x056b('0x2'));var moment=require(_0x056b('0x3'));var BPromise=require(_0x056b('0x4'));var rp=require(_0x056b('0x5'));var fs=require('fs');var path=require(_0x056b('0x6'));var rimraf=require(_0x056b('0x7'));var config=require(_0x056b('0x8'));var attributes=require(_0x056b('0x9'));module['exports']=function(_0xf86089,_0x506217){return _0xf86089[_0x056b('0xa')]('SquareOdbc',attributes,{'tableName':_0x056b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4a1c=['path','rimraf','../../config/environment','./squareOdbc.attributes','exports','define','SquareOdbc','util','../../config/logger','api','moment','bluebird'];(function(_0x2572f9,_0x282be2){var _0x50e1e1=function(_0x381e33){while(--_0x381e33){_0x2572f9['push'](_0x2572f9['shift']());}};_0x50e1e1(++_0x282be2);}(_0x4a1c,0x1ab));var _0xc4a1=function(_0x2431d6,_0x25189a){_0x2431d6=_0x2431d6-0x0;var _0x4d0f9b=_0x4a1c[_0x2431d6];return _0x4d0f9b;};'use strict';var _=require('lodash');var util=require(_0xc4a1('0x0'));var logger=require(_0xc4a1('0x1'))(_0xc4a1('0x2'));var moment=require(_0xc4a1('0x3'));var BPromise=require(_0xc4a1('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc4a1('0x5'));var rimraf=require(_0xc4a1('0x6'));var config=require(_0xc4a1('0x7'));var attributes=require(_0xc4a1('0x8'));module[_0xc4a1('0x9')]=function(_0x3c60e3,_0x219579){return _0x3c60e3[_0xc4a1('0xa')](_0xc4a1('0xb'),attributes,{'tableName':'square_odbc','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 7b586e9..5f5e990 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf7eb=['model','map','then','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','info','debug','stringify','error','code','SquareOdbc,\x20%s,\x20%s','message','request\x20sent','result','ShowSquareOdbc','SquareOdbc','options','raw','where','attributes','include'];(function(_0x3d3dfd,_0x4bc7fc){var _0x4c54f8=function(_0x3ad5a5){while(--_0x3ad5a5){_0x3d3dfd['push'](_0x3d3dfd['shift']());}};_0x4c54f8(++_0x4bc7fc);}(_0xf7eb,0x80));var _0xbf7e=function(_0xe79a9d,_0x1ce962){_0xe79a9d=_0xe79a9d-0x0;var _0x108d5f=_0xf7eb[_0xe79a9d];return _0x108d5f;};'use strict';var _=require('lodash');var util=require(_0xbf7e('0x0'));var moment=require(_0xbf7e('0x1'));var BPromise=require(_0xbf7e('0x2'));var rs=require(_0xbf7e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbf7e('0x4'))['db'];var utils=require(_0xbf7e('0x5'));var logger=require('../../config/logger')(_0xbf7e('0x6'));var config=require(_0xbf7e('0x7'));var jayson=require(_0xbf7e('0x8'));var client=jayson[_0xbf7e('0x9')][_0xbf7e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x34612c,_0x16c693,_0x20f508){return new BPromise(function(_0x550c4d,_0x109f0c){return client['request'](_0x34612c,_0x20f508)['then'](function(_0x37a795){logger[_0xbf7e('0xb')]('SquareOdbc,\x20%s,\x20%s',_0x16c693,'request\x20sent');logger[_0xbf7e('0xc')]('SquareOdbc,\x20%s,\x20%s,\x20%s',_0x16c693,'request\x20sent',JSON[_0xbf7e('0xd')](_0x37a795));if(_0x37a795[_0xbf7e('0xe')]){if(_0x37a795[_0xbf7e('0xe')][_0xbf7e('0xf')]===0x1f4){logger[_0xbf7e('0xe')](_0xbf7e('0x10'),_0x16c693,_0x37a795['error'][_0xbf7e('0x11')]);return _0x109f0c(_0x37a795[_0xbf7e('0xe')][_0xbf7e('0x11')]);}logger[_0xbf7e('0xe')](_0xbf7e('0x10'),_0x16c693,_0x37a795[_0xbf7e('0xe')][_0xbf7e('0x11')]);return _0x550c4d(_0x37a795['error'][_0xbf7e('0x11')]);}else{logger[_0xbf7e('0xb')]('SquareOdbc,\x20%s,\x20%s',_0x16c693,_0xbf7e('0x12'));_0x550c4d(_0x37a795[_0xbf7e('0x13')][_0xbf7e('0x11')]);}})['catch'](function(_0x59fc92){logger[_0xbf7e('0xe')]('SquareOdbc,\x20%s,\x20%s',_0x16c693,_0x59fc92);_0x109f0c(_0x59fc92);});});}exports[_0xbf7e('0x14')]=function(_0xf44706){var _0x1b4310=this;return new Promise(function(_0x4a62f9,_0x1f7af8){return db[_0xbf7e('0x15')]['find']({'raw':_0xf44706['options']?_0xf44706[_0xbf7e('0x16')][_0xbf7e('0x17')]===undefined?!![]:![]:!![],'where':_0xf44706[_0xbf7e('0x16')]?_0xf44706[_0xbf7e('0x16')][_0xbf7e('0x18')]||null:null,'attributes':_0xf44706['options']?_0xf44706[_0xbf7e('0x16')][_0xbf7e('0x19')]||null:null,'include':_0xf44706[_0xbf7e('0x16')]?_0xf44706['options']['include']?_['map'](_0xf44706[_0xbf7e('0x16')][_0xbf7e('0x1a')],function(_0x589db2){return{'model':db[_0x589db2[_0xbf7e('0x1b')]],'as':_0x589db2['as'],'attributes':_0x589db2[_0xbf7e('0x19')],'include':_0x589db2[_0xbf7e('0x1a')]?_[_0xbf7e('0x1c')](_0x589db2[_0xbf7e('0x1a')],function(_0x172b09){return{'model':db[_0x172b09['model']],'as':_0x172b09['as'],'attributes':_0x172b09[_0xbf7e('0x19')],'include':_0x172b09[_0xbf7e('0x1a')]?_[_0xbf7e('0x1c')](_0x172b09[_0xbf7e('0x1a')],function(_0x1d6d21){return{'model':db[_0x1d6d21[_0xbf7e('0x1b')]],'as':_0x1d6d21['as'],'attributes':_0x1d6d21[_0xbf7e('0x19')]};}):[]};}):[]};}):[]:[]})[_0xbf7e('0x1d')](function(_0x5a1dc2){logger[_0xbf7e('0xb')](_0xbf7e('0x14'),_0xf44706);logger['debug']('ShowSquareOdbc',_0xf44706,JSON[_0xbf7e('0xd')](_0x5a1dc2));_0x4a62f9(_0x5a1dc2);})[_0xbf7e('0x1e')](function(_0xabb3d3){logger['error'](_0xbf7e('0x14'),_0xabb3d3[_0xbf7e('0x11')],_0xf44706);_0x1f7af8(_0x1b4310[_0xbf7e('0xe')](0x1f4,_0xabb3d3[_0xbf7e('0x11')]));});});};
\ No newline at end of file
+var _0x6b5f=['attributes','then','ShowSquareOdbc','lodash','moment','bluebird','../../mysqldb','../../config/environment','jayson/promise','client','request','info','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','find','options','raw','where','include','map','model'];(function(_0x129479,_0x256c7e){var _0x3fa0ce=function(_0x35401f){while(--_0x35401f){_0x129479['push'](_0x129479['shift']());}};_0x3fa0ce(++_0x256c7e);}(_0x6b5f,0x15f));var _0xf6b5=function(_0x327973,_0x22f5bc){_0x327973=_0x327973-0x0;var _0x1b6281=_0x6b5f[_0x327973];return _0x1b6281;};'use strict';var _=require(_0xf6b5('0x0'));var util=require('util');var moment=require(_0xf6b5('0x1'));var BPromise=require(_0xf6b5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf6b5('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xf6b5('0x4'));var jayson=require(_0xf6b5('0x5'));var client=jayson[_0xf6b5('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1f17ca,_0x1df17f,_0x4c6d9e){return new BPromise(function(_0x46527d,_0x4ad4f3){return client[_0xf6b5('0x7')](_0x1f17ca,_0x4c6d9e)['then'](function(_0x33fd41){logger[_0xf6b5('0x8')](_0xf6b5('0x9'),_0x1df17f,_0xf6b5('0xa'));logger[_0xf6b5('0xb')](_0xf6b5('0xc'),_0x1df17f,_0xf6b5('0xa'),JSON[_0xf6b5('0xd')](_0x33fd41));if(_0x33fd41['error']){if(_0x33fd41[_0xf6b5('0xe')][_0xf6b5('0xf')]===0x1f4){logger[_0xf6b5('0xe')]('SquareOdbc,\x20%s,\x20%s',_0x1df17f,_0x33fd41[_0xf6b5('0xe')][_0xf6b5('0x10')]);return _0x4ad4f3(_0x33fd41[_0xf6b5('0xe')][_0xf6b5('0x10')]);}logger[_0xf6b5('0xe')](_0xf6b5('0x9'),_0x1df17f,_0x33fd41['error'][_0xf6b5('0x10')]);return _0x46527d(_0x33fd41[_0xf6b5('0xe')][_0xf6b5('0x10')]);}else{logger[_0xf6b5('0x8')](_0xf6b5('0x9'),_0x1df17f,'request\x20sent');_0x46527d(_0x33fd41[_0xf6b5('0x11')][_0xf6b5('0x10')]);}})[_0xf6b5('0x12')](function(_0x44d8bb){logger[_0xf6b5('0xe')](_0xf6b5('0x9'),_0x1df17f,_0x44d8bb);_0x4ad4f3(_0x44d8bb);});});}exports['ShowSquareOdbc']=function(_0x3f95d1){var _0x23f751=this;return new Promise(function(_0x1bb113,_0x2bb06e){return db['SquareOdbc'][_0xf6b5('0x13')]({'raw':_0x3f95d1[_0xf6b5('0x14')]?_0x3f95d1[_0xf6b5('0x14')][_0xf6b5('0x15')]===undefined?!![]:![]:!![],'where':_0x3f95d1['options']?_0x3f95d1[_0xf6b5('0x14')][_0xf6b5('0x16')]||null:null,'attributes':_0x3f95d1[_0xf6b5('0x14')]?_0x3f95d1[_0xf6b5('0x14')]['attributes']||null:null,'include':_0x3f95d1['options']?_0x3f95d1[_0xf6b5('0x14')][_0xf6b5('0x17')]?_[_0xf6b5('0x18')](_0x3f95d1[_0xf6b5('0x14')][_0xf6b5('0x17')],function(_0x4f4f2a){return{'model':db[_0x4f4f2a[_0xf6b5('0x19')]],'as':_0x4f4f2a['as'],'attributes':_0x4f4f2a['attributes'],'include':_0x4f4f2a[_0xf6b5('0x17')]?_[_0xf6b5('0x18')](_0x4f4f2a[_0xf6b5('0x17')],function(_0x313238){return{'model':db[_0x313238[_0xf6b5('0x19')]],'as':_0x313238['as'],'attributes':_0x313238[_0xf6b5('0x1a')],'include':_0x313238[_0xf6b5('0x17')]?_[_0xf6b5('0x18')](_0x313238['include'],function(_0x51bd7b){return{'model':db[_0x51bd7b[_0xf6b5('0x19')]],'as':_0x51bd7b['as'],'attributes':_0x51bd7b['attributes']};}):[]};}):[]};}):[]:[]})[_0xf6b5('0x1b')](function(_0x159ce7){logger[_0xf6b5('0x8')](_0xf6b5('0x1c'),_0x3f95d1);logger[_0xf6b5('0xb')](_0xf6b5('0x1c'),_0x3f95d1,JSON[_0xf6b5('0xd')](_0x159ce7));_0x1bb113(_0x159ce7);})[_0xf6b5('0x12')](function(_0x33c4a5){logger['error'](_0xf6b5('0x1c'),_0x33c4a5[_0xf6b5('0x10')],_0x3f95d1);_0x2bb06e(_0x23f751['error'](0x1f4,_0x33c4a5['message']));});});};
\ No newline at end of file
index dea6ed6..2225547 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x94c2=['../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller','get','index','isAuthenticated','show','/:id/users','post','addUsers','put','/:id','update','delete','destroy','removeUsers','exports','util','connect-timeout','express','Router','fs-extra'];(function(_0x323a59,_0x59e734){var _0x5560e2=function(_0x43e123){while(--_0x43e123){_0x323a59['push'](_0x323a59['shift']());}};_0x5560e2(++_0x59e734);}(_0x94c2,0x13d));var _0x294c=function(_0x2dea24,_0x2fc021){_0x2dea24=_0x2dea24-0x0;var _0x309d58=_0x94c2[_0x2dea24];return _0x309d58;};'use strict';var multer=require('multer');var util=require(_0x294c('0x0'));var path=require('path');var timeout=require(_0x294c('0x1'));var express=require(_0x294c('0x2'));var router=express[_0x294c('0x3')]();var fs_extra=require(_0x294c('0x4'));var auth=require(_0x294c('0x5'));var interaction=require(_0x294c('0x6'));var config=require(_0x294c('0x7'));var controller=require(_0x294c('0x8'));router[_0x294c('0x9')]('/',auth['isAuthenticated'](),controller[_0x294c('0xa')]);router['get']('/:id',auth[_0x294c('0xb')](),controller[_0x294c('0xc')]);router[_0x294c('0x9')](_0x294c('0xd'),auth['isAuthenticated'](),controller['getUsers']);router[_0x294c('0xe')]('/',auth[_0x294c('0xb')](),controller['create']);router['post'](_0x294c('0xd'),auth[_0x294c('0xb')](),controller[_0x294c('0xf')]);router[_0x294c('0x10')](_0x294c('0x11'),auth[_0x294c('0xb')](),controller[_0x294c('0x12')]);router[_0x294c('0x13')](_0x294c('0x11'),auth[_0x294c('0xb')](),controller[_0x294c('0x14')]);router[_0x294c('0x13')]('/:id/users',auth['isAuthenticated'](),controller[_0x294c('0x15')]);module[_0x294c('0x16')]=router;
\ No newline at end of file
+var _0x757c=['removeUsers','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','/:id','show','/:id/users','post','put','update','delete','destroy'];(function(_0xa63ea3,_0x4367ff){var _0x2aa5ff=function(_0x30dc84){while(--_0x30dc84){_0xa63ea3['push'](_0xa63ea3['shift']());}};_0x2aa5ff(++_0x4367ff);}(_0x757c,0x191));var _0xc757=function(_0x4fa441,_0x46c8b7){_0x4fa441=_0x4fa441-0x0;var _0x37c1cf=_0x757c[_0x4fa441];return _0x37c1cf;};'use strict';var multer=require(_0xc757('0x0'));var util=require(_0xc757('0x1'));var path=require('path');var timeout=require(_0xc757('0x2'));var express=require(_0xc757('0x3'));var router=express[_0xc757('0x4')]();var fs_extra=require(_0xc757('0x5'));var auth=require(_0xc757('0x6'));var interaction=require(_0xc757('0x7'));var config=require(_0xc757('0x8'));var controller=require('./squareProject.controller');router['get']('/',auth[_0xc757('0x9')](),controller['index']);router[_0xc757('0xa')](_0xc757('0xb'),auth[_0xc757('0x9')](),controller[_0xc757('0xc')]);router[_0xc757('0xa')](_0xc757('0xd'),auth[_0xc757('0x9')](),controller['getUsers']);router['post']('/',auth[_0xc757('0x9')](),controller['create']);router[_0xc757('0xe')]('/:id/users',auth[_0xc757('0x9')](),controller['addUsers']);router[_0xc757('0xf')](_0xc757('0xb'),auth[_0xc757('0x9')](),controller[_0xc757('0x10')]);router[_0xc757('0x11')]('/:id',auth[_0xc757('0x9')](),controller[_0xc757('0x12')]);router[_0xc757('0x11')]('/:id/users',auth['isAuthenticated'](),controller[_0xc757('0x13')]);module[_0xc757('0x14')]=router;
\ No newline at end of file
index c044669..808bfeb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4a51=['production','toString','utf8','DATE','sequelize','exports','STRING','TEXT','long','getDataValue','preproduction'];(function(_0xba41db,_0x27563f){var _0x55faaf=function(_0x1acd4f){while(--_0x1acd4f){_0xba41db['push'](_0xba41db['shift']());}};_0x55faaf(++_0x27563f);}(_0x4a51,0x14e));var _0x14a5=function(_0x2dea24,_0x2fc021){_0x2dea24=_0x2dea24-0x0;var _0x309d58=_0x4a51[_0x2dea24];return _0x309d58;};'use strict';var Sequelize=require(_0x14a5('0x0'));module[_0x14a5('0x1')]={'name':{'type':Sequelize[_0x14a5('0x2')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x14a5('0x2')]},'notes':{'type':Sequelize[_0x14a5('0x3')]},'preproduction':{'type':Sequelize['BLOB'](_0x14a5('0x4')),'get':function(){if(this[_0x14a5('0x5')]('preproduction')){return this['getDataValue'](_0x14a5('0x6'))['toString']('utf8');}}},'production':{'type':Sequelize['BLOB']('long'),'get':function(){if(this['getDataValue'](_0x14a5('0x7'))){return this[_0x14a5('0x5')](_0x14a5('0x7'))[_0x14a5('0x8')](_0x14a5('0x9'));}}},'savedAt':{'type':Sequelize['DATE']},'publishedAt':{'type':Sequelize[_0x14a5('0xa')]}};
\ No newline at end of file
+var _0x4489=['TEXT','BLOB','toString','getDataValue','production','DATE','sequelize','exports','name','STRING'];(function(_0x36b518,_0xb0b62d){var _0x34693e=function(_0x1626cb){while(--_0x1626cb){_0x36b518['push'](_0x36b518['shift']());}};_0x34693e(++_0xb0b62d);}(_0x4489,0x164));var _0x9448=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4489[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x9448('0x0'));module[_0x9448('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x9448('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x9448('0x3')]},'notes':{'type':Sequelize[_0x9448('0x4')]},'preproduction':{'type':Sequelize[_0x9448('0x5')]('long'),'get':function(){if(this['getDataValue']('preproduction')){return this['getDataValue']('preproduction')[_0x9448('0x6')]('utf8');}}},'production':{'type':Sequelize[_0x9448('0x5')]('long'),'get':function(){if(this[_0x9448('0x7')](_0x9448('0x8'))){return this[_0x9448('0x7')]('production')['toString']('utf8');}}},'savedAt':{'type':Sequelize[_0x9448('0x9')]},'publishedAt':{'type':Sequelize[_0x9448('0x9')]}};
\ No newline at end of file
index 993107c..c7c57f8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x96ee=['fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./squareProject.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','then','get','SquareProjects','UserProfileResource','error','stack','name','index','rawAttributes','fieldName','type','map','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','SquareProject','includeAll','findAll','rows','catch','params','length','options','find','create','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','addUsers','ids','omit','removeUsers','isArray','emit','getUsers','findOne','User','eml-format','fast-json-patch','request-promise','bluebird','path','sox','to-csv'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x96ee,0x10d));var _0xe96e=function(_0x56989c,_0x6781f0){_0x56989c=_0x56989c-0x0;var _0x22ab27=_0x96ee[_0x56989c];return _0x22ab27;};'use strict';var emlformat=require(_0xe96e('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xe96e('0x1'));var rp=require(_0xe96e('0x2'));var moment=require('moment');var BPromise=require(_0xe96e('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0xe96e('0x4'));var sox=require(_0xe96e('0x5'));var csv=require(_0xe96e('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe96e('0x7'));var _=require('lodash');var squel=require(_0xe96e('0x8'));var crypto=require(_0xe96e('0x9'));var jsforce=require(_0xe96e('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xe96e('0x6'));var querystring=require(_0xe96e('0xb'));var Papa=require(_0xe96e('0xc'));var Redis=require(_0xe96e('0xd'));var authService=require(_0xe96e('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe96e('0xf'));var logger=require(_0xe96e('0x10'))('api');var utils=require(_0xe96e('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0xe96e('0x12'));var db=require(_0xe96e('0x13'))['db'];config[_0xe96e('0x14')]=_[_0xe96e('0x15')](config[_0xe96e('0x14')],{'host':'localhost','port':0x18eb});var socket=require(_0xe96e('0x16'))(new Redis(config[_0xe96e('0x14')]));require(_0xe96e('0x17'))[_0xe96e('0x18')](socket);function respondWithStatusCode(_0xdf335a,_0x87a994){_0x87a994=_0x87a994||0xcc;return function(_0x4ad11e){if(_0x4ad11e){return _0xdf335a[_0xe96e('0x19')](_0x87a994);}return _0xdf335a[_0xe96e('0x1a')](_0x87a994)[_0xe96e('0x1b')]();};}function respondWithResult(_0x5b6626,_0x1bb21b){_0x1bb21b=_0x1bb21b||0xc8;return function(_0x394eab){if(_0x394eab){return _0x5b6626[_0xe96e('0x1a')](_0x1bb21b)[_0xe96e('0x1c')](_0x394eab);}};}function respondWithFilteredResult(_0x2676d3,_0x5cb82e){return function(_0x3820c7){if(_0x3820c7){var _0xb8deb4=typeof _0x5cb82e[_0xe96e('0x1d')]===_0xe96e('0x1e')&&typeof _0x5cb82e[_0xe96e('0x1f')]===_0xe96e('0x1e');var _0x54f89d=_0x3820c7['count'];var _0x2dacb0=_0xb8deb4?0x0:_0x5cb82e[_0xe96e('0x1d')];var _0x4024d6=_0xb8deb4?_0x3820c7[_0xe96e('0x20')]:_0x5cb82e['offset']+_0x5cb82e[_0xe96e('0x1f')];var _0x19f0cf;if(_0x4024d6>=_0x54f89d){_0x4024d6=_0x54f89d;_0x19f0cf=0xc8;}else{_0x19f0cf=0xce;}_0x2676d3[_0xe96e('0x1a')](_0x19f0cf);return _0x2676d3[_0xe96e('0x21')](_0xe96e('0x22'),_0x2dacb0+'-'+_0x4024d6+'/'+_0x54f89d)[_0xe96e('0x1c')](_0x3820c7);}return null;};}function patchUpdates(_0x32cd20){return function(_0xa01bac){try{jsonpatch[_0xe96e('0x23')](_0xa01bac,_0x32cd20,!![]);}catch(_0x4e4e7e){return BPromise[_0xe96e('0x24')](_0x4e4e7e);}return _0xa01bac[_0xe96e('0x25')]();};}function saveUpdates(_0x1dd5a9,_0x3eaee0){return function(_0x4fd51c){if(_0x4fd51c){return _0x4fd51c['update'](_0x1dd5a9)['then'](function(_0x31aaa0){return _0x31aaa0;});}return null;};}function removeEntity(_0x4121fb,_0x3d6386){return function(_0xc27273){if(_0xc27273){return _0xc27273[_0xe96e('0x26')]()[_0xe96e('0x27')](function(){var _0x1af4b6=_0xc27273[_0xe96e('0x28')]({'plain':!![]});var _0x3d8383=_0xe96e('0x29');return db[_0xe96e('0x2a')]['destroy']({'where':{'type':_0x3d8383,'resourceId':_0x1af4b6['id']}})[_0xe96e('0x27')](function(){return _0xc27273;});})[_0xe96e('0x27')](function(){_0x4121fb[_0xe96e('0x1a')](0xcc)[_0xe96e('0x1b')]();});}};}function handleEntityNotFound(_0x4d1b80,_0x265fb8){return function(_0x23a0a6){if(!_0x23a0a6){_0x4d1b80[_0xe96e('0x19')](0x194);}return _0x23a0a6;};}function handleError(_0x3dac8e,_0x450a98){_0x450a98=_0x450a98||0x1f4;return function(_0x26682d){logger[_0xe96e('0x2b')](_0x26682d[_0xe96e('0x2c')]);if(_0x26682d[_0xe96e('0x2d')]){delete _0x26682d['name'];}_0x3dac8e[_0xe96e('0x1a')](_0x450a98)['send'](_0x26682d);};}exports[_0xe96e('0x2e')]=function(_0x32b3c2,_0x495d7f){var _0x20829c={},_0x27f24b={},_0x26c1ad={'count':0x0,'rows':[]};var _0x33fe87=_['map'](db['SquareProject'][_0xe96e('0x2f')],function(_0x4a65d8){return{'name':_0x4a65d8[_0xe96e('0x30')],'type':_0x4a65d8[_0xe96e('0x31')]['key']};});_0x27f24b['model']=_[_0xe96e('0x32')](_0x33fe87,_0xe96e('0x2d'));_0x27f24b[_0xe96e('0x33')]=_[_0xe96e('0x34')](_0x32b3c2[_0xe96e('0x33')]);_0x27f24b[_0xe96e('0x35')]=_[_0xe96e('0x36')](_0x27f24b[_0xe96e('0x37')],_0x27f24b['query']);_0x20829c[_0xe96e('0x38')]=_[_0xe96e('0x36')](_0x27f24b['model'],qs[_0xe96e('0x39')](_0x32b3c2[_0xe96e('0x33')]['fields']));_0x20829c[_0xe96e('0x38')]=_0x20829c[_0xe96e('0x38')]['length']?_0x20829c[_0xe96e('0x38')]:_0x27f24b['model'];if(!_0x32b3c2['query'][_0xe96e('0x3a')](_0xe96e('0x3b'))){_0x20829c[_0xe96e('0x1f')]=qs[_0xe96e('0x1f')](_0x32b3c2['query']['limit']);_0x20829c[_0xe96e('0x1d')]=qs[_0xe96e('0x1d')](_0x32b3c2[_0xe96e('0x33')][_0xe96e('0x1d')]);}_0x20829c[_0xe96e('0x3c')]=qs[_0xe96e('0x3d')](_0x32b3c2[_0xe96e('0x33')][_0xe96e('0x3d')]);_0x20829c[_0xe96e('0x3e')]=qs[_0xe96e('0x35')](_['pick'](_0x32b3c2[_0xe96e('0x33')],_0x27f24b[_0xe96e('0x35')]),_0x33fe87);if(_0x32b3c2[_0xe96e('0x33')]['filter']){_0x20829c[_0xe96e('0x3e')]=_[_0xe96e('0x3f')](_0x20829c[_0xe96e('0x3e')],{'$or':_[_0xe96e('0x32')](_0x33fe87,function(_0x39ce7b){if(_0x39ce7b[_0xe96e('0x31')]!==_0xe96e('0x40')){var _0x34efa6={};_0x34efa6[_0x39ce7b['name']]={'$like':'%'+_0x32b3c2[_0xe96e('0x33')][_0xe96e('0x41')]+'%'};return _0x34efa6;}})});}_0x20829c=_[_0xe96e('0x3f')]({},_0x20829c,_0x32b3c2['options']);var _0x415e21={'where':_0x20829c[_0xe96e('0x3e')]};return db[_0xe96e('0x42')]['count'](_0x415e21)[_0xe96e('0x27')](function(_0x25f53d){_0x26c1ad[_0xe96e('0x20')]=_0x25f53d;if(_0x32b3c2[_0xe96e('0x33')][_0xe96e('0x43')]){_0x20829c['include']=[{'all':!![]}];}return db[_0xe96e('0x42')][_0xe96e('0x44')](_0x20829c);})[_0xe96e('0x27')](function(_0x1d032f){_0x26c1ad[_0xe96e('0x45')]=_0x1d032f;return _0x26c1ad;})[_0xe96e('0x27')](respondWithFilteredResult(_0x495d7f,_0x20829c))[_0xe96e('0x46')](handleError(_0x495d7f,null));};exports['show']=function(_0x269466,_0x2f7914){var _0x9b76dc={'raw':![],'where':{'id':_0x269466[_0xe96e('0x47')]['id']}},_0x321025={};_0x321025['model']=_[_0xe96e('0x34')](db[_0xe96e('0x42')]['rawAttributes']);_0x321025[_0xe96e('0x33')]=_[_0xe96e('0x34')](_0x269466[_0xe96e('0x33')]);_0x321025[_0xe96e('0x35')]=_['intersection'](_0x321025[_0xe96e('0x37')],_0x321025['query']);_0x9b76dc[_0xe96e('0x38')]=_[_0xe96e('0x36')](_0x321025['model'],qs['fields'](_0x269466['query']['fields']));_0x9b76dc[_0xe96e('0x38')]=_0x9b76dc['attributes'][_0xe96e('0x48')]?_0x9b76dc[_0xe96e('0x38')]:_0x321025[_0xe96e('0x37')];if(_0x269466[_0xe96e('0x33')][_0xe96e('0x43')]){_0x9b76dc['include']=[{'all':!![]}];}_0x9b76dc=_['merge']({},_0x9b76dc,_0x269466[_0xe96e('0x49')]);return db[_0xe96e('0x42')][_0xe96e('0x4a')](_0x9b76dc)[_0xe96e('0x27')](handleEntityNotFound(_0x2f7914,null))[_0xe96e('0x27')](respondWithResult(_0x2f7914,null))[_0xe96e('0x46')](handleError(_0x2f7914,null));};exports[_0xe96e('0x4b')]=function(_0x1a56aa,_0x160eb7){return db[_0xe96e('0x42')][_0xe96e('0x4b')](_0x1a56aa['body'],{})['then'](function(_0x17df27){var _0x5a88b6=_0x1a56aa['user'][_0xe96e('0x28')]({'plain':!![]});if(!_0x5a88b6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5a88b6['role']===_0xe96e('0x4c')){var _0x18bc1e=_0x17df27[_0xe96e('0x28')]({'plain':!![]});var _0x1fe87c=_0xe96e('0x29');return db[_0xe96e('0x4d')][_0xe96e('0x4a')]({'where':{'name':_0x1fe87c,'userProfileId':_0x5a88b6[_0xe96e('0x4e')]},'raw':!![]})['then'](function(_0x5efd9d){if(_0x5efd9d&&_0x5efd9d[_0xe96e('0x4f')]===0x0){return db[_0xe96e('0x2a')]['create']({'name':_0x18bc1e[_0xe96e('0x2d')],'resourceId':_0x18bc1e['id'],'type':_0x5efd9d[_0xe96e('0x2d')],'sectionId':_0x5efd9d['id']},{})[_0xe96e('0x27')](function(){return _0x17df27;});}else{return _0x17df27;}})[_0xe96e('0x46')](function(_0x532f0e){logger[_0xe96e('0x2b')](_0xe96e('0x50'),_0x532f0e);throw _0x532f0e;});}return _0x17df27;})[_0xe96e('0x27')](respondWithResult(_0x160eb7,0xc9))[_0xe96e('0x46')](handleError(_0x160eb7,null));};exports[_0xe96e('0x51')]=function(_0xdbe734,_0x1df646){if(_0xdbe734[_0xe96e('0x52')]['id']){delete _0xdbe734[_0xe96e('0x52')]['id'];}return db[_0xe96e('0x42')][_0xe96e('0x4a')]({'where':{'id':_0xdbe734[_0xe96e('0x47')]['id']}})[_0xe96e('0x27')](handleEntityNotFound(_0x1df646,null))['then'](saveUpdates(_0xdbe734[_0xe96e('0x52')],null))[_0xe96e('0x27')](respondWithResult(_0x1df646,null))['catch'](handleError(_0x1df646,null));};exports[_0xe96e('0x26')]=function(_0x101ce3,_0x190735){return db[_0xe96e('0x42')][_0xe96e('0x4a')]({'where':{'id':_0x101ce3['params']['id']}})[_0xe96e('0x27')](handleEntityNotFound(_0x190735,null))[_0xe96e('0x27')](removeEntity(_0x190735,null))[_0xe96e('0x46')](handleError(_0x190735,null));};exports[_0xe96e('0x53')]=function(_0x4369f,_0x122e02,_0x334e72){return db[_0xe96e('0x42')]['find']({'where':{'id':_0x4369f[_0xe96e('0x47')]['id']}})[_0xe96e('0x27')](handleEntityNotFound(_0x122e02,null))['then'](function(_0x68cbc7){if(_0x68cbc7){return _0x68cbc7['addUsers'](_0x4369f['body'][_0xe96e('0x54')],_[_0xe96e('0x55')](_0x4369f[_0xe96e('0x52')],[_0xe96e('0x54'),'id'])||{});}})[_0xe96e('0x27')](respondWithResult(_0x122e02,null))[_0xe96e('0x46')](handleError(_0x122e02,null));};exports['removeUsers']=function(_0x383ef6,_0x278fa8,_0x152ccf){return db[_0xe96e('0x42')][_0xe96e('0x4a')]({'where':{'id':_0x383ef6[_0xe96e('0x47')]['id']}})[_0xe96e('0x27')](handleEntityNotFound(_0x278fa8,null))['then'](function(_0x3ca207){if(_0x3ca207){return _0x3ca207[_0xe96e('0x56')](_0x383ef6['query'][_0xe96e('0x54')])[_0xe96e('0x27')](function(){if(_[_0xe96e('0x57')](_0x383ef6[_0xe96e('0x33')]['ids'])){for(var _0x188758=0x0;_0x188758<_0x383ef6['query'][_0xe96e('0x54')]['length'];_0x188758+=0x1){socket[_0xe96e('0x58')]('userSquareProject:remove',{'UserId':Number(_0x383ef6[_0xe96e('0x33')]['ids'][_0x188758]),'SquareProjectId':Number(_0x383ef6[_0xe96e('0x47')]['id'])});}}else{socket[_0xe96e('0x58')]('userSquareProject:remove',{'UserId':Number(_0x383ef6[_0xe96e('0x33')][_0xe96e('0x54')]),'SquareProjectId':Number(_0x383ef6['params']['id'])});}});}})[_0xe96e('0x27')](respondWithStatusCode(_0x278fa8,null))[_0xe96e('0x46')](handleError(_0x278fa8,null));};exports[_0xe96e('0x59')]=function(_0x37340a,_0x4f98ff,_0x27b1d0){var _0x126e67={};var _0x56f3c8={};var _0x530dbe;var _0x2a7d13;return db[_0xe96e('0x42')][_0xe96e('0x5a')]({'where':{'id':_0x37340a[_0xe96e('0x47')]['id']}})['then'](handleEntityNotFound(_0x4f98ff,null))['then'](function(_0x4d8d86){if(_0x4d8d86){_0x530dbe=_0x4d8d86;_0x56f3c8[_0xe96e('0x37')]=_[_0xe96e('0x34')](db[_0xe96e('0x5b')][_0xe96e('0x2f')]);_0x56f3c8[_0xe96e('0x33')]=_[_0xe96e('0x34')](_0x37340a[_0xe96e('0x33')]);_0x56f3c8['filters']=_[_0xe96e('0x36')](_0x56f3c8[_0xe96e('0x37')],_0x56f3c8[_0xe96e('0x33')]);_0x126e67['attributes']=_['intersection'](_0x56f3c8[_0xe96e('0x37')],qs['fields'](_0x37340a[_0xe96e('0x33')][_0xe96e('0x39')]));_0x126e67[_0xe96e('0x38')]=_0x126e67['attributes'][_0xe96e('0x48')]?_0x126e67[_0xe96e('0x38')]:_0x56f3c8[_0xe96e('0x37')];_0x126e67[_0xe96e('0x3c')]=qs[_0xe96e('0x3d')](_0x37340a[_0xe96e('0x33')][_0xe96e('0x3d')]);_0x126e67['where']=qs[_0xe96e('0x35')](_['pick'](_0x37340a['query'],_0x56f3c8[_0xe96e('0x35')]));if(_0x37340a[_0xe96e('0x33')][_0xe96e('0x41')]){_0x126e67[_0xe96e('0x3e')]=_[_0xe96e('0x3f')](_0x126e67[_0xe96e('0x3e')],{'$or':_['map'](_0x126e67[_0xe96e('0x38')],function(_0x11f497){var _0x47403e={};_0x47403e[_0x11f497]={'$like':'%'+_0x37340a[_0xe96e('0x33')][_0xe96e('0x41')]+'%'};return _0x47403e;})});}_0x126e67=_[_0xe96e('0x3f')]({},_0x126e67,_0x37340a[_0xe96e('0x49')]);return _0x530dbe[_0xe96e('0x59')](_0x126e67);}})[_0xe96e('0x27')](function(_0x313cc3){if(_0x313cc3){_0x2a7d13=_0x313cc3[_0xe96e('0x48')];if(!_0x37340a['query'][_0xe96e('0x3a')](_0xe96e('0x3b'))){_0x126e67[_0xe96e('0x1f')]=qs[_0xe96e('0x1f')](_0x37340a[_0xe96e('0x33')]['limit']);_0x126e67[_0xe96e('0x1d')]=qs[_0xe96e('0x1d')](_0x37340a['query'][_0xe96e('0x1d')]);}return _0x530dbe[_0xe96e('0x59')](_0x126e67);}})[_0xe96e('0x27')](function(_0x2af700){if(_0x2af700){return _0x2af700?{'count':_0x2a7d13,'rows':_0x2af700}:null;}})[_0xe96e('0x27')](respondWithResult(_0x4f98ff,null))[_0xe96e('0x46')](handleError(_0x4f98ff,null));};
\ No newline at end of file
+var _0x227c=['autoAssociation','find','addUsers','ids','removeUsers','emit','userSquareProject:remove','getUsers','findOne','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','redis','localhost','socket.io-emitter','./squareProject.socket','register','sendStatus','status','json','undefined','offset','count','limit','Content-Range','apply','reject','save','update','then','destroy','get','SquareProjects','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filters','filter','where','merge','type','VIRTUAL','options','SquareProject','findAll','rows','catch','show','params','keys','includeAll','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection'];(function(_0x35863f,_0x4f3a04){var _0x35a567=function(_0x192d22){while(--_0x192d22){_0x35863f['push'](_0x35863f['shift']());}};_0x35a567(++_0x4f3a04);}(_0x227c,0x66));var _0xc227=function(_0x42e75c,_0x136223){_0x42e75c=_0x42e75c-0x0;var _0x42b0b8=_0x227c[_0x42e75c];return _0x42b0b8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc227('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc227('0x1'));var rp=require(_0xc227('0x2'));var moment=require('moment');var BPromise=require(_0xc227('0x3'));var Mustache=require(_0xc227('0x4'));var util=require(_0xc227('0x5'));var path=require(_0xc227('0x6'));var sox=require(_0xc227('0x7'));var csv=require('to-csv');var ejs=require(_0xc227('0x8'));var fs=require('fs');var fs_extra=require(_0xc227('0x9'));var _=require(_0xc227('0xa'));var squel=require(_0xc227('0xb'));var crypto=require(_0xc227('0xc'));var jsforce=require(_0xc227('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xc227('0xe'));var Papa=require(_0xc227('0xf'));var Redis=require('ioredis');var authService=require(_0xc227('0x10'));var qs=require(_0xc227('0x11'));var as=require(_0xc227('0x12'));var hardwareService=require(_0xc227('0x13'));var logger=require(_0xc227('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xc227('0x15'));var db=require('../../mysqldb')['db'];config[_0xc227('0x16')]=_['defaults'](config[_0xc227('0x16')],{'host':_0xc227('0x17'),'port':0x18eb});var socket=require(_0xc227('0x18'))(new Redis(config[_0xc227('0x16')]));require(_0xc227('0x19'))[_0xc227('0x1a')](socket);function respondWithStatusCode(_0x37df5f,_0x1af752){_0x1af752=_0x1af752||0xcc;return function(_0x6fd7e0){if(_0x6fd7e0){return _0x37df5f[_0xc227('0x1b')](_0x1af752);}return _0x37df5f[_0xc227('0x1c')](_0x1af752)['end']();};}function respondWithResult(_0x4e3fcf,_0x52b1a9){_0x52b1a9=_0x52b1a9||0xc8;return function(_0x3e2fff){if(_0x3e2fff){return _0x4e3fcf[_0xc227('0x1c')](_0x52b1a9)[_0xc227('0x1d')](_0x3e2fff);}};}function respondWithFilteredResult(_0x20df28,_0x4e6883){return function(_0x2d204e){if(_0x2d204e){var _0x27c583=typeof _0x4e6883['offset']===_0xc227('0x1e')&&typeof _0x4e6883['limit']===_0xc227('0x1e');var _0x4fc74f=_0x2d204e['count'];var _0x5392b7=_0x27c583?0x0:_0x4e6883[_0xc227('0x1f')];var _0x266374=_0x27c583?_0x2d204e[_0xc227('0x20')]:_0x4e6883[_0xc227('0x1f')]+_0x4e6883[_0xc227('0x21')];var _0x10e20;if(_0x266374>=_0x4fc74f){_0x266374=_0x4fc74f;_0x10e20=0xc8;}else{_0x10e20=0xce;}_0x20df28[_0xc227('0x1c')](_0x10e20);return _0x20df28['set'](_0xc227('0x22'),_0x5392b7+'-'+_0x266374+'/'+_0x4fc74f)[_0xc227('0x1d')](_0x2d204e);}return null;};}function patchUpdates(_0x16c9ad){return function(_0x398f97){try{jsonpatch[_0xc227('0x23')](_0x398f97,_0x16c9ad,!![]);}catch(_0x389a4a){return BPromise[_0xc227('0x24')](_0x389a4a);}return _0x398f97[_0xc227('0x25')]();};}function saveUpdates(_0x61475a,_0x10705b){return function(_0x1e71fa){if(_0x1e71fa){return _0x1e71fa[_0xc227('0x26')](_0x61475a)[_0xc227('0x27')](function(_0x20eaff){return _0x20eaff;});}return null;};}function removeEntity(_0x77acdf,_0x2b5744){return function(_0x516ffb){if(_0x516ffb){return _0x516ffb[_0xc227('0x28')]()[_0xc227('0x27')](function(){var _0x37dfb5=_0x516ffb[_0xc227('0x29')]({'plain':!![]});var _0x55a94a=_0xc227('0x2a');return db[_0xc227('0x2b')]['destroy']({'where':{'type':_0x55a94a,'resourceId':_0x37dfb5['id']}})[_0xc227('0x27')](function(){return _0x516ffb;});})['then'](function(){_0x77acdf[_0xc227('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0xc5355d,_0x52f8a8){return function(_0x53896b){if(!_0x53896b){_0xc5355d[_0xc227('0x1b')](0x194);}return _0x53896b;};}function handleError(_0x1ba10c,_0x2ae78a){_0x2ae78a=_0x2ae78a||0x1f4;return function(_0xc90d27){logger[_0xc227('0x2c')](_0xc90d27[_0xc227('0x2d')]);if(_0xc90d27['name']){delete _0xc90d27[_0xc227('0x2e')];}_0x1ba10c['status'](_0x2ae78a)[_0xc227('0x2f')](_0xc90d27);};}exports[_0xc227('0x30')]=function(_0xed1b06,_0x2fc23f){var _0x228dcc={},_0x606e00={},_0x5a6175={'count':0x0,'rows':[]};var _0x24dd7d=_[_0xc227('0x31')](db['SquareProject'][_0xc227('0x32')],function(_0x51d970){return{'name':_0x51d970[_0xc227('0x33')],'type':_0x51d970['type'][_0xc227('0x34')]};});_0x606e00[_0xc227('0x35')]=_['map'](_0x24dd7d,_0xc227('0x2e'));_0x606e00[_0xc227('0x36')]=_['keys'](_0xed1b06[_0xc227('0x36')]);_0x606e00['filters']=_[_0xc227('0x37')](_0x606e00[_0xc227('0x35')],_0x606e00[_0xc227('0x36')]);_0x228dcc[_0xc227('0x38')]=_[_0xc227('0x37')](_0x606e00[_0xc227('0x35')],qs[_0xc227('0x39')](_0xed1b06[_0xc227('0x36')][_0xc227('0x39')]));_0x228dcc[_0xc227('0x38')]=_0x228dcc[_0xc227('0x38')][_0xc227('0x3a')]?_0x228dcc['attributes']:_0x606e00[_0xc227('0x35')];if(!_0xed1b06[_0xc227('0x36')][_0xc227('0x3b')](_0xc227('0x3c'))){_0x228dcc[_0xc227('0x21')]=qs[_0xc227('0x21')](_0xed1b06[_0xc227('0x36')][_0xc227('0x21')]);_0x228dcc['offset']=qs[_0xc227('0x1f')](_0xed1b06['query'][_0xc227('0x1f')]);}_0x228dcc[_0xc227('0x3d')]=qs[_0xc227('0x3e')](_0xed1b06[_0xc227('0x36')]['sort']);_0x228dcc['where']=qs['filters'](_[_0xc227('0x3f')](_0xed1b06[_0xc227('0x36')],_0x606e00[_0xc227('0x40')]),_0x24dd7d);if(_0xed1b06[_0xc227('0x36')][_0xc227('0x41')]){_0x228dcc[_0xc227('0x42')]=_[_0xc227('0x43')](_0x228dcc['where'],{'$or':_[_0xc227('0x31')](_0x24dd7d,function(_0x153fbd){if(_0x153fbd[_0xc227('0x44')]!==_0xc227('0x45')){var _0x54e530={};_0x54e530[_0x153fbd[_0xc227('0x2e')]]={'$like':'%'+_0xed1b06[_0xc227('0x36')]['filter']+'%'};return _0x54e530;}})});}_0x228dcc=_[_0xc227('0x43')]({},_0x228dcc,_0xed1b06[_0xc227('0x46')]);var _0x33d473={'where':_0x228dcc['where']};return db[_0xc227('0x47')][_0xc227('0x20')](_0x33d473)[_0xc227('0x27')](function(_0x17436d){_0x5a6175[_0xc227('0x20')]=_0x17436d;if(_0xed1b06['query']['includeAll']){_0x228dcc['include']=[{'all':!![]}];}return db[_0xc227('0x47')][_0xc227('0x48')](_0x228dcc);})[_0xc227('0x27')](function(_0x48b18c){_0x5a6175[_0xc227('0x49')]=_0x48b18c;return _0x5a6175;})['then'](respondWithFilteredResult(_0x2fc23f,_0x228dcc))[_0xc227('0x4a')](handleError(_0x2fc23f,null));};exports[_0xc227('0x4b')]=function(_0x1212e1,_0x15fe54){var _0x32d213={'raw':![],'where':{'id':_0x1212e1[_0xc227('0x4c')]['id']}},_0x2d21c5={};_0x2d21c5[_0xc227('0x35')]=_[_0xc227('0x4d')](db[_0xc227('0x47')][_0xc227('0x32')]);_0x2d21c5[_0xc227('0x36')]=_[_0xc227('0x4d')](_0x1212e1[_0xc227('0x36')]);_0x2d21c5[_0xc227('0x40')]=_['intersection'](_0x2d21c5[_0xc227('0x35')],_0x2d21c5[_0xc227('0x36')]);_0x32d213['attributes']=_[_0xc227('0x37')](_0x2d21c5['model'],qs[_0xc227('0x39')](_0x1212e1[_0xc227('0x36')][_0xc227('0x39')]));_0x32d213[_0xc227('0x38')]=_0x32d213[_0xc227('0x38')][_0xc227('0x3a')]?_0x32d213[_0xc227('0x38')]:_0x2d21c5['model'];if(_0x1212e1[_0xc227('0x36')][_0xc227('0x4e')]){_0x32d213['include']=[{'all':!![]}];}_0x32d213=_[_0xc227('0x43')]({},_0x32d213,_0x1212e1[_0xc227('0x46')]);return db[_0xc227('0x47')]['find'](_0x32d213)['then'](handleEntityNotFound(_0x15fe54,null))[_0xc227('0x27')](respondWithResult(_0x15fe54,null))['catch'](handleError(_0x15fe54,null));};exports[_0xc227('0x4f')]=function(_0x36b474,_0x449327){return db[_0xc227('0x47')][_0xc227('0x4f')](_0x36b474[_0xc227('0x50')],{})['then'](function(_0x26b4a0){var _0x177666=_0x36b474[_0xc227('0x51')][_0xc227('0x29')]({'plain':!![]});if(!_0x177666)throw new Error(_0xc227('0x52'));if(_0x177666['role']===_0xc227('0x51')){var _0x439792=_0x26b4a0['get']({'plain':!![]});var _0x28691c=_0xc227('0x2a');return db[_0xc227('0x53')]['find']({'where':{'name':_0x28691c,'userProfileId':_0x177666['userProfileId']},'raw':!![]})[_0xc227('0x27')](function(_0x56ca2a){if(_0x56ca2a&&_0x56ca2a[_0xc227('0x54')]===0x0){return db['UserProfileResource']['create']({'name':_0x439792[_0xc227('0x2e')],'resourceId':_0x439792['id'],'type':_0x56ca2a['name'],'sectionId':_0x56ca2a['id']},{})[_0xc227('0x27')](function(){return _0x26b4a0;});}else{return _0x26b4a0;}})[_0xc227('0x4a')](function(_0x40037e){logger[_0xc227('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x40037e);throw _0x40037e;});}return _0x26b4a0;})['then'](respondWithResult(_0x449327,0xc9))['catch'](handleError(_0x449327,null));};exports['update']=function(_0x53fb31,_0x357d4d){if(_0x53fb31[_0xc227('0x50')]['id']){delete _0x53fb31[_0xc227('0x50')]['id'];}return db[_0xc227('0x47')][_0xc227('0x55')]({'where':{'id':_0x53fb31[_0xc227('0x4c')]['id']}})[_0xc227('0x27')](handleEntityNotFound(_0x357d4d,null))[_0xc227('0x27')](saveUpdates(_0x53fb31[_0xc227('0x50')],null))[_0xc227('0x27')](respondWithResult(_0x357d4d,null))[_0xc227('0x4a')](handleError(_0x357d4d,null));};exports['destroy']=function(_0x217524,_0x12b2c5){return db['SquareProject'][_0xc227('0x55')]({'where':{'id':_0x217524[_0xc227('0x4c')]['id']}})[_0xc227('0x27')](handleEntityNotFound(_0x12b2c5,null))['then'](removeEntity(_0x12b2c5,null))['catch'](handleError(_0x12b2c5,null));};exports['addUsers']=function(_0x3c82f7,_0x4c43a4,_0x123570){return db[_0xc227('0x47')]['find']({'where':{'id':_0x3c82f7[_0xc227('0x4c')]['id']}})[_0xc227('0x27')](handleEntityNotFound(_0x4c43a4,null))[_0xc227('0x27')](function(_0xe20819){if(_0xe20819){return _0xe20819[_0xc227('0x56')](_0x3c82f7[_0xc227('0x50')][_0xc227('0x57')],_['omit'](_0x3c82f7['body'],[_0xc227('0x57'),'id'])||{});}})[_0xc227('0x27')](respondWithResult(_0x4c43a4,null))[_0xc227('0x4a')](handleError(_0x4c43a4,null));};exports['removeUsers']=function(_0x1f6529,_0x170558,_0x50eb73){return db[_0xc227('0x47')]['find']({'where':{'id':_0x1f6529[_0xc227('0x4c')]['id']}})[_0xc227('0x27')](handleEntityNotFound(_0x170558,null))['then'](function(_0x475afe){if(_0x475afe){return _0x475afe[_0xc227('0x58')](_0x1f6529[_0xc227('0x36')][_0xc227('0x57')])['then'](function(){if(_['isArray'](_0x1f6529[_0xc227('0x36')][_0xc227('0x57')])){for(var _0x3191b4=0x0;_0x3191b4<_0x1f6529[_0xc227('0x36')][_0xc227('0x57')][_0xc227('0x3a')];_0x3191b4+=0x1){socket['emit']('userSquareProject:remove',{'UserId':Number(_0x1f6529[_0xc227('0x36')][_0xc227('0x57')][_0x3191b4]),'SquareProjectId':Number(_0x1f6529[_0xc227('0x4c')]['id'])});}}else{socket[_0xc227('0x59')](_0xc227('0x5a'),{'UserId':Number(_0x1f6529[_0xc227('0x36')][_0xc227('0x57')]),'SquareProjectId':Number(_0x1f6529[_0xc227('0x4c')]['id'])});}});}})['then'](respondWithStatusCode(_0x170558,null))['catch'](handleError(_0x170558,null));};exports[_0xc227('0x5b')]=function(_0x3452a1,_0x5332a2,_0x5dfe41){var _0x5e3f10={};var _0x4d4bb0={};var _0x15c5c1;var _0x3df8f1;return db[_0xc227('0x47')][_0xc227('0x5c')]({'where':{'id':_0x3452a1[_0xc227('0x4c')]['id']}})['then'](handleEntityNotFound(_0x5332a2,null))[_0xc227('0x27')](function(_0x293ef2){if(_0x293ef2){_0x15c5c1=_0x293ef2;_0x4d4bb0[_0xc227('0x35')]=_[_0xc227('0x4d')](db['User'][_0xc227('0x32')]);_0x4d4bb0['query']=_[_0xc227('0x4d')](_0x3452a1[_0xc227('0x36')]);_0x4d4bb0[_0xc227('0x40')]=_[_0xc227('0x37')](_0x4d4bb0['model'],_0x4d4bb0[_0xc227('0x36')]);_0x5e3f10[_0xc227('0x38')]=_[_0xc227('0x37')](_0x4d4bb0[_0xc227('0x35')],qs['fields'](_0x3452a1['query'][_0xc227('0x39')]));_0x5e3f10[_0xc227('0x38')]=_0x5e3f10[_0xc227('0x38')][_0xc227('0x3a')]?_0x5e3f10['attributes']:_0x4d4bb0[_0xc227('0x35')];_0x5e3f10[_0xc227('0x3d')]=qs[_0xc227('0x3e')](_0x3452a1[_0xc227('0x36')]['sort']);_0x5e3f10[_0xc227('0x42')]=qs['filters'](_[_0xc227('0x3f')](_0x3452a1['query'],_0x4d4bb0['filters']));if(_0x3452a1[_0xc227('0x36')][_0xc227('0x41')]){_0x5e3f10[_0xc227('0x42')]=_[_0xc227('0x43')](_0x5e3f10['where'],{'$or':_[_0xc227('0x31')](_0x5e3f10[_0xc227('0x38')],function(_0x487b6e){var _0x2775aa={};_0x2775aa[_0x487b6e]={'$like':'%'+_0x3452a1[_0xc227('0x36')][_0xc227('0x41')]+'%'};return _0x2775aa;})});}_0x5e3f10=_[_0xc227('0x43')]({},_0x5e3f10,_0x3452a1['options']);return _0x15c5c1['getUsers'](_0x5e3f10);}})[_0xc227('0x27')](function(_0x4cefc0){if(_0x4cefc0){_0x3df8f1=_0x4cefc0['length'];if(!_0x3452a1[_0xc227('0x36')][_0xc227('0x3b')](_0xc227('0x3c'))){_0x5e3f10[_0xc227('0x21')]=qs[_0xc227('0x21')](_0x3452a1[_0xc227('0x36')][_0xc227('0x21')]);_0x5e3f10['offset']=qs[_0xc227('0x1f')](_0x3452a1[_0xc227('0x36')]['offset']);}return _0x15c5c1[_0xc227('0x5b')](_0x5e3f10);}})['then'](function(_0x557683){if(_0x557683){return _0x557683?{'count':_0x3df8f1,'rows':_0x557683}:null;}})[_0xc227('0x27')](respondWithResult(_0x5332a2,null))['catch'](handleError(_0x5332a2,null));};
\ No newline at end of file
index 9455608..b08badc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0852=['events','../../mysqldb','setMaxListeners','save','remove','emit','hook','exports'];(function(_0x4aaa77,_0x16425f){var _0x6e2518=function(_0x1ae96b){while(--_0x1ae96b){_0x4aaa77['push'](_0x4aaa77['shift']());}};_0x6e2518(++_0x16425f);}(_0x0852,0x148));var _0x2085=function(_0x1b6186,_0x1ec7f2){_0x1b6186=_0x1b6186-0x0;var _0x186121=_0x0852[_0x1b6186];return _0x186121;};'use strict';var EventEmitter=require(_0x2085('0x0'));var SquareProject=require(_0x2085('0x1'))['db']['SquareProject'];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x2085('0x2')](0x0);var events={'afterCreate':_0x2085('0x3'),'afterUpdate':'update','afterDestroy':_0x2085('0x4')};function emitEvent(_0x49c1c1){return function(_0x17cdbe,_0x22c883,_0x5deb0b){SquareProjectEvents[_0x2085('0x5')](_0x49c1c1+':'+_0x17cdbe['id'],_0x17cdbe);SquareProjectEvents[_0x2085('0x5')](_0x49c1c1,_0x17cdbe);_0x5deb0b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SquareProject[_0x2085('0x6')](e,emitEvent(event));}}module[_0x2085('0x7')]=SquareProjectEvents;
\ No newline at end of file
+var _0x91b5=['save','remove','emit','hasOwnProperty','hook','events','setMaxListeners'];(function(_0xf38d2f,_0x14a6ce){var _0x57d86a=function(_0x55952d){while(--_0x55952d){_0xf38d2f['push'](_0xf38d2f['shift']());}};_0x57d86a(++_0x14a6ce);}(_0x91b5,0xd0));var _0x591b=function(_0x5ae8ac,_0x5872f2){_0x5ae8ac=_0x5ae8ac-0x0;var _0x34f0bf=_0x91b5[_0x5ae8ac];return _0x34f0bf;};'use strict';var EventEmitter=require(_0x591b('0x0'));var SquareProject=require('../../mysqldb')['db']['SquareProject'];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x591b('0x1')](0x0);var events={'afterCreate':_0x591b('0x2'),'afterUpdate':'update','afterDestroy':_0x591b('0x3')};function emitEvent(_0x1ac916){return function(_0x484244,_0x5cf8b2,_0x12188c){SquareProjectEvents[_0x591b('0x4')](_0x1ac916+':'+_0x484244['id'],_0x484244);SquareProjectEvents['emit'](_0x1ac916,_0x484244);_0x12188c(null);};}for(var e in events){if(events[_0x591b('0x5')](e)){var event=events[e];SquareProject[_0x591b('0x6')](e,emitEvent(event));}}module['exports']=SquareProjectEvents;
\ No newline at end of file
index 68f61bd..8639bd1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x32e7=['../../config/logger','moment','bluebird','request-promise','path','rimraf','exports','define','SquareProject','square_projects','preproduction','savedAt','format','YYYY-MM-DD\x20HH:mm:ss','changed','production','lodash'];(function(_0x12cdc1,_0x4f878c){var _0x5c2a1f=function(_0xe1b358){while(--_0xe1b358){_0x12cdc1['push'](_0x12cdc1['shift']());}};_0x5c2a1f(++_0x4f878c);}(_0x32e7,0x131));var _0x732e=function(_0x36441c,_0x1e2f2e){_0x36441c=_0x36441c-0x0;var _0x4ab211=_0x32e7[_0x36441c];return _0x4ab211;};'use strict';var _=require(_0x732e('0x0'));var util=require('util');var logger=require(_0x732e('0x1'))('api');var moment=require(_0x732e('0x2'));var BPromise=require(_0x732e('0x3'));var rp=require(_0x732e('0x4'));var fs=require('fs');var path=require(_0x732e('0x5'));var rimraf=require(_0x732e('0x6'));var config=require('../../config/environment');var attributes=require('./squareProject.attributes');module[_0x732e('0x7')]=function(_0x3cdacb,_0x123d3a){return _0x3cdacb[_0x732e('0x8')](_0x732e('0x9'),attributes,{'tableName':_0x732e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3fcd18,_0x421157,_0x50b161){if(_0x3fcd18['changed'](_0x732e('0xb'))){_0x3fcd18[_0x732e('0xc')]=moment()[_0x732e('0xd')](_0x732e('0xe'));}if(_0x3fcd18[_0x732e('0xf')](_0x732e('0x10'))){_0x3fcd18['publishedAt']=moment()[_0x732e('0xd')](_0x732e('0xe'));}_0x50b161(null,_0x3fcd18);}}});};
\ No newline at end of file
+var _0x6d28=['../../config/environment','define','SquareProject','square_projects','preproduction','savedAt','format','YYYY-MM-DD\x20HH:mm:ss','changed','production','publishedAt','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x2d8fc2,_0x1c461d){var _0x3a9e53=function(_0x18941c){while(--_0x18941c){_0x2d8fc2['push'](_0x2d8fc2['shift']());}};_0x3a9e53(++_0x1c461d);}(_0x6d28,0x14e));var _0x86d2=function(_0x5a79e2,_0x319b1a){_0x5a79e2=_0x5a79e2-0x0;var _0x266c45=_0x6d28[_0x5a79e2];return _0x266c45;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x86d2('0x0'))(_0x86d2('0x1'));var moment=require(_0x86d2('0x2'));var BPromise=require(_0x86d2('0x3'));var rp=require(_0x86d2('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x86d2('0x5'));var config=require(_0x86d2('0x6'));var attributes=require('./squareProject.attributes');module['exports']=function(_0x4fb6db,_0x1a14cc){return _0x4fb6db[_0x86d2('0x7')](_0x86d2('0x8'),attributes,{'tableName':_0x86d2('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4cf168,_0x4c4cf5,_0x2b73ff){if(_0x4cf168['changed'](_0x86d2('0xa'))){_0x4cf168[_0x86d2('0xb')]=moment()[_0x86d2('0xc')](_0x86d2('0xd'));}if(_0x4cf168[_0x86d2('0xe')](_0x86d2('0xf'))){_0x4cf168[_0x86d2('0x10')]=moment()[_0x86d2('0xc')](_0x86d2('0xd'));}_0x2b73ff(null,_0x4cf168);}}});};
\ No newline at end of file
index b4ec1fd..ca0d583 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5aaf=['./squareProject.socket','register','then','info','SquareProject,\x20%s,\x20%s','SquareProject,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','SquareProject','find','options','raw','where','attributes','include','map','ShowSquareProject','debug','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5aaf,0xd0));var _0xf5aa=function(_0x3b3392,_0x548235){_0x3b3392=_0x3b3392-0x0;var _0x4e1267=_0x5aaf[_0x3b3392];return _0x4e1267;};'use strict';var _=require(_0xf5aa('0x0'));var util=require(_0xf5aa('0x1'));var moment=require(_0xf5aa('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf5aa('0x3'));var db=require(_0xf5aa('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xf5aa('0x5'))(_0xf5aa('0x6'));var config=require('../../config/environment');var jayson=require(_0xf5aa('0x7'));var client=jayson[_0xf5aa('0x8')][_0xf5aa('0x9')]({'port':0x232a});config[_0xf5aa('0xa')]=_[_0xf5aa('0xb')](config[_0xf5aa('0xa')],{'host':_0xf5aa('0xc'),'port':0x18eb});var socket=require(_0xf5aa('0xd'))(new Redis(config[_0xf5aa('0xa')]));require(_0xf5aa('0xe'))[_0xf5aa('0xf')](socket);function respondWithRpcPromise(_0x2d5203,_0x4ad1cd,_0x206b30){return new BPromise(function(_0x360080,_0x3586e7){return client['request'](_0x2d5203,_0x206b30)[_0xf5aa('0x10')](function(_0x233333){logger[_0xf5aa('0x11')](_0xf5aa('0x12'),_0x4ad1cd,'request\x20sent');logger['debug'](_0xf5aa('0x13'),_0x4ad1cd,_0xf5aa('0x14'),JSON[_0xf5aa('0x15')](_0x233333));if(_0x233333[_0xf5aa('0x16')]){if(_0x233333['error'][_0xf5aa('0x17')]===0x1f4){logger[_0xf5aa('0x16')](_0xf5aa('0x12'),_0x4ad1cd,_0x233333[_0xf5aa('0x16')][_0xf5aa('0x18')]);return _0x3586e7(_0x233333['error'][_0xf5aa('0x18')]);}logger[_0xf5aa('0x16')]('SquareProject,\x20%s,\x20%s',_0x4ad1cd,_0x233333[_0xf5aa('0x16')][_0xf5aa('0x18')]);return _0x360080(_0x233333[_0xf5aa('0x16')][_0xf5aa('0x18')]);}else{logger[_0xf5aa('0x11')](_0xf5aa('0x12'),_0x4ad1cd,_0xf5aa('0x14'));_0x360080(_0x233333[_0xf5aa('0x19')][_0xf5aa('0x18')]);}})['catch'](function(_0x544274){logger[_0xf5aa('0x16')](_0xf5aa('0x12'),_0x4ad1cd,_0x544274);_0x3586e7(_0x544274);});});}exports['ShowSquareProject']=function(_0xcc2ca4){var _0x498c5c=this;return new Promise(function(_0x277241,_0x1f216f){return db[_0xf5aa('0x1a')][_0xf5aa('0x1b')]({'raw':_0xcc2ca4['options']?_0xcc2ca4[_0xf5aa('0x1c')][_0xf5aa('0x1d')]===undefined?!![]:![]:!![],'where':_0xcc2ca4['options']?_0xcc2ca4[_0xf5aa('0x1c')][_0xf5aa('0x1e')]||null:null,'attributes':_0xcc2ca4[_0xf5aa('0x1c')]?_0xcc2ca4[_0xf5aa('0x1c')][_0xf5aa('0x1f')]||null:null,'include':_0xcc2ca4[_0xf5aa('0x1c')]?_0xcc2ca4[_0xf5aa('0x1c')][_0xf5aa('0x20')]?_[_0xf5aa('0x21')](_0xcc2ca4[_0xf5aa('0x1c')][_0xf5aa('0x20')],function(_0x5e234c){return{'model':db[_0x5e234c['model']],'as':_0x5e234c['as'],'attributes':_0x5e234c[_0xf5aa('0x1f')],'include':_0x5e234c[_0xf5aa('0x20')]?_[_0xf5aa('0x21')](_0x5e234c['include'],function(_0x41538e){return{'model':db[_0x41538e['model']],'as':_0x41538e['as'],'attributes':_0x41538e['attributes'],'include':_0x41538e['include']?_[_0xf5aa('0x21')](_0x41538e['include'],function(_0x1d794c){return{'model':db[_0x1d794c['model']],'as':_0x1d794c['as'],'attributes':_0x1d794c[_0xf5aa('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xf5aa('0x10')](function(_0x4280b5){logger['info'](_0xf5aa('0x22'),_0xcc2ca4);logger[_0xf5aa('0x23')](_0xf5aa('0x22'),_0xcc2ca4,JSON[_0xf5aa('0x15')](_0x4280b5));_0x277241(_0x4280b5);})[_0xf5aa('0x24')](function(_0x5ead69){logger[_0xf5aa('0x16')]('ShowSquareProject',_0x5ead69[_0xf5aa('0x18')],_0xcc2ca4);_0x1f216f(_0x498c5c[_0xf5aa('0x16')](0x1f4,_0x5ead69[_0xf5aa('0x18')]));});});};
\ No newline at end of file
+var _0x1dbc=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','localhost','socket.io-emitter','redis','then','request\x20sent','debug','stringify','error','SquareProject,\x20%s,\x20%s','message','info','result','ShowSquareProject','SquareProject','find','options','attributes','include','model','map','lodash','util','moment','randomstring','../../mysqldb'];(function(_0x2ec30d,_0x4dd1a4){var _0x5090e4=function(_0x4faf27){while(--_0x4faf27){_0x2ec30d['push'](_0x2ec30d['shift']());}};_0x5090e4(++_0x4dd1a4);}(_0x1dbc,0x17b));var _0xc1db=function(_0x1cb931,_0x41493d){_0x1cb931=_0x1cb931-0x0;var _0x1ef86b=_0x1dbc[_0x1cb931];return _0x1ef86b;};'use strict';var _=require(_0xc1db('0x0'));var util=require(_0xc1db('0x1'));var moment=require(_0xc1db('0x2'));var BPromise=require('bluebird');var rs=require(_0xc1db('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc1db('0x4'))['db'];var utils=require(_0xc1db('0x5'));var logger=require(_0xc1db('0x6'))(_0xc1db('0x7'));var config=require(_0xc1db('0x8'));var jayson=require(_0xc1db('0x9'));var client=jayson[_0xc1db('0xa')][_0xc1db('0xb')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0xc1db('0xc'),'port':0x18eb});var socket=require(_0xc1db('0xd'))(new Redis(config[_0xc1db('0xe')]));require('./squareProject.socket')['register'](socket);function respondWithRpcPromise(_0x55a796,_0x39741f,_0x50a90b){return new BPromise(function(_0x2920b1,_0x406cf2){return client['request'](_0x55a796,_0x50a90b)[_0xc1db('0xf')](function(_0xe4edf9){logger['info']('SquareProject,\x20%s,\x20%s',_0x39741f,_0xc1db('0x10'));logger[_0xc1db('0x11')]('SquareProject,\x20%s,\x20%s,\x20%s',_0x39741f,'request\x20sent',JSON[_0xc1db('0x12')](_0xe4edf9));if(_0xe4edf9[_0xc1db('0x13')]){if(_0xe4edf9['error']['code']===0x1f4){logger[_0xc1db('0x13')](_0xc1db('0x14'),_0x39741f,_0xe4edf9[_0xc1db('0x13')][_0xc1db('0x15')]);return _0x406cf2(_0xe4edf9[_0xc1db('0x13')][_0xc1db('0x15')]);}logger[_0xc1db('0x13')](_0xc1db('0x14'),_0x39741f,_0xe4edf9[_0xc1db('0x13')][_0xc1db('0x15')]);return _0x2920b1(_0xe4edf9[_0xc1db('0x13')][_0xc1db('0x15')]);}else{logger[_0xc1db('0x16')]('SquareProject,\x20%s,\x20%s',_0x39741f,_0xc1db('0x10'));_0x2920b1(_0xe4edf9[_0xc1db('0x17')][_0xc1db('0x15')]);}})['catch'](function(_0x4dcd94){logger[_0xc1db('0x13')](_0xc1db('0x14'),_0x39741f,_0x4dcd94);_0x406cf2(_0x4dcd94);});});}exports[_0xc1db('0x18')]=function(_0x2a74f1){var _0x319f25=this;return new Promise(function(_0x3f4b38,_0xfa0af0){return db[_0xc1db('0x19')][_0xc1db('0x1a')]({'raw':_0x2a74f1[_0xc1db('0x1b')]?_0x2a74f1['options']['raw']===undefined?!![]:![]:!![],'where':_0x2a74f1[_0xc1db('0x1b')]?_0x2a74f1[_0xc1db('0x1b')]['where']||null:null,'attributes':_0x2a74f1[_0xc1db('0x1b')]?_0x2a74f1[_0xc1db('0x1b')][_0xc1db('0x1c')]||null:null,'include':_0x2a74f1[_0xc1db('0x1b')]?_0x2a74f1[_0xc1db('0x1b')][_0xc1db('0x1d')]?_['map'](_0x2a74f1[_0xc1db('0x1b')][_0xc1db('0x1d')],function(_0x42256c){return{'model':db[_0x42256c[_0xc1db('0x1e')]],'as':_0x42256c['as'],'attributes':_0x42256c[_0xc1db('0x1c')],'include':_0x42256c[_0xc1db('0x1d')]?_[_0xc1db('0x1f')](_0x42256c[_0xc1db('0x1d')],function(_0x503eca){return{'model':db[_0x503eca[_0xc1db('0x1e')]],'as':_0x503eca['as'],'attributes':_0x503eca[_0xc1db('0x1c')],'include':_0x503eca[_0xc1db('0x1d')]?_[_0xc1db('0x1f')](_0x503eca[_0xc1db('0x1d')],function(_0x1dea17){return{'model':db[_0x1dea17[_0xc1db('0x1e')]],'as':_0x1dea17['as'],'attributes':_0x1dea17['attributes']};}):[]};}):[]};}):[]:[]})[_0xc1db('0xf')](function(_0x3bcabe){logger[_0xc1db('0x16')](_0xc1db('0x18'),_0x2a74f1);logger[_0xc1db('0x11')](_0xc1db('0x18'),_0x2a74f1,JSON['stringify'](_0x3bcabe));_0x3f4b38(_0x3bcabe);})['catch'](function(_0x2b5687){logger[_0xc1db('0x13')](_0xc1db('0x18'),_0x2b5687['message'],_0x2a74f1);_0xfa0af0(_0x319f25[_0xc1db('0x13')](0x1f4,_0x2b5687[_0xc1db('0x15')]));});});};
\ No newline at end of file
index cd200a8..df66dc3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7c03=['squareProject:','./squareProject.events','save','update','emit','removeListener','register'];(function(_0x1dcf4a,_0x5ac250){var _0xdaf934=function(_0x27c5e3){while(--_0x27c5e3){_0x1dcf4a['push'](_0x1dcf4a['shift']());}};_0xdaf934(++_0x5ac250);}(_0x7c03,0x12e));var _0x37c0=function(_0x4aab19,_0x24da2c){_0x4aab19=_0x4aab19-0x0;var _0x327f17=_0x7c03[_0x4aab19];return _0x327f17;};'use strict';var SquareProjectEvents=require(_0x37c0('0x0'));var events=[_0x37c0('0x1'),'remove',_0x37c0('0x2')];function createListener(_0x2f654d,_0x25930a){return function(_0x3d6e84){_0x25930a[_0x37c0('0x3')](_0x2f654d,_0x3d6e84);};}function removeListener(_0x2b47d7,_0x3dbcaf){return function(){SquareProjectEvents[_0x37c0('0x4')](_0x2b47d7,_0x3dbcaf);};}exports[_0x37c0('0x5')]=function(_0x1ddf65){for(var _0x341228=0x0,_0x4bf512=events['length'];_0x341228<_0x4bf512;_0x341228++){var _0x1aeb85=events[_0x341228];var _0x4a6e0d=createListener(_0x37c0('0x6')+_0x1aeb85,_0x1ddf65);SquareProjectEvents['on'](_0x1aeb85,_0x4a6e0d);}};
\ No newline at end of file
+var _0x17a2=['update','emit','length','squareProject:','save','remove'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x17a2,0xe2));var _0x217a=function(_0x448add,_0x14e685){_0x448add=_0x448add-0x0;var _0x12d3f1=_0x17a2[_0x448add];return _0x12d3f1;};'use strict';var SquareProjectEvents=require('./squareProject.events');var events=[_0x217a('0x0'),_0x217a('0x1'),_0x217a('0x2')];function createListener(_0x40f9bc,_0x2feab1){return function(_0x4a2ce0){_0x2feab1[_0x217a('0x3')](_0x40f9bc,_0x4a2ce0);};}function removeListener(_0x10f958,_0x2c907a){return function(){SquareProjectEvents['removeListener'](_0x10f958,_0x2c907a);};}exports['register']=function(_0x3b9009){for(var _0x586ce6=0x0,_0x3f9ffa=events[_0x217a('0x4')];_0x586ce6<_0x3f9ffa;_0x586ce6++){var _0x3ed129=events[_0x586ce6];var _0x263dc5=createListener(_0x217a('0x5')+_0x3ed129,_0x3b9009);SquareProjectEvents['on'](_0x3ed129,_0x263dc5);}};
\ No newline at end of file
index c643666..8127685 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','index','/:id','isAuthenticated','post','put','update','delete','destroy','exports','multer','util','path','express'];(function(_0x1675ac,_0x2cb438){var _0x395a0c=function(_0x53adf3){while(--_0x53adf3){_0x1675ac['push'](_0x1675ac['shift']());}};_0x395a0c(++_0x2cb438);}(_0x7a54,0x106));var _0x47a5=function(_0x479812,_0x10fee5){_0x479812=_0x479812-0x0;var _0x49b56b=_0x7a54[_0x479812];return _0x49b56b;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['show']);router[_0x47a5('0x9')]('/:id/download',auth['isAuthenticated'](),controller['download']);router[_0x47a5('0xd')]('/',auth[_0x47a5('0xc')](),controller['create']);router[_0x47a5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x47a5('0xf')]);router[_0x47a5('0x10')](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x11')]);module[_0x47a5('0x12')]=router;
\ No newline at end of file
+var _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(_0x16e4c5,_0x2dd81f){var _0x11bfc0=function(_0x5002e9){while(--_0x5002e9){_0x16e4c5['push'](_0x16e4c5['shift']());}};_0x11bfc0(++_0x2dd81f);}(_0x1cb9,0x14e));var _0x91cb=function(_0x521e7e,_0x3dc81d){_0x521e7e=_0x521e7e-0x0;var _0x182db8=_0x1cb9[_0x521e7e];return _0x182db8;};'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
index c649f35..8accd5e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['sequelize','exports','STRING','VIRTUAL','getDataValue','savePath','lastIndexOf'];(function(_0x30b1cf,_0x2f75c4){var _0x2a087d=function(_0x417340){while(--_0x417340){_0x30b1cf['push'](_0x30b1cf['shift']());}};_0x2a087d(++_0x2f75c4);}(_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
+var _0x7c09=['exports','STRING','VIRTUAL','getDataValue','savePath','lastIndexOf'];(function(_0x451bc6,_0x3a50a3){var _0x2d0faa=function(_0x24afd0){while(--_0x24afd0){_0x451bc6['push'](_0x451bc6['shift']());}};_0x2d0faa(++_0x3a50a3);}(_0x7c09,0x102));var _0x97c0=function(_0x41189a,_0x36b745){_0x41189a=_0x41189a-0x0;var _0x5ab985=_0x7c09[_0x41189a];return _0x5ab985;};'use strict';var Sequelize=require('sequelize');module[_0x97c0('0x0')]={'uniqueid':{'type':Sequelize[_0x97c0('0x1')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x97c0('0x1')]},'context':{'type':Sequelize[_0x97c0('0x1')]},'extension':{'type':Sequelize[_0x97c0('0x1')]},'priority':{'type':Sequelize[_0x97c0('0x1')]},'accountcode':{'type':Sequelize[_0x97c0('0x1')]},'dnid':{'type':Sequelize[_0x97c0('0x1')]},'projectName':{'type':Sequelize[_0x97c0('0x1')]},'saveName':{'type':Sequelize['STRING']},'filename':{'type':Sequelize['STRING']},'savePath':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x97c0('0x2')],'get':function(){var _0x42c6c7='';var _0x2c19fa=this[_0x97c0('0x3')](_0x97c0('0x4'));if(_0x2c19fa){_0x42c6c7=_0x2c19fa['substring'](_0x2c19fa[_0x97c0('0x5')]('.'));}return _0x42c6c7;}}};
\ No newline at end of file
index 9015c0d..2d8462d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4e46=['model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','rawAttributes','create','body','find','params','download','../../components/encryptor','uniqueid','filename','savePath','format','%s.cypher','existsSync','decryptFile','recording','Sequelize','SquareRecording\x20not\x20found','message','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','eml-format','rimraf','fast-json-patch','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','apply','reject','save','then','destroy','error','stack','name','send','index','map','SquareRecording','fieldName','type','key'];(function(_0x6b6340,_0x6302c4){var _0x3609bf=function(_0x1620a0){while(--_0x1620a0){_0x6b6340['push'](_0x6b6340['shift']());}};_0x3609bf(++_0x6302c4);}(_0x4e46,0x8d));var _0x64e4=function(_0x2e4959,_0xb35030){_0x2e4959=_0x2e4959-0x0;var _0x2583b3=_0x4e46[_0x2e4959];return _0x2583b3;};'use strict';var emlformat=require(_0x64e4('0x0'));var rimraf=require(_0x64e4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x64e4('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x64e4('0x3'));var Mustache=require(_0x64e4('0x4'));var util=require(_0x64e4('0x5'));var path=require('path');var sox=require(_0x64e4('0x6'));var csv=require(_0x64e4('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x64e4('0x8'));var _=require(_0x64e4('0x9'));var squel=require('squel');var crypto=require(_0x64e4('0xa'));var jsforce=require(_0x64e4('0xb'));var deskjs=require(_0x64e4('0xc'));var toCsv=require(_0x64e4('0x7'));var querystring=require(_0x64e4('0xd'));var Papa=require('papaparse');var Redis=require(_0x64e4('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x64e4('0xf'));var as=require(_0x64e4('0x10'));var hardwareService=require(_0x64e4('0x11'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x64e4('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x64e4('0x13'))['db'];function respondWithStatusCode(_0x1f9f56,_0xc23500){_0xc23500=_0xc23500||0xcc;return function(_0x40ca64){if(_0x40ca64){return _0x1f9f56[_0x64e4('0x14')](_0xc23500);}return _0x1f9f56[_0x64e4('0x15')](_0xc23500)[_0x64e4('0x16')]();};}function respondWithResult(_0xb318c4,_0x501839){_0x501839=_0x501839||0xc8;return function(_0x160e3f){if(_0x160e3f){return _0xb318c4[_0x64e4('0x15')](_0x501839)['json'](_0x160e3f);}};}function respondWithFilteredResult(_0x21c3a3,_0x528a07){return function(_0x396ca5){if(_0x396ca5){var _0x5a42ef=typeof _0x528a07[_0x64e4('0x17')]==='undefined'&&typeof _0x528a07[_0x64e4('0x18')]===_0x64e4('0x19');var _0x4c045c=_0x396ca5['count'];var _0x233f0a=_0x5a42ef?0x0:_0x528a07['offset'];var _0x1ef7cd=_0x5a42ef?_0x396ca5[_0x64e4('0x1a')]:_0x528a07[_0x64e4('0x17')]+_0x528a07[_0x64e4('0x18')];var _0x568d8f;if(_0x1ef7cd>=_0x4c045c){_0x1ef7cd=_0x4c045c;_0x568d8f=0xc8;}else{_0x568d8f=0xce;}_0x21c3a3[_0x64e4('0x15')](_0x568d8f);return _0x21c3a3[_0x64e4('0x1b')]('Content-Range',_0x233f0a+'-'+_0x1ef7cd+'/'+_0x4c045c)['json'](_0x396ca5);}return null;};}function patchUpdates(_0x54c492){return function(_0x557355){try{jsonpatch[_0x64e4('0x1c')](_0x557355,_0x54c492,!![]);}catch(_0x159351){return BPromise[_0x64e4('0x1d')](_0x159351);}return _0x557355[_0x64e4('0x1e')]();};}function saveUpdates(_0x53a8d8,_0x1dc1dd){return function(_0x2d5a88){if(_0x2d5a88){return _0x2d5a88['update'](_0x53a8d8)[_0x64e4('0x1f')](function(_0x289aac){return _0x289aac;});}return null;};}function removeEntity(_0x17bdbe,_0x53a244){return function(_0x44f21e){if(_0x44f21e){return _0x44f21e[_0x64e4('0x20')]()[_0x64e4('0x1f')](function(){_0x17bdbe[_0x64e4('0x15')](0xcc)[_0x64e4('0x16')]();});}};}function handleEntityNotFound(_0x510411,_0x20fc5a){return function(_0x20edc6){if(!_0x20edc6){_0x510411['sendStatus'](0x194);}return _0x20edc6;};}function handleError(_0x9452bd,_0x490e7a){_0x490e7a=_0x490e7a||0x1f4;return function(_0x9e39da){logger[_0x64e4('0x21')](_0x9e39da[_0x64e4('0x22')]);if(_0x9e39da[_0x64e4('0x23')]){delete _0x9e39da['name'];}_0x9452bd[_0x64e4('0x15')](_0x490e7a)[_0x64e4('0x24')](_0x9e39da);};}exports[_0x64e4('0x25')]=function(_0x88eed,_0x3ce697){var _0x55fead={},_0x217131={},_0x2fdd42={'count':0x0,'rows':[]};var _0x4cf8f1=_[_0x64e4('0x26')](db[_0x64e4('0x27')]['rawAttributes'],function(_0xd991be){return{'name':_0xd991be[_0x64e4('0x28')],'type':_0xd991be[_0x64e4('0x29')][_0x64e4('0x2a')]};});_0x217131[_0x64e4('0x2b')]=_[_0x64e4('0x26')](_0x4cf8f1,_0x64e4('0x23'));_0x217131[_0x64e4('0x2c')]=_[_0x64e4('0x2d')](_0x88eed[_0x64e4('0x2c')]);_0x217131[_0x64e4('0x2e')]=_[_0x64e4('0x2f')](_0x217131[_0x64e4('0x2b')],_0x217131[_0x64e4('0x2c')]);_0x55fead[_0x64e4('0x30')]=_[_0x64e4('0x2f')](_0x217131[_0x64e4('0x2b')],qs[_0x64e4('0x31')](_0x88eed['query']['fields']));_0x55fead[_0x64e4('0x30')]=_0x55fead['attributes'][_0x64e4('0x32')]?_0x55fead['attributes']:_0x217131[_0x64e4('0x2b')];if(!_0x88eed[_0x64e4('0x2c')][_0x64e4('0x33')](_0x64e4('0x34'))){_0x55fead[_0x64e4('0x18')]=qs['limit'](_0x88eed[_0x64e4('0x2c')][_0x64e4('0x18')]);_0x55fead[_0x64e4('0x17')]=qs['offset'](_0x88eed[_0x64e4('0x2c')][_0x64e4('0x17')]);}_0x55fead[_0x64e4('0x35')]=qs[_0x64e4('0x36')](_0x88eed[_0x64e4('0x2c')][_0x64e4('0x36')]);_0x55fead[_0x64e4('0x37')]=qs[_0x64e4('0x2e')](_[_0x64e4('0x38')](_0x88eed[_0x64e4('0x2c')],_0x217131['filters']),_0x4cf8f1);if(_0x88eed[_0x64e4('0x2c')][_0x64e4('0x39')]){_0x55fead[_0x64e4('0x37')]=_['merge'](_0x55fead['where'],{'$or':_[_0x64e4('0x26')](_0x4cf8f1,function(_0x4a67fb){if(_0x4a67fb[_0x64e4('0x29')]!==_0x64e4('0x3a')){var _0x9a75dc={};_0x9a75dc[_0x4a67fb[_0x64e4('0x23')]]={'$like':'%'+_0x88eed[_0x64e4('0x2c')][_0x64e4('0x39')]+'%'};return _0x9a75dc;}})});}_0x55fead=_[_0x64e4('0x3b')]({},_0x55fead,_0x88eed[_0x64e4('0x3c')]);var _0x177614={'where':_0x55fead['where']};return db['SquareRecording'][_0x64e4('0x1a')](_0x177614)[_0x64e4('0x1f')](function(_0x2b0dbd){_0x2fdd42[_0x64e4('0x1a')]=_0x2b0dbd;if(_0x88eed[_0x64e4('0x2c')][_0x64e4('0x3d')]){_0x55fead[_0x64e4('0x3e')]=[{'all':!![]}];}return db['SquareRecording'][_0x64e4('0x3f')](_0x55fead);})[_0x64e4('0x1f')](function(_0x5af893){_0x2fdd42['rows']=_0x5af893;return _0x2fdd42;})[_0x64e4('0x1f')](respondWithFilteredResult(_0x3ce697,_0x55fead))[_0x64e4('0x40')](handleError(_0x3ce697,null));};exports[_0x64e4('0x41')]=function(_0x359a44,_0x1d9d3e){var _0x3bc34e={'raw':!![],'where':{'id':_0x359a44['params']['id']}},_0x51fdda={};_0x51fdda[_0x64e4('0x2b')]=_[_0x64e4('0x2d')](db['SquareRecording'][_0x64e4('0x42')]);_0x51fdda[_0x64e4('0x2c')]=_[_0x64e4('0x2d')](_0x359a44['query']);_0x51fdda[_0x64e4('0x2e')]=_[_0x64e4('0x2f')](_0x51fdda['model'],_0x51fdda[_0x64e4('0x2c')]);_0x3bc34e['attributes']=_[_0x64e4('0x2f')](_0x51fdda[_0x64e4('0x2b')],qs[_0x64e4('0x31')](_0x359a44[_0x64e4('0x2c')][_0x64e4('0x31')]));_0x3bc34e['attributes']=_0x3bc34e[_0x64e4('0x30')][_0x64e4('0x32')]?_0x3bc34e[_0x64e4('0x30')]:_0x51fdda['model'];if(_0x359a44[_0x64e4('0x2c')][_0x64e4('0x3d')]){_0x3bc34e[_0x64e4('0x3e')]=[{'all':!![]}];}_0x3bc34e=_[_0x64e4('0x3b')]({},_0x3bc34e,_0x359a44['options']);return db[_0x64e4('0x27')]['find'](_0x3bc34e)['then'](handleEntityNotFound(_0x1d9d3e,null))[_0x64e4('0x1f')](respondWithResult(_0x1d9d3e,null))[_0x64e4('0x40')](handleError(_0x1d9d3e,null));};exports[_0x64e4('0x43')]=function(_0x341ae2,_0x5067bc){return db[_0x64e4('0x27')][_0x64e4('0x43')](_0x341ae2[_0x64e4('0x44')],{})[_0x64e4('0x1f')](respondWithResult(_0x5067bc,0xc9))[_0x64e4('0x40')](handleError(_0x5067bc,null));};exports['update']=function(_0x182a75,_0x489abb){if(_0x182a75[_0x64e4('0x44')]['id']){delete _0x182a75[_0x64e4('0x44')]['id'];}return db['SquareRecording'][_0x64e4('0x45')]({'where':{'id':_0x182a75[_0x64e4('0x46')]['id']}})[_0x64e4('0x1f')](handleEntityNotFound(_0x489abb,null))[_0x64e4('0x1f')](saveUpdates(_0x182a75[_0x64e4('0x44')],null))[_0x64e4('0x1f')](respondWithResult(_0x489abb,null))[_0x64e4('0x40')](handleError(_0x489abb,null));};exports[_0x64e4('0x47')]=function(_0x22ab80,_0x444e8d,_0x43a7d1){var _0x30bbc6=require(_0x64e4('0x48'));var _0x269f3e=![];var _0xba645c={};if(_0x22ab80[_0x64e4('0x2c')]['type']&&_0x22ab80[_0x64e4('0x2c')][_0x64e4('0x29')]===_0x64e4('0x49')){_0xba645c[_0x64e4('0x49')]=_0x22ab80[_0x64e4('0x46')]['id'];}else{_0xba645c['id']=_0x22ab80[_0x64e4('0x46')]['id'];}return db[_0x64e4('0x27')][_0x64e4('0x45')]({'where':_0xba645c,'attributes':['id','savePath',_0x64e4('0x4a')],'raw':!![]})['then'](handleEntityNotFound(_0x444e8d,null))[_0x64e4('0x1f')](function(_0x7aad8){if(_0x7aad8){var _0x1e4998=_0x7aad8[_0x64e4('0x4b')];var _0x4c097e=util[_0x64e4('0x4c')](_0x64e4('0x4d'),_0x1e4998);if(fs[_0x64e4('0x4e')](_0x4c097e)){_0x269f3e=!![];return _0x30bbc6[_0x64e4('0x4f')](_0x4c097e,_0x1e4998,config['secrets'][_0x64e4('0x50')])[_0x64e4('0x1f')](function(){return _0x7aad8;});}return _0x7aad8;}})[_0x64e4('0x1f')](function(_0x6b29ba){if(_0x6b29ba){var _0x6f90d4=_0x6b29ba['savePath'];if(!fs['existsSync'](_0x6f90d4)){throw new db[(_0x64e4('0x51'))]['ValidationError'](_0x64e4('0x52'));}if(_0x6b29ba['filename']){return _0x444e8d[_0x64e4('0x47')](_0x6f90d4,_0x6b29ba['filename']+path['extname'](_0x6f90d4),function(){if(_0x269f3e){fs['unlink'](_0x6f90d4);}});}else{return _0x444e8d[_0x64e4('0x47')](_0x6f90d4,function(_0x5672c4){if(_0x269f3e){fs['unlink'](_0x6f90d4);}});}}})[_0x64e4('0x40')](function(_0x5870e8){if(_0x5870e8[_0x64e4('0x53')]===_0x64e4('0x52')){_0x444e8d[_0x64e4('0x15')](0x194)['send']('Not\x20found');}else{return handleError(_0x444e8d,null);}});};exports[_0x64e4('0x20')]=function(_0x2c5b94,_0x324533){return db[_0x64e4('0x27')][_0x64e4('0x45')]({'where':{'id':_0x2c5b94['params']['id']}})[_0x64e4('0x1f')](function(_0x1b6c72){if(_['isNil'](_0x1b6c72)){throw new ReferenceError(_0x64e4('0x54'));}return _0x1b6c72;})[_0x64e4('0x1f')](function(_0x5bd756){var _0x188718=_0x5bd756[_0x64e4('0x4b')];logger[_0x64e4('0x55')](_0x64e4('0x56'),_0x188718);if(!_[_0x64e4('0x57')](_0x5bd756[_0x64e4('0x4b')])&&fs[_0x64e4('0x4e')](_0x188718)){logger[_0x64e4('0x55')](_0x64e4('0x58')+_0x188718+_0x64e4('0x59'));fs[_0x64e4('0x5a')](_0x188718);}_0x188718=_0x188718+_0x64e4('0x5b');if(!_[_0x64e4('0x57')](_0x5bd756[_0x64e4('0x4b')])&&fs['existsSync'](_0x188718)){logger[_0x64e4('0x55')](_0x64e4('0x58')+_0x188718+_0x64e4('0x59'));fs['unlinkSync'](_0x188718);}return _0x5bd756;})[_0x64e4('0x1f')](function(_0x6ee9da){if(!_0x6ee9da)throw new InternalError();return _0x6ee9da[_0x64e4('0x20')]();})[_0x64e4('0x1f')](function(){_0x324533[_0x64e4('0x15')](0xcc)[_0x64e4('0x16')]();})['catch'](handleError(_0x324533,null));};
\ No newline at end of file
+var _0x648e=['Sequelize','SquareRecording\x20not\x20found','extname','unlink','Entity\x20not\x20found','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','isNil','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','to-csv','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','offset','undefined','count','limit','set','Content-Range','json','update','destroy','then','end','stack','name','send','map','SquareRecording','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','show','params','options','catch','create','body','find','download','../../components/encryptor','uniqueid','savePath','filename','format','existsSync','decryptFile','secrets','recording'];(function(_0x493aaa,_0x1bf361){var _0x4f37ee=function(_0x366a3e){while(--_0x366a3e){_0x493aaa['push'](_0x493aaa['shift']());}};_0x4f37ee(++_0x1bf361);}(_0x648e,0x119));var _0xe648=function(_0x49810c,_0xea46fd){_0x49810c=_0x49810c-0x0;var _0x23f6f3=_0x648e[_0x49810c];return _0x23f6f3;};'use strict';var emlformat=require(_0xe648('0x0'));var rimraf=require(_0xe648('0x1'));var zipdir=require(_0xe648('0x2'));var jsonpatch=require(_0xe648('0x3'));var rp=require(_0xe648('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe648('0x5'));var util=require('util');var path=require(_0xe648('0x6'));var sox=require('sox');var csv=require(_0xe648('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe648('0x8'));var _=require(_0xe648('0x9'));var squel=require(_0xe648('0xa'));var crypto=require(_0xe648('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xe648('0x7'));var querystring=require(_0xe648('0xc'));var Papa=require(_0xe648('0xd'));var Redis=require(_0xe648('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xe648('0xf'));var as=require(_0xe648('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xe648('0x11'));var utils=require(_0xe648('0x12'));var config=require(_0xe648('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xe648('0x14'))['db'];function respondWithStatusCode(_0x11723,_0x1929b3){_0x1929b3=_0x1929b3||0xcc;return function(_0xeb5f03){if(_0xeb5f03){return _0x11723[_0xe648('0x15')](_0x1929b3);}return _0x11723[_0xe648('0x16')](_0x1929b3)['end']();};}function respondWithResult(_0x15b0ea,_0x13ce07){_0x13ce07=_0x13ce07||0xc8;return function(_0x1ece80){if(_0x1ece80){return _0x15b0ea[_0xe648('0x16')](_0x13ce07)['json'](_0x1ece80);}};}function respondWithFilteredResult(_0x2c2b47,_0x48acca){return function(_0x5766a7){if(_0x5766a7){var _0x3cd84d=typeof _0x48acca[_0xe648('0x17')]===_0xe648('0x18')&&typeof _0x48acca['limit']==='undefined';var _0x24f397=_0x5766a7[_0xe648('0x19')];var _0x153414=_0x3cd84d?0x0:_0x48acca[_0xe648('0x17')];var _0x1fb04b=_0x3cd84d?_0x5766a7['count']:_0x48acca[_0xe648('0x17')]+_0x48acca[_0xe648('0x1a')];var _0x507ef7;if(_0x1fb04b>=_0x24f397){_0x1fb04b=_0x24f397;_0x507ef7=0xc8;}else{_0x507ef7=0xce;}_0x2c2b47[_0xe648('0x16')](_0x507ef7);return _0x2c2b47[_0xe648('0x1b')](_0xe648('0x1c'),_0x153414+'-'+_0x1fb04b+'/'+_0x24f397)[_0xe648('0x1d')](_0x5766a7);}return null;};}function patchUpdates(_0x52a542){return function(_0x35f6c7){try{jsonpatch['apply'](_0x35f6c7,_0x52a542,!![]);}catch(_0x4b3f38){return BPromise['reject'](_0x4b3f38);}return _0x35f6c7['save']();};}function saveUpdates(_0x4bd096,_0x1493db){return function(_0x3d572e){if(_0x3d572e){return _0x3d572e[_0xe648('0x1e')](_0x4bd096)['then'](function(_0x29f12d){return _0x29f12d;});}return null;};}function removeEntity(_0x455646,_0x144e9e){return function(_0x2e0249){if(_0x2e0249){return _0x2e0249[_0xe648('0x1f')]()[_0xe648('0x20')](function(){_0x455646[_0xe648('0x16')](0xcc)[_0xe648('0x21')]();});}};}function handleEntityNotFound(_0x4b46fa,_0x16a730){return function(_0x573d8f){if(!_0x573d8f){_0x4b46fa[_0xe648('0x15')](0x194);}return _0x573d8f;};}function handleError(_0x4f509c,_0x1ed0da){_0x1ed0da=_0x1ed0da||0x1f4;return function(_0x125ed2){logger['error'](_0x125ed2[_0xe648('0x22')]);if(_0x125ed2[_0xe648('0x23')]){delete _0x125ed2[_0xe648('0x23')];}_0x4f509c[_0xe648('0x16')](_0x1ed0da)[_0xe648('0x24')](_0x125ed2);};}exports['index']=function(_0x411a2d,_0x1462fa){var _0x4fad83={},_0x2dfa88={},_0x2f133e={'count':0x0,'rows':[]};var _0x3d0bd0=_[_0xe648('0x25')](db[_0xe648('0x26')][_0xe648('0x27')],function(_0x576711){return{'name':_0x576711[_0xe648('0x28')],'type':_0x576711[_0xe648('0x29')][_0xe648('0x2a')]};});_0x2dfa88[_0xe648('0x2b')]=_[_0xe648('0x25')](_0x3d0bd0,_0xe648('0x23'));_0x2dfa88[_0xe648('0x2c')]=_[_0xe648('0x2d')](_0x411a2d['query']);_0x2dfa88[_0xe648('0x2e')]=_['intersection'](_0x2dfa88[_0xe648('0x2b')],_0x2dfa88[_0xe648('0x2c')]);_0x4fad83[_0xe648('0x2f')]=_[_0xe648('0x30')](_0x2dfa88[_0xe648('0x2b')],qs[_0xe648('0x31')](_0x411a2d['query']['fields']));_0x4fad83[_0xe648('0x2f')]=_0x4fad83[_0xe648('0x2f')][_0xe648('0x32')]?_0x4fad83[_0xe648('0x2f')]:_0x2dfa88[_0xe648('0x2b')];if(!_0x411a2d[_0xe648('0x2c')][_0xe648('0x33')](_0xe648('0x34'))){_0x4fad83[_0xe648('0x1a')]=qs['limit'](_0x411a2d[_0xe648('0x2c')][_0xe648('0x1a')]);_0x4fad83[_0xe648('0x17')]=qs[_0xe648('0x17')](_0x411a2d[_0xe648('0x2c')][_0xe648('0x17')]);}_0x4fad83['order']=qs[_0xe648('0x35')](_0x411a2d['query'][_0xe648('0x35')]);_0x4fad83[_0xe648('0x36')]=qs[_0xe648('0x2e')](_[_0xe648('0x37')](_0x411a2d['query'],_0x2dfa88['filters']),_0x3d0bd0);if(_0x411a2d[_0xe648('0x2c')][_0xe648('0x38')]){_0x4fad83[_0xe648('0x36')]=_[_0xe648('0x39')](_0x4fad83[_0xe648('0x36')],{'$or':_[_0xe648('0x25')](_0x3d0bd0,function(_0xd89e53){if(_0xd89e53[_0xe648('0x29')]!==_0xe648('0x3a')){var _0x1f8de9={};_0x1f8de9[_0xd89e53[_0xe648('0x23')]]={'$like':'%'+_0x411a2d[_0xe648('0x2c')]['filter']+'%'};return _0x1f8de9;}})});}_0x4fad83=_[_0xe648('0x39')]({},_0x4fad83,_0x411a2d['options']);var _0x1436b9={'where':_0x4fad83['where']};return db[_0xe648('0x26')][_0xe648('0x19')](_0x1436b9)[_0xe648('0x20')](function(_0x38f08b){_0x2f133e[_0xe648('0x19')]=_0x38f08b;if(_0x411a2d['query'][_0xe648('0x3b')]){_0x4fad83[_0xe648('0x3c')]=[{'all':!![]}];}return db[_0xe648('0x26')][_0xe648('0x3d')](_0x4fad83);})['then'](function(_0x175bcf){_0x2f133e['rows']=_0x175bcf;return _0x2f133e;})[_0xe648('0x20')](respondWithFilteredResult(_0x1462fa,_0x4fad83))['catch'](handleError(_0x1462fa,null));};exports[_0xe648('0x3e')]=function(_0x592343,_0x4b88dc){var _0x4255e4={'raw':!![],'where':{'id':_0x592343[_0xe648('0x3f')]['id']}},_0x570ba8={};_0x570ba8['model']=_[_0xe648('0x2d')](db[_0xe648('0x26')]['rawAttributes']);_0x570ba8[_0xe648('0x2c')]=_[_0xe648('0x2d')](_0x592343[_0xe648('0x2c')]);_0x570ba8[_0xe648('0x2e')]=_[_0xe648('0x30')](_0x570ba8[_0xe648('0x2b')],_0x570ba8[_0xe648('0x2c')]);_0x4255e4[_0xe648('0x2f')]=_[_0xe648('0x30')](_0x570ba8[_0xe648('0x2b')],qs[_0xe648('0x31')](_0x592343[_0xe648('0x2c')][_0xe648('0x31')]));_0x4255e4[_0xe648('0x2f')]=_0x4255e4[_0xe648('0x2f')]['length']?_0x4255e4[_0xe648('0x2f')]:_0x570ba8[_0xe648('0x2b')];if(_0x592343[_0xe648('0x2c')][_0xe648('0x3b')]){_0x4255e4[_0xe648('0x3c')]=[{'all':!![]}];}_0x4255e4=_[_0xe648('0x39')]({},_0x4255e4,_0x592343[_0xe648('0x40')]);return db[_0xe648('0x26')]['find'](_0x4255e4)['then'](handleEntityNotFound(_0x4b88dc,null))[_0xe648('0x20')](respondWithResult(_0x4b88dc,null))[_0xe648('0x41')](handleError(_0x4b88dc,null));};exports['create']=function(_0x3e63bd,_0x265d1f){return db[_0xe648('0x26')][_0xe648('0x42')](_0x3e63bd['body'],{})[_0xe648('0x20')](respondWithResult(_0x265d1f,0xc9))[_0xe648('0x41')](handleError(_0x265d1f,null));};exports[_0xe648('0x1e')]=function(_0x39c816,_0x38d925){if(_0x39c816['body']['id']){delete _0x39c816[_0xe648('0x43')]['id'];}return db[_0xe648('0x26')][_0xe648('0x44')]({'where':{'id':_0x39c816['params']['id']}})[_0xe648('0x20')](handleEntityNotFound(_0x38d925,null))[_0xe648('0x20')](saveUpdates(_0x39c816['body'],null))[_0xe648('0x20')](respondWithResult(_0x38d925,null))[_0xe648('0x41')](handleError(_0x38d925,null));};exports[_0xe648('0x45')]=function(_0x15c6f4,_0x5ccd53,_0xcb0ae8){var _0x3bc24e=require(_0xe648('0x46'));var _0x374881=![];var _0x4d6a87={};if(_0x15c6f4[_0xe648('0x2c')][_0xe648('0x29')]&&_0x15c6f4[_0xe648('0x2c')]['type']===_0xe648('0x47')){_0x4d6a87[_0xe648('0x47')]=_0x15c6f4[_0xe648('0x3f')]['id'];}else{_0x4d6a87['id']=_0x15c6f4['params']['id'];}return db[_0xe648('0x26')][_0xe648('0x44')]({'where':_0x4d6a87,'attributes':['id',_0xe648('0x48'),_0xe648('0x49')],'raw':!![]})[_0xe648('0x20')](handleEntityNotFound(_0x5ccd53,null))[_0xe648('0x20')](function(_0x461e66){if(_0x461e66){var _0x5d2b1c=_0x461e66[_0xe648('0x48')];var _0x33f9de=util[_0xe648('0x4a')]('%s.cypher',_0x5d2b1c);if(fs[_0xe648('0x4b')](_0x33f9de)){_0x374881=!![];return _0x3bc24e[_0xe648('0x4c')](_0x33f9de,_0x5d2b1c,config[_0xe648('0x4d')][_0xe648('0x4e')])[_0xe648('0x20')](function(){return _0x461e66;});}return _0x461e66;}})[_0xe648('0x20')](function(_0x450d1f){if(_0x450d1f){var _0x4ebd9e=_0x450d1f[_0xe648('0x48')];if(!fs[_0xe648('0x4b')](_0x4ebd9e)){throw new db[(_0xe648('0x4f'))]['ValidationError'](_0xe648('0x50'));}if(_0x450d1f[_0xe648('0x49')]){return _0x5ccd53[_0xe648('0x45')](_0x4ebd9e,_0x450d1f['filename']+path[_0xe648('0x51')](_0x4ebd9e),function(){if(_0x374881){fs[_0xe648('0x52')](_0x4ebd9e);}});}else{return _0x5ccd53['download'](_0x4ebd9e,function(_0x26ba88){if(_0x374881){fs[_0xe648('0x52')](_0x4ebd9e);}});}}})[_0xe648('0x41')](function(_0x1961bd){if(_0x1961bd['message']===_0xe648('0x50')){_0x5ccd53['status'](0x194)[_0xe648('0x24')]('Not\x20found');}else{return handleError(_0x5ccd53,null);}});};exports['destroy']=function(_0x30ed2d,_0x25f46f){return db[_0xe648('0x26')][_0xe648('0x44')]({'where':{'id':_0x30ed2d[_0xe648('0x3f')]['id']}})['then'](function(_0x50943e){if(_['isNil'](_0x50943e)){throw new ReferenceError(_0xe648('0x53'));}return _0x50943e;})[_0xe648('0x20')](function(_0x11f877){var _0x3b60fb=_0x11f877[_0xe648('0x48')];logger[_0xe648('0x54')]('cancellazione\x20fisica\x20documento\x20%s',_0x3b60fb);if(!_['isNil'](_0x11f877['savePath'])&&fs[_0xe648('0x4b')](_0x3b60fb)){logger['info'](_0xe648('0x55')+_0x3b60fb+_0xe648('0x56'));fs[_0xe648('0x57')](_0x3b60fb);}_0x3b60fb=_0x3b60fb+_0xe648('0x58');if(!_[_0xe648('0x59')](_0x11f877[_0xe648('0x48')])&&fs[_0xe648('0x4b')](_0x3b60fb)){logger[_0xe648('0x54')](_0xe648('0x55')+_0x3b60fb+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xe648('0x57')](_0x3b60fb);}return _0x11f877;})[_0xe648('0x20')](function(_0x2f528a){if(!_0x2f528a)throw new InternalError();return _0x2f528a[_0xe648('0x1f')]();})[_0xe648('0x20')](function(){_0x25f46f['status'](0xcc)[_0xe648('0x21')]();})[_0xe648('0x41')](handleError(_0x25f46f,null));};
\ No newline at end of file
index c7cae74..6adaefd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbe2c=['define','SquareRecording','square_recordings','lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x47c799,_0x20629a){var _0x12b4dd=function(_0xf5a44b){while(--_0xf5a44b){_0x47c799['push'](_0x47c799['shift']());}};_0x12b4dd(++_0x20629a);}(_0xbe2c,0x18f));var _0xcbe2=function(_0x50ca0b,_0x1cbcef){_0x50ca0b=_0x50ca0b-0x0;var _0x326ec7=_0xbe2c[_0x50ca0b];return _0x326ec7;};'use strict';var _=require(_0xcbe2('0x0'));var util=require(_0xcbe2('0x1'));var logger=require('../../config/logger')(_0xcbe2('0x2'));var moment=require('moment');var BPromise=require(_0xcbe2('0x3'));var rp=require(_0xcbe2('0x4'));var fs=require('fs');var path=require(_0xcbe2('0x5'));var rimraf=require(_0xcbe2('0x6'));var config=require(_0xcbe2('0x7'));var attributes=require('./squareRecording.attributes');module[_0xcbe2('0x8')]=function(_0x2f1e95,_0x519925){return _0x2f1e95[_0xcbe2('0x9')](_0xcbe2('0xa'),attributes,{'tableName':_0xcbe2('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7c71=['define','SquareRecording','square_recordings','lodash','util','../../config/logger','api','bluebird','request-promise','path','./squareRecording.attributes','exports'];(function(_0x1d2097,_0x245566){var _0x54cc47=function(_0x378a97){while(--_0x378a97){_0x1d2097['push'](_0x1d2097['shift']());}};_0x54cc47(++_0x245566);}(_0x7c71,0x177));var _0x17c7=function(_0x59eefb,_0x2151ce){_0x59eefb=_0x59eefb-0x0;var _0x1a49e8=_0x7c71[_0x59eefb];return _0x1a49e8;};'use strict';var _=require(_0x17c7('0x0'));var util=require(_0x17c7('0x1'));var logger=require(_0x17c7('0x2'))(_0x17c7('0x3'));var moment=require('moment');var BPromise=require(_0x17c7('0x4'));var rp=require(_0x17c7('0x5'));var fs=require('fs');var path=require(_0x17c7('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x17c7('0x7'));module[_0x17c7('0x8')]=function(_0x26b276,_0x3e98d9){return _0x26b276[_0x17c7('0x9')](_0x17c7('0xa'),attributes,{'tableName':_0x17c7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 5cbb091..58131ae 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x07f9=['error','code','SquareRecording,\x20%s,\x20%s','message','result','catch','SquareRecording','create','body','options','CreateSquareRecording','stringify','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','http','then','info','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s'];(function(_0x870b69,_0x123d24){var _0x5375e8=function(_0x7b5899){while(--_0x7b5899){_0x870b69['push'](_0x870b69['shift']());}};_0x5375e8(++_0x123d24);}(_0x07f9,0x186));var _0x907f=function(_0x104bd6,_0x61e7ac){_0x104bd6=_0x104bd6-0x0;var _0x18a878=_0x07f9[_0x104bd6];return _0x18a878;};'use strict';var _=require(_0x907f('0x0'));var util=require('util');var moment=require(_0x907f('0x1'));var BPromise=require(_0x907f('0x2'));var rs=require(_0x907f('0x3'));var fs=require('fs');var Redis=require(_0x907f('0x4'));var db=require(_0x907f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x907f('0x6'))('rpc');var config=require(_0x907f('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x907f('0x8')][_0x907f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x212988,_0x180490,_0x11e174){return new BPromise(function(_0x5bcf77,_0x526bd9){return client['request'](_0x212988,_0x11e174)[_0x907f('0xa')](function(_0x28518e){logger[_0x907f('0xb')]('SquareRecording,\x20%s,\x20%s',_0x180490,_0x907f('0xc'));logger[_0x907f('0xd')](_0x907f('0xe'),_0x180490,_0x907f('0xc'),JSON['stringify'](_0x28518e));if(_0x28518e[_0x907f('0xf')]){if(_0x28518e[_0x907f('0xf')][_0x907f('0x10')]===0x1f4){logger['error'](_0x907f('0x11'),_0x180490,_0x28518e[_0x907f('0xf')][_0x907f('0x12')]);return _0x526bd9(_0x28518e[_0x907f('0xf')][_0x907f('0x12')]);}logger[_0x907f('0xf')](_0x907f('0x11'),_0x180490,_0x28518e[_0x907f('0xf')][_0x907f('0x12')]);return _0x5bcf77(_0x28518e[_0x907f('0xf')][_0x907f('0x12')]);}else{logger[_0x907f('0xb')]('SquareRecording,\x20%s,\x20%s',_0x180490,_0x907f('0xc'));_0x5bcf77(_0x28518e[_0x907f('0x13')][_0x907f('0x12')]);}})[_0x907f('0x14')](function(_0x45cb4d){logger[_0x907f('0xf')](_0x907f('0x11'),_0x180490,_0x45cb4d);_0x526bd9(_0x45cb4d);});});}exports['CreateSquareRecording']=function(_0x50b009){var _0x41d64d=this;return new Promise(function(_0x4bc530,_0x13597f){return db[_0x907f('0x15')][_0x907f('0x16')](_0x50b009[_0x907f('0x17')],{'raw':_0x50b009['options']?_0x50b009[_0x907f('0x18')]['raw']===undefined?!![]:![]:!![]})[_0x907f('0xa')](function(_0x48d50f){logger[_0x907f('0xb')]('CreateSquareRecording',_0x50b009);logger['debug'](_0x907f('0x19'),_0x50b009,JSON[_0x907f('0x1a')](_0x48d50f));_0x4bc530(_0x48d50f);})[_0x907f('0x14')](function(_0x59de6e){logger[_0x907f('0xf')](_0x907f('0x19'),_0x59de6e[_0x907f('0x12')],_0x50b009);_0x13597f(_0x41d64d['error'](0x1f4,_0x59de6e[_0x907f('0x12')]));});});};
\ No newline at end of file
+var _0x380e=['SquareRecording','body','options','raw','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','request','then','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','CreateSquareRecording'];(function(_0x104ffb,_0x4452fd){var _0x3563e0=function(_0x1fb090){while(--_0x1fb090){_0x104ffb['push'](_0x104ffb['shift']());}};_0x3563e0(++_0x4452fd);}(_0x380e,0xc2));var _0xe380=function(_0x262972,_0xc36bc7){_0x262972=_0x262972-0x0;var _0x518c1c=_0x380e[_0x262972];return _0x518c1c;};'use strict';var _=require(_0xe380('0x0'));var util=require(_0xe380('0x1'));var moment=require(_0xe380('0x2'));var BPromise=require(_0xe380('0x3'));var rs=require(_0xe380('0x4'));var fs=require('fs');var Redis=require(_0xe380('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xe380('0x6'))(_0xe380('0x7'));var config=require('../../config/environment');var jayson=require(_0xe380('0x8'));var client=jayson[_0xe380('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4cfbf5,_0x435ace,_0x4c33be){return new BPromise(function(_0x1f2789,_0x48f5a6){return client[_0xe380('0xa')](_0x4cfbf5,_0x4c33be)[_0xe380('0xb')](function(_0x235961){logger['info'](_0xe380('0xc'),_0x435ace,_0xe380('0xd'));logger[_0xe380('0xe')](_0xe380('0xf'),_0x435ace,_0xe380('0xd'),JSON['stringify'](_0x235961));if(_0x235961['error']){if(_0x235961[_0xe380('0x10')][_0xe380('0x11')]===0x1f4){logger['error'](_0xe380('0xc'),_0x435ace,_0x235961[_0xe380('0x10')][_0xe380('0x12')]);return _0x48f5a6(_0x235961[_0xe380('0x10')][_0xe380('0x12')]);}logger['error']('SquareRecording,\x20%s,\x20%s',_0x435ace,_0x235961['error'][_0xe380('0x12')]);return _0x1f2789(_0x235961['error'][_0xe380('0x12')]);}else{logger[_0xe380('0x13')](_0xe380('0xc'),_0x435ace,_0xe380('0xd'));_0x1f2789(_0x235961['result'][_0xe380('0x12')]);}})[_0xe380('0x14')](function(_0x353273){logger[_0xe380('0x10')](_0xe380('0xc'),_0x435ace,_0x353273);_0x48f5a6(_0x353273);});});}exports[_0xe380('0x15')]=function(_0x19de8c){var _0x3f376e=this;return new Promise(function(_0x51c65e,_0x153261){return db[_0xe380('0x16')]['create'](_0x19de8c[_0xe380('0x17')],{'raw':_0x19de8c[_0xe380('0x18')]?_0x19de8c[_0xe380('0x18')][_0xe380('0x19')]===undefined?!![]:![]:!![]})[_0xe380('0xb')](function(_0x3e4da9){logger[_0xe380('0x13')](_0xe380('0x15'),_0x19de8c);logger[_0xe380('0xe')](_0xe380('0x15'),_0x19de8c,JSON[_0xe380('0x1a')](_0x3e4da9));_0x51c65e(_0x3e4da9);})[_0xe380('0x14')](function(_0xa7999a){logger[_0xe380('0x10')]('CreateSquareRecording',_0xa7999a[_0xe380('0x12')],_0x19de8c);_0x153261(_0x3f376e[_0xe380('0x10')](0x1f4,_0xa7999a[_0xe380('0x12')]));});});};
\ No newline at end of file
index 059f2e0..b85d0ac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x5d1df9,_0x4a95bf){var _0x5d4feb=function(_0x37b443){while(--_0x37b443){_0x5d1df9['push'](_0x5d1df9['shift']());}};_0x5d4feb(++_0x4a95bf);}(_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'));var controller=require('./squareReport.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router;
\ No newline at end of file
+var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x4b9b78,_0x1dc74a){var _0x330388=function(_0x49bcdc){while(--_0x49bcdc){_0x4b9b78['push'](_0x4b9b78['shift']());}};_0x330388(++_0x1dc74a);}(_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('./squareReport.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router;
\ No newline at end of file
index b65e178..02bfc74 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd63b=['DATE','BOOLEAN','exports','STRING'];(function(_0x55f6ba,_0x231f9f){var _0x31f8d8=function(_0x132f01){while(--_0x132f01){_0x55f6ba['push'](_0x55f6ba['shift']());}};_0x31f8d8(++_0x231f9f);}(_0xd63b,0x16e));var _0xbd63=function(_0x703096,_0xd95aa0){_0x703096=_0x703096-0x0;var _0x334db9=_0xd63b[_0x703096];return _0x334db9;};'use strict';var Sequelize=require('sequelize');module[_0xbd63('0x0')]={'network':{'type':Sequelize[_0xbd63('0x1')]},'network_script':{'type':Sequelize[_0xbd63('0x1')]},'request':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xbd63('0x1')]},'language':{'type':Sequelize[_0xbd63('0x1')]},'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xbd63('0x1')]},'version':{'type':Sequelize[_0xbd63('0x1')]},'callerid':{'type':Sequelize[_0xbd63('0x1')]},'calleridname':{'type':Sequelize[_0xbd63('0x1')]},'callingpres':{'type':Sequelize[_0xbd63('0x1')]},'callingani2':{'type':Sequelize[_0xbd63('0x1')]},'callington':{'type':Sequelize[_0xbd63('0x1')]},'callingtns':{'type':Sequelize[_0xbd63('0x1')]},'dnid':{'type':Sequelize['STRING']},'rdnis':{'type':Sequelize[_0xbd63('0x1')]},'context':{'type':Sequelize[_0xbd63('0x1')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xbd63('0x1')]},'enhanced':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'threadid':{'type':Sequelize[_0xbd63('0x1')]},'project_name':{'type':Sequelize[_0xbd63('0x1')]},'joinAt':{'type':Sequelize[_0xbd63('0x2')]},'leaveAt':{'type':Sequelize[_0xbd63('0x2')]},'bot':{'type':Sequelize[_0xbd63('0x3')],'defaultValue':![]}};
\ No newline at end of file
+var _0x034b=['exports','STRING','DATE','sequelize'];(function(_0x1390c5,_0x5d4312){var _0x2b99a5=function(_0x5cc06f){while(--_0x5cc06f){_0x1390c5['push'](_0x1390c5['shift']());}};_0x2b99a5(++_0x5d4312);}(_0x034b,0xc7));var _0xb034=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x034b[_0x3947c9];return _0x2e7871;};'use strict';var Sequelize=require(_0xb034('0x0'));module[_0xb034('0x1')]={'network':{'type':Sequelize[_0xb034('0x2')]},'network_script':{'type':Sequelize[_0xb034('0x2')]},'request':{'type':Sequelize[_0xb034('0x2')]},'channel':{'type':Sequelize[_0xb034('0x2')]},'language':{'type':Sequelize[_0xb034('0x2')]},'type':{'type':Sequelize[_0xb034('0x2')]},'uniqueid':{'type':Sequelize[_0xb034('0x2')]},'version':{'type':Sequelize[_0xb034('0x2')]},'callerid':{'type':Sequelize[_0xb034('0x2')]},'calleridname':{'type':Sequelize[_0xb034('0x2')]},'callingpres':{'type':Sequelize[_0xb034('0x2')]},'callingani2':{'type':Sequelize[_0xb034('0x2')]},'callington':{'type':Sequelize[_0xb034('0x2')]},'callingtns':{'type':Sequelize[_0xb034('0x2')]},'dnid':{'type':Sequelize[_0xb034('0x2')]},'rdnis':{'type':Sequelize[_0xb034('0x2')]},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0xb034('0x2')]},'priority':{'type':Sequelize[_0xb034('0x2')]},'enhanced':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xb034('0x2')]},'threadid':{'type':Sequelize[_0xb034('0x2')]},'project_name':{'type':Sequelize[_0xb034('0x2')]},'joinAt':{'type':Sequelize[_0xb034('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'bot':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
index 69bcfa8..b51eecd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xde52=['offset','undefined','limit','count','set','Content-Range','json','reject','save','then','destroy','end','error','name','index','map','rawAttributes','type','key','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','SquareReport','include','findAll','rows','catch','show','keys','includeAll','find','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xde52,0x10d));var _0x2de5=function(_0x5502a7,_0x325618){_0x5502a7=_0x5502a7-0x0;var _0x3946fa=_0xde52[_0x5502a7];return _0x3946fa;};'use strict';var emlformat=require(_0x2de5('0x0'));var rimraf=require(_0x2de5('0x1'));var zipdir=require(_0x2de5('0x2'));var jsonpatch=require(_0x2de5('0x3'));var rp=require(_0x2de5('0x4'));var moment=require(_0x2de5('0x5'));var BPromise=require(_0x2de5('0x6'));var Mustache=require('mustache');var util=require(_0x2de5('0x7'));var path=require(_0x2de5('0x8'));var sox=require(_0x2de5('0x9'));var csv=require(_0x2de5('0xa'));var ejs=require(_0x2de5('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x2de5('0xc'));var jsforce=require(_0x2de5('0xd'));var deskjs=require(_0x2de5('0xe'));var toCsv=require(_0x2de5('0xa'));var querystring=require(_0x2de5('0xf'));var Papa=require(_0x2de5('0x10'));var Redis=require(_0x2de5('0x11'));var authService=require(_0x2de5('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x2de5('0x13'));var hardwareService=require(_0x2de5('0x14'));var logger=require(_0x2de5('0x15'))(_0x2de5('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x2de5('0x17'));var db=require(_0x2de5('0x18'))['db'];function respondWithStatusCode(_0x236ca5,_0x13009a){_0x13009a=_0x13009a||0xcc;return function(_0x29a31e){if(_0x29a31e){return _0x236ca5[_0x2de5('0x19')](_0x13009a);}return _0x236ca5[_0x2de5('0x1a')](_0x13009a)['end']();};}function respondWithResult(_0x537ba6,_0x19ad83){_0x19ad83=_0x19ad83||0xc8;return function(_0x5576f3){if(_0x5576f3){return _0x537ba6[_0x2de5('0x1a')](_0x19ad83)['json'](_0x5576f3);}};}function respondWithFilteredResult(_0x4b6383,_0x187aa9){return function(_0x25ee91){if(_0x25ee91){var _0x568895=typeof _0x187aa9[_0x2de5('0x1b')]===_0x2de5('0x1c')&&typeof _0x187aa9[_0x2de5('0x1d')]===_0x2de5('0x1c');var _0x33f6db=_0x25ee91[_0x2de5('0x1e')];var _0x212957=_0x568895?0x0:_0x187aa9['offset'];var _0x53d21e=_0x568895?_0x25ee91[_0x2de5('0x1e')]:_0x187aa9[_0x2de5('0x1b')]+_0x187aa9[_0x2de5('0x1d')];var _0x1c1203;if(_0x53d21e>=_0x33f6db){_0x53d21e=_0x33f6db;_0x1c1203=0xc8;}else{_0x1c1203=0xce;}_0x4b6383[_0x2de5('0x1a')](_0x1c1203);return _0x4b6383[_0x2de5('0x1f')](_0x2de5('0x20'),_0x212957+'-'+_0x53d21e+'/'+_0x33f6db)[_0x2de5('0x21')](_0x25ee91);}return null;};}function patchUpdates(_0xfe27b1){return function(_0x1d2571){try{jsonpatch['apply'](_0x1d2571,_0xfe27b1,!![]);}catch(_0x37d41d){return BPromise[_0x2de5('0x22')](_0x37d41d);}return _0x1d2571[_0x2de5('0x23')]();};}function saveUpdates(_0x545364,_0x4f60b4){return function(_0x398d17){if(_0x398d17){return _0x398d17['update'](_0x545364)[_0x2de5('0x24')](function(_0x573f33){return _0x573f33;});}return null;};}function removeEntity(_0xee821e,_0x26cbbe){return function(_0x35e8fe){if(_0x35e8fe){return _0x35e8fe[_0x2de5('0x25')]()[_0x2de5('0x24')](function(){_0xee821e[_0x2de5('0x1a')](0xcc)[_0x2de5('0x26')]();});}};}function handleEntityNotFound(_0x7fad31,_0x1d44ff){return function(_0x442c9e){if(!_0x442c9e){_0x7fad31[_0x2de5('0x19')](0x194);}return _0x442c9e;};}function handleError(_0x814142,_0x46866f){_0x46866f=_0x46866f||0x1f4;return function(_0x29ce0c){logger[_0x2de5('0x27')](_0x29ce0c['stack']);if(_0x29ce0c[_0x2de5('0x28')]){delete _0x29ce0c['name'];}_0x814142['status'](_0x46866f)['send'](_0x29ce0c);};}exports[_0x2de5('0x29')]=function(_0x32c44a,_0x1dbbf7){var _0x45bfd9={},_0x4a5851={},_0x4c56c9={'count':0x0,'rows':[]};var _0x325b46=_[_0x2de5('0x2a')](db['SquareReport'][_0x2de5('0x2b')],function(_0x3236c9){return{'name':_0x3236c9['fieldName'],'type':_0x3236c9[_0x2de5('0x2c')][_0x2de5('0x2d')]};});_0x4a5851['model']=_[_0x2de5('0x2a')](_0x325b46,'name');_0x4a5851[_0x2de5('0x2e')]=_['keys'](_0x32c44a[_0x2de5('0x2e')]);_0x4a5851[_0x2de5('0x2f')]=_[_0x2de5('0x30')](_0x4a5851[_0x2de5('0x31')],_0x4a5851[_0x2de5('0x2e')]);_0x45bfd9['attributes']=_['intersection'](_0x4a5851['model'],qs[_0x2de5('0x32')](_0x32c44a['query'][_0x2de5('0x32')]));_0x45bfd9['attributes']=_0x45bfd9[_0x2de5('0x33')][_0x2de5('0x34')]?_0x45bfd9[_0x2de5('0x33')]:_0x4a5851[_0x2de5('0x31')];if(!_0x32c44a[_0x2de5('0x2e')][_0x2de5('0x35')](_0x2de5('0x36'))){_0x45bfd9['limit']=qs[_0x2de5('0x1d')](_0x32c44a['query'][_0x2de5('0x1d')]);_0x45bfd9[_0x2de5('0x1b')]=qs[_0x2de5('0x1b')](_0x32c44a[_0x2de5('0x2e')][_0x2de5('0x1b')]);}_0x45bfd9[_0x2de5('0x37')]=qs[_0x2de5('0x38')](_0x32c44a[_0x2de5('0x2e')][_0x2de5('0x38')]);_0x45bfd9[_0x2de5('0x39')]=qs[_0x2de5('0x2f')](_[_0x2de5('0x3a')](_0x32c44a[_0x2de5('0x2e')],_0x4a5851[_0x2de5('0x2f')]),_0x325b46);if(_0x32c44a['query'][_0x2de5('0x3b')]){_0x45bfd9['where']=_[_0x2de5('0x3c')](_0x45bfd9[_0x2de5('0x39')],{'$or':_['map'](_0x325b46,function(_0x698d7a){if(_0x698d7a[_0x2de5('0x2c')]!=='VIRTUAL'){var _0x4bb0ab={};_0x4bb0ab[_0x698d7a[_0x2de5('0x28')]]={'$like':'%'+_0x32c44a[_0x2de5('0x2e')][_0x2de5('0x3b')]+'%'};return _0x4bb0ab;}})});}_0x45bfd9=_[_0x2de5('0x3c')]({},_0x45bfd9,_0x32c44a[_0x2de5('0x3d')]);var _0x580608={'where':_0x45bfd9['where']};return db[_0x2de5('0x3e')]['count'](_0x580608)['then'](function(_0x4d70bd){_0x4c56c9[_0x2de5('0x1e')]=_0x4d70bd;if(_0x32c44a[_0x2de5('0x2e')]['includeAll']){_0x45bfd9[_0x2de5('0x3f')]=[{'all':!![]}];}return db[_0x2de5('0x3e')][_0x2de5('0x40')](_0x45bfd9);})[_0x2de5('0x24')](function(_0x3cd950){_0x4c56c9[_0x2de5('0x41')]=_0x3cd950;return _0x4c56c9;})[_0x2de5('0x24')](respondWithFilteredResult(_0x1dbbf7,_0x45bfd9))[_0x2de5('0x42')](handleError(_0x1dbbf7,null));};exports[_0x2de5('0x43')]=function(_0x5212fe,_0x1b580a){var _0x187708={'raw':!![],'where':{'id':_0x5212fe['params']['id']}},_0x5c9d38={};_0x5c9d38['model']=_[_0x2de5('0x44')](db['SquareReport'][_0x2de5('0x2b')]);_0x5c9d38[_0x2de5('0x2e')]=_['keys'](_0x5212fe[_0x2de5('0x2e')]);_0x5c9d38[_0x2de5('0x2f')]=_['intersection'](_0x5c9d38[_0x2de5('0x31')],_0x5c9d38[_0x2de5('0x2e')]);_0x187708[_0x2de5('0x33')]=_[_0x2de5('0x30')](_0x5c9d38[_0x2de5('0x31')],qs['fields'](_0x5212fe['query']['fields']));_0x187708[_0x2de5('0x33')]=_0x187708[_0x2de5('0x33')]['length']?_0x187708[_0x2de5('0x33')]:_0x5c9d38[_0x2de5('0x31')];if(_0x5212fe['query'][_0x2de5('0x45')]){_0x187708['include']=[{'all':!![]}];}_0x187708=_[_0x2de5('0x3c')]({},_0x187708,_0x5212fe[_0x2de5('0x3d')]);return db[_0x2de5('0x3e')][_0x2de5('0x46')](_0x187708)[_0x2de5('0x24')](handleEntityNotFound(_0x1b580a,null))[_0x2de5('0x24')](respondWithResult(_0x1b580a,null))['catch'](handleError(_0x1b580a,null));};exports[_0x2de5('0x47')]=function(_0x2a488e,_0x205081){return db['SquareReport'][_0x2de5('0x47')](_0x2a488e[_0x2de5('0x48')],{})[_0x2de5('0x24')](respondWithResult(_0x205081,0xc9))[_0x2de5('0x42')](handleError(_0x205081,null));};exports[_0x2de5('0x49')]=function(_0x4c27ca,_0x1e15f9){if(_0x4c27ca[_0x2de5('0x48')]['id']){delete _0x4c27ca[_0x2de5('0x48')]['id'];}return db[_0x2de5('0x3e')]['find']({'where':{'id':_0x4c27ca['params']['id']}})['then'](handleEntityNotFound(_0x1e15f9,null))['then'](saveUpdates(_0x4c27ca[_0x2de5('0x48')],null))[_0x2de5('0x24')](respondWithResult(_0x1e15f9,null))[_0x2de5('0x42')](handleError(_0x1e15f9,null));};exports['destroy']=function(_0x5e4df8,_0x1a1d8d){return db['SquareReport'][_0x2de5('0x46')]({'where':{'id':_0x5e4df8['params']['id']}})[_0x2de5('0x24')](handleEntityNotFound(_0x1a1d8d,null))[_0x2de5('0x24')](removeEntity(_0x1a1d8d,null))[_0x2de5('0x42')](handleError(_0x1a1d8d,null));};exports['describe']=function(_0xaa277a,_0x478eb1){return db[_0x2de5('0x3e')]['describe']()[_0x2de5('0x24')](respondWithResult(_0x478eb1,null))['catch'](handleError(_0x478eb1,null));};
\ No newline at end of file
+var _0x44f1=['model','query','keys','intersection','attributes','fields','nolimit','order','sort','where','filters','filter','merge','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','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','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','apply','reject','update','then','destroy','sendStatus','error','stack','name','index','map','SquareReport','rawAttributes','fieldName','type'];(function(_0x2c6bad,_0x29ffed){var _0x5f5435=function(_0x23f89b){while(--_0x23f89b){_0x2c6bad['push'](_0x2c6bad['shift']());}};_0x5f5435(++_0x29ffed);}(_0x44f1,0xad));var _0x144f=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0x44f1[_0x134c2e];return _0x2825db;};'use strict';var emlformat=require(_0x144f('0x0'));var rimraf=require(_0x144f('0x1'));var zipdir=require(_0x144f('0x2'));var jsonpatch=require(_0x144f('0x3'));var rp=require('request-promise');var moment=require(_0x144f('0x4'));var BPromise=require(_0x144f('0x5'));var Mustache=require(_0x144f('0x6'));var util=require(_0x144f('0x7'));var path=require(_0x144f('0x8'));var sox=require(_0x144f('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x144f('0xa'));var _=require(_0x144f('0xb'));var squel=require('squel');var crypto=require(_0x144f('0xc'));var jsforce=require(_0x144f('0xd'));var deskjs=require(_0x144f('0xe'));var toCsv=require(_0x144f('0xf'));var querystring=require(_0x144f('0x10'));var Papa=require(_0x144f('0x11'));var Redis=require(_0x144f('0x12'));var authService=require(_0x144f('0x13'));var qs=require(_0x144f('0x14'));var as=require(_0x144f('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x144f('0x16'))(_0x144f('0x17'));var utils=require(_0x144f('0x18'));var config=require(_0x144f('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x144f('0x1a'))['db'];function respondWithStatusCode(_0x2c3e84,_0x460df0){_0x460df0=_0x460df0||0xcc;return function(_0x2e520e){if(_0x2e520e){return _0x2c3e84['sendStatus'](_0x460df0);}return _0x2c3e84[_0x144f('0x1b')](_0x460df0)[_0x144f('0x1c')]();};}function respondWithResult(_0x414610,_0x28f93e){_0x28f93e=_0x28f93e||0xc8;return function(_0x374e65){if(_0x374e65){return _0x414610[_0x144f('0x1b')](_0x28f93e)[_0x144f('0x1d')](_0x374e65);}};}function respondWithFilteredResult(_0x4e2bb9,_0x30ac24){return function(_0x21b7d1){if(_0x21b7d1){var _0x4a3a2e=typeof _0x30ac24[_0x144f('0x1e')]===_0x144f('0x1f')&&typeof _0x30ac24[_0x144f('0x20')]==='undefined';var _0x1a96fc=_0x21b7d1[_0x144f('0x21')];var _0x31778e=_0x4a3a2e?0x0:_0x30ac24[_0x144f('0x1e')];var _0x535bdc=_0x4a3a2e?_0x21b7d1[_0x144f('0x21')]:_0x30ac24[_0x144f('0x1e')]+_0x30ac24[_0x144f('0x20')];var _0x1bc898;if(_0x535bdc>=_0x1a96fc){_0x535bdc=_0x1a96fc;_0x1bc898=0xc8;}else{_0x1bc898=0xce;}_0x4e2bb9[_0x144f('0x1b')](_0x1bc898);return _0x4e2bb9['set']('Content-Range',_0x31778e+'-'+_0x535bdc+'/'+_0x1a96fc)['json'](_0x21b7d1);}return null;};}function patchUpdates(_0x5215de){return function(_0x26537b){try{jsonpatch[_0x144f('0x22')](_0x26537b,_0x5215de,!![]);}catch(_0x2c17f1){return BPromise[_0x144f('0x23')](_0x2c17f1);}return _0x26537b['save']();};}function saveUpdates(_0x3f66d2,_0x242457){return function(_0x4a7d92){if(_0x4a7d92){return _0x4a7d92[_0x144f('0x24')](_0x3f66d2)[_0x144f('0x25')](function(_0x158834){return _0x158834;});}return null;};}function removeEntity(_0x5253bb,_0x4b8d47){return function(_0x43b041){if(_0x43b041){return _0x43b041[_0x144f('0x26')]()['then'](function(){_0x5253bb['status'](0xcc)[_0x144f('0x1c')]();});}};}function handleEntityNotFound(_0x5ad539,_0x1db110){return function(_0x23a09d){if(!_0x23a09d){_0x5ad539[_0x144f('0x27')](0x194);}return _0x23a09d;};}function handleError(_0x13c653,_0x4c3a7d){_0x4c3a7d=_0x4c3a7d||0x1f4;return function(_0x3c5d07){logger[_0x144f('0x28')](_0x3c5d07[_0x144f('0x29')]);if(_0x3c5d07[_0x144f('0x2a')]){delete _0x3c5d07['name'];}_0x13c653['status'](_0x4c3a7d)['send'](_0x3c5d07);};}exports[_0x144f('0x2b')]=function(_0x1e7e4e,_0x171f1a){var _0x2149b7={},_0x420232={},_0x51d4f9={'count':0x0,'rows':[]};var _0x3239e3=_[_0x144f('0x2c')](db[_0x144f('0x2d')][_0x144f('0x2e')],function(_0x326677){return{'name':_0x326677[_0x144f('0x2f')],'type':_0x326677[_0x144f('0x30')]['key']};});_0x420232[_0x144f('0x31')]=_[_0x144f('0x2c')](_0x3239e3,_0x144f('0x2a'));_0x420232[_0x144f('0x32')]=_[_0x144f('0x33')](_0x1e7e4e['query']);_0x420232['filters']=_[_0x144f('0x34')](_0x420232['model'],_0x420232[_0x144f('0x32')]);_0x2149b7[_0x144f('0x35')]=_[_0x144f('0x34')](_0x420232[_0x144f('0x31')],qs[_0x144f('0x36')](_0x1e7e4e[_0x144f('0x32')][_0x144f('0x36')]));_0x2149b7[_0x144f('0x35')]=_0x2149b7[_0x144f('0x35')]['length']?_0x2149b7[_0x144f('0x35')]:_0x420232[_0x144f('0x31')];if(!_0x1e7e4e['query']['hasOwnProperty'](_0x144f('0x37'))){_0x2149b7['limit']=qs[_0x144f('0x20')](_0x1e7e4e[_0x144f('0x32')]['limit']);_0x2149b7['offset']=qs['offset'](_0x1e7e4e['query']['offset']);}_0x2149b7[_0x144f('0x38')]=qs[_0x144f('0x39')](_0x1e7e4e[_0x144f('0x32')][_0x144f('0x39')]);_0x2149b7[_0x144f('0x3a')]=qs[_0x144f('0x3b')](_['pick'](_0x1e7e4e[_0x144f('0x32')],_0x420232[_0x144f('0x3b')]),_0x3239e3);if(_0x1e7e4e[_0x144f('0x32')][_0x144f('0x3c')]){_0x2149b7[_0x144f('0x3a')]=_[_0x144f('0x3d')](_0x2149b7[_0x144f('0x3a')],{'$or':_['map'](_0x3239e3,function(_0x3e41dd){if(_0x3e41dd[_0x144f('0x30')]!=='VIRTUAL'){var _0x1a20c1={};_0x1a20c1[_0x3e41dd[_0x144f('0x2a')]]={'$like':'%'+_0x1e7e4e[_0x144f('0x32')]['filter']+'%'};return _0x1a20c1;}})});}_0x2149b7=_[_0x144f('0x3d')]({},_0x2149b7,_0x1e7e4e['options']);var _0x5e3076={'where':_0x2149b7[_0x144f('0x3a')]};return db['SquareReport'][_0x144f('0x21')](_0x5e3076)[_0x144f('0x25')](function(_0x33bb4e){_0x51d4f9[_0x144f('0x21')]=_0x33bb4e;if(_0x1e7e4e['query'][_0x144f('0x3e')]){_0x2149b7[_0x144f('0x3f')]=[{'all':!![]}];}return db[_0x144f('0x2d')][_0x144f('0x40')](_0x2149b7);})[_0x144f('0x25')](function(_0x378c0e){_0x51d4f9[_0x144f('0x41')]=_0x378c0e;return _0x51d4f9;})[_0x144f('0x25')](respondWithFilteredResult(_0x171f1a,_0x2149b7))[_0x144f('0x42')](handleError(_0x171f1a,null));};exports[_0x144f('0x43')]=function(_0x3e2440,_0x3e64be){var _0x5c127a={'raw':!![],'where':{'id':_0x3e2440[_0x144f('0x44')]['id']}},_0x46bd50={};_0x46bd50[_0x144f('0x31')]=_['keys'](db[_0x144f('0x2d')][_0x144f('0x2e')]);_0x46bd50[_0x144f('0x32')]=_[_0x144f('0x33')](_0x3e2440[_0x144f('0x32')]);_0x46bd50[_0x144f('0x3b')]=_[_0x144f('0x34')](_0x46bd50[_0x144f('0x31')],_0x46bd50['query']);_0x5c127a[_0x144f('0x35')]=_[_0x144f('0x34')](_0x46bd50[_0x144f('0x31')],qs[_0x144f('0x36')](_0x3e2440[_0x144f('0x32')][_0x144f('0x36')]));_0x5c127a[_0x144f('0x35')]=_0x5c127a[_0x144f('0x35')]['length']?_0x5c127a['attributes']:_0x46bd50[_0x144f('0x31')];if(_0x3e2440[_0x144f('0x32')][_0x144f('0x3e')]){_0x5c127a['include']=[{'all':!![]}];}_0x5c127a=_[_0x144f('0x3d')]({},_0x5c127a,_0x3e2440[_0x144f('0x45')]);return db[_0x144f('0x2d')][_0x144f('0x46')](_0x5c127a)['then'](handleEntityNotFound(_0x3e64be,null))['then'](respondWithResult(_0x3e64be,null))[_0x144f('0x42')](handleError(_0x3e64be,null));};exports[_0x144f('0x47')]=function(_0x1f0258,_0x1e23b5){return db['SquareReport'][_0x144f('0x47')](_0x1f0258[_0x144f('0x48')],{})[_0x144f('0x25')](respondWithResult(_0x1e23b5,0xc9))['catch'](handleError(_0x1e23b5,null));};exports[_0x144f('0x24')]=function(_0x4a09e9,_0x15480a){if(_0x4a09e9[_0x144f('0x48')]['id']){delete _0x4a09e9[_0x144f('0x48')]['id'];}return db['SquareReport'][_0x144f('0x46')]({'where':{'id':_0x4a09e9[_0x144f('0x44')]['id']}})[_0x144f('0x25')](handleEntityNotFound(_0x15480a,null))[_0x144f('0x25')](saveUpdates(_0x4a09e9[_0x144f('0x48')],null))[_0x144f('0x25')](respondWithResult(_0x15480a,null))[_0x144f('0x42')](handleError(_0x15480a,null));};exports[_0x144f('0x26')]=function(_0x42c2a5,_0x3878fb){return db[_0x144f('0x2d')][_0x144f('0x46')]({'where':{'id':_0x42c2a5[_0x144f('0x44')]['id']}})[_0x144f('0x25')](handleEntityNotFound(_0x3878fb,null))[_0x144f('0x25')](removeEntity(_0x3878fb,null))[_0x144f('0x42')](handleError(_0x3878fb,null));};exports[_0x144f('0x49')]=function(_0x5884dc,_0x1cf4a9){return db[_0x144f('0x2d')][_0x144f('0x49')]()[_0x144f('0x25')](respondWithResult(_0x1cf4a9,null))[_0x144f('0x42')](handleError(_0x1cf4a9,null));};
\ No newline at end of file
index 8ac4e97..9a3f1e0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdd05=['../../config/environment','./squareReport.attributes','exports','SquareReport','report_square','uid_pname','project_name','leaveAt','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x16f295,_0x6f189b){var _0x505d8b=function(_0x14efc7){while(--_0x14efc7){_0x16f295['push'](_0x16f295['shift']());}};_0x505d8b(++_0x6f189b);}(_0xdd05,0xcb));var _0x5dd0=function(_0x4654d5,_0x55fdf3){_0x4654d5=_0x4654d5-0x0;var _0x2da3f9=_0xdd05[_0x4654d5];return _0x2da3f9;};'use strict';var _=require(_0x5dd0('0x0'));var util=require('util');var logger=require(_0x5dd0('0x1'))(_0x5dd0('0x2'));var moment=require(_0x5dd0('0x3'));var BPromise=require(_0x5dd0('0x4'));var rp=require(_0x5dd0('0x5'));var fs=require('fs');var path=require(_0x5dd0('0x6'));var rimraf=require('rimraf');var config=require(_0x5dd0('0x7'));var attributes=require(_0x5dd0('0x8'));module[_0x5dd0('0x9')]=function(_0x5e58f0,_0x36a2c4){return _0x5e58f0['define'](_0x5dd0('0xa'),attributes,{'tableName':_0x5dd0('0xb'),'paranoid':![],'indexes':[{'name':_0x5dd0('0xc'),'fields':['uniqueid',_0x5dd0('0xd')]},{'name':_0x5dd0('0xe'),'fields':[_0x5dd0('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xa0d0=['bluebird','request-promise','path','rimraf','exports','report_square','uid_pname','uniqueid','project_name','leaveAt','lodash','util','../../config/logger'];(function(_0x5a7618,_0x3f44c2){var _0x12dc65=function(_0x3cc4cd){while(--_0x3cc4cd){_0x5a7618['push'](_0x5a7618['shift']());}};_0x12dc65(++_0x3f44c2);}(_0xa0d0,0x101));var _0x0a0d=function(_0x2b5eae,_0x55010d){_0x2b5eae=_0x2b5eae-0x0;var _0x5f3ac9=_0xa0d0[_0x2b5eae];return _0x5f3ac9;};'use strict';var _=require(_0x0a0d('0x0'));var util=require(_0x0a0d('0x1'));var logger=require(_0x0a0d('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a0d('0x3'));var rp=require(_0x0a0d('0x4'));var fs=require('fs');var path=require(_0x0a0d('0x5'));var rimraf=require(_0x0a0d('0x6'));var config=require('../../config/environment');var attributes=require('./squareReport.attributes');module[_0x0a0d('0x7')]=function(_0xfce88e,_0x2037cb){return _0xfce88e['define']('SquareReport',attributes,{'tableName':_0x0a0d('0x8'),'paranoid':![],'indexes':[{'name':_0x0a0d('0x9'),'fields':[_0x0a0d('0xa'),_0x0a0d('0xb')]},{'name':_0x0a0d('0xc'),'fields':[_0x0a0d('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
index 7d1da44..71ad9c4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe1f8=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','SquareReport,\x20%s,\x20%s','message','result','catch','SquareReport','create','options','raw','CreateSquareReport','where','limit','UpdateSquareReport','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x8f08f4,_0x138c4a){var _0x3b1f4f=function(_0x55a5f4){while(--_0x55a5f4){_0x8f08f4['push'](_0x8f08f4['shift']());}};_0x3b1f4f(++_0x138c4a);}(_0xe1f8,0x9a));var _0x8e1f=function(_0x4eb5eb,_0x25c1ba){_0x4eb5eb=_0x4eb5eb-0x0;var _0x30d401=_0xe1f8[_0x4eb5eb];return _0x30d401;};'use strict';var _=require(_0x8e1f('0x0'));var util=require(_0x8e1f('0x1'));var moment=require(_0x8e1f('0x2'));var BPromise=require(_0x8e1f('0x3'));var rs=require(_0x8e1f('0x4'));var fs=require('fs');var Redis=require(_0x8e1f('0x5'));var db=require(_0x8e1f('0x6'))['db'];var utils=require(_0x8e1f('0x7'));var logger=require(_0x8e1f('0x8'))(_0x8e1f('0x9'));var config=require('../../config/environment');var jayson=require(_0x8e1f('0xa'));var client=jayson[_0x8e1f('0xb')][_0x8e1f('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xc13a79,_0x2f9060,_0x5ad323){return new BPromise(function(_0x54d7e1,_0x4e2140){return client[_0x8e1f('0xd')](_0xc13a79,_0x5ad323)[_0x8e1f('0xe')](function(_0x47965a){logger[_0x8e1f('0xf')]('SquareReport,\x20%s,\x20%s',_0x2f9060,_0x8e1f('0x10'));logger[_0x8e1f('0x11')]('SquareReport,\x20%s,\x20%s,\x20%s',_0x2f9060,_0x8e1f('0x10'),JSON[_0x8e1f('0x12')](_0x47965a));if(_0x47965a[_0x8e1f('0x13')]){if(_0x47965a[_0x8e1f('0x13')]['code']===0x1f4){logger[_0x8e1f('0x13')](_0x8e1f('0x14'),_0x2f9060,_0x47965a[_0x8e1f('0x13')][_0x8e1f('0x15')]);return _0x4e2140(_0x47965a[_0x8e1f('0x13')]['message']);}logger[_0x8e1f('0x13')](_0x8e1f('0x14'),_0x2f9060,_0x47965a[_0x8e1f('0x13')][_0x8e1f('0x15')]);return _0x54d7e1(_0x47965a[_0x8e1f('0x13')][_0x8e1f('0x15')]);}else{logger[_0x8e1f('0xf')](_0x8e1f('0x14'),_0x2f9060,'request\x20sent');_0x54d7e1(_0x47965a[_0x8e1f('0x16')][_0x8e1f('0x15')]);}})[_0x8e1f('0x17')](function(_0x27e5f5){logger[_0x8e1f('0x13')]('SquareReport,\x20%s,\x20%s',_0x2f9060,_0x27e5f5);_0x4e2140(_0x27e5f5);});});}exports['CreateSquareReport']=function(_0x1fdb4d){var _0x4ce7a4=this;return new Promise(function(_0x1787eb,_0x171a04){return db[_0x8e1f('0x18')][_0x8e1f('0x19')](_0x1fdb4d['body'],{'raw':_0x1fdb4d['options']?_0x1fdb4d[_0x8e1f('0x1a')][_0x8e1f('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x42dd8b){logger['info'](_0x8e1f('0x1c'),_0x1fdb4d);logger[_0x8e1f('0x11')]('CreateSquareReport',_0x1fdb4d,JSON[_0x8e1f('0x12')](_0x42dd8b));_0x1787eb(_0x42dd8b);})[_0x8e1f('0x17')](function(_0x41ba15){logger[_0x8e1f('0x13')](_0x8e1f('0x1c'),_0x41ba15[_0x8e1f('0x15')],_0x1fdb4d);_0x171a04(_0x4ce7a4[_0x8e1f('0x13')](0x1f4,_0x41ba15[_0x8e1f('0x15')]));});});};exports['UpdateSquareReport']=function(_0x56460b){var _0x493d17=this;return new Promise(function(_0x1e7ee5,_0x595cea){return db[_0x8e1f('0x18')]['update'](_0x56460b['body'],{'raw':_0x56460b['options']?_0x56460b[_0x8e1f('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x56460b[_0x8e1f('0x1a')]?_0x56460b['options'][_0x8e1f('0x1d')]||null:null,'attributes':_0x56460b[_0x8e1f('0x1a')]?_0x56460b[_0x8e1f('0x1a')]['attributes']||null:null,'limit':_0x56460b[_0x8e1f('0x1a')]?_0x56460b['options'][_0x8e1f('0x1e')]||null:null})[_0x8e1f('0xe')](function(_0x114462){logger['info'](_0x8e1f('0x1f'),_0x56460b);logger[_0x8e1f('0x11')](_0x8e1f('0x1f'),_0x56460b,JSON['stringify'](_0x114462));_0x1e7ee5(_0x114462);})[_0x8e1f('0x17')](function(_0x51fd67){logger['error'](_0x8e1f('0x1f'),_0x51fd67[_0x8e1f('0x15')],_0x56460b);_0x595cea(_0x493d17[_0x8e1f('0x13')](0x1f4,_0x51fd67[_0x8e1f('0x15')]));});});};
\ No newline at end of file
+var _0x5b8b=['update','raw','where','attributes','limit','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','SquareReport,\x20%s,\x20%s','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','CreateSquareReport','SquareReport','body','options','stringify','UpdateSquareReport'];(function(_0x5cc10c,_0x224f4b){var _0x40435a=function(_0x59f555){while(--_0x59f555){_0x5cc10c['push'](_0x5cc10c['shift']());}};_0x40435a(++_0x224f4b);}(_0x5b8b,0x68));var _0xb5b8=function(_0x10273d,_0x198ac3){_0x10273d=_0x10273d-0x0;var _0x55a02e=_0x5b8b[_0x10273d];return _0x55a02e;};'use strict';var _=require('lodash');var util=require(_0xb5b8('0x0'));var moment=require(_0xb5b8('0x1'));var BPromise=require(_0xb5b8('0x2'));var rs=require(_0xb5b8('0x3'));var fs=require('fs');var Redis=require(_0xb5b8('0x4'));var db=require(_0xb5b8('0x5'))['db'];var utils=require(_0xb5b8('0x6'));var logger=require(_0xb5b8('0x7'))('rpc');var config=require(_0xb5b8('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xb5b8('0x9')][_0xb5b8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x19b59b,_0x361072,_0xca7e33){return new BPromise(function(_0x15d8b8,_0x3b5478){return client[_0xb5b8('0xb')](_0x19b59b,_0xca7e33)[_0xb5b8('0xc')](function(_0x2f12e9){logger[_0xb5b8('0xd')](_0xb5b8('0xe'),_0x361072,_0xb5b8('0xf'));logger[_0xb5b8('0x10')](_0xb5b8('0x11'),_0x361072,_0xb5b8('0xf'),JSON['stringify'](_0x2f12e9));if(_0x2f12e9[_0xb5b8('0x12')]){if(_0x2f12e9[_0xb5b8('0x12')][_0xb5b8('0x13')]===0x1f4){logger[_0xb5b8('0x12')](_0xb5b8('0xe'),_0x361072,_0x2f12e9[_0xb5b8('0x12')][_0xb5b8('0x14')]);return _0x3b5478(_0x2f12e9[_0xb5b8('0x12')][_0xb5b8('0x14')]);}logger[_0xb5b8('0x12')](_0xb5b8('0xe'),_0x361072,_0x2f12e9[_0xb5b8('0x12')][_0xb5b8('0x14')]);return _0x15d8b8(_0x2f12e9[_0xb5b8('0x12')][_0xb5b8('0x14')]);}else{logger[_0xb5b8('0xd')](_0xb5b8('0xe'),_0x361072,_0xb5b8('0xf'));_0x15d8b8(_0x2f12e9['result'][_0xb5b8('0x14')]);}})[_0xb5b8('0x15')](function(_0x445991){logger[_0xb5b8('0x12')]('SquareReport,\x20%s,\x20%s',_0x361072,_0x445991);_0x3b5478(_0x445991);});});}exports[_0xb5b8('0x16')]=function(_0x444157){var _0x4a6c6a=this;return new Promise(function(_0x22ce4b,_0x44941b){return db[_0xb5b8('0x17')]['create'](_0x444157[_0xb5b8('0x18')],{'raw':_0x444157[_0xb5b8('0x19')]?_0x444157['options']['raw']===undefined?!![]:![]:!![]})[_0xb5b8('0xc')](function(_0x372af2){logger[_0xb5b8('0xd')](_0xb5b8('0x16'),_0x444157);logger['debug'](_0xb5b8('0x16'),_0x444157,JSON[_0xb5b8('0x1a')](_0x372af2));_0x22ce4b(_0x372af2);})[_0xb5b8('0x15')](function(_0x466130){logger[_0xb5b8('0x12')](_0xb5b8('0x16'),_0x466130['message'],_0x444157);_0x44941b(_0x4a6c6a['error'](0x1f4,_0x466130['message']));});});};exports[_0xb5b8('0x1b')]=function(_0x36e747){var _0x49d153=this;return new Promise(function(_0x201417,_0x28abd8){return db[_0xb5b8('0x17')][_0xb5b8('0x1c')](_0x36e747[_0xb5b8('0x18')],{'raw':_0x36e747[_0xb5b8('0x19')]?_0x36e747[_0xb5b8('0x19')][_0xb5b8('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x36e747['options']?_0x36e747[_0xb5b8('0x19')][_0xb5b8('0x1e')]||null:null,'attributes':_0x36e747[_0xb5b8('0x19')]?_0x36e747[_0xb5b8('0x19')][_0xb5b8('0x1f')]||null:null,'limit':_0x36e747[_0xb5b8('0x19')]?_0x36e747['options'][_0xb5b8('0x20')]||null:null})['then'](function(_0x18462e){logger[_0xb5b8('0xd')]('UpdateSquareReport',_0x36e747);logger[_0xb5b8('0x10')](_0xb5b8('0x1b'),_0x36e747,JSON[_0xb5b8('0x1a')](_0x18462e));_0x201417(_0x18462e);})[_0xb5b8('0x15')](function(_0x5cd4a2){logger[_0xb5b8('0x12')](_0xb5b8('0x1b'),_0x5cd4a2[_0xb5b8('0x14')],_0x36e747);_0x28abd8(_0x49d153[_0xb5b8('0x12')](0x1f4,_0x5cd4a2[_0xb5b8('0x14')]));});});};
\ No newline at end of file
index d12a08f..3b7e037 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe4c1=['get','describe','/:id','show','post','create','put','update','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./squareReportDetail.controller','isAuthenticated'];(function(_0x58cede,_0x2081bf){var _0x41c297=function(_0x4904e7){while(--_0x4904e7){_0x58cede['push'](_0x58cede['shift']());}};_0x41c297(++_0x2081bf);}(_0xe4c1,0xee));var _0x1e4c=function(_0x29d915,_0x54a040){_0x29d915=_0x29d915-0x0;var _0x160f86=_0xe4c1[_0x29d915];return _0x160f86;};'use strict';var multer=require('multer');var util=require(_0x1e4c('0x0'));var path=require(_0x1e4c('0x1'));var timeout=require(_0x1e4c('0x2'));var express=require('express');var router=express[_0x1e4c('0x3')]();var fs_extra=require(_0x1e4c('0x4'));var auth=require(_0x1e4c('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x1e4c('0x6'));var controller=require(_0x1e4c('0x7'));router['get']('/',auth[_0x1e4c('0x8')](),controller['index']);router[_0x1e4c('0x9')]('/describe',auth['isAuthenticated'](),controller[_0x1e4c('0xa')]);router[_0x1e4c('0x9')](_0x1e4c('0xb'),auth[_0x1e4c('0x8')](),controller[_0x1e4c('0xc')]);router[_0x1e4c('0xd')]('/',auth['isAuthenticated'](),controller[_0x1e4c('0xe')]);router[_0x1e4c('0xf')](_0x1e4c('0xb'),auth['isAuthenticated'](),controller[_0x1e4c('0x10')]);router['delete'](_0x1e4c('0xb'),auth[_0x1e4c('0x8')](),controller[_0x1e4c('0x11')]);module[_0x1e4c('0x12')]=router;
\ No newline at end of file
+var _0x3998=['../../components/interaction/service','../../config/environment','./squareReportDetail.controller','get','isAuthenticated','/describe','describe','/:id','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x56cc32,_0x157b90){var _0x4195ac=function(_0x264f9b){while(--_0x264f9b){_0x56cc32['push'](_0x56cc32['shift']());}};_0x4195ac(++_0x157b90);}(_0x3998,0x1c8));var _0x8399=function(_0x15c3d8,_0x26be09){_0x15c3d8=_0x15c3d8-0x0;var _0x46a944=_0x3998[_0x15c3d8];return _0x46a944;};'use strict';var multer=require(_0x8399('0x0'));var util=require('util');var path=require(_0x8399('0x1'));var timeout=require(_0x8399('0x2'));var express=require(_0x8399('0x3'));var router=express[_0x8399('0x4')]();var fs_extra=require(_0x8399('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x8399('0x6'));var config=require(_0x8399('0x7'));var controller=require(_0x8399('0x8'));router[_0x8399('0x9')]('/',auth[_0x8399('0xa')](),controller['index']);router['get'](_0x8399('0xb'),auth[_0x8399('0xa')](),controller[_0x8399('0xc')]);router[_0x8399('0x9')](_0x8399('0xd'),auth[_0x8399('0xa')](),controller['show']);router[_0x8399('0xe')]('/',auth['isAuthenticated'](),controller[_0x8399('0xf')]);router[_0x8399('0x10')]('/:id',auth[_0x8399('0xa')](),controller[_0x8399('0x11')]);router[_0x8399('0x12')](_0x8399('0xd'),auth[_0x8399('0xa')](),controller[_0x8399('0x13')]);module[_0x8399('0x14')]=router;
\ No newline at end of file
index 80d6e02..b1f5f32 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfff0=['TEXT','sequelize','exports','STRING'];(function(_0x2091c2,_0x3b565c){var _0xed8f06=function(_0x4b6f84){while(--_0x4b6f84){_0x2091c2['push'](_0x2091c2['shift']());}};_0xed8f06(++_0x3b565c);}(_0xfff0,0x1d9));var _0x0fff=function(_0x30594a,_0x3048ff){_0x30594a=_0x30594a-0x0;var _0x597829=_0xfff0[_0x30594a];return _0x597829;};'use strict';var Sequelize=require(_0x0fff('0x0'));module[_0x0fff('0x1')]={'uniqueid':{'type':Sequelize[_0x0fff('0x2')]},'node':{'type':Sequelize[_0x0fff('0x2')]},'application':{'type':Sequelize[_0x0fff('0x2')]},'data':{'type':Sequelize[_0x0fff('0x3')]},'project_name':{'type':Sequelize[_0x0fff('0x2')]},'callerid':{'type':Sequelize[_0x0fff('0x2')]}};
\ No newline at end of file
+var _0x25a9=['TEXT','sequelize','exports','STRING'];(function(_0x40015a,_0x415db5){var _0x42f8a4=function(_0x5685ad){while(--_0x5685ad){_0x40015a['push'](_0x40015a['shift']());}};_0x42f8a4(++_0x415db5);}(_0x25a9,0x1ed));var _0x925a=function(_0x272e18,_0x75e43c){_0x272e18=_0x272e18-0x0;var _0x572ca9=_0x25a9[_0x272e18];return _0x572ca9;};'use strict';var Sequelize=require(_0x925a('0x0'));module[_0x925a('0x1')]={'uniqueid':{'type':Sequelize[_0x925a('0x2')]},'node':{'type':Sequelize[_0x925a('0x2')]},'application':{'type':Sequelize['STRING']},'data':{'type':Sequelize[_0x925a('0x3')]},'project_name':{'type':Sequelize[_0x925a('0x2')]},'callerid':{'type':Sequelize[_0x925a('0x2')]}};
\ No newline at end of file
index c95f041..b496e70 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x11e9=['rows','catch','params','keys','fields','includeAll','find','create','body','update','describe','rimraf','fast-json-patch','moment','bluebird','mustache','to-csv','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','then','destroy','error','stack','name','send','index','map','SquareDetailsReport','rawAttributes','type','key','model','query','intersection','attributes','length','nolimit','order','sort','where','filters','pick','filter','merge','options','include','findAll'];(function(_0x578275,_0xe7ae46){var _0xf78041=function(_0x13148c){while(--_0x13148c){_0x578275['push'](_0x578275['shift']());}};_0xf78041(++_0xe7ae46);}(_0x11e9,0x169));var _0x911e=function(_0x40f6fb,_0x472e4c){_0x40f6fb=_0x40f6fb-0x0;var _0x30a94a=_0x11e9[_0x40f6fb];return _0x30a94a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x911e('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x911e('0x1'));var rp=require('request-promise');var moment=require(_0x911e('0x2'));var BPromise=require(_0x911e('0x3'));var Mustache=require(_0x911e('0x4'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x911e('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x911e('0x6'));var _=require('lodash');var squel=require(_0x911e('0x7'));var crypto=require('crypto');var jsforce=require(_0x911e('0x8'));var deskjs=require(_0x911e('0x9'));var toCsv=require(_0x911e('0x5'));var querystring=require(_0x911e('0xa'));var Papa=require(_0x911e('0xb'));var Redis=require(_0x911e('0xc'));var authService=require(_0x911e('0xd'));var qs=require(_0x911e('0xe'));var as=require(_0x911e('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x911e('0x10'))(_0x911e('0x11'));var utils=require('../../config/utils');var config=require(_0x911e('0x12'));var licenseUtil=require(_0x911e('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x34b81b,_0x5c8354){_0x5c8354=_0x5c8354||0xcc;return function(_0x4696db){if(_0x4696db){return _0x34b81b[_0x911e('0x14')](_0x5c8354);}return _0x34b81b['status'](_0x5c8354)[_0x911e('0x15')]();};}function respondWithResult(_0x25ba34,_0x376b26){_0x376b26=_0x376b26||0xc8;return function(_0x802e4d){if(_0x802e4d){return _0x25ba34['status'](_0x376b26)[_0x911e('0x16')](_0x802e4d);}};}function respondWithFilteredResult(_0x2e4fa2,_0x3dd538){return function(_0x4b3bbf){if(_0x4b3bbf){var _0x581cee=typeof _0x3dd538[_0x911e('0x17')]===_0x911e('0x18')&&typeof _0x3dd538[_0x911e('0x19')]===_0x911e('0x18');var _0x5c36dc=_0x4b3bbf[_0x911e('0x1a')];var _0x305ca9=_0x581cee?0x0:_0x3dd538[_0x911e('0x17')];var _0x11e9d0=_0x581cee?_0x4b3bbf[_0x911e('0x1a')]:_0x3dd538['offset']+_0x3dd538[_0x911e('0x19')];var _0x1eeb3d;if(_0x11e9d0>=_0x5c36dc){_0x11e9d0=_0x5c36dc;_0x1eeb3d=0xc8;}else{_0x1eeb3d=0xce;}_0x2e4fa2[_0x911e('0x1b')](_0x1eeb3d);return _0x2e4fa2[_0x911e('0x1c')](_0x911e('0x1d'),_0x305ca9+'-'+_0x11e9d0+'/'+_0x5c36dc)[_0x911e('0x16')](_0x4b3bbf);}return null;};}function patchUpdates(_0x761cdc){return function(_0x255665){try{jsonpatch[_0x911e('0x1e')](_0x255665,_0x761cdc,!![]);}catch(_0x3944e0){return BPromise['reject'](_0x3944e0);}return _0x255665['save']();};}function saveUpdates(_0xa12635,_0x2da93f){return function(_0x4fc00b){if(_0x4fc00b){return _0x4fc00b['update'](_0xa12635)[_0x911e('0x1f')](function(_0x476d17){return _0x476d17;});}return null;};}function removeEntity(_0x9ca3e6,_0x5bd49f){return function(_0x59e5da){if(_0x59e5da){return _0x59e5da[_0x911e('0x20')]()[_0x911e('0x1f')](function(){_0x9ca3e6[_0x911e('0x1b')](0xcc)[_0x911e('0x15')]();});}};}function handleEntityNotFound(_0x2a7d77,_0x1a0294){return function(_0x9ecbbd){if(!_0x9ecbbd){_0x2a7d77['sendStatus'](0x194);}return _0x9ecbbd;};}function handleError(_0x4917d7,_0x4bfaaf){_0x4bfaaf=_0x4bfaaf||0x1f4;return function(_0x52e5db){logger[_0x911e('0x21')](_0x52e5db[_0x911e('0x22')]);if(_0x52e5db[_0x911e('0x23')]){delete _0x52e5db['name'];}_0x4917d7[_0x911e('0x1b')](_0x4bfaaf)[_0x911e('0x24')](_0x52e5db);};}exports[_0x911e('0x25')]=function(_0x1efafd,_0x5dac8c){var _0x20d4a4={},_0x2539db={},_0x5655a8={'count':0x0,'rows':[]};var _0x3f29f2=_[_0x911e('0x26')](db[_0x911e('0x27')][_0x911e('0x28')],function(_0x1f5a39){return{'name':_0x1f5a39['fieldName'],'type':_0x1f5a39[_0x911e('0x29')][_0x911e('0x2a')]};});_0x2539db[_0x911e('0x2b')]=_[_0x911e('0x26')](_0x3f29f2,'name');_0x2539db[_0x911e('0x2c')]=_['keys'](_0x1efafd[_0x911e('0x2c')]);_0x2539db['filters']=_[_0x911e('0x2d')](_0x2539db[_0x911e('0x2b')],_0x2539db[_0x911e('0x2c')]);_0x20d4a4[_0x911e('0x2e')]=_[_0x911e('0x2d')](_0x2539db[_0x911e('0x2b')],qs['fields'](_0x1efafd[_0x911e('0x2c')]['fields']));_0x20d4a4[_0x911e('0x2e')]=_0x20d4a4[_0x911e('0x2e')][_0x911e('0x2f')]?_0x20d4a4[_0x911e('0x2e')]:_0x2539db[_0x911e('0x2b')];if(!_0x1efafd[_0x911e('0x2c')]['hasOwnProperty'](_0x911e('0x30'))){_0x20d4a4[_0x911e('0x19')]=qs['limit'](_0x1efafd[_0x911e('0x2c')][_0x911e('0x19')]);_0x20d4a4['offset']=qs['offset'](_0x1efafd[_0x911e('0x2c')][_0x911e('0x17')]);}_0x20d4a4[_0x911e('0x31')]=qs[_0x911e('0x32')](_0x1efafd[_0x911e('0x2c')][_0x911e('0x32')]);_0x20d4a4[_0x911e('0x33')]=qs[_0x911e('0x34')](_[_0x911e('0x35')](_0x1efafd[_0x911e('0x2c')],_0x2539db[_0x911e('0x34')]),_0x3f29f2);if(_0x1efafd['query'][_0x911e('0x36')]){_0x20d4a4[_0x911e('0x33')]=_[_0x911e('0x37')](_0x20d4a4[_0x911e('0x33')],{'$or':_[_0x911e('0x26')](_0x3f29f2,function(_0x635c1a){if(_0x635c1a[_0x911e('0x29')]!=='VIRTUAL'){var _0x327c5e={};_0x327c5e[_0x635c1a[_0x911e('0x23')]]={'$like':'%'+_0x1efafd['query'][_0x911e('0x36')]+'%'};return _0x327c5e;}})});}_0x20d4a4=_[_0x911e('0x37')]({},_0x20d4a4,_0x1efafd[_0x911e('0x38')]);var _0x50da75={'where':_0x20d4a4[_0x911e('0x33')]};return db['SquareDetailsReport'][_0x911e('0x1a')](_0x50da75)['then'](function(_0x3478bc){_0x5655a8['count']=_0x3478bc;if(_0x1efafd[_0x911e('0x2c')]['includeAll']){_0x20d4a4[_0x911e('0x39')]=[{'all':!![]}];}return db['SquareDetailsReport'][_0x911e('0x3a')](_0x20d4a4);})[_0x911e('0x1f')](function(_0x1067ac){_0x5655a8[_0x911e('0x3b')]=_0x1067ac;return _0x5655a8;})['then'](respondWithFilteredResult(_0x5dac8c,_0x20d4a4))[_0x911e('0x3c')](handleError(_0x5dac8c,null));};exports['show']=function(_0xd108bf,_0x5d106a){var _0x32ac49={'raw':!![],'where':{'id':_0xd108bf[_0x911e('0x3d')]['id']}},_0x15edef={};_0x15edef[_0x911e('0x2b')]=_[_0x911e('0x3e')](db[_0x911e('0x27')][_0x911e('0x28')]);_0x15edef[_0x911e('0x2c')]=_[_0x911e('0x3e')](_0xd108bf['query']);_0x15edef[_0x911e('0x34')]=_[_0x911e('0x2d')](_0x15edef[_0x911e('0x2b')],_0x15edef[_0x911e('0x2c')]);_0x32ac49[_0x911e('0x2e')]=_[_0x911e('0x2d')](_0x15edef[_0x911e('0x2b')],qs[_0x911e('0x3f')](_0xd108bf['query'][_0x911e('0x3f')]));_0x32ac49['attributes']=_0x32ac49[_0x911e('0x2e')][_0x911e('0x2f')]?_0x32ac49[_0x911e('0x2e')]:_0x15edef['model'];if(_0xd108bf[_0x911e('0x2c')][_0x911e('0x40')]){_0x32ac49[_0x911e('0x39')]=[{'all':!![]}];}_0x32ac49=_['merge']({},_0x32ac49,_0xd108bf[_0x911e('0x38')]);return db[_0x911e('0x27')][_0x911e('0x41')](_0x32ac49)[_0x911e('0x1f')](handleEntityNotFound(_0x5d106a,null))[_0x911e('0x1f')](respondWithResult(_0x5d106a,null))[_0x911e('0x3c')](handleError(_0x5d106a,null));};exports[_0x911e('0x42')]=function(_0x293d57,_0x2b20da){return db[_0x911e('0x27')][_0x911e('0x42')](_0x293d57[_0x911e('0x43')],{})['then'](respondWithResult(_0x2b20da,0xc9))[_0x911e('0x3c')](handleError(_0x2b20da,null));};exports[_0x911e('0x44')]=function(_0x10a1a9,_0xa1f615){if(_0x10a1a9[_0x911e('0x43')]['id']){delete _0x10a1a9['body']['id'];}return db['SquareDetailsReport'][_0x911e('0x41')]({'where':{'id':_0x10a1a9[_0x911e('0x3d')]['id']}})['then'](handleEntityNotFound(_0xa1f615,null))['then'](saveUpdates(_0x10a1a9[_0x911e('0x43')],null))[_0x911e('0x1f')](respondWithResult(_0xa1f615,null))[_0x911e('0x3c')](handleError(_0xa1f615,null));};exports[_0x911e('0x20')]=function(_0x26208a,_0x380ad6){return db[_0x911e('0x27')][_0x911e('0x41')]({'where':{'id':_0x26208a[_0x911e('0x3d')]['id']}})[_0x911e('0x1f')](handleEntityNotFound(_0x380ad6,null))[_0x911e('0x1f')](removeEntity(_0x380ad6,null))[_0x911e('0x3c')](handleError(_0x380ad6,null));};exports[_0x911e('0x45')]=function(_0x6c818,_0x27d36f){return db['SquareDetailsReport']['describe']()[_0x911e('0x1f')](respondWithResult(_0x27d36f,null))[_0x911e('0x3c')](handleError(_0x27d36f,null));};
\ No newline at end of file
+var _0xcf7c=['offset','undefined','count','limit','set','apply','reject','update','destroy','then','end','sendStatus','error','name','send','index','map','SquareDetailsReport','rawAttributes','fieldName','key','model','keys','filters','intersection','attributes','fields','query','order','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','body','describe','zip-dir','fast-json-patch','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','json'];(function(_0x2ebbeb,_0x549d7a){var _0x1bced8=function(_0x33a8e3){while(--_0x33a8e3){_0x2ebbeb['push'](_0x2ebbeb['shift']());}};_0x1bced8(++_0x549d7a);}(_0xcf7c,0x151));var _0xccf7=function(_0x4fbde2,_0x364951){_0x4fbde2=_0x4fbde2-0x0;var _0x2bce29=_0xcf7c[_0x4fbde2];return _0x2bce29;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xccf7('0x0'));var jsonpatch=require(_0xccf7('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xccf7('0x2'));var Mustache=require(_0xccf7('0x3'));var util=require(_0xccf7('0x4'));var path=require('path');var sox=require(_0xccf7('0x5'));var csv=require(_0xccf7('0x6'));var ejs=require(_0xccf7('0x7'));var fs=require('fs');var fs_extra=require(_0xccf7('0x8'));var _=require(_0xccf7('0x9'));var squel=require(_0xccf7('0xa'));var crypto=require(_0xccf7('0xb'));var jsforce=require(_0xccf7('0xc'));var deskjs=require(_0xccf7('0xd'));var toCsv=require(_0xccf7('0x6'));var querystring=require(_0xccf7('0xe'));var Papa=require(_0xccf7('0xf'));var Redis=require(_0xccf7('0x10'));var authService=require(_0xccf7('0x11'));var qs=require(_0xccf7('0x12'));var as=require(_0xccf7('0x13'));var hardwareService=require(_0xccf7('0x14'));var logger=require(_0xccf7('0x15'))(_0xccf7('0x16'));var utils=require(_0xccf7('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xccf7('0x18'));var db=require(_0xccf7('0x19'))['db'];function respondWithStatusCode(_0x5ca8f5,_0xb29db8){_0xb29db8=_0xb29db8||0xcc;return function(_0x4f1577){if(_0x4f1577){return _0x5ca8f5['sendStatus'](_0xb29db8);}return _0x5ca8f5[_0xccf7('0x1a')](_0xb29db8)['end']();};}function respondWithResult(_0x40b19d,_0x2bbce2){_0x2bbce2=_0x2bbce2||0xc8;return function(_0x2359d6){if(_0x2359d6){return _0x40b19d[_0xccf7('0x1a')](_0x2bbce2)[_0xccf7('0x1b')](_0x2359d6);}};}function respondWithFilteredResult(_0x46c16b,_0x1bd826){return function(_0x683064){if(_0x683064){var _0x53792b=typeof _0x1bd826[_0xccf7('0x1c')]===_0xccf7('0x1d')&&typeof _0x1bd826['limit']==='undefined';var _0x4f159c=_0x683064[_0xccf7('0x1e')];var _0x174a7e=_0x53792b?0x0:_0x1bd826[_0xccf7('0x1c')];var _0x17c0e0=_0x53792b?_0x683064[_0xccf7('0x1e')]:_0x1bd826[_0xccf7('0x1c')]+_0x1bd826[_0xccf7('0x1f')];var _0x5abe7e;if(_0x17c0e0>=_0x4f159c){_0x17c0e0=_0x4f159c;_0x5abe7e=0xc8;}else{_0x5abe7e=0xce;}_0x46c16b['status'](_0x5abe7e);return _0x46c16b[_0xccf7('0x20')]('Content-Range',_0x174a7e+'-'+_0x17c0e0+'/'+_0x4f159c)[_0xccf7('0x1b')](_0x683064);}return null;};}function patchUpdates(_0x41b622){return function(_0x4dfc9a){try{jsonpatch[_0xccf7('0x21')](_0x4dfc9a,_0x41b622,!![]);}catch(_0x49b07){return BPromise[_0xccf7('0x22')](_0x49b07);}return _0x4dfc9a['save']();};}function saveUpdates(_0x5933a2,_0x46f17a){return function(_0x2d0d0e){if(_0x2d0d0e){return _0x2d0d0e[_0xccf7('0x23')](_0x5933a2)['then'](function(_0x485d5f){return _0x485d5f;});}return null;};}function removeEntity(_0x3fb313,_0x3a12e2){return function(_0x30e15d){if(_0x30e15d){return _0x30e15d[_0xccf7('0x24')]()[_0xccf7('0x25')](function(){_0x3fb313['status'](0xcc)[_0xccf7('0x26')]();});}};}function handleEntityNotFound(_0x20d9b3,_0x3e390e){return function(_0x4d19fc){if(!_0x4d19fc){_0x20d9b3[_0xccf7('0x27')](0x194);}return _0x4d19fc;};}function handleError(_0x109319,_0x1399d3){_0x1399d3=_0x1399d3||0x1f4;return function(_0x1ad738){logger[_0xccf7('0x28')](_0x1ad738['stack']);if(_0x1ad738[_0xccf7('0x29')]){delete _0x1ad738[_0xccf7('0x29')];}_0x109319[_0xccf7('0x1a')](_0x1399d3)[_0xccf7('0x2a')](_0x1ad738);};}exports[_0xccf7('0x2b')]=function(_0x312e73,_0x10df32){var _0x19e196={},_0x46cd1c={},_0x41e69c={'count':0x0,'rows':[]};var _0x15885d=_[_0xccf7('0x2c')](db[_0xccf7('0x2d')][_0xccf7('0x2e')],function(_0x5dcd53){return{'name':_0x5dcd53[_0xccf7('0x2f')],'type':_0x5dcd53['type'][_0xccf7('0x30')]};});_0x46cd1c[_0xccf7('0x31')]=_[_0xccf7('0x2c')](_0x15885d,'name');_0x46cd1c['query']=_[_0xccf7('0x32')](_0x312e73['query']);_0x46cd1c[_0xccf7('0x33')]=_[_0xccf7('0x34')](_0x46cd1c['model'],_0x46cd1c['query']);_0x19e196[_0xccf7('0x35')]=_[_0xccf7('0x34')](_0x46cd1c[_0xccf7('0x31')],qs[_0xccf7('0x36')](_0x312e73[_0xccf7('0x37')][_0xccf7('0x36')]));_0x19e196[_0xccf7('0x35')]=_0x19e196[_0xccf7('0x35')]['length']?_0x19e196[_0xccf7('0x35')]:_0x46cd1c[_0xccf7('0x31')];if(!_0x312e73[_0xccf7('0x37')]['hasOwnProperty']('nolimit')){_0x19e196['limit']=qs[_0xccf7('0x1f')](_0x312e73[_0xccf7('0x37')]['limit']);_0x19e196[_0xccf7('0x1c')]=qs['offset'](_0x312e73[_0xccf7('0x37')][_0xccf7('0x1c')]);}_0x19e196[_0xccf7('0x38')]=qs['sort'](_0x312e73[_0xccf7('0x37')]['sort']);_0x19e196[_0xccf7('0x39')]=qs[_0xccf7('0x33')](_[_0xccf7('0x3a')](_0x312e73['query'],_0x46cd1c['filters']),_0x15885d);if(_0x312e73[_0xccf7('0x37')][_0xccf7('0x3b')]){_0x19e196[_0xccf7('0x39')]=_[_0xccf7('0x3c')](_0x19e196[_0xccf7('0x39')],{'$or':_['map'](_0x15885d,function(_0x3c45f4){if(_0x3c45f4['type']!==_0xccf7('0x3d')){var _0x296720={};_0x296720[_0x3c45f4['name']]={'$like':'%'+_0x312e73['query'][_0xccf7('0x3b')]+'%'};return _0x296720;}})});}_0x19e196=_[_0xccf7('0x3c')]({},_0x19e196,_0x312e73[_0xccf7('0x3e')]);var _0x4805d2={'where':_0x19e196[_0xccf7('0x39')]};return db[_0xccf7('0x2d')][_0xccf7('0x1e')](_0x4805d2)[_0xccf7('0x25')](function(_0x1b1915){_0x41e69c[_0xccf7('0x1e')]=_0x1b1915;if(_0x312e73[_0xccf7('0x37')][_0xccf7('0x3f')]){_0x19e196[_0xccf7('0x40')]=[{'all':!![]}];}return db[_0xccf7('0x2d')][_0xccf7('0x41')](_0x19e196);})['then'](function(_0x29f33d){_0x41e69c[_0xccf7('0x42')]=_0x29f33d;return _0x41e69c;})['then'](respondWithFilteredResult(_0x10df32,_0x19e196))[_0xccf7('0x43')](handleError(_0x10df32,null));};exports[_0xccf7('0x44')]=function(_0x2b3c5e,_0x1fc814){var _0x6a2618={'raw':!![],'where':{'id':_0x2b3c5e[_0xccf7('0x45')]['id']}},_0x4a18f3={};_0x4a18f3[_0xccf7('0x31')]=_['keys'](db[_0xccf7('0x2d')][_0xccf7('0x2e')]);_0x4a18f3['query']=_[_0xccf7('0x32')](_0x2b3c5e[_0xccf7('0x37')]);_0x4a18f3[_0xccf7('0x33')]=_[_0xccf7('0x34')](_0x4a18f3[_0xccf7('0x31')],_0x4a18f3[_0xccf7('0x37')]);_0x6a2618['attributes']=_['intersection'](_0x4a18f3['model'],qs[_0xccf7('0x36')](_0x2b3c5e[_0xccf7('0x37')][_0xccf7('0x36')]));_0x6a2618[_0xccf7('0x35')]=_0x6a2618[_0xccf7('0x35')]['length']?_0x6a2618[_0xccf7('0x35')]:_0x4a18f3[_0xccf7('0x31')];if(_0x2b3c5e[_0xccf7('0x37')][_0xccf7('0x3f')]){_0x6a2618[_0xccf7('0x40')]=[{'all':!![]}];}_0x6a2618=_['merge']({},_0x6a2618,_0x2b3c5e['options']);return db[_0xccf7('0x2d')][_0xccf7('0x46')](_0x6a2618)[_0xccf7('0x25')](handleEntityNotFound(_0x1fc814,null))[_0xccf7('0x25')](respondWithResult(_0x1fc814,null))['catch'](handleError(_0x1fc814,null));};exports['create']=function(_0x5034b8,_0x3c868c){return db[_0xccf7('0x2d')]['create'](_0x5034b8[_0xccf7('0x47')],{})[_0xccf7('0x25')](respondWithResult(_0x3c868c,0xc9))[_0xccf7('0x43')](handleError(_0x3c868c,null));};exports[_0xccf7('0x23')]=function(_0x236e8c,_0x458fe8){if(_0x236e8c[_0xccf7('0x47')]['id']){delete _0x236e8c[_0xccf7('0x47')]['id'];}return db['SquareDetailsReport'][_0xccf7('0x46')]({'where':{'id':_0x236e8c[_0xccf7('0x45')]['id']}})['then'](handleEntityNotFound(_0x458fe8,null))['then'](saveUpdates(_0x236e8c['body'],null))[_0xccf7('0x25')](respondWithResult(_0x458fe8,null))[_0xccf7('0x43')](handleError(_0x458fe8,null));};exports[_0xccf7('0x24')]=function(_0x1b6fd9,_0x51d000){return db[_0xccf7('0x2d')][_0xccf7('0x46')]({'where':{'id':_0x1b6fd9[_0xccf7('0x45')]['id']}})[_0xccf7('0x25')](handleEntityNotFound(_0x51d000,null))[_0xccf7('0x25')](removeEntity(_0x51d000,null))[_0xccf7('0x43')](handleError(_0x51d000,null));};exports[_0xccf7('0x48')]=function(_0x12e439,_0x44de32){return db[_0xccf7('0x2d')][_0xccf7('0x48')]()[_0xccf7('0x25')](respondWithResult(_0x44de32,null))[_0xccf7('0x43')](handleError(_0x44de32,null));};
\ No newline at end of file
index 6b1940b..cc1aeba 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4fe3=['./squareReportDetail.attributes','exports','define','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x3b8efa,_0x54a46e){var _0x112060=function(_0x3b5a6f){while(--_0x3b5a6f){_0x3b8efa['push'](_0x3b8efa['shift']());}};_0x112060(++_0x54a46e);}(_0x4fe3,0x93));var _0x34fe=function(_0xcd7a3,_0x440f46){_0xcd7a3=_0xcd7a3-0x0;var _0x336cd7=_0x4fe3[_0xcd7a3];return _0x336cd7;};'use strict';var _=require(_0x34fe('0x0'));var util=require(_0x34fe('0x1'));var logger=require(_0x34fe('0x2'))(_0x34fe('0x3'));var moment=require(_0x34fe('0x4'));var BPromise=require(_0x34fe('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x34fe('0x6'));var rimraf=require(_0x34fe('0x7'));var config=require(_0x34fe('0x8'));var attributes=require(_0x34fe('0x9'));module[_0x34fe('0xa')]=function(_0x43423d,_0x131dd1){return _0x43423d[_0x34fe('0xb')]('SquareDetailsReport',attributes,{'tableName':'report_square_details','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xea67=['path','rimraf','./squareReportDetail.attributes','exports','define','SquareDetailsReport','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x5a6e2d,_0x5a3579){var _0x4fab7a=function(_0xb1a793){while(--_0xb1a793){_0x5a6e2d['push'](_0x5a6e2d['shift']());}};_0x4fab7a(++_0x5a3579);}(_0xea67,0x162));var _0x7ea6=function(_0x3875b1,_0x47cf1a){_0x3875b1=_0x3875b1-0x0;var _0x1e9c55=_0xea67[_0x3875b1];return _0x1e9c55;};'use strict';var _=require(_0x7ea6('0x0'));var util=require(_0x7ea6('0x1'));var logger=require(_0x7ea6('0x2'))(_0x7ea6('0x3'));var moment=require(_0x7ea6('0x4'));var BPromise=require('bluebird');var rp=require(_0x7ea6('0x5'));var fs=require('fs');var path=require(_0x7ea6('0x6'));var rimraf=require(_0x7ea6('0x7'));var config=require('../../config/environment');var attributes=require(_0x7ea6('0x8'));module[_0x7ea6('0x9')]=function(_0x15f424,_0x36a403){return _0x15f424[_0x7ea6('0xa')](_0x7ea6('0xb'),attributes,{'tableName':'report_square_details','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 2dadf50..a8fbb65 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5b12=['../../config/utils','rpc','client','request','then','info','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','code','SquareDetailsReport,\x20%s,\x20%s','message','catch','CreateSquareDetailsReport','SquareDetailsReport','options','raw','lodash','util','moment','randomstring','../../mysqldb'];(function(_0x42081a,_0x2c66e8){var _0x582ab3=function(_0x119558){while(--_0x119558){_0x42081a['push'](_0x42081a['shift']());}};_0x582ab3(++_0x2c66e8);}(_0x5b12,0xa3));var _0x25b1=function(_0x7a3d26,_0x4c1d5d){_0x7a3d26=_0x7a3d26-0x0;var _0x293427=_0x5b12[_0x7a3d26];return _0x293427;};'use strict';var _=require(_0x25b1('0x0'));var util=require(_0x25b1('0x1'));var moment=require(_0x25b1('0x2'));var BPromise=require('bluebird');var rs=require(_0x25b1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x25b1('0x4'))['db'];var utils=require(_0x25b1('0x5'));var logger=require('../../config/logger')(_0x25b1('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x25b1('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5bb95b,_0x1f715d,_0x28c980){return new BPromise(function(_0x451c66,_0x2a46e0){return client[_0x25b1('0x8')](_0x5bb95b,_0x28c980)[_0x25b1('0x9')](function(_0x3346ed){logger[_0x25b1('0xa')]('SquareDetailsReport,\x20%s,\x20%s',_0x1f715d,_0x25b1('0xb'));logger[_0x25b1('0xc')](_0x25b1('0xd'),_0x1f715d,_0x25b1('0xb'),JSON[_0x25b1('0xe')](_0x3346ed));if(_0x3346ed[_0x25b1('0xf')]){if(_0x3346ed[_0x25b1('0xf')][_0x25b1('0x10')]===0x1f4){logger[_0x25b1('0xf')](_0x25b1('0x11'),_0x1f715d,_0x3346ed[_0x25b1('0xf')][_0x25b1('0x12')]);return _0x2a46e0(_0x3346ed[_0x25b1('0xf')][_0x25b1('0x12')]);}logger[_0x25b1('0xf')](_0x25b1('0x11'),_0x1f715d,_0x3346ed['error'][_0x25b1('0x12')]);return _0x451c66(_0x3346ed[_0x25b1('0xf')]['message']);}else{logger[_0x25b1('0xa')](_0x25b1('0x11'),_0x1f715d,_0x25b1('0xb'));_0x451c66(_0x3346ed['result']['message']);}})[_0x25b1('0x13')](function(_0x573ec2){logger[_0x25b1('0xf')](_0x25b1('0x11'),_0x1f715d,_0x573ec2);_0x2a46e0(_0x573ec2);});});}exports[_0x25b1('0x14')]=function(_0x27ccc9){var _0x1f78c2=this;return new Promise(function(_0x2a7d14,_0x17024a){return db[_0x25b1('0x15')]['create'](_0x27ccc9['body'],{'raw':_0x27ccc9[_0x25b1('0x16')]?_0x27ccc9['options'][_0x25b1('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x3bfd7d){logger['info'](_0x25b1('0x14'),_0x27ccc9);logger['debug'](_0x25b1('0x14'),_0x27ccc9,JSON['stringify'](_0x3bfd7d));_0x2a7d14(_0x3bfd7d);})['catch'](function(_0x565cfd){logger[_0x25b1('0xf')](_0x25b1('0x14'),_0x565cfd['message'],_0x27ccc9);_0x17024a(_0x1f78c2[_0x25b1('0xf')](0x1f4,_0x565cfd[_0x25b1('0x12')]));});});};
\ No newline at end of file
+var _0xfff0=['CreateSquareDetailsReport','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','then','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','SquareDetailsReport','create','body','options','raw'];(function(_0x5876ad,_0x2150c0){var _0x4d46f7=function(_0x23e6af){while(--_0x23e6af){_0x5876ad['push'](_0x5876ad['shift']());}};_0x4d46f7(++_0x2150c0);}(_0xfff0,0x139));var _0x0fff=function(_0x1731ef,_0x563f12){_0x1731ef=_0x1731ef-0x0;var _0x3ba2b1=_0xfff0[_0x1731ef];return _0x3ba2b1;};'use strict';var _=require('lodash');var util=require(_0x0fff('0x0'));var moment=require(_0x0fff('0x1'));var BPromise=require(_0x0fff('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0fff('0x3'));var db=require(_0x0fff('0x4'))['db'];var utils=require(_0x0fff('0x5'));var logger=require('../../config/logger')(_0x0fff('0x6'));var config=require(_0x0fff('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x0fff('0x8')][_0x0fff('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2f1d2b,_0x586dc5,_0x24cfb0){return new BPromise(function(_0x5e9672,_0x1f2658){return client['request'](_0x2f1d2b,_0x24cfb0)[_0x0fff('0xa')](function(_0x3db6f6){logger['info'](_0x0fff('0xb'),_0x586dc5,_0x0fff('0xc'));logger[_0x0fff('0xd')](_0x0fff('0xe'),_0x586dc5,_0x0fff('0xc'),JSON[_0x0fff('0xf')](_0x3db6f6));if(_0x3db6f6[_0x0fff('0x10')]){if(_0x3db6f6[_0x0fff('0x10')][_0x0fff('0x11')]===0x1f4){logger[_0x0fff('0x10')](_0x0fff('0xb'),_0x586dc5,_0x3db6f6['error'][_0x0fff('0x12')]);return _0x1f2658(_0x3db6f6['error'][_0x0fff('0x12')]);}logger[_0x0fff('0x10')](_0x0fff('0xb'),_0x586dc5,_0x3db6f6[_0x0fff('0x10')]['message']);return _0x5e9672(_0x3db6f6['error'][_0x0fff('0x12')]);}else{logger['info']('SquareDetailsReport,\x20%s,\x20%s',_0x586dc5,'request\x20sent');_0x5e9672(_0x3db6f6[_0x0fff('0x13')][_0x0fff('0x12')]);}})['catch'](function(_0x431b33){logger[_0x0fff('0x10')]('SquareDetailsReport,\x20%s,\x20%s',_0x586dc5,_0x431b33);_0x1f2658(_0x431b33);});});}exports['CreateSquareDetailsReport']=function(_0x48f36d){var _0x2337f=this;return new Promise(function(_0x606792,_0x46a02d){return db[_0x0fff('0x14')][_0x0fff('0x15')](_0x48f36d[_0x0fff('0x16')],{'raw':_0x48f36d['options']?_0x48f36d[_0x0fff('0x17')][_0x0fff('0x18')]===undefined?!![]:![]:!![]})[_0x0fff('0xa')](function(_0x49d211){logger['info'](_0x0fff('0x19'),_0x48f36d);logger[_0x0fff('0xd')](_0x0fff('0x19'),_0x48f36d,JSON[_0x0fff('0xf')](_0x49d211));_0x606792(_0x49d211);})['catch'](function(_0x155132){logger[_0x0fff('0x10')](_0x0fff('0x19'),_0x155132[_0x0fff('0x12')],_0x48f36d);_0x46a02d(_0x2337f[_0x0fff('0x10')](0x1f4,_0x155132[_0x0fff('0x12')]));});});};
\ No newline at end of file
index fa7ea6d..9715ff9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x56a3=['./system.controller','isAuthenticated','index','get','Router','../../components/auth/service'];(function(_0x34ee29,_0x54022f){var _0x3ae70e=function(_0x334ea2){while(--_0x334ea2){_0x34ee29['push'](_0x34ee29['shift']());}};_0x3ae70e(++_0x54022f);}(_0x56a3,0x196));var _0x356a=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x56a3[_0x20a584];return _0x4b41a8;};'use strict';var express=require('express');var router=express[_0x356a('0x0')]();var auth=require(_0x356a('0x1'));var controller=require(_0x356a('0x2'));router['get']('/',auth[_0x356a('0x3')](),controller[_0x356a('0x4')]);router[_0x356a('0x5')]('/process/:pid/kill',auth[_0x356a('0x3')](),controller['killProcess']);module['exports']=router;
\ No newline at end of file
+var _0x445b=['./system.controller','get','isAuthenticated','/process/:pid/kill','killProcess','../../components/auth/service'];(function(_0x8d6c7a,_0x2d4c3c){var _0x2c305a=function(_0x388014){while(--_0x388014){_0x8d6c7a['push'](_0x8d6c7a['shift']());}};_0x2c305a(++_0x2d4c3c);}(_0x445b,0x185));var _0xb445=function(_0x3d8603,_0x43b724){_0x3d8603=_0x3d8603-0x0;var _0x3181f2=_0x445b[_0x3d8603];return _0x3181f2;};'use strict';var express=require('express');var router=express['Router']();var auth=require(_0xb445('0x0'));var controller=require(_0xb445('0x1'));router[_0xb445('0x2')]('/',auth[_0xb445('0x3')](),controller['index']);router[_0xb445('0x2')](_0xb445('0x4'),auth['isAuthenticated'](),controller[_0xb445('0x5')]);module['exports']=router;
\ No newline at end of file
index 180d309..82f2264 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0ebc=['status','send','getAllData','then','json','catch','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','split','length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','kill','SIGINT','killProcess','child_process','exec','util','lodash','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name'];(function(_0x8e14fd,_0x51c2ca){var _0x4a97db=function(_0x2b18ab){while(--_0x2b18ab){_0x8e14fd['push'](_0x8e14fd['shift']());}};_0x4a97db(++_0x51c2ca);}(_0x0ebc,0x76));var _0xc0eb=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0ebc[_0x321bb2];return _0x9c12ed;};'use strict';var info=require('systeminformation');var exec=require(_0xc0eb('0x0'))[_0xc0eb('0x1')];var logger=require('../../config/logger')('api');var util=require(_0xc0eb('0x2'));var BPromise=require('bluebird');var _=require(_0xc0eb('0x3'));function handleError(_0x58baa7,_0x397656,_0x354506){_0x397656=_0x397656||0x1f4;return function(_0x434f77){logger['error'](_0xc0eb('0x4'),_0x354506,_0x397656,util[_0xc0eb('0x5')](_0x434f77,{'showHidden':![],'depth':null}));delete _0x434f77[_0xc0eb('0x6')];_0x58baa7[_0xc0eb('0x7')](_0x397656)[_0xc0eb('0x8')](_0x434f77);};}exports['index']=function(_0x58447a,_0x448c1e){return info[_0xc0eb('0x9')]()[_0xc0eb('0xa')](function(_0x11d7ce){return _0x448c1e[_0xc0eb('0x7')](0xc8)[_0xc0eb('0xb')](_0x11d7ce);})[_0xc0eb('0xc')](function(_0x1d8c2a){return _0x448c1e['status'](0x1f4)[_0xc0eb('0xb')](_0x1d8c2a);});};exports['killProcess']=function(_0x509608,_0x2c56b4){var _0x338d82=[_0xc0eb('0xd')];return new BPromise(function(_0x1d2d9b,_0x419f41){return exec(util[_0xc0eb('0xe')](_0xc0eb('0xf'),_0x509608[_0xc0eb('0x10')][_0xc0eb('0x11')]),function(_0x4ca576,_0x213879,_0x1adde6){if(_0x4ca576){return _0x419f41(_0x4ca576);}return _0x1d2d9b(_0x213879);});})[_0xc0eb('0xa')](function(_0xeb15b8){var _0x1e4213=![];var _0x9d44bd=_0xeb15b8[_0xc0eb('0x12')](/\n/);for(var _0x2a60d2=0x0,_0xae3e46=_0x338d82[_0xc0eb('0x13')];_0x2a60d2<_0xae3e46,_0x1e4213===![];_0x2a60d2+=0x1){if(_0xeb15b8[_0xc0eb('0x14')](_0x338d82[_0x2a60d2])>=0x0){_0x1e4213=!![];}}if(!_0x1e4213){throw new Error(util['format'](_0xc0eb('0x15'),_0x509608[_0xc0eb('0x10')]['pid']));}process[_0xc0eb('0x16')](_0x509608[_0xc0eb('0x10')][_0xc0eb('0x11')],_0xc0eb('0x17'));return _0x2c56b4[_0xc0eb('0x7')](0xc8)[_0xc0eb('0xb')]({'message':util[_0xc0eb('0xe')]('Process\x20with\x20pid\x20%s\x20killed\x20correctly',_0x509608[_0xc0eb('0x10')][_0xc0eb('0x11')])});})[_0xc0eb('0xc')](handleError(_0x2c56b4,null,_0xc0eb('0x18')));};
\ No newline at end of file
+var _0x1792=['Process\x20with\x20pid\x20%s\x20killed\x20correctly','catch','killProcess','systeminformation','child_process','api','util','bluebird','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','status','send','index','getAllData','then','json','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','format','pid','kill'];(function(_0x30c2af,_0x5b7d42){var _0x3888cb=function(_0x32a465){while(--_0x32a465){_0x30c2af['push'](_0x30c2af['shift']());}};_0x3888cb(++_0x5b7d42);}(_0x1792,0x16b));var _0x2179=function(_0x37bf43,_0x5b2339){_0x37bf43=_0x37bf43-0x0;var _0x4101c5=_0x1792[_0x37bf43];return _0x4101c5;};'use strict';var info=require(_0x2179('0x0'));var exec=require(_0x2179('0x1'))['exec'];var logger=require('../../config/logger')(_0x2179('0x2'));var util=require(_0x2179('0x3'));var BPromise=require(_0x2179('0x4'));var _=require(_0x2179('0x5'));function handleError(_0x343f4f,_0x209d1f,_0x1e3bf2){_0x209d1f=_0x209d1f||0x1f4;return function(_0x1efd3c){logger[_0x2179('0x6')](_0x2179('0x7'),_0x1e3bf2,_0x209d1f,util[_0x2179('0x8')](_0x1efd3c,{'showHidden':![],'depth':null}));delete _0x1efd3c[_0x2179('0x9')];_0x343f4f[_0x2179('0xa')](_0x209d1f)[_0x2179('0xb')](_0x1efd3c);};}exports[_0x2179('0xc')]=function(_0x9bb23e,_0x1b8465){return info[_0x2179('0xd')]()[_0x2179('0xe')](function(_0x3d19b0){return _0x1b8465['status'](0xc8)[_0x2179('0xf')](_0x3d19b0);})['catch'](function(_0x1fb28f){return _0x1b8465[_0x2179('0xa')](0x1f4)['json'](_0x1fb28f);});};exports['killProcess']=function(_0x36dfb9,_0x437b18){var _0x58498b=['components/import/cm'];return new BPromise(function(_0x5ebc9d,_0x1484e3){return exec(util['format'](_0x2179('0x10'),_0x36dfb9[_0x2179('0x11')]['pid']),function(_0x59663a,_0x4897a4,_0x51d054){if(_0x59663a){return _0x1484e3(_0x59663a);}return _0x5ebc9d(_0x4897a4);});})[_0x2179('0xe')](function(_0x232082){var _0x3c3452=![];var _0x469af4=_0x232082['split'](/\n/);for(var _0x32d528=0x0,_0x4d4533=_0x58498b['length'];_0x32d528<_0x4d4533,_0x3c3452===![];_0x32d528+=0x1){if(_0x232082['indexOf'](_0x58498b[_0x32d528])>=0x0){_0x3c3452=!![];}}if(!_0x3c3452){throw new Error(util[_0x2179('0x12')]('Process\x20with\x20pid\x20%s\x20not\x20found!',_0x36dfb9[_0x2179('0x11')][_0x2179('0x13')]));}process[_0x2179('0x14')](_0x36dfb9[_0x2179('0x11')][_0x2179('0x13')],'SIGINT');return _0x437b18[_0x2179('0xa')](0xc8)[_0x2179('0xf')]({'message':util[_0x2179('0x12')](_0x2179('0x15'),_0x36dfb9[_0x2179('0x11')]['pid'])});})[_0x2179('0x16')](handleError(_0x437b18,null,_0x2179('0x17')));};
\ No newline at end of file
index 950ac7e..4d77271 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa72a=['isAuthenticated','/:id','show','post','put','update','delete','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','get'];(function(_0x2bdb6c,_0x5b644a){var _0x456e08=function(_0x1d5201){while(--_0x1d5201){_0x2bdb6c['push'](_0x2bdb6c['shift']());}};_0x456e08(++_0x5b644a);}(_0xa72a,0xc8));var _0xaa72=function(_0x48e4d6,_0x499fc4){_0x48e4d6=_0x48e4d6-0x0;var _0x381211=_0xa72a[_0x48e4d6];return _0x381211;};'use strict';var multer=require(_0xaa72('0x0'));var util=require('util');var path=require(_0xaa72('0x1'));var timeout=require(_0xaa72('0x2'));var express=require(_0xaa72('0x3'));var router=express['Router']();var fs_extra=require(_0xaa72('0x4'));var auth=require(_0xaa72('0x5'));var interaction=require(_0xaa72('0x6'));var config=require('../../config/environment');var controller=require('./tag.controller');router[_0xaa72('0x7')]('/',auth[_0xaa72('0x8')](),controller['index']);router['get'](_0xaa72('0x9'),auth['isAuthenticated'](),controller[_0xaa72('0xa')]);router[_0xaa72('0xb')]('/',auth[_0xaa72('0x8')](),controller['create']);router[_0xaa72('0xc')](_0xaa72('0x9'),auth[_0xaa72('0x8')](),controller[_0xaa72('0xd')]);router[_0xaa72('0xe')](_0xaa72('0x9'),auth[_0xaa72('0x8')](),controller['destroy']);module[_0xaa72('0xf')]=router;
\ No newline at end of file
+var _0xbba8=['path','express','../../components/auth/service','../../components/interaction/service','./tag.controller','get','index','/:id','isAuthenticated','show','post','create','put','update','delete','exports','util'];(function(_0x23bcd4,_0xd3deb0){var _0x4cb792=function(_0x48d4c8){while(--_0x48d4c8){_0x23bcd4['push'](_0x23bcd4['shift']());}};_0x4cb792(++_0xd3deb0);}(_0xbba8,0x197));var _0x8bba=function(_0x494e66,_0xf6d9cd){_0x494e66=_0x494e66-0x0;var _0x5df5ca=_0xbba8[_0x494e66];return _0x5df5ca;};'use strict';var multer=require('multer');var util=require(_0x8bba('0x0'));var path=require(_0x8bba('0x1'));var timeout=require('connect-timeout');var express=require(_0x8bba('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x8bba('0x3'));var interaction=require(_0x8bba('0x4'));var config=require('../../config/environment');var controller=require(_0x8bba('0x5'));router[_0x8bba('0x6')]('/',auth['isAuthenticated'](),controller[_0x8bba('0x7')]);router[_0x8bba('0x6')](_0x8bba('0x8'),auth[_0x8bba('0x9')](),controller[_0x8bba('0xa')]);router[_0x8bba('0xb')]('/',auth[_0x8bba('0x9')](),controller[_0x8bba('0xc')]);router[_0x8bba('0xd')]('/:id',auth[_0x8bba('0x9')](),controller[_0x8bba('0xe')]);router[_0x8bba('0xf')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x8bba('0x10')]=router;
\ No newline at end of file
index c5edb93..44f2b22 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2572=['name','#0091EA','sequelize','exports','STRING'];(function(_0x17809c,_0xa6ceb9){var _0x144a29=function(_0x44b044){while(--_0x44b044){_0x17809c['push'](_0x17809c['shift']());}};_0x144a29(++_0xa6ceb9);}(_0x2572,0x110));var _0x2257=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x2572[_0x2f5ac5];return _0x37c9a8;};'use strict';var Sequelize=require(_0x2257('0x0'));module[_0x2257('0x1')]={'name':{'type':Sequelize[_0x2257('0x2')],'unique':_0x2257('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x2257('0x2')],'defaultValue':_0x2257('0x4')},'description':{'type':Sequelize[_0x2257('0x2')]}};
\ No newline at end of file
+var _0x4483=['exports','STRING','#0091EA','sequelize'];(function(_0x18f623,_0x1f2a74){var _0x299b78=function(_0x3914e8){while(--_0x3914e8){_0x18f623['push'](_0x18f623['shift']());}};_0x299b78(++_0x1f2a74);}(_0x4483,0x1a3));var _0x3448=function(_0xf93b47,_0x458cf7){_0xf93b47=_0xf93b47-0x0;var _0x1102c5=_0x4483[_0xf93b47];return _0x1102c5;};'use strict';var Sequelize=require(_0x3448('0x0'));module[_0x3448('0x1')]={'name':{'type':Sequelize[_0x3448('0x2')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x3448('0x2')],'defaultValue':_0x3448('0x3')},'description':{'type':Sequelize[_0x3448('0x2')]}};
\ No newline at end of file
index 7255df5..3ff6f8b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x202c=['Tags','then','end','name','send','map','Tag','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','save','update','destroy','get'];(function(_0x1854d3,_0x3d0663){var _0x4234ab=function(_0x3b5168){while(--_0x3b5168){_0x1854d3['push'](_0x1854d3['shift']());}};_0x4234ab(++_0x3d0663);}(_0x202c,0x178));var _0xc202=function(_0x279073,_0x227b6c){_0x279073=_0x279073-0x0;var _0x176e41=_0x202c[_0x279073];return _0x176e41;};'use strict';var emlformat=require(_0xc202('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xc202('0x1'));var rp=require(_0xc202('0x2'));var moment=require(_0xc202('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xc202('0x4'));var util=require(_0xc202('0x5'));var path=require(_0xc202('0x6'));var sox=require(_0xc202('0x7'));var csv=require('to-csv');var ejs=require(_0xc202('0x8'));var fs=require('fs');var fs_extra=require(_0xc202('0x9'));var _=require('lodash');var squel=require(_0xc202('0xa'));var crypto=require('crypto');var jsforce=require(_0xc202('0xb'));var deskjs=require(_0xc202('0xc'));var toCsv=require(_0xc202('0xd'));var querystring=require(_0xc202('0xe'));var Papa=require(_0xc202('0xf'));var Redis=require(_0xc202('0x10'));var authService=require(_0xc202('0x11'));var qs=require(_0xc202('0x12'));var as=require(_0xc202('0x13'));var hardwareService=require(_0xc202('0x14'));var logger=require(_0xc202('0x15'))(_0xc202('0x16'));var utils=require(_0xc202('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xc202('0x18'));var db=require(_0xc202('0x19'))['db'];function respondWithStatusCode(_0x2805af,_0xbf3618){_0xbf3618=_0xbf3618||0xcc;return function(_0x269dc0){if(_0x269dc0){return _0x2805af[_0xc202('0x1a')](_0xbf3618);}return _0x2805af[_0xc202('0x1b')](_0xbf3618)['end']();};}function respondWithResult(_0xbd4353,_0x32b5d9){_0x32b5d9=_0x32b5d9||0xc8;return function(_0x591cc0){if(_0x591cc0){return _0xbd4353['status'](_0x32b5d9)['json'](_0x591cc0);}};}function respondWithFilteredResult(_0x2dafa5,_0x4a333c){return function(_0x2f18ec){if(_0x2f18ec){var _0x5971a6=typeof _0x4a333c[_0xc202('0x1c')]===_0xc202('0x1d')&&typeof _0x4a333c[_0xc202('0x1e')]===_0xc202('0x1d');var _0x705253=_0x2f18ec[_0xc202('0x1f')];var _0x9620a0=_0x5971a6?0x0:_0x4a333c['offset'];var _0x16ec7c=_0x5971a6?_0x2f18ec[_0xc202('0x1f')]:_0x4a333c[_0xc202('0x1c')]+_0x4a333c['limit'];var _0x504d94;if(_0x16ec7c>=_0x705253){_0x16ec7c=_0x705253;_0x504d94=0xc8;}else{_0x504d94=0xce;}_0x2dafa5[_0xc202('0x1b')](_0x504d94);return _0x2dafa5[_0xc202('0x20')](_0xc202('0x21'),_0x9620a0+'-'+_0x16ec7c+'/'+_0x705253)[_0xc202('0x22')](_0x2f18ec);}return null;};}function patchUpdates(_0x2ae3c1){return function(_0x537ae1){try{jsonpatch['apply'](_0x537ae1,_0x2ae3c1,!![]);}catch(_0x3eec58){return BPromise['reject'](_0x3eec58);}return _0x537ae1[_0xc202('0x23')]();};}function saveUpdates(_0x372b31,_0x56e979){return function(_0x50f917){if(_0x50f917){return _0x50f917[_0xc202('0x24')](_0x372b31)['then'](function(_0x23e1a0){return _0x23e1a0;});}return null;};}function removeEntity(_0x2570e2,_0x27f4cb){return function(_0x3a0dab){if(_0x3a0dab){return _0x3a0dab[_0xc202('0x25')]()['then'](function(){var _0x59f84d=_0x3a0dab[_0xc202('0x26')]({'plain':!![]});var _0x1076af=_0xc202('0x27');return db['UserProfileResource'][_0xc202('0x25')]({'where':{'type':_0x1076af,'resourceId':_0x59f84d['id']}})[_0xc202('0x28')](function(){return _0x3a0dab;});})['then'](function(){_0x2570e2['status'](0xcc)[_0xc202('0x29')]();});}};}function handleEntityNotFound(_0x2f8011,_0xd88a43){return function(_0x6b291c){if(!_0x6b291c){_0x2f8011[_0xc202('0x1a')](0x194);}return _0x6b291c;};}function handleError(_0x483357,_0x114abb){_0x114abb=_0x114abb||0x1f4;return function(_0x32f56c){logger['error'](_0x32f56c['stack']);if(_0x32f56c[_0xc202('0x2a')]){delete _0x32f56c[_0xc202('0x2a')];}_0x483357[_0xc202('0x1b')](_0x114abb)[_0xc202('0x2b')](_0x32f56c);};}exports['index']=function(_0x1f09cf,_0x2c8fec){var _0x3c3f22={},_0x597b75={},_0x77f95a={'count':0x0,'rows':[]};var _0x11cc40=_[_0xc202('0x2c')](db[_0xc202('0x2d')][_0xc202('0x2e')],function(_0x196394){return{'name':_0x196394[_0xc202('0x2f')],'type':_0x196394[_0xc202('0x30')][_0xc202('0x31')]};});_0x597b75[_0xc202('0x32')]=_[_0xc202('0x2c')](_0x11cc40,_0xc202('0x2a'));_0x597b75['query']=_[_0xc202('0x33')](_0x1f09cf[_0xc202('0x34')]);_0x597b75[_0xc202('0x35')]=_['intersection'](_0x597b75[_0xc202('0x32')],_0x597b75['query']);_0x3c3f22[_0xc202('0x36')]=_[_0xc202('0x37')](_0x597b75[_0xc202('0x32')],qs[_0xc202('0x38')](_0x1f09cf[_0xc202('0x34')][_0xc202('0x38')]));_0x3c3f22['attributes']=_0x3c3f22[_0xc202('0x36')]['length']?_0x3c3f22[_0xc202('0x36')]:_0x597b75['model'];if(!_0x1f09cf[_0xc202('0x34')][_0xc202('0x39')](_0xc202('0x3a'))){_0x3c3f22['limit']=qs[_0xc202('0x1e')](_0x1f09cf[_0xc202('0x34')][_0xc202('0x1e')]);_0x3c3f22[_0xc202('0x1c')]=qs[_0xc202('0x1c')](_0x1f09cf[_0xc202('0x34')]['offset']);}_0x3c3f22[_0xc202('0x3b')]=qs[_0xc202('0x3c')](_0x1f09cf[_0xc202('0x34')]['sort']);_0x3c3f22[_0xc202('0x3d')]=qs[_0xc202('0x35')](_[_0xc202('0x3e')](_0x1f09cf[_0xc202('0x34')],_0x597b75['filters']),_0x11cc40);if(_0x1f09cf['query'][_0xc202('0x3f')]){_0x3c3f22['where']=_[_0xc202('0x40')](_0x3c3f22[_0xc202('0x3d')],{'$or':_[_0xc202('0x2c')](_0x11cc40,function(_0x200c27){if(_0x200c27[_0xc202('0x30')]!==_0xc202('0x41')){var _0x52d9d2={};_0x52d9d2[_0x200c27[_0xc202('0x2a')]]={'$like':'%'+_0x1f09cf[_0xc202('0x34')][_0xc202('0x3f')]+'%'};return _0x52d9d2;}})});}_0x3c3f22=_[_0xc202('0x40')]({},_0x3c3f22,_0x1f09cf[_0xc202('0x42')]);var _0x51b191={'where':_0x3c3f22[_0xc202('0x3d')]};return db[_0xc202('0x2d')][_0xc202('0x1f')](_0x51b191)[_0xc202('0x28')](function(_0x50ed63){_0x77f95a['count']=_0x50ed63;if(_0x1f09cf[_0xc202('0x34')]['includeAll']){_0x3c3f22[_0xc202('0x43')]=[{'all':!![]}];}return db['Tag'][_0xc202('0x44')](_0x3c3f22);})[_0xc202('0x28')](function(_0x138a43){_0x77f95a[_0xc202('0x45')]=_0x138a43;return _0x77f95a;})['then'](respondWithFilteredResult(_0x2c8fec,_0x3c3f22))[_0xc202('0x46')](handleError(_0x2c8fec,null));};exports[_0xc202('0x47')]=function(_0x865cd1,_0x2de657){var _0x1f4bb2={'raw':!![],'where':{'id':_0x865cd1[_0xc202('0x48')]['id']}},_0x91785a={};_0x91785a[_0xc202('0x32')]=_[_0xc202('0x33')](db[_0xc202('0x2d')][_0xc202('0x2e')]);_0x91785a[_0xc202('0x34')]=_[_0xc202('0x33')](_0x865cd1[_0xc202('0x34')]);_0x91785a[_0xc202('0x35')]=_[_0xc202('0x37')](_0x91785a[_0xc202('0x32')],_0x91785a[_0xc202('0x34')]);_0x1f4bb2[_0xc202('0x36')]=_[_0xc202('0x37')](_0x91785a['model'],qs[_0xc202('0x38')](_0x865cd1[_0xc202('0x34')][_0xc202('0x38')]));_0x1f4bb2['attributes']=_0x1f4bb2['attributes']['length']?_0x1f4bb2[_0xc202('0x36')]:_0x91785a[_0xc202('0x32')];if(_0x865cd1[_0xc202('0x34')][_0xc202('0x49')]){_0x1f4bb2[_0xc202('0x43')]=[{'all':!![]}];}_0x1f4bb2=_[_0xc202('0x40')]({},_0x1f4bb2,_0x865cd1[_0xc202('0x42')]);return db[_0xc202('0x2d')][_0xc202('0x4a')](_0x1f4bb2)[_0xc202('0x28')](handleEntityNotFound(_0x2de657,null))[_0xc202('0x28')](respondWithResult(_0x2de657,null))[_0xc202('0x46')](handleError(_0x2de657,null));};exports[_0xc202('0x4b')]=function(_0x5220a2,_0x33e70c){return db[_0xc202('0x2d')]['create'](_0x5220a2[_0xc202('0x4c')],{})[_0xc202('0x28')](function(_0x2864b6){var _0x28f89f=_0x5220a2[_0xc202('0x4d')]['get']({'plain':!![]});if(!_0x28f89f)throw new Error(_0xc202('0x4e'));if(_0x28f89f['role']===_0xc202('0x4d')){var _0x5f1b99=_0x2864b6[_0xc202('0x26')]({'plain':!![]});var _0x20ffe5='Tags';return db[_0xc202('0x4f')][_0xc202('0x4a')]({'where':{'name':_0x20ffe5,'userProfileId':_0x28f89f['userProfileId']},'raw':!![]})['then'](function(_0x584b46){if(_0x584b46&&_0x584b46[_0xc202('0x50')]===0x0){return db['UserProfileResource'][_0xc202('0x4b')]({'name':_0x5f1b99[_0xc202('0x2a')],'resourceId':_0x5f1b99['id'],'type':_0x584b46[_0xc202('0x2a')],'sectionId':_0x584b46['id']},{})[_0xc202('0x28')](function(){return _0x2864b6;});}else{return _0x2864b6;}})[_0xc202('0x46')](function(_0x26874e){logger[_0xc202('0x51')](_0xc202('0x52'),_0x26874e);throw _0x26874e;});}return _0x2864b6;})[_0xc202('0x28')](respondWithResult(_0x33e70c,0xc9))[_0xc202('0x46')](handleError(_0x33e70c,null));};exports[_0xc202('0x24')]=function(_0x273f3c,_0x320047){if(_0x273f3c['body']['id']){delete _0x273f3c[_0xc202('0x4c')]['id'];}return db['Tag']['find']({'where':{'id':_0x273f3c[_0xc202('0x48')]['id']}})[_0xc202('0x28')](handleEntityNotFound(_0x320047,null))[_0xc202('0x28')](saveUpdates(_0x273f3c['body'],null))[_0xc202('0x28')](respondWithResult(_0x320047,null))['catch'](handleError(_0x320047,null));};exports[_0xc202('0x25')]=function(_0x19fd03,_0x5464ea){return db[_0xc202('0x2d')][_0xc202('0x4a')]({'where':{'id':_0x19fd03['params']['id']}})[_0xc202('0x28')](handleEntityNotFound(_0x5464ea,null))['then'](removeEntity(_0x5464ea,null))[_0xc202('0x46')](handleError(_0x5464ea,null));};
\ No newline at end of file
+var _0x5ff3=['params','rimraf','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','destroy','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','keys','query','intersection','model','attributes','fields','length','nolimit','order','sort','where','filters','filter','merge','options','Tag','include','findAll','catch','show','includeAll','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Tags','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body'];(function(_0x4a5494,_0x3ad336){var _0x57cbb5=function(_0xa5a1ac){while(--_0xa5a1ac){_0x4a5494['push'](_0x4a5494['shift']());}};_0x57cbb5(++_0x3ad336);}(_0x5ff3,0x17d));var _0x35ff=function(_0x5357cd,_0x4622b3){_0x5357cd=_0x5357cd-0x0;var _0x369a7f=_0x5ff3[_0x5357cd];return _0x369a7f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x35ff('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x35ff('0x1'));var rp=require('request-promise');var moment=require(_0x35ff('0x2'));var BPromise=require(_0x35ff('0x3'));var Mustache=require(_0x35ff('0x4'));var util=require(_0x35ff('0x5'));var path=require('path');var sox=require(_0x35ff('0x6'));var csv=require(_0x35ff('0x7'));var ejs=require(_0x35ff('0x8'));var fs=require('fs');var fs_extra=require(_0x35ff('0x9'));var _=require(_0x35ff('0xa'));var squel=require('squel');var crypto=require(_0x35ff('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x35ff('0xc'));var toCsv=require(_0x35ff('0x7'));var querystring=require(_0x35ff('0xd'));var Papa=require('papaparse');var Redis=require(_0x35ff('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x35ff('0xf'));var as=require(_0x35ff('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x35ff('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x35ff('0x12'))['db'];function respondWithStatusCode(_0x3c5f4b,_0x5bda40){_0x5bda40=_0x5bda40||0xcc;return function(_0x842930){if(_0x842930){return _0x3c5f4b['sendStatus'](_0x5bda40);}return _0x3c5f4b[_0x35ff('0x13')](_0x5bda40)[_0x35ff('0x14')]();};}function respondWithResult(_0x3db454,_0x4d1d41){_0x4d1d41=_0x4d1d41||0xc8;return function(_0xff8ac){if(_0xff8ac){return _0x3db454[_0x35ff('0x13')](_0x4d1d41)[_0x35ff('0x15')](_0xff8ac);}};}function respondWithFilteredResult(_0x3e24dd,_0x438199){return function(_0x3dff65){if(_0x3dff65){var _0x2d4a88=typeof _0x438199[_0x35ff('0x16')]===_0x35ff('0x17')&&typeof _0x438199[_0x35ff('0x18')]===_0x35ff('0x17');var _0x3430e2=_0x3dff65[_0x35ff('0x19')];var _0x16c803=_0x2d4a88?0x0:_0x438199[_0x35ff('0x16')];var _0x5f470e=_0x2d4a88?_0x3dff65[_0x35ff('0x19')]:_0x438199[_0x35ff('0x16')]+_0x438199[_0x35ff('0x18')];var _0x1c0d8c;if(_0x5f470e>=_0x3430e2){_0x5f470e=_0x3430e2;_0x1c0d8c=0xc8;}else{_0x1c0d8c=0xce;}_0x3e24dd['status'](_0x1c0d8c);return _0x3e24dd['set'](_0x35ff('0x1a'),_0x16c803+'-'+_0x5f470e+'/'+_0x3430e2)[_0x35ff('0x15')](_0x3dff65);}return null;};}function patchUpdates(_0x4c8dd4){return function(_0x238f65){try{jsonpatch[_0x35ff('0x1b')](_0x238f65,_0x4c8dd4,!![]);}catch(_0x3a87bc){return BPromise[_0x35ff('0x1c')](_0x3a87bc);}return _0x238f65['save']();};}function saveUpdates(_0x3d60b4,_0x55274b){return function(_0x7cc20a){if(_0x7cc20a){return _0x7cc20a[_0x35ff('0x1d')](_0x3d60b4)[_0x35ff('0x1e')](function(_0x16a5a0){return _0x16a5a0;});}return null;};}function removeEntity(_0x396cc2,_0x2b3782){return function(_0x347cec){if(_0x347cec){return _0x347cec['destroy']()[_0x35ff('0x1e')](function(){var _0x2ffcb=_0x347cec['get']({'plain':!![]});var _0x426e4e='Tags';return db['UserProfileResource'][_0x35ff('0x1f')]({'where':{'type':_0x426e4e,'resourceId':_0x2ffcb['id']}})[_0x35ff('0x1e')](function(){return _0x347cec;});})[_0x35ff('0x1e')](function(){_0x396cc2[_0x35ff('0x13')](0xcc)[_0x35ff('0x14')]();});}};}function handleEntityNotFound(_0x546ec0,_0x2bdba4){return function(_0x412873){if(!_0x412873){_0x546ec0[_0x35ff('0x20')](0x194);}return _0x412873;};}function handleError(_0x5e191b,_0x3357a){_0x3357a=_0x3357a||0x1f4;return function(_0x1f51c5){logger[_0x35ff('0x21')](_0x1f51c5[_0x35ff('0x22')]);if(_0x1f51c5[_0x35ff('0x23')]){delete _0x1f51c5[_0x35ff('0x23')];}_0x5e191b[_0x35ff('0x13')](_0x3357a)[_0x35ff('0x24')](_0x1f51c5);};}exports[_0x35ff('0x25')]=function(_0x47d8fa,_0x3f9440){var _0x57339d={},_0x1cb370={},_0x257501={'count':0x0,'rows':[]};var _0x2bc118=_[_0x35ff('0x26')](db['Tag'][_0x35ff('0x27')],function(_0x5de349){return{'name':_0x5de349[_0x35ff('0x28')],'type':_0x5de349[_0x35ff('0x29')]['key']};});_0x1cb370['model']=_[_0x35ff('0x26')](_0x2bc118,_0x35ff('0x23'));_0x1cb370['query']=_[_0x35ff('0x2a')](_0x47d8fa[_0x35ff('0x2b')]);_0x1cb370['filters']=_[_0x35ff('0x2c')](_0x1cb370[_0x35ff('0x2d')],_0x1cb370[_0x35ff('0x2b')]);_0x57339d[_0x35ff('0x2e')]=_[_0x35ff('0x2c')](_0x1cb370[_0x35ff('0x2d')],qs[_0x35ff('0x2f')](_0x47d8fa[_0x35ff('0x2b')][_0x35ff('0x2f')]));_0x57339d[_0x35ff('0x2e')]=_0x57339d[_0x35ff('0x2e')][_0x35ff('0x30')]?_0x57339d[_0x35ff('0x2e')]:_0x1cb370['model'];if(!_0x47d8fa[_0x35ff('0x2b')]['hasOwnProperty'](_0x35ff('0x31'))){_0x57339d[_0x35ff('0x18')]=qs[_0x35ff('0x18')](_0x47d8fa[_0x35ff('0x2b')][_0x35ff('0x18')]);_0x57339d['offset']=qs[_0x35ff('0x16')](_0x47d8fa[_0x35ff('0x2b')][_0x35ff('0x16')]);}_0x57339d[_0x35ff('0x32')]=qs[_0x35ff('0x33')](_0x47d8fa['query'][_0x35ff('0x33')]);_0x57339d[_0x35ff('0x34')]=qs[_0x35ff('0x35')](_['pick'](_0x47d8fa['query'],_0x1cb370[_0x35ff('0x35')]),_0x2bc118);if(_0x47d8fa[_0x35ff('0x2b')][_0x35ff('0x36')]){_0x57339d[_0x35ff('0x34')]=_[_0x35ff('0x37')](_0x57339d[_0x35ff('0x34')],{'$or':_[_0x35ff('0x26')](_0x2bc118,function(_0x368f7c){if(_0x368f7c['type']!=='VIRTUAL'){var _0x550c09={};_0x550c09[_0x368f7c[_0x35ff('0x23')]]={'$like':'%'+_0x47d8fa[_0x35ff('0x2b')][_0x35ff('0x36')]+'%'};return _0x550c09;}})});}_0x57339d=_[_0x35ff('0x37')]({},_0x57339d,_0x47d8fa[_0x35ff('0x38')]);var _0x59c398={'where':_0x57339d[_0x35ff('0x34')]};return db[_0x35ff('0x39')][_0x35ff('0x19')](_0x59c398)[_0x35ff('0x1e')](function(_0x117ee6){_0x257501[_0x35ff('0x19')]=_0x117ee6;if(_0x47d8fa['query']['includeAll']){_0x57339d[_0x35ff('0x3a')]=[{'all':!![]}];}return db[_0x35ff('0x39')][_0x35ff('0x3b')](_0x57339d);})[_0x35ff('0x1e')](function(_0x4b1e3e){_0x257501['rows']=_0x4b1e3e;return _0x257501;})[_0x35ff('0x1e')](respondWithFilteredResult(_0x3f9440,_0x57339d))[_0x35ff('0x3c')](handleError(_0x3f9440,null));};exports[_0x35ff('0x3d')]=function(_0x1cd2c8,_0xb1f6ca){var _0x2ff794={'raw':!![],'where':{'id':_0x1cd2c8['params']['id']}},_0x346758={};_0x346758['model']=_[_0x35ff('0x2a')](db[_0x35ff('0x39')][_0x35ff('0x27')]);_0x346758['query']=_[_0x35ff('0x2a')](_0x1cd2c8[_0x35ff('0x2b')]);_0x346758['filters']=_['intersection'](_0x346758[_0x35ff('0x2d')],_0x346758['query']);_0x2ff794[_0x35ff('0x2e')]=_[_0x35ff('0x2c')](_0x346758['model'],qs[_0x35ff('0x2f')](_0x1cd2c8['query']['fields']));_0x2ff794[_0x35ff('0x2e')]=_0x2ff794[_0x35ff('0x2e')][_0x35ff('0x30')]?_0x2ff794[_0x35ff('0x2e')]:_0x346758[_0x35ff('0x2d')];if(_0x1cd2c8[_0x35ff('0x2b')][_0x35ff('0x3e')]){_0x2ff794[_0x35ff('0x3a')]=[{'all':!![]}];}_0x2ff794=_[_0x35ff('0x37')]({},_0x2ff794,_0x1cd2c8[_0x35ff('0x38')]);return db[_0x35ff('0x39')][_0x35ff('0x3f')](_0x2ff794)['then'](handleEntityNotFound(_0xb1f6ca,null))[_0x35ff('0x1e')](respondWithResult(_0xb1f6ca,null))[_0x35ff('0x3c')](handleError(_0xb1f6ca,null));};exports[_0x35ff('0x40')]=function(_0x2d26e2,_0x506def){return db['Tag'][_0x35ff('0x40')](_0x2d26e2['body'],{})[_0x35ff('0x1e')](function(_0x2caefe){var _0x14aa90=_0x2d26e2[_0x35ff('0x41')][_0x35ff('0x42')]({'plain':!![]});if(!_0x14aa90)throw new Error(_0x35ff('0x43'));if(_0x14aa90[_0x35ff('0x44')]===_0x35ff('0x41')){var _0x3be5fc=_0x2caefe['get']({'plain':!![]});var _0x48e22b=_0x35ff('0x45');return db['UserProfileSection'][_0x35ff('0x3f')]({'where':{'name':_0x48e22b,'userProfileId':_0x14aa90[_0x35ff('0x46')]},'raw':!![]})[_0x35ff('0x1e')](function(_0x255bdc){if(_0x255bdc&&_0x255bdc[_0x35ff('0x47')]===0x0){return db[_0x35ff('0x48')][_0x35ff('0x40')]({'name':_0x3be5fc[_0x35ff('0x23')],'resourceId':_0x3be5fc['id'],'type':_0x255bdc[_0x35ff('0x23')],'sectionId':_0x255bdc['id']},{})['then'](function(){return _0x2caefe;});}else{return _0x2caefe;}})[_0x35ff('0x3c')](function(_0x39b65f){logger[_0x35ff('0x21')](_0x35ff('0x49'),_0x39b65f);throw _0x39b65f;});}return _0x2caefe;})['then'](respondWithResult(_0x506def,0xc9))['catch'](handleError(_0x506def,null));};exports['update']=function(_0x211bb2,_0x5b410d){if(_0x211bb2[_0x35ff('0x4a')]['id']){delete _0x211bb2['body']['id'];}return db[_0x35ff('0x39')]['find']({'where':{'id':_0x211bb2[_0x35ff('0x4b')]['id']}})['then'](handleEntityNotFound(_0x5b410d,null))[_0x35ff('0x1e')](saveUpdates(_0x211bb2[_0x35ff('0x4a')],null))[_0x35ff('0x1e')](respondWithResult(_0x5b410d,null))[_0x35ff('0x3c')](handleError(_0x5b410d,null));};exports['destroy']=function(_0x497b38,_0x2be86b){return db['Tag'][_0x35ff('0x3f')]({'where':{'id':_0x497b38[_0x35ff('0x4b')]['id']}})['then'](handleEntityNotFound(_0x2be86b,null))[_0x35ff('0x1e')](removeEntity(_0x2be86b,null))['catch'](handleError(_0x2be86b,null));};
\ No newline at end of file
index d15afe7..262d72d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2ab6=['path','rimraf','../../config/environment','./tag.attributes','exports','define','Tag','tools_tags','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x2ab6,0x19e));var _0x62ab=function(_0x2cbc93,_0x2f8acd){_0x2cbc93=_0x2cbc93-0x0;var _0x5a6476=_0x2ab6[_0x2cbc93];return _0x5a6476;};'use strict';var _=require(_0x62ab('0x0'));var util=require('util');var logger=require(_0x62ab('0x1'))(_0x62ab('0x2'));var moment=require(_0x62ab('0x3'));var BPromise=require(_0x62ab('0x4'));var rp=require(_0x62ab('0x5'));var fs=require('fs');var path=require(_0x62ab('0x6'));var rimraf=require(_0x62ab('0x7'));var config=require(_0x62ab('0x8'));var attributes=require(_0x62ab('0x9'));module[_0x62ab('0xa')]=function(_0x5bfeb5,_0x19b615){return _0x5bfeb5[_0x62ab('0xb')](_0x62ab('0xc'),attributes,{'tableName':_0x62ab('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8dcd=['api','rimraf','../../config/environment','./tag.attributes','exports','define','Tag','tools_tags','lodash','util','../../config/logger'];(function(_0x2baa70,_0x6cec74){var _0x455a00=function(_0x4f9f40){while(--_0x4f9f40){_0x2baa70['push'](_0x2baa70['shift']());}};_0x455a00(++_0x6cec74);}(_0x8dcd,0xce));var _0xd8dc=function(_0x19ed91,_0x561c98){_0x19ed91=_0x19ed91-0x0;var _0x2f50b7=_0x8dcd[_0x19ed91];return _0x2f50b7;};'use strict';var _=require(_0xd8dc('0x0'));var util=require(_0xd8dc('0x1'));var logger=require(_0xd8dc('0x2'))(_0xd8dc('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(_0xd8dc('0x4'));var config=require(_0xd8dc('0x5'));var attributes=require(_0xd8dc('0x6'));module[_0xd8dc('0x7')]=function(_0x5330f2,_0x581a5c){return _0x5330f2[_0xd8dc('0x8')](_0xd8dc('0x9'),attributes,{'tableName':_0xd8dc('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index e756452..0c6ea83 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','Tag,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x2534b5,_0x46d576){var _0x58212c=function(_0x4c3872){while(--_0x4c3872){_0x2534b5['push'](_0x2534b5['shift']());}};_0x58212c(++_0x46d576);}(_0x84ab,0x12f));var _0xb84a=function(_0x352d28,_0x444033){_0x352d28=_0x352d28-0x0;var _0x387d7e=_0x84ab[_0x352d28];return _0x387d7e;};'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']('Tag,\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')]('Tag,\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 _0x9221=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','Tag,\x20%s,\x20%s','debug','Tag,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','util','moment','randomstring','ioredis','../../config/utils'];(function(_0x2d7333,_0x52e151){var _0x2e4005=function(_0x26bbad){while(--_0x26bbad){_0x2d7333['push'](_0x2d7333['shift']());}};_0x2e4005(++_0x52e151);}(_0x9221,0x64));var _0x1922=function(_0x347471,_0x1c9a02){_0x347471=_0x347471-0x0;var _0x422b6a=_0x9221[_0x347471];return _0x422b6a;};'use strict';var _=require('lodash');var util=require(_0x1922('0x0'));var moment=require(_0x1922('0x1'));var BPromise=require('bluebird');var rs=require(_0x1922('0x2'));var fs=require('fs');var Redis=require(_0x1922('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1922('0x4'));var logger=require(_0x1922('0x5'))(_0x1922('0x6'));var config=require(_0x1922('0x7'));var jayson=require(_0x1922('0x8'));var client=jayson[_0x1922('0x9')][_0x1922('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5aa05c,_0x116227,_0x3cfd98){return new BPromise(function(_0x195fa4,_0x47c225){return client[_0x1922('0xb')](_0x5aa05c,_0x3cfd98)['then'](function(_0x2b6c51){logger[_0x1922('0xc')](_0x1922('0xd'),_0x116227,'request\x20sent');logger[_0x1922('0xe')](_0x1922('0xf'),_0x116227,'request\x20sent',JSON[_0x1922('0x10')](_0x2b6c51));if(_0x2b6c51['error']){if(_0x2b6c51[_0x1922('0x11')]['code']===0x1f4){logger[_0x1922('0x11')](_0x1922('0xd'),_0x116227,_0x2b6c51[_0x1922('0x11')]['message']);return _0x47c225(_0x2b6c51['error'][_0x1922('0x12')]);}logger[_0x1922('0x11')](_0x1922('0xd'),_0x116227,_0x2b6c51[_0x1922('0x11')][_0x1922('0x12')]);return _0x195fa4(_0x2b6c51['error'][_0x1922('0x12')]);}else{logger['info'](_0x1922('0xd'),_0x116227,_0x1922('0x13'));_0x195fa4(_0x2b6c51[_0x1922('0x14')][_0x1922('0x12')]);}})['catch'](function(_0x459511){logger[_0x1922('0x11')](_0x1922('0xd'),_0x116227,_0x459511);_0x47c225(_0x459511);});});}
\ No newline at end of file
index 330632c..aadd2d3 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(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xa9e0[_0x6c993a];return _0x27f547;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('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(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0xa9e0[_0x5447fd];return _0x15b28a;};'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 3cec1bd..d4beedf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb7e7=['STRING','sequelize'];(function(_0x946518,_0x22816f){var _0x909b69=function(_0x2fa5a4){while(--_0x2fa5a4){_0x946518['push'](_0x946518['shift']());}};_0x909b69(++_0x22816f);}(_0xb7e7,0x121));var _0x7b7e=function(_0x34843e,_0x4c4224){_0x34843e=_0x34843e-0x0;var _0x598f7f=_0xb7e7[_0x34843e];return _0x598f7f;};'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 _0x757a=['exports','STRING'];(function(_0x410124,_0x8d7d47){var _0x5650b7=function(_0x148d69){while(--_0x148d69){_0x410124['push'](_0x410124['shift']());}};_0x5650b7(++_0x8d7d47);}(_0x757a,0xde));var _0xa757=function(_0x18161b,_0x5b8ef1){_0x18161b=_0x18161b-0x0;var _0x5351f3=_0x757a[_0x18161b];return _0x5351f3;};'use strict';var Sequelize=require('sequelize');module[_0xa757('0x0')]={'name':{'type':Sequelize[_0xa757('0x1')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 6d02e15..6c2d031 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8cf7=['hasOwnProperty','order','sort','where','filter','merge','map','options','Team','includeAll','include','findAll','rows','show','params','intersection','find','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Teams','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','sequelize','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','Sequelize','UserId','QueryTypes','UserVoiceQueue','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','SELECT','MailQueueId','UserMailQueue','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SmsQueueId','UserSmsQueue','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','ChatQueueId','UserChatQueue','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','OpenchannelQueueId','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','UserWhatsappQueue','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','sendStatus','send','findOne','channel','ValidationError','Unknown\x20channel','toLowerCase','Queue','capitalize','Queues','addQueues','isValidChannel','add','removeQueues','ids','isArray','Voice','Chat','Mail','Sms','Fax','Whatsapp','transaction','QueueId','TeamVoiceQueue','penalty','User','findOrCreate','Queue:save','online','voicePause','interface','UserVoiceQueueRt','upsert','isNil','format','all','addAgents','spread','removeAgents','Openchannel','Queue:remove','getAgents','pick','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./team.socket','register','end','status','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','error','stack','name','index','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','fields','length'];(function(_0x16d10f,_0x2ba2d5){var _0x50c823=function(_0x44e43f){while(--_0x44e43f){_0x16d10f['push'](_0x16d10f['shift']());}};_0x50c823(++_0x2ba2d5);}(_0x8cf7,0x1a7));var _0x78cf=function(_0x5d32d5,_0x4bf9b3){_0x5d32d5=_0x5d32d5-0x0;var _0x3dea93=_0x8cf7[_0x5d32d5];return _0x3dea93;};'use strict';var emlformat=require(_0x78cf('0x0'));var rimraf=require(_0x78cf('0x1'));var zipdir=require(_0x78cf('0x2'));var jsonpatch=require(_0x78cf('0x3'));var rp=require(_0x78cf('0x4'));var moment=require(_0x78cf('0x5'));var BPromise=require(_0x78cf('0x6'));var Mustache=require(_0x78cf('0x7'));var util=require('util');var path=require(_0x78cf('0x8'));var sox=require('sox');var csv=require(_0x78cf('0x9'));var ejs=require(_0x78cf('0xa'));var fs=require('fs');var fs_extra=require(_0x78cf('0xb'));var _=require(_0x78cf('0xc'));var squel=require(_0x78cf('0xd'));var crypto=require('crypto');var jsforce=require(_0x78cf('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x78cf('0x9'));var querystring=require(_0x78cf('0xf'));var Papa=require(_0x78cf('0x10'));var Redis=require(_0x78cf('0x11'));var authService=require(_0x78cf('0x12'));var qs=require(_0x78cf('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x78cf('0x14'));var logger=require(_0x78cf('0x15'))(_0x78cf('0x16'));var utils=require(_0x78cf('0x17'));var config=require(_0x78cf('0x18'));var licenseUtil=require(_0x78cf('0x19'));var db=require(_0x78cf('0x1a'))['db'];config[_0x78cf('0x1b')]=_['defaults'](config[_0x78cf('0x1b')],{'host':_0x78cf('0x1c'),'port':0x18eb});var socket=require(_0x78cf('0x1d'))(new Redis(config[_0x78cf('0x1b')]));require(_0x78cf('0x1e'))[_0x78cf('0x1f')](socket);function respondWithStatusCode(_0x3b1848,_0x4d04d1){_0x4d04d1=_0x4d04d1||0xcc;return function(_0x304467){if(_0x304467){return _0x3b1848['sendStatus'](_0x4d04d1);}return _0x3b1848['status'](_0x4d04d1)[_0x78cf('0x20')]();};}function respondWithResult(_0x6d1d16,_0x3258cd){_0x3258cd=_0x3258cd||0xc8;return function(_0x28b785){if(_0x28b785){return _0x6d1d16[_0x78cf('0x21')](_0x3258cd)[_0x78cf('0x22')](_0x28b785);}};}function respondWithFilteredResult(_0x54b500,_0x300be3){return function(_0x3cd587){if(_0x3cd587){var _0x495f1a=typeof _0x300be3['offset']===_0x78cf('0x23')&&typeof _0x300be3[_0x78cf('0x24')]===_0x78cf('0x23');var _0x508acd=_0x3cd587[_0x78cf('0x25')];var _0x1e53d7=_0x495f1a?0x0:_0x300be3['offset'];var _0x8d0e5=_0x495f1a?_0x3cd587[_0x78cf('0x25')]:_0x300be3[_0x78cf('0x26')]+_0x300be3[_0x78cf('0x24')];var _0x2cdcc2;if(_0x8d0e5>=_0x508acd){_0x8d0e5=_0x508acd;_0x2cdcc2=0xc8;}else{_0x2cdcc2=0xce;}_0x54b500[_0x78cf('0x21')](_0x2cdcc2);return _0x54b500['set'](_0x78cf('0x27'),_0x1e53d7+'-'+_0x8d0e5+'/'+_0x508acd)['json'](_0x3cd587);}return null;};}function patchUpdates(_0x2f1dc9){return function(_0x238d52){try{jsonpatch[_0x78cf('0x28')](_0x238d52,_0x2f1dc9,!![]);}catch(_0x394423){return BPromise[_0x78cf('0x29')](_0x394423);}return _0x238d52[_0x78cf('0x2a')]();};}function saveUpdates(_0x1543e0,_0x8cde4f){return function(_0x524750){if(_0x524750){return _0x524750[_0x78cf('0x2b')](_0x1543e0)[_0x78cf('0x2c')](function(_0x3c83c0){return _0x3c83c0;});}return null;};}function handleEntityNotFound(_0xfe36be,_0x25baec){return function(_0x4153f0){if(!_0x4153f0){_0xfe36be['sendStatus'](0x194);}return _0x4153f0;};}function handleError(_0x443434,_0x3bc727){_0x3bc727=_0x3bc727||0x1f4;return function(_0x442fa5){logger[_0x78cf('0x2d')](_0x442fa5[_0x78cf('0x2e')]);if(_0x442fa5[_0x78cf('0x2f')]){delete _0x442fa5['name'];}_0x443434[_0x78cf('0x21')](_0x3bc727)['send'](_0x442fa5);};}exports[_0x78cf('0x30')]=function(_0x24d8eb,_0x5a9304){var _0x43f36e={},_0x4715f8={},_0x424e80={'count':0x0,'rows':[]};var _0x854aed=_['map'](db['Team'][_0x78cf('0x31')],function(_0x59331d){return{'name':_0x59331d[_0x78cf('0x32')],'type':_0x59331d[_0x78cf('0x33')][_0x78cf('0x34')]};});_0x4715f8['model']=_['map'](_0x854aed,_0x78cf('0x2f'));_0x4715f8[_0x78cf('0x35')]=_[_0x78cf('0x36')](_0x24d8eb[_0x78cf('0x35')]);_0x4715f8[_0x78cf('0x37')]=_['intersection'](_0x4715f8[_0x78cf('0x38')],_0x4715f8[_0x78cf('0x35')]);_0x43f36e[_0x78cf('0x39')]=_['intersection'](_0x4715f8[_0x78cf('0x38')],qs[_0x78cf('0x3a')](_0x24d8eb[_0x78cf('0x35')][_0x78cf('0x3a')]));_0x43f36e[_0x78cf('0x39')]=_0x43f36e[_0x78cf('0x39')][_0x78cf('0x3b')]?_0x43f36e[_0x78cf('0x39')]:_0x4715f8[_0x78cf('0x38')];if(!_0x24d8eb[_0x78cf('0x35')][_0x78cf('0x3c')]('nolimit')){_0x43f36e[_0x78cf('0x24')]=qs[_0x78cf('0x24')](_0x24d8eb[_0x78cf('0x35')][_0x78cf('0x24')]);_0x43f36e[_0x78cf('0x26')]=qs[_0x78cf('0x26')](_0x24d8eb[_0x78cf('0x35')][_0x78cf('0x26')]);}_0x43f36e[_0x78cf('0x3d')]=qs[_0x78cf('0x3e')](_0x24d8eb['query']['sort']);_0x43f36e[_0x78cf('0x3f')]=qs[_0x78cf('0x37')](_['pick'](_0x24d8eb['query'],_0x4715f8[_0x78cf('0x37')]),_0x854aed);if(_0x24d8eb['query'][_0x78cf('0x40')]){_0x43f36e[_0x78cf('0x3f')]=_[_0x78cf('0x41')](_0x43f36e[_0x78cf('0x3f')],{'$or':_[_0x78cf('0x42')](_0x854aed,function(_0x5a391c){if(_0x5a391c[_0x78cf('0x33')]!=='VIRTUAL'){var _0x560fb1={};_0x560fb1[_0x5a391c['name']]={'$like':'%'+_0x24d8eb['query'][_0x78cf('0x40')]+'%'};return _0x560fb1;}})});}_0x43f36e=_[_0x78cf('0x41')]({},_0x43f36e,_0x24d8eb[_0x78cf('0x43')]);var _0x39225d={'where':_0x43f36e[_0x78cf('0x3f')]};return db[_0x78cf('0x44')][_0x78cf('0x25')](_0x39225d)[_0x78cf('0x2c')](function(_0x45da82){_0x424e80[_0x78cf('0x25')]=_0x45da82;if(_0x24d8eb[_0x78cf('0x35')][_0x78cf('0x45')]){_0x43f36e[_0x78cf('0x46')]=[{'all':!![]}];}return db[_0x78cf('0x44')][_0x78cf('0x47')](_0x43f36e);})['then'](function(_0x37386c){_0x424e80[_0x78cf('0x48')]=_0x37386c;return _0x424e80;})[_0x78cf('0x2c')](respondWithFilteredResult(_0x5a9304,_0x43f36e))['catch'](handleError(_0x5a9304,null));};exports[_0x78cf('0x49')]=function(_0x5a50e7,_0x4bf005){var _0x3e8db5={'raw':![],'where':{'id':_0x5a50e7[_0x78cf('0x4a')]['id']}},_0x37a64c={};_0x37a64c['model']=_['keys'](db[_0x78cf('0x44')][_0x78cf('0x31')]);_0x37a64c[_0x78cf('0x35')]=_[_0x78cf('0x36')](_0x5a50e7['query']);_0x37a64c[_0x78cf('0x37')]=_[_0x78cf('0x4b')](_0x37a64c[_0x78cf('0x38')],_0x37a64c[_0x78cf('0x35')]);_0x3e8db5[_0x78cf('0x39')]=_[_0x78cf('0x4b')](_0x37a64c[_0x78cf('0x38')],qs[_0x78cf('0x3a')](_0x5a50e7[_0x78cf('0x35')][_0x78cf('0x3a')]));_0x3e8db5['attributes']=_0x3e8db5[_0x78cf('0x39')][_0x78cf('0x3b')]?_0x3e8db5[_0x78cf('0x39')]:_0x37a64c[_0x78cf('0x38')];if(_0x5a50e7[_0x78cf('0x35')][_0x78cf('0x45')]){_0x3e8db5[_0x78cf('0x46')]=[{'all':!![]}];}_0x3e8db5=_[_0x78cf('0x41')]({},_0x3e8db5,_0x5a50e7[_0x78cf('0x43')]);return db[_0x78cf('0x44')][_0x78cf('0x4c')](_0x3e8db5)['then'](handleEntityNotFound(_0x4bf005,null))[_0x78cf('0x2c')](respondWithResult(_0x4bf005,null))[_0x78cf('0x4d')](handleError(_0x4bf005,null));};exports[_0x78cf('0x4e')]=function(_0x4ee343,_0x47990e){return db[_0x78cf('0x44')]['create'](_0x4ee343[_0x78cf('0x4f')],{})[_0x78cf('0x2c')](function(_0x3bd5dc){var _0x41691c=_0x4ee343[_0x78cf('0x50')][_0x78cf('0x51')]({'plain':!![]});if(!_0x41691c)throw new Error(_0x78cf('0x52'));if(_0x41691c[_0x78cf('0x53')]===_0x78cf('0x50')){var _0x4e11a9=_0x3bd5dc[_0x78cf('0x51')]({'plain':!![]});var _0x48163c=_0x78cf('0x54');return db[_0x78cf('0x55')]['find']({'where':{'name':_0x48163c,'userProfileId':_0x41691c[_0x78cf('0x56')]},'raw':!![]})['then'](function(_0x362da5){if(_0x362da5&&_0x362da5[_0x78cf('0x57')]===0x0){return db[_0x78cf('0x58')][_0x78cf('0x4e')]({'name':_0x4e11a9['name'],'resourceId':_0x4e11a9['id'],'type':_0x362da5[_0x78cf('0x2f')],'sectionId':_0x362da5['id']},{})[_0x78cf('0x2c')](function(){return _0x3bd5dc;});}else{return _0x3bd5dc;}})[_0x78cf('0x4d')](function(_0x1569c3){logger[_0x78cf('0x2d')](_0x78cf('0x59'),_0x1569c3);throw _0x1569c3;});}return _0x3bd5dc;})[_0x78cf('0x2c')](respondWithResult(_0x47990e,0xc9))['catch'](handleError(_0x47990e,null));};exports[_0x78cf('0x2b')]=function(_0x4310b9,_0x7aa38a){if(_0x4310b9[_0x78cf('0x4f')]['id']){delete _0x4310b9[_0x78cf('0x4f')]['id'];}return db[_0x78cf('0x44')][_0x78cf('0x4c')]({'where':{'id':_0x4310b9[_0x78cf('0x4a')]['id']}})['then'](handleEntityNotFound(_0x7aa38a,null))[_0x78cf('0x2c')](saveUpdates(_0x4310b9[_0x78cf('0x4f')],null))['then'](respondWithResult(_0x7aa38a,null))[_0x78cf('0x4d')](handleError(_0x7aa38a,null));};exports[_0x78cf('0x5a')]=function(_0x2b069a,_0x11b996){var _0x13a5df=_0x2b069a[_0x78cf('0x4a')]['id'];var _0x35451b=[];return db[_0x78cf('0x5b')]['transaction'](function(_0xf80a01){var _0x593610=_0x78cf('0x5c')+_0x13a5df;return db['sequelize']['query'](_0x593610,{'type':db[_0x78cf('0x5d')]['QueryTypes']['SELECT'],'raw':!![],'transaction':_0xf80a01})[_0x78cf('0x2c')](function(_0x3721f5){_0x35451b=_[_0x78cf('0x42')](_0x3721f5,function(_0x271fcb){return Number(_0x271fcb[_0x78cf('0x5e')]);});})[_0x78cf('0x2c')](function(){var _0x344281='SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20'+_0x13a5df;return db[_0x78cf('0x5b')][_0x78cf('0x35')](_0x344281,{'type':db[_0x78cf('0x5d')][_0x78cf('0x5f')]['SELECT'],'raw':!![],'transaction':_0xf80a01});})['then'](function(_0x16161e){var _0x4acfaa=_[_0x78cf('0x42')](_0x16161e,function(_0x21a823){return Number(_0x21a823['VoiceQueueId']);});return db[_0x78cf('0x60')][_0x78cf('0x5a')]({'where':{'UserId':{'$in':_0x35451b},'VoiceQueueId':{'$in':_0x4acfaa}},'transaction':_0xf80a01});})[_0x78cf('0x2c')](function(){var _0x40989a=_0x78cf('0x61')+_0x13a5df;return db[_0x78cf('0x5b')][_0x78cf('0x35')](_0x40989a,{'type':db['Sequelize']['QueryTypes'][_0x78cf('0x62')],'raw':!![],'transaction':_0xf80a01});})[_0x78cf('0x2c')](function(_0x5d41f8){var _0x249e19=_[_0x78cf('0x42')](_0x5d41f8,function(_0xcdd28e){return Number(_0xcdd28e[_0x78cf('0x63')]);});return db[_0x78cf('0x64')][_0x78cf('0x5a')]({'where':{'UserId':{'$in':_0x35451b},'MailQueueId':{'$in':_0x249e19}},'transaction':_0xf80a01});})['then'](function(){var _0x4aca4a=_0x78cf('0x65')+_0x13a5df;return db[_0x78cf('0x5b')]['query'](_0x4aca4a,{'type':db[_0x78cf('0x5d')][_0x78cf('0x5f')][_0x78cf('0x62')],'raw':!![],'transaction':_0xf80a01});})[_0x78cf('0x2c')](function(_0x36aeaf){var _0x20f020=_[_0x78cf('0x42')](_0x36aeaf,function(_0x15fcfa){return Number(_0x15fcfa[_0x78cf('0x66')]);});return db[_0x78cf('0x67')][_0x78cf('0x5a')]({'where':{'UserId':{'$in':_0x35451b},'SmsQueueId':{'$in':_0x20f020}},'transaction':_0xf80a01});})[_0x78cf('0x2c')](function(){var _0x3e5911=_0x78cf('0x68')+_0x13a5df;return db[_0x78cf('0x5b')][_0x78cf('0x35')](_0x3e5911,{'type':db[_0x78cf('0x5d')][_0x78cf('0x5f')][_0x78cf('0x62')],'raw':!![],'transaction':_0xf80a01});})['then'](function(_0x4baaf4){var _0x51f74e=_['map'](_0x4baaf4,function(_0x365e7d){return Number(_0x365e7d[_0x78cf('0x69')]);});return db[_0x78cf('0x6a')][_0x78cf('0x5a')]({'where':{'UserId':{'$in':_0x35451b},'ChatQueueId':{'$in':_0x51f74e}},'transaction':_0xf80a01});})[_0x78cf('0x2c')](function(){var _0x3fc68e='SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20'+_0x13a5df;return db[_0x78cf('0x5b')][_0x78cf('0x35')](_0x3fc68e,{'type':db[_0x78cf('0x5d')]['QueryTypes'][_0x78cf('0x62')],'raw':!![],'transaction':_0xf80a01});})[_0x78cf('0x2c')](function(_0x200921){var _0x83e919=_[_0x78cf('0x42')](_0x200921,function(_0x234223){return Number(_0x234223['FaxQueueId']);});return db['UserFaxQueue'][_0x78cf('0x5a')]({'where':{'UserId':{'$in':_0x35451b},'FaxQueueId':{'$in':_0x83e919}},'transaction':_0xf80a01});})[_0x78cf('0x2c')](function(){var _0x5533dc=_0x78cf('0x6b')+_0x13a5df;return db[_0x78cf('0x5b')][_0x78cf('0x35')](_0x5533dc,{'type':db[_0x78cf('0x5d')]['QueryTypes']['SELECT'],'raw':!![],'transaction':_0xf80a01});})['then'](function(_0x5334aa){var _0x349787=_[_0x78cf('0x42')](_0x5334aa,function(_0x3dfda9){return Number(_0x3dfda9[_0x78cf('0x6c')]);});return db[_0x78cf('0x6d')][_0x78cf('0x5a')]({'where':{'UserId':{'$in':_0x35451b},'OpenchannelQueueId':{'$in':_0x349787}},'transaction':_0xf80a01});})['then'](function(){var _0x16551e=_0x78cf('0x6e')+_0x13a5df;return db[_0x78cf('0x5b')][_0x78cf('0x35')](_0x16551e,{'type':db[_0x78cf('0x5d')]['QueryTypes'][_0x78cf('0x62')],'raw':!![],'transaction':_0xf80a01});})[_0x78cf('0x2c')](function(_0x5f0eb3){var _0x4bf59d=_['map'](_0x5f0eb3,function(_0x3e298c){return Number(_0x3e298c[_0x78cf('0x6f')]);});return db[_0x78cf('0x70')][_0x78cf('0x5a')]({'where':{'UserId':{'$in':_0x35451b},'WhatsappQueueId':{'$in':_0x4bf59d}},'transaction':_0xf80a01});})[_0x78cf('0x2c')](function(){return db[_0x78cf('0x71')][_0x78cf('0x4c')]({'where':{'TeamId':_0x13a5df}});})['then'](function(_0x2e7915){if(_0x2e7915===null){return;}return db[_0x78cf('0x72')][_0x78cf('0x5a')]({'where':{'UserId':{'$in':_0x35451b},'VoicePrefixId':_0x2e7915[_0x78cf('0x73')]},'transaction':_0xf80a01});})[_0x78cf('0x2c')](function(){return db[_0x78cf('0x44')][_0x78cf('0x5a')]({'where':{'id':_0x13a5df},'cascade':!![],'transaction':_0xf80a01});})['then'](function(_0x41e010){if(_0x41e010===0x0){_0x11b996[_0x78cf('0x74')](0x194);}else{return db[_0x78cf('0x58')][_0x78cf('0x5a')]({'where':{'type':_0x78cf('0x54'),'resourceId':_0x13a5df},'cascade':!![],'transaction':_0xf80a01})[_0x78cf('0x2c')](function(){_0x11b996[_0x78cf('0x21')](0xcc)[_0x78cf('0x20')]();});}})['catch'](function(_0x1b9181){_0x11b996['status'](0x1f4)[_0x78cf('0x75')](_0x1b9181);});});};exports['getQueues']=function(_0x2fd697,_0x2ce240,_0x40ef45){return db[_0x78cf('0x44')][_0x78cf('0x76')]({'where':{'id':_0x2fd697[_0x78cf('0x4a')]['id']}})['then'](handleEntityNotFound(_0x2ce240,null))[_0x78cf('0x2c')](function(_0x3b2a97){if(!_0x2fd697[_0x78cf('0x35')]['channel']||!utils['isValidChannel'](_0x2fd697[_0x78cf('0x35')][_0x78cf('0x77')])){throw new db[(_0x78cf('0x5d'))][(_0x78cf('0x78'))](_0x78cf('0x79'));}var _0x3a2f75={};var _0x47894c={};_0x47894c['model']=_[_0x78cf('0x36')](db[_['capitalize'](_0x2fd697[_0x78cf('0x35')][_0x78cf('0x77')][_0x78cf('0x7a')]())+_0x78cf('0x7b')][_0x78cf('0x31')]);_0x47894c[_0x78cf('0x35')]=_[_0x78cf('0x36')](_0x2fd697[_0x78cf('0x35')]);_0x47894c[_0x78cf('0x37')]=_['intersection'](_0x47894c[_0x78cf('0x38')],_0x47894c[_0x78cf('0x35')]);_0x3a2f75[_0x78cf('0x39')]=_[_0x78cf('0x4b')](_0x47894c[_0x78cf('0x38')],qs[_0x78cf('0x3a')](_0x2fd697[_0x78cf('0x35')][_0x78cf('0x3a')]));_0x3a2f75[_0x78cf('0x39')]=_0x3a2f75[_0x78cf('0x39')][_0x78cf('0x3b')]?_0x3a2f75[_0x78cf('0x39')]:_0x47894c[_0x78cf('0x38')];_0x3a2f75['limit']=qs[_0x78cf('0x24')](_0x2fd697[_0x78cf('0x35')]['limit']);_0x3a2f75[_0x78cf('0x26')]=qs['offset'](_0x2fd697['query'][_0x78cf('0x26')]);_0x3a2f75[_0x78cf('0x3d')]=qs[_0x78cf('0x3e')](_0x2fd697[_0x78cf('0x35')]['sort']);_0x3a2f75['where']=qs[_0x78cf('0x37')](_['pick'](_0x2fd697[_0x78cf('0x35')],_0x47894c[_0x78cf('0x37')]));_0x3a2f75=_[_0x78cf('0x41')]({},_0x3a2f75,_0x2fd697[_0x78cf('0x43')]);return _0x3b2a97[_0x78cf('0x51')+_[_0x78cf('0x7c')](_0x2fd697[_0x78cf('0x35')][_0x78cf('0x77')][_0x78cf('0x7a')]())+_0x78cf('0x7d')](_0x3a2f75);})[_0x78cf('0x2c')](respondWithResult(_0x2ce240,null))[_0x78cf('0x4d')](handleError(_0x2ce240,null));};exports[_0x78cf('0x7e')]=function(_0x5a206e,_0x4d0f28,_0x19bc84){return db['Team'][_0x78cf('0x76')]({'where':{'id':_0x5a206e[_0x78cf('0x4a')]['id']}})[_0x78cf('0x2c')](function(_0x43f60b){if(_0x43f60b){if(!_0x5a206e[_0x78cf('0x4f')]['channel']||!utils[_0x78cf('0x7f')](_0x5a206e['body']['channel'])){throw new db[(_0x78cf('0x5d'))][(_0x78cf('0x78'))](_0x78cf('0x79'));}return _0x43f60b[_0x78cf('0x80')+_[_0x78cf('0x7c')](_0x5a206e['body'][_0x78cf('0x77')]['toLowerCase']())+'Queues'](_0x5a206e['body']['ids']);}return null;})['then'](handleEntityNotFound(_0x4d0f28,null))[_0x78cf('0x2c')](respondWithStatusCode(_0x4d0f28,null))[_0x78cf('0x4d')](handleError(_0x4d0f28,null));};exports[_0x78cf('0x81')]=function(_0x41abdb,_0x4bf994,_0x518a06){return db[_0x78cf('0x44')][_0x78cf('0x76')]({'where':{'id':_0x41abdb[_0x78cf('0x4a')]['id']}})[_0x78cf('0x2c')](function(_0x3c99ca){if(_0x3c99ca){if(!_0x41abdb[_0x78cf('0x35')]['channel']||!utils['isValidChannel'](_0x41abdb['query'][_0x78cf('0x77')])){throw new db[(_0x78cf('0x5d'))]['ValidationError'](_0x78cf('0x79'));}return _0x3c99ca['remove'+_[_0x78cf('0x7c')](_0x41abdb['query'][_0x78cf('0x77')]['toLowerCase']())+_0x78cf('0x7d')](_0x41abdb['query'][_0x78cf('0x82')]);}return null;})[_0x78cf('0x2c')](handleEntityNotFound(_0x4bf994,null))[_0x78cf('0x2c')](respondWithStatusCode(_0x4bf994,null))[_0x78cf('0x4d')](handleError(_0x4bf994,null));};exports['addAgents']=function(_0x31f578,_0x362f30){var _0x37660a=_[_0x78cf('0x83')](_0x31f578[_0x78cf('0x4f')][_0x78cf('0x82')])?_0x31f578[_0x78cf('0x4f')]['ids']:[_0x31f578[_0x78cf('0x4f')][_0x78cf('0x82')]];var _0x2b49f7=_0x31f578[_0x78cf('0x4a')]['id'];return db[_0x78cf('0x44')][_0x78cf('0x4c')]({'where':{'id':_0x2b49f7}})[_0x78cf('0x2c')](handleEntityNotFound(_0x362f30,null))[_0x78cf('0x2c')](function(_0x3f1edb){if(_0x3f1edb){var _0x302e4c=[_0x78cf('0x84'),_0x78cf('0x85'),_0x78cf('0x86'),_0x78cf('0x87'),_0x78cf('0x88'),'Openchannel',_0x78cf('0x89')];return db['sequelize'][_0x78cf('0x8a')](function(_0x5e6a3f){var _0x45509b=_[_0x78cf('0x42')](_0x302e4c,function(_0x1614aa){var _0x38bb8e={'attributes':['id',_0x78cf('0x2f')]};if(_0x1614aa===_0x78cf('0x84')){_0x38bb8e['through']={'attributes':['penalty']};}return _0x3f1edb[_0x78cf('0x51')+_0x1614aa+'Queues'](_0x38bb8e)['then'](function(_0x39e6af){var _0x20cefb=_['map'](_0x39e6af,function(_0x659dc6){var _0x326777=_[_0x78cf('0x42')](_0x37660a,function(_0x1b80c7){var _0xb2d4bf={'where':{'UserId':_0x1b80c7,[_0x1614aa+_0x78cf('0x8b')]:_0x659dc6['id']},'transaction':_0x5e6a3f};if(_0x1614aa===_0x78cf('0x84')){_0xb2d4bf['defaults']={'penalty':_0x659dc6[_0x78cf('0x8c')][_0x78cf('0x8d')]};}return db[_0x78cf('0x8e')+_0x1614aa+_0x78cf('0x7b')][_0x78cf('0x8f')](_0xb2d4bf)['then'](function(){socket['emit']('user'+_0x1614aa+_0x78cf('0x90'),{'UserId':_0x1b80c7,[_0x1614aa+'QueueId']:_0x659dc6['id']});if(_0x1614aa!==_0x78cf('0x84')){return;}return db['User'][_0x78cf('0x47')]({'where':{'id':_0x37660a,'online':0x1},'attributes':['id','name',_0x78cf('0x91'),_0x78cf('0x92'),_0x78cf('0x93')],'raw':!![]})[_0x78cf('0x2c')](function(_0x49549c){var _0x5ba12c=_[_0x78cf('0x42')](_0x49549c,function(_0x4f1ea3){return db[_0x78cf('0x94')][_0x78cf('0x95')]({'membername':_0x4f1ea3[_0x78cf('0x2f')],'UserId':_0x4f1ea3['id'],'queue_name':_0x659dc6[_0x78cf('0x2f')],'VoiceQueueId':_0x659dc6['id'],'interface':_[_0x78cf('0x96')](_0x4f1ea3[_0x78cf('0x93')])?util[_0x78cf('0x97')]('SIP/%s',_0x4f1ea3[_0x78cf('0x2f')]):_0x4f1ea3[_0x78cf('0x93')],'paused':_0x4f1ea3[_0x78cf('0x92')]||![],'penalty':_0x659dc6[_0x78cf('0x8c')][_0x78cf('0x8d')]},{'transaction':_0x5e6a3f});});return Promise[_0x78cf('0x98')](_0x5ba12c);});});});return Promise['all'](_0x326777);});return Promise['all'](_0x20cefb);})[_0x78cf('0x2c')](function(){return db[_0x78cf('0x71')]['findOne']({'where':{'teamId':_0x2b49f7}})['then'](function(_0x39bfcb){if(_0x39bfcb){var _0x2b1e9e=_[_0x78cf('0x42')](_0x37660a,function(_0x147b66){db[_0x78cf('0x72')][_0x78cf('0x95')]({'UserId':_0x147b66,'VoicePrefixId':_0x39bfcb['VoicePrefixId']});});return Promise[_0x78cf('0x98')](_0x2b1e9e);}});});});return Promise[_0x78cf('0x98')](_0x45509b)['then'](function(){return _0x3f1edb[_0x78cf('0x99')](_0x37660a,{'transaction':_0x5e6a3f})[_0x78cf('0x9a')](function(_0x15d009){return _0x15d009;});});});}})['then'](respondWithResult(_0x362f30,null))[_0x78cf('0x4d')](handleError(_0x362f30,null));};exports[_0x78cf('0x9b')]=function(_0x37f061,_0x3bb98d){var _0x4204b8=_[_0x78cf('0x83')](_0x37f061['query'][_0x78cf('0x82')])?_0x37f061[_0x78cf('0x35')][_0x78cf('0x82')]:[_0x37f061['query'][_0x78cf('0x82')]];var _0x55531c=_0x37f061[_0x78cf('0x4a')]['id'];return db[_0x78cf('0x44')][_0x78cf('0x4c')]({'where':{'id':_0x55531c}})['then'](handleEntityNotFound(_0x3bb98d,null))[_0x78cf('0x2c')](function(_0x1278f3){if(_0x1278f3){var _0x4837de=[_0x78cf('0x84'),_0x78cf('0x85'),_0x78cf('0x86'),_0x78cf('0x87'),_0x78cf('0x88'),_0x78cf('0x9c'),'Whatsapp'];return db[_0x78cf('0x5b')]['transaction'](function(_0x594474){var _0x355778=_[_0x78cf('0x42')](_0x4837de,function(_0xc5d72d){var _0x41324a={'attributes':['id','name']};return _0x1278f3['get'+_0xc5d72d+'Queues'](_0x41324a)[_0x78cf('0x2c')](function(_0x9a0fdb){var _0x523c8a=_[_0x78cf('0x42')](_0x9a0fdb,function(_0x506ee7){return _0x506ee7['removeAgents'](_0x4204b8,{'transaction':_0x594474})['then'](function(){var _0x1f59dc=_[_0x78cf('0x42')](_0x4204b8,function(_0xe9d225){socket['emit'](_0x78cf('0x50')+_0xc5d72d+_0x78cf('0x9d'),{'UserId':Number(_0xe9d225),[_0xc5d72d+_0x78cf('0x8b')]:_0x506ee7['id']});if(_0xc5d72d!==_0x78cf('0x84')){return;}return db['UserVoiceQueueRt'][_0x78cf('0x5a')]({'where':{'VoiceQueueId':_0x506ee7['id'],'UserId':_0xe9d225},'transaction':_0x594474});});return Promise[_0x78cf('0x98')](_0x1f59dc);});});return Promise[_0x78cf('0x98')](_0x523c8a);});});return Promise['all'](_0x355778)[_0x78cf('0x2c')](function(){return _0x1278f3[_0x78cf('0x9b')](_0x4204b8,{'transaction':_0x594474});})[_0x78cf('0x2c')](function(){return db[_0x78cf('0x71')][_0x78cf('0x76')]({'where':{'teamId':_0x55531c}})['then'](function(_0x209b0d){if(_0x209b0d){var _0x52ea48=_[_0x78cf('0x42')](_0x4204b8,function(_0xa7c9cb){db[_0x78cf('0x72')][_0x78cf('0x5a')]({'where':{'UserId':_0xa7c9cb,'VoicePrefixId':_0x209b0d[_0x78cf('0x73')]}});});return Promise[_0x78cf('0x98')](_0x52ea48);}});});});}})[_0x78cf('0x2c')](respondWithStatusCode(_0x3bb98d,null))[_0x78cf('0x4d')](handleError(_0x3bb98d,null));};exports[_0x78cf('0x9e')]=function(_0x152b43,_0x394d9f,_0x1427ad){var _0x35fec5={};var _0x53171b={};var _0xc03c21;var _0x1c3dd1;return db[_0x78cf('0x44')][_0x78cf('0x76')]({'where':{'id':_0x152b43['params']['id']}})[_0x78cf('0x2c')](handleEntityNotFound(_0x394d9f,null))[_0x78cf('0x2c')](function(_0x1786a4){if(_0x1786a4){_0xc03c21=_0x1786a4;_0x53171b[_0x78cf('0x38')]=_[_0x78cf('0x36')](db[_0x78cf('0x8e')]['rawAttributes']);_0x53171b['query']=_[_0x78cf('0x36')](_0x152b43['query']);_0x53171b[_0x78cf('0x37')]=_[_0x78cf('0x4b')](_0x53171b[_0x78cf('0x38')],_0x53171b[_0x78cf('0x35')]);_0x35fec5[_0x78cf('0x39')]=_[_0x78cf('0x4b')](_0x53171b['model'],qs[_0x78cf('0x3a')](_0x152b43[_0x78cf('0x35')][_0x78cf('0x3a')]));_0x35fec5[_0x78cf('0x39')]=_0x35fec5[_0x78cf('0x39')]['length']?_0x35fec5[_0x78cf('0x39')]:_0x53171b[_0x78cf('0x38')];_0x35fec5[_0x78cf('0x3d')]=qs[_0x78cf('0x3e')](_0x152b43[_0x78cf('0x35')][_0x78cf('0x3e')]);_0x35fec5[_0x78cf('0x3f')]=qs[_0x78cf('0x37')](_[_0x78cf('0x9f')](_0x152b43[_0x78cf('0x35')],_0x53171b['filters']));if(_0x152b43['query'][_0x78cf('0x40')]){_0x35fec5[_0x78cf('0x3f')]=_[_0x78cf('0x41')](_0x35fec5[_0x78cf('0x3f')],{'$or':_[_0x78cf('0x42')](_0x35fec5['attributes'],function(_0x3f3517){var _0x274f38={};_0x274f38[_0x3f3517]={'$like':'%'+_0x152b43[_0x78cf('0x35')][_0x78cf('0x40')]+'%'};return _0x274f38;})});}_0x35fec5=_[_0x78cf('0x41')]({},_0x35fec5,_0x152b43[_0x78cf('0x43')]);return _0xc03c21[_0x78cf('0x9e')](_0x35fec5);}})[_0x78cf('0x2c')](function(_0x226b80){if(_0x226b80){_0x1c3dd1=_0x226b80[_0x78cf('0x3b')];if(!_0x152b43[_0x78cf('0x35')][_0x78cf('0x3c')](_0x78cf('0xa0'))){_0x35fec5['limit']=qs['limit'](_0x152b43['query'][_0x78cf('0x24')]);_0x35fec5[_0x78cf('0x26')]=qs[_0x78cf('0x26')](_0x152b43[_0x78cf('0x35')][_0x78cf('0x26')]);}return _0xc03c21[_0x78cf('0x9e')](_0x35fec5);}})['then'](function(_0x27da18){if(_0x27da18){return _0x27da18?{'count':_0x1c3dd1,'rows':_0x27da18}:null;}})[_0x78cf('0x2c')](respondWithResult(_0x394d9f,null))['catch'](handleError(_0x394d9f,null));};
\ No newline at end of file
+var _0x7b62=['SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','Sequelize','UserVoiceQueue','destroy','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','MailQueueId','UserMailQueue','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SmsQueueId','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','UserChatQueue','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','UserFaxQueue','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','UserWhatsappQueue','UserVoicePrefix','VoicePrefixId','Teams','getQueues','findOne','isValidChannel','channel','ValidationError','Unknown\x20channel','capitalize','toLowerCase','Queue','length','Queues','add','ids','removeQueues','remove','addAgents','Voice','Chat','Mail','Sms','Openchannel','Whatsapp','through','penalty','TeamVoiceQueue','User','emit','QueueId','findAll','online','voicePause','UserVoiceQueueRt','isNil','interface','SIP/%s','all','TeamVoicePrefix','upsert','spread','removeAgents','isArray','Fax','Queue:remove','getAgents','eml-format','rimraf','zip-dir','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./team.socket','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','then','error','stack','name','send','map','Team','rawAttributes','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','type','VIRTUAL','merge','includeAll','rows','catch','show','include','options','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','sequelize','transaction','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','QueryTypes','SELECT','UserId'];(function(_0x571421,_0x51d35c){var _0x3727ec=function(_0x1c23ed){while(--_0x1c23ed){_0x571421['push'](_0x571421['shift']());}};_0x3727ec(++_0x51d35c);}(_0x7b62,0x177));var _0x27b6=function(_0x8506df,_0x23a65f){_0x8506df=_0x8506df-0x0;var _0x42f5d7=_0x7b62[_0x8506df];return _0x42f5d7;};'use strict';var emlformat=require(_0x27b6('0x0'));var rimraf=require(_0x27b6('0x1'));var zipdir=require(_0x27b6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x27b6('0x3'));var BPromise=require(_0x27b6('0x4'));var Mustache=require(_0x27b6('0x5'));var util=require('util');var path=require(_0x27b6('0x6'));var sox=require(_0x27b6('0x7'));var csv=require(_0x27b6('0x8'));var ejs=require(_0x27b6('0x9'));var fs=require('fs');var fs_extra=require(_0x27b6('0xa'));var _=require('lodash');var squel=require(_0x27b6('0xb'));var crypto=require(_0x27b6('0xc'));var jsforce=require(_0x27b6('0xd'));var deskjs=require(_0x27b6('0xe'));var toCsv=require(_0x27b6('0x8'));var querystring=require(_0x27b6('0xf'));var Papa=require(_0x27b6('0x10'));var Redis=require(_0x27b6('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x27b6('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x27b6('0x13'))(_0x27b6('0x14'));var utils=require(_0x27b6('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x27b6('0x16'));var db=require('../../mysqldb')['db'];config[_0x27b6('0x17')]=_[_0x27b6('0x18')](config[_0x27b6('0x17')],{'host':_0x27b6('0x19'),'port':0x18eb});var socket=require(_0x27b6('0x1a'))(new Redis(config[_0x27b6('0x17')]));require(_0x27b6('0x1b'))['register'](socket);function respondWithStatusCode(_0xbcb14c,_0x491e47){_0x491e47=_0x491e47||0xcc;return function(_0x56243c){if(_0x56243c){return _0xbcb14c[_0x27b6('0x1c')](_0x491e47);}return _0xbcb14c[_0x27b6('0x1d')](_0x491e47)[_0x27b6('0x1e')]();};}function respondWithResult(_0x4433c7,_0x5d161b){_0x5d161b=_0x5d161b||0xc8;return function(_0x495115){if(_0x495115){return _0x4433c7[_0x27b6('0x1d')](_0x5d161b)[_0x27b6('0x1f')](_0x495115);}};}function respondWithFilteredResult(_0x592e30,_0x62ad18){return function(_0x20d6de){if(_0x20d6de){var _0x148318=typeof _0x62ad18[_0x27b6('0x20')]==='undefined'&&typeof _0x62ad18[_0x27b6('0x21')]===_0x27b6('0x22');var _0x1f3732=_0x20d6de['count'];var _0x14785b=_0x148318?0x0:_0x62ad18[_0x27b6('0x20')];var _0x2faaf9=_0x148318?_0x20d6de[_0x27b6('0x23')]:_0x62ad18[_0x27b6('0x20')]+_0x62ad18[_0x27b6('0x21')];var _0x2133d4;if(_0x2faaf9>=_0x1f3732){_0x2faaf9=_0x1f3732;_0x2133d4=0xc8;}else{_0x2133d4=0xce;}_0x592e30[_0x27b6('0x1d')](_0x2133d4);return _0x592e30[_0x27b6('0x24')](_0x27b6('0x25'),_0x14785b+'-'+_0x2faaf9+'/'+_0x1f3732)[_0x27b6('0x1f')](_0x20d6de);}return null;};}function patchUpdates(_0x10d921){return function(_0x28431e){try{jsonpatch[_0x27b6('0x26')](_0x28431e,_0x10d921,!![]);}catch(_0x40e705){return BPromise[_0x27b6('0x27')](_0x40e705);}return _0x28431e[_0x27b6('0x28')]();};}function saveUpdates(_0x19f319,_0x2c1edb){return function(_0x2dd3f1){if(_0x2dd3f1){return _0x2dd3f1['update'](_0x19f319)[_0x27b6('0x29')](function(_0x271a02){return _0x271a02;});}return null;};}function handleEntityNotFound(_0x4f0ec2,_0x3750b8){return function(_0x1e78a9){if(!_0x1e78a9){_0x4f0ec2[_0x27b6('0x1c')](0x194);}return _0x1e78a9;};}function handleError(_0x57fbc4,_0x4c2044){_0x4c2044=_0x4c2044||0x1f4;return function(_0x41f45f){logger[_0x27b6('0x2a')](_0x41f45f[_0x27b6('0x2b')]);if(_0x41f45f[_0x27b6('0x2c')]){delete _0x41f45f[_0x27b6('0x2c')];}_0x57fbc4[_0x27b6('0x1d')](_0x4c2044)[_0x27b6('0x2d')](_0x41f45f);};}exports['index']=function(_0x541d88,_0x11dc60){var _0x320998={},_0x1fdc74={},_0x87071b={'count':0x0,'rows':[]};var _0x4b5f31=_[_0x27b6('0x2e')](db[_0x27b6('0x2f')][_0x27b6('0x30')],function(_0x4786f8){return{'name':_0x4786f8['fieldName'],'type':_0x4786f8['type'][_0x27b6('0x31')]};});_0x1fdc74[_0x27b6('0x32')]=_['map'](_0x4b5f31,_0x27b6('0x2c'));_0x1fdc74[_0x27b6('0x33')]=_[_0x27b6('0x34')](_0x541d88[_0x27b6('0x33')]);_0x1fdc74['filters']=_[_0x27b6('0x35')](_0x1fdc74[_0x27b6('0x32')],_0x1fdc74[_0x27b6('0x33')]);_0x320998[_0x27b6('0x36')]=_[_0x27b6('0x35')](_0x1fdc74['model'],qs[_0x27b6('0x37')](_0x541d88['query'][_0x27b6('0x37')]));_0x320998[_0x27b6('0x36')]=_0x320998['attributes']['length']?_0x320998['attributes']:_0x1fdc74['model'];if(!_0x541d88[_0x27b6('0x33')][_0x27b6('0x38')](_0x27b6('0x39'))){_0x320998['limit']=qs[_0x27b6('0x21')](_0x541d88[_0x27b6('0x33')][_0x27b6('0x21')]);_0x320998[_0x27b6('0x20')]=qs[_0x27b6('0x20')](_0x541d88[_0x27b6('0x33')]['offset']);}_0x320998[_0x27b6('0x3a')]=qs['sort'](_0x541d88[_0x27b6('0x33')][_0x27b6('0x3b')]);_0x320998[_0x27b6('0x3c')]=qs[_0x27b6('0x3d')](_[_0x27b6('0x3e')](_0x541d88[_0x27b6('0x33')],_0x1fdc74['filters']),_0x4b5f31);if(_0x541d88[_0x27b6('0x33')][_0x27b6('0x3f')]){_0x320998['where']=_['merge'](_0x320998['where'],{'$or':_[_0x27b6('0x2e')](_0x4b5f31,function(_0x50b8a6){if(_0x50b8a6[_0x27b6('0x40')]!==_0x27b6('0x41')){var _0x5bfd4f={};_0x5bfd4f[_0x50b8a6[_0x27b6('0x2c')]]={'$like':'%'+_0x541d88['query']['filter']+'%'};return _0x5bfd4f;}})});}_0x320998=_[_0x27b6('0x42')]({},_0x320998,_0x541d88['options']);var _0xa51380={'where':_0x320998[_0x27b6('0x3c')]};return db[_0x27b6('0x2f')][_0x27b6('0x23')](_0xa51380)[_0x27b6('0x29')](function(_0x1347a1){_0x87071b['count']=_0x1347a1;if(_0x541d88[_0x27b6('0x33')][_0x27b6('0x43')]){_0x320998['include']=[{'all':!![]}];}return db['Team']['findAll'](_0x320998);})[_0x27b6('0x29')](function(_0x2778b2){_0x87071b[_0x27b6('0x44')]=_0x2778b2;return _0x87071b;})[_0x27b6('0x29')](respondWithFilteredResult(_0x11dc60,_0x320998))[_0x27b6('0x45')](handleError(_0x11dc60,null));};exports[_0x27b6('0x46')]=function(_0x42bd95,_0x33a30e){var _0x1511bd={'raw':![],'where':{'id':_0x42bd95['params']['id']}},_0x19af78={};_0x19af78[_0x27b6('0x32')]=_['keys'](db['Team'][_0x27b6('0x30')]);_0x19af78[_0x27b6('0x33')]=_[_0x27b6('0x34')](_0x42bd95[_0x27b6('0x33')]);_0x19af78[_0x27b6('0x3d')]=_['intersection'](_0x19af78[_0x27b6('0x32')],_0x19af78['query']);_0x1511bd[_0x27b6('0x36')]=_[_0x27b6('0x35')](_0x19af78[_0x27b6('0x32')],qs[_0x27b6('0x37')](_0x42bd95['query'][_0x27b6('0x37')]));_0x1511bd[_0x27b6('0x36')]=_0x1511bd['attributes']['length']?_0x1511bd[_0x27b6('0x36')]:_0x19af78[_0x27b6('0x32')];if(_0x42bd95['query']['includeAll']){_0x1511bd[_0x27b6('0x47')]=[{'all':!![]}];}_0x1511bd=_[_0x27b6('0x42')]({},_0x1511bd,_0x42bd95[_0x27b6('0x48')]);return db['Team']['find'](_0x1511bd)[_0x27b6('0x29')](handleEntityNotFound(_0x33a30e,null))[_0x27b6('0x29')](respondWithResult(_0x33a30e,null))[_0x27b6('0x45')](handleError(_0x33a30e,null));};exports[_0x27b6('0x49')]=function(_0x43d929,_0x58f552){return db[_0x27b6('0x2f')][_0x27b6('0x49')](_0x43d929[_0x27b6('0x4a')],{})[_0x27b6('0x29')](function(_0xe4f8ad){var _0x22b392=_0x43d929['user'][_0x27b6('0x4b')]({'plain':!![]});if(!_0x22b392)throw new Error(_0x27b6('0x4c'));if(_0x22b392['role']===_0x27b6('0x4d')){var _0x51c866=_0xe4f8ad[_0x27b6('0x4b')]({'plain':!![]});var _0x13f832='Teams';return db['UserProfileSection'][_0x27b6('0x4e')]({'where':{'name':_0x13f832,'userProfileId':_0x22b392[_0x27b6('0x4f')]},'raw':!![]})[_0x27b6('0x29')](function(_0x5b655d){if(_0x5b655d&&_0x5b655d[_0x27b6('0x50')]===0x0){return db[_0x27b6('0x51')][_0x27b6('0x49')]({'name':_0x51c866[_0x27b6('0x2c')],'resourceId':_0x51c866['id'],'type':_0x5b655d['name'],'sectionId':_0x5b655d['id']},{})['then'](function(){return _0xe4f8ad;});}else{return _0xe4f8ad;}})[_0x27b6('0x45')](function(_0x1aa6b2){logger[_0x27b6('0x2a')](_0x27b6('0x52'),_0x1aa6b2);throw _0x1aa6b2;});}return _0xe4f8ad;})['then'](respondWithResult(_0x58f552,0xc9))['catch'](handleError(_0x58f552,null));};exports['update']=function(_0x52c5fa,_0x4126c4){if(_0x52c5fa['body']['id']){delete _0x52c5fa[_0x27b6('0x4a')]['id'];}return db[_0x27b6('0x2f')][_0x27b6('0x4e')]({'where':{'id':_0x52c5fa[_0x27b6('0x53')]['id']}})[_0x27b6('0x29')](handleEntityNotFound(_0x4126c4,null))[_0x27b6('0x29')](saveUpdates(_0x52c5fa[_0x27b6('0x4a')],null))['then'](respondWithResult(_0x4126c4,null))['catch'](handleError(_0x4126c4,null));};exports['destroy']=function(_0x3c364e,_0x24b9ff){var _0x9d0c44=_0x3c364e[_0x27b6('0x53')]['id'];var _0x52ca54=[];return db[_0x27b6('0x54')][_0x27b6('0x55')](function(_0x1eecf6){var _0x44c6f6=_0x27b6('0x56')+_0x9d0c44;return db[_0x27b6('0x54')][_0x27b6('0x33')](_0x44c6f6,{'type':db['Sequelize'][_0x27b6('0x57')][_0x27b6('0x58')],'raw':!![],'transaction':_0x1eecf6})[_0x27b6('0x29')](function(_0x1928e0){_0x52ca54=_['map'](_0x1928e0,function(_0x3f94fb){return Number(_0x3f94fb[_0x27b6('0x59')]);});})[_0x27b6('0x29')](function(){var _0x1e24d5=_0x27b6('0x5a')+_0x9d0c44;return db[_0x27b6('0x54')][_0x27b6('0x33')](_0x1e24d5,{'type':db[_0x27b6('0x5b')][_0x27b6('0x57')][_0x27b6('0x58')],'raw':!![],'transaction':_0x1eecf6});})[_0x27b6('0x29')](function(_0x5114b8){var _0x9a9cc1=_[_0x27b6('0x2e')](_0x5114b8,function(_0x223d3d){return Number(_0x223d3d['VoiceQueueId']);});return db[_0x27b6('0x5c')][_0x27b6('0x5d')]({'where':{'UserId':{'$in':_0x52ca54},'VoiceQueueId':{'$in':_0x9a9cc1}},'transaction':_0x1eecf6});})[_0x27b6('0x29')](function(){var _0x2f39d0=_0x27b6('0x5e')+_0x9d0c44;return db['sequelize']['query'](_0x2f39d0,{'type':db[_0x27b6('0x5b')]['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x1eecf6});})[_0x27b6('0x29')](function(_0x5434f6){var _0x576f7c=_[_0x27b6('0x2e')](_0x5434f6,function(_0x4517f5){return Number(_0x4517f5[_0x27b6('0x5f')]);});return db[_0x27b6('0x60')]['destroy']({'where':{'UserId':{'$in':_0x52ca54},'MailQueueId':{'$in':_0x576f7c}},'transaction':_0x1eecf6});})[_0x27b6('0x29')](function(){var _0x4556f3=_0x27b6('0x61')+_0x9d0c44;return db[_0x27b6('0x54')][_0x27b6('0x33')](_0x4556f3,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x1eecf6});})[_0x27b6('0x29')](function(_0x4442a0){var _0x580790=_[_0x27b6('0x2e')](_0x4442a0,function(_0x2e6b1b){return Number(_0x2e6b1b[_0x27b6('0x62')]);});return db['UserSmsQueue'][_0x27b6('0x5d')]({'where':{'UserId':{'$in':_0x52ca54},'SmsQueueId':{'$in':_0x580790}},'transaction':_0x1eecf6});})[_0x27b6('0x29')](function(){var _0x2b9e6d=_0x27b6('0x63')+_0x9d0c44;return db[_0x27b6('0x54')]['query'](_0x2b9e6d,{'type':db[_0x27b6('0x5b')]['QueryTypes'][_0x27b6('0x58')],'raw':!![],'transaction':_0x1eecf6});})[_0x27b6('0x29')](function(_0x2842ec){var _0x3cd0aa=_[_0x27b6('0x2e')](_0x2842ec,function(_0x387675){return Number(_0x387675['ChatQueueId']);});return db[_0x27b6('0x64')][_0x27b6('0x5d')]({'where':{'UserId':{'$in':_0x52ca54},'ChatQueueId':{'$in':_0x3cd0aa}},'transaction':_0x1eecf6});})[_0x27b6('0x29')](function(){var _0x3c47e6=_0x27b6('0x65')+_0x9d0c44;return db['sequelize'][_0x27b6('0x33')](_0x3c47e6,{'type':db[_0x27b6('0x5b')]['QueryTypes'][_0x27b6('0x58')],'raw':!![],'transaction':_0x1eecf6});})[_0x27b6('0x29')](function(_0x40e4b0){var _0x29a963=_[_0x27b6('0x2e')](_0x40e4b0,function(_0x47ada7){return Number(_0x47ada7['FaxQueueId']);});return db[_0x27b6('0x66')][_0x27b6('0x5d')]({'where':{'UserId':{'$in':_0x52ca54},'FaxQueueId':{'$in':_0x29a963}},'transaction':_0x1eecf6});})['then'](function(){var _0x46989f=_0x27b6('0x67')+_0x9d0c44;return db['sequelize'][_0x27b6('0x33')](_0x46989f,{'type':db[_0x27b6('0x5b')][_0x27b6('0x57')][_0x27b6('0x58')],'raw':!![],'transaction':_0x1eecf6});})['then'](function(_0x4c6129){var _0x3c361c=_[_0x27b6('0x2e')](_0x4c6129,function(_0x59c471){return Number(_0x59c471['OpenchannelQueueId']);});return db[_0x27b6('0x68')][_0x27b6('0x5d')]({'where':{'UserId':{'$in':_0x52ca54},'OpenchannelQueueId':{'$in':_0x3c361c}},'transaction':_0x1eecf6});})[_0x27b6('0x29')](function(){var _0x4b1809=_0x27b6('0x69')+_0x9d0c44;return db[_0x27b6('0x54')][_0x27b6('0x33')](_0x4b1809,{'type':db[_0x27b6('0x5b')][_0x27b6('0x57')]['SELECT'],'raw':!![],'transaction':_0x1eecf6});})['then'](function(_0x876425){var _0x171cfa=_[_0x27b6('0x2e')](_0x876425,function(_0x58fc4a){return Number(_0x58fc4a[_0x27b6('0x6a')]);});return db[_0x27b6('0x6b')][_0x27b6('0x5d')]({'where':{'UserId':{'$in':_0x52ca54},'WhatsappQueueId':{'$in':_0x171cfa}},'transaction':_0x1eecf6});})[_0x27b6('0x29')](function(){return db['TeamVoicePrefix'][_0x27b6('0x4e')]({'where':{'TeamId':_0x9d0c44}});})['then'](function(_0x255fa4){if(_0x255fa4===null){return;}return db[_0x27b6('0x6c')][_0x27b6('0x5d')]({'where':{'UserId':{'$in':_0x52ca54},'VoicePrefixId':_0x255fa4[_0x27b6('0x6d')]},'transaction':_0x1eecf6});})['then'](function(){return db[_0x27b6('0x2f')][_0x27b6('0x5d')]({'where':{'id':_0x9d0c44},'cascade':!![],'transaction':_0x1eecf6});})[_0x27b6('0x29')](function(_0x1fd36e){if(_0x1fd36e===0x0){_0x24b9ff[_0x27b6('0x1c')](0x194);}else{return db[_0x27b6('0x51')][_0x27b6('0x5d')]({'where':{'type':_0x27b6('0x6e'),'resourceId':_0x9d0c44},'cascade':!![],'transaction':_0x1eecf6})[_0x27b6('0x29')](function(){_0x24b9ff[_0x27b6('0x1d')](0xcc)[_0x27b6('0x1e')]();});}})[_0x27b6('0x45')](function(_0xefc230){_0x24b9ff['status'](0x1f4)[_0x27b6('0x2d')](_0xefc230);});});};exports[_0x27b6('0x6f')]=function(_0x4c78d2,_0x5a95ca,_0x307896){return db[_0x27b6('0x2f')][_0x27b6('0x70')]({'where':{'id':_0x4c78d2[_0x27b6('0x53')]['id']}})[_0x27b6('0x29')](handleEntityNotFound(_0x5a95ca,null))[_0x27b6('0x29')](function(_0x4437cb){if(!_0x4c78d2[_0x27b6('0x33')]['channel']||!utils[_0x27b6('0x71')](_0x4c78d2[_0x27b6('0x33')][_0x27b6('0x72')])){throw new db[(_0x27b6('0x5b'))][(_0x27b6('0x73'))](_0x27b6('0x74'));}var _0x5123e1={};var _0x106fef={};_0x106fef[_0x27b6('0x32')]=_['keys'](db[_[_0x27b6('0x75')](_0x4c78d2['query'][_0x27b6('0x72')][_0x27b6('0x76')]())+_0x27b6('0x77')][_0x27b6('0x30')]);_0x106fef[_0x27b6('0x33')]=_[_0x27b6('0x34')](_0x4c78d2[_0x27b6('0x33')]);_0x106fef['filters']=_[_0x27b6('0x35')](_0x106fef['model'],_0x106fef['query']);_0x5123e1['attributes']=_[_0x27b6('0x35')](_0x106fef['model'],qs[_0x27b6('0x37')](_0x4c78d2['query'][_0x27b6('0x37')]));_0x5123e1[_0x27b6('0x36')]=_0x5123e1[_0x27b6('0x36')][_0x27b6('0x78')]?_0x5123e1[_0x27b6('0x36')]:_0x106fef[_0x27b6('0x32')];_0x5123e1['limit']=qs[_0x27b6('0x21')](_0x4c78d2['query'][_0x27b6('0x21')]);_0x5123e1[_0x27b6('0x20')]=qs['offset'](_0x4c78d2[_0x27b6('0x33')][_0x27b6('0x20')]);_0x5123e1[_0x27b6('0x3a')]=qs[_0x27b6('0x3b')](_0x4c78d2[_0x27b6('0x33')][_0x27b6('0x3b')]);_0x5123e1[_0x27b6('0x3c')]=qs[_0x27b6('0x3d')](_[_0x27b6('0x3e')](_0x4c78d2[_0x27b6('0x33')],_0x106fef[_0x27b6('0x3d')]));_0x5123e1=_['merge']({},_0x5123e1,_0x4c78d2[_0x27b6('0x48')]);return _0x4437cb[_0x27b6('0x4b')+_[_0x27b6('0x75')](_0x4c78d2[_0x27b6('0x33')]['channel']['toLowerCase']())+_0x27b6('0x79')](_0x5123e1);})[_0x27b6('0x29')](respondWithResult(_0x5a95ca,null))[_0x27b6('0x45')](handleError(_0x5a95ca,null));};exports['addQueues']=function(_0x2bc47c,_0x2fd793,_0x3505d7){return db[_0x27b6('0x2f')][_0x27b6('0x70')]({'where':{'id':_0x2bc47c[_0x27b6('0x53')]['id']}})['then'](function(_0x334ebb){if(_0x334ebb){if(!_0x2bc47c[_0x27b6('0x4a')][_0x27b6('0x72')]||!utils[_0x27b6('0x71')](_0x2bc47c[_0x27b6('0x4a')][_0x27b6('0x72')])){throw new db['Sequelize'][(_0x27b6('0x73'))]('Unknown\x20channel');}return _0x334ebb[_0x27b6('0x7a')+_['capitalize'](_0x2bc47c['body'][_0x27b6('0x72')][_0x27b6('0x76')]())+_0x27b6('0x79')](_0x2bc47c[_0x27b6('0x4a')][_0x27b6('0x7b')]);}return null;})[_0x27b6('0x29')](handleEntityNotFound(_0x2fd793,null))[_0x27b6('0x29')](respondWithStatusCode(_0x2fd793,null))['catch'](handleError(_0x2fd793,null));};exports[_0x27b6('0x7c')]=function(_0x4830ea,_0x216034,_0x36849b){return db[_0x27b6('0x2f')][_0x27b6('0x70')]({'where':{'id':_0x4830ea[_0x27b6('0x53')]['id']}})[_0x27b6('0x29')](function(_0x4722a8){if(_0x4722a8){if(!_0x4830ea[_0x27b6('0x33')]['channel']||!utils[_0x27b6('0x71')](_0x4830ea[_0x27b6('0x33')][_0x27b6('0x72')])){throw new db['Sequelize'][(_0x27b6('0x73'))](_0x27b6('0x74'));}return _0x4722a8[_0x27b6('0x7d')+_[_0x27b6('0x75')](_0x4830ea[_0x27b6('0x33')][_0x27b6('0x72')]['toLowerCase']())+'Queues'](_0x4830ea['query']['ids']);}return null;})['then'](handleEntityNotFound(_0x216034,null))[_0x27b6('0x29')](respondWithStatusCode(_0x216034,null))[_0x27b6('0x45')](handleError(_0x216034,null));};exports[_0x27b6('0x7e')]=function(_0x56a9d2,_0x54d84a){var _0x2c93fa=_['isArray'](_0x56a9d2[_0x27b6('0x4a')][_0x27b6('0x7b')])?_0x56a9d2['body'][_0x27b6('0x7b')]:[_0x56a9d2[_0x27b6('0x4a')][_0x27b6('0x7b')]];var _0x4450f7=_0x56a9d2[_0x27b6('0x53')]['id'];return db[_0x27b6('0x2f')][_0x27b6('0x4e')]({'where':{'id':_0x4450f7}})['then'](handleEntityNotFound(_0x54d84a,null))[_0x27b6('0x29')](function(_0x42ee84){if(_0x42ee84){var _0x30a9f4=[_0x27b6('0x7f'),_0x27b6('0x80'),_0x27b6('0x81'),_0x27b6('0x82'),'Fax',_0x27b6('0x83'),_0x27b6('0x84')];return db['sequelize'][_0x27b6('0x55')](function(_0x5bebba){var _0x169e0a=_[_0x27b6('0x2e')](_0x30a9f4,function(_0x36ddf2){var _0xd9dd77={'attributes':['id',_0x27b6('0x2c')]};if(_0x36ddf2==='Voice'){_0xd9dd77[_0x27b6('0x85')]={'attributes':[_0x27b6('0x86')]};}return _0x42ee84[_0x27b6('0x4b')+_0x36ddf2+_0x27b6('0x79')](_0xd9dd77)[_0x27b6('0x29')](function(_0x2654d4){var _0x249fc1=_[_0x27b6('0x2e')](_0x2654d4,function(_0x341647){var _0x1738d7=_[_0x27b6('0x2e')](_0x2c93fa,function(_0x235df5){var _0x4277f9={'where':{'UserId':_0x235df5,[_0x36ddf2+'QueueId']:_0x341647['id']},'transaction':_0x5bebba};if(_0x36ddf2===_0x27b6('0x7f')){_0x4277f9[_0x27b6('0x18')]={'penalty':_0x341647[_0x27b6('0x87')][_0x27b6('0x86')]};}return db[_0x27b6('0x88')+_0x36ddf2+_0x27b6('0x77')]['findOrCreate'](_0x4277f9)[_0x27b6('0x29')](function(){socket[_0x27b6('0x89')](_0x27b6('0x4d')+_0x36ddf2+'Queue:save',{'UserId':_0x235df5,[_0x36ddf2+_0x27b6('0x8a')]:_0x341647['id']});if(_0x36ddf2!==_0x27b6('0x7f')){return;}return db[_0x27b6('0x88')][_0x27b6('0x8b')]({'where':{'id':_0x2c93fa,'online':0x1},'attributes':['id',_0x27b6('0x2c'),_0x27b6('0x8c'),_0x27b6('0x8d'),'interface'],'raw':!![]})[_0x27b6('0x29')](function(_0x593d16){var _0x5c251e=_[_0x27b6('0x2e')](_0x593d16,function(_0x5ebd6f){return db[_0x27b6('0x8e')]['upsert']({'membername':_0x5ebd6f[_0x27b6('0x2c')],'UserId':_0x5ebd6f['id'],'queue_name':_0x341647['name'],'VoiceQueueId':_0x341647['id'],'interface':_[_0x27b6('0x8f')](_0x5ebd6f[_0x27b6('0x90')])?util['format'](_0x27b6('0x91'),_0x5ebd6f[_0x27b6('0x2c')]):_0x5ebd6f[_0x27b6('0x90')],'paused':_0x5ebd6f[_0x27b6('0x8d')]||![],'penalty':_0x341647['TeamVoiceQueue'][_0x27b6('0x86')]},{'transaction':_0x5bebba});});return Promise[_0x27b6('0x92')](_0x5c251e);});});});return Promise[_0x27b6('0x92')](_0x1738d7);});return Promise[_0x27b6('0x92')](_0x249fc1);})[_0x27b6('0x29')](function(){return db[_0x27b6('0x93')][_0x27b6('0x70')]({'where':{'teamId':_0x4450f7}})[_0x27b6('0x29')](function(_0x3e329a){if(_0x3e329a){var _0x4b07e7=_[_0x27b6('0x2e')](_0x2c93fa,function(_0xf028e8){db[_0x27b6('0x6c')][_0x27b6('0x94')]({'UserId':_0xf028e8,'VoicePrefixId':_0x3e329a['VoicePrefixId']});});return Promise[_0x27b6('0x92')](_0x4b07e7);}});});});return Promise['all'](_0x169e0a)[_0x27b6('0x29')](function(){return _0x42ee84[_0x27b6('0x7e')](_0x2c93fa,{'transaction':_0x5bebba})[_0x27b6('0x95')](function(_0x444011){return _0x444011;});});});}})[_0x27b6('0x29')](respondWithResult(_0x54d84a,null))[_0x27b6('0x45')](handleError(_0x54d84a,null));};exports[_0x27b6('0x96')]=function(_0x1704a5,_0x3089b7){var _0x53ea27=_[_0x27b6('0x97')](_0x1704a5[_0x27b6('0x33')]['ids'])?_0x1704a5[_0x27b6('0x33')][_0x27b6('0x7b')]:[_0x1704a5[_0x27b6('0x33')][_0x27b6('0x7b')]];var _0x1862c0=_0x1704a5[_0x27b6('0x53')]['id'];return db['Team'][_0x27b6('0x4e')]({'where':{'id':_0x1862c0}})[_0x27b6('0x29')](handleEntityNotFound(_0x3089b7,null))[_0x27b6('0x29')](function(_0x3595f4){if(_0x3595f4){var _0x148c92=[_0x27b6('0x7f'),_0x27b6('0x80'),_0x27b6('0x81'),_0x27b6('0x82'),_0x27b6('0x98'),_0x27b6('0x83'),_0x27b6('0x84')];return db[_0x27b6('0x54')][_0x27b6('0x55')](function(_0xf1e718){var _0x4d5d26=_[_0x27b6('0x2e')](_0x148c92,function(_0x11f1e3){var _0x26c69d={'attributes':['id','name']};return _0x3595f4['get'+_0x11f1e3+'Queues'](_0x26c69d)[_0x27b6('0x29')](function(_0x434239){var _0x11add3=_[_0x27b6('0x2e')](_0x434239,function(_0x2e1d89){return _0x2e1d89[_0x27b6('0x96')](_0x53ea27,{'transaction':_0xf1e718})[_0x27b6('0x29')](function(){var _0x839c0a=_['map'](_0x53ea27,function(_0x4e66fa){socket[_0x27b6('0x89')](_0x27b6('0x4d')+_0x11f1e3+_0x27b6('0x99'),{'UserId':Number(_0x4e66fa),[_0x11f1e3+'QueueId']:_0x2e1d89['id']});if(_0x11f1e3!==_0x27b6('0x7f')){return;}return db[_0x27b6('0x8e')][_0x27b6('0x5d')]({'where':{'VoiceQueueId':_0x2e1d89['id'],'UserId':_0x4e66fa},'transaction':_0xf1e718});});return Promise[_0x27b6('0x92')](_0x839c0a);});});return Promise['all'](_0x11add3);});});return Promise[_0x27b6('0x92')](_0x4d5d26)[_0x27b6('0x29')](function(){return _0x3595f4['removeAgents'](_0x53ea27,{'transaction':_0xf1e718});})[_0x27b6('0x29')](function(){return db[_0x27b6('0x93')]['findOne']({'where':{'teamId':_0x1862c0}})['then'](function(_0x5001e7){if(_0x5001e7){var _0x4610de=_[_0x27b6('0x2e')](_0x53ea27,function(_0x824454){db['UserVoicePrefix'][_0x27b6('0x5d')]({'where':{'UserId':_0x824454,'VoicePrefixId':_0x5001e7[_0x27b6('0x6d')]}});});return Promise[_0x27b6('0x92')](_0x4610de);}});});});}})[_0x27b6('0x29')](respondWithStatusCode(_0x3089b7,null))[_0x27b6('0x45')](handleError(_0x3089b7,null));};exports[_0x27b6('0x9a')]=function(_0x590a2f,_0x335923,_0x990645){var _0x13de0c={};var _0x34e867={};var _0x5c4af7;var _0x3c1043;return db['Team'][_0x27b6('0x70')]({'where':{'id':_0x590a2f[_0x27b6('0x53')]['id']}})[_0x27b6('0x29')](handleEntityNotFound(_0x335923,null))[_0x27b6('0x29')](function(_0x544bb5){if(_0x544bb5){_0x5c4af7=_0x544bb5;_0x34e867[_0x27b6('0x32')]=_[_0x27b6('0x34')](db[_0x27b6('0x88')]['rawAttributes']);_0x34e867[_0x27b6('0x33')]=_[_0x27b6('0x34')](_0x590a2f[_0x27b6('0x33')]);_0x34e867[_0x27b6('0x3d')]=_[_0x27b6('0x35')](_0x34e867['model'],_0x34e867[_0x27b6('0x33')]);_0x13de0c[_0x27b6('0x36')]=_[_0x27b6('0x35')](_0x34e867[_0x27b6('0x32')],qs[_0x27b6('0x37')](_0x590a2f[_0x27b6('0x33')][_0x27b6('0x37')]));_0x13de0c[_0x27b6('0x36')]=_0x13de0c[_0x27b6('0x36')][_0x27b6('0x78')]?_0x13de0c[_0x27b6('0x36')]:_0x34e867[_0x27b6('0x32')];_0x13de0c[_0x27b6('0x3a')]=qs[_0x27b6('0x3b')](_0x590a2f['query'][_0x27b6('0x3b')]);_0x13de0c[_0x27b6('0x3c')]=qs[_0x27b6('0x3d')](_['pick'](_0x590a2f['query'],_0x34e867[_0x27b6('0x3d')]));if(_0x590a2f[_0x27b6('0x33')][_0x27b6('0x3f')]){_0x13de0c[_0x27b6('0x3c')]=_[_0x27b6('0x42')](_0x13de0c[_0x27b6('0x3c')],{'$or':_[_0x27b6('0x2e')](_0x13de0c[_0x27b6('0x36')],function(_0xb43a62){var _0x48923c={};_0x48923c[_0xb43a62]={'$like':'%'+_0x590a2f[_0x27b6('0x33')][_0x27b6('0x3f')]+'%'};return _0x48923c;})});}_0x13de0c=_[_0x27b6('0x42')]({},_0x13de0c,_0x590a2f[_0x27b6('0x48')]);return _0x5c4af7[_0x27b6('0x9a')](_0x13de0c);}})[_0x27b6('0x29')](function(_0x58f18a){if(_0x58f18a){_0x3c1043=_0x58f18a[_0x27b6('0x78')];if(!_0x590a2f[_0x27b6('0x33')][_0x27b6('0x38')]('nolimit')){_0x13de0c[_0x27b6('0x21')]=qs[_0x27b6('0x21')](_0x590a2f['query']['limit']);_0x13de0c[_0x27b6('0x20')]=qs[_0x27b6('0x20')](_0x590a2f[_0x27b6('0x33')]['offset']);}return _0x5c4af7[_0x27b6('0x9a')](_0x13de0c);}})[_0x27b6('0x29')](function(_0x203fa7){if(_0x203fa7){return _0x203fa7?{'count':_0x3c1043,'rows':_0x203fa7}:null;}})['then'](respondWithResult(_0x335923,null))[_0x27b6('0x45')](handleError(_0x335923,null));};
\ No newline at end of file
index d50e376..0ef79f4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xffb0=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','Team','setMaxListeners','save'];(function(_0x3bd2c8,_0x395b96){var _0x25374f=function(_0x5ee528){while(--_0x5ee528){_0x3bd2c8['push'](_0x3bd2c8['shift']());}};_0x25374f(++_0x395b96);}(_0xffb0,0x187));var _0x0ffb=function(_0x1bff68,_0x2c8c68){_0x1bff68=_0x1bff68-0x0;var _0x57dfd0=_0xffb0[_0x1bff68];return _0x57dfd0;};'use strict';var EventEmitter=require(_0x0ffb('0x0'));var Team=require(_0x0ffb('0x1'))['db'][_0x0ffb('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0x0ffb('0x3')](0x0);var events={'afterCreate':_0x0ffb('0x4'),'afterUpdate':_0x0ffb('0x5'),'afterDestroy':_0x0ffb('0x6')};function emitEvent(_0x4c5de4){return function(_0x34cb55,_0x4b9757,_0x238284){TeamEvents[_0x0ffb('0x7')](_0x4c5de4+':'+_0x34cb55['id'],_0x34cb55);TeamEvents[_0x0ffb('0x7')](_0x4c5de4,_0x34cb55);_0x238284(null);};}for(var e in events){if(events[_0x0ffb('0x8')](e)){var event=events[e];Team[_0x0ffb('0x9')](e,emitEvent(event));}}module[_0x0ffb('0xa')]=TeamEvents;
\ No newline at end of file
+var _0x3ff9=['hasOwnProperty','hook','exports','events','../../mysqldb','Team','setMaxListeners','update','remove','emit'];(function(_0x57fe7f,_0x2fae5f){var _0xce8eae=function(_0x363d50){while(--_0x363d50){_0x57fe7f['push'](_0x57fe7f['shift']());}};_0xce8eae(++_0x2fae5f);}(_0x3ff9,0x14d));var _0x93ff=function(_0x4ff09b,_0x53f67d){_0x4ff09b=_0x4ff09b-0x0;var _0x3f5c2e=_0x3ff9[_0x4ff09b];return _0x3f5c2e;};'use strict';var EventEmitter=require(_0x93ff('0x0'));var Team=require(_0x93ff('0x1'))['db'][_0x93ff('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0x93ff('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x93ff('0x4'),'afterDestroy':_0x93ff('0x5')};function emitEvent(_0x57480c){return function(_0x1d7225,_0x1225b3,_0x4bf372){TeamEvents[_0x93ff('0x6')](_0x57480c+':'+_0x1d7225['id'],_0x1d7225);TeamEvents[_0x93ff('0x6')](_0x57480c,_0x1d7225);_0x4bf372(null);};}for(var e in events){if(events[_0x93ff('0x7')](e)){var event=events[e];Team[_0x93ff('0x8')](e,emitEvent(event));}}module[_0x93ff('0x9')]=TeamEvents;
\ No newline at end of file
index d26c8a6..641f8fd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8950=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./team.attributes','exports','Team','teams'];(function(_0x5a2162,_0x5a90a3){var _0x4561a7=function(_0x11849e){while(--_0x11849e){_0x5a2162['push'](_0x5a2162['shift']());}};_0x4561a7(++_0x5a90a3);}(_0x8950,0x8c));var _0x0895=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x8950[_0x21a9d9];return _0x46adce;};'use strict';var _=require(_0x0895('0x0'));var util=require(_0x0895('0x1'));var logger=require(_0x0895('0x2'))(_0x0895('0x3'));var moment=require(_0x0895('0x4'));var BPromise=require(_0x0895('0x5'));var rp=require(_0x0895('0x6'));var fs=require('fs');var path=require(_0x0895('0x7'));var rimraf=require(_0x0895('0x8'));var config=require(_0x0895('0x9'));var attributes=require(_0x0895('0xa'));module[_0x0895('0xb')]=function(_0x2bcef9,_0x1ce748){return _0x2bcef9['define'](_0x0895('0xc'),attributes,{'tableName':_0x0895('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4bd0=['./team.attributes','exports','define','Team','teams','util','../../config/logger','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x4799d6,_0x48ba3e){var _0x3ca3ec=function(_0x444c19){while(--_0x444c19){_0x4799d6['push'](_0x4799d6['shift']());}};_0x3ca3ec(++_0x48ba3e);}(_0x4bd0,0x89));var _0x04bd=function(_0x21cda3,_0x17b90a){_0x21cda3=_0x21cda3-0x0;var _0x558dc3=_0x4bd0[_0x21cda3];return _0x558dc3;};'use strict';var _=require('lodash');var util=require(_0x04bd('0x0'));var logger=require(_0x04bd('0x1'))('api');var moment=require('moment');var BPromise=require(_0x04bd('0x2'));var rp=require(_0x04bd('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x04bd('0x4'));var config=require(_0x04bd('0x5'));var attributes=require(_0x04bd('0x6'));module[_0x04bd('0x7')]=function(_0x5262ca,_0x301536){return _0x5262ca[_0x04bd('0x8')](_0x04bd('0x9'),attributes,{'tableName':_0x04bd('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 5bb14b9..8e93d9b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf1c4=['Team,\x20%s,\x20%s','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./team.socket','register','then','info'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xf1c4,0x7e));var _0x4f1c=function(_0xa24508,_0x1d63cb){_0xa24508=_0xa24508-0x0;var _0x52d3af=_0xf1c4[_0xa24508];return _0x52d3af;};'use strict';var _=require(_0x4f1c('0x0'));var util=require(_0x4f1c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x4f1c('0x2'));var fs=require('fs');var Redis=require(_0x4f1c('0x3'));var db=require(_0x4f1c('0x4'))['db'];var utils=require(_0x4f1c('0x5'));var logger=require(_0x4f1c('0x6'))(_0x4f1c('0x7'));var config=require(_0x4f1c('0x8'));var jayson=require(_0x4f1c('0x9'));var client=jayson[_0x4f1c('0xa')]['http']({'port':0x232a});config['redis']=_[_0x4f1c('0xb')](config[_0x4f1c('0xc')],{'host':_0x4f1c('0xd'),'port':0x18eb});var socket=require(_0x4f1c('0xe'))(new Redis(config[_0x4f1c('0xc')]));require(_0x4f1c('0xf'))[_0x4f1c('0x10')](socket);function respondWithRpcPromise(_0x1fea81,_0x1449ce,_0x5d6bc5){return new BPromise(function(_0x2333d0,_0x2ee676){return client['request'](_0x1fea81,_0x5d6bc5)[_0x4f1c('0x11')](function(_0x356c64){logger[_0x4f1c('0x12')](_0x4f1c('0x13'),_0x1449ce,_0x4f1c('0x14'));logger[_0x4f1c('0x15')](_0x4f1c('0x16'),_0x1449ce,_0x4f1c('0x14'),JSON[_0x4f1c('0x17')](_0x356c64));if(_0x356c64[_0x4f1c('0x18')]){if(_0x356c64[_0x4f1c('0x18')][_0x4f1c('0x19')]===0x1f4){logger[_0x4f1c('0x18')]('Team,\x20%s,\x20%s',_0x1449ce,_0x356c64['error'][_0x4f1c('0x1a')]);return _0x2ee676(_0x356c64['error'][_0x4f1c('0x1a')]);}logger[_0x4f1c('0x18')](_0x4f1c('0x13'),_0x1449ce,_0x356c64['error'][_0x4f1c('0x1a')]);return _0x2333d0(_0x356c64[_0x4f1c('0x18')][_0x4f1c('0x1a')]);}else{logger[_0x4f1c('0x12')](_0x4f1c('0x13'),_0x1449ce,'request\x20sent');_0x2333d0(_0x356c64[_0x4f1c('0x1b')][_0x4f1c('0x1a')]);}})[_0x4f1c('0x1c')](function(_0x5f1915){logger[_0x4f1c('0x18')](_0x4f1c('0x13'),_0x1449ce,_0x5f1915);_0x2ee676(_0x5f1915);});});}
\ No newline at end of file
+var _0x4531=['http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','Team,\x20%s,\x20%s','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0x39ca55,_0x2e0621){var _0x533cb2=function(_0x13aa63){while(--_0x13aa63){_0x39ca55['push'](_0x39ca55['shift']());}};_0x533cb2(++_0x2e0621);}(_0x4531,0x6a));var _0x1453=function(_0x47fc97,_0x3cd87d){_0x47fc97=_0x47fc97-0x0;var _0x52b93c=_0x4531[_0x47fc97];return _0x52b93c;};'use strict';var _=require('lodash');var util=require(_0x1453('0x0'));var moment=require(_0x1453('0x1'));var BPromise=require(_0x1453('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1453('0x3'));var db=require(_0x1453('0x4'))['db'];var utils=require(_0x1453('0x5'));var logger=require('../../config/logger')(_0x1453('0x6'));var config=require(_0x1453('0x7'));var jayson=require(_0x1453('0x8'));var client=jayson[_0x1453('0x9')][_0x1453('0xa')]({'port':0x232a});config[_0x1453('0xb')]=_[_0x1453('0xc')](config[_0x1453('0xb')],{'host':_0x1453('0xd'),'port':0x18eb});var socket=require(_0x1453('0xe'))(new Redis(config['redis']));require('./team.socket')[_0x1453('0xf')](socket);function respondWithRpcPromise(_0x1c7e80,_0x3e46e3,_0x1a2db3){return new BPromise(function(_0x43b8e9,_0xb048b2){return client[_0x1453('0x10')](_0x1c7e80,_0x1a2db3)[_0x1453('0x11')](function(_0x2e40bf){logger[_0x1453('0x12')](_0x1453('0x13'),_0x3e46e3,_0x1453('0x14'));logger[_0x1453('0x15')](_0x1453('0x16'),_0x3e46e3,_0x1453('0x14'),JSON[_0x1453('0x17')](_0x2e40bf));if(_0x2e40bf[_0x1453('0x18')]){if(_0x2e40bf[_0x1453('0x18')][_0x1453('0x19')]===0x1f4){logger[_0x1453('0x18')](_0x1453('0x13'),_0x3e46e3,_0x2e40bf[_0x1453('0x18')][_0x1453('0x1a')]);return _0xb048b2(_0x2e40bf[_0x1453('0x18')]['message']);}logger[_0x1453('0x18')]('Team,\x20%s,\x20%s',_0x3e46e3,_0x2e40bf['error'][_0x1453('0x1a')]);return _0x43b8e9(_0x2e40bf['error'][_0x1453('0x1a')]);}else{logger[_0x1453('0x12')](_0x1453('0x13'),_0x3e46e3,_0x1453('0x14'));_0x43b8e9(_0x2e40bf[_0x1453('0x1b')]['message']);}})[_0x1453('0x1c')](function(_0x3b61e5){logger[_0x1453('0x18')](_0x1453('0x13'),_0x3e46e3,_0x3b61e5);_0xb048b2(_0x3b61e5);});});}
\ No newline at end of file
index 8ff483f..310495a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf3da=['save','remove','update','emit','removeListener','register','length','team:','./team.events'];(function(_0x32ee04,_0x1b0d32){var _0x1ddece=function(_0x58ebef){while(--_0x58ebef){_0x32ee04['push'](_0x32ee04['shift']());}};_0x1ddece(++_0x1b0d32);}(_0xf3da,0x143));var _0xaf3d=function(_0x4ccf84,_0xf90273){_0x4ccf84=_0x4ccf84-0x0;var _0x580284=_0xf3da[_0x4ccf84];return _0x580284;};'use strict';var TeamEvents=require(_0xaf3d('0x0'));var events=[_0xaf3d('0x1'),_0xaf3d('0x2'),_0xaf3d('0x3')];function createListener(_0x574277,_0x19a660){return function(_0x3ef5df){_0x19a660[_0xaf3d('0x4')](_0x574277,_0x3ef5df);};}function removeListener(_0x158441,_0x5b370e){return function(){TeamEvents[_0xaf3d('0x5')](_0x158441,_0x5b370e);};}exports[_0xaf3d('0x6')]=function(_0x5c28a9){for(var _0x3058f0=0x0,_0x173ef6=events[_0xaf3d('0x7')];_0x3058f0<_0x173ef6;_0x3058f0++){var _0x581200=events[_0x3058f0];var _0x4b082d=createListener(_0xaf3d('0x8')+_0x581200,_0x5c28a9);TeamEvents['on'](_0x581200,_0x4b082d);}};
\ No newline at end of file
+var _0x56fc=['update','emit','removeListener','register','length','team:','./team.events','remove'];(function(_0x274797,_0x56be87){var _0x5671b3=function(_0x5638fe){while(--_0x5638fe){_0x274797['push'](_0x274797['shift']());}};_0x5671b3(++_0x56be87);}(_0x56fc,0x13e));var _0xc56f=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0x56fc[_0x565c49];return _0x20ca34;};'use strict';var TeamEvents=require(_0xc56f('0x0'));var events=['save',_0xc56f('0x1'),_0xc56f('0x2')];function createListener(_0x2fe616,_0x2eaef7){return function(_0x2c2077){_0x2eaef7[_0xc56f('0x3')](_0x2fe616,_0x2c2077);};}function removeListener(_0x4e3a6b,_0x2284f9){return function(){TeamEvents[_0xc56f('0x4')](_0x4e3a6b,_0x2284f9);};}exports[_0xc56f('0x5')]=function(_0x2d65c6){for(var _0x2bccdd=0x0,_0x4e2ffa=events[_0xc56f('0x6')];_0x2bccdd<_0x4e2ffa;_0x2bccdd++){var _0x12e9ba=events[_0x2bccdd];var _0x53ed7d=createListener(_0xc56f('0x7')+_0x12e9ba,_0x2d65c6);TeamEvents['on'](_0x12e9ba,_0x53ed7d);}};
\ No newline at end of file
index 6567322..e0ef493 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdcf9=['exports','INTEGER','sequelize'];(function(_0x362882,_0x3012cf){var _0x4632c9=function(_0x1cdbb8){while(--_0x1cdbb8){_0x362882['push'](_0x362882['shift']());}};_0x4632c9(++_0x3012cf);}(_0xdcf9,0x101));var _0x9dcf=function(_0x5a993e,_0x569385){_0x5a993e=_0x5a993e-0x0;var _0x2d2818=_0xdcf9[_0x5a993e];return _0x2d2818;};'use strict';var Sequelize=require(_0x9dcf('0x0'));module[_0x9dcf('0x1')]={'TeamId':{'type':Sequelize[_0x9dcf('0x2')]},'VoicePrefixId':{'type':Sequelize[_0x9dcf('0x2')]}};
\ No newline at end of file
+var _0x8581=['INTEGER','exports'];(function(_0xc20f22,_0x49698f){var _0x1535d5=function(_0x5ce3f3){while(--_0x5ce3f3){_0xc20f22['push'](_0xc20f22['shift']());}};_0x1535d5(++_0x49698f);}(_0x8581,0x163));var _0x1858=function(_0x342515,_0x6db444){_0x342515=_0x342515-0x0;var _0x5bdef4=_0x8581[_0x342515];return _0x5bdef4;};'use strict';var Sequelize=require('sequelize');module[_0x1858('0x0')]={'TeamId':{'type':Sequelize[_0x1858('0x1')]},'VoicePrefixId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
index c5be12a..38dbd29 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa693=['util','../../config/logger','api','moment','bluebird','../../config/environment','./teamVoicePrefix.attributes','exports','define','TeamVoicePrefix','lodash'];(function(_0x4849f6,_0x104836){var _0x1a3dcd=function(_0x494d3c){while(--_0x494d3c){_0x4849f6['push'](_0x4849f6['shift']());}};_0x1a3dcd(++_0x104836);}(_0xa693,0xf1));var _0x3a69=function(_0x34c553,_0x3e7dfc){_0x34c553=_0x34c553-0x0;var _0x1357d2=_0xa693[_0x34c553];return _0x1357d2;};'use strict';var _=require(_0x3a69('0x0'));var util=require(_0x3a69('0x1'));var logger=require(_0x3a69('0x2'))(_0x3a69('0x3'));var moment=require(_0x3a69('0x4'));var BPromise=require(_0x3a69('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x3a69('0x6'));var attributes=require(_0x3a69('0x7'));module[_0x3a69('0x8')]=function(_0x363363,_0x3a05e0){return _0x363363[_0x3a69('0x9')](_0x3a69('0xa'),attributes,{'tableName':'team_has_voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf6ed=['define','TeamVoicePrefix','team_has_voice_prefixes','lodash','../../config/logger','api','moment','path','./teamVoicePrefix.attributes'];(function(_0x20b594,_0x2829da){var _0x2e3a45=function(_0xde25b8){while(--_0xde25b8){_0x20b594['push'](_0x20b594['shift']());}};_0x2e3a45(++_0x2829da);}(_0xf6ed,0x1ce));var _0xdf6e=function(_0x29677f,_0x1c34b3){_0x29677f=_0x29677f-0x0;var _0x5ac7cc=_0xf6ed[_0x29677f];return _0x5ac7cc;};'use strict';var _=require(_0xdf6e('0x0'));var util=require('util');var logger=require(_0xdf6e('0x1'))(_0xdf6e('0x2'));var moment=require(_0xdf6e('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xdf6e('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xdf6e('0x5'));module['exports']=function(_0x2a844a,_0x5eb5d1){return _0x2a844a[_0xdf6e('0x6')](_0xdf6e('0x7'),attributes,{'tableName':_0xdf6e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index a427e64..619fd50 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(_0x1e9827,_0x4c26e6){var _0x84e342=function(_0x20aecb){while(--_0x20aecb){_0x1e9827['push'](_0x1e9827['shift']());}};_0x84e342(++_0x4c26e6);}(_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'));module[_0x0a9e('0x7')]=router;
\ No newline at end of file
+var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x276204,_0x4ad6f3){var _0x137d07=function(_0x3d6add){while(--_0x3d6add){_0x276204['push'](_0x276204['shift']());}};_0x137d07(++_0x4ad6f3);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router;
\ No newline at end of file
index 62111d8..20a7357 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1468=['exports','INTEGER','sequelize'];(function(_0x4837eb,_0x36c230){var _0x48bf8f=function(_0x16a2f2){while(--_0x16a2f2){_0x4837eb['push'](_0x4837eb['shift']());}};_0x48bf8f(++_0x36c230);}(_0x1468,0x68));var _0x8146=function(_0x1b64dd,_0x2cf769){_0x1b64dd=_0x1b64dd-0x0;var _0xeb464c=_0x1468[_0x1b64dd];return _0xeb464c;};'use strict';var Sequelize=require(_0x8146('0x0'));module[_0x8146('0x1')]={'penalty':{'type':Sequelize[_0x8146('0x2')],'defaultValue':0x0}};
\ No newline at end of file
+var _0xcfa1=['sequelize','INTEGER'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcfa1,0xbe));var _0x1cfa=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xcfa1[_0x397e5f];return _0x5302b8;};'use strict';var Sequelize=require(_0x1cfa('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x1cfa('0x1')],'defaultValue':0x0}};
\ No newline at end of file
index e7767d0..4178cec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x12c9=['TeamVoiceQueue','team_has_voice_queues','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./teamVoiceQueue.attributes','define'];(function(_0x35cc19,_0x3deb10){var _0x4d0efa=function(_0x5e96d8){while(--_0x5e96d8){_0x35cc19['push'](_0x35cc19['shift']());}};_0x4d0efa(++_0x3deb10);}(_0x12c9,0x1c9));var _0x912c=function(_0x5462ee,_0x42dd57){_0x5462ee=_0x5462ee-0x0;var _0xdbc133=_0x12c9[_0x5462ee];return _0xdbc133;};'use strict';var _=require(_0x912c('0x0'));var util=require(_0x912c('0x1'));var logger=require(_0x912c('0x2'))(_0x912c('0x3'));var moment=require(_0x912c('0x4'));var BPromise=require('bluebird');var rp=require(_0x912c('0x5'));var fs=require('fs');var path=require(_0x912c('0x6'));var rimraf=require(_0x912c('0x7'));var config=require(_0x912c('0x8'));var attributes=require(_0x912c('0x9'));module['exports']=function(_0x584a27,_0xe29019){return _0x584a27[_0x912c('0xa')](_0x912c('0xb'),attributes,{'tableName':_0x912c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2821=['lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./teamVoiceQueue.attributes','exports','define','TeamVoiceQueue','team_has_voice_queues'];(function(_0x1fcf8d,_0x575872){var _0x5f5d85=function(_0x40d04e){while(--_0x40d04e){_0x1fcf8d['push'](_0x1fcf8d['shift']());}};_0x5f5d85(++_0x575872);}(_0x2821,0xc3));var _0x1282=function(_0x11f3c3,_0x43a130){_0x11f3c3=_0x11f3c3-0x0;var _0x1461cc=_0x2821[_0x11f3c3];return _0x1461cc;};'use strict';var _=require(_0x1282('0x0'));var util=require(_0x1282('0x1'));var logger=require(_0x1282('0x2'))(_0x1282('0x3'));var moment=require(_0x1282('0x4'));var BPromise=require(_0x1282('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1282('0x6'));var rimraf=require(_0x1282('0x7'));var config=require('../../config/environment');var attributes=require(_0x1282('0x8'));module[_0x1282('0x9')]=function(_0x384b8b,_0xe7525f){return _0x384b8b[_0x1282('0xa')](_0x1282('0xb'),attributes,{'tableName':_0x1282('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index cd81b1c..5b41f32 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2557=['lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','request','then','info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch'];(function(_0x1c212f,_0x59d13f){var _0x212fee=function(_0x1b6269){while(--_0x1b6269){_0x1c212f['push'](_0x1c212f['shift']());}};_0x212fee(++_0x59d13f);}(_0x2557,0x11e));var _0x7255=function(_0x196c4f,_0x4d1247){_0x196c4f=_0x196c4f-0x0;var _0x5bcf80=_0x2557[_0x196c4f];return _0x5bcf80;};'use strict';var _=require(_0x7255('0x0'));var util=require('util');var moment=require(_0x7255('0x1'));var BPromise=require(_0x7255('0x2'));var rs=require(_0x7255('0x3'));var fs=require('fs');var Redis=require(_0x7255('0x4'));var db=require(_0x7255('0x5'))['db'];var utils=require(_0x7255('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x7255('0x7'));var client=jayson[_0x7255('0x8')][_0x7255('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x841417,_0x419dc0,_0x2142a5){return new BPromise(function(_0x5b6aa4,_0x3baa49){return client[_0x7255('0xa')](_0x841417,_0x2142a5)[_0x7255('0xb')](function(_0x5388d5){logger[_0x7255('0xc')](_0x7255('0xd'),_0x419dc0,_0x7255('0xe'));logger[_0x7255('0xf')](_0x7255('0x10'),_0x419dc0,_0x7255('0xe'),JSON[_0x7255('0x11')](_0x5388d5));if(_0x5388d5['error']){if(_0x5388d5[_0x7255('0x12')]['code']===0x1f4){logger['error']('TeamVoiceQueue,\x20%s,\x20%s',_0x419dc0,_0x5388d5[_0x7255('0x12')][_0x7255('0x13')]);return _0x3baa49(_0x5388d5[_0x7255('0x12')][_0x7255('0x13')]);}logger[_0x7255('0x12')](_0x7255('0xd'),_0x419dc0,_0x5388d5[_0x7255('0x12')]['message']);return _0x5b6aa4(_0x5388d5[_0x7255('0x12')][_0x7255('0x13')]);}else{logger[_0x7255('0xc')](_0x7255('0xd'),_0x419dc0,_0x7255('0xe'));_0x5b6aa4(_0x5388d5[_0x7255('0x14')][_0x7255('0x13')]);}})[_0x7255('0x15')](function(_0x1dc830){logger[_0x7255('0x12')](_0x7255('0xd'),_0x419dc0,_0x1dc830);_0x3baa49(_0x1dc830);});});}
\ No newline at end of file
+var _0x6263=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x3fdb59,_0x15af6e){var _0x43108d=function(_0x3474c7){while(--_0x3474c7){_0x3fdb59['push'](_0x3fdb59['shift']());}};_0x43108d(++_0x15af6e);}(_0x6263,0x19d));var _0x3626=function(_0x524e23,_0x1e2aa7){_0x524e23=_0x524e23-0x0;var _0x231413=_0x6263[_0x524e23];return _0x231413;};'use strict';var _=require(_0x3626('0x0'));var util=require(_0x3626('0x1'));var moment=require(_0x3626('0x2'));var BPromise=require(_0x3626('0x3'));var rs=require(_0x3626('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3626('0x5'))['db'];var utils=require(_0x3626('0x6'));var logger=require(_0x3626('0x7'))(_0x3626('0x8'));var config=require('../../config/environment');var jayson=require(_0x3626('0x9'));var client=jayson['client'][_0x3626('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x292c3a,_0x4a6fd3,_0x313603){return new BPromise(function(_0x15d8b6,_0x48dede){return client[_0x3626('0xb')](_0x292c3a,_0x313603)[_0x3626('0xc')](function(_0x51cbc8){logger['info'](_0x3626('0xd'),_0x4a6fd3,_0x3626('0xe'));logger['debug'](_0x3626('0xf'),_0x4a6fd3,_0x3626('0xe'),JSON[_0x3626('0x10')](_0x51cbc8));if(_0x51cbc8[_0x3626('0x11')]){if(_0x51cbc8[_0x3626('0x11')]['code']===0x1f4){logger[_0x3626('0x11')](_0x3626('0xd'),_0x4a6fd3,_0x51cbc8['error'][_0x3626('0x12')]);return _0x48dede(_0x51cbc8[_0x3626('0x11')][_0x3626('0x12')]);}logger[_0x3626('0x11')](_0x3626('0xd'),_0x4a6fd3,_0x51cbc8[_0x3626('0x11')][_0x3626('0x12')]);return _0x15d8b6(_0x51cbc8[_0x3626('0x11')][_0x3626('0x12')]);}else{logger[_0x3626('0x13')]('TeamVoiceQueue,\x20%s,\x20%s',_0x4a6fd3,_0x3626('0xe'));_0x15d8b6(_0x51cbc8[_0x3626('0x14')][_0x3626('0x12')]);}})[_0x3626('0x15')](function(_0x502abe){logger[_0x3626('0x11')](_0x3626('0xd'),_0x4a6fd3,_0x502abe);_0x48dede(_0x502abe);});});}
\ No newline at end of file
index 3ed941c..eaf9de7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9e6d=['exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','create','destroy'];(function(_0x6f5153,_0x597918){var _0x175ce8=function(_0x36b4b8){while(--_0x36b4b8){_0x6f5153['push'](_0x6f5153['shift']());}};_0x175ce8(++_0x597918);}(_0x9e6d,0x1d2));var _0xd9e6=function(_0x301d6d,_0xcafea7){_0x301d6d=_0x301d6d-0x0;var _0x309ff6=_0x9e6d[_0x301d6d];return _0x309ff6;};'use strict';var multer=require(_0xd9e6('0x0'));var util=require('util');var path=require(_0xd9e6('0x1'));var timeout=require(_0xd9e6('0x2'));var express=require(_0xd9e6('0x3'));var router=express['Router']();var fs_extra=require(_0xd9e6('0x4'));var auth=require(_0xd9e6('0x5'));var interaction=require(_0xd9e6('0x6'));var config=require(_0xd9e6('0x7'));var controller=require('./template.controller');router[_0xd9e6('0x8')]('/',auth[_0xd9e6('0x9')](),controller['index']);router['get'](_0xd9e6('0xa'),auth[_0xd9e6('0x9')](),controller[_0xd9e6('0xb')]);router['post']('/',auth[_0xd9e6('0x9')](),controller[_0xd9e6('0xc')]);router['put'](_0xd9e6('0xa'),auth[_0xd9e6('0x9')](),controller['update']);router['delete'](_0xd9e6('0xa'),auth[_0xd9e6('0x9')](),controller[_0xd9e6('0xd')]);module[_0xd9e6('0xe')]=router;
\ No newline at end of file
+var _0x160c=['create','put','isAuthenticated','update','delete','destroy','exports','util','path','connect-timeout','../../components/auth/service','../../config/environment','./template.controller','get','index','/:id','show','post'];(function(_0x2851f7,_0x2a01de){var _0x5888cd=function(_0x38d3f0){while(--_0x38d3f0){_0x2851f7['push'](_0x2851f7['shift']());}};_0x5888cd(++_0x2a01de);}(_0x160c,0x181));var _0xc160=function(_0x395937,_0x46a558){_0x395937=_0x395937-0x0;var _0x5710c7=_0x160c[_0x395937];return _0x5710c7;};'use strict';var multer=require('multer');var util=require(_0xc160('0x0'));var path=require(_0xc160('0x1'));var timeout=require(_0xc160('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xc160('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xc160('0x4'));var controller=require(_0xc160('0x5'));router[_0xc160('0x6')]('/',auth['isAuthenticated'](),controller[_0xc160('0x7')]);router['get'](_0xc160('0x8'),auth['isAuthenticated'](),controller[_0xc160('0x9')]);router[_0xc160('0xa')]('/',auth['isAuthenticated'](),controller[_0xc160('0xb')]);router[_0xc160('0xc')]('/:id',auth[_0xc160('0xd')](),controller[_0xc160('0xe')]);router[_0xc160('0xf')](_0xc160('0x8'),auth[_0xc160('0xd')](),controller[_0xc160('0x10')]);module[_0xc160('0x11')]=router;
\ No newline at end of file
index cc5eaa6..1555704 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9268=['STRING','TEXT','exports'];(function(_0x17c6c3,_0x59cc8e){var _0xc674b5=function(_0x3c29f0){while(--_0x3c29f0){_0x17c6c3['push'](_0x17c6c3['shift']());}};_0xc674b5(++_0x59cc8e);}(_0x9268,0x1eb));var _0x8926=function(_0x3d2d6f,_0x368872){_0x3d2d6f=_0x3d2d6f-0x0;var _0x5c0022=_0x9268[_0x3d2d6f];return _0x5c0022;};'use strict';var Sequelize=require('sequelize');module[_0x8926('0x0')]={'name':{'type':Sequelize[_0x8926('0x1')]},'description':{'type':Sequelize[_0x8926('0x1')]},'html':{'type':Sequelize[_0x8926('0x2')]}};
\ No newline at end of file
+var _0xd0ed=['TEXT','exports','STRING'];(function(_0x1818d,_0x5f94e){var _0x37de5d=function(_0x1846df){while(--_0x1846df){_0x1818d['push'](_0x1818d['shift']());}};_0x37de5d(++_0x5f94e);}(_0xd0ed,0x112));var _0xdd0e=function(_0x3b10de,_0x3bb7e4){_0x3b10de=_0x3b10de-0x0;var _0x461407=_0xd0ed[_0x3b10de];return _0x461407;};'use strict';var Sequelize=require('sequelize');module[_0xdd0e('0x0')]={'name':{'type':Sequelize[_0xdd0e('0x1')]},'description':{'type':Sequelize['STRING']},'html':{'type':Sequelize[_0xdd0e('0x2')]}};
\ No newline at end of file
index 5181801..9594cff 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7d16=['body','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','limit','count','set','Content-Range','reject','then','get','Templates','UserProfileResource','destroy','error','stack','name','send','map','Template','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','catch','params','keys','rawAttributes','find','create'];(function(_0x2987d1,_0x5fa345){var _0x3d68ee=function(_0x4bb60e){while(--_0x4bb60e){_0x2987d1['push'](_0x2987d1['shift']());}};_0x3d68ee(++_0x5fa345);}(_0x7d16,0x187));var _0x67d1=function(_0x4b7f7f,_0x3d7d3b){_0x4b7f7f=_0x4b7f7f-0x0;var _0x10f95a=_0x7d16[_0x4b7f7f];return _0x10f95a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x67d1('0x0'));var zipdir=require(_0x67d1('0x1'));var jsonpatch=require(_0x67d1('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x67d1('0x3'));var Mustache=require(_0x67d1('0x4'));var util=require(_0x67d1('0x5'));var path=require(_0x67d1('0x6'));var sox=require('sox');var csv=require(_0x67d1('0x7'));var ejs=require(_0x67d1('0x8'));var fs=require('fs');var fs_extra=require(_0x67d1('0x9'));var _=require(_0x67d1('0xa'));var squel=require(_0x67d1('0xb'));var crypto=require(_0x67d1('0xc'));var jsforce=require(_0x67d1('0xd'));var deskjs=require(_0x67d1('0xe'));var toCsv=require(_0x67d1('0x7'));var querystring=require(_0x67d1('0xf'));var Papa=require('papaparse');var Redis=require(_0x67d1('0x10'));var authService=require(_0x67d1('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x67d1('0x12'));var hardwareService=require(_0x67d1('0x13'));var logger=require(_0x67d1('0x14'))('api');var utils=require(_0x67d1('0x15'));var config=require(_0x67d1('0x16'));var licenseUtil=require(_0x67d1('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x107c7e,_0x226c5c){_0x226c5c=_0x226c5c||0xcc;return function(_0x589865){if(_0x589865){return _0x107c7e['sendStatus'](_0x226c5c);}return _0x107c7e[_0x67d1('0x18')](_0x226c5c)[_0x67d1('0x19')]();};}function respondWithResult(_0x418ca1,_0x50e228){_0x50e228=_0x50e228||0xc8;return function(_0x3d774e){if(_0x3d774e){return _0x418ca1[_0x67d1('0x18')](_0x50e228)[_0x67d1('0x1a')](_0x3d774e);}};}function respondWithFilteredResult(_0x25ee70,_0x2c36f1){return function(_0x193ea3){if(_0x193ea3){var _0x180dbd=typeof _0x2c36f1[_0x67d1('0x1b')]==='undefined'&&typeof _0x2c36f1[_0x67d1('0x1c')]==='undefined';var _0x512b7c=_0x193ea3[_0x67d1('0x1d')];var _0xaf1113=_0x180dbd?0x0:_0x2c36f1['offset'];var _0x143948=_0x180dbd?_0x193ea3[_0x67d1('0x1d')]:_0x2c36f1[_0x67d1('0x1b')]+_0x2c36f1[_0x67d1('0x1c')];var _0x5d95e3;if(_0x143948>=_0x512b7c){_0x143948=_0x512b7c;_0x5d95e3=0xc8;}else{_0x5d95e3=0xce;}_0x25ee70[_0x67d1('0x18')](_0x5d95e3);return _0x25ee70[_0x67d1('0x1e')](_0x67d1('0x1f'),_0xaf1113+'-'+_0x143948+'/'+_0x512b7c)[_0x67d1('0x1a')](_0x193ea3);}return null;};}function patchUpdates(_0x32d9a4){return function(_0x32892c){try{jsonpatch['apply'](_0x32892c,_0x32d9a4,!![]);}catch(_0xfb5281){return BPromise[_0x67d1('0x20')](_0xfb5281);}return _0x32892c['save']();};}function saveUpdates(_0x5eb3e4,_0x8a1bd9){return function(_0x2df1c6){if(_0x2df1c6){return _0x2df1c6['update'](_0x5eb3e4)[_0x67d1('0x21')](function(_0xf50fd7){return _0xf50fd7;});}return null;};}function removeEntity(_0x1c1480,_0x38a706){return function(_0x2ecccd){if(_0x2ecccd){return _0x2ecccd['destroy']()['then'](function(){var _0x41699a=_0x2ecccd[_0x67d1('0x22')]({'plain':!![]});var _0x179b0a=_0x67d1('0x23');return db[_0x67d1('0x24')][_0x67d1('0x25')]({'where':{'type':_0x179b0a,'resourceId':_0x41699a['id']}})['then'](function(){return _0x2ecccd;});})[_0x67d1('0x21')](function(){_0x1c1480[_0x67d1('0x18')](0xcc)[_0x67d1('0x19')]();});}};}function handleEntityNotFound(_0x564039,_0x23ca97){return function(_0x1f7a95){if(!_0x1f7a95){_0x564039['sendStatus'](0x194);}return _0x1f7a95;};}function handleError(_0x314d12,_0x2af7b3){_0x2af7b3=_0x2af7b3||0x1f4;return function(_0x314692){logger[_0x67d1('0x26')](_0x314692[_0x67d1('0x27')]);if(_0x314692['name']){delete _0x314692[_0x67d1('0x28')];}_0x314d12[_0x67d1('0x18')](_0x2af7b3)[_0x67d1('0x29')](_0x314692);};}exports['index']=function(_0x7d0a51,_0x129001){var _0x1fcca3={},_0x561e17={},_0x1e7db5={'count':0x0,'rows':[]};var _0x1df746=_[_0x67d1('0x2a')](db[_0x67d1('0x2b')]['rawAttributes'],function(_0x51f911){return{'name':_0x51f911[_0x67d1('0x2c')],'type':_0x51f911[_0x67d1('0x2d')][_0x67d1('0x2e')]};});_0x561e17[_0x67d1('0x2f')]=_[_0x67d1('0x2a')](_0x1df746,_0x67d1('0x28'));_0x561e17['query']=_['keys'](_0x7d0a51[_0x67d1('0x30')]);_0x561e17[_0x67d1('0x31')]=_[_0x67d1('0x32')](_0x561e17[_0x67d1('0x2f')],_0x561e17[_0x67d1('0x30')]);_0x1fcca3[_0x67d1('0x33')]=_[_0x67d1('0x32')](_0x561e17['model'],qs[_0x67d1('0x34')](_0x7d0a51[_0x67d1('0x30')]['fields']));_0x1fcca3[_0x67d1('0x33')]=_0x1fcca3[_0x67d1('0x33')][_0x67d1('0x35')]?_0x1fcca3[_0x67d1('0x33')]:_0x561e17[_0x67d1('0x2f')];if(!_0x7d0a51[_0x67d1('0x30')][_0x67d1('0x36')](_0x67d1('0x37'))){_0x1fcca3['limit']=qs[_0x67d1('0x1c')](_0x7d0a51[_0x67d1('0x30')][_0x67d1('0x1c')]);_0x1fcca3[_0x67d1('0x1b')]=qs[_0x67d1('0x1b')](_0x7d0a51[_0x67d1('0x30')][_0x67d1('0x1b')]);}_0x1fcca3[_0x67d1('0x38')]=qs[_0x67d1('0x39')](_0x7d0a51[_0x67d1('0x30')][_0x67d1('0x39')]);_0x1fcca3[_0x67d1('0x3a')]=qs[_0x67d1('0x31')](_[_0x67d1('0x3b')](_0x7d0a51['query'],_0x561e17['filters']),_0x1df746);if(_0x7d0a51[_0x67d1('0x30')][_0x67d1('0x3c')]){_0x1fcca3[_0x67d1('0x3a')]=_[_0x67d1('0x3d')](_0x1fcca3['where'],{'$or':_[_0x67d1('0x2a')](_0x1df746,function(_0xa1a76f){if(_0xa1a76f[_0x67d1('0x2d')]!=='VIRTUAL'){var _0x361e65={};_0x361e65[_0xa1a76f[_0x67d1('0x28')]]={'$like':'%'+_0x7d0a51[_0x67d1('0x30')][_0x67d1('0x3c')]+'%'};return _0x361e65;}})});}_0x1fcca3=_['merge']({},_0x1fcca3,_0x7d0a51[_0x67d1('0x3e')]);var _0x6b97c9={'where':_0x1fcca3[_0x67d1('0x3a')]};return db['Template'][_0x67d1('0x1d')](_0x6b97c9)[_0x67d1('0x21')](function(_0x351cd0){_0x1e7db5[_0x67d1('0x1d')]=_0x351cd0;if(_0x7d0a51[_0x67d1('0x30')][_0x67d1('0x3f')]){_0x1fcca3[_0x67d1('0x40')]=[{'all':!![]}];}return db[_0x67d1('0x2b')]['findAll'](_0x1fcca3);})[_0x67d1('0x21')](function(_0x477e07){_0x1e7db5['rows']=_0x477e07;return _0x1e7db5;})[_0x67d1('0x21')](respondWithFilteredResult(_0x129001,_0x1fcca3))[_0x67d1('0x41')](handleError(_0x129001,null));};exports['show']=function(_0x243604,_0x3eb339){var _0x4d96b1={'raw':!![],'where':{'id':_0x243604[_0x67d1('0x42')]['id']}},_0x3b6963={};_0x3b6963['model']=_[_0x67d1('0x43')](db['Template'][_0x67d1('0x44')]);_0x3b6963['query']=_[_0x67d1('0x43')](_0x243604['query']);_0x3b6963['filters']=_[_0x67d1('0x32')](_0x3b6963[_0x67d1('0x2f')],_0x3b6963[_0x67d1('0x30')]);_0x4d96b1[_0x67d1('0x33')]=_[_0x67d1('0x32')](_0x3b6963[_0x67d1('0x2f')],qs[_0x67d1('0x34')](_0x243604[_0x67d1('0x30')][_0x67d1('0x34')]));_0x4d96b1[_0x67d1('0x33')]=_0x4d96b1[_0x67d1('0x33')][_0x67d1('0x35')]?_0x4d96b1[_0x67d1('0x33')]:_0x3b6963[_0x67d1('0x2f')];if(_0x243604[_0x67d1('0x30')][_0x67d1('0x3f')]){_0x4d96b1[_0x67d1('0x40')]=[{'all':!![]}];}_0x4d96b1=_[_0x67d1('0x3d')]({},_0x4d96b1,_0x243604[_0x67d1('0x3e')]);return db[_0x67d1('0x2b')][_0x67d1('0x45')](_0x4d96b1)[_0x67d1('0x21')](handleEntityNotFound(_0x3eb339,null))[_0x67d1('0x21')](respondWithResult(_0x3eb339,null))['catch'](handleError(_0x3eb339,null));};exports[_0x67d1('0x46')]=function(_0xe56baf,_0x16bc09){return db[_0x67d1('0x2b')][_0x67d1('0x46')](_0xe56baf[_0x67d1('0x47')],{})['then'](function(_0xdd9a29){var _0x165c11=_0xe56baf[_0x67d1('0x48')][_0x67d1('0x22')]({'plain':!![]});if(!_0x165c11)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x165c11['role']===_0x67d1('0x48')){var _0x277151=_0xdd9a29[_0x67d1('0x22')]({'plain':!![]});var _0x3d9863=_0x67d1('0x23');return db[_0x67d1('0x49')][_0x67d1('0x45')]({'where':{'name':_0x3d9863,'userProfileId':_0x165c11[_0x67d1('0x4a')]},'raw':!![]})[_0x67d1('0x21')](function(_0x3d1bc1){if(_0x3d1bc1&&_0x3d1bc1[_0x67d1('0x4b')]===0x0){return db['UserProfileResource'][_0x67d1('0x46')]({'name':_0x277151[_0x67d1('0x28')],'resourceId':_0x277151['id'],'type':_0x3d1bc1[_0x67d1('0x28')],'sectionId':_0x3d1bc1['id']},{})[_0x67d1('0x21')](function(){return _0xdd9a29;});}else{return _0xdd9a29;}})[_0x67d1('0x41')](function(_0x109a23){logger[_0x67d1('0x26')](_0x67d1('0x4c'),_0x109a23);throw _0x109a23;});}return _0xdd9a29;})['then'](respondWithResult(_0x16bc09,0xc9))[_0x67d1('0x41')](handleError(_0x16bc09,null));};exports['update']=function(_0x4392f3,_0x513b96){if(_0x4392f3[_0x67d1('0x47')]['id']){delete _0x4392f3[_0x67d1('0x47')]['id'];}return db[_0x67d1('0x2b')][_0x67d1('0x45')]({'where':{'id':_0x4392f3['params']['id']}})[_0x67d1('0x21')](handleEntityNotFound(_0x513b96,null))['then'](saveUpdates(_0x4392f3['body'],null))['then'](respondWithResult(_0x513b96,null))[_0x67d1('0x41')](handleError(_0x513b96,null));};exports[_0x67d1('0x25')]=function(_0x2f53e8,_0x3097ec){return db[_0x67d1('0x2b')]['find']({'where':{'id':_0x2f53e8[_0x67d1('0x42')]['id']}})[_0x67d1('0x21')](handleEntityNotFound(_0x3097ec,null))[_0x67d1('0x21')](removeEntity(_0x3097ec,null))[_0x67d1('0x41')](handleError(_0x3097ec,null));};
\ No newline at end of file
+var _0x353f=['rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','findAll','rows','catch','params','fields','include','find','create','role','user','UserProfileSection','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','Templates','end','error','name','send','index','map','Template'];(function(_0x64fa5d,_0x4ba48d){var _0x39618c=function(_0x4e0672){while(--_0x4e0672){_0x64fa5d['push'](_0x64fa5d['shift']());}};_0x39618c(++_0x4ba48d);}(_0x353f,0x71));var _0xf353=function(_0x349120,_0x219139){_0x349120=_0x349120-0x0;var _0x494325=_0x353f[_0x349120];return _0x494325;};'use strict';var emlformat=require(_0xf353('0x0'));var rimraf=require(_0xf353('0x1'));var zipdir=require(_0xf353('0x2'));var jsonpatch=require(_0xf353('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xf353('0x4'));var Mustache=require(_0xf353('0x5'));var util=require(_0xf353('0x6'));var path=require(_0xf353('0x7'));var sox=require('sox');var csv=require(_0xf353('0x8'));var ejs=require(_0xf353('0x9'));var fs=require('fs');var fs_extra=require(_0xf353('0xa'));var _=require('lodash');var squel=require(_0xf353('0xb'));var crypto=require(_0xf353('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xf353('0xd'));var toCsv=require(_0xf353('0x8'));var querystring=require(_0xf353('0xe'));var Papa=require(_0xf353('0xf'));var Redis=require(_0xf353('0x10'));var authService=require(_0xf353('0x11'));var qs=require(_0xf353('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf353('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xf353('0x14'));var config=require(_0xf353('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xf353('0x16'))['db'];function respondWithStatusCode(_0x5afcba,_0x692378){_0x692378=_0x692378||0xcc;return function(_0x5736e1){if(_0x5736e1){return _0x5afcba[_0xf353('0x17')](_0x692378);}return _0x5afcba['status'](_0x692378)['end']();};}function respondWithResult(_0x67d5c9,_0xa24e38){_0xa24e38=_0xa24e38||0xc8;return function(_0x31bc5a){if(_0x31bc5a){return _0x67d5c9[_0xf353('0x18')](_0xa24e38)[_0xf353('0x19')](_0x31bc5a);}};}function respondWithFilteredResult(_0x1158b7,_0x4936b1){return function(_0x2ddb94){if(_0x2ddb94){var _0x506ffe=typeof _0x4936b1[_0xf353('0x1a')]===_0xf353('0x1b')&&typeof _0x4936b1['limit']===_0xf353('0x1b');var _0x79f08d=_0x2ddb94['count'];var _0x4dd8bf=_0x506ffe?0x0:_0x4936b1[_0xf353('0x1a')];var _0x2245ae=_0x506ffe?_0x2ddb94[_0xf353('0x1c')]:_0x4936b1['offset']+_0x4936b1[_0xf353('0x1d')];var _0x3bd3e6;if(_0x2245ae>=_0x79f08d){_0x2245ae=_0x79f08d;_0x3bd3e6=0xc8;}else{_0x3bd3e6=0xce;}_0x1158b7['status'](_0x3bd3e6);return _0x1158b7[_0xf353('0x1e')](_0xf353('0x1f'),_0x4dd8bf+'-'+_0x2245ae+'/'+_0x79f08d)[_0xf353('0x19')](_0x2ddb94);}return null;};}function patchUpdates(_0x230e1d){return function(_0x1db255){try{jsonpatch[_0xf353('0x20')](_0x1db255,_0x230e1d,!![]);}catch(_0x17c2a7){return BPromise[_0xf353('0x21')](_0x17c2a7);}return _0x1db255[_0xf353('0x22')]();};}function saveUpdates(_0x51f5fd,_0x2f86e1){return function(_0x4aa667){if(_0x4aa667){return _0x4aa667[_0xf353('0x23')](_0x51f5fd)[_0xf353('0x24')](function(_0x159b3b){return _0x159b3b;});}return null;};}function removeEntity(_0x564772,_0x1a442d){return function(_0x3e73fa){if(_0x3e73fa){return _0x3e73fa[_0xf353('0x25')]()[_0xf353('0x24')](function(){var _0x3242b9=_0x3e73fa[_0xf353('0x26')]({'plain':!![]});var _0x20bd3b=_0xf353('0x27');return db['UserProfileResource'][_0xf353('0x25')]({'where':{'type':_0x20bd3b,'resourceId':_0x3242b9['id']}})[_0xf353('0x24')](function(){return _0x3e73fa;});})[_0xf353('0x24')](function(){_0x564772[_0xf353('0x18')](0xcc)[_0xf353('0x28')]();});}};}function handleEntityNotFound(_0x261831,_0x5ec893){return function(_0x10a197){if(!_0x10a197){_0x261831[_0xf353('0x17')](0x194);}return _0x10a197;};}function handleError(_0x133d5c,_0x25528a){_0x25528a=_0x25528a||0x1f4;return function(_0x504959){logger[_0xf353('0x29')](_0x504959['stack']);if(_0x504959[_0xf353('0x2a')]){delete _0x504959[_0xf353('0x2a')];}_0x133d5c[_0xf353('0x18')](_0x25528a)[_0xf353('0x2b')](_0x504959);};}exports[_0xf353('0x2c')]=function(_0x4e83da,_0x1434a7){var _0x180d8e={},_0x52cbf6={},_0x1e9cb4={'count':0x0,'rows':[]};var _0x36f4c3=_[_0xf353('0x2d')](db[_0xf353('0x2e')][_0xf353('0x2f')],function(_0x410293){return{'name':_0x410293[_0xf353('0x30')],'type':_0x410293['type']['key']};});_0x52cbf6[_0xf353('0x31')]=_[_0xf353('0x2d')](_0x36f4c3,_0xf353('0x2a'));_0x52cbf6[_0xf353('0x32')]=_[_0xf353('0x33')](_0x4e83da[_0xf353('0x32')]);_0x52cbf6[_0xf353('0x34')]=_[_0xf353('0x35')](_0x52cbf6[_0xf353('0x31')],_0x52cbf6['query']);_0x180d8e[_0xf353('0x36')]=_['intersection'](_0x52cbf6[_0xf353('0x31')],qs['fields'](_0x4e83da['query']['fields']));_0x180d8e[_0xf353('0x36')]=_0x180d8e[_0xf353('0x36')][_0xf353('0x37')]?_0x180d8e[_0xf353('0x36')]:_0x52cbf6[_0xf353('0x31')];if(!_0x4e83da[_0xf353('0x32')][_0xf353('0x38')]('nolimit')){_0x180d8e[_0xf353('0x1d')]=qs[_0xf353('0x1d')](_0x4e83da[_0xf353('0x32')][_0xf353('0x1d')]);_0x180d8e[_0xf353('0x1a')]=qs['offset'](_0x4e83da['query'][_0xf353('0x1a')]);}_0x180d8e[_0xf353('0x39')]=qs[_0xf353('0x3a')](_0x4e83da['query']['sort']);_0x180d8e[_0xf353('0x3b')]=qs[_0xf353('0x34')](_[_0xf353('0x3c')](_0x4e83da[_0xf353('0x32')],_0x52cbf6[_0xf353('0x34')]),_0x36f4c3);if(_0x4e83da[_0xf353('0x32')][_0xf353('0x3d')]){_0x180d8e[_0xf353('0x3b')]=_[_0xf353('0x3e')](_0x180d8e[_0xf353('0x3b')],{'$or':_[_0xf353('0x2d')](_0x36f4c3,function(_0x183f95){if(_0x183f95[_0xf353('0x3f')]!==_0xf353('0x40')){var _0x229ca5={};_0x229ca5[_0x183f95[_0xf353('0x2a')]]={'$like':'%'+_0x4e83da['query'][_0xf353('0x3d')]+'%'};return _0x229ca5;}})});}_0x180d8e=_[_0xf353('0x3e')]({},_0x180d8e,_0x4e83da[_0xf353('0x41')]);var _0x428db1={'where':_0x180d8e[_0xf353('0x3b')]};return db['Template'][_0xf353('0x1c')](_0x428db1)[_0xf353('0x24')](function(_0x5dd2ea){_0x1e9cb4[_0xf353('0x1c')]=_0x5dd2ea;if(_0x4e83da[_0xf353('0x32')]['includeAll']){_0x180d8e['include']=[{'all':!![]}];}return db['Template'][_0xf353('0x42')](_0x180d8e);})[_0xf353('0x24')](function(_0x31758f){_0x1e9cb4[_0xf353('0x43')]=_0x31758f;return _0x1e9cb4;})['then'](respondWithFilteredResult(_0x1434a7,_0x180d8e))[_0xf353('0x44')](handleError(_0x1434a7,null));};exports['show']=function(_0x33e76f,_0xadd4c2){var _0x540a9e={'raw':!![],'where':{'id':_0x33e76f[_0xf353('0x45')]['id']}},_0x23f1d4={};_0x23f1d4['model']=_[_0xf353('0x33')](db['Template'][_0xf353('0x2f')]);_0x23f1d4['query']=_['keys'](_0x33e76f['query']);_0x23f1d4['filters']=_['intersection'](_0x23f1d4[_0xf353('0x31')],_0x23f1d4[_0xf353('0x32')]);_0x540a9e[_0xf353('0x36')]=_[_0xf353('0x35')](_0x23f1d4[_0xf353('0x31')],qs[_0xf353('0x46')](_0x33e76f[_0xf353('0x32')]['fields']));_0x540a9e['attributes']=_0x540a9e[_0xf353('0x36')][_0xf353('0x37')]?_0x540a9e[_0xf353('0x36')]:_0x23f1d4['model'];if(_0x33e76f[_0xf353('0x32')]['includeAll']){_0x540a9e[_0xf353('0x47')]=[{'all':!![]}];}_0x540a9e=_[_0xf353('0x3e')]({},_0x540a9e,_0x33e76f[_0xf353('0x41')]);return db[_0xf353('0x2e')][_0xf353('0x48')](_0x540a9e)[_0xf353('0x24')](handleEntityNotFound(_0xadd4c2,null))[_0xf353('0x24')](respondWithResult(_0xadd4c2,null))[_0xf353('0x44')](handleError(_0xadd4c2,null));};exports[_0xf353('0x49')]=function(_0x5622ec,_0x46b5cc){return db[_0xf353('0x2e')][_0xf353('0x49')](_0x5622ec['body'],{})[_0xf353('0x24')](function(_0x15c0ae){var _0x31746d=_0x5622ec['user'][_0xf353('0x26')]({'plain':!![]});if(!_0x31746d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x31746d[_0xf353('0x4a')]===_0xf353('0x4b')){var _0xa3de03=_0x15c0ae[_0xf353('0x26')]({'plain':!![]});var _0x2fc261='Templates';return db[_0xf353('0x4c')]['find']({'where':{'name':_0x2fc261,'userProfileId':_0x31746d['userProfileId']},'raw':!![]})[_0xf353('0x24')](function(_0x4540c1){if(_0x4540c1&&_0x4540c1['autoAssociation']===0x0){return db[_0xf353('0x4d')]['create']({'name':_0xa3de03['name'],'resourceId':_0xa3de03['id'],'type':_0x4540c1[_0xf353('0x2a')],'sectionId':_0x4540c1['id']},{})[_0xf353('0x24')](function(){return _0x15c0ae;});}else{return _0x15c0ae;}})[_0xf353('0x44')](function(_0x4cc19e){logger[_0xf353('0x29')](_0xf353('0x4e'),_0x4cc19e);throw _0x4cc19e;});}return _0x15c0ae;})['then'](respondWithResult(_0x46b5cc,0xc9))['catch'](handleError(_0x46b5cc,null));};exports[_0xf353('0x23')]=function(_0x5cfdfa,_0x303854){if(_0x5cfdfa[_0xf353('0x4f')]['id']){delete _0x5cfdfa[_0xf353('0x4f')]['id'];}return db[_0xf353('0x2e')][_0xf353('0x48')]({'where':{'id':_0x5cfdfa[_0xf353('0x45')]['id']}})['then'](handleEntityNotFound(_0x303854,null))['then'](saveUpdates(_0x5cfdfa[_0xf353('0x4f')],null))[_0xf353('0x24')](respondWithResult(_0x303854,null))[_0xf353('0x44')](handleError(_0x303854,null));};exports[_0xf353('0x25')]=function(_0x46c0eb,_0x5e1fd9){return db[_0xf353('0x2e')][_0xf353('0x48')]({'where':{'id':_0x46c0eb[_0xf353('0x45')]['id']}})[_0xf353('0x24')](handleEntityNotFound(_0x5e1fd9,null))['then'](removeEntity(_0x5e1fd9,null))[_0xf353('0x44')](handleError(_0x5e1fd9,null));};
\ No newline at end of file
index d642af3..68bd448 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7e5a=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./template.attributes','exports','define','tools_templates','lodash','util'];(function(_0x88cd7b,_0x4c884c){var _0x56fcc8=function(_0x513b3d){while(--_0x513b3d){_0x88cd7b['push'](_0x88cd7b['shift']());}};_0x56fcc8(++_0x4c884c);}(_0x7e5a,0x191));var _0xa7e5=function(_0x194a93,_0x200027){_0x194a93=_0x194a93-0x0;var _0x38da03=_0x7e5a[_0x194a93];return _0x38da03;};'use strict';var _=require(_0xa7e5('0x0'));var util=require(_0xa7e5('0x1'));var logger=require(_0xa7e5('0x2'))(_0xa7e5('0x3'));var moment=require(_0xa7e5('0x4'));var BPromise=require(_0xa7e5('0x5'));var rp=require(_0xa7e5('0x6'));var fs=require('fs');var path=require(_0xa7e5('0x7'));var rimraf=require('rimraf');var config=require(_0xa7e5('0x8'));var attributes=require(_0xa7e5('0x9'));module[_0xa7e5('0xa')]=function(_0xaf89ca,_0x415dd2){return _0xaf89ca[_0xa7e5('0xb')]('Template',attributes,{'tableName':_0xa7e5('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7711=['exports','Template','tools_templates','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./template.attributes'];(function(_0x575b72,_0x1a7eb1){var _0x561c57=function(_0x10e401){while(--_0x10e401){_0x575b72['push'](_0x575b72['shift']());}};_0x561c57(++_0x1a7eb1);}(_0x7711,0x1ca));var _0x1771=function(_0x521d3b,_0x25bbc0){_0x521d3b=_0x521d3b-0x0;var _0x502a8e=_0x7711[_0x521d3b];return _0x502a8e;};'use strict';var _=require(_0x1771('0x0'));var util=require(_0x1771('0x1'));var logger=require(_0x1771('0x2'))(_0x1771('0x3'));var moment=require(_0x1771('0x4'));var BPromise=require(_0x1771('0x5'));var rp=require(_0x1771('0x6'));var fs=require('fs');var path=require(_0x1771('0x7'));var rimraf=require('rimraf');var config=require(_0x1771('0x8'));var attributes=require(_0x1771('0x9'));module[_0x1771('0xa')]=function(_0x2cd55f,_0x3cc5e4){return _0x2cd55f['define'](_0x1771('0xb'),attributes,{'tableName':_0x1771('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index ceaf236..e9e9042 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x09e9=['bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','error','code','message','Template,\x20%s,\x20%s','result','catch','Template','findAll','options','raw','where','attributes','limit','include','map','model','GetTemplate','stringify','lodash','util','moment'];(function(_0x4b2a52,_0x27e2b3){var _0x3a2e1b=function(_0x2ddd24){while(--_0x2ddd24){_0x4b2a52['push'](_0x4b2a52['shift']());}};_0x3a2e1b(++_0x27e2b3);}(_0x09e9,0x1cb));var _0x909e=function(_0xd1d19a,_0x1933f0){_0xd1d19a=_0xd1d19a-0x0;var _0x52a79d=_0x09e9[_0xd1d19a];return _0x52a79d;};'use strict';var _=require(_0x909e('0x0'));var util=require(_0x909e('0x1'));var moment=require(_0x909e('0x2'));var BPromise=require(_0x909e('0x3'));var rs=require(_0x909e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x909e('0x5'));var logger=require('../../config/logger')(_0x909e('0x6'));var config=require(_0x909e('0x7'));var jayson=require(_0x909e('0x8'));var client=jayson[_0x909e('0x9')][_0x909e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4c1f77,_0x2288d7,_0x1b920d){return new BPromise(function(_0xbd9a10,_0x3c4a0c){return client['request'](_0x4c1f77,_0x1b920d)[_0x909e('0xb')](function(_0x2be565){logger[_0x909e('0xc')]('Template,\x20%s,\x20%s',_0x2288d7,_0x909e('0xd'));logger[_0x909e('0xe')]('Template,\x20%s,\x20%s,\x20%s',_0x2288d7,_0x909e('0xd'),JSON['stringify'](_0x2be565));if(_0x2be565['error']){if(_0x2be565[_0x909e('0xf')][_0x909e('0x10')]===0x1f4){logger[_0x909e('0xf')]('Template,\x20%s,\x20%s',_0x2288d7,_0x2be565[_0x909e('0xf')]['message']);return _0x3c4a0c(_0x2be565[_0x909e('0xf')][_0x909e('0x11')]);}logger[_0x909e('0xf')](_0x909e('0x12'),_0x2288d7,_0x2be565['error']['message']);return _0xbd9a10(_0x2be565['error'][_0x909e('0x11')]);}else{logger[_0x909e('0xc')](_0x909e('0x12'),_0x2288d7,'request\x20sent');_0xbd9a10(_0x2be565[_0x909e('0x13')][_0x909e('0x11')]);}})[_0x909e('0x14')](function(_0x3442c7){logger[_0x909e('0xf')](_0x909e('0x12'),_0x2288d7,_0x3442c7);_0x3c4a0c(_0x3442c7);});});}exports['GetTemplate']=function(_0x523ca4){var _0x1a7b97=this;return new Promise(function(_0x11aa8d,_0x12b725){return db[_0x909e('0x15')][_0x909e('0x16')]({'raw':_0x523ca4[_0x909e('0x17')]?_0x523ca4['options'][_0x909e('0x18')]===undefined?!![]:![]:!![],'where':_0x523ca4[_0x909e('0x17')]?_0x523ca4['options'][_0x909e('0x19')]||null:null,'attributes':_0x523ca4[_0x909e('0x17')]?_0x523ca4[_0x909e('0x17')][_0x909e('0x1a')]||null:null,'limit':_0x523ca4[_0x909e('0x17')]?_0x523ca4[_0x909e('0x17')][_0x909e('0x1b')]||null:null,'include':_0x523ca4[_0x909e('0x17')]?_0x523ca4[_0x909e('0x17')][_0x909e('0x1c')]?_[_0x909e('0x1d')](_0x523ca4[_0x909e('0x17')][_0x909e('0x1c')],function(_0x2e8b62){return{'model':db[_0x2e8b62[_0x909e('0x1e')]],'as':_0x2e8b62['as'],'attributes':_0x2e8b62[_0x909e('0x1a')],'include':_0x2e8b62[_0x909e('0x1c')]?_[_0x909e('0x1d')](_0x2e8b62[_0x909e('0x1c')],function(_0x570c7e){return{'model':db[_0x570c7e[_0x909e('0x1e')]],'as':_0x570c7e['as'],'attributes':_0x570c7e['attributes'],'include':_0x570c7e[_0x909e('0x1c')]?_[_0x909e('0x1d')](_0x570c7e[_0x909e('0x1c')],function(_0x5db456){return{'model':db[_0x5db456[_0x909e('0x1e')]],'as':_0x5db456['as'],'attributes':_0x5db456['attributes']};}):[]};}):[]};}):[]:[]})[_0x909e('0xb')](function(_0x77b00c){logger['info'](_0x909e('0x1f'),_0x523ca4);logger[_0x909e('0xe')](_0x909e('0x1f'),_0x523ca4,JSON[_0x909e('0x20')](_0x77b00c));_0x11aa8d(_0x77b00c);})['catch'](function(_0x5bf478){logger[_0x909e('0xf')]('GetTemplate',_0x5bf478[_0x909e('0x11')],_0x523ca4);_0x12b725(_0x1a7b97[_0x909e('0xf')](0x1f4,_0x5bf478[_0x909e('0x11')]));});});};
\ No newline at end of file
+var _0x1a67=['stringify','error','code','Template,\x20%s,\x20%s','message','info','result','catch','GetTemplate','Template','findAll','options','where','limit','include','model','attributes','map','debug','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','then','request\x20sent','Template,\x20%s,\x20%s,\x20%s'];(function(_0x4c112d,_0x20c0cc){var _0xd3ba42=function(_0x2b2233){while(--_0x2b2233){_0x4c112d['push'](_0x4c112d['shift']());}};_0xd3ba42(++_0x20c0cc);}(_0x1a67,0x1c5));var _0x71a6=function(_0x4c5a01,_0x425581){_0x4c5a01=_0x4c5a01-0x0;var _0x460655=_0x1a67[_0x4c5a01];return _0x460655;};'use strict';var _=require(_0x71a6('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x71a6('0x1'));var rs=require(_0x71a6('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x71a6('0x3'))['db'];var utils=require(_0x71a6('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x71a6('0x5'));var jayson=require(_0x71a6('0x6'));var client=jayson[_0x71a6('0x7')][_0x71a6('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1b0639,_0x19a03d,_0x236196){return new BPromise(function(_0x2da358,_0x477db7){return client['request'](_0x1b0639,_0x236196)[_0x71a6('0x9')](function(_0x310f92){logger['info']('Template,\x20%s,\x20%s',_0x19a03d,_0x71a6('0xa'));logger['debug'](_0x71a6('0xb'),_0x19a03d,_0x71a6('0xa'),JSON[_0x71a6('0xc')](_0x310f92));if(_0x310f92[_0x71a6('0xd')]){if(_0x310f92[_0x71a6('0xd')][_0x71a6('0xe')]===0x1f4){logger[_0x71a6('0xd')](_0x71a6('0xf'),_0x19a03d,_0x310f92[_0x71a6('0xd')][_0x71a6('0x10')]);return _0x477db7(_0x310f92[_0x71a6('0xd')][_0x71a6('0x10')]);}logger[_0x71a6('0xd')]('Template,\x20%s,\x20%s',_0x19a03d,_0x310f92[_0x71a6('0xd')]['message']);return _0x2da358(_0x310f92[_0x71a6('0xd')][_0x71a6('0x10')]);}else{logger[_0x71a6('0x11')](_0x71a6('0xf'),_0x19a03d,_0x71a6('0xa'));_0x2da358(_0x310f92[_0x71a6('0x12')][_0x71a6('0x10')]);}})[_0x71a6('0x13')](function(_0xc8ed30){logger['error'](_0x71a6('0xf'),_0x19a03d,_0xc8ed30);_0x477db7(_0xc8ed30);});});}exports[_0x71a6('0x14')]=function(_0x323767){var _0x3d1d7e=this;return new Promise(function(_0x52142f,_0x3889ba){return db[_0x71a6('0x15')][_0x71a6('0x16')]({'raw':_0x323767[_0x71a6('0x17')]?_0x323767[_0x71a6('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x323767[_0x71a6('0x17')]?_0x323767[_0x71a6('0x17')][_0x71a6('0x18')]||null:null,'attributes':_0x323767[_0x71a6('0x17')]?_0x323767[_0x71a6('0x17')]['attributes']||null:null,'limit':_0x323767[_0x71a6('0x17')]?_0x323767[_0x71a6('0x17')][_0x71a6('0x19')]||null:null,'include':_0x323767[_0x71a6('0x17')]?_0x323767[_0x71a6('0x17')][_0x71a6('0x1a')]?_['map'](_0x323767['options'][_0x71a6('0x1a')],function(_0x507d0d){return{'model':db[_0x507d0d[_0x71a6('0x1b')]],'as':_0x507d0d['as'],'attributes':_0x507d0d[_0x71a6('0x1c')],'include':_0x507d0d[_0x71a6('0x1a')]?_[_0x71a6('0x1d')](_0x507d0d['include'],function(_0x481daa){return{'model':db[_0x481daa[_0x71a6('0x1b')]],'as':_0x481daa['as'],'attributes':_0x481daa[_0x71a6('0x1c')],'include':_0x481daa[_0x71a6('0x1a')]?_['map'](_0x481daa[_0x71a6('0x1a')],function(_0xa0d0d7){return{'model':db[_0xa0d0d7['model']],'as':_0xa0d0d7['as'],'attributes':_0xa0d0d7[_0x71a6('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x71a6('0x9')](function(_0x112b2a){logger[_0x71a6('0x11')](_0x71a6('0x14'),_0x323767);logger[_0x71a6('0x1e')](_0x71a6('0x14'),_0x323767,JSON[_0x71a6('0xc')](_0x112b2a));_0x52142f(_0x112b2a);})[_0x71a6('0x13')](function(_0x4e0f74){logger['error'](_0x71a6('0x14'),_0x4e0f74[_0x71a6('0x10')],_0x323767);_0x3889ba(_0x3d1d7e['error'](0x1f4,_0x4e0f74[_0x71a6('0x10')]));});});};
\ No newline at end of file
index 1289ae6..faee33c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd2be=['../../components/interaction/service','../../config/environment','./trigger.controller','isAuthenticated','index','get','/:id','show','getAllConditions','/:id/any_conditions','post','addAllCondition','addAnyCondition','/:id/actions','addAction','put','update','delete','exports','path','connect-timeout','express','../../components/auth/service'];(function(_0x16cd37,_0x3deb36){var _0x2e5885=function(_0x117635){while(--_0x117635){_0x16cd37['push'](_0x16cd37['shift']());}};_0x2e5885(++_0x3deb36);}(_0xd2be,0x86));var _0xed2b=function(_0x2317af,_0x1332d3){_0x2317af=_0x2317af-0x0;var _0x3cb58d=_0xd2be[_0x2317af];return _0x3cb58d;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xed2b('0x0'));var timeout=require(_0xed2b('0x1'));var express=require(_0xed2b('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xed2b('0x3'));var interaction=require(_0xed2b('0x4'));var config=require(_0xed2b('0x5'));var controller=require(_0xed2b('0x6'));router['get']('/',auth[_0xed2b('0x7')](),controller[_0xed2b('0x8')]);router[_0xed2b('0x9')](_0xed2b('0xa'),auth['isAuthenticated'](),controller[_0xed2b('0xb')]);router['get']('/:id/all_conditions',auth['isAuthenticated'](),controller[_0xed2b('0xc')]);router[_0xed2b('0x9')](_0xed2b('0xd'),auth[_0xed2b('0x7')](),controller['getAnyConditions']);router['get']('/:id/actions',auth['isAuthenticated'](),controller['getActions']);router[_0xed2b('0xe')]('/',auth[_0xed2b('0x7')](),controller['create']);router[_0xed2b('0xe')]('/:id/all_conditions',auth[_0xed2b('0x7')](),controller[_0xed2b('0xf')]);router[_0xed2b('0xe')](_0xed2b('0xd'),auth[_0xed2b('0x7')](),controller[_0xed2b('0x10')]);router[_0xed2b('0xe')](_0xed2b('0x11'),auth['isAuthenticated'](),controller[_0xed2b('0x12')]);router[_0xed2b('0x13')]('/:id',auth['isAuthenticated'](),controller[_0xed2b('0x14')]);router[_0xed2b('0x15')](_0xed2b('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0xed2b('0x16')]=router;
\ No newline at end of file
+var _0x12d0=['/:id','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./trigger.controller','get','isAuthenticated','/:id/all_conditions','/:id/any_conditions','/:id/actions','getActions','post','create','addAllCondition','addAnyCondition','addAction','put'];(function(_0x4e6ae6,_0x49dba6){var _0x23c108=function(_0x1bc103){while(--_0x1bc103){_0x4e6ae6['push'](_0x4e6ae6['shift']());}};_0x23c108(++_0x49dba6);}(_0x12d0,0x1be));var _0x012d=function(_0x30b33d,_0x115074){_0x30b33d=_0x30b33d-0x0;var _0x30a83f=_0x12d0[_0x30b33d];return _0x30a83f;};'use strict';var multer=require(_0x012d('0x0'));var util=require(_0x012d('0x1'));var path=require(_0x012d('0x2'));var timeout=require(_0x012d('0x3'));var express=require(_0x012d('0x4'));var router=express[_0x012d('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x012d('0x6'));var interaction=require(_0x012d('0x7'));var config=require(_0x012d('0x8'));var controller=require(_0x012d('0x9'));router[_0x012d('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x012d('0xa')]('/:id',auth[_0x012d('0xb')](),controller['show']);router[_0x012d('0xa')](_0x012d('0xc'),auth[_0x012d('0xb')](),controller['getAllConditions']);router[_0x012d('0xa')](_0x012d('0xd'),auth[_0x012d('0xb')](),controller['getAnyConditions']);router[_0x012d('0xa')](_0x012d('0xe'),auth[_0x012d('0xb')](),controller[_0x012d('0xf')]);router[_0x012d('0x10')]('/',auth['isAuthenticated'](),controller[_0x012d('0x11')]);router[_0x012d('0x10')](_0x012d('0xc'),auth[_0x012d('0xb')](),controller[_0x012d('0x12')]);router[_0x012d('0x10')](_0x012d('0xd'),auth['isAuthenticated'](),controller[_0x012d('0x13')]);router[_0x012d('0x10')]('/:id/actions',auth[_0x012d('0xb')](),controller[_0x012d('0x14')]);router[_0x012d('0x15')](_0x012d('0x16'),auth[_0x012d('0xb')](),controller[_0x012d('0x17')]);router[_0x012d('0x18')](_0x012d('0x16'),auth[_0x012d('0xb')](),controller['destroy']);module[_0x012d('0x19')]=router;
\ No newline at end of file
index 8f3c464..c725bda 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x07f1=['sequelize','exports','STRING','BOOLEAN'];(function(_0x2997ef,_0x55324a){var _0x28b861=function(_0x3f1c69){while(--_0x3f1c69){_0x2997ef['push'](_0x2997ef['shift']());}};_0x28b861(++_0x55324a);}(_0x07f1,0x1dc));var _0x107f=function(_0x220520,_0x1ad732){_0x220520=_0x220520-0x0;var _0x595bda=_0x07f1[_0x220520];return _0x595bda;};'use strict';var Sequelize=require(_0x107f('0x0'));module[_0x107f('0x1')]={'name':{'type':Sequelize[_0x107f('0x2')]},'channel':{'type':Sequelize[_0x107f('0x2')]},'description':{'type':Sequelize[_0x107f('0x2')]},'status':{'type':Sequelize[_0x107f('0x3')],'defaultValue':![]}};
\ No newline at end of file
+var _0xbc00=['exports','STRING','BOOLEAN','sequelize'];(function(_0x540133,_0x41783f){var _0x26b6e9=function(_0x10ebe3){while(--_0x10ebe3){_0x540133['push'](_0x540133['shift']());}};_0x26b6e9(++_0x41783f);}(_0xbc00,0x107));var _0x0bc0=function(_0x44b3bd,_0x44c97d){_0x44b3bd=_0x44b3bd-0x0;var _0x1efc4a=_0xbc00[_0x44b3bd];return _0x1efc4a;};'use strict';var Sequelize=require(_0x0bc0('0x0'));module[_0x0bc0('0x1')]={'name':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x0bc0('0x2')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x0bc0('0x3')],'defaultValue':![]}};
\ No newline at end of file
index cfabc17..67c9a6f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb08a=['lodash','squel','crypto','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','destroy','then','get','error','name','send','map','Trigger','rawAttributes','fieldName','key','model','query','keys','attributes','fields','length','nolimit','order','sort','where','filters','pick','merge','type','VIRTUAL','filter','options','includeAll','include','catch','show','params','intersection','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Triggers','find','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','TriggerAllId','Condition','addAnyCondition','getAllConditions','findOne','getAnyConditions','hasOwnProperty','addAction','TriggerId','Action','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','ejs'];(function(_0x386bcb,_0x4a6565){var _0x4fda99=function(_0x321c21){while(--_0x321c21){_0x386bcb['push'](_0x386bcb['shift']());}};_0x4fda99(++_0x4a6565);}(_0xb08a,0x15c));var _0xab08=function(_0x446208,_0xb483fb){_0x446208=_0x446208-0x0;var _0xe49563=_0xb08a[_0x446208];return _0xe49563;};'use strict';var emlformat=require(_0xab08('0x0'));var rimraf=require(_0xab08('0x1'));var zipdir=require(_0xab08('0x2'));var jsonpatch=require(_0xab08('0x3'));var rp=require(_0xab08('0x4'));var moment=require('moment');var BPromise=require(_0xab08('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xab08('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xab08('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xab08('0x8'));var squel=require(_0xab08('0x9'));var crypto=require(_0xab08('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xab08('0xb'));var querystring=require(_0xab08('0xc'));var Papa=require(_0xab08('0xd'));var Redis=require(_0xab08('0xe'));var authService=require(_0xab08('0xf'));var qs=require(_0xab08('0x10'));var as=require(_0xab08('0x11'));var hardwareService=require(_0xab08('0x12'));var logger=require('../../config/logger')(_0xab08('0x13'));var utils=require(_0xab08('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xab08('0x15'));var db=require(_0xab08('0x16'))['db'];function respondWithStatusCode(_0x33ee83,_0x47d903){_0x47d903=_0x47d903||0xcc;return function(_0x20c169){if(_0x20c169){return _0x33ee83['sendStatus'](_0x47d903);}return _0x33ee83[_0xab08('0x17')](_0x47d903)[_0xab08('0x18')]();};}function respondWithResult(_0x3f0711,_0x5bc18d){_0x5bc18d=_0x5bc18d||0xc8;return function(_0x1d6cad){if(_0x1d6cad){return _0x3f0711[_0xab08('0x17')](_0x5bc18d)[_0xab08('0x19')](_0x1d6cad);}};}function respondWithFilteredResult(_0x1490a3,_0x419651){return function(_0x1c60d6){if(_0x1c60d6){var _0x247a7=typeof _0x419651[_0xab08('0x1a')]===_0xab08('0x1b')&&typeof _0x419651[_0xab08('0x1c')]===_0xab08('0x1b');var _0x508694=_0x1c60d6[_0xab08('0x1d')];var _0x1b8da5=_0x247a7?0x0:_0x419651[_0xab08('0x1a')];var _0x4dba2d=_0x247a7?_0x1c60d6['count']:_0x419651[_0xab08('0x1a')]+_0x419651[_0xab08('0x1c')];var _0x191872;if(_0x4dba2d>=_0x508694){_0x4dba2d=_0x508694;_0x191872=0xc8;}else{_0x191872=0xce;}_0x1490a3[_0xab08('0x17')](_0x191872);return _0x1490a3[_0xab08('0x1e')](_0xab08('0x1f'),_0x1b8da5+'-'+_0x4dba2d+'/'+_0x508694)[_0xab08('0x19')](_0x1c60d6);}return null;};}function patchUpdates(_0x2d5ec4){return function(_0x6ec8e7){try{jsonpatch[_0xab08('0x20')](_0x6ec8e7,_0x2d5ec4,!![]);}catch(_0x2ee33c){return BPromise['reject'](_0x2ee33c);}return _0x6ec8e7['save']();};}function saveUpdates(_0x3cec55,_0x49673e){return function(_0x32fc9b){if(_0x32fc9b){return _0x32fc9b[_0xab08('0x21')](_0x3cec55)['then'](function(_0x20611c){return _0x20611c;});}return null;};}function removeEntity(_0x84b904,_0x447c4d){return function(_0x45b652){if(_0x45b652){return _0x45b652[_0xab08('0x22')]()[_0xab08('0x23')](function(){var _0x35c533=_0x45b652[_0xab08('0x24')]({'plain':!![]});var _0x3ec88c='Triggers';return db['UserProfileResource'][_0xab08('0x22')]({'where':{'type':_0x3ec88c,'resourceId':_0x35c533['id']}})[_0xab08('0x23')](function(){return _0x45b652;});})[_0xab08('0x23')](function(){_0x84b904[_0xab08('0x17')](0xcc)[_0xab08('0x18')]();});}};}function handleEntityNotFound(_0x99fa9d,_0xf5f24){return function(_0x15b3e3){if(!_0x15b3e3){_0x99fa9d['sendStatus'](0x194);}return _0x15b3e3;};}function handleError(_0x5dfd16,_0x36c95f){_0x36c95f=_0x36c95f||0x1f4;return function(_0x12448b){logger[_0xab08('0x25')](_0x12448b['stack']);if(_0x12448b['name']){delete _0x12448b[_0xab08('0x26')];}_0x5dfd16[_0xab08('0x17')](_0x36c95f)[_0xab08('0x27')](_0x12448b);};}exports['index']=function(_0x4f293d,_0x3c70aa){var _0x254d69={},_0x2336a3={},_0x1938f6={'count':0x0,'rows':[]};var _0x17582c=_[_0xab08('0x28')](db[_0xab08('0x29')][_0xab08('0x2a')],function(_0x216bef){return{'name':_0x216bef[_0xab08('0x2b')],'type':_0x216bef['type'][_0xab08('0x2c')]};});_0x2336a3[_0xab08('0x2d')]=_[_0xab08('0x28')](_0x17582c,_0xab08('0x26'));_0x2336a3[_0xab08('0x2e')]=_[_0xab08('0x2f')](_0x4f293d[_0xab08('0x2e')]);_0x2336a3['filters']=_['intersection'](_0x2336a3[_0xab08('0x2d')],_0x2336a3[_0xab08('0x2e')]);_0x254d69[_0xab08('0x30')]=_['intersection'](_0x2336a3['model'],qs[_0xab08('0x31')](_0x4f293d[_0xab08('0x2e')][_0xab08('0x31')]));_0x254d69[_0xab08('0x30')]=_0x254d69[_0xab08('0x30')][_0xab08('0x32')]?_0x254d69[_0xab08('0x30')]:_0x2336a3[_0xab08('0x2d')];if(!_0x4f293d[_0xab08('0x2e')]['hasOwnProperty'](_0xab08('0x33'))){_0x254d69[_0xab08('0x1c')]=qs['limit'](_0x4f293d[_0xab08('0x2e')][_0xab08('0x1c')]);_0x254d69[_0xab08('0x1a')]=qs[_0xab08('0x1a')](_0x4f293d[_0xab08('0x2e')][_0xab08('0x1a')]);}_0x254d69[_0xab08('0x34')]=qs[_0xab08('0x35')](_0x4f293d[_0xab08('0x2e')][_0xab08('0x35')]);_0x254d69[_0xab08('0x36')]=qs[_0xab08('0x37')](_[_0xab08('0x38')](_0x4f293d[_0xab08('0x2e')],_0x2336a3[_0xab08('0x37')]),_0x17582c);if(_0x4f293d['query']['filter']){_0x254d69[_0xab08('0x36')]=_[_0xab08('0x39')](_0x254d69[_0xab08('0x36')],{'$or':_[_0xab08('0x28')](_0x17582c,function(_0x232d83){if(_0x232d83[_0xab08('0x3a')]!==_0xab08('0x3b')){var _0x4e39c0={};_0x4e39c0[_0x232d83[_0xab08('0x26')]]={'$like':'%'+_0x4f293d[_0xab08('0x2e')][_0xab08('0x3c')]+'%'};return _0x4e39c0;}})});}_0x254d69=_[_0xab08('0x39')]({},_0x254d69,_0x4f293d[_0xab08('0x3d')]);var _0x12cd13={'where':_0x254d69[_0xab08('0x36')]};return db['Trigger'][_0xab08('0x1d')](_0x12cd13)['then'](function(_0x1b45d0){_0x1938f6[_0xab08('0x1d')]=_0x1b45d0;if(_0x4f293d['query'][_0xab08('0x3e')]){_0x254d69[_0xab08('0x3f')]=[{'all':!![]}];}return db['Trigger']['findAll'](_0x254d69);})['then'](function(_0x21a489){_0x1938f6['rows']=_0x21a489;return _0x1938f6;})[_0xab08('0x23')](respondWithFilteredResult(_0x3c70aa,_0x254d69))[_0xab08('0x40')](handleError(_0x3c70aa,null));};exports[_0xab08('0x41')]=function(_0x4e868b,_0x5a53eb){var _0x140b18={'raw':![],'where':{'id':_0x4e868b[_0xab08('0x42')]['id']}},_0x113dfb={};_0x113dfb[_0xab08('0x2d')]=_['keys'](db[_0xab08('0x29')]['rawAttributes']);_0x113dfb['query']=_[_0xab08('0x2f')](_0x4e868b[_0xab08('0x2e')]);_0x113dfb['filters']=_['intersection'](_0x113dfb['model'],_0x113dfb[_0xab08('0x2e')]);_0x140b18[_0xab08('0x30')]=_[_0xab08('0x43')](_0x113dfb['model'],qs[_0xab08('0x31')](_0x4e868b[_0xab08('0x2e')][_0xab08('0x31')]));_0x140b18[_0xab08('0x30')]=_0x140b18[_0xab08('0x30')][_0xab08('0x32')]?_0x140b18[_0xab08('0x30')]:_0x113dfb[_0xab08('0x2d')];if(_0x4e868b[_0xab08('0x2e')][_0xab08('0x3e')]){_0x140b18[_0xab08('0x3f')]=[{'all':!![]}];}_0x140b18=_[_0xab08('0x39')]({},_0x140b18,_0x4e868b['options']);return db[_0xab08('0x29')]['find'](_0x140b18)[_0xab08('0x23')](handleEntityNotFound(_0x5a53eb,null))[_0xab08('0x23')](respondWithResult(_0x5a53eb,null))[_0xab08('0x40')](handleError(_0x5a53eb,null));};exports[_0xab08('0x44')]=function(_0x284d72,_0x43820e){return db['Trigger'][_0xab08('0x44')](_0x284d72[_0xab08('0x45')],{})[_0xab08('0x23')](function(_0x12d443){var _0x39740f=_0x284d72['user'][_0xab08('0x24')]({'plain':!![]});if(!_0x39740f)throw new Error(_0xab08('0x46'));if(_0x39740f[_0xab08('0x47')]===_0xab08('0x48')){var _0x2c3a0c=_0x12d443[_0xab08('0x24')]({'plain':!![]});var _0x4a4e82=_0xab08('0x49');return db['UserProfileSection'][_0xab08('0x4a')]({'where':{'name':_0x4a4e82,'userProfileId':_0x39740f[_0xab08('0x4b')]},'raw':!![]})[_0xab08('0x23')](function(_0x3aa8b7){if(_0x3aa8b7&&_0x3aa8b7['autoAssociation']===0x0){return db[_0xab08('0x4c')][_0xab08('0x44')]({'name':_0x2c3a0c[_0xab08('0x26')],'resourceId':_0x2c3a0c['id'],'type':_0x3aa8b7[_0xab08('0x26')],'sectionId':_0x3aa8b7['id']},{})[_0xab08('0x23')](function(){return _0x12d443;});}else{return _0x12d443;}})[_0xab08('0x40')](function(_0x5646f2){logger[_0xab08('0x25')](_0xab08('0x4d'),_0x5646f2);throw _0x5646f2;});}return _0x12d443;})[_0xab08('0x23')](respondWithResult(_0x43820e,0xc9))[_0xab08('0x40')](handleError(_0x43820e,null));};exports[_0xab08('0x21')]=function(_0x348ea9,_0x5acbcb){if(_0x348ea9[_0xab08('0x45')]['id']){delete _0x348ea9['body']['id'];}return db[_0xab08('0x29')][_0xab08('0x4a')]({'where':{'id':_0x348ea9[_0xab08('0x42')]['id']}})[_0xab08('0x23')](handleEntityNotFound(_0x5acbcb,null))[_0xab08('0x23')](saveUpdates(_0x348ea9['body'],null))[_0xab08('0x23')](respondWithResult(_0x5acbcb,null))[_0xab08('0x40')](handleError(_0x5acbcb,null));};exports['destroy']=function(_0x5d5097,_0x1b4d20){return db[_0xab08('0x29')][_0xab08('0x4a')]({'where':{'id':_0x5d5097[_0xab08('0x42')]['id']}})[_0xab08('0x23')](handleEntityNotFound(_0x1b4d20,null))[_0xab08('0x23')](removeEntity(_0x1b4d20,null))['catch'](handleError(_0x1b4d20,null));};exports['addAllCondition']=function(_0x49fd28,_0x99fca5,_0xdf308f){if(_0x49fd28[_0xab08('0x45')]['id']){delete _0x49fd28[_0xab08('0x45')]['id'];}return db[_0xab08('0x29')][_0xab08('0x4a')]({'where':{'id':_0x49fd28[_0xab08('0x42')]['id']}})[_0xab08('0x23')](handleEntityNotFound(_0x99fca5,null))[_0xab08('0x23')](function(_0x1b5b64){if(_0x1b5b64){_0x49fd28[_0xab08('0x45')][_0xab08('0x4e')]=_0x1b5b64['id'];return db[_0xab08('0x4f')][_0xab08('0x44')](_0x49fd28[_0xab08('0x45')]);}})[_0xab08('0x23')](respondWithResult(_0x99fca5,null))[_0xab08('0x40')](handleError(_0x99fca5,null));};exports[_0xab08('0x50')]=function(_0x37d8f1,_0x2cf2aa,_0x575378){if(_0x37d8f1[_0xab08('0x45')]['id']){delete _0x37d8f1[_0xab08('0x45')]['id'];}return db[_0xab08('0x29')][_0xab08('0x4a')]({'where':{'id':_0x37d8f1[_0xab08('0x42')]['id']}})['then'](handleEntityNotFound(_0x2cf2aa,null))[_0xab08('0x23')](function(_0x22fb3d){if(_0x22fb3d){_0x37d8f1[_0xab08('0x45')]['TriggerAnyId']=_0x22fb3d['id'];return db[_0xab08('0x4f')]['create'](_0x37d8f1[_0xab08('0x45')]);}})['then'](respondWithResult(_0x2cf2aa,null))[_0xab08('0x40')](handleError(_0x2cf2aa,null));};exports[_0xab08('0x51')]=function(_0x73c7c3,_0x5e1bbc,_0x4cb00f){var _0x4dac06={};var _0x1489e4={};var _0x36d345;var _0x49c9a5;return db['Trigger'][_0xab08('0x52')]({'where':{'id':_0x73c7c3['params']['id']}})[_0xab08('0x23')](handleEntityNotFound(_0x5e1bbc,null))[_0xab08('0x23')](function(_0xa06415){if(_0xa06415){_0x36d345=_0xa06415;_0x1489e4[_0xab08('0x2d')]=_[_0xab08('0x2f')](db[_0xab08('0x4f')]['rawAttributes']);_0x1489e4['query']=_[_0xab08('0x2f')](_0x73c7c3[_0xab08('0x2e')]);_0x1489e4[_0xab08('0x37')]=_[_0xab08('0x43')](_0x1489e4[_0xab08('0x2d')],_0x1489e4[_0xab08('0x2e')]);_0x4dac06[_0xab08('0x30')]=_[_0xab08('0x43')](_0x1489e4[_0xab08('0x2d')],qs[_0xab08('0x31')](_0x73c7c3[_0xab08('0x2e')]['fields']));_0x4dac06[_0xab08('0x30')]=_0x4dac06[_0xab08('0x30')]['length']?_0x4dac06[_0xab08('0x30')]:_0x1489e4[_0xab08('0x2d')];_0x4dac06['order']=qs[_0xab08('0x35')](_0x73c7c3['query']['sort']);_0x4dac06[_0xab08('0x36')]=qs[_0xab08('0x37')](_[_0xab08('0x38')](_0x73c7c3['query'],_0x1489e4[_0xab08('0x37')]));if(_0x73c7c3[_0xab08('0x2e')]['filter']){_0x4dac06[_0xab08('0x36')]=_[_0xab08('0x39')](_0x4dac06['where'],{'$or':_[_0xab08('0x28')](_0x4dac06[_0xab08('0x30')],function(_0x51189d){var _0x312f57={};_0x312f57[_0x51189d]={'$like':'%'+_0x73c7c3[_0xab08('0x2e')][_0xab08('0x3c')]+'%'};return _0x312f57;})});}_0x4dac06=_['merge']({},_0x4dac06,_0x73c7c3[_0xab08('0x3d')]);return _0x36d345['getAllConditions'](_0x4dac06);}})[_0xab08('0x23')](function(_0x2f9457){if(_0x2f9457){_0x49c9a5=_0x2f9457[_0xab08('0x32')];if(!_0x73c7c3['query']['hasOwnProperty'](_0xab08('0x33'))){_0x4dac06['limit']=qs[_0xab08('0x1c')](_0x73c7c3[_0xab08('0x2e')][_0xab08('0x1c')]);_0x4dac06[_0xab08('0x1a')]=qs[_0xab08('0x1a')](_0x73c7c3[_0xab08('0x2e')]['offset']);}return _0x36d345[_0xab08('0x51')](_0x4dac06);}})[_0xab08('0x23')](function(_0x41a37d){if(_0x41a37d){return _0x41a37d?{'count':_0x49c9a5,'rows':_0x41a37d}:null;}})['then'](respondWithResult(_0x5e1bbc,null))['catch'](handleError(_0x5e1bbc,null));};exports[_0xab08('0x53')]=function(_0x4a601c,_0x592e46,_0x2bc767){var _0x16bd53={};var _0xb8862={};var _0x5d7c2d;var _0x8b7e6b;return db['Trigger'][_0xab08('0x52')]({'where':{'id':_0x4a601c[_0xab08('0x42')]['id']}})[_0xab08('0x23')](handleEntityNotFound(_0x592e46,null))[_0xab08('0x23')](function(_0x1e8ddb){if(_0x1e8ddb){_0x5d7c2d=_0x1e8ddb;_0xb8862[_0xab08('0x2d')]=_[_0xab08('0x2f')](db[_0xab08('0x4f')]['rawAttributes']);_0xb8862[_0xab08('0x2e')]=_[_0xab08('0x2f')](_0x4a601c['query']);_0xb8862[_0xab08('0x37')]=_[_0xab08('0x43')](_0xb8862[_0xab08('0x2d')],_0xb8862[_0xab08('0x2e')]);_0x16bd53['attributes']=_['intersection'](_0xb8862[_0xab08('0x2d')],qs[_0xab08('0x31')](_0x4a601c[_0xab08('0x2e')]['fields']));_0x16bd53[_0xab08('0x30')]=_0x16bd53[_0xab08('0x30')][_0xab08('0x32')]?_0x16bd53[_0xab08('0x30')]:_0xb8862[_0xab08('0x2d')];_0x16bd53[_0xab08('0x34')]=qs['sort'](_0x4a601c[_0xab08('0x2e')][_0xab08('0x35')]);_0x16bd53['where']=qs['filters'](_['pick'](_0x4a601c[_0xab08('0x2e')],_0xb8862[_0xab08('0x37')]));if(_0x4a601c['query'][_0xab08('0x3c')]){_0x16bd53[_0xab08('0x36')]=_[_0xab08('0x39')](_0x16bd53[_0xab08('0x36')],{'$or':_[_0xab08('0x28')](_0x16bd53[_0xab08('0x30')],function(_0x1aefc8){var _0x5d66c5={};_0x5d66c5[_0x1aefc8]={'$like':'%'+_0x4a601c['query'][_0xab08('0x3c')]+'%'};return _0x5d66c5;})});}_0x16bd53=_[_0xab08('0x39')]({},_0x16bd53,_0x4a601c[_0xab08('0x3d')]);return _0x5d7c2d[_0xab08('0x53')](_0x16bd53);}})[_0xab08('0x23')](function(_0x103a95){if(_0x103a95){_0x8b7e6b=_0x103a95[_0xab08('0x32')];if(!_0x4a601c[_0xab08('0x2e')][_0xab08('0x54')](_0xab08('0x33'))){_0x16bd53[_0xab08('0x1c')]=qs[_0xab08('0x1c')](_0x4a601c[_0xab08('0x2e')][_0xab08('0x1c')]);_0x16bd53[_0xab08('0x1a')]=qs[_0xab08('0x1a')](_0x4a601c[_0xab08('0x2e')]['offset']);}return _0x5d7c2d['getAnyConditions'](_0x16bd53);}})['then'](function(_0x2cb1ae){if(_0x2cb1ae){return _0x2cb1ae?{'count':_0x8b7e6b,'rows':_0x2cb1ae}:null;}})[_0xab08('0x23')](respondWithResult(_0x592e46,null))[_0xab08('0x40')](handleError(_0x592e46,null));};exports[_0xab08('0x55')]=function(_0x5c9a17,_0x14a6a6,_0x24c41){if(_0x5c9a17[_0xab08('0x45')]['id']){delete _0x5c9a17[_0xab08('0x45')]['id'];}return db[_0xab08('0x29')][_0xab08('0x4a')]({'where':{'id':_0x5c9a17[_0xab08('0x42')]['id']}})[_0xab08('0x23')](handleEntityNotFound(_0x14a6a6,null))['then'](function(_0x26d52e){if(_0x26d52e){_0x5c9a17[_0xab08('0x45')][_0xab08('0x56')]=_0x26d52e['id'];return db[_0xab08('0x57')][_0xab08('0x44')](_0x5c9a17[_0xab08('0x45')]);}})[_0xab08('0x23')](respondWithResult(_0x14a6a6,null))[_0xab08('0x40')](handleError(_0x14a6a6,null));};exports[_0xab08('0x58')]=function(_0xf94e91,_0x4560d3,_0x3fb2b5){var _0x87a5b1={};var _0x55644d={};var _0x4fe53c;var _0x48e54b;return db['Trigger'][_0xab08('0x52')]({'where':{'id':_0xf94e91[_0xab08('0x42')]['id']}})['then'](handleEntityNotFound(_0x4560d3,null))[_0xab08('0x23')](function(_0x1422e0){if(_0x1422e0){_0x4fe53c=_0x1422e0;_0x55644d['model']=_[_0xab08('0x2f')](db[_0xab08('0x57')][_0xab08('0x2a')]);_0x55644d['query']=_[_0xab08('0x2f')](_0xf94e91[_0xab08('0x2e')]);_0x55644d[_0xab08('0x37')]=_[_0xab08('0x43')](_0x55644d[_0xab08('0x2d')],_0x55644d[_0xab08('0x2e')]);_0x87a5b1[_0xab08('0x30')]=_['intersection'](_0x55644d['model'],qs['fields'](_0xf94e91[_0xab08('0x2e')]['fields']));_0x87a5b1[_0xab08('0x30')]=_0x87a5b1[_0xab08('0x30')][_0xab08('0x32')]?_0x87a5b1[_0xab08('0x30')]:_0x55644d['model'];_0x87a5b1[_0xab08('0x34')]=qs[_0xab08('0x35')](_0xf94e91['query'][_0xab08('0x35')]);_0x87a5b1[_0xab08('0x36')]=qs[_0xab08('0x37')](_[_0xab08('0x38')](_0xf94e91[_0xab08('0x2e')],_0x55644d[_0xab08('0x37')]));if(_0xf94e91['query'][_0xab08('0x3c')]){_0x87a5b1[_0xab08('0x36')]=_[_0xab08('0x39')](_0x87a5b1['where'],{'$or':_[_0xab08('0x28')](_0x87a5b1[_0xab08('0x30')],function(_0xbd74de){var _0xcdc069={};_0xcdc069[_0xbd74de]={'$like':'%'+_0xf94e91[_0xab08('0x2e')][_0xab08('0x3c')]+'%'};return _0xcdc069;})});}_0x87a5b1=_[_0xab08('0x39')]({},_0x87a5b1,_0xf94e91['options']);return _0x4fe53c[_0xab08('0x58')](_0x87a5b1);}})[_0xab08('0x23')](function(_0x5ae4e2){if(_0x5ae4e2){_0x48e54b=_0x5ae4e2[_0xab08('0x32')];if(!_0xf94e91['query'][_0xab08('0x54')]('nolimit')){_0x87a5b1[_0xab08('0x1c')]=qs[_0xab08('0x1c')](_0xf94e91['query']['limit']);_0x87a5b1['offset']=qs['offset'](_0xf94e91[_0xab08('0x2e')][_0xab08('0x1a')]);}return _0x4fe53c[_0xab08('0x58')](_0x87a5b1);}})[_0xab08('0x23')](function(_0xbe8e66){if(_0xbe8e66){return _0xbe8e66?{'count':_0x48e54b,'rows':_0xbe8e66}:null;}})['then'](respondWithResult(_0x4560d3,null))['catch'](handleError(_0x4560d3,null));};
\ No newline at end of file
+var _0x9d3c=['zip-dir','fast-json-patch','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','get','UserProfileResource','end','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','pick','where','VIRTUAL','filter','merge','options','Trigger','include','findAll','show','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Triggers','UserProfileSection','userProfileId','autoAssociation','catch','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','addAllCondition','TriggerAllId','Condition','addAnyCondition','TriggerAnyId','getAllConditions','findOne','hasOwnProperty','getAnyConditions','addAction','TriggerId','Action','getActions','eml-format','rimraf'];(function(_0x1718b5,_0x1cd76b){var _0x486aa4=function(_0x4777be){while(--_0x4777be){_0x1718b5['push'](_0x1718b5['shift']());}};_0x486aa4(++_0x1cd76b);}(_0x9d3c,0xc8));var _0xc9d3=function(_0x1f91e7,_0x3291c2){_0x1f91e7=_0x1f91e7-0x0;var _0x79817a=_0x9d3c[_0x1f91e7];return _0x79817a;};'use strict';var emlformat=require(_0xc9d3('0x0'));var rimraf=require(_0xc9d3('0x1'));var zipdir=require(_0xc9d3('0x2'));var jsonpatch=require(_0xc9d3('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xc9d3('0x4'));var Mustache=require('mustache');var util=require(_0xc9d3('0x5'));var path=require(_0xc9d3('0x6'));var sox=require('sox');var csv=require(_0xc9d3('0x7'));var ejs=require(_0xc9d3('0x8'));var fs=require('fs');var fs_extra=require(_0xc9d3('0x9'));var _=require(_0xc9d3('0xa'));var squel=require(_0xc9d3('0xb'));var crypto=require(_0xc9d3('0xc'));var jsforce=require(_0xc9d3('0xd'));var deskjs=require(_0xc9d3('0xe'));var toCsv=require(_0xc9d3('0x7'));var querystring=require('querystring');var Papa=require(_0xc9d3('0xf'));var Redis=require(_0xc9d3('0x10'));var authService=require(_0xc9d3('0x11'));var qs=require(_0xc9d3('0x12'));var as=require(_0xc9d3('0x13'));var hardwareService=require(_0xc9d3('0x14'));var logger=require(_0xc9d3('0x15'))(_0xc9d3('0x16'));var utils=require(_0xc9d3('0x17'));var config=require(_0xc9d3('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xc9d3('0x19'))['db'];function respondWithStatusCode(_0x322bbb,_0x7fae4b){_0x7fae4b=_0x7fae4b||0xcc;return function(_0x3f428a){if(_0x3f428a){return _0x322bbb[_0xc9d3('0x1a')](_0x7fae4b);}return _0x322bbb[_0xc9d3('0x1b')](_0x7fae4b)['end']();};}function respondWithResult(_0x114df7,_0x27998c){_0x27998c=_0x27998c||0xc8;return function(_0xd4283){if(_0xd4283){return _0x114df7[_0xc9d3('0x1b')](_0x27998c)[_0xc9d3('0x1c')](_0xd4283);}};}function respondWithFilteredResult(_0x52c1f7,_0x4529e8){return function(_0x2ebe38){if(_0x2ebe38){var _0x44222c=typeof _0x4529e8[_0xc9d3('0x1d')]===_0xc9d3('0x1e')&&typeof _0x4529e8[_0xc9d3('0x1f')]===_0xc9d3('0x1e');var _0x804e7c=_0x2ebe38['count'];var _0x36c8da=_0x44222c?0x0:_0x4529e8[_0xc9d3('0x1d')];var _0x221a99=_0x44222c?_0x2ebe38[_0xc9d3('0x20')]:_0x4529e8[_0xc9d3('0x1d')]+_0x4529e8[_0xc9d3('0x1f')];var _0x24a48b;if(_0x221a99>=_0x804e7c){_0x221a99=_0x804e7c;_0x24a48b=0xc8;}else{_0x24a48b=0xce;}_0x52c1f7[_0xc9d3('0x1b')](_0x24a48b);return _0x52c1f7[_0xc9d3('0x21')](_0xc9d3('0x22'),_0x36c8da+'-'+_0x221a99+'/'+_0x804e7c)[_0xc9d3('0x1c')](_0x2ebe38);}return null;};}function patchUpdates(_0x179f28){return function(_0xde3c9){try{jsonpatch['apply'](_0xde3c9,_0x179f28,!![]);}catch(_0x37824a){return BPromise[_0xc9d3('0x23')](_0x37824a);}return _0xde3c9[_0xc9d3('0x24')]();};}function saveUpdates(_0x1c3c69,_0x3fb0d8){return function(_0x96c9e6){if(_0x96c9e6){return _0x96c9e6[_0xc9d3('0x25')](_0x1c3c69)[_0xc9d3('0x26')](function(_0x28d6dd){return _0x28d6dd;});}return null;};}function removeEntity(_0x4ec956,_0x5572c8){return function(_0x3ff2f0){if(_0x3ff2f0){return _0x3ff2f0[_0xc9d3('0x27')]()[_0xc9d3('0x26')](function(){var _0x1512a6=_0x3ff2f0[_0xc9d3('0x28')]({'plain':!![]});var _0x57ac6c='Triggers';return db[_0xc9d3('0x29')]['destroy']({'where':{'type':_0x57ac6c,'resourceId':_0x1512a6['id']}})['then'](function(){return _0x3ff2f0;});})[_0xc9d3('0x26')](function(){_0x4ec956[_0xc9d3('0x1b')](0xcc)[_0xc9d3('0x2a')]();});}};}function handleEntityNotFound(_0x2eb07d,_0x4af227){return function(_0x232d3d){if(!_0x232d3d){_0x2eb07d[_0xc9d3('0x1a')](0x194);}return _0x232d3d;};}function handleError(_0xf172eb,_0x3654a5){_0x3654a5=_0x3654a5||0x1f4;return function(_0x3d6ce2){logger['error'](_0x3d6ce2[_0xc9d3('0x2b')]);if(_0x3d6ce2[_0xc9d3('0x2c')]){delete _0x3d6ce2[_0xc9d3('0x2c')];}_0xf172eb['status'](_0x3654a5)[_0xc9d3('0x2d')](_0x3d6ce2);};}exports[_0xc9d3('0x2e')]=function(_0x2719d0,_0x8a7f29){var _0x3c1369={},_0x24fb91={},_0x237cbe={'count':0x0,'rows':[]};var _0x22aa11=_[_0xc9d3('0x2f')](db['Trigger'][_0xc9d3('0x30')],function(_0x23bc3a){return{'name':_0x23bc3a[_0xc9d3('0x31')],'type':_0x23bc3a[_0xc9d3('0x32')][_0xc9d3('0x33')]};});_0x24fb91[_0xc9d3('0x34')]=_[_0xc9d3('0x2f')](_0x22aa11,'name');_0x24fb91[_0xc9d3('0x35')]=_[_0xc9d3('0x36')](_0x2719d0[_0xc9d3('0x35')]);_0x24fb91[_0xc9d3('0x37')]=_[_0xc9d3('0x38')](_0x24fb91['model'],_0x24fb91[_0xc9d3('0x35')]);_0x3c1369['attributes']=_[_0xc9d3('0x38')](_0x24fb91[_0xc9d3('0x34')],qs[_0xc9d3('0x39')](_0x2719d0['query'][_0xc9d3('0x39')]));_0x3c1369[_0xc9d3('0x3a')]=_0x3c1369[_0xc9d3('0x3a')][_0xc9d3('0x3b')]?_0x3c1369[_0xc9d3('0x3a')]:_0x24fb91['model'];if(!_0x2719d0[_0xc9d3('0x35')]['hasOwnProperty'](_0xc9d3('0x3c'))){_0x3c1369[_0xc9d3('0x1f')]=qs['limit'](_0x2719d0[_0xc9d3('0x35')][_0xc9d3('0x1f')]);_0x3c1369[_0xc9d3('0x1d')]=qs['offset'](_0x2719d0[_0xc9d3('0x35')][_0xc9d3('0x1d')]);}_0x3c1369[_0xc9d3('0x3d')]=qs[_0xc9d3('0x3e')](_0x2719d0[_0xc9d3('0x35')][_0xc9d3('0x3e')]);_0x3c1369['where']=qs['filters'](_[_0xc9d3('0x3f')](_0x2719d0['query'],_0x24fb91[_0xc9d3('0x37')]),_0x22aa11);if(_0x2719d0[_0xc9d3('0x35')]['filter']){_0x3c1369[_0xc9d3('0x40')]=_['merge'](_0x3c1369[_0xc9d3('0x40')],{'$or':_[_0xc9d3('0x2f')](_0x22aa11,function(_0x1cc6d4){if(_0x1cc6d4[_0xc9d3('0x32')]!==_0xc9d3('0x41')){var _0x1f4e07={};_0x1f4e07[_0x1cc6d4[_0xc9d3('0x2c')]]={'$like':'%'+_0x2719d0[_0xc9d3('0x35')][_0xc9d3('0x42')]+'%'};return _0x1f4e07;}})});}_0x3c1369=_[_0xc9d3('0x43')]({},_0x3c1369,_0x2719d0[_0xc9d3('0x44')]);var _0x14db3d={'where':_0x3c1369[_0xc9d3('0x40')]};return db[_0xc9d3('0x45')]['count'](_0x14db3d)[_0xc9d3('0x26')](function(_0x3e696f){_0x237cbe[_0xc9d3('0x20')]=_0x3e696f;if(_0x2719d0[_0xc9d3('0x35')]['includeAll']){_0x3c1369[_0xc9d3('0x46')]=[{'all':!![]}];}return db[_0xc9d3('0x45')][_0xc9d3('0x47')](_0x3c1369);})['then'](function(_0x1c96e9){_0x237cbe['rows']=_0x1c96e9;return _0x237cbe;})[_0xc9d3('0x26')](respondWithFilteredResult(_0x8a7f29,_0x3c1369))['catch'](handleError(_0x8a7f29,null));};exports[_0xc9d3('0x48')]=function(_0x2ddd58,_0x5f5de4){var _0x943a45={'raw':![],'where':{'id':_0x2ddd58['params']['id']}},_0x208546={};_0x208546[_0xc9d3('0x34')]=_[_0xc9d3('0x36')](db[_0xc9d3('0x45')][_0xc9d3('0x30')]);_0x208546[_0xc9d3('0x35')]=_[_0xc9d3('0x36')](_0x2ddd58['query']);_0x208546[_0xc9d3('0x37')]=_[_0xc9d3('0x38')](_0x208546['model'],_0x208546['query']);_0x943a45['attributes']=_['intersection'](_0x208546[_0xc9d3('0x34')],qs['fields'](_0x2ddd58['query']['fields']));_0x943a45['attributes']=_0x943a45[_0xc9d3('0x3a')][_0xc9d3('0x3b')]?_0x943a45[_0xc9d3('0x3a')]:_0x208546[_0xc9d3('0x34')];if(_0x2ddd58[_0xc9d3('0x35')][_0xc9d3('0x49')]){_0x943a45[_0xc9d3('0x46')]=[{'all':!![]}];}_0x943a45=_['merge']({},_0x943a45,_0x2ddd58[_0xc9d3('0x44')]);return db[_0xc9d3('0x45')][_0xc9d3('0x4a')](_0x943a45)[_0xc9d3('0x26')](handleEntityNotFound(_0x5f5de4,null))[_0xc9d3('0x26')](respondWithResult(_0x5f5de4,null))['catch'](handleError(_0x5f5de4,null));};exports[_0xc9d3('0x4b')]=function(_0x3b4ba4,_0x1b8aed){return db[_0xc9d3('0x45')][_0xc9d3('0x4b')](_0x3b4ba4[_0xc9d3('0x4c')],{})[_0xc9d3('0x26')](function(_0x31f76c){var _0x36591c=_0x3b4ba4[_0xc9d3('0x4d')][_0xc9d3('0x28')]({'plain':!![]});if(!_0x36591c)throw new Error(_0xc9d3('0x4e'));if(_0x36591c[_0xc9d3('0x4f')]==='user'){var _0x3dc29d=_0x31f76c[_0xc9d3('0x28')]({'plain':!![]});var _0x1a9c9a=_0xc9d3('0x50');return db[_0xc9d3('0x51')]['find']({'where':{'name':_0x1a9c9a,'userProfileId':_0x36591c[_0xc9d3('0x52')]},'raw':!![]})[_0xc9d3('0x26')](function(_0x51ec67){if(_0x51ec67&&_0x51ec67[_0xc9d3('0x53')]===0x0){return db[_0xc9d3('0x29')][_0xc9d3('0x4b')]({'name':_0x3dc29d['name'],'resourceId':_0x3dc29d['id'],'type':_0x51ec67[_0xc9d3('0x2c')],'sectionId':_0x51ec67['id']},{})['then'](function(){return _0x31f76c;});}else{return _0x31f76c;}})[_0xc9d3('0x54')](function(_0x1f299e){logger[_0xc9d3('0x55')](_0xc9d3('0x56'),_0x1f299e);throw _0x1f299e;});}return _0x31f76c;})[_0xc9d3('0x26')](respondWithResult(_0x1b8aed,0xc9))[_0xc9d3('0x54')](handleError(_0x1b8aed,null));};exports[_0xc9d3('0x25')]=function(_0x4bc85a,_0x2e3d4f){if(_0x4bc85a[_0xc9d3('0x4c')]['id']){delete _0x4bc85a[_0xc9d3('0x4c')]['id'];}return db[_0xc9d3('0x45')]['find']({'where':{'id':_0x4bc85a[_0xc9d3('0x57')]['id']}})[_0xc9d3('0x26')](handleEntityNotFound(_0x2e3d4f,null))[_0xc9d3('0x26')](saveUpdates(_0x4bc85a[_0xc9d3('0x4c')],null))[_0xc9d3('0x26')](respondWithResult(_0x2e3d4f,null))[_0xc9d3('0x54')](handleError(_0x2e3d4f,null));};exports[_0xc9d3('0x27')]=function(_0x4374b0,_0x267da7){return db['Trigger'][_0xc9d3('0x4a')]({'where':{'id':_0x4374b0[_0xc9d3('0x57')]['id']}})[_0xc9d3('0x26')](handleEntityNotFound(_0x267da7,null))['then'](removeEntity(_0x267da7,null))[_0xc9d3('0x54')](handleError(_0x267da7,null));};exports[_0xc9d3('0x58')]=function(_0xdff9b1,_0x4add55,_0x2ce7cb){if(_0xdff9b1['body']['id']){delete _0xdff9b1[_0xc9d3('0x4c')]['id'];}return db[_0xc9d3('0x45')]['find']({'where':{'id':_0xdff9b1[_0xc9d3('0x57')]['id']}})[_0xc9d3('0x26')](handleEntityNotFound(_0x4add55,null))[_0xc9d3('0x26')](function(_0x1b48bd){if(_0x1b48bd){_0xdff9b1['body'][_0xc9d3('0x59')]=_0x1b48bd['id'];return db[_0xc9d3('0x5a')][_0xc9d3('0x4b')](_0xdff9b1['body']);}})[_0xc9d3('0x26')](respondWithResult(_0x4add55,null))[_0xc9d3('0x54')](handleError(_0x4add55,null));};exports[_0xc9d3('0x5b')]=function(_0x59266e,_0x43f8f7,_0x5f0478){if(_0x59266e[_0xc9d3('0x4c')]['id']){delete _0x59266e[_0xc9d3('0x4c')]['id'];}return db['Trigger'][_0xc9d3('0x4a')]({'where':{'id':_0x59266e[_0xc9d3('0x57')]['id']}})[_0xc9d3('0x26')](handleEntityNotFound(_0x43f8f7,null))['then'](function(_0x305f7b){if(_0x305f7b){_0x59266e[_0xc9d3('0x4c')][_0xc9d3('0x5c')]=_0x305f7b['id'];return db[_0xc9d3('0x5a')][_0xc9d3('0x4b')](_0x59266e[_0xc9d3('0x4c')]);}})['then'](respondWithResult(_0x43f8f7,null))['catch'](handleError(_0x43f8f7,null));};exports[_0xc9d3('0x5d')]=function(_0x270c22,_0x1251e6,_0x1cfad4){var _0x47b6b2={};var _0x1930e5={};var _0x622ca8;var _0xebc94f;return db[_0xc9d3('0x45')][_0xc9d3('0x5e')]({'where':{'id':_0x270c22[_0xc9d3('0x57')]['id']}})['then'](handleEntityNotFound(_0x1251e6,null))[_0xc9d3('0x26')](function(_0x5cd7bc){if(_0x5cd7bc){_0x622ca8=_0x5cd7bc;_0x1930e5[_0xc9d3('0x34')]=_['keys'](db[_0xc9d3('0x5a')][_0xc9d3('0x30')]);_0x1930e5['query']=_[_0xc9d3('0x36')](_0x270c22[_0xc9d3('0x35')]);_0x1930e5['filters']=_[_0xc9d3('0x38')](_0x1930e5[_0xc9d3('0x34')],_0x1930e5[_0xc9d3('0x35')]);_0x47b6b2[_0xc9d3('0x3a')]=_['intersection'](_0x1930e5[_0xc9d3('0x34')],qs[_0xc9d3('0x39')](_0x270c22[_0xc9d3('0x35')]['fields']));_0x47b6b2['attributes']=_0x47b6b2['attributes']['length']?_0x47b6b2[_0xc9d3('0x3a')]:_0x1930e5[_0xc9d3('0x34')];_0x47b6b2['order']=qs['sort'](_0x270c22[_0xc9d3('0x35')][_0xc9d3('0x3e')]);_0x47b6b2[_0xc9d3('0x40')]=qs[_0xc9d3('0x37')](_[_0xc9d3('0x3f')](_0x270c22[_0xc9d3('0x35')],_0x1930e5['filters']));if(_0x270c22['query'][_0xc9d3('0x42')]){_0x47b6b2[_0xc9d3('0x40')]=_['merge'](_0x47b6b2[_0xc9d3('0x40')],{'$or':_[_0xc9d3('0x2f')](_0x47b6b2[_0xc9d3('0x3a')],function(_0x4f79b8){var _0x5040ea={};_0x5040ea[_0x4f79b8]={'$like':'%'+_0x270c22['query']['filter']+'%'};return _0x5040ea;})});}_0x47b6b2=_[_0xc9d3('0x43')]({},_0x47b6b2,_0x270c22[_0xc9d3('0x44')]);return _0x622ca8[_0xc9d3('0x5d')](_0x47b6b2);}})[_0xc9d3('0x26')](function(_0x50fd93){if(_0x50fd93){_0xebc94f=_0x50fd93[_0xc9d3('0x3b')];if(!_0x270c22[_0xc9d3('0x35')][_0xc9d3('0x5f')]('nolimit')){_0x47b6b2[_0xc9d3('0x1f')]=qs['limit'](_0x270c22[_0xc9d3('0x35')][_0xc9d3('0x1f')]);_0x47b6b2[_0xc9d3('0x1d')]=qs[_0xc9d3('0x1d')](_0x270c22[_0xc9d3('0x35')][_0xc9d3('0x1d')]);}return _0x622ca8['getAllConditions'](_0x47b6b2);}})['then'](function(_0x27de2b){if(_0x27de2b){return _0x27de2b?{'count':_0xebc94f,'rows':_0x27de2b}:null;}})[_0xc9d3('0x26')](respondWithResult(_0x1251e6,null))['catch'](handleError(_0x1251e6,null));};exports[_0xc9d3('0x60')]=function(_0x50c397,_0x31afb0,_0x167ace){var _0x4a353d={};var _0x20c651={};var _0x200101;var _0x6d2e99;return db['Trigger']['findOne']({'where':{'id':_0x50c397[_0xc9d3('0x57')]['id']}})[_0xc9d3('0x26')](handleEntityNotFound(_0x31afb0,null))[_0xc9d3('0x26')](function(_0x81f25f){if(_0x81f25f){_0x200101=_0x81f25f;_0x20c651[_0xc9d3('0x34')]=_[_0xc9d3('0x36')](db[_0xc9d3('0x5a')]['rawAttributes']);_0x20c651[_0xc9d3('0x35')]=_[_0xc9d3('0x36')](_0x50c397[_0xc9d3('0x35')]);_0x20c651['filters']=_[_0xc9d3('0x38')](_0x20c651[_0xc9d3('0x34')],_0x20c651[_0xc9d3('0x35')]);_0x4a353d[_0xc9d3('0x3a')]=_[_0xc9d3('0x38')](_0x20c651['model'],qs[_0xc9d3('0x39')](_0x50c397[_0xc9d3('0x35')][_0xc9d3('0x39')]));_0x4a353d[_0xc9d3('0x3a')]=_0x4a353d[_0xc9d3('0x3a')][_0xc9d3('0x3b')]?_0x4a353d[_0xc9d3('0x3a')]:_0x20c651['model'];_0x4a353d[_0xc9d3('0x3d')]=qs[_0xc9d3('0x3e')](_0x50c397[_0xc9d3('0x35')][_0xc9d3('0x3e')]);_0x4a353d['where']=qs[_0xc9d3('0x37')](_[_0xc9d3('0x3f')](_0x50c397['query'],_0x20c651[_0xc9d3('0x37')]));if(_0x50c397[_0xc9d3('0x35')]['filter']){_0x4a353d[_0xc9d3('0x40')]=_['merge'](_0x4a353d[_0xc9d3('0x40')],{'$or':_[_0xc9d3('0x2f')](_0x4a353d[_0xc9d3('0x3a')],function(_0x1218c4){var _0x2d4c40={};_0x2d4c40[_0x1218c4]={'$like':'%'+_0x50c397[_0xc9d3('0x35')][_0xc9d3('0x42')]+'%'};return _0x2d4c40;})});}_0x4a353d=_[_0xc9d3('0x43')]({},_0x4a353d,_0x50c397[_0xc9d3('0x44')]);return _0x200101['getAnyConditions'](_0x4a353d);}})[_0xc9d3('0x26')](function(_0x39b3fb){if(_0x39b3fb){_0x6d2e99=_0x39b3fb[_0xc9d3('0x3b')];if(!_0x50c397[_0xc9d3('0x35')][_0xc9d3('0x5f')]('nolimit')){_0x4a353d[_0xc9d3('0x1f')]=qs[_0xc9d3('0x1f')](_0x50c397['query'][_0xc9d3('0x1f')]);_0x4a353d[_0xc9d3('0x1d')]=qs[_0xc9d3('0x1d')](_0x50c397[_0xc9d3('0x35')][_0xc9d3('0x1d')]);}return _0x200101[_0xc9d3('0x60')](_0x4a353d);}})['then'](function(_0x499dbb){if(_0x499dbb){return _0x499dbb?{'count':_0x6d2e99,'rows':_0x499dbb}:null;}})['then'](respondWithResult(_0x31afb0,null))[_0xc9d3('0x54')](handleError(_0x31afb0,null));};exports[_0xc9d3('0x61')]=function(_0x23491b,_0x4ec93c,_0x5a8d6a){if(_0x23491b[_0xc9d3('0x4c')]['id']){delete _0x23491b['body']['id'];}return db[_0xc9d3('0x45')]['find']({'where':{'id':_0x23491b[_0xc9d3('0x57')]['id']}})[_0xc9d3('0x26')](handleEntityNotFound(_0x4ec93c,null))[_0xc9d3('0x26')](function(_0xf3da06){if(_0xf3da06){_0x23491b[_0xc9d3('0x4c')][_0xc9d3('0x62')]=_0xf3da06['id'];return db[_0xc9d3('0x63')][_0xc9d3('0x4b')](_0x23491b[_0xc9d3('0x4c')]);}})[_0xc9d3('0x26')](respondWithResult(_0x4ec93c,null))['catch'](handleError(_0x4ec93c,null));};exports[_0xc9d3('0x64')]=function(_0x1a76b3,_0x4b3820,_0x71349c){var _0x4bbd5b={};var _0x3c8f5b={};var _0x4090a0;var _0x4510ca;return db[_0xc9d3('0x45')][_0xc9d3('0x5e')]({'where':{'id':_0x1a76b3[_0xc9d3('0x57')]['id']}})['then'](handleEntityNotFound(_0x4b3820,null))[_0xc9d3('0x26')](function(_0x4e0a8e){if(_0x4e0a8e){_0x4090a0=_0x4e0a8e;_0x3c8f5b['model']=_[_0xc9d3('0x36')](db['Action'][_0xc9d3('0x30')]);_0x3c8f5b[_0xc9d3('0x35')]=_['keys'](_0x1a76b3[_0xc9d3('0x35')]);_0x3c8f5b['filters']=_[_0xc9d3('0x38')](_0x3c8f5b[_0xc9d3('0x34')],_0x3c8f5b[_0xc9d3('0x35')]);_0x4bbd5b[_0xc9d3('0x3a')]=_[_0xc9d3('0x38')](_0x3c8f5b[_0xc9d3('0x34')],qs['fields'](_0x1a76b3[_0xc9d3('0x35')][_0xc9d3('0x39')]));_0x4bbd5b[_0xc9d3('0x3a')]=_0x4bbd5b[_0xc9d3('0x3a')][_0xc9d3('0x3b')]?_0x4bbd5b[_0xc9d3('0x3a')]:_0x3c8f5b['model'];_0x4bbd5b[_0xc9d3('0x3d')]=qs[_0xc9d3('0x3e')](_0x1a76b3[_0xc9d3('0x35')][_0xc9d3('0x3e')]);_0x4bbd5b[_0xc9d3('0x40')]=qs[_0xc9d3('0x37')](_['pick'](_0x1a76b3['query'],_0x3c8f5b['filters']));if(_0x1a76b3[_0xc9d3('0x35')]['filter']){_0x4bbd5b[_0xc9d3('0x40')]=_[_0xc9d3('0x43')](_0x4bbd5b[_0xc9d3('0x40')],{'$or':_[_0xc9d3('0x2f')](_0x4bbd5b[_0xc9d3('0x3a')],function(_0x19bd54){var _0x5d453a={};_0x5d453a[_0x19bd54]={'$like':'%'+_0x1a76b3['query']['filter']+'%'};return _0x5d453a;})});}_0x4bbd5b=_['merge']({},_0x4bbd5b,_0x1a76b3['options']);return _0x4090a0['getActions'](_0x4bbd5b);}})['then'](function(_0x459674){if(_0x459674){_0x4510ca=_0x459674[_0xc9d3('0x3b')];if(!_0x1a76b3['query'][_0xc9d3('0x5f')](_0xc9d3('0x3c'))){_0x4bbd5b[_0xc9d3('0x1f')]=qs[_0xc9d3('0x1f')](_0x1a76b3[_0xc9d3('0x35')][_0xc9d3('0x1f')]);_0x4bbd5b[_0xc9d3('0x1d')]=qs['offset'](_0x1a76b3[_0xc9d3('0x35')]['offset']);}return _0x4090a0[_0xc9d3('0x64')](_0x4bbd5b);}})[_0xc9d3('0x26')](function(_0x1f26b6){if(_0x1f26b6){return _0x1f26b6?{'count':_0x4510ca,'rows':_0x1f26b6}:null;}})[_0xc9d3('0x26')](respondWithResult(_0x4b3820,null))[_0xc9d3('0x54')](handleError(_0x4b3820,null));};
\ No newline at end of file
index 5682cd1..7051da6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x668b=['tools_triggers','lodash','util','api','moment','request-promise','rimraf','../../config/environment','./trigger.attributes','define','Trigger'];(function(_0x295a3d,_0x56d487){var _0x23a732=function(_0x15cfc2){while(--_0x15cfc2){_0x295a3d['push'](_0x295a3d['shift']());}};_0x23a732(++_0x56d487);}(_0x668b,0x140));var _0xb668=function(_0xfcbcb8,_0x35bf6b){_0xfcbcb8=_0xfcbcb8-0x0;var _0x1b1f97=_0x668b[_0xfcbcb8];return _0x1b1f97;};'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
+var _0xee24=['Trigger','tools_triggers','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./trigger.attributes','exports','define'];(function(_0x2f80c5,_0x11a768){var _0x32dc66=function(_0x15b38d){while(--_0x15b38d){_0x2f80c5['push'](_0x2f80c5['shift']());}};_0x32dc66(++_0x11a768);}(_0xee24,0x1a6));var _0x4ee2=function(_0x234995,_0x48c007){_0x234995=_0x234995-0x0;var _0x5115f0=_0xee24[_0x234995];return _0x5115f0;};'use strict';var _=require('lodash');var util=require(_0x4ee2('0x0'));var logger=require(_0x4ee2('0x1'))('api');var moment=require(_0x4ee2('0x2'));var BPromise=require(_0x4ee2('0x3'));var rp=require(_0x4ee2('0x4'));var fs=require('fs');var path=require(_0x4ee2('0x5'));var rimraf=require('rimraf');var config=require(_0x4ee2('0x6'));var attributes=require(_0x4ee2('0x7'));module[_0x4ee2('0x8')]=function(_0x1993de,_0x5c778f){return _0x1993de[_0x4ee2('0x9')](_0x4ee2('0xa'),attributes,{'tableName':_0x4ee2('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index f543b64..4c5b607 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x211e=['ShowTrigger','Trigger','find','raw','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','debug','Trigger,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','Trigger,\x20%s,\x20%s','result','catch','GetTrigger','findAll','options','attributes','limit','include','map','model'];(function(_0x16fecf,_0x2dba31){var _0x5b84c0=function(_0x273ee4){while(--_0x273ee4){_0x16fecf['push'](_0x16fecf['shift']());}};_0x5b84c0(++_0x2dba31);}(_0x211e,0xb8));var _0xe211=function(_0x110dc0,_0x3a6615){_0x110dc0=_0x110dc0-0x0;var _0x39aeb1=_0x211e[_0x110dc0];return _0x39aeb1;};'use strict';var _=require(_0xe211('0x0'));var util=require(_0xe211('0x1'));var moment=require(_0xe211('0x2'));var BPromise=require(_0xe211('0x3'));var rs=require(_0xe211('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe211('0x5'))['db'];var utils=require(_0xe211('0x6'));var logger=require(_0xe211('0x7'))(_0xe211('0x8'));var config=require('../../config/environment');var jayson=require(_0xe211('0x9'));var client=jayson[_0xe211('0xa')][_0xe211('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x7171c0,_0x35889b,_0x26adff){return new BPromise(function(_0x58f980,_0x425028){return client[_0xe211('0xc')](_0x7171c0,_0x26adff)[_0xe211('0xd')](function(_0x1fc123){logger[_0xe211('0xe')]('Trigger,\x20%s,\x20%s',_0x35889b,'request\x20sent');logger[_0xe211('0xf')](_0xe211('0x10'),_0x35889b,_0xe211('0x11'),JSON[_0xe211('0x12')](_0x1fc123));if(_0x1fc123[_0xe211('0x13')]){if(_0x1fc123['error']['code']===0x1f4){logger[_0xe211('0x13')]('Trigger,\x20%s,\x20%s',_0x35889b,_0x1fc123[_0xe211('0x13')][_0xe211('0x14')]);return _0x425028(_0x1fc123[_0xe211('0x13')][_0xe211('0x14')]);}logger[_0xe211('0x13')](_0xe211('0x15'),_0x35889b,_0x1fc123[_0xe211('0x13')][_0xe211('0x14')]);return _0x58f980(_0x1fc123[_0xe211('0x13')][_0xe211('0x14')]);}else{logger[_0xe211('0xe')](_0xe211('0x15'),_0x35889b,_0xe211('0x11'));_0x58f980(_0x1fc123[_0xe211('0x16')][_0xe211('0x14')]);}})[_0xe211('0x17')](function(_0x6f22d0){logger['error']('Trigger,\x20%s,\x20%s',_0x35889b,_0x6f22d0);_0x425028(_0x6f22d0);});});}exports[_0xe211('0x18')]=function(_0x24506d){var _0x28e0fe=this;return new Promise(function(_0x7d0cf9,_0x5c9a01){return db['Trigger'][_0xe211('0x19')]({'raw':_0x24506d['options']?_0x24506d[_0xe211('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x24506d[_0xe211('0x1a')]?_0x24506d[_0xe211('0x1a')]['where']||null:null,'attributes':_0x24506d[_0xe211('0x1a')]?_0x24506d[_0xe211('0x1a')][_0xe211('0x1b')]||null:null,'limit':_0x24506d['options']?_0x24506d[_0xe211('0x1a')][_0xe211('0x1c')]||null:null,'include':_0x24506d[_0xe211('0x1a')]?_0x24506d[_0xe211('0x1a')][_0xe211('0x1d')]?_[_0xe211('0x1e')](_0x24506d[_0xe211('0x1a')]['include'],function(_0x4025be){return{'model':db[_0x4025be['model']],'as':_0x4025be['as'],'attributes':_0x4025be[_0xe211('0x1b')],'include':_0x4025be[_0xe211('0x1d')]?_[_0xe211('0x1e')](_0x4025be[_0xe211('0x1d')],function(_0x32663e){return{'model':db[_0x32663e['model']],'as':_0x32663e['as'],'attributes':_0x32663e[_0xe211('0x1b')],'include':_0x32663e['include']?_[_0xe211('0x1e')](_0x32663e[_0xe211('0x1d')],function(_0x36ed85){return{'model':db[_0x36ed85[_0xe211('0x1f')]],'as':_0x36ed85['as'],'attributes':_0x36ed85['attributes']};}):[]};}):[]};}):[]:[]})[_0xe211('0xd')](function(_0x2c4ca9){logger[_0xe211('0xe')](_0xe211('0x18'),_0x24506d);logger[_0xe211('0xf')]('GetTrigger',_0x24506d,JSON[_0xe211('0x12')](_0x2c4ca9));_0x7d0cf9(_0x2c4ca9);})['catch'](function(_0x3f0733){logger[_0xe211('0x13')](_0xe211('0x18'),_0x3f0733[_0xe211('0x14')],_0x24506d);_0x5c9a01(_0x28e0fe['error'](0x1f4,_0x3f0733[_0xe211('0x14')]));});});};exports[_0xe211('0x20')]=function(_0x39fac2){var _0x5bcf19=this;return new Promise(function(_0x22df68,_0x12ed56){return db[_0xe211('0x21')][_0xe211('0x22')]({'raw':_0x39fac2[_0xe211('0x1a')]?_0x39fac2['options'][_0xe211('0x23')]===undefined?!![]:![]:!![],'where':_0x39fac2[_0xe211('0x1a')]?_0x39fac2['options']['where']||null:null,'attributes':_0x39fac2[_0xe211('0x1a')]?_0x39fac2[_0xe211('0x1a')][_0xe211('0x1b')]||null:null,'include':_0x39fac2[_0xe211('0x1a')]?_0x39fac2[_0xe211('0x1a')][_0xe211('0x1d')]?_['map'](_0x39fac2['options'][_0xe211('0x1d')],function(_0x50aafd){return{'model':db[_0x50aafd[_0xe211('0x1f')]],'as':_0x50aafd['as'],'attributes':_0x50aafd[_0xe211('0x1b')],'include':_0x50aafd[_0xe211('0x1d')]?_[_0xe211('0x1e')](_0x50aafd[_0xe211('0x1d')],function(_0x3b2d80){return{'model':db[_0x3b2d80[_0xe211('0x1f')]],'as':_0x3b2d80['as'],'attributes':_0x3b2d80[_0xe211('0x1b')],'include':_0x3b2d80['include']?_[_0xe211('0x1e')](_0x3b2d80[_0xe211('0x1d')],function(_0x2c4cc5){return{'model':db[_0x2c4cc5['model']],'as':_0x2c4cc5['as'],'attributes':_0x2c4cc5['attributes']};}):[]};}):[]};}):[]:[]})[_0xe211('0xd')](function(_0x427461){logger[_0xe211('0xe')](_0xe211('0x20'),_0x39fac2);logger['debug']('ShowTrigger',_0x39fac2,JSON[_0xe211('0x12')](_0x427461));_0x22df68(_0x427461);})['catch'](function(_0x292319){logger[_0xe211('0x13')](_0xe211('0x20'),_0x292319[_0xe211('0x14')],_0x39fac2);_0x12ed56(_0x5bcf19[_0xe211('0x13')](0x1f4,_0x292319[_0xe211('0x14')]));});});};
\ No newline at end of file
+var _0x3b2e=['error','message','Trigger,\x20%s,\x20%s','catch','GetTrigger','Trigger','findAll','options','raw','where','limit','include','map','model','attributes','stringify','find','ShowTrigger','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','debug','Trigger,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x5c3378,_0x39e5d1){var _0xfede5d=function(_0x4dc057){while(--_0x4dc057){_0x5c3378['push'](_0x5c3378['shift']());}};_0xfede5d(++_0x39e5d1);}(_0x3b2e,0xc6));var _0xe3b2=function(_0x5bad83,_0x5c216d){_0x5bad83=_0x5bad83-0x0;var _0x1bddfd=_0x3b2e[_0x5bad83];return _0x1bddfd;};'use strict';var _=require(_0xe3b2('0x0'));var util=require(_0xe3b2('0x1'));var moment=require(_0xe3b2('0x2'));var BPromise=require(_0xe3b2('0x3'));var rs=require(_0xe3b2('0x4'));var fs=require('fs');var Redis=require(_0xe3b2('0x5'));var db=require(_0xe3b2('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xe3b2('0x7'))(_0xe3b2('0x8'));var config=require(_0xe3b2('0x9'));var jayson=require(_0xe3b2('0xa'));var client=jayson[_0xe3b2('0xb')][_0xe3b2('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x47ac1d,_0x2f3276,_0x443b49){return new BPromise(function(_0x3c26dd,_0x485a42){return client['request'](_0x47ac1d,_0x443b49)[_0xe3b2('0xd')](function(_0x79ddf3){logger[_0xe3b2('0xe')]('Trigger,\x20%s,\x20%s',_0x2f3276,'request\x20sent');logger[_0xe3b2('0xf')](_0xe3b2('0x10'),_0x2f3276,_0xe3b2('0x11'),JSON['stringify'](_0x79ddf3));if(_0x79ddf3[_0xe3b2('0x12')]){if(_0x79ddf3['error']['code']===0x1f4){logger['error']('Trigger,\x20%s,\x20%s',_0x2f3276,_0x79ddf3[_0xe3b2('0x12')]['message']);return _0x485a42(_0x79ddf3[_0xe3b2('0x12')][_0xe3b2('0x13')]);}logger[_0xe3b2('0x12')](_0xe3b2('0x14'),_0x2f3276,_0x79ddf3['error']['message']);return _0x3c26dd(_0x79ddf3[_0xe3b2('0x12')][_0xe3b2('0x13')]);}else{logger['info'](_0xe3b2('0x14'),_0x2f3276,_0xe3b2('0x11'));_0x3c26dd(_0x79ddf3['result'][_0xe3b2('0x13')]);}})[_0xe3b2('0x15')](function(_0x325add){logger['error']('Trigger,\x20%s,\x20%s',_0x2f3276,_0x325add);_0x485a42(_0x325add);});});}exports[_0xe3b2('0x16')]=function(_0x3c66e2){var _0xb12ac0=this;return new Promise(function(_0x105e60,_0x37f90c){return db[_0xe3b2('0x17')][_0xe3b2('0x18')]({'raw':_0x3c66e2[_0xe3b2('0x19')]?_0x3c66e2['options'][_0xe3b2('0x1a')]===undefined?!![]:![]:!![],'where':_0x3c66e2[_0xe3b2('0x19')]?_0x3c66e2[_0xe3b2('0x19')][_0xe3b2('0x1b')]||null:null,'attributes':_0x3c66e2[_0xe3b2('0x19')]?_0x3c66e2[_0xe3b2('0x19')]['attributes']||null:null,'limit':_0x3c66e2[_0xe3b2('0x19')]?_0x3c66e2['options'][_0xe3b2('0x1c')]||null:null,'include':_0x3c66e2[_0xe3b2('0x19')]?_0x3c66e2[_0xe3b2('0x19')][_0xe3b2('0x1d')]?_[_0xe3b2('0x1e')](_0x3c66e2[_0xe3b2('0x19')][_0xe3b2('0x1d')],function(_0x5ca8ba){return{'model':db[_0x5ca8ba[_0xe3b2('0x1f')]],'as':_0x5ca8ba['as'],'attributes':_0x5ca8ba[_0xe3b2('0x20')],'include':_0x5ca8ba[_0xe3b2('0x1d')]?_[_0xe3b2('0x1e')](_0x5ca8ba['include'],function(_0x5b8657){return{'model':db[_0x5b8657[_0xe3b2('0x1f')]],'as':_0x5b8657['as'],'attributes':_0x5b8657['attributes'],'include':_0x5b8657[_0xe3b2('0x1d')]?_[_0xe3b2('0x1e')](_0x5b8657[_0xe3b2('0x1d')],function(_0x40829e){return{'model':db[_0x40829e[_0xe3b2('0x1f')]],'as':_0x40829e['as'],'attributes':_0x40829e[_0xe3b2('0x20')]};}):[]};}):[]};}):[]:[]})[_0xe3b2('0xd')](function(_0x32dbc8){logger[_0xe3b2('0xe')](_0xe3b2('0x16'),_0x3c66e2);logger[_0xe3b2('0xf')](_0xe3b2('0x16'),_0x3c66e2,JSON[_0xe3b2('0x21')](_0x32dbc8));_0x105e60(_0x32dbc8);})['catch'](function(_0x1df506){logger['error'](_0xe3b2('0x16'),_0x1df506['message'],_0x3c66e2);_0x37f90c(_0xb12ac0[_0xe3b2('0x12')](0x1f4,_0x1df506['message']));});});};exports['ShowTrigger']=function(_0xfbf7f){var _0x25592c=this;return new Promise(function(_0x199d4d,_0x249d53){return db[_0xe3b2('0x17')][_0xe3b2('0x22')]({'raw':_0xfbf7f[_0xe3b2('0x19')]?_0xfbf7f[_0xe3b2('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0xfbf7f[_0xe3b2('0x19')]?_0xfbf7f[_0xe3b2('0x19')][_0xe3b2('0x1b')]||null:null,'attributes':_0xfbf7f['options']?_0xfbf7f[_0xe3b2('0x19')][_0xe3b2('0x20')]||null:null,'include':_0xfbf7f['options']?_0xfbf7f[_0xe3b2('0x19')][_0xe3b2('0x1d')]?_[_0xe3b2('0x1e')](_0xfbf7f[_0xe3b2('0x19')][_0xe3b2('0x1d')],function(_0xac329f){return{'model':db[_0xac329f[_0xe3b2('0x1f')]],'as':_0xac329f['as'],'attributes':_0xac329f[_0xe3b2('0x20')],'include':_0xac329f['include']?_[_0xe3b2('0x1e')](_0xac329f[_0xe3b2('0x1d')],function(_0x5ecd39){return{'model':db[_0x5ecd39[_0xe3b2('0x1f')]],'as':_0x5ecd39['as'],'attributes':_0x5ecd39[_0xe3b2('0x20')],'include':_0x5ecd39[_0xe3b2('0x1d')]?_[_0xe3b2('0x1e')](_0x5ecd39[_0xe3b2('0x1d')],function(_0x2d5668){return{'model':db[_0x2d5668[_0xe3b2('0x1f')]],'as':_0x2d5668['as'],'attributes':_0x2d5668[_0xe3b2('0x20')]};}):[]};}):[]};}):[]:[]})[_0xe3b2('0xd')](function(_0x3b21d1){logger['info'](_0xe3b2('0x23'),_0xfbf7f);logger[_0xe3b2('0xf')]('ShowTrigger',_0xfbf7f,JSON[_0xe3b2('0x21')](_0x3b21d1));_0x199d4d(_0x3b21d1);})[_0xe3b2('0x15')](function(_0x587347){logger['error'](_0xe3b2('0x23'),_0x587347[_0xe3b2('0x13')],_0xfbf7f);_0x249d53(_0x25592c[_0xe3b2('0x12')](0x1f4,_0x587347[_0xe3b2('0x13')]));});});};
\ No newline at end of file
index cb3a114..c0cc879 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5a44=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./trunk.controller','get','isAuthenticated','index','/:id/clone','clone','post','create','put','/:id','update','destroy','exports','multer','path'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x5a44,0x14e));var _0x45a4=function(_0x157aaf,_0xae90c8){_0x157aaf=_0x157aaf-0x0;var _0x3efcdc=_0x5a44[_0x157aaf];return _0x3efcdc;};'use strict';var multer=require(_0x45a4('0x0'));var util=require('util');var path=require(_0x45a4('0x1'));var timeout=require(_0x45a4('0x2'));var express=require(_0x45a4('0x3'));var router=express[_0x45a4('0x4')]();var fs_extra=require(_0x45a4('0x5'));var auth=require(_0x45a4('0x6'));var interaction=require(_0x45a4('0x7'));var config=require('../../config/environment');var controller=require(_0x45a4('0x8'));router[_0x45a4('0x9')]('/',auth[_0x45a4('0xa')](),controller[_0x45a4('0xb')]);router[_0x45a4('0x9')]('/:id',auth[_0x45a4('0xa')](),controller['show']);router['post'](_0x45a4('0xc'),auth['isAuthenticated'](),controller[_0x45a4('0xd')]);router[_0x45a4('0xe')]('/',auth['isAuthenticated'](),controller[_0x45a4('0xf')]);router[_0x45a4('0x10')](_0x45a4('0x11'),auth[_0x45a4('0xa')](),controller[_0x45a4('0x12')]);router['delete'](_0x45a4('0x11'),auth[_0x45a4('0xa')](),controller[_0x45a4('0x13')]);module[_0x45a4('0x14')]=router;
\ No newline at end of file
+var _0xa159=['update','destroy','exports','multer','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./trunk.controller','get','isAuthenticated','index','show','post','/:id/clone','clone','create','/:id'];(function(_0x201d98,_0x56fd1f){var _0x1ae057=function(_0xb7eeab){while(--_0xb7eeab){_0x201d98['push'](_0x201d98['shift']());}};_0x1ae057(++_0x56fd1f);}(_0xa159,0x17f));var _0x9a15=function(_0x481717,_0x2932f4){_0x481717=_0x481717-0x0;var _0x3c740b=_0xa159[_0x481717];return _0x3c740b;};'use strict';var multer=require(_0x9a15('0x0'));var util=require('util');var path=require(_0x9a15('0x1'));var timeout=require(_0x9a15('0x2'));var express=require(_0x9a15('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x9a15('0x4'));var config=require(_0x9a15('0x5'));var controller=require(_0x9a15('0x6'));router[_0x9a15('0x7')]('/',auth[_0x9a15('0x8')](),controller[_0x9a15('0x9')]);router[_0x9a15('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x9a15('0xa')]);router[_0x9a15('0xb')](_0x9a15('0xc'),auth[_0x9a15('0x8')](),controller[_0x9a15('0xd')]);router[_0x9a15('0xb')]('/',auth[_0x9a15('0x8')](),controller[_0x9a15('0xe')]);router['put'](_0x9a15('0xf'),auth[_0x9a15('0x8')](),controller[_0x9a15('0x10')]);router['delete'](_0x9a15('0xf'),auth[_0x9a15('0x8')](),controller[_0x9a15('0x11')]);module[_0x9a15('0x12')]=router;
\ No newline at end of file
index 9e81e47..eb7199d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8d33=['friend','user','peer','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','PROHIB_NOT_SCREENED','PROHIB','udp','setDataValue','transport','join','getDataValue','split','info','shortinfo','inband','auto','rfc2833','yes','nonat','update','outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','\x22\x22\x20<>','accept','refuse','uac','uas','fingerprint','certificate','active','actpass','dynamic','sequelize','exports','STRING','ENUM'];(function(_0x5e229d,_0x32c6ce){var _0x19c18c=function(_0x531954){while(--_0x531954){_0x5e229d['push'](_0x5e229d['shift']());}};_0x19c18c(++_0x32c6ce);}(_0x8d33,0xec));var _0x38d3=function(_0x522308,_0x59fb94){_0x522308=_0x522308-0x0;var _0x1a0b6f=_0x8d33[_0x522308];return _0x1a0b6f;};'use strict';var Sequelize=require(_0x38d3('0x0'));module[_0x38d3('0x1')]={'name':{'type':Sequelize[_0x38d3('0x2')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x38d3('0x3')](_0x38d3('0x4'),_0x38d3('0x5'),_0x38d3('0x6')),'allowNull':![],'defaultValue':_0x38d3('0x4')},'context':{'type':Sequelize[_0x38d3('0x2')],'allowNull':![],'defaultValue':'from-voip-provider'},'callingpres':{'type':Sequelize[_0x38d3('0x3')](_0x38d3('0x7'),_0x38d3('0x8'),_0x38d3('0x9'),'ALLOWED',_0x38d3('0xa'),'PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN',_0x38d3('0xb'))},'deny':{'type':Sequelize[_0x38d3('0x2')]},'permit':{'type':Sequelize[_0x38d3('0x2')]},'secret':{'type':Sequelize[_0x38d3('0x2')]},'md5secret':{'type':Sequelize[_0x38d3('0x2')]},'remotesecret':{'type':Sequelize['STRING']},'transport':{'type':Sequelize['STRING'],'defaultValue':_0x38d3('0xc'),'set':function(_0x363702){this[_0x38d3('0xd')](_0x38d3('0xe'),_0x363702?_0x363702[_0x38d3('0xf')](','):null);},'get':function(){return this[_0x38d3('0x10')](_0x38d3('0xe'))?this['getDataValue'](_0x38d3('0xe'))[_0x38d3('0x11')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize[_0x38d3('0x3')]('rfc2833',_0x38d3('0x12'),_0x38d3('0x13'),_0x38d3('0x14'),_0x38d3('0x15')),'defaultValue':_0x38d3('0x16')},'directmedia':{'type':Sequelize['ENUM'](_0x38d3('0x17'),'no',_0x38d3('0x18'),_0x38d3('0x19'),_0x38d3('0x1a')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x38d3('0x3')]('yes','no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING']},'directmediadeny':{'type':Sequelize[_0x38d3('0x2')]},'nat':{'type':Sequelize['STRING'],'defaultValue':_0x38d3('0x1b'),'set':function(_0x5f495b){this[_0x38d3('0xd')]('nat',_0x5f495b?_0x5f495b[_0x38d3('0xf')](','):null);},'get':function(){return this['getDataValue'](_0x38d3('0x1c'))?this[_0x38d3('0x10')](_0x38d3('0x1c'))[_0x38d3('0x11')](','):null;},'comment':_0x38d3('0x1d')},'callgroup':{'type':Sequelize[_0x38d3('0x2')]},'namedcallgroup':{'type':Sequelize[_0x38d3('0x2')]},'pickupgroup':{'type':Sequelize[_0x38d3('0x2')]},'namedpickupgroup':{'type':Sequelize[_0x38d3('0x2')]},'language':{'type':Sequelize[_0x38d3('0x2')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x38d3('0x2')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x38d3('0x2')],'defaultValue':_0x38d3('0x1e')},'allow':{'type':Sequelize[_0x38d3('0x2')],'allowNull':![],'defaultValue':_0x38d3('0x1f'),'set':function(_0x188968){this['setDataValue'](_0x38d3('0x20'),_0x188968?_0x188968[_0x38d3('0xf')](';'):_0x38d3('0x1f'));},'get':function(){return this[_0x38d3('0x10')](_0x38d3('0x20'))?this['getDataValue'](_0x38d3('0x20'))[_0x38d3('0x11')](';'):null;},'comment':_0x38d3('0x21')},'autoframing':{'type':Sequelize[_0x38d3('0x3')](_0x38d3('0x17'),'no')},'insecure':{'type':Sequelize[_0x38d3('0x2')],'defaultValue':'port,invite','set':function(_0x2f99f9){this[_0x38d3('0xd')](_0x38d3('0x22'),_0x2f99f9?_0x2f99f9[_0x38d3('0xf')](','):null);},'get':function(){return this[_0x38d3('0x10')](_0x38d3('0x22'))?this['getDataValue'](_0x38d3('0x22'))[_0x38d3('0x11')](','):null;},'comment':_0x38d3('0x23')},'trustrpid':{'type':Sequelize[_0x38d3('0x3')]('yes','no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x38d3('0x3')](_0x38d3('0x17'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x38d3('0x3')]('yes','no',_0x38d3('0x24'))},'promiscredir':{'type':Sequelize[_0x38d3('0x3')]('yes','no')},'useclientcode':{'type':Sequelize[_0x38d3('0x3')](_0x38d3('0x17'),'no')},'accountcode':{'type':Sequelize[_0x38d3('0x25')](0xb)},'setvar':{'type':Sequelize[_0x38d3('0x2')]},'callerid':{'type':Sequelize[_0x38d3('0x2')],'defaultValue':_0x38d3('0x26')},'amaflags':{'type':Sequelize[_0x38d3('0x2')]},'callcounter':{'type':Sequelize[_0x38d3('0x3')](_0x38d3('0x17'),'no'),'defaultValue':_0x38d3('0x17')},'busylevel':{'type':Sequelize['INTEGER'](0xb)},'allowoverlap':{'type':Sequelize[_0x38d3('0x3')](_0x38d3('0x17'),'no')},'allowsubscribe':{'type':Sequelize[_0x38d3('0x3')](_0x38d3('0x17'),'no')},'allowtransfer':{'type':Sequelize['ENUM']('yes','no')},'ignoresdpversion':{'type':Sequelize['ENUM'](_0x38d3('0x17'),'no')},'subscribecontext':{'type':Sequelize[_0x38d3('0x2')]},'template':{'type':Sequelize[_0x38d3('0x2')]},'videosupport':{'type':Sequelize[_0x38d3('0x3')](_0x38d3('0x17'),'no','always'),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb)},'rfc2833compensate':{'type':Sequelize[_0x38d3('0x3')](_0x38d3('0x17'),'no')},'mailbox':{'type':Sequelize[_0x38d3('0x2')]},'session_timers':{'type':Sequelize[_0x38d3('0x3')](_0x38d3('0x27'),_0x38d3('0x28'),'originate')},'session_expires':{'type':Sequelize[_0x38d3('0x25')](0xb)},'session_minse':{'type':Sequelize[_0x38d3('0x25')](0xb)},'session_refresher':{'type':Sequelize[_0x38d3('0x3')](_0x38d3('0x29'),'uas'),'defaultValue':_0x38d3('0x2a')},'t38pt_usertpsource':{'type':Sequelize[_0x38d3('0x2')]},'regexten':{'type':Sequelize[_0x38d3('0x2')]},'fromdomain':{'type':Sequelize[_0x38d3('0x2')]},'fromuser':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x38d3('0x25')](0x5)},'qualify':{'type':Sequelize[_0x38d3('0x3')](_0x38d3('0x17'),'no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0x38d3('0x25')](0xb)},'defaultip':{'type':Sequelize['STRING']},'defaultuser':{'type':Sequelize[_0x38d3('0x2')]},'rtptimeout':{'type':Sequelize[_0x38d3('0x25')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x38d3('0x25')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x38d3('0x25')](0xb)},'sendrpid':{'type':Sequelize[_0x38d3('0x3')](_0x38d3('0x17'),'no','pai'),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x38d3('0x2')]},'callbackextension':{'type':Sequelize[_0x38d3('0x2')]},'timert1':{'type':Sequelize['INTEGER'](0xb)},'timerb':{'type':Sequelize[_0x38d3('0x25')](0xb)},'qualifyfreq':{'type':Sequelize[_0x38d3('0x25')](0xb)},'contactpermit':{'type':Sequelize[_0x38d3('0x2')]},'contactdeny':{'type':Sequelize[_0x38d3('0x2')]},'contactacl':{'type':Sequelize[_0x38d3('0x2')]},'unsolicited_mailbox':{'type':Sequelize[_0x38d3('0x2')]},'use_q850_reason':{'type':Sequelize[_0x38d3('0x2')]},'maxforwards':{'type':Sequelize[_0x38d3('0x25')](0xb)},'encryption':{'type':Sequelize[_0x38d3('0x3')](_0x38d3('0x17'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0x38d3('0x17'),'no')},'force_avp':{'type':Sequelize[_0x38d3('0x3')]('yes','no')},'icesupport':{'type':Sequelize[_0x38d3('0x3')](_0x38d3('0x17'),'no')},'dtlsenable':{'type':Sequelize[_0x38d3('0x3')]('yes','no')},'dtlsverify':{'type':Sequelize[_0x38d3('0x3')](_0x38d3('0x17'),'no',_0x38d3('0x2b'),_0x38d3('0x2c'))},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb)},'dtlscertfile':{'type':Sequelize[_0x38d3('0x2')]},'dtlsprivatekey':{'type':Sequelize[_0x38d3('0x2')]},'dtlscipher':{'type':Sequelize[_0x38d3('0x2')]},'dtlscafile':{'type':Sequelize['STRING']},'dtlscapath':{'type':Sequelize[_0x38d3('0x2')]},'dtlssetup':{'type':Sequelize[_0x38d3('0x3')](_0x38d3('0x2d'),'passive',_0x38d3('0x2e')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x38d3('0x2')]},'usereqphone':{'type':Sequelize[_0x38d3('0x3')](_0x38d3('0x17'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x38d3('0x2')]},'recordofffeature':{'type':Sequelize[_0x38d3('0x2')]},'call_limit':{'type':Sequelize[_0x38d3('0x25')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x38d3('0x3')](_0x38d3('0x17'),'no')},'subscribemwi':{'type':Sequelize['ENUM'](_0x38d3('0x17'),'no')},'vmexten':{'type':Sequelize[_0x38d3('0x2')]},'mohinterpret':{'type':Sequelize[_0x38d3('0x2')]},'mohsuggest':{'type':Sequelize[_0x38d3('0x2')]},'parkinglot':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x38d3('0x2')],'defaultValue':_0x38d3('0x2f')},'canreinvite':{'type':Sequelize[_0x38d3('0x3')](_0x38d3('0x17'),'no',_0x38d3('0x18'),_0x38d3('0x19'),'update,nonat'),'defaultValue':'no'},'registry':{'type':Sequelize[_0x38d3('0x2')]},'otherFields':{'type':Sequelize[_0x38d3('0x2')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x38d3('0x2')],'defaultValue':'no'}};
\ No newline at end of file
+var _0xc41c=['friend','peer','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','setDataValue','transport','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','shortinfo','auto','yes','nonat','outgoing','force_rport,comedia','nat','join','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','\x22\x22\x20<>','always','accept','refuse','originate','uas','certificate','active','actpass','dynamic','update','update,nonat','BOOLEAN','sequelize','exports','STRING','name','ENUM'];(function(_0x2522ae,_0x2b2be5){var _0x3d3184=function(_0x405348){while(--_0x405348){_0x2522ae['push'](_0x2522ae['shift']());}};_0x3d3184(++_0x2b2be5);}(_0xc41c,0xcb));var _0xcc41=function(_0x4abd58,_0x523c62){_0x4abd58=_0x4abd58-0x0;var _0x3608a8=_0xc41c[_0x4abd58];return _0x3608a8;};'use strict';var Sequelize=require(_0xcc41('0x0'));module[_0xcc41('0x1')]={'name':{'type':Sequelize[_0xcc41('0x2')],'allowNull':![],'unique':_0xcc41('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xcc41('0x4')](_0xcc41('0x5'),'user',_0xcc41('0x6')),'allowNull':![],'defaultValue':_0xcc41('0x5')},'context':{'type':Sequelize[_0xcc41('0x2')],'allowNull':![],'defaultValue':_0xcc41('0x7')},'callingpres':{'type':Sequelize[_0xcc41('0x4')](_0xcc41('0x8'),_0xcc41('0x9'),_0xcc41('0xa'),_0xcc41('0xb'),'PROHIB_NOT_SCREENED',_0xcc41('0xc'),_0xcc41('0xd'),_0xcc41('0xe'))},'deny':{'type':Sequelize[_0xcc41('0x2')]},'permit':{'type':Sequelize[_0xcc41('0x2')]},'secret':{'type':Sequelize['STRING']},'md5secret':{'type':Sequelize[_0xcc41('0x2')]},'remotesecret':{'type':Sequelize[_0xcc41('0x2')]},'transport':{'type':Sequelize['STRING'],'defaultValue':_0xcc41('0xf'),'set':function(_0x14668e){this[_0xcc41('0x10')](_0xcc41('0x11'),_0x14668e?_0x14668e['join'](','):null);},'get':function(){return this[_0xcc41('0x12')](_0xcc41('0x11'))?this['getDataValue'](_0xcc41('0x11'))[_0xcc41('0x13')](','):null;},'comment':_0xcc41('0x14')},'dtmfmode':{'type':Sequelize[_0xcc41('0x4')](_0xcc41('0x15'),'info',_0xcc41('0x16'),'inband',_0xcc41('0x17')),'defaultValue':_0xcc41('0x15')},'directmedia':{'type':Sequelize[_0xcc41('0x4')](_0xcc41('0x18'),'no',_0xcc41('0x19'),'update',_0xcc41('0x1a')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xcc41('0x2')]},'directmediadeny':{'type':Sequelize[_0xcc41('0x2')]},'nat':{'type':Sequelize[_0xcc41('0x2')],'defaultValue':_0xcc41('0x1b'),'set':function(_0x58cdef){this[_0xcc41('0x10')](_0xcc41('0x1c'),_0x58cdef?_0x58cdef[_0xcc41('0x1d')](','):null);},'get':function(){return this[_0xcc41('0x12')](_0xcc41('0x1c'))?this[_0xcc41('0x12')](_0xcc41('0x1c'))[_0xcc41('0x13')](','):null;},'comment':_0xcc41('0x1e')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0xcc41('0x2')]},'pickupgroup':{'type':Sequelize[_0xcc41('0x2')]},'namedpickupgroup':{'type':Sequelize[_0xcc41('0x2')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xcc41('0x2')],'allowNull':!![]},'disallow':{'type':Sequelize[_0xcc41('0x2')],'defaultValue':_0xcc41('0x1f')},'allow':{'type':Sequelize[_0xcc41('0x2')],'allowNull':![],'defaultValue':_0xcc41('0x20'),'set':function(_0x130de1){this[_0xcc41('0x10')]('allow',_0x130de1?_0x130de1[_0xcc41('0x1d')](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0xcc41('0x12')]('allow')?this[_0xcc41('0x12')](_0xcc41('0x21'))[_0xcc41('0x13')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]'},'autoframing':{'type':Sequelize['ENUM']('yes','no')},'insecure':{'type':Sequelize[_0xcc41('0x2')],'defaultValue':_0xcc41('0x22'),'set':function(_0x6f55b){this['setDataValue'](_0xcc41('0x23'),_0x6f55b?_0x6f55b[_0xcc41('0x1d')](','):null);},'get':function(){return this['getDataValue'](_0xcc41('0x23'))?this[_0xcc41('0x12')](_0xcc41('0x23'))[_0xcc41('0x13')](','):null;},'comment':_0xcc41('0x24')},'trustrpid':{'type':Sequelize['ENUM'](_0xcc41('0x18'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM'](_0xcc41('0x18'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xcc41('0x4')]('yes','no',_0xcc41('0x25'))},'promiscredir':{'type':Sequelize[_0xcc41('0x4')]('yes','no')},'useclientcode':{'type':Sequelize[_0xcc41('0x4')](_0xcc41('0x18'),'no')},'accountcode':{'type':Sequelize[_0xcc41('0x26')](0xb)},'setvar':{'type':Sequelize[_0xcc41('0x2')]},'callerid':{'type':Sequelize['STRING'],'defaultValue':_0xcc41('0x27')},'amaflags':{'type':Sequelize['STRING']},'callcounter':{'type':Sequelize[_0xcc41('0x4')]('yes','no'),'defaultValue':_0xcc41('0x18')},'busylevel':{'type':Sequelize[_0xcc41('0x26')](0xb)},'allowoverlap':{'type':Sequelize[_0xcc41('0x4')](_0xcc41('0x18'),'no')},'allowsubscribe':{'type':Sequelize['ENUM'](_0xcc41('0x18'),'no')},'allowtransfer':{'type':Sequelize[_0xcc41('0x4')](_0xcc41('0x18'),'no')},'ignoresdpversion':{'type':Sequelize[_0xcc41('0x4')](_0xcc41('0x18'),'no')},'subscribecontext':{'type':Sequelize[_0xcc41('0x2')]},'template':{'type':Sequelize['STRING']},'videosupport':{'type':Sequelize[_0xcc41('0x4')]('yes','no',_0xcc41('0x28')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb)},'rfc2833compensate':{'type':Sequelize[_0xcc41('0x4')](_0xcc41('0x18'),'no')},'mailbox':{'type':Sequelize[_0xcc41('0x2')]},'session_timers':{'type':Sequelize[_0xcc41('0x4')](_0xcc41('0x29'),_0xcc41('0x2a'),_0xcc41('0x2b'))},'session_expires':{'type':Sequelize[_0xcc41('0x26')](0xb)},'session_minse':{'type':Sequelize[_0xcc41('0x26')](0xb)},'session_refresher':{'type':Sequelize[_0xcc41('0x4')]('uac',_0xcc41('0x2c')),'defaultValue':_0xcc41('0x2c')},'t38pt_usertpsource':{'type':Sequelize[_0xcc41('0x2')]},'regexten':{'type':Sequelize['STRING']},'fromdomain':{'type':Sequelize[_0xcc41('0x2')]},'fromuser':{'type':Sequelize[_0xcc41('0x2')]},'port':{'type':Sequelize[_0xcc41('0x26')](0x5)},'qualify':{'type':Sequelize['ENUM'](_0xcc41('0x18'),'no'),'defaultValue':_0xcc41('0x18')},'keepalive':{'type':Sequelize['INTEGER'](0xb)},'defaultip':{'type':Sequelize['STRING']},'defaultuser':{'type':Sequelize[_0xcc41('0x2')]},'rtptimeout':{'type':Sequelize[_0xcc41('0x26')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0xcc41('0x26')](0xb)},'rtpkeepalive':{'type':Sequelize[_0xcc41('0x26')](0xb)},'sendrpid':{'type':Sequelize['ENUM'](_0xcc41('0x18'),'no','pai'),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xcc41('0x2')]},'callbackextension':{'type':Sequelize['STRING']},'timert1':{'type':Sequelize['INTEGER'](0xb)},'timerb':{'type':Sequelize['INTEGER'](0xb)},'qualifyfreq':{'type':Sequelize[_0xcc41('0x26')](0xb)},'contactpermit':{'type':Sequelize[_0xcc41('0x2')]},'contactdeny':{'type':Sequelize[_0xcc41('0x2')]},'contactacl':{'type':Sequelize['STRING']},'unsolicited_mailbox':{'type':Sequelize[_0xcc41('0x2')]},'use_q850_reason':{'type':Sequelize[_0xcc41('0x2')]},'maxforwards':{'type':Sequelize['INTEGER'](0xb)},'encryption':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0xcc41('0x4')](_0xcc41('0x18'),'no')},'force_avp':{'type':Sequelize[_0xcc41('0x4')](_0xcc41('0x18'),'no')},'icesupport':{'type':Sequelize[_0xcc41('0x4')](_0xcc41('0x18'),'no')},'dtlsenable':{'type':Sequelize[_0xcc41('0x4')]('yes','no')},'dtlsverify':{'type':Sequelize[_0xcc41('0x4')](_0xcc41('0x18'),'no','fingerprint',_0xcc41('0x2d'))},'dtlsrekey':{'type':Sequelize[_0xcc41('0x26')](0xb)},'dtlscertfile':{'type':Sequelize[_0xcc41('0x2')]},'dtlsprivatekey':{'type':Sequelize[_0xcc41('0x2')]},'dtlscipher':{'type':Sequelize[_0xcc41('0x2')]},'dtlscafile':{'type':Sequelize[_0xcc41('0x2')]},'dtlscapath':{'type':Sequelize[_0xcc41('0x2')]},'dtlssetup':{'type':Sequelize[_0xcc41('0x4')](_0xcc41('0x2e'),'passive',_0xcc41('0x2f')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING']},'usereqphone':{'type':Sequelize['ENUM'](_0xcc41('0x18'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING']},'recordofffeature':{'type':Sequelize['STRING']},'call_limit':{'type':Sequelize[_0xcc41('0x26')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0xcc41('0x4')]('yes','no')},'subscribemwi':{'type':Sequelize[_0xcc41('0x4')]('yes','no')},'vmexten':{'type':Sequelize['STRING']},'mohinterpret':{'type':Sequelize[_0xcc41('0x2')]},'mohsuggest':{'type':Sequelize['STRING']},'parkinglot':{'type':Sequelize[_0xcc41('0x2')]},'description':{'type':Sequelize[_0xcc41('0x2')]},'host':{'type':Sequelize[_0xcc41('0x2')],'defaultValue':_0xcc41('0x30')},'canreinvite':{'type':Sequelize[_0xcc41('0x4')](_0xcc41('0x18'),'no',_0xcc41('0x19'),_0xcc41('0x31'),_0xcc41('0x32')),'defaultValue':'no'},'registry':{'type':Sequelize[_0xcc41('0x2')]},'otherFields':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0xcc41('0x33')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0xcc41('0x2')],'defaultValue':'no'}};
\ No newline at end of file
index 6943918..4fa2281 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8d0e=['omit','updatedAt','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','server/files/templates/trunk.ejs','utf8','readFileSync','root','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','Unable\x20to\x20retrieve\x20the\x20current\x20user','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','client','http','request','then','Trunk,\x20%s,\x20%s','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','code','error','message','info','result','catch','sendStatus','status','end','json','offset','undefined','count','reject','update','destroy','get','Trunks','stack','name','send','map','Trunk','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','pick','where','merge','VIRTUAL','filter','options','include','findAll','rows','show','params','keys','rawAttributes','includeAll','find','createdAt','body'];(function(_0x307c85,_0x2d6aee){var _0x2d1933=function(_0x2a920b){while(--_0x2a920b){_0x307c85['push'](_0x307c85['shift']());}};_0x2d1933(++_0x2d6aee);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x449267,_0x5f000d){_0x449267=_0x449267-0x0;var _0x235da0=_0x8d0e[_0x449267];return _0x235da0;};'use strict';var emlformat=require(_0xe8d0('0x0'));var rimraf=require(_0xe8d0('0x1'));var zipdir=require(_0xe8d0('0x2'));var jsonpatch=require(_0xe8d0('0x3'));var rp=require(_0xe8d0('0x4'));var moment=require(_0xe8d0('0x5'));var BPromise=require(_0xe8d0('0x6'));var Mustache=require(_0xe8d0('0x7'));var util=require(_0xe8d0('0x8'));var path=require('path');var sox=require(_0xe8d0('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe8d0('0xa'));var _=require(_0xe8d0('0xb'));var squel=require(_0xe8d0('0xc'));var crypto=require(_0xe8d0('0xd'));var jsforce=require(_0xe8d0('0xe'));var deskjs=require(_0xe8d0('0xf'));var toCsv=require(_0xe8d0('0x10'));var querystring=require(_0xe8d0('0x11'));var Papa=require('papaparse');var Redis=require(_0xe8d0('0x12'));var authService=require(_0xe8d0('0x13'));var qs=require(_0xe8d0('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe8d0('0x15'))(_0xe8d0('0x16'));var utils=require(_0xe8d0('0x17'));var config=require(_0xe8d0('0x18'));var licenseUtil=require(_0xe8d0('0x19'));var db=require(_0xe8d0('0x1a'))['db'];var jayson=require('jayson/promise');var client=jayson[_0xe8d0('0x1b')][_0xe8d0('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x533b42,_0x2b640d,_0x4cbd26,_0x59b4b7){return new BPromise(function(_0x90a1ea,_0x2aa906){var _0x1aa725=_0x59b4b7||client;return _0x1aa725[_0xe8d0('0x1d')](_0x533b42,_0x4cbd26)[_0xe8d0('0x1e')](function(_0x7151c6){logger['info'](_0xe8d0('0x1f'),_0x2b640d,'request\x20sent');logger[_0xe8d0('0x20')](_0xe8d0('0x21'),_0x2b640d,_0xe8d0('0x22'),JSON['stringify'](_0x7151c6));if(_0x7151c6['error']){if(_0x7151c6['error'][_0xe8d0('0x23')]===0x1f4){logger[_0xe8d0('0x24')](_0xe8d0('0x1f'),_0x2b640d,_0x7151c6[_0xe8d0('0x24')][_0xe8d0('0x25')]);return _0x2aa906(_0x7151c6['error'][_0xe8d0('0x25')]);}logger[_0xe8d0('0x24')]('Trunk,\x20%s,\x20%s',_0x2b640d,_0x7151c6['error']['message']);return _0x90a1ea(_0x7151c6[_0xe8d0('0x24')][_0xe8d0('0x25')]);}else{logger[_0xe8d0('0x26')](_0xe8d0('0x1f'),_0x2b640d,_0xe8d0('0x22'));_0x90a1ea(_0x7151c6[_0xe8d0('0x27')][_0xe8d0('0x25')]);}})[_0xe8d0('0x28')](function(_0x32e39a){logger['error'](_0xe8d0('0x1f'),_0x2b640d,_0x32e39a);_0x2aa906(_0x32e39a);});});}function respondWithStatusCode(_0x9f747,_0x572c25){_0x572c25=_0x572c25||0xcc;return function(_0x106614){if(_0x106614){return _0x9f747[_0xe8d0('0x29')](_0x572c25);}return _0x9f747[_0xe8d0('0x2a')](_0x572c25)[_0xe8d0('0x2b')]();};}function respondWithResult(_0x146783,_0x149dfd){_0x149dfd=_0x149dfd||0xc8;return function(_0x31519b){if(_0x31519b){return _0x146783[_0xe8d0('0x2a')](_0x149dfd)[_0xe8d0('0x2c')](_0x31519b);}};}function respondWithFilteredResult(_0x2dee67,_0x264de4){return function(_0x539548){if(_0x539548){var _0x24982c=typeof _0x264de4[_0xe8d0('0x2d')]===_0xe8d0('0x2e')&&typeof _0x264de4['limit']===_0xe8d0('0x2e');var _0x343b08=_0x539548['count'];var _0x1519e2=_0x24982c?0x0:_0x264de4[_0xe8d0('0x2d')];var _0x11fcf2=_0x24982c?_0x539548[_0xe8d0('0x2f')]:_0x264de4[_0xe8d0('0x2d')]+_0x264de4['limit'];var _0x3cc292;if(_0x11fcf2>=_0x343b08){_0x11fcf2=_0x343b08;_0x3cc292=0xc8;}else{_0x3cc292=0xce;}_0x2dee67['status'](_0x3cc292);return _0x2dee67['set']('Content-Range',_0x1519e2+'-'+_0x11fcf2+'/'+_0x343b08)[_0xe8d0('0x2c')](_0x539548);}return null;};}function patchUpdates(_0x13cd4c){return function(_0x36ccec){try{jsonpatch['apply'](_0x36ccec,_0x13cd4c,!![]);}catch(_0x57e375){return BPromise[_0xe8d0('0x30')](_0x57e375);}return _0x36ccec['save']();};}function saveUpdates(_0x3b5d31,_0x383084){return function(_0x327004){if(_0x327004){return _0x327004[_0xe8d0('0x31')](_0x3b5d31)[_0xe8d0('0x1e')](function(_0x5bbc9e){return _0x5bbc9e;});}return null;};}function removeEntity(_0x1bee61,_0x4db53c){return function(_0x402e90){if(_0x402e90){return _0x402e90[_0xe8d0('0x32')]()['then'](function(){var _0x4547b6=_0x402e90[_0xe8d0('0x33')]({'plain':!![]});var _0x4c1347=_0xe8d0('0x34');return db['UserProfileResource'][_0xe8d0('0x32')]({'where':{'type':_0x4c1347,'resourceId':_0x4547b6['id']}})['then'](function(){return _0x402e90;});})[_0xe8d0('0x1e')](function(){_0x1bee61['status'](0xcc)[_0xe8d0('0x2b')]();});}};}function handleEntityNotFound(_0xb2cdbf,_0x1e2430){return function(_0x320565){if(!_0x320565){_0xb2cdbf['sendStatus'](0x194);}return _0x320565;};}function handleError(_0x36a650,_0x354e19){_0x354e19=_0x354e19||0x1f4;return function(_0x20eec5){logger['error'](_0x20eec5[_0xe8d0('0x35')]);if(_0x20eec5[_0xe8d0('0x36')]){delete _0x20eec5[_0xe8d0('0x36')];}_0x36a650[_0xe8d0('0x2a')](_0x354e19)[_0xe8d0('0x37')](_0x20eec5);};}exports['index']=function(_0x5a969a,_0x1828c5){var _0x10970d={},_0x3d76d5={},_0x318106={'count':0x0,'rows':[]};var _0x23d72e=_[_0xe8d0('0x38')](db[_0xe8d0('0x39')]['rawAttributes'],function(_0x5dff14){return{'name':_0x5dff14[_0xe8d0('0x3a')],'type':_0x5dff14[_0xe8d0('0x3b')][_0xe8d0('0x3c')]};});_0x3d76d5[_0xe8d0('0x3d')]=_[_0xe8d0('0x38')](_0x23d72e,'name');_0x3d76d5[_0xe8d0('0x3e')]=_['keys'](_0x5a969a[_0xe8d0('0x3e')]);_0x3d76d5[_0xe8d0('0x3f')]=_[_0xe8d0('0x40')](_0x3d76d5['model'],_0x3d76d5[_0xe8d0('0x3e')]);_0x10970d[_0xe8d0('0x41')]=_[_0xe8d0('0x40')](_0x3d76d5[_0xe8d0('0x3d')],qs[_0xe8d0('0x42')](_0x5a969a['query']['fields']));_0x10970d['attributes']=_0x10970d['attributes'][_0xe8d0('0x43')]?_0x10970d['attributes']:_0x3d76d5[_0xe8d0('0x3d')];if(!_0x5a969a[_0xe8d0('0x3e')][_0xe8d0('0x44')](_0xe8d0('0x45'))){_0x10970d[_0xe8d0('0x46')]=qs[_0xe8d0('0x46')](_0x5a969a[_0xe8d0('0x3e')][_0xe8d0('0x46')]);_0x10970d['offset']=qs[_0xe8d0('0x2d')](_0x5a969a[_0xe8d0('0x3e')]['offset']);}_0x10970d['order']=qs[_0xe8d0('0x47')](_0x5a969a[_0xe8d0('0x3e')][_0xe8d0('0x47')]);_0x10970d['where']=qs[_0xe8d0('0x3f')](_[_0xe8d0('0x48')](_0x5a969a['query'],_0x3d76d5[_0xe8d0('0x3f')]),_0x23d72e);if(_0x5a969a[_0xe8d0('0x3e')]['filter']){_0x10970d[_0xe8d0('0x49')]=_[_0xe8d0('0x4a')](_0x10970d[_0xe8d0('0x49')],{'$or':_[_0xe8d0('0x38')](_0x23d72e,function(_0x1d5815){if(_0x1d5815[_0xe8d0('0x3b')]!==_0xe8d0('0x4b')){var _0x1ce97d={};_0x1ce97d[_0x1d5815['name']]={'$like':'%'+_0x5a969a[_0xe8d0('0x3e')][_0xe8d0('0x4c')]+'%'};return _0x1ce97d;}})});}_0x10970d=_[_0xe8d0('0x4a')]({},_0x10970d,_0x5a969a[_0xe8d0('0x4d')]);var _0x28d38b={'where':_0x10970d[_0xe8d0('0x49')]};return db[_0xe8d0('0x39')][_0xe8d0('0x2f')](_0x28d38b)[_0xe8d0('0x1e')](function(_0x2e2c05){_0x318106[_0xe8d0('0x2f')]=_0x2e2c05;if(_0x5a969a[_0xe8d0('0x3e')]['includeAll']){_0x10970d[_0xe8d0('0x4e')]=[{'all':!![]}];}return db[_0xe8d0('0x39')][_0xe8d0('0x4f')](_0x10970d);})[_0xe8d0('0x1e')](function(_0x34047c){_0x318106[_0xe8d0('0x50')]=_0x34047c;return _0x318106;})[_0xe8d0('0x1e')](respondWithFilteredResult(_0x1828c5,_0x10970d))['catch'](handleError(_0x1828c5,null));};exports[_0xe8d0('0x51')]=function(_0x424764,_0x151cf4){var _0x205933={'raw':![],'where':{'id':_0x424764[_0xe8d0('0x52')]['id']}},_0x4ed47f={};_0x4ed47f['model']=_[_0xe8d0('0x53')](db[_0xe8d0('0x39')][_0xe8d0('0x54')]);_0x4ed47f[_0xe8d0('0x3e')]=_[_0xe8d0('0x53')](_0x424764[_0xe8d0('0x3e')]);_0x4ed47f[_0xe8d0('0x3f')]=_['intersection'](_0x4ed47f[_0xe8d0('0x3d')],_0x4ed47f['query']);_0x205933['attributes']=_[_0xe8d0('0x40')](_0x4ed47f['model'],qs[_0xe8d0('0x42')](_0x424764['query'][_0xe8d0('0x42')]));_0x205933[_0xe8d0('0x41')]=_0x205933[_0xe8d0('0x41')][_0xe8d0('0x43')]?_0x205933['attributes']:_0x4ed47f[_0xe8d0('0x3d')];if(_0x424764[_0xe8d0('0x3e')][_0xe8d0('0x55')]){_0x205933[_0xe8d0('0x4e')]=[{'all':!![]}];}_0x205933=_[_0xe8d0('0x4a')]({},_0x205933,_0x424764['options']);return db[_0xe8d0('0x39')][_0xe8d0('0x56')](_0x205933)[_0xe8d0('0x1e')](handleEntityNotFound(_0x151cf4,null))['then'](respondWithResult(_0x151cf4,null))[_0xe8d0('0x28')](handleError(_0x151cf4,null));};exports['clone']=function(_0x56b4fa,_0x1bd329){var _0x37040a={'where':{'id':_0x56b4fa[_0xe8d0('0x52')]['id']}},_0x4e7b49={};_0x4e7b49[_0xe8d0('0x3d')]=_['keys'](db[_0xe8d0('0x39')][_0xe8d0('0x54')]);_0x37040a[_0xe8d0('0x41')]=_[_0xe8d0('0x40')](_0x4e7b49['model'],qs[_0xe8d0('0x42')](_0x56b4fa[_0xe8d0('0x3e')][_0xe8d0('0x42')]));_0x37040a[_0xe8d0('0x41')]=_0x37040a['attributes'][_0xe8d0('0x43')]?_0x37040a[_0xe8d0('0x41')]:_0x4e7b49[_0xe8d0('0x3d')];if(_0x56b4fa[_0xe8d0('0x3e')][_0xe8d0('0x55')]){_0x37040a[_0xe8d0('0x4e')]=[{'all':!![]}];}_0x37040a=_['merge']({},_0x37040a,_0x56b4fa['options']);return db[_0xe8d0('0x39')]['find'](_0x37040a)[_0xe8d0('0x1e')](handleEntityNotFound(_0x1bd329,null))[_0xe8d0('0x1e')](function(_0x4c0d4c){if(_0x4c0d4c){var _0x5ac1ae=_0x4c0d4c[_0xe8d0('0x33')]({'plain':!![]});_0x5ac1ae=qs['omit'](_0x5ac1ae,['id',_0xe8d0('0x57'),'updatedAt']);_0x56b4fa[_0xe8d0('0x58')]=_[_0xe8d0('0x59')](_0x56b4fa[_0xe8d0('0x58')],['id','createdAt',_0xe8d0('0x5a')]);return db[_0xe8d0('0x39')]['create'](_[_0xe8d0('0x4a')](_0x5ac1ae,_0x56b4fa['body']),{'include':_0x56b4fa[_0xe8d0('0x3e')]['includeAll']?[{'all':!![]}]:undefined})[_0xe8d0('0x1e')](function(_0x17afc2){var _0x29467d=_0x56b4fa[_0xe8d0('0x5b')][_0xe8d0('0x33')]({'plain':!![]});if(!_0x29467d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x29467d['role']===_0xe8d0('0x5b')){var _0x55a2df=_0x17afc2[_0xe8d0('0x33')]({'plain':!![]});var _0x18b655=_0xe8d0('0x34');return db[_0xe8d0('0x5c')][_0xe8d0('0x56')]({'where':{'name':_0x18b655,'userProfileId':_0x29467d[_0xe8d0('0x5d')]},'raw':!![]})[_0xe8d0('0x1e')](function(_0x20647d){if(_0x20647d&&_0x20647d[_0xe8d0('0x5e')]===0x0){return db[_0xe8d0('0x5f')][_0xe8d0('0x60')]({'name':_0x55a2df[_0xe8d0('0x36')],'resourceId':_0x55a2df['id'],'type':_0x20647d[_0xe8d0('0x36')],'sectionId':_0x20647d['id']},{})[_0xe8d0('0x1e')](function(){return _0x17afc2;});}else{return _0x17afc2;}})[_0xe8d0('0x28')](function(_0x4a68d5){logger[_0xe8d0('0x24')](_0xe8d0('0x61'),_0x4a68d5);throw _0x4a68d5;});}return _0x17afc2;});}})[_0xe8d0('0x1e')](respondWithResult(_0x1bd329,0xc9))[_0xe8d0('0x28')](handleError(_0x1bd329,null));};exports[_0xe8d0('0x60')]=function(_0x4848d4,_0x2eeb92,_0x1d30c0){var _0x45b42b;return db[_0xe8d0('0x39')][_0xe8d0('0x60')](_0x4848d4[_0xe8d0('0x58')],{'raw':!![]})[_0xe8d0('0x1e')](function(_0x13ceb4){_0x45b42b=_0x13ceb4;return db[_0xe8d0('0x39')][_0xe8d0('0x4f')]({'raw':!![]});})[_0xe8d0('0x1e')](function(_0xdb3e53){var _0x556d7e=fs['readFileSync'](path[_0xe8d0('0x62')](config['root'],_0xe8d0('0x63')),_0xe8d0('0x64'));var _0x56761c=fs[_0xe8d0('0x65')](path[_0xe8d0('0x62')](config[_0xe8d0('0x66')],_0xe8d0('0x67')),_0xe8d0('0x64'));var _0x1b5df8=ejs[_0xe8d0('0x68')](_0x556d7e,{'trunks':_0xdb3e53||[]});fs[_0xe8d0('0x69')](_0xe8d0('0x6a'),_0x1b5df8);if(_0x45b42b[_0xe8d0('0x6b')]){var _0xb078d8=ejs[_0xe8d0('0x68')](_0x56761c,{'trunks':_0xdb3e53||[]});fs[_0xe8d0('0x69')](_0xe8d0('0x6c'),_0xb078d8);}})[_0xe8d0('0x1e')](function(){return respondWithRpcPromise(_0xe8d0('0x6d'),_0xe8d0('0x60'),{'module':_0xe8d0('0x6e')});})[_0xe8d0('0x1e')](function(){var _0x500fb0=_0x4848d4[_0xe8d0('0x5b')][_0xe8d0('0x33')]({'plain':!![]});if(!_0x500fb0)throw new Error(_0xe8d0('0x6f'));if(_0x500fb0['role']===_0xe8d0('0x5b')){var _0x4c54c4=_0x45b42b[_0xe8d0('0x33')]({'plain':!![]});return db[_0xe8d0('0x5c')][_0xe8d0('0x56')]({'where':{'name':'Trunks','userProfileId':_0x500fb0[_0xe8d0('0x5d')]},'raw':!![]})[_0xe8d0('0x1e')](function(_0xc94cd3){if(_0xc94cd3&&_0xc94cd3[_0xe8d0('0x5e')]===0x0){return db[_0xe8d0('0x5f')]['create']({'name':_0x4c54c4[_0xe8d0('0x36')],'resourceId':_0x4c54c4['id'],'type':_0xc94cd3[_0xe8d0('0x36')],'sectionId':_0xc94cd3['id']},{})[_0xe8d0('0x1e')](function(){return _0x45b42b;});}else{return _0x45b42b;}})[_0xe8d0('0x28')](function(_0x252f0e){logger[_0xe8d0('0x24')](_0xe8d0('0x61'),_0x252f0e);throw _0x252f0e;});}return _0x45b42b;})[_0xe8d0('0x1e')](respondWithResult(_0x2eeb92,0xc9))['catch'](handleError(_0x2eeb92,null));};exports[_0xe8d0('0x31')]=function(_0x31b9d3,_0x14d722,_0x2aa6fc){var _0x4d5997;return db[_0xe8d0('0x39')][_0xe8d0('0x56')]({'where':{'id':_0x31b9d3[_0xe8d0('0x52')]['id']}})['then'](handleEntityNotFound(_0x14d722,null))[_0xe8d0('0x1e')](saveUpdates(_0x31b9d3['body'],null))[_0xe8d0('0x1e')](function(_0x478eb2){if(_0x478eb2){_0x4d5997=_0x478eb2;return db[_0xe8d0('0x39')][_0xe8d0('0x4f')]({'raw':!![]});}})[_0xe8d0('0x1e')](function(_0xa90bdc){if(_0xa90bdc){var _0x87aa04=fs[_0xe8d0('0x65')](path[_0xe8d0('0x62')](config[_0xe8d0('0x66')],_0xe8d0('0x63')),_0xe8d0('0x64'));var _0x2eaf2f=fs[_0xe8d0('0x65')](path['join'](config[_0xe8d0('0x66')],_0xe8d0('0x67')),_0xe8d0('0x64'));var _0x761e97=ejs[_0xe8d0('0x68')](_0x87aa04,{'trunks':_0xa90bdc||[]});fs[_0xe8d0('0x69')](_0xe8d0('0x6a'),_0x761e97);var _0x605b5f=ejs[_0xe8d0('0x68')](_0x2eaf2f,{'trunks':_0xa90bdc||[]});fs[_0xe8d0('0x69')]('/etc/asterisk/sip_xcally_registers.conf',_0x605b5f);return respondWithRpcPromise(_0xe8d0('0x6d'),_0xe8d0('0x31'),{'module':_0xe8d0('0x6e')});}return null;})[_0xe8d0('0x1e')](function(_0x255e4b){if(_0x255e4b){return _0x4d5997;}})['then'](respondWithResult(_0x14d722,null))['catch'](handleError(_0x14d722,null));};exports[_0xe8d0('0x32')]=function(_0x5c8c7d,_0x3fb7c8,_0x16098b){var _0x363b3a;return db['Trunk'][_0xe8d0('0x56')]({'where':{'id':_0x5c8c7d['params']['id']}})[_0xe8d0('0x1e')](handleEntityNotFound(_0x3fb7c8,null))[_0xe8d0('0x1e')](removeEntity(_0x3fb7c8,null))[_0xe8d0('0x1e')](function(){return db[_0xe8d0('0x39')][_0xe8d0('0x4f')]({'raw':!![]});})['then'](function(_0x58034d){var _0xfbacce=fs[_0xe8d0('0x65')](path[_0xe8d0('0x62')](config[_0xe8d0('0x66')],_0xe8d0('0x63')),_0xe8d0('0x64'));var _0x2790f=fs[_0xe8d0('0x65')](path[_0xe8d0('0x62')](config['root'],_0xe8d0('0x67')),_0xe8d0('0x64'));var _0x142db4=ejs[_0xe8d0('0x68')](_0xfbacce,{'trunks':_0x58034d});var _0x4a568f=ejs['render'](_0x2790f,{'trunks':_0x58034d});fs[_0xe8d0('0x69')](_0xe8d0('0x6a'),_0x142db4);fs[_0xe8d0('0x69')](_0xe8d0('0x6c'),_0x4a568f);return respondWithRpcPromise(_0xe8d0('0x6d'),_0xe8d0('0x32'),{'module':_0xe8d0('0x6e')});})[_0xe8d0('0x28')](handleError(_0x3fb7c8,null));};
\ No newline at end of file
+var _0xedd9=['body','createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','userProfileId','autoAssociation','create','readFileSync','join','root','utf8','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','server/files/templates/trunk.ejs','server/files/templates/registry.ejs','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','jayson/promise','client','http','request','then','info','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','Trunk,\x20%s,\x20%s','status','end','offset','undefined','count','set','Content-Range','json','apply','reject','save','update','destroy','get','Trunks','UserProfileResource','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','limit','order','sort','where','filters','pick','filter','merge','options','includeAll','include','Trunk','findAll','rows','show','params','length','find','omit'];(function(_0x5465b6,_0x189c8d){var _0x5a7f6a=function(_0x1f36b7){while(--_0x1f36b7){_0x5465b6['push'](_0x5465b6['shift']());}};_0x5a7f6a(++_0x189c8d);}(_0xedd9,0xfc));var _0x9edd=function(_0x36e6b7,_0x76c28){_0x36e6b7=_0x36e6b7-0x0;var _0x39bb34=_0xedd9[_0x36e6b7];return _0x39bb34;};'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'];var jayson=require(_0x9edd('0x18'));var client=jayson[_0x9edd('0x19')][_0x9edd('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0xfca576,_0xef5498,_0x47eb64,_0x176bfa){return new BPromise(function(_0x44fc7c,_0x891832){var _0x4d9a7=_0x176bfa||client;return _0x4d9a7[_0x9edd('0x1b')](_0xfca576,_0x47eb64)[_0x9edd('0x1c')](function(_0x1042aa){logger[_0x9edd('0x1d')]('Trunk,\x20%s,\x20%s',_0xef5498,_0x9edd('0x1e'));logger[_0x9edd('0x1f')](_0x9edd('0x20'),_0xef5498,'request\x20sent',JSON[_0x9edd('0x21')](_0x1042aa));if(_0x1042aa[_0x9edd('0x22')]){if(_0x1042aa[_0x9edd('0x22')]['code']===0x1f4){logger[_0x9edd('0x22')]('Trunk,\x20%s,\x20%s',_0xef5498,_0x1042aa[_0x9edd('0x22')][_0x9edd('0x23')]);return _0x891832(_0x1042aa['error']['message']);}logger[_0x9edd('0x22')]('Trunk,\x20%s,\x20%s',_0xef5498,_0x1042aa[_0x9edd('0x22')]['message']);return _0x44fc7c(_0x1042aa['error'][_0x9edd('0x23')]);}else{logger[_0x9edd('0x1d')]('Trunk,\x20%s,\x20%s',_0xef5498,'request\x20sent');_0x44fc7c(_0x1042aa[_0x9edd('0x24')][_0x9edd('0x23')]);}})[_0x9edd('0x25')](function(_0x542172){logger[_0x9edd('0x22')](_0x9edd('0x26'),_0xef5498,_0x542172);_0x891832(_0x542172);});});}function respondWithStatusCode(_0x44a6c1,_0x2ca65f){_0x2ca65f=_0x2ca65f||0xcc;return function(_0x339a0d){if(_0x339a0d){return _0x44a6c1['sendStatus'](_0x2ca65f);}return _0x44a6c1[_0x9edd('0x27')](_0x2ca65f)[_0x9edd('0x28')]();};}function respondWithResult(_0x3a1ea5,_0x2f9f86){_0x2f9f86=_0x2f9f86||0xc8;return function(_0x310a4d){if(_0x310a4d){return _0x3a1ea5['status'](_0x2f9f86)['json'](_0x310a4d);}};}function respondWithFilteredResult(_0x3276ee,_0xfeca7b){return function(_0x8d67aa){if(_0x8d67aa){var _0x25e135=typeof _0xfeca7b[_0x9edd('0x29')]==='undefined'&&typeof _0xfeca7b['limit']===_0x9edd('0x2a');var _0x257a26=_0x8d67aa[_0x9edd('0x2b')];var _0x52746a=_0x25e135?0x0:_0xfeca7b[_0x9edd('0x29')];var _0x28cfae=_0x25e135?_0x8d67aa[_0x9edd('0x2b')]:_0xfeca7b[_0x9edd('0x29')]+_0xfeca7b['limit'];var _0x2155a1;if(_0x28cfae>=_0x257a26){_0x28cfae=_0x257a26;_0x2155a1=0xc8;}else{_0x2155a1=0xce;}_0x3276ee[_0x9edd('0x27')](_0x2155a1);return _0x3276ee[_0x9edd('0x2c')](_0x9edd('0x2d'),_0x52746a+'-'+_0x28cfae+'/'+_0x257a26)[_0x9edd('0x2e')](_0x8d67aa);}return null;};}function patchUpdates(_0x42e664){return function(_0x209aba){try{jsonpatch[_0x9edd('0x2f')](_0x209aba,_0x42e664,!![]);}catch(_0x19b6c1){return BPromise[_0x9edd('0x30')](_0x19b6c1);}return _0x209aba[_0x9edd('0x31')]();};}function saveUpdates(_0x138002,_0x6907a5){return function(_0xa55906){if(_0xa55906){return _0xa55906[_0x9edd('0x32')](_0x138002)['then'](function(_0x1453d2){return _0x1453d2;});}return null;};}function removeEntity(_0x259259,_0x267c74){return function(_0x5d1707){if(_0x5d1707){return _0x5d1707[_0x9edd('0x33')]()[_0x9edd('0x1c')](function(){var _0xde9b13=_0x5d1707[_0x9edd('0x34')]({'plain':!![]});var _0x21bc30=_0x9edd('0x35');return db[_0x9edd('0x36')][_0x9edd('0x33')]({'where':{'type':_0x21bc30,'resourceId':_0xde9b13['id']}})[_0x9edd('0x1c')](function(){return _0x5d1707;});})[_0x9edd('0x1c')](function(){_0x259259[_0x9edd('0x27')](0xcc)[_0x9edd('0x28')]();});}};}function handleEntityNotFound(_0x27eb7e,_0x14f780){return function(_0x5757fc){if(!_0x5757fc){_0x27eb7e[_0x9edd('0x37')](0x194);}return _0x5757fc;};}function handleError(_0x5ed62d,_0x968303){_0x968303=_0x968303||0x1f4;return function(_0x148630){logger[_0x9edd('0x22')](_0x148630[_0x9edd('0x38')]);if(_0x148630[_0x9edd('0x39')]){delete _0x148630['name'];}_0x5ed62d[_0x9edd('0x27')](_0x968303)[_0x9edd('0x3a')](_0x148630);};}exports[_0x9edd('0x3b')]=function(_0x38e9be,_0x1be77f){var _0x337e6c={},_0x5c0627={},_0x1cbbac={'count':0x0,'rows':[]};var _0x1ccee8=_[_0x9edd('0x3c')](db['Trunk'][_0x9edd('0x3d')],function(_0x56a228){return{'name':_0x56a228[_0x9edd('0x3e')],'type':_0x56a228['type'][_0x9edd('0x3f')]};});_0x5c0627[_0x9edd('0x40')]=_[_0x9edd('0x3c')](_0x1ccee8,'name');_0x5c0627[_0x9edd('0x41')]=_[_0x9edd('0x42')](_0x38e9be[_0x9edd('0x41')]);_0x5c0627['filters']=_[_0x9edd('0x43')](_0x5c0627['model'],_0x5c0627[_0x9edd('0x41')]);_0x337e6c[_0x9edd('0x44')]=_['intersection'](_0x5c0627[_0x9edd('0x40')],qs[_0x9edd('0x45')](_0x38e9be[_0x9edd('0x41')][_0x9edd('0x45')]));_0x337e6c['attributes']=_0x337e6c[_0x9edd('0x44')]['length']?_0x337e6c[_0x9edd('0x44')]:_0x5c0627[_0x9edd('0x40')];if(!_0x38e9be['query'][_0x9edd('0x46')]('nolimit')){_0x337e6c['limit']=qs[_0x9edd('0x47')](_0x38e9be[_0x9edd('0x41')][_0x9edd('0x47')]);_0x337e6c[_0x9edd('0x29')]=qs[_0x9edd('0x29')](_0x38e9be[_0x9edd('0x41')][_0x9edd('0x29')]);}_0x337e6c[_0x9edd('0x48')]=qs[_0x9edd('0x49')](_0x38e9be[_0x9edd('0x41')][_0x9edd('0x49')]);_0x337e6c[_0x9edd('0x4a')]=qs[_0x9edd('0x4b')](_[_0x9edd('0x4c')](_0x38e9be[_0x9edd('0x41')],_0x5c0627['filters']),_0x1ccee8);if(_0x38e9be[_0x9edd('0x41')][_0x9edd('0x4d')]){_0x337e6c[_0x9edd('0x4a')]=_[_0x9edd('0x4e')](_0x337e6c[_0x9edd('0x4a')],{'$or':_[_0x9edd('0x3c')](_0x1ccee8,function(_0x10d41e){if(_0x10d41e['type']!=='VIRTUAL'){var _0x4bc7a1={};_0x4bc7a1[_0x10d41e[_0x9edd('0x39')]]={'$like':'%'+_0x38e9be['query'][_0x9edd('0x4d')]+'%'};return _0x4bc7a1;}})});}_0x337e6c=_[_0x9edd('0x4e')]({},_0x337e6c,_0x38e9be[_0x9edd('0x4f')]);var _0x8db801={'where':_0x337e6c[_0x9edd('0x4a')]};return db['Trunk'][_0x9edd('0x2b')](_0x8db801)[_0x9edd('0x1c')](function(_0x40e33d){_0x1cbbac['count']=_0x40e33d;if(_0x38e9be[_0x9edd('0x41')][_0x9edd('0x50')]){_0x337e6c[_0x9edd('0x51')]=[{'all':!![]}];}return db[_0x9edd('0x52')][_0x9edd('0x53')](_0x337e6c);})[_0x9edd('0x1c')](function(_0x4d4f33){_0x1cbbac[_0x9edd('0x54')]=_0x4d4f33;return _0x1cbbac;})[_0x9edd('0x1c')](respondWithFilteredResult(_0x1be77f,_0x337e6c))['catch'](handleError(_0x1be77f,null));};exports[_0x9edd('0x55')]=function(_0x8d8701,_0x4bb324){var _0x2bd089={'raw':![],'where':{'id':_0x8d8701[_0x9edd('0x56')]['id']}},_0x8134cd={};_0x8134cd['model']=_[_0x9edd('0x42')](db[_0x9edd('0x52')][_0x9edd('0x3d')]);_0x8134cd[_0x9edd('0x41')]=_['keys'](_0x8d8701[_0x9edd('0x41')]);_0x8134cd[_0x9edd('0x4b')]=_[_0x9edd('0x43')](_0x8134cd['model'],_0x8134cd[_0x9edd('0x41')]);_0x2bd089[_0x9edd('0x44')]=_['intersection'](_0x8134cd[_0x9edd('0x40')],qs['fields'](_0x8d8701[_0x9edd('0x41')][_0x9edd('0x45')]));_0x2bd089[_0x9edd('0x44')]=_0x2bd089[_0x9edd('0x44')][_0x9edd('0x57')]?_0x2bd089[_0x9edd('0x44')]:_0x8134cd[_0x9edd('0x40')];if(_0x8d8701[_0x9edd('0x41')][_0x9edd('0x50')]){_0x2bd089[_0x9edd('0x51')]=[{'all':!![]}];}_0x2bd089=_[_0x9edd('0x4e')]({},_0x2bd089,_0x8d8701['options']);return db[_0x9edd('0x52')][_0x9edd('0x58')](_0x2bd089)[_0x9edd('0x1c')](handleEntityNotFound(_0x4bb324,null))['then'](respondWithResult(_0x4bb324,null))[_0x9edd('0x25')](handleError(_0x4bb324,null));};exports['clone']=function(_0x54d83d,_0x54ecfa){var _0x1348a7={'where':{'id':_0x54d83d[_0x9edd('0x56')]['id']}},_0x45f47c={};_0x45f47c[_0x9edd('0x40')]=_['keys'](db['Trunk']['rawAttributes']);_0x1348a7[_0x9edd('0x44')]=_[_0x9edd('0x43')](_0x45f47c[_0x9edd('0x40')],qs[_0x9edd('0x45')](_0x54d83d[_0x9edd('0x41')][_0x9edd('0x45')]));_0x1348a7[_0x9edd('0x44')]=_0x1348a7[_0x9edd('0x44')]['length']?_0x1348a7[_0x9edd('0x44')]:_0x45f47c['model'];if(_0x54d83d[_0x9edd('0x41')][_0x9edd('0x50')]){_0x1348a7['include']=[{'all':!![]}];}_0x1348a7=_[_0x9edd('0x4e')]({},_0x1348a7,_0x54d83d[_0x9edd('0x4f')]);return db[_0x9edd('0x52')]['find'](_0x1348a7)[_0x9edd('0x1c')](handleEntityNotFound(_0x54ecfa,null))[_0x9edd('0x1c')](function(_0x430eb4){if(_0x430eb4){var _0x15ebfa=_0x430eb4[_0x9edd('0x34')]({'plain':!![]});_0x15ebfa=qs[_0x9edd('0x59')](_0x15ebfa,['id','createdAt','updatedAt']);_0x54d83d[_0x9edd('0x5a')]=_['omit'](_0x54d83d[_0x9edd('0x5a')],['id',_0x9edd('0x5b'),_0x9edd('0x5c')]);return db[_0x9edd('0x52')]['create'](_[_0x9edd('0x4e')](_0x15ebfa,_0x54d83d['body']),{'include':_0x54d83d[_0x9edd('0x41')][_0x9edd('0x50')]?[{'all':!![]}]:undefined})[_0x9edd('0x1c')](function(_0x5ca123){var _0x2651a2=_0x54d83d['user'][_0x9edd('0x34')]({'plain':!![]});if(!_0x2651a2)throw new Error(_0x9edd('0x5d'));if(_0x2651a2['role']===_0x9edd('0x5e')){var _0x4a72d0=_0x5ca123[_0x9edd('0x34')]({'plain':!![]});var _0x134c9c=_0x9edd('0x35');return db['UserProfileSection'][_0x9edd('0x58')]({'where':{'name':_0x134c9c,'userProfileId':_0x2651a2[_0x9edd('0x5f')]},'raw':!![]})[_0x9edd('0x1c')](function(_0x2015fc){if(_0x2015fc&&_0x2015fc[_0x9edd('0x60')]===0x0){return db['UserProfileResource']['create']({'name':_0x4a72d0[_0x9edd('0x39')],'resourceId':_0x4a72d0['id'],'type':_0x2015fc[_0x9edd('0x39')],'sectionId':_0x2015fc['id']},{})['then'](function(){return _0x5ca123;});}else{return _0x5ca123;}})['catch'](function(_0x52afd7){logger[_0x9edd('0x22')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x52afd7);throw _0x52afd7;});}return _0x5ca123;});}})['then'](respondWithResult(_0x54ecfa,0xc9))[_0x9edd('0x25')](handleError(_0x54ecfa,null));};exports[_0x9edd('0x61')]=function(_0x589348,_0xb9ebeb,_0x11e082){var _0x34dff5;return db['Trunk'][_0x9edd('0x61')](_0x589348['body'],{'raw':!![]})[_0x9edd('0x1c')](function(_0x18d1a0){_0x34dff5=_0x18d1a0;return db['Trunk'][_0x9edd('0x53')]({'raw':!![]});})[_0x9edd('0x1c')](function(_0x5c1746){var _0x2bd6d1=fs[_0x9edd('0x62')](path[_0x9edd('0x63')](config[_0x9edd('0x64')],'server/files/templates/trunk.ejs'),_0x9edd('0x65'));var _0x58330c=fs[_0x9edd('0x62')](path[_0x9edd('0x63')](config[_0x9edd('0x64')],'server/files/templates/registry.ejs'),_0x9edd('0x65'));var _0x286593=ejs[_0x9edd('0x66')](_0x2bd6d1,{'trunks':_0x5c1746||[]});fs[_0x9edd('0x67')](_0x9edd('0x68'),_0x286593);if(_0x34dff5[_0x9edd('0x69')]){var _0x3fa4a9=ejs['render'](_0x58330c,{'trunks':_0x5c1746||[]});fs['writeFileSync'](_0x9edd('0x6a'),_0x3fa4a9);}})[_0x9edd('0x1c')](function(){return respondWithRpcPromise(_0x9edd('0x6b'),_0x9edd('0x61'),{'module':_0x9edd('0x6c')});})['then'](function(){var _0x2e40c8=_0x589348[_0x9edd('0x5e')][_0x9edd('0x34')]({'plain':!![]});if(!_0x2e40c8)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2e40c8[_0x9edd('0x6d')]===_0x9edd('0x5e')){var _0x4b1c12=_0x34dff5[_0x9edd('0x34')]({'plain':!![]});return db[_0x9edd('0x6e')]['find']({'where':{'name':_0x9edd('0x35'),'userProfileId':_0x2e40c8[_0x9edd('0x5f')]},'raw':!![]})['then'](function(_0x3f08ac){if(_0x3f08ac&&_0x3f08ac['autoAssociation']===0x0){return db['UserProfileResource'][_0x9edd('0x61')]({'name':_0x4b1c12[_0x9edd('0x39')],'resourceId':_0x4b1c12['id'],'type':_0x3f08ac[_0x9edd('0x39')],'sectionId':_0x3f08ac['id']},{})['then'](function(){return _0x34dff5;});}else{return _0x34dff5;}})[_0x9edd('0x25')](function(_0x286e47){logger['error'](_0x9edd('0x6f'),_0x286e47);throw _0x286e47;});}return _0x34dff5;})[_0x9edd('0x1c')](respondWithResult(_0xb9ebeb,0xc9))[_0x9edd('0x25')](handleError(_0xb9ebeb,null));};exports[_0x9edd('0x32')]=function(_0x54ac71,_0x5e68db,_0x1129b7){var _0x5bb28c;return db[_0x9edd('0x52')][_0x9edd('0x58')]({'where':{'id':_0x54ac71[_0x9edd('0x56')]['id']}})[_0x9edd('0x1c')](handleEntityNotFound(_0x5e68db,null))[_0x9edd('0x1c')](saveUpdates(_0x54ac71[_0x9edd('0x5a')],null))[_0x9edd('0x1c')](function(_0x5a4d4b){if(_0x5a4d4b){_0x5bb28c=_0x5a4d4b;return db[_0x9edd('0x52')]['findAll']({'raw':!![]});}})[_0x9edd('0x1c')](function(_0x3c4db7){if(_0x3c4db7){var _0x2c7562=fs[_0x9edd('0x62')](path[_0x9edd('0x63')](config[_0x9edd('0x64')],_0x9edd('0x70')),'utf8');var _0x25e3e7=fs[_0x9edd('0x62')](path['join'](config[_0x9edd('0x64')],_0x9edd('0x71')),'utf8');var _0x304e56=ejs[_0x9edd('0x66')](_0x2c7562,{'trunks':_0x3c4db7||[]});fs[_0x9edd('0x67')]('/etc/asterisk/sip_xcally_trunks.conf',_0x304e56);var _0x41cd76=ejs[_0x9edd('0x66')](_0x25e3e7,{'trunks':_0x3c4db7||[]});fs[_0x9edd('0x67')]('/etc/asterisk/sip_xcally_registers.conf',_0x41cd76);return respondWithRpcPromise('Reload','update',{'module':'chan_sip.so'});}return null;})[_0x9edd('0x1c')](function(_0x1a6d3d){if(_0x1a6d3d){return _0x5bb28c;}})[_0x9edd('0x1c')](respondWithResult(_0x5e68db,null))['catch'](handleError(_0x5e68db,null));};exports['destroy']=function(_0x49dc1d,_0x56d794,_0x388252){var _0x20762d;return db[_0x9edd('0x52')][_0x9edd('0x58')]({'where':{'id':_0x49dc1d[_0x9edd('0x56')]['id']}})[_0x9edd('0x1c')](handleEntityNotFound(_0x56d794,null))[_0x9edd('0x1c')](removeEntity(_0x56d794,null))[_0x9edd('0x1c')](function(){return db[_0x9edd('0x52')][_0x9edd('0x53')]({'raw':!![]});})[_0x9edd('0x1c')](function(_0x4cfa99){var _0x367fc6=fs[_0x9edd('0x62')](path[_0x9edd('0x63')](config[_0x9edd('0x64')],_0x9edd('0x70')),_0x9edd('0x65'));var _0x3d4890=fs[_0x9edd('0x62')](path['join'](config['root'],_0x9edd('0x71')),'utf8');var _0x35950b=ejs['render'](_0x367fc6,{'trunks':_0x4cfa99});var _0x21c35f=ejs[_0x9edd('0x66')](_0x3d4890,{'trunks':_0x4cfa99});fs['writeFileSync'](_0x9edd('0x68'),_0x35950b);fs[_0x9edd('0x67')]('/etc/asterisk/sip_xcally_registers.conf',_0x21c35f);return respondWithRpcPromise(_0x9edd('0x6b'),_0x9edd('0x33'),{'module':_0x9edd('0x6c')});})[_0x9edd('0x25')](handleError(_0x56d794,null));};
\ No newline at end of file
index fc8ae26..d96c949 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf1e9=['moment','request-promise','path','rimraf','../../config/environment','./trunk.attributes','exports','Trunk','tools_trunks','../../config/logger','api'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xf1e9,0x153));var _0x9f1e=function(_0x34b817,_0x420ef9){_0x34b817=_0x34b817-0x0;var _0x1aaa29=_0xf1e9[_0x34b817];return _0x1aaa29;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9f1e('0x0'))(_0x9f1e('0x1'));var moment=require(_0x9f1e('0x2'));var BPromise=require('bluebird');var rp=require(_0x9f1e('0x3'));var fs=require('fs');var path=require(_0x9f1e('0x4'));var rimraf=require(_0x9f1e('0x5'));var config=require(_0x9f1e('0x6'));var attributes=require(_0x9f1e('0x7'));module[_0x9f1e('0x8')]=function(_0x573f74,_0x1bd2db){return _0x573f74['define'](_0x9f1e('0x9'),attributes,{'tableName':_0x9f1e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xdd1c=['util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./trunk.attributes','exports','define','Trunk','tools_trunks'];(function(_0x316c42,_0x3391f0){var _0x2b38f7=function(_0x38d2cf){while(--_0x38d2cf){_0x316c42['push'](_0x316c42['shift']());}};_0x2b38f7(++_0x3391f0);}(_0xdd1c,0x1d4));var _0xcdd1=function(_0x447725,_0x49753b){_0x447725=_0x447725-0x0;var _0x399167=_0xdd1c[_0x447725];return _0x399167;};'use strict';var _=require('lodash');var util=require(_0xcdd1('0x0'));var logger=require('../../config/logger')(_0xcdd1('0x1'));var moment=require(_0xcdd1('0x2'));var BPromise=require(_0xcdd1('0x3'));var rp=require(_0xcdd1('0x4'));var fs=require('fs');var path=require(_0xcdd1('0x5'));var rimraf=require(_0xcdd1('0x6'));var config=require(_0xcdd1('0x7'));var attributes=require(_0xcdd1('0x8'));module[_0xcdd1('0x9')]=function(_0x220c14,_0x270415){return _0x220c14[_0xcdd1('0xa')](_0xcdd1('0xb'),attributes,{'tableName':_0xcdd1('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 6e8b90f..6dc4e1b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaf72=['raw','attributes','limit','map','include','model','GetTrunk','stringify','catch','find','where','ShowTrunk','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','debug','request\x20sent','error','code','message','Trunk,\x20%s,\x20%s','info','Trunk','findAll','options'];(function(_0x58acac,_0x27670e){var _0x422a93=function(_0x41d916){while(--_0x41d916){_0x58acac['push'](_0x58acac['shift']());}};_0x422a93(++_0x27670e);}(_0xaf72,0x159));var _0x2af7=function(_0x61d638,_0x375289){_0x61d638=_0x61d638-0x0;var _0x15010e=_0xaf72[_0x61d638];return _0x15010e;};'use strict';var _=require(_0x2af7('0x0'));var util=require('util');var moment=require(_0x2af7('0x1'));var BPromise=require(_0x2af7('0x2'));var rs=require(_0x2af7('0x3'));var fs=require('fs');var Redis=require(_0x2af7('0x4'));var db=require(_0x2af7('0x5'))['db'];var utils=require(_0x2af7('0x6'));var logger=require(_0x2af7('0x7'))(_0x2af7('0x8'));var config=require(_0x2af7('0x9'));var jayson=require(_0x2af7('0xa'));var client=jayson[_0x2af7('0xb')][_0x2af7('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1c38ad,_0x2a6910,_0x34bb05){return new BPromise(function(_0x1d3ca5,_0x2bf440){return client[_0x2af7('0xd')](_0x1c38ad,_0x34bb05)[_0x2af7('0xe')](function(_0x1afdfd){logger['info']('Trunk,\x20%s,\x20%s',_0x2a6910,'request\x20sent');logger[_0x2af7('0xf')]('Trunk,\x20%s,\x20%s,\x20%s',_0x2a6910,_0x2af7('0x10'),JSON['stringify'](_0x1afdfd));if(_0x1afdfd[_0x2af7('0x11')]){if(_0x1afdfd[_0x2af7('0x11')][_0x2af7('0x12')]===0x1f4){logger[_0x2af7('0x11')]('Trunk,\x20%s,\x20%s',_0x2a6910,_0x1afdfd[_0x2af7('0x11')][_0x2af7('0x13')]);return _0x2bf440(_0x1afdfd['error'][_0x2af7('0x13')]);}logger['error'](_0x2af7('0x14'),_0x2a6910,_0x1afdfd[_0x2af7('0x11')][_0x2af7('0x13')]);return _0x1d3ca5(_0x1afdfd[_0x2af7('0x11')]['message']);}else{logger[_0x2af7('0x15')]('Trunk,\x20%s,\x20%s',_0x2a6910,_0x2af7('0x10'));_0x1d3ca5(_0x1afdfd['result']['message']);}})['catch'](function(_0x2a702f){logger['error']('Trunk,\x20%s,\x20%s',_0x2a6910,_0x2a702f);_0x2bf440(_0x2a702f);});});}exports['GetTrunk']=function(_0x2ad1ab){var _0x490a53=this;return new Promise(function(_0x352aa0,_0x6156be){return db[_0x2af7('0x16')][_0x2af7('0x17')]({'raw':_0x2ad1ab[_0x2af7('0x18')]?_0x2ad1ab[_0x2af7('0x18')][_0x2af7('0x19')]===undefined?!![]:![]:!![],'where':_0x2ad1ab['options']?_0x2ad1ab[_0x2af7('0x18')]['where']||null:null,'attributes':_0x2ad1ab['options']?_0x2ad1ab[_0x2af7('0x18')][_0x2af7('0x1a')]||null:null,'limit':_0x2ad1ab[_0x2af7('0x18')]?_0x2ad1ab[_0x2af7('0x18')][_0x2af7('0x1b')]||null:null,'include':_0x2ad1ab['options']?_0x2ad1ab[_0x2af7('0x18')]['include']?_[_0x2af7('0x1c')](_0x2ad1ab[_0x2af7('0x18')]['include'],function(_0xd70bc5){return{'model':db[_0xd70bc5['model']],'as':_0xd70bc5['as'],'attributes':_0xd70bc5[_0x2af7('0x1a')],'include':_0xd70bc5[_0x2af7('0x1d')]?_[_0x2af7('0x1c')](_0xd70bc5[_0x2af7('0x1d')],function(_0x5c507e){return{'model':db[_0x5c507e[_0x2af7('0x1e')]],'as':_0x5c507e['as'],'attributes':_0x5c507e[_0x2af7('0x1a')],'include':_0x5c507e[_0x2af7('0x1d')]?_['map'](_0x5c507e['include'],function(_0x4cedc6){return{'model':db[_0x4cedc6[_0x2af7('0x1e')]],'as':_0x4cedc6['as'],'attributes':_0x4cedc6[_0x2af7('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x2af7('0xe')](function(_0x4f313d){logger[_0x2af7('0x15')](_0x2af7('0x1f'),_0x2ad1ab);logger[_0x2af7('0xf')]('GetTrunk',_0x2ad1ab,JSON[_0x2af7('0x20')](_0x4f313d));_0x352aa0(_0x4f313d);})[_0x2af7('0x21')](function(_0x3f69a3){logger['error'](_0x2af7('0x1f'),_0x3f69a3[_0x2af7('0x13')],_0x2ad1ab);_0x6156be(_0x490a53[_0x2af7('0x11')](0x1f4,_0x3f69a3['message']));});});};exports['ShowTrunk']=function(_0x1f489a){var _0x2e67c8=this;return new Promise(function(_0x47fadf,_0xca50ee){return db[_0x2af7('0x16')][_0x2af7('0x22')]({'raw':_0x1f489a[_0x2af7('0x18')]?_0x1f489a[_0x2af7('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x1f489a[_0x2af7('0x18')]?_0x1f489a[_0x2af7('0x18')][_0x2af7('0x23')]||null:null,'attributes':_0x1f489a[_0x2af7('0x18')]?_0x1f489a[_0x2af7('0x18')]['attributes']||null:null,'include':_0x1f489a[_0x2af7('0x18')]?_0x1f489a['options'][_0x2af7('0x1d')]?_[_0x2af7('0x1c')](_0x1f489a[_0x2af7('0x18')][_0x2af7('0x1d')],function(_0x261651){return{'model':db[_0x261651[_0x2af7('0x1e')]],'as':_0x261651['as'],'attributes':_0x261651[_0x2af7('0x1a')],'include':_0x261651[_0x2af7('0x1d')]?_[_0x2af7('0x1c')](_0x261651[_0x2af7('0x1d')],function(_0x15ad62){return{'model':db[_0x15ad62[_0x2af7('0x1e')]],'as':_0x15ad62['as'],'attributes':_0x15ad62[_0x2af7('0x1a')],'include':_0x15ad62[_0x2af7('0x1d')]?_[_0x2af7('0x1c')](_0x15ad62[_0x2af7('0x1d')],function(_0x1669a8){return{'model':db[_0x1669a8[_0x2af7('0x1e')]],'as':_0x1669a8['as'],'attributes':_0x1669a8[_0x2af7('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x2af7('0xe')](function(_0x531da4){logger[_0x2af7('0x15')](_0x2af7('0x24'),_0x1f489a);logger[_0x2af7('0xf')]('ShowTrunk',_0x1f489a,JSON[_0x2af7('0x20')](_0x531da4));_0x47fadf(_0x531da4);})[_0x2af7('0x21')](function(_0x590230){logger[_0x2af7('0x11')]('ShowTrunk',_0x590230[_0x2af7('0x13')],_0x1f489a);_0xca50ee(_0x2e67c8[_0x2af7('0x11')](0x1f4,_0x590230[_0x2af7('0x13')]));});});};
\ No newline at end of file
+var _0x9496=['model','find','ShowTrunk','lodash','moment','bluebird','randomstring','../../config/logger','rpc','jayson/promise','client','http','then','info','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Trunk,\x20%s,\x20%s','result','catch','GetTrunk','Trunk','options','raw','where','attributes','include','map'];(function(_0x4c0c77,_0x3c609e){var _0x4b20b6=function(_0x4f3e95){while(--_0x4f3e95){_0x4c0c77['push'](_0x4c0c77['shift']());}};_0x4b20b6(++_0x3c609e);}(_0x9496,0x183));var _0x6949=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0x9496[_0x1928c9];return _0x51b5fb;};'use strict';var _=require(_0x6949('0x0'));var util=require('util');var moment=require(_0x6949('0x1'));var BPromise=require(_0x6949('0x2'));var rs=require(_0x6949('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6949('0x4'))(_0x6949('0x5'));var config=require('../../config/environment');var jayson=require(_0x6949('0x6'));var client=jayson[_0x6949('0x7')][_0x6949('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4b2128,_0x116163,_0x618701){return new BPromise(function(_0x3a9063,_0x4454f1){return client['request'](_0x4b2128,_0x618701)[_0x6949('0x9')](function(_0x2de2d9){logger[_0x6949('0xa')]('Trunk,\x20%s,\x20%s',_0x116163,_0x6949('0xb'));logger[_0x6949('0xc')](_0x6949('0xd'),_0x116163,_0x6949('0xb'),JSON[_0x6949('0xe')](_0x2de2d9));if(_0x2de2d9['error']){if(_0x2de2d9[_0x6949('0xf')][_0x6949('0x10')]===0x1f4){logger[_0x6949('0xf')]('Trunk,\x20%s,\x20%s',_0x116163,_0x2de2d9[_0x6949('0xf')][_0x6949('0x11')]);return _0x4454f1(_0x2de2d9[_0x6949('0xf')]['message']);}logger[_0x6949('0xf')](_0x6949('0x12'),_0x116163,_0x2de2d9[_0x6949('0xf')][_0x6949('0x11')]);return _0x3a9063(_0x2de2d9['error'][_0x6949('0x11')]);}else{logger[_0x6949('0xa')]('Trunk,\x20%s,\x20%s',_0x116163,_0x6949('0xb'));_0x3a9063(_0x2de2d9[_0x6949('0x13')]['message']);}})[_0x6949('0x14')](function(_0x3eb449){logger['error'](_0x6949('0x12'),_0x116163,_0x3eb449);_0x4454f1(_0x3eb449);});});}exports[_0x6949('0x15')]=function(_0x17e419){var _0x15f561=this;return new Promise(function(_0x29c9e5,_0x51199f){return db[_0x6949('0x16')]['findAll']({'raw':_0x17e419['options']?_0x17e419[_0x6949('0x17')][_0x6949('0x18')]===undefined?!![]:![]:!![],'where':_0x17e419[_0x6949('0x17')]?_0x17e419[_0x6949('0x17')][_0x6949('0x19')]||null:null,'attributes':_0x17e419[_0x6949('0x17')]?_0x17e419[_0x6949('0x17')][_0x6949('0x1a')]||null:null,'limit':_0x17e419[_0x6949('0x17')]?_0x17e419[_0x6949('0x17')]['limit']||null:null,'include':_0x17e419[_0x6949('0x17')]?_0x17e419['options'][_0x6949('0x1b')]?_[_0x6949('0x1c')](_0x17e419[_0x6949('0x17')][_0x6949('0x1b')],function(_0x1e7588){return{'model':db[_0x1e7588[_0x6949('0x1d')]],'as':_0x1e7588['as'],'attributes':_0x1e7588['attributes'],'include':_0x1e7588['include']?_[_0x6949('0x1c')](_0x1e7588[_0x6949('0x1b')],function(_0x5b660e){return{'model':db[_0x5b660e['model']],'as':_0x5b660e['as'],'attributes':_0x5b660e[_0x6949('0x1a')],'include':_0x5b660e[_0x6949('0x1b')]?_['map'](_0x5b660e['include'],function(_0x98349){return{'model':db[_0x98349['model']],'as':_0x98349['as'],'attributes':_0x98349[_0x6949('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1eaaf4){logger['info'](_0x6949('0x15'),_0x17e419);logger[_0x6949('0xc')](_0x6949('0x15'),_0x17e419,JSON[_0x6949('0xe')](_0x1eaaf4));_0x29c9e5(_0x1eaaf4);})['catch'](function(_0x4cc639){logger[_0x6949('0xf')](_0x6949('0x15'),_0x4cc639['message'],_0x17e419);_0x51199f(_0x15f561['error'](0x1f4,_0x4cc639['message']));});});};exports['ShowTrunk']=function(_0x1452f1){var _0x128a54=this;return new Promise(function(_0x272cbe,_0x172ec4){return db['Trunk'][_0x6949('0x1e')]({'raw':_0x1452f1['options']?_0x1452f1[_0x6949('0x17')][_0x6949('0x18')]===undefined?!![]:![]:!![],'where':_0x1452f1['options']?_0x1452f1['options']['where']||null:null,'attributes':_0x1452f1[_0x6949('0x17')]?_0x1452f1[_0x6949('0x17')][_0x6949('0x1a')]||null:null,'include':_0x1452f1[_0x6949('0x17')]?_0x1452f1[_0x6949('0x17')][_0x6949('0x1b')]?_[_0x6949('0x1c')](_0x1452f1[_0x6949('0x17')]['include'],function(_0x1732ce){return{'model':db[_0x1732ce[_0x6949('0x1d')]],'as':_0x1732ce['as'],'attributes':_0x1732ce['attributes'],'include':_0x1732ce['include']?_[_0x6949('0x1c')](_0x1732ce[_0x6949('0x1b')],function(_0x1979d0){return{'model':db[_0x1979d0[_0x6949('0x1d')]],'as':_0x1979d0['as'],'attributes':_0x1979d0[_0x6949('0x1a')],'include':_0x1979d0[_0x6949('0x1b')]?_[_0x6949('0x1c')](_0x1979d0[_0x6949('0x1b')],function(_0x3d0776){return{'model':db[_0x3d0776[_0x6949('0x1d')]],'as':_0x3d0776['as'],'attributes':_0x3d0776[_0x6949('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x6949('0x9')](function(_0x1c52e3){logger[_0x6949('0xa')](_0x6949('0x1f'),_0x1452f1);logger[_0x6949('0xc')](_0x6949('0x1f'),_0x1452f1,JSON[_0x6949('0xe')](_0x1c52e3));_0x272cbe(_0x1c52e3);})['catch'](function(_0xf679c6){logger[_0x6949('0xf')](_0x6949('0x1f'),_0xf679c6[_0x6949('0x11')],_0x1452f1);_0x172ec4(_0x128a54['error'](0x1f4,_0xf679c6[_0x6949('0x11')]));});});};
\ No newline at end of file
index ffaaa53..bea194e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaaf3=['../../components/auth/service','./user-setting.controller','put','/:id','isAuthenticated','update','exports','Router'];(function(_0x526b71,_0x27c3ca){var _0x18b82c=function(_0x3dd760){while(--_0x3dd760){_0x526b71['push'](_0x526b71['shift']());}};_0x18b82c(++_0x27c3ca);}(_0xaaf3,0xf7));var _0x3aaf=function(_0x44be66,_0x34fbbb){_0x44be66=_0x44be66-0x0;var _0x286f1e=_0xaaf3[_0x44be66];return _0x286f1e;};'use strict';var express=require('express');var router=express[_0x3aaf('0x0')]();var auth=require(_0x3aaf('0x1'));var controller=require(_0x3aaf('0x2'));router[_0x3aaf('0x3')](_0x3aaf('0x4'),auth[_0x3aaf('0x5')](),controller[_0x3aaf('0x6')]);module[_0x3aaf('0x7')]=router;
\ No newline at end of file
+var _0x1db1=['../../components/auth/service','put','isAuthenticated','update','express'];(function(_0x16c044,_0x30b078){var _0x2c7e50=function(_0x49b6b4){while(--_0x49b6b4){_0x16c044['push'](_0x16c044['shift']());}};_0x2c7e50(++_0x30b078);}(_0x1db1,0x112));var _0x11db=function(_0x2ff8e9,_0x3ce3a8){_0x2ff8e9=_0x2ff8e9-0x0;var _0x1967d1=_0x1db1[_0x2ff8e9];return _0x1967d1;};'use strict';var express=require(_0x11db('0x0'));var router=express['Router']();var auth=require(_0x11db('0x1'));var controller=require('./user-setting.controller');router[_0x11db('0x2')]('/:id',auth[_0x11db('0x3')](),controller[_0x11db('0x4')]);module['exports']=router;
\ No newline at end of file
index 3efbf00..bc05b1d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf673=['DATE','UserId','sequelize','error','warning','info','ENUM'];(function(_0xb301d4,_0x27ed18){var _0x3b5bde=function(_0x1fbc5f){while(--_0x1fbc5f){_0xb301d4['push'](_0xb301d4['shift']());}};_0x3b5bde(++_0x27ed18);}(_0xf673,0x1b4));var _0x3f67=function(_0x52c4e9,_0x5412d0){_0x52c4e9=_0x52c4e9-0x0;var _0x252a03=_0xf673[_0x52c4e9];return _0x252a03;};'use strict';var Sequelize=require(_0x3f67('0x0'));const CLIENT_SIDE_LOG_LEVELS=[_0x3f67('0x1'),_0x3f67('0x2'),_0x3f67('0x3'),'debug'];module['exports']={'clientSideLoggingLevel':{'type':Sequelize[_0x3f67('0x4')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0x3f67('0x1'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize['TEXT'],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0x3f67('0x5')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize['INTEGER'],'unique':_0x3f67('0x6')}};
\ No newline at end of file
+var _0xd265=['exports','ENUM','error','BOOLEAN','DATE','INTEGER','UserId','warning','info','debug'];(function(_0x4aa838,_0x4aa14f){var _0x3abff0=function(_0x402d55){while(--_0x402d55){_0x4aa838['push'](_0x4aa838['shift']());}};_0x3abff0(++_0x4aa14f);}(_0xd265,0x1ab));var _0x5d26=function(_0x50284d,_0x2b80b0){_0x50284d=_0x50284d-0x0;var _0x5d29ff=_0xd265[_0x50284d];return _0x5d29ff;};'use strict';var Sequelize=require('sequelize');const CLIENT_SIDE_LOG_LEVELS=['error',_0x5d26('0x0'),_0x5d26('0x1'),_0x5d26('0x2')];module[_0x5d26('0x3')]={'clientSideLoggingLevel':{'type':Sequelize[_0x5d26('0x4')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0x5d26('0x5'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0x5d26('0x6')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize['TEXT'],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0x5d26('0x7')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0x5d26('0x8')],'unique':_0x5d26('0x9')}};
\ No newline at end of file
index a3b1826..fd69651 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x53d5=['catch','lodash','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','socket.io-emitter','./user-setting.socket','register','redis','defaults','status','json','update','then','error','stack','name','send','user','role','admin','params','UserSetting','find','body'];(function(_0x1eaa09,_0x5b0b2e){var _0x44f23a=function(_0x37844e){while(--_0x37844e){_0x1eaa09['push'](_0x1eaa09['shift']());}};_0x44f23a(++_0x5b0b2e);}(_0x53d5,0x1cc));var _0x553d=function(_0x5267db,_0x2f34a2){_0x5267db=_0x5267db-0x0;var _0x53f050=_0x53d5[_0x5267db];return _0x53f050;};'use strict';var _=require(_0x553d('0x0'));var Redis=require(_0x553d('0x1'));var logger=require(_0x553d('0x2'))(_0x553d('0x3'));var config=require(_0x553d('0x4'));var db=require(_0x553d('0x5'))['db'];var socket=require(_0x553d('0x6'))(new Redis(config['redis']));require(_0x553d('0x7'))[_0x553d('0x8')](socket);config[_0x553d('0x9')]=_[_0x553d('0xa')](config[_0x553d('0x9')],{'host':'localhost','port':0x18eb});function respondWithResult(_0x1d5a5e,_0x39ad58){_0x39ad58=_0x39ad58||0xc8;return function(_0x1c38b2){if(_0x1c38b2){return _0x1d5a5e[_0x553d('0xb')](_0x39ad58)[_0x553d('0xc')](_0x1c38b2);}};}function saveUpdates(_0x42b564){return function(_0x37dc2d){if(_0x37dc2d){return _0x37dc2d[_0x553d('0xd')](_0x42b564)[_0x553d('0xe')](function(_0x14eb25){return _0x14eb25;});}return null;};}function handleEntityNotFound(_0x94d3eb){return function(_0x470384){if(!_0x470384){_0x94d3eb['sendStatus'](0x194);}return _0x470384;};}function handleError(_0x540bde,_0x1c1d73){_0x1c1d73=_0x1c1d73||0x1f4;return function(_0x47a19b){logger[_0x553d('0xf')](_0x47a19b[_0x553d('0x10')]);if(_0x47a19b[_0x553d('0x11')]){delete _0x47a19b[_0x553d('0x11')];}_0x540bde[_0x553d('0xb')](_0x1c1d73)[_0x553d('0x12')](_0x47a19b);};}exports[_0x553d('0xd')]=function(_0x1713ed,_0x40e96e){if(_0x1713ed[_0x553d('0x13')][_0x553d('0x14')]!==_0x553d('0x15'))throw new Error('Unauthorized');if(isNaN(Number(_0x1713ed[_0x553d('0x16')]['id'])))throw new Error('Invalid\x20user\x20setting\x20id');return db[_0x553d('0x17')][_0x553d('0x18')]({'where':{'id':_0x1713ed[_0x553d('0x16')]['id']}})['then'](handleEntityNotFound(_0x40e96e,null))['then'](saveUpdates(_0x1713ed[_0x553d('0x19')],null))[_0x553d('0xe')](respondWithResult(_0x40e96e,null))[_0x553d('0x1a')](handleError(_0x40e96e,null));};
\ No newline at end of file
+var _0xbe22=['ioredis','../../config/environment','../../mysqldb','socket.io-emitter','redis','./user-setting.socket','register','defaults','localhost','status','update','then','sendStatus','stack','name','send','user','role','Unauthorized','params','UserSetting','find','body','catch','lodash'];(function(_0x4dcc2d,_0x422839){var _0x1bbd79=function(_0x173341){while(--_0x173341){_0x4dcc2d['push'](_0x4dcc2d['shift']());}};_0x1bbd79(++_0x422839);}(_0xbe22,0x1c1));var _0x2be2=function(_0x575123,_0x26556c){_0x575123=_0x575123-0x0;var _0x466ffe=_0xbe22[_0x575123];return _0x466ffe;};'use strict';var _=require(_0x2be2('0x0'));var Redis=require(_0x2be2('0x1'));var logger=require('../../config/logger')('api');var config=require(_0x2be2('0x2'));var db=require(_0x2be2('0x3'))['db'];var socket=require(_0x2be2('0x4'))(new Redis(config[_0x2be2('0x5')]));require(_0x2be2('0x6'))[_0x2be2('0x7')](socket);config[_0x2be2('0x5')]=_[_0x2be2('0x8')](config[_0x2be2('0x5')],{'host':_0x2be2('0x9'),'port':0x18eb});function respondWithResult(_0x59740c,_0x1fd9fc){_0x1fd9fc=_0x1fd9fc||0xc8;return function(_0x27e1a9){if(_0x27e1a9){return _0x59740c[_0x2be2('0xa')](_0x1fd9fc)['json'](_0x27e1a9);}};}function saveUpdates(_0x338f6f){return function(_0x45a927){if(_0x45a927){return _0x45a927[_0x2be2('0xb')](_0x338f6f)[_0x2be2('0xc')](function(_0x40d8b2){return _0x40d8b2;});}return null;};}function handleEntityNotFound(_0x4cefb1){return function(_0x460ec7){if(!_0x460ec7){_0x4cefb1[_0x2be2('0xd')](0x194);}return _0x460ec7;};}function handleError(_0x4f3ec4,_0x39ddb4){_0x39ddb4=_0x39ddb4||0x1f4;return function(_0x3bc3d9){logger['error'](_0x3bc3d9[_0x2be2('0xe')]);if(_0x3bc3d9[_0x2be2('0xf')]){delete _0x3bc3d9[_0x2be2('0xf')];}_0x4f3ec4['status'](_0x39ddb4)[_0x2be2('0x10')](_0x3bc3d9);};}exports[_0x2be2('0xb')]=function(_0x5d2438,_0x10beca){if(_0x5d2438[_0x2be2('0x11')][_0x2be2('0x12')]!=='admin')throw new Error(_0x2be2('0x13'));if(isNaN(Number(_0x5d2438[_0x2be2('0x14')]['id'])))throw new Error('Invalid\x20user\x20setting\x20id');return db[_0x2be2('0x15')][_0x2be2('0x16')]({'where':{'id':_0x5d2438['params']['id']}})[_0x2be2('0xc')](handleEntityNotFound(_0x10beca,null))['then'](saveUpdates(_0x5d2438[_0x2be2('0x17')],null))[_0x2be2('0xc')](respondWithResult(_0x10beca,null))[_0x2be2('0x18')](handleError(_0x10beca,null));};
\ No newline at end of file
index 2966c2b..0a799f6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x146c=['emit','hasOwnProperty','events','../../mysqldb','setMaxListeners','save','update','remove'];(function(_0x2142bf,_0x57aaae){var _0x511085=function(_0xc7f9c7){while(--_0xc7f9c7){_0x2142bf['push'](_0x2142bf['shift']());}};_0x511085(++_0x57aaae);}(_0x146c,0x182));var _0xc146=function(_0x26b99,_0x306d0c){_0x26b99=_0x26b99-0x0;var _0xd275a5=_0x146c[_0x26b99];return _0xd275a5;};'use strict';var EventEmitter=require(_0xc146('0x0'));var UserSetting=require(_0xc146('0x1'))['db']['UserSetting'];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0xc146('0x2')](0x0);var events={'afterCreate':_0xc146('0x3'),'afterUpdate':_0xc146('0x4'),'afterDestroy':_0xc146('0x5')};function emitEvent(_0x3f99c1){return function(_0x4d62a8,_0x27bdc7,_0x5e5cf4){UserSettingEvents['emit'](_0x3f99c1+':'+_0x4d62a8['id'],_0x4d62a8);UserSettingEvents[_0xc146('0x6')](_0x3f99c1,_0x4d62a8);_0x5e5cf4(null);};}for(var e in events){if(events[_0xc146('0x7')](e)){var event=events[e];UserSetting['hook'](e,emitEvent(event));}}module['exports']=UserSettingEvents;
\ No newline at end of file
+var _0xdbbf=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','UserSetting'];(function(_0x5c87ec,_0x61f877){var _0x4bd9bb=function(_0x51c68e){while(--_0x51c68e){_0x5c87ec['push'](_0x5c87ec['shift']());}};_0x4bd9bb(++_0x61f877);}(_0xdbbf,0xbc));var _0xfdbb=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xdbbf[_0x57b54c];return _0x59cc19;};'use strict';var EventEmitter=require('events');var UserSetting=require(_0xfdbb('0x0'))['db'][_0xfdbb('0x1')];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0xfdbb('0x2')](0x0);var events={'afterCreate':_0xfdbb('0x3'),'afterUpdate':_0xfdbb('0x4'),'afterDestroy':_0xfdbb('0x5')};function emitEvent(_0x199d5a){return function(_0x222b2f,_0x1b33f3,_0x587368){UserSettingEvents['emit'](_0x199d5a+':'+_0x222b2f['id'],_0x222b2f);UserSettingEvents[_0xfdbb('0x6')](_0x199d5a,_0x222b2f);_0x587368(null);};}for(var e in events){if(events[_0xfdbb('0x7')](e)){var event=events[e];UserSetting[_0xfdbb('0x8')](e,emitEvent(event));}}module[_0xfdbb('0x9')]=UserSettingEvents;
\ No newline at end of file
index 68002da..58e0bab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4fad=['exports','UserSetting','user_settings','clientSideLoggingEnabled','clientSideLoggingEnabledSince','./user-setting.attributes'];(function(_0x369bf3,_0x2a4044){var _0x4f861c=function(_0x1750ce){while(--_0x1750ce){_0x369bf3['push'](_0x369bf3['shift']());}};_0x4f861c(++_0x2a4044);}(_0x4fad,0xcb));var _0xd4fa=function(_0x24ee15,_0x123d03){_0x24ee15=_0x24ee15-0x0;var _0xbaa3ed=_0x4fad[_0x24ee15];return _0xbaa3ed;};'use strict';var attributes=require(_0xd4fa('0x0'));module[_0xd4fa('0x1')]=function(_0x398f3c){return _0x398f3c['define'](_0xd4fa('0x2'),attributes,{'tableName':_0xd4fa('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x174360){if(!_0x174360[_0xd4fa('0x4')])_0x174360[_0xd4fa('0x5')]=null;else if(_0x174360[_0xd4fa('0x5')]===null)_0x174360[_0xd4fa('0x5')]=new Date();}}});};
\ No newline at end of file
+var _0xf69c=['clientSideLoggingEnabled','clientSideLoggingEnabledSince','./user-setting.attributes','exports','define','user_settings'];(function(_0x39c585,_0x454a3f){var _0x3ddf40=function(_0x196dcb){while(--_0x196dcb){_0x39c585['push'](_0x39c585['shift']());}};_0x3ddf40(++_0x454a3f);}(_0xf69c,0x1e2));var _0xcf69=function(_0x227b64,_0x1c6f72){_0x227b64=_0x227b64-0x0;var _0xc84cb5=_0xf69c[_0x227b64];return _0xc84cb5;};'use strict';var attributes=require(_0xcf69('0x0'));module[_0xcf69('0x1')]=function(_0x478546){return _0x478546[_0xcf69('0x2')]('UserSetting',attributes,{'tableName':_0xcf69('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x465240){if(!_0x465240[_0xcf69('0x4')])_0x465240['clientSideLoggingEnabledSince']=null;else if(_0x465240[_0xcf69('0x5')]===null)_0x465240[_0xcf69('0x5')]=new Date();}}});};
\ No newline at end of file
index ec4bac6..f05af87 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3e70=['register','length','user-setting:','./user-setting.events','save','remove','update','emit','user-setting:update','user-setting:update:user-','UserId'];(function(_0x4eb5e1,_0x42b61f){var _0x18e425=function(_0x39dd84){while(--_0x39dd84){_0x4eb5e1['push'](_0x4eb5e1['shift']());}};_0x18e425(++_0x42b61f);}(_0x3e70,0x71));var _0x03e7=function(_0x5de1df,_0x118066){_0x5de1df=_0x5de1df-0x0;var _0x214768=_0x3e70[_0x5de1df];return _0x214768;};'use strict';var UserSettingEvents=require(_0x03e7('0x0'));var events=[_0x03e7('0x1'),_0x03e7('0x2'),_0x03e7('0x3')];function createListener(_0x2a14c5,_0x24257c){return function(_0x1dc94b){_0x24257c[_0x03e7('0x4')](_0x2a14c5,_0x1dc94b);if(_0x2a14c5===_0x03e7('0x5')){_0x24257c['emit'](_0x03e7('0x6')+_0x1dc94b[_0x03e7('0x7')],_0x1dc94b);}};}exports[_0x03e7('0x8')]=function(_0x3409e2){for(var _0x54fef3=0x0,_0x39603e=events[_0x03e7('0x9')];_0x54fef3<_0x39603e;_0x54fef3++){var _0x19442d=events[_0x54fef3];var _0x53e6c7=createListener(_0x03e7('0xa')+_0x19442d,_0x3409e2);UserSettingEvents['on'](_0x19442d,_0x53e6c7);}};
\ No newline at end of file
+var _0x8d58=['length','user-setting:','save','remove','update','emit','user-setting:update','user-setting:update:user-','UserId','register'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x8d58,0x12e));var _0x88d5=function(_0x50b9a1,_0x20bab2){_0x50b9a1=_0x50b9a1-0x0;var _0x52f36f=_0x8d58[_0x50b9a1];return _0x52f36f;};'use strict';var UserSettingEvents=require('./user-setting.events');var events=[_0x88d5('0x0'),_0x88d5('0x1'),_0x88d5('0x2')];function createListener(_0xb245b7,_0x48f62a){return function(_0x50c34a){_0x48f62a[_0x88d5('0x3')](_0xb245b7,_0x50c34a);if(_0xb245b7===_0x88d5('0x4')){_0x48f62a['emit'](_0x88d5('0x5')+_0x50c34a[_0x88d5('0x6')],_0x50c34a);}};}exports[_0x88d5('0x7')]=function(_0x5141ca){for(var _0x376651=0x0,_0xd508f9=events[_0x88d5('0x8')];_0x376651<_0xd508f9;_0x376651++){var _0x5eb692=events[_0x376651];var _0x1bc067=createListener(_0x88d5('0x9')+_0x5eb692,_0x5141ca);UserSettingEvents['on'](_0x5eb692,_0x1bc067);}};
\ No newline at end of file
index 4ae238b..9f7bb6a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8a7a=['/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','addFaxAccounts','addMailAccounts','addOpenchannelAccounts','/:id/sms_accounts','addSmsAccounts','addChatWebsites','addSquareProjects','createApiKey','put','update','/:id/password','changePassword','delete','removeQueues','destroy','/:id/mail_interactions','removeMailInteractions','removeFaxInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeWhatsappAccounts','removeApiKey','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./user.controller','get','isAuthenticated','index','/describe','describe','getPresence','/:id','show','getAvatar','/:id/open_tabs','getOpenTabs','/:id/contacts','getContacts','/:id/queues','getQueues','/:id/queues_rt','/:id/groups','getGroups','/:id/recordings','/:id/chat/interactions','getChatInteractions','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','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/square_projects','getSquareProjects','/:id/scheduled_calls','/:id/api_key','getApiKey','post','create','bulkCreate','addQueues','diskStorage','join','root','server/files/images/','%s-%s','originalname','/:id/avatar','single','file','login','/:id/logout','logout','/:id/pause','pause','unpause','addTeams','addChatInteractions','addMailInteractions'];(function(_0x8d2268,_0x1d48c3){var _0x42cd50=function(_0x40a4ab){while(--_0x40a4ab){_0x8d2268['push'](_0x8d2268['shift']());}};_0x42cd50(++_0x1d48c3);}(_0x8a7a,0x17e));var _0xa8a7=function(_0x26a01d,_0x513b02){_0x26a01d=_0x26a01d-0x0;var _0x41fc95=_0x8a7a[_0x26a01d];return _0x41fc95;};'use strict';var multer=require(_0xa8a7('0x0'));var util=require('util');var path=require(_0xa8a7('0x1'));var timeout=require(_0xa8a7('0x2'));var express=require(_0xa8a7('0x3'));var router=express[_0xa8a7('0x4')]();var fs_extra=require(_0xa8a7('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xa8a7('0x6'));var config=require('../../config/environment');var controller=require(_0xa8a7('0x7'));router[_0xa8a7('0x8')]('/',auth[_0xa8a7('0x9')](),controller[_0xa8a7('0xa')]);router[_0xa8a7('0x8')](_0xa8a7('0xb'),auth[_0xa8a7('0x9')](),controller[_0xa8a7('0xc')]);router[_0xa8a7('0x8')]('/whoami',auth[_0xa8a7('0x9')](),controller['whoami']);router['get']('/presence',auth[_0xa8a7('0x9')](),controller[_0xa8a7('0xd')]);router[_0xa8a7('0x8')](_0xa8a7('0xe'),auth[_0xa8a7('0x9')](),controller[_0xa8a7('0xf')]);router[_0xa8a7('0x8')]('/:id/avatar',controller[_0xa8a7('0x10')]);router[_0xa8a7('0x8')](_0xa8a7('0x11'),auth[_0xa8a7('0x9')](),controller[_0xa8a7('0x12')]);router[_0xa8a7('0x8')](_0xa8a7('0x13'),auth['isAuthenticated'](),controller[_0xa8a7('0x14')]);router[_0xa8a7('0x8')](_0xa8a7('0x15'),auth['isAuthenticated'](),controller[_0xa8a7('0x16')]);router[_0xa8a7('0x8')](_0xa8a7('0x17'),auth['isAuthenticated'](),controller['getVoiceQueuesRt']);router[_0xa8a7('0x8')](_0xa8a7('0x18'),auth[_0xa8a7('0x9')](),controller[_0xa8a7('0x19')]);router['get'](_0xa8a7('0x1a'),auth['isAuthenticated'](),controller['getRecordings']);router['get']('/:id/screen_recordings',auth['isAuthenticated'](),controller['getScreenRecordings']);router[_0xa8a7('0x8')](_0xa8a7('0x1b'),auth[_0xa8a7('0x9')](),controller[_0xa8a7('0x1c')]);router[_0xa8a7('0x8')]('/:id/openchannel/interactions',auth['isAuthenticated'](),controller[_0xa8a7('0x1d')]);router[_0xa8a7('0x8')](_0xa8a7('0x1e'),auth[_0xa8a7('0x9')](),controller['getMailInteractions']);router['get'](_0xa8a7('0x1f'),auth[_0xa8a7('0x9')](),controller[_0xa8a7('0x20')]);router['get'](_0xa8a7('0x21'),auth[_0xa8a7('0x9')](),controller[_0xa8a7('0x22')]);router['get'](_0xa8a7('0x23'),auth[_0xa8a7('0x9')](),controller['getWhatsappInteractions']);router['get'](_0xa8a7('0x24'),auth[_0xa8a7('0x9')](),controller[_0xa8a7('0x25')]);router[_0xa8a7('0x8')](_0xa8a7('0x26'),auth[_0xa8a7('0x9')](),controller[_0xa8a7('0x27')]);router['get'](_0xa8a7('0x28'),auth[_0xa8a7('0x9')](),controller[_0xa8a7('0x29')]);router[_0xa8a7('0x8')](_0xa8a7('0x2a'),auth[_0xa8a7('0x9')](),controller[_0xa8a7('0x2b')]);router['get'](_0xa8a7('0x2c'),auth[_0xa8a7('0x9')](),controller[_0xa8a7('0x2d')]);router['get'](_0xa8a7('0x2e'),auth[_0xa8a7('0x9')](),controller[_0xa8a7('0x2f')]);router[_0xa8a7('0x8')](_0xa8a7('0x30'),auth[_0xa8a7('0x9')](),controller[_0xa8a7('0x31')]);router[_0xa8a7('0x8')]('/:id/sms_accounts',auth[_0xa8a7('0x9')](),controller[_0xa8a7('0x32')]);router[_0xa8a7('0x8')](_0xa8a7('0x33'),auth[_0xa8a7('0x9')](),controller[_0xa8a7('0x34')]);router[_0xa8a7('0x8')](_0xa8a7('0x35'),auth[_0xa8a7('0x9')](),controller[_0xa8a7('0x36')]);router[_0xa8a7('0x8')](_0xa8a7('0x37'),auth[_0xa8a7('0x9')](),controller[_0xa8a7('0x38')]);router[_0xa8a7('0x8')](_0xa8a7('0x39'),auth[_0xa8a7('0x9')](),controller['getScheduledCalls']);router[_0xa8a7('0x8')](_0xa8a7('0x3a'),auth[_0xa8a7('0x9')](),controller[_0xa8a7('0x3b')]);router['post'](_0xa8a7('0x13'),auth['isAuthenticated'](),controller['addContacts']);router[_0xa8a7('0x3c')]('/',auth['isAuthenticated'](),controller[_0xa8a7('0x3d')]);router['post']('/create_many',auth[_0xa8a7('0x9')](),controller[_0xa8a7('0x3e')]);router[_0xa8a7('0x3c')](_0xa8a7('0x15'),auth[_0xa8a7('0x9')](),controller[_0xa8a7('0x3f')]);var upload=multer({'storage':multer[_0xa8a7('0x40')]({'destination':function(_0x23474a,_0x23f423,_0x42a468){_0x42a468(null,path[_0xa8a7('0x41')](config[_0xa8a7('0x42')],_0xa8a7('0x43')));},'filename':function(_0x2eb918,_0x2a71b0,_0x94fe5d){_0x94fe5d(null,util['format'](_0xa8a7('0x44'),Date['now'](),_0x2a71b0[_0xa8a7('0x45')]));}})});router[_0xa8a7('0x3c')](_0xa8a7('0x46'),upload[_0xa8a7('0x47')](_0xa8a7('0x48')),controller['addAvatar']);router['post']('/:id/login',auth[_0xa8a7('0x9')](),controller[_0xa8a7('0x49')]);router[_0xa8a7('0x3c')](_0xa8a7('0x4a'),auth['isAuthenticated'](),controller[_0xa8a7('0x4b')]);router[_0xa8a7('0x3c')](_0xa8a7('0x4c'),auth[_0xa8a7('0x9')](),controller[_0xa8a7('0x4d')]);router[_0xa8a7('0x3c')]('/:id/unpause',auth[_0xa8a7('0x9')](),controller[_0xa8a7('0x4e')]);router[_0xa8a7('0x3c')](_0xa8a7('0x24'),auth['isAuthenticated'](),controller[_0xa8a7('0x4f')]);router['post']('/:id/chat_interactions',auth[_0xa8a7('0x9')](),controller[_0xa8a7('0x50')]);router[_0xa8a7('0x3c')]('/:id/mail_interactions',auth[_0xa8a7('0x9')](),controller[_0xa8a7('0x51')]);router[_0xa8a7('0x3c')](_0xa8a7('0x52'),auth['isAuthenticated'](),controller[_0xa8a7('0x53')]);router[_0xa8a7('0x3c')](_0xa8a7('0x54'),auth['isAuthenticated'](),controller[_0xa8a7('0x55')]);router[_0xa8a7('0x3c')](_0xa8a7('0x56'),auth[_0xa8a7('0x9')](),controller[_0xa8a7('0x57')]);router[_0xa8a7('0x3c')](_0xa8a7('0x58'),auth[_0xa8a7('0x9')](),controller[_0xa8a7('0x59')]);router[_0xa8a7('0x3c')](_0xa8a7('0x2c'),auth[_0xa8a7('0x9')](),controller[_0xa8a7('0x5a')]);router[_0xa8a7('0x3c')](_0xa8a7('0x2e'),auth[_0xa8a7('0x9')](),controller[_0xa8a7('0x5b')]);router[_0xa8a7('0x3c')](_0xa8a7('0x30'),auth[_0xa8a7('0x9')](),controller[_0xa8a7('0x5c')]);router['post'](_0xa8a7('0x5d'),auth[_0xa8a7('0x9')](),controller[_0xa8a7('0x5e')]);router[_0xa8a7('0x3c')]('/:id/chat_websites',auth['isAuthenticated'](),controller[_0xa8a7('0x5f')]);router[_0xa8a7('0x3c')](_0xa8a7('0x35'),auth[_0xa8a7('0x9')](),controller['addWhatsappAccounts']);router[_0xa8a7('0x3c')](_0xa8a7('0x37'),auth[_0xa8a7('0x9')](),controller[_0xa8a7('0x60')]);router[_0xa8a7('0x3c')](_0xa8a7('0x3a'),auth[_0xa8a7('0x9')](),controller[_0xa8a7('0x61')]);router[_0xa8a7('0x62')](_0xa8a7('0xe'),auth[_0xa8a7('0x9')](),controller[_0xa8a7('0x63')]);router[_0xa8a7('0x62')](_0xa8a7('0x64'),auth[_0xa8a7('0x9')](),controller[_0xa8a7('0x65')]);router[_0xa8a7('0x66')](_0xa8a7('0x15'),auth[_0xa8a7('0x9')](),controller[_0xa8a7('0x67')]);router[_0xa8a7('0x66')]('/:id/teams',auth['isAuthenticated'](),controller['removeTeams']);router[_0xa8a7('0x66')]('/:id',auth[_0xa8a7('0x9')](),controller[_0xa8a7('0x68')]);router[_0xa8a7('0x66')]('/:id/chat_interactions',auth[_0xa8a7('0x9')](),controller['removeChatInteractions']);router[_0xa8a7('0x66')](_0xa8a7('0x69'),auth[_0xa8a7('0x9')](),controller[_0xa8a7('0x6a')]);router['delete']('/:id/fax_interactions',auth[_0xa8a7('0x9')](),controller[_0xa8a7('0x6b')]);router['delete'](_0xa8a7('0x54'),auth[_0xa8a7('0x9')](),controller['removeSmsInteractions']);router[_0xa8a7('0x66')](_0xa8a7('0x56'),auth[_0xa8a7('0x9')](),controller[_0xa8a7('0x6c')]);router[_0xa8a7('0x66')]('/:id/whatsapp_interactions',auth[_0xa8a7('0x9')](),controller[_0xa8a7('0x6d')]);router[_0xa8a7('0x66')](_0xa8a7('0x2c'),auth[_0xa8a7('0x9')](),controller[_0xa8a7('0x6e')]);router[_0xa8a7('0x66')]('/:id/mail_accounts',auth['isAuthenticated'](),controller[_0xa8a7('0x6f')]);router[_0xa8a7('0x66')](_0xa8a7('0x30'),auth[_0xa8a7('0x9')](),controller[_0xa8a7('0x70')]);router[_0xa8a7('0x66')](_0xa8a7('0x5d'),auth[_0xa8a7('0x9')](),controller['removeSmsAccounts']);router[_0xa8a7('0x66')](_0xa8a7('0x33'),auth[_0xa8a7('0x9')](),controller['removeChatWebsites']);router[_0xa8a7('0x66')](_0xa8a7('0x35'),auth['isAuthenticated'](),controller[_0xa8a7('0x71')]);router[_0xa8a7('0x66')](_0xa8a7('0x37'),auth[_0xa8a7('0x9')](),controller['removeSquareProjects']);router[_0xa8a7('0x66')]('/:id/api_key',auth[_0xa8a7('0x9')](),controller[_0xa8a7('0x72')]);module[_0xa8a7('0x73')]=router;
\ No newline at end of file
+var _0x7e51=['/:id/login','login','/:id/logout','logout','/:id/pause','pause','/:id/unpause','unpause','addTeams','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','addFaxAccounts','addMailAccounts','/:id/openchannel_accounts','addOpenchannelAccounts','/:id/chat_websites','addWhatsappAccounts','createApiKey','update','put','/:id/password','changePassword','delete','removeQueues','/:id/teams','removeTeams','destroy','removeChatInteractions','removeMailInteractions','/:id/fax_interactions','/:id/sms_interactions','removeSmsInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeWhatsappAccounts','removeSquareProjects','exports','multer','util','path','Router','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/whoami','whoami','/presence','getPresence','/:id','getAvatar','getOpenTabs','getContacts','/:id/queues','getQueues','/:id/groups','/:id/recordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/lists','getLists','/:id/agents','/:id/prefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/square_projects','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','getApiKey','post','/:id/contacts','/create_many','bulkCreate','addQueues','diskStorage','root','server/files/images/','%s-%s','now','originalname','/:id/avatar','single','file','addAvatar'];(function(_0x598c44,_0x189ab7){var _0x2a2d1d=function(_0x517828){while(--_0x517828){_0x598c44['push'](_0x598c44['shift']());}};_0x2a2d1d(++_0x189ab7);}(_0x7e51,0x117));var _0x17e5=function(_0x2ee694,_0x292724){_0x2ee694=_0x2ee694-0x0;var _0x4cfee7=_0x7e51[_0x2ee694];return _0x4cfee7;};'use strict';var multer=require(_0x17e5('0x0'));var util=require(_0x17e5('0x1'));var path=require(_0x17e5('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x17e5('0x3')]();var fs_extra=require(_0x17e5('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x17e5('0x5'));var config=require(_0x17e5('0x6'));var controller=require('./user.controller');router['get']('/',auth[_0x17e5('0x7')](),controller[_0x17e5('0x8')]);router[_0x17e5('0x9')]('/describe',auth[_0x17e5('0x7')](),controller[_0x17e5('0xa')]);router['get'](_0x17e5('0xb'),auth[_0x17e5('0x7')](),controller[_0x17e5('0xc')]);router[_0x17e5('0x9')](_0x17e5('0xd'),auth[_0x17e5('0x7')](),controller[_0x17e5('0xe')]);router['get'](_0x17e5('0xf'),auth[_0x17e5('0x7')](),controller['show']);router[_0x17e5('0x9')]('/:id/avatar',controller[_0x17e5('0x10')]);router['get']('/:id/open_tabs',auth[_0x17e5('0x7')](),controller[_0x17e5('0x11')]);router[_0x17e5('0x9')]('/:id/contacts',auth[_0x17e5('0x7')](),controller[_0x17e5('0x12')]);router[_0x17e5('0x9')](_0x17e5('0x13'),auth[_0x17e5('0x7')](),controller[_0x17e5('0x14')]);router['get']('/:id/queues_rt',auth['isAuthenticated'](),controller['getVoiceQueuesRt']);router[_0x17e5('0x9')](_0x17e5('0x15'),auth[_0x17e5('0x7')](),controller['getGroups']);router[_0x17e5('0x9')](_0x17e5('0x16'),auth['isAuthenticated'](),controller['getRecordings']);router[_0x17e5('0x9')]('/:id/screen_recordings',auth['isAuthenticated'](),controller[_0x17e5('0x17')]);router[_0x17e5('0x9')](_0x17e5('0x18'),auth[_0x17e5('0x7')](),controller[_0x17e5('0x19')]);router[_0x17e5('0x9')](_0x17e5('0x1a'),auth[_0x17e5('0x7')](),controller[_0x17e5('0x1b')]);router[_0x17e5('0x9')](_0x17e5('0x1c'),auth[_0x17e5('0x7')](),controller[_0x17e5('0x1d')]);router['get'](_0x17e5('0x1e'),auth[_0x17e5('0x7')](),controller[_0x17e5('0x1f')]);router['get'](_0x17e5('0x20'),auth[_0x17e5('0x7')](),controller[_0x17e5('0x21')]);router[_0x17e5('0x9')](_0x17e5('0x22'),auth[_0x17e5('0x7')](),controller[_0x17e5('0x23')]);router[_0x17e5('0x9')]('/:id/teams',auth[_0x17e5('0x7')](),controller['getTeams']);router[_0x17e5('0x9')](_0x17e5('0x24'),auth[_0x17e5('0x7')](),controller[_0x17e5('0x25')]);router[_0x17e5('0x9')](_0x17e5('0x26'),auth[_0x17e5('0x7')](),controller['getAgents']);router[_0x17e5('0x9')](_0x17e5('0x27'),auth[_0x17e5('0x7')](),controller['getVoicePrefixes']);router[_0x17e5('0x9')](_0x17e5('0x28'),auth[_0x17e5('0x7')](),controller[_0x17e5('0x29')]);router[_0x17e5('0x9')](_0x17e5('0x2a'),auth[_0x17e5('0x7')](),controller[_0x17e5('0x2b')]);router[_0x17e5('0x9')]('/:id/openchannel_accounts',auth['isAuthenticated'](),controller[_0x17e5('0x2c')]);router[_0x17e5('0x9')](_0x17e5('0x2d'),auth[_0x17e5('0x7')](),controller[_0x17e5('0x2e')]);router[_0x17e5('0x9')]('/:id/chat_websites',auth[_0x17e5('0x7')](),controller['getChatWebsites']);router['get'](_0x17e5('0x2f'),auth[_0x17e5('0x7')](),controller[_0x17e5('0x30')]);router[_0x17e5('0x9')](_0x17e5('0x31'),auth[_0x17e5('0x7')](),controller['getSquareProjects']);router[_0x17e5('0x9')](_0x17e5('0x32'),auth[_0x17e5('0x7')](),controller[_0x17e5('0x33')]);router[_0x17e5('0x9')](_0x17e5('0x34'),auth[_0x17e5('0x7')](),controller[_0x17e5('0x35')]);router[_0x17e5('0x36')](_0x17e5('0x37'),auth[_0x17e5('0x7')](),controller['addContacts']);router['post']('/',auth[_0x17e5('0x7')](),controller['create']);router[_0x17e5('0x36')](_0x17e5('0x38'),auth[_0x17e5('0x7')](),controller[_0x17e5('0x39')]);router[_0x17e5('0x36')](_0x17e5('0x13'),auth[_0x17e5('0x7')](),controller[_0x17e5('0x3a')]);var upload=multer({'storage':multer[_0x17e5('0x3b')]({'destination':function(_0x109afa,_0x2558cc,_0x45b390){_0x45b390(null,path['join'](config[_0x17e5('0x3c')],_0x17e5('0x3d')));},'filename':function(_0x414803,_0x3304f3,_0x463167){_0x463167(null,util['format'](_0x17e5('0x3e'),Date[_0x17e5('0x3f')](),_0x3304f3[_0x17e5('0x40')]));}})});router[_0x17e5('0x36')](_0x17e5('0x41'),upload[_0x17e5('0x42')](_0x17e5('0x43')),controller[_0x17e5('0x44')]);router[_0x17e5('0x36')](_0x17e5('0x45'),auth[_0x17e5('0x7')](),controller[_0x17e5('0x46')]);router[_0x17e5('0x36')](_0x17e5('0x47'),auth[_0x17e5('0x7')](),controller[_0x17e5('0x48')]);router[_0x17e5('0x36')](_0x17e5('0x49'),auth[_0x17e5('0x7')](),controller[_0x17e5('0x4a')]);router[_0x17e5('0x36')](_0x17e5('0x4b'),auth[_0x17e5('0x7')](),controller[_0x17e5('0x4c')]);router[_0x17e5('0x36')]('/:id/teams',auth[_0x17e5('0x7')](),controller[_0x17e5('0x4d')]);router[_0x17e5('0x36')](_0x17e5('0x4e'),auth['isAuthenticated'](),controller[_0x17e5('0x4f')]);router[_0x17e5('0x36')](_0x17e5('0x50'),auth['isAuthenticated'](),controller['addMailInteractions']);router[_0x17e5('0x36')]('/:id/fax_interactions',auth[_0x17e5('0x7')](),controller['addFaxInteractions']);router['post']('/:id/sms_interactions',auth['isAuthenticated'](),controller['addSmsInteractions']);router['post'](_0x17e5('0x51'),auth[_0x17e5('0x7')](),controller[_0x17e5('0x52')]);router[_0x17e5('0x36')](_0x17e5('0x53'),auth[_0x17e5('0x7')](),controller[_0x17e5('0x54')]);router[_0x17e5('0x36')](_0x17e5('0x28'),auth['isAuthenticated'](),controller[_0x17e5('0x55')]);router['post'](_0x17e5('0x2a'),auth[_0x17e5('0x7')](),controller[_0x17e5('0x56')]);router[_0x17e5('0x36')](_0x17e5('0x57'),auth[_0x17e5('0x7')](),controller[_0x17e5('0x58')]);router[_0x17e5('0x36')]('/:id/sms_accounts',auth[_0x17e5('0x7')](),controller['addSmsAccounts']);router['post'](_0x17e5('0x59'),auth[_0x17e5('0x7')](),controller['addChatWebsites']);router[_0x17e5('0x36')](_0x17e5('0x2f'),auth[_0x17e5('0x7')](),controller[_0x17e5('0x5a')]);router[_0x17e5('0x36')](_0x17e5('0x31'),auth[_0x17e5('0x7')](),controller['addSquareProjects']);router[_0x17e5('0x36')](_0x17e5('0x34'),auth[_0x17e5('0x7')](),controller[_0x17e5('0x5b')]);router['put'](_0x17e5('0xf'),auth[_0x17e5('0x7')](),controller[_0x17e5('0x5c')]);router[_0x17e5('0x5d')](_0x17e5('0x5e'),auth[_0x17e5('0x7')](),controller[_0x17e5('0x5f')]);router[_0x17e5('0x60')](_0x17e5('0x13'),auth[_0x17e5('0x7')](),controller[_0x17e5('0x61')]);router[_0x17e5('0x60')](_0x17e5('0x62'),auth['isAuthenticated'](),controller[_0x17e5('0x63')]);router['delete'](_0x17e5('0xf'),auth[_0x17e5('0x7')](),controller[_0x17e5('0x64')]);router[_0x17e5('0x60')](_0x17e5('0x4e'),auth['isAuthenticated'](),controller[_0x17e5('0x65')]);router[_0x17e5('0x60')](_0x17e5('0x50'),auth['isAuthenticated'](),controller[_0x17e5('0x66')]);router[_0x17e5('0x60')](_0x17e5('0x67'),auth[_0x17e5('0x7')](),controller['removeFaxInteractions']);router['delete'](_0x17e5('0x68'),auth[_0x17e5('0x7')](),controller[_0x17e5('0x69')]);router[_0x17e5('0x60')]('/:id/openchannel_interactions',auth[_0x17e5('0x7')](),controller[_0x17e5('0x6a')]);router[_0x17e5('0x60')](_0x17e5('0x53'),auth['isAuthenticated'](),controller[_0x17e5('0x6b')]);router[_0x17e5('0x60')](_0x17e5('0x28'),auth['isAuthenticated'](),controller[_0x17e5('0x6c')]);router[_0x17e5('0x60')](_0x17e5('0x2a'),auth[_0x17e5('0x7')](),controller[_0x17e5('0x6d')]);router[_0x17e5('0x60')](_0x17e5('0x57'),auth[_0x17e5('0x7')](),controller[_0x17e5('0x6e')]);router['delete'](_0x17e5('0x2d'),auth[_0x17e5('0x7')](),controller[_0x17e5('0x6f')]);router[_0x17e5('0x60')](_0x17e5('0x59'),auth[_0x17e5('0x7')](),controller[_0x17e5('0x70')]);router[_0x17e5('0x60')](_0x17e5('0x2f'),auth[_0x17e5('0x7')](),controller[_0x17e5('0x71')]);router[_0x17e5('0x60')]('/:id/square_projects',auth[_0x17e5('0x7')](),controller[_0x17e5('0x72')]);router[_0x17e5('0x60')](_0x17e5('0x34'),auth[_0x17e5('0x7')](),controller['removeApiKey']);module[_0x17e5('0x73')]=router;
\ No newline at end of file
index d00dc58..59f3217 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x34e8=['isArray','wss','encryption','force_avp','icesupport','dtlsenable','dtlsverify','dtlssetup','dtlscertfile','rtcp_mux','avpf','/etc/pki/tls/certs/motion.crt','dtlsprivatekey','permissions','map','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blockedAt','sequelize','moment','util','lodash','STRING','name','setDataValue','defaultuser','fullname','callerid','format','\x22%s\x22\x20<%s>','getDataValue','internal','email','toLowerCase','ENUM','admin','agent','telephone','local','INTEGER','accountcode','BOOLEAN','DEFAULT\x20PAUSE','DATE','dynamic','friend','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','shortinfo','inband','yes','nonat','update','outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','never','\x22\x22\x20<>','always','accept','refuse','originate','uac','uas','certificate','passive','actpass','update,nonat','TEXT','showWebBar','get'];(function(_0x58fc16,_0x38e7b4){var _0x2923e1=function(_0x4f1103){while(--_0x4f1103){_0x58fc16['push'](_0x58fc16['shift']());}};_0x2923e1(++_0x38e7b4);}(_0x34e8,0x12c));var _0x834e=function(_0x3fbd60,_0x4df971){_0x3fbd60=_0x3fbd60-0x0;var _0x24e5f2=_0x34e8[_0x3fbd60];return _0x24e5f2;};'use strict';var Sequelize=require(_0x834e('0x0'));var moment=require(_0x834e('0x1'));var util=require(_0x834e('0x2'));var _=require(_0x834e('0x3'));module['exports']={'name':{'type':Sequelize[_0x834e('0x4')],'allowNull':![],'unique':_0x834e('0x5'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x472111){this[_0x834e('0x6')](_0x834e('0x5'),_0x472111);this[_0x834e('0x6')](_0x834e('0x7'),_0x472111);},'comment':'The\x20name\x20of\x20the\x20user'},'fullname':{'type':Sequelize[_0x834e('0x4')],'allowNull':![],'set':function(_0x52056d){this[_0x834e('0x6')](_0x834e('0x8'),_0x52056d);this[_0x834e('0x6')](_0x834e('0x9'),util[_0x834e('0xa')](_0x834e('0xb'),_0x52056d,this[_0x834e('0xc')](_0x834e('0xd'))));}},'alias':{'type':Sequelize[_0x834e('0x4')]},'email':{'type':Sequelize[_0x834e('0x4')],'allowNull':![],'unique':_0x834e('0xe'),'validate':{'isEmail':!![]},'set':function(_0x36e124){if(_0x36e124){this[_0x834e('0x6')](_0x834e('0xe'),_0x36e124[_0x834e('0xf')]());}}},'role':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x11'),'user',_0x834e('0x12'),_0x834e('0x13')),'allowNull':![]},'password':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x834e('0x4')],'defaultValue':_0x834e('0x14')},'internal':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':![],'unique':_0x834e('0xd'),'set':function(_0x50e860){this[_0x834e('0x6')](_0x834e('0xd'),_0x50e860);this['setDataValue'](_0x834e('0x16'),_0x50e860);this['setDataValue'](_0x834e('0x9'),util[_0x834e('0xa')]('\x22%s\x22\x20<%s>',this[_0x834e('0xc')](_0x834e('0x8')),_0x50e860));}},'salt':{'type':Sequelize[_0x834e('0x4')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0x834e('0x4')]},'address':{'type':Sequelize[_0x834e('0x4')]},'zipcode':{'type':Sequelize[_0x834e('0x4')]},'userpic':{'type':Sequelize[_0x834e('0x4')]},'city':{'type':Sequelize[_0x834e('0x4')]},'country':{'type':Sequelize[_0x834e('0x4')]},'online':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize['DATE']},'voicePause':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'smsPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'pauseType':{'type':Sequelize['STRING'],'defaultValue':_0x834e('0x18')},'lastPauseAt':{'type':Sequelize[_0x834e('0x19')]},'chatCapacity':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x834e('0x17')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x834e('0x15')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x834e('0x1a')},'ipaddr':{'type':Sequelize['STRING'],'allowNull':!![]},'port':{'type':Sequelize[_0x834e('0x15')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'regserver':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'type':{'type':Sequelize['ENUM']('friend','user','peer'),'allowNull':!![],'defaultValue':_0x834e('0x1b')},'context':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![],'defaultValue':_0x834e('0x1c')},'callingpres':{'type':Sequelize['ENUM'](_0x834e('0x1d'),_0x834e('0x1e'),_0x834e('0x1f'),_0x834e('0x20'),_0x834e('0x21'),_0x834e('0x22'),_0x834e('0x23'),_0x834e('0x24')),'allowNull':!![]},'deny':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'permit':{'type':Sequelize['STRING'],'allowNull':!![]},'secret':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'md5secret':{'type':Sequelize['STRING'],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'transport':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![],'defaultValue':_0x834e('0x25'),'set':function(_0x2b3418){this[_0x834e('0x6')](_0x834e('0x26'),_0x2b3418?_0x2b3418[_0x834e('0x27')](','):null);},'get':function(){return this[_0x834e('0xc')](_0x834e('0x26'))?this[_0x834e('0xc')]('transport')[_0x834e('0x28')](','):null;},'comment':_0x834e('0x29')},'dtmfmode':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2a'),'info',_0x834e('0x2b'),_0x834e('0x2c'),'auto'),'allowNull':!![],'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize['ENUM'](_0x834e('0x2d'),'no',_0x834e('0x2e'),_0x834e('0x2f'),_0x834e('0x30')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING'],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'nat':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x834e('0x31'),'set':function(_0x6a3ac){this['setDataValue'](_0x834e('0x32'),_0x6a3ac?_0x6a3ac[_0x834e('0x27')](','):null);},'get':function(){return this['getDataValue']('nat')?this[_0x834e('0xc')](_0x834e('0x32'))[_0x834e('0x28')](','):null;},'comment':_0x834e('0x33')},'callgroup':{'type':Sequelize[_0x834e('0x4')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0x834e('0x4')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x834e('0x4')]},'disallow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x834e('0x34')},'allow':{'type':Sequelize[_0x834e('0x4')],'allowNull':![],'defaultValue':_0x834e('0x35'),'set':function(_0x3c59af){this[_0x834e('0x6')]('allow',_0x3c59af?_0x3c59af[_0x834e('0x27')](';'):_0x834e('0x35'));},'get':function(){return this[_0x834e('0xc')]('allow')?this[_0x834e('0xc')](_0x834e('0x36'))['split'](';'):null;},'comment':_0x834e('0x37')},'autoframing':{'type':Sequelize['ENUM'](_0x834e('0x2d'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![],'set':function(_0x4a18bb){this['setDataValue'](_0x834e('0x38'),_0x4a18bb?_0x4a18bb[_0x834e('0x27')](','):null);},'get':function(){return this[_0x834e('0xc')](_0x834e('0x38'))?this[_0x834e('0xc')](_0x834e('0x38'))[_0x834e('0x28')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0x834e('0x10')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x834e('0x10')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x834e('0x10')]('yes','no',_0x834e('0x39')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x834e('0x10')]('yes','no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![],'defaultValue':_0x834e('0x3a')},'amaflags':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![],'defaultValue':_0x834e('0x2d')},'busylevel':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM'](_0x834e('0x2d'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'template':{'type':Sequelize['STRING'],'allowNull':!![]},'videosupport':{'type':Sequelize['ENUM'](_0x834e('0x2d'),'no',_0x834e('0x3b')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x3c'),_0x834e('0x3d'),_0x834e('0x3e')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x3f'),_0x834e('0x40')),'allowNull':!![],'defaultValue':_0x834e('0x40')},'t38pt_usertpsource':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'qualify':{'type':Sequelize['ENUM'](_0x834e('0x2d'),'no'),'allowNull':!![],'defaultValue':_0x834e('0x2d')},'keepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x834e('0x10')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x834e('0x10')]('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x834e('0x10')]('yes','no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x834e('0x10')]('yes','no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize['ENUM'](_0x834e('0x2d'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x834e('0x10')]('yes','no','fingerprint',_0x834e('0x41')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x834e('0x10')]('active',_0x834e('0x42'),_0x834e('0x43')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING'],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x834e('0x10')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize['STRING'],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'canreinvite':{'type':Sequelize['ENUM'](_0x834e('0x2d'),'no',_0x834e('0x2e'),_0x834e('0x2f'),_0x834e('0x44')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x834e('0x4')]},'resetPasswordExpires':{'type':Sequelize[_0x834e('0x19')]},'passwordResetAt':{'type':Sequelize[_0x834e('0x19')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x834e('0x45')]},'showWebBar':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0,'set':function(_0x1e4310){this[_0x834e('0x6')](_0x834e('0x46'),_0x1e4310);var _0x1659c8=this[_0x834e('0x47')]({'plain':!![]});switch(_0x1e4310){case 0x0:case 0x1:var _0x17b8e3=_0x1659c8[_0x834e('0x26')]?_[_0x834e('0x48')](_0x1659c8[_0x834e('0x26')])?_0x1659c8[_0x834e('0x26')][_0x834e('0x27')]():_0x1659c8[_0x834e('0x26')]:'udp';if(_0x17b8e3===_0x834e('0x49')){_0x17b8e3=_0x834e('0x25');}this[_0x834e('0x6')](_0x834e('0x26'),_0x17b8e3);this['setDataValue'](_0x834e('0x4a'),'no');this['setDataValue']('avpf',null);this[_0x834e('0x6')](_0x834e('0x4b'),null);this[_0x834e('0x6')](_0x834e('0x4c'),null);this[_0x834e('0x6')](_0x834e('0x4d'),null);this[_0x834e('0x6')](_0x834e('0x4e'),null);this['setDataValue'](_0x834e('0x4f'),null);this['setDataValue'](_0x834e('0x50'),null);this[_0x834e('0x6')]('dtlsprivatekey',null);this['setDataValue'](_0x834e('0x51'),'no');break;case 0x2:this[_0x834e('0x6')](_0x834e('0x26'),_0x834e('0x49'));this[_0x834e('0x6')]('encryption',_0x834e('0x2d'));this[_0x834e('0x6')](_0x834e('0x52'),_0x834e('0x2d'));this[_0x834e('0x6')](_0x834e('0x4b'),_0x834e('0x2d'));this[_0x834e('0x6')](_0x834e('0x4c'),_0x834e('0x2d'));this['setDataValue'](_0x834e('0x4d'),_0x834e('0x2d'));this[_0x834e('0x6')](_0x834e('0x4e'),'no');this['setDataValue'](_0x834e('0x4f'),'actpass');this['setDataValue']('dtlscertfile',_0x1659c8[_0x834e('0x50')]||_0x834e('0x53'));this['setDataValue'](_0x834e('0x54'),_0x1659c8[_0x834e('0x54')]||'/etc/pki/tls/private/motion.key');this[_0x834e('0x6')](_0x834e('0x51'),'yes');break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0x346be5){this[_0x834e('0x6')](_0x834e('0x55'),_0x346be5?_0x346be5[_0x834e('0x27')](','):[]);},'get':function(){return this[_0x834e('0xc')]('permissions')?_[_0x834e('0x56')](this['getDataValue'](_0x834e('0x55'))[_0x834e('0x28')](','),function(_0x2c758c){return parseInt(_0x2c758c,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize['STRING']},'phoneBarNoReplyNumber':{'type':Sequelize[_0x834e('0x4')]},'phoneBarBusyNumber':{'type':Sequelize[_0x834e('0x4')]},'phoneBarUnconditional':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x834e('0x17')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x834e('0x4')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x834e('0x17')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x834e('0x4')]},'phoneBarEnableJaws':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['VIRTUAL'],'get':function(){return this['getDataValue']('phoneBarEnableScreenRecordingByAgent')?this[_0x834e('0xc')](_0x834e('0x57')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'interface':{'type':Sequelize['STRING'],'defaultValue':null},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![],'set':function(_0x18ddac){if(typeof _0x18ddac===_0x834e('0x58')){var _0x5acf5c=_0x18ddac==='1'?!![]:_0x18ddac==='0'?![]:_0x18ddac===_0x834e('0x59')?!![]:_0x18ddac===_0x834e('0x5a')?![]:![];this[_0x834e('0x6')]('screenrecording',_0x5acf5c);}else{this[_0x834e('0x6')](_0x834e('0x5b'),_0x18ddac);}}},'blocked':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![],'set':function(_0x443633){this[_0x834e('0x6')]('blocked',_0x443633);if(_0x443633===!![]){this['setDataValue'](_0x834e('0x5c'),moment());this[_0x834e('0x6')]('loginAttempts',0x0);}else{this[_0x834e('0x6')]('blockedAt',null);}}},'blockedAt':{'type':Sequelize[_0x834e('0x19')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x834e('0x15')](0x5)['UNSIGNED'],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x834e('0x17')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0}};
\ No newline at end of file
+var _0xe706=['admin','user','agent','telephone','local','accountcode','BOOLEAN','DATE','INTEGER','dynamic','friend','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_FAILED_SCREEN','udp','transport','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','yes','nonat','update','outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','insecure','\x22\x22\x20<>','always','accept','uac','uas','certificate','active','passive','actpass','update,nonat','showWebBar','get','force_avp','icesupport','dtlsenable','dtlsverify','dtlssetup','dtlscertfile','dtlsprivatekey','wss','avpf','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','rtcp_mux','TEXT','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','blocked','blockedAt','UNSIGNED','sequelize','moment','util','exports','STRING','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','fullname','callerid','format','\x22%s\x22\x20<%s>','getDataValue','internal','email','ENUM'];(function(_0x230509,_0x5327de){var _0x5b3042=function(_0x1d3b98){while(--_0x1d3b98){_0x230509['push'](_0x230509['shift']());}};_0x5b3042(++_0x5327de);}(_0xe706,0xa3));var _0x6e70=function(_0x5eb4bb,_0xbd4598){_0x5eb4bb=_0x5eb4bb-0x0;var _0x12d25b=_0xe706[_0x5eb4bb];return _0x12d25b;};'use strict';var Sequelize=require(_0x6e70('0x0'));var moment=require(_0x6e70('0x1'));var util=require(_0x6e70('0x2'));var _=require('lodash');module[_0x6e70('0x3')]={'name':{'type':Sequelize[_0x6e70('0x4')],'allowNull':![],'unique':_0x6e70('0x5'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x7dfbc3){this[_0x6e70('0x6')](_0x6e70('0x5'),_0x7dfbc3);this[_0x6e70('0x6')](_0x6e70('0x7'),_0x7dfbc3);},'comment':_0x6e70('0x8')},'fullname':{'type':Sequelize[_0x6e70('0x4')],'allowNull':![],'set':function(_0x36357b){this[_0x6e70('0x6')](_0x6e70('0x9'),_0x36357b);this[_0x6e70('0x6')](_0x6e70('0xa'),util[_0x6e70('0xb')](_0x6e70('0xc'),_0x36357b,this[_0x6e70('0xd')](_0x6e70('0xe'))));}},'alias':{'type':Sequelize[_0x6e70('0x4')]},'email':{'type':Sequelize[_0x6e70('0x4')],'allowNull':![],'unique':_0x6e70('0xf'),'validate':{'isEmail':!![]},'set':function(_0x37b3e0){if(_0x37b3e0){this[_0x6e70('0x6')]('email',_0x37b3e0['toLowerCase']());}}},'role':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x11'),_0x6e70('0x12'),_0x6e70('0x13'),_0x6e70('0x14')),'allowNull':![]},'password':{'type':Sequelize[_0x6e70('0x4')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x6e70('0x4')],'defaultValue':_0x6e70('0x15')},'internal':{'type':Sequelize['INTEGER'](0xb),'allowNull':![],'unique':'internal','set':function(_0x48bc72){this[_0x6e70('0x6')]('internal',_0x48bc72);this['setDataValue'](_0x6e70('0x16'),_0x48bc72);this[_0x6e70('0x6')]('callerid',util[_0x6e70('0xb')]('\x22%s\x22\x20<%s>',this[_0x6e70('0xd')](_0x6e70('0x9')),_0x48bc72));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0x6e70('0x4')]},'address':{'type':Sequelize['STRING']},'zipcode':{'type':Sequelize[_0x6e70('0x4')]},'userpic':{'type':Sequelize[_0x6e70('0x4')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize['STRING']},'online':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x6e70('0x18')]},'voicePause':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x6e70('0x4')],'defaultValue':'DEFAULT\x20PAUSE'},'lastPauseAt':{'type':Sequelize[_0x6e70('0x18')]},'chatCapacity':{'type':Sequelize[_0x6e70('0x19')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x6e70('0x19')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x6e70('0x19')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x6e70('0x19')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x6e70('0x19')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x6e70('0x19')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'description':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x6e70('0x1a')},'ipaddr':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'port':{'type':Sequelize[_0x6e70('0x19')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize['STRING'],'allowNull':!![]},'regserver':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x1b'),'user',_0x6e70('0x1c')),'allowNull':!![],'defaultValue':_0x6e70('0x1b')},'context':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![],'defaultValue':_0x6e70('0x1d')},'callingpres':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x1e'),_0x6e70('0x1f'),_0x6e70('0x20'),_0x6e70('0x21'),_0x6e70('0x22'),'PROHIB_PASSED_SCREEN',_0x6e70('0x23'),'PROHIB'),'allowNull':!![]},'deny':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'permit':{'type':Sequelize['STRING'],'allowNull':!![]},'secret':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'transport':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x6e70('0x24'),'set':function(_0x42b094){this['setDataValue'](_0x6e70('0x25'),_0x42b094?_0x42b094[_0x6e70('0x26')](','):null);},'get':function(){return this['getDataValue'](_0x6e70('0x25'))?this[_0x6e70('0xd')](_0x6e70('0x25'))[_0x6e70('0x27')](','):null;},'comment':_0x6e70('0x28')},'dtmfmode':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x29'),_0x6e70('0x2a'),_0x6e70('0x2b'),_0x6e70('0x2c'),'auto'),'allowNull':!![],'defaultValue':_0x6e70('0x29')},'directmedia':{'type':Sequelize['ENUM'](_0x6e70('0x2d'),'no',_0x6e70('0x2e'),_0x6e70('0x2f'),_0x6e70('0x30')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'nat':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![],'defaultValue':_0x6e70('0x31'),'set':function(_0x2a5444){this[_0x6e70('0x6')](_0x6e70('0x32'),_0x2a5444?_0x2a5444['join'](','):null);},'get':function(){return this['getDataValue']('nat')?this[_0x6e70('0xd')](_0x6e70('0x32'))[_0x6e70('0x27')](','):null;},'comment':_0x6e70('0x33')},'callgroup':{'type':Sequelize[_0x6e70('0x4')]},'namedcallgroup':{'type':Sequelize[_0x6e70('0x4')]},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize[_0x6e70('0x4')]},'language':{'type':Sequelize[_0x6e70('0x4')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x6e70('0x4')]},'disallow':{'type':Sequelize[_0x6e70('0x4')],'allowNull':![],'defaultValue':_0x6e70('0x34')},'allow':{'type':Sequelize[_0x6e70('0x4')],'allowNull':![],'defaultValue':_0x6e70('0x35'),'set':function(_0x16fc7d){this['setDataValue'](_0x6e70('0x36'),_0x16fc7d?_0x16fc7d[_0x6e70('0x26')](';'):_0x6e70('0x35'));},'get':function(){return this[_0x6e70('0xd')](_0x6e70('0x36'))?this[_0x6e70('0xd')](_0x6e70('0x36'))['split'](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]'},'autoframing':{'type':Sequelize['ENUM'](_0x6e70('0x2d'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![],'set':function(_0x83847b){this[_0x6e70('0x6')](_0x6e70('0x37'),_0x83847b?_0x83847b['join'](','):null);},'get':function(){return this[_0x6e70('0xd')](_0x6e70('0x37'))?this[_0x6e70('0xd')]('insecure')['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0x6e70('0x10')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no','never'),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x6e70('0x10')]('yes','no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'callerid':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x6e70('0x38')},'amaflags':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no'),'allowNull':!![],'defaultValue':_0x6e70('0x2d')},'busylevel':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x6e70('0x10')]('yes','no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'template':{'type':Sequelize['STRING'],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x6e70('0x10')]('yes','no',_0x6e70('0x39')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x3a'),'refuse','originate'),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x3b'),_0x6e70('0x3c')),'allowNull':!![],'defaultValue':_0x6e70('0x3c')},'t38pt_usertpsource':{'type':Sequelize['STRING'],'allowNull':!![]},'regexten':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no'),'allowNull':!![],'defaultValue':'yes'},'keepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize['ENUM'](_0x6e70('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize['ENUM'](_0x6e70('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x6e70('0x10')]('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM'](_0x6e70('0x2d'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no','fingerprint',_0x6e70('0x3d')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x3e'),_0x6e70('0x3f'),_0x6e70('0x40')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x6e70('0x10')]('yes','no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no','nonat',_0x6e70('0x2f'),_0x6e70('0x41')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x6e70('0x4')]},'resetPasswordExpires':{'type':Sequelize[_0x6e70('0x18')]},'passwordResetAt':{'type':Sequelize[_0x6e70('0x18')],'defaultValue':null},'previousPasswords':{'type':Sequelize['TEXT']},'showWebBar':{'type':Sequelize['INTEGER'],'defaultValue':0x0,'set':function(_0x2f9be4){this[_0x6e70('0x6')](_0x6e70('0x42'),_0x2f9be4);var _0x41a861=this[_0x6e70('0x43')]({'plain':!![]});switch(_0x2f9be4){case 0x0:case 0x1:var _0x739946=_0x41a861[_0x6e70('0x25')]?_['isArray'](_0x41a861['transport'])?_0x41a861[_0x6e70('0x25')][_0x6e70('0x26')]():_0x41a861[_0x6e70('0x25')]:_0x6e70('0x24');if(_0x739946==='wss'){_0x739946='udp';}this[_0x6e70('0x6')](_0x6e70('0x25'),_0x739946);this['setDataValue']('encryption','no');this[_0x6e70('0x6')]('avpf',null);this[_0x6e70('0x6')](_0x6e70('0x44'),null);this[_0x6e70('0x6')](_0x6e70('0x45'),null);this[_0x6e70('0x6')](_0x6e70('0x46'),null);this[_0x6e70('0x6')](_0x6e70('0x47'),null);this['setDataValue'](_0x6e70('0x48'),null);this[_0x6e70('0x6')](_0x6e70('0x49'),null);this[_0x6e70('0x6')](_0x6e70('0x4a'),null);this['setDataValue']('rtcp_mux','no');break;case 0x2:this['setDataValue'](_0x6e70('0x25'),_0x6e70('0x4b'));this[_0x6e70('0x6')]('encryption','yes');this[_0x6e70('0x6')](_0x6e70('0x4c'),_0x6e70('0x2d'));this[_0x6e70('0x6')](_0x6e70('0x44'),_0x6e70('0x2d'));this['setDataValue'](_0x6e70('0x45'),_0x6e70('0x2d'));this[_0x6e70('0x6')](_0x6e70('0x46'),'yes');this[_0x6e70('0x6')]('dtlsverify','no');this['setDataValue'](_0x6e70('0x48'),_0x6e70('0x40'));this[_0x6e70('0x6')](_0x6e70('0x49'),_0x41a861[_0x6e70('0x49')]||_0x6e70('0x4d'));this['setDataValue'](_0x6e70('0x4a'),_0x41a861[_0x6e70('0x4a')]||_0x6e70('0x4e'));this[_0x6e70('0x6')](_0x6e70('0x4f'),_0x6e70('0x2d'));break;default:}}},'permissions':{'type':Sequelize[_0x6e70('0x50')],'set':function(_0xd9b4a9){this[_0x6e70('0x6')](_0x6e70('0x51'),_0xd9b4a9?_0xd9b4a9['join'](','):[]);},'get':function(){return this[_0x6e70('0xd')](_0x6e70('0x51'))?_[_0x6e70('0x52')](this['getDataValue']('permissions')[_0x6e70('0x27')](','),function(_0x18ecf0){return parseInt(_0x18ecf0,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x6e70('0x4')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x6e70('0x4')]},'phoneBarBusyNumber':{'type':Sequelize[_0x6e70('0x4')]},'phoneBarUnconditional':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x6e70('0x19')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x6e70('0x4')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x6e70('0x19')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x6e70('0x4')]},'phoneBarEnableJaws':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x6e70('0x53')],'get':function(){return this[_0x6e70('0xd')](_0x6e70('0x54'))?this[_0x6e70('0xd')]('phoneBarEnableScreenRecordingByAgent'):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'hotdesk':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'interface':{'type':Sequelize[_0x6e70('0x4')],'defaultValue':null},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize['STRING'],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'screenrecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x576069){if(typeof _0x576069===_0x6e70('0x55')){var _0x21e4c2=_0x576069==='1'?!![]:_0x576069==='0'?![]:_0x576069===_0x6e70('0x56')?!![]:_0x576069==='false'?![]:![];this['setDataValue']('screenrecording',_0x21e4c2);}else{this[_0x6e70('0x6')]('screenrecording',_0x576069);}}},'blocked':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![],'set':function(_0x34237d){this[_0x6e70('0x6')](_0x6e70('0x57'),_0x34237d);if(_0x34237d===!![]){this[_0x6e70('0x6')](_0x6e70('0x58'),moment());this[_0x6e70('0x6')]('loginAttempts',0x0);}else{this[_0x6e70('0x6')](_0x6e70('0x58'),null);}}},'blockedAt':{'type':Sequelize[_0x6e70('0x18')],'defaultValue':null},'loginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x6e70('0x19')](0x5)[_0x6e70('0x59')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize[_0x6e70('0x19')],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize[_0x6e70('0x19')],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0x6e70('0x19')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize[_0x6e70('0x19')],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize[_0x6e70('0x19')],'defaultValue':0x0}};
\ No newline at end of file
index e2061d8..121f57b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9d3d=['$and','$gt','$gte','$lt','$lte','$ne','$eq','$between','$notBetween','$in','$notIn','$like','$notLike','$notILike','$overlap','$contains','$contained','$any','CmHopper','firstName','lastName','phone','Contact','getApiKey','retrieveApiKey','No\x20API\x20access\x20key\x20found!','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','createApiKey','iat','nonce','token','removeApiKey','apiKeyNonce','apiKeyIat','API\x20key\x20not\x20available','whoami','getUserSetting','getPresence','resolve','teams','queues','inbound','lower','col','asc','desc','substring','uniqBy','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','result','offline','idle','ringing','voiceStatus','charAt','toUpperCase','slice','select','field','ui.','InteractionId','user_has_','_interactions','ui.UserId\x20=\x20?','toString','OpenTabs','moment','bluebird','path','lodash','squel','jayson/promise','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','./user.socket','defaults','localhost','client','request','then','info','User,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','update','destroy','role','admin','Users','user','Agents','agent','Telephones','filter','ignore','map','value','includes','find','UserProfileResource','name','send','User','fieldName','key','password','getOptions','query','includeAll','include','userSetting','true','UserSetting','attributes','push','findAll','rows','length','chat','dataValues','sms','fax','mail','openchannel','whatsapp','all','show','params','model','differenceBy','keys','rawAttributes','salt','filters','intersection','fields','merge','options','openTabs','body','describe','addContacts','ids','omit','Setting','securePassword','internal','min_internal','isNil','sequelize','select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)','QueryTypes','SELECT','from','mailbox','VoiceMail','email','permissions','103','113','110','104','105','108','109','create','Unauthorized','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator','checkUserLimits','settingsEnabled','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','bulkCreate','some','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator','each','telephone','UserProfileSection','isEmpty','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','channel','online','loginInPause','interface','isValidChannel','Unknown\x20channel','add','capitalize','toLowerCase','penalty','spread','QueueId','Queue:save','VoiceQueue','get','voice','format','SIP/%s','voicePause','UserVoiceQueueRt','upsert','removeQueues','Queues','isArray','emit','Queue:remove','file','getAvatar','join','userpic','download','existsSync','server/files/images/','root','CHAT','createdAt','OpenchannelOpenTabs','OPENCHANNEL','MailOpenTabs','MAIL','SMS','WHATSAPP','concat','getContacts','CmContact','order','sort','where','pick','CmList','Tag','Tags','color','tag','nolimit','findOne','Queue','Unknown\x20role','getVoiceQueuesRt','getGroups','ChatGroup','hasOwnProperty','getRecordings','UserId','VoiceRecording','getScreenRecordings','ScreenRecording','getChatInteractions','ChatInteraction','OpenchannelInteraction','getOpenchannelInteractions','MailInteraction','SmsInteraction','getSmsInteractions','getFaxInteractions','getWhatsappInteractions','login','mobile','LOCAL/%s@from-sip/n','intrf','user:%s','user:forcelogout','headers','x-forwarded-for','connection','remoteAddress','socket','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','getVoiceQueues','UserVoiceQueue.penalty','MemberReport','YYYY-MM-DD\x20HH:mm:ss','forEach','LOGIN','device','PAUSE','LOGININPAUSE','logout','QueuePause','pause','updateAttributes','type','DEFAULT\x20PAUSE','unpause','faxPause','openchannelPause','smsPause','whatsapppause','lastPauseAt','manual','Pause','getTeams','Team','addTeams','Voice','getChatQueues','getMailQueues','Mail','getSmsQueues','setDataValue','Sms','getWhatsappQueues','Whatsapp','getFaxQueues','Fax','getOpenchannelQueues','flatten','transaction','addAgent','getDataValue','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','removeTeams','Chat','Openchannel','removeAgent','getLists','values','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','user_has_chat_interactions:save','removeChatInteractions','user_has_chat_interactions:remove','addMailInteractions','user_has_mail_interactions:save','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','user_has_sms_interactions:save','user_has_sms_interactions:remove','addOpenchannelInteractions','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','user_has_whatsapp_interactions:save','removeWhatsappInteractions','getVoicePrefixes','VoicePrefix','getFaxAccounts','FaxAccount','removeFaxAccounts','getMailAccounts','MailAccount','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','OpenchannelAccount','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','SmsAccount','addSmsAccounts','removeSmsAccounts','ChatWebsite','getChatWebsites','addChatWebsites','removeChatWebsites','getWhatsappAccounts','WhatsappAccount','addWhatsappAccounts','removeWhatsappAccounts','getSquareProjects','addSquareProjects','removeSquareProjects','getScheduledCalls'];(function(_0xc55d64,_0x133f2d){var _0x4194f6=function(_0x4a38c9){while(--_0x4a38c9){_0xc55d64['push'](_0xc55d64['shift']());}};_0x4194f6(++_0x133f2d);}(_0x9d3d,0x1d9));var _0xd9d3=function(_0xad6b8d,_0x34cefd){_0xad6b8d=_0xad6b8d-0x0;var _0x5cbf28=_0x9d3d[_0xad6b8d];return _0x5cbf28;};'use strict';var moment=require(_0xd9d3('0x0'));var BPromise=require(_0xd9d3('0x1'));var util=require('util');var path=require(_0xd9d3('0x2'));var fs=require('fs');var _=require(_0xd9d3('0x3'));var squel=require(_0xd9d3('0x4'));var jayson=require(_0xd9d3('0x5'));var Redis=require(_0xd9d3('0x6'));var authService=require(_0xd9d3('0x7'));var qs=require('../../components/parsers/qs');var logger=require(_0xd9d3('0x8'))(_0xd9d3('0x9'));var utils=require(_0xd9d3('0xa'));var config=require(_0xd9d3('0xb'));var licenseUtil=require(_0xd9d3('0xc'));var db=require('../../mysqldb')['db'];var socket=require('socket.io-emitter')(new Redis(config[_0xd9d3('0xd')]));require(_0xd9d3('0xe'))['register'](socket);config[_0xd9d3('0xd')]=_[_0xd9d3('0xf')](config[_0xd9d3('0xd')],{'host':_0xd9d3('0x10'),'port':0x18eb});var client=jayson[_0xd9d3('0x11')]['http']({'port':0x232a});var values;function respondWithRpcPromise(_0x5256f7,_0x418075,_0x107b94,_0x3ee2d1){return new BPromise(function(_0x6ad533,_0x2e91c0){var _0x18b7e8=_0x3ee2d1||client;return _0x18b7e8[_0xd9d3('0x12')](_0x5256f7,_0x107b94)[_0xd9d3('0x13')](function(_0x303917){logger[_0xd9d3('0x14')](_0xd9d3('0x15'),_0x418075,_0xd9d3('0x16'));logger[_0xd9d3('0x17')]('User,\x20%s,\x20%s,\x20%s',_0x418075,_0xd9d3('0x16'),JSON[_0xd9d3('0x18')](_0x303917));if(_0x303917['error']){if(_0x303917[_0xd9d3('0x19')][_0xd9d3('0x1a')]===0x1f4){logger[_0xd9d3('0x19')](_0xd9d3('0x15'),_0x418075,_0x303917[_0xd9d3('0x19')][_0xd9d3('0x1b')]);return _0x2e91c0(_0x303917['error'][_0xd9d3('0x1b')]);}logger['error'](_0xd9d3('0x15'),_0x418075,_0x303917[_0xd9d3('0x19')]['message']);return _0x6ad533(_0x303917[_0xd9d3('0x19')]['message']);}else{logger[_0xd9d3('0x14')](_0xd9d3('0x15'),_0x418075,'request\x20sent');_0x6ad533(_0x303917['result'][_0xd9d3('0x1b')]);}})[_0xd9d3('0x1c')](function(_0x191978){logger[_0xd9d3('0x19')]('User,\x20%s,\x20%s',_0x418075,_0x191978);_0x2e91c0(_0x191978);});});}function respondWithStatusCode(_0x599073,_0x400b2b){_0x400b2b=_0x400b2b||0xcc;return function(_0x4671c0){if(_0x4671c0){return _0x599073[_0xd9d3('0x1d')](_0x400b2b);}return _0x599073['status'](_0x400b2b)[_0xd9d3('0x1e')]();};}function respondWithResult(_0x15ab9c,_0x86cdcd){_0x86cdcd=_0x86cdcd||0xc8;return function(_0x24f3f2){if(_0x24f3f2){return _0x15ab9c[_0xd9d3('0x1f')](_0x86cdcd)['json'](_0x24f3f2);}};}function respondWithFilteredResult(_0x46f93a,_0x344781){return function(_0x42eebc){if(_0x42eebc){var _0x5916c5=typeof _0x344781[_0xd9d3('0x20')]===_0xd9d3('0x21')&&typeof _0x344781[_0xd9d3('0x22')]==='undefined';var _0x179701=_0x42eebc[_0xd9d3('0x23')];var _0x5ced40=_0x5916c5?0x0:_0x344781[_0xd9d3('0x20')];var _0xcfe2f6=_0x5916c5?_0x42eebc['count']:_0x344781[_0xd9d3('0x20')]+_0x344781[_0xd9d3('0x22')];var _0x5382f1;if(_0xcfe2f6>=_0x179701){_0xcfe2f6=_0x179701;_0x5382f1=0xc8;}else{_0x5382f1=0xce;}_0x46f93a['status'](_0x5382f1);return _0x46f93a[_0xd9d3('0x24')](_0xd9d3('0x25'),_0x5ced40+'-'+_0xcfe2f6+'/'+_0x179701)[_0xd9d3('0x26')](_0x42eebc);}return null;};}function saveUpdates(_0x1ac536){return function(_0x2f559f){if(_0x2f559f){return _0x2f559f[_0xd9d3('0x27')](_0x1ac536)[_0xd9d3('0x13')](function(_0x50c0b1){return _0x50c0b1;});}return null;};}function removeEntity(_0x1c2510){return function(_0x303818){if(_0x303818){return _0x303818[_0xd9d3('0x28')]()[_0xd9d3('0x13')](function(){var _0x117029=_0x303818['get']({'plain':!![]});if(_0x117029[_0xd9d3('0x29')]===_0xd9d3('0x2a'))return;var _0x12c27c=[{'name':_0xd9d3('0x2b'),'value':_0xd9d3('0x2c'),'ignore':!![]},{'name':_0xd9d3('0x2d'),'value':_0xd9d3('0x2e'),'ignore':![]},{'name':_0xd9d3('0x2f'),'value':'telephone','ignore':![]}];var _0x5dee89=_(_0x12c27c)[_0xd9d3('0x30')](_0xd9d3('0x31'))[_0xd9d3('0x32')](_0xd9d3('0x33'))['value']();if(_[_0xd9d3('0x34')](_0x5dee89,_0x117029[_0xd9d3('0x29')])){return;}var _0x28f713=_[_0xd9d3('0x35')](_0x12c27c,['value',_0x117029['role']])['name'];return db[_0xd9d3('0x36')][_0xd9d3('0x28')]({'where':{'type':_0x28f713,'resourceId':_0x117029['id']}})[_0xd9d3('0x13')](function(){return _0x303818;});})[_0xd9d3('0x13')](function(){_0x1c2510['status'](0xcc)[_0xd9d3('0x1e')]();});}};}function handleEntityNotFound(_0xa9866b){return function(_0x4d3768){if(!_0x4d3768){_0xa9866b[_0xd9d3('0x1d')](0x194);}return _0x4d3768;};}function handleError(_0x368153,_0x37fb51){_0x37fb51=_0x37fb51||0x1f4;return function(_0x1405bd){logger[_0xd9d3('0x19')](_0x1405bd['stack']);if(_0x1405bd[_0xd9d3('0x37')]){delete _0x1405bd[_0xd9d3('0x37')];}_0x368153[_0xd9d3('0x1f')](_0x37fb51)[_0xd9d3('0x38')](_0x1405bd);};}exports['index']=function(_0x4304df,_0x287981){var _0x1f1b66={},_0xe18a3b={'count':0x0,'rows':[]};var _0x3db0f8=_(db[_0xd9d3('0x39')]['rawAttributes'])[_0xd9d3('0x32')](function(_0x4fa619){return{'name':_0x4fa619[_0xd9d3('0x3a')],'type':_0x4fa619['type'][_0xd9d3('0x3b')]};})['filter'](function(_0x15b332){return!_['includes']([_0xd9d3('0x3c'),'salt'],_0x15b332['name']);})[_0xd9d3('0x33')]();_0x1f1b66=qs[_0xd9d3('0x3d')](_0x3db0f8,_0x4304df);var _0xb6b610={'where':_0x1f1b66['where']};return db[_0xd9d3('0x39')]['count'](_0xb6b610)['then'](function(_0x11dc9d){_0xe18a3b[_0xd9d3('0x23')]=_0x11dc9d;if(_0x4304df[_0xd9d3('0x3e')][_0xd9d3('0x3f')]){_0x1f1b66[_0xd9d3('0x40')]=[{'all':!![]}];}if(_0x4304df['query'][_0xd9d3('0x41')]===_0xd9d3('0x42')){_0x1f1b66[_0xd9d3('0x40')]=[{'model':db[_0xd9d3('0x43')],'as':_0xd9d3('0x41')}];}if(!_[_0xd9d3('0x34')](_0x1f1b66[_0xd9d3('0x44')],'id')){_0x1f1b66[_0xd9d3('0x44')][_0xd9d3('0x45')]('id');}return db[_0xd9d3('0x39')][_0xd9d3('0x46')](_0x1f1b66);})[_0xd9d3('0x13')](function(_0x45d56d){_0xe18a3b[_0xd9d3('0x47')]=_0x45d56d;if(_0x4304df['query']['openTabs']===_0xd9d3('0x42')){var _0x286181=[];for(var _0x3a792a=0x0;_0x3a792a<_0xe18a3b['rows'][_0xd9d3('0x48')];_0x3a792a++){_0x286181[_0xd9d3('0x45')](get_open_tabs(_0xd9d3('0x49'),_0xe18a3b[_0xd9d3('0x47')][_0x3a792a][_0xd9d3('0x4a')]));_0x286181[_0xd9d3('0x45')](get_open_tabs(_0xd9d3('0x4b'),_0xe18a3b[_0xd9d3('0x47')][_0x3a792a][_0xd9d3('0x4a')]));_0x286181['push'](get_open_tabs(_0xd9d3('0x4c'),_0xe18a3b[_0xd9d3('0x47')][_0x3a792a][_0xd9d3('0x4a')]));_0x286181[_0xd9d3('0x45')](get_open_tabs(_0xd9d3('0x4d'),_0xe18a3b[_0xd9d3('0x47')][_0x3a792a][_0xd9d3('0x4a')]));_0x286181['push'](get_open_tabs(_0xd9d3('0x4e'),_0xe18a3b['rows'][_0x3a792a]['dataValues']));_0x286181[_0xd9d3('0x45')](get_open_tabs(_0xd9d3('0x4f'),_0xe18a3b[_0xd9d3('0x47')][_0x3a792a]['dataValues']));}return BPromise[_0xd9d3('0x50')](_0x286181)[_0xd9d3('0x13')](function(){return _0xe18a3b;});}else{return _0xe18a3b;}})[_0xd9d3('0x13')](respondWithFilteredResult(_0x287981,_0x1f1b66))[_0xd9d3('0x1c')](handleError(_0x287981,null));};exports[_0xd9d3('0x51')]=function(_0x10daa4,_0x19f800){var _0x4c78eb={'raw':![],'where':{'id':_0x10daa4[_0xd9d3('0x52')]['id']}},_0x12ce72={};_0x12ce72[_0xd9d3('0x53')]=_[_0xd9d3('0x54')](_[_0xd9d3('0x55')](db[_0xd9d3('0x39')][_0xd9d3('0x56')]),[_0xd9d3('0x3c'),_0xd9d3('0x57')]);_0x12ce72[_0xd9d3('0x3e')]=_[_0xd9d3('0x55')](_0x10daa4[_0xd9d3('0x3e')]);_0x12ce72[_0xd9d3('0x58')]=_[_0xd9d3('0x59')](_0x12ce72[_0xd9d3('0x53')],_0x12ce72[_0xd9d3('0x3e')]);_0x4c78eb['attributes']=_[_0xd9d3('0x59')](_0x12ce72[_0xd9d3('0x53')],qs[_0xd9d3('0x5a')](_0x10daa4[_0xd9d3('0x3e')]['fields']));_0x4c78eb[_0xd9d3('0x44')]=_0x4c78eb[_0xd9d3('0x44')][_0xd9d3('0x48')]?_0x4c78eb[_0xd9d3('0x44')]:_0x12ce72[_0xd9d3('0x53')];if(_0x10daa4[_0xd9d3('0x3e')][_0xd9d3('0x3f')]){_0x4c78eb['include']=[{'all':!![]}];}if(_0x10daa4['query'][_0xd9d3('0x41')]===_0xd9d3('0x42')){_0x4c78eb['include']=[{'model':db[_0xd9d3('0x43')],'as':_0xd9d3('0x41')}];}_0x4c78eb=_[_0xd9d3('0x5b')]({},_0x4c78eb,_0x10daa4[_0xd9d3('0x5c')]);if(!_[_0xd9d3('0x34')](_0x4c78eb['attributes'],'id')){_0x4c78eb[_0xd9d3('0x44')][_0xd9d3('0x45')]('id');}return db[_0xd9d3('0x39')][_0xd9d3('0x35')](_0x4c78eb)[_0xd9d3('0x13')](handleEntityNotFound(_0x19f800,null))[_0xd9d3('0x13')](function(_0x3ce2ac){var _0x961ba4=[];values=_0x3ce2ac;if(_0x10daa4[_0xd9d3('0x3e')][_0xd9d3('0x5d')]===_0xd9d3('0x42')){_0x961ba4['push'](get_open_tabs('chat',_0x3ce2ac[_0xd9d3('0x4a')]));_0x961ba4[_0xd9d3('0x45')](get_open_tabs(_0xd9d3('0x4b'),_0x3ce2ac[_0xd9d3('0x4a')]));_0x961ba4[_0xd9d3('0x45')](get_open_tabs(_0xd9d3('0x4e'),_0x3ce2ac['dataValues']));_0x961ba4[_0xd9d3('0x45')](get_open_tabs(_0xd9d3('0x4f'),_0x3ce2ac[_0xd9d3('0x4a')]));_0x961ba4['push'](get_open_tabs(_0xd9d3('0x4c'),_0x3ce2ac[_0xd9d3('0x4a')]));_0x961ba4[_0xd9d3('0x45')](get_open_tabs('mail',_0x3ce2ac[_0xd9d3('0x4a')]));return BPromise['all'](_0x961ba4);}else{return values;}})[_0xd9d3('0x13')](function(){return values;})[_0xd9d3('0x13')](respondWithResult(_0x19f800,null))[_0xd9d3('0x1c')](handleError(_0x19f800,null));};exports['update']=function(_0x55bba7,_0x5675b1){if(_0x55bba7[_0xd9d3('0x5e')]['id']){delete _0x55bba7[_0xd9d3('0x5e')]['id'];}delete _0x55bba7[_0xd9d3('0x5e')][_0xd9d3('0x29')];return db[_0xd9d3('0x39')]['find']({'where':{'id':_0x55bba7[_0xd9d3('0x52')]['id']}})[_0xd9d3('0x13')](handleEntityNotFound(_0x5675b1,null))[_0xd9d3('0x13')](saveUpdates(_0x55bba7[_0xd9d3('0x5e')],null))['then'](respondWithResult(_0x5675b1,null))[_0xd9d3('0x1c')](handleError(_0x5675b1,null));};exports[_0xd9d3('0x5f')]=function(_0x5ad59c,_0x553e92){return db[_0xd9d3('0x39')][_0xd9d3('0x5f')]()[_0xd9d3('0x13')](respondWithResult(_0x553e92,null))[_0xd9d3('0x1c')](handleError(_0x553e92,null));};exports[_0xd9d3('0x60')]=function(_0x8a85f3,_0x424d09){return db[_0xd9d3('0x39')][_0xd9d3('0x35')]({'where':{'id':_0x8a85f3[_0xd9d3('0x52')]['id']}})[_0xd9d3('0x13')](handleEntityNotFound(_0x424d09,null))[_0xd9d3('0x13')](function(_0x5cd5de){if(_0x5cd5de){return _0x5cd5de[_0xd9d3('0x60')](_0x8a85f3[_0xd9d3('0x5e')][_0xd9d3('0x61')],_[_0xd9d3('0x62')](_0x8a85f3[_0xd9d3('0x5e')],[_0xd9d3('0x61'),'id'])||{});}})['then'](respondWithResult(_0x424d09,null))[_0xd9d3('0x1c')](handleError(_0x424d09,null));};function validateUser(_0x32da00){return new BPromise(function(_0x1f05d5,_0x451810){if(_0x32da00['internal'])return _0x1f05d5(_0x32da00);return db[_0xd9d3('0x63')]['findById'](0x1)[_0xd9d3('0x13')](function(_0x454ae9){if(_0x454ae9[_0xd9d3('0x64')])authService['validatePasswordPattern'](_0x32da00[_0xd9d3('0x3c')]);db[_0xd9d3('0x39')]['max'](_0xd9d3('0x65'))[_0xd9d3('0x13')](function(_0x3c6b16){if(_['isNil'](_0x3c6b16)){_0x32da00['internal']=_0x454ae9[_0xd9d3('0x66')]||0x1;return;}if(_[_0xd9d3('0x67')](_0x454ae9['min_internal'])||_0x454ae9[_0xd9d3('0x66')]===_0x3c6b16){_0x32da00[_0xd9d3('0x65')]=_0x3c6b16+0x1;return;}if(_0x454ae9[_0xd9d3('0x66')]>_0x3c6b16){_0x32da00[_0xd9d3('0x65')]=_0x454ae9[_0xd9d3('0x66')];return;}return db[_0xd9d3('0x68')][_0xd9d3('0x3e')](_0xd9d3('0x69'),{'type':db[_0xd9d3('0x68')][_0xd9d3('0x6a')][_0xd9d3('0x6b')]})[_0xd9d3('0x13')](function(_0x26649b){if(_0x26649b&&_0x26649b['length']){for(var _0x22af52=0x0,_0x38147e=_0x26649b[_0xd9d3('0x48')];_0x22af52<_0x38147e&&_['isNil'](_0x32da00['internal']);_0x22af52++){if(_0x454ae9[_0xd9d3('0x66')]<=_0x26649b[_0x22af52][_0xd9d3('0x6c')]){_0x32da00[_0xd9d3('0x65')]=_0x26649b[_0x22af52]['from'];}else if(_0x454ae9[_0xd9d3('0x66')]>_0x26649b[_0x22af52][_0xd9d3('0x6c')]&&_0x454ae9[_0xd9d3('0x66')]<=_0x26649b[_0x22af52]['to']){_0x32da00[_0xd9d3('0x65')]=_0x454ae9['min_internal'];}}}if(_['isNil'](_0x32da00['internal'])){_0x32da00[_0xd9d3('0x65')]=_0x3c6b16+0x1;}return _0x1f05d5(_0x32da00);});});})[_0xd9d3('0x1c')](function(_0x343d06){_0x451810(_0x343d06);});});}function updateUser(_0x2efa44){return new BPromise(function(_0x11cc71,_0x46fb28){try{if(_0x2efa44['voicemail']){_0x2efa44[_0xd9d3('0x6d')]=_0x2efa44[_0xd9d3('0x65')];_0x2efa44[_0xd9d3('0x6e')]={'mailbox':_0x2efa44['internal'],'password':_0x2efa44['password'],'fullname':_0x2efa44['fullname'],'email':_0x2efa44[_0xd9d3('0x6f')]};}if(_0x2efa44[_0xd9d3('0x29')]===_0xd9d3('0x2e')){if(!_0x2efa44[_0xd9d3('0x70')])_0x2efa44[_0xd9d3('0x70')]=['101','102',_0xd9d3('0x71'),_0xd9d3('0x72'),_0xd9d3('0x73'),_0xd9d3('0x74'),_0xd9d3('0x75'),'106','107',_0xd9d3('0x76'),_0xd9d3('0x77'),'100','111','114','115'];}_0x11cc71(_0x2efa44);}catch(_0x17021f){_0x46fb28(_0x17021f);}});}exports[_0xd9d3('0x78')]=function(_0x368884,_0x952e0c){if(_0x368884[_0xd9d3('0x2c')]['role']===_0xd9d3('0x2e'))throw new Error(_0xd9d3('0x79'));if(_0x368884[_0xd9d3('0x5e')][_0xd9d3('0x29')]===_0xd9d3('0x2c')&&_0x368884[_0xd9d3('0x2c')][_0xd9d3('0x29')]!=='admin'){throw new Error(_0xd9d3('0x7a'));}if(_0x368884['body'][_0xd9d3('0x29')]===_0xd9d3('0x2a')&&_0x368884[_0xd9d3('0x2c')][_0xd9d3('0x29')]!==_0xd9d3('0x2a')){throw new Error(_0xd9d3('0x7b'));}return licenseUtil[_0xd9d3('0x7c')]([_0x368884['body']])[_0xd9d3('0x13')](function(){return validateUser(_0x368884[_0xd9d3('0x5e')]);})['then'](function(_0x404efc){return updateUser(_0x404efc)['then'](function(_0x4b243f){if(_0x4b243f[_0xd9d3('0x29')]===_0xd9d3('0x2a')){_0x4b243f[_0xd9d3('0x7d')]=_0x368884[_0xd9d3('0x2c')]['settingsEnabled'];delete _0x4b243f[_0xd9d3('0x7e')];}return _0x4b243f;});})[_0xd9d3('0x13')](function(_0x348029){return db[_0xd9d3('0x39')][_0xd9d3('0x78')](_0x348029,{'include':[{'model':db[_0xd9d3('0x6e')],'as':'VoiceMail'}]});})[_0xd9d3('0x13')](function(_0x1325eb){if(_0x368884[_0xd9d3('0x5e')][_0xd9d3('0x29')]==='user')return _0x1325eb;if(_0x368884[_0xd9d3('0x2c')][_0xd9d3('0x29')]!=='user')return _0x1325eb;return db['UserProfileSection']['find']({'where':{'name':_0x1325eb[_0xd9d3('0x29')]===_0xd9d3('0x2e')?_0xd9d3('0x2d'):_0xd9d3('0x2f'),'userProfileId':_0x368884[_0xd9d3('0x2c')]['userProfileId']},'raw':!![]})['then'](function(_0x542c4e){if(!_0x542c4e||_0x542c4e[_0xd9d3('0x7f')]!=0x0)return _0x1325eb;return db['UserProfileResource'][_0xd9d3('0x78')]({'name':_0x1325eb['name'],'resourceId':_0x1325eb['id'],'type':_0x542c4e[_0xd9d3('0x37')],'sectionId':_0x542c4e['id']},{})['then'](function(){return _0x1325eb;});})[_0xd9d3('0x1c')](function(_0x3d4ad3){logger[_0xd9d3('0x19')](_0xd9d3('0x80'),_0x3d4ad3);throw _0x3d4ad3;});})['then'](respondWithResult(_0x952e0c,0xc9))[_0xd9d3('0x1c')](handleError(_0x952e0c,null));};exports[_0xd9d3('0x81')]=function(_0x2259c5,_0x1b200e){var _0x46242a=_0x2259c5[_0xd9d3('0x5e')];var _0x3d3f95=[];if(_0x2259c5[_0xd9d3('0x2c')][_0xd9d3('0x29')]===_0xd9d3('0x2e'))throw new Error('Unauthorized');if(_[_0xd9d3('0x82')](_0x46242a,[_0xd9d3('0x29'),_0xd9d3('0x2c')])&&_0x2259c5[_0xd9d3('0x2c')][_0xd9d3('0x29')]!==_0xd9d3('0x2a')){throw new Error(_0xd9d3('0x7a'));}if(_[_0xd9d3('0x82')](_0x46242a,[_0xd9d3('0x29'),_0xd9d3('0x2a')])&&_0x2259c5[_0xd9d3('0x2c')][_0xd9d3('0x29')]!==_0xd9d3('0x2a')){throw new Error(_0xd9d3('0x83'));}return licenseUtil[_0xd9d3('0x7c')](_0x46242a)['then'](function(){return validateUser(_0x46242a[0x0]);})[_0xd9d3('0x13')](function(){for(var _0x3db1b2=0x1;_0x3db1b2<_0x46242a['length'];_0x3db1b2++){var _0x4208e3=_0x46242a[_0x3db1b2-0x1]['internal'];if(!_0x46242a[_0x3db1b2][_0xd9d3('0x65')])_0x46242a[_0x3db1b2]['internal']=_0x4208e3+0x1;_0x3d3f95['push'](validateUser(_0x46242a[_0x3db1b2]));}return BPromise[_0xd9d3('0x50')](_0x3d3f95);})[_0xd9d3('0x13')](function(){_0x3d3f95=[];for(var _0x5fcbf8=0x0;_0x5fcbf8<_0x46242a[_0xd9d3('0x48')];_0x5fcbf8++){_0x3d3f95[_0xd9d3('0x45')](updateUser(_0x46242a[_0x5fcbf8]));}return BPromise['all'](_0x3d3f95);})['then'](function(){return BPromise[_0xd9d3('0x84')](_0x46242a,function(_0x255734){return db[_0xd9d3('0x39')][_0xd9d3('0x78')](_0x255734,{'include':[{'model':db[_0xd9d3('0x6e')],'as':'VoiceMail'}]})[_0xd9d3('0x13')](function(_0x3acd90){_0x255734['id']=_0x3acd90['id'];return _0x255734;});});})[_0xd9d3('0x13')](function(_0x3bfc1e){if(_0x2259c5[_0xd9d3('0x5e')][_0xd9d3('0x29')]===_0xd9d3('0x2c'))return _0x3bfc1e;if(_0x2259c5[_0xd9d3('0x2c')][_0xd9d3('0x29')]!==_0xd9d3('0x2c'))return _0x3bfc1e;var _0x37fa7e=_[_0xd9d3('0x82')](_0x3bfc1e,function(_0x2438fd){return _0x2438fd[_0xd9d3('0x29')]==='agent'||_0x2438fd[_0xd9d3('0x29')]===_0xd9d3('0x85');});if(!_0x37fa7e)return _0x3bfc1e;return db[_0xd9d3('0x86')][_0xd9d3('0x46')]({'where':{'name':{'$or':[_0xd9d3('0x2d'),_0xd9d3('0x2f')]},'userProfileId':_0x2259c5[_0xd9d3('0x2c')]['userProfileId']},'raw':!![]})['then'](function(_0x544293){if(_[_0xd9d3('0x87')](_0x544293)||!_[_0xd9d3('0x82')](_0x544293,[_0xd9d3('0x7f'),0x0]))return _0x3bfc1e;_0x3d3f95=[];var _0x4b6bb7=_(_0x544293)[_0xd9d3('0x32')](function(_0x4647e1){if(_0x4647e1[_0xd9d3('0x7f')]===0x1)return;return _0x4647e1[_0xd9d3('0x37')]===_0xd9d3('0x2d')?_0xd9d3('0x2e'):_0xd9d3('0x85');})['compact']()[_0xd9d3('0x33')]();for(var _0x3c3a6c=0x0;_0x3c3a6c<_0x3bfc1e['length'];_0x3c3a6c++){if(!_['includes'](_0x4b6bb7,_0x3bfc1e[_0x3c3a6c]['role']))return;var _0x17614c=_0x3bfc1e[_0x3c3a6c][_0xd9d3('0x29')]==='agent'?_0xd9d3('0x2d'):_0xd9d3('0x2f');_0x3d3f95[_0xd9d3('0x45')](db[_0xd9d3('0x36')][_0xd9d3('0x78')]({'name':_0x3bfc1e[_0x3c3a6c][_0xd9d3('0x37')],'resourceId':_0x3bfc1e[_0x3c3a6c]['id'],'type':_0x17614c,'sectionId':_[_0xd9d3('0x35')](_0x544293,['name',_0x17614c])['id']},{}));}return BPromise[_0xd9d3('0x50')](_0x3d3f95);});})[_0xd9d3('0x13')](respondWithResult(_0x1b200e,0xc9))[_0xd9d3('0x1c')](handleError(_0x1b200e,null));};exports[_0xd9d3('0x88')]=function(_0x4bff32,_0x2091e3){if(_0x4bff32['body']['id']){delete _0x4bff32[_0xd9d3('0x5e')]['id'];}return db[_0xd9d3('0x39')]['find']({'where':{'id':_0x4bff32[_0xd9d3('0x52')]['id']}})[_0xd9d3('0x13')](function(_0x25c9a7){if(!_0x25c9a7)return null;if(_0x25c9a7['id']===_0x4bff32[_0xd9d3('0x2c')]['id']){if(!_0x4bff32[_0xd9d3('0x5e')][_0xd9d3('0x89')]||!_0x4bff32[_0xd9d3('0x5e')]['newPassword']){throw new db[(_0xd9d3('0x8a'))][(_0xd9d3('0x8b'))](_0xd9d3('0x8c'));}if(!_0x25c9a7['authenticate'](_0x4bff32['body'][_0xd9d3('0x89')])){throw new db[(_0xd9d3('0x8a'))]['ValidationError'](_0xd9d3('0x8d'));}if(_0x4bff32['body']['oldPassword']===_0x4bff32['body'][_0xd9d3('0x8e')]){throw new db['Sequelize'][(_0xd9d3('0x8b'))](_0xd9d3('0x8f'));}}else if(_0x4bff32['user'][_0xd9d3('0x29')]===_0xd9d3('0x2a')){if(!_0x4bff32[_0xd9d3('0x5e')][_0xd9d3('0x8e')]){throw new db[(_0xd9d3('0x8a'))]['ValidationError'](_0xd9d3('0x90'));}}else if(_0x4bff32[_0xd9d3('0x2c')]['role']===_0xd9d3('0x2c')){if(!_0x4bff32['body']['newPassword']){throw new db[(_0xd9d3('0x8a'))][(_0xd9d3('0x8b'))](_0xd9d3('0x90'));}if(_0x25c9a7[_0xd9d3('0x29')]!==_0xd9d3('0x2e')){throw new db['Sequelize'][(_0xd9d3('0x8b'))](_0xd9d3('0x79'));}}else{throw new db['Sequelize'][(_0xd9d3('0x8b'))](_0xd9d3('0x79'));}return _0x25c9a7;})[_0xd9d3('0x13')](handleEntityNotFound(_0x2091e3,null))[_0xd9d3('0x13')](function(_0xc0d070){return db[_0xd9d3('0x63')]['findOne']({'attributes':['id','securePassword',_0xd9d3('0x91'),_0xd9d3('0x92')]})[_0xd9d3('0x13')](function(_0x216d0a){if(_0x216d0a[_0xd9d3('0x64')])authService[_0xd9d3('0x93')](_0x4bff32[_0xd9d3('0x5e')][_0xd9d3('0x8e')]);if(!_0x216d0a[_0xd9d3('0x91')]||!_0xc0d070['previousPasswords'])return _0xc0d070;authService[_0xd9d3('0x94')](_0x4bff32[_0xd9d3('0x5e')][_0xd9d3('0x8e')],_0xc0d070[_0xd9d3('0x95')],_0x216d0a[_0xd9d3('0x92')]);return _0xc0d070;})[_0xd9d3('0x13')](saveUpdates({'password':_0x4bff32[_0xd9d3('0x5e')][_0xd9d3('0x8e')],'passwordResetAt':_0x4bff32[_0xd9d3('0x2c')]['id']==_0x4bff32[_0xd9d3('0x52')]['id']?moment():null,'previousPasswords':authService[_0xd9d3('0x96')](_0x4bff32['body'][_0xd9d3('0x8e')],_0xc0d070[_0xd9d3('0x95')])},null));})[_0xd9d3('0x13')](respondWithResult(_0x2091e3,null))[_0xd9d3('0x1c')](handleError(_0x2091e3,null));};exports[_0xd9d3('0x97')]=function(_0xb3101,_0x341ae7){var _0x205346=_0xb3101['body'][_0xd9d3('0x98')];return db[_0xd9d3('0x39')][_0xd9d3('0x35')]({'where':{'id':_0xb3101[_0xd9d3('0x52')]['id']},'attributes':['id',_0xd9d3('0x37'),_0xd9d3('0x29'),_0xd9d3('0x99'),_0xd9d3('0x9a'),'voicePause',_0xd9d3('0x9b')]})['then'](handleEntityNotFound(_0x341ae7,null))[_0xd9d3('0x13')](function(_0x58f7e5){if(_0x58f7e5){if(!utils[_0xd9d3('0x9c')](_0x205346)){throw new db[(_0xd9d3('0x8a'))][(_0xd9d3('0x8b'))](_0xd9d3('0x9d'));}return _0x58f7e5[_0xd9d3('0x9e')+_[_0xd9d3('0x9f')](_0x205346[_0xd9d3('0xa0')]())+'Queues'](_0xb3101['body'][_0xd9d3('0x61')],{'penalty':_0xb3101[_0xd9d3('0x5e')][_0xd9d3('0xa1')]||0x0})[_0xd9d3('0xa2')](function(_0x3a31ee){for(var _0x3eb196=0x0;_0x3eb196<_0xb3101['body'][_0xd9d3('0x61')][_0xd9d3('0x48')];_0x3eb196+=0x1){var _0x10b3a4={'UserId':Number(_0xb3101[_0xd9d3('0x52')]['id'])};_0x10b3a4[_[_0xd9d3('0x9f')](_0x205346[_0xd9d3('0xa0')]())+_0xd9d3('0xa3')]=Number(_0xb3101['body'][_0xd9d3('0x61')][_0x3eb196]);socket['emit'](_0xd9d3('0x2c')+_[_0xd9d3('0x9f')](_0x205346['toLowerCase']())+_0xd9d3('0xa4'),_0x10b3a4);}return _0x3a31ee;})[_0xd9d3('0x13')](function(){if(_0x205346==='voice'){return db[_0xd9d3('0xa5')][_0xd9d3('0x46')]({'where':{'id':_0xb3101['body'][_0xd9d3('0x61')]||[]},'raw':!![],'attributes':['id',_0xd9d3('0x37')]});}})[_0xd9d3('0x13')](function(_0x5eb966){var _0x3ed406=_0x58f7e5[_0xd9d3('0xa6')]({'plain':!![]});var _0x3362a9=[];if(_0x205346===_0xd9d3('0xa7')&&_0x3ed406[_0xd9d3('0x29')]===_0xd9d3('0x2e')&&_0x3ed406[_0xd9d3('0x99')]){for(var _0x205c79=0x0;_0x205c79<_0x5eb966['length'];_0x205c79+=0x1){_0x3362a9['push']({'membername':_0x3ed406['name'],'UserId':_0x3ed406['id'],'queue_name':_0x5eb966[_0x205c79]['name'],'VoiceQueueId':_0x5eb966[_0x205c79]['id'],'interface':_[_0xd9d3('0x67')](_0x3ed406[_0xd9d3('0x9b')])?util[_0xd9d3('0xa8')](_0xd9d3('0xa9'),_0x3ed406['name']):_0x3ed406[_0xd9d3('0x9b')],'paused':_0x3ed406[_0xd9d3('0xaa')]||![],'penalty':_0xb3101['body'][_0xd9d3('0xa1')]||0x0});}return BPromise[_0xd9d3('0x84')](_0x3362a9,function(_0x4ac6a0){return db[_0xd9d3('0xab')][_0xd9d3('0xac')](_0x4ac6a0);});}return _0x58f7e5;});}})['then'](respondWithStatusCode(_0x341ae7,null))[_0xd9d3('0x1c')](handleError(_0x341ae7,null));};exports[_0xd9d3('0xad')]=function(_0x2de64b,_0x4bb19f){var _0x55c853,_0x3d33a7;return db[_0xd9d3('0x39')][_0xd9d3('0x35')]({'where':{'id':_0x2de64b[_0xd9d3('0x52')]['id']},'attributes':['id',_0xd9d3('0x37'),_0xd9d3('0x29')]})[_0xd9d3('0x13')](handleEntityNotFound(_0x4bb19f,null))[_0xd9d3('0x13')](function(_0x162e80){if(_0x162e80){_0x55c853=_0x162e80;if(!_0x2de64b[_0xd9d3('0x3e')][_0xd9d3('0x98')]||!utils['isValidChannel'](_0x2de64b[_0xd9d3('0x3e')][_0xd9d3('0x98')])){throw new db[(_0xd9d3('0x8a'))][(_0xd9d3('0x8b'))](_0xd9d3('0x9d'));}return _0x162e80['remove'+_[_0xd9d3('0x9f')](_0x2de64b[_0xd9d3('0x3e')][_0xd9d3('0x98')]['toLowerCase']())+_0xd9d3('0xae')](_0x2de64b['query'][_0xd9d3('0x61')]);}})[_0xd9d3('0x13')](function(_0x123270){if(_[_0xd9d3('0xaf')](_0x2de64b[_0xd9d3('0x3e')][_0xd9d3('0x61')])){for(var _0x13f8e0=0x0;_0x13f8e0<_0x2de64b[_0xd9d3('0x3e')]['ids'][_0xd9d3('0x48')];_0x13f8e0+=0x1){_0x3d33a7={'UserId':Number(_0x2de64b[_0xd9d3('0x52')]['id'])};_0x3d33a7[_['capitalize'](_0x2de64b[_0xd9d3('0x3e')][_0xd9d3('0x98')][_0xd9d3('0xa0')]())+'QueueId']=Number(_0x2de64b[_0xd9d3('0x3e')][_0xd9d3('0x61')][_0x13f8e0]);socket[_0xd9d3('0xb0')](_0xd9d3('0x2c')+_['capitalize'](_0x2de64b[_0xd9d3('0x3e')][_0xd9d3('0x98')]['toLowerCase']())+_0xd9d3('0xb1'),_0x3d33a7);}}else{_0x3d33a7={'UserId':Number(_0x2de64b[_0xd9d3('0x52')]['id'])};_0x3d33a7[_[_0xd9d3('0x9f')](_0x2de64b[_0xd9d3('0x3e')][_0xd9d3('0x98')]['toLowerCase']())+_0xd9d3('0xa3')]=Number(_0x2de64b[_0xd9d3('0x3e')][_0xd9d3('0x61')]);socket[_0xd9d3('0xb0')](_0xd9d3('0x2c')+_[_0xd9d3('0x9f')](_0x2de64b[_0xd9d3('0x3e')][_0xd9d3('0x98')][_0xd9d3('0xa0')]())+'Queue:remove',_0x3d33a7);}return _0x123270;})[_0xd9d3('0x13')](function(){if(_0x2de64b['query'][_0xd9d3('0x98')]===_0xd9d3('0xa7')){return db[_0xd9d3('0xab')][_0xd9d3('0x28')]({'where':{'UserId':_0x2de64b[_0xd9d3('0x52')]['id'],'VoiceQueueId':_0x2de64b[_0xd9d3('0x3e')][_0xd9d3('0x61')]},'individualHooks':!![]})[_0xd9d3('0x13')](function(){return _0x55c853;});}return _0x55c853;})[_0xd9d3('0x13')](respondWithStatusCode(_0x4bb19f,null))[_0xd9d3('0x1c')](handleError(_0x4bb19f,null));};exports['addAvatar']=function(_0x431fda,_0x20ca0a){_0x431fda[_0xd9d3('0x5e')]['userpic']=_0x431fda[_0xd9d3('0xb2')]['filename'];return db[_0xd9d3('0x39')]['find']({'where':{'id':_0x431fda[_0xd9d3('0x52')]['id']}})['then'](handleEntityNotFound(_0x20ca0a,null))['then'](saveUpdates(_0x431fda['body'],null))[_0xd9d3('0x13')](respondWithResult(_0x20ca0a,null))[_0xd9d3('0x1c')](handleError(_0x20ca0a,null));};exports[_0xd9d3('0xb3')]=function(_0x4c07db,_0x52cd65){var _0x51cdf8=path[_0xd9d3('0xb4')](config['root'],'server/files/images/logos/default_profile.png');return db[_0xd9d3('0x39')][_0xd9d3('0x35')]({'where':{'id':_0x4c07db['params']['id']},'attributes':['id',_0xd9d3('0xb5')],'raw':!![]})[_0xd9d3('0x13')](handleEntityNotFound(_0x52cd65,null))[_0xd9d3('0x13')](function(_0x158bc4){if(_0x158bc4){if(_['isNil'](_0x158bc4[_0xd9d3('0xb5')])){return _0x52cd65[_0xd9d3('0xb6')](_0x51cdf8);}else{if(!fs[_0xd9d3('0xb7')](path[_0xd9d3('0xb4')](config['root'],_0xd9d3('0xb8'),_0x158bc4[_0xd9d3('0xb5')]))){return _0x52cd65['download'](_0x51cdf8);}return _0x52cd65['download'](path[_0xd9d3('0xb4')](config[_0xd9d3('0xb9')],_0xd9d3('0xb8'),_0x158bc4[_0xd9d3('0xb5')]));}}})['catch'](handleError(_0x52cd65,null));};exports['getOpenTabs']=function(_0x329354,_0x2a100e){return db[_0xd9d3('0x39')][_0xd9d3('0x35')]({'where':{'id':_0x329354[_0xd9d3('0x52')]['id']},'attributes':['id']})[_0xd9d3('0x13')](handleEntityNotFound(_0x2a100e,null))[_0xd9d3('0x13')](function(_0x17c548){var _0x4a3340=[];values=_0x17c548[_0xd9d3('0x4a')];_0x4a3340[_0xd9d3('0x45')](get_open_tabs('chat',_0x17c548[_0xd9d3('0x4a')]));_0x4a3340[_0xd9d3('0x45')](get_open_tabs('sms',_0x17c548['dataValues']));_0x4a3340['push'](get_open_tabs(_0xd9d3('0x4e'),_0x17c548[_0xd9d3('0x4a')]));_0x4a3340[_0xd9d3('0x45')](get_open_tabs(_0xd9d3('0x4f'),_0x17c548[_0xd9d3('0x4a')]));_0x4a3340[_0xd9d3('0x45')](get_open_tabs('fax',_0x17c548[_0xd9d3('0x4a')]));_0x4a3340['push'](get_open_tabs('mail',_0x17c548[_0xd9d3('0x4a')]));return BPromise[_0xd9d3('0x50')](_0x4a3340);})[_0xd9d3('0x13')](function(_0x1857f1){if(_0x1857f1){var _0x7d65e0=_[_0xd9d3('0x32')](values['ChatOpenTabs'],function(_0x1730f0){return{'channel':_0xd9d3('0xba'),'id':_0x1730f0['id'],'createdAt':_0x1730f0[_0xd9d3('0xbb')]};});var _0x3e354b=_[_0xd9d3('0x32')](values['FaxOpenTabs'],function(_0x5a38bf){return{'channel':'FAX','id':_0x5a38bf['id'],'createdAt':_0x5a38bf[_0xd9d3('0xbb')]};});var _0x547e8e=_[_0xd9d3('0x32')](values[_0xd9d3('0xbc')],function(_0x521321){return{'channel':_0xd9d3('0xbd'),'id':_0x521321['id'],'createdAt':_0x521321[_0xd9d3('0xbb')]};});var _0x446fce=_[_0xd9d3('0x32')](values[_0xd9d3('0xbe')],function(_0x258665){return{'channel':_0xd9d3('0xbf'),'id':_0x258665['id'],'createdAt':_0x258665[_0xd9d3('0xbb')]};});var _0x5f19ed=_[_0xd9d3('0x32')](values['SmsOpenTabs'],function(_0x543c4a){return{'channel':_0xd9d3('0xc0'),'id':_0x543c4a['id'],'createdAt':_0x543c4a[_0xd9d3('0xbb')]};});var _0x219ea0=_['map'](values['WhatsappOpenTabs'],function(_0x70aaf5){return{'channel':_0xd9d3('0xc1'),'id':_0x70aaf5['id'],'createdAt':_0x70aaf5['createdAt']};});var _0x23cc8b=_[_0xd9d3('0xc2')](_0x7d65e0,_0x3e354b,_0x547e8e,_0x446fce,_0x5f19ed,_0x219ea0);var _0x4127b6={'count':_0x23cc8b[_0xd9d3('0x48')],'rows':_0x23cc8b};return _0x4127b6;}else return null;})[_0xd9d3('0x13')](respondWithResult(_0x2a100e,null))[_0xd9d3('0x1c')](handleError(_0x2a100e,null));};exports[_0xd9d3('0xc3')]=function(_0x21b05,_0x39f0f0){var _0x386185={};var _0x3a5494={};var _0x555a22;var _0x5b8f50;return db[_0xd9d3('0x39')]['findOne']({'where':{'id':_0x21b05[_0xd9d3('0x52')]['id']}})[_0xd9d3('0x13')](handleEntityNotFound(_0x39f0f0,null))['then'](function(_0x43d063){if(_0x43d063){_0x555a22=_0x43d063;_0x3a5494['model']=_['keys'](db[_0xd9d3('0xc4')][_0xd9d3('0x56')]);_0x3a5494[_0xd9d3('0x3e')]=_[_0xd9d3('0x55')](_0x21b05[_0xd9d3('0x3e')]);_0x3a5494['filters']=_[_0xd9d3('0x59')](_0x3a5494['model'],_0x3a5494[_0xd9d3('0x3e')]);_0x386185[_0xd9d3('0x44')]=_[_0xd9d3('0x59')](_0x3a5494['model'],qs[_0xd9d3('0x5a')](_0x21b05[_0xd9d3('0x3e')]['fields']));_0x386185[_0xd9d3('0x44')]=_0x386185[_0xd9d3('0x44')][_0xd9d3('0x48')]?_0x386185['attributes']:_0x3a5494[_0xd9d3('0x53')];_0x386185[_0xd9d3('0xc5')]=qs['sort'](_0x21b05['query'][_0xd9d3('0xc6')]);_0x386185[_0xd9d3('0xc7')]=qs[_0xd9d3('0x58')](_[_0xd9d3('0xc8')](_0x21b05[_0xd9d3('0x3e')],_0x3a5494['filters']));if(_0x21b05[_0xd9d3('0x3e')]['filter']){_0x386185[_0xd9d3('0xc7')]=_[_0xd9d3('0x5b')](_0x386185[_0xd9d3('0xc7')],{'$or':_[_0xd9d3('0x32')](_0x386185[_0xd9d3('0x44')],function(_0x38550d){var _0x4309c0={};_0x4309c0[_0x38550d]={'$like':'%'+_0x21b05[_0xd9d3('0x3e')][_0xd9d3('0x30')]+'%'};return _0x4309c0;})});}_0x386185=_[_0xd9d3('0x5b')]({},_0x386185,_0x21b05[_0xd9d3('0x5c')]);return _0x555a22['getContacts'](_0x386185);}})[_0xd9d3('0x13')](function(_0x43d368){if(_0x43d368){_0x5b8f50=_0x43d368['length'];if(_0x21b05[_0xd9d3('0x3e')]['hasOwnProperty']('includeAll')){_0x386185[_0xd9d3('0x40')]=[{'model':db[_0xd9d3('0xc9')],'as':'List','required':![]},{'model':db[_0xd9d3('0xca')],'as':_0xd9d3('0xcb'),'attributes':['id',_0xd9d3('0x37'),_0xd9d3('0xcc')],'where':_0x21b05[_0xd9d3('0x3e')]['tag']?{'id':_0x21b05[_0xd9d3('0x3e')][_0xd9d3('0xcd')]}:undefined,'required':_0x21b05[_0xd9d3('0x3e')][_0xd9d3('0xcd')]?!![]:![]}];}if(!_0x21b05[_0xd9d3('0x3e')]['hasOwnProperty'](_0xd9d3('0xce'))){_0x386185[_0xd9d3('0x22')]=qs[_0xd9d3('0x22')](_0x21b05['query'][_0xd9d3('0x22')]);_0x386185[_0xd9d3('0x20')]=qs[_0xd9d3('0x20')](_0x21b05[_0xd9d3('0x3e')][_0xd9d3('0x20')]);}return _0x555a22[_0xd9d3('0xc3')](_0x386185);}})['then'](function(_0x53b290){if(_0x53b290){return _0x53b290?{'count':_0x5b8f50,'rows':_0x53b290}:null;}})[_0xd9d3('0x13')](respondWithResult(_0x39f0f0,null))[_0xd9d3('0x1c')](handleError(_0x39f0f0,null));};exports['getQueues']=function(_0x36b0e7,_0x5ec57a){var _0x1bc797;var _0x177013={};var _0x351bc1;return db['User'][_0xd9d3('0xcf')]({'where':{'id':_0x36b0e7[_0xd9d3('0x52')]['id']},'attributes':['id',_0xd9d3('0x37'),_0xd9d3('0x29')]})[_0xd9d3('0x13')](handleEntityNotFound(_0x5ec57a,null))[_0xd9d3('0x13')](function(_0xa4b12e){if(!utils['isValidChannel'](_0x36b0e7['query'][_0xd9d3('0x98')])){throw new db[(_0xd9d3('0x8a'))][(_0xd9d3('0x8b'))]('Unknown\x20channel');}_0x1bc797=_0xa4b12e;var _0x6e6b62={};_0x6e6b62[_0xd9d3('0x53')]=_[_0xd9d3('0x55')](db[_[_0xd9d3('0x9f')](_0x36b0e7[_0xd9d3('0x3e')][_0xd9d3('0x98')])+_0xd9d3('0xd0')][_0xd9d3('0x56')]);_0x6e6b62[_0xd9d3('0x3e')]=_['keys'](_0x36b0e7['query']);_0x6e6b62[_0xd9d3('0x58')]=_['intersection'](_0x6e6b62[_0xd9d3('0x53')],_0x6e6b62['query']);_0x177013[_0xd9d3('0x44')]=_[_0xd9d3('0x59')](_0x6e6b62[_0xd9d3('0x53')],qs['fields'](_0x36b0e7[_0xd9d3('0x3e')][_0xd9d3('0x5a')]));_0x177013[_0xd9d3('0x44')]=_0x177013['attributes'][_0xd9d3('0x48')]?_0x177013[_0xd9d3('0x44')]:_0x6e6b62['model'];_0x177013['order']=qs[_0xd9d3('0xc6')](_0x36b0e7[_0xd9d3('0x3e')][_0xd9d3('0xc6')]);_0x177013[_0xd9d3('0xc7')]=qs[_0xd9d3('0x58')](_['pick'](_0x36b0e7[_0xd9d3('0x3e')],_0x6e6b62[_0xd9d3('0x58')]));if(_0x36b0e7[_0xd9d3('0x3e')][_0xd9d3('0x30')]){_0x177013['where']=_['merge'](_0x177013['where'],{'$or':_[_0xd9d3('0x32')](_0x177013['attributes'],function(_0x7009e){var _0x7369f8={};_0x7369f8[_0x7009e]={'$like':'%'+_0x36b0e7[_0xd9d3('0x3e')][_0xd9d3('0x30')]+'%'};return _0x7369f8;})});}_0x177013=_[_0xd9d3('0x5b')]({},_0x177013,_0x36b0e7[_0xd9d3('0x5c')]);switch(_0x1bc797[_0xd9d3('0x29')]){case'admin':return db[_[_0xd9d3('0x9f')](_0x36b0e7[_0xd9d3('0x3e')]['channel'])+_0xd9d3('0xd0')][_0xd9d3('0x46')](_0x177013);case _0xd9d3('0x2c'):case'agent':return _0x1bc797[_0xd9d3('0xa6')+_[_0xd9d3('0x9f')](_0x36b0e7[_0xd9d3('0x3e')][_0xd9d3('0x98')])+_0xd9d3('0xae')](_0x177013);default:throw new db['Sequelize']['ValidationError'](_0xd9d3('0xd1'));}})['then'](function(_0x3bfe63){_0x351bc1=_0x3bfe63[_0xd9d3('0x48')];if(!_0x36b0e7[_0xd9d3('0x3e')]['hasOwnProperty'](_0xd9d3('0xce'))){_0x177013[_0xd9d3('0x22')]=qs['limit'](_0x36b0e7[_0xd9d3('0x3e')][_0xd9d3('0x22')]);_0x177013[_0xd9d3('0x20')]=qs[_0xd9d3('0x20')](_0x36b0e7[_0xd9d3('0x3e')][_0xd9d3('0x20')]);}switch(_0x1bc797[_0xd9d3('0x29')]){case _0xd9d3('0x2a'):return db[_[_0xd9d3('0x9f')](_0x36b0e7[_0xd9d3('0x3e')][_0xd9d3('0x98')])+_0xd9d3('0xd0')][_0xd9d3('0x46')](_0x177013);case'user':case _0xd9d3('0x2e'):return _0x1bc797[_0xd9d3('0xa6')+_[_0xd9d3('0x9f')](_0x36b0e7[_0xd9d3('0x3e')][_0xd9d3('0x98')])+_0xd9d3('0xae')](_0x177013);}})[_0xd9d3('0x13')](function(_0x5c8838){return{'count':_0x351bc1,'rows':_0x5c8838};})[_0xd9d3('0x13')](respondWithResult(_0x5ec57a,null))[_0xd9d3('0x1c')](handleError(_0x5ec57a,null));};exports[_0xd9d3('0xd2')]=function(_0x12a567,_0x277b9d){var _0x4c861b={};var _0x4c9d48={};var _0x4f649b;var _0x3c92a0;return db['User']['findOne']({'where':{'id':_0x12a567['params']['id']}})[_0xd9d3('0x13')](handleEntityNotFound(_0x277b9d,null))[_0xd9d3('0x13')](function(_0x3821fc){if(_0x3821fc){_0x4f649b=_0x3821fc;_0x4c9d48[_0xd9d3('0x53')]=_[_0xd9d3('0x55')](db['UserVoiceQueueRt'][_0xd9d3('0x56')]);_0x4c9d48['query']=_[_0xd9d3('0x55')](_0x12a567[_0xd9d3('0x3e')]);_0x4c9d48['filters']=_[_0xd9d3('0x59')](_0x4c9d48[_0xd9d3('0x53')],_0x4c9d48[_0xd9d3('0x3e')]);_0x4c861b[_0xd9d3('0x44')]=_['intersection'](_0x4c9d48[_0xd9d3('0x53')],qs[_0xd9d3('0x5a')](_0x12a567[_0xd9d3('0x3e')][_0xd9d3('0x5a')]));_0x4c861b[_0xd9d3('0x44')]=_0x4c861b[_0xd9d3('0x44')]['length']?_0x4c861b[_0xd9d3('0x44')]:_0x4c9d48['model'];_0x4c861b[_0xd9d3('0xc5')]=qs['sort'](_0x12a567[_0xd9d3('0x3e')][_0xd9d3('0xc6')]);_0x4c861b[_0xd9d3('0xc7')]=qs[_0xd9d3('0x58')](_[_0xd9d3('0xc8')](_0x12a567[_0xd9d3('0x3e')],_0x4c9d48['filters']));if(_0x12a567['query'][_0xd9d3('0x30')]){_0x4c861b[_0xd9d3('0xc7')]=_[_0xd9d3('0x5b')](_0x4c861b[_0xd9d3('0xc7')],{'$or':_[_0xd9d3('0x32')](_0x4c861b[_0xd9d3('0x44')],function(_0x787225){var _0x228246={};_0x228246[_0x787225]={'$like':'%'+_0x12a567[_0xd9d3('0x3e')][_0xd9d3('0x30')]+'%'};return _0x228246;})});}_0x4c861b=_[_0xd9d3('0x5b')]({},_0x4c861b,_0x12a567[_0xd9d3('0x5c')]);return _0x4f649b[_0xd9d3('0xd2')](_0x4c861b);}})[_0xd9d3('0x13')](function(_0x731b55){if(_0x731b55){_0x3c92a0=_0x731b55[_0xd9d3('0x48')];if(!_0x12a567['query']['hasOwnProperty'](_0xd9d3('0xce'))){_0x4c861b[_0xd9d3('0x22')]=qs[_0xd9d3('0x22')](_0x12a567[_0xd9d3('0x3e')][_0xd9d3('0x22')]);_0x4c861b[_0xd9d3('0x20')]=qs[_0xd9d3('0x20')](_0x12a567[_0xd9d3('0x3e')][_0xd9d3('0x20')]);}return _0x4f649b['getVoiceQueuesRt'](_0x4c861b);}})[_0xd9d3('0x13')](function(_0x1b1637){if(_0x1b1637){return _0x1b1637?{'count':_0x3c92a0,'rows':_0x1b1637}:null;}})[_0xd9d3('0x13')](respondWithResult(_0x277b9d,null))[_0xd9d3('0x1c')](handleError(_0x277b9d,null));};exports[_0xd9d3('0xd3')]=function(_0x3e8d7e,_0x55762f){var _0x2f89fb={};var _0x445221={};var _0x1a21b8;var _0x474584;return db[_0xd9d3('0x39')][_0xd9d3('0xcf')]({'where':{'id':_0x3e8d7e[_0xd9d3('0x52')]['id']}})['then'](handleEntityNotFound(_0x55762f,null))[_0xd9d3('0x13')](function(_0x318def){if(_0x318def){_0x1a21b8=_0x318def;_0x445221[_0xd9d3('0x53')]=_[_0xd9d3('0x55')](db[_0xd9d3('0xd4')]['rawAttributes']);_0x445221[_0xd9d3('0x3e')]=_[_0xd9d3('0x55')](_0x3e8d7e['query']);_0x445221[_0xd9d3('0x58')]=_['intersection'](_0x445221[_0xd9d3('0x53')],_0x445221[_0xd9d3('0x3e')]);_0x2f89fb['attributes']=_[_0xd9d3('0x59')](_0x445221[_0xd9d3('0x53')],qs[_0xd9d3('0x5a')](_0x3e8d7e[_0xd9d3('0x3e')]['fields']));_0x2f89fb[_0xd9d3('0x44')]=_0x2f89fb[_0xd9d3('0x44')][_0xd9d3('0x48')]?_0x2f89fb['attributes']:_0x445221[_0xd9d3('0x53')];_0x2f89fb[_0xd9d3('0xc5')]=qs[_0xd9d3('0xc6')](_0x3e8d7e['query'][_0xd9d3('0xc6')]);_0x2f89fb['where']=qs[_0xd9d3('0x58')](_['pick'](_0x3e8d7e[_0xd9d3('0x3e')],_0x445221[_0xd9d3('0x58')]));if(_0x3e8d7e[_0xd9d3('0x3e')][_0xd9d3('0x30')]){_0x2f89fb[_0xd9d3('0xc7')]=_[_0xd9d3('0x5b')](_0x2f89fb[_0xd9d3('0xc7')],{'$or':_[_0xd9d3('0x32')](_0x2f89fb[_0xd9d3('0x44')],function(_0x235fcf){var _0x2e89ad={};_0x2e89ad[_0x235fcf]={'$like':'%'+_0x3e8d7e[_0xd9d3('0x3e')][_0xd9d3('0x30')]+'%'};return _0x2e89ad;})});}_0x2f89fb=_[_0xd9d3('0x5b')]({},_0x2f89fb,_0x3e8d7e[_0xd9d3('0x5c')]);return _0x1a21b8[_0xd9d3('0xd3')](_0x2f89fb);}})[_0xd9d3('0x13')](function(_0x5e7635){if(_0x5e7635){_0x474584=_0x5e7635[_0xd9d3('0x48')];if(!_0x3e8d7e[_0xd9d3('0x3e')][_0xd9d3('0xd5')](_0xd9d3('0xce'))){_0x2f89fb['limit']=qs[_0xd9d3('0x22')](_0x3e8d7e[_0xd9d3('0x3e')][_0xd9d3('0x22')]);_0x2f89fb[_0xd9d3('0x20')]=qs['offset'](_0x3e8d7e[_0xd9d3('0x3e')][_0xd9d3('0x20')]);}return _0x1a21b8[_0xd9d3('0xd3')](_0x2f89fb);}})[_0xd9d3('0x13')](function(_0x18b485){if(_0x18b485){return _0x18b485?{'count':_0x474584,'rows':_0x18b485}:null;}})[_0xd9d3('0x13')](respondWithResult(_0x55762f,null))[_0xd9d3('0x1c')](handleError(_0x55762f,null));};exports[_0xd9d3('0xd6')]=function(_0x305893,_0x46975e){var _0x3f8154={'raw':!![],'where':{}};var _0x2d985a={};var _0x22d2cd={'count':0x0,'rows':[]};return db[_0xd9d3('0x39')][_0xd9d3('0xcf')]({'where':{'id':_0x305893[_0xd9d3('0x52')]['id']}})[_0xd9d3('0x13')](handleEntityNotFound(_0x46975e,null))[_0xd9d3('0x13')](function(_0x533928){if(_0x533928){_0x2d985a[_0xd9d3('0x53')]=_[_0xd9d3('0x55')](db['VoiceRecording'][_0xd9d3('0x56')]);_0x2d985a[_0xd9d3('0x3e')]=_[_0xd9d3('0x55')](_0x305893[_0xd9d3('0x3e')]);_0x2d985a[_0xd9d3('0x58')]=_[_0xd9d3('0x59')](_0x2d985a[_0xd9d3('0x53')],_0x2d985a['query']);_0x3f8154[_0xd9d3('0x44')]=_[_0xd9d3('0x59')](_0x2d985a['model'],qs[_0xd9d3('0x5a')](_0x305893[_0xd9d3('0x3e')]['fields']));_0x3f8154['attributes']=_0x3f8154[_0xd9d3('0x44')]['length']?_0x3f8154[_0xd9d3('0x44')]:_0x2d985a[_0xd9d3('0x53')];if(!_0x305893['query'][_0xd9d3('0xd5')](_0xd9d3('0xce'))){_0x3f8154[_0xd9d3('0x22')]=qs[_0xd9d3('0x22')](_0x305893[_0xd9d3('0x3e')][_0xd9d3('0x22')]);_0x3f8154[_0xd9d3('0x20')]=qs[_0xd9d3('0x20')](_0x305893['query'][_0xd9d3('0x20')]);}_0x3f8154[_0xd9d3('0xc5')]=qs[_0xd9d3('0xc6')](_0x305893[_0xd9d3('0x3e')][_0xd9d3('0xc6')]);_0x3f8154[_0xd9d3('0xc7')]=qs[_0xd9d3('0x58')](_[_0xd9d3('0xc8')](_0x305893['query'],_0x2d985a[_0xd9d3('0x58')]));_0x3f8154['where'][_0xd9d3('0xd7')]=_0x533928['id'];if(_0x305893[_0xd9d3('0x3e')]['filter']){_0x3f8154[_0xd9d3('0xc7')]=_[_0xd9d3('0x5b')](_0x3f8154[_0xd9d3('0xc7')],{'$or':_[_0xd9d3('0x32')](_0x3f8154[_0xd9d3('0x44')],function(_0x2f6727){var _0x27452d={};_0x27452d[_0x2f6727]={'$like':'%'+_0x305893[_0xd9d3('0x3e')][_0xd9d3('0x30')]+'%'};return _0x27452d;})});}_0x3f8154=_[_0xd9d3('0x5b')]({},_0x3f8154,_0x305893[_0xd9d3('0x5c')]);return db['VoiceRecording'][_0xd9d3('0x23')]({'where':_0x3f8154[_0xd9d3('0xc7')]})[_0xd9d3('0x13')](function(_0x24383f){_0x22d2cd[_0xd9d3('0x23')]=_0x24383f;if(_0x305893[_0xd9d3('0x3e')][_0xd9d3('0x3f')]){_0x3f8154[_0xd9d3('0x40')]=[{'all':!![]}];}return db[_0xd9d3('0xd8')][_0xd9d3('0x46')](_0x3f8154);})[_0xd9d3('0x13')](function(_0x3dcb05){_0x22d2cd['rows']=_0x3dcb05;return _0x22d2cd;});}})['then'](respondWithFilteredResult(_0x46975e,_0x3f8154))['catch'](handleError(_0x46975e,null));};exports[_0xd9d3('0xd9')]=function(_0x2fc7e8,_0x5f5be6){var _0xd82e0={'raw':!![],'where':{}};var _0x5a4f0d={};var _0x232750={'count':0x0,'rows':[]};return db[_0xd9d3('0x39')][_0xd9d3('0xcf')]({'where':{'id':_0x2fc7e8['params']['id']}})['then'](handleEntityNotFound(_0x5f5be6,null))['then'](function(_0xdc5470){if(_0xdc5470){_0x5a4f0d[_0xd9d3('0x53')]=_[_0xd9d3('0x55')](db[_0xd9d3('0xda')][_0xd9d3('0x56')]);_0x5a4f0d[_0xd9d3('0x3e')]=_[_0xd9d3('0x55')](_0x2fc7e8[_0xd9d3('0x3e')]);_0x5a4f0d[_0xd9d3('0x58')]=_['intersection'](_0x5a4f0d[_0xd9d3('0x53')],_0x5a4f0d[_0xd9d3('0x3e')]);_0xd82e0['attributes']=_['intersection'](_0x5a4f0d[_0xd9d3('0x53')],qs['fields'](_0x2fc7e8['query'][_0xd9d3('0x5a')]));_0xd82e0[_0xd9d3('0x44')]=_0xd82e0[_0xd9d3('0x44')][_0xd9d3('0x48')]?_0xd82e0['attributes']:_0x5a4f0d[_0xd9d3('0x53')];if(!_0x2fc7e8['query'][_0xd9d3('0xd5')](_0xd9d3('0xce'))){_0xd82e0[_0xd9d3('0x22')]=qs[_0xd9d3('0x22')](_0x2fc7e8[_0xd9d3('0x3e')][_0xd9d3('0x22')]);_0xd82e0[_0xd9d3('0x20')]=qs[_0xd9d3('0x20')](_0x2fc7e8['query']['offset']);}_0xd82e0[_0xd9d3('0xc5')]=qs[_0xd9d3('0xc6')](_0x2fc7e8[_0xd9d3('0x3e')][_0xd9d3('0xc6')]);_0xd82e0[_0xd9d3('0xc7')]=qs[_0xd9d3('0x58')](_['pick'](_0x2fc7e8[_0xd9d3('0x3e')],_0x5a4f0d['filters']));_0xd82e0['where']['UserId']=_0xdc5470['id'];if(_0x2fc7e8[_0xd9d3('0x3e')]['filter']){_0xd82e0[_0xd9d3('0xc7')]=_[_0xd9d3('0x5b')](_0xd82e0['where'],{'$or':_[_0xd9d3('0x32')](_0xd82e0['attributes'],function(_0x3c88fd){var _0x3187a8={};_0x3187a8[_0x3c88fd]={'$like':'%'+_0x2fc7e8['query']['filter']+'%'};return _0x3187a8;})});}_0xd82e0=_[_0xd9d3('0x5b')]({},_0xd82e0,_0x2fc7e8[_0xd9d3('0x5c')]);return db[_0xd9d3('0xda')][_0xd9d3('0x23')]({'where':_0xd82e0['where']})['then'](function(_0xf66d1d){_0x232750['count']=_0xf66d1d;if(_0x2fc7e8[_0xd9d3('0x3e')][_0xd9d3('0x3f')]){_0xd82e0['include']=[{'all':!![]}];}return db[_0xd9d3('0xda')][_0xd9d3('0x46')](_0xd82e0);})[_0xd9d3('0x13')](function(_0x364131){_0x232750[_0xd9d3('0x47')]=_0x364131;return _0x232750;});}})[_0xd9d3('0x13')](respondWithFilteredResult(_0x5f5be6,_0xd82e0))[_0xd9d3('0x1c')](handleError(_0x5f5be6,null));};exports[_0xd9d3('0xdb')]=function(_0x462e3b,_0x44ea62){var _0x50709b={};var _0x2eb593={};var _0x209fc6;var _0x2f6c6c;return db[_0xd9d3('0x39')][_0xd9d3('0xcf')]({'where':{'id':_0x462e3b[_0xd9d3('0x52')]['id']}})['then'](handleEntityNotFound(_0x44ea62,null))['then'](function(_0x2498a8){if(_0x2498a8){_0x209fc6=_0x2498a8;_0x2eb593[_0xd9d3('0x53')]=_[_0xd9d3('0x55')](db[_0xd9d3('0xdc')][_0xd9d3('0x56')]);_0x2eb593[_0xd9d3('0x3e')]=_[_0xd9d3('0x55')](_0x462e3b['query']);_0x2eb593[_0xd9d3('0x58')]=_[_0xd9d3('0x59')](_0x2eb593[_0xd9d3('0x53')],_0x2eb593[_0xd9d3('0x3e')]);_0x50709b['attributes']=_['intersection'](_0x2eb593[_0xd9d3('0x53')],qs[_0xd9d3('0x5a')](_0x462e3b['query']['fields']));_0x50709b[_0xd9d3('0x44')]=_0x50709b['attributes']['length']?_0x50709b[_0xd9d3('0x44')]:_0x2eb593[_0xd9d3('0x53')];_0x50709b[_0xd9d3('0xc5')]=qs['sort'](_0x462e3b[_0xd9d3('0x3e')]['sort']);_0x50709b[_0xd9d3('0xc7')]=qs[_0xd9d3('0x58')](_[_0xd9d3('0xc8')](_0x462e3b[_0xd9d3('0x3e')],_0x2eb593['filters']));if(_0x462e3b[_0xd9d3('0x3e')]['filter']){_0x50709b['where']=_['merge'](_0x50709b[_0xd9d3('0xc7')],{'$or':_[_0xd9d3('0x32')](_0x50709b[_0xd9d3('0x44')],function(_0x530c4d){var _0x4aef23={};_0x4aef23[_0x530c4d]={'$like':'%'+_0x462e3b[_0xd9d3('0x3e')][_0xd9d3('0x30')]+'%'};return _0x4aef23;})});}_0x50709b=_[_0xd9d3('0x5b')]({},_0x50709b,_0x462e3b[_0xd9d3('0x5c')]);return _0x209fc6['getChatInteractions'](_0x50709b);}})[_0xd9d3('0x13')](function(_0x2c3750){if(_0x2c3750){_0x2f6c6c=_0x2c3750['length'];if(!_0x462e3b[_0xd9d3('0x3e')]['hasOwnProperty'](_0xd9d3('0xce'))){_0x50709b[_0xd9d3('0x22')]=qs[_0xd9d3('0x22')](_0x462e3b['query'][_0xd9d3('0x22')]);_0x50709b[_0xd9d3('0x20')]=qs[_0xd9d3('0x20')](_0x462e3b[_0xd9d3('0x3e')][_0xd9d3('0x20')]);}return _0x209fc6[_0xd9d3('0xdb')](_0x50709b);}})[_0xd9d3('0x13')](function(_0xe6ec58){if(_0xe6ec58){return _0xe6ec58?{'count':_0x2f6c6c,'rows':_0xe6ec58}:null;}})[_0xd9d3('0x13')](respondWithResult(_0x44ea62,null))[_0xd9d3('0x1c')](handleError(_0x44ea62,null));};exports['getOpenchannelInteractions']=function(_0x5582af,_0x253545){var _0xe2945e={};var _0x3b006b={};var _0x5baa97;var _0x9bc986;return db['User'][_0xd9d3('0xcf')]({'where':{'id':_0x5582af[_0xd9d3('0x52')]['id']}})['then'](handleEntityNotFound(_0x253545,null))[_0xd9d3('0x13')](function(_0x2fb910){if(_0x2fb910){_0x5baa97=_0x2fb910;_0x3b006b[_0xd9d3('0x53')]=_['keys'](db[_0xd9d3('0xdd')]['rawAttributes']);_0x3b006b[_0xd9d3('0x3e')]=_[_0xd9d3('0x55')](_0x5582af[_0xd9d3('0x3e')]);_0x3b006b[_0xd9d3('0x58')]=_['intersection'](_0x3b006b['model'],_0x3b006b[_0xd9d3('0x3e')]);_0xe2945e[_0xd9d3('0x44')]=_[_0xd9d3('0x59')](_0x3b006b[_0xd9d3('0x53')],qs['fields'](_0x5582af[_0xd9d3('0x3e')][_0xd9d3('0x5a')]));_0xe2945e[_0xd9d3('0x44')]=_0xe2945e[_0xd9d3('0x44')]['length']?_0xe2945e[_0xd9d3('0x44')]:_0x3b006b[_0xd9d3('0x53')];_0xe2945e[_0xd9d3('0xc5')]=qs[_0xd9d3('0xc6')](_0x5582af['query'][_0xd9d3('0xc6')]);_0xe2945e[_0xd9d3('0xc7')]=qs[_0xd9d3('0x58')](_[_0xd9d3('0xc8')](_0x5582af[_0xd9d3('0x3e')],_0x3b006b[_0xd9d3('0x58')]));if(_0x5582af[_0xd9d3('0x3e')][_0xd9d3('0x30')]){_0xe2945e[_0xd9d3('0xc7')]=_[_0xd9d3('0x5b')](_0xe2945e['where'],{'$or':_[_0xd9d3('0x32')](_0xe2945e[_0xd9d3('0x44')],function(_0x26ac3c){var _0x496ca9={};_0x496ca9[_0x26ac3c]={'$like':'%'+_0x5582af[_0xd9d3('0x3e')][_0xd9d3('0x30')]+'%'};return _0x496ca9;})});}_0xe2945e=_[_0xd9d3('0x5b')]({},_0xe2945e,_0x5582af[_0xd9d3('0x5c')]);return _0x5baa97[_0xd9d3('0xde')](_0xe2945e);}})[_0xd9d3('0x13')](function(_0x5b1bab){if(_0x5b1bab){_0x9bc986=_0x5b1bab[_0xd9d3('0x48')];if(!_0x5582af['query'][_0xd9d3('0xd5')]('nolimit')){_0xe2945e[_0xd9d3('0x22')]=qs[_0xd9d3('0x22')](_0x5582af[_0xd9d3('0x3e')][_0xd9d3('0x22')]);_0xe2945e[_0xd9d3('0x20')]=qs['offset'](_0x5582af[_0xd9d3('0x3e')][_0xd9d3('0x20')]);}return _0x5baa97[_0xd9d3('0xde')](_0xe2945e);}})['then'](function(_0x2801c7){if(_0x2801c7){return _0x2801c7?{'count':_0x9bc986,'rows':_0x2801c7}:null;}})[_0xd9d3('0x13')](respondWithResult(_0x253545,null))[_0xd9d3('0x1c')](handleError(_0x253545,null));};exports['getMailInteractions']=function(_0x135514,_0x26a3b5){var _0x1e4ceb={'raw':!![],'where':{}};var _0x12e2f1={};var _0xb8a6c6={'count':0x0,'rows':[]};return db[_0xd9d3('0x39')]['findOne']({'where':{'id':_0x135514[_0xd9d3('0x52')]['id']}})['then'](handleEntityNotFound(_0x26a3b5,null))[_0xd9d3('0x13')](function(_0x71f871){if(_0x71f871){_0x12e2f1[_0xd9d3('0x53')]=_[_0xd9d3('0x55')](db[_0xd9d3('0xdf')][_0xd9d3('0x56')]);_0x12e2f1[_0xd9d3('0x3e')]=_['keys'](_0x135514[_0xd9d3('0x3e')]);_0x12e2f1[_0xd9d3('0x58')]=_[_0xd9d3('0x59')](_0x12e2f1[_0xd9d3('0x53')],_0x12e2f1[_0xd9d3('0x3e')]);_0x1e4ceb[_0xd9d3('0x44')]=_[_0xd9d3('0x59')](_0x12e2f1[_0xd9d3('0x53')],qs[_0xd9d3('0x5a')](_0x135514['query'][_0xd9d3('0x5a')]));_0x1e4ceb['attributes']=_0x1e4ceb[_0xd9d3('0x44')][_0xd9d3('0x48')]?_0x1e4ceb['attributes']:_0x12e2f1['model'];if(!_0x135514[_0xd9d3('0x3e')][_0xd9d3('0xd5')](_0xd9d3('0xce'))){_0x1e4ceb[_0xd9d3('0x22')]=qs[_0xd9d3('0x22')](_0x135514[_0xd9d3('0x3e')][_0xd9d3('0x22')]);_0x1e4ceb[_0xd9d3('0x20')]=qs[_0xd9d3('0x20')](_0x135514[_0xd9d3('0x3e')][_0xd9d3('0x20')]);}_0x1e4ceb['order']=qs[_0xd9d3('0xc6')](_0x135514[_0xd9d3('0x3e')][_0xd9d3('0xc6')]);_0x1e4ceb[_0xd9d3('0xc7')]=qs[_0xd9d3('0x58')](_['pick'](_0x135514['query'],_0x12e2f1[_0xd9d3('0x58')]));_0x1e4ceb[_0xd9d3('0xc7')]['UserId']=_0x71f871['id'];if(_0x135514[_0xd9d3('0x3e')]['filter']){_0x1e4ceb[_0xd9d3('0xc7')]=_['merge'](_0x1e4ceb[_0xd9d3('0xc7')],{'$or':_[_0xd9d3('0x32')](_0x1e4ceb[_0xd9d3('0x44')],function(_0x2c2515){var _0x34eabb={};_0x34eabb[_0x2c2515]={'$like':'%'+_0x135514['query']['filter']+'%'};return _0x34eabb;})});}_0x1e4ceb=_['merge']({},_0x1e4ceb,_0x135514[_0xd9d3('0x5c')]);return db[_0xd9d3('0xdf')][_0xd9d3('0x23')]({'where':_0x1e4ceb[_0xd9d3('0xc7')]})[_0xd9d3('0x13')](function(_0x9df2ac){_0xb8a6c6['count']=_0x9df2ac;if(_0x135514[_0xd9d3('0x3e')][_0xd9d3('0x3f')]){_0x1e4ceb[_0xd9d3('0x40')]=[{'all':!![]}];}return db[_0xd9d3('0xdf')]['findAll'](_0x1e4ceb);})[_0xd9d3('0x13')](function(_0x3aee1b){_0xb8a6c6['rows']=_0x3aee1b;return _0xb8a6c6;});}})[_0xd9d3('0x13')](respondWithFilteredResult(_0x26a3b5,_0x1e4ceb))[_0xd9d3('0x1c')](handleError(_0x26a3b5,null));};exports['getSmsInteractions']=function(_0xdfce88,_0x1b60c6){var _0x28e811={};var _0x466bf1={};var _0x49c6f7;var _0x11ae9f;return db[_0xd9d3('0x39')][_0xd9d3('0xcf')]({'where':{'id':_0xdfce88[_0xd9d3('0x52')]['id']}})[_0xd9d3('0x13')](handleEntityNotFound(_0x1b60c6,null))['then'](function(_0x3440b6){if(_0x3440b6){_0x49c6f7=_0x3440b6;_0x466bf1['model']=_[_0xd9d3('0x55')](db[_0xd9d3('0xe0')][_0xd9d3('0x56')]);_0x466bf1['query']=_[_0xd9d3('0x55')](_0xdfce88[_0xd9d3('0x3e')]);_0x466bf1[_0xd9d3('0x58')]=_[_0xd9d3('0x59')](_0x466bf1[_0xd9d3('0x53')],_0x466bf1[_0xd9d3('0x3e')]);_0x28e811[_0xd9d3('0x44')]=_['intersection'](_0x466bf1['model'],qs[_0xd9d3('0x5a')](_0xdfce88[_0xd9d3('0x3e')][_0xd9d3('0x5a')]));_0x28e811['attributes']=_0x28e811[_0xd9d3('0x44')][_0xd9d3('0x48')]?_0x28e811[_0xd9d3('0x44')]:_0x466bf1['model'];_0x28e811[_0xd9d3('0xc5')]=qs[_0xd9d3('0xc6')](_0xdfce88[_0xd9d3('0x3e')][_0xd9d3('0xc6')]);_0x28e811[_0xd9d3('0xc7')]=qs[_0xd9d3('0x58')](_['pick'](_0xdfce88[_0xd9d3('0x3e')],_0x466bf1[_0xd9d3('0x58')]));if(_0xdfce88[_0xd9d3('0x3e')][_0xd9d3('0x30')]){_0x28e811[_0xd9d3('0xc7')]=_[_0xd9d3('0x5b')](_0x28e811[_0xd9d3('0xc7')],{'$or':_['map'](_0x28e811[_0xd9d3('0x44')],function(_0x4c6eea){var _0x479c80={};_0x479c80[_0x4c6eea]={'$like':'%'+_0xdfce88[_0xd9d3('0x3e')]['filter']+'%'};return _0x479c80;})});}_0x28e811=_[_0xd9d3('0x5b')]({},_0x28e811,_0xdfce88[_0xd9d3('0x5c')]);return _0x49c6f7['getSmsInteractions'](_0x28e811);}})[_0xd9d3('0x13')](function(_0x1d8f09){if(_0x1d8f09){_0x11ae9f=_0x1d8f09[_0xd9d3('0x48')];if(!_0xdfce88[_0xd9d3('0x3e')][_0xd9d3('0xd5')]('nolimit')){_0x28e811[_0xd9d3('0x22')]=qs[_0xd9d3('0x22')](_0xdfce88['query'][_0xd9d3('0x22')]);_0x28e811[_0xd9d3('0x20')]=qs['offset'](_0xdfce88[_0xd9d3('0x3e')][_0xd9d3('0x20')]);}return _0x49c6f7[_0xd9d3('0xe1')](_0x28e811);}})[_0xd9d3('0x13')](function(_0x5ed421){if(_0x5ed421){return _0x5ed421?{'count':_0x11ae9f,'rows':_0x5ed421}:null;}})[_0xd9d3('0x13')](respondWithResult(_0x1b60c6,null))['catch'](handleError(_0x1b60c6,null));};exports[_0xd9d3('0xe2')]=function(_0x5aa602,_0x2d41fd){var _0x390bc3={};var _0x10565c={};var _0x149583;var _0x44b252;return db[_0xd9d3('0x39')][_0xd9d3('0xcf')]({'where':{'id':_0x5aa602['params']['id']}})['then'](handleEntityNotFound(_0x2d41fd,null))[_0xd9d3('0x13')](function(_0xd0024f){if(_0xd0024f){_0x149583=_0xd0024f;_0x10565c[_0xd9d3('0x53')]=_['keys'](db['FaxInteraction'][_0xd9d3('0x56')]);_0x10565c['query']=_[_0xd9d3('0x55')](_0x5aa602[_0xd9d3('0x3e')]);_0x10565c[_0xd9d3('0x58')]=_[_0xd9d3('0x59')](_0x10565c['model'],_0x10565c[_0xd9d3('0x3e')]);_0x390bc3[_0xd9d3('0x44')]=_[_0xd9d3('0x59')](_0x10565c['model'],qs[_0xd9d3('0x5a')](_0x5aa602[_0xd9d3('0x3e')]['fields']));_0x390bc3['attributes']=_0x390bc3[_0xd9d3('0x44')][_0xd9d3('0x48')]?_0x390bc3[_0xd9d3('0x44')]:_0x10565c[_0xd9d3('0x53')];_0x390bc3['order']=qs[_0xd9d3('0xc6')](_0x5aa602[_0xd9d3('0x3e')][_0xd9d3('0xc6')]);_0x390bc3['where']=qs['filters'](_['pick'](_0x5aa602[_0xd9d3('0x3e')],_0x10565c[_0xd9d3('0x58')]));if(_0x5aa602['query'][_0xd9d3('0x30')]){_0x390bc3[_0xd9d3('0xc7')]=_[_0xd9d3('0x5b')](_0x390bc3[_0xd9d3('0xc7')],{'$or':_['map'](_0x390bc3[_0xd9d3('0x44')],function(_0x3f3ecc){var _0x3bd53b={};_0x3bd53b[_0x3f3ecc]={'$like':'%'+_0x5aa602[_0xd9d3('0x3e')][_0xd9d3('0x30')]+'%'};return _0x3bd53b;})});}_0x390bc3=_[_0xd9d3('0x5b')]({},_0x390bc3,_0x5aa602['options']);return _0x149583[_0xd9d3('0xe2')](_0x390bc3);}})[_0xd9d3('0x13')](function(_0x2bd10b){if(_0x2bd10b){_0x44b252=_0x2bd10b[_0xd9d3('0x48')];if(!_0x5aa602[_0xd9d3('0x3e')][_0xd9d3('0xd5')](_0xd9d3('0xce'))){_0x390bc3[_0xd9d3('0x22')]=qs[_0xd9d3('0x22')](_0x5aa602[_0xd9d3('0x3e')][_0xd9d3('0x22')]);_0x390bc3['offset']=qs['offset'](_0x5aa602[_0xd9d3('0x3e')][_0xd9d3('0x20')]);}return _0x149583['getFaxInteractions'](_0x390bc3);}})[_0xd9d3('0x13')](function(_0xe5347e){if(_0xe5347e){return _0xe5347e?{'count':_0x44b252,'rows':_0xe5347e}:null;}})['then'](respondWithResult(_0x2d41fd,null))['catch'](handleError(_0x2d41fd,null));};exports[_0xd9d3('0xe3')]=function(_0x121370,_0x3850a4){var _0x2c5fbd={};var _0x388ffa={};var _0x4d3ae6;var _0x332352;return db[_0xd9d3('0x39')][_0xd9d3('0xcf')]({'where':{'id':_0x121370[_0xd9d3('0x52')]['id']}})[_0xd9d3('0x13')](handleEntityNotFound(_0x3850a4,null))['then'](function(_0x44510e){if(_0x44510e){_0x4d3ae6=_0x44510e;_0x388ffa[_0xd9d3('0x53')]=_[_0xd9d3('0x55')](db['WhatsappInteraction'][_0xd9d3('0x56')]);_0x388ffa[_0xd9d3('0x3e')]=_['keys'](_0x121370[_0xd9d3('0x3e')]);_0x388ffa[_0xd9d3('0x58')]=_[_0xd9d3('0x59')](_0x388ffa[_0xd9d3('0x53')],_0x388ffa[_0xd9d3('0x3e')]);_0x2c5fbd[_0xd9d3('0x44')]=_[_0xd9d3('0x59')](_0x388ffa['model'],qs[_0xd9d3('0x5a')](_0x121370[_0xd9d3('0x3e')]['fields']));_0x2c5fbd[_0xd9d3('0x44')]=_0x2c5fbd[_0xd9d3('0x44')]['length']?_0x2c5fbd['attributes']:_0x388ffa[_0xd9d3('0x53')];_0x2c5fbd[_0xd9d3('0xc5')]=qs['sort'](_0x121370['query'][_0xd9d3('0xc6')]);_0x2c5fbd[_0xd9d3('0xc7')]=qs[_0xd9d3('0x58')](_[_0xd9d3('0xc8')](_0x121370['query'],_0x388ffa[_0xd9d3('0x58')]));if(_0x121370[_0xd9d3('0x3e')][_0xd9d3('0x30')]){_0x2c5fbd[_0xd9d3('0xc7')]=_[_0xd9d3('0x5b')](_0x2c5fbd[_0xd9d3('0xc7')],{'$or':_[_0xd9d3('0x32')](_0x2c5fbd[_0xd9d3('0x44')],function(_0x1c9c13){var _0x7d7ed1={};_0x7d7ed1[_0x1c9c13]={'$like':'%'+_0x121370[_0xd9d3('0x3e')][_0xd9d3('0x30')]+'%'};return _0x7d7ed1;})});}_0x2c5fbd=_[_0xd9d3('0x5b')]({},_0x2c5fbd,_0x121370[_0xd9d3('0x5c')]);return _0x4d3ae6[_0xd9d3('0xe3')](_0x2c5fbd);}})[_0xd9d3('0x13')](function(_0x584983){if(_0x584983){_0x332352=_0x584983[_0xd9d3('0x48')];if(!_0x121370[_0xd9d3('0x3e')][_0xd9d3('0xd5')](_0xd9d3('0xce'))){_0x2c5fbd[_0xd9d3('0x22')]=qs['limit'](_0x121370['query']['limit']);_0x2c5fbd[_0xd9d3('0x20')]=qs['offset'](_0x121370[_0xd9d3('0x3e')]['offset']);}return _0x4d3ae6[_0xd9d3('0xe3')](_0x2c5fbd);}})[_0xd9d3('0x13')](function(_0x2e87a4){if(_0x2e87a4){return _0x2e87a4?{'count':_0x332352,'rows':_0x2e87a4}:null;}})['then'](respondWithResult(_0x3850a4,null))[_0xd9d3('0x1c')](handleError(_0x3850a4,null));};exports[_0xd9d3('0xe4')]=function(_0x3c7529,_0x53faa6,_0x345f51){var _0x99db81;var _0x376488;var _0x4e87dd;var _0x125c60=!_['isNil'](_0x3c7529[_0xd9d3('0x52')]['id'])?_0x3c7529[_0xd9d3('0x52')]['id']:!_[_0xd9d3('0x67')](_0x3c7529[_0xd9d3('0x2c')]['id'])?_0x3c7529['user']['id']:null;return db[_0xd9d3('0x39')][_0xd9d3('0x35')]({'where':{'id':_0x125c60,'role':{'$or':['admin',_0xd9d3('0x2c'),_0xd9d3('0x2e')]}},'attributes':['id',_0xd9d3('0x37'),'phone',_0xd9d3('0xe5'),_0xd9d3('0x29'),_0xd9d3('0x65'),_0xd9d3('0x9a')]})[_0xd9d3('0x13')](function(_0x403f9d){if(_0x403f9d){if(_0x403f9d[_0xd9d3('0x29')]==='agent'){_0x99db81=_0x403f9d;if(_0x3c7529[_0xd9d3('0x5e')][_0xd9d3('0x9b')]){_0x4e87dd=util[_0xd9d3('0xa8')](_0xd9d3('0xe6'),_0x99db81[_0x3c7529['body']['interface']]);}else if(_0x3c7529[_0xd9d3('0x5e')][_0xd9d3('0xe7')]){_0x4e87dd=util[_0xd9d3('0xa8')](_0xd9d3('0xa9'),_0x3c7529[_0xd9d3('0x5e')]['intrf']);}else{_0x4e87dd=util[_0xd9d3('0xa8')](_0xd9d3('0xa9'),_0x99db81[_0xd9d3('0x37')]);}socket['to'](util['format'](_0xd9d3('0xe8'),_0x99db81[_0xd9d3('0x37')]))[_0xd9d3('0xb0')](_0xd9d3('0xe9'),{'user':{'id':_0x99db81['id'],'name':_0x99db81['name']},'ip':_0x3c7529[_0xd9d3('0xea')][_0xd9d3('0xeb')]||_0x3c7529[_0xd9d3('0xec')][_0xd9d3('0xed')]||_0x3c7529[_0xd9d3('0xee')][_0xd9d3('0xed')]||_0x3c7529['connection'][_0xd9d3('0xee')]['remoteAddress']});return db[_0xd9d3('0xab')][_0xd9d3('0x28')]({'where':{'membername':_0x99db81[_0xd9d3('0x37')]},'individualHooks':!![]});}}else{throw new db[(_0xd9d3('0x8a'))][(_0xd9d3('0x8b'))](_0xd9d3('0xef'));}})[_0xd9d3('0x13')](function(){if(_0x99db81){return _0x99db81[_0xd9d3('0xf0')]({'raw':!![]});}})['then'](function(_0x2e78ed){if(_0x99db81){var _0x2bc213=[];if(_0x2e78ed){_0x376488=_0x2e78ed;if(_0x376488[_0xd9d3('0x48')]){for(var _0x2a57af=0x0;_0x2a57af<_0x376488[_0xd9d3('0x48')];_0x2a57af++){_0x2bc213[_0xd9d3('0x45')]({'membername':_0x99db81['name'],'UserId':_0x99db81['id'],'queue_name':_0x376488[_0x2a57af][_0xd9d3('0x37')],'VoiceQueueId':_0x376488[_0x2a57af]['id'],'interface':_0x4e87dd,'paused':_0x99db81[_0xd9d3('0x9a')]||![],'penalty':_0x376488[_0x2a57af][_0xd9d3('0xf1')]||0x0});}return BPromise[_0xd9d3('0x84')](_0x2bc213,function(_0x8a822d){return db['UserVoiceQueueRt']['upsert'](_0x8a822d);});}}}})[_0xd9d3('0x13')](function(){if(_0x99db81){return db[_0xd9d3('0xf2')][_0xd9d3('0x46')]({'where':{'membername':_0x99db81['name'],'exitAt':null}});}})['then'](function(_0x45e447){if(_0x99db81){var _0x89e7a=[];_0x45e447['forEach'](function(_0x26e5c3){_0x89e7a[_0xd9d3('0x45')](_0x26e5c3['update']({'exitAt':moment()[_0xd9d3('0xa8')](_0xd9d3('0xf3'))}));});return BPromise[_0xd9d3('0x50')](_0x89e7a);}})[_0xd9d3('0x13')](function(){if(_0x99db81){var _0x47cd3b=[];var _0xa58738=[];var _0xae4830=utils['getChannels']();var _0x5b1fe4={'membername':_0x99db81[_0xd9d3('0x37')],'interface':_0x4e87dd,'enterAt':moment()['format'](_0xd9d3('0xf3')),'role':_0x99db81['role'],'internal':_0x99db81[_0xd9d3('0x65')]};_0xae4830[_0xd9d3('0xf4')](function(_0x1fe6f6){_0x47cd3b['push'](_[_0xd9d3('0x5b')]({'channel':_0x1fe6f6,'type':_0xd9d3('0xf5'),'data1':_0x3c7529[_0xd9d3('0x5e')][_0xd9d3('0xf6')],'data2':_0x4e87dd},_0x5b1fe4));if(_0x99db81[_0xd9d3('0x9a')]){_0xa58738[_0xd9d3('0x45')](_[_0xd9d3('0x5b')]({'channel':_0x1fe6f6,'type':_0xd9d3('0xf7'),'data1':'LOGININPAUSE'},_0x5b1fe4));}});return db[_0xd9d3('0xf2')][_0xd9d3('0x81')](_0x47cd3b[_0xd9d3('0xc2')](_0xa58738),{'individualHooks':!![]});}})[_0xd9d3('0x13')](function(){if(_0x99db81){return _0x99db81['update']({'online':!![],'lastLoginAt':moment()[_0xd9d3('0xa8')](_0xd9d3('0xf3')),'voicePause':_0x99db81[_0xd9d3('0x9a')]||![],'mailPause':_0x99db81[_0xd9d3('0x9a')]||![],'chatPause':_0x99db81[_0xd9d3('0x9a')]||![],'faxPause':_0x99db81['loginInPause']||![],'smsPause':_0x99db81[_0xd9d3('0x9a')]||![],'openchannelPause':_0x99db81['loginInPause']||![],'whatsappPause':_0x99db81['loginInPause']||![],'pauseType':_0x99db81['loginInPause']?_0xd9d3('0xf8'):null,'interface':_0x4e87dd,'lastPauseAt':moment()['format'](_0xd9d3('0xf3'))});}})['then'](function(_0x44d5da){if(_0x3c7529['isMiddleware']){return _0x345f51();}else{return BPromise['resolve'](_0x44d5da)['then'](respondWithResult(_0x53faa6,null));}})[_0xd9d3('0x1c')](handleError(_0x53faa6,null));};exports[_0xd9d3('0xf9')]=function(_0x4479b2,_0x58a87d){var _0x20670e;return db[_0xd9d3('0x39')][_0xd9d3('0x35')]({'where':{'id':_0x4479b2[_0xd9d3('0x52')]['id'],'role':'agent'},'attributes':['id',_0xd9d3('0x37'),_0xd9d3('0x29')]})[_0xd9d3('0x13')](handleEntityNotFound(_0x58a87d,null))[_0xd9d3('0x13')](function(_0x4c9b8c){if(_0x4c9b8c){_0x20670e=_0x4c9b8c;return db[_0xd9d3('0xab')][_0xd9d3('0x28')]({'where':{'membername':_0x20670e[_0xd9d3('0x37')]},'individualHooks':!![]});}})[_0xd9d3('0x13')](function(){return db[_0xd9d3('0xf2')][_0xd9d3('0x46')]({'where':{'membername':_0x20670e['name'],'exitAt':null}});})[_0xd9d3('0x13')](function(_0x2f838a){var _0x128e54=[];_0x2f838a['forEach'](function(_0x4e555b){_0x128e54['push'](_0x4e555b[_0xd9d3('0x27')]({'exitAt':moment()[_0xd9d3('0xa8')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0xd9d3('0x50')](_0x128e54);})['then'](function(){return _0x20670e[_0xd9d3('0x27')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})['then'](respondWithResult(_0x58a87d,null))[_0xd9d3('0x1c')](handleError(_0x58a87d,null));};exports['pause']=function(_0x380baf,_0x221a46){var _0x529643;return db[_0xd9d3('0xab')]['update']({'paused':0x1},{'where':{'UserId':_0x380baf[_0xd9d3('0x52')]['id']},'individualHooks':!![]})[_0xd9d3('0x13')](function(){return db[_0xd9d3('0x39')][_0xd9d3('0x35')]({'where':{'id':_0x380baf[_0xd9d3('0x52')]['id'],'role':_0xd9d3('0x2e')},'attributes':['id',_0xd9d3('0x37'),'role',_0xd9d3('0x65'),'interface']});})[_0xd9d3('0x13')](handleEntityNotFound(_0x221a46,null))[_0xd9d3('0x13')](function(_0x80bb9a){if(_0x80bb9a){_0x529643=_0x80bb9a;return respondWithRpcPromise(_0xd9d3('0xfa'),_0xd9d3('0xfb'),{'id':_0x529643['id'],'name':_0x529643[_0xd9d3('0x37')],'pause':!![]});}})[_0xd9d3('0x13')](function(){if(_0x529643){return db['MemberReport'][_0xd9d3('0x46')]({'where':{'membername':_0x529643[_0xd9d3('0x37')],'type':'PAUSE','exitAt':null}});}})[_0xd9d3('0x13')](function(_0x4b2c9f){if(_0x4b2c9f['length']){var _0x3fc270=moment()['format'](_0xd9d3('0xf3'));for(var _0x244c3b=0x0,_0x4ae023=_0x4b2c9f['length'];_0x244c3b<_0x4ae023;_0x244c3b++){_0x4b2c9f[_0x244c3b][_0xd9d3('0xfc')]({'exitAt':_0x3fc270});}}})[_0xd9d3('0x13')](function(){var _0x6dae0f=[];var _0x283771=utils['getChannels']();_0x283771[_0xd9d3('0xf4')](function(_0x14d932){_0x6dae0f[_0xd9d3('0x45')]({'channel':_0x14d932,'membername':_0x529643[_0xd9d3('0x37')],'interface':_['isNil'](_0x529643[_0xd9d3('0x9b')])?util[_0xd9d3('0xa8')](_0xd9d3('0xa9'),_0x529643['name']):_0x529643['interface'],'type':_0xd9d3('0xf7'),'enterAt':moment()['format'](_0xd9d3('0xf3')),'data1':_0x380baf[_0xd9d3('0x5e')][_0xd9d3('0xfd')]||'DEFAULT\x20PAUSE','role':_0x529643[_0xd9d3('0x29')],'internal':_0x529643['internal']});});return db[_0xd9d3('0xf2')]['bulkCreate'](_0x6dae0f,{'individualHooks':!![]});})[_0xd9d3('0x13')](function(){return _0x529643[_0xd9d3('0x27')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x380baf[_0xd9d3('0x5e')][_0xd9d3('0xfd')]||_0xd9d3('0xfe'),'lastPauseAt':moment()[_0xd9d3('0xa8')](_0xd9d3('0xf3'))});})[_0xd9d3('0x13')](respondWithResult(_0x221a46,null))[_0xd9d3('0x1c')](handleError(_0x221a46,null));};exports[_0xd9d3('0xff')]=function(_0x227869,_0x4b209a){var _0x3d906f;return db[_0xd9d3('0x39')][_0xd9d3('0x35')]({'where':{'id':_0x227869[_0xd9d3('0x52')]['id']},'attributes':['id',_0xd9d3('0x37'),_0xd9d3('0x29'),_0xd9d3('0xaa'),'mailPause','chatPause',_0xd9d3('0x100'),_0xd9d3('0x101'),_0xd9d3('0x102'),_0xd9d3('0x103'),'pauseType',_0xd9d3('0x104')]})[_0xd9d3('0x13')](handleEntityNotFound(_0x4b209a,null))['then'](function(_0x23e9d1){if(_0x23e9d1){_0x3d906f=_0x23e9d1;if(_0x227869[_0xd9d3('0x5e')][_0xd9d3('0x98')]&&!utils[_0xd9d3('0x9c')](_0x227869[_0xd9d3('0x5e')][_0xd9d3('0x98')])){throw new db['Sequelize'][(_0xd9d3('0x8b'))](_0xd9d3('0x9d'));}switch(_0x227869[_0xd9d3('0x5e')][_0xd9d3('0x98')]){case _0xd9d3('0xa7'):return respondWithRpcPromise(_0xd9d3('0xfa'),_0xd9d3('0xff'),{'id':_0x3d906f['id'],'name':_0x3d906f['name'],'pause':![]})[_0xd9d3('0x13')](function(){return db[_0xd9d3('0xab')][_0xd9d3('0x27')]({'paused':0x0},{'where':{'UserId':_0x3d906f['id']},'individualHooks':!![]});})[_0xd9d3('0x13')](function(){return db[_0xd9d3('0xf2')]['find']({'where':{'channel':_0x227869[_0xd9d3('0x5e')][_0xd9d3('0x98')],'membername':_0x3d906f['name'],'type':_0xd9d3('0xf7'),'exitAt':null}});})[_0xd9d3('0x13')](function(_0x256006){if(_0x256006){return _0x256006['update']({'exitAt':moment()[_0xd9d3('0xa8')](_0xd9d3('0xf3')),'data2':'manual'},{'individualHooks':!![]});}return null;})[_0xd9d3('0x13')](function(){return _0x3d906f[_0xd9d3('0x27')]({'voicePause':![]});});case _0xd9d3('0x4d'):case _0xd9d3('0x49'):case _0xd9d3('0x4c'):case _0xd9d3('0x4b'):case _0xd9d3('0x4f'):case'openchannel':return db['MemberReport'][_0xd9d3('0x35')]({'where':{'channel':_0x227869['body'][_0xd9d3('0x98')],'membername':_0x3d906f[_0xd9d3('0x37')],'type':_0xd9d3('0xf7'),'exitAt':null}})['then'](function(_0x191f28){if(_0x191f28){return _0x191f28['update']({'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0xd9d3('0x105')},{'individualHooks':!![]});}return null;})[_0xd9d3('0x13')](function(){var _0x4cafe9={};_[_0xd9d3('0x24')](_0x4cafe9,util[_0xd9d3('0xa8')]('%s%s',_0x227869[_0xd9d3('0x5e')][_0xd9d3('0x98')],_0xd9d3('0x106')),![]);return _0x3d906f[_0xd9d3('0x27')](_0x4cafe9);});default:return respondWithRpcPromise('QueuePause','unpause',{'id':_0x3d906f['id'],'name':_0x3d906f[_0xd9d3('0x37')],'pause':![]})[_0xd9d3('0x13')](function(){return db['UserVoiceQueueRt'][_0xd9d3('0x27')]({'paused':0x0},{'where':{'UserId':_0x3d906f['id']}});})[_0xd9d3('0x13')](function(){return db[_0xd9d3('0xf2')][_0xd9d3('0x46')]({'where':{'membername':_0x3d906f['name'],'type':_0xd9d3('0xf7'),'exitAt':null}});})['then'](function(_0x4382dc){var _0x1634d3=[];_0x4382dc[_0xd9d3('0xf4')](function(_0x4340c3){_0x1634d3[_0xd9d3('0x45')](_0x4340c3[_0xd9d3('0x27')]({'exitAt':moment()['format'](_0xd9d3('0xf3')),'data2':'manual'}));});return BPromise[_0xd9d3('0x50')](_0x1634d3);})[_0xd9d3('0x13')](function(){return _0x3d906f['update']({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'whatsappPause':![],'openchannelPause':![]});});}}})['then'](respondWithResult(_0x4b209a,null))[_0xd9d3('0x1c')](handleError(_0x4b209a,null));};exports[_0xd9d3('0x107')]=function(_0x53f904,_0x3fa8e3){var _0x424daf={};var _0x1b19ba={};var _0x3a60e7;var _0x763866;return db['User']['findOne']({'where':{'id':_0x53f904[_0xd9d3('0x52')]['id']}})[_0xd9d3('0x13')](handleEntityNotFound(_0x3fa8e3,null))[_0xd9d3('0x13')](function(_0x2364f7){if(_0x2364f7){_0x3a60e7=_0x2364f7;_0x1b19ba[_0xd9d3('0x53')]=_[_0xd9d3('0x55')](db[_0xd9d3('0x108')]['rawAttributes']);_0x1b19ba[_0xd9d3('0x3e')]=_['keys'](_0x53f904[_0xd9d3('0x3e')]);_0x1b19ba[_0xd9d3('0x58')]=_['intersection'](_0x1b19ba[_0xd9d3('0x53')],_0x1b19ba[_0xd9d3('0x3e')]);_0x424daf['attributes']=_['intersection'](_0x1b19ba[_0xd9d3('0x53')],qs[_0xd9d3('0x5a')](_0x53f904[_0xd9d3('0x3e')]['fields']));_0x424daf[_0xd9d3('0x44')]=_0x424daf['attributes']['length']?_0x424daf[_0xd9d3('0x44')]:_0x1b19ba['model'];_0x424daf[_0xd9d3('0xc5')]=qs[_0xd9d3('0xc6')](_0x53f904[_0xd9d3('0x3e')][_0xd9d3('0xc6')]);_0x424daf[_0xd9d3('0xc7')]=qs['filters'](_['pick'](_0x53f904[_0xd9d3('0x3e')],_0x1b19ba[_0xd9d3('0x58')]));if(_0x53f904['query'][_0xd9d3('0x30')]){_0x424daf['where']=_['merge'](_0x424daf[_0xd9d3('0xc7')],{'$or':_[_0xd9d3('0x32')](_0x424daf[_0xd9d3('0x44')],function(_0x39e20d){var _0x144bfb={};_0x144bfb[_0x39e20d]={'$like':'%'+_0x53f904[_0xd9d3('0x3e')][_0xd9d3('0x30')]+'%'};return _0x144bfb;})});}_0x424daf=_['merge']({},_0x424daf,_0x53f904[_0xd9d3('0x5c')]);return _0x3a60e7[_0xd9d3('0x107')](_0x424daf);}})['then'](function(_0x34f6f1){if(_0x34f6f1){_0x763866=_0x34f6f1['length'];if(!_0x53f904[_0xd9d3('0x3e')][_0xd9d3('0xd5')](_0xd9d3('0xce'))){_0x424daf[_0xd9d3('0x22')]=qs['limit'](_0x53f904[_0xd9d3('0x3e')]['limit']);_0x424daf[_0xd9d3('0x20')]=qs[_0xd9d3('0x20')](_0x53f904[_0xd9d3('0x3e')]['offset']);}return _0x3a60e7['getTeams'](_0x424daf);}})[_0xd9d3('0x13')](function(_0xccc75a){if(_0xccc75a){return _0xccc75a?{'count':_0x763866,'rows':_0xccc75a}:null;}})[_0xd9d3('0x13')](respondWithResult(_0x3fa8e3,null))[_0xd9d3('0x1c')](handleError(_0x3fa8e3,null));};exports[_0xd9d3('0x109')]=function(_0x21f754,_0x35fd6c){return db['User'][_0xd9d3('0x35')]({'where':{'id':_0x21f754['params']['id']}})[_0xd9d3('0x13')](handleEntityNotFound(_0x35fd6c,null))[_0xd9d3('0x13')](function(_0x564060){if(_0x564060){var _0x2a117d=_0x564060[_0xd9d3('0xa6')]({'plain':!![]});return _0x564060[_0xd9d3('0x109')](_0x21f754[_0xd9d3('0x5e')]['ids'],_[_0xd9d3('0x62')](_0x21f754[_0xd9d3('0x5e')],[_0xd9d3('0x61'),'id'])||{})[_0xd9d3('0x13')](function(){for(var _0x5f36c8=0x0;_0x5f36c8<_0x21f754['body'][_0xd9d3('0x61')][_0xd9d3('0x48')];_0x5f36c8++){var _0x5e4980=[];var _0xdda36a={};db['Team']['findOne']({'where':{'id':_0x21f754[_0xd9d3('0x5e')][_0xd9d3('0x61')][_0x5f36c8]}})[_0xd9d3('0x13')](function(_0x3d7f89){_0xdda36a=_0x3d7f89[_0xd9d3('0x4a')];_0x5e4980[_0xd9d3('0x45')](_0x3d7f89[_0xd9d3('0xf0')]()['then'](function(_0x1eaeff){for(var _0x1a7bf2=0x0;_0x1a7bf2<_0x1eaeff[_0xd9d3('0x48')];_0x1a7bf2++){_0x1eaeff[_0x1a7bf2]['setDataValue'](_0xd9d3('0x98'),_0xd9d3('0x10a'));}return _0x1eaeff;}));_0x5e4980[_0xd9d3('0x45')](_0x3d7f89[_0xd9d3('0x10b')]()[_0xd9d3('0x13')](function(_0x250ecc){for(var _0x2d9739=0x0;_0x2d9739<_0x250ecc[_0xd9d3('0x48')];_0x2d9739++){_0x250ecc[_0x2d9739]['setDataValue'](_0xd9d3('0x98'),'Chat');}return _0x250ecc;}));_0x5e4980['push'](_0x3d7f89[_0xd9d3('0x10c')]()['then'](function(_0x3aa9ad){for(var _0x4a3fa6=0x0;_0x4a3fa6<_0x3aa9ad['length'];_0x4a3fa6++){_0x3aa9ad[_0x4a3fa6]['setDataValue']('channel',_0xd9d3('0x10d'));}return _0x3aa9ad;}));_0x5e4980[_0xd9d3('0x45')](_0x3d7f89[_0xd9d3('0x10e')]()[_0xd9d3('0x13')](function(_0x33dd07){for(var _0x5226b3=0x0;_0x5226b3<_0x33dd07[_0xd9d3('0x48')];_0x5226b3++){_0x33dd07[_0x5226b3][_0xd9d3('0x10f')](_0xd9d3('0x98'),_0xd9d3('0x110'));}return _0x33dd07;}));_0x5e4980[_0xd9d3('0x45')](_0x3d7f89[_0xd9d3('0x111')]()[_0xd9d3('0x13')](function(_0xebb159){for(var _0x582fc5=0x0;_0x582fc5<_0xebb159['length'];_0x582fc5++){_0xebb159[_0x582fc5][_0xd9d3('0x10f')](_0xd9d3('0x98'),_0xd9d3('0x112'));}return _0xebb159;}));_0x5e4980[_0xd9d3('0x45')](_0x3d7f89[_0xd9d3('0x113')]()[_0xd9d3('0x13')](function(_0x2e41f6){for(var _0x1c17ff=0x0;_0x1c17ff<_0x2e41f6[_0xd9d3('0x48')];_0x1c17ff++){_0x2e41f6[_0x1c17ff]['setDataValue'](_0xd9d3('0x98'),_0xd9d3('0x114'));}return _0x2e41f6;}));_0x5e4980['push'](_0x3d7f89[_0xd9d3('0x115')]()[_0xd9d3('0x13')](function(_0x56e52b){for(var _0x89f0c5=0x0;_0x89f0c5<_0x56e52b['length'];_0x89f0c5++){_0x56e52b[_0x89f0c5][_0xd9d3('0x10f')](_0xd9d3('0x98'),'Openchannel');}return _0x56e52b;}));return BPromise[_0xd9d3('0x50')](_0x5e4980);})[_0xd9d3('0x13')](function(_0x58f98c){var _0x4bb16a=_[_0xd9d3('0x116')](_0x58f98c);_0x5e4980=[];return db[_0xd9d3('0x68')][_0xd9d3('0x117')](function(_0x5e04ad){for(var _0x653d5c=0x0;_0x653d5c<_0x4bb16a[_0xd9d3('0x48')];_0x653d5c++){_0x5e4980[_0xd9d3('0x45')](_0x4bb16a[_0x653d5c][_0xd9d3('0x118')](_0x2a117d['id']),{'transaction':_0x5e04ad});}return BPromise[_0xd9d3('0x50')](_0x5e4980)[_0xd9d3('0x13')](function(){if(_0x2a117d[_0xd9d3('0x99')]){return BPromise[_0xd9d3('0x84')](_[_0xd9d3('0x30')](_0x4bb16a,function(_0x576f0b){return _0x576f0b['getDataValue'](_0xd9d3('0x98'))===_0xd9d3('0x10a');}),function(_0x4d90f7){return db[_0xd9d3('0xab')][_0xd9d3('0xac')]({'membername':_0x2a117d[_0xd9d3('0x37')],'UserId':_0x2a117d['id'],'queue_name':_0x4d90f7['name'],'VoiceQueueId':_0x4d90f7['id'],'interface':_[_0xd9d3('0x67')](_0x2a117d[_0xd9d3('0x9b')])?util[_0xd9d3('0xa8')](_0xd9d3('0xa9'),_0x2a117d[_0xd9d3('0x37')]):_0x2a117d[_0xd9d3('0x9b')],'paused':_0x2a117d[_0xd9d3('0xaa')]||![],'penalty':_0x2a117d[_0xd9d3('0xa1')]},{'transaction':_0x5e04ad});});}else{return;}})[_0xd9d3('0x13')](function(){for(var _0x44eef9=0x0;_0x44eef9<_0x4bb16a[_0xd9d3('0x48')];_0x44eef9++){var _0x3c687c=_0x4bb16a[_0x44eef9][_0xd9d3('0x119')]('channel');var _0x2bb9f9=_0x3c687c+'QueueId';socket[_0xd9d3('0xb0')](_0xd9d3('0x2c')+_0x3c687c+_0xd9d3('0xa4'),{'UserId':_0x2a117d['id'],['queueField']:_0x4bb16a[_0x44eef9]['id']});}});});})[_0xd9d3('0x13')](function(){db[_0xd9d3('0x11a')][_0xd9d3('0xcf')]({'where':{'teamId':_0xdda36a['id']}})['then'](function(_0x2a5e71){if(_0x2a5e71){db[_0xd9d3('0x11b')]['create']({'UserId':_0x21f754[_0xd9d3('0x52')]['id'],'VoicePrefixId':_0x2a5e71[_0xd9d3('0x11c')]});}});});}});}})[_0xd9d3('0x13')](respondWithStatusCode(_0x35fd6c,null))[_0xd9d3('0x1c')](handleError(_0x35fd6c,null));};exports[_0xd9d3('0x11d')]=function(_0x533d37,_0x1d1673){return db[_0xd9d3('0x39')][_0xd9d3('0xcf')]({'where':{'id':_0x533d37[_0xd9d3('0x52')]['id']}})['then'](handleEntityNotFound(_0x1d1673,null))[_0xd9d3('0x13')](function(_0x1129b2){if(_0x1129b2){var _0x448f91=_0x1129b2['get']({'plain':!![]});var _0x374e4f=_0x533d37[_0xd9d3('0x3e')][_0xd9d3('0x61')];return _0x1129b2[_0xd9d3('0x11d')](_0x374e4f)[_0xd9d3('0x13')](function(){for(var _0x684eff=0x0;_0x684eff<_0x374e4f[_0xd9d3('0x48')];_0x684eff++){var _0x34a134=[];var _0x1ea8dc={};db['Team']['findOne']({'where':{'id':_0x374e4f[_0x684eff]}})[_0xd9d3('0x13')](function(_0x309371){_0x1ea8dc=_0x309371[_0xd9d3('0x4a')];_0x34a134[_0xd9d3('0x45')](_0x309371[_0xd9d3('0xf0')]()['then'](function(_0x2734b5){for(var _0x5ef22a=0x0;_0x5ef22a<_0x2734b5[_0xd9d3('0x48')];_0x5ef22a++){_0x2734b5[_0x5ef22a][_0xd9d3('0x10f')](_0xd9d3('0x98'),_0xd9d3('0x10a'));}return _0x2734b5;}));_0x34a134['push'](_0x309371[_0xd9d3('0x10b')]()[_0xd9d3('0x13')](function(_0x264ec0){for(var _0x587294=0x0;_0x587294<_0x264ec0['length'];_0x587294++){_0x264ec0[_0x587294]['setDataValue'](_0xd9d3('0x98'),_0xd9d3('0x11e'));}return _0x264ec0;}));_0x34a134[_0xd9d3('0x45')](_0x309371[_0xd9d3('0x10c')]()[_0xd9d3('0x13')](function(_0x2d00eb){for(var _0x197232=0x0;_0x197232<_0x2d00eb[_0xd9d3('0x48')];_0x197232++){_0x2d00eb[_0x197232][_0xd9d3('0x10f')](_0xd9d3('0x98'),'Mail');}return _0x2d00eb;}));_0x34a134[_0xd9d3('0x45')](_0x309371[_0xd9d3('0x10e')]()[_0xd9d3('0x13')](function(_0x5c65b0){for(var _0x25556a=0x0;_0x25556a<_0x5c65b0[_0xd9d3('0x48')];_0x25556a++){_0x5c65b0[_0x25556a]['setDataValue']('channel',_0xd9d3('0x110'));}return _0x5c65b0;}));_0x34a134[_0xd9d3('0x45')](_0x309371['getWhatsappQueues']()['then'](function(_0x2ce5e3){for(var _0x139455=0x0;_0x139455<_0x2ce5e3[_0xd9d3('0x48')];_0x139455++){_0x2ce5e3[_0x139455][_0xd9d3('0x10f')]('channel','Whatsapp');}return _0x2ce5e3;}));_0x34a134[_0xd9d3('0x45')](_0x309371['getFaxQueues']()[_0xd9d3('0x13')](function(_0x1b0c4c){for(var _0x25a93e=0x0;_0x25a93e<_0x1b0c4c[_0xd9d3('0x48')];_0x25a93e++){_0x1b0c4c[_0x25a93e][_0xd9d3('0x10f')]('channel',_0xd9d3('0x114'));}return _0x1b0c4c;}));_0x34a134['push'](_0x309371[_0xd9d3('0x115')]()[_0xd9d3('0x13')](function(_0x302bfc){for(var _0x59d164=0x0;_0x59d164<_0x302bfc[_0xd9d3('0x48')];_0x59d164++){_0x302bfc[_0x59d164][_0xd9d3('0x10f')](_0xd9d3('0x98'),_0xd9d3('0x11f'));}return _0x302bfc;}));return BPromise[_0xd9d3('0x50')](_0x34a134);})[_0xd9d3('0x13')](function(_0x2b90f4){var _0xf85836=_[_0xd9d3('0x116')](_0x2b90f4);_0x34a134=[];return db[_0xd9d3('0x68')][_0xd9d3('0x117')](function(_0x2ab8cc){for(var _0x53835b=0x0;_0x53835b<_0xf85836[_0xd9d3('0x48')];_0x53835b++){_0x34a134['push'](_0xf85836[_0x53835b][_0xd9d3('0x120')](_0x448f91['id']),{'transaction':_0x2ab8cc});}return BPromise['all'](_0x34a134)['then'](function(){if(_0x448f91[_0xd9d3('0x99')]){return BPromise['each'](_[_0xd9d3('0x30')](_0xf85836,function(_0x43dde1){return _0x43dde1[_0xd9d3('0x119')]('channel')==='Voice';}),function(_0x213b88){return db[_0xd9d3('0xab')][_0xd9d3('0x28')]({'where':{'VoiceQueueId':_0x213b88['id'],'UserId':_0x448f91['id']},'transaction':_0x2ab8cc});});}else{return;}})[_0xd9d3('0x13')](function(){db[_0xd9d3('0x11a')]['findOne']({'where':{'teamId':_0x1ea8dc['id']}})['then'](function(_0xd968a7){if(_0xd968a7){return db[_0xd9d3('0x11b')]['destroy']({'where':{'UserId':_0x448f91['id'],'VoicePrefixId':_0xd968a7[_0xd9d3('0x4a')][_0xd9d3('0x11c')]}});}});})[_0xd9d3('0x13')](function(){for(var _0x8a2298=0x0;_0x8a2298<_0xf85836[_0xd9d3('0x48')];_0x8a2298++){var _0x1a3d99=_0xf85836[_0x8a2298][_0xd9d3('0x119')](_0xd9d3('0x98'));var _0x27a7e6=_0x1a3d99+_0xd9d3('0xa3');socket[_0xd9d3('0xb0')](_0xd9d3('0x2c')+_0x1a3d99+_0xd9d3('0xb1'),{'UserId':_0x448f91['id'],['queueField']:_0xf85836[_0x8a2298]['id']});}});});});}});}})['then'](respondWithStatusCode(_0x1d1673,null))[_0xd9d3('0x1c')](handleError(_0x1d1673,null));};exports[_0xd9d3('0x121')]=function(_0x5ddbe4,_0x4c01dd){var _0x5eac4c={};var _0x5ba98f={};var _0x109cc4;var _0xceedb4;return db['User'][_0xd9d3('0xcf')]({'where':{'id':_0x5ddbe4[_0xd9d3('0x52')]['id']}})[_0xd9d3('0x13')](handleEntityNotFound(_0x4c01dd,null))[_0xd9d3('0x13')](function(_0x839b33){if(_0x839b33){_0x109cc4=_0x839b33;_0x5ba98f[_0xd9d3('0x53')]=_[_0xd9d3('0x55')](db['CmList'][_0xd9d3('0x56')]);_0x5ba98f[_0xd9d3('0x3e')]=_['keys'](_0x5ddbe4[_0xd9d3('0x3e')]);_0x5ba98f[_0xd9d3('0x58')]=_[_0xd9d3('0x59')](_0x5ba98f[_0xd9d3('0x53')],_0x5ba98f['query']);_0x5eac4c[_0xd9d3('0x44')]=_[_0xd9d3('0x59')](_0x5ba98f['model'],qs[_0xd9d3('0x5a')](_0x5ddbe4['query'][_0xd9d3('0x5a')]));_0x5eac4c[_0xd9d3('0x44')]=_0x5eac4c[_0xd9d3('0x44')][_0xd9d3('0x48')]?_0x5eac4c['attributes']:_0x5ba98f['model'];_0x5eac4c[_0xd9d3('0xc5')]=qs[_0xd9d3('0xc6')](_0x5ddbe4[_0xd9d3('0x3e')][_0xd9d3('0xc6')]);_0x5eac4c[_0xd9d3('0xc7')]=qs[_0xd9d3('0x58')](_[_0xd9d3('0xc8')](_0x5ddbe4[_0xd9d3('0x3e')],_0x5ba98f[_0xd9d3('0x58')]));if(_0x5ddbe4[_0xd9d3('0x3e')]['filter']){_0x5eac4c[_0xd9d3('0xc7')]=_[_0xd9d3('0x5b')](_0x5eac4c[_0xd9d3('0xc7')],{'$or':_[_0xd9d3('0x32')](_0x5eac4c[_0xd9d3('0x44')],function(_0xf5aa5e){var _0x404208={};_0x404208[_0xf5aa5e]={'$like':'%'+_0x5ddbe4[_0xd9d3('0x3e')]['filter']+'%'};return _0x404208;})});}_0x5eac4c=_[_0xd9d3('0x5b')]({},_0x5eac4c,_0x5ddbe4[_0xd9d3('0x5c')]);return _0x109cc4[_0xd9d3('0x121')](_0x5eac4c);}})[_0xd9d3('0x13')](function(_0x45571d){if(_0x45571d){_0xceedb4=_0x45571d[_0xd9d3('0x48')];if(!_0x5ddbe4['query'][_0xd9d3('0xd5')](_0xd9d3('0xce'))){_0x5eac4c[_0xd9d3('0x22')]=qs[_0xd9d3('0x22')](_0x5ddbe4[_0xd9d3('0x3e')]['limit']);_0x5eac4c[_0xd9d3('0x20')]=qs['offset'](_0x5ddbe4['query']['offset']);}return _0x109cc4[_0xd9d3('0x121')](_0x5eac4c);}})[_0xd9d3('0x13')](function(_0xe0014f){if(_0xe0014f){return _0xe0014f?{'count':_0xceedb4,'rows':_0xe0014f}:null;}})[_0xd9d3('0x13')](respondWithResult(_0x4c01dd,null))[_0xd9d3('0x1c')](handleError(_0x4c01dd,null));};exports['getAgents']=function(_0x55c7c9,_0x216e6f){var _0x111843={};var _0x252725={};var _0x515195;return db[_0xd9d3('0x39')]['findOne']({'where':{'id':_0x55c7c9[_0xd9d3('0x52')]['id']}})[_0xd9d3('0x13')](handleEntityNotFound(_0x216e6f,null))[_0xd9d3('0x13')](function(_0x24f3f1){if(_0x24f3f1){_0x515195=_0x24f3f1;_0x252725[_0xd9d3('0x53')]=_[_0xd9d3('0x55')](db[_0xd9d3('0x39')]['rawAttributes']);_0x252725[_0xd9d3('0x3e')]=_[_0xd9d3('0x55')](_0x55c7c9[_0xd9d3('0x3e')]);_0x252725[_0xd9d3('0x58')]=_[_0xd9d3('0x59')](_0x252725[_0xd9d3('0x53')],_0x252725[_0xd9d3('0x3e')]);_0x111843[_0xd9d3('0x44')]=_['intersection'](_0x252725[_0xd9d3('0x53')],qs['fields'](_0x55c7c9['query']['fields']));_0x111843['attributes']=_0x111843['attributes'][_0xd9d3('0x48')]?_0x111843[_0xd9d3('0x44')]:_0x252725[_0xd9d3('0x53')];_0x111843[_0xd9d3('0xc5')]=qs[_0xd9d3('0xc6')](_0x55c7c9[_0xd9d3('0x3e')][_0xd9d3('0xc6')]);_0x111843[_0xd9d3('0xc7')]=qs[_0xd9d3('0x58')](_['pick'](_0x55c7c9[_0xd9d3('0x3e')],_0x252725[_0xd9d3('0x58')]));if(_0x55c7c9['query'][_0xd9d3('0x30')]){_0x111843[_0xd9d3('0xc7')]=_[_0xd9d3('0x5b')](_0x111843[_0xd9d3('0xc7')],{'$or':_[_0xd9d3('0x32')](_0x111843[_0xd9d3('0x44')],function(_0x47d1ca){var _0x1ca1b7={};_0x1ca1b7[_0x47d1ca]={'$like':'%'+_0x55c7c9['query'][_0xd9d3('0x30')]+'%'};return _0x1ca1b7;})});}_0x111843[_0xd9d3('0x53')]=db[_0xd9d3('0x39')];_0x111843['as']=_0xd9d3('0x2d');_0x111843=_[_0xd9d3('0x5b')]({},_0x111843,_0x55c7c9[_0xd9d3('0x5c')]);return _0x515195['getVoiceQueues']({'include':[_0x111843]});}})['then'](function(_0x4086a8){if(_0x4086a8){var _0xbc04c0={},_0x5b5bb1=[];for(var _0x19a712=0x0;_0x19a712<_0x4086a8['length'];_0x19a712+=0x1){for(var _0x32866d=0x0,_0x1286a6;_0x32866d<_0x4086a8[_0x19a712]['Agents'][_0xd9d3('0x48')];_0x32866d+=0x1){_0x1286a6=_0x4086a8[_0x19a712][_0xd9d3('0x2d')][_0x32866d][_0xd9d3('0xa6')]({'plain':!![]});_0xbc04c0[_0x1286a6['id']]=_0x1286a6;}}_0xbc04c0=_[_0xd9d3('0x122')](_0xbc04c0);for(var _0xc7c3fb=qs[_0xd9d3('0x20')](_0x55c7c9[_0xd9d3('0x3e')][_0xd9d3('0x20')]);_0xc7c3fb<_0xbc04c0[_0xd9d3('0x48')]&&_0x5b5bb1[_0xd9d3('0x48')]<qs[_0xd9d3('0x22')](_0x55c7c9[_0xd9d3('0x3e')][_0xd9d3('0x22')]);_0xc7c3fb+=0x1){if(_0xbc04c0[_0xc7c3fb]){_0x5b5bb1[_0xd9d3('0x45')](_0xbc04c0[_0xc7c3fb]);}}return{'count':_0xbc04c0['length'],'rows':_0x5b5bb1};}})[_0xd9d3('0x13')](respondWithResult(_0x216e6f,null))[_0xd9d3('0x1c')](handleError(_0x216e6f,null));};exports['destroy']=function(_0x338ead,_0x29cdcb){if(_0x338ead[_0xd9d3('0x2c')]['id']==_0x338ead[_0xd9d3('0x52')]['id']){return _0x29cdcb['status'](0x1f4)[_0xd9d3('0x38')]({'message':_0xd9d3('0x123')});}return db['User']['find']({'where':{'id':_0x338ead[_0xd9d3('0x52')]['id']}})[_0xd9d3('0x13')](handleEntityNotFound(_0x29cdcb,null))[_0xd9d3('0x13')](removeEntity(_0x29cdcb,null))[_0xd9d3('0x1c')](handleError(_0x29cdcb,null));};exports[_0xd9d3('0x124')]=function(_0x4a25f0,_0x5b1c61){return db[_0xd9d3('0x39')]['find']({'where':{'id':_0x4a25f0[_0xd9d3('0x52')]['id']}})[_0xd9d3('0x13')](handleEntityNotFound(_0x5b1c61,null))[_0xd9d3('0x13')](function(_0x564883){if(_0x564883){return _0x564883[_0xd9d3('0x124')](_0x4a25f0[_0xd9d3('0x5e')][_0xd9d3('0x61')],_[_0xd9d3('0x62')](_0x4a25f0[_0xd9d3('0x5e')],[_0xd9d3('0x61'),'id'])||{})[_0xd9d3('0xa2')](function(){for(var _0x383e6c=0x0;_0x383e6c<_0x4a25f0[_0xd9d3('0x5e')]['ids']['length'];_0x383e6c+=0x1){socket[_0xd9d3('0xb0')](_0xd9d3('0x125'),{'ChatInteractionId':Number(_0x4a25f0['body'][_0xd9d3('0x61')][_0x383e6c]),'UserId':Number(_0x4a25f0[_0xd9d3('0x52')]['id'])});}return _0x4a25f0[_0xd9d3('0x5e')][_0xd9d3('0x61')];});}})[_0xd9d3('0x13')](respondWithResult(_0x5b1c61,null))[_0xd9d3('0x1c')](handleError(_0x5b1c61,null));};exports['removeChatInteractions']=function(_0x14f578,_0x5890cf){return db['User'][_0xd9d3('0x35')]({'where':{'id':_0x14f578[_0xd9d3('0x52')]['id']}})[_0xd9d3('0x13')](handleEntityNotFound(_0x5890cf,null))['then'](function(_0x413926){if(_0x413926){return _0x413926[_0xd9d3('0x126')](_0x14f578[_0xd9d3('0x3e')][_0xd9d3('0x61')])['then'](function(){if(_[_0xd9d3('0xaf')](_0x14f578['query']['ids'])){for(var _0x5beb9c=0x0;_0x5beb9c<_0x14f578[_0xd9d3('0x3e')][_0xd9d3('0x61')][_0xd9d3('0x48')];_0x5beb9c+=0x1){socket[_0xd9d3('0xb0')](_0xd9d3('0x127'),{'ChatInteractionId':Number(_0x14f578['query'][_0xd9d3('0x61')][_0x5beb9c]),'UserId':Number(_0x14f578[_0xd9d3('0x52')]['id'])});}}else{socket[_0xd9d3('0xb0')](_0xd9d3('0x127'),{'ChatInteractionId':Number(_0x14f578['query'][_0xd9d3('0x61')]),'UserId':Number(_0x14f578[_0xd9d3('0x52')]['id'])});}});}})[_0xd9d3('0x13')](respondWithStatusCode(_0x5890cf,null))[_0xd9d3('0x1c')](handleError(_0x5890cf,null));};exports[_0xd9d3('0x128')]=function(_0x3a8942,_0x2b0569){return db[_0xd9d3('0x39')]['find']({'where':{'id':_0x3a8942[_0xd9d3('0x52')]['id']}})[_0xd9d3('0x13')](handleEntityNotFound(_0x2b0569,null))['then'](function(_0x423dac){if(_0x423dac){return _0x423dac[_0xd9d3('0x128')](_0x3a8942[_0xd9d3('0x5e')][_0xd9d3('0x61')],_['omit'](_0x3a8942['body'],[_0xd9d3('0x61'),'id'])||{})['spread'](function(){for(var _0x2038fd=0x0;_0x2038fd<_0x3a8942[_0xd9d3('0x5e')][_0xd9d3('0x61')]['length'];_0x2038fd+=0x1){socket['emit'](_0xd9d3('0x129'),{'MailInteractionId':Number(_0x3a8942[_0xd9d3('0x5e')][_0xd9d3('0x61')][_0x2038fd]),'UserId':Number(_0x3a8942[_0xd9d3('0x52')]['id'])});}return _0x3a8942['body'][_0xd9d3('0x61')];});}})[_0xd9d3('0x13')](respondWithResult(_0x2b0569,null))[_0xd9d3('0x1c')](handleError(_0x2b0569,null));};exports[_0xd9d3('0x12a')]=function(_0x2db24f,_0x5614d7){return db[_0xd9d3('0x39')][_0xd9d3('0x35')]({'where':{'id':_0x2db24f[_0xd9d3('0x52')]['id']}})['then'](handleEntityNotFound(_0x5614d7,null))[_0xd9d3('0x13')](function(_0x140bc7){if(_0x140bc7){return _0x140bc7[_0xd9d3('0x12a')](_0x2db24f[_0xd9d3('0x3e')]['ids'])['then'](function(){if(_[_0xd9d3('0xaf')](_0x2db24f[_0xd9d3('0x3e')]['ids'])){for(var _0x2848f6=0x0;_0x2848f6<_0x2db24f[_0xd9d3('0x3e')][_0xd9d3('0x61')][_0xd9d3('0x48')];_0x2848f6+=0x1){socket[_0xd9d3('0xb0')]('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0x2db24f[_0xd9d3('0x3e')][_0xd9d3('0x61')][_0x2848f6]),'UserId':Number(_0x2db24f[_0xd9d3('0x52')]['id'])});}}else{socket[_0xd9d3('0xb0')](_0xd9d3('0x12b'),{'MailInteractionId':Number(_0x2db24f[_0xd9d3('0x3e')][_0xd9d3('0x61')]),'UserId':Number(_0x2db24f[_0xd9d3('0x52')]['id'])});}});}})['then'](respondWithStatusCode(_0x5614d7,null))[_0xd9d3('0x1c')](handleError(_0x5614d7,null));};exports[_0xd9d3('0x12c')]=function(_0x3237a2,_0x10f3ed){return db[_0xd9d3('0x39')][_0xd9d3('0x35')]({'where':{'id':_0x3237a2[_0xd9d3('0x52')]['id']}})[_0xd9d3('0x13')](handleEntityNotFound(_0x10f3ed,null))[_0xd9d3('0x13')](function(_0x4820c4){if(_0x4820c4){return _0x4820c4[_0xd9d3('0x12c')](_0x3237a2['body'][_0xd9d3('0x61')],_[_0xd9d3('0x62')](_0x3237a2[_0xd9d3('0x5e')],[_0xd9d3('0x61'),'id'])||{})[_0xd9d3('0xa2')](function(){for(var _0x492e54=0x0;_0x492e54<_0x3237a2[_0xd9d3('0x5e')]['ids'][_0xd9d3('0x48')];_0x492e54+=0x1){socket['emit']('user_has_fax_interactions:save',{'FaxInteractionId':Number(_0x3237a2[_0xd9d3('0x5e')][_0xd9d3('0x61')][_0x492e54]),'UserId':Number(_0x3237a2[_0xd9d3('0x52')]['id'])});}return _0x3237a2[_0xd9d3('0x5e')]['ids'];});}})[_0xd9d3('0x13')](respondWithResult(_0x10f3ed,null))['catch'](handleError(_0x10f3ed,null));};exports[_0xd9d3('0x12d')]=function(_0x1c1e72,_0x2c223f){return db[_0xd9d3('0x39')][_0xd9d3('0x35')]({'where':{'id':_0x1c1e72[_0xd9d3('0x52')]['id']}})['then'](handleEntityNotFound(_0x2c223f,null))[_0xd9d3('0x13')](function(_0x26e126){if(_0x26e126){return _0x26e126[_0xd9d3('0x12d')](_0x1c1e72[_0xd9d3('0x3e')]['ids'])[_0xd9d3('0x13')](function(){if(_['isArray'](_0x1c1e72[_0xd9d3('0x3e')][_0xd9d3('0x61')])){for(var _0x2509aa=0x0;_0x2509aa<_0x1c1e72[_0xd9d3('0x3e')]['ids'][_0xd9d3('0x48')];_0x2509aa+=0x1){socket[_0xd9d3('0xb0')](_0xd9d3('0x12e'),{'FaxInteractionId':Number(_0x1c1e72[_0xd9d3('0x3e')][_0xd9d3('0x61')][_0x2509aa]),'UserId':Number(_0x1c1e72[_0xd9d3('0x52')]['id'])});}}else{socket[_0xd9d3('0xb0')](_0xd9d3('0x12e'),{'FaxInteractionId':Number(_0x1c1e72[_0xd9d3('0x3e')][_0xd9d3('0x61')]),'UserId':Number(_0x1c1e72['params']['id'])});}});}})[_0xd9d3('0x13')](respondWithStatusCode(_0x2c223f,null))[_0xd9d3('0x1c')](handleError(_0x2c223f,null));};exports[_0xd9d3('0x12f')]=function(_0x4c51ec,_0x119b69){return db[_0xd9d3('0x39')][_0xd9d3('0x35')]({'where':{'id':_0x4c51ec[_0xd9d3('0x52')]['id']}})[_0xd9d3('0x13')](handleEntityNotFound(_0x119b69,null))[_0xd9d3('0x13')](function(_0xf3d971){if(_0xf3d971){return _0xf3d971[_0xd9d3('0x12f')](_0x4c51ec[_0xd9d3('0x5e')][_0xd9d3('0x61')],_[_0xd9d3('0x62')](_0x4c51ec[_0xd9d3('0x5e')],[_0xd9d3('0x61'),'id'])||{})[_0xd9d3('0xa2')](function(){for(var _0x27b559=0x0;_0x27b559<_0x4c51ec[_0xd9d3('0x5e')][_0xd9d3('0x61')][_0xd9d3('0x48')];_0x27b559+=0x1){socket[_0xd9d3('0xb0')](_0xd9d3('0x130'),{'SmsInteractionId':Number(_0x4c51ec[_0xd9d3('0x5e')][_0xd9d3('0x61')][_0x27b559]),'UserId':Number(_0x4c51ec[_0xd9d3('0x52')]['id'])});}return _0x4c51ec[_0xd9d3('0x5e')][_0xd9d3('0x61')];});}})[_0xd9d3('0x13')](respondWithResult(_0x119b69,null))[_0xd9d3('0x1c')](handleError(_0x119b69,null));};exports['removeSmsInteractions']=function(_0x2de410,_0x3fe3d7){return db[_0xd9d3('0x39')][_0xd9d3('0x35')]({'where':{'id':_0x2de410[_0xd9d3('0x52')]['id']}})[_0xd9d3('0x13')](handleEntityNotFound(_0x3fe3d7,null))[_0xd9d3('0x13')](function(_0x8d4b56){if(_0x8d4b56){return _0x8d4b56['removeSmsInteractions'](_0x2de410[_0xd9d3('0x3e')]['ids'])[_0xd9d3('0x13')](function(){if(_[_0xd9d3('0xaf')](_0x2de410['query'][_0xd9d3('0x61')])){for(var _0x4cb222=0x0;_0x4cb222<_0x2de410[_0xd9d3('0x3e')][_0xd9d3('0x61')][_0xd9d3('0x48')];_0x4cb222+=0x1){socket[_0xd9d3('0xb0')](_0xd9d3('0x131'),{'SmsInteractionId':Number(_0x2de410[_0xd9d3('0x3e')][_0xd9d3('0x61')][_0x4cb222]),'UserId':Number(_0x2de410[_0xd9d3('0x52')]['id'])});}}else{socket['emit'](_0xd9d3('0x131'),{'SmsInteractionId':Number(_0x2de410[_0xd9d3('0x3e')]['ids']),'UserId':Number(_0x2de410['params']['id'])});}});}})[_0xd9d3('0x13')](respondWithStatusCode(_0x3fe3d7,null))['catch'](handleError(_0x3fe3d7,null));};exports['addOpenchannelInteractions']=function(_0x42d23e,_0x1b529c){return db[_0xd9d3('0x39')][_0xd9d3('0x35')]({'where':{'id':_0x42d23e[_0xd9d3('0x52')]['id']}})['then'](handleEntityNotFound(_0x1b529c,null))[_0xd9d3('0x13')](function(_0x36fb5d){if(_0x36fb5d){return _0x36fb5d[_0xd9d3('0x132')](_0x42d23e['body'][_0xd9d3('0x61')],_[_0xd9d3('0x62')](_0x42d23e[_0xd9d3('0x5e')],[_0xd9d3('0x61'),'id'])||{})['spread'](function(){for(var _0x4886bb=0x0;_0x4886bb<_0x42d23e[_0xd9d3('0x5e')]['ids'][_0xd9d3('0x48')];_0x4886bb+=0x1){socket[_0xd9d3('0xb0')]('user_has_openchannel_interactions:save',{'OpenchannelInteractionId':Number(_0x42d23e[_0xd9d3('0x5e')]['ids'][_0x4886bb]),'UserId':Number(_0x42d23e[_0xd9d3('0x52')]['id'])});}return _0x42d23e[_0xd9d3('0x5e')][_0xd9d3('0x61')];});}})[_0xd9d3('0x13')](respondWithResult(_0x1b529c,null))[_0xd9d3('0x1c')](handleError(_0x1b529c,null));};exports[_0xd9d3('0x133')]=function(_0x207b0f,_0x383a12){return db[_0xd9d3('0x39')][_0xd9d3('0x35')]({'where':{'id':_0x207b0f['params']['id']}})[_0xd9d3('0x13')](handleEntityNotFound(_0x383a12,null))[_0xd9d3('0x13')](function(_0xe57dbc){if(_0xe57dbc){return _0xe57dbc[_0xd9d3('0x133')](_0x207b0f[_0xd9d3('0x3e')]['ids'])[_0xd9d3('0x13')](function(){if(_[_0xd9d3('0xaf')](_0x207b0f[_0xd9d3('0x3e')][_0xd9d3('0x61')])){for(var _0x432063=0x0;_0x432063<_0x207b0f[_0xd9d3('0x3e')]['ids'][_0xd9d3('0x48')];_0x432063+=0x1){socket[_0xd9d3('0xb0')](_0xd9d3('0x134'),{'OpenchannelInteractionId':Number(_0x207b0f['query'][_0xd9d3('0x61')][_0x432063]),'UserId':Number(_0x207b0f[_0xd9d3('0x52')]['id'])});}}else{socket[_0xd9d3('0xb0')](_0xd9d3('0x134'),{'OpenchannelInteractionId':Number(_0x207b0f[_0xd9d3('0x3e')][_0xd9d3('0x61')]),'UserId':Number(_0x207b0f[_0xd9d3('0x52')]['id'])});}});}})[_0xd9d3('0x13')](respondWithStatusCode(_0x383a12,null))['catch'](handleError(_0x383a12,null));};exports[_0xd9d3('0x135')]=function(_0x5bf880,_0x50f9dd){return db[_0xd9d3('0x39')][_0xd9d3('0x35')]({'where':{'id':_0x5bf880['params']['id']}})['then'](handleEntityNotFound(_0x50f9dd,null))[_0xd9d3('0x13')](function(_0x57ca88){if(_0x57ca88){return _0x57ca88[_0xd9d3('0x135')](_0x5bf880[_0xd9d3('0x5e')][_0xd9d3('0x61')],_[_0xd9d3('0x62')](_0x5bf880['body'],['ids','id'])||{})['spread'](function(){for(var _0x3756a2=0x0;_0x3756a2<_0x5bf880[_0xd9d3('0x5e')][_0xd9d3('0x61')][_0xd9d3('0x48')];_0x3756a2+=0x1){socket[_0xd9d3('0xb0')](_0xd9d3('0x136'),{'WhatsappInteractionId':Number(_0x5bf880[_0xd9d3('0x5e')][_0xd9d3('0x61')][_0x3756a2]),'UserId':Number(_0x5bf880[_0xd9d3('0x52')]['id'])});}return _0x5bf880[_0xd9d3('0x5e')][_0xd9d3('0x61')];});}})[_0xd9d3('0x13')](respondWithResult(_0x50f9dd,null))[_0xd9d3('0x1c')](handleError(_0x50f9dd,null));};exports[_0xd9d3('0x137')]=function(_0x16fda2,_0x24f04d){return db['User'][_0xd9d3('0x35')]({'where':{'id':_0x16fda2[_0xd9d3('0x52')]['id']}})[_0xd9d3('0x13')](handleEntityNotFound(_0x24f04d,null))[_0xd9d3('0x13')](function(_0x454068){if(_0x454068){return _0x454068[_0xd9d3('0x137')](_0x16fda2[_0xd9d3('0x3e')]['ids']);}})['then'](respondWithStatusCode(_0x24f04d,null))['catch'](handleError(_0x24f04d,null));};exports[_0xd9d3('0x138')]=function(_0x536333,_0x487779){var _0x2f3d5f={};var _0x4442aa={};var _0x25f6dd;var _0x215f05;return db[_0xd9d3('0x39')][_0xd9d3('0xcf')]({'where':{'id':_0x536333[_0xd9d3('0x52')]['id']}})['then'](handleEntityNotFound(_0x487779,null))[_0xd9d3('0x13')](function(_0x32d8fe){if(_0x32d8fe){_0x25f6dd=_0x32d8fe;_0x4442aa['model']=_[_0xd9d3('0x55')](db[_0xd9d3('0x139')][_0xd9d3('0x56')]);_0x4442aa[_0xd9d3('0x3e')]=_[_0xd9d3('0x55')](_0x536333[_0xd9d3('0x3e')]);_0x4442aa[_0xd9d3('0x58')]=_[_0xd9d3('0x59')](_0x4442aa['model'],_0x4442aa[_0xd9d3('0x3e')]);_0x2f3d5f[_0xd9d3('0x44')]=_[_0xd9d3('0x59')](_0x4442aa[_0xd9d3('0x53')],qs['fields'](_0x536333['query'][_0xd9d3('0x5a')]));_0x2f3d5f[_0xd9d3('0x44')]=_0x2f3d5f[_0xd9d3('0x44')]['length']?_0x2f3d5f[_0xd9d3('0x44')]:_0x4442aa['model'];_0x2f3d5f[_0xd9d3('0xc5')]=qs[_0xd9d3('0xc6')](_0x536333['query']['sort']);_0x2f3d5f[_0xd9d3('0xc7')]=qs['filters'](_[_0xd9d3('0xc8')](_0x536333[_0xd9d3('0x3e')],_0x4442aa[_0xd9d3('0x58')]));if(_0x536333[_0xd9d3('0x3e')]['filter']){_0x2f3d5f[_0xd9d3('0xc7')]=_[_0xd9d3('0x5b')](_0x2f3d5f[_0xd9d3('0xc7')],{'$or':_[_0xd9d3('0x32')](_0x2f3d5f[_0xd9d3('0x44')],function(_0x1750bf){var _0x2bde56={};_0x2bde56[_0x1750bf]={'$like':'%'+_0x536333[_0xd9d3('0x3e')][_0xd9d3('0x30')]+'%'};return _0x2bde56;})});}_0x2f3d5f=_[_0xd9d3('0x5b')]({},_0x2f3d5f,_0x536333[_0xd9d3('0x5c')]);return _0x25f6dd['getVoicePrefixes'](_0x2f3d5f);}})[_0xd9d3('0x13')](function(_0x3e6279){if(_0x3e6279){_0x215f05=_0x3e6279[_0xd9d3('0x48')];if(!_0x536333[_0xd9d3('0x3e')]['hasOwnProperty'](_0xd9d3('0xce'))){_0x2f3d5f[_0xd9d3('0x22')]=qs[_0xd9d3('0x22')](_0x536333[_0xd9d3('0x3e')][_0xd9d3('0x22')]);_0x2f3d5f['offset']=qs[_0xd9d3('0x20')](_0x536333[_0xd9d3('0x3e')][_0xd9d3('0x20')]);}return _0x25f6dd['getVoicePrefixes'](_0x2f3d5f);}})[_0xd9d3('0x13')](function(_0x277a03){if(_0x277a03){return _0x277a03?{'count':_0x215f05,'rows':_0x277a03}:null;}})['then'](respondWithResult(_0x487779,null))[_0xd9d3('0x1c')](handleError(_0x487779,null));};exports[_0xd9d3('0x13a')]=function(_0x486be9,_0x45cc47){var _0x2003f0={};var _0x58eb4c={};var _0x3d9000;var _0xc842d4;return db[_0xd9d3('0x39')][_0xd9d3('0xcf')]({'where':{'id':_0x486be9[_0xd9d3('0x52')]['id']}})['then'](handleEntityNotFound(_0x45cc47,null))[_0xd9d3('0x13')](function(_0x1f4153){if(_0x1f4153){_0x3d9000=_0x1f4153;_0x58eb4c[_0xd9d3('0x53')]=_[_0xd9d3('0x55')](db[_0xd9d3('0x13b')][_0xd9d3('0x56')]);_0x58eb4c['query']=_['keys'](_0x486be9[_0xd9d3('0x3e')]);_0x58eb4c['filters']=_[_0xd9d3('0x59')](_0x58eb4c[_0xd9d3('0x53')],_0x58eb4c['query']);_0x2003f0['attributes']=_[_0xd9d3('0x59')](_0x58eb4c[_0xd9d3('0x53')],qs[_0xd9d3('0x5a')](_0x486be9['query']['fields']));_0x2003f0[_0xd9d3('0x44')]=_0x2003f0[_0xd9d3('0x44')][_0xd9d3('0x48')]?_0x2003f0[_0xd9d3('0x44')]:_0x58eb4c['model'];_0x2003f0[_0xd9d3('0xc5')]=qs[_0xd9d3('0xc6')](_0x486be9[_0xd9d3('0x3e')][_0xd9d3('0xc6')]);_0x2003f0[_0xd9d3('0xc7')]=qs[_0xd9d3('0x58')](_[_0xd9d3('0xc8')](_0x486be9[_0xd9d3('0x3e')],_0x58eb4c[_0xd9d3('0x58')]));if(_0x486be9['query'][_0xd9d3('0x30')]){_0x2003f0[_0xd9d3('0xc7')]=_['merge'](_0x2003f0[_0xd9d3('0xc7')],{'$or':_[_0xd9d3('0x32')](_0x2003f0[_0xd9d3('0x44')],function(_0x351d78){var _0x1c34b8={};_0x1c34b8[_0x351d78]={'$like':'%'+_0x486be9['query'][_0xd9d3('0x30')]+'%'};return _0x1c34b8;})});}_0x2003f0=_['merge']({},_0x2003f0,_0x486be9[_0xd9d3('0x5c')]);return _0x3d9000[_0xd9d3('0x13a')](_0x2003f0);}})['then'](function(_0xae3067){if(_0xae3067){_0xc842d4=_0xae3067['length'];if(!_0x486be9['query'][_0xd9d3('0xd5')](_0xd9d3('0xce'))){_0x2003f0[_0xd9d3('0x22')]=qs[_0xd9d3('0x22')](_0x486be9[_0xd9d3('0x3e')][_0xd9d3('0x22')]);_0x2003f0[_0xd9d3('0x20')]=qs[_0xd9d3('0x20')](_0x486be9['query']['offset']);}return _0x3d9000['getFaxAccounts'](_0x2003f0);}})[_0xd9d3('0x13')](function(_0x269bac){if(_0x269bac){return _0x269bac?{'count':_0xc842d4,'rows':_0x269bac}:null;}})['then'](respondWithResult(_0x45cc47,null))[_0xd9d3('0x1c')](handleError(_0x45cc47,null));};exports['addFaxAccounts']=function(_0x21d390,_0x3c7436){return db[_0xd9d3('0x39')]['find']({'where':{'id':_0x21d390[_0xd9d3('0x52')]['id']}})[_0xd9d3('0x13')](handleEntityNotFound(_0x3c7436,null))[_0xd9d3('0x13')](function(_0x2183fc){if(_0x2183fc){return _0x2183fc['addFaxAccounts'](_0x21d390[_0xd9d3('0x5e')]['ids'],_[_0xd9d3('0x62')](_0x21d390[_0xd9d3('0x5e')],['ids','id'])||{});}})[_0xd9d3('0x13')](respondWithResult(_0x3c7436,null))[_0xd9d3('0x1c')](handleError(_0x3c7436,null));};exports[_0xd9d3('0x13c')]=function(_0x492949,_0x46896d){return db[_0xd9d3('0x39')][_0xd9d3('0x35')]({'where':{'id':_0x492949[_0xd9d3('0x52')]['id']}})[_0xd9d3('0x13')](handleEntityNotFound(_0x46896d,null))[_0xd9d3('0x13')](function(_0x25c538){if(_0x25c538){return _0x25c538[_0xd9d3('0x13c')](_0x492949['query'][_0xd9d3('0x61')]);}})[_0xd9d3('0x13')](respondWithStatusCode(_0x46896d,null))[_0xd9d3('0x1c')](handleError(_0x46896d,null));};exports[_0xd9d3('0x13d')]=function(_0x36273f,_0x3b8b52){var _0x1643ac={};var _0x2d9805={};var _0x1211ca;var _0x515d00;return db['User'][_0xd9d3('0xcf')]({'where':{'id':_0x36273f[_0xd9d3('0x52')]['id']}})[_0xd9d3('0x13')](handleEntityNotFound(_0x3b8b52,null))[_0xd9d3('0x13')](function(_0x531790){if(_0x531790){_0x1211ca=_0x531790;_0x2d9805[_0xd9d3('0x53')]=_['keys'](db[_0xd9d3('0x13e')]['rawAttributes']);_0x2d9805['query']=_['keys'](_0x36273f[_0xd9d3('0x3e')]);_0x2d9805[_0xd9d3('0x58')]=_[_0xd9d3('0x59')](_0x2d9805[_0xd9d3('0x53')],_0x2d9805['query']);_0x1643ac[_0xd9d3('0x44')]=_[_0xd9d3('0x59')](_0x2d9805[_0xd9d3('0x53')],qs[_0xd9d3('0x5a')](_0x36273f['query']['fields']));_0x1643ac[_0xd9d3('0x44')]=_0x1643ac[_0xd9d3('0x44')]['length']?_0x1643ac[_0xd9d3('0x44')]:_0x2d9805[_0xd9d3('0x53')];_0x1643ac['order']=qs['sort'](_0x36273f[_0xd9d3('0x3e')]['sort']);_0x1643ac[_0xd9d3('0xc7')]=qs[_0xd9d3('0x58')](_['pick'](_0x36273f[_0xd9d3('0x3e')],_0x2d9805[_0xd9d3('0x58')]));if(_0x36273f['query']['filter']){_0x1643ac[_0xd9d3('0xc7')]=_[_0xd9d3('0x5b')](_0x1643ac['where'],{'$or':_[_0xd9d3('0x32')](_0x1643ac[_0xd9d3('0x44')],function(_0x5d261f){var _0x2e9c69={};_0x2e9c69[_0x5d261f]={'$like':'%'+_0x36273f[_0xd9d3('0x3e')][_0xd9d3('0x30')]+'%'};return _0x2e9c69;})});}_0x1643ac=_[_0xd9d3('0x5b')]({},_0x1643ac,_0x36273f[_0xd9d3('0x5c')]);return _0x1211ca[_0xd9d3('0x13d')](_0x1643ac);}})[_0xd9d3('0x13')](function(_0x45c962){if(_0x45c962){_0x515d00=_0x45c962[_0xd9d3('0x48')];if(!_0x36273f[_0xd9d3('0x3e')][_0xd9d3('0xd5')]('nolimit')){_0x1643ac['limit']=qs['limit'](_0x36273f[_0xd9d3('0x3e')][_0xd9d3('0x22')]);_0x1643ac[_0xd9d3('0x20')]=qs[_0xd9d3('0x20')](_0x36273f['query'][_0xd9d3('0x20')]);}return _0x1211ca[_0xd9d3('0x13d')](_0x1643ac);}})[_0xd9d3('0x13')](function(_0x23730e){if(_0x23730e){return _0x23730e?{'count':_0x515d00,'rows':_0x23730e}:null;}})['then'](respondWithResult(_0x3b8b52,null))['catch'](handleError(_0x3b8b52,null));};exports[_0xd9d3('0x13f')]=function(_0x52ebe9,_0x1b7ee2){return db[_0xd9d3('0x39')][_0xd9d3('0x35')]({'where':{'id':_0x52ebe9[_0xd9d3('0x52')]['id']}})[_0xd9d3('0x13')](handleEntityNotFound(_0x1b7ee2,null))[_0xd9d3('0x13')](function(_0x5113e2){if(_0x5113e2){return _0x5113e2[_0xd9d3('0x13f')](_0x52ebe9[_0xd9d3('0x5e')][_0xd9d3('0x61')],_['omit'](_0x52ebe9['body'],[_0xd9d3('0x61'),'id'])||{});}})[_0xd9d3('0x13')](respondWithResult(_0x1b7ee2,null))['catch'](handleError(_0x1b7ee2,null));};exports['removeMailAccounts']=function(_0x4b2009,_0x597488){return db[_0xd9d3('0x39')]['find']({'where':{'id':_0x4b2009[_0xd9d3('0x52')]['id']}})[_0xd9d3('0x13')](handleEntityNotFound(_0x597488,null))[_0xd9d3('0x13')](function(_0xd637a3){if(_0xd637a3){return _0xd637a3[_0xd9d3('0x140')](_0x4b2009[_0xd9d3('0x3e')][_0xd9d3('0x61')]);}})[_0xd9d3('0x13')](respondWithStatusCode(_0x597488,null))[_0xd9d3('0x1c')](handleError(_0x597488,null));};exports[_0xd9d3('0x141')]=function(_0x4c65f3,_0x244214){var _0x5e1b4f={};var _0x4712d3={};var _0x4b29eb;var _0x15e790;return db[_0xd9d3('0x39')][_0xd9d3('0xcf')]({'where':{'id':_0x4c65f3[_0xd9d3('0x52')]['id']}})[_0xd9d3('0x13')](handleEntityNotFound(_0x244214,null))[_0xd9d3('0x13')](function(_0x420ddd){if(_0x420ddd){_0x4b29eb=_0x420ddd;_0x4712d3[_0xd9d3('0x53')]=_[_0xd9d3('0x55')](db[_0xd9d3('0x142')][_0xd9d3('0x56')]);_0x4712d3[_0xd9d3('0x3e')]=_[_0xd9d3('0x55')](_0x4c65f3[_0xd9d3('0x3e')]);_0x4712d3[_0xd9d3('0x58')]=_[_0xd9d3('0x59')](_0x4712d3['model'],_0x4712d3[_0xd9d3('0x3e')]);_0x5e1b4f[_0xd9d3('0x44')]=_[_0xd9d3('0x59')](_0x4712d3[_0xd9d3('0x53')],qs[_0xd9d3('0x5a')](_0x4c65f3[_0xd9d3('0x3e')][_0xd9d3('0x5a')]));_0x5e1b4f[_0xd9d3('0x44')]=_0x5e1b4f[_0xd9d3('0x44')]['length']?_0x5e1b4f['attributes']:_0x4712d3[_0xd9d3('0x53')];_0x5e1b4f[_0xd9d3('0xc5')]=qs[_0xd9d3('0xc6')](_0x4c65f3[_0xd9d3('0x3e')][_0xd9d3('0xc6')]);_0x5e1b4f[_0xd9d3('0xc7')]=qs[_0xd9d3('0x58')](_[_0xd9d3('0xc8')](_0x4c65f3[_0xd9d3('0x3e')],_0x4712d3[_0xd9d3('0x58')]));if(_0x4c65f3[_0xd9d3('0x3e')][_0xd9d3('0x30')]){_0x5e1b4f[_0xd9d3('0xc7')]=_[_0xd9d3('0x5b')](_0x5e1b4f[_0xd9d3('0xc7')],{'$or':_[_0xd9d3('0x32')](_0x5e1b4f[_0xd9d3('0x44')],function(_0x1f31be){var _0x47490c={};_0x47490c[_0x1f31be]={'$like':'%'+_0x4c65f3[_0xd9d3('0x3e')]['filter']+'%'};return _0x47490c;})});}_0x5e1b4f=_[_0xd9d3('0x5b')]({},_0x5e1b4f,_0x4c65f3['options']);return _0x4b29eb[_0xd9d3('0x141')](_0x5e1b4f);}})['then'](function(_0x23d6e8){if(_0x23d6e8){_0x15e790=_0x23d6e8['length'];if(!_0x4c65f3[_0xd9d3('0x3e')][_0xd9d3('0xd5')](_0xd9d3('0xce'))){_0x5e1b4f[_0xd9d3('0x22')]=qs['limit'](_0x4c65f3[_0xd9d3('0x3e')][_0xd9d3('0x22')]);_0x5e1b4f[_0xd9d3('0x20')]=qs[_0xd9d3('0x20')](_0x4c65f3['query']['offset']);}return _0x4b29eb[_0xd9d3('0x141')](_0x5e1b4f);}})[_0xd9d3('0x13')](function(_0x14a84f){if(_0x14a84f){return _0x14a84f?{'count':_0x15e790,'rows':_0x14a84f}:null;}})[_0xd9d3('0x13')](respondWithResult(_0x244214,null))[_0xd9d3('0x1c')](handleError(_0x244214,null));};exports[_0xd9d3('0x143')]=function(_0x4a126c,_0x3dafb2){return db['User'][_0xd9d3('0x35')]({'where':{'id':_0x4a126c[_0xd9d3('0x52')]['id']}})['then'](handleEntityNotFound(_0x3dafb2,null))[_0xd9d3('0x13')](function(_0x22e5b7){if(_0x22e5b7){return _0x22e5b7[_0xd9d3('0x143')](_0x4a126c[_0xd9d3('0x5e')]['ids'],_[_0xd9d3('0x62')](_0x4a126c[_0xd9d3('0x5e')],[_0xd9d3('0x61'),'id'])||{});}})[_0xd9d3('0x13')](respondWithResult(_0x3dafb2,null))[_0xd9d3('0x1c')](handleError(_0x3dafb2,null));};exports[_0xd9d3('0x144')]=function(_0x5a0af4,_0x89e619){return db[_0xd9d3('0x39')][_0xd9d3('0x35')]({'where':{'id':_0x5a0af4['params']['id']}})['then'](handleEntityNotFound(_0x89e619,null))['then'](function(_0x254e75){if(_0x254e75){return _0x254e75[_0xd9d3('0x144')](_0x5a0af4[_0xd9d3('0x3e')][_0xd9d3('0x61')]);}})[_0xd9d3('0x13')](respondWithStatusCode(_0x89e619,null))[_0xd9d3('0x1c')](handleError(_0x89e619,null));};exports[_0xd9d3('0x145')]=function(_0x38c9cc,_0x5bd13f){var _0x2fb845={};var _0x29aff2={};var _0x42fa01;var _0xe2cdcf;return db[_0xd9d3('0x39')][_0xd9d3('0xcf')]({'where':{'id':_0x38c9cc['params']['id']}})['then'](handleEntityNotFound(_0x5bd13f,null))[_0xd9d3('0x13')](function(_0x442200){if(_0x442200){_0x42fa01=_0x442200;_0x29aff2[_0xd9d3('0x53')]=_[_0xd9d3('0x55')](db[_0xd9d3('0x146')][_0xd9d3('0x56')]);_0x29aff2['query']=_[_0xd9d3('0x55')](_0x38c9cc[_0xd9d3('0x3e')]);_0x29aff2[_0xd9d3('0x58')]=_[_0xd9d3('0x59')](_0x29aff2[_0xd9d3('0x53')],_0x29aff2[_0xd9d3('0x3e')]);_0x2fb845['attributes']=_['intersection'](_0x29aff2['model'],qs['fields'](_0x38c9cc[_0xd9d3('0x3e')][_0xd9d3('0x5a')]));_0x2fb845[_0xd9d3('0x44')]=_0x2fb845['attributes'][_0xd9d3('0x48')]?_0x2fb845[_0xd9d3('0x44')]:_0x29aff2[_0xd9d3('0x53')];_0x2fb845['order']=qs['sort'](_0x38c9cc[_0xd9d3('0x3e')][_0xd9d3('0xc6')]);_0x2fb845[_0xd9d3('0xc7')]=qs[_0xd9d3('0x58')](_['pick'](_0x38c9cc[_0xd9d3('0x3e')],_0x29aff2[_0xd9d3('0x58')]));if(_0x38c9cc[_0xd9d3('0x3e')][_0xd9d3('0x30')]){_0x2fb845['where']=_[_0xd9d3('0x5b')](_0x2fb845['where'],{'$or':_[_0xd9d3('0x32')](_0x2fb845[_0xd9d3('0x44')],function(_0x57531e){var _0x119259={};_0x119259[_0x57531e]={'$like':'%'+_0x38c9cc['query']['filter']+'%'};return _0x119259;})});}_0x2fb845=_[_0xd9d3('0x5b')]({},_0x2fb845,_0x38c9cc[_0xd9d3('0x5c')]);return _0x42fa01[_0xd9d3('0x145')](_0x2fb845);}})[_0xd9d3('0x13')](function(_0x5f2376){if(_0x5f2376){_0xe2cdcf=_0x5f2376['length'];if(!_0x38c9cc[_0xd9d3('0x3e')][_0xd9d3('0xd5')]('nolimit')){_0x2fb845[_0xd9d3('0x22')]=qs['limit'](_0x38c9cc[_0xd9d3('0x3e')][_0xd9d3('0x22')]);_0x2fb845['offset']=qs[_0xd9d3('0x20')](_0x38c9cc[_0xd9d3('0x3e')][_0xd9d3('0x20')]);}return _0x42fa01[_0xd9d3('0x145')](_0x2fb845);}})[_0xd9d3('0x13')](function(_0x28c622){if(_0x28c622){return _0x28c622?{'count':_0xe2cdcf,'rows':_0x28c622}:null;}})[_0xd9d3('0x13')](respondWithResult(_0x5bd13f,null))[_0xd9d3('0x1c')](handleError(_0x5bd13f,null));};exports[_0xd9d3('0x147')]=function(_0x37573f,_0x1ebda5){return db[_0xd9d3('0x39')]['find']({'where':{'id':_0x37573f[_0xd9d3('0x52')]['id']}})[_0xd9d3('0x13')](handleEntityNotFound(_0x1ebda5,null))['then'](function(_0x31a5bc){if(_0x31a5bc){return _0x31a5bc['addSmsAccounts'](_0x37573f['body'][_0xd9d3('0x61')],_['omit'](_0x37573f['body'],['ids','id'])||{});}})['then'](respondWithResult(_0x1ebda5,null))[_0xd9d3('0x1c')](handleError(_0x1ebda5,null));};exports[_0xd9d3('0x148')]=function(_0x1cc1fe,_0x54b9bb){return db['User']['find']({'where':{'id':_0x1cc1fe[_0xd9d3('0x52')]['id']}})[_0xd9d3('0x13')](handleEntityNotFound(_0x54b9bb,null))[_0xd9d3('0x13')](function(_0x4b58e1){if(_0x4b58e1){return _0x4b58e1['removeSmsAccounts'](_0x1cc1fe[_0xd9d3('0x3e')][_0xd9d3('0x61')]);}})[_0xd9d3('0x13')](respondWithStatusCode(_0x54b9bb,null))[_0xd9d3('0x1c')](handleError(_0x54b9bb,null));};exports['getChatWebsites']=function(_0x42077b,_0x3cbac0){var _0x4fa474={};var _0x3bda44={};var _0x1e61da;var _0x25600b;return db[_0xd9d3('0x39')][_0xd9d3('0xcf')]({'where':{'id':_0x42077b[_0xd9d3('0x52')]['id']}})[_0xd9d3('0x13')](handleEntityNotFound(_0x3cbac0,null))[_0xd9d3('0x13')](function(_0x22ae19){if(_0x22ae19){_0x1e61da=_0x22ae19;_0x3bda44[_0xd9d3('0x53')]=_[_0xd9d3('0x55')](db[_0xd9d3('0x149')][_0xd9d3('0x56')]);_0x3bda44[_0xd9d3('0x3e')]=_[_0xd9d3('0x55')](_0x42077b[_0xd9d3('0x3e')]);_0x3bda44[_0xd9d3('0x58')]=_[_0xd9d3('0x59')](_0x3bda44[_0xd9d3('0x53')],_0x3bda44[_0xd9d3('0x3e')]);_0x4fa474[_0xd9d3('0x44')]=_[_0xd9d3('0x59')](_0x3bda44[_0xd9d3('0x53')],qs[_0xd9d3('0x5a')](_0x42077b[_0xd9d3('0x3e')]['fields']));_0x4fa474[_0xd9d3('0x44')]=_0x4fa474[_0xd9d3('0x44')][_0xd9d3('0x48')]?_0x4fa474[_0xd9d3('0x44')]:_0x3bda44[_0xd9d3('0x53')];_0x4fa474[_0xd9d3('0xc5')]=qs[_0xd9d3('0xc6')](_0x42077b[_0xd9d3('0x3e')][_0xd9d3('0xc6')]);_0x4fa474[_0xd9d3('0xc7')]=qs[_0xd9d3('0x58')](_[_0xd9d3('0xc8')](_0x42077b[_0xd9d3('0x3e')],_0x3bda44[_0xd9d3('0x58')]));if(_0x42077b[_0xd9d3('0x3e')][_0xd9d3('0x30')]){_0x4fa474[_0xd9d3('0xc7')]=_[_0xd9d3('0x5b')](_0x4fa474[_0xd9d3('0xc7')],{'$or':_[_0xd9d3('0x32')](_0x4fa474['attributes'],function(_0x4e04d2){var _0x3af8c5={};_0x3af8c5[_0x4e04d2]={'$like':'%'+_0x42077b[_0xd9d3('0x3e')][_0xd9d3('0x30')]+'%'};return _0x3af8c5;})});}_0x4fa474=_['merge']({},_0x4fa474,_0x42077b[_0xd9d3('0x5c')]);return _0x1e61da[_0xd9d3('0x14a')](_0x4fa474);}})[_0xd9d3('0x13')](function(_0xbdfcae){if(_0xbdfcae){_0x25600b=_0xbdfcae[_0xd9d3('0x48')];if(!_0x42077b[_0xd9d3('0x3e')][_0xd9d3('0xd5')](_0xd9d3('0xce'))){_0x4fa474[_0xd9d3('0x22')]=qs[_0xd9d3('0x22')](_0x42077b[_0xd9d3('0x3e')][_0xd9d3('0x22')]);_0x4fa474[_0xd9d3('0x20')]=qs[_0xd9d3('0x20')](_0x42077b[_0xd9d3('0x3e')][_0xd9d3('0x20')]);}return _0x1e61da[_0xd9d3('0x14a')](_0x4fa474);}})[_0xd9d3('0x13')](function(_0x389fe3){if(_0x389fe3){return _0x389fe3?{'count':_0x25600b,'rows':_0x389fe3}:null;}})[_0xd9d3('0x13')](respondWithResult(_0x3cbac0,null))['catch'](handleError(_0x3cbac0,null));};exports[_0xd9d3('0x14b')]=function(_0x2e47b4,_0x3241a3){return db[_0xd9d3('0x39')][_0xd9d3('0x35')]({'where':{'id':_0x2e47b4['params']['id']}})[_0xd9d3('0x13')](handleEntityNotFound(_0x3241a3,null))[_0xd9d3('0x13')](function(_0x2cc978){if(_0x2cc978){return _0x2cc978[_0xd9d3('0x14b')](_0x2e47b4['body'][_0xd9d3('0x61')],_['omit'](_0x2e47b4[_0xd9d3('0x5e')],['ids','id'])||{});}})['then'](respondWithResult(_0x3241a3,null))['catch'](handleError(_0x3241a3,null));};exports[_0xd9d3('0x14c')]=function(_0x4744c9,_0x2fa623){return db[_0xd9d3('0x39')][_0xd9d3('0x35')]({'where':{'id':_0x4744c9[_0xd9d3('0x52')]['id']}})['then'](handleEntityNotFound(_0x2fa623,null))[_0xd9d3('0x13')](function(_0xf4928f){if(_0xf4928f){return _0xf4928f[_0xd9d3('0x14c')](_0x4744c9[_0xd9d3('0x3e')]['ids']);}})[_0xd9d3('0x13')](respondWithStatusCode(_0x2fa623,null))[_0xd9d3('0x1c')](handleError(_0x2fa623,null));};exports[_0xd9d3('0x14d')]=function(_0x3bdd6d,_0x19beb7){var _0x17afcf={};var _0x3bfdf7={};var _0xa93c7d;var _0x1526a4;return db[_0xd9d3('0x39')][_0xd9d3('0xcf')]({'where':{'id':_0x3bdd6d[_0xd9d3('0x52')]['id']}})['then'](handleEntityNotFound(_0x19beb7,null))['then'](function(_0x15a4be){if(_0x15a4be){_0xa93c7d=_0x15a4be;_0x3bfdf7[_0xd9d3('0x53')]=_[_0xd9d3('0x55')](db[_0xd9d3('0x14e')][_0xd9d3('0x56')]);_0x3bfdf7[_0xd9d3('0x3e')]=_[_0xd9d3('0x55')](_0x3bdd6d[_0xd9d3('0x3e')]);_0x3bfdf7['filters']=_['intersection'](_0x3bfdf7[_0xd9d3('0x53')],_0x3bfdf7[_0xd9d3('0x3e')]);_0x17afcf[_0xd9d3('0x44')]=_[_0xd9d3('0x59')](_0x3bfdf7[_0xd9d3('0x53')],qs[_0xd9d3('0x5a')](_0x3bdd6d['query'][_0xd9d3('0x5a')]));_0x17afcf[_0xd9d3('0x44')]=_0x17afcf[_0xd9d3('0x44')][_0xd9d3('0x48')]?_0x17afcf[_0xd9d3('0x44')]:_0x3bfdf7[_0xd9d3('0x53')];_0x17afcf[_0xd9d3('0xc5')]=qs[_0xd9d3('0xc6')](_0x3bdd6d[_0xd9d3('0x3e')][_0xd9d3('0xc6')]);_0x17afcf[_0xd9d3('0xc7')]=qs[_0xd9d3('0x58')](_[_0xd9d3('0xc8')](_0x3bdd6d[_0xd9d3('0x3e')],_0x3bfdf7['filters']));if(_0x3bdd6d[_0xd9d3('0x3e')][_0xd9d3('0x30')]){_0x17afcf[_0xd9d3('0xc7')]=_[_0xd9d3('0x5b')](_0x17afcf[_0xd9d3('0xc7')],{'$or':_['map'](_0x17afcf['attributes'],function(_0x249b21){var _0x3aa4ce={};_0x3aa4ce[_0x249b21]={'$like':'%'+_0x3bdd6d['query'][_0xd9d3('0x30')]+'%'};return _0x3aa4ce;})});}_0x17afcf=_[_0xd9d3('0x5b')]({},_0x17afcf,_0x3bdd6d['options']);return _0xa93c7d['getWhatsappAccounts'](_0x17afcf);}})['then'](function(_0x3edba8){if(_0x3edba8){_0x1526a4=_0x3edba8[_0xd9d3('0x48')];if(!_0x3bdd6d[_0xd9d3('0x3e')][_0xd9d3('0xd5')]('nolimit')){_0x17afcf[_0xd9d3('0x22')]=qs['limit'](_0x3bdd6d[_0xd9d3('0x3e')][_0xd9d3('0x22')]);_0x17afcf[_0xd9d3('0x20')]=qs['offset'](_0x3bdd6d[_0xd9d3('0x3e')][_0xd9d3('0x20')]);}return _0xa93c7d[_0xd9d3('0x14d')](_0x17afcf);}})[_0xd9d3('0x13')](function(_0x330b3a){if(_0x330b3a){return _0x330b3a?{'count':_0x1526a4,'rows':_0x330b3a}:null;}})['then'](respondWithResult(_0x19beb7,null))[_0xd9d3('0x1c')](handleError(_0x19beb7,null));};exports[_0xd9d3('0x14f')]=function(_0x5cc367,_0x325407){return db[_0xd9d3('0x39')][_0xd9d3('0x35')]({'where':{'id':_0x5cc367[_0xd9d3('0x52')]['id']}})[_0xd9d3('0x13')](handleEntityNotFound(_0x325407,null))[_0xd9d3('0x13')](function(_0x320b08){if(_0x320b08){return _0x320b08[_0xd9d3('0x14f')](_0x5cc367['body'][_0xd9d3('0x61')],_['omit'](_0x5cc367[_0xd9d3('0x5e')],[_0xd9d3('0x61'),'id'])||{});}})[_0xd9d3('0x13')](respondWithResult(_0x325407,null))[_0xd9d3('0x1c')](handleError(_0x325407,null));};exports[_0xd9d3('0x150')]=function(_0xdf9c7c,_0x5a9fae){return db[_0xd9d3('0x39')]['find']({'where':{'id':_0xdf9c7c[_0xd9d3('0x52')]['id']}})[_0xd9d3('0x13')](handleEntityNotFound(_0x5a9fae,null))[_0xd9d3('0x13')](function(_0x5e4884){if(_0x5e4884){return _0x5e4884[_0xd9d3('0x150')](_0xdf9c7c['query'][_0xd9d3('0x61')]);}})[_0xd9d3('0x13')](respondWithStatusCode(_0x5a9fae,null))[_0xd9d3('0x1c')](handleError(_0x5a9fae,null));};exports['getSquareProjects']=function(_0x12b992,_0x5dc913){var _0x15133b={};var _0x27ab5e={};var _0x35e4d3;var _0x1c0cbc;return db['User'][_0xd9d3('0xcf')]({'where':{'id':_0x12b992['params']['id']}})['then'](handleEntityNotFound(_0x5dc913,null))[_0xd9d3('0x13')](function(_0x1d515f){if(_0x1d515f){_0x35e4d3=_0x1d515f;_0x27ab5e[_0xd9d3('0x53')]=_[_0xd9d3('0x55')](db['SquareProject'][_0xd9d3('0x56')]);_0x27ab5e[_0xd9d3('0x3e')]=_[_0xd9d3('0x55')](_0x12b992[_0xd9d3('0x3e')]);_0x27ab5e['filters']=_['intersection'](_0x27ab5e[_0xd9d3('0x53')],_0x27ab5e[_0xd9d3('0x3e')]);_0x15133b[_0xd9d3('0x44')]=_[_0xd9d3('0x59')](_0x27ab5e[_0xd9d3('0x53')],qs['fields'](_0x12b992[_0xd9d3('0x3e')][_0xd9d3('0x5a')]));_0x15133b[_0xd9d3('0x44')]=_0x15133b[_0xd9d3('0x44')][_0xd9d3('0x48')]?_0x15133b[_0xd9d3('0x44')]:_0x27ab5e[_0xd9d3('0x53')];_0x15133b['order']=qs[_0xd9d3('0xc6')](_0x12b992[_0xd9d3('0x3e')][_0xd9d3('0xc6')]);_0x15133b[_0xd9d3('0xc7')]=qs[_0xd9d3('0x58')](_[_0xd9d3('0xc8')](_0x12b992[_0xd9d3('0x3e')],_0x27ab5e[_0xd9d3('0x58')]));if(_0x12b992[_0xd9d3('0x3e')]['filter']){_0x15133b[_0xd9d3('0xc7')]=_['merge'](_0x15133b[_0xd9d3('0xc7')],{'$or':_[_0xd9d3('0x32')](_0x15133b[_0xd9d3('0x44')],function(_0x1ddf02){var _0x2d09fe={};_0x2d09fe[_0x1ddf02]={'$like':'%'+_0x12b992['query']['filter']+'%'};return _0x2d09fe;})});}_0x15133b=_['merge']({},_0x15133b,_0x12b992[_0xd9d3('0x5c')]);return _0x35e4d3[_0xd9d3('0x151')](_0x15133b);}})[_0xd9d3('0x13')](function(_0x4c6351){if(_0x4c6351){_0x1c0cbc=_0x4c6351[_0xd9d3('0x48')];if(!_0x12b992['query'][_0xd9d3('0xd5')]('nolimit')){_0x15133b[_0xd9d3('0x22')]=qs[_0xd9d3('0x22')](_0x12b992[_0xd9d3('0x3e')][_0xd9d3('0x22')]);_0x15133b[_0xd9d3('0x20')]=qs['offset'](_0x12b992[_0xd9d3('0x3e')][_0xd9d3('0x20')]);}return _0x35e4d3['getSquareProjects'](_0x15133b);}})[_0xd9d3('0x13')](function(_0x20a5cb){if(_0x20a5cb){return _0x20a5cb?{'count':_0x1c0cbc,'rows':_0x20a5cb}:null;}})[_0xd9d3('0x13')](respondWithResult(_0x5dc913,null))[_0xd9d3('0x1c')](handleError(_0x5dc913,null));};exports['addSquareProjects']=function(_0x105ed4,_0x3cdf8e){return db['User'][_0xd9d3('0x35')]({'where':{'id':_0x105ed4[_0xd9d3('0x52')]['id']}})[_0xd9d3('0x13')](handleEntityNotFound(_0x3cdf8e,null))[_0xd9d3('0x13')](function(_0x224b42){if(_0x224b42){return _0x224b42[_0xd9d3('0x152')](_0x105ed4[_0xd9d3('0x5e')][_0xd9d3('0x61')],_[_0xd9d3('0x62')](_0x105ed4[_0xd9d3('0x5e')],[_0xd9d3('0x61'),'id'])||{});}})[_0xd9d3('0x13')](respondWithResult(_0x3cdf8e,null))[_0xd9d3('0x1c')](handleError(_0x3cdf8e,null));};exports[_0xd9d3('0x153')]=function(_0x3fca78,_0x13bf2a){return db[_0xd9d3('0x39')][_0xd9d3('0x35')]({'where':{'id':_0x3fca78[_0xd9d3('0x52')]['id']}})[_0xd9d3('0x13')](handleEntityNotFound(_0x13bf2a,null))[_0xd9d3('0x13')](function(_0x2ecc04){if(_0x2ecc04){return _0x2ecc04[_0xd9d3('0x153')](_0x3fca78[_0xd9d3('0x3e')][_0xd9d3('0x61')]);}})[_0xd9d3('0x13')](respondWithStatusCode(_0x13bf2a,null))[_0xd9d3('0x1c')](handleError(_0x13bf2a,null));};exports[_0xd9d3('0x154')]=function(_0x226f1f,_0x4de4bd){var _0x499898={},_0x16a7da={},_0x219e4c={'count':0x0,'rows':[]};var _0x11eeb9=db['CmHopper']['rawAttributes'];_0x16a7da[_0xd9d3('0x53')]=_[_0xd9d3('0x55')](_0x11eeb9);_0x16a7da[_0xd9d3('0x3e')]=_[_0xd9d3('0x55')](_0x226f1f[_0xd9d3('0x3e')]);_0x16a7da[_0xd9d3('0x58')]=_[_0xd9d3('0x59')](_0x16a7da['model'],_0x16a7da[_0xd9d3('0x3e')]);_0x16a7da[_0xd9d3('0x58')]=_['concat'](_0x16a7da[_0xd9d3('0x58')],[_0xd9d3('0x155'),'$or',_0xd9d3('0x156'),_0xd9d3('0x157'),_0xd9d3('0x158'),_0xd9d3('0x159'),_0xd9d3('0x15a'),_0xd9d3('0x15b'),'$not',_0xd9d3('0x15c'),_0xd9d3('0x15d'),_0xd9d3('0x15e'),_0xd9d3('0x15f'),_0xd9d3('0x160'),_0xd9d3('0x161'),'$iLike',_0xd9d3('0x162'),_0xd9d3('0x160'),_0xd9d3('0x163'),_0xd9d3('0x164'),_0xd9d3('0x165'),_0xd9d3('0x166')]);_0x499898[_0xd9d3('0x44')]=_[_0xd9d3('0x59')](_0x16a7da[_0xd9d3('0x53')],qs[_0xd9d3('0x5a')](_0x226f1f[_0xd9d3('0x3e')][_0xd9d3('0x5a')]));_0x499898[_0xd9d3('0x44')]=_0x499898[_0xd9d3('0x44')][_0xd9d3('0x48')]?_0x499898[_0xd9d3('0x44')]:_0x16a7da[_0xd9d3('0x53')];if(!_0x226f1f[_0xd9d3('0x3e')][_0xd9d3('0xd5')](_0xd9d3('0xce'))){_0x499898['limit']=qs['limit'](_0x226f1f[_0xd9d3('0x3e')]['limit']);_0x499898[_0xd9d3('0x20')]=qs[_0xd9d3('0x20')](_0x226f1f['query'][_0xd9d3('0x20')]);}_0x499898[_0xd9d3('0xc5')]=qs['sort'](_0x226f1f[_0xd9d3('0x3e')][_0xd9d3('0xc6')]);_0x499898['where']=qs[_0xd9d3('0x58')](_[_0xd9d3('0xc8')](_0x226f1f['query'],_0x16a7da[_0xd9d3('0x58')]));if(_0x226f1f['query'][_0xd9d3('0x30')]){_0x499898[_0xd9d3('0xc7')]=_[_0xd9d3('0x5b')](_0x499898[_0xd9d3('0xc7')],{'$or':_[_0xd9d3('0x32')](_0x499898[_0xd9d3('0x44')],function(_0x4de354){var _0x228ed0={};_0x228ed0[_0x4de354]={'$like':'%'+_0x226f1f[_0xd9d3('0x3e')][_0xd9d3('0x30')]+'%'};return _0x228ed0;})});}_0x499898['where']={'$and':[_0x499898[_0xd9d3('0xc7')],{'$or':[{'UserId':_0x226f1f[_0xd9d3('0x52')]['id']},{'OwnerId':_0x226f1f[_0xd9d3('0x52')]['id']}]}]};_0x499898=_[_0xd9d3('0x5b')]({},_0x499898,_0x226f1f[_0xd9d3('0x5c')]);var _0xeccae5={'where':_0x499898[_0xd9d3('0xc7')]};return db[_0xd9d3('0x167')]['count'](_0xeccae5)[_0xd9d3('0x13')](function(_0x594e66){_0x219e4c[_0xd9d3('0x23')]=_0x594e66;if(_0x226f1f[_0xd9d3('0x3e')][_0xd9d3('0x3f')]){_0x499898[_0xd9d3('0x40')]=[{'attributes':['id',_0xd9d3('0x168'),_0xd9d3('0x169'),_0xd9d3('0x16a')],'model':db[_0xd9d3('0xc4')],'as':_0xd9d3('0x16b')},{'attributes':['id','name','dialActive'],'model':db['VoiceQueue'],'as':'Queue'}];}return db['CmHopper']['findAll'](_0x499898);})[_0xd9d3('0x13')](function(_0xb29669){_0x219e4c['rows']=_0xb29669;return _0x219e4c;})['then'](respondWithFilteredResult(_0x4de4bd,_0x499898))['catch'](handleError(_0x4de4bd,null));};exports[_0xd9d3('0x16c')]=function(_0x570c1e,_0x3b971f){if(!_[_0xd9d3('0x67')](_0x570c1e[_0xd9d3('0x2c')]['id'])&&(_0x570c1e[_0xd9d3('0x2c')]['role']==_0xd9d3('0x2a')||_0x570c1e[_0xd9d3('0x2c')][_0xd9d3('0x29')]=='user')){return db[_0xd9d3('0x39')][_0xd9d3('0xcf')]({'where':{'id':_0x570c1e[_0xd9d3('0x52')]['id']},'raw':!![]})['then'](function(_0x9912c7){return authService[_0xd9d3('0x16d')](_0x9912c7);})[_0xd9d3('0x13')](function(_0x3cef52){if(_0x3cef52){return _0x3b971f[_0xd9d3('0x1f')](0xc8)['json']({'api_key':_0x3cef52['token']});}else{return _0x3b971f['status'](0xcc)[_0xd9d3('0x26')]({'message':_0xd9d3('0x16e')});}})[_0xd9d3('0x1c')](handleError(_0x3b971f,0x193));}else{return _0x3b971f[_0xd9d3('0x1f')](0x191)[_0xd9d3('0x26')]({'message':_0xd9d3('0x16f')});}};exports[_0xd9d3('0x170')]=function(_0x14d18e,_0x4eb1c3){if(!_[_0xd9d3('0x67')](_0x14d18e[_0xd9d3('0x2c')]['id'])&&(_0x14d18e[_0xd9d3('0x2c')]['role']==_0xd9d3('0x2a')||_0x14d18e[_0xd9d3('0x2c')][_0xd9d3('0x29')]==_0xd9d3('0x2c'))){return db['User'][_0xd9d3('0x35')]({'where':{'id':_0x14d18e[_0xd9d3('0x52')]['id']}})[_0xd9d3('0x13')](function(_0x2bb79d){return authService['generateApiKey'](_0x2bb79d);})[_0xd9d3('0x13')](function(_0x15ac62){return db[_0xd9d3('0x39')][_0xd9d3('0x27')]({'apiKeyIat':_0x15ac62[_0xd9d3('0x171')],'apiKeyNonce':_0x15ac62[_0xd9d3('0x172')]},{'where':{'id':_0x14d18e[_0xd9d3('0x52')]['id']}})['then'](function(){return _0x4eb1c3[_0xd9d3('0x1f')](0xc8)[_0xd9d3('0x26')]({'api_key':_0x15ac62[_0xd9d3('0x173')]});});})[_0xd9d3('0x1c')](handleError(_0x4eb1c3,0x193));}else{return _0x4eb1c3[_0xd9d3('0x1f')](0x191)[_0xd9d3('0x26')]({'message':'You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.'});}};exports[_0xd9d3('0x174')]=function(_0x22d8ce,_0x2287e3){if(!_[_0xd9d3('0x67')](_0x22d8ce[_0xd9d3('0x2c')]['id'])&&(_0x22d8ce[_0xd9d3('0x2c')][_0xd9d3('0x29')]==_0xd9d3('0x2a')||_0x22d8ce['user'][_0xd9d3('0x29')]=='user')){return db['User']['find']({'where':{'id':_0x22d8ce[_0xd9d3('0x52')]['id']}})[_0xd9d3('0x13')](handleEntityNotFound(_0x2287e3,null))['then'](function(_0x6d7d4c){if(_0x6d7d4c&&_0x6d7d4c[_0xd9d3('0x175')]&&_0x6d7d4c[_0xd9d3('0x176')])return _0x6d7d4c;else throw{'message':_0xd9d3('0x177')};})[_0xd9d3('0x13')](function(){return db[_0xd9d3('0x39')][_0xd9d3('0x27')]({'apiKeyNonce':null,'apiKeyIat':null},{'where':{'id':_0x22d8ce[_0xd9d3('0x52')]['id']}});})['then'](respondWithStatusCode(_0x2287e3,0xc8))[_0xd9d3('0x1c')](handleError(_0x2287e3,0x193));}else{return _0x2287e3[_0xd9d3('0x1f')](0x191)[_0xd9d3('0x26')]({'message':_0xd9d3('0x16f')});}};exports[_0xd9d3('0x178')]=function(_0x29fe5c,_0xd460f6){var _0x1a2fe9=_0x29fe5c['user'][_0xd9d3('0xa6')]({'plain':!![]});if(!_0x1a2fe9){return _0xd460f6['status'](0x191)[_0xd9d3('0x38')]('Unable\x20to\x20retrieve\x20the\x20current\x20user');}else{Promise['resolve']()[_0xd9d3('0x13')](function(){if(_0x29fe5c[_0xd9d3('0x3e')]['userSetting']!==_0xd9d3('0x42'))return;return _0x29fe5c[_0xd9d3('0x2c')][_0xd9d3('0x179')]();})['then'](function(_0x3fbce9){if(!_0x3fbce9)return;return _0x3fbce9[_0xd9d3('0xa6')]({'plain':!![]});})[_0xd9d3('0x13')](function(_0x2a24a4){_0x1a2fe9[_0xd9d3('0x41')]=_0x2a24a4;return _0xd460f6[_0xd9d3('0x1f')](0xc8)[_0xd9d3('0x26')](_0x1a2fe9);});}};exports[_0xd9d3('0x17a')]=function(_0x54ff03,_0x28320d){var _0x46bbc8={'offset':0x0},_0x3fc485={'count':0x0,'rows':[]};Promise[_0xd9d3('0x17b')]()[_0xd9d3('0x13')](function(){if(!_0x54ff03[_0xd9d3('0x3e')][_0xd9d3('0x30')]&&!_0x54ff03[_0xd9d3('0x3e')][_0xd9d3('0x17c')]&&!_0x54ff03['query'][_0xd9d3('0x17d')])return[];return Promise['resolve']()['then'](function(){var _0x5175cc=[];if(!_[_0xd9d3('0x87')](_0x54ff03[_0xd9d3('0x3e')]['teams'])){_0x5175cc['push'](db['Team']['findAll']({'attributes':['id',_0xd9d3('0x37')],'where':{'id':_0x54ff03[_0xd9d3('0x3e')][_0xd9d3('0x17c')]}}));}if(!_[_0xd9d3('0x87')](_0x54ff03[_0xd9d3('0x3e')]['queues'])){_0x5175cc[_0xd9d3('0x45')](db[_0xd9d3('0xa5')]['findAll']({'attributes':['id','name'],'type':_0xd9d3('0x17e'),'where':{'id':_0x54ff03[_0xd9d3('0x3e')][_0xd9d3('0x17d')]}}));}return Promise['all'](_0x5175cc);})[_0xd9d3('0x13')](function(_0x1e1c9d){var _0x3e77eb=_['flatten'](_0x1e1c9d)[_0xd9d3('0x32')](function(_0x52fa91){return _0x52fa91['getAgents']({'attributes':['id','name',_0xd9d3('0x65'),_0xd9d3('0x99')],'raw':!![]});});return Promise[_0xd9d3('0x50')](_0x3e77eb);})['then'](function(_0x52099a){var _0x39c3a4=_[_0xd9d3('0x116')](_0x52099a);if(!_0x54ff03[_0xd9d3('0x3e')][_0xd9d3('0x30')])return _0x39c3a4;if(_[_0xd9d3('0x87')](_0x39c3a4)){return db[_0xd9d3('0x39')][_0xd9d3('0x46')]({'attributes':['id',_0xd9d3('0x37'),_0xd9d3('0x65'),_0xd9d3('0x99')],'where':{'role':_0xd9d3('0x2e'),'$or':[db[_0xd9d3('0x68')]['where'](db[_0xd9d3('0x68')]['fn'](_0xd9d3('0x17f'),db[_0xd9d3('0x68')][_0xd9d3('0x180')](_0xd9d3('0x37'))),{'$like':'%'+_0x54ff03[_0xd9d3('0x3e')]['filter'][_0xd9d3('0xa0')]()+'%'}),{'internal':{'$like':'%'+_0x54ff03['query'][_0xd9d3('0x30')]+'%'}}]},'raw':!![]});}else{return _(_0x39c3a4)[_0xd9d3('0x116')]()[_0xd9d3('0x30')](function(_0x16180f){return _0x16180f[_0xd9d3('0x37')][_0xd9d3('0xa0')]()[_0xd9d3('0x34')](_0x54ff03[_0xd9d3('0x3e')]['filter']['toLowerCase']())||_0x16180f[_0xd9d3('0x65')]['toString']()[_0xd9d3('0x34')](_0x54ff03[_0xd9d3('0x3e')][_0xd9d3('0x30')]);})[_0xd9d3('0x33')]();}})[_0xd9d3('0x13')](function(_0x1e4ae3){var _0x3966c1=_0xd9d3('0x37');var _0x345842=_0xd9d3('0x181');if(_0x54ff03['query'][_0xd9d3('0xc6')]){_0x345842=_0x54ff03[_0xd9d3('0x3e')][_0xd9d3('0xc6')][0x0]==='-'?_0xd9d3('0x182'):'asc';_0x3966c1=_0x345842===_0xd9d3('0x181')?_0x54ff03[_0xd9d3('0x3e')][_0xd9d3('0xc6')]:_0x54ff03[_0xd9d3('0x3e')]['sort'][_0xd9d3('0x183')](0x1);}return _(_0x1e4ae3)[_0xd9d3('0x184')]('id')['orderBy']([function(_0x4773e5){return _0x3966c1===_0xd9d3('0x37')?_0x4773e5[_0x3966c1][_0xd9d3('0xa0')]():_0x4773e5[_0x3966c1];}],[_0x345842])['map'](function(_0x3ce7d1){return _[_0xd9d3('0xc8')](_0x3ce7d1,['id',_0xd9d3('0x37'),'internal',_0xd9d3('0x99')]);})[_0xd9d3('0x33')]();})[_0xd9d3('0x13')](function(_0x5151b5){return client[_0xd9d3('0x12')](_0xd9d3('0x2d'),_0x54ff03)[_0xd9d3('0x13')](function(_0x5c315a){if(_0x5c315a[_0xd9d3('0x19')])throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)');var _0x469844=_0x5c315a['result'];var _0x22692f=jayson['client']['http']({'port':0x232c});return _0x22692f[_0xd9d3('0x12')](_0xd9d3('0x2d'),_0x54ff03)[_0xd9d3('0x13')](function(_0x5be471){if(_0x5be471[_0xd9d3('0x19')])throw new Error(_0xd9d3('0x185'));var _0x2ed7b1=_0x5be471[_0xd9d3('0x186')];return _[_0xd9d3('0x5b')]({},_0x2ed7b1,_0x469844);});})[_0xd9d3('0x13')](function(_0x2fd58c){return _[_0xd9d3('0x32')](_0x5151b5,function(_0x234ff5){var _0x44c41b=_[_0xd9d3('0x35')](_0x2fd58c[_0xd9d3('0x47')],['id',_0x234ff5['id']]);if(!_0x44c41b||!_0x234ff5['online']){_0x234ff5[_0xd9d3('0x1f')]=_0xd9d3('0x187');}else if(_0x44c41b[_0xd9d3('0xaa')]){_0x234ff5['status']=_0xd9d3('0xfb');}else{_0x234ff5[_0xd9d3('0x1f')]=_[_0xd9d3('0x34')]([_0xd9d3('0x188'),'unknown','unavailable',_0xd9d3('0x189'),null,undefined],_0x44c41b[_0xd9d3('0x18a')])?_0xd9d3('0x99'):'busy';}return _0x234ff5;});});});})[_0xd9d3('0x13')](function(_0x161b08){if(!_0x54ff03[_0xd9d3('0x3e')][_0xd9d3('0xd5')]('nolimit')){_0x46bbc8[_0xd9d3('0x22')]=qs[_0xd9d3('0x22')](_0x54ff03[_0xd9d3('0x3e')][_0xd9d3('0x22')]||0xa);_0x46bbc8['offset']=qs[_0xd9d3('0x20')](_0x54ff03[_0xd9d3('0x3e')]['offset']);}_0x3fc485['count']=_0x161b08[_0xd9d3('0x48')];_0x3fc485[_0xd9d3('0x47')]=_0x46bbc8[_0xd9d3('0x22')]?_0x161b08['slice'](_0x46bbc8[_0xd9d3('0x20')],_0x46bbc8[_0xd9d3('0x20')]+_0x46bbc8[_0xd9d3('0x22')]):_0x161b08;return _0x3fc485;})[_0xd9d3('0x13')](respondWithFilteredResult(_0x28320d,_0x46bbc8))[_0xd9d3('0x1c')](handleError(_0x28320d,null));};function get_open_tabs(_0x1a948c,_0x5e0730){var _0x167cdd=_0x1a948c[_0xd9d3('0x18b')](0x0)[_0xd9d3('0x18c')]()+_0x1a948c[_0xd9d3('0x18d')](0x1);var _0x1d9de3={'type':db[_0xd9d3('0x8a')][_0xd9d3('0x6a')][_0xd9d3('0x6b')],'raw':!![]};return new BPromise(function(_0x5ecb7b,_0x7f7784){var _0x1393e8=squel[_0xd9d3('0x18e')]()[_0xd9d3('0x18f')](_0xd9d3('0x190')+_0x167cdd+_0xd9d3('0x191'),'id')['field']('ui.createdAt')['from'](_0xd9d3('0x192')+_0x1a948c+_0xd9d3('0x193'),'ui')[_0xd9d3('0xc7')](_0xd9d3('0x194'),_0x5e0730['id']);return db[_0xd9d3('0x68')][_0xd9d3('0x3e')](_0x1393e8[_0xd9d3('0x195')](),_0x1d9de3)[_0xd9d3('0x13')](function(_0x4edb6d){_0x5e0730[_0x167cdd+_0xd9d3('0x196')]=_0x4edb6d;_0x5ecb7b(_0x4edb6d);})[_0xd9d3('0x1c')](function(_0x3d3bdc){_0x7f7784(_0x3d3bdc);});});}
\ No newline at end of file
+var _0xf218=['tag','nolimit','getQueues','pick','options','Queue','Unknown\x20role','getVoiceQueuesRt','getGroups','getRecordings','VoiceRecording','UserId','getScreenRecordings','ScreenRecording','getChatInteractions','ChatInteraction','OpenchannelInteraction','getOpenchannelInteractions','getMailInteractions','MailInteraction','getSmsInteractions','SmsInteraction','getFaxInteractions','FaxInteraction','getWhatsappInteractions','WhatsappInteraction','login','phone','mobile','LOCAL/%s@from-sip/n','intrf','user:forcelogout','connection','remoteAddress','socket','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','getVoiceQueues','UserVoiceQueue.penalty','MemberReport','forEach','getChannels','LOGIN','device','PAUSE','LOGININPAUSE','YYYY-MM-DD\x20HH:mm:ss','isMiddleware','logout','pause','QueuePause','updateAttributes','DEFAULT\x20PAUSE','mailPause','chatPause','faxPause','openchannelPause','smsPause','pauseType','lastPauseAt','unpause','manual','set','getTeams','Team','addTeams','omit','Voice','getChatQueues','setDataValue','Chat','getMailQueues','Mail','getSmsQueues','Sms','Whatsapp','Fax','getOpenchannelQueues','Openchannel','flatten','transaction','addAgent','getDataValue','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','removeTeams','getWhatsappQueues','getFaxQueues','removeAgent','getLists','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','spread','user_has_chat_interactions:save','removeChatInteractions','user_has_chat_interactions:remove','addMailInteractions','user_has_mail_interactions:save','isArray','user_has_mail_interactions:remove','addFaxInteractions','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','addWhatsappInteractions','user_has_whatsapp_interactions:save','removeWhatsappInteractions','getVoicePrefixes','VoicePrefix','getFaxAccounts','FaxAccount','addFaxAccounts','removeFaxAccounts','getMailAccounts','MailAccount','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','OpenchannelAccount','addOpenchannelAccounts','removeOpenchannelAccounts','addSmsAccounts','removeSmsAccounts','getChatWebsites','ChatWebsite','addChatWebsites','getWhatsappAccounts','addWhatsappAccounts','removeWhatsappAccounts','SquareProject','getSquareProjects','addSquareProjects','removeSquareProjects','getScheduledCalls','CmHopper','$gt','$gte','$lt','$lte','$notIn','$notLike','$iLike','$like','$contains','$contained','lastName','dialActive','getApiKey','retrieveApiKey','token','No\x20API\x20access\x20key\x20found!','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','generateApiKey','iat','nonce','apiKeyNonce','apiKeyIat','whoami','Unable\x20to\x20retrieve\x20the\x20current\x20user','resolve','getUserSetting','getPresence','queues','isEmpty','teams','inbound','getAgents','lower','col','asc','desc','request','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','offline','unknown','unavailable','ringing','voiceStatus','busy','slice','toUpperCase','select','field','InteractionId','ui.createdAt','user_has_','_interactions','ui.UserId\x20=\x20?','toString','OpenTabs','moment','bluebird','util','path','squel','jayson/promise','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','socket.io-emitter','redis','./user.socket','register','defaults','localhost','client','http','User,\x20%s,\x20%s','request\x20sent','debug','User,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','status','end','offset','limit','undefined','count','json','update','then','get','role','admin','Users','user','agent','Telephones','telephone','filter','ignore','value','includes','find','UserProfileResource','stack','name','send','index','User','rawAttributes','map','type','key','password','salt','getOptions','where','query','includeAll','include','true','UserSetting','attributes','push','rows','length','chat','dataValues','fax','mail','openchannel','whatsapp','all','show','params','model','differenceBy','keys','filters','intersection','fields','userSetting','merge','openTabs','sms','body','describe','addContacts','ids','internal','findById','securePassword','validatePasswordPattern','max','isNil','min_internal','sequelize','QueryTypes','SELECT','from','voicemail','mailbox','VoiceMail','fullname','email','101','102','110','104','105','106','107','100','111','114','115','create','Unauthorized','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','checkUserLimits','settingsEnabled','userProfileId','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','bulkCreate','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator','each','findAll','Agents','some','compact','changePassword','oldPassword','newPassword','Sequelize','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','authenticate','ValidationError','Wrong\x20credentials','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','enforcePasswordHistory','passwordHistoryLimit','previousPasswords','updatePasswordsHistory','addQueues','channel','online','loginInPause','voicePause','interface','isValidChannel','Unknown\x20channel','toLowerCase','Queues','capitalize','QueueId','emit','Queue:save','voice','VoiceQueue','format','SIP/%s','penalty','UserVoiceQueueRt','upsert','removeQueues','remove','Queue:remove','destroy','addAvatar','getAvatar','join','server/files/images/logos/default_profile.png','userpic','server/files/images/','download','getOpenTabs','CHAT','createdAt','FaxOpenTabs','FAX','OpenchannelOpenTabs','OPENCHANNEL','MAIL','SmsOpenTabs','SMS','WhatsappOpenTabs','WHATSAPP','concat','getContacts','findOne','order','sort','hasOwnProperty','CmList','List','Tag','color'];(function(_0x11155f,_0x57b687){var _0xd07e48=function(_0x592615){while(--_0x592615){_0x11155f['push'](_0x11155f['shift']());}};_0xd07e48(++_0x57b687);}(_0xf218,0xc5));var _0x8f21=function(_0x20cea6,_0x3a0611){_0x20cea6=_0x20cea6-0x0;var _0x29f2ae=_0xf218[_0x20cea6];return _0x29f2ae;};'use strict';var moment=require(_0x8f21('0x0'));var BPromise=require(_0x8f21('0x1'));var util=require(_0x8f21('0x2'));var path=require(_0x8f21('0x3'));var fs=require('fs');var _=require('lodash');var squel=require(_0x8f21('0x4'));var jayson=require(_0x8f21('0x5'));var Redis=require(_0x8f21('0x6'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var logger=require(_0x8f21('0x7'))(_0x8f21('0x8'));var utils=require('../../config/utils');var config=require(_0x8f21('0x9'));var licenseUtil=require('../../config/license/util');var db=require(_0x8f21('0xa'))['db'];var socket=require(_0x8f21('0xb'))(new Redis(config[_0x8f21('0xc')]));require(_0x8f21('0xd'))[_0x8f21('0xe')](socket);config['redis']=_[_0x8f21('0xf')](config[_0x8f21('0xc')],{'host':_0x8f21('0x10'),'port':0x18eb});var client=jayson[_0x8f21('0x11')][_0x8f21('0x12')]({'port':0x232a});var values;function respondWithRpcPromise(_0x20386c,_0x1d1e4f,_0x41455b,_0x1efa58){return new BPromise(function(_0x3dc5aa,_0x39339d){var _0x144f49=_0x1efa58||client;return _0x144f49['request'](_0x20386c,_0x41455b)['then'](function(_0x1ecdbe){logger['info'](_0x8f21('0x13'),_0x1d1e4f,_0x8f21('0x14'));logger[_0x8f21('0x15')](_0x8f21('0x16'),_0x1d1e4f,_0x8f21('0x14'),JSON[_0x8f21('0x17')](_0x1ecdbe));if(_0x1ecdbe['error']){if(_0x1ecdbe[_0x8f21('0x18')][_0x8f21('0x19')]===0x1f4){logger[_0x8f21('0x18')]('User,\x20%s,\x20%s',_0x1d1e4f,_0x1ecdbe[_0x8f21('0x18')][_0x8f21('0x1a')]);return _0x39339d(_0x1ecdbe[_0x8f21('0x18')][_0x8f21('0x1a')]);}logger[_0x8f21('0x18')](_0x8f21('0x13'),_0x1d1e4f,_0x1ecdbe[_0x8f21('0x18')][_0x8f21('0x1a')]);return _0x3dc5aa(_0x1ecdbe[_0x8f21('0x18')][_0x8f21('0x1a')]);}else{logger[_0x8f21('0x1b')]('User,\x20%s,\x20%s',_0x1d1e4f,'request\x20sent');_0x3dc5aa(_0x1ecdbe[_0x8f21('0x1c')][_0x8f21('0x1a')]);}})[_0x8f21('0x1d')](function(_0x29c9d9){logger[_0x8f21('0x18')](_0x8f21('0x13'),_0x1d1e4f,_0x29c9d9);_0x39339d(_0x29c9d9);});});}function respondWithStatusCode(_0x1111f8,_0x2d2024){_0x2d2024=_0x2d2024||0xcc;return function(_0x553cc5){if(_0x553cc5){return _0x1111f8[_0x8f21('0x1e')](_0x2d2024);}return _0x1111f8[_0x8f21('0x1f')](_0x2d2024)[_0x8f21('0x20')]();};}function respondWithResult(_0x5595ba,_0x4fc920){_0x4fc920=_0x4fc920||0xc8;return function(_0x2a0037){if(_0x2a0037){return _0x5595ba[_0x8f21('0x1f')](_0x4fc920)['json'](_0x2a0037);}};}function respondWithFilteredResult(_0x13fa17,_0x45c15a){return function(_0x4beee3){if(_0x4beee3){var _0x1aa516=typeof _0x45c15a[_0x8f21('0x21')]==='undefined'&&typeof _0x45c15a[_0x8f21('0x22')]===_0x8f21('0x23');var _0x3d8145=_0x4beee3['count'];var _0x4cf088=_0x1aa516?0x0:_0x45c15a[_0x8f21('0x21')];var _0xb1cb22=_0x1aa516?_0x4beee3[_0x8f21('0x24')]:_0x45c15a[_0x8f21('0x21')]+_0x45c15a[_0x8f21('0x22')];var _0x1fd15b;if(_0xb1cb22>=_0x3d8145){_0xb1cb22=_0x3d8145;_0x1fd15b=0xc8;}else{_0x1fd15b=0xce;}_0x13fa17[_0x8f21('0x1f')](_0x1fd15b);return _0x13fa17['set']('Content-Range',_0x4cf088+'-'+_0xb1cb22+'/'+_0x3d8145)[_0x8f21('0x25')](_0x4beee3);}return null;};}function saveUpdates(_0x3a434){return function(_0xa01164){if(_0xa01164){return _0xa01164[_0x8f21('0x26')](_0x3a434)['then'](function(_0xceaa98){return _0xceaa98;});}return null;};}function removeEntity(_0x3c2b6c){return function(_0x28d32c){if(_0x28d32c){return _0x28d32c['destroy']()[_0x8f21('0x27')](function(){var _0x401d60=_0x28d32c[_0x8f21('0x28')]({'plain':!![]});if(_0x401d60[_0x8f21('0x29')]===_0x8f21('0x2a'))return;var _0x32c73c=[{'name':_0x8f21('0x2b'),'value':_0x8f21('0x2c'),'ignore':!![]},{'name':'Agents','value':_0x8f21('0x2d'),'ignore':![]},{'name':_0x8f21('0x2e'),'value':_0x8f21('0x2f'),'ignore':![]}];var _0x4268db=_(_0x32c73c)[_0x8f21('0x30')](_0x8f21('0x31'))['map'](_0x8f21('0x32'))['value']();if(_[_0x8f21('0x33')](_0x4268db,_0x401d60[_0x8f21('0x29')])){return;}var _0x33c84c=_[_0x8f21('0x34')](_0x32c73c,[_0x8f21('0x32'),_0x401d60['role']])['name'];return db[_0x8f21('0x35')]['destroy']({'where':{'type':_0x33c84c,'resourceId':_0x401d60['id']}})[_0x8f21('0x27')](function(){return _0x28d32c;});})[_0x8f21('0x27')](function(){_0x3c2b6c['status'](0xcc)[_0x8f21('0x20')]();});}};}function handleEntityNotFound(_0x671f5e){return function(_0x5d005e){if(!_0x5d005e){_0x671f5e[_0x8f21('0x1e')](0x194);}return _0x5d005e;};}function handleError(_0x986491,_0x320cb0){_0x320cb0=_0x320cb0||0x1f4;return function(_0x39acee){logger[_0x8f21('0x18')](_0x39acee[_0x8f21('0x36')]);if(_0x39acee[_0x8f21('0x37')]){delete _0x39acee['name'];}_0x986491[_0x8f21('0x1f')](_0x320cb0)[_0x8f21('0x38')](_0x39acee);};}exports[_0x8f21('0x39')]=function(_0x13dc7f,_0x254a45){var _0x2f9476={},_0x1dd785={'count':0x0,'rows':[]};var _0x41714b=_(db[_0x8f21('0x3a')][_0x8f21('0x3b')])[_0x8f21('0x3c')](function(_0x49f9bd){return{'name':_0x49f9bd['fieldName'],'type':_0x49f9bd[_0x8f21('0x3d')][_0x8f21('0x3e')]};})[_0x8f21('0x30')](function(_0x1f7b9d){return!_[_0x8f21('0x33')]([_0x8f21('0x3f'),_0x8f21('0x40')],_0x1f7b9d[_0x8f21('0x37')]);})[_0x8f21('0x32')]();_0x2f9476=qs[_0x8f21('0x41')](_0x41714b,_0x13dc7f);var _0x3e443a={'where':_0x2f9476[_0x8f21('0x42')]};return db[_0x8f21('0x3a')][_0x8f21('0x24')](_0x3e443a)[_0x8f21('0x27')](function(_0x55cff6){_0x1dd785[_0x8f21('0x24')]=_0x55cff6;if(_0x13dc7f[_0x8f21('0x43')][_0x8f21('0x44')]){_0x2f9476[_0x8f21('0x45')]=[{'all':!![]}];}if(_0x13dc7f[_0x8f21('0x43')]['userSetting']===_0x8f21('0x46')){_0x2f9476[_0x8f21('0x45')]=[{'model':db[_0x8f21('0x47')],'as':'userSetting'}];}if(!_[_0x8f21('0x33')](_0x2f9476[_0x8f21('0x48')],'id')){_0x2f9476[_0x8f21('0x48')][_0x8f21('0x49')]('id');}return db[_0x8f21('0x3a')]['findAll'](_0x2f9476);})[_0x8f21('0x27')](function(_0x2396a4){_0x1dd785[_0x8f21('0x4a')]=_0x2396a4;if(_0x13dc7f[_0x8f21('0x43')]['openTabs']===_0x8f21('0x46')){var _0x8d8c85=[];for(var _0xde6cde=0x0;_0xde6cde<_0x1dd785['rows'][_0x8f21('0x4b')];_0xde6cde++){_0x8d8c85['push'](get_open_tabs(_0x8f21('0x4c'),_0x1dd785['rows'][_0xde6cde][_0x8f21('0x4d')]));_0x8d8c85['push'](get_open_tabs('sms',_0x1dd785[_0x8f21('0x4a')][_0xde6cde][_0x8f21('0x4d')]));_0x8d8c85['push'](get_open_tabs(_0x8f21('0x4e'),_0x1dd785['rows'][_0xde6cde]['dataValues']));_0x8d8c85[_0x8f21('0x49')](get_open_tabs(_0x8f21('0x4f'),_0x1dd785[_0x8f21('0x4a')][_0xde6cde][_0x8f21('0x4d')]));_0x8d8c85[_0x8f21('0x49')](get_open_tabs(_0x8f21('0x50'),_0x1dd785[_0x8f21('0x4a')][_0xde6cde]['dataValues']));_0x8d8c85[_0x8f21('0x49')](get_open_tabs(_0x8f21('0x51'),_0x1dd785[_0x8f21('0x4a')][_0xde6cde][_0x8f21('0x4d')]));}return BPromise[_0x8f21('0x52')](_0x8d8c85)[_0x8f21('0x27')](function(){return _0x1dd785;});}else{return _0x1dd785;}})[_0x8f21('0x27')](respondWithFilteredResult(_0x254a45,_0x2f9476))[_0x8f21('0x1d')](handleError(_0x254a45,null));};exports[_0x8f21('0x53')]=function(_0x4b61e6,_0x256853){var _0x11e475={'raw':![],'where':{'id':_0x4b61e6[_0x8f21('0x54')]['id']}},_0x1c1bbb={};_0x1c1bbb[_0x8f21('0x55')]=_[_0x8f21('0x56')](_['keys'](db[_0x8f21('0x3a')][_0x8f21('0x3b')]),[_0x8f21('0x3f'),'salt']);_0x1c1bbb[_0x8f21('0x43')]=_[_0x8f21('0x57')](_0x4b61e6[_0x8f21('0x43')]);_0x1c1bbb[_0x8f21('0x58')]=_[_0x8f21('0x59')](_0x1c1bbb[_0x8f21('0x55')],_0x1c1bbb[_0x8f21('0x43')]);_0x11e475['attributes']=_[_0x8f21('0x59')](_0x1c1bbb[_0x8f21('0x55')],qs[_0x8f21('0x5a')](_0x4b61e6[_0x8f21('0x43')]['fields']));_0x11e475[_0x8f21('0x48')]=_0x11e475[_0x8f21('0x48')]['length']?_0x11e475[_0x8f21('0x48')]:_0x1c1bbb[_0x8f21('0x55')];if(_0x4b61e6[_0x8f21('0x43')][_0x8f21('0x44')]){_0x11e475[_0x8f21('0x45')]=[{'all':!![]}];}if(_0x4b61e6['query'][_0x8f21('0x5b')]===_0x8f21('0x46')){_0x11e475['include']=[{'model':db[_0x8f21('0x47')],'as':_0x8f21('0x5b')}];}_0x11e475=_[_0x8f21('0x5c')]({},_0x11e475,_0x4b61e6['options']);if(!_[_0x8f21('0x33')](_0x11e475[_0x8f21('0x48')],'id')){_0x11e475[_0x8f21('0x48')][_0x8f21('0x49')]('id');}return db['User']['find'](_0x11e475)['then'](handleEntityNotFound(_0x256853,null))[_0x8f21('0x27')](function(_0x49ff9e){var _0x5125f9=[];values=_0x49ff9e;if(_0x4b61e6[_0x8f21('0x43')][_0x8f21('0x5d')]==='true'){_0x5125f9['push'](get_open_tabs('chat',_0x49ff9e[_0x8f21('0x4d')]));_0x5125f9[_0x8f21('0x49')](get_open_tabs(_0x8f21('0x5e'),_0x49ff9e[_0x8f21('0x4d')]));_0x5125f9[_0x8f21('0x49')](get_open_tabs(_0x8f21('0x50'),_0x49ff9e['dataValues']));_0x5125f9[_0x8f21('0x49')](get_open_tabs(_0x8f21('0x51'),_0x49ff9e['dataValues']));_0x5125f9[_0x8f21('0x49')](get_open_tabs(_0x8f21('0x4e'),_0x49ff9e[_0x8f21('0x4d')]));_0x5125f9['push'](get_open_tabs(_0x8f21('0x4f'),_0x49ff9e['dataValues']));return BPromise['all'](_0x5125f9);}else{return values;}})[_0x8f21('0x27')](function(){return values;})[_0x8f21('0x27')](respondWithResult(_0x256853,null))[_0x8f21('0x1d')](handleError(_0x256853,null));};exports[_0x8f21('0x26')]=function(_0x3769ed,_0x46e9d7){if(_0x3769ed['body']['id']){delete _0x3769ed[_0x8f21('0x5f')]['id'];}delete _0x3769ed[_0x8f21('0x5f')][_0x8f21('0x29')];return db[_0x8f21('0x3a')][_0x8f21('0x34')]({'where':{'id':_0x3769ed[_0x8f21('0x54')]['id']}})[_0x8f21('0x27')](handleEntityNotFound(_0x46e9d7,null))['then'](saveUpdates(_0x3769ed['body'],null))[_0x8f21('0x27')](respondWithResult(_0x46e9d7,null))[_0x8f21('0x1d')](handleError(_0x46e9d7,null));};exports[_0x8f21('0x60')]=function(_0x399863,_0x5af204){return db[_0x8f21('0x3a')]['describe']()[_0x8f21('0x27')](respondWithResult(_0x5af204,null))[_0x8f21('0x1d')](handleError(_0x5af204,null));};exports[_0x8f21('0x61')]=function(_0x46ca60,_0x2412cd){return db[_0x8f21('0x3a')]['find']({'where':{'id':_0x46ca60['params']['id']}})[_0x8f21('0x27')](handleEntityNotFound(_0x2412cd,null))[_0x8f21('0x27')](function(_0x1dc473){if(_0x1dc473){return _0x1dc473[_0x8f21('0x61')](_0x46ca60[_0x8f21('0x5f')][_0x8f21('0x62')],_['omit'](_0x46ca60[_0x8f21('0x5f')],[_0x8f21('0x62'),'id'])||{});}})[_0x8f21('0x27')](respondWithResult(_0x2412cd,null))[_0x8f21('0x1d')](handleError(_0x2412cd,null));};function validateUser(_0x45fd8e){return new BPromise(function(_0x4283ba,_0x553046){if(_0x45fd8e[_0x8f21('0x63')])return _0x4283ba(_0x45fd8e);return db['Setting'][_0x8f21('0x64')](0x1)[_0x8f21('0x27')](function(_0x27a8e0){if(_0x27a8e0[_0x8f21('0x65')])authService[_0x8f21('0x66')](_0x45fd8e[_0x8f21('0x3f')]);db[_0x8f21('0x3a')][_0x8f21('0x67')]('internal')[_0x8f21('0x27')](function(_0x55c79e){if(_[_0x8f21('0x68')](_0x55c79e)){_0x45fd8e['internal']=_0x27a8e0[_0x8f21('0x69')]||0x1;return;}if(_[_0x8f21('0x68')](_0x27a8e0['min_internal'])||_0x27a8e0[_0x8f21('0x69')]===_0x55c79e){_0x45fd8e[_0x8f21('0x63')]=_0x55c79e+0x1;return;}if(_0x27a8e0[_0x8f21('0x69')]>_0x55c79e){_0x45fd8e[_0x8f21('0x63')]=_0x27a8e0[_0x8f21('0x69')];return;}return db[_0x8f21('0x6a')][_0x8f21('0x43')]('select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)',{'type':db[_0x8f21('0x6a')][_0x8f21('0x6b')][_0x8f21('0x6c')]})['then'](function(_0x109a23){if(_0x109a23&&_0x109a23['length']){for(var _0x1f4a23=0x0,_0x3d4b6b=_0x109a23['length'];_0x1f4a23<_0x3d4b6b&&_['isNil'](_0x45fd8e[_0x8f21('0x63')]);_0x1f4a23++){if(_0x27a8e0[_0x8f21('0x69')]<=_0x109a23[_0x1f4a23][_0x8f21('0x6d')]){_0x45fd8e[_0x8f21('0x63')]=_0x109a23[_0x1f4a23][_0x8f21('0x6d')];}else if(_0x27a8e0['min_internal']>_0x109a23[_0x1f4a23][_0x8f21('0x6d')]&&_0x27a8e0[_0x8f21('0x69')]<=_0x109a23[_0x1f4a23]['to']){_0x45fd8e[_0x8f21('0x63')]=_0x27a8e0[_0x8f21('0x69')];}}}if(_[_0x8f21('0x68')](_0x45fd8e[_0x8f21('0x63')])){_0x45fd8e[_0x8f21('0x63')]=_0x55c79e+0x1;}return _0x4283ba(_0x45fd8e);});});})[_0x8f21('0x1d')](function(_0xf45d20){_0x553046(_0xf45d20);});});}function updateUser(_0x3d6e48){return new BPromise(function(_0x544f11,_0x560b8e){try{if(_0x3d6e48[_0x8f21('0x6e')]){_0x3d6e48[_0x8f21('0x6f')]=_0x3d6e48[_0x8f21('0x63')];_0x3d6e48[_0x8f21('0x70')]={'mailbox':_0x3d6e48[_0x8f21('0x63')],'password':_0x3d6e48[_0x8f21('0x3f')],'fullname':_0x3d6e48[_0x8f21('0x71')],'email':_0x3d6e48[_0x8f21('0x72')]};}if(_0x3d6e48['role']===_0x8f21('0x2d')){if(!_0x3d6e48['permissions'])_0x3d6e48['permissions']=[_0x8f21('0x73'),_0x8f21('0x74'),'103','113',_0x8f21('0x75'),_0x8f21('0x76'),_0x8f21('0x77'),_0x8f21('0x78'),_0x8f21('0x79'),'108','109',_0x8f21('0x7a'),_0x8f21('0x7b'),_0x8f21('0x7c'),_0x8f21('0x7d')];}_0x544f11(_0x3d6e48);}catch(_0x64048d){_0x560b8e(_0x64048d);}});}exports[_0x8f21('0x7e')]=function(_0x313134,_0x34efeb){if(_0x313134[_0x8f21('0x2c')][_0x8f21('0x29')]===_0x8f21('0x2d'))throw new Error(_0x8f21('0x7f'));if(_0x313134[_0x8f21('0x5f')][_0x8f21('0x29')]===_0x8f21('0x2c')&&_0x313134[_0x8f21('0x2c')][_0x8f21('0x29')]!==_0x8f21('0x2a')){throw new Error(_0x8f21('0x80'));}if(_0x313134['body'][_0x8f21('0x29')]==='admin'&&_0x313134[_0x8f21('0x2c')]['role']!==_0x8f21('0x2a')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator');}return licenseUtil[_0x8f21('0x81')]([_0x313134[_0x8f21('0x5f')]])[_0x8f21('0x27')](function(){return validateUser(_0x313134['body']);})['then'](function(_0xe3069c){return updateUser(_0xe3069c)['then'](function(_0x2d091c){if(_0x2d091c[_0x8f21('0x29')]===_0x8f21('0x2a')){_0x2d091c[_0x8f21('0x82')]=_0x313134[_0x8f21('0x2c')][_0x8f21('0x82')];delete _0x2d091c[_0x8f21('0x83')];}return _0x2d091c;});})['then'](function(_0x1a7b05){return db[_0x8f21('0x3a')]['create'](_0x1a7b05,{'include':[{'model':db[_0x8f21('0x70')],'as':'VoiceMail'}]});})[_0x8f21('0x27')](function(_0x5258fb){if(_0x313134['body']['role']===_0x8f21('0x2c'))return _0x5258fb;if(_0x313134['user'][_0x8f21('0x29')]!==_0x8f21('0x2c'))return _0x5258fb;return db[_0x8f21('0x84')][_0x8f21('0x34')]({'where':{'name':_0x5258fb[_0x8f21('0x29')]===_0x8f21('0x2d')?'Agents':'Telephones','userProfileId':_0x313134['user'][_0x8f21('0x83')]},'raw':!![]})[_0x8f21('0x27')](function(_0x57a901){if(!_0x57a901||_0x57a901[_0x8f21('0x85')]!=0x0)return _0x5258fb;return db[_0x8f21('0x35')]['create']({'name':_0x5258fb[_0x8f21('0x37')],'resourceId':_0x5258fb['id'],'type':_0x57a901['name'],'sectionId':_0x57a901['id']},{})[_0x8f21('0x27')](function(){return _0x5258fb;});})['catch'](function(_0xfaf60d){logger['error'](_0x8f21('0x86'),_0xfaf60d);throw _0xfaf60d;});})[_0x8f21('0x27')](respondWithResult(_0x34efeb,0xc9))[_0x8f21('0x1d')](handleError(_0x34efeb,null));};exports[_0x8f21('0x87')]=function(_0x2d83ae,_0xc37082){var _0x3118da=_0x2d83ae['body'];var _0x6ccf7c=[];if(_0x2d83ae[_0x8f21('0x2c')][_0x8f21('0x29')]===_0x8f21('0x2d'))throw new Error(_0x8f21('0x7f'));if(_['some'](_0x3118da,['role',_0x8f21('0x2c')])&&_0x2d83ae[_0x8f21('0x2c')]['role']!=='admin'){throw new Error(_0x8f21('0x80'));}if(_['some'](_0x3118da,[_0x8f21('0x29'),_0x8f21('0x2a')])&&_0x2d83ae[_0x8f21('0x2c')][_0x8f21('0x29')]!==_0x8f21('0x2a')){throw new Error(_0x8f21('0x88'));}return licenseUtil[_0x8f21('0x81')](_0x3118da)[_0x8f21('0x27')](function(){return validateUser(_0x3118da[0x0]);})[_0x8f21('0x27')](function(){for(var _0x3c534f=0x1;_0x3c534f<_0x3118da['length'];_0x3c534f++){var _0x185fa7=_0x3118da[_0x3c534f-0x1][_0x8f21('0x63')];if(!_0x3118da[_0x3c534f][_0x8f21('0x63')])_0x3118da[_0x3c534f][_0x8f21('0x63')]=_0x185fa7+0x1;_0x6ccf7c[_0x8f21('0x49')](validateUser(_0x3118da[_0x3c534f]));}return BPromise['all'](_0x6ccf7c);})[_0x8f21('0x27')](function(){_0x6ccf7c=[];for(var _0x2e6985=0x0;_0x2e6985<_0x3118da['length'];_0x2e6985++){_0x6ccf7c[_0x8f21('0x49')](updateUser(_0x3118da[_0x2e6985]));}return BPromise[_0x8f21('0x52')](_0x6ccf7c);})[_0x8f21('0x27')](function(){return BPromise[_0x8f21('0x89')](_0x3118da,function(_0x4dd65a){return db[_0x8f21('0x3a')][_0x8f21('0x7e')](_0x4dd65a,{'include':[{'model':db[_0x8f21('0x70')],'as':_0x8f21('0x70')}]})[_0x8f21('0x27')](function(_0x45a09b){_0x4dd65a['id']=_0x45a09b['id'];return _0x4dd65a;});});})[_0x8f21('0x27')](function(_0x57c136){if(_0x2d83ae[_0x8f21('0x5f')][_0x8f21('0x29')]===_0x8f21('0x2c'))return _0x57c136;if(_0x2d83ae[_0x8f21('0x2c')]['role']!==_0x8f21('0x2c'))return _0x57c136;var _0x4b10d9=_['some'](_0x57c136,function(_0x346745){return _0x346745[_0x8f21('0x29')]===_0x8f21('0x2d')||_0x346745['role']===_0x8f21('0x2f');});if(!_0x4b10d9)return _0x57c136;return db[_0x8f21('0x84')][_0x8f21('0x8a')]({'where':{'name':{'$or':[_0x8f21('0x8b'),_0x8f21('0x2e')]},'userProfileId':_0x2d83ae[_0x8f21('0x2c')][_0x8f21('0x83')]},'raw':!![]})[_0x8f21('0x27')](function(_0x1daec1){if(_['isEmpty'](_0x1daec1)||!_[_0x8f21('0x8c')](_0x1daec1,['autoAssociation',0x0]))return _0x57c136;_0x6ccf7c=[];var _0x1c336f=_(_0x1daec1)[_0x8f21('0x3c')](function(_0xc8bc16){if(_0xc8bc16[_0x8f21('0x85')]===0x1)return;return _0xc8bc16[_0x8f21('0x37')]===_0x8f21('0x8b')?_0x8f21('0x2d'):_0x8f21('0x2f');})[_0x8f21('0x8d')]()[_0x8f21('0x32')]();for(var _0x307e48=0x0;_0x307e48<_0x57c136[_0x8f21('0x4b')];_0x307e48++){if(!_[_0x8f21('0x33')](_0x1c336f,_0x57c136[_0x307e48][_0x8f21('0x29')]))return;var _0x187449=_0x57c136[_0x307e48]['role']===_0x8f21('0x2d')?_0x8f21('0x8b'):_0x8f21('0x2e');_0x6ccf7c['push'](db[_0x8f21('0x35')][_0x8f21('0x7e')]({'name':_0x57c136[_0x307e48][_0x8f21('0x37')],'resourceId':_0x57c136[_0x307e48]['id'],'type':_0x187449,'sectionId':_['find'](_0x1daec1,['name',_0x187449])['id']},{}));}return BPromise[_0x8f21('0x52')](_0x6ccf7c);});})[_0x8f21('0x27')](respondWithResult(_0xc37082,0xc9))[_0x8f21('0x1d')](handleError(_0xc37082,null));};exports[_0x8f21('0x8e')]=function(_0x204018,_0x32707e){if(_0x204018[_0x8f21('0x5f')]['id']){delete _0x204018[_0x8f21('0x5f')]['id'];}return db[_0x8f21('0x3a')]['find']({'where':{'id':_0x204018[_0x8f21('0x54')]['id']}})['then'](function(_0xad9303){if(!_0xad9303)return null;if(_0xad9303['id']===_0x204018[_0x8f21('0x2c')]['id']){if(!_0x204018[_0x8f21('0x5f')][_0x8f21('0x8f')]||!_0x204018[_0x8f21('0x5f')][_0x8f21('0x90')]){throw new db[(_0x8f21('0x91'))]['ValidationError'](_0x8f21('0x92'));}if(!_0xad9303[_0x8f21('0x93')](_0x204018[_0x8f21('0x5f')][_0x8f21('0x8f')])){throw new db['Sequelize'][(_0x8f21('0x94'))](_0x8f21('0x95'));}if(_0x204018[_0x8f21('0x5f')]['oldPassword']===_0x204018[_0x8f21('0x5f')][_0x8f21('0x90')]){throw new db['Sequelize'][(_0x8f21('0x94'))](_0x8f21('0x96'));}}else if(_0x204018['user'][_0x8f21('0x29')]===_0x8f21('0x2a')){if(!_0x204018[_0x8f21('0x5f')][_0x8f21('0x90')]){throw new db['Sequelize'][(_0x8f21('0x94'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}}else if(_0x204018['user'][_0x8f21('0x29')]==='user'){if(!_0x204018[_0x8f21('0x5f')][_0x8f21('0x90')]){throw new db[(_0x8f21('0x91'))]['ValidationError'](_0x8f21('0x97'));}if(_0xad9303[_0x8f21('0x29')]!==_0x8f21('0x2d')){throw new db['Sequelize'][(_0x8f21('0x94'))](_0x8f21('0x7f'));}}else{throw new db[(_0x8f21('0x91'))][(_0x8f21('0x94'))]('Unauthorized');}return _0xad9303;})[_0x8f21('0x27')](handleEntityNotFound(_0x32707e,null))['then'](function(_0xe8cd32){return db['Setting']['findOne']({'attributes':['id',_0x8f21('0x65'),_0x8f21('0x98'),_0x8f21('0x99')]})[_0x8f21('0x27')](function(_0x3d5370){if(_0x3d5370[_0x8f21('0x65')])authService[_0x8f21('0x66')](_0x204018[_0x8f21('0x5f')][_0x8f21('0x90')]);if(!_0x3d5370['enforcePasswordHistory']||!_0xe8cd32[_0x8f21('0x9a')])return _0xe8cd32;authService['validatePasswordHistory'](_0x204018[_0x8f21('0x5f')][_0x8f21('0x90')],_0xe8cd32[_0x8f21('0x9a')],_0x3d5370['passwordHistoryLimit']);return _0xe8cd32;})[_0x8f21('0x27')](saveUpdates({'password':_0x204018[_0x8f21('0x5f')]['newPassword'],'passwordResetAt':_0x204018[_0x8f21('0x2c')]['id']==_0x204018[_0x8f21('0x54')]['id']?moment():null,'previousPasswords':authService[_0x8f21('0x9b')](_0x204018[_0x8f21('0x5f')]['newPassword'],_0xe8cd32['previousPasswords'])},null));})[_0x8f21('0x27')](respondWithResult(_0x32707e,null))[_0x8f21('0x1d')](handleError(_0x32707e,null));};exports[_0x8f21('0x9c')]=function(_0x905dfc,_0x4df885){var _0x562273=_0x905dfc[_0x8f21('0x5f')][_0x8f21('0x9d')];return db[_0x8f21('0x3a')]['find']({'where':{'id':_0x905dfc[_0x8f21('0x54')]['id']},'attributes':['id',_0x8f21('0x37'),'role',_0x8f21('0x9e'),_0x8f21('0x9f'),_0x8f21('0xa0'),_0x8f21('0xa1')]})[_0x8f21('0x27')](handleEntityNotFound(_0x4df885,null))['then'](function(_0x179ccf){if(_0x179ccf){if(!utils[_0x8f21('0xa2')](_0x562273)){throw new db[(_0x8f21('0x91'))]['ValidationError'](_0x8f21('0xa3'));}return _0x179ccf['add'+_['capitalize'](_0x562273[_0x8f21('0xa4')]())+_0x8f21('0xa5')](_0x905dfc[_0x8f21('0x5f')][_0x8f21('0x62')],{'penalty':_0x905dfc[_0x8f21('0x5f')]['penalty']||0x0})['spread'](function(_0x5d1315){for(var _0x4f86e1=0x0;_0x4f86e1<_0x905dfc[_0x8f21('0x5f')][_0x8f21('0x62')][_0x8f21('0x4b')];_0x4f86e1+=0x1){var _0x28b0cc={'UserId':Number(_0x905dfc['params']['id'])};_0x28b0cc[_[_0x8f21('0xa6')](_0x562273[_0x8f21('0xa4')]())+_0x8f21('0xa7')]=Number(_0x905dfc[_0x8f21('0x5f')][_0x8f21('0x62')][_0x4f86e1]);socket[_0x8f21('0xa8')](_0x8f21('0x2c')+_[_0x8f21('0xa6')](_0x562273[_0x8f21('0xa4')]())+_0x8f21('0xa9'),_0x28b0cc);}return _0x5d1315;})[_0x8f21('0x27')](function(){if(_0x562273===_0x8f21('0xaa')){return db[_0x8f21('0xab')][_0x8f21('0x8a')]({'where':{'id':_0x905dfc[_0x8f21('0x5f')][_0x8f21('0x62')]||[]},'raw':!![],'attributes':['id',_0x8f21('0x37')]});}})['then'](function(_0x16d649){var _0x3901b2=_0x179ccf[_0x8f21('0x28')]({'plain':!![]});var _0x253f72=[];if(_0x562273===_0x8f21('0xaa')&&_0x3901b2[_0x8f21('0x29')]===_0x8f21('0x2d')&&_0x3901b2['online']){for(var _0x112202=0x0;_0x112202<_0x16d649[_0x8f21('0x4b')];_0x112202+=0x1){_0x253f72[_0x8f21('0x49')]({'membername':_0x3901b2['name'],'UserId':_0x3901b2['id'],'queue_name':_0x16d649[_0x112202][_0x8f21('0x37')],'VoiceQueueId':_0x16d649[_0x112202]['id'],'interface':_[_0x8f21('0x68')](_0x3901b2['interface'])?util[_0x8f21('0xac')](_0x8f21('0xad'),_0x3901b2[_0x8f21('0x37')]):_0x3901b2['interface'],'paused':_0x3901b2[_0x8f21('0xa0')]||![],'penalty':_0x905dfc['body'][_0x8f21('0xae')]||0x0});}return BPromise[_0x8f21('0x89')](_0x253f72,function(_0x4cbf81){return db[_0x8f21('0xaf')][_0x8f21('0xb0')](_0x4cbf81);});}return _0x179ccf;});}})[_0x8f21('0x27')](respondWithStatusCode(_0x4df885,null))['catch'](handleError(_0x4df885,null));};exports[_0x8f21('0xb1')]=function(_0x5b1de5,_0x52188e){var _0x900606,_0xe9cd30;return db['User'][_0x8f21('0x34')]({'where':{'id':_0x5b1de5[_0x8f21('0x54')]['id']},'attributes':['id','name',_0x8f21('0x29')]})[_0x8f21('0x27')](handleEntityNotFound(_0x52188e,null))[_0x8f21('0x27')](function(_0x3a6e29){if(_0x3a6e29){_0x900606=_0x3a6e29;if(!_0x5b1de5[_0x8f21('0x43')][_0x8f21('0x9d')]||!utils[_0x8f21('0xa2')](_0x5b1de5['query'][_0x8f21('0x9d')])){throw new db[(_0x8f21('0x91'))][(_0x8f21('0x94'))](_0x8f21('0xa3'));}return _0x3a6e29[_0x8f21('0xb2')+_['capitalize'](_0x5b1de5['query'][_0x8f21('0x9d')][_0x8f21('0xa4')]())+'Queues'](_0x5b1de5[_0x8f21('0x43')][_0x8f21('0x62')]);}})[_0x8f21('0x27')](function(_0x49adf2){if(_['isArray'](_0x5b1de5['query'][_0x8f21('0x62')])){for(var _0x1ebd9e=0x0;_0x1ebd9e<_0x5b1de5[_0x8f21('0x43')][_0x8f21('0x62')]['length'];_0x1ebd9e+=0x1){_0xe9cd30={'UserId':Number(_0x5b1de5[_0x8f21('0x54')]['id'])};_0xe9cd30[_['capitalize'](_0x5b1de5['query'][_0x8f21('0x9d')]['toLowerCase']())+_0x8f21('0xa7')]=Number(_0x5b1de5[_0x8f21('0x43')][_0x8f21('0x62')][_0x1ebd9e]);socket[_0x8f21('0xa8')](_0x8f21('0x2c')+_['capitalize'](_0x5b1de5[_0x8f21('0x43')][_0x8f21('0x9d')]['toLowerCase']())+_0x8f21('0xb3'),_0xe9cd30);}}else{_0xe9cd30={'UserId':Number(_0x5b1de5['params']['id'])};_0xe9cd30[_['capitalize'](_0x5b1de5[_0x8f21('0x43')]['channel']['toLowerCase']())+_0x8f21('0xa7')]=Number(_0x5b1de5[_0x8f21('0x43')][_0x8f21('0x62')]);socket[_0x8f21('0xa8')](_0x8f21('0x2c')+_[_0x8f21('0xa6')](_0x5b1de5['query']['channel']['toLowerCase']())+_0x8f21('0xb3'),_0xe9cd30);}return _0x49adf2;})[_0x8f21('0x27')](function(){if(_0x5b1de5['query'][_0x8f21('0x9d')]===_0x8f21('0xaa')){return db[_0x8f21('0xaf')][_0x8f21('0xb4')]({'where':{'UserId':_0x5b1de5[_0x8f21('0x54')]['id'],'VoiceQueueId':_0x5b1de5[_0x8f21('0x43')][_0x8f21('0x62')]},'individualHooks':!![]})[_0x8f21('0x27')](function(){return _0x900606;});}return _0x900606;})[_0x8f21('0x27')](respondWithStatusCode(_0x52188e,null))[_0x8f21('0x1d')](handleError(_0x52188e,null));};exports[_0x8f21('0xb5')]=function(_0xa0f2f,_0x57477c){_0xa0f2f[_0x8f21('0x5f')]['userpic']=_0xa0f2f['file']['filename'];return db[_0x8f21('0x3a')][_0x8f21('0x34')]({'where':{'id':_0xa0f2f[_0x8f21('0x54')]['id']}})[_0x8f21('0x27')](handleEntityNotFound(_0x57477c,null))['then'](saveUpdates(_0xa0f2f[_0x8f21('0x5f')],null))[_0x8f21('0x27')](respondWithResult(_0x57477c,null))['catch'](handleError(_0x57477c,null));};exports[_0x8f21('0xb6')]=function(_0x22a7df,_0xe963af){var _0x1e182d=path[_0x8f21('0xb7')](config['root'],_0x8f21('0xb8'));return db['User'][_0x8f21('0x34')]({'where':{'id':_0x22a7df[_0x8f21('0x54')]['id']},'attributes':['id','userpic'],'raw':!![]})[_0x8f21('0x27')](handleEntityNotFound(_0xe963af,null))[_0x8f21('0x27')](function(_0x164bcf){if(_0x164bcf){if(_['isNil'](_0x164bcf[_0x8f21('0xb9')])){return _0xe963af['download'](_0x1e182d);}else{if(!fs['existsSync'](path[_0x8f21('0xb7')](config['root'],_0x8f21('0xba'),_0x164bcf[_0x8f21('0xb9')]))){return _0xe963af[_0x8f21('0xbb')](_0x1e182d);}return _0xe963af[_0x8f21('0xbb')](path[_0x8f21('0xb7')](config['root'],_0x8f21('0xba'),_0x164bcf[_0x8f21('0xb9')]));}}})[_0x8f21('0x1d')](handleError(_0xe963af,null));};exports[_0x8f21('0xbc')]=function(_0x4970bc,_0x27066c){return db[_0x8f21('0x3a')][_0x8f21('0x34')]({'where':{'id':_0x4970bc[_0x8f21('0x54')]['id']},'attributes':['id']})['then'](handleEntityNotFound(_0x27066c,null))[_0x8f21('0x27')](function(_0x48b436){var _0x452d09=[];values=_0x48b436[_0x8f21('0x4d')];_0x452d09[_0x8f21('0x49')](get_open_tabs(_0x8f21('0x4c'),_0x48b436[_0x8f21('0x4d')]));_0x452d09[_0x8f21('0x49')](get_open_tabs(_0x8f21('0x5e'),_0x48b436['dataValues']));_0x452d09[_0x8f21('0x49')](get_open_tabs(_0x8f21('0x50'),_0x48b436['dataValues']));_0x452d09[_0x8f21('0x49')](get_open_tabs(_0x8f21('0x51'),_0x48b436[_0x8f21('0x4d')]));_0x452d09[_0x8f21('0x49')](get_open_tabs(_0x8f21('0x4e'),_0x48b436[_0x8f21('0x4d')]));_0x452d09[_0x8f21('0x49')](get_open_tabs(_0x8f21('0x4f'),_0x48b436['dataValues']));return BPromise[_0x8f21('0x52')](_0x452d09);})[_0x8f21('0x27')](function(_0xb5558){if(_0xb5558){var _0x475a82=_[_0x8f21('0x3c')](values['ChatOpenTabs'],function(_0x19fdb0){return{'channel':_0x8f21('0xbd'),'id':_0x19fdb0['id'],'createdAt':_0x19fdb0[_0x8f21('0xbe')]};});var _0xd62085=_[_0x8f21('0x3c')](values[_0x8f21('0xbf')],function(_0x3c2181){return{'channel':_0x8f21('0xc0'),'id':_0x3c2181['id'],'createdAt':_0x3c2181[_0x8f21('0xbe')]};});var _0xd10ba8=_[_0x8f21('0x3c')](values[_0x8f21('0xc1')],function(_0x25d347){return{'channel':_0x8f21('0xc2'),'id':_0x25d347['id'],'createdAt':_0x25d347[_0x8f21('0xbe')]};});var _0x26b0a8=_[_0x8f21('0x3c')](values['MailOpenTabs'],function(_0x5e9f7b){return{'channel':_0x8f21('0xc3'),'id':_0x5e9f7b['id'],'createdAt':_0x5e9f7b[_0x8f21('0xbe')]};});var _0x230cfd=_[_0x8f21('0x3c')](values[_0x8f21('0xc4')],function(_0x2b6f59){return{'channel':_0x8f21('0xc5'),'id':_0x2b6f59['id'],'createdAt':_0x2b6f59[_0x8f21('0xbe')]};});var _0x5d39bf=_[_0x8f21('0x3c')](values[_0x8f21('0xc6')],function(_0x4cdadd){return{'channel':_0x8f21('0xc7'),'id':_0x4cdadd['id'],'createdAt':_0x4cdadd[_0x8f21('0xbe')]};});var _0x3afe92=_[_0x8f21('0xc8')](_0x475a82,_0xd62085,_0xd10ba8,_0x26b0a8,_0x230cfd,_0x5d39bf);var _0x5d10c9={'count':_0x3afe92[_0x8f21('0x4b')],'rows':_0x3afe92};return _0x5d10c9;}else return null;})[_0x8f21('0x27')](respondWithResult(_0x27066c,null))[_0x8f21('0x1d')](handleError(_0x27066c,null));};exports[_0x8f21('0xc9')]=function(_0xd49759,_0x2d7da5){var _0x580f11={};var _0x4f17c8={};var _0x15de25;var _0x5413d6;return db[_0x8f21('0x3a')][_0x8f21('0xca')]({'where':{'id':_0xd49759[_0x8f21('0x54')]['id']}})['then'](handleEntityNotFound(_0x2d7da5,null))[_0x8f21('0x27')](function(_0x32e7b7){if(_0x32e7b7){_0x15de25=_0x32e7b7;_0x4f17c8[_0x8f21('0x55')]=_['keys'](db['CmContact'][_0x8f21('0x3b')]);_0x4f17c8['query']=_[_0x8f21('0x57')](_0xd49759[_0x8f21('0x43')]);_0x4f17c8['filters']=_[_0x8f21('0x59')](_0x4f17c8[_0x8f21('0x55')],_0x4f17c8[_0x8f21('0x43')]);_0x580f11['attributes']=_[_0x8f21('0x59')](_0x4f17c8[_0x8f21('0x55')],qs[_0x8f21('0x5a')](_0xd49759[_0x8f21('0x43')][_0x8f21('0x5a')]));_0x580f11[_0x8f21('0x48')]=_0x580f11[_0x8f21('0x48')][_0x8f21('0x4b')]?_0x580f11[_0x8f21('0x48')]:_0x4f17c8[_0x8f21('0x55')];_0x580f11[_0x8f21('0xcb')]=qs[_0x8f21('0xcc')](_0xd49759['query']['sort']);_0x580f11[_0x8f21('0x42')]=qs['filters'](_['pick'](_0xd49759[_0x8f21('0x43')],_0x4f17c8[_0x8f21('0x58')]));if(_0xd49759[_0x8f21('0x43')]['filter']){_0x580f11[_0x8f21('0x42')]=_[_0x8f21('0x5c')](_0x580f11['where'],{'$or':_[_0x8f21('0x3c')](_0x580f11[_0x8f21('0x48')],function(_0x43dca8){var _0x3a3a98={};_0x3a3a98[_0x43dca8]={'$like':'%'+_0xd49759[_0x8f21('0x43')][_0x8f21('0x30')]+'%'};return _0x3a3a98;})});}_0x580f11=_['merge']({},_0x580f11,_0xd49759['options']);return _0x15de25[_0x8f21('0xc9')](_0x580f11);}})[_0x8f21('0x27')](function(_0x52c213){if(_0x52c213){_0x5413d6=_0x52c213[_0x8f21('0x4b')];if(_0xd49759[_0x8f21('0x43')][_0x8f21('0xcd')](_0x8f21('0x44'))){_0x580f11[_0x8f21('0x45')]=[{'model':db[_0x8f21('0xce')],'as':_0x8f21('0xcf'),'required':![]},{'model':db[_0x8f21('0xd0')],'as':'Tags','attributes':['id',_0x8f21('0x37'),_0x8f21('0xd1')],'where':_0xd49759[_0x8f21('0x43')][_0x8f21('0xd2')]?{'id':_0xd49759[_0x8f21('0x43')][_0x8f21('0xd2')]}:undefined,'required':_0xd49759[_0x8f21('0x43')][_0x8f21('0xd2')]?!![]:![]}];}if(!_0xd49759[_0x8f21('0x43')][_0x8f21('0xcd')](_0x8f21('0xd3'))){_0x580f11[_0x8f21('0x22')]=qs[_0x8f21('0x22')](_0xd49759[_0x8f21('0x43')][_0x8f21('0x22')]);_0x580f11[_0x8f21('0x21')]=qs[_0x8f21('0x21')](_0xd49759[_0x8f21('0x43')][_0x8f21('0x21')]);}return _0x15de25[_0x8f21('0xc9')](_0x580f11);}})[_0x8f21('0x27')](function(_0x23ed01){if(_0x23ed01){return _0x23ed01?{'count':_0x5413d6,'rows':_0x23ed01}:null;}})[_0x8f21('0x27')](respondWithResult(_0x2d7da5,null))[_0x8f21('0x1d')](handleError(_0x2d7da5,null));};exports[_0x8f21('0xd4')]=function(_0x31c2dd,_0x344a03){var _0x417a28;var _0x4916bd={};var _0x162593;return db[_0x8f21('0x3a')][_0x8f21('0xca')]({'where':{'id':_0x31c2dd[_0x8f21('0x54')]['id']},'attributes':['id',_0x8f21('0x37'),'role']})[_0x8f21('0x27')](handleEntityNotFound(_0x344a03,null))[_0x8f21('0x27')](function(_0xe6a03b){if(!utils[_0x8f21('0xa2')](_0x31c2dd[_0x8f21('0x43')][_0x8f21('0x9d')])){throw new db[(_0x8f21('0x91'))][(_0x8f21('0x94'))](_0x8f21('0xa3'));}_0x417a28=_0xe6a03b;var _0x3e775c={};_0x3e775c[_0x8f21('0x55')]=_[_0x8f21('0x57')](db[_[_0x8f21('0xa6')](_0x31c2dd[_0x8f21('0x43')][_0x8f21('0x9d')])+'Queue']['rawAttributes']);_0x3e775c[_0x8f21('0x43')]=_[_0x8f21('0x57')](_0x31c2dd[_0x8f21('0x43')]);_0x3e775c[_0x8f21('0x58')]=_[_0x8f21('0x59')](_0x3e775c[_0x8f21('0x55')],_0x3e775c['query']);_0x4916bd[_0x8f21('0x48')]=_[_0x8f21('0x59')](_0x3e775c[_0x8f21('0x55')],qs[_0x8f21('0x5a')](_0x31c2dd['query']['fields']));_0x4916bd[_0x8f21('0x48')]=_0x4916bd['attributes']['length']?_0x4916bd[_0x8f21('0x48')]:_0x3e775c[_0x8f21('0x55')];_0x4916bd['order']=qs[_0x8f21('0xcc')](_0x31c2dd[_0x8f21('0x43')][_0x8f21('0xcc')]);_0x4916bd[_0x8f21('0x42')]=qs[_0x8f21('0x58')](_[_0x8f21('0xd5')](_0x31c2dd[_0x8f21('0x43')],_0x3e775c[_0x8f21('0x58')]));if(_0x31c2dd['query'][_0x8f21('0x30')]){_0x4916bd[_0x8f21('0x42')]=_[_0x8f21('0x5c')](_0x4916bd[_0x8f21('0x42')],{'$or':_['map'](_0x4916bd['attributes'],function(_0x5deb85){var _0x35cbfe={};_0x35cbfe[_0x5deb85]={'$like':'%'+_0x31c2dd[_0x8f21('0x43')][_0x8f21('0x30')]+'%'};return _0x35cbfe;})});}_0x4916bd=_['merge']({},_0x4916bd,_0x31c2dd[_0x8f21('0xd6')]);switch(_0x417a28[_0x8f21('0x29')]){case _0x8f21('0x2a'):return db[_['capitalize'](_0x31c2dd[_0x8f21('0x43')][_0x8f21('0x9d')])+_0x8f21('0xd7')][_0x8f21('0x8a')](_0x4916bd);case'user':case _0x8f21('0x2d'):return _0x417a28[_0x8f21('0x28')+_['capitalize'](_0x31c2dd[_0x8f21('0x43')]['channel'])+'Queues'](_0x4916bd);default:throw new db[(_0x8f21('0x91'))][(_0x8f21('0x94'))](_0x8f21('0xd8'));}})[_0x8f21('0x27')](function(_0x31dc18){_0x162593=_0x31dc18['length'];if(!_0x31c2dd[_0x8f21('0x43')]['hasOwnProperty'](_0x8f21('0xd3'))){_0x4916bd[_0x8f21('0x22')]=qs[_0x8f21('0x22')](_0x31c2dd[_0x8f21('0x43')][_0x8f21('0x22')]);_0x4916bd[_0x8f21('0x21')]=qs[_0x8f21('0x21')](_0x31c2dd[_0x8f21('0x43')][_0x8f21('0x21')]);}switch(_0x417a28[_0x8f21('0x29')]){case _0x8f21('0x2a'):return db[_[_0x8f21('0xa6')](_0x31c2dd[_0x8f21('0x43')][_0x8f21('0x9d')])+_0x8f21('0xd7')]['findAll'](_0x4916bd);case'user':case _0x8f21('0x2d'):return _0x417a28['get'+_[_0x8f21('0xa6')](_0x31c2dd[_0x8f21('0x43')][_0x8f21('0x9d')])+'Queues'](_0x4916bd);}})['then'](function(_0x4d7ea7){return{'count':_0x162593,'rows':_0x4d7ea7};})[_0x8f21('0x27')](respondWithResult(_0x344a03,null))[_0x8f21('0x1d')](handleError(_0x344a03,null));};exports['getVoiceQueuesRt']=function(_0x355548,_0x10a0a7){var _0x5b2b54={};var _0x4196a3={};var _0x177e86;var _0x18963c;return db[_0x8f21('0x3a')]['findOne']({'where':{'id':_0x355548['params']['id']}})[_0x8f21('0x27')](handleEntityNotFound(_0x10a0a7,null))['then'](function(_0x199f27){if(_0x199f27){_0x177e86=_0x199f27;_0x4196a3[_0x8f21('0x55')]=_['keys'](db[_0x8f21('0xaf')][_0x8f21('0x3b')]);_0x4196a3[_0x8f21('0x43')]=_[_0x8f21('0x57')](_0x355548[_0x8f21('0x43')]);_0x4196a3[_0x8f21('0x58')]=_[_0x8f21('0x59')](_0x4196a3[_0x8f21('0x55')],_0x4196a3[_0x8f21('0x43')]);_0x5b2b54[_0x8f21('0x48')]=_[_0x8f21('0x59')](_0x4196a3[_0x8f21('0x55')],qs[_0x8f21('0x5a')](_0x355548['query'][_0x8f21('0x5a')]));_0x5b2b54[_0x8f21('0x48')]=_0x5b2b54[_0x8f21('0x48')][_0x8f21('0x4b')]?_0x5b2b54[_0x8f21('0x48')]:_0x4196a3['model'];_0x5b2b54[_0x8f21('0xcb')]=qs[_0x8f21('0xcc')](_0x355548['query']['sort']);_0x5b2b54[_0x8f21('0x42')]=qs['filters'](_['pick'](_0x355548[_0x8f21('0x43')],_0x4196a3[_0x8f21('0x58')]));if(_0x355548[_0x8f21('0x43')][_0x8f21('0x30')]){_0x5b2b54[_0x8f21('0x42')]=_[_0x8f21('0x5c')](_0x5b2b54[_0x8f21('0x42')],{'$or':_['map'](_0x5b2b54[_0x8f21('0x48')],function(_0x54506a){var _0x54ea2c={};_0x54ea2c[_0x54506a]={'$like':'%'+_0x355548[_0x8f21('0x43')][_0x8f21('0x30')]+'%'};return _0x54ea2c;})});}_0x5b2b54=_[_0x8f21('0x5c')]({},_0x5b2b54,_0x355548[_0x8f21('0xd6')]);return _0x177e86['getVoiceQueuesRt'](_0x5b2b54);}})[_0x8f21('0x27')](function(_0x27cf76){if(_0x27cf76){_0x18963c=_0x27cf76[_0x8f21('0x4b')];if(!_0x355548[_0x8f21('0x43')][_0x8f21('0xcd')](_0x8f21('0xd3'))){_0x5b2b54['limit']=qs[_0x8f21('0x22')](_0x355548[_0x8f21('0x43')]['limit']);_0x5b2b54[_0x8f21('0x21')]=qs['offset'](_0x355548[_0x8f21('0x43')][_0x8f21('0x21')]);}return _0x177e86[_0x8f21('0xd9')](_0x5b2b54);}})[_0x8f21('0x27')](function(_0x5ac2f1){if(_0x5ac2f1){return _0x5ac2f1?{'count':_0x18963c,'rows':_0x5ac2f1}:null;}})[_0x8f21('0x27')](respondWithResult(_0x10a0a7,null))['catch'](handleError(_0x10a0a7,null));};exports[_0x8f21('0xda')]=function(_0xbb6cbe,_0xcc1059){var _0x2628e8={};var _0x16a263={};var _0x361d1d;var _0x211053;return db[_0x8f21('0x3a')]['findOne']({'where':{'id':_0xbb6cbe[_0x8f21('0x54')]['id']}})[_0x8f21('0x27')](handleEntityNotFound(_0xcc1059,null))['then'](function(_0x23c677){if(_0x23c677){_0x361d1d=_0x23c677;_0x16a263['model']=_['keys'](db['ChatGroup'][_0x8f21('0x3b')]);_0x16a263['query']=_[_0x8f21('0x57')](_0xbb6cbe[_0x8f21('0x43')]);_0x16a263['filters']=_[_0x8f21('0x59')](_0x16a263[_0x8f21('0x55')],_0x16a263[_0x8f21('0x43')]);_0x2628e8[_0x8f21('0x48')]=_['intersection'](_0x16a263[_0x8f21('0x55')],qs[_0x8f21('0x5a')](_0xbb6cbe['query']['fields']));_0x2628e8[_0x8f21('0x48')]=_0x2628e8[_0x8f21('0x48')][_0x8f21('0x4b')]?_0x2628e8[_0x8f21('0x48')]:_0x16a263[_0x8f21('0x55')];_0x2628e8[_0x8f21('0xcb')]=qs['sort'](_0xbb6cbe[_0x8f21('0x43')][_0x8f21('0xcc')]);_0x2628e8[_0x8f21('0x42')]=qs[_0x8f21('0x58')](_[_0x8f21('0xd5')](_0xbb6cbe['query'],_0x16a263[_0x8f21('0x58')]));if(_0xbb6cbe[_0x8f21('0x43')]['filter']){_0x2628e8[_0x8f21('0x42')]=_[_0x8f21('0x5c')](_0x2628e8[_0x8f21('0x42')],{'$or':_['map'](_0x2628e8['attributes'],function(_0x59b083){var _0x2e0010={};_0x2e0010[_0x59b083]={'$like':'%'+_0xbb6cbe[_0x8f21('0x43')][_0x8f21('0x30')]+'%'};return _0x2e0010;})});}_0x2628e8=_[_0x8f21('0x5c')]({},_0x2628e8,_0xbb6cbe[_0x8f21('0xd6')]);return _0x361d1d[_0x8f21('0xda')](_0x2628e8);}})[_0x8f21('0x27')](function(_0x56a89d){if(_0x56a89d){_0x211053=_0x56a89d[_0x8f21('0x4b')];if(!_0xbb6cbe['query'][_0x8f21('0xcd')](_0x8f21('0xd3'))){_0x2628e8[_0x8f21('0x22')]=qs['limit'](_0xbb6cbe[_0x8f21('0x43')]['limit']);_0x2628e8[_0x8f21('0x21')]=qs[_0x8f21('0x21')](_0xbb6cbe[_0x8f21('0x43')][_0x8f21('0x21')]);}return _0x361d1d[_0x8f21('0xda')](_0x2628e8);}})[_0x8f21('0x27')](function(_0xe92a8e){if(_0xe92a8e){return _0xe92a8e?{'count':_0x211053,'rows':_0xe92a8e}:null;}})[_0x8f21('0x27')](respondWithResult(_0xcc1059,null))[_0x8f21('0x1d')](handleError(_0xcc1059,null));};exports[_0x8f21('0xdb')]=function(_0xec2881,_0x130eab){var _0x25b039={'raw':!![],'where':{}};var _0x5430e1={};var _0x110d10={'count':0x0,'rows':[]};return db[_0x8f21('0x3a')][_0x8f21('0xca')]({'where':{'id':_0xec2881['params']['id']}})[_0x8f21('0x27')](handleEntityNotFound(_0x130eab,null))[_0x8f21('0x27')](function(_0xf374a0){if(_0xf374a0){_0x5430e1[_0x8f21('0x55')]=_[_0x8f21('0x57')](db[_0x8f21('0xdc')][_0x8f21('0x3b')]);_0x5430e1[_0x8f21('0x43')]=_[_0x8f21('0x57')](_0xec2881[_0x8f21('0x43')]);_0x5430e1['filters']=_[_0x8f21('0x59')](_0x5430e1[_0x8f21('0x55')],_0x5430e1[_0x8f21('0x43')]);_0x25b039[_0x8f21('0x48')]=_[_0x8f21('0x59')](_0x5430e1['model'],qs[_0x8f21('0x5a')](_0xec2881['query'][_0x8f21('0x5a')]));_0x25b039[_0x8f21('0x48')]=_0x25b039[_0x8f21('0x48')][_0x8f21('0x4b')]?_0x25b039[_0x8f21('0x48')]:_0x5430e1[_0x8f21('0x55')];if(!_0xec2881[_0x8f21('0x43')]['hasOwnProperty']('nolimit')){_0x25b039[_0x8f21('0x22')]=qs[_0x8f21('0x22')](_0xec2881[_0x8f21('0x43')][_0x8f21('0x22')]);_0x25b039[_0x8f21('0x21')]=qs['offset'](_0xec2881['query']['offset']);}_0x25b039['order']=qs['sort'](_0xec2881[_0x8f21('0x43')][_0x8f21('0xcc')]);_0x25b039[_0x8f21('0x42')]=qs[_0x8f21('0x58')](_[_0x8f21('0xd5')](_0xec2881[_0x8f21('0x43')],_0x5430e1['filters']));_0x25b039[_0x8f21('0x42')][_0x8f21('0xdd')]=_0xf374a0['id'];if(_0xec2881[_0x8f21('0x43')][_0x8f21('0x30')]){_0x25b039[_0x8f21('0x42')]=_[_0x8f21('0x5c')](_0x25b039[_0x8f21('0x42')],{'$or':_[_0x8f21('0x3c')](_0x25b039[_0x8f21('0x48')],function(_0xfbd214){var _0x49b8ba={};_0x49b8ba[_0xfbd214]={'$like':'%'+_0xec2881['query'][_0x8f21('0x30')]+'%'};return _0x49b8ba;})});}_0x25b039=_[_0x8f21('0x5c')]({},_0x25b039,_0xec2881[_0x8f21('0xd6')]);return db[_0x8f21('0xdc')][_0x8f21('0x24')]({'where':_0x25b039[_0x8f21('0x42')]})[_0x8f21('0x27')](function(_0x283eef){_0x110d10[_0x8f21('0x24')]=_0x283eef;if(_0xec2881['query'][_0x8f21('0x44')]){_0x25b039[_0x8f21('0x45')]=[{'all':!![]}];}return db[_0x8f21('0xdc')]['findAll'](_0x25b039);})['then'](function(_0x4be151){_0x110d10[_0x8f21('0x4a')]=_0x4be151;return _0x110d10;});}})['then'](respondWithFilteredResult(_0x130eab,_0x25b039))[_0x8f21('0x1d')](handleError(_0x130eab,null));};exports[_0x8f21('0xde')]=function(_0x188c21,_0x23cf8c){var _0x159f3a={'raw':!![],'where':{}};var _0x1cdcd4={};var _0x520627={'count':0x0,'rows':[]};return db[_0x8f21('0x3a')][_0x8f21('0xca')]({'where':{'id':_0x188c21[_0x8f21('0x54')]['id']}})['then'](handleEntityNotFound(_0x23cf8c,null))[_0x8f21('0x27')](function(_0x50df44){if(_0x50df44){_0x1cdcd4[_0x8f21('0x55')]=_[_0x8f21('0x57')](db[_0x8f21('0xdf')]['rawAttributes']);_0x1cdcd4['query']=_[_0x8f21('0x57')](_0x188c21[_0x8f21('0x43')]);_0x1cdcd4['filters']=_[_0x8f21('0x59')](_0x1cdcd4[_0x8f21('0x55')],_0x1cdcd4['query']);_0x159f3a[_0x8f21('0x48')]=_['intersection'](_0x1cdcd4[_0x8f21('0x55')],qs[_0x8f21('0x5a')](_0x188c21[_0x8f21('0x43')][_0x8f21('0x5a')]));_0x159f3a[_0x8f21('0x48')]=_0x159f3a[_0x8f21('0x48')]['length']?_0x159f3a['attributes']:_0x1cdcd4['model'];if(!_0x188c21['query'][_0x8f21('0xcd')](_0x8f21('0xd3'))){_0x159f3a[_0x8f21('0x22')]=qs['limit'](_0x188c21[_0x8f21('0x43')][_0x8f21('0x22')]);_0x159f3a[_0x8f21('0x21')]=qs['offset'](_0x188c21['query'][_0x8f21('0x21')]);}_0x159f3a[_0x8f21('0xcb')]=qs[_0x8f21('0xcc')](_0x188c21[_0x8f21('0x43')][_0x8f21('0xcc')]);_0x159f3a[_0x8f21('0x42')]=qs[_0x8f21('0x58')](_[_0x8f21('0xd5')](_0x188c21[_0x8f21('0x43')],_0x1cdcd4[_0x8f21('0x58')]));_0x159f3a[_0x8f21('0x42')][_0x8f21('0xdd')]=_0x50df44['id'];if(_0x188c21[_0x8f21('0x43')][_0x8f21('0x30')]){_0x159f3a['where']=_['merge'](_0x159f3a['where'],{'$or':_['map'](_0x159f3a['attributes'],function(_0x529a90){var _0x30e6b3={};_0x30e6b3[_0x529a90]={'$like':'%'+_0x188c21['query'][_0x8f21('0x30')]+'%'};return _0x30e6b3;})});}_0x159f3a=_[_0x8f21('0x5c')]({},_0x159f3a,_0x188c21[_0x8f21('0xd6')]);return db['ScreenRecording']['count']({'where':_0x159f3a[_0x8f21('0x42')]})[_0x8f21('0x27')](function(_0x26d367){_0x520627[_0x8f21('0x24')]=_0x26d367;if(_0x188c21[_0x8f21('0x43')]['includeAll']){_0x159f3a[_0x8f21('0x45')]=[{'all':!![]}];}return db[_0x8f21('0xdf')][_0x8f21('0x8a')](_0x159f3a);})['then'](function(_0x1a1119){_0x520627[_0x8f21('0x4a')]=_0x1a1119;return _0x520627;});}})['then'](respondWithFilteredResult(_0x23cf8c,_0x159f3a))[_0x8f21('0x1d')](handleError(_0x23cf8c,null));};exports[_0x8f21('0xe0')]=function(_0x5e5697,_0x5e9895){var _0x4b362b={};var _0x5f4dad={};var _0x53aef3;var _0x69db60;return db[_0x8f21('0x3a')][_0x8f21('0xca')]({'where':{'id':_0x5e5697[_0x8f21('0x54')]['id']}})[_0x8f21('0x27')](handleEntityNotFound(_0x5e9895,null))[_0x8f21('0x27')](function(_0x2d23cc){if(_0x2d23cc){_0x53aef3=_0x2d23cc;_0x5f4dad['model']=_[_0x8f21('0x57')](db[_0x8f21('0xe1')][_0x8f21('0x3b')]);_0x5f4dad[_0x8f21('0x43')]=_[_0x8f21('0x57')](_0x5e5697[_0x8f21('0x43')]);_0x5f4dad[_0x8f21('0x58')]=_['intersection'](_0x5f4dad[_0x8f21('0x55')],_0x5f4dad[_0x8f21('0x43')]);_0x4b362b[_0x8f21('0x48')]=_[_0x8f21('0x59')](_0x5f4dad[_0x8f21('0x55')],qs[_0x8f21('0x5a')](_0x5e5697[_0x8f21('0x43')]['fields']));_0x4b362b[_0x8f21('0x48')]=_0x4b362b[_0x8f21('0x48')][_0x8f21('0x4b')]?_0x4b362b[_0x8f21('0x48')]:_0x5f4dad['model'];_0x4b362b[_0x8f21('0xcb')]=qs[_0x8f21('0xcc')](_0x5e5697[_0x8f21('0x43')][_0x8f21('0xcc')]);_0x4b362b[_0x8f21('0x42')]=qs[_0x8f21('0x58')](_['pick'](_0x5e5697['query'],_0x5f4dad[_0x8f21('0x58')]));if(_0x5e5697[_0x8f21('0x43')][_0x8f21('0x30')]){_0x4b362b[_0x8f21('0x42')]=_['merge'](_0x4b362b['where'],{'$or':_[_0x8f21('0x3c')](_0x4b362b['attributes'],function(_0x1504ce){var _0x26576d={};_0x26576d[_0x1504ce]={'$like':'%'+_0x5e5697[_0x8f21('0x43')][_0x8f21('0x30')]+'%'};return _0x26576d;})});}_0x4b362b=_['merge']({},_0x4b362b,_0x5e5697[_0x8f21('0xd6')]);return _0x53aef3['getChatInteractions'](_0x4b362b);}})[_0x8f21('0x27')](function(_0xf60038){if(_0xf60038){_0x69db60=_0xf60038[_0x8f21('0x4b')];if(!_0x5e5697['query'][_0x8f21('0xcd')]('nolimit')){_0x4b362b['limit']=qs['limit'](_0x5e5697[_0x8f21('0x43')][_0x8f21('0x22')]);_0x4b362b[_0x8f21('0x21')]=qs['offset'](_0x5e5697[_0x8f21('0x43')]['offset']);}return _0x53aef3[_0x8f21('0xe0')](_0x4b362b);}})['then'](function(_0x526493){if(_0x526493){return _0x526493?{'count':_0x69db60,'rows':_0x526493}:null;}})[_0x8f21('0x27')](respondWithResult(_0x5e9895,null))[_0x8f21('0x1d')](handleError(_0x5e9895,null));};exports['getOpenchannelInteractions']=function(_0x275023,_0x967fb8){var _0x4a4e2c={};var _0x280a24={};var _0x407683;var _0x4b890f;return db[_0x8f21('0x3a')][_0x8f21('0xca')]({'where':{'id':_0x275023[_0x8f21('0x54')]['id']}})[_0x8f21('0x27')](handleEntityNotFound(_0x967fb8,null))[_0x8f21('0x27')](function(_0x1fe583){if(_0x1fe583){_0x407683=_0x1fe583;_0x280a24[_0x8f21('0x55')]=_['keys'](db[_0x8f21('0xe2')]['rawAttributes']);_0x280a24[_0x8f21('0x43')]=_['keys'](_0x275023[_0x8f21('0x43')]);_0x280a24[_0x8f21('0x58')]=_[_0x8f21('0x59')](_0x280a24[_0x8f21('0x55')],_0x280a24[_0x8f21('0x43')]);_0x4a4e2c[_0x8f21('0x48')]=_[_0x8f21('0x59')](_0x280a24[_0x8f21('0x55')],qs[_0x8f21('0x5a')](_0x275023[_0x8f21('0x43')]['fields']));_0x4a4e2c[_0x8f21('0x48')]=_0x4a4e2c[_0x8f21('0x48')][_0x8f21('0x4b')]?_0x4a4e2c['attributes']:_0x280a24[_0x8f21('0x55')];_0x4a4e2c[_0x8f21('0xcb')]=qs[_0x8f21('0xcc')](_0x275023[_0x8f21('0x43')][_0x8f21('0xcc')]);_0x4a4e2c[_0x8f21('0x42')]=qs[_0x8f21('0x58')](_[_0x8f21('0xd5')](_0x275023[_0x8f21('0x43')],_0x280a24[_0x8f21('0x58')]));if(_0x275023[_0x8f21('0x43')][_0x8f21('0x30')]){_0x4a4e2c[_0x8f21('0x42')]=_[_0x8f21('0x5c')](_0x4a4e2c['where'],{'$or':_['map'](_0x4a4e2c[_0x8f21('0x48')],function(_0x29c39a){var _0x2f6508={};_0x2f6508[_0x29c39a]={'$like':'%'+_0x275023[_0x8f21('0x43')][_0x8f21('0x30')]+'%'};return _0x2f6508;})});}_0x4a4e2c=_[_0x8f21('0x5c')]({},_0x4a4e2c,_0x275023[_0x8f21('0xd6')]);return _0x407683[_0x8f21('0xe3')](_0x4a4e2c);}})[_0x8f21('0x27')](function(_0x575430){if(_0x575430){_0x4b890f=_0x575430[_0x8f21('0x4b')];if(!_0x275023[_0x8f21('0x43')][_0x8f21('0xcd')](_0x8f21('0xd3'))){_0x4a4e2c['limit']=qs[_0x8f21('0x22')](_0x275023[_0x8f21('0x43')][_0x8f21('0x22')]);_0x4a4e2c[_0x8f21('0x21')]=qs[_0x8f21('0x21')](_0x275023['query'][_0x8f21('0x21')]);}return _0x407683['getOpenchannelInteractions'](_0x4a4e2c);}})[_0x8f21('0x27')](function(_0x298d09){if(_0x298d09){return _0x298d09?{'count':_0x4b890f,'rows':_0x298d09}:null;}})[_0x8f21('0x27')](respondWithResult(_0x967fb8,null))['catch'](handleError(_0x967fb8,null));};exports[_0x8f21('0xe4')]=function(_0x79e5b7,_0x25ba4a){var _0x3c5a93={'raw':!![],'where':{}};var _0x1e0b86={};var _0x34613d={'count':0x0,'rows':[]};return db['User'][_0x8f21('0xca')]({'where':{'id':_0x79e5b7[_0x8f21('0x54')]['id']}})[_0x8f21('0x27')](handleEntityNotFound(_0x25ba4a,null))[_0x8f21('0x27')](function(_0x4495cf){if(_0x4495cf){_0x1e0b86[_0x8f21('0x55')]=_[_0x8f21('0x57')](db['MailInteraction']['rawAttributes']);_0x1e0b86[_0x8f21('0x43')]=_[_0x8f21('0x57')](_0x79e5b7['query']);_0x1e0b86[_0x8f21('0x58')]=_[_0x8f21('0x59')](_0x1e0b86['model'],_0x1e0b86['query']);_0x3c5a93[_0x8f21('0x48')]=_['intersection'](_0x1e0b86[_0x8f21('0x55')],qs[_0x8f21('0x5a')](_0x79e5b7['query'][_0x8f21('0x5a')]));_0x3c5a93[_0x8f21('0x48')]=_0x3c5a93['attributes'][_0x8f21('0x4b')]?_0x3c5a93['attributes']:_0x1e0b86[_0x8f21('0x55')];if(!_0x79e5b7[_0x8f21('0x43')][_0x8f21('0xcd')]('nolimit')){_0x3c5a93[_0x8f21('0x22')]=qs[_0x8f21('0x22')](_0x79e5b7['query'][_0x8f21('0x22')]);_0x3c5a93[_0x8f21('0x21')]=qs[_0x8f21('0x21')](_0x79e5b7[_0x8f21('0x43')][_0x8f21('0x21')]);}_0x3c5a93[_0x8f21('0xcb')]=qs[_0x8f21('0xcc')](_0x79e5b7[_0x8f21('0x43')]['sort']);_0x3c5a93[_0x8f21('0x42')]=qs[_0x8f21('0x58')](_['pick'](_0x79e5b7[_0x8f21('0x43')],_0x1e0b86[_0x8f21('0x58')]));_0x3c5a93[_0x8f21('0x42')]['UserId']=_0x4495cf['id'];if(_0x79e5b7['query'][_0x8f21('0x30')]){_0x3c5a93[_0x8f21('0x42')]=_[_0x8f21('0x5c')](_0x3c5a93['where'],{'$or':_[_0x8f21('0x3c')](_0x3c5a93[_0x8f21('0x48')],function(_0x29534d){var _0x427fd6={};_0x427fd6[_0x29534d]={'$like':'%'+_0x79e5b7[_0x8f21('0x43')]['filter']+'%'};return _0x427fd6;})});}_0x3c5a93=_[_0x8f21('0x5c')]({},_0x3c5a93,_0x79e5b7[_0x8f21('0xd6')]);return db[_0x8f21('0xe5')][_0x8f21('0x24')]({'where':_0x3c5a93[_0x8f21('0x42')]})['then'](function(_0x11fd58){_0x34613d[_0x8f21('0x24')]=_0x11fd58;if(_0x79e5b7[_0x8f21('0x43')][_0x8f21('0x44')]){_0x3c5a93[_0x8f21('0x45')]=[{'all':!![]}];}return db[_0x8f21('0xe5')][_0x8f21('0x8a')](_0x3c5a93);})[_0x8f21('0x27')](function(_0x49b4ab){_0x34613d[_0x8f21('0x4a')]=_0x49b4ab;return _0x34613d;});}})[_0x8f21('0x27')](respondWithFilteredResult(_0x25ba4a,_0x3c5a93))['catch'](handleError(_0x25ba4a,null));};exports[_0x8f21('0xe6')]=function(_0x2c2ae9,_0x3beff9){var _0x403827={};var _0x4a59f1={};var _0x1fc0e4;var _0x149828;return db[_0x8f21('0x3a')][_0x8f21('0xca')]({'where':{'id':_0x2c2ae9[_0x8f21('0x54')]['id']}})[_0x8f21('0x27')](handleEntityNotFound(_0x3beff9,null))[_0x8f21('0x27')](function(_0x138003){if(_0x138003){_0x1fc0e4=_0x138003;_0x4a59f1['model']=_[_0x8f21('0x57')](db[_0x8f21('0xe7')][_0x8f21('0x3b')]);_0x4a59f1['query']=_[_0x8f21('0x57')](_0x2c2ae9['query']);_0x4a59f1[_0x8f21('0x58')]=_[_0x8f21('0x59')](_0x4a59f1[_0x8f21('0x55')],_0x4a59f1[_0x8f21('0x43')]);_0x403827[_0x8f21('0x48')]=_['intersection'](_0x4a59f1['model'],qs['fields'](_0x2c2ae9['query'][_0x8f21('0x5a')]));_0x403827[_0x8f21('0x48')]=_0x403827[_0x8f21('0x48')][_0x8f21('0x4b')]?_0x403827[_0x8f21('0x48')]:_0x4a59f1[_0x8f21('0x55')];_0x403827[_0x8f21('0xcb')]=qs[_0x8f21('0xcc')](_0x2c2ae9[_0x8f21('0x43')]['sort']);_0x403827['where']=qs[_0x8f21('0x58')](_[_0x8f21('0xd5')](_0x2c2ae9[_0x8f21('0x43')],_0x4a59f1[_0x8f21('0x58')]));if(_0x2c2ae9[_0x8f21('0x43')][_0x8f21('0x30')]){_0x403827['where']=_[_0x8f21('0x5c')](_0x403827[_0x8f21('0x42')],{'$or':_[_0x8f21('0x3c')](_0x403827[_0x8f21('0x48')],function(_0x4c6abd){var _0x265ef2={};_0x265ef2[_0x4c6abd]={'$like':'%'+_0x2c2ae9['query'][_0x8f21('0x30')]+'%'};return _0x265ef2;})});}_0x403827=_[_0x8f21('0x5c')]({},_0x403827,_0x2c2ae9['options']);return _0x1fc0e4['getSmsInteractions'](_0x403827);}})[_0x8f21('0x27')](function(_0x22a21c){if(_0x22a21c){_0x149828=_0x22a21c[_0x8f21('0x4b')];if(!_0x2c2ae9['query'][_0x8f21('0xcd')](_0x8f21('0xd3'))){_0x403827['limit']=qs['limit'](_0x2c2ae9[_0x8f21('0x43')][_0x8f21('0x22')]);_0x403827['offset']=qs[_0x8f21('0x21')](_0x2c2ae9[_0x8f21('0x43')][_0x8f21('0x21')]);}return _0x1fc0e4[_0x8f21('0xe6')](_0x403827);}})['then'](function(_0x59e917){if(_0x59e917){return _0x59e917?{'count':_0x149828,'rows':_0x59e917}:null;}})[_0x8f21('0x27')](respondWithResult(_0x3beff9,null))['catch'](handleError(_0x3beff9,null));};exports[_0x8f21('0xe8')]=function(_0x5bd6fe,_0x2f2cfd){var _0x5b85b5={};var _0x1df21f={};var _0x3d7c18;var _0x2a7e3c;return db[_0x8f21('0x3a')]['findOne']({'where':{'id':_0x5bd6fe[_0x8f21('0x54')]['id']}})[_0x8f21('0x27')](handleEntityNotFound(_0x2f2cfd,null))[_0x8f21('0x27')](function(_0x1716af){if(_0x1716af){_0x3d7c18=_0x1716af;_0x1df21f[_0x8f21('0x55')]=_['keys'](db[_0x8f21('0xe9')][_0x8f21('0x3b')]);_0x1df21f['query']=_['keys'](_0x5bd6fe['query']);_0x1df21f['filters']=_['intersection'](_0x1df21f[_0x8f21('0x55')],_0x1df21f[_0x8f21('0x43')]);_0x5b85b5[_0x8f21('0x48')]=_[_0x8f21('0x59')](_0x1df21f[_0x8f21('0x55')],qs['fields'](_0x5bd6fe[_0x8f21('0x43')][_0x8f21('0x5a')]));_0x5b85b5[_0x8f21('0x48')]=_0x5b85b5[_0x8f21('0x48')][_0x8f21('0x4b')]?_0x5b85b5[_0x8f21('0x48')]:_0x1df21f[_0x8f21('0x55')];_0x5b85b5[_0x8f21('0xcb')]=qs['sort'](_0x5bd6fe[_0x8f21('0x43')][_0x8f21('0xcc')]);_0x5b85b5['where']=qs['filters'](_[_0x8f21('0xd5')](_0x5bd6fe[_0x8f21('0x43')],_0x1df21f[_0x8f21('0x58')]));if(_0x5bd6fe[_0x8f21('0x43')][_0x8f21('0x30')]){_0x5b85b5[_0x8f21('0x42')]=_[_0x8f21('0x5c')](_0x5b85b5[_0x8f21('0x42')],{'$or':_['map'](_0x5b85b5[_0x8f21('0x48')],function(_0x4d1e27){var _0x488b0b={};_0x488b0b[_0x4d1e27]={'$like':'%'+_0x5bd6fe['query']['filter']+'%'};return _0x488b0b;})});}_0x5b85b5=_[_0x8f21('0x5c')]({},_0x5b85b5,_0x5bd6fe[_0x8f21('0xd6')]);return _0x3d7c18[_0x8f21('0xe8')](_0x5b85b5);}})[_0x8f21('0x27')](function(_0x1b28a4){if(_0x1b28a4){_0x2a7e3c=_0x1b28a4[_0x8f21('0x4b')];if(!_0x5bd6fe[_0x8f21('0x43')]['hasOwnProperty']('nolimit')){_0x5b85b5['limit']=qs[_0x8f21('0x22')](_0x5bd6fe[_0x8f21('0x43')][_0x8f21('0x22')]);_0x5b85b5[_0x8f21('0x21')]=qs[_0x8f21('0x21')](_0x5bd6fe[_0x8f21('0x43')][_0x8f21('0x21')]);}return _0x3d7c18[_0x8f21('0xe8')](_0x5b85b5);}})[_0x8f21('0x27')](function(_0x3bde29){if(_0x3bde29){return _0x3bde29?{'count':_0x2a7e3c,'rows':_0x3bde29}:null;}})[_0x8f21('0x27')](respondWithResult(_0x2f2cfd,null))[_0x8f21('0x1d')](handleError(_0x2f2cfd,null));};exports[_0x8f21('0xea')]=function(_0x269dad,_0x5a2aaf){var _0x21ed88={};var _0x2ddf69={};var _0x1ee289;var _0x1df311;return db[_0x8f21('0x3a')]['findOne']({'where':{'id':_0x269dad[_0x8f21('0x54')]['id']}})[_0x8f21('0x27')](handleEntityNotFound(_0x5a2aaf,null))[_0x8f21('0x27')](function(_0xbcd1dc){if(_0xbcd1dc){_0x1ee289=_0xbcd1dc;_0x2ddf69['model']=_['keys'](db[_0x8f21('0xeb')][_0x8f21('0x3b')]);_0x2ddf69[_0x8f21('0x43')]=_[_0x8f21('0x57')](_0x269dad[_0x8f21('0x43')]);_0x2ddf69['filters']=_[_0x8f21('0x59')](_0x2ddf69['model'],_0x2ddf69[_0x8f21('0x43')]);_0x21ed88[_0x8f21('0x48')]=_['intersection'](_0x2ddf69[_0x8f21('0x55')],qs['fields'](_0x269dad[_0x8f21('0x43')][_0x8f21('0x5a')]));_0x21ed88['attributes']=_0x21ed88['attributes'][_0x8f21('0x4b')]?_0x21ed88[_0x8f21('0x48')]:_0x2ddf69['model'];_0x21ed88['order']=qs['sort'](_0x269dad[_0x8f21('0x43')][_0x8f21('0xcc')]);_0x21ed88[_0x8f21('0x42')]=qs[_0x8f21('0x58')](_[_0x8f21('0xd5')](_0x269dad[_0x8f21('0x43')],_0x2ddf69[_0x8f21('0x58')]));if(_0x269dad[_0x8f21('0x43')]['filter']){_0x21ed88['where']=_['merge'](_0x21ed88[_0x8f21('0x42')],{'$or':_[_0x8f21('0x3c')](_0x21ed88[_0x8f21('0x48')],function(_0xcd7c7d){var _0x546010={};_0x546010[_0xcd7c7d]={'$like':'%'+_0x269dad['query'][_0x8f21('0x30')]+'%'};return _0x546010;})});}_0x21ed88=_[_0x8f21('0x5c')]({},_0x21ed88,_0x269dad[_0x8f21('0xd6')]);return _0x1ee289[_0x8f21('0xea')](_0x21ed88);}})[_0x8f21('0x27')](function(_0x41abdf){if(_0x41abdf){_0x1df311=_0x41abdf[_0x8f21('0x4b')];if(!_0x269dad[_0x8f21('0x43')]['hasOwnProperty'](_0x8f21('0xd3'))){_0x21ed88[_0x8f21('0x22')]=qs['limit'](_0x269dad[_0x8f21('0x43')][_0x8f21('0x22')]);_0x21ed88[_0x8f21('0x21')]=qs[_0x8f21('0x21')](_0x269dad[_0x8f21('0x43')][_0x8f21('0x21')]);}return _0x1ee289[_0x8f21('0xea')](_0x21ed88);}})[_0x8f21('0x27')](function(_0x485962){if(_0x485962){return _0x485962?{'count':_0x1df311,'rows':_0x485962}:null;}})[_0x8f21('0x27')](respondWithResult(_0x5a2aaf,null))[_0x8f21('0x1d')](handleError(_0x5a2aaf,null));};exports[_0x8f21('0xec')]=function(_0x357dec,_0x3e20a5,_0x4a9c05){var _0x3b5614;var _0x39fd40;var _0x250f2e;var _0x256272=!_[_0x8f21('0x68')](_0x357dec[_0x8f21('0x54')]['id'])?_0x357dec[_0x8f21('0x54')]['id']:!_[_0x8f21('0x68')](_0x357dec[_0x8f21('0x2c')]['id'])?_0x357dec[_0x8f21('0x2c')]['id']:null;return db[_0x8f21('0x3a')][_0x8f21('0x34')]({'where':{'id':_0x256272,'role':{'$or':[_0x8f21('0x2a'),_0x8f21('0x2c'),'agent']}},'attributes':['id',_0x8f21('0x37'),_0x8f21('0xed'),_0x8f21('0xee'),_0x8f21('0x29'),_0x8f21('0x63'),_0x8f21('0x9f')]})[_0x8f21('0x27')](function(_0x11edde){if(_0x11edde){if(_0x11edde[_0x8f21('0x29')]===_0x8f21('0x2d')){_0x3b5614=_0x11edde;if(_0x357dec['body'][_0x8f21('0xa1')]){_0x250f2e=util[_0x8f21('0xac')](_0x8f21('0xef'),_0x3b5614[_0x357dec[_0x8f21('0x5f')][_0x8f21('0xa1')]]);}else if(_0x357dec['body'][_0x8f21('0xf0')]){_0x250f2e=util['format'](_0x8f21('0xad'),_0x357dec['body'][_0x8f21('0xf0')]);}else{_0x250f2e=util['format']('SIP/%s',_0x3b5614[_0x8f21('0x37')]);}socket['to'](util[_0x8f21('0xac')]('user:%s',_0x3b5614[_0x8f21('0x37')]))[_0x8f21('0xa8')](_0x8f21('0xf1'),{'user':{'id':_0x3b5614['id'],'name':_0x3b5614[_0x8f21('0x37')]},'ip':_0x357dec['headers']['x-forwarded-for']||_0x357dec[_0x8f21('0xf2')]['remoteAddress']||_0x357dec['socket'][_0x8f21('0xf3')]||_0x357dec['connection'][_0x8f21('0xf4')][_0x8f21('0xf3')]});return db[_0x8f21('0xaf')][_0x8f21('0xb4')]({'where':{'membername':_0x3b5614['name']},'individualHooks':!![]});}}else{throw new db['Sequelize'][(_0x8f21('0x94'))](_0x8f21('0xf5'));}})[_0x8f21('0x27')](function(){if(_0x3b5614){return _0x3b5614[_0x8f21('0xf6')]({'raw':!![]});}})['then'](function(_0x169698){if(_0x3b5614){var _0x3d1d82=[];if(_0x169698){_0x39fd40=_0x169698;if(_0x39fd40[_0x8f21('0x4b')]){for(var _0x5473c2=0x0;_0x5473c2<_0x39fd40[_0x8f21('0x4b')];_0x5473c2++){_0x3d1d82[_0x8f21('0x49')]({'membername':_0x3b5614[_0x8f21('0x37')],'UserId':_0x3b5614['id'],'queue_name':_0x39fd40[_0x5473c2][_0x8f21('0x37')],'VoiceQueueId':_0x39fd40[_0x5473c2]['id'],'interface':_0x250f2e,'paused':_0x3b5614[_0x8f21('0x9f')]||![],'penalty':_0x39fd40[_0x5473c2][_0x8f21('0xf7')]||0x0});}return BPromise[_0x8f21('0x89')](_0x3d1d82,function(_0x229219){return db[_0x8f21('0xaf')][_0x8f21('0xb0')](_0x229219);});}}}})[_0x8f21('0x27')](function(){if(_0x3b5614){return db[_0x8f21('0xf8')]['findAll']({'where':{'membername':_0x3b5614[_0x8f21('0x37')],'exitAt':null}});}})[_0x8f21('0x27')](function(_0x123d35){if(_0x3b5614){var _0x4dd3e7=[];_0x123d35[_0x8f21('0xf9')](function(_0x2cbfc9){_0x4dd3e7['push'](_0x2cbfc9[_0x8f21('0x26')]({'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise['all'](_0x4dd3e7);}})['then'](function(){if(_0x3b5614){var _0x5099b4=[];var _0x4fac8f=[];var _0x5b83e7=utils[_0x8f21('0xfa')]();var _0x234f11={'membername':_0x3b5614[_0x8f21('0x37')],'interface':_0x250f2e,'enterAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x3b5614[_0x8f21('0x29')],'internal':_0x3b5614[_0x8f21('0x63')]};_0x5b83e7[_0x8f21('0xf9')](function(_0x3c9b6d){_0x5099b4[_0x8f21('0x49')](_[_0x8f21('0x5c')]({'channel':_0x3c9b6d,'type':_0x8f21('0xfb'),'data1':_0x357dec[_0x8f21('0x5f')][_0x8f21('0xfc')],'data2':_0x250f2e},_0x234f11));if(_0x3b5614[_0x8f21('0x9f')]){_0x4fac8f[_0x8f21('0x49')](_[_0x8f21('0x5c')]({'channel':_0x3c9b6d,'type':_0x8f21('0xfd'),'data1':_0x8f21('0xfe')},_0x234f11));}});return db[_0x8f21('0xf8')][_0x8f21('0x87')](_0x5099b4['concat'](_0x4fac8f),{'individualHooks':!![]});}})['then'](function(){if(_0x3b5614){return _0x3b5614[_0x8f21('0x26')]({'online':!![],'lastLoginAt':moment()[_0x8f21('0xac')]('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x3b5614[_0x8f21('0x9f')]||![],'mailPause':_0x3b5614[_0x8f21('0x9f')]||![],'chatPause':_0x3b5614[_0x8f21('0x9f')]||![],'faxPause':_0x3b5614[_0x8f21('0x9f')]||![],'smsPause':_0x3b5614[_0x8f21('0x9f')]||![],'openchannelPause':_0x3b5614[_0x8f21('0x9f')]||![],'whatsappPause':_0x3b5614[_0x8f21('0x9f')]||![],'pauseType':_0x3b5614[_0x8f21('0x9f')]?_0x8f21('0xfe'):null,'interface':_0x250f2e,'lastPauseAt':moment()[_0x8f21('0xac')](_0x8f21('0xff'))});}})['then'](function(_0x58ce50){if(_0x357dec[_0x8f21('0x100')]){return _0x4a9c05();}else{return BPromise['resolve'](_0x58ce50)[_0x8f21('0x27')](respondWithResult(_0x3e20a5,null));}})[_0x8f21('0x1d')](handleError(_0x3e20a5,null));};exports[_0x8f21('0x101')]=function(_0x378ca9,_0x1ea55b){var _0x5096d1;return db['User'][_0x8f21('0x34')]({'where':{'id':_0x378ca9['params']['id'],'role':_0x8f21('0x2d')},'attributes':['id','name',_0x8f21('0x29')]})['then'](handleEntityNotFound(_0x1ea55b,null))['then'](function(_0xa77f44){if(_0xa77f44){_0x5096d1=_0xa77f44;return db[_0x8f21('0xaf')][_0x8f21('0xb4')]({'where':{'membername':_0x5096d1[_0x8f21('0x37')]},'individualHooks':!![]});}})[_0x8f21('0x27')](function(){return db[_0x8f21('0xf8')]['findAll']({'where':{'membername':_0x5096d1[_0x8f21('0x37')],'exitAt':null}});})['then'](function(_0xa2f6fd){var _0x55cb81=[];_0xa2f6fd[_0x8f21('0xf9')](function(_0x3b3c26){_0x55cb81[_0x8f21('0x49')](_0x3b3c26[_0x8f21('0x26')]({'exitAt':moment()[_0x8f21('0xac')](_0x8f21('0xff'))}));});return BPromise[_0x8f21('0x52')](_0x55cb81);})['then'](function(){return _0x5096d1[_0x8f21('0x26')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0x8f21('0x27')](respondWithResult(_0x1ea55b,null))[_0x8f21('0x1d')](handleError(_0x1ea55b,null));};exports[_0x8f21('0x102')]=function(_0x41ad86,_0x20dbda){var _0x37cf23;return db[_0x8f21('0xaf')][_0x8f21('0x26')]({'paused':0x1},{'where':{'UserId':_0x41ad86[_0x8f21('0x54')]['id']},'individualHooks':!![]})[_0x8f21('0x27')](function(){return db[_0x8f21('0x3a')][_0x8f21('0x34')]({'where':{'id':_0x41ad86[_0x8f21('0x54')]['id'],'role':_0x8f21('0x2d')},'attributes':['id',_0x8f21('0x37'),_0x8f21('0x29'),'internal','interface']});})[_0x8f21('0x27')](handleEntityNotFound(_0x20dbda,null))[_0x8f21('0x27')](function(_0x3b8dcb){if(_0x3b8dcb){_0x37cf23=_0x3b8dcb;return respondWithRpcPromise(_0x8f21('0x103'),_0x8f21('0x102'),{'id':_0x37cf23['id'],'name':_0x37cf23[_0x8f21('0x37')],'pause':!![]});}})[_0x8f21('0x27')](function(){if(_0x37cf23){return db[_0x8f21('0xf8')][_0x8f21('0x8a')]({'where':{'membername':_0x37cf23[_0x8f21('0x37')],'type':'PAUSE','exitAt':null}});}})[_0x8f21('0x27')](function(_0x2d9447){if(_0x2d9447[_0x8f21('0x4b')]){var _0x1f12cc=moment()[_0x8f21('0xac')](_0x8f21('0xff'));for(var _0x1c4962=0x0,_0x39df4=_0x2d9447['length'];_0x1c4962<_0x39df4;_0x1c4962++){_0x2d9447[_0x1c4962][_0x8f21('0x104')]({'exitAt':_0x1f12cc});}}})[_0x8f21('0x27')](function(){var _0x3a5a08=[];var _0x264ec4=utils[_0x8f21('0xfa')]();_0x264ec4[_0x8f21('0xf9')](function(_0xb9f275){_0x3a5a08[_0x8f21('0x49')]({'channel':_0xb9f275,'membername':_0x37cf23[_0x8f21('0x37')],'interface':_[_0x8f21('0x68')](_0x37cf23[_0x8f21('0xa1')])?util[_0x8f21('0xac')](_0x8f21('0xad'),_0x37cf23[_0x8f21('0x37')]):_0x37cf23[_0x8f21('0xa1')],'type':_0x8f21('0xfd'),'enterAt':moment()[_0x8f21('0xac')](_0x8f21('0xff')),'data1':_0x41ad86['body'][_0x8f21('0x3d')]||_0x8f21('0x105'),'role':_0x37cf23['role'],'internal':_0x37cf23['internal']});});return db['MemberReport'][_0x8f21('0x87')](_0x3a5a08,{'individualHooks':!![]});})[_0x8f21('0x27')](function(){return _0x37cf23[_0x8f21('0x26')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x41ad86[_0x8f21('0x5f')]['type']||'DEFAULT\x20PAUSE','lastPauseAt':moment()[_0x8f21('0xac')](_0x8f21('0xff'))});})[_0x8f21('0x27')](respondWithResult(_0x20dbda,null))[_0x8f21('0x1d')](handleError(_0x20dbda,null));};exports['unpause']=function(_0x3153c4,_0x356a52){var _0xadbd7b;return db[_0x8f21('0x3a')][_0x8f21('0x34')]({'where':{'id':_0x3153c4[_0x8f21('0x54')]['id']},'attributes':['id',_0x8f21('0x37'),'role',_0x8f21('0xa0'),_0x8f21('0x106'),_0x8f21('0x107'),_0x8f21('0x108'),_0x8f21('0x109'),_0x8f21('0x10a'),'whatsapppause',_0x8f21('0x10b'),_0x8f21('0x10c')]})[_0x8f21('0x27')](handleEntityNotFound(_0x356a52,null))[_0x8f21('0x27')](function(_0x110180){if(_0x110180){_0xadbd7b=_0x110180;if(_0x3153c4[_0x8f21('0x5f')]['channel']&&!utils[_0x8f21('0xa2')](_0x3153c4['body'][_0x8f21('0x9d')])){throw new db[(_0x8f21('0x91'))][(_0x8f21('0x94'))](_0x8f21('0xa3'));}switch(_0x3153c4[_0x8f21('0x5f')][_0x8f21('0x9d')]){case _0x8f21('0xaa'):return respondWithRpcPromise(_0x8f21('0x103'),_0x8f21('0x10d'),{'id':_0xadbd7b['id'],'name':_0xadbd7b['name'],'pause':![]})[_0x8f21('0x27')](function(){return db[_0x8f21('0xaf')][_0x8f21('0x26')]({'paused':0x0},{'where':{'UserId':_0xadbd7b['id']},'individualHooks':!![]});})[_0x8f21('0x27')](function(){return db[_0x8f21('0xf8')]['find']({'where':{'channel':_0x3153c4[_0x8f21('0x5f')][_0x8f21('0x9d')],'membername':_0xadbd7b['name'],'type':_0x8f21('0xfd'),'exitAt':null}});})[_0x8f21('0x27')](function(_0x270632){if(_0x270632){return _0x270632[_0x8f21('0x26')]({'exitAt':moment()[_0x8f21('0xac')](_0x8f21('0xff')),'data2':_0x8f21('0x10e')},{'individualHooks':!![]});}return null;})[_0x8f21('0x27')](function(){return _0xadbd7b[_0x8f21('0x26')]({'voicePause':![]});});case _0x8f21('0x4f'):case _0x8f21('0x4c'):case _0x8f21('0x4e'):case'sms':case _0x8f21('0x51'):case _0x8f21('0x50'):return db[_0x8f21('0xf8')][_0x8f21('0x34')]({'where':{'channel':_0x3153c4[_0x8f21('0x5f')][_0x8f21('0x9d')],'membername':_0xadbd7b[_0x8f21('0x37')],'type':_0x8f21('0xfd'),'exitAt':null}})['then'](function(_0x2878e1){if(_0x2878e1){return _0x2878e1['update']({'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0x8f21('0x10e')},{'individualHooks':!![]});}return null;})[_0x8f21('0x27')](function(){var _0x2e8717={};_[_0x8f21('0x10f')](_0x2e8717,util['format']('%s%s',_0x3153c4[_0x8f21('0x5f')]['channel'],'Pause'),![]);return _0xadbd7b['update'](_0x2e8717);});default:return respondWithRpcPromise(_0x8f21('0x103'),_0x8f21('0x10d'),{'id':_0xadbd7b['id'],'name':_0xadbd7b[_0x8f21('0x37')],'pause':![]})[_0x8f21('0x27')](function(){return db[_0x8f21('0xaf')]['update']({'paused':0x0},{'where':{'UserId':_0xadbd7b['id']}});})['then'](function(){return db['MemberReport'][_0x8f21('0x8a')]({'where':{'membername':_0xadbd7b[_0x8f21('0x37')],'type':_0x8f21('0xfd'),'exitAt':null}});})['then'](function(_0xc55ff1){var _0x434586=[];_0xc55ff1[_0x8f21('0xf9')](function(_0x3e4220){_0x434586[_0x8f21('0x49')](_0x3e4220[_0x8f21('0x26')]({'exitAt':moment()[_0x8f21('0xac')](_0x8f21('0xff')),'data2':_0x8f21('0x10e')}));});return BPromise[_0x8f21('0x52')](_0x434586);})[_0x8f21('0x27')](function(){return _0xadbd7b[_0x8f21('0x26')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'whatsappPause':![],'openchannelPause':![]});});}}})[_0x8f21('0x27')](respondWithResult(_0x356a52,null))[_0x8f21('0x1d')](handleError(_0x356a52,null));};exports[_0x8f21('0x110')]=function(_0x46adf9,_0x117305){var _0x928052={};var _0x30fa3d={};var _0x5ad391;var _0x23300b;return db[_0x8f21('0x3a')][_0x8f21('0xca')]({'where':{'id':_0x46adf9[_0x8f21('0x54')]['id']}})[_0x8f21('0x27')](handleEntityNotFound(_0x117305,null))['then'](function(_0x387be6){if(_0x387be6){_0x5ad391=_0x387be6;_0x30fa3d[_0x8f21('0x55')]=_[_0x8f21('0x57')](db[_0x8f21('0x111')][_0x8f21('0x3b')]);_0x30fa3d[_0x8f21('0x43')]=_[_0x8f21('0x57')](_0x46adf9[_0x8f21('0x43')]);_0x30fa3d['filters']=_[_0x8f21('0x59')](_0x30fa3d[_0x8f21('0x55')],_0x30fa3d['query']);_0x928052['attributes']=_[_0x8f21('0x59')](_0x30fa3d['model'],qs[_0x8f21('0x5a')](_0x46adf9[_0x8f21('0x43')][_0x8f21('0x5a')]));_0x928052[_0x8f21('0x48')]=_0x928052[_0x8f21('0x48')]['length']?_0x928052['attributes']:_0x30fa3d[_0x8f21('0x55')];_0x928052[_0x8f21('0xcb')]=qs['sort'](_0x46adf9['query'][_0x8f21('0xcc')]);_0x928052[_0x8f21('0x42')]=qs[_0x8f21('0x58')](_['pick'](_0x46adf9[_0x8f21('0x43')],_0x30fa3d[_0x8f21('0x58')]));if(_0x46adf9[_0x8f21('0x43')][_0x8f21('0x30')]){_0x928052['where']=_[_0x8f21('0x5c')](_0x928052[_0x8f21('0x42')],{'$or':_[_0x8f21('0x3c')](_0x928052[_0x8f21('0x48')],function(_0x2ea6bb){var _0x3224c2={};_0x3224c2[_0x2ea6bb]={'$like':'%'+_0x46adf9[_0x8f21('0x43')][_0x8f21('0x30')]+'%'};return _0x3224c2;})});}_0x928052=_[_0x8f21('0x5c')]({},_0x928052,_0x46adf9[_0x8f21('0xd6')]);return _0x5ad391['getTeams'](_0x928052);}})['then'](function(_0x4defac){if(_0x4defac){_0x23300b=_0x4defac['length'];if(!_0x46adf9['query']['hasOwnProperty'](_0x8f21('0xd3'))){_0x928052[_0x8f21('0x22')]=qs[_0x8f21('0x22')](_0x46adf9[_0x8f21('0x43')][_0x8f21('0x22')]);_0x928052['offset']=qs['offset'](_0x46adf9[_0x8f21('0x43')][_0x8f21('0x21')]);}return _0x5ad391[_0x8f21('0x110')](_0x928052);}})['then'](function(_0x577775){if(_0x577775){return _0x577775?{'count':_0x23300b,'rows':_0x577775}:null;}})[_0x8f21('0x27')](respondWithResult(_0x117305,null))['catch'](handleError(_0x117305,null));};exports[_0x8f21('0x112')]=function(_0x1d578d,_0x164757){return db[_0x8f21('0x3a')][_0x8f21('0x34')]({'where':{'id':_0x1d578d[_0x8f21('0x54')]['id']}})[_0x8f21('0x27')](handleEntityNotFound(_0x164757,null))['then'](function(_0x234cb5){if(_0x234cb5){var _0x558b26=_0x234cb5[_0x8f21('0x28')]({'plain':!![]});return _0x234cb5[_0x8f21('0x112')](_0x1d578d['body']['ids'],_[_0x8f21('0x113')](_0x1d578d[_0x8f21('0x5f')],[_0x8f21('0x62'),'id'])||{})[_0x8f21('0x27')](function(){for(var _0x2c5028=0x0;_0x2c5028<_0x1d578d[_0x8f21('0x5f')][_0x8f21('0x62')][_0x8f21('0x4b')];_0x2c5028++){var _0x45b893=[];var _0x575164={};db[_0x8f21('0x111')][_0x8f21('0xca')]({'where':{'id':_0x1d578d[_0x8f21('0x5f')][_0x8f21('0x62')][_0x2c5028]}})[_0x8f21('0x27')](function(_0x355f2d){_0x575164=_0x355f2d['dataValues'];_0x45b893[_0x8f21('0x49')](_0x355f2d[_0x8f21('0xf6')]()[_0x8f21('0x27')](function(_0x352c54){for(var _0x5095d1=0x0;_0x5095d1<_0x352c54[_0x8f21('0x4b')];_0x5095d1++){_0x352c54[_0x5095d1]['setDataValue']('channel',_0x8f21('0x114'));}return _0x352c54;}));_0x45b893[_0x8f21('0x49')](_0x355f2d[_0x8f21('0x115')]()[_0x8f21('0x27')](function(_0x586580){for(var _0x9bcb01=0x0;_0x9bcb01<_0x586580[_0x8f21('0x4b')];_0x9bcb01++){_0x586580[_0x9bcb01][_0x8f21('0x116')]('channel',_0x8f21('0x117'));}return _0x586580;}));_0x45b893['push'](_0x355f2d[_0x8f21('0x118')]()[_0x8f21('0x27')](function(_0x12f582){for(var _0x267d4f=0x0;_0x267d4f<_0x12f582['length'];_0x267d4f++){_0x12f582[_0x267d4f]['setDataValue'](_0x8f21('0x9d'),_0x8f21('0x119'));}return _0x12f582;}));_0x45b893[_0x8f21('0x49')](_0x355f2d[_0x8f21('0x11a')]()[_0x8f21('0x27')](function(_0x3f1e9e){for(var _0x439779=0x0;_0x439779<_0x3f1e9e[_0x8f21('0x4b')];_0x439779++){_0x3f1e9e[_0x439779][_0x8f21('0x116')](_0x8f21('0x9d'),_0x8f21('0x11b'));}return _0x3f1e9e;}));_0x45b893[_0x8f21('0x49')](_0x355f2d['getWhatsappQueues']()[_0x8f21('0x27')](function(_0x327c26){for(var _0x703d4=0x0;_0x703d4<_0x327c26['length'];_0x703d4++){_0x327c26[_0x703d4][_0x8f21('0x116')](_0x8f21('0x9d'),_0x8f21('0x11c'));}return _0x327c26;}));_0x45b893[_0x8f21('0x49')](_0x355f2d['getFaxQueues']()[_0x8f21('0x27')](function(_0x38fe8a){for(var _0x37dc5e=0x0;_0x37dc5e<_0x38fe8a[_0x8f21('0x4b')];_0x37dc5e++){_0x38fe8a[_0x37dc5e][_0x8f21('0x116')]('channel',_0x8f21('0x11d'));}return _0x38fe8a;}));_0x45b893[_0x8f21('0x49')](_0x355f2d[_0x8f21('0x11e')]()[_0x8f21('0x27')](function(_0x3377b2){for(var _0x4f5fd8=0x0;_0x4f5fd8<_0x3377b2[_0x8f21('0x4b')];_0x4f5fd8++){_0x3377b2[_0x4f5fd8]['setDataValue'](_0x8f21('0x9d'),_0x8f21('0x11f'));}return _0x3377b2;}));return BPromise['all'](_0x45b893);})['then'](function(_0x3544da){var _0x26f090=_[_0x8f21('0x120')](_0x3544da);_0x45b893=[];return db[_0x8f21('0x6a')][_0x8f21('0x121')](function(_0x10afab){for(var _0x478768=0x0;_0x478768<_0x26f090[_0x8f21('0x4b')];_0x478768++){_0x45b893[_0x8f21('0x49')](_0x26f090[_0x478768][_0x8f21('0x122')](_0x558b26['id']),{'transaction':_0x10afab});}return BPromise[_0x8f21('0x52')](_0x45b893)['then'](function(){if(_0x558b26[_0x8f21('0x9e')]){return BPromise['each'](_[_0x8f21('0x30')](_0x26f090,function(_0x198038){return _0x198038[_0x8f21('0x123')](_0x8f21('0x9d'))===_0x8f21('0x114');}),function(_0x3a99de){return db[_0x8f21('0xaf')][_0x8f21('0xb0')]({'membername':_0x558b26[_0x8f21('0x37')],'UserId':_0x558b26['id'],'queue_name':_0x3a99de[_0x8f21('0x37')],'VoiceQueueId':_0x3a99de['id'],'interface':_[_0x8f21('0x68')](_0x558b26[_0x8f21('0xa1')])?util['format'](_0x8f21('0xad'),_0x558b26[_0x8f21('0x37')]):_0x558b26[_0x8f21('0xa1')],'paused':_0x558b26['voicePause']||![],'penalty':_0x558b26[_0x8f21('0xae')]},{'transaction':_0x10afab});});}else{return;}})['then'](function(){for(var _0x328697=0x0;_0x328697<_0x26f090[_0x8f21('0x4b')];_0x328697++){var _0x2074fa=_0x26f090[_0x328697]['getDataValue']('channel');var _0x5f08a5=_0x2074fa+_0x8f21('0xa7');socket['emit'](_0x8f21('0x2c')+_0x2074fa+_0x8f21('0xa9'),{'UserId':_0x558b26['id'],['queueField']:_0x26f090[_0x328697]['id']});}});});})[_0x8f21('0x27')](function(){db[_0x8f21('0x124')][_0x8f21('0xca')]({'where':{'teamId':_0x575164['id']}})[_0x8f21('0x27')](function(_0x499d22){if(_0x499d22){db[_0x8f21('0x125')]['create']({'UserId':_0x1d578d[_0x8f21('0x54')]['id'],'VoicePrefixId':_0x499d22[_0x8f21('0x126')]});}});});}});}})[_0x8f21('0x27')](respondWithStatusCode(_0x164757,null))[_0x8f21('0x1d')](handleError(_0x164757,null));};exports[_0x8f21('0x127')]=function(_0x5e55a1,_0x51a80b){return db[_0x8f21('0x3a')][_0x8f21('0xca')]({'where':{'id':_0x5e55a1[_0x8f21('0x54')]['id']}})['then'](handleEntityNotFound(_0x51a80b,null))[_0x8f21('0x27')](function(_0x1daa42){if(_0x1daa42){var _0x383963=_0x1daa42[_0x8f21('0x28')]({'plain':!![]});var _0x2a9175=_0x5e55a1['query'][_0x8f21('0x62')];return _0x1daa42[_0x8f21('0x127')](_0x2a9175)[_0x8f21('0x27')](function(){for(var _0x1dfab8=0x0;_0x1dfab8<_0x2a9175['length'];_0x1dfab8++){var _0xd8d3fd=[];var _0x178b45={};db[_0x8f21('0x111')][_0x8f21('0xca')]({'where':{'id':_0x2a9175[_0x1dfab8]}})['then'](function(_0x3fbf2b){_0x178b45=_0x3fbf2b[_0x8f21('0x4d')];_0xd8d3fd['push'](_0x3fbf2b['getVoiceQueues']()['then'](function(_0x41ff94){for(var _0x2287b8=0x0;_0x2287b8<_0x41ff94[_0x8f21('0x4b')];_0x2287b8++){_0x41ff94[_0x2287b8][_0x8f21('0x116')](_0x8f21('0x9d'),_0x8f21('0x114'));}return _0x41ff94;}));_0xd8d3fd['push'](_0x3fbf2b['getChatQueues']()[_0x8f21('0x27')](function(_0xc75e8){for(var _0x4c0e0d=0x0;_0x4c0e0d<_0xc75e8[_0x8f21('0x4b')];_0x4c0e0d++){_0xc75e8[_0x4c0e0d][_0x8f21('0x116')]('channel',_0x8f21('0x117'));}return _0xc75e8;}));_0xd8d3fd[_0x8f21('0x49')](_0x3fbf2b['getMailQueues']()[_0x8f21('0x27')](function(_0x4ab09f){for(var _0x14c286=0x0;_0x14c286<_0x4ab09f[_0x8f21('0x4b')];_0x14c286++){_0x4ab09f[_0x14c286][_0x8f21('0x116')](_0x8f21('0x9d'),_0x8f21('0x119'));}return _0x4ab09f;}));_0xd8d3fd[_0x8f21('0x49')](_0x3fbf2b[_0x8f21('0x11a')]()[_0x8f21('0x27')](function(_0x3ae75c){for(var _0x5e55e7=0x0;_0x5e55e7<_0x3ae75c[_0x8f21('0x4b')];_0x5e55e7++){_0x3ae75c[_0x5e55e7]['setDataValue']('channel','Sms');}return _0x3ae75c;}));_0xd8d3fd[_0x8f21('0x49')](_0x3fbf2b[_0x8f21('0x128')]()[_0x8f21('0x27')](function(_0xc10db6){for(var _0x102dc4=0x0;_0x102dc4<_0xc10db6[_0x8f21('0x4b')];_0x102dc4++){_0xc10db6[_0x102dc4][_0x8f21('0x116')](_0x8f21('0x9d'),_0x8f21('0x11c'));}return _0xc10db6;}));_0xd8d3fd[_0x8f21('0x49')](_0x3fbf2b[_0x8f21('0x129')]()[_0x8f21('0x27')](function(_0x2db693){for(var _0x2b54a1=0x0;_0x2b54a1<_0x2db693['length'];_0x2b54a1++){_0x2db693[_0x2b54a1]['setDataValue'](_0x8f21('0x9d'),_0x8f21('0x11d'));}return _0x2db693;}));_0xd8d3fd[_0x8f21('0x49')](_0x3fbf2b[_0x8f21('0x11e')]()[_0x8f21('0x27')](function(_0x45a7c0){for(var _0x103c4c=0x0;_0x103c4c<_0x45a7c0[_0x8f21('0x4b')];_0x103c4c++){_0x45a7c0[_0x103c4c][_0x8f21('0x116')]('channel',_0x8f21('0x11f'));}return _0x45a7c0;}));return BPromise['all'](_0xd8d3fd);})[_0x8f21('0x27')](function(_0x232c1a){var _0x3c0774=_[_0x8f21('0x120')](_0x232c1a);_0xd8d3fd=[];return db[_0x8f21('0x6a')][_0x8f21('0x121')](function(_0x2440d4){for(var _0x3926c9=0x0;_0x3926c9<_0x3c0774[_0x8f21('0x4b')];_0x3926c9++){_0xd8d3fd['push'](_0x3c0774[_0x3926c9][_0x8f21('0x12a')](_0x383963['id']),{'transaction':_0x2440d4});}return BPromise[_0x8f21('0x52')](_0xd8d3fd)[_0x8f21('0x27')](function(){if(_0x383963['online']){return BPromise[_0x8f21('0x89')](_[_0x8f21('0x30')](_0x3c0774,function(_0x2abaf0){return _0x2abaf0[_0x8f21('0x123')]('channel')===_0x8f21('0x114');}),function(_0x1b26d9){return db[_0x8f21('0xaf')][_0x8f21('0xb4')]({'where':{'VoiceQueueId':_0x1b26d9['id'],'UserId':_0x383963['id']},'transaction':_0x2440d4});});}else{return;}})['then'](function(){db[_0x8f21('0x124')]['findOne']({'where':{'teamId':_0x178b45['id']}})['then'](function(_0x25b66c){if(_0x25b66c){return db[_0x8f21('0x125')][_0x8f21('0xb4')]({'where':{'UserId':_0x383963['id'],'VoicePrefixId':_0x25b66c[_0x8f21('0x4d')]['VoicePrefixId']}});}});})[_0x8f21('0x27')](function(){for(var _0x388bbd=0x0;_0x388bbd<_0x3c0774[_0x8f21('0x4b')];_0x388bbd++){var _0x2ce572=_0x3c0774[_0x388bbd][_0x8f21('0x123')](_0x8f21('0x9d'));var _0x2c9a64=_0x2ce572+_0x8f21('0xa7');socket[_0x8f21('0xa8')]('user'+_0x2ce572+_0x8f21('0xb3'),{'UserId':_0x383963['id'],['queueField']:_0x3c0774[_0x388bbd]['id']});}});});});}});}})[_0x8f21('0x27')](respondWithStatusCode(_0x51a80b,null))[_0x8f21('0x1d')](handleError(_0x51a80b,null));};exports['getLists']=function(_0x3636ee,_0x3d8949){var _0x2e3096={};var _0x4d4376={};var _0x6e6bb3;var _0x322901;return db[_0x8f21('0x3a')]['findOne']({'where':{'id':_0x3636ee[_0x8f21('0x54')]['id']}})[_0x8f21('0x27')](handleEntityNotFound(_0x3d8949,null))[_0x8f21('0x27')](function(_0x3870ba){if(_0x3870ba){_0x6e6bb3=_0x3870ba;_0x4d4376[_0x8f21('0x55')]=_[_0x8f21('0x57')](db[_0x8f21('0xce')]['rawAttributes']);_0x4d4376[_0x8f21('0x43')]=_[_0x8f21('0x57')](_0x3636ee[_0x8f21('0x43')]);_0x4d4376[_0x8f21('0x58')]=_[_0x8f21('0x59')](_0x4d4376[_0x8f21('0x55')],_0x4d4376['query']);_0x2e3096['attributes']=_['intersection'](_0x4d4376[_0x8f21('0x55')],qs[_0x8f21('0x5a')](_0x3636ee[_0x8f21('0x43')]['fields']));_0x2e3096[_0x8f21('0x48')]=_0x2e3096[_0x8f21('0x48')][_0x8f21('0x4b')]?_0x2e3096['attributes']:_0x4d4376['model'];_0x2e3096['order']=qs[_0x8f21('0xcc')](_0x3636ee[_0x8f21('0x43')]['sort']);_0x2e3096[_0x8f21('0x42')]=qs[_0x8f21('0x58')](_[_0x8f21('0xd5')](_0x3636ee[_0x8f21('0x43')],_0x4d4376['filters']));if(_0x3636ee[_0x8f21('0x43')][_0x8f21('0x30')]){_0x2e3096[_0x8f21('0x42')]=_[_0x8f21('0x5c')](_0x2e3096[_0x8f21('0x42')],{'$or':_[_0x8f21('0x3c')](_0x2e3096[_0x8f21('0x48')],function(_0x50f7dd){var _0x3843d7={};_0x3843d7[_0x50f7dd]={'$like':'%'+_0x3636ee[_0x8f21('0x43')][_0x8f21('0x30')]+'%'};return _0x3843d7;})});}_0x2e3096=_[_0x8f21('0x5c')]({},_0x2e3096,_0x3636ee['options']);return _0x6e6bb3['getLists'](_0x2e3096);}})[_0x8f21('0x27')](function(_0x26573e){if(_0x26573e){_0x322901=_0x26573e[_0x8f21('0x4b')];if(!_0x3636ee[_0x8f21('0x43')][_0x8f21('0xcd')](_0x8f21('0xd3'))){_0x2e3096[_0x8f21('0x22')]=qs['limit'](_0x3636ee[_0x8f21('0x43')][_0x8f21('0x22')]);_0x2e3096[_0x8f21('0x21')]=qs[_0x8f21('0x21')](_0x3636ee['query']['offset']);}return _0x6e6bb3[_0x8f21('0x12b')](_0x2e3096);}})[_0x8f21('0x27')](function(_0x568876){if(_0x568876){return _0x568876?{'count':_0x322901,'rows':_0x568876}:null;}})[_0x8f21('0x27')](respondWithResult(_0x3d8949,null))['catch'](handleError(_0x3d8949,null));};exports['getAgents']=function(_0x100471,_0x173744){var _0x519682={};var _0x63ae0b={};var _0x386ffe;return db['User'][_0x8f21('0xca')]({'where':{'id':_0x100471[_0x8f21('0x54')]['id']}})[_0x8f21('0x27')](handleEntityNotFound(_0x173744,null))[_0x8f21('0x27')](function(_0x19d4f0){if(_0x19d4f0){_0x386ffe=_0x19d4f0;_0x63ae0b[_0x8f21('0x55')]=_[_0x8f21('0x57')](db[_0x8f21('0x3a')]['rawAttributes']);_0x63ae0b[_0x8f21('0x43')]=_[_0x8f21('0x57')](_0x100471['query']);_0x63ae0b[_0x8f21('0x58')]=_[_0x8f21('0x59')](_0x63ae0b['model'],_0x63ae0b[_0x8f21('0x43')]);_0x519682[_0x8f21('0x48')]=_[_0x8f21('0x59')](_0x63ae0b[_0x8f21('0x55')],qs['fields'](_0x100471[_0x8f21('0x43')][_0x8f21('0x5a')]));_0x519682[_0x8f21('0x48')]=_0x519682['attributes'][_0x8f21('0x4b')]?_0x519682['attributes']:_0x63ae0b[_0x8f21('0x55')];_0x519682[_0x8f21('0xcb')]=qs[_0x8f21('0xcc')](_0x100471[_0x8f21('0x43')][_0x8f21('0xcc')]);_0x519682[_0x8f21('0x42')]=qs['filters'](_[_0x8f21('0xd5')](_0x100471['query'],_0x63ae0b['filters']));if(_0x100471[_0x8f21('0x43')][_0x8f21('0x30')]){_0x519682[_0x8f21('0x42')]=_[_0x8f21('0x5c')](_0x519682['where'],{'$or':_[_0x8f21('0x3c')](_0x519682['attributes'],function(_0x1e5625){var _0x338e96={};_0x338e96[_0x1e5625]={'$like':'%'+_0x100471['query'][_0x8f21('0x30')]+'%'};return _0x338e96;})});}_0x519682['model']=db[_0x8f21('0x3a')];_0x519682['as']=_0x8f21('0x8b');_0x519682=_['merge']({},_0x519682,_0x100471['options']);return _0x386ffe[_0x8f21('0xf6')]({'include':[_0x519682]});}})[_0x8f21('0x27')](function(_0x11a817){if(_0x11a817){var _0x4110b2={},_0x2db74f=[];for(var _0x37428a=0x0;_0x37428a<_0x11a817[_0x8f21('0x4b')];_0x37428a+=0x1){for(var _0x60e51=0x0,_0x100034;_0x60e51<_0x11a817[_0x37428a][_0x8f21('0x8b')][_0x8f21('0x4b')];_0x60e51+=0x1){_0x100034=_0x11a817[_0x37428a][_0x8f21('0x8b')][_0x60e51][_0x8f21('0x28')]({'plain':!![]});_0x4110b2[_0x100034['id']]=_0x100034;}}_0x4110b2=_['values'](_0x4110b2);for(var _0x3bc04d=qs['offset'](_0x100471[_0x8f21('0x43')]['offset']);_0x3bc04d<_0x4110b2[_0x8f21('0x4b')]&&_0x2db74f[_0x8f21('0x4b')]<qs[_0x8f21('0x22')](_0x100471[_0x8f21('0x43')]['limit']);_0x3bc04d+=0x1){if(_0x4110b2[_0x3bc04d]){_0x2db74f[_0x8f21('0x49')](_0x4110b2[_0x3bc04d]);}}return{'count':_0x4110b2[_0x8f21('0x4b')],'rows':_0x2db74f};}})['then'](respondWithResult(_0x173744,null))[_0x8f21('0x1d')](handleError(_0x173744,null));};exports[_0x8f21('0xb4')]=function(_0x1a0e73,_0x24fafd){if(_0x1a0e73[_0x8f21('0x2c')]['id']==_0x1a0e73['params']['id']){return _0x24fafd[_0x8f21('0x1f')](0x1f4)[_0x8f21('0x38')]({'message':_0x8f21('0x12c')});}return db['User'][_0x8f21('0x34')]({'where':{'id':_0x1a0e73[_0x8f21('0x54')]['id']}})[_0x8f21('0x27')](handleEntityNotFound(_0x24fafd,null))[_0x8f21('0x27')](removeEntity(_0x24fafd,null))[_0x8f21('0x1d')](handleError(_0x24fafd,null));};exports[_0x8f21('0x12d')]=function(_0x2aa166,_0x142184){return db['User'][_0x8f21('0x34')]({'where':{'id':_0x2aa166[_0x8f21('0x54')]['id']}})[_0x8f21('0x27')](handleEntityNotFound(_0x142184,null))[_0x8f21('0x27')](function(_0x2ab804){if(_0x2ab804){return _0x2ab804['addChatInteractions'](_0x2aa166[_0x8f21('0x5f')][_0x8f21('0x62')],_[_0x8f21('0x113')](_0x2aa166['body'],['ids','id'])||{})[_0x8f21('0x12e')](function(){for(var _0x4abc90=0x0;_0x4abc90<_0x2aa166[_0x8f21('0x5f')][_0x8f21('0x62')][_0x8f21('0x4b')];_0x4abc90+=0x1){socket[_0x8f21('0xa8')](_0x8f21('0x12f'),{'ChatInteractionId':Number(_0x2aa166[_0x8f21('0x5f')]['ids'][_0x4abc90]),'UserId':Number(_0x2aa166[_0x8f21('0x54')]['id'])});}return _0x2aa166[_0x8f21('0x5f')][_0x8f21('0x62')];});}})[_0x8f21('0x27')](respondWithResult(_0x142184,null))['catch'](handleError(_0x142184,null));};exports[_0x8f21('0x130')]=function(_0x18c7e1,_0xa3c63b){return db['User']['find']({'where':{'id':_0x18c7e1[_0x8f21('0x54')]['id']}})[_0x8f21('0x27')](handleEntityNotFound(_0xa3c63b,null))[_0x8f21('0x27')](function(_0x145c15){if(_0x145c15){return _0x145c15['removeChatInteractions'](_0x18c7e1[_0x8f21('0x43')][_0x8f21('0x62')])['then'](function(){if(_['isArray'](_0x18c7e1[_0x8f21('0x43')][_0x8f21('0x62')])){for(var _0x26cd12=0x0;_0x26cd12<_0x18c7e1['query'][_0x8f21('0x62')]['length'];_0x26cd12+=0x1){socket[_0x8f21('0xa8')](_0x8f21('0x131'),{'ChatInteractionId':Number(_0x18c7e1[_0x8f21('0x43')][_0x8f21('0x62')][_0x26cd12]),'UserId':Number(_0x18c7e1[_0x8f21('0x54')]['id'])});}}else{socket['emit'](_0x8f21('0x131'),{'ChatInteractionId':Number(_0x18c7e1[_0x8f21('0x43')]['ids']),'UserId':Number(_0x18c7e1[_0x8f21('0x54')]['id'])});}});}})['then'](respondWithStatusCode(_0xa3c63b,null))[_0x8f21('0x1d')](handleError(_0xa3c63b,null));};exports[_0x8f21('0x132')]=function(_0x279255,_0x554386){return db[_0x8f21('0x3a')][_0x8f21('0x34')]({'where':{'id':_0x279255[_0x8f21('0x54')]['id']}})['then'](handleEntityNotFound(_0x554386,null))[_0x8f21('0x27')](function(_0x2aee2d){if(_0x2aee2d){return _0x2aee2d[_0x8f21('0x132')](_0x279255[_0x8f21('0x5f')][_0x8f21('0x62')],_[_0x8f21('0x113')](_0x279255['body'],[_0x8f21('0x62'),'id'])||{})[_0x8f21('0x12e')](function(){for(var _0x1c50e3=0x0;_0x1c50e3<_0x279255[_0x8f21('0x5f')][_0x8f21('0x62')][_0x8f21('0x4b')];_0x1c50e3+=0x1){socket[_0x8f21('0xa8')](_0x8f21('0x133'),{'MailInteractionId':Number(_0x279255[_0x8f21('0x5f')][_0x8f21('0x62')][_0x1c50e3]),'UserId':Number(_0x279255[_0x8f21('0x54')]['id'])});}return _0x279255[_0x8f21('0x5f')][_0x8f21('0x62')];});}})['then'](respondWithResult(_0x554386,null))[_0x8f21('0x1d')](handleError(_0x554386,null));};exports['removeMailInteractions']=function(_0x2ecca8,_0x17ee0f){return db['User'][_0x8f21('0x34')]({'where':{'id':_0x2ecca8[_0x8f21('0x54')]['id']}})[_0x8f21('0x27')](handleEntityNotFound(_0x17ee0f,null))[_0x8f21('0x27')](function(_0x19c15d){if(_0x19c15d){return _0x19c15d['removeMailInteractions'](_0x2ecca8[_0x8f21('0x43')][_0x8f21('0x62')])[_0x8f21('0x27')](function(){if(_[_0x8f21('0x134')](_0x2ecca8[_0x8f21('0x43')][_0x8f21('0x62')])){for(var _0x22a071=0x0;_0x22a071<_0x2ecca8[_0x8f21('0x43')]['ids'][_0x8f21('0x4b')];_0x22a071+=0x1){socket[_0x8f21('0xa8')](_0x8f21('0x135'),{'MailInteractionId':Number(_0x2ecca8['query'][_0x8f21('0x62')][_0x22a071]),'UserId':Number(_0x2ecca8[_0x8f21('0x54')]['id'])});}}else{socket[_0x8f21('0xa8')]('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0x2ecca8['query'][_0x8f21('0x62')]),'UserId':Number(_0x2ecca8[_0x8f21('0x54')]['id'])});}});}})[_0x8f21('0x27')](respondWithStatusCode(_0x17ee0f,null))[_0x8f21('0x1d')](handleError(_0x17ee0f,null));};exports[_0x8f21('0x136')]=function(_0x5aade6,_0x5cc8cf){return db[_0x8f21('0x3a')][_0x8f21('0x34')]({'where':{'id':_0x5aade6['params']['id']}})['then'](handleEntityNotFound(_0x5cc8cf,null))['then'](function(_0x1fff80){if(_0x1fff80){return _0x1fff80[_0x8f21('0x136')](_0x5aade6[_0x8f21('0x5f')][_0x8f21('0x62')],_[_0x8f21('0x113')](_0x5aade6[_0x8f21('0x5f')],[_0x8f21('0x62'),'id'])||{})[_0x8f21('0x12e')](function(){for(var _0x2402c4=0x0;_0x2402c4<_0x5aade6[_0x8f21('0x5f')][_0x8f21('0x62')][_0x8f21('0x4b')];_0x2402c4+=0x1){socket[_0x8f21('0xa8')]('user_has_fax_interactions:save',{'FaxInteractionId':Number(_0x5aade6[_0x8f21('0x5f')][_0x8f21('0x62')][_0x2402c4]),'UserId':Number(_0x5aade6['params']['id'])});}return _0x5aade6[_0x8f21('0x5f')][_0x8f21('0x62')];});}})['then'](respondWithResult(_0x5cc8cf,null))['catch'](handleError(_0x5cc8cf,null));};exports[_0x8f21('0x137')]=function(_0x34ecec,_0x2c37c7){return db[_0x8f21('0x3a')][_0x8f21('0x34')]({'where':{'id':_0x34ecec[_0x8f21('0x54')]['id']}})[_0x8f21('0x27')](handleEntityNotFound(_0x2c37c7,null))[_0x8f21('0x27')](function(_0x144817){if(_0x144817){return _0x144817[_0x8f21('0x137')](_0x34ecec[_0x8f21('0x43')][_0x8f21('0x62')])['then'](function(){if(_['isArray'](_0x34ecec[_0x8f21('0x43')][_0x8f21('0x62')])){for(var _0x27a653=0x0;_0x27a653<_0x34ecec[_0x8f21('0x43')]['ids'][_0x8f21('0x4b')];_0x27a653+=0x1){socket['emit'](_0x8f21('0x138'),{'FaxInteractionId':Number(_0x34ecec[_0x8f21('0x43')][_0x8f21('0x62')][_0x27a653]),'UserId':Number(_0x34ecec[_0x8f21('0x54')]['id'])});}}else{socket['emit'](_0x8f21('0x138'),{'FaxInteractionId':Number(_0x34ecec[_0x8f21('0x43')][_0x8f21('0x62')]),'UserId':Number(_0x34ecec['params']['id'])});}});}})[_0x8f21('0x27')](respondWithStatusCode(_0x2c37c7,null))[_0x8f21('0x1d')](handleError(_0x2c37c7,null));};exports[_0x8f21('0x139')]=function(_0x4f6b4f,_0x4ffc4b){return db[_0x8f21('0x3a')]['find']({'where':{'id':_0x4f6b4f['params']['id']}})['then'](handleEntityNotFound(_0x4ffc4b,null))[_0x8f21('0x27')](function(_0x527b36){if(_0x527b36){return _0x527b36[_0x8f21('0x139')](_0x4f6b4f[_0x8f21('0x5f')][_0x8f21('0x62')],_['omit'](_0x4f6b4f[_0x8f21('0x5f')],[_0x8f21('0x62'),'id'])||{})[_0x8f21('0x12e')](function(){for(var _0x1a3836=0x0;_0x1a3836<_0x4f6b4f['body'][_0x8f21('0x62')][_0x8f21('0x4b')];_0x1a3836+=0x1){socket[_0x8f21('0xa8')](_0x8f21('0x13a'),{'SmsInteractionId':Number(_0x4f6b4f['body']['ids'][_0x1a3836]),'UserId':Number(_0x4f6b4f['params']['id'])});}return _0x4f6b4f[_0x8f21('0x5f')][_0x8f21('0x62')];});}})[_0x8f21('0x27')](respondWithResult(_0x4ffc4b,null))[_0x8f21('0x1d')](handleError(_0x4ffc4b,null));};exports['removeSmsInteractions']=function(_0x353a32,_0x949e00){return db['User']['find']({'where':{'id':_0x353a32[_0x8f21('0x54')]['id']}})[_0x8f21('0x27')](handleEntityNotFound(_0x949e00,null))[_0x8f21('0x27')](function(_0x928ca1){if(_0x928ca1){return _0x928ca1[_0x8f21('0x13b')](_0x353a32[_0x8f21('0x43')][_0x8f21('0x62')])[_0x8f21('0x27')](function(){if(_[_0x8f21('0x134')](_0x353a32[_0x8f21('0x43')][_0x8f21('0x62')])){for(var _0x45cd4d=0x0;_0x45cd4d<_0x353a32[_0x8f21('0x43')]['ids']['length'];_0x45cd4d+=0x1){socket[_0x8f21('0xa8')](_0x8f21('0x13c'),{'SmsInteractionId':Number(_0x353a32[_0x8f21('0x43')][_0x8f21('0x62')][_0x45cd4d]),'UserId':Number(_0x353a32[_0x8f21('0x54')]['id'])});}}else{socket['emit'](_0x8f21('0x13c'),{'SmsInteractionId':Number(_0x353a32[_0x8f21('0x43')][_0x8f21('0x62')]),'UserId':Number(_0x353a32[_0x8f21('0x54')]['id'])});}});}})[_0x8f21('0x27')](respondWithStatusCode(_0x949e00,null))[_0x8f21('0x1d')](handleError(_0x949e00,null));};exports[_0x8f21('0x13d')]=function(_0xbe9e8e,_0x171e99){return db[_0x8f21('0x3a')]['find']({'where':{'id':_0xbe9e8e['params']['id']}})[_0x8f21('0x27')](handleEntityNotFound(_0x171e99,null))[_0x8f21('0x27')](function(_0x134c3e){if(_0x134c3e){return _0x134c3e[_0x8f21('0x13d')](_0xbe9e8e[_0x8f21('0x5f')]['ids'],_[_0x8f21('0x113')](_0xbe9e8e[_0x8f21('0x5f')],[_0x8f21('0x62'),'id'])||{})[_0x8f21('0x12e')](function(){for(var _0x271a7f=0x0;_0x271a7f<_0xbe9e8e[_0x8f21('0x5f')][_0x8f21('0x62')][_0x8f21('0x4b')];_0x271a7f+=0x1){socket[_0x8f21('0xa8')](_0x8f21('0x13e'),{'OpenchannelInteractionId':Number(_0xbe9e8e[_0x8f21('0x5f')][_0x8f21('0x62')][_0x271a7f]),'UserId':Number(_0xbe9e8e['params']['id'])});}return _0xbe9e8e[_0x8f21('0x5f')][_0x8f21('0x62')];});}})['then'](respondWithResult(_0x171e99,null))[_0x8f21('0x1d')](handleError(_0x171e99,null));};exports[_0x8f21('0x13f')]=function(_0x293194,_0x2525d6){return db[_0x8f21('0x3a')][_0x8f21('0x34')]({'where':{'id':_0x293194['params']['id']}})['then'](handleEntityNotFound(_0x2525d6,null))[_0x8f21('0x27')](function(_0x12c473){if(_0x12c473){return _0x12c473[_0x8f21('0x13f')](_0x293194[_0x8f21('0x43')][_0x8f21('0x62')])[_0x8f21('0x27')](function(){if(_[_0x8f21('0x134')](_0x293194[_0x8f21('0x43')][_0x8f21('0x62')])){for(var _0x1f1480=0x0;_0x1f1480<_0x293194['query'][_0x8f21('0x62')][_0x8f21('0x4b')];_0x1f1480+=0x1){socket[_0x8f21('0xa8')]('user_has_openchannel_interactions:remove',{'OpenchannelInteractionId':Number(_0x293194[_0x8f21('0x43')][_0x8f21('0x62')][_0x1f1480]),'UserId':Number(_0x293194[_0x8f21('0x54')]['id'])});}}else{socket['emit']('user_has_openchannel_interactions:remove',{'OpenchannelInteractionId':Number(_0x293194[_0x8f21('0x43')]['ids']),'UserId':Number(_0x293194['params']['id'])});}});}})[_0x8f21('0x27')](respondWithStatusCode(_0x2525d6,null))[_0x8f21('0x1d')](handleError(_0x2525d6,null));};exports[_0x8f21('0x140')]=function(_0x48e7d4,_0x450cb2){return db[_0x8f21('0x3a')][_0x8f21('0x34')]({'where':{'id':_0x48e7d4[_0x8f21('0x54')]['id']}})['then'](handleEntityNotFound(_0x450cb2,null))[_0x8f21('0x27')](function(_0x578f06){if(_0x578f06){return _0x578f06[_0x8f21('0x140')](_0x48e7d4[_0x8f21('0x5f')]['ids'],_[_0x8f21('0x113')](_0x48e7d4[_0x8f21('0x5f')],['ids','id'])||{})['spread'](function(){for(var _0x5dc430=0x0;_0x5dc430<_0x48e7d4[_0x8f21('0x5f')][_0x8f21('0x62')][_0x8f21('0x4b')];_0x5dc430+=0x1){socket[_0x8f21('0xa8')](_0x8f21('0x141'),{'WhatsappInteractionId':Number(_0x48e7d4[_0x8f21('0x5f')][_0x8f21('0x62')][_0x5dc430]),'UserId':Number(_0x48e7d4['params']['id'])});}return _0x48e7d4[_0x8f21('0x5f')]['ids'];});}})[_0x8f21('0x27')](respondWithResult(_0x450cb2,null))[_0x8f21('0x1d')](handleError(_0x450cb2,null));};exports[_0x8f21('0x142')]=function(_0x167e2b,_0x13eddc){return db['User']['find']({'where':{'id':_0x167e2b['params']['id']}})[_0x8f21('0x27')](handleEntityNotFound(_0x13eddc,null))[_0x8f21('0x27')](function(_0x576683){if(_0x576683){return _0x576683['removeWhatsappInteractions'](_0x167e2b[_0x8f21('0x43')][_0x8f21('0x62')]);}})[_0x8f21('0x27')](respondWithStatusCode(_0x13eddc,null))[_0x8f21('0x1d')](handleError(_0x13eddc,null));};exports[_0x8f21('0x143')]=function(_0x4ef0c4,_0x5d6546){var _0x37d8de={};var _0x661de4={};var _0xdff8cc;var _0x57bb08;return db[_0x8f21('0x3a')][_0x8f21('0xca')]({'where':{'id':_0x4ef0c4['params']['id']}})['then'](handleEntityNotFound(_0x5d6546,null))[_0x8f21('0x27')](function(_0x397849){if(_0x397849){_0xdff8cc=_0x397849;_0x661de4[_0x8f21('0x55')]=_['keys'](db[_0x8f21('0x144')][_0x8f21('0x3b')]);_0x661de4[_0x8f21('0x43')]=_[_0x8f21('0x57')](_0x4ef0c4[_0x8f21('0x43')]);_0x661de4[_0x8f21('0x58')]=_[_0x8f21('0x59')](_0x661de4[_0x8f21('0x55')],_0x661de4[_0x8f21('0x43')]);_0x37d8de[_0x8f21('0x48')]=_[_0x8f21('0x59')](_0x661de4['model'],qs['fields'](_0x4ef0c4[_0x8f21('0x43')][_0x8f21('0x5a')]));_0x37d8de['attributes']=_0x37d8de[_0x8f21('0x48')][_0x8f21('0x4b')]?_0x37d8de[_0x8f21('0x48')]:_0x661de4[_0x8f21('0x55')];_0x37d8de[_0x8f21('0xcb')]=qs[_0x8f21('0xcc')](_0x4ef0c4[_0x8f21('0x43')]['sort']);_0x37d8de[_0x8f21('0x42')]=qs[_0x8f21('0x58')](_[_0x8f21('0xd5')](_0x4ef0c4[_0x8f21('0x43')],_0x661de4[_0x8f21('0x58')]));if(_0x4ef0c4[_0x8f21('0x43')][_0x8f21('0x30')]){_0x37d8de[_0x8f21('0x42')]=_[_0x8f21('0x5c')](_0x37d8de[_0x8f21('0x42')],{'$or':_[_0x8f21('0x3c')](_0x37d8de[_0x8f21('0x48')],function(_0x4e9c0d){var _0x12f36e={};_0x12f36e[_0x4e9c0d]={'$like':'%'+_0x4ef0c4[_0x8f21('0x43')][_0x8f21('0x30')]+'%'};return _0x12f36e;})});}_0x37d8de=_[_0x8f21('0x5c')]({},_0x37d8de,_0x4ef0c4[_0x8f21('0xd6')]);return _0xdff8cc['getVoicePrefixes'](_0x37d8de);}})[_0x8f21('0x27')](function(_0x1bccc3){if(_0x1bccc3){_0x57bb08=_0x1bccc3['length'];if(!_0x4ef0c4[_0x8f21('0x43')]['hasOwnProperty'](_0x8f21('0xd3'))){_0x37d8de[_0x8f21('0x22')]=qs[_0x8f21('0x22')](_0x4ef0c4[_0x8f21('0x43')][_0x8f21('0x22')]);_0x37d8de[_0x8f21('0x21')]=qs[_0x8f21('0x21')](_0x4ef0c4[_0x8f21('0x43')][_0x8f21('0x21')]);}return _0xdff8cc[_0x8f21('0x143')](_0x37d8de);}})['then'](function(_0x330599){if(_0x330599){return _0x330599?{'count':_0x57bb08,'rows':_0x330599}:null;}})[_0x8f21('0x27')](respondWithResult(_0x5d6546,null))['catch'](handleError(_0x5d6546,null));};exports[_0x8f21('0x145')]=function(_0x2cf9bb,_0x37da4c){var _0x9ac037={};var _0x1b714c={};var _0x23558d;var _0x2c5916;return db['User'][_0x8f21('0xca')]({'where':{'id':_0x2cf9bb[_0x8f21('0x54')]['id']}})[_0x8f21('0x27')](handleEntityNotFound(_0x37da4c,null))['then'](function(_0x171347){if(_0x171347){_0x23558d=_0x171347;_0x1b714c['model']=_[_0x8f21('0x57')](db[_0x8f21('0x146')]['rawAttributes']);_0x1b714c['query']=_[_0x8f21('0x57')](_0x2cf9bb[_0x8f21('0x43')]);_0x1b714c[_0x8f21('0x58')]=_[_0x8f21('0x59')](_0x1b714c[_0x8f21('0x55')],_0x1b714c[_0x8f21('0x43')]);_0x9ac037['attributes']=_['intersection'](_0x1b714c[_0x8f21('0x55')],qs[_0x8f21('0x5a')](_0x2cf9bb['query'][_0x8f21('0x5a')]));_0x9ac037['attributes']=_0x9ac037['attributes'][_0x8f21('0x4b')]?_0x9ac037[_0x8f21('0x48')]:_0x1b714c[_0x8f21('0x55')];_0x9ac037[_0x8f21('0xcb')]=qs[_0x8f21('0xcc')](_0x2cf9bb[_0x8f21('0x43')][_0x8f21('0xcc')]);_0x9ac037['where']=qs[_0x8f21('0x58')](_[_0x8f21('0xd5')](_0x2cf9bb[_0x8f21('0x43')],_0x1b714c['filters']));if(_0x2cf9bb['query'][_0x8f21('0x30')]){_0x9ac037['where']=_[_0x8f21('0x5c')](_0x9ac037[_0x8f21('0x42')],{'$or':_[_0x8f21('0x3c')](_0x9ac037[_0x8f21('0x48')],function(_0x59a883){var _0x581554={};_0x581554[_0x59a883]={'$like':'%'+_0x2cf9bb[_0x8f21('0x43')]['filter']+'%'};return _0x581554;})});}_0x9ac037=_[_0x8f21('0x5c')]({},_0x9ac037,_0x2cf9bb[_0x8f21('0xd6')]);return _0x23558d[_0x8f21('0x145')](_0x9ac037);}})[_0x8f21('0x27')](function(_0x51a80c){if(_0x51a80c){_0x2c5916=_0x51a80c['length'];if(!_0x2cf9bb[_0x8f21('0x43')][_0x8f21('0xcd')]('nolimit')){_0x9ac037[_0x8f21('0x22')]=qs[_0x8f21('0x22')](_0x2cf9bb[_0x8f21('0x43')]['limit']);_0x9ac037[_0x8f21('0x21')]=qs['offset'](_0x2cf9bb[_0x8f21('0x43')]['offset']);}return _0x23558d[_0x8f21('0x145')](_0x9ac037);}})[_0x8f21('0x27')](function(_0x20f387){if(_0x20f387){return _0x20f387?{'count':_0x2c5916,'rows':_0x20f387}:null;}})['then'](respondWithResult(_0x37da4c,null))[_0x8f21('0x1d')](handleError(_0x37da4c,null));};exports[_0x8f21('0x147')]=function(_0xe63c94,_0x341d84){return db[_0x8f21('0x3a')][_0x8f21('0x34')]({'where':{'id':_0xe63c94[_0x8f21('0x54')]['id']}})[_0x8f21('0x27')](handleEntityNotFound(_0x341d84,null))[_0x8f21('0x27')](function(_0x340904){if(_0x340904){return _0x340904[_0x8f21('0x147')](_0xe63c94['body'][_0x8f21('0x62')],_[_0x8f21('0x113')](_0xe63c94[_0x8f21('0x5f')],[_0x8f21('0x62'),'id'])||{});}})[_0x8f21('0x27')](respondWithResult(_0x341d84,null))[_0x8f21('0x1d')](handleError(_0x341d84,null));};exports[_0x8f21('0x148')]=function(_0x52e338,_0x39e058){return db[_0x8f21('0x3a')]['find']({'where':{'id':_0x52e338['params']['id']}})[_0x8f21('0x27')](handleEntityNotFound(_0x39e058,null))[_0x8f21('0x27')](function(_0x388937){if(_0x388937){return _0x388937[_0x8f21('0x148')](_0x52e338[_0x8f21('0x43')][_0x8f21('0x62')]);}})['then'](respondWithStatusCode(_0x39e058,null))[_0x8f21('0x1d')](handleError(_0x39e058,null));};exports[_0x8f21('0x149')]=function(_0x845679,_0x4f7ba0){var _0x32ce46={};var _0x38a8e5={};var _0x237231;var _0x57e645;return db[_0x8f21('0x3a')]['findOne']({'where':{'id':_0x845679['params']['id']}})[_0x8f21('0x27')](handleEntityNotFound(_0x4f7ba0,null))[_0x8f21('0x27')](function(_0x2a8cc1){if(_0x2a8cc1){_0x237231=_0x2a8cc1;_0x38a8e5[_0x8f21('0x55')]=_[_0x8f21('0x57')](db[_0x8f21('0x14a')]['rawAttributes']);_0x38a8e5[_0x8f21('0x43')]=_[_0x8f21('0x57')](_0x845679[_0x8f21('0x43')]);_0x38a8e5['filters']=_[_0x8f21('0x59')](_0x38a8e5[_0x8f21('0x55')],_0x38a8e5['query']);_0x32ce46[_0x8f21('0x48')]=_[_0x8f21('0x59')](_0x38a8e5[_0x8f21('0x55')],qs[_0x8f21('0x5a')](_0x845679[_0x8f21('0x43')][_0x8f21('0x5a')]));_0x32ce46['attributes']=_0x32ce46[_0x8f21('0x48')][_0x8f21('0x4b')]?_0x32ce46[_0x8f21('0x48')]:_0x38a8e5[_0x8f21('0x55')];_0x32ce46['order']=qs['sort'](_0x845679[_0x8f21('0x43')][_0x8f21('0xcc')]);_0x32ce46[_0x8f21('0x42')]=qs['filters'](_[_0x8f21('0xd5')](_0x845679[_0x8f21('0x43')],_0x38a8e5[_0x8f21('0x58')]));if(_0x845679[_0x8f21('0x43')]['filter']){_0x32ce46[_0x8f21('0x42')]=_[_0x8f21('0x5c')](_0x32ce46['where'],{'$or':_[_0x8f21('0x3c')](_0x32ce46[_0x8f21('0x48')],function(_0x13a5ef){var _0x5af57f={};_0x5af57f[_0x13a5ef]={'$like':'%'+_0x845679[_0x8f21('0x43')][_0x8f21('0x30')]+'%'};return _0x5af57f;})});}_0x32ce46=_[_0x8f21('0x5c')]({},_0x32ce46,_0x845679[_0x8f21('0xd6')]);return _0x237231[_0x8f21('0x149')](_0x32ce46);}})[_0x8f21('0x27')](function(_0x87a01a){if(_0x87a01a){_0x57e645=_0x87a01a[_0x8f21('0x4b')];if(!_0x845679[_0x8f21('0x43')][_0x8f21('0xcd')](_0x8f21('0xd3'))){_0x32ce46[_0x8f21('0x22')]=qs['limit'](_0x845679[_0x8f21('0x43')]['limit']);_0x32ce46['offset']=qs['offset'](_0x845679[_0x8f21('0x43')][_0x8f21('0x21')]);}return _0x237231[_0x8f21('0x149')](_0x32ce46);}})['then'](function(_0x5cc1de){if(_0x5cc1de){return _0x5cc1de?{'count':_0x57e645,'rows':_0x5cc1de}:null;}})[_0x8f21('0x27')](respondWithResult(_0x4f7ba0,null))[_0x8f21('0x1d')](handleError(_0x4f7ba0,null));};exports[_0x8f21('0x14b')]=function(_0x3a10d3,_0x449319){return db[_0x8f21('0x3a')][_0x8f21('0x34')]({'where':{'id':_0x3a10d3['params']['id']}})[_0x8f21('0x27')](handleEntityNotFound(_0x449319,null))['then'](function(_0x367408){if(_0x367408){return _0x367408['addMailAccounts'](_0x3a10d3[_0x8f21('0x5f')][_0x8f21('0x62')],_[_0x8f21('0x113')](_0x3a10d3[_0x8f21('0x5f')],[_0x8f21('0x62'),'id'])||{});}})[_0x8f21('0x27')](respondWithResult(_0x449319,null))[_0x8f21('0x1d')](handleError(_0x449319,null));};exports['removeMailAccounts']=function(_0x421801,_0x37cd93){return db[_0x8f21('0x3a')][_0x8f21('0x34')]({'where':{'id':_0x421801['params']['id']}})[_0x8f21('0x27')](handleEntityNotFound(_0x37cd93,null))['then'](function(_0xf510fa){if(_0xf510fa){return _0xf510fa[_0x8f21('0x14c')](_0x421801['query']['ids']);}})[_0x8f21('0x27')](respondWithStatusCode(_0x37cd93,null))[_0x8f21('0x1d')](handleError(_0x37cd93,null));};exports[_0x8f21('0x14d')]=function(_0x55ed8c,_0x4b9159){var _0x450ae1={};var _0xe639f2={};var _0x277db1;var _0x58a632;return db[_0x8f21('0x3a')]['findOne']({'where':{'id':_0x55ed8c[_0x8f21('0x54')]['id']}})[_0x8f21('0x27')](handleEntityNotFound(_0x4b9159,null))[_0x8f21('0x27')](function(_0x5e2e22){if(_0x5e2e22){_0x277db1=_0x5e2e22;_0xe639f2[_0x8f21('0x55')]=_['keys'](db[_0x8f21('0x14e')][_0x8f21('0x3b')]);_0xe639f2[_0x8f21('0x43')]=_[_0x8f21('0x57')](_0x55ed8c[_0x8f21('0x43')]);_0xe639f2['filters']=_[_0x8f21('0x59')](_0xe639f2['model'],_0xe639f2['query']);_0x450ae1[_0x8f21('0x48')]=_['intersection'](_0xe639f2[_0x8f21('0x55')],qs['fields'](_0x55ed8c[_0x8f21('0x43')]['fields']));_0x450ae1[_0x8f21('0x48')]=_0x450ae1['attributes'][_0x8f21('0x4b')]?_0x450ae1[_0x8f21('0x48')]:_0xe639f2[_0x8f21('0x55')];_0x450ae1[_0x8f21('0xcb')]=qs[_0x8f21('0xcc')](_0x55ed8c[_0x8f21('0x43')][_0x8f21('0xcc')]);_0x450ae1['where']=qs[_0x8f21('0x58')](_[_0x8f21('0xd5')](_0x55ed8c[_0x8f21('0x43')],_0xe639f2[_0x8f21('0x58')]));if(_0x55ed8c[_0x8f21('0x43')][_0x8f21('0x30')]){_0x450ae1[_0x8f21('0x42')]=_[_0x8f21('0x5c')](_0x450ae1['where'],{'$or':_[_0x8f21('0x3c')](_0x450ae1[_0x8f21('0x48')],function(_0x11b9ac){var _0x4fd2ed={};_0x4fd2ed[_0x11b9ac]={'$like':'%'+_0x55ed8c[_0x8f21('0x43')][_0x8f21('0x30')]+'%'};return _0x4fd2ed;})});}_0x450ae1=_[_0x8f21('0x5c')]({},_0x450ae1,_0x55ed8c['options']);return _0x277db1[_0x8f21('0x14d')](_0x450ae1);}})[_0x8f21('0x27')](function(_0x4f0f7f){if(_0x4f0f7f){_0x58a632=_0x4f0f7f[_0x8f21('0x4b')];if(!_0x55ed8c['query'][_0x8f21('0xcd')](_0x8f21('0xd3'))){_0x450ae1[_0x8f21('0x22')]=qs[_0x8f21('0x22')](_0x55ed8c[_0x8f21('0x43')][_0x8f21('0x22')]);_0x450ae1[_0x8f21('0x21')]=qs['offset'](_0x55ed8c[_0x8f21('0x43')][_0x8f21('0x21')]);}return _0x277db1[_0x8f21('0x14d')](_0x450ae1);}})[_0x8f21('0x27')](function(_0x1af130){if(_0x1af130){return _0x1af130?{'count':_0x58a632,'rows':_0x1af130}:null;}})[_0x8f21('0x27')](respondWithResult(_0x4b9159,null))[_0x8f21('0x1d')](handleError(_0x4b9159,null));};exports[_0x8f21('0x14f')]=function(_0x409d3e,_0x665f5c){return db[_0x8f21('0x3a')]['find']({'where':{'id':_0x409d3e[_0x8f21('0x54')]['id']}})[_0x8f21('0x27')](handleEntityNotFound(_0x665f5c,null))[_0x8f21('0x27')](function(_0xd53ca7){if(_0xd53ca7){return _0xd53ca7['addOpenchannelAccounts'](_0x409d3e[_0x8f21('0x5f')][_0x8f21('0x62')],_[_0x8f21('0x113')](_0x409d3e[_0x8f21('0x5f')],[_0x8f21('0x62'),'id'])||{});}})[_0x8f21('0x27')](respondWithResult(_0x665f5c,null))[_0x8f21('0x1d')](handleError(_0x665f5c,null));};exports[_0x8f21('0x150')]=function(_0x440f2e,_0x2babec){return db[_0x8f21('0x3a')][_0x8f21('0x34')]({'where':{'id':_0x440f2e['params']['id']}})[_0x8f21('0x27')](handleEntityNotFound(_0x2babec,null))[_0x8f21('0x27')](function(_0x2967e1){if(_0x2967e1){return _0x2967e1['removeOpenchannelAccounts'](_0x440f2e[_0x8f21('0x43')]['ids']);}})['then'](respondWithStatusCode(_0x2babec,null))[_0x8f21('0x1d')](handleError(_0x2babec,null));};exports['getSmsAccounts']=function(_0x46a24f,_0x47a505){var _0x263ac3={};var _0x3494cb={};var _0x6eb125;var _0x295075;return db[_0x8f21('0x3a')][_0x8f21('0xca')]({'where':{'id':_0x46a24f['params']['id']}})[_0x8f21('0x27')](handleEntityNotFound(_0x47a505,null))[_0x8f21('0x27')](function(_0x51140f){if(_0x51140f){_0x6eb125=_0x51140f;_0x3494cb['model']=_['keys'](db['SmsAccount'][_0x8f21('0x3b')]);_0x3494cb['query']=_[_0x8f21('0x57')](_0x46a24f[_0x8f21('0x43')]);_0x3494cb[_0x8f21('0x58')]=_[_0x8f21('0x59')](_0x3494cb[_0x8f21('0x55')],_0x3494cb[_0x8f21('0x43')]);_0x263ac3[_0x8f21('0x48')]=_[_0x8f21('0x59')](_0x3494cb[_0x8f21('0x55')],qs[_0x8f21('0x5a')](_0x46a24f[_0x8f21('0x43')][_0x8f21('0x5a')]));_0x263ac3[_0x8f21('0x48')]=_0x263ac3[_0x8f21('0x48')][_0x8f21('0x4b')]?_0x263ac3['attributes']:_0x3494cb['model'];_0x263ac3['order']=qs['sort'](_0x46a24f[_0x8f21('0x43')][_0x8f21('0xcc')]);_0x263ac3[_0x8f21('0x42')]=qs[_0x8f21('0x58')](_['pick'](_0x46a24f['query'],_0x3494cb[_0x8f21('0x58')]));if(_0x46a24f[_0x8f21('0x43')][_0x8f21('0x30')]){_0x263ac3[_0x8f21('0x42')]=_['merge'](_0x263ac3[_0x8f21('0x42')],{'$or':_[_0x8f21('0x3c')](_0x263ac3[_0x8f21('0x48')],function(_0x4613cd){var _0x5f2f83={};_0x5f2f83[_0x4613cd]={'$like':'%'+_0x46a24f[_0x8f21('0x43')][_0x8f21('0x30')]+'%'};return _0x5f2f83;})});}_0x263ac3=_[_0x8f21('0x5c')]({},_0x263ac3,_0x46a24f['options']);return _0x6eb125['getSmsAccounts'](_0x263ac3);}})[_0x8f21('0x27')](function(_0x1ce3fe){if(_0x1ce3fe){_0x295075=_0x1ce3fe[_0x8f21('0x4b')];if(!_0x46a24f[_0x8f21('0x43')][_0x8f21('0xcd')]('nolimit')){_0x263ac3['limit']=qs[_0x8f21('0x22')](_0x46a24f[_0x8f21('0x43')]['limit']);_0x263ac3[_0x8f21('0x21')]=qs['offset'](_0x46a24f[_0x8f21('0x43')][_0x8f21('0x21')]);}return _0x6eb125['getSmsAccounts'](_0x263ac3);}})[_0x8f21('0x27')](function(_0x5dc57c){if(_0x5dc57c){return _0x5dc57c?{'count':_0x295075,'rows':_0x5dc57c}:null;}})[_0x8f21('0x27')](respondWithResult(_0x47a505,null))['catch'](handleError(_0x47a505,null));};exports[_0x8f21('0x151')]=function(_0xd05c8e,_0x238ba7){return db[_0x8f21('0x3a')][_0x8f21('0x34')]({'where':{'id':_0xd05c8e[_0x8f21('0x54')]['id']}})['then'](handleEntityNotFound(_0x238ba7,null))[_0x8f21('0x27')](function(_0x557f80){if(_0x557f80){return _0x557f80['addSmsAccounts'](_0xd05c8e['body']['ids'],_[_0x8f21('0x113')](_0xd05c8e[_0x8f21('0x5f')],['ids','id'])||{});}})[_0x8f21('0x27')](respondWithResult(_0x238ba7,null))['catch'](handleError(_0x238ba7,null));};exports['removeSmsAccounts']=function(_0x23a4eb,_0x597a4a){return db['User']['find']({'where':{'id':_0x23a4eb[_0x8f21('0x54')]['id']}})[_0x8f21('0x27')](handleEntityNotFound(_0x597a4a,null))[_0x8f21('0x27')](function(_0x543164){if(_0x543164){return _0x543164[_0x8f21('0x152')](_0x23a4eb[_0x8f21('0x43')][_0x8f21('0x62')]);}})[_0x8f21('0x27')](respondWithStatusCode(_0x597a4a,null))[_0x8f21('0x1d')](handleError(_0x597a4a,null));};exports[_0x8f21('0x153')]=function(_0x16c055,_0x4fcd3d){var _0x175aa7={};var _0x781ee6={};var _0x5a7655;var _0xdd908f;return db[_0x8f21('0x3a')][_0x8f21('0xca')]({'where':{'id':_0x16c055['params']['id']}})['then'](handleEntityNotFound(_0x4fcd3d,null))['then'](function(_0x2e6fa7){if(_0x2e6fa7){_0x5a7655=_0x2e6fa7;_0x781ee6[_0x8f21('0x55')]=_[_0x8f21('0x57')](db[_0x8f21('0x154')][_0x8f21('0x3b')]);_0x781ee6['query']=_[_0x8f21('0x57')](_0x16c055[_0x8f21('0x43')]);_0x781ee6[_0x8f21('0x58')]=_[_0x8f21('0x59')](_0x781ee6['model'],_0x781ee6[_0x8f21('0x43')]);_0x175aa7[_0x8f21('0x48')]=_['intersection'](_0x781ee6[_0x8f21('0x55')],qs[_0x8f21('0x5a')](_0x16c055[_0x8f21('0x43')][_0x8f21('0x5a')]));_0x175aa7[_0x8f21('0x48')]=_0x175aa7[_0x8f21('0x48')]['length']?_0x175aa7[_0x8f21('0x48')]:_0x781ee6['model'];_0x175aa7[_0x8f21('0xcb')]=qs[_0x8f21('0xcc')](_0x16c055[_0x8f21('0x43')][_0x8f21('0xcc')]);_0x175aa7[_0x8f21('0x42')]=qs[_0x8f21('0x58')](_[_0x8f21('0xd5')](_0x16c055['query'],_0x781ee6[_0x8f21('0x58')]));if(_0x16c055[_0x8f21('0x43')][_0x8f21('0x30')]){_0x175aa7[_0x8f21('0x42')]=_['merge'](_0x175aa7[_0x8f21('0x42')],{'$or':_[_0x8f21('0x3c')](_0x175aa7['attributes'],function(_0x4ef5a7){var _0x51d43e={};_0x51d43e[_0x4ef5a7]={'$like':'%'+_0x16c055['query']['filter']+'%'};return _0x51d43e;})});}_0x175aa7=_['merge']({},_0x175aa7,_0x16c055[_0x8f21('0xd6')]);return _0x5a7655['getChatWebsites'](_0x175aa7);}})[_0x8f21('0x27')](function(_0x2a061b){if(_0x2a061b){_0xdd908f=_0x2a061b[_0x8f21('0x4b')];if(!_0x16c055['query']['hasOwnProperty'](_0x8f21('0xd3'))){_0x175aa7[_0x8f21('0x22')]=qs[_0x8f21('0x22')](_0x16c055[_0x8f21('0x43')][_0x8f21('0x22')]);_0x175aa7[_0x8f21('0x21')]=qs[_0x8f21('0x21')](_0x16c055[_0x8f21('0x43')][_0x8f21('0x21')]);}return _0x5a7655[_0x8f21('0x153')](_0x175aa7);}})['then'](function(_0x1b0e4b){if(_0x1b0e4b){return _0x1b0e4b?{'count':_0xdd908f,'rows':_0x1b0e4b}:null;}})[_0x8f21('0x27')](respondWithResult(_0x4fcd3d,null))[_0x8f21('0x1d')](handleError(_0x4fcd3d,null));};exports[_0x8f21('0x155')]=function(_0x6381bf,_0x434f70){return db[_0x8f21('0x3a')][_0x8f21('0x34')]({'where':{'id':_0x6381bf[_0x8f21('0x54')]['id']}})[_0x8f21('0x27')](handleEntityNotFound(_0x434f70,null))['then'](function(_0x31aba5){if(_0x31aba5){return _0x31aba5['addChatWebsites'](_0x6381bf['body'][_0x8f21('0x62')],_[_0x8f21('0x113')](_0x6381bf[_0x8f21('0x5f')],[_0x8f21('0x62'),'id'])||{});}})[_0x8f21('0x27')](respondWithResult(_0x434f70,null))[_0x8f21('0x1d')](handleError(_0x434f70,null));};exports['removeChatWebsites']=function(_0x45bb9e,_0x2f45ad){return db[_0x8f21('0x3a')][_0x8f21('0x34')]({'where':{'id':_0x45bb9e[_0x8f21('0x54')]['id']}})[_0x8f21('0x27')](handleEntityNotFound(_0x2f45ad,null))['then'](function(_0x15fe99){if(_0x15fe99){return _0x15fe99['removeChatWebsites'](_0x45bb9e[_0x8f21('0x43')]['ids']);}})['then'](respondWithStatusCode(_0x2f45ad,null))[_0x8f21('0x1d')](handleError(_0x2f45ad,null));};exports[_0x8f21('0x156')]=function(_0x18aa01,_0x5a9c6d){var _0x573a6e={};var _0x2c04fd={};var _0x1b037e;var _0x53e013;return db[_0x8f21('0x3a')][_0x8f21('0xca')]({'where':{'id':_0x18aa01[_0x8f21('0x54')]['id']}})[_0x8f21('0x27')](handleEntityNotFound(_0x5a9c6d,null))[_0x8f21('0x27')](function(_0x16688b){if(_0x16688b){_0x1b037e=_0x16688b;_0x2c04fd[_0x8f21('0x55')]=_[_0x8f21('0x57')](db['WhatsappAccount'][_0x8f21('0x3b')]);_0x2c04fd[_0x8f21('0x43')]=_[_0x8f21('0x57')](_0x18aa01[_0x8f21('0x43')]);_0x2c04fd[_0x8f21('0x58')]=_[_0x8f21('0x59')](_0x2c04fd[_0x8f21('0x55')],_0x2c04fd[_0x8f21('0x43')]);_0x573a6e[_0x8f21('0x48')]=_[_0x8f21('0x59')](_0x2c04fd[_0x8f21('0x55')],qs[_0x8f21('0x5a')](_0x18aa01[_0x8f21('0x43')]['fields']));_0x573a6e[_0x8f21('0x48')]=_0x573a6e['attributes'][_0x8f21('0x4b')]?_0x573a6e['attributes']:_0x2c04fd['model'];_0x573a6e[_0x8f21('0xcb')]=qs[_0x8f21('0xcc')](_0x18aa01[_0x8f21('0x43')][_0x8f21('0xcc')]);_0x573a6e[_0x8f21('0x42')]=qs[_0x8f21('0x58')](_['pick'](_0x18aa01[_0x8f21('0x43')],_0x2c04fd[_0x8f21('0x58')]));if(_0x18aa01[_0x8f21('0x43')]['filter']){_0x573a6e[_0x8f21('0x42')]=_['merge'](_0x573a6e[_0x8f21('0x42')],{'$or':_[_0x8f21('0x3c')](_0x573a6e['attributes'],function(_0x94e3f7){var _0x4723b8={};_0x4723b8[_0x94e3f7]={'$like':'%'+_0x18aa01['query'][_0x8f21('0x30')]+'%'};return _0x4723b8;})});}_0x573a6e=_[_0x8f21('0x5c')]({},_0x573a6e,_0x18aa01['options']);return _0x1b037e['getWhatsappAccounts'](_0x573a6e);}})[_0x8f21('0x27')](function(_0x2ce037){if(_0x2ce037){_0x53e013=_0x2ce037[_0x8f21('0x4b')];if(!_0x18aa01[_0x8f21('0x43')]['hasOwnProperty'](_0x8f21('0xd3'))){_0x573a6e[_0x8f21('0x22')]=qs[_0x8f21('0x22')](_0x18aa01[_0x8f21('0x43')][_0x8f21('0x22')]);_0x573a6e[_0x8f21('0x21')]=qs[_0x8f21('0x21')](_0x18aa01[_0x8f21('0x43')][_0x8f21('0x21')]);}return _0x1b037e[_0x8f21('0x156')](_0x573a6e);}})[_0x8f21('0x27')](function(_0x4fd111){if(_0x4fd111){return _0x4fd111?{'count':_0x53e013,'rows':_0x4fd111}:null;}})[_0x8f21('0x27')](respondWithResult(_0x5a9c6d,null))['catch'](handleError(_0x5a9c6d,null));};exports[_0x8f21('0x157')]=function(_0xa5e1f6,_0x5515d3){return db[_0x8f21('0x3a')][_0x8f21('0x34')]({'where':{'id':_0xa5e1f6['params']['id']}})[_0x8f21('0x27')](handleEntityNotFound(_0x5515d3,null))[_0x8f21('0x27')](function(_0x934a12){if(_0x934a12){return _0x934a12['addWhatsappAccounts'](_0xa5e1f6[_0x8f21('0x5f')][_0x8f21('0x62')],_[_0x8f21('0x113')](_0xa5e1f6[_0x8f21('0x5f')],['ids','id'])||{});}})[_0x8f21('0x27')](respondWithResult(_0x5515d3,null))[_0x8f21('0x1d')](handleError(_0x5515d3,null));};exports[_0x8f21('0x158')]=function(_0x226a51,_0x4fc7a3){return db[_0x8f21('0x3a')][_0x8f21('0x34')]({'where':{'id':_0x226a51['params']['id']}})[_0x8f21('0x27')](handleEntityNotFound(_0x4fc7a3,null))[_0x8f21('0x27')](function(_0x11cfb9){if(_0x11cfb9){return _0x11cfb9[_0x8f21('0x158')](_0x226a51[_0x8f21('0x43')][_0x8f21('0x62')]);}})[_0x8f21('0x27')](respondWithStatusCode(_0x4fc7a3,null))[_0x8f21('0x1d')](handleError(_0x4fc7a3,null));};exports['getSquareProjects']=function(_0x40693a,_0x21d017){var _0x278b9a={};var _0x3f26ad={};var _0x4b017b;var _0x5be78c;return db[_0x8f21('0x3a')][_0x8f21('0xca')]({'where':{'id':_0x40693a[_0x8f21('0x54')]['id']}})[_0x8f21('0x27')](handleEntityNotFound(_0x21d017,null))[_0x8f21('0x27')](function(_0x486e02){if(_0x486e02){_0x4b017b=_0x486e02;_0x3f26ad['model']=_[_0x8f21('0x57')](db[_0x8f21('0x159')][_0x8f21('0x3b')]);_0x3f26ad[_0x8f21('0x43')]=_['keys'](_0x40693a[_0x8f21('0x43')]);_0x3f26ad[_0x8f21('0x58')]=_['intersection'](_0x3f26ad['model'],_0x3f26ad[_0x8f21('0x43')]);_0x278b9a['attributes']=_[_0x8f21('0x59')](_0x3f26ad[_0x8f21('0x55')],qs[_0x8f21('0x5a')](_0x40693a[_0x8f21('0x43')][_0x8f21('0x5a')]));_0x278b9a[_0x8f21('0x48')]=_0x278b9a[_0x8f21('0x48')][_0x8f21('0x4b')]?_0x278b9a[_0x8f21('0x48')]:_0x3f26ad['model'];_0x278b9a['order']=qs[_0x8f21('0xcc')](_0x40693a[_0x8f21('0x43')]['sort']);_0x278b9a[_0x8f21('0x42')]=qs[_0x8f21('0x58')](_['pick'](_0x40693a[_0x8f21('0x43')],_0x3f26ad[_0x8f21('0x58')]));if(_0x40693a[_0x8f21('0x43')]['filter']){_0x278b9a['where']=_['merge'](_0x278b9a['where'],{'$or':_[_0x8f21('0x3c')](_0x278b9a['attributes'],function(_0x47f0e1){var _0xea8391={};_0xea8391[_0x47f0e1]={'$like':'%'+_0x40693a[_0x8f21('0x43')][_0x8f21('0x30')]+'%'};return _0xea8391;})});}_0x278b9a=_['merge']({},_0x278b9a,_0x40693a[_0x8f21('0xd6')]);return _0x4b017b['getSquareProjects'](_0x278b9a);}})['then'](function(_0x378498){if(_0x378498){_0x5be78c=_0x378498[_0x8f21('0x4b')];if(!_0x40693a[_0x8f21('0x43')][_0x8f21('0xcd')](_0x8f21('0xd3'))){_0x278b9a['limit']=qs[_0x8f21('0x22')](_0x40693a['query'][_0x8f21('0x22')]);_0x278b9a[_0x8f21('0x21')]=qs[_0x8f21('0x21')](_0x40693a[_0x8f21('0x43')]['offset']);}return _0x4b017b[_0x8f21('0x15a')](_0x278b9a);}})[_0x8f21('0x27')](function(_0x3a13cf){if(_0x3a13cf){return _0x3a13cf?{'count':_0x5be78c,'rows':_0x3a13cf}:null;}})[_0x8f21('0x27')](respondWithResult(_0x21d017,null))[_0x8f21('0x1d')](handleError(_0x21d017,null));};exports[_0x8f21('0x15b')]=function(_0x38e10f,_0x555213){return db[_0x8f21('0x3a')][_0x8f21('0x34')]({'where':{'id':_0x38e10f[_0x8f21('0x54')]['id']}})[_0x8f21('0x27')](handleEntityNotFound(_0x555213,null))[_0x8f21('0x27')](function(_0x5e4632){if(_0x5e4632){return _0x5e4632[_0x8f21('0x15b')](_0x38e10f['body'][_0x8f21('0x62')],_[_0x8f21('0x113')](_0x38e10f['body'],[_0x8f21('0x62'),'id'])||{});}})[_0x8f21('0x27')](respondWithResult(_0x555213,null))[_0x8f21('0x1d')](handleError(_0x555213,null));};exports[_0x8f21('0x15c')]=function(_0x5b2082,_0x4ff6ef){return db[_0x8f21('0x3a')][_0x8f21('0x34')]({'where':{'id':_0x5b2082[_0x8f21('0x54')]['id']}})[_0x8f21('0x27')](handleEntityNotFound(_0x4ff6ef,null))[_0x8f21('0x27')](function(_0x256bf6){if(_0x256bf6){return _0x256bf6['removeSquareProjects'](_0x5b2082[_0x8f21('0x43')]['ids']);}})[_0x8f21('0x27')](respondWithStatusCode(_0x4ff6ef,null))['catch'](handleError(_0x4ff6ef,null));};exports[_0x8f21('0x15d')]=function(_0xf2157f,_0x1202c4){var _0x1d2771={},_0x3df17b={},_0x2d5124={'count':0x0,'rows':[]};var _0x40cc38=db[_0x8f21('0x15e')][_0x8f21('0x3b')];_0x3df17b[_0x8f21('0x55')]=_[_0x8f21('0x57')](_0x40cc38);_0x3df17b[_0x8f21('0x43')]=_[_0x8f21('0x57')](_0xf2157f[_0x8f21('0x43')]);_0x3df17b['filters']=_[_0x8f21('0x59')](_0x3df17b[_0x8f21('0x55')],_0x3df17b[_0x8f21('0x43')]);_0x3df17b['filters']=_[_0x8f21('0xc8')](_0x3df17b[_0x8f21('0x58')],['$and','$or',_0x8f21('0x15f'),_0x8f21('0x160'),_0x8f21('0x161'),_0x8f21('0x162'),'$ne','$eq','$not','$between','$notBetween','$in',_0x8f21('0x163'),'$like',_0x8f21('0x164'),_0x8f21('0x165'),'$notILike',_0x8f21('0x166'),'$overlap',_0x8f21('0x167'),_0x8f21('0x168'),'$any']);_0x1d2771[_0x8f21('0x48')]=_['intersection'](_0x3df17b[_0x8f21('0x55')],qs[_0x8f21('0x5a')](_0xf2157f[_0x8f21('0x43')][_0x8f21('0x5a')]));_0x1d2771[_0x8f21('0x48')]=_0x1d2771[_0x8f21('0x48')][_0x8f21('0x4b')]?_0x1d2771['attributes']:_0x3df17b[_0x8f21('0x55')];if(!_0xf2157f[_0x8f21('0x43')][_0x8f21('0xcd')](_0x8f21('0xd3'))){_0x1d2771['limit']=qs[_0x8f21('0x22')](_0xf2157f[_0x8f21('0x43')]['limit']);_0x1d2771['offset']=qs[_0x8f21('0x21')](_0xf2157f['query'][_0x8f21('0x21')]);}_0x1d2771[_0x8f21('0xcb')]=qs[_0x8f21('0xcc')](_0xf2157f[_0x8f21('0x43')]['sort']);_0x1d2771['where']=qs[_0x8f21('0x58')](_[_0x8f21('0xd5')](_0xf2157f[_0x8f21('0x43')],_0x3df17b[_0x8f21('0x58')]));if(_0xf2157f[_0x8f21('0x43')][_0x8f21('0x30')]){_0x1d2771['where']=_[_0x8f21('0x5c')](_0x1d2771[_0x8f21('0x42')],{'$or':_[_0x8f21('0x3c')](_0x1d2771[_0x8f21('0x48')],function(_0x54cc27){var _0x37e0f9={};_0x37e0f9[_0x54cc27]={'$like':'%'+_0xf2157f[_0x8f21('0x43')][_0x8f21('0x30')]+'%'};return _0x37e0f9;})});}_0x1d2771[_0x8f21('0x42')]={'$and':[_0x1d2771[_0x8f21('0x42')],{'$or':[{'UserId':_0xf2157f[_0x8f21('0x54')]['id']},{'OwnerId':_0xf2157f[_0x8f21('0x54')]['id']}]}]};_0x1d2771=_[_0x8f21('0x5c')]({},_0x1d2771,_0xf2157f[_0x8f21('0xd6')]);var _0x7fa91c={'where':_0x1d2771[_0x8f21('0x42')]};return db['CmHopper'][_0x8f21('0x24')](_0x7fa91c)[_0x8f21('0x27')](function(_0x45f1b4){_0x2d5124[_0x8f21('0x24')]=_0x45f1b4;if(_0xf2157f[_0x8f21('0x43')][_0x8f21('0x44')]){_0x1d2771[_0x8f21('0x45')]=[{'attributes':['id','firstName',_0x8f21('0x169'),'phone'],'model':db['CmContact'],'as':'Contact'},{'attributes':['id',_0x8f21('0x37'),_0x8f21('0x16a')],'model':db[_0x8f21('0xab')],'as':_0x8f21('0xd7')}];}return db['CmHopper']['findAll'](_0x1d2771);})[_0x8f21('0x27')](function(_0x93b104){_0x2d5124[_0x8f21('0x4a')]=_0x93b104;return _0x2d5124;})[_0x8f21('0x27')](respondWithFilteredResult(_0x1202c4,_0x1d2771))[_0x8f21('0x1d')](handleError(_0x1202c4,null));};exports[_0x8f21('0x16b')]=function(_0x53faa6,_0x3764ab){if(!_[_0x8f21('0x68')](_0x53faa6[_0x8f21('0x2c')]['id'])&&(_0x53faa6[_0x8f21('0x2c')][_0x8f21('0x29')]==_0x8f21('0x2a')||_0x53faa6[_0x8f21('0x2c')]['role']=='user')){return db[_0x8f21('0x3a')][_0x8f21('0xca')]({'where':{'id':_0x53faa6[_0x8f21('0x54')]['id']},'raw':!![]})[_0x8f21('0x27')](function(_0x3c080c){return authService[_0x8f21('0x16c')](_0x3c080c);})[_0x8f21('0x27')](function(_0x2ba521){if(_0x2ba521){return _0x3764ab[_0x8f21('0x1f')](0xc8)[_0x8f21('0x25')]({'api_key':_0x2ba521[_0x8f21('0x16d')]});}else{return _0x3764ab['status'](0xcc)['json']({'message':_0x8f21('0x16e')});}})[_0x8f21('0x1d')](handleError(_0x3764ab,0x193));}else{return _0x3764ab[_0x8f21('0x1f')](0x191)[_0x8f21('0x25')]({'message':_0x8f21('0x16f')});}};exports['createApiKey']=function(_0x404922,_0x2fb13f){if(!_[_0x8f21('0x68')](_0x404922[_0x8f21('0x2c')]['id'])&&(_0x404922[_0x8f21('0x2c')]['role']==_0x8f21('0x2a')||_0x404922['user'][_0x8f21('0x29')]==_0x8f21('0x2c'))){return db[_0x8f21('0x3a')][_0x8f21('0x34')]({'where':{'id':_0x404922[_0x8f21('0x54')]['id']}})[_0x8f21('0x27')](function(_0x190d1e){return authService[_0x8f21('0x170')](_0x190d1e);})['then'](function(_0x1f2917){return db[_0x8f21('0x3a')][_0x8f21('0x26')]({'apiKeyIat':_0x1f2917[_0x8f21('0x171')],'apiKeyNonce':_0x1f2917[_0x8f21('0x172')]},{'where':{'id':_0x404922[_0x8f21('0x54')]['id']}})[_0x8f21('0x27')](function(){return _0x2fb13f[_0x8f21('0x1f')](0xc8)['json']({'api_key':_0x1f2917[_0x8f21('0x16d')]});});})[_0x8f21('0x1d')](handleError(_0x2fb13f,0x193));}else{return _0x2fb13f[_0x8f21('0x1f')](0x191)[_0x8f21('0x25')]({'message':_0x8f21('0x16f')});}};exports['removeApiKey']=function(_0x1a8fb4,_0x1e4260){if(!_[_0x8f21('0x68')](_0x1a8fb4['user']['id'])&&(_0x1a8fb4[_0x8f21('0x2c')]['role']==_0x8f21('0x2a')||_0x1a8fb4['user']['role']==_0x8f21('0x2c'))){return db['User']['find']({'where':{'id':_0x1a8fb4['params']['id']}})[_0x8f21('0x27')](handleEntityNotFound(_0x1e4260,null))['then'](function(_0x2d997e){if(_0x2d997e&&_0x2d997e[_0x8f21('0x173')]&&_0x2d997e[_0x8f21('0x174')])return _0x2d997e;else throw{'message':'API\x20key\x20not\x20available'};})[_0x8f21('0x27')](function(){return db[_0x8f21('0x3a')]['update']({'apiKeyNonce':null,'apiKeyIat':null},{'where':{'id':_0x1a8fb4[_0x8f21('0x54')]['id']}});})[_0x8f21('0x27')](respondWithStatusCode(_0x1e4260,0xc8))[_0x8f21('0x1d')](handleError(_0x1e4260,0x193));}else{return _0x1e4260[_0x8f21('0x1f')](0x191)[_0x8f21('0x25')]({'message':_0x8f21('0x16f')});}};exports[_0x8f21('0x175')]=function(_0x64188f,_0x3e22a5){var _0x1ae92f=_0x64188f[_0x8f21('0x2c')][_0x8f21('0x28')]({'plain':!![]});if(!_0x1ae92f){return _0x3e22a5[_0x8f21('0x1f')](0x191)[_0x8f21('0x38')](_0x8f21('0x176'));}else{Promise[_0x8f21('0x177')]()[_0x8f21('0x27')](function(){if(_0x64188f[_0x8f21('0x43')][_0x8f21('0x5b')]!=='true')return;return _0x64188f[_0x8f21('0x2c')][_0x8f21('0x178')]();})[_0x8f21('0x27')](function(_0x527cf0){if(!_0x527cf0)return;return _0x527cf0[_0x8f21('0x28')]({'plain':!![]});})[_0x8f21('0x27')](function(_0x1368ef){_0x1ae92f[_0x8f21('0x5b')]=_0x1368ef;return _0x3e22a5[_0x8f21('0x1f')](0xc8)[_0x8f21('0x25')](_0x1ae92f);});}};exports[_0x8f21('0x179')]=function(_0x5767a0,_0x151215){var _0x365927={'offset':0x0},_0x36b3b7={'count':0x0,'rows':[]};Promise[_0x8f21('0x177')]()[_0x8f21('0x27')](function(){if(!_0x5767a0[_0x8f21('0x43')][_0x8f21('0x30')]&&!_0x5767a0[_0x8f21('0x43')]['teams']&&!_0x5767a0[_0x8f21('0x43')][_0x8f21('0x17a')])return[];return Promise[_0x8f21('0x177')]()[_0x8f21('0x27')](function(){var _0x268704=[];if(!_[_0x8f21('0x17b')](_0x5767a0[_0x8f21('0x43')][_0x8f21('0x17c')])){_0x268704[_0x8f21('0x49')](db[_0x8f21('0x111')][_0x8f21('0x8a')]({'attributes':['id',_0x8f21('0x37')],'where':{'id':_0x5767a0[_0x8f21('0x43')][_0x8f21('0x17c')]}}));}if(!_['isEmpty'](_0x5767a0[_0x8f21('0x43')]['queues'])){_0x268704[_0x8f21('0x49')](db['VoiceQueue']['findAll']({'attributes':['id',_0x8f21('0x37')],'type':_0x8f21('0x17d'),'where':{'id':_0x5767a0['query'][_0x8f21('0x17a')]}}));}return Promise[_0x8f21('0x52')](_0x268704);})[_0x8f21('0x27')](function(_0x4df3ff){var _0x4172a4=_[_0x8f21('0x120')](_0x4df3ff)[_0x8f21('0x3c')](function(_0x215599){return _0x215599[_0x8f21('0x17e')]({'attributes':['id',_0x8f21('0x37'),_0x8f21('0x63'),_0x8f21('0x9e')],'raw':!![]});});return Promise[_0x8f21('0x52')](_0x4172a4);})['then'](function(_0x42a302){var _0x16ee09=_[_0x8f21('0x120')](_0x42a302);if(!_0x5767a0[_0x8f21('0x43')][_0x8f21('0x30')])return _0x16ee09;if(_[_0x8f21('0x17b')](_0x16ee09)){return db[_0x8f21('0x3a')]['findAll']({'attributes':['id',_0x8f21('0x37'),'internal','online'],'where':{'role':_0x8f21('0x2d'),'$or':[db['sequelize']['where'](db[_0x8f21('0x6a')]['fn'](_0x8f21('0x17f'),db[_0x8f21('0x6a')][_0x8f21('0x180')]('name')),{'$like':'%'+_0x5767a0[_0x8f21('0x43')][_0x8f21('0x30')]['toLowerCase']()+'%'}),{'internal':{'$like':'%'+_0x5767a0['query'][_0x8f21('0x30')]+'%'}}]},'raw':!![]});}else{return _(_0x16ee09)['flatten']()[_0x8f21('0x30')](function(_0x4cf463){return _0x4cf463[_0x8f21('0x37')]['toLowerCase']()[_0x8f21('0x33')](_0x5767a0[_0x8f21('0x43')][_0x8f21('0x30')][_0x8f21('0xa4')]())||_0x4cf463[_0x8f21('0x63')]['toString']()['includes'](_0x5767a0[_0x8f21('0x43')][_0x8f21('0x30')]);})[_0x8f21('0x32')]();}})[_0x8f21('0x27')](function(_0x345604){var _0x3768f8=_0x8f21('0x37');var _0x3224a2=_0x8f21('0x181');if(_0x5767a0['query']['sort']){_0x3224a2=_0x5767a0[_0x8f21('0x43')][_0x8f21('0xcc')][0x0]==='-'?_0x8f21('0x182'):'asc';_0x3768f8=_0x3224a2===_0x8f21('0x181')?_0x5767a0[_0x8f21('0x43')][_0x8f21('0xcc')]:_0x5767a0[_0x8f21('0x43')][_0x8f21('0xcc')]['substring'](0x1);}return _(_0x345604)['uniqBy']('id')['orderBy']([function(_0x57b033){return _0x3768f8===_0x8f21('0x37')?_0x57b033[_0x3768f8][_0x8f21('0xa4')]():_0x57b033[_0x3768f8];}],[_0x3224a2])[_0x8f21('0x3c')](function(_0x30b7f2){return _[_0x8f21('0xd5')](_0x30b7f2,['id','name',_0x8f21('0x63'),_0x8f21('0x9e')]);})[_0x8f21('0x32')]();})[_0x8f21('0x27')](function(_0x36eff0){return client[_0x8f21('0x183')](_0x8f21('0x8b'),_0x5767a0)[_0x8f21('0x27')](function(_0x56513c){if(_0x56513c['error'])throw new Error(_0x8f21('0x184'));var _0x2fd9e9=_0x56513c['result'];var _0x2d84d9=jayson[_0x8f21('0x11')][_0x8f21('0x12')]({'port':0x232c});return _0x2d84d9[_0x8f21('0x183')](_0x8f21('0x8b'),_0x5767a0)[_0x8f21('0x27')](function(_0x1dc06c){if(_0x1dc06c[_0x8f21('0x18')])throw new Error(_0x8f21('0x185'));var _0x158336=_0x1dc06c['result'];return _[_0x8f21('0x5c')]({},_0x158336,_0x2fd9e9);});})[_0x8f21('0x27')](function(_0x34bfea){return _[_0x8f21('0x3c')](_0x36eff0,function(_0x3ae330){var _0xdf0b75=_[_0x8f21('0x34')](_0x34bfea[_0x8f21('0x4a')],['id',_0x3ae330['id']]);if(!_0xdf0b75||!_0x3ae330[_0x8f21('0x9e')]){_0x3ae330['status']=_0x8f21('0x186');}else if(_0xdf0b75['voicePause']){_0x3ae330[_0x8f21('0x1f')]='pause';}else{_0x3ae330[_0x8f21('0x1f')]=_[_0x8f21('0x33')](['idle',_0x8f21('0x187'),_0x8f21('0x188'),_0x8f21('0x189'),null,undefined],_0xdf0b75[_0x8f21('0x18a')])?'online':_0x8f21('0x18b');}return _0x3ae330;});});});})[_0x8f21('0x27')](function(_0x1a85cc){if(!_0x5767a0[_0x8f21('0x43')][_0x8f21('0xcd')](_0x8f21('0xd3'))){_0x365927[_0x8f21('0x22')]=qs[_0x8f21('0x22')](_0x5767a0[_0x8f21('0x43')][_0x8f21('0x22')]||0xa);_0x365927[_0x8f21('0x21')]=qs[_0x8f21('0x21')](_0x5767a0[_0x8f21('0x43')][_0x8f21('0x21')]);}_0x36b3b7[_0x8f21('0x24')]=_0x1a85cc[_0x8f21('0x4b')];_0x36b3b7['rows']=_0x365927['limit']?_0x1a85cc[_0x8f21('0x18c')](_0x365927[_0x8f21('0x21')],_0x365927['offset']+_0x365927[_0x8f21('0x22')]):_0x1a85cc;return _0x36b3b7;})['then'](respondWithFilteredResult(_0x151215,_0x365927))[_0x8f21('0x1d')](handleError(_0x151215,null));};function get_open_tabs(_0x17a440,_0x38b3ff){var _0x4d6ce6=_0x17a440['charAt'](0x0)[_0x8f21('0x18d')]()+_0x17a440[_0x8f21('0x18c')](0x1);var _0x2816ee={'type':db[_0x8f21('0x91')]['QueryTypes']['SELECT'],'raw':!![]};return new BPromise(function(_0x145390,_0x3141b6){var _0x240880=squel[_0x8f21('0x18e')]()[_0x8f21('0x18f')]('ui.'+_0x4d6ce6+_0x8f21('0x190'),'id')[_0x8f21('0x18f')](_0x8f21('0x191'))[_0x8f21('0x6d')](_0x8f21('0x192')+_0x17a440+_0x8f21('0x193'),'ui')[_0x8f21('0x42')](_0x8f21('0x194'),_0x38b3ff['id']);return db[_0x8f21('0x6a')][_0x8f21('0x43')](_0x240880[_0x8f21('0x195')](),_0x2816ee)[_0x8f21('0x27')](function(_0x274c7f){_0x38b3ff[_0x4d6ce6+_0x8f21('0x196')]=_0x274c7f;_0x145390(_0x274c7f);})[_0x8f21('0x1d')](function(_0x207cac){_0x3141b6(_0x207cac);});});}
\ No newline at end of file
index 9c45384..a034f06 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc9b6=['events','../../mysqldb','User','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x47e7cb,_0x4c1b8d){var _0x2a8874=function(_0x36498f){while(--_0x36498f){_0x47e7cb['push'](_0x47e7cb['shift']());}};_0x2a8874(++_0x4c1b8d);}(_0xc9b6,0xa0));var _0x6c9b=function(_0x5c938e,_0x2422f6){_0x5c938e=_0x5c938e-0x0;var _0x3b18dc=_0xc9b6[_0x5c938e];return _0x3b18dc;};'use strict';var EventEmitter=require(_0x6c9b('0x0'));var User=require(_0x6c9b('0x1'))['db'][_0x6c9b('0x2')];var UserEvents=new EventEmitter();UserEvents[_0x6c9b('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x6c9b('0x4'),'afterDestroy':_0x6c9b('0x5')};function emitEvent(_0x309e54){return function(_0x82803b,_0x285a5d,_0x1f4420){UserEvents[_0x6c9b('0x6')](_0x309e54+':'+_0x82803b['id'],_0x82803b);UserEvents[_0x6c9b('0x6')](_0x309e54,_0x82803b);_0x1f4420(null);};}for(var e in events){if(events[_0x6c9b('0x7')](e)){var event=events[e];User[_0x6c9b('0x8')](e,emitEvent(event));}}module[_0x6c9b('0x9')]=UserEvents;
\ No newline at end of file
+var _0x10b9=['update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','User','save'];(function(_0x523410,_0xa08203){var _0x144ede=function(_0x27278c){while(--_0x27278c){_0x523410['push'](_0x523410['shift']());}};_0x144ede(++_0xa08203);}(_0x10b9,0x101));var _0x910b=function(_0x5aac05,_0x427415){_0x5aac05=_0x5aac05-0x0;var _0x3c4dc7=_0x10b9[_0x5aac05];return _0x3c4dc7;};'use strict';var EventEmitter=require(_0x910b('0x0'));var User=require(_0x910b('0x1'))['db'][_0x910b('0x2')];var UserEvents=new EventEmitter();UserEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x910b('0x3'),'afterUpdate':_0x910b('0x4'),'afterDestroy':_0x910b('0x5')};function emitEvent(_0x1ee9b5){return function(_0x127f56,_0x3cb6ba,_0x15f881){UserEvents[_0x910b('0x6')](_0x1ee9b5+':'+_0x127f56['id'],_0x127f56);UserEvents[_0x910b('0x6')](_0x1ee9b5,_0x127f56);_0x15f881(null);};}for(var e in events){if(events[_0x910b('0x7')](e)){var event=events[e];User['hook'](e,emitEvent(event));}}module[_0x910b('0x8')]=UserEvents;
\ No newline at end of file
index 917654a..4477e3b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe81b=['bulkCreate','destroy','encryptPassword','function','base64','salt','pbkdf2Sync','sha1','toString','pbkdf2','provider','makeSalt','md5secret','crypto','md5','lodash','./user.attributes','google','length','context','from-sip','format','push','merge','CDR(type)=%s','chanspy','record','${UNIQUEID}.%s,a','auth','Authenticate','password','ChanSpy','SIP/%s,%s','options','join','StopMixMonitor','wav','WAV','system','CDR(type)=internal','includes','extensionMonitor','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=%s','Dial','SIP/%s,,tTxX','Hangup','defaults','VoiceChanSpy','findAll','then','internal','name','concat','catch','User','utf8','utf8_bin','undefined','resolve','UserProfile','find','userProfileId','privacyEnabled','updateMd5Password','updatePassword','changed','userSetting','createUserSetting','error','VoiceExtension'];(function(_0xce7ef0,_0x386a15){var _0x577b06=function(_0x43b598){while(--_0x43b598){_0xce7ef0['push'](_0xce7ef0['shift']());}};_0x577b06(++_0x386a15);}(_0xe81b,0x129));var _0xbe81=function(_0x36884e,_0x48008f){_0x36884e=_0x36884e-0x0;var _0x1cc367=_0xe81b[_0x36884e];return _0x1cc367;};'use strict';var BPromise=require('bluebird');var crypto=require(_0xbe81('0x0'));var util=require('util');var md5=require(_0xbe81('0x1'));var _=require(_0xbe81('0x2'));var attributes=require(_0xbe81('0x3'));var authTypes=[_0xbe81('0x4')];var validatePresenceOf=function(_0x37b4de){return _0x37b4de&&_0x37b4de[_0xbe81('0x5')];};var getChanSpyApplications=function(_0x478383,_0x37e63f,_0x313f20){var _0x30e6bd={'context':_0x478383[_0xbe81('0x6')]||_0xbe81('0x7'),'type':'system','isApp':![],'UserId':_0x478383['id']};var _0x2fc5c9=[];for(var _0x5efaa6=0x0,_0x4690c9=0x1;_0x5efaa6<_0x313f20['length'];_0x5efaa6++,_0x4690c9=0x1){var _0x40346f={'exten':util[_0xbe81('0x8')]('%s%s',_0x313f20[_0x5efaa6]['prefix'],_0x37e63f),'ChanSpyId':_0x313f20[_0x5efaa6]['id']};_0x2fc5c9[_0xbe81('0x9')](_[_0xbe81('0xa')]({'app':'Set','appdata':util[_0xbe81('0x8')](_0xbe81('0xb'),_0xbe81('0xc')),'priority':_0x4690c9++},_0x30e6bd,_0x40346f));if(_0x313f20[_0x5efaa6][_0xbe81('0xd')]){_0x2fc5c9[_0xbe81('0x9')](_[_0xbe81('0xa')]({'app':'MixMonitor','appdata':util[_0xbe81('0x8')](_0xbe81('0xe'),_0x313f20[_0x5efaa6]['recordingFormat']),'priority':_0x4690c9++},_0x30e6bd,_0x40346f));}if(_0x313f20[_0x5efaa6][_0xbe81('0xf')]){_0x2fc5c9[_0xbe81('0x9')](_[_0xbe81('0xa')]({'app':_0xbe81('0x10'),'appdata':_0x313f20[_0x5efaa6][_0xbe81('0x11')],'priority':_0x4690c9++},_0x30e6bd,_0x40346f));}_0x2fc5c9['push'](_['merge']({'app':_0xbe81('0x12'),'appdata':util['format'](_0xbe81('0x13'),_0x478383['name'],_0x313f20[_0x5efaa6]['options']?_0x313f20[_0x5efaa6][_0xbe81('0x14')][_0xbe81('0x15')](''):''),'priority':_0x4690c9++},_0x30e6bd,_0x40346f));if(_0x313f20[_0x5efaa6][_0xbe81('0xd')]){_0x2fc5c9[_0xbe81('0x9')](_['merge']({'app':_0xbe81('0x16'),'priority':_0x4690c9++},_0x30e6bd,_0x40346f));}}return _0x2fc5c9;};var getUserApplications=function(_0x243493,_0x4354e8){var _0x46a179=[_0xbe81('0x17'),_0xbe81('0x18'),'gsm'];var _0x4ad583={'context':_0x243493[_0xbe81('0x6')]||_0xbe81('0x7'),'exten':_0x4354e8,'type':_0xbe81('0x19'),'isApp':![],'UserId':_0x243493['id']};var _0x2c3f39=[{'app':'Set','appdata':_0xbe81('0x1a')}];if(_0x243493['extensionMonitor']&&_[_0xbe81('0x1b')](_0x46a179,_0x243493[_0xbe81('0x1c')])){_0x2c3f39[_0xbe81('0x9')]({'app':'Set','appdata':_0xbe81('0x1d')});_0x2c3f39[_0xbe81('0x9')]({'app':'Set','appdata':util[_0xbe81('0x8')](_0xbe81('0x1e'),_0x243493[_0xbe81('0x1c')])});_0x2c3f39[_0xbe81('0x9')]({'app':_0xbe81('0x1f'),'appdata':util[_0xbe81('0x8')]('SIP/%s,,tTxXU(xcally-mixmonitor-context)',_0x243493['name'])});}else{_0x2c3f39[_0xbe81('0x9')]({'app':'Dial','appdata':util[_0xbe81('0x8')](_0xbe81('0x20'),_0x243493['name'])});}_0x2c3f39['push']({'app':_0xbe81('0x21')});for(var _0x42ca20=0x0;_0x42ca20<_0x2c3f39[_0xbe81('0x5')];_0x42ca20++){_0x2c3f39[_0x42ca20]['priority']=_0x42ca20+0x1;_0x2c3f39[_0x42ca20]=_[_0xbe81('0x22')](_0x2c3f39[_0x42ca20],_0x4ad583);}return _0x2c3f39;};var getChanSpyPromise=function(_0x139512,_0x3821f2){return new BPromise(function(_0x416225,_0x59076e){return _0x139512[_0xbe81('0x23')][_0xbe81('0x24')]()[_0xbe81('0x25')](function(_0x5ad935){if(_0x5ad935){var _0x28d255=getChanSpyApplications(_0x3821f2,_0x3821f2[_0xbe81('0x26')],_0x5ad935);if(_0x3821f2[_0xbe81('0x26')]!=_0x3821f2[_0xbe81('0x27')]){_0x28d255=_0x28d255[_0xbe81('0x28')](getChanSpyApplications(_0x3821f2,_0x3821f2[_0xbe81('0x27')],_0x5ad935));}return _0x416225(_0x28d255);}return _0x416225([]);})[_0xbe81('0x29')](function(_0x2867d3){_0x59076e(_0x2867d3);});});};module['exports']=function(_0x49ee28){var _0x488064=_0x49ee28['models'];return _0x49ee28['define'](_0xbe81('0x2a'),attributes,{'tableName':'users','charset':_0xbe81('0x2b'),'collate':_0xbe81('0x2c'),'hooks':{'beforeCreate':function(_0x344e70,_0x40ecb3,_0x20c47c){var _0x3f4391=typeof _0x344e70['userProfileId']===_0xbe81('0x2d')?BPromise[_0xbe81('0x2e')](null):_0x488064[_0xbe81('0x2f')][_0xbe81('0x30')]({'where':{'id':_0x344e70[_0xbe81('0x31')]}});_0x3f4391[_0xbe81('0x25')](function(_0x532258){if(_0x532258){_0x344e70[_0xbe81('0x32')]=_0x532258[_0xbe81('0x32')];}})['then'](function(){_0x344e70[_0xbe81('0x33')]();_0x344e70[_0xbe81('0x34')](_0x20c47c);})['catch'](function(_0xaf6b86){_0x20c47c(_0xaf6b86);});},'beforeUpdate':function(_0x28cd1e,_0x956df6,_0x3b084a){Promise[_0xbe81('0x2e')]()['then'](function(){if(_0x28cd1e[_0xbe81('0x35')](_0xbe81('0x31'))===![])return;return _0x488064['UserProfile'][_0xbe81('0x30')]({'where':{'id':_0x28cd1e[_0xbe81('0x31')]}})['then'](function(_0x459bfd){if(_0x459bfd)_0x28cd1e[_0xbe81('0x32')]=_0x459bfd[_0xbe81('0x32')];return;});})[_0xbe81('0x25')](function(){if(_0x28cd1e[_0xbe81('0x35')](_0xbe81('0x11'))){_0x28cd1e[_0xbe81('0x33')]();return _0x28cd1e['updatePassword'](_0x3b084a);}_0x3b084a();})[_0xbe81('0x29')](function(_0x3cec43){_0x3b084a(_0x3cec43);});},'afterCreate':function(_0x5991a7,_0x345c31,_0xf653bc){var _0xdb6109=getUserApplications(_0x5991a7,_0x5991a7[_0xbe81('0x26')]);if(_0x5991a7[_0xbe81('0x26')]!=_0x5991a7[_0xbe81('0x27')]){_0xdb6109=_0xdb6109[_0xbe81('0x28')](getUserApplications(_0x5991a7,_0x5991a7[_0xbe81('0x27')]));}return Promise[_0xbe81('0x2e')]()[_0xbe81('0x25')](function(){if(!_0x5991a7[_0xbe81('0x36')]){return _0x5991a7[_0xbe81('0x37')]({'clientSideLoggingLevel':_0xbe81('0x38'),'clientSideLoggingEnabled':![]});}})[_0xbe81('0x25')](function(){return _0x488064[_0xbe81('0x39')][_0xbe81('0x3a')](_0xdb6109);})['then'](function(){if(_0x5991a7['chanspy']){return getChanSpyPromise(_0x488064,_0x5991a7);}})[_0xbe81('0x25')](function(_0x43b87e){if(_0x43b87e&&_0x43b87e[_0xbe81('0x5')]){return _0x488064[_0xbe81('0x39')][_0xbe81('0x3a')](_0x43b87e);}})['then'](function(){_0xf653bc();})[_0xbe81('0x29')](function(_0x527020){_0xf653bc(_0x527020);});},'afterUpdate':function(_0x56dd93,_0x5923b3,_0x1531b5){return BPromise[_0xbe81('0x2e')]()[_0xbe81('0x25')](function(){if(_0x56dd93['changed'](_0xbe81('0xc'))||_0x56dd93[_0xbe81('0x35')](_0xbe81('0x6'))){return _0x488064[_0xbe81('0x39')][_0xbe81('0x3b')]({'where':{'UserId':_0x56dd93['id'],'type':'system','ChanSpyId':{'$ne':null}}})[_0xbe81('0x25')](function(){if(_0x56dd93[_0xbe81('0xc')]){return getChanSpyPromise(_0x488064,_0x56dd93)['then'](function(_0x39cf3f){if(_0x39cf3f&&_0x39cf3f['length']){return _0x488064[_0xbe81('0x39')][_0xbe81('0x3a')](_0x39cf3f);}});}});}})['then'](function(){if(_0x56dd93['changed'](_0xbe81('0x1c'))||_0x56dd93[_0xbe81('0x35')](_0xbe81('0x6'))){return _0x488064[_0xbe81('0x39')]['destroy']({'where':{'UserId':_0x56dd93['id'],'type':_0xbe81('0x19'),'ChanSpyId':null}})[_0xbe81('0x25')](function(){var _0x4b4a20=getUserApplications(_0x56dd93,_0x56dd93[_0xbe81('0x26')]);if(_0x56dd93[_0xbe81('0x26')]!=_0x56dd93[_0xbe81('0x27')]){_0x4b4a20=_0x4b4a20[_0xbe81('0x28')](getUserApplications(_0x56dd93,_0x56dd93[_0xbe81('0x27')]));}return _0x488064['VoiceExtension'][_0xbe81('0x3a')](_0x4b4a20);});}})[_0xbe81('0x25')](function(){_0x1531b5();})[_0xbe81('0x29')](function(_0x2e0302){_0x1531b5(_0x2e0302);});},'afterDestroy':function(_0x53fe34){return _0x488064['VoiceExtension'][_0xbe81('0x3b')]({'where':{'UserId':_0x53fe34['id'],'type':_0xbe81('0x19')}});}},'instanceMethods':{'authenticate':function(_0x5339ae,_0x3fe3a9){if(!_0x3fe3a9){return this['password']===this[_0xbe81('0x3c')](_0x5339ae);}var _0x480a41=this;this[_0xbe81('0x3c')](_0x5339ae,function(_0x15a4ec,_0x8a2671){if(_0x15a4ec){_0x3fe3a9(_0x15a4ec);}if(_0x480a41[_0xbe81('0x11')]===_0x8a2671){_0x3fe3a9(null,!![]);}else{_0x3fe3a9(null,![]);}});},'makeSalt':function(_0x256c6c,_0x259be3){var _0x1290c6=0x10;if(typeof arguments[0x0]===_0xbe81('0x3d')){_0x259be3=arguments[0x0];_0x256c6c=_0x1290c6;}else if(typeof arguments[0x1]==='function'){_0x259be3=arguments[0x1];}else{throw new Error('Missing\x20Callback');}if(!_0x256c6c){_0x256c6c=_0x1290c6;}return crypto['randomBytes'](_0x256c6c,function(_0x473956,_0x42e575){if(_0x473956){_0x259be3(_0x473956);}return _0x259be3(null,_0x42e575['toString'](_0xbe81('0x3e')));});},'encryptPassword':function(_0x3903ae,_0x474e2f){if(!_0x3903ae||!this[_0xbe81('0x3f')]){return _0x474e2f?_0x474e2f(null):null;}var _0x2af76e=0x2710;var _0x3f0133=0x40;var _0x1471de=new Buffer(this[_0xbe81('0x3f')],'base64');if(!_0x474e2f){return crypto[_0xbe81('0x40')](_0x3903ae,_0x1471de,_0x2af76e,_0x3f0133,_0xbe81('0x41'))[_0xbe81('0x42')](_0xbe81('0x3e'));}return crypto[_0xbe81('0x43')](_0x3903ae,_0x1471de,_0x2af76e,_0x3f0133,'sha1',function(_0x5dab6a,_0x476da3){if(_0x5dab6a){_0x474e2f(_0x5dab6a);}return _0x474e2f(null,_0x476da3['toString'](_0xbe81('0x3e')));});},'updatePassword':function(_0x2e7759){if(!this[_0xbe81('0x11')]){return _0x2e7759(null);}if(!validatePresenceOf(this[_0xbe81('0x11')])&&authTypes['indexOf'](this[_0xbe81('0x44')])===-0x1){_0x2e7759(new Error('Invalid\x20password'));}var _0x49608e=this;this[_0xbe81('0x45')](function(_0x8ca0b7,_0x28329b){if(_0x8ca0b7){return _0x2e7759(_0x8ca0b7);}_0x49608e[_0xbe81('0x3f')]=_0x28329b;_0x49608e[_0xbe81('0x3c')](_0x49608e['password'],function(_0x58f354,_0x43df32){if(_0x58f354){_0x2e7759(_0x58f354);}_0x49608e[_0xbe81('0x11')]=_0x43df32;_0x2e7759(null);});});},'updateMd5Password':function(){this[_0xbe81('0x46')]=md5(this[_0xbe81('0x27')]+':asterisk:'+this[_0xbe81('0x11')]);return this[_0xbe81('0x46')];}}});};
\ No newline at end of file
+var _0xf157=['record','MixMonitor','${UNIQUEID}.%s,a','auth','push','Authenticate','password','ChanSpy','SIP/%s,%s','name','options','join','StopMixMonitor','wav','WAV','gsm','from-sip','system','Set','CDR(type)=internal','extensionMonitor','includes','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=%s','SIP/%s,,tTxXU(xcally-mixmonitor-context)','Dial','SIP/%s,,tTxX','Hangup','priority','defaults','VoiceChanSpy','findAll','internal','concat','catch','exports','models','User','users','utf8','userProfileId','undefined','UserProfile','then','privacyEnabled','updateMd5Password','resolve','changed','find','updatePassword','userSetting','error','VoiceExtension','bulkCreate','chanspy','destroy','encryptPassword','function','Missing\x20Callback','randomBytes','base64','salt','pbkdf2Sync','sha1','toString','pbkdf2','indexOf','provider','Invalid\x20password','makeSalt',':asterisk:','md5secret','bluebird','crypto','util','md5','lodash','./user.attributes','google','length','context','format','%s%s','merge'];(function(_0x2454cb,_0x2997ae){var _0x32f79f=function(_0xf0c935){while(--_0xf0c935){_0x2454cb['push'](_0x2454cb['shift']());}};_0x32f79f(++_0x2997ae);}(_0xf157,0xf0));var _0x7f15=function(_0x32002e,_0x218f24){_0x32002e=_0x32002e-0x0;var _0x33ec8c=_0xf157[_0x32002e];return _0x33ec8c;};'use strict';var BPromise=require(_0x7f15('0x0'));var crypto=require(_0x7f15('0x1'));var util=require(_0x7f15('0x2'));var md5=require(_0x7f15('0x3'));var _=require(_0x7f15('0x4'));var attributes=require(_0x7f15('0x5'));var authTypes=[_0x7f15('0x6')];var validatePresenceOf=function(_0x2e7b62){return _0x2e7b62&&_0x2e7b62[_0x7f15('0x7')];};var getChanSpyApplications=function(_0x54fcf7,_0x5c94a9,_0x9b8562){var _0x3f41a7={'context':_0x54fcf7[_0x7f15('0x8')]||'from-sip','type':'system','isApp':![],'UserId':_0x54fcf7['id']};var _0x39944d=[];for(var _0x4a4f4b=0x0,_0x45458f=0x1;_0x4a4f4b<_0x9b8562[_0x7f15('0x7')];_0x4a4f4b++,_0x45458f=0x1){var _0x522265={'exten':util[_0x7f15('0x9')](_0x7f15('0xa'),_0x9b8562[_0x4a4f4b]['prefix'],_0x5c94a9),'ChanSpyId':_0x9b8562[_0x4a4f4b]['id']};_0x39944d['push'](_[_0x7f15('0xb')]({'app':'Set','appdata':util[_0x7f15('0x9')]('CDR(type)=%s','chanspy'),'priority':_0x45458f++},_0x3f41a7,_0x522265));if(_0x9b8562[_0x4a4f4b][_0x7f15('0xc')]){_0x39944d['push'](_[_0x7f15('0xb')]({'app':_0x7f15('0xd'),'appdata':util[_0x7f15('0x9')](_0x7f15('0xe'),_0x9b8562[_0x4a4f4b]['recordingFormat']),'priority':_0x45458f++},_0x3f41a7,_0x522265));}if(_0x9b8562[_0x4a4f4b][_0x7f15('0xf')]){_0x39944d[_0x7f15('0x10')](_[_0x7f15('0xb')]({'app':_0x7f15('0x11'),'appdata':_0x9b8562[_0x4a4f4b][_0x7f15('0x12')],'priority':_0x45458f++},_0x3f41a7,_0x522265));}_0x39944d[_0x7f15('0x10')](_[_0x7f15('0xb')]({'app':_0x7f15('0x13'),'appdata':util[_0x7f15('0x9')](_0x7f15('0x14'),_0x54fcf7[_0x7f15('0x15')],_0x9b8562[_0x4a4f4b][_0x7f15('0x16')]?_0x9b8562[_0x4a4f4b][_0x7f15('0x16')][_0x7f15('0x17')](''):''),'priority':_0x45458f++},_0x3f41a7,_0x522265));if(_0x9b8562[_0x4a4f4b][_0x7f15('0xc')]){_0x39944d[_0x7f15('0x10')](_[_0x7f15('0xb')]({'app':_0x7f15('0x18'),'priority':_0x45458f++},_0x3f41a7,_0x522265));}}return _0x39944d;};var getUserApplications=function(_0x8c8207,_0x31a256){var _0x5f1930=[_0x7f15('0x19'),_0x7f15('0x1a'),_0x7f15('0x1b')];var _0x5ca124={'context':_0x8c8207[_0x7f15('0x8')]||_0x7f15('0x1c'),'exten':_0x31a256,'type':_0x7f15('0x1d'),'isApp':![],'UserId':_0x8c8207['id']};var _0x531cb5=[{'app':_0x7f15('0x1e'),'appdata':_0x7f15('0x1f')}];if(_0x8c8207[_0x7f15('0x20')]&&_[_0x7f15('0x21')](_0x5f1930,_0x8c8207[_0x7f15('0x20')])){_0x531cb5[_0x7f15('0x10')]({'app':_0x7f15('0x1e'),'appdata':_0x7f15('0x22')});_0x531cb5[_0x7f15('0x10')]({'app':_0x7f15('0x1e'),'appdata':util[_0x7f15('0x9')](_0x7f15('0x23'),_0x8c8207[_0x7f15('0x20')])});_0x531cb5[_0x7f15('0x10')]({'app':'Dial','appdata':util[_0x7f15('0x9')](_0x7f15('0x24'),_0x8c8207[_0x7f15('0x15')])});}else{_0x531cb5['push']({'app':_0x7f15('0x25'),'appdata':util[_0x7f15('0x9')](_0x7f15('0x26'),_0x8c8207['name'])});}_0x531cb5[_0x7f15('0x10')]({'app':_0x7f15('0x27')});for(var _0x3405ec=0x0;_0x3405ec<_0x531cb5['length'];_0x3405ec++){_0x531cb5[_0x3405ec][_0x7f15('0x28')]=_0x3405ec+0x1;_0x531cb5[_0x3405ec]=_[_0x7f15('0x29')](_0x531cb5[_0x3405ec],_0x5ca124);}return _0x531cb5;};var getChanSpyPromise=function(_0x3c7d9e,_0x47f4b4){return new BPromise(function(_0x40e2f1,_0x1eebae){return _0x3c7d9e[_0x7f15('0x2a')][_0x7f15('0x2b')]()['then'](function(_0x300341){if(_0x300341){var _0x1ef4ce=getChanSpyApplications(_0x47f4b4,_0x47f4b4[_0x7f15('0x2c')],_0x300341);if(_0x47f4b4[_0x7f15('0x2c')]!=_0x47f4b4['name']){_0x1ef4ce=_0x1ef4ce[_0x7f15('0x2d')](getChanSpyApplications(_0x47f4b4,_0x47f4b4[_0x7f15('0x15')],_0x300341));}return _0x40e2f1(_0x1ef4ce);}return _0x40e2f1([]);})[_0x7f15('0x2e')](function(_0x3fbbf9){_0x1eebae(_0x3fbbf9);});});};module[_0x7f15('0x2f')]=function(_0x3dd3bd){var _0x7f7b2f=_0x3dd3bd[_0x7f15('0x30')];return _0x3dd3bd['define'](_0x7f15('0x31'),attributes,{'tableName':_0x7f15('0x32'),'charset':_0x7f15('0x33'),'collate':'utf8_bin','hooks':{'beforeCreate':function(_0x481c28,_0x26638a,_0x3e9a7d){var _0x339492=typeof _0x481c28[_0x7f15('0x34')]===_0x7f15('0x35')?BPromise['resolve'](null):_0x7f7b2f[_0x7f15('0x36')]['find']({'where':{'id':_0x481c28[_0x7f15('0x34')]}});_0x339492[_0x7f15('0x37')](function(_0xaaa4c7){if(_0xaaa4c7){_0x481c28[_0x7f15('0x38')]=_0xaaa4c7[_0x7f15('0x38')];}})[_0x7f15('0x37')](function(){_0x481c28[_0x7f15('0x39')]();_0x481c28['updatePassword'](_0x3e9a7d);})[_0x7f15('0x2e')](function(_0x113c4b){_0x3e9a7d(_0x113c4b);});},'beforeUpdate':function(_0x3ecfea,_0x27c445,_0x220390){Promise[_0x7f15('0x3a')]()[_0x7f15('0x37')](function(){if(_0x3ecfea[_0x7f15('0x3b')](_0x7f15('0x34'))===![])return;return _0x7f7b2f[_0x7f15('0x36')][_0x7f15('0x3c')]({'where':{'id':_0x3ecfea[_0x7f15('0x34')]}})[_0x7f15('0x37')](function(_0x155dfe){if(_0x155dfe)_0x3ecfea[_0x7f15('0x38')]=_0x155dfe[_0x7f15('0x38')];return;});})[_0x7f15('0x37')](function(){if(_0x3ecfea['changed'](_0x7f15('0x12'))){_0x3ecfea[_0x7f15('0x39')]();return _0x3ecfea[_0x7f15('0x3d')](_0x220390);}_0x220390();})[_0x7f15('0x2e')](function(_0x1775ba){_0x220390(_0x1775ba);});},'afterCreate':function(_0x1bb10c,_0x2d2614,_0x374319){var _0x49393d=getUserApplications(_0x1bb10c,_0x1bb10c[_0x7f15('0x2c')]);if(_0x1bb10c['internal']!=_0x1bb10c[_0x7f15('0x15')]){_0x49393d=_0x49393d[_0x7f15('0x2d')](getUserApplications(_0x1bb10c,_0x1bb10c['name']));}return Promise['resolve']()[_0x7f15('0x37')](function(){if(!_0x1bb10c[_0x7f15('0x3e')]){return _0x1bb10c['createUserSetting']({'clientSideLoggingLevel':_0x7f15('0x3f'),'clientSideLoggingEnabled':![]});}})[_0x7f15('0x37')](function(){return _0x7f7b2f[_0x7f15('0x40')][_0x7f15('0x41')](_0x49393d);})[_0x7f15('0x37')](function(){if(_0x1bb10c[_0x7f15('0x42')]){return getChanSpyPromise(_0x7f7b2f,_0x1bb10c);}})['then'](function(_0x2a7b3b){if(_0x2a7b3b&&_0x2a7b3b['length']){return _0x7f7b2f[_0x7f15('0x40')]['bulkCreate'](_0x2a7b3b);}})[_0x7f15('0x37')](function(){_0x374319();})[_0x7f15('0x2e')](function(_0x5a67d9){_0x374319(_0x5a67d9);});},'afterUpdate':function(_0x3d9a41,_0x59163c,_0x4b1268){return BPromise[_0x7f15('0x3a')]()[_0x7f15('0x37')](function(){if(_0x3d9a41[_0x7f15('0x3b')](_0x7f15('0x42'))||_0x3d9a41[_0x7f15('0x3b')]('context')){return _0x7f7b2f[_0x7f15('0x40')]['destroy']({'where':{'UserId':_0x3d9a41['id'],'type':_0x7f15('0x1d'),'ChanSpyId':{'$ne':null}}})[_0x7f15('0x37')](function(){if(_0x3d9a41[_0x7f15('0x42')]){return getChanSpyPromise(_0x7f7b2f,_0x3d9a41)[_0x7f15('0x37')](function(_0xebd990){if(_0xebd990&&_0xebd990[_0x7f15('0x7')]){return _0x7f7b2f[_0x7f15('0x40')][_0x7f15('0x41')](_0xebd990);}});}});}})[_0x7f15('0x37')](function(){if(_0x3d9a41[_0x7f15('0x3b')](_0x7f15('0x20'))||_0x3d9a41[_0x7f15('0x3b')](_0x7f15('0x8'))){return _0x7f7b2f['VoiceExtension']['destroy']({'where':{'UserId':_0x3d9a41['id'],'type':_0x7f15('0x1d'),'ChanSpyId':null}})[_0x7f15('0x37')](function(){var _0x480bad=getUserApplications(_0x3d9a41,_0x3d9a41['internal']);if(_0x3d9a41[_0x7f15('0x2c')]!=_0x3d9a41[_0x7f15('0x15')]){_0x480bad=_0x480bad['concat'](getUserApplications(_0x3d9a41,_0x3d9a41[_0x7f15('0x15')]));}return _0x7f7b2f[_0x7f15('0x40')]['bulkCreate'](_0x480bad);});}})[_0x7f15('0x37')](function(){_0x4b1268();})[_0x7f15('0x2e')](function(_0x5199cb){_0x4b1268(_0x5199cb);});},'afterDestroy':function(_0x4e79f0){return _0x7f7b2f[_0x7f15('0x40')][_0x7f15('0x43')]({'where':{'UserId':_0x4e79f0['id'],'type':_0x7f15('0x1d')}});}},'instanceMethods':{'authenticate':function(_0x2aca98,_0x51b091){if(!_0x51b091){return this['password']===this[_0x7f15('0x44')](_0x2aca98);}var _0x30821c=this;this[_0x7f15('0x44')](_0x2aca98,function(_0x39a9ca,_0x152ac8){if(_0x39a9ca){_0x51b091(_0x39a9ca);}if(_0x30821c[_0x7f15('0x12')]===_0x152ac8){_0x51b091(null,!![]);}else{_0x51b091(null,![]);}});},'makeSalt':function(_0x203840,_0x47fe54){var _0xfc4d72=0x10;if(typeof arguments[0x0]===_0x7f15('0x45')){_0x47fe54=arguments[0x0];_0x203840=_0xfc4d72;}else if(typeof arguments[0x1]==='function'){_0x47fe54=arguments[0x1];}else{throw new Error(_0x7f15('0x46'));}if(!_0x203840){_0x203840=_0xfc4d72;}return crypto[_0x7f15('0x47')](_0x203840,function(_0x30fe17,_0x2bf668){if(_0x30fe17){_0x47fe54(_0x30fe17);}return _0x47fe54(null,_0x2bf668['toString'](_0x7f15('0x48')));});},'encryptPassword':function(_0x48ea51,_0x53bff0){if(!_0x48ea51||!this[_0x7f15('0x49')]){return _0x53bff0?_0x53bff0(null):null;}var _0x4bb12f=0x2710;var _0x156829=0x40;var _0xea204c=new Buffer(this['salt'],_0x7f15('0x48'));if(!_0x53bff0){return crypto[_0x7f15('0x4a')](_0x48ea51,_0xea204c,_0x4bb12f,_0x156829,_0x7f15('0x4b'))[_0x7f15('0x4c')](_0x7f15('0x48'));}return crypto[_0x7f15('0x4d')](_0x48ea51,_0xea204c,_0x4bb12f,_0x156829,_0x7f15('0x4b'),function(_0x17dcfa,_0x24a412){if(_0x17dcfa){_0x53bff0(_0x17dcfa);}return _0x53bff0(null,_0x24a412[_0x7f15('0x4c')](_0x7f15('0x48')));});},'updatePassword':function(_0x1c9041){if(!this[_0x7f15('0x12')]){return _0x1c9041(null);}if(!validatePresenceOf(this[_0x7f15('0x12')])&&authTypes[_0x7f15('0x4e')](this[_0x7f15('0x4f')])===-0x1){_0x1c9041(new Error(_0x7f15('0x50')));}var _0x53c84f=this;this[_0x7f15('0x51')](function(_0x1c6a5b,_0xcfd5ba){if(_0x1c6a5b){return _0x1c9041(_0x1c6a5b);}_0x53c84f['salt']=_0xcfd5ba;_0x53c84f[_0x7f15('0x44')](_0x53c84f[_0x7f15('0x12')],function(_0x1a3bf3,_0x50f936){if(_0x1a3bf3){_0x1c9041(_0x1a3bf3);}_0x53c84f['password']=_0x50f936;_0x1c9041(null);});});},'updateMd5Password':function(){this['md5secret']=md5(this[_0x7f15('0x15')]+_0x7f15('0x52')+this['password']);return this[_0x7f15('0x53')];}}});};
\ No newline at end of file
index 97d0971..c0ecfb9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3a8b=['loginInPause','agent','../../config/license/util','getLicense','agents','getVoiceQueues','upsert','getChannels','merge','LOGIN','LOGININPAUSE','concat','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./user.socket','register','request','info','User,\x20%s,\x20%s','request\x20sent','User,\x20%s,\x20%s,\x20%s','error','message','result','catch','GetUser','User','findAll','options','where','attributes','limit','include','map','model','then','debug','stringify','ShowUser','find','raw','PauseUser','name','internal','interface','UserVoiceQueueRt','update','MemberReport','PAUSE','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','forEach','push','SIP/%s','body','type','DEFAULT\x20PAUSE','role','uniqueid','bulkCreate','UnpauseUser','findOne','channel','isValidChannel','Unknown\x20channel','system','chat','fax','openchannel','set','%s%s','Pause','all','LogoutUser','destroy','LoginUser','mobile','phone'];(function(_0x359ecf,_0x20a123){var _0x3ee937=function(_0xc51d1b){while(--_0xc51d1b){_0x359ecf['push'](_0x359ecf['shift']());}};_0x3ee937(++_0x20a123);}(_0x3a8b,0x126));var _0xb3a8=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x3a8b[_0x138adb];return _0x1b27f2;};'use strict';var _=require(_0xb3a8('0x0'));var util=require(_0xb3a8('0x1'));var moment=require(_0xb3a8('0x2'));var BPromise=require(_0xb3a8('0x3'));var rs=require(_0xb3a8('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb3a8('0x5'))['db'];var utils=require(_0xb3a8('0x6'));var logger=require(_0xb3a8('0x7'))(_0xb3a8('0x8'));var config=require(_0xb3a8('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xb3a8('0xa')][_0xb3a8('0xb')]({'port':0x232a});config[_0xb3a8('0xc')]=_[_0xb3a8('0xd')](config[_0xb3a8('0xc')],{'host':_0xb3a8('0xe'),'port':0x18eb});var socket=require(_0xb3a8('0xf'))(new Redis(config['redis']));require(_0xb3a8('0x10'))[_0xb3a8('0x11')](socket);function respondWithRpcPromise(_0xe79c8c,_0x2e299c,_0x4be53e){return new BPromise(function(_0x1e00a0,_0x405032){return client[_0xb3a8('0x12')](_0xe79c8c,_0x4be53e)['then'](function(_0x4d1160){logger[_0xb3a8('0x13')](_0xb3a8('0x14'),_0x2e299c,_0xb3a8('0x15'));logger['debug'](_0xb3a8('0x16'),_0x2e299c,'request\x20sent',JSON['stringify'](_0x4d1160));if(_0x4d1160[_0xb3a8('0x17')]){if(_0x4d1160[_0xb3a8('0x17')]['code']===0x1f4){logger[_0xb3a8('0x17')](_0xb3a8('0x14'),_0x2e299c,_0x4d1160['error'][_0xb3a8('0x18')]);return _0x405032(_0x4d1160['error'][_0xb3a8('0x18')]);}logger[_0xb3a8('0x17')](_0xb3a8('0x14'),_0x2e299c,_0x4d1160[_0xb3a8('0x17')][_0xb3a8('0x18')]);return _0x1e00a0(_0x4d1160[_0xb3a8('0x17')][_0xb3a8('0x18')]);}else{logger[_0xb3a8('0x13')](_0xb3a8('0x14'),_0x2e299c,'request\x20sent');_0x1e00a0(_0x4d1160[_0xb3a8('0x19')]['message']);}})[_0xb3a8('0x1a')](function(_0x5ebd9b){logger[_0xb3a8('0x17')](_0xb3a8('0x14'),_0x2e299c,_0x5ebd9b);_0x405032(_0x5ebd9b);});});}exports[_0xb3a8('0x1b')]=function(_0x41cbff){var _0x1bf8cd=this;return new Promise(function(_0x5b4d12,_0x2c5bca){return db[_0xb3a8('0x1c')][_0xb3a8('0x1d')]({'raw':_0x41cbff[_0xb3a8('0x1e')]?_0x41cbff[_0xb3a8('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x41cbff[_0xb3a8('0x1e')]?_0x41cbff[_0xb3a8('0x1e')][_0xb3a8('0x1f')]||null:null,'attributes':_0x41cbff['options']?_0x41cbff[_0xb3a8('0x1e')][_0xb3a8('0x20')]||null:null,'limit':_0x41cbff[_0xb3a8('0x1e')]?_0x41cbff['options'][_0xb3a8('0x21')]||null:null,'include':_0x41cbff['options']?_0x41cbff[_0xb3a8('0x1e')]['include']?_['map'](_0x41cbff[_0xb3a8('0x1e')]['include'],function(_0x33c506){return{'model':db[_0x33c506['model']],'as':_0x33c506['as'],'attributes':_0x33c506['attributes'],'include':_0x33c506[_0xb3a8('0x22')]?_[_0xb3a8('0x23')](_0x33c506[_0xb3a8('0x22')],function(_0x387d37){return{'model':db[_0x387d37[_0xb3a8('0x24')]],'as':_0x387d37['as'],'attributes':_0x387d37[_0xb3a8('0x20')],'include':_0x387d37['include']?_[_0xb3a8('0x23')](_0x387d37[_0xb3a8('0x22')],function(_0x53c45f){return{'model':db[_0x53c45f['model']],'as':_0x53c45f['as'],'attributes':_0x53c45f[_0xb3a8('0x20')]};}):[]};}):[]};}):[]:[]})[_0xb3a8('0x25')](function(_0x44c8f1){logger[_0xb3a8('0x13')]('GetUser',_0x41cbff);logger[_0xb3a8('0x26')]('GetUser',_0x41cbff,JSON[_0xb3a8('0x27')](_0x44c8f1));_0x5b4d12(_0x44c8f1);})['catch'](function(_0x2e2935){logger[_0xb3a8('0x17')]('GetUser',_0x2e2935[_0xb3a8('0x18')],_0x41cbff);_0x2c5bca(_0x1bf8cd[_0xb3a8('0x17')](0x1f4,_0x2e2935[_0xb3a8('0x18')]));});});};exports[_0xb3a8('0x28')]=function(_0xbc7c68){var _0x3da3cd=this;return new Promise(function(_0x578902,_0x187398){return db[_0xb3a8('0x1c')][_0xb3a8('0x29')]({'raw':_0xbc7c68['options']?_0xbc7c68[_0xb3a8('0x1e')][_0xb3a8('0x2a')]===undefined?!![]:![]:!![],'where':_0xbc7c68[_0xb3a8('0x1e')]?_0xbc7c68['options'][_0xb3a8('0x1f')]||null:null,'attributes':_0xbc7c68['options']?_0xbc7c68[_0xb3a8('0x1e')]['attributes']||null:null,'include':_0xbc7c68[_0xb3a8('0x1e')]?_0xbc7c68[_0xb3a8('0x1e')][_0xb3a8('0x22')]?_[_0xb3a8('0x23')](_0xbc7c68[_0xb3a8('0x1e')][_0xb3a8('0x22')],function(_0x2b7f00){return{'model':db[_0x2b7f00['model']],'as':_0x2b7f00['as'],'attributes':_0x2b7f00[_0xb3a8('0x20')],'include':_0x2b7f00['include']?_[_0xb3a8('0x23')](_0x2b7f00[_0xb3a8('0x22')],function(_0x2319a7){return{'model':db[_0x2319a7[_0xb3a8('0x24')]],'as':_0x2319a7['as'],'attributes':_0x2319a7['attributes'],'include':_0x2319a7[_0xb3a8('0x22')]?_[_0xb3a8('0x23')](_0x2319a7[_0xb3a8('0x22')],function(_0x306a4d){return{'model':db[_0x306a4d[_0xb3a8('0x24')]],'as':_0x306a4d['as'],'attributes':_0x306a4d[_0xb3a8('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1c2b6b){logger[_0xb3a8('0x13')]('ShowUser',_0xbc7c68);logger[_0xb3a8('0x26')]('ShowUser',_0xbc7c68,JSON[_0xb3a8('0x27')](_0x1c2b6b));_0x578902(_0x1c2b6b);})[_0xb3a8('0x1a')](function(_0x3da7e9){logger[_0xb3a8('0x17')](_0xb3a8('0x28'),_0x3da7e9[_0xb3a8('0x18')],_0xbc7c68);_0x187398(_0x3da3cd[_0xb3a8('0x17')](0x1f4,_0x3da7e9[_0xb3a8('0x18')]));});});};exports[_0xb3a8('0x2b')]=function(_0x12459a){var _0x57a0b7=this;return new Promise(function(_0x50e42b,_0x43a04f){var _0x5a3171;return db[_0xb3a8('0x1c')]['find']({'where':_0x12459a[_0xb3a8('0x1e')][_0xb3a8('0x1f')]||{},'attributes':['id',_0xb3a8('0x2c'),'role',_0xb3a8('0x2d'),_0xb3a8('0x2e')]})['then'](function(_0x21ce28){if(_0x21ce28){_0x5a3171=_0x21ce28;return db[_0xb3a8('0x2f')][_0xb3a8('0x30')]({'paused':0x1},{'where':{'UserId':_0x5a3171['id']},'individualHooks':!![]});}})[_0xb3a8('0x25')](function(){if(_0x5a3171){return db[_0xb3a8('0x31')]['findAll']({'where':{'membername':_0x5a3171[_0xb3a8('0x2c')],'type':_0xb3a8('0x32'),'exitAt':null}});}})[_0xb3a8('0x25')](function(_0x2cd8ab){if(_0x5a3171){if(_0x2cd8ab&&_0x2cd8ab[_0xb3a8('0x33')]){var _0x17ad84=moment()[_0xb3a8('0x34')](_0xb3a8('0x35'));for(var _0x54db98=0x0,_0x59e6d5=_0x2cd8ab[_0xb3a8('0x33')];_0x54db98<_0x59e6d5;_0x54db98++){_0x2cd8ab[_0x54db98][_0xb3a8('0x36')]({'exitAt':_0x17ad84});}}}})[_0xb3a8('0x25')](function(){if(_0x5a3171){var _0x44ff36=[];var _0x40467f=utils['getChannels']();_0x40467f[_0xb3a8('0x37')](function(_0x2f17ea){_0x44ff36[_0xb3a8('0x38')]({'channel':_0x2f17ea,'membername':_0x5a3171['name'],'interface':_['isNil'](_0x5a3171[_0xb3a8('0x2e')])?util[_0xb3a8('0x34')](_0xb3a8('0x39'),_0x5a3171[_0xb3a8('0x2c')]):_0x5a3171[_0xb3a8('0x2e')],'type':_0xb3a8('0x32'),'enterAt':moment()['format'](_0xb3a8('0x35')),'data1':_0x12459a[_0xb3a8('0x3a')][_0xb3a8('0x3b')]||_0xb3a8('0x3c'),'role':_0x5a3171[_0xb3a8('0x3d')],'internal':_0x5a3171['internal'],'uniqueid':_0x12459a[_0xb3a8('0x3a')][_0xb3a8('0x3e')]||null});});return db[_0xb3a8('0x31')][_0xb3a8('0x3f')](_0x44ff36,{'individualHooks':!![]});}})[_0xb3a8('0x25')](function(){if(_0x5a3171){return _0x5a3171['update']({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x12459a[_0xb3a8('0x3a')][_0xb3a8('0x3b')]||'DEFAULT\x20PAUSE','lastPauseAt':moment()[_0xb3a8('0x34')](_0xb3a8('0x35'))});}})['then'](function(_0x384c84){_0x50e42b(_0x384c84);})[_0xb3a8('0x1a')](function(_0x4a9ee9){_0x43a04f(_0x57a0b7[_0xb3a8('0x17')](0x1f4,_0x4a9ee9[_0xb3a8('0x18')]));});});};exports[_0xb3a8('0x40')]=function(_0x5ba2a1){var _0x1434f6=this;return new Promise(function(_0x56b020,_0xd52143){var _0x4c9a60;return db['User'][_0xb3a8('0x41')]({'where':_0x5ba2a1[_0xb3a8('0x1e')]['where']||{},'attributes':['id',_0xb3a8('0x2c')]})[_0xb3a8('0x25')](function(_0x53cfeb){if(_0x53cfeb){_0x4c9a60=_0x53cfeb;if(_0x5ba2a1[_0xb3a8('0x3a')][_0xb3a8('0x42')]&&!utils[_0xb3a8('0x43')](_0x5ba2a1[_0xb3a8('0x3a')][_0xb3a8('0x42')])){throw new Error(_0xb3a8('0x44'));}switch(_0x5ba2a1[_0xb3a8('0x3a')]['channel']){case'voice':return db[_0xb3a8('0x2f')][_0xb3a8('0x30')]({'paused':0x0},{'where':{'UserId':_0x4c9a60['id']}})[_0xb3a8('0x25')](function(){return db[_0xb3a8('0x31')][_0xb3a8('0x29')]({'where':{'channel':_0x5ba2a1[_0xb3a8('0x3a')][_0xb3a8('0x42')],'membername':_0x4c9a60[_0xb3a8('0x2c')],'type':'PAUSE','exitAt':null}});})['then'](function(_0x145d21){if(_0x145d21){return _0x145d21[_0xb3a8('0x30')]({'exitAt':moment()[_0xb3a8('0x34')](_0xb3a8('0x35')),'data2':_0xb3a8('0x45')},{'individualHooks':!![]});}return null;})[_0xb3a8('0x25')](function(){return _0x4c9a60[_0xb3a8('0x30')]({'voicePause':![]});});case'mail':case _0xb3a8('0x46'):case _0xb3a8('0x47'):case'sms':case _0xb3a8('0x48'):case'whatsapp':return db[_0xb3a8('0x31')][_0xb3a8('0x29')]({'where':{'channel':_0x5ba2a1[_0xb3a8('0x3a')][_0xb3a8('0x42')],'membername':_0x4c9a60['name'],'type':'PAUSE','exitAt':null}})[_0xb3a8('0x25')](function(_0x30f020){return _0x30f020[_0xb3a8('0x30')]({'exitAt':moment()['format'](_0xb3a8('0x35')),'data2':_0xb3a8('0x45')},{'individualHooks':!![]});})[_0xb3a8('0x25')](function(){var _0x1de662={};_[_0xb3a8('0x49')](_0x1de662,util[_0xb3a8('0x34')](_0xb3a8('0x4a'),_0x5ba2a1[_0xb3a8('0x3a')][_0xb3a8('0x42')],_0xb3a8('0x4b')),![]);return _0x4c9a60['update'](_0x1de662);});default:return db['UserVoiceQueueRt'][_0xb3a8('0x30')]({'paused':0x0},{'where':{'UserId':_0x4c9a60['id']}})[_0xb3a8('0x25')](function(){return db[_0xb3a8('0x31')][_0xb3a8('0x1d')]({'where':{'membername':_0x4c9a60[_0xb3a8('0x2c')],'type':'PAUSE','exitAt':null}});})['then'](function(_0x1665e4){var _0x3e5322=[];_0x1665e4['forEach'](function(_0x58a0a8){_0x3e5322['push'](_0x58a0a8['update']({'exitAt':moment()[_0xb3a8('0x34')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0xb3a8('0x45')}));});return BPromise[_0xb3a8('0x4c')](_0x3e5322);})[_0xb3a8('0x25')](function(){return _0x4c9a60[_0xb3a8('0x30')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![]});});}}})[_0xb3a8('0x25')](function(_0x224aca){_0x56b020(_0x224aca);})[_0xb3a8('0x1a')](function(_0x47e4d5){_0xd52143(_0x1434f6[_0xb3a8('0x17')](0x1f4,_0x47e4d5[_0xb3a8('0x18')]));});});};exports[_0xb3a8('0x4d')]=function(_0x1c008a){var _0x48a14a=this;return new Promise(function(_0x34475d,_0x47fb0f){var _0x419595;return db[_0xb3a8('0x1c')]['findOne']({'where':_0x1c008a[_0xb3a8('0x1e')][_0xb3a8('0x1f')]||{},'attributes':['id',_0xb3a8('0x2c')]})[_0xb3a8('0x25')](function(_0x1e9644){if(_0x1e9644){_0x419595=_0x1e9644;return db['UserVoiceQueueRt'][_0xb3a8('0x4e')]({'where':{'membername':_0x419595[_0xb3a8('0x2c')]},'individualHooks':!![]});}})[_0xb3a8('0x25')](function(){if(_0x419595){return db[_0xb3a8('0x31')][_0xb3a8('0x1d')]({'where':{'membername':_0x419595['name'],'exitAt':null}});}})[_0xb3a8('0x25')](function(_0x52f3e5){if(_0x419595){if(_0x52f3e5&&_0x52f3e5[_0xb3a8('0x33')]){var _0x490da1=[];_0x52f3e5[_0xb3a8('0x37')](function(_0x18b217){_0x490da1[_0xb3a8('0x38')](_0x18b217[_0xb3a8('0x30')]({'exitAt':moment()[_0xb3a8('0x34')](_0xb3a8('0x35'))}));});return BPromise[_0xb3a8('0x4c')](_0x490da1);}}})[_0xb3a8('0x25')](function(){if(_0x419595){return _0x419595['update']({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0xb3a8('0x25')](function(_0x567ef2){_0x34475d(_0x567ef2);})[_0xb3a8('0x1a')](function(_0x5c1697){_0x47fb0f(_0x48a14a[_0xb3a8('0x17')](0x1f4,_0x5c1697['message']));});});};exports[_0xb3a8('0x4f')]=function(_0xfd1dbe){var _0x33f3a9=this;return new Promise(function(_0x15bacd,_0x24ac82){var _0x50a238;var _0x571cd8;var _0x55aa74;var _0x23a09e;return db[_0xb3a8('0x1c')][_0xb3a8('0x41')]({'where':_0xfd1dbe[_0xb3a8('0x1e')][_0xb3a8('0x1f')]||{},'attributes':['id',_0xb3a8('0x2c'),_0xb3a8('0x3d'),_0xb3a8('0x50'),_0xb3a8('0x51'),_0xb3a8('0x2d'),_0xb3a8('0x52'),_0xb3a8('0x2e')]})[_0xb3a8('0x25')](function(_0x50cf59){if(_0x50cf59){_0x50a238=_0x50cf59;_0x23a09e=_0xfd1dbe[_0xb3a8('0x3a')][_0xb3a8('0x2e')]?_0xfd1dbe['body'][_0xb3a8('0x2e')]:util[_0xb3a8('0x34')](_0xb3a8('0x39'),_0x50a238[_0xb3a8('0x2c')]);return db[_0xb3a8('0x1c')]['count']({'where':{'role':_0xb3a8('0x53'),'online':!![],'id':{'$ne':_0x50a238['id']}}});}})[_0xb3a8('0x25')](function(_0x2641fa){if(_0x2641fa){_0x55aa74=_0x2641fa;return require(_0xb3a8('0x54'))[_0xb3a8('0x55')]();}})['then'](function(_0xe222fb){if(_0xe222fb&&_0xe222fb[_0xb3a8('0x56')]&&_0x55aa74>=_0xe222fb['agents']){throw new Error('Maximum\x20login\x20has\x20been\x20reached');}})['then'](function(){if(_0x50a238){return db['UserVoiceQueueRt']['destroy']({'where':{'membername':_0x50a238[_0xb3a8('0x2c')]},'individualHooks':!![]});}})['then'](function(){if(_0x50a238){return _0x50a238[_0xb3a8('0x57')]({'raw':!![]});}})[_0xb3a8('0x25')](function(_0x1dd6f4){if(_0x50a238){if(_0x1dd6f4){var _0xf74597=[];_0x571cd8=_0x1dd6f4;if(_0x571cd8['length']){for(var _0x118fb8=0x0;_0x118fb8<_0x571cd8[_0xb3a8('0x33')];_0x118fb8++){_0xf74597[_0xb3a8('0x38')](db['UserVoiceQueueRt'][_0xb3a8('0x58')]({'membername':_0x50a238[_0xb3a8('0x2c')],'UserId':_0x50a238['id'],'queue_name':_0x571cd8[_0x118fb8][_0xb3a8('0x2c')],'VoiceQueueId':_0x571cd8[_0x118fb8]['id'],'interface':_0x23a09e,'paused':_0x50a238[_0xb3a8('0x52')]||![],'penalty':_0x571cd8[_0x118fb8]['UserVoiceQueue.penalty']||0x0}));}return BPromise['all'](_0xf74597);}}}})[_0xb3a8('0x25')](function(){if(_0x50a238){return db[_0xb3a8('0x31')]['findAll']({'where':{'membername':_0x50a238[_0xb3a8('0x2c')],'exitAt':null}});}})[_0xb3a8('0x25')](function(_0x1f9f19){if(_0x50a238){if(_0x1f9f19&&_0x1f9f19[_0xb3a8('0x33')]){var _0x549811=[];_0x1f9f19[_0xb3a8('0x37')](function(_0x2fd22e){_0x549811[_0xb3a8('0x38')](_0x2fd22e[_0xb3a8('0x30')]({'exitAt':moment()[_0xb3a8('0x34')](_0xb3a8('0x35'))}));});return BPromise[_0xb3a8('0x4c')](_0x549811);}}})[_0xb3a8('0x25')](function(_0x187954){if(_0x50a238){var _0x43221e=[];var _0xe4fb55=[];var _0x5468a1=utils[_0xb3a8('0x59')]();var _0x2957bd={'membername':_0x50a238[_0xb3a8('0x2c')],'interface':_0x23a09e,'enterAt':moment()[_0xb3a8('0x34')](_0xb3a8('0x35')),'role':_0x50a238['role'],'internal':_0x50a238[_0xb3a8('0x2d')]};_0x5468a1[_0xb3a8('0x37')](function(_0x3ad070){_0x43221e['push'](_[_0xb3a8('0x5a')]({'channel':_0x3ad070,'type':_0xb3a8('0x5b'),'data1':'callysquare','data2':_0x23a09e},_0x2957bd));if(_0x50a238['loginInPause']){_0xe4fb55['push'](_[_0xb3a8('0x5a')]({'channel':_0x3ad070,'type':_0xb3a8('0x32'),'data1':_0xb3a8('0x5c')},_0x2957bd));}});return db[_0xb3a8('0x31')][_0xb3a8('0x3f')](_0x43221e[_0xb3a8('0x5d')](_0xe4fb55),{'individualHooks':!![]});}})['then'](function(){if(_0x50a238){return _0x50a238['update']({'online':!![],'lastLoginAt':moment()[_0xb3a8('0x34')](_0xb3a8('0x35')),'voicePause':_0x50a238['loginInPause']||![],'mailPause':_0x50a238[_0xb3a8('0x52')]||![],'chatPause':_0x50a238[_0xb3a8('0x52')]||![],'faxPause':_0x50a238[_0xb3a8('0x52')]||![],'smsPause':_0x50a238[_0xb3a8('0x52')]||![],'openchannelPause':_0x50a238[_0xb3a8('0x52')]||![],'pauseType':_0x50a238['loginInPause']?_0xb3a8('0x5c'):null,'lastPauseAt':moment()['format'](_0xb3a8('0x35')),'interface':_0x23a09e});}})[_0xb3a8('0x25')](function(_0x16dc53){_0x15bacd(_0x16dc53);})[_0xb3a8('0x1a')](function(_0x3d6ec1){_0x24ac82(_0x33f3a9[_0xb3a8('0x17')](0x1f4,_0x3d6ec1[_0xb3a8('0x18')]));});});};
\ No newline at end of file
+var _0x58fe=['jayson/promise','client','redis','localhost','socket.io-emitter','./user.socket','register','request','then','info','request\x20sent','debug','User,\x20%s,\x20%s,\x20%s','stringify','error','code','User,\x20%s,\x20%s','message','catch','GetUser','User','findAll','options','limit','include','map','model','attributes','find','raw','where','ShowUser','PauseUser','name','interface','UserVoiceQueueRt','update','MemberReport','PAUSE','length','format','updateAttributes','forEach','push','isNil','SIP/%s','YYYY-MM-DD\x20HH:mm:ss','body','type','DEFAULT\x20PAUSE','role','internal','bulkCreate','UnpauseUser','findOne','channel','Unknown\x20channel','voice','mail','fax','sms','openchannel','system','set','%s%s','all','LogoutUser','LoginUser','count','agent','../../config/license/util','agents','Maximum\x20login\x20has\x20been\x20reached','destroy','getVoiceQueues','loginInPause','UserVoiceQueue.penalty','getChannels','merge','LOGIN','LOGININPAUSE','concat','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment'];(function(_0x122b55,_0x4a5065){var _0x488daa=function(_0x4e2f40){while(--_0x4e2f40){_0x122b55['push'](_0x122b55['shift']());}};_0x488daa(++_0x4a5065);}(_0x58fe,0x1be));var _0xe58f=function(_0x3d8ca8,_0x1a9764){_0x3d8ca8=_0x3d8ca8-0x0;var _0x517e45=_0x58fe[_0x3d8ca8];return _0x517e45;};'use strict';var _=require(_0xe58f('0x0'));var util=require(_0xe58f('0x1'));var moment=require(_0xe58f('0x2'));var BPromise=require(_0xe58f('0x3'));var rs=require(_0xe58f('0x4'));var fs=require('fs');var Redis=require(_0xe58f('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xe58f('0x6'));var logger=require('../../config/logger')(_0xe58f('0x7'));var config=require(_0xe58f('0x8'));var jayson=require(_0xe58f('0x9'));var client=jayson[_0xe58f('0xa')]['http']({'port':0x232a});config[_0xe58f('0xb')]=_['defaults'](config[_0xe58f('0xb')],{'host':_0xe58f('0xc'),'port':0x18eb});var socket=require(_0xe58f('0xd'))(new Redis(config['redis']));require(_0xe58f('0xe'))[_0xe58f('0xf')](socket);function respondWithRpcPromise(_0x51ea11,_0x237b07,_0x2cb8ca){return new BPromise(function(_0x4843e6,_0x2032c9){return client[_0xe58f('0x10')](_0x51ea11,_0x2cb8ca)[_0xe58f('0x11')](function(_0x3c036c){logger[_0xe58f('0x12')]('User,\x20%s,\x20%s',_0x237b07,_0xe58f('0x13'));logger[_0xe58f('0x14')](_0xe58f('0x15'),_0x237b07,_0xe58f('0x13'),JSON[_0xe58f('0x16')](_0x3c036c));if(_0x3c036c['error']){if(_0x3c036c[_0xe58f('0x17')][_0xe58f('0x18')]===0x1f4){logger[_0xe58f('0x17')](_0xe58f('0x19'),_0x237b07,_0x3c036c[_0xe58f('0x17')][_0xe58f('0x1a')]);return _0x2032c9(_0x3c036c[_0xe58f('0x17')][_0xe58f('0x1a')]);}logger[_0xe58f('0x17')]('User,\x20%s,\x20%s',_0x237b07,_0x3c036c['error']['message']);return _0x4843e6(_0x3c036c[_0xe58f('0x17')][_0xe58f('0x1a')]);}else{logger[_0xe58f('0x12')](_0xe58f('0x19'),_0x237b07,_0xe58f('0x13'));_0x4843e6(_0x3c036c['result'][_0xe58f('0x1a')]);}})[_0xe58f('0x1b')](function(_0x45615c){logger[_0xe58f('0x17')](_0xe58f('0x19'),_0x237b07,_0x45615c);_0x2032c9(_0x45615c);});});}exports[_0xe58f('0x1c')]=function(_0x40d951){var _0xb7f3d3=this;return new Promise(function(_0x497c0e,_0x3fc85d){return db[_0xe58f('0x1d')][_0xe58f('0x1e')]({'raw':_0x40d951[_0xe58f('0x1f')]?_0x40d951['options']['raw']===undefined?!![]:![]:!![],'where':_0x40d951[_0xe58f('0x1f')]?_0x40d951['options']['where']||null:null,'attributes':_0x40d951[_0xe58f('0x1f')]?_0x40d951[_0xe58f('0x1f')]['attributes']||null:null,'limit':_0x40d951[_0xe58f('0x1f')]?_0x40d951[_0xe58f('0x1f')][_0xe58f('0x20')]||null:null,'include':_0x40d951[_0xe58f('0x1f')]?_0x40d951[_0xe58f('0x1f')][_0xe58f('0x21')]?_[_0xe58f('0x22')](_0x40d951[_0xe58f('0x1f')][_0xe58f('0x21')],function(_0x30ef6f){return{'model':db[_0x30ef6f[_0xe58f('0x23')]],'as':_0x30ef6f['as'],'attributes':_0x30ef6f[_0xe58f('0x24')],'include':_0x30ef6f[_0xe58f('0x21')]?_['map'](_0x30ef6f['include'],function(_0xd0f993){return{'model':db[_0xd0f993['model']],'as':_0xd0f993['as'],'attributes':_0xd0f993[_0xe58f('0x24')],'include':_0xd0f993['include']?_[_0xe58f('0x22')](_0xd0f993['include'],function(_0x1f199e){return{'model':db[_0x1f199e[_0xe58f('0x23')]],'as':_0x1f199e['as'],'attributes':_0x1f199e['attributes']};}):[]};}):[]};}):[]:[]})[_0xe58f('0x11')](function(_0x1b3308){logger['info'](_0xe58f('0x1c'),_0x40d951);logger[_0xe58f('0x14')](_0xe58f('0x1c'),_0x40d951,JSON[_0xe58f('0x16')](_0x1b3308));_0x497c0e(_0x1b3308);})[_0xe58f('0x1b')](function(_0x36c41e){logger[_0xe58f('0x17')]('GetUser',_0x36c41e['message'],_0x40d951);_0x3fc85d(_0xb7f3d3[_0xe58f('0x17')](0x1f4,_0x36c41e['message']));});});};exports['ShowUser']=function(_0x30c469){var _0x1ef11a=this;return new Promise(function(_0x1b7c64,_0x352a0c){return db['User'][_0xe58f('0x25')]({'raw':_0x30c469[_0xe58f('0x1f')]?_0x30c469[_0xe58f('0x1f')][_0xe58f('0x26')]===undefined?!![]:![]:!![],'where':_0x30c469[_0xe58f('0x1f')]?_0x30c469[_0xe58f('0x1f')][_0xe58f('0x27')]||null:null,'attributes':_0x30c469[_0xe58f('0x1f')]?_0x30c469[_0xe58f('0x1f')][_0xe58f('0x24')]||null:null,'include':_0x30c469[_0xe58f('0x1f')]?_0x30c469[_0xe58f('0x1f')][_0xe58f('0x21')]?_['map'](_0x30c469[_0xe58f('0x1f')][_0xe58f('0x21')],function(_0x46ac20){return{'model':db[_0x46ac20['model']],'as':_0x46ac20['as'],'attributes':_0x46ac20[_0xe58f('0x24')],'include':_0x46ac20[_0xe58f('0x21')]?_[_0xe58f('0x22')](_0x46ac20['include'],function(_0x1db406){return{'model':db[_0x1db406[_0xe58f('0x23')]],'as':_0x1db406['as'],'attributes':_0x1db406['attributes'],'include':_0x1db406['include']?_[_0xe58f('0x22')](_0x1db406[_0xe58f('0x21')],function(_0x459faa){return{'model':db[_0x459faa[_0xe58f('0x23')]],'as':_0x459faa['as'],'attributes':_0x459faa[_0xe58f('0x24')]};}):[]};}):[]};}):[]:[]})[_0xe58f('0x11')](function(_0x13d964){logger['info']('ShowUser',_0x30c469);logger[_0xe58f('0x14')](_0xe58f('0x28'),_0x30c469,JSON[_0xe58f('0x16')](_0x13d964));_0x1b7c64(_0x13d964);})[_0xe58f('0x1b')](function(_0x3efeea){logger['error'](_0xe58f('0x28'),_0x3efeea[_0xe58f('0x1a')],_0x30c469);_0x352a0c(_0x1ef11a['error'](0x1f4,_0x3efeea[_0xe58f('0x1a')]));});});};exports[_0xe58f('0x29')]=function(_0x2c7d09){var _0x232aa0=this;return new Promise(function(_0x249894,_0x491080){var _0x37852b;return db[_0xe58f('0x1d')][_0xe58f('0x25')]({'where':_0x2c7d09[_0xe58f('0x1f')][_0xe58f('0x27')]||{},'attributes':['id',_0xe58f('0x2a'),'role','internal',_0xe58f('0x2b')]})[_0xe58f('0x11')](function(_0x22c0f4){if(_0x22c0f4){_0x37852b=_0x22c0f4;return db[_0xe58f('0x2c')][_0xe58f('0x2d')]({'paused':0x1},{'where':{'UserId':_0x37852b['id']},'individualHooks':!![]});}})[_0xe58f('0x11')](function(){if(_0x37852b){return db[_0xe58f('0x2e')]['findAll']({'where':{'membername':_0x37852b[_0xe58f('0x2a')],'type':_0xe58f('0x2f'),'exitAt':null}});}})['then'](function(_0x381a43){if(_0x37852b){if(_0x381a43&&_0x381a43[_0xe58f('0x30')]){var _0x10b585=moment()[_0xe58f('0x31')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x4272b2=0x0,_0x25478c=_0x381a43[_0xe58f('0x30')];_0x4272b2<_0x25478c;_0x4272b2++){_0x381a43[_0x4272b2][_0xe58f('0x32')]({'exitAt':_0x10b585});}}}})[_0xe58f('0x11')](function(){if(_0x37852b){var _0x5ef51a=[];var _0x2449a1=utils['getChannels']();_0x2449a1[_0xe58f('0x33')](function(_0x6da592){_0x5ef51a[_0xe58f('0x34')]({'channel':_0x6da592,'membername':_0x37852b[_0xe58f('0x2a')],'interface':_[_0xe58f('0x35')](_0x37852b[_0xe58f('0x2b')])?util[_0xe58f('0x31')](_0xe58f('0x36'),_0x37852b[_0xe58f('0x2a')]):_0x37852b[_0xe58f('0x2b')],'type':'PAUSE','enterAt':moment()[_0xe58f('0x31')](_0xe58f('0x37')),'data1':_0x2c7d09[_0xe58f('0x38')][_0xe58f('0x39')]||_0xe58f('0x3a'),'role':_0x37852b[_0xe58f('0x3b')],'internal':_0x37852b[_0xe58f('0x3c')],'uniqueid':_0x2c7d09[_0xe58f('0x38')]['uniqueid']||null});});return db[_0xe58f('0x2e')][_0xe58f('0x3d')](_0x5ef51a,{'individualHooks':!![]});}})[_0xe58f('0x11')](function(){if(_0x37852b){return _0x37852b[_0xe58f('0x2d')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x2c7d09[_0xe58f('0x38')][_0xe58f('0x39')]||_0xe58f('0x3a'),'lastPauseAt':moment()[_0xe58f('0x31')](_0xe58f('0x37'))});}})[_0xe58f('0x11')](function(_0x2185d3){_0x249894(_0x2185d3);})[_0xe58f('0x1b')](function(_0xe8b1fe){_0x491080(_0x232aa0[_0xe58f('0x17')](0x1f4,_0xe8b1fe[_0xe58f('0x1a')]));});});};exports[_0xe58f('0x3e')]=function(_0x285a91){var _0x5d62cc=this;return new Promise(function(_0x490592,_0x5766c9){var _0x2bff81;return db[_0xe58f('0x1d')][_0xe58f('0x3f')]({'where':_0x285a91[_0xe58f('0x1f')][_0xe58f('0x27')]||{},'attributes':['id',_0xe58f('0x2a')]})[_0xe58f('0x11')](function(_0xaff4b5){if(_0xaff4b5){_0x2bff81=_0xaff4b5;if(_0x285a91[_0xe58f('0x38')][_0xe58f('0x40')]&&!utils['isValidChannel'](_0x285a91[_0xe58f('0x38')][_0xe58f('0x40')])){throw new Error(_0xe58f('0x41'));}switch(_0x285a91[_0xe58f('0x38')]['channel']){case _0xe58f('0x42'):return db[_0xe58f('0x2c')]['update']({'paused':0x0},{'where':{'UserId':_0x2bff81['id']}})['then'](function(){return db[_0xe58f('0x2e')][_0xe58f('0x25')]({'where':{'channel':_0x285a91[_0xe58f('0x38')][_0xe58f('0x40')],'membername':_0x2bff81['name'],'type':'PAUSE','exitAt':null}});})[_0xe58f('0x11')](function(_0x343a12){if(_0x343a12){return _0x343a12[_0xe58f('0x2d')]({'exitAt':moment()[_0xe58f('0x31')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':'system'},{'individualHooks':!![]});}return null;})[_0xe58f('0x11')](function(){return _0x2bff81[_0xe58f('0x2d')]({'voicePause':![]});});case _0xe58f('0x43'):case'chat':case _0xe58f('0x44'):case _0xe58f('0x45'):case _0xe58f('0x46'):case'whatsapp':return db[_0xe58f('0x2e')][_0xe58f('0x25')]({'where':{'channel':_0x285a91[_0xe58f('0x38')][_0xe58f('0x40')],'membername':_0x2bff81['name'],'type':'PAUSE','exitAt':null}})[_0xe58f('0x11')](function(_0x1a6af8){return _0x1a6af8[_0xe58f('0x2d')]({'exitAt':moment()[_0xe58f('0x31')](_0xe58f('0x37')),'data2':_0xe58f('0x47')},{'individualHooks':!![]});})[_0xe58f('0x11')](function(){var _0x413d4d={};_[_0xe58f('0x48')](_0x413d4d,util[_0xe58f('0x31')](_0xe58f('0x49'),_0x285a91[_0xe58f('0x38')][_0xe58f('0x40')],'Pause'),![]);return _0x2bff81['update'](_0x413d4d);});default:return db['UserVoiceQueueRt'][_0xe58f('0x2d')]({'paused':0x0},{'where':{'UserId':_0x2bff81['id']}})[_0xe58f('0x11')](function(){return db[_0xe58f('0x2e')]['findAll']({'where':{'membername':_0x2bff81['name'],'type':_0xe58f('0x2f'),'exitAt':null}});})[_0xe58f('0x11')](function(_0x38995a){var _0x2b3d66=[];_0x38995a['forEach'](function(_0x455ef7){_0x2b3d66[_0xe58f('0x34')](_0x455ef7[_0xe58f('0x2d')]({'exitAt':moment()['format'](_0xe58f('0x37')),'data2':'system'}));});return BPromise[_0xe58f('0x4a')](_0x2b3d66);})[_0xe58f('0x11')](function(){return _0x2bff81['update']({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![]});});}}})['then'](function(_0x55c391){_0x490592(_0x55c391);})['catch'](function(_0x1b9d11){_0x5766c9(_0x5d62cc[_0xe58f('0x17')](0x1f4,_0x1b9d11[_0xe58f('0x1a')]));});});};exports[_0xe58f('0x4b')]=function(_0x485d54){var _0x5b7271=this;return new Promise(function(_0x3ec50d,_0x2edb23){var _0x45d20f;return db[_0xe58f('0x1d')][_0xe58f('0x3f')]({'where':_0x485d54[_0xe58f('0x1f')]['where']||{},'attributes':['id',_0xe58f('0x2a')]})[_0xe58f('0x11')](function(_0xbf970b){if(_0xbf970b){_0x45d20f=_0xbf970b;return db[_0xe58f('0x2c')]['destroy']({'where':{'membername':_0x45d20f['name']},'individualHooks':!![]});}})[_0xe58f('0x11')](function(){if(_0x45d20f){return db[_0xe58f('0x2e')][_0xe58f('0x1e')]({'where':{'membername':_0x45d20f[_0xe58f('0x2a')],'exitAt':null}});}})['then'](function(_0x4e4ec9){if(_0x45d20f){if(_0x4e4ec9&&_0x4e4ec9[_0xe58f('0x30')]){var _0x5853a4=[];_0x4e4ec9[_0xe58f('0x33')](function(_0xcebd43){_0x5853a4['push'](_0xcebd43[_0xe58f('0x2d')]({'exitAt':moment()['format'](_0xe58f('0x37'))}));});return BPromise['all'](_0x5853a4);}}})[_0xe58f('0x11')](function(){if(_0x45d20f){return _0x45d20f[_0xe58f('0x2d')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0xe58f('0x11')](function(_0x50c87c){_0x3ec50d(_0x50c87c);})[_0xe58f('0x1b')](function(_0x4748bb){_0x2edb23(_0x5b7271[_0xe58f('0x17')](0x1f4,_0x4748bb['message']));});});};exports[_0xe58f('0x4c')]=function(_0xbe326){var _0x2be7b4=this;return new Promise(function(_0x32ee86,_0x575866){var _0x4e5eb3;var _0x10fc23;var _0x4fde6b;var _0xf34451;return db[_0xe58f('0x1d')][_0xe58f('0x3f')]({'where':_0xbe326[_0xe58f('0x1f')][_0xe58f('0x27')]||{},'attributes':['id','name','role','mobile','phone',_0xe58f('0x3c'),'loginInPause',_0xe58f('0x2b')]})[_0xe58f('0x11')](function(_0x5c7056){if(_0x5c7056){_0x4e5eb3=_0x5c7056;_0xf34451=_0xbe326[_0xe58f('0x38')]['interface']?_0xbe326[_0xe58f('0x38')][_0xe58f('0x2b')]:util[_0xe58f('0x31')]('SIP/%s',_0x4e5eb3[_0xe58f('0x2a')]);return db[_0xe58f('0x1d')][_0xe58f('0x4d')]({'where':{'role':_0xe58f('0x4e'),'online':!![],'id':{'$ne':_0x4e5eb3['id']}}});}})[_0xe58f('0x11')](function(_0x2c5a6f){if(_0x2c5a6f){_0x4fde6b=_0x2c5a6f;return require(_0xe58f('0x4f'))['getLicense']();}})[_0xe58f('0x11')](function(_0x1a0391){if(_0x1a0391&&_0x1a0391[_0xe58f('0x50')]&&_0x4fde6b>=_0x1a0391[_0xe58f('0x50')]){throw new Error(_0xe58f('0x51'));}})['then'](function(){if(_0x4e5eb3){return db[_0xe58f('0x2c')][_0xe58f('0x52')]({'where':{'membername':_0x4e5eb3[_0xe58f('0x2a')]},'individualHooks':!![]});}})[_0xe58f('0x11')](function(){if(_0x4e5eb3){return _0x4e5eb3[_0xe58f('0x53')]({'raw':!![]});}})['then'](function(_0x3ecbb2){if(_0x4e5eb3){if(_0x3ecbb2){var _0x171cb0=[];_0x10fc23=_0x3ecbb2;if(_0x10fc23[_0xe58f('0x30')]){for(var _0x5c7841=0x0;_0x5c7841<_0x10fc23[_0xe58f('0x30')];_0x5c7841++){_0x171cb0[_0xe58f('0x34')](db[_0xe58f('0x2c')]['upsert']({'membername':_0x4e5eb3[_0xe58f('0x2a')],'UserId':_0x4e5eb3['id'],'queue_name':_0x10fc23[_0x5c7841]['name'],'VoiceQueueId':_0x10fc23[_0x5c7841]['id'],'interface':_0xf34451,'paused':_0x4e5eb3[_0xe58f('0x54')]||![],'penalty':_0x10fc23[_0x5c7841][_0xe58f('0x55')]||0x0}));}return BPromise[_0xe58f('0x4a')](_0x171cb0);}}}})[_0xe58f('0x11')](function(){if(_0x4e5eb3){return db['MemberReport'][_0xe58f('0x1e')]({'where':{'membername':_0x4e5eb3[_0xe58f('0x2a')],'exitAt':null}});}})[_0xe58f('0x11')](function(_0x492152){if(_0x4e5eb3){if(_0x492152&&_0x492152['length']){var _0x189868=[];_0x492152[_0xe58f('0x33')](function(_0x2b01f1){_0x189868[_0xe58f('0x34')](_0x2b01f1[_0xe58f('0x2d')]({'exitAt':moment()[_0xe58f('0x31')](_0xe58f('0x37'))}));});return BPromise[_0xe58f('0x4a')](_0x189868);}}})['then'](function(_0x5adb9a){if(_0x4e5eb3){var _0x39b32f=[];var _0x1e5081=[];var _0x3cc9cb=utils[_0xe58f('0x56')]();var _0x895b75={'membername':_0x4e5eb3['name'],'interface':_0xf34451,'enterAt':moment()[_0xe58f('0x31')](_0xe58f('0x37')),'role':_0x4e5eb3['role'],'internal':_0x4e5eb3[_0xe58f('0x3c')]};_0x3cc9cb[_0xe58f('0x33')](function(_0x465629){_0x39b32f[_0xe58f('0x34')](_[_0xe58f('0x57')]({'channel':_0x465629,'type':_0xe58f('0x58'),'data1':'callysquare','data2':_0xf34451},_0x895b75));if(_0x4e5eb3[_0xe58f('0x54')]){_0x1e5081[_0xe58f('0x34')](_[_0xe58f('0x57')]({'channel':_0x465629,'type':'PAUSE','data1':_0xe58f('0x59')},_0x895b75));}});return db[_0xe58f('0x2e')][_0xe58f('0x3d')](_0x39b32f[_0xe58f('0x5a')](_0x1e5081),{'individualHooks':!![]});}})[_0xe58f('0x11')](function(){if(_0x4e5eb3){return _0x4e5eb3[_0xe58f('0x2d')]({'online':!![],'lastLoginAt':moment()[_0xe58f('0x31')](_0xe58f('0x37')),'voicePause':_0x4e5eb3[_0xe58f('0x54')]||![],'mailPause':_0x4e5eb3['loginInPause']||![],'chatPause':_0x4e5eb3['loginInPause']||![],'faxPause':_0x4e5eb3[_0xe58f('0x54')]||![],'smsPause':_0x4e5eb3['loginInPause']||![],'openchannelPause':_0x4e5eb3[_0xe58f('0x54')]||![],'pauseType':_0x4e5eb3[_0xe58f('0x54')]?_0xe58f('0x59'):null,'lastPauseAt':moment()[_0xe58f('0x31')](_0xe58f('0x37')),'interface':_0xf34451});}})[_0xe58f('0x11')](function(_0x5d7a6e){_0x32ee86(_0x5d7a6e);})[_0xe58f('0x1b')](function(_0x2a1a13){_0x575866(_0x2be7b4[_0xe58f('0x17')](0x1f4,_0x2a1a13['message']));});});};
\ No newline at end of file
index 9cb1389..e72f739 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc442=['save','remove','update','emit','removeListener','register','length','user:','./user.events'];(function(_0x36c6f0,_0x272d24){var _0x3af75e=function(_0x123551){while(--_0x123551){_0x36c6f0['push'](_0x36c6f0['shift']());}};_0x3af75e(++_0x272d24);}(_0xc442,0x194));var _0x2c44=function(_0x55d279,_0x48f243){_0x55d279=_0x55d279-0x0;var _0x33d746=_0xc442[_0x55d279];return _0x33d746;};'use strict';var UserEvents=require(_0x2c44('0x0'));var events=[_0x2c44('0x1'),_0x2c44('0x2'),_0x2c44('0x3')];function createListener(_0x36ec19,_0x200675){return function(_0x107a33){_0x200675[_0x2c44('0x4')](_0x36ec19,_0x107a33);};}function removeListener(_0x137ab9,_0x5c7488){return function(){UserEvents[_0x2c44('0x5')](_0x137ab9,_0x5c7488);};}exports[_0x2c44('0x6')]=function(_0x1a141a){for(var _0x557774=0x0,_0x16eead=events[_0x2c44('0x7')];_0x557774<_0x16eead;_0x557774++){var _0x2dd5b2=events[_0x557774];var _0x4d3ae3=createListener(_0x2c44('0x8')+_0x2dd5b2,_0x1a141a);UserEvents['on'](_0x2dd5b2,_0x4d3ae3);}};
\ No newline at end of file
+var _0xa698=['emit','removeListener','register','length','user:','./user.events','save','remove','update'];(function(_0x308213,_0x224541){var _0x2e1619=function(_0x972b51){while(--_0x972b51){_0x308213['push'](_0x308213['shift']());}};_0x2e1619(++_0x224541);}(_0xa698,0x1b5));var _0x8a69=function(_0x13fb93,_0x595468){_0x13fb93=_0x13fb93-0x0;var _0x334dc4=_0xa698[_0x13fb93];return _0x334dc4;};'use strict';var UserEvents=require(_0x8a69('0x0'));var events=[_0x8a69('0x1'),_0x8a69('0x2'),_0x8a69('0x3')];function createListener(_0x392429,_0x58841c){return function(_0x1fbdb8){_0x58841c[_0x8a69('0x4')](_0x392429,_0x1fbdb8);};}function removeListener(_0x56b8b8,_0x17ca12){return function(){UserEvents[_0x8a69('0x5')](_0x56b8b8,_0x17ca12);};}exports[_0x8a69('0x6')]=function(_0x134d21){for(var _0x13a151=0x0,_0x403a67=events[_0x8a69('0x7')];_0x13a151<_0x403a67;_0x13a151++){var _0x3705e2=events[_0x13a151];var _0x5368e0=createListener(_0x8a69('0x8')+_0x3705e2,_0x134d21);UserEvents['on'](_0x3705e2,_0x5368e0);}};
\ No newline at end of file
index b4ee6a7..aeccc2b 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(_0x1836a7,_0x47e0d0){var _0x162178=function(_0x450b47){while(--_0x450b47){_0x1836a7['push'](_0x1836a7['shift']());}};_0x162178(++_0x47e0d0);}(_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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x288ceb,_0x185eaf){var _0x5368a9=function(_0x15e601){while(--_0x15e601){_0x288ceb['push'](_0x288ceb['shift']());}};_0x5368a9(++_0x185eaf);}(_0x9c44,0x178));var _0x49c4=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0x9c44[_0x68c979];return _0x4f0001;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router;
\ No newline at end of file
index 769e032..75ef55a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xef6d=['exports','INTEGER'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xef6d,0x12c));var _0xdef6=function(_0x5322a0,_0x5d0c60){_0x5322a0=_0x5322a0-0x0;var _0x1c2212=_0xef6d[_0x5322a0];return _0x1c2212;};'use strict';var Sequelize=require('sequelize');module[_0xdef6('0x0')]={'penalty':{'type':Sequelize[_0xdef6('0x1')],'defaultValue':0x0}};
\ No newline at end of file
+var _0xa4e4=['sequelize','exports'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0xa4e4,0x1de));var _0x4a4e=function(_0x16e1d5,_0x26b53b){_0x16e1d5=_0x16e1d5-0x0;var _0x534f2c=_0xa4e4[_0x16e1d5];return _0x534f2c;};'use strict';var Sequelize=require(_0x4a4e('0x0'));module[_0x4a4e('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
index 8d95921..afe9560 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3671=['path','./userChatQueue.attributes','exports','UserChatQueue','user_has_chat_queues','lodash','../../config/logger','moment','request-promise'];(function(_0x15c93b,_0x5478f9){var _0x20cdbe=function(_0x2f71b3){while(--_0x2f71b3){_0x15c93b['push'](_0x15c93b['shift']());}};_0x20cdbe(++_0x5478f9);}(_0x3671,0x17f));var _0x1367=function(_0xa9db74,_0x45e441){_0xa9db74=_0xa9db74-0x0;var _0x3c8d7a=_0x3671[_0xa9db74];return _0x3c8d7a;};'use strict';var _=require(_0x1367('0x0'));var util=require('util');var logger=require(_0x1367('0x1'))('api');var moment=require(_0x1367('0x2'));var BPromise=require('bluebird');var rp=require(_0x1367('0x3'));var fs=require('fs');var path=require(_0x1367('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x1367('0x5'));module[_0x1367('0x6')]=function(_0xae7960,_0x39b91c){return _0xae7960['define'](_0x1367('0x7'),attributes,{'tableName':_0x1367('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x87a0=['api','moment','bluebird','rimraf','../../config/environment','./userChatQueue.attributes','exports','UserChatQueue','user_has_chat_queues','lodash','util','../../config/logger'];(function(_0x3b0152,_0x2e2105){var _0x478f7b=function(_0x236088){while(--_0x236088){_0x3b0152['push'](_0x3b0152['shift']());}};_0x478f7b(++_0x2e2105);}(_0x87a0,0x81));var _0x087a=function(_0x5be281,_0x3ef1da){_0x5be281=_0x5be281-0x0;var _0x5968a1=_0x87a0[_0x5be281];return _0x5968a1;};'use strict';var _=require(_0x087a('0x0'));var util=require(_0x087a('0x1'));var logger=require(_0x087a('0x2'))(_0x087a('0x3'));var moment=require(_0x087a('0x4'));var BPromise=require(_0x087a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x087a('0x6'));var config=require(_0x087a('0x7'));var attributes=require(_0x087a('0x8'));module[_0x087a('0x9')]=function(_0x1c2b53,_0x45db3c){return _0x1c2b53['define'](_0x087a('0xa'),attributes,{'tableName':_0x087a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index f321d2c..1d95389 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf8b4=['debug','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','UserChatQueue,\x20%s,\x20%s','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent'];(function(_0x35f2d6,_0x1eacc1){var _0x33a492=function(_0x3dccc5){while(--_0x3dccc5){_0x35f2d6['push'](_0x35f2d6['shift']());}};_0x33a492(++_0x1eacc1);}(_0xf8b4,0x1d1));var _0x4f8b=function(_0x1925c7,_0x1791a7){_0x1925c7=_0x1925c7-0x0;var _0x349120=_0xf8b4[_0x1925c7];return _0x349120;};'use strict';var _=require('lodash');var util=require(_0x4f8b('0x0'));var moment=require('moment');var BPromise=require(_0x4f8b('0x1'));var rs=require(_0x4f8b('0x2'));var fs=require('fs');var Redis=require(_0x4f8b('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x4f8b('0x4'));var logger=require(_0x4f8b('0x5'))(_0x4f8b('0x6'));var config=require(_0x4f8b('0x7'));var jayson=require(_0x4f8b('0x8'));var client=jayson[_0x4f8b('0x9')][_0x4f8b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4951f0,_0x358368,_0x6706ca){return new BPromise(function(_0x2c5766,_0x67c48){return client[_0x4f8b('0xb')](_0x4951f0,_0x6706ca)[_0x4f8b('0xc')](function(_0x352d1f){logger[_0x4f8b('0xd')]('UserChatQueue,\x20%s,\x20%s',_0x358368,_0x4f8b('0xe'));logger[_0x4f8b('0xf')](_0x4f8b('0x10'),_0x358368,_0x4f8b('0xe'),JSON[_0x4f8b('0x11')](_0x352d1f));if(_0x352d1f[_0x4f8b('0x12')]){if(_0x352d1f[_0x4f8b('0x12')][_0x4f8b('0x13')]===0x1f4){logger[_0x4f8b('0x12')](_0x4f8b('0x14'),_0x358368,_0x352d1f[_0x4f8b('0x12')][_0x4f8b('0x15')]);return _0x67c48(_0x352d1f[_0x4f8b('0x12')][_0x4f8b('0x15')]);}logger[_0x4f8b('0x12')]('UserChatQueue,\x20%s,\x20%s',_0x358368,_0x352d1f[_0x4f8b('0x12')][_0x4f8b('0x15')]);return _0x2c5766(_0x352d1f[_0x4f8b('0x12')][_0x4f8b('0x15')]);}else{logger[_0x4f8b('0xd')](_0x4f8b('0x14'),_0x358368,_0x4f8b('0xe'));_0x2c5766(_0x352d1f[_0x4f8b('0x16')]['message']);}})[_0x4f8b('0x17')](function(_0xea24ad){logger[_0x4f8b('0x12')](_0x4f8b('0x14'),_0x358368,_0xea24ad);_0x67c48(_0xea24ad);});});}
\ No newline at end of file
+var _0xb259=['request','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','http'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xb259,0x173));var _0x9b25=function(_0xfc36d8,_0x233b0b){_0xfc36d8=_0xfc36d8-0x0;var _0x234f42=_0xb259[_0xfc36d8];return _0x234f42;};'use strict';var _=require(_0x9b25('0x0'));var util=require(_0x9b25('0x1'));var moment=require(_0x9b25('0x2'));var BPromise=require(_0x9b25('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9b25('0x4'))['db'];var utils=require(_0x9b25('0x5'));var logger=require('../../config/logger')(_0x9b25('0x6'));var config=require(_0x9b25('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x9b25('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4afcc0,_0x2dc3b0,_0x226854){return new BPromise(function(_0xe0415,_0x501be7){return client[_0x9b25('0x9')](_0x4afcc0,_0x226854)['then'](function(_0x167270){logger[_0x9b25('0xa')](_0x9b25('0xb'),_0x2dc3b0,_0x9b25('0xc'));logger[_0x9b25('0xd')](_0x9b25('0xe'),_0x2dc3b0,_0x9b25('0xc'),JSON['stringify'](_0x167270));if(_0x167270['error']){if(_0x167270[_0x9b25('0xf')][_0x9b25('0x10')]===0x1f4){logger[_0x9b25('0xf')]('UserChatQueue,\x20%s,\x20%s',_0x2dc3b0,_0x167270['error'][_0x9b25('0x11')]);return _0x501be7(_0x167270[_0x9b25('0xf')]['message']);}logger['error'](_0x9b25('0xb'),_0x2dc3b0,_0x167270['error'][_0x9b25('0x11')]);return _0xe0415(_0x167270[_0x9b25('0xf')][_0x9b25('0x11')]);}else{logger[_0x9b25('0xa')](_0x9b25('0xb'),_0x2dc3b0,_0x9b25('0xc'));_0xe0415(_0x167270[_0x9b25('0x12')][_0x9b25('0x11')]);}})[_0x9b25('0x13')](function(_0x34bbf8){logger[_0x9b25('0xf')](_0x9b25('0xb'),_0x2dc3b0,_0x34bbf8);_0x501be7(_0x34bbf8);});});}
\ No newline at end of file
index 59cabcd..2df39c5 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(_0x405a7a,_0x5937ac){var _0x4c9a54=function(_0x826698){while(--_0x826698){_0x405a7a['push'](_0x405a7a['shift']());}};_0x4c9a54(++_0x5937ac);}(_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
+var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x302e06,_0x40b336){var _0x22987e=function(_0x4c509a){while(--_0x4c509a){_0x302e06['push'](_0x302e06['shift']());}};_0x22987e(++_0x40b336);}(_0xa9e0,0x123));var _0x0a9e=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0xa9e0[_0x491a7f];return _0x3d8f44;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router;
\ No newline at end of file
index 689571a..a707c97 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2ac3=['STRING','INTEGER'];(function(_0x3f967e,_0x30f2d2){var _0x326b8c=function(_0x160aa8){while(--_0x160aa8){_0x3f967e['push'](_0x3f967e['shift']());}};_0x326b8c(++_0x30f2d2);}(_0x2ac3,0x93));var _0x32ac=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x2ac3[_0x59ee6f];return _0x4c0979;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize[_0x32ac('0x0')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x32ac('0x0')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x32ac('0x1')]}};
\ No newline at end of file
+var _0xb80c=['INTEGER','exports'];(function(_0x425d46,_0x38d08a){var _0x43cd97=function(_0x485ea8){while(--_0x485ea8){_0x425d46['push'](_0x425d46['shift']());}};_0x43cd97(++_0x38d08a);}(_0xb80c,0xb3));var _0xcb80=function(_0x127257,_0x1cce66){_0x127257=_0x127257-0x0;var _0x54efcc=_0xb80c[_0x127257];return _0x54efcc;};'use strict';var Sequelize=require('sequelize');module[_0xcb80('0x0')]={'penalty':{'type':Sequelize[_0xcb80('0x1')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xcb80('0x1')],'defaultValue':0x0},'queue':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 3921351..cd19182 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2bc2=['request-promise','path','rimraf','../../config/environment','./userFaxQueue.attributes','exports','define','UserFaxQueue','user_has_fax_queues','util','api','moment'];(function(_0x30c2d6,_0x23d52f){var _0x54c769=function(_0x24d698){while(--_0x24d698){_0x30c2d6['push'](_0x30c2d6['shift']());}};_0x54c769(++_0x23d52f);}(_0x2bc2,0x8d));var _0x22bc=function(_0x9c39de,_0x2a5854){_0x9c39de=_0x9c39de-0x0;var _0x590e76=_0x2bc2[_0x9c39de];return _0x590e76;};'use strict';var _=require('lodash');var util=require(_0x22bc('0x0'));var logger=require('../../config/logger')(_0x22bc('0x1'));var moment=require(_0x22bc('0x2'));var BPromise=require('bluebird');var rp=require(_0x22bc('0x3'));var fs=require('fs');var path=require(_0x22bc('0x4'));var rimraf=require(_0x22bc('0x5'));var config=require(_0x22bc('0x6'));var attributes=require(_0x22bc('0x7'));module[_0x22bc('0x8')]=function(_0x29bf9f,_0x284dbd){return _0x29bf9f[_0x22bc('0x9')](_0x22bc('0xa'),attributes,{'tableName':_0x22bc('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xffac=['exports','define','UserFaxQueue','user_has_fax_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./userFaxQueue.attributes'];(function(_0x484387,_0x3fe5a3){var _0x108c80=function(_0x268f29){while(--_0x268f29){_0x484387['push'](_0x484387['shift']());}};_0x108c80(++_0x3fe5a3);}(_0xffac,0xc8));var _0xcffa=function(_0x1701ce,_0x2bccf9){_0x1701ce=_0x1701ce-0x0;var _0x1446eb=_0xffac[_0x1701ce];return _0x1446eb;};'use strict';var _=require(_0xcffa('0x0'));var util=require(_0xcffa('0x1'));var logger=require(_0xcffa('0x2'))(_0xcffa('0x3'));var moment=require(_0xcffa('0x4'));var BPromise=require(_0xcffa('0x5'));var rp=require(_0xcffa('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcffa('0x7'));var config=require(_0xcffa('0x8'));var attributes=require(_0xcffa('0x9'));module[_0xcffa('0xa')]=function(_0x3be13f,_0xaa2c74){return _0x3be13f[_0xcffa('0xb')](_0xcffa('0xc'),attributes,{'tableName':_0xcffa('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 7d8c61f..9748ad5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x05a4=['http','request','then','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x3fa70a,_0x2edd99){var _0x30175c=function(_0x46a062){while(--_0x46a062){_0x3fa70a['push'](_0x3fa70a['shift']());}};_0x30175c(++_0x2edd99);}(_0x05a4,0x7f));var _0x405a=function(_0x262393,_0x5af6e9){_0x262393=_0x262393-0x0;var _0x2f9918=_0x05a4[_0x262393];return _0x2f9918;};'use strict';var _=require(_0x405a('0x0'));var util=require(_0x405a('0x1'));var moment=require(_0x405a('0x2'));var BPromise=require(_0x405a('0x3'));var rs=require(_0x405a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x405a('0x5'))['db'];var utils=require(_0x405a('0x6'));var logger=require(_0x405a('0x7'))(_0x405a('0x8'));var config=require(_0x405a('0x9'));var jayson=require(_0x405a('0xa'));var client=jayson['client'][_0x405a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xd4cfaa,_0x4990fb,_0x56d9a1){return new BPromise(function(_0x5db2c3,_0x4dda03){return client[_0x405a('0xc')](_0xd4cfaa,_0x56d9a1)[_0x405a('0xd')](function(_0xd1f2e5){logger[_0x405a('0xe')](_0x405a('0xf'),_0x4990fb,_0x405a('0x10'));logger['debug'](_0x405a('0x11'),_0x4990fb,_0x405a('0x10'),JSON[_0x405a('0x12')](_0xd1f2e5));if(_0xd1f2e5[_0x405a('0x13')]){if(_0xd1f2e5[_0x405a('0x13')][_0x405a('0x14')]===0x1f4){logger['error'](_0x405a('0xf'),_0x4990fb,_0xd1f2e5[_0x405a('0x13')][_0x405a('0x15')]);return _0x4dda03(_0xd1f2e5['error'][_0x405a('0x15')]);}logger[_0x405a('0x13')](_0x405a('0xf'),_0x4990fb,_0xd1f2e5[_0x405a('0x13')][_0x405a('0x15')]);return _0x5db2c3(_0xd1f2e5[_0x405a('0x13')][_0x405a('0x15')]);}else{logger[_0x405a('0xe')]('UserFaxQueue,\x20%s,\x20%s',_0x4990fb,_0x405a('0x10'));_0x5db2c3(_0xd1f2e5[_0x405a('0x16')][_0x405a('0x15')]);}})['catch'](function(_0x193698){logger['error'](_0x405a('0xf'),_0x4990fb,_0x193698);_0x4dda03(_0x193698);});});}
\ No newline at end of file
+var _0x64ce=['http','request','then','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/environment','jayson/promise','client'];(function(_0x2f3d29,_0x150e7b){var _0x53d69d=function(_0x45f6ec){while(--_0x45f6ec){_0x2f3d29['push'](_0x2f3d29['shift']());}};_0x53d69d(++_0x150e7b);}(_0x64ce,0x1b0));var _0xe64c=function(_0xb02eed,_0x13d074){_0xb02eed=_0xb02eed-0x0;var _0x43455b=_0x64ce[_0xb02eed];return _0x43455b;};'use strict';var _=require(_0xe64c('0x0'));var util=require(_0xe64c('0x1'));var moment=require(_0xe64c('0x2'));var BPromise=require(_0xe64c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe64c('0x4'));var db=require(_0xe64c('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xe64c('0x6'));var jayson=require(_0xe64c('0x7'));var client=jayson[_0xe64c('0x8')][_0xe64c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x163064,_0x3718bd,_0x16c320){return new BPromise(function(_0x34fa58,_0x465129){return client[_0xe64c('0xa')](_0x163064,_0x16c320)[_0xe64c('0xb')](function(_0x364c19){logger[_0xe64c('0xc')](_0xe64c('0xd'),_0x3718bd,_0xe64c('0xe'));logger['debug'](_0xe64c('0xf'),_0x3718bd,_0xe64c('0xe'),JSON[_0xe64c('0x10')](_0x364c19));if(_0x364c19[_0xe64c('0x11')]){if(_0x364c19[_0xe64c('0x11')][_0xe64c('0x12')]===0x1f4){logger[_0xe64c('0x11')]('UserFaxQueue,\x20%s,\x20%s',_0x3718bd,_0x364c19[_0xe64c('0x11')]['message']);return _0x465129(_0x364c19[_0xe64c('0x11')][_0xe64c('0x13')]);}logger['error']('UserFaxQueue,\x20%s,\x20%s',_0x3718bd,_0x364c19[_0xe64c('0x11')][_0xe64c('0x13')]);return _0x34fa58(_0x364c19[_0xe64c('0x11')][_0xe64c('0x13')]);}else{logger[_0xe64c('0xc')](_0xe64c('0xd'),_0x3718bd,_0xe64c('0xe'));_0x34fa58(_0x364c19['result'][_0xe64c('0x13')]);}})[_0xe64c('0x14')](function(_0x321a95){logger['error'](_0xe64c('0xd'),_0x3718bd,_0x321a95);_0x465129(_0x321a95);});});}
\ No newline at end of file
index 4e31f5f..aeb38f7 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(_0x53f2fd,_0x5d1c08){var _0x206ba8=function(_0x2b13c5){while(--_0x2b13c5){_0x53f2fd['push'](_0x53f2fd['shift']());}};_0x206ba8(++_0x5d1c08);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xa9e0[_0x1facfa];return _0x9ec701;};'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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x5b6d34,_0x2a32a0){var _0x65eb46=function(_0x2fed53){while(--_0x2fed53){_0x5b6d34['push'](_0x5b6d34['shift']());}};_0x65eb46(++_0x2a32a0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xa9e0[_0x2b10c6];return _0x3789d2;};'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 b9951d9..3e05628 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5209=['INTEGER'];(function(_0x30a863,_0x11ada2){var _0x5e9fed=function(_0x4002b4){while(--_0x4002b4){_0x30a863['push'](_0x30a863['shift']());}};_0x5e9fed(++_0x11ada2);}(_0x5209,0x163));var _0x9520=function(_0x1f7b4c,_0x312460){_0x1f7b4c=_0x1f7b4c-0x0;var _0x528e82=_0x5209[_0x1f7b4c];return _0x528e82;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize[_0x9520('0x0')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x0e34=['INTEGER','sequelize'];(function(_0x3ee917,_0x3eeb1b){var _0xa190e4=function(_0x5db709){while(--_0x5db709){_0x3ee917['push'](_0x3ee917['shift']());}};_0xa190e4(++_0x3eeb1b);}(_0x0e34,0x13d));var _0x40e3=function(_0x1dd52d,_0x3b6332){_0x1dd52d=_0x1dd52d-0x0;var _0x25c746=_0x0e34[_0x1dd52d];return _0x25c746;};'use strict';var Sequelize=require(_0x40e3('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x40e3('0x1')],'defaultValue':0x0}};
\ No newline at end of file
index 15712f5..48024de 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3e0b=['../../config/environment','./userMailQueue.attributes','exports','UserMailQueue','user_has_mail_queues','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf'];(function(_0x5658f5,_0x45ed1c){var _0x2c1d5b=function(_0xd00e4c){while(--_0xd00e4c){_0x5658f5['push'](_0x5658f5['shift']());}};_0x2c1d5b(++_0x45ed1c);}(_0x3e0b,0xe9));var _0xb3e0=function(_0x44265,_0x5c3c68){_0x44265=_0x44265-0x0;var _0x49539b=_0x3e0b[_0x44265];return _0x49539b;};'use strict';var _=require(_0xb3e0('0x0'));var util=require(_0xb3e0('0x1'));var logger=require(_0xb3e0('0x2'))(_0xb3e0('0x3'));var moment=require('moment');var BPromise=require(_0xb3e0('0x4'));var rp=require(_0xb3e0('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb3e0('0x6'));var config=require(_0xb3e0('0x7'));var attributes=require(_0xb3e0('0x8'));module[_0xb3e0('0x9')]=function(_0x323540,_0x526cf3){return _0x323540['define'](_0xb3e0('0xa'),attributes,{'tableName':_0xb3e0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x087b=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','exports','define','user_has_mail_queues','lodash'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x087b,0x16a));var _0xb087=function(_0x4e9d3c,_0x1f4b98){_0x4e9d3c=_0x4e9d3c-0x0;var _0x2d0825=_0x087b[_0x4e9d3c];return _0x2d0825;};'use strict';var _=require(_0xb087('0x0'));var util=require(_0xb087('0x1'));var logger=require(_0xb087('0x2'))(_0xb087('0x3'));var moment=require(_0xb087('0x4'));var BPromise=require(_0xb087('0x5'));var rp=require(_0xb087('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb087('0x7'));var config=require('../../config/environment');var attributes=require('./userMailQueue.attributes');module[_0xb087('0x8')]=function(_0x278284,_0x3fd4ec){return _0x278284[_0xb087('0x9')]('UserMailQueue',attributes,{'tableName':_0xb087('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 3b837a4..2277960 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa41a=['rpc','../../config/environment','client','http','request','then','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x48bc1e,_0x13de06){var _0x4c98bb=function(_0x5c2ab7){while(--_0x5c2ab7){_0x48bc1e['push'](_0x48bc1e['shift']());}};_0x4c98bb(++_0x13de06);}(_0xa41a,0x6b));var _0xaa41=function(_0x4b39c8,_0x31a79e){_0x4b39c8=_0x4b39c8-0x0;var _0x17d0ad=_0xa41a[_0x4b39c8];return _0x17d0ad;};'use strict';var _=require(_0xaa41('0x0'));var util=require(_0xaa41('0x1'));var moment=require('moment');var BPromise=require(_0xaa41('0x2'));var rs=require(_0xaa41('0x3'));var fs=require('fs');var Redis=require(_0xaa41('0x4'));var db=require(_0xaa41('0x5'))['db'];var utils=require(_0xaa41('0x6'));var logger=require(_0xaa41('0x7'))(_0xaa41('0x8'));var config=require(_0xaa41('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xaa41('0xa')][_0xaa41('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x54bc5a,_0x5b1fff,_0x179545){return new BPromise(function(_0x202cce,_0x588ab4){return client[_0xaa41('0xc')](_0x54bc5a,_0x179545)[_0xaa41('0xd')](function(_0x409dab){logger[_0xaa41('0xe')](_0xaa41('0xf'),_0x5b1fff,_0xaa41('0x10'));logger[_0xaa41('0x11')](_0xaa41('0x12'),_0x5b1fff,_0xaa41('0x10'),JSON['stringify'](_0x409dab));if(_0x409dab[_0xaa41('0x13')]){if(_0x409dab[_0xaa41('0x13')]['code']===0x1f4){logger['error'](_0xaa41('0xf'),_0x5b1fff,_0x409dab['error'][_0xaa41('0x14')]);return _0x588ab4(_0x409dab[_0xaa41('0x13')][_0xaa41('0x14')]);}logger[_0xaa41('0x13')](_0xaa41('0xf'),_0x5b1fff,_0x409dab['error'][_0xaa41('0x14')]);return _0x202cce(_0x409dab[_0xaa41('0x13')][_0xaa41('0x14')]);}else{logger[_0xaa41('0xe')](_0xaa41('0xf'),_0x5b1fff,_0xaa41('0x10'));_0x202cce(_0x409dab[_0xaa41('0x15')]['message']);}})[_0xaa41('0x16')](function(_0x16b930){logger[_0xaa41('0x13')](_0xaa41('0xf'),_0x5b1fff,_0x16b930);_0x588ab4(_0x16b930);});});}
\ No newline at end of file
+var _0x008c=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','UserMailQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','UserMailQueue,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x008c,0x188));var _0xc008=function(_0x3c49b2,_0x285e48){_0x3c49b2=_0x3c49b2-0x0;var _0x2d9203=_0x008c[_0x3c49b2];return _0x2d9203;};'use strict';var _=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var moment=require(_0xc008('0x2'));var BPromise=require(_0xc008('0x3'));var rs=require(_0xc008('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc008('0x5'))['db'];var utils=require(_0xc008('0x6'));var logger=require(_0xc008('0x7'))(_0xc008('0x8'));var config=require(_0xc008('0x9'));var jayson=require(_0xc008('0xa'));var client=jayson[_0xc008('0xb')][_0xc008('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x9c8cb2,_0x4af530,_0x428fa9){return new BPromise(function(_0x5aa09b,_0x30be38){return client['request'](_0x9c8cb2,_0x428fa9)['then'](function(_0x27830d){logger[_0xc008('0xd')]('UserMailQueue,\x20%s,\x20%s',_0x4af530,'request\x20sent');logger['debug'](_0xc008('0xe'),_0x4af530,_0xc008('0xf'),JSON['stringify'](_0x27830d));if(_0x27830d[_0xc008('0x10')]){if(_0x27830d[_0xc008('0x10')][_0xc008('0x11')]===0x1f4){logger[_0xc008('0x10')](_0xc008('0x12'),_0x4af530,_0x27830d[_0xc008('0x10')][_0xc008('0x13')]);return _0x30be38(_0x27830d['error']['message']);}logger[_0xc008('0x10')]('UserMailQueue,\x20%s,\x20%s',_0x4af530,_0x27830d[_0xc008('0x10')][_0xc008('0x13')]);return _0x5aa09b(_0x27830d[_0xc008('0x10')][_0xc008('0x13')]);}else{logger[_0xc008('0xd')]('UserMailQueue,\x20%s,\x20%s',_0x4af530,'request\x20sent');_0x5aa09b(_0x27830d['result'][_0xc008('0x13')]);}})[_0xc008('0x14')](function(_0x3cafe3){logger[_0xc008('0x10')]('UserMailQueue,\x20%s,\x20%s',_0x4af530,_0x3cafe3);_0x30be38(_0x3cafe3);});});}
\ No newline at end of file
index edb1aeb..061a1b7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1b7f=['../../components/auth/service','../../components/interaction/service','../../config/environment','./userNotification.controller','post','isAuthenticated','sendUserNotification','exports','util','path','express','Router'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x1b7f,0x98));var _0xf1b7=function(_0x4dc5ef,_0x39f11e){_0x4dc5ef=_0x4dc5ef-0x0;var _0x241e81=_0x1b7f[_0x4dc5ef];return _0x241e81;};'use strict';var multer=require('multer');var util=require(_0xf1b7('0x0'));var path=require(_0xf1b7('0x1'));var timeout=require('connect-timeout');var express=require(_0xf1b7('0x2'));var router=express[_0xf1b7('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xf1b7('0x4'));var interaction=require(_0xf1b7('0x5'));var config=require(_0xf1b7('0x6'));var controller=require(_0xf1b7('0x7'));router[_0xf1b7('0x8')]('/',auth[_0xf1b7('0x9')](),controller[_0xf1b7('0xa')]);module[_0xf1b7('0xb')]=router;
\ No newline at end of file
+var _0x91e3=['exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','./userNotification.controller','post','sendUserNotification'];(function(_0x3fecd6,_0x23a98e){var _0x4883ad=function(_0x45a87e){while(--_0x45a87e){_0x3fecd6['push'](_0x3fecd6['shift']());}};_0x4883ad(++_0x23a98e);}(_0x91e3,0x65));var _0x391e=function(_0x15681d,_0x40d775){_0x15681d=_0x15681d-0x0;var _0x21f3df=_0x91e3[_0x15681d];return _0x21f3df;};'use strict';var multer=require(_0x391e('0x0'));var util=require(_0x391e('0x1'));var path=require(_0x391e('0x2'));var timeout=require('connect-timeout');var express=require(_0x391e('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x391e('0x4'));var interaction=require(_0x391e('0x5'));var config=require('../../config/environment');var controller=require(_0x391e('0x6'));router[_0x391e('0x7')]('/',auth['isAuthenticated'](),controller[_0x391e('0x8')]);module[_0x391e('0x9')]=router;
\ No newline at end of file
index 3de1231..abea867 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x62de=['TEXT','STRING','BOOLEAN'];(function(_0x411add,_0x1aed38){var _0x238242=function(_0x4a1cd5){while(--_0x4a1cd5){_0x411add['push'](_0x411add['shift']());}};_0x238242(++_0x1aed38);}(_0x62de,0xba));var _0xe62d=function(_0x2f39e3,_0xa8b18){_0x2f39e3=_0x2f39e3-0x0;var _0x42ff78=_0x62de[_0x2f39e3];return _0x42ff78;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0xe62d('0x0')]},'senderName':{'type':Sequelize['STRING']},'recipientsId':{'type':Sequelize['TEXT']},'recipientsDescription':{'type':Sequelize[_0xe62d('0x1')]},'beep':{'type':Sequelize[_0xe62d('0x2')]}};
\ No newline at end of file
+var _0x010b=['STRING','BOOLEAN','sequelize','exports','TEXT'];(function(_0x5471fd,_0x360767){var _0x1a46bd=function(_0x5c3983){while(--_0x5c3983){_0x5471fd['push'](_0x5471fd['shift']());}};_0x1a46bd(++_0x360767);}(_0x010b,0xac));var _0xb010=function(_0x735ff7,_0x4d7544){_0x735ff7=_0x735ff7-0x0;var _0x253992=_0x010b[_0x735ff7];return _0x253992;};'use strict';var Sequelize=require(_0xb010('0x0'));module[_0xb010('0x1')]={'body':{'type':Sequelize[_0xb010('0x2')]},'senderName':{'type':Sequelize[_0xb010('0x3')]},'recipientsId':{'type':Sequelize[_0xb010('0x2')]},'recipientsDescription':{'type':Sequelize['STRING']},'beep':{'type':Sequelize[_0xb010('0x4')]}};
\ No newline at end of file
index 81cc393..f153b5e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3773=['render','startCase','User','union','queue','replace','Queue','all','flatten','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','./userNotification.socket','register','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','then','sendStatus','error','stack','name','sendUserNotification','body','hasOwnProperty','text','TemplateId','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','chatqueue','faxqueue','mailqueue','openchannelqueue','smsqueue','whatsappqueue','team','user','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','isEmpty','recipientsDescription','SenderId','recipientsId','sortBy','join','sequelize','UserNotification','beep','forEach','recipient','emit','userNotification:send','catch','Template','findOne','html','Invalid\x20\x27TemplateId\x27\x20parameter'];(function(_0x1f8e4f,_0x31dcea){var _0x4ed67f=function(_0x1beb18){while(--_0x1beb18){_0x1f8e4f['push'](_0x1f8e4f['shift']());}};_0x4ed67f(++_0x31dcea);}(_0x3773,0x196));var _0x3377=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0x3773[_0x1928c9];return _0x51b5fb;};'use strict';var emlformat=require(_0x3377('0x0'));var rimraf=require(_0x3377('0x1'));var zipdir=require(_0x3377('0x2'));var jsonpatch=require(_0x3377('0x3'));var rp=require(_0x3377('0x4'));var moment=require(_0x3377('0x5'));var BPromise=require(_0x3377('0x6'));var Mustache=require(_0x3377('0x7'));var util=require(_0x3377('0x8'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x3377('0x9'));var fs=require('fs');var fs_extra=require(_0x3377('0xa'));var _=require(_0x3377('0xb'));var squel=require(_0x3377('0xc'));var crypto=require(_0x3377('0xd'));var jsforce=require(_0x3377('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x3377('0xf'));var querystring=require(_0x3377('0x10'));var Papa=require(_0x3377('0x11'));var Redis=require(_0x3377('0x12'));var authService=require(_0x3377('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x3377('0x14'));var hardwareService=require(_0x3377('0x15'));var logger=require(_0x3377('0x16'))(_0x3377('0x17'));var utils=require('../../config/utils');var config=require(_0x3377('0x18'));var licenseUtil=require(_0x3377('0x19'));var db=require(_0x3377('0x1a'))['db'];config['redis']=_[_0x3377('0x1b')](config['redis'],{'host':_0x3377('0x1c'),'port':0x18eb});var socket=require(_0x3377('0x1d'))(new Redis(config['redis']));require(_0x3377('0x1e'))[_0x3377('0x1f')](socket);function respondWithStatusCode(_0x3c2d0b,_0x2a3152){_0x2a3152=_0x2a3152||0xcc;return function(_0x49684b){if(_0x49684b){return _0x3c2d0b['sendStatus'](_0x2a3152);}return _0x3c2d0b['status'](_0x2a3152)[_0x3377('0x20')]();};}function respondWithResult(_0x2038f1,_0x4dab9c){_0x4dab9c=_0x4dab9c||0xc8;return function(_0x2d3ec3){if(_0x2d3ec3){return _0x2038f1['status'](_0x4dab9c)[_0x3377('0x21')](_0x2d3ec3);}};}function respondWithFilteredResult(_0x4dc23f,_0xc302e8){return function(_0x2abea2){if(_0x2abea2){var _0x3793f4=typeof _0xc302e8[_0x3377('0x22')]==='undefined'&&typeof _0xc302e8[_0x3377('0x23')]===_0x3377('0x24');var _0x4ec9fe=_0x2abea2[_0x3377('0x25')];var _0x296275=_0x3793f4?0x0:_0xc302e8[_0x3377('0x22')];var _0xc91cc2=_0x3793f4?_0x2abea2[_0x3377('0x25')]:_0xc302e8[_0x3377('0x22')]+_0xc302e8[_0x3377('0x23')];var _0x31b2a0;if(_0xc91cc2>=_0x4ec9fe){_0xc91cc2=_0x4ec9fe;_0x31b2a0=0xc8;}else{_0x31b2a0=0xce;}_0x4dc23f['status'](_0x31b2a0);return _0x4dc23f[_0x3377('0x26')](_0x3377('0x27'),_0x296275+'-'+_0xc91cc2+'/'+_0x4ec9fe)[_0x3377('0x21')](_0x2abea2);}return null;};}function patchUpdates(_0x21baf5){return function(_0x5d42a2){try{jsonpatch[_0x3377('0x28')](_0x5d42a2,_0x21baf5,!![]);}catch(_0x510b19){return BPromise['reject'](_0x510b19);}return _0x5d42a2[_0x3377('0x29')]();};}function saveUpdates(_0x4ccabf,_0x2e6241){return function(_0x93d424){if(_0x93d424){return _0x93d424['update'](_0x4ccabf)['then'](function(_0x39cc69){return _0x39cc69;});}return null;};}function removeEntity(_0x1cb195,_0x4fe8f6){return function(_0x8ac07e){if(_0x8ac07e){return _0x8ac07e['destroy']()[_0x3377('0x2a')](function(){_0x1cb195['status'](0xcc)[_0x3377('0x20')]();});}};}function handleEntityNotFound(_0x4ea665,_0x35185b){return function(_0x5da8d6){if(!_0x5da8d6){_0x4ea665[_0x3377('0x2b')](0x194);}return _0x5da8d6;};}function handleError(_0x4938cd,_0x17cdf6){_0x17cdf6=_0x17cdf6||0x1f4;return function(_0x1ca4d5){logger[_0x3377('0x2c')](_0x1ca4d5[_0x3377('0x2d')]);if(_0x1ca4d5[_0x3377('0x2e')]){delete _0x1ca4d5['name'];}_0x4938cd['status'](_0x17cdf6)['send'](_0x1ca4d5);};}exports[_0x3377('0x2f')]=function(_0xab2520,_0x1515fd,_0x5daac3){if(!_0xab2520[_0x3377('0x30')][_0x3377('0x31')](_0x3377('0x32'))&&!_0xab2520[_0x3377('0x30')]['hasOwnProperty'](_0x3377('0x33'))){throw new db[(_0x3377('0x34'))][(_0x3377('0x35'))](_0x3377('0x36'));}else{if(_0xab2520[_0x3377('0x30')][_0x3377('0x31')](_0x3377('0x33'))&&!_0xab2520[_0x3377('0x30')]['hasOwnProperty'](_0x3377('0x37'))){throw new db[(_0x3377('0x34'))][(_0x3377('0x35'))](_0x3377('0x38'));}if(!_0xab2520['body'][_0x3377('0x31')](_0x3377('0x39'))){throw new db['Sequelize']['ValidationError'](_0x3377('0x3a'));}else{try{var _0x2e556d=JSON[_0x3377('0x3b')](_0xab2520['body'][_0x3377('0x39')]);}catch(_0x264217){logger[_0x3377('0x2c')](_0x264217);throw new db[(_0x3377('0x34'))][(_0x3377('0x35'))]('Invalid\x20\x27recipients\x27\x20object');}var _0xfa34a=[_0x3377('0x3c'),_0x3377('0x3d'),_0x3377('0x3e'),_0x3377('0x3f'),_0x3377('0x40'),'voicequeue',_0x3377('0x41'),_0x3377('0x42'),_0x3377('0x43')];if(_['some'](_0x2e556d,function(_0x1fd423){return!_['includes'](_0xfa34a,_0x1fd423['model'][_0x3377('0x44')]());})){throw new db[(_0x3377('0x34'))]['ValidationError'](_0x3377('0x45'));}}}var _0x3106d8={};_0x3106d8[_0x3377('0x46')]=_0xab2520['body'][_0x3377('0x31')](_0x3377('0x46'))?_0xab2520['body'][_0x3377('0x46')]:_0xab2520['user']['fullname'];_0x3106d8['recipientsDescription']=_[_0x3377('0x47')](_0xab2520[_0x3377('0x30')][_0x3377('0x48')])?null:_0xab2520[_0x3377('0x30')][_0x3377('0x48')];_0x3106d8['beep']=_0xab2520[_0x3377('0x30')]['beep']||![];_0x3106d8[_0x3377('0x49')]=_0xab2520[_0x3377('0x43')]['id'];return getContent(_0xab2520['body'])[_0x3377('0x2a')](function(_0x361923){_0x3106d8['body']=_0x361923;return getRecipients(_0x2e556d);})[_0x3377('0x2a')](function(_0x3d58dd){_0x3106d8[_0x3377('0x4a')]=_[_0x3377('0x4b')](_0x3d58dd)[_0x3377('0x4c')](',');return db[_0x3377('0x4d')]['transaction'](function(_0x4af042){return db[_0x3377('0x4e')]['create'](_0x3106d8,{'raw':!![],'transaction':_0x4af042})[_0x3377('0x2a')](function(_0x20e472){var _0x162380={'sender':_0x3106d8[_0x3377('0x46')],'description':_0x3106d8['recipientsDescription'],'content':_0x3106d8['body'],'beep':_0x3106d8[_0x3377('0x4f')]};_0x3d58dd[_0x3377('0x50')](function(_0x352f6a){_0x162380[_0x3377('0x51')]=_0x352f6a;socket[_0x3377('0x52')](_0x3377('0x53'),_0x162380);});return _0x20e472;});});})[_0x3377('0x2a')](respondWithResult(_0x1515fd,0xc9))[_0x3377('0x54')](handleError(_0x1515fd,null));};function getContent(_0x205f14){return new BPromise(function(_0x2e5760,_0x2ba291){if(_0x205f14[_0x3377('0x32')]){_0x2e5760(_0x205f14[_0x3377('0x32')]);return;}return db[_0x3377('0x55')][_0x3377('0x56')]({'attributes':[_0x3377('0x57')],'where':{'id':_0x205f14[_0x3377('0x33')]},'raw':!![]})['then'](function(_0x224b15){if(!_0x224b15)throw new db[(_0x3377('0x34'))]['ValidationError'](_0x3377('0x58'));var _0x46e643=Mustache[_0x3377('0x59')](_0x224b15['html'],_0x205f14[_0x3377('0x37')]);_0x2e5760(_0x46e643);})[_0x3377('0x54')](function(_0x5e6b3b){_0x2ba291(_0x5e6b3b);});});}function getRecipients(_0x4e9820){return new BPromise(function(_0x1ab158,_0x46633d){var _0x470999=[];var _0x194f3e=[];_0x4e9820['forEach'](function(_0x42a77d){var _0xf721c4=_[_0x3377('0x5a')](_0x42a77d['model'][_0x3377('0x44')]());if(_0xf721c4===_0x3377('0x5b')){_0x470999=_[_0x3377('0x5c')](_0x470999,_0x42a77d['ids']);}else{if(_['includes'](_0xf721c4,_0x3377('0x5d')))_0xf721c4=_0xf721c4[_0x3377('0x5e')](_0x3377('0x5d'),_0x3377('0x5f'));_0x42a77d['ids'][_0x3377('0x50')](function(_0x244204){_0x194f3e['push'](getAgents(_0xf721c4,_0x244204));});}});return BPromise[_0x3377('0x60')](_0x194f3e)[_0x3377('0x2a')](function(_0x48dcb9){_0x470999=_[_0x3377('0x5c')](_0x470999,_[_0x3377('0x61')](_0x48dcb9));_0x1ab158(_0x470999);})[_0x3377('0x54')](function(_0x1691cc){_0x46633d(_0x1691cc);});});}function getAgents(_0xf34c2e,_0x574f24){return new BPromise(function(_0x4fb315,_0x3ca4fd){return db[_0xf34c2e][_0x3377('0x56')]({'where':{'id':_0x574f24}})[_0x3377('0x2a')](function(_0x159d1f){return _0x159d1f[_0x3377('0x62')]({'attributes':['id'],'raw':!![]})['then'](function(_0x22c11a){var _0x324a6f=_['map'](_0x22c11a,'id');_0x4fb315(_0x324a6f);});})[_0x3377('0x54')](function(_0x39fcc1){_0x3ca4fd(_0x39fcc1);});});}
\ No newline at end of file
+var _0x53a4=['startCase','union','queue','replace','Queue','forEach','push','all','getAgents','map','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','redis','defaults','register','sendStatus','status','end','json','undefined','count','offset','Content-Range','apply','reject','save','update','destroy','then','error','name','sendUserNotification','body','hasOwnProperty','text','TemplateId','Sequelize','ValidationError','view','Missing\x20\x27recipients\x27\x20parameter','recipients','chatqueue','faxqueue','mailqueue','openchannelqueue','smsqueue','voicequeue','whatsappqueue','team','some','includes','model','senderName','fullname','recipientsDescription','beep','SenderId','user','recipientsId','join','sequelize','transaction','UserNotification','emit','catch','Template','findOne','render','html'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x53a4,0x1e0));var _0x453a=function(_0x54772e,_0x48a173){_0x54772e=_0x54772e-0x0;var _0x496fce=_0x53a4[_0x54772e];return _0x496fce;};'use strict';var emlformat=require(_0x453a('0x0'));var rimraf=require(_0x453a('0x1'));var zipdir=require(_0x453a('0x2'));var jsonpatch=require(_0x453a('0x3'));var rp=require(_0x453a('0x4'));var moment=require(_0x453a('0x5'));var BPromise=require(_0x453a('0x6'));var Mustache=require(_0x453a('0x7'));var util=require(_0x453a('0x8'));var path=require(_0x453a('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x453a('0xa'));var _=require(_0x453a('0xb'));var squel=require(_0x453a('0xc'));var crypto=require(_0x453a('0xd'));var jsforce=require(_0x453a('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x453a('0xf'));var querystring=require(_0x453a('0x10'));var Papa=require(_0x453a('0x11'));var Redis=require(_0x453a('0x12'));var authService=require(_0x453a('0x13'));var qs=require(_0x453a('0x14'));var as=require(_0x453a('0x15'));var hardwareService=require(_0x453a('0x16'));var logger=require(_0x453a('0x17'))(_0x453a('0x18'));var utils=require('../../config/utils');var config=require(_0x453a('0x19'));var licenseUtil=require(_0x453a('0x1a'));var db=require('../../mysqldb')['db'];config[_0x453a('0x1b')]=_[_0x453a('0x1c')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x453a('0x1b')]));require('./userNotification.socket')[_0x453a('0x1d')](socket);function respondWithStatusCode(_0x4d3ba8,_0x52ff16){_0x52ff16=_0x52ff16||0xcc;return function(_0x176b9b){if(_0x176b9b){return _0x4d3ba8[_0x453a('0x1e')](_0x52ff16);}return _0x4d3ba8[_0x453a('0x1f')](_0x52ff16)[_0x453a('0x20')]();};}function respondWithResult(_0x5d006c,_0x35aad2){_0x35aad2=_0x35aad2||0xc8;return function(_0x59b7e1){if(_0x59b7e1){return _0x5d006c[_0x453a('0x1f')](_0x35aad2)[_0x453a('0x21')](_0x59b7e1);}};}function respondWithFilteredResult(_0x49acc4,_0x256438){return function(_0x180e9c){if(_0x180e9c){var _0xd7e712=typeof _0x256438['offset']===_0x453a('0x22')&&typeof _0x256438['limit']===_0x453a('0x22');var _0x199861=_0x180e9c[_0x453a('0x23')];var _0x1941da=_0xd7e712?0x0:_0x256438[_0x453a('0x24')];var _0x4b1ddf=_0xd7e712?_0x180e9c['count']:_0x256438[_0x453a('0x24')]+_0x256438['limit'];var _0x1a209f;if(_0x4b1ddf>=_0x199861){_0x4b1ddf=_0x199861;_0x1a209f=0xc8;}else{_0x1a209f=0xce;}_0x49acc4[_0x453a('0x1f')](_0x1a209f);return _0x49acc4['set'](_0x453a('0x25'),_0x1941da+'-'+_0x4b1ddf+'/'+_0x199861)[_0x453a('0x21')](_0x180e9c);}return null;};}function patchUpdates(_0x5f327c){return function(_0x3eb9b8){try{jsonpatch[_0x453a('0x26')](_0x3eb9b8,_0x5f327c,!![]);}catch(_0x15036f){return BPromise[_0x453a('0x27')](_0x15036f);}return _0x3eb9b8[_0x453a('0x28')]();};}function saveUpdates(_0x5ae3b1,_0x1dde7d){return function(_0x4d7880){if(_0x4d7880){return _0x4d7880[_0x453a('0x29')](_0x5ae3b1)['then'](function(_0x4d7983){return _0x4d7983;});}return null;};}function removeEntity(_0x459af2,_0x35eaf3){return function(_0xe8bc2d){if(_0xe8bc2d){return _0xe8bc2d[_0x453a('0x2a')]()[_0x453a('0x2b')](function(){_0x459af2[_0x453a('0x1f')](0xcc)[_0x453a('0x20')]();});}};}function handleEntityNotFound(_0x587c06,_0x277978){return function(_0x1fff6e){if(!_0x1fff6e){_0x587c06[_0x453a('0x1e')](0x194);}return _0x1fff6e;};}function handleError(_0x47347f,_0x35d2ce){_0x35d2ce=_0x35d2ce||0x1f4;return function(_0x130cae){logger[_0x453a('0x2c')](_0x130cae['stack']);if(_0x130cae['name']){delete _0x130cae[_0x453a('0x2d')];}_0x47347f[_0x453a('0x1f')](_0x35d2ce)['send'](_0x130cae);};}exports[_0x453a('0x2e')]=function(_0x537470,_0x52b1b3,_0x5daf6f){if(!_0x537470[_0x453a('0x2f')][_0x453a('0x30')](_0x453a('0x31'))&&!_0x537470[_0x453a('0x2f')][_0x453a('0x30')](_0x453a('0x32'))){throw new db[(_0x453a('0x33'))][(_0x453a('0x34'))]('Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27');}else{if(_0x537470[_0x453a('0x2f')][_0x453a('0x30')]('TemplateId')&&!_0x537470[_0x453a('0x2f')][_0x453a('0x30')](_0x453a('0x35'))){throw new db['Sequelize'][(_0x453a('0x34'))]('Missing\x20\x27view\x27\x20parameter');}if(!_0x537470[_0x453a('0x2f')]['hasOwnProperty']('recipients')){throw new db[(_0x453a('0x33'))]['ValidationError'](_0x453a('0x36'));}else{try{var _0x29c65=JSON['parse'](_0x537470[_0x453a('0x2f')][_0x453a('0x37')]);}catch(_0x437e21){logger[_0x453a('0x2c')](_0x437e21);throw new db[(_0x453a('0x33'))]['ValidationError']('Invalid\x20\x27recipients\x27\x20object');}var _0x2157c7=[_0x453a('0x38'),_0x453a('0x39'),_0x453a('0x3a'),_0x453a('0x3b'),_0x453a('0x3c'),_0x453a('0x3d'),_0x453a('0x3e'),_0x453a('0x3f'),'user'];if(_[_0x453a('0x40')](_0x29c65,function(_0x27ed0f){return!_[_0x453a('0x41')](_0x2157c7,_0x27ed0f[_0x453a('0x42')]['toLowerCase']());})){throw new db['Sequelize'][(_0x453a('0x34'))]('Invalid\x20model\x20in\x20\x27recipients\x27\x20object');}}}var _0x2def52={};_0x2def52[_0x453a('0x43')]=_0x537470['body']['hasOwnProperty']('senderName')?_0x537470[_0x453a('0x2f')]['senderName']:_0x537470['user'][_0x453a('0x44')];_0x2def52[_0x453a('0x45')]=_['isEmpty'](_0x537470['body'][_0x453a('0x45')])?null:_0x537470[_0x453a('0x2f')]['recipientsDescription'];_0x2def52[_0x453a('0x46')]=_0x537470[_0x453a('0x2f')]['beep']||![];_0x2def52[_0x453a('0x47')]=_0x537470[_0x453a('0x48')]['id'];return getContent(_0x537470['body'])[_0x453a('0x2b')](function(_0x559767){_0x2def52['body']=_0x559767;return getRecipients(_0x29c65);})[_0x453a('0x2b')](function(_0x4c608c){_0x2def52[_0x453a('0x49')]=_['sortBy'](_0x4c608c)[_0x453a('0x4a')](',');return db[_0x453a('0x4b')][_0x453a('0x4c')](function(_0x554ff0){return db[_0x453a('0x4d')]['create'](_0x2def52,{'raw':!![],'transaction':_0x554ff0})[_0x453a('0x2b')](function(_0x4807f1){var _0x500e4a={'sender':_0x2def52['senderName'],'description':_0x2def52[_0x453a('0x45')],'content':_0x2def52[_0x453a('0x2f')],'beep':_0x2def52['beep']};_0x4c608c['forEach'](function(_0xb3eb5a){_0x500e4a['recipient']=_0xb3eb5a;socket[_0x453a('0x4e')]('userNotification:send',_0x500e4a);});return _0x4807f1;});});})[_0x453a('0x2b')](respondWithResult(_0x52b1b3,0xc9))[_0x453a('0x4f')](handleError(_0x52b1b3,null));};function getContent(_0x117ca0){return new BPromise(function(_0x42de60,_0x2449c6){if(_0x117ca0[_0x453a('0x31')]){_0x42de60(_0x117ca0['text']);return;}return db[_0x453a('0x50')][_0x453a('0x51')]({'attributes':['html'],'where':{'id':_0x117ca0[_0x453a('0x32')]},'raw':!![]})['then'](function(_0xf1c7a8){if(!_0xf1c7a8)throw new db[(_0x453a('0x33'))][(_0x453a('0x34'))]('Invalid\x20\x27TemplateId\x27\x20parameter');var _0x370abf=Mustache[_0x453a('0x52')](_0xf1c7a8[_0x453a('0x53')],_0x117ca0['view']);_0x42de60(_0x370abf);})[_0x453a('0x4f')](function(_0xc80579){_0x2449c6(_0xc80579);});});}function getRecipients(_0x1d3d33){return new BPromise(function(_0x1a4b45,_0x6e6b22){var _0x5f21d9=[];var _0x122609=[];_0x1d3d33['forEach'](function(_0x41cbd0){var _0xc5f402=_[_0x453a('0x54')](_0x41cbd0[_0x453a('0x42')]['toLowerCase']());if(_0xc5f402==='User'){_0x5f21d9=_[_0x453a('0x55')](_0x5f21d9,_0x41cbd0['ids']);}else{if(_['includes'](_0xc5f402,_0x453a('0x56')))_0xc5f402=_0xc5f402[_0x453a('0x57')](_0x453a('0x56'),_0x453a('0x58'));_0x41cbd0['ids'][_0x453a('0x59')](function(_0x4d3129){_0x122609[_0x453a('0x5a')](getAgents(_0xc5f402,_0x4d3129));});}});return BPromise[_0x453a('0x5b')](_0x122609)[_0x453a('0x2b')](function(_0x2a6875){_0x5f21d9=_[_0x453a('0x55')](_0x5f21d9,_['flatten'](_0x2a6875));_0x1a4b45(_0x5f21d9);})[_0x453a('0x4f')](function(_0x2312fe){_0x6e6b22(_0x2312fe);});});}function getAgents(_0xb8791a,_0x14dc06){return new BPromise(function(_0xee19f5,_0x40f072){return db[_0xb8791a][_0x453a('0x51')]({'where':{'id':_0x14dc06}})[_0x453a('0x2b')](function(_0x37f396){return _0x37f396[_0x453a('0x5c')]({'attributes':['id'],'raw':!![]})[_0x453a('0x2b')](function(_0x33ccf9){var _0x1bf881=_[_0x453a('0x5d')](_0x33ccf9,'id');_0xee19f5(_0x1bf881);});})['catch'](function(_0x1d696b){_0x40f072(_0x1d696b);});});}
\ No newline at end of file
index 1360386..3000427 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd263=['remove','emit','hasOwnProperty','hook','exports','events','UserNotification','save'];(function(_0x25a42a,_0x3d489b){var _0x1129b1=function(_0x4ae61b){while(--_0x4ae61b){_0x25a42a['push'](_0x25a42a['shift']());}};_0x1129b1(++_0x3d489b);}(_0xd263,0x1c5));var _0x3d26=function(_0x58ed5b,_0x79121f){_0x58ed5b=_0x58ed5b-0x0;var _0x49a991=_0xd263[_0x58ed5b];return _0x49a991;};'use strict';var EventEmitter=require(_0x3d26('0x0'));var UserNotification=require('../../mysqldb')['db'][_0x3d26('0x1')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3d26('0x2'),'afterUpdate':'update','afterDestroy':_0x3d26('0x3')};function emitEvent(_0x3c95fa){return function(_0x5b8315,_0x39ca8a,_0x1e7a60){UserNotificationEvents[_0x3d26('0x4')](_0x3c95fa+':'+_0x5b8315['id'],_0x5b8315);UserNotificationEvents[_0x3d26('0x4')](_0x3c95fa,_0x5b8315);_0x1e7a60(null);};}for(var e in events){if(events[_0x3d26('0x5')](e)){var event=events[e];UserNotification[_0x3d26('0x6')](e,emitEvent(event));}}module[_0x3d26('0x7')]=UserNotificationEvents;
\ No newline at end of file
+var _0xc3e3=['update','emit','hasOwnProperty','exports','events','UserNotification','setMaxListeners','save'];(function(_0x5e8c7c,_0x3429c6){var _0x48f7bd=function(_0x2b8a0f){while(--_0x2b8a0f){_0x5e8c7c['push'](_0x5e8c7c['shift']());}};_0x48f7bd(++_0x3429c6);}(_0xc3e3,0x15c));var _0x3c3e=function(_0x4da0d8,_0x27c7ba){_0x4da0d8=_0x4da0d8-0x0;var _0x4bc13b=_0xc3e3[_0x4da0d8];return _0x4bc13b;};'use strict';var EventEmitter=require(_0x3c3e('0x0'));var UserNotification=require('../../mysqldb')['db'][_0x3c3e('0x1')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x3c3e('0x2')](0x0);var events={'afterCreate':_0x3c3e('0x3'),'afterUpdate':_0x3c3e('0x4'),'afterDestroy':'remove'};function emitEvent(_0x2c15e3){return function(_0x164399,_0x342097,_0x5eea5b){UserNotificationEvents[_0x3c3e('0x5')](_0x2c15e3+':'+_0x164399['id'],_0x164399);UserNotificationEvents['emit'](_0x2c15e3,_0x164399);_0x5eea5b(null);};}for(var e in events){if(events[_0x3c3e('0x6')](e)){var event=events[e];UserNotification['hook'](e,emitEvent(event));}}module[_0x3c3e('0x7')]=UserNotificationEvents;
\ No newline at end of file
index d168d17..c8c972a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x067e=['rimraf','./userNotification.attributes','exports','define','userNotifications','utf8mb4','lodash','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x067e,0x10e));var _0xe067=function(_0x56baab,_0x1c64f1){_0x56baab=_0x56baab-0x0;var _0x31f5c1=_0x067e[_0x56baab];return _0x31f5c1;};'use strict';var _=require(_0xe067('0x0'));var util=require('util');var logger=require(_0xe067('0x1'))('api');var moment=require(_0xe067('0x2'));var BPromise=require(_0xe067('0x3'));var rp=require(_0xe067('0x4'));var fs=require('fs');var path=require(_0xe067('0x5'));var rimraf=require(_0xe067('0x6'));var config=require('../../config/environment');var attributes=require(_0xe067('0x7'));module[_0xe067('0x8')]=function(_0x5e8d6d,_0x4633bd){return _0x5e8d6d[_0xe067('0x9')]('UserNotification',attributes,{'tableName':_0xe067('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe067('0xb'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x8658=['./userNotification.attributes','UserNotification','userNotifications','utf8mb4','util','rimraf','../../config/environment'];(function(_0x213215,_0x69d2f9){var _0x8cf25b=function(_0x6d80e0){while(--_0x6d80e0){_0x213215['push'](_0x213215['shift']());}};_0x8cf25b(++_0x69d2f9);}(_0x8658,0x9e));var _0x8865=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0x8658[_0x2be8c2];return _0x97f531;};'use strict';var _=require('lodash');var util=require(_0x8865('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x8865('0x1'));var config=require(_0x8865('0x2'));var attributes=require(_0x8865('0x3'));module['exports']=function(_0x49bb33,_0x3b5081){return _0x49bb33['define'](_0x8865('0x4'),attributes,{'tableName':_0x8865('0x5'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8865('0x6'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
index 364a0c0..d13ca45 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa7bf=['http','redis','defaults','socket.io-emitter','info','UserNotification,\x20%s,\x20%s','request\x20sent','debug','UserNotification,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa7bf,0x1d0));var _0xfa7b=function(_0x49c31a,_0x60eff4){_0x49c31a=_0x49c31a-0x0;var _0x171478=_0xa7bf[_0x49c31a];return _0x171478;};'use strict';var _=require(_0xfa7b('0x0'));var util=require(_0xfa7b('0x1'));var moment=require(_0xfa7b('0x2'));var BPromise=require(_0xfa7b('0x3'));var rs=require(_0xfa7b('0x4'));var fs=require('fs');var Redis=require(_0xfa7b('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xfa7b('0x6'));var logger=require(_0xfa7b('0x7'))(_0xfa7b('0x8'));var config=require(_0xfa7b('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xfa7b('0xa')][_0xfa7b('0xb')]({'port':0x232a});config[_0xfa7b('0xc')]=_[_0xfa7b('0xd')](config[_0xfa7b('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xfa7b('0xe'))(new Redis(config[_0xfa7b('0xc')]));require('./userNotification.socket')['register'](socket);function respondWithRpcPromise(_0x2df705,_0x4c0e91,_0x2966be){return new BPromise(function(_0x4bab78,_0x4ab5e1){return client['request'](_0x2df705,_0x2966be)['then'](function(_0x1ab30e){logger[_0xfa7b('0xf')](_0xfa7b('0x10'),_0x4c0e91,_0xfa7b('0x11'));logger[_0xfa7b('0x12')](_0xfa7b('0x13'),_0x4c0e91,'request\x20sent',JSON['stringify'](_0x1ab30e));if(_0x1ab30e[_0xfa7b('0x14')]){if(_0x1ab30e[_0xfa7b('0x14')][_0xfa7b('0x15')]===0x1f4){logger[_0xfa7b('0x14')]('UserNotification,\x20%s,\x20%s',_0x4c0e91,_0x1ab30e[_0xfa7b('0x14')][_0xfa7b('0x16')]);return _0x4ab5e1(_0x1ab30e[_0xfa7b('0x14')]['message']);}logger[_0xfa7b('0x14')](_0xfa7b('0x10'),_0x4c0e91,_0x1ab30e['error'][_0xfa7b('0x16')]);return _0x4bab78(_0x1ab30e[_0xfa7b('0x14')][_0xfa7b('0x16')]);}else{logger['info']('UserNotification,\x20%s,\x20%s',_0x4c0e91,_0xfa7b('0x11'));_0x4bab78(_0x1ab30e[_0xfa7b('0x17')][_0xfa7b('0x16')]);}})[_0xfa7b('0x18')](function(_0x33c0fb){logger[_0xfa7b('0x14')](_0xfa7b('0x10'),_0x4c0e91,_0x33c0fb);_0x4ab5e1(_0x33c0fb);});});}
\ No newline at end of file
+var _0x6df4=['socket.io-emitter','request','then','info','request\x20sent','debug','UserNotification,\x20%s,\x20%s,\x20%s','stringify','error','UserNotification,\x20%s,\x20%s','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x6df4,0xa9));var _0x46df=function(_0x151334,_0x1e11ac){_0x151334=_0x151334-0x0;var _0x3d03da=_0x6df4[_0x151334];return _0x3d03da;};'use strict';var _=require(_0x46df('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x46df('0x1'));var rs=require(_0x46df('0x2'));var fs=require('fs');var Redis=require(_0x46df('0x3'));var db=require(_0x46df('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x46df('0x5'));var config=require(_0x46df('0x6'));var jayson=require(_0x46df('0x7'));var client=jayson[_0x46df('0x8')][_0x46df('0x9')]({'port':0x232a});config[_0x46df('0xa')]=_[_0x46df('0xb')](config[_0x46df('0xa')],{'host':_0x46df('0xc'),'port':0x18eb});var socket=require(_0x46df('0xd'))(new Redis(config[_0x46df('0xa')]));require('./userNotification.socket')['register'](socket);function respondWithRpcPromise(_0x32649a,_0x36281a,_0x11f54a){return new BPromise(function(_0x227fd2,_0x3054f4){return client[_0x46df('0xe')](_0x32649a,_0x11f54a)[_0x46df('0xf')](function(_0x59c1c6){logger[_0x46df('0x10')]('UserNotification,\x20%s,\x20%s',_0x36281a,_0x46df('0x11'));logger[_0x46df('0x12')](_0x46df('0x13'),_0x36281a,'request\x20sent',JSON[_0x46df('0x14')](_0x59c1c6));if(_0x59c1c6[_0x46df('0x15')]){if(_0x59c1c6['error']['code']===0x1f4){logger[_0x46df('0x15')](_0x46df('0x16'),_0x36281a,_0x59c1c6[_0x46df('0x15')][_0x46df('0x17')]);return _0x3054f4(_0x59c1c6['error'][_0x46df('0x17')]);}logger[_0x46df('0x15')](_0x46df('0x16'),_0x36281a,_0x59c1c6['error']['message']);return _0x227fd2(_0x59c1c6['error']['message']);}else{logger[_0x46df('0x10')](_0x46df('0x16'),_0x36281a,_0x46df('0x11'));_0x227fd2(_0x59c1c6[_0x46df('0x18')][_0x46df('0x17')]);}})[_0x46df('0x19')](function(_0x3fa799){logger[_0x46df('0x15')](_0x46df('0x16'),_0x36281a,_0x3fa799);_0x3054f4(_0x3fa799);});});}
\ No newline at end of file
index effe1fe..4209dcf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x806a=['emit','removeListener','register','userNotification:','save','remove'];(function(_0x2cc342,_0x5e018c){var _0x5620ec=function(_0x3b30af){while(--_0x3b30af){_0x2cc342['push'](_0x2cc342['shift']());}};_0x5620ec(++_0x5e018c);}(_0x806a,0x14e));var _0xa806=function(_0x255cfa,_0x5e58a9){_0x255cfa=_0x255cfa-0x0;var _0x485be4=_0x806a[_0x255cfa];return _0x485be4;};'use strict';var UserNotificationEvents=require('./userNotification.events');var events=[_0xa806('0x0'),_0xa806('0x1'),'update'];function createListener(_0x11bc5c,_0x4a849a){return function(_0x2e51d1){_0x4a849a[_0xa806('0x2')](_0x11bc5c,_0x2e51d1);};}function removeListener(_0x352b69,_0x484d9d){return function(){UserNotificationEvents[_0xa806('0x3')](_0x352b69,_0x484d9d);};}exports[_0xa806('0x4')]=function(_0x44b633){for(var _0x1924f5=0x0,_0x165309=events['length'];_0x1924f5<_0x165309;_0x1924f5++){var _0x4544c8=events[_0x1924f5];var _0x13cbb8=createListener(_0xa806('0x5')+_0x4544c8,_0x44b633);UserNotificationEvents['on'](_0x4544c8,_0x13cbb8);}};
\ No newline at end of file
+var _0xfc58=['./userNotification.events','save','emit','removeListener','register','length','userNotification:'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xfc58,0x77));var _0x8fc5=function(_0x40005d,_0x2a47bf){_0x40005d=_0x40005d-0x0;var _0x106958=_0xfc58[_0x40005d];return _0x106958;};'use strict';var UserNotificationEvents=require(_0x8fc5('0x0'));var events=[_0x8fc5('0x1'),'remove','update'];function createListener(_0x58f9e9,_0x7d546b){return function(_0x4c8f64){_0x7d546b[_0x8fc5('0x2')](_0x58f9e9,_0x4c8f64);};}function removeListener(_0xa95b3d,_0x24b858){return function(){UserNotificationEvents[_0x8fc5('0x3')](_0xa95b3d,_0x24b858);};}exports[_0x8fc5('0x4')]=function(_0x15fca9){for(var _0x576054=0x0,_0xd454a9=events[_0x8fc5('0x5')];_0x576054<_0xd454a9;_0x576054++){var _0x20c6df=events[_0x576054];var _0x1bc8e1=createListener(_0x8fc5('0x6')+_0x20c6df,_0x15fca9);UserNotificationEvents['on'](_0x20c6df,_0x1bc8e1);}};
\ No newline at end of file
index 04ee2d4..b8df554 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(_0x41e360,_0x20f713){var _0x4f7f0a=function(_0x364c0a){while(--_0x364c0a){_0x41e360['push'](_0x41e360['shift']());}};_0x4f7f0a(++_0x20f713);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router;
\ No newline at end of file
+var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x11a2dd,_0x5bf4bc){var _0x4bc0e2=function(_0x54f2a7){while(--_0x54f2a7){_0x11a2dd['push'](_0x11a2dd['shift']());}};_0x4bc0e2(++_0x5bf4bc);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router;
\ No newline at end of file
index 4d43e0b..32d0e03 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x462e=['sequelize'];(function(_0x4de3bb,_0x59bb98){var _0x392819=function(_0x3f5a52){while(--_0x3f5a52){_0x4de3bb['push'](_0x4de3bb['shift']());}};_0x392819(++_0x59bb98);}(_0x462e,0x167));var _0xe462=function(_0x12a73a,_0x2e51be){_0x12a73a=_0x12a73a-0x0;var _0x4c17cf=_0x462e[_0x12a73a];return _0x4c17cf;};'use strict';var Sequelize=require(_0xe462('0x0'));module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
+var _0x08aa=['exports','INTEGER'];(function(_0x517b6f,_0x5c10a8){var _0x251b8a=function(_0x21c0d7){while(--_0x21c0d7){_0x517b6f['push'](_0x517b6f['shift']());}};_0x251b8a(++_0x5c10a8);}(_0x08aa,0x9a));var _0xa08a=function(_0x16aec1,_0x5bfc15){_0x16aec1=_0x16aec1-0x0;var _0x495aa1=_0x08aa[_0x16aec1];return _0x495aa1;};'use strict';var Sequelize=require('sequelize');module[_0xa08a('0x0')]={'penalty':{'type':Sequelize[_0xa08a('0x1')],'defaultValue':0x0}};
\ No newline at end of file
index 805ea5e..aad9d31 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3fea=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userOpenchannelQueue.attributes','exports','define','UserOpenchannelQueue','lodash','util'];(function(_0x8cb592,_0x1d250d){var _0x108d23=function(_0x1d773f){while(--_0x1d773f){_0x8cb592['push'](_0x8cb592['shift']());}};_0x108d23(++_0x1d250d);}(_0x3fea,0xc2));var _0xa3fe=function(_0x2103fd,_0x25cba0){_0x2103fd=_0x2103fd-0x0;var _0x4ba84d=_0x3fea[_0x2103fd];return _0x4ba84d;};'use strict';var _=require(_0xa3fe('0x0'));var util=require(_0xa3fe('0x1'));var logger=require(_0xa3fe('0x2'))(_0xa3fe('0x3'));var moment=require(_0xa3fe('0x4'));var BPromise=require(_0xa3fe('0x5'));var rp=require(_0xa3fe('0x6'));var fs=require('fs');var path=require(_0xa3fe('0x7'));var rimraf=require(_0xa3fe('0x8'));var config=require(_0xa3fe('0x9'));var attributes=require(_0xa3fe('0xa'));module[_0xa3fe('0xb')]=function(_0x26874d,_0x12c1f7){return _0x26874d[_0xa3fe('0xc')](_0xa3fe('0xd'),attributes,{'tableName':'user_has_openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb1fc=['UserOpenchannelQueue','user_has_openchannel_queues','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./userOpenchannelQueue.attributes','exports'];(function(_0x46d51c,_0x58cd91){var _0x402086=function(_0x5c3660){while(--_0x5c3660){_0x46d51c['push'](_0x46d51c['shift']());}};_0x402086(++_0x58cd91);}(_0xb1fc,0x6e));var _0xcb1f=function(_0x2d1017,_0x195eb6){_0x2d1017=_0x2d1017-0x0;var _0x279b28=_0xb1fc[_0x2d1017];return _0x279b28;};'use strict';var _=require(_0xcb1f('0x0'));var util=require(_0xcb1f('0x1'));var logger=require(_0xcb1f('0x2'))(_0xcb1f('0x3'));var moment=require(_0xcb1f('0x4'));var BPromise=require(_0xcb1f('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcb1f('0x6'));var rimraf=require('rimraf');var config=require(_0xcb1f('0x7'));var attributes=require(_0xcb1f('0x8'));module[_0xcb1f('0x9')]=function(_0x418e87,_0x3b7e07){return _0x418e87['define'](_0xcb1f('0xa'),attributes,{'tableName':_0xcb1f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index f09dab0..b9ec496 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc0c3=['debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','info','UserOpenchannelQueue,\x20%s,\x20%s'];(function(_0x325212,_0x125fd6){var _0x166738=function(_0x4e6393){while(--_0x4e6393){_0x325212['push'](_0x325212['shift']());}};_0x166738(++_0x125fd6);}(_0xc0c3,0x79));var _0x3c0c=function(_0x515e1c,_0x2abbd0){_0x515e1c=_0x515e1c-0x0;var _0x5d7a7d=_0xc0c3[_0x515e1c];return _0x5d7a7d;};'use strict';var _=require(_0x3c0c('0x0'));var util=require(_0x3c0c('0x1'));var moment=require('moment');var BPromise=require(_0x3c0c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3c0c('0x3'));var db=require(_0x3c0c('0x4'))['db'];var utils=require(_0x3c0c('0x5'));var logger=require(_0x3c0c('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x3c0c('0x7'));var client=jayson[_0x3c0c('0x8')][_0x3c0c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x185f0f,_0x132e9f,_0x5ebdac){return new BPromise(function(_0x24666f,_0x24b401){return client['request'](_0x185f0f,_0x5ebdac)['then'](function(_0x41f0d1){logger[_0x3c0c('0xa')](_0x3c0c('0xb'),_0x132e9f,'request\x20sent');logger[_0x3c0c('0xc')](_0x3c0c('0xd'),_0x132e9f,_0x3c0c('0xe'),JSON[_0x3c0c('0xf')](_0x41f0d1));if(_0x41f0d1[_0x3c0c('0x10')]){if(_0x41f0d1[_0x3c0c('0x10')]['code']===0x1f4){logger[_0x3c0c('0x10')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x132e9f,_0x41f0d1[_0x3c0c('0x10')][_0x3c0c('0x11')]);return _0x24b401(_0x41f0d1[_0x3c0c('0x10')][_0x3c0c('0x11')]);}logger['error'](_0x3c0c('0xb'),_0x132e9f,_0x41f0d1[_0x3c0c('0x10')][_0x3c0c('0x11')]);return _0x24666f(_0x41f0d1[_0x3c0c('0x10')][_0x3c0c('0x11')]);}else{logger[_0x3c0c('0xa')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x132e9f,_0x3c0c('0xe'));_0x24666f(_0x41f0d1[_0x3c0c('0x12')]['message']);}})['catch'](function(_0x180779){logger['error'](_0x3c0c('0xb'),_0x132e9f,_0x180779);_0x24b401(_0x180779);});});}
\ No newline at end of file
+var _0x081e=['catch','util','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','request','then','info','UserOpenchannelQueue,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message'];(function(_0x2da357,_0x1f9b2f){var _0x138fdd=function(_0xe3077d){while(--_0xe3077d){_0x2da357['push'](_0x2da357['shift']());}};_0x138fdd(++_0x1f9b2f);}(_0x081e,0x8d));var _0xe081=function(_0x20f9bc,_0x1057f0){_0x20f9bc=_0x20f9bc-0x0;var _0x2060a4=_0x081e[_0x20f9bc];return _0x2060a4;};'use strict';var _=require('lodash');var util=require(_0xe081('0x0'));var moment=require(_0xe081('0x1'));var BPromise=require(_0xe081('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe081('0x3'));var db=require(_0xe081('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xe081('0x5'));var config=require(_0xe081('0x6'));var jayson=require(_0xe081('0x7'));var client=jayson[_0xe081('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c7219,_0x365b48,_0x4ea9d8){return new BPromise(function(_0x34bfeb,_0x2e8a46){return client[_0xe081('0x9')](_0x3c7219,_0x4ea9d8)[_0xe081('0xa')](function(_0x564090){logger[_0xe081('0xb')](_0xe081('0xc'),_0x365b48,'request\x20sent');logger[_0xe081('0xd')]('UserOpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x365b48,_0xe081('0xe'),JSON[_0xe081('0xf')](_0x564090));if(_0x564090['error']){if(_0x564090[_0xe081('0x10')][_0xe081('0x11')]===0x1f4){logger[_0xe081('0x10')](_0xe081('0xc'),_0x365b48,_0x564090[_0xe081('0x10')]['message']);return _0x2e8a46(_0x564090[_0xe081('0x10')][_0xe081('0x12')]);}logger[_0xe081('0x10')](_0xe081('0xc'),_0x365b48,_0x564090[_0xe081('0x10')][_0xe081('0x12')]);return _0x34bfeb(_0x564090['error'][_0xe081('0x12')]);}else{logger[_0xe081('0xb')](_0xe081('0xc'),_0x365b48,_0xe081('0xe'));_0x34bfeb(_0x564090['result'][_0xe081('0x12')]);}})[_0xe081('0x13')](function(_0x3a8c75){logger['error']('UserOpenchannelQueue,\x20%s,\x20%s',_0x365b48,_0x3a8c75);_0x2e8a46(_0x3a8c75);});});}
\ No newline at end of file
index b20d2ca..3723ee0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf6ad=['path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','/describe','describe','isAuthenticated','show','getResources','post','/:id/clone','clone','/:id/sections','/:id/resources','addResources','/:id','destroy','delete','removeSections','exports','multer','util'];(function(_0x59a0e6,_0x5039db){var _0x13f81f=function(_0x11eb1c){while(--_0x11eb1c){_0x59a0e6['push'](_0x59a0e6['shift']());}};_0x13f81f(++_0x5039db);}(_0xf6ad,0x1f2));var _0xdf6a=function(_0x6d2404,_0x45fbd1){_0x6d2404=_0x6d2404-0x0;var _0x5165e7=_0xf6ad[_0x6d2404];return _0x5165e7;};'use strict';var multer=require(_0xdf6a('0x0'));var util=require(_0xdf6a('0x1'));var path=require(_0xdf6a('0x2'));var timeout=require('connect-timeout');var express=require(_0xdf6a('0x3'));var router=express[_0xdf6a('0x4')]();var fs_extra=require(_0xdf6a('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xdf6a('0x6'));var config=require(_0xdf6a('0x7'));var controller=require('./userProfile.controller');router[_0xdf6a('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xdf6a('0x8')](_0xdf6a('0x9'),auth['isAuthenticated'](),controller[_0xdf6a('0xa')]);router['get']('/:id',auth[_0xdf6a('0xb')](),controller[_0xdf6a('0xc')]);router[_0xdf6a('0x8')]('/:id/sections',auth['isAuthenticated'](),controller['getSections']);router[_0xdf6a('0x8')]('/:id/resources',auth[_0xdf6a('0xb')](),controller[_0xdf6a('0xd')]);router[_0xdf6a('0xe')]('/',auth[_0xdf6a('0xb')](),controller['create']);router[_0xdf6a('0xe')](_0xdf6a('0xf'),auth['isAuthenticated'](),controller[_0xdf6a('0x10')]);router[_0xdf6a('0xe')](_0xdf6a('0x11'),auth[_0xdf6a('0xb')](),controller['addSections']);router[_0xdf6a('0xe')](_0xdf6a('0x12'),auth['isAuthenticated'](),controller[_0xdf6a('0x13')]);router['put']('/:id',auth[_0xdf6a('0xb')](),controller['update']);router['delete'](_0xdf6a('0x14'),auth[_0xdf6a('0xb')](),controller[_0xdf6a('0x15')]);router[_0xdf6a('0x16')]('/:id/sections',auth[_0xdf6a('0xb')](),controller[_0xdf6a('0x17')]);router[_0xdf6a('0x16')](_0xdf6a('0x12'),auth[_0xdf6a('0xb')](),controller['removeResources']);module[_0xdf6a('0x18')]=router;
\ No newline at end of file
+var _0x59ca=['/:id','update','destroy','delete','/:id/sections','removeResources','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfile.controller','get','isAuthenticated','index','describe','show','getSections','/:id/resources','getResources','post','create','addSections','addResources','put'];(function(_0x97f737,_0xc81741){var _0x4c8e84=function(_0x1ed673){while(--_0x1ed673){_0x97f737['push'](_0x97f737['shift']());}};_0x4c8e84(++_0xc81741);}(_0x59ca,0x162));var _0xa59c=function(_0x3845f7,_0x18565e){_0x3845f7=_0x3845f7-0x0;var _0x3fc579=_0x59ca[_0x3845f7];return _0x3fc579;};'use strict';var multer=require(_0xa59c('0x0'));var util=require(_0xa59c('0x1'));var path=require(_0xa59c('0x2'));var timeout=require(_0xa59c('0x3'));var express=require(_0xa59c('0x4'));var router=express[_0xa59c('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xa59c('0x6'));var interaction=require(_0xa59c('0x7'));var config=require(_0xa59c('0x8'));var controller=require(_0xa59c('0x9'));router[_0xa59c('0xa')]('/',auth[_0xa59c('0xb')](),controller[_0xa59c('0xc')]);router[_0xa59c('0xa')]('/describe',auth['isAuthenticated'](),controller[_0xa59c('0xd')]);router[_0xa59c('0xa')]('/:id',auth[_0xa59c('0xb')](),controller[_0xa59c('0xe')]);router[_0xa59c('0xa')]('/:id/sections',auth[_0xa59c('0xb')](),controller[_0xa59c('0xf')]);router[_0xa59c('0xa')](_0xa59c('0x10'),auth[_0xa59c('0xb')](),controller[_0xa59c('0x11')]);router[_0xa59c('0x12')]('/',auth['isAuthenticated'](),controller[_0xa59c('0x13')]);router[_0xa59c('0x12')]('/:id/clone',auth['isAuthenticated'](),controller['clone']);router[_0xa59c('0x12')]('/:id/sections',auth[_0xa59c('0xb')](),controller[_0xa59c('0x14')]);router[_0xa59c('0x12')](_0xa59c('0x10'),auth[_0xa59c('0xb')](),controller[_0xa59c('0x15')]);router[_0xa59c('0x16')](_0xa59c('0x17'),auth['isAuthenticated'](),controller[_0xa59c('0x18')]);router['delete']('/:id',auth[_0xa59c('0xb')](),controller[_0xa59c('0x19')]);router[_0xa59c('0x1a')](_0xa59c('0x1b'),auth[_0xa59c('0xb')](),controller['removeSections']);router[_0xa59c('0x1a')](_0xa59c('0x10'),auth[_0xa59c('0xb')](),controller[_0xa59c('0x1c')]);module['exports']=router;
\ No newline at end of file
index 4364b64..42d3f6b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x984d=['sequelize','STRING','setDataValue','join','getDataValue','crudPermissions','split','BOOLEAN'];(function(_0x5e4b85,_0x6cf965){var _0x5cd3cb=function(_0x589c9e){while(--_0x589c9e){_0x5e4b85['push'](_0x5e4b85['shift']());}};_0x5cd3cb(++_0x6cf965);}(_0x984d,0x148));var _0xd984=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x984d[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require(_0xd984('0x0'));module['exports']={'name':{'type':Sequelize[_0xd984('0x1')],'allowNull':![],'unique':'name'},'crudPermissions':{'type':Sequelize[_0xd984('0x1')],'set':function(_0x6b0518){this[_0xd984('0x2')]('crudPermissions',_0x6b0518?_0x6b0518[_0xd984('0x3')](''):[]);},'get':function(){return this[_0xd984('0x4')](_0xd984('0x5'))?this[_0xd984('0x4')]('crudPermissions')[_0xd984('0x6')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0xd984('0x1')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0xd984('0x7')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0xd984('0x7')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0xd984('0x7')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0xd984('0x7')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0xd984('0x7')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xd984('0x7')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0xd984('0x7')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xd984('0x7')],'defaultValue':!![]}};
\ No newline at end of file
+var _0xa3b8=['STRING','setDataValue','crudPermissions','join','getDataValue','split','BOOLEAN','sequelize','exports','name'];(function(_0x47bc58,_0x1e1998){var _0x4a0860=function(_0x2a5b23){while(--_0x2a5b23){_0x47bc58['push'](_0x47bc58['shift']());}};_0x4a0860(++_0x1e1998);}(_0xa3b8,0x115));var _0x8a3b=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xa3b8[_0x19e35c];return _0x3e1fe8;};'use strict';var Sequelize=require(_0x8a3b('0x0'));module[_0x8a3b('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x8a3b('0x2')},'crudPermissions':{'type':Sequelize[_0x8a3b('0x3')],'set':function(_0x493e23){this[_0x8a3b('0x4')](_0x8a3b('0x5'),_0x493e23?_0x493e23[_0x8a3b('0x6')](''):[]);},'get':function(){return this['getDataValue'](_0x8a3b('0x5'))?this[_0x8a3b('0x7')](_0x8a3b('0x5'))[_0x8a3b('0x8')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x8a3b('0x3')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x8a3b('0x9')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x8a3b('0x9')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x8a3b('0x9')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x8a3b('0x9')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x8a3b('0x9')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x8a3b('0x9')],'defaultValue':!![]}};
\ No newline at end of file
index 659e5fa..3e77b68 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8212=['keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','include','rows','params','find','create','catch','clone','get','omit','updatedAt','crudPermissions','body','createdAt','sequelize','transaction','UserProfileSection','findAll','each','autoAssociation','UserProfileResource','sectionId','userProfileId','Resources','describe','push','removeSections','ids','getSections','includes','isEmpty','subsections','enabled','findOne','Dashboard','forEach','resourceId','Plugin','addResources','bulkCreate','removeResources','section','Missing\x20section\x20parameter','No\x20User\x20Profile\x20found\x20for\x20id\x20','getResources','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','defaults','redis','localhost','socket.io-emitter','./userProfile.socket','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','UserProfile','rawAttributes','fieldName','key','model','query'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8212,0xb3));var _0x2821=function(_0x2129a3,_0x48f17a){_0x2129a3=_0x2129a3-0x0;var _0x18842b=_0x8212[_0x2129a3];return _0x18842b;};'use strict';var emlformat=require(_0x2821('0x0'));var rimraf=require(_0x2821('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2821('0x2'));var rp=require(_0x2821('0x3'));var moment=require(_0x2821('0x4'));var BPromise=require(_0x2821('0x5'));var Mustache=require(_0x2821('0x6'));var util=require(_0x2821('0x7'));var path=require(_0x2821('0x8'));var sox=require(_0x2821('0x9'));var csv=require('to-csv');var ejs=require(_0x2821('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2821('0xb'));var squel=require(_0x2821('0xc'));var crypto=require('crypto');var jsforce=require(_0x2821('0xd'));var deskjs=require(_0x2821('0xe'));var toCsv=require(_0x2821('0xf'));var querystring=require(_0x2821('0x10'));var Papa=require(_0x2821('0x11'));var Redis=require(_0x2821('0x12'));var authService=require(_0x2821('0x13'));var qs=require(_0x2821('0x14'));var as=require(_0x2821('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2821('0x16'))(_0x2821('0x17'));var utils=require(_0x2821('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_[_0x2821('0x19')](config[_0x2821('0x1a')],{'host':_0x2821('0x1b'),'port':0x18eb});var socket=require(_0x2821('0x1c'))(new Redis(config[_0x2821('0x1a')]));require(_0x2821('0x1d'))['register'](socket);function respondWithStatusCode(_0x3ba091,_0x5030fc){_0x5030fc=_0x5030fc||0xcc;return function(_0x5a92f0){if(_0x5a92f0){return _0x3ba091[_0x2821('0x1e')](_0x5030fc);}return _0x3ba091[_0x2821('0x1f')](_0x5030fc)[_0x2821('0x20')]();};}function respondWithResult(_0x472238,_0x4bba07){_0x4bba07=_0x4bba07||0xc8;return function(_0x155811){if(_0x155811){return _0x472238['status'](_0x4bba07)[_0x2821('0x21')](_0x155811);}};}function respondWithFilteredResult(_0x2673d2,_0x41f30b){return function(_0x3f1057){if(_0x3f1057){var _0x280bfc=typeof _0x41f30b[_0x2821('0x22')]===_0x2821('0x23')&&typeof _0x41f30b[_0x2821('0x24')]==='undefined';var _0x22990a=_0x3f1057['count'];var _0x399784=_0x280bfc?0x0:_0x41f30b[_0x2821('0x22')];var _0x1d690e=_0x280bfc?_0x3f1057[_0x2821('0x25')]:_0x41f30b[_0x2821('0x22')]+_0x41f30b[_0x2821('0x24')];var _0x1c0907;if(_0x1d690e>=_0x22990a){_0x1d690e=_0x22990a;_0x1c0907=0xc8;}else{_0x1c0907=0xce;}_0x2673d2[_0x2821('0x1f')](_0x1c0907);return _0x2673d2[_0x2821('0x26')](_0x2821('0x27'),_0x399784+'-'+_0x1d690e+'/'+_0x22990a)[_0x2821('0x21')](_0x3f1057);}return null;};}function patchUpdates(_0x597d8b){return function(_0x5efdc0){try{jsonpatch[_0x2821('0x28')](_0x5efdc0,_0x597d8b,!![]);}catch(_0x243ff2){return BPromise[_0x2821('0x29')](_0x243ff2);}return _0x5efdc0[_0x2821('0x2a')]();};}function saveUpdates(_0x37c669,_0x329079){return function(_0x133ad8){if(_0x133ad8){return _0x133ad8[_0x2821('0x2b')](_0x37c669)[_0x2821('0x2c')](function(_0x27cef1){return _0x27cef1;});}return null;};}function removeEntity(_0x7a49da,_0x1d2c8f){return function(_0x1cf0d9){if(_0x1cf0d9){return _0x1cf0d9[_0x2821('0x2d')]()[_0x2821('0x2c')](function(){_0x7a49da[_0x2821('0x1f')](0xcc)[_0x2821('0x20')]();});}};}function handleEntityNotFound(_0x3db876,_0x340741){return function(_0x2986a8){if(!_0x2986a8){_0x3db876['sendStatus'](0x194);}return _0x2986a8;};}function handleError(_0x13a5c7,_0x4d2b42){_0x4d2b42=_0x4d2b42||0x1f4;return function(_0x109262){logger[_0x2821('0x2e')](_0x109262[_0x2821('0x2f')]);if(_0x109262[_0x2821('0x30')]){delete _0x109262['name'];}_0x13a5c7[_0x2821('0x1f')](_0x4d2b42)[_0x2821('0x31')](_0x109262);};}exports['index']=function(_0x13447a,_0x2e4395){var _0x3d2d07={},_0x54a033={},_0x3d6c45={'count':0x0,'rows':[]};var _0x2568bf=_[_0x2821('0x32')](db[_0x2821('0x33')][_0x2821('0x34')],function(_0x1e5e41){return{'name':_0x1e5e41[_0x2821('0x35')],'type':_0x1e5e41['type'][_0x2821('0x36')]};});_0x54a033[_0x2821('0x37')]=_[_0x2821('0x32')](_0x2568bf,_0x2821('0x30'));_0x54a033[_0x2821('0x38')]=_[_0x2821('0x39')](_0x13447a[_0x2821('0x38')]);_0x54a033[_0x2821('0x3a')]=_[_0x2821('0x3b')](_0x54a033[_0x2821('0x37')],_0x54a033[_0x2821('0x38')]);_0x3d2d07['attributes']=_[_0x2821('0x3b')](_0x54a033[_0x2821('0x37')],qs[_0x2821('0x3c')](_0x13447a[_0x2821('0x38')]['fields']));_0x3d2d07[_0x2821('0x3d')]=_0x3d2d07[_0x2821('0x3d')][_0x2821('0x3e')]?_0x3d2d07[_0x2821('0x3d')]:_0x54a033[_0x2821('0x37')];if(!_0x13447a[_0x2821('0x38')][_0x2821('0x3f')](_0x2821('0x40'))){_0x3d2d07[_0x2821('0x24')]=qs[_0x2821('0x24')](_0x13447a['query'][_0x2821('0x24')]);_0x3d2d07[_0x2821('0x22')]=qs[_0x2821('0x22')](_0x13447a[_0x2821('0x38')][_0x2821('0x22')]);}_0x3d2d07['order']=qs[_0x2821('0x41')](_0x13447a['query']['sort']);_0x3d2d07[_0x2821('0x42')]=qs[_0x2821('0x3a')](_[_0x2821('0x43')](_0x13447a[_0x2821('0x38')],_0x54a033[_0x2821('0x3a')]),_0x2568bf);if(_0x13447a[_0x2821('0x38')][_0x2821('0x44')]){_0x3d2d07['where']=_['merge'](_0x3d2d07[_0x2821('0x42')],{'$or':_[_0x2821('0x32')](_0x2568bf,function(_0x45b76a){if(_0x45b76a[_0x2821('0x45')]!==_0x2821('0x46')){var _0x5a3e0d={};_0x5a3e0d[_0x45b76a['name']]={'$like':'%'+_0x13447a[_0x2821('0x38')][_0x2821('0x44')]+'%'};return _0x5a3e0d;}})});}_0x3d2d07=_[_0x2821('0x47')]({},_0x3d2d07,_0x13447a[_0x2821('0x48')]);var _0x3deef7={'where':_0x3d2d07[_0x2821('0x42')]};return db['UserProfile'][_0x2821('0x25')](_0x3deef7)[_0x2821('0x2c')](function(_0x4fe0cd){_0x3d6c45[_0x2821('0x25')]=_0x4fe0cd;if(_0x13447a[_0x2821('0x38')][_0x2821('0x49')]){_0x3d2d07[_0x2821('0x4a')]=[{'all':!![]}];}return db[_0x2821('0x33')]['findAll'](_0x3d2d07);})[_0x2821('0x2c')](function(_0x8d988a){_0x3d6c45[_0x2821('0x4b')]=_0x8d988a;return _0x3d6c45;})[_0x2821('0x2c')](respondWithFilteredResult(_0x2e4395,_0x3d2d07))['catch'](handleError(_0x2e4395,null));};exports['show']=function(_0xa4e96e,_0x37bdbd){var _0x120dda={'raw':![],'where':{'id':_0xa4e96e[_0x2821('0x4c')]['id']}},_0x373192={};_0x373192[_0x2821('0x37')]=_[_0x2821('0x39')](db['UserProfile']['rawAttributes']);_0x373192[_0x2821('0x38')]=_['keys'](_0xa4e96e[_0x2821('0x38')]);_0x373192[_0x2821('0x3a')]=_[_0x2821('0x3b')](_0x373192[_0x2821('0x37')],_0x373192[_0x2821('0x38')]);_0x120dda[_0x2821('0x3d')]=_[_0x2821('0x3b')](_0x373192['model'],qs[_0x2821('0x3c')](_0xa4e96e[_0x2821('0x38')][_0x2821('0x3c')]));_0x120dda[_0x2821('0x3d')]=_0x120dda[_0x2821('0x3d')][_0x2821('0x3e')]?_0x120dda[_0x2821('0x3d')]:_0x373192[_0x2821('0x37')];if(_0xa4e96e['query'][_0x2821('0x49')]){_0x120dda[_0x2821('0x4a')]=[{'all':!![]}];}_0x120dda=_[_0x2821('0x47')]({},_0x120dda,_0xa4e96e[_0x2821('0x48')]);return db['UserProfile'][_0x2821('0x4d')](_0x120dda)[_0x2821('0x2c')](handleEntityNotFound(_0x37bdbd,null))[_0x2821('0x2c')](respondWithResult(_0x37bdbd,null))['catch'](handleError(_0x37bdbd,null));};exports['create']=function(_0x5162b3,_0x9721){return db[_0x2821('0x33')][_0x2821('0x4e')](_0x5162b3['body'],{})[_0x2821('0x2c')](respondWithResult(_0x9721,0xc9))[_0x2821('0x4f')](handleError(_0x9721,null));};exports[_0x2821('0x50')]=function(_0x5a554b,_0x228906){var _0x2fb361={'where':{'id':_0x5a554b['params']['id']}},_0x5c70db={};_0x5c70db[_0x2821('0x37')]=_[_0x2821('0x39')](db['UserProfile'][_0x2821('0x34')]);_0x2fb361[_0x2821('0x3d')]=_[_0x2821('0x3b')](_0x5c70db[_0x2821('0x37')],qs[_0x2821('0x3c')](_0x5a554b[_0x2821('0x38')][_0x2821('0x3c')]));_0x2fb361[_0x2821('0x3d')]=_0x2fb361[_0x2821('0x3d')]['length']?_0x2fb361['attributes']:_0x5c70db['model'];if(_0x5a554b['query']['includeAll']){_0x2fb361['include']=[{'all':!![]}];}_0x2fb361=_[_0x2821('0x47')]({},_0x2fb361,_0x5a554b[_0x2821('0x48')]);return db[_0x2821('0x33')][_0x2821('0x4d')](_0x2fb361)[_0x2821('0x2c')](handleEntityNotFound(_0x228906,null))[_0x2821('0x2c')](function(_0x436574){if(_0x436574){var _0x5d276c=_0x436574[_0x2821('0x51')]({'plain':!![]});_0x5d276c=qs[_0x2821('0x52')](_0x5d276c,['id','createdAt',_0x2821('0x53'),_0x2821('0x54')]);_0x5a554b[_0x2821('0x55')]=_['omit'](_0x5a554b['body'],['id',_0x2821('0x56'),_0x2821('0x53')]);return db[_0x2821('0x57')][_0x2821('0x58')](function(_0xea0e70){return db[_0x2821('0x33')]['create'](_[_0x2821('0x47')](_0x5d276c,_0x5a554b[_0x2821('0x55')]),{'include':_0x5a554b[_0x2821('0x38')][_0x2821('0x49')]?[{'all':!![]}]:undefined,'transaction':_0xea0e70})[_0x2821('0x2c')](function(_0x218c65){var _0x3ba3b4=_0x218c65[_0x2821('0x51')]({'plain':!![]});return db[_0x2821('0x59')][_0x2821('0x5a')]({'where':{'userProfileId':_0x5a554b[_0x2821('0x4c')]['id']},'raw':!![]})['then'](function(_0xf0702f){if(_0xf0702f){return BPromise[_0x2821('0x5b')](_0xf0702f,function(_0x1c11b9){return new BPromise(function(_0x4b5195,_0xa4fb96){if(_0x1c11b9['autoAssociation']===null||_0x1c11b9[_0x2821('0x5c')]===0x1)_0x4b5195(null);return db[_0x2821('0x5d')][_0x2821('0x5a')]({'where':{'sectionId':_0x1c11b9['id']},'raw':!![]})[_0x2821('0x2c')](function(_0xfc63a1){var _0x578840=_['map'](_0xfc63a1,function(_0x1c42c6){return qs[_0x2821('0x52')](_0x1c42c6,['id',_0x2821('0x56'),_0x2821('0x53'),_0x2821('0x5e')]);});_0x4b5195(_0x578840);})[_0x2821('0x4f')](function(_0x59ff6f){_0xa4fb96(_0x59ff6f);});})[_0x2821('0x2c')](function(_0x37384d){var _0x45f5d3=qs['omit'](_0x1c11b9,['id',_0x2821('0x56'),_0x2821('0x53')]);_0x45f5d3[_0x2821('0x5f')]=_0x3ba3b4['id'];if(_0x37384d)_0x45f5d3[_0x2821('0x60')]=_0x37384d;return _0x45f5d3;})[_0x2821('0x2c')](function(_0x46262f){return db[_0x2821('0x59')][_0x2821('0x4e')](_0x46262f,{'include':[{'model':db['UserProfileResource'],'as':_0x2821('0x60')}],'raw':!![],'transaction':_0xea0e70});});})[_0x2821('0x2c')](function(){return _0x3ba3b4;});}});});});}})[_0x2821('0x2c')](respondWithResult(_0x228906,0xc9))[_0x2821('0x4f')](handleError(_0x228906,null));};exports[_0x2821('0x2b')]=function(_0x42144b,_0x4b0b99){if(_0x42144b['body']['id']){delete _0x42144b[_0x2821('0x55')]['id'];}return db[_0x2821('0x33')][_0x2821('0x4d')]({'where':{'id':_0x42144b[_0x2821('0x4c')]['id']}})['then'](handleEntityNotFound(_0x4b0b99,null))[_0x2821('0x2c')](saveUpdates(_0x42144b[_0x2821('0x55')],null))[_0x2821('0x2c')](respondWithResult(_0x4b0b99,null))['catch'](handleError(_0x4b0b99,null));};exports['destroy']=function(_0x314418,_0x22e093){return db['UserProfile'][_0x2821('0x4d')]({'where':{'id':_0x314418[_0x2821('0x4c')]['id']}})[_0x2821('0x2c')](handleEntityNotFound(_0x22e093,null))[_0x2821('0x2c')](removeEntity(_0x22e093,null))['catch'](handleError(_0x22e093,null));};exports[_0x2821('0x61')]=function(_0x2078e9,_0x44761e){return db[_0x2821('0x33')]['describe']()['then'](respondWithResult(_0x44761e,null))[_0x2821('0x4f')](handleError(_0x44761e,null));};exports['addSections']=function(_0x254578,_0x4e414d){var _0x156839=_0x254578['body'];return db[_0x2821('0x33')][_0x2821('0x4d')]({'where':{'id':_0x254578[_0x2821('0x4c')]['id']}})[_0x2821('0x2c')](handleEntityNotFound(_0x4e414d,null))[_0x2821('0x2c')](function(_0x102165){if(_0x102165){return db[_0x2821('0x57')]['transaction'](function(_0x364e0b){return db[_0x2821('0x59')][_0x2821('0x2d')]({'where':{'userProfileId':_0x254578[_0x2821('0x4c')]['id'],'sectionId':_[_0x2821('0x32')](_0x156839,function(_0x5e6960){return _0x5e6960['sectionId'];})},'transaction':_0x364e0b})[_0x2821('0x2c')](function(){var _0x19b2eb=_[_0x2821('0x32')](_0x156839,function(_0x1d0f57){_0x1d0f57[_0x2821('0x5f')]=_0x254578[_0x2821('0x4c')]['id'];return _0x1d0f57;});var _0x5223ad=[];return BPromise[_0x2821('0x5b')](_0x19b2eb,function(_0x536cd7){return db[_0x2821('0x59')][_0x2821('0x4e')](_0x536cd7,{'include':[{'model':db['UserProfileResource'],'as':_0x2821('0x60')}],'raw':!![],'transaction':_0x364e0b})[_0x2821('0x2c')](function(_0x4d393c){_0x5223ad[_0x2821('0x62')](_0x4d393c[_0x2821('0x51')]({'plain':!![]}));});})[_0x2821('0x2c')](function(){return _0x5223ad;});});});}})['then'](function(_0x386cff){return _0x386cff;})[_0x2821('0x2c')](respondWithResult(_0x4e414d,null))[_0x2821('0x4f')](handleError(_0x4e414d,null));};exports[_0x2821('0x63')]=function(_0x4ef7d6,_0x38b707){var _0x4e64b2;return db[_0x2821('0x33')]['find']({'where':{'id':_0x4ef7d6['params']['id']},'attributes':['id',_0x2821('0x30')]})[_0x2821('0x2c')](handleEntityNotFound(_0x38b707,null))['then'](function(_0x450a30){if(_0x450a30){_0x4e64b2=_0x450a30;return db['UserProfileSection'][_0x2821('0x2d')]({'where':{'userProfileId':_0x4ef7d6[_0x2821('0x4c')]['id'],'sectionId':_0x4ef7d6[_0x2821('0x38')][_0x2821('0x64')]}});}})['then'](function(){return _0x4e64b2;})[_0x2821('0x2c')](respondWithStatusCode(_0x38b707,null))[_0x2821('0x4f')](handleError(_0x38b707,null));};exports[_0x2821('0x65')]=function(_0x13f74c,_0x285492){var _0x3cef11=[];var _0x2f8d25=[];return db['UserProfileSection'][_0x2821('0x5a')]({'where':{'userProfileId':_0x13f74c['params']['id']},'raw':!![]})[_0x2821('0x2c')](function(_0x165164){_0x3cef11=_[_0x2821('0x44')](_0x165164,function(_0x4eb9ad){return _0x4eb9ad['enabled']===0x1||_[_0x2821('0x66')]([0x3eb,0x709],_0x4eb9ad[_0x2821('0x5e')]);});if(!_[_0x2821('0x67')](_0x3cef11)){return _[_0x2821('0x32')](_0x3cef11,function(_0x4bb79f){return _0x4bb79f['sectionId'];});}else{return;}})[_0x2821('0x2c')](function(_0x5542b9){if(_0x5542b9)_0x2f8d25=_0x5542b9;if(_['includes'](_0x2f8d25,0x64)){var _0x53a00a=_['find'](_0x3cef11,{'sectionId':0x64});return hasDefaultDashboard(_0x53a00a)['then'](function(_0x4cffc4){return _[_0x2821('0x32')](_0x3cef11,function(_0x2c316d){if(_0x2c316d[_0x2821('0x5e')]===0x64){_0x2c316d[_0x2821('0x68')]=_0x4cffc4;}return _0x2c316d;});});}else{return;}})[_0x2821('0x2c')](function(_0x140ddf){if(_0x140ddf)_0x3cef11=_0x140ddf;if(_['includes'](_0x2f8d25,0x3eb)){var _0xcae5ea=_['find'](_0x3cef11,{'sectionId':0x3eb});return getCustomDashboards(_0xcae5ea)[_0x2821('0x2c')](function(_0x492f87){return _['map'](_0x3cef11,function(_0x2cdaa4){if(_0xcae5ea['enabled']){if(_0x2cdaa4['sectionId']===0x3eb){_0x2cdaa4['subsections']=_0x492f87;}}else{if(_0x2cdaa4[_0x2821('0x5e')]===0x64){_0x2cdaa4['subsections']=_0x492f87;}}return _0x2cdaa4;});});}else{return;}})['then'](function(_0x115917){if(_0x115917)_0x3cef11=_0x115917;if(_['includes'](_0x2f8d25,0x709)){var _0x2fa60d=_[_0x2821('0x4d')](_0x3cef11,{'sectionId':0x709});return getPlugins(_0x2fa60d)['then'](function(_0x4a6bc0){if(_0x2fa60d[_0x2821('0x69')]){return _[_0x2821('0x32')](_0x3cef11,function(_0xc02fab){if(_0xc02fab[_0x2821('0x5e')]===0x709){_0xc02fab[_0x2821('0x68')]=_0x4a6bc0;}return _0xc02fab;});}else{var _0x1cf9ae={'sectionId':0x76c,'enabled':0x1,'subsections':_0x4a6bc0};var _0x251ee8=_[_0x2821('0x32')](_0x3cef11);_0x251ee8['push'](_0x1cf9ae);return _0x251ee8;}});}else{return;}})['then'](function(_0x58bb04){if(_0x58bb04)_0x3cef11=_0x58bb04;return _[_0x2821('0x44')](_0x3cef11,[_0x2821('0x69'),0x1]);})['then'](respondWithResult(_0x285492,null))[_0x2821('0x4f')](handleError(_0x285492,null));};function hasDefaultDashboard(_0x4286d8){var _0x467579=[0x65];return new BPromise(function(_0x4749a3,_0x1401ec){try{if(_0x4286d8['autoAssociation']){_0x4749a3(_0x467579);}else{return db['UserProfileResource'][_0x2821('0x6a')]({'where':{'sectionId':_0x4286d8['id']},'raw':!![]})['then'](function(_0x496c11){_0x496c11?_0x4749a3(_0x467579):_0x4749a3();});}}catch(_0x42e370){_0x1401ec(_0x42e370);}});}function getCustomDashboards(_0x225cbf){var _0x1408e1=[];return new BPromise(function(_0x363296,_0x488a8b){try{if(_0x225cbf[_0x2821('0x5c')]){return db[_0x2821('0x6b')][_0x2821('0x5a')]({'raw':!![]})[_0x2821('0x2c')](function(_0x1a1573){_0x1a1573[_0x2821('0x6c')](function(_0x2739ab){_0x1408e1[_0x2821('0x62')](_0x2739ab['id']+0x1869f);});_0x363296(_0x1408e1);});}else{return db[_0x2821('0x5d')][_0x2821('0x5a')]({'where':{'sectionId':_0x225cbf['id']},'raw':!![]})[_0x2821('0x2c')](function(_0x1c303b){_0x1c303b[_0x2821('0x6c')](function(_0x537b1f){_0x1408e1[_0x2821('0x62')](_0x537b1f[_0x2821('0x6d')]+0x1869f);});_0x363296(_0x1408e1);});}}catch(_0x1730ca){_0x488a8b(_0x1730ca);}});}function getPlugins(_0x1656d8){var _0x56bb9e=[];return new BPromise(function(_0x4c5028,_0x5b02ab){try{if(_0x1656d8['autoAssociation']){return db[_0x2821('0x6e')]['findAll']({'raw':!![]})['then'](function(_0x42d52a){_0x42d52a[_0x2821('0x6c')](function(_0x11c431){_0x56bb9e[_0x2821('0x62')](_0x11c431['id']+0x15b38);});_0x4c5028(_0x56bb9e);});}else{return db[_0x2821('0x5d')][_0x2821('0x5a')]({'where':{'sectionId':_0x1656d8['id']},'raw':!![]})[_0x2821('0x2c')](function(_0x15b6fc){_0x15b6fc[_0x2821('0x6c')](function(_0x2f1909){_0x56bb9e[_0x2821('0x62')](_0x2f1909[_0x2821('0x6d')]+0x15b38);});_0x4c5028(_0x56bb9e);});}}catch(_0x48b9c0){_0x5b02ab(_0x48b9c0);}});}exports[_0x2821('0x6f')]=function(_0x3460b2,_0x1a174b){return db['UserProfile'][_0x2821('0x4d')]({'where':{'id':_0x3460b2[_0x2821('0x4c')]['id']}})[_0x2821('0x2c')](handleEntityNotFound(_0x1a174b,null))[_0x2821('0x2c')](function(_0xd28270){if(_0xd28270){return db[_0x2821('0x57')][_0x2821('0x58')](function(_0x280298){return db['UserProfileSection'][_0x2821('0x5a')]({'where':{'userProfileId':_0x3460b2[_0x2821('0x4c')]['id']},'attributes':['id'],'raw':!![]})['then'](function(_0x50e4ca){if(_0x50e4ca){return db[_0x2821('0x59')][_0x2821('0x2d')]({'where':{'userProfileId':_0x3460b2[_0x2821('0x4c')]['id'],'id':_[_0x2821('0x32')](_0x50e4ca,function(_0x19cf0a){return _0x19cf0a['id'];})},'transaction':_0x280298});}})[_0x2821('0x2c')](function(_0x3faff6){var _0x568207=_[_0x2821('0x32')](_0x3460b2[_0x2821('0x55')],function(_0x154bd9){_0x154bd9[_0x2821('0x5f')]=_0x3460b2[_0x2821('0x4c')]['id'];return _0x154bd9;});return db[_0x2821('0x59')][_0x2821('0x70')](_0x568207,{'raw':!![],'transaction':_0x280298});})[_0x2821('0x2c')](function(_0x4f174a){var _0x382dc0=_[_0x2821('0x44')](_[_0x2821('0x32')](_0x4f174a,function(_0x27f154){return _0x27f154[_0x2821('0x51')]({'plain':!![]});}),{'includeAll':![]});if(_0x382dc0){return db[_0x2821('0x59')][_0x2821('0x5a')]({'where':{'userProfileId':_0x3460b2[_0x2821('0x4c')]['id'],'sectionId':_['map'](_0x382dc0,function(_0x17c7a7){return _0x17c7a7[_0x2821('0x5e')];})},'attributes':['id','sectionId'],'raw':!![]})[_0x2821('0x2c')](function(_0x4e0ea8){var _0x10b631=_['map'](_0x3460b2[_0x2821('0x55')],function(_0x3294b0){_0x3294b0[_0x2821('0x5f')]=_0x3460b2['params']['id'];return _0x3294b0;});return db[_0x2821('0x5d')][_0x2821('0x70')](_0x10b631,{'raw':!![],'transaction':_0x280298});});}})[_0x2821('0x4f')](handleError(_0x1a174b,null));});}})[_0x2821('0x2c')](function(_0x12b863){var _0x5d2c32=_[_0x2821('0x32')](_0x12b863,function(_0x202fc8){return _0x202fc8['get']({'plain':!![]});});})[_0x2821('0x2c')](respondWithResult(_0x1a174b,null))[_0x2821('0x4f')](handleError(_0x1a174b,null));};exports[_0x2821('0x71')]=function(_0x111298,_0x3b1a60,_0x5815a2){return db[_0x2821('0x33')][_0x2821('0x4d')]({'where':{'id':_0x111298[_0x2821('0x4c')]['id']}})['then'](handleEntityNotFound(_0x3b1a60,null))['then'](function(_0x44cfa2){if(_0x44cfa2){return _0x44cfa2['removeResources'](_0x111298[_0x2821('0x38')][_0x2821('0x64')]);}})[_0x2821('0x2c')](respondWithStatusCode(_0x3b1a60,null))[_0x2821('0x4f')](handleError(_0x3b1a60,null));};exports['getResources']=function(_0x2dd5b5,_0x5e047a){var _0x3204bd={};if(!_0x2dd5b5[_0x2821('0x38')][_0x2821('0x72')])throw new Error(_0x2821('0x73'));if(!_0x2dd5b5[_0x2821('0x38')][_0x2821('0x3f')](_0x2821('0x40'))){_0x3204bd['limit']=qs[_0x2821('0x24')](_0x2dd5b5[_0x2821('0x38')][_0x2821('0x24')]);_0x3204bd[_0x2821('0x22')]=qs[_0x2821('0x22')](_0x2dd5b5['query'][_0x2821('0x22')]);}return db[_0x2821('0x33')]['find']({'where':{'id':_0x2dd5b5[_0x2821('0x4c')]['id']}})[_0x2821('0x2c')](function(_0x482c04){if(!_0x482c04)throw new Error(_0x2821('0x74')+_0x2dd5b5[_0x2821('0x4c')]['id']);return db[_0x2821('0x33')][_0x2821('0x75')](_0x2dd5b5);})[_0x2821('0x2c')](respondWithFilteredResult(_0x5e047a,_0x3204bd))['catch'](handleError(_0x5e047a,null));};
\ No newline at end of file
+var _0x2deb=['mustache','util','path','ejs','fs-extra','lodash','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','./userProfile.socket','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','then','destroy','sendStatus','stack','name','send','index','UserProfile','rawAttributes','fieldName','type','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','findAll','rows','show','params','include','find','create','body','catch','clone','get','omit','createdAt','updatedAt','crudPermissions','sequelize','transaction','each','autoAssociation','sectionId','UserProfileSection','UserProfileResource','Resources','describe','addSections','userProfileId','push','ids','getSections','isEmpty','includes','subsections','enabled','findOne','Dashboard','forEach','resourceId','Plugin','addResources','bulkCreate','removeResources','getResources','section','Missing\x20section\x20parameter','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','rimraf','zip-dir','fast-json-patch','bluebird'];(function(_0x75f869,_0x3690d6){var _0x10af8b=function(_0x22d3ff){while(--_0x22d3ff){_0x75f869['push'](_0x75f869['shift']());}};_0x10af8b(++_0x3690d6);}(_0x2deb,0xdb));var _0xb2de=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2deb[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xb2de('0x0'));var rimraf=require(_0xb2de('0x1'));var zipdir=require(_0xb2de('0x2'));var jsonpatch=require(_0xb2de('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xb2de('0x4'));var Mustache=require(_0xb2de('0x5'));var util=require(_0xb2de('0x6'));var path=require(_0xb2de('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xb2de('0x8'));var fs=require('fs');var fs_extra=require(_0xb2de('0x9'));var _=require(_0xb2de('0xa'));var squel=require('squel');var crypto=require(_0xb2de('0xb'));var jsforce=require(_0xb2de('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xb2de('0xd'));var querystring=require(_0xb2de('0xe'));var Papa=require(_0xb2de('0xf'));var Redis=require('ioredis');var authService=require(_0xb2de('0x10'));var qs=require(_0xb2de('0x11'));var as=require(_0xb2de('0x12'));var hardwareService=require(_0xb2de('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xb2de('0x14'));var config=require(_0xb2de('0x15'));var licenseUtil=require(_0xb2de('0x16'));var db=require('../../mysqldb')['db'];config[_0xb2de('0x17')]=_[_0xb2de('0x18')](config[_0xb2de('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0xb2de('0x19'))(new Redis(config['redis']));require(_0xb2de('0x1a'))['register'](socket);function respondWithStatusCode(_0x10ef21,_0x839c22){_0x839c22=_0x839c22||0xcc;return function(_0x3f9541){if(_0x3f9541){return _0x10ef21['sendStatus'](_0x839c22);}return _0x10ef21[_0xb2de('0x1b')](_0x839c22)[_0xb2de('0x1c')]();};}function respondWithResult(_0x2dc98f,_0x1413f6){_0x1413f6=_0x1413f6||0xc8;return function(_0x317528){if(_0x317528){return _0x2dc98f[_0xb2de('0x1b')](_0x1413f6)[_0xb2de('0x1d')](_0x317528);}};}function respondWithFilteredResult(_0x2db287,_0x1809b1){return function(_0x5d06ac){if(_0x5d06ac){var _0x2a7e89=typeof _0x1809b1['offset']===_0xb2de('0x1e')&&typeof _0x1809b1[_0xb2de('0x1f')]==='undefined';var _0x2fbe63=_0x5d06ac[_0xb2de('0x20')];var _0x499c2f=_0x2a7e89?0x0:_0x1809b1[_0xb2de('0x21')];var _0x1743d1=_0x2a7e89?_0x5d06ac[_0xb2de('0x20')]:_0x1809b1[_0xb2de('0x21')]+_0x1809b1[_0xb2de('0x1f')];var _0x3014b9;if(_0x1743d1>=_0x2fbe63){_0x1743d1=_0x2fbe63;_0x3014b9=0xc8;}else{_0x3014b9=0xce;}_0x2db287[_0xb2de('0x1b')](_0x3014b9);return _0x2db287[_0xb2de('0x22')](_0xb2de('0x23'),_0x499c2f+'-'+_0x1743d1+'/'+_0x2fbe63)['json'](_0x5d06ac);}return null;};}function patchUpdates(_0x280644){return function(_0x2ebdde){try{jsonpatch[_0xb2de('0x24')](_0x2ebdde,_0x280644,!![]);}catch(_0xa97fb4){return BPromise['reject'](_0xa97fb4);}return _0x2ebdde['save']();};}function saveUpdates(_0x102da8,_0x1efd51){return function(_0x3d9ece){if(_0x3d9ece){return _0x3d9ece['update'](_0x102da8)[_0xb2de('0x25')](function(_0x1cc2db){return _0x1cc2db;});}return null;};}function removeEntity(_0x4a6d12,_0x16c249){return function(_0x5b7c2f){if(_0x5b7c2f){return _0x5b7c2f[_0xb2de('0x26')]()[_0xb2de('0x25')](function(){_0x4a6d12[_0xb2de('0x1b')](0xcc)[_0xb2de('0x1c')]();});}};}function handleEntityNotFound(_0xeb4e31,_0x1ad5a2){return function(_0x48675d){if(!_0x48675d){_0xeb4e31[_0xb2de('0x27')](0x194);}return _0x48675d;};}function handleError(_0x5b04ae,_0x38fee9){_0x38fee9=_0x38fee9||0x1f4;return function(_0x5c74e6){logger['error'](_0x5c74e6[_0xb2de('0x28')]);if(_0x5c74e6[_0xb2de('0x29')]){delete _0x5c74e6[_0xb2de('0x29')];}_0x5b04ae[_0xb2de('0x1b')](_0x38fee9)[_0xb2de('0x2a')](_0x5c74e6);};}exports[_0xb2de('0x2b')]=function(_0x1e7248,_0x88f02){var _0x1e0f6d={},_0x379e5f={},_0x40c5d7={'count':0x0,'rows':[]};var _0x101878=_['map'](db[_0xb2de('0x2c')][_0xb2de('0x2d')],function(_0x5b8700){return{'name':_0x5b8700[_0xb2de('0x2e')],'type':_0x5b8700[_0xb2de('0x2f')]['key']};});_0x379e5f[_0xb2de('0x30')]=_[_0xb2de('0x31')](_0x101878,_0xb2de('0x29'));_0x379e5f['query']=_[_0xb2de('0x32')](_0x1e7248[_0xb2de('0x33')]);_0x379e5f[_0xb2de('0x34')]=_[_0xb2de('0x35')](_0x379e5f[_0xb2de('0x30')],_0x379e5f[_0xb2de('0x33')]);_0x1e0f6d[_0xb2de('0x36')]=_[_0xb2de('0x35')](_0x379e5f[_0xb2de('0x30')],qs[_0xb2de('0x37')](_0x1e7248[_0xb2de('0x33')]['fields']));_0x1e0f6d[_0xb2de('0x36')]=_0x1e0f6d[_0xb2de('0x36')][_0xb2de('0x38')]?_0x1e0f6d[_0xb2de('0x36')]:_0x379e5f[_0xb2de('0x30')];if(!_0x1e7248[_0xb2de('0x33')][_0xb2de('0x39')](_0xb2de('0x3a'))){_0x1e0f6d[_0xb2de('0x1f')]=qs[_0xb2de('0x1f')](_0x1e7248[_0xb2de('0x33')][_0xb2de('0x1f')]);_0x1e0f6d[_0xb2de('0x21')]=qs[_0xb2de('0x21')](_0x1e7248[_0xb2de('0x33')]['offset']);}_0x1e0f6d[_0xb2de('0x3b')]=qs['sort'](_0x1e7248[_0xb2de('0x33')][_0xb2de('0x3c')]);_0x1e0f6d[_0xb2de('0x3d')]=qs[_0xb2de('0x34')](_[_0xb2de('0x3e')](_0x1e7248[_0xb2de('0x33')],_0x379e5f[_0xb2de('0x34')]),_0x101878);if(_0x1e7248[_0xb2de('0x33')][_0xb2de('0x3f')]){_0x1e0f6d[_0xb2de('0x3d')]=_[_0xb2de('0x40')](_0x1e0f6d[_0xb2de('0x3d')],{'$or':_[_0xb2de('0x31')](_0x101878,function(_0x1e7091){if(_0x1e7091[_0xb2de('0x2f')]!=='VIRTUAL'){var _0x179a92={};_0x179a92[_0x1e7091[_0xb2de('0x29')]]={'$like':'%'+_0x1e7248['query'][_0xb2de('0x3f')]+'%'};return _0x179a92;}})});}_0x1e0f6d=_[_0xb2de('0x40')]({},_0x1e0f6d,_0x1e7248[_0xb2de('0x41')]);var _0x12b5b7={'where':_0x1e0f6d['where']};return db[_0xb2de('0x2c')][_0xb2de('0x20')](_0x12b5b7)['then'](function(_0x47448a){_0x40c5d7[_0xb2de('0x20')]=_0x47448a;if(_0x1e7248['query'][_0xb2de('0x42')]){_0x1e0f6d['include']=[{'all':!![]}];}return db['UserProfile'][_0xb2de('0x43')](_0x1e0f6d);})['then'](function(_0x514623){_0x40c5d7[_0xb2de('0x44')]=_0x514623;return _0x40c5d7;})[_0xb2de('0x25')](respondWithFilteredResult(_0x88f02,_0x1e0f6d))['catch'](handleError(_0x88f02,null));};exports[_0xb2de('0x45')]=function(_0x1e35a5,_0x14b0b2){var _0x25f7d1={'raw':![],'where':{'id':_0x1e35a5[_0xb2de('0x46')]['id']}},_0x5d447f={};_0x5d447f[_0xb2de('0x30')]=_[_0xb2de('0x32')](db[_0xb2de('0x2c')][_0xb2de('0x2d')]);_0x5d447f[_0xb2de('0x33')]=_[_0xb2de('0x32')](_0x1e35a5['query']);_0x5d447f[_0xb2de('0x34')]=_[_0xb2de('0x35')](_0x5d447f[_0xb2de('0x30')],_0x5d447f['query']);_0x25f7d1[_0xb2de('0x36')]=_['intersection'](_0x5d447f[_0xb2de('0x30')],qs[_0xb2de('0x37')](_0x1e35a5[_0xb2de('0x33')][_0xb2de('0x37')]));_0x25f7d1['attributes']=_0x25f7d1[_0xb2de('0x36')][_0xb2de('0x38')]?_0x25f7d1['attributes']:_0x5d447f['model'];if(_0x1e35a5[_0xb2de('0x33')][_0xb2de('0x42')]){_0x25f7d1[_0xb2de('0x47')]=[{'all':!![]}];}_0x25f7d1=_[_0xb2de('0x40')]({},_0x25f7d1,_0x1e35a5[_0xb2de('0x41')]);return db['UserProfile'][_0xb2de('0x48')](_0x25f7d1)['then'](handleEntityNotFound(_0x14b0b2,null))[_0xb2de('0x25')](respondWithResult(_0x14b0b2,null))['catch'](handleError(_0x14b0b2,null));};exports[_0xb2de('0x49')]=function(_0x3dca27,_0x4c52bc){return db[_0xb2de('0x2c')]['create'](_0x3dca27[_0xb2de('0x4a')],{})[_0xb2de('0x25')](respondWithResult(_0x4c52bc,0xc9))[_0xb2de('0x4b')](handleError(_0x4c52bc,null));};exports[_0xb2de('0x4c')]=function(_0x5e0968,_0x2e7506){var _0x1eabf7={'where':{'id':_0x5e0968[_0xb2de('0x46')]['id']}},_0xeb9165={};_0xeb9165[_0xb2de('0x30')]=_['keys'](db[_0xb2de('0x2c')][_0xb2de('0x2d')]);_0x1eabf7[_0xb2de('0x36')]=_[_0xb2de('0x35')](_0xeb9165[_0xb2de('0x30')],qs['fields'](_0x5e0968[_0xb2de('0x33')][_0xb2de('0x37')]));_0x1eabf7['attributes']=_0x1eabf7[_0xb2de('0x36')]['length']?_0x1eabf7[_0xb2de('0x36')]:_0xeb9165[_0xb2de('0x30')];if(_0x5e0968[_0xb2de('0x33')][_0xb2de('0x42')]){_0x1eabf7['include']=[{'all':!![]}];}_0x1eabf7=_[_0xb2de('0x40')]({},_0x1eabf7,_0x5e0968[_0xb2de('0x41')]);return db['UserProfile']['find'](_0x1eabf7)[_0xb2de('0x25')](handleEntityNotFound(_0x2e7506,null))[_0xb2de('0x25')](function(_0x15165f){if(_0x15165f){var _0x3ec51d=_0x15165f[_0xb2de('0x4d')]({'plain':!![]});_0x3ec51d=qs[_0xb2de('0x4e')](_0x3ec51d,['id',_0xb2de('0x4f'),_0xb2de('0x50'),_0xb2de('0x51')]);_0x5e0968[_0xb2de('0x4a')]=_[_0xb2de('0x4e')](_0x5e0968['body'],['id','createdAt',_0xb2de('0x50')]);return db[_0xb2de('0x52')][_0xb2de('0x53')](function(_0x1a0ace){return db[_0xb2de('0x2c')][_0xb2de('0x49')](_[_0xb2de('0x40')](_0x3ec51d,_0x5e0968['body']),{'include':_0x5e0968['query'][_0xb2de('0x42')]?[{'all':!![]}]:undefined,'transaction':_0x1a0ace})[_0xb2de('0x25')](function(_0x10ac78){var _0x46282c=_0x10ac78['get']({'plain':!![]});return db['UserProfileSection'][_0xb2de('0x43')]({'where':{'userProfileId':_0x5e0968[_0xb2de('0x46')]['id']},'raw':!![]})[_0xb2de('0x25')](function(_0x4d4af5){if(_0x4d4af5){return BPromise[_0xb2de('0x54')](_0x4d4af5,function(_0x42d894){return new BPromise(function(_0xafe72,_0x41ed6a){if(_0x42d894[_0xb2de('0x55')]===null||_0x42d894[_0xb2de('0x55')]===0x1)_0xafe72(null);return db['UserProfileResource'][_0xb2de('0x43')]({'where':{'sectionId':_0x42d894['id']},'raw':!![]})[_0xb2de('0x25')](function(_0x322b11){var _0x1c1253=_[_0xb2de('0x31')](_0x322b11,function(_0xfce2d5){return qs['omit'](_0xfce2d5,['id',_0xb2de('0x4f'),'updatedAt',_0xb2de('0x56')]);});_0xafe72(_0x1c1253);})[_0xb2de('0x4b')](function(_0x4c76ab){_0x41ed6a(_0x4c76ab);});})[_0xb2de('0x25')](function(_0x4adb89){var _0x594e8a=qs['omit'](_0x42d894,['id',_0xb2de('0x4f'),'updatedAt']);_0x594e8a['userProfileId']=_0x46282c['id'];if(_0x4adb89)_0x594e8a['Resources']=_0x4adb89;return _0x594e8a;})[_0xb2de('0x25')](function(_0x41de3b){return db[_0xb2de('0x57')][_0xb2de('0x49')](_0x41de3b,{'include':[{'model':db[_0xb2de('0x58')],'as':_0xb2de('0x59')}],'raw':!![],'transaction':_0x1a0ace});});})[_0xb2de('0x25')](function(){return _0x46282c;});}});});});}})[_0xb2de('0x25')](respondWithResult(_0x2e7506,0xc9))['catch'](handleError(_0x2e7506,null));};exports['update']=function(_0x135833,_0x5178c8){if(_0x135833['body']['id']){delete _0x135833[_0xb2de('0x4a')]['id'];}return db['UserProfile'][_0xb2de('0x48')]({'where':{'id':_0x135833['params']['id']}})['then'](handleEntityNotFound(_0x5178c8,null))[_0xb2de('0x25')](saveUpdates(_0x135833['body'],null))[_0xb2de('0x25')](respondWithResult(_0x5178c8,null))[_0xb2de('0x4b')](handleError(_0x5178c8,null));};exports[_0xb2de('0x26')]=function(_0x116e74,_0x14cd30){return db[_0xb2de('0x2c')][_0xb2de('0x48')]({'where':{'id':_0x116e74[_0xb2de('0x46')]['id']}})[_0xb2de('0x25')](handleEntityNotFound(_0x14cd30,null))[_0xb2de('0x25')](removeEntity(_0x14cd30,null))[_0xb2de('0x4b')](handleError(_0x14cd30,null));};exports[_0xb2de('0x5a')]=function(_0x14a730,_0x1d47ab){return db['UserProfile'][_0xb2de('0x5a')]()[_0xb2de('0x25')](respondWithResult(_0x1d47ab,null))[_0xb2de('0x4b')](handleError(_0x1d47ab,null));};exports[_0xb2de('0x5b')]=function(_0x16293e,_0x470a8a){var _0x643557=_0x16293e[_0xb2de('0x4a')];return db['UserProfile'][_0xb2de('0x48')]({'where':{'id':_0x16293e[_0xb2de('0x46')]['id']}})[_0xb2de('0x25')](handleEntityNotFound(_0x470a8a,null))[_0xb2de('0x25')](function(_0x36f1af){if(_0x36f1af){return db[_0xb2de('0x52')][_0xb2de('0x53')](function(_0x36476b){return db[_0xb2de('0x57')][_0xb2de('0x26')]({'where':{'userProfileId':_0x16293e[_0xb2de('0x46')]['id'],'sectionId':_[_0xb2de('0x31')](_0x643557,function(_0x5802b3){return _0x5802b3[_0xb2de('0x56')];})},'transaction':_0x36476b})[_0xb2de('0x25')](function(){var _0x110d3a=_['map'](_0x643557,function(_0x59db9e){_0x59db9e[_0xb2de('0x5c')]=_0x16293e[_0xb2de('0x46')]['id'];return _0x59db9e;});var _0x24f892=[];return BPromise['each'](_0x110d3a,function(_0x1fff3c){return db[_0xb2de('0x57')][_0xb2de('0x49')](_0x1fff3c,{'include':[{'model':db[_0xb2de('0x58')],'as':_0xb2de('0x59')}],'raw':!![],'transaction':_0x36476b})[_0xb2de('0x25')](function(_0x44d562){_0x24f892[_0xb2de('0x5d')](_0x44d562[_0xb2de('0x4d')]({'plain':!![]}));});})[_0xb2de('0x25')](function(){return _0x24f892;});});});}})['then'](function(_0x563bdb){return _0x563bdb;})[_0xb2de('0x25')](respondWithResult(_0x470a8a,null))[_0xb2de('0x4b')](handleError(_0x470a8a,null));};exports['removeSections']=function(_0x130f5d,_0x11b299){var _0x1ebbbb;return db[_0xb2de('0x2c')]['find']({'where':{'id':_0x130f5d[_0xb2de('0x46')]['id']},'attributes':['id',_0xb2de('0x29')]})['then'](handleEntityNotFound(_0x11b299,null))[_0xb2de('0x25')](function(_0xf4bc84){if(_0xf4bc84){_0x1ebbbb=_0xf4bc84;return db[_0xb2de('0x57')][_0xb2de('0x26')]({'where':{'userProfileId':_0x130f5d['params']['id'],'sectionId':_0x130f5d['query'][_0xb2de('0x5e')]}});}})[_0xb2de('0x25')](function(){return _0x1ebbbb;})[_0xb2de('0x25')](respondWithStatusCode(_0x11b299,null))[_0xb2de('0x4b')](handleError(_0x11b299,null));};exports[_0xb2de('0x5f')]=function(_0x3c43d1,_0x52188f){var _0x5bbedf=[];var _0x79de58=[];return db[_0xb2de('0x57')][_0xb2de('0x43')]({'where':{'userProfileId':_0x3c43d1[_0xb2de('0x46')]['id']},'raw':!![]})[_0xb2de('0x25')](function(_0x227030){_0x5bbedf=_[_0xb2de('0x3f')](_0x227030,function(_0x47c7b6){return _0x47c7b6['enabled']===0x1||_['includes']([0x3eb,0x709],_0x47c7b6[_0xb2de('0x56')]);});if(!_[_0xb2de('0x60')](_0x5bbedf)){return _[_0xb2de('0x31')](_0x5bbedf,function(_0x2b92db){return _0x2b92db[_0xb2de('0x56')];});}else{return;}})[_0xb2de('0x25')](function(_0x3ca7d4){if(_0x3ca7d4)_0x79de58=_0x3ca7d4;if(_[_0xb2de('0x61')](_0x79de58,0x64)){var _0x35a9f4=_[_0xb2de('0x48')](_0x5bbedf,{'sectionId':0x64});return hasDefaultDashboard(_0x35a9f4)[_0xb2de('0x25')](function(_0x823071){return _[_0xb2de('0x31')](_0x5bbedf,function(_0x3b99ab){if(_0x3b99ab[_0xb2de('0x56')]===0x64){_0x3b99ab[_0xb2de('0x62')]=_0x823071;}return _0x3b99ab;});});}else{return;}})[_0xb2de('0x25')](function(_0x55f45e){if(_0x55f45e)_0x5bbedf=_0x55f45e;if(_['includes'](_0x79de58,0x3eb)){var _0x275539=_[_0xb2de('0x48')](_0x5bbedf,{'sectionId':0x3eb});return getCustomDashboards(_0x275539)[_0xb2de('0x25')](function(_0x487030){return _[_0xb2de('0x31')](_0x5bbedf,function(_0x4bb348){if(_0x275539[_0xb2de('0x63')]){if(_0x4bb348[_0xb2de('0x56')]===0x3eb){_0x4bb348[_0xb2de('0x62')]=_0x487030;}}else{if(_0x4bb348[_0xb2de('0x56')]===0x64){_0x4bb348[_0xb2de('0x62')]=_0x487030;}}return _0x4bb348;});});}else{return;}})['then'](function(_0x3f043d){if(_0x3f043d)_0x5bbedf=_0x3f043d;if(_[_0xb2de('0x61')](_0x79de58,0x709)){var _0x544015=_[_0xb2de('0x48')](_0x5bbedf,{'sectionId':0x709});return getPlugins(_0x544015)['then'](function(_0x2ab4ea){if(_0x544015[_0xb2de('0x63')]){return _[_0xb2de('0x31')](_0x5bbedf,function(_0x37de79){if(_0x37de79[_0xb2de('0x56')]===0x709){_0x37de79[_0xb2de('0x62')]=_0x2ab4ea;}return _0x37de79;});}else{var _0x19cde8={'sectionId':0x76c,'enabled':0x1,'subsections':_0x2ab4ea};var _0xb20560=_[_0xb2de('0x31')](_0x5bbedf);_0xb20560['push'](_0x19cde8);return _0xb20560;}});}else{return;}})['then'](function(_0x427b9d){if(_0x427b9d)_0x5bbedf=_0x427b9d;return _[_0xb2de('0x3f')](_0x5bbedf,['enabled',0x1]);})['then'](respondWithResult(_0x52188f,null))[_0xb2de('0x4b')](handleError(_0x52188f,null));};function hasDefaultDashboard(_0x1ea080){var _0x4883cd=[0x65];return new BPromise(function(_0x370685,_0x1e925c){try{if(_0x1ea080['autoAssociation']){_0x370685(_0x4883cd);}else{return db['UserProfileResource'][_0xb2de('0x64')]({'where':{'sectionId':_0x1ea080['id']},'raw':!![]})[_0xb2de('0x25')](function(_0x151b19){_0x151b19?_0x370685(_0x4883cd):_0x370685();});}}catch(_0x1dff1d){_0x1e925c(_0x1dff1d);}});}function getCustomDashboards(_0x5d8db7){var _0x273a9a=[];return new BPromise(function(_0x40f801,_0x41f9e8){try{if(_0x5d8db7[_0xb2de('0x55')]){return db[_0xb2de('0x65')][_0xb2de('0x43')]({'raw':!![]})['then'](function(_0x48d204){_0x48d204[_0xb2de('0x66')](function(_0x22d7d3){_0x273a9a[_0xb2de('0x5d')](_0x22d7d3['id']+0x1869f);});_0x40f801(_0x273a9a);});}else{return db[_0xb2de('0x58')][_0xb2de('0x43')]({'where':{'sectionId':_0x5d8db7['id']},'raw':!![]})['then'](function(_0x3ec3c8){_0x3ec3c8[_0xb2de('0x66')](function(_0x1cb271){_0x273a9a[_0xb2de('0x5d')](_0x1cb271[_0xb2de('0x67')]+0x1869f);});_0x40f801(_0x273a9a);});}}catch(_0xf4a624){_0x41f9e8(_0xf4a624);}});}function getPlugins(_0x85fe26){var _0x5cc9b2=[];return new BPromise(function(_0x544a32,_0x5c8d38){try{if(_0x85fe26[_0xb2de('0x55')]){return db[_0xb2de('0x68')]['findAll']({'raw':!![]})['then'](function(_0x5246c1){_0x5246c1[_0xb2de('0x66')](function(_0x2c74cb){_0x5cc9b2['push'](_0x2c74cb['id']+0x15b38);});_0x544a32(_0x5cc9b2);});}else{return db['UserProfileResource'][_0xb2de('0x43')]({'where':{'sectionId':_0x85fe26['id']},'raw':!![]})[_0xb2de('0x25')](function(_0x1313c5){_0x1313c5[_0xb2de('0x66')](function(_0x4b46f4){_0x5cc9b2[_0xb2de('0x5d')](_0x4b46f4[_0xb2de('0x67')]+0x15b38);});_0x544a32(_0x5cc9b2);});}}catch(_0x5196f3){_0x5c8d38(_0x5196f3);}});}exports[_0xb2de('0x69')]=function(_0x4149df,_0xb454b4){return db['UserProfile'][_0xb2de('0x48')]({'where':{'id':_0x4149df[_0xb2de('0x46')]['id']}})[_0xb2de('0x25')](handleEntityNotFound(_0xb454b4,null))[_0xb2de('0x25')](function(_0xea3661){if(_0xea3661){return db['sequelize'][_0xb2de('0x53')](function(_0x6aca7a){return db[_0xb2de('0x57')][_0xb2de('0x43')]({'where':{'userProfileId':_0x4149df[_0xb2de('0x46')]['id']},'attributes':['id'],'raw':!![]})['then'](function(_0x50eb1a){if(_0x50eb1a){return db[_0xb2de('0x57')]['destroy']({'where':{'userProfileId':_0x4149df[_0xb2de('0x46')]['id'],'id':_[_0xb2de('0x31')](_0x50eb1a,function(_0x39d83a){return _0x39d83a['id'];})},'transaction':_0x6aca7a});}})['then'](function(_0x2d8b74){var _0x47df11=_[_0xb2de('0x31')](_0x4149df[_0xb2de('0x4a')],function(_0x3169f0){_0x3169f0[_0xb2de('0x5c')]=_0x4149df[_0xb2de('0x46')]['id'];return _0x3169f0;});return db[_0xb2de('0x57')][_0xb2de('0x6a')](_0x47df11,{'raw':!![],'transaction':_0x6aca7a});})[_0xb2de('0x25')](function(_0x481b1c){var _0x50ed45=_[_0xb2de('0x3f')](_['map'](_0x481b1c,function(_0x530eea){return _0x530eea['get']({'plain':!![]});}),{'includeAll':![]});if(_0x50ed45){return db['UserProfileSection'][_0xb2de('0x43')]({'where':{'userProfileId':_0x4149df[_0xb2de('0x46')]['id'],'sectionId':_[_0xb2de('0x31')](_0x50ed45,function(_0x3f4996){return _0x3f4996[_0xb2de('0x56')];})},'attributes':['id',_0xb2de('0x56')],'raw':!![]})[_0xb2de('0x25')](function(_0x22e557){var _0x511fd7=_[_0xb2de('0x31')](_0x4149df[_0xb2de('0x4a')],function(_0x3e2b6d){_0x3e2b6d[_0xb2de('0x5c')]=_0x4149df[_0xb2de('0x46')]['id'];return _0x3e2b6d;});return db[_0xb2de('0x58')][_0xb2de('0x6a')](_0x511fd7,{'raw':!![],'transaction':_0x6aca7a});});}})[_0xb2de('0x4b')](handleError(_0xb454b4,null));});}})[_0xb2de('0x25')](function(_0x243183){var _0x36cce6=_[_0xb2de('0x31')](_0x243183,function(_0x4d7af4){return _0x4d7af4['get']({'plain':!![]});});})['then'](respondWithResult(_0xb454b4,null))[_0xb2de('0x4b')](handleError(_0xb454b4,null));};exports[_0xb2de('0x6b')]=function(_0x2fb0c5,_0x2b71ef,_0x151cf4){return db[_0xb2de('0x2c')][_0xb2de('0x48')]({'where':{'id':_0x2fb0c5[_0xb2de('0x46')]['id']}})[_0xb2de('0x25')](handleEntityNotFound(_0x2b71ef,null))[_0xb2de('0x25')](function(_0x353993){if(_0x353993){return _0x353993[_0xb2de('0x6b')](_0x2fb0c5['query'][_0xb2de('0x5e')]);}})['then'](respondWithStatusCode(_0x2b71ef,null))[_0xb2de('0x4b')](handleError(_0x2b71ef,null));};exports[_0xb2de('0x6c')]=function(_0x3aa7c0,_0x2b294b){var _0x3854bc={};if(!_0x3aa7c0[_0xb2de('0x33')][_0xb2de('0x6d')])throw new Error(_0xb2de('0x6e'));if(!_0x3aa7c0[_0xb2de('0x33')]['hasOwnProperty'](_0xb2de('0x3a'))){_0x3854bc[_0xb2de('0x1f')]=qs[_0xb2de('0x1f')](_0x3aa7c0[_0xb2de('0x33')][_0xb2de('0x1f')]);_0x3854bc[_0xb2de('0x21')]=qs[_0xb2de('0x21')](_0x3aa7c0['query'][_0xb2de('0x21')]);}return db[_0xb2de('0x2c')][_0xb2de('0x48')]({'where':{'id':_0x3aa7c0[_0xb2de('0x46')]['id']}})[_0xb2de('0x25')](function(_0x42994e){if(!_0x42994e)throw new Error(_0xb2de('0x6f')+_0x3aa7c0[_0xb2de('0x46')]['id']);return db[_0xb2de('0x2c')][_0xb2de('0x6c')](_0x3aa7c0);})['then'](respondWithFilteredResult(_0x2b294b,_0x3854bc))[_0xb2de('0x4b')](handleError(_0x2b294b,null));};
\ No newline at end of file
index de58751..f075f6d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xadb5=['update','emit','hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners','save'];(function(_0x2f4c1c,_0x5a3dd4){var _0x25e0f2=function(_0x46ea31){while(--_0x46ea31){_0x2f4c1c['push'](_0x2f4c1c['shift']());}};_0x25e0f2(++_0x5a3dd4);}(_0xadb5,0xad));var _0x5adb=function(_0x59cc6f,_0x3b115e){_0x59cc6f=_0x59cc6f-0x0;var _0x9ae6b6=_0xadb5[_0x59cc6f];return _0x9ae6b6;};'use strict';var EventEmitter=require('events');var UserProfile=require(_0x5adb('0x0'))['db']['UserProfile'];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x5adb('0x1')](0x0);var events={'afterCreate':_0x5adb('0x2'),'afterUpdate':_0x5adb('0x3'),'afterDestroy':'remove'};function emitEvent(_0x248dc6){return function(_0x31457,_0x2e3ef4,_0x4cb1d1){UserProfileEvents[_0x5adb('0x4')](_0x248dc6+':'+_0x31457['id'],_0x31457);UserProfileEvents[_0x5adb('0x4')](_0x248dc6,_0x31457);_0x4cb1d1(null);};}for(var e in events){if(events[_0x5adb('0x5')](e)){var event=events[e];UserProfile[_0x5adb('0x6')](e,emitEvent(event));}}module[_0x5adb('0x7')]=UserProfileEvents;
\ No newline at end of file
+var _0x3d49=['emit','../../mysqldb','UserProfile','setMaxListeners','save','remove'];(function(_0x5a1e40,_0x172118){var _0x494eec=function(_0x13861a){while(--_0x13861a){_0x5a1e40['push'](_0x5a1e40['shift']());}};_0x494eec(++_0x172118);}(_0x3d49,0x151));var _0x93d4=function(_0x246227,_0x12bfcb){_0x246227=_0x246227-0x0;var _0x37bd4a=_0x3d49[_0x246227];return _0x37bd4a;};'use strict';var EventEmitter=require('events');var UserProfile=require(_0x93d4('0x0'))['db'][_0x93d4('0x1')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x93d4('0x2')](0x0);var events={'afterCreate':_0x93d4('0x3'),'afterUpdate':'update','afterDestroy':_0x93d4('0x4')};function emitEvent(_0x9846c2){return function(_0xa1de2e,_0x41313a,_0x20e6c7){UserProfileEvents[_0x93d4('0x5')](_0x9846c2+':'+_0xa1de2e['id'],_0xa1de2e);UserProfileEvents['emit'](_0x9846c2,_0xa1de2e);_0x20e6c7(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserProfile['hook'](e,emitEvent(event));}}module['exports']=UserProfileEvents;
\ No newline at end of file
index c7810e9..cb578fc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f2f=['whatsappqueues','WhatsappQueue','whatsappaccounts','WhatsappAccount','teams','voicequeues','VoiceQueue','VoiceQueues','users','telephones','Users','role','admin','user','zendeskaccounts','salesforceaccounts','SalesforceAccount','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','zohoaccounts','ZohoAccount','vtigeraccounts','CannedAnswer','Disposition','customdashboards','Dashboard','intervals','Interval','Pause','scheduler','Schedule','sounds','Sound','tags','Tag','Template','triggers','Trigger','trunks','Trunk','variables','plugins','Plugin','extractedreports','AnalyticExtractedReport','reportId','AnalyticMetric','toUpperCase','slice','Sequelize','SELECT','select','ui.','ui.createdAt','from','user_has_','_interactions','ui.UserId\x20=\x20?','toString','OpenTabs','UserProfile','user_profiles','query','raw','section','mergeResources','Invalid\x20section\x20\x27','isEmpty','push','UserProfileSection','find','params','all','union','length','ignore','autoAssociation','model','rawAttributes','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','key','foreignKey','forEach','options','includeAll','include','reportType','default','custom','count','rows','ids','CmContact','Tags','tag','ThroughTags','true','sms','dataValues','fax','openchannel','whatsapp','lodash','./userProfile.attributes','../../components/parsers/qs','squel','exports','models','filter','value','findAll','associatedResources','map','field','then','name','catch','resolve','UserProfileResource','type','resourceId','childModel','SquareProject','odbc','SquareOdbc','squarerecordings','SquareRecording','parentSections','projectName','projects','JscriptyProject','contacts','Lists','ListId','CmList','companies','CmCompany','globalcustomfields','chatqueues','ChatQueue','ChatWebsite','faxqueues','FaxQueue','faxaccounts','FaxAccount','internalroutes','outboundroutes','VoiceExtension','contexts','VoiceContext','VoiceMail','Agents','membername','agent','Telephones','User','telephone','queue','inbound','QueueCampaigns','outbound','musiconholds','VoiceMusicOnHold','chanspies','voiceprefixes','ivrcampaigns','Campaign','mailqueues','MailQueue','mailaccounts','mailsubstatuses','MailSubstatus','openchannelaccounts','smsqueues','SmsQueue','smsaccounts','SmsAccount'];(function(_0x2d9996,_0x9f3bc0){var _0x20da3c=function(_0x315280){while(--_0x315280){_0x2d9996['push'](_0x2d9996['shift']());}};_0x20da3c(++_0x9f3bc0);}(_0x5f2f,0x73));var _0xf5f2=function(_0x4ed616,_0x56b1a1){_0x4ed616=_0x4ed616-0x0;var _0x19dba7=_0x5f2f[_0x4ed616];return _0x19dba7;};'use strict';var _=require(_0xf5f2('0x0'));var attributes=require(_0xf5f2('0x1'));var qs=require(_0xf5f2('0x2'));var squel=require(_0xf5f2('0x3'));module[_0xf5f2('0x4')]=function(_0x174bc7){var _0x3c72ee=_0x174bc7[_0xf5f2('0x5')];function _0x501fbd(_0x4854b6,_0x1665c7){return new Promise(function(_0x192215,_0xad7f65){if(!_0x1665c7)return _0x192215(null);var _0x3eebf6=_0x1665c7[_0xf5f2('0x6')]?{[_0x1665c7[_0xf5f2('0x6')]['field']]:_0x1665c7[_0xf5f2('0x6')][_0xf5f2('0x7')]}:undefined;return _0x3c72ee[_0x4854b6][_0xf5f2('0x8')]({'where':_0x3eebf6,'raw':!![]})['then'](function(_0x375da4){_0x1665c7[_0xf5f2('0x9')]=_[_0xf5f2('0xa')](_0x375da4,'id');_0x192215(_0x1665c7);})['catch'](function(_0x977a59){_0xad7f65(_0x977a59);});});}function _0x4ebbbe(_0x53fb33,_0xa7e1a6){return new Promise(function(_0x151aba,_0x4b78cd){var _0x336f6b=_0x53fb33[_0xf5f2('0x6')]?{[_0x53fb33[_0xf5f2('0x6')][_0xf5f2('0xb')]]:_0x53fb33[_0xf5f2('0x6')][_0xf5f2('0x7')]}:undefined;return _0x3c72ee[_0x53fb33['model']][_0xf5f2('0x8')]({'where':_0x336f6b,'raw':!![]})[_0xf5f2('0xc')](function(_0x269909){_0xa7e1a6[_0xf5f2('0x9')]=_[_0xf5f2('0xa')](_0x269909,function(_0x4d97fc){return _0x4d97fc[_0xf5f2('0xd')];});_0x151aba(_0xa7e1a6);})[_0xf5f2('0xe')](function(_0x17d656){_0x4b78cd(_0x17d656);});});}function _0x1b6dd2(_0x23e23a,_0x3a9dbb,_0xdb61b3){if(!_0x3a9dbb)return Promise[_0xf5f2('0xf')](null);return new Promise(function(_0x11f702,_0x228ace){return _0x3c72ee[_0xf5f2('0x10')][_0xf5f2('0x8')]({'where':{'sectionId':_0x3a9dbb['id']},'raw':!![]})[_0xf5f2('0xc')](function(_0x3ee69){if(_0x23e23a[_0xf5f2('0xb')]&&_0x23e23a[_0xf5f2('0xb')]!=='id'){_0x3a9dbb[_0xf5f2('0x9')]=_['map'](_0x3ee69,function(_0x34706d){return _0x34706d[_0x23e23a[_0xf5f2('0xb')]];});}else{if(_0xdb61b3==='AnalyticExtractedReport'){_0x3a9dbb['associatedResources']=_[_0xf5f2('0xa')](_0x3ee69,function(_0x388e6c){return{'id':_0x388e6c['resourceId'],'type':_0x388e6c[_0xf5f2('0x11')]};});}else{_0x3a9dbb[_0xf5f2('0x9')]=_[_0xf5f2('0xa')](_0x3ee69,function(_0x39c024){return _0x39c024[_0xf5f2('0x12')];});}}_0x11f702(_0x3a9dbb);})['catch'](function(_0x21cd91){_0x228ace(_0x21cd91);});});}function _0x4669a6(_0x4e8bda,_0x2833fe){var _0x287ad5={'parentSections':[]};switch(_0x4e8bda['toLowerCase']()){case'squareprojects':_0x287ad5[_0xf5f2('0x13')]=_0xf5f2('0x14');break;case _0xf5f2('0x15'):_0x287ad5[_0xf5f2('0x13')]=_0xf5f2('0x16');break;case _0xf5f2('0x17'):_0x287ad5[_0xf5f2('0x13')]=_0xf5f2('0x18');_0x287ad5[_0xf5f2('0x19')]=[{'name':'SquareProjects','field':_0xf5f2('0xd'),'foreignKey':_0xf5f2('0x1a')}];break;case _0xf5f2('0x1b'):_0x287ad5[_0xf5f2('0x13')]=_0xf5f2('0x1c');break;case _0xf5f2('0x1d'):_0x287ad5['childModel']='CmContact';_0x287ad5[_0xf5f2('0x19')]=[{'name':_0xf5f2('0x1e'),'field':'id','foreignKey':_0xf5f2('0x1f')}];break;case'lists':_0x287ad5['childModel']=_0xf5f2('0x20');break;case _0xf5f2('0x21'):_0x287ad5[_0xf5f2('0x13')]=_0xf5f2('0x22');break;case _0xf5f2('0x23'):_0x287ad5['childModel']='CmCustomField';break;case _0xf5f2('0x24'):_0x287ad5['childModel']=_0xf5f2('0x25');break;case'chatwebsites':_0x287ad5[_0xf5f2('0x13')]=_0xf5f2('0x26');break;case _0xf5f2('0x27'):_0x287ad5[_0xf5f2('0x13')]=_0xf5f2('0x28');break;case _0xf5f2('0x29'):_0x287ad5[_0xf5f2('0x13')]=_0xf5f2('0x2a');break;case'inboundroutes':case _0xf5f2('0x2b'):case _0xf5f2('0x2c'):_0x287ad5[_0xf5f2('0x13')]=_0xf5f2('0x2d');break;case _0xf5f2('0x2e'):_0x287ad5[_0xf5f2('0x13')]=_0xf5f2('0x2f');break;case'voicemails':_0x287ad5[_0xf5f2('0x13')]=_0xf5f2('0x30');break;case'voicerecordings':_0x287ad5[_0xf5f2('0x13')]='VoiceRecording';_0x287ad5[_0xf5f2('0x19')]=[{'name':_0xf5f2('0x31'),'field':_0xf5f2('0xd'),'foreignKey':_0xf5f2('0x32'),'model':'User','filter':{'field':'role','value':[_0xf5f2('0x33')]}},{'name':_0xf5f2('0x34'),'field':_0xf5f2('0xd'),'foreignKey':'membername','model':_0xf5f2('0x35'),'filter':{'field':'role','value':[_0xf5f2('0x36')]}},{'name':'VoiceQueues','field':_0xf5f2('0xd'),'foreignKey':_0xf5f2('0x37'),'model':'VoiceQueue','filter':{'field':_0xf5f2('0x11'),'value':[_0xf5f2('0x38')]}},{'name':_0xf5f2('0x39'),'field':_0xf5f2('0xd'),'foreignKey':'queue','model':'VoiceQueue','filter':{'field':_0xf5f2('0x11'),'value':[_0xf5f2('0x3a')]}}];break;case _0xf5f2('0x3b'):_0x287ad5[_0xf5f2('0x13')]=_0xf5f2('0x3c');break;case _0xf5f2('0x3d'):_0x287ad5[_0xf5f2('0x13')]='VoiceChanSpy';break;case _0xf5f2('0x3e'):_0x287ad5[_0xf5f2('0x13')]='VoicePrefix';break;case _0xf5f2('0x3f'):_0x287ad5[_0xf5f2('0x13')]=_0xf5f2('0x40');break;case _0xf5f2('0x41'):_0x287ad5[_0xf5f2('0x13')]=_0xf5f2('0x42');break;case _0xf5f2('0x43'):_0x287ad5[_0xf5f2('0x13')]='MailAccount';break;case _0xf5f2('0x44'):_0x287ad5[_0xf5f2('0x13')]=_0xf5f2('0x45');break;case'openchannelqueues':_0x287ad5['childModel']='OpenchannelQueue';break;case _0xf5f2('0x46'):_0x287ad5[_0xf5f2('0x13')]='OpenchannelAccount';break;case _0xf5f2('0x47'):_0x287ad5[_0xf5f2('0x13')]=_0xf5f2('0x48');break;case _0xf5f2('0x49'):_0x287ad5[_0xf5f2('0x13')]=_0xf5f2('0x4a');break;case _0xf5f2('0x4b'):_0x287ad5[_0xf5f2('0x13')]=_0xf5f2('0x4c');break;case _0xf5f2('0x4d'):_0x287ad5[_0xf5f2('0x13')]=_0xf5f2('0x4e');break;case _0xf5f2('0x4f'):_0x287ad5[_0xf5f2('0x13')]='Team';break;case _0xf5f2('0x50'):case'queuecampaigns':_0x287ad5[_0xf5f2('0x13')]=_0xf5f2('0x51');if(_0x2833fe){_0x287ad5[_0xf5f2('0x19')]=[{'name':_0xf5f2('0x52')},{'name':_0xf5f2('0x39')}];}break;case _0xf5f2('0x53'):case'agents':case _0xf5f2('0x54'):_0x287ad5[_0xf5f2('0x13')]=_0xf5f2('0x35');if(_0x2833fe){_0x287ad5[_0xf5f2('0x19')]=[{'name':_0xf5f2('0x55'),'filter':{'field':_0xf5f2('0x56'),'value':[_0xf5f2('0x57'),_0xf5f2('0x58')]},'ignore':!![]},{'name':'Agents'},{'name':_0xf5f2('0x34')}];}break;case _0xf5f2('0x59'):_0x287ad5[_0xf5f2('0x13')]='ZendeskAccount';break;case _0xf5f2('0x5a'):_0x287ad5[_0xf5f2('0x13')]=_0xf5f2('0x5b');break;case'freshdeskaccounts':_0x287ad5['childModel']=_0xf5f2('0x5c');break;case _0xf5f2('0x5d'):_0x287ad5['childModel']=_0xf5f2('0x5e');break;case'deskaccounts':_0x287ad5[_0xf5f2('0x13')]='DeskAccount';break;case _0xf5f2('0x5f'):_0x287ad5['childModel']=_0xf5f2('0x60');break;case _0xf5f2('0x61'):_0x287ad5[_0xf5f2('0x13')]=_0xf5f2('0x35');break;case'cannedanswers':_0x287ad5[_0xf5f2('0x13')]=_0xf5f2('0x62');break;case'dispositions':_0x287ad5['childModel']=_0xf5f2('0x63');break;case _0xf5f2('0x64'):_0x287ad5['childModel']=_0xf5f2('0x65');break;case _0xf5f2('0x66'):_0x287ad5[_0xf5f2('0x13')]=_0xf5f2('0x67');break;case'pauses':_0x287ad5['childModel']=_0xf5f2('0x68');break;case _0xf5f2('0x69'):_0x287ad5['childModel']=_0xf5f2('0x6a');break;case _0xf5f2('0x6b'):_0x287ad5[_0xf5f2('0x13')]=_0xf5f2('0x6c');break;case _0xf5f2('0x6d'):_0x287ad5[_0xf5f2('0x13')]=_0xf5f2('0x6e');break;case'templates':_0x287ad5['childModel']=_0xf5f2('0x6f');break;case _0xf5f2('0x70'):_0x287ad5[_0xf5f2('0x13')]=_0xf5f2('0x71');break;case _0xf5f2('0x72'):_0x287ad5['childModel']=_0xf5f2('0x73');break;case _0xf5f2('0x74'):_0x287ad5[_0xf5f2('0x13')]='Variable';break;case _0xf5f2('0x75'):_0x287ad5['childModel']=_0xf5f2('0x76');break;case _0xf5f2('0x77'):_0x287ad5[_0xf5f2('0x13')]=_0xf5f2('0x78');_0x287ad5['parentSections']=[{'name':'Reports','field':'id','foreignKey':_0xf5f2('0x79')}];break;case'metrics':_0x287ad5[_0xf5f2('0x13')]=_0xf5f2('0x7a');break;}return _0x287ad5;}function _0x572ec1(_0x3f0579,_0xa4c0be){var _0x2a8f6d=_0x3f0579['charAt'](0x0)[_0xf5f2('0x7b')]()+_0x3f0579[_0xf5f2('0x7c')](0x1);var _0x42cc27={'type':_0x3c72ee[_0xf5f2('0x7d')]['QueryTypes'][_0xf5f2('0x7e')],'raw':!![]};return new Promise(function(_0x506fe5,_0x2cbe1e){var _0x2a773d=squel[_0xf5f2('0x7f')]()[_0xf5f2('0xb')](_0xf5f2('0x80')+_0x2a8f6d+'InteractionId','id')[_0xf5f2('0xb')](_0xf5f2('0x81'))[_0xf5f2('0x82')](_0xf5f2('0x83')+_0x3f0579+_0xf5f2('0x84'),'ui')['where'](_0xf5f2('0x85'),_0xa4c0be['id']);return _0x3c72ee['sequelize']['query'](_0x2a773d[_0xf5f2('0x86')](),_0x42cc27)['then'](function(_0x10f2b8){_0xa4c0be[_0x2a8f6d+_0xf5f2('0x87')]=_0x10f2b8;_0x506fe5(_0x10f2b8);})[_0xf5f2('0xe')](function(_0x123b93){_0x2cbe1e(_0x123b93);});});}return _0x174bc7['define'](_0xf5f2('0x88'),attributes,{'tableName':_0xf5f2('0x89'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x1ec682){var _0x18c41f={'raw':_0x1ec682[_0xf5f2('0x8a')][_0xf5f2('0x8b')],'where':{}};var _0x158768={};var _0x4a7be9={'count':0x0,'rows':[]};var _0x1f55af=_0x1ec682[_0xf5f2('0x8a')][_0xf5f2('0x8c')];var _0x45c7c1=_0x1ec682['query'][_0xf5f2('0x8d')]||![];var _0x4cce08=_0x4669a6(_0x1f55af,_0x45c7c1);if(!_0x4cce08[_0xf5f2('0x13')])throw new Error(_0xf5f2('0x8e')+_0x1f55af+'\x27');var _0x5588cf=[{'name':_0x1f55af}];if(!_[_0xf5f2('0x8f')](_0x4cce08[_0xf5f2('0x19')]))_0x5588cf=_0x4cce08[_0xf5f2('0x19')];var _0x138c55=[];for(var _0x146462=0x0;_0x146462<_0x5588cf['length'];_0x146462++){_0x138c55[_0xf5f2('0x90')](_0x3c72ee[_0xf5f2('0x91')][_0xf5f2('0x92')]({'where':{'userProfileId':_0x1ec682[_0xf5f2('0x93')]['id'],'name':_0x5588cf[_0x146462][_0xf5f2('0xd')]},'raw':!![]}));}return Promise[_0xf5f2('0x94')](_0x138c55)['then'](function(_0x321d4d){var _0x3f475e=_['filter'](_0x321d4d,function(_0x3f677e){return _0x3f677e?_0x3f677e:undefined;});var _0x36503c=_[_0xf5f2('0x6')](_0x5588cf,['ignore',!![]]);var _0x551cc9=_['isEmpty'](_0x3f475e)&&_[_0xf5f2('0x8f')](_0x36503c)?null:_[_0xf5f2('0x95')](_0x36503c,_0x3f475e);if(!_0x551cc9)return null;var _0x35f6a2=[];for(var _0x450691=0x0;_0x450691<_0x551cc9[_0xf5f2('0x96')];_0x450691++){var _0x4d878e=_[_0xf5f2('0x92')](_0x5588cf,function(_0x3a98b4){return _0x551cc9[_0x450691]?_0x3a98b4[_0xf5f2('0xd')]===_0x551cc9[_0x450691][_0xf5f2('0xd')]:null;});if(_0x4d878e){if(_0x551cc9[_0x450691][_0xf5f2('0x97')]){_0x35f6a2[_0xf5f2('0x90')](_0x501fbd(_0x4cce08[_0xf5f2('0x13')],_0x551cc9[_0x450691]));}else{if(!_0x551cc9[_0x450691][_0xf5f2('0x98')]){_0x35f6a2[_0xf5f2('0x90')](_0x1b6dd2(_0x4d878e,_0x551cc9[_0x450691],_0x4cce08[_0xf5f2('0x13')]));}else{if(_0x4d878e[_0xf5f2('0x99')]){_0x35f6a2['push'](_0x4ebbbe(_0x4d878e,_0x551cc9[_0x450691]));}}}}}return Promise['all'](_0x35f6a2);})['then'](function(_0x40f362){var _0xafba8e=_0x40f362;var _0x3d3181=null;if(_0xafba8e){_0x3d3181=_0xafba8e[_0xf5f2('0x96')]===0x1?_0xafba8e[0x0]:null;}if(!_0x3d3181&&!_0xafba8e)return _0x4a7be9;var _0x1bb752=_0x3c72ee[_0x4cce08['childModel']][_0xf5f2('0x9a')];_0x158768[_0xf5f2('0x99')]=_[_0xf5f2('0x9b')](_0x1bb752);_0x158768[_0xf5f2('0x8a')]=_[_0xf5f2('0x9b')](_0x1ec682['query']);_0x158768[_0xf5f2('0x9c')]=_[_0xf5f2('0x9d')](_0x158768['model'],_0x158768[_0xf5f2('0x8a')]);_0x18c41f[_0xf5f2('0x9e')]=_[_0xf5f2('0x9d')](_0x158768[_0xf5f2('0x99')],qs['fields'](_0x1ec682[_0xf5f2('0x8a')][_0xf5f2('0x9f')]));_0x18c41f[_0xf5f2('0x9e')]=_0x18c41f[_0xf5f2('0x9e')][_0xf5f2('0x96')]?_0x18c41f['attributes']:_0x158768['model'];if(!_0x1ec682[_0xf5f2('0x8a')][_0xf5f2('0xa0')](_0xf5f2('0xa1'))){_0x18c41f[_0xf5f2('0xa2')]=qs['limit'](_0x1ec682['query'][_0xf5f2('0xa2')]);_0x18c41f['offset']=qs['offset'](_0x1ec682['query']['offset']);}_0x18c41f[_0xf5f2('0xa3')]=qs[_0xf5f2('0xa4')](_0x1ec682[_0xf5f2('0x8a')][_0xf5f2('0xa4')]);_0x18c41f[_0xf5f2('0xa5')]=qs[_0xf5f2('0x9c')](_[_0xf5f2('0xa6')](_0x1ec682[_0xf5f2('0x8a')],_0x158768[_0xf5f2('0x9c')]));if(_0x1ec682[_0xf5f2('0x8a')][_0xf5f2('0x6')]){_0x18c41f[_0xf5f2('0xa5')]=_[_0xf5f2('0xa7')](_0x18c41f[_0xf5f2('0xa5')],{'$or':_[_0xf5f2('0xa')](_0x1bb752,function(_0x21da15){if(_0x21da15[_0xf5f2('0x11')][_0xf5f2('0xa8')]!=='VIRTUAL'){var _0xe7ac8={};_0xe7ac8[_0x21da15[_0xf5f2('0xb')]]={'$like':'%'+_0x1ec682[_0xf5f2('0x8a')][_0xf5f2('0x6')]+'%'};return _0xe7ac8;}})});}var _0x18c353=[];var _0x308220=null;var _0x16491c={};if(_0x3d3181){_0x308220=_[_0xf5f2('0x92')](_0x5588cf,['name',_0x3d3181[_0xf5f2('0xd')]]);if(_0x308220['field']){_0x16491c={};if(_0x4cce08['childModel']==='AnalyticExtractedReport'){_0x16491c[_0x308220['foreignKey']]=_['map'](_0x3d3181['associatedResources'],'id');}else{_0x16491c[_0x308220[_0xf5f2('0xa9')]]=_0x3d3181[_0xf5f2('0x9')];}_0x18c353[_0xf5f2('0x90')](_0x16491c);}else{_0x18c41f[_0xf5f2('0xa5')]['id']=_0x3d3181[_0xf5f2('0x9')];}}else{for(var _0x3cf857=0x0;_0x3cf857<_0xafba8e['length'];_0x3cf857++){_0x308220=_['find'](_0x5588cf,[_0xf5f2('0xd'),_0xafba8e[_0x3cf857]['name']]);if(_0x308220[_0xf5f2('0xb')]){_0x16491c={};_0x16491c[_0x308220[_0xf5f2('0xa9')]]=_0xafba8e[_0x3cf857]['associatedResources'];_0x18c353['push'](_0x16491c);}else{if(!_0x18c41f[_0xf5f2('0xa5')]['id'])_0x18c41f[_0xf5f2('0xa5')]['id']=[];_0xafba8e[_0x3cf857]['associatedResources'][_0xf5f2('0xaa')](function(_0x388b32){_0x18c41f['where']['id'][_0xf5f2('0x90')](_0x388b32);});}}}if(!_[_0xf5f2('0x8f')](_0x18c353)){_0x18c41f[_0xf5f2('0xa5')]=_['merge'](_0x18c41f[_0xf5f2('0xa5')],{'$and':{'$or':_0x18c353}});}_0x18c41f=_[_0xf5f2('0xa7')]({},_0x18c41f,_0x1ec682[_0xf5f2('0xab')]);if(_0x3d3181&&!_0x3d3181[_0xf5f2('0x98')]&&_0x4cce08[_0xf5f2('0x13')]===_0xf5f2('0x78')){if(_0x1ec682[_0xf5f2('0x8a')][_0xf5f2('0xac')]){_0x18c41f[_0xf5f2('0xad')]=[{'all':!![]}];}return _0x3c72ee[_0x4cce08[_0xf5f2('0x13')]][_0xf5f2('0x8')](_0x18c41f)[_0xf5f2('0xc')](function(_0x6f9240){var _0x407dd8=[];_0x6f9240[_0xf5f2('0xaa')](function(_0x28b9cd){var _0x1902c6;switch(_0x28b9cd[_0xf5f2('0xae')]){case _0xf5f2('0xaf'):_0x1902c6=_[_0xf5f2('0x92')](_0x3d3181[_0xf5f2('0x9')],function(_0x533aff){return _0x533aff['id']===_0x28b9cd[_0xf5f2('0x79')]&&_0x533aff[_0xf5f2('0x11')]==='DefaultReports';});break;case _0xf5f2('0xb0'):_0x1902c6=_[_0xf5f2('0x92')](_0x3d3181['associatedResources'],function(_0xb56304){return _0xb56304['id']===_0x28b9cd[_0xf5f2('0x79')]&&_0xb56304[_0xf5f2('0x11')]==='CustomReports';});break;}if(_0x1902c6)_0x407dd8['push'](_0x28b9cd);});_0x4a7be9[_0xf5f2('0xb1')]=_0x407dd8[_0xf5f2('0x96')];_0x4a7be9[_0xf5f2('0xb2')]=_0x407dd8;return _0x4a7be9;});}else{if(!_['isEmpty'](_0x1ec682['query'][_0xf5f2('0xb3')])){_0x18c41f[_0xf5f2('0xa5')]['id']=_0x18c41f[_0xf5f2('0xa5')]['id']?_['intersection'](_0x18c41f['where']['id'],_0x1ec682['query']['ids']):_0x1ec682['query'][_0xf5f2('0xb3')];}return _0x3c72ee[_0x4cce08['childModel']][_0xf5f2('0xb1')]({'where':_0x18c41f[_0xf5f2('0xa5')]})[_0xf5f2('0xc')](function(_0x43a167){_0x4a7be9[_0xf5f2('0xb1')]=_0x43a167;if(_0x1ec682[_0xf5f2('0x8a')][_0xf5f2('0xac')]){if(_0x4cce08[_0xf5f2('0x13')]===_0xf5f2('0xb4')){_0x18c41f[_0xf5f2('0xad')]=[{'model':_0x3c72ee[_0xf5f2('0x6e')],'as':_0xf5f2('0xb5'),'attributes':['id',_0xf5f2('0xd'),'color'],'required':_0x1ec682[_0xf5f2('0x8a')][_0xf5f2('0xb6')]?!![]:![]},{'model':_0x3c72ee['Tag'],'as':_0xf5f2('0xb7'),'attributes':['id',_0xf5f2('0xd'),'color'],'through':_0x1ec682[_0xf5f2('0x8a')][_0xf5f2('0xb6')]?{'attributes':[],'where':{'TagId':_0x1ec682[_0xf5f2('0x8a')]['tag']||undefined}}:{},'required':_0x1ec682[_0xf5f2('0x8a')][_0xf5f2('0xb6')]?!![]:![]}];}else{_0x18c41f['include']=[{'all':!![]}];}}return _0x3c72ee[_0x4cce08[_0xf5f2('0x13')]][_0xf5f2('0x8')](_0x18c41f);})[_0xf5f2('0xc')](function(_0x517aa8){_0x4a7be9[_0xf5f2('0xb2')]=_0x517aa8;if(_0x1f55af==='Agents'&&_0x1ec682[_0xf5f2('0x8a')]['openTabs']===_0xf5f2('0xb8')){var _0x3cbc58=[];for(var _0x120e2b=0x0;_0x120e2b<_0x4a7be9[_0xf5f2('0xb2')]['length'];_0x120e2b++){_0x3cbc58[_0xf5f2('0x90')](_0x572ec1('chat',_0x4a7be9['rows'][_0x120e2b]['dataValues']));_0x3cbc58[_0xf5f2('0x90')](_0x572ec1(_0xf5f2('0xb9'),_0x4a7be9['rows'][_0x120e2b][_0xf5f2('0xba')]));_0x3cbc58[_0xf5f2('0x90')](_0x572ec1(_0xf5f2('0xbb'),_0x4a7be9[_0xf5f2('0xb2')][_0x120e2b][_0xf5f2('0xba')]));_0x3cbc58[_0xf5f2('0x90')](_0x572ec1('mail',_0x4a7be9[_0xf5f2('0xb2')][_0x120e2b][_0xf5f2('0xba')]));_0x3cbc58['push'](_0x572ec1(_0xf5f2('0xbc'),_0x4a7be9[_0xf5f2('0xb2')][_0x120e2b]['dataValues']));_0x3cbc58[_0xf5f2('0x90')](_0x572ec1(_0xf5f2('0xbd'),_0x4a7be9[_0xf5f2('0xb2')][_0x120e2b][_0xf5f2('0xba')]));}return Promise[_0xf5f2('0x94')](_0x3cbc58)[_0xf5f2('0xc')](function(){return _0x4a7be9;});}return _0x4a7be9;});}});}}});};
\ No newline at end of file
+var _0x4137=['QueryTypes','select','ui.','InteractionId','from','_interactions','where','ui.UserId\x20=\x20?','sequelize','define','user_profiles','query','raw','section','mergeResources','Invalid\x20section\x20\x27','isEmpty','length','UserProfileSection','find','ignore','autoAssociation','model','all','rawAttributes','keys','filters','intersection','attributes','fields','nolimit','limit','offset','sort','pick','VIRTUAL','push','foreignKey','forEach','merge','options','include','reportType','default','reportId','DefaultReports','custom','CustomReports','rows','ids','count','includeAll','Tags','color','tag','ThroughTags','Agents','openTabs','true','chat','dataValues','sms','fax','mail','openchannel','lodash','./userProfile.attributes','../../components/parsers/qs','squel','exports','models','filter','field','value','findAll','associatedResources','catch','then','map','UserProfileResource','AnalyticExtractedReport','resourceId','type','toLowerCase','squareprojects','childModel','SquareProject','odbc','squarerecordings','SquareRecording','parentSections','SquareProjects','projectName','projects','JscriptyProject','contacts','ListId','lists','CmList','companies','globalcustomfields','CmCustomField','chatqueues','ChatQueue','chatwebsites','ChatWebsite','faxqueues','FaxQueue','faxaccounts','FaxAccount','internalroutes','outboundroutes','contexts','VoiceContext','voicemails','voicerecordings','VoiceRecording','name','role','Telephones','membername','User','VoiceQueues','queue','VoiceQueue','inbound','QueueCampaigns','outbound','MailQueue','mailaccounts','MailAccount','openchannelqueues','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','smsqueues','SmsQueue','smsaccounts','SmsAccount','whatsappqueues','WhatsappQueue','whatsappaccounts','WhatsappAccount','teams','Team','voicequeues','queuecampaigns','users','agents','telephones','Users','admin','user','zendeskaccounts','salesforceaccounts','freshdeskaccounts','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','ZohoAccount','vtigeraccounts','Disposition','customdashboards','Dashboard','Interval','Sound','tags','Tag','Template','triggers','Trigger','Trunk','variables','Variable','plugins','extractedreports','Reports','metrics','toUpperCase','slice','Sequelize'];(function(_0x34cf30,_0x52107b){var _0x4e78ba=function(_0xf226bd){while(--_0xf226bd){_0x34cf30['push'](_0x34cf30['shift']());}};_0x4e78ba(++_0x52107b);}(_0x4137,0xf8));var _0x7413=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x4137[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0x7413('0x0'));var attributes=require(_0x7413('0x1'));var qs=require(_0x7413('0x2'));var squel=require(_0x7413('0x3'));module[_0x7413('0x4')]=function(_0x410971){var _0x2e6df7=_0x410971[_0x7413('0x5')];function _0x258255(_0x3dc48a,_0x451a96){return new Promise(function(_0x3bb181,_0x4fbade){if(!_0x451a96)return _0x3bb181(null);var _0xc808cd=_0x451a96[_0x7413('0x6')]?{[_0x451a96[_0x7413('0x6')][_0x7413('0x7')]]:_0x451a96['filter'][_0x7413('0x8')]}:undefined;return _0x2e6df7[_0x3dc48a][_0x7413('0x9')]({'where':_0xc808cd,'raw':!![]})['then'](function(_0x422bf5){_0x451a96[_0x7413('0xa')]=_['map'](_0x422bf5,'id');_0x3bb181(_0x451a96);})[_0x7413('0xb')](function(_0x427b3b){_0x4fbade(_0x427b3b);});});}function _0x737ab4(_0x3e026b,_0x14212d){return new Promise(function(_0x5a1e62,_0xa25d72){var _0x32034c=_0x3e026b['filter']?{[_0x3e026b[_0x7413('0x6')][_0x7413('0x7')]]:_0x3e026b[_0x7413('0x6')]['value']}:undefined;return _0x2e6df7[_0x3e026b['model']]['findAll']({'where':_0x32034c,'raw':!![]})[_0x7413('0xc')](function(_0x336c4c){_0x14212d['associatedResources']=_[_0x7413('0xd')](_0x336c4c,function(_0x45bef0){return _0x45bef0['name'];});_0x5a1e62(_0x14212d);})[_0x7413('0xb')](function(_0x50f301){_0xa25d72(_0x50f301);});});}function _0x4b9a5b(_0x26501b,_0x568d1f,_0x195c72){if(!_0x568d1f)return Promise['resolve'](null);return new Promise(function(_0x2036b6,_0x3230d8){return _0x2e6df7[_0x7413('0xe')][_0x7413('0x9')]({'where':{'sectionId':_0x568d1f['id']},'raw':!![]})[_0x7413('0xc')](function(_0x26dafe){if(_0x26501b['field']&&_0x26501b[_0x7413('0x7')]!=='id'){_0x568d1f[_0x7413('0xa')]=_[_0x7413('0xd')](_0x26dafe,function(_0xfe5b8c){return _0xfe5b8c[_0x26501b['field']];});}else{if(_0x195c72===_0x7413('0xf')){_0x568d1f[_0x7413('0xa')]=_[_0x7413('0xd')](_0x26dafe,function(_0x20d3d2){return{'id':_0x20d3d2[_0x7413('0x10')],'type':_0x20d3d2[_0x7413('0x11')]};});}else{_0x568d1f[_0x7413('0xa')]=_[_0x7413('0xd')](_0x26dafe,function(_0x56a06a){return _0x56a06a['resourceId'];});}}_0x2036b6(_0x568d1f);})[_0x7413('0xb')](function(_0x599654){_0x3230d8(_0x599654);});});}function _0x1585ba(_0x372944,_0x3b0c81){var _0x2fc0f4={'parentSections':[]};switch(_0x372944[_0x7413('0x12')]()){case _0x7413('0x13'):_0x2fc0f4[_0x7413('0x14')]=_0x7413('0x15');break;case _0x7413('0x16'):_0x2fc0f4['childModel']='SquareOdbc';break;case _0x7413('0x17'):_0x2fc0f4['childModel']=_0x7413('0x18');_0x2fc0f4[_0x7413('0x19')]=[{'name':_0x7413('0x1a'),'field':'name','foreignKey':_0x7413('0x1b')}];break;case _0x7413('0x1c'):_0x2fc0f4[_0x7413('0x14')]=_0x7413('0x1d');break;case _0x7413('0x1e'):_0x2fc0f4[_0x7413('0x14')]='CmContact';_0x2fc0f4[_0x7413('0x19')]=[{'name':'Lists','field':'id','foreignKey':_0x7413('0x1f')}];break;case _0x7413('0x20'):_0x2fc0f4[_0x7413('0x14')]=_0x7413('0x21');break;case _0x7413('0x22'):_0x2fc0f4[_0x7413('0x14')]='CmCompany';break;case _0x7413('0x23'):_0x2fc0f4[_0x7413('0x14')]=_0x7413('0x24');break;case _0x7413('0x25'):_0x2fc0f4[_0x7413('0x14')]=_0x7413('0x26');break;case _0x7413('0x27'):_0x2fc0f4['childModel']=_0x7413('0x28');break;case _0x7413('0x29'):_0x2fc0f4[_0x7413('0x14')]=_0x7413('0x2a');break;case _0x7413('0x2b'):_0x2fc0f4['childModel']=_0x7413('0x2c');break;case'inboundroutes':case _0x7413('0x2d'):case _0x7413('0x2e'):_0x2fc0f4[_0x7413('0x14')]='VoiceExtension';break;case _0x7413('0x2f'):_0x2fc0f4['childModel']=_0x7413('0x30');break;case _0x7413('0x31'):_0x2fc0f4['childModel']='VoiceMail';break;case _0x7413('0x32'):_0x2fc0f4[_0x7413('0x14')]=_0x7413('0x33');_0x2fc0f4['parentSections']=[{'name':'Agents','field':_0x7413('0x34'),'foreignKey':'membername','model':'User','filter':{'field':_0x7413('0x35'),'value':['agent']}},{'name':_0x7413('0x36'),'field':_0x7413('0x34'),'foreignKey':_0x7413('0x37'),'model':_0x7413('0x38'),'filter':{'field':_0x7413('0x35'),'value':['telephone']}},{'name':_0x7413('0x39'),'field':_0x7413('0x34'),'foreignKey':_0x7413('0x3a'),'model':_0x7413('0x3b'),'filter':{'field':_0x7413('0x11'),'value':[_0x7413('0x3c')]}},{'name':_0x7413('0x3d'),'field':_0x7413('0x34'),'foreignKey':_0x7413('0x3a'),'model':_0x7413('0x3b'),'filter':{'field':_0x7413('0x11'),'value':[_0x7413('0x3e')]}}];break;case'musiconholds':_0x2fc0f4[_0x7413('0x14')]='VoiceMusicOnHold';break;case'chanspies':_0x2fc0f4['childModel']='VoiceChanSpy';break;case'voiceprefixes':_0x2fc0f4[_0x7413('0x14')]='VoicePrefix';break;case'ivrcampaigns':_0x2fc0f4[_0x7413('0x14')]='Campaign';break;case'mailqueues':_0x2fc0f4[_0x7413('0x14')]=_0x7413('0x3f');break;case _0x7413('0x40'):_0x2fc0f4[_0x7413('0x14')]=_0x7413('0x41');break;case'mailsubstatuses':_0x2fc0f4[_0x7413('0x14')]='MailSubstatus';break;case _0x7413('0x42'):_0x2fc0f4[_0x7413('0x14')]=_0x7413('0x43');break;case _0x7413('0x44'):_0x2fc0f4[_0x7413('0x14')]=_0x7413('0x45');break;case _0x7413('0x46'):_0x2fc0f4[_0x7413('0x14')]=_0x7413('0x47');break;case _0x7413('0x48'):_0x2fc0f4[_0x7413('0x14')]=_0x7413('0x49');break;case _0x7413('0x4a'):_0x2fc0f4['childModel']=_0x7413('0x4b');break;case _0x7413('0x4c'):_0x2fc0f4[_0x7413('0x14')]=_0x7413('0x4d');break;case _0x7413('0x4e'):_0x2fc0f4[_0x7413('0x14')]=_0x7413('0x4f');break;case _0x7413('0x50'):case _0x7413('0x51'):_0x2fc0f4[_0x7413('0x14')]=_0x7413('0x3b');if(_0x3b0c81){_0x2fc0f4['parentSections']=[{'name':_0x7413('0x39')},{'name':'QueueCampaigns'}];}break;case _0x7413('0x52'):case _0x7413('0x53'):case _0x7413('0x54'):_0x2fc0f4[_0x7413('0x14')]=_0x7413('0x38');if(_0x3b0c81){_0x2fc0f4[_0x7413('0x19')]=[{'name':_0x7413('0x55'),'filter':{'field':_0x7413('0x35'),'value':[_0x7413('0x56'),_0x7413('0x57')]},'ignore':!![]},{'name':'Agents'},{'name':'Telephones'}];}break;case _0x7413('0x58'):_0x2fc0f4['childModel']='ZendeskAccount';break;case _0x7413('0x59'):_0x2fc0f4[_0x7413('0x14')]='SalesforceAccount';break;case _0x7413('0x5a'):_0x2fc0f4['childModel']='FreshdeskAccount';break;case _0x7413('0x5b'):_0x2fc0f4['childModel']=_0x7413('0x5c');break;case _0x7413('0x5d'):_0x2fc0f4[_0x7413('0x14')]=_0x7413('0x5e');break;case _0x7413('0x5f'):_0x2fc0f4[_0x7413('0x14')]=_0x7413('0x60');break;case _0x7413('0x61'):_0x2fc0f4[_0x7413('0x14')]=_0x7413('0x38');break;case'cannedanswers':_0x2fc0f4[_0x7413('0x14')]='CannedAnswer';break;case'dispositions':_0x2fc0f4['childModel']=_0x7413('0x62');break;case _0x7413('0x63'):_0x2fc0f4[_0x7413('0x14')]=_0x7413('0x64');break;case'intervals':_0x2fc0f4['childModel']=_0x7413('0x65');break;case'pauses':_0x2fc0f4[_0x7413('0x14')]='Pause';break;case'scheduler':_0x2fc0f4['childModel']='Schedule';break;case'sounds':_0x2fc0f4[_0x7413('0x14')]=_0x7413('0x66');break;case _0x7413('0x67'):_0x2fc0f4[_0x7413('0x14')]=_0x7413('0x68');break;case'templates':_0x2fc0f4[_0x7413('0x14')]=_0x7413('0x69');break;case _0x7413('0x6a'):_0x2fc0f4['childModel']=_0x7413('0x6b');break;case'trunks':_0x2fc0f4['childModel']=_0x7413('0x6c');break;case _0x7413('0x6d'):_0x2fc0f4[_0x7413('0x14')]=_0x7413('0x6e');break;case _0x7413('0x6f'):_0x2fc0f4[_0x7413('0x14')]='Plugin';break;case _0x7413('0x70'):_0x2fc0f4['childModel']=_0x7413('0xf');_0x2fc0f4['parentSections']=[{'name':_0x7413('0x71'),'field':'id','foreignKey':'reportId'}];break;case _0x7413('0x72'):_0x2fc0f4[_0x7413('0x14')]='AnalyticMetric';break;}return _0x2fc0f4;}function _0x269976(_0x549623,_0xf01452){var _0x2a5db6=_0x549623['charAt'](0x0)[_0x7413('0x73')]()+_0x549623[_0x7413('0x74')](0x1);var _0x59d639={'type':_0x2e6df7[_0x7413('0x75')][_0x7413('0x76')]['SELECT'],'raw':!![]};return new Promise(function(_0xf4641,_0x28eaf4){var _0x34211b=squel[_0x7413('0x77')]()[_0x7413('0x7')](_0x7413('0x78')+_0x2a5db6+_0x7413('0x79'),'id')[_0x7413('0x7')]('ui.createdAt')[_0x7413('0x7a')]('user_has_'+_0x549623+_0x7413('0x7b'),'ui')[_0x7413('0x7c')](_0x7413('0x7d'),_0xf01452['id']);return _0x2e6df7[_0x7413('0x7e')]['query'](_0x34211b['toString'](),_0x59d639)['then'](function(_0x56b090){_0xf01452[_0x2a5db6+'OpenTabs']=_0x56b090;_0xf4641(_0x56b090);})[_0x7413('0xb')](function(_0x1c00e6){_0x28eaf4(_0x1c00e6);});});}return _0x410971[_0x7413('0x7f')]('UserProfile',attributes,{'tableName':_0x7413('0x80'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0xb7dd83){var _0x12544d={'raw':_0xb7dd83[_0x7413('0x81')][_0x7413('0x82')],'where':{}};var _0x3db284={};var _0x2f0f0c={'count':0x0,'rows':[]};var _0x295a0a=_0xb7dd83[_0x7413('0x81')][_0x7413('0x83')];var _0x3f9cfd=_0xb7dd83[_0x7413('0x81')][_0x7413('0x84')]||![];var _0x4b381e=_0x1585ba(_0x295a0a,_0x3f9cfd);if(!_0x4b381e[_0x7413('0x14')])throw new Error(_0x7413('0x85')+_0x295a0a+'\x27');var _0x4cab22=[{'name':_0x295a0a}];if(!_[_0x7413('0x86')](_0x4b381e[_0x7413('0x19')]))_0x4cab22=_0x4b381e[_0x7413('0x19')];var _0x5e4aa1=[];for(var _0x102fd2=0x0;_0x102fd2<_0x4cab22[_0x7413('0x87')];_0x102fd2++){_0x5e4aa1['push'](_0x2e6df7[_0x7413('0x88')][_0x7413('0x89')]({'where':{'userProfileId':_0xb7dd83['params']['id'],'name':_0x4cab22[_0x102fd2][_0x7413('0x34')]},'raw':!![]}));}return Promise['all'](_0x5e4aa1)['then'](function(_0xbb819a){var _0xbd74d9=_[_0x7413('0x6')](_0xbb819a,function(_0x3d2f93){return _0x3d2f93?_0x3d2f93:undefined;});var _0x128419=_[_0x7413('0x6')](_0x4cab22,[_0x7413('0x8a'),!![]]);var _0x2f8637=_['isEmpty'](_0xbd74d9)&&_[_0x7413('0x86')](_0x128419)?null:_['union'](_0x128419,_0xbd74d9);if(!_0x2f8637)return null;var _0xd9c741=[];for(var _0x3deb37=0x0;_0x3deb37<_0x2f8637[_0x7413('0x87')];_0x3deb37++){var _0x3054f5=_[_0x7413('0x89')](_0x4cab22,function(_0x29d919){return _0x2f8637[_0x3deb37]?_0x29d919[_0x7413('0x34')]===_0x2f8637[_0x3deb37][_0x7413('0x34')]:null;});if(_0x3054f5){if(_0x2f8637[_0x3deb37][_0x7413('0x8a')]){_0xd9c741['push'](_0x258255(_0x4b381e[_0x7413('0x14')],_0x2f8637[_0x3deb37]));}else{if(!_0x2f8637[_0x3deb37][_0x7413('0x8b')]){_0xd9c741['push'](_0x4b9a5b(_0x3054f5,_0x2f8637[_0x3deb37],_0x4b381e[_0x7413('0x14')]));}else{if(_0x3054f5[_0x7413('0x8c')]){_0xd9c741['push'](_0x737ab4(_0x3054f5,_0x2f8637[_0x3deb37]));}}}}}return Promise[_0x7413('0x8d')](_0xd9c741);})['then'](function(_0xcbc6e){var _0x3d4ce3=_0xcbc6e;var _0x54f03d=null;if(_0x3d4ce3){_0x54f03d=_0x3d4ce3['length']===0x1?_0x3d4ce3[0x0]:null;}if(!_0x54f03d&&!_0x3d4ce3)return _0x2f0f0c;var _0x227a66=_0x2e6df7[_0x4b381e[_0x7413('0x14')]][_0x7413('0x8e')];_0x3db284['model']=_[_0x7413('0x8f')](_0x227a66);_0x3db284[_0x7413('0x81')]=_[_0x7413('0x8f')](_0xb7dd83[_0x7413('0x81')]);_0x3db284[_0x7413('0x90')]=_[_0x7413('0x91')](_0x3db284['model'],_0x3db284[_0x7413('0x81')]);_0x12544d[_0x7413('0x92')]=_[_0x7413('0x91')](_0x3db284['model'],qs[_0x7413('0x93')](_0xb7dd83[_0x7413('0x81')][_0x7413('0x93')]));_0x12544d[_0x7413('0x92')]=_0x12544d[_0x7413('0x92')][_0x7413('0x87')]?_0x12544d[_0x7413('0x92')]:_0x3db284[_0x7413('0x8c')];if(!_0xb7dd83[_0x7413('0x81')]['hasOwnProperty'](_0x7413('0x94'))){_0x12544d[_0x7413('0x95')]=qs[_0x7413('0x95')](_0xb7dd83[_0x7413('0x81')][_0x7413('0x95')]);_0x12544d[_0x7413('0x96')]=qs['offset'](_0xb7dd83[_0x7413('0x81')]['offset']);}_0x12544d['order']=qs[_0x7413('0x97')](_0xb7dd83[_0x7413('0x81')]['sort']);_0x12544d[_0x7413('0x7c')]=qs[_0x7413('0x90')](_[_0x7413('0x98')](_0xb7dd83[_0x7413('0x81')],_0x3db284[_0x7413('0x90')]));if(_0xb7dd83[_0x7413('0x81')][_0x7413('0x6')]){_0x12544d[_0x7413('0x7c')]=_['merge'](_0x12544d[_0x7413('0x7c')],{'$or':_['map'](_0x227a66,function(_0xeaf166){if(_0xeaf166[_0x7413('0x11')]['key']!==_0x7413('0x99')){var _0x1f4ce0={};_0x1f4ce0[_0xeaf166[_0x7413('0x7')]]={'$like':'%'+_0xb7dd83[_0x7413('0x81')][_0x7413('0x6')]+'%'};return _0x1f4ce0;}})});}var _0x3920b5=[];var _0x3dcbfb=null;var _0x12fbb2={};if(_0x54f03d){_0x3dcbfb=_[_0x7413('0x89')](_0x4cab22,[_0x7413('0x34'),_0x54f03d['name']]);if(_0x3dcbfb[_0x7413('0x7')]){_0x12fbb2={};if(_0x4b381e[_0x7413('0x14')]==='AnalyticExtractedReport'){_0x12fbb2[_0x3dcbfb['foreignKey']]=_['map'](_0x54f03d[_0x7413('0xa')],'id');}else{_0x12fbb2[_0x3dcbfb['foreignKey']]=_0x54f03d[_0x7413('0xa')];}_0x3920b5[_0x7413('0x9a')](_0x12fbb2);}else{_0x12544d[_0x7413('0x7c')]['id']=_0x54f03d[_0x7413('0xa')];}}else{for(var _0x470c21=0x0;_0x470c21<_0x3d4ce3[_0x7413('0x87')];_0x470c21++){_0x3dcbfb=_[_0x7413('0x89')](_0x4cab22,[_0x7413('0x34'),_0x3d4ce3[_0x470c21][_0x7413('0x34')]]);if(_0x3dcbfb['field']){_0x12fbb2={};_0x12fbb2[_0x3dcbfb[_0x7413('0x9b')]]=_0x3d4ce3[_0x470c21][_0x7413('0xa')];_0x3920b5[_0x7413('0x9a')](_0x12fbb2);}else{if(!_0x12544d['where']['id'])_0x12544d[_0x7413('0x7c')]['id']=[];_0x3d4ce3[_0x470c21][_0x7413('0xa')][_0x7413('0x9c')](function(_0x432906){_0x12544d[_0x7413('0x7c')]['id'][_0x7413('0x9a')](_0x432906);});}}}if(!_[_0x7413('0x86')](_0x3920b5)){_0x12544d[_0x7413('0x7c')]=_[_0x7413('0x9d')](_0x12544d[_0x7413('0x7c')],{'$and':{'$or':_0x3920b5}});}_0x12544d=_['merge']({},_0x12544d,_0xb7dd83[_0x7413('0x9e')]);if(_0x54f03d&&!_0x54f03d[_0x7413('0x8b')]&&_0x4b381e['childModel']===_0x7413('0xf')){if(_0xb7dd83[_0x7413('0x81')]['includeAll']){_0x12544d[_0x7413('0x9f')]=[{'all':!![]}];}return _0x2e6df7[_0x4b381e[_0x7413('0x14')]][_0x7413('0x9')](_0x12544d)['then'](function(_0x36d8cf){var _0x5a44bd=[];_0x36d8cf[_0x7413('0x9c')](function(_0x35f721){var _0x4537b5;switch(_0x35f721[_0x7413('0xa0')]){case _0x7413('0xa1'):_0x4537b5=_[_0x7413('0x89')](_0x54f03d['associatedResources'],function(_0x4ece1){return _0x4ece1['id']===_0x35f721[_0x7413('0xa2')]&&_0x4ece1[_0x7413('0x11')]===_0x7413('0xa3');});break;case _0x7413('0xa4'):_0x4537b5=_['find'](_0x54f03d[_0x7413('0xa')],function(_0x566ee0){return _0x566ee0['id']===_0x35f721[_0x7413('0xa2')]&&_0x566ee0[_0x7413('0x11')]===_0x7413('0xa5');});break;}if(_0x4537b5)_0x5a44bd['push'](_0x35f721);});_0x2f0f0c['count']=_0x5a44bd[_0x7413('0x87')];_0x2f0f0c[_0x7413('0xa6')]=_0x5a44bd;return _0x2f0f0c;});}else{if(!_[_0x7413('0x86')](_0xb7dd83[_0x7413('0x81')]['ids'])){_0x12544d['where']['id']=_0x12544d[_0x7413('0x7c')]['id']?_[_0x7413('0x91')](_0x12544d[_0x7413('0x7c')]['id'],_0xb7dd83['query']['ids']):_0xb7dd83[_0x7413('0x81')][_0x7413('0xa7')];}return _0x2e6df7[_0x4b381e[_0x7413('0x14')]][_0x7413('0xa8')]({'where':_0x12544d[_0x7413('0x7c')]})[_0x7413('0xc')](function(_0x5fd045){_0x2f0f0c['count']=_0x5fd045;if(_0xb7dd83['query'][_0x7413('0xa9')]){if(_0x4b381e[_0x7413('0x14')]==='CmContact'){_0x12544d[_0x7413('0x9f')]=[{'model':_0x2e6df7[_0x7413('0x68')],'as':_0x7413('0xaa'),'attributes':['id',_0x7413('0x34'),_0x7413('0xab')],'required':_0xb7dd83[_0x7413('0x81')][_0x7413('0xac')]?!![]:![]},{'model':_0x2e6df7[_0x7413('0x68')],'as':_0x7413('0xad'),'attributes':['id','name',_0x7413('0xab')],'through':_0xb7dd83[_0x7413('0x81')][_0x7413('0xac')]?{'attributes':[],'where':{'TagId':_0xb7dd83[_0x7413('0x81')][_0x7413('0xac')]||undefined}}:{},'required':_0xb7dd83[_0x7413('0x81')]['tag']?!![]:![]}];}else{_0x12544d['include']=[{'all':!![]}];}}return _0x2e6df7[_0x4b381e['childModel']][_0x7413('0x9')](_0x12544d);})[_0x7413('0xc')](function(_0x999109){_0x2f0f0c[_0x7413('0xa6')]=_0x999109;if(_0x295a0a===_0x7413('0xae')&&_0xb7dd83[_0x7413('0x81')][_0x7413('0xaf')]===_0x7413('0xb0')){var _0x4e872e=[];for(var _0x11f5a3=0x0;_0x11f5a3<_0x2f0f0c['rows'][_0x7413('0x87')];_0x11f5a3++){_0x4e872e[_0x7413('0x9a')](_0x269976(_0x7413('0xb1'),_0x2f0f0c[_0x7413('0xa6')][_0x11f5a3][_0x7413('0xb2')]));_0x4e872e['push'](_0x269976(_0x7413('0xb3'),_0x2f0f0c[_0x7413('0xa6')][_0x11f5a3][_0x7413('0xb2')]));_0x4e872e[_0x7413('0x9a')](_0x269976(_0x7413('0xb4'),_0x2f0f0c[_0x7413('0xa6')][_0x11f5a3][_0x7413('0xb2')]));_0x4e872e[_0x7413('0x9a')](_0x269976(_0x7413('0xb5'),_0x2f0f0c[_0x7413('0xa6')][_0x11f5a3][_0x7413('0xb2')]));_0x4e872e[_0x7413('0x9a')](_0x269976(_0x7413('0xb6'),_0x2f0f0c[_0x7413('0xa6')][_0x11f5a3][_0x7413('0xb2')]));_0x4e872e['push'](_0x269976('whatsapp',_0x2f0f0c[_0x7413('0xa6')][_0x11f5a3][_0x7413('0xb2')]));}return Promise['all'](_0x4e872e)[_0x7413('0xc')](function(){return _0x2f0f0c;});}return _0x2f0f0c;});}});}}});};
\ No newline at end of file
index 537797c..af2885a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x649f=['request','then','info','UserProfile,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','register'];(function(_0xcbf392,_0x348ccc){var _0x1a7097=function(_0x5055f9){while(--_0x5055f9){_0xcbf392['push'](_0xcbf392['shift']());}};_0x1a7097(++_0x348ccc);}(_0x649f,0x93));var _0xf649=function(_0xa8883,_0x1f107f){_0xa8883=_0xa8883-0x0;var _0x479426=_0x649f[_0xa8883];return _0x479426;};'use strict';var _=require(_0xf649('0x0'));var util=require(_0xf649('0x1'));var moment=require(_0xf649('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf649('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xf649('0x4'));var logger=require(_0xf649('0x5'))(_0xf649('0x6'));var config=require(_0xf649('0x7'));var jayson=require(_0xf649('0x8'));var client=jayson[_0xf649('0x9')][_0xf649('0xa')]({'port':0x232a});config[_0xf649('0xb')]=_['defaults'](config['redis'],{'host':_0xf649('0xc'),'port':0x18eb});var socket=require(_0xf649('0xd'))(new Redis(config[_0xf649('0xb')]));require('./userProfile.socket')[_0xf649('0xe')](socket);function respondWithRpcPromise(_0x2a278c,_0x38d583,_0x4061a2){return new BPromise(function(_0x5abb8f,_0x7f5eda){return client[_0xf649('0xf')](_0x2a278c,_0x4061a2)[_0xf649('0x10')](function(_0xe5a71c){logger[_0xf649('0x11')](_0xf649('0x12'),_0x38d583,'request\x20sent');logger[_0xf649('0x13')]('UserProfile,\x20%s,\x20%s,\x20%s',_0x38d583,'request\x20sent',JSON[_0xf649('0x14')](_0xe5a71c));if(_0xe5a71c[_0xf649('0x15')]){if(_0xe5a71c[_0xf649('0x15')][_0xf649('0x16')]===0x1f4){logger[_0xf649('0x15')](_0xf649('0x12'),_0x38d583,_0xe5a71c[_0xf649('0x15')][_0xf649('0x17')]);return _0x7f5eda(_0xe5a71c['error'][_0xf649('0x17')]);}logger[_0xf649('0x15')]('UserProfile,\x20%s,\x20%s',_0x38d583,_0xe5a71c[_0xf649('0x15')][_0xf649('0x17')]);return _0x5abb8f(_0xe5a71c[_0xf649('0x15')]['message']);}else{logger['info'](_0xf649('0x12'),_0x38d583,_0xf649('0x18'));_0x5abb8f(_0xe5a71c[_0xf649('0x19')][_0xf649('0x17')]);}})[_0xf649('0x1a')](function(_0x2d956d){logger[_0xf649('0x15')](_0xf649('0x12'),_0x38d583,_0x2d956d);_0x7f5eda(_0x2d956d);});});}
\ No newline at end of file
+var _0xa064=['request','then','info','request\x20sent','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','code','message','UserProfile,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','client','http','defaults','redis','./userProfile.socket','register'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0xa064,0x192));var _0x4a06=function(_0xd6ca7,_0xf8aca2){_0xd6ca7=_0xd6ca7-0x0;var _0x5f269f=_0xa064[_0xd6ca7];return _0x5f269f;};'use strict';var _=require(_0x4a06('0x0'));var util=require(_0x4a06('0x1'));var moment=require(_0x4a06('0x2'));var BPromise=require(_0x4a06('0x3'));var rs=require(_0x4a06('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4a06('0x5'));var logger=require('../../config/logger')(_0x4a06('0x6'));var config=require(_0x4a06('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x4a06('0x8')][_0x4a06('0x9')]({'port':0x232a});config['redis']=_[_0x4a06('0xa')](config[_0x4a06('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4a06('0xb')]));require(_0x4a06('0xc'))[_0x4a06('0xd')](socket);function respondWithRpcPromise(_0x157495,_0x51079c,_0x167769){return new BPromise(function(_0x1b8308,_0x40bf75){return client[_0x4a06('0xe')](_0x157495,_0x167769)[_0x4a06('0xf')](function(_0x455225){logger[_0x4a06('0x10')]('UserProfile,\x20%s,\x20%s',_0x51079c,_0x4a06('0x11'));logger['debug'](_0x4a06('0x12'),_0x51079c,_0x4a06('0x11'),JSON[_0x4a06('0x13')](_0x455225));if(_0x455225['error']){if(_0x455225[_0x4a06('0x14')][_0x4a06('0x15')]===0x1f4){logger[_0x4a06('0x14')]('UserProfile,\x20%s,\x20%s',_0x51079c,_0x455225[_0x4a06('0x14')][_0x4a06('0x16')]);return _0x40bf75(_0x455225[_0x4a06('0x14')]['message']);}logger[_0x4a06('0x14')](_0x4a06('0x17'),_0x51079c,_0x455225[_0x4a06('0x14')][_0x4a06('0x16')]);return _0x1b8308(_0x455225[_0x4a06('0x14')]['message']);}else{logger[_0x4a06('0x10')]('UserProfile,\x20%s,\x20%s',_0x51079c,_0x4a06('0x11'));_0x1b8308(_0x455225[_0x4a06('0x18')][_0x4a06('0x16')]);}})[_0x4a06('0x19')](function(_0x28b067){logger[_0x4a06('0x14')](_0x4a06('0x17'),_0x51079c,_0x28b067);_0x40bf75(_0x28b067);});});}
\ No newline at end of file
index e011b79..6e4744d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x41e3=['emit','register','length','userProfile:','save','remove','update'];(function(_0x103c4c,_0x285348){var _0x3fc15e=function(_0x40e0e6){while(--_0x40e0e6){_0x103c4c['push'](_0x103c4c['shift']());}};_0x3fc15e(++_0x285348);}(_0x41e3,0xb3));var _0x341e=function(_0x4d593e,_0x131776){_0x4d593e=_0x4d593e-0x0;var _0x31e2df=_0x41e3[_0x4d593e];return _0x31e2df;};'use strict';var UserProfileEvents=require('./userProfile.events');var events=[_0x341e('0x0'),_0x341e('0x1'),_0x341e('0x2')];function createListener(_0x5668b9,_0xbda4b7){return function(_0x27f419){_0xbda4b7[_0x341e('0x3')](_0x5668b9,_0x27f419);};}function removeListener(_0xef3be3,_0x144f6f){return function(){UserProfileEvents['removeListener'](_0xef3be3,_0x144f6f);};}exports[_0x341e('0x4')]=function(_0x79164f){for(var _0x46bd00=0x0,_0x3ff69e=events[_0x341e('0x5')];_0x46bd00<_0x3ff69e;_0x46bd00++){var _0x45d260=events[_0x46bd00];var _0x5e4a64=createListener(_0x341e('0x6')+_0x45d260,_0x79164f);UserProfileEvents['on'](_0x45d260,_0x5e4a64);}};
\ No newline at end of file
+var _0x2482=['remove','update','emit','removeListener','register','length','userProfile:','save'];(function(_0x562d2a,_0x5b12b6){var _0x51aa29=function(_0x32d5a4){while(--_0x32d5a4){_0x562d2a['push'](_0x562d2a['shift']());}};_0x51aa29(++_0x5b12b6);}(_0x2482,0x10f));var _0x2248=function(_0x1d0458,_0x389f29){_0x1d0458=_0x1d0458-0x0;var _0x35eea4=_0x2482[_0x1d0458];return _0x35eea4;};'use strict';var UserProfileEvents=require('./userProfile.events');var events=[_0x2248('0x0'),_0x2248('0x1'),_0x2248('0x2')];function createListener(_0x5750ff,_0x1e47e2){return function(_0x218f0d){_0x1e47e2[_0x2248('0x3')](_0x5750ff,_0x218f0d);};}function removeListener(_0x37beee,_0x515687){return function(){UserProfileEvents[_0x2248('0x4')](_0x37beee,_0x515687);};}exports[_0x2248('0x5')]=function(_0x4be501){for(var _0x4908c7=0x0,_0x18ba30=events[_0x2248('0x6')];_0x4908c7<_0x18ba30;_0x4908c7++){var _0x40768e=events[_0x4908c7];var _0x5efd5e=createListener(_0x2248('0x7')+_0x40768e,_0x4be501);UserProfileEvents['on'](_0x40768e,_0x5efd5e);}};
\ No newline at end of file
index 4be95f1..0f2fada 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x020a=['/describe','isAuthenticated','/:id','show','create','put','update','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./userProfileResource.controller'];(function(_0x45ccd2,_0x4ecb10){var _0x554dff=function(_0x2f9bea){while(--_0x2f9bea){_0x45ccd2['push'](_0x45ccd2['shift']());}};_0x554dff(++_0x4ecb10);}(_0x020a,0x105));var _0xa020=function(_0x695b76,_0x551526){_0x695b76=_0x695b76-0x0;var _0x1dc21f=_0x020a[_0x695b76];return _0x1dc21f;};'use strict';var multer=require(_0xa020('0x0'));var util=require(_0xa020('0x1'));var path=require(_0xa020('0x2'));var timeout=require('connect-timeout');var express=require(_0xa020('0x3'));var router=express[_0xa020('0x4')]();var fs_extra=require(_0xa020('0x5'));var auth=require(_0xa020('0x6'));var interaction=require(_0xa020('0x7'));var config=require('../../config/environment');var controller=require(_0xa020('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xa020('0x9'),auth[_0xa020('0xa')](),controller['describe']);router['get'](_0xa020('0xb'),auth[_0xa020('0xa')](),controller[_0xa020('0xc')]);router['post']('/',auth[_0xa020('0xa')](),controller[_0xa020('0xd')]);router[_0xa020('0xe')](_0xa020('0xb'),auth['isAuthenticated'](),controller[_0xa020('0xf')]);router['delete'](_0xa020('0xb'),auth[_0xa020('0xa')](),controller[_0xa020('0x10')]);module[_0xa020('0x11')]=router;
\ No newline at end of file
+var _0x265b=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','update','delete','exports'];(function(_0x2bc1fe,_0x45da98){var _0x1a47a5=function(_0x2e5053){while(--_0x2e5053){_0x2bc1fe['push'](_0x2bc1fe['shift']());}};_0x1a47a5(++_0x45da98);}(_0x265b,0x6e));var _0xb265=function(_0x264290,_0xc8926d){_0x264290=_0x264290-0x0;var _0x3f1b46=_0x265b[_0x264290];return _0x3f1b46;};'use strict';var multer=require(_0xb265('0x0'));var util=require(_0xb265('0x1'));var path=require(_0xb265('0x2'));var timeout=require(_0xb265('0x3'));var express=require(_0xb265('0x4'));var router=express[_0xb265('0x5')]();var fs_extra=require(_0xb265('0x6'));var auth=require(_0xb265('0x7'));var interaction=require(_0xb265('0x8'));var config=require(_0xb265('0x9'));var controller=require('./userProfileResource.controller');router[_0xb265('0xa')]('/',auth[_0xb265('0xb')](),controller[_0xb265('0xc')]);router['get'](_0xb265('0xd'),auth['isAuthenticated'](),controller[_0xb265('0xe')]);router[_0xb265('0xa')](_0xb265('0xf'),auth['isAuthenticated'](),controller[_0xb265('0x10')]);router[_0xb265('0x11')]('/',auth['isAuthenticated'](),controller[_0xb265('0x12')]);router['put'](_0xb265('0xf'),auth[_0xb265('0xb')](),controller[_0xb265('0x13')]);router[_0xb265('0x14')](_0xb265('0xf'),auth[_0xb265('0xb')](),controller['destroy']);module[_0xb265('0x15')]=router;
\ No newline at end of file
index bef6d48..c1153ed 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc0f1=['STRING'];(function(_0x2f95a9,_0x1654c5){var _0x2798ab=function(_0xe23dfa){while(--_0xe23dfa){_0x2f95a9['push'](_0x2f95a9['shift']());}};_0x2798ab(++_0x1654c5);}(_0xc0f1,0x1ba));var _0x1c0f=function(_0x19f9e6,_0x4f59a6){_0x19f9e6=_0x19f9e6-0x0;var _0x45c862=_0xc0f1[_0x19f9e6];return _0x45c862;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'resourceId':{'type':Sequelize['INTEGER'],'allowNull':![]},'type':{'type':Sequelize[_0x1c0f('0x0')],'allowNull':![]}};
\ No newline at end of file
+var _0x7e55=['INTEGER','STRING','sequelize','exports'];(function(_0x817d9b,_0x3c37e3){var _0x2752e1=function(_0x2b434e){while(--_0x2b434e){_0x817d9b['push'](_0x817d9b['shift']());}};_0x2752e1(++_0x3c37e3);}(_0x7e55,0x9a));var _0x57e5=function(_0xf26d40,_0x2f4f46){_0xf26d40=_0xf26d40-0x0;var _0x50b68c=_0x7e55[_0xf26d40];return _0x50b68c;};'use strict';var Sequelize=require(_0x57e5('0x0'));module[_0x57e5('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'resourceId':{'type':Sequelize[_0x57e5('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x57e5('0x3')],'allowNull':![]}};
\ No newline at end of file
index 3360223..4407445 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x524e=['end','json','offset','limit','count','set','apply','reject','save','update','destroy','name','send','index','map','rawAttributes','key','model','keys','filters','intersection','attributes','fields','query','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','UserProfileResource','then','includeAll','include','findAll','rows','catch','show','length','find','create','body','params','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x5d056b,_0x426ba2){var _0x14bf67=function(_0x2cdee9){while(--_0x2cdee9){_0x5d056b['push'](_0x5d056b['shift']());}};_0x14bf67(++_0x426ba2);}(_0x524e,0x15e));var _0xe524=function(_0x378f20,_0x34faa5){_0x378f20=_0x378f20-0x0;var _0xd7e514=_0x524e[_0x378f20];return _0xd7e514;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe524('0x0'));var jsonpatch=require(_0xe524('0x1'));var rp=require(_0xe524('0x2'));var moment=require(_0xe524('0x3'));var BPromise=require(_0xe524('0x4'));var Mustache=require(_0xe524('0x5'));var util=require(_0xe524('0x6'));var path=require(_0xe524('0x7'));var sox=require(_0xe524('0x8'));var csv=require(_0xe524('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe524('0xa'));var _=require(_0xe524('0xb'));var squel=require(_0xe524('0xc'));var crypto=require('crypto');var jsforce=require(_0xe524('0xd'));var deskjs=require(_0xe524('0xe'));var toCsv=require(_0xe524('0x9'));var querystring=require(_0xe524('0xf'));var Papa=require(_0xe524('0x10'));var Redis=require(_0xe524('0x11'));var authService=require(_0xe524('0x12'));var qs=require(_0xe524('0x13'));var as=require(_0xe524('0x14'));var hardwareService=require(_0xe524('0x15'));var logger=require(_0xe524('0x16'))(_0xe524('0x17'));var utils=require(_0xe524('0x18'));var config=require(_0xe524('0x19'));var licenseUtil=require(_0xe524('0x1a'));var db=require(_0xe524('0x1b'))['db'];function respondWithStatusCode(_0x5077c1,_0x4b0f51){_0x4b0f51=_0x4b0f51||0xcc;return function(_0xfdc2a5){if(_0xfdc2a5){return _0x5077c1[_0xe524('0x1c')](_0x4b0f51);}return _0x5077c1[_0xe524('0x1d')](_0x4b0f51)[_0xe524('0x1e')]();};}function respondWithResult(_0x20a852,_0x57c1b6){_0x57c1b6=_0x57c1b6||0xc8;return function(_0x12ff75){if(_0x12ff75){return _0x20a852['status'](_0x57c1b6)[_0xe524('0x1f')](_0x12ff75);}};}function respondWithFilteredResult(_0x1b0af6,_0x48165e){return function(_0x569660){if(_0x569660){var _0x488fce=typeof _0x48165e[_0xe524('0x20')]==='undefined'&&typeof _0x48165e[_0xe524('0x21')]==='undefined';var _0x5c8736=_0x569660['count'];var _0x3a4027=_0x488fce?0x0:_0x48165e['offset'];var _0x11b2a1=_0x488fce?_0x569660[_0xe524('0x22')]:_0x48165e[_0xe524('0x20')]+_0x48165e[_0xe524('0x21')];var _0x5d7b17;if(_0x11b2a1>=_0x5c8736){_0x11b2a1=_0x5c8736;_0x5d7b17=0xc8;}else{_0x5d7b17=0xce;}_0x1b0af6[_0xe524('0x1d')](_0x5d7b17);return _0x1b0af6[_0xe524('0x23')]('Content-Range',_0x3a4027+'-'+_0x11b2a1+'/'+_0x5c8736)[_0xe524('0x1f')](_0x569660);}return null;};}function patchUpdates(_0x309f85){return function(_0x43a4f9){try{jsonpatch[_0xe524('0x24')](_0x43a4f9,_0x309f85,!![]);}catch(_0x1c4194){return BPromise[_0xe524('0x25')](_0x1c4194);}return _0x43a4f9[_0xe524('0x26')]();};}function saveUpdates(_0x375219,_0x7dfe97){return function(_0x5c4d21){if(_0x5c4d21){return _0x5c4d21[_0xe524('0x27')](_0x375219)['then'](function(_0x577d1f){return _0x577d1f;});}return null;};}function removeEntity(_0x2d2f83,_0x23df5e){return function(_0x1ad106){if(_0x1ad106){return _0x1ad106[_0xe524('0x28')]()['then'](function(){_0x2d2f83[_0xe524('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x17e245,_0xcf5db){return function(_0xd62772){if(!_0xd62772){_0x17e245[_0xe524('0x1c')](0x194);}return _0xd62772;};}function handleError(_0x4102d9,_0xfd5965){_0xfd5965=_0xfd5965||0x1f4;return function(_0x2141db){logger['error'](_0x2141db['stack']);if(_0x2141db[_0xe524('0x29')]){delete _0x2141db[_0xe524('0x29')];}_0x4102d9[_0xe524('0x1d')](_0xfd5965)[_0xe524('0x2a')](_0x2141db);};}exports[_0xe524('0x2b')]=function(_0x5405e4,_0x52f140){var _0x4b1ff={},_0x25e7a7={},_0x3aedd9={'count':0x0,'rows':[]};var _0x8070e4=_[_0xe524('0x2c')](db['UserProfileResource'][_0xe524('0x2d')],function(_0x9a7e98){return{'name':_0x9a7e98['fieldName'],'type':_0x9a7e98['type'][_0xe524('0x2e')]};});_0x25e7a7[_0xe524('0x2f')]=_['map'](_0x8070e4,_0xe524('0x29'));_0x25e7a7['query']=_[_0xe524('0x30')](_0x5405e4['query']);_0x25e7a7[_0xe524('0x31')]=_[_0xe524('0x32')](_0x25e7a7[_0xe524('0x2f')],_0x25e7a7['query']);_0x4b1ff[_0xe524('0x33')]=_['intersection'](_0x25e7a7[_0xe524('0x2f')],qs[_0xe524('0x34')](_0x5405e4[_0xe524('0x35')]['fields']));_0x4b1ff[_0xe524('0x33')]=_0x4b1ff[_0xe524('0x33')]['length']?_0x4b1ff[_0xe524('0x33')]:_0x25e7a7[_0xe524('0x2f')];if(!_0x5405e4[_0xe524('0x35')][_0xe524('0x36')]('nolimit')){_0x4b1ff[_0xe524('0x21')]=qs[_0xe524('0x21')](_0x5405e4[_0xe524('0x35')][_0xe524('0x21')]);_0x4b1ff[_0xe524('0x20')]=qs[_0xe524('0x20')](_0x5405e4[_0xe524('0x35')][_0xe524('0x20')]);}_0x4b1ff['order']=qs[_0xe524('0x37')](_0x5405e4['query'][_0xe524('0x37')]);_0x4b1ff[_0xe524('0x38')]=qs['filters'](_[_0xe524('0x39')](_0x5405e4['query'],_0x25e7a7[_0xe524('0x31')]),_0x8070e4);if(_0x5405e4[_0xe524('0x35')][_0xe524('0x3a')]){_0x4b1ff[_0xe524('0x38')]=_[_0xe524('0x3b')](_0x4b1ff[_0xe524('0x38')],{'$or':_[_0xe524('0x2c')](_0x8070e4,function(_0x13762c){if(_0x13762c['type']!==_0xe524('0x3c')){var _0x940c05={};_0x940c05[_0x13762c[_0xe524('0x29')]]={'$like':'%'+_0x5405e4[_0xe524('0x35')][_0xe524('0x3a')]+'%'};return _0x940c05;}})});}_0x4b1ff=_[_0xe524('0x3b')]({},_0x4b1ff,_0x5405e4[_0xe524('0x3d')]);var _0x158d45={'where':_0x4b1ff['where']};return db[_0xe524('0x3e')][_0xe524('0x22')](_0x158d45)[_0xe524('0x3f')](function(_0x59781b){_0x3aedd9[_0xe524('0x22')]=_0x59781b;if(_0x5405e4['query'][_0xe524('0x40')]){_0x4b1ff[_0xe524('0x41')]=[{'all':!![]}];}return db[_0xe524('0x3e')][_0xe524('0x42')](_0x4b1ff);})[_0xe524('0x3f')](function(_0x4746cd){_0x3aedd9[_0xe524('0x43')]=_0x4746cd;return _0x3aedd9;})['then'](respondWithFilteredResult(_0x52f140,_0x4b1ff))[_0xe524('0x44')](handleError(_0x52f140,null));};exports[_0xe524('0x45')]=function(_0x13c54c,_0x376505){var _0x438962={'raw':![],'where':{'id':_0x13c54c['params']['id']}},_0x1ae283={};_0x1ae283[_0xe524('0x2f')]=_[_0xe524('0x30')](db[_0xe524('0x3e')]['rawAttributes']);_0x1ae283[_0xe524('0x35')]=_['keys'](_0x13c54c['query']);_0x1ae283[_0xe524('0x31')]=_[_0xe524('0x32')](_0x1ae283['model'],_0x1ae283[_0xe524('0x35')]);_0x438962[_0xe524('0x33')]=_[_0xe524('0x32')](_0x1ae283[_0xe524('0x2f')],qs['fields'](_0x13c54c['query'][_0xe524('0x34')]));_0x438962[_0xe524('0x33')]=_0x438962['attributes'][_0xe524('0x46')]?_0x438962['attributes']:_0x1ae283[_0xe524('0x2f')];if(_0x13c54c[_0xe524('0x35')][_0xe524('0x40')]){_0x438962[_0xe524('0x41')]=[{'all':!![]}];}_0x438962=_[_0xe524('0x3b')]({},_0x438962,_0x13c54c[_0xe524('0x3d')]);return db[_0xe524('0x3e')][_0xe524('0x47')](_0x438962)[_0xe524('0x3f')](handleEntityNotFound(_0x376505,null))[_0xe524('0x3f')](respondWithResult(_0x376505,null))[_0xe524('0x44')](handleError(_0x376505,null));};exports[_0xe524('0x48')]=function(_0x3d7ab7,_0x33b1c8){return db[_0xe524('0x3e')]['create'](_0x3d7ab7[_0xe524('0x49')],{})['then'](respondWithResult(_0x33b1c8,0xc9))['catch'](handleError(_0x33b1c8,null));};exports[_0xe524('0x27')]=function(_0x59fe6b,_0x232cf0){if(_0x59fe6b[_0xe524('0x49')]['id']){delete _0x59fe6b['body']['id'];}return db[_0xe524('0x3e')]['find']({'where':{'id':_0x59fe6b['params']['id']}})[_0xe524('0x3f')](handleEntityNotFound(_0x232cf0,null))[_0xe524('0x3f')](saveUpdates(_0x59fe6b[_0xe524('0x49')],null))['then'](respondWithResult(_0x232cf0,null))['catch'](handleError(_0x232cf0,null));};exports['destroy']=function(_0x4e9c3b,_0x4f7a64){return db['UserProfileResource'][_0xe524('0x47')]({'where':{'id':_0x4e9c3b[_0xe524('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4f7a64,null))[_0xe524('0x3f')](removeEntity(_0x4f7a64,null))[_0xe524('0x44')](handleError(_0x4f7a64,null));};exports[_0xe524('0x4b')]=function(_0x208aa8,_0x2fa143){return db['UserProfileResource'][_0xe524('0x4b')]()[_0xe524('0x3f')](respondWithResult(_0x2fa143,null))[_0xe524('0x44')](handleError(_0x2fa143,null));};
\ No newline at end of file
+var _0x9536=['rawAttributes','intersection','length','options','find','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','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','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','error','stack','name','index','map','UserProfileResource','fieldName','model','query','keys','filters','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','then','includeAll','include','findAll','rows','catch','params'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x9536,0x179));var _0x6953=function(_0x33a694,_0x9b6640){_0x33a694=_0x33a694-0x0;var _0x41ff01=_0x9536[_0x33a694];return _0x41ff01;};'use strict';var emlformat=require(_0x6953('0x0'));var rimraf=require(_0x6953('0x1'));var zipdir=require(_0x6953('0x2'));var jsonpatch=require(_0x6953('0x3'));var rp=require('request-promise');var moment=require(_0x6953('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x6953('0x5'));var util=require(_0x6953('0x6'));var path=require(_0x6953('0x7'));var sox=require(_0x6953('0x8'));var csv=require(_0x6953('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6953('0xa'));var _=require(_0x6953('0xb'));var squel=require(_0x6953('0xc'));var crypto=require(_0x6953('0xd'));var jsforce=require(_0x6953('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x6953('0x9'));var querystring=require(_0x6953('0xf'));var Papa=require(_0x6953('0x10'));var Redis=require('ioredis');var authService=require(_0x6953('0x11'));var qs=require(_0x6953('0x12'));var as=require(_0x6953('0x13'));var hardwareService=require(_0x6953('0x14'));var logger=require(_0x6953('0x15'))(_0x6953('0x16'));var utils=require(_0x6953('0x17'));var config=require(_0x6953('0x18'));var licenseUtil=require(_0x6953('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x358388,_0x513dd0){_0x513dd0=_0x513dd0||0xcc;return function(_0x8de91e){if(_0x8de91e){return _0x358388[_0x6953('0x1a')](_0x513dd0);}return _0x358388[_0x6953('0x1b')](_0x513dd0)[_0x6953('0x1c')]();};}function respondWithResult(_0x1b5221,_0x244713){_0x244713=_0x244713||0xc8;return function(_0x175fa9){if(_0x175fa9){return _0x1b5221[_0x6953('0x1b')](_0x244713)[_0x6953('0x1d')](_0x175fa9);}};}function respondWithFilteredResult(_0x31d182,_0xae5515){return function(_0x548473){if(_0x548473){var _0x5f49db=typeof _0xae5515[_0x6953('0x1e')]===_0x6953('0x1f')&&typeof _0xae5515[_0x6953('0x20')]===_0x6953('0x1f');var _0x510d46=_0x548473[_0x6953('0x21')];var _0x2da771=_0x5f49db?0x0:_0xae5515['offset'];var _0x10858a=_0x5f49db?_0x548473[_0x6953('0x21')]:_0xae5515[_0x6953('0x1e')]+_0xae5515[_0x6953('0x20')];var _0xc714d3;if(_0x10858a>=_0x510d46){_0x10858a=_0x510d46;_0xc714d3=0xc8;}else{_0xc714d3=0xce;}_0x31d182['status'](_0xc714d3);return _0x31d182[_0x6953('0x22')](_0x6953('0x23'),_0x2da771+'-'+_0x10858a+'/'+_0x510d46)[_0x6953('0x1d')](_0x548473);}return null;};}function patchUpdates(_0x2ba433){return function(_0x41f021){try{jsonpatch['apply'](_0x41f021,_0x2ba433,!![]);}catch(_0xf96d07){return BPromise[_0x6953('0x24')](_0xf96d07);}return _0x41f021['save']();};}function saveUpdates(_0x317979,_0x40c9d1){return function(_0xb92529){if(_0xb92529){return _0xb92529[_0x6953('0x25')](_0x317979)['then'](function(_0x37f339){return _0x37f339;});}return null;};}function removeEntity(_0x231cb2,_0x2a7f6a){return function(_0x508ea7){if(_0x508ea7){return _0x508ea7['destroy']()['then'](function(){_0x231cb2[_0x6953('0x1b')](0xcc)[_0x6953('0x1c')]();});}};}function handleEntityNotFound(_0x550be4,_0x1a32f4){return function(_0x587df0){if(!_0x587df0){_0x550be4[_0x6953('0x1a')](0x194);}return _0x587df0;};}function handleError(_0x2bf39b,_0xcdbce8){_0xcdbce8=_0xcdbce8||0x1f4;return function(_0x2cc01e){logger[_0x6953('0x26')](_0x2cc01e[_0x6953('0x27')]);if(_0x2cc01e['name']){delete _0x2cc01e[_0x6953('0x28')];}_0x2bf39b[_0x6953('0x1b')](_0xcdbce8)['send'](_0x2cc01e);};}exports[_0x6953('0x29')]=function(_0x4af39d,_0x173b3c){var _0x3b1175={},_0x426c7c={},_0x4b0325={'count':0x0,'rows':[]};var _0x131992=_[_0x6953('0x2a')](db[_0x6953('0x2b')]['rawAttributes'],function(_0x4c49fc){return{'name':_0x4c49fc[_0x6953('0x2c')],'type':_0x4c49fc['type']['key']};});_0x426c7c[_0x6953('0x2d')]=_[_0x6953('0x2a')](_0x131992,_0x6953('0x28'));_0x426c7c[_0x6953('0x2e')]=_[_0x6953('0x2f')](_0x4af39d['query']);_0x426c7c[_0x6953('0x30')]=_['intersection'](_0x426c7c[_0x6953('0x2d')],_0x426c7c[_0x6953('0x2e')]);_0x3b1175['attributes']=_['intersection'](_0x426c7c[_0x6953('0x2d')],qs[_0x6953('0x31')](_0x4af39d[_0x6953('0x2e')]['fields']));_0x3b1175[_0x6953('0x32')]=_0x3b1175['attributes']['length']?_0x3b1175['attributes']:_0x426c7c['model'];if(!_0x4af39d[_0x6953('0x2e')][_0x6953('0x33')](_0x6953('0x34'))){_0x3b1175[_0x6953('0x20')]=qs[_0x6953('0x20')](_0x4af39d[_0x6953('0x2e')]['limit']);_0x3b1175[_0x6953('0x1e')]=qs['offset'](_0x4af39d[_0x6953('0x2e')]['offset']);}_0x3b1175[_0x6953('0x35')]=qs[_0x6953('0x36')](_0x4af39d[_0x6953('0x2e')][_0x6953('0x36')]);_0x3b1175['where']=qs[_0x6953('0x30')](_[_0x6953('0x37')](_0x4af39d[_0x6953('0x2e')],_0x426c7c[_0x6953('0x30')]),_0x131992);if(_0x4af39d[_0x6953('0x2e')][_0x6953('0x38')]){_0x3b1175[_0x6953('0x39')]=_[_0x6953('0x3a')](_0x3b1175[_0x6953('0x39')],{'$or':_[_0x6953('0x2a')](_0x131992,function(_0x2d9d81){if(_0x2d9d81['type']!==_0x6953('0x3b')){var _0x3c03ab={};_0x3c03ab[_0x2d9d81[_0x6953('0x28')]]={'$like':'%'+_0x4af39d['query']['filter']+'%'};return _0x3c03ab;}})});}_0x3b1175=_[_0x6953('0x3a')]({},_0x3b1175,_0x4af39d['options']);var _0x5abaf2={'where':_0x3b1175[_0x6953('0x39')]};return db[_0x6953('0x2b')]['count'](_0x5abaf2)[_0x6953('0x3c')](function(_0x263728){_0x4b0325[_0x6953('0x21')]=_0x263728;if(_0x4af39d[_0x6953('0x2e')][_0x6953('0x3d')]){_0x3b1175[_0x6953('0x3e')]=[{'all':!![]}];}return db['UserProfileResource'][_0x6953('0x3f')](_0x3b1175);})[_0x6953('0x3c')](function(_0x30a27a){_0x4b0325[_0x6953('0x40')]=_0x30a27a;return _0x4b0325;})[_0x6953('0x3c')](respondWithFilteredResult(_0x173b3c,_0x3b1175))[_0x6953('0x41')](handleError(_0x173b3c,null));};exports['show']=function(_0x5a40de,_0xeef91a){var _0x54d7c2={'raw':![],'where':{'id':_0x5a40de[_0x6953('0x42')]['id']}},_0x588ff8={};_0x588ff8[_0x6953('0x2d')]=_[_0x6953('0x2f')](db[_0x6953('0x2b')][_0x6953('0x43')]);_0x588ff8['query']=_['keys'](_0x5a40de[_0x6953('0x2e')]);_0x588ff8[_0x6953('0x30')]=_['intersection'](_0x588ff8[_0x6953('0x2d')],_0x588ff8['query']);_0x54d7c2[_0x6953('0x32')]=_[_0x6953('0x44')](_0x588ff8[_0x6953('0x2d')],qs[_0x6953('0x31')](_0x5a40de['query'][_0x6953('0x31')]));_0x54d7c2[_0x6953('0x32')]=_0x54d7c2['attributes'][_0x6953('0x45')]?_0x54d7c2[_0x6953('0x32')]:_0x588ff8[_0x6953('0x2d')];if(_0x5a40de[_0x6953('0x2e')][_0x6953('0x3d')]){_0x54d7c2[_0x6953('0x3e')]=[{'all':!![]}];}_0x54d7c2=_[_0x6953('0x3a')]({},_0x54d7c2,_0x5a40de[_0x6953('0x46')]);return db[_0x6953('0x2b')][_0x6953('0x47')](_0x54d7c2)[_0x6953('0x3c')](handleEntityNotFound(_0xeef91a,null))['then'](respondWithResult(_0xeef91a,null))[_0x6953('0x41')](handleError(_0xeef91a,null));};exports['create']=function(_0x15c142,_0x1d5979){return db[_0x6953('0x2b')]['create'](_0x15c142[_0x6953('0x48')],{})[_0x6953('0x3c')](respondWithResult(_0x1d5979,0xc9))['catch'](handleError(_0x1d5979,null));};exports['update']=function(_0xbf5b61,_0x265b44){if(_0xbf5b61[_0x6953('0x48')]['id']){delete _0xbf5b61[_0x6953('0x48')]['id'];}return db[_0x6953('0x2b')][_0x6953('0x47')]({'where':{'id':_0xbf5b61[_0x6953('0x42')]['id']}})[_0x6953('0x3c')](handleEntityNotFound(_0x265b44,null))[_0x6953('0x3c')](saveUpdates(_0xbf5b61[_0x6953('0x48')],null))[_0x6953('0x3c')](respondWithResult(_0x265b44,null))['catch'](handleError(_0x265b44,null));};exports['destroy']=function(_0x14a7bf,_0x38e3e8){return db[_0x6953('0x2b')][_0x6953('0x47')]({'where':{'id':_0x14a7bf[_0x6953('0x42')]['id']}})[_0x6953('0x3c')](handleEntityNotFound(_0x38e3e8,null))[_0x6953('0x3c')](removeEntity(_0x38e3e8,null))[_0x6953('0x41')](handleError(_0x38e3e8,null));};exports[_0x6953('0x49')]=function(_0x50b962,_0x5f15b0){return db['UserProfileResource']['describe']()[_0x6953('0x3c')](respondWithResult(_0x5f15b0,null))[_0x6953('0x41')](handleError(_0x5f15b0,null));};
\ No newline at end of file
index e4b14ae..0efe4a8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc33d=['sectionId','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./userProfileResource.attributes','exports','define','UserProfileResource','user_profile_has_resources','compositeIndex','resourceId'];(function(_0x20cef4,_0x5f3fb5){var _0x5c9679=function(_0x1ca612){while(--_0x1ca612){_0x20cef4['push'](_0x20cef4['shift']());}};_0x5c9679(++_0x5f3fb5);}(_0xc33d,0x6a));var _0xdc33=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc33d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xdc33('0x0'));var logger=require(_0xdc33('0x1'))('api');var moment=require(_0xdc33('0x2'));var BPromise=require(_0xdc33('0x3'));var rp=require(_0xdc33('0x4'));var fs=require('fs');var path=require(_0xdc33('0x5'));var rimraf=require(_0xdc33('0x6'));var config=require('../../config/environment');var attributes=require(_0xdc33('0x7'));module[_0xdc33('0x8')]=function(_0x28607f,_0x412651){return _0x28607f[_0xdc33('0x9')](_0xdc33('0xa'),attributes,{'tableName':_0xdc33('0xb'),'paranoid':![],'indexes':[{'name':_0xdc33('0xc'),'fields':[_0xdc33('0xd'),_0xdc33('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x73ec=['UserProfileResource','compositeIndex','resourceId','sectionId','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./userProfileResource.attributes'];(function(_0xb5a65b,_0x982a3e){var _0x1d48c3=function(_0x44a54d){while(--_0x44a54d){_0xb5a65b['push'](_0xb5a65b['shift']());}};_0x1d48c3(++_0x982a3e);}(_0x73ec,0x138));var _0xc73e=function(_0x525ba5,_0x4103d7){_0x525ba5=_0x525ba5-0x0;var _0xe0ef92=_0x73ec[_0x525ba5];return _0xe0ef92;};'use strict';var _=require(_0xc73e('0x0'));var util=require(_0xc73e('0x1'));var logger=require(_0xc73e('0x2'))(_0xc73e('0x3'));var moment=require('moment');var BPromise=require(_0xc73e('0x4'));var rp=require(_0xc73e('0x5'));var fs=require('fs');var path=require(_0xc73e('0x6'));var rimraf=require(_0xc73e('0x7'));var config=require(_0xc73e('0x8'));var attributes=require(_0xc73e('0x9'));module['exports']=function(_0x4e6554,_0x391c11){return _0x4e6554['define'](_0xc73e('0xa'),attributes,{'tableName':'user_profile_has_resources','paranoid':![],'indexes':[{'name':_0xc73e('0xb'),'fields':[_0xc73e('0xc'),_0xc73e('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
index e8e10f1..96239a7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9a86=['then','UserProfileResource,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x271187,_0x354506){var _0x5db43d=function(_0x5eb8bd){while(--_0x5eb8bd){_0x271187['push'](_0x271187['shift']());}};_0x5db43d(++_0x354506);}(_0x9a86,0x1ed));var _0x69a8=function(_0x4bc65f,_0x39ec43){_0x4bc65f=_0x4bc65f-0x0;var _0x44f85f=_0x9a86[_0x4bc65f];return _0x44f85f;};'use strict';var _=require(_0x69a8('0x0'));var util=require(_0x69a8('0x1'));var moment=require('moment');var BPromise=require(_0x69a8('0x2'));var rs=require(_0x69a8('0x3'));var fs=require('fs');var Redis=require(_0x69a8('0x4'));var db=require(_0x69a8('0x5'))['db'];var utils=require(_0x69a8('0x6'));var logger=require(_0x69a8('0x7'))(_0x69a8('0x8'));var config=require(_0x69a8('0x9'));var jayson=require(_0x69a8('0xa'));var client=jayson[_0x69a8('0xb')][_0x69a8('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x47592b,_0x40d196,_0x308ef9){return new BPromise(function(_0x1909fc,_0x1c826b){return client['request'](_0x47592b,_0x308ef9)[_0x69a8('0xd')](function(_0xaf3ed6){logger['info'](_0x69a8('0xe'),_0x40d196,_0x69a8('0xf'));logger['debug']('UserProfileResource,\x20%s,\x20%s,\x20%s',_0x40d196,_0x69a8('0xf'),JSON[_0x69a8('0x10')](_0xaf3ed6));if(_0xaf3ed6[_0x69a8('0x11')]){if(_0xaf3ed6[_0x69a8('0x11')]['code']===0x1f4){logger['error'](_0x69a8('0xe'),_0x40d196,_0xaf3ed6['error'][_0x69a8('0x12')]);return _0x1c826b(_0xaf3ed6[_0x69a8('0x11')][_0x69a8('0x12')]);}logger[_0x69a8('0x11')](_0x69a8('0xe'),_0x40d196,_0xaf3ed6['error'][_0x69a8('0x12')]);return _0x1909fc(_0xaf3ed6['error'][_0x69a8('0x12')]);}else{logger[_0x69a8('0x13')]('UserProfileResource,\x20%s,\x20%s',_0x40d196,_0x69a8('0xf'));_0x1909fc(_0xaf3ed6[_0x69a8('0x14')][_0x69a8('0x12')]);}})[_0x69a8('0x15')](function(_0x1d3ebf){logger[_0x69a8('0x11')](_0x69a8('0xe'),_0x40d196,_0x1d3ebf);_0x1c826b(_0x1d3ebf);});});}
\ No newline at end of file
+var _0xda02=['stringify','error','code','message','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x1b4c04,_0x8d961d){var _0x374f5d=function(_0x11dc31){while(--_0x11dc31){_0x1b4c04['push'](_0x1b4c04['shift']());}};_0x374f5d(++_0x8d961d);}(_0xda02,0x133));var _0x2da0=function(_0x2d2e85,_0x22faa9){_0x2d2e85=_0x2d2e85-0x0;var _0x3e9f5e=_0xda02[_0x2d2e85];return _0x3e9f5e;};'use strict';var _=require('lodash');var util=require(_0x2da0('0x0'));var moment=require(_0x2da0('0x1'));var BPromise=require(_0x2da0('0x2'));var rs=require(_0x2da0('0x3'));var fs=require('fs');var Redis=require(_0x2da0('0x4'));var db=require(_0x2da0('0x5'))['db'];var utils=require(_0x2da0('0x6'));var logger=require(_0x2da0('0x7'))(_0x2da0('0x8'));var config=require(_0x2da0('0x9'));var jayson=require(_0x2da0('0xa'));var client=jayson[_0x2da0('0xb')][_0x2da0('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x53fe80,_0x1165ea,_0x4d0572){return new BPromise(function(_0x2fecdd,_0x565881){return client[_0x2da0('0xd')](_0x53fe80,_0x4d0572)[_0x2da0('0xe')](function(_0x4fad26){logger['info'](_0x2da0('0xf'),_0x1165ea,_0x2da0('0x10'));logger[_0x2da0('0x11')]('UserProfileResource,\x20%s,\x20%s,\x20%s',_0x1165ea,_0x2da0('0x10'),JSON[_0x2da0('0x12')](_0x4fad26));if(_0x4fad26[_0x2da0('0x13')]){if(_0x4fad26[_0x2da0('0x13')][_0x2da0('0x14')]===0x1f4){logger[_0x2da0('0x13')](_0x2da0('0xf'),_0x1165ea,_0x4fad26['error'][_0x2da0('0x15')]);return _0x565881(_0x4fad26[_0x2da0('0x13')][_0x2da0('0x15')]);}logger['error'](_0x2da0('0xf'),_0x1165ea,_0x4fad26['error']['message']);return _0x2fecdd(_0x4fad26['error'][_0x2da0('0x15')]);}else{logger[_0x2da0('0x16')]('UserProfileResource,\x20%s,\x20%s',_0x1165ea,'request\x20sent');_0x2fecdd(_0x4fad26[_0x2da0('0x17')][_0x2da0('0x15')]);}})[_0x2da0('0x18')](function(_0x5111d0){logger[_0x2da0('0x13')]('UserProfileResource,\x20%s,\x20%s',_0x1165ea,_0x5111d0);_0x565881(_0x5111d0);});});}
\ No newline at end of file
index c15d4a1..d4832a1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfb66=['get','isAuthenticated','index','/describe','describe','/:id','show','create','update','destroy','multer','path','connect-timeout','fs-extra','../../components/interaction/service','./userProfileSection.controller'];(function(_0x3ff685,_0x304b9e){var _0x2046c9=function(_0x7a10e9){while(--_0x7a10e9){_0x3ff685['push'](_0x3ff685['shift']());}};_0x2046c9(++_0x304b9e);}(_0xfb66,0x8a));var _0x6fb6=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0xfb66[_0x3e5086];return _0xfeb102;};'use strict';var multer=require(_0x6fb6('0x0'));var util=require('util');var path=require(_0x6fb6('0x1'));var timeout=require(_0x6fb6('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x6fb6('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x6fb6('0x4'));var config=require('../../config/environment');var controller=require(_0x6fb6('0x5'));router[_0x6fb6('0x6')]('/',auth[_0x6fb6('0x7')](),controller[_0x6fb6('0x8')]);router[_0x6fb6('0x6')](_0x6fb6('0x9'),auth[_0x6fb6('0x7')](),controller[_0x6fb6('0xa')]);router['get'](_0x6fb6('0xb'),auth[_0x6fb6('0x7')](),controller[_0x6fb6('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x6fb6('0xd')]);router['put'](_0x6fb6('0xb'),auth[_0x6fb6('0x7')](),controller[_0x6fb6('0xe')]);router['delete'](_0x6fb6('0xb'),auth['isAuthenticated'](),controller[_0x6fb6('0xf')]);module['exports']=router;
\ No newline at end of file
+var _0x39a9=['../../components/auth/service','../../config/environment','./userProfileSection.controller','get','index','isAuthenticated','/:id','show','put','delete','destroy','multer','path','Router','fs-extra'];(function(_0x3e7336,_0x242b6d){var _0x1f9ff6=function(_0x1c574f){while(--_0x1c574f){_0x3e7336['push'](_0x3e7336['shift']());}};_0x1f9ff6(++_0x242b6d);}(_0x39a9,0x128));var _0x939a=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x39a9[_0x2c91e9];return _0x13f0ff;};'use strict';var multer=require(_0x939a('0x0'));var util=require('util');var path=require(_0x939a('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x939a('0x2')]();var fs_extra=require(_0x939a('0x3'));var auth=require(_0x939a('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x939a('0x5'));var controller=require(_0x939a('0x6'));router[_0x939a('0x7')]('/',auth['isAuthenticated'](),controller[_0x939a('0x8')]);router[_0x939a('0x7')]('/describe',auth[_0x939a('0x9')](),controller['describe']);router[_0x939a('0x7')](_0x939a('0xa'),auth[_0x939a('0x9')](),controller[_0x939a('0xb')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x939a('0xc')](_0x939a('0xa'),auth[_0x939a('0x9')](),controller['update']);router[_0x939a('0xd')](_0x939a('0xa'),auth['isAuthenticated'](),controller[_0x939a('0xe')]);module['exports']=router;
\ No newline at end of file
index c52eccf..cef4d86 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6b20=['getDataValue','sequelize','exports','STRING','BOOLEAN','setDataValue','crudPermissions','join'];(function(_0x3de255,_0x4282ab){var _0xea369b=function(_0x1a6ebc){while(--_0x1a6ebc){_0x3de255['push'](_0x3de255['shift']());}};_0xea369b(++_0x4282ab);}(_0x6b20,0xd1));var _0x06b2=function(_0xf840e0,_0x5d75c9){_0xf840e0=_0xf840e0-0x0;var _0x37cd14=_0x6b20[_0xf840e0];return _0x37cd14;};'use strict';var Sequelize=require(_0x06b2('0x0'));module[_0x06b2('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'category':{'type':Sequelize[_0x06b2('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize['INTEGER'],'allowNull':![]},'enabled':{'type':Sequelize[_0x06b2('0x3')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x06b2('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x06b2('0x2')],'set':function(_0x5ba392){this[_0x06b2('0x4')](_0x06b2('0x5'),_0x5ba392?_0x5ba392[_0x06b2('0x6')](''):[]);},'get':function(){return this[_0x06b2('0x7')](_0x06b2('0x5'))?this[_0x06b2('0x7')](_0x06b2('0x5'))['split'](''):[];}}};
\ No newline at end of file
+var _0xb62e=['STRING','BOOLEAN','setDataValue','crudPermissions','getDataValue','split','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb62e,0x1de));var _0xeb62=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0xb62e[_0x1035c1];return _0x308d67;};'use strict';var Sequelize=require(_0xeb62('0x0'));module[_0xeb62('0x1')]={'name':{'type':Sequelize[_0xeb62('0x2')],'allowNull':![]},'category':{'type':Sequelize[_0xeb62('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize['INTEGER'],'allowNull':![]},'enabled':{'type':Sequelize[_0xeb62('0x3')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0xeb62('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0xeb62('0x2')],'set':function(_0x929329){this[_0xeb62('0x4')](_0xeb62('0x5'),_0x929329?_0x929329['join'](''):[]);},'get':function(){return this[_0xeb62('0x6')](_0xeb62('0x5'))?this[_0xeb62('0x6')]('crudPermissions')[_0xeb62('0x7')](''):[];}}};
\ No newline at end of file
index e40f41f..c951d9c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7e26=['json','offset','limit','undefined','count','set','Content-Range','apply','then','destroy','stack','name','index','map','UserProfileSection','rawAttributes','type','query','filters','model','fields','attributes','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','intersection','find','create','body','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end'];(function(_0x501c3f,_0x1916d6){var _0x4c154b=function(_0x24463d){while(--_0x24463d){_0x501c3f['push'](_0x501c3f['shift']());}};_0x4c154b(++_0x1916d6);}(_0x7e26,0x15a));var _0x67e2=function(_0x2eab6b,_0x25e737){_0x2eab6b=_0x2eab6b-0x0;var _0x26aec5=_0x7e26[_0x2eab6b];return _0x26aec5;};'use strict';var emlformat=require(_0x67e2('0x0'));var rimraf=require(_0x67e2('0x1'));var zipdir=require(_0x67e2('0x2'));var jsonpatch=require(_0x67e2('0x3'));var rp=require(_0x67e2('0x4'));var moment=require(_0x67e2('0x5'));var BPromise=require(_0x67e2('0x6'));var Mustache=require(_0x67e2('0x7'));var util=require(_0x67e2('0x8'));var path=require(_0x67e2('0x9'));var sox=require(_0x67e2('0xa'));var csv=require(_0x67e2('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x67e2('0xc'));var squel=require(_0x67e2('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x67e2('0xe'));var toCsv=require(_0x67e2('0xb'));var querystring=require(_0x67e2('0xf'));var Papa=require(_0x67e2('0x10'));var Redis=require('ioredis');var authService=require(_0x67e2('0x11'));var qs=require(_0x67e2('0x12'));var as=require(_0x67e2('0x13'));var hardwareService=require(_0x67e2('0x14'));var logger=require(_0x67e2('0x15'))('api');var utils=require(_0x67e2('0x16'));var config=require(_0x67e2('0x17'));var licenseUtil=require(_0x67e2('0x18'));var db=require(_0x67e2('0x19'))['db'];function respondWithStatusCode(_0x2bdb93,_0x4a8ae6){_0x4a8ae6=_0x4a8ae6||0xcc;return function(_0x227577){if(_0x227577){return _0x2bdb93[_0x67e2('0x1a')](_0x4a8ae6);}return _0x2bdb93[_0x67e2('0x1b')](_0x4a8ae6)[_0x67e2('0x1c')]();};}function respondWithResult(_0x319be8,_0x3f7589){_0x3f7589=_0x3f7589||0xc8;return function(_0x32e927){if(_0x32e927){return _0x319be8[_0x67e2('0x1b')](_0x3f7589)[_0x67e2('0x1d')](_0x32e927);}};}function respondWithFilteredResult(_0x26a87f,_0x242715){return function(_0x274a0e){if(_0x274a0e){var _0x13feb7=typeof _0x242715[_0x67e2('0x1e')]==='undefined'&&typeof _0x242715[_0x67e2('0x1f')]===_0x67e2('0x20');var _0x4769b6=_0x274a0e[_0x67e2('0x21')];var _0x59e15e=_0x13feb7?0x0:_0x242715[_0x67e2('0x1e')];var _0x1eaa99=_0x13feb7?_0x274a0e[_0x67e2('0x21')]:_0x242715[_0x67e2('0x1e')]+_0x242715[_0x67e2('0x1f')];var _0x3243b5;if(_0x1eaa99>=_0x4769b6){_0x1eaa99=_0x4769b6;_0x3243b5=0xc8;}else{_0x3243b5=0xce;}_0x26a87f['status'](_0x3243b5);return _0x26a87f[_0x67e2('0x22')](_0x67e2('0x23'),_0x59e15e+'-'+_0x1eaa99+'/'+_0x4769b6)['json'](_0x274a0e);}return null;};}function patchUpdates(_0x28a3be){return function(_0x1b6041){try{jsonpatch[_0x67e2('0x24')](_0x1b6041,_0x28a3be,!![]);}catch(_0x1cdf35){return BPromise['reject'](_0x1cdf35);}return _0x1b6041['save']();};}function saveUpdates(_0x408b0b,_0x46a10c){return function(_0x5e1789){if(_0x5e1789){return _0x5e1789['update'](_0x408b0b)[_0x67e2('0x25')](function(_0xd15208){return _0xd15208;});}return null;};}function removeEntity(_0x13159f,_0x444e54){return function(_0x161255){if(_0x161255){return _0x161255[_0x67e2('0x26')]()[_0x67e2('0x25')](function(){_0x13159f['status'](0xcc)[_0x67e2('0x1c')]();});}};}function handleEntityNotFound(_0xbee56a,_0x456f87){return function(_0xb58e47){if(!_0xb58e47){_0xbee56a[_0x67e2('0x1a')](0x194);}return _0xb58e47;};}function handleError(_0x5e1603,_0x3dddf1){_0x3dddf1=_0x3dddf1||0x1f4;return function(_0x25ba73){logger['error'](_0x25ba73[_0x67e2('0x27')]);if(_0x25ba73['name']){delete _0x25ba73[_0x67e2('0x28')];}_0x5e1603['status'](_0x3dddf1)['send'](_0x25ba73);};}exports[_0x67e2('0x29')]=function(_0x57029c,_0x48a52e){var _0xcffe7f={},_0x26501d={},_0x1afdf9={'count':0x0,'rows':[]};var _0x5d16b2=_[_0x67e2('0x2a')](db[_0x67e2('0x2b')][_0x67e2('0x2c')],function(_0x237ea1){return{'name':_0x237ea1['fieldName'],'type':_0x237ea1[_0x67e2('0x2d')]['key']};});_0x26501d['model']=_[_0x67e2('0x2a')](_0x5d16b2,'name');_0x26501d[_0x67e2('0x2e')]=_['keys'](_0x57029c[_0x67e2('0x2e')]);_0x26501d[_0x67e2('0x2f')]=_['intersection'](_0x26501d[_0x67e2('0x30')],_0x26501d['query']);_0xcffe7f['attributes']=_['intersection'](_0x26501d[_0x67e2('0x30')],qs[_0x67e2('0x31')](_0x57029c[_0x67e2('0x2e')][_0x67e2('0x31')]));_0xcffe7f[_0x67e2('0x32')]=_0xcffe7f[_0x67e2('0x32')][_0x67e2('0x33')]?_0xcffe7f[_0x67e2('0x32')]:_0x26501d[_0x67e2('0x30')];if(!_0x57029c['query'][_0x67e2('0x34')]('nolimit')){_0xcffe7f['limit']=qs[_0x67e2('0x1f')](_0x57029c[_0x67e2('0x2e')]['limit']);_0xcffe7f[_0x67e2('0x1e')]=qs[_0x67e2('0x1e')](_0x57029c['query'][_0x67e2('0x1e')]);}_0xcffe7f[_0x67e2('0x35')]=qs[_0x67e2('0x36')](_0x57029c[_0x67e2('0x2e')]['sort']);_0xcffe7f['where']=qs['filters'](_[_0x67e2('0x37')](_0x57029c[_0x67e2('0x2e')],_0x26501d[_0x67e2('0x2f')]),_0x5d16b2);if(_0x57029c['query'][_0x67e2('0x38')]){_0xcffe7f[_0x67e2('0x39')]=_[_0x67e2('0x3a')](_0xcffe7f[_0x67e2('0x39')],{'$or':_['map'](_0x5d16b2,function(_0x2d4d79){if(_0x2d4d79[_0x67e2('0x2d')]!==_0x67e2('0x3b')){var _0x2aac83={};_0x2aac83[_0x2d4d79['name']]={'$like':'%'+_0x57029c[_0x67e2('0x2e')][_0x67e2('0x38')]+'%'};return _0x2aac83;}})});}_0xcffe7f=_[_0x67e2('0x3a')]({},_0xcffe7f,_0x57029c[_0x67e2('0x3c')]);var _0x572992={'where':_0xcffe7f[_0x67e2('0x39')]};return db[_0x67e2('0x2b')]['count'](_0x572992)[_0x67e2('0x25')](function(_0x10d6a3){_0x1afdf9[_0x67e2('0x21')]=_0x10d6a3;if(_0x57029c[_0x67e2('0x2e')][_0x67e2('0x3d')]){_0xcffe7f[_0x67e2('0x3e')]=[{'all':!![]}];}return db['UserProfileSection'][_0x67e2('0x3f')](_0xcffe7f);})[_0x67e2('0x25')](function(_0x50c19c){_0x1afdf9[_0x67e2('0x40')]=_0x50c19c;return _0x1afdf9;})['then'](respondWithFilteredResult(_0x48a52e,_0xcffe7f))[_0x67e2('0x41')](handleError(_0x48a52e,null));};exports[_0x67e2('0x42')]=function(_0x51b7ad,_0x25efc5){var _0x1ea106={'raw':![],'where':{'id':_0x51b7ad[_0x67e2('0x43')]['id']}},_0x2e56f6={};_0x2e56f6[_0x67e2('0x30')]=_[_0x67e2('0x44')](db[_0x67e2('0x2b')][_0x67e2('0x2c')]);_0x2e56f6[_0x67e2('0x2e')]=_['keys'](_0x51b7ad[_0x67e2('0x2e')]);_0x2e56f6[_0x67e2('0x2f')]=_[_0x67e2('0x45')](_0x2e56f6['model'],_0x2e56f6[_0x67e2('0x2e')]);_0x1ea106['attributes']=_[_0x67e2('0x45')](_0x2e56f6[_0x67e2('0x30')],qs['fields'](_0x51b7ad[_0x67e2('0x2e')][_0x67e2('0x31')]));_0x1ea106[_0x67e2('0x32')]=_0x1ea106[_0x67e2('0x32')]['length']?_0x1ea106[_0x67e2('0x32')]:_0x2e56f6[_0x67e2('0x30')];if(_0x51b7ad[_0x67e2('0x2e')]['includeAll']){_0x1ea106[_0x67e2('0x3e')]=[{'all':!![]}];}_0x1ea106=_[_0x67e2('0x3a')]({},_0x1ea106,_0x51b7ad['options']);return db[_0x67e2('0x2b')][_0x67e2('0x46')](_0x1ea106)[_0x67e2('0x25')](handleEntityNotFound(_0x25efc5,null))[_0x67e2('0x25')](respondWithResult(_0x25efc5,null))['catch'](handleError(_0x25efc5,null));};exports[_0x67e2('0x47')]=function(_0x113773,_0x1850fc){return db[_0x67e2('0x2b')][_0x67e2('0x47')](_0x113773[_0x67e2('0x48')],{})['then'](respondWithResult(_0x1850fc,0xc9))[_0x67e2('0x41')](handleError(_0x1850fc,null));};exports[_0x67e2('0x49')]=function(_0x413791,_0x45ef1c){if(_0x413791[_0x67e2('0x48')]['id']){delete _0x413791[_0x67e2('0x48')]['id'];}return db[_0x67e2('0x2b')][_0x67e2('0x46')]({'where':{'id':_0x413791[_0x67e2('0x43')]['id']}})[_0x67e2('0x25')](handleEntityNotFound(_0x45ef1c,null))[_0x67e2('0x25')](saveUpdates(_0x413791[_0x67e2('0x48')],null))[_0x67e2('0x25')](respondWithResult(_0x45ef1c,null))['catch'](handleError(_0x45ef1c,null));};exports[_0x67e2('0x26')]=function(_0xf2cf5d,_0x1f4cff){return db[_0x67e2('0x2b')]['find']({'where':{'id':_0xf2cf5d['params']['id']}})[_0x67e2('0x25')](handleEntityNotFound(_0x1f4cff,null))['then'](removeEntity(_0x1f4cff,null))[_0x67e2('0x41')](handleError(_0x1f4cff,null));};exports[_0x67e2('0x4a')]=function(_0x5965c9,_0x196577){return db[_0x67e2('0x2b')][_0x67e2('0x4a')]()[_0x67e2('0x25')](respondWithResult(_0x196577,null))[_0x67e2('0x41')](handleError(_0x196577,null));};
\ No newline at end of file
+var _0xf2fc=['destroy','sendStatus','error','stack','name','send','UserProfileSection','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','save','then'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf2fc,0x72));var _0xcf2f=function(_0x258dea,_0x14051c){_0x258dea=_0x258dea-0x0;var _0x5b7c1a=_0xf2fc[_0x258dea];return _0x5b7c1a;};'use strict';var emlformat=require(_0xcf2f('0x0'));var rimraf=require(_0xcf2f('0x1'));var zipdir=require(_0xcf2f('0x2'));var jsonpatch=require(_0xcf2f('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xcf2f('0x4'));var sox=require(_0xcf2f('0x5'));var csv=require(_0xcf2f('0x6'));var ejs=require(_0xcf2f('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xcf2f('0x8'));var crypto=require(_0xcf2f('0x9'));var jsforce=require(_0xcf2f('0xa'));var deskjs=require(_0xcf2f('0xb'));var toCsv=require(_0xcf2f('0x6'));var querystring=require(_0xcf2f('0xc'));var Papa=require('papaparse');var Redis=require(_0xcf2f('0xd'));var authService=require(_0xcf2f('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xcf2f('0xf'));var hardwareService=require(_0xcf2f('0x10'));var logger=require('../../config/logger')(_0xcf2f('0x11'));var utils=require('../../config/utils');var config=require(_0xcf2f('0x12'));var licenseUtil=require(_0xcf2f('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3ad633,_0x3e96ae){_0x3e96ae=_0x3e96ae||0xcc;return function(_0xc1beeb){if(_0xc1beeb){return _0x3ad633['sendStatus'](_0x3e96ae);}return _0x3ad633[_0xcf2f('0x14')](_0x3e96ae)[_0xcf2f('0x15')]();};}function respondWithResult(_0x324122,_0x2bcba2){_0x2bcba2=_0x2bcba2||0xc8;return function(_0x58b4bd){if(_0x58b4bd){return _0x324122[_0xcf2f('0x14')](_0x2bcba2)['json'](_0x58b4bd);}};}function respondWithFilteredResult(_0x1a0293,_0x3b75af){return function(_0x250cb7){if(_0x250cb7){var _0x2cabad=typeof _0x3b75af[_0xcf2f('0x16')]===_0xcf2f('0x17')&&typeof _0x3b75af[_0xcf2f('0x18')]===_0xcf2f('0x17');var _0x344533=_0x250cb7['count'];var _0xa443aa=_0x2cabad?0x0:_0x3b75af['offset'];var _0x746b89=_0x2cabad?_0x250cb7[_0xcf2f('0x19')]:_0x3b75af[_0xcf2f('0x16')]+_0x3b75af[_0xcf2f('0x18')];var _0x5cecf3;if(_0x746b89>=_0x344533){_0x746b89=_0x344533;_0x5cecf3=0xc8;}else{_0x5cecf3=0xce;}_0x1a0293[_0xcf2f('0x14')](_0x5cecf3);return _0x1a0293[_0xcf2f('0x1a')](_0xcf2f('0x1b'),_0xa443aa+'-'+_0x746b89+'/'+_0x344533)[_0xcf2f('0x1c')](_0x250cb7);}return null;};}function patchUpdates(_0x44f92a){return function(_0x4819e0){try{jsonpatch[_0xcf2f('0x1d')](_0x4819e0,_0x44f92a,!![]);}catch(_0x1c7749){return BPromise['reject'](_0x1c7749);}return _0x4819e0[_0xcf2f('0x1e')]();};}function saveUpdates(_0x3eb121,_0x4c04e5){return function(_0x47bae8){if(_0x47bae8){return _0x47bae8['update'](_0x3eb121)[_0xcf2f('0x1f')](function(_0x11fa52){return _0x11fa52;});}return null;};}function removeEntity(_0x1e7674,_0x1702a4){return function(_0x31cb61){if(_0x31cb61){return _0x31cb61[_0xcf2f('0x20')]()['then'](function(){_0x1e7674[_0xcf2f('0x14')](0xcc)[_0xcf2f('0x15')]();});}};}function handleEntityNotFound(_0x4c3e48,_0x321819){return function(_0x27b81c){if(!_0x27b81c){_0x4c3e48[_0xcf2f('0x21')](0x194);}return _0x27b81c;};}function handleError(_0x140c59,_0x111f60){_0x111f60=_0x111f60||0x1f4;return function(_0x35bc3e){logger[_0xcf2f('0x22')](_0x35bc3e[_0xcf2f('0x23')]);if(_0x35bc3e[_0xcf2f('0x24')]){delete _0x35bc3e[_0xcf2f('0x24')];}_0x140c59[_0xcf2f('0x14')](_0x111f60)[_0xcf2f('0x25')](_0x35bc3e);};}exports['index']=function(_0x446767,_0x354aa6){var _0x2a843d={},_0x44d3d9={},_0x5583a2={'count':0x0,'rows':[]};var _0x27f801=_['map'](db[_0xcf2f('0x26')][_0xcf2f('0x27')],function(_0x873812){return{'name':_0x873812[_0xcf2f('0x28')],'type':_0x873812['type'][_0xcf2f('0x29')]};});_0x44d3d9[_0xcf2f('0x2a')]=_[_0xcf2f('0x2b')](_0x27f801,_0xcf2f('0x24'));_0x44d3d9[_0xcf2f('0x2c')]=_[_0xcf2f('0x2d')](_0x446767[_0xcf2f('0x2c')]);_0x44d3d9[_0xcf2f('0x2e')]=_[_0xcf2f('0x2f')](_0x44d3d9[_0xcf2f('0x2a')],_0x44d3d9['query']);_0x2a843d[_0xcf2f('0x30')]=_['intersection'](_0x44d3d9['model'],qs[_0xcf2f('0x31')](_0x446767[_0xcf2f('0x2c')][_0xcf2f('0x31')]));_0x2a843d['attributes']=_0x2a843d[_0xcf2f('0x30')]['length']?_0x2a843d[_0xcf2f('0x30')]:_0x44d3d9[_0xcf2f('0x2a')];if(!_0x446767[_0xcf2f('0x2c')][_0xcf2f('0x32')](_0xcf2f('0x33'))){_0x2a843d[_0xcf2f('0x18')]=qs['limit'](_0x446767[_0xcf2f('0x2c')][_0xcf2f('0x18')]);_0x2a843d[_0xcf2f('0x16')]=qs['offset'](_0x446767[_0xcf2f('0x2c')][_0xcf2f('0x16')]);}_0x2a843d[_0xcf2f('0x34')]=qs[_0xcf2f('0x35')](_0x446767[_0xcf2f('0x2c')]['sort']);_0x2a843d[_0xcf2f('0x36')]=qs[_0xcf2f('0x2e')](_[_0xcf2f('0x37')](_0x446767[_0xcf2f('0x2c')],_0x44d3d9[_0xcf2f('0x2e')]),_0x27f801);if(_0x446767[_0xcf2f('0x2c')]['filter']){_0x2a843d[_0xcf2f('0x36')]=_[_0xcf2f('0x38')](_0x2a843d['where'],{'$or':_[_0xcf2f('0x2b')](_0x27f801,function(_0xce6fa6){if(_0xce6fa6[_0xcf2f('0x39')]!==_0xcf2f('0x3a')){var _0x313ec2={};_0x313ec2[_0xce6fa6[_0xcf2f('0x24')]]={'$like':'%'+_0x446767[_0xcf2f('0x2c')]['filter']+'%'};return _0x313ec2;}})});}_0x2a843d=_[_0xcf2f('0x38')]({},_0x2a843d,_0x446767[_0xcf2f('0x3b')]);var _0x59f57c={'where':_0x2a843d[_0xcf2f('0x36')]};return db['UserProfileSection'][_0xcf2f('0x19')](_0x59f57c)['then'](function(_0xdfe49b){_0x5583a2['count']=_0xdfe49b;if(_0x446767['query'][_0xcf2f('0x3c')]){_0x2a843d[_0xcf2f('0x3d')]=[{'all':!![]}];}return db['UserProfileSection'][_0xcf2f('0x3e')](_0x2a843d);})[_0xcf2f('0x1f')](function(_0x415c66){_0x5583a2[_0xcf2f('0x3f')]=_0x415c66;return _0x5583a2;})[_0xcf2f('0x1f')](respondWithFilteredResult(_0x354aa6,_0x2a843d))[_0xcf2f('0x40')](handleError(_0x354aa6,null));};exports[_0xcf2f('0x41')]=function(_0x30edd9,_0x5c97b3){var _0x5f1713={'raw':![],'where':{'id':_0x30edd9[_0xcf2f('0x42')]['id']}},_0x4f4366={};_0x4f4366[_0xcf2f('0x2a')]=_[_0xcf2f('0x2d')](db[_0xcf2f('0x26')][_0xcf2f('0x27')]);_0x4f4366[_0xcf2f('0x2c')]=_[_0xcf2f('0x2d')](_0x30edd9[_0xcf2f('0x2c')]);_0x4f4366['filters']=_['intersection'](_0x4f4366[_0xcf2f('0x2a')],_0x4f4366[_0xcf2f('0x2c')]);_0x5f1713[_0xcf2f('0x30')]=_[_0xcf2f('0x2f')](_0x4f4366[_0xcf2f('0x2a')],qs[_0xcf2f('0x31')](_0x30edd9['query'][_0xcf2f('0x31')]));_0x5f1713['attributes']=_0x5f1713[_0xcf2f('0x30')][_0xcf2f('0x43')]?_0x5f1713['attributes']:_0x4f4366['model'];if(_0x30edd9['query'][_0xcf2f('0x3c')]){_0x5f1713[_0xcf2f('0x3d')]=[{'all':!![]}];}_0x5f1713=_[_0xcf2f('0x38')]({},_0x5f1713,_0x30edd9[_0xcf2f('0x3b')]);return db['UserProfileSection'][_0xcf2f('0x44')](_0x5f1713)[_0xcf2f('0x1f')](handleEntityNotFound(_0x5c97b3,null))[_0xcf2f('0x1f')](respondWithResult(_0x5c97b3,null))['catch'](handleError(_0x5c97b3,null));};exports[_0xcf2f('0x45')]=function(_0x14c315,_0x30e28e){return db['UserProfileSection'][_0xcf2f('0x45')](_0x14c315[_0xcf2f('0x46')],{})[_0xcf2f('0x1f')](respondWithResult(_0x30e28e,0xc9))[_0xcf2f('0x40')](handleError(_0x30e28e,null));};exports[_0xcf2f('0x47')]=function(_0x3b6699,_0x20d43e){if(_0x3b6699[_0xcf2f('0x46')]['id']){delete _0x3b6699[_0xcf2f('0x46')]['id'];}return db['UserProfileSection']['find']({'where':{'id':_0x3b6699['params']['id']}})[_0xcf2f('0x1f')](handleEntityNotFound(_0x20d43e,null))['then'](saveUpdates(_0x3b6699[_0xcf2f('0x46')],null))[_0xcf2f('0x1f')](respondWithResult(_0x20d43e,null))[_0xcf2f('0x40')](handleError(_0x20d43e,null));};exports[_0xcf2f('0x20')]=function(_0xda53c4,_0x46b2ed){return db[_0xcf2f('0x26')][_0xcf2f('0x44')]({'where':{'id':_0xda53c4[_0xcf2f('0x42')]['id']}})[_0xcf2f('0x1f')](handleEntityNotFound(_0x46b2ed,null))[_0xcf2f('0x1f')](removeEntity(_0x46b2ed,null))[_0xcf2f('0x40')](handleError(_0x46b2ed,null));};exports[_0xcf2f('0x48')]=function(_0x3ce8a4,_0x4973dd){return db[_0xcf2f('0x26')][_0xcf2f('0x48')]()[_0xcf2f('0x1f')](respondWithResult(_0x4973dd,null))[_0xcf2f('0x40')](handleError(_0x4973dd,null));};
\ No newline at end of file
index 9ea308b..0a276a3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x71db=['moment','bluebird','rimraf','../../config/environment','./userProfileSection.attributes','exports','define','UserProfileSection','user_profile_has_sections','sectionId','userProfileId','lodash','util','../../config/logger','api'];(function(_0x597207,_0x3244c0){var _0x1b9743=function(_0x5cae81){while(--_0x5cae81){_0x597207['push'](_0x597207['shift']());}};_0x1b9743(++_0x3244c0);}(_0x71db,0x173));var _0xb71d=function(_0x176317,_0x4897b3){_0x176317=_0x176317-0x0;var _0xef2759=_0x71db[_0x176317];return _0xef2759;};'use strict';var _=require(_0xb71d('0x0'));var util=require(_0xb71d('0x1'));var logger=require(_0xb71d('0x2'))(_0xb71d('0x3'));var moment=require(_0xb71d('0x4'));var BPromise=require(_0xb71d('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xb71d('0x6'));var config=require(_0xb71d('0x7'));var attributes=require(_0xb71d('0x8'));module[_0xb71d('0x9')]=function(_0x4e8b60,_0x2195e0){return _0x4e8b60[_0xb71d('0xa')](_0xb71d('0xb'),attributes,{'tableName':_0xb71d('0xc'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0xb71d('0xd'),_0xb71d('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x9679=['lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userProfileSection.attributes','define','UserProfileSection','compositeIndex','userProfileId'];(function(_0x469648,_0x4ddaa3){var _0x3014db=function(_0x50614c){while(--_0x50614c){_0x469648['push'](_0x469648['shift']());}};_0x3014db(++_0x4ddaa3);}(_0x9679,0x15f));var _0x9967=function(_0x5a9739,_0xc7730d){_0x5a9739=_0x5a9739-0x0;var _0xcc635e=_0x9679[_0x5a9739];return _0xcc635e;};'use strict';var _=require(_0x9967('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x9967('0x1'));var moment=require(_0x9967('0x2'));var BPromise=require(_0x9967('0x3'));var rp=require(_0x9967('0x4'));var fs=require('fs');var path=require(_0x9967('0x5'));var rimraf=require(_0x9967('0x6'));var config=require(_0x9967('0x7'));var attributes=require(_0x9967('0x8'));module['exports']=function(_0x5c8725,_0x5b577f){return _0x5c8725[_0x9967('0x9')](_0x9967('0xa'),attributes,{'tableName':'user_profile_has_sections','paranoid':![],'indexes':[{'name':_0x9967('0xb'),'fields':['sectionId',_0x9967('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
index 952a6e3..a74cd03 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5523=['stringify','error','message','result','catch','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x192734,_0x56d6d1){var _0x11e8f0=function(_0x518834){while(--_0x518834){_0x192734['push'](_0x192734['shift']());}};_0x11e8f0(++_0x56d6d1);}(_0x5523,0x15b));var _0x3552=function(_0xb713fe,_0xe5cc3){_0xb713fe=_0xb713fe-0x0;var _0x412771=_0x5523[_0xb713fe];return _0x412771;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3552('0x0'));var BPromise=require(_0x3552('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3552('0x2'));var db=require(_0x3552('0x3'))['db'];var utils=require(_0x3552('0x4'));var logger=require('../../config/logger')(_0x3552('0x5'));var config=require(_0x3552('0x6'));var jayson=require(_0x3552('0x7'));var client=jayson['client'][_0x3552('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1c222f,_0x336492,_0x14529b){return new BPromise(function(_0x83ffcd,_0x4c0a4f){return client[_0x3552('0x9')](_0x1c222f,_0x14529b)[_0x3552('0xa')](function(_0xfacf1e){logger['info'](_0x3552('0xb'),_0x336492,_0x3552('0xc'));logger[_0x3552('0xd')]('UserProfileSection,\x20%s,\x20%s,\x20%s',_0x336492,_0x3552('0xc'),JSON[_0x3552('0xe')](_0xfacf1e));if(_0xfacf1e[_0x3552('0xf')]){if(_0xfacf1e['error']['code']===0x1f4){logger[_0x3552('0xf')]('UserProfileSection,\x20%s,\x20%s',_0x336492,_0xfacf1e[_0x3552('0xf')][_0x3552('0x10')]);return _0x4c0a4f(_0xfacf1e['error'][_0x3552('0x10')]);}logger[_0x3552('0xf')](_0x3552('0xb'),_0x336492,_0xfacf1e['error']['message']);return _0x83ffcd(_0xfacf1e[_0x3552('0xf')][_0x3552('0x10')]);}else{logger['info']('UserProfileSection,\x20%s,\x20%s',_0x336492,'request\x20sent');_0x83ffcd(_0xfacf1e[_0x3552('0x11')]['message']);}})[_0x3552('0x12')](function(_0x5e64ad){logger[_0x3552('0xf')](_0x3552('0xb'),_0x336492,_0x5e64ad);_0x4c0a4f(_0x5e64ad);});});}
\ No newline at end of file
+var _0x89a6=['request\x20sent','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','UserProfileSection,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x4485e7,_0x14c289){var _0x167d06=function(_0xad65dd){while(--_0xad65dd){_0x4485e7['push'](_0x4485e7['shift']());}};_0x167d06(++_0x14c289);}(_0x89a6,0x6a));var _0x689a=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x89a6[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x689a('0x0'));var util=require(_0x689a('0x1'));var moment=require(_0x689a('0x2'));var BPromise=require(_0x689a('0x3'));var rs=require(_0x689a('0x4'));var fs=require('fs');var Redis=require(_0x689a('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x689a('0x6'));var logger=require(_0x689a('0x7'))(_0x689a('0x8'));var config=require(_0x689a('0x9'));var jayson=require(_0x689a('0xa'));var client=jayson[_0x689a('0xb')][_0x689a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x567f16,_0x47ac69,_0x464347){return new BPromise(function(_0x13ca13,_0x370037){return client[_0x689a('0xd')](_0x567f16,_0x464347)['then'](function(_0x30cfb6){logger['info']('UserProfileSection,\x20%s,\x20%s',_0x47ac69,_0x689a('0xe'));logger['debug'](_0x689a('0xf'),_0x47ac69,_0x689a('0xe'),JSON[_0x689a('0x10')](_0x30cfb6));if(_0x30cfb6[_0x689a('0x11')]){if(_0x30cfb6[_0x689a('0x11')][_0x689a('0x12')]===0x1f4){logger[_0x689a('0x11')](_0x689a('0x13'),_0x47ac69,_0x30cfb6['error'][_0x689a('0x14')]);return _0x370037(_0x30cfb6['error'][_0x689a('0x14')]);}logger[_0x689a('0x11')](_0x689a('0x13'),_0x47ac69,_0x30cfb6['error'][_0x689a('0x14')]);return _0x13ca13(_0x30cfb6[_0x689a('0x11')][_0x689a('0x14')]);}else{logger[_0x689a('0x15')](_0x689a('0x13'),_0x47ac69,'request\x20sent');_0x13ca13(_0x30cfb6[_0x689a('0x16')]['message']);}})[_0x689a('0x17')](function(_0x38af94){logger['error'](_0x689a('0x13'),_0x47ac69,_0x38af94);_0x370037(_0x38af94);});});}
\ No newline at end of file
index 178d222..fce98d2 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(_0x209b06,_0x2be741){var _0xacc50f=function(_0x3fba09){while(--_0x3fba09){_0x209b06['push'](_0x209b06['shift']());}};_0xacc50f(++_0x2be741);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router;
\ No newline at end of file
+var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x27b3bf,_0x58125a){var _0x515eaa=function(_0x49e3fd){while(--_0x49e3fd){_0x27b3bf['push'](_0x27b3bf['shift']());}};_0x515eaa(++_0x58125a);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x2ed7d1,_0x363741){_0x2ed7d1=_0x2ed7d1-0x0;var _0x38ae3c=_0xcb91[_0x2ed7d1];return _0x38ae3c;};'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 46cdace..84137bc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7763=['sequelize','exports','INTEGER'];(function(_0x272ab7,_0x393844){var _0x30746e=function(_0x3798fe){while(--_0x3798fe){_0x272ab7['push'](_0x272ab7['shift']());}};_0x30746e(++_0x393844);}(_0x7763,0x13b));var _0x3776=function(_0x381543,_0x1aacb5){_0x381543=_0x381543-0x0;var _0x30b94d=_0x7763[_0x381543];return _0x30b94d;};'use strict';var Sequelize=require(_0x3776('0x0'));module[_0x3776('0x1')]={'penalty':{'type':Sequelize[_0x3776('0x2')],'defaultValue':0x0}};
\ No newline at end of file
+var _0xbd5a=['exports','INTEGER','sequelize'];(function(_0x1ddbee,_0x5c0373){var _0x5c6189=function(_0x71ffc7){while(--_0x71ffc7){_0x1ddbee['push'](_0x1ddbee['shift']());}};_0x5c6189(++_0x5c0373);}(_0xbd5a,0x1d0));var _0xabd5=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0xbd5a[_0xc6be3a];return _0x56a310;};'use strict';var Sequelize=require(_0xabd5('0x0'));module[_0xabd5('0x1')]={'penalty':{'type':Sequelize[_0xabd5('0x2')],'defaultValue':0x0}};
\ No newline at end of file
index e17266d..1e4b284 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfdbd=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./userSmsQueue.attributes'];(function(_0x47b58b,_0x41a189){var _0x46bebe=function(_0x22bbfa){while(--_0x22bbfa){_0x47b58b['push'](_0x47b58b['shift']());}};_0x46bebe(++_0x41a189);}(_0xfdbd,0xf0));var _0xdfdb=function(_0x1db251,_0xf0443d){_0x1db251=_0x1db251-0x0;var _0x56685a=_0xfdbd[_0x1db251];return _0x56685a;};'use strict';var _=require(_0xdfdb('0x0'));var util=require(_0xdfdb('0x1'));var logger=require(_0xdfdb('0x2'))(_0xdfdb('0x3'));var moment=require(_0xdfdb('0x4'));var BPromise=require(_0xdfdb('0x5'));var rp=require(_0xdfdb('0x6'));var fs=require('fs');var path=require(_0xdfdb('0x7'));var rimraf=require(_0xdfdb('0x8'));var config=require('../../config/environment');var attributes=require(_0xdfdb('0x9'));module['exports']=function(_0x453ef6,_0x41bd5e){return _0x453ef6['define']('UserSmsQueue',attributes,{'tableName':'user_has_sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./userSmsQueue.attributes','exports','UserSmsQueue','user_has_sms_queues','lodash','util'];(function(_0x309991,_0x457e73){var _0x4ca94d=function(_0x294acc){while(--_0x294acc){_0x309991['push'](_0x309991['shift']());}};_0x4ca94d(++_0x457e73);}(_0x7a54,0x106));var _0x47a5=function(_0x50024a,_0x46cc0a){_0x50024a=_0x50024a-0x0;var _0x49fd9d=_0x7a54[_0x50024a];return _0x49fd9d;};'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 a5e35a9..b35ee7d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8017=['ioredis','../../config/utils','../../config/environment','client','http','request','then','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','bluebird','randomstring'];(function(_0xa9a245,_0x2a0387){var _0x2d0eaa=function(_0x2bba86){while(--_0x2bba86){_0xa9a245['push'](_0xa9a245['shift']());}};_0x2d0eaa(++_0x2a0387);}(_0x8017,0x18b));var _0x7801=function(_0x419550,_0x15cdf1){_0x419550=_0x419550-0x0;var _0x55f9ef=_0x8017[_0x419550];return _0x55f9ef;};'use strict';var _=require(_0x7801('0x0'));var util=require(_0x7801('0x1'));var moment=require('moment');var BPromise=require(_0x7801('0x2'));var rs=require(_0x7801('0x3'));var fs=require('fs');var Redis=require(_0x7801('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7801('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x7801('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x7801('0x7')][_0x7801('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x48292b,_0x785efd,_0x4833a3){return new BPromise(function(_0x25469e,_0x17f967){return client[_0x7801('0x9')](_0x48292b,_0x4833a3)[_0x7801('0xa')](function(_0xc09d71){logger[_0x7801('0xb')](_0x7801('0xc'),_0x785efd,_0x7801('0xd'));logger[_0x7801('0xe')](_0x7801('0xf'),_0x785efd,_0x7801('0xd'),JSON[_0x7801('0x10')](_0xc09d71));if(_0xc09d71[_0x7801('0x11')]){if(_0xc09d71[_0x7801('0x11')]['code']===0x1f4){logger[_0x7801('0x11')](_0x7801('0xc'),_0x785efd,_0xc09d71[_0x7801('0x11')]['message']);return _0x17f967(_0xc09d71[_0x7801('0x11')][_0x7801('0x12')]);}logger[_0x7801('0x11')]('UserSmsQueue,\x20%s,\x20%s',_0x785efd,_0xc09d71['error'][_0x7801('0x12')]);return _0x25469e(_0xc09d71[_0x7801('0x11')][_0x7801('0x12')]);}else{logger[_0x7801('0xb')](_0x7801('0xc'),_0x785efd,_0x7801('0xd'));_0x25469e(_0xc09d71[_0x7801('0x13')]['message']);}})[_0x7801('0x14')](function(_0x1c8f76){logger[_0x7801('0x11')]('UserSmsQueue,\x20%s,\x20%s',_0x785efd,_0x1c8f76);_0x17f967(_0x1c8f76);});});}
\ No newline at end of file
+var _0x99d5=['lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','error','code','message','catch'];(function(_0x59dccc,_0x184c1c){var _0xc97bcb=function(_0x1ddbcb){while(--_0x1ddbcb){_0x59dccc['push'](_0x59dccc['shift']());}};_0xc97bcb(++_0x184c1c);}(_0x99d5,0xe4));var _0x599d=function(_0x157e93,_0x4668f9){_0x157e93=_0x157e93-0x0;var _0x4459af=_0x99d5[_0x157e93];return _0x4459af;};'use strict';var _=require(_0x599d('0x0'));var util=require('util');var moment=require(_0x599d('0x1'));var BPromise=require(_0x599d('0x2'));var rs=require(_0x599d('0x3'));var fs=require('fs');var Redis=require(_0x599d('0x4'));var db=require(_0x599d('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x599d('0x6'))(_0x599d('0x7'));var config=require('../../config/environment');var jayson=require(_0x599d('0x8'));var client=jayson[_0x599d('0x9')][_0x599d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2b161a,_0x108c07,_0x3348fe){return new BPromise(function(_0x55fa93,_0x5ddc11){return client[_0x599d('0xb')](_0x2b161a,_0x3348fe)['then'](function(_0x5cb0bf){logger[_0x599d('0xc')](_0x599d('0xd'),_0x108c07,'request\x20sent');logger['debug']('UserSmsQueue,\x20%s,\x20%s,\x20%s',_0x108c07,_0x599d('0xe'),JSON['stringify'](_0x5cb0bf));if(_0x5cb0bf[_0x599d('0xf')]){if(_0x5cb0bf[_0x599d('0xf')][_0x599d('0x10')]===0x1f4){logger[_0x599d('0xf')]('UserSmsQueue,\x20%s,\x20%s',_0x108c07,_0x5cb0bf['error'][_0x599d('0x11')]);return _0x5ddc11(_0x5cb0bf[_0x599d('0xf')][_0x599d('0x11')]);}logger[_0x599d('0xf')](_0x599d('0xd'),_0x108c07,_0x5cb0bf['error'][_0x599d('0x11')]);return _0x55fa93(_0x5cb0bf[_0x599d('0xf')][_0x599d('0x11')]);}else{logger[_0x599d('0xc')]('UserSmsQueue,\x20%s,\x20%s',_0x108c07,_0x599d('0xe'));_0x55fa93(_0x5cb0bf['result'][_0x599d('0x11')]);}})[_0x599d('0x12')](function(_0x5f08c0){logger[_0x599d('0xf')](_0x599d('0xd'),_0x108c07,_0x5f08c0);_0x5ddc11(_0x5f08c0);});});}
\ No newline at end of file
index 3d3b0c7..f558a30 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3cb5=['exports','INTEGER','sequelize'];(function(_0x77e14a,_0x16e0cd){var _0x10d19c=function(_0x5c1036){while(--_0x5c1036){_0x77e14a['push'](_0x77e14a['shift']());}};_0x10d19c(++_0x16e0cd);}(_0x3cb5,0xb6));var _0x53cb=function(_0x181bee,_0x434df4){_0x181bee=_0x181bee-0x0;var _0x82300c=_0x3cb5[_0x181bee];return _0x82300c;};'use strict';var Sequelize=require(_0x53cb('0x0'));module[_0x53cb('0x1')]={'UserId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize[_0x53cb('0x2')]}};
\ No newline at end of file
+var _0x1a54=['exports','INTEGER','sequelize'];(function(_0x31d6c2,_0x422dcd){var _0x295dd0=function(_0x2b5dd1){while(--_0x2b5dd1){_0x31d6c2['push'](_0x31d6c2['shift']());}};_0x295dd0(++_0x422dcd);}(_0x1a54,0x86));var _0x41a5=function(_0x3412fb,_0x13df0c){_0x3412fb=_0x3412fb-0x0;var _0x344a25=_0x1a54[_0x3412fb];return _0x344a25;};'use strict';var Sequelize=require(_0x41a5('0x0'));module[_0x41a5('0x1')]={'UserId':{'type':Sequelize[_0x41a5('0x2')]},'VoicePrefixId':{'type':Sequelize[_0x41a5('0x2')]}};
\ No newline at end of file
index 9034fc3..d15da35 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['../../config/environment','./userVoicePrefix.attributes','exports','define','UserVoicePrefix','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x40f13a,_0x26ce34){var _0x397c2f=function(_0x400033){while(--_0x400033){_0x40f13a['push'](_0x40f13a['shift']());}};_0x397c2f(++_0x26ce34);}(_0xa9e0,0x123));var _0x0a9e=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xa9e0[_0xa1e3e3];return _0xc980e9;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'user_has_voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa9e0=['../../config/environment','./userVoicePrefix.attributes','exports','define','UserVoicePrefix','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x2484f8,_0x1ea92a){var _0x2ac7f0=function(_0x1c9a4e){while(--_0x1c9a4e){_0x2484f8['push'](_0x2484f8['shift']());}};_0x2ac7f0(++_0x1ea92a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0xa9e0[_0x3635ce];return _0x97ecd0;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'user_has_voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 809ac88..3bec5af 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(_0x17f9f4,_0x212dda){var _0x4dc32c=function(_0x1ed46d){while(--_0x1ed46d){_0x17f9f4['push'](_0x17f9f4['shift']());}};_0x4dc32c(++_0x212dda);}(_0x9c44,0x178));var _0x49c4=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x9c44[_0x167cc1];return _0x10bc4b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router;
\ No newline at end of file
+var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x26278a,_0x161f57){var _0x108b8f=function(_0x35ab70){while(--_0x35ab70){_0x26278a['push'](_0x26278a['shift']());}};_0x108b8f(++_0x161f57);}(_0x70e0,0x17b));var _0x070e=function(_0x59e469,_0x1e8647){_0x59e469=_0x59e469-0x0;var _0x17a2ab=_0x70e0[_0x59e469];return _0x17a2ab;};'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 0ee2c32..ba7357e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x94ce=['sequelize','exports'];(function(_0x475138,_0x508cd){var _0x21c5dd=function(_0x4d72d1){while(--_0x4d72d1){_0x475138['push'](_0x475138['shift']());}};_0x21c5dd(++_0x508cd);}(_0x94ce,0x6c));var _0xe94c=function(_0x5ea246,_0x2f1890){_0x5ea246=_0x5ea246-0x0;var _0x164491=_0x94ce[_0x5ea246];return _0x164491;};'use strict';var Sequelize=require(_0xe94c('0x0'));module[_0xe94c('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
+var _0xd58c=['INTEGER','sequelize','exports'];(function(_0xe7acb9,_0x479726){var _0x364bb6=function(_0x235cda){while(--_0x235cda){_0xe7acb9['push'](_0xe7acb9['shift']());}};_0x364bb6(++_0x479726);}(_0xd58c,0x70));var _0xcd58=function(_0x5c64e6,_0x3cece4){_0x5c64e6=_0x5c64e6-0x0;var _0x2d5571=_0xd58c[_0x5c64e6];return _0x2d5571;};'use strict';var Sequelize=require(_0xcd58('0x0'));module[_0xcd58('0x1')]={'penalty':{'type':Sequelize[_0xcd58('0x2')],'defaultValue':0x0}};
\ No newline at end of file
index 7f7d80c..9b96d2e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x649b=['lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userVoiceQueue.attributes','exports','UserVoiceQueue','user_has_voice_queues'];(function(_0x58c3b9,_0x34c59b){var _0x4b700b=function(_0x9b5918){while(--_0x9b5918){_0x58c3b9['push'](_0x58c3b9['shift']());}};_0x4b700b(++_0x34c59b);}(_0x649b,0xe4));var _0xb649=function(_0x358ed7,_0x68dcbc){_0x358ed7=_0x358ed7-0x0;var _0x1b72ce=_0x649b[_0x358ed7];return _0x1b72ce;};'use strict';var _=require(_0xb649('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xb649('0x1'));var moment=require(_0xb649('0x2'));var BPromise=require(_0xb649('0x3'));var rp=require(_0xb649('0x4'));var fs=require('fs');var path=require(_0xb649('0x5'));var rimraf=require(_0xb649('0x6'));var config=require(_0xb649('0x7'));var attributes=require(_0xb649('0x8'));module[_0xb649('0x9')]=function(_0x308869,_0x4bd3c3){return _0x308869['define'](_0xb649('0xa'),attributes,{'tableName':_0xb649('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5369=['../../config/environment','./userVoiceQueue.attributes','exports','UserVoiceQueue','user_has_voice_queues','lodash','../../config/logger','moment','bluebird','path','rimraf'];(function(_0x18fec8,_0x31d0cd){var _0x5e400c=function(_0x1f3bc0){while(--_0x1f3bc0){_0x18fec8['push'](_0x18fec8['shift']());}};_0x5e400c(++_0x31d0cd);}(_0x5369,0x118));var _0x9536=function(_0x169879,_0x2364bc){_0x169879=_0x169879-0x0;var _0x2f3199=_0x5369[_0x169879];return _0x2f3199;};'use strict';var _=require(_0x9536('0x0'));var util=require('util');var logger=require(_0x9536('0x1'))('api');var moment=require(_0x9536('0x2'));var BPromise=require(_0x9536('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9536('0x4'));var rimraf=require(_0x9536('0x5'));var config=require(_0x9536('0x6'));var attributes=require(_0x9536('0x7'));module[_0x9536('0x8')]=function(_0x5a6a52,_0x18a58e){return _0x5a6a52['define'](_0x9536('0x9'),attributes,{'tableName':_0x9536('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 2683305..9ef4432 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x83d3=['UserVoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','UserVoiceQueue,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','debug'];(function(_0x192abd,_0x522bb3){var _0x14504e=function(_0x2d801b){while(--_0x2d801b){_0x192abd['push'](_0x192abd['shift']());}};_0x14504e(++_0x522bb3);}(_0x83d3,0x111));var _0x383d=function(_0x114d1f,_0x55548e){_0x114d1f=_0x114d1f-0x0;var _0x5b91d4=_0x83d3[_0x114d1f];return _0x5b91d4;};'use strict';var _=require(_0x383d('0x0'));var util=require(_0x383d('0x1'));var moment=require('moment');var BPromise=require(_0x383d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x383d('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x383d('0x4'))(_0x383d('0x5'));var config=require(_0x383d('0x6'));var jayson=require(_0x383d('0x7'));var client=jayson[_0x383d('0x8')][_0x383d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x139176,_0x34f3b9,_0x5abf7e){return new BPromise(function(_0x459547,_0x1f5e82){return client[_0x383d('0xa')](_0x139176,_0x5abf7e)['then'](function(_0x28de75){logger['info']('UserVoiceQueue,\x20%s,\x20%s',_0x34f3b9,'request\x20sent');logger[_0x383d('0xb')](_0x383d('0xc'),_0x34f3b9,_0x383d('0xd'),JSON['stringify'](_0x28de75));if(_0x28de75[_0x383d('0xe')]){if(_0x28de75[_0x383d('0xe')]['code']===0x1f4){logger[_0x383d('0xe')](_0x383d('0xf'),_0x34f3b9,_0x28de75[_0x383d('0xe')][_0x383d('0x10')]);return _0x1f5e82(_0x28de75[_0x383d('0xe')][_0x383d('0x10')]);}logger['error'](_0x383d('0xf'),_0x34f3b9,_0x28de75[_0x383d('0xe')][_0x383d('0x10')]);return _0x459547(_0x28de75[_0x383d('0xe')][_0x383d('0x10')]);}else{logger['info'](_0x383d('0xf'),_0x34f3b9,_0x383d('0xd'));_0x459547(_0x28de75[_0x383d('0x11')][_0x383d('0x10')]);}})[_0x383d('0x12')](function(_0x2c8b49){logger[_0x383d('0xe')]('UserVoiceQueue,\x20%s,\x20%s',_0x34f3b9,_0x2c8b49);_0x1f5e82(_0x2c8b49);});});}
\ No newline at end of file
+var _0xe15e=['UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xe15e,0x6e));var _0xee15=function(_0x11e43a,_0x4dc616){_0x11e43a=_0x11e43a-0x0;var _0x247f0=_0xe15e[_0x11e43a];return _0x247f0;};'use strict';var _=require('lodash');var util=require(_0xee15('0x0'));var moment=require(_0xee15('0x1'));var BPromise=require(_0xee15('0x2'));var rs=require(_0xee15('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xee15('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xee15('0x5'))(_0xee15('0x6'));var config=require(_0xee15('0x7'));var jayson=require(_0xee15('0x8'));var client=jayson[_0xee15('0x9')][_0xee15('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x438e76,_0x2a80d4,_0xe1581a){return new BPromise(function(_0x24c19f,_0x76525e){return client[_0xee15('0xb')](_0x438e76,_0xe1581a)[_0xee15('0xc')](function(_0x3e082a){logger['info'](_0xee15('0xd'),_0x2a80d4,_0xee15('0xe'));logger[_0xee15('0xf')](_0xee15('0x10'),_0x2a80d4,_0xee15('0xe'),JSON[_0xee15('0x11')](_0x3e082a));if(_0x3e082a[_0xee15('0x12')]){if(_0x3e082a[_0xee15('0x12')][_0xee15('0x13')]===0x1f4){logger[_0xee15('0x12')](_0xee15('0xd'),_0x2a80d4,_0x3e082a[_0xee15('0x12')]['message']);return _0x76525e(_0x3e082a[_0xee15('0x12')]['message']);}logger[_0xee15('0x12')](_0xee15('0xd'),_0x2a80d4,_0x3e082a[_0xee15('0x12')][_0xee15('0x14')]);return _0x24c19f(_0x3e082a[_0xee15('0x12')][_0xee15('0x14')]);}else{logger['info']('UserVoiceQueue,\x20%s,\x20%s',_0x2a80d4,_0xee15('0xe'));_0x24c19f(_0x3e082a['result'][_0xee15('0x14')]);}})['catch'](function(_0x3ff1c2){logger['error']('UserVoiceQueue,\x20%s,\x20%s',_0x2a80d4,_0x3ff1c2);_0x76525e(_0x3ff1c2);});});}
\ No newline at end of file
index 574f691..9900381 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(_0xc08f00,_0x28067f){var _0x8649f7=function(_0x25f9a2){while(--_0x25f9a2){_0xc08f00['push'](_0xc08f00['shift']());}};_0x8649f7(++_0x28067f);}(_0x9c44,0x178));var _0x49c4=function(_0x4f9b18,_0x2cb5ca){_0x4f9b18=_0x4f9b18-0x0;var _0x29f20c=_0x9c44[_0x4f9b18];return _0x29f20c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router;
\ No newline at end of file
+var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x15f6a0,_0x5b34fc){var _0x10f8c7=function(_0x5b7d95){while(--_0x5b7d95){_0x15f6a0['push'](_0x15f6a0['shift']());}};_0x10f8c7(++_0x5b34fc);}(_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
index 613b050..4266eeb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7556=['Required\x20by\x20Asterisk','STRING','INTEGER','queue_interface'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0x7556,0x188));var _0x6755=function(_0x28b5ac,_0x30ea08){_0x28b5ac=_0x28b5ac-0x0;var _0x5ed3f2=_0x7556[_0x28b5ac];return _0x5ed3f2;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['INTEGER'],'primaryKey':!![],'autoIncrement':!![],'comment':_0x6755('0x0')},'membername':{'type':Sequelize[_0x6755('0x1')],'allowNull':![],'comment':_0x6755('0x0')},'UserId':{'type':Sequelize[_0x6755('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize[_0x6755('0x1')],'allowNull':![],'unique':_0x6755('0x3'),'comment':'Required\x20by\x20Asterisk'},'VoiceQueueId':{'type':Sequelize[_0x6755('0x2')],'allowNull':![]},'interface':{'type':Sequelize[_0x6755('0x1')],'allowNull':![],'unique':_0x6755('0x3'),'comment':_0x6755('0x0')},'penalty':{'type':Sequelize[_0x6755('0x2')](0xb),'defaultValue':0x0,'comment':_0x6755('0x0')},'paused':{'type':Sequelize[_0x6755('0x2')](0xb),'defaultValue':0x0,'comment':_0x6755('0x0')}};
\ No newline at end of file
+var _0x7825=['INTEGER','queue_interface','exports','STRING','Required\x20by\x20Asterisk'];(function(_0x447175,_0x23efc7){var _0x4e4544=function(_0x367f83){while(--_0x367f83){_0x447175['push'](_0x447175['shift']());}};_0x4e4544(++_0x23efc7);}(_0x7825,0x138));var _0x5782=function(_0x3b970b,_0x2ff4aa){_0x3b970b=_0x3b970b-0x0;var _0x202d50=_0x7825[_0x3b970b];return _0x202d50;};'use strict';var Sequelize=require('sequelize');module[_0x5782('0x0')]={'uniqueid':{'type':Sequelize['INTEGER'],'primaryKey':!![],'autoIncrement':!![],'comment':'Required\x20by\x20Asterisk'},'membername':{'type':Sequelize[_0x5782('0x1')],'allowNull':![],'comment':_0x5782('0x2')},'UserId':{'type':Sequelize[_0x5782('0x3')],'allowNull':![]},'queue_name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x5782('0x4'),'comment':_0x5782('0x2')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'allowNull':![]},'interface':{'type':Sequelize[_0x5782('0x1')],'allowNull':![],'unique':'queue_interface','comment':_0x5782('0x2')},'penalty':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0x5782('0x2')},'paused':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'}};
\ No newline at end of file
index 53d374c..7de3e93 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb574=['emit','hook','exports','events','setMaxListeners','save','update','remove'];(function(_0x5a39b0,_0x1c574d){var _0x1cf467=function(_0xa2b527){while(--_0xa2b527){_0x5a39b0['push'](_0x5a39b0['shift']());}};_0x1cf467(++_0x1c574d);}(_0xb574,0x17b));var _0x4b57=function(_0xcf1d3d,_0x337010){_0xcf1d3d=_0xcf1d3d-0x0;var _0x45d198=_0xb574[_0xcf1d3d];return _0x45d198;};'use strict';var EventEmitter=require(_0x4b57('0x0'));var UserVoiceQueueRt=require('../../mysqldb')['db']['UserVoiceQueueRt'];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x4b57('0x1')](0x0);var events={'afterCreate':_0x4b57('0x2'),'afterUpdate':_0x4b57('0x3'),'afterDestroy':_0x4b57('0x4')};function emitEvent(_0x25c2b3){return function(_0x3b5654,_0x10d76a,_0xaea482){UserVoiceQueueRtEvents[_0x4b57('0x5')](_0x25c2b3+':'+_0x3b5654['id'],_0x3b5654);UserVoiceQueueRtEvents[_0x4b57('0x5')](_0x25c2b3,_0x3b5654);_0xaea482(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserVoiceQueueRt[_0x4b57('0x6')](e,emitEvent(event));}}module[_0x4b57('0x7')]=UserVoiceQueueRtEvents;
\ No newline at end of file
+var _0xc729=['remove','emit','hasOwnProperty','exports','events','../../mysqldb','setMaxListeners','save'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xc729,0x84));var _0x9c72=function(_0x203a0b,_0x583c98){_0x203a0b=_0x203a0b-0x0;var _0x590daf=_0xc729[_0x203a0b];return _0x590daf;};'use strict';var EventEmitter=require(_0x9c72('0x0'));var UserVoiceQueueRt=require(_0x9c72('0x1'))['db']['UserVoiceQueueRt'];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x9c72('0x2')](0x0);var events={'afterCreate':_0x9c72('0x3'),'afterUpdate':'update','afterDestroy':_0x9c72('0x4')};function emitEvent(_0x19b0ad){return function(_0x27e5c1,_0x4302c7,_0x2362b0){UserVoiceQueueRtEvents[_0x9c72('0x5')](_0x19b0ad+':'+_0x27e5c1['id'],_0x27e5c1);UserVoiceQueueRtEvents[_0x9c72('0x5')](_0x19b0ad,_0x27e5c1);_0x2362b0(null);};}for(var e in events){if(events[_0x9c72('0x6')](e)){var event=events[e];UserVoiceQueueRt['hook'](e,emitEvent(event));}}module[_0x9c72('0x7')]=UserVoiceQueueRtEvents;
\ No newline at end of file
index 7e04280..913c094 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd7c1=['../../config/logger','api','moment','path','rimraf','./userVoiceQueueRt.attributes','exports','define','UserVoiceQueueRt','user_has_voice_queues_rt','util'];(function(_0x2046dd,_0x40a9ab){var _0x2eb055=function(_0x1c65e8){while(--_0x1c65e8){_0x2046dd['push'](_0x2046dd['shift']());}};_0x2eb055(++_0x40a9ab);}(_0xd7c1,0x128));var _0x1d7c=function(_0x5e5a1c,_0x156c34){_0x5e5a1c=_0x5e5a1c-0x0;var _0x24e945=_0xd7c1[_0x5e5a1c];return _0x24e945;};'use strict';var _=require('lodash');var util=require(_0x1d7c('0x0'));var logger=require(_0x1d7c('0x1'))(_0x1d7c('0x2'));var moment=require(_0x1d7c('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x1d7c('0x4'));var rimraf=require(_0x1d7c('0x5'));var config=require('../../config/environment');var attributes=require(_0x1d7c('0x6'));module[_0x1d7c('0x7')]=function(_0x3acded,_0x1fb305){return _0x3acded[_0x1d7c('0x8')](_0x1d7c('0x9'),attributes,{'tableName':_0x1d7c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x67df=['bluebird','path','rimraf','../../config/environment','exports','define','UserVoiceQueueRt','user_has_voice_queues_rt','lodash','util','../../config/logger','api'];(function(_0x1dea16,_0x4f7a5c){var _0x3923a3=function(_0x200a3a){while(--_0x200a3a){_0x1dea16['push'](_0x1dea16['shift']());}};_0x3923a3(++_0x4f7a5c);}(_0x67df,0x1d0));var _0xf67d=function(_0x22ebc6,_0x265d0b){_0x22ebc6=_0x22ebc6-0x0;var _0x350676=_0x67df[_0x22ebc6];return _0x350676;};'use strict';var _=require(_0xf67d('0x0'));var util=require(_0xf67d('0x1'));var logger=require(_0xf67d('0x2'))(_0xf67d('0x3'));var moment=require('moment');var BPromise=require(_0xf67d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf67d('0x5'));var rimraf=require(_0xf67d('0x6'));var config=require(_0xf67d('0x7'));var attributes=require('./userVoiceQueueRt.attributes');module[_0xf67d('0x8')]=function(_0x9e1f8f,_0x5edeae){return _0x9e1f8f[_0xf67d('0x9')](_0xf67d('0xa'),attributes,{'tableName':_0xf67d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 35472d3..756e19f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8637=['UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','code','message','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','raw','sequelize','COUNT','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./userVoiceQueueRt.socket','then','info'];(function(_0x429948,_0x1a6851){var _0x35d5d1=function(_0x574853){while(--_0x574853){_0x429948['push'](_0x429948['shift']());}};_0x35d5d1(++_0x1a6851);}(_0x8637,0xf0));var _0x7863=function(_0x56eef0,_0x15cf5f){_0x56eef0=_0x56eef0-0x0;var _0x513dd4=_0x8637[_0x56eef0];return _0x513dd4;};'use strict';var _=require(_0x7863('0x0'));var util=require('util');var moment=require(_0x7863('0x1'));var BPromise=require(_0x7863('0x2'));var rs=require(_0x7863('0x3'));var fs=require('fs');var Redis=require(_0x7863('0x4'));var db=require(_0x7863('0x5'))['db'];var utils=require(_0x7863('0x6'));var logger=require(_0x7863('0x7'))(_0x7863('0x8'));var config=require(_0x7863('0x9'));var jayson=require(_0x7863('0xa'));var client=jayson[_0x7863('0xb')]['http']({'port':0x232a});config[_0x7863('0xc')]=_[_0x7863('0xd')](config['redis'],{'host':_0x7863('0xe'),'port':0x18eb});var socket=require(_0x7863('0xf'))(new Redis(config[_0x7863('0xc')]));require(_0x7863('0x10'))['register'](socket);function respondWithRpcPromise(_0x26912c,_0x476aef,_0x126fe5){return new BPromise(function(_0x10aca0,_0x6be2f1){return client['request'](_0x26912c,_0x126fe5)[_0x7863('0x11')](function(_0x476751){logger[_0x7863('0x12')](_0x7863('0x13'),_0x476aef,_0x7863('0x14'));logger[_0x7863('0x15')](_0x7863('0x16'),_0x476aef,_0x7863('0x14'),JSON[_0x7863('0x17')](_0x476751));if(_0x476751[_0x7863('0x18')]){if(_0x476751['error'][_0x7863('0x19')]===0x1f4){logger['error'](_0x7863('0x13'),_0x476aef,_0x476751[_0x7863('0x18')][_0x7863('0x1a')]);return _0x6be2f1(_0x476751[_0x7863('0x18')][_0x7863('0x1a')]);}logger[_0x7863('0x18')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x476aef,_0x476751['error'][_0x7863('0x1a')]);return _0x10aca0(_0x476751[_0x7863('0x18')][_0x7863('0x1a')]);}else{logger['info']('UserVoiceQueueRt,\x20%s,\x20%s',_0x476aef,_0x7863('0x14'));_0x10aca0(_0x476751['result']['message']);}})['catch'](function(_0x2fbdec){logger[_0x7863('0x18')](_0x7863('0x13'),_0x476aef,_0x2fbdec);_0x6be2f1(_0x2fbdec);});});}exports[_0x7863('0x1b')]=function(_0x4304e7){var _0x53d4f4=this;return new Promise(function(_0x3e7244,_0x3e98f9){return db[_0x7863('0x1c')][_0x7863('0x1d')]({'raw':_0x4304e7[_0x7863('0x1e')]?_0x4304e7[_0x7863('0x1e')][_0x7863('0x1f')]===undefined?!![]:![]:!![],'where':_0x4304e7[_0x7863('0x1e')]?_0x4304e7['options']['where']||null:null,'attributes':[[db[_0x7863('0x20')]['fn'](_0x7863('0x21'),db[_0x7863('0x20')]['fn']('IF',db[_0x7863('0x20')]['literal'](_0x7863('0x22')))),_0x7863('0x23')]]})['then'](function(_0x1459c7){logger[_0x7863('0x12')]('GetVoiceQueueRtPauses',_0x4304e7);logger[_0x7863('0x15')](_0x7863('0x1b'),_0x4304e7,JSON[_0x7863('0x17')](_0x1459c7));_0x3e7244(_0x1459c7);})[_0x7863('0x24')](function(_0x4a9d92){logger[_0x7863('0x18')](_0x7863('0x1b'),_0x4a9d92[_0x7863('0x1a')],_0x4304e7);_0x3e98f9(_0x53d4f4[_0x7863('0x18')](0x1f4,_0x4a9d92[_0x7863('0x1a')]));});});};
\ No newline at end of file
+var _0x5086=['outboundQueuePauses','GetVoiceQueueRtPauses','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','socket.io-emitter','./userVoiceQueueRt.socket','register','then','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','UserVoiceQueueRt','findAll','options','raw','sequelize','COUNT','`paused`\x20=\x201,\x201,\x20null'];(function(_0x817d9b,_0x3c37e3){var _0x2752e1=function(_0x2b434e){while(--_0x2b434e){_0x817d9b['push'](_0x817d9b['shift']());}};_0x2752e1(++_0x3c37e3);}(_0x5086,0x6f));var _0x6508=function(_0x4e7d25,_0x58285f){_0x4e7d25=_0x4e7d25-0x0;var _0x526fe6=_0x5086[_0x4e7d25];return _0x526fe6;};'use strict';var _=require(_0x6508('0x0'));var util=require(_0x6508('0x1'));var moment=require(_0x6508('0x2'));var BPromise=require(_0x6508('0x3'));var rs=require(_0x6508('0x4'));var fs=require('fs');var Redis=require(_0x6508('0x5'));var db=require(_0x6508('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x6508('0x7'))(_0x6508('0x8'));var config=require(_0x6508('0x9'));var jayson=require(_0x6508('0xa'));var client=jayson[_0x6508('0xb')]['http']({'port':0x232a});config[_0x6508('0xc')]=_['defaults'](config[_0x6508('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x6508('0xd'))(new Redis(config[_0x6508('0xc')]));require(_0x6508('0xe'))[_0x6508('0xf')](socket);function respondWithRpcPromise(_0x3d9abe,_0x5612bf,_0x2a268c){return new BPromise(function(_0x4aa08d,_0x428e58){return client['request'](_0x3d9abe,_0x2a268c)[_0x6508('0x10')](function(_0x354ba7){logger['info'](_0x6508('0x11'),_0x5612bf,_0x6508('0x12'));logger[_0x6508('0x13')](_0x6508('0x14'),_0x5612bf,_0x6508('0x12'),JSON[_0x6508('0x15')](_0x354ba7));if(_0x354ba7[_0x6508('0x16')]){if(_0x354ba7[_0x6508('0x16')][_0x6508('0x17')]===0x1f4){logger['error'](_0x6508('0x11'),_0x5612bf,_0x354ba7[_0x6508('0x16')][_0x6508('0x18')]);return _0x428e58(_0x354ba7['error'][_0x6508('0x18')]);}logger['error'](_0x6508('0x11'),_0x5612bf,_0x354ba7[_0x6508('0x16')][_0x6508('0x18')]);return _0x4aa08d(_0x354ba7[_0x6508('0x16')][_0x6508('0x18')]);}else{logger[_0x6508('0x19')](_0x6508('0x11'),_0x5612bf,_0x6508('0x12'));_0x4aa08d(_0x354ba7['result'][_0x6508('0x18')]);}})['catch'](function(_0x4ff71a){logger[_0x6508('0x16')](_0x6508('0x11'),_0x5612bf,_0x4ff71a);_0x428e58(_0x4ff71a);});});}exports['GetVoiceQueueRtPauses']=function(_0x58e7ab){var _0x51dee1=this;return new Promise(function(_0x2c65d0,_0x70c179){return db[_0x6508('0x1a')][_0x6508('0x1b')]({'raw':_0x58e7ab[_0x6508('0x1c')]?_0x58e7ab['options'][_0x6508('0x1d')]===undefined?!![]:![]:!![],'where':_0x58e7ab[_0x6508('0x1c')]?_0x58e7ab['options']['where']||null:null,'attributes':[[db[_0x6508('0x1e')]['fn'](_0x6508('0x1f'),db[_0x6508('0x1e')]['fn']('IF',db[_0x6508('0x1e')]['literal'](_0x6508('0x20')))),_0x6508('0x21')]]})['then'](function(_0x254e2a){logger[_0x6508('0x19')](_0x6508('0x22'),_0x58e7ab);logger[_0x6508('0x13')]('GetVoiceQueueRtPauses',_0x58e7ab,JSON['stringify'](_0x254e2a));_0x2c65d0(_0x254e2a);})[_0x6508('0x23')](function(_0x3b47b9){logger[_0x6508('0x16')]('GetVoiceQueueRtPauses',_0x3b47b9[_0x6508('0x18')],_0x58e7ab);_0x70c179(_0x51dee1[_0x6508('0x16')](0x1f4,_0x3b47b9['message']));});});};
\ No newline at end of file
index a68a33c..40a0396 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5a5a=['emit','length','userVoiceQueueRt:','save','remove','update'];(function(_0xf7cb5f,_0x3e97cb){var _0x906947=function(_0x7ef4e5){while(--_0x7ef4e5){_0xf7cb5f['push'](_0xf7cb5f['shift']());}};_0x906947(++_0x3e97cb);}(_0x5a5a,0x1d1));var _0xa5a5=function(_0x5ab556,_0x5216da){_0x5ab556=_0x5ab556-0x0;var _0x54765b=_0x5a5a[_0x5ab556];return _0x54765b;};'use strict';var UserVoiceQueueRtEvents=require('./userVoiceQueueRt.events');var events=[_0xa5a5('0x0'),_0xa5a5('0x1'),_0xa5a5('0x2')];function createListener(_0x2552b1,_0x42cf19){return function(_0x50c2ad){_0x42cf19[_0xa5a5('0x3')](_0x2552b1,_0x50c2ad);};}function removeListener(_0x3307f1,_0x1fd3f0){return function(){UserVoiceQueueRtEvents['removeListener'](_0x3307f1,_0x1fd3f0);};}exports['register']=function(_0x43943d){for(var _0x1fe96d=0x0,_0x5691f1=events[_0xa5a5('0x4')];_0x1fe96d<_0x5691f1;_0x1fe96d++){var _0xf2ea20=events[_0x1fe96d];var _0x1234c2=createListener(_0xa5a5('0x5')+_0xf2ea20,_0x43943d);UserVoiceQueueRtEvents['on'](_0xf2ea20,_0x1234c2);}};
\ No newline at end of file
+var _0x88b0=['removeListener','register','length','userVoiceQueueRt:','./userVoiceQueueRt.events','save','emit'];(function(_0x50aec5,_0x12464c){var _0x3b86c4=function(_0x4d457b){while(--_0x4d457b){_0x50aec5['push'](_0x50aec5['shift']());}};_0x3b86c4(++_0x12464c);}(_0x88b0,0x1cb));var _0x088b=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x88b0[_0x501510];return _0x1e6ee5;};'use strict';var UserVoiceQueueRtEvents=require(_0x088b('0x0'));var events=[_0x088b('0x1'),'remove','update'];function createListener(_0x3f8d4a,_0x1ead50){return function(_0x28a565){_0x1ead50[_0x088b('0x2')](_0x3f8d4a,_0x28a565);};}function removeListener(_0x49e80b,_0x211dfb){return function(){UserVoiceQueueRtEvents[_0x088b('0x3')](_0x49e80b,_0x211dfb);};}exports[_0x088b('0x4')]=function(_0x5af8a4){for(var _0x4a9986=0x0,_0xfd98a3=events[_0x088b('0x5')];_0x4a9986<_0xfd98a3;_0x4a9986++){var _0x18fa42=events[_0x4a9986];var _0x2164cb=createListener(_0x088b('0x6')+_0x18fa42,_0x5af8a4);UserVoiceQueueRtEvents['on'](_0x18fa42,_0x2164cb);}};
\ No newline at end of file
index cc5dc15..830b90e 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(_0x4ff3f9,_0x202232){var _0x54fe66=function(_0x10ea57){while(--_0x10ea57){_0x4ff3f9['push'](_0x4ff3f9['shift']());}};_0x54fe66(++_0x202232);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router;
\ No newline at end of file
+var _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x1a5a87,_0x5b093b){var _0x20ed26=function(_0x29a5f5){while(--_0x29a5f5){_0x1a5a87['push'](_0x1a5a87['shift']());}};_0x20ed26(++_0x5b093b);}(_0xedd9,0xfc));var _0x9edd=function(_0x36ebf8,_0x6e8b8){_0x36ebf8=_0x36ebf8-0x0;var _0x2256f5=_0xedd9[_0x36ebf8];return _0x2256f5;};'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 336c815..ef33f7e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xea03=['sequelize','INTEGER'];(function(_0x5c1f4b,_0xebe785){var _0x508b67=function(_0x31c7c4){while(--_0x31c7c4){_0x5c1f4b['push'](_0x5c1f4b['shift']());}};_0x508b67(++_0xebe785);}(_0xea03,0x1ba));var _0x3ea0=function(_0x55f122,_0x56edaf){_0x55f122=_0x55f122-0x0;var _0x1a28d6=_0xea03[_0x55f122];return _0x1a28d6;};'use strict';var Sequelize=require(_0x3ea0('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x3ea0('0x1')],'defaultValue':0x0}};
\ No newline at end of file
+var _0xc9b9=['INTEGER'];(function(_0x5ebaf0,_0x230ca7){var _0x7a90a0=function(_0x31ec9f){while(--_0x31ec9f){_0x5ebaf0['push'](_0x5ebaf0['shift']());}};_0x7a90a0(++_0x230ca7);}(_0xc9b9,0x18f));var _0x9c9b=function(_0x3932eb,_0x43b210){_0x3932eb=_0x3932eb-0x0;var _0x5316e5=_0xc9b9[_0x3932eb];return _0x5316e5;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize[_0x9c9b('0x0')],'defaultValue':0x0}};
\ No newline at end of file
index 8553848..d56576b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfebd=['util','../../config/logger','api','moment','bluebird','path','../../config/environment','exports','define','UserWhatsappQueue','user_has_whatsapp_queues'];(function(_0x31b40c,_0x25ca52){var _0x751580=function(_0x1a33d4){while(--_0x1a33d4){_0x31b40c['push'](_0x31b40c['shift']());}};_0x751580(++_0x25ca52);}(_0xfebd,0x108));var _0xdfeb=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfebd[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xdfeb('0x0'));var logger=require(_0xdfeb('0x1'))(_0xdfeb('0x2'));var moment=require(_0xdfeb('0x3'));var BPromise=require(_0xdfeb('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdfeb('0x5'));var rimraf=require('rimraf');var config=require(_0xdfeb('0x6'));var attributes=require('./userWhatsappQueue.attributes');module[_0xdfeb('0x7')]=function(_0x551c4d,_0x49c92d){return _0x551c4d[_0xdfeb('0x8')](_0xdfeb('0x9'),attributes,{'tableName':_0xdfeb('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc72c=['user_has_whatsapp_queues','lodash','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./userWhatsappQueue.attributes','UserWhatsappQueue'];(function(_0x4b8da2,_0x5c97ca){var _0x16b62b=function(_0x573a0e){while(--_0x573a0e){_0x4b8da2['push'](_0x4b8da2['shift']());}};_0x16b62b(++_0x5c97ca);}(_0xc72c,0x119));var _0xcc72=function(_0x36c5b0,_0x5001da){_0x36c5b0=_0x36c5b0-0x0;var _0xf19333=_0xc72c[_0x36c5b0];return _0xf19333;};'use strict';var _=require(_0xcc72('0x0'));var util=require('util');var logger=require(_0xcc72('0x1'))(_0xcc72('0x2'));var moment=require(_0xcc72('0x3'));var BPromise=require('bluebird');var rp=require(_0xcc72('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcc72('0x5'));var config=require(_0xcc72('0x6'));var attributes=require(_0xcc72('0x7'));module['exports']=function(_0x2cc65c,_0x31ad4b){return _0x2cc65c['define'](_0xcc72('0x8'),attributes,{'tableName':_0xcc72('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 3d34b43..c79f3bb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa8d8=['lodash','util','bluebird','randomstring','rpc','jayson/promise','http','request','then','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x3aa900,_0x1820f2){var _0x397a95=function(_0x254306){while(--_0x254306){_0x3aa900['push'](_0x3aa900['shift']());}};_0x397a95(++_0x1820f2);}(_0xa8d8,0x72));var _0x8a8d=function(_0x74ab89,_0x4595bf){_0x74ab89=_0x74ab89-0x0;var _0x51d309=_0xa8d8[_0x74ab89];return _0x51d309;};'use strict';var _=require(_0x8a8d('0x0'));var util=require(_0x8a8d('0x1'));var moment=require('moment');var BPromise=require(_0x8a8d('0x2'));var rs=require(_0x8a8d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x8a8d('0x4'));var config=require('../../config/environment');var jayson=require(_0x8a8d('0x5'));var client=jayson['client'][_0x8a8d('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x3d6e5b,_0x56ef14,_0x447bbd){return new BPromise(function(_0x3e25d2,_0x45a94f){return client[_0x8a8d('0x7')](_0x3d6e5b,_0x447bbd)[_0x8a8d('0x8')](function(_0x113878){logger[_0x8a8d('0x9')](_0x8a8d('0xa'),_0x56ef14,_0x8a8d('0xb'));logger[_0x8a8d('0xc')](_0x8a8d('0xd'),_0x56ef14,_0x8a8d('0xb'),JSON[_0x8a8d('0xe')](_0x113878));if(_0x113878[_0x8a8d('0xf')]){if(_0x113878['error'][_0x8a8d('0x10')]===0x1f4){logger[_0x8a8d('0xf')](_0x8a8d('0xa'),_0x56ef14,_0x113878['error'][_0x8a8d('0x11')]);return _0x45a94f(_0x113878[_0x8a8d('0xf')][_0x8a8d('0x11')]);}logger[_0x8a8d('0xf')](_0x8a8d('0xa'),_0x56ef14,_0x113878[_0x8a8d('0xf')][_0x8a8d('0x11')]);return _0x3e25d2(_0x113878['error'][_0x8a8d('0x11')]);}else{logger[_0x8a8d('0x9')](_0x8a8d('0xa'),_0x56ef14,'request\x20sent');_0x3e25d2(_0x113878[_0x8a8d('0x12')][_0x8a8d('0x11')]);}})['catch'](function(_0x2c02ae){logger[_0x8a8d('0xf')](_0x8a8d('0xa'),_0x56ef14,_0x2c02ae);_0x45a94f(_0x2c02ae);});});}
\ No newline at end of file
+var _0x4183=['info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client','request','then'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4183,0xeb));var _0x3418=function(_0x2cd74c,_0x421a6b){_0x2cd74c=_0x2cd74c-0x0;var _0x1d0269=_0x4183[_0x2cd74c];return _0x1d0269;};'use strict';var _=require(_0x3418('0x0'));var util=require(_0x3418('0x1'));var moment=require(_0x3418('0x2'));var BPromise=require(_0x3418('0x3'));var rs=require(_0x3418('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3418('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x3418('0x6'))(_0x3418('0x7'));var config=require('../../config/environment');var jayson=require(_0x3418('0x8'));var client=jayson[_0x3418('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4232b3,_0x4821a8,_0x2ff8ee){return new BPromise(function(_0x4e34b4,_0x4e6a80){return client[_0x3418('0xa')](_0x4232b3,_0x2ff8ee)[_0x3418('0xb')](function(_0x1df61a){logger[_0x3418('0xc')](_0x3418('0xd'),_0x4821a8,_0x3418('0xe'));logger[_0x3418('0xf')]('UserWhatsappQueue,\x20%s,\x20%s,\x20%s',_0x4821a8,'request\x20sent',JSON[_0x3418('0x10')](_0x1df61a));if(_0x1df61a[_0x3418('0x11')]){if(_0x1df61a[_0x3418('0x11')]['code']===0x1f4){logger[_0x3418('0x11')](_0x3418('0xd'),_0x4821a8,_0x1df61a[_0x3418('0x11')][_0x3418('0x12')]);return _0x4e6a80(_0x1df61a['error'][_0x3418('0x12')]);}logger[_0x3418('0x11')]('UserWhatsappQueue,\x20%s,\x20%s',_0x4821a8,_0x1df61a['error'][_0x3418('0x12')]);return _0x4e34b4(_0x1df61a[_0x3418('0x11')]['message']);}else{logger[_0x3418('0xc')](_0x3418('0xd'),_0x4821a8,_0x3418('0xe'));_0x4e34b4(_0x1df61a['result']['message']);}})['catch'](function(_0x85c439){logger[_0x3418('0x11')](_0x3418('0xd'),_0x4821a8,_0x85c439);_0x4e6a80(_0x85c439);});});}
\ No newline at end of file
index e10e922..309bfa7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbec5=['/:id','isAuthenticated','show','post','create','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./variable.controller','get','index'];(function(_0x33be9d,_0x41618e){var _0x4a9267=function(_0x4f0e70){while(--_0x4f0e70){_0x33be9d['push'](_0x33be9d['shift']());}};_0x4a9267(++_0x41618e);}(_0xbec5,0xe5));var _0x5bec=function(_0xf84870,_0x4dc38f){_0xf84870=_0xf84870-0x0;var _0x4541a4=_0xbec5[_0xf84870];return _0x4541a4;};'use strict';var multer=require(_0x5bec('0x0'));var util=require(_0x5bec('0x1'));var path=require('path');var timeout=require(_0x5bec('0x2'));var express=require(_0x5bec('0x3'));var router=express[_0x5bec('0x4')]();var fs_extra=require(_0x5bec('0x5'));var auth=require(_0x5bec('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x5bec('0x7'));var controller=require(_0x5bec('0x8'));router[_0x5bec('0x9')]('/',auth['isAuthenticated'](),controller[_0x5bec('0xa')]);router[_0x5bec('0x9')](_0x5bec('0xb'),auth[_0x5bec('0xc')](),controller[_0x5bec('0xd')]);router[_0x5bec('0xe')]('/',auth[_0x5bec('0xc')](),controller[_0x5bec('0xf')]);router['put'](_0x5bec('0xb'),auth['isAuthenticated'](),controller[_0x5bec('0x10')]);router[_0x5bec('0x11')](_0x5bec('0xb'),auth['isAuthenticated'](),controller[_0x5bec('0x12')]);module[_0x5bec('0x13')]=router;
\ No newline at end of file
+var _0xad53=['post','create','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./variable.controller','get','isAuthenticated','index','show'];(function(_0x236b13,_0xd848df){var _0x4def23=function(_0x804f56){while(--_0x804f56){_0x236b13['push'](_0x236b13['shift']());}};_0x4def23(++_0xd848df);}(_0xad53,0x1ea));var _0x3ad5=function(_0x413906,_0x3c7066){_0x413906=_0x413906-0x0;var _0x19d510=_0xad53[_0x413906];return _0x19d510;};'use strict';var multer=require(_0x3ad5('0x0'));var util=require(_0x3ad5('0x1'));var path=require(_0x3ad5('0x2'));var timeout=require(_0x3ad5('0x3'));var express=require(_0x3ad5('0x4'));var router=express[_0x3ad5('0x5')]();var fs_extra=require(_0x3ad5('0x6'));var auth=require(_0x3ad5('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x3ad5('0x8'));var controller=require(_0x3ad5('0x9'));router[_0x3ad5('0xa')]('/',auth[_0x3ad5('0xb')](),controller[_0x3ad5('0xc')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x3ad5('0xd')]);router[_0x3ad5('0xe')]('/',auth[_0x3ad5('0xb')](),controller[_0x3ad5('0xf')]);router[_0x3ad5('0x10')](_0x3ad5('0x11'),auth[_0x3ad5('0xb')](),controller[_0x3ad5('0x12')]);router['delete'](_0x3ad5('0x11'),auth[_0x3ad5('0xb')](),controller[_0x3ad5('0x13')]);module[_0x3ad5('0x14')]=router;
\ No newline at end of file
index 65dbe38..37f879b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x02ca=['exports','STRING','name','sequelize'];(function(_0x382913,_0x326a06){var _0x3aa9d7=function(_0xcb23ee){while(--_0xcb23ee){_0x382913['push'](_0x382913['shift']());}};_0x3aa9d7(++_0x326a06);}(_0x02ca,0xdf));var _0xa02c=function(_0x262d9b,_0x7ad509){_0x262d9b=_0x262d9b-0x0;var _0x162ea2=_0x02ca[_0x262d9b];return _0x162ea2;};'use strict';var Sequelize=require(_0xa02c('0x0'));module[_0xa02c('0x1')]={'name':{'type':Sequelize[_0xa02c('0x2')],'unique':_0xa02c('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xa02c('0x2')]}};
\ No newline at end of file
+var _0x1500=['STRING','exports'];(function(_0x145f74,_0x346ce8){var _0x13ec90=function(_0x3bbd81){while(--_0x3bbd81){_0x145f74['push'](_0x145f74['shift']());}};_0x13ec90(++_0x346ce8);}(_0x1500,0x191));var _0x0150=function(_0x57a949,_0x8844d9){_0x57a949=_0x57a949-0x0;var _0x2c4d35=_0x1500[_0x57a949];return _0x2c4d35;};'use strict';var Sequelize=require('sequelize');module[_0x0150('0x0')]={'name':{'type':Sequelize[_0x0150('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x0150('0x1')]}};
\ No newline at end of file
index 48af150..25326e4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xae5a=['Content-Range','apply','reject','update','then','destroy','get','Variables','UserProfileResource','error','stack','name','index','Variable','type','query','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','map','options','includeAll','findAll','rows','catch','show','params','keys','rawAttributes','length','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','squel','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','status','end','json','undefined','count','offset','set'];(function(_0x5be365,_0x26187f){var _0x237c7a=function(_0x49b276){while(--_0x49b276){_0x5be365['push'](_0x5be365['shift']());}};_0x237c7a(++_0x26187f);}(_0xae5a,0x11a));var _0xaae5=function(_0x379bf9,_0x42ba3a){_0x379bf9=_0x379bf9-0x0;var _0x5bdb27=_0xae5a[_0x379bf9];return _0x5bdb27;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xaae5('0x0'));var zipdir=require(_0xaae5('0x1'));var jsonpatch=require(_0xaae5('0x2'));var rp=require(_0xaae5('0x3'));var moment=require(_0xaae5('0x4'));var BPromise=require(_0xaae5('0x5'));var Mustache=require(_0xaae5('0x6'));var util=require(_0xaae5('0x7'));var path=require(_0xaae5('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xaae5('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xaae5('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xaae5('0xb'));var toCsv=require(_0xaae5('0xc'));var querystring=require('querystring');var Papa=require(_0xaae5('0xd'));var Redis=require('ioredis');var authService=require(_0xaae5('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xaae5('0xf'));var hardwareService=require(_0xaae5('0x10'));var logger=require(_0xaae5('0x11'))(_0xaae5('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xd531c6,_0x3690cc){_0x3690cc=_0x3690cc||0xcc;return function(_0x283766){if(_0x283766){return _0xd531c6['sendStatus'](_0x3690cc);}return _0xd531c6[_0xaae5('0x13')](_0x3690cc)[_0xaae5('0x14')]();};}function respondWithResult(_0x278d94,_0x7cc8f2){_0x7cc8f2=_0x7cc8f2||0xc8;return function(_0x8cb307){if(_0x8cb307){return _0x278d94[_0xaae5('0x13')](_0x7cc8f2)[_0xaae5('0x15')](_0x8cb307);}};}function respondWithFilteredResult(_0x17e824,_0x5614ab){return function(_0x466ffb){if(_0x466ffb){var _0x479085=typeof _0x5614ab['offset']==='undefined'&&typeof _0x5614ab['limit']===_0xaae5('0x16');var _0x237be1=_0x466ffb[_0xaae5('0x17')];var _0x30b743=_0x479085?0x0:_0x5614ab[_0xaae5('0x18')];var _0x2e74c3=_0x479085?_0x466ffb[_0xaae5('0x17')]:_0x5614ab['offset']+_0x5614ab['limit'];var _0x82301a;if(_0x2e74c3>=_0x237be1){_0x2e74c3=_0x237be1;_0x82301a=0xc8;}else{_0x82301a=0xce;}_0x17e824[_0xaae5('0x13')](_0x82301a);return _0x17e824[_0xaae5('0x19')](_0xaae5('0x1a'),_0x30b743+'-'+_0x2e74c3+'/'+_0x237be1)['json'](_0x466ffb);}return null;};}function patchUpdates(_0x59d406){return function(_0x5f054d){try{jsonpatch[_0xaae5('0x1b')](_0x5f054d,_0x59d406,!![]);}catch(_0x2ef645){return BPromise[_0xaae5('0x1c')](_0x2ef645);}return _0x5f054d['save']();};}function saveUpdates(_0x21c2e0,_0x250a03){return function(_0x37763c){if(_0x37763c){return _0x37763c[_0xaae5('0x1d')](_0x21c2e0)[_0xaae5('0x1e')](function(_0x489207){return _0x489207;});}return null;};}function removeEntity(_0x544f3e,_0x3eb037){return function(_0x5f50c4){if(_0x5f50c4){return _0x5f50c4[_0xaae5('0x1f')]()['then'](function(){var _0x561d9d=_0x5f50c4[_0xaae5('0x20')]({'plain':!![]});var _0x247f1e=_0xaae5('0x21');return db[_0xaae5('0x22')][_0xaae5('0x1f')]({'where':{'type':_0x247f1e,'resourceId':_0x561d9d['id']}})[_0xaae5('0x1e')](function(){return _0x5f50c4;});})[_0xaae5('0x1e')](function(){_0x544f3e[_0xaae5('0x13')](0xcc)[_0xaae5('0x14')]();});}};}function handleEntityNotFound(_0x508c4e,_0x2e3813){return function(_0x225fde){if(!_0x225fde){_0x508c4e['sendStatus'](0x194);}return _0x225fde;};}function handleError(_0x379efe,_0x5172f2){_0x5172f2=_0x5172f2||0x1f4;return function(_0x4441bb){logger[_0xaae5('0x23')](_0x4441bb[_0xaae5('0x24')]);if(_0x4441bb[_0xaae5('0x25')]){delete _0x4441bb[_0xaae5('0x25')];}_0x379efe['status'](_0x5172f2)['send'](_0x4441bb);};}exports[_0xaae5('0x26')]=function(_0x482d0a,_0x3404f7){var _0x1e6077={},_0x58989b={},_0x303f5a={'count':0x0,'rows':[]};var _0x567f91=_['map'](db[_0xaae5('0x27')]['rawAttributes'],function(_0x42890e){return{'name':_0x42890e['fieldName'],'type':_0x42890e[_0xaae5('0x28')]['key']};});_0x58989b['model']=_['map'](_0x567f91,_0xaae5('0x25'));_0x58989b[_0xaae5('0x29')]=_['keys'](_0x482d0a['query']);_0x58989b[_0xaae5('0x2a')]=_[_0xaae5('0x2b')](_0x58989b[_0xaae5('0x2c')],_0x58989b['query']);_0x1e6077['attributes']=_['intersection'](_0x58989b[_0xaae5('0x2c')],qs[_0xaae5('0x2d')](_0x482d0a[_0xaae5('0x29')][_0xaae5('0x2d')]));_0x1e6077['attributes']=_0x1e6077[_0xaae5('0x2e')]['length']?_0x1e6077[_0xaae5('0x2e')]:_0x58989b[_0xaae5('0x2c')];if(!_0x482d0a[_0xaae5('0x29')][_0xaae5('0x2f')](_0xaae5('0x30'))){_0x1e6077[_0xaae5('0x31')]=qs[_0xaae5('0x31')](_0x482d0a[_0xaae5('0x29')][_0xaae5('0x31')]);_0x1e6077[_0xaae5('0x18')]=qs[_0xaae5('0x18')](_0x482d0a[_0xaae5('0x29')][_0xaae5('0x18')]);}_0x1e6077[_0xaae5('0x32')]=qs['sort'](_0x482d0a['query'][_0xaae5('0x33')]);_0x1e6077[_0xaae5('0x34')]=qs[_0xaae5('0x2a')](_[_0xaae5('0x35')](_0x482d0a[_0xaae5('0x29')],_0x58989b[_0xaae5('0x2a')]),_0x567f91);if(_0x482d0a[_0xaae5('0x29')][_0xaae5('0x36')]){_0x1e6077['where']=_[_0xaae5('0x37')](_0x1e6077[_0xaae5('0x34')],{'$or':_[_0xaae5('0x38')](_0x567f91,function(_0x287ca8){if(_0x287ca8[_0xaae5('0x28')]!=='VIRTUAL'){var _0x1c435d={};_0x1c435d[_0x287ca8[_0xaae5('0x25')]]={'$like':'%'+_0x482d0a[_0xaae5('0x29')]['filter']+'%'};return _0x1c435d;}})});}_0x1e6077=_['merge']({},_0x1e6077,_0x482d0a[_0xaae5('0x39')]);var _0x1e8103={'where':_0x1e6077[_0xaae5('0x34')]};return db['Variable'][_0xaae5('0x17')](_0x1e8103)['then'](function(_0x503b65){_0x303f5a[_0xaae5('0x17')]=_0x503b65;if(_0x482d0a[_0xaae5('0x29')][_0xaae5('0x3a')]){_0x1e6077['include']=[{'all':!![]}];}return db[_0xaae5('0x27')][_0xaae5('0x3b')](_0x1e6077);})[_0xaae5('0x1e')](function(_0x2e7560){_0x303f5a[_0xaae5('0x3c')]=_0x2e7560;return _0x303f5a;})[_0xaae5('0x1e')](respondWithFilteredResult(_0x3404f7,_0x1e6077))[_0xaae5('0x3d')](handleError(_0x3404f7,null));};exports[_0xaae5('0x3e')]=function(_0x48ce57,_0x36c213){var _0x147151={'raw':!![],'where':{'id':_0x48ce57[_0xaae5('0x3f')]['id']}},_0x5e44d4={};_0x5e44d4['model']=_[_0xaae5('0x40')](db[_0xaae5('0x27')][_0xaae5('0x41')]);_0x5e44d4[_0xaae5('0x29')]=_[_0xaae5('0x40')](_0x48ce57[_0xaae5('0x29')]);_0x5e44d4[_0xaae5('0x2a')]=_[_0xaae5('0x2b')](_0x5e44d4[_0xaae5('0x2c')],_0x5e44d4[_0xaae5('0x29')]);_0x147151[_0xaae5('0x2e')]=_[_0xaae5('0x2b')](_0x5e44d4[_0xaae5('0x2c')],qs[_0xaae5('0x2d')](_0x48ce57[_0xaae5('0x29')][_0xaae5('0x2d')]));_0x147151['attributes']=_0x147151[_0xaae5('0x2e')][_0xaae5('0x42')]?_0x147151[_0xaae5('0x2e')]:_0x5e44d4[_0xaae5('0x2c')];if(_0x48ce57[_0xaae5('0x29')][_0xaae5('0x3a')]){_0x147151[_0xaae5('0x43')]=[{'all':!![]}];}_0x147151=_[_0xaae5('0x37')]({},_0x147151,_0x48ce57[_0xaae5('0x39')]);return db[_0xaae5('0x27')]['find'](_0x147151)[_0xaae5('0x1e')](handleEntityNotFound(_0x36c213,null))['then'](respondWithResult(_0x36c213,null))[_0xaae5('0x3d')](handleError(_0x36c213,null));};exports[_0xaae5('0x44')]=function(_0x53bcfe,_0x3fd53e){return db[_0xaae5('0x27')][_0xaae5('0x44')](_0x53bcfe[_0xaae5('0x45')],{})[_0xaae5('0x1e')](function(_0x5055ca){var _0xd9d58a=_0x53bcfe[_0xaae5('0x46')][_0xaae5('0x20')]({'plain':!![]});if(!_0xd9d58a)throw new Error(_0xaae5('0x47'));if(_0xd9d58a['role']===_0xaae5('0x46')){var _0x57cc60=_0x5055ca['get']({'plain':!![]});var _0x125f74=_0xaae5('0x21');return db[_0xaae5('0x48')][_0xaae5('0x49')]({'where':{'name':_0x125f74,'userProfileId':_0xd9d58a[_0xaae5('0x4a')]},'raw':!![]})['then'](function(_0x3138b5){if(_0x3138b5&&_0x3138b5[_0xaae5('0x4b')]===0x0){return db[_0xaae5('0x22')][_0xaae5('0x44')]({'name':_0x57cc60[_0xaae5('0x25')],'resourceId':_0x57cc60['id'],'type':_0x3138b5[_0xaae5('0x25')],'sectionId':_0x3138b5['id']},{})[_0xaae5('0x1e')](function(){return _0x5055ca;});}else{return _0x5055ca;}})['catch'](function(_0x47d1e){logger[_0xaae5('0x23')](_0xaae5('0x4c'),_0x47d1e);throw _0x47d1e;});}return _0x5055ca;})['then'](respondWithResult(_0x3fd53e,0xc9))[_0xaae5('0x3d')](handleError(_0x3fd53e,null));};exports[_0xaae5('0x1d')]=function(_0x22c3da,_0xefd721){if(_0x22c3da[_0xaae5('0x45')]['id']){delete _0x22c3da[_0xaae5('0x45')]['id'];}return db[_0xaae5('0x27')][_0xaae5('0x49')]({'where':{'id':_0x22c3da[_0xaae5('0x3f')]['id']}})[_0xaae5('0x1e')](handleEntityNotFound(_0xefd721,null))[_0xaae5('0x1e')](saveUpdates(_0x22c3da[_0xaae5('0x45')],null))['then'](respondWithResult(_0xefd721,null))['catch'](handleError(_0xefd721,null));};exports[_0xaae5('0x1f')]=function(_0x4c5638,_0x22d545){return db[_0xaae5('0x27')][_0xaae5('0x49')]({'where':{'id':_0x4c5638[_0xaae5('0x3f')]['id']}})[_0xaae5('0x1e')](handleEntityNotFound(_0x22d545,null))[_0xaae5('0x1e')](removeEntity(_0x22d545,null))[_0xaae5('0x3d')](handleError(_0x22d545,null));};
\ No newline at end of file
+var _0xb20a=['send','index','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','Variable','includeAll','findAll','rows','show','params','rawAttributes','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','rimraf','zip-dir','fast-json-patch','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','set','apply','reject','update','destroy','then','Variables','error','stack','name'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0xb20a,0x1ce));var _0xab20=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xb20a[_0x2c91e9];return _0x13f0ff;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xab20('0x0'));var zipdir=require(_0xab20('0x1'));var jsonpatch=require(_0xab20('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xab20('0x3'));var util=require(_0xab20('0x4'));var path=require(_0xab20('0x5'));var sox=require(_0xab20('0x6'));var csv=require(_0xab20('0x7'));var ejs=require(_0xab20('0x8'));var fs=require('fs');var fs_extra=require(_0xab20('0x9'));var _=require('lodash');var squel=require(_0xab20('0xa'));var crypto=require(_0xab20('0xb'));var jsforce=require(_0xab20('0xc'));var deskjs=require(_0xab20('0xd'));var toCsv=require(_0xab20('0x7'));var querystring=require(_0xab20('0xe'));var Papa=require(_0xab20('0xf'));var Redis=require(_0xab20('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xab20('0x11'));var hardwareService=require(_0xab20('0x12'));var logger=require(_0xab20('0x13'))('api');var utils=require(_0xab20('0x14'));var config=require(_0xab20('0x15'));var licenseUtil=require(_0xab20('0x16'));var db=require(_0xab20('0x17'))['db'];function respondWithStatusCode(_0x32d1cf,_0x479b47){_0x479b47=_0x479b47||0xcc;return function(_0x570252){if(_0x570252){return _0x32d1cf[_0xab20('0x18')](_0x479b47);}return _0x32d1cf['status'](_0x479b47)[_0xab20('0x19')]();};}function respondWithResult(_0x10aced,_0x2af82e){_0x2af82e=_0x2af82e||0xc8;return function(_0x31ccdb){if(_0x31ccdb){return _0x10aced[_0xab20('0x1a')](_0x2af82e)[_0xab20('0x1b')](_0x31ccdb);}};}function respondWithFilteredResult(_0x54a391,_0x3c5cd5){return function(_0x3007b3){if(_0x3007b3){var _0x4f7ddb=typeof _0x3c5cd5[_0xab20('0x1c')]==='undefined'&&typeof _0x3c5cd5[_0xab20('0x1d')]===_0xab20('0x1e');var _0xb2bd9=_0x3007b3[_0xab20('0x1f')];var _0x4a0617=_0x4f7ddb?0x0:_0x3c5cd5[_0xab20('0x1c')];var _0x847163=_0x4f7ddb?_0x3007b3[_0xab20('0x1f')]:_0x3c5cd5[_0xab20('0x1c')]+_0x3c5cd5[_0xab20('0x1d')];var _0x1867fb;if(_0x847163>=_0xb2bd9){_0x847163=_0xb2bd9;_0x1867fb=0xc8;}else{_0x1867fb=0xce;}_0x54a391[_0xab20('0x1a')](_0x1867fb);return _0x54a391[_0xab20('0x20')]('Content-Range',_0x4a0617+'-'+_0x847163+'/'+_0xb2bd9)[_0xab20('0x1b')](_0x3007b3);}return null;};}function patchUpdates(_0x5e1428){return function(_0x31331b){try{jsonpatch[_0xab20('0x21')](_0x31331b,_0x5e1428,!![]);}catch(_0x3876a7){return BPromise[_0xab20('0x22')](_0x3876a7);}return _0x31331b['save']();};}function saveUpdates(_0x47f05d,_0x366a59){return function(_0x7390ce){if(_0x7390ce){return _0x7390ce[_0xab20('0x23')](_0x47f05d)['then'](function(_0x297c86){return _0x297c86;});}return null;};}function removeEntity(_0x2c51af,_0x57562e){return function(_0x25eade){if(_0x25eade){return _0x25eade[_0xab20('0x24')]()[_0xab20('0x25')](function(){var _0x437068=_0x25eade['get']({'plain':!![]});var _0x40c3d5=_0xab20('0x26');return db['UserProfileResource'][_0xab20('0x24')]({'where':{'type':_0x40c3d5,'resourceId':_0x437068['id']}})[_0xab20('0x25')](function(){return _0x25eade;});})[_0xab20('0x25')](function(){_0x2c51af[_0xab20('0x1a')](0xcc)[_0xab20('0x19')]();});}};}function handleEntityNotFound(_0x5dcc6b,_0x4ec7e3){return function(_0x4af5a1){if(!_0x4af5a1){_0x5dcc6b[_0xab20('0x18')](0x194);}return _0x4af5a1;};}function handleError(_0x5de401,_0x449767){_0x449767=_0x449767||0x1f4;return function(_0x1d9cf0){logger[_0xab20('0x27')](_0x1d9cf0[_0xab20('0x28')]);if(_0x1d9cf0['name']){delete _0x1d9cf0[_0xab20('0x29')];}_0x5de401['status'](_0x449767)[_0xab20('0x2a')](_0x1d9cf0);};}exports[_0xab20('0x2b')]=function(_0x2739b5,_0x558f99){var _0x27eee8={},_0x5eb961={},_0x4147df={'count':0x0,'rows':[]};var _0x453db3=_[_0xab20('0x2c')](db['Variable']['rawAttributes'],function(_0x236ec1){return{'name':_0x236ec1[_0xab20('0x2d')],'type':_0x236ec1[_0xab20('0x2e')][_0xab20('0x2f')]};});_0x5eb961[_0xab20('0x30')]=_['map'](_0x453db3,'name');_0x5eb961[_0xab20('0x31')]=_[_0xab20('0x32')](_0x2739b5[_0xab20('0x31')]);_0x5eb961[_0xab20('0x33')]=_[_0xab20('0x34')](_0x5eb961[_0xab20('0x30')],_0x5eb961[_0xab20('0x31')]);_0x27eee8[_0xab20('0x35')]=_[_0xab20('0x34')](_0x5eb961[_0xab20('0x30')],qs['fields'](_0x2739b5['query'][_0xab20('0x36')]));_0x27eee8[_0xab20('0x35')]=_0x27eee8['attributes'][_0xab20('0x37')]?_0x27eee8[_0xab20('0x35')]:_0x5eb961['model'];if(!_0x2739b5[_0xab20('0x31')][_0xab20('0x38')](_0xab20('0x39'))){_0x27eee8['limit']=qs[_0xab20('0x1d')](_0x2739b5[_0xab20('0x31')]['limit']);_0x27eee8[_0xab20('0x1c')]=qs[_0xab20('0x1c')](_0x2739b5[_0xab20('0x31')]['offset']);}_0x27eee8[_0xab20('0x3a')]=qs[_0xab20('0x3b')](_0x2739b5['query'][_0xab20('0x3b')]);_0x27eee8['where']=qs[_0xab20('0x33')](_['pick'](_0x2739b5['query'],_0x5eb961[_0xab20('0x33')]),_0x453db3);if(_0x2739b5[_0xab20('0x31')][_0xab20('0x3c')]){_0x27eee8[_0xab20('0x3d')]=_[_0xab20('0x3e')](_0x27eee8[_0xab20('0x3d')],{'$or':_[_0xab20('0x2c')](_0x453db3,function(_0x18c47b){if(_0x18c47b[_0xab20('0x2e')]!==_0xab20('0x3f')){var _0x3ad4a6={};_0x3ad4a6[_0x18c47b['name']]={'$like':'%'+_0x2739b5[_0xab20('0x31')]['filter']+'%'};return _0x3ad4a6;}})});}_0x27eee8=_[_0xab20('0x3e')]({},_0x27eee8,_0x2739b5[_0xab20('0x40')]);var _0x1276d8={'where':_0x27eee8[_0xab20('0x3d')]};return db[_0xab20('0x41')]['count'](_0x1276d8)['then'](function(_0x1359dc){_0x4147df[_0xab20('0x1f')]=_0x1359dc;if(_0x2739b5[_0xab20('0x31')][_0xab20('0x42')]){_0x27eee8['include']=[{'all':!![]}];}return db[_0xab20('0x41')][_0xab20('0x43')](_0x27eee8);})[_0xab20('0x25')](function(_0xf78fa0){_0x4147df[_0xab20('0x44')]=_0xf78fa0;return _0x4147df;})[_0xab20('0x25')](respondWithFilteredResult(_0x558f99,_0x27eee8))['catch'](handleError(_0x558f99,null));};exports[_0xab20('0x45')]=function(_0x4a9547,_0x535cec){var _0x3ad564={'raw':!![],'where':{'id':_0x4a9547[_0xab20('0x46')]['id']}},_0xbb8c4a={};_0xbb8c4a['model']=_[_0xab20('0x32')](db[_0xab20('0x41')][_0xab20('0x47')]);_0xbb8c4a[_0xab20('0x31')]=_[_0xab20('0x32')](_0x4a9547[_0xab20('0x31')]);_0xbb8c4a[_0xab20('0x33')]=_[_0xab20('0x34')](_0xbb8c4a[_0xab20('0x30')],_0xbb8c4a[_0xab20('0x31')]);_0x3ad564[_0xab20('0x35')]=_['intersection'](_0xbb8c4a['model'],qs[_0xab20('0x36')](_0x4a9547['query'][_0xab20('0x36')]));_0x3ad564['attributes']=_0x3ad564[_0xab20('0x35')][_0xab20('0x37')]?_0x3ad564[_0xab20('0x35')]:_0xbb8c4a[_0xab20('0x30')];if(_0x4a9547['query'][_0xab20('0x42')]){_0x3ad564['include']=[{'all':!![]}];}_0x3ad564=_[_0xab20('0x3e')]({},_0x3ad564,_0x4a9547[_0xab20('0x40')]);return db[_0xab20('0x41')]['find'](_0x3ad564)[_0xab20('0x25')](handleEntityNotFound(_0x535cec,null))['then'](respondWithResult(_0x535cec,null))['catch'](handleError(_0x535cec,null));};exports[_0xab20('0x48')]=function(_0x4915ee,_0x4cd62c){return db[_0xab20('0x41')][_0xab20('0x48')](_0x4915ee[_0xab20('0x49')],{})[_0xab20('0x25')](function(_0x3cfbd2){var _0x5d0736=_0x4915ee[_0xab20('0x4a')][_0xab20('0x4b')]({'plain':!![]});if(!_0x5d0736)throw new Error(_0xab20('0x4c'));if(_0x5d0736[_0xab20('0x4d')]===_0xab20('0x4a')){var _0x334c34=_0x3cfbd2[_0xab20('0x4b')]({'plain':!![]});var _0x1ec4f1='Variables';return db[_0xab20('0x4e')][_0xab20('0x4f')]({'where':{'name':_0x1ec4f1,'userProfileId':_0x5d0736['userProfileId']},'raw':!![]})[_0xab20('0x25')](function(_0x30aa5b){if(_0x30aa5b&&_0x30aa5b[_0xab20('0x50')]===0x0){return db[_0xab20('0x51')][_0xab20('0x48')]({'name':_0x334c34['name'],'resourceId':_0x334c34['id'],'type':_0x30aa5b[_0xab20('0x29')],'sectionId':_0x30aa5b['id']},{})[_0xab20('0x25')](function(){return _0x3cfbd2;});}else{return _0x3cfbd2;}})['catch'](function(_0x51db99){logger['error'](_0xab20('0x52'),_0x51db99);throw _0x51db99;});}return _0x3cfbd2;})[_0xab20('0x25')](respondWithResult(_0x4cd62c,0xc9))['catch'](handleError(_0x4cd62c,null));};exports['update']=function(_0x442f29,_0x2d8842){if(_0x442f29[_0xab20('0x49')]['id']){delete _0x442f29[_0xab20('0x49')]['id'];}return db['Variable'][_0xab20('0x4f')]({'where':{'id':_0x442f29[_0xab20('0x46')]['id']}})[_0xab20('0x25')](handleEntityNotFound(_0x2d8842,null))[_0xab20('0x25')](saveUpdates(_0x442f29['body'],null))[_0xab20('0x25')](respondWithResult(_0x2d8842,null))[_0xab20('0x53')](handleError(_0x2d8842,null));};exports['destroy']=function(_0x1835ca,_0x58aaf1){return db[_0xab20('0x41')][_0xab20('0x4f')]({'where':{'id':_0x1835ca[_0xab20('0x46')]['id']}})[_0xab20('0x25')](handleEntityNotFound(_0x58aaf1,null))[_0xab20('0x25')](removeEntity(_0x58aaf1,null))[_0xab20('0x53')](handleError(_0x58aaf1,null));};
\ No newline at end of file
index 5c0f613..4f84c36 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8925=['exports','define','Variable','tools_variables','lodash','util','api','moment','bluebird','request-promise','rimraf'];(function(_0x4a8237,_0x3d2ec0){var _0x3e4858=function(_0x2e22a0){while(--_0x2e22a0){_0x4a8237['push'](_0x4a8237['shift']());}};_0x3e4858(++_0x3d2ec0);}(_0x8925,0x122));var _0x5892=function(_0x2484e6,_0x2cbe6c){_0x2484e6=_0x2484e6-0x0;var _0x20efaf=_0x8925[_0x2484e6];return _0x20efaf;};'use strict';var _=require(_0x5892('0x0'));var util=require(_0x5892('0x1'));var logger=require('../../config/logger')(_0x5892('0x2'));var moment=require(_0x5892('0x3'));var BPromise=require(_0x5892('0x4'));var rp=require(_0x5892('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5892('0x6'));var config=require('../../config/environment');var attributes=require('./variable.attributes');module[_0x5892('0x7')]=function(_0x177eb7,_0x411adb){return _0x177eb7[_0x5892('0x8')](_0x5892('0x9'),attributes,{'tableName':_0x5892('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x527d=['exports','define','tools_variables','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./variable.attributes'];(function(_0xd7b0a4,_0x53c7d3){var _0x184e9e=function(_0x325bbd){while(--_0x325bbd){_0xd7b0a4['push'](_0xd7b0a4['shift']());}};_0x184e9e(++_0x53c7d3);}(_0x527d,0x93));var _0xd527=function(_0x3305de,_0x16582f){_0x3305de=_0x3305de-0x0;var _0x3b5a84=_0x527d[_0x3305de];return _0x3b5a84;};'use strict';var _=require(_0xd527('0x0'));var util=require(_0xd527('0x1'));var logger=require(_0xd527('0x2'))('api');var moment=require(_0xd527('0x3'));var BPromise=require(_0xd527('0x4'));var rp=require(_0xd527('0x5'));var fs=require('fs');var path=require(_0xd527('0x6'));var rimraf=require(_0xd527('0x7'));var config=require('../../config/environment');var attributes=require(_0xd527('0x8'));module[_0xd527('0x9')]=function(_0xa034cc,_0x166529){return _0xa034cc[_0xd527('0xa')]('Variable',attributes,{'tableName':_0xd527('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index b39084f..ee7adde 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6aa7=['include','model','attributes','map','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','request','then','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowVariable','find','options','raw','where'];(function(_0x391adb,_0x3ab535){var _0x35edb5=function(_0x375065){while(--_0x375065){_0x391adb['push'](_0x391adb['shift']());}};_0x35edb5(++_0x3ab535);}(_0x6aa7,0x178));var _0x76aa=function(_0x2c3ed2,_0x46d8cc){_0x2c3ed2=_0x2c3ed2-0x0;var _0x1fd82b=_0x6aa7[_0x2c3ed2];return _0x1fd82b;};'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);});});}exports[_0x76aa('0x16')]=function(_0x21c16d){var _0xa1bc7=this;return new Promise(function(_0x3ead3f,_0x496902){return db['Variable'][_0x76aa('0x17')]({'raw':_0x21c16d[_0x76aa('0x18')]?_0x21c16d[_0x76aa('0x18')][_0x76aa('0x19')]===undefined?!![]:![]:!![],'where':_0x21c16d[_0x76aa('0x18')]?_0x21c16d[_0x76aa('0x18')][_0x76aa('0x1a')]||null:null,'attributes':_0x21c16d[_0x76aa('0x18')]?_0x21c16d[_0x76aa('0x18')]['attributes']||null:null,'include':_0x21c16d[_0x76aa('0x18')]?_0x21c16d[_0x76aa('0x18')][_0x76aa('0x1b')]?_['map'](_0x21c16d[_0x76aa('0x18')][_0x76aa('0x1b')],function(_0x31252f){return{'model':db[_0x31252f[_0x76aa('0x1c')]],'as':_0x31252f['as'],'attributes':_0x31252f[_0x76aa('0x1d')],'include':_0x31252f[_0x76aa('0x1b')]?_[_0x76aa('0x1e')](_0x31252f[_0x76aa('0x1b')],function(_0x32bf9f){return{'model':db[_0x32bf9f[_0x76aa('0x1c')]],'as':_0x32bf9f['as'],'attributes':_0x32bf9f[_0x76aa('0x1d')],'include':_0x32bf9f[_0x76aa('0x1b')]?_[_0x76aa('0x1e')](_0x32bf9f['include'],function(_0xb5e8a9){return{'model':db[_0xb5e8a9[_0x76aa('0x1c')]],'as':_0xb5e8a9['as'],'attributes':_0xb5e8a9[_0x76aa('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x76aa('0xa')](function(_0xa1e6){logger[_0x76aa('0xb')](_0x76aa('0x16'),_0x21c16d);logger[_0x76aa('0xe')](_0x76aa('0x16'),_0x21c16d,JSON[_0x76aa('0x10')](_0xa1e6));_0x3ead3f(_0xa1e6);})['catch'](function(_0x3fcb7f){logger['error'](_0x76aa('0x16'),_0x3fcb7f[_0x76aa('0x13')],_0x21c16d);_0x496902(_0xa1bc7[_0x76aa('0x11')](0x1f4,_0x3fcb7f[_0x76aa('0x13')]));});});};
\ No newline at end of file
+var _0x7217=['where','attributes','map','include','model','ShowVariable','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Variable,\x20%s,\x20%s','debug','Variable,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','Variable','find','options','raw'];(function(_0x2eb67e,_0x3a85be){var _0x1cee38=function(_0x355d06){while(--_0x355d06){_0x2eb67e['push'](_0x2eb67e['shift']());}};_0x1cee38(++_0x3a85be);}(_0x7217,0x19e));var _0x7721=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0x7217[_0x21aec3];return _0x288bbc;};'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')]('Variable,\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']('Variable,\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);});});}exports['ShowVariable']=function(_0x3fc09e){var _0x5cb0e6=this;return new Promise(function(_0xfec626,_0x4e96fb){return db[_0x7721('0x18')][_0x7721('0x19')]({'raw':_0x3fc09e[_0x7721('0x1a')]?_0x3fc09e[_0x7721('0x1a')][_0x7721('0x1b')]===undefined?!![]:![]:!![],'where':_0x3fc09e[_0x7721('0x1a')]?_0x3fc09e[_0x7721('0x1a')][_0x7721('0x1c')]||null:null,'attributes':_0x3fc09e['options']?_0x3fc09e[_0x7721('0x1a')][_0x7721('0x1d')]||null:null,'include':_0x3fc09e[_0x7721('0x1a')]?_0x3fc09e[_0x7721('0x1a')]['include']?_[_0x7721('0x1e')](_0x3fc09e['options'][_0x7721('0x1f')],function(_0x288e3a){return{'model':db[_0x288e3a[_0x7721('0x20')]],'as':_0x288e3a['as'],'attributes':_0x288e3a[_0x7721('0x1d')],'include':_0x288e3a[_0x7721('0x1f')]?_[_0x7721('0x1e')](_0x288e3a[_0x7721('0x1f')],function(_0x5b4d74){return{'model':db[_0x5b4d74[_0x7721('0x20')]],'as':_0x5b4d74['as'],'attributes':_0x5b4d74[_0x7721('0x1d')],'include':_0x5b4d74[_0x7721('0x1f')]?_[_0x7721('0x1e')](_0x5b4d74[_0x7721('0x1f')],function(_0x16355a){return{'model':db[_0x16355a[_0x7721('0x20')]],'as':_0x16355a['as'],'attributes':_0x16355a[_0x7721('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x7721('0xc')](function(_0x52316e){logger[_0x7721('0xd')]('ShowVariable',_0x3fc09e);logger['debug'](_0x7721('0x21'),_0x3fc09e,JSON[_0x7721('0x12')](_0x52316e));_0xfec626(_0x52316e);})[_0x7721('0x17')](function(_0x158d98){logger[_0x7721('0x13')](_0x7721('0x21'),_0x158d98[_0x7721('0x15')],_0x3fc09e);_0x4e96fb(_0x5cb0e6[_0x7721('0x13')](0x1f4,_0x158d98['message']));});});};
\ No newline at end of file
index 1c3b4a1..dc8240e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdc5b=['reset','/pull','canUpdate','pull','restart','migrations','exports','express','Router','../../components/auth/service','./version.controller','get','index','/fetch','isAuthenticated','fetch'];(function(_0x364760,_0x3f100a){var _0x201a4d=function(_0x43df11){while(--_0x43df11){_0x364760['push'](_0x364760['shift']());}};_0x201a4d(++_0x3f100a);}(_0xdc5b,0x107));var _0xbdc5=function(_0x3898e6,_0x43fc3c){_0x3898e6=_0x3898e6-0x0;var _0x1c5e50=_0xdc5b[_0x3898e6];return _0x1c5e50;};'use strict';var express=require(_0xbdc5('0x0'));var router=express[_0xbdc5('0x1')]();var auth=require(_0xbdc5('0x2'));var controller=require(_0xbdc5('0x3'));router[_0xbdc5('0x4')]('/',controller[_0xbdc5('0x5')]);router[_0xbdc5('0x4')](_0xbdc5('0x6'),auth[_0xbdc5('0x7')](),auth['canUpdate'](),controller[_0xbdc5('0x8')]);router['get']('/reset',auth['isAuthenticated'](),auth['canUpdate'](),controller[_0xbdc5('0x9')]);router[_0xbdc5('0x4')](_0xbdc5('0xa'),auth[_0xbdc5('0x7')](),auth[_0xbdc5('0xb')](),controller[_0xbdc5('0xc')]);router['get']('/restart',auth[_0xbdc5('0x7')](),controller[_0xbdc5('0xd')]);router[_0xbdc5('0x4')]('/migrations',controller[_0xbdc5('0xe')]);module[_0xbdc5('0xf')]=router;
\ No newline at end of file
+var _0x02ea=['../../components/auth/service','./version.controller','get','index','/fetch','canUpdate','fetch','isAuthenticated','pull','/restart','restart','/migrations','migrations','exports','express'];(function(_0x167538,_0x5216ff){var _0x53b517=function(_0x3913ce){while(--_0x3913ce){_0x167538['push'](_0x167538['shift']());}};_0x53b517(++_0x5216ff);}(_0x02ea,0xd1));var _0xa02e=function(_0x4350c2,_0x112f3c){_0x4350c2=_0x4350c2-0x0;var _0x8b6406=_0x02ea[_0x4350c2];return _0x8b6406;};'use strict';var express=require(_0xa02e('0x0'));var router=express['Router']();var auth=require(_0xa02e('0x1'));var controller=require(_0xa02e('0x2'));router[_0xa02e('0x3')]('/',controller[_0xa02e('0x4')]);router[_0xa02e('0x3')](_0xa02e('0x5'),auth['isAuthenticated'](),auth[_0xa02e('0x6')](),controller[_0xa02e('0x7')]);router[_0xa02e('0x3')]('/reset',auth[_0xa02e('0x8')](),auth[_0xa02e('0x6')](),controller['reset']);router['get']('/pull',auth[_0xa02e('0x8')](),auth['canUpdate'](),controller[_0xa02e('0x9')]);router[_0xa02e('0x3')](_0xa02e('0xa'),auth['isAuthenticated'](),controller[_0xa02e('0xb')]);router['get'](_0xa02e('0xc'),controller[_0xa02e('0xd')]);module[_0xa02e('0xe')]=router;
\ No newline at end of file
index eb6d4c3..3470ec8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb5b8=['../../config/pm2','../../config/logger','update','simple-git','root','query','latest','fetch','tags','exports','2.0.0','status','json','error','git\x20fetch','reset','FETCH_HEAD','info','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','restart','motion2','then','catch','migrations','readdirSync','join','length','.js','push','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','map','\x20to\x20','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','lodash','version','compare-versions','../../mysqldb','../../config/environment'];(function(_0x1e8ab9,_0x123613){var _0x13d0cd=function(_0x35924b){while(--_0x35924b){_0x1e8ab9['push'](_0x1e8ab9['shift']());}};_0x13d0cd(++_0x123613);}(_0xb5b8,0x14a));var _0x8b5b=function(_0x3e80e5,_0x340d96){_0x3e80e5=_0x3e80e5-0x0;var _0x308f16=_0xb5b8[_0x3e80e5];return _0x308f16;};'use strict';var Umzug=require(_0x8b5b('0x0'));var path=require('path');var fs=require('fs');var _=require(_0x8b5b('0x1'));var pkginfo=require('pkginfo')(module,_0x8b5b('0x2'));var compareVersions=require(_0x8b5b('0x3'));var exec=require('child_process')['exec'];var db=require(_0x8b5b('0x4'))['db'];var config=require(_0x8b5b('0x5'));var pm2=require(_0x8b5b('0x6'));var logger=require(_0x8b5b('0x7'))(_0x8b5b('0x8'));var git=require(_0x8b5b('0x9'))(config[_0x8b5b('0xa')]);exports['index']=function(_0x4e53b0,_0x5d92c0){var _0x1da3f3={'current':module['exports'][_0x8b5b('0x2')],'phonebar':0x2};if(_0x4e53b0[_0x8b5b('0xb')]&&_0x4e53b0[_0x8b5b('0xb')][_0x8b5b('0xc')]){return git[_0x8b5b('0xd')]()[_0x8b5b('0xe')](function(_0x288ac7,_0x35f533){_0x1da3f3[_0x8b5b('0xc')]=(_0x288ac7?module[_0x8b5b('0xf')]['version']:_0x35f533[_0x8b5b('0xc')])||_0x8b5b('0x10');return _0x5d92c0[_0x8b5b('0x11')](0xc8)[_0x8b5b('0x12')](_0x1da3f3);});}else{return _0x5d92c0[_0x8b5b('0x11')](0xc8)[_0x8b5b('0x12')](_0x1da3f3);}};exports[_0x8b5b('0xd')]=function(_0x436440,_0x5e9966){return git[_0x8b5b('0xd')](['origin','master'],function(_0x2fcc53){if(_0x2fcc53){logger[_0x8b5b('0x13')](_0x2fcc53);return _0x5e9966[_0x8b5b('0x11')](0x1f4)[_0x8b5b('0x12')](_0x2fcc53);}logger['info'](_0x8b5b('0x14'));return _0x5e9966['status'](0xc8)[_0x8b5b('0x12')]({'output':'git\x20fetch\x20origin\x20master'});});};exports['reset']=function(_0x2cce35,_0x251334){return git[_0x8b5b('0x15')](['--hard',_0x8b5b('0x16')],function(_0x4f9c2a){if(_0x4f9c2a){logger[_0x8b5b('0x13')](_0x4f9c2a);return _0x251334[_0x8b5b('0x11')](0x1f4)[_0x8b5b('0x12')](_0x4f9c2a);}logger[_0x8b5b('0x17')](_0x8b5b('0x18'));return _0x251334[_0x8b5b('0x11')](0xc8)[_0x8b5b('0x12')]({'output':_0x8b5b('0x19')});});};exports[_0x8b5b('0x1a')]=function(_0x5d6d3d,_0x5b0b3a){exec('npm\x20install\x20--production',function(_0x259f66,_0x476629,_0x1fa3c0){logger[_0x8b5b('0x17')](_0x476629);logger[_0x8b5b('0x17')](_0x1fa3c0);if(_0x259f66){logger[_0x8b5b('0x13')](_0x259f66);return _0x5b0b3a['status'](0x1f4)['json'](_0x259f66);}return _0x5b0b3a['status'](0xc8)['json']({'output':_0x476629});});};exports[_0x8b5b('0x1b')]=function(_0x2bc829,_0x27a0d0){return pm2[_0x8b5b('0x1b')](_0x8b5b('0x1c'))[_0x8b5b('0x1d')](function(_0x35d8ef){logger[_0x8b5b('0x17')]('pm2\x20restart\x20motion\x20%s',_0x35d8ef);return _0x27a0d0[_0x8b5b('0x11')](0xc8)[_0x8b5b('0x12')]({'output':'Your\x20system\x20has\x20been\x20restart\x20successfully'});})[_0x8b5b('0x1e')](function(_0x4b5401){logger[_0x8b5b('0x13')](_0x4b5401);return _0x27a0d0[_0x8b5b('0x11')](0x1f4)[_0x8b5b('0x12')](_0x4b5401);});};exports[_0x8b5b('0x1f')]=function(_0x26a072,_0x2a1f45){var _0x575703=fs[_0x8b5b('0x20')](path[_0x8b5b('0x21')](config['root'],'server',_0x8b5b('0x1f')));var _0x48e561=[];for(var _0x35ef47=0x0;_0x35ef47<_0x575703[_0x8b5b('0x22')];_0x35ef47++){var _0x248a1e=_0x575703[_0x35ef47]['replace'](_0x8b5b('0x23'),'');if(compareVersions(module[_0x8b5b('0xf')][_0x8b5b('0x2')],_0x248a1e)===-0x1){_0x48e561[_0x8b5b('0x24')](_0x248a1e);}}if(_0x48e561[_0x8b5b('0x22')]){var _0x22c435=_0x48e561[_0x8b5b('0x25')](compareVersions);var _0x579a4f=new Umzug({'storage':_0x8b5b('0x26'),'storageOptions':{'model':db[_0x8b5b('0x27')],'modelName':_0x8b5b('0x27'),'columnName':_0x8b5b('0x2')},'migrations':{'params':[db[_0x8b5b('0x26')][_0x8b5b('0x28')](),db[_0x8b5b('0x26')][_0x8b5b('0x29')],function(){throw new Error(_0x8b5b('0x2a'));}],'path':path[_0x8b5b('0x21')](config['root'],_0x8b5b('0x2b'),_0x8b5b('0x1f')),'pattern':/\.js$/}});_0x579a4f['up']({'migrations':_[_0x8b5b('0x2c')](_0x22c435,function(_0xd965cf){return _0xd965cf+_0x8b5b('0x23');})})['then'](function(){return _0x2a1f45[_0x8b5b('0x11')](0xc8)[_0x8b5b('0x12')]({'output':'Database\x20migrated\x20successfully\x20from\x20version\x20'+module[_0x8b5b('0xf')][_0x8b5b('0x2')]+_0x8b5b('0x2d')+_['last'](_0x22c435),'migrations':_[_0x8b5b('0x21')](_0x22c435)});})[_0x8b5b('0x1e')](function(_0x5c14ef){if(_0x5c14ef instanceof db[_0x8b5b('0x26')][_0x8b5b('0x2e')]){return _0x2a1f45[_0x8b5b('0x11')](0xc8)[_0x8b5b('0x12')]({'output':'Database\x20already\x20up-to-date'});}else{return _0x2a1f45[_0x8b5b('0x11')](0x1f4)[_0x8b5b('0x12')](_0x5c14ef);}});}else{return _0x2a1f45[_0x8b5b('0x11')](0xc8)[_0x8b5b('0x12')]({'output':_0x8b5b('0x2f')});}};
\ No newline at end of file
+var _0x2289=['error','info','git\x20fetch','status','git\x20fetch\x20origin\x20master','--hard','FETCH_HEAD','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production','restart','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','join','length','replace','.js','push','sequelize','getQueryInterface','constructor','server','\x20to\x20','Database\x20already\x20up-to-date','umzug','path','lodash','pkginfo','version','exec','../../config/environment','../../config/logger','update','simple-git','root','exports','query','tags','latest','json','fetch','origin','master'];(function(_0x4b36c9,_0xa03a46){var _0x53fd89=function(_0x4c35f4){while(--_0x4c35f4){_0x4b36c9['push'](_0x4b36c9['shift']());}};_0x53fd89(++_0xa03a46);}(_0x2289,0x165));var _0x9228=function(_0x1dda39,_0x221826){_0x1dda39=_0x1dda39-0x0;var _0x269408=_0x2289[_0x1dda39];return _0x269408;};'use strict';var Umzug=require(_0x9228('0x0'));var path=require(_0x9228('0x1'));var fs=require('fs');var _=require(_0x9228('0x2'));var pkginfo=require(_0x9228('0x3'))(module,_0x9228('0x4'));var compareVersions=require('compare-versions');var exec=require('child_process')[_0x9228('0x5')];var db=require('../../mysqldb')['db'];var config=require(_0x9228('0x6'));var pm2=require('../../config/pm2');var logger=require(_0x9228('0x7'))(_0x9228('0x8'));var git=require(_0x9228('0x9'))(config[_0x9228('0xa')]);exports['index']=function(_0xd25aed,_0x16e187){var _0x1c2671={'current':module[_0x9228('0xb')][_0x9228('0x4')],'phonebar':0x2};if(_0xd25aed[_0x9228('0xc')]&&_0xd25aed[_0x9228('0xc')]['latest']){return git['fetch']()[_0x9228('0xd')](function(_0x4e5a76,_0xb7a30a){_0x1c2671['latest']=(_0x4e5a76?module[_0x9228('0xb')][_0x9228('0x4')]:_0xb7a30a[_0x9228('0xe')])||'2.0.0';return _0x16e187['status'](0xc8)[_0x9228('0xf')](_0x1c2671);});}else{return _0x16e187['status'](0xc8)[_0x9228('0xf')](_0x1c2671);}};exports[_0x9228('0x10')]=function(_0x660199,_0x265ff4){return git[_0x9228('0x10')]([_0x9228('0x11'),_0x9228('0x12')],function(_0x385bb6){if(_0x385bb6){logger[_0x9228('0x13')](_0x385bb6);return _0x265ff4['status'](0x1f4)[_0x9228('0xf')](_0x385bb6);}logger[_0x9228('0x14')](_0x9228('0x15'));return _0x265ff4[_0x9228('0x16')](0xc8)['json']({'output':_0x9228('0x17')});});};exports['reset']=function(_0x490ff0,_0x35147b){return git['reset']([_0x9228('0x18'),_0x9228('0x19')],function(_0x2dc6db){if(_0x2dc6db){logger['error'](_0x2dc6db);return _0x35147b['status'](0x1f4)[_0x9228('0xf')](_0x2dc6db);}logger['info'](_0x9228('0x1a'));return _0x35147b[_0x9228('0x16')](0xc8)[_0x9228('0xf')]({'output':_0x9228('0x1b')});});};exports[_0x9228('0x1c')]=function(_0x117504,_0x3729a0){exec(_0x9228('0x1d'),function(_0x1efe78,_0x20e26f,_0x5a1a69){logger[_0x9228('0x14')](_0x20e26f);logger[_0x9228('0x14')](_0x5a1a69);if(_0x1efe78){logger['error'](_0x1efe78);return _0x3729a0['status'](0x1f4)[_0x9228('0xf')](_0x1efe78);}return _0x3729a0[_0x9228('0x16')](0xc8)[_0x9228('0xf')]({'output':_0x20e26f});});};exports['restart']=function(_0x349e0a,_0xef1de0){return pm2[_0x9228('0x1e')]('motion2')[_0x9228('0x1f')](function(_0x573ac7){logger[_0x9228('0x14')](_0x9228('0x20'),_0x573ac7);return _0xef1de0['status'](0xc8)[_0x9228('0xf')]({'output':_0x9228('0x21')});})[_0x9228('0x22')](function(_0x5dac47){logger['error'](_0x5dac47);return _0xef1de0[_0x9228('0x16')](0x1f4)['json'](_0x5dac47);});};exports[_0x9228('0x23')]=function(_0x4dff88,_0x3b89fd){var _0x55afe0=fs['readdirSync'](path[_0x9228('0x24')](config[_0x9228('0xa')],'server',_0x9228('0x23')));var _0x5ee96d=[];for(var _0x4a2d58=0x0;_0x4a2d58<_0x55afe0[_0x9228('0x25')];_0x4a2d58++){var _0x33b75c=_0x55afe0[_0x4a2d58][_0x9228('0x26')](_0x9228('0x27'),'');if(compareVersions(module[_0x9228('0xb')][_0x9228('0x4')],_0x33b75c)===-0x1){_0x5ee96d[_0x9228('0x28')](_0x33b75c);}}if(_0x5ee96d[_0x9228('0x25')]){var _0x61aa6b=_0x5ee96d['sort'](compareVersions);var _0x133009=new Umzug({'storage':_0x9228('0x29'),'storageOptions':{'model':db['Migration'],'modelName':'Migration','columnName':'version'},'migrations':{'params':[db[_0x9228('0x29')][_0x9228('0x2a')](),db[_0x9228('0x29')][_0x9228('0x2b')],function(){throw new Error('Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.');}],'path':path[_0x9228('0x24')](config['root'],_0x9228('0x2c'),_0x9228('0x23')),'pattern':/\.js$/}});_0x133009['up']({'migrations':_['map'](_0x61aa6b,function(_0x565f7c){return _0x565f7c+'.js';})})[_0x9228('0x1f')](function(){return _0x3b89fd[_0x9228('0x16')](0xc8)[_0x9228('0xf')]({'output':'Database\x20migrated\x20successfully\x20from\x20version\x20'+module['exports']['version']+_0x9228('0x2d')+_['last'](_0x61aa6b),'migrations':_[_0x9228('0x24')](_0x61aa6b)});})[_0x9228('0x22')](function(_0x3fb223){if(_0x3fb223 instanceof db['sequelize']['UniqueConstraintError']){return _0x3b89fd[_0x9228('0x16')](0xc8)['json']({'output':_0x9228('0x2e')});}else{return _0x3b89fd[_0x9228('0x16')](0x1f4)[_0x9228('0xf')](_0x3fb223);}});}else{return _0x3b89fd[_0x9228('0x16')](0xc8)[_0x9228('0xf')]({'output':'Database\x20already\x20up-to-date'});}};
\ No newline at end of file
index 199d818..3bc50ab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe8f0=['/describe','describe','/:id','show','post','put','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceAgentReport.controller','isAuthenticated','get'];(function(_0x75ce5b,_0x3b582f){var _0x22195e=function(_0x166668){while(--_0x166668){_0x75ce5b['push'](_0x75ce5b['shift']());}};_0x22195e(++_0x3b582f);}(_0xe8f0,0x1e9));var _0x0e8f=function(_0x2589fe,_0x12d6ce){_0x2589fe=_0x2589fe-0x0;var _0x52cfae=_0xe8f0[_0x2589fe];return _0x52cfae;};'use strict';var multer=require(_0x0e8f('0x0'));var util=require(_0x0e8f('0x1'));var path=require(_0x0e8f('0x2'));var timeout=require('connect-timeout');var express=require(_0x0e8f('0x3'));var router=express[_0x0e8f('0x4')]();var fs_extra=require(_0x0e8f('0x5'));var auth=require(_0x0e8f('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x0e8f('0x7'));var controller=require(_0x0e8f('0x8'));router['get']('/',auth[_0x0e8f('0x9')](),controller['index']);router[_0x0e8f('0xa')](_0x0e8f('0xb'),auth['isAuthenticated'](),controller[_0x0e8f('0xc')]);router['get'](_0x0e8f('0xd'),auth[_0x0e8f('0x9')](),controller[_0x0e8f('0xe')]);router[_0x0e8f('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0e8f('0x10')](_0x0e8f('0xd'),auth[_0x0e8f('0x9')](),controller['update']);router[_0x0e8f('0x11')](_0x0e8f('0xd'),auth[_0x0e8f('0x9')](),controller[_0x0e8f('0x12')]);module[_0x0e8f('0x13')]=router;
\ No newline at end of file
+var _0x823a=['/:id','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','get','isAuthenticated','index','describe'];(function(_0x4573dd,_0x22088d){var _0x42ee7a=function(_0x6ee6f8){while(--_0x6ee6f8){_0x4573dd['push'](_0x4573dd['shift']());}};_0x42ee7a(++_0x22088d);}(_0x823a,0x14a));var _0xa823=function(_0xf1f2e0,_0x37c415){_0xf1f2e0=_0xf1f2e0-0x0;var _0x991373=_0x823a[_0xf1f2e0];return _0x991373;};'use strict';var multer=require(_0xa823('0x0'));var util=require(_0xa823('0x1'));var path=require(_0xa823('0x2'));var timeout=require(_0xa823('0x3'));var express=require(_0xa823('0x4'));var router=express[_0xa823('0x5')]();var fs_extra=require(_0xa823('0x6'));var auth=require(_0xa823('0x7'));var interaction=require(_0xa823('0x8'));var config=require(_0xa823('0x9'));var controller=require(_0xa823('0xa'));router[_0xa823('0xb')]('/',auth[_0xa823('0xc')](),controller[_0xa823('0xd')]);router[_0xa823('0xb')]('/describe',auth[_0xa823('0xc')](),controller[_0xa823('0xe')]);router['get'](_0xa823('0xf'),auth[_0xa823('0xc')](),controller['show']);router[_0xa823('0x10')]('/',auth['isAuthenticated'](),controller[_0xa823('0x11')]);router[_0xa823('0x12')](_0xa823('0xf'),auth[_0xa823('0xc')](),controller[_0xa823('0x13')]);router[_0xa823('0x14')](_0xa823('0xf'),auth['isAuthenticated'](),controller[_0xa823('0x15')]);module[_0xa823('0x16')]=router;
\ No newline at end of file
index 57bc954..861b39f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xccef=['exports','STRING','DATE','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED'];(function(_0x3b210e,_0x36acc6){var _0x4dc496=function(_0x50ad1b){while(--_0x50ad1b){_0x3b210e['push'](_0x3b210e['shift']());}};_0x4dc496(++_0x36acc6);}(_0xccef,0x1d4));var _0xfcce=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xccef[_0x502c7d];return _0x30b7ed;};'use strict';var Sequelize=require('sequelize');module[_0xfcce('0x0')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xfcce('0x1')]},'calleridnum':{'type':Sequelize[_0xfcce('0x1')]},'calleridname':{'type':Sequelize[_0xfcce('0x1')]},'queue':{'type':Sequelize[_0xfcce('0x1')]},'interface':{'type':Sequelize[_0xfcce('0x1')]},'membername':{'type':Sequelize[_0xfcce('0x1')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize['DATE']},'agentcompleteAt':{'type':Sequelize[_0xfcce('0x2')]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdumpAt':{'type':Sequelize[_0xfcce('0x2')]},'holdtime':{'type':Sequelize[_0xfcce('0x3')]},'agentcomplete':{'type':Sequelize[_0xfcce('0x4')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0xfcce('0x4')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0xfcce('0x4')],'defaultValue':![]},'talktime':{'type':Sequelize[_0xfcce('0x3')]},'agentacw':{'type':Sequelize[_0xfcce('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0xfcce('0x1')]},'lastevent':{'type':Sequelize[_0xfcce('0x1')]},'channel':{'type':Sequelize[_0xfcce('0x1')]},'channelstate':{'type':Sequelize[_0xfcce('0x3')]},'channelstatedesc':{'type':Sequelize[_0xfcce('0x1')]},'connectedlinenum':{'type':Sequelize[_0xfcce('0x1')]},'connectedlinename':{'type':Sequelize[_0xfcce('0x1')]},'language':{'type':Sequelize[_0xfcce('0x1')]},'accountcode':{'type':Sequelize[_0xfcce('0x1')]},'context':{'type':Sequelize[_0xfcce('0x1')]},'exten':{'type':Sequelize[_0xfcce('0x1')]},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0xfcce('0x1')]},'destchannelstate':{'type':Sequelize[_0xfcce('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0xfcce('0x1')]},'destcalleridnum':{'type':Sequelize[_0xfcce('0x1')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0xfcce('0x1')]},'destconnectedlinename':{'type':Sequelize[_0xfcce('0x1')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0xfcce('0x1')]},'destexten':{'type':Sequelize[_0xfcce('0x1')]},'destpriority':{'type':Sequelize[_0xfcce('0x1')]},'destuniqueid':{'type':Sequelize[_0xfcce('0x1')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0xfcce('0x1')]},'answeredelsewheremembername':{'type':Sequelize[_0xfcce('0x1')]},'transfer':{'type':Sequelize[_0xfcce('0x4')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xfcce('0x1')],'comment':_0xfcce('0x5')},'transferexten':{'type':Sequelize[_0xfcce('0x1')]},'transferuniqueid':{'type':Sequelize[_0xfcce('0x1')]},'agententerreason':{'type':Sequelize[_0xfcce('0x3')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x0120=['exports','STRING','DATE','BOOLEAN','INTEGER','FORWARD,\x20BLIND,\x20ATTENDED','sequelize'];(function(_0x5a446d,_0x498ff6){var _0xd31b0d=function(_0x3f9890){while(--_0x3f9890){_0x5a446d['push'](_0x5a446d['shift']());}};_0xd31b0d(++_0x498ff6);}(_0x0120,0x6f));var _0x0012=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0x0120[_0x31e29a];return _0x32d892;};'use strict';var Sequelize=require(_0x0012('0x0'));module[_0x0012('0x1')]={'type':{'type':Sequelize[_0x0012('0x2')]},'uniqueid':{'type':Sequelize[_0x0012('0x2')]},'calleridnum':{'type':Sequelize[_0x0012('0x2')]},'calleridname':{'type':Sequelize[_0x0012('0x2')]},'queue':{'type':Sequelize[_0x0012('0x2')]},'interface':{'type':Sequelize[_0x0012('0x2')]},'membername':{'type':Sequelize[_0x0012('0x2')]},'agentcalledAt':{'type':Sequelize[_0x0012('0x3')]},'agentconnectAt':{'type':Sequelize[_0x0012('0x3')]},'agentcompleteAt':{'type':Sequelize[_0x0012('0x3')]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdumpAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0x0012('0x4')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x0012('0x4')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x0012('0x4')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x0012('0x5')]},'agentacw':{'type':Sequelize[_0x0012('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0x0012('0x2')]},'lastevent':{'type':Sequelize[_0x0012('0x2')]},'channel':{'type':Sequelize[_0x0012('0x2')]},'channelstate':{'type':Sequelize[_0x0012('0x5')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x0012('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x0012('0x2')]},'accountcode':{'type':Sequelize[_0x0012('0x2')]},'context':{'type':Sequelize[_0x0012('0x2')]},'exten':{'type':Sequelize[_0x0012('0x2')]},'priority':{'type':Sequelize[_0x0012('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x0012('0x5')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0x0012('0x2')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0x0012('0x2')]},'destcontext':{'type':Sequelize[_0x0012('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x0012('0x2')]},'destuniqueid':{'type':Sequelize[_0x0012('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x0012('0x2')]},'answeredelsewheremembername':{'type':Sequelize[_0x0012('0x2')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':_0x0012('0x6')},'transferexten':{'type':Sequelize[_0x0012('0x2')]},'transferuniqueid':{'type':Sequelize[_0x0012('0x2')]},'agententerreason':{'type':Sequelize[_0x0012('0x5')],'defaultValue':0x0}};
\ No newline at end of file
index 2d90fc0..80cf676 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(_0x4ed520,_0x21be63){var _0x4415a6=function(_0x14b151){while(--_0x14b151){_0x4ed520['push'](_0x4ed520['shift']());}};_0x4415a6(++_0x21be63);}(_0xa9e0,0x123));var _0x0a9e=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xa9e0[_0x311c35];return _0x5cc50c;};'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(_0x9dfc10,_0x19c2d5){var _0x4f938a=function(_0x12b1e5){while(--_0x12b1e5){_0x9dfc10['push'](_0x9dfc10['shift']());}};_0x4f938a(++_0x19c2d5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xa9e0[_0x3054be];return _0x3df150;};'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 a39adaf..d8f3007 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x29d4=['uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceAgentReport.attributes','exports','define','VoiceAgentReport'];(function(_0x6c3026,_0x5420a2){var _0x25c473=function(_0x1f7555){while(--_0x1f7555){_0x6c3026['push'](_0x6c3026['shift']());}};_0x25c473(++_0x5420a2);}(_0x29d4,0x1a1));var _0x429d=function(_0x34021d,_0x753aa6){_0x34021d=_0x34021d-0x0;var _0x16597b=_0x29d4[_0x34021d];return _0x16597b;};'use strict';var _=require(_0x429d('0x0'));var util=require('util');var logger=require(_0x429d('0x1'))(_0x429d('0x2'));var moment=require(_0x429d('0x3'));var BPromise=require(_0x429d('0x4'));var rp=require(_0x429d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x429d('0x6'));var config=require(_0x429d('0x7'));var attributes=require(_0x429d('0x8'));module[_0x429d('0x9')]=function(_0x1c55aa,_0xa71445){return _0x1c55aa[_0x429d('0xa')](_0x429d('0xb'),attributes,{'tableName':'report_agent','paranoid':![],'indexes':[{'fields':[_0x429d('0xc'),'destuniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0xb38e=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','report_agent','uniqueid','destuniqueid','lodash'];(function(_0xab9f3d,_0xb336fa){var _0x5283bf=function(_0x505e6c){while(--_0x505e6c){_0xab9f3d['push'](_0xab9f3d['shift']());}};_0x5283bf(++_0xb336fa);}(_0xb38e,0xa7));var _0xeb38=function(_0x444ac8,_0x52cb81){_0x444ac8=_0x444ac8-0x0;var _0x3ba5bb=_0xb38e[_0x444ac8];return _0x3ba5bb;};'use strict';var _=require(_0xeb38('0x0'));var util=require(_0xeb38('0x1'));var logger=require(_0xeb38('0x2'))(_0xeb38('0x3'));var moment=require(_0xeb38('0x4'));var BPromise=require(_0xeb38('0x5'));var rp=require(_0xeb38('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xeb38('0x7'));var config=require(_0xeb38('0x8'));var attributes=require('./voiceAgentReport.attributes');module[_0xeb38('0x9')]=function(_0xd3e5dc,_0x28e501){return _0xd3e5dc[_0xeb38('0xa')]('VoiceAgentReport',attributes,{'tableName':_0xeb38('0xb'),'paranoid':![],'indexes':[{'fields':[_0xeb38('0xc'),_0xeb38('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
index 5d2f3fe..b12f6ca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7883=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','VoiceAgentReport,\x20%s,\x20%s','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','request\x20sent','result','catch','CreateVoiceAgentReport','VoiceAgentReport','create','body','options','raw','UpdateVoiceAgentReport','attributes','limit','lodash','util'];(function(_0x1a43b0,_0x1c8244){var _0x129198=function(_0x2d44a4){while(--_0x2d44a4){_0x1a43b0['push'](_0x1a43b0['shift']());}};_0x129198(++_0x1c8244);}(_0x7883,0x148));var _0x3788=function(_0x5acc26,_0x8c948e){_0x5acc26=_0x5acc26-0x0;var _0x23a669=_0x7883[_0x5acc26];return _0x23a669;};'use strict';var _=require(_0x3788('0x0'));var util=require(_0x3788('0x1'));var moment=require('moment');var BPromise=require(_0x3788('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3788('0x3'));var db=require(_0x3788('0x4'))['db'];var utils=require(_0x3788('0x5'));var logger=require(_0x3788('0x6'))(_0x3788('0x7'));var config=require(_0x3788('0x8'));var jayson=require(_0x3788('0x9'));var client=jayson[_0x3788('0xa')][_0x3788('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2e6939,_0x2beb52,_0x2ca5aa){return new BPromise(function(_0x5c3b00,_0x59c1ba){return client['request'](_0x2e6939,_0x2ca5aa)[_0x3788('0xc')](function(_0x3b0c90){logger[_0x3788('0xd')](_0x3788('0xe'),_0x2beb52,'request\x20sent');logger[_0x3788('0xf')](_0x3788('0x10'),_0x2beb52,'request\x20sent',JSON[_0x3788('0x11')](_0x3b0c90));if(_0x3b0c90['error']){if(_0x3b0c90['error'][_0x3788('0x12')]===0x1f4){logger[_0x3788('0x13')](_0x3788('0xe'),_0x2beb52,_0x3b0c90['error'][_0x3788('0x14')]);return _0x59c1ba(_0x3b0c90[_0x3788('0x13')][_0x3788('0x14')]);}logger[_0x3788('0x13')]('VoiceAgentReport,\x20%s,\x20%s',_0x2beb52,_0x3b0c90[_0x3788('0x13')][_0x3788('0x14')]);return _0x5c3b00(_0x3b0c90[_0x3788('0x13')]['message']);}else{logger[_0x3788('0xd')]('VoiceAgentReport,\x20%s,\x20%s',_0x2beb52,_0x3788('0x15'));_0x5c3b00(_0x3b0c90[_0x3788('0x16')][_0x3788('0x14')]);}})[_0x3788('0x17')](function(_0x1e6cfe){logger[_0x3788('0x13')]('VoiceAgentReport,\x20%s,\x20%s',_0x2beb52,_0x1e6cfe);_0x59c1ba(_0x1e6cfe);});});}exports[_0x3788('0x18')]=function(_0x3d32e3){var _0x36b25d=this;return new Promise(function(_0x20782b,_0x1c1616){return db[_0x3788('0x19')][_0x3788('0x1a')](_0x3d32e3[_0x3788('0x1b')],{'raw':_0x3d32e3[_0x3788('0x1c')]?_0x3d32e3['options'][_0x3788('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x46b070){logger[_0x3788('0xd')](_0x3788('0x18'),_0x3d32e3);logger[_0x3788('0xf')](_0x3788('0x18'),_0x3d32e3,JSON[_0x3788('0x11')](_0x46b070));_0x20782b(_0x46b070);})[_0x3788('0x17')](function(_0x223416){logger[_0x3788('0x13')](_0x3788('0x18'),_0x223416['message'],_0x3d32e3);_0x1c1616(_0x36b25d['error'](0x1f4,_0x223416[_0x3788('0x14')]));});});};exports[_0x3788('0x1e')]=function(_0x524d95){var _0xb02149=this;return new Promise(function(_0x475330,_0x143a95){return db[_0x3788('0x19')]['update'](_0x524d95[_0x3788('0x1b')],{'raw':_0x524d95[_0x3788('0x1c')]?_0x524d95[_0x3788('0x1c')][_0x3788('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x524d95[_0x3788('0x1c')]?_0x524d95[_0x3788('0x1c')]['where']||null:null,'attributes':_0x524d95['options']?_0x524d95[_0x3788('0x1c')][_0x3788('0x1f')]||null:null,'limit':_0x524d95[_0x3788('0x1c')]?_0x524d95[_0x3788('0x1c')][_0x3788('0x20')]||null:null})[_0x3788('0xc')](function(_0x53c5db){logger[_0x3788('0xd')](_0x3788('0x1e'),_0x524d95);logger['debug'](_0x3788('0x1e'),_0x524d95,JSON['stringify'](_0x53c5db));_0x475330(_0x53c5db);})[_0x3788('0x17')](function(_0x38fe7e){logger[_0x3788('0x13')](_0x3788('0x1e'),_0x38fe7e[_0x3788('0x14')],_0x524d95);_0x143a95(_0xb02149['error'](0x1f4,_0x38fe7e[_0x3788('0x14')]));});});};
\ No newline at end of file
+var _0x012f=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','CreateVoiceAgentReport','VoiceAgentReport','create','body','options','stringify','update','raw','where','attributes','limit','UpdateVoiceAgentReport','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x240134,_0x2742a4){var _0x181532=function(_0x77d4c2){while(--_0x77d4c2){_0x240134['push'](_0x240134['shift']());}};_0x181532(++_0x2742a4);}(_0x012f,0x119));var _0xf012=function(_0xf7fda0,_0x27c453){_0xf7fda0=_0xf7fda0-0x0;var _0x5a4a51=_0x012f[_0xf7fda0];return _0x5a4a51;};'use strict';var _=require(_0xf012('0x0'));var util=require(_0xf012('0x1'));var moment=require(_0xf012('0x2'));var BPromise=require('bluebird');var rs=require(_0xf012('0x3'));var fs=require('fs');var Redis=require(_0xf012('0x4'));var db=require(_0xf012('0x5'))['db'];var utils=require(_0xf012('0x6'));var logger=require(_0xf012('0x7'))(_0xf012('0x8'));var config=require(_0xf012('0x9'));var jayson=require(_0xf012('0xa'));var client=jayson[_0xf012('0xb')][_0xf012('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2f6d68,_0x2f6478,_0x2d7955){return new BPromise(function(_0x103a25,_0x29f509){return client['request'](_0x2f6d68,_0x2d7955)[_0xf012('0xd')](function(_0x3b4524){logger['info'](_0xf012('0xe'),_0x2f6478,_0xf012('0xf'));logger[_0xf012('0x10')](_0xf012('0x11'),_0x2f6478,'request\x20sent',JSON['stringify'](_0x3b4524));if(_0x3b4524[_0xf012('0x12')]){if(_0x3b4524[_0xf012('0x12')][_0xf012('0x13')]===0x1f4){logger[_0xf012('0x12')](_0xf012('0xe'),_0x2f6478,_0x3b4524[_0xf012('0x12')][_0xf012('0x14')]);return _0x29f509(_0x3b4524[_0xf012('0x12')][_0xf012('0x14')]);}logger['error'](_0xf012('0xe'),_0x2f6478,_0x3b4524[_0xf012('0x12')][_0xf012('0x14')]);return _0x103a25(_0x3b4524['error'][_0xf012('0x14')]);}else{logger[_0xf012('0x15')](_0xf012('0xe'),_0x2f6478,'request\x20sent');_0x103a25(_0x3b4524[_0xf012('0x16')]['message']);}})[_0xf012('0x17')](function(_0x48227c){logger[_0xf012('0x12')]('VoiceAgentReport,\x20%s,\x20%s',_0x2f6478,_0x48227c);_0x29f509(_0x48227c);});});}exports[_0xf012('0x18')]=function(_0x1bec84){var _0x1bc93a=this;return new Promise(function(_0x463fc7,_0x23932a){return db[_0xf012('0x19')][_0xf012('0x1a')](_0x1bec84[_0xf012('0x1b')],{'raw':_0x1bec84['options']?_0x1bec84[_0xf012('0x1c')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x5c68c5){logger['info'](_0xf012('0x18'),_0x1bec84);logger['debug'](_0xf012('0x18'),_0x1bec84,JSON[_0xf012('0x1d')](_0x5c68c5));_0x463fc7(_0x5c68c5);})[_0xf012('0x17')](function(_0x7d71ba){logger['error'](_0xf012('0x18'),_0x7d71ba[_0xf012('0x14')],_0x1bec84);_0x23932a(_0x1bc93a[_0xf012('0x12')](0x1f4,_0x7d71ba[_0xf012('0x14')]));});});};exports['UpdateVoiceAgentReport']=function(_0x194f0b){var _0x445d9b=this;return new Promise(function(_0x403885,_0x300c60){return db[_0xf012('0x19')][_0xf012('0x1e')](_0x194f0b[_0xf012('0x1b')],{'raw':_0x194f0b[_0xf012('0x1c')]?_0x194f0b[_0xf012('0x1c')][_0xf012('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x194f0b[_0xf012('0x1c')]?_0x194f0b['options'][_0xf012('0x20')]||null:null,'attributes':_0x194f0b[_0xf012('0x1c')]?_0x194f0b['options'][_0xf012('0x21')]||null:null,'limit':_0x194f0b[_0xf012('0x1c')]?_0x194f0b[_0xf012('0x1c')][_0xf012('0x22')]||null:null})[_0xf012('0xd')](function(_0x3b0943){logger[_0xf012('0x15')](_0xf012('0x23'),_0x194f0b);logger[_0xf012('0x10')]('UpdateVoiceAgentReport',_0x194f0b,JSON[_0xf012('0x1d')](_0x3b0943));_0x403885(_0x3b0943);})['catch'](function(_0x4f795d){logger[_0xf012('0x12')](_0xf012('0x23'),_0x4f795d[_0xf012('0x14')],_0x194f0b);_0x300c60(_0x445d9b[_0xf012('0x12')](0x1f4,_0x4f795d[_0xf012('0x14')]));});});};
\ No newline at end of file
index 67b2770..5f48a3b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdbf5=['show','post','put','update','exports','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','get','isAuthenticated','index','/describe'];(function(_0x214a25,_0x15071d){var _0x405988=function(_0x5c6fc1){while(--_0x5c6fc1){_0x214a25['push'](_0x214a25['shift']());}};_0x405988(++_0x15071d);}(_0xdbf5,0x18c));var _0x5dbf=function(_0x192b6c,_0x1c9442){_0x192b6c=_0x192b6c-0x0;var _0x52f955=_0xdbf5[_0x192b6c];return _0x52f955;};'use strict';var multer=require('multer');var util=require(_0x5dbf('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5dbf('0x1'));var router=express[_0x5dbf('0x2')]();var fs_extra=require(_0x5dbf('0x3'));var auth=require(_0x5dbf('0x4'));var interaction=require(_0x5dbf('0x5'));var config=require(_0x5dbf('0x6'));var controller=require(_0x5dbf('0x7'));router[_0x5dbf('0x8')]('/',auth[_0x5dbf('0x9')](),controller[_0x5dbf('0xa')]);router[_0x5dbf('0x8')](_0x5dbf('0xb'),auth[_0x5dbf('0x9')](),controller['describe']);router[_0x5dbf('0x8')]('/:id',auth[_0x5dbf('0x9')](),controller[_0x5dbf('0xc')]);router[_0x5dbf('0xd')]('/',auth[_0x5dbf('0x9')](),controller['create']);router[_0x5dbf('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x5dbf('0xf')]);router['delete']('/:id',auth[_0x5dbf('0x9')](),controller['destroy']);module[_0x5dbf('0x10')]=router;
\ No newline at end of file
+var _0xdc97=['get','isAuthenticated','describe','/:id','show','create','put','update','delete','multer','util','path','express','fs-extra','../../components/auth/service','../../config/environment','./voiceCallReport.controller'];(function(_0x198541,_0x2e1dea){var _0x24c19a=function(_0x28f701){while(--_0x28f701){_0x198541['push'](_0x198541['shift']());}};_0x24c19a(++_0x2e1dea);}(_0xdc97,0x13b));var _0x7dc9=function(_0x153f4f,_0x2a0688){_0x153f4f=_0x153f4f-0x0;var _0x1911da=_0xdc97[_0x153f4f];return _0x1911da;};'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
index 737a4ec..0093b3a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3145=['STRING','ENUM','inbound','internal','outbound','inbound-fax','outbound-fax','DATE','INTEGER','exports'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x3145,0xc7));var _0x5314=function(_0x4c470b,_0x139581){_0x4c470b=_0x4c470b-0x0;var _0x16d4e8=_0x3145[_0x4c470b];return _0x16d4e8;};'use strict';var Sequelize=require('sequelize');module[_0x5314('0x0')]={'uniqueid':{'type':Sequelize[_0x5314('0x1')]},'type':{'type':Sequelize[_0x5314('0x2')](_0x5314('0x3'),_0x5314('0x4'),_0x5314('0x5'),_0x5314('0x6'),_0x5314('0x7'),'dialer')},'tag':{'type':Sequelize[_0x5314('0x1')]},'accountcode':{'type':Sequelize['STRING']},'source':{'type':Sequelize[_0x5314('0x1')]},'destination':{'type':Sequelize[_0x5314('0x1')]},'destinationcontext':{'type':Sequelize[_0x5314('0x1')]},'callerid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x5314('0x1')]},'destinationchannel':{'type':Sequelize[_0x5314('0x1')]},'lastapplication':{'type':Sequelize[_0x5314('0x1')]},'lastdata':{'type':Sequelize['TEXT']},'starttime':{'type':Sequelize[_0x5314('0x8')]},'systemanswertime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x5314('0x8')]},'endtime':{'type':Sequelize[_0x5314('0x8')]},'duration':{'type':Sequelize[_0x5314('0x9')]},'billableseconds':{'type':Sequelize[_0x5314('0x9')]},'mohtime':{'type':Sequelize[_0x5314('0x9')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x5314('0x1')]},'amaflags':{'type':Sequelize[_0x5314('0x1')]},'userfield':{'type':Sequelize[_0x5314('0x1')]},'userDisposition':{'type':Sequelize[_0x5314('0x1')]},'userSecondDisposition':{'type':Sequelize[_0x5314('0x1')]},'userThirdDisposition':{'type':Sequelize[_0x5314('0x1')]},'note':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0x5314('0x1')]},'routeid':{'type':Sequelize[_0x5314('0x9')]},'sipcallid':{'type':Sequelize[_0x5314('0x1')]}};
\ No newline at end of file
+var _0xe5ff=['exports','STRING','ENUM','inbound','internal','outbound','inbound-fax','outbound-fax','dialer','DATE','INTEGER','sequelize'];(function(_0x561c51,_0x428fb6){var _0x5949c4=function(_0x2ef04f){while(--_0x2ef04f){_0x561c51['push'](_0x561c51['shift']());}};_0x5949c4(++_0x428fb6);}(_0xe5ff,0x197));var _0xfe5f=function(_0x394be9,_0x588d2d){_0x394be9=_0x394be9-0x0;var _0x2229fb=_0xe5ff[_0x394be9];return _0x2229fb;};'use strict';var Sequelize=require(_0xfe5f('0x0'));module[_0xfe5f('0x1')]={'uniqueid':{'type':Sequelize[_0xfe5f('0x2')]},'type':{'type':Sequelize[_0xfe5f('0x3')](_0xfe5f('0x4'),_0xfe5f('0x5'),_0xfe5f('0x6'),_0xfe5f('0x7'),_0xfe5f('0x8'),_0xfe5f('0x9'))},'tag':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xfe5f('0x2')]},'source':{'type':Sequelize[_0xfe5f('0x2')]},'destination':{'type':Sequelize[_0xfe5f('0x2')]},'destinationcontext':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xfe5f('0x2')]},'channel':{'type':Sequelize['STRING']},'destinationchannel':{'type':Sequelize[_0xfe5f('0x2')]},'lastapplication':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize['TEXT']},'starttime':{'type':Sequelize['DATE']},'systemanswertime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0xfe5f('0xa')]},'endtime':{'type':Sequelize[_0xfe5f('0xa')]},'duration':{'type':Sequelize[_0xfe5f('0xb')]},'billableseconds':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0xfe5f('0x2')]},'userfield':{'type':Sequelize[_0xfe5f('0x2')]},'userDisposition':{'type':Sequelize[_0xfe5f('0x2')]},'userSecondDisposition':{'type':Sequelize['STRING']},'userThirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xfe5f('0x2')]},'prefix':{'type':Sequelize[_0xfe5f('0x2')]},'routeid':{'type':Sequelize['INTEGER']},'sipcallid':{'type':Sequelize[_0xfe5f('0x2')]}};
\ No newline at end of file
index 92bbf8b..8cdfd7a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2ef3=['pick','filter','merge','options','VoiceCallReport','then','includeAll','include','fullname','alias','User','findAll','rows','catch','show','params','keys','find','create','destroy','describe','body','uniqueid','user','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where'];(function(_0x1f36bb,_0x8af718){var _0xaf97fa=function(_0xeca489){while(--_0xeca489){_0x1f36bb['push'](_0x1f36bb['shift']());}};_0xaf97fa(++_0x8af718);}(_0x2ef3,0xba));var _0x32ef=function(_0x5ec53d,_0x368d91){_0x5ec53d=_0x5ec53d-0x0;var _0x5c7088=_0x2ef3[_0x5ec53d];return _0x5c7088;};'use strict';var emlformat=require(_0x32ef('0x0'));var rimraf=require(_0x32ef('0x1'));var zipdir=require(_0x32ef('0x2'));var jsonpatch=require(_0x32ef('0x3'));var rp=require(_0x32ef('0x4'));var moment=require(_0x32ef('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x32ef('0x6'));var util=require(_0x32ef('0x7'));var path=require('path');var sox=require(_0x32ef('0x8'));var csv=require(_0x32ef('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x32ef('0xa'));var squel=require(_0x32ef('0xb'));var crypto=require(_0x32ef('0xc'));var jsforce=require(_0x32ef('0xd'));var deskjs=require(_0x32ef('0xe'));var toCsv=require(_0x32ef('0x9'));var querystring=require(_0x32ef('0xf'));var Papa=require(_0x32ef('0x10'));var Redis=require(_0x32ef('0x11'));var authService=require(_0x32ef('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x32ef('0x13'));var logger=require(_0x32ef('0x14'))(_0x32ef('0x15'));var utils=require(_0x32ef('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x32ef('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1a5106,_0x49d590){_0x49d590=_0x49d590||0xcc;return function(_0x3e98df){if(_0x3e98df){return _0x1a5106[_0x32ef('0x18')](_0x49d590);}return _0x1a5106['status'](_0x49d590)['end']();};}function respondWithResult(_0x19ce1,_0x4d8009){_0x4d8009=_0x4d8009||0xc8;return function(_0x326fce){if(_0x326fce){return _0x19ce1[_0x32ef('0x19')](_0x4d8009)[_0x32ef('0x1a')](_0x326fce);}};}function respondWithFilteredResult(_0x54c7f5,_0x57aff1){return function(_0x55bf0b){if(_0x55bf0b){var _0x531e30=typeof _0x57aff1[_0x32ef('0x1b')]===_0x32ef('0x1c')&&typeof _0x57aff1[_0x32ef('0x1d')]==='undefined';var _0x5d559b=_0x55bf0b[_0x32ef('0x1e')];var _0x1a9476=_0x531e30?0x0:_0x57aff1[_0x32ef('0x1b')];var _0x57863c=_0x531e30?_0x55bf0b[_0x32ef('0x1e')]:_0x57aff1[_0x32ef('0x1b')]+_0x57aff1['limit'];var _0x304505;if(_0x57863c>=_0x5d559b){_0x57863c=_0x5d559b;_0x304505=0xc8;}else{_0x304505=0xce;}_0x54c7f5[_0x32ef('0x19')](_0x304505);return _0x54c7f5[_0x32ef('0x1f')](_0x32ef('0x20'),_0x1a9476+'-'+_0x57863c+'/'+_0x5d559b)[_0x32ef('0x1a')](_0x55bf0b);}return null;};}function patchUpdates(_0x3aec05){return function(_0x4de441){try{jsonpatch[_0x32ef('0x21')](_0x4de441,_0x3aec05,!![]);}catch(_0x5cc3ef){return BPromise[_0x32ef('0x22')](_0x5cc3ef);}return _0x4de441[_0x32ef('0x23')]();};}function saveUpdates(_0x49f2d8,_0x1af371){return function(_0x97780){if(_0x97780){return _0x97780[_0x32ef('0x24')](_0x49f2d8)['then'](function(_0x57f5e5){return _0x57f5e5;});}return null;};}function removeEntity(_0x22f2d7,_0xb30fab){return function(_0x225feb){if(_0x225feb){return _0x225feb['destroy']()['then'](function(){_0x22f2d7[_0x32ef('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51a412,_0x278495){return function(_0x14d4b3){if(!_0x14d4b3){_0x51a412[_0x32ef('0x18')](0x194);}return _0x14d4b3;};}function handleError(_0x1dbe98,_0x15ce54){_0x15ce54=_0x15ce54||0x1f4;return function(_0x234175){logger[_0x32ef('0x25')](_0x234175[_0x32ef('0x26')]);if(_0x234175[_0x32ef('0x27')]){delete _0x234175[_0x32ef('0x27')];}_0x1dbe98[_0x32ef('0x19')](_0x15ce54)[_0x32ef('0x28')](_0x234175);};}exports['index']=function(_0xd65fde,_0x2f5d06){var _0x5a04cd={},_0x12de1a={},_0x3c569d={'count':0x0,'rows':[]};var _0x30b250=_[_0x32ef('0x29')](db['VoiceCallReport'][_0x32ef('0x2a')],function(_0x22bf86){return{'name':_0x22bf86[_0x32ef('0x2b')],'type':_0x22bf86[_0x32ef('0x2c')][_0x32ef('0x2d')]};});_0x12de1a[_0x32ef('0x2e')]=_[_0x32ef('0x29')](_0x30b250,'name');_0x12de1a[_0x32ef('0x2f')]=_['keys'](_0xd65fde[_0x32ef('0x2f')]);_0x12de1a[_0x32ef('0x30')]=_['intersection'](_0x12de1a[_0x32ef('0x2e')],_0x12de1a[_0x32ef('0x2f')]);_0x5a04cd[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0x12de1a[_0x32ef('0x2e')],qs['fields'](_0xd65fde['query'][_0x32ef('0x33')]));_0x5a04cd['attributes']=_0x5a04cd[_0x32ef('0x31')][_0x32ef('0x34')]?_0x5a04cd[_0x32ef('0x31')]:_0x12de1a[_0x32ef('0x2e')];if(!_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x35')]('nolimit')){_0x5a04cd['limit']=qs['limit'](_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x1d')]);_0x5a04cd[_0x32ef('0x1b')]=qs['offset'](_0xd65fde['query'][_0x32ef('0x1b')]);}_0x5a04cd[_0x32ef('0x36')]=qs[_0x32ef('0x37')](_0xd65fde['query']['sort']);_0x5a04cd[_0x32ef('0x38')]=qs[_0x32ef('0x30')](_[_0x32ef('0x39')](_0xd65fde[_0x32ef('0x2f')],_0x12de1a[_0x32ef('0x30')]),_0x30b250);if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]){_0x5a04cd[_0x32ef('0x38')]=_[_0x32ef('0x3b')](_0x5a04cd['where'],{'$or':_[_0x32ef('0x29')](_0x30b250,function(_0x36e374){if(_0x36e374[_0x32ef('0x2c')]!=='VIRTUAL'){var _0x365125={};_0x365125[_0x36e374[_0x32ef('0x27')]]={'$like':'%'+_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]+'%'};return _0x365125;}})});}_0x5a04cd=_[_0x32ef('0x3b')]({},_0x5a04cd,_0xd65fde[_0x32ef('0x3c')]);var _0x256c40={'where':_0x5a04cd[_0x32ef('0x38')]};return db[_0x32ef('0x3d')][_0x32ef('0x1e')](_0x256c40)[_0x32ef('0x3e')](function(_0x4615b4){_0x3c569d['count']=_0x4615b4;if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3f')]){_0x5a04cd[_0x32ef('0x40')]=[{'attributes':['id',_0x32ef('0x27'),_0x32ef('0x41'),_0x32ef('0x42')],'model':db[_0x32ef('0x43')],'as':'User'}];}return db['VoiceCallReport'][_0x32ef('0x44')](_0x5a04cd);})[_0x32ef('0x3e')](function(_0x2a33dd){_0x3c569d[_0x32ef('0x45')]=_0x2a33dd;return _0x3c569d;})['then'](respondWithFilteredResult(_0x2f5d06,_0x5a04cd))[_0x32ef('0x46')](handleError(_0x2f5d06,null));};exports[_0x32ef('0x47')]=function(_0x5d2f06,_0x4744ba){var _0x4bc5bc={'raw':!![],'where':{'id':_0x5d2f06[_0x32ef('0x48')]['id']}},_0xcb3c08={};_0xcb3c08[_0x32ef('0x2e')]=_[_0x32ef('0x49')](db[_0x32ef('0x3d')][_0x32ef('0x2a')]);_0xcb3c08[_0x32ef('0x2f')]=_[_0x32ef('0x49')](_0x5d2f06[_0x32ef('0x2f')]);_0xcb3c08[_0x32ef('0x30')]=_['intersection'](_0xcb3c08[_0x32ef('0x2e')],_0xcb3c08['query']);_0x4bc5bc[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0xcb3c08[_0x32ef('0x2e')],qs['fields'](_0x5d2f06[_0x32ef('0x2f')][_0x32ef('0x33')]));_0x4bc5bc[_0x32ef('0x31')]=_0x4bc5bc[_0x32ef('0x31')][_0x32ef('0x34')]?_0x4bc5bc[_0x32ef('0x31')]:_0xcb3c08[_0x32ef('0x2e')];if(_0x5d2f06['query']['includeAll']){_0x4bc5bc[_0x32ef('0x40')]=[{'all':!![]}];}_0x4bc5bc=_[_0x32ef('0x3b')]({},_0x4bc5bc,_0x5d2f06[_0x32ef('0x3c')]);return db[_0x32ef('0x3d')][_0x32ef('0x4a')](_0x4bc5bc)[_0x32ef('0x3e')](handleEntityNotFound(_0x4744ba,null))[_0x32ef('0x3e')](respondWithResult(_0x4744ba,null))[_0x32ef('0x46')](handleError(_0x4744ba,null));};exports[_0x32ef('0x4b')]=function(_0x1ebedf,_0x35a294){return db[_0x32ef('0x3d')][_0x32ef('0x4b')](_0x1ebedf['body'],{})[_0x32ef('0x3e')](respondWithResult(_0x35a294,0xc9))[_0x32ef('0x46')](handleError(_0x35a294,null));};exports[_0x32ef('0x4c')]=function(_0xd42609,_0x1cc9f3){return db[_0x32ef('0x3d')][_0x32ef('0x4a')]({'where':{'id':_0xd42609[_0x32ef('0x48')]['id']}})[_0x32ef('0x3e')](handleEntityNotFound(_0x1cc9f3,null))[_0x32ef('0x3e')](removeEntity(_0x1cc9f3,null))[_0x32ef('0x46')](handleError(_0x1cc9f3,null));};exports[_0x32ef('0x4d')]=function(_0x272377,_0x326445){return db[_0x32ef('0x3d')][_0x32ef('0x4d')]()[_0x32ef('0x3e')](respondWithResult(_0x326445,null))[_0x32ef('0x46')](handleError(_0x326445,null));};exports['update']=function(_0x515ac9,_0x179c2f){if(_0x515ac9[_0x32ef('0x4e')][_0x32ef('0x4f')]){delete _0x515ac9[_0x32ef('0x4e')][_0x32ef('0x4f')];}return db[_0x32ef('0x3d')][_0x32ef('0x4a')]({'where':{'uniqueid':_0x515ac9[_0x32ef('0x48')]['id'],'UserId':{'$or':[null,_0x515ac9[_0x32ef('0x50')]['id']]}}})[_0x32ef('0x3e')](handleEntityNotFound(_0x179c2f,null))[_0x32ef('0x3e')](saveUpdates(_0x515ac9['body'],null))[_0x32ef('0x3e')](respondWithResult(_0x179c2f,null))[_0x32ef('0x46')](handleError(_0x179c2f,null));};
\ No newline at end of file
+var _0x5f66=['../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','destroy','then','error','name','send','index','map','VoiceCallReport','rawAttributes','fieldName','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','merge','type','VIRTUAL','includeAll','include','fullname','alias','User','rows','catch','show','params','find','create','body','describe','uniqueid','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x5f66,0x1a0));var _0x65f6=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0x5f66[_0x278e3c];return _0x3e2d9b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x65f6('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x65f6('0x1'));var rp=require(_0x65f6('0x2'));var moment=require(_0x65f6('0x3'));var BPromise=require(_0x65f6('0x4'));var Mustache=require(_0x65f6('0x5'));var util=require('util');var path=require(_0x65f6('0x6'));var sox=require('sox');var csv=require(_0x65f6('0x7'));var ejs=require(_0x65f6('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x65f6('0x9'));var crypto=require(_0x65f6('0xa'));var jsforce=require(_0x65f6('0xb'));var deskjs=require(_0x65f6('0xc'));var toCsv=require(_0x65f6('0x7'));var querystring=require(_0x65f6('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x65f6('0xe'));var qs=require(_0x65f6('0xf'));var as=require(_0x65f6('0x10'));var hardwareService=require(_0x65f6('0x11'));var logger=require('../../config/logger')(_0x65f6('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x65f6('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x419819,_0x4862a5){_0x4862a5=_0x4862a5||0xcc;return function(_0x2f964a){if(_0x2f964a){return _0x419819[_0x65f6('0x14')](_0x4862a5);}return _0x419819[_0x65f6('0x15')](_0x4862a5)[_0x65f6('0x16')]();};}function respondWithResult(_0x369f96,_0x1d29fd){_0x1d29fd=_0x1d29fd||0xc8;return function(_0x44144b){if(_0x44144b){return _0x369f96[_0x65f6('0x15')](_0x1d29fd)[_0x65f6('0x17')](_0x44144b);}};}function respondWithFilteredResult(_0x3440af,_0x59154e){return function(_0x19b9ff){if(_0x19b9ff){var _0x49a913=typeof _0x59154e['offset']===_0x65f6('0x18')&&typeof _0x59154e[_0x65f6('0x19')]===_0x65f6('0x18');var _0x1c955c=_0x19b9ff[_0x65f6('0x1a')];var _0x1f974c=_0x49a913?0x0:_0x59154e[_0x65f6('0x1b')];var _0x18380e=_0x49a913?_0x19b9ff['count']:_0x59154e['offset']+_0x59154e[_0x65f6('0x19')];var _0x5b4055;if(_0x18380e>=_0x1c955c){_0x18380e=_0x1c955c;_0x5b4055=0xc8;}else{_0x5b4055=0xce;}_0x3440af['status'](_0x5b4055);return _0x3440af['set'](_0x65f6('0x1c'),_0x1f974c+'-'+_0x18380e+'/'+_0x1c955c)[_0x65f6('0x17')](_0x19b9ff);}return null;};}function patchUpdates(_0x5114a4){return function(_0x39e19f){try{jsonpatch[_0x65f6('0x1d')](_0x39e19f,_0x5114a4,!![]);}catch(_0xbee6a4){return BPromise[_0x65f6('0x1e')](_0xbee6a4);}return _0x39e19f[_0x65f6('0x1f')]();};}function saveUpdates(_0xc139c2,_0x581374){return function(_0x197a49){if(_0x197a49){return _0x197a49['update'](_0xc139c2)['then'](function(_0x212247){return _0x212247;});}return null;};}function removeEntity(_0xd173f4,_0x524e42){return function(_0x1eeaaa){if(_0x1eeaaa){return _0x1eeaaa[_0x65f6('0x20')]()[_0x65f6('0x21')](function(){_0xd173f4[_0x65f6('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9d7bb0,_0x59ea32){return function(_0x20a161){if(!_0x20a161){_0x9d7bb0['sendStatus'](0x194);}return _0x20a161;};}function handleError(_0x5cb131,_0x4fde2f){_0x4fde2f=_0x4fde2f||0x1f4;return function(_0x29abdb){logger[_0x65f6('0x22')](_0x29abdb['stack']);if(_0x29abdb[_0x65f6('0x23')]){delete _0x29abdb[_0x65f6('0x23')];}_0x5cb131['status'](_0x4fde2f)[_0x65f6('0x24')](_0x29abdb);};}exports[_0x65f6('0x25')]=function(_0x28d0df,_0x559330){var _0x4ac04b={},_0x488d36={},_0x266cfe={'count':0x0,'rows':[]};var _0x3c032f=_[_0x65f6('0x26')](db[_0x65f6('0x27')][_0x65f6('0x28')],function(_0x14a387){return{'name':_0x14a387[_0x65f6('0x29')],'type':_0x14a387['type']['key']};});_0x488d36[_0x65f6('0x2a')]=_[_0x65f6('0x26')](_0x3c032f,'name');_0x488d36['query']=_[_0x65f6('0x2b')](_0x28d0df[_0x65f6('0x2c')]);_0x488d36[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x488d36[_0x65f6('0x2a')],_0x488d36[_0x65f6('0x2c')]);_0x4ac04b['attributes']=_[_0x65f6('0x2e')](_0x488d36[_0x65f6('0x2a')],qs[_0x65f6('0x2f')](_0x28d0df['query'][_0x65f6('0x2f')]));_0x4ac04b[_0x65f6('0x30')]=_0x4ac04b[_0x65f6('0x30')][_0x65f6('0x31')]?_0x4ac04b[_0x65f6('0x30')]:_0x488d36[_0x65f6('0x2a')];if(!_0x28d0df['query'][_0x65f6('0x32')](_0x65f6('0x33'))){_0x4ac04b['limit']=qs[_0x65f6('0x19')](_0x28d0df['query'][_0x65f6('0x19')]);_0x4ac04b['offset']=qs[_0x65f6('0x1b')](_0x28d0df[_0x65f6('0x2c')]['offset']);}_0x4ac04b[_0x65f6('0x34')]=qs[_0x65f6('0x35')](_0x28d0df[_0x65f6('0x2c')]['sort']);_0x4ac04b['where']=qs[_0x65f6('0x2d')](_['pick'](_0x28d0df[_0x65f6('0x2c')],_0x488d36['filters']),_0x3c032f);if(_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x36')]){_0x4ac04b['where']=_[_0x65f6('0x37')](_0x4ac04b['where'],{'$or':_['map'](_0x3c032f,function(_0x71b16b){if(_0x71b16b[_0x65f6('0x38')]!==_0x65f6('0x39')){var _0x313be5={};_0x313be5[_0x71b16b[_0x65f6('0x23')]]={'$like':'%'+_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x36')]+'%'};return _0x313be5;}})});}_0x4ac04b=_[_0x65f6('0x37')]({},_0x4ac04b,_0x28d0df['options']);var _0x3aa254={'where':_0x4ac04b['where']};return db[_0x65f6('0x27')][_0x65f6('0x1a')](_0x3aa254)[_0x65f6('0x21')](function(_0x2ea7f7){_0x266cfe['count']=_0x2ea7f7;if(_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x4ac04b[_0x65f6('0x3b')]=[{'attributes':['id',_0x65f6('0x23'),_0x65f6('0x3c'),_0x65f6('0x3d')],'model':db[_0x65f6('0x3e')],'as':_0x65f6('0x3e')}];}return db[_0x65f6('0x27')]['findAll'](_0x4ac04b);})[_0x65f6('0x21')](function(_0x400ed2){_0x266cfe[_0x65f6('0x3f')]=_0x400ed2;return _0x266cfe;})[_0x65f6('0x21')](respondWithFilteredResult(_0x559330,_0x4ac04b))[_0x65f6('0x40')](handleError(_0x559330,null));};exports[_0x65f6('0x41')]=function(_0xe0b72d,_0x2e91e8){var _0x461393={'raw':!![],'where':{'id':_0xe0b72d[_0x65f6('0x42')]['id']}},_0x2abbed={};_0x2abbed[_0x65f6('0x2a')]=_[_0x65f6('0x2b')](db[_0x65f6('0x27')][_0x65f6('0x28')]);_0x2abbed[_0x65f6('0x2c')]=_['keys'](_0xe0b72d[_0x65f6('0x2c')]);_0x2abbed[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x2abbed[_0x65f6('0x2a')],_0x2abbed['query']);_0x461393[_0x65f6('0x30')]=_[_0x65f6('0x2e')](_0x2abbed[_0x65f6('0x2a')],qs['fields'](_0xe0b72d[_0x65f6('0x2c')][_0x65f6('0x2f')]));_0x461393[_0x65f6('0x30')]=_0x461393[_0x65f6('0x30')]['length']?_0x461393[_0x65f6('0x30')]:_0x2abbed['model'];if(_0xe0b72d[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x461393['include']=[{'all':!![]}];}_0x461393=_[_0x65f6('0x37')]({},_0x461393,_0xe0b72d['options']);return db[_0x65f6('0x27')][_0x65f6('0x43')](_0x461393)[_0x65f6('0x21')](handleEntityNotFound(_0x2e91e8,null))[_0x65f6('0x21')](respondWithResult(_0x2e91e8,null))[_0x65f6('0x40')](handleError(_0x2e91e8,null));};exports[_0x65f6('0x44')]=function(_0x4d30c5,_0x51bf6c){return db[_0x65f6('0x27')][_0x65f6('0x44')](_0x4d30c5[_0x65f6('0x45')],{})[_0x65f6('0x21')](respondWithResult(_0x51bf6c,0xc9))[_0x65f6('0x40')](handleError(_0x51bf6c,null));};exports[_0x65f6('0x20')]=function(_0x149c28,_0x41690c){return db[_0x65f6('0x27')]['find']({'where':{'id':_0x149c28[_0x65f6('0x42')]['id']}})[_0x65f6('0x21')](handleEntityNotFound(_0x41690c,null))[_0x65f6('0x21')](removeEntity(_0x41690c,null))['catch'](handleError(_0x41690c,null));};exports[_0x65f6('0x46')]=function(_0x42d453,_0x49ba5a){return db[_0x65f6('0x27')][_0x65f6('0x46')]()['then'](respondWithResult(_0x49ba5a,null))[_0x65f6('0x40')](handleError(_0x49ba5a,null));};exports['update']=function(_0x247be3,_0x3b241f){if(_0x247be3[_0x65f6('0x45')]['uniqueid']){delete _0x247be3[_0x65f6('0x45')][_0x65f6('0x47')];}return db['VoiceCallReport'][_0x65f6('0x43')]({'where':{'uniqueid':_0x247be3[_0x65f6('0x42')]['id'],'UserId':{'$or':[null,_0x247be3['user']['id']]}}})[_0x65f6('0x21')](handleEntityNotFound(_0x3b241f,null))[_0x65f6('0x21')](saveUpdates(_0x247be3[_0x65f6('0x45')],null))[_0x65f6('0x21')](respondWithResult(_0x3b241f,null))[_0x65f6('0x40')](handleError(_0x3b241f,null));};
\ No newline at end of file
index a61dc21..3a962d8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd9f5=['define','VoiceCallReport','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./voiceCallReport.attributes'];(function(_0x2178ae,_0x22e2df){var _0x2969c3=function(_0x1bfee1){while(--_0x1bfee1){_0x2178ae['push'](_0x2178ae['shift']());}};_0x2969c3(++_0x22e2df);}(_0xd9f5,0x92));var _0x5d9f=function(_0x24f5b1,_0x350007){_0x24f5b1=_0x24f5b1-0x0;var _0x451a13=_0xd9f5[_0x24f5b1];return _0x451a13;};'use strict';var _=require(_0x5d9f('0x0'));var util=require(_0x5d9f('0x1'));var logger=require(_0x5d9f('0x2'))(_0x5d9f('0x3'));var moment=require(_0x5d9f('0x4'));var BPromise=require(_0x5d9f('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5d9f('0x6'));var rimraf=require(_0x5d9f('0x7'));var config=require(_0x5d9f('0x8'));var attributes=require(_0x5d9f('0x9'));module['exports']=function(_0x2b4b,_0x337d75){return _0x2b4b[_0x5d9f('0xa')](_0x5d9f('0xb'),attributes,{'tableName':'report_call','paranoid':![],'indexes':[{'fields':[_0x5d9f('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xef98=['../../config/logger','api','bluebird','path','rimraf','exports','define','report_call','uniqueid'];(function(_0x2e666f,_0x1bc5f3){var _0x455047=function(_0x269c89){while(--_0x269c89){_0x2e666f['push'](_0x2e666f['shift']());}};_0x455047(++_0x1bc5f3);}(_0xef98,0x1c2));var _0x8ef9=function(_0x854a02,_0x315dbd){_0x854a02=_0x854a02-0x0;var _0x265aa3=_0xef98[_0x854a02];return _0x265aa3;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x8ef9('0x0'))(_0x8ef9('0x1'));var moment=require('moment');var BPromise=require(_0x8ef9('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8ef9('0x3'));var rimraf=require(_0x8ef9('0x4'));var config=require('../../config/environment');var attributes=require('./voiceCallReport.attributes');module[_0x8ef9('0x5')]=function(_0x5df7ec,_0x1cab8c){return _0x5df7ec[_0x8ef9('0x6')]('VoiceCallReport',attributes,{'tableName':_0x8ef9('0x7'),'paranoid':![],'indexes':[{'fields':[_0x8ef9('0x8')]}],'timestamps':!![]});};
\ No newline at end of file
index 282f0ec..2a39257 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4ba1=['stringify','error','message','result','catch','VoiceCallReport','options','raw','where','attributes','limit','include','map','model','then','GetVoiceCallReport','body','CreateVoiceCallReport','UpdateVoiceCallReport','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','http','request','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s'];(function(_0x240ce3,_0x42b6b9){var _0x358e3a=function(_0x56685a){while(--_0x56685a){_0x240ce3['push'](_0x240ce3['shift']());}};_0x358e3a(++_0x42b6b9);}(_0x4ba1,0x9b));var _0x14ba=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x4ba1[_0x4b369d];return _0x571a98;};'use strict';var _=require(_0x14ba('0x0'));var util=require(_0x14ba('0x1'));var moment=require(_0x14ba('0x2'));var BPromise=require('bluebird');var rs=require(_0x14ba('0x3'));var fs=require('fs');var Redis=require(_0x14ba('0x4'));var db=require(_0x14ba('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x14ba('0x6'))('rpc');var config=require(_0x14ba('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x14ba('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x173cc9,_0x3ef70c,_0x1fc34b){return new BPromise(function(_0x277561,_0x19a6ba){return client[_0x14ba('0x9')](_0x173cc9,_0x1fc34b)['then'](function(_0x123d9a){logger[_0x14ba('0xa')](_0x14ba('0xb'),_0x3ef70c,_0x14ba('0xc'));logger[_0x14ba('0xd')](_0x14ba('0xe'),_0x3ef70c,'request\x20sent',JSON[_0x14ba('0xf')](_0x123d9a));if(_0x123d9a[_0x14ba('0x10')]){if(_0x123d9a['error']['code']===0x1f4){logger[_0x14ba('0x10')](_0x14ba('0xb'),_0x3ef70c,_0x123d9a['error'][_0x14ba('0x11')]);return _0x19a6ba(_0x123d9a[_0x14ba('0x10')]['message']);}logger[_0x14ba('0x10')]('VoiceCallReport,\x20%s,\x20%s',_0x3ef70c,_0x123d9a[_0x14ba('0x10')]['message']);return _0x277561(_0x123d9a[_0x14ba('0x10')][_0x14ba('0x11')]);}else{logger[_0x14ba('0xa')](_0x14ba('0xb'),_0x3ef70c,_0x14ba('0xc'));_0x277561(_0x123d9a[_0x14ba('0x12')][_0x14ba('0x11')]);}})[_0x14ba('0x13')](function(_0x22094b){logger[_0x14ba('0x10')](_0x14ba('0xb'),_0x3ef70c,_0x22094b);_0x19a6ba(_0x22094b);});});}exports['GetVoiceCallReport']=function(_0x40ce01){var _0x433ee1=this;return new Promise(function(_0x5287ce,_0x34502b){return db[_0x14ba('0x14')]['findAll']({'raw':_0x40ce01[_0x14ba('0x15')]?_0x40ce01[_0x14ba('0x15')][_0x14ba('0x16')]===undefined?!![]:![]:!![],'where':_0x40ce01[_0x14ba('0x15')]?_0x40ce01[_0x14ba('0x15')][_0x14ba('0x17')]||null:null,'attributes':_0x40ce01['options']?_0x40ce01[_0x14ba('0x15')][_0x14ba('0x18')]||null:null,'limit':_0x40ce01['options']?_0x40ce01[_0x14ba('0x15')][_0x14ba('0x19')]||null:null,'include':_0x40ce01['options']?_0x40ce01['options'][_0x14ba('0x1a')]?_[_0x14ba('0x1b')](_0x40ce01[_0x14ba('0x15')]['include'],function(_0x27d220){return{'model':db[_0x27d220[_0x14ba('0x1c')]],'as':_0x27d220['as'],'attributes':_0x27d220[_0x14ba('0x18')],'include':_0x27d220[_0x14ba('0x1a')]?_[_0x14ba('0x1b')](_0x27d220[_0x14ba('0x1a')],function(_0x2827ad){return{'model':db[_0x2827ad['model']],'as':_0x2827ad['as'],'attributes':_0x2827ad[_0x14ba('0x18')],'include':_0x2827ad[_0x14ba('0x1a')]?_['map'](_0x2827ad['include'],function(_0x4e4095){return{'model':db[_0x4e4095[_0x14ba('0x1c')]],'as':_0x4e4095['as'],'attributes':_0x4e4095[_0x14ba('0x18')]};}):[]};}):[]};}):[]:[]})[_0x14ba('0x1d')](function(_0x4377f5){logger[_0x14ba('0xa')](_0x14ba('0x1e'),_0x40ce01);logger[_0x14ba('0xd')](_0x14ba('0x1e'),_0x40ce01,JSON['stringify'](_0x4377f5));_0x5287ce(_0x4377f5);})['catch'](function(_0x19a2bc){logger[_0x14ba('0x10')](_0x14ba('0x1e'),_0x19a2bc[_0x14ba('0x11')],_0x40ce01);_0x34502b(_0x433ee1[_0x14ba('0x10')](0x1f4,_0x19a2bc['message']));});});};exports['CreateVoiceCallReport']=function(_0x313500){var _0x233bc0=this;return new Promise(function(_0x188c67,_0x28e735){return db[_0x14ba('0x14')]['create'](_0x313500[_0x14ba('0x1f')],{'raw':_0x313500[_0x14ba('0x15')]?_0x313500[_0x14ba('0x15')]['raw']===undefined?!![]:![]:!![]})[_0x14ba('0x1d')](function(_0xa377){logger['info']('CreateVoiceCallReport',_0x313500);logger[_0x14ba('0xd')](_0x14ba('0x20'),_0x313500,JSON[_0x14ba('0xf')](_0xa377));_0x188c67(_0xa377);})[_0x14ba('0x13')](function(_0x30294d){logger['error'](_0x14ba('0x20'),_0x30294d[_0x14ba('0x11')],_0x313500);_0x28e735(_0x233bc0[_0x14ba('0x10')](0x1f4,_0x30294d[_0x14ba('0x11')]));});});};exports[_0x14ba('0x21')]=function(_0x413917){var _0x1382a3=this;return new Promise(function(_0x47f320,_0x26535d){return db[_0x14ba('0x14')]['update'](_0x413917['body'],{'raw':_0x413917[_0x14ba('0x15')]?_0x413917[_0x14ba('0x15')][_0x14ba('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x413917[_0x14ba('0x15')]?_0x413917[_0x14ba('0x15')][_0x14ba('0x17')]||null:null,'attributes':_0x413917[_0x14ba('0x15')]?_0x413917[_0x14ba('0x15')][_0x14ba('0x18')]||null:null,'limit':_0x413917[_0x14ba('0x15')]?_0x413917[_0x14ba('0x15')][_0x14ba('0x19')]||null:null})[_0x14ba('0x1d')](function(_0x12562e){logger[_0x14ba('0xa')](_0x14ba('0x21'),_0x413917);logger['debug']('UpdateVoiceCallReport',_0x413917,JSON[_0x14ba('0xf')](_0x12562e));_0x47f320(_0x12562e);})[_0x14ba('0x13')](function(_0x2661f2){logger[_0x14ba('0x10')](_0x14ba('0x21'),_0x2661f2['message'],_0x413917);_0x26535d(_0x1382a3[_0x14ba('0x10')](0x1f4,_0x2661f2[_0x14ba('0x11')]));});});};
\ No newline at end of file
+var _0x9882=['include','map','model','VoiceCallReport','create','body','CreateVoiceCallReport','UpdateVoiceCallReport','update','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetVoiceCallReport','findAll','options','raw','attributes','limit'];(function(_0x3e8199,_0x35e076){var _0x1a51da=function(_0xb47928){while(--_0xb47928){_0x3e8199['push'](_0x3e8199['shift']());}};_0x1a51da(++_0x35e076);}(_0x9882,0x139));var _0x2988=function(_0x35ee13,_0x39b512){_0x35ee13=_0x35ee13-0x0;var _0x3ebaad=_0x9882[_0x35ee13];return _0x3ebaad;};'use strict';var _=require(_0x2988('0x0'));var util=require(_0x2988('0x1'));var moment=require(_0x2988('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2988('0x3'));var db=require(_0x2988('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x2988('0x5'))(_0x2988('0x6'));var config=require('../../config/environment');var jayson=require(_0x2988('0x7'));var client=jayson[_0x2988('0x8')][_0x2988('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2e3439,_0x547b94,_0x22263f){return new BPromise(function(_0x13074e,_0x527454){return client[_0x2988('0xa')](_0x2e3439,_0x22263f)[_0x2988('0xb')](function(_0x3028b7){logger['info'](_0x2988('0xc'),_0x547b94,_0x2988('0xd'));logger[_0x2988('0xe')](_0x2988('0xf'),_0x547b94,_0x2988('0xd'),JSON[_0x2988('0x10')](_0x3028b7));if(_0x3028b7[_0x2988('0x11')]){if(_0x3028b7[_0x2988('0x11')][_0x2988('0x12')]===0x1f4){logger[_0x2988('0x11')](_0x2988('0xc'),_0x547b94,_0x3028b7[_0x2988('0x11')][_0x2988('0x13')]);return _0x527454(_0x3028b7[_0x2988('0x11')][_0x2988('0x13')]);}logger[_0x2988('0x11')](_0x2988('0xc'),_0x547b94,_0x3028b7[_0x2988('0x11')][_0x2988('0x13')]);return _0x13074e(_0x3028b7['error'][_0x2988('0x13')]);}else{logger[_0x2988('0x14')](_0x2988('0xc'),_0x547b94,_0x2988('0xd'));_0x13074e(_0x3028b7[_0x2988('0x15')][_0x2988('0x13')]);}})[_0x2988('0x16')](function(_0x11ad45){logger['error'](_0x2988('0xc'),_0x547b94,_0x11ad45);_0x527454(_0x11ad45);});});}exports[_0x2988('0x17')]=function(_0x42706b){var _0xc9133=this;return new Promise(function(_0x2757b0,_0x3ad412){return db['VoiceCallReport'][_0x2988('0x18')]({'raw':_0x42706b[_0x2988('0x19')]?_0x42706b[_0x2988('0x19')][_0x2988('0x1a')]===undefined?!![]:![]:!![],'where':_0x42706b['options']?_0x42706b[_0x2988('0x19')]['where']||null:null,'attributes':_0x42706b['options']?_0x42706b[_0x2988('0x19')][_0x2988('0x1b')]||null:null,'limit':_0x42706b['options']?_0x42706b[_0x2988('0x19')][_0x2988('0x1c')]||null:null,'include':_0x42706b[_0x2988('0x19')]?_0x42706b[_0x2988('0x19')][_0x2988('0x1d')]?_[_0x2988('0x1e')](_0x42706b[_0x2988('0x19')][_0x2988('0x1d')],function(_0x352cf3){return{'model':db[_0x352cf3[_0x2988('0x1f')]],'as':_0x352cf3['as'],'attributes':_0x352cf3[_0x2988('0x1b')],'include':_0x352cf3['include']?_[_0x2988('0x1e')](_0x352cf3[_0x2988('0x1d')],function(_0x3d37be){return{'model':db[_0x3d37be[_0x2988('0x1f')]],'as':_0x3d37be['as'],'attributes':_0x3d37be[_0x2988('0x1b')],'include':_0x3d37be['include']?_[_0x2988('0x1e')](_0x3d37be['include'],function(_0x281115){return{'model':db[_0x281115['model']],'as':_0x281115['as'],'attributes':_0x281115[_0x2988('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x2988('0xb')](function(_0x49fcc1){logger[_0x2988('0x14')](_0x2988('0x17'),_0x42706b);logger[_0x2988('0xe')]('GetVoiceCallReport',_0x42706b,JSON[_0x2988('0x10')](_0x49fcc1));_0x2757b0(_0x49fcc1);})[_0x2988('0x16')](function(_0x1df082){logger[_0x2988('0x11')](_0x2988('0x17'),_0x1df082[_0x2988('0x13')],_0x42706b);_0x3ad412(_0xc9133[_0x2988('0x11')](0x1f4,_0x1df082[_0x2988('0x13')]));});});};exports['CreateVoiceCallReport']=function(_0x5070ab){var _0x555148=this;return new Promise(function(_0x18d654,_0x5ec039){return db[_0x2988('0x20')][_0x2988('0x21')](_0x5070ab[_0x2988('0x22')],{'raw':_0x5070ab[_0x2988('0x19')]?_0x5070ab[_0x2988('0x19')][_0x2988('0x1a')]===undefined?!![]:![]:!![]})[_0x2988('0xb')](function(_0x23ca20){logger[_0x2988('0x14')](_0x2988('0x23'),_0x5070ab);logger[_0x2988('0xe')](_0x2988('0x23'),_0x5070ab,JSON[_0x2988('0x10')](_0x23ca20));_0x18d654(_0x23ca20);})['catch'](function(_0x5b9261){logger['error'](_0x2988('0x23'),_0x5b9261['message'],_0x5070ab);_0x5ec039(_0x555148[_0x2988('0x11')](0x1f4,_0x5b9261[_0x2988('0x13')]));});});};exports[_0x2988('0x24')]=function(_0x340565){var _0x397d77=this;return new Promise(function(_0x34cb69,_0x5a0080){return db[_0x2988('0x20')][_0x2988('0x25')](_0x340565[_0x2988('0x22')],{'raw':_0x340565[_0x2988('0x19')]?_0x340565['options'][_0x2988('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x340565[_0x2988('0x19')]?_0x340565[_0x2988('0x19')]['where']||null:null,'attributes':_0x340565[_0x2988('0x19')]?_0x340565[_0x2988('0x19')][_0x2988('0x1b')]||null:null,'limit':_0x340565['options']?_0x340565[_0x2988('0x19')][_0x2988('0x1c')]||null:null})[_0x2988('0xb')](function(_0xad9a7a){logger[_0x2988('0x14')](_0x2988('0x24'),_0x340565);logger['debug']('UpdateVoiceCallReport',_0x340565,JSON['stringify'](_0xad9a7a));_0x34cb69(_0xad9a7a);})[_0x2988('0x16')](function(_0x2c2ff2){logger[_0x2988('0x11')]('UpdateVoiceCallReport',_0x2c2ff2[_0x2988('0x13')],_0x340565);_0x5a0080(_0x397d77[_0x2988('0x11')](0x1f4,_0x2c2ff2['message']));});});};
\ No newline at end of file
index c1e4f5f..bfd6edf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf84b=['isAuthenticated','index','create','/:id','update','multer','path','fs-extra','../../components/auth/service','../../config/environment','get'];(function(_0x4bae1a,_0x5b0916){var _0x27f6d2=function(_0x2204b2){while(--_0x2204b2){_0x4bae1a['push'](_0x4bae1a['shift']());}};_0x27f6d2(++_0x5b0916);}(_0xf84b,0x139));var _0xbf84=function(_0x7e41fd,_0x258522){_0x7e41fd=_0x7e41fd-0x0;var _0x34e127=_0xf84b[_0x7e41fd];return _0x34e127;};'use strict';var multer=require(_0xbf84('0x0'));var util=require('util');var path=require(_0xbf84('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xbf84('0x2'));var auth=require(_0xbf84('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xbf84('0x4'));var controller=require('./voiceChanSpy.controller');router[_0xbf84('0x5')]('/',auth[_0xbf84('0x6')](),controller[_0xbf84('0x7')]);router[_0xbf84('0x5')]('/:id',auth[_0xbf84('0x6')](),controller['show']);router['post']('/',auth[_0xbf84('0x6')](),controller[_0xbf84('0x8')]);router['put'](_0xbf84('0x9'),auth[_0xbf84('0x6')](),controller[_0xbf84('0xa')]);router['delete'](_0xbf84('0x9'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x184c=['./voiceChanSpy.controller','get','index','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x389c78,_0x1a872e){var _0x9cea6e=function(_0x9858ee){while(--_0x9858ee){_0x389c78['push'](_0x389c78['shift']());}};_0x9cea6e(++_0x1a872e);}(_0x184c,0x148));var _0xc184=function(_0x4c7662,_0x4813b3){_0x4c7662=_0x4c7662-0x0;var _0x8da52a=_0x184c[_0x4c7662];return _0x8da52a;};'use strict';var multer=require('multer');var util=require(_0xc184('0x0'));var path=require(_0xc184('0x1'));var timeout=require(_0xc184('0x2'));var express=require(_0xc184('0x3'));var router=express[_0xc184('0x4')]();var fs_extra=require(_0xc184('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xc184('0x6'));var config=require(_0xc184('0x7'));var controller=require(_0xc184('0x8'));router[_0xc184('0x9')]('/',auth['isAuthenticated'](),controller[_0xc184('0xa')]);router[_0xc184('0x9')](_0xc184('0xb'),auth[_0xc184('0xc')](),controller[_0xc184('0xd')]);router[_0xc184('0xe')]('/',auth[_0xc184('0xc')](),controller[_0xc184('0xf')]);router[_0xc184('0x10')](_0xc184('0xb'),auth[_0xc184('0xc')](),controller[_0xc184('0x11')]);router[_0xc184('0x12')]('/:id',auth[_0xc184('0xc')](),controller[_0xc184('0x13')]);module[_0xc184('0x14')]=router;
\ No newline at end of file
index 2005462..762972e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9dce=['name','setDataValue','options','join','getDataValue','split','BOOLEAN','STRING'];(function(_0x30295d,_0x3d39b0){var _0x18cfac=function(_0x33ce9a){while(--_0x33ce9a){_0x30295d['push'](_0x30295d['shift']());}};_0x18cfac(++_0x3d39b0);}(_0x9dce,0x177));var _0xe9dc=function(_0x1a1cc4,_0x7064e6){_0x1a1cc4=_0x1a1cc4-0x0;var _0x3cce34=_0x9dce[_0x1a1cc4];return _0x3cce34;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xe9dc('0x0')]},'prefix':{'type':Sequelize[_0xe9dc('0x0')],'unique':_0xe9dc('0x1'),'allowNull':![]},'options':{'type':Sequelize[_0xe9dc('0x0')],'set':function(_0x34d3a6){this[_0xe9dc('0x2')](_0xe9dc('0x3'),_0x34d3a6?_0x34d3a6[_0xe9dc('0x4')](''):[]);},'get':function(){return this[_0xe9dc('0x5')](_0xe9dc('0x3'))?this[_0xe9dc('0x5')](_0xe9dc('0x3'))[_0xe9dc('0x6')](''):[];}},'auth':{'type':Sequelize[_0xe9dc('0x7')],'defaultValue':![]},'password':{'type':Sequelize[_0xe9dc('0x0')]},'record':{'type':Sequelize[_0xe9dc('0x7')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0xe9dc('0x0')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xcb2c=['join','getDataValue','BOOLEAN','sequelize','STRING','name','setDataValue','options'];(function(_0xb24a3e,_0x4a3594){var _0x4038d7=function(_0x1ea3c3){while(--_0x1ea3c3){_0xb24a3e['push'](_0xb24a3e['shift']());}};_0x4038d7(++_0x4a3594);}(_0xcb2c,0xab));var _0xccb2=function(_0x55e08b,_0x421620){_0x55e08b=_0x55e08b-0x0;var _0xd1a7ff=_0xcb2c[_0x55e08b];return _0xd1a7ff;};'use strict';var Sequelize=require(_0xccb2('0x0'));module['exports']={'name':{'type':Sequelize[_0xccb2('0x1')]},'prefix':{'type':Sequelize[_0xccb2('0x1')],'unique':_0xccb2('0x2'),'allowNull':![]},'options':{'type':Sequelize['STRING'],'set':function(_0x36d8e8){this[_0xccb2('0x3')](_0xccb2('0x4'),_0x36d8e8?_0x36d8e8[_0xccb2('0x5')](''):[]);},'get':function(){return this['getDataValue'](_0xccb2('0x4'))?this[_0xccb2('0x6')](_0xccb2('0x4'))['split'](''):[];}},'auth':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'password':{'type':Sequelize[_0xccb2('0x1')]},'record':{'type':Sequelize[_0xccb2('0x7')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0xccb2('0x1')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 6f765c9..329ad90 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4a3d=['ChanSpies','error','name','index','map','VoiceChanSpy','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','options','count','includeAll','findAll','show','params','merge','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','find','autoAssociation','UserProfileResource','catch','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'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x4a3d,0x79));var _0xd4a3=function(_0x334844,_0xf4d888){_0x334844=_0x334844-0x0;var _0x20f483=_0x4a3d[_0x334844];return _0x20f483;};'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(){var _0x345bac=_0x1a4ced['get']({'plain':!![]});var _0x35a871=_0xd4a3('0x27');return db['UserProfileResource'][_0xd4a3('0x26')]({'where':{'type':_0x35a871,'resourceId':_0x345bac['id']}})[_0xd4a3('0x25')](function(){return _0x1a4ced;});})[_0xd4a3('0x25')](function(){_0x2de130['status'](0xcc)[_0xd4a3('0x1d')]();});}};}function handleEntityNotFound(_0xf2c907,_0x20a845){return function(_0x586cd8){if(!_0x586cd8){_0xf2c907[_0xd4a3('0x1b')](0x194);}return _0x586cd8;};}function handleError(_0x52cb44,_0x2372ee){_0x2372ee=_0x2372ee||0x1f4;return function(_0x523871){logger[_0xd4a3('0x28')](_0x523871['stack']);if(_0x523871[_0xd4a3('0x29')]){delete _0x523871['name'];}_0x52cb44[_0xd4a3('0x1c')](_0x2372ee)['send'](_0x523871);};}exports[_0xd4a3('0x2a')]=function(_0x31baf2,_0x2f2e8d){var _0x318159={},_0x1f103d={},_0x5067fa={'count':0x0,'rows':[]};var _0x53ec2c=_[_0xd4a3('0x2b')](db[_0xd4a3('0x2c')][_0xd4a3('0x2d')],function(_0x168d9f){return{'name':_0x168d9f['fieldName'],'type':_0x168d9f[_0xd4a3('0x2e')][_0xd4a3('0x2f')]};});_0x1f103d['model']=_[_0xd4a3('0x2b')](_0x53ec2c,'name');_0x1f103d[_0xd4a3('0x30')]=_[_0xd4a3('0x31')](_0x31baf2[_0xd4a3('0x30')]);_0x1f103d[_0xd4a3('0x32')]=_[_0xd4a3('0x33')](_0x1f103d[_0xd4a3('0x34')],_0x1f103d[_0xd4a3('0x30')]);_0x318159[_0xd4a3('0x35')]=_[_0xd4a3('0x33')](_0x1f103d['model'],qs[_0xd4a3('0x36')](_0x31baf2[_0xd4a3('0x30')][_0xd4a3('0x36')]));_0x318159['attributes']=_0x318159[_0xd4a3('0x35')][_0xd4a3('0x37')]?_0x318159[_0xd4a3('0x35')]:_0x1f103d[_0xd4a3('0x34')];if(!_0x31baf2[_0xd4a3('0x30')][_0xd4a3('0x38')](_0xd4a3('0x39'))){_0x318159['limit']=qs[_0xd4a3('0x20')](_0x31baf2['query']['limit']);_0x318159[_0xd4a3('0x1e')]=qs[_0xd4a3('0x1e')](_0x31baf2[_0xd4a3('0x30')][_0xd4a3('0x1e')]);}_0x318159['order']=qs[_0xd4a3('0x3a')](_0x31baf2['query'][_0xd4a3('0x3a')]);_0x318159[_0xd4a3('0x3b')]=qs[_0xd4a3('0x32')](_[_0xd4a3('0x3c')](_0x31baf2['query'],_0x1f103d[_0xd4a3('0x32')]),_0x53ec2c);if(_0x31baf2[_0xd4a3('0x30')][_0xd4a3('0x3d')]){_0x318159[_0xd4a3('0x3b')]=_['merge'](_0x318159['where'],{'$or':_[_0xd4a3('0x2b')](_0x53ec2c,function(_0x244c7c){if(_0x244c7c[_0xd4a3('0x2e')]!==_0xd4a3('0x3e')){var _0x217b34={};_0x217b34[_0x244c7c[_0xd4a3('0x29')]]={'$like':'%'+_0x31baf2[_0xd4a3('0x30')]['filter']+'%'};return _0x217b34;}})});}_0x318159=_['merge']({},_0x318159,_0x31baf2[_0xd4a3('0x3f')]);var _0x26ab3a={'where':_0x318159[_0xd4a3('0x3b')]};return db[_0xd4a3('0x2c')][_0xd4a3('0x40')](_0x26ab3a)[_0xd4a3('0x25')](function(_0xcb013){_0x5067fa[_0xd4a3('0x40')]=_0xcb013;if(_0x31baf2[_0xd4a3('0x30')][_0xd4a3('0x41')]){_0x318159['include']=[{'all':!![]}];}return db[_0xd4a3('0x2c')][_0xd4a3('0x42')](_0x318159);})[_0xd4a3('0x25')](function(_0x40b847){_0x5067fa['rows']=_0x40b847;return _0x5067fa;})[_0xd4a3('0x25')](respondWithFilteredResult(_0x2f2e8d,_0x318159))['catch'](handleError(_0x2f2e8d,null));};exports[_0xd4a3('0x43')]=function(_0x4a968d,_0x1a2548){var _0x1f5ce2={'raw':![],'where':{'id':_0x4a968d[_0xd4a3('0x44')]['id']}},_0x1bbf98={};_0x1bbf98[_0xd4a3('0x34')]=_['keys'](db[_0xd4a3('0x2c')][_0xd4a3('0x2d')]);_0x1bbf98[_0xd4a3('0x30')]=_['keys'](_0x4a968d[_0xd4a3('0x30')]);_0x1bbf98[_0xd4a3('0x32')]=_['intersection'](_0x1bbf98[_0xd4a3('0x34')],_0x1bbf98[_0xd4a3('0x30')]);_0x1f5ce2[_0xd4a3('0x35')]=_[_0xd4a3('0x33')](_0x1bbf98[_0xd4a3('0x34')],qs['fields'](_0x4a968d['query'][_0xd4a3('0x36')]));_0x1f5ce2[_0xd4a3('0x35')]=_0x1f5ce2[_0xd4a3('0x35')][_0xd4a3('0x37')]?_0x1f5ce2[_0xd4a3('0x35')]:_0x1bbf98[_0xd4a3('0x34')];if(_0x4a968d[_0xd4a3('0x30')][_0xd4a3('0x41')]){_0x1f5ce2['include']=[{'all':!![]}];}_0x1f5ce2=_[_0xd4a3('0x45')]({},_0x1f5ce2,_0x4a968d[_0xd4a3('0x3f')]);return db['VoiceChanSpy']['find'](_0x1f5ce2)[_0xd4a3('0x25')](handleEntityNotFound(_0x1a2548,null))['then'](respondWithResult(_0x1a2548,null))['catch'](handleError(_0x1a2548,null));};exports[_0xd4a3('0x46')]=function(_0x3410e6,_0x1b0051){return db[_0xd4a3('0x2c')][_0xd4a3('0x46')](_0x3410e6[_0xd4a3('0x47')],{})['then'](function(_0x4a0e7f){var _0x58f931=_0x3410e6[_0xd4a3('0x48')]['get']({'plain':!![]});if(!_0x58f931)throw new Error(_0xd4a3('0x49'));if(_0x58f931[_0xd4a3('0x4a')]===_0xd4a3('0x48')){var _0x8668d=_0x4a0e7f[_0xd4a3('0x4b')]({'plain':!![]});var _0x1ec9a3=_0xd4a3('0x27');return db['UserProfileSection'][_0xd4a3('0x4c')]({'where':{'name':_0x1ec9a3,'userProfileId':_0x58f931['userProfileId']},'raw':!![]})[_0xd4a3('0x25')](function(_0x5665a0){if(_0x5665a0&&_0x5665a0[_0xd4a3('0x4d')]===0x0){return db[_0xd4a3('0x4e')]['create']({'name':_0x8668d[_0xd4a3('0x29')],'resourceId':_0x8668d['id'],'type':_0x5665a0[_0xd4a3('0x29')],'sectionId':_0x5665a0['id']},{})['then'](function(){return _0x4a0e7f;});}else{return _0x4a0e7f;}})[_0xd4a3('0x4f')](function(_0x155744){logger[_0xd4a3('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x155744);throw _0x155744;});}return _0x4a0e7f;})[_0xd4a3('0x25')](respondWithResult(_0x1b0051,0xc9))[_0xd4a3('0x4f')](handleError(_0x1b0051,null));};exports[_0xd4a3('0x24')]=function(_0x4d4491,_0x1b7def){if(_0x4d4491[_0xd4a3('0x47')]['id']){delete _0x4d4491['body']['id'];}return db[_0xd4a3('0x2c')][_0xd4a3('0x4c')]({'where':{'id':_0x4d4491[_0xd4a3('0x44')]['id']}})[_0xd4a3('0x25')](handleEntityNotFound(_0x1b7def,null))[_0xd4a3('0x25')](saveUpdates(_0x4d4491[_0xd4a3('0x47')],null))['then'](respondWithResult(_0x1b7def,null))[_0xd4a3('0x4f')](handleError(_0x1b7def,null));};exports[_0xd4a3('0x26')]=function(_0x85c3e2,_0x10fb68){return db[_0xd4a3('0x2c')][_0xd4a3('0x4c')]({'where':{'id':_0x85c3e2[_0xd4a3('0x44')]['id']}})[_0xd4a3('0x25')](handleEntityNotFound(_0x10fb68,null))[_0xd4a3('0x25')](removeEntity(_0x10fb68,null))[_0xd4a3('0x4f')](handleError(_0x10fb68,null));};
\ No newline at end of file
+var _0x8a1b=['error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','undefined','limit','count','offset','apply','reject','save','update','then','ChanSpies','UserProfileResource','destroy','sendStatus','stack','name','send','index','VoiceChanSpy','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','catch','show','params','includeAll','create','body','user','get','UserProfileSection','find','userProfileId','autoAssociation'];(function(_0x22e22e,_0x54c6fc){var _0x10a02a=function(_0x42b867){while(--_0x42b867){_0x22e22e['push'](_0x22e22e['shift']());}};_0x10a02a(++_0x54c6fc);}(_0x8a1b,0xf8));var _0xb8a1=function(_0x2a8e36,_0x4265c2){_0x2a8e36=_0x2a8e36-0x0;var _0x5768f5=_0x8a1b[_0x2a8e36];return _0x5768f5;};'use strict';var emlformat=require(_0xb8a1('0x0'));var rimraf=require(_0xb8a1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb8a1('0x2'));var rp=require(_0xb8a1('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xb8a1('0x4'));var util=require(_0xb8a1('0x5'));var path=require(_0xb8a1('0x6'));var sox=require(_0xb8a1('0x7'));var csv=require(_0xb8a1('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb8a1('0x9'));var _=require(_0xb8a1('0xa'));var squel=require(_0xb8a1('0xb'));var crypto=require(_0xb8a1('0xc'));var jsforce=require(_0xb8a1('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xb8a1('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xb8a1('0xe'));var authService=require(_0xb8a1('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xb8a1('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb8a1('0x11'))(_0xb8a1('0x12'));var utils=require(_0xb8a1('0x13'));var config=require(_0xb8a1('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xb8a1('0x15'))['db'];function respondWithStatusCode(_0x31f76e,_0x34aa9a){_0x34aa9a=_0x34aa9a||0xcc;return function(_0x7420ea){if(_0x7420ea){return _0x31f76e['sendStatus'](_0x34aa9a);}return _0x31f76e[_0xb8a1('0x16')](_0x34aa9a)[_0xb8a1('0x17')]();};}function respondWithResult(_0x24f8fc,_0x2feffe){_0x2feffe=_0x2feffe||0xc8;return function(_0xed7f42){if(_0xed7f42){return _0x24f8fc[_0xb8a1('0x16')](_0x2feffe)[_0xb8a1('0x18')](_0xed7f42);}};}function respondWithFilteredResult(_0x7c2479,_0x4710be){return function(_0x320151){if(_0x320151){var _0x367436=typeof _0x4710be['offset']===_0xb8a1('0x19')&&typeof _0x4710be[_0xb8a1('0x1a')]===_0xb8a1('0x19');var _0x5b410c=_0x320151[_0xb8a1('0x1b')];var _0x2ad525=_0x367436?0x0:_0x4710be[_0xb8a1('0x1c')];var _0xdf75f0=_0x367436?_0x320151[_0xb8a1('0x1b')]:_0x4710be[_0xb8a1('0x1c')]+_0x4710be[_0xb8a1('0x1a')];var _0x155df4;if(_0xdf75f0>=_0x5b410c){_0xdf75f0=_0x5b410c;_0x155df4=0xc8;}else{_0x155df4=0xce;}_0x7c2479[_0xb8a1('0x16')](_0x155df4);return _0x7c2479['set']('Content-Range',_0x2ad525+'-'+_0xdf75f0+'/'+_0x5b410c)[_0xb8a1('0x18')](_0x320151);}return null;};}function patchUpdates(_0x51859f){return function(_0x58bca0){try{jsonpatch[_0xb8a1('0x1d')](_0x58bca0,_0x51859f,!![]);}catch(_0x26be92){return BPromise[_0xb8a1('0x1e')](_0x26be92);}return _0x58bca0[_0xb8a1('0x1f')]();};}function saveUpdates(_0x655293,_0x3f616f){return function(_0x2618bd){if(_0x2618bd){return _0x2618bd[_0xb8a1('0x20')](_0x655293)[_0xb8a1('0x21')](function(_0xff7f41){return _0xff7f41;});}return null;};}function removeEntity(_0x1a3e62,_0x1829b7){return function(_0x2d9d56){if(_0x2d9d56){return _0x2d9d56['destroy']()[_0xb8a1('0x21')](function(){var _0x116232=_0x2d9d56['get']({'plain':!![]});var _0x4b69b8=_0xb8a1('0x22');return db[_0xb8a1('0x23')][_0xb8a1('0x24')]({'where':{'type':_0x4b69b8,'resourceId':_0x116232['id']}})[_0xb8a1('0x21')](function(){return _0x2d9d56;});})['then'](function(){_0x1a3e62['status'](0xcc)[_0xb8a1('0x17')]();});}};}function handleEntityNotFound(_0x22311f,_0x3b1ce5){return function(_0x58e717){if(!_0x58e717){_0x22311f[_0xb8a1('0x25')](0x194);}return _0x58e717;};}function handleError(_0x58d346,_0x997618){_0x997618=_0x997618||0x1f4;return function(_0x1a3837){logger['error'](_0x1a3837[_0xb8a1('0x26')]);if(_0x1a3837['name']){delete _0x1a3837[_0xb8a1('0x27')];}_0x58d346[_0xb8a1('0x16')](_0x997618)[_0xb8a1('0x28')](_0x1a3837);};}exports[_0xb8a1('0x29')]=function(_0x322294,_0x512317){var _0x2ad164={},_0x12b5a1={},_0x518f9f={'count':0x0,'rows':[]};var _0x128c9b=_['map'](db[_0xb8a1('0x2a')][_0xb8a1('0x2b')],function(_0x362fae){return{'name':_0x362fae[_0xb8a1('0x2c')],'type':_0x362fae[_0xb8a1('0x2d')][_0xb8a1('0x2e')]};});_0x12b5a1['model']=_[_0xb8a1('0x2f')](_0x128c9b,_0xb8a1('0x27'));_0x12b5a1[_0xb8a1('0x30')]=_[_0xb8a1('0x31')](_0x322294[_0xb8a1('0x30')]);_0x12b5a1[_0xb8a1('0x32')]=_[_0xb8a1('0x33')](_0x12b5a1[_0xb8a1('0x34')],_0x12b5a1['query']);_0x2ad164['attributes']=_[_0xb8a1('0x33')](_0x12b5a1['model'],qs[_0xb8a1('0x35')](_0x322294[_0xb8a1('0x30')][_0xb8a1('0x35')]));_0x2ad164[_0xb8a1('0x36')]=_0x2ad164[_0xb8a1('0x36')][_0xb8a1('0x37')]?_0x2ad164[_0xb8a1('0x36')]:_0x12b5a1[_0xb8a1('0x34')];if(!_0x322294[_0xb8a1('0x30')][_0xb8a1('0x38')](_0xb8a1('0x39'))){_0x2ad164[_0xb8a1('0x1a')]=qs[_0xb8a1('0x1a')](_0x322294[_0xb8a1('0x30')][_0xb8a1('0x1a')]);_0x2ad164[_0xb8a1('0x1c')]=qs[_0xb8a1('0x1c')](_0x322294['query'][_0xb8a1('0x1c')]);}_0x2ad164[_0xb8a1('0x3a')]=qs[_0xb8a1('0x3b')](_0x322294[_0xb8a1('0x30')][_0xb8a1('0x3b')]);_0x2ad164[_0xb8a1('0x3c')]=qs['filters'](_[_0xb8a1('0x3d')](_0x322294[_0xb8a1('0x30')],_0x12b5a1[_0xb8a1('0x32')]),_0x128c9b);if(_0x322294[_0xb8a1('0x30')][_0xb8a1('0x3e')]){_0x2ad164[_0xb8a1('0x3c')]=_[_0xb8a1('0x3f')](_0x2ad164[_0xb8a1('0x3c')],{'$or':_[_0xb8a1('0x2f')](_0x128c9b,function(_0x36df2f){if(_0x36df2f[_0xb8a1('0x2d')]!==_0xb8a1('0x40')){var _0x409182={};_0x409182[_0x36df2f[_0xb8a1('0x27')]]={'$like':'%'+_0x322294[_0xb8a1('0x30')]['filter']+'%'};return _0x409182;}})});}_0x2ad164=_[_0xb8a1('0x3f')]({},_0x2ad164,_0x322294[_0xb8a1('0x41')]);var _0x41b652={'where':_0x2ad164[_0xb8a1('0x3c')]};return db['VoiceChanSpy'][_0xb8a1('0x1b')](_0x41b652)[_0xb8a1('0x21')](function(_0xe9410a){_0x518f9f[_0xb8a1('0x1b')]=_0xe9410a;if(_0x322294[_0xb8a1('0x30')]['includeAll']){_0x2ad164['include']=[{'all':!![]}];}return db['VoiceChanSpy'][_0xb8a1('0x42')](_0x2ad164);})[_0xb8a1('0x21')](function(_0x26870b){_0x518f9f[_0xb8a1('0x43')]=_0x26870b;return _0x518f9f;})[_0xb8a1('0x21')](respondWithFilteredResult(_0x512317,_0x2ad164))[_0xb8a1('0x44')](handleError(_0x512317,null));};exports[_0xb8a1('0x45')]=function(_0x1850ad,_0x2abd9f){var _0x3e2dca={'raw':![],'where':{'id':_0x1850ad[_0xb8a1('0x46')]['id']}},_0xbe944c={};_0xbe944c['model']=_[_0xb8a1('0x31')](db['VoiceChanSpy'][_0xb8a1('0x2b')]);_0xbe944c[_0xb8a1('0x30')]=_['keys'](_0x1850ad[_0xb8a1('0x30')]);_0xbe944c[_0xb8a1('0x32')]=_[_0xb8a1('0x33')](_0xbe944c[_0xb8a1('0x34')],_0xbe944c[_0xb8a1('0x30')]);_0x3e2dca[_0xb8a1('0x36')]=_[_0xb8a1('0x33')](_0xbe944c[_0xb8a1('0x34')],qs[_0xb8a1('0x35')](_0x1850ad[_0xb8a1('0x30')][_0xb8a1('0x35')]));_0x3e2dca[_0xb8a1('0x36')]=_0x3e2dca[_0xb8a1('0x36')][_0xb8a1('0x37')]?_0x3e2dca['attributes']:_0xbe944c['model'];if(_0x1850ad[_0xb8a1('0x30')][_0xb8a1('0x47')]){_0x3e2dca['include']=[{'all':!![]}];}_0x3e2dca=_[_0xb8a1('0x3f')]({},_0x3e2dca,_0x1850ad[_0xb8a1('0x41')]);return db[_0xb8a1('0x2a')]['find'](_0x3e2dca)['then'](handleEntityNotFound(_0x2abd9f,null))[_0xb8a1('0x21')](respondWithResult(_0x2abd9f,null))[_0xb8a1('0x44')](handleError(_0x2abd9f,null));};exports[_0xb8a1('0x48')]=function(_0xf14f4f,_0xdcd04b){return db['VoiceChanSpy'][_0xb8a1('0x48')](_0xf14f4f[_0xb8a1('0x49')],{})[_0xb8a1('0x21')](function(_0x34faf1){var _0x3acc0b=_0xf14f4f[_0xb8a1('0x4a')]['get']({'plain':!![]});if(!_0x3acc0b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3acc0b['role']==='user'){var _0xe557b7=_0x34faf1[_0xb8a1('0x4b')]({'plain':!![]});var _0x20fff9=_0xb8a1('0x22');return db[_0xb8a1('0x4c')][_0xb8a1('0x4d')]({'where':{'name':_0x20fff9,'userProfileId':_0x3acc0b[_0xb8a1('0x4e')]},'raw':!![]})[_0xb8a1('0x21')](function(_0x18d0ad){if(_0x18d0ad&&_0x18d0ad[_0xb8a1('0x4f')]===0x0){return db['UserProfileResource'][_0xb8a1('0x48')]({'name':_0xe557b7[_0xb8a1('0x27')],'resourceId':_0xe557b7['id'],'type':_0x18d0ad[_0xb8a1('0x27')],'sectionId':_0x18d0ad['id']},{})[_0xb8a1('0x21')](function(){return _0x34faf1;});}else{return _0x34faf1;}})[_0xb8a1('0x44')](function(_0x41dc40){logger[_0xb8a1('0x50')](_0xb8a1('0x51'),_0x41dc40);throw _0x41dc40;});}return _0x34faf1;})['then'](respondWithResult(_0xdcd04b,0xc9))['catch'](handleError(_0xdcd04b,null));};exports[_0xb8a1('0x20')]=function(_0x42bc4f,_0x3b10de){if(_0x42bc4f['body']['id']){delete _0x42bc4f[_0xb8a1('0x49')]['id'];}return db[_0xb8a1('0x2a')][_0xb8a1('0x4d')]({'where':{'id':_0x42bc4f['params']['id']}})[_0xb8a1('0x21')](handleEntityNotFound(_0x3b10de,null))[_0xb8a1('0x21')](saveUpdates(_0x42bc4f[_0xb8a1('0x49')],null))[_0xb8a1('0x21')](respondWithResult(_0x3b10de,null))[_0xb8a1('0x44')](handleError(_0x3b10de,null));};exports[_0xb8a1('0x24')]=function(_0x907971,_0x1805dc){return db[_0xb8a1('0x2a')][_0xb8a1('0x4d')]({'where':{'id':_0x907971['params']['id']}})[_0xb8a1('0x21')](handleEntityNotFound(_0x1805dc,null))[_0xb8a1('0x21')](removeEntity(_0x1805dc,null))['catch'](handleError(_0x1805dc,null));};
\ No newline at end of file
index 635cf85..1062cae 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa3d7=['from-sip','%s%s','prefix','system','merge','format','CDR(type)=%s','chanspy','record','push','MixMonitor','${UNIQUEID}.%s,a','auth','password','ChanSpy','SIP/%s,%s','name','options','join','length','concat','internal','User','agent','catch','models','define','VoiceChanSpy','voice_chanspy','then','VoiceExtension','bulkCreate','destroy','lodash','util','./voiceChanSpy.attributes','context'];(function(_0x5206fb,_0x27aaf0){var _0x28cf2d=function(_0x32f19d){while(--_0x32f19d){_0x5206fb['push'](_0x5206fb['shift']());}};_0x28cf2d(++_0x27aaf0);}(_0xa3d7,0xff));var _0x7a3d=function(_0x4207f4,_0x1f778b){_0x4207f4=_0x4207f4-0x0;var _0x29a621=_0xa3d7[_0x4207f4];return _0x29a621;};'use strict';var _=require(_0x7a3d('0x0'));var util=require(_0x7a3d('0x1'));var BPromise=require('bluebird');var attributes=require(_0x7a3d('0x2'));var getUserApplications=function(_0x22f7d4,_0x51fe1d,_0x5aaa48){var _0x1863d4=0x1;var _0x6d3e4=[];var _0xc459b={'context':_0x51fe1d[_0x7a3d('0x3')]||_0x7a3d('0x4'),'exten':util['format'](_0x7a3d('0x5'),_0x22f7d4[_0x7a3d('0x6')],_0x5aaa48),'type':_0x7a3d('0x7'),'isApp':![],'ChanSpyId':_0x22f7d4['id'],'UserId':_0x51fe1d['id']};_0x6d3e4['push'](_[_0x7a3d('0x8')]({'app':'Set','appdata':util[_0x7a3d('0x9')](_0x7a3d('0xa'),_0x7a3d('0xb')),'priority':_0x1863d4++},_0xc459b));if(_0x22f7d4[_0x7a3d('0xc')]){_0x6d3e4[_0x7a3d('0xd')](_[_0x7a3d('0x8')]({'app':_0x7a3d('0xe'),'appdata':util[_0x7a3d('0x9')](_0x7a3d('0xf'),_0x22f7d4['recordingFormat']),'priority':_0x1863d4++},_0xc459b));}if(_0x22f7d4[_0x7a3d('0x10')]){_0x6d3e4[_0x7a3d('0xd')](_[_0x7a3d('0x8')]({'app':'Authenticate','appdata':_0x22f7d4[_0x7a3d('0x11')],'priority':_0x1863d4++},_0xc459b));}_0x6d3e4[_0x7a3d('0xd')](_['merge']({'app':_0x7a3d('0x12'),'appdata':util[_0x7a3d('0x9')](_0x7a3d('0x13'),_0x51fe1d[_0x7a3d('0x14')],_0x22f7d4[_0x7a3d('0x15')]?_0x22f7d4[_0x7a3d('0x15')][_0x7a3d('0x16')](''):''),'priority':_0x1863d4++},_0xc459b));if(_0x22f7d4[_0x7a3d('0xc')]){_0x6d3e4['push'](_['merge']({'app':'StopMixMonitor','priority':_0x1863d4++},_0xc459b));}return _0x6d3e4;};var getChanSpyApplications=function(_0x16a1fb,_0x50314c){var _0x69946a=[];for(var _0x280dfd=0x0,_0x263250=0x1;_0x280dfd<_0x50314c[_0x7a3d('0x17')];_0x280dfd++,_0x263250=0x1){_0x69946a=_0x69946a[_0x7a3d('0x18')](getUserApplications(_0x16a1fb,_0x50314c[_0x280dfd],_0x50314c[_0x280dfd][_0x7a3d('0x19')]));if(_0x50314c[_0x280dfd]['internal']!=_0x50314c[_0x280dfd][_0x7a3d('0x14')]){_0x69946a=_0x69946a[_0x7a3d('0x18')](getUserApplications(_0x16a1fb,_0x50314c[_0x280dfd],_0x50314c[_0x280dfd][_0x7a3d('0x14')]));}}return _0x69946a;};var getChanSpyPromise=function(_0x2d2d53,_0x2b5d2b){return new BPromise(function(_0x5eb61a,_0x14350d){return _0x2d2d53[_0x7a3d('0x1a')]['findAll']({'attributes':['id',_0x7a3d('0x14'),_0x7a3d('0x19')],'where':{'role':_0x7a3d('0x1b'),'chanspy':!![]},'raw':!![]})['then'](function(_0x335d4b){if(_0x335d4b){return _0x5eb61a(getChanSpyApplications(_0x2b5d2b,_0x335d4b));}return _0x5eb61a([]);})[_0x7a3d('0x1c')](function(_0x2fc0c5){_0x14350d(_0x2fc0c5);});});};module['exports']=function(_0x3f282d,_0x27c8da){var _0x3e10af=_0x3f282d[_0x7a3d('0x1d')];return _0x3f282d[_0x7a3d('0x1e')](_0x7a3d('0x1f'),attributes,{'tableName':_0x7a3d('0x20'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x68f10b,_0x8a8992,_0x470a78){return getChanSpyPromise(_0x3e10af,_0x68f10b)[_0x7a3d('0x21')](function(_0x52edcb){if(_0x52edcb&&_0x52edcb[_0x7a3d('0x17')]){return _0x3e10af[_0x7a3d('0x22')][_0x7a3d('0x23')](_0x52edcb);}})[_0x7a3d('0x21')](function(){_0x470a78();})[_0x7a3d('0x1c')](function(_0x5cb7b4){_0x470a78(_0x5cb7b4);});},'afterUpdate':function(_0x55f067,_0x3cf73f,_0x23a819){return _0x3e10af[_0x7a3d('0x22')][_0x7a3d('0x24')]({'where':{'ChanSpyId':_0x55f067['id']}})[_0x7a3d('0x21')](function(){return getChanSpyPromise(_0x3e10af,_0x55f067);})[_0x7a3d('0x21')](function(_0x4a6270){if(_0x4a6270&&_0x4a6270['length']){return _0x3e10af[_0x7a3d('0x22')][_0x7a3d('0x23')](_0x4a6270);}})['then'](function(){_0x23a819();})['catch'](function(_0x95a4ed){_0x23a819(_0x95a4ed);});},'afterDestroy':function(_0xbc561f,_0x4d89bc,_0x14e211){return _0x3e10af[_0x7a3d('0x22')]['destroy']({'where':{'ChanSpyId':_0xbc561f['id']}})[_0x7a3d('0x21')](function(){_0x14e211();})[_0x7a3d('0x1c')](function(_0x3ac3cd){_0x14e211(_0x3ac3cd);});}}});};
\ No newline at end of file
+var _0xdb52=['merge','Set','CDR(type)=%s','chanspy','record','${UNIQUEID}.%s,a','auth','Authenticate','password','SIP/%s,%s','options','StopMixMonitor','length','internal','User','findAll','name','then','catch','exports','models','VoiceChanSpy','voice_chanspy','VoiceExtension','bulkCreate','destroy','util','bluebird','context','from-sip','format','%s%s','prefix','push'];(function(_0x33f4a8,_0x2d7496){var _0x49606a=function(_0x460591){while(--_0x460591){_0x33f4a8['push'](_0x33f4a8['shift']());}};_0x49606a(++_0x2d7496);}(_0xdb52,0x80));var _0x2db5=function(_0x2fd02d,_0x178092){_0x2fd02d=_0x2fd02d-0x0;var _0x468c64=_0xdb52[_0x2fd02d];return _0x468c64;};'use strict';var _=require('lodash');var util=require(_0x2db5('0x0'));var BPromise=require(_0x2db5('0x1'));var attributes=require('./voiceChanSpy.attributes');var getUserApplications=function(_0x2ced3b,_0x28e88d,_0x3452a3){var _0x284b9f=0x1;var _0x2e7365=[];var _0x33f20d={'context':_0x28e88d[_0x2db5('0x2')]||_0x2db5('0x3'),'exten':util[_0x2db5('0x4')](_0x2db5('0x5'),_0x2ced3b[_0x2db5('0x6')],_0x3452a3),'type':'system','isApp':![],'ChanSpyId':_0x2ced3b['id'],'UserId':_0x28e88d['id']};_0x2e7365[_0x2db5('0x7')](_[_0x2db5('0x8')]({'app':_0x2db5('0x9'),'appdata':util['format'](_0x2db5('0xa'),_0x2db5('0xb')),'priority':_0x284b9f++},_0x33f20d));if(_0x2ced3b[_0x2db5('0xc')]){_0x2e7365[_0x2db5('0x7')](_[_0x2db5('0x8')]({'app':'MixMonitor','appdata':util[_0x2db5('0x4')](_0x2db5('0xd'),_0x2ced3b['recordingFormat']),'priority':_0x284b9f++},_0x33f20d));}if(_0x2ced3b[_0x2db5('0xe')]){_0x2e7365[_0x2db5('0x7')](_[_0x2db5('0x8')]({'app':_0x2db5('0xf'),'appdata':_0x2ced3b[_0x2db5('0x10')],'priority':_0x284b9f++},_0x33f20d));}_0x2e7365[_0x2db5('0x7')](_[_0x2db5('0x8')]({'app':'ChanSpy','appdata':util['format'](_0x2db5('0x11'),_0x28e88d['name'],_0x2ced3b[_0x2db5('0x12')]?_0x2ced3b['options']['join'](''):''),'priority':_0x284b9f++},_0x33f20d));if(_0x2ced3b[_0x2db5('0xc')]){_0x2e7365[_0x2db5('0x7')](_['merge']({'app':_0x2db5('0x13'),'priority':_0x284b9f++},_0x33f20d));}return _0x2e7365;};var getChanSpyApplications=function(_0x17476f,_0x29233b){var _0x5c39f2=[];for(var _0x320ad7=0x0,_0x8656ca=0x1;_0x320ad7<_0x29233b[_0x2db5('0x14')];_0x320ad7++,_0x8656ca=0x1){_0x5c39f2=_0x5c39f2['concat'](getUserApplications(_0x17476f,_0x29233b[_0x320ad7],_0x29233b[_0x320ad7][_0x2db5('0x15')]));if(_0x29233b[_0x320ad7][_0x2db5('0x15')]!=_0x29233b[_0x320ad7]['name']){_0x5c39f2=_0x5c39f2['concat'](getUserApplications(_0x17476f,_0x29233b[_0x320ad7],_0x29233b[_0x320ad7]['name']));}}return _0x5c39f2;};var getChanSpyPromise=function(_0x23597f,_0xf887b5){return new BPromise(function(_0x3efc40,_0xc6d044){return _0x23597f[_0x2db5('0x16')][_0x2db5('0x17')]({'attributes':['id',_0x2db5('0x18'),_0x2db5('0x15')],'where':{'role':'agent','chanspy':!![]},'raw':!![]})[_0x2db5('0x19')](function(_0x46e94d){if(_0x46e94d){return _0x3efc40(getChanSpyApplications(_0xf887b5,_0x46e94d));}return _0x3efc40([]);})[_0x2db5('0x1a')](function(_0x53afab){_0xc6d044(_0x53afab);});});};module[_0x2db5('0x1b')]=function(_0x24b097,_0x493dd5){var _0x457f60=_0x24b097[_0x2db5('0x1c')];return _0x24b097['define'](_0x2db5('0x1d'),attributes,{'tableName':_0x2db5('0x1e'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0xaf9a21,_0x2a6ab4,_0x26ac08){return getChanSpyPromise(_0x457f60,_0xaf9a21)['then'](function(_0x2feecd){if(_0x2feecd&&_0x2feecd['length']){return _0x457f60[_0x2db5('0x1f')][_0x2db5('0x20')](_0x2feecd);}})['then'](function(){_0x26ac08();})[_0x2db5('0x1a')](function(_0x299bc9){_0x26ac08(_0x299bc9);});},'afterUpdate':function(_0x3f2707,_0x3a4334,_0x2b5fde){return _0x457f60[_0x2db5('0x1f')]['destroy']({'where':{'ChanSpyId':_0x3f2707['id']}})[_0x2db5('0x19')](function(){return getChanSpyPromise(_0x457f60,_0x3f2707);})[_0x2db5('0x19')](function(_0x2213f5){if(_0x2213f5&&_0x2213f5[_0x2db5('0x14')]){return _0x457f60['VoiceExtension'][_0x2db5('0x20')](_0x2213f5);}})['then'](function(){_0x2b5fde();})[_0x2db5('0x1a')](function(_0x354c7f){_0x2b5fde(_0x354c7f);});},'afterDestroy':function(_0x1de76b,_0x7ffdd5,_0x2ca34f){return _0x457f60['VoiceExtension'][_0x2db5('0x21')]({'where':{'ChanSpyId':_0x1de76b['id']}})[_0x2db5('0x19')](function(){_0x2ca34f();})['catch'](function(_0x234af3){_0x2ca34f(_0x234af3);});}}});};
\ No newline at end of file
index 24ebcab..641e66b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x579c=['message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceChanSpy,\x20%s,\x20%s','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x5b16bb,_0x399b07){var _0xce6a=function(_0x157578){while(--_0x157578){_0x5b16bb['push'](_0x5b16bb['shift']());}};_0xce6a(++_0x399b07);}(_0x579c,0xda));var _0xc579=function(_0x5375fd,_0x50887f){_0x5375fd=_0x5375fd-0x0;var _0x142671=_0x579c[_0x5375fd];return _0x142671;};'use strict';var _=require(_0xc579('0x0'));var util=require(_0xc579('0x1'));var moment=require(_0xc579('0x2'));var BPromise=require(_0xc579('0x3'));var rs=require(_0xc579('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc579('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc579('0x6'))(_0xc579('0x7'));var config=require(_0xc579('0x8'));var jayson=require(_0xc579('0x9'));var client=jayson[_0xc579('0xa')][_0xc579('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2e451b,_0x585167,_0x1c6d9c){return new BPromise(function(_0x293c4a,_0x2ce949){return client[_0xc579('0xc')](_0x2e451b,_0x1c6d9c)[_0xc579('0xd')](function(_0x44b151){logger[_0xc579('0xe')](_0xc579('0xf'),_0x585167,'request\x20sent');logger[_0xc579('0x10')](_0xc579('0x11'),_0x585167,_0xc579('0x12'),JSON[_0xc579('0x13')](_0x44b151));if(_0x44b151[_0xc579('0x14')]){if(_0x44b151[_0xc579('0x14')][_0xc579('0x15')]===0x1f4){logger[_0xc579('0x14')](_0xc579('0xf'),_0x585167,_0x44b151[_0xc579('0x14')][_0xc579('0x16')]);return _0x2ce949(_0x44b151['error'][_0xc579('0x16')]);}logger['error'](_0xc579('0xf'),_0x585167,_0x44b151['error'][_0xc579('0x16')]);return _0x293c4a(_0x44b151['error'][_0xc579('0x16')]);}else{logger['info'](_0xc579('0xf'),_0x585167,_0xc579('0x12'));_0x293c4a(_0x44b151['result']['message']);}})[_0xc579('0x17')](function(_0x2abc55){logger[_0xc579('0x14')](_0xc579('0xf'),_0x585167,_0x2abc55);_0x2ce949(_0x2abc55);});});}
\ No newline at end of file
+var _0x5ec6=['VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','../../config/environment','client','http','request','then','VoiceChanSpy,\x20%s,\x20%s','debug'];(function(_0x421c7c,_0x3beef3){var _0x1f5c72=function(_0x22168c){while(--_0x22168c){_0x421c7c['push'](_0x421c7c['shift']());}};_0x1f5c72(++_0x3beef3);}(_0x5ec6,0x7f));var _0x65ec=function(_0x272023,_0x3bc423){_0x272023=_0x272023-0x0;var _0xa4144c=_0x5ec6[_0x272023];return _0xa4144c;};'use strict';var _=require(_0x65ec('0x0'));var util=require(_0x65ec('0x1'));var moment=require(_0x65ec('0x2'));var BPromise=require('bluebird');var rs=require(_0x65ec('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x65ec('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x65ec('0x5'))('rpc');var config=require(_0x65ec('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x65ec('0x7')][_0x65ec('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5d6254,_0xb3600b,_0x266254){return new BPromise(function(_0x4f8653,_0x28aa8f){return client[_0x65ec('0x9')](_0x5d6254,_0x266254)[_0x65ec('0xa')](function(_0x50e5c4){logger['info'](_0x65ec('0xb'),_0xb3600b,'request\x20sent');logger[_0x65ec('0xc')](_0x65ec('0xd'),_0xb3600b,'request\x20sent',JSON[_0x65ec('0xe')](_0x50e5c4));if(_0x50e5c4[_0x65ec('0xf')]){if(_0x50e5c4['error'][_0x65ec('0x10')]===0x1f4){logger[_0x65ec('0xf')]('VoiceChanSpy,\x20%s,\x20%s',_0xb3600b,_0x50e5c4[_0x65ec('0xf')][_0x65ec('0x11')]);return _0x28aa8f(_0x50e5c4[_0x65ec('0xf')][_0x65ec('0x11')]);}logger[_0x65ec('0xf')](_0x65ec('0xb'),_0xb3600b,_0x50e5c4[_0x65ec('0xf')][_0x65ec('0x11')]);return _0x4f8653(_0x50e5c4['error'][_0x65ec('0x11')]);}else{logger[_0x65ec('0x12')](_0x65ec('0xb'),_0xb3600b,'request\x20sent');_0x4f8653(_0x50e5c4['result'][_0x65ec('0x11')]);}})[_0x65ec('0x13')](function(_0xa597d4){logger['error'](_0x65ec('0xb'),_0xb3600b,_0xa597d4);_0x28aa8f(_0xa597d4);});});}
\ No newline at end of file
index dcf6584..8bfc264 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x14b3=['post','create','/:id','update','delete','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x36c5b0,_0x5001da){var _0xf19333=function(_0x1e880a){while(--_0x1e880a){_0x36c5b0['push'](_0x36c5b0['shift']());}};_0xf19333(++_0x5001da);}(_0x14b3,0x138));var _0x314b=function(_0x253946,_0x1c8d56){_0x253946=_0x253946-0x0;var _0x198cd6=_0x14b3[_0x253946];return _0x198cd6;};'use strict';var multer=require(_0x314b('0x0'));var util=require(_0x314b('0x1'));var path=require(_0x314b('0x2'));var timeout=require('connect-timeout');var express=require(_0x314b('0x3'));var router=express[_0x314b('0x4')]();var fs_extra=require(_0x314b('0x5'));var auth=require(_0x314b('0x6'));var interaction=require(_0x314b('0x7'));var config=require(_0x314b('0x8'));var controller=require('./voiceContext.controller');router[_0x314b('0x9')]('/',auth[_0x314b('0xa')](),controller['index']);router[_0x314b('0x9')]('/:id',auth[_0x314b('0xa')](),controller['show']);router[_0x314b('0xb')]('/',auth['isAuthenticated'](),controller[_0x314b('0xc')]);router['put'](_0x314b('0xd'),auth[_0x314b('0xa')](),controller[_0x314b('0xe')]);router[_0x314b('0xf')](_0x314b('0xd'),auth[_0x314b('0xa')](),controller[_0x314b('0x10')]);module['exports']=router;
\ No newline at end of file
+var _0xcf15=['post','create','put','isAuthenticated','delete','/:id','destroy','exports','multer','connect-timeout','express','Router','../../components/auth/service','./voiceContext.controller','get','index','show'];(function(_0x47d934,_0x405618){var _0x7c7e5b=function(_0x1511eb){while(--_0x1511eb){_0x47d934['push'](_0x47d934['shift']());}};_0x7c7e5b(++_0x405618);}(_0xcf15,0x17e));var _0x5cf1=function(_0xcd8813,_0x5228bd){_0xcd8813=_0xcd8813-0x0;var _0xf0f522=_0xcf15[_0xcd8813];return _0xf0f522;};'use strict';var multer=require(_0x5cf1('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x5cf1('0x1'));var express=require(_0x5cf1('0x2'));var router=express[_0x5cf1('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5cf1('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x5cf1('0x5'));router[_0x5cf1('0x6')]('/',auth['isAuthenticated'](),controller[_0x5cf1('0x7')]);router[_0x5cf1('0x6')]('/:id',auth['isAuthenticated'](),controller[_0x5cf1('0x8')]);router[_0x5cf1('0x9')]('/',auth['isAuthenticated'](),controller[_0x5cf1('0xa')]);router[_0x5cf1('0xb')]('/:id',auth[_0x5cf1('0xc')](),controller['update']);router[_0x5cf1('0xd')](_0x5cf1('0xe'),auth[_0x5cf1('0xc')](),controller[_0x5cf1('0xf')]);module[_0x5cf1('0x10')]=router;
\ No newline at end of file
index 52979be..aba0ea6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xea11=['STRING','BOOLEAN','sequelize','exports'];(function(_0x41f4b3,_0x4c535c){var _0x3a4866=function(_0x518e3b){while(--_0x518e3b){_0x41f4b3['push'](_0x41f4b3['shift']());}};_0x3a4866(++_0x4c535c);}(_0xea11,0x186));var _0x1ea1=function(_0x5c1bd9,_0x37cd17){_0x5c1bd9=_0x5c1bd9-0x0;var _0x213f49=_0xea11[_0x5c1bd9];return _0x213f49;};'use strict';var Sequelize=require(_0x1ea1('0x0'));module[_0x1ea1('0x1')]={'name':{'type':Sequelize[_0x1ea1('0x2')],'unique':'name'},'description':{'type':Sequelize[_0x1ea1('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x1ea1('0x3')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x740e=['sequelize','name','STRING','BOOLEAN'];(function(_0x3aaf0a,_0x450970){var _0x33e6bc=function(_0x1db54d){while(--_0x1db54d){_0x3aaf0a['push'](_0x3aaf0a['shift']());}};_0x33e6bc(++_0x450970);}(_0x740e,0x144));var _0xe740=function(_0x1162fd,_0x3f470c){_0x1162fd=_0x1162fd-0x0;var _0x32e449=_0x740e[_0x1162fd];return _0x32e449;};'use strict';var Sequelize=require(_0xe740('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xe740('0x1')},'description':{'type':Sequelize[_0xe740('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0xe740('0x3')],'defaultValue':0x0}};
\ No newline at end of file
index e70c250..a8d482e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1214=['length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','options','includeAll','findAll','rows','params','keys','find','create','body','readFileSync','join','server/files/templates/context.ejs','utf8','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','user','get','role','UserProfileSection','userProfileId','autoAssociation','root','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','VoiceContext,\x20%s,\x20%s','request\x20sent','VoiceContext,\x20%s,\x20%s,\x20%s','error','message','result','catch','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','destroy','Contexts','UserProfileResource','sendStatus','stack','name','VoiceContext','rawAttributes','type','key','model','query','filters','intersection','fields','attributes'];(function(_0x4fdbe5,_0x16de8a){var _0x88b471=function(_0x454d51){while(--_0x454d51){_0x4fdbe5['push'](_0x4fdbe5['shift']());}};_0x88b471(++_0x16de8a);}(_0x1214,0xeb));var _0x4121=function(_0x4e4061,_0x26503b){_0x4e4061=_0x4e4061-0x0;var _0x371dbd=_0x1214[_0x4e4061];return _0x371dbd;};'use strict';var emlformat=require(_0x4121('0x0'));var rimraf=require(_0x4121('0x1'));var zipdir=require(_0x4121('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4121('0x3'));var moment=require('moment');var BPromise=require(_0x4121('0x4'));var Mustache=require(_0x4121('0x5'));var util=require(_0x4121('0x6'));var path=require(_0x4121('0x7'));var sox=require(_0x4121('0x8'));var csv=require(_0x4121('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4121('0xa'));var squel=require(_0x4121('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x4121('0xc'));var toCsv=require(_0x4121('0x9'));var querystring=require('querystring');var Papa=require(_0x4121('0xd'));var Redis=require(_0x4121('0xe'));var authService=require(_0x4121('0xf'));var qs=require(_0x4121('0x10'));var as=require(_0x4121('0x11'));var hardwareService=require(_0x4121('0x12'));var logger=require(_0x4121('0x13'))(_0x4121('0x14'));var utils=require(_0x4121('0x15'));var config=require(_0x4121('0x16'));var licenseUtil=require(_0x4121('0x17'));var db=require(_0x4121('0x18'))['db'];var jayson=require(_0x4121('0x19'));var client=jayson[_0x4121('0x1a')][_0x4121('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x523c8a,_0x35f449,_0x4e7018,_0x2d4062){return new BPromise(function(_0x2f097b,_0x311e90){var _0x327261=_0x2d4062||client;return _0x327261[_0x4121('0x1c')](_0x523c8a,_0x4e7018)['then'](function(_0x1e8006){logger['info'](_0x4121('0x1d'),_0x35f449,_0x4121('0x1e'));logger['debug'](_0x4121('0x1f'),_0x35f449,_0x4121('0x1e'),JSON['stringify'](_0x1e8006));if(_0x1e8006[_0x4121('0x20')]){if(_0x1e8006[_0x4121('0x20')]['code']===0x1f4){logger[_0x4121('0x20')]('VoiceContext,\x20%s,\x20%s',_0x35f449,_0x1e8006[_0x4121('0x20')][_0x4121('0x21')]);return _0x311e90(_0x1e8006[_0x4121('0x20')][_0x4121('0x21')]);}logger['error'](_0x4121('0x1d'),_0x35f449,_0x1e8006[_0x4121('0x20')][_0x4121('0x21')]);return _0x2f097b(_0x1e8006[_0x4121('0x20')]['message']);}else{logger['info'](_0x4121('0x1d'),_0x35f449,_0x4121('0x1e'));_0x2f097b(_0x1e8006[_0x4121('0x22')][_0x4121('0x21')]);}})[_0x4121('0x23')](function(_0x3e2bea){logger[_0x4121('0x20')](_0x4121('0x1d'),_0x35f449,_0x3e2bea);_0x311e90(_0x3e2bea);});});}function respondWithStatusCode(_0x59d16a,_0x53e4ff){_0x53e4ff=_0x53e4ff||0xcc;return function(_0x1ee409){if(_0x1ee409){return _0x59d16a['sendStatus'](_0x53e4ff);}return _0x59d16a[_0x4121('0x24')](_0x53e4ff)[_0x4121('0x25')]();};}function respondWithResult(_0x18747c,_0x55d97c){_0x55d97c=_0x55d97c||0xc8;return function(_0x31f426){if(_0x31f426){return _0x18747c[_0x4121('0x24')](_0x55d97c)[_0x4121('0x26')](_0x31f426);}};}function respondWithFilteredResult(_0x3882e1,_0x54dbdf){return function(_0x1fbe01){if(_0x1fbe01){var _0x35adf2=typeof _0x54dbdf[_0x4121('0x27')]===_0x4121('0x28')&&typeof _0x54dbdf['limit']===_0x4121('0x28');var _0xd7b0cc=_0x1fbe01[_0x4121('0x29')];var _0x5b8fe7=_0x35adf2?0x0:_0x54dbdf['offset'];var _0x314f8a=_0x35adf2?_0x1fbe01[_0x4121('0x29')]:_0x54dbdf['offset']+_0x54dbdf[_0x4121('0x2a')];var _0x294bdd;if(_0x314f8a>=_0xd7b0cc){_0x314f8a=_0xd7b0cc;_0x294bdd=0xc8;}else{_0x294bdd=0xce;}_0x3882e1[_0x4121('0x24')](_0x294bdd);return _0x3882e1[_0x4121('0x2b')](_0x4121('0x2c'),_0x5b8fe7+'-'+_0x314f8a+'/'+_0xd7b0cc)['json'](_0x1fbe01);}return null;};}function patchUpdates(_0x4355c9){return function(_0x417313){try{jsonpatch[_0x4121('0x2d')](_0x417313,_0x4355c9,!![]);}catch(_0x1531e7){return BPromise['reject'](_0x1531e7);}return _0x417313[_0x4121('0x2e')]();};}function saveUpdates(_0xa35e28,_0x4348bd){return function(_0x2d8a8c){if(_0x2d8a8c){return _0x2d8a8c[_0x4121('0x2f')](_0xa35e28)[_0x4121('0x30')](function(_0x52e378){return _0x52e378;});}return null;};}function removeEntity(_0x1b39ed,_0x5694e4){return function(_0x104d79){if(_0x104d79){return _0x104d79[_0x4121('0x31')]()[_0x4121('0x30')](function(){var _0x370dc6=_0x104d79['get']({'plain':!![]});var _0x2eedcb=_0x4121('0x32');return db[_0x4121('0x33')][_0x4121('0x31')]({'where':{'type':_0x2eedcb,'resourceId':_0x370dc6['id']}})['then'](function(){return _0x104d79;});})[_0x4121('0x30')](function(){_0x1b39ed[_0x4121('0x24')](0xcc)[_0x4121('0x25')]();});}};}function handleEntityNotFound(_0x3e703b,_0x19218c){return function(_0x31d85e){if(!_0x31d85e){_0x3e703b[_0x4121('0x34')](0x194);}return _0x31d85e;};}function handleError(_0x547bb3,_0x1a2338){_0x1a2338=_0x1a2338||0x1f4;return function(_0xbe2cf4){logger['error'](_0xbe2cf4[_0x4121('0x35')]);if(_0xbe2cf4[_0x4121('0x36')]){delete _0xbe2cf4[_0x4121('0x36')];}_0x547bb3[_0x4121('0x24')](_0x1a2338)['send'](_0xbe2cf4);};}exports['index']=function(_0x28dbb5,_0x4f773a){var _0x54c16b={},_0x5114cd={},_0x9e5fcb={'count':0x0,'rows':[]};var _0x5450d9=_['map'](db[_0x4121('0x37')][_0x4121('0x38')],function(_0x1f6ea6){return{'name':_0x1f6ea6['fieldName'],'type':_0x1f6ea6[_0x4121('0x39')][_0x4121('0x3a')]};});_0x5114cd[_0x4121('0x3b')]=_['map'](_0x5450d9,_0x4121('0x36'));_0x5114cd['query']=_['keys'](_0x28dbb5[_0x4121('0x3c')]);_0x5114cd[_0x4121('0x3d')]=_[_0x4121('0x3e')](_0x5114cd['model'],_0x5114cd[_0x4121('0x3c')]);_0x54c16b['attributes']=_[_0x4121('0x3e')](_0x5114cd[_0x4121('0x3b')],qs['fields'](_0x28dbb5[_0x4121('0x3c')][_0x4121('0x3f')]));_0x54c16b[_0x4121('0x40')]=_0x54c16b['attributes'][_0x4121('0x41')]?_0x54c16b[_0x4121('0x40')]:_0x5114cd[_0x4121('0x3b')];if(!_0x28dbb5[_0x4121('0x3c')][_0x4121('0x42')](_0x4121('0x43'))){_0x54c16b[_0x4121('0x2a')]=qs[_0x4121('0x2a')](_0x28dbb5['query']['limit']);_0x54c16b['offset']=qs[_0x4121('0x27')](_0x28dbb5['query'][_0x4121('0x27')]);}_0x54c16b[_0x4121('0x44')]=qs[_0x4121('0x45')](_0x28dbb5['query']['sort']);_0x54c16b[_0x4121('0x46')]=qs[_0x4121('0x3d')](_[_0x4121('0x47')](_0x28dbb5[_0x4121('0x3c')],_0x5114cd[_0x4121('0x3d')]),_0x5450d9);if(_0x28dbb5['query'][_0x4121('0x48')]){_0x54c16b[_0x4121('0x46')]=_[_0x4121('0x49')](_0x54c16b[_0x4121('0x46')],{'$or':_[_0x4121('0x4a')](_0x5450d9,function(_0x47863c){if(_0x47863c[_0x4121('0x39')]!=='VIRTUAL'){var _0x32eec2={};_0x32eec2[_0x47863c['name']]={'$like':'%'+_0x28dbb5[_0x4121('0x3c')][_0x4121('0x48')]+'%'};return _0x32eec2;}})});}_0x54c16b=_[_0x4121('0x49')]({},_0x54c16b,_0x28dbb5[_0x4121('0x4b')]);var _0x70f548={'where':_0x54c16b[_0x4121('0x46')]};return db[_0x4121('0x37')]['count'](_0x70f548)[_0x4121('0x30')](function(_0x47295b){_0x9e5fcb[_0x4121('0x29')]=_0x47295b;if(_0x28dbb5[_0x4121('0x3c')][_0x4121('0x4c')]){_0x54c16b['include']=[{'all':!![]}];}return db[_0x4121('0x37')][_0x4121('0x4d')](_0x54c16b);})['then'](function(_0x2dbd20){_0x9e5fcb[_0x4121('0x4e')]=_0x2dbd20;return _0x9e5fcb;})[_0x4121('0x30')](respondWithFilteredResult(_0x4f773a,_0x54c16b))['catch'](handleError(_0x4f773a,null));};exports['show']=function(_0x170e37,_0x30a70f){var _0x292bf5={'raw':![],'where':{'id':_0x170e37[_0x4121('0x4f')]['id']}},_0x1e7de2={};_0x1e7de2[_0x4121('0x3b')]=_[_0x4121('0x50')](db[_0x4121('0x37')][_0x4121('0x38')]);_0x1e7de2['query']=_[_0x4121('0x50')](_0x170e37[_0x4121('0x3c')]);_0x1e7de2[_0x4121('0x3d')]=_[_0x4121('0x3e')](_0x1e7de2['model'],_0x1e7de2[_0x4121('0x3c')]);_0x292bf5['attributes']=_[_0x4121('0x3e')](_0x1e7de2[_0x4121('0x3b')],qs['fields'](_0x170e37[_0x4121('0x3c')][_0x4121('0x3f')]));_0x292bf5[_0x4121('0x40')]=_0x292bf5[_0x4121('0x40')][_0x4121('0x41')]?_0x292bf5['attributes']:_0x1e7de2[_0x4121('0x3b')];if(_0x170e37[_0x4121('0x3c')][_0x4121('0x4c')]){_0x292bf5['include']=[{'all':!![]}];}_0x292bf5=_[_0x4121('0x49')]({},_0x292bf5,_0x170e37[_0x4121('0x4b')]);return db['VoiceContext'][_0x4121('0x51')](_0x292bf5)[_0x4121('0x30')](handleEntityNotFound(_0x30a70f,null))['then'](respondWithResult(_0x30a70f,null))[_0x4121('0x23')](handleError(_0x30a70f,null));};exports[_0x4121('0x52')]=function(_0x19dc3e,_0x8325d5,_0x44fcf2){var _0x2cf5ac;return db['VoiceContext'][_0x4121('0x52')](_0x19dc3e[_0x4121('0x53')],{'raw':!![]})['then'](function(_0x2873d1){_0x2cf5ac=_0x2873d1;return db['VoiceContext']['findAll']({'raw':!![]});})['then'](function(_0x250703){var _0x554d15=fs[_0x4121('0x54')](path[_0x4121('0x55')](config['root'],_0x4121('0x56')),_0x4121('0x57'));var _0x2c316d=ejs[_0x4121('0x58')](_0x554d15,{'contexts':_0x250703||[]});fs[_0x4121('0x59')](_0x4121('0x5a'),_0x2c316d);})[_0x4121('0x30')](function(){return respondWithRpcPromise(_0x4121('0x5b'),_0x4121('0x52'),{'module':_0x4121('0x5c')});})[_0x4121('0x30')](function(){var _0xc836ae=_0x19dc3e[_0x4121('0x5d')][_0x4121('0x5e')]({'plain':!![]});if(!_0xc836ae)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xc836ae[_0x4121('0x5f')]===_0x4121('0x5d')){var _0x2f8ff5=_0x2cf5ac[_0x4121('0x5e')]({'plain':!![]});return db[_0x4121('0x60')][_0x4121('0x51')]({'where':{'name':_0x4121('0x32'),'userProfileId':_0xc836ae[_0x4121('0x61')]},'raw':!![]})[_0x4121('0x30')](function(_0x565870){if(_0x565870&&_0x565870[_0x4121('0x62')]===0x0){return db[_0x4121('0x33')][_0x4121('0x52')]({'name':_0x2f8ff5[_0x4121('0x36')],'resourceId':_0x2f8ff5['id'],'type':_0x565870[_0x4121('0x36')],'sectionId':_0x565870['id']},{})[_0x4121('0x30')](function(){return _0x2cf5ac;});}else{return _0x2cf5ac;}})['catch'](function(_0x9e550a){logger[_0x4121('0x20')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x9e550a);throw _0x9e550a;});}return _0x2cf5ac;})[_0x4121('0x30')](respondWithResult(_0x8325d5,0xc9))['catch'](handleError(_0x8325d5,null));};exports[_0x4121('0x2f')]=function(_0x365912,_0x897dc7,_0x5efbcf){var _0x46288b;return db['VoiceContext'][_0x4121('0x51')]({'where':{'id':_0x365912[_0x4121('0x4f')]['id']}})[_0x4121('0x30')](handleEntityNotFound(_0x897dc7,null))[_0x4121('0x30')](saveUpdates(_0x365912[_0x4121('0x53')],null))[_0x4121('0x30')](function(_0x443066){if(_0x443066){_0x46288b=_0x443066;return db['VoiceContext']['findAll']({'raw':!![]});}})['then'](function(_0x175066){var _0x265f50=fs[_0x4121('0x54')](path['join'](config[_0x4121('0x63')],_0x4121('0x56')),_0x4121('0x57'));var _0x1134df=ejs[_0x4121('0x58')](_0x265f50,{'contexts':_0x175066||[]});fs[_0x4121('0x59')](_0x4121('0x5a'),_0x1134df);})[_0x4121('0x30')](function(){return respondWithRpcPromise(_0x4121('0x5b'),'update',{'module':_0x4121('0x5c')});})[_0x4121('0x30')](function(){return _0x46288b;})['then'](respondWithResult(_0x897dc7,null))['catch'](handleError(_0x897dc7,null));};exports[_0x4121('0x31')]=function(_0x4d87bd,_0x19551f,_0x1a07ed){var _0x152f73;return db[_0x4121('0x37')][_0x4121('0x51')]({'where':{'id':_0x4d87bd[_0x4121('0x4f')]['id']}})[_0x4121('0x30')](handleEntityNotFound(_0x19551f,null))[_0x4121('0x30')](removeEntity(_0x19551f,null))[_0x4121('0x30')](function(){return db[_0x4121('0x37')][_0x4121('0x4d')]({'raw':!![]});})[_0x4121('0x30')](function(_0xbe630c){var _0x383f7d=fs['readFileSync'](path[_0x4121('0x55')](config[_0x4121('0x63')],_0x4121('0x56')),'utf8');var _0x1bb103=ejs[_0x4121('0x58')](_0x383f7d,{'contexts':_0xbe630c});fs[_0x4121('0x59')](_0x4121('0x5a'),_0x1bb103);return respondWithRpcPromise(_0x4121('0x5b'),_0x4121('0x31'),{'module':'chan_sip.so'});})[_0x4121('0x23')](handleError(_0x19551f,null));};
\ No newline at end of file
+var _0x9877=['mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','VoiceContext,\x20%s,\x20%s','request\x20sent','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','result','catch','sendStatus','status','offset','limit','count','set','json','apply','reject','save','update','destroy','Contexts','stack','name','index','VoiceContext','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','keys','length','find','create','join','root','utf8','render','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','body','readFileSync','server/files/templates/context.ejs','writeFileSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x56d403,_0x5d2a62){var _0x24f353=function(_0x14d739){while(--_0x14d739){_0x56d403['push'](_0x56d403['shift']());}};_0x24f353(++_0x5d2a62);}(_0x9877,0xcf));var _0x7987=function(_0x3233d1,_0x54f5cb){_0x3233d1=_0x3233d1-0x0;var _0x276411=_0x9877[_0x3233d1];return _0x276411;};'use strict';var emlformat=require(_0x7987('0x0'));var rimraf=require(_0x7987('0x1'));var zipdir=require(_0x7987('0x2'));var jsonpatch=require(_0x7987('0x3'));var rp=require(_0x7987('0x4'));var moment=require(_0x7987('0x5'));var BPromise=require(_0x7987('0x6'));var Mustache=require(_0x7987('0x7'));var util=require(_0x7987('0x8'));var path=require(_0x7987('0x9'));var sox=require(_0x7987('0xa'));var csv=require(_0x7987('0xb'));var ejs=require(_0x7987('0xc'));var fs=require('fs');var fs_extra=require(_0x7987('0xd'));var _=require(_0x7987('0xe'));var squel=require(_0x7987('0xf'));var crypto=require('crypto');var jsforce=require(_0x7987('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x7987('0xb'));var querystring=require(_0x7987('0x11'));var Papa=require(_0x7987('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x7987('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7987('0x14'));var logger=require(_0x7987('0x15'))(_0x7987('0x16'));var utils=require(_0x7987('0x17'));var config=require(_0x7987('0x18'));var licenseUtil=require(_0x7987('0x19'));var db=require(_0x7987('0x1a'))['db'];var jayson=require(_0x7987('0x1b'));var client=jayson[_0x7987('0x1c')][_0x7987('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x178f0d,_0x4fa5d1,_0x15c76d,_0x472950){return new BPromise(function(_0x14fea6,_0x23fd42){var _0x584a57=_0x472950||client;return _0x584a57[_0x7987('0x1e')](_0x178f0d,_0x15c76d)[_0x7987('0x1f')](function(_0x5e565d){logger['info'](_0x7987('0x20'),_0x4fa5d1,_0x7987('0x21'));logger['debug'](_0x7987('0x22'),_0x4fa5d1,_0x7987('0x21'),JSON[_0x7987('0x23')](_0x5e565d));if(_0x5e565d['error']){if(_0x5e565d['error'][_0x7987('0x24')]===0x1f4){logger[_0x7987('0x25')](_0x7987('0x20'),_0x4fa5d1,_0x5e565d[_0x7987('0x25')][_0x7987('0x26')]);return _0x23fd42(_0x5e565d[_0x7987('0x25')][_0x7987('0x26')]);}logger[_0x7987('0x25')]('VoiceContext,\x20%s,\x20%s',_0x4fa5d1,_0x5e565d[_0x7987('0x25')]['message']);return _0x14fea6(_0x5e565d[_0x7987('0x25')][_0x7987('0x26')]);}else{logger[_0x7987('0x27')](_0x7987('0x20'),_0x4fa5d1,'request\x20sent');_0x14fea6(_0x5e565d[_0x7987('0x28')]['message']);}})[_0x7987('0x29')](function(_0x3df386){logger['error'](_0x7987('0x20'),_0x4fa5d1,_0x3df386);_0x23fd42(_0x3df386);});});}function respondWithStatusCode(_0x184250,_0x1f051d){_0x1f051d=_0x1f051d||0xcc;return function(_0x2b4c82){if(_0x2b4c82){return _0x184250[_0x7987('0x2a')](_0x1f051d);}return _0x184250[_0x7987('0x2b')](_0x1f051d)['end']();};}function respondWithResult(_0x5b7f59,_0x121767){_0x121767=_0x121767||0xc8;return function(_0x26ece2){if(_0x26ece2){return _0x5b7f59['status'](_0x121767)['json'](_0x26ece2);}};}function respondWithFilteredResult(_0x53cfb4,_0x3a6e){return function(_0x4b9b20){if(_0x4b9b20){var _0x494a8b=typeof _0x3a6e[_0x7987('0x2c')]==='undefined'&&typeof _0x3a6e[_0x7987('0x2d')]==='undefined';var _0x2551f8=_0x4b9b20[_0x7987('0x2e')];var _0x551ee7=_0x494a8b?0x0:_0x3a6e[_0x7987('0x2c')];var _0x546ed5=_0x494a8b?_0x4b9b20[_0x7987('0x2e')]:_0x3a6e['offset']+_0x3a6e[_0x7987('0x2d')];var _0x3a760d;if(_0x546ed5>=_0x2551f8){_0x546ed5=_0x2551f8;_0x3a760d=0xc8;}else{_0x3a760d=0xce;}_0x53cfb4[_0x7987('0x2b')](_0x3a760d);return _0x53cfb4[_0x7987('0x2f')]('Content-Range',_0x551ee7+'-'+_0x546ed5+'/'+_0x2551f8)[_0x7987('0x30')](_0x4b9b20);}return null;};}function patchUpdates(_0x4f45ff){return function(_0xb5045){try{jsonpatch[_0x7987('0x31')](_0xb5045,_0x4f45ff,!![]);}catch(_0x4d768b){return BPromise[_0x7987('0x32')](_0x4d768b);}return _0xb5045[_0x7987('0x33')]();};}function saveUpdates(_0x4b263b,_0xc18640){return function(_0x3c4d9c){if(_0x3c4d9c){return _0x3c4d9c[_0x7987('0x34')](_0x4b263b)[_0x7987('0x1f')](function(_0x2c2d4d){return _0x2c2d4d;});}return null;};}function removeEntity(_0x12201a,_0x2058ba){return function(_0x3b107c){if(_0x3b107c){return _0x3b107c[_0x7987('0x35')]()[_0x7987('0x1f')](function(){var _0x38389e=_0x3b107c['get']({'plain':!![]});var _0x16bdea=_0x7987('0x36');return db['UserProfileResource'][_0x7987('0x35')]({'where':{'type':_0x16bdea,'resourceId':_0x38389e['id']}})[_0x7987('0x1f')](function(){return _0x3b107c;});})['then'](function(){_0x12201a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x156f3a,_0x13ae83){return function(_0x2a612d){if(!_0x2a612d){_0x156f3a[_0x7987('0x2a')](0x194);}return _0x2a612d;};}function handleError(_0x54cde4,_0x24191e){_0x24191e=_0x24191e||0x1f4;return function(_0xf1692){logger[_0x7987('0x25')](_0xf1692[_0x7987('0x37')]);if(_0xf1692[_0x7987('0x38')]){delete _0xf1692['name'];}_0x54cde4[_0x7987('0x2b')](_0x24191e)['send'](_0xf1692);};}exports[_0x7987('0x39')]=function(_0x1c3ce2,_0xcafcb4){var _0x85c999={},_0x479ce7={},_0x18902d={'count':0x0,'rows':[]};var _0x57e019=_['map'](db[_0x7987('0x3a')][_0x7987('0x3b')],function(_0x2d494f){return{'name':_0x2d494f[_0x7987('0x3c')],'type':_0x2d494f[_0x7987('0x3d')]['key']};});_0x479ce7[_0x7987('0x3e')]=_['map'](_0x57e019,_0x7987('0x38'));_0x479ce7[_0x7987('0x3f')]=_['keys'](_0x1c3ce2['query']);_0x479ce7[_0x7987('0x40')]=_[_0x7987('0x41')](_0x479ce7['model'],_0x479ce7[_0x7987('0x3f')]);_0x85c999[_0x7987('0x42')]=_[_0x7987('0x41')](_0x479ce7['model'],qs[_0x7987('0x43')](_0x1c3ce2[_0x7987('0x3f')][_0x7987('0x43')]));_0x85c999[_0x7987('0x42')]=_0x85c999[_0x7987('0x42')]['length']?_0x85c999[_0x7987('0x42')]:_0x479ce7['model'];if(!_0x1c3ce2[_0x7987('0x3f')][_0x7987('0x44')]('nolimit')){_0x85c999[_0x7987('0x2d')]=qs['limit'](_0x1c3ce2['query'][_0x7987('0x2d')]);_0x85c999[_0x7987('0x2c')]=qs[_0x7987('0x2c')](_0x1c3ce2[_0x7987('0x3f')][_0x7987('0x2c')]);}_0x85c999[_0x7987('0x45')]=qs[_0x7987('0x46')](_0x1c3ce2['query'][_0x7987('0x46')]);_0x85c999[_0x7987('0x47')]=qs[_0x7987('0x40')](_[_0x7987('0x48')](_0x1c3ce2[_0x7987('0x3f')],_0x479ce7[_0x7987('0x40')]),_0x57e019);if(_0x1c3ce2['query'][_0x7987('0x49')]){_0x85c999[_0x7987('0x47')]=_[_0x7987('0x4a')](_0x85c999[_0x7987('0x47')],{'$or':_[_0x7987('0x4b')](_0x57e019,function(_0xc4b1e7){if(_0xc4b1e7[_0x7987('0x3d')]!==_0x7987('0x4c')){var _0x40c46e={};_0x40c46e[_0xc4b1e7[_0x7987('0x38')]]={'$like':'%'+_0x1c3ce2[_0x7987('0x3f')][_0x7987('0x49')]+'%'};return _0x40c46e;}})});}_0x85c999=_[_0x7987('0x4a')]({},_0x85c999,_0x1c3ce2[_0x7987('0x4d')]);var _0x4c6d61={'where':_0x85c999[_0x7987('0x47')]};return db['VoiceContext'][_0x7987('0x2e')](_0x4c6d61)[_0x7987('0x1f')](function(_0x3163a3){_0x18902d[_0x7987('0x2e')]=_0x3163a3;if(_0x1c3ce2[_0x7987('0x3f')][_0x7987('0x4e')]){_0x85c999[_0x7987('0x4f')]=[{'all':!![]}];}return db['VoiceContext'][_0x7987('0x50')](_0x85c999);})[_0x7987('0x1f')](function(_0x675ddd){_0x18902d[_0x7987('0x51')]=_0x675ddd;return _0x18902d;})[_0x7987('0x1f')](respondWithFilteredResult(_0xcafcb4,_0x85c999))['catch'](handleError(_0xcafcb4,null));};exports['show']=function(_0x542b00,_0x14e704){var _0x52e81e={'raw':![],'where':{'id':_0x542b00['params']['id']}},_0x2cd24e={};_0x2cd24e[_0x7987('0x3e')]=_[_0x7987('0x52')](db[_0x7987('0x3a')]['rawAttributes']);_0x2cd24e[_0x7987('0x3f')]=_[_0x7987('0x52')](_0x542b00[_0x7987('0x3f')]);_0x2cd24e['filters']=_[_0x7987('0x41')](_0x2cd24e[_0x7987('0x3e')],_0x2cd24e['query']);_0x52e81e[_0x7987('0x42')]=_[_0x7987('0x41')](_0x2cd24e['model'],qs[_0x7987('0x43')](_0x542b00[_0x7987('0x3f')][_0x7987('0x43')]));_0x52e81e[_0x7987('0x42')]=_0x52e81e['attributes'][_0x7987('0x53')]?_0x52e81e[_0x7987('0x42')]:_0x2cd24e['model'];if(_0x542b00[_0x7987('0x3f')]['includeAll']){_0x52e81e[_0x7987('0x4f')]=[{'all':!![]}];}_0x52e81e=_[_0x7987('0x4a')]({},_0x52e81e,_0x542b00[_0x7987('0x4d')]);return db[_0x7987('0x3a')][_0x7987('0x54')](_0x52e81e)[_0x7987('0x1f')](handleEntityNotFound(_0x14e704,null))['then'](respondWithResult(_0x14e704,null))[_0x7987('0x29')](handleError(_0x14e704,null));};exports[_0x7987('0x55')]=function(_0x51bc87,_0xb96abd,_0x52707f){var _0x28fa7a;return db[_0x7987('0x3a')][_0x7987('0x55')](_0x51bc87['body'],{'raw':!![]})['then'](function(_0x48c8e7){_0x28fa7a=_0x48c8e7;return db[_0x7987('0x3a')][_0x7987('0x50')]({'raw':!![]});})[_0x7987('0x1f')](function(_0x4b59d1){var _0xb5d857=fs['readFileSync'](path[_0x7987('0x56')](config[_0x7987('0x57')],'server/files/templates/context.ejs'),_0x7987('0x58'));var _0x268ddd=ejs[_0x7987('0x59')](_0xb5d857,{'contexts':_0x4b59d1||[]});fs['writeFileSync'](_0x7987('0x5a'),_0x268ddd);})[_0x7987('0x1f')](function(){return respondWithRpcPromise(_0x7987('0x5b'),_0x7987('0x55'),{'module':_0x7987('0x5c')});})[_0x7987('0x1f')](function(){var _0x244e48=_0x51bc87[_0x7987('0x5d')][_0x7987('0x5e')]({'plain':!![]});if(!_0x244e48)throw new Error(_0x7987('0x5f'));if(_0x244e48[_0x7987('0x60')]==='user'){var _0x31329e=_0x28fa7a[_0x7987('0x5e')]({'plain':!![]});return db[_0x7987('0x61')][_0x7987('0x54')]({'where':{'name':_0x7987('0x36'),'userProfileId':_0x244e48[_0x7987('0x62')]},'raw':!![]})['then'](function(_0x5d4e58){if(_0x5d4e58&&_0x5d4e58[_0x7987('0x63')]===0x0){return db[_0x7987('0x64')][_0x7987('0x55')]({'name':_0x31329e[_0x7987('0x38')],'resourceId':_0x31329e['id'],'type':_0x5d4e58[_0x7987('0x38')],'sectionId':_0x5d4e58['id']},{})['then'](function(){return _0x28fa7a;});}else{return _0x28fa7a;}})['catch'](function(_0x44abe9){logger[_0x7987('0x25')](_0x7987('0x65'),_0x44abe9);throw _0x44abe9;});}return _0x28fa7a;})[_0x7987('0x1f')](respondWithResult(_0xb96abd,0xc9))[_0x7987('0x29')](handleError(_0xb96abd,null));};exports[_0x7987('0x34')]=function(_0x1b7e6e,_0x1bae29,_0x55d856){var _0x223ffd;return db[_0x7987('0x3a')][_0x7987('0x54')]({'where':{'id':_0x1b7e6e[_0x7987('0x66')]['id']}})[_0x7987('0x1f')](handleEntityNotFound(_0x1bae29,null))[_0x7987('0x1f')](saveUpdates(_0x1b7e6e[_0x7987('0x67')],null))[_0x7987('0x1f')](function(_0xe3863a){if(_0xe3863a){_0x223ffd=_0xe3863a;return db[_0x7987('0x3a')]['findAll']({'raw':!![]});}})[_0x7987('0x1f')](function(_0x573ce0){var _0x46ec15=fs[_0x7987('0x68')](path[_0x7987('0x56')](config['root'],_0x7987('0x69')),'utf8');var _0x3e14ea=ejs[_0x7987('0x59')](_0x46ec15,{'contexts':_0x573ce0||[]});fs[_0x7987('0x6a')](_0x7987('0x5a'),_0x3e14ea);})[_0x7987('0x1f')](function(){return respondWithRpcPromise('Reload',_0x7987('0x34'),{'module':_0x7987('0x5c')});})[_0x7987('0x1f')](function(){return _0x223ffd;})[_0x7987('0x1f')](respondWithResult(_0x1bae29,null))[_0x7987('0x29')](handleError(_0x1bae29,null));};exports[_0x7987('0x35')]=function(_0xe59548,_0x3b84ec,_0x491700){var _0x29befb;return db[_0x7987('0x3a')][_0x7987('0x54')]({'where':{'id':_0xe59548[_0x7987('0x66')]['id']}})[_0x7987('0x1f')](handleEntityNotFound(_0x3b84ec,null))[_0x7987('0x1f')](removeEntity(_0x3b84ec,null))[_0x7987('0x1f')](function(){return db[_0x7987('0x3a')][_0x7987('0x50')]({'raw':!![]});})[_0x7987('0x1f')](function(_0x30d952){var _0x40e788=fs[_0x7987('0x68')](path['join'](config[_0x7987('0x57')],'server/files/templates/context.ejs'),_0x7987('0x58'));var _0x3cc774=ejs[_0x7987('0x59')](_0x40e788,{'contexts':_0x30d952});fs['writeFileSync'](_0x7987('0x5a'),_0x3cc774);return respondWithRpcPromise('Reload',_0x7987('0x35'),{'module':_0x7987('0x5c')});})['catch'](handleError(_0x3b84ec,null));};
\ No newline at end of file
index 46c2192..5585d0e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1179=['bluebird','request-promise','path','rimraf','../../config/environment','./voiceContext.attributes','exports','define','voice_contexts','lodash','util','../../config/logger','moment'];(function(_0x43840a,_0x391a19){var _0x5b19b5=function(_0x4ec7ac){while(--_0x4ec7ac){_0x43840a['push'](_0x43840a['shift']());}};_0x5b19b5(++_0x391a19);}(_0x1179,0x7e));var _0x9117=function(_0x2519d7,_0x13c5ef){_0x2519d7=_0x2519d7-0x0;var _0x579eda=_0x1179[_0x2519d7];return _0x579eda;};'use strict';var _=require(_0x9117('0x0'));var util=require(_0x9117('0x1'));var logger=require(_0x9117('0x2'))('api');var moment=require(_0x9117('0x3'));var BPromise=require(_0x9117('0x4'));var rp=require(_0x9117('0x5'));var fs=require('fs');var path=require(_0x9117('0x6'));var rimraf=require(_0x9117('0x7'));var config=require(_0x9117('0x8'));var attributes=require(_0x9117('0x9'));module[_0x9117('0xa')]=function(_0xa7c429,_0x4d5751){return _0xa7c429[_0x9117('0xb')]('VoiceContext',attributes,{'tableName':_0x9117('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5a9b=['../../config/environment','exports','define','VoiceContext','util','../../config/logger','api','bluebird'];(function(_0x19dd7a,_0x51de21){var _0x3feb6a=function(_0x4a3c84){while(--_0x4a3c84){_0x19dd7a['push'](_0x19dd7a['shift']());}};_0x3feb6a(++_0x51de21);}(_0x5a9b,0x18c));var _0xb5a9=function(_0x147445,_0x91a83b){_0x147445=_0x147445-0x0;var _0x12becb=_0x5a9b[_0x147445];return _0x12becb;};'use strict';var _=require('lodash');var util=require(_0xb5a9('0x0'));var logger=require(_0xb5a9('0x1'))(_0xb5a9('0x2'));var moment=require('moment');var BPromise=require(_0xb5a9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xb5a9('0x4'));var attributes=require('./voiceContext.attributes');module[_0xb5a9('0x5')]=function(_0x26a77e,_0x1fb4ca){return _0x26a77e[_0xb5a9('0x6')](_0xb5a9('0x7'),attributes,{'tableName':'voice_contexts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index b262cf8..e0f4a47 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6947=['../../config/environment','jayson/promise','client','http','request','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','error','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','rpc'];(function(_0x1ddedd,_0x485606){var _0xa3e1ac=function(_0x580444){while(--_0x580444){_0x1ddedd['push'](_0x1ddedd['shift']());}};_0xa3e1ac(++_0x485606);}(_0x6947,0x72));var _0x7694=function(_0x20a3fb,_0x31c9e7){_0x20a3fb=_0x20a3fb-0x0;var _0x531d1e=_0x6947[_0x20a3fb];return _0x531d1e;};'use strict';var _=require('lodash');var util=require(_0x7694('0x0'));var moment=require('moment');var BPromise=require(_0x7694('0x1'));var rs=require(_0x7694('0x2'));var fs=require('fs');var Redis=require(_0x7694('0x3'));var db=require(_0x7694('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7694('0x5'));var config=require(_0x7694('0x6'));var jayson=require(_0x7694('0x7'));var client=jayson[_0x7694('0x8')][_0x7694('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x266a27,_0x52cecf,_0x9ecd68){return new BPromise(function(_0x57d637,_0x28ea4f){return client[_0x7694('0xa')](_0x266a27,_0x9ecd68)['then'](function(_0x3a4a92){logger[_0x7694('0xb')](_0x7694('0xc'),_0x52cecf,_0x7694('0xd'));logger[_0x7694('0xe')](_0x7694('0xf'),_0x52cecf,_0x7694('0xd'),JSON['stringify'](_0x3a4a92));if(_0x3a4a92[_0x7694('0x10')]){if(_0x3a4a92[_0x7694('0x10')]['code']===0x1f4){logger[_0x7694('0x10')](_0x7694('0xc'),_0x52cecf,_0x3a4a92[_0x7694('0x10')]['message']);return _0x28ea4f(_0x3a4a92['error'][_0x7694('0x11')]);}logger[_0x7694('0x10')](_0x7694('0xc'),_0x52cecf,_0x3a4a92['error'][_0x7694('0x11')]);return _0x57d637(_0x3a4a92['error'][_0x7694('0x11')]);}else{logger[_0x7694('0xb')](_0x7694('0xc'),_0x52cecf,_0x7694('0xd'));_0x57d637(_0x3a4a92[_0x7694('0x12')]['message']);}})[_0x7694('0x13')](function(_0xb1edf0){logger[_0x7694('0x10')](_0x7694('0xc'),_0x52cecf,_0xb1edf0);_0x28ea4f(_0xb1edf0);});});}
\ No newline at end of file
+var _0x13eb=['../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','bluebird','randomstring'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x13eb,0x8f));var _0xb13e=function(_0xc81f5f,_0x181205){_0xc81f5f=_0xc81f5f-0x0;var _0x4410dc=_0x13eb[_0xc81f5f];return _0x4410dc;};'use strict';var _=require(_0xb13e('0x0'));var util=require(_0xb13e('0x1'));var moment=require('moment');var BPromise=require(_0xb13e('0x2'));var rs=require(_0xb13e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb13e('0x4'))['db'];var utils=require(_0xb13e('0x5'));var logger=require(_0xb13e('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xb13e('0x7'));var client=jayson[_0xb13e('0x8')][_0xb13e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1722ad,_0x215b85,_0x2184d5){return new BPromise(function(_0x4c2374,_0x3390be){return client[_0xb13e('0xa')](_0x1722ad,_0x2184d5)['then'](function(_0x44e6b4){logger[_0xb13e('0xb')](_0xb13e('0xc'),_0x215b85,_0xb13e('0xd'));logger[_0xb13e('0xe')](_0xb13e('0xf'),_0x215b85,_0xb13e('0xd'),JSON[_0xb13e('0x10')](_0x44e6b4));if(_0x44e6b4[_0xb13e('0x11')]){if(_0x44e6b4[_0xb13e('0x11')]['code']===0x1f4){logger[_0xb13e('0x11')](_0xb13e('0xc'),_0x215b85,_0x44e6b4[_0xb13e('0x11')][_0xb13e('0x12')]);return _0x3390be(_0x44e6b4['error'][_0xb13e('0x12')]);}logger[_0xb13e('0x11')](_0xb13e('0xc'),_0x215b85,_0x44e6b4[_0xb13e('0x11')][_0xb13e('0x12')]);return _0x4c2374(_0x44e6b4[_0xb13e('0x11')][_0xb13e('0x12')]);}else{logger[_0xb13e('0xb')](_0xb13e('0xc'),_0x215b85,_0xb13e('0xd'));_0x4c2374(_0x44e6b4[_0xb13e('0x13')][_0xb13e('0x12')]);}})[_0xb13e('0x14')](function(_0x3e5fa2){logger[_0xb13e('0x11')](_0xb13e('0xc'),_0x215b85,_0x3e5fa2);_0x3390be(_0x3e5fa2);});});}
\ No newline at end of file
index c229fd7..2e599ad 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8248=['../../components/interaction/service','../../config/environment','./voiceDialReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','put','delete','exports','multer','util','connect-timeout','Router','fs-extra'];(function(_0x58f8d6,_0x3de6e9){var _0x249399=function(_0x5a2d88){while(--_0x5a2d88){_0x58f8d6['push'](_0x58f8d6['shift']());}};_0x249399(++_0x3de6e9);}(_0x8248,0x67));var _0x8824=function(_0x2b9a0b,_0x203cb9){_0x2b9a0b=_0x2b9a0b-0x0;var _0x29712f=_0x8248[_0x2b9a0b];return _0x29712f;};'use strict';var multer=require(_0x8824('0x0'));var util=require(_0x8824('0x1'));var path=require('path');var timeout=require(_0x8824('0x2'));var express=require('express');var router=express[_0x8824('0x3')]();var fs_extra=require(_0x8824('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x8824('0x5'));var config=require(_0x8824('0x6'));var controller=require(_0x8824('0x7'));router[_0x8824('0x8')]('/',auth[_0x8824('0x9')](),controller[_0x8824('0xa')]);router[_0x8824('0x8')](_0x8824('0xb'),auth[_0x8824('0x9')](),controller[_0x8824('0xc')]);router['get'](_0x8824('0xd'),auth[_0x8824('0x9')](),controller[_0x8824('0xe')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x8824('0xf')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x8824('0x10')](_0x8824('0xd'),auth[_0x8824('0x9')](),controller['destroy']);module[_0x8824('0x11')]=router;
\ No newline at end of file
+var _0xa486=['/:id','delete','destroy','exports','multer','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','show','post','create','put'];(function(_0x19e6b3,_0x433159){var _0x2649f2=function(_0x31d402){while(--_0x31d402){_0x19e6b3['push'](_0x19e6b3['shift']());}};_0x2649f2(++_0x433159);}(_0xa486,0xd5));var _0x6a48=function(_0x417285,_0x421d14){_0x417285=_0x417285-0x0;var _0x293c6b=_0xa486[_0x417285];return _0x293c6b;};'use strict';var multer=require(_0x6a48('0x0'));var util=require('util');var path=require(_0x6a48('0x1'));var timeout=require(_0x6a48('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x6a48('0x3'));var auth=require(_0x6a48('0x4'));var interaction=require(_0x6a48('0x5'));var config=require('../../config/environment');var controller=require('./voiceDialReport.controller');router[_0x6a48('0x6')]('/',auth[_0x6a48('0x7')](),controller[_0x6a48('0x8')]);router['get'](_0x6a48('0x9'),auth[_0x6a48('0x7')](),controller[_0x6a48('0xa')]);router[_0x6a48('0x6')]('/:id',auth[_0x6a48('0x7')](),controller[_0x6a48('0xb')]);router[_0x6a48('0xc')]('/',auth[_0x6a48('0x7')](),controller[_0x6a48('0xd')]);router[_0x6a48('0xe')](_0x6a48('0xf'),auth[_0x6a48('0x7')](),controller['update']);router[_0x6a48('0x10')](_0x6a48('0xf'),auth[_0x6a48('0x7')](),controller[_0x6a48('0x11')]);module[_0x6a48('0x12')]=router;
\ No newline at end of file
index 3dfc672..cfde1bd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x24ca=['STRING','INTEGER','DATE','called,connect,complete','sequelize'];(function(_0x12809c,_0x1e70f8){var _0x56a964=function(_0x324a19){while(--_0x324a19){_0x12809c['push'](_0x12809c['shift']());}};_0x56a964(++_0x1e70f8);}(_0x24ca,0x1bc));var _0xa24c=function(_0x411e71,_0xf9652){_0x411e71=_0x411e71-0x0;var _0x226ae3=_0x24ca[_0x411e71];return _0x226ae3;};'use strict';var Sequelize=require(_0xa24c('0x0'));module['exports']={'privilege':{'type':Sequelize[_0xa24c('0x1')]},'channel':{'type':Sequelize[_0xa24c('0x1')]},'channelstate':{'type':Sequelize[_0xa24c('0x2')]},'channelstatedesc':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xa24c('0x1')]},'calleridname':{'type':Sequelize[_0xa24c('0x1')]},'connectedlinenum':{'type':Sequelize[_0xa24c('0x1')]},'connectedlinename':{'type':Sequelize[_0xa24c('0x1')]},'language':{'type':Sequelize[_0xa24c('0x1')]},'accountcode':{'type':Sequelize[_0xa24c('0x1')]},'context':{'type':Sequelize[_0xa24c('0x1')]},'exten':{'type':Sequelize[_0xa24c('0x1')]},'priority':{'type':Sequelize[_0xa24c('0x2')]},'uniqueid':{'type':Sequelize[_0xa24c('0x1')]},'linkedid':{'type':Sequelize[_0xa24c('0x1')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0xa24c('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0xa24c('0x1')]},'destcalleridnum':{'type':Sequelize[_0xa24c('0x1')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0xa24c('0x1')]},'destconnectedlinename':{'type':Sequelize[_0xa24c('0x1')]},'destlanguage':{'type':Sequelize[_0xa24c('0x1')]},'destaccountcode':{'type':Sequelize[_0xa24c('0x1')]},'destcontext':{'type':Sequelize[_0xa24c('0x1')]},'destexten':{'type':Sequelize[_0xa24c('0x1')]},'destpriority':{'type':Sequelize[_0xa24c('0x2')]},'destuniqueid':{'type':Sequelize[_0xa24c('0x1')]},'destlinkedid':{'type':Sequelize[_0xa24c('0x1')]},'dialstring':{'type':Sequelize['STRING']},'dialstatus':{'type':Sequelize[_0xa24c('0x1')]},'starttime':{'type':Sequelize[_0xa24c('0x3')]},'answertime':{'type':Sequelize[_0xa24c('0x3')]},'endtime':{'type':Sequelize[_0xa24c('0x3')]},'lastevent':{'type':Sequelize['STRING'],'comment':_0xa24c('0x4')},'routeId':{'type':Sequelize[_0xa24c('0x2')]},'duration':{'type':Sequelize[_0xa24c('0x2')]},'holdtime':{'type':Sequelize[_0xa24c('0x2')]},'billableseconds':{'type':Sequelize[_0xa24c('0x2')]}};
\ No newline at end of file
+var _0x98a8=['sequelize','exports','STRING','INTEGER','DATE'];(function(_0x3550c9,_0x1d6cb0){var _0x59fd90=function(_0x269468){while(--_0x269468){_0x3550c9['push'](_0x3550c9['shift']());}};_0x59fd90(++_0x1d6cb0);}(_0x98a8,0x12c));var _0x898a=function(_0x1d1867,_0x1cdce8){_0x1d1867=_0x1d1867-0x0;var _0x168217=_0x98a8[_0x1d1867];return _0x168217;};'use strict';var Sequelize=require(_0x898a('0x0'));module[_0x898a('0x1')]={'privilege':{'type':Sequelize[_0x898a('0x2')]},'channel':{'type':Sequelize[_0x898a('0x2')]},'channelstate':{'type':Sequelize[_0x898a('0x3')]},'channelstatedesc':{'type':Sequelize[_0x898a('0x2')]},'calleridnum':{'type':Sequelize[_0x898a('0x2')]},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x898a('0x2')]},'connectedlinename':{'type':Sequelize[_0x898a('0x2')]},'language':{'type':Sequelize[_0x898a('0x2')]},'accountcode':{'type':Sequelize[_0x898a('0x2')]},'context':{'type':Sequelize[_0x898a('0x2')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x898a('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0x898a('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x898a('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x898a('0x2')]},'destcalleridnum':{'type':Sequelize[_0x898a('0x2')]},'destcalleridname':{'type':Sequelize[_0x898a('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x898a('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x898a('0x2')]},'destlanguage':{'type':Sequelize[_0x898a('0x2')]},'destaccountcode':{'type':Sequelize[_0x898a('0x2')]},'destcontext':{'type':Sequelize[_0x898a('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x898a('0x3')]},'destuniqueid':{'type':Sequelize['STRING']},'destlinkedid':{'type':Sequelize[_0x898a('0x2')]},'dialstring':{'type':Sequelize['STRING']},'dialstatus':{'type':Sequelize[_0x898a('0x2')]},'starttime':{'type':Sequelize[_0x898a('0x4')]},'answertime':{'type':Sequelize[_0x898a('0x4')]},'endtime':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize['STRING'],'comment':'called,connect,complete'},'routeId':{'type':Sequelize[_0x898a('0x3')]},'duration':{'type':Sequelize[_0x898a('0x3')]},'holdtime':{'type':Sequelize[_0x898a('0x3')]},'billableseconds':{'type':Sequelize[_0x898a('0x3')]}};
\ No newline at end of file
index 22a06a3..5bcd938 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb448=['sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','show','params','find','body','describe','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','undefined','offset','limit','status','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','VoiceDialReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','length','nolimit','order'];(function(_0x191154,_0x56f74c){var _0x3dcd73=function(_0x51c321){while(--_0x51c321){_0x191154['push'](_0x191154['shift']());}};_0x3dcd73(++_0x56f74c);}(_0xb448,0xac));var _0x8b44=function(_0x12fc8d,_0x19ee33){_0x12fc8d=_0x12fc8d-0x0;var _0x3f9d04=_0xb448[_0x12fc8d];return _0x3f9d04;};'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(_0x8b44('0x0'));var moment=require('moment');var BPromise=require(_0x8b44('0x1'));var Mustache=require(_0x8b44('0x2'));var util=require(_0x8b44('0x3'));var path=require(_0x8b44('0x4'));var sox=require(_0x8b44('0x5'));var csv=require(_0x8b44('0x6'));var ejs=require(_0x8b44('0x7'));var fs=require('fs');var fs_extra=require(_0x8b44('0x8'));var _=require(_0x8b44('0x9'));var squel=require(_0x8b44('0xa'));var crypto=require(_0x8b44('0xb'));var jsforce=require(_0x8b44('0xc'));var deskjs=require(_0x8b44('0xd'));var toCsv=require('to-csv');var querystring=require(_0x8b44('0xe'));var Papa=require('papaparse');var Redis=require(_0x8b44('0xf'));var authService=require(_0x8b44('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8b44('0x11'));var logger=require(_0x8b44('0x12'))('api');var utils=require(_0x8b44('0x13'));var config=require(_0x8b44('0x14'));var licenseUtil=require(_0x8b44('0x15'));var db=require(_0x8b44('0x16'))['db'];function respondWithStatusCode(_0x1b0315,_0x4c0b52){_0x4c0b52=_0x4c0b52||0xcc;return function(_0x2299e7){if(_0x2299e7){return _0x1b0315[_0x8b44('0x17')](_0x4c0b52);}return _0x1b0315['status'](_0x4c0b52)[_0x8b44('0x18')]();};}function respondWithResult(_0x57a94f,_0x3ec34c){_0x3ec34c=_0x3ec34c||0xc8;return function(_0x466fe3){if(_0x466fe3){return _0x57a94f['status'](_0x3ec34c)[_0x8b44('0x19')](_0x466fe3);}};}function respondWithFilteredResult(_0x38ddc4,_0x52dec5){return function(_0x36e1b5){if(_0x36e1b5){var _0x4d5fbc=typeof _0x52dec5['offset']===_0x8b44('0x1a')&&typeof _0x52dec5['limit']===_0x8b44('0x1a');var _0xd23d45=_0x36e1b5['count'];var _0x51b9cb=_0x4d5fbc?0x0:_0x52dec5[_0x8b44('0x1b')];var _0x2f24c6=_0x4d5fbc?_0x36e1b5['count']:_0x52dec5['offset']+_0x52dec5[_0x8b44('0x1c')];var _0x2daacd;if(_0x2f24c6>=_0xd23d45){_0x2f24c6=_0xd23d45;_0x2daacd=0xc8;}else{_0x2daacd=0xce;}_0x38ddc4[_0x8b44('0x1d')](_0x2daacd);return _0x38ddc4[_0x8b44('0x1e')](_0x8b44('0x1f'),_0x51b9cb+'-'+_0x2f24c6+'/'+_0xd23d45)[_0x8b44('0x19')](_0x36e1b5);}return null;};}function patchUpdates(_0x53f00d){return function(_0x197fc8){try{jsonpatch[_0x8b44('0x20')](_0x197fc8,_0x53f00d,!![]);}catch(_0x3ca28a){return BPromise[_0x8b44('0x21')](_0x3ca28a);}return _0x197fc8[_0x8b44('0x22')]();};}function saveUpdates(_0x3346ea,_0x2fae2e){return function(_0x3308b8){if(_0x3308b8){return _0x3308b8[_0x8b44('0x23')](_0x3346ea)['then'](function(_0x57757e){return _0x57757e;});}return null;};}function removeEntity(_0x391336,_0x557f86){return function(_0x122bea){if(_0x122bea){return _0x122bea[_0x8b44('0x24')]()[_0x8b44('0x25')](function(){_0x391336[_0x8b44('0x1d')](0xcc)[_0x8b44('0x18')]();});}};}function handleEntityNotFound(_0x706d8f,_0x525789){return function(_0x21b406){if(!_0x21b406){_0x706d8f[_0x8b44('0x17')](0x194);}return _0x21b406;};}function handleError(_0x1e273a,_0x23194d){_0x23194d=_0x23194d||0x1f4;return function(_0x346e7e){logger[_0x8b44('0x26')](_0x346e7e[_0x8b44('0x27')]);if(_0x346e7e[_0x8b44('0x28')]){delete _0x346e7e['name'];}_0x1e273a[_0x8b44('0x1d')](_0x23194d)[_0x8b44('0x29')](_0x346e7e);};}exports[_0x8b44('0x2a')]=function(_0xbfa506,_0x9aaa20){var _0x5a0489={},_0x223e33={},_0x304b8f={'count':0x0,'rows':[]};var _0x5f11b2=_[_0x8b44('0x2b')](db[_0x8b44('0x2c')][_0x8b44('0x2d')],function(_0x27c84a){return{'name':_0x27c84a[_0x8b44('0x2e')],'type':_0x27c84a[_0x8b44('0x2f')][_0x8b44('0x30')]};});_0x223e33['model']=_['map'](_0x5f11b2,_0x8b44('0x28'));_0x223e33[_0x8b44('0x31')]=_[_0x8b44('0x32')](_0xbfa506[_0x8b44('0x31')]);_0x223e33[_0x8b44('0x33')]=_[_0x8b44('0x34')](_0x223e33['model'],_0x223e33['query']);_0x5a0489[_0x8b44('0x35')]=_[_0x8b44('0x34')](_0x223e33[_0x8b44('0x36')],qs[_0x8b44('0x37')](_0xbfa506[_0x8b44('0x31')][_0x8b44('0x37')]));_0x5a0489[_0x8b44('0x35')]=_0x5a0489[_0x8b44('0x35')][_0x8b44('0x38')]?_0x5a0489['attributes']:_0x223e33['model'];if(!_0xbfa506[_0x8b44('0x31')]['hasOwnProperty'](_0x8b44('0x39'))){_0x5a0489[_0x8b44('0x1c')]=qs['limit'](_0xbfa506['query']['limit']);_0x5a0489['offset']=qs[_0x8b44('0x1b')](_0xbfa506[_0x8b44('0x31')]['offset']);}_0x5a0489[_0x8b44('0x3a')]=qs[_0x8b44('0x3b')](_0xbfa506['query'][_0x8b44('0x3b')]);_0x5a0489[_0x8b44('0x3c')]=qs['filters'](_[_0x8b44('0x3d')](_0xbfa506[_0x8b44('0x31')],_0x223e33[_0x8b44('0x33')]),_0x5f11b2);if(_0xbfa506[_0x8b44('0x31')][_0x8b44('0x3e')]){_0x5a0489[_0x8b44('0x3c')]=_[_0x8b44('0x3f')](_0x5a0489['where'],{'$or':_[_0x8b44('0x2b')](_0x5f11b2,function(_0x5a188e){if(_0x5a188e[_0x8b44('0x2f')]!==_0x8b44('0x40')){var _0x36f2d1={};_0x36f2d1[_0x5a188e['name']]={'$like':'%'+_0xbfa506[_0x8b44('0x31')]['filter']+'%'};return _0x36f2d1;}})});}_0x5a0489=_[_0x8b44('0x3f')]({},_0x5a0489,_0xbfa506[_0x8b44('0x41')]);var _0x193dbb={'where':_0x5a0489['where']};return db[_0x8b44('0x2c')][_0x8b44('0x42')](_0x193dbb)[_0x8b44('0x25')](function(_0x318059){_0x304b8f[_0x8b44('0x42')]=_0x318059;if(_0xbfa506[_0x8b44('0x31')][_0x8b44('0x43')]){_0x5a0489[_0x8b44('0x44')]=[{'all':!![]}];}return db[_0x8b44('0x2c')][_0x8b44('0x45')](_0x5a0489);})['then'](function(_0x20d005){_0x304b8f[_0x8b44('0x46')]=_0x20d005;return _0x304b8f;})[_0x8b44('0x25')](respondWithFilteredResult(_0x9aaa20,_0x5a0489))[_0x8b44('0x47')](handleError(_0x9aaa20,null));};exports[_0x8b44('0x48')]=function(_0x4a94bd,_0x3d239c){var _0x5e8f98={'raw':!![],'where':{'id':_0x4a94bd[_0x8b44('0x49')]['id']}},_0x8febc1={};_0x8febc1[_0x8b44('0x36')]=_['keys'](db['VoiceDialReport'][_0x8b44('0x2d')]);_0x8febc1[_0x8b44('0x31')]=_['keys'](_0x4a94bd[_0x8b44('0x31')]);_0x8febc1[_0x8b44('0x33')]=_[_0x8b44('0x34')](_0x8febc1[_0x8b44('0x36')],_0x8febc1['query']);_0x5e8f98['attributes']=_[_0x8b44('0x34')](_0x8febc1['model'],qs['fields'](_0x4a94bd[_0x8b44('0x31')][_0x8b44('0x37')]));_0x5e8f98['attributes']=_0x5e8f98['attributes'][_0x8b44('0x38')]?_0x5e8f98[_0x8b44('0x35')]:_0x8febc1[_0x8b44('0x36')];if(_0x4a94bd[_0x8b44('0x31')][_0x8b44('0x43')]){_0x5e8f98[_0x8b44('0x44')]=[{'all':!![]}];}_0x5e8f98=_[_0x8b44('0x3f')]({},_0x5e8f98,_0x4a94bd[_0x8b44('0x41')]);return db['VoiceDialReport'][_0x8b44('0x4a')](_0x5e8f98)['then'](handleEntityNotFound(_0x3d239c,null))[_0x8b44('0x25')](respondWithResult(_0x3d239c,null))[_0x8b44('0x47')](handleError(_0x3d239c,null));};exports['create']=function(_0x38009b,_0x229d9e){return db[_0x8b44('0x2c')]['create'](_0x38009b[_0x8b44('0x4b')],{})[_0x8b44('0x25')](respondWithResult(_0x229d9e,0xc9))[_0x8b44('0x47')](handleError(_0x229d9e,null));};exports['update']=function(_0x15f98f,_0x3f0c23){if(_0x15f98f['body']['id']){delete _0x15f98f[_0x8b44('0x4b')]['id'];}return db[_0x8b44('0x2c')][_0x8b44('0x4a')]({'where':{'id':_0x15f98f['params']['id']}})[_0x8b44('0x25')](handleEntityNotFound(_0x3f0c23,null))[_0x8b44('0x25')](saveUpdates(_0x15f98f[_0x8b44('0x4b')],null))[_0x8b44('0x25')](respondWithResult(_0x3f0c23,null))[_0x8b44('0x47')](handleError(_0x3f0c23,null));};exports['destroy']=function(_0x3a9a5a,_0x4e4429){return db['VoiceDialReport'][_0x8b44('0x4a')]({'where':{'id':_0x3a9a5a[_0x8b44('0x49')]['id']}})[_0x8b44('0x25')](handleEntityNotFound(_0x4e4429,null))['then'](removeEntity(_0x4e4429,null))['catch'](handleError(_0x4e4429,null));};exports[_0x8b44('0x4c')]=function(_0x27837d,_0x3341e6){return db[_0x8b44('0x2c')]['describe']()[_0x8b44('0x25')](respondWithResult(_0x3341e6,null))[_0x8b44('0x47')](handleError(_0x3341e6,null));};
\ No newline at end of file
+var _0xde10=['describe','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','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','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','VoiceDialReport','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','includeAll','include','rows','catch','show','rawAttributes','find','create','body','params'];(function(_0x1d0b80,_0x41fc24){var _0x35d642=function(_0x4c2cb5){while(--_0x4c2cb5){_0x1d0b80['push'](_0x1d0b80['shift']());}};_0x35d642(++_0x41fc24);}(_0xde10,0x1d5));var _0x0de1=function(_0x592855,_0x4eecf6){_0x592855=_0x592855-0x0;var _0x500595=_0xde10[_0x592855];return _0x500595;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0de1('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0de1('0x1'));var rp=require(_0x0de1('0x2'));var moment=require(_0x0de1('0x3'));var BPromise=require(_0x0de1('0x4'));var Mustache=require(_0x0de1('0x5'));var util=require(_0x0de1('0x6'));var path=require(_0x0de1('0x7'));var sox=require('sox');var csv=require(_0x0de1('0x8'));var ejs=require(_0x0de1('0x9'));var fs=require('fs');var fs_extra=require(_0x0de1('0xa'));var _=require(_0x0de1('0xb'));var squel=require(_0x0de1('0xc'));var crypto=require(_0x0de1('0xd'));var jsforce=require(_0x0de1('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0de1('0xf'));var Redis=require(_0x0de1('0x10'));var authService=require(_0x0de1('0x11'));var qs=require(_0x0de1('0x12'));var as=require(_0x0de1('0x13'));var hardwareService=require(_0x0de1('0x14'));var logger=require(_0x0de1('0x15'))(_0x0de1('0x16'));var utils=require('../../config/utils');var config=require(_0x0de1('0x17'));var licenseUtil=require(_0x0de1('0x18'));var db=require(_0x0de1('0x19'))['db'];function respondWithStatusCode(_0xa78866,_0x4bb9b0){_0x4bb9b0=_0x4bb9b0||0xcc;return function(_0x490d0a){if(_0x490d0a){return _0xa78866[_0x0de1('0x1a')](_0x4bb9b0);}return _0xa78866[_0x0de1('0x1b')](_0x4bb9b0)[_0x0de1('0x1c')]();};}function respondWithResult(_0x7cfd37,_0x54648c){_0x54648c=_0x54648c||0xc8;return function(_0xd45f86){if(_0xd45f86){return _0x7cfd37[_0x0de1('0x1b')](_0x54648c)[_0x0de1('0x1d')](_0xd45f86);}};}function respondWithFilteredResult(_0x5ed69c,_0x50d153){return function(_0x66f570){if(_0x66f570){var _0x2f891d=typeof _0x50d153[_0x0de1('0x1e')]==='undefined'&&typeof _0x50d153['limit']===_0x0de1('0x1f');var _0x14bb06=_0x66f570[_0x0de1('0x20')];var _0x402a86=_0x2f891d?0x0:_0x50d153['offset'];var _0xd925c2=_0x2f891d?_0x66f570['count']:_0x50d153[_0x0de1('0x1e')]+_0x50d153['limit'];var _0x174722;if(_0xd925c2>=_0x14bb06){_0xd925c2=_0x14bb06;_0x174722=0xc8;}else{_0x174722=0xce;}_0x5ed69c['status'](_0x174722);return _0x5ed69c[_0x0de1('0x21')]('Content-Range',_0x402a86+'-'+_0xd925c2+'/'+_0x14bb06)[_0x0de1('0x1d')](_0x66f570);}return null;};}function patchUpdates(_0x550add){return function(_0x3f8455){try{jsonpatch[_0x0de1('0x22')](_0x3f8455,_0x550add,!![]);}catch(_0x52ae2b){return BPromise[_0x0de1('0x23')](_0x52ae2b);}return _0x3f8455[_0x0de1('0x24')]();};}function saveUpdates(_0x777ec2,_0x2f716f){return function(_0x5292fd){if(_0x5292fd){return _0x5292fd[_0x0de1('0x25')](_0x777ec2)[_0x0de1('0x26')](function(_0x1653e1){return _0x1653e1;});}return null;};}function removeEntity(_0x46fd78,_0x384537){return function(_0x3b1ebe){if(_0x3b1ebe){return _0x3b1ebe[_0x0de1('0x27')]()['then'](function(){_0x46fd78[_0x0de1('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x251017,_0x3192af){return function(_0x1911ee){if(!_0x1911ee){_0x251017['sendStatus'](0x194);}return _0x1911ee;};}function handleError(_0x58fd44,_0x25cb06){_0x25cb06=_0x25cb06||0x1f4;return function(_0x5a1fea){logger[_0x0de1('0x28')](_0x5a1fea[_0x0de1('0x29')]);if(_0x5a1fea[_0x0de1('0x2a')]){delete _0x5a1fea[_0x0de1('0x2a')];}_0x58fd44[_0x0de1('0x1b')](_0x25cb06)[_0x0de1('0x2b')](_0x5a1fea);};}exports[_0x0de1('0x2c')]=function(_0x401cf2,_0x2cf8da){var _0x4fee97={},_0x63925={},_0x21a3b9={'count':0x0,'rows':[]};var _0x446316=_['map'](db[_0x0de1('0x2d')]['rawAttributes'],function(_0x2d34f3){return{'name':_0x2d34f3[_0x0de1('0x2e')],'type':_0x2d34f3[_0x0de1('0x2f')][_0x0de1('0x30')]};});_0x63925[_0x0de1('0x31')]=_[_0x0de1('0x32')](_0x446316,_0x0de1('0x2a'));_0x63925[_0x0de1('0x33')]=_[_0x0de1('0x34')](_0x401cf2[_0x0de1('0x33')]);_0x63925[_0x0de1('0x35')]=_[_0x0de1('0x36')](_0x63925[_0x0de1('0x31')],_0x63925[_0x0de1('0x33')]);_0x4fee97[_0x0de1('0x37')]=_[_0x0de1('0x36')](_0x63925['model'],qs[_0x0de1('0x38')](_0x401cf2[_0x0de1('0x33')]['fields']));_0x4fee97[_0x0de1('0x37')]=_0x4fee97['attributes'][_0x0de1('0x39')]?_0x4fee97[_0x0de1('0x37')]:_0x63925[_0x0de1('0x31')];if(!_0x401cf2['query'][_0x0de1('0x3a')](_0x0de1('0x3b'))){_0x4fee97['limit']=qs[_0x0de1('0x3c')](_0x401cf2[_0x0de1('0x33')]['limit']);_0x4fee97[_0x0de1('0x1e')]=qs[_0x0de1('0x1e')](_0x401cf2[_0x0de1('0x33')][_0x0de1('0x1e')]);}_0x4fee97[_0x0de1('0x3d')]=qs['sort'](_0x401cf2[_0x0de1('0x33')][_0x0de1('0x3e')]);_0x4fee97[_0x0de1('0x3f')]=qs[_0x0de1('0x35')](_[_0x0de1('0x40')](_0x401cf2['query'],_0x63925[_0x0de1('0x35')]),_0x446316);if(_0x401cf2[_0x0de1('0x33')][_0x0de1('0x41')]){_0x4fee97['where']=_[_0x0de1('0x42')](_0x4fee97['where'],{'$or':_[_0x0de1('0x32')](_0x446316,function(_0x1d2e4c){if(_0x1d2e4c[_0x0de1('0x2f')]!=='VIRTUAL'){var _0x2c8985={};_0x2c8985[_0x1d2e4c[_0x0de1('0x2a')]]={'$like':'%'+_0x401cf2[_0x0de1('0x33')]['filter']+'%'};return _0x2c8985;}})});}_0x4fee97=_[_0x0de1('0x42')]({},_0x4fee97,_0x401cf2['options']);var _0x54ed32={'where':_0x4fee97[_0x0de1('0x3f')]};return db[_0x0de1('0x2d')][_0x0de1('0x20')](_0x54ed32)[_0x0de1('0x26')](function(_0x218ec5){_0x21a3b9['count']=_0x218ec5;if(_0x401cf2[_0x0de1('0x33')][_0x0de1('0x43')]){_0x4fee97[_0x0de1('0x44')]=[{'all':!![]}];}return db[_0x0de1('0x2d')]['findAll'](_0x4fee97);})['then'](function(_0x3f35c2){_0x21a3b9[_0x0de1('0x45')]=_0x3f35c2;return _0x21a3b9;})[_0x0de1('0x26')](respondWithFilteredResult(_0x2cf8da,_0x4fee97))[_0x0de1('0x46')](handleError(_0x2cf8da,null));};exports[_0x0de1('0x47')]=function(_0x1a090a,_0x1bf938){var _0x3ae58d={'raw':!![],'where':{'id':_0x1a090a['params']['id']}},_0x54cbd9={};_0x54cbd9[_0x0de1('0x31')]=_[_0x0de1('0x34')](db[_0x0de1('0x2d')][_0x0de1('0x48')]);_0x54cbd9[_0x0de1('0x33')]=_[_0x0de1('0x34')](_0x1a090a['query']);_0x54cbd9['filters']=_[_0x0de1('0x36')](_0x54cbd9[_0x0de1('0x31')],_0x54cbd9['query']);_0x3ae58d[_0x0de1('0x37')]=_['intersection'](_0x54cbd9[_0x0de1('0x31')],qs[_0x0de1('0x38')](_0x1a090a[_0x0de1('0x33')][_0x0de1('0x38')]));_0x3ae58d[_0x0de1('0x37')]=_0x3ae58d[_0x0de1('0x37')][_0x0de1('0x39')]?_0x3ae58d[_0x0de1('0x37')]:_0x54cbd9[_0x0de1('0x31')];if(_0x1a090a[_0x0de1('0x33')][_0x0de1('0x43')]){_0x3ae58d[_0x0de1('0x44')]=[{'all':!![]}];}_0x3ae58d=_[_0x0de1('0x42')]({},_0x3ae58d,_0x1a090a['options']);return db['VoiceDialReport'][_0x0de1('0x49')](_0x3ae58d)['then'](handleEntityNotFound(_0x1bf938,null))[_0x0de1('0x26')](respondWithResult(_0x1bf938,null))[_0x0de1('0x46')](handleError(_0x1bf938,null));};exports[_0x0de1('0x4a')]=function(_0x4b036f,_0x437e3d){return db[_0x0de1('0x2d')][_0x0de1('0x4a')](_0x4b036f[_0x0de1('0x4b')],{})[_0x0de1('0x26')](respondWithResult(_0x437e3d,0xc9))[_0x0de1('0x46')](handleError(_0x437e3d,null));};exports['update']=function(_0x353b9e,_0x35ca9){if(_0x353b9e[_0x0de1('0x4b')]['id']){delete _0x353b9e[_0x0de1('0x4b')]['id'];}return db[_0x0de1('0x2d')]['find']({'where':{'id':_0x353b9e['params']['id']}})['then'](handleEntityNotFound(_0x35ca9,null))[_0x0de1('0x26')](saveUpdates(_0x353b9e[_0x0de1('0x4b')],null))[_0x0de1('0x26')](respondWithResult(_0x35ca9,null))[_0x0de1('0x46')](handleError(_0x35ca9,null));};exports['destroy']=function(_0x5e7b5d,_0x2ed4f1){return db['VoiceDialReport'][_0x0de1('0x49')]({'where':{'id':_0x5e7b5d[_0x0de1('0x4c')]['id']}})[_0x0de1('0x26')](handleEntityNotFound(_0x2ed4f1,null))[_0x0de1('0x26')](removeEntity(_0x2ed4f1,null))['catch'](handleError(_0x2ed4f1,null));};exports['describe']=function(_0x192c6c,_0x5a022e){return db[_0x0de1('0x2d')][_0x0de1('0x4d')]()['then'](respondWithResult(_0x5a022e,null))[_0x0de1('0x46')](handleError(_0x5a022e,null));};
\ No newline at end of file
index a02914d..44adc92 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6dfa=['VoiceDialReport','report_dial','uniqueid','lodash','util','../../config/logger','api','moment','request-promise','rimraf','exports','define'];(function(_0x5d1044,_0x18f656){var _0x3cd90e=function(_0x3c40be){while(--_0x3c40be){_0x5d1044['push'](_0x5d1044['shift']());}};_0x3cd90e(++_0x18f656);}(_0x6dfa,0x7b));var _0xa6df=function(_0x3abfad,_0x9c43a2){_0x3abfad=_0x3abfad-0x0;var _0x260ace=_0x6dfa[_0x3abfad];return _0x260ace;};'use strict';var _=require(_0xa6df('0x0'));var util=require(_0xa6df('0x1'));var logger=require(_0xa6df('0x2'))(_0xa6df('0x3'));var moment=require(_0xa6df('0x4'));var BPromise=require('bluebird');var rp=require(_0xa6df('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa6df('0x6'));var config=require('../../config/environment');var attributes=require('./voiceDialReport.attributes');module[_0xa6df('0x7')]=function(_0x273081,_0x3299a2){return _0x273081[_0xa6df('0x8')](_0xa6df('0x9'),attributes,{'tableName':_0xa6df('0xa'),'paranoid':![],'indexes':[{'fields':[_0xa6df('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x9917=['request-promise','path','rimraf','../../config/environment','./voiceDialReport.attributes','exports','define','report_dial','uniqueid','lodash','../../config/logger','api','moment'];(function(_0x4ab2fd,_0x16480d){var _0x2bd55f=function(_0x382bf1){while(--_0x382bf1){_0x4ab2fd['push'](_0x4ab2fd['shift']());}};_0x2bd55f(++_0x16480d);}(_0x9917,0xe6));var _0x7991=function(_0x3c89bc,_0x5d349e){_0x3c89bc=_0x3c89bc-0x0;var _0x43837d=_0x9917[_0x3c89bc];return _0x43837d;};'use strict';var _=require(_0x7991('0x0'));var util=require('util');var logger=require(_0x7991('0x1'))(_0x7991('0x2'));var moment=require(_0x7991('0x3'));var BPromise=require('bluebird');var rp=require(_0x7991('0x4'));var fs=require('fs');var path=require(_0x7991('0x5'));var rimraf=require(_0x7991('0x6'));var config=require(_0x7991('0x7'));var attributes=require(_0x7991('0x8'));module[_0x7991('0x9')]=function(_0x2235eb,_0xd3bd12){return _0x2235eb[_0x7991('0xa')]('VoiceDialReport',attributes,{'tableName':_0x7991('0xb'),'paranoid':![],'indexes':[{'fields':[_0x7991('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
index 0edd38f..9e87454 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4b13=['then','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','CreateVoiceDialReport','VoiceDialReport','create','body','options','UpdateVoiceDialReport','update','raw','where','attributes','limit','moment','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0xbd0264,_0x19d3ff){var _0x21eb7e=function(_0x17697a){while(--_0x17697a){_0xbd0264['push'](_0xbd0264['shift']());}};_0x21eb7e(++_0x19d3ff);}(_0x4b13,0x1d7));var _0x34b1=function(_0x17d99f,_0x3fab1e){_0x17d99f=_0x17d99f-0x0;var _0x1dbd5a=_0x4b13[_0x17d99f];return _0x1dbd5a;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x34b1('0x0'));var BPromise=require('bluebird');var rs=require(_0x34b1('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x34b1('0x2'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x34b1('0x3'));var config=require(_0x34b1('0x4'));var jayson=require(_0x34b1('0x5'));var client=jayson[_0x34b1('0x6')][_0x34b1('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x35a4bb,_0x14459a,_0x3dcc92){return new BPromise(function(_0x278d7a,_0xfb13d9){return client[_0x34b1('0x8')](_0x35a4bb,_0x3dcc92)[_0x34b1('0x9')](function(_0x1b3741){logger[_0x34b1('0xa')](_0x34b1('0xb'),_0x14459a,_0x34b1('0xc'));logger[_0x34b1('0xd')]('VoiceDialReport,\x20%s,\x20%s,\x20%s',_0x14459a,_0x34b1('0xc'),JSON['stringify'](_0x1b3741));if(_0x1b3741[_0x34b1('0xe')]){if(_0x1b3741[_0x34b1('0xe')][_0x34b1('0xf')]===0x1f4){logger[_0x34b1('0xe')](_0x34b1('0xb'),_0x14459a,_0x1b3741['error'][_0x34b1('0x10')]);return _0xfb13d9(_0x1b3741[_0x34b1('0xe')][_0x34b1('0x10')]);}logger['error'](_0x34b1('0xb'),_0x14459a,_0x1b3741[_0x34b1('0xe')][_0x34b1('0x10')]);return _0x278d7a(_0x1b3741[_0x34b1('0xe')]['message']);}else{logger[_0x34b1('0xa')](_0x34b1('0xb'),_0x14459a,'request\x20sent');_0x278d7a(_0x1b3741[_0x34b1('0x11')][_0x34b1('0x10')]);}})[_0x34b1('0x12')](function(_0x7551d5){logger[_0x34b1('0xe')](_0x34b1('0xb'),_0x14459a,_0x7551d5);_0xfb13d9(_0x7551d5);});});}exports[_0x34b1('0x13')]=function(_0x5aaf3c){var _0x4b689c=this;return new Promise(function(_0x48cc77,_0x281045){return db[_0x34b1('0x14')][_0x34b1('0x15')](_0x5aaf3c[_0x34b1('0x16')],{'raw':_0x5aaf3c[_0x34b1('0x17')]?_0x5aaf3c[_0x34b1('0x17')]['raw']===undefined?!![]:![]:!![]})[_0x34b1('0x9')](function(_0x4a746a){logger[_0x34b1('0xa')](_0x34b1('0x13'),_0x5aaf3c);logger['debug'](_0x34b1('0x13'),_0x5aaf3c,JSON['stringify'](_0x4a746a));_0x48cc77(_0x4a746a);})['catch'](function(_0x155150){logger[_0x34b1('0xe')](_0x34b1('0x13'),_0x155150[_0x34b1('0x10')],_0x5aaf3c);_0x281045(_0x4b689c['error'](0x1f4,_0x155150[_0x34b1('0x10')]));});});};exports[_0x34b1('0x18')]=function(_0x4a61aa){var _0x97a7ac=this;return new Promise(function(_0x588930,_0x14242a){return db[_0x34b1('0x14')][_0x34b1('0x19')](_0x4a61aa[_0x34b1('0x16')],{'raw':_0x4a61aa[_0x34b1('0x17')]?_0x4a61aa[_0x34b1('0x17')][_0x34b1('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4a61aa[_0x34b1('0x17')]?_0x4a61aa['options'][_0x34b1('0x1b')]||null:null,'attributes':_0x4a61aa[_0x34b1('0x17')]?_0x4a61aa['options'][_0x34b1('0x1c')]||null:null,'limit':_0x4a61aa['options']?_0x4a61aa[_0x34b1('0x17')][_0x34b1('0x1d')]||null:null})['then'](function(_0x4a2772){logger[_0x34b1('0xa')](_0x34b1('0x18'),_0x4a61aa);logger[_0x34b1('0xd')](_0x34b1('0x18'),_0x4a61aa,JSON['stringify'](_0x4a2772));_0x588930(_0x4a2772);})[_0x34b1('0x12')](function(_0x2ade2e){logger['error'](_0x34b1('0x18'),_0x2ade2e[_0x34b1('0x10')],_0x4a61aa);_0x14242a(_0x97a7ac['error'](0x1f4,_0x2ade2e[_0x34b1('0x10')]));});});};
\ No newline at end of file
+var _0xd8fb=['where','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CreateVoiceDialReport','VoiceDialReport','create','body','options','raw','UpdateVoiceDialReport','update'];(function(_0x453ff1,_0x51d06b){var _0x36f097=function(_0x5af956){while(--_0x5af956){_0x453ff1['push'](_0x453ff1['shift']());}};_0x36f097(++_0x51d06b);}(_0xd8fb,0xb1));var _0xbd8f=function(_0x401bfa,_0x1c36bc){_0x401bfa=_0x401bfa-0x0;var _0x52fd2b=_0xd8fb[_0x401bfa];return _0x52fd2b;};'use strict';var _=require(_0xbd8f('0x0'));var util=require(_0xbd8f('0x1'));var moment=require(_0xbd8f('0x2'));var BPromise=require(_0xbd8f('0x3'));var rs=require(_0xbd8f('0x4'));var fs=require('fs');var Redis=require(_0xbd8f('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xbd8f('0x6'));var logger=require(_0xbd8f('0x7'))(_0xbd8f('0x8'));var config=require(_0xbd8f('0x9'));var jayson=require(_0xbd8f('0xa'));var client=jayson[_0xbd8f('0xb')][_0xbd8f('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1d4cc6,_0x34cbea,_0x8c81b5){return new BPromise(function(_0x14defb,_0x55012f){return client[_0xbd8f('0xd')](_0x1d4cc6,_0x8c81b5)[_0xbd8f('0xe')](function(_0xc0c29e){logger[_0xbd8f('0xf')](_0xbd8f('0x10'),_0x34cbea,_0xbd8f('0x11'));logger[_0xbd8f('0x12')]('VoiceDialReport,\x20%s,\x20%s,\x20%s',_0x34cbea,_0xbd8f('0x11'),JSON[_0xbd8f('0x13')](_0xc0c29e));if(_0xc0c29e[_0xbd8f('0x14')]){if(_0xc0c29e[_0xbd8f('0x14')][_0xbd8f('0x15')]===0x1f4){logger[_0xbd8f('0x14')](_0xbd8f('0x10'),_0x34cbea,_0xc0c29e[_0xbd8f('0x14')][_0xbd8f('0x16')]);return _0x55012f(_0xc0c29e[_0xbd8f('0x14')][_0xbd8f('0x16')]);}logger['error'](_0xbd8f('0x10'),_0x34cbea,_0xc0c29e['error']['message']);return _0x14defb(_0xc0c29e[_0xbd8f('0x14')][_0xbd8f('0x16')]);}else{logger[_0xbd8f('0xf')](_0xbd8f('0x10'),_0x34cbea,_0xbd8f('0x11'));_0x14defb(_0xc0c29e[_0xbd8f('0x17')][_0xbd8f('0x16')]);}})[_0xbd8f('0x18')](function(_0xb04258){logger[_0xbd8f('0x14')]('VoiceDialReport,\x20%s,\x20%s',_0x34cbea,_0xb04258);_0x55012f(_0xb04258);});});}exports[_0xbd8f('0x19')]=function(_0x2af2e5){var _0x237795=this;return new Promise(function(_0x54b098,_0x2fc061){return db[_0xbd8f('0x1a')][_0xbd8f('0x1b')](_0x2af2e5[_0xbd8f('0x1c')],{'raw':_0x2af2e5[_0xbd8f('0x1d')]?_0x2af2e5[_0xbd8f('0x1d')][_0xbd8f('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0x461017){logger['info']('CreateVoiceDialReport',_0x2af2e5);logger[_0xbd8f('0x12')]('CreateVoiceDialReport',_0x2af2e5,JSON[_0xbd8f('0x13')](_0x461017));_0x54b098(_0x461017);})[_0xbd8f('0x18')](function(_0x153f2c){logger[_0xbd8f('0x14')](_0xbd8f('0x19'),_0x153f2c[_0xbd8f('0x16')],_0x2af2e5);_0x2fc061(_0x237795['error'](0x1f4,_0x153f2c[_0xbd8f('0x16')]));});});};exports[_0xbd8f('0x1f')]=function(_0x1ac8f6){var _0xc05953=this;return new Promise(function(_0xbfa031,_0x13451d){return db[_0xbd8f('0x1a')][_0xbd8f('0x20')](_0x1ac8f6[_0xbd8f('0x1c')],{'raw':_0x1ac8f6[_0xbd8f('0x1d')]?_0x1ac8f6[_0xbd8f('0x1d')][_0xbd8f('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1ac8f6[_0xbd8f('0x1d')]?_0x1ac8f6['options'][_0xbd8f('0x21')]||null:null,'attributes':_0x1ac8f6[_0xbd8f('0x1d')]?_0x1ac8f6['options']['attributes']||null:null,'limit':_0x1ac8f6[_0xbd8f('0x1d')]?_0x1ac8f6[_0xbd8f('0x1d')][_0xbd8f('0x22')]||null:null})['then'](function(_0xa02538){logger[_0xbd8f('0xf')](_0xbd8f('0x1f'),_0x1ac8f6);logger['debug'](_0xbd8f('0x1f'),_0x1ac8f6,JSON['stringify'](_0xa02538));_0xbfa031(_0xa02538);})[_0xbd8f('0x18')](function(_0x2943e2){logger[_0xbd8f('0x14')]('UpdateVoiceDialReport',_0x2943e2['message'],_0x1ac8f6);_0x13451d(_0xc05953[_0xbd8f('0x14')](0x1f4,_0x2943e2['message']));});});};
\ No newline at end of file
index 420e84a..990e13f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0070=['/:id','post','create','/:id/applications','isAuthenticated','addApplications','put','update','delete','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','index'];(function(_0x8c540d,_0x1eed5b){var _0x22ed75=function(_0x3aefbf){while(--_0x3aefbf){_0x8c540d['push'](_0x8c540d['shift']());}};_0x22ed75(++_0x1eed5b);}(_0x0070,0xdb));var _0x0007=function(_0x2d3a4d,_0x47561e){_0x2d3a4d=_0x2d3a4d-0x0;var _0x3a94a3=_0x0070[_0x2d3a4d];return _0x3a94a3;};'use strict';var multer=require(_0x0007('0x0'));var util=require(_0x0007('0x1'));var path=require(_0x0007('0x2'));var timeout=require('connect-timeout');var express=require(_0x0007('0x3'));var router=express[_0x0007('0x4')]();var fs_extra=require(_0x0007('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0007('0x6'));var config=require(_0x0007('0x7'));var controller=require('./voiceExtension.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x0007('0x8')]);router['get'](_0x0007('0x9'),auth['isAuthenticated'](),controller['show']);router[_0x0007('0xa')]('/',auth['isAuthenticated'](),controller[_0x0007('0xb')]);router[_0x0007('0xa')](_0x0007('0xc'),auth[_0x0007('0xd')](),controller[_0x0007('0xe')]);router[_0x0007('0xf')](_0x0007('0x9'),auth[_0x0007('0xd')](),controller[_0x0007('0x10')]);router[_0x0007('0x11')](_0x0007('0x9'),auth[_0x0007('0xd')](),controller['destroy']);module[_0x0007('0x12')]=router;
\ No newline at end of file
+var _0xc212=['post','/:id/applications','addApplications','/:id','update','delete','destroy','exports','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceExtension.controller','get','isAuthenticated','index','show'];(function(_0xb00f0d,_0xa51fd3){var _0x2a9876=function(_0x4f7795){while(--_0x4f7795){_0xb00f0d['push'](_0xb00f0d['shift']());}};_0x2a9876(++_0xa51fd3);}(_0xc212,0x1c0));var _0x2c21=function(_0x26cb93,_0x4c3007){_0x26cb93=_0x26cb93-0x0;var _0x2b947b=_0xc212[_0x26cb93];return _0x2b947b;};'use strict';var multer=require('multer');var util=require(_0x2c21('0x0'));var path=require(_0x2c21('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x2c21('0x2')]();var fs_extra=require(_0x2c21('0x3'));var auth=require(_0x2c21('0x4'));var interaction=require(_0x2c21('0x5'));var config=require(_0x2c21('0x6'));var controller=require(_0x2c21('0x7'));router[_0x2c21('0x8')]('/',auth[_0x2c21('0x9')](),controller[_0x2c21('0xa')]);router[_0x2c21('0x8')]('/:id',auth[_0x2c21('0x9')](),controller[_0x2c21('0xb')]);router[_0x2c21('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0x2c21('0xc')](_0x2c21('0xd'),auth[_0x2c21('0x9')](),controller[_0x2c21('0xe')]);router['put'](_0x2c21('0xf'),auth[_0x2c21('0x9')](),controller[_0x2c21('0x10')]);router[_0x2c21('0x11')](_0x2c21('0xf'),auth['isAuthenticated'](),controller[_0x2c21('0x12')]);module[_0x2c21('0x13')]=router;
\ No newline at end of file
index e47abb8..70e93dd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbf2e=['inbound-fax','any','*,*,*,*','INTEGER','BOOLEAN','wav','VIRTUAL','getDataValue','exten','sequelize','STRING','compositeIndex','NoOp','ENUM','inbound','outbound','internal'];(function(_0x3c43f9,_0x59dd5b){var _0xe67d3b=function(_0x201607){while(--_0x201607){_0x3c43f9['push'](_0x3c43f9['shift']());}};_0xe67d3b(++_0x59dd5b);}(_0xbf2e,0x1d4));var _0xebf2=function(_0x4b92e4,_0x1b7ea3){_0x4b92e4=_0x4b92e4-0x0;var _0x198f7f=_0xbf2e[_0x4b92e4];return _0x198f7f;};'use strict';var Sequelize=require(_0xebf2('0x0'));module['exports']={'context':{'type':Sequelize[_0xebf2('0x1')],'allowNull':![],'unique':_0xebf2('0x2'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0xebf2('0x1')],'allowNull':![],'unique':_0xebf2('0x2')},'priority':{'type':Sequelize[_0xebf2('0x1')],'allowNull':![],'defaultValue':'1','unique':_0xebf2('0x2')},'tag':{'type':Sequelize[_0xebf2('0x1')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xebf2('0x3')},'appdata':{'type':Sequelize[_0xebf2('0x1')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0xebf2('0x4')](_0xebf2('0x5'),_0xebf2('0x6'),_0xebf2('0x7'),_0xebf2('0x8'),'outbound-fax','system',_0xebf2('0x9')),'allowNull':![]},'description':{'type':Sequelize[_0xebf2('0x1')]},'interval':{'type':Sequelize[_0xebf2('0x1')],'allowNull':![],'defaultValue':_0xebf2('0xa')},'IntervalId':{'type':Sequelize[_0xebf2('0xb')]},'isApp':{'type':Sequelize[_0xebf2('0xc')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0xebf2('0x1')],'defaultValue':null},'callerID':{'type':Sequelize[_0xebf2('0x1')],'allowNull':!![]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0xebf2('0xb')]},'recordingFormat':{'type':Sequelize['STRING'],'defaultValue':_0xebf2('0xd')},'answer':{'type':Sequelize[_0xebf2('0xc')],'defaultValue':!![]},'name':{'type':Sequelize[_0xebf2('0xe')],'get':function(_0x5f2456){return this[_0xebf2('0xf')](_0xebf2('0x10'));}},'alias':{'type':Sequelize[_0xebf2('0x1')],'allowNull':!![]}};
\ No newline at end of file
+var _0x95bd=['exten','sequelize','exports','STRING','compositeIndex','inbound','internal','inbound-fax','outbound-fax','system','*,*,*,*','INTEGER','wav','BOOLEAN','VIRTUAL'];(function(_0x9fc40a,_0x2da87f){var _0x43623e=function(_0xc932d){while(--_0xc932d){_0x9fc40a['push'](_0x9fc40a['shift']());}};_0x43623e(++_0x2da87f);}(_0x95bd,0x1e1));var _0xd95b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x95bd[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xd95b('0x0'));module[_0xd95b('0x1')]={'context':{'type':Sequelize[_0xd95b('0x2')],'allowNull':![],'unique':_0xd95b('0x3'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0xd95b('0x2')],'allowNull':![],'unique':'compositeIndex'},'priority':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'1','unique':'compositeIndex'},'tag':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0xd95b('0x2')],'allowNull':![],'defaultValue':'NoOp'},'appdata':{'type':Sequelize[_0xd95b('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize['ENUM'](_0xd95b('0x4'),'outbound',_0xd95b('0x5'),_0xd95b('0x6'),_0xd95b('0x7'),_0xd95b('0x8'),'any'),'allowNull':![]},'description':{'type':Sequelize[_0xd95b('0x2')]},'interval':{'type':Sequelize[_0xd95b('0x2')],'allowNull':![],'defaultValue':_0xd95b('0x9')},'IntervalId':{'type':Sequelize[_0xd95b('0xa')]},'isApp':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0xd95b('0x2')],'defaultValue':null},'callerID':{'type':Sequelize[_0xd95b('0x2')],'allowNull':!![]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0xd95b('0xa')]},'recordingFormat':{'type':Sequelize[_0xd95b('0x2')],'defaultValue':_0xd95b('0xb')},'answer':{'type':Sequelize[_0xd95b('0xc')],'defaultValue':!![]},'name':{'type':Sequelize[_0xd95b('0xd')],'get':function(_0x381f92){return this['getDataValue'](_0xd95b('0xe'));}},'alias':{'type':Sequelize['STRING'],'allowNull':!![]}};
\ No newline at end of file
index 47a9eac..7527497 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8955=['context','addApplications','sequelize','transaction','ISOLATION_LEVELS','READ_COMMITTED','findOne','VoiceExtensionId','isApp','createRouting','findAndCountAll','finally','send','lodash','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','localhost','./voiceExtension.socket','status','json','limit','undefined','count','offset','set','Content-Range','destroy','then','get','InboundRoutes','inbound','OutboundRoutes','outbound','InternalRoutes','internal','filter','value','includes','type','name','end','sendStatus','error','stack','index','rawAttributes','fieldName','model','map','query','intersection','fields','attributes','hasOwnProperty','nolimit','order','where','filters','pick','VIRTUAL','merge','options','VoiceExtension','includeAll','include','catch','params','keys','find','create','body','startsWith','exten','concat','user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','description','cutdigits','mandatoryDisposition','alias'];(function(_0x5d8018,_0x588592){var _0x151ac4=function(_0x548679){while(--_0x548679){_0x5d8018['push'](_0x5d8018['shift']());}};_0x151ac4(++_0x588592);}(_0x8955,0x115));var _0x5895=function(_0x150b39,_0x45091f){_0x150b39=_0x150b39-0x0;var _0x30be92=_0x8955[_0x150b39];return _0x30be92;};'use strict';var _=require(_0x5895('0x0'));var Redis=require(_0x5895('0x1'));var qs=require(_0x5895('0x2'));var logger=require('../../config/logger')(_0x5895('0x3'));var config=require(_0x5895('0x4'));var db=require(_0x5895('0x5'))['db'];config[_0x5895('0x6')]=_['defaults'](config[_0x5895('0x6')],{'host':_0x5895('0x7'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5895('0x6')]));require(_0x5895('0x8'))['register'](socket);function respondWithStatusCode(_0x1ceb6e,_0x13425b){_0x13425b=_0x13425b||0xcc;return function(_0x68c1e1){if(_0x68c1e1){return _0x1ceb6e['sendStatus'](_0x13425b);}return _0x1ceb6e[_0x5895('0x9')](_0x13425b)['end']();};}function respondWithResult(_0x14b721,_0x9e071f){_0x9e071f=_0x9e071f||0xc8;return function(_0x206818){if(_0x206818){return _0x14b721[_0x5895('0x9')](_0x9e071f)[_0x5895('0xa')](_0x206818);}};}function respondWithFilteredResult(_0x1b5552,_0x65d066){return function(_0x38fb76){if(_0x38fb76){var _0x40a1c9=typeof _0x65d066['offset']==='undefined'&&typeof _0x65d066[_0x5895('0xb')]===_0x5895('0xc');var _0x35dca9=_0x38fb76[_0x5895('0xd')];var _0x2b3e9d=_0x40a1c9?0x0:_0x65d066[_0x5895('0xe')];var _0x27c894=_0x40a1c9?_0x38fb76['count']:_0x65d066['offset']+_0x65d066['limit'];var _0x3197c5;if(_0x27c894>=_0x35dca9){_0x27c894=_0x35dca9;_0x3197c5=0xc8;}else{_0x3197c5=0xce;}_0x1b5552['status'](_0x3197c5);return _0x1b5552[_0x5895('0xf')](_0x5895('0x10'),_0x2b3e9d+'-'+_0x27c894+'/'+_0x35dca9)[_0x5895('0xa')](_0x38fb76);}return null;};}function removeEntity(_0x3570d7){return function(_0x2ead63){if(_0x2ead63){return _0x2ead63[_0x5895('0x11')]()[_0x5895('0x12')](function(){var _0x129f08=_0x2ead63[_0x5895('0x13')]({'plain':!![]});var _0x16479d=[{'name':_0x5895('0x14'),'value':_0x5895('0x15'),'ignore':![]},{'name':_0x5895('0x16'),'value':_0x5895('0x17'),'ignore':![]},{'name':_0x5895('0x18'),'value':_0x5895('0x19'),'ignore':![]}];var _0x23500b=_(_0x16479d)[_0x5895('0x1a')]('ignore')['map'](_0x5895('0x1b'))[_0x5895('0x1b')]();if(_[_0x5895('0x1c')](_0x23500b,_0x129f08[_0x5895('0x1d')])){return;}var _0x3e4c32=_['find'](_0x16479d,[_0x5895('0x1b'),_0x129f08[_0x5895('0x1d')]])[_0x5895('0x1e')];return db['UserProfileResource'][_0x5895('0x11')]({'where':{'type':_0x3e4c32,'resourceId':_0x129f08['id']}})[_0x5895('0x12')](function(){return _0x2ead63;});})['then'](function(){_0x3570d7['status'](0xcc)[_0x5895('0x1f')]();});}};}function handleEntityNotFound(_0x41ec9e){return function(_0x2dabbe){if(!_0x2dabbe){_0x41ec9e[_0x5895('0x20')](0x194);}return _0x2dabbe;};}function handleError(_0x3a7f60,_0x1775c7){_0x1775c7=_0x1775c7||0x1f4;return function(_0x5d20cf){logger[_0x5895('0x21')](_0x5d20cf[_0x5895('0x22')]);if(_0x5d20cf[_0x5895('0x1e')]){delete _0x5d20cf[_0x5895('0x1e')];}_0x3a7f60[_0x5895('0x9')](_0x1775c7)['send'](_0x5d20cf);};}exports[_0x5895('0x23')]=function(_0x126b59,_0x16e52a){var _0x402bbb={},_0x293125={},_0x47ac00={'count':0x0,'rows':[]};var _0xa343b6=_['map'](db['VoiceExtension'][_0x5895('0x24')],function(_0x50c74c){return{'name':_0x50c74c[_0x5895('0x25')],'type':_0x50c74c['type']['key']};});_0x293125[_0x5895('0x26')]=_[_0x5895('0x27')](_0xa343b6,'name');_0x293125[_0x5895('0x28')]=_['keys'](_0x126b59[_0x5895('0x28')]);_0x293125['filters']=_['intersection'](_0x293125['model'],_0x293125[_0x5895('0x28')]);_0x402bbb['attributes']=_[_0x5895('0x29')](_0x293125[_0x5895('0x26')],qs[_0x5895('0x2a')](_0x126b59['query'][_0x5895('0x2a')]));_0x402bbb[_0x5895('0x2b')]=_0x402bbb[_0x5895('0x2b')]['length']?_0x402bbb[_0x5895('0x2b')]:_0x293125[_0x5895('0x26')];if(!_0x126b59[_0x5895('0x28')][_0x5895('0x2c')](_0x5895('0x2d'))){_0x402bbb[_0x5895('0xb')]=qs[_0x5895('0xb')](_0x126b59[_0x5895('0x28')][_0x5895('0xb')]);_0x402bbb[_0x5895('0xe')]=qs[_0x5895('0xe')](_0x126b59['query'][_0x5895('0xe')]);}_0x402bbb[_0x5895('0x2e')]=qs['sort'](_0x126b59[_0x5895('0x28')]['sort']);_0x402bbb[_0x5895('0x2f')]=qs[_0x5895('0x30')](_[_0x5895('0x31')](_0x126b59[_0x5895('0x28')],_0x293125[_0x5895('0x30')]),_0xa343b6);if(_0x126b59['query'][_0x5895('0x1a')]){_0x402bbb[_0x5895('0x2f')]=_['merge'](_0x402bbb[_0x5895('0x2f')],{'$or':_[_0x5895('0x27')](_0xa343b6,function(_0x5edcd0){if(_0x5edcd0[_0x5895('0x1d')]!==_0x5895('0x32')){var _0x29e972={};_0x29e972[_0x5edcd0[_0x5895('0x1e')]]={'$like':'%'+_0x126b59[_0x5895('0x28')][_0x5895('0x1a')]+'%'};return _0x29e972;}})});}_0x402bbb=_[_0x5895('0x33')]({},_0x402bbb,_0x126b59[_0x5895('0x34')]);var _0x2c8f54={'where':_0x402bbb[_0x5895('0x2f')]};return db[_0x5895('0x35')]['count'](_0x2c8f54)[_0x5895('0x12')](function(_0x344240){_0x47ac00[_0x5895('0xd')]=_0x344240;if(_0x126b59['query'][_0x5895('0x36')]){_0x402bbb[_0x5895('0x37')]=[{'all':!![]}];}return db['VoiceExtension']['findAll'](_0x402bbb);})['then'](function(_0x2b1052){_0x47ac00['rows']=_0x2b1052;return _0x47ac00;})[_0x5895('0x12')](respondWithFilteredResult(_0x16e52a,_0x402bbb))[_0x5895('0x38')](handleError(_0x16e52a,null));};exports['show']=function(_0x16f07b,_0x2e051e){var _0x21e887={'raw':![],'where':{'id':_0x16f07b[_0x5895('0x39')]['id']}},_0x317292={};_0x317292['model']=_['keys'](db[_0x5895('0x35')][_0x5895('0x24')]);_0x317292[_0x5895('0x28')]=_[_0x5895('0x3a')](_0x16f07b[_0x5895('0x28')]);_0x317292['filters']=_[_0x5895('0x29')](_0x317292['model'],_0x317292['query']);_0x21e887[_0x5895('0x2b')]=_[_0x5895('0x29')](_0x317292[_0x5895('0x26')],qs[_0x5895('0x2a')](_0x16f07b['query'][_0x5895('0x2a')]));_0x21e887[_0x5895('0x2b')]=_0x21e887[_0x5895('0x2b')]['length']?_0x21e887[_0x5895('0x2b')]:_0x317292[_0x5895('0x26')];if(_0x16f07b[_0x5895('0x28')][_0x5895('0x36')]){_0x21e887[_0x5895('0x37')]=[{'all':!![]}];}_0x21e887=_[_0x5895('0x33')]({},_0x21e887,_0x16f07b[_0x5895('0x34')]);return db[_0x5895('0x35')][_0x5895('0x3b')](_0x21e887)[_0x5895('0x12')](handleEntityNotFound(_0x2e051e,null))[_0x5895('0x12')](respondWithResult(_0x2e051e,null))[_0x5895('0x38')](handleError(_0x2e051e,null));};exports[_0x5895('0x11')]=function(_0x276ffc,_0x2e82ed){return db[_0x5895('0x35')][_0x5895('0x3b')]({'where':{'id':_0x276ffc[_0x5895('0x39')]['id']}})['then'](handleEntityNotFound(_0x2e82ed,null))[_0x5895('0x12')](removeEntity(_0x2e82ed,null))['catch'](handleError(_0x2e82ed,null));};exports[_0x5895('0x3c')]=function(_0x616d71,_0x30852d){if(_0x616d71[_0x5895('0x3d')]['type']===_0x5895('0x17')&&!_[_0x5895('0x3e')](_0x616d71[_0x5895('0x3d')][_0x5895('0x3f')],'_')){_0x616d71['body']['exten']='_'[_0x5895('0x40')](_0x616d71[_0x5895('0x3d')][_0x5895('0x3f')]);}return db['VoiceExtension'][_0x5895('0x3c')](_0x616d71[_0x5895('0x3d')],{'raw':![]})['then'](function(_0x1d1a8a){var _0x25f312=_0x616d71[_0x5895('0x41')][_0x5895('0x13')]({'plain':!![]});if(!_0x25f312)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x25f312[_0x5895('0x42')]===_0x5895('0x41')){var _0x36aaa3=_0x1d1a8a[_0x5895('0x13')]({'plain':!![]});var _0x2bb5a3=[{'name':_0x5895('0x14'),'value':_0x5895('0x15')},{'name':'OutboundRoutes','value':_0x5895('0x17')},{'name':_0x5895('0x18'),'value':_0x5895('0x19')}];var _0x2ebdcc=_[_0x5895('0x3b')](_0x2bb5a3,['value',_0x36aaa3['type']])[_0x5895('0x1e')];return db[_0x5895('0x43')]['find']({'where':{'name':_0x2ebdcc,'userProfileId':_0x25f312[_0x5895('0x44')]},'raw':!![]})[_0x5895('0x12')](function(_0x300a3a){if(_0x300a3a&&_0x300a3a['autoAssociation']===0x0){return db['UserProfileResource'][_0x5895('0x3c')]({'name':_0x36aaa3[_0x5895('0x1e')],'resourceId':_0x36aaa3['id'],'type':_0x300a3a[_0x5895('0x1e')],'sectionId':_0x300a3a['id']},{})['then'](function(){return _0x1d1a8a;});}else{return _0x1d1a8a;}})[_0x5895('0x38')](function(_0x468e4b){logger['error'](_0x5895('0x45'),_0x468e4b);throw _0x468e4b;});}return _0x1d1a8a;})['then'](respondWithResult(_0x30852d,0xc9))['catch'](handleError(_0x30852d,null));};exports['update']=function(_0x42bac8,_0x4713c1){if(_0x42bac8[_0x5895('0x3d')]['id']){delete _0x42bac8[_0x5895('0x3d')]['id'];}return db[_0x5895('0x35')][_0x5895('0x3b')]({'where':{'id':_0x42bac8[_0x5895('0x39')]['id']}})['then'](handleEntityNotFound(_0x4713c1,null))[_0x5895('0x12')](function(_0x23c794){if(_0x23c794){return db['VoiceExtension'][_0x5895('0x46')](_['pick'](_0x42bac8[_0x5895('0x3d')],['exten','context',_0x5895('0x47'),'recordingFormat',_0x5895('0x48'),_0x5895('0x49'),_0x5895('0x4a')]),{'where':{'context':_0x23c794[_0x5895('0x4b')],'exten':_0x23c794[_0x5895('0x3f')]},'individualHooks':!![]})['then'](function(_0x1dd60c){return _0x1dd60c;});}return null;})[_0x5895('0x12')](respondWithStatusCode(_0x4713c1,null))[_0x5895('0x38')](handleError(_0x4713c1,null));};exports[_0x5895('0x4c')]=function(_0x5a700d,_0x369a66){var _0x5c73f5=_0x5a700d[_0x5895('0x39')]['id'];var _0xf23e4=_0x5a700d[_0x5895('0x3d')];var _0x21038a=0xc8;var _0x89a037=null;return db[_0x5895('0x4d')][_0x5895('0x4e')]({'isolationLevel':db[_0x5895('0x4d')]['Transaction'][_0x5895('0x4f')][_0x5895('0x50')]},function(_0xa61a13){return db[_0x5895('0x35')][_0x5895('0x51')]({'where':{'id':_0x5c73f5},'transaction':_0xa61a13})['then'](function(_0x4258e0){if(_0x4258e0){return db[_0x5895('0x35')][_0x5895('0x11')]({'where':{'VoiceExtensionId':_0x5c73f5},'transaction':_0xa61a13})[_0x5895('0x12')](function(){var _0xb7d012=_[_0x5895('0x27')](_0xf23e4,function(_0x133b7d){_0x133b7d[_0x5895('0x52')]=_0x5c73f5;_0x133b7d[_0x5895('0x53')]=!![];return _0x133b7d;});return _0x4258e0[_0x5895('0x54')](_0xb7d012);})[_0x5895('0x12')](function(_0x13a026){return db[_0x5895('0x35')]['bulkCreate'](_0x13a026,{'transaction':_0xa61a13});});}else{_0x21038a=0x194;_0x89a037=[];}});})[_0x5895('0x12')](function(){if(_0x21038a!==0x194){return db[_0x5895('0x35')][_0x5895('0x55')]({'where':{'isApp':!![],'VoiceExtensionId':_0x5c73f5},'order':'cast(priority\x20as\x20unsigned)'})['then'](function(_0x5ab10c){_0x89a037=_0x5ab10c;});}})['catch'](function(_0x3ee947){_0x21038a=0x1f4;logger[_0x5895('0x21')](_0x3ee947['stack']);if(_0x3ee947[_0x5895('0x1e')]){delete _0x3ee947[_0x5895('0x1e')];}_0x89a037=_0x3ee947;})[_0x5895('0x56')](function(){if(_0x89a037===null){_0x369a66['sendStatus'](_0x21038a);}else{if(_0x21038a===0x1f4){_0x369a66[_0x5895('0x9')](_0x21038a)[_0x5895('0x57')](_0x89a037);}else{_0x369a66[_0x5895('0x9')](_0x21038a)[_0x5895('0xa')](_0x89a037);}}});};
\ No newline at end of file
+var _0x5852=['create','startsWith','body','exten','user','InboundRoutes','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','pick','context','recordingFormat','cutdigits','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','findOne','bulkCreate','cast(priority\x20as\x20unsigned)','finally','ioredis','../../config/logger','api','../../mysqldb','redis','defaults','localhost','./voiceExtension.socket','sendStatus','status','end','json','offset','undefined','limit','count','set','destroy','get','inbound','OutboundRoutes','outbound','InternalRoutes','internal','filter','map','value','type','find','then','name','send','index','rawAttributes','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VoiceExtension','includeAll','rows','show','params','include','options','catch'];(function(_0x5356e2,_0xdbc166){var _0x4848c2=function(_0x3ceefa){while(--_0x3ceefa){_0x5356e2['push'](_0x5356e2['shift']());}};_0x4848c2(++_0xdbc166);}(_0x5852,0x161));var _0x2585=function(_0x2dfe07,_0x2b663f){_0x2dfe07=_0x2dfe07-0x0;var _0x30aee0=_0x5852[_0x2dfe07];return _0x30aee0;};'use strict';var _=require('lodash');var Redis=require(_0x2585('0x0'));var qs=require('../../components/parsers/qs');var logger=require(_0x2585('0x1'))(_0x2585('0x2'));var config=require('../../config/environment');var db=require(_0x2585('0x3'))['db'];config[_0x2585('0x4')]=_[_0x2585('0x5')](config[_0x2585('0x4')],{'host':_0x2585('0x6'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2585('0x4')]));require(_0x2585('0x7'))['register'](socket);function respondWithStatusCode(_0x1c89b3,_0x5b181b){_0x5b181b=_0x5b181b||0xcc;return function(_0x5a08a5){if(_0x5a08a5){return _0x1c89b3[_0x2585('0x8')](_0x5b181b);}return _0x1c89b3[_0x2585('0x9')](_0x5b181b)[_0x2585('0xa')]();};}function respondWithResult(_0x23d40b,_0x2c6fdd){_0x2c6fdd=_0x2c6fdd||0xc8;return function(_0x17630c){if(_0x17630c){return _0x23d40b[_0x2585('0x9')](_0x2c6fdd)[_0x2585('0xb')](_0x17630c);}};}function respondWithFilteredResult(_0x5a8d7d,_0x30a8a6){return function(_0x32c642){if(_0x32c642){var _0x2f0490=typeof _0x30a8a6[_0x2585('0xc')]===_0x2585('0xd')&&typeof _0x30a8a6[_0x2585('0xe')]===_0x2585('0xd');var _0x29d67b=_0x32c642[_0x2585('0xf')];var _0x70b753=_0x2f0490?0x0:_0x30a8a6['offset'];var _0x563d3b=_0x2f0490?_0x32c642['count']:_0x30a8a6['offset']+_0x30a8a6[_0x2585('0xe')];var _0x1a1234;if(_0x563d3b>=_0x29d67b){_0x563d3b=_0x29d67b;_0x1a1234=0xc8;}else{_0x1a1234=0xce;}_0x5a8d7d['status'](_0x1a1234);return _0x5a8d7d[_0x2585('0x10')]('Content-Range',_0x70b753+'-'+_0x563d3b+'/'+_0x29d67b)[_0x2585('0xb')](_0x32c642);}return null;};}function removeEntity(_0x2fe8ac){return function(_0x13893b){if(_0x13893b){return _0x13893b[_0x2585('0x11')]()['then'](function(){var _0x4f0bcd=_0x13893b[_0x2585('0x12')]({'plain':!![]});var _0x50f2d0=[{'name':'InboundRoutes','value':_0x2585('0x13'),'ignore':![]},{'name':_0x2585('0x14'),'value':_0x2585('0x15'),'ignore':![]},{'name':_0x2585('0x16'),'value':_0x2585('0x17'),'ignore':![]}];var _0x456a01=_(_0x50f2d0)[_0x2585('0x18')]('ignore')[_0x2585('0x19')](_0x2585('0x1a'))[_0x2585('0x1a')]();if(_['includes'](_0x456a01,_0x4f0bcd[_0x2585('0x1b')])){return;}var _0x48826a=_[_0x2585('0x1c')](_0x50f2d0,['value',_0x4f0bcd['type']])['name'];return db['UserProfileResource']['destroy']({'where':{'type':_0x48826a,'resourceId':_0x4f0bcd['id']}})[_0x2585('0x1d')](function(){return _0x13893b;});})[_0x2585('0x1d')](function(){_0x2fe8ac[_0x2585('0x9')](0xcc)[_0x2585('0xa')]();});}};}function handleEntityNotFound(_0x4c9d0f){return function(_0x284a68){if(!_0x284a68){_0x4c9d0f['sendStatus'](0x194);}return _0x284a68;};}function handleError(_0x46f53e,_0x2ba7b8){_0x2ba7b8=_0x2ba7b8||0x1f4;return function(_0x2f4037){logger['error'](_0x2f4037['stack']);if(_0x2f4037[_0x2585('0x1e')]){delete _0x2f4037[_0x2585('0x1e')];}_0x46f53e['status'](_0x2ba7b8)[_0x2585('0x1f')](_0x2f4037);};}exports[_0x2585('0x20')]=function(_0x779f76,_0x9f145c){var _0x348d9a={},_0xab628e={},_0x36c00a={'count':0x0,'rows':[]};var _0x14209b=_[_0x2585('0x19')](db['VoiceExtension'][_0x2585('0x21')],function(_0x37a98e){return{'name':_0x37a98e['fieldName'],'type':_0x37a98e[_0x2585('0x1b')][_0x2585('0x22')]};});_0xab628e[_0x2585('0x23')]=_['map'](_0x14209b,_0x2585('0x1e'));_0xab628e[_0x2585('0x24')]=_[_0x2585('0x25')](_0x779f76[_0x2585('0x24')]);_0xab628e[_0x2585('0x26')]=_['intersection'](_0xab628e[_0x2585('0x23')],_0xab628e[_0x2585('0x24')]);_0x348d9a[_0x2585('0x27')]=_[_0x2585('0x28')](_0xab628e[_0x2585('0x23')],qs[_0x2585('0x29')](_0x779f76[_0x2585('0x24')][_0x2585('0x29')]));_0x348d9a[_0x2585('0x27')]=_0x348d9a[_0x2585('0x27')][_0x2585('0x2a')]?_0x348d9a[_0x2585('0x27')]:_0xab628e[_0x2585('0x23')];if(!_0x779f76[_0x2585('0x24')][_0x2585('0x2b')](_0x2585('0x2c'))){_0x348d9a[_0x2585('0xe')]=qs[_0x2585('0xe')](_0x779f76[_0x2585('0x24')]['limit']);_0x348d9a[_0x2585('0xc')]=qs[_0x2585('0xc')](_0x779f76['query'][_0x2585('0xc')]);}_0x348d9a[_0x2585('0x2d')]=qs[_0x2585('0x2e')](_0x779f76['query'][_0x2585('0x2e')]);_0x348d9a[_0x2585('0x2f')]=qs[_0x2585('0x26')](_['pick'](_0x779f76[_0x2585('0x24')],_0xab628e[_0x2585('0x26')]),_0x14209b);if(_0x779f76[_0x2585('0x24')][_0x2585('0x18')]){_0x348d9a[_0x2585('0x2f')]=_[_0x2585('0x30')](_0x348d9a[_0x2585('0x2f')],{'$or':_[_0x2585('0x19')](_0x14209b,function(_0x3b6748){if(_0x3b6748[_0x2585('0x1b')]!=='VIRTUAL'){var _0x270975={};_0x270975[_0x3b6748[_0x2585('0x1e')]]={'$like':'%'+_0x779f76[_0x2585('0x24')][_0x2585('0x18')]+'%'};return _0x270975;}})});}_0x348d9a=_[_0x2585('0x30')]({},_0x348d9a,_0x779f76['options']);var _0x214f94={'where':_0x348d9a[_0x2585('0x2f')]};return db[_0x2585('0x31')][_0x2585('0xf')](_0x214f94)[_0x2585('0x1d')](function(_0xe1266){_0x36c00a[_0x2585('0xf')]=_0xe1266;if(_0x779f76[_0x2585('0x24')][_0x2585('0x32')]){_0x348d9a['include']=[{'all':!![]}];}return db[_0x2585('0x31')]['findAll'](_0x348d9a);})['then'](function(_0x3032ea){_0x36c00a[_0x2585('0x33')]=_0x3032ea;return _0x36c00a;})['then'](respondWithFilteredResult(_0x9f145c,_0x348d9a))['catch'](handleError(_0x9f145c,null));};exports[_0x2585('0x34')]=function(_0x23962e,_0x31f50d){var _0x17d3af={'raw':![],'where':{'id':_0x23962e[_0x2585('0x35')]['id']}},_0xd9bf19={};_0xd9bf19[_0x2585('0x23')]=_[_0x2585('0x25')](db[_0x2585('0x31')]['rawAttributes']);_0xd9bf19[_0x2585('0x24')]=_['keys'](_0x23962e['query']);_0xd9bf19[_0x2585('0x26')]=_['intersection'](_0xd9bf19[_0x2585('0x23')],_0xd9bf19[_0x2585('0x24')]);_0x17d3af[_0x2585('0x27')]=_[_0x2585('0x28')](_0xd9bf19[_0x2585('0x23')],qs[_0x2585('0x29')](_0x23962e['query'][_0x2585('0x29')]));_0x17d3af[_0x2585('0x27')]=_0x17d3af['attributes'][_0x2585('0x2a')]?_0x17d3af['attributes']:_0xd9bf19[_0x2585('0x23')];if(_0x23962e[_0x2585('0x24')][_0x2585('0x32')]){_0x17d3af[_0x2585('0x36')]=[{'all':!![]}];}_0x17d3af=_[_0x2585('0x30')]({},_0x17d3af,_0x23962e[_0x2585('0x37')]);return db[_0x2585('0x31')][_0x2585('0x1c')](_0x17d3af)[_0x2585('0x1d')](handleEntityNotFound(_0x31f50d,null))[_0x2585('0x1d')](respondWithResult(_0x31f50d,null))[_0x2585('0x38')](handleError(_0x31f50d,null));};exports[_0x2585('0x11')]=function(_0x3f042e,_0x449926){return db[_0x2585('0x31')][_0x2585('0x1c')]({'where':{'id':_0x3f042e[_0x2585('0x35')]['id']}})[_0x2585('0x1d')](handleEntityNotFound(_0x449926,null))[_0x2585('0x1d')](removeEntity(_0x449926,null))['catch'](handleError(_0x449926,null));};exports[_0x2585('0x39')]=function(_0x5ad3d4,_0x1abdf5){if(_0x5ad3d4['body'][_0x2585('0x1b')]==='outbound'&&!_[_0x2585('0x3a')](_0x5ad3d4[_0x2585('0x3b')][_0x2585('0x3c')],'_')){_0x5ad3d4[_0x2585('0x3b')]['exten']='_'['concat'](_0x5ad3d4[_0x2585('0x3b')][_0x2585('0x3c')]);}return db[_0x2585('0x31')][_0x2585('0x39')](_0x5ad3d4[_0x2585('0x3b')],{'raw':![]})[_0x2585('0x1d')](function(_0x487fbf){var _0x1ef62b=_0x5ad3d4[_0x2585('0x3d')][_0x2585('0x12')]({'plain':!![]});if(!_0x1ef62b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1ef62b['role']===_0x2585('0x3d')){var _0x1c5b26=_0x487fbf['get']({'plain':!![]});var _0x4e4f64=[{'name':_0x2585('0x3e'),'value':'inbound'},{'name':'OutboundRoutes','value':_0x2585('0x15')},{'name':_0x2585('0x16'),'value':'internal'}];var _0x474030=_[_0x2585('0x1c')](_0x4e4f64,['value',_0x1c5b26[_0x2585('0x1b')]])['name'];return db['UserProfileSection'][_0x2585('0x1c')]({'where':{'name':_0x474030,'userProfileId':_0x1ef62b[_0x2585('0x3f')]},'raw':!![]})[_0x2585('0x1d')](function(_0x250c4d){if(_0x250c4d&&_0x250c4d[_0x2585('0x40')]===0x0){return db[_0x2585('0x41')][_0x2585('0x39')]({'name':_0x1c5b26[_0x2585('0x1e')],'resourceId':_0x1c5b26['id'],'type':_0x250c4d[_0x2585('0x1e')],'sectionId':_0x250c4d['id']},{})[_0x2585('0x1d')](function(){return _0x487fbf;});}else{return _0x487fbf;}})['catch'](function(_0x52edd5){logger[_0x2585('0x42')](_0x2585('0x43'),_0x52edd5);throw _0x52edd5;});}return _0x487fbf;})['then'](respondWithResult(_0x1abdf5,0xc9))[_0x2585('0x38')](handleError(_0x1abdf5,null));};exports[_0x2585('0x44')]=function(_0x31cc0f,_0x2920c9){if(_0x31cc0f[_0x2585('0x3b')]['id']){delete _0x31cc0f[_0x2585('0x3b')]['id'];}return db[_0x2585('0x31')][_0x2585('0x1c')]({'where':{'id':_0x31cc0f[_0x2585('0x35')]['id']}})[_0x2585('0x1d')](handleEntityNotFound(_0x2920c9,null))[_0x2585('0x1d')](function(_0x349b55){if(_0x349b55){return db[_0x2585('0x31')][_0x2585('0x44')](_[_0x2585('0x45')](_0x31cc0f[_0x2585('0x3b')],[_0x2585('0x3c'),_0x2585('0x46'),'description',_0x2585('0x47'),_0x2585('0x48'),'mandatoryDisposition','alias']),{'where':{'context':_0x349b55[_0x2585('0x46')],'exten':_0x349b55[_0x2585('0x3c')]},'individualHooks':!![]})[_0x2585('0x1d')](function(_0x559a3b){return _0x559a3b;});}return null;})['then'](respondWithStatusCode(_0x2920c9,null))[_0x2585('0x38')](handleError(_0x2920c9,null));};exports[_0x2585('0x49')]=function(_0x27e2be,_0x86f87b){var _0x57bb59=_0x27e2be[_0x2585('0x35')]['id'];var _0x1e0dd8=_0x27e2be[_0x2585('0x3b')];var _0x3a3c30=0xc8;var _0x450489=null;return db[_0x2585('0x4a')][_0x2585('0x4b')]({'isolationLevel':db[_0x2585('0x4a')][_0x2585('0x4c')][_0x2585('0x4d')]['READ_COMMITTED']},function(_0x4550c4){return db[_0x2585('0x31')][_0x2585('0x4e')]({'where':{'id':_0x57bb59},'transaction':_0x4550c4})['then'](function(_0x41fa86){if(_0x41fa86){return db[_0x2585('0x31')]['destroy']({'where':{'VoiceExtensionId':_0x57bb59},'transaction':_0x4550c4})[_0x2585('0x1d')](function(){var _0x55b254=_[_0x2585('0x19')](_0x1e0dd8,function(_0x5a9869){_0x5a9869['VoiceExtensionId']=_0x57bb59;_0x5a9869['isApp']=!![];return _0x5a9869;});return _0x41fa86['createRouting'](_0x55b254);})[_0x2585('0x1d')](function(_0x54f4f1){return db[_0x2585('0x31')][_0x2585('0x4f')](_0x54f4f1,{'transaction':_0x4550c4});});}else{_0x3a3c30=0x194;_0x450489=[];}});})[_0x2585('0x1d')](function(){if(_0x3a3c30!==0x194){return db[_0x2585('0x31')]['findAndCountAll']({'where':{'isApp':!![],'VoiceExtensionId':_0x57bb59},'order':_0x2585('0x50')})[_0x2585('0x1d')](function(_0x8cc5f6){_0x450489=_0x8cc5f6;});}})[_0x2585('0x38')](function(_0x47e2e4){_0x3a3c30=0x1f4;logger[_0x2585('0x42')](_0x47e2e4['stack']);if(_0x47e2e4['name']){delete _0x47e2e4[_0x2585('0x1e')];}_0x450489=_0x47e2e4;})[_0x2585('0x51')](function(){if(_0x450489===null){_0x86f87b[_0x2585('0x8')](_0x3a3c30);}else{if(_0x3a3c30===0x1f4){_0x86f87b[_0x2585('0x9')](_0x3a3c30)['send'](_0x450489);}else{_0x86f87b[_0x2585('0x9')](_0x3a3c30)[_0x2585('0xb')](_0x450489);}}});};
\ No newline at end of file
index e315a25..4aa5076 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0bef=['../../mysqldb','setMaxListeners','save','remove','emit','hasOwnProperty','exports','events'];(function(_0x493d47,_0x260d6a){var _0x11031d=function(_0x13250e){while(--_0x13250e){_0x493d47['push'](_0x493d47['shift']());}};_0x11031d(++_0x260d6a);}(_0x0bef,0x1ef));var _0xf0be=function(_0x18455e,_0x19992e){_0x18455e=_0x18455e-0x0;var _0x3553bf=_0x0bef[_0x18455e];return _0x3553bf;};'use strict';var EventEmitter=require(_0xf0be('0x0'));var VoiceExtension=require(_0xf0be('0x1'))['db']['VoiceExtension'];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0xf0be('0x2')](0x0);var events={'afterCreate':_0xf0be('0x3'),'afterUpdate':'update','afterDestroy':_0xf0be('0x4')};function emitEvent(_0x258a2f){return function(_0x2e9d74,_0x3f7929,_0x339b2c){VoiceExtensionEvents[_0xf0be('0x5')](_0x258a2f+':'+_0x2e9d74['id'],_0x2e9d74);VoiceExtensionEvents['emit'](_0x258a2f,_0x2e9d74);_0x339b2c(null);};}for(var e in events){if(events[_0xf0be('0x6')](e)){var event=events[e];VoiceExtension['hook'](e,emitEvent(event));}}module[_0xf0be('0x7')]=VoiceExtensionEvents;
\ No newline at end of file
+var _0x53e5=['remove','emit','hasOwnProperty','../../mysqldb','VoiceExtension','save','update'];(function(_0x5ddaac,_0x2697a8){var _0x2a9c58=function(_0x851032){while(--_0x851032){_0x5ddaac['push'](_0x5ddaac['shift']());}};_0x2a9c58(++_0x2697a8);}(_0x53e5,0x18b));var _0x553e=function(_0x452c37,_0x25ebd4){_0x452c37=_0x452c37-0x0;var _0x2ce2fb=_0x53e5[_0x452c37];return _0x2ce2fb;};'use strict';var EventEmitter=require('events');var VoiceExtension=require(_0x553e('0x0'))['db'][_0x553e('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x553e('0x2'),'afterUpdate':_0x553e('0x3'),'afterDestroy':_0x553e('0x4')};function emitEvent(_0xcac43){return function(_0x3c6b37,_0x4b67b4,_0x2e1f2b){VoiceExtensionEvents['emit'](_0xcac43+':'+_0x3c6b37['id'],_0x3c6b37);VoiceExtensionEvents[_0x553e('0x5')](_0xcac43,_0x3c6b37);_0x2e1f2b(null);};}for(var e in events){if(events[_0x553e('0x6')](e)){var event=events[e];VoiceExtension['hook'](e,emitEvent(event));}}module['exports']=VoiceExtensionEvents;
\ No newline at end of file
index 81d6af5..0aa0581 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa786=['voice_extensions','get','priority','concat','exports','models','type','Set','CDR(type)=','context','exten','alias','NoOp','CDR(routeAlias)=','No\x20alias\x20set','inbound','push','CDR(routeid)=','XCALLY-MOTION-ANSWER=0','outbound','CDR(type)=outbound','cutdigits','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','CDR(prefix)=${EXTEN:0:','MONITOR_OPTIONS=ab','outboundrouteid=','hasOwnProperty','recordingFormat','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','timeout','url','split','length','trunk','param','phone','prefix','${EXTEN:','${EXTEN}','SIP','join','options','none','U(xcally-mixmonitor-context)','replace','isEmpty','Interval','findAll','interval','IntervalId','then','*,*,*,*','map','filter','toLowerCase','tag','intervals','ExecIf','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','Set(CALLERID(all)=','NoOp(No\x20number\x20available)','answer','queue','app','custom','XCALLY-MOTION-ANSWER=1','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','appType','outboundDial','last','catch','define'];(function(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0xa786,0x1d2));var _0x6a78=function(_0x20be60,_0x4f094c){_0x20be60=_0x20be60-0x0;var _0x1ec26e=_0xa786[_0x20be60];return _0x1ec26e;};'use strict';var _=require('lodash');var attributes=require('./voiceExtension.attributes');module[_0x6a78('0x0')]=function(_0x3abf87){var _0x96d812=_0x3abf87[_0x6a78('0x1')];function _0x22723f(_0x1ca897){var _0x34b520=0x2;var _0x521b4a=[{'type':_0x1ca897[_0x6a78('0x2')],'app':_0x6a78('0x3'),'appdata':_0x6a78('0x4')+_0x1ca897[_0x6a78('0x2')],'context':_0x1ca897[_0x6a78('0x5')],'exten':_0x1ca897[_0x6a78('0x6')],'priority':_0x34b520++,'VoiceExtensionId':_0x1ca897['id']},{'type':_0x1ca897[_0x6a78('0x2')],'app':_0x1ca897[_0x6a78('0x7')]?_0x6a78('0x3'):_0x6a78('0x8'),'appdata':_0x1ca897[_0x6a78('0x7')]?_0x6a78('0x9')+_0x1ca897[_0x6a78('0x7')]:_0x6a78('0xa'),'context':_0x1ca897[_0x6a78('0x5')],'exten':_0x1ca897[_0x6a78('0x6')],'priority':_0x34b520++,'VoiceExtensionId':_0x1ca897['id']}];if(_0x1ca897[_0x6a78('0x2')]===_0x6a78('0xb')){_0x521b4a[_0x6a78('0xc')]({'type':'inbound','app':'Set','appdata':_0x6a78('0xd')+_0x1ca897['id'],'context':_0x1ca897[_0x6a78('0x5')],'exten':_0x1ca897['exten'],'priority':_0x34b520++,'VoiceExtensionId':_0x1ca897['id']});}_0x521b4a[_0x6a78('0xc')]({'type':_0x1ca897[_0x6a78('0x2')],'app':_0x6a78('0x3'),'appdata':_0x6a78('0xe'),'context':_0x1ca897[_0x6a78('0x5')],'exten':_0x1ca897[_0x6a78('0x6')],'priority':_0x34b520++,'VoiceExtensionId':_0x1ca897['id']},{'type':_0x1ca897[_0x6a78('0x2')],'app':'Set','appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x1ca897['context'],'exten':_0x1ca897[_0x6a78('0x6')],'priority':_0x34b520++,'VoiceExtensionId':_0x1ca897['id']},{'type':_0x1ca897[_0x6a78('0x2')],'app':_0x6a78('0x3'),'appdata':'MONITOR_OPTIONS=ab','context':_0x1ca897[_0x6a78('0x5')],'exten':_0x1ca897[_0x6a78('0x6')],'priority':_0x34b520++,'VoiceExtensionId':_0x1ca897['id']});return _0x521b4a;}function _0x5b5a5d(_0x304193){var _0x136df2=0x2;var _0x3f8fab=[{'type':_0x6a78('0xf'),'app':_0x6a78('0x3'),'appdata':_0x6a78('0x10'),'context':_0x304193[_0x6a78('0x5')],'exten':_0x304193[_0x6a78('0x6')],'priority':_0x136df2++,'VoiceExtensionId':_0x304193['id']},{'type':'outbound','app':_0x304193[_0x6a78('0x7')]?'Set':_0x6a78('0x8'),'appdata':_0x304193[_0x6a78('0x7')]?_0x6a78('0x9')+_0x304193['alias']:_0x6a78('0xa'),'context':_0x304193['context'],'exten':_0x304193[_0x6a78('0x6')],'priority':_0x136df2++,'VoiceExtensionId':_0x304193['id']},{'type':'outbound','app':_0x6a78('0x3'),'appdata':'CDR(destination)='+(_0x304193[_0x6a78('0x11')]?'${EXTEN:'+_0x304193['cutdigits']+'}':'${EXTEN}'),'context':_0x304193[_0x6a78('0x5')],'exten':_0x304193[_0x6a78('0x6')],'priority':_0x136df2++,'VoiceExtensionId':_0x304193['id']},{'type':_0x6a78('0xf'),'app':'Set','appdata':_0x6a78('0xd')+_0x304193['id'],'context':_0x304193[_0x6a78('0x5')],'exten':_0x304193[_0x6a78('0x6')],'priority':_0x136df2++,'VoiceExtensionId':_0x304193['id']},{'type':_0x6a78('0xf'),'app':'ExecIf','appdata':_0x6a78('0x12')+(_0x136df2+0x2)+'):Goto('+(_0x136df2+0x1)+')','context':_0x304193[_0x6a78('0x5')],'exten':_0x304193[_0x6a78('0x6')],'priority':_0x136df2++,'VoiceExtensionId':_0x304193['id']},{'type':_0x6a78('0xf'),'app':_0x6a78('0x3'),'appdata':_0x304193['cutdigits']?_0x6a78('0x13')+_0x304193[_0x6a78('0x11')]+'}':'CDR(prefix)=noprefix','context':_0x304193[_0x6a78('0x5')],'exten':_0x304193['exten'],'priority':_0x136df2++,'VoiceExtensionId':_0x304193['id']},{'type':_0x6a78('0xf'),'app':'Set','appdata':_0x6a78('0xe'),'context':_0x304193[_0x6a78('0x5')],'exten':_0x304193['exten'],'priority':_0x136df2++,'VoiceExtensionId':_0x304193['id']},{'type':_0x6a78('0xf'),'app':_0x6a78('0x3'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x304193[_0x6a78('0x5')],'exten':_0x304193[_0x6a78('0x6')],'priority':_0x136df2++,'VoiceExtensionId':_0x304193['id']},{'type':'outbound','app':_0x6a78('0x3'),'appdata':_0x6a78('0x14'),'context':_0x304193[_0x6a78('0x5')],'exten':_0x304193[_0x6a78('0x6')],'priority':_0x136df2++,'VoiceExtensionId':_0x304193['id']},{'type':_0x6a78('0xf'),'app':_0x6a78('0x3'),'appdata':_0x6a78('0x15')+_0x304193['id'],'context':_0x304193['context'],'exten':_0x304193[_0x6a78('0x6')],'priority':_0x136df2++,'VoiceExtensionId':_0x304193['id']}];if(_0x304193[_0x6a78('0x16')]('recordingFormat')&&_0x304193[_0x6a78('0x17')]!=='none'){_0x3f8fab[_0x6a78('0xc')]({'type':_0x6a78('0xf'),'app':'Set','appdata':_0x6a78('0x18'),'context':_0x304193[_0x6a78('0x5')],'exten':_0x304193['exten'],'priority':_0x136df2++,'VoiceExtensionId':_0x304193['id']},{'type':_0x6a78('0xf'),'app':'Set','appdata':_0x6a78('0x19')+_0x304193[_0x6a78('0x17')]||'wav','context':_0x304193['context'],'exten':_0x304193[_0x6a78('0x6')],'priority':_0x136df2++,'VoiceExtensionId':_0x304193['id']});}return _0x3f8fab;}function _0x6d1a66(_0x39dd29,_0x725b9f){var _0x58a7e8=[{'name':'trunk','param':0x0},{'name':_0x6a78('0x1a'),'param':0x1},{'name':'options','param':0x2},{'name':_0x6a78('0x1b'),'param':0x3}];var _0x16ff80={};var _0x58cf10=_0x725b9f[_0x6a78('0x1c')](',');var _0x580aad=[];for(var _0x14953c=0x0;_0x14953c<_0x58a7e8[_0x6a78('0x1d')];_0x14953c++){switch(_0x58a7e8[_0x14953c]['name']){case _0x6a78('0x1e'):_0x16ff80['trunk']=_0x58cf10[_0x58a7e8[_0x14953c][_0x6a78('0x1f')]][_0x6a78('0x1c')]('/')[0x1];_0x16ff80[_0x6a78('0x20')]=_0x58cf10[_0x58a7e8[_0x14953c][_0x6a78('0x1f')]][_0x6a78('0x1c')]('/')[0x2];_0x16ff80[_0x6a78('0x21')]=_0x16ff80[_0x6a78('0x20')]?_0x16ff80[_0x6a78('0x20')][_0x6a78('0x1c')]('$')[0x0]:undefined;_0x16ff80['phone']=_0x39dd29[_0x6a78('0x11')]?(_0x16ff80[_0x6a78('0x21')]||'')+_0x6a78('0x22')+_0x39dd29[_0x6a78('0x11')]+'}':(_0x16ff80[_0x6a78('0x21')]||'')+_0x6a78('0x23');_0x580aad[_0x58a7e8[_0x14953c][_0x6a78('0x1f')]]=[_0x6a78('0x24'),_0x16ff80[_0x6a78('0x1e')],_0x16ff80[_0x6a78('0x20')]][_0x6a78('0x25')]('/');break;case'options':_0x16ff80[_0x6a78('0x26')]=_0x58cf10[_0x58a7e8[_0x14953c]['param']];if(_0x39dd29[_0x6a78('0x17')]!==_0x6a78('0x27')){if(_0x16ff80[_0x6a78('0x26')]['indexOf'](_0x6a78('0x28'))<0x0){_0x16ff80[_0x6a78('0x26')]+=_0x6a78('0x28');}}else{_0x16ff80[_0x6a78('0x26')]=_0x16ff80[_0x6a78('0x26')][_0x6a78('0x29')](_0x6a78('0x28'),'');}_0x580aad[_0x58a7e8[_0x14953c][_0x6a78('0x1f')]]=_0x16ff80[_0x6a78('0x26')];break;default:_0x580aad[_0x58a7e8[_0x14953c][_0x6a78('0x1f')]]=_0x58cf10[_0x58a7e8[_0x14953c][_0x6a78('0x1f')]];}}return _0x580aad[_0x6a78('0x25')](',');}function _0xd9d351(_0x2e89ce,_0x2fdfd0,_0x56347f){return new Promise(function(_0x32c106,_0x1fb48b){var _0x3602a4=[];if(_[_0x6a78('0x2a')](_0x2fdfd0))return _0x32c106(_0x3602a4);_0x96d812[_0x6a78('0x2b')][_0x6a78('0x2c')]({'attributes':['id',_0x6a78('0x2d'),_0x6a78('0x2e')],'raw':!![]})[_0x6a78('0x2f')](function(_0x5f5c8a){for(var _0x351dcf=0x0,_0x2c8b5e=0x0;_0x351dcf<_0x2fdfd0['length'];_0x351dcf++,_0x2c8b5e=0x0){var _0x34bd0e=_0x2fdfd0[_0x351dcf];var _0x22405c=[];var _0x35eb86=[];delete _0x34bd0e['id'];if(_0x34bd0e[_0x6a78('0x2d')]!==_0x6a78('0x30')){_0x34bd0e['intervals']=[_0x34bd0e[_0x6a78('0x2d')]];}else{_0x34bd0e['intervals']=_0x34bd0e[_0x6a78('0x2e')]?_[_0x6a78('0x31')](_[_0x6a78('0x32')](_0x5f5c8a,{'IntervalId':_0x34bd0e[_0x6a78('0x2e')]}),_0x6a78('0x2d')):[];}_0x34bd0e[_0x6a78('0x5')]=_0x2e89ce[_0x6a78('0x5')];_0x34bd0e[_0x6a78('0x6')]=_0x2e89ce[_0x6a78('0x6')];if(_0x34bd0e[_0x6a78('0x2')])_0x34bd0e[_0x6a78('0x2')]=_0x34bd0e['type'][_0x6a78('0x33')]();if(_0x2e89ce[_0x6a78('0x2')]===_0x6a78('0xf')){if(_0x34bd0e['hasOwnProperty'](_0x6a78('0x34'))&&_0x34bd0e[_0x6a78('0x34')]&&_0x34bd0e[_0x6a78('0x34')]!=='--'){_0x22405c[_0x6a78('0xc')]({'type':_0x34bd0e[_0x6a78('0x2')][_0x6a78('0x33')](),'app':'Set','appdata':'CDR(tag)='+_0x34bd0e['tag'],'context':_0x2e89ce[_0x6a78('0x5')],'exten':_0x2e89ce[_0x6a78('0x6')],'priority':_0x34bd0e[_0x6a78('0x35')][_0x6a78('0x1d')]+_0x56347f+_0x2c8b5e++,'VoiceExtensionId':_0x2e89ce['id']});}_0x22405c[_0x6a78('0xc')]({'type':_0x34bd0e[_0x6a78('0x2')][_0x6a78('0x33')](),'app':_0x6a78('0x36'),'appdata':_0x6a78('0x37')+(_0x34bd0e[_0x6a78('0x38')]?_0x6a78('0x39')+_0x34bd0e[_0x6a78('0x38')]+')':_0x6a78('0x3a')),'context':_0x2e89ce[_0x6a78('0x5')],'exten':_0x2e89ce[_0x6a78('0x6')],'priority':_0x34bd0e[_0x6a78('0x35')][_0x6a78('0x1d')]+_0x56347f+_0x2c8b5e++,'VoiceExtensionId':_0x2e89ce['id']});}else{if(_0x34bd0e['hasOwnProperty'](_0x6a78('0x3b'))){if([_0x6a78('0x3c'),'playback']['includes'](_0x34bd0e[_0x6a78('0x3d')]['toLowerCase']())&&_0x34bd0e['appType']!==_0x6a78('0x3e')){if(_0x34bd0e[_0x6a78('0x3b')]){_0x22405c[_0x6a78('0xc')]({'type':_0x34bd0e[_0x6a78('0x2')][_0x6a78('0x33')](),'app':_0x6a78('0x36'),'appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x2e89ce[_0x6a78('0x5')],'exten':_0x2e89ce[_0x6a78('0x6')],'priority':_0x34bd0e[_0x6a78('0x35')][_0x6a78('0x1d')]+_0x56347f+_0x2c8b5e++,'VoiceExtensionId':_0x2e89ce['id']});_0x22405c[_0x6a78('0xc')]({'type':_0x34bd0e['type']['toLowerCase'](),'app':_0x6a78('0x3'),'appdata':_0x6a78('0x3f'),'context':_0x2e89ce[_0x6a78('0x5')],'exten':_0x2e89ce['exten'],'priority':_0x34bd0e[_0x6a78('0x35')][_0x6a78('0x1d')]+_0x56347f+_0x2c8b5e++,'VoiceExtensionId':_0x2e89ce['id']});}else{_0x22405c[_0x6a78('0xc')]({'type':_0x34bd0e[_0x6a78('0x2')][_0x6a78('0x33')](),'app':_0x6a78('0x36'),'appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x2e89ce[_0x6a78('0x5')],'exten':_0x2e89ce['exten'],'priority':_0x34bd0e['intervals']['length']+_0x56347f+_0x2c8b5e++,'VoiceExtensionId':_0x2e89ce['id']});_0x22405c[_0x6a78('0xc')]({'type':_0x34bd0e[_0x6a78('0x2')][_0x6a78('0x33')](),'app':_0x6a78('0x3'),'appdata':_0x6a78('0x40'),'context':_0x2e89ce[_0x6a78('0x5')],'exten':_0x2e89ce[_0x6a78('0x6')],'priority':_0x34bd0e[_0x6a78('0x35')][_0x6a78('0x1d')]+_0x56347f+_0x2c8b5e++,'VoiceExtensionId':_0x2e89ce['id']});}}}}for(var _0x502de3=0x0;_0x502de3<_0x34bd0e[_0x6a78('0x35')][_0x6a78('0x1d')];_0x502de3++){var _0x1f2bd4=_0x56347f+_0x34bd0e[_0x6a78('0x35')]['length'];var _0x1bfadf=_0x502de3===_0x34bd0e[_0x6a78('0x35')][_0x6a78('0x1d')]-0x1?_0x56347f+_0x22405c[_0x6a78('0x1d')]+_0x35eb86['length']+0x2:_0x56347f+_0x502de3+0x1;_0x22405c[_0x6a78('0x41')](_0x502de3,0x0,{'type':_0x2e89ce['type'],'app':_0x6a78('0x42'),'appdata':_0x34bd0e[_0x6a78('0x35')][_0x502de3]+'?'+_0x2e89ce[_0x6a78('0x5')]+_0x6a78('0x43')+_0x1f2bd4+':'+_0x2e89ce[_0x6a78('0x5')]+',${EXTEN},'+_0x1bfadf,'exten':_0x2e89ce['exten'],'context':_0x2e89ce[_0x6a78('0x5')],'priority':_0x56347f+_0x502de3,'VoiceExtensionId':_0x2e89ce['id']});}if(_0x34bd0e[_0x6a78('0x44')]===_0x6a78('0x45'))_0x34bd0e['appdata']=_0x6d1a66(_0x2e89ce,_0x34bd0e['appdata']);_0x34bd0e['priority']=_0x22405c['length']?_[_0x6a78('0x46')](_0x22405c)['priority']+0x1:_0x56347f;_0x3602a4=_['concat'](_0x3602a4,_0x22405c,[_0x34bd0e],_0x35eb86);_0x56347f=_[_0x6a78('0x46')](_0x3602a4)['priority']+0x1;}return _0x32c106(_0x3602a4);})[_0x6a78('0x47')](function(_0x1c0490){_0x1fb48b(_0x1c0490);});});}return _0x3abf87[_0x6a78('0x48')]('VoiceExtension',attributes,{'tableName':_0x6a78('0x49'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x688ac0){var _0x59819c=this[_0x6a78('0x4a')]({'plain':!![]});var _0x2897f6=_0x59819c['type']===_0x6a78('0xf')?_0x5b5a5d(_0x59819c):_0x22723f(_0x59819c);return _0xd9d351(_0x59819c,_0x688ac0,_['last'](_0x2897f6)[_0x6a78('0x4b')]+0x1)[_0x6a78('0x2f')](function(_0x2d9a64){var _0x3427ee=_[_0x6a78('0x4c')](_0x2897f6,_0x2d9a64);_0x3427ee[_0x6a78('0xc')]({'type':_0x59819c[_0x6a78('0x2')],'app':'Hangup','exten':_0x59819c['exten'],'context':_0x59819c[_0x6a78('0x5')],'priority':_[_0x6a78('0x46')](_0x3427ee)['priority']+0x1,'VoiceExtensionId':_0x59819c['id']});return _0x3427ee;});}}});};
\ No newline at end of file
+var _0xe8a1=['$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','outboundDial','priority','last','concat','define','VoiceExtension','get','Hangup','lodash','./voiceExtension.attributes','exports','Set','CDR(type)=','type','context','exten','alias','NoOp','CDR(routeAlias)=','inbound','push','CDR(routeid)=','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','CDR(type)=outbound','No\x20alias\x20set','CDR(destination)=','cutdigits','${EXTEN:','outbound','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','XCALLY-MOTION-ANSWER=0','outboundrouteid=','hasOwnProperty','recordingFormat','none','timeout','url','split','length','name','trunk','param','prefix','phone','${EXTEN}','SIP','join','options','indexOf','U(xcally-mixmonitor-context)','isEmpty','interval','IntervalId','then','*,*,*,*','intervals','map','filter','toLowerCase','tag','CDR(tag)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','Set(CALLERID(all)=','answer','queue','playback','app','appType','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1'];(function(_0x15359b,_0x2bbeb0){var _0x42e8ae=function(_0x345086){while(--_0x345086){_0x15359b['push'](_0x15359b['shift']());}};_0x42e8ae(++_0x2bbeb0);}(_0xe8a1,0xad));var _0x1e8a=function(_0x56cd86,_0x5e07eb){_0x56cd86=_0x56cd86-0x0;var _0x33003b=_0xe8a1[_0x56cd86];return _0x33003b;};'use strict';var _=require(_0x1e8a('0x0'));var attributes=require(_0x1e8a('0x1'));module[_0x1e8a('0x2')]=function(_0x5607b6){var _0x2f4060=_0x5607b6['models'];function _0x3142e6(_0x563bf0){var _0x3d2731=0x2;var _0x48e299=[{'type':_0x563bf0['type'],'app':_0x1e8a('0x3'),'appdata':_0x1e8a('0x4')+_0x563bf0[_0x1e8a('0x5')],'context':_0x563bf0[_0x1e8a('0x6')],'exten':_0x563bf0[_0x1e8a('0x7')],'priority':_0x3d2731++,'VoiceExtensionId':_0x563bf0['id']},{'type':_0x563bf0[_0x1e8a('0x5')],'app':_0x563bf0[_0x1e8a('0x8')]?_0x1e8a('0x3'):_0x1e8a('0x9'),'appdata':_0x563bf0[_0x1e8a('0x8')]?_0x1e8a('0xa')+_0x563bf0['alias']:'No\x20alias\x20set','context':_0x563bf0['context'],'exten':_0x563bf0[_0x1e8a('0x7')],'priority':_0x3d2731++,'VoiceExtensionId':_0x563bf0['id']}];if(_0x563bf0['type']===_0x1e8a('0xb')){_0x48e299[_0x1e8a('0xc')]({'type':_0x1e8a('0xb'),'app':_0x1e8a('0x3'),'appdata':_0x1e8a('0xd')+_0x563bf0['id'],'context':_0x563bf0['context'],'exten':_0x563bf0['exten'],'priority':_0x3d2731++,'VoiceExtensionId':_0x563bf0['id']});}_0x48e299['push']({'type':_0x563bf0[_0x1e8a('0x5')],'app':_0x1e8a('0x3'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x563bf0[_0x1e8a('0x6')],'exten':_0x563bf0[_0x1e8a('0x7')],'priority':_0x3d2731++,'VoiceExtensionId':_0x563bf0['id']},{'type':_0x563bf0[_0x1e8a('0x5')],'app':_0x1e8a('0x3'),'appdata':_0x1e8a('0xe'),'context':_0x563bf0[_0x1e8a('0x6')],'exten':_0x563bf0[_0x1e8a('0x7')],'priority':_0x3d2731++,'VoiceExtensionId':_0x563bf0['id']},{'type':_0x563bf0['type'],'app':_0x1e8a('0x3'),'appdata':_0x1e8a('0xf'),'context':_0x563bf0['context'],'exten':_0x563bf0[_0x1e8a('0x7')],'priority':_0x3d2731++,'VoiceExtensionId':_0x563bf0['id']});return _0x48e299;}function _0x1f7793(_0x49bd16){var _0xd22576=0x2;var _0x5e10c3=[{'type':'outbound','app':'Set','appdata':_0x1e8a('0x10'),'context':_0x49bd16[_0x1e8a('0x6')],'exten':_0x49bd16[_0x1e8a('0x7')],'priority':_0xd22576++,'VoiceExtensionId':_0x49bd16['id']},{'type':'outbound','app':_0x49bd16[_0x1e8a('0x8')]?'Set':'NoOp','appdata':_0x49bd16[_0x1e8a('0x8')]?_0x1e8a('0xa')+_0x49bd16[_0x1e8a('0x8')]:_0x1e8a('0x11'),'context':_0x49bd16['context'],'exten':_0x49bd16[_0x1e8a('0x7')],'priority':_0xd22576++,'VoiceExtensionId':_0x49bd16['id']},{'type':'outbound','app':_0x1e8a('0x3'),'appdata':_0x1e8a('0x12')+(_0x49bd16[_0x1e8a('0x13')]?_0x1e8a('0x14')+_0x49bd16[_0x1e8a('0x13')]+'}':'${EXTEN}'),'context':_0x49bd16[_0x1e8a('0x6')],'exten':_0x49bd16['exten'],'priority':_0xd22576++,'VoiceExtensionId':_0x49bd16['id']},{'type':_0x1e8a('0x15'),'app':_0x1e8a('0x3'),'appdata':_0x1e8a('0xd')+_0x49bd16['id'],'context':_0x49bd16[_0x1e8a('0x6')],'exten':_0x49bd16['exten'],'priority':_0xd22576++,'VoiceExtensionId':_0x49bd16['id']},{'type':_0x1e8a('0x15'),'app':_0x1e8a('0x16'),'appdata':_0x1e8a('0x17')+(_0xd22576+0x2)+'):Goto('+(_0xd22576+0x1)+')','context':_0x49bd16[_0x1e8a('0x6')],'exten':_0x49bd16[_0x1e8a('0x7')],'priority':_0xd22576++,'VoiceExtensionId':_0x49bd16['id']},{'type':_0x1e8a('0x15'),'app':_0x1e8a('0x3'),'appdata':_0x49bd16['cutdigits']?_0x1e8a('0x18')+_0x49bd16[_0x1e8a('0x13')]+'}':_0x1e8a('0x19'),'context':_0x49bd16[_0x1e8a('0x6')],'exten':_0x49bd16[_0x1e8a('0x7')],'priority':_0xd22576++,'VoiceExtensionId':_0x49bd16['id']},{'type':_0x1e8a('0x15'),'app':_0x1e8a('0x3'),'appdata':_0x1e8a('0x1a'),'context':_0x49bd16[_0x1e8a('0x6')],'exten':_0x49bd16[_0x1e8a('0x7')],'priority':_0xd22576++,'VoiceExtensionId':_0x49bd16['id']},{'type':'outbound','app':'Set','appdata':_0x1e8a('0xe'),'context':_0x49bd16[_0x1e8a('0x6')],'exten':_0x49bd16[_0x1e8a('0x7')],'priority':_0xd22576++,'VoiceExtensionId':_0x49bd16['id']},{'type':'outbound','app':_0x1e8a('0x3'),'appdata':_0x1e8a('0xf'),'context':_0x49bd16[_0x1e8a('0x6')],'exten':_0x49bd16[_0x1e8a('0x7')],'priority':_0xd22576++,'VoiceExtensionId':_0x49bd16['id']},{'type':_0x1e8a('0x15'),'app':_0x1e8a('0x3'),'appdata':_0x1e8a('0x1b')+_0x49bd16['id'],'context':_0x49bd16['context'],'exten':_0x49bd16[_0x1e8a('0x7')],'priority':_0xd22576++,'VoiceExtensionId':_0x49bd16['id']}];if(_0x49bd16[_0x1e8a('0x1c')]('recordingFormat')&&_0x49bd16[_0x1e8a('0x1d')]!==_0x1e8a('0x1e')){_0x5e10c3[_0x1e8a('0xc')]({'type':_0x1e8a('0x15'),'app':_0x1e8a('0x3'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x49bd16['context'],'exten':_0x49bd16[_0x1e8a('0x7')],'priority':_0xd22576++,'VoiceExtensionId':_0x49bd16['id']},{'type':_0x1e8a('0x15'),'app':_0x1e8a('0x3'),'appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x49bd16[_0x1e8a('0x1d')]||'wav','context':_0x49bd16[_0x1e8a('0x6')],'exten':_0x49bd16['exten'],'priority':_0xd22576++,'VoiceExtensionId':_0x49bd16['id']});}return _0x5e10c3;}function _0x196c68(_0x2703ce,_0x281219){var _0x53b4dd=[{'name':'trunk','param':0x0},{'name':_0x1e8a('0x1f'),'param':0x1},{'name':'options','param':0x2},{'name':_0x1e8a('0x20'),'param':0x3}];var _0x486985={};var _0x240ca8=_0x281219[_0x1e8a('0x21')](',');var _0x2bab99=[];for(var _0x30cb66=0x0;_0x30cb66<_0x53b4dd[_0x1e8a('0x22')];_0x30cb66++){switch(_0x53b4dd[_0x30cb66][_0x1e8a('0x23')]){case _0x1e8a('0x24'):_0x486985['trunk']=_0x240ca8[_0x53b4dd[_0x30cb66]['param']][_0x1e8a('0x21')]('/')[0x1];_0x486985['phone']=_0x240ca8[_0x53b4dd[_0x30cb66][_0x1e8a('0x25')]][_0x1e8a('0x21')]('/')[0x2];_0x486985[_0x1e8a('0x26')]=_0x486985[_0x1e8a('0x27')]?_0x486985['phone'][_0x1e8a('0x21')]('$')[0x0]:undefined;_0x486985['phone']=_0x2703ce[_0x1e8a('0x13')]?(_0x486985[_0x1e8a('0x26')]||'')+_0x1e8a('0x14')+_0x2703ce[_0x1e8a('0x13')]+'}':(_0x486985[_0x1e8a('0x26')]||'')+_0x1e8a('0x28');_0x2bab99[_0x53b4dd[_0x30cb66]['param']]=[_0x1e8a('0x29'),_0x486985[_0x1e8a('0x24')],_0x486985['phone']][_0x1e8a('0x2a')]('/');break;case'options':_0x486985[_0x1e8a('0x2b')]=_0x240ca8[_0x53b4dd[_0x30cb66][_0x1e8a('0x25')]];if(_0x2703ce['recordingFormat']!==_0x1e8a('0x1e')){if(_0x486985[_0x1e8a('0x2b')][_0x1e8a('0x2c')]('U(xcally-mixmonitor-context)')<0x0){_0x486985[_0x1e8a('0x2b')]+='U(xcally-mixmonitor-context)';}}else{_0x486985['options']=_0x486985[_0x1e8a('0x2b')]['replace'](_0x1e8a('0x2d'),'');}_0x2bab99[_0x53b4dd[_0x30cb66][_0x1e8a('0x25')]]=_0x486985[_0x1e8a('0x2b')];break;default:_0x2bab99[_0x53b4dd[_0x30cb66][_0x1e8a('0x25')]]=_0x240ca8[_0x53b4dd[_0x30cb66][_0x1e8a('0x25')]];}}return _0x2bab99['join'](',');}function _0x407878(_0x367767,_0x263735,_0x3d0bd0){return new Promise(function(_0x250718,_0x4ab289){var _0x34def3=[];if(_[_0x1e8a('0x2e')](_0x263735))return _0x250718(_0x34def3);_0x2f4060['Interval']['findAll']({'attributes':['id',_0x1e8a('0x2f'),_0x1e8a('0x30')],'raw':!![]})[_0x1e8a('0x31')](function(_0x1490d9){for(var _0x57dfdf=0x0,_0x57a7c=0x0;_0x57dfdf<_0x263735[_0x1e8a('0x22')];_0x57dfdf++,_0x57a7c=0x0){var _0x361599=_0x263735[_0x57dfdf];var _0x1c09fc=[];var _0x43690a=[];delete _0x361599['id'];if(_0x361599[_0x1e8a('0x2f')]!==_0x1e8a('0x32')){_0x361599[_0x1e8a('0x33')]=[_0x361599[_0x1e8a('0x2f')]];}else{_0x361599[_0x1e8a('0x33')]=_0x361599[_0x1e8a('0x30')]?_[_0x1e8a('0x34')](_[_0x1e8a('0x35')](_0x1490d9,{'IntervalId':_0x361599[_0x1e8a('0x30')]}),_0x1e8a('0x2f')):[];}_0x361599[_0x1e8a('0x6')]=_0x367767['context'];_0x361599[_0x1e8a('0x7')]=_0x367767[_0x1e8a('0x7')];if(_0x361599[_0x1e8a('0x5')])_0x361599['type']=_0x361599[_0x1e8a('0x5')][_0x1e8a('0x36')]();if(_0x367767[_0x1e8a('0x5')]===_0x1e8a('0x15')){if(_0x361599[_0x1e8a('0x1c')]('tag')&&_0x361599[_0x1e8a('0x37')]&&_0x361599['tag']!=='--'){_0x1c09fc[_0x1e8a('0xc')]({'type':_0x361599[_0x1e8a('0x5')][_0x1e8a('0x36')](),'app':_0x1e8a('0x3'),'appdata':_0x1e8a('0x38')+_0x361599[_0x1e8a('0x37')],'context':_0x367767[_0x1e8a('0x6')],'exten':_0x367767[_0x1e8a('0x7')],'priority':_0x361599['intervals'][_0x1e8a('0x22')]+_0x3d0bd0+_0x57a7c++,'VoiceExtensionId':_0x367767['id']});}_0x1c09fc[_0x1e8a('0xc')]({'type':_0x361599['type'][_0x1e8a('0x36')](),'app':'ExecIf','appdata':_0x1e8a('0x39')+(_0x361599[_0x1e8a('0x3a')]?_0x1e8a('0x3b')+_0x361599['callerID']+')':'NoOp(No\x20number\x20available)'),'context':_0x367767['context'],'exten':_0x367767['exten'],'priority':_0x361599[_0x1e8a('0x33')][_0x1e8a('0x22')]+_0x3d0bd0+_0x57a7c++,'VoiceExtensionId':_0x367767['id']});}else{if(_0x361599[_0x1e8a('0x1c')](_0x1e8a('0x3c'))){if([_0x1e8a('0x3d'),_0x1e8a('0x3e')]['includes'](_0x361599[_0x1e8a('0x3f')][_0x1e8a('0x36')]())&&_0x361599[_0x1e8a('0x40')]!=='custom'){if(_0x361599[_0x1e8a('0x3c')]){_0x1c09fc[_0x1e8a('0xc')]({'type':_0x361599[_0x1e8a('0x5')][_0x1e8a('0x36')](),'app':_0x1e8a('0x16'),'appdata':_0x1e8a('0x41'),'context':_0x367767[_0x1e8a('0x6')],'exten':_0x367767[_0x1e8a('0x7')],'priority':_0x361599[_0x1e8a('0x33')][_0x1e8a('0x22')]+_0x3d0bd0+_0x57a7c++,'VoiceExtensionId':_0x367767['id']});_0x1c09fc['push']({'type':_0x361599[_0x1e8a('0x5')][_0x1e8a('0x36')](),'app':'Set','appdata':_0x1e8a('0x42'),'context':_0x367767[_0x1e8a('0x6')],'exten':_0x367767[_0x1e8a('0x7')],'priority':_0x361599[_0x1e8a('0x33')][_0x1e8a('0x22')]+_0x3d0bd0+_0x57a7c++,'VoiceExtensionId':_0x367767['id']});}else{_0x1c09fc[_0x1e8a('0xc')]({'type':_0x361599['type'][_0x1e8a('0x36')](),'app':_0x1e8a('0x16'),'appdata':_0x1e8a('0x43'),'context':_0x367767[_0x1e8a('0x6')],'exten':_0x367767[_0x1e8a('0x7')],'priority':_0x361599[_0x1e8a('0x33')]['length']+_0x3d0bd0+_0x57a7c++,'VoiceExtensionId':_0x367767['id']});_0x1c09fc[_0x1e8a('0xc')]({'type':_0x361599[_0x1e8a('0x5')]['toLowerCase'](),'app':_0x1e8a('0x3'),'appdata':_0x1e8a('0x44'),'context':_0x367767[_0x1e8a('0x6')],'exten':_0x367767[_0x1e8a('0x7')],'priority':_0x361599[_0x1e8a('0x33')][_0x1e8a('0x22')]+_0x3d0bd0+_0x57a7c++,'VoiceExtensionId':_0x367767['id']});}}}}for(var _0x93608e=0x0;_0x93608e<_0x361599[_0x1e8a('0x33')][_0x1e8a('0x22')];_0x93608e++){var _0x1e90ec=_0x3d0bd0+_0x361599[_0x1e8a('0x33')][_0x1e8a('0x22')];var _0x4045e6=_0x93608e===_0x361599[_0x1e8a('0x33')]['length']-0x1?_0x3d0bd0+_0x1c09fc['length']+_0x43690a[_0x1e8a('0x22')]+0x2:_0x3d0bd0+_0x93608e+0x1;_0x1c09fc[_0x1e8a('0x45')](_0x93608e,0x0,{'type':_0x367767[_0x1e8a('0x5')],'app':_0x1e8a('0x46'),'appdata':_0x361599[_0x1e8a('0x33')][_0x93608e]+'?'+_0x367767[_0x1e8a('0x6')]+',${EXTEN},'+_0x1e90ec+':'+_0x367767['context']+_0x1e8a('0x47')+_0x4045e6,'exten':_0x367767['exten'],'context':_0x367767[_0x1e8a('0x6')],'priority':_0x3d0bd0+_0x93608e,'VoiceExtensionId':_0x367767['id']});}if(_0x361599[_0x1e8a('0x40')]===_0x1e8a('0x48'))_0x361599['appdata']=_0x196c68(_0x367767,_0x361599['appdata']);_0x361599[_0x1e8a('0x49')]=_0x1c09fc[_0x1e8a('0x22')]?_[_0x1e8a('0x4a')](_0x1c09fc)[_0x1e8a('0x49')]+0x1:_0x3d0bd0;_0x34def3=_[_0x1e8a('0x4b')](_0x34def3,_0x1c09fc,[_0x361599],_0x43690a);_0x3d0bd0=_[_0x1e8a('0x4a')](_0x34def3)[_0x1e8a('0x49')]+0x1;}return _0x250718(_0x34def3);})['catch'](function(_0x1f9e86){_0x4ab289(_0x1f9e86);});});}return _0x5607b6[_0x1e8a('0x4c')](_0x1e8a('0x4d'),attributes,{'tableName':'voice_extensions','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x31e783){var _0xbde17e=this[_0x1e8a('0x4e')]({'plain':!![]});var _0x40f53e=_0xbde17e[_0x1e8a('0x5')]===_0x1e8a('0x15')?_0x1f7793(_0xbde17e):_0x3142e6(_0xbde17e);return _0x407878(_0xbde17e,_0x31e783,_[_0x1e8a('0x4a')](_0x40f53e)['priority']+0x1)[_0x1e8a('0x31')](function(_0x53b9f6){var _0x16bb95=_['concat'](_0x40f53e,_0x53b9f6);_0x16bb95[_0x1e8a('0xc')]({'type':_0xbde17e['type'],'app':_0x1e8a('0x4f'),'exten':_0xbde17e[_0x1e8a('0x7')],'context':_0xbde17e['context'],'priority':_['last'](_0x16bb95)[_0x1e8a('0x49')]+0x1,'VoiceExtensionId':_0xbde17e['id']});return _0x16bb95;});}}});};
\ No newline at end of file
index da65981..51213e4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x326f=['stringify','error','code','message','request\x20sent','result','catch','VoiceExtension','options','raw','where','attributes','limit','include','model','map','then','info','GetVoiceExtension','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','register','request','VoiceExtension,\x20%s,\x20%s','debug','VoiceExtension,\x20%s,\x20%s,\x20%s'];(function(_0x509a75,_0x46abbd){var _0x381a71=function(_0xec67eb){while(--_0xec67eb){_0x509a75['push'](_0x509a75['shift']());}};_0x381a71(++_0x46abbd);}(_0x326f,0xd1));var _0xf326=function(_0x59b744,_0x5ca32a){_0x59b744=_0x59b744-0x0;var _0x7300a=_0x326f[_0x59b744];return _0x7300a;};'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});config[_0xf326('0xb')]=_[_0xf326('0xc')](config[_0xf326('0xb')],{'host':_0xf326('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./voiceExtension.socket')[_0xf326('0xe')](socket);function respondWithRpcPromise(_0x1fc80e,_0x163416,_0x2686e1){return new BPromise(function(_0x1f3a33,_0x5db9d7){return client[_0xf326('0xf')](_0x1fc80e,_0x2686e1)['then'](function(_0x1cf441){logger['info'](_0xf326('0x10'),_0x163416,'request\x20sent');logger[_0xf326('0x11')](_0xf326('0x12'),_0x163416,'request\x20sent',JSON[_0xf326('0x13')](_0x1cf441));if(_0x1cf441[_0xf326('0x14')]){if(_0x1cf441[_0xf326('0x14')][_0xf326('0x15')]===0x1f4){logger['error'](_0xf326('0x10'),_0x163416,_0x1cf441['error']['message']);return _0x5db9d7(_0x1cf441[_0xf326('0x14')][_0xf326('0x16')]);}logger[_0xf326('0x14')](_0xf326('0x10'),_0x163416,_0x1cf441[_0xf326('0x14')][_0xf326('0x16')]);return _0x1f3a33(_0x1cf441[_0xf326('0x14')][_0xf326('0x16')]);}else{logger['info'](_0xf326('0x10'),_0x163416,_0xf326('0x17'));_0x1f3a33(_0x1cf441[_0xf326('0x18')][_0xf326('0x16')]);}})[_0xf326('0x19')](function(_0x311af0){logger['error']('VoiceExtension,\x20%s,\x20%s',_0x163416,_0x311af0);_0x5db9d7(_0x311af0);});});}exports['GetVoiceExtension']=function(_0x16e605){var _0x289f4b=this;return new Promise(function(_0x484cbe,_0x4cabce){return db[_0xf326('0x1a')]['findAll']({'raw':_0x16e605['options']?_0x16e605[_0xf326('0x1b')][_0xf326('0x1c')]===undefined?!![]:![]:!![],'where':_0x16e605['options']?_0x16e605['options'][_0xf326('0x1d')]||null:null,'attributes':_0x16e605[_0xf326('0x1b')]?_0x16e605['options'][_0xf326('0x1e')]||null:null,'limit':_0x16e605[_0xf326('0x1b')]?_0x16e605[_0xf326('0x1b')][_0xf326('0x1f')]||null:null,'include':_0x16e605[_0xf326('0x1b')]?_0x16e605[_0xf326('0x1b')]['include']?_['map'](_0x16e605['options'][_0xf326('0x20')],function(_0x1a2c4e){return{'model':db[_0x1a2c4e[_0xf326('0x21')]],'as':_0x1a2c4e['as'],'attributes':_0x1a2c4e[_0xf326('0x1e')],'include':_0x1a2c4e[_0xf326('0x20')]?_[_0xf326('0x22')](_0x1a2c4e['include'],function(_0x201d28){return{'model':db[_0x201d28[_0xf326('0x21')]],'as':_0x201d28['as'],'attributes':_0x201d28[_0xf326('0x1e')],'include':_0x201d28['include']?_[_0xf326('0x22')](_0x201d28['include'],function(_0x4a9abf){return{'model':db[_0x4a9abf[_0xf326('0x21')]],'as':_0x4a9abf['as'],'attributes':_0x4a9abf[_0xf326('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xf326('0x23')](function(_0x5dbe63){logger[_0xf326('0x24')](_0xf326('0x25'),_0x16e605);logger['debug'](_0xf326('0x25'),_0x16e605,JSON[_0xf326('0x13')](_0x5dbe63));_0x484cbe(_0x5dbe63);})[_0xf326('0x19')](function(_0x18d110){logger[_0xf326('0x14')](_0xf326('0x25'),_0x18d110[_0xf326('0x16')],_0x16e605);_0x4cabce(_0x289f4b[_0xf326('0x14')](0x1f4,_0x18d110[_0xf326('0x16')]));});});};
\ No newline at end of file
+var _0x965d=['stringify','error','message','info','GetVoiceExtension','VoiceExtension','findAll','options','where','limit','include','map','model','attributes','then','debug','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','redis','defaults','localhost','./voiceExtension.socket','register','VoiceExtension,\x20%s,\x20%s','request\x20sent','VoiceExtension,\x20%s,\x20%s,\x20%s'];(function(_0x8d7a30,_0x336422){var _0x41c062=function(_0x1fe9ac){while(--_0x1fe9ac){_0x8d7a30['push'](_0x8d7a30['shift']());}};_0x41c062(++_0x336422);}(_0x965d,0x1be));var _0xd965=function(_0x507320,_0x279428){_0x507320=_0x507320-0x0;var _0x259201=_0x965d[_0x507320];return _0x259201;};'use strict';var _=require(_0xd965('0x0'));var util=require(_0xd965('0x1'));var moment=require('moment');var BPromise=require(_0xd965('0x2'));var rs=require(_0xd965('0x3'));var fs=require('fs');var Redis=require(_0xd965('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xd965('0x5'));var logger=require(_0xd965('0x6'))(_0xd965('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0xd965('0x8')]=_[_0xd965('0x9')](config['redis'],{'host':_0xd965('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd965('0x8')]));require(_0xd965('0xb'))[_0xd965('0xc')](socket);function respondWithRpcPromise(_0xb3956f,_0x59fadc,_0x3d7453){return new BPromise(function(_0x433714,_0x21c632){return client['request'](_0xb3956f,_0x3d7453)['then'](function(_0x4ad301){logger['info'](_0xd965('0xd'),_0x59fadc,_0xd965('0xe'));logger['debug'](_0xd965('0xf'),_0x59fadc,_0xd965('0xe'),JSON[_0xd965('0x10')](_0x4ad301));if(_0x4ad301[_0xd965('0x11')]){if(_0x4ad301[_0xd965('0x11')]['code']===0x1f4){logger[_0xd965('0x11')](_0xd965('0xd'),_0x59fadc,_0x4ad301['error']['message']);return _0x21c632(_0x4ad301['error'][_0xd965('0x12')]);}logger[_0xd965('0x11')](_0xd965('0xd'),_0x59fadc,_0x4ad301[_0xd965('0x11')]['message']);return _0x433714(_0x4ad301[_0xd965('0x11')][_0xd965('0x12')]);}else{logger[_0xd965('0x13')](_0xd965('0xd'),_0x59fadc,_0xd965('0xe'));_0x433714(_0x4ad301['result'][_0xd965('0x12')]);}})['catch'](function(_0x47b63a){logger['error'](_0xd965('0xd'),_0x59fadc,_0x47b63a);_0x21c632(_0x47b63a);});});}exports[_0xd965('0x14')]=function(_0x876ef4){var _0xabe074=this;return new Promise(function(_0x532c40,_0x46ccf3){return db[_0xd965('0x15')][_0xd965('0x16')]({'raw':_0x876ef4['options']?_0x876ef4['options']['raw']===undefined?!![]:![]:!![],'where':_0x876ef4[_0xd965('0x17')]?_0x876ef4['options'][_0xd965('0x18')]||null:null,'attributes':_0x876ef4[_0xd965('0x17')]?_0x876ef4['options']['attributes']||null:null,'limit':_0x876ef4[_0xd965('0x17')]?_0x876ef4[_0xd965('0x17')][_0xd965('0x19')]||null:null,'include':_0x876ef4[_0xd965('0x17')]?_0x876ef4[_0xd965('0x17')][_0xd965('0x1a')]?_[_0xd965('0x1b')](_0x876ef4[_0xd965('0x17')][_0xd965('0x1a')],function(_0xc30f4d){return{'model':db[_0xc30f4d[_0xd965('0x1c')]],'as':_0xc30f4d['as'],'attributes':_0xc30f4d[_0xd965('0x1d')],'include':_0xc30f4d['include']?_[_0xd965('0x1b')](_0xc30f4d[_0xd965('0x1a')],function(_0x540d0c){return{'model':db[_0x540d0c['model']],'as':_0x540d0c['as'],'attributes':_0x540d0c['attributes'],'include':_0x540d0c['include']?_['map'](_0x540d0c[_0xd965('0x1a')],function(_0x182b87){return{'model':db[_0x182b87[_0xd965('0x1c')]],'as':_0x182b87['as'],'attributes':_0x182b87['attributes']};}):[]};}):[]};}):[]:[]})[_0xd965('0x1e')](function(_0xf6007e){logger[_0xd965('0x13')]('GetVoiceExtension',_0x876ef4);logger[_0xd965('0x1f')]('GetVoiceExtension',_0x876ef4,JSON['stringify'](_0xf6007e));_0x532c40(_0xf6007e);})[_0xd965('0x20')](function(_0x26379d){logger['error'](_0xd965('0x14'),_0x26379d['message'],_0x876ef4);_0x46ccf3(_0xabe074[_0xd965('0x11')](0x1f4,_0x26379d[_0xd965('0x12')]));});});};
\ No newline at end of file
index da20227..92015fe 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(_0x2a309f,_0x443e22){var _0x33c295=function(_0x45542a){while(--_0x45542a){_0x2a309f['push'](_0x2a309f['shift']());}};_0x33c295(++_0x443e22);}(_0x4975,0x86));var _0x5497=function(_0x48b44e,_0x2178b1){_0x48b44e=_0x48b44e-0x0;var _0x170367=_0x4975[_0x48b44e];return _0x170367;};'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 _0x2ef3=['update','emit','removeListener','register','length','voiceExtension:','./voiceExtension.events','save','remove'];(function(_0x51a7b0,_0x4d07cf){var _0x481289=function(_0x2306a2){while(--_0x2306a2){_0x51a7b0['push'](_0x51a7b0['shift']());}};_0x481289(++_0x4d07cf);}(_0x2ef3,0xba));var _0x32ef=function(_0x1986ee,_0x5ca9a2){_0x1986ee=_0x1986ee-0x0;var _0x46a579=_0x2ef3[_0x1986ee];return _0x46a579;};'use strict';var VoiceExtensionEvents=require(_0x32ef('0x0'));var events=[_0x32ef('0x1'),_0x32ef('0x2'),_0x32ef('0x3')];function createListener(_0x3944df,_0x38047b){return function(_0x48106c){_0x38047b[_0x32ef('0x4')](_0x3944df,_0x48106c);};}function removeListener(_0x38b7f3,_0x524ab6){return function(){VoiceExtensionEvents[_0x32ef('0x5')](_0x38b7f3,_0x524ab6);};}exports[_0x32ef('0x6')]=function(_0x4c8104){for(var _0x5dfa09=0x0,_0x2c0089=events[_0x32ef('0x7')];_0x5dfa09<_0x2c0089;_0x5dfa09++){var _0x367c39=events[_0x5dfa09];var _0x2fb8eb=createListener(_0x32ef('0x8')+_0x367c39,_0x4c8104);VoiceExtensionEvents['on'](_0x367c39,_0x2fb8eb);}};
\ No newline at end of file
index dda6068..6253633 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(_0x4ad9a8,_0x289a0e){var _0xa78261=function(_0x5638f4){while(--_0x5638f4){_0x4ad9a8['push'](_0x4ad9a8['shift']());}};_0xa78261(++_0x289a0e);}(_0x7b84,0x17c));var _0x47b8=function(_0x4bcce2,_0x5b936f){_0x4bcce2=_0x4bcce2-0x0;var _0x34c7cf=_0x7b84[_0x4bcce2];return _0x34c7cf;};'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 _0x2ef3=['express','Router','../../components/auth/service','../../components/interaction/service','./voiceMail.controller','get','/:id','isAuthenticated','show','/:id/messages','getMessages','post','update','delete','exports','multer','util','path','connect-timeout'];(function(_0x129a0e,_0x3f08fb){var _0x424099=function(_0x30cdef){while(--_0x30cdef){_0x129a0e['push'](_0x129a0e['shift']());}};_0x424099(++_0x3f08fb);}(_0x2ef3,0xba));var _0x32ef=function(_0x133705,_0x236cf6){_0x133705=_0x133705-0x0;var _0x275eec=_0x2ef3[_0x133705];return _0x275eec;};'use strict';var multer=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var path=require(_0x32ef('0x2'));var timeout=require(_0x32ef('0x3'));var express=require(_0x32ef('0x4'));var router=express[_0x32ef('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x32ef('0x6'));var interaction=require(_0x32ef('0x7'));var config=require('../../config/environment');var controller=require(_0x32ef('0x8'));router[_0x32ef('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x32ef('0x9')](_0x32ef('0xa'),auth[_0x32ef('0xb')](),controller[_0x32ef('0xc')]);router[_0x32ef('0x9')](_0x32ef('0xd'),auth[_0x32ef('0xb')](),controller[_0x32ef('0xe')]);router[_0x32ef('0xf')]('/',auth[_0x32ef('0xb')](),controller['create']);router['put'](_0x32ef('0xa'),auth[_0x32ef('0xb')](),controller[_0x32ef('0x10')]);router[_0x32ef('0x11')]('/:id',auth[_0x32ef('0xb')](),controller['destroy']);module[_0x32ef('0x12')]=router;
\ No newline at end of file
index 3cc84d7..cbdbdfb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x60ae=['ENUM','TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL','getDataValue','fullname','\x20-\x20','sequelize','exports','STRING','from-voicemail','contest_mailbox','setDataValue','email','string','central','yes'];(function(_0x10d0f0,_0x1eba3d){var _0x93e308=function(_0x388548){while(--_0x388548){_0x10d0f0['push'](_0x10d0f0['shift']());}};_0x93e308(++_0x1eba3d);}(_0x60ae,0x14c));var _0xe60a=function(_0x322c2f,_0x254da0){_0x322c2f=_0x322c2f-0x0;var _0x33994f=_0x60ae[_0x322c2f];return _0x33994f;};'use strict';var Sequelize=require(_0xe60a('0x0'));module[_0xe60a('0x1')]={'customer_id':{'type':Sequelize[_0xe60a('0x2')]},'context':{'type':Sequelize[_0xe60a('0x2')],'defaultValue':_0xe60a('0x3'),'unique':_0xe60a('0x4')},'mailbox':{'type':Sequelize[_0xe60a('0x2')],'defaultValue':'','allowNull':![],'unique':_0xe60a('0x4')},'password':{'type':Sequelize[_0xe60a('0x2')]},'fullname':{'type':Sequelize[_0xe60a('0x2')]},'email':{'type':Sequelize[_0xe60a('0x2')],'validate':{'isEmail':!![]},'set':function(_0x18cad3){this[_0xe60a('0x5')](_0xe60a('0x6'),typeof _0x18cad3===_0xe60a('0x7')&&_0x18cad3['trim']()?_0x18cad3['trim']():null);}},'pager':{'type':Sequelize[_0xe60a('0x2')]},'tz':{'type':Sequelize['STRING'],'defaultValue':_0xe60a('0x8')},'attach':{'type':Sequelize['ENUM'](_0xe60a('0x9'),'no'),'defaultValue':'yes','allowNull':![]},'saycid':{'type':Sequelize[_0xe60a('0xa')](_0xe60a('0x9'),'no'),'defaultValue':'yes','allowNull':![]},'dialout':{'type':Sequelize['STRING']},'callback':{'type':Sequelize[_0xe60a('0x2')]},'review':{'type':Sequelize[_0xe60a('0xa')](_0xe60a('0x9'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0xe60a('0xa')]('yes','no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0xe60a('0xa')](_0xe60a('0x9'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0xe60a('0xa')](_0xe60a('0x9'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0xe60a('0xb'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0xe60a('0xa')](_0xe60a('0x9'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0xe60a('0xa')]('yes','no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0xe60a('0xa')](_0xe60a('0x9'),'no'),'defaultValue':'yes','allowNull':![]},'forcename':{'type':Sequelize[_0xe60a('0xa')]('yes','no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0xe60a('0xa')](_0xe60a('0x9'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0xe60a('0xa')](_0xe60a('0x9'),'no'),'defaultValue':_0xe60a('0x9'),'allowNull':![]},'stamp':{'type':_0xe60a('0xc')},'emailsubject':{'type':Sequelize[_0xe60a('0x2')]},'emailbody':{'type':Sequelize['STRING']},'maxsecs':{'type':Sequelize[_0xe60a('0xd')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0xe60a('0xe')],'get':function(){return this[_0xe60a('0xf')](_0xe60a('0x10'))+_0xe60a('0x11')+this[_0xe60a('0xf')]('mailbox');}}};
\ No newline at end of file
+var _0x81ae=['\x20-\x20','exports','from-voicemail','contest_mailbox','STRING','string','trim','central','yes','ENUM','TINYINT(4)','INTEGER','VIRTUAL','getDataValue','fullname'];(function(_0x22b8a3,_0x2a79a7){var _0x199a0c=function(_0x544c66){while(--_0x544c66){_0x22b8a3['push'](_0x22b8a3['shift']());}};_0x199a0c(++_0x2a79a7);}(_0x81ae,0x196));var _0xe81a=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x81ae[_0x160c73];return _0xd9302;};'use strict';var Sequelize=require('sequelize');module[_0xe81a('0x0')]={'customer_id':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING'],'defaultValue':_0xe81a('0x1'),'unique':_0xe81a('0x2')},'mailbox':{'type':Sequelize[_0xe81a('0x3')],'defaultValue':'','allowNull':![],'unique':_0xe81a('0x2')},'password':{'type':Sequelize[_0xe81a('0x3')]},'fullname':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]},'set':function(_0x4eab15){this['setDataValue']('email',typeof _0x4eab15===_0xe81a('0x4')&&_0x4eab15[_0xe81a('0x5')]()?_0x4eab15[_0xe81a('0x5')]():null);}},'pager':{'type':Sequelize[_0xe81a('0x3')]},'tz':{'type':Sequelize[_0xe81a('0x3')],'defaultValue':_0xe81a('0x6')},'attach':{'type':Sequelize['ENUM'](_0xe81a('0x7'),'no'),'defaultValue':'yes','allowNull':![]},'saycid':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0xe81a('0x7'),'allowNull':![]},'dialout':{'type':Sequelize[_0xe81a('0x3')]},'callback':{'type':Sequelize[_0xe81a('0x3')]},'review':{'type':Sequelize[_0xe81a('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0xe81a('0x8')](_0xe81a('0x7'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0xe81a('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0xe81a('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0xe81a('0x9'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0xe81a('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0xe81a('0x8')](_0xe81a('0x7'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0xe81a('0x8')](_0xe81a('0x7'),'no'),'defaultValue':_0xe81a('0x7'),'allowNull':![]},'forcename':{'type':Sequelize[_0xe81a('0x8')](_0xe81a('0x7'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize['ENUM'](_0xe81a('0x7'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0xe81a('0x8')](_0xe81a('0x7'),'no'),'defaultValue':'yes','allowNull':![]},'stamp':{'type':'TIMESTAMP'},'emailsubject':{'type':Sequelize['STRING']},'emailbody':{'type':Sequelize['STRING']},'maxsecs':{'type':Sequelize[_0xe81a('0xa')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0xe81a('0xa')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0xe81a('0xb')],'get':function(){return this[_0xe81a('0xc')](_0xe81a('0xd'))+_0xe81a('0xe')+this[_0xe81a('0xc')]('mailbox');}}};
\ No newline at end of file
index 67c0027..062bffd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd64b=['merge','filter','options','includeAll','include','findAll','catch','params','filters','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','getMessages','findOne','order','sort','mailbox','VoiceMailMessage','findAndCountAll','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','undefined','count','offset','apply','reject','update','then','destroy','get','Voicemails','stack','name','send','index','map','VoiceMail','rawAttributes','type','model','keys','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','limit','where','pick'];(function(_0x5100bc,_0x35e471){var _0x1d6ec6=function(_0x24795f){while(--_0x24795f){_0x5100bc['push'](_0x5100bc['shift']());}};_0x1d6ec6(++_0x35e471);}(_0xd64b,0xc1));var _0xbd64=function(_0x2add83,_0x3a014e){_0x2add83=_0x2add83-0x0;var _0x5570e5=_0xd64b[_0x2add83];return _0x5570e5;};'use strict';var emlformat=require(_0xbd64('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbd64('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbd64('0x2'));var moment=require(_0xbd64('0x3'));var BPromise=require(_0xbd64('0x4'));var Mustache=require(_0xbd64('0x5'));var util=require(_0xbd64('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbd64('0x7'));var _=require(_0xbd64('0x8'));var squel=require(_0xbd64('0x9'));var crypto=require(_0xbd64('0xa'));var jsforce=require(_0xbd64('0xb'));var deskjs=require(_0xbd64('0xc'));var toCsv=require(_0xbd64('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xbd64('0xe'));var authService=require(_0xbd64('0xf'));var qs=require(_0xbd64('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbd64('0x11'));var logger=require(_0xbd64('0x12'))(_0xbd64('0x13'));var utils=require(_0xbd64('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xbd64('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x136f60,_0x2729d8){_0x2729d8=_0x2729d8||0xcc;return function(_0x3a941c){if(_0x3a941c){return _0x136f60[_0xbd64('0x16')](_0x2729d8);}return _0x136f60[_0xbd64('0x17')](_0x2729d8)[_0xbd64('0x18')]();};}function respondWithResult(_0x2e23f2,_0x269e2f){_0x269e2f=_0x269e2f||0xc8;return function(_0x2b5808){if(_0x2b5808){return _0x2e23f2['status'](_0x269e2f)[_0xbd64('0x19')](_0x2b5808);}};}function respondWithFilteredResult(_0x13e7a4,_0x3ff550){return function(_0x32fd34){if(_0x32fd34){var _0x29fc16=typeof _0x3ff550['offset']===_0xbd64('0x1a')&&typeof _0x3ff550['limit']===_0xbd64('0x1a');var _0x1432a6=_0x32fd34[_0xbd64('0x1b')];var _0x1d7a14=_0x29fc16?0x0:_0x3ff550[_0xbd64('0x1c')];var _0x2f4554=_0x29fc16?_0x32fd34[_0xbd64('0x1b')]:_0x3ff550[_0xbd64('0x1c')]+_0x3ff550['limit'];var _0x305545;if(_0x2f4554>=_0x1432a6){_0x2f4554=_0x1432a6;_0x305545=0xc8;}else{_0x305545=0xce;}_0x13e7a4[_0xbd64('0x17')](_0x305545);return _0x13e7a4['set']('Content-Range',_0x1d7a14+'-'+_0x2f4554+'/'+_0x1432a6)[_0xbd64('0x19')](_0x32fd34);}return null;};}function patchUpdates(_0x42b328){return function(_0x196d21){try{jsonpatch[_0xbd64('0x1d')](_0x196d21,_0x42b328,!![]);}catch(_0x2c5551){return BPromise[_0xbd64('0x1e')](_0x2c5551);}return _0x196d21['save']();};}function saveUpdates(_0x4d4a16,_0x6038f){return function(_0x41f2f){if(_0x41f2f){return _0x41f2f[_0xbd64('0x1f')](_0x4d4a16)[_0xbd64('0x20')](function(_0x55e74c){return _0x55e74c;});}return null;};}function removeEntity(_0x51d118,_0x28497c){return function(_0x4afaff){if(_0x4afaff){return _0x4afaff[_0xbd64('0x21')]()['then'](function(){var _0x33452d=_0x4afaff[_0xbd64('0x22')]({'plain':!![]});var _0x3d12a0=_0xbd64('0x23');return db['UserProfileResource'][_0xbd64('0x21')]({'where':{'type':_0x3d12a0,'resourceId':_0x33452d['id']}})[_0xbd64('0x20')](function(){return _0x4afaff;});})[_0xbd64('0x20')](function(){_0x51d118[_0xbd64('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4e8719,_0x29c9c8){return function(_0x49eac5){if(!_0x49eac5){_0x4e8719['sendStatus'](0x194);}return _0x49eac5;};}function handleError(_0xfa918,_0x5aacdd){_0x5aacdd=_0x5aacdd||0x1f4;return function(_0x3cf5b7){logger['error'](_0x3cf5b7[_0xbd64('0x24')]);if(_0x3cf5b7['name']){delete _0x3cf5b7[_0xbd64('0x25')];}_0xfa918[_0xbd64('0x17')](_0x5aacdd)[_0xbd64('0x26')](_0x3cf5b7);};}exports[_0xbd64('0x27')]=function(_0x306f19,_0x207ffc){var _0x4ed44a={},_0x35bdd5={},_0xe876c9={'count':0x0,'rows':[]};var _0xc44280=_[_0xbd64('0x28')](db[_0xbd64('0x29')][_0xbd64('0x2a')],function(_0x5e70d3){return{'name':_0x5e70d3['fieldName'],'type':_0x5e70d3[_0xbd64('0x2b')]['key']};});_0x35bdd5[_0xbd64('0x2c')]=_[_0xbd64('0x28')](_0xc44280,'name');_0x35bdd5['query']=_[_0xbd64('0x2d')](_0x306f19['query']);_0x35bdd5['filters']=_[_0xbd64('0x2e')](_0x35bdd5[_0xbd64('0x2c')],_0x35bdd5[_0xbd64('0x2f')]);_0x4ed44a['attributes']=_[_0xbd64('0x2e')](_0x35bdd5['model'],qs[_0xbd64('0x30')](_0x306f19[_0xbd64('0x2f')][_0xbd64('0x30')]));_0x4ed44a[_0xbd64('0x31')]=_0x4ed44a[_0xbd64('0x31')][_0xbd64('0x32')]?_0x4ed44a['attributes']:_0x35bdd5['model'];if(!_0x306f19[_0xbd64('0x2f')][_0xbd64('0x33')](_0xbd64('0x34'))){_0x4ed44a[_0xbd64('0x35')]=qs[_0xbd64('0x35')](_0x306f19[_0xbd64('0x2f')]['limit']);_0x4ed44a['offset']=qs[_0xbd64('0x1c')](_0x306f19[_0xbd64('0x2f')][_0xbd64('0x1c')]);}_0x4ed44a['order']=qs['sort'](_0x306f19[_0xbd64('0x2f')]['sort']);_0x4ed44a[_0xbd64('0x36')]=qs['filters'](_[_0xbd64('0x37')](_0x306f19[_0xbd64('0x2f')],_0x35bdd5['filters']),_0xc44280);if(_0x306f19[_0xbd64('0x2f')]['filter']){_0x4ed44a['where']=_[_0xbd64('0x38')](_0x4ed44a[_0xbd64('0x36')],{'$or':_[_0xbd64('0x28')](_0xc44280,function(_0x52f401){if(_0x52f401['type']!=='VIRTUAL'){var _0x344d46={};_0x344d46[_0x52f401[_0xbd64('0x25')]]={'$like':'%'+_0x306f19['query'][_0xbd64('0x39')]+'%'};return _0x344d46;}})});}_0x4ed44a=_[_0xbd64('0x38')]({},_0x4ed44a,_0x306f19[_0xbd64('0x3a')]);var _0x27fd12={'where':_0x4ed44a['where']};return db['VoiceMail'][_0xbd64('0x1b')](_0x27fd12)['then'](function(_0x595a91){_0xe876c9[_0xbd64('0x1b')]=_0x595a91;if(_0x306f19[_0xbd64('0x2f')][_0xbd64('0x3b')]){_0x4ed44a[_0xbd64('0x3c')]=[{'all':!![]}];}return db[_0xbd64('0x29')][_0xbd64('0x3d')](_0x4ed44a);})[_0xbd64('0x20')](function(_0x762380){_0xe876c9['rows']=_0x762380;return _0xe876c9;})[_0xbd64('0x20')](respondWithFilteredResult(_0x207ffc,_0x4ed44a))[_0xbd64('0x3e')](handleError(_0x207ffc,null));};exports['show']=function(_0x41b27a,_0x1e4983){var _0xe5b069={'raw':!![],'where':{'id':_0x41b27a[_0xbd64('0x3f')]['id']}},_0x2bc972={};_0x2bc972[_0xbd64('0x2c')]=_[_0xbd64('0x2d')](db['VoiceMail'][_0xbd64('0x2a')]);_0x2bc972['query']=_[_0xbd64('0x2d')](_0x41b27a['query']);_0x2bc972[_0xbd64('0x40')]=_[_0xbd64('0x2e')](_0x2bc972[_0xbd64('0x2c')],_0x2bc972['query']);_0xe5b069[_0xbd64('0x31')]=_['intersection'](_0x2bc972['model'],qs['fields'](_0x41b27a[_0xbd64('0x2f')][_0xbd64('0x30')]));_0xe5b069[_0xbd64('0x31')]=_0xe5b069[_0xbd64('0x31')][_0xbd64('0x32')]?_0xe5b069[_0xbd64('0x31')]:_0x2bc972[_0xbd64('0x2c')];if(_0x41b27a['query'][_0xbd64('0x3b')]){_0xe5b069[_0xbd64('0x3c')]=[{'all':!![]}];}_0xe5b069=_[_0xbd64('0x38')]({},_0xe5b069,_0x41b27a['options']);return db[_0xbd64('0x29')][_0xbd64('0x41')](_0xe5b069)[_0xbd64('0x20')](handleEntityNotFound(_0x1e4983,null))[_0xbd64('0x20')](respondWithResult(_0x1e4983,null))[_0xbd64('0x3e')](handleError(_0x1e4983,null));};exports['create']=function(_0x283699,_0x1a9ec8){return db[_0xbd64('0x29')][_0xbd64('0x42')](_0x283699['body'],{})['then'](function(_0x1e008f){var _0x2a7eec=_0x283699[_0xbd64('0x43')][_0xbd64('0x22')]({'plain':!![]});if(!_0x2a7eec)throw new Error(_0xbd64('0x44'));if(_0x2a7eec[_0xbd64('0x45')]===_0xbd64('0x43')){var _0x3807a7=_0x1e008f[_0xbd64('0x22')]({'plain':!![]});var _0x2709b2=_0xbd64('0x23');return db[_0xbd64('0x46')][_0xbd64('0x41')]({'where':{'name':_0x2709b2,'userProfileId':_0x2a7eec[_0xbd64('0x47')]},'raw':!![]})[_0xbd64('0x20')](function(_0x5bd444){if(_0x5bd444&&_0x5bd444[_0xbd64('0x48')]===0x0){return db['UserProfileResource']['create']({'name':_0x3807a7['name'],'resourceId':_0x3807a7['id'],'type':_0x5bd444['name'],'sectionId':_0x5bd444['id']},{})[_0xbd64('0x20')](function(){return _0x1e008f;});}else{return _0x1e008f;}})[_0xbd64('0x3e')](function(_0x5480f5){logger[_0xbd64('0x49')](_0xbd64('0x4a'),_0x5480f5);throw _0x5480f5;});}return _0x1e008f;})[_0xbd64('0x20')](respondWithResult(_0x1a9ec8,0xc9))['catch'](handleError(_0x1a9ec8,null));};exports[_0xbd64('0x1f')]=function(_0x371bad,_0x44cd4f){if(_0x371bad[_0xbd64('0x4b')]['id']){delete _0x371bad[_0xbd64('0x4b')]['id'];}return db[_0xbd64('0x29')]['find']({'where':{'id':_0x371bad['params']['id']}})['then'](handleEntityNotFound(_0x44cd4f,null))[_0xbd64('0x20')](saveUpdates(_0x371bad[_0xbd64('0x4b')],null))[_0xbd64('0x20')](respondWithResult(_0x44cd4f,null))[_0xbd64('0x3e')](handleError(_0x44cd4f,null));};exports['destroy']=function(_0x1d0d9f,_0x20b275){return db[_0xbd64('0x29')][_0xbd64('0x41')]({'where':{'id':_0x1d0d9f[_0xbd64('0x3f')]['id']}})[_0xbd64('0x20')](handleEntityNotFound(_0x20b275,null))['then'](removeEntity(_0x20b275,null))[_0xbd64('0x3e')](handleError(_0x20b275,null));};exports[_0xbd64('0x4c')]=function(_0x15f1fc,_0x1fe3e5,_0x465661){return db[_0xbd64('0x29')][_0xbd64('0x4d')]({'where':{'id':_0x15f1fc[_0xbd64('0x3f')]['id']}})[_0xbd64('0x20')](handleEntityNotFound(_0x1fe3e5,null))[_0xbd64('0x20')](function(_0x3812b3){var _0xffda84;var _0x4a1e21={},_0x56c7d9={};_0x56c7d9[_0xbd64('0x2c')]=_[_0xbd64('0x2d')](db['VoiceMailMessage']['rawAttributes']);_0x56c7d9[_0xbd64('0x2f')]=_[_0xbd64('0x2d')](_0x15f1fc['query']);_0x56c7d9[_0xbd64('0x40')]=_[_0xbd64('0x2e')](_0x56c7d9[_0xbd64('0x2c')],_0x56c7d9[_0xbd64('0x2f')]);_0x4a1e21[_0xbd64('0x31')]=_[_0xbd64('0x2e')](_0x56c7d9[_0xbd64('0x2c')],qs[_0xbd64('0x30')](_0x15f1fc[_0xbd64('0x2f')]['fields']));_0x4a1e21[_0xbd64('0x31')]=_0x4a1e21[_0xbd64('0x31')][_0xbd64('0x32')]?_0x4a1e21['attributes']:_0x56c7d9[_0xbd64('0x2c')];if(!_0x15f1fc[_0xbd64('0x2f')]['hasOwnProperty'](_0xbd64('0x34'))){_0x4a1e21[_0xbd64('0x35')]=qs[_0xbd64('0x35')](_0x15f1fc[_0xbd64('0x2f')][_0xbd64('0x35')]);_0x4a1e21[_0xbd64('0x1c')]=qs['offset'](_0x15f1fc[_0xbd64('0x2f')][_0xbd64('0x1c')]);}_0x4a1e21[_0xbd64('0x4e')]=qs[_0xbd64('0x4f')](_0x15f1fc['query'][_0xbd64('0x4f')]);_0x4a1e21[_0xbd64('0x36')]=qs['filters'](_[_0xbd64('0x37')](_0x15f1fc['query'],_0x56c7d9[_0xbd64('0x40')]));if(_0x15f1fc[_0xbd64('0x2f')][_0xbd64('0x39')]){_0x4a1e21[_0xbd64('0x36')]=_['merge'](_0x4a1e21[_0xbd64('0x36')],{'$or':_[_0xbd64('0x28')](_0x4a1e21[_0xbd64('0x31')],function(_0x23925c){var _0x463a60={};_0x463a60[_0x23925c]={'$like':'%'+_0x15f1fc[_0xbd64('0x2f')]['filter']+'%'};return _0x463a60;})});}_0x4a1e21['where']=_['merge'](_0x4a1e21[_0xbd64('0x36')],{'mailboxuser':_0x3812b3[_0xbd64('0x50')]});_0x4a1e21=_[_0xbd64('0x38')]({},_0x4a1e21,_0x15f1fc[_0xbd64('0x3a')]);return db[_0xbd64('0x51')][_0xbd64('0x52')](_0x4a1e21)['then'](respondWithFilteredResult(_0x1fe3e5,_0x4a1e21));})[_0xbd64('0x3e')](handleError(_0x1fe3e5,null));};
\ No newline at end of file
+var _0x236c=['fs-extra','squel','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','offset','undefined','count','set','Content-Range','json','apply','reject','save','update','then','destroy','Voicemails','UserProfileResource','error','name','send','index','map','VoiceMail','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','include','rows','catch','show','params','rawAttributes','includeAll','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','findOne','VoiceMailMessage','mailbox','findAndCountAll','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs'];(function(_0x16a6a7,_0x13cfce){var _0x38af75=function(_0x15fe75){while(--_0x15fe75){_0x16a6a7['push'](_0x16a6a7['shift']());}};_0x38af75(++_0x13cfce);}(_0x236c,0x155));var _0xc236=function(_0x16d7ff,_0x180aa7){_0x16d7ff=_0x16d7ff-0x0;var _0x5b183f=_0x236c[_0x16d7ff];return _0x5b183f;};'use strict';var emlformat=require(_0xc236('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc236('0x1'));var jsonpatch=require(_0xc236('0x2'));var rp=require(_0xc236('0x3'));var moment=require(_0xc236('0x4'));var BPromise=require(_0xc236('0x5'));var Mustache=require('mustache');var util=require(_0xc236('0x6'));var path=require(_0xc236('0x7'));var sox=require(_0xc236('0x8'));var csv=require(_0xc236('0x9'));var ejs=require(_0xc236('0xa'));var fs=require('fs');var fs_extra=require(_0xc236('0xb'));var _=require('lodash');var squel=require(_0xc236('0xc'));var crypto=require(_0xc236('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xc236('0xe'));var Papa=require('papaparse');var Redis=require(_0xc236('0xf'));var authService=require(_0xc236('0x10'));var qs=require(_0xc236('0x11'));var as=require(_0xc236('0x12'));var hardwareService=require(_0xc236('0x13'));var logger=require('../../config/logger')(_0xc236('0x14'));var utils=require(_0xc236('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xc236('0x16'));var db=require(_0xc236('0x17'))['db'];function respondWithStatusCode(_0x5ee3a5,_0x5b9638){_0x5b9638=_0x5b9638||0xcc;return function(_0x5bce83){if(_0x5bce83){return _0x5ee3a5['sendStatus'](_0x5b9638);}return _0x5ee3a5[_0xc236('0x18')](_0x5b9638)[_0xc236('0x19')]();};}function respondWithResult(_0x2184c9,_0x71bce2){_0x71bce2=_0x71bce2||0xc8;return function(_0x5052db){if(_0x5052db){return _0x2184c9[_0xc236('0x18')](_0x71bce2)['json'](_0x5052db);}};}function respondWithFilteredResult(_0x5221bf,_0x9a65e8){return function(_0x32f2fd){if(_0x32f2fd){var _0x443a46=typeof _0x9a65e8[_0xc236('0x1a')]===_0xc236('0x1b')&&typeof _0x9a65e8['limit']==='undefined';var _0x57355b=_0x32f2fd[_0xc236('0x1c')];var _0x76f45=_0x443a46?0x0:_0x9a65e8[_0xc236('0x1a')];var _0x541a20=_0x443a46?_0x32f2fd[_0xc236('0x1c')]:_0x9a65e8['offset']+_0x9a65e8['limit'];var _0x1eafba;if(_0x541a20>=_0x57355b){_0x541a20=_0x57355b;_0x1eafba=0xc8;}else{_0x1eafba=0xce;}_0x5221bf[_0xc236('0x18')](_0x1eafba);return _0x5221bf[_0xc236('0x1d')](_0xc236('0x1e'),_0x76f45+'-'+_0x541a20+'/'+_0x57355b)[_0xc236('0x1f')](_0x32f2fd);}return null;};}function patchUpdates(_0x27c6ab){return function(_0x3f0e2f){try{jsonpatch[_0xc236('0x20')](_0x3f0e2f,_0x27c6ab,!![]);}catch(_0x54ffac){return BPromise[_0xc236('0x21')](_0x54ffac);}return _0x3f0e2f[_0xc236('0x22')]();};}function saveUpdates(_0x4a9006,_0x208c3f){return function(_0x34d73a){if(_0x34d73a){return _0x34d73a[_0xc236('0x23')](_0x4a9006)[_0xc236('0x24')](function(_0x27afba){return _0x27afba;});}return null;};}function removeEntity(_0x21fab8,_0x3a315b){return function(_0xf921e6){if(_0xf921e6){return _0xf921e6[_0xc236('0x25')]()[_0xc236('0x24')](function(){var _0x17cb3b=_0xf921e6['get']({'plain':!![]});var _0x308cd6=_0xc236('0x26');return db[_0xc236('0x27')][_0xc236('0x25')]({'where':{'type':_0x308cd6,'resourceId':_0x17cb3b['id']}})['then'](function(){return _0xf921e6;});})[_0xc236('0x24')](function(){_0x21fab8['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x15ead8,_0x4eace8){return function(_0x36e578){if(!_0x36e578){_0x15ead8['sendStatus'](0x194);}return _0x36e578;};}function handleError(_0x54365,_0x5c79d6){_0x5c79d6=_0x5c79d6||0x1f4;return function(_0x423842){logger[_0xc236('0x28')](_0x423842['stack']);if(_0x423842['name']){delete _0x423842[_0xc236('0x29')];}_0x54365[_0xc236('0x18')](_0x5c79d6)[_0xc236('0x2a')](_0x423842);};}exports[_0xc236('0x2b')]=function(_0x5f3891,_0x4e3262){var _0x28ffa5={},_0x53b767={},_0x2c756f={'count':0x0,'rows':[]};var _0x4ddc87=_[_0xc236('0x2c')](db[_0xc236('0x2d')]['rawAttributes'],function(_0x5a5ec3){return{'name':_0x5a5ec3[_0xc236('0x2e')],'type':_0x5a5ec3[_0xc236('0x2f')][_0xc236('0x30')]};});_0x53b767[_0xc236('0x31')]=_[_0xc236('0x2c')](_0x4ddc87,_0xc236('0x29'));_0x53b767[_0xc236('0x32')]=_[_0xc236('0x33')](_0x5f3891[_0xc236('0x32')]);_0x53b767['filters']=_['intersection'](_0x53b767['model'],_0x53b767[_0xc236('0x32')]);_0x28ffa5[_0xc236('0x34')]=_[_0xc236('0x35')](_0x53b767[_0xc236('0x31')],qs[_0xc236('0x36')](_0x5f3891[_0xc236('0x32')][_0xc236('0x36')]));_0x28ffa5['attributes']=_0x28ffa5[_0xc236('0x34')][_0xc236('0x37')]?_0x28ffa5[_0xc236('0x34')]:_0x53b767['model'];if(!_0x5f3891[_0xc236('0x32')][_0xc236('0x38')](_0xc236('0x39'))){_0x28ffa5[_0xc236('0x3a')]=qs['limit'](_0x5f3891[_0xc236('0x32')][_0xc236('0x3a')]);_0x28ffa5[_0xc236('0x1a')]=qs[_0xc236('0x1a')](_0x5f3891[_0xc236('0x32')][_0xc236('0x1a')]);}_0x28ffa5[_0xc236('0x3b')]=qs[_0xc236('0x3c')](_0x5f3891[_0xc236('0x32')][_0xc236('0x3c')]);_0x28ffa5[_0xc236('0x3d')]=qs[_0xc236('0x3e')](_[_0xc236('0x3f')](_0x5f3891[_0xc236('0x32')],_0x53b767[_0xc236('0x3e')]),_0x4ddc87);if(_0x5f3891[_0xc236('0x32')][_0xc236('0x40')]){_0x28ffa5['where']=_['merge'](_0x28ffa5['where'],{'$or':_['map'](_0x4ddc87,function(_0x369a79){if(_0x369a79['type']!==_0xc236('0x41')){var _0x361526={};_0x361526[_0x369a79[_0xc236('0x29')]]={'$like':'%'+_0x5f3891[_0xc236('0x32')][_0xc236('0x40')]+'%'};return _0x361526;}})});}_0x28ffa5=_[_0xc236('0x42')]({},_0x28ffa5,_0x5f3891[_0xc236('0x43')]);var _0x201ba3={'where':_0x28ffa5[_0xc236('0x3d')]};return db[_0xc236('0x2d')][_0xc236('0x1c')](_0x201ba3)[_0xc236('0x24')](function(_0x3b2f2f){_0x2c756f[_0xc236('0x1c')]=_0x3b2f2f;if(_0x5f3891[_0xc236('0x32')]['includeAll']){_0x28ffa5[_0xc236('0x44')]=[{'all':!![]}];}return db[_0xc236('0x2d')]['findAll'](_0x28ffa5);})[_0xc236('0x24')](function(_0x5b0bc5){_0x2c756f[_0xc236('0x45')]=_0x5b0bc5;return _0x2c756f;})['then'](respondWithFilteredResult(_0x4e3262,_0x28ffa5))[_0xc236('0x46')](handleError(_0x4e3262,null));};exports[_0xc236('0x47')]=function(_0x8d04c9,_0x479e02){var _0x11e3dd={'raw':!![],'where':{'id':_0x8d04c9[_0xc236('0x48')]['id']}},_0x429e08={};_0x429e08['model']=_[_0xc236('0x33')](db[_0xc236('0x2d')][_0xc236('0x49')]);_0x429e08[_0xc236('0x32')]=_[_0xc236('0x33')](_0x8d04c9[_0xc236('0x32')]);_0x429e08['filters']=_[_0xc236('0x35')](_0x429e08['model'],_0x429e08[_0xc236('0x32')]);_0x11e3dd[_0xc236('0x34')]=_[_0xc236('0x35')](_0x429e08[_0xc236('0x31')],qs[_0xc236('0x36')](_0x8d04c9[_0xc236('0x32')][_0xc236('0x36')]));_0x11e3dd['attributes']=_0x11e3dd[_0xc236('0x34')]['length']?_0x11e3dd[_0xc236('0x34')]:_0x429e08[_0xc236('0x31')];if(_0x8d04c9['query'][_0xc236('0x4a')]){_0x11e3dd[_0xc236('0x44')]=[{'all':!![]}];}_0x11e3dd=_[_0xc236('0x42')]({},_0x11e3dd,_0x8d04c9[_0xc236('0x43')]);return db[_0xc236('0x2d')][_0xc236('0x4b')](_0x11e3dd)[_0xc236('0x24')](handleEntityNotFound(_0x479e02,null))['then'](respondWithResult(_0x479e02,null))['catch'](handleError(_0x479e02,null));};exports[_0xc236('0x4c')]=function(_0x2afed2,_0x510f7f){return db[_0xc236('0x2d')][_0xc236('0x4c')](_0x2afed2[_0xc236('0x4d')],{})[_0xc236('0x24')](function(_0x45fa20){var _0x1683f4=_0x2afed2[_0xc236('0x4e')][_0xc236('0x4f')]({'plain':!![]});if(!_0x1683f4)throw new Error(_0xc236('0x50'));if(_0x1683f4['role']===_0xc236('0x4e')){var _0x307663=_0x45fa20[_0xc236('0x4f')]({'plain':!![]});var _0x447a83=_0xc236('0x26');return db[_0xc236('0x51')][_0xc236('0x4b')]({'where':{'name':_0x447a83,'userProfileId':_0x1683f4['userProfileId']},'raw':!![]})[_0xc236('0x24')](function(_0x3788ff){if(_0x3788ff&&_0x3788ff[_0xc236('0x52')]===0x0){return db[_0xc236('0x27')]['create']({'name':_0x307663[_0xc236('0x29')],'resourceId':_0x307663['id'],'type':_0x3788ff[_0xc236('0x29')],'sectionId':_0x3788ff['id']},{})[_0xc236('0x24')](function(){return _0x45fa20;});}else{return _0x45fa20;}})[_0xc236('0x46')](function(_0x9d81c8){logger['error'](_0xc236('0x53'),_0x9d81c8);throw _0x9d81c8;});}return _0x45fa20;})['then'](respondWithResult(_0x510f7f,0xc9))[_0xc236('0x46')](handleError(_0x510f7f,null));};exports[_0xc236('0x23')]=function(_0x3f9e85,_0x15defc){if(_0x3f9e85[_0xc236('0x4d')]['id']){delete _0x3f9e85['body']['id'];}return db['VoiceMail'][_0xc236('0x4b')]({'where':{'id':_0x3f9e85[_0xc236('0x48')]['id']}})[_0xc236('0x24')](handleEntityNotFound(_0x15defc,null))[_0xc236('0x24')](saveUpdates(_0x3f9e85[_0xc236('0x4d')],null))[_0xc236('0x24')](respondWithResult(_0x15defc,null))[_0xc236('0x46')](handleError(_0x15defc,null));};exports[_0xc236('0x25')]=function(_0x24af08,_0x2d27e7){return db['VoiceMail']['find']({'where':{'id':_0x24af08[_0xc236('0x48')]['id']}})[_0xc236('0x24')](handleEntityNotFound(_0x2d27e7,null))[_0xc236('0x24')](removeEntity(_0x2d27e7,null))[_0xc236('0x46')](handleError(_0x2d27e7,null));};exports['getMessages']=function(_0x94fc7,_0x460076,_0x56e476){return db[_0xc236('0x2d')][_0xc236('0x54')]({'where':{'id':_0x94fc7[_0xc236('0x48')]['id']}})[_0xc236('0x24')](handleEntityNotFound(_0x460076,null))['then'](function(_0x1558dd){var _0xec00da;var _0x35955c={},_0x2602f8={};_0x2602f8[_0xc236('0x31')]=_[_0xc236('0x33')](db[_0xc236('0x55')]['rawAttributes']);_0x2602f8[_0xc236('0x32')]=_['keys'](_0x94fc7[_0xc236('0x32')]);_0x2602f8[_0xc236('0x3e')]=_[_0xc236('0x35')](_0x2602f8[_0xc236('0x31')],_0x2602f8['query']);_0x35955c[_0xc236('0x34')]=_[_0xc236('0x35')](_0x2602f8[_0xc236('0x31')],qs['fields'](_0x94fc7[_0xc236('0x32')][_0xc236('0x36')]));_0x35955c[_0xc236('0x34')]=_0x35955c[_0xc236('0x34')][_0xc236('0x37')]?_0x35955c[_0xc236('0x34')]:_0x2602f8['model'];if(!_0x94fc7['query'][_0xc236('0x38')](_0xc236('0x39'))){_0x35955c[_0xc236('0x3a')]=qs[_0xc236('0x3a')](_0x94fc7[_0xc236('0x32')][_0xc236('0x3a')]);_0x35955c[_0xc236('0x1a')]=qs['offset'](_0x94fc7['query']['offset']);}_0x35955c[_0xc236('0x3b')]=qs[_0xc236('0x3c')](_0x94fc7[_0xc236('0x32')][_0xc236('0x3c')]);_0x35955c['where']=qs['filters'](_['pick'](_0x94fc7['query'],_0x2602f8[_0xc236('0x3e')]));if(_0x94fc7['query'][_0xc236('0x40')]){_0x35955c['where']=_[_0xc236('0x42')](_0x35955c[_0xc236('0x3d')],{'$or':_[_0xc236('0x2c')](_0x35955c[_0xc236('0x34')],function(_0x26d708){var _0x169e73={};_0x169e73[_0x26d708]={'$like':'%'+_0x94fc7[_0xc236('0x32')]['filter']+'%'};return _0x169e73;})});}_0x35955c[_0xc236('0x3d')]=_['merge'](_0x35955c[_0xc236('0x3d')],{'mailboxuser':_0x1558dd[_0xc236('0x56')]});_0x35955c=_[_0xc236('0x42')]({},_0x35955c,_0x94fc7[_0xc236('0x43')]);return db[_0xc236('0x55')][_0xc236('0x57')](_0x35955c)['then'](respondWithFilteredResult(_0x460076,_0x35955c));})[_0xc236('0x46')](handleError(_0x460076,null));};
\ No newline at end of file
index 93fd802..35cac2c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x75bd=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMail.attributes','define','VoiceMail','voice_voicemail','mailbox_context','context','lodash','util','../../config/logger'];(function(_0x23acc3,_0x4e7403){var _0x2c7dd5=function(_0x411530){while(--_0x411530){_0x23acc3['push'](_0x23acc3['shift']());}};_0x2c7dd5(++_0x4e7403);}(_0x75bd,0x9d));var _0xd75b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x75bd[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xd75b('0x0'));var util=require(_0xd75b('0x1'));var logger=require(_0xd75b('0x2'))(_0xd75b('0x3'));var moment=require(_0xd75b('0x4'));var BPromise=require(_0xd75b('0x5'));var rp=require(_0xd75b('0x6'));var fs=require('fs');var path=require(_0xd75b('0x7'));var rimraf=require(_0xd75b('0x8'));var config=require(_0xd75b('0x9'));var attributes=require(_0xd75b('0xa'));module['exports']=function(_0x4e7d6d,_0x5e9ba6){return _0x4e7d6d[_0xd75b('0xb')](_0xd75b('0xc'),attributes,{'tableName':_0xd75b('0xd'),'paranoid':![],'indexes':[{'name':_0xd75b('0xe'),'fields':['mailbox',_0xd75b('0xf')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xf194=['../../config/logger','bluebird','path','./voiceMail.attributes','exports','define','VoiceMail','voice_voicemail','context','util'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xf194,0x1b7));var _0x4f19=function(_0x302f42,_0x3734b6){_0x302f42=_0x302f42-0x0;var _0x36532b=_0xf194[_0x302f42];return _0x36532b;};'use strict';var _=require('lodash');var util=require(_0x4f19('0x0'));var logger=require(_0x4f19('0x1'))('api');var moment=require('moment');var BPromise=require(_0x4f19('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4f19('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x4f19('0x4'));module[_0x4f19('0x5')]=function(_0x2cf7bf,_0x184cd2){return _0x2cf7bf[_0x4f19('0x6')](_0x4f19('0x7'),attributes,{'tableName':_0x4f19('0x8'),'paranoid':![],'indexes':[{'name':'mailbox_context','fields':['mailbox',_0x4f19('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
index ac18b58..49c088c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe879=['bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','info','VoiceMail,\x20%s,\x20%s','debug','VoiceMail,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','catch','util','moment'];(function(_0x4d4fc4,_0x508931){var _0x4649ee=function(_0x30f5d2){while(--_0x30f5d2){_0x4d4fc4['push'](_0x4d4fc4['shift']());}};_0x4649ee(++_0x508931);}(_0xe879,0x6a));var _0x9e87=function(_0x2af7b2,_0x3b7a1f){_0x2af7b2=_0x2af7b2-0x0;var _0x5024ef=_0xe879[_0x2af7b2];return _0x5024ef;};'use strict';var _=require('lodash');var util=require(_0x9e87('0x0'));var moment=require(_0x9e87('0x1'));var BPromise=require(_0x9e87('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9e87('0x3'))['db'];var utils=require(_0x9e87('0x4'));var logger=require(_0x9e87('0x5'))(_0x9e87('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x9e87('0x7')][_0x9e87('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5d0148,_0x14b874,_0x53a431){return new BPromise(function(_0xf91d1e,_0x33df5d){return client[_0x9e87('0x9')](_0x5d0148,_0x53a431)['then'](function(_0x2ec096){logger[_0x9e87('0xa')](_0x9e87('0xb'),_0x14b874,'request\x20sent');logger[_0x9e87('0xc')](_0x9e87('0xd'),_0x14b874,_0x9e87('0xe'),JSON['stringify'](_0x2ec096));if(_0x2ec096['error']){if(_0x2ec096[_0x9e87('0xf')]['code']===0x1f4){logger[_0x9e87('0xf')](_0x9e87('0xb'),_0x14b874,_0x2ec096['error'][_0x9e87('0x10')]);return _0x33df5d(_0x2ec096['error'][_0x9e87('0x10')]);}logger['error']('VoiceMail,\x20%s,\x20%s',_0x14b874,_0x2ec096[_0x9e87('0xf')][_0x9e87('0x10')]);return _0xf91d1e(_0x2ec096['error'][_0x9e87('0x10')]);}else{logger[_0x9e87('0xa')](_0x9e87('0xb'),_0x14b874,'request\x20sent');_0xf91d1e(_0x2ec096['result'][_0x9e87('0x10')]);}})[_0x9e87('0x11')](function(_0x4c604a){logger['error'](_0x9e87('0xb'),_0x14b874,_0x4c604a);_0x33df5d(_0x4c604a);});});}
\ No newline at end of file
+var _0x6cec=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird'];(function(_0x4c2e0f,_0x39c1c2){var _0x4bd0b6=function(_0x2d0eea){while(--_0x2d0eea){_0x4c2e0f['push'](_0x4c2e0f['shift']());}};_0x4bd0b6(++_0x39c1c2);}(_0x6cec,0xac));var _0xc6ce=function(_0x13639d,_0x3c996b){_0x13639d=_0x13639d-0x0;var _0x52ef14=_0x6cec[_0x13639d];return _0x52ef14;};'use strict';var _=require(_0xc6ce('0x0'));var util=require(_0xc6ce('0x1'));var moment=require('moment');var BPromise=require(_0xc6ce('0x2'));var rs=require(_0xc6ce('0x3'));var fs=require('fs');var Redis=require(_0xc6ce('0x4'));var db=require(_0xc6ce('0x5'))['db'];var utils=require(_0xc6ce('0x6'));var logger=require('../../config/logger')(_0xc6ce('0x7'));var config=require(_0xc6ce('0x8'));var jayson=require(_0xc6ce('0x9'));var client=jayson[_0xc6ce('0xa')][_0xc6ce('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4b1016,_0x2112b4,_0x42ad6f){return new BPromise(function(_0x4b77a3,_0x39893e){return client[_0xc6ce('0xc')](_0x4b1016,_0x42ad6f)[_0xc6ce('0xd')](function(_0x3305da){logger[_0xc6ce('0xe')](_0xc6ce('0xf'),_0x2112b4,_0xc6ce('0x10'));logger[_0xc6ce('0x11')](_0xc6ce('0x12'),_0x2112b4,_0xc6ce('0x10'),JSON[_0xc6ce('0x13')](_0x3305da));if(_0x3305da[_0xc6ce('0x14')]){if(_0x3305da[_0xc6ce('0x14')][_0xc6ce('0x15')]===0x1f4){logger[_0xc6ce('0x14')](_0xc6ce('0xf'),_0x2112b4,_0x3305da['error'][_0xc6ce('0x16')]);return _0x39893e(_0x3305da[_0xc6ce('0x14')][_0xc6ce('0x16')]);}logger[_0xc6ce('0x14')](_0xc6ce('0xf'),_0x2112b4,_0x3305da[_0xc6ce('0x14')][_0xc6ce('0x16')]);return _0x4b77a3(_0x3305da['error'][_0xc6ce('0x16')]);}else{logger[_0xc6ce('0xe')](_0xc6ce('0xf'),_0x2112b4,_0xc6ce('0x10'));_0x4b77a3(_0x3305da[_0xc6ce('0x17')]['message']);}})[_0xc6ce('0x18')](function(_0x4cdcbd){logger[_0xc6ce('0x14')](_0xc6ce('0xf'),_0x2112b4,_0x4cdcbd);_0x39893e(_0x4cdcbd);});});}
\ No newline at end of file
index 1edc66f..3c3511c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x58e4=['/:id','post','create','put','delete','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceMailMessage.controller','isAuthenticated','index','get'];(function(_0x3d0c7d,_0xc74fc6){var _0xb5535d=function(_0x1aae45){while(--_0x1aae45){_0x3d0c7d['push'](_0x3d0c7d['shift']());}};_0xb5535d(++_0xc74fc6);}(_0x58e4,0x192));var _0x458e=function(_0x4e0fa0,_0x26d1e4){_0x4e0fa0=_0x4e0fa0-0x0;var _0x376a83=_0x58e4[_0x4e0fa0];return _0x376a83;};'use strict';var multer=require(_0x458e('0x0'));var util=require(_0x458e('0x1'));var path=require(_0x458e('0x2'));var timeout=require(_0x458e('0x3'));var express=require('express');var router=express[_0x458e('0x4')]();var fs_extra=require(_0x458e('0x5'));var auth=require(_0x458e('0x6'));var interaction=require(_0x458e('0x7'));var config=require('../../config/environment');var controller=require(_0x458e('0x8'));router['get']('/',auth[_0x458e('0x9')](),controller[_0x458e('0xa')]);router[_0x458e('0xb')](_0x458e('0xc'),auth[_0x458e('0x9')](),controller['show']);router[_0x458e('0xb')]('/:id/download',auth['isAuthenticated'](),controller['download']);router[_0x458e('0xd')]('/',auth[_0x458e('0x9')](),controller[_0x458e('0xe')]);router[_0x458e('0xf')](_0x458e('0xc'),auth[_0x458e('0x9')](),controller['update']);router[_0x458e('0x10')](_0x458e('0xc'),auth[_0x458e('0x9')](),controller[_0x458e('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0x7156=['./voiceMailMessage.controller','index','get','/:id','isAuthenticated','/:id/download','download','post','create','delete','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x275e73,_0x8d5ff6){var _0x43829d=function(_0x490b75){while(--_0x490b75){_0x275e73['push'](_0x275e73['shift']());}};_0x43829d(++_0x8d5ff6);}(_0x7156,0x173));var _0x6715=function(_0x3b2f59,_0x185551){_0x3b2f59=_0x3b2f59-0x0;var _0x50b017=_0x7156[_0x3b2f59];return _0x50b017;};'use strict';var multer=require(_0x6715('0x0'));var util=require(_0x6715('0x1'));var path=require(_0x6715('0x2'));var timeout=require(_0x6715('0x3'));var express=require('express');var router=express[_0x6715('0x4')]();var fs_extra=require(_0x6715('0x5'));var auth=require(_0x6715('0x6'));var interaction=require(_0x6715('0x7'));var config=require(_0x6715('0x8'));var controller=require(_0x6715('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x6715('0xa')]);router[_0x6715('0xb')](_0x6715('0xc'),auth[_0x6715('0xd')](),controller['show']);router['get'](_0x6715('0xe'),auth[_0x6715('0xd')](),controller[_0x6715('0xf')]);router[_0x6715('0x10')]('/',auth['isAuthenticated'](),controller[_0x6715('0x11')]);router['put'](_0x6715('0xc'),auth[_0x6715('0xd')](),controller['update']);router[_0x6715('0x12')]('/:id',auth[_0x6715('0xd')](),controller[_0x6715('0x13')]);module['exports']=router;
\ No newline at end of file
index 9f9a7a3..bf18dbd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x56c1=['CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','exports','getDataValue','INTEGER','STRING','BLOB','TIMESTAMP','literal'];(function(_0x5e42ca,_0x5f4f6e){var _0x29e21f=function(_0x503fc4){while(--_0x503fc4){_0x5e42ca['push'](_0x5e42ca['shift']());}};_0x29e21f(++_0x5f4f6e);}(_0x56c1,0x1c1));var _0x156c=function(_0x116809,_0x199b6f){_0x116809=_0x116809-0x0;var _0x1135b4=_0x56c1[_0x116809];return _0x1135b4;};'use strict';var Sequelize=require('sequelize');module[_0x156c('0x0')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x3f1265){return this[_0x156c('0x1')]('id');}},'msgnum':{'type':Sequelize[_0x156c('0x2')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x156c('0x3')],'defaultValue':''},'context':{'type':Sequelize['STRING'],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x156c('0x3')],'defaultValue':''},'callerid':{'type':Sequelize[_0x156c('0x3')],'defaultValue':''},'origtime':{'type':Sequelize[_0x156c('0x3')],'defaultValue':''},'duration':{'type':Sequelize[_0x156c('0x3')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x156c('0x3')],'defaultValue':''},'mailboxcontext':{'type':Sequelize['STRING'],'defaultValue':''},'recording':{'type':Sequelize[_0x156c('0x4')]('long'),'defaultValue':null},'flag':{'type':Sequelize['STRING'],'defaultValue':''},'msg_id':{'type':Sequelize['STRING'],'defaultValue':''},'stamp':{'type':_0x156c('0x5'),'defaultValue':Sequelize[_0x156c('0x6')](_0x156c('0x7'))}};
\ No newline at end of file
+var _0x1844=['getDataValue','INTEGER','STRING','BLOB','long','TIMESTAMP','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','exports','VIRTUAL'];(function(_0x56e32e,_0x9eb2f6){var _0x2a757b=function(_0x50b7bc){while(--_0x50b7bc){_0x56e32e['push'](_0x56e32e['shift']());}};_0x2a757b(++_0x9eb2f6);}(_0x1844,0x1ab));var _0x4184=function(_0xdbec4d,_0xfb4626){_0xdbec4d=_0xdbec4d-0x0;var _0x208681=_0x1844[_0xdbec4d];return _0x208681;};'use strict';var Sequelize=require(_0x4184('0x0'));module[_0x4184('0x1')]={'name':{'type':Sequelize[_0x4184('0x2')],'get':function(_0x470807){return this[_0x4184('0x3')]('id');}},'msgnum':{'type':Sequelize[_0x4184('0x4')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x4184('0x5')],'defaultValue':''},'context':{'type':Sequelize['STRING'],'defaultValue':''},'macrocontext':{'type':Sequelize['STRING'],'defaultValue':''},'callerid':{'type':Sequelize['STRING'],'defaultValue':''},'origtime':{'type':Sequelize[_0x4184('0x5')],'defaultValue':''},'duration':{'type':Sequelize[_0x4184('0x5')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x4184('0x5')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x4184('0x5')],'defaultValue':''},'recording':{'type':Sequelize[_0x4184('0x6')](_0x4184('0x7')),'defaultValue':null},'flag':{'type':Sequelize[_0x4184('0x5')],'defaultValue':''},'msg_id':{'type':Sequelize['STRING'],'defaultValue':''},'stamp':{'type':_0x4184('0x8'),'defaultValue':Sequelize['literal'](_0x4184('0x9'))}};
\ No newline at end of file
index 89f6971..559a6f7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x86d0=['offset','undefined','count','limit','set','Content-Range','apply','then','destroy','stack','name','index','map','VoiceMailMessage','rawAttributes','type','key','model','differenceBy','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','options','find','create','body','params','download','recording','msg_id','Sequelize','VoiceMailMessage\x20not\x20found','attachment','Content-Disposition','attachment;\x20filename=\x22','.wav\x22','send','eml-format','zip-dir','fast-json-patch','moment','mustache','util','sox','to-csv','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json'];(function(_0x566901,_0x4ae7f9){var _0x264942=function(_0x3af8f1){while(--_0x3af8f1){_0x566901['push'](_0x566901['shift']());}};_0x264942(++_0x4ae7f9);}(_0x86d0,0x131));var _0x086d=function(_0x1a362a,_0x532d2e){_0x1a362a=_0x1a362a-0x0;var _0x1c6fc4=_0x86d0[_0x1a362a];return _0x1c6fc4;};'use strict';var emlformat=require(_0x086d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x086d('0x1'));var jsonpatch=require(_0x086d('0x2'));var rp=require('request-promise');var moment=require(_0x086d('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x086d('0x4'));var util=require(_0x086d('0x5'));var path=require('path');var sox=require(_0x086d('0x6'));var csv=require(_0x086d('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x086d('0x8'));var _=require('lodash');var squel=require(_0x086d('0x9'));var crypto=require(_0x086d('0xa'));var jsforce=require(_0x086d('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x086d('0x7'));var querystring=require('querystring');var Papa=require(_0x086d('0xc'));var Redis=require(_0x086d('0xd'));var authService=require(_0x086d('0xe'));var qs=require(_0x086d('0xf'));var as=require(_0x086d('0x10'));var hardwareService=require(_0x086d('0x11'));var logger=require(_0x086d('0x12'))(_0x086d('0x13'));var utils=require(_0x086d('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x086d('0x15'));var db=require(_0x086d('0x16'))['db'];function respondWithStatusCode(_0x580d4b,_0x4c4132){_0x4c4132=_0x4c4132||0xcc;return function(_0x3d2d24){if(_0x3d2d24){return _0x580d4b[_0x086d('0x17')](_0x4c4132);}return _0x580d4b[_0x086d('0x18')](_0x4c4132)[_0x086d('0x19')]();};}function respondWithResult(_0xdf8ed6,_0x1a71cf){_0x1a71cf=_0x1a71cf||0xc8;return function(_0x337152){if(_0x337152){return _0xdf8ed6[_0x086d('0x18')](_0x1a71cf)[_0x086d('0x1a')](_0x337152);}};}function respondWithFilteredResult(_0x11b0e4,_0x53ef73){return function(_0x12b990){if(_0x12b990){var _0x253bfa=typeof _0x53ef73[_0x086d('0x1b')]===_0x086d('0x1c')&&typeof _0x53ef73['limit']==='undefined';var _0x5b006c=_0x12b990[_0x086d('0x1d')];var _0x3ee7b5=_0x253bfa?0x0:_0x53ef73[_0x086d('0x1b')];var _0x5e6d78=_0x253bfa?_0x12b990[_0x086d('0x1d')]:_0x53ef73[_0x086d('0x1b')]+_0x53ef73[_0x086d('0x1e')];var _0x4aed2a;if(_0x5e6d78>=_0x5b006c){_0x5e6d78=_0x5b006c;_0x4aed2a=0xc8;}else{_0x4aed2a=0xce;}_0x11b0e4['status'](_0x4aed2a);return _0x11b0e4[_0x086d('0x1f')](_0x086d('0x20'),_0x3ee7b5+'-'+_0x5e6d78+'/'+_0x5b006c)[_0x086d('0x1a')](_0x12b990);}return null;};}function patchUpdates(_0x4dc053){return function(_0x114e66){try{jsonpatch[_0x086d('0x21')](_0x114e66,_0x4dc053,!![]);}catch(_0x8e0141){return BPromise['reject'](_0x8e0141);}return _0x114e66['save']();};}function saveUpdates(_0x5304a8,_0x1db7e0){return function(_0x520cfa){if(_0x520cfa){return _0x520cfa['update'](_0x5304a8)[_0x086d('0x22')](function(_0x1c13f3){return _0x1c13f3;});}return null;};}function removeEntity(_0x3562ea,_0x16f73a){return function(_0x11679c){if(_0x11679c){return _0x11679c[_0x086d('0x23')]()[_0x086d('0x22')](function(){_0x3562ea[_0x086d('0x18')](0xcc)[_0x086d('0x19')]();});}};}function handleEntityNotFound(_0x35f351,_0x12c94b){return function(_0x516eea){if(!_0x516eea){_0x35f351[_0x086d('0x17')](0x194);}return _0x516eea;};}function handleError(_0x2f5852,_0x4233e8){_0x4233e8=_0x4233e8||0x1f4;return function(_0x37ba76){logger['error'](_0x37ba76[_0x086d('0x24')]);if(_0x37ba76['name']){delete _0x37ba76[_0x086d('0x25')];}_0x2f5852[_0x086d('0x18')](_0x4233e8)['send'](_0x37ba76);};}exports[_0x086d('0x26')]=function(_0x51d1c3,_0x5a2748){var _0x2db163={},_0x2e64f3={},_0x3d445c={'count':0x0,'rows':[]};var _0x5d6622=_[_0x086d('0x27')](db[_0x086d('0x28')][_0x086d('0x29')],function(_0x5bd4a0){return{'name':_0x5bd4a0['fieldName'],'type':_0x5bd4a0[_0x086d('0x2a')][_0x086d('0x2b')]};});_0x2e64f3[_0x086d('0x2c')]=_[_0x086d('0x2d')](_[_0x086d('0x27')](_0x5d6622,'name'),['name']);_0x2e64f3[_0x086d('0x2e')]=_[_0x086d('0x2f')](_0x51d1c3[_0x086d('0x2e')]);_0x2e64f3[_0x086d('0x30')]=_[_0x086d('0x31')](_0x2e64f3['model'],_0x2e64f3[_0x086d('0x2e')]);_0x2db163[_0x086d('0x32')]=_[_0x086d('0x31')](_0x2e64f3[_0x086d('0x2c')],qs[_0x086d('0x33')](_0x51d1c3['query'][_0x086d('0x33')]));_0x2db163['attributes']=_0x2db163['attributes'][_0x086d('0x34')]?_0x2db163['attributes']:_0x2e64f3[_0x086d('0x2c')];if(!_0x51d1c3[_0x086d('0x2e')][_0x086d('0x35')](_0x086d('0x36'))){_0x2db163[_0x086d('0x1e')]=qs[_0x086d('0x1e')](_0x51d1c3[_0x086d('0x2e')][_0x086d('0x1e')]);_0x2db163[_0x086d('0x1b')]=qs[_0x086d('0x1b')](_0x51d1c3[_0x086d('0x2e')]['offset']);}_0x2db163[_0x086d('0x37')]=qs['sort'](_0x51d1c3[_0x086d('0x2e')][_0x086d('0x38')]);_0x2db163[_0x086d('0x39')]=qs['filters'](_[_0x086d('0x3a')](_0x51d1c3[_0x086d('0x2e')],_0x2e64f3[_0x086d('0x30')]),_0x5d6622);if(_0x51d1c3[_0x086d('0x2e')]['filter']){_0x2db163[_0x086d('0x39')]=_[_0x086d('0x3b')](_0x2db163[_0x086d('0x39')],{'$or':_[_0x086d('0x27')](_0x5d6622,function(_0x3dab58){if(_0x3dab58[_0x086d('0x2a')]!==_0x086d('0x3c')){var _0x3e8c81={};_0x3e8c81[_0x3dab58[_0x086d('0x25')]]={'$like':'%'+_0x51d1c3[_0x086d('0x2e')][_0x086d('0x3d')]+'%'};return _0x3e8c81;}})});}_0x2db163=_[_0x086d('0x3b')]({},_0x2db163,_0x51d1c3['options']);var _0x13e515={'where':_0x2db163[_0x086d('0x39')]};return db['VoiceMailMessage']['count'](_0x13e515)[_0x086d('0x22')](function(_0x12baa5){_0x3d445c[_0x086d('0x1d')]=_0x12baa5;if(_0x51d1c3[_0x086d('0x2e')][_0x086d('0x3e')]){_0x2db163[_0x086d('0x3f')]=[{'all':!![]}];}return db['VoiceMailMessage'][_0x086d('0x40')](_0x2db163);})[_0x086d('0x22')](function(_0x4312c9){_0x3d445c[_0x086d('0x41')]=_0x4312c9;return _0x3d445c;})[_0x086d('0x22')](respondWithFilteredResult(_0x5a2748,_0x2db163))[_0x086d('0x42')](handleError(_0x5a2748,null));};exports[_0x086d('0x43')]=function(_0x4eaa1f,_0x33712e){var _0x5e8894={'raw':!![],'where':{'id':_0x4eaa1f['params']['id']}},_0x49eb14={};_0x49eb14[_0x086d('0x2c')]=_[_0x086d('0x2f')](db[_0x086d('0x28')][_0x086d('0x29')]);_0x49eb14['query']=_['keys'](_0x4eaa1f[_0x086d('0x2e')]);_0x49eb14[_0x086d('0x30')]=_['intersection'](_0x49eb14['model'],_0x49eb14['query']);_0x5e8894[_0x086d('0x32')]=_[_0x086d('0x31')](_0x49eb14[_0x086d('0x2c')],qs[_0x086d('0x33')](_0x4eaa1f[_0x086d('0x2e')][_0x086d('0x33')]));_0x5e8894[_0x086d('0x32')]=_0x5e8894[_0x086d('0x32')][_0x086d('0x34')]?_0x5e8894[_0x086d('0x32')]:_0x49eb14[_0x086d('0x2c')];if(_0x4eaa1f[_0x086d('0x2e')][_0x086d('0x3e')]){_0x5e8894[_0x086d('0x3f')]=[{'all':!![]}];}_0x5e8894=_['merge']({},_0x5e8894,_0x4eaa1f[_0x086d('0x44')]);return db[_0x086d('0x28')][_0x086d('0x45')](_0x5e8894)[_0x086d('0x22')](handleEntityNotFound(_0x33712e,null))[_0x086d('0x22')](respondWithResult(_0x33712e,null))[_0x086d('0x42')](handleError(_0x33712e,null));};exports[_0x086d('0x46')]=function(_0x339857,_0x2acf25){return db[_0x086d('0x28')]['create'](_0x339857['body'],{})[_0x086d('0x22')](respondWithResult(_0x2acf25,0xc9))[_0x086d('0x42')](handleError(_0x2acf25,null));};exports['update']=function(_0x506923,_0x2dc728){if(_0x506923[_0x086d('0x47')]['id']){delete _0x506923[_0x086d('0x47')]['id'];}return db[_0x086d('0x28')][_0x086d('0x45')]({'where':{'id':_0x506923[_0x086d('0x48')]['id']}})[_0x086d('0x22')](handleEntityNotFound(_0x2dc728,null))[_0x086d('0x22')](saveUpdates(_0x506923['body'],null))['then'](respondWithResult(_0x2dc728,null))[_0x086d('0x42')](handleError(_0x2dc728,null));};exports[_0x086d('0x23')]=function(_0x88a52b,_0x250ae9){return db[_0x086d('0x28')]['find']({'where':{'id':_0x88a52b[_0x086d('0x48')]['id']}})[_0x086d('0x22')](handleEntityNotFound(_0x250ae9,null))[_0x086d('0x22')](removeEntity(_0x250ae9,null))[_0x086d('0x42')](handleError(_0x250ae9,null));};exports[_0x086d('0x49')]=function(_0x467ff6,_0x24ca05,_0x217305){return db[_0x086d('0x28')][_0x086d('0x45')]({'where':{'id':_0x467ff6['params']['id']},'attributes':['id',_0x086d('0x4a'),_0x086d('0x4b')]})[_0x086d('0x22')](handleEntityNotFound(_0x24ca05,null))[_0x086d('0x22')](function(_0x2872ea){if(_0x2872ea){if(!_0x2872ea['recording']){throw new db[(_0x086d('0x4c'))]['ValidationError'](_0x086d('0x4d'));}var _0x13969f={'Content-Type':'audio/wav','Content-Disposition':_0x086d('0x4e')};if(_0x2872ea[_0x086d('0x4b')]){_0x13969f[_0x086d('0x4f')]=_0x086d('0x50')+_0x2872ea[_0x086d('0x4b')]+_0x086d('0x51');}_0x24ca05['set'](_0x13969f);return _0x24ca05[_0x086d('0x52')](new Buffer(_0x2872ea[_0x086d('0x4a')]));}})[_0x086d('0x42')](handleError(_0x24ca05,null));};
\ No newline at end of file
+var _0xf58f=['save','update','then','destroy','error','stack','name','send','map','VoiceMailMessage','rawAttributes','fieldName','type','model','differenceBy','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','length','catch','body','find','download','recording','msg_id','Sequelize','VoiceMailMessage\x20not\x20found','audio/wav','attachment','Content-Disposition','attachment;\x20filename=\x22','.wav\x22','set','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','apply'];(function(_0x1454c5,_0x11d3e8){var _0x362cbe=function(_0x552709){while(--_0x552709){_0x1454c5['push'](_0x1454c5['shift']());}};_0x362cbe(++_0x11d3e8);}(_0xf58f,0x1d7));var _0xff58=function(_0x4dd3a5,_0x3457c3){_0x4dd3a5=_0x4dd3a5-0x0;var _0x37da0d=_0xf58f[_0x4dd3a5];return _0x37da0d;};'use strict';var emlformat=require(_0xff58('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xff58('0x1'));var jsonpatch=require(_0xff58('0x2'));var rp=require(_0xff58('0x3'));var moment=require(_0xff58('0x4'));var BPromise=require(_0xff58('0x5'));var Mustache=require('mustache');var util=require(_0xff58('0x6'));var path=require(_0xff58('0x7'));var sox=require(_0xff58('0x8'));var csv=require(_0xff58('0x9'));var ejs=require(_0xff58('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xff58('0xb'));var crypto=require('crypto');var jsforce=require(_0xff58('0xc'));var deskjs=require(_0xff58('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xff58('0xe'));var Redis=require(_0xff58('0xf'));var authService=require(_0xff58('0x10'));var qs=require(_0xff58('0x11'));var as=require(_0xff58('0x12'));var hardwareService=require(_0xff58('0x13'));var logger=require('../../config/logger')(_0xff58('0x14'));var utils=require(_0xff58('0x15'));var config=require(_0xff58('0x16'));var licenseUtil=require(_0xff58('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x374f69,_0x5c15b1){_0x5c15b1=_0x5c15b1||0xcc;return function(_0x34da98){if(_0x34da98){return _0x374f69[_0xff58('0x18')](_0x5c15b1);}return _0x374f69['status'](_0x5c15b1)[_0xff58('0x19')]();};}function respondWithResult(_0x5bb13f,_0x28f15b){_0x28f15b=_0x28f15b||0xc8;return function(_0x13cdc6){if(_0x13cdc6){return _0x5bb13f[_0xff58('0x1a')](_0x28f15b)[_0xff58('0x1b')](_0x13cdc6);}};}function respondWithFilteredResult(_0x2d36ed,_0x58fdf0){return function(_0x3baf46){if(_0x3baf46){var _0x5f9fac=typeof _0x58fdf0[_0xff58('0x1c')]===_0xff58('0x1d')&&typeof _0x58fdf0[_0xff58('0x1e')]===_0xff58('0x1d');var _0x5d8f70=_0x3baf46[_0xff58('0x1f')];var _0x37f7b7=_0x5f9fac?0x0:_0x58fdf0[_0xff58('0x1c')];var _0x3db0ef=_0x5f9fac?_0x3baf46[_0xff58('0x1f')]:_0x58fdf0[_0xff58('0x1c')]+_0x58fdf0['limit'];var _0x1000bb;if(_0x3db0ef>=_0x5d8f70){_0x3db0ef=_0x5d8f70;_0x1000bb=0xc8;}else{_0x1000bb=0xce;}_0x2d36ed['status'](_0x1000bb);return _0x2d36ed['set']('Content-Range',_0x37f7b7+'-'+_0x3db0ef+'/'+_0x5d8f70)[_0xff58('0x1b')](_0x3baf46);}return null;};}function patchUpdates(_0x316bcf){return function(_0x1d88a4){try{jsonpatch[_0xff58('0x20')](_0x1d88a4,_0x316bcf,!![]);}catch(_0x1fa023){return BPromise['reject'](_0x1fa023);}return _0x1d88a4[_0xff58('0x21')]();};}function saveUpdates(_0x4815ba,_0x1fc204){return function(_0x47161f){if(_0x47161f){return _0x47161f[_0xff58('0x22')](_0x4815ba)[_0xff58('0x23')](function(_0x8ab62e){return _0x8ab62e;});}return null;};}function removeEntity(_0x1f7383,_0x213856){return function(_0x2abd0d){if(_0x2abd0d){return _0x2abd0d[_0xff58('0x24')]()[_0xff58('0x23')](function(){_0x1f7383[_0xff58('0x1a')](0xcc)[_0xff58('0x19')]();});}};}function handleEntityNotFound(_0x112dbe,_0x1b97e9){return function(_0x361a20){if(!_0x361a20){_0x112dbe[_0xff58('0x18')](0x194);}return _0x361a20;};}function handleError(_0x41b33c,_0x299903){_0x299903=_0x299903||0x1f4;return function(_0x47cd1b){logger[_0xff58('0x25')](_0x47cd1b[_0xff58('0x26')]);if(_0x47cd1b[_0xff58('0x27')]){delete _0x47cd1b[_0xff58('0x27')];}_0x41b33c[_0xff58('0x1a')](_0x299903)[_0xff58('0x28')](_0x47cd1b);};}exports['index']=function(_0x402e6a,_0xe15834){var _0x403509={},_0x1eb46d={},_0x371d76={'count':0x0,'rows':[]};var _0x456a85=_[_0xff58('0x29')](db[_0xff58('0x2a')][_0xff58('0x2b')],function(_0x4efa62){return{'name':_0x4efa62[_0xff58('0x2c')],'type':_0x4efa62[_0xff58('0x2d')]['key']};});_0x1eb46d[_0xff58('0x2e')]=_[_0xff58('0x2f')](_[_0xff58('0x29')](_0x456a85,'name'),[_0xff58('0x27')]);_0x1eb46d[_0xff58('0x30')]=_[_0xff58('0x31')](_0x402e6a[_0xff58('0x30')]);_0x1eb46d[_0xff58('0x32')]=_[_0xff58('0x33')](_0x1eb46d['model'],_0x1eb46d['query']);_0x403509[_0xff58('0x34')]=_['intersection'](_0x1eb46d[_0xff58('0x2e')],qs['fields'](_0x402e6a['query'][_0xff58('0x35')]));_0x403509[_0xff58('0x34')]=_0x403509[_0xff58('0x34')]['length']?_0x403509['attributes']:_0x1eb46d[_0xff58('0x2e')];if(!_0x402e6a[_0xff58('0x30')][_0xff58('0x36')](_0xff58('0x37'))){_0x403509[_0xff58('0x1e')]=qs[_0xff58('0x1e')](_0x402e6a[_0xff58('0x30')][_0xff58('0x1e')]);_0x403509['offset']=qs[_0xff58('0x1c')](_0x402e6a[_0xff58('0x30')]['offset']);}_0x403509[_0xff58('0x38')]=qs['sort'](_0x402e6a[_0xff58('0x30')][_0xff58('0x39')]);_0x403509['where']=qs[_0xff58('0x32')](_['pick'](_0x402e6a[_0xff58('0x30')],_0x1eb46d[_0xff58('0x32')]),_0x456a85);if(_0x402e6a[_0xff58('0x30')][_0xff58('0x3a')]){_0x403509[_0xff58('0x3b')]=_[_0xff58('0x3c')](_0x403509[_0xff58('0x3b')],{'$or':_[_0xff58('0x29')](_0x456a85,function(_0x519e2c){if(_0x519e2c[_0xff58('0x2d')]!==_0xff58('0x3d')){var _0x58e4d6={};_0x58e4d6[_0x519e2c[_0xff58('0x27')]]={'$like':'%'+_0x402e6a['query']['filter']+'%'};return _0x58e4d6;}})});}_0x403509=_[_0xff58('0x3c')]({},_0x403509,_0x402e6a[_0xff58('0x3e')]);var _0x4164bc={'where':_0x403509[_0xff58('0x3b')]};return db[_0xff58('0x2a')][_0xff58('0x1f')](_0x4164bc)[_0xff58('0x23')](function(_0x14f303){_0x371d76[_0xff58('0x1f')]=_0x14f303;if(_0x402e6a[_0xff58('0x30')][_0xff58('0x3f')]){_0x403509[_0xff58('0x40')]=[{'all':!![]}];}return db[_0xff58('0x2a')][_0xff58('0x41')](_0x403509);})[_0xff58('0x23')](function(_0xf9d2dd){_0x371d76[_0xff58('0x42')]=_0xf9d2dd;return _0x371d76;})[_0xff58('0x23')](respondWithFilteredResult(_0xe15834,_0x403509))['catch'](handleError(_0xe15834,null));};exports[_0xff58('0x43')]=function(_0x1ccfb5,_0x174eb2){var _0x2e04fd={'raw':!![],'where':{'id':_0x1ccfb5[_0xff58('0x44')]['id']}},_0x990635={};_0x990635['model']=_[_0xff58('0x31')](db[_0xff58('0x2a')]['rawAttributes']);_0x990635['query']=_[_0xff58('0x31')](_0x1ccfb5[_0xff58('0x30')]);_0x990635[_0xff58('0x32')]=_[_0xff58('0x33')](_0x990635[_0xff58('0x2e')],_0x990635[_0xff58('0x30')]);_0x2e04fd[_0xff58('0x34')]=_[_0xff58('0x33')](_0x990635[_0xff58('0x2e')],qs['fields'](_0x1ccfb5[_0xff58('0x30')][_0xff58('0x35')]));_0x2e04fd[_0xff58('0x34')]=_0x2e04fd[_0xff58('0x34')][_0xff58('0x45')]?_0x2e04fd['attributes']:_0x990635['model'];if(_0x1ccfb5[_0xff58('0x30')][_0xff58('0x3f')]){_0x2e04fd[_0xff58('0x40')]=[{'all':!![]}];}_0x2e04fd=_[_0xff58('0x3c')]({},_0x2e04fd,_0x1ccfb5['options']);return db[_0xff58('0x2a')]['find'](_0x2e04fd)[_0xff58('0x23')](handleEntityNotFound(_0x174eb2,null))[_0xff58('0x23')](respondWithResult(_0x174eb2,null))[_0xff58('0x46')](handleError(_0x174eb2,null));};exports['create']=function(_0x4a4168,_0xc6b4d6){return db[_0xff58('0x2a')]['create'](_0x4a4168['body'],{})[_0xff58('0x23')](respondWithResult(_0xc6b4d6,0xc9))['catch'](handleError(_0xc6b4d6,null));};exports[_0xff58('0x22')]=function(_0x457841,_0x152b10){if(_0x457841[_0xff58('0x47')]['id']){delete _0x457841[_0xff58('0x47')]['id'];}return db[_0xff58('0x2a')][_0xff58('0x48')]({'where':{'id':_0x457841['params']['id']}})[_0xff58('0x23')](handleEntityNotFound(_0x152b10,null))[_0xff58('0x23')](saveUpdates(_0x457841['body'],null))['then'](respondWithResult(_0x152b10,null))[_0xff58('0x46')](handleError(_0x152b10,null));};exports[_0xff58('0x24')]=function(_0x564d8f,_0x321db1){return db[_0xff58('0x2a')][_0xff58('0x48')]({'where':{'id':_0x564d8f[_0xff58('0x44')]['id']}})[_0xff58('0x23')](handleEntityNotFound(_0x321db1,null))['then'](removeEntity(_0x321db1,null))[_0xff58('0x46')](handleError(_0x321db1,null));};exports[_0xff58('0x49')]=function(_0x4f54e3,_0x38410b,_0xb128ae){return db['VoiceMailMessage'][_0xff58('0x48')]({'where':{'id':_0x4f54e3[_0xff58('0x44')]['id']},'attributes':['id',_0xff58('0x4a'),_0xff58('0x4b')]})[_0xff58('0x23')](handleEntityNotFound(_0x38410b,null))['then'](function(_0x9720ed){if(_0x9720ed){if(!_0x9720ed[_0xff58('0x4a')]){throw new db[(_0xff58('0x4c'))]['ValidationError'](_0xff58('0x4d'));}var _0x32921b={'Content-Type':_0xff58('0x4e'),'Content-Disposition':_0xff58('0x4f')};if(_0x9720ed['msg_id']){_0x32921b[_0xff58('0x50')]=_0xff58('0x51')+_0x9720ed[_0xff58('0x4b')]+_0xff58('0x52');}_0x38410b[_0xff58('0x53')](_0x32921b);return _0x38410b[_0xff58('0x28')](new Buffer(_0x9720ed['recording']));}})['catch'](handleError(_0x38410b,null));};
\ No newline at end of file
index 8bf4fb5..2c11652 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x292a=['util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./voiceMailMessage.attributes','define','VoiceMailMessage','dir','lodash'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x292a,0x16b));var _0xa292=function(_0x22093a,_0xa7acf1){_0x22093a=_0x22093a-0x0;var _0x2f4989=_0x292a[_0x22093a];return _0x2f4989;};'use strict';var _=require(_0xa292('0x0'));var util=require(_0xa292('0x1'));var logger=require(_0xa292('0x2'))(_0xa292('0x3'));var moment=require(_0xa292('0x4'));var BPromise=require(_0xa292('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa292('0x6'));var rimraf=require(_0xa292('0x7'));var config=require(_0xa292('0x8'));var attributes=require(_0xa292('0x9'));module['exports']=function(_0x2f3b2e,_0x42dd24){return _0x2f3b2e[_0xa292('0xa')](_0xa292('0xb'),attributes,{'tableName':'voice_voicemail_messages','paranoid':![],'indexes':[{'name':_0xa292('0xc'),'fields':[_0xa292('0xc')]}],'timestamps':![]});};
\ No newline at end of file
+var _0xbe14=['define','VoiceMailMessage','dir','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMailMessage.attributes','exports'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xbe14,0xb7));var _0x4be1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbe14[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x4be1('0x0'));var util=require(_0x4be1('0x1'));var logger=require(_0x4be1('0x2'))(_0x4be1('0x3'));var moment=require(_0x4be1('0x4'));var BPromise=require(_0x4be1('0x5'));var rp=require(_0x4be1('0x6'));var fs=require('fs');var path=require(_0x4be1('0x7'));var rimraf=require(_0x4be1('0x8'));var config=require(_0x4be1('0x9'));var attributes=require(_0x4be1('0xa'));module[_0x4be1('0xb')]=function(_0x11c35f,_0x530ab3){return _0x11c35f[_0x4be1('0xc')](_0x4be1('0xd'),attributes,{'tableName':'voice_voicemail_messages','paranoid':![],'indexes':[{'name':_0x4be1('0xe'),'fields':[_0x4be1('0xe')]}],'timestamps':![]});};
\ No newline at end of file
index 6d8f203..bea5bd4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0e6e=['VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info'];(function(_0x114b04,_0x2458f9){var _0x42a95f=function(_0x4eeb7c){while(--_0x4eeb7c){_0x114b04['push'](_0x114b04['shift']());}};_0x42a95f(++_0x2458f9);}(_0x0e6e,0x119));var _0xe0e6=function(_0x3e9bc6,_0x44bcda){_0x3e9bc6=_0x3e9bc6-0x0;var _0x5ef196=_0x0e6e[_0x3e9bc6];return _0x5ef196;};'use strict';var _=require('lodash');var util=require(_0xe0e6('0x0'));var moment=require(_0xe0e6('0x1'));var BPromise=require(_0xe0e6('0x2'));var rs=require(_0xe0e6('0x3'));var fs=require('fs');var Redis=require(_0xe0e6('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xe0e6('0x5'));var logger=require(_0xe0e6('0x6'))(_0xe0e6('0x7'));var config=require(_0xe0e6('0x8'));var jayson=require(_0xe0e6('0x9'));var client=jayson[_0xe0e6('0xa')][_0xe0e6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x182796,_0x537a16,_0x35892e){return new BPromise(function(_0xae77f4,_0xa77bc1){return client['request'](_0x182796,_0x35892e)['then'](function(_0x4d54a5){logger[_0xe0e6('0xc')](_0xe0e6('0xd'),_0x537a16,_0xe0e6('0xe'));logger[_0xe0e6('0xf')]('VoiceMailMessage,\x20%s,\x20%s,\x20%s',_0x537a16,'request\x20sent',JSON[_0xe0e6('0x10')](_0x4d54a5));if(_0x4d54a5[_0xe0e6('0x11')]){if(_0x4d54a5['error'][_0xe0e6('0x12')]===0x1f4){logger[_0xe0e6('0x11')](_0xe0e6('0xd'),_0x537a16,_0x4d54a5['error'][_0xe0e6('0x13')]);return _0xa77bc1(_0x4d54a5[_0xe0e6('0x11')][_0xe0e6('0x13')]);}logger['error'](_0xe0e6('0xd'),_0x537a16,_0x4d54a5[_0xe0e6('0x11')][_0xe0e6('0x13')]);return _0xae77f4(_0x4d54a5[_0xe0e6('0x11')][_0xe0e6('0x13')]);}else{logger[_0xe0e6('0xc')](_0xe0e6('0xd'),_0x537a16,'request\x20sent');_0xae77f4(_0x4d54a5['result'][_0xe0e6('0x13')]);}})[_0xe0e6('0x14')](function(_0x391453){logger['error'](_0xe0e6('0xd'),_0x537a16,_0x391453);_0xa77bc1(_0x391453);});});}
\ No newline at end of file
+var _0x70b1=['then','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','util','moment','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','http','request'];(function(_0x158f01,_0x12af3e){var _0x5ef74e=function(_0x5e7adc){while(--_0x5e7adc){_0x158f01['push'](_0x158f01['shift']());}};_0x5ef74e(++_0x12af3e);}(_0x70b1,0x19a));var _0x170b=function(_0x1734cf,_0x198405){_0x1734cf=_0x1734cf-0x0;var _0x524290=_0x70b1[_0x1734cf];return _0x524290;};'use strict';var _=require('lodash');var util=require(_0x170b('0x0'));var moment=require(_0x170b('0x1'));var BPromise=require('bluebird');var rs=require(_0x170b('0x2'));var fs=require('fs');var Redis=require(_0x170b('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x170b('0x4'))(_0x170b('0x5'));var config=require(_0x170b('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x170b('0x7')][_0x170b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xd3a752,_0x308e29,_0x4b3457){return new BPromise(function(_0x46df7a,_0x1e6568){return client[_0x170b('0x9')](_0xd3a752,_0x4b3457)[_0x170b('0xa')](function(_0x1781d6){logger['info'](_0x170b('0xb'),_0x308e29,_0x170b('0xc'));logger[_0x170b('0xd')](_0x170b('0xe'),_0x308e29,_0x170b('0xc'),JSON[_0x170b('0xf')](_0x1781d6));if(_0x1781d6[_0x170b('0x10')]){if(_0x1781d6['error'][_0x170b('0x11')]===0x1f4){logger[_0x170b('0x10')]('VoiceMailMessage,\x20%s,\x20%s',_0x308e29,_0x1781d6['error'][_0x170b('0x12')]);return _0x1e6568(_0x1781d6[_0x170b('0x10')][_0x170b('0x12')]);}logger[_0x170b('0x10')](_0x170b('0xb'),_0x308e29,_0x1781d6[_0x170b('0x10')][_0x170b('0x12')]);return _0x46df7a(_0x1781d6[_0x170b('0x10')][_0x170b('0x12')]);}else{logger[_0x170b('0x13')](_0x170b('0xb'),_0x308e29,_0x170b('0xc'));_0x46df7a(_0x1781d6[_0x170b('0x14')][_0x170b('0x12')]);}})['catch'](function(_0x489093){logger[_0x170b('0x10')](_0x170b('0xb'),_0x308e29,_0x489093);_0x1e6568(_0x489093);});});}
\ No newline at end of file
index 13618d0..2fa2200 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe550=['get','isAuthenticated','show','/:id/sounds','getSounds','post','create','delete','/:id','destroy','removeSound','exports','util','path','express','Router','fs-extra','../../config/environment'];(function(_0x145d1c,_0x4e8027){var _0x45c520=function(_0x51ebc5){while(--_0x51ebc5){_0x145d1c['push'](_0x145d1c['shift']());}};_0x45c520(++_0x4e8027);}(_0xe550,0x1f2));var _0x0e55=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe550[_0x14add3];return _0x4a174f;};'use strict';var multer=require('multer');var util=require(_0x0e55('0x0'));var path=require(_0x0e55('0x1'));var timeout=require('connect-timeout');var express=require(_0x0e55('0x2'));var router=express[_0x0e55('0x3')]();var fs_extra=require(_0x0e55('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x0e55('0x5'));var controller=require('./voiceMusicOnHold.controller');router[_0x0e55('0x6')]('/',auth[_0x0e55('0x7')](),controller['index']);router['get']('/:id',auth[_0x0e55('0x7')](),controller[_0x0e55('0x8')]);router[_0x0e55('0x6')](_0x0e55('0x9'),auth['isAuthenticated'](),controller[_0x0e55('0xa')]);router[_0x0e55('0xb')]('/',auth[_0x0e55('0x7')](),controller[_0x0e55('0xc')]);router[_0x0e55('0xb')](_0x0e55('0x9'),auth['isAuthenticated'](),controller['addSound']);router['put']('/:id',auth[_0x0e55('0x7')](),controller['update']);router[_0x0e55('0xd')](_0x0e55('0xe'),auth[_0x0e55('0x7')](),controller[_0x0e55('0xf')]);router[_0x0e55('0xd')]('/:id/sounds/:id2',auth[_0x0e55('0x7')](),controller[_0x0e55('0x10')]);module[_0x0e55('0x11')]=router;
\ No newline at end of file
+var _0x6891=['index','/:id','show','/:id/sounds','getSounds','post','create','put','update','destroy','/:id/sounds/:id2','removeSound','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','get','isAuthenticated'];(function(_0x1c7d23,_0x3e5209){var _0x5b0127=function(_0x4ae14a){while(--_0x4ae14a){_0x1c7d23['push'](_0x1c7d23['shift']());}};_0x5b0127(++_0x3e5209);}(_0x6891,0x115));var _0x1689=function(_0x1521be,_0x34aa83){_0x1521be=_0x1521be-0x0;var _0x156a8e=_0x6891[_0x1521be];return _0x156a8e;};'use strict';var multer=require(_0x1689('0x0'));var util=require(_0x1689('0x1'));var path=require(_0x1689('0x2'));var timeout=require(_0x1689('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x1689('0x4'));var auth=require(_0x1689('0x5'));var interaction=require(_0x1689('0x6'));var config=require(_0x1689('0x7'));var controller=require(_0x1689('0x8'));router[_0x1689('0x9')]('/',auth[_0x1689('0xa')](),controller[_0x1689('0xb')]);router[_0x1689('0x9')](_0x1689('0xc'),auth['isAuthenticated'](),controller[_0x1689('0xd')]);router[_0x1689('0x9')](_0x1689('0xe'),auth[_0x1689('0xa')](),controller[_0x1689('0xf')]);router[_0x1689('0x10')]('/',auth[_0x1689('0xa')](),controller[_0x1689('0x11')]);router['post'](_0x1689('0xe'),auth[_0x1689('0xa')](),controller['addSound']);router[_0x1689('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x1689('0x13')]);router['delete'](_0x1689('0xc'),auth[_0x1689('0xa')](),controller[_0x1689('0x14')]);router['delete'](_0x1689('0x15'),auth[_0x1689('0xa')](),controller[_0x1689('0x16')]);module[_0x1689('0x17')]=router;
\ No newline at end of file
index f7e88de..f213974 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8f5e=['mp3','alpha','TIMESTAMP','BOOLEAN','STRING','name','ENUM','custom','files','quietmp3'];(function(_0x4875f6,_0x596fd9){var _0x1d3a57=function(_0xf04ef4){while(--_0xf04ef4){_0x4875f6['push'](_0x4875f6['shift']());}};_0x1d3a57(++_0x596fd9);}(_0x8f5e,0x9a));var _0xe8f5=function(_0x4f18a2,_0x4df3a1){_0x4f18a2=_0x4f18a2-0x0;var _0x2f1a9a=_0x8f5e[_0x4f18a2];return _0x2f1a9a;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xe8f5('0x0')],'allowNull':![],'unique':_0xe8f5('0x1')},'mode':{'type':Sequelize[_0xe8f5('0x2')](_0xe8f5('0x3'),_0xe8f5('0x4'),'mp3nb','quietmp3nb',_0xe8f5('0x5'),_0xe8f5('0x6')),'allowNull':!![],'defaultValue':'files'},'directory':{'type':Sequelize[_0xe8f5('0x0')],'allowNull':!![]},'application':{'type':Sequelize[_0xe8f5('0x0')],'allowNull':!![]},'digit':{'type':Sequelize[_0xe8f5('0x0')],'allowNull':!![]},'sort':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0xe8f5('0x7')},'format':{'type':Sequelize[_0xe8f5('0x0')],'allowNull':!![]},'stamp':{'type':_0xe8f5('0x8')},'defaultEntry':{'type':Sequelize[_0xe8f5('0x9')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x1d6f=['exports','name','ENUM','custom','files','mp3nb','quietmp3nb','STRING','alpha','sequelize'];(function(_0x164ae0,_0x3c7ad4){var _0x45860e=function(_0x1d415b){while(--_0x1d415b){_0x164ae0['push'](_0x164ae0['shift']());}};_0x45860e(++_0x3c7ad4);}(_0x1d6f,0xef));var _0xf1d6=function(_0x142c1a,_0x7195f2){_0x142c1a=_0x142c1a-0x0;var _0x6fe077=_0x1d6f[_0x142c1a];return _0x6fe077;};'use strict';var Sequelize=require(_0xf1d6('0x0'));module[_0xf1d6('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xf1d6('0x2')},'mode':{'type':Sequelize[_0xf1d6('0x3')](_0xf1d6('0x4'),_0xf1d6('0x5'),_0xf1d6('0x6'),_0xf1d6('0x7'),'quietmp3','mp3'),'allowNull':!![],'defaultValue':_0xf1d6('0x5')},'directory':{'type':Sequelize[_0xf1d6('0x8')],'allowNull':!![]},'application':{'type':Sequelize[_0xf1d6('0x8')],'allowNull':!![]},'digit':{'type':Sequelize[_0xf1d6('0x8')],'allowNull':!![]},'sort':{'type':Sequelize[_0xf1d6('0x8')],'allowNull':!![],'defaultValue':_0xf1d6('0x9')},'format':{'type':Sequelize['STRING'],'allowNull':!![]},'stamp':{'type':'TIMESTAMP'},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}};
\ No newline at end of file
index ba8fb03..3884b6a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x49ee=['forEach','unlinkSync','rmdirSync','ValidationError','addSound','save_name','converted_format','root','server/files/sounds/converted','format','%s.%s','basename','extname','symlinkSync','Sequelize','removeSound','findOne','id2','createdAt','getSounds','Sound','options','hasOwnProperty','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','sendStatus','status','end','json','undefined','limit','offset','count','set','reject','update','then','get','MusicOnHolds','error','stack','name','send','index','map','VoiceMusicOnHold','rawAttributes','type','model','keys','filters','intersection','attributes','fields','query','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','catch','show','params','find','body','create','sequelize','transaction','mode','files','directory','join','server/files/moh','mkdirSync','0777','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','UserProfileResource','destroy','readdirSync'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x49ee,0x161));var _0xe49e=function(_0x3c8afd,_0x2dcf92){_0x3c8afd=_0x3c8afd-0x0;var _0x5556c5=_0x49ee[_0x3c8afd];return _0x5556c5;};'use strict';var emlformat=require(_0xe49e('0x0'));var rimraf=require(_0xe49e('0x1'));var zipdir=require(_0xe49e('0x2'));var jsonpatch=require(_0xe49e('0x3'));var rp=require('request-promise');var moment=require(_0xe49e('0x4'));var BPromise=require(_0xe49e('0x5'));var Mustache=require(_0xe49e('0x6'));var util=require(_0xe49e('0x7'));var path=require(_0xe49e('0x8'));var sox=require(_0xe49e('0x9'));var csv=require(_0xe49e('0xa'));var ejs=require(_0xe49e('0xb'));var fs=require('fs');var fs_extra=require(_0xe49e('0xc'));var _=require(_0xe49e('0xd'));var squel=require(_0xe49e('0xe'));var crypto=require('crypto');var jsforce=require(_0xe49e('0xf'));var deskjs=require(_0xe49e('0x10'));var toCsv=require('to-csv');var querystring=require(_0xe49e('0x11'));var Papa=require('papaparse');var Redis=require(_0xe49e('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xe49e('0x13'));var as=require(_0xe49e('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe49e('0x15'))(_0xe49e('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x459d2e,_0x1e1d8e){_0x1e1d8e=_0x1e1d8e||0xcc;return function(_0x38516d){if(_0x38516d){return _0x459d2e[_0xe49e('0x17')](_0x1e1d8e);}return _0x459d2e[_0xe49e('0x18')](_0x1e1d8e)[_0xe49e('0x19')]();};}function respondWithResult(_0x37b82b,_0x27ee3d){_0x27ee3d=_0x27ee3d||0xc8;return function(_0xb2761b){if(_0xb2761b){return _0x37b82b[_0xe49e('0x18')](_0x27ee3d)[_0xe49e('0x1a')](_0xb2761b);}};}function respondWithFilteredResult(_0x361aed,_0x58fb86){return function(_0x541795){if(_0x541795){var _0x3cccd1=typeof _0x58fb86['offset']===_0xe49e('0x1b')&&typeof _0x58fb86[_0xe49e('0x1c')]===_0xe49e('0x1b');var _0x5e50ce=_0x541795['count'];var _0x59030c=_0x3cccd1?0x0:_0x58fb86[_0xe49e('0x1d')];var _0xaa2e8=_0x3cccd1?_0x541795[_0xe49e('0x1e')]:_0x58fb86[_0xe49e('0x1d')]+_0x58fb86[_0xe49e('0x1c')];var _0x436fc6;if(_0xaa2e8>=_0x5e50ce){_0xaa2e8=_0x5e50ce;_0x436fc6=0xc8;}else{_0x436fc6=0xce;}_0x361aed[_0xe49e('0x18')](_0x436fc6);return _0x361aed[_0xe49e('0x1f')]('Content-Range',_0x59030c+'-'+_0xaa2e8+'/'+_0x5e50ce)[_0xe49e('0x1a')](_0x541795);}return null;};}function patchUpdates(_0x2e0d29){return function(_0x204d21){try{jsonpatch['apply'](_0x204d21,_0x2e0d29,!![]);}catch(_0x1b17e2){return BPromise[_0xe49e('0x20')](_0x1b17e2);}return _0x204d21['save']();};}function saveUpdates(_0x14df09,_0xccf8b){return function(_0xbee7f7){if(_0xbee7f7){return _0xbee7f7[_0xe49e('0x21')](_0x14df09)[_0xe49e('0x22')](function(_0x3a0f3e){return _0x3a0f3e;});}return null;};}function removeEntity(_0x8abf5c,_0xf731ee){return function(_0x2980f3){if(_0x2980f3){return _0x2980f3['destroy']()[_0xe49e('0x22')](function(){var _0x1f2c83=_0x2980f3[_0xe49e('0x23')]({'plain':!![]});var _0xc6d797=_0xe49e('0x24');return db['UserProfileResource']['destroy']({'where':{'type':_0xc6d797,'resourceId':_0x1f2c83['id']}})['then'](function(){return _0x2980f3;});})['then'](function(){_0x8abf5c[_0xe49e('0x18')](0xcc)[_0xe49e('0x19')]();});}};}function handleEntityNotFound(_0x25a837,_0x126d95){return function(_0xfcf87c){if(!_0xfcf87c){_0x25a837[_0xe49e('0x17')](0x194);}return _0xfcf87c;};}function handleError(_0x2070a3,_0x1dc282){_0x1dc282=_0x1dc282||0x1f4;return function(_0x4d3d78){logger[_0xe49e('0x25')](_0x4d3d78[_0xe49e('0x26')]);if(_0x4d3d78[_0xe49e('0x27')]){delete _0x4d3d78[_0xe49e('0x27')];}_0x2070a3[_0xe49e('0x18')](_0x1dc282)[_0xe49e('0x28')](_0x4d3d78);};}exports[_0xe49e('0x29')]=function(_0x5ca4cc,_0x1478fd){var _0x3f040a={},_0x31c591={},_0x2cd14a={'count':0x0,'rows':[]};var _0x3da8f9=_[_0xe49e('0x2a')](db[_0xe49e('0x2b')][_0xe49e('0x2c')],function(_0x5c0e69){return{'name':_0x5c0e69['fieldName'],'type':_0x5c0e69[_0xe49e('0x2d')]['key']};});_0x31c591[_0xe49e('0x2e')]=_[_0xe49e('0x2a')](_0x3da8f9,_0xe49e('0x27'));_0x31c591['query']=_[_0xe49e('0x2f')](_0x5ca4cc['query']);_0x31c591[_0xe49e('0x30')]=_[_0xe49e('0x31')](_0x31c591[_0xe49e('0x2e')],_0x31c591['query']);_0x3f040a[_0xe49e('0x32')]=_[_0xe49e('0x31')](_0x31c591[_0xe49e('0x2e')],qs[_0xe49e('0x33')](_0x5ca4cc[_0xe49e('0x34')][_0xe49e('0x33')]));_0x3f040a[_0xe49e('0x32')]=_0x3f040a[_0xe49e('0x32')][_0xe49e('0x35')]?_0x3f040a[_0xe49e('0x32')]:_0x31c591['model'];if(!_0x5ca4cc['query']['hasOwnProperty'](_0xe49e('0x36'))){_0x3f040a[_0xe49e('0x1c')]=qs['limit'](_0x5ca4cc['query']['limit']);_0x3f040a[_0xe49e('0x1d')]=qs[_0xe49e('0x1d')](_0x5ca4cc[_0xe49e('0x34')][_0xe49e('0x1d')]);}_0x3f040a[_0xe49e('0x37')]=qs[_0xe49e('0x38')](_0x5ca4cc[_0xe49e('0x34')][_0xe49e('0x38')]);delete _0x5ca4cc[_0xe49e('0x34')][_0xe49e('0x38')];_0x3f040a[_0xe49e('0x39')]=qs[_0xe49e('0x30')](_[_0xe49e('0x3a')](_0x5ca4cc[_0xe49e('0x34')],_0x31c591[_0xe49e('0x30')]),_0x3da8f9);if(_0x5ca4cc[_0xe49e('0x34')][_0xe49e('0x3b')]){_0x3f040a[_0xe49e('0x39')]=_['merge'](_0x3f040a['where'],{'$or':_[_0xe49e('0x2a')](_0x3da8f9,function(_0xd66a56){if(_0xd66a56['type']!==_0xe49e('0x3c')){var _0x2425c2={};_0x2425c2[_0xd66a56[_0xe49e('0x27')]]={'$like':'%'+_0x5ca4cc['query'][_0xe49e('0x3b')]+'%'};return _0x2425c2;}})});}_0x3f040a=_[_0xe49e('0x3d')]({},_0x3f040a,_0x5ca4cc['options']);var _0x5b8107={'where':_0x3f040a[_0xe49e('0x39')]};return db[_0xe49e('0x2b')][_0xe49e('0x1e')](_0x5b8107)[_0xe49e('0x22')](function(_0x565f9d){_0x2cd14a[_0xe49e('0x1e')]=_0x565f9d;if(_0x5ca4cc[_0xe49e('0x34')][_0xe49e('0x3e')]){_0x3f040a[_0xe49e('0x3f')]=[{'all':!![]}];}return db[_0xe49e('0x2b')]['findAll'](_0x3f040a);})['then'](function(_0x5efae9){_0x2cd14a['rows']=_0x5efae9;return _0x2cd14a;})[_0xe49e('0x22')](respondWithFilteredResult(_0x1478fd,_0x3f040a))[_0xe49e('0x40')](handleError(_0x1478fd,null));};exports[_0xe49e('0x41')]=function(_0x57ca3d,_0x5cb464){var _0x4b1157={'raw':![],'where':{'id':_0x57ca3d[_0xe49e('0x42')]['id']}},_0x6701e2={};_0x6701e2[_0xe49e('0x2e')]=_['keys'](db[_0xe49e('0x2b')]['rawAttributes']);_0x6701e2['query']=_[_0xe49e('0x2f')](_0x57ca3d[_0xe49e('0x34')]);_0x6701e2[_0xe49e('0x30')]=_[_0xe49e('0x31')](_0x6701e2[_0xe49e('0x2e')],_0x6701e2[_0xe49e('0x34')]);_0x4b1157['attributes']=_[_0xe49e('0x31')](_0x6701e2[_0xe49e('0x2e')],qs[_0xe49e('0x33')](_0x57ca3d['query'][_0xe49e('0x33')]));_0x4b1157[_0xe49e('0x32')]=_0x4b1157[_0xe49e('0x32')]['length']?_0x4b1157['attributes']:_0x6701e2[_0xe49e('0x2e')];if(_0x57ca3d[_0xe49e('0x34')][_0xe49e('0x3e')]){_0x4b1157[_0xe49e('0x3f')]=[{'all':!![]}];}_0x4b1157=_[_0xe49e('0x3d')]({},_0x4b1157,_0x57ca3d['options']);return db['VoiceMusicOnHold'][_0xe49e('0x43')](_0x4b1157)[_0xe49e('0x22')](handleEntityNotFound(_0x5cb464,null))[_0xe49e('0x22')](respondWithResult(_0x5cb464,null))['catch'](handleError(_0x5cb464,null));};exports['update']=function(_0x58fdb3,_0x19deea){if(_0x58fdb3[_0xe49e('0x44')]['id']){delete _0x58fdb3[_0xe49e('0x44')]['id'];}return db['VoiceMusicOnHold'][_0xe49e('0x43')]({'where':{'id':_0x58fdb3['params']['id']}})[_0xe49e('0x22')](handleEntityNotFound(_0x19deea,null))[_0xe49e('0x22')](saveUpdates(_0x58fdb3['body'],null))[_0xe49e('0x22')](respondWithResult(_0x19deea,null))[_0xe49e('0x40')](handleError(_0x19deea,null));};exports[_0xe49e('0x45')]=function(_0x283c88,_0x47796d,_0x2aa80b){return db[_0xe49e('0x46')][_0xe49e('0x47')](function(_0x90bdc9){if(_0x283c88[_0xe49e('0x44')][_0xe49e('0x48')]===_0xe49e('0x49')){_0x283c88[_0xe49e('0x44')][_0xe49e('0x4a')]=path[_0xe49e('0x4b')](config['root'],_0xe49e('0x4c'),_0x283c88[_0xe49e('0x44')][_0xe49e('0x27')]);}return db['VoiceMusicOnHold']['create'](_0x283c88[_0xe49e('0x44')],{'transaction':_0x90bdc9})[_0xe49e('0x22')](function(_0xf2a125){if(_0x283c88[_0xe49e('0x44')][_0xe49e('0x48')]===_0xe49e('0x49')){fs[_0xe49e('0x4d')](_0xf2a125['directory'],parseInt(_0xe49e('0x4e'),0x8));}var _0x598e3e=_0x283c88[_0xe49e('0x4f')]['get']({'plain':!![]});if(!_0x598e3e)throw new Error(_0xe49e('0x50'));if(_0x598e3e[_0xe49e('0x51')]===_0xe49e('0x4f')){var _0x31d9d6=_0xf2a125[_0xe49e('0x23')]({'plain':!![]});return db[_0xe49e('0x52')]['find']({'where':{'name':_0xe49e('0x24'),'userProfileId':_0x598e3e[_0xe49e('0x53')]},'raw':!![]})[_0xe49e('0x22')](function(_0x5efe6a){if(_0x5efe6a&&_0x5efe6a['autoAssociation']===0x0){return db[_0xe49e('0x54')][_0xe49e('0x45')]({'name':_0x31d9d6[_0xe49e('0x27')],'resourceId':_0x31d9d6['id'],'type':_0x5efe6a[_0xe49e('0x27')],'sectionId':_0x5efe6a['id']},{})[_0xe49e('0x22')](function(){return _0xf2a125;});}else{return _0xf2a125;}})[_0xe49e('0x40')](function(_0x54e86f){logger[_0xe49e('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x54e86f);});}return _0xf2a125;});})[_0xe49e('0x22')](respondWithResult(_0x47796d,0xc9))[_0xe49e('0x40')](handleError(_0x47796d,null));};exports['destroy']=function(_0x145682,_0x3625eb,_0x2d7098){var _0x55131e;return db['VoiceMusicOnHold']['find']({'where':{'id':_0x145682['params']['id']}})[_0xe49e('0x22')](function(_0x3a0986){if(_0x3a0986){return db[_0xe49e('0x46')]['transaction'](function(_0x4777f5){return _0x3a0986[_0xe49e('0x55')]({'transaction':_0x4777f5,'raw':!![]})[_0xe49e('0x22')](function(_0x367fda){if(_0x367fda[_0xe49e('0x4a')]){fs[_0xe49e('0x56')](_0x367fda[_0xe49e('0x4a')])[_0xe49e('0x57')](function(_0x4d668f){fs[_0xe49e('0x58')](path[_0xe49e('0x4b')](_0x367fda[_0xe49e('0x4a')],_0x4d668f));});fs[_0xe49e('0x59')](_0x367fda[_0xe49e('0x4a')]);}return _0x367fda;});})[_0xe49e('0x40')](function(_0xd0956f){throw new db['Sequelize'][(_0xe49e('0x5a'))](_0xd0956f['message']);});}})['then'](handleEntityNotFound(_0x3625eb,null))['then'](removeEntity(_0x3625eb,null))['catch'](handleError(_0x3625eb,null));};exports[_0xe49e('0x5b')]=function(_0x30892d,_0x59e1cd,_0x65d4ef){return db[_0xe49e('0x46')]['transaction'](function(_0x53c6c8){var _0x4ed020;return db[_0xe49e('0x2b')]['find']({'where':{'id':_0x30892d[_0xe49e('0x42')]['id']}})['then'](function(_0x30d206){if(_0x30d206){_0x4ed020=_0x30d206;return _0x30d206[_0xe49e('0x5b')](_0x30892d['body']['id'],{'transaction':_0x53c6c8});}})[_0xe49e('0x22')](function(_0x5dfa90){if(_0x5dfa90){return db['Sound']['findOne']({'where':{'id':_0x30892d['body']['id']},'attributes':['id',_0xe49e('0x27'),_0xe49e('0x5c'),_0xe49e('0x5d'),'createdAt'],'raw':!![]});}})['then'](function(_0x168b94){if(_0x168b94){var _0x23e7fd=path[_0xe49e('0x4b')](config[_0xe49e('0x5e')],_0xe49e('0x5f'),util[_0xe49e('0x60')](_0xe49e('0x61'),path[_0xe49e('0x62')](_0x168b94[_0xe49e('0x5c')],path[_0xe49e('0x63')](_0x168b94[_0xe49e('0x5c')])),_0x168b94[_0xe49e('0x5d')]));var _0x48c3ea=path[_0xe49e('0x4b')](config[_0xe49e('0x5e')],'server/files/moh',_0x4ed020['name'],util[_0xe49e('0x60')](_0xe49e('0x61'),_0x168b94['name'],_0x168b94[_0xe49e('0x5d')]));fs[_0xe49e('0x64')](_0x23e7fd,_0x48c3ea);return _0x168b94;}})[_0xe49e('0x40')](function(_0x1220b4){throw new db[(_0xe49e('0x65'))][(_0xe49e('0x5a'))](_0x1220b4['message']);});})[_0xe49e('0x22')](handleEntityNotFound(_0x59e1cd,null))[_0xe49e('0x22')](respondWithResult(_0x59e1cd,0xc9))[_0xe49e('0x40')](handleError(_0x59e1cd,null));};exports[_0xe49e('0x66')]=function(_0x6dcfb0,_0x3d3860,_0x4f15e9){return db['sequelize'][_0xe49e('0x47')](function(_0xd0f15a){var _0x5e0a05;return db[_0xe49e('0x2b')][_0xe49e('0x67')]({'where':{'id':_0x6dcfb0[_0xe49e('0x42')]['id']}})['then'](handleEntityNotFound(_0x3d3860,null))[_0xe49e('0x22')](function(_0x5eaaef){if(_0x5eaaef){_0x5e0a05=_0x5eaaef;return _0x5eaaef[_0xe49e('0x66')](_0x6dcfb0['params'][_0xe49e('0x68')]);}})['then'](function(_0x5274cd){if(_0x5274cd){return db['Sound'][_0xe49e('0x67')]({'where':{'id':_0x6dcfb0['params'][_0xe49e('0x68')]},'attributes':['id',_0xe49e('0x27'),_0xe49e('0x5c'),_0xe49e('0x5d'),_0xe49e('0x69')],'raw':!![]});}})[_0xe49e('0x22')](function(_0x1f748d){if(_0x1f748d){fs[_0xe49e('0x58')](path[_0xe49e('0x4b')](_0x5e0a05[_0xe49e('0x4a')],util[_0xe49e('0x60')](_0xe49e('0x61'),_0x1f748d[_0xe49e('0x27')],_0x1f748d[_0xe49e('0x5d')])));return _0x1f748d;}})[_0xe49e('0x40')](function(_0x25c6d6){throw new db[(_0xe49e('0x65'))][(_0xe49e('0x5a'))](_0x25c6d6['message']);});})['then'](handleEntityNotFound(_0x3d3860,null))['then'](respondWithStatusCode(_0x3d3860,0xcc))[_0xe49e('0x40')](handleError(_0x3d3860,null));};exports[_0xe49e('0x6a')]=function(_0xbaa6b0,_0x2a2926,_0x2584c4){var _0x3b072e={};var _0xf960ec={};var _0x63651c;var _0x58f881;return db[_0xe49e('0x2b')][_0xe49e('0x67')]({'where':{'id':_0xbaa6b0[_0xe49e('0x42')]['id']}})[_0xe49e('0x22')](handleEntityNotFound(_0x2a2926,null))[_0xe49e('0x22')](function(_0x1fd91b){if(_0x1fd91b){_0x63651c=_0x1fd91b;_0xf960ec['model']=_['keys'](db[_0xe49e('0x6b')][_0xe49e('0x2c')]);_0xf960ec['query']=_['keys'](_0xbaa6b0[_0xe49e('0x34')]);_0xf960ec[_0xe49e('0x30')]=_[_0xe49e('0x31')](_0xf960ec[_0xe49e('0x2e')],_0xf960ec[_0xe49e('0x34')]);_0x3b072e[_0xe49e('0x32')]=_[_0xe49e('0x31')](_0xf960ec[_0xe49e('0x2e')],qs[_0xe49e('0x33')](_0xbaa6b0['query']['fields']));_0x3b072e[_0xe49e('0x32')]=_0x3b072e['attributes'][_0xe49e('0x35')]?_0x3b072e['attributes']:_0xf960ec['model'];_0x3b072e[_0xe49e('0x37')]=qs[_0xe49e('0x38')](_0xbaa6b0[_0xe49e('0x34')][_0xe49e('0x38')]);_0x3b072e['where']=qs['filters'](_[_0xe49e('0x3a')](_0xbaa6b0['query'],_0xf960ec[_0xe49e('0x30')]));if(_0xbaa6b0[_0xe49e('0x34')]['filter']){_0x3b072e[_0xe49e('0x39')]=_[_0xe49e('0x3d')](_0x3b072e[_0xe49e('0x39')],{'$or':_['map'](_0x3b072e[_0xe49e('0x32')],function(_0x54c358){var _0x477d80={};_0x477d80[_0x54c358]={'$like':'%'+_0xbaa6b0[_0xe49e('0x34')]['filter']+'%'};return _0x477d80;})});}_0x3b072e=_[_0xe49e('0x3d')]({},_0x3b072e,_0xbaa6b0[_0xe49e('0x6c')]);return _0x63651c[_0xe49e('0x6a')](_0x3b072e);}})[_0xe49e('0x22')](function(_0x1606e5){if(_0x1606e5){_0x58f881=_0x1606e5[_0xe49e('0x35')];if(!_0xbaa6b0[_0xe49e('0x34')][_0xe49e('0x6d')]('nolimit')){_0x3b072e[_0xe49e('0x1c')]=qs[_0xe49e('0x1c')](_0xbaa6b0['query']['limit']);_0x3b072e['offset']=qs[_0xe49e('0x1d')](_0xbaa6b0[_0xe49e('0x34')][_0xe49e('0x1d')]);}return _0x63651c[_0xe49e('0x6a')](_0x3b072e);}})[_0xe49e('0x22')](function(_0x2845e6){if(_0x2845e6){return _0x2845e6?{'count':_0x58f881,'rows':_0x2845e6}:null;}})[_0xe49e('0x22')](respondWithResult(_0x2a2926,null))[_0xe49e('0x40')](handleError(_0x2a2926,null));};
\ No newline at end of file
+var _0x7681=['length','find','body','create','sequelize','transaction','files','join','server/files/moh','mode','mkdirSync','directory','0777','user','get','role','UserProfileSection','MusicOnHolds','autoAssociation','forEach','unlinkSync','rmdirSync','Sequelize','ValidationError','message','addSound','Sound','findOne','save_name','root','server/files/sounds/converted','format','basename','extname','converted_format','%s.%s','symlinkSync','removeSound','id2','getSounds','hasOwnProperty','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','squel','crypto','jsforce','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','end','json','undefined','limit','offset','count','set','Content-Range','reject','save','update','then','UserProfileResource','destroy','error','name','send','index','VoiceMusicOnHold','rawAttributes','fieldName','type','map','query','filters','intersection','model','fields','attributes','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','keys'];(function(_0x47f973,_0x5e88f2){var _0x5150ed=function(_0x17a8f0){while(--_0x17a8f0){_0x47f973['push'](_0x47f973['shift']());}};_0x5150ed(++_0x5e88f2);}(_0x7681,0x1e1));var _0x1768=function(_0x42614a,_0x2439c7){_0x42614a=_0x42614a-0x0;var _0x2d5163=_0x7681[_0x42614a];return _0x2d5163;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x1768('0x0'));var rp=require(_0x1768('0x1'));var moment=require(_0x1768('0x2'));var BPromise=require(_0x1768('0x3'));var Mustache=require(_0x1768('0x4'));var util=require('util');var path=require(_0x1768('0x5'));var sox=require(_0x1768('0x6'));var csv=require('to-csv');var ejs=require(_0x1768('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x1768('0x8'));var crypto=require(_0x1768('0x9'));var jsforce=require(_0x1768('0xa'));var deskjs=require(_0x1768('0xb'));var toCsv=require('to-csv');var querystring=require(_0x1768('0xc'));var Papa=require(_0x1768('0xd'));var Redis=require('ioredis');var authService=require(_0x1768('0xe'));var qs=require(_0x1768('0xf'));var as=require(_0x1768('0x10'));var hardwareService=require(_0x1768('0x11'));var logger=require(_0x1768('0x12'))('api');var utils=require(_0x1768('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x1768('0x14'));var db=require(_0x1768('0x15'))['db'];function respondWithStatusCode(_0x3af457,_0x5269f1){_0x5269f1=_0x5269f1||0xcc;return function(_0x32c5ed){if(_0x32c5ed){return _0x3af457[_0x1768('0x16')](_0x5269f1);}return _0x3af457[_0x1768('0x17')](_0x5269f1)[_0x1768('0x18')]();};}function respondWithResult(_0x5d557a,_0x16053b){_0x16053b=_0x16053b||0xc8;return function(_0x18ab99){if(_0x18ab99){return _0x5d557a[_0x1768('0x17')](_0x16053b)[_0x1768('0x19')](_0x18ab99);}};}function respondWithFilteredResult(_0xc1d0b8,_0x122221){return function(_0x5e7650){if(_0x5e7650){var _0x39eaf7=typeof _0x122221['offset']===_0x1768('0x1a')&&typeof _0x122221[_0x1768('0x1b')]===_0x1768('0x1a');var _0x28256a=_0x5e7650['count'];var _0x54b7f8=_0x39eaf7?0x0:_0x122221[_0x1768('0x1c')];var _0x55d8fe=_0x39eaf7?_0x5e7650[_0x1768('0x1d')]:_0x122221[_0x1768('0x1c')]+_0x122221['limit'];var _0x517789;if(_0x55d8fe>=_0x28256a){_0x55d8fe=_0x28256a;_0x517789=0xc8;}else{_0x517789=0xce;}_0xc1d0b8['status'](_0x517789);return _0xc1d0b8[_0x1768('0x1e')](_0x1768('0x1f'),_0x54b7f8+'-'+_0x55d8fe+'/'+_0x28256a)[_0x1768('0x19')](_0x5e7650);}return null;};}function patchUpdates(_0x10698e){return function(_0x5e05df){try{jsonpatch['apply'](_0x5e05df,_0x10698e,!![]);}catch(_0x128677){return BPromise[_0x1768('0x20')](_0x128677);}return _0x5e05df[_0x1768('0x21')]();};}function saveUpdates(_0x42917d,_0x2763fe){return function(_0x2a9466){if(_0x2a9466){return _0x2a9466[_0x1768('0x22')](_0x42917d)['then'](function(_0x4bca0b){return _0x4bca0b;});}return null;};}function removeEntity(_0x57a984,_0x4f6d2e){return function(_0x338616){if(_0x338616){return _0x338616['destroy']()[_0x1768('0x23')](function(){var _0x3d3216=_0x338616['get']({'plain':!![]});var _0x136fac='MusicOnHolds';return db[_0x1768('0x24')][_0x1768('0x25')]({'where':{'type':_0x136fac,'resourceId':_0x3d3216['id']}})[_0x1768('0x23')](function(){return _0x338616;});})['then'](function(){_0x57a984[_0x1768('0x17')](0xcc)[_0x1768('0x18')]();});}};}function handleEntityNotFound(_0x4ca7c3,_0x3f2cc5){return function(_0x2adb50){if(!_0x2adb50){_0x4ca7c3['sendStatus'](0x194);}return _0x2adb50;};}function handleError(_0x466d44,_0x23bcfe){_0x23bcfe=_0x23bcfe||0x1f4;return function(_0x2be600){logger[_0x1768('0x26')](_0x2be600['stack']);if(_0x2be600[_0x1768('0x27')]){delete _0x2be600[_0x1768('0x27')];}_0x466d44[_0x1768('0x17')](_0x23bcfe)[_0x1768('0x28')](_0x2be600);};}exports[_0x1768('0x29')]=function(_0x28c474,_0x268245){var _0x43b3db={},_0x5de779={},_0x3d0628={'count':0x0,'rows':[]};var _0x3e3c23=_['map'](db[_0x1768('0x2a')][_0x1768('0x2b')],function(_0x123cc4){return{'name':_0x123cc4[_0x1768('0x2c')],'type':_0x123cc4[_0x1768('0x2d')]['key']};});_0x5de779['model']=_[_0x1768('0x2e')](_0x3e3c23,_0x1768('0x27'));_0x5de779[_0x1768('0x2f')]=_['keys'](_0x28c474[_0x1768('0x2f')]);_0x5de779[_0x1768('0x30')]=_[_0x1768('0x31')](_0x5de779[_0x1768('0x32')],_0x5de779[_0x1768('0x2f')]);_0x43b3db['attributes']=_['intersection'](_0x5de779['model'],qs[_0x1768('0x33')](_0x28c474[_0x1768('0x2f')]['fields']));_0x43b3db[_0x1768('0x34')]=_0x43b3db[_0x1768('0x34')]['length']?_0x43b3db['attributes']:_0x5de779[_0x1768('0x32')];if(!_0x28c474[_0x1768('0x2f')]['hasOwnProperty'](_0x1768('0x35'))){_0x43b3db['limit']=qs[_0x1768('0x1b')](_0x28c474['query'][_0x1768('0x1b')]);_0x43b3db[_0x1768('0x1c')]=qs['offset'](_0x28c474[_0x1768('0x2f')][_0x1768('0x1c')]);}_0x43b3db[_0x1768('0x36')]=qs[_0x1768('0x37')](_0x28c474['query'][_0x1768('0x37')]);delete _0x28c474[_0x1768('0x2f')][_0x1768('0x37')];_0x43b3db[_0x1768('0x38')]=qs[_0x1768('0x30')](_[_0x1768('0x39')](_0x28c474['query'],_0x5de779[_0x1768('0x30')]),_0x3e3c23);if(_0x28c474[_0x1768('0x2f')][_0x1768('0x3a')]){_0x43b3db[_0x1768('0x38')]=_[_0x1768('0x3b')](_0x43b3db['where'],{'$or':_[_0x1768('0x2e')](_0x3e3c23,function(_0x25bd94){if(_0x25bd94[_0x1768('0x2d')]!==_0x1768('0x3c')){var _0x580299={};_0x580299[_0x25bd94[_0x1768('0x27')]]={'$like':'%'+_0x28c474[_0x1768('0x2f')][_0x1768('0x3a')]+'%'};return _0x580299;}})});}_0x43b3db=_[_0x1768('0x3b')]({},_0x43b3db,_0x28c474[_0x1768('0x3d')]);var _0x91b0b1={'where':_0x43b3db[_0x1768('0x38')]};return db[_0x1768('0x2a')][_0x1768('0x1d')](_0x91b0b1)[_0x1768('0x23')](function(_0x5b5daf){_0x3d0628[_0x1768('0x1d')]=_0x5b5daf;if(_0x28c474[_0x1768('0x2f')][_0x1768('0x3e')]){_0x43b3db[_0x1768('0x3f')]=[{'all':!![]}];}return db[_0x1768('0x2a')]['findAll'](_0x43b3db);})[_0x1768('0x23')](function(_0x56b188){_0x3d0628[_0x1768('0x40')]=_0x56b188;return _0x3d0628;})[_0x1768('0x23')](respondWithFilteredResult(_0x268245,_0x43b3db))[_0x1768('0x41')](handleError(_0x268245,null));};exports[_0x1768('0x42')]=function(_0x5b406a,_0x308780){var _0x2df843={'raw':![],'where':{'id':_0x5b406a[_0x1768('0x43')]['id']}},_0x26e17c={};_0x26e17c['model']=_['keys'](db[_0x1768('0x2a')]['rawAttributes']);_0x26e17c['query']=_[_0x1768('0x44')](_0x5b406a[_0x1768('0x2f')]);_0x26e17c['filters']=_['intersection'](_0x26e17c[_0x1768('0x32')],_0x26e17c['query']);_0x2df843[_0x1768('0x34')]=_[_0x1768('0x31')](_0x26e17c[_0x1768('0x32')],qs[_0x1768('0x33')](_0x5b406a[_0x1768('0x2f')][_0x1768('0x33')]));_0x2df843[_0x1768('0x34')]=_0x2df843[_0x1768('0x34')][_0x1768('0x45')]?_0x2df843['attributes']:_0x26e17c[_0x1768('0x32')];if(_0x5b406a['query'][_0x1768('0x3e')]){_0x2df843[_0x1768('0x3f')]=[{'all':!![]}];}_0x2df843=_[_0x1768('0x3b')]({},_0x2df843,_0x5b406a['options']);return db[_0x1768('0x2a')][_0x1768('0x46')](_0x2df843)[_0x1768('0x23')](handleEntityNotFound(_0x308780,null))[_0x1768('0x23')](respondWithResult(_0x308780,null))[_0x1768('0x41')](handleError(_0x308780,null));};exports['update']=function(_0xf5121b,_0x261545){if(_0xf5121b['body']['id']){delete _0xf5121b[_0x1768('0x47')]['id'];}return db[_0x1768('0x2a')][_0x1768('0x46')]({'where':{'id':_0xf5121b[_0x1768('0x43')]['id']}})[_0x1768('0x23')](handleEntityNotFound(_0x261545,null))[_0x1768('0x23')](saveUpdates(_0xf5121b[_0x1768('0x47')],null))['then'](respondWithResult(_0x261545,null))['catch'](handleError(_0x261545,null));};exports[_0x1768('0x48')]=function(_0x4ef973,_0x3bda22,_0x1b284e){return db[_0x1768('0x49')][_0x1768('0x4a')](function(_0x5465be){if(_0x4ef973[_0x1768('0x47')]['mode']===_0x1768('0x4b')){_0x4ef973[_0x1768('0x47')]['directory']=path[_0x1768('0x4c')](config['root'],_0x1768('0x4d'),_0x4ef973[_0x1768('0x47')][_0x1768('0x27')]);}return db[_0x1768('0x2a')]['create'](_0x4ef973[_0x1768('0x47')],{'transaction':_0x5465be})[_0x1768('0x23')](function(_0x3c59f5){if(_0x4ef973['body'][_0x1768('0x4e')]==='files'){fs[_0x1768('0x4f')](_0x3c59f5[_0x1768('0x50')],parseInt(_0x1768('0x51'),0x8));}var _0x11121f=_0x4ef973[_0x1768('0x52')][_0x1768('0x53')]({'plain':!![]});if(!_0x11121f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x11121f[_0x1768('0x54')]==='user'){var _0x33a718=_0x3c59f5[_0x1768('0x53')]({'plain':!![]});return db[_0x1768('0x55')][_0x1768('0x46')]({'where':{'name':_0x1768('0x56'),'userProfileId':_0x11121f['userProfileId']},'raw':!![]})[_0x1768('0x23')](function(_0x2ce124){if(_0x2ce124&&_0x2ce124[_0x1768('0x57')]===0x0){return db[_0x1768('0x24')][_0x1768('0x48')]({'name':_0x33a718[_0x1768('0x27')],'resourceId':_0x33a718['id'],'type':_0x2ce124[_0x1768('0x27')],'sectionId':_0x2ce124['id']},{})[_0x1768('0x23')](function(){return _0x3c59f5;});}else{return _0x3c59f5;}})['catch'](function(_0x1bd431){logger[_0x1768('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1bd431);});}return _0x3c59f5;});})['then'](respondWithResult(_0x3bda22,0xc9))['catch'](handleError(_0x3bda22,null));};exports['destroy']=function(_0x2e20e1,_0x2e6497,_0x438c20){var _0x4f99b0;return db['VoiceMusicOnHold'][_0x1768('0x46')]({'where':{'id':_0x2e20e1['params']['id']}})[_0x1768('0x23')](function(_0x2633c0){if(_0x2633c0){return db[_0x1768('0x49')][_0x1768('0x4a')](function(_0x3bdaad){return _0x2633c0['destroy']({'transaction':_0x3bdaad,'raw':!![]})[_0x1768('0x23')](function(_0x19f2af){if(_0x19f2af['directory']){fs['readdirSync'](_0x19f2af['directory'])[_0x1768('0x58')](function(_0x47d2de){fs[_0x1768('0x59')](path[_0x1768('0x4c')](_0x19f2af[_0x1768('0x50')],_0x47d2de));});fs[_0x1768('0x5a')](_0x19f2af[_0x1768('0x50')]);}return _0x19f2af;});})[_0x1768('0x41')](function(_0x4133d0){throw new db[(_0x1768('0x5b'))][(_0x1768('0x5c'))](_0x4133d0[_0x1768('0x5d')]);});}})[_0x1768('0x23')](handleEntityNotFound(_0x2e6497,null))[_0x1768('0x23')](removeEntity(_0x2e6497,null))[_0x1768('0x41')](handleError(_0x2e6497,null));};exports[_0x1768('0x5e')]=function(_0x2157aa,_0xd6bf5,_0x112466){return db[_0x1768('0x49')][_0x1768('0x4a')](function(_0x57e0f9){var _0x92f93d;return db[_0x1768('0x2a')]['find']({'where':{'id':_0x2157aa[_0x1768('0x43')]['id']}})[_0x1768('0x23')](function(_0x54c187){if(_0x54c187){_0x92f93d=_0x54c187;return _0x54c187[_0x1768('0x5e')](_0x2157aa[_0x1768('0x47')]['id'],{'transaction':_0x57e0f9});}})['then'](function(_0x249958){if(_0x249958){return db[_0x1768('0x5f')][_0x1768('0x60')]({'where':{'id':_0x2157aa[_0x1768('0x47')]['id']},'attributes':['id','name',_0x1768('0x61'),'converted_format','createdAt'],'raw':!![]});}})[_0x1768('0x23')](function(_0x26432a){if(_0x26432a){var _0x1a6975=path[_0x1768('0x4c')](config[_0x1768('0x62')],_0x1768('0x63'),util[_0x1768('0x64')]('%s.%s',path[_0x1768('0x65')](_0x26432a[_0x1768('0x61')],path[_0x1768('0x66')](_0x26432a[_0x1768('0x61')])),_0x26432a[_0x1768('0x67')]));var _0x4716ef=path[_0x1768('0x4c')](config[_0x1768('0x62')],_0x1768('0x4d'),_0x92f93d[_0x1768('0x27')],util[_0x1768('0x64')](_0x1768('0x68'),_0x26432a['name'],_0x26432a[_0x1768('0x67')]));fs[_0x1768('0x69')](_0x1a6975,_0x4716ef);return _0x26432a;}})[_0x1768('0x41')](function(_0x1f66ad){throw new db[(_0x1768('0x5b'))]['ValidationError'](_0x1f66ad[_0x1768('0x5d')]);});})[_0x1768('0x23')](handleEntityNotFound(_0xd6bf5,null))[_0x1768('0x23')](respondWithResult(_0xd6bf5,0xc9))[_0x1768('0x41')](handleError(_0xd6bf5,null));};exports[_0x1768('0x6a')]=function(_0x13935d,_0x2d81a2,_0xbc4e1f){return db[_0x1768('0x49')]['transaction'](function(_0x45600d){var _0x4360d5;return db[_0x1768('0x2a')]['findOne']({'where':{'id':_0x13935d[_0x1768('0x43')]['id']}})[_0x1768('0x23')](handleEntityNotFound(_0x2d81a2,null))[_0x1768('0x23')](function(_0xa09718){if(_0xa09718){_0x4360d5=_0xa09718;return _0xa09718['removeSound'](_0x13935d[_0x1768('0x43')][_0x1768('0x6b')]);}})[_0x1768('0x23')](function(_0x16ee82){if(_0x16ee82){return db[_0x1768('0x5f')]['findOne']({'where':{'id':_0x13935d['params']['id2']},'attributes':['id',_0x1768('0x27'),_0x1768('0x61'),_0x1768('0x67'),'createdAt'],'raw':!![]});}})[_0x1768('0x23')](function(_0x147910){if(_0x147910){fs[_0x1768('0x59')](path[_0x1768('0x4c')](_0x4360d5[_0x1768('0x50')],util[_0x1768('0x64')](_0x1768('0x68'),_0x147910[_0x1768('0x27')],_0x147910[_0x1768('0x67')])));return _0x147910;}})[_0x1768('0x41')](function(_0x29b107){throw new db[(_0x1768('0x5b'))][(_0x1768('0x5c'))](_0x29b107[_0x1768('0x5d')]);});})[_0x1768('0x23')](handleEntityNotFound(_0x2d81a2,null))[_0x1768('0x23')](respondWithStatusCode(_0x2d81a2,0xcc))[_0x1768('0x41')](handleError(_0x2d81a2,null));};exports[_0x1768('0x6c')]=function(_0x2c762f,_0x15cd2c,_0x1ff07f){var _0x2b9cd2={};var _0x32227a={};var _0x1f945b;var _0x335f36;return db[_0x1768('0x2a')]['findOne']({'where':{'id':_0x2c762f[_0x1768('0x43')]['id']}})[_0x1768('0x23')](handleEntityNotFound(_0x15cd2c,null))[_0x1768('0x23')](function(_0xdd4c3e){if(_0xdd4c3e){_0x1f945b=_0xdd4c3e;_0x32227a[_0x1768('0x32')]=_[_0x1768('0x44')](db[_0x1768('0x5f')][_0x1768('0x2b')]);_0x32227a['query']=_[_0x1768('0x44')](_0x2c762f[_0x1768('0x2f')]);_0x32227a[_0x1768('0x30')]=_[_0x1768('0x31')](_0x32227a[_0x1768('0x32')],_0x32227a[_0x1768('0x2f')]);_0x2b9cd2[_0x1768('0x34')]=_[_0x1768('0x31')](_0x32227a[_0x1768('0x32')],qs[_0x1768('0x33')](_0x2c762f[_0x1768('0x2f')][_0x1768('0x33')]));_0x2b9cd2['attributes']=_0x2b9cd2[_0x1768('0x34')][_0x1768('0x45')]?_0x2b9cd2[_0x1768('0x34')]:_0x32227a[_0x1768('0x32')];_0x2b9cd2[_0x1768('0x36')]=qs['sort'](_0x2c762f['query']['sort']);_0x2b9cd2[_0x1768('0x38')]=qs[_0x1768('0x30')](_[_0x1768('0x39')](_0x2c762f[_0x1768('0x2f')],_0x32227a[_0x1768('0x30')]));if(_0x2c762f[_0x1768('0x2f')][_0x1768('0x3a')]){_0x2b9cd2['where']=_[_0x1768('0x3b')](_0x2b9cd2[_0x1768('0x38')],{'$or':_[_0x1768('0x2e')](_0x2b9cd2['attributes'],function(_0x17f372){var _0x3b4fc6={};_0x3b4fc6[_0x17f372]={'$like':'%'+_0x2c762f[_0x1768('0x2f')][_0x1768('0x3a')]+'%'};return _0x3b4fc6;})});}_0x2b9cd2=_[_0x1768('0x3b')]({},_0x2b9cd2,_0x2c762f[_0x1768('0x3d')]);return _0x1f945b[_0x1768('0x6c')](_0x2b9cd2);}})[_0x1768('0x23')](function(_0x1cef00){if(_0x1cef00){_0x335f36=_0x1cef00[_0x1768('0x45')];if(!_0x2c762f[_0x1768('0x2f')][_0x1768('0x6d')](_0x1768('0x35'))){_0x2b9cd2[_0x1768('0x1b')]=qs[_0x1768('0x1b')](_0x2c762f[_0x1768('0x2f')][_0x1768('0x1b')]);_0x2b9cd2[_0x1768('0x1c')]=qs[_0x1768('0x1c')](_0x2c762f[_0x1768('0x2f')][_0x1768('0x1c')]);}return _0x1f945b[_0x1768('0x6c')](_0x2b9cd2);}})[_0x1768('0x23')](function(_0x1043c1){if(_0x1043c1){return _0x1043c1?{'count':_0x335f36,'rows':_0x1043c1}:null;}})[_0x1768('0x23')](respondWithResult(_0x15cd2c,null))[_0x1768('0x41')](handleError(_0x15cd2c,null));};
\ No newline at end of file
index d0403ec..9046c91 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5703=['voice_musiconhold','../../config/logger','api','moment','request-promise','path','../../config/environment','./voiceMusicOnHold.attributes','exports','define'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x5703,0x141));var _0x3570=function(_0x414658,_0x32591f){_0x414658=_0x414658-0x0;var _0x3f33b8=_0x5703[_0x414658];return _0x3f33b8;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3570('0x0'))(_0x3570('0x1'));var moment=require(_0x3570('0x2'));var BPromise=require('bluebird');var rp=require(_0x3570('0x3'));var fs=require('fs');var path=require(_0x3570('0x4'));var rimraf=require('rimraf');var config=require(_0x3570('0x5'));var attributes=require(_0x3570('0x6'));module[_0x3570('0x7')]=function(_0x3cdc36,_0x3c7c8c){return _0x3cdc36[_0x3570('0x8')]('VoiceMusicOnHold',attributes,{'tableName':_0x3570('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6898=['VoiceMusicOnHold','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMusicOnHold.attributes','exports'];(function(_0x5b6514,_0x3001df){var _0x532331=function(_0x352b22){while(--_0x352b22){_0x5b6514['push'](_0x5b6514['shift']());}};_0x532331(++_0x3001df);}(_0x6898,0xfe));var _0x8689=function(_0x51c303,_0x3305a4){_0x51c303=_0x51c303-0x0;var _0x4d2167=_0x6898[_0x51c303];return _0x4d2167;};'use strict';var _=require(_0x8689('0x0'));var util=require('util');var logger=require(_0x8689('0x1'))(_0x8689('0x2'));var moment=require('moment');var BPromise=require(_0x8689('0x3'));var rp=require(_0x8689('0x4'));var fs=require('fs');var path=require(_0x8689('0x5'));var rimraf=require(_0x8689('0x6'));var config=require(_0x8689('0x7'));var attributes=require(_0x8689('0x8'));module[_0x8689('0x9')]=function(_0x2de64d,_0x29f4bc){return _0x2de64d['define'](_0x8689('0xa'),attributes,{'tableName':'voice_musiconhold','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 24c3c7b..96b547a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['http','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\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(_0x1756e2,_0x396b86){var _0x5197c0=function(_0x1b500b){while(--_0x1b500b){_0x1756e2['push'](_0x1756e2['shift']());}};_0x5197c0(++_0x396b86);}(_0xa9e0,0x123));var _0x0a9e=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0xa9e0[_0x8de54f];return _0x14cba4;};'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 _0x70e0=['code','VoiceMusicOnHold,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0xc4f842,_0x4bdd8c){var _0x3d2703=function(_0x20cfeb){while(--_0x20cfeb){_0xc4f842['push'](_0xc4f842['shift']());}};_0x3d2703(++_0x4bdd8c);}(_0x70e0,0x17b));var _0x070e=function(_0x275cee,_0x417138){_0x275cee=_0x275cee-0x0;var _0x43cee1=_0x70e0[_0x275cee];return _0x43cee1;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var moment=require(_0x070e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x070e('0x3'));var db=require(_0x070e('0x4'))['db'];var utils=require(_0x070e('0x5'));var logger=require(_0x070e('0x6'))('rpc');var config=require(_0x070e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x070e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56e420,_0x5032e5,_0x35ab0c){return new BPromise(function(_0x1e11f0,_0x604664){return client[_0x070e('0x9')](_0x56e420,_0x35ab0c)[_0x070e('0xa')](function(_0x68a09e){logger[_0x070e('0xb')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x5032e5,'request\x20sent');logger[_0x070e('0xc')](_0x070e('0xd'),_0x5032e5,_0x070e('0xe'),JSON[_0x070e('0xf')](_0x68a09e));if(_0x68a09e[_0x070e('0x10')]){if(_0x68a09e[_0x070e('0x10')][_0x070e('0x11')]===0x1f4){logger[_0x070e('0x10')](_0x070e('0x12'),_0x5032e5,_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);return _0x604664(_0x68a09e['error']['message']);}logger[_0x070e('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x5032e5,_0x68a09e['error']['message']);return _0x1e11f0(_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);}else{logger['info']('VoiceMusicOnHold,\x20%s,\x20%s',_0x5032e5,_0x070e('0xe'));_0x1e11f0(_0x68a09e[_0x070e('0x14')][_0x070e('0x13')]);}})[_0x070e('0x15')](function(_0x5bc71e){logger['error'](_0x070e('0x12'),_0x5032e5,_0x5bc71e);_0x604664(_0x5bc71e);});});}
\ No newline at end of file
index fa2732b..f4bc5b6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc9b9=['path','connect-timeout','express','../../config/environment','index','get','/describe','isAuthenticated','describe','/:id','show','getAgents','/:id/teams','post','/:id/users','addTeams','delete','destroy','removeAgents','removeTeams','exports'];(function(_0x42fcce,_0x3d6a6d){var _0x191198=function(_0x75d934){while(--_0x75d934){_0x42fcce['push'](_0x42fcce['shift']());}};_0x191198(++_0x3d6a6d);}(_0xc9b9,0x18f));var _0x9c9b=function(_0x2b45b5,_0x474458){_0x2b45b5=_0x2b45b5-0x0;var _0x1d9c06=_0xc9b9[_0x2b45b5];return _0x1d9c06;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9c9b('0x0'));var timeout=require(_0x9c9b('0x1'));var express=require(_0x9c9b('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x9c9b('0x3'));var controller=require('./voicePrefix.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x9c9b('0x4')]);router[_0x9c9b('0x5')](_0x9c9b('0x6'),auth[_0x9c9b('0x7')](),controller[_0x9c9b('0x8')]);router['get'](_0x9c9b('0x9'),auth[_0x9c9b('0x7')](),controller[_0x9c9b('0xa')]);router[_0x9c9b('0x5')]('/:id/users',auth[_0x9c9b('0x7')](),controller[_0x9c9b('0xb')]);router['get'](_0x9c9b('0xc'),auth[_0x9c9b('0x7')](),controller['getTeams']);router['post']('/',auth[_0x9c9b('0x7')](),controller['create']);router[_0x9c9b('0xd')](_0x9c9b('0xe'),auth['isAuthenticated'](),controller['addAgents']);router['post']('/:id/teams',auth[_0x9c9b('0x7')](),controller[_0x9c9b('0xf')]);router['put'](_0x9c9b('0x9'),auth[_0x9c9b('0x7')](),controller['update']);router[_0x9c9b('0x10')](_0x9c9b('0x9'),auth[_0x9c9b('0x7')](),controller[_0x9c9b('0x11')]);router[_0x9c9b('0x10')](_0x9c9b('0xe'),auth[_0x9c9b('0x7')](),controller[_0x9c9b('0x12')]);router[_0x9c9b('0x10')]('/:id/teams',auth[_0x9c9b('0x7')](),controller[_0x9c9b('0x13')]);module[_0x9c9b('0x14')]=router;
\ No newline at end of file
+var _0x1360=['describe','/:id','show','/:id/users','getAgents','/:id/teams','getTeams','post','create','addTeams','put','update','delete','destroy','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voicePrefix.controller','get','isAuthenticated','index'];(function(_0x2064f5,_0x2186d0){var _0x29c5a4=function(_0x41f2b0){while(--_0x41f2b0){_0x2064f5['push'](_0x2064f5['shift']());}};_0x29c5a4(++_0x2186d0);}(_0x1360,0xd6));var _0x0136=function(_0xb37311,_0x180fef){_0xb37311=_0xb37311-0x0;var _0x496834=_0x1360[_0xb37311];return _0x496834;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x0136('0x0'));var timeout=require(_0x0136('0x1'));var express=require(_0x0136('0x2'));var router=express[_0x0136('0x3')]();var fs_extra=require(_0x0136('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x0136('0x5'));var config=require(_0x0136('0x6'));var controller=require(_0x0136('0x7'));router[_0x0136('0x8')]('/',auth[_0x0136('0x9')](),controller[_0x0136('0xa')]);router['get']('/describe',auth[_0x0136('0x9')](),controller[_0x0136('0xb')]);router[_0x0136('0x8')](_0x0136('0xc'),auth[_0x0136('0x9')](),controller[_0x0136('0xd')]);router[_0x0136('0x8')](_0x0136('0xe'),auth[_0x0136('0x9')](),controller[_0x0136('0xf')]);router['get'](_0x0136('0x10'),auth[_0x0136('0x9')](),controller[_0x0136('0x11')]);router[_0x0136('0x12')]('/',auth[_0x0136('0x9')](),controller[_0x0136('0x13')]);router[_0x0136('0x12')]('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router[_0x0136('0x12')](_0x0136('0x10'),auth[_0x0136('0x9')](),controller[_0x0136('0x14')]);router[_0x0136('0x15')](_0x0136('0xc'),auth[_0x0136('0x9')](),controller[_0x0136('0x16')]);router[_0x0136('0x17')](_0x0136('0xc'),auth['isAuthenticated'](),controller[_0x0136('0x18')]);router[_0x0136('0x17')]('/:id/users',auth[_0x0136('0x9')](),controller['removeAgents']);router['delete'](_0x0136('0x10'),auth[_0x0136('0x9')](),controller['removeTeams']);module['exports']=router;
\ No newline at end of file
index af83bd4..962b89a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc993=['sequelize','exports','STRING','VIRTUAL','getDataValue','name','INTEGER'];(function(_0x65d35a,_0x3cecfc){var _0x52b826=function(_0x3283f5){while(--_0x3283f5){_0x65d35a['push'](_0x65d35a['shift']());}};_0x52b826(++_0x3cecfc);}(_0xc993,0x157));var _0x3c99=function(_0x114abb,_0x2755c2){_0x114abb=_0x114abb-0x0;var _0x546f25=_0xc993[_0x114abb];return _0x546f25;};'use strict';var Sequelize=require(_0x3c99('0x0'));module[_0x3c99('0x1')]={'name':{'type':Sequelize[_0x3c99('0x2')],'allowNull':![],'unique':'name'},'prefix':{'type':Sequelize[_0x3c99('0x3')],'get':function(_0x1788e6){return'system-'+this[_0x3c99('0x4')](_0x3c99('0x5'))+'-';}},'description':{'type':Sequelize[_0x3c99('0x2')]},'callerIdAll':{'type':Sequelize[_0x3c99('0x2')]},'VoiceExtensionId':{'type':Sequelize[_0x3c99('0x6')]}};
\ No newline at end of file
+var _0x86b1=['system-','getDataValue','INTEGER','sequelize','STRING','name'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x86b1,0x1cb));var _0x186b=function(_0x1d148f,_0x487ab9){_0x1d148f=_0x1d148f-0x0;var _0x57ac51=_0x86b1[_0x1d148f];return _0x57ac51;};'use strict';var Sequelize=require(_0x186b('0x0'));module['exports']={'name':{'type':Sequelize[_0x186b('0x1')],'allowNull':![],'unique':_0x186b('0x2')},'prefix':{'type':Sequelize['VIRTUAL'],'get':function(_0x288fe6){return _0x186b('0x3')+this[_0x186b('0x4')](_0x186b('0x2'))+'-';}},'description':{'type':Sequelize[_0x186b('0x1')]},'callerIdAll':{'type':Sequelize[_0x186b('0x1')]},'VoiceExtensionId':{'type':Sequelize[_0x186b('0x5')]}};
\ No newline at end of file
index 61e2aa7..c729045 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x25e7=['ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','destroy','then','get','UserProfileResource','end','stack','name','send','index','map','VoicePrefix','type','model','query','keys','attributes','fields','hasOwnProperty','order','sort','filters','pick','where','merge','VIRTUAL','filter','include','findAll','catch','show','rawAttributes','intersection','includeAll','options','find','params','describe','create','sequelize','transaction','VoiceExtension','VoiceExtensionId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','VoicePrefixes','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','exten','app','description','Voice\x20Prefix\x20Extension','priority','appdata','prefix','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','Set','CDR(prefix)=','push','PREFIX-CALLERIDALL=','callerIdAll','NoOp','No\x20callerid\x20available','goto','${EXTEN:','length','charAt','body','system-','update','findById','addAgents','ids','omit','spread','emit','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','getAgents','findOne','User','nolimit','getTeams','Team','Agents','voicePause','interface','addTeams','each','TeamVoicePrefix','upsert','UserVoicePrefix','findOrCreate','forEach','removeTeams','select','field','tq.TeamId','from','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','toString','SELECT','every','TeamId','all','union','compact','value','isEmpty','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path'];(function(_0x2494cd,_0x2599af){var _0x357364=function(_0x22f05e){while(--_0x22f05e){_0x2494cd['push'](_0x2494cd['shift']());}};_0x357364(++_0x2599af);}(_0x25e7,0x1d6));var _0x725e=function(_0x15f3a8,_0x9bcdcc){_0x15f3a8=_0x15f3a8-0x0;var _0x26f727=_0x25e7[_0x15f3a8];return _0x26f727;};'use strict';var emlformat=require(_0x725e('0x0'));var rimraf=require(_0x725e('0x1'));var zipdir=require(_0x725e('0x2'));var jsonpatch=require(_0x725e('0x3'));var rp=require(_0x725e('0x4'));var moment=require(_0x725e('0x5'));var BPromise=require(_0x725e('0x6'));var Mustache=require(_0x725e('0x7'));var util=require(_0x725e('0x8'));var path=require(_0x725e('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x725e('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x725e('0xb'));var crypto=require(_0x725e('0xc'));var jsforce=require(_0x725e('0xd'));var deskjs=require(_0x725e('0xe'));var toCsv=require(_0x725e('0xf'));var querystring=require(_0x725e('0x10'));var Papa=require(_0x725e('0x11'));var Redis=require(_0x725e('0x12'));var authService=require(_0x725e('0x13'));var qs=require(_0x725e('0x14'));var as=require(_0x725e('0x15'));var hardwareService=require(_0x725e('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0x725e('0x17'));var config=require(_0x725e('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x725e('0x19')]=_[_0x725e('0x1a')](config['redis'],{'host':_0x725e('0x1b'),'port':0x18eb});var socket=require(_0x725e('0x1c'))(new Redis(config[_0x725e('0x19')]));require('./voicePrefix.socket')[_0x725e('0x1d')](socket);function respondWithStatusCode(_0x221e02,_0x44e652){_0x44e652=_0x44e652||0xcc;return function(_0x2e78d2){if(_0x2e78d2){return _0x221e02[_0x725e('0x1e')](_0x44e652);}return _0x221e02[_0x725e('0x1f')](_0x44e652)['end']();};}function respondWithResult(_0x156b99,_0x268312){_0x268312=_0x268312||0xc8;return function(_0x297bb7){if(_0x297bb7){return _0x156b99['status'](_0x268312)[_0x725e('0x20')](_0x297bb7);}};}function respondWithFilteredResult(_0x125fef,_0x2dda5c){return function(_0x397e33){if(_0x397e33){var _0x268438=typeof _0x2dda5c[_0x725e('0x21')]==='undefined'&&typeof _0x2dda5c[_0x725e('0x22')]===_0x725e('0x23');var _0x1b8879=_0x397e33[_0x725e('0x24')];var _0x1a9ea6=_0x268438?0x0:_0x2dda5c[_0x725e('0x21')];var _0x540802=_0x268438?_0x397e33[_0x725e('0x24')]:_0x2dda5c[_0x725e('0x21')]+_0x2dda5c[_0x725e('0x22')];var _0x40c21b;if(_0x540802>=_0x1b8879){_0x540802=_0x1b8879;_0x40c21b=0xc8;}else{_0x40c21b=0xce;}_0x125fef[_0x725e('0x1f')](_0x40c21b);return _0x125fef[_0x725e('0x25')](_0x725e('0x26'),_0x1a9ea6+'-'+_0x540802+'/'+_0x1b8879)[_0x725e('0x20')](_0x397e33);}return null;};}function patchUpdates(_0x7d0792){return function(_0x5c33c1){try{jsonpatch[_0x725e('0x27')](_0x5c33c1,_0x7d0792,!![]);}catch(_0x36cbab){return BPromise[_0x725e('0x28')](_0x36cbab);}return _0x5c33c1[_0x725e('0x29')]();};}function saveUpdates(_0x5a8191,_0xffe474){return function(_0x5268c8){if(_0x5268c8){return _0x5268c8['update'](_0x5a8191)['then'](function(_0x2aad7b){return _0x2aad7b;});}return null;};}function removeEntity(_0x1cbaae,_0x2d3c55){return function(_0x590aff){if(_0x590aff){return _0x590aff[_0x725e('0x2a')]()[_0x725e('0x2b')](function(){var _0x5a5bef=_0x590aff[_0x725e('0x2c')]({'plain':!![]});var _0x339a58='VoicePrefixes';return db[_0x725e('0x2d')]['destroy']({'where':{'type':_0x339a58,'resourceId':_0x5a5bef['id']}})['then'](function(){return _0x590aff;});})[_0x725e('0x2b')](function(){_0x1cbaae['status'](0xcc)[_0x725e('0x2e')]();});}};}function handleEntityNotFound(_0x4cc4ad,_0x4de2e0){return function(_0x9b5b7f){if(!_0x9b5b7f){_0x4cc4ad[_0x725e('0x1e')](0x194);}return _0x9b5b7f;};}function handleError(_0x33fe34,_0x545237){_0x545237=_0x545237||0x1f4;return function(_0x2e0534){logger['error'](_0x2e0534[_0x725e('0x2f')]);if(_0x2e0534[_0x725e('0x30')]){delete _0x2e0534[_0x725e('0x30')];}_0x33fe34[_0x725e('0x1f')](_0x545237)[_0x725e('0x31')](_0x2e0534);};}exports[_0x725e('0x32')]=function(_0x154ca0,_0x100c63){var _0x4271d2={},_0x3e7637={},_0x9179a4={'count':0x0,'rows':[]};var _0x5493d0=_[_0x725e('0x33')](db[_0x725e('0x34')]['rawAttributes'],function(_0x43f3c6){return{'name':_0x43f3c6['fieldName'],'type':_0x43f3c6[_0x725e('0x35')]['key']};});_0x3e7637[_0x725e('0x36')]=_[_0x725e('0x33')](_0x5493d0,_0x725e('0x30'));_0x3e7637[_0x725e('0x37')]=_[_0x725e('0x38')](_0x154ca0[_0x725e('0x37')]);_0x3e7637['filters']=_['intersection'](_0x3e7637[_0x725e('0x36')],_0x3e7637[_0x725e('0x37')]);_0x4271d2[_0x725e('0x39')]=_['intersection'](_0x3e7637[_0x725e('0x36')],qs['fields'](_0x154ca0[_0x725e('0x37')][_0x725e('0x3a')]));_0x4271d2[_0x725e('0x39')]=_0x4271d2[_0x725e('0x39')]['length']?_0x4271d2['attributes']:_0x3e7637[_0x725e('0x36')];if(!_0x154ca0[_0x725e('0x37')][_0x725e('0x3b')]('nolimit')){_0x4271d2[_0x725e('0x22')]=qs[_0x725e('0x22')](_0x154ca0[_0x725e('0x37')]['limit']);_0x4271d2[_0x725e('0x21')]=qs['offset'](_0x154ca0[_0x725e('0x37')][_0x725e('0x21')]);}_0x4271d2[_0x725e('0x3c')]=qs[_0x725e('0x3d')](_0x154ca0[_0x725e('0x37')]['sort']);_0x4271d2['where']=qs[_0x725e('0x3e')](_[_0x725e('0x3f')](_0x154ca0[_0x725e('0x37')],_0x3e7637['filters']),_0x5493d0);if(_0x154ca0[_0x725e('0x37')]['filter']){_0x4271d2[_0x725e('0x40')]=_[_0x725e('0x41')](_0x4271d2[_0x725e('0x40')],{'$or':_[_0x725e('0x33')](_0x5493d0,function(_0x48e532){if(_0x48e532[_0x725e('0x35')]!==_0x725e('0x42')){var _0x1ae4e2={};_0x1ae4e2[_0x48e532[_0x725e('0x30')]]={'$like':'%'+_0x154ca0[_0x725e('0x37')][_0x725e('0x43')]+'%'};return _0x1ae4e2;}})});}_0x4271d2=_[_0x725e('0x41')]({},_0x4271d2,_0x154ca0['options']);var _0x36b0ae={'where':_0x4271d2[_0x725e('0x40')]};return db['VoicePrefix'][_0x725e('0x24')](_0x36b0ae)[_0x725e('0x2b')](function(_0x5e719e){_0x9179a4['count']=_0x5e719e;if(_0x154ca0['query']['includeAll']){_0x4271d2[_0x725e('0x44')]=[{'all':!![]}];}return db[_0x725e('0x34')][_0x725e('0x45')](_0x4271d2);})['then'](function(_0x1eee42){_0x9179a4['rows']=_0x1eee42;return _0x9179a4;})['then'](respondWithFilteredResult(_0x100c63,_0x4271d2))[_0x725e('0x46')](handleError(_0x100c63,null));};exports[_0x725e('0x47')]=function(_0x12ffd0,_0x241960){var _0x3081df={'raw':![],'where':{'id':_0x12ffd0['params']['id']}},_0x45eed6={};_0x45eed6[_0x725e('0x36')]=_['keys'](db[_0x725e('0x34')][_0x725e('0x48')]);_0x45eed6['query']=_[_0x725e('0x38')](_0x12ffd0['query']);_0x45eed6[_0x725e('0x3e')]=_[_0x725e('0x49')](_0x45eed6['model'],_0x45eed6['query']);_0x3081df[_0x725e('0x39')]=_['intersection'](_0x45eed6[_0x725e('0x36')],qs['fields'](_0x12ffd0['query']['fields']));_0x3081df[_0x725e('0x39')]=_0x3081df[_0x725e('0x39')]['length']?_0x3081df[_0x725e('0x39')]:_0x45eed6[_0x725e('0x36')];if(_0x12ffd0['query'][_0x725e('0x4a')]){_0x3081df[_0x725e('0x44')]=[{'all':!![]}];}_0x3081df=_[_0x725e('0x41')]({},_0x3081df,_0x12ffd0[_0x725e('0x4b')]);return db[_0x725e('0x34')][_0x725e('0x4c')](_0x3081df)[_0x725e('0x2b')](handleEntityNotFound(_0x241960,null))[_0x725e('0x2b')](respondWithResult(_0x241960,null))[_0x725e('0x46')](handleError(_0x241960,null));};exports[_0x725e('0x2a')]=function(_0x34edcd,_0x14753a){return db[_0x725e('0x34')]['find']({'where':{'id':_0x34edcd[_0x725e('0x4d')]['id']}})['then'](handleEntityNotFound(_0x14753a,null))[_0x725e('0x2b')](removeEntity(_0x14753a,null))[_0x725e('0x46')](handleError(_0x14753a,null));};exports[_0x725e('0x4e')]=function(_0x1a289e,_0x34eab7){return db[_0x725e('0x34')][_0x725e('0x4e')]()[_0x725e('0x2b')](respondWithResult(_0x34eab7,null))[_0x725e('0x46')](handleError(_0x34eab7,null));};exports[_0x725e('0x4f')]=function(_0x3f4d9b,_0x248252){var _0x361050;return db[_0x725e('0x50')][_0x725e('0x51')](function(_0x3c994e){return db[_0x725e('0x34')][_0x725e('0x4f')](_0x3f4d9b['body'],{'transaction':_0x3c994e})[_0x725e('0x2b')](function(_0x5ce25f){_0x361050=_0x5ce25f[_0x725e('0x2c')]({'plain':!![]});return db[_0x725e('0x52')]['find']({'where':{'id':_0x361050[_0x725e('0x53')]},'raw':!![]})['then'](function(_0x3a2d0a){return createVoicePrefixExtensions(_0x361050,_0x3a2d0a,_0x3c994e);});});})[_0x725e('0x2b')](function(){var _0x1330b1=_0x3f4d9b['user'][_0x725e('0x2c')]({'plain':!![]});if(!_0x1330b1)throw new Error(_0x725e('0x54'));if(_0x1330b1[_0x725e('0x55')]===_0x725e('0x56')){var _0x2afb6e=_0x361050;return db[_0x725e('0x57')][_0x725e('0x4c')]({'where':{'name':_0x725e('0x58'),'userProfileId':_0x1330b1['userProfileId']},'raw':!![]})[_0x725e('0x2b')](function(_0x215018){if(_0x215018&&_0x215018['autoAssociation']===0x0){return db['UserProfileResource'][_0x725e('0x4f')]({'name':_0x2afb6e[_0x725e('0x30')],'resourceId':_0x2afb6e['id'],'type':_0x215018['name'],'sectionId':_0x215018['id']},{})['then'](function(){return _0x361050;});}else{return _0x361050;}})[_0x725e('0x46')](function(_0x2c343f){logger[_0x725e('0x59')](_0x725e('0x5a'),_0x2c343f);throw _0x2c343f;});}return _0x361050;})[_0x725e('0x2b')](respondWithResult(_0x248252,null))[_0x725e('0x46')](handleError(_0x248252,null));};function Extension(_0x591c00,_0x18fb12,_0x4498fb,_0x5c5a3f){this[_0x725e('0x5b')]=_0x725e('0x5c');this[_0x725e('0x5d')]=_0x591c00;this[_0x725e('0x5e')]=_0x4498fb;this[_0x725e('0x35')]='system';this[_0x725e('0x5f')]=_0x725e('0x60');this[_0x725e('0x61')]=_0x18fb12;this[_0x725e('0x62')]=_0x5c5a3f;}function createVoicePrefixExtensions(_0x3af5fd,_0x104a68,_0x4a742b){return new BPromise(function(_0x342ba9,_0x5f46f0){var _0x517bb9=new Extension(formatPrefixName(_0x3af5fd[_0x725e('0x63')]),0x1,'NoOp','Voice\x20Prefix');_0x517bb9[_0x725e('0x64')]=_0x3af5fd['id'];return db[_0x725e('0x52')][_0x725e('0x4f')](_0x517bb9,{'transaction':_0x4a742b})[_0x725e('0x2b')](function(_0x402eb3){var _0x2b748c=_0x402eb3[_0x725e('0x2c')]({'plain':!![]});var _0x5ecc04=_[_0x725e('0x33')](addVoicePrefixExtensions(_0x3af5fd,_0x104a68),function(_0xa138bf){_0xa138bf[_0x725e('0x53')]=_0x2b748c['id'];_0xa138bf['VoicePrefixId']=_0x3af5fd['id'];return _0xa138bf;});return db['VoiceExtension'][_0x725e('0x65')](_0x5ecc04,{'transaction':_0x4a742b})[_0x725e('0x2b')](function(_0x449f1f){if(!_0x449f1f){return _0x5f46f0(_0x725e('0x66'));}else{return _0x342ba9(_0x449f1f);}})[_0x725e('0x46')](function(_0x10c7ba){return _0x5f46f0(_0x10c7ba);});});;});};function addVoicePrefixExtensions(_0x1f977b,_0x4d97c9){var _0x24e2ed=[];var _0x5c31b6=formatPrefixName(_0x1f977b[_0x725e('0x63')]);_0x24e2ed['push'](new Extension(_0x5c31b6,0x2,_0x725e('0x67'),_0x725e('0x68')+_0x1f977b[_0x725e('0x30')]));if(_0x1f977b['callerIdAll']){_0x24e2ed[_0x725e('0x69')](new Extension(_0x5c31b6,0x3,_0x725e('0x67'),_0x725e('0x6a')+_0x1f977b[_0x725e('0x6b')]));}else{_0x24e2ed[_0x725e('0x69')](new Extension(_0x5c31b6,0x3,_0x725e('0x6c'),_0x725e('0x6d')));}_0x24e2ed[_0x725e('0x69')](new Extension(_0x5c31b6,0x4,_0x725e('0x6e'),_0x4d97c9['context']+','+_0x725e('0x6f')+(0x8+_0x1f977b[_0x725e('0x30')]['length'])+'}'+','+0x1));return _0x24e2ed;}function formatPrefixName(_0x12cc3e){var _0x1a12c1='_';for(var _0x1d2e49=0x0;_0x1d2e49<_0x12cc3e[_0x725e('0x70')];_0x1d2e49++){if(_0x12cc3e[_0x725e('0x71')](_0x1d2e49)=='-'){_0x1a12c1+=_0x12cc3e[_0x725e('0x71')](_0x1d2e49);}else{_0x1a12c1+='['+_0x12cc3e[_0x725e('0x71')](_0x1d2e49)+']';}}_0x1a12c1+='.';return _0x1a12c1;}exports['update']=function(_0x5e54b6,_0x5216eb,_0x2d13df){var _0x3fc31d=_0x5e54b6[_0x725e('0x72')];_0x3fc31d['prefix']=_0x725e('0x73')+_0x3fc31d[_0x725e('0x30')]+'-';return db['sequelize']['transaction'](function(_0xd456e4){return db['VoicePrefix'][_0x725e('0x74')](_0x3fc31d,{'where':{'id':_0x3fc31d['id']},'transaction':_0xd456e4})[_0x725e('0x2b')](function(){return db['VoiceExtension'][_0x725e('0x2a')]({'where':{'VoicePrefixId':_0x3fc31d['id']},'transaction':_0xd456e4})[_0x725e('0x2b')](function(){return db[_0x725e('0x52')]['find']({'where':{'id':_0x3fc31d[_0x725e('0x53')]},'raw':!![]})[_0x725e('0x2b')](function(_0x44bcaa){return createVoicePrefixExtensions(_0x3fc31d,_0x44bcaa,_0xd456e4);});});});})['then'](function(){return db[_0x725e('0x34')][_0x725e('0x75')](_0x3fc31d['id']);})[_0x725e('0x2b')](respondWithResult(_0x5216eb,null))[_0x725e('0x46')](handleError(_0x5216eb,null));};exports[_0x725e('0x76')]=function(_0x57dd58,_0x5b84ae,_0x2fbf91){return db[_0x725e('0x34')][_0x725e('0x4c')]({'where':{'id':_0x57dd58['params']['id']}})[_0x725e('0x2b')](handleEntityNotFound(_0x5b84ae,null))[_0x725e('0x2b')](function(_0x4d0809){if(_0x4d0809){return _0x4d0809[_0x725e('0x76')](_0x57dd58[_0x725e('0x72')][_0x725e('0x77')],_[_0x725e('0x78')](_0x57dd58[_0x725e('0x72')],['ids','id'])||{})[_0x725e('0x79')](function(_0x543e18){for(var _0xc7201d=0x0;_0xc7201d<_0x57dd58[_0x725e('0x72')][_0x725e('0x77')][_0x725e('0x70')];_0xc7201d+=0x1){socket[_0x725e('0x7a')](_0x725e('0x7b'),{'UserId':Number(_0x57dd58[_0x725e('0x72')][_0x725e('0x77')][_0xc7201d]),'VoicePrefixId':Number(_0x57dd58[_0x725e('0x4d')]['id'])});}return _0x543e18;});}})['then'](respondWithResult(_0x5b84ae,null))[_0x725e('0x46')](handleError(_0x5b84ae,null));};exports[_0x725e('0x7c')]=function(_0x2e35a9,_0x41eeeb,_0x59ef64){return db[_0x725e('0x34')][_0x725e('0x4c')]({'where':{'id':_0x2e35a9[_0x725e('0x4d')]['id']}})[_0x725e('0x2b')](handleEntityNotFound(_0x41eeeb,null))['then'](function(_0x3072d8){if(_0x3072d8){return _0x3072d8['removeAgents'](_0x2e35a9[_0x725e('0x37')]['ids'])['then'](function(){if(_[_0x725e('0x7d')](_0x2e35a9['query'][_0x725e('0x77')])){for(var _0x4ed673=0x0;_0x4ed673<_0x2e35a9[_0x725e('0x37')][_0x725e('0x77')][_0x725e('0x70')];_0x4ed673+=0x1){socket['emit'](_0x725e('0x7e'),{'UserId':Number(_0x2e35a9[_0x725e('0x37')]['ids'][_0x4ed673]),'VoicePrefixId':Number(_0x2e35a9[_0x725e('0x4d')]['id'])});}}else{socket['emit'](_0x725e('0x7e'),{'UserId':Number(_0x2e35a9[_0x725e('0x37')]['ids']),'VoicePrefixId':Number(_0x2e35a9[_0x725e('0x4d')]['id'])});}});}})[_0x725e('0x2b')](respondWithStatusCode(_0x41eeeb,null))[_0x725e('0x46')](handleError(_0x41eeeb,null));};exports[_0x725e('0x7f')]=function(_0x3beead,_0x35f227,_0x17a099){var _0x42416e={};var _0x12b0e3={};var _0x1898be;var _0xc67a2f;return db[_0x725e('0x34')][_0x725e('0x80')]({'where':{'id':_0x3beead[_0x725e('0x4d')]['id']}})[_0x725e('0x2b')](handleEntityNotFound(_0x35f227,null))[_0x725e('0x2b')](function(_0x2ca538){if(_0x2ca538){_0x1898be=_0x2ca538;_0x12b0e3['model']=_[_0x725e('0x38')](db[_0x725e('0x81')][_0x725e('0x48')]);_0x12b0e3[_0x725e('0x37')]=_[_0x725e('0x38')](_0x3beead[_0x725e('0x37')]);_0x12b0e3[_0x725e('0x3e')]=_[_0x725e('0x49')](_0x12b0e3['model'],_0x12b0e3['query']);_0x42416e[_0x725e('0x39')]=_[_0x725e('0x49')](_0x12b0e3[_0x725e('0x36')],qs['fields'](_0x3beead['query'][_0x725e('0x3a')]));_0x42416e[_0x725e('0x39')]=_0x42416e[_0x725e('0x39')][_0x725e('0x70')]?_0x42416e[_0x725e('0x39')]:_0x12b0e3[_0x725e('0x36')];_0x42416e['order']=qs[_0x725e('0x3d')](_0x3beead[_0x725e('0x37')][_0x725e('0x3d')]);_0x42416e['where']=qs[_0x725e('0x3e')](_[_0x725e('0x3f')](_0x3beead['query'],_0x12b0e3[_0x725e('0x3e')]));if(_0x3beead[_0x725e('0x37')][_0x725e('0x43')]){_0x42416e[_0x725e('0x40')]=_[_0x725e('0x41')](_0x42416e[_0x725e('0x40')],{'$or':_['map'](_0x42416e['attributes'],function(_0x3b35ba){var _0x21d697={};_0x21d697[_0x3b35ba]={'$like':'%'+_0x3beead[_0x725e('0x37')][_0x725e('0x43')]+'%'};return _0x21d697;})});}_0x42416e=_[_0x725e('0x41')]({},_0x42416e,_0x3beead['options']);return _0x1898be[_0x725e('0x7f')](_0x42416e);}})[_0x725e('0x2b')](function(_0x6e24d0){if(_0x6e24d0){_0xc67a2f=_0x6e24d0['length'];if(!_0x3beead['query'][_0x725e('0x3b')](_0x725e('0x82'))){_0x42416e[_0x725e('0x22')]=qs['limit'](_0x3beead[_0x725e('0x37')][_0x725e('0x22')]);_0x42416e[_0x725e('0x21')]=qs[_0x725e('0x21')](_0x3beead[_0x725e('0x37')][_0x725e('0x21')]);}return _0x1898be[_0x725e('0x7f')](_0x42416e);}})[_0x725e('0x2b')](function(_0x54fbe6){if(_0x54fbe6){return _0x54fbe6?{'count':_0xc67a2f,'rows':_0x54fbe6}:null;}})[_0x725e('0x2b')](respondWithResult(_0x35f227,null))['catch'](handleError(_0x35f227,null));};exports[_0x725e('0x83')]=function(_0x56fc9a,_0x51e00d,_0x2e02a3){var _0x1b6528={};var _0x4fc3ef={};var _0x50bb3e;var _0x2d37f3;return db[_0x725e('0x34')]['findOne']({'where':{'id':_0x56fc9a[_0x725e('0x4d')]['id']}})[_0x725e('0x2b')](handleEntityNotFound(_0x51e00d,null))[_0x725e('0x2b')](function(_0x1fe8bd){if(_0x1fe8bd){_0x50bb3e=_0x1fe8bd;_0x4fc3ef[_0x725e('0x36')]=_[_0x725e('0x38')](db[_0x725e('0x84')][_0x725e('0x48')]);_0x4fc3ef['query']=_[_0x725e('0x38')](_0x56fc9a[_0x725e('0x37')]);_0x4fc3ef[_0x725e('0x3e')]=_[_0x725e('0x49')](_0x4fc3ef[_0x725e('0x36')],_0x4fc3ef[_0x725e('0x37')]);_0x1b6528[_0x725e('0x39')]=_['intersection'](_0x4fc3ef[_0x725e('0x36')],qs['fields'](_0x56fc9a[_0x725e('0x37')][_0x725e('0x3a')]));_0x1b6528[_0x725e('0x39')]=_0x1b6528[_0x725e('0x39')][_0x725e('0x70')]?_0x1b6528[_0x725e('0x39')]:_0x4fc3ef['model'];_0x1b6528['order']=qs[_0x725e('0x3d')](_0x56fc9a[_0x725e('0x37')][_0x725e('0x3d')]);_0x1b6528[_0x725e('0x40')]=qs[_0x725e('0x3e')](_[_0x725e('0x3f')](_0x56fc9a[_0x725e('0x37')],_0x4fc3ef[_0x725e('0x3e')]));if(_0x56fc9a[_0x725e('0x37')][_0x725e('0x43')]){_0x1b6528[_0x725e('0x40')]=_[_0x725e('0x41')](_0x1b6528[_0x725e('0x40')],{'$or':_['map'](_0x1b6528[_0x725e('0x39')],function(_0x5877e9){var _0x2a5ee9={};_0x2a5ee9[_0x5877e9]={'$like':'%'+_0x56fc9a[_0x725e('0x37')]['filter']+'%'};return _0x2a5ee9;})});}_0x1b6528=_[_0x725e('0x41')]({},_0x1b6528,_0x56fc9a['options']);return _0x50bb3e[_0x725e('0x83')](_0x1b6528);}})[_0x725e('0x2b')](function(_0x579756){if(_0x579756){_0x2d37f3=_0x579756['length'];if(!_0x56fc9a[_0x725e('0x37')]['hasOwnProperty'](_0x725e('0x82'))){_0x1b6528['limit']=qs[_0x725e('0x22')](_0x56fc9a[_0x725e('0x37')]['limit']);_0x1b6528[_0x725e('0x21')]=qs[_0x725e('0x21')](_0x56fc9a[_0x725e('0x37')][_0x725e('0x21')]);}return _0x50bb3e[_0x725e('0x83')](_0x1b6528);}})[_0x725e('0x2b')](function(_0x354d76){if(_0x354d76){return _0x354d76?{'count':_0x2d37f3,'rows':_0x354d76}:null;}})['then'](respondWithResult(_0x51e00d,null))[_0x725e('0x46')](handleError(_0x51e00d,null));};exports['addTeams']=function(_0x1dffdd,_0x125a60,_0x58773a){var _0x58c8fe=_0x1dffdd['body'][_0x725e('0x77')];var _0x5b3b7c;return db['Team'][_0x725e('0x45')]({'where':{'id':_0x58c8fe},'attributes':['id'],'include':[{'model':db[_0x725e('0x81')],'as':_0x725e('0x85'),'attributes':['id',_0x725e('0x30'),'online',_0x725e('0x86'),_0x725e('0x87')],'raw':!![]}]})[_0x725e('0x2b')](function(_0x4cb90b){if(_0x4cb90b){_0x5b3b7c=_0x4cb90b;var _0x100b33=_['flatMap'](_0x4cb90b,function(_0x358cda){var _0x20f0a9=_0x358cda[_0x725e('0x2c')]({'plain':!![]});return _0x20f0a9[_0x725e('0x85')];});return db[_0x725e('0x34')][_0x725e('0x4c')]({'where':{'id':_0x1dffdd[_0x725e('0x4d')]['id']}})['then'](function(_0x530ac5){return db[_0x725e('0x50')][_0x725e('0x51')](function(_0xe17e71){return _0x530ac5[_0x725e('0x88')](_0x58c8fe,{'transaction':_0xe17e71})['then'](function(){return BPromise[_0x725e('0x89')](_0x5b3b7c,function(_0x4a6dd1){return db[_0x725e('0x8a')][_0x725e('0x8b')]({'TeamId':_0x4a6dd1['id'],'VoicePrefixId':_0x1dffdd[_0x725e('0x4d')]['id']},{'transaction':_0xe17e71});});})[_0x725e('0x2b')](function(){return BPromise[_0x725e('0x89')](_0x100b33,function(_0x3455da){return db[_0x725e('0x8c')][_0x725e('0x8d')]({'where':{'UserId':_0x3455da['id'],'VoicePrefixId':_0x1dffdd['params']['id']},'transaction':_0xe17e71});});})[_0x725e('0x2b')](function(){_0x100b33[_0x725e('0x8e')](function(_0x34bd67){socket[_0x725e('0x7a')](_0x725e('0x7b'),{'UserId':_0x34bd67['id'],'VoicePrefixId':_0x530ac5['id']});});});});});}})[_0x725e('0x2b')](respondWithStatusCode(_0x125a60,null))['catch'](handleError(_0x125a60,null));};exports[_0x725e('0x8f')]=function(_0x127f9b,_0x3da4d9,_0x543e64){return db[_0x725e('0x84')][_0x725e('0x45')]({'where':{'id':_0x127f9b[_0x725e('0x37')][_0x725e('0x77')]},'attributes':['id'],'include':[{'model':db[_0x725e('0x81')],'as':_0x725e('0x85'),'attributes':['id'],'raw':!![]}]})[_0x725e('0x2b')](handleEntityNotFound(_0x3da4d9,null))[_0x725e('0x2b')](function(_0x46b8f8){var _0x1f9130=_[_0x725e('0x33')](_0x46b8f8,'id');var _0x1851df=[];var _0x5ad4be=[];var _0x256b12=squel[_0x725e('0x90')]();_0x256b12[_0x725e('0x91')](_0x725e('0x92'))[_0x725e('0x93')]('team_has_voice_prefixes','tq')['join']('user_has_teams','ut',_0x725e('0x94'))['where']('VoicePrefixId\x20=\x20?',_0x127f9b[_0x725e('0x4d')]['id']);for(var _0x545eb3=0x0;_0x545eb3<_0x46b8f8[_0x725e('0x70')];_0x545eb3+=0x1){let _0x28aebc=_0x46b8f8[_0x545eb3];for(var _0x322347=0x0;_0x322347<_0x28aebc['Agents'][_0x725e('0x70')];_0x322347+=0x1){let _0x35aa4a=_0x28aebc['Agents'][_0x322347];var _0x3e7f45=_0x256b12[_0x725e('0x95')]();_0x3e7f45[_0x725e('0x40')](_0x725e('0x96'),_0x35aa4a['id']);_0x5ad4be[_0x725e('0x69')](db['sequelize']['query'](_0x3e7f45[_0x725e('0x97')](),{'type':db[_0x725e('0x50')]['QueryTypes'][_0x725e('0x98')]})['then'](function(_0x55ef18){if(_0x55ef18[_0x725e('0x70')]===0x1){return _0x35aa4a['id'];}else{var _0x5c11d5=_[_0x725e('0x99')](_[_0x725e('0x33')](_0x55ef18,_0x725e('0x9a')),function(_0x4cc2fb){return _['includes'](_0x1f9130,_0x4cc2fb);});if(_0x5c11d5){return _0x35aa4a['id'];}}}));}}return BPromise[_0x725e('0x9b')](_0x5ad4be)[_0x725e('0x2b')](function(_0x1d533b){_0x1851df=_(_0x1851df)[_0x725e('0x9c')](_0x1d533b)[_0x725e('0x9d')]()[_0x725e('0x9e')]();return db['VoicePrefix'][_0x725e('0x4c')]({'where':{'id':_0x127f9b[_0x725e('0x4d')]['id']}})[_0x725e('0x2b')](function(_0x51ba9d){return db[_0x725e('0x50')][_0x725e('0x51')](function(_0xe8e8d7){return _0x51ba9d[_0x725e('0x8f')](_0x127f9b['query'][_0x725e('0x77')],{'transaction':_0xe8e8d7})[_0x725e('0x2b')](function(){if(!_[_0x725e('0x9f')](_0x1851df)){return _0x51ba9d[_0x725e('0x7c')](_0x1851df,{'transaction':_0xe8e8d7});}})['then'](function(){_0x1851df[_0x725e('0x8e')](function(_0x5f3ad7){socket[_0x725e('0x7a')]('userVoicePrefix:remove',{'UserId':_0x5f3ad7,'VoicePrefixId':_0x51ba9d['id']});});});});});});})[_0x725e('0x2b')](respondWithStatusCode(_0x3da4d9,null))[_0x725e('0x46')](handleError(_0x3da4d9,null));};
\ No newline at end of file
+var _0xfef3=['../../mysqldb','defaults','redis','localhost','register','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','save','update','destroy','VoicePrefixes','then','error','stack','name','index','map','VoicePrefix','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','find','catch','describe','create','sequelize','transaction','body','get','VoiceExtension','VoiceExtensionId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','system','description','Voice\x20Prefix\x20Extension','priority','appdata','prefix','NoOp','Voice\x20Prefix','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','push','Set','CDR(prefix)=','callerIdAll','No\x20callerid\x20available','charAt','system-','findById','addAgents','ids','spread','emit','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','getAgents','findOne','User','pick','getTeams','hasOwnProperty','Team','Agents','online','interface','flatMap','each','TeamVoicePrefix','upsert','findOrCreate','forEach','select','field','tq.TeamId','team_has_voice_prefixes','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','QueryTypes','every','TeamId','all','union','value','isEmpty','eml-format','zip-dir','request-promise','moment','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment'];(function(_0x25f2be,_0xe12346){var _0x481ac6=function(_0x15a9b6){while(--_0x15a9b6){_0x25f2be['push'](_0x25f2be['shift']());}};_0x481ac6(++_0xe12346);}(_0xfef3,0x118));var _0x3fef=function(_0x6ad6c0,_0x39de11){_0x6ad6c0=_0x6ad6c0-0x0;var _0x139825=_0xfef3[_0x6ad6c0];return _0x139825;};'use strict';var emlformat=require(_0x3fef('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3fef('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3fef('0x2'));var moment=require(_0x3fef('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x3fef('0x4'));var util=require(_0x3fef('0x5'));var path=require('path');var sox=require(_0x3fef('0x6'));var csv=require(_0x3fef('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3fef('0x8'));var _=require(_0x3fef('0x9'));var squel=require(_0x3fef('0xa'));var crypto=require(_0x3fef('0xb'));var jsforce=require(_0x3fef('0xc'));var deskjs=require(_0x3fef('0xd'));var toCsv=require(_0x3fef('0x7'));var querystring=require(_0x3fef('0xe'));var Papa=require(_0x3fef('0xf'));var Redis=require(_0x3fef('0x10'));var authService=require(_0x3fef('0x11'));var qs=require(_0x3fef('0x12'));var as=require(_0x3fef('0x13'));var hardwareService=require(_0x3fef('0x14'));var logger=require('../../config/logger')(_0x3fef('0x15'));var utils=require(_0x3fef('0x16'));var config=require(_0x3fef('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x3fef('0x18'))['db'];config['redis']=_[_0x3fef('0x19')](config[_0x3fef('0x1a')],{'host':_0x3fef('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3fef('0x1a')]));require('./voicePrefix.socket')[_0x3fef('0x1c')](socket);function respondWithStatusCode(_0x14c053,_0x56a65d){_0x56a65d=_0x56a65d||0xcc;return function(_0x2dec1b){if(_0x2dec1b){return _0x14c053[_0x3fef('0x1d')](_0x56a65d);}return _0x14c053[_0x3fef('0x1e')](_0x56a65d)[_0x3fef('0x1f')]();};}function respondWithResult(_0x395df0,_0x2af1ba){_0x2af1ba=_0x2af1ba||0xc8;return function(_0x5c899f){if(_0x5c899f){return _0x395df0[_0x3fef('0x1e')](_0x2af1ba)[_0x3fef('0x20')](_0x5c899f);}};}function respondWithFilteredResult(_0x1ec282,_0x3f2997){return function(_0x1613ad){if(_0x1613ad){var _0xaa0ae3=typeof _0x3f2997['offset']===_0x3fef('0x21')&&typeof _0x3f2997[_0x3fef('0x22')]==='undefined';var _0x2c7f36=_0x1613ad[_0x3fef('0x23')];var _0x42e095=_0xaa0ae3?0x0:_0x3f2997[_0x3fef('0x24')];var _0x245332=_0xaa0ae3?_0x1613ad[_0x3fef('0x23')]:_0x3f2997[_0x3fef('0x24')]+_0x3f2997[_0x3fef('0x22')];var _0x124e7c;if(_0x245332>=_0x2c7f36){_0x245332=_0x2c7f36;_0x124e7c=0xc8;}else{_0x124e7c=0xce;}_0x1ec282[_0x3fef('0x1e')](_0x124e7c);return _0x1ec282[_0x3fef('0x25')](_0x3fef('0x26'),_0x42e095+'-'+_0x245332+'/'+_0x2c7f36)[_0x3fef('0x20')](_0x1613ad);}return null;};}function patchUpdates(_0x39a8ea){return function(_0x433a3e){try{jsonpatch['apply'](_0x433a3e,_0x39a8ea,!![]);}catch(_0x5b56de){return BPromise['reject'](_0x5b56de);}return _0x433a3e[_0x3fef('0x27')]();};}function saveUpdates(_0x3ba38d,_0xa16dc){return function(_0x5f047c){if(_0x5f047c){return _0x5f047c[_0x3fef('0x28')](_0x3ba38d)['then'](function(_0x45464b){return _0x45464b;});}return null;};}function removeEntity(_0x2c0848,_0x64d3e6){return function(_0xf2b269){if(_0xf2b269){return _0xf2b269[_0x3fef('0x29')]()['then'](function(){var _0x4b4dee=_0xf2b269['get']({'plain':!![]});var _0x121ff0=_0x3fef('0x2a');return db['UserProfileResource'][_0x3fef('0x29')]({'where':{'type':_0x121ff0,'resourceId':_0x4b4dee['id']}})[_0x3fef('0x2b')](function(){return _0xf2b269;});})['then'](function(){_0x2c0848[_0x3fef('0x1e')](0xcc)[_0x3fef('0x1f')]();});}};}function handleEntityNotFound(_0xf892bb,_0x2b73fb){return function(_0x3a1a0a){if(!_0x3a1a0a){_0xf892bb[_0x3fef('0x1d')](0x194);}return _0x3a1a0a;};}function handleError(_0x20abb6,_0x4a632c){_0x4a632c=_0x4a632c||0x1f4;return function(_0x34576a){logger[_0x3fef('0x2c')](_0x34576a[_0x3fef('0x2d')]);if(_0x34576a[_0x3fef('0x2e')]){delete _0x34576a['name'];}_0x20abb6[_0x3fef('0x1e')](_0x4a632c)['send'](_0x34576a);};}exports[_0x3fef('0x2f')]=function(_0x3c4483,_0x16009a){var _0x1136b3={},_0x10b803={},_0x464763={'count':0x0,'rows':[]};var _0x355c03=_[_0x3fef('0x30')](db[_0x3fef('0x31')][_0x3fef('0x32')],function(_0x4f1061){return{'name':_0x4f1061['fieldName'],'type':_0x4f1061[_0x3fef('0x33')]['key']};});_0x10b803[_0x3fef('0x34')]=_[_0x3fef('0x30')](_0x355c03,_0x3fef('0x2e'));_0x10b803[_0x3fef('0x35')]=_[_0x3fef('0x36')](_0x3c4483[_0x3fef('0x35')]);_0x10b803[_0x3fef('0x37')]=_[_0x3fef('0x38')](_0x10b803[_0x3fef('0x34')],_0x10b803[_0x3fef('0x35')]);_0x1136b3[_0x3fef('0x39')]=_[_0x3fef('0x38')](_0x10b803[_0x3fef('0x34')],qs[_0x3fef('0x3a')](_0x3c4483['query'][_0x3fef('0x3a')]));_0x1136b3[_0x3fef('0x39')]=_0x1136b3[_0x3fef('0x39')][_0x3fef('0x3b')]?_0x1136b3[_0x3fef('0x39')]:_0x10b803[_0x3fef('0x34')];if(!_0x3c4483['query']['hasOwnProperty'](_0x3fef('0x3c'))){_0x1136b3[_0x3fef('0x22')]=qs[_0x3fef('0x22')](_0x3c4483[_0x3fef('0x35')][_0x3fef('0x22')]);_0x1136b3[_0x3fef('0x24')]=qs[_0x3fef('0x24')](_0x3c4483[_0x3fef('0x35')][_0x3fef('0x24')]);}_0x1136b3[_0x3fef('0x3d')]=qs[_0x3fef('0x3e')](_0x3c4483['query'][_0x3fef('0x3e')]);_0x1136b3[_0x3fef('0x3f')]=qs['filters'](_['pick'](_0x3c4483[_0x3fef('0x35')],_0x10b803[_0x3fef('0x37')]),_0x355c03);if(_0x3c4483[_0x3fef('0x35')][_0x3fef('0x40')]){_0x1136b3[_0x3fef('0x3f')]=_[_0x3fef('0x41')](_0x1136b3[_0x3fef('0x3f')],{'$or':_[_0x3fef('0x30')](_0x355c03,function(_0x577ab8){if(_0x577ab8[_0x3fef('0x33')]!==_0x3fef('0x42')){var _0x2859db={};_0x2859db[_0x577ab8[_0x3fef('0x2e')]]={'$like':'%'+_0x3c4483[_0x3fef('0x35')][_0x3fef('0x40')]+'%'};return _0x2859db;}})});}_0x1136b3=_[_0x3fef('0x41')]({},_0x1136b3,_0x3c4483[_0x3fef('0x43')]);var _0x3df52b={'where':_0x1136b3[_0x3fef('0x3f')]};return db[_0x3fef('0x31')][_0x3fef('0x23')](_0x3df52b)[_0x3fef('0x2b')](function(_0x15d2c7){_0x464763[_0x3fef('0x23')]=_0x15d2c7;if(_0x3c4483['query'][_0x3fef('0x44')]){_0x1136b3[_0x3fef('0x45')]=[{'all':!![]}];}return db[_0x3fef('0x31')][_0x3fef('0x46')](_0x1136b3);})[_0x3fef('0x2b')](function(_0x33b145){_0x464763['rows']=_0x33b145;return _0x464763;})[_0x3fef('0x2b')](respondWithFilteredResult(_0x16009a,_0x1136b3))['catch'](handleError(_0x16009a,null));};exports[_0x3fef('0x47')]=function(_0x40a206,_0x59e3b0){var _0xa1a53d={'raw':![],'where':{'id':_0x40a206[_0x3fef('0x48')]['id']}},_0x4e662c={};_0x4e662c[_0x3fef('0x34')]=_[_0x3fef('0x36')](db[_0x3fef('0x31')][_0x3fef('0x32')]);_0x4e662c[_0x3fef('0x35')]=_[_0x3fef('0x36')](_0x40a206[_0x3fef('0x35')]);_0x4e662c[_0x3fef('0x37')]=_[_0x3fef('0x38')](_0x4e662c[_0x3fef('0x34')],_0x4e662c[_0x3fef('0x35')]);_0xa1a53d[_0x3fef('0x39')]=_['intersection'](_0x4e662c[_0x3fef('0x34')],qs[_0x3fef('0x3a')](_0x40a206['query'][_0x3fef('0x3a')]));_0xa1a53d[_0x3fef('0x39')]=_0xa1a53d[_0x3fef('0x39')]['length']?_0xa1a53d[_0x3fef('0x39')]:_0x4e662c[_0x3fef('0x34')];if(_0x40a206['query'][_0x3fef('0x44')]){_0xa1a53d['include']=[{'all':!![]}];}_0xa1a53d=_['merge']({},_0xa1a53d,_0x40a206[_0x3fef('0x43')]);return db['VoicePrefix'][_0x3fef('0x49')](_0xa1a53d)[_0x3fef('0x2b')](handleEntityNotFound(_0x59e3b0,null))['then'](respondWithResult(_0x59e3b0,null))[_0x3fef('0x4a')](handleError(_0x59e3b0,null));};exports[_0x3fef('0x29')]=function(_0x2f8bb2,_0x5902b1){return db[_0x3fef('0x31')][_0x3fef('0x49')]({'where':{'id':_0x2f8bb2[_0x3fef('0x48')]['id']}})['then'](handleEntityNotFound(_0x5902b1,null))[_0x3fef('0x2b')](removeEntity(_0x5902b1,null))[_0x3fef('0x4a')](handleError(_0x5902b1,null));};exports[_0x3fef('0x4b')]=function(_0x6a5321,_0x3ae6a7){return db['VoicePrefix'][_0x3fef('0x4b')]()[_0x3fef('0x2b')](respondWithResult(_0x3ae6a7,null))[_0x3fef('0x4a')](handleError(_0x3ae6a7,null));};exports[_0x3fef('0x4c')]=function(_0x3dc5b5,_0x15be93){var _0x3f9d35;return db[_0x3fef('0x4d')][_0x3fef('0x4e')](function(_0x4862a5){return db['VoicePrefix'][_0x3fef('0x4c')](_0x3dc5b5[_0x3fef('0x4f')],{'transaction':_0x4862a5})[_0x3fef('0x2b')](function(_0x29c619){_0x3f9d35=_0x29c619[_0x3fef('0x50')]({'plain':!![]});return db[_0x3fef('0x51')][_0x3fef('0x49')]({'where':{'id':_0x3f9d35[_0x3fef('0x52')]},'raw':!![]})[_0x3fef('0x2b')](function(_0x36e054){return createVoicePrefixExtensions(_0x3f9d35,_0x36e054,_0x4862a5);});});})[_0x3fef('0x2b')](function(){var _0x109fac=_0x3dc5b5['user'][_0x3fef('0x50')]({'plain':!![]});if(!_0x109fac)throw new Error(_0x3fef('0x53'));if(_0x109fac[_0x3fef('0x54')]===_0x3fef('0x55')){var _0x5b0415=_0x3f9d35;return db[_0x3fef('0x56')][_0x3fef('0x49')]({'where':{'name':_0x3fef('0x2a'),'userProfileId':_0x109fac[_0x3fef('0x57')]},'raw':!![]})['then'](function(_0x189d48){if(_0x189d48&&_0x189d48[_0x3fef('0x58')]===0x0){return db[_0x3fef('0x59')]['create']({'name':_0x5b0415['name'],'resourceId':_0x5b0415['id'],'type':_0x189d48[_0x3fef('0x2e')],'sectionId':_0x189d48['id']},{})[_0x3fef('0x2b')](function(){return _0x3f9d35;});}else{return _0x3f9d35;}})[_0x3fef('0x4a')](function(_0x3370ef){logger['error'](_0x3fef('0x5a'),_0x3370ef);throw _0x3370ef;});}return _0x3f9d35;})['then'](respondWithResult(_0x15be93,null))[_0x3fef('0x4a')](handleError(_0x15be93,null));};function Extension(_0x48a329,_0x43b311,_0x4cc6de,_0x155fcb){this[_0x3fef('0x5b')]=_0x3fef('0x5c');this['exten']=_0x48a329;this['app']=_0x4cc6de;this[_0x3fef('0x33')]=_0x3fef('0x5d');this[_0x3fef('0x5e')]=_0x3fef('0x5f');this[_0x3fef('0x60')]=_0x43b311;this[_0x3fef('0x61')]=_0x155fcb;}function createVoicePrefixExtensions(_0x1095b6,_0x2b9a5e,_0x5493a8){return new BPromise(function(_0x12ffca,_0x4b6d74){var _0x5ec4e7=new Extension(formatPrefixName(_0x1095b6[_0x3fef('0x62')]),0x1,_0x3fef('0x63'),_0x3fef('0x64'));_0x5ec4e7[_0x3fef('0x65')]=_0x1095b6['id'];return db[_0x3fef('0x51')][_0x3fef('0x4c')](_0x5ec4e7,{'transaction':_0x5493a8})[_0x3fef('0x2b')](function(_0x187c0f){var _0x62e2c4=_0x187c0f['get']({'plain':!![]});var _0x2d36fd=_['map'](addVoicePrefixExtensions(_0x1095b6,_0x2b9a5e),function(_0xc01327){_0xc01327[_0x3fef('0x52')]=_0x62e2c4['id'];_0xc01327[_0x3fef('0x65')]=_0x1095b6['id'];return _0xc01327;});return db[_0x3fef('0x51')][_0x3fef('0x66')](_0x2d36fd,{'transaction':_0x5493a8})[_0x3fef('0x2b')](function(_0x4a4631){if(!_0x4a4631){return _0x4b6d74(_0x3fef('0x67'));}else{return _0x12ffca(_0x4a4631);}})[_0x3fef('0x4a')](function(_0x3e98fb){return _0x4b6d74(_0x3e98fb);});});;});};function addVoicePrefixExtensions(_0x200d07,_0x6cc4a3){var _0x40bd7e=[];var _0x10b869=formatPrefixName(_0x200d07[_0x3fef('0x62')]);_0x40bd7e[_0x3fef('0x68')](new Extension(_0x10b869,0x2,_0x3fef('0x69'),_0x3fef('0x6a')+_0x200d07['name']));if(_0x200d07[_0x3fef('0x6b')]){_0x40bd7e['push'](new Extension(_0x10b869,0x3,'Set','PREFIX-CALLERIDALL='+_0x200d07[_0x3fef('0x6b')]));}else{_0x40bd7e['push'](new Extension(_0x10b869,0x3,_0x3fef('0x63'),_0x3fef('0x6c')));}_0x40bd7e[_0x3fef('0x68')](new Extension(_0x10b869,0x4,'goto',_0x6cc4a3[_0x3fef('0x5b')]+','+'${EXTEN:'+(0x8+_0x200d07[_0x3fef('0x2e')][_0x3fef('0x3b')])+'}'+','+0x1));return _0x40bd7e;}function formatPrefixName(_0x51ea04){var _0x1d0ae0='_';for(var _0x458583=0x0;_0x458583<_0x51ea04[_0x3fef('0x3b')];_0x458583++){if(_0x51ea04[_0x3fef('0x6d')](_0x458583)=='-'){_0x1d0ae0+=_0x51ea04[_0x3fef('0x6d')](_0x458583);}else{_0x1d0ae0+='['+_0x51ea04[_0x3fef('0x6d')](_0x458583)+']';}}_0x1d0ae0+='.';return _0x1d0ae0;}exports[_0x3fef('0x28')]=function(_0x1362ce,_0x4fde10,_0x25467e){var _0x410951=_0x1362ce[_0x3fef('0x4f')];_0x410951[_0x3fef('0x62')]=_0x3fef('0x6e')+_0x410951[_0x3fef('0x2e')]+'-';return db[_0x3fef('0x4d')][_0x3fef('0x4e')](function(_0xaff567){return db[_0x3fef('0x31')][_0x3fef('0x28')](_0x410951,{'where':{'id':_0x410951['id']},'transaction':_0xaff567})[_0x3fef('0x2b')](function(){return db[_0x3fef('0x51')][_0x3fef('0x29')]({'where':{'VoicePrefixId':_0x410951['id']},'transaction':_0xaff567})['then'](function(){return db[_0x3fef('0x51')][_0x3fef('0x49')]({'where':{'id':_0x410951[_0x3fef('0x52')]},'raw':!![]})['then'](function(_0x5e430a){return createVoicePrefixExtensions(_0x410951,_0x5e430a,_0xaff567);});});});})['then'](function(){return db[_0x3fef('0x31')][_0x3fef('0x6f')](_0x410951['id']);})[_0x3fef('0x2b')](respondWithResult(_0x4fde10,null))[_0x3fef('0x4a')](handleError(_0x4fde10,null));};exports['addAgents']=function(_0x441f1f,_0x17856b,_0x2f9b5f){return db[_0x3fef('0x31')]['find']({'where':{'id':_0x441f1f[_0x3fef('0x48')]['id']}})[_0x3fef('0x2b')](handleEntityNotFound(_0x17856b,null))[_0x3fef('0x2b')](function(_0xf80bab){if(_0xf80bab){return _0xf80bab[_0x3fef('0x70')](_0x441f1f['body'][_0x3fef('0x71')],_['omit'](_0x441f1f[_0x3fef('0x4f')],['ids','id'])||{})[_0x3fef('0x72')](function(_0x13b272){for(var _0x2948c4=0x0;_0x2948c4<_0x441f1f[_0x3fef('0x4f')][_0x3fef('0x71')][_0x3fef('0x3b')];_0x2948c4+=0x1){socket[_0x3fef('0x73')](_0x3fef('0x74'),{'UserId':Number(_0x441f1f[_0x3fef('0x4f')]['ids'][_0x2948c4]),'VoicePrefixId':Number(_0x441f1f[_0x3fef('0x48')]['id'])});}return _0x13b272;});}})[_0x3fef('0x2b')](respondWithResult(_0x17856b,null))[_0x3fef('0x4a')](handleError(_0x17856b,null));};exports[_0x3fef('0x75')]=function(_0x4d8a00,_0x766e5d,_0x244d0b){return db[_0x3fef('0x31')][_0x3fef('0x49')]({'where':{'id':_0x4d8a00[_0x3fef('0x48')]['id']}})[_0x3fef('0x2b')](handleEntityNotFound(_0x766e5d,null))['then'](function(_0x34aecb){if(_0x34aecb){return _0x34aecb[_0x3fef('0x75')](_0x4d8a00[_0x3fef('0x35')][_0x3fef('0x71')])[_0x3fef('0x2b')](function(){if(_[_0x3fef('0x76')](_0x4d8a00['query'][_0x3fef('0x71')])){for(var _0x414bfe=0x0;_0x414bfe<_0x4d8a00[_0x3fef('0x35')][_0x3fef('0x71')][_0x3fef('0x3b')];_0x414bfe+=0x1){socket['emit'](_0x3fef('0x77'),{'UserId':Number(_0x4d8a00[_0x3fef('0x35')][_0x3fef('0x71')][_0x414bfe]),'VoicePrefixId':Number(_0x4d8a00['params']['id'])});}}else{socket[_0x3fef('0x73')](_0x3fef('0x77'),{'UserId':Number(_0x4d8a00[_0x3fef('0x35')]['ids']),'VoicePrefixId':Number(_0x4d8a00['params']['id'])});}});}})[_0x3fef('0x2b')](respondWithStatusCode(_0x766e5d,null))[_0x3fef('0x4a')](handleError(_0x766e5d,null));};exports[_0x3fef('0x78')]=function(_0x25914c,_0x573323,_0x169b33){var _0x1361d2={};var _0x29b668={};var _0x5bf8b7;var _0x1cddf6;return db[_0x3fef('0x31')][_0x3fef('0x79')]({'where':{'id':_0x25914c[_0x3fef('0x48')]['id']}})[_0x3fef('0x2b')](handleEntityNotFound(_0x573323,null))[_0x3fef('0x2b')](function(_0x277f65){if(_0x277f65){_0x5bf8b7=_0x277f65;_0x29b668['model']=_['keys'](db[_0x3fef('0x7a')]['rawAttributes']);_0x29b668[_0x3fef('0x35')]=_[_0x3fef('0x36')](_0x25914c[_0x3fef('0x35')]);_0x29b668['filters']=_[_0x3fef('0x38')](_0x29b668['model'],_0x29b668[_0x3fef('0x35')]);_0x1361d2['attributes']=_['intersection'](_0x29b668['model'],qs[_0x3fef('0x3a')](_0x25914c[_0x3fef('0x35')][_0x3fef('0x3a')]));_0x1361d2[_0x3fef('0x39')]=_0x1361d2[_0x3fef('0x39')][_0x3fef('0x3b')]?_0x1361d2[_0x3fef('0x39')]:_0x29b668['model'];_0x1361d2[_0x3fef('0x3d')]=qs[_0x3fef('0x3e')](_0x25914c[_0x3fef('0x35')]['sort']);_0x1361d2[_0x3fef('0x3f')]=qs[_0x3fef('0x37')](_[_0x3fef('0x7b')](_0x25914c[_0x3fef('0x35')],_0x29b668['filters']));if(_0x25914c[_0x3fef('0x35')]['filter']){_0x1361d2[_0x3fef('0x3f')]=_[_0x3fef('0x41')](_0x1361d2[_0x3fef('0x3f')],{'$or':_[_0x3fef('0x30')](_0x1361d2[_0x3fef('0x39')],function(_0x1804a5){var _0x3100c3={};_0x3100c3[_0x1804a5]={'$like':'%'+_0x25914c[_0x3fef('0x35')]['filter']+'%'};return _0x3100c3;})});}_0x1361d2=_[_0x3fef('0x41')]({},_0x1361d2,_0x25914c['options']);return _0x5bf8b7['getAgents'](_0x1361d2);}})[_0x3fef('0x2b')](function(_0x1b9cdc){if(_0x1b9cdc){_0x1cddf6=_0x1b9cdc[_0x3fef('0x3b')];if(!_0x25914c[_0x3fef('0x35')]['hasOwnProperty'](_0x3fef('0x3c'))){_0x1361d2[_0x3fef('0x22')]=qs[_0x3fef('0x22')](_0x25914c[_0x3fef('0x35')]['limit']);_0x1361d2[_0x3fef('0x24')]=qs[_0x3fef('0x24')](_0x25914c[_0x3fef('0x35')][_0x3fef('0x24')]);}return _0x5bf8b7[_0x3fef('0x78')](_0x1361d2);}})['then'](function(_0x27fd0b){if(_0x27fd0b){return _0x27fd0b?{'count':_0x1cddf6,'rows':_0x27fd0b}:null;}})[_0x3fef('0x2b')](respondWithResult(_0x573323,null))[_0x3fef('0x4a')](handleError(_0x573323,null));};exports[_0x3fef('0x7c')]=function(_0x14e142,_0x5894f5,_0xe6a6b7){var _0x26b1c0={};var _0x2000b2={};var _0x44310b;var _0x400fff;return db['VoicePrefix'][_0x3fef('0x79')]({'where':{'id':_0x14e142[_0x3fef('0x48')]['id']}})[_0x3fef('0x2b')](handleEntityNotFound(_0x5894f5,null))[_0x3fef('0x2b')](function(_0x1a5f47){if(_0x1a5f47){_0x44310b=_0x1a5f47;_0x2000b2[_0x3fef('0x34')]=_['keys'](db['Team']['rawAttributes']);_0x2000b2['query']=_['keys'](_0x14e142[_0x3fef('0x35')]);_0x2000b2[_0x3fef('0x37')]=_[_0x3fef('0x38')](_0x2000b2[_0x3fef('0x34')],_0x2000b2[_0x3fef('0x35')]);_0x26b1c0['attributes']=_[_0x3fef('0x38')](_0x2000b2[_0x3fef('0x34')],qs[_0x3fef('0x3a')](_0x14e142[_0x3fef('0x35')][_0x3fef('0x3a')]));_0x26b1c0[_0x3fef('0x39')]=_0x26b1c0[_0x3fef('0x39')]['length']?_0x26b1c0[_0x3fef('0x39')]:_0x2000b2['model'];_0x26b1c0[_0x3fef('0x3d')]=qs[_0x3fef('0x3e')](_0x14e142[_0x3fef('0x35')][_0x3fef('0x3e')]);_0x26b1c0[_0x3fef('0x3f')]=qs[_0x3fef('0x37')](_[_0x3fef('0x7b')](_0x14e142['query'],_0x2000b2['filters']));if(_0x14e142['query']['filter']){_0x26b1c0[_0x3fef('0x3f')]=_[_0x3fef('0x41')](_0x26b1c0[_0x3fef('0x3f')],{'$or':_[_0x3fef('0x30')](_0x26b1c0[_0x3fef('0x39')],function(_0x580a23){var _0x8d6d0e={};_0x8d6d0e[_0x580a23]={'$like':'%'+_0x14e142[_0x3fef('0x35')][_0x3fef('0x40')]+'%'};return _0x8d6d0e;})});}_0x26b1c0=_['merge']({},_0x26b1c0,_0x14e142[_0x3fef('0x43')]);return _0x44310b[_0x3fef('0x7c')](_0x26b1c0);}})['then'](function(_0x59654f){if(_0x59654f){_0x400fff=_0x59654f[_0x3fef('0x3b')];if(!_0x14e142['query'][_0x3fef('0x7d')](_0x3fef('0x3c'))){_0x26b1c0['limit']=qs[_0x3fef('0x22')](_0x14e142[_0x3fef('0x35')][_0x3fef('0x22')]);_0x26b1c0['offset']=qs[_0x3fef('0x24')](_0x14e142[_0x3fef('0x35')]['offset']);}return _0x44310b[_0x3fef('0x7c')](_0x26b1c0);}})[_0x3fef('0x2b')](function(_0xb08e2c){if(_0xb08e2c){return _0xb08e2c?{'count':_0x400fff,'rows':_0xb08e2c}:null;}})[_0x3fef('0x2b')](respondWithResult(_0x5894f5,null))['catch'](handleError(_0x5894f5,null));};exports['addTeams']=function(_0x91a872,_0x5ce3d8,_0x15cc4f){var _0x11a3d3=_0x91a872[_0x3fef('0x4f')][_0x3fef('0x71')];var _0x4e4a3c;return db[_0x3fef('0x7e')][_0x3fef('0x46')]({'where':{'id':_0x11a3d3},'attributes':['id'],'include':[{'model':db[_0x3fef('0x7a')],'as':_0x3fef('0x7f'),'attributes':['id','name',_0x3fef('0x80'),'voicePause',_0x3fef('0x81')],'raw':!![]}]})[_0x3fef('0x2b')](function(_0x578303){if(_0x578303){_0x4e4a3c=_0x578303;var _0x4c575a=_[_0x3fef('0x82')](_0x578303,function(_0xee8848){var _0x5089f2=_0xee8848[_0x3fef('0x50')]({'plain':!![]});return _0x5089f2[_0x3fef('0x7f')];});return db['VoicePrefix']['find']({'where':{'id':_0x91a872[_0x3fef('0x48')]['id']}})[_0x3fef('0x2b')](function(_0x5e5b34){return db[_0x3fef('0x4d')][_0x3fef('0x4e')](function(_0x14c4bb){return _0x5e5b34['addTeams'](_0x11a3d3,{'transaction':_0x14c4bb})[_0x3fef('0x2b')](function(){return BPromise[_0x3fef('0x83')](_0x4e4a3c,function(_0x349180){return db[_0x3fef('0x84')][_0x3fef('0x85')]({'TeamId':_0x349180['id'],'VoicePrefixId':_0x91a872['params']['id']},{'transaction':_0x14c4bb});});})[_0x3fef('0x2b')](function(){return BPromise[_0x3fef('0x83')](_0x4c575a,function(_0x45ab57){return db['UserVoicePrefix'][_0x3fef('0x86')]({'where':{'UserId':_0x45ab57['id'],'VoicePrefixId':_0x91a872['params']['id']},'transaction':_0x14c4bb});});})['then'](function(){_0x4c575a[_0x3fef('0x87')](function(_0x1d43ba){socket['emit'](_0x3fef('0x74'),{'UserId':_0x1d43ba['id'],'VoicePrefixId':_0x5e5b34['id']});});});});});}})[_0x3fef('0x2b')](respondWithStatusCode(_0x5ce3d8,null))['catch'](handleError(_0x5ce3d8,null));};exports['removeTeams']=function(_0x373a45,_0x1a792b,_0x34e182){return db['Team'][_0x3fef('0x46')]({'where':{'id':_0x373a45[_0x3fef('0x35')][_0x3fef('0x71')]},'attributes':['id'],'include':[{'model':db[_0x3fef('0x7a')],'as':_0x3fef('0x7f'),'attributes':['id'],'raw':!![]}]})[_0x3fef('0x2b')](handleEntityNotFound(_0x1a792b,null))[_0x3fef('0x2b')](function(_0x114585){var _0x4725dd=_[_0x3fef('0x30')](_0x114585,'id');var _0x3b9285=[];var _0x550ba3=[];var _0x778837=squel[_0x3fef('0x88')]();_0x778837[_0x3fef('0x89')](_0x3fef('0x8a'))['from'](_0x3fef('0x8b'),'tq')[_0x3fef('0x8c')](_0x3fef('0x8d'),'ut',_0x3fef('0x8e'))['where']('VoicePrefixId\x20=\x20?',_0x373a45[_0x3fef('0x48')]['id']);for(var _0x9110ca=0x0;_0x9110ca<_0x114585[_0x3fef('0x3b')];_0x9110ca+=0x1){let _0x2bb28c=_0x114585[_0x9110ca];for(var _0x99fa04=0x0;_0x99fa04<_0x2bb28c['Agents'][_0x3fef('0x3b')];_0x99fa04+=0x1){let _0x2aa67e=_0x2bb28c['Agents'][_0x99fa04];var _0x541b46=_0x778837[_0x3fef('0x8f')]();_0x541b46[_0x3fef('0x3f')](_0x3fef('0x90'),_0x2aa67e['id']);_0x550ba3[_0x3fef('0x68')](db[_0x3fef('0x4d')][_0x3fef('0x35')](_0x541b46['toString'](),{'type':db['sequelize'][_0x3fef('0x91')]['SELECT']})[_0x3fef('0x2b')](function(_0x18afc9){if(_0x18afc9[_0x3fef('0x3b')]===0x1){return _0x2aa67e['id'];}else{var _0x5b6489=_[_0x3fef('0x92')](_[_0x3fef('0x30')](_0x18afc9,_0x3fef('0x93')),function(_0x259fc1){return _['includes'](_0x4725dd,_0x259fc1);});if(_0x5b6489){return _0x2aa67e['id'];}}}));}}return BPromise[_0x3fef('0x94')](_0x550ba3)[_0x3fef('0x2b')](function(_0x37b1a3){_0x3b9285=_(_0x3b9285)[_0x3fef('0x95')](_0x37b1a3)['compact']()[_0x3fef('0x96')]();return db[_0x3fef('0x31')][_0x3fef('0x49')]({'where':{'id':_0x373a45[_0x3fef('0x48')]['id']}})[_0x3fef('0x2b')](function(_0x446bab){return db[_0x3fef('0x4d')][_0x3fef('0x4e')](function(_0x2eddc5){return _0x446bab['removeTeams'](_0x373a45['query'][_0x3fef('0x71')],{'transaction':_0x2eddc5})[_0x3fef('0x2b')](function(){if(!_[_0x3fef('0x97')](_0x3b9285)){return _0x446bab[_0x3fef('0x75')](_0x3b9285,{'transaction':_0x2eddc5});}})['then'](function(){_0x3b9285[_0x3fef('0x87')](function(_0x2e642d){socket[_0x3fef('0x73')]('userVoicePrefix:remove',{'UserId':_0x2e642d,'VoicePrefixId':_0x446bab['id']});});});});});});})[_0x3fef('0x2b')](respondWithStatusCode(_0x1a792b,null))['catch'](handleError(_0x1a792b,null));};
\ No newline at end of file
index 5c2e36a..7ce62fb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x50fc=['hook','exports','VoicePrefix','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x50fc,0x10a));var _0xc50f=function(_0x463376,_0x13871c){_0x463376=_0x463376-0x0;var _0x336ccd=_0x50fc[_0x463376];return _0x336ccd;};'use strict';var EventEmitter=require('events');var VoicePrefix=require('../../mysqldb')['db'][_0xc50f('0x0')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0xc50f('0x1')](0x0);var events={'afterCreate':_0xc50f('0x2'),'afterUpdate':_0xc50f('0x3'),'afterDestroy':'remove'};function emitEvent(_0x49f386){return function(_0x2368f4,_0x54256d,_0x2cba76){VoicePrefixEvents['emit'](_0x49f386+':'+_0x2368f4['id'],_0x2368f4);VoicePrefixEvents[_0xc50f('0x4')](_0x49f386,_0x2368f4);_0x2cba76(null);};}for(var e in events){if(events[_0xc50f('0x5')](e)){var event=events[e];VoicePrefix[_0xc50f('0x6')](e,emitEvent(event));}}module[_0xc50f('0x7')]=VoicePrefixEvents;
\ No newline at end of file
+var _0xff16=['../../mysqldb','VoicePrefix','setMaxListeners','remove','emit','hasOwnProperty','exports','events'];(function(_0x1dcf04,_0x1be406){var _0x3a08df=function(_0x3e987a){while(--_0x3e987a){_0x1dcf04['push'](_0x1dcf04['shift']());}};_0x3a08df(++_0x1be406);}(_0xff16,0x167));var _0x6ff1=function(_0x2d7374,_0x1f5726){_0x2d7374=_0x2d7374-0x0;var _0x236bf2=_0xff16[_0x2d7374];return _0x236bf2;};'use strict';var EventEmitter=require(_0x6ff1('0x0'));var VoicePrefix=require(_0x6ff1('0x1'))['db'][_0x6ff1('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x6ff1('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x6ff1('0x4')};function emitEvent(_0x2fce62){return function(_0x5633a1,_0x4576bb,_0x1a14a3){VoicePrefixEvents[_0x6ff1('0x5')](_0x2fce62+':'+_0x5633a1['id'],_0x5633a1);VoicePrefixEvents[_0x6ff1('0x5')](_0x2fce62,_0x5633a1);_0x1a14a3(null);};}for(var e in events){if(events[_0x6ff1('0x6')](e)){var event=events[e];VoicePrefix['hook'](e,emitEvent(event));}}module[_0x6ff1('0x7')]=VoicePrefixEvents;
\ No newline at end of file
index 4458aac..6a83f79 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x88b1=['VoicePrefix','voice_prefixes','lodash','util','path','../../config/environment','./voicePrefix.attributes','define'];(function(_0x444ca7,_0x5acdf6){var _0x38ead7=function(_0x2c158e){while(--_0x2c158e){_0x444ca7['push'](_0x444ca7['shift']());}};_0x38ead7(++_0x5acdf6);}(_0x88b1,0xb2));var _0x188b=function(_0x501bc3,_0x1f5336){_0x501bc3=_0x501bc3-0x0;var _0x52de59=_0x88b1[_0x501bc3];return _0x52de59;};'use strict';var _=require(_0x188b('0x0'));var util=require(_0x188b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x188b('0x2'));var rimraf=require('rimraf');var config=require(_0x188b('0x3'));var attributes=require(_0x188b('0x4'));module['exports']=function(_0x5169b8,_0x134f55){return _0x5169b8[_0x188b('0x5')](_0x188b('0x6'),attributes,{'tableName':_0x188b('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x034d=['define','VoicePrefix','voice_prefixes','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','./voicePrefix.attributes','exports'];(function(_0x196555,_0x368ed4){var _0x556a6d=function(_0x15ff63){while(--_0x15ff63){_0x196555['push'](_0x196555['shift']());}};_0x556a6d(++_0x368ed4);}(_0x034d,0xab));var _0xd034=function(_0x445b71,_0x4a4bc5){_0x445b71=_0x445b71-0x0;var _0x816452=_0x034d[_0x445b71];return _0x816452;};'use strict';var _=require(_0xd034('0x0'));var util=require(_0xd034('0x1'));var logger=require(_0xd034('0x2'))(_0xd034('0x3'));var moment=require('moment');var BPromise=require(_0xd034('0x4'));var rp=require(_0xd034('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd034('0x6'));var config=require('../../config/environment');var attributes=require(_0xd034('0x7'));module[_0xd034('0x8')]=function(_0xfe7cdb,_0x291bf1){return _0xfe7cdb[_0xd034('0x9')](_0xd034('0xa'),attributes,{'tableName':_0xd034('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 6033a25..3887f08 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb5f3=['info','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','./voicePrefix.socket','register','request','then','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','code','VoicePrefix,\x20%s,\x20%s','message'];(function(_0x21da2f,_0x5f58a4){var _0x21da2b=function(_0x548601){while(--_0x548601){_0x21da2f['push'](_0x21da2f['shift']());}};_0x21da2b(++_0x5f58a4);}(_0xb5f3,0x137));var _0x3b5f=function(_0x200aa5,_0x197802){_0x200aa5=_0x200aa5-0x0;var _0x458200=_0xb5f3[_0x200aa5];return _0x458200;};'use strict';var _=require(_0x3b5f('0x0'));var util=require(_0x3b5f('0x1'));var moment=require(_0x3b5f('0x2'));var BPromise=require('bluebird');var rs=require(_0x3b5f('0x3'));var fs=require('fs');var Redis=require(_0x3b5f('0x4'));var db=require(_0x3b5f('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3b5f('0x6'));var config=require(_0x3b5f('0x7'));var jayson=require(_0x3b5f('0x8'));var client=jayson[_0x3b5f('0x9')]['http']({'port':0x232a});config[_0x3b5f('0xa')]=_[_0x3b5f('0xb')](config['redis'],{'host':_0x3b5f('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3b5f('0xa')]));require(_0x3b5f('0xd'))[_0x3b5f('0xe')](socket);function respondWithRpcPromise(_0xfa2a4d,_0x5f5a5f,_0x13be1a){return new BPromise(function(_0x3d33cb,_0x158ac9){return client[_0x3b5f('0xf')](_0xfa2a4d,_0x13be1a)[_0x3b5f('0x10')](function(_0x57267a){logger['info']('VoicePrefix,\x20%s,\x20%s',_0x5f5a5f,_0x3b5f('0x11'));logger[_0x3b5f('0x12')](_0x3b5f('0x13'),_0x5f5a5f,_0x3b5f('0x11'),JSON[_0x3b5f('0x14')](_0x57267a));if(_0x57267a[_0x3b5f('0x15')]){if(_0x57267a[_0x3b5f('0x15')][_0x3b5f('0x16')]===0x1f4){logger['error'](_0x3b5f('0x17'),_0x5f5a5f,_0x57267a[_0x3b5f('0x15')][_0x3b5f('0x18')]);return _0x158ac9(_0x57267a['error'][_0x3b5f('0x18')]);}logger['error'](_0x3b5f('0x17'),_0x5f5a5f,_0x57267a[_0x3b5f('0x15')]['message']);return _0x3d33cb(_0x57267a[_0x3b5f('0x15')][_0x3b5f('0x18')]);}else{logger[_0x3b5f('0x19')](_0x3b5f('0x17'),_0x5f5a5f,'request\x20sent');_0x3d33cb(_0x57267a[_0x3b5f('0x1a')]['message']);}})[_0x3b5f('0x1b')](function(_0x19d6fe){logger[_0x3b5f('0x15')]('VoicePrefix,\x20%s,\x20%s',_0x5f5a5f,_0x19d6fe);_0x158ac9(_0x19d6fe);});});}
\ No newline at end of file
+var _0xeda7=['redis','defaults','localhost','socket.io-emitter','register','request','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x1ee3e6,_0x3ef99f){var _0x4464f9=function(_0x45da00){while(--_0x45da00){_0x1ee3e6['push'](_0x1ee3e6['shift']());}};_0x4464f9(++_0x3ef99f);}(_0xeda7,0x196));var _0x7eda=function(_0x49d41c,_0x2bdc35){_0x49d41c=_0x49d41c-0x0;var _0xb64c5f=_0xeda7[_0x49d41c];return _0xb64c5f;};'use strict';var _=require(_0x7eda('0x0'));var util=require(_0x7eda('0x1'));var moment=require(_0x7eda('0x2'));var BPromise=require(_0x7eda('0x3'));var rs=require(_0x7eda('0x4'));var fs=require('fs');var Redis=require(_0x7eda('0x5'));var db=require(_0x7eda('0x6'))['db'];var utils=require(_0x7eda('0x7'));var logger=require(_0x7eda('0x8'))(_0x7eda('0x9'));var config=require(_0x7eda('0xa'));var jayson=require(_0x7eda('0xb'));var client=jayson[_0x7eda('0xc')][_0x7eda('0xd')]({'port':0x232a});config[_0x7eda('0xe')]=_[_0x7eda('0xf')](config[_0x7eda('0xe')],{'host':_0x7eda('0x10'),'port':0x18eb});var socket=require(_0x7eda('0x11'))(new Redis(config[_0x7eda('0xe')]));require('./voicePrefix.socket')[_0x7eda('0x12')](socket);function respondWithRpcPromise(_0x506476,_0x4f69a7,_0x1a0e32){return new BPromise(function(_0x177458,_0x3dfcdb){return client[_0x7eda('0x13')](_0x506476,_0x1a0e32)['then'](function(_0x53792a){logger[_0x7eda('0x14')](_0x7eda('0x15'),_0x4f69a7,_0x7eda('0x16'));logger[_0x7eda('0x17')]('VoicePrefix,\x20%s,\x20%s,\x20%s',_0x4f69a7,_0x7eda('0x16'),JSON['stringify'](_0x53792a));if(_0x53792a[_0x7eda('0x18')]){if(_0x53792a[_0x7eda('0x18')][_0x7eda('0x19')]===0x1f4){logger[_0x7eda('0x18')](_0x7eda('0x15'),_0x4f69a7,_0x53792a[_0x7eda('0x18')][_0x7eda('0x1a')]);return _0x3dfcdb(_0x53792a[_0x7eda('0x18')][_0x7eda('0x1a')]);}logger['error']('VoicePrefix,\x20%s,\x20%s',_0x4f69a7,_0x53792a[_0x7eda('0x18')]['message']);return _0x177458(_0x53792a['error'][_0x7eda('0x1a')]);}else{logger[_0x7eda('0x14')](_0x7eda('0x15'),_0x4f69a7,_0x7eda('0x16'));_0x177458(_0x53792a[_0x7eda('0x1b')]['message']);}})['catch'](function(_0x5dc833){logger[_0x7eda('0x18')]('VoicePrefix,\x20%s,\x20%s',_0x4f69a7,_0x5dc833);_0x3dfcdb(_0x5dc833);});});}
\ No newline at end of file
index b68560c..54115ad 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6308=['emit','length','voicePrefix:','./voicePrefix.events','remove'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x6308,0x1f2));var _0x8630=function(_0x3de8a4,_0x289a5c){_0x3de8a4=_0x3de8a4-0x0;var _0x4635cf=_0x6308[_0x3de8a4];return _0x4635cf;};'use strict';var VoicePrefixEvents=require(_0x8630('0x0'));var events=['save',_0x8630('0x1'),'update'];function createListener(_0x54a006,_0x315284){return function(_0x1ba5a4){_0x315284[_0x8630('0x2')](_0x54a006,_0x1ba5a4);};}function removeListener(_0x393f45,_0xd3ae17){return function(){VoicePrefixEvents['removeListener'](_0x393f45,_0xd3ae17);};}exports['register']=function(_0x1d62c8){for(var _0x571543=0x0,_0x337086=events[_0x8630('0x3')];_0x571543<_0x337086;_0x571543++){var _0x1bcfea=events[_0x571543];var _0x2b87ea=createListener(_0x8630('0x4')+_0x1bcfea,_0x1d62c8);VoicePrefixEvents['on'](_0x1bcfea,_0x2b87ea);}};
\ No newline at end of file
+var _0x1b32=['save','remove','update','emit','removeListener','register','length'];(function(_0xd23930,_0xed8238){var _0x2909c4=function(_0x2d5e83){while(--_0x2d5e83){_0xd23930['push'](_0xd23930['shift']());}};_0x2909c4(++_0xed8238);}(_0x1b32,0x85));var _0x21b3=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0x1b32[_0x2dadb9];return _0x2f0097;};'use strict';var VoicePrefixEvents=require('./voicePrefix.events');var events=[_0x21b3('0x0'),_0x21b3('0x1'),_0x21b3('0x2')];function createListener(_0x776353,_0xa6a010){return function(_0x2f43c5){_0xa6a010[_0x21b3('0x3')](_0x776353,_0x2f43c5);};}function removeListener(_0x2aba68,_0x34fdac){return function(){VoicePrefixEvents[_0x21b3('0x4')](_0x2aba68,_0x34fdac);};}exports[_0x21b3('0x5')]=function(_0x403803){for(var _0x37859f=0x0,_0x47516a=events[_0x21b3('0x6')];_0x37859f<_0x47516a;_0x37859f++){var _0x5c0f36=events[_0x37859f];var _0x45b1b7=createListener('voicePrefix:'+_0x5c0f36,_0x403803);VoicePrefixEvents['on'](_0x5c0f36,_0x45b1b7);}};
\ No newline at end of file
index 6ef9308..457019a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['addAgents','/:id/blacklists','addBlackLists','update','delete','destroy','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','/:id','getHoppers','/:id/hopper_histories','isAuthenticated','getHopperHistories','/:id/hopper_black','getHopperBlacks','/:id/teams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','getLists','post','create','/:id/clone','clone','addTeams'];(function(_0x4f1c05,_0x4cdf88){var _0x530236=function(_0x358e60){while(--_0x358e60){_0x4f1c05['push'](_0x4f1c05['shift']());}};_0x530236(++_0x4cdf88);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xa9e0[_0x5ddb1c];return _0x354adc;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/hoppers',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/hopper_finals',auth['isAuthenticated'](),controller['getHopperFinals']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getTeams']);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('0x8')]('/:id/blacklists',auth[_0x0a9e('0xd')](),controller['getBlackLists']);router[_0x0a9e('0x18')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x18')](_0x0a9e('0x1a'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x18')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router[_0x0a9e('0x18')]('/:id/users',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1d')]);router['post'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller['addLists']);router[_0x0a9e('0x18')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x22')]);router['delete']('/:id/teams',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router[_0x0a9e('0x21')](_0x0a9e('0x12'),auth['isAuthenticated'](),controller[_0x0a9e('0x24')]);router['delete'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x25')]);router[_0x0a9e('0x21')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x26')]);module[_0x0a9e('0x27')]=router;
\ No newline at end of file
+var _0xa9e0=['addAgents','/:id/blacklists','addBlackLists','update','delete','destroy','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','/:id','getHoppers','/:id/hopper_histories','isAuthenticated','getHopperHistories','/:id/hopper_black','getHopperBlacks','/:id/teams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','getLists','post','create','/:id/clone','clone','addTeams'];(function(_0x43e7c4,_0x24fb15){var _0x4685d9=function(_0x223a94){while(--_0x223a94){_0x43e7c4['push'](_0x43e7c4['shift']());}};_0x4685d9(++_0x24fb15);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0xa9e0[_0x1cfa0d];return _0xe33279;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));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/hoppers',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/hopper_finals',auth['isAuthenticated'](),controller['getHopperFinals']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getTeams']);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('0x8')]('/:id/blacklists',auth[_0x0a9e('0xd')](),controller['getBlackLists']);router[_0x0a9e('0x18')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x18')](_0x0a9e('0x1a'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x18')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router[_0x0a9e('0x18')]('/:id/users',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1d')]);router['post'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller['addLists']);router[_0x0a9e('0x18')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x22')]);router['delete']('/:id/teams',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router[_0x0a9e('0x21')](_0x0a9e('0x12'),auth['isAuthenticated'](),controller[_0x0a9e('0x24')]);router['delete'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x25')]);router[_0x0a9e('0x21')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x26')]);module[_0x0a9e('0x27')]=router;
\ No newline at end of file
index f20512b..c10a0d9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc0be=['outbound','default','ringall','leastrecent','rrmemory','linear','rrordered','setDataValue','strategy','getDataValue','type','dialMethod','booked','roundrobin','predictive','power','INTEGER','yes','once','TEXT','periodic_announce','join','split','joinempty','leavewhenempty','acw','wrapuptime','Active/Disactive\x20Campaign','preview','progressive','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','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)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','always','never','BOOLEAN','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Min\x20Word\x20Length','#AMD\x20Maximum\x20Word\x20Length','Active/Disactive\x20Recall\x20In\x20Queue','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,<project_name>)','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\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)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','mandatoryDisposition','exports','STRING','name','ENUM','inbound'];(function(_0xae7c2f,_0xf31e04){var _0x5d7001=function(_0x4eeadb){while(--_0x4eeadb){_0xae7c2f['push'](_0xae7c2f['shift']());}};_0x5d7001(++_0xf31e04);}(_0xc0be,0x97));var _0xec0b=function(_0x312fee,_0x577c41){_0x312fee=_0x312fee-0x0;var _0x5a221e=_0xc0be[_0x312fee];return _0x5a221e;};'use strict';var Sequelize=require('sequelize');module[_0xec0b('0x0')]={'name':{'type':Sequelize[_0xec0b('0x1')],'allowNull':![],'unique':_0xec0b('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xec0b('0x3')](_0xec0b('0x4'),_0xec0b('0x5')),'allowNull':![],'defaultValue':_0xec0b('0x4')},'musiconhold':{'type':Sequelize[_0xec0b('0x1')],'defaultValue':_0xec0b('0x6')},'announce':{'type':Sequelize[_0xec0b('0x1')],'defaultValue':''},'strategy':{'type':Sequelize[_0xec0b('0x3')]('rr',_0xec0b('0x7'),_0xec0b('0x8'),'fewestcalls','random',_0xec0b('0x9'),_0xec0b('0xa'),'wrandom',_0xec0b('0xb')),'allowNull':![],'defaultValue':_0xec0b('0x7'),'set':function(_0x27e6c4){this[_0xec0b('0xc')](_0xec0b('0xd'),_0x27e6c4?_0x27e6c4:_0xec0b('0x9'));},'get':function(){var _0x3ded0d=this[_0xec0b('0xe')](_0xec0b('0xf'));var _0x2c9ae4=this[_0xec0b('0xe')](_0xec0b('0x10'));var _0x2c3e7f=this['getDataValue'](_0xec0b('0xd'));if(_0x3ded0d===_0xec0b('0x4')){return _0x2c3e7f;}if(_0x2c9ae4==='booked'&&_0x2c3e7f===_0xec0b('0x9')||_0x2c9ae4===_0xec0b('0x11')&&_0x2c3e7f===_0xec0b('0x12')){return _0x2c3e7f;}if(_0x2c9ae4==='progressive'||_0x2c9ae4===_0xec0b('0x13')||_0x2c9ae4===_0xec0b('0x14')){return _0x2c3e7f;}return null;}},'servicelevel':{'type':Sequelize[_0xec0b('0x15')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0xec0b('0x1')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0xec0b('0x15')](0xb)},'timeout':{'type':Sequelize[_0xec0b('0x15')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize['STRING']},'weight':{'type':Sequelize[_0xec0b('0x15')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0xec0b('0x15')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0xec0b('0x3')](_0xec0b('0x16'),'no'),'defaultValue':_0xec0b('0x16')},'autopause':{'type':Sequelize[_0xec0b('0x3')](_0xec0b('0x16'),'no','all'),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0xec0b('0x15')](0xb)},'autopausebusy':{'type':Sequelize['ENUM'](_0xec0b('0x16'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0xec0b('0x3')](_0xec0b('0x16'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0xec0b('0x15')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0xec0b('0x3')]('yes','no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0xec0b('0x3')](_0xec0b('0x16'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize['ENUM'](_0xec0b('0x16'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0xec0b('0x1')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0xec0b('0x1')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0xec0b('0x15')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0xec0b('0x15')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0xec0b('0x15')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0xec0b('0x3')](_0xec0b('0x16'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0xec0b('0x3')](_0xec0b('0x16'),'no'),'defaultValue':_0xec0b('0x16')},'announce_holdtime':{'type':Sequelize[_0xec0b('0x3')]('yes','no',_0xec0b('0x17')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0xec0b('0x1')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0xec0b('0x3')]('yes','no')},'announce_position_limit':{'type':Sequelize['INTEGER'](0xb)},'announce_round_seconds':{'type':Sequelize[_0xec0b('0x3')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize['STRING'],'defaultValue':''},'monitor_type':{'type':Sequelize[_0xec0b('0x1')]},'queue_youarenext':{'type':Sequelize[_0xec0b('0x1')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0xec0b('0x1')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize['STRING'],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0xec0b('0x1')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0xec0b('0x1')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0xec0b('0x1')],'defaultValue':null},'queue_seconds':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0xec0b('0x1')],'defaultValue':null},'queue_reporthold':{'type':Sequelize['STRING']},'queue_quantity1':{'type':Sequelize[_0xec0b('0x1')]},'queue_quantity2':{'type':Sequelize['STRING']},'queue_periodic_announce':{'type':Sequelize[_0xec0b('0x1')]},'queue_less_than':{'type':Sequelize['STRING']},'periodic_announce':{'type':Sequelize[_0xec0b('0x18')],'set':function(_0x56909f){this['setDataValue'](_0xec0b('0x19'),_0x56909f?_0x56909f[_0xec0b('0x1a')](','):[]);},'get':function(){return this[_0xec0b('0xe')](_0xec0b('0x19'))?this[_0xec0b('0xe')](_0xec0b('0x19'))[_0xec0b('0x1b')](','):[];}},'joinempty':{'type':Sequelize[_0xec0b('0x1')],'defaultValue':_0xec0b('0x16'),'set':function(_0x54e1ea){this[_0xec0b('0xc')]('joinempty',_0x54e1ea?_0x54e1ea[_0xec0b('0x1a')](','):undefined);},'get':function(){return this['getDataValue'](_0xec0b('0x1c'))?this[_0xec0b('0xe')](_0xec0b('0x1c'))['split'](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0xec0b('0x1')],'defaultValue':'no','set':function(_0x97f56a){this[_0xec0b('0xc')](_0xec0b('0x1d'),_0x97f56a?_0x97f56a[_0xec0b('0x1a')](','):undefined);},'get':function(){return this[_0xec0b('0xe')]('leavewhenempty')?this[_0xec0b('0xe')]('leavewhenempty')[_0xec0b('0x1b')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0xec0b('0x3')](_0xec0b('0x16'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0xec0b('0x3')](_0xec0b('0x16'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0xec0b('0x3')](_0xec0b('0x16'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xec0b('0x1')]},'acw':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'set':function(_0xdc35fd){this[_0xec0b('0xc')](_0xec0b('0x1e'),_0xdc35fd);if(_0xdc35fd){if(this['getDataValue'](_0xec0b('0x1f'))<0x2){this['setDataValue'](_0xec0b('0x1f'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0xec0b('0x15')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xec0b('0x20')},'dialMethod':{'type':Sequelize[_0xec0b('0x3')](_0xec0b('0x21'),'progressive','power',_0xec0b('0x13'),'booked'),'defaultValue':_0xec0b('0x22'),'comment':_0xec0b('0x23')},'dialLimitChannel':{'type':Sequelize[_0xec0b('0x15')](0x4)[_0xec0b('0x24')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xec0b('0x25')},'dialLimitQueue':{'type':Sequelize[_0xec0b('0x15')](0x4)[_0xec0b('0x24')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xec0b('0x26')},'dialPowerLevel':{'type':Sequelize[_0xec0b('0x27')](0x2)['UNSIGNED'],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':'Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).'},'dialPredictiveOptimization':{'type':Sequelize[_0xec0b('0x3')](_0xec0b('0x28'),_0xec0b('0x29')),'defaultValue':_0xec0b('0x29'),'comment':_0xec0b('0x2a')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0xec0b('0x27')](0x2)[_0xec0b('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0xec0b('0x2b')},'dialPredictiveInterval':{'type':Sequelize[_0xec0b('0x15')](0x3)[_0xec0b('0x24')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0xec0b('0x2c')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xec0b('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0xec0b('0x15')](0x3)[_0xec0b('0x24')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xec0b('0x2d')},'dialQueueOptions':{'type':Sequelize[_0xec0b('0x1')],'defaultValue':_0xec0b('0x2e'),'comment':_0xec0b('0x2f')},'dialQueueTimeout':{'type':Sequelize[_0xec0b('0x15')](0x3)[_0xec0b('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xec0b('0x30')},'dialQueueProject':{'type':Sequelize[_0xec0b('0x1')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,<project_name>)'},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xec0b('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0xec0b('0x15')](0x5)[_0xec0b('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xec0b('0x31')},'dialBusyRetryFrequency':{'type':Sequelize[_0xec0b('0x15')](0x5)[_0xec0b('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xec0b('0x32')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xec0b('0x15')](0x3)[_0xec0b('0x24')],'defaultValue':0x3,'comment':_0xec0b('0x33')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xec0b('0x15')](0x5)[_0xec0b('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xec0b('0x34')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xec0b('0x1')],'defaultValue':'07:00-22:00,*,*,*'},'dialPrefix':{'type':Sequelize[_0xec0b('0x1')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0xec0b('0x35'),_0xec0b('0x36'),'onlyIfOpen'),'defaultValue':_0xec0b('0x35')},'dialAMDActive':{'type':Sequelize[_0xec0b('0x37')],'defaultValue':0x0,'comment':_0xec0b('0x38')},'dialAMDInitialSilence':{'type':Sequelize[_0xec0b('0x15')](0x9)[_0xec0b('0x24')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xec0b('0x39')},'dialAMDGreeting':{'type':Sequelize[_0xec0b('0x15')](0x9)[_0xec0b('0x24')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xec0b('0x3a')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xec0b('0x15')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xec0b('0x15')](0x9)[_0xec0b('0x24')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0xec0b('0x24')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xec0b('0x3b')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0xec0b('0x24')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xec0b('0x15')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0xec0b('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0xec0b('0x15')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xec0b('0x3c')},'dialRecallMeTimeout':{'type':Sequelize['INTEGER'](0x5)[_0xec0b('0x24')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':'#RecallMe\x20Timeout\x20(min:1)'},'dialRecallInQueue':{'type':Sequelize[_0xec0b('0x37')],'defaultValue':0x0,'comment':_0xec0b('0x3d')},'dialOrderByScheduledAt':{'type':Sequelize[_0xec0b('0x3')]('DESC','ASC'),'defaultValue':'DESC'},'dialQueueProject2':{'type':Sequelize[_0xec0b('0x1')],'comment':_0xec0b('0x3e')},'dialAgiAfterHangupClient':{'type':Sequelize[_0xec0b('0x37')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0xec0b('0x37')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xec0b('0x15')](0x3)[_0xec0b('0x24')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xec0b('0x3f')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0xec0b('0x24')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xec0b('0x40')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xec0b('0x15')](0x3)[_0xec0b('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xec0b('0x41')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xec0b('0x15')](0x5)[_0xec0b('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xec0b('0x42')},'dialDropMaxRetry':{'type':Sequelize[_0xec0b('0x15')](0x3)[_0xec0b('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xec0b('0x43')},'dialDropRetryFrequency':{'type':Sequelize[_0xec0b('0x15')](0x5)[_0xec0b('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xec0b('0x44')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xec0b('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xec0b('0x45')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xec0b('0x15')](0x5)[_0xec0b('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xec0b('0x46')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xec0b('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xec0b('0x47')},'dialMachineRetryFrequency':{'type':Sequelize[_0xec0b('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xec0b('0x48')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xec0b('0x15')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xec0b('0x49')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xec0b('0x15')](0x5)[_0xec0b('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xec0b('0x4a')},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'comment':_0xec0b('0x4b')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0xdcf326){if(!_0xdcf326)this[_0xec0b('0xc')](_0xec0b('0x4c'),null);this['setDataValue'](_0xec0b('0x4d'),_0xdcf326);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0xec0b('0x15')](0x3)['UNSIGNED'],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0xec0b('0x37')],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize[_0xec0b('0x15')](0x3)[_0xec0b('0x24')],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize[_0xec0b('0x37')],'defaultValue':![]}};
\ No newline at end of file
+var _0xa0b5=['predictive','INTEGER','yes','all','once','TEXT','periodic_announce','joinempty','join','split','leavewhenempty','BOOLEAN','acw','wrapuptime','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.','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','FLOAT','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','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)','07:00-22:00,*,*,*','never','onlyIfOpen','always','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','ENUM','inbound','outbound','default','fewestcalls','rrmemory','rrordered','setDataValue','getDataValue','type','dialMethod','strategy','booked','progressive'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xa0b5,0x1e1));var _0x5a0b=function(_0x294791,_0x80430a){_0x294791=_0x294791-0x0;var _0x159d85=_0xa0b5[_0x294791];return _0x159d85;};'use strict';var Sequelize=require(_0x5a0b('0x0'));module[_0x5a0b('0x1')]={'name':{'type':Sequelize[_0x5a0b('0x2')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x5a0b('0x3')](_0x5a0b('0x4'),_0x5a0b('0x5')),'allowNull':![],'defaultValue':_0x5a0b('0x4')},'musiconhold':{'type':Sequelize[_0x5a0b('0x2')],'defaultValue':_0x5a0b('0x6')},'announce':{'type':Sequelize[_0x5a0b('0x2')],'defaultValue':''},'strategy':{'type':Sequelize['ENUM']('rr','ringall','leastrecent',_0x5a0b('0x7'),'random',_0x5a0b('0x8'),'linear','wrandom',_0x5a0b('0x9')),'allowNull':![],'defaultValue':'ringall','set':function(_0x97ca82){this[_0x5a0b('0xa')]('strategy',_0x97ca82?_0x97ca82:_0x5a0b('0x8'));},'get':function(){var _0x43c4af=this[_0x5a0b('0xb')](_0x5a0b('0xc'));var _0x4a82fc=this[_0x5a0b('0xb')](_0x5a0b('0xd'));var _0x544ae0=this[_0x5a0b('0xb')](_0x5a0b('0xe'));if(_0x43c4af==='inbound'){return _0x544ae0;}if(_0x4a82fc===_0x5a0b('0xf')&&_0x544ae0===_0x5a0b('0x8')||_0x4a82fc===_0x5a0b('0xf')&&_0x544ae0==='roundrobin'){return _0x544ae0;}if(_0x4a82fc===_0x5a0b('0x10')||_0x4a82fc===_0x5a0b('0x11')||_0x4a82fc==='power'){return _0x544ae0;}return null;}},'servicelevel':{'type':Sequelize[_0x5a0b('0x12')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x5a0b('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x5a0b('0x12')](0xb)},'timeout':{'type':Sequelize[_0x5a0b('0x12')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x5a0b('0x12')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x5a0b('0x2')]},'weight':{'type':Sequelize[_0x5a0b('0x12')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x5a0b('0x3')](_0x5a0b('0x13'),'no'),'defaultValue':_0x5a0b('0x13')},'autopause':{'type':Sequelize['ENUM']('yes','no',_0x5a0b('0x14')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x5a0b('0x12')](0xb)},'autopausebusy':{'type':Sequelize[_0x5a0b('0x3')](_0x5a0b('0x13'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x5a0b('0x3')](_0x5a0b('0x13'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x5a0b('0x12')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x5a0b('0x3')](_0x5a0b('0x13'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize['ENUM']('yes','no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x5a0b('0x3')](_0x5a0b('0x13'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x5a0b('0x3')](_0x5a0b('0x13'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize['STRING'],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x5a0b('0x2')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x5a0b('0x12')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x5a0b('0x12')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x5a0b('0x12')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize['ENUM'](_0x5a0b('0x13'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x5a0b('0x3')](_0x5a0b('0x13'),'no'),'defaultValue':_0x5a0b('0x13')},'announce_holdtime':{'type':Sequelize[_0x5a0b('0x3')](_0x5a0b('0x13'),'no',_0x5a0b('0x15')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x5a0b('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x5a0b('0x3')](_0x5a0b('0x13'),'no')},'announce_position_limit':{'type':Sequelize[_0x5a0b('0x12')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x5a0b('0x3')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x5a0b('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x5a0b('0x2')]},'queue_youarenext':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x5a0b('0x2')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize['STRING'],'defaultValue':null},'queue_holdtime':{'type':Sequelize['STRING'],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x5a0b('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize['STRING'],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x5a0b('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x5a0b('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x5a0b('0x2')]},'queue_quantity1':{'type':Sequelize[_0x5a0b('0x2')]},'queue_quantity2':{'type':Sequelize[_0x5a0b('0x2')]},'queue_periodic_announce':{'type':Sequelize[_0x5a0b('0x2')]},'queue_less_than':{'type':Sequelize[_0x5a0b('0x2')]},'periodic_announce':{'type':Sequelize[_0x5a0b('0x16')],'set':function(_0x4234d3){this['setDataValue'](_0x5a0b('0x17'),_0x4234d3?_0x4234d3['join'](','):[]);},'get':function(){return this[_0x5a0b('0xb')](_0x5a0b('0x17'))?this[_0x5a0b('0xb')](_0x5a0b('0x17'))['split'](','):[];}},'joinempty':{'type':Sequelize['STRING'],'defaultValue':_0x5a0b('0x13'),'set':function(_0xfd31eb){this[_0x5a0b('0xa')](_0x5a0b('0x18'),_0xfd31eb?_0xfd31eb[_0x5a0b('0x19')](','):undefined);},'get':function(){return this[_0x5a0b('0xb')](_0x5a0b('0x18'))?this[_0x5a0b('0xb')](_0x5a0b('0x18'))[_0x5a0b('0x1a')](','):undefined;}},'leavewhenempty':{'type':Sequelize['STRING'],'defaultValue':'no','set':function(_0x5721d8){this[_0x5a0b('0xa')]('leavewhenempty',_0x5721d8?_0x5721d8[_0x5a0b('0x19')](','):undefined);},'get':function(){return this[_0x5a0b('0xb')](_0x5a0b('0x1b'))?this[_0x5a0b('0xb')](_0x5a0b('0x1b'))[_0x5a0b('0x1a')](','):undefined;}},'reportholdtime':{'type':Sequelize['ENUM'](_0x5a0b('0x13'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x5a0b('0x3')](_0x5a0b('0x13'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x5a0b('0x12')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x5a0b('0x3')](_0x5a0b('0x13'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x5a0b('0x2')]},'description':{'type':Sequelize['STRING']},'acw':{'type':Sequelize[_0x5a0b('0x1c')],'defaultValue':0x0,'set':function(_0x1c67f6){this[_0x5a0b('0xa')](_0x5a0b('0x1d'),_0x1c67f6);if(_0x1c67f6){if(this[_0x5a0b('0xb')](_0x5a0b('0x1e'))<0x2){this['setDataValue'](_0x5a0b('0x1e'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x5a0b('0x12')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x5a0b('0x1f')},'dialMethod':{'type':Sequelize['ENUM'](_0x5a0b('0x20'),_0x5a0b('0x10'),'power','predictive',_0x5a0b('0xf')),'defaultValue':_0x5a0b('0x10'),'comment':_0x5a0b('0x21')},'dialLimitChannel':{'type':Sequelize[_0x5a0b('0x12')](0x4)[_0x5a0b('0x22')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x5a0b('0x23')},'dialLimitQueue':{'type':Sequelize['INTEGER'](0x4)[_0x5a0b('0x22')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x5a0b('0x24')},'dialPowerLevel':{'type':Sequelize['FLOAT'](0x2)[_0x5a0b('0x22')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x5a0b('0x25')},'dialPredictiveOptimization':{'type':Sequelize[_0x5a0b('0x3')](_0x5a0b('0x26'),'dropRate'),'defaultValue':_0x5a0b('0x27'),'comment':_0x5a0b('0x28')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x5a0b('0x29')](0x2)[_0x5a0b('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x5a0b('0x2a')},'dialPredictiveInterval':{'type':Sequelize[_0x5a0b('0x12')](0x3)[_0x5a0b('0x22')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x5a0b('0x2b')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x5a0b('0x12')](0x3)[_0x5a0b('0x22')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5a0b('0x2c')},'dialQueueOptions':{'type':Sequelize[_0x5a0b('0x2')],'defaultValue':_0x5a0b('0x2d'),'comment':'https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue'},'dialQueueTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x5a0b('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5a0b('0x2e')},'dialQueueProject':{'type':Sequelize[_0x5a0b('0x2')],'comment':_0x5a0b('0x2f')},'dialCongestionMaxRetry':{'type':Sequelize[_0x5a0b('0x12')](0x3)[_0x5a0b('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5a0b('0x30')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x5a0b('0x12')](0x5)[_0x5a0b('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5a0b('0x31')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x5a0b('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5a0b('0x32')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5a0b('0x33')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x5a0b('0x12')](0x3)[_0x5a0b('0x22')],'defaultValue':0x3,'comment':_0x5a0b('0x34')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5a0b('0x35')},'dialGlobalMaxRetry':{'type':Sequelize[_0x5a0b('0x12')](0x3)[_0x5a0b('0x22')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x5a0b('0x36')},'dialTimezone':{'type':Sequelize[_0x5a0b('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0x5a0b('0x37')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x5a0b('0x3')]('always',_0x5a0b('0x38'),_0x5a0b('0x39')),'defaultValue':_0x5a0b('0x3a')},'dialAMDActive':{'type':Sequelize[_0x5a0b('0x1c')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x5a0b('0x22')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x5a0b('0x3b')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x5a0b('0x3c')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x5a0b('0x12')](0x9)[_0x5a0b('0x22')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x5a0b('0x12')](0x9)[_0x5a0b('0x22')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x5a0b('0x3d')},'dialAMDMinWordLength':{'type':Sequelize[_0x5a0b('0x12')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x5a0b('0x3e')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x5a0b('0x12')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x5a0b('0x3f')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x5a0b('0x12')](0x9)[_0x5a0b('0x22')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x5a0b('0x40')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x5a0b('0x12')](0x5)[_0x5a0b('0x22')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x5a0b('0x41')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x5a0b('0x12')](0x9)[_0x5a0b('0x22')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x5a0b('0x42')},'dialRecallMeTimeout':{'type':Sequelize[_0x5a0b('0x12')](0x5)[_0x5a0b('0x22')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x5a0b('0x43')},'dialRecallInQueue':{'type':Sequelize[_0x5a0b('0x1c')],'defaultValue':0x0,'comment':_0x5a0b('0x44')},'dialOrderByScheduledAt':{'type':Sequelize[_0x5a0b('0x3')](_0x5a0b('0x45'),_0x5a0b('0x46')),'defaultValue':_0x5a0b('0x45')},'dialQueueProject2':{'type':Sequelize['STRING'],'comment':_0x5a0b('0x2f')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x5a0b('0x1c')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x5a0b('0x12')](0x3)[_0x5a0b('0x22')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x5a0b('0x47')},'dialCutDigit':{'type':Sequelize[_0x5a0b('0x12')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x5a0b('0x48')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x5a0b('0x12')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x5a0b('0x12')](0x5)[_0x5a0b('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5a0b('0x49')},'dialDropMaxRetry':{'type':Sequelize[_0x5a0b('0x12')](0x3)[_0x5a0b('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5a0b('0x4a')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x5a0b('0x12')](0x3)[_0x5a0b('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5a0b('0x4b')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x5a0b('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0x5a0b('0x12')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5a0b('0x4c')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5a0b('0x4d')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x5a0b('0x12')](0x3)[_0x5a0b('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5a0b('0x4e')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x5a0b('0x12')](0x5)[_0x5a0b('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5a0b('0x4f')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x5a0b('0x12')],'allowNull':!![],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x5a0b('0x50'),'set':function(_0x15809c){if(!_0x15809c)this[_0x5a0b('0xa')](_0x5a0b('0x51'),null);this[_0x5a0b('0xa')](_0x5a0b('0x52'),_0x15809c);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x5a0b('0x12')](0x3)[_0x5a0b('0x22')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0x5a0b('0x1c')],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize[_0x5a0b('0x12')](0x3)[_0x5a0b('0x22')],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize[_0x5a0b('0x1c')],'defaultValue':![]}};
\ No newline at end of file
index fa618fb..8f37409 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x82c4=['toString','QueryTypes','SELECT','every','TeamId','all','union','transaction','removeAgents','UserVoiceQueueRt','addAgents','spread','isEmpty','isArray','userVoiceQueue:remove','getAgents','getMembers','getLists','CmList','YYYY-MM-DD\x20HH:mm:ss','addLists','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','phone','ListId','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','CmListId','select','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','onlyIfOpen','phone\x20IS\x20NOT\x20NULL','cm_hopper_additional_phones','CmHopperId','ci.item','ci.OrderBy+1','h.ContactId=ci.CmContactId','h.scheduledat=?','ci.ItemClass=?','PHONE','removeLists','getBlackLists','addBlackLists','cm_hopper_black','NOW()','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','update','destroy','then','get','VoiceQueues','inbound','outbound','ignore','value','includes','type','find','name','UserProfileResource','error','stack','index','map','key','model','query','keys','intersection','fields','attributes','order','sort','where','filters','pick','filter','merge','VIRTUAL','VoiceQueue','includeAll','include','rows','catch','show','length','create','body','role','user','QueueCampaigns','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','rawAttributes','options','omit','createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','getHoppers','VoiceQueueId','CmHopper','findAll','getHopperHistories','findOne','CmHopperHistory','hasOwnProperty','nolimit','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','Team','getTeams','addTeams','teams','Agents','online','voicePause','interface','forEach','penalty','sequelize','TeamVoiceQueue','upsert','UserVoiceQueue','findOrCreate','each','isNil','format','SIP/%s','emit','userVoiceQueue:save','removeTeams','ids','User','field','tq.TeamId','from','team_has_voice_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x82c4,0x1ca));var _0x482c=function(_0x355494,_0x592917){_0x355494=_0x355494-0x0;var _0x59d215=_0x82c4[_0x355494];return _0x59d215;};'use strict';var emlformat=require(_0x482c('0x0'));var rimraf=require(_0x482c('0x1'));var zipdir=require(_0x482c('0x2'));var jsonpatch=require(_0x482c('0x3'));var rp=require(_0x482c('0x4'));var moment=require(_0x482c('0x5'));var BPromise=require(_0x482c('0x6'));var Mustache=require('mustache');var util=require(_0x482c('0x7'));var path=require('path');var sox=require(_0x482c('0x8'));var csv=require('to-csv');var ejs=require(_0x482c('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x482c('0xa'));var squel=require(_0x482c('0xb'));var crypto=require(_0x482c('0xc'));var jsforce=require(_0x482c('0xd'));var deskjs=require(_0x482c('0xe'));var toCsv=require('to-csv');var querystring=require(_0x482c('0xf'));var Papa=require(_0x482c('0x10'));var Redis=require(_0x482c('0x11'));var authService=require(_0x482c('0x12'));var qs=require(_0x482c('0x13'));var as=require(_0x482c('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x482c('0x15'))(_0x482c('0x16'));var utils=require(_0x482c('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x482c('0x18'));var db=require(_0x482c('0x19'))['db'];config[_0x482c('0x1a')]=_['defaults'](config['redis'],{'host':_0x482c('0x1b'),'port':0x18eb});var socket=require(_0x482c('0x1c'))(new Redis(config['redis']));require('./voiceQueue.socket')[_0x482c('0x1d')](socket);function respondWithStatusCode(_0xe3f853,_0x46016e){_0x46016e=_0x46016e||0xcc;return function(_0x3dfbc8){if(_0x3dfbc8){return _0xe3f853[_0x482c('0x1e')](_0x46016e);}return _0xe3f853[_0x482c('0x1f')](_0x46016e)[_0x482c('0x20')]();};}function respondWithResult(_0xf65563,_0x3fc79c){_0x3fc79c=_0x3fc79c||0xc8;return function(_0x1758fb){if(_0x1758fb){return _0xf65563[_0x482c('0x1f')](_0x3fc79c)[_0x482c('0x21')](_0x1758fb);}};}function respondWithFilteredResult(_0x4bdf15,_0x244bb9){return function(_0x5b6f7e){if(_0x5b6f7e){var _0x3aed45=typeof _0x244bb9[_0x482c('0x22')]==='undefined'&&typeof _0x244bb9['limit']===_0x482c('0x23');var _0x584656=_0x5b6f7e[_0x482c('0x24')];var _0x4784a2=_0x3aed45?0x0:_0x244bb9[_0x482c('0x22')];var _0x3f97ae=_0x3aed45?_0x5b6f7e['count']:_0x244bb9[_0x482c('0x22')]+_0x244bb9[_0x482c('0x25')];var _0x38a956;if(_0x3f97ae>=_0x584656){_0x3f97ae=_0x584656;_0x38a956=0xc8;}else{_0x38a956=0xce;}_0x4bdf15[_0x482c('0x1f')](_0x38a956);return _0x4bdf15[_0x482c('0x26')]('Content-Range',_0x4784a2+'-'+_0x3f97ae+'/'+_0x584656)['json'](_0x5b6f7e);}return null;};}function patchUpdates(_0x238503){return function(_0x147d05){try{jsonpatch[_0x482c('0x27')](_0x147d05,_0x238503,!![]);}catch(_0x5c4e9c){return BPromise[_0x482c('0x28')](_0x5c4e9c);}return _0x147d05['save']();};}function saveUpdates(_0x2f3f96,_0xc2df7){return function(_0x4f1108){if(_0x4f1108){return _0x4f1108[_0x482c('0x29')](_0x2f3f96)['then'](function(_0x589bc6){return _0x589bc6;});}return null;};}function removeEntity(_0x2165af,_0x27f1b5){return function(_0x36b25c){if(_0x36b25c){return _0x36b25c[_0x482c('0x2a')]()[_0x482c('0x2b')](function(){var _0x215826=_0x36b25c[_0x482c('0x2c')]({'plain':!![]});var _0x5ad788=[{'name':_0x482c('0x2d'),'value':_0x482c('0x2e'),'ignore':![]},{'name':'QueueCampaigns','value':_0x482c('0x2f'),'ignore':![]}];var _0x52b6fc=_(_0x5ad788)['filter'](_0x482c('0x30'))['map'](_0x482c('0x31'))[_0x482c('0x31')]();if(_[_0x482c('0x32')](_0x52b6fc,_0x215826[_0x482c('0x33')])){return;}var _0x39e8aa=_[_0x482c('0x34')](_0x5ad788,[_0x482c('0x31'),_0x215826[_0x482c('0x33')]])[_0x482c('0x35')];return db[_0x482c('0x36')][_0x482c('0x2a')]({'where':{'type':_0x39e8aa,'resourceId':_0x215826['id']}})[_0x482c('0x2b')](function(){return _0x36b25c;});})[_0x482c('0x2b')](function(){_0x2165af[_0x482c('0x1f')](0xcc)[_0x482c('0x20')]();});}};}function handleEntityNotFound(_0x164417,_0x22a8be){return function(_0x37456e){if(!_0x37456e){_0x164417['sendStatus'](0x194);}return _0x37456e;};}function handleError(_0x4bc837,_0x520b6b){_0x520b6b=_0x520b6b||0x1f4;return function(_0x2fd9d0){logger[_0x482c('0x37')](_0x2fd9d0[_0x482c('0x38')]);if(_0x2fd9d0[_0x482c('0x35')]){delete _0x2fd9d0['name'];}_0x4bc837[_0x482c('0x1f')](_0x520b6b)['send'](_0x2fd9d0);};}exports[_0x482c('0x39')]=function(_0xdeb7ad,_0xdb7f5a){var _0x28140b={},_0x15223b={},_0x19cfc8={'count':0x0,'rows':[]};var _0x129a31=_[_0x482c('0x3a')](db['VoiceQueue']['rawAttributes'],function(_0x467a70){return{'name':_0x467a70['fieldName'],'type':_0x467a70[_0x482c('0x33')][_0x482c('0x3b')]};});_0x15223b[_0x482c('0x3c')]=_['map'](_0x129a31,_0x482c('0x35'));_0x15223b[_0x482c('0x3d')]=_[_0x482c('0x3e')](_0xdeb7ad[_0x482c('0x3d')]);_0x15223b['filters']=_[_0x482c('0x3f')](_0x15223b['model'],_0x15223b[_0x482c('0x3d')]);_0x28140b['attributes']=_[_0x482c('0x3f')](_0x15223b['model'],qs[_0x482c('0x40')](_0xdeb7ad[_0x482c('0x3d')]['fields']));_0x28140b[_0x482c('0x41')]=_0x28140b['attributes']['length']?_0x28140b[_0x482c('0x41')]:_0x15223b['model'];if(!_0xdeb7ad['query']['hasOwnProperty']('nolimit')){_0x28140b[_0x482c('0x25')]=qs[_0x482c('0x25')](_0xdeb7ad[_0x482c('0x3d')][_0x482c('0x25')]);_0x28140b[_0x482c('0x22')]=qs['offset'](_0xdeb7ad[_0x482c('0x3d')][_0x482c('0x22')]);}_0x28140b[_0x482c('0x42')]=qs[_0x482c('0x43')](_0xdeb7ad['query']['sort']);_0x28140b[_0x482c('0x44')]=qs[_0x482c('0x45')](_[_0x482c('0x46')](_0xdeb7ad[_0x482c('0x3d')],_0x15223b[_0x482c('0x45')]),_0x129a31);if(_0xdeb7ad[_0x482c('0x3d')][_0x482c('0x47')]){_0x28140b[_0x482c('0x44')]=_[_0x482c('0x48')](_0x28140b[_0x482c('0x44')],{'$or':_[_0x482c('0x3a')](_0x129a31,function(_0x489131){if(_0x489131[_0x482c('0x33')]!==_0x482c('0x49')){var _0x393ca2={};_0x393ca2[_0x489131[_0x482c('0x35')]]={'$like':'%'+_0xdeb7ad[_0x482c('0x3d')][_0x482c('0x47')]+'%'};return _0x393ca2;}})});}_0x28140b=_[_0x482c('0x48')]({},_0x28140b,_0xdeb7ad['options']);var _0x48dcd9={'where':_0x28140b[_0x482c('0x44')]};return db[_0x482c('0x4a')][_0x482c('0x24')](_0x48dcd9)['then'](function(_0x12ac96){_0x19cfc8['count']=_0x12ac96;if(_0xdeb7ad[_0x482c('0x3d')][_0x482c('0x4b')]){_0x28140b[_0x482c('0x4c')]=[{'all':!![]}];}return db[_0x482c('0x4a')]['findAll'](_0x28140b);})[_0x482c('0x2b')](function(_0x2c37f3){_0x19cfc8[_0x482c('0x4d')]=_0x2c37f3;return _0x19cfc8;})['then'](respondWithFilteredResult(_0xdb7f5a,_0x28140b))[_0x482c('0x4e')](handleError(_0xdb7f5a,null));};exports[_0x482c('0x4f')]=function(_0xcf89c4,_0x5d978a){var _0x4bd38e={'raw':![],'where':{'id':_0xcf89c4['params']['id']}},_0x4a677d={};_0x4a677d['model']=_['keys'](db[_0x482c('0x4a')]['rawAttributes']);_0x4a677d[_0x482c('0x3d')]=_[_0x482c('0x3e')](_0xcf89c4[_0x482c('0x3d')]);_0x4a677d[_0x482c('0x45')]=_[_0x482c('0x3f')](_0x4a677d[_0x482c('0x3c')],_0x4a677d[_0x482c('0x3d')]);_0x4bd38e[_0x482c('0x41')]=_[_0x482c('0x3f')](_0x4a677d[_0x482c('0x3c')],qs[_0x482c('0x40')](_0xcf89c4[_0x482c('0x3d')][_0x482c('0x40')]));_0x4bd38e[_0x482c('0x41')]=_0x4bd38e[_0x482c('0x41')][_0x482c('0x50')]?_0x4bd38e[_0x482c('0x41')]:_0x4a677d[_0x482c('0x3c')];if(_0xcf89c4[_0x482c('0x3d')]['includeAll']){_0x4bd38e[_0x482c('0x4c')]=[{'all':!![]}];}_0x4bd38e=_[_0x482c('0x48')]({},_0x4bd38e,_0xcf89c4['options']);return db[_0x482c('0x4a')][_0x482c('0x34')](_0x4bd38e)[_0x482c('0x2b')](handleEntityNotFound(_0x5d978a,null))[_0x482c('0x2b')](respondWithResult(_0x5d978a,null))[_0x482c('0x4e')](handleError(_0x5d978a,null));};exports['create']=function(_0x5b2d8d,_0x208a8f){return db[_0x482c('0x4a')][_0x482c('0x51')](_0x5b2d8d[_0x482c('0x52')],{})[_0x482c('0x2b')](function(_0x2bf632){var _0x348db6=_0x5b2d8d['user']['get']({'plain':!![]});if(!_0x348db6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x348db6[_0x482c('0x53')]===_0x482c('0x54')){var _0x3e5bfe=_0x2bf632[_0x482c('0x2c')]({'plain':!![]});var _0x45744d=[{'name':_0x482c('0x2d'),'value':_0x482c('0x2e')},{'name':_0x482c('0x55'),'value':_0x482c('0x2f')}];var _0x2d6657=_[_0x482c('0x34')](_0x45744d,['value',_0x3e5bfe[_0x482c('0x33')]])[_0x482c('0x35')];return db[_0x482c('0x56')][_0x482c('0x34')]({'where':{'name':_0x2d6657,'userProfileId':_0x348db6[_0x482c('0x57')]},'raw':!![]})[_0x482c('0x2b')](function(_0x2d9505){if(_0x2d9505&&_0x2d9505[_0x482c('0x58')]===0x0){return db[_0x482c('0x36')][_0x482c('0x51')]({'name':_0x3e5bfe[_0x482c('0x35')],'resourceId':_0x3e5bfe['id'],'type':_0x2d9505[_0x482c('0x35')],'sectionId':_0x2d9505['id']},{})['then'](function(){return _0x2bf632;});}else{return _0x2bf632;}})['catch'](function(_0x1a9466){logger[_0x482c('0x37')](_0x482c('0x59'),_0x1a9466);throw _0x1a9466;});}return _0x2bf632;})[_0x482c('0x2b')](respondWithResult(_0x208a8f,0xc9))[_0x482c('0x4e')](handleError(_0x208a8f,null));};exports[_0x482c('0x5a')]=function(_0x5382b0,_0x231353){var _0x732d17={'where':{'id':_0x5382b0[_0x482c('0x5b')]['id']}},_0x197056={};_0x197056[_0x482c('0x3c')]=_[_0x482c('0x3e')](db[_0x482c('0x4a')][_0x482c('0x5c')]);_0x732d17[_0x482c('0x41')]=_[_0x482c('0x3f')](_0x197056[_0x482c('0x3c')],qs[_0x482c('0x40')](_0x5382b0['query'][_0x482c('0x40')]));_0x732d17['attributes']=_0x732d17[_0x482c('0x41')][_0x482c('0x50')]?_0x732d17[_0x482c('0x41')]:_0x197056[_0x482c('0x3c')];if(_0x5382b0[_0x482c('0x3d')][_0x482c('0x4b')]){_0x732d17['include']=[{'all':!![]}];}_0x732d17=_[_0x482c('0x48')]({},_0x732d17,_0x5382b0[_0x482c('0x5d')]);return db['VoiceQueue']['find'](_0x732d17)[_0x482c('0x2b')](handleEntityNotFound(_0x231353,null))[_0x482c('0x2b')](function(_0x481241){if(_0x481241){var _0x257d26=_0x481241[_0x482c('0x2c')]({'plain':!![]});_0x257d26=qs[_0x482c('0x5e')](_0x257d26,['id',_0x482c('0x5f'),'updatedAt']);_0x5382b0[_0x482c('0x52')]=_[_0x482c('0x5e')](_0x5382b0[_0x482c('0x52')],['id',_0x482c('0x5f'),_0x482c('0x60')]);return db[_0x482c('0x4a')]['create'](_['merge'](_0x257d26,_0x5382b0[_0x482c('0x52')]),{'include':_0x5382b0[_0x482c('0x3d')][_0x482c('0x4b')]?[{'all':!![]}]:undefined})['then'](function(_0x23349f){var _0x2b7551=_0x5382b0[_0x482c('0x54')][_0x482c('0x2c')]({'plain':!![]});if(!_0x2b7551)throw new Error(_0x482c('0x61'));if(_0x2b7551[_0x482c('0x53')]===_0x482c('0x54')){var _0x37e456=_0x23349f[_0x482c('0x2c')]({'plain':!![]});var _0x4eee43=[{'name':'VoiceQueues','value':_0x482c('0x2e')},{'name':_0x482c('0x55'),'value':'outbound'}];var _0x5d11ce=_[_0x482c('0x34')](_0x4eee43,[_0x482c('0x31'),_0x37e456[_0x482c('0x33')]])['name'];return db['UserProfileSection']['find']({'where':{'name':_0x5d11ce,'userProfileId':_0x2b7551[_0x482c('0x57')]},'raw':!![]})[_0x482c('0x2b')](function(_0x43aa51){if(_0x43aa51&&_0x43aa51[_0x482c('0x58')]===0x0){return db[_0x482c('0x36')][_0x482c('0x51')]({'name':_0x37e456['name'],'resourceId':_0x37e456['id'],'type':_0x43aa51['name'],'sectionId':_0x43aa51['id']},{})[_0x482c('0x2b')](function(){return _0x23349f;});}else{return _0x23349f;}})[_0x482c('0x4e')](function(_0x243a37){logger[_0x482c('0x37')](_0x482c('0x59'),_0x243a37);throw _0x243a37;});}return _0x23349f;});}})[_0x482c('0x2b')](respondWithResult(_0x231353,0xc9))[_0x482c('0x4e')](handleError(_0x231353,null));};exports[_0x482c('0x29')]=function(_0x1c771f,_0x142809){if(_0x1c771f[_0x482c('0x52')]['id']){delete _0x1c771f[_0x482c('0x52')]['id'];}return db['VoiceQueue'][_0x482c('0x34')]({'where':{'id':_0x1c771f[_0x482c('0x5b')]['id']}})[_0x482c('0x2b')](handleEntityNotFound(_0x142809,null))['then'](saveUpdates(_0x1c771f[_0x482c('0x52')],null))[_0x482c('0x2b')](respondWithResult(_0x142809,null))[_0x482c('0x4e')](handleError(_0x142809,null));};exports['destroy']=function(_0x4751ca,_0x536f20){return db['VoiceQueue'][_0x482c('0x34')]({'where':{'id':_0x4751ca[_0x482c('0x5b')]['id']}})[_0x482c('0x2b')](handleEntityNotFound(_0x536f20,null))[_0x482c('0x2b')](removeEntity(_0x536f20,null))[_0x482c('0x4e')](handleError(_0x536f20,null));};exports[_0x482c('0x62')]=function(_0x3b293f,_0x58f479,_0x1d497b){var _0x191904={'raw':![],'where':{}};var _0x5eb509={};var _0x23360c={'count':0x0,'rows':[]};return db['VoiceQueue']['findOne']({'where':{'id':_0x3b293f['params']['id']}})[_0x482c('0x2b')](handleEntityNotFound(_0x58f479,null))['then'](function(_0x5e63b7){if(_0x5e63b7){_0x5eb509[_0x482c('0x3c')]=_[_0x482c('0x3e')](db['CmHopper'][_0x482c('0x5c')]);_0x5eb509['query']=_['keys'](_0x3b293f['query']);_0x5eb509[_0x482c('0x45')]=_[_0x482c('0x3f')](_0x5eb509['model'],_0x5eb509['query']);_0x191904['attributes']=_[_0x482c('0x3f')](_0x5eb509[_0x482c('0x3c')],qs[_0x482c('0x40')](_0x3b293f['query']['fields']));_0x191904[_0x482c('0x41')]=_0x191904['attributes'][_0x482c('0x50')]?_0x191904[_0x482c('0x41')]:_0x5eb509['model'];if(!_0x3b293f[_0x482c('0x3d')]['hasOwnProperty']('nolimit')){_0x191904[_0x482c('0x25')]=qs['limit'](_0x3b293f[_0x482c('0x3d')]['limit']);_0x191904[_0x482c('0x22')]=qs['offset'](_0x3b293f[_0x482c('0x3d')][_0x482c('0x22')]);}_0x191904[_0x482c('0x42')]=qs['sort'](_0x3b293f[_0x482c('0x3d')][_0x482c('0x43')]);_0x191904[_0x482c('0x44')]=qs['filters'](_[_0x482c('0x46')](_0x3b293f[_0x482c('0x3d')],_0x5eb509[_0x482c('0x45')]));_0x191904[_0x482c('0x44')][_0x482c('0x63')]=_0x5e63b7['id'];if(_0x3b293f[_0x482c('0x3d')][_0x482c('0x47')]){_0x191904['where']=_[_0x482c('0x48')](_0x191904[_0x482c('0x44')],{'$or':_[_0x482c('0x3a')](_0x191904['attributes'],function(_0x484304){var _0x4dc54a={};_0x4dc54a[_0x484304]={'$like':'%'+_0x3b293f[_0x482c('0x3d')]['filter']+'%'};return _0x4dc54a;})});}_0x191904=_['merge']({},_0x191904,_0x3b293f[_0x482c('0x5d')]);return db['CmHopper'][_0x482c('0x24')]({'where':_0x191904[_0x482c('0x44')]})[_0x482c('0x2b')](function(_0x2a1d3a){_0x23360c['count']=_0x2a1d3a;if(_0x3b293f[_0x482c('0x3d')]['includeAll']){_0x191904[_0x482c('0x4c')]=[{'all':!![]}];}return db[_0x482c('0x64')][_0x482c('0x65')](_0x191904);})['then'](function(_0x590d97){_0x23360c[_0x482c('0x4d')]=_0x590d97;return _0x23360c;});}})[_0x482c('0x2b')](respondWithFilteredResult(_0x58f479,_0x191904))['catch'](handleError(_0x58f479,null));};exports[_0x482c('0x66')]=function(_0x4b726f,_0x929a4,_0x2c683f){var _0x2f5799={'raw':!![],'where':{}};var _0x549dec={};var _0x1f3a94={'count':0x0,'rows':[]};return db[_0x482c('0x4a')][_0x482c('0x67')]({'where':{'id':_0x4b726f['params']['id']}})[_0x482c('0x2b')](handleEntityNotFound(_0x929a4,null))[_0x482c('0x2b')](function(_0x56a961){if(_0x56a961){_0x549dec['model']=_['keys'](db[_0x482c('0x68')][_0x482c('0x5c')]);_0x549dec[_0x482c('0x3d')]=_['keys'](_0x4b726f[_0x482c('0x3d')]);_0x549dec[_0x482c('0x45')]=_['intersection'](_0x549dec[_0x482c('0x3c')],_0x549dec['query']);_0x2f5799[_0x482c('0x41')]=_[_0x482c('0x3f')](_0x549dec[_0x482c('0x3c')],qs[_0x482c('0x40')](_0x4b726f[_0x482c('0x3d')][_0x482c('0x40')]));_0x2f5799['attributes']=_0x2f5799['attributes'][_0x482c('0x50')]?_0x2f5799[_0x482c('0x41')]:_0x549dec[_0x482c('0x3c')];if(!_0x4b726f[_0x482c('0x3d')][_0x482c('0x69')](_0x482c('0x6a'))){_0x2f5799[_0x482c('0x25')]=qs['limit'](_0x4b726f[_0x482c('0x3d')][_0x482c('0x25')]);_0x2f5799[_0x482c('0x22')]=qs['offset'](_0x4b726f[_0x482c('0x3d')][_0x482c('0x22')]);}_0x2f5799[_0x482c('0x42')]=qs[_0x482c('0x43')](_0x4b726f[_0x482c('0x3d')][_0x482c('0x43')]);_0x2f5799[_0x482c('0x44')]=qs['filters'](_[_0x482c('0x46')](_0x4b726f[_0x482c('0x3d')],_0x549dec[_0x482c('0x45')]));_0x2f5799['where'][_0x482c('0x63')]=_0x56a961['id'];if(_0x4b726f['query'][_0x482c('0x47')]){_0x2f5799[_0x482c('0x44')]=_[_0x482c('0x48')](_0x2f5799[_0x482c('0x44')],{'$or':_['map'](_0x2f5799[_0x482c('0x41')],function(_0xeaee3d){var _0x1120e1={};_0x1120e1[_0xeaee3d]={'$like':'%'+_0x4b726f[_0x482c('0x3d')]['filter']+'%'};return _0x1120e1;})});}_0x2f5799=_[_0x482c('0x48')]({},_0x2f5799,_0x4b726f[_0x482c('0x5d')]);return db[_0x482c('0x68')][_0x482c('0x24')]({'where':_0x2f5799[_0x482c('0x44')]})['then'](function(_0x33116b){_0x1f3a94[_0x482c('0x24')]=_0x33116b;if(_0x4b726f[_0x482c('0x3d')][_0x482c('0x4b')]){_0x2f5799[_0x482c('0x4c')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x482c('0x65')](_0x2f5799);})[_0x482c('0x2b')](function(_0x44da80){_0x1f3a94['rows']=_0x44da80;return _0x1f3a94;});}})[_0x482c('0x2b')](respondWithFilteredResult(_0x929a4,_0x2f5799))[_0x482c('0x4e')](handleError(_0x929a4,null));};exports[_0x482c('0x6b')]=function(_0x1621cb,_0x519225,_0x73c25f){var _0x2da8de={'raw':!![],'where':{}};var _0x80d460={};var _0x5cbf1a={'count':0x0,'rows':[]};return db[_0x482c('0x4a')][_0x482c('0x67')]({'where':{'id':_0x1621cb[_0x482c('0x5b')]['id']}})[_0x482c('0x2b')](handleEntityNotFound(_0x519225,null))['then'](function(_0x5529d0){if(_0x5529d0){_0x80d460['model']=_[_0x482c('0x3e')](db[_0x482c('0x6c')][_0x482c('0x5c')]);_0x80d460[_0x482c('0x3d')]=_[_0x482c('0x3e')](_0x1621cb[_0x482c('0x3d')]);_0x80d460[_0x482c('0x45')]=_['intersection'](_0x80d460['model'],_0x80d460['query']);_0x2da8de[_0x482c('0x41')]=_[_0x482c('0x3f')](_0x80d460[_0x482c('0x3c')],qs[_0x482c('0x40')](_0x1621cb[_0x482c('0x3d')][_0x482c('0x40')]));_0x2da8de[_0x482c('0x41')]=_0x2da8de[_0x482c('0x41')][_0x482c('0x50')]?_0x2da8de['attributes']:_0x80d460[_0x482c('0x3c')];if(!_0x1621cb[_0x482c('0x3d')][_0x482c('0x69')](_0x482c('0x6a'))){_0x2da8de[_0x482c('0x25')]=qs[_0x482c('0x25')](_0x1621cb[_0x482c('0x3d')]['limit']);_0x2da8de['offset']=qs['offset'](_0x1621cb[_0x482c('0x3d')]['offset']);}_0x2da8de[_0x482c('0x42')]=qs[_0x482c('0x43')](_0x1621cb['query'][_0x482c('0x43')]);_0x2da8de[_0x482c('0x44')]=qs[_0x482c('0x45')](_[_0x482c('0x46')](_0x1621cb['query'],_0x80d460[_0x482c('0x45')]));_0x2da8de[_0x482c('0x44')][_0x482c('0x63')]=_0x5529d0['id'];if(_0x1621cb['query'][_0x482c('0x47')]){_0x2da8de[_0x482c('0x44')]=_[_0x482c('0x48')](_0x2da8de[_0x482c('0x44')],{'$or':_[_0x482c('0x3a')](_0x2da8de[_0x482c('0x41')],function(_0x34a698){var _0x1f3ac5={};_0x1f3ac5[_0x34a698]={'$like':'%'+_0x1621cb['query']['filter']+'%'};return _0x1f3ac5;})});}_0x2da8de=_['merge']({},_0x2da8de,_0x1621cb['options']);return db[_0x482c('0x6c')]['count']({'where':_0x2da8de[_0x482c('0x44')]})[_0x482c('0x2b')](function(_0x28d3b7){_0x5cbf1a[_0x482c('0x24')]=_0x28d3b7;if(_0x1621cb[_0x482c('0x3d')][_0x482c('0x4b')]){_0x2da8de[_0x482c('0x4c')]=[{'all':!![]}];}return db[_0x482c('0x6c')][_0x482c('0x65')](_0x2da8de);})[_0x482c('0x2b')](function(_0xde6c1b){_0x5cbf1a[_0x482c('0x4d')]=_0xde6c1b;return _0x5cbf1a;});}})[_0x482c('0x2b')](respondWithFilteredResult(_0x519225,_0x2da8de))[_0x482c('0x4e')](handleError(_0x519225,null));};exports[_0x482c('0x6d')]=function(_0x1edc8b,_0x23ac93,_0x511375){var _0x51888b={'raw':!![],'where':{}};var _0x1adfc9={};var _0x1635ee={'count':0x0,'rows':[]};return db[_0x482c('0x4a')][_0x482c('0x67')]({'where':{'id':_0x1edc8b[_0x482c('0x5b')]['id']}})[_0x482c('0x2b')](handleEntityNotFound(_0x23ac93,null))[_0x482c('0x2b')](function(_0x282b3f){if(_0x282b3f){_0x1adfc9['model']=_['keys'](db[_0x482c('0x6e')]['rawAttributes']);_0x1adfc9[_0x482c('0x3d')]=_[_0x482c('0x3e')](_0x1edc8b[_0x482c('0x3d')]);_0x1adfc9[_0x482c('0x45')]=_[_0x482c('0x3f')](_0x1adfc9[_0x482c('0x3c')],_0x1adfc9[_0x482c('0x3d')]);_0x51888b['attributes']=_[_0x482c('0x3f')](_0x1adfc9[_0x482c('0x3c')],qs[_0x482c('0x40')](_0x1edc8b[_0x482c('0x3d')][_0x482c('0x40')]));_0x51888b['attributes']=_0x51888b[_0x482c('0x41')][_0x482c('0x50')]?_0x51888b[_0x482c('0x41')]:_0x1adfc9['model'];if(!_0x1edc8b[_0x482c('0x3d')][_0x482c('0x69')](_0x482c('0x6a'))){_0x51888b[_0x482c('0x25')]=qs[_0x482c('0x25')](_0x1edc8b['query'][_0x482c('0x25')]);_0x51888b[_0x482c('0x22')]=qs['offset'](_0x1edc8b['query']['offset']);}_0x51888b['order']=qs[_0x482c('0x43')](_0x1edc8b[_0x482c('0x3d')][_0x482c('0x43')]);_0x51888b[_0x482c('0x44')]=qs[_0x482c('0x45')](_[_0x482c('0x46')](_0x1edc8b['query'],_0x1adfc9[_0x482c('0x45')]));_0x51888b[_0x482c('0x44')]['VoiceQueueId']=_0x282b3f['id'];if(_0x1edc8b[_0x482c('0x3d')][_0x482c('0x47')]){_0x51888b[_0x482c('0x44')]=_[_0x482c('0x48')](_0x51888b['where'],{'$or':_[_0x482c('0x3a')](_0x51888b['attributes'],function(_0x3acd9c){var _0x7bf21e={};_0x7bf21e[_0x3acd9c]={'$like':'%'+_0x1edc8b[_0x482c('0x3d')]['filter']+'%'};return _0x7bf21e;})});}_0x51888b=_[_0x482c('0x48')]({},_0x51888b,_0x1edc8b[_0x482c('0x5d')]);return db['CmHopperBlack'][_0x482c('0x24')]({'where':_0x51888b[_0x482c('0x44')]})['then'](function(_0xa1aa34){_0x1635ee[_0x482c('0x24')]=_0xa1aa34;if(_0x1edc8b[_0x482c('0x3d')][_0x482c('0x4b')]){_0x51888b['include']=[{'all':!![]}];}return db[_0x482c('0x6e')]['findAll'](_0x51888b);})[_0x482c('0x2b')](function(_0x19883d){_0x1635ee[_0x482c('0x4d')]=_0x19883d;return _0x1635ee;});}})[_0x482c('0x2b')](respondWithFilteredResult(_0x23ac93,_0x51888b))[_0x482c('0x4e')](handleError(_0x23ac93,null));};exports['getTeams']=function(_0x50bff4,_0x224cee,_0x2d80d6){var _0x494d3f={};var _0x13daa4={};var _0x96edd6;var _0x5b6932;return db['VoiceQueue'][_0x482c('0x67')]({'where':{'id':_0x50bff4['params']['id']}})[_0x482c('0x2b')](handleEntityNotFound(_0x224cee,null))[_0x482c('0x2b')](function(_0x15a0c7){if(_0x15a0c7){_0x96edd6=_0x15a0c7;_0x13daa4[_0x482c('0x3c')]=_[_0x482c('0x3e')](db[_0x482c('0x6f')][_0x482c('0x5c')]);_0x13daa4[_0x482c('0x3d')]=_[_0x482c('0x3e')](_0x50bff4['query']);_0x13daa4[_0x482c('0x45')]=_['intersection'](_0x13daa4['model'],_0x13daa4[_0x482c('0x3d')]);_0x494d3f[_0x482c('0x41')]=_['intersection'](_0x13daa4[_0x482c('0x3c')],qs[_0x482c('0x40')](_0x50bff4[_0x482c('0x3d')]['fields']));_0x494d3f[_0x482c('0x41')]=_0x494d3f[_0x482c('0x41')]['length']?_0x494d3f['attributes']:_0x13daa4[_0x482c('0x3c')];_0x494d3f[_0x482c('0x42')]=qs['sort'](_0x50bff4['query'][_0x482c('0x43')]);_0x494d3f['where']=qs['filters'](_[_0x482c('0x46')](_0x50bff4[_0x482c('0x3d')],_0x13daa4[_0x482c('0x45')]));if(_0x50bff4[_0x482c('0x3d')]['filter']){_0x494d3f[_0x482c('0x44')]=_['merge'](_0x494d3f[_0x482c('0x44')],{'$or':_[_0x482c('0x3a')](_0x494d3f[_0x482c('0x41')],function(_0x3465f1){var _0x55ce96={};_0x55ce96[_0x3465f1]={'$like':'%'+_0x50bff4[_0x482c('0x3d')]['filter']+'%'};return _0x55ce96;})});}_0x494d3f=_[_0x482c('0x48')]({},_0x494d3f,_0x50bff4[_0x482c('0x5d')]);return _0x96edd6[_0x482c('0x70')](_0x494d3f);}})['then'](function(_0x12333e){if(_0x12333e){_0x5b6932=_0x12333e[_0x482c('0x50')];if(!_0x50bff4[_0x482c('0x3d')][_0x482c('0x69')](_0x482c('0x6a'))){_0x494d3f['limit']=qs[_0x482c('0x25')](_0x50bff4[_0x482c('0x3d')][_0x482c('0x25')]);_0x494d3f['offset']=qs['offset'](_0x50bff4['query'][_0x482c('0x22')]);}return _0x96edd6[_0x482c('0x70')](_0x494d3f);}})['then'](function(_0x4c1bc0){if(_0x4c1bc0){return _0x4c1bc0?{'count':_0x5b6932,'rows':_0x4c1bc0}:null;}})[_0x482c('0x2b')](respondWithResult(_0x224cee,null))[_0x482c('0x4e')](handleError(_0x224cee,null));};exports[_0x482c('0x71')]=function(_0x1e5538,_0x1f1096,_0x2cdc07){var _0x48e680=_0x1e5538['body'][_0x482c('0x72')];var _0x177305=_['map'](_0x48e680,'id');return db['Team']['findAll']({'where':{'id':_0x177305},'attributes':['id'],'include':[{'model':db['User'],'as':_0x482c('0x73'),'attributes':['id','name',_0x482c('0x74'),_0x482c('0x75'),_0x482c('0x76')],'raw':!![]}]})[_0x482c('0x2b')](function(_0x3e8df6){if(_0x3e8df6){var _0x55e873=_['flatMap'](_0x3e8df6,function(_0x4fdc4d){var _0x49d704=_0x4fdc4d['get']({'plain':!![]});_0x49d704['Agents'][_0x482c('0x77')](function(_0x5eb8c9){_0x5eb8c9[_0x482c('0x78')]=_[_0x482c('0x34')](_0x48e680,{'id':_0x49d704['id']})[_0x482c('0x78')];});return _0x49d704[_0x482c('0x73')];});return db['VoiceQueue'][_0x482c('0x34')]({'where':{'id':_0x1e5538[_0x482c('0x5b')]['id']}})[_0x482c('0x2b')](function(_0x46e589){return db[_0x482c('0x79')]['transaction'](function(_0x454d28){return _0x46e589['addTeams'](_0x177305,{'transaction':_0x454d28})['then'](function(){return BPromise['each'](_0x48e680,function(_0x324de4){return db[_0x482c('0x7a')][_0x482c('0x7b')]({'TeamId':_0x324de4['id'],'VoiceQueueId':_0x1e5538[_0x482c('0x5b')]['id'],'penalty':_0x324de4['penalty']},{'transaction':_0x454d28});});})['then'](function(){return BPromise['each'](_0x55e873,function(_0x1cee52){return db[_0x482c('0x7c')][_0x482c('0x7d')]({'where':{'UserId':_0x1cee52['id'],'VoiceQueueId':_0x1e5538[_0x482c('0x5b')]['id']},'defaults':{'penalty':_0x1cee52[_0x482c('0x78')]},'transaction':_0x454d28});});})[_0x482c('0x2b')](function(){return BPromise[_0x482c('0x7e')](_['filter'](_0x55e873,{'online':!![]}),function(_0x3def96){return db['UserVoiceQueueRt'][_0x482c('0x7b')]({'membername':_0x3def96[_0x482c('0x35')],'UserId':_0x3def96['id'],'queue_name':_0x46e589[_0x482c('0x35')],'VoiceQueueId':_0x46e589['id'],'interface':_[_0x482c('0x7f')](_0x3def96[_0x482c('0x76')])?util[_0x482c('0x80')](_0x482c('0x81'),_0x3def96[_0x482c('0x35')]):_0x3def96['interface'],'paused':_0x3def96['voicePause']||![],'penalty':_0x3def96[_0x482c('0x78')]},{'transaction':_0x454d28});});})[_0x482c('0x2b')](function(){_0x55e873[_0x482c('0x77')](function(_0xcec4c4){socket[_0x482c('0x82')](_0x482c('0x83'),{'UserId':_0xcec4c4['id'],'VoiceQueueId':_0x46e589['id']});});});});});}})[_0x482c('0x2b')](respondWithStatusCode(_0x1f1096,null))[_0x482c('0x4e')](handleError(_0x1f1096,null));};exports[_0x482c('0x84')]=function(_0x1d035f,_0x48f08e,_0x2d8da3){return db[_0x482c('0x6f')][_0x482c('0x65')]({'where':{'id':_0x1d035f[_0x482c('0x3d')][_0x482c('0x85')]},'attributes':['id'],'include':[{'model':db[_0x482c('0x86')],'as':_0x482c('0x73'),'attributes':['id'],'raw':!![]}]})[_0x482c('0x2b')](handleEntityNotFound(_0x48f08e,null))[_0x482c('0x2b')](function(_0x4be0d8){var _0x41f9fe=_[_0x482c('0x3a')](_0x4be0d8,'id');var _0x428d83=[];var _0x35656a=[];var _0x206ae8=squel['select']();_0x206ae8[_0x482c('0x87')](_0x482c('0x88'))[_0x482c('0x89')](_0x482c('0x8a'),'tq')[_0x482c('0x8b')](_0x482c('0x8c'),'ut',_0x482c('0x8d'))['where'](_0x482c('0x8e'),_0x1d035f[_0x482c('0x5b')]['id']);for(var _0x229802=0x0;_0x229802<_0x4be0d8['length'];_0x229802+=0x1){let _0x3428a5=_0x4be0d8[_0x229802];for(var _0xcfeaef=0x0;_0xcfeaef<_0x3428a5[_0x482c('0x73')][_0x482c('0x50')];_0xcfeaef+=0x1){let _0x3fc5c5=_0x3428a5['Agents'][_0xcfeaef];var _0x56c460=_0x206ae8[_0x482c('0x5a')]();_0x56c460[_0x482c('0x44')](_0x482c('0x8f'),_0x3fc5c5['id']);_0x35656a[_0x482c('0x90')](db[_0x482c('0x79')][_0x482c('0x3d')](_0x56c460[_0x482c('0x91')](),{'type':db['sequelize'][_0x482c('0x92')][_0x482c('0x93')]})[_0x482c('0x2b')](function(_0x43d869){if(_0x43d869[_0x482c('0x50')]===0x1){return _0x3fc5c5['id'];}else{var _0x42b724=_[_0x482c('0x94')](_['map'](_0x43d869,_0x482c('0x95')),function(_0x2d48f0){return _[_0x482c('0x32')](_0x41f9fe,_0x2d48f0);});if(_0x42b724){return _0x3fc5c5['id'];}}}));}}return BPromise[_0x482c('0x96')](_0x35656a)[_0x482c('0x2b')](function(_0x197c2b){_0x428d83=_(_0x428d83)[_0x482c('0x97')](_0x197c2b)['compact']()[_0x482c('0x31')]();return db[_0x482c('0x4a')][_0x482c('0x34')]({'where':{'id':_0x1d035f[_0x482c('0x5b')]['id']}})[_0x482c('0x2b')](function(_0x427adc){return db[_0x482c('0x79')][_0x482c('0x98')](function(_0x26cf4a){return _0x427adc[_0x482c('0x84')](_0x1d035f[_0x482c('0x3d')][_0x482c('0x85')],{'transaction':_0x26cf4a})[_0x482c('0x2b')](function(){if(!_['isEmpty'](_0x428d83)){return _0x427adc[_0x482c('0x99')](_0x428d83,{'transaction':_0x26cf4a})[_0x482c('0x2b')](function(){return db[_0x482c('0x9a')]['destroy']({'where':{'VoiceQueueId':_0x1d035f['params']['id'],'UserId':_0x428d83},'transaction':_0x26cf4a});});}})[_0x482c('0x2b')](function(){_0x428d83[_0x482c('0x77')](function(_0x2671e7){socket[_0x482c('0x82')]('userVoiceQueue:remove',{'UserId':_0x2671e7,'VoiceQueueId':_0x427adc['id']});});});});});});})['then'](respondWithStatusCode(_0x48f08e,null))[_0x482c('0x4e')](handleError(_0x48f08e,null));};exports['addAgents']=function(_0x34a3b1,_0x1ecf1f,_0x192157){var _0x3081e1,_0x2c910f;return db[_0x482c('0x4a')]['find']({'where':{'id':_0x34a3b1['params']['id']}})[_0x482c('0x2b')](handleEntityNotFound(_0x1ecf1f,null))[_0x482c('0x2b')](function(_0x53ffa1){if(_0x53ffa1){_0x2c910f=_0x53ffa1;return _0x53ffa1[_0x482c('0x9b')](_0x34a3b1[_0x482c('0x52')][_0x482c('0x85')],_[_0x482c('0x5e')](_0x34a3b1['body'],[_0x482c('0x85'),'id'])||{})[_0x482c('0x9c')](function(_0x23ab40){for(var _0x107451=0x0;_0x107451<_0x34a3b1['body'][_0x482c('0x85')][_0x482c('0x50')];_0x107451+=0x1){socket[_0x482c('0x82')](_0x482c('0x83'),{'UserId':Number(_0x34a3b1[_0x482c('0x52')][_0x482c('0x85')][_0x107451]),'VoiceQueueId':Number(_0x34a3b1[_0x482c('0x5b')]['id'])});}return _0x23ab40;});}})[_0x482c('0x2b')](function(_0x4c3b5d){_0x3081e1=_0x4c3b5d||[];if(_0x2c910f){return db[_0x482c('0x86')][_0x482c('0x65')]({'where':{'id':_0x34a3b1['body'][_0x482c('0x85')]},'attributes':['id',_0x482c('0x35'),_0x482c('0x74'),_0x482c('0x75'),'interface'],'raw':!![]});}})[_0x482c('0x2b')](function(_0x312646){if(!_[_0x482c('0x9d')](_0x312646)){var _0x29c11e=[];for(var _0xb54a39=0x0;_0xb54a39<_0x312646[_0x482c('0x50')];_0xb54a39++){if(_0x312646[_0xb54a39][_0x482c('0x74')]){_0x29c11e[_0x482c('0x90')](db[_0x482c('0x9a')]['upsert']({'membername':_0x312646[_0xb54a39][_0x482c('0x35')],'UserId':_0x312646[_0xb54a39]['id'],'queue_name':_0x2c910f[_0x482c('0x35')],'VoiceQueueId':_0x2c910f['id'],'interface':_[_0x482c('0x7f')](_0x312646[_0xb54a39]['interface'])?util[_0x482c('0x80')](_0x482c('0x81'),_0x312646[_0xb54a39]['name']):_0x312646[_0xb54a39][_0x482c('0x76')],'paused':_0x312646[_0xb54a39]['voicePause']||![],'penalty':_0x34a3b1['body'][_0x482c('0x78')]||0x0}));}}return BPromise[_0x482c('0x96')](_0x29c11e);}})['then'](function(){return _0x3081e1;})[_0x482c('0x2b')](respondWithResult(_0x1ecf1f,null))[_0x482c('0x4e')](handleError(_0x1ecf1f,null));};exports['removeAgents']=function(_0x2158bd,_0x308629,_0x3da5b5){return db['VoiceQueue'][_0x482c('0x34')]({'where':{'id':_0x2158bd['params']['id']}})[_0x482c('0x2b')](handleEntityNotFound(_0x308629,null))['then'](function(_0x42ef05){if(_0x42ef05){return _0x42ef05[_0x482c('0x99')](_0x2158bd['query'][_0x482c('0x85')])['then'](function(){if(_[_0x482c('0x9e')](_0x2158bd[_0x482c('0x3d')][_0x482c('0x85')])){for(var _0x520cb2=0x0;_0x520cb2<_0x2158bd[_0x482c('0x3d')][_0x482c('0x85')][_0x482c('0x50')];_0x520cb2+=0x1){socket[_0x482c('0x82')](_0x482c('0x9f'),{'UserId':Number(_0x2158bd[_0x482c('0x3d')]['ids'][_0x520cb2]),'VoiceQueueId':Number(_0x2158bd[_0x482c('0x5b')]['id'])});}}else{socket[_0x482c('0x82')](_0x482c('0x9f'),{'UserId':Number(_0x2158bd[_0x482c('0x3d')][_0x482c('0x85')]),'VoiceQueueId':Number(_0x2158bd[_0x482c('0x5b')]['id'])});}});}})[_0x482c('0x2b')](function(_0xc69633){return db['UserVoiceQueueRt'][_0x482c('0x2a')]({'where':{'VoiceQueueId':_0x2158bd['params']['id'],'UserId':_0x2158bd[_0x482c('0x3d')]['ids']}})[_0x482c('0x2b')](function(){return _0xc69633;});})[_0x482c('0x2b')](respondWithStatusCode(_0x308629,null))[_0x482c('0x4e')](handleError(_0x308629,null));};exports[_0x482c('0xa0')]=function(_0x49b429,_0x561691,_0x59b64c){var _0x581ed9={};var _0x21019e={};var _0x1ab33b;var _0x469f7c;return db[_0x482c('0x4a')][_0x482c('0x67')]({'where':{'id':_0x49b429['params']['id']}})[_0x482c('0x2b')](handleEntityNotFound(_0x561691,null))[_0x482c('0x2b')](function(_0x424870){if(_0x424870){_0x1ab33b=_0x424870;_0x21019e[_0x482c('0x3c')]=_[_0x482c('0x3e')](db['User'][_0x482c('0x5c')]);_0x21019e[_0x482c('0x3d')]=_[_0x482c('0x3e')](_0x49b429[_0x482c('0x3d')]);_0x21019e[_0x482c('0x45')]=_[_0x482c('0x3f')](_0x21019e[_0x482c('0x3c')],_0x21019e[_0x482c('0x3d')]);_0x581ed9[_0x482c('0x41')]=_[_0x482c('0x3f')](_0x21019e[_0x482c('0x3c')],qs['fields'](_0x49b429[_0x482c('0x3d')][_0x482c('0x40')]));_0x581ed9[_0x482c('0x41')]=_0x581ed9[_0x482c('0x41')][_0x482c('0x50')]?_0x581ed9[_0x482c('0x41')]:_0x21019e[_0x482c('0x3c')];_0x581ed9['order']=qs['sort'](_0x49b429[_0x482c('0x3d')]['sort']);_0x581ed9[_0x482c('0x44')]=qs[_0x482c('0x45')](_['pick'](_0x49b429[_0x482c('0x3d')],_0x21019e[_0x482c('0x45')]));if(_0x49b429['query'][_0x482c('0x47')]){_0x581ed9[_0x482c('0x44')]=_[_0x482c('0x48')](_0x581ed9[_0x482c('0x44')],{'$or':_[_0x482c('0x3a')](_0x581ed9[_0x482c('0x41')],function(_0xd2b6ae){var _0x556f36={};_0x556f36[_0xd2b6ae]={'$like':'%'+_0x49b429[_0x482c('0x3d')]['filter']+'%'};return _0x556f36;})});}_0x581ed9=_['merge']({},_0x581ed9,_0x49b429[_0x482c('0x5d')]);return _0x1ab33b[_0x482c('0xa0')](_0x581ed9);}})[_0x482c('0x2b')](function(_0x457613){if(_0x457613){_0x469f7c=_0x457613['length'];if(!_0x49b429[_0x482c('0x3d')]['hasOwnProperty']('nolimit')){_0x581ed9[_0x482c('0x25')]=qs[_0x482c('0x25')](_0x49b429[_0x482c('0x3d')][_0x482c('0x25')]);_0x581ed9[_0x482c('0x22')]=qs[_0x482c('0x22')](_0x49b429[_0x482c('0x3d')][_0x482c('0x22')]);}return _0x1ab33b[_0x482c('0xa0')](_0x581ed9);}})['then'](function(_0x28e7c3){if(_0x28e7c3){return _0x28e7c3?{'count':_0x469f7c,'rows':_0x28e7c3}:null;}})[_0x482c('0x2b')](respondWithResult(_0x561691,null))['catch'](handleError(_0x561691,null));};exports[_0x482c('0xa1')]=function(_0x47d330,_0x36e33f,_0x430e34){var _0x5196ed={};var _0x39af7a={};var _0x2c08ea;var _0x461b60;return db['VoiceQueue']['findOne']({'where':{'id':_0x47d330[_0x482c('0x5b')]['id']}})[_0x482c('0x2b')](handleEntityNotFound(_0x36e33f,null))[_0x482c('0x2b')](function(_0x44d43c){if(_0x44d43c){_0x2c08ea=_0x44d43c;_0x39af7a['model']=_[_0x482c('0x3e')](db['UserVoiceQueueRt'][_0x482c('0x5c')]);_0x39af7a[_0x482c('0x3d')]=_[_0x482c('0x3e')](_0x47d330[_0x482c('0x3d')]);_0x39af7a[_0x482c('0x45')]=_[_0x482c('0x3f')](_0x39af7a[_0x482c('0x3c')],_0x39af7a[_0x482c('0x3d')]);_0x5196ed[_0x482c('0x41')]=_[_0x482c('0x3f')](_0x39af7a[_0x482c('0x3c')],qs[_0x482c('0x40')](_0x47d330[_0x482c('0x3d')]['fields']));_0x5196ed[_0x482c('0x41')]=_0x5196ed[_0x482c('0x41')][_0x482c('0x50')]?_0x5196ed['attributes']:_0x39af7a[_0x482c('0x3c')];_0x5196ed[_0x482c('0x42')]=qs[_0x482c('0x43')](_0x47d330[_0x482c('0x3d')]['sort']);_0x5196ed[_0x482c('0x44')]=qs[_0x482c('0x45')](_[_0x482c('0x46')](_0x47d330[_0x482c('0x3d')],_0x39af7a['filters']));if(_0x47d330[_0x482c('0x3d')][_0x482c('0x47')]){_0x5196ed['where']=_[_0x482c('0x48')](_0x5196ed[_0x482c('0x44')],{'$or':_[_0x482c('0x3a')](_0x5196ed[_0x482c('0x41')],function(_0x3963a1){var _0x5b650d={};_0x5b650d[_0x3963a1]={'$like':'%'+_0x47d330[_0x482c('0x3d')][_0x482c('0x47')]+'%'};return _0x5b650d;})});}_0x5196ed=_[_0x482c('0x48')]({},_0x5196ed,_0x47d330['options']);return _0x2c08ea[_0x482c('0xa1')](_0x5196ed);}})[_0x482c('0x2b')](function(_0x409615){if(_0x409615){_0x461b60=_0x409615[_0x482c('0x50')];if(!_0x47d330[_0x482c('0x3d')][_0x482c('0x69')](_0x482c('0x6a'))){_0x5196ed[_0x482c('0x25')]=qs['limit'](_0x47d330[_0x482c('0x3d')][_0x482c('0x25')]);_0x5196ed[_0x482c('0x22')]=qs['offset'](_0x47d330[_0x482c('0x3d')]['offset']);}return _0x2c08ea[_0x482c('0xa1')](_0x5196ed);}})['then'](function(_0x2bf0b5){return _0x2bf0b5?{'count':_0x461b60,'rows':_0x2bf0b5}:null;})[_0x482c('0x2b')](respondWithResult(_0x36e33f,null))[_0x482c('0x4e')](handleError(_0x36e33f,null));};exports[_0x482c('0xa2')]=function(_0x5d55c1,_0xf4358d,_0x158298){var _0x12b5e3={};var _0x4fa849={};var _0x2a92ad;var _0x3ed0ba;return db[_0x482c('0x4a')][_0x482c('0x67')]({'where':{'id':_0x5d55c1[_0x482c('0x5b')]['id']}})[_0x482c('0x2b')](handleEntityNotFound(_0xf4358d,null))['then'](function(_0x28bb2d){if(_0x28bb2d){_0x2a92ad=_0x28bb2d;_0x4fa849[_0x482c('0x3c')]=_[_0x482c('0x3e')](db[_0x482c('0xa3')]['rawAttributes']);_0x4fa849['query']=_['keys'](_0x5d55c1['query']);_0x4fa849[_0x482c('0x45')]=_['intersection'](_0x4fa849[_0x482c('0x3c')],_0x4fa849[_0x482c('0x3d')]);_0x12b5e3[_0x482c('0x41')]=_[_0x482c('0x3f')](_0x4fa849['model'],qs['fields'](_0x5d55c1['query']['fields']));_0x12b5e3[_0x482c('0x41')]=_0x12b5e3[_0x482c('0x41')]['length']?_0x12b5e3[_0x482c('0x41')]:_0x4fa849[_0x482c('0x3c')];_0x12b5e3['order']=qs[_0x482c('0x43')](_0x5d55c1[_0x482c('0x3d')][_0x482c('0x43')]);_0x12b5e3['where']=qs[_0x482c('0x45')](_['pick'](_0x5d55c1['query'],_0x4fa849[_0x482c('0x45')]));if(_0x5d55c1[_0x482c('0x3d')]['filter']){_0x12b5e3[_0x482c('0x44')]=_[_0x482c('0x48')](_0x12b5e3[_0x482c('0x44')],{'$or':_[_0x482c('0x3a')](_0x12b5e3['attributes'],function(_0x1fa02d){var _0x354e37={};_0x354e37[_0x1fa02d]={'$like':'%'+_0x5d55c1[_0x482c('0x3d')][_0x482c('0x47')]+'%'};return _0x354e37;})});}_0x12b5e3=_[_0x482c('0x48')]({},_0x12b5e3,_0x5d55c1[_0x482c('0x5d')]);return _0x2a92ad[_0x482c('0xa2')](_0x12b5e3);}})[_0x482c('0x2b')](function(_0x10855b){if(_0x10855b){_0x3ed0ba=_0x10855b[_0x482c('0x50')];if(!_0x5d55c1['query'][_0x482c('0x69')](_0x482c('0x6a'))){_0x12b5e3[_0x482c('0x25')]=qs['limit'](_0x5d55c1[_0x482c('0x3d')][_0x482c('0x25')]);_0x12b5e3[_0x482c('0x22')]=qs['offset'](_0x5d55c1['query'][_0x482c('0x22')]);}return _0x2a92ad[_0x482c('0xa2')](_0x12b5e3);}})[_0x482c('0x2b')](function(_0x296233){if(_0x296233){return _0x296233?{'count':_0x3ed0ba,'rows':_0x296233}:null;}})[_0x482c('0x2b')](respondWithResult(_0xf4358d,null))[_0x482c('0x4e')](handleError(_0xf4358d,null));};exports['addLists']=function(_0xb9756c,_0x23ca09,_0x3e5bcd){var _0x32aa97=moment()[_0x482c('0x80')](_0x482c('0xa4'));var _0x5671c7,_0x103e97;return db[_0x482c('0x4a')]['find']({'where':{'id':_0xb9756c[_0x482c('0x5b')]['id']}})[_0x482c('0x2b')](handleEntityNotFound(_0x23ca09,null))[_0x482c('0x2b')](function(_0x402dbd){if(_0x402dbd){_0x103e97=_0x402dbd;return _0x402dbd[_0x482c('0xa5')](_0xb9756c['body'][_0x482c('0x85')],_[_0x482c('0x5e')](_0xb9756c['body'],[_0x482c('0x85'),'id'])||{});}return null;})[_0x482c('0x9c')](function(_0x37e579){var _0x52c912;_0x5671c7=_0x37e579||[];var _0x533070=[];if(_0x37e579){for(var _0xdd5495=0x0;_0xdd5495<_0x37e579[_0x482c('0x50')];_0xdd5495+=0x1){var _0x422e8d=_0x37e579[_0xdd5495][_0x482c('0x2c')]({'plain':!![]});_0x103e97[_0x482c('0xa6')]=_0xb9756c['body']['dialCheckDuplicateType']?_0xb9756c['body'][_0x482c('0xa6')]:_0x103e97[_0x482c('0xa6')];switch(_0x103e97[_0x482c('0xa6')]){case _0x482c('0xa7'):_0x52c912=squel[_0x482c('0xa8')]()[_0x482c('0xa9')](_0x482c('0xaa'))[_0x482c('0xab')](['phone',_0x482c('0xac'),_0x482c('0xad'),'ListId',_0x482c('0x63'),'createdAt',_0x482c('0x60')],squel['select']()[_0x482c('0x87')](_0x482c('0xae'),_0x482c('0xae'))[_0x482c('0x87')]('\x27'+_0x32aa97+'\x27',_0x482c('0xac'))['field']('id',_0x482c('0xad'))['field'](_0x422e8d['CmListId'][_0x482c('0x91')](),_0x482c('0xaf'))[_0x482c('0x87')](_0xb9756c[_0x482c('0x5b')]['id'][_0x482c('0x91')](),_0x482c('0x63'))[_0x482c('0x87')]('\x27'+_0x32aa97+'\x27',_0x482c('0x5f'))[_0x482c('0x87')]('\x27'+_0x32aa97+'\x27',_0x482c('0x60'))[_0x482c('0x89')](_0x482c('0xb0'))[_0x482c('0x44')](_0x482c('0xb1'))[_0x482c('0x44')](_0x482c('0xb2'),_0x422e8d[_0x482c('0xb3')][_0x482c('0x91')]())['where']('phone\x20IS\x20NOT\x20NULL')['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x482c('0xb4')]()[_0x482c('0x87')](_0x482c('0xb5'))[_0x482c('0x89')](_0x482c('0xb6'))[_0x482c('0x44')]('VoiceQueueId\x20=\x20?',_0xb9756c[_0x482c('0x5b')]['id']['toString']()))['where'](_0x482c('0xb7'),squel['select']()[_0x482c('0x87')](_0x482c('0xb8'))['from'](_0x482c('0xaa'))['where'](_0x482c('0x8e'),_0xb9756c['params']['id'][_0x482c('0x91')]())))[_0x482c('0x91')]();break;case _0x482c('0xb9'):_0x52c912=squel[_0x482c('0xa8')]()[_0x482c('0xa9')](_0x482c('0xaa'))[_0x482c('0xab')]([_0x482c('0xae'),_0x482c('0xac'),_0x482c('0xad'),'ListId',_0x482c('0x63'),_0x482c('0x5f'),_0x482c('0x60')],squel[_0x482c('0xb4')]()['field'](_0x482c('0xae'),_0x482c('0xae'))[_0x482c('0x87')]('\x27'+_0x32aa97+'\x27',_0x482c('0xac'))[_0x482c('0x87')]('id',_0x482c('0xad'))[_0x482c('0x87')](_0x422e8d['CmListId']['toString'](),'ListId')[_0x482c('0x87')](_0xb9756c[_0x482c('0x5b')]['id'][_0x482c('0x91')](),'VoiceQueueId')[_0x482c('0x87')]('\x27'+_0x32aa97+'\x27','createdAt')[_0x482c('0x87')]('\x27'+_0x32aa97+'\x27',_0x482c('0x60'))['from']('cm_contacts')[_0x482c('0x44')](_0x482c('0xb1'))[_0x482c('0x44')](_0x482c('0xb2'),_0x422e8d[_0x482c('0xb3')]['toString']())[_0x482c('0x44')](_0x482c('0xba'))[_0x482c('0x44')](_0x482c('0xb7'),squel['select']()[_0x482c('0x87')](_0x482c('0xb8'))[_0x482c('0x89')](_0x482c('0xaa'))[_0x482c('0x44')](_0x482c('0x8e'),_0xb9756c[_0x482c('0x5b')]['id'][_0x482c('0x91')]())))[_0x482c('0x91')]();break;default:_0x52c912=squel['insert']()[_0x482c('0xa9')](_0x482c('0xaa'))['fromQuery']([_0x482c('0xae'),_0x482c('0xac'),_0x482c('0xad'),_0x482c('0xaf'),'VoiceQueueId',_0x482c('0x5f'),_0x482c('0x60')],squel[_0x482c('0xb4')]()[_0x482c('0x87')](_0x482c('0xae'),'phone')[_0x482c('0x87')]('\x27'+_0x32aa97+'\x27',_0x482c('0xac'))['field']('id',_0x482c('0xad'))[_0x482c('0x87')](_0x422e8d[_0x482c('0xb3')][_0x482c('0x91')](),'ListId')[_0x482c('0x87')](_0xb9756c[_0x482c('0x5b')]['id'][_0x482c('0x91')](),_0x482c('0x63'))[_0x482c('0x87')]('\x27'+_0x32aa97+'\x27',_0x482c('0x5f'))[_0x482c('0x87')]('\x27'+_0x32aa97+'\x27',_0x482c('0x60'))[_0x482c('0x89')](_0x482c('0xb0'))[_0x482c('0x44')](_0x482c('0xb1'))['where'](_0x482c('0xb2'),_0x422e8d[_0x482c('0xb3')][_0x482c('0x91')]())[_0x482c('0x44')](_0x482c('0xba')))[_0x482c('0x91')]();}_0x533070[_0x482c('0x90')](db['sequelize'][_0x482c('0x3d')](_0x52c912));}return BPromise[_0x482c('0x96')](_0x533070);}})[_0x482c('0x2b')](function(){var _0x370056=[];var _0x535e08=squel[_0x482c('0xa8')]()[_0x482c('0xa9')](_0x482c('0xbb'))[_0x482c('0xab')]([_0x482c('0xbc'),_0x482c('0xae'),'OrderBy',_0x482c('0x5f'),'updatedAt'],squel[_0x482c('0xb4')]()[_0x482c('0x87')]('h.id')[_0x482c('0x87')](_0x482c('0xbd'))[_0x482c('0x87')](_0x482c('0xbe'))[_0x482c('0x87')]('\x27'+_0x32aa97+'\x27','createdAt')[_0x482c('0x87')]('\x27'+_0x32aa97+'\x27',_0x482c('0x60'))['from']('cm_contact_has_items','ci')['join'](_0x482c('0xaa'),'h',_0x482c('0xbf'))['where'](_0x482c('0xc0'),_0x32aa97)[_0x482c('0x44')](_0x482c('0xc1'),_0x482c('0xc2')))[_0x482c('0x91')]();_0x370056['push'](db['sequelize'][_0x482c('0x3d')](_0x535e08));return BPromise[_0x482c('0x96')](_0x370056);})[_0x482c('0x2b')](function(){return _0x5671c7;})[_0x482c('0x2b')](respondWithResult(_0x23ca09,null))['catch'](handleError(_0x23ca09,null));};exports[_0x482c('0xc3')]=function(_0x3d1aa5,_0x13a72c,_0x63aeab){return db[_0x482c('0x4a')][_0x482c('0x34')]({'where':{'id':_0x3d1aa5[_0x482c('0x5b')]['id']}})['then'](handleEntityNotFound(_0x13a72c,null))[_0x482c('0x2b')](function(_0x7b6187){if(_0x7b6187){return _0x7b6187[_0x482c('0xc3')](_0x3d1aa5[_0x482c('0x3d')][_0x482c('0x85')]);}})[_0x482c('0x2b')](function(_0x4ca130){if(_0x4ca130){return db[_0x482c('0x64')][_0x482c('0x2a')]({'where':{'ListId':_0x3d1aa5[_0x482c('0x3d')][_0x482c('0x85')],'VoiceQueueId':_0x3d1aa5['params']['id']}})[_0x482c('0x2b')](function(){return _0x4ca130;});}})['then'](respondWithStatusCode(_0x13a72c,null))[_0x482c('0x4e')](handleError(_0x13a72c,null));};exports[_0x482c('0xc4')]=function(_0x33b6a6,_0x1ab586,_0x49140c){var _0x105a3c={};var _0x5b6d0b={};var _0x44c11d;var _0x47207f;return db['VoiceQueue']['findOne']({'where':{'id':_0x33b6a6[_0x482c('0x5b')]['id']}})[_0x482c('0x2b')](handleEntityNotFound(_0x1ab586,null))['then'](function(_0x360fd7){if(_0x360fd7){_0x44c11d=_0x360fd7;_0x5b6d0b[_0x482c('0x3c')]=_[_0x482c('0x3e')](db['CmList'][_0x482c('0x5c')]);_0x5b6d0b[_0x482c('0x3d')]=_['keys'](_0x33b6a6[_0x482c('0x3d')]);_0x5b6d0b[_0x482c('0x45')]=_[_0x482c('0x3f')](_0x5b6d0b[_0x482c('0x3c')],_0x5b6d0b['query']);_0x105a3c['attributes']=_[_0x482c('0x3f')](_0x5b6d0b['model'],qs[_0x482c('0x40')](_0x33b6a6[_0x482c('0x3d')][_0x482c('0x40')]));_0x105a3c[_0x482c('0x41')]=_0x105a3c[_0x482c('0x41')][_0x482c('0x50')]?_0x105a3c[_0x482c('0x41')]:_0x5b6d0b[_0x482c('0x3c')];_0x105a3c[_0x482c('0x42')]=qs[_0x482c('0x43')](_0x33b6a6['query'][_0x482c('0x43')]);_0x105a3c['where']=qs[_0x482c('0x45')](_[_0x482c('0x46')](_0x33b6a6[_0x482c('0x3d')],_0x5b6d0b[_0x482c('0x45')]));if(_0x33b6a6[_0x482c('0x3d')][_0x482c('0x47')]){_0x105a3c[_0x482c('0x44')]=_[_0x482c('0x48')](_0x105a3c[_0x482c('0x44')],{'$or':_[_0x482c('0x3a')](_0x105a3c[_0x482c('0x41')],function(_0x38538c){var _0x4e791c={};_0x4e791c[_0x38538c]={'$like':'%'+_0x33b6a6[_0x482c('0x3d')][_0x482c('0x47')]+'%'};return _0x4e791c;})});}_0x105a3c=_[_0x482c('0x48')]({},_0x105a3c,_0x33b6a6[_0x482c('0x5d')]);return _0x44c11d['getBlackLists'](_0x105a3c);}})['then'](function(_0x3cc319){if(_0x3cc319){_0x47207f=_0x3cc319[_0x482c('0x50')];if(!_0x33b6a6[_0x482c('0x3d')][_0x482c('0x69')](_0x482c('0x6a'))){_0x105a3c[_0x482c('0x25')]=qs['limit'](_0x33b6a6[_0x482c('0x3d')][_0x482c('0x25')]);_0x105a3c[_0x482c('0x22')]=qs[_0x482c('0x22')](_0x33b6a6['query'][_0x482c('0x22')]);}return _0x44c11d[_0x482c('0xc4')](_0x105a3c);}})['then'](function(_0xd3b6aa){if(_0xd3b6aa){return _0xd3b6aa?{'count':_0x47207f,'rows':_0xd3b6aa}:null;}})['then'](respondWithResult(_0x1ab586,null))[_0x482c('0x4e')](handleError(_0x1ab586,null));};exports[_0x482c('0xc5')]=function(_0xba3b16,_0x460f29,_0x272055){var _0xb8bbf1,_0xadac9f;return db[_0x482c('0x4a')][_0x482c('0x34')]({'where':{'id':_0xba3b16[_0x482c('0x5b')]['id']}})['then'](handleEntityNotFound(_0x460f29,null))['then'](function(_0x3756b8){if(_0x3756b8){_0xadac9f=_0x3756b8;return _0x3756b8[_0x482c('0xc5')](_0xba3b16[_0x482c('0x52')][_0x482c('0x85')],_['omit'](_0xba3b16['body'],[_0x482c('0x85'),'id'])||{});}return null;})[_0x482c('0x9c')](function(_0x39fd6a){var _0x68f127;_0xb8bbf1=_0x39fd6a||[];var _0x52943f=[];if(_0x39fd6a){for(var _0x248fcb=0x0;_0x248fcb<_0x39fd6a['length'];_0x248fcb+=0x1){var _0x4b1b94=_0x39fd6a[_0x248fcb][_0x482c('0x2c')]({'plain':!![]});_0x68f127=squel['insert']()[_0x482c('0xa9')](_0x482c('0xc6'))['fromQuery']([_0x482c('0xae'),_0x482c('0xad'),'ListId',_0x482c('0x63'),_0x482c('0x5f'),_0x482c('0x60')],squel[_0x482c('0xb4')]()['field'](_0x482c('0xae'),_0x482c('0xae'))[_0x482c('0x87')]('id',_0x482c('0xad'))[_0x482c('0x87')](_0x4b1b94[_0x482c('0xb3')][_0x482c('0x91')](),'ListId')['field'](_0xba3b16[_0x482c('0x5b')]['id'][_0x482c('0x91')](),_0x482c('0x63'))[_0x482c('0x87')]('NOW()',_0x482c('0x5f'))[_0x482c('0x87')](_0x482c('0xc7'),_0x482c('0x60'))[_0x482c('0x89')](_0x482c('0xb0'))[_0x482c('0x44')](_0x482c('0xb1'))[_0x482c('0x44')](_0x482c('0xb2'),_0x4b1b94[_0x482c('0xb3')][_0x482c('0x91')]())[_0x482c('0x44')](_0x482c('0xba')))[_0x482c('0x91')]();_0x52943f['push'](db[_0x482c('0x79')][_0x482c('0x3d')](_0x68f127));}return BPromise['all'](_0x52943f);}})[_0x482c('0x2b')](function(){return _0xb8bbf1;})[_0x482c('0x2b')](respondWithResult(_0x460f29,null))['catch'](handleError(_0x460f29,null));};exports[_0x482c('0xc8')]=function(_0x38e0ec,_0x315e2d,_0x53c490){return db[_0x482c('0x4a')][_0x482c('0x34')]({'where':{'id':_0x38e0ec[_0x482c('0x5b')]['id']}})[_0x482c('0x2b')](handleEntityNotFound(_0x315e2d,null))['then'](function(_0x1cd810){if(_0x1cd810){return _0x1cd810[_0x482c('0xc8')](_0x38e0ec[_0x482c('0x3d')][_0x482c('0x85')]);}})[_0x482c('0x2b')](function(_0xa42296){if(_0xa42296){return db[_0x482c('0x6e')]['destroy']({'where':{'ListId':_0x38e0ec[_0x482c('0x3d')][_0x482c('0x85')],'VoiceQueueId':_0x38e0ec[_0x482c('0x5b')]['id']}})[_0x482c('0x2b')](function(){return _0xa42296;});}})[_0x482c('0x2b')](respondWithStatusCode(_0x315e2d,null))[_0x482c('0x4e')](handleError(_0x315e2d,null));};
\ No newline at end of file
+var _0x03db=['map','value','includes','type','find','name','UserProfileResource','sendStatus','stack','send','index','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','filters','merge','VIRTUAL','options','VoiceQueue','include','findAll','show','includeAll','catch','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','QueueCampaigns','outbound','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','rawAttributes','omit','createdAt','updatedAt','body','error','getHoppers','CmHopper','sort','VoiceQueueId','getHopperHistories','findOne','CmHopperHistory','pick','CmHopperFinal','rows','getHopperBlacks','CmHopperBlack','getTeams','addTeams','teams','Team','User','Agents','online','interface','flatMap','penalty','sequelize','transaction','each','TeamVoiceQueue','upsert','UserVoiceQueue','UserVoiceQueueRt','format','forEach','userVoiceQueue:save','removeTeams','ids','field','tq.TeamId','from','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','TeamId','all','union','compact','isEmpty','removeAgents','emit','userVoiceQueue:remove','addAgents','spread','voicePause','isArray','getAgents','getMembers','getLists','CmList','addLists','YYYY-MM-DD\x20HH:mm:ss','dialCheckDuplicateType','always','into','fromQuery','phone','scheduledAt','ContactId','ListId','select','cm_contacts','ListId\x20=\x20?','CmListId','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','COALESCE(phone,\x27\x27)','cm_hopper','insert','deletedAt\x20IS\x20NULL','cm_hopper_additional_phones','OrderBy','h.id','ci.item','ci.OrderBy+1','cm_contact_has_items','join','ci.ItemClass=?','PHONE','removeLists','getBlackLists','addBlackLists','cm_hopper_black','NOW()','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../mysqldb','redis','socket.io-emitter','./voiceQueue.socket','register','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','update','then','destroy','VoiceQueues','inbound','filter','ignore'];(function(_0x5652d3,_0x543250){var _0x17a8c2=function(_0x1ffe4d){while(--_0x1ffe4d){_0x5652d3['push'](_0x5652d3['shift']());}};_0x17a8c2(++_0x543250);}(_0x03db,0x156));var _0xb03d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x03db[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xb03d('0x0'));var rimraf=require(_0xb03d('0x1'));var zipdir=require(_0xb03d('0x2'));var jsonpatch=require(_0xb03d('0x3'));var rp=require('request-promise');var moment=require(_0xb03d('0x4'));var BPromise=require(_0xb03d('0x5'));var Mustache=require(_0xb03d('0x6'));var util=require(_0xb03d('0x7'));var path=require(_0xb03d('0x8'));var sox=require('sox');var csv=require(_0xb03d('0x9'));var ejs=require(_0xb03d('0xa'));var fs=require('fs');var fs_extra=require(_0xb03d('0xb'));var _=require('lodash');var squel=require(_0xb03d('0xc'));var crypto=require('crypto');var jsforce=require(_0xb03d('0xd'));var deskjs=require(_0xb03d('0xe'));var toCsv=require(_0xb03d('0x9'));var querystring=require(_0xb03d('0xf'));var Papa=require(_0xb03d('0x10'));var Redis=require(_0xb03d('0x11'));var authService=require(_0xb03d('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xb03d('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xb03d('0x14'));var utils=require(_0xb03d('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xb03d('0x16'))['db'];config['redis']=_['defaults'](config[_0xb03d('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0xb03d('0x18'))(new Redis(config[_0xb03d('0x17')]));require(_0xb03d('0x19'))[_0xb03d('0x1a')](socket);function respondWithStatusCode(_0x1e85d5,_0x2fb19e){_0x2fb19e=_0x2fb19e||0xcc;return function(_0x443fed){if(_0x443fed){return _0x1e85d5['sendStatus'](_0x2fb19e);}return _0x1e85d5[_0xb03d('0x1b')](_0x2fb19e)[_0xb03d('0x1c')]();};}function respondWithResult(_0x2de6db,_0x5980a6){_0x5980a6=_0x5980a6||0xc8;return function(_0x5ca81f){if(_0x5ca81f){return _0x2de6db[_0xb03d('0x1b')](_0x5980a6)[_0xb03d('0x1d')](_0x5ca81f);}};}function respondWithFilteredResult(_0xc0a76a,_0x10b526){return function(_0x17398a){if(_0x17398a){var _0x54fd94=typeof _0x10b526[_0xb03d('0x1e')]===_0xb03d('0x1f')&&typeof _0x10b526['limit']===_0xb03d('0x1f');var _0xfd13c6=_0x17398a[_0xb03d('0x20')];var _0x29c20=_0x54fd94?0x0:_0x10b526[_0xb03d('0x1e')];var _0x331d45=_0x54fd94?_0x17398a[_0xb03d('0x20')]:_0x10b526[_0xb03d('0x1e')]+_0x10b526[_0xb03d('0x21')];var _0x491105;if(_0x331d45>=_0xfd13c6){_0x331d45=_0xfd13c6;_0x491105=0xc8;}else{_0x491105=0xce;}_0xc0a76a['status'](_0x491105);return _0xc0a76a[_0xb03d('0x22')](_0xb03d('0x23'),_0x29c20+'-'+_0x331d45+'/'+_0xfd13c6)[_0xb03d('0x1d')](_0x17398a);}return null;};}function patchUpdates(_0x809c5f){return function(_0x3de6fd){try{jsonpatch['apply'](_0x3de6fd,_0x809c5f,!![]);}catch(_0x380844){return BPromise[_0xb03d('0x24')](_0x380844);}return _0x3de6fd['save']();};}function saveUpdates(_0x2e6783,_0x233761){return function(_0x50885d){if(_0x50885d){return _0x50885d[_0xb03d('0x25')](_0x2e6783)[_0xb03d('0x26')](function(_0x594009){return _0x594009;});}return null;};}function removeEntity(_0xdc21cf,_0x350fe6){return function(_0x2217b1){if(_0x2217b1){return _0x2217b1[_0xb03d('0x27')]()['then'](function(){var _0x214144=_0x2217b1['get']({'plain':!![]});var _0x23f24c=[{'name':_0xb03d('0x28'),'value':_0xb03d('0x29'),'ignore':![]},{'name':'QueueCampaigns','value':'outbound','ignore':![]}];var _0x5c70ad=_(_0x23f24c)[_0xb03d('0x2a')](_0xb03d('0x2b'))[_0xb03d('0x2c')]('value')[_0xb03d('0x2d')]();if(_[_0xb03d('0x2e')](_0x5c70ad,_0x214144[_0xb03d('0x2f')])){return;}var _0x3f9851=_[_0xb03d('0x30')](_0x23f24c,['value',_0x214144[_0xb03d('0x2f')]])[_0xb03d('0x31')];return db[_0xb03d('0x32')][_0xb03d('0x27')]({'where':{'type':_0x3f9851,'resourceId':_0x214144['id']}})[_0xb03d('0x26')](function(){return _0x2217b1;});})[_0xb03d('0x26')](function(){_0xdc21cf[_0xb03d('0x1b')](0xcc)[_0xb03d('0x1c')]();});}};}function handleEntityNotFound(_0x5f615b,_0x3c7a44){return function(_0x57434c){if(!_0x57434c){_0x5f615b[_0xb03d('0x33')](0x194);}return _0x57434c;};}function handleError(_0x5eeaeb,_0x2ae830){_0x2ae830=_0x2ae830||0x1f4;return function(_0x3639f8){logger['error'](_0x3639f8[_0xb03d('0x34')]);if(_0x3639f8[_0xb03d('0x31')]){delete _0x3639f8['name'];}_0x5eeaeb[_0xb03d('0x1b')](_0x2ae830)[_0xb03d('0x35')](_0x3639f8);};}exports[_0xb03d('0x36')]=function(_0x4a8d37,_0x3cc531){var _0x216cd2={},_0xb1ec44={},_0x2178ad={'count':0x0,'rows':[]};var _0x12ff94=_['map'](db['VoiceQueue']['rawAttributes'],function(_0x3b9d0d){return{'name':_0x3b9d0d['fieldName'],'type':_0x3b9d0d[_0xb03d('0x2f')]['key']};});_0xb1ec44[_0xb03d('0x37')]=_['map'](_0x12ff94,_0xb03d('0x31'));_0xb1ec44['query']=_[_0xb03d('0x38')](_0x4a8d37[_0xb03d('0x39')]);_0xb1ec44['filters']=_[_0xb03d('0x3a')](_0xb1ec44[_0xb03d('0x37')],_0xb1ec44[_0xb03d('0x39')]);_0x216cd2[_0xb03d('0x3b')]=_['intersection'](_0xb1ec44[_0xb03d('0x37')],qs[_0xb03d('0x3c')](_0x4a8d37[_0xb03d('0x39')][_0xb03d('0x3c')]));_0x216cd2['attributes']=_0x216cd2['attributes'][_0xb03d('0x3d')]?_0x216cd2['attributes']:_0xb1ec44[_0xb03d('0x37')];if(!_0x4a8d37[_0xb03d('0x39')][_0xb03d('0x3e')](_0xb03d('0x3f'))){_0x216cd2[_0xb03d('0x21')]=qs[_0xb03d('0x21')](_0x4a8d37['query']['limit']);_0x216cd2[_0xb03d('0x1e')]=qs[_0xb03d('0x1e')](_0x4a8d37['query'][_0xb03d('0x1e')]);}_0x216cd2[_0xb03d('0x40')]=qs['sort'](_0x4a8d37[_0xb03d('0x39')]['sort']);_0x216cd2[_0xb03d('0x41')]=qs[_0xb03d('0x42')](_['pick'](_0x4a8d37['query'],_0xb1ec44[_0xb03d('0x42')]),_0x12ff94);if(_0x4a8d37['query'][_0xb03d('0x2a')]){_0x216cd2['where']=_[_0xb03d('0x43')](_0x216cd2['where'],{'$or':_[_0xb03d('0x2c')](_0x12ff94,function(_0x330d86){if(_0x330d86[_0xb03d('0x2f')]!==_0xb03d('0x44')){var _0x3fc54f={};_0x3fc54f[_0x330d86['name']]={'$like':'%'+_0x4a8d37[_0xb03d('0x39')][_0xb03d('0x2a')]+'%'};return _0x3fc54f;}})});}_0x216cd2=_[_0xb03d('0x43')]({},_0x216cd2,_0x4a8d37[_0xb03d('0x45')]);var _0x312de4={'where':_0x216cd2[_0xb03d('0x41')]};return db[_0xb03d('0x46')][_0xb03d('0x20')](_0x312de4)[_0xb03d('0x26')](function(_0x351a3b){_0x2178ad['count']=_0x351a3b;if(_0x4a8d37[_0xb03d('0x39')]['includeAll']){_0x216cd2[_0xb03d('0x47')]=[{'all':!![]}];}return db[_0xb03d('0x46')][_0xb03d('0x48')](_0x216cd2);})[_0xb03d('0x26')](function(_0x1623f4){_0x2178ad['rows']=_0x1623f4;return _0x2178ad;})[_0xb03d('0x26')](respondWithFilteredResult(_0x3cc531,_0x216cd2))['catch'](handleError(_0x3cc531,null));};exports[_0xb03d('0x49')]=function(_0x4a116b,_0x4d48d0){var _0x47d50a={'raw':![],'where':{'id':_0x4a116b['params']['id']}},_0x4e6737={};_0x4e6737[_0xb03d('0x37')]=_[_0xb03d('0x38')](db['VoiceQueue']['rawAttributes']);_0x4e6737[_0xb03d('0x39')]=_[_0xb03d('0x38')](_0x4a116b[_0xb03d('0x39')]);_0x4e6737[_0xb03d('0x42')]=_[_0xb03d('0x3a')](_0x4e6737[_0xb03d('0x37')],_0x4e6737[_0xb03d('0x39')]);_0x47d50a[_0xb03d('0x3b')]=_['intersection'](_0x4e6737[_0xb03d('0x37')],qs[_0xb03d('0x3c')](_0x4a116b[_0xb03d('0x39')]['fields']));_0x47d50a[_0xb03d('0x3b')]=_0x47d50a[_0xb03d('0x3b')][_0xb03d('0x3d')]?_0x47d50a[_0xb03d('0x3b')]:_0x4e6737['model'];if(_0x4a116b[_0xb03d('0x39')][_0xb03d('0x4a')]){_0x47d50a[_0xb03d('0x47')]=[{'all':!![]}];}_0x47d50a=_[_0xb03d('0x43')]({},_0x47d50a,_0x4a116b[_0xb03d('0x45')]);return db[_0xb03d('0x46')][_0xb03d('0x30')](_0x47d50a)[_0xb03d('0x26')](handleEntityNotFound(_0x4d48d0,null))[_0xb03d('0x26')](respondWithResult(_0x4d48d0,null))[_0xb03d('0x4b')](handleError(_0x4d48d0,null));};exports['create']=function(_0x2411c5,_0x13ff57){return db[_0xb03d('0x46')][_0xb03d('0x4c')](_0x2411c5['body'],{})[_0xb03d('0x26')](function(_0x15460a){var _0x5c3d4e=_0x2411c5['user'][_0xb03d('0x4d')]({'plain':!![]});if(!_0x5c3d4e)throw new Error(_0xb03d('0x4e'));if(_0x5c3d4e[_0xb03d('0x4f')]===_0xb03d('0x50')){var _0x371cbb=_0x15460a[_0xb03d('0x4d')]({'plain':!![]});var _0x588eb7=[{'name':'VoiceQueues','value':'inbound'},{'name':_0xb03d('0x51'),'value':_0xb03d('0x52')}];var _0x4e0429=_[_0xb03d('0x30')](_0x588eb7,[_0xb03d('0x2d'),_0x371cbb['type']])[_0xb03d('0x31')];return db[_0xb03d('0x53')][_0xb03d('0x30')]({'where':{'name':_0x4e0429,'userProfileId':_0x5c3d4e[_0xb03d('0x54')]},'raw':!![]})['then'](function(_0xd95952){if(_0xd95952&&_0xd95952[_0xb03d('0x55')]===0x0){return db[_0xb03d('0x32')][_0xb03d('0x4c')]({'name':_0x371cbb[_0xb03d('0x31')],'resourceId':_0x371cbb['id'],'type':_0xd95952['name'],'sectionId':_0xd95952['id']},{})[_0xb03d('0x26')](function(){return _0x15460a;});}else{return _0x15460a;}})[_0xb03d('0x4b')](function(_0x55d563){logger['error'](_0xb03d('0x56'),_0x55d563);throw _0x55d563;});}return _0x15460a;})['then'](respondWithResult(_0x13ff57,0xc9))[_0xb03d('0x4b')](handleError(_0x13ff57,null));};exports[_0xb03d('0x57')]=function(_0x41c98e,_0x324307){var _0x184fb7={'where':{'id':_0x41c98e[_0xb03d('0x58')]['id']}},_0x266528={};_0x266528['model']=_[_0xb03d('0x38')](db['VoiceQueue'][_0xb03d('0x59')]);_0x184fb7[_0xb03d('0x3b')]=_[_0xb03d('0x3a')](_0x266528[_0xb03d('0x37')],qs[_0xb03d('0x3c')](_0x41c98e[_0xb03d('0x39')][_0xb03d('0x3c')]));_0x184fb7[_0xb03d('0x3b')]=_0x184fb7['attributes']['length']?_0x184fb7[_0xb03d('0x3b')]:_0x266528[_0xb03d('0x37')];if(_0x41c98e[_0xb03d('0x39')][_0xb03d('0x4a')]){_0x184fb7['include']=[{'all':!![]}];}_0x184fb7=_['merge']({},_0x184fb7,_0x41c98e[_0xb03d('0x45')]);return db[_0xb03d('0x46')]['find'](_0x184fb7)[_0xb03d('0x26')](handleEntityNotFound(_0x324307,null))['then'](function(_0x185988){if(_0x185988){var _0x3f8ea3=_0x185988['get']({'plain':!![]});_0x3f8ea3=qs[_0xb03d('0x5a')](_0x3f8ea3,['id',_0xb03d('0x5b'),_0xb03d('0x5c')]);_0x41c98e[_0xb03d('0x5d')]=_[_0xb03d('0x5a')](_0x41c98e[_0xb03d('0x5d')],['id',_0xb03d('0x5b'),_0xb03d('0x5c')]);return db[_0xb03d('0x46')]['create'](_[_0xb03d('0x43')](_0x3f8ea3,_0x41c98e[_0xb03d('0x5d')]),{'include':_0x41c98e[_0xb03d('0x39')][_0xb03d('0x4a')]?[{'all':!![]}]:undefined})['then'](function(_0x5f375d){var _0xd8c7e7=_0x41c98e['user'][_0xb03d('0x4d')]({'plain':!![]});if(!_0xd8c7e7)throw new Error(_0xb03d('0x4e'));if(_0xd8c7e7[_0xb03d('0x4f')]==='user'){var _0x4315bb=_0x5f375d[_0xb03d('0x4d')]({'plain':!![]});var _0x8efbfa=[{'name':'VoiceQueues','value':_0xb03d('0x29')},{'name':'QueueCampaigns','value':'outbound'}];var _0x6afa56=_[_0xb03d('0x30')](_0x8efbfa,[_0xb03d('0x2d'),_0x4315bb[_0xb03d('0x2f')]])['name'];return db[_0xb03d('0x53')][_0xb03d('0x30')]({'where':{'name':_0x6afa56,'userProfileId':_0xd8c7e7[_0xb03d('0x54')]},'raw':!![]})[_0xb03d('0x26')](function(_0x49b864){if(_0x49b864&&_0x49b864[_0xb03d('0x55')]===0x0){return db[_0xb03d('0x32')][_0xb03d('0x4c')]({'name':_0x4315bb['name'],'resourceId':_0x4315bb['id'],'type':_0x49b864[_0xb03d('0x31')],'sectionId':_0x49b864['id']},{})['then'](function(){return _0x5f375d;});}else{return _0x5f375d;}})[_0xb03d('0x4b')](function(_0x28af78){logger[_0xb03d('0x5e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x28af78);throw _0x28af78;});}return _0x5f375d;});}})[_0xb03d('0x26')](respondWithResult(_0x324307,0xc9))[_0xb03d('0x4b')](handleError(_0x324307,null));};exports[_0xb03d('0x25')]=function(_0x2d13ef,_0xfdceae){if(_0x2d13ef[_0xb03d('0x5d')]['id']){delete _0x2d13ef['body']['id'];}return db[_0xb03d('0x46')][_0xb03d('0x30')]({'where':{'id':_0x2d13ef[_0xb03d('0x58')]['id']}})[_0xb03d('0x26')](handleEntityNotFound(_0xfdceae,null))[_0xb03d('0x26')](saveUpdates(_0x2d13ef[_0xb03d('0x5d')],null))[_0xb03d('0x26')](respondWithResult(_0xfdceae,null))[_0xb03d('0x4b')](handleError(_0xfdceae,null));};exports['destroy']=function(_0x276b30,_0x139fef){return db[_0xb03d('0x46')]['find']({'where':{'id':_0x276b30[_0xb03d('0x58')]['id']}})['then'](handleEntityNotFound(_0x139fef,null))[_0xb03d('0x26')](removeEntity(_0x139fef,null))[_0xb03d('0x4b')](handleError(_0x139fef,null));};exports[_0xb03d('0x5f')]=function(_0x103e62,_0x2bd7d9,_0x2f1b7f){var _0x1c9c3d={'raw':![],'where':{}};var _0x46f8a8={};var _0x4c4bc8={'count':0x0,'rows':[]};return db['VoiceQueue']['findOne']({'where':{'id':_0x103e62[_0xb03d('0x58')]['id']}})[_0xb03d('0x26')](handleEntityNotFound(_0x2bd7d9,null))[_0xb03d('0x26')](function(_0x3f902f){if(_0x3f902f){_0x46f8a8[_0xb03d('0x37')]=_[_0xb03d('0x38')](db[_0xb03d('0x60')][_0xb03d('0x59')]);_0x46f8a8[_0xb03d('0x39')]=_[_0xb03d('0x38')](_0x103e62['query']);_0x46f8a8[_0xb03d('0x42')]=_[_0xb03d('0x3a')](_0x46f8a8[_0xb03d('0x37')],_0x46f8a8[_0xb03d('0x39')]);_0x1c9c3d[_0xb03d('0x3b')]=_[_0xb03d('0x3a')](_0x46f8a8[_0xb03d('0x37')],qs[_0xb03d('0x3c')](_0x103e62[_0xb03d('0x39')]['fields']));_0x1c9c3d[_0xb03d('0x3b')]=_0x1c9c3d[_0xb03d('0x3b')][_0xb03d('0x3d')]?_0x1c9c3d[_0xb03d('0x3b')]:_0x46f8a8['model'];if(!_0x103e62[_0xb03d('0x39')][_0xb03d('0x3e')](_0xb03d('0x3f'))){_0x1c9c3d[_0xb03d('0x21')]=qs[_0xb03d('0x21')](_0x103e62['query'][_0xb03d('0x21')]);_0x1c9c3d[_0xb03d('0x1e')]=qs[_0xb03d('0x1e')](_0x103e62[_0xb03d('0x39')][_0xb03d('0x1e')]);}_0x1c9c3d[_0xb03d('0x40')]=qs[_0xb03d('0x61')](_0x103e62[_0xb03d('0x39')][_0xb03d('0x61')]);_0x1c9c3d['where']=qs[_0xb03d('0x42')](_['pick'](_0x103e62['query'],_0x46f8a8[_0xb03d('0x42')]));_0x1c9c3d[_0xb03d('0x41')][_0xb03d('0x62')]=_0x3f902f['id'];if(_0x103e62[_0xb03d('0x39')]['filter']){_0x1c9c3d[_0xb03d('0x41')]=_[_0xb03d('0x43')](_0x1c9c3d[_0xb03d('0x41')],{'$or':_[_0xb03d('0x2c')](_0x1c9c3d[_0xb03d('0x3b')],function(_0xe5bd46){var _0x397524={};_0x397524[_0xe5bd46]={'$like':'%'+_0x103e62['query'][_0xb03d('0x2a')]+'%'};return _0x397524;})});}_0x1c9c3d=_[_0xb03d('0x43')]({},_0x1c9c3d,_0x103e62[_0xb03d('0x45')]);return db[_0xb03d('0x60')][_0xb03d('0x20')]({'where':_0x1c9c3d[_0xb03d('0x41')]})['then'](function(_0x56e70d){_0x4c4bc8[_0xb03d('0x20')]=_0x56e70d;if(_0x103e62[_0xb03d('0x39')][_0xb03d('0x4a')]){_0x1c9c3d[_0xb03d('0x47')]=[{'all':!![]}];}return db['CmHopper'][_0xb03d('0x48')](_0x1c9c3d);})[_0xb03d('0x26')](function(_0x1922d6){_0x4c4bc8['rows']=_0x1922d6;return _0x4c4bc8;});}})[_0xb03d('0x26')](respondWithFilteredResult(_0x2bd7d9,_0x1c9c3d))[_0xb03d('0x4b')](handleError(_0x2bd7d9,null));};exports[_0xb03d('0x63')]=function(_0x3e7b9e,_0x20488b,_0x4b1426){var _0x454db4={'raw':!![],'where':{}};var _0x554ed7={};var _0x2db9f2={'count':0x0,'rows':[]};return db[_0xb03d('0x46')][_0xb03d('0x64')]({'where':{'id':_0x3e7b9e['params']['id']}})[_0xb03d('0x26')](handleEntityNotFound(_0x20488b,null))[_0xb03d('0x26')](function(_0x24a94e){if(_0x24a94e){_0x554ed7[_0xb03d('0x37')]=_[_0xb03d('0x38')](db[_0xb03d('0x65')][_0xb03d('0x59')]);_0x554ed7['query']=_[_0xb03d('0x38')](_0x3e7b9e[_0xb03d('0x39')]);_0x554ed7[_0xb03d('0x42')]=_[_0xb03d('0x3a')](_0x554ed7[_0xb03d('0x37')],_0x554ed7[_0xb03d('0x39')]);_0x454db4[_0xb03d('0x3b')]=_[_0xb03d('0x3a')](_0x554ed7[_0xb03d('0x37')],qs['fields'](_0x3e7b9e['query']['fields']));_0x454db4['attributes']=_0x454db4[_0xb03d('0x3b')][_0xb03d('0x3d')]?_0x454db4[_0xb03d('0x3b')]:_0x554ed7['model'];if(!_0x3e7b9e[_0xb03d('0x39')]['hasOwnProperty'](_0xb03d('0x3f'))){_0x454db4[_0xb03d('0x21')]=qs[_0xb03d('0x21')](_0x3e7b9e['query'][_0xb03d('0x21')]);_0x454db4[_0xb03d('0x1e')]=qs[_0xb03d('0x1e')](_0x3e7b9e['query']['offset']);}_0x454db4[_0xb03d('0x40')]=qs['sort'](_0x3e7b9e[_0xb03d('0x39')][_0xb03d('0x61')]);_0x454db4[_0xb03d('0x41')]=qs[_0xb03d('0x42')](_[_0xb03d('0x66')](_0x3e7b9e[_0xb03d('0x39')],_0x554ed7['filters']));_0x454db4[_0xb03d('0x41')][_0xb03d('0x62')]=_0x24a94e['id'];if(_0x3e7b9e['query'][_0xb03d('0x2a')]){_0x454db4[_0xb03d('0x41')]=_[_0xb03d('0x43')](_0x454db4['where'],{'$or':_[_0xb03d('0x2c')](_0x454db4[_0xb03d('0x3b')],function(_0x7fd365){var _0xbe1f77={};_0xbe1f77[_0x7fd365]={'$like':'%'+_0x3e7b9e[_0xb03d('0x39')][_0xb03d('0x2a')]+'%'};return _0xbe1f77;})});}_0x454db4=_[_0xb03d('0x43')]({},_0x454db4,_0x3e7b9e[_0xb03d('0x45')]);return db[_0xb03d('0x65')]['count']({'where':_0x454db4['where']})[_0xb03d('0x26')](function(_0x184308){_0x2db9f2[_0xb03d('0x20')]=_0x184308;if(_0x3e7b9e[_0xb03d('0x39')][_0xb03d('0x4a')]){_0x454db4[_0xb03d('0x47')]=[{'all':!![]}];}return db[_0xb03d('0x65')][_0xb03d('0x48')](_0x454db4);})['then'](function(_0x480e57){_0x2db9f2['rows']=_0x480e57;return _0x2db9f2;});}})[_0xb03d('0x26')](respondWithFilteredResult(_0x20488b,_0x454db4))[_0xb03d('0x4b')](handleError(_0x20488b,null));};exports['getHopperFinals']=function(_0x12aad0,_0x4f969b,_0x17c2af){var _0x3196c1={'raw':!![],'where':{}};var _0x1b2edc={};var _0x4a0eef={'count':0x0,'rows':[]};return db[_0xb03d('0x46')]['findOne']({'where':{'id':_0x12aad0[_0xb03d('0x58')]['id']}})[_0xb03d('0x26')](handleEntityNotFound(_0x4f969b,null))[_0xb03d('0x26')](function(_0x3ffb8c){if(_0x3ffb8c){_0x1b2edc[_0xb03d('0x37')]=_[_0xb03d('0x38')](db[_0xb03d('0x67')][_0xb03d('0x59')]);_0x1b2edc['query']=_[_0xb03d('0x38')](_0x12aad0[_0xb03d('0x39')]);_0x1b2edc[_0xb03d('0x42')]=_['intersection'](_0x1b2edc[_0xb03d('0x37')],_0x1b2edc[_0xb03d('0x39')]);_0x3196c1[_0xb03d('0x3b')]=_[_0xb03d('0x3a')](_0x1b2edc[_0xb03d('0x37')],qs['fields'](_0x12aad0[_0xb03d('0x39')]['fields']));_0x3196c1['attributes']=_0x3196c1[_0xb03d('0x3b')][_0xb03d('0x3d')]?_0x3196c1['attributes']:_0x1b2edc[_0xb03d('0x37')];if(!_0x12aad0[_0xb03d('0x39')][_0xb03d('0x3e')](_0xb03d('0x3f'))){_0x3196c1[_0xb03d('0x21')]=qs[_0xb03d('0x21')](_0x12aad0['query'][_0xb03d('0x21')]);_0x3196c1[_0xb03d('0x1e')]=qs['offset'](_0x12aad0[_0xb03d('0x39')][_0xb03d('0x1e')]);}_0x3196c1[_0xb03d('0x40')]=qs[_0xb03d('0x61')](_0x12aad0[_0xb03d('0x39')][_0xb03d('0x61')]);_0x3196c1['where']=qs['filters'](_[_0xb03d('0x66')](_0x12aad0['query'],_0x1b2edc[_0xb03d('0x42')]));_0x3196c1[_0xb03d('0x41')]['VoiceQueueId']=_0x3ffb8c['id'];if(_0x12aad0[_0xb03d('0x39')][_0xb03d('0x2a')]){_0x3196c1[_0xb03d('0x41')]=_[_0xb03d('0x43')](_0x3196c1['where'],{'$or':_[_0xb03d('0x2c')](_0x3196c1[_0xb03d('0x3b')],function(_0x2c6486){var _0x2c7e39={};_0x2c7e39[_0x2c6486]={'$like':'%'+_0x12aad0[_0xb03d('0x39')][_0xb03d('0x2a')]+'%'};return _0x2c7e39;})});}_0x3196c1=_['merge']({},_0x3196c1,_0x12aad0['options']);return db[_0xb03d('0x67')][_0xb03d('0x20')]({'where':_0x3196c1[_0xb03d('0x41')]})[_0xb03d('0x26')](function(_0x32e8c1){_0x4a0eef['count']=_0x32e8c1;if(_0x12aad0['query'][_0xb03d('0x4a')]){_0x3196c1[_0xb03d('0x47')]=[{'all':!![]}];}return db[_0xb03d('0x67')][_0xb03d('0x48')](_0x3196c1);})[_0xb03d('0x26')](function(_0x5db8a9){_0x4a0eef[_0xb03d('0x68')]=_0x5db8a9;return _0x4a0eef;});}})['then'](respondWithFilteredResult(_0x4f969b,_0x3196c1))[_0xb03d('0x4b')](handleError(_0x4f969b,null));};exports[_0xb03d('0x69')]=function(_0x314f79,_0x12d80a,_0x5d9d14){var _0xd1b95d={'raw':!![],'where':{}};var _0x4da6cc={};var _0x29e225={'count':0x0,'rows':[]};return db['VoiceQueue']['findOne']({'where':{'id':_0x314f79[_0xb03d('0x58')]['id']}})[_0xb03d('0x26')](handleEntityNotFound(_0x12d80a,null))['then'](function(_0x7e0e80){if(_0x7e0e80){_0x4da6cc['model']=_[_0xb03d('0x38')](db['CmHopperBlack'][_0xb03d('0x59')]);_0x4da6cc[_0xb03d('0x39')]=_[_0xb03d('0x38')](_0x314f79[_0xb03d('0x39')]);_0x4da6cc[_0xb03d('0x42')]=_[_0xb03d('0x3a')](_0x4da6cc[_0xb03d('0x37')],_0x4da6cc[_0xb03d('0x39')]);_0xd1b95d[_0xb03d('0x3b')]=_[_0xb03d('0x3a')](_0x4da6cc[_0xb03d('0x37')],qs['fields'](_0x314f79[_0xb03d('0x39')]['fields']));_0xd1b95d[_0xb03d('0x3b')]=_0xd1b95d[_0xb03d('0x3b')][_0xb03d('0x3d')]?_0xd1b95d[_0xb03d('0x3b')]:_0x4da6cc[_0xb03d('0x37')];if(!_0x314f79[_0xb03d('0x39')]['hasOwnProperty'](_0xb03d('0x3f'))){_0xd1b95d[_0xb03d('0x21')]=qs['limit'](_0x314f79[_0xb03d('0x39')][_0xb03d('0x21')]);_0xd1b95d[_0xb03d('0x1e')]=qs[_0xb03d('0x1e')](_0x314f79['query'][_0xb03d('0x1e')]);}_0xd1b95d[_0xb03d('0x40')]=qs['sort'](_0x314f79[_0xb03d('0x39')]['sort']);_0xd1b95d['where']=qs['filters'](_['pick'](_0x314f79[_0xb03d('0x39')],_0x4da6cc[_0xb03d('0x42')]));_0xd1b95d[_0xb03d('0x41')]['VoiceQueueId']=_0x7e0e80['id'];if(_0x314f79[_0xb03d('0x39')]['filter']){_0xd1b95d[_0xb03d('0x41')]=_[_0xb03d('0x43')](_0xd1b95d['where'],{'$or':_['map'](_0xd1b95d[_0xb03d('0x3b')],function(_0xade177){var _0x5256a3={};_0x5256a3[_0xade177]={'$like':'%'+_0x314f79[_0xb03d('0x39')][_0xb03d('0x2a')]+'%'};return _0x5256a3;})});}_0xd1b95d=_[_0xb03d('0x43')]({},_0xd1b95d,_0x314f79['options']);return db['CmHopperBlack'][_0xb03d('0x20')]({'where':_0xd1b95d[_0xb03d('0x41')]})[_0xb03d('0x26')](function(_0x367f7b){_0x29e225[_0xb03d('0x20')]=_0x367f7b;if(_0x314f79[_0xb03d('0x39')]['includeAll']){_0xd1b95d[_0xb03d('0x47')]=[{'all':!![]}];}return db[_0xb03d('0x6a')]['findAll'](_0xd1b95d);})[_0xb03d('0x26')](function(_0x4cce94){_0x29e225['rows']=_0x4cce94;return _0x29e225;});}})['then'](respondWithFilteredResult(_0x12d80a,_0xd1b95d))[_0xb03d('0x4b')](handleError(_0x12d80a,null));};exports[_0xb03d('0x6b')]=function(_0x31dfe3,_0x5a80e8,_0x3f2de9){var _0x476bab={};var _0x584f68={};var _0x17bcf5;var _0x38dff0;return db[_0xb03d('0x46')][_0xb03d('0x64')]({'where':{'id':_0x31dfe3['params']['id']}})['then'](handleEntityNotFound(_0x5a80e8,null))[_0xb03d('0x26')](function(_0x28c0cf){if(_0x28c0cf){_0x17bcf5=_0x28c0cf;_0x584f68[_0xb03d('0x37')]=_[_0xb03d('0x38')](db['Team'][_0xb03d('0x59')]);_0x584f68[_0xb03d('0x39')]=_[_0xb03d('0x38')](_0x31dfe3[_0xb03d('0x39')]);_0x584f68['filters']=_[_0xb03d('0x3a')](_0x584f68[_0xb03d('0x37')],_0x584f68[_0xb03d('0x39')]);_0x476bab[_0xb03d('0x3b')]=_[_0xb03d('0x3a')](_0x584f68[_0xb03d('0x37')],qs[_0xb03d('0x3c')](_0x31dfe3[_0xb03d('0x39')][_0xb03d('0x3c')]));_0x476bab[_0xb03d('0x3b')]=_0x476bab[_0xb03d('0x3b')][_0xb03d('0x3d')]?_0x476bab['attributes']:_0x584f68['model'];_0x476bab[_0xb03d('0x40')]=qs['sort'](_0x31dfe3[_0xb03d('0x39')][_0xb03d('0x61')]);_0x476bab[_0xb03d('0x41')]=qs[_0xb03d('0x42')](_[_0xb03d('0x66')](_0x31dfe3[_0xb03d('0x39')],_0x584f68[_0xb03d('0x42')]));if(_0x31dfe3[_0xb03d('0x39')]['filter']){_0x476bab[_0xb03d('0x41')]=_[_0xb03d('0x43')](_0x476bab[_0xb03d('0x41')],{'$or':_[_0xb03d('0x2c')](_0x476bab['attributes'],function(_0x17c69b){var _0x501c67={};_0x501c67[_0x17c69b]={'$like':'%'+_0x31dfe3['query'][_0xb03d('0x2a')]+'%'};return _0x501c67;})});}_0x476bab=_[_0xb03d('0x43')]({},_0x476bab,_0x31dfe3['options']);return _0x17bcf5[_0xb03d('0x6b')](_0x476bab);}})[_0xb03d('0x26')](function(_0x293db8){if(_0x293db8){_0x38dff0=_0x293db8[_0xb03d('0x3d')];if(!_0x31dfe3['query']['hasOwnProperty']('nolimit')){_0x476bab[_0xb03d('0x21')]=qs['limit'](_0x31dfe3[_0xb03d('0x39')][_0xb03d('0x21')]);_0x476bab[_0xb03d('0x1e')]=qs['offset'](_0x31dfe3['query'][_0xb03d('0x1e')]);}return _0x17bcf5[_0xb03d('0x6b')](_0x476bab);}})[_0xb03d('0x26')](function(_0x35fc9e){if(_0x35fc9e){return _0x35fc9e?{'count':_0x38dff0,'rows':_0x35fc9e}:null;}})[_0xb03d('0x26')](respondWithResult(_0x5a80e8,null))['catch'](handleError(_0x5a80e8,null));};exports[_0xb03d('0x6c')]=function(_0x5410de,_0x1b48ae,_0x8f0d58){var _0x19e997=_0x5410de['body'][_0xb03d('0x6d')];var _0x440f4a=_[_0xb03d('0x2c')](_0x19e997,'id');return db[_0xb03d('0x6e')][_0xb03d('0x48')]({'where':{'id':_0x440f4a},'attributes':['id'],'include':[{'model':db[_0xb03d('0x6f')],'as':_0xb03d('0x70'),'attributes':['id',_0xb03d('0x31'),_0xb03d('0x71'),'voicePause',_0xb03d('0x72')],'raw':!![]}]})[_0xb03d('0x26')](function(_0x51ca9e){if(_0x51ca9e){var _0x514b83=_[_0xb03d('0x73')](_0x51ca9e,function(_0x1d3eac){var _0x3995bf=_0x1d3eac[_0xb03d('0x4d')]({'plain':!![]});_0x3995bf[_0xb03d('0x70')]['forEach'](function(_0xa39703){_0xa39703[_0xb03d('0x74')]=_[_0xb03d('0x30')](_0x19e997,{'id':_0x3995bf['id']})['penalty'];});return _0x3995bf[_0xb03d('0x70')];});return db[_0xb03d('0x46')][_0xb03d('0x30')]({'where':{'id':_0x5410de[_0xb03d('0x58')]['id']}})[_0xb03d('0x26')](function(_0x24b634){return db[_0xb03d('0x75')][_0xb03d('0x76')](function(_0x2c032c){return _0x24b634[_0xb03d('0x6c')](_0x440f4a,{'transaction':_0x2c032c})[_0xb03d('0x26')](function(){return BPromise[_0xb03d('0x77')](_0x19e997,function(_0x388764){return db[_0xb03d('0x78')][_0xb03d('0x79')]({'TeamId':_0x388764['id'],'VoiceQueueId':_0x5410de[_0xb03d('0x58')]['id'],'penalty':_0x388764[_0xb03d('0x74')]},{'transaction':_0x2c032c});});})[_0xb03d('0x26')](function(){return BPromise[_0xb03d('0x77')](_0x514b83,function(_0x331385){return db[_0xb03d('0x7a')]['findOrCreate']({'where':{'UserId':_0x331385['id'],'VoiceQueueId':_0x5410de[_0xb03d('0x58')]['id']},'defaults':{'penalty':_0x331385[_0xb03d('0x74')]},'transaction':_0x2c032c});});})[_0xb03d('0x26')](function(){return BPromise[_0xb03d('0x77')](_[_0xb03d('0x2a')](_0x514b83,{'online':!![]}),function(_0x5635d5){return db[_0xb03d('0x7b')]['upsert']({'membername':_0x5635d5[_0xb03d('0x31')],'UserId':_0x5635d5['id'],'queue_name':_0x24b634[_0xb03d('0x31')],'VoiceQueueId':_0x24b634['id'],'interface':_['isNil'](_0x5635d5[_0xb03d('0x72')])?util[_0xb03d('0x7c')]('SIP/%s',_0x5635d5[_0xb03d('0x31')]):_0x5635d5['interface'],'paused':_0x5635d5['voicePause']||![],'penalty':_0x5635d5[_0xb03d('0x74')]},{'transaction':_0x2c032c});});})[_0xb03d('0x26')](function(){_0x514b83[_0xb03d('0x7d')](function(_0x2e07a5){socket['emit'](_0xb03d('0x7e'),{'UserId':_0x2e07a5['id'],'VoiceQueueId':_0x24b634['id']});});});});});}})[_0xb03d('0x26')](respondWithStatusCode(_0x1b48ae,null))['catch'](handleError(_0x1b48ae,null));};exports[_0xb03d('0x7f')]=function(_0x1c547f,_0xaa254c,_0x128cb8){return db[_0xb03d('0x6e')][_0xb03d('0x48')]({'where':{'id':_0x1c547f[_0xb03d('0x39')][_0xb03d('0x80')]},'attributes':['id'],'include':[{'model':db[_0xb03d('0x6f')],'as':_0xb03d('0x70'),'attributes':['id'],'raw':!![]}]})[_0xb03d('0x26')](handleEntityNotFound(_0xaa254c,null))[_0xb03d('0x26')](function(_0x446eb0){var _0x2c020d=_[_0xb03d('0x2c')](_0x446eb0,'id');var _0x53a43c=[];var _0x3fec23=[];var _0x2d1ee0=squel['select']();_0x2d1ee0[_0xb03d('0x81')](_0xb03d('0x82'))[_0xb03d('0x83')]('team_has_voice_queues','tq')['join'](_0xb03d('0x84'),'ut',_0xb03d('0x85'))[_0xb03d('0x41')](_0xb03d('0x86'),_0x1c547f[_0xb03d('0x58')]['id']);for(var _0x18d051=0x0;_0x18d051<_0x446eb0[_0xb03d('0x3d')];_0x18d051+=0x1){let _0x22a83c=_0x446eb0[_0x18d051];for(var _0x63a1a8=0x0;_0x63a1a8<_0x22a83c[_0xb03d('0x70')][_0xb03d('0x3d')];_0x63a1a8+=0x1){let _0x2babed=_0x22a83c['Agents'][_0x63a1a8];var _0x726c89=_0x2d1ee0['clone']();_0x726c89[_0xb03d('0x41')](_0xb03d('0x87'),_0x2babed['id']);_0x3fec23[_0xb03d('0x88')](db['sequelize'][_0xb03d('0x39')](_0x726c89[_0xb03d('0x89')](),{'type':db[_0xb03d('0x75')][_0xb03d('0x8a')][_0xb03d('0x8b')]})[_0xb03d('0x26')](function(_0x25d3cd){if(_0x25d3cd['length']===0x1){return _0x2babed['id'];}else{var _0x3348cd=_['every'](_[_0xb03d('0x2c')](_0x25d3cd,_0xb03d('0x8c')),function(_0x5afc50){return _['includes'](_0x2c020d,_0x5afc50);});if(_0x3348cd){return _0x2babed['id'];}}}));}}return BPromise[_0xb03d('0x8d')](_0x3fec23)['then'](function(_0x4bafc4){_0x53a43c=_(_0x53a43c)[_0xb03d('0x8e')](_0x4bafc4)[_0xb03d('0x8f')]()[_0xb03d('0x2d')]();return db[_0xb03d('0x46')][_0xb03d('0x30')]({'where':{'id':_0x1c547f['params']['id']}})[_0xb03d('0x26')](function(_0x49940f){return db[_0xb03d('0x75')][_0xb03d('0x76')](function(_0xc56f1c){return _0x49940f[_0xb03d('0x7f')](_0x1c547f[_0xb03d('0x39')][_0xb03d('0x80')],{'transaction':_0xc56f1c})[_0xb03d('0x26')](function(){if(!_[_0xb03d('0x90')](_0x53a43c)){return _0x49940f[_0xb03d('0x91')](_0x53a43c,{'transaction':_0xc56f1c})[_0xb03d('0x26')](function(){return db[_0xb03d('0x7b')][_0xb03d('0x27')]({'where':{'VoiceQueueId':_0x1c547f['params']['id'],'UserId':_0x53a43c},'transaction':_0xc56f1c});});}})[_0xb03d('0x26')](function(){_0x53a43c['forEach'](function(_0x42153a){socket[_0xb03d('0x92')](_0xb03d('0x93'),{'UserId':_0x42153a,'VoiceQueueId':_0x49940f['id']});});});});});});})[_0xb03d('0x26')](respondWithStatusCode(_0xaa254c,null))[_0xb03d('0x4b')](handleError(_0xaa254c,null));};exports[_0xb03d('0x94')]=function(_0x2abdf4,_0x3d3022,_0x46e2b9){var _0x90a4ba,_0x53a350;return db['VoiceQueue'][_0xb03d('0x30')]({'where':{'id':_0x2abdf4['params']['id']}})['then'](handleEntityNotFound(_0x3d3022,null))[_0xb03d('0x26')](function(_0x54f262){if(_0x54f262){_0x53a350=_0x54f262;return _0x54f262['addAgents'](_0x2abdf4[_0xb03d('0x5d')]['ids'],_[_0xb03d('0x5a')](_0x2abdf4['body'],[_0xb03d('0x80'),'id'])||{})[_0xb03d('0x95')](function(_0x8fb6b2){for(var _0x35e1d0=0x0;_0x35e1d0<_0x2abdf4['body'][_0xb03d('0x80')][_0xb03d('0x3d')];_0x35e1d0+=0x1){socket[_0xb03d('0x92')]('userVoiceQueue:save',{'UserId':Number(_0x2abdf4[_0xb03d('0x5d')]['ids'][_0x35e1d0]),'VoiceQueueId':Number(_0x2abdf4[_0xb03d('0x58')]['id'])});}return _0x8fb6b2;});}})[_0xb03d('0x26')](function(_0x260888){_0x90a4ba=_0x260888||[];if(_0x53a350){return db['User'][_0xb03d('0x48')]({'where':{'id':_0x2abdf4['body'][_0xb03d('0x80')]},'attributes':['id',_0xb03d('0x31'),_0xb03d('0x71'),_0xb03d('0x96'),_0xb03d('0x72')],'raw':!![]});}})[_0xb03d('0x26')](function(_0x2b0d6a){if(!_[_0xb03d('0x90')](_0x2b0d6a)){var _0x2244d4=[];for(var _0x13e963=0x0;_0x13e963<_0x2b0d6a['length'];_0x13e963++){if(_0x2b0d6a[_0x13e963][_0xb03d('0x71')]){_0x2244d4['push'](db[_0xb03d('0x7b')]['upsert']({'membername':_0x2b0d6a[_0x13e963][_0xb03d('0x31')],'UserId':_0x2b0d6a[_0x13e963]['id'],'queue_name':_0x53a350[_0xb03d('0x31')],'VoiceQueueId':_0x53a350['id'],'interface':_['isNil'](_0x2b0d6a[_0x13e963][_0xb03d('0x72')])?util[_0xb03d('0x7c')]('SIP/%s',_0x2b0d6a[_0x13e963][_0xb03d('0x31')]):_0x2b0d6a[_0x13e963][_0xb03d('0x72')],'paused':_0x2b0d6a[_0x13e963]['voicePause']||![],'penalty':_0x2abdf4[_0xb03d('0x5d')][_0xb03d('0x74')]||0x0}));}}return BPromise['all'](_0x2244d4);}})[_0xb03d('0x26')](function(){return _0x90a4ba;})[_0xb03d('0x26')](respondWithResult(_0x3d3022,null))['catch'](handleError(_0x3d3022,null));};exports[_0xb03d('0x91')]=function(_0x808379,_0x219205,_0x8ffd57){return db[_0xb03d('0x46')]['find']({'where':{'id':_0x808379[_0xb03d('0x58')]['id']}})[_0xb03d('0x26')](handleEntityNotFound(_0x219205,null))[_0xb03d('0x26')](function(_0x4eaa86){if(_0x4eaa86){return _0x4eaa86[_0xb03d('0x91')](_0x808379['query'][_0xb03d('0x80')])['then'](function(){if(_[_0xb03d('0x97')](_0x808379['query'][_0xb03d('0x80')])){for(var _0x5dbba2=0x0;_0x5dbba2<_0x808379[_0xb03d('0x39')]['ids'][_0xb03d('0x3d')];_0x5dbba2+=0x1){socket[_0xb03d('0x92')](_0xb03d('0x93'),{'UserId':Number(_0x808379['query']['ids'][_0x5dbba2]),'VoiceQueueId':Number(_0x808379[_0xb03d('0x58')]['id'])});}}else{socket[_0xb03d('0x92')](_0xb03d('0x93'),{'UserId':Number(_0x808379['query'][_0xb03d('0x80')]),'VoiceQueueId':Number(_0x808379[_0xb03d('0x58')]['id'])});}});}})['then'](function(_0x4b8b11){return db['UserVoiceQueueRt']['destroy']({'where':{'VoiceQueueId':_0x808379[_0xb03d('0x58')]['id'],'UserId':_0x808379[_0xb03d('0x39')][_0xb03d('0x80')]}})[_0xb03d('0x26')](function(){return _0x4b8b11;});})[_0xb03d('0x26')](respondWithStatusCode(_0x219205,null))[_0xb03d('0x4b')](handleError(_0x219205,null));};exports['getAgents']=function(_0x3f7e21,_0x353486,_0x4d05bb){var _0x58d851={};var _0x50acfe={};var _0xce324a;var _0x36391d;return db['VoiceQueue']['findOne']({'where':{'id':_0x3f7e21[_0xb03d('0x58')]['id']}})[_0xb03d('0x26')](handleEntityNotFound(_0x353486,null))[_0xb03d('0x26')](function(_0x805d37){if(_0x805d37){_0xce324a=_0x805d37;_0x50acfe[_0xb03d('0x37')]=_['keys'](db['User'][_0xb03d('0x59')]);_0x50acfe['query']=_['keys'](_0x3f7e21[_0xb03d('0x39')]);_0x50acfe['filters']=_['intersection'](_0x50acfe[_0xb03d('0x37')],_0x50acfe[_0xb03d('0x39')]);_0x58d851[_0xb03d('0x3b')]=_[_0xb03d('0x3a')](_0x50acfe[_0xb03d('0x37')],qs['fields'](_0x3f7e21[_0xb03d('0x39')][_0xb03d('0x3c')]));_0x58d851[_0xb03d('0x3b')]=_0x58d851[_0xb03d('0x3b')][_0xb03d('0x3d')]?_0x58d851[_0xb03d('0x3b')]:_0x50acfe[_0xb03d('0x37')];_0x58d851['order']=qs[_0xb03d('0x61')](_0x3f7e21[_0xb03d('0x39')][_0xb03d('0x61')]);_0x58d851['where']=qs[_0xb03d('0x42')](_[_0xb03d('0x66')](_0x3f7e21[_0xb03d('0x39')],_0x50acfe[_0xb03d('0x42')]));if(_0x3f7e21[_0xb03d('0x39')][_0xb03d('0x2a')]){_0x58d851[_0xb03d('0x41')]=_[_0xb03d('0x43')](_0x58d851[_0xb03d('0x41')],{'$or':_['map'](_0x58d851[_0xb03d('0x3b')],function(_0x34b911){var _0x18ccb0={};_0x18ccb0[_0x34b911]={'$like':'%'+_0x3f7e21[_0xb03d('0x39')][_0xb03d('0x2a')]+'%'};return _0x18ccb0;})});}_0x58d851=_[_0xb03d('0x43')]({},_0x58d851,_0x3f7e21[_0xb03d('0x45')]);return _0xce324a[_0xb03d('0x98')](_0x58d851);}})['then'](function(_0x535957){if(_0x535957){_0x36391d=_0x535957[_0xb03d('0x3d')];if(!_0x3f7e21[_0xb03d('0x39')][_0xb03d('0x3e')](_0xb03d('0x3f'))){_0x58d851['limit']=qs['limit'](_0x3f7e21['query'][_0xb03d('0x21')]);_0x58d851[_0xb03d('0x1e')]=qs[_0xb03d('0x1e')](_0x3f7e21[_0xb03d('0x39')][_0xb03d('0x1e')]);}return _0xce324a['getAgents'](_0x58d851);}})[_0xb03d('0x26')](function(_0x12c790){if(_0x12c790){return _0x12c790?{'count':_0x36391d,'rows':_0x12c790}:null;}})[_0xb03d('0x26')](respondWithResult(_0x353486,null))[_0xb03d('0x4b')](handleError(_0x353486,null));};exports[_0xb03d('0x99')]=function(_0x462112,_0xe4897d,_0x3d24ff){var _0x514e50={};var _0x2cd8d4={};var _0x2fbbf5;var _0x87098c;return db[_0xb03d('0x46')][_0xb03d('0x64')]({'where':{'id':_0x462112[_0xb03d('0x58')]['id']}})[_0xb03d('0x26')](handleEntityNotFound(_0xe4897d,null))[_0xb03d('0x26')](function(_0x4cf7c9){if(_0x4cf7c9){_0x2fbbf5=_0x4cf7c9;_0x2cd8d4[_0xb03d('0x37')]=_[_0xb03d('0x38')](db[_0xb03d('0x7b')][_0xb03d('0x59')]);_0x2cd8d4[_0xb03d('0x39')]=_[_0xb03d('0x38')](_0x462112[_0xb03d('0x39')]);_0x2cd8d4[_0xb03d('0x42')]=_['intersection'](_0x2cd8d4[_0xb03d('0x37')],_0x2cd8d4[_0xb03d('0x39')]);_0x514e50['attributes']=_[_0xb03d('0x3a')](_0x2cd8d4[_0xb03d('0x37')],qs[_0xb03d('0x3c')](_0x462112[_0xb03d('0x39')][_0xb03d('0x3c')]));_0x514e50[_0xb03d('0x3b')]=_0x514e50[_0xb03d('0x3b')][_0xb03d('0x3d')]?_0x514e50[_0xb03d('0x3b')]:_0x2cd8d4[_0xb03d('0x37')];_0x514e50[_0xb03d('0x40')]=qs[_0xb03d('0x61')](_0x462112[_0xb03d('0x39')][_0xb03d('0x61')]);_0x514e50[_0xb03d('0x41')]=qs[_0xb03d('0x42')](_[_0xb03d('0x66')](_0x462112[_0xb03d('0x39')],_0x2cd8d4[_0xb03d('0x42')]));if(_0x462112[_0xb03d('0x39')][_0xb03d('0x2a')]){_0x514e50[_0xb03d('0x41')]=_['merge'](_0x514e50[_0xb03d('0x41')],{'$or':_['map'](_0x514e50['attributes'],function(_0x369ef6){var _0x32e8f9={};_0x32e8f9[_0x369ef6]={'$like':'%'+_0x462112[_0xb03d('0x39')][_0xb03d('0x2a')]+'%'};return _0x32e8f9;})});}_0x514e50=_[_0xb03d('0x43')]({},_0x514e50,_0x462112[_0xb03d('0x45')]);return _0x2fbbf5[_0xb03d('0x99')](_0x514e50);}})[_0xb03d('0x26')](function(_0xe1dce2){if(_0xe1dce2){_0x87098c=_0xe1dce2[_0xb03d('0x3d')];if(!_0x462112[_0xb03d('0x39')][_0xb03d('0x3e')](_0xb03d('0x3f'))){_0x514e50[_0xb03d('0x21')]=qs[_0xb03d('0x21')](_0x462112[_0xb03d('0x39')]['limit']);_0x514e50[_0xb03d('0x1e')]=qs['offset'](_0x462112[_0xb03d('0x39')]['offset']);}return _0x2fbbf5[_0xb03d('0x99')](_0x514e50);}})[_0xb03d('0x26')](function(_0xde01a9){return _0xde01a9?{'count':_0x87098c,'rows':_0xde01a9}:null;})[_0xb03d('0x26')](respondWithResult(_0xe4897d,null))[_0xb03d('0x4b')](handleError(_0xe4897d,null));};exports[_0xb03d('0x9a')]=function(_0x4b4437,_0xb30a7a,_0x409b0d){var _0x3f66d9={};var _0x1c2d9f={};var _0x338a14;var _0x31ecdd;return db[_0xb03d('0x46')][_0xb03d('0x64')]({'where':{'id':_0x4b4437[_0xb03d('0x58')]['id']}})[_0xb03d('0x26')](handleEntityNotFound(_0xb30a7a,null))['then'](function(_0x376e6b){if(_0x376e6b){_0x338a14=_0x376e6b;_0x1c2d9f['model']=_['keys'](db[_0xb03d('0x9b')][_0xb03d('0x59')]);_0x1c2d9f[_0xb03d('0x39')]=_[_0xb03d('0x38')](_0x4b4437[_0xb03d('0x39')]);_0x1c2d9f['filters']=_['intersection'](_0x1c2d9f[_0xb03d('0x37')],_0x1c2d9f[_0xb03d('0x39')]);_0x3f66d9[_0xb03d('0x3b')]=_[_0xb03d('0x3a')](_0x1c2d9f[_0xb03d('0x37')],qs['fields'](_0x4b4437[_0xb03d('0x39')][_0xb03d('0x3c')]));_0x3f66d9['attributes']=_0x3f66d9['attributes'][_0xb03d('0x3d')]?_0x3f66d9['attributes']:_0x1c2d9f[_0xb03d('0x37')];_0x3f66d9[_0xb03d('0x40')]=qs['sort'](_0x4b4437[_0xb03d('0x39')][_0xb03d('0x61')]);_0x3f66d9['where']=qs[_0xb03d('0x42')](_[_0xb03d('0x66')](_0x4b4437[_0xb03d('0x39')],_0x1c2d9f[_0xb03d('0x42')]));if(_0x4b4437[_0xb03d('0x39')][_0xb03d('0x2a')]){_0x3f66d9['where']=_[_0xb03d('0x43')](_0x3f66d9[_0xb03d('0x41')],{'$or':_[_0xb03d('0x2c')](_0x3f66d9[_0xb03d('0x3b')],function(_0x46e9bb){var _0x149f7d={};_0x149f7d[_0x46e9bb]={'$like':'%'+_0x4b4437[_0xb03d('0x39')][_0xb03d('0x2a')]+'%'};return _0x149f7d;})});}_0x3f66d9=_[_0xb03d('0x43')]({},_0x3f66d9,_0x4b4437[_0xb03d('0x45')]);return _0x338a14['getLists'](_0x3f66d9);}})[_0xb03d('0x26')](function(_0x1dd1df){if(_0x1dd1df){_0x31ecdd=_0x1dd1df[_0xb03d('0x3d')];if(!_0x4b4437[_0xb03d('0x39')][_0xb03d('0x3e')](_0xb03d('0x3f'))){_0x3f66d9[_0xb03d('0x21')]=qs[_0xb03d('0x21')](_0x4b4437[_0xb03d('0x39')][_0xb03d('0x21')]);_0x3f66d9[_0xb03d('0x1e')]=qs[_0xb03d('0x1e')](_0x4b4437[_0xb03d('0x39')][_0xb03d('0x1e')]);}return _0x338a14[_0xb03d('0x9a')](_0x3f66d9);}})['then'](function(_0x317808){if(_0x317808){return _0x317808?{'count':_0x31ecdd,'rows':_0x317808}:null;}})[_0xb03d('0x26')](respondWithResult(_0xb30a7a,null))[_0xb03d('0x4b')](handleError(_0xb30a7a,null));};exports[_0xb03d('0x9c')]=function(_0x654b40,_0x2e434c,_0x28505f){var _0x1a76e2=moment()[_0xb03d('0x7c')](_0xb03d('0x9d'));var _0xec9802,_0x198a45;return db[_0xb03d('0x46')][_0xb03d('0x30')]({'where':{'id':_0x654b40[_0xb03d('0x58')]['id']}})['then'](handleEntityNotFound(_0x2e434c,null))[_0xb03d('0x26')](function(_0x1f2420){if(_0x1f2420){_0x198a45=_0x1f2420;return _0x1f2420[_0xb03d('0x9c')](_0x654b40[_0xb03d('0x5d')]['ids'],_[_0xb03d('0x5a')](_0x654b40[_0xb03d('0x5d')],['ids','id'])||{});}return null;})[_0xb03d('0x95')](function(_0x596ca3){var _0x53bca5;_0xec9802=_0x596ca3||[];var _0x2b8a73=[];if(_0x596ca3){for(var _0x176ba2=0x0;_0x176ba2<_0x596ca3[_0xb03d('0x3d')];_0x176ba2+=0x1){var _0x44346d=_0x596ca3[_0x176ba2][_0xb03d('0x4d')]({'plain':!![]});_0x198a45[_0xb03d('0x9e')]=_0x654b40['body']['dialCheckDuplicateType']?_0x654b40['body'][_0xb03d('0x9e')]:_0x198a45[_0xb03d('0x9e')];switch(_0x198a45[_0xb03d('0x9e')]){case _0xb03d('0x9f'):_0x53bca5=squel['insert']()[_0xb03d('0xa0')]('cm_hopper')[_0xb03d('0xa1')]([_0xb03d('0xa2'),_0xb03d('0xa3'),_0xb03d('0xa4'),_0xb03d('0xa5'),_0xb03d('0x62'),_0xb03d('0x5b'),_0xb03d('0x5c')],squel[_0xb03d('0xa6')]()[_0xb03d('0x81')]('phone','phone')[_0xb03d('0x81')]('\x27'+_0x1a76e2+'\x27',_0xb03d('0xa3'))[_0xb03d('0x81')]('id',_0xb03d('0xa4'))[_0xb03d('0x81')](_0x44346d['CmListId'][_0xb03d('0x89')](),_0xb03d('0xa5'))[_0xb03d('0x81')](_0x654b40[_0xb03d('0x58')]['id'][_0xb03d('0x89')](),_0xb03d('0x62'))['field']('\x27'+_0x1a76e2+'\x27',_0xb03d('0x5b'))['field']('\x27'+_0x1a76e2+'\x27',_0xb03d('0x5c'))['from'](_0xb03d('0xa7'))[_0xb03d('0x41')]('deletedAt\x20IS\x20NULL')[_0xb03d('0x41')](_0xb03d('0xa8'),_0x44346d[_0xb03d('0xa9')][_0xb03d('0x89')]())[_0xb03d('0x41')](_0xb03d('0xaa'))[_0xb03d('0x41')](_0xb03d('0xab'),squel['select']()[_0xb03d('0x81')](_0xb03d('0xac'))['from'](_0xb03d('0xad'))[_0xb03d('0x41')]('VoiceQueueId\x20=\x20?',_0x654b40[_0xb03d('0x58')]['id']['toString']()))[_0xb03d('0x41')](_0xb03d('0xab'),squel[_0xb03d('0xa6')]()[_0xb03d('0x81')](_0xb03d('0xae'))[_0xb03d('0x83')](_0xb03d('0xaf'))[_0xb03d('0x41')]('VoiceQueueId\x20=\x20?',_0x654b40[_0xb03d('0x58')]['id'][_0xb03d('0x89')]())))[_0xb03d('0x89')]();break;case'onlyIfOpen':_0x53bca5=squel[_0xb03d('0xb0')]()[_0xb03d('0xa0')](_0xb03d('0xaf'))[_0xb03d('0xa1')](['phone','scheduledAt','ContactId',_0xb03d('0xa5'),_0xb03d('0x62'),_0xb03d('0x5b'),_0xb03d('0x5c')],squel[_0xb03d('0xa6')]()[_0xb03d('0x81')](_0xb03d('0xa2'),_0xb03d('0xa2'))[_0xb03d('0x81')]('\x27'+_0x1a76e2+'\x27','scheduledAt')[_0xb03d('0x81')]('id',_0xb03d('0xa4'))[_0xb03d('0x81')](_0x44346d[_0xb03d('0xa9')][_0xb03d('0x89')](),_0xb03d('0xa5'))['field'](_0x654b40['params']['id'][_0xb03d('0x89')](),_0xb03d('0x62'))['field']('\x27'+_0x1a76e2+'\x27',_0xb03d('0x5b'))['field']('\x27'+_0x1a76e2+'\x27',_0xb03d('0x5c'))[_0xb03d('0x83')](_0xb03d('0xa7'))['where']('deletedAt\x20IS\x20NULL')['where'](_0xb03d('0xa8'),_0x44346d[_0xb03d('0xa9')][_0xb03d('0x89')]())[_0xb03d('0x41')]('phone\x20IS\x20NOT\x20NULL')[_0xb03d('0x41')](_0xb03d('0xab'),squel['select']()['field']('COALESCE(phone,\x27\x27)')[_0xb03d('0x83')]('cm_hopper')[_0xb03d('0x41')](_0xb03d('0x86'),_0x654b40[_0xb03d('0x58')]['id'][_0xb03d('0x89')]())))[_0xb03d('0x89')]();break;default:_0x53bca5=squel[_0xb03d('0xb0')]()['into']('cm_hopper')['fromQuery']([_0xb03d('0xa2'),'scheduledAt','ContactId',_0xb03d('0xa5'),'VoiceQueueId',_0xb03d('0x5b'),_0xb03d('0x5c')],squel[_0xb03d('0xa6')]()[_0xb03d('0x81')](_0xb03d('0xa2'),'phone')[_0xb03d('0x81')]('\x27'+_0x1a76e2+'\x27',_0xb03d('0xa3'))[_0xb03d('0x81')]('id','ContactId')[_0xb03d('0x81')](_0x44346d[_0xb03d('0xa9')][_0xb03d('0x89')](),_0xb03d('0xa5'))[_0xb03d('0x81')](_0x654b40[_0xb03d('0x58')]['id'][_0xb03d('0x89')](),_0xb03d('0x62'))[_0xb03d('0x81')]('\x27'+_0x1a76e2+'\x27','createdAt')[_0xb03d('0x81')]('\x27'+_0x1a76e2+'\x27',_0xb03d('0x5c'))['from'](_0xb03d('0xa7'))[_0xb03d('0x41')](_0xb03d('0xb1'))['where']('ListId\x20=\x20?',_0x44346d[_0xb03d('0xa9')][_0xb03d('0x89')]())['where'](_0xb03d('0xaa')))[_0xb03d('0x89')]();}_0x2b8a73[_0xb03d('0x88')](db[_0xb03d('0x75')][_0xb03d('0x39')](_0x53bca5));}return BPromise[_0xb03d('0x8d')](_0x2b8a73);}})[_0xb03d('0x26')](function(){var _0xe5010c=[];var _0x1fff64=squel[_0xb03d('0xb0')]()[_0xb03d('0xa0')](_0xb03d('0xb2'))[_0xb03d('0xa1')](['CmHopperId',_0xb03d('0xa2'),_0xb03d('0xb3'),'createdAt','updatedAt'],squel['select']()[_0xb03d('0x81')](_0xb03d('0xb4'))['field'](_0xb03d('0xb5'))['field'](_0xb03d('0xb6'))[_0xb03d('0x81')]('\x27'+_0x1a76e2+'\x27',_0xb03d('0x5b'))['field']('\x27'+_0x1a76e2+'\x27','updatedAt')[_0xb03d('0x83')](_0xb03d('0xb7'),'ci')[_0xb03d('0xb8')](_0xb03d('0xaf'),'h','h.ContactId=ci.CmContactId')[_0xb03d('0x41')]('h.scheduledat=?',_0x1a76e2)['where'](_0xb03d('0xb9'),_0xb03d('0xba')))[_0xb03d('0x89')]();_0xe5010c['push'](db[_0xb03d('0x75')][_0xb03d('0x39')](_0x1fff64));return BPromise[_0xb03d('0x8d')](_0xe5010c);})[_0xb03d('0x26')](function(){return _0xec9802;})[_0xb03d('0x26')](respondWithResult(_0x2e434c,null))['catch'](handleError(_0x2e434c,null));};exports[_0xb03d('0xbb')]=function(_0xb676a,_0x1d94ab,_0x5ef171){return db[_0xb03d('0x46')][_0xb03d('0x30')]({'where':{'id':_0xb676a[_0xb03d('0x58')]['id']}})[_0xb03d('0x26')](handleEntityNotFound(_0x1d94ab,null))[_0xb03d('0x26')](function(_0x556fba){if(_0x556fba){return _0x556fba[_0xb03d('0xbb')](_0xb676a[_0xb03d('0x39')]['ids']);}})[_0xb03d('0x26')](function(_0x30bd33){if(_0x30bd33){return db[_0xb03d('0x60')][_0xb03d('0x27')]({'where':{'ListId':_0xb676a[_0xb03d('0x39')]['ids'],'VoiceQueueId':_0xb676a['params']['id']}})[_0xb03d('0x26')](function(){return _0x30bd33;});}})[_0xb03d('0x26')](respondWithStatusCode(_0x1d94ab,null))[_0xb03d('0x4b')](handleError(_0x1d94ab,null));};exports['getBlackLists']=function(_0x2280df,_0x13ff29,_0x5dc243){var _0x56c2db={};var _0x135e69={};var _0x9816bf;var _0x49b2a8;return db[_0xb03d('0x46')][_0xb03d('0x64')]({'where':{'id':_0x2280df['params']['id']}})[_0xb03d('0x26')](handleEntityNotFound(_0x13ff29,null))[_0xb03d('0x26')](function(_0x4b0813){if(_0x4b0813){_0x9816bf=_0x4b0813;_0x135e69[_0xb03d('0x37')]=_[_0xb03d('0x38')](db[_0xb03d('0x9b')]['rawAttributes']);_0x135e69['query']=_[_0xb03d('0x38')](_0x2280df['query']);_0x135e69[_0xb03d('0x42')]=_[_0xb03d('0x3a')](_0x135e69['model'],_0x135e69[_0xb03d('0x39')]);_0x56c2db[_0xb03d('0x3b')]=_[_0xb03d('0x3a')](_0x135e69[_0xb03d('0x37')],qs[_0xb03d('0x3c')](_0x2280df[_0xb03d('0x39')][_0xb03d('0x3c')]));_0x56c2db[_0xb03d('0x3b')]=_0x56c2db[_0xb03d('0x3b')][_0xb03d('0x3d')]?_0x56c2db[_0xb03d('0x3b')]:_0x135e69['model'];_0x56c2db['order']=qs[_0xb03d('0x61')](_0x2280df[_0xb03d('0x39')][_0xb03d('0x61')]);_0x56c2db[_0xb03d('0x41')]=qs[_0xb03d('0x42')](_['pick'](_0x2280df['query'],_0x135e69['filters']));if(_0x2280df[_0xb03d('0x39')][_0xb03d('0x2a')]){_0x56c2db[_0xb03d('0x41')]=_['merge'](_0x56c2db['where'],{'$or':_[_0xb03d('0x2c')](_0x56c2db[_0xb03d('0x3b')],function(_0x51281e){var _0x30b270={};_0x30b270[_0x51281e]={'$like':'%'+_0x2280df[_0xb03d('0x39')]['filter']+'%'};return _0x30b270;})});}_0x56c2db=_['merge']({},_0x56c2db,_0x2280df['options']);return _0x9816bf['getBlackLists'](_0x56c2db);}})[_0xb03d('0x26')](function(_0x20b959){if(_0x20b959){_0x49b2a8=_0x20b959[_0xb03d('0x3d')];if(!_0x2280df['query'][_0xb03d('0x3e')](_0xb03d('0x3f'))){_0x56c2db[_0xb03d('0x21')]=qs[_0xb03d('0x21')](_0x2280df[_0xb03d('0x39')]['limit']);_0x56c2db[_0xb03d('0x1e')]=qs[_0xb03d('0x1e')](_0x2280df[_0xb03d('0x39')][_0xb03d('0x1e')]);}return _0x9816bf[_0xb03d('0xbc')](_0x56c2db);}})[_0xb03d('0x26')](function(_0xeb9f6){if(_0xeb9f6){return _0xeb9f6?{'count':_0x49b2a8,'rows':_0xeb9f6}:null;}})[_0xb03d('0x26')](respondWithResult(_0x13ff29,null))[_0xb03d('0x4b')](handleError(_0x13ff29,null));};exports[_0xb03d('0xbd')]=function(_0x5eccbf,_0x447c89,_0x1cdbb9){var _0x523f0a,_0x4d24b4;return db[_0xb03d('0x46')]['find']({'where':{'id':_0x5eccbf[_0xb03d('0x58')]['id']}})[_0xb03d('0x26')](handleEntityNotFound(_0x447c89,null))['then'](function(_0xbba66c){if(_0xbba66c){_0x4d24b4=_0xbba66c;return _0xbba66c[_0xb03d('0xbd')](_0x5eccbf['body'][_0xb03d('0x80')],_[_0xb03d('0x5a')](_0x5eccbf['body'],['ids','id'])||{});}return null;})[_0xb03d('0x95')](function(_0x12e2bb){var _0x3a879e;_0x523f0a=_0x12e2bb||[];var _0x17f2e9=[];if(_0x12e2bb){for(var _0x5ced5d=0x0;_0x5ced5d<_0x12e2bb[_0xb03d('0x3d')];_0x5ced5d+=0x1){var _0x2bd077=_0x12e2bb[_0x5ced5d][_0xb03d('0x4d')]({'plain':!![]});_0x3a879e=squel[_0xb03d('0xb0')]()[_0xb03d('0xa0')](_0xb03d('0xbe'))[_0xb03d('0xa1')]([_0xb03d('0xa2'),_0xb03d('0xa4'),'ListId',_0xb03d('0x62'),_0xb03d('0x5b'),'updatedAt'],squel['select']()[_0xb03d('0x81')](_0xb03d('0xa2'),_0xb03d('0xa2'))[_0xb03d('0x81')]('id',_0xb03d('0xa4'))[_0xb03d('0x81')](_0x2bd077[_0xb03d('0xa9')][_0xb03d('0x89')](),_0xb03d('0xa5'))[_0xb03d('0x81')](_0x5eccbf['params']['id'][_0xb03d('0x89')](),_0xb03d('0x62'))[_0xb03d('0x81')](_0xb03d('0xbf'),_0xb03d('0x5b'))[_0xb03d('0x81')](_0xb03d('0xbf'),'updatedAt')['from'](_0xb03d('0xa7'))['where'](_0xb03d('0xb1'))['where']('ListId\x20=\x20?',_0x2bd077['CmListId']['toString']())[_0xb03d('0x41')](_0xb03d('0xaa')))['toString']();_0x17f2e9['push'](db['sequelize']['query'](_0x3a879e));}return BPromise[_0xb03d('0x8d')](_0x17f2e9);}})[_0xb03d('0x26')](function(){return _0x523f0a;})['then'](respondWithResult(_0x447c89,null))[_0xb03d('0x4b')](handleError(_0x447c89,null));};exports['removeBlackLists']=function(_0xe2a05,_0x3802a0,_0x265dc5){return db['VoiceQueue'][_0xb03d('0x30')]({'where':{'id':_0xe2a05[_0xb03d('0x58')]['id']}})[_0xb03d('0x26')](handleEntityNotFound(_0x3802a0,null))['then'](function(_0x597409){if(_0x597409){return _0x597409[_0xb03d('0xc0')](_0xe2a05['query'][_0xb03d('0x80')]);}})['then'](function(_0x3732da){if(_0x3732da){return db[_0xb03d('0x6a')][_0xb03d('0x27')]({'where':{'ListId':_0xe2a05['query'][_0xb03d('0x80')],'VoiceQueueId':_0xe2a05['params']['id']}})[_0xb03d('0x26')](function(){return _0x3732da;});}})['then'](respondWithStatusCode(_0x3802a0,null))['catch'](handleError(_0x3802a0,null));};
\ No newline at end of file
index e989588..7235fe9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8044=['../../mysqldb','VoiceQueue','save','update','remove','emit','hasOwnProperty','exports','events'];(function(_0x2a453b,_0x479c50){var _0x132f79=function(_0x5e3d83){while(--_0x5e3d83){_0x2a453b['push'](_0x2a453b['shift']());}};_0x132f79(++_0x479c50);}(_0x8044,0x7d));var _0x4804=function(_0x396466,_0xe9857b){_0x396466=_0x396466-0x0;var _0x5e9ab4=_0x8044[_0x396466];return _0x5e9ab4;};'use strict';var EventEmitter=require(_0x4804('0x0'));var VoiceQueue=require(_0x4804('0x1'))['db'][_0x4804('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x4804('0x3'),'afterUpdate':_0x4804('0x4'),'afterDestroy':_0x4804('0x5')};function emitEvent(_0x4481b5){return function(_0xb3349f,_0x3c8edd,_0x4b799b){VoiceQueueEvents[_0x4804('0x6')](_0x4481b5+':'+_0xb3349f['id'],_0xb3349f);VoiceQueueEvents[_0x4804('0x6')](_0x4481b5,_0xb3349f);_0x4b799b(null);};}for(var e in events){if(events[_0x4804('0x7')](e)){var event=events[e];VoiceQueue['hook'](e,emitEvent(event));}}module[_0x4804('0x8')]=VoiceQueueEvents;
\ No newline at end of file
+var _0x70be=['update','emit','hasOwnProperty','hook','exports','VoiceQueue','setMaxListeners','save'];(function(_0x5968c5,_0x47c5d7){var _0x2e725a=function(_0x515f2d){while(--_0x515f2d){_0x5968c5['push'](_0x5968c5['shift']());}};_0x2e725a(++_0x47c5d7);}(_0x70be,0x12d));var _0xe70b=function(_0xddfcc0,_0x38943a){_0xddfcc0=_0xddfcc0-0x0;var _0x47b45e=_0x70be[_0xddfcc0];return _0x47b45e;};'use strict';var EventEmitter=require('events');var VoiceQueue=require('../../mysqldb')['db'][_0xe70b('0x0')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xe70b('0x1')](0x0);var events={'afterCreate':_0xe70b('0x2'),'afterUpdate':_0xe70b('0x3'),'afterDestroy':'remove'};function emitEvent(_0x3628ef){return function(_0x19256f,_0x33345c,_0x2a4d34){VoiceQueueEvents[_0xe70b('0x4')](_0x3628ef+':'+_0x19256f['id'],_0x19256f);VoiceQueueEvents['emit'](_0x3628ef,_0x19256f);_0x2a4d34(null);};}for(var e in events){if(events[_0xe70b('0x5')](e)){var event=events[e];VoiceQueue[_0xe70b('0x6')](e,emitEvent(event));}}module[_0xe70b('0x7')]=VoiceQueueEvents;
\ No newline at end of file
index ae89312..14be0c3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3e74=['exports','VoiceQueue','voice_queues','lodash','../../config/logger','api','moment','path','../../config/environment','./voiceQueue.attributes'];(function(_0x5f3309,_0x37871b){var _0xea65ec=function(_0x4fbe43){while(--_0x4fbe43){_0x5f3309['push'](_0x5f3309['shift']());}};_0xea65ec(++_0x37871b);}(_0x3e74,0x175));var _0x43e7=function(_0x160259,_0x4e5e3d){_0x160259=_0x160259-0x0;var _0x1758c0=_0x3e74[_0x160259];return _0x1758c0;};'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 _0x70e0=['voice_queues','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','./voiceQueue.attributes'];(function(_0x1ed116,_0x23bc80){var _0x574066=function(_0x424f9e){while(--_0x424f9e){_0x1ed116['push'](_0x1ed116['shift']());}};_0x574066(++_0x23bc80);}(_0x70e0,0x17b));var _0x070e=function(_0x5822b3,_0x1191b8){_0x5822b3=_0x5822b3-0x0;var _0x4c7697=_0x70e0[_0x5822b3];return _0x4c7697;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var logger=require(_0x070e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x070e('0x3'));var rp=require(_0x070e('0x4'));var fs=require('fs');var path=require(_0x070e('0x5'));var rimraf=require(_0x070e('0x6'));var config=require('../../config/environment');var attributes=require(_0x070e('0x7'));module['exports']=function(_0x46fe68,_0x4b041d){return _0x46fe68['define']('VoiceQueue',attributes,{'tableName':_0x070e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 03cae4e..e6410bf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa040=['GetVoiceQueue','VoiceQueue','findAll','options','raw','where','attributes','include','map','model','catch','ShowVoiceQueue','find','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','./voiceQueue.socket','register','then','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xa040,0x1e1));var _0x0a04=function(_0x592bde,_0x3045d3){_0x592bde=_0x592bde-0x0;var _0xe3eb1=_0xa040[_0x592bde];return _0xe3eb1;};'use strict';var _=require('lodash');var util=require(_0x0a04('0x0'));var moment=require(_0x0a04('0x1'));var BPromise=require(_0x0a04('0x2'));var rs=require(_0x0a04('0x3'));var fs=require('fs');var Redis=require(_0x0a04('0x4'));var db=require(_0x0a04('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x0a04('0x6'));var config=require(_0x0a04('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x0a04('0x8')][_0x0a04('0x9')]({'port':0x232a});config[_0x0a04('0xa')]=_['defaults'](config[_0x0a04('0xa')],{'host':_0x0a04('0xb'),'port':0x18eb});var socket=require(_0x0a04('0xc'))(new Redis(config[_0x0a04('0xa')]));require(_0x0a04('0xd'))[_0x0a04('0xe')](socket);function respondWithRpcPromise(_0x78ff6,_0x46ca86,_0x49b445){return new BPromise(function(_0x303709,_0x224b21){return client['request'](_0x78ff6,_0x49b445)[_0x0a04('0xf')](function(_0x434a74){logger['info'](_0x0a04('0x10'),_0x46ca86,_0x0a04('0x11'));logger[_0x0a04('0x12')](_0x0a04('0x13'),_0x46ca86,_0x0a04('0x11'),JSON[_0x0a04('0x14')](_0x434a74));if(_0x434a74[_0x0a04('0x15')]){if(_0x434a74[_0x0a04('0x15')][_0x0a04('0x16')]===0x1f4){logger[_0x0a04('0x15')]('VoiceQueue,\x20%s,\x20%s',_0x46ca86,_0x434a74[_0x0a04('0x15')][_0x0a04('0x17')]);return _0x224b21(_0x434a74['error']['message']);}logger[_0x0a04('0x15')](_0x0a04('0x10'),_0x46ca86,_0x434a74[_0x0a04('0x15')][_0x0a04('0x17')]);return _0x303709(_0x434a74[_0x0a04('0x15')][_0x0a04('0x17')]);}else{logger[_0x0a04('0x18')]('VoiceQueue,\x20%s,\x20%s',_0x46ca86,'request\x20sent');_0x303709(_0x434a74[_0x0a04('0x19')]['message']);}})['catch'](function(_0x18ad37){logger[_0x0a04('0x15')](_0x0a04('0x10'),_0x46ca86,_0x18ad37);_0x224b21(_0x18ad37);});});}exports[_0x0a04('0x1a')]=function(_0x43848d){var _0x14333c=this;return new Promise(function(_0x2c777e,_0x16a211){return db[_0x0a04('0x1b')][_0x0a04('0x1c')]({'raw':_0x43848d['options']?_0x43848d[_0x0a04('0x1d')][_0x0a04('0x1e')]===undefined?!![]:![]:!![],'where':_0x43848d[_0x0a04('0x1d')]?_0x43848d[_0x0a04('0x1d')][_0x0a04('0x1f')]||null:null,'attributes':_0x43848d['options']?_0x43848d[_0x0a04('0x1d')][_0x0a04('0x20')]||null:null,'limit':_0x43848d[_0x0a04('0x1d')]?_0x43848d[_0x0a04('0x1d')]['limit']||null:null,'include':_0x43848d[_0x0a04('0x1d')]?_0x43848d[_0x0a04('0x1d')][_0x0a04('0x21')]?_[_0x0a04('0x22')](_0x43848d[_0x0a04('0x1d')][_0x0a04('0x21')],function(_0x4d93e8){return{'model':db[_0x4d93e8[_0x0a04('0x23')]],'as':_0x4d93e8['as'],'attributes':_0x4d93e8[_0x0a04('0x20')],'include':_0x4d93e8[_0x0a04('0x21')]?_[_0x0a04('0x22')](_0x4d93e8[_0x0a04('0x21')],function(_0x974389){return{'model':db[_0x974389[_0x0a04('0x23')]],'as':_0x974389['as'],'attributes':_0x974389['attributes'],'include':_0x974389[_0x0a04('0x21')]?_[_0x0a04('0x22')](_0x974389[_0x0a04('0x21')],function(_0x159db9){return{'model':db[_0x159db9['model']],'as':_0x159db9['as'],'attributes':_0x159db9[_0x0a04('0x20')]};}):[]};}):[]};}):[]:[]})[_0x0a04('0xf')](function(_0x361d7f){logger[_0x0a04('0x18')](_0x0a04('0x1a'),_0x43848d);logger[_0x0a04('0x12')]('GetVoiceQueue',_0x43848d,JSON['stringify'](_0x361d7f));_0x2c777e(_0x361d7f);})[_0x0a04('0x24')](function(_0x595d33){logger[_0x0a04('0x15')](_0x0a04('0x1a'),_0x595d33['message'],_0x43848d);_0x16a211(_0x14333c[_0x0a04('0x15')](0x1f4,_0x595d33[_0x0a04('0x17')]));});});};exports[_0x0a04('0x25')]=function(_0x537ca3){var _0x3e6422=this;return new Promise(function(_0x77376c,_0x52a5bc){return db[_0x0a04('0x1b')][_0x0a04('0x26')]({'raw':_0x537ca3[_0x0a04('0x1d')]?_0x537ca3[_0x0a04('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x537ca3[_0x0a04('0x1d')]?_0x537ca3[_0x0a04('0x1d')]['where']||null:null,'attributes':_0x537ca3['options']?_0x537ca3['options'][_0x0a04('0x20')]||null:null,'include':_0x537ca3[_0x0a04('0x1d')]?_0x537ca3[_0x0a04('0x1d')][_0x0a04('0x21')]?_[_0x0a04('0x22')](_0x537ca3[_0x0a04('0x1d')][_0x0a04('0x21')],function(_0x3293d6){return{'model':db[_0x3293d6['model']],'as':_0x3293d6['as'],'attributes':_0x3293d6[_0x0a04('0x20')],'include':_0x3293d6[_0x0a04('0x21')]?_['map'](_0x3293d6['include'],function(_0x13e7e4){return{'model':db[_0x13e7e4[_0x0a04('0x23')]],'as':_0x13e7e4['as'],'attributes':_0x13e7e4[_0x0a04('0x20')],'include':_0x13e7e4[_0x0a04('0x21')]?_[_0x0a04('0x22')](_0x13e7e4[_0x0a04('0x21')],function(_0x28160e){return{'model':db[_0x28160e[_0x0a04('0x23')]],'as':_0x28160e['as'],'attributes':_0x28160e[_0x0a04('0x20')]};}):[]};}):[]};}):[]:[]})[_0x0a04('0xf')](function(_0x1a380b){logger['info']('ShowVoiceQueue',_0x537ca3);logger[_0x0a04('0x12')]('ShowVoiceQueue',_0x537ca3,JSON[_0x0a04('0x14')](_0x1a380b));_0x77376c(_0x1a380b);})['catch'](function(_0x5d7f89){logger['error'](_0x0a04('0x25'),_0x5d7f89[_0x0a04('0x17')],_0x537ca3);_0x52a5bc(_0x3e6422[_0x0a04('0x15')](0x1f4,_0x5d7f89['message']));});});};
\ No newline at end of file
+var _0xda68=['include','model','ShowVoiceQueue','find','raw','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','redis','defaults','socket.io-emitter','register','request','then','info','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','VoiceQueue,\x20%s,\x20%s','message','result','catch','GetVoiceQueue','VoiceQueue','findAll','options','where','attributes','limit','map'];(function(_0x226106,_0x18e497){var _0x6c66b2=function(_0xab7fe0){while(--_0xab7fe0){_0x226106['push'](_0x226106['shift']());}};_0x6c66b2(++_0x18e497);}(_0xda68,0x124));var _0x8da6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xda68[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x8da6('0x0'));var moment=require(_0x8da6('0x1'));var BPromise=require(_0x8da6('0x2'));var rs=require(_0x8da6('0x3'));var fs=require('fs');var Redis=require(_0x8da6('0x4'));var db=require(_0x8da6('0x5'))['db'];var utils=require(_0x8da6('0x6'));var logger=require('../../config/logger')(_0x8da6('0x7'));var config=require('../../config/environment');var jayson=require(_0x8da6('0x8'));var client=jayson[_0x8da6('0x9')][_0x8da6('0xa')]({'port':0x232a});config[_0x8da6('0xb')]=_[_0x8da6('0xc')](config[_0x8da6('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x8da6('0xd'))(new Redis(config[_0x8da6('0xb')]));require('./voiceQueue.socket')[_0x8da6('0xe')](socket);function respondWithRpcPromise(_0x50d88b,_0x589122,_0x2af6eb){return new BPromise(function(_0x2bd949,_0x1afaf2){return client[_0x8da6('0xf')](_0x50d88b,_0x2af6eb)[_0x8da6('0x10')](function(_0x1a05e3){logger[_0x8da6('0x11')]('VoiceQueue,\x20%s,\x20%s',_0x589122,'request\x20sent');logger[_0x8da6('0x12')](_0x8da6('0x13'),_0x589122,_0x8da6('0x14'),JSON[_0x8da6('0x15')](_0x1a05e3));if(_0x1a05e3[_0x8da6('0x16')]){if(_0x1a05e3[_0x8da6('0x16')][_0x8da6('0x17')]===0x1f4){logger[_0x8da6('0x16')](_0x8da6('0x18'),_0x589122,_0x1a05e3[_0x8da6('0x16')][_0x8da6('0x19')]);return _0x1afaf2(_0x1a05e3[_0x8da6('0x16')]['message']);}logger[_0x8da6('0x16')]('VoiceQueue,\x20%s,\x20%s',_0x589122,_0x1a05e3[_0x8da6('0x16')][_0x8da6('0x19')]);return _0x2bd949(_0x1a05e3[_0x8da6('0x16')]['message']);}else{logger['info'](_0x8da6('0x18'),_0x589122,_0x8da6('0x14'));_0x2bd949(_0x1a05e3[_0x8da6('0x1a')][_0x8da6('0x19')]);}})[_0x8da6('0x1b')](function(_0x1805e4){logger[_0x8da6('0x16')](_0x8da6('0x18'),_0x589122,_0x1805e4);_0x1afaf2(_0x1805e4);});});}exports[_0x8da6('0x1c')]=function(_0x4cf58c){var _0x233662=this;return new Promise(function(_0x29fb1e,_0x35be36){return db[_0x8da6('0x1d')][_0x8da6('0x1e')]({'raw':_0x4cf58c['options']?_0x4cf58c[_0x8da6('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x4cf58c[_0x8da6('0x1f')]?_0x4cf58c[_0x8da6('0x1f')][_0x8da6('0x20')]||null:null,'attributes':_0x4cf58c[_0x8da6('0x1f')]?_0x4cf58c[_0x8da6('0x1f')][_0x8da6('0x21')]||null:null,'limit':_0x4cf58c[_0x8da6('0x1f')]?_0x4cf58c[_0x8da6('0x1f')][_0x8da6('0x22')]||null:null,'include':_0x4cf58c[_0x8da6('0x1f')]?_0x4cf58c[_0x8da6('0x1f')]['include']?_[_0x8da6('0x23')](_0x4cf58c[_0x8da6('0x1f')][_0x8da6('0x24')],function(_0x5bed39){return{'model':db[_0x5bed39['model']],'as':_0x5bed39['as'],'attributes':_0x5bed39[_0x8da6('0x21')],'include':_0x5bed39['include']?_[_0x8da6('0x23')](_0x5bed39[_0x8da6('0x24')],function(_0x239e47){return{'model':db[_0x239e47[_0x8da6('0x25')]],'as':_0x239e47['as'],'attributes':_0x239e47[_0x8da6('0x21')],'include':_0x239e47[_0x8da6('0x24')]?_[_0x8da6('0x23')](_0x239e47[_0x8da6('0x24')],function(_0x2661e9){return{'model':db[_0x2661e9['model']],'as':_0x2661e9['as'],'attributes':_0x2661e9[_0x8da6('0x21')]};}):[]};}):[]};}):[]:[]})[_0x8da6('0x10')](function(_0x22be72){logger[_0x8da6('0x11')](_0x8da6('0x1c'),_0x4cf58c);logger[_0x8da6('0x12')](_0x8da6('0x1c'),_0x4cf58c,JSON['stringify'](_0x22be72));_0x29fb1e(_0x22be72);})['catch'](function(_0x2e6c46){logger[_0x8da6('0x16')]('GetVoiceQueue',_0x2e6c46[_0x8da6('0x19')],_0x4cf58c);_0x35be36(_0x233662[_0x8da6('0x16')](0x1f4,_0x2e6c46[_0x8da6('0x19')]));});});};exports[_0x8da6('0x26')]=function(_0xedb6b5){var _0x5162c6=this;return new Promise(function(_0x39218f,_0x197be7){return db[_0x8da6('0x1d')][_0x8da6('0x27')]({'raw':_0xedb6b5[_0x8da6('0x1f')]?_0xedb6b5['options'][_0x8da6('0x28')]===undefined?!![]:![]:!![],'where':_0xedb6b5['options']?_0xedb6b5['options'][_0x8da6('0x20')]||null:null,'attributes':_0xedb6b5['options']?_0xedb6b5[_0x8da6('0x1f')][_0x8da6('0x21')]||null:null,'include':_0xedb6b5['options']?_0xedb6b5[_0x8da6('0x1f')][_0x8da6('0x24')]?_['map'](_0xedb6b5[_0x8da6('0x1f')][_0x8da6('0x24')],function(_0x51ff75){return{'model':db[_0x51ff75[_0x8da6('0x25')]],'as':_0x51ff75['as'],'attributes':_0x51ff75[_0x8da6('0x21')],'include':_0x51ff75['include']?_[_0x8da6('0x23')](_0x51ff75[_0x8da6('0x24')],function(_0x2591c6){return{'model':db[_0x2591c6['model']],'as':_0x2591c6['as'],'attributes':_0x2591c6[_0x8da6('0x21')],'include':_0x2591c6[_0x8da6('0x24')]?_[_0x8da6('0x23')](_0x2591c6[_0x8da6('0x24')],function(_0x39418e){return{'model':db[_0x39418e[_0x8da6('0x25')]],'as':_0x39418e['as'],'attributes':_0x39418e[_0x8da6('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x352002){logger['info'](_0x8da6('0x26'),_0xedb6b5);logger[_0x8da6('0x12')](_0x8da6('0x26'),_0xedb6b5,JSON['stringify'](_0x352002));_0x39218f(_0x352002);})[_0x8da6('0x1b')](function(_0xfc71f2){logger['error']('ShowVoiceQueue',_0xfc71f2['message'],_0xedb6b5);_0x197be7(_0x5162c6[_0x8da6('0x16')](0x1f4,_0xfc71f2[_0x8da6('0x19')]));});});};
\ No newline at end of file
index 35dc934..7f4bd55 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9ad=['removeListener','register','length','./voiceQueue.events','save','remove','update','emit'];(function(_0x126b2e,_0x3e94e4){var _0x347419=function(_0xa688e1){while(--_0xa688e1){_0x126b2e['push'](_0x126b2e['shift']());}};_0x347419(++_0x3e94e4);}(_0xa9ad,0x11b));var _0xda9a=function(_0x5d40ee,_0x21a944){_0x5d40ee=_0x5d40ee-0x0;var _0x442b35=_0xa9ad[_0x5d40ee];return _0x442b35;};'use strict';var VoiceQueueEvents=require(_0xda9a('0x0'));var events=[_0xda9a('0x1'),_0xda9a('0x2'),_0xda9a('0x3')];function createListener(_0x320945,_0x2caf25){return function(_0xe70f31){_0x2caf25[_0xda9a('0x4')](_0x320945,_0xe70f31);};}function removeListener(_0x562d37,_0x2a4f0e){return function(){VoiceQueueEvents[_0xda9a('0x5')](_0x562d37,_0x2a4f0e);};}exports[_0xda9a('0x6')]=function(_0x54945e){for(var _0x38df47=0x0,_0x1a66b8=events[_0xda9a('0x7')];_0x38df47<_0x1a66b8;_0x38df47++){var _0x330e76=events[_0x38df47];var _0x72eecd=createListener('voiceQueue:'+_0x330e76,_0x54945e);VoiceQueueEvents['on'](_0x330e76,_0x72eecd);}};
\ No newline at end of file
+var _0x6982=['register','length','voiceQueue:','./voiceQueue.events','save','remove','update','removeListener'];(function(_0x46bf18,_0x24c5a8){var _0x3798bb=function(_0x47ba00){while(--_0x47ba00){_0x46bf18['push'](_0x46bf18['shift']());}};_0x3798bb(++_0x24c5a8);}(_0x6982,0x1e3));var _0x2698=function(_0x4af4fa,_0xe3089c){_0x4af4fa=_0x4af4fa-0x0;var _0x1eb771=_0x6982[_0x4af4fa];return _0x1eb771;};'use strict';var VoiceQueueEvents=require(_0x2698('0x0'));var events=[_0x2698('0x1'),_0x2698('0x2'),_0x2698('0x3')];function createListener(_0x1e00a5,_0x54e000){return function(_0x4629e4){_0x54e000['emit'](_0x1e00a5,_0x4629e4);};}function removeListener(_0x57e1c0,_0x4feda8){return function(){VoiceQueueEvents[_0x2698('0x4')](_0x57e1c0,_0x4feda8);};}exports[_0x2698('0x5')]=function(_0x4ba62b){for(var _0x1ffe26=0x0,_0x3f2644=events[_0x2698('0x6')];_0x1ffe26<_0x3f2644;_0x1ffe26++){var _0x73359=events[_0x1ffe26];var _0x24eccf=createListener(_0x2698('0x7')+_0x73359,_0x4ba62b);VoiceQueueEvents['on'](_0x73359,_0x24eccf);}};
\ No newline at end of file
index 922fd80..745c7ee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x04b1=['delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../config/environment','./voiceQueueReport.controller','get','isAuthenticated','index','/describe','/index','getVoiceQueuesReport','/:id','show','create','update'];(function(_0x61cec2,_0x4bf8ec){var _0x2ff357=function(_0x2a1575){while(--_0x2a1575){_0x61cec2['push'](_0x61cec2['shift']());}};_0x2ff357(++_0x4bf8ec);}(_0x04b1,0x1a7));var _0x104b=function(_0x4ca333,_0x1218a3){_0x4ca333=_0x4ca333-0x0;var _0x13b2e1=_0x04b1[_0x4ca333];return _0x13b2e1;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x104b('0x0'));var timeout=require(_0x104b('0x1'));var express=require(_0x104b('0x2'));var router=express[_0x104b('0x3')]();var fs_extra=require(_0x104b('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x104b('0x5'));var controller=require(_0x104b('0x6'));router[_0x104b('0x7')]('/',auth[_0x104b('0x8')](),controller[_0x104b('0x9')]);router['get'](_0x104b('0xa'),auth[_0x104b('0x8')](),controller['describe']);router['get'](_0x104b('0xb'),auth[_0x104b('0x8')](),controller[_0x104b('0xc')]);router[_0x104b('0x7')](_0x104b('0xd'),auth[_0x104b('0x8')](),controller[_0x104b('0xe')]);router['post']('/',auth[_0x104b('0x8')](),controller[_0x104b('0xf')]);router['put'](_0x104b('0xd'),auth[_0x104b('0x8')](),controller[_0x104b('0x10')]);router[_0x104b('0x11')](_0x104b('0xd'),auth[_0x104b('0x8')](),controller[_0x104b('0x12')]);module[_0x104b('0x13')]=router;
\ No newline at end of file
+var _0x07ca=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','get','index','/describe','describe','/index','isAuthenticated','getVoiceQueuesReport','/:id','show','post','create','put','update','delete'];(function(_0x4fb993,_0x4fd8ef){var _0x348c09=function(_0x38c9da){while(--_0x38c9da){_0x4fb993['push'](_0x4fb993['shift']());}};_0x348c09(++_0x4fd8ef);}(_0x07ca,0x1b2));var _0xa07c=function(_0x457c96,_0x13785c){_0x457c96=_0x457c96-0x0;var _0x4e5ebc=_0x07ca[_0x457c96];return _0x4e5ebc;};'use strict';var multer=require(_0xa07c('0x0'));var util=require(_0xa07c('0x1'));var path=require(_0xa07c('0x2'));var timeout=require(_0xa07c('0x3'));var express=require(_0xa07c('0x4'));var router=express[_0xa07c('0x5')]();var fs_extra=require(_0xa07c('0x6'));var auth=require(_0xa07c('0x7'));var interaction=require(_0xa07c('0x8'));var config=require(_0xa07c('0x9'));var controller=require(_0xa07c('0xa'));router[_0xa07c('0xb')]('/',auth['isAuthenticated'](),controller[_0xa07c('0xc')]);router[_0xa07c('0xb')](_0xa07c('0xd'),auth['isAuthenticated'](),controller[_0xa07c('0xe')]);router['get'](_0xa07c('0xf'),auth[_0xa07c('0x10')](),controller[_0xa07c('0x11')]);router[_0xa07c('0xb')](_0xa07c('0x12'),auth['isAuthenticated'](),controller[_0xa07c('0x13')]);router[_0xa07c('0x14')]('/',auth[_0xa07c('0x10')](),controller[_0xa07c('0x15')]);router[_0xa07c('0x16')](_0xa07c('0x12'),auth['isAuthenticated'](),controller[_0xa07c('0x17')]);router[_0xa07c('0x18')](_0xa07c('0x12'),auth[_0xa07c('0x10')](),controller[_0xa07c('0x19')]);module[_0xa07c('0x1a')]=router;
\ No newline at end of file
index b074ab6..e28513f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9f64=['sequelize','moment','exports','STRING','DATE','getDataValue','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','seconds','setDataValue','queuecallerleaveAt','holdtime','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED'];(function(_0x59f8ef,_0x31ffb6){var _0x2365b7=function(_0x2a5175){while(--_0x2a5175){_0x59f8ef['push'](_0x59f8ef['shift']());}};_0x2365b7(++_0x31ffb6);}(_0x9f64,0x160));var _0x49f6=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x9f64[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0x49f6('0x0'));var moment=require(_0x49f6('0x1'));module[_0x49f6('0x2')]={'type':{'type':Sequelize[_0x49f6('0x3')]},'uniqueid':{'type':Sequelize[_0x49f6('0x3')]},'calleridnum':{'type':Sequelize[_0x49f6('0x3')]},'calleridname':{'type':Sequelize[_0x49f6('0x3')]},'queue':{'type':Sequelize[_0x49f6('0x3')]},'queuecallerjoinAt':{'type':Sequelize[_0x49f6('0x4')]},'queuecallerleaveAt':{'type':Sequelize[_0x49f6('0x4')],'set':function(_0x31b959){var _0x4314fe=moment(_0x31b959);var _0x2dbbbe=moment(this[_0x49f6('0x5')](_0x49f6('0x6')))[_0x49f6('0x7')](_0x49f6('0x8'));var _0x21b975=_0x4314fe['diff'](_0x2dbbbe,_0x49f6('0x9'));this[_0x49f6('0xa')](_0x49f6('0xb'),_0x31b959);this[_0x49f6('0xa')](_0x49f6('0xc'),_0x21b975||null);}},'position':{'type':Sequelize[_0x49f6('0xd')]},'count':{'type':Sequelize['INTEGER']},'queuecallerabandon':{'type':Sequelize[_0x49f6('0xe')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize['DATE']},'queuecallercomplete':{'type':Sequelize[_0x49f6('0xe')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize['DATE']},'queuecallerexit':{'type':Sequelize[_0x49f6('0xe')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize['DATE']},'queuecallerexitreason':{'type':Sequelize['STRING'],'comment':'COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT'},'originalposition':{'type':Sequelize[_0x49f6('0xd')]},'channel':{'type':Sequelize[_0x49f6('0x3')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x49f6('0x3')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x49f6('0x3')]},'exten':{'type':Sequelize[_0x49f6('0x3')]},'priority':{'type':Sequelize[_0x49f6('0x3')]},'holdtime':{'type':Sequelize[_0x49f6('0xd')]},'mohtime':{'type':Sequelize[_0x49f6('0xd')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x49f6('0xe')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x49f6('0x3')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':_0x49f6('0xf')},'transferexten':{'type':Sequelize[_0x49f6('0x3')]},'transferuniqueid':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0x49f6('0x3')]},'secondDisposition':{'type':Sequelize[_0x49f6('0x3')]},'thirdDisposition':{'type':Sequelize[_0x49f6('0x3')]},'queuecallerenterreason':{'type':Sequelize[_0x49f6('0xd')],'defaultValue':0x0}};
\ No newline at end of file
+var _0xe0cc=['COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','exports','STRING','DATE','getDataValue','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','setDataValue','holdtime','INTEGER','BOOLEAN'];(function(_0x2aa0e7,_0x4e5145){var _0x1472c0=function(_0x4deaeb){while(--_0x4deaeb){_0x2aa0e7['push'](_0x2aa0e7['shift']());}};_0x1472c0(++_0x4e5145);}(_0xe0cc,0x1cd));var _0xce0c=function(_0x180e4e,_0x1740d3){_0x180e4e=_0x180e4e-0x0;var _0x3410fa=_0xe0cc[_0x180e4e];return _0x3410fa;};'use strict';var Sequelize=require(_0xce0c('0x0'));var moment=require(_0xce0c('0x1'));module[_0xce0c('0x2')]={'type':{'type':Sequelize[_0xce0c('0x3')]},'uniqueid':{'type':Sequelize[_0xce0c('0x3')]},'calleridnum':{'type':Sequelize[_0xce0c('0x3')]},'calleridname':{'type':Sequelize[_0xce0c('0x3')]},'queue':{'type':Sequelize[_0xce0c('0x3')]},'queuecallerjoinAt':{'type':Sequelize['DATE']},'queuecallerleaveAt':{'type':Sequelize[_0xce0c('0x4')],'set':function(_0x10eb31){var _0x3bbedb=moment(_0x10eb31);var _0x196137=moment(this[_0xce0c('0x5')](_0xce0c('0x6')))[_0xce0c('0x7')](_0xce0c('0x8'));var _0x73c8d1=_0x3bbedb[_0xce0c('0x9')](_0x196137,_0xce0c('0xa'));this['setDataValue']('queuecallerleaveAt',_0x10eb31);this[_0xce0c('0xb')](_0xce0c('0xc'),_0x73c8d1||null);}},'position':{'type':Sequelize[_0xce0c('0xd')]},'count':{'type':Sequelize[_0xce0c('0xd')]},'queuecallerabandon':{'type':Sequelize[_0xce0c('0xe')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0xce0c('0x4')]},'queuecallercomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0xce0c('0x4')]},'queuecallerexit':{'type':Sequelize[_0xce0c('0xe')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0xce0c('0x4')]},'queuecallerexitreason':{'type':Sequelize[_0xce0c('0x3')],'comment':_0xce0c('0xf')},'originalposition':{'type':Sequelize['INTEGER']},'channel':{'type':Sequelize[_0xce0c('0x3')]},'connectedlinenum':{'type':Sequelize[_0xce0c('0x3')]},'connectedlinename':{'type':Sequelize[_0xce0c('0x3')]},'accountcode':{'type':Sequelize[_0xce0c('0x3')]},'context':{'type':Sequelize[_0xce0c('0x3')]},'exten':{'type':Sequelize[_0xce0c('0x3')]},'priority':{'type':Sequelize[_0xce0c('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0xce0c('0xd')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xce0c('0xe')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0xce0c('0x3')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xce0c('0x3')],'comment':_0xce0c('0x10')},'transferexten':{'type':Sequelize[_0xce0c('0x3')]},'transferuniqueid':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0xce0c('0x3')]},'secondDisposition':{'type':Sequelize[_0xce0c('0x3')]},'thirdDisposition':{'type':Sequelize[_0xce0c('0x3')]},'queuecallerenterreason':{'type':Sequelize[_0xce0c('0xd')],'defaultValue':0x0}};
\ No newline at end of file
index 911b42f..5514995 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4753=['sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./voiceQueueReport.socket','register','sendStatus','end','status','json','offset','undefined','count','limit','set','apply','save','update','then','destroy','error','stack','name','send','index','map','VoiceQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','merge','options','find','create','body','describe','hasOwnProperty','getVoiceQueuesReport','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x3ba471,_0x5958a9){var _0x2cac20=function(_0x5e5588){while(--_0x5e5588){_0x3ba471['push'](_0x3ba471['shift']());}};_0x2cac20(++_0x5958a9);}(_0x4753,0x1a2));var _0x3475=function(_0x346d90,_0x471890){_0x346d90=_0x346d90-0x0;var _0x3ce7c6=_0x4753[_0x346d90];return _0x3ce7c6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3475('0x0'));var zipdir=require(_0x3475('0x1'));var jsonpatch=require(_0x3475('0x2'));var rp=require(_0x3475('0x3'));var moment=require(_0x3475('0x4'));var BPromise=require(_0x3475('0x5'));var Mustache=require(_0x3475('0x6'));var util=require('util');var path=require('path');var sox=require(_0x3475('0x7'));var csv=require(_0x3475('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3475('0x9'));var _=require('lodash');var squel=require(_0x3475('0xa'));var crypto=require(_0x3475('0xb'));var jsforce=require(_0x3475('0xc'));var deskjs=require(_0x3475('0xd'));var toCsv=require(_0x3475('0x8'));var querystring=require(_0x3475('0xe'));var Papa=require(_0x3475('0xf'));var Redis=require(_0x3475('0x10'));var authService=require(_0x3475('0x11'));var qs=require(_0x3475('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3475('0x13'));var logger=require(_0x3475('0x14'))(_0x3475('0x15'));var utils=require(_0x3475('0x16'));var config=require(_0x3475('0x17'));var licenseUtil=require(_0x3475('0x18'));var db=require(_0x3475('0x19'))['db'];config[_0x3475('0x1a')]=_[_0x3475('0x1b')](config[_0x3475('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x3475('0x1c'))(new Redis(config['redis']));require(_0x3475('0x1d'))[_0x3475('0x1e')](socket);function respondWithStatusCode(_0x53ae46,_0x204d0f){_0x204d0f=_0x204d0f||0xcc;return function(_0x5d7b19){if(_0x5d7b19){return _0x53ae46[_0x3475('0x1f')](_0x204d0f);}return _0x53ae46['status'](_0x204d0f)[_0x3475('0x20')]();};}function respondWithResult(_0x97ffca,_0x5c6914){_0x5c6914=_0x5c6914||0xc8;return function(_0x4fa376){if(_0x4fa376){return _0x97ffca[_0x3475('0x21')](_0x5c6914)[_0x3475('0x22')](_0x4fa376);}};}function respondWithFilteredResult(_0x1b1e7c,_0x4fe1a8){return function(_0x122784){if(_0x122784){var _0x2c8d16=typeof _0x4fe1a8[_0x3475('0x23')]===_0x3475('0x24')&&typeof _0x4fe1a8['limit']===_0x3475('0x24');var _0x5908df=_0x122784[_0x3475('0x25')];var _0x160511=_0x2c8d16?0x0:_0x4fe1a8[_0x3475('0x23')];var _0x300ba0=_0x2c8d16?_0x122784['count']:_0x4fe1a8[_0x3475('0x23')]+_0x4fe1a8[_0x3475('0x26')];var _0x38df60;if(_0x300ba0>=_0x5908df){_0x300ba0=_0x5908df;_0x38df60=0xc8;}else{_0x38df60=0xce;}_0x1b1e7c[_0x3475('0x21')](_0x38df60);return _0x1b1e7c[_0x3475('0x27')]('Content-Range',_0x160511+'-'+_0x300ba0+'/'+_0x5908df)[_0x3475('0x22')](_0x122784);}return null;};}function patchUpdates(_0x257b20){return function(_0x2d42ca){try{jsonpatch[_0x3475('0x28')](_0x2d42ca,_0x257b20,!![]);}catch(_0x74d467){return BPromise['reject'](_0x74d467);}return _0x2d42ca[_0x3475('0x29')]();};}function saveUpdates(_0x16c37e,_0x52a4d9){return function(_0x29dca0){if(_0x29dca0){return _0x29dca0[_0x3475('0x2a')](_0x16c37e)[_0x3475('0x2b')](function(_0x568e95){return _0x568e95;});}return null;};}function removeEntity(_0x48debb,_0xfd6bbf){return function(_0x374cc6){if(_0x374cc6){return _0x374cc6[_0x3475('0x2c')]()[_0x3475('0x2b')](function(){_0x48debb[_0x3475('0x21')](0xcc)[_0x3475('0x20')]();});}};}function handleEntityNotFound(_0x41b86e,_0x7d0069){return function(_0xc38594){if(!_0xc38594){_0x41b86e['sendStatus'](0x194);}return _0xc38594;};}function handleError(_0x14bf42,_0x4e304d){_0x4e304d=_0x4e304d||0x1f4;return function(_0xbeed5e){logger[_0x3475('0x2d')](_0xbeed5e[_0x3475('0x2e')]);if(_0xbeed5e[_0x3475('0x2f')]){delete _0xbeed5e[_0x3475('0x2f')];}_0x14bf42[_0x3475('0x21')](_0x4e304d)[_0x3475('0x30')](_0xbeed5e);};}exports[_0x3475('0x31')]=function(_0x283210,_0x3221e7){var _0x931e33={},_0x1739cb={},_0x5d6238={'count':0x0,'rows':[]};var _0x25b03c=_[_0x3475('0x32')](db[_0x3475('0x33')][_0x3475('0x34')],function(_0x1d41c2){return{'name':_0x1d41c2[_0x3475('0x35')],'type':_0x1d41c2[_0x3475('0x36')][_0x3475('0x37')]};});_0x1739cb[_0x3475('0x38')]=_[_0x3475('0x32')](_0x25b03c,_0x3475('0x2f'));_0x1739cb[_0x3475('0x39')]=_[_0x3475('0x3a')](_0x283210[_0x3475('0x39')]);_0x1739cb[_0x3475('0x3b')]=_[_0x3475('0x3c')](_0x1739cb['model'],_0x1739cb['query']);_0x931e33['attributes']=_['intersection'](_0x1739cb['model'],qs[_0x3475('0x3d')](_0x283210[_0x3475('0x39')]['fields']));_0x931e33[_0x3475('0x3e')]=_0x931e33['attributes'][_0x3475('0x3f')]?_0x931e33[_0x3475('0x3e')]:_0x1739cb[_0x3475('0x38')];if(!_0x283210['query']['hasOwnProperty'](_0x3475('0x40'))){_0x931e33[_0x3475('0x26')]=qs[_0x3475('0x26')](_0x283210[_0x3475('0x39')]['limit']);_0x931e33[_0x3475('0x23')]=qs['offset'](_0x283210['query']['offset']);}_0x931e33[_0x3475('0x41')]=qs[_0x3475('0x42')](_0x283210[_0x3475('0x39')]['sort']);_0x931e33[_0x3475('0x43')]=qs['filters'](_[_0x3475('0x44')](_0x283210[_0x3475('0x39')],_0x1739cb[_0x3475('0x3b')]),_0x25b03c);if(_0x283210[_0x3475('0x39')]['filter']){_0x931e33['where']=_['merge'](_0x931e33[_0x3475('0x43')],{'$or':_['map'](_0x25b03c,function(_0x293d47){if(_0x293d47[_0x3475('0x36')]!==_0x3475('0x45')){var _0x116712={};_0x116712[_0x293d47[_0x3475('0x2f')]]={'$like':'%'+_0x283210[_0x3475('0x39')]['filter']+'%'};return _0x116712;}})});}_0x931e33=_['merge']({},_0x931e33,_0x283210['options']);var _0x9198c5={'where':_0x931e33[_0x3475('0x43')]};return db[_0x3475('0x33')][_0x3475('0x25')](_0x9198c5)[_0x3475('0x2b')](function(_0x64ce60){_0x5d6238[_0x3475('0x25')]=_0x64ce60;if(_0x283210['query'][_0x3475('0x46')]){_0x931e33[_0x3475('0x47')]=[{'all':!![]}];}return db[_0x3475('0x33')][_0x3475('0x48')](_0x931e33);})['then'](function(_0x157768){_0x5d6238[_0x3475('0x49')]=_0x157768;return _0x5d6238;})[_0x3475('0x2b')](respondWithFilteredResult(_0x3221e7,_0x931e33))[_0x3475('0x4a')](handleError(_0x3221e7,null));};exports[_0x3475('0x4b')]=function(_0x4607a6,_0x28b9d4){var _0x5e3700={'raw':![],'where':{'id':_0x4607a6[_0x3475('0x4c')]['id']}},_0x251cf8={};_0x251cf8[_0x3475('0x38')]=_[_0x3475('0x3a')](db['VoiceQueueReport'][_0x3475('0x34')]);_0x251cf8[_0x3475('0x39')]=_[_0x3475('0x3a')](_0x4607a6[_0x3475('0x39')]);_0x251cf8[_0x3475('0x3b')]=_[_0x3475('0x3c')](_0x251cf8[_0x3475('0x38')],_0x251cf8[_0x3475('0x39')]);_0x5e3700[_0x3475('0x3e')]=_[_0x3475('0x3c')](_0x251cf8[_0x3475('0x38')],qs['fields'](_0x4607a6[_0x3475('0x39')]['fields']));_0x5e3700[_0x3475('0x3e')]=_0x5e3700[_0x3475('0x3e')]['length']?_0x5e3700[_0x3475('0x3e')]:_0x251cf8['model'];if(_0x4607a6[_0x3475('0x39')][_0x3475('0x46')]){_0x5e3700[_0x3475('0x47')]=[{'all':!![]}];}_0x5e3700=_[_0x3475('0x4d')]({},_0x5e3700,_0x4607a6[_0x3475('0x4e')]);return db['VoiceQueueReport'][_0x3475('0x4f')](_0x5e3700)[_0x3475('0x2b')](handleEntityNotFound(_0x28b9d4,null))[_0x3475('0x2b')](respondWithResult(_0x28b9d4,null))[_0x3475('0x4a')](handleError(_0x28b9d4,null));};exports[_0x3475('0x50')]=function(_0x3dbe3b,_0x1bbddd){return db[_0x3475('0x33')][_0x3475('0x50')](_0x3dbe3b['body'],{})[_0x3475('0x2b')](respondWithResult(_0x1bbddd,0xc9))[_0x3475('0x4a')](handleError(_0x1bbddd,null));};exports[_0x3475('0x2a')]=function(_0x2f5f9f,_0xb722c5){if(_0x2f5f9f[_0x3475('0x51')]['id']){delete _0x2f5f9f[_0x3475('0x51')]['id'];}return db['VoiceQueueReport'][_0x3475('0x4f')]({'where':{'id':_0x2f5f9f['params']['id']}})[_0x3475('0x2b')](handleEntityNotFound(_0xb722c5,null))[_0x3475('0x2b')](saveUpdates(_0x2f5f9f['body'],null))[_0x3475('0x2b')](respondWithResult(_0xb722c5,null))[_0x3475('0x4a')](handleError(_0xb722c5,null));};exports[_0x3475('0x2c')]=function(_0x44f0af,_0x52fd8e){return db[_0x3475('0x33')]['find']({'where':{'id':_0x44f0af[_0x3475('0x4c')]['id']}})[_0x3475('0x2b')](handleEntityNotFound(_0x52fd8e,null))['then'](removeEntity(_0x52fd8e,null))[_0x3475('0x4a')](handleError(_0x52fd8e,null));};exports[_0x3475('0x52')]=function(_0x2acfdd,_0x3af8d3){return db[_0x3475('0x33')]['describe']()[_0x3475('0x2b')](respondWithResult(_0x3af8d3,null))[_0x3475('0x4a')](handleError(_0x3af8d3,null));};exports['getVoiceQueuesReport']=function(_0x3d9e2c,_0x4adfb5){var _0x3842f1={},_0x153d46={},_0x450c1c={'count':0x0,'rows':[]};_0x153d46[_0x3475('0x38')]=_[_0x3475('0x3a')](db['VoiceQueueReport']['rawAttributes']);_0x153d46['query']=_[_0x3475('0x3a')](_0x3d9e2c[_0x3475('0x39')]);_0x153d46['filters']=_[_0x3475('0x3c')](_0x153d46['model'],_0x153d46[_0x3475('0x39')]);_0x3842f1[_0x3475('0x3e')]=_[_0x3475('0x3c')](_0x153d46[_0x3475('0x38')],qs[_0x3475('0x3d')](_0x3d9e2c[_0x3475('0x39')][_0x3475('0x3d')]));_0x3842f1['attributes']=_0x3842f1[_0x3475('0x3e')][_0x3475('0x3f')]?_0x3842f1[_0x3475('0x3e')]:_0x153d46[_0x3475('0x38')];if(!_0x3d9e2c[_0x3475('0x39')][_0x3475('0x53')](_0x3475('0x40'))){_0x3842f1[_0x3475('0x26')]=qs[_0x3475('0x26')](_0x3d9e2c['query'][_0x3475('0x26')]);_0x3842f1[_0x3475('0x23')]=qs[_0x3475('0x23')](_0x3d9e2c[_0x3475('0x39')][_0x3475('0x23')]);}_0x3842f1[_0x3475('0x41')]=qs[_0x3475('0x42')](_0x3d9e2c[_0x3475('0x39')]['sort']);_0x3842f1[_0x3475('0x43')]=qs['filters'](_[_0x3475('0x44')](_0x3d9e2c[_0x3475('0x39')],_0x153d46[_0x3475('0x3b')]));if(_0x3d9e2c['query']['filter']){_0x3842f1[_0x3475('0x43')]=_[_0x3475('0x4d')](_0x3842f1[_0x3475('0x43')],{'$or':_[_0x3475('0x32')](_0x3842f1[_0x3475('0x3e')],function(_0xf5b141){var _0x2402fb={};_0x2402fb[_0xf5b141]={'$like':'%'+_0x3d9e2c['query']['filter']+'%'};return _0x2402fb;})});}_0x3842f1=_[_0x3475('0x4d')]({},_0x3842f1,_0x3d9e2c['options']);var _0x57e51d={'where':_0x3842f1['where']};return db[_0x3475('0x33')][_0x3475('0x25')](_0x57e51d)[_0x3475('0x2b')](function(_0x269bea){_0x450c1c[_0x3475('0x25')]=_0x269bea;if(_0x3d9e2c[_0x3475('0x39')]['includeAll']){_0x3842f1[_0x3475('0x47')]=[{'all':!![]}];}return db['VoiceQueueReport']['findAll'](_0x3842f1);})['then'](function(_0x5938b5){_0x450c1c[_0x3475('0x49')]=_0x5938b5;return _0x450c1c;})['then'](respondWithFilteredResult(_0x4adfb5,_0x3842f1,_0x3475('0x54')))[_0x3475('0x4a')](handleError(_0x4adfb5,null,_0x3475('0x54')));};
\ No newline at end of file
+var _0x62f8=['status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','stack','name','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','VoiceQueueReport','findAll','rows','show','params','fields','includeAll','include','find','create','catch','body','describe','getVoiceQueuesReport','eml-format','rimraf','fast-json-patch','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','sendStatus'];(function(_0x275386,_0x506260){var _0x58e8b4=function(_0x3aab63){while(--_0x3aab63){_0x275386['push'](_0x275386['shift']());}};_0x58e8b4(++_0x506260);}(_0x62f8,0x83));var _0x862f=function(_0x10bdbe,_0x249c38){_0x10bdbe=_0x10bdbe-0x0;var _0x2bdb9d=_0x62f8[_0x10bdbe];return _0x2bdb9d;};'use strict';var emlformat=require(_0x862f('0x0'));var rimraf=require(_0x862f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x862f('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x862f('0x3'));var Mustache=require(_0x862f('0x4'));var util=require(_0x862f('0x5'));var path=require(_0x862f('0x6'));var sox=require(_0x862f('0x7'));var csv=require('to-csv');var ejs=require(_0x862f('0x8'));var fs=require('fs');var fs_extra=require(_0x862f('0x9'));var _=require(_0x862f('0xa'));var squel=require(_0x862f('0xb'));var crypto=require(_0x862f('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x862f('0xd'));var toCsv=require('to-csv');var querystring=require(_0x862f('0xe'));var Papa=require('papaparse');var Redis=require(_0x862f('0xf'));var authService=require(_0x862f('0x10'));var qs=require(_0x862f('0x11'));var as=require(_0x862f('0x12'));var hardwareService=require(_0x862f('0x13'));var logger=require(_0x862f('0x14'))('api');var utils=require(_0x862f('0x15'));var config=require(_0x862f('0x16'));var licenseUtil=require(_0x862f('0x17'));var db=require('../../mysqldb')['db'];config[_0x862f('0x18')]=_[_0x862f('0x19')](config[_0x862f('0x18')],{'host':_0x862f('0x1a'),'port':0x18eb});var socket=require(_0x862f('0x1b'))(new Redis(config[_0x862f('0x18')]));require(_0x862f('0x1c'))[_0x862f('0x1d')](socket);function respondWithStatusCode(_0x4bb784,_0x3356ee){_0x3356ee=_0x3356ee||0xcc;return function(_0x5bbfe9){if(_0x5bbfe9){return _0x4bb784[_0x862f('0x1e')](_0x3356ee);}return _0x4bb784[_0x862f('0x1f')](_0x3356ee)[_0x862f('0x20')]();};}function respondWithResult(_0x447ca8,_0x2f8a00){_0x2f8a00=_0x2f8a00||0xc8;return function(_0x400a8c){if(_0x400a8c){return _0x447ca8[_0x862f('0x1f')](_0x2f8a00)[_0x862f('0x21')](_0x400a8c);}};}function respondWithFilteredResult(_0x17127b,_0x113e49){return function(_0x3cd2a9){if(_0x3cd2a9){var _0x392ff4=typeof _0x113e49[_0x862f('0x22')]===_0x862f('0x23')&&typeof _0x113e49[_0x862f('0x24')]===_0x862f('0x23');var _0x3f321f=_0x3cd2a9[_0x862f('0x25')];var _0x5471cb=_0x392ff4?0x0:_0x113e49['offset'];var _0x377184=_0x392ff4?_0x3cd2a9['count']:_0x113e49[_0x862f('0x22')]+_0x113e49[_0x862f('0x24')];var _0x3cab45;if(_0x377184>=_0x3f321f){_0x377184=_0x3f321f;_0x3cab45=0xc8;}else{_0x3cab45=0xce;}_0x17127b[_0x862f('0x1f')](_0x3cab45);return _0x17127b[_0x862f('0x26')](_0x862f('0x27'),_0x5471cb+'-'+_0x377184+'/'+_0x3f321f)[_0x862f('0x21')](_0x3cd2a9);}return null;};}function patchUpdates(_0x316102){return function(_0xdac28){try{jsonpatch[_0x862f('0x28')](_0xdac28,_0x316102,!![]);}catch(_0xdc7b96){return BPromise[_0x862f('0x29')](_0xdc7b96);}return _0xdac28['save']();};}function saveUpdates(_0x3cf923,_0x4471b1){return function(_0x1331d3){if(_0x1331d3){return _0x1331d3['update'](_0x3cf923)[_0x862f('0x2a')](function(_0x3daac7){return _0x3daac7;});}return null;};}function removeEntity(_0x44944e,_0x5372b8){return function(_0x1eafcb){if(_0x1eafcb){return _0x1eafcb['destroy']()[_0x862f('0x2a')](function(){_0x44944e[_0x862f('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2cd86f,_0x1a782b){return function(_0x12417a){if(!_0x12417a){_0x2cd86f[_0x862f('0x1e')](0x194);}return _0x12417a;};}function handleError(_0x9fbf4f,_0x437982){_0x437982=_0x437982||0x1f4;return function(_0x1782ab){logger['error'](_0x1782ab[_0x862f('0x2b')]);if(_0x1782ab[_0x862f('0x2c')]){delete _0x1782ab[_0x862f('0x2c')];}_0x9fbf4f[_0x862f('0x1f')](_0x437982)['send'](_0x1782ab);};}exports[_0x862f('0x2d')]=function(_0x41d805,_0x3b70c){var _0xc2f02b={},_0xb313b3={},_0x20f074={'count':0x0,'rows':[]};var _0x55eccc=_[_0x862f('0x2e')](db['VoiceQueueReport'][_0x862f('0x2f')],function(_0x316c75){return{'name':_0x316c75[_0x862f('0x30')],'type':_0x316c75[_0x862f('0x31')]['key']};});_0xb313b3[_0x862f('0x32')]=_[_0x862f('0x2e')](_0x55eccc,_0x862f('0x2c'));_0xb313b3[_0x862f('0x33')]=_[_0x862f('0x34')](_0x41d805['query']);_0xb313b3[_0x862f('0x35')]=_[_0x862f('0x36')](_0xb313b3[_0x862f('0x32')],_0xb313b3[_0x862f('0x33')]);_0xc2f02b[_0x862f('0x37')]=_['intersection'](_0xb313b3[_0x862f('0x32')],qs['fields'](_0x41d805[_0x862f('0x33')]['fields']));_0xc2f02b['attributes']=_0xc2f02b[_0x862f('0x37')][_0x862f('0x38')]?_0xc2f02b[_0x862f('0x37')]:_0xb313b3[_0x862f('0x32')];if(!_0x41d805[_0x862f('0x33')][_0x862f('0x39')](_0x862f('0x3a'))){_0xc2f02b[_0x862f('0x24')]=qs[_0x862f('0x24')](_0x41d805[_0x862f('0x33')][_0x862f('0x24')]);_0xc2f02b[_0x862f('0x22')]=qs[_0x862f('0x22')](_0x41d805[_0x862f('0x33')][_0x862f('0x22')]);}_0xc2f02b[_0x862f('0x3b')]=qs[_0x862f('0x3c')](_0x41d805[_0x862f('0x33')][_0x862f('0x3c')]);_0xc2f02b[_0x862f('0x3d')]=qs['filters'](_[_0x862f('0x3e')](_0x41d805['query'],_0xb313b3[_0x862f('0x35')]),_0x55eccc);if(_0x41d805['query'][_0x862f('0x3f')]){_0xc2f02b[_0x862f('0x3d')]=_[_0x862f('0x40')](_0xc2f02b[_0x862f('0x3d')],{'$or':_[_0x862f('0x2e')](_0x55eccc,function(_0x2cd922){if(_0x2cd922[_0x862f('0x31')]!==_0x862f('0x41')){var _0x24827f={};_0x24827f[_0x2cd922['name']]={'$like':'%'+_0x41d805[_0x862f('0x33')][_0x862f('0x3f')]+'%'};return _0x24827f;}})});}_0xc2f02b=_['merge']({},_0xc2f02b,_0x41d805[_0x862f('0x42')]);var _0x2ef6d3={'where':_0xc2f02b['where']};return db[_0x862f('0x43')][_0x862f('0x25')](_0x2ef6d3)[_0x862f('0x2a')](function(_0x5a77bf){_0x20f074[_0x862f('0x25')]=_0x5a77bf;if(_0x41d805[_0x862f('0x33')]['includeAll']){_0xc2f02b['include']=[{'all':!![]}];}return db[_0x862f('0x43')][_0x862f('0x44')](_0xc2f02b);})[_0x862f('0x2a')](function(_0x1570b1){_0x20f074[_0x862f('0x45')]=_0x1570b1;return _0x20f074;})[_0x862f('0x2a')](respondWithFilteredResult(_0x3b70c,_0xc2f02b))['catch'](handleError(_0x3b70c,null));};exports[_0x862f('0x46')]=function(_0x459581,_0x331a0a){var _0x266df6={'raw':![],'where':{'id':_0x459581[_0x862f('0x47')]['id']}},_0xe44d1d={};_0xe44d1d['model']=_[_0x862f('0x34')](db[_0x862f('0x43')][_0x862f('0x2f')]);_0xe44d1d[_0x862f('0x33')]=_[_0x862f('0x34')](_0x459581['query']);_0xe44d1d['filters']=_[_0x862f('0x36')](_0xe44d1d[_0x862f('0x32')],_0xe44d1d[_0x862f('0x33')]);_0x266df6['attributes']=_['intersection'](_0xe44d1d[_0x862f('0x32')],qs[_0x862f('0x48')](_0x459581['query']['fields']));_0x266df6[_0x862f('0x37')]=_0x266df6[_0x862f('0x37')][_0x862f('0x38')]?_0x266df6[_0x862f('0x37')]:_0xe44d1d[_0x862f('0x32')];if(_0x459581['query'][_0x862f('0x49')]){_0x266df6[_0x862f('0x4a')]=[{'all':!![]}];}_0x266df6=_[_0x862f('0x40')]({},_0x266df6,_0x459581[_0x862f('0x42')]);return db[_0x862f('0x43')][_0x862f('0x4b')](_0x266df6)['then'](handleEntityNotFound(_0x331a0a,null))[_0x862f('0x2a')](respondWithResult(_0x331a0a,null))['catch'](handleError(_0x331a0a,null));};exports[_0x862f('0x4c')]=function(_0x244eda,_0x4c1173){return db[_0x862f('0x43')][_0x862f('0x4c')](_0x244eda['body'],{})[_0x862f('0x2a')](respondWithResult(_0x4c1173,0xc9))[_0x862f('0x4d')](handleError(_0x4c1173,null));};exports['update']=function(_0x77d924,_0x1f36c8){if(_0x77d924[_0x862f('0x4e')]['id']){delete _0x77d924['body']['id'];}return db[_0x862f('0x43')][_0x862f('0x4b')]({'where':{'id':_0x77d924[_0x862f('0x47')]['id']}})[_0x862f('0x2a')](handleEntityNotFound(_0x1f36c8,null))[_0x862f('0x2a')](saveUpdates(_0x77d924['body'],null))[_0x862f('0x2a')](respondWithResult(_0x1f36c8,null))[_0x862f('0x4d')](handleError(_0x1f36c8,null));};exports['destroy']=function(_0x4f63a2,_0x4a95d1){return db[_0x862f('0x43')][_0x862f('0x4b')]({'where':{'id':_0x4f63a2[_0x862f('0x47')]['id']}})[_0x862f('0x2a')](handleEntityNotFound(_0x4a95d1,null))[_0x862f('0x2a')](removeEntity(_0x4a95d1,null))[_0x862f('0x4d')](handleError(_0x4a95d1,null));};exports[_0x862f('0x4f')]=function(_0x24c93b,_0x5db55b){return db[_0x862f('0x43')][_0x862f('0x4f')]()[_0x862f('0x2a')](respondWithResult(_0x5db55b,null))[_0x862f('0x4d')](handleError(_0x5db55b,null));};exports['getVoiceQueuesReport']=function(_0x43d999,_0x279ee3){var _0x2c52b7={},_0x3dd2c9={},_0x19b64b={'count':0x0,'rows':[]};_0x3dd2c9['model']=_[_0x862f('0x34')](db[_0x862f('0x43')][_0x862f('0x2f')]);_0x3dd2c9[_0x862f('0x33')]=_[_0x862f('0x34')](_0x43d999['query']);_0x3dd2c9[_0x862f('0x35')]=_['intersection'](_0x3dd2c9[_0x862f('0x32')],_0x3dd2c9[_0x862f('0x33')]);_0x2c52b7[_0x862f('0x37')]=_[_0x862f('0x36')](_0x3dd2c9[_0x862f('0x32')],qs[_0x862f('0x48')](_0x43d999[_0x862f('0x33')][_0x862f('0x48')]));_0x2c52b7[_0x862f('0x37')]=_0x2c52b7[_0x862f('0x37')]['length']?_0x2c52b7[_0x862f('0x37')]:_0x3dd2c9[_0x862f('0x32')];if(!_0x43d999[_0x862f('0x33')][_0x862f('0x39')](_0x862f('0x3a'))){_0x2c52b7[_0x862f('0x24')]=qs[_0x862f('0x24')](_0x43d999[_0x862f('0x33')][_0x862f('0x24')]);_0x2c52b7[_0x862f('0x22')]=qs[_0x862f('0x22')](_0x43d999[_0x862f('0x33')]['offset']);}_0x2c52b7[_0x862f('0x3b')]=qs[_0x862f('0x3c')](_0x43d999['query'][_0x862f('0x3c')]);_0x2c52b7[_0x862f('0x3d')]=qs[_0x862f('0x35')](_[_0x862f('0x3e')](_0x43d999[_0x862f('0x33')],_0x3dd2c9['filters']));if(_0x43d999[_0x862f('0x33')][_0x862f('0x3f')]){_0x2c52b7[_0x862f('0x3d')]=_[_0x862f('0x40')](_0x2c52b7[_0x862f('0x3d')],{'$or':_[_0x862f('0x2e')](_0x2c52b7['attributes'],function(_0x3d2372){var _0x101ead={};_0x101ead[_0x3d2372]={'$like':'%'+_0x43d999['query'][_0x862f('0x3f')]+'%'};return _0x101ead;})});}_0x2c52b7=_[_0x862f('0x40')]({},_0x2c52b7,_0x43d999[_0x862f('0x42')]);var _0x24b494={'where':_0x2c52b7[_0x862f('0x3d')]};return db[_0x862f('0x43')][_0x862f('0x25')](_0x24b494)[_0x862f('0x2a')](function(_0x3331e7){_0x19b64b[_0x862f('0x25')]=_0x3331e7;if(_0x43d999['query'][_0x862f('0x49')]){_0x2c52b7['include']=[{'all':!![]}];}return db['VoiceQueueReport'][_0x862f('0x44')](_0x2c52b7);})[_0x862f('0x2a')](function(_0x26d39d){_0x19b64b[_0x862f('0x45')]=_0x26d39d;return _0x19b64b;})[_0x862f('0x2a')](respondWithFilteredResult(_0x279ee3,_0x2c52b7,_0x862f('0x50')))[_0x862f('0x4d')](handleError(_0x279ee3,null,_0x862f('0x50')));};
\ No newline at end of file
index 0071c17..ee691f3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0406=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x5c3d50,_0x58f122){var _0x154bfd=function(_0x210dc2){while(--_0x210dc2){_0x5c3d50['push'](_0x5c3d50['shift']());}};_0x154bfd(++_0x58f122);}(_0x0406,0xda));var _0x6040=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x0406[_0x20a584];return _0x4b41a8;};'use strict';var EventEmitter=require(_0x6040('0x0'));var VoiceQueueReport=require(_0x6040('0x1'))['db']['VoiceQueueReport'];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x6040('0x2')](0x0);var events={'afterCreate':_0x6040('0x3'),'afterUpdate':_0x6040('0x4'),'afterDestroy':_0x6040('0x5')};function emitEvent(_0x194783){return function(_0x26f409,_0x176156,_0x2ebfba){VoiceQueueReportEvents[_0x6040('0x6')](_0x194783+':'+_0x26f409['id'],_0x26f409);VoiceQueueReportEvents[_0x6040('0x6')](_0x194783,_0x26f409);_0x2ebfba(null);};}for(var e in events){if(events[_0x6040('0x7')](e)){var event=events[e];VoiceQueueReport[_0x6040('0x8')](e,emitEvent(event));}}module[_0x6040('0x9')]=VoiceQueueReportEvents;
\ No newline at end of file
+var _0x68a2=['events','../../mysqldb','VoiceQueueReport','save','update','remove','emit','hook'];(function(_0x450275,_0x7abe4c){var _0x2076d4=function(_0xee579c){while(--_0xee579c){_0x450275['push'](_0x450275['shift']());}};_0x2076d4(++_0x7abe4c);}(_0x68a2,0x1a8));var _0x268a=function(_0x4723eb,_0x7f6b1e){_0x4723eb=_0x4723eb-0x0;var _0x37e188=_0x68a2[_0x4723eb];return _0x37e188;};'use strict';var EventEmitter=require(_0x268a('0x0'));var VoiceQueueReport=require(_0x268a('0x1'))['db'][_0x268a('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x268a('0x3'),'afterUpdate':_0x268a('0x4'),'afterDestroy':_0x268a('0x5')};function emitEvent(_0x1e967f){return function(_0x4cba00,_0xd72f64,_0x26137f){VoiceQueueReportEvents[_0x268a('0x6')](_0x1e967f+':'+_0x4cba00['id'],_0x4cba00);VoiceQueueReportEvents[_0x268a('0x6')](_0x1e967f,_0x4cba00);_0x26137f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueueReport[_0x268a('0x7')](e,emitEvent(event));}}module['exports']=VoiceQueueReportEvents;
\ No newline at end of file
index 87ab207..60fc014 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa744=['request-promise','../../config/environment','./voiceQueueReport.attributes','VoiceQueueReport','report_queue','uniqueid','util','api','moment','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa744,0x1a0));var _0x4a74=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xa744[_0xa464c9];return _0x3d73c4;};'use strict';var _=require('lodash');var util=require(_0x4a74('0x0'));var logger=require('../../config/logger')(_0x4a74('0x1'));var moment=require(_0x4a74('0x2'));var BPromise=require(_0x4a74('0x3'));var rp=require(_0x4a74('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x4a74('0x5'));var attributes=require(_0x4a74('0x6'));module['exports']=function(_0x38ab56,_0x47154d){return _0x38ab56['define'](_0x4a74('0x7'),attributes,{'tableName':_0x4a74('0x8'),'paranoid':![],'indexes':[{'fields':[_0x4a74('0x9')]},{'fields':['calleridnum']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x4e39=['report_queue','uniqueid','calleridnum','util','../../config/logger','api','moment','bluebird','define','VoiceQueueReport'];(function(_0x37cf3f,_0x233853){var _0x4f47e1=function(_0x103d63){while(--_0x103d63){_0x37cf3f['push'](_0x37cf3f['shift']());}};_0x4f47e1(++_0x233853);}(_0x4e39,0xfd));var _0x94e3=function(_0x56aa66,_0x1ddf52){_0x56aa66=_0x56aa66-0x0;var _0xeba9ff=_0x4e39[_0x56aa66];return _0xeba9ff;};'use strict';var _=require('lodash');var util=require(_0x94e3('0x0'));var logger=require(_0x94e3('0x1'))(_0x94e3('0x2'));var moment=require(_0x94e3('0x3'));var BPromise=require(_0x94e3('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./voiceQueueReport.attributes');module['exports']=function(_0x54b130,_0x2a283f){return _0x54b130[_0x94e3('0x5')](_0x94e3('0x6'),attributes,{'tableName':_0x94e3('0x7'),'paranoid':![],'indexes':[{'fields':[_0x94e3('0x8')]},{'fields':[_0x94e3('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
index 8b6584c..cc84b9b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4145=['options','raw','where','limit','include','map','attributes','model','debug','CreateVoiceQueueReport','create','body','update','UpdateVoiceQueueReport','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./voiceQueueReport.socket','request','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVoiceQueueReport','VoiceQueueReport','findAll'];(function(_0x25c582,_0xfb304c){var _0x178ce1=function(_0x3e59d8){while(--_0x3e59d8){_0x25c582['push'](_0x25c582['shift']());}};_0x178ce1(++_0xfb304c);}(_0x4145,0x176));var _0x5414=function(_0x3ab116,_0x6e09af){_0x3ab116=_0x3ab116-0x0;var _0x313871=_0x4145[_0x3ab116];return _0x313871;};'use strict';var _=require(_0x5414('0x0'));var util=require(_0x5414('0x1'));var moment=require(_0x5414('0x2'));var BPromise=require(_0x5414('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5414('0x4'));var db=require(_0x5414('0x5'))['db'];var utils=require(_0x5414('0x6'));var logger=require('../../config/logger')(_0x5414('0x7'));var config=require(_0x5414('0x8'));var jayson=require(_0x5414('0x9'));var client=jayson[_0x5414('0xa')][_0x5414('0xb')]({'port':0x232a});config[_0x5414('0xc')]=_[_0x5414('0xd')](config[_0x5414('0xc')],{'host':_0x5414('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5414('0xc')]));require(_0x5414('0xf'))['register'](socket);function respondWithRpcPromise(_0x49fcc4,_0x56c0cd,_0x18e22a){return new BPromise(function(_0x57c580,_0xc0e972){return client[_0x5414('0x10')](_0x49fcc4,_0x18e22a)[_0x5414('0x11')](function(_0x505ef0){logger[_0x5414('0x12')](_0x5414('0x13'),_0x56c0cd,_0x5414('0x14'));logger['debug'](_0x5414('0x15'),_0x56c0cd,'request\x20sent',JSON[_0x5414('0x16')](_0x505ef0));if(_0x505ef0[_0x5414('0x17')]){if(_0x505ef0[_0x5414('0x17')][_0x5414('0x18')]===0x1f4){logger['error']('VoiceQueueReport,\x20%s,\x20%s',_0x56c0cd,_0x505ef0['error'][_0x5414('0x19')]);return _0xc0e972(_0x505ef0['error'][_0x5414('0x19')]);}logger[_0x5414('0x17')](_0x5414('0x13'),_0x56c0cd,_0x505ef0[_0x5414('0x17')][_0x5414('0x19')]);return _0x57c580(_0x505ef0[_0x5414('0x17')][_0x5414('0x19')]);}else{logger['info'](_0x5414('0x13'),_0x56c0cd,_0x5414('0x14'));_0x57c580(_0x505ef0[_0x5414('0x1a')][_0x5414('0x19')]);}})[_0x5414('0x1b')](function(_0x2a34b7){logger[_0x5414('0x17')]('VoiceQueueReport,\x20%s,\x20%s',_0x56c0cd,_0x2a34b7);_0xc0e972(_0x2a34b7);});});}exports[_0x5414('0x1c')]=function(_0x31e875){var _0x566549=this;return new Promise(function(_0x39ea4e,_0x4ed121){return db[_0x5414('0x1d')][_0x5414('0x1e')]({'raw':_0x31e875[_0x5414('0x1f')]?_0x31e875[_0x5414('0x1f')][_0x5414('0x20')]===undefined?!![]:![]:!![],'where':_0x31e875['options']?_0x31e875[_0x5414('0x1f')][_0x5414('0x21')]||null:null,'attributes':_0x31e875['options']?_0x31e875[_0x5414('0x1f')]['attributes']||null:null,'limit':_0x31e875[_0x5414('0x1f')]?_0x31e875[_0x5414('0x1f')][_0x5414('0x22')]||null:null,'include':_0x31e875[_0x5414('0x1f')]?_0x31e875[_0x5414('0x1f')][_0x5414('0x23')]?_[_0x5414('0x24')](_0x31e875[_0x5414('0x1f')][_0x5414('0x23')],function(_0x53ab82){return{'model':db[_0x53ab82['model']],'as':_0x53ab82['as'],'attributes':_0x53ab82[_0x5414('0x25')],'include':_0x53ab82['include']?_[_0x5414('0x24')](_0x53ab82[_0x5414('0x23')],function(_0x3806cb){return{'model':db[_0x3806cb[_0x5414('0x26')]],'as':_0x3806cb['as'],'attributes':_0x3806cb[_0x5414('0x25')],'include':_0x3806cb[_0x5414('0x23')]?_[_0x5414('0x24')](_0x3806cb['include'],function(_0x5b4be4){return{'model':db[_0x5b4be4[_0x5414('0x26')]],'as':_0x5b4be4['as'],'attributes':_0x5b4be4[_0x5414('0x25')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4d11ce){logger[_0x5414('0x12')](_0x5414('0x1c'),_0x31e875);logger[_0x5414('0x27')](_0x5414('0x1c'),_0x31e875,JSON['stringify'](_0x4d11ce));_0x39ea4e(_0x4d11ce);})['catch'](function(_0x265668){logger[_0x5414('0x17')](_0x5414('0x1c'),_0x265668[_0x5414('0x19')],_0x31e875);_0x4ed121(_0x566549[_0x5414('0x17')](0x1f4,_0x265668[_0x5414('0x19')]));});});};exports[_0x5414('0x28')]=function(_0x347655){var _0x4de188=this;return new Promise(function(_0x5ae2cb,_0x42270b){return db[_0x5414('0x1d')][_0x5414('0x29')](_0x347655[_0x5414('0x2a')],{'raw':_0x347655['options']?_0x347655[_0x5414('0x1f')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x1ba6af){logger[_0x5414('0x12')]('CreateVoiceQueueReport',_0x347655);logger[_0x5414('0x27')](_0x5414('0x28'),_0x347655,JSON['stringify'](_0x1ba6af));_0x5ae2cb(_0x1ba6af);})[_0x5414('0x1b')](function(_0x4da01f){logger['error'](_0x5414('0x28'),_0x4da01f['message'],_0x347655);_0x42270b(_0x4de188['error'](0x1f4,_0x4da01f[_0x5414('0x19')]));});});};exports['UpdateVoiceQueueReport']=function(_0xac30cc){var _0x43365f=this;return new Promise(function(_0x53d3e4,_0x310c82){return db['VoiceQueueReport'][_0x5414('0x2b')](_0xac30cc[_0x5414('0x2a')],{'raw':_0xac30cc['options']?_0xac30cc[_0x5414('0x1f')][_0x5414('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xac30cc[_0x5414('0x1f')]?_0xac30cc[_0x5414('0x1f')][_0x5414('0x21')]||null:null,'attributes':_0xac30cc[_0x5414('0x1f')]?_0xac30cc['options'][_0x5414('0x25')]||null:null,'limit':_0xac30cc[_0x5414('0x1f')]?_0xac30cc[_0x5414('0x1f')][_0x5414('0x22')]||null:null})[_0x5414('0x11')](function(_0x2a1891){logger[_0x5414('0x12')](_0x5414('0x2c'),_0xac30cc);logger[_0x5414('0x27')](_0x5414('0x2c'),_0xac30cc,JSON[_0x5414('0x16')](_0x2a1891));_0x53d3e4(_0x2a1891);})[_0x5414('0x1b')](function(_0x1819d5){logger[_0x5414('0x17')](_0x5414('0x2c'),_0x1819d5[_0x5414('0x19')],_0xac30cc);_0x310c82(_0x43365f[_0x5414('0x17')](0x1f4,_0x1819d5[_0x5414('0x19')]));});});};
\ No newline at end of file
+var _0xc683=['localhost','socket.io-emitter','./voiceQueueReport.socket','register','then','request\x20sent','debug','stringify','error','code','VoiceQueueReport,\x20%s,\x20%s','message','info','result','catch','GetVoiceQueueReport','VoiceQueueReport','findAll','options','raw','where','attributes','limit','map','include','model','CreateVoiceQueueReport','create','body','UpdateVoiceQueueReport','update','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','client','http','redis','defaults'];(function(_0x3ef2d5,_0x423d46){var _0x2fefb2=function(_0x54f82f){while(--_0x54f82f){_0x3ef2d5['push'](_0x3ef2d5['shift']());}};_0x2fefb2(++_0x423d46);}(_0xc683,0x14c));var _0x3c68=function(_0x263a74,_0xc31414){_0x263a74=_0x263a74-0x0;var _0x2aa86c=_0xc683[_0x263a74];return _0x2aa86c;};'use strict';var _=require('lodash');var util=require(_0x3c68('0x0'));var moment=require(_0x3c68('0x1'));var BPromise=require(_0x3c68('0x2'));var rs=require(_0x3c68('0x3'));var fs=require('fs');var Redis=require(_0x3c68('0x4'));var db=require(_0x3c68('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3c68('0x6'));var config=require('../../config/environment');var jayson=require(_0x3c68('0x7'));var client=jayson[_0x3c68('0x8')][_0x3c68('0x9')]({'port':0x232a});config[_0x3c68('0xa')]=_[_0x3c68('0xb')](config[_0x3c68('0xa')],{'host':_0x3c68('0xc'),'port':0x18eb});var socket=require(_0x3c68('0xd'))(new Redis(config[_0x3c68('0xa')]));require(_0x3c68('0xe'))[_0x3c68('0xf')](socket);function respondWithRpcPromise(_0x3a84dc,_0x55acdf,_0x531d35){return new BPromise(function(_0x3b84ad,_0x22894a){return client['request'](_0x3a84dc,_0x531d35)[_0x3c68('0x10')](function(_0x45c19c){logger['info']('VoiceQueueReport,\x20%s,\x20%s',_0x55acdf,_0x3c68('0x11'));logger[_0x3c68('0x12')]('VoiceQueueReport,\x20%s,\x20%s,\x20%s',_0x55acdf,'request\x20sent',JSON[_0x3c68('0x13')](_0x45c19c));if(_0x45c19c['error']){if(_0x45c19c[_0x3c68('0x14')][_0x3c68('0x15')]===0x1f4){logger['error'](_0x3c68('0x16'),_0x55acdf,_0x45c19c['error'][_0x3c68('0x17')]);return _0x22894a(_0x45c19c['error'][_0x3c68('0x17')]);}logger['error'](_0x3c68('0x16'),_0x55acdf,_0x45c19c[_0x3c68('0x14')][_0x3c68('0x17')]);return _0x3b84ad(_0x45c19c['error']['message']);}else{logger[_0x3c68('0x18')]('VoiceQueueReport,\x20%s,\x20%s',_0x55acdf,_0x3c68('0x11'));_0x3b84ad(_0x45c19c[_0x3c68('0x19')][_0x3c68('0x17')]);}})[_0x3c68('0x1a')](function(_0x450d50){logger['error'](_0x3c68('0x16'),_0x55acdf,_0x450d50);_0x22894a(_0x450d50);});});}exports[_0x3c68('0x1b')]=function(_0x4ed0c2){var _0x2aeeec=this;return new Promise(function(_0x5aa269,_0x2f70fa){return db[_0x3c68('0x1c')][_0x3c68('0x1d')]({'raw':_0x4ed0c2[_0x3c68('0x1e')]?_0x4ed0c2[_0x3c68('0x1e')][_0x3c68('0x1f')]===undefined?!![]:![]:!![],'where':_0x4ed0c2[_0x3c68('0x1e')]?_0x4ed0c2[_0x3c68('0x1e')][_0x3c68('0x20')]||null:null,'attributes':_0x4ed0c2['options']?_0x4ed0c2['options'][_0x3c68('0x21')]||null:null,'limit':_0x4ed0c2[_0x3c68('0x1e')]?_0x4ed0c2['options'][_0x3c68('0x22')]||null:null,'include':_0x4ed0c2['options']?_0x4ed0c2['options']['include']?_[_0x3c68('0x23')](_0x4ed0c2[_0x3c68('0x1e')][_0x3c68('0x24')],function(_0x1b7cbc){return{'model':db[_0x1b7cbc['model']],'as':_0x1b7cbc['as'],'attributes':_0x1b7cbc[_0x3c68('0x21')],'include':_0x1b7cbc['include']?_[_0x3c68('0x23')](_0x1b7cbc[_0x3c68('0x24')],function(_0x53277a){return{'model':db[_0x53277a['model']],'as':_0x53277a['as'],'attributes':_0x53277a[_0x3c68('0x21')],'include':_0x53277a[_0x3c68('0x24')]?_[_0x3c68('0x23')](_0x53277a['include'],function(_0x453f8e){return{'model':db[_0x453f8e[_0x3c68('0x25')]],'as':_0x453f8e['as'],'attributes':_0x453f8e[_0x3c68('0x21')]};}):[]};}):[]};}):[]:[]})[_0x3c68('0x10')](function(_0x4eb0fa){logger['info'](_0x3c68('0x1b'),_0x4ed0c2);logger[_0x3c68('0x12')](_0x3c68('0x1b'),_0x4ed0c2,JSON[_0x3c68('0x13')](_0x4eb0fa));_0x5aa269(_0x4eb0fa);})['catch'](function(_0x3964d){logger[_0x3c68('0x14')](_0x3c68('0x1b'),_0x3964d[_0x3c68('0x17')],_0x4ed0c2);_0x2f70fa(_0x2aeeec[_0x3c68('0x14')](0x1f4,_0x3964d['message']));});});};exports[_0x3c68('0x26')]=function(_0x33656e){var _0x3c1e1c=this;return new Promise(function(_0x1850dd,_0x3c69b9){return db[_0x3c68('0x1c')][_0x3c68('0x27')](_0x33656e[_0x3c68('0x28')],{'raw':_0x33656e['options']?_0x33656e[_0x3c68('0x1e')][_0x3c68('0x1f')]===undefined?!![]:![]:!![]})[_0x3c68('0x10')](function(_0x180da1){logger[_0x3c68('0x18')](_0x3c68('0x26'),_0x33656e);logger[_0x3c68('0x12')]('CreateVoiceQueueReport',_0x33656e,JSON[_0x3c68('0x13')](_0x180da1));_0x1850dd(_0x180da1);})[_0x3c68('0x1a')](function(_0xb5ed1c){logger['error']('CreateVoiceQueueReport',_0xb5ed1c[_0x3c68('0x17')],_0x33656e);_0x3c69b9(_0x3c1e1c['error'](0x1f4,_0xb5ed1c['message']));});});};exports[_0x3c68('0x29')]=function(_0x5ae8bd){var _0x3673d3=this;return new Promise(function(_0x559672,_0x300e14){return db[_0x3c68('0x1c')][_0x3c68('0x2a')](_0x5ae8bd[_0x3c68('0x28')],{'raw':_0x5ae8bd[_0x3c68('0x1e')]?_0x5ae8bd[_0x3c68('0x1e')][_0x3c68('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5ae8bd[_0x3c68('0x1e')]?_0x5ae8bd[_0x3c68('0x1e')][_0x3c68('0x20')]||null:null,'attributes':_0x5ae8bd[_0x3c68('0x1e')]?_0x5ae8bd[_0x3c68('0x1e')]['attributes']||null:null,'limit':_0x5ae8bd[_0x3c68('0x1e')]?_0x5ae8bd['options'][_0x3c68('0x22')]||null:null})[_0x3c68('0x10')](function(_0x7debb8){logger[_0x3c68('0x18')](_0x3c68('0x29'),_0x5ae8bd);logger['debug'](_0x3c68('0x29'),_0x5ae8bd,JSON[_0x3c68('0x13')](_0x7debb8));_0x559672(_0x7debb8);})[_0x3c68('0x1a')](function(_0x4e5b4b){logger[_0x3c68('0x14')]('UpdateVoiceQueueReport',_0x4e5b4b[_0x3c68('0x17')],_0x5ae8bd);_0x300e14(_0x3673d3[_0x3c68('0x14')](0x1f4,_0x4e5b4b[_0x3c68('0x17')]));});});};
\ No newline at end of file
index 11ccc2b..46b399e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x80ce=['length','voiceQueueReport:','update','emit'];(function(_0x1b1f88,_0x3fe1cb){var _0x5045b9=function(_0x5c1367){while(--_0x5c1367){_0x1b1f88['push'](_0x1b1f88['shift']());}};_0x5045b9(++_0x3fe1cb);}(_0x80ce,0xae));var _0xe80c=function(_0xb93df6,_0x217324){_0xb93df6=_0xb93df6-0x0;var _0x325384=_0x80ce[_0xb93df6];return _0x325384;};'use strict';var VoiceQueueReportEvents=require('./voiceQueueReport.events');var events=['save','remove',_0xe80c('0x0')];function createListener(_0x150228,_0x52217f){return function(_0x23bc31){_0x52217f[_0xe80c('0x1')](_0x150228,_0x23bc31);};}function removeListener(_0x4372b2,_0x57043c){return function(){VoiceQueueReportEvents['removeListener'](_0x4372b2,_0x57043c);};}exports['register']=function(_0x48d62c){for(var _0x19b480=0x0,_0x320a7e=events[_0xe80c('0x2')];_0x19b480<_0x320a7e;_0x19b480++){var _0x591a4a=events[_0x19b480];var _0x4da07c=createListener(_0xe80c('0x3')+_0x591a4a,_0x48d62c);VoiceQueueReportEvents['on'](_0x591a4a,_0x4da07c);}};
\ No newline at end of file
+var _0x2f91=['remove','emit','removeListener','register','length','./voiceQueueReport.events','save'];(function(_0x5366ea,_0x11dcea){var _0x5e248a=function(_0x1be5d2){while(--_0x1be5d2){_0x5366ea['push'](_0x5366ea['shift']());}};_0x5e248a(++_0x11dcea);}(_0x2f91,0x98));var _0x12f9=function(_0x1c0690,_0x83febb){_0x1c0690=_0x1c0690-0x0;var _0x3421e3=_0x2f91[_0x1c0690];return _0x3421e3;};'use strict';var VoiceQueueReportEvents=require(_0x12f9('0x0'));var events=[_0x12f9('0x1'),_0x12f9('0x2'),'update'];function createListener(_0x3280e9,_0xf4931b){return function(_0x28cdd9){_0xf4931b[_0x12f9('0x3')](_0x3280e9,_0x28cdd9);};}function removeListener(_0x5198f0,_0x473285){return function(){VoiceQueueReportEvents[_0x12f9('0x4')](_0x5198f0,_0x473285);};}exports[_0x12f9('0x5')]=function(_0xf06fa3){for(var _0x57a5ff=0x0,_0x7811e=events[_0x12f9('0x6')];_0x57a5ff<_0x7811e;_0x57a5ff++){var _0x4ea10c=events[_0x57a5ff];var _0x5b892a=createListener('voiceQueueReport:'+_0x4ea10c,_0xf06fa3);VoiceQueueReportEvents['on'](_0x4ea10c,_0x5b892a);}};
\ No newline at end of file
index 48328ec..3cf9196 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1f10=['express','../../components/auth/service','../../config/environment','./voiceQueuesLog.controller','get','index','/:id','isAuthenticated','show','post','create','update','delete','destroy','exports','multer','util','connect-timeout'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1f10,0x69));var _0x01f1=function(_0xafd2e6,_0x3f08e0){_0xafd2e6=_0xafd2e6-0x0;var _0xc25128=_0x1f10[_0xafd2e6];return _0xc25128;};'use strict';var multer=require(_0x01f1('0x0'));var util=require(_0x01f1('0x1'));var path=require('path');var timeout=require(_0x01f1('0x2'));var express=require(_0x01f1('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x01f1('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x01f1('0x5'));var controller=require(_0x01f1('0x6'));router[_0x01f1('0x7')]('/',auth['isAuthenticated'](),controller[_0x01f1('0x8')]);router[_0x01f1('0x7')](_0x01f1('0x9'),auth[_0x01f1('0xa')](),controller[_0x01f1('0xb')]);router[_0x01f1('0xc')]('/',auth[_0x01f1('0xa')](),controller[_0x01f1('0xd')]);router['put'](_0x01f1('0x9'),auth[_0x01f1('0xa')](),controller[_0x01f1('0xe')]);router[_0x01f1('0xf')](_0x01f1('0x9'),auth['isAuthenticated'](),controller[_0x01f1('0x10')]);module[_0x01f1('0x11')]=router;
\ No newline at end of file
+var _0xa809=['create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','get','isAuthenticated','index','/:id','show','post'];(function(_0xcd5a3d,_0x3c5b33){var _0xd43207=function(_0x17d976){while(--_0x17d976){_0xcd5a3d['push'](_0xcd5a3d['shift']());}};_0xd43207(++_0x3c5b33);}(_0xa809,0x1a8));var _0x9a80=function(_0x371402,_0x58d782){_0x371402=_0x371402-0x0;var _0x2bda3b=_0xa809[_0x371402];return _0x2bda3b;};'use strict';var multer=require(_0x9a80('0x0'));var util=require(_0x9a80('0x1'));var path=require(_0x9a80('0x2'));var timeout=require(_0x9a80('0x3'));var express=require(_0x9a80('0x4'));var router=express[_0x9a80('0x5')]();var fs_extra=require(_0x9a80('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x9a80('0x7'));var config=require(_0x9a80('0x8'));var controller=require(_0x9a80('0x9'));router[_0x9a80('0xa')]('/',auth[_0x9a80('0xb')](),controller[_0x9a80('0xc')]);router[_0x9a80('0xa')](_0x9a80('0xd'),auth[_0x9a80('0xb')](),controller[_0x9a80('0xe')]);router[_0x9a80('0xf')]('/',auth[_0x9a80('0xb')](),controller[_0x9a80('0x10')]);router[_0x9a80('0x11')](_0x9a80('0xd'),auth[_0x9a80('0xb')](),controller[_0x9a80('0x12')]);router[_0x9a80('0x13')](_0x9a80('0xd'),auth[_0x9a80('0xb')](),controller[_0x9a80('0x14')]);module[_0x9a80('0x15')]=router;
\ No newline at end of file
index 73d332d..989141a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcaaf=['sequelize','exports','STRING','DATE','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x4f9350,_0x1eb2e1){var _0x4af838=function(_0x3a121c){while(--_0x3a121c){_0x4f9350['push'](_0x4f9350['shift']());}};_0x4af838(++_0x1eb2e1);}(_0xcaaf,0x66));var _0xfcaa=function(_0x3a14ee,_0x4fdf68){_0x3a14ee=_0x3a14ee-0x0;var _0x17e6f9=_0xcaaf[_0x3a14ee];return _0x17e6f9;};'use strict';var Sequelize=require(_0xfcaa('0x0'));var moment=require('moment');module[_0xfcaa('0x1')]={'time':{'type':Sequelize['STRING']},'callid':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0xfcaa('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0xfcaa('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0xfcaa('0x2')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0xfcaa('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0xfcaa('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0xfcaa('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0xfcaa('0x3')],'allowNull':![],'defaultValue':moment()[_0xfcaa('0x4')](_0xfcaa('0x5'))}};
\ No newline at end of file
+var _0x0142=['exports','STRING','DATE','YYYY-MM-DD\x20HH:mm:ss','sequelize'];(function(_0x1455aa,_0x1f2cf9){var _0x37d526=function(_0x146ce1){while(--_0x146ce1){_0x1455aa['push'](_0x1455aa['shift']());}};_0x37d526(++_0x1f2cf9);}(_0x0142,0x130));var _0x2014=function(_0x519cc4,_0x59d532){_0x519cc4=_0x519cc4-0x0;var _0x34f572=_0x0142[_0x519cc4];return _0x34f572;};'use strict';var Sequelize=require(_0x2014('0x0'));var moment=require('moment');module[_0x2014('0x1')]={'time':{'type':Sequelize['STRING']},'callid':{'type':Sequelize[_0x2014('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x2014('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x2014('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x2014('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x2014('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x2014('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x2014('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x2014('0x3')],'allowNull':![],'defaultValue':moment()['format'](_0x2014('0x4'))}};
\ No newline at end of file
index eb0c4fa..82ecf6c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x063c=['hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','include','find','catch','create','body','params','destroy','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','apply','reject','save','update','then','stack','name','index','VoiceQueuesLog','rawAttributes','fieldName','type','model','map','query','keys','intersection','attributes','fields','length'];(function(_0x4eed7a,_0x229e56){var _0x4f0750=function(_0x1c9329){while(--_0x1c9329){_0x4eed7a['push'](_0x4eed7a['shift']());}};_0x4f0750(++_0x229e56);}(_0x063c,0x17e));var _0xc063=function(_0x524be2,_0x2ca9ba){_0x524be2=_0x524be2-0x0;var _0x3c90fb=_0x063c[_0x524be2];return _0x3c90fb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc063('0x0'));var zipdir=require(_0xc063('0x1'));var jsonpatch=require(_0xc063('0x2'));var rp=require(_0xc063('0x3'));var moment=require('moment');var BPromise=require(_0xc063('0x4'));var Mustache=require(_0xc063('0x5'));var util=require(_0xc063('0x6'));var path=require(_0xc063('0x7'));var sox=require(_0xc063('0x8'));var csv=require(_0xc063('0x9'));var ejs=require(_0xc063('0xa'));var fs=require('fs');var fs_extra=require(_0xc063('0xb'));var _=require(_0xc063('0xc'));var squel=require('squel');var crypto=require(_0xc063('0xd'));var jsforce=require(_0xc063('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xc063('0x9'));var querystring=require(_0xc063('0xf'));var Papa=require(_0xc063('0x10'));var Redis=require(_0xc063('0x11'));var authService=require(_0xc063('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc063('0x13'));var logger=require('../../config/logger')(_0xc063('0x14'));var utils=require(_0xc063('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xc063('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x40469a,_0x18b219){_0x18b219=_0x18b219||0xcc;return function(_0x477c7f){if(_0x477c7f){return _0x40469a[_0xc063('0x17')](_0x18b219);}return _0x40469a[_0xc063('0x18')](_0x18b219)[_0xc063('0x19')]();};}function respondWithResult(_0x39b080,_0x1e5d4e){_0x1e5d4e=_0x1e5d4e||0xc8;return function(_0x1d0cee){if(_0x1d0cee){return _0x39b080[_0xc063('0x18')](_0x1e5d4e)['json'](_0x1d0cee);}};}function respondWithFilteredResult(_0x431128,_0x3c66e8){return function(_0x4282be){if(_0x4282be){var _0xc47e7b=typeof _0x3c66e8[_0xc063('0x1a')]===_0xc063('0x1b')&&typeof _0x3c66e8[_0xc063('0x1c')]===_0xc063('0x1b');var _0x3a11e6=_0x4282be[_0xc063('0x1d')];var _0x232a2c=_0xc47e7b?0x0:_0x3c66e8[_0xc063('0x1a')];var _0xd7d370=_0xc47e7b?_0x4282be[_0xc063('0x1d')]:_0x3c66e8['offset']+_0x3c66e8[_0xc063('0x1c')];var _0x4a7356;if(_0xd7d370>=_0x3a11e6){_0xd7d370=_0x3a11e6;_0x4a7356=0xc8;}else{_0x4a7356=0xce;}_0x431128['status'](_0x4a7356);return _0x431128['set']('Content-Range',_0x232a2c+'-'+_0xd7d370+'/'+_0x3a11e6)['json'](_0x4282be);}return null;};}function patchUpdates(_0x3e746f){return function(_0x11848b){try{jsonpatch[_0xc063('0x1e')](_0x11848b,_0x3e746f,!![]);}catch(_0x431f93){return BPromise[_0xc063('0x1f')](_0x431f93);}return _0x11848b[_0xc063('0x20')]();};}function saveUpdates(_0x3e8e6a,_0x5a0142){return function(_0x394f8f){if(_0x394f8f){return _0x394f8f[_0xc063('0x21')](_0x3e8e6a)[_0xc063('0x22')](function(_0x1da292){return _0x1da292;});}return null;};}function removeEntity(_0x1367af,_0x2b533b){return function(_0x39b45a){if(_0x39b45a){return _0x39b45a['destroy']()[_0xc063('0x22')](function(){_0x1367af[_0xc063('0x18')](0xcc)[_0xc063('0x19')]();});}};}function handleEntityNotFound(_0x5697e7,_0xb9b17e){return function(_0x576332){if(!_0x576332){_0x5697e7[_0xc063('0x17')](0x194);}return _0x576332;};}function handleError(_0x1bd15a,_0x2d1316){_0x2d1316=_0x2d1316||0x1f4;return function(_0x33dcca){logger['error'](_0x33dcca[_0xc063('0x23')]);if(_0x33dcca[_0xc063('0x24')]){delete _0x33dcca[_0xc063('0x24')];}_0x1bd15a[_0xc063('0x18')](_0x2d1316)['send'](_0x33dcca);};}exports[_0xc063('0x25')]=function(_0x3f2825,_0x5104be){var _0x58ee57={},_0x341ce3={},_0x5b97ea={'count':0x0,'rows':[]};var _0x27a726=_['map'](db[_0xc063('0x26')][_0xc063('0x27')],function(_0x3d7321){return{'name':_0x3d7321[_0xc063('0x28')],'type':_0x3d7321[_0xc063('0x29')]['key']};});_0x341ce3[_0xc063('0x2a')]=_[_0xc063('0x2b')](_0x27a726,_0xc063('0x24'));_0x341ce3[_0xc063('0x2c')]=_[_0xc063('0x2d')](_0x3f2825[_0xc063('0x2c')]);_0x341ce3['filters']=_[_0xc063('0x2e')](_0x341ce3[_0xc063('0x2a')],_0x341ce3[_0xc063('0x2c')]);_0x58ee57[_0xc063('0x2f')]=_[_0xc063('0x2e')](_0x341ce3[_0xc063('0x2a')],qs[_0xc063('0x30')](_0x3f2825['query'][_0xc063('0x30')]));_0x58ee57[_0xc063('0x2f')]=_0x58ee57['attributes'][_0xc063('0x31')]?_0x58ee57[_0xc063('0x2f')]:_0x341ce3[_0xc063('0x2a')];if(!_0x3f2825[_0xc063('0x2c')][_0xc063('0x32')](_0xc063('0x33'))){_0x58ee57[_0xc063('0x1c')]=qs['limit'](_0x3f2825[_0xc063('0x2c')][_0xc063('0x1c')]);_0x58ee57['offset']=qs[_0xc063('0x1a')](_0x3f2825['query']['offset']);}_0x58ee57[_0xc063('0x34')]=qs[_0xc063('0x35')](_0x3f2825['query'][_0xc063('0x35')]);_0x58ee57[_0xc063('0x36')]=qs[_0xc063('0x37')](_[_0xc063('0x38')](_0x3f2825['query'],_0x341ce3['filters']),_0x27a726);if(_0x3f2825['query'][_0xc063('0x39')]){_0x58ee57[_0xc063('0x36')]=_[_0xc063('0x3a')](_0x58ee57['where'],{'$or':_[_0xc063('0x2b')](_0x27a726,function(_0x446240){if(_0x446240[_0xc063('0x29')]!==_0xc063('0x3b')){var _0x48f4e6={};_0x48f4e6[_0x446240[_0xc063('0x24')]]={'$like':'%'+_0x3f2825[_0xc063('0x2c')][_0xc063('0x39')]+'%'};return _0x48f4e6;}})});}_0x58ee57=_['merge']({},_0x58ee57,_0x3f2825[_0xc063('0x3c')]);var _0x31e987={'where':_0x58ee57['where']};return db[_0xc063('0x26')][_0xc063('0x1d')](_0x31e987)['then'](function(_0x4c4388){_0x5b97ea[_0xc063('0x1d')]=_0x4c4388;if(_0x3f2825[_0xc063('0x2c')][_0xc063('0x3d')]){_0x58ee57['include']=[{'all':!![]}];}return db[_0xc063('0x26')][_0xc063('0x3e')](_0x58ee57);})[_0xc063('0x22')](function(_0x2368e3){_0x5b97ea[_0xc063('0x3f')]=_0x2368e3;return _0x5b97ea;})[_0xc063('0x22')](respondWithFilteredResult(_0x5104be,_0x58ee57))['catch'](handleError(_0x5104be,null));};exports[_0xc063('0x40')]=function(_0x405a5b,_0x2832e0){var _0x2fd0dc={'raw':!![],'where':{'id':_0x405a5b['params']['id']}},_0x51faec={};_0x51faec[_0xc063('0x2a')]=_[_0xc063('0x2d')](db['VoiceQueuesLog'][_0xc063('0x27')]);_0x51faec[_0xc063('0x2c')]=_[_0xc063('0x2d')](_0x405a5b[_0xc063('0x2c')]);_0x51faec[_0xc063('0x37')]=_[_0xc063('0x2e')](_0x51faec[_0xc063('0x2a')],_0x51faec[_0xc063('0x2c')]);_0x2fd0dc[_0xc063('0x2f')]=_['intersection'](_0x51faec[_0xc063('0x2a')],qs['fields'](_0x405a5b['query'][_0xc063('0x30')]));_0x2fd0dc[_0xc063('0x2f')]=_0x2fd0dc[_0xc063('0x2f')][_0xc063('0x31')]?_0x2fd0dc[_0xc063('0x2f')]:_0x51faec[_0xc063('0x2a')];if(_0x405a5b['query'][_0xc063('0x3d')]){_0x2fd0dc[_0xc063('0x41')]=[{'all':!![]}];}_0x2fd0dc=_['merge']({},_0x2fd0dc,_0x405a5b[_0xc063('0x3c')]);return db['VoiceQueuesLog'][_0xc063('0x42')](_0x2fd0dc)[_0xc063('0x22')](handleEntityNotFound(_0x2832e0,null))[_0xc063('0x22')](respondWithResult(_0x2832e0,null))[_0xc063('0x43')](handleError(_0x2832e0,null));};exports[_0xc063('0x44')]=function(_0x55b811,_0x59b45d){return db[_0xc063('0x26')][_0xc063('0x44')](_0x55b811['body'],{})['then'](respondWithResult(_0x59b45d,0xc9))[_0xc063('0x43')](handleError(_0x59b45d,null));};exports[_0xc063('0x21')]=function(_0x55155c,_0x516587){if(_0x55155c[_0xc063('0x45')]['id']){delete _0x55155c[_0xc063('0x45')]['id'];}return db['VoiceQueuesLog']['find']({'where':{'id':_0x55155c[_0xc063('0x46')]['id']}})[_0xc063('0x22')](handleEntityNotFound(_0x516587,null))[_0xc063('0x22')](saveUpdates(_0x55155c[_0xc063('0x45')],null))[_0xc063('0x22')](respondWithResult(_0x516587,null))[_0xc063('0x43')](handleError(_0x516587,null));};exports[_0xc063('0x47')]=function(_0x4e2833,_0x16c491){return db[_0xc063('0x26')][_0xc063('0x42')]({'where':{'id':_0x4e2833[_0xc063('0x46')]['id']}})[_0xc063('0x22')](handleEntityNotFound(_0x16c491,null))[_0xc063('0x22')](removeEntity(_0x16c491,null))[_0xc063('0x43')](handleError(_0x16c491,null));};
\ No newline at end of file
+var _0x0de6=['filter','count','include','findAll','rows','catch','params','options','find','create','body','destroy','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','set','Content-Range','reject','update','then','error','stack','name','send','index','map','VoiceQueuesLog','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL'];(function(_0x193f03,_0xabfdb8){var _0x26f348=function(_0x4bb382){while(--_0x4bb382){_0x193f03['push'](_0x193f03['shift']());}};_0x26f348(++_0xabfdb8);}(_0x0de6,0x9e));var _0x60de=function(_0x4de002,_0x3fb911){_0x4de002=_0x4de002-0x0;var _0x442036=_0x0de6[_0x4de002];return _0x442036;};'use strict';var emlformat=require(_0x60de('0x0'));var rimraf=require(_0x60de('0x1'));var zipdir=require(_0x60de('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x60de('0x3'));var moment=require(_0x60de('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x60de('0x5'));var util=require(_0x60de('0x6'));var path=require(_0x60de('0x7'));var sox=require(_0x60de('0x8'));var csv=require(_0x60de('0x9'));var ejs=require(_0x60de('0xa'));var fs=require('fs');var fs_extra=require(_0x60de('0xb'));var _=require('lodash');var squel=require(_0x60de('0xc'));var crypto=require(_0x60de('0xd'));var jsforce=require(_0x60de('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x60de('0x9'));var querystring=require('querystring');var Papa=require(_0x60de('0xf'));var Redis=require(_0x60de('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x60de('0x11'));var as=require(_0x60de('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x60de('0x13'))(_0x60de('0x14'));var utils=require(_0x60de('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x60de('0x16'));var db=require(_0x60de('0x17'))['db'];function respondWithStatusCode(_0x5f1228,_0x40e648){_0x40e648=_0x40e648||0xcc;return function(_0x5a1d96){if(_0x5a1d96){return _0x5f1228[_0x60de('0x18')](_0x40e648);}return _0x5f1228[_0x60de('0x19')](_0x40e648)[_0x60de('0x1a')]();};}function respondWithResult(_0x1db37d,_0x2b7d15){_0x2b7d15=_0x2b7d15||0xc8;return function(_0x3ef9de){if(_0x3ef9de){return _0x1db37d[_0x60de('0x19')](_0x2b7d15)['json'](_0x3ef9de);}};}function respondWithFilteredResult(_0x2b3dc2,_0x11579c){return function(_0x5148b3){if(_0x5148b3){var _0x3bd0e6=typeof _0x11579c[_0x60de('0x1b')]===_0x60de('0x1c')&&typeof _0x11579c[_0x60de('0x1d')]===_0x60de('0x1c');var _0x573060=_0x5148b3['count'];var _0x5aefcb=_0x3bd0e6?0x0:_0x11579c['offset'];var _0x1dbefb=_0x3bd0e6?_0x5148b3['count']:_0x11579c[_0x60de('0x1b')]+_0x11579c['limit'];var _0x3e960b;if(_0x1dbefb>=_0x573060){_0x1dbefb=_0x573060;_0x3e960b=0xc8;}else{_0x3e960b=0xce;}_0x2b3dc2[_0x60de('0x19')](_0x3e960b);return _0x2b3dc2[_0x60de('0x1e')](_0x60de('0x1f'),_0x5aefcb+'-'+_0x1dbefb+'/'+_0x573060)['json'](_0x5148b3);}return null;};}function patchUpdates(_0x4c78f7){return function(_0x4cadfe){try{jsonpatch['apply'](_0x4cadfe,_0x4c78f7,!![]);}catch(_0x18b286){return BPromise[_0x60de('0x20')](_0x18b286);}return _0x4cadfe['save']();};}function saveUpdates(_0x18cf9d,_0x465b99){return function(_0x5da2dd){if(_0x5da2dd){return _0x5da2dd[_0x60de('0x21')](_0x18cf9d)[_0x60de('0x22')](function(_0x53b52f){return _0x53b52f;});}return null;};}function removeEntity(_0x5e028f,_0x3727ec){return function(_0x2a4e02){if(_0x2a4e02){return _0x2a4e02['destroy']()['then'](function(){_0x5e028f['status'](0xcc)[_0x60de('0x1a')]();});}};}function handleEntityNotFound(_0x242819,_0x2f111b){return function(_0x4d9b52){if(!_0x4d9b52){_0x242819['sendStatus'](0x194);}return _0x4d9b52;};}function handleError(_0x20ca6c,_0x474698){_0x474698=_0x474698||0x1f4;return function(_0x32f431){logger[_0x60de('0x23')](_0x32f431[_0x60de('0x24')]);if(_0x32f431['name']){delete _0x32f431[_0x60de('0x25')];}_0x20ca6c[_0x60de('0x19')](_0x474698)[_0x60de('0x26')](_0x32f431);};}exports[_0x60de('0x27')]=function(_0x10fba4,_0x265a4b){var _0x5e4a1f={},_0x2c7063={},_0x3228b9={'count':0x0,'rows':[]};var _0x95b6d7=_[_0x60de('0x28')](db[_0x60de('0x29')][_0x60de('0x2a')],function(_0x490e2c){return{'name':_0x490e2c[_0x60de('0x2b')],'type':_0x490e2c[_0x60de('0x2c')]['key']};});_0x2c7063[_0x60de('0x2d')]=_['map'](_0x95b6d7,'name');_0x2c7063[_0x60de('0x2e')]=_[_0x60de('0x2f')](_0x10fba4['query']);_0x2c7063[_0x60de('0x30')]=_[_0x60de('0x31')](_0x2c7063[_0x60de('0x2d')],_0x2c7063[_0x60de('0x2e')]);_0x5e4a1f['attributes']=_[_0x60de('0x31')](_0x2c7063['model'],qs['fields'](_0x10fba4[_0x60de('0x2e')][_0x60de('0x32')]));_0x5e4a1f[_0x60de('0x33')]=_0x5e4a1f[_0x60de('0x33')][_0x60de('0x34')]?_0x5e4a1f[_0x60de('0x33')]:_0x2c7063[_0x60de('0x2d')];if(!_0x10fba4['query'][_0x60de('0x35')](_0x60de('0x36'))){_0x5e4a1f[_0x60de('0x1d')]=qs[_0x60de('0x1d')](_0x10fba4[_0x60de('0x2e')][_0x60de('0x1d')]);_0x5e4a1f['offset']=qs['offset'](_0x10fba4[_0x60de('0x2e')][_0x60de('0x1b')]);}_0x5e4a1f[_0x60de('0x37')]=qs[_0x60de('0x38')](_0x10fba4[_0x60de('0x2e')]['sort']);_0x5e4a1f[_0x60de('0x39')]=qs[_0x60de('0x30')](_[_0x60de('0x3a')](_0x10fba4[_0x60de('0x2e')],_0x2c7063['filters']),_0x95b6d7);if(_0x10fba4[_0x60de('0x2e')]['filter']){_0x5e4a1f[_0x60de('0x39')]=_[_0x60de('0x3b')](_0x5e4a1f[_0x60de('0x39')],{'$or':_['map'](_0x95b6d7,function(_0x3ed576){if(_0x3ed576[_0x60de('0x2c')]!==_0x60de('0x3c')){var _0x56665d={};_0x56665d[_0x3ed576['name']]={'$like':'%'+_0x10fba4[_0x60de('0x2e')][_0x60de('0x3d')]+'%'};return _0x56665d;}})});}_0x5e4a1f=_[_0x60de('0x3b')]({},_0x5e4a1f,_0x10fba4['options']);var _0x406e58={'where':_0x5e4a1f[_0x60de('0x39')]};return db[_0x60de('0x29')]['count'](_0x406e58)[_0x60de('0x22')](function(_0xf8170f){_0x3228b9[_0x60de('0x3e')]=_0xf8170f;if(_0x10fba4['query']['includeAll']){_0x5e4a1f[_0x60de('0x3f')]=[{'all':!![]}];}return db[_0x60de('0x29')][_0x60de('0x40')](_0x5e4a1f);})['then'](function(_0xf9dcbf){_0x3228b9[_0x60de('0x41')]=_0xf9dcbf;return _0x3228b9;})[_0x60de('0x22')](respondWithFilteredResult(_0x265a4b,_0x5e4a1f))[_0x60de('0x42')](handleError(_0x265a4b,null));};exports['show']=function(_0x2f4d54,_0x192f65){var _0x175762={'raw':!![],'where':{'id':_0x2f4d54[_0x60de('0x43')]['id']}},_0x23092e={};_0x23092e['model']=_[_0x60de('0x2f')](db[_0x60de('0x29')][_0x60de('0x2a')]);_0x23092e['query']=_[_0x60de('0x2f')](_0x2f4d54[_0x60de('0x2e')]);_0x23092e[_0x60de('0x30')]=_[_0x60de('0x31')](_0x23092e[_0x60de('0x2d')],_0x23092e[_0x60de('0x2e')]);_0x175762[_0x60de('0x33')]=_['intersection'](_0x23092e['model'],qs[_0x60de('0x32')](_0x2f4d54[_0x60de('0x2e')][_0x60de('0x32')]));_0x175762['attributes']=_0x175762['attributes']['length']?_0x175762[_0x60de('0x33')]:_0x23092e[_0x60de('0x2d')];if(_0x2f4d54['query']['includeAll']){_0x175762[_0x60de('0x3f')]=[{'all':!![]}];}_0x175762=_[_0x60de('0x3b')]({},_0x175762,_0x2f4d54[_0x60de('0x44')]);return db['VoiceQueuesLog'][_0x60de('0x45')](_0x175762)[_0x60de('0x22')](handleEntityNotFound(_0x192f65,null))['then'](respondWithResult(_0x192f65,null))[_0x60de('0x42')](handleError(_0x192f65,null));};exports[_0x60de('0x46')]=function(_0x234dd4,_0x6e2271){return db[_0x60de('0x29')][_0x60de('0x46')](_0x234dd4['body'],{})[_0x60de('0x22')](respondWithResult(_0x6e2271,0xc9))['catch'](handleError(_0x6e2271,null));};exports[_0x60de('0x21')]=function(_0x46c3ff,_0x237b98){if(_0x46c3ff[_0x60de('0x47')]['id']){delete _0x46c3ff[_0x60de('0x47')]['id'];}return db[_0x60de('0x29')][_0x60de('0x45')]({'where':{'id':_0x46c3ff[_0x60de('0x43')]['id']}})[_0x60de('0x22')](handleEntityNotFound(_0x237b98,null))[_0x60de('0x22')](saveUpdates(_0x46c3ff[_0x60de('0x47')],null))['then'](respondWithResult(_0x237b98,null))[_0x60de('0x42')](handleError(_0x237b98,null));};exports[_0x60de('0x48')]=function(_0x1332ca,_0x295ec3){return db[_0x60de('0x29')][_0x60de('0x45')]({'where':{'id':_0x1332ca['params']['id']}})[_0x60de('0x22')](handleEntityNotFound(_0x295ec3,null))['then'](removeEntity(_0x295ec3,null))['catch'](handleError(_0x295ec3,null));};
\ No newline at end of file
index 815eb96..2c9ce7f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa5df=['request-promise','rimraf','../../config/environment','./voiceQueuesLog.attributes','exports','define','event_dtm','dtm','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x5e0fb7,_0x124947){var _0x4ee969=function(_0x2c92ae){while(--_0x2c92ae){_0x5e0fb7['push'](_0x5e0fb7['shift']());}};_0x4ee969(++_0x124947);}(_0xa5df,0x190));var _0xfa5d=function(_0x2866c9,_0x239dcf){_0x2866c9=_0x2866c9-0x0;var _0x3ebdb7=_0xa5df[_0x2866c9];return _0x3ebdb7;};'use strict';var _=require(_0xfa5d('0x0'));var util=require(_0xfa5d('0x1'));var logger=require(_0xfa5d('0x2'))(_0xfa5d('0x3'));var moment=require(_0xfa5d('0x4'));var BPromise=require(_0xfa5d('0x5'));var rp=require(_0xfa5d('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfa5d('0x7'));var config=require(_0xfa5d('0x8'));var attributes=require(_0xfa5d('0x9'));module[_0xfa5d('0xa')]=function(_0x331859,_0x1c2214){return _0x331859[_0xfa5d('0xb')]('VoiceQueuesLog',attributes,{'tableName':'voice_queues_log','paranoid':![],'indexes':[{'name':_0xfa5d('0xc'),'fields':['event',_0xfa5d('0xd')]}],'timestamps':![]});};
\ No newline at end of file
+var _0xddee=['VoiceQueuesLog','event_dtm','event','dtm','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./voiceQueuesLog.attributes','exports','define'];(function(_0x525c7b,_0x488fcc){var _0x27b33e=function(_0x56d43b){while(--_0x56d43b){_0x525c7b['push'](_0x525c7b['shift']());}};_0x27b33e(++_0x488fcc);}(_0xddee,0x1d2));var _0xedde=function(_0x3e6729,_0x16d4af){_0x3e6729=_0x3e6729-0x0;var _0x535bcd=_0xddee[_0x3e6729];return _0x535bcd;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xedde('0x0'))(_0xedde('0x1'));var moment=require(_0xedde('0x2'));var BPromise=require('bluebird');var rp=require(_0xedde('0x3'));var fs=require('fs');var path=require(_0xedde('0x4'));var rimraf=require(_0xedde('0x5'));var config=require(_0xedde('0x6'));var attributes=require(_0xedde('0x7'));module[_0xedde('0x8')]=function(_0x2d370e,_0x4483c7){return _0x2d370e[_0xedde('0x9')](_0xedde('0xa'),attributes,{'tableName':'voice_queues_log','paranoid':![],'indexes':[{'name':_0xedde('0xb'),'fields':[_0xedde('0xc'),_0xedde('0xd')]}],'timestamps':![]});};
\ No newline at end of file
index daab90f..2941cdc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xee29=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceQueuesLog,\x20%s,\x20%s','message','result','catch'];(function(_0x3f0e2c,_0x5644a3){var _0x32aa1a=function(_0x3a73b1){while(--_0x3a73b1){_0x3f0e2c['push'](_0x3f0e2c['shift']());}};_0x32aa1a(++_0x5644a3);}(_0xee29,0xd8));var _0x9ee2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xee29[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x9ee2('0x0'));var util=require(_0x9ee2('0x1'));var moment=require(_0x9ee2('0x2'));var BPromise=require(_0x9ee2('0x3'));var rs=require(_0x9ee2('0x4'));var fs=require('fs');var Redis=require(_0x9ee2('0x5'));var db=require(_0x9ee2('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x9ee2('0x7'));var config=require(_0x9ee2('0x8'));var jayson=require(_0x9ee2('0x9'));var client=jayson['client'][_0x9ee2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x53bb21,_0x444b92,_0x51bf5e){return new BPromise(function(_0x32107c,_0x156b13){return client[_0x9ee2('0xb')](_0x53bb21,_0x51bf5e)[_0x9ee2('0xc')](function(_0xee118){logger[_0x9ee2('0xd')]('VoiceQueuesLog,\x20%s,\x20%s',_0x444b92,_0x9ee2('0xe'));logger[_0x9ee2('0xf')](_0x9ee2('0x10'),_0x444b92,_0x9ee2('0xe'),JSON[_0x9ee2('0x11')](_0xee118));if(_0xee118[_0x9ee2('0x12')]){if(_0xee118[_0x9ee2('0x12')][_0x9ee2('0x13')]===0x1f4){logger['error'](_0x9ee2('0x14'),_0x444b92,_0xee118[_0x9ee2('0x12')][_0x9ee2('0x15')]);return _0x156b13(_0xee118[_0x9ee2('0x12')][_0x9ee2('0x15')]);}logger[_0x9ee2('0x12')](_0x9ee2('0x14'),_0x444b92,_0xee118[_0x9ee2('0x12')][_0x9ee2('0x15')]);return _0x32107c(_0xee118['error'][_0x9ee2('0x15')]);}else{logger[_0x9ee2('0xd')](_0x9ee2('0x14'),_0x444b92,'request\x20sent');_0x32107c(_0xee118[_0x9ee2('0x16')][_0x9ee2('0x15')]);}})[_0x9ee2('0x17')](function(_0x2280ca){logger[_0x9ee2('0x12')](_0x9ee2('0x14'),_0x444b92,_0x2280ca);_0x156b13(_0x2280ca);});});}
\ 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(_0x65ed75,_0x10aaf7){var _0x3684f1=function(_0x128d13){while(--_0x128d13){_0x65ed75['push'](_0x65ed75['shift']());}};_0x3684f1(++_0x10aaf7);}(_0x4bd1,0x90));var _0x14bd=function(_0x1f9f37,_0x18776e){_0x1f9f37=_0x1f9f37-0x0;var _0x21c080=_0x4bd1[_0x1f9f37];return _0x21c080;};'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 c6b4078..ceb8e46 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7881=['destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceRecording.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download','download','/:id/downloads','downloads','/:id/transcribe','downloadTranscribe','create','post','runTranscribe','put','update','delete'];(function(_0x5351a2,_0x353fda){var _0x578c84=function(_0x3be76d){while(--_0x3be76d){_0x5351a2['push'](_0x5351a2['shift']());}};_0x578c84(++_0x353fda);}(_0x7881,0x16a));var _0x1788=function(_0x3a598d,_0x190624){_0x3a598d=_0x3a598d-0x0;var _0x3ab1d6=_0x7881[_0x3a598d];return _0x3ab1d6;};'use strict';var multer=require('multer');var util=require(_0x1788('0x0'));var path=require(_0x1788('0x1'));var timeout=require(_0x1788('0x2'));var express=require(_0x1788('0x3'));var router=express[_0x1788('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x1788('0x5'));var interaction=require(_0x1788('0x6'));var config=require(_0x1788('0x7'));var controller=require(_0x1788('0x8'));router[_0x1788('0x9')]('/',auth[_0x1788('0xa')](),controller[_0x1788('0xb')]);router['get'](_0x1788('0xc'),auth['isAuthenticated'](),controller[_0x1788('0xd')]);router['get'](_0x1788('0xe'),auth[_0x1788('0xa')](),controller[_0x1788('0xf')]);router[_0x1788('0x9')](_0x1788('0x10'),auth[_0x1788('0xa')](),controller[_0x1788('0x11')]);router['get'](_0x1788('0x12'),controller[_0x1788('0x13')]);router['get'](_0x1788('0x14'),auth[_0x1788('0xa')](),controller[_0x1788('0x15')]);router['post']('/',auth[_0x1788('0xa')](),controller[_0x1788('0x16')]);router[_0x1788('0x17')](_0x1788('0x14'),auth['isAuthenticated'](),controller[_0x1788('0x18')]);router[_0x1788('0x19')](_0x1788('0xe'),auth['isAuthenticated'](),controller[_0x1788('0x1a')]);router[_0x1788('0x1b')](_0x1788('0xe'),auth['isAuthenticated'](),controller[_0x1788('0x1c')]);module[_0x1788('0x1d')]=router;
\ No newline at end of file
+var _0x7d6b=['/:id/download','download','/:id/downloads','downloads','/:id/transcribe','downloadTranscribe','post','create','runTranscribe','put','update','delete','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceRecording.controller','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x56a616,_0x5a3c7c){var _0xe94844=function(_0x1d3816){while(--_0x1d3816){_0x56a616['push'](_0x56a616['shift']());}};_0xe94844(++_0x5a3c7c);}(_0x7d6b,0xd8));var _0xb7d6=function(_0x4526e9,_0xbff7c8){_0x4526e9=_0x4526e9-0x0;var _0x4e1da7=_0x7d6b[_0x4526e9];return _0x4e1da7;};'use strict';var multer=require(_0xb7d6('0x0'));var util=require(_0xb7d6('0x1'));var path=require(_0xb7d6('0x2'));var timeout=require(_0xb7d6('0x3'));var express=require('express');var router=express[_0xb7d6('0x4')]();var fs_extra=require(_0xb7d6('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xb7d6('0x6'));var config=require(_0xb7d6('0x7'));var controller=require(_0xb7d6('0x8'));router[_0xb7d6('0x9')]('/',auth[_0xb7d6('0xa')](),controller[_0xb7d6('0xb')]);router[_0xb7d6('0x9')](_0xb7d6('0xc'),auth[_0xb7d6('0xa')](),controller[_0xb7d6('0xd')]);router['get'](_0xb7d6('0xe'),auth[_0xb7d6('0xa')](),controller[_0xb7d6('0xf')]);router[_0xb7d6('0x9')](_0xb7d6('0x10'),auth[_0xb7d6('0xa')](),controller[_0xb7d6('0x11')]);router[_0xb7d6('0x9')](_0xb7d6('0x12'),controller[_0xb7d6('0x13')]);router[_0xb7d6('0x9')](_0xb7d6('0x14'),auth['isAuthenticated'](),controller[_0xb7d6('0x15')]);router[_0xb7d6('0x16')]('/',auth[_0xb7d6('0xa')](),controller[_0xb7d6('0x17')]);router[_0xb7d6('0x16')]('/:id/transcribe',auth[_0xb7d6('0xa')](),controller[_0xb7d6('0x18')]);router[_0xb7d6('0x19')]('/:id',auth['isAuthenticated'](),controller[_0xb7d6('0x1a')]);router[_0xb7d6('0x1b')](_0xb7d6('0xe'),auth[_0xb7d6('0xa')](),controller[_0xb7d6('0x1c')]);module['exports']=router;
\ No newline at end of file
index 3476397..8c2f669 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(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xa9e0[_0x2dafbe];return _0x58a45a;};'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(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0xa9e0[_0x3ce3c];return _0x55a2c9;};'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 3e663fb..14e4be1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb8e7=['[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','data1','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','tempSentiment','writeFile','downloadTranscribe','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','rimraf','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','aws-sdk','uuid/v4','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','reject','update','then','destroy','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','differenceBy','format','query','keys','filters','intersection','fields','attributes','length','model','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','VoiceRecording','includeAll','findAll','catch','show','params','include','options','create','body','find','describe','uniqueid','value','%s.cypher','existsSync','decryptFile','recording','ValidationError','filename','download','unlink','message','VoiceRecording\x20not\x20found','Not\x20found','downloads','../../components/encryptor','sequelize','MD5','token','$and','push','secrets','Sequelize','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','listBuckets','createBucket','upload','TranscribeService','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','bucket','location','Location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeName','transcribeStatus','TranscriptionJobStatus','runTranscribe','findOne','Voice\x20Recording\x20not\x20found','Setting','transcribe','transcribeAccountId','language','Transcribe\x20not\x20configured','runSentiment','sentiment','Sentiment\x20Analysis\x20not\x20configured','Cloud\x20Provider\x20not\x20available','data2','Cloud\x20Provider\x20not\x20configured','transcribeRegion','Buckets','Name'];(function(_0x46370e,_0x345909){var _0x56ddc2=function(_0x2e0ace){while(--_0x2e0ace){_0x46370e['push'](_0x46370e['shift']());}};_0x56ddc2(++_0x345909);}(_0xb8e7,0xa9));var _0x7b8e=function(_0x5e14fa,_0x1b616d){_0x5e14fa=_0x5e14fa-0x0;var _0x3f7032=_0xb8e7[_0x5e14fa];return _0x3f7032;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7b8e('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7b8e('0x1'));var rp=require('request-promise');var moment=require(_0x7b8e('0x2'));var BPromise=require(_0x7b8e('0x3'));var Mustache=require(_0x7b8e('0x4'));var util=require('util');var path=require(_0x7b8e('0x5'));var sox=require(_0x7b8e('0x6'));var csv=require(_0x7b8e('0x7'));var ejs=require(_0x7b8e('0x8'));var fs=require('fs');var fs_extra=require(_0x7b8e('0x9'));var _=require(_0x7b8e('0xa'));var squel=require(_0x7b8e('0xb'));var crypto=require(_0x7b8e('0xc'));var jsforce=require(_0x7b8e('0xd'));var deskjs=require(_0x7b8e('0xe'));var toCsv=require(_0x7b8e('0x7'));var querystring=require(_0x7b8e('0xf'));var Papa=require(_0x7b8e('0x10'));var AWS=require(_0x7b8e('0x11'));var uuidv4=require(_0x7b8e('0x12'));var Redis=require('ioredis');var authService=require(_0x7b8e('0x13'));var qs=require(_0x7b8e('0x14'));var as=require(_0x7b8e('0x15'));var hardwareService=require(_0x7b8e('0x16'));var logger=require(_0x7b8e('0x17'))('api');var utils=require('../../config/utils');var config=require(_0x7b8e('0x18'));var licenseUtil=require(_0x7b8e('0x19'));var db=require(_0x7b8e('0x1a'))['db'];function respondWithStatusCode(_0x1189c1,_0x191201){_0x191201=_0x191201||0xcc;return function(_0x2ab581){if(_0x2ab581){return _0x1189c1[_0x7b8e('0x1b')](_0x191201);}return _0x1189c1['status'](_0x191201)['end']();};}function respondWithResult(_0x36088d,_0x4ef684){_0x4ef684=_0x4ef684||0xc8;return function(_0x24ad5e){if(_0x24ad5e){return _0x36088d[_0x7b8e('0x1c')](_0x4ef684)[_0x7b8e('0x1d')](_0x24ad5e);}};}function respondWithFilteredResult(_0x5e507a,_0xea8de0){return function(_0x35f6a8){if(_0x35f6a8){var _0x31c648=typeof _0xea8de0[_0x7b8e('0x1e')]==='undefined'&&typeof _0xea8de0[_0x7b8e('0x1f')]===_0x7b8e('0x20');var _0x4bf817=_0x35f6a8['count'];var _0x2f6755=_0x31c648?0x0:_0xea8de0['offset'];var _0x71369b=_0x31c648?_0x35f6a8[_0x7b8e('0x21')]:_0xea8de0['offset']+_0xea8de0[_0x7b8e('0x1f')];var _0x5bbb11;if(_0x71369b>=_0x4bf817){_0x71369b=_0x4bf817;_0x5bbb11=0xc8;}else{_0x5bbb11=0xce;}_0x5e507a[_0x7b8e('0x1c')](_0x5bbb11);return _0x5e507a[_0x7b8e('0x22')](_0x7b8e('0x23'),_0x2f6755+'-'+_0x71369b+'/'+_0x4bf817)[_0x7b8e('0x1d')](_0x35f6a8);}return null;};}function patchUpdates(_0x4ab6e0){return function(_0x176bb6){try{jsonpatch['apply'](_0x176bb6,_0x4ab6e0,!![]);}catch(_0x1cd0eb){return BPromise[_0x7b8e('0x24')](_0x1cd0eb);}return _0x176bb6['save']();};}function saveUpdates(_0x3c8234,_0x1c1b54){return function(_0x113fce){if(_0x113fce){return _0x113fce[_0x7b8e('0x25')](_0x3c8234)[_0x7b8e('0x26')](function(_0x436f3e){return _0x436f3e;});}return null;};}function removeEntity(_0x447f2f,_0x2de65c){return function(_0x5f47df){if(_0x5f47df){return _0x5f47df[_0x7b8e('0x27')]()[_0x7b8e('0x26')](function(){_0x447f2f['status'](0xcc)[_0x7b8e('0x28')]();});}};}function handleEntityNotFound(_0x3fe7e2,_0x2b00c2){return function(_0x472878){if(!_0x472878){_0x3fe7e2[_0x7b8e('0x1b')](0x194);}return _0x472878;};}function handleError(_0x56f480,_0x3693c5){_0x3693c5=_0x3693c5||0x1f4;return function(_0x108875){logger[_0x7b8e('0x29')](_0x108875[_0x7b8e('0x2a')]);if(_0x108875[_0x7b8e('0x2b')]){delete _0x108875[_0x7b8e('0x2b')];}_0x56f480[_0x7b8e('0x1c')](_0x3693c5)[_0x7b8e('0x2c')](_0x108875);};}exports[_0x7b8e('0x2d')]=function(_0x417353,_0x424f65){var _0x51f01c={},_0x57916d={},_0x276cb9={'count':0x0,'rows':[]};var _0x5d901b=_[_0x7b8e('0x2e')](db['VoiceRecording'][_0x7b8e('0x2f')],function(_0x34cd49){return{'name':_0x34cd49[_0x7b8e('0x30')],'type':_0x34cd49[_0x7b8e('0x31')][_0x7b8e('0x32')]};});_0x57916d['model']=_[_0x7b8e('0x33')](_[_0x7b8e('0x2e')](_0x5d901b,_0x7b8e('0x2b')),[_0x7b8e('0x34')]);_0x57916d[_0x7b8e('0x35')]=_[_0x7b8e('0x36')](_0x417353[_0x7b8e('0x35')]);_0x57916d[_0x7b8e('0x37')]=_[_0x7b8e('0x38')](_0x57916d['model'],_0x57916d[_0x7b8e('0x35')]);_0x51f01c['attributes']=_[_0x7b8e('0x38')](_0x57916d['model'],qs[_0x7b8e('0x39')](_0x417353[_0x7b8e('0x35')][_0x7b8e('0x39')]));_0x51f01c[_0x7b8e('0x3a')]=_0x51f01c[_0x7b8e('0x3a')][_0x7b8e('0x3b')]?_0x51f01c[_0x7b8e('0x3a')]:_0x57916d[_0x7b8e('0x3c')];if(!_0x417353['query'][_0x7b8e('0x3d')](_0x7b8e('0x3e'))){_0x51f01c[_0x7b8e('0x1f')]=qs[_0x7b8e('0x1f')](_0x417353[_0x7b8e('0x35')][_0x7b8e('0x1f')]);_0x51f01c['offset']=qs['offset'](_0x417353[_0x7b8e('0x35')][_0x7b8e('0x1e')]);}_0x51f01c[_0x7b8e('0x3f')]=qs[_0x7b8e('0x40')](_0x417353[_0x7b8e('0x35')]['sort']);_0x51f01c[_0x7b8e('0x41')]=qs['filters'](_[_0x7b8e('0x42')](_0x417353['query'],_0x57916d[_0x7b8e('0x37')]),_0x5d901b);if(_0x417353[_0x7b8e('0x35')][_0x7b8e('0x43')]){_0x51f01c[_0x7b8e('0x41')]=_[_0x7b8e('0x44')](_0x51f01c[_0x7b8e('0x41')],{'$or':_[_0x7b8e('0x2e')](_0x5d901b,function(_0x438c63){if(_0x438c63[_0x7b8e('0x31')]!==_0x7b8e('0x45')){var _0x475255={};_0x475255[_0x438c63[_0x7b8e('0x2b')]]={'$like':'%'+_0x417353[_0x7b8e('0x35')]['filter']+'%'};return _0x475255;}})});}_0x51f01c=_[_0x7b8e('0x44')]({},_0x51f01c,_0x417353['options']);var _0x296eef={'where':_0x51f01c['where']};return db[_0x7b8e('0x46')][_0x7b8e('0x21')](_0x296eef)[_0x7b8e('0x26')](function(_0xbc8ee4){_0x276cb9[_0x7b8e('0x21')]=_0xbc8ee4;if(_0x417353[_0x7b8e('0x35')][_0x7b8e('0x47')]){_0x51f01c['include']=[{'all':!![]}];}return db[_0x7b8e('0x46')][_0x7b8e('0x48')](_0x51f01c);})[_0x7b8e('0x26')](function(_0x8f267b){_0x276cb9['rows']=_0x8f267b;return _0x276cb9;})['then'](respondWithFilteredResult(_0x424f65,_0x51f01c))[_0x7b8e('0x49')](handleError(_0x424f65,null));};exports[_0x7b8e('0x4a')]=function(_0x2b2101,_0x4d403a){var _0x221509={'raw':![],'where':{'id':_0x2b2101[_0x7b8e('0x4b')]['id']}},_0x2c3ba4={};_0x2c3ba4[_0x7b8e('0x3c')]=_[_0x7b8e('0x36')](db[_0x7b8e('0x46')][_0x7b8e('0x2f')]);_0x2c3ba4['query']=_['keys'](_0x2b2101['query']);_0x2c3ba4[_0x7b8e('0x37')]=_[_0x7b8e('0x38')](_0x2c3ba4[_0x7b8e('0x3c')],_0x2c3ba4[_0x7b8e('0x35')]);_0x221509[_0x7b8e('0x3a')]=_[_0x7b8e('0x38')](_0x2c3ba4[_0x7b8e('0x3c')],qs[_0x7b8e('0x39')](_0x2b2101[_0x7b8e('0x35')][_0x7b8e('0x39')]));_0x221509['attributes']=_0x221509[_0x7b8e('0x3a')][_0x7b8e('0x3b')]?_0x221509['attributes']:_0x2c3ba4['model'];if(_0x2b2101[_0x7b8e('0x35')][_0x7b8e('0x47')]){_0x221509[_0x7b8e('0x4c')]=[{'all':!![]}];}_0x221509=_[_0x7b8e('0x44')]({},_0x221509,_0x2b2101[_0x7b8e('0x4d')]);return db[_0x7b8e('0x46')]['find'](_0x221509)['then'](handleEntityNotFound(_0x4d403a,null))[_0x7b8e('0x26')](respondWithResult(_0x4d403a,null))[_0x7b8e('0x49')](handleError(_0x4d403a,null));};exports[_0x7b8e('0x4e')]=function(_0x9509d6,_0x10d250){return db[_0x7b8e('0x46')][_0x7b8e('0x4e')](_0x9509d6[_0x7b8e('0x4f')],{})[_0x7b8e('0x26')](respondWithResult(_0x10d250,0xc9))[_0x7b8e('0x49')](handleError(_0x10d250,null));};exports[_0x7b8e('0x25')]=function(_0x5e6796,_0x452c4b){if(_0x5e6796[_0x7b8e('0x4f')]['id']){delete _0x5e6796[_0x7b8e('0x4f')]['id'];}return db[_0x7b8e('0x46')][_0x7b8e('0x50')]({'where':{'id':_0x5e6796[_0x7b8e('0x4b')]['id']}})[_0x7b8e('0x26')](handleEntityNotFound(_0x452c4b,null))['then'](saveUpdates(_0x5e6796['body'],null))[_0x7b8e('0x26')](respondWithResult(_0x452c4b,null))[_0x7b8e('0x49')](handleError(_0x452c4b,null));};exports['describe']=function(_0x4ea469,_0x2d38a4){return db[_0x7b8e('0x46')][_0x7b8e('0x51')]()['then'](respondWithResult(_0x2d38a4,null))['catch'](handleError(_0x2d38a4,null));};exports['download']=function(_0x517d61,_0x9c1518,_0x220cc3){var _0x559038=require('../../components/encryptor');var _0x57537a=![];var _0x1f1f78={};if(_0x517d61[_0x7b8e('0x35')][_0x7b8e('0x31')]&&_0x517d61[_0x7b8e('0x35')]['type']===_0x7b8e('0x52')){_0x1f1f78['uniqueid']=_0x517d61[_0x7b8e('0x4b')]['id'];}else{_0x1f1f78['id']=_0x517d61[_0x7b8e('0x4b')]['id'];}return db[_0x7b8e('0x46')][_0x7b8e('0x50')]({'where':_0x1f1f78,'attributes':['id',_0x7b8e('0x53')],'raw':!![]})[_0x7b8e('0x26')](handleEntityNotFound(_0x9c1518,null))[_0x7b8e('0x26')](function(_0x31bb00){if(_0x31bb00){var _0x405f5d=_0x31bb00[_0x7b8e('0x53')];var _0x3398cb=util[_0x7b8e('0x34')](_0x7b8e('0x54'),_0x405f5d);if(fs[_0x7b8e('0x55')](_0x3398cb)){_0x57537a=!![];return _0x559038[_0x7b8e('0x56')](_0x3398cb,_0x405f5d,config['secrets'][_0x7b8e('0x57')])['then'](function(){return _0x31bb00;});}return _0x31bb00;}})[_0x7b8e('0x26')](function(_0x4efe49){if(_0x4efe49){var _0x42944c=_0x4efe49[_0x7b8e('0x53')];if(!fs['existsSync'](_0x42944c)){throw new db['Sequelize'][(_0x7b8e('0x58'))]('VoiceRecording\x20not\x20found');}if(_0x4efe49[_0x7b8e('0x59')]){return _0x9c1518[_0x7b8e('0x5a')](_0x42944c,_0x4efe49['filename']+path['extname'](_0x42944c),function(){if(_0x57537a){fs[_0x7b8e('0x5b')](_0x42944c);}});}else{return _0x9c1518[_0x7b8e('0x5a')](_0x42944c,function(_0x191372){if(_0x57537a){fs['unlink'](_0x42944c);}});}}})[_0x7b8e('0x49')](function(_0x1b24d8){if(_0x1b24d8[_0x7b8e('0x5c')]===_0x7b8e('0x5d')){_0x9c1518[_0x7b8e('0x1c')](0x194)[_0x7b8e('0x2c')](_0x7b8e('0x5e'));}else{return handleError(_0x9c1518,null);}});};exports[_0x7b8e('0x5f')]=function(_0x12bbc5,_0x590e7f,_0x11b47d){var _0x5e1ae6=require(_0x7b8e('0x60'));var _0x2f5118=![];var _0x3b65b1={'$and':[db['sequelize'][_0x7b8e('0x41')](db[_0x7b8e('0x61')]['fn'](_0x7b8e('0x62'),db[_0x7b8e('0x61')]['col'](_0x7b8e('0x52'))),_0x12bbc5[_0x7b8e('0x35')][_0x7b8e('0x63')])]};if(_0x12bbc5['query']['type']&&_0x12bbc5[_0x7b8e('0x35')][_0x7b8e('0x31')]===_0x7b8e('0x52')){_0x3b65b1[_0x7b8e('0x64')][_0x7b8e('0x65')]({'uniqueid':_0x12bbc5[_0x7b8e('0x4b')]['id']});}else{_0x3b65b1['$and'][_0x7b8e('0x65')]({'id':_0x12bbc5[_0x7b8e('0x4b')]['id']});}return db[_0x7b8e('0x46')][_0x7b8e('0x50')]({'where':_0x3b65b1,'attributes':['id','value'],'raw':!![]})['then'](handleEntityNotFound(_0x590e7f,null))['then'](function(_0x3209f5){if(_0x3209f5){var _0x4fcc62=util[_0x7b8e('0x34')](_0x7b8e('0x54'),_0x3209f5[_0x7b8e('0x53')]);if(fs['existsSync'](_0x4fcc62)){_0x2f5118=!![];return _0x5e1ae6[_0x7b8e('0x56')](_0x4fcc62,_0x3209f5[_0x7b8e('0x53')],config[_0x7b8e('0x66')][_0x7b8e('0x57')])[_0x7b8e('0x26')](function(){return _0x3209f5;});}return _0x3209f5;}})[_0x7b8e('0x26')](function(_0x37ad32){if(_0x37ad32){if(!fs[_0x7b8e('0x55')](_0x37ad32[_0x7b8e('0x53')])){throw new db[(_0x7b8e('0x67'))][(_0x7b8e('0x58'))](_0x7b8e('0x5d'));}if(_0x37ad32[_0x7b8e('0x59')]){return _0x590e7f[_0x7b8e('0x5a')](_0x37ad32[_0x7b8e('0x53')],_0x37ad32[_0x7b8e('0x59')]+path['extname'](_0x37ad32['value']),function(){if(_0x2f5118){fs[_0x7b8e('0x5b')](_0x37ad32[_0x7b8e('0x53')]);}});}else{return _0x590e7f['download'](_0x37ad32[_0x7b8e('0x53')],function(_0x17fe2a){if(_0x2f5118){fs[_0x7b8e('0x5b')](_0x37ad32['value']);}});}}})['catch'](handleError(_0x590e7f,null));};exports[_0x7b8e('0x27')]=function(_0x1d6822,_0x18bee9){return db[_0x7b8e('0x46')]['find']({'where':{'id':_0x1d6822[_0x7b8e('0x4b')]['id']}})[_0x7b8e('0x26')](function(_0x7cecee){if(_[_0x7b8e('0x68')](_0x7cecee)){throw new ReferenceError(_0x7b8e('0x69'));}return _0x7cecee;})[_0x7b8e('0x26')](function(_0x428fc7){var _0x187874=_0x428fc7[_0x7b8e('0x53')];logger[_0x7b8e('0x6a')](_0x7b8e('0x6b'),_0x187874);if(!_[_0x7b8e('0x68')](_0x428fc7[_0x7b8e('0x53')])&&fs[_0x7b8e('0x55')](_0x187874)){logger[_0x7b8e('0x6a')](_0x7b8e('0x6c')+_0x187874+_0x7b8e('0x6d'));fs[_0x7b8e('0x6e')](_0x187874);}_0x187874=_0x187874+'.cypher';if(!_[_0x7b8e('0x68')](_0x428fc7['value'])&&fs['existsSync'](_0x187874)){logger[_0x7b8e('0x6a')](_0x7b8e('0x6c')+_0x187874+_0x7b8e('0x6d'));fs[_0x7b8e('0x6e')](_0x187874);}return _0x428fc7;})['then'](function(_0x27923a){if(!_0x27923a)throw new InternalError();return _0x27923a[_0x7b8e('0x27')]();})['then'](function(){_0x18bee9[_0x7b8e('0x1c')](0xcc)['end']();})[_0x7b8e('0x49')](handleError(_0x18bee9,null));};function getBucketslist(_0x3c0e07,_0x446085,_0x28aa1b){return new Promise(function(_0x21e84b,_0x245715){var _0x11706b=new AWS['S3']({'accessKeyId':_0x446085,'secretAccessKey':_0x3c0e07,'region':_0x28aa1b});_0x11706b[_0x7b8e('0x6f')]({},function(_0x38aa2f,_0x2bdb64){if(_0x38aa2f){return _0x245715(_0x38aa2f);}else{return _0x21e84b(_0x2bdb64);}});});}function createBucket(_0xee5823,_0x447095,_0x98e660,_0x1cda7f){return new Promise(function(_0x453e29,_0x12b9c7){var _0x3e059c=new AWS['S3']({'accessKeyId':_0x447095,'secretAccessKey':_0xee5823,'region':_0x98e660});_0x3e059c[_0x7b8e('0x70')]({'Bucket':_0x1cda7f},function(_0x433d8a,_0x3492c8){if(_0x433d8a){return _0x12b9c7(_0x433d8a);}else{return _0x453e29(_0x3492c8);}});});}function uploadFile(_0x18fbaa,_0xa23888,_0x3d5cb9,_0x24421b,_0x521afb,_0x4c5863){return new Promise(function(_0x5b9f7c,_0x13d1c7){var _0x5c3636=new AWS['S3']({'accessKeyId':_0xa23888,'secretAccessKey':_0x18fbaa,'region':_0x3d5cb9});_0x5c3636[_0x7b8e('0x71')]({'Bucket':_0x24421b,'Key':_0x521afb,'Body':_0x4c5863},function(_0x240e67,_0x522251){if(_0x240e67){return _0x13d1c7(_0x240e67);}else{return _0x5b9f7c(_0x522251);}});});}function startTranscribe(_0x12cbd6,_0x33508c,_0x43214a,_0x57a405,_0xf0c709,_0x1a4e59){return new Promise(function(_0x12c327,_0x32b8a3){var _0x561dce=new AWS[(_0x7b8e('0x72'))]({'accessKeyId':_0x33508c,'secretAccessKey':_0x12cbd6,'region':_0x43214a});_0x561dce[_0x7b8e('0x73')]({'TranscriptionJobName':_0x57a405,'LanguageCode':_0xf0c709,'Media':{'MediaFileUri':_0x1a4e59}},function(_0x51b667,_0x43ac46){if(_0x51b667){return _0x32b8a3(_0x51b667);}else{return _0x12c327(_0x43ac46);}});});}function transcribe(_0x58878e,_0x39fa08,_0x256a66,_0x35cbd0,_0x33b20,_0x23f4f9,_0x1b1248){return new Promise(function(_0x533c2e,_0x218ee1){var _0x29923e={};logger[_0x7b8e('0x6a')](util[_0x7b8e('0x34')](_0x7b8e('0x74'),_0x58878e,_0x33b20));return uploadFile(_0x39fa08,_0x256a66,_0x35cbd0,_0x33b20,path[_0x7b8e('0x75')](_0x23f4f9),fs[_0x7b8e('0x76')](_0x23f4f9))[_0x7b8e('0x26')](function(_0x19eed3){logger['info'](util[_0x7b8e('0x34')](_0x7b8e('0x77'),_0x58878e,_0x33b20,_0x19eed3['Location']));_0x29923e[_0x7b8e('0x78')]=_0x19eed3['Bucket'];_0x29923e[_0x7b8e('0x79')]=_0x19eed3[_0x7b8e('0x7a')];logger[_0x7b8e('0x6a')](util[_0x7b8e('0x34')](_0x7b8e('0x7b'),_0x58878e));return startTranscribe(_0x39fa08,_0x256a66,_0x35cbd0,uuidv4(),_0x1b1248,_0x19eed3[_0x7b8e('0x7a')]);})[_0x7b8e('0x26')](function(_0x3fb0a0){logger[_0x7b8e('0x6a')](util['format'](_0x7b8e('0x7c'),_0x58878e,_0x3fb0a0[_0x7b8e('0x7d')][_0x7b8e('0x7e')]));_0x29923e[_0x7b8e('0x7f')]=_0x3fb0a0[_0x7b8e('0x7d')][_0x7b8e('0x7e')];_0x29923e[_0x7b8e('0x80')]=_0x3fb0a0[_0x7b8e('0x7d')][_0x7b8e('0x81')];return _0x533c2e(_0x29923e);})[_0x7b8e('0x49')](function(_0x396a39){return _0x218ee1(_0x396a39);});});}exports[_0x7b8e('0x82')]=function(_0x3b5d58,_0x5f1966,_0x4d5a5d){var _0x2ce487;var _0x272903;var _0x4cd4b3;var _0x3bcc86=require(_0x7b8e('0x60'));return db['VoiceRecording'][_0x7b8e('0x83')]({'where':{'id':_0x3b5d58['params']['id']}})[_0x7b8e('0x26')](function(_0x45204d){if(_0x45204d){var _0x4bead6=util[_0x7b8e('0x34')]('%s.cypher',_0x45204d[_0x7b8e('0x53')]);if(fs[_0x7b8e('0x55')](_0x4bead6)){cypher=!![];return _0x3bcc86[_0x7b8e('0x56')](_0x4bead6,_0x45204d[_0x7b8e('0x53')],config['secrets'][_0x7b8e('0x57')])[_0x7b8e('0x26')](function(){return _0x45204d;});}return _0x45204d;}})['then'](function(_0x58d7ab){if(!_0x58d7ab){throw new db[(_0x7b8e('0x67'))][(_0x7b8e('0x58'))](_0x7b8e('0x84'));}_0x272903=_0x58d7ab;return db[_0x7b8e('0x85')][_0x7b8e('0x83')]({'where':{'id':0x1}});})[_0x7b8e('0x26')](handleEntityNotFound(_0x5f1966,null))[_0x7b8e('0x26')](function(_0x1467f6){if(_0x1467f6){_0x2ce487=_0x1467f6;if(!_0x2ce487[_0x7b8e('0x86')]||!_0x2ce487[_0x7b8e('0x87')]||!_0x2ce487['transcribeRegion']||!_0x2ce487[_0x7b8e('0x88')]||!_0x2ce487[_0x7b8e('0x78')]){throw new db['Sequelize'][(_0x7b8e('0x58'))](_0x7b8e('0x89'));}if(_0x3b5d58[_0x7b8e('0x4f')][_0x7b8e('0x8a')]&&(!_0x2ce487[_0x7b8e('0x8b')]||!_0x2ce487['sentimentAccountId']||!_0x2ce487['sentimentRegion']||!_0x2ce487[_0x7b8e('0x88')]||!_0x2ce487[_0x7b8e('0x78')])){throw new db['Sequelize'][(_0x7b8e('0x58'))](_0x7b8e('0x8c'));}return db['CloudProvider'][_0x7b8e('0x83')]({'where':{'id':_0x2ce487[_0x7b8e('0x87')]}});}})[_0x7b8e('0x26')](function(_0x4be95c){if(!_0x4be95c){throw new db[(_0x7b8e('0x67'))][(_0x7b8e('0x58'))](_0x7b8e('0x8d'));}if(!_0x4be95c['data1']||!_0x4be95c[_0x7b8e('0x8e')]){throw new db[(_0x7b8e('0x67'))][(_0x7b8e('0x58'))](_0x7b8e('0x8f'));}_0x4cd4b3=_0x4be95c;return getBucketslist(_0x4cd4b3['data1'],_0x4cd4b3['data2'],_0x2ce487[_0x7b8e('0x90')]);})['then'](function(_0x328baa){if(_0x328baa&&_0x328baa['Buckets']){var _0x5a1233=_[_0x7b8e('0x50')](_0x328baa[_0x7b8e('0x91')],function(_0x579e19){return _0x579e19[_0x7b8e('0x92')]===_0x2ce487[_0x7b8e('0x78')];});if(!_0x5a1233){logger[_0x7b8e('0x6a')](util['format'](_0x7b8e('0x93'),_0x3b5d58[_0x7b8e('0x4b')]['id'],_0x2ce487[_0x7b8e('0x78')]));return createBucket(_0x4cd4b3[_0x7b8e('0x94')],_0x4cd4b3['data2'],_0x2ce487[_0x7b8e('0x90')],_0x2ce487[_0x7b8e('0x78')]);}logger[_0x7b8e('0x6a')](util[_0x7b8e('0x34')](_0x7b8e('0x95'),_0x3b5d58[_0x7b8e('0x4b')]['id'],_0x2ce487[_0x7b8e('0x78')]));return;}})[_0x7b8e('0x26')](function(_0x2a77fb){if(_0x272903[_0x7b8e('0x80')]==='NEW'){return transcribe(_0x3b5d58['params']['id'],_0x4cd4b3[_0x7b8e('0x94')],_0x4cd4b3['data2'],_0x2ce487['transcribeRegion'],_0x2ce487[_0x7b8e('0x78')],_0x272903[_0x7b8e('0x53')],_0x2ce487[_0x7b8e('0x88')]);}else{logger[_0x7b8e('0x6a')](util[_0x7b8e('0x34')](_0x7b8e('0x96'),_0x3b5d58[_0x7b8e('0x4b')]['id']));return{'transcribeStatus':_0x7b8e('0x97')};}})['then'](function(_0x126dac){if(_0x126dac){_0x126dac[_0x7b8e('0x98')]=_0x3b5d58[_0x7b8e('0x4f')]['runSentiment'];return _0x272903['updateAttributes'](_0x126dac);}})[_0x7b8e('0x26')](respondWithResult(_0x5f1966,null))[_0x7b8e('0x49')](handleError(_0x5f1966,null));};function writeFile(_0x558bb7,_0x14590c){return new Promise(function(_0xdee028,_0x5d6cd4){fs[_0x7b8e('0x99')](_0x14590c,_0x558bb7,function(_0x21e90a,_0x5bee7f){if(_0x21e90a){return _0x5d6cd4(_0x21e90a);}else{return _0xdee028(_0x5bee7f);}});});}exports[_0x7b8e('0x9a')]=function(_0x51e42a,_0x484bd5,_0x1a214c){return db[_0x7b8e('0x46')][_0x7b8e('0x83')]({'where':{'id':_0x51e42a[_0x7b8e('0x4b')]['id']}})[_0x7b8e('0x26')](handleEntityNotFound(_0x484bd5))[_0x7b8e('0x26')](function(_0xcfc27b){if(_0xcfc27b&&_0xcfc27b['fileText']){var _0x2dee12=_0xcfc27b['fileText'];var _0x2796b6=config['root']+_0x7b8e('0x9b')+_0xcfc27b['id']+_0x7b8e('0x9c');if(fs[_0x7b8e('0x55')](_0x2796b6)){return _0x2796b6;}return writeFile(_0x2dee12,_0x2796b6)[_0x7b8e('0x26')](function(){return _0x2796b6;});}else{throw new db['Sequelize'][(_0x7b8e('0x58'))](_0x7b8e('0x9d'));}})[_0x7b8e('0x26')](function(_0x3875eb){return _0x484bd5['download'](_0x3875eb);})[_0x7b8e('0x49')](handleError(_0x484bd5));};
\ No newline at end of file
+var _0x60cb=['../../components/parsers/advancedSearch','../../config/logger','../../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','index','map','VoiceRecording','rawAttributes','model','differenceBy','format','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','params','find','catch','create','body','download','../../components/encryptor','uniqueid','value','%s.cypher','secrets','recording','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','extname','unlink','Not\x20found','downloads','sequelize','MD5','col','token','$and','push','existsSync','isNil','info','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','File:\x20\x22','listBuckets','createBucket','upload','startTranscriptionJob','basename','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','bucket','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeStatus','TranscriptionJobStatus','runTranscribe','Voice\x20Recording\x20not\x20found','Setting','findOne','transcribe','transcribeAccountId','transcribeRegion','language','Transcribe\x20not\x20configured','runSentiment','sentiment','sentimentAccountId','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','Cloud\x20Provider\x20not\x20available','data2','Cloud\x20Provider\x20not\x20configured','Buckets','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','data1','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','IN_PROGRESS','tempSentiment','writeFile','downloadTranscribe','fileText','root','.txt','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','querystring','papaparse','aws-sdk','uuid/v4','ioredis','../../components/auth/service'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x60cb,0x81));var _0xb60c=function(_0x90a2f2,_0x2b2d10){_0x90a2f2=_0x90a2f2-0x0;var _0x3aa938=_0x60cb[_0x90a2f2];return _0x3aa938;};'use strict';var emlformat=require(_0xb60c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb60c('0x1'));var jsonpatch=require(_0xb60c('0x2'));var rp=require(_0xb60c('0x3'));var moment=require(_0xb60c('0x4'));var BPromise=require(_0xb60c('0x5'));var Mustache=require(_0xb60c('0x6'));var util=require('util');var path=require(_0xb60c('0x7'));var sox=require(_0xb60c('0x8'));var csv=require(_0xb60c('0x9'));var ejs=require(_0xb60c('0xa'));var fs=require('fs');var fs_extra=require(_0xb60c('0xb'));var _=require(_0xb60c('0xc'));var squel=require('squel');var crypto=require(_0xb60c('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xb60c('0x9'));var querystring=require(_0xb60c('0xe'));var Papa=require(_0xb60c('0xf'));var AWS=require(_0xb60c('0x10'));var uuidv4=require(_0xb60c('0x11'));var Redis=require(_0xb60c('0x12'));var authService=require(_0xb60c('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xb60c('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb60c('0x15'))('api');var utils=require('../../config/utils');var config=require(_0xb60c('0x16'));var licenseUtil=require(_0xb60c('0x17'));var db=require(_0xb60c('0x18'))['db'];function respondWithStatusCode(_0x53a83d,_0x6e06ae){_0x6e06ae=_0x6e06ae||0xcc;return function(_0x8873ec){if(_0x8873ec){return _0x53a83d[_0xb60c('0x19')](_0x6e06ae);}return _0x53a83d[_0xb60c('0x1a')](_0x6e06ae)['end']();};}function respondWithResult(_0x467d34,_0x58b63a){_0x58b63a=_0x58b63a||0xc8;return function(_0x43a8e3){if(_0x43a8e3){return _0x467d34[_0xb60c('0x1a')](_0x58b63a)[_0xb60c('0x1b')](_0x43a8e3);}};}function respondWithFilteredResult(_0x5226f8,_0x1f08be){return function(_0x1fbcf4){if(_0x1fbcf4){var _0x4f4eb3=typeof _0x1f08be[_0xb60c('0x1c')]===_0xb60c('0x1d')&&typeof _0x1f08be[_0xb60c('0x1e')]===_0xb60c('0x1d');var _0x2513c7=_0x1fbcf4[_0xb60c('0x1f')];var _0x13dc0c=_0x4f4eb3?0x0:_0x1f08be[_0xb60c('0x1c')];var _0x18366b=_0x4f4eb3?_0x1fbcf4[_0xb60c('0x1f')]:_0x1f08be[_0xb60c('0x1c')]+_0x1f08be['limit'];var _0x5ae2ae;if(_0x18366b>=_0x2513c7){_0x18366b=_0x2513c7;_0x5ae2ae=0xc8;}else{_0x5ae2ae=0xce;}_0x5226f8[_0xb60c('0x1a')](_0x5ae2ae);return _0x5226f8[_0xb60c('0x20')](_0xb60c('0x21'),_0x13dc0c+'-'+_0x18366b+'/'+_0x2513c7)['json'](_0x1fbcf4);}return null;};}function patchUpdates(_0xb774be){return function(_0x12e756){try{jsonpatch[_0xb60c('0x22')](_0x12e756,_0xb774be,!![]);}catch(_0x2484b2){return BPromise[_0xb60c('0x23')](_0x2484b2);}return _0x12e756[_0xb60c('0x24')]();};}function saveUpdates(_0x1af3cf,_0x556d27){return function(_0x4b0c9c){if(_0x4b0c9c){return _0x4b0c9c[_0xb60c('0x25')](_0x1af3cf)[_0xb60c('0x26')](function(_0x16e52f){return _0x16e52f;});}return null;};}function removeEntity(_0x3c0d7e,_0x2caea4){return function(_0x2ee952){if(_0x2ee952){return _0x2ee952[_0xb60c('0x27')]()[_0xb60c('0x26')](function(){_0x3c0d7e[_0xb60c('0x1a')](0xcc)[_0xb60c('0x28')]();});}};}function handleEntityNotFound(_0x2dfbe5,_0x414e2e){return function(_0x4f7966){if(!_0x4f7966){_0x2dfbe5['sendStatus'](0x194);}return _0x4f7966;};}function handleError(_0x585a0a,_0x4aa09b){_0x4aa09b=_0x4aa09b||0x1f4;return function(_0x358b06){logger['error'](_0x358b06[_0xb60c('0x29')]);if(_0x358b06[_0xb60c('0x2a')]){delete _0x358b06[_0xb60c('0x2a')];}_0x585a0a[_0xb60c('0x1a')](_0x4aa09b)[_0xb60c('0x2b')](_0x358b06);};}exports[_0xb60c('0x2c')]=function(_0x26192f,_0x4fc659){var _0x463c74={},_0x44650b={},_0x2e20c8={'count':0x0,'rows':[]};var _0x3888c5=_[_0xb60c('0x2d')](db[_0xb60c('0x2e')][_0xb60c('0x2f')],function(_0x2482ec){return{'name':_0x2482ec['fieldName'],'type':_0x2482ec['type']['key']};});_0x44650b[_0xb60c('0x30')]=_[_0xb60c('0x31')](_[_0xb60c('0x2d')](_0x3888c5,'name'),[_0xb60c('0x32')]);_0x44650b[_0xb60c('0x33')]=_[_0xb60c('0x34')](_0x26192f[_0xb60c('0x33')]);_0x44650b[_0xb60c('0x35')]=_[_0xb60c('0x36')](_0x44650b[_0xb60c('0x30')],_0x44650b[_0xb60c('0x33')]);_0x463c74[_0xb60c('0x37')]=_['intersection'](_0x44650b['model'],qs[_0xb60c('0x38')](_0x26192f[_0xb60c('0x33')][_0xb60c('0x38')]));_0x463c74['attributes']=_0x463c74[_0xb60c('0x37')][_0xb60c('0x39')]?_0x463c74[_0xb60c('0x37')]:_0x44650b['model'];if(!_0x26192f[_0xb60c('0x33')][_0xb60c('0x3a')](_0xb60c('0x3b'))){_0x463c74[_0xb60c('0x1e')]=qs[_0xb60c('0x1e')](_0x26192f[_0xb60c('0x33')][_0xb60c('0x1e')]);_0x463c74[_0xb60c('0x1c')]=qs[_0xb60c('0x1c')](_0x26192f[_0xb60c('0x33')]['offset']);}_0x463c74['order']=qs[_0xb60c('0x3c')](_0x26192f[_0xb60c('0x33')]['sort']);_0x463c74[_0xb60c('0x3d')]=qs[_0xb60c('0x35')](_[_0xb60c('0x3e')](_0x26192f[_0xb60c('0x33')],_0x44650b['filters']),_0x3888c5);if(_0x26192f[_0xb60c('0x33')][_0xb60c('0x3f')]){_0x463c74[_0xb60c('0x3d')]=_[_0xb60c('0x40')](_0x463c74[_0xb60c('0x3d')],{'$or':_[_0xb60c('0x2d')](_0x3888c5,function(_0x1d2162){if(_0x1d2162[_0xb60c('0x41')]!==_0xb60c('0x42')){var _0x332b13={};_0x332b13[_0x1d2162[_0xb60c('0x2a')]]={'$like':'%'+_0x26192f[_0xb60c('0x33')][_0xb60c('0x3f')]+'%'};return _0x332b13;}})});}_0x463c74=_[_0xb60c('0x40')]({},_0x463c74,_0x26192f[_0xb60c('0x43')]);var _0x317f9a={'where':_0x463c74['where']};return db[_0xb60c('0x2e')][_0xb60c('0x1f')](_0x317f9a)['then'](function(_0x88b935){_0x2e20c8[_0xb60c('0x1f')]=_0x88b935;if(_0x26192f['query'][_0xb60c('0x44')]){_0x463c74[_0xb60c('0x45')]=[{'all':!![]}];}return db[_0xb60c('0x2e')][_0xb60c('0x46')](_0x463c74);})[_0xb60c('0x26')](function(_0x391ed8){_0x2e20c8[_0xb60c('0x47')]=_0x391ed8;return _0x2e20c8;})[_0xb60c('0x26')](respondWithFilteredResult(_0x4fc659,_0x463c74))['catch'](handleError(_0x4fc659,null));};exports['show']=function(_0x4fd658,_0x27d24a){var _0x3896cf={'raw':![],'where':{'id':_0x4fd658[_0xb60c('0x48')]['id']}},_0x50dd9f={};_0x50dd9f[_0xb60c('0x30')]=_[_0xb60c('0x34')](db[_0xb60c('0x2e')]['rawAttributes']);_0x50dd9f[_0xb60c('0x33')]=_['keys'](_0x4fd658[_0xb60c('0x33')]);_0x50dd9f[_0xb60c('0x35')]=_[_0xb60c('0x36')](_0x50dd9f[_0xb60c('0x30')],_0x50dd9f[_0xb60c('0x33')]);_0x3896cf['attributes']=_[_0xb60c('0x36')](_0x50dd9f[_0xb60c('0x30')],qs['fields'](_0x4fd658[_0xb60c('0x33')][_0xb60c('0x38')]));_0x3896cf[_0xb60c('0x37')]=_0x3896cf[_0xb60c('0x37')][_0xb60c('0x39')]?_0x3896cf['attributes']:_0x50dd9f[_0xb60c('0x30')];if(_0x4fd658[_0xb60c('0x33')]['includeAll']){_0x3896cf['include']=[{'all':!![]}];}_0x3896cf=_[_0xb60c('0x40')]({},_0x3896cf,_0x4fd658[_0xb60c('0x43')]);return db['VoiceRecording'][_0xb60c('0x49')](_0x3896cf)[_0xb60c('0x26')](handleEntityNotFound(_0x27d24a,null))['then'](respondWithResult(_0x27d24a,null))[_0xb60c('0x4a')](handleError(_0x27d24a,null));};exports[_0xb60c('0x4b')]=function(_0xa8a33a,_0xbbdf28){return db['VoiceRecording'][_0xb60c('0x4b')](_0xa8a33a['body'],{})['then'](respondWithResult(_0xbbdf28,0xc9))[_0xb60c('0x4a')](handleError(_0xbbdf28,null));};exports[_0xb60c('0x25')]=function(_0x225a0f,_0x7e03b4){if(_0x225a0f[_0xb60c('0x4c')]['id']){delete _0x225a0f['body']['id'];}return db[_0xb60c('0x2e')][_0xb60c('0x49')]({'where':{'id':_0x225a0f['params']['id']}})[_0xb60c('0x26')](handleEntityNotFound(_0x7e03b4,null))[_0xb60c('0x26')](saveUpdates(_0x225a0f[_0xb60c('0x4c')],null))[_0xb60c('0x26')](respondWithResult(_0x7e03b4,null))[_0xb60c('0x4a')](handleError(_0x7e03b4,null));};exports['describe']=function(_0x1cb7f7,_0x593788){return db[_0xb60c('0x2e')]['describe']()[_0xb60c('0x26')](respondWithResult(_0x593788,null))[_0xb60c('0x4a')](handleError(_0x593788,null));};exports[_0xb60c('0x4d')]=function(_0x36b311,_0x75ec6d,_0x3a6ad2){var _0x226cec=require(_0xb60c('0x4e'));var _0x23202f=![];var _0x1369f5={};if(_0x36b311['query'][_0xb60c('0x41')]&&_0x36b311[_0xb60c('0x33')][_0xb60c('0x41')]===_0xb60c('0x4f')){_0x1369f5['uniqueid']=_0x36b311[_0xb60c('0x48')]['id'];}else{_0x1369f5['id']=_0x36b311[_0xb60c('0x48')]['id'];}return db[_0xb60c('0x2e')][_0xb60c('0x49')]({'where':_0x1369f5,'attributes':['id',_0xb60c('0x50')],'raw':!![]})[_0xb60c('0x26')](handleEntityNotFound(_0x75ec6d,null))[_0xb60c('0x26')](function(_0x55a41a){if(_0x55a41a){var _0x5d916a=_0x55a41a['value'];var _0x27e3fd=util[_0xb60c('0x32')](_0xb60c('0x51'),_0x5d916a);if(fs['existsSync'](_0x27e3fd)){_0x23202f=!![];return _0x226cec['decryptFile'](_0x27e3fd,_0x5d916a,config[_0xb60c('0x52')][_0xb60c('0x53')])['then'](function(){return _0x55a41a;});}return _0x55a41a;}})[_0xb60c('0x26')](function(_0x38f9ee){if(_0x38f9ee){var _0x31df1f=_0x38f9ee[_0xb60c('0x50')];if(!fs['existsSync'](_0x31df1f)){throw new db[(_0xb60c('0x54'))][(_0xb60c('0x55'))](_0xb60c('0x56'));}if(_0x38f9ee[_0xb60c('0x57')]){return _0x75ec6d[_0xb60c('0x4d')](_0x31df1f,_0x38f9ee['filename']+path[_0xb60c('0x58')](_0x31df1f),function(){if(_0x23202f){fs[_0xb60c('0x59')](_0x31df1f);}});}else{return _0x75ec6d[_0xb60c('0x4d')](_0x31df1f,function(_0x10fa9b){if(_0x23202f){fs['unlink'](_0x31df1f);}});}}})['catch'](function(_0x3b26df){if(_0x3b26df['message']===_0xb60c('0x56')){_0x75ec6d[_0xb60c('0x1a')](0x194)['send'](_0xb60c('0x5a'));}else{return handleError(_0x75ec6d,null);}});};exports[_0xb60c('0x5b')]=function(_0x7ee07d,_0x38494b,_0x15b9ee){var _0x3e8c0a=require(_0xb60c('0x4e'));var _0x1c30ca=![];var _0x42255e={'$and':[db[_0xb60c('0x5c')][_0xb60c('0x3d')](db[_0xb60c('0x5c')]['fn'](_0xb60c('0x5d'),db[_0xb60c('0x5c')][_0xb60c('0x5e')]('uniqueid')),_0x7ee07d[_0xb60c('0x33')][_0xb60c('0x5f')])]};if(_0x7ee07d['query'][_0xb60c('0x41')]&&_0x7ee07d['query']['type']===_0xb60c('0x4f')){_0x42255e[_0xb60c('0x60')][_0xb60c('0x61')]({'uniqueid':_0x7ee07d['params']['id']});}else{_0x42255e[_0xb60c('0x60')][_0xb60c('0x61')]({'id':_0x7ee07d[_0xb60c('0x48')]['id']});}return db[_0xb60c('0x2e')]['find']({'where':_0x42255e,'attributes':['id','value'],'raw':!![]})[_0xb60c('0x26')](handleEntityNotFound(_0x38494b,null))[_0xb60c('0x26')](function(_0xf087b7){if(_0xf087b7){var _0x1de341=util[_0xb60c('0x32')]('%s.cypher',_0xf087b7[_0xb60c('0x50')]);if(fs[_0xb60c('0x62')](_0x1de341)){_0x1c30ca=!![];return _0x3e8c0a['decryptFile'](_0x1de341,_0xf087b7['value'],config['secrets'][_0xb60c('0x53')])[_0xb60c('0x26')](function(){return _0xf087b7;});}return _0xf087b7;}})[_0xb60c('0x26')](function(_0x54ac07){if(_0x54ac07){if(!fs[_0xb60c('0x62')](_0x54ac07[_0xb60c('0x50')])){throw new db[(_0xb60c('0x54'))][(_0xb60c('0x55'))](_0xb60c('0x56'));}if(_0x54ac07[_0xb60c('0x57')]){return _0x38494b[_0xb60c('0x4d')](_0x54ac07['value'],_0x54ac07[_0xb60c('0x57')]+path[_0xb60c('0x58')](_0x54ac07[_0xb60c('0x50')]),function(){if(_0x1c30ca){fs[_0xb60c('0x59')](_0x54ac07[_0xb60c('0x50')]);}});}else{return _0x38494b[_0xb60c('0x4d')](_0x54ac07[_0xb60c('0x50')],function(_0xfb3cee){if(_0x1c30ca){fs[_0xb60c('0x59')](_0x54ac07[_0xb60c('0x50')]);}});}}})['catch'](handleError(_0x38494b,null));};exports[_0xb60c('0x27')]=function(_0xd597d7,_0x473d09){return db['VoiceRecording'][_0xb60c('0x49')]({'where':{'id':_0xd597d7[_0xb60c('0x48')]['id']}})[_0xb60c('0x26')](function(_0xdd9bcb){if(_[_0xb60c('0x63')](_0xdd9bcb)){throw new ReferenceError('Entity\x20not\x20found');}return _0xdd9bcb;})['then'](function(_0x2e6976){var _0x5aa3cb=_0x2e6976['value'];logger[_0xb60c('0x64')]('cancellazione\x20fisica\x20documento\x20%s',_0x5aa3cb);if(!_[_0xb60c('0x63')](_0x2e6976[_0xb60c('0x50')])&&fs[_0xb60c('0x62')](_0x5aa3cb)){logger[_0xb60c('0x64')]('File:\x20\x22'+_0x5aa3cb+_0xb60c('0x65'));fs['unlinkSync'](_0x5aa3cb);}_0x5aa3cb=_0x5aa3cb+_0xb60c('0x66');if(!_['isNil'](_0x2e6976[_0xb60c('0x50')])&&fs[_0xb60c('0x62')](_0x5aa3cb)){logger[_0xb60c('0x64')](_0xb60c('0x67')+_0x5aa3cb+_0xb60c('0x65'));fs['unlinkSync'](_0x5aa3cb);}return _0x2e6976;})['then'](function(_0x1c836d){if(!_0x1c836d)throw new InternalError();return _0x1c836d['destroy']();})[_0xb60c('0x26')](function(){_0x473d09[_0xb60c('0x1a')](0xcc)[_0xb60c('0x28')]();})[_0xb60c('0x4a')](handleError(_0x473d09,null));};function getBucketslist(_0x1c5d60,_0x1b8cc5,_0x56ac90){return new Promise(function(_0xdeddd,_0x114b4c){var _0x1d2943=new AWS['S3']({'accessKeyId':_0x1b8cc5,'secretAccessKey':_0x1c5d60,'region':_0x56ac90});_0x1d2943[_0xb60c('0x68')]({},function(_0x45e598,_0x4cfd4f){if(_0x45e598){return _0x114b4c(_0x45e598);}else{return _0xdeddd(_0x4cfd4f);}});});}function createBucket(_0x573580,_0xe09d5a,_0x9d22e8,_0x11c589){return new Promise(function(_0x1cdfc1,_0x1b5c07){var _0x2b7128=new AWS['S3']({'accessKeyId':_0xe09d5a,'secretAccessKey':_0x573580,'region':_0x9d22e8});_0x2b7128[_0xb60c('0x69')]({'Bucket':_0x11c589},function(_0x2e5bd1,_0x43efef){if(_0x2e5bd1){return _0x1b5c07(_0x2e5bd1);}else{return _0x1cdfc1(_0x43efef);}});});}function uploadFile(_0x5068a6,_0x971d2,_0x39b963,_0x2b1a94,_0x430324,_0x22debe){return new Promise(function(_0x36f9b9,_0x152b8e){var _0x1ce79d=new AWS['S3']({'accessKeyId':_0x971d2,'secretAccessKey':_0x5068a6,'region':_0x39b963});_0x1ce79d[_0xb60c('0x6a')]({'Bucket':_0x2b1a94,'Key':_0x430324,'Body':_0x22debe},function(_0x5f06b9,_0x2d2b93){if(_0x5f06b9){return _0x152b8e(_0x5f06b9);}else{return _0x36f9b9(_0x2d2b93);}});});}function startTranscribe(_0x694a43,_0x290028,_0x7a6946,_0x53d3f0,_0x4397f7,_0x2ca36f){return new Promise(function(_0x4c58c7,_0x4ecdd7){var _0x3fd81f=new AWS['TranscribeService']({'accessKeyId':_0x290028,'secretAccessKey':_0x694a43,'region':_0x7a6946});_0x3fd81f[_0xb60c('0x6b')]({'TranscriptionJobName':_0x53d3f0,'LanguageCode':_0x4397f7,'Media':{'MediaFileUri':_0x2ca36f}},function(_0x16399d,_0x5d86e8){if(_0x16399d){return _0x4ecdd7(_0x16399d);}else{return _0x4c58c7(_0x5d86e8);}});});}function transcribe(_0x2e7df1,_0x4aa1e7,_0x397d1d,_0xeb6ae1,_0x1d4e43,_0x57a4c7,_0x19079d){return new Promise(function(_0x294663,_0x263be4){var _0x150fd4={};logger[_0xb60c('0x64')](util['format']('[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s',_0x2e7df1,_0x1d4e43));return uploadFile(_0x4aa1e7,_0x397d1d,_0xeb6ae1,_0x1d4e43,path[_0xb60c('0x6c')](_0x57a4c7),fs[_0xb60c('0x6d')](_0x57a4c7))['then'](function(_0x1e078f){logger['info'](util[_0xb60c('0x32')](_0xb60c('0x6e'),_0x2e7df1,_0x1d4e43,_0x1e078f[_0xb60c('0x6f')]));_0x150fd4[_0xb60c('0x70')]=_0x1e078f['Bucket'];_0x150fd4[_0xb60c('0x71')]=_0x1e078f[_0xb60c('0x6f')];logger[_0xb60c('0x64')](util[_0xb60c('0x32')](_0xb60c('0x72'),_0x2e7df1));return startTranscribe(_0x4aa1e7,_0x397d1d,_0xeb6ae1,uuidv4(),_0x19079d,_0x1e078f[_0xb60c('0x6f')]);})[_0xb60c('0x26')](function(_0x245b37){logger[_0xb60c('0x64')](util['format'](_0xb60c('0x73'),_0x2e7df1,_0x245b37[_0xb60c('0x74')][_0xb60c('0x75')]));_0x150fd4['transcribeName']=_0x245b37[_0xb60c('0x74')]['TranscriptionJobName'];_0x150fd4[_0xb60c('0x76')]=_0x245b37[_0xb60c('0x74')][_0xb60c('0x77')];return _0x294663(_0x150fd4);})[_0xb60c('0x4a')](function(_0x46fb32){return _0x263be4(_0x46fb32);});});}exports[_0xb60c('0x78')]=function(_0x3248cd,_0x9f9a46,_0x4663e9){var _0x4c4a96;var _0x349c14;var _0x134aa7;var _0x5f24a4=require(_0xb60c('0x4e'));return db[_0xb60c('0x2e')]['findOne']({'where':{'id':_0x3248cd[_0xb60c('0x48')]['id']}})[_0xb60c('0x26')](function(_0x10c378){if(_0x10c378){var _0x14d43b=util[_0xb60c('0x32')](_0xb60c('0x51'),_0x10c378[_0xb60c('0x50')]);if(fs[_0xb60c('0x62')](_0x14d43b)){cypher=!![];return _0x5f24a4['decryptFile'](_0x14d43b,_0x10c378['value'],config[_0xb60c('0x52')][_0xb60c('0x53')])[_0xb60c('0x26')](function(){return _0x10c378;});}return _0x10c378;}})[_0xb60c('0x26')](function(_0x49144f){if(!_0x49144f){throw new db[(_0xb60c('0x54'))][(_0xb60c('0x55'))](_0xb60c('0x79'));}_0x349c14=_0x49144f;return db[_0xb60c('0x7a')][_0xb60c('0x7b')]({'where':{'id':0x1}});})[_0xb60c('0x26')](handleEntityNotFound(_0x9f9a46,null))[_0xb60c('0x26')](function(_0x297f0c){if(_0x297f0c){_0x4c4a96=_0x297f0c;if(!_0x4c4a96[_0xb60c('0x7c')]||!_0x4c4a96[_0xb60c('0x7d')]||!_0x4c4a96[_0xb60c('0x7e')]||!_0x4c4a96[_0xb60c('0x7f')]||!_0x4c4a96[_0xb60c('0x70')]){throw new db[(_0xb60c('0x54'))][(_0xb60c('0x55'))](_0xb60c('0x80'));}if(_0x3248cd['body'][_0xb60c('0x81')]&&(!_0x4c4a96[_0xb60c('0x82')]||!_0x4c4a96[_0xb60c('0x83')]||!_0x4c4a96[_0xb60c('0x84')]||!_0x4c4a96['language']||!_0x4c4a96[_0xb60c('0x70')])){throw new db[(_0xb60c('0x54'))]['ValidationError'](_0xb60c('0x85'));}return db['CloudProvider']['findOne']({'where':{'id':_0x4c4a96[_0xb60c('0x7d')]}});}})[_0xb60c('0x26')](function(_0x136172){if(!_0x136172){throw new db[(_0xb60c('0x54'))]['ValidationError'](_0xb60c('0x86'));}if(!_0x136172['data1']||!_0x136172[_0xb60c('0x87')]){throw new db['Sequelize'][(_0xb60c('0x55'))](_0xb60c('0x88'));}_0x134aa7=_0x136172;return getBucketslist(_0x134aa7['data1'],_0x134aa7[_0xb60c('0x87')],_0x4c4a96['transcribeRegion']);})['then'](function(_0x33b85e){if(_0x33b85e&&_0x33b85e[_0xb60c('0x89')]){var _0x4a0a52=_[_0xb60c('0x49')](_0x33b85e[_0xb60c('0x89')],function(_0x15e6e3){return _0x15e6e3['Name']===_0x4c4a96[_0xb60c('0x70')];});if(!_0x4a0a52){logger[_0xb60c('0x64')](util[_0xb60c('0x32')](_0xb60c('0x8a'),_0x3248cd[_0xb60c('0x48')]['id'],_0x4c4a96[_0xb60c('0x70')]));return createBucket(_0x134aa7[_0xb60c('0x8b')],_0x134aa7[_0xb60c('0x87')],_0x4c4a96[_0xb60c('0x7e')],_0x4c4a96['bucket']);}logger[_0xb60c('0x64')](util['format'](_0xb60c('0x8c'),_0x3248cd['params']['id'],_0x4c4a96[_0xb60c('0x70')]));return;}})[_0xb60c('0x26')](function(_0x2febb7){if(_0x349c14['transcribeStatus']===_0xb60c('0x8d')){return transcribe(_0x3248cd[_0xb60c('0x48')]['id'],_0x134aa7[_0xb60c('0x8b')],_0x134aa7[_0xb60c('0x87')],_0x4c4a96['transcribeRegion'],_0x4c4a96['bucket'],_0x349c14[_0xb60c('0x50')],_0x4c4a96[_0xb60c('0x7f')]);}else{logger[_0xb60c('0x64')](util[_0xb60c('0x32')]('[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested',_0x3248cd[_0xb60c('0x48')]['id']));return{'transcribeStatus':_0xb60c('0x8e')};}})[_0xb60c('0x26')](function(_0x1d0b74){if(_0x1d0b74){_0x1d0b74[_0xb60c('0x8f')]=_0x3248cd[_0xb60c('0x4c')]['runSentiment'];return _0x349c14['updateAttributes'](_0x1d0b74);}})[_0xb60c('0x26')](respondWithResult(_0x9f9a46,null))[_0xb60c('0x4a')](handleError(_0x9f9a46,null));};function writeFile(_0x4ee3cf,_0x4473ad){return new Promise(function(_0x3df8e1,_0x5aec8a){fs[_0xb60c('0x90')](_0x4473ad,_0x4ee3cf,function(_0x58d889,_0x153a84){if(_0x58d889){return _0x5aec8a(_0x58d889);}else{return _0x3df8e1(_0x153a84);}});});}exports[_0xb60c('0x91')]=function(_0x1ca24e,_0x589ad3,_0x3140ec){return db['VoiceRecording']['findOne']({'where':{'id':_0x1ca24e[_0xb60c('0x48')]['id']}})['then'](handleEntityNotFound(_0x589ad3))[_0xb60c('0x26')](function(_0x1023e5){if(_0x1023e5&&_0x1023e5[_0xb60c('0x92')]){var _0x5387cd=_0x1023e5[_0xb60c('0x92')];var _0x1ffd4a=config[_0xb60c('0x93')]+'/server/files/transcribes/transcribe_'+_0x1023e5['id']+_0xb60c('0x94');if(fs[_0xb60c('0x62')](_0x1ffd4a)){return _0x1ffd4a;}return writeFile(_0x5387cd,_0x1ffd4a)['then'](function(){return _0x1ffd4a;});}else{throw new db[(_0xb60c('0x54'))][(_0xb60c('0x55'))]('Transcript\x20not\x20available');}})[_0xb60c('0x26')](function(_0x438254){return _0x589ad3[_0xb60c('0x4d')](_0x438254);})[_0xb60c('0x4a')](handleError(_0x589ad3));};
\ No newline at end of file
index 272cef2..c3af289 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1c2f=['VoiceRecording','voice_recordings','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./voiceRecording.attributes','define'];(function(_0x17b66e,_0x5785b9){var _0x116c48=function(_0x4eb8e1){while(--_0x4eb8e1){_0x17b66e['push'](_0x17b66e['shift']());}};_0x116c48(++_0x5785b9);}(_0x1c2f,0x1c3));var _0xf1c2=function(_0x21ed77,_0x4c076d){_0x21ed77=_0x21ed77-0x0;var _0x32ab10=_0x1c2f[_0x21ed77];return _0x32ab10;};'use strict';var _=require(_0xf1c2('0x0'));var util=require(_0xf1c2('0x1'));var logger=require(_0xf1c2('0x2'))(_0xf1c2('0x3'));var moment=require(_0xf1c2('0x4'));var BPromise=require(_0xf1c2('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf1c2('0x6'));var rimraf=require(_0xf1c2('0x7'));var config=require(_0xf1c2('0x8'));var attributes=require(_0xf1c2('0x9'));module['exports']=function(_0x20d8cf,_0x4984aa){return _0x20d8cf[_0xf1c2('0xa')](_0xf1c2('0xb'),attributes,{'tableName':_0xf1c2('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xf1c2('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x46b7=['uniqueid','util','../../config/logger','api','moment','request-promise','path','rimraf','./voiceRecording.attributes','exports','define','VoiceRecording'];(function(_0x41a023,_0x3b570e){var _0x50f761=function(_0x17f518){while(--_0x17f518){_0x41a023['push'](_0x41a023['shift']());}};_0x50f761(++_0x3b570e);}(_0x46b7,0xa9));var _0x746b=function(_0x459c43,_0x3f1229){_0x459c43=_0x459c43-0x0;var _0x1d7e46=_0x46b7[_0x459c43];return _0x1d7e46;};'use strict';var _=require('lodash');var util=require(_0x746b('0x0'));var logger=require(_0x746b('0x1'))(_0x746b('0x2'));var moment=require(_0x746b('0x3'));var BPromise=require('bluebird');var rp=require(_0x746b('0x4'));var fs=require('fs');var path=require(_0x746b('0x5'));var rimraf=require(_0x746b('0x6'));var config=require('../../config/environment');var attributes=require(_0x746b('0x7'));module[_0x746b('0x8')]=function(_0x167839,_0x50b09e){return _0x167839[_0x746b('0x9')](_0x746b('0xa'),attributes,{'tableName':'voice_recordings','paranoid':![],'indexes':[{'name':_0x746b('0xb'),'fields':[_0x746b('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
index fbdb051..085a385 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaebd=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','message','VoiceRecording,\x20%s,\x20%s','catch','UpdateVoiceRecording','update','options','raw','where','attributes','debug','CreateVoiceRecording','Setting','findOne','callRecordingEncryption','VoiceRecording','create','body','value','format','%s.cypher','encryptFile','recording','unlink','lodash','moment','bluebird'];(function(_0x10dc60,_0x2fcce1){var _0x47dec5=function(_0x24b5e4){while(--_0x24b5e4){_0x10dc60['push'](_0x10dc60['shift']());}};_0x47dec5(++_0x2fcce1);}(_0xaebd,0x1e9));var _0xdaeb=function(_0x4583d3,_0x1fd408){_0x4583d3=_0x4583d3-0x0;var _0x21c991=_0xaebd[_0x4583d3];return _0x21c991;};'use strict';var _=require(_0xdaeb('0x0'));var util=require('util');var moment=require(_0xdaeb('0x1'));var BPromise=require(_0xdaeb('0x2'));var rs=require(_0xdaeb('0x3'));var fs=require('fs');var Redis=require(_0xdaeb('0x4'));var db=require(_0xdaeb('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xdaeb('0x6'))(_0xdaeb('0x7'));var config=require(_0xdaeb('0x8'));var jayson=require(_0xdaeb('0x9'));var client=jayson[_0xdaeb('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3ea090,_0x3f7ba1,_0x52c717){return new BPromise(function(_0x550bd9,_0x1b9d37){return client[_0xdaeb('0xb')](_0x3ea090,_0x52c717)[_0xdaeb('0xc')](function(_0x5e0ae9){logger[_0xdaeb('0xd')]('VoiceRecording,\x20%s,\x20%s',_0x3f7ba1,_0xdaeb('0xe'));logger['debug'](_0xdaeb('0xf'),_0x3f7ba1,'request\x20sent',JSON[_0xdaeb('0x10')](_0x5e0ae9));if(_0x5e0ae9[_0xdaeb('0x11')]){if(_0x5e0ae9['error']['code']===0x1f4){logger[_0xdaeb('0x11')]('VoiceRecording,\x20%s,\x20%s',_0x3f7ba1,_0x5e0ae9[_0xdaeb('0x11')][_0xdaeb('0x12')]);return _0x1b9d37(_0x5e0ae9[_0xdaeb('0x11')][_0xdaeb('0x12')]);}logger[_0xdaeb('0x11')](_0xdaeb('0x13'),_0x3f7ba1,_0x5e0ae9[_0xdaeb('0x11')]['message']);return _0x550bd9(_0x5e0ae9['error'][_0xdaeb('0x12')]);}else{logger[_0xdaeb('0xd')](_0xdaeb('0x13'),_0x3f7ba1,_0xdaeb('0xe'));_0x550bd9(_0x5e0ae9['result']['message']);}})[_0xdaeb('0x14')](function(_0x4dd803){logger['error'](_0xdaeb('0x13'),_0x3f7ba1,_0x4dd803);_0x1b9d37(_0x4dd803);});});}exports[_0xdaeb('0x15')]=function(_0x1b5243){var _0x1fe84e=this;return new Promise(function(_0x2d8f11,_0x36f9ac){return db['VoiceRecording'][_0xdaeb('0x16')](_0x1b5243['body'],{'raw':_0x1b5243[_0xdaeb('0x17')]?_0x1b5243[_0xdaeb('0x17')][_0xdaeb('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1b5243['options']?_0x1b5243['options'][_0xdaeb('0x19')]||null:null,'attributes':_0x1b5243[_0xdaeb('0x17')]?_0x1b5243[_0xdaeb('0x17')][_0xdaeb('0x1a')]||null:null,'limit':_0x1b5243[_0xdaeb('0x17')]?_0x1b5243['options']['limit']||null:null})[_0xdaeb('0xc')](function(_0x3cfcaf){logger[_0xdaeb('0xd')](_0xdaeb('0x15'),_0x1b5243);logger[_0xdaeb('0x1b')]('UpdateVoiceRecording',_0x1b5243,JSON[_0xdaeb('0x10')](_0x3cfcaf));_0x2d8f11(_0x3cfcaf);})['catch'](function(_0x130c35){logger[_0xdaeb('0x11')](_0xdaeb('0x15'),_0x130c35[_0xdaeb('0x12')],_0x1b5243);_0x36f9ac(_0x1fe84e[_0xdaeb('0x11')](0x1f4,_0x130c35['message']));});});};exports[_0xdaeb('0x1c')]=function(_0x34fa21){var _0x338687=this;return new Promise(function(_0x4eb719,_0x57c2c4){var _0x43095f=require('../../components/encryptor');var _0x5045f8;return db[_0xdaeb('0x1d')][_0xdaeb('0x1e')]({'attributes':['id',_0xdaeb('0x1f')],'where':{'id':0x1},'raw':!![]})['then'](function(_0x5e6f97){_0x5045f8=_0x5e6f97;return db[_0xdaeb('0x20')][_0xdaeb('0x21')](_0x34fa21[_0xdaeb('0x22')]);})['then'](function(_0x36c933){if(_0x5045f8['callRecordingEncryption']&&fs['existsSync'](_0x36c933[_0xdaeb('0x23')])){var _0x21f6cf=util[_0xdaeb('0x24')](_0xdaeb('0x25'),_0x36c933[_0xdaeb('0x23')]);return _0x43095f[_0xdaeb('0x26')](_0x36c933[_0xdaeb('0x23')],_0x21f6cf,config['secrets'][_0xdaeb('0x27')])[_0xdaeb('0xc')](function(){fs[_0xdaeb('0x28')](_0x36c933[_0xdaeb('0x23')]);logger[_0xdaeb('0xd')]('CreateVoiceRecording\x20file\x20encrypted');return _0x36c933;});}return _0x36c933;})[_0xdaeb('0xc')](function(_0x3de2bd){logger['info'](_0xdaeb('0x1c'),_0x34fa21);logger[_0xdaeb('0x1b')](_0xdaeb('0x1c'),_0x34fa21,JSON[_0xdaeb('0x10')](_0x3de2bd));_0x4eb719(_0x3de2bd);})[_0xdaeb('0x14')](function(_0x1628b8){logger[_0xdaeb('0x11')](_0xdaeb('0x1c'),_0x1628b8[_0xdaeb('0x12')],_0x34fa21);_0x57c2c4(_0x338687[_0xdaeb('0x11')](0x1f4,_0x1628b8['message']));});});};
\ No newline at end of file
+var _0xb145=['info','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','VoiceRecording,\x20%s,\x20%s','message','result','catch','VoiceRecording','update','body','options','where','attributes','limit','UpdateVoiceRecording','CreateVoiceRecording','../../components/encryptor','Setting','findOne','callRecordingEncryption','then','create','existsSync','format','value','encryptFile','recording','unlink','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xb145,0xa3));var _0x5b14=function(_0x4d602e,_0x6d47f2){_0x4d602e=_0x4d602e-0x0;var _0x529761=_0xb145[_0x4d602e];return _0x529761;};'use strict';var _=require('lodash');var util=require(_0x5b14('0x0'));var moment=require(_0x5b14('0x1'));var BPromise=require(_0x5b14('0x2'));var rs=require(_0x5b14('0x3'));var fs=require('fs');var Redis=require(_0x5b14('0x4'));var db=require(_0x5b14('0x5'))['db'];var utils=require(_0x5b14('0x6'));var logger=require(_0x5b14('0x7'))('rpc');var config=require(_0x5b14('0x8'));var jayson=require(_0x5b14('0x9'));var client=jayson[_0x5b14('0xa')][_0x5b14('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x50fd91,_0x1d12ed,_0x2a3921){return new BPromise(function(_0x34530a,_0x62cdcd){return client[_0x5b14('0xc')](_0x50fd91,_0x2a3921)['then'](function(_0x32d729){logger[_0x5b14('0xd')]('VoiceRecording,\x20%s,\x20%s',_0x1d12ed,_0x5b14('0xe'));logger[_0x5b14('0xf')](_0x5b14('0x10'),_0x1d12ed,_0x5b14('0xe'),JSON[_0x5b14('0x11')](_0x32d729));if(_0x32d729['error']){if(_0x32d729[_0x5b14('0x12')]['code']===0x1f4){logger[_0x5b14('0x12')](_0x5b14('0x13'),_0x1d12ed,_0x32d729[_0x5b14('0x12')][_0x5b14('0x14')]);return _0x62cdcd(_0x32d729[_0x5b14('0x12')][_0x5b14('0x14')]);}logger['error'](_0x5b14('0x13'),_0x1d12ed,_0x32d729[_0x5b14('0x12')][_0x5b14('0x14')]);return _0x34530a(_0x32d729[_0x5b14('0x12')][_0x5b14('0x14')]);}else{logger[_0x5b14('0xd')](_0x5b14('0x13'),_0x1d12ed,_0x5b14('0xe'));_0x34530a(_0x32d729[_0x5b14('0x15')][_0x5b14('0x14')]);}})[_0x5b14('0x16')](function(_0x2c3efb){logger['error'](_0x5b14('0x13'),_0x1d12ed,_0x2c3efb);_0x62cdcd(_0x2c3efb);});});}exports['UpdateVoiceRecording']=function(_0x48d395){var _0x58bf3c=this;return new Promise(function(_0x3f397d,_0x3035b5){return db[_0x5b14('0x17')][_0x5b14('0x18')](_0x48d395[_0x5b14('0x19')],{'raw':_0x48d395[_0x5b14('0x1a')]?_0x48d395[_0x5b14('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x48d395['options']?_0x48d395['options'][_0x5b14('0x1b')]||null:null,'attributes':_0x48d395[_0x5b14('0x1a')]?_0x48d395[_0x5b14('0x1a')][_0x5b14('0x1c')]||null:null,'limit':_0x48d395['options']?_0x48d395[_0x5b14('0x1a')][_0x5b14('0x1d')]||null:null})['then'](function(_0x2d7b38){logger[_0x5b14('0xd')]('UpdateVoiceRecording',_0x48d395);logger[_0x5b14('0xf')]('UpdateVoiceRecording',_0x48d395,JSON['stringify'](_0x2d7b38));_0x3f397d(_0x2d7b38);})['catch'](function(_0x4def4b){logger[_0x5b14('0x12')](_0x5b14('0x1e'),_0x4def4b[_0x5b14('0x14')],_0x48d395);_0x3035b5(_0x58bf3c['error'](0x1f4,_0x4def4b[_0x5b14('0x14')]));});});};exports[_0x5b14('0x1f')]=function(_0x2ac7b0){var _0x143648=this;return new Promise(function(_0xe6851b,_0x1bbbd7){var _0x422d22=require(_0x5b14('0x20'));var _0x296d65;return db[_0x5b14('0x21')][_0x5b14('0x22')]({'attributes':['id',_0x5b14('0x23')],'where':{'id':0x1},'raw':!![]})[_0x5b14('0x24')](function(_0x266bbe){_0x296d65=_0x266bbe;return db['VoiceRecording'][_0x5b14('0x25')](_0x2ac7b0[_0x5b14('0x19')]);})['then'](function(_0x4ecf7c){if(_0x296d65[_0x5b14('0x23')]&&fs[_0x5b14('0x26')](_0x4ecf7c['value'])){var _0x4c1f0e=util[_0x5b14('0x27')]('%s.cypher',_0x4ecf7c[_0x5b14('0x28')]);return _0x422d22[_0x5b14('0x29')](_0x4ecf7c['value'],_0x4c1f0e,config['secrets'][_0x5b14('0x2a')])[_0x5b14('0x24')](function(){fs[_0x5b14('0x2b')](_0x4ecf7c['value']);logger[_0x5b14('0xd')]('CreateVoiceRecording\x20file\x20encrypted');return _0x4ecf7c;});}return _0x4ecf7c;})[_0x5b14('0x24')](function(_0x291c92){logger[_0x5b14('0xd')](_0x5b14('0x1f'),_0x2ac7b0);logger['debug'](_0x5b14('0x1f'),_0x2ac7b0,JSON[_0x5b14('0x11')](_0x291c92));_0xe6851b(_0x291c92);})[_0x5b14('0x16')](function(_0x37f62c){logger['error'](_0x5b14('0x1f'),_0x37f62c[_0x5b14('0x14')],_0x2ac7b0);_0x1bbbd7(_0x143648[_0x5b14('0x12')](0x1f4,_0x37f62c['message']));});});};
\ No newline at end of file
index 26e76b1..af81474 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x67c0=['put','/:id','delete','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','get','isAuthenticated','index','describe','show','post','create'];(function(_0x26d6d9,_0x431cb8){var _0x1b4875=function(_0x41111f){while(--_0x41111f){_0x26d6d9['push'](_0x26d6d9['shift']());}};_0x1b4875(++_0x431cb8);}(_0x67c0,0xa4));var _0x067c=function(_0xecee39,_0x3536d4){_0xecee39=_0xecee39-0x0;var _0x2292cc=_0x67c0[_0xecee39];return _0x2292cc;};'use strict';var multer=require(_0x067c('0x0'));var util=require('util');var path=require(_0x067c('0x1'));var timeout=require('connect-timeout');var express=require(_0x067c('0x2'));var router=express[_0x067c('0x3')]();var fs_extra=require(_0x067c('0x4'));var auth=require(_0x067c('0x5'));var interaction=require(_0x067c('0x6'));var config=require(_0x067c('0x7'));var controller=require(_0x067c('0x8'));router[_0x067c('0x9')]('/',auth[_0x067c('0xa')](),controller[_0x067c('0xb')]);router[_0x067c('0x9')]('/describe',auth[_0x067c('0xa')](),controller[_0x067c('0xc')]);router['get']('/:id',auth[_0x067c('0xa')](),controller[_0x067c('0xd')]);router[_0x067c('0xe')]('/',auth['isAuthenticated'](),controller[_0x067c('0xf')]);router[_0x067c('0x10')](_0x067c('0x11'),auth[_0x067c('0xa')](),controller['update']);router[_0x067c('0x12')](_0x067c('0x11'),auth[_0x067c('0xa')](),controller[_0x067c('0x13')]);module['exports']=router;
\ No newline at end of file
+var _0x364c=['express','Router','fs-extra','../../components/auth/service','./voiceTransferReport.controller','get','/describe','isAuthenticated','describe','/:id','show','put','delete','multer','path'];(function(_0x44b533,_0x221c8d){var _0x42325b=function(_0x309350){while(--_0x309350){_0x44b533['push'](_0x44b533['shift']());}};_0x42325b(++_0x221c8d);}(_0x364c,0x157));var _0xc364=function(_0x535e36,_0x3b5960){_0x535e36=_0x535e36-0x0;var _0x30df15=_0x364c[_0x535e36];return _0x30df15;};'use strict';var multer=require(_0xc364('0x0'));var util=require('util');var path=require(_0xc364('0x1'));var timeout=require('connect-timeout');var express=require(_0xc364('0x2'));var router=express[_0xc364('0x3')]();var fs_extra=require(_0xc364('0x4'));var auth=require(_0xc364('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xc364('0x6'));router[_0xc364('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xc364('0x7')](_0xc364('0x8'),auth[_0xc364('0x9')](),controller[_0xc364('0xa')]);router[_0xc364('0x7')](_0xc364('0xb'),auth[_0xc364('0x9')](),controller[_0xc364('0xc')]);router['post']('/',auth[_0xc364('0x9')](),controller['create']);router[_0xc364('0xd')](_0xc364('0xb'),auth['isAuthenticated'](),controller['update']);router[_0xc364('0xe')](_0xc364('0xb'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 236fb80..9ce067b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1a17=['moment','ENUM','attended','STRING','Yes','sequelize'];(function(_0x428bf7,_0x122965){var _0x27341d=function(_0x7a77ce){while(--_0x7a77ce){_0x428bf7['push'](_0x428bf7['shift']());}};_0x27341d(++_0x122965);}(_0x1a17,0x1d9));var _0x71a1=function(_0x13131a,_0x4c5e8d){_0x13131a=_0x13131a-0x0;var _0x4b3753=_0x1a17[_0x13131a];return _0x4b3753;};'use strict';var Sequelize=require(_0x71a1('0x0'));var moment=require(_0x71a1('0x1'));module['exports']={'type':{'type':Sequelize[_0x71a1('0x2')]('blind',_0x71a1('0x3'))},'result':{'type':Sequelize['STRING']},'transfererchannel':{'type':Sequelize['STRING']},'transferercalleridnum':{'type':Sequelize[_0x71a1('0x4')]},'transferercalleridname':{'type':Sequelize[_0x71a1('0x4')]},'transfererconnectedlinenum':{'type':Sequelize['STRING']},'transfererconnectedlinename':{'type':Sequelize[_0x71a1('0x4')]},'transfereraccountcode':{'type':Sequelize[_0x71a1('0x4')]},'transferercontext':{'type':Sequelize[_0x71a1('0x4')]},'transfererexten':{'type':Sequelize[_0x71a1('0x4')]},'transfererlinkedid':{'type':Sequelize[_0x71a1('0x4')]},'transfereechannel':{'type':Sequelize[_0x71a1('0x4')]},'transfereecalleridnum':{'type':Sequelize[_0x71a1('0x4')]},'transfereecalleridname':{'type':Sequelize['STRING']},'transfereeconnectedlinenum':{'type':Sequelize['STRING']},'transfereeconnectedlinename':{'type':Sequelize[_0x71a1('0x4')]},'transfereeaccountcode':{'type':Sequelize[_0x71a1('0x4')]},'transfereecontext':{'type':Sequelize[_0x71a1('0x4')]},'transfereeexten':{'type':Sequelize[_0x71a1('0x4')]},'transfereelinkedid':{'type':Sequelize['STRING']},'isexternal':{'type':Sequelize['ENUM'](_0x71a1('0x5'),'No')},'context':{'type':Sequelize[_0x71a1('0x4')]},'extension':{'type':Sequelize[_0x71a1('0x4')]}};
\ No newline at end of file
+var _0x5658=['Yes','moment','ENUM','blind','attended','STRING'];(function(_0x3e733e,_0x57fffa){var _0x461d56=function(_0x23db86){while(--_0x23db86){_0x3e733e['push'](_0x3e733e['shift']());}};_0x461d56(++_0x57fffa);}(_0x5658,0x14b));var _0x8565=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x5658[_0x2c91e9];return _0x13f0ff;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x8565('0x0'));module['exports']={'type':{'type':Sequelize[_0x8565('0x1')](_0x8565('0x2'),_0x8565('0x3'))},'result':{'type':Sequelize[_0x8565('0x4')]},'transfererchannel':{'type':Sequelize[_0x8565('0x4')]},'transferercalleridnum':{'type':Sequelize[_0x8565('0x4')]},'transferercalleridname':{'type':Sequelize[_0x8565('0x4')]},'transfererconnectedlinenum':{'type':Sequelize['STRING']},'transfererconnectedlinename':{'type':Sequelize[_0x8565('0x4')]},'transfereraccountcode':{'type':Sequelize['STRING']},'transferercontext':{'type':Sequelize[_0x8565('0x4')]},'transfererexten':{'type':Sequelize[_0x8565('0x4')]},'transfererlinkedid':{'type':Sequelize[_0x8565('0x4')]},'transfereechannel':{'type':Sequelize['STRING']},'transfereecalleridnum':{'type':Sequelize[_0x8565('0x4')]},'transfereecalleridname':{'type':Sequelize[_0x8565('0x4')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x8565('0x4')]},'transfereeconnectedlinename':{'type':Sequelize[_0x8565('0x4')]},'transfereeaccountcode':{'type':Sequelize[_0x8565('0x4')]},'transfereecontext':{'type':Sequelize[_0x8565('0x4')]},'transfereeexten':{'type':Sequelize[_0x8565('0x4')]},'transfereelinkedid':{'type':Sequelize[_0x8565('0x4')]},'isexternal':{'type':Sequelize['ENUM'](_0x8565('0x5'),'No')},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize['STRING']}};
\ No newline at end of file
index eb81032..c29b00a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1b75=['undefined','count','set','Content-Range','apply','reject','save','update','then','end','stack','name','send','map','VoiceTransferReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','findAll','rows','catch','params','include','body','destroy','find','describe','eml-format','rimraf','zip-dir','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','sendStatus','status','json','offset','limit'];(function(_0x3bae81,_0x33037a){var _0x9c1072=function(_0x54e32a){while(--_0x54e32a){_0x3bae81['push'](_0x3bae81['shift']());}};_0x9c1072(++_0x33037a);}(_0x1b75,0x14e));var _0x51b7=function(_0x34c063,_0x11d3d7){_0x34c063=_0x34c063-0x0;var _0x2c63a3=_0x1b75[_0x34c063];return _0x2c63a3;};'use strict';var emlformat=require(_0x51b7('0x0'));var rimraf=require(_0x51b7('0x1'));var zipdir=require(_0x51b7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x51b7('0x3'));var Mustache=require('mustache');var util=require(_0x51b7('0x4'));var path=require('path');var sox=require(_0x51b7('0x5'));var csv=require(_0x51b7('0x6'));var ejs=require(_0x51b7('0x7'));var fs=require('fs');var fs_extra=require(_0x51b7('0x8'));var _=require(_0x51b7('0x9'));var squel=require('squel');var crypto=require(_0x51b7('0xa'));var jsforce=require(_0x51b7('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x51b7('0x6'));var querystring=require(_0x51b7('0xc'));var Papa=require(_0x51b7('0xd'));var Redis=require(_0x51b7('0xe'));var authService=require(_0x51b7('0xf'));var qs=require(_0x51b7('0x10'));var as=require(_0x51b7('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x51b7('0x12'))(_0x51b7('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x51b7('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3afef3,_0x409c25){_0x409c25=_0x409c25||0xcc;return function(_0x17cf6d){if(_0x17cf6d){return _0x3afef3[_0x51b7('0x15')](_0x409c25);}return _0x3afef3[_0x51b7('0x16')](_0x409c25)['end']();};}function respondWithResult(_0x3ebcb4,_0x4b17d0){_0x4b17d0=_0x4b17d0||0xc8;return function(_0x58d9b9){if(_0x58d9b9){return _0x3ebcb4[_0x51b7('0x16')](_0x4b17d0)[_0x51b7('0x17')](_0x58d9b9);}};}function respondWithFilteredResult(_0x40a1b1,_0x23b131){return function(_0x25c20e){if(_0x25c20e){var _0x4bb036=typeof _0x23b131[_0x51b7('0x18')]==='undefined'&&typeof _0x23b131[_0x51b7('0x19')]===_0x51b7('0x1a');var _0x2e46c8=_0x25c20e[_0x51b7('0x1b')];var _0x2ed254=_0x4bb036?0x0:_0x23b131[_0x51b7('0x18')];var _0xcdb11e=_0x4bb036?_0x25c20e[_0x51b7('0x1b')]:_0x23b131[_0x51b7('0x18')]+_0x23b131['limit'];var _0x17d678;if(_0xcdb11e>=_0x2e46c8){_0xcdb11e=_0x2e46c8;_0x17d678=0xc8;}else{_0x17d678=0xce;}_0x40a1b1['status'](_0x17d678);return _0x40a1b1[_0x51b7('0x1c')](_0x51b7('0x1d'),_0x2ed254+'-'+_0xcdb11e+'/'+_0x2e46c8)[_0x51b7('0x17')](_0x25c20e);}return null;};}function patchUpdates(_0x3d3553){return function(_0x2476e0){try{jsonpatch[_0x51b7('0x1e')](_0x2476e0,_0x3d3553,!![]);}catch(_0x1d4596){return BPromise[_0x51b7('0x1f')](_0x1d4596);}return _0x2476e0[_0x51b7('0x20')]();};}function saveUpdates(_0x323648,_0x3e6cd3){return function(_0x2cea35){if(_0x2cea35){return _0x2cea35[_0x51b7('0x21')](_0x323648)[_0x51b7('0x22')](function(_0x860c16){return _0x860c16;});}return null;};}function removeEntity(_0x5c6974,_0x1bb75b){return function(_0x308fc0){if(_0x308fc0){return _0x308fc0['destroy']()[_0x51b7('0x22')](function(){_0x5c6974[_0x51b7('0x16')](0xcc)[_0x51b7('0x23')]();});}};}function handleEntityNotFound(_0x23312d,_0x309489){return function(_0x333fe3){if(!_0x333fe3){_0x23312d[_0x51b7('0x15')](0x194);}return _0x333fe3;};}function handleError(_0x340f90,_0x252fb6){_0x252fb6=_0x252fb6||0x1f4;return function(_0x56e6aa){logger['error'](_0x56e6aa[_0x51b7('0x24')]);if(_0x56e6aa[_0x51b7('0x25')]){delete _0x56e6aa[_0x51b7('0x25')];}_0x340f90[_0x51b7('0x16')](_0x252fb6)[_0x51b7('0x26')](_0x56e6aa);};}exports['index']=function(_0x42a88,_0x37c3a2){var _0x4b3a88={},_0x2ff0e7={},_0x221000={'count':0x0,'rows':[]};var _0x4ea0e6=_[_0x51b7('0x27')](db[_0x51b7('0x28')][_0x51b7('0x29')],function(_0x4a494b){return{'name':_0x4a494b[_0x51b7('0x2a')],'type':_0x4a494b['type'][_0x51b7('0x2b')]};});_0x2ff0e7[_0x51b7('0x2c')]=_[_0x51b7('0x27')](_0x4ea0e6,'name');_0x2ff0e7[_0x51b7('0x2d')]=_[_0x51b7('0x2e')](_0x42a88[_0x51b7('0x2d')]);_0x2ff0e7[_0x51b7('0x2f')]=_[_0x51b7('0x30')](_0x2ff0e7[_0x51b7('0x2c')],_0x2ff0e7[_0x51b7('0x2d')]);_0x4b3a88['attributes']=_[_0x51b7('0x30')](_0x2ff0e7[_0x51b7('0x2c')],qs[_0x51b7('0x31')](_0x42a88[_0x51b7('0x2d')][_0x51b7('0x31')]));_0x4b3a88['attributes']=_0x4b3a88[_0x51b7('0x32')][_0x51b7('0x33')]?_0x4b3a88['attributes']:_0x2ff0e7['model'];if(!_0x42a88['query']['hasOwnProperty'](_0x51b7('0x34'))){_0x4b3a88[_0x51b7('0x19')]=qs[_0x51b7('0x19')](_0x42a88[_0x51b7('0x2d')][_0x51b7('0x19')]);_0x4b3a88[_0x51b7('0x18')]=qs[_0x51b7('0x18')](_0x42a88[_0x51b7('0x2d')][_0x51b7('0x18')]);}_0x4b3a88[_0x51b7('0x35')]=qs[_0x51b7('0x36')](_0x42a88[_0x51b7('0x2d')][_0x51b7('0x36')]);_0x4b3a88[_0x51b7('0x37')]=qs[_0x51b7('0x2f')](_[_0x51b7('0x38')](_0x42a88['query'],_0x2ff0e7[_0x51b7('0x2f')]),_0x4ea0e6);if(_0x42a88[_0x51b7('0x2d')][_0x51b7('0x39')]){_0x4b3a88[_0x51b7('0x37')]=_['merge'](_0x4b3a88[_0x51b7('0x37')],{'$or':_[_0x51b7('0x27')](_0x4ea0e6,function(_0x2ed6a6){if(_0x2ed6a6[_0x51b7('0x3a')]!==_0x51b7('0x3b')){var _0x16b1e5={};_0x16b1e5[_0x2ed6a6['name']]={'$like':'%'+_0x42a88[_0x51b7('0x2d')][_0x51b7('0x39')]+'%'};return _0x16b1e5;}})});}_0x4b3a88=_[_0x51b7('0x3c')]({},_0x4b3a88,_0x42a88[_0x51b7('0x3d')]);var _0x33429a={'where':_0x4b3a88[_0x51b7('0x37')]};return db[_0x51b7('0x28')][_0x51b7('0x1b')](_0x33429a)['then'](function(_0x4a95bf){_0x221000['count']=_0x4a95bf;if(_0x42a88['query'][_0x51b7('0x3e')]){_0x4b3a88['include']=[{'all':!![]}];}return db[_0x51b7('0x28')][_0x51b7('0x3f')](_0x4b3a88);})[_0x51b7('0x22')](function(_0x3c9389){_0x221000[_0x51b7('0x40')]=_0x3c9389;return _0x221000;})[_0x51b7('0x22')](respondWithFilteredResult(_0x37c3a2,_0x4b3a88))[_0x51b7('0x41')](handleError(_0x37c3a2,null));};exports['show']=function(_0x382576,_0x23ce04){var _0xeb5208={'raw':!![],'where':{'id':_0x382576[_0x51b7('0x42')]['id']}},_0x13c650={};_0x13c650[_0x51b7('0x2c')]=_[_0x51b7('0x2e')](db[_0x51b7('0x28')][_0x51b7('0x29')]);_0x13c650['query']=_[_0x51b7('0x2e')](_0x382576[_0x51b7('0x2d')]);_0x13c650[_0x51b7('0x2f')]=_[_0x51b7('0x30')](_0x13c650[_0x51b7('0x2c')],_0x13c650[_0x51b7('0x2d')]);_0xeb5208[_0x51b7('0x32')]=_['intersection'](_0x13c650[_0x51b7('0x2c')],qs[_0x51b7('0x31')](_0x382576['query'][_0x51b7('0x31')]));_0xeb5208[_0x51b7('0x32')]=_0xeb5208['attributes'][_0x51b7('0x33')]?_0xeb5208[_0x51b7('0x32')]:_0x13c650[_0x51b7('0x2c')];if(_0x382576['query']['includeAll']){_0xeb5208[_0x51b7('0x43')]=[{'all':!![]}];}_0xeb5208=_['merge']({},_0xeb5208,_0x382576[_0x51b7('0x3d')]);return db['VoiceTransferReport']['find'](_0xeb5208)[_0x51b7('0x22')](handleEntityNotFound(_0x23ce04,null))[_0x51b7('0x22')](respondWithResult(_0x23ce04,null))[_0x51b7('0x41')](handleError(_0x23ce04,null));};exports['create']=function(_0x36568e,_0x297e0b){return db[_0x51b7('0x28')]['create'](_0x36568e['body'],{})[_0x51b7('0x22')](respondWithResult(_0x297e0b,0xc9))[_0x51b7('0x41')](handleError(_0x297e0b,null));};exports['update']=function(_0x16e036,_0x59e2dc){if(_0x16e036[_0x51b7('0x44')]['id']){delete _0x16e036[_0x51b7('0x44')]['id'];}return db['VoiceTransferReport']['find']({'where':{'id':_0x16e036[_0x51b7('0x42')]['id']}})['then'](handleEntityNotFound(_0x59e2dc,null))[_0x51b7('0x22')](saveUpdates(_0x16e036[_0x51b7('0x44')],null))[_0x51b7('0x22')](respondWithResult(_0x59e2dc,null))['catch'](handleError(_0x59e2dc,null));};exports[_0x51b7('0x45')]=function(_0x4e8a49,_0x403024){return db[_0x51b7('0x28')][_0x51b7('0x46')]({'where':{'id':_0x4e8a49[_0x51b7('0x42')]['id']}})[_0x51b7('0x22')](handleEntityNotFound(_0x403024,null))['then'](removeEntity(_0x403024,null))['catch'](handleError(_0x403024,null));};exports['describe']=function(_0x2bbf8a,_0x5e0e00){return db[_0x51b7('0x28')][_0x51b7('0x47')]()[_0x51b7('0x22')](respondWithResult(_0x5e0e00,null))['catch'](handleError(_0x5e0e00,null));};
\ No newline at end of file
+var _0xd89c=['../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../mysqldb','status','end','json','offset','undefined','count','set','Content-Range','apply','save','update','then','destroy','sendStatus','name','send','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','merge','VIRTUAL','options','VoiceTransferReport','findAll','catch','show','params','includeAll','include','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs'];(function(_0x4e11d5,_0x1ce514){var _0x5e4e4c=function(_0xbee63d){while(--_0xbee63d){_0x4e11d5['push'](_0x4e11d5['shift']());}};_0x5e4e4c(++_0x1ce514);}(_0xd89c,0xd0));var _0xcd89=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0xd89c[_0x278e3c];return _0x3e2d9b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcd89('0x0'));var zipdir=require(_0xcd89('0x1'));var jsonpatch=require(_0xcd89('0x2'));var rp=require(_0xcd89('0x3'));var moment=require(_0xcd89('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xcd89('0x5'));var path=require(_0xcd89('0x6'));var sox=require(_0xcd89('0x7'));var csv=require(_0xcd89('0x8'));var ejs=require(_0xcd89('0x9'));var fs=require('fs');var fs_extra=require(_0xcd89('0xa'));var _=require(_0xcd89('0xb'));var squel=require(_0xcd89('0xc'));var crypto=require(_0xcd89('0xd'));var jsforce=require(_0xcd89('0xe'));var deskjs=require(_0xcd89('0xf'));var toCsv=require(_0xcd89('0x8'));var querystring=require(_0xcd89('0x10'));var Papa=require(_0xcd89('0x11'));var Redis=require(_0xcd89('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xcd89('0x13'));var as=require(_0xcd89('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcd89('0x15'))('api');var utils=require(_0xcd89('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xcd89('0x17'))['db'];function respondWithStatusCode(_0x19b734,_0x45e86a){_0x45e86a=_0x45e86a||0xcc;return function(_0x2ec5d4){if(_0x2ec5d4){return _0x19b734['sendStatus'](_0x45e86a);}return _0x19b734[_0xcd89('0x18')](_0x45e86a)[_0xcd89('0x19')]();};}function respondWithResult(_0x53d8d0,_0x3c8aab){_0x3c8aab=_0x3c8aab||0xc8;return function(_0x58b04a){if(_0x58b04a){return _0x53d8d0[_0xcd89('0x18')](_0x3c8aab)[_0xcd89('0x1a')](_0x58b04a);}};}function respondWithFilteredResult(_0x5d65e0,_0x1ffa28){return function(_0x465d4a){if(_0x465d4a){var _0x5c98e6=typeof _0x1ffa28[_0xcd89('0x1b')]===_0xcd89('0x1c')&&typeof _0x1ffa28['limit']===_0xcd89('0x1c');var _0x2004b9=_0x465d4a[_0xcd89('0x1d')];var _0x217b27=_0x5c98e6?0x0:_0x1ffa28['offset'];var _0x59aeaa=_0x5c98e6?_0x465d4a[_0xcd89('0x1d')]:_0x1ffa28[_0xcd89('0x1b')]+_0x1ffa28['limit'];var _0x5f579b;if(_0x59aeaa>=_0x2004b9){_0x59aeaa=_0x2004b9;_0x5f579b=0xc8;}else{_0x5f579b=0xce;}_0x5d65e0[_0xcd89('0x18')](_0x5f579b);return _0x5d65e0[_0xcd89('0x1e')](_0xcd89('0x1f'),_0x217b27+'-'+_0x59aeaa+'/'+_0x2004b9)[_0xcd89('0x1a')](_0x465d4a);}return null;};}function patchUpdates(_0x39267d){return function(_0x3f1bb7){try{jsonpatch[_0xcd89('0x20')](_0x3f1bb7,_0x39267d,!![]);}catch(_0x4a9fb0){return BPromise['reject'](_0x4a9fb0);}return _0x3f1bb7[_0xcd89('0x21')]();};}function saveUpdates(_0x4b165f,_0x51fe52){return function(_0x1c13f8){if(_0x1c13f8){return _0x1c13f8[_0xcd89('0x22')](_0x4b165f)[_0xcd89('0x23')](function(_0x1290bf){return _0x1290bf;});}return null;};}function removeEntity(_0x2012ee,_0x2642fd){return function(_0x4be909){if(_0x4be909){return _0x4be909[_0xcd89('0x24')]()[_0xcd89('0x23')](function(){_0x2012ee[_0xcd89('0x18')](0xcc)[_0xcd89('0x19')]();});}};}function handleEntityNotFound(_0x18c26a,_0x22349c){return function(_0x456d9f){if(!_0x456d9f){_0x18c26a[_0xcd89('0x25')](0x194);}return _0x456d9f;};}function handleError(_0x49ee96,_0x318a18){_0x318a18=_0x318a18||0x1f4;return function(_0x36616b){logger['error'](_0x36616b['stack']);if(_0x36616b['name']){delete _0x36616b[_0xcd89('0x26')];}_0x49ee96['status'](_0x318a18)[_0xcd89('0x27')](_0x36616b);};}exports[_0xcd89('0x28')]=function(_0x2679ef,_0x174013){var _0x107c10={},_0x5dec26={},_0x12cc5e={'count':0x0,'rows':[]};var _0x503fb5=_['map'](db['VoiceTransferReport'][_0xcd89('0x29')],function(_0x2b914b){return{'name':_0x2b914b[_0xcd89('0x2a')],'type':_0x2b914b[_0xcd89('0x2b')][_0xcd89('0x2c')]};});_0x5dec26[_0xcd89('0x2d')]=_[_0xcd89('0x2e')](_0x503fb5,_0xcd89('0x26'));_0x5dec26[_0xcd89('0x2f')]=_[_0xcd89('0x30')](_0x2679ef[_0xcd89('0x2f')]);_0x5dec26[_0xcd89('0x31')]=_[_0xcd89('0x32')](_0x5dec26[_0xcd89('0x2d')],_0x5dec26['query']);_0x107c10[_0xcd89('0x33')]=_[_0xcd89('0x32')](_0x5dec26[_0xcd89('0x2d')],qs[_0xcd89('0x34')](_0x2679ef[_0xcd89('0x2f')][_0xcd89('0x34')]));_0x107c10[_0xcd89('0x33')]=_0x107c10['attributes'][_0xcd89('0x35')]?_0x107c10['attributes']:_0x5dec26[_0xcd89('0x2d')];if(!_0x2679ef[_0xcd89('0x2f')][_0xcd89('0x36')](_0xcd89('0x37'))){_0x107c10[_0xcd89('0x38')]=qs[_0xcd89('0x38')](_0x2679ef[_0xcd89('0x2f')][_0xcd89('0x38')]);_0x107c10[_0xcd89('0x1b')]=qs[_0xcd89('0x1b')](_0x2679ef[_0xcd89('0x2f')][_0xcd89('0x1b')]);}_0x107c10[_0xcd89('0x39')]=qs[_0xcd89('0x3a')](_0x2679ef[_0xcd89('0x2f')][_0xcd89('0x3a')]);_0x107c10['where']=qs['filters'](_[_0xcd89('0x3b')](_0x2679ef['query'],_0x5dec26[_0xcd89('0x31')]),_0x503fb5);if(_0x2679ef[_0xcd89('0x2f')][_0xcd89('0x3c')]){_0x107c10[_0xcd89('0x3d')]=_[_0xcd89('0x3e')](_0x107c10['where'],{'$or':_['map'](_0x503fb5,function(_0x201767){if(_0x201767[_0xcd89('0x2b')]!==_0xcd89('0x3f')){var _0x12ac00={};_0x12ac00[_0x201767[_0xcd89('0x26')]]={'$like':'%'+_0x2679ef[_0xcd89('0x2f')][_0xcd89('0x3c')]+'%'};return _0x12ac00;}})});}_0x107c10=_[_0xcd89('0x3e')]({},_0x107c10,_0x2679ef[_0xcd89('0x40')]);var _0x5cc785={'where':_0x107c10[_0xcd89('0x3d')]};return db[_0xcd89('0x41')][_0xcd89('0x1d')](_0x5cc785)[_0xcd89('0x23')](function(_0x236276){_0x12cc5e[_0xcd89('0x1d')]=_0x236276;if(_0x2679ef[_0xcd89('0x2f')]['includeAll']){_0x107c10['include']=[{'all':!![]}];}return db[_0xcd89('0x41')][_0xcd89('0x42')](_0x107c10);})[_0xcd89('0x23')](function(_0x37b030){_0x12cc5e['rows']=_0x37b030;return _0x12cc5e;})[_0xcd89('0x23')](respondWithFilteredResult(_0x174013,_0x107c10))[_0xcd89('0x43')](handleError(_0x174013,null));};exports[_0xcd89('0x44')]=function(_0x58f8dd,_0x7b0e67){var _0xe2f627={'raw':!![],'where':{'id':_0x58f8dd[_0xcd89('0x45')]['id']}},_0x214aea={};_0x214aea[_0xcd89('0x2d')]=_[_0xcd89('0x30')](db[_0xcd89('0x41')]['rawAttributes']);_0x214aea[_0xcd89('0x2f')]=_[_0xcd89('0x30')](_0x58f8dd[_0xcd89('0x2f')]);_0x214aea['filters']=_[_0xcd89('0x32')](_0x214aea[_0xcd89('0x2d')],_0x214aea['query']);_0xe2f627[_0xcd89('0x33')]=_[_0xcd89('0x32')](_0x214aea[_0xcd89('0x2d')],qs[_0xcd89('0x34')](_0x58f8dd[_0xcd89('0x2f')][_0xcd89('0x34')]));_0xe2f627['attributes']=_0xe2f627[_0xcd89('0x33')]['length']?_0xe2f627['attributes']:_0x214aea[_0xcd89('0x2d')];if(_0x58f8dd[_0xcd89('0x2f')][_0xcd89('0x46')]){_0xe2f627[_0xcd89('0x47')]=[{'all':!![]}];}_0xe2f627=_['merge']({},_0xe2f627,_0x58f8dd[_0xcd89('0x40')]);return db[_0xcd89('0x41')][_0xcd89('0x48')](_0xe2f627)['then'](handleEntityNotFound(_0x7b0e67,null))[_0xcd89('0x23')](respondWithResult(_0x7b0e67,null))[_0xcd89('0x43')](handleError(_0x7b0e67,null));};exports[_0xcd89('0x49')]=function(_0x87df45,_0x5090b0){return db['VoiceTransferReport'][_0xcd89('0x49')](_0x87df45[_0xcd89('0x4a')],{})[_0xcd89('0x23')](respondWithResult(_0x5090b0,0xc9))[_0xcd89('0x43')](handleError(_0x5090b0,null));};exports[_0xcd89('0x22')]=function(_0x1c9f58,_0x15fe15){if(_0x1c9f58[_0xcd89('0x4a')]['id']){delete _0x1c9f58[_0xcd89('0x4a')]['id'];}return db['VoiceTransferReport'][_0xcd89('0x48')]({'where':{'id':_0x1c9f58[_0xcd89('0x45')]['id']}})['then'](handleEntityNotFound(_0x15fe15,null))[_0xcd89('0x23')](saveUpdates(_0x1c9f58[_0xcd89('0x4a')],null))[_0xcd89('0x23')](respondWithResult(_0x15fe15,null))[_0xcd89('0x43')](handleError(_0x15fe15,null));};exports[_0xcd89('0x24')]=function(_0x2227b7,_0xa06038){return db['VoiceTransferReport'][_0xcd89('0x48')]({'where':{'id':_0x2227b7[_0xcd89('0x45')]['id']}})[_0xcd89('0x23')](handleEntityNotFound(_0xa06038,null))[_0xcd89('0x23')](removeEntity(_0xa06038,null))[_0xcd89('0x43')](handleError(_0xa06038,null));};exports[_0xcd89('0x4b')]=function(_0x57c870,_0x583fbf){return db[_0xcd89('0x41')]['describe']()[_0xcd89('0x23')](respondWithResult(_0x583fbf,null))[_0xcd89('0x43')](handleError(_0x583fbf,null));};
\ No newline at end of file
index 9d621b5..c02f60c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4988=['bluebird','path','rimraf','../../config/environment','./voiceTransferReport.attributes','exports','define','VoiceTransferReport','report_call_transfer','lodash','../../config/logger','moment'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x4988,0x1ad));var _0x8498=function(_0x2f74aa,_0x1d58cb){_0x2f74aa=_0x2f74aa-0x0;var _0x5f59f6=_0x4988[_0x2f74aa];return _0x5f59f6;};'use strict';var _=require(_0x8498('0x0'));var util=require('util');var logger=require(_0x8498('0x1'))('api');var moment=require(_0x8498('0x2'));var BPromise=require(_0x8498('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8498('0x4'));var rimraf=require(_0x8498('0x5'));var config=require(_0x8498('0x6'));var attributes=require(_0x8498('0x7'));module[_0x8498('0x8')]=function(_0x58c44c,_0x34075d){return _0x58c44c[_0x8498('0x9')](_0x8498('0xa'),attributes,{'tableName':_0x8498('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x76ba=['moment','bluebird','path','../../config/environment','exports','define','report_call_transfer','lodash','util','../../config/logger','api'];(function(_0x4802b0,_0x1fe664){var _0xe38fea=function(_0x371ae9){while(--_0x371ae9){_0x4802b0['push'](_0x4802b0['shift']());}};_0xe38fea(++_0x1fe664);}(_0x76ba,0x1d5));var _0xa76b=function(_0x281515,_0xc37c63){_0x281515=_0x281515-0x0;var _0x522887=_0x76ba[_0x281515];return _0x522887;};'use strict';var _=require(_0xa76b('0x0'));var util=require(_0xa76b('0x1'));var logger=require(_0xa76b('0x2'))(_0xa76b('0x3'));var moment=require(_0xa76b('0x4'));var BPromise=require(_0xa76b('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa76b('0x6'));var rimraf=require('rimraf');var config=require(_0xa76b('0x7'));var attributes=require('./voiceTransferReport.attributes');module[_0xa76b('0x8')]=function(_0x2c55a6,_0x2bc805){return _0x2c55a6[_0xa76b('0x9')]('VoiceTransferReport',attributes,{'tableName':_0xa76b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 512bd8c..3df8a0b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8331=['create','body','options','raw','debug','stringify','catch','util','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','then','info','VoiceTransferReport,\x20%s,\x20%s','VoiceTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','CreateVoiceTransferReport'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x8331,0x16f));var _0x1833=function(_0xb6e2ea,_0x3b26e9){_0xb6e2ea=_0xb6e2ea-0x0;var _0x2a57bb=_0x8331[_0xb6e2ea];return _0x2a57bb;};'use strict';var _=require('lodash');var util=require(_0x1833('0x0'));var moment=require('moment');var BPromise=require(_0x1833('0x1'));var rs=require(_0x1833('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x1833('0x3'));var logger=require('../../config/logger')(_0x1833('0x4'));var config=require(_0x1833('0x5'));var jayson=require(_0x1833('0x6'));var client=jayson[_0x1833('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3516f5,_0x2d639d,_0x57255b){return new BPromise(function(_0x527d02,_0x3eb881){return client['request'](_0x3516f5,_0x57255b)[_0x1833('0x8')](function(_0x11ffb8){logger[_0x1833('0x9')](_0x1833('0xa'),_0x2d639d,'request\x20sent');logger['debug'](_0x1833('0xb'),_0x2d639d,_0x1833('0xc'),JSON['stringify'](_0x11ffb8));if(_0x11ffb8[_0x1833('0xd')]){if(_0x11ffb8[_0x1833('0xd')]['code']===0x1f4){logger[_0x1833('0xd')](_0x1833('0xa'),_0x2d639d,_0x11ffb8[_0x1833('0xd')]['message']);return _0x3eb881(_0x11ffb8[_0x1833('0xd')][_0x1833('0xe')]);}logger[_0x1833('0xd')](_0x1833('0xa'),_0x2d639d,_0x11ffb8[_0x1833('0xd')]['message']);return _0x527d02(_0x11ffb8['error'][_0x1833('0xe')]);}else{logger['info'](_0x1833('0xa'),_0x2d639d,_0x1833('0xc'));_0x527d02(_0x11ffb8[_0x1833('0xf')]['message']);}})['catch'](function(_0x3da635){logger[_0x1833('0xd')](_0x1833('0xa'),_0x2d639d,_0x3da635);_0x3eb881(_0x3da635);});});}exports[_0x1833('0x10')]=function(_0x5419c7){var _0x398d52=this;return new Promise(function(_0x170133,_0xd681b7){return db['VoiceTransferReport'][_0x1833('0x11')](_0x5419c7[_0x1833('0x12')],{'raw':_0x5419c7[_0x1833('0x13')]?_0x5419c7[_0x1833('0x13')][_0x1833('0x14')]===undefined?!![]:![]:!![]})[_0x1833('0x8')](function(_0x404bb5){logger[_0x1833('0x9')](_0x1833('0x10'),_0x5419c7);logger[_0x1833('0x15')](_0x1833('0x10'),_0x5419c7,JSON[_0x1833('0x16')](_0x404bb5));_0x170133(_0x404bb5);})[_0x1833('0x17')](function(_0x50e2e8){logger['error'](_0x1833('0x10'),_0x50e2e8[_0x1833('0xe')],_0x5419c7);_0xd681b7(_0x398d52[_0x1833('0xd')](0x1f4,_0x50e2e8['message']));});});};
\ No newline at end of file
+var _0xa1d7=['../../config/utils','jayson/promise','client','http','request','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','CreateVoiceTransferReport','VoiceTransferReport','create','body','options','then','debug','lodash','util','moment','bluebird','randomstring','../../mysqldb'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa1d7,0xfe));var _0x7a1d=function(_0x2642cb,_0x4b917f){_0x2642cb=_0x2642cb-0x0;var _0xe6e41=_0xa1d7[_0x2642cb];return _0xe6e41;};'use strict';var _=require(_0x7a1d('0x0'));var util=require(_0x7a1d('0x1'));var moment=require(_0x7a1d('0x2'));var BPromise=require(_0x7a1d('0x3'));var rs=require(_0x7a1d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7a1d('0x5'))['db'];var utils=require(_0x7a1d('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x7a1d('0x7'));var client=jayson[_0x7a1d('0x8')][_0x7a1d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x487b5f,_0x10f147,_0x316b62){return new BPromise(function(_0x11b964,_0xdac870){return client[_0x7a1d('0xa')](_0x487b5f,_0x316b62)['then'](function(_0x4fcd3f){logger['info'](_0x7a1d('0xb'),_0x10f147,_0x7a1d('0xc'));logger['debug']('VoiceTransferReport,\x20%s,\x20%s,\x20%s',_0x10f147,_0x7a1d('0xc'),JSON[_0x7a1d('0xd')](_0x4fcd3f));if(_0x4fcd3f[_0x7a1d('0xe')]){if(_0x4fcd3f['error'][_0x7a1d('0xf')]===0x1f4){logger[_0x7a1d('0xe')](_0x7a1d('0xb'),_0x10f147,_0x4fcd3f[_0x7a1d('0xe')][_0x7a1d('0x10')]);return _0xdac870(_0x4fcd3f[_0x7a1d('0xe')][_0x7a1d('0x10')]);}logger[_0x7a1d('0xe')]('VoiceTransferReport,\x20%s,\x20%s',_0x10f147,_0x4fcd3f['error'][_0x7a1d('0x10')]);return _0x11b964(_0x4fcd3f[_0x7a1d('0xe')][_0x7a1d('0x10')]);}else{logger[_0x7a1d('0x11')](_0x7a1d('0xb'),_0x10f147,'request\x20sent');_0x11b964(_0x4fcd3f['result'][_0x7a1d('0x10')]);}})[_0x7a1d('0x12')](function(_0xbea585){logger[_0x7a1d('0xe')](_0x7a1d('0xb'),_0x10f147,_0xbea585);_0xdac870(_0xbea585);});});}exports[_0x7a1d('0x13')]=function(_0x516f41){var _0x1fe8b1=this;return new Promise(function(_0x298364,_0x9d4c6){return db[_0x7a1d('0x14')][_0x7a1d('0x15')](_0x516f41[_0x7a1d('0x16')],{'raw':_0x516f41['options']?_0x516f41[_0x7a1d('0x17')]['raw']===undefined?!![]:![]:!![]})[_0x7a1d('0x18')](function(_0x264887){logger[_0x7a1d('0x11')](_0x7a1d('0x13'),_0x516f41);logger[_0x7a1d('0x19')](_0x7a1d('0x13'),_0x516f41,JSON[_0x7a1d('0xd')](_0x264887));_0x298364(_0x264887);})['catch'](function(_0x340e01){logger['error'](_0x7a1d('0x13'),_0x340e01[_0x7a1d('0x10')],_0x516f41);_0x9d4c6(_0x1fe8b1[_0x7a1d('0xe')](0x1f4,_0x340e01[_0x7a1d('0x10')]));});});};
\ No newline at end of file
index 3ee8587..df2b38d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['/transfer','transfer','exports','express','Router','../../components/auth/service','/originate','isWebrtcLicence','originate','post','/hangup','isAuthenticated','hangup','/answer','answer','hold','/unhold','calls'];(function(_0x13c27a,_0x352f6f){var _0x342ab5=function(_0x17af47){while(--_0x17af47){_0x13c27a['push'](_0x13c27a['shift']());}};_0x342ab5(++_0x352f6f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xa9e0[_0x484e36];return _0xafc85d;};'use strict';var express=require(_0x0a9e('0x0'));var router=express[_0x0a9e('0x1')]();var auth=require(_0x0a9e('0x2'));var controller=require('./webbar.controller');router['post'](_0x0a9e('0x3'),auth['isAuthenticated'](),auth[_0x0a9e('0x4')](),controller[_0x0a9e('0x5')]);router[_0x0a9e('0x6')](_0x0a9e('0x7'),auth[_0x0a9e('0x8')](),auth['isWebrtcLicence'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x6')](_0x0a9e('0xa'),auth['isAuthenticated'](),auth['isWebrtcLicence'](),controller[_0x0a9e('0xb')]);router['post']('/hold',auth[_0x0a9e('0x8')](),auth[_0x0a9e('0x4')](),controller[_0x0a9e('0xc')]);router[_0x0a9e('0x6')](_0x0a9e('0xd'),auth[_0x0a9e('0x8')](),auth['isWebrtcLicence'](),controller['unhold']);router['post']('/calls',auth[_0x0a9e('0x8')](),auth[_0x0a9e('0x4')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x6')](_0x0a9e('0xf'),auth[_0x0a9e('0x8')](),auth['isWebrtcLicence'](),controller[_0x0a9e('0x10')]);module[_0x0a9e('0x11')]=router;
\ No newline at end of file
+var _0xedd9=['unhold','/calls','calls','/transfer','exports','Router','../../components/auth/service','./webbar.controller','post','/originate','isAuthenticated','isWebrtcLicence','originate','/hangup','hangup','/answer','answer','/hold','/unhold'];(function(_0x34f0d8,_0x40a101){var _0x44f566=function(_0x1a4050){while(--_0x1a4050){_0x34f0d8['push'](_0x34f0d8['shift']());}};_0x44f566(++_0x40a101);}(_0xedd9,0xfc));var _0x9edd=function(_0x581c60,_0x371c9c){_0x581c60=_0x581c60-0x0;var _0x131aaf=_0xedd9[_0x581c60];return _0x131aaf;};'use strict';var express=require('express');var router=express[_0x9edd('0x0')]();var auth=require(_0x9edd('0x1'));var controller=require(_0x9edd('0x2'));router[_0x9edd('0x3')](_0x9edd('0x4'),auth[_0x9edd('0x5')](),auth[_0x9edd('0x6')](),controller[_0x9edd('0x7')]);router['post'](_0x9edd('0x8'),auth[_0x9edd('0x5')](),auth[_0x9edd('0x6')](),controller[_0x9edd('0x9')]);router['post'](_0x9edd('0xa'),auth['isAuthenticated'](),auth[_0x9edd('0x6')](),controller[_0x9edd('0xb')]);router[_0x9edd('0x3')](_0x9edd('0xc'),auth['isAuthenticated'](),auth[_0x9edd('0x6')](),controller['hold']);router[_0x9edd('0x3')](_0x9edd('0xd'),auth['isAuthenticated'](),auth[_0x9edd('0x6')](),controller[_0x9edd('0xe')]);router['post'](_0x9edd('0xf'),auth[_0x9edd('0x5')](),auth[_0x9edd('0x6')](),controller[_0x9edd('0x10')]);router[_0x9edd('0x3')](_0x9edd('0x11'),auth[_0x9edd('0x5')](),auth[_0x9edd('0x6')](),controller['transfer']);module[_0x9edd('0x12')]=router;
\ No newline at end of file
index c33b331..b7da4e4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x750a=['hold\x20fired:','webbar:hold','hold\x20executed!','unhold','unhold\x20fired:','webbar:unhold','calls\x20fired:','UserId','conference','conference\x20fired:','webbar:conference','conference\x20executed!','transfer\x20fired:','transferNumber','webbar:transfer','transfer\x20executed!','lodash','util','bluebird','jayson/promise','client','http','../../config/logger','webbarapi','ioredis','redis','defaults','localhost','socket.io-emitter','number','string','callNumber\x20is\x20required','sessionId\x20is\x20required','userId\x20is\x20required','emit','log','error','name','send','NotFound','code','message','result','catch','User','findOne','agent','then','all','filter','rows','sessionId','sessionId\x20','\x20not\x20found!','info','originate\x20fired:','body','validate','status','userId','callNumber','callerId','callbackUrl','format','user:%s','webbar:originate','json','hangup','hangup\x20fired:','length','webbar:hangup','answer\x20fired:','entityFound:','webbar:answer','answer\x20executed!','hold'];(function(_0xd0b91c,_0x483967){var _0xf915fe=function(_0x1bc5ad){while(--_0x1bc5ad){_0xd0b91c['push'](_0xd0b91c['shift']());}};_0xf915fe(++_0x483967);}(_0x750a,0x140));var _0xa750=function(_0x5e6cad,_0x27e3aa){_0x5e6cad=_0x5e6cad-0x0;var _0x18261e=_0x750a[_0x5e6cad];return _0x18261e;};'use strict';var path=require('path');var fs=require('fs');var _=require(_0xa750('0x0'));var db=require('../../mysqldb')['db'];var config=require('../../config/environment');var util=require(_0xa750('0x1'));var BPromise=require(_0xa750('0x2'));var jayson=require(_0xa750('0x3'));var amiClient=jayson[_0xa750('0x4')][_0xa750('0x5')]({'port':0x232a});var logger=require(_0xa750('0x6'))(_0xa750('0x7'));var Redis=require(_0xa750('0x8'));config[_0xa750('0x9')]=_[_0xa750('0xa')](config[_0xa750('0x9')],{'host':_0xa750('0xb'),'port':0x18eb});var io=require(_0xa750('0xc'))(new Redis(config['redis']));var Schema=require('validate');var originateValidation=new Schema({'userId':{'type':_0xa750('0xd'),'required':[!![],'userId\x20is\x20required']},'callNumber':{'type':_0xa750('0xe'),'required':[!![],_0xa750('0xf')]},'callerId':{'type':'string'},'callbackUrl':{'type':_0xa750('0xe')}});var hangupValidation=new Schema({'userId':{'type':_0xa750('0xd'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':'string','required':![]}});var answerValidation=new Schema({'userId':{'type':_0xa750('0xd'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xa750('0xe'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0xa750('0xd'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xa750('0xe'),'required':[!![],_0xa750('0x10')]},'transferNumber':{'type':_0xa750('0xe'),'required':[!![],'transferNumber\x20is\x20required']}});var holdValidation=new Schema({'userId':{'type':_0xa750('0xd'),'required':[!![],_0xa750('0x11')]},'sessionId':{'type':_0xa750('0xe'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0xa750('0xd'),'required':[!![],_0xa750('0x11')]},'sessionId':{'type':_0xa750('0xe'),'required':![]}});var callsValidation=new Schema({'userId':{'type':'number','required':[!![],_0xa750('0x11')]}});var conferenceValidation=new Schema({'userId':{'type':_0xa750('0xd'),'required':[!![],_0xa750('0x11')]}});function emit(_0x49fe3b,_0x337095,_0x29480c){logger['info'](_0x49fe3b,_0x337095,JSON['stringify'](_0x29480c));io['to'](_0x49fe3b)[_0xa750('0x12')](_0x337095,_0x29480c);}function handleError(_0x5b1e6b){return function(_0x433dbd){console[_0xa750('0x13')]('handleError:',_0x433dbd,_0x433dbd instanceof RangeError);logger[_0xa750('0x14')](_0x433dbd['stack']);if(_0x433dbd instanceof RangeError){if(_0x433dbd['name']){delete _0x433dbd[_0xa750('0x15')];}_0x5b1e6b['status'](0x194)[_0xa750('0x16')](_0x433dbd);}else{if(_0x433dbd['name']){delete _0x433dbd[_0xa750('0x15')];}_0x5b1e6b['status'](0x1f4)[_0xa750('0x16')](_0x433dbd);}};}function checkError(){return function(_0x500922){if(!_0x500922){throw new RangeError(_0xa750('0x17'));}return _0x500922;};}function respondWithRpcPromise(_0x4d1939,_0x52f166){return new BPromise(function(_0xaa9d3e,_0x52da84){var _0x216fbf=amiClient;return _0x216fbf['request'](_0x4d1939,_0x52f166)['then'](function(_0x5b433d){if(_0x5b433d['error']){if(_0x5b433d[_0xa750('0x14')][_0xa750('0x18')]===0x1f4){return _0x52da84(_0x5b433d[_0xa750('0x14')][_0xa750('0x19')]);}return _0xaa9d3e(_0x5b433d[_0xa750('0x14')][_0xa750('0x19')]);}else{_0xaa9d3e(_0x5b433d[_0xa750('0x1a')]);}})[_0xa750('0x1b')](function(_0x3d52b3){_0x52da84(_0x3d52b3);});});}function getAgent(_0x94697a){return db[_0xa750('0x1c')][_0xa750('0x1d')]({'where':{'id':_0x94697a,'role':_0xa750('0x1e')}})[_0xa750('0x1f')](checkError());}function getAgentCheckSession(_0x310e2d,_0x4ffff4){return new BPromise(function(_0x3d3923,_0x35dfc9){var _0x21cd2c=respondWithRpcPromise('VoiceChannels');var _0x35ab53=getAgent(_0x310e2d);Promise[_0xa750('0x20')]([_0x21cd2c,_0x35ab53])[_0xa750('0x1f')](function(_0x1223d2){var _0x579f1c=_0x1223d2[0x0];var _0x297eef=_0x1223d2[0x1];var _0x34d5e9=_[_0xa750('0x21')](_0x579f1c[_0xa750('0x22')],function(_0x2c5253){return _0x2c5253['UserId']==_0x297eef['id']&&_0x2c5253[_0xa750('0x23')]==_0x4ffff4;});if(_0x34d5e9['length']==0x1){_0x3d3923(_0x297eef);}else{_0x35dfc9(new RangeError(_0xa750('0x24')+_0x4ffff4+_0xa750('0x25')));}});});}exports['originate']=function(_0x8b5c2d,_0x6bc25d){logger[_0xa750('0x26')](_0xa750('0x27'),_0x8b5c2d[_0xa750('0x28')]);var _0xe59fe7=originateValidation[_0xa750('0x29')](_0x8b5c2d[_0xa750('0x28')]);if(_0xe59fe7['length']>0x0){return _0x6bc25d[_0xa750('0x2a')](0x190)['json'](_0xe59fe7);}var _0x18d040=_0x8b5c2d[_0xa750('0x28')][_0xa750('0x2b')];var _0x13465a=_0x8b5c2d['body'][_0xa750('0x2c')];var _0xa700fd=_0x8b5c2d['body'][_0xa750('0x2d')];var _0x330710=_0x8b5c2d[_0xa750('0x28')][_0xa750('0x2e')];return getAgent(_0x18d040)['then'](function(_0xf60128){logger['info']('entityFound:',_0xf60128[_0xa750('0x15')]);emit(util[_0xa750('0x2f')](_0xa750('0x30'),_0xf60128['name']),_0xa750('0x31'),{'callNumber':_0x13465a,'callerId':_0xa700fd,'callbackUrl':_0x330710});return _0x6bc25d[_0xa750('0x2a')](0xc8)[_0xa750('0x32')]({'error':![],'message':'originate\x20executed!'});})[_0xa750('0x1b')](handleError(_0x6bc25d));};exports[_0xa750('0x33')]=function(_0x3f3c41,_0x5d402a){logger[_0xa750('0x26')](_0xa750('0x34'),_0x3f3c41[_0xa750('0x28')]);var _0x4b6438=hangupValidation[_0xa750('0x29')](_0x3f3c41[_0xa750('0x28')]);if(_0x4b6438[_0xa750('0x35')]>0x0){return _0x5d402a[_0xa750('0x2a')](0x190)['json'](_0x4b6438);}var _0x4dc0b8=_0x3f3c41[_0xa750('0x28')][_0xa750('0x2b')];var _0x4c614d=_0x3f3c41[_0xa750('0x28')][_0xa750('0x23')];return getAgent(_0x4dc0b8)[_0xa750('0x1f')](function(_0x1166ff){logger[_0xa750('0x26')]('entityFound:',_0x1166ff[_0xa750('0x15')]);emit(util[_0xa750('0x2f')](_0xa750('0x30'),_0x1166ff[_0xa750('0x15')]),_0xa750('0x36'),{'sessionId':_0x4c614d});return _0x5d402a[_0xa750('0x2a')](0xc8)[_0xa750('0x32')]({'error':![],'message':'hangup\x20executed!'});})[_0xa750('0x1b')](handleError(_0x5d402a));};exports['answer']=function(_0x214fa0,_0x4ab922){logger[_0xa750('0x26')](_0xa750('0x37'),_0x214fa0[_0xa750('0x28')]);var _0x1be24e=answerValidation[_0xa750('0x29')](_0x214fa0[_0xa750('0x28')]);if(_0x1be24e[_0xa750('0x35')]>0x0){return _0x4ab922[_0xa750('0x2a')](0x190)[_0xa750('0x32')](_0x1be24e);}var _0x108a1a=_0x214fa0[_0xa750('0x28')][_0xa750('0x2b')];var _0x3ec860=_0x214fa0[_0xa750('0x28')][_0xa750('0x23')];return getAgent(_0x108a1a)[_0xa750('0x1f')](function(_0x25b82c){logger[_0xa750('0x26')](_0xa750('0x38'),_0x25b82c[_0xa750('0x15')]);emit(util['format'](_0xa750('0x30'),_0x25b82c[_0xa750('0x15')]),_0xa750('0x39'),{'sessionId':_0x3ec860});return _0x4ab922[_0xa750('0x2a')](0xc8)[_0xa750('0x32')]({'error':![],'message':_0xa750('0x3a')});})[_0xa750('0x1b')](handleError(_0x4ab922));};exports[_0xa750('0x3b')]=function(_0x3534b1,_0x5635b9){logger[_0xa750('0x26')](_0xa750('0x3c'),_0x3534b1['body']);var _0xb7d7e=holdValidation[_0xa750('0x29')](_0x3534b1[_0xa750('0x28')]);if(_0xb7d7e[_0xa750('0x35')]>0x0){return _0x5635b9[_0xa750('0x2a')](0x190)[_0xa750('0x32')](_0xb7d7e);}var _0x5e7a95=_0x3534b1[_0xa750('0x28')][_0xa750('0x2b')];var _0x6cd49f=_0x3534b1['body'][_0xa750('0x23')];return getAgent(_0x5e7a95)[_0xa750('0x1f')](function(_0x58afd2){logger[_0xa750('0x26')](_0xa750('0x38'),_0x58afd2[_0xa750('0x15')]);emit(util['format'](_0xa750('0x30'),_0x58afd2[_0xa750('0x15')]),_0xa750('0x3d'),{'sessionId':_0x6cd49f});return _0x5635b9[_0xa750('0x2a')](0xc8)['json']({'error':![],'message':_0xa750('0x3e')});})[_0xa750('0x1b')](handleError(_0x5635b9));};exports[_0xa750('0x3f')]=function(_0xed4f88,_0x4ce363){logger[_0xa750('0x26')](_0xa750('0x40'),_0xed4f88['body']);var _0x38aa35=unholdValidation['validate'](_0xed4f88[_0xa750('0x28')]);if(_0x38aa35[_0xa750('0x35')]>0x0){return _0x4ce363['status'](0x190)['json'](_0x38aa35);}var _0x58eba1=_0xed4f88[_0xa750('0x28')][_0xa750('0x2b')];var _0x4ea12b=_0xed4f88[_0xa750('0x28')][_0xa750('0x23')];return getAgent(_0x58eba1)[_0xa750('0x1f')](function(_0x5e69ea){logger['info']('entityFound:',_0x5e69ea['name']);emit(util[_0xa750('0x2f')]('user:%s',_0x5e69ea[_0xa750('0x15')]),_0xa750('0x41'),{'sessionId':_0x4ea12b});return _0x4ce363['status'](0xc8)[_0xa750('0x32')]({'error':![],'message':'unhold\x20executed!'});})[_0xa750('0x1b')](handleError(_0x4ce363));};exports['calls']=function(_0x54788d,_0x5940be){logger['info'](_0xa750('0x42'),_0x5940be[_0xa750('0x28')]);var _0x5f1313=callsValidation['validate'](_0x54788d['body']);if(_0x5f1313[_0xa750('0x35')]>0x0){return _0x5940be[_0xa750('0x2a')](0x190)[_0xa750('0x32')](_0x5f1313);}var _0x45a7da=_0x54788d[_0xa750('0x28')][_0xa750('0x2b')];var _0x599e7e=respondWithRpcPromise('VoiceChannels');var _0x440975=getAgent(_0x45a7da);return Promise[_0xa750('0x20')]([_0x599e7e,_0x440975])[_0xa750('0x1f')](function(_0x11163d){var _0xa8fe=_0x11163d[0x0];var _0x5a3cd5=_0x11163d[0x1];var _0x4030b3=_[_0xa750('0x21')](_0xa8fe[_0xa750('0x22')],function(_0x16b826){return _0x16b826[_0xa750('0x43')]==_0x5a3cd5['id'];});return _0x5940be[_0xa750('0x2a')](0xc8)[_0xa750('0x32')]({'count':_0x4030b3[_0xa750('0x35')],'rows':_0x4030b3});})['catch'](handleError(_0x5940be));};exports[_0xa750('0x44')]=function(_0x1c7713,_0x130297){logger[_0xa750('0x26')](_0xa750('0x45'),_0x1c7713['body']);var _0xcad347=conferenceValidation[_0xa750('0x29')](_0x1c7713[_0xa750('0x28')]);if(_0xcad347[_0xa750('0x35')]>0x0){return _0x130297[_0xa750('0x2a')](0x190)[_0xa750('0x32')](_0xcad347);}var _0x6053de=_0x1c7713[_0xa750('0x28')][_0xa750('0x2b')];return getAgent(_0x6053de)[_0xa750('0x1f')](function(_0x32fd6b){logger[_0xa750('0x26')](_0xa750('0x38'),_0x32fd6b[_0xa750('0x15')]);emit(util[_0xa750('0x2f')](_0xa750('0x30'),_0x32fd6b['name']),_0xa750('0x46'));return _0x130297['status'](0xc8)[_0xa750('0x32')]({'error':![],'message':_0xa750('0x47')});})[_0xa750('0x1b')](handleError(_0x130297));};exports['transfer']=function(_0x18c242,_0x2ed01a){logger[_0xa750('0x26')](_0xa750('0x48'),_0x18c242[_0xa750('0x28')]);var _0x278a58=transferValidation['validate'](_0x18c242[_0xa750('0x28')]);if(_0x278a58[_0xa750('0x35')]>0x0){return _0x2ed01a['status'](0x190)[_0xa750('0x32')](_0x278a58);}var _0x1bdc5e=_0x18c242[_0xa750('0x28')][_0xa750('0x2b')];var _0x3255c7=_0x18c242[_0xa750('0x28')][_0xa750('0x23')];var _0xc0b61b=_0x18c242[_0xa750('0x28')][_0xa750('0x49')];return getAgent(_0x1bdc5e)[_0xa750('0x1f')](function(_0x5d3ae2){logger['info'](_0xa750('0x38'),_0x5d3ae2[_0xa750('0x15')]);emit(util[_0xa750('0x2f')](_0xa750('0x30'),_0x5d3ae2['name']),_0xa750('0x4a'),{'sessionId':_0x3255c7,'transferNumber':_0xc0b61b});return _0x2ed01a[_0xa750('0x2a')](0xc8)[_0xa750('0x32')]({'error':![],'message':_0xa750('0x4b')});})[_0xa750('0x1b')](handleError(_0x2ed01a));};
\ No newline at end of file
+var _0x3667=['defaults','localhost','socket.io-emitter','validate','number','userId\x20is\x20required','string','callNumber\x20is\x20required','sessionId\x20is\x20required','transferNumber\x20is\x20required','info','stringify','emit','handleError:','stack','name','send','request','then','error','code','message','catch','User','agent','VoiceChannels','filter','rows','UserId','sessionId','originate\x20fired:','body','length','json','userId','callNumber','callerId','entityFound:','format','status','hangup\x20fired:','user:%s','webbar:answer','answer\x20executed!','hold','hold\x20fired:','hold\x20executed!','unhold','unhold\x20fired:','webbar:unhold','unhold\x20executed!','calls','calls\x20fired:','all','conference\x20fired:','conference\x20executed!','transfer','transfer\x20fired:','transferNumber','webbar:transfer','transfer\x20executed!','path','lodash','../../mysqldb','../../config/environment','util','jayson/promise','client','../../config/logger','webbarapi','ioredis','redis'];(function(_0xe3f3a5,_0x26955e){var _0x261ac5=function(_0x9ab524){while(--_0x9ab524){_0xe3f3a5['push'](_0xe3f3a5['shift']());}};_0x261ac5(++_0x26955e);}(_0x3667,0xcd));var _0x7366=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3667[_0x3dd15e];return _0x231fd0;};'use strict';var path=require(_0x7366('0x0'));var fs=require('fs');var _=require(_0x7366('0x1'));var db=require(_0x7366('0x2'))['db'];var config=require(_0x7366('0x3'));var util=require(_0x7366('0x4'));var BPromise=require('bluebird');var jayson=require(_0x7366('0x5'));var amiClient=jayson[_0x7366('0x6')]['http']({'port':0x232a});var logger=require(_0x7366('0x7'))(_0x7366('0x8'));var Redis=require(_0x7366('0x9'));config[_0x7366('0xa')]=_[_0x7366('0xb')](config['redis'],{'host':_0x7366('0xc'),'port':0x18eb});var io=require(_0x7366('0xd'))(new Redis(config[_0x7366('0xa')]));var Schema=require(_0x7366('0xe'));var originateValidation=new Schema({'userId':{'type':_0x7366('0xf'),'required':[!![],_0x7366('0x10')]},'callNumber':{'type':_0x7366('0x11'),'required':[!![],_0x7366('0x12')]},'callerId':{'type':_0x7366('0x11')},'callbackUrl':{'type':_0x7366('0x11')}});var hangupValidation=new Schema({'userId':{'type':_0x7366('0xf'),'required':[!![],_0x7366('0x10')]},'sessionId':{'type':_0x7366('0x11'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0x7366('0xf'),'required':[!![],_0x7366('0x10')]},'sessionId':{'type':_0x7366('0x11'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0x7366('0xf'),'required':[!![],_0x7366('0x10')]},'sessionId':{'type':_0x7366('0x11'),'required':[!![],_0x7366('0x13')]},'transferNumber':{'type':_0x7366('0x11'),'required':[!![],_0x7366('0x14')]}});var holdValidation=new Schema({'userId':{'type':_0x7366('0xf'),'required':[!![],_0x7366('0x10')]},'sessionId':{'type':_0x7366('0x11'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x7366('0xf'),'required':[!![],_0x7366('0x10')]},'sessionId':{'type':_0x7366('0x11'),'required':![]}});var callsValidation=new Schema({'userId':{'type':'number','required':[!![],_0x7366('0x10')]}});var conferenceValidation=new Schema({'userId':{'type':_0x7366('0xf'),'required':[!![],_0x7366('0x10')]}});function emit(_0x2c0422,_0xe2c87b,_0x431c01){logger[_0x7366('0x15')](_0x2c0422,_0xe2c87b,JSON[_0x7366('0x16')](_0x431c01));io['to'](_0x2c0422)[_0x7366('0x17')](_0xe2c87b,_0x431c01);}function handleError(_0x41113f){return function(_0x1a71f5){console['log'](_0x7366('0x18'),_0x1a71f5,_0x1a71f5 instanceof RangeError);logger['error'](_0x1a71f5[_0x7366('0x19')]);if(_0x1a71f5 instanceof RangeError){if(_0x1a71f5[_0x7366('0x1a')]){delete _0x1a71f5[_0x7366('0x1a')];}_0x41113f['status'](0x194)[_0x7366('0x1b')](_0x1a71f5);}else{if(_0x1a71f5[_0x7366('0x1a')]){delete _0x1a71f5[_0x7366('0x1a')];}_0x41113f['status'](0x1f4)[_0x7366('0x1b')](_0x1a71f5);}};}function checkError(){return function(_0x1946c6){if(!_0x1946c6){throw new RangeError('NotFound');}return _0x1946c6;};}function respondWithRpcPromise(_0x3bfbca,_0x411dfe){return new BPromise(function(_0xaab659,_0x1a12d2){var _0x3c30a2=amiClient;return _0x3c30a2[_0x7366('0x1c')](_0x3bfbca,_0x411dfe)[_0x7366('0x1d')](function(_0x22ed7e){if(_0x22ed7e[_0x7366('0x1e')]){if(_0x22ed7e[_0x7366('0x1e')][_0x7366('0x1f')]===0x1f4){return _0x1a12d2(_0x22ed7e[_0x7366('0x1e')][_0x7366('0x20')]);}return _0xaab659(_0x22ed7e['error'][_0x7366('0x20')]);}else{_0xaab659(_0x22ed7e['result']);}})[_0x7366('0x21')](function(_0x4ab987){_0x1a12d2(_0x4ab987);});});}function getAgent(_0x5e30fb){return db[_0x7366('0x22')]['findOne']({'where':{'id':_0x5e30fb,'role':_0x7366('0x23')}})['then'](checkError());}function getAgentCheckSession(_0x256633,_0x191177){return new BPromise(function(_0x5c37e2,_0x6d196a){var _0x565aa7=respondWithRpcPromise(_0x7366('0x24'));var _0x2b61af=getAgent(_0x256633);Promise['all']([_0x565aa7,_0x2b61af])[_0x7366('0x1d')](function(_0x507baf){var _0xc58ac7=_0x507baf[0x0];var _0x46f80f=_0x507baf[0x1];var _0x39d6ea=_[_0x7366('0x25')](_0xc58ac7[_0x7366('0x26')],function(_0x5e075c){return _0x5e075c[_0x7366('0x27')]==_0x46f80f['id']&&_0x5e075c[_0x7366('0x28')]==_0x191177;});if(_0x39d6ea['length']==0x1){_0x5c37e2(_0x46f80f);}else{_0x6d196a(new RangeError('sessionId\x20'+_0x191177+'\x20not\x20found!'));}});});}exports['originate']=function(_0x2a1d46,_0x43d487){logger[_0x7366('0x15')](_0x7366('0x29'),_0x2a1d46['body']);var _0x3ca5e6=originateValidation[_0x7366('0xe')](_0x2a1d46[_0x7366('0x2a')]);if(_0x3ca5e6[_0x7366('0x2b')]>0x0){return _0x43d487['status'](0x190)[_0x7366('0x2c')](_0x3ca5e6);}var _0x311dab=_0x2a1d46['body'][_0x7366('0x2d')];var _0x44c81e=_0x2a1d46[_0x7366('0x2a')][_0x7366('0x2e')];var _0x7779c7=_0x2a1d46[_0x7366('0x2a')][_0x7366('0x2f')];var _0x26858b=_0x2a1d46[_0x7366('0x2a')]['callbackUrl'];return getAgent(_0x311dab)[_0x7366('0x1d')](function(_0x83b879){logger['info'](_0x7366('0x30'),_0x83b879[_0x7366('0x1a')]);emit(util[_0x7366('0x31')]('user:%s',_0x83b879[_0x7366('0x1a')]),'webbar:originate',{'callNumber':_0x44c81e,'callerId':_0x7779c7,'callbackUrl':_0x26858b});return _0x43d487[_0x7366('0x32')](0xc8)['json']({'error':![],'message':'originate\x20executed!'});})[_0x7366('0x21')](handleError(_0x43d487));};exports['hangup']=function(_0x3228b5,_0x116081){logger['info'](_0x7366('0x33'),_0x3228b5['body']);var _0x36f861=hangupValidation[_0x7366('0xe')](_0x3228b5[_0x7366('0x2a')]);if(_0x36f861[_0x7366('0x2b')]>0x0){return _0x116081['status'](0x190)[_0x7366('0x2c')](_0x36f861);}var _0x1d8be3=_0x3228b5[_0x7366('0x2a')]['userId'];var _0x487e36=_0x3228b5[_0x7366('0x2a')][_0x7366('0x28')];return getAgent(_0x1d8be3)[_0x7366('0x1d')](function(_0x18e9b1){logger[_0x7366('0x15')](_0x7366('0x30'),_0x18e9b1['name']);emit(util['format'](_0x7366('0x34'),_0x18e9b1[_0x7366('0x1a')]),'webbar:hangup',{'sessionId':_0x487e36});return _0x116081[_0x7366('0x32')](0xc8)[_0x7366('0x2c')]({'error':![],'message':'hangup\x20executed!'});})[_0x7366('0x21')](handleError(_0x116081));};exports['answer']=function(_0xafac5,_0x1834cf){logger['info']('answer\x20fired:',_0xafac5[_0x7366('0x2a')]);var _0xedc3c7=answerValidation[_0x7366('0xe')](_0xafac5[_0x7366('0x2a')]);if(_0xedc3c7['length']>0x0){return _0x1834cf[_0x7366('0x32')](0x190)[_0x7366('0x2c')](_0xedc3c7);}var _0xb9d7e4=_0xafac5[_0x7366('0x2a')][_0x7366('0x2d')];var _0x3d8c79=_0xafac5[_0x7366('0x2a')]['sessionId'];return getAgent(_0xb9d7e4)[_0x7366('0x1d')](function(_0x320fc2){logger[_0x7366('0x15')]('entityFound:',_0x320fc2[_0x7366('0x1a')]);emit(util[_0x7366('0x31')]('user:%s',_0x320fc2[_0x7366('0x1a')]),_0x7366('0x35'),{'sessionId':_0x3d8c79});return _0x1834cf[_0x7366('0x32')](0xc8)['json']({'error':![],'message':_0x7366('0x36')});})[_0x7366('0x21')](handleError(_0x1834cf));};exports[_0x7366('0x37')]=function(_0x570459,_0x37b251){logger[_0x7366('0x15')](_0x7366('0x38'),_0x570459['body']);var _0xb32e28=holdValidation[_0x7366('0xe')](_0x570459[_0x7366('0x2a')]);if(_0xb32e28[_0x7366('0x2b')]>0x0){return _0x37b251['status'](0x190)[_0x7366('0x2c')](_0xb32e28);}var _0x2d1c52=_0x570459[_0x7366('0x2a')][_0x7366('0x2d')];var _0x3cf180=_0x570459[_0x7366('0x2a')][_0x7366('0x28')];return getAgent(_0x2d1c52)[_0x7366('0x1d')](function(_0x2ad8bf){logger['info'](_0x7366('0x30'),_0x2ad8bf[_0x7366('0x1a')]);emit(util['format'](_0x7366('0x34'),_0x2ad8bf[_0x7366('0x1a')]),'webbar:hold',{'sessionId':_0x3cf180});return _0x37b251[_0x7366('0x32')](0xc8)['json']({'error':![],'message':_0x7366('0x39')});})[_0x7366('0x21')](handleError(_0x37b251));};exports[_0x7366('0x3a')]=function(_0x22026a,_0x588b31){logger[_0x7366('0x15')](_0x7366('0x3b'),_0x22026a[_0x7366('0x2a')]);var _0x46a532=unholdValidation[_0x7366('0xe')](_0x22026a[_0x7366('0x2a')]);if(_0x46a532[_0x7366('0x2b')]>0x0){return _0x588b31[_0x7366('0x32')](0x190)[_0x7366('0x2c')](_0x46a532);}var _0x336b4d=_0x22026a[_0x7366('0x2a')][_0x7366('0x2d')];var _0x5d2a2c=_0x22026a[_0x7366('0x2a')]['sessionId'];return getAgent(_0x336b4d)['then'](function(_0x1d488b){logger[_0x7366('0x15')]('entityFound:',_0x1d488b[_0x7366('0x1a')]);emit(util[_0x7366('0x31')]('user:%s',_0x1d488b['name']),_0x7366('0x3c'),{'sessionId':_0x5d2a2c});return _0x588b31['status'](0xc8)[_0x7366('0x2c')]({'error':![],'message':_0x7366('0x3d')});})['catch'](handleError(_0x588b31));};exports[_0x7366('0x3e')]=function(_0x1b3923,_0xcce4ef){logger['info'](_0x7366('0x3f'),_0xcce4ef[_0x7366('0x2a')]);var _0x2ca931=callsValidation[_0x7366('0xe')](_0x1b3923['body']);if(_0x2ca931[_0x7366('0x2b')]>0x0){return _0xcce4ef[_0x7366('0x32')](0x190)[_0x7366('0x2c')](_0x2ca931);}var _0xa15c2b=_0x1b3923[_0x7366('0x2a')]['userId'];var _0x1249a7=respondWithRpcPromise(_0x7366('0x24'));var _0x5b3160=getAgent(_0xa15c2b);return Promise[_0x7366('0x40')]([_0x1249a7,_0x5b3160])['then'](function(_0x2335cc){var _0x5cbefc=_0x2335cc[0x0];var _0x427066=_0x2335cc[0x1];var _0x16d438=_['filter'](_0x5cbefc[_0x7366('0x26')],function(_0xec468a){return _0xec468a[_0x7366('0x27')]==_0x427066['id'];});return _0xcce4ef[_0x7366('0x32')](0xc8)['json']({'count':_0x16d438['length'],'rows':_0x16d438});})[_0x7366('0x21')](handleError(_0xcce4ef));};exports['conference']=function(_0x432755,_0x14f758){logger[_0x7366('0x15')](_0x7366('0x41'),_0x432755[_0x7366('0x2a')]);var _0x3e64b7=conferenceValidation[_0x7366('0xe')](_0x432755[_0x7366('0x2a')]);if(_0x3e64b7[_0x7366('0x2b')]>0x0){return _0x14f758['status'](0x190)[_0x7366('0x2c')](_0x3e64b7);}var _0x52d254=_0x432755['body']['userId'];return getAgent(_0x52d254)[_0x7366('0x1d')](function(_0x523016){logger[_0x7366('0x15')]('entityFound:',_0x523016[_0x7366('0x1a')]);emit(util['format'](_0x7366('0x34'),_0x523016[_0x7366('0x1a')]),'webbar:conference');return _0x14f758['status'](0xc8)[_0x7366('0x2c')]({'error':![],'message':_0x7366('0x42')});})[_0x7366('0x21')](handleError(_0x14f758));};exports[_0x7366('0x43')]=function(_0x5dc9e2,_0x349bd2){logger[_0x7366('0x15')](_0x7366('0x44'),_0x5dc9e2['body']);var _0x5a9aeb=transferValidation[_0x7366('0xe')](_0x5dc9e2[_0x7366('0x2a')]);if(_0x5a9aeb[_0x7366('0x2b')]>0x0){return _0x349bd2['status'](0x190)[_0x7366('0x2c')](_0x5a9aeb);}var _0x1e121f=_0x5dc9e2[_0x7366('0x2a')][_0x7366('0x2d')];var _0x3aa57b=_0x5dc9e2[_0x7366('0x2a')][_0x7366('0x28')];var _0x38c65b=_0x5dc9e2[_0x7366('0x2a')][_0x7366('0x45')];return getAgent(_0x1e121f)[_0x7366('0x1d')](function(_0x5d5c2e){logger[_0x7366('0x15')](_0x7366('0x30'),_0x5d5c2e['name']);emit(util[_0x7366('0x31')]('user:%s',_0x5d5c2e['name']),_0x7366('0x46'),{'sessionId':_0x3aa57b,'transferNumber':_0x38c65b});return _0x349bd2[_0x7366('0x32')](0xc8)[_0x7366('0x2c')]({'error':![],'message':_0x7366('0x47')});})[_0x7366('0x21')](handleError(_0x349bd2));};
\ No newline at end of file
index 1f72989..6b455e1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-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(_0x1a1b6e,_0x3a07a9){var _0x571e2c=function(_0x6cea62){while(--_0x6cea62){_0x1a1b6e['push'](_0x1a1b6e['shift']());}};_0x571e2c(++_0x3a07a9);}(_0x430c,0x1a1));var _0xc430=function(_0x1709e7,_0x2ced21){_0x1709e7=_0x1709e7-0x0;var _0x402819=_0x430c[_0x1709e7];return _0x402819;};'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
+var _0x524e=['index','/describe','describe','/:id','isAuthenticated','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/users','/:id/applications','getApplications','post','addDisposition','addAnswer','addApplications','/:id/notify','notify','/:id/send','put','update','delete','destroy','removeAnswers','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappAccount.controller','get'];(function(_0xdec230,_0x4b3c25){var _0x2fe253=function(_0xeacc88){while(--_0xeacc88){_0xdec230['push'](_0xdec230['shift']());}};_0x2fe253(++_0x4b3c25);}(_0x524e,0x15e));var _0xe524=function(_0x49622f,_0x5bcb80){_0x49622f=_0x49622f-0x0;var _0x5b6ecd=_0x524e[_0x49622f];return _0x5b6ecd;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe524('0x0'));var timeout=require(_0xe524('0x1'));var express=require(_0xe524('0x2'));var router=express[_0xe524('0x3')]();var fs_extra=require(_0xe524('0x4'));var auth=require(_0xe524('0x5'));var interaction=require(_0xe524('0x6'));var config=require(_0xe524('0x7'));var controller=require(_0xe524('0x8'));router[_0xe524('0x9')]('/',auth['isAuthenticated'](),controller[_0xe524('0xa')]);router[_0xe524('0x9')](_0xe524('0xb'),auth['isAuthenticated'](),controller[_0xe524('0xc')]);router[_0xe524('0x9')](_0xe524('0xd'),auth[_0xe524('0xe')](),controller[_0xe524('0xf')]);router[_0xe524('0x9')](_0xe524('0x10'),auth[_0xe524('0xe')](),controller[_0xe524('0x11')]);router[_0xe524('0x9')](_0xe524('0x12'),auth[_0xe524('0xe')](),controller[_0xe524('0x13')]);router[_0xe524('0x9')](_0xe524('0x14'),auth[_0xe524('0xe')](),controller['getAgents']);router['get'](_0xe524('0x15'),auth[_0xe524('0xe')](),controller[_0xe524('0x16')]);router[_0xe524('0x17')]('/',auth[_0xe524('0xe')](),controller['create']);router[_0xe524('0x17')]('/:id/dispositions',auth[_0xe524('0xe')](),controller[_0xe524('0x18')]);router['post'](_0xe524('0x12'),auth['isAuthenticated'](),controller[_0xe524('0x19')]);router['post'](_0xe524('0x14'),auth['isAuthenticated'](),controller['addAgents']);router['post'](_0xe524('0x15'),auth['isAuthenticated'](),controller[_0xe524('0x1a')]);router[_0xe524('0x17')](_0xe524('0x1b'),controller[_0xe524('0x1c')]);router['post'](_0xe524('0x1d'),auth[_0xe524('0xe')](),controller['send']);router[_0xe524('0x1e')](_0xe524('0xd'),auth[_0xe524('0xe')](),controller[_0xe524('0x1f')]);router[_0xe524('0x20')](_0xe524('0xd'),auth[_0xe524('0xe')](),controller[_0xe524('0x21')]);router[_0xe524('0x20')]('/:id/dispositions',auth[_0xe524('0xe')](),controller['removeDispositions']);router['delete'](_0xe524('0x12'),auth[_0xe524('0xe')](),controller[_0xe524('0x22')]);router[_0xe524('0x20')]('/:id/users',auth[_0xe524('0xe')](),controller['removeAgents']);module[_0xe524('0x23')]=router;
\ No newline at end of file
index 5966c2b..58ba834 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2b83=['Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','randomstring','exports','STRING','generate','twilio','sinch','TEXT','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER'];(function(_0x5b78e8,_0x55096b){var _0xf2c321=function(_0x4e0cff){while(--_0x4e0cff){_0x5b78e8['push'](_0x5b78e8['shift']());}};_0xf2c321(++_0x55096b);}(_0x2b83,0x146));var _0x32b8=function(_0x300ba2,_0xe84fce){_0x300ba2=_0x300ba2-0x0;var _0x4c780d=_0x2b83[_0x300ba2];return _0x4c780d;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x32b8('0x0'));module[_0x32b8('0x1')]={'name':{'type':Sequelize[_0x32b8('0x2')],'unique':'name','allowNull':![]},'key':{'type':Sequelize[_0x32b8('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0x32b8('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0x32b8('0x2')],'defaultValue':function(){return rs[_0x32b8('0x3')]();}},'phone':{'type':Sequelize[_0x32b8('0x2')]},'type':{'type':Sequelize['ENUM'](_0x32b8('0x4'),_0x32b8('0x5'))},'accountSid':{'type':Sequelize[_0x32b8('0x2')]},'baseUrl':{'type':Sequelize[_0x32b8('0x2')]},'authToken':{'type':Sequelize[_0x32b8('0x2')]},'notificationTemplate':{'type':Sequelize[_0x32b8('0x6')],'defaultValue':function(){return _0x32b8('0x7');}},'notificationSound':{'type':Sequelize[_0x32b8('0x8')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x32b8('0x8')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x32b8('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x32b8('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x32b8('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x32b8('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x32b8('0x9')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x32b8('0xa'),'set':function(_0x358beb){if(!_0x358beb){this[_0x32b8('0xb')](_0x32b8('0xc'),null);}this[_0x32b8('0xb')](_0x32b8('0xd'),_0x358beb);}},'description':{'type':Sequelize[_0x32b8('0x2')]}};
\ No newline at end of file
+var _0xd3b0=['twilio','sinch','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','randomstring','exports','STRING','generate'];(function(_0x471256,_0x12b9e8){var _0x2b29c6=function(_0x32183d){while(--_0x32183d){_0x471256['push'](_0x471256['shift']());}};_0x2b29c6(++_0x12b9e8);}(_0xd3b0,0x11a));var _0x0d3b=function(_0x1938af,_0x4f65b1){_0x1938af=_0x1938af-0x0;var _0x220cfc=_0xd3b0[_0x1938af];return _0x220cfc;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x0d3b('0x0'));module[_0x0d3b('0x1')]={'name':{'type':Sequelize[_0x0d3b('0x2')],'unique':'name','allowNull':![]},'key':{'type':Sequelize[_0x0d3b('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0x0d3b('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0x0d3b('0x2')],'defaultValue':function(){return rs[_0x0d3b('0x3')]();}},'phone':{'type':Sequelize[_0x0d3b('0x2')]},'type':{'type':Sequelize['ENUM'](_0x0d3b('0x4'),_0x0d3b('0x5'))},'accountSid':{'type':Sequelize[_0x0d3b('0x2')]},'baseUrl':{'type':Sequelize[_0x0d3b('0x2')]},'authToken':{'type':Sequelize[_0x0d3b('0x2')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x0d3b('0x6');}},'notificationSound':{'type':Sequelize[_0x0d3b('0x7')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x0d3b('0x7')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x0d3b('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x0d3b('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x0d3b('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x0d3b('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x0d3b('0x8')],'comment':_0x0d3b('0x9')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x0d3b('0xa'),'set':function(_0x232105){if(!_0x232105){this[_0x0d3b('0xb')](_0x0d3b('0xc'),null);}this[_0x0d3b('0xb')]('mandatoryDisposition',_0x232105);}},'description':{'type':Sequelize[_0x0d3b('0x2')]}};
\ No newline at end of file
index 30a8c5c..c8d847b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x21e3=['interaction','ContactId','UserId','unshift','agent','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','stringify','twilio','Content-Type','text/xml','to\x20is\x20mandatory','List','DESC','user','Messages','dataValues','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./whatsappAccount.socket','jayson/promise','client','http','request','then','WhatsappAccount,\x20%s,\x20%s','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','destroy','get','UserProfileResource','stack','name','send','index','mandatoryDispositionPause','map','WhatsappAccount','rawAttributes','fieldName','key','keys','intersection','attributes','model','fields','length','query','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','type','options','count','includeAll','findAll','rows','params','Pause','include','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','WhatsappAccounts','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','WhatsappAccountId','Disposition','getDispositions','findOne','pick','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','addAgents','omit','emit','removeAgents','isArray','userWhatsappAccount:remove','getAgents','addApplications','sequelize','Transaction','READ_COMMITTED','WhatsappApplication','bulkCreate','findAndCountAll','priority','finally','getApplications','notify','whatsapp','Applications','account','sinch','state','read','WhatsappMessage','statuses','timestamp','message_id','applications','orderBy','asc','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','mobile','from','From','replace','whatsapp:','Body','MessageSid','notifications','messageId','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','CmList','CmContact','Contacts','list','contact','WhatsappInteraction','spread','created','close','unmanaged'];(function(_0x7d579a,_0x1580b){var _0x3b06cb=function(_0x4ba063){while(--_0x4ba063){_0x7d579a['push'](_0x7d579a['shift']());}};_0x3b06cb(++_0x1580b);}(_0x21e3,0xe0));var _0x321e=function(_0x24af24,_0x1430ca){_0x24af24=_0x24af24-0x0;var _0x547bfb=_0x21e3[_0x24af24];return _0x547bfb;};'use strict';var emlformat=require(_0x321e('0x0'));var rimraf=require(_0x321e('0x1'));var zipdir=require(_0x321e('0x2'));var jsonpatch=require(_0x321e('0x3'));var rp=require('request-promise');var moment=require(_0x321e('0x4'));var BPromise=require(_0x321e('0x5'));var Mustache=require(_0x321e('0x6'));var util=require(_0x321e('0x7'));var path=require(_0x321e('0x8'));var sox=require(_0x321e('0x9'));var csv=require(_0x321e('0xa'));var ejs=require(_0x321e('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x321e('0xc'));var squel=require('squel');var crypto=require(_0x321e('0xd'));var jsforce=require(_0x321e('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x321e('0xa'));var querystring=require(_0x321e('0xf'));var Papa=require(_0x321e('0x10'));var Redis=require(_0x321e('0x11'));var authService=require(_0x321e('0x12'));var qs=require(_0x321e('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x321e('0x14'));var logger=require(_0x321e('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x321e('0x16'));var licenseUtil=require(_0x321e('0x17'));var db=require(_0x321e('0x18'))['db'];config['redis']=_[_0x321e('0x19')](config[_0x321e('0x1a')],{'host':_0x321e('0x1b'),'port':0x18eb});var socket=require(_0x321e('0x1c'))(new Redis(config[_0x321e('0x1a')]));require(_0x321e('0x1d'))['register'](socket);var jayson=require(_0x321e('0x1e'));var client=jayson[_0x321e('0x1f')][_0x321e('0x20')]({'port':0x232c});function respondWithRpcPromise(_0x2b741b,_0x146039,_0x395b7b,_0x1386b6){return new BPromise(function(_0x43e4ea,_0x504f68){var _0x3ada46=_0x1386b6||client;return _0x3ada46[_0x321e('0x21')](_0x2b741b,_0x395b7b)[_0x321e('0x22')](function(_0x431683){logger['info'](_0x321e('0x23'),_0x146039,'request\x20sent');logger[_0x321e('0x24')](_0x321e('0x25'),_0x146039,_0x321e('0x26'),JSON['stringify'](_0x431683));if(_0x431683[_0x321e('0x27')]){if(_0x431683[_0x321e('0x27')][_0x321e('0x28')]===0x1f4){logger[_0x321e('0x27')](_0x321e('0x23'),_0x146039,_0x431683[_0x321e('0x27')]['message']);return _0x504f68(_0x431683[_0x321e('0x27')]['message']);}logger[_0x321e('0x27')](_0x321e('0x23'),_0x146039,_0x431683[_0x321e('0x27')][_0x321e('0x29')]);return _0x43e4ea(_0x431683[_0x321e('0x27')][_0x321e('0x29')]);}else{logger[_0x321e('0x2a')](_0x321e('0x23'),_0x146039,_0x321e('0x26'));_0x43e4ea(_0x431683[_0x321e('0x2b')][_0x321e('0x29')]);}})[_0x321e('0x2c')](function(_0x36a258){logger[_0x321e('0x27')]('WhatsappAccount,\x20%s,\x20%s',_0x146039,_0x36a258);_0x504f68(_0x36a258);});});}function respondWithStatusCode(_0x5e271c,_0x20fe42){_0x20fe42=_0x20fe42||0xcc;return function(_0x5d076c){if(_0x5d076c){return _0x5e271c[_0x321e('0x2d')](_0x20fe42);}return _0x5e271c[_0x321e('0x2e')](_0x20fe42)[_0x321e('0x2f')]();};}function respondWithResult(_0x41dd02,_0x117f6f){_0x117f6f=_0x117f6f||0xc8;return function(_0x4cbd2e){if(_0x4cbd2e){return _0x41dd02[_0x321e('0x2e')](_0x117f6f)[_0x321e('0x30')](_0x4cbd2e);}};}function respondWithFilteredResult(_0x5b3753,_0x35c555){return function(_0x1f13b6){if(_0x1f13b6){var _0x2b9df8=typeof _0x35c555[_0x321e('0x31')]===_0x321e('0x32')&&typeof _0x35c555[_0x321e('0x33')]==='undefined';var _0x4783bd=_0x1f13b6['count'];var _0x50456c=_0x2b9df8?0x0:_0x35c555[_0x321e('0x31')];var _0xceca5a=_0x2b9df8?_0x1f13b6['count']:_0x35c555['offset']+_0x35c555['limit'];var _0xa3a139;if(_0xceca5a>=_0x4783bd){_0xceca5a=_0x4783bd;_0xa3a139=0xc8;}else{_0xa3a139=0xce;}_0x5b3753[_0x321e('0x2e')](_0xa3a139);return _0x5b3753[_0x321e('0x34')](_0x321e('0x35'),_0x50456c+'-'+_0xceca5a+'/'+_0x4783bd)[_0x321e('0x30')](_0x1f13b6);}return null;};}function patchUpdates(_0x521ffe){return function(_0x3275dc){try{jsonpatch[_0x321e('0x36')](_0x3275dc,_0x521ffe,!![]);}catch(_0x54c5bd){return BPromise[_0x321e('0x37')](_0x54c5bd);}return _0x3275dc[_0x321e('0x38')]();};}function saveUpdates(_0x496452,_0x59f2f0){return function(_0x46ed47){if(_0x46ed47){return _0x46ed47[_0x321e('0x39')](_0x496452)[_0x321e('0x22')](function(_0x5d7948){return _0x5d7948;});}return null;};}function removeEntity(_0x45f6bd,_0x2b79fd){return function(_0x31c442){if(_0x31c442){return _0x31c442[_0x321e('0x3a')]()[_0x321e('0x22')](function(){var _0x38aadf=_0x31c442[_0x321e('0x3b')]({'plain':!![]});var _0x45a327='WhatsappAccounts';return db[_0x321e('0x3c')][_0x321e('0x3a')]({'where':{'type':_0x45a327,'resourceId':_0x38aadf['id']}})[_0x321e('0x22')](function(){return _0x31c442;});})[_0x321e('0x22')](function(){_0x45f6bd[_0x321e('0x2e')](0xcc)[_0x321e('0x2f')]();});}};}function handleEntityNotFound(_0x38551c,_0x446e37){return function(_0x3ba391){if(!_0x3ba391){_0x38551c[_0x321e('0x2d')](0x194);}return _0x3ba391;};}function handleError(_0x39de0e,_0x4c92df){_0x4c92df=_0x4c92df||0x1f4;return function(_0x343fbc){logger[_0x321e('0x27')](_0x343fbc[_0x321e('0x3d')]);if(_0x343fbc[_0x321e('0x3e')]){delete _0x343fbc[_0x321e('0x3e')];}_0x39de0e[_0x321e('0x2e')](_0x4c92df)[_0x321e('0x3f')](_0x343fbc);};}exports[_0x321e('0x40')]=function(_0x148fce,_0x2dcd52){var _0x509a74={'include':[{'model':db['Pause'],'as':_0x321e('0x41')}]},_0x3735e3={},_0x31cd63={'count':0x0,'rows':[]};var _0x17ee89=_[_0x321e('0x42')](db[_0x321e('0x43')][_0x321e('0x44')],function(_0x51369b){return{'name':_0x51369b[_0x321e('0x45')],'type':_0x51369b['type'][_0x321e('0x46')]};});_0x3735e3['model']=_[_0x321e('0x42')](_0x17ee89,'name');_0x3735e3['query']=_[_0x321e('0x47')](_0x148fce['query']);_0x3735e3['filters']=_[_0x321e('0x48')](_0x3735e3['model'],_0x3735e3['query']);_0x509a74[_0x321e('0x49')]=_['intersection'](_0x3735e3[_0x321e('0x4a')],qs[_0x321e('0x4b')](_0x148fce['query']['fields']));_0x509a74[_0x321e('0x49')]=_0x509a74[_0x321e('0x49')][_0x321e('0x4c')]?_0x509a74['attributes']:_0x3735e3['model'];if(!_0x148fce[_0x321e('0x4d')][_0x321e('0x4e')](_0x321e('0x4f'))){_0x509a74['limit']=qs[_0x321e('0x33')](_0x148fce[_0x321e('0x4d')][_0x321e('0x33')]);_0x509a74[_0x321e('0x31')]=qs['offset'](_0x148fce[_0x321e('0x4d')][_0x321e('0x31')]);}_0x509a74[_0x321e('0x50')]=qs[_0x321e('0x51')](_0x148fce[_0x321e('0x4d')][_0x321e('0x51')]);_0x509a74['where']=qs[_0x321e('0x52')](_['pick'](_0x148fce[_0x321e('0x4d')],_0x3735e3[_0x321e('0x52')]),_0x17ee89);if(_0x148fce[_0x321e('0x4d')][_0x321e('0x53')]){_0x509a74[_0x321e('0x54')]=_[_0x321e('0x55')](_0x509a74['where'],{'$or':_[_0x321e('0x42')](_0x17ee89,function(_0xeb779a){if(_0xeb779a[_0x321e('0x56')]!=='VIRTUAL'){var _0x443b48={};_0x443b48[_0xeb779a[_0x321e('0x3e')]]={'$like':'%'+_0x148fce[_0x321e('0x4d')][_0x321e('0x53')]+'%'};return _0x443b48;}})});}_0x509a74=_[_0x321e('0x55')]({},_0x509a74,_0x148fce[_0x321e('0x57')]);var _0x3aa43f={'where':_0x509a74[_0x321e('0x54')]};return db['WhatsappAccount'][_0x321e('0x58')](_0x3aa43f)['then'](function(_0x12adbc){_0x31cd63[_0x321e('0x58')]=_0x12adbc;if(_0x148fce['query'][_0x321e('0x59')]){_0x509a74['include']=[{'all':!![]}];}return db[_0x321e('0x43')][_0x321e('0x5a')](_0x509a74);})[_0x321e('0x22')](function(_0x1e12b2){_0x31cd63[_0x321e('0x5b')]=_0x1e12b2;return _0x31cd63;})['then'](respondWithFilteredResult(_0x2dcd52,_0x509a74))[_0x321e('0x2c')](handleError(_0x2dcd52,null));};exports['show']=function(_0x1aaecb,_0x108958){var _0x4accfb={'raw':![],'where':{'id':_0x1aaecb[_0x321e('0x5c')]['id']},'include':[{'model':db[_0x321e('0x5d')],'as':'mandatoryDispositionPause'}]},_0x47ec83={};_0x47ec83[_0x321e('0x4a')]=_[_0x321e('0x47')](db[_0x321e('0x43')][_0x321e('0x44')]);_0x47ec83[_0x321e('0x4d')]=_[_0x321e('0x47')](_0x1aaecb['query']);_0x47ec83['filters']=_['intersection'](_0x47ec83[_0x321e('0x4a')],_0x47ec83[_0x321e('0x4d')]);_0x4accfb[_0x321e('0x49')]=_['intersection'](_0x47ec83[_0x321e('0x4a')],qs[_0x321e('0x4b')](_0x1aaecb[_0x321e('0x4d')]['fields']));_0x4accfb[_0x321e('0x49')]=_0x4accfb[_0x321e('0x49')][_0x321e('0x4c')]?_0x4accfb[_0x321e('0x49')]:_0x47ec83[_0x321e('0x4a')];if(_0x1aaecb[_0x321e('0x4d')][_0x321e('0x59')]){_0x4accfb[_0x321e('0x5e')]=[{'all':!![]}];}_0x4accfb=_[_0x321e('0x55')]({},_0x4accfb,_0x1aaecb[_0x321e('0x57')]);return db['WhatsappAccount'][_0x321e('0x5f')](_0x4accfb)[_0x321e('0x22')](handleEntityNotFound(_0x108958,null))[_0x321e('0x22')](respondWithResult(_0x108958,null))[_0x321e('0x2c')](handleError(_0x108958,null));};exports[_0x321e('0x60')]=function(_0x2f087f,_0xc6aa04){return db[_0x321e('0x43')][_0x321e('0x60')](_0x2f087f['body'],{})['then'](function(_0x588b82){var _0x525e95=_0x2f087f['user'][_0x321e('0x3b')]({'plain':!![]});if(!_0x525e95)throw new Error(_0x321e('0x61'));if(_0x525e95[_0x321e('0x62')]==='user'){var _0x2079d2=_0x588b82['get']({'plain':!![]});var _0x201582=_0x321e('0x63');return db[_0x321e('0x64')][_0x321e('0x5f')]({'where':{'name':_0x201582,'userProfileId':_0x525e95[_0x321e('0x65')]},'raw':!![]})[_0x321e('0x22')](function(_0x36041c){if(_0x36041c&&_0x36041c[_0x321e('0x66')]===0x0){return db[_0x321e('0x3c')]['create']({'name':_0x2079d2['name'],'resourceId':_0x2079d2['id'],'type':_0x36041c['name'],'sectionId':_0x36041c['id']},{})[_0x321e('0x22')](function(){return _0x588b82;});}else{return _0x588b82;}})[_0x321e('0x2c')](function(_0x2aa93c){logger[_0x321e('0x27')](_0x321e('0x67'),_0x2aa93c);throw _0x2aa93c;});}return _0x588b82;})[_0x321e('0x22')](respondWithResult(_0xc6aa04,0xc9))[_0x321e('0x2c')](handleError(_0xc6aa04,null));};exports[_0x321e('0x39')]=function(_0x5bf27c,_0x490f74){if(_0x5bf27c[_0x321e('0x68')]['id']){delete _0x5bf27c[_0x321e('0x68')]['id'];}return db[_0x321e('0x43')]['find']({'where':{'id':_0x5bf27c[_0x321e('0x5c')]['id']},'include':[{'model':db[_0x321e('0x5d')],'as':_0x321e('0x41')}]})['then'](handleEntityNotFound(_0x490f74,null))[_0x321e('0x22')](saveUpdates(_0x5bf27c[_0x321e('0x68')],null))[_0x321e('0x22')](respondWithResult(_0x490f74,null))[_0x321e('0x2c')](handleError(_0x490f74,null));};exports['destroy']=function(_0x363fd1,_0x3492d6){return db['WhatsappAccount'][_0x321e('0x5f')]({'where':{'id':_0x363fd1[_0x321e('0x5c')]['id']}})[_0x321e('0x22')](handleEntityNotFound(_0x3492d6,null))[_0x321e('0x22')](removeEntity(_0x3492d6,null))['catch'](handleError(_0x3492d6,null));};exports[_0x321e('0x69')]=function(_0x3b2e63,_0x436105){return db[_0x321e('0x43')][_0x321e('0x69')]()['then'](respondWithResult(_0x436105,null))['catch'](handleError(_0x436105,null));};exports[_0x321e('0x6a')]=function(_0x28398a,_0x273d5a,_0x597c51){if(_0x28398a[_0x321e('0x68')]['id']){delete _0x28398a[_0x321e('0x68')]['id'];}return db[_0x321e('0x43')][_0x321e('0x5f')]({'where':{'id':_0x28398a['params']['id']}})[_0x321e('0x22')](handleEntityNotFound(_0x273d5a,null))[_0x321e('0x22')](function(_0x3a002f){if(_0x3a002f){_0x28398a['body'][_0x321e('0x6b')]=_0x3a002f['id'];return db[_0x321e('0x6c')]['create'](_0x28398a['body']);}})[_0x321e('0x22')](respondWithResult(_0x273d5a,null))['catch'](handleError(_0x273d5a,null));};exports[_0x321e('0x6d')]=function(_0x190c92,_0x24a9e0,_0x3366ca){var _0x488549={'raw':![],'where':{}};var _0x55ed2c={};var _0x29c1f6={'count':0x0,'rows':[]};return db[_0x321e('0x43')][_0x321e('0x6e')]({'where':{'id':_0x190c92[_0x321e('0x5c')]['id']}})[_0x321e('0x22')](handleEntityNotFound(_0x24a9e0,null))[_0x321e('0x22')](function(_0x2a8aef){if(_0x2a8aef){_0x55ed2c[_0x321e('0x4a')]=_[_0x321e('0x47')](db[_0x321e('0x6c')][_0x321e('0x44')]);_0x55ed2c[_0x321e('0x4d')]=_[_0x321e('0x47')](_0x190c92['query']);_0x55ed2c[_0x321e('0x52')]=_['intersection'](_0x55ed2c[_0x321e('0x4a')],_0x55ed2c['query']);_0x488549[_0x321e('0x49')]=_[_0x321e('0x48')](_0x55ed2c[_0x321e('0x4a')],qs[_0x321e('0x4b')](_0x190c92[_0x321e('0x4d')][_0x321e('0x4b')]));_0x488549[_0x321e('0x49')]=_0x488549[_0x321e('0x49')][_0x321e('0x4c')]?_0x488549[_0x321e('0x49')]:_0x55ed2c['model'];if(!_0x190c92[_0x321e('0x4d')][_0x321e('0x4e')](_0x321e('0x4f'))){_0x488549[_0x321e('0x33')]=qs['limit'](_0x190c92['query'][_0x321e('0x33')]);_0x488549['offset']=qs['offset'](_0x190c92['query'][_0x321e('0x31')]);}_0x488549[_0x321e('0x50')]=qs['sort'](_0x190c92[_0x321e('0x4d')][_0x321e('0x51')]);_0x488549[_0x321e('0x54')]=qs[_0x321e('0x52')](_[_0x321e('0x6f')](_0x190c92[_0x321e('0x4d')],_0x55ed2c[_0x321e('0x52')]));_0x488549['where'][_0x321e('0x6b')]=_0x2a8aef['id'];if(_0x190c92[_0x321e('0x4d')]['filter']){_0x488549[_0x321e('0x54')]=_[_0x321e('0x55')](_0x488549[_0x321e('0x54')],{'$or':_[_0x321e('0x42')](_0x488549[_0x321e('0x49')],function(_0x3325eb){var _0x94751b={};_0x94751b[_0x3325eb]={'$like':'%'+_0x190c92['query'][_0x321e('0x53')]+'%'};return _0x94751b;})});}_0x488549=_[_0x321e('0x55')]({},_0x488549,_0x190c92['options']);return db[_0x321e('0x6c')]['count']({'where':_0x488549[_0x321e('0x54')]})['then'](function(_0x5c0594){_0x29c1f6['count']=_0x5c0594;if(_0x190c92[_0x321e('0x4d')][_0x321e('0x59')]){_0x488549[_0x321e('0x5e')]=[{'all':!![]}];}return db['Disposition'][_0x321e('0x5a')](_0x488549);})[_0x321e('0x22')](function(_0x351878){_0x29c1f6[_0x321e('0x5b')]=_0x351878;return _0x29c1f6;});}})[_0x321e('0x22')](respondWithFilteredResult(_0x24a9e0,_0x488549))[_0x321e('0x2c')](handleError(_0x24a9e0,null));};exports['removeDispositions']=function(_0x36fa57,_0x503386,_0x27c8d8){return db['WhatsappAccount'][_0x321e('0x5f')]({'where':{'id':_0x36fa57[_0x321e('0x5c')]['id']}})[_0x321e('0x22')](handleEntityNotFound(_0x503386,null))[_0x321e('0x22')](function(_0x548f73){if(_0x548f73){return _0x548f73[_0x321e('0x70')](_0x36fa57[_0x321e('0x4d')][_0x321e('0x71')]);}})[_0x321e('0x22')](respondWithStatusCode(_0x503386,null))[_0x321e('0x2c')](handleError(_0x503386,null));};exports[_0x321e('0x72')]=function(_0x57622a,_0x5a5477,_0x542618){if(_0x57622a[_0x321e('0x68')]['id']){delete _0x57622a[_0x321e('0x68')]['id'];}return db[_0x321e('0x43')][_0x321e('0x5f')]({'where':{'id':_0x57622a[_0x321e('0x5c')]['id']}})[_0x321e('0x22')](handleEntityNotFound(_0x5a5477,null))['then'](function(_0x95267a){if(_0x95267a){_0x57622a['body'][_0x321e('0x6b')]=_0x95267a['id'];return db['CannedAnswer'][_0x321e('0x60')](_0x57622a[_0x321e('0x68')]);}})['then'](respondWithResult(_0x5a5477,null))['catch'](handleError(_0x5a5477,null));};exports[_0x321e('0x73')]=function(_0x26c14a,_0x53b791,_0x37bbbd){var _0x848674={'raw':![],'where':{}};var _0x5a7961={};var _0x2f69f6={'count':0x0,'rows':[]};return db[_0x321e('0x43')][_0x321e('0x6e')]({'where':{'id':_0x26c14a[_0x321e('0x5c')]['id']}})[_0x321e('0x22')](handleEntityNotFound(_0x53b791,null))[_0x321e('0x22')](function(_0x3f76df){if(_0x3f76df){_0x5a7961['model']=_['keys'](db[_0x321e('0x74')][_0x321e('0x44')]);_0x5a7961[_0x321e('0x4d')]=_[_0x321e('0x47')](_0x26c14a['query']);_0x5a7961['filters']=_[_0x321e('0x48')](_0x5a7961[_0x321e('0x4a')],_0x5a7961['query']);_0x848674[_0x321e('0x49')]=_['intersection'](_0x5a7961['model'],qs[_0x321e('0x4b')](_0x26c14a[_0x321e('0x4d')][_0x321e('0x4b')]));_0x848674['attributes']=_0x848674[_0x321e('0x49')]['length']?_0x848674[_0x321e('0x49')]:_0x5a7961[_0x321e('0x4a')];if(!_0x26c14a[_0x321e('0x4d')][_0x321e('0x4e')](_0x321e('0x4f'))){_0x848674[_0x321e('0x33')]=qs[_0x321e('0x33')](_0x26c14a[_0x321e('0x4d')]['limit']);_0x848674['offset']=qs[_0x321e('0x31')](_0x26c14a[_0x321e('0x4d')]['offset']);}_0x848674[_0x321e('0x50')]=qs[_0x321e('0x51')](_0x26c14a['query'][_0x321e('0x51')]);_0x848674[_0x321e('0x54')]=qs[_0x321e('0x52')](_[_0x321e('0x6f')](_0x26c14a[_0x321e('0x4d')],_0x5a7961[_0x321e('0x52')]));_0x848674[_0x321e('0x54')][_0x321e('0x6b')]=_0x3f76df['id'];if(_0x26c14a[_0x321e('0x4d')]['filter']){_0x848674['where']=_['merge'](_0x848674[_0x321e('0x54')],{'$or':_[_0x321e('0x42')](_0x848674[_0x321e('0x49')],function(_0x13de3d){var _0x1319eb={};_0x1319eb[_0x13de3d]={'$like':'%'+_0x26c14a[_0x321e('0x4d')][_0x321e('0x53')]+'%'};return _0x1319eb;})});}_0x848674=_[_0x321e('0x55')]({},_0x848674,_0x26c14a[_0x321e('0x57')]);return db[_0x321e('0x74')][_0x321e('0x58')]({'where':_0x848674[_0x321e('0x54')]})[_0x321e('0x22')](function(_0x468fb8){_0x2f69f6['count']=_0x468fb8;if(_0x26c14a['query'][_0x321e('0x59')]){_0x848674[_0x321e('0x5e')]=[{'all':!![]}];}return db[_0x321e('0x74')][_0x321e('0x5a')](_0x848674);})[_0x321e('0x22')](function(_0x15b4c9){_0x2f69f6[_0x321e('0x5b')]=_0x15b4c9;return _0x2f69f6;});}})[_0x321e('0x22')](respondWithFilteredResult(_0x53b791,_0x848674))[_0x321e('0x2c')](handleError(_0x53b791,null));};exports['removeAnswers']=function(_0x741f36,_0x4288b0,_0x45280f){return db[_0x321e('0x43')][_0x321e('0x5f')]({'where':{'id':_0x741f36['params']['id']}})[_0x321e('0x22')](handleEntityNotFound(_0x4288b0,null))[_0x321e('0x22')](function(_0x4c7b44){if(_0x4c7b44){return _0x4c7b44[_0x321e('0x75')](_0x741f36['query'][_0x321e('0x71')]);}})[_0x321e('0x22')](respondWithStatusCode(_0x4288b0,null))[_0x321e('0x2c')](handleError(_0x4288b0,null));};exports[_0x321e('0x76')]=function(_0x1735b9,_0x13f2a1,_0x5e3bdb){return db[_0x321e('0x43')][_0x321e('0x5f')]({'where':{'id':_0x1735b9[_0x321e('0x5c')]['id']}})['then'](handleEntityNotFound(_0x13f2a1,null))[_0x321e('0x22')](function(_0x27ac15){if(_0x27ac15){return _0x27ac15[_0x321e('0x76')](_0x1735b9[_0x321e('0x68')][_0x321e('0x71')],_[_0x321e('0x77')](_0x1735b9[_0x321e('0x68')],[_0x321e('0x71'),'id'])||{})['spread'](function(_0x347372){for(var _0x1069ae=0x0;_0x1069ae<_0x1735b9[_0x321e('0x68')][_0x321e('0x71')][_0x321e('0x4c')];_0x1069ae+=0x1){socket[_0x321e('0x78')]('userWhatsappAccount:save',{'UserId':Number(_0x1735b9['body']['ids'][_0x1069ae]),'WhatsappAccountId':Number(_0x1735b9['params']['id'])});}return _0x347372;});}})[_0x321e('0x22')](respondWithResult(_0x13f2a1,null))[_0x321e('0x2c')](handleError(_0x13f2a1,null));};exports[_0x321e('0x79')]=function(_0x4b8f53,_0x46d327,_0x422550){return db[_0x321e('0x43')]['find']({'where':{'id':_0x4b8f53[_0x321e('0x5c')]['id']}})[_0x321e('0x22')](handleEntityNotFound(_0x46d327,null))[_0x321e('0x22')](function(_0x3bccdc){if(_0x3bccdc){return _0x3bccdc[_0x321e('0x79')](_0x4b8f53[_0x321e('0x4d')]['ids'])[_0x321e('0x22')](function(){if(_[_0x321e('0x7a')](_0x4b8f53[_0x321e('0x4d')][_0x321e('0x71')])){for(var _0x58d621=0x0;_0x58d621<_0x4b8f53[_0x321e('0x4d')][_0x321e('0x71')][_0x321e('0x4c')];_0x58d621+=0x1){socket[_0x321e('0x78')](_0x321e('0x7b'),{'UserId':Number(_0x4b8f53[_0x321e('0x4d')][_0x321e('0x71')][_0x58d621]),'WhatsappAccountId':Number(_0x4b8f53[_0x321e('0x5c')]['id'])});}}else{socket['emit'](_0x321e('0x7b'),{'UserId':Number(_0x4b8f53[_0x321e('0x4d')]['ids']),'WhatsappAccountId':Number(_0x4b8f53[_0x321e('0x5c')]['id'])});}});}})['then'](respondWithStatusCode(_0x46d327,null))[_0x321e('0x2c')](handleError(_0x46d327,null));};exports[_0x321e('0x7c')]=function(_0x3a3502,_0x1136f4,_0x2254c8){var _0x3f3f27={};var _0x3fa993={};var _0x219398;var _0x24107e;return db[_0x321e('0x43')][_0x321e('0x6e')]({'where':{'id':_0x3a3502['params']['id']}})[_0x321e('0x22')](handleEntityNotFound(_0x1136f4,null))['then'](function(_0x5507e5){if(_0x5507e5){_0x219398=_0x5507e5;_0x3fa993['model']=_[_0x321e('0x47')](db['User'][_0x321e('0x44')]);_0x3fa993['query']=_['keys'](_0x3a3502[_0x321e('0x4d')]);_0x3fa993[_0x321e('0x52')]=_['intersection'](_0x3fa993['model'],_0x3fa993[_0x321e('0x4d')]);_0x3f3f27[_0x321e('0x49')]=_[_0x321e('0x48')](_0x3fa993[_0x321e('0x4a')],qs[_0x321e('0x4b')](_0x3a3502[_0x321e('0x4d')]['fields']));_0x3f3f27[_0x321e('0x49')]=_0x3f3f27[_0x321e('0x49')][_0x321e('0x4c')]?_0x3f3f27[_0x321e('0x49')]:_0x3fa993[_0x321e('0x4a')];_0x3f3f27[_0x321e('0x50')]=qs['sort'](_0x3a3502[_0x321e('0x4d')]['sort']);_0x3f3f27[_0x321e('0x54')]=qs['filters'](_[_0x321e('0x6f')](_0x3a3502[_0x321e('0x4d')],_0x3fa993[_0x321e('0x52')]));if(_0x3a3502[_0x321e('0x4d')][_0x321e('0x53')]){_0x3f3f27[_0x321e('0x54')]=_[_0x321e('0x55')](_0x3f3f27[_0x321e('0x54')],{'$or':_[_0x321e('0x42')](_0x3f3f27[_0x321e('0x49')],function(_0x100be0){var _0x21daf9={};_0x21daf9[_0x100be0]={'$like':'%'+_0x3a3502[_0x321e('0x4d')][_0x321e('0x53')]+'%'};return _0x21daf9;})});}_0x3f3f27=_['merge']({},_0x3f3f27,_0x3a3502[_0x321e('0x57')]);return _0x219398[_0x321e('0x7c')](_0x3f3f27);}})[_0x321e('0x22')](function(_0x4ae87c){if(_0x4ae87c){_0x24107e=_0x4ae87c['length'];if(!_0x3a3502['query'][_0x321e('0x4e')]('nolimit')){_0x3f3f27[_0x321e('0x33')]=qs[_0x321e('0x33')](_0x3a3502[_0x321e('0x4d')]['limit']);_0x3f3f27[_0x321e('0x31')]=qs[_0x321e('0x31')](_0x3a3502[_0x321e('0x4d')][_0x321e('0x31')]);}return _0x219398[_0x321e('0x7c')](_0x3f3f27);}})['then'](function(_0x4290b1){if(_0x4290b1){return _0x4290b1?{'count':_0x24107e,'rows':_0x4290b1}:null;}})[_0x321e('0x22')](respondWithResult(_0x1136f4,null))[_0x321e('0x2c')](handleError(_0x1136f4,null));};exports[_0x321e('0x7d')]=function(_0xeaf4d5,_0x4fc4d9){var _0x59008b=_0xeaf4d5[_0x321e('0x5c')]['id'];var _0x108166=_0xeaf4d5[_0x321e('0x68')];var _0x270f0a=0xc8;var _0x45f573=null;return db[_0x321e('0x7e')]['transaction']({'isolationLevel':db['sequelize'][_0x321e('0x7f')]['ISOLATION_LEVELS'][_0x321e('0x80')]},function(_0x16caa8){return db['WhatsappAccount'][_0x321e('0x6e')]({'where':{'id':_0x59008b},'transaction':_0x16caa8})[_0x321e('0x22')](function(_0x4aae9c){if(_0x4aae9c){return db[_0x321e('0x81')][_0x321e('0x3a')]({'where':{'WhatsappAccountId':_0x59008b},'transaction':_0x16caa8})['then'](function(){var _0x3a0b5a=_[_0x321e('0x42')](_0x108166,function(_0x360fba){_0x360fba[_0x321e('0x6b')]=_0x59008b;return _0x360fba;});return db['WhatsappApplication'][_0x321e('0x82')](_0x3a0b5a,{'transaction':_0x16caa8});});}else{_0x270f0a=0x194;_0x45f573=[];}});})[_0x321e('0x22')](function(){if(_0x270f0a!==0x194){return db[_0x321e('0x81')][_0x321e('0x83')]({'where':{'WhatsappAccountId':_0x59008b},'order':_0x321e('0x84')})['then'](function(_0x1e144b){_0x45f573=_0x1e144b;});}})[_0x321e('0x2c')](function(_0x438ea2){_0x270f0a=0x1f4;logger[_0x321e('0x27')](_0x438ea2[_0x321e('0x3d')]);if(_0x438ea2[_0x321e('0x3e')]){delete _0x438ea2[_0x321e('0x3e')];}_0x45f573=_0x438ea2;})[_0x321e('0x85')](function(){if(_0x45f573===null){_0x4fc4d9[_0x321e('0x2d')](_0x270f0a);}else{if(_0x270f0a===0x1f4){_0x4fc4d9['status'](_0x270f0a)[_0x321e('0x3f')](_0x45f573);}else{_0x4fc4d9['status'](_0x270f0a)[_0x321e('0x30')](_0x45f573);}}});};exports[_0x321e('0x86')]=function(_0x2f52c9,_0x125e2a,_0x1bd3ab){var _0x512e4e={};var _0x643687={};var _0x4b2a93;var _0x3ff746;return db[_0x321e('0x43')][_0x321e('0x6e')]({'where':{'id':_0x2f52c9['params']['id']}})[_0x321e('0x22')](handleEntityNotFound(_0x125e2a,null))[_0x321e('0x22')](function(_0x5da1fc){if(_0x5da1fc){_0x4b2a93=_0x5da1fc;_0x643687[_0x321e('0x4a')]=_[_0x321e('0x47')](db['WhatsappApplication'][_0x321e('0x44')]);_0x643687['query']=_[_0x321e('0x47')](_0x2f52c9[_0x321e('0x4d')]);_0x643687[_0x321e('0x52')]=_['intersection'](_0x643687[_0x321e('0x4a')],_0x643687[_0x321e('0x4d')]);_0x512e4e['attributes']=_[_0x321e('0x48')](_0x643687[_0x321e('0x4a')],qs[_0x321e('0x4b')](_0x2f52c9[_0x321e('0x4d')][_0x321e('0x4b')]));_0x512e4e['attributes']=_0x512e4e[_0x321e('0x49')][_0x321e('0x4c')]?_0x512e4e[_0x321e('0x49')]:_0x643687['model'];_0x512e4e[_0x321e('0x50')]=qs[_0x321e('0x51')](_0x2f52c9[_0x321e('0x4d')]['sort']);_0x512e4e['where']=qs[_0x321e('0x52')](_[_0x321e('0x6f')](_0x2f52c9[_0x321e('0x4d')],_0x643687[_0x321e('0x52')]));if(_0x2f52c9[_0x321e('0x4d')][_0x321e('0x53')]){_0x512e4e[_0x321e('0x54')]=_[_0x321e('0x55')](_0x512e4e[_0x321e('0x54')],{'$or':_['map'](_0x512e4e[_0x321e('0x49')],function(_0x861f){var _0x45d3bf={};_0x45d3bf[_0x861f]={'$like':'%'+_0x2f52c9['query']['filter']+'%'};return _0x45d3bf;})});}_0x512e4e=_[_0x321e('0x55')]({},_0x512e4e,_0x2f52c9[_0x321e('0x57')]);return _0x4b2a93[_0x321e('0x86')](_0x512e4e);}})[_0x321e('0x22')](function(_0x54be0c){if(_0x54be0c){_0x3ff746=_0x54be0c['length'];if(!_0x2f52c9[_0x321e('0x4d')][_0x321e('0x4e')](_0x321e('0x4f'))){_0x512e4e[_0x321e('0x33')]=qs[_0x321e('0x33')](_0x2f52c9[_0x321e('0x4d')][_0x321e('0x33')]);_0x512e4e['offset']=qs[_0x321e('0x31')](_0x2f52c9[_0x321e('0x4d')][_0x321e('0x31')]);}return _0x4b2a93[_0x321e('0x86')](_0x512e4e);}})[_0x321e('0x22')](function(_0x3b1bc8){if(_0x3b1bc8){return _0x3b1bc8?{'count':_0x3ff746,'rows':_0x3b1bc8}:null;}})[_0x321e('0x22')](respondWithResult(_0x125e2a,null))['catch'](handleError(_0x125e2a,null));};exports[_0x321e('0x87')]=function(_0x7a72d,_0x48ad56,_0x4573f){var _0xe4555d={'channel':_0x321e('0x88')};var _0x5d147a=[];var _0x286cec=[];var _0x20376f={};return db[_0x321e('0x43')][_0x321e('0x5f')]({'where':{'id':_0x7a72d[_0x321e('0x5c')]['id']},'include':[{'model':db[_0x321e('0x81')],'as':_0x321e('0x89')}]})[_0x321e('0x22')](handleEntityNotFound(_0x48ad56,null))[_0x321e('0x22')](function(_0x2e1a41){_0xe4555d[_0x321e('0x8a')]=_0x2e1a41;if(_0xe4555d[_0x321e('0x8a')]&&_0xe4555d[_0x321e('0x8a')][_0x321e('0x56')]===_0x321e('0x8b')&&_0x7a72d[_0x321e('0x68')]['statuses']){if(_0x7a72d['body']['statuses']['length']===0x0)return;if(_0x7a72d[_0x321e('0x68')]['statuses'][0x0][_0x321e('0x8c')]!==_0x321e('0x8d'))return;return db[_0x321e('0x8e')][_0x321e('0x39')]({'read':!![],'readAt':_0x7a72d[_0x321e('0x68')][_0x321e('0x8f')][0x0][_0x321e('0x90')]},{'where':{'messageId':_0x7a72d[_0x321e('0x68')][_0x321e('0x8f')][0x0][_0x321e('0x91')]},'individualHooks':!![]})['then'](function(_0x3bdae6){return _0x48ad56[_0x321e('0x2e')](0xc8)[_0x321e('0x30')](_0x3bdae6);});}_0xe4555d[_0x321e('0x92')]=_[_0x321e('0x93')](_0x2e1a41[_0x321e('0x89')],[_0x321e('0x84')],[_0x321e('0x94')]);if(_0xe4555d[_0x321e('0x8a')]['Applications']){delete _0xe4555d[_0x321e('0x8a')][_0x321e('0x89')];}return db['CmContact'][_0x321e('0x69')]()[_0x321e('0x22')](function(_0x3c1132){if(!_0x3c1132){throw new db[(_0x321e('0x95'))][(_0x321e('0x96'))](_0x321e('0x97'));}_0x5d147a=_[_0x321e('0x98')](_[_0x321e('0x47')](_0x3c1132),[_0x321e('0x99'),_0x321e('0x9a')]);_0x286cec=_[_0x321e('0x98')](_['keys'](_0x3c1132),[_0x321e('0x99'),'updatedAt',_0x321e('0x9b'),_0x321e('0x9c')]);_0xe4555d['body']={'mapKey':_0x321e('0x9d')};if(_0xe4555d[_0x321e('0x8a')]&&_0xe4555d[_0x321e('0x8a')][_0x321e('0x56')]==='twilio'){_0xe4555d[_0x321e('0x68')][_0x321e('0x9e')]=_0x7a72d['body'][_0x321e('0x9f')][_0x321e('0xa0')](_0x321e('0xa1'),'');_0xe4555d[_0x321e('0x68')][_0x321e('0x68')]=_0x7a72d[_0x321e('0x68')][_0x321e('0xa2')];_0xe4555d[_0x321e('0x68')]['messageId']=_0x7a72d['body'][_0x321e('0xa3')];}if(_0xe4555d[_0x321e('0x8a')]&&_0xe4555d[_0x321e('0x8a')][_0x321e('0x56')]===_0x321e('0x8b')){_0xe4555d[_0x321e('0x68')][_0x321e('0x9e')]=_0x7a72d['body'][_0x321e('0xa4')][0x0][_0x321e('0x9e')];_0xe4555d[_0x321e('0x68')][_0x321e('0x68')]=_0x7a72d[_0x321e('0x68')][_0x321e('0xa4')][0x0][_0x321e('0x29')][_0x321e('0x68')];_0xe4555d[_0x321e('0x68')][_0x321e('0xa5')]=_0x7a72d[_0x321e('0x68')][_0x321e('0xa4')][0x0][_0x321e('0x91')];}if(_0xe4555d['body']['id']){delete _0xe4555d[_0x321e('0x68')]['id'];}if(_[_0x321e('0xa6')](_0xe4555d[_0x321e('0x68')][_0x321e('0x9e')])){throw new db[(_0x321e('0x95'))][(_0x321e('0x96'))](_0x321e('0xa7'));}if(_['isNil'](_0xe4555d[_0x321e('0x68')][_0x321e('0x68')])||_0xe4555d[_0x321e('0x68')][_0x321e('0x68')]===''){throw new db[(_0x321e('0x95'))][(_0x321e('0x96'))](_0x321e('0xa8'));}if(_[_0x321e('0xa6')](_0xe4555d['body']['mapKey'])){throw new db[(_0x321e('0x95'))][(_0x321e('0x96'))](_0x321e('0xa9')+_0x286cec);}if(!_[_0x321e('0xaa')](_0x286cec,_0xe4555d[_0x321e('0x68')][_0x321e('0xab')])){throw new db[(_0x321e('0x95'))]['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x286cec);}_0x20376f[_0xe4555d[_0x321e('0x68')][_0x321e('0xab')]]=_0xe4555d[_0x321e('0x68')][_0x321e('0x9e')];return db[_0x321e('0xac')][_0x321e('0x5f')]({'where':{'id':_0xe4555d[_0x321e('0x8a')][_0x321e('0x9c')]},'include':[{'model':db[_0x321e('0xad')],'as':_0x321e('0xae'),'where':_0x20376f,'limit':0x1,'order':[['updatedAt','DESC']]}]});})[_0x321e('0x22')](handleEntityNotFound(_0x48ad56,null))['then'](function(_0x16d91e){if(_0x16d91e){_0xe4555d[_0x321e('0xaf')]=_[_0x321e('0x77')](_0x16d91e,['Contacts']);if(_0x16d91e[_0x321e('0xae')]['length']){return _0x16d91e[_0x321e('0xae')][0x0];}var _0xaef2d2=_['defaults'](_0xe4555d[_0x321e('0x68')],{'firstName':_0xe4555d[_0x321e('0x68')][_0x321e('0x9e')],'ListId':_0x16d91e['id']});_0xaef2d2[_0xe4555d[_0x321e('0x68')][_0x321e('0xab')]]=_0xe4555d[_0x321e('0x68')][_0x321e('0x9e')];return db[_0x321e('0xad')][_0x321e('0x60')](_0xaef2d2,{'fields':_0x5d147a,'raw':!![]});}})[_0x321e('0x22')](handleEntityNotFound(_0x48ad56,null))[_0x321e('0x22')](function(_0x4141f7){if(_0x4141f7){_0xe4555d[_0x321e('0xb0')]=_0x4141f7;var _0x16b700={'ContactId':_0x4141f7['id'],'phone':_0xe4555d[_0x321e('0x68')][_0x321e('0x9e')],'WhatsappAccountId':_0x7a72d['params']['id']};var _0x5da67f={'ContactId':_0x4141f7['id'],'WhatsappAccountId':_0x7a72d[_0x321e('0x5c')]['id'],'closed':![]};return db[_0x321e('0xb1')]['find']({'where':_0x5da67f})['then'](function(_0x112450){if(_0x112450){return[_0x112450,![]];}return db[_0x321e('0xb1')][_0x321e('0x60')](_0x16b700)[_0x321e('0x22')](function(_0xb61941){return[_0xb61941,!![]];});});}})[_0x321e('0xb2')](function(_0x343a5c,_0x3185e4){_0xe4555d['interaction']=_0x343a5c['get']({'plain':!![]});_0xe4555d['interaction'][_0x321e('0xb3')]=![];if(_0x3185e4){if(_0xe4555d[_0x321e('0x8a')]['autoclose']){_0xe4555d[_0x321e('0x92')]['push']({'id':0x0,'priority':_0xe4555d[_0x321e('0x92')][_0x321e('0x4c')]+0x1,'app':_0x321e('0xb4'),'appdata':_0x321e('0xb5'),'interval':'*,*,*,*'});}_0xe4555d[_0x321e('0xb6')]['created']=!![];}return db['WhatsappMessage']['create']({'phone':_0xe4555d[_0x321e('0x68')][_0x321e('0x9e')],'messageId':_0xe4555d[_0x321e('0x68')][_0x321e('0xa5')],'body':_0xe4555d[_0x321e('0x68')][_0x321e('0x68')],'WhatsappAccountId':_0x7a72d[_0x321e('0x5c')]['id'],'WhatsappInteractionId':_0x343a5c['id'],'direction':'in','ContactId':_0x343a5c[_0x321e('0xb7')],'AttachmentId':_0xe4555d['body']['AttachmentId']});})[_0x321e('0x22')](function(_0x5ee441){_0xe4555d[_0x321e('0x29')]=_0x5ee441;if(_0xe4555d[_0x321e('0xb6')]['UserId']){return db['User'][_0x321e('0x5f')]({'attributes':['id','name'],'where':{'id':_0xe4555d[_0x321e('0xb6')][_0x321e('0xb8')]}})['then'](function(_0x397019){if(_0x397019){_0xe4555d[_0x321e('0x92')][_0x321e('0xb9')]({'id':0x0,'priority':0x0,'app':_0x321e('0xba'),'appdata':_0x397019[_0x321e('0x3e')]+','+(_0xe4555d[_0x321e('0x8a')][_0x321e('0xbb')]||0xa),'interval':_0x321e('0xbc')});}return respondWithRpcPromise('Start','startRouting',_0xe4555d);});}return respondWithRpcPromise(_0x321e('0xbd'),_0x321e('0xbe'),_0xe4555d);})[_0x321e('0x22')](function(_0x3ee02b){if(_0x3ee02b){var _0x6880ae=0xc8;var _0x2470cc='receiveMessage';logger[_0x321e('0x2a')](_0x321e('0x25'),_0x2470cc,_0x6880ae,_0x321e('0xbf'));logger[_0x321e('0x24')](_0x321e('0xc0'),_0x2470cc,_0x6880ae,_0x321e('0xbf'),JSON[_0x321e('0xc1')](_0x3ee02b));if(_0xe4555d[_0x321e('0x8a')][_0x321e('0x56')]===_0x321e('0xc2')){return _0x48ad56[_0x321e('0x2e')](_0x6880ae)['set'](_0x321e('0xc3'),_0x321e('0xc4'))[_0x321e('0x3f')]('<?xml\x20version=\x221.0\x22\x20encoding=\x22UTF-8\x22?>\x0a<Response></Response>');}else{return _0x48ad56[_0x321e('0x2e')](_0x6880ae)[_0x321e('0x30')](_0x3ee02b);}}});})[_0x321e('0x2c')](handleError(_0x48ad56,null));};exports[_0x321e('0x3f')]=function(_0x3ec9c3,_0x383a65,_0x4e8335){var _0x3da44c,_0x5ec93f,_0x2666be;if(_['isNil'](_0x3ec9c3[_0x321e('0x68')][_0x321e('0x68')])||_0x3ec9c3[_0x321e('0x68')][_0x321e('0x68')]===''){throw new db[(_0x321e('0x95'))][(_0x321e('0x96'))](_0x321e('0xa8'));}if(_[_0x321e('0xa6')](_0x3ec9c3[_0x321e('0x68')]['to'])){throw new db[(_0x321e('0x95'))][(_0x321e('0x96'))](_0x321e('0xc5'));}_0x3da44c=_0x3ec9c3[_0x321e('0x68')]['to'];return db[_0x321e('0x43')][_0x321e('0x5f')]({'where':{'id':_0x3ec9c3[_0x321e('0x5c')]['id']},'include':[{'model':db[_0x321e('0xac')],'as':_0x321e('0xc6'),'include':[{'model':db[_0x321e('0xad')],'as':_0x321e('0xae'),'where':{'mobile':_0x3da44c},'limit':0x1,'order':[[_0x321e('0x9a'),_0x321e('0xc7')]]}]}]})[_0x321e('0x22')](handleEntityNotFound(_0x383a65,null))['then'](function(_0x1782f8){if(_0x1782f8&&_0x1782f8['List']){_0x5ec93f=_0x1782f8[_0x321e('0x3b')]({'plain':!![]});if(_0x5ec93f[_0x321e('0xc6')]&&_0x5ec93f[_0x321e('0xc6')][_0x321e('0xae')][_0x321e('0x4c')]){return _0x5ec93f[_0x321e('0xc6')][_0x321e('0xae')][0x0];}return db[_0x321e('0xad')][_0x321e('0x60')](_[_0x321e('0x19')](_0x3ec9c3[_0x321e('0x68')],{'firstName':_0x3da44c,'mobile':_0x3da44c,'phone':_0x3da44c,'ListId':_0x5ec93f[_0x321e('0x9c')]}));}})[_0x321e('0x22')](handleEntityNotFound(_0x383a65,null))['then'](function(_0x2a4fd8){if(_0x2a4fd8){_0x2666be=_0x2a4fd8;return db[_0x321e('0xb1')][_0x321e('0x5f')]({'where':{'ContactId':_0x2666be['id'],'closed':![],'WhatsappAccountId':_0x5ec93f['id']}})[_0x321e('0x22')](function(_0xe23935){if(_0xe23935){return[_0xe23935,![]];}return db[_0x321e('0xb1')][_0x321e('0x60')]({'UserId':_0x3ec9c3['user']['id'],'ContactId':_0x2666be['id'],'WhatsappAccountId':_0x5ec93f['id'],'phone':_0x3da44c,'firstMsgDirection':'out','Messages':[_[_0x321e('0x55')](_0x3ec9c3[_0x321e('0x68')],{'read':![],'body':_0x3ec9c3[_0x321e('0x68')][_0x321e('0x68')],'phone':_0x3da44c,'WhatsappAccountId':_0x5ec93f['id'],'UserId':_0x3ec9c3[_0x321e('0xc8')]['id'],'ContactId':_0x2666be['id']})]},{'include':[{'model':db['WhatsappMessage'],'as':_0x321e('0xc9')}]})['then'](function(_0x430a51){return[_0x430a51,!![]];});});}})[_0x321e('0xb2')](function(_0x489523,_0x59c6cd){if(_0x59c6cd){return _0x489523;}return db['WhatsappMessage']['create'](_[_0x321e('0x55')](_0x3ec9c3[_0x321e('0x68')],{'read':![],'body':_0x3ec9c3[_0x321e('0x68')][_0x321e('0x68')],'phone':_0x3da44c,'WhatsappAccountId':_0x5ec93f['id'],'WhatsappInteractionId':_0x489523['id'],'UserId':_0x3ec9c3[_0x321e('0xc8')]['id'],'ContactId':_0x2666be['id']}))[_0x321e('0x22')](function(_0xffd925){_0x489523[_0x321e('0xca')][_0x321e('0xc9')]=[];_0x489523['dataValues'][_0x321e('0xc9')]['push'](_0xffd925[_0x321e('0xca')]);return _0x489523;});})[_0x321e('0x22')](respondWithResult(_0x383a65,null))[_0x321e('0x2c')](handleError(_0x383a65,null));};
\ No newline at end of file
+var _0x5472=['nolimit','order','sort','pick','where','filter','merge','options','includeAll','rows','rawAttributes','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','WhatsappAccountId','Disposition','getDispositions','findOne','findAll','removeDispositions','ids','addAnswer','CannedAnswer','hasOwnProperty','removeAnswers','addAgents','omit','emit','userWhatsappAccount:save','removeAgents','isArray','userWhatsappAccount:remove','User','addApplications','sequelize','ISOLATION_LEVELS','READ_COMMITTED','WhatsappApplication','bulkCreate','priority','stack','finally','getApplications','whatsapp','Applications','account','statuses','read','WhatsappMessage','update','timestamp','message_id','orderBy','asc','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','mobile','From','replace','whatsapp:','Body','sinch','from','notifications','messageId','isNil','from\x20is\x20mandatory','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','contact','WhatsappInteraction','spread','interaction','created','applications','push','close','unmanaged','*,*,*,*','ContactId','UserId','unshift','agent','waitForTheAssignedAgent','startRouting','Start','receiveMessage','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','twilio','Content-Type','text/xml','<?xml\x20version=\x221.0\x22\x20encoding=\x22UTF-8\x22?>\x0a<Response></Response>','body\x20is\x20mandatory\x20and\x20not\x20empty','to\x20is\x20mandatory','List','out','Messages','dataValues','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','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/license/util','redis','defaults','socket.io-emitter','./whatsappAccount.socket','register','jayson/promise','http','request','info','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','WhatsappAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','save','then','get','WhatsappAccounts','UserProfileResource','destroy','end','name','send','index','Pause','mandatoryDispositionPause','map','WhatsappAccount','fieldName','type','keys','query','filters','intersection','model','attributes','fields','length'];(function(_0x1bc53d,_0x45db73){var _0x4fd791=function(_0xb96ea){while(--_0xb96ea){_0x1bc53d['push'](_0x1bc53d['shift']());}};_0x4fd791(++_0x45db73);}(_0x5472,0x76));var _0x2547=function(_0x34c2b3,_0x46b3fc){_0x34c2b3=_0x34c2b3-0x0;var _0x36a73f=_0x5472[_0x34c2b3];return _0x36a73f;};'use strict';var emlformat=require(_0x2547('0x0'));var rimraf=require(_0x2547('0x1'));var zipdir=require(_0x2547('0x2'));var jsonpatch=require(_0x2547('0x3'));var rp=require(_0x2547('0x4'));var moment=require(_0x2547('0x5'));var BPromise=require(_0x2547('0x6'));var Mustache=require(_0x2547('0x7'));var util=require('util');var path=require(_0x2547('0x8'));var sox=require('sox');var csv=require(_0x2547('0x9'));var ejs=require(_0x2547('0xa'));var fs=require('fs');var fs_extra=require(_0x2547('0xb'));var _=require(_0x2547('0xc'));var squel=require(_0x2547('0xd'));var crypto=require(_0x2547('0xe'));var jsforce=require(_0x2547('0xf'));var deskjs=require(_0x2547('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x2547('0x11'));var authService=require(_0x2547('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2547('0x13'));var logger=require('../../config/logger')(_0x2547('0x14'));var utils=require(_0x2547('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x2547('0x16'));var db=require('../../mysqldb')['db'];config[_0x2547('0x17')]=_[_0x2547('0x18')](config[_0x2547('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x2547('0x19'))(new Redis(config[_0x2547('0x17')]));require(_0x2547('0x1a'))[_0x2547('0x1b')](socket);var jayson=require(_0x2547('0x1c'));var client=jayson['client'][_0x2547('0x1d')]({'port':0x232c});function respondWithRpcPromise(_0x16a2a5,_0x1df586,_0x3a71cd,_0x45b135){return new BPromise(function(_0x2738b7,_0x150853){var _0x3840a4=_0x45b135||client;return _0x3840a4[_0x2547('0x1e')](_0x16a2a5,_0x3a71cd)['then'](function(_0x22362b){logger[_0x2547('0x1f')]('WhatsappAccount,\x20%s,\x20%s',_0x1df586,'request\x20sent');logger[_0x2547('0x20')](_0x2547('0x21'),_0x1df586,_0x2547('0x22'),JSON[_0x2547('0x23')](_0x22362b));if(_0x22362b[_0x2547('0x24')]){if(_0x22362b[_0x2547('0x24')]['code']===0x1f4){logger[_0x2547('0x24')](_0x2547('0x25'),_0x1df586,_0x22362b['error']['message']);return _0x150853(_0x22362b[_0x2547('0x24')][_0x2547('0x26')]);}logger['error'](_0x2547('0x25'),_0x1df586,_0x22362b['error'][_0x2547('0x26')]);return _0x2738b7(_0x22362b[_0x2547('0x24')][_0x2547('0x26')]);}else{logger[_0x2547('0x1f')](_0x2547('0x25'),_0x1df586,_0x2547('0x22'));_0x2738b7(_0x22362b[_0x2547('0x27')][_0x2547('0x26')]);}})[_0x2547('0x28')](function(_0x5d3974){logger[_0x2547('0x24')](_0x2547('0x25'),_0x1df586,_0x5d3974);_0x150853(_0x5d3974);});});}function respondWithStatusCode(_0x59679f,_0x117d3b){_0x117d3b=_0x117d3b||0xcc;return function(_0x5a8550){if(_0x5a8550){return _0x59679f[_0x2547('0x29')](_0x117d3b);}return _0x59679f[_0x2547('0x2a')](_0x117d3b)['end']();};}function respondWithResult(_0x63dace,_0xcf0403){_0xcf0403=_0xcf0403||0xc8;return function(_0x48ceaa){if(_0x48ceaa){return _0x63dace[_0x2547('0x2a')](_0xcf0403)[_0x2547('0x2b')](_0x48ceaa);}};}function respondWithFilteredResult(_0x21012c,_0x4916cb){return function(_0x566a64){if(_0x566a64){var _0x34ec95=typeof _0x4916cb[_0x2547('0x2c')]==='undefined'&&typeof _0x4916cb[_0x2547('0x2d')]===_0x2547('0x2e');var _0xa4d26b=_0x566a64[_0x2547('0x2f')];var _0x57fc63=_0x34ec95?0x0:_0x4916cb[_0x2547('0x2c')];var _0x2d2771=_0x34ec95?_0x566a64['count']:_0x4916cb[_0x2547('0x2c')]+_0x4916cb[_0x2547('0x2d')];var _0x3e10db;if(_0x2d2771>=_0xa4d26b){_0x2d2771=_0xa4d26b;_0x3e10db=0xc8;}else{_0x3e10db=0xce;}_0x21012c['status'](_0x3e10db);return _0x21012c[_0x2547('0x30')](_0x2547('0x31'),_0x57fc63+'-'+_0x2d2771+'/'+_0xa4d26b)[_0x2547('0x2b')](_0x566a64);}return null;};}function patchUpdates(_0x2f1f21){return function(_0x3b8ae1){try{jsonpatch[_0x2547('0x32')](_0x3b8ae1,_0x2f1f21,!![]);}catch(_0x23ad5d){return BPromise['reject'](_0x23ad5d);}return _0x3b8ae1[_0x2547('0x33')]();};}function saveUpdates(_0x487caa,_0x30f9ac){return function(_0x3ebbb2){if(_0x3ebbb2){return _0x3ebbb2['update'](_0x487caa)[_0x2547('0x34')](function(_0x11cb59){return _0x11cb59;});}return null;};}function removeEntity(_0x2e3210,_0x4e90df){return function(_0xbd8666){if(_0xbd8666){return _0xbd8666['destroy']()[_0x2547('0x34')](function(){var _0x448c51=_0xbd8666[_0x2547('0x35')]({'plain':!![]});var _0x2800b3=_0x2547('0x36');return db[_0x2547('0x37')][_0x2547('0x38')]({'where':{'type':_0x2800b3,'resourceId':_0x448c51['id']}})['then'](function(){return _0xbd8666;});})[_0x2547('0x34')](function(){_0x2e3210[_0x2547('0x2a')](0xcc)[_0x2547('0x39')]();});}};}function handleEntityNotFound(_0x295824,_0x29cbb8){return function(_0x2cc651){if(!_0x2cc651){_0x295824[_0x2547('0x29')](0x194);}return _0x2cc651;};}function handleError(_0x5a9214,_0x7a46b2){_0x7a46b2=_0x7a46b2||0x1f4;return function(_0x323cbb){logger[_0x2547('0x24')](_0x323cbb['stack']);if(_0x323cbb[_0x2547('0x3a')]){delete _0x323cbb[_0x2547('0x3a')];}_0x5a9214[_0x2547('0x2a')](_0x7a46b2)[_0x2547('0x3b')](_0x323cbb);};}exports[_0x2547('0x3c')]=function(_0x2fb4a6,_0x3b7e62){var _0x18419b={'include':[{'model':db[_0x2547('0x3d')],'as':_0x2547('0x3e')}]},_0x1f6923={},_0xbe9b86={'count':0x0,'rows':[]};var _0x465940=_[_0x2547('0x3f')](db[_0x2547('0x40')]['rawAttributes'],function(_0x4d2642){return{'name':_0x4d2642[_0x2547('0x41')],'type':_0x4d2642[_0x2547('0x42')]['key']};});_0x1f6923['model']=_[_0x2547('0x3f')](_0x465940,_0x2547('0x3a'));_0x1f6923['query']=_[_0x2547('0x43')](_0x2fb4a6[_0x2547('0x44')]);_0x1f6923[_0x2547('0x45')]=_[_0x2547('0x46')](_0x1f6923[_0x2547('0x47')],_0x1f6923[_0x2547('0x44')]);_0x18419b[_0x2547('0x48')]=_['intersection'](_0x1f6923[_0x2547('0x47')],qs[_0x2547('0x49')](_0x2fb4a6[_0x2547('0x44')][_0x2547('0x49')]));_0x18419b[_0x2547('0x48')]=_0x18419b[_0x2547('0x48')][_0x2547('0x4a')]?_0x18419b[_0x2547('0x48')]:_0x1f6923[_0x2547('0x47')];if(!_0x2fb4a6['query']['hasOwnProperty'](_0x2547('0x4b'))){_0x18419b[_0x2547('0x2d')]=qs[_0x2547('0x2d')](_0x2fb4a6['query'][_0x2547('0x2d')]);_0x18419b['offset']=qs[_0x2547('0x2c')](_0x2fb4a6[_0x2547('0x44')][_0x2547('0x2c')]);}_0x18419b[_0x2547('0x4c')]=qs[_0x2547('0x4d')](_0x2fb4a6[_0x2547('0x44')]['sort']);_0x18419b['where']=qs[_0x2547('0x45')](_[_0x2547('0x4e')](_0x2fb4a6[_0x2547('0x44')],_0x1f6923[_0x2547('0x45')]),_0x465940);if(_0x2fb4a6[_0x2547('0x44')]['filter']){_0x18419b[_0x2547('0x4f')]=_['merge'](_0x18419b[_0x2547('0x4f')],{'$or':_[_0x2547('0x3f')](_0x465940,function(_0x322315){if(_0x322315['type']!=='VIRTUAL'){var _0x297de1={};_0x297de1[_0x322315[_0x2547('0x3a')]]={'$like':'%'+_0x2fb4a6[_0x2547('0x44')][_0x2547('0x50')]+'%'};return _0x297de1;}})});}_0x18419b=_[_0x2547('0x51')]({},_0x18419b,_0x2fb4a6[_0x2547('0x52')]);var _0x30c8e3={'where':_0x18419b['where']};return db[_0x2547('0x40')]['count'](_0x30c8e3)[_0x2547('0x34')](function(_0x332615){_0xbe9b86[_0x2547('0x2f')]=_0x332615;if(_0x2fb4a6[_0x2547('0x44')][_0x2547('0x53')]){_0x18419b['include']=[{'all':!![]}];}return db[_0x2547('0x40')]['findAll'](_0x18419b);})[_0x2547('0x34')](function(_0x4af540){_0xbe9b86[_0x2547('0x54')]=_0x4af540;return _0xbe9b86;})[_0x2547('0x34')](respondWithFilteredResult(_0x3b7e62,_0x18419b))[_0x2547('0x28')](handleError(_0x3b7e62,null));};exports['show']=function(_0xe24cef,_0x5a36ab){var _0x9249fa={'raw':![],'where':{'id':_0xe24cef['params']['id']},'include':[{'model':db[_0x2547('0x3d')],'as':'mandatoryDispositionPause'}]},_0x2fb144={};_0x2fb144['model']=_[_0x2547('0x43')](db[_0x2547('0x40')][_0x2547('0x55')]);_0x2fb144[_0x2547('0x44')]=_['keys'](_0xe24cef['query']);_0x2fb144[_0x2547('0x45')]=_['intersection'](_0x2fb144[_0x2547('0x47')],_0x2fb144['query']);_0x9249fa[_0x2547('0x48')]=_[_0x2547('0x46')](_0x2fb144[_0x2547('0x47')],qs[_0x2547('0x49')](_0xe24cef['query'][_0x2547('0x49')]));_0x9249fa[_0x2547('0x48')]=_0x9249fa[_0x2547('0x48')]['length']?_0x9249fa[_0x2547('0x48')]:_0x2fb144[_0x2547('0x47')];if(_0xe24cef['query'][_0x2547('0x53')]){_0x9249fa[_0x2547('0x56')]=[{'all':!![]}];}_0x9249fa=_['merge']({},_0x9249fa,_0xe24cef[_0x2547('0x52')]);return db[_0x2547('0x40')][_0x2547('0x57')](_0x9249fa)[_0x2547('0x34')](handleEntityNotFound(_0x5a36ab,null))['then'](respondWithResult(_0x5a36ab,null))[_0x2547('0x28')](handleError(_0x5a36ab,null));};exports[_0x2547('0x58')]=function(_0xc2def5,_0x2db675){return db[_0x2547('0x40')][_0x2547('0x58')](_0xc2def5[_0x2547('0x59')],{})[_0x2547('0x34')](function(_0x47952c){var _0x113eb4=_0xc2def5[_0x2547('0x5a')]['get']({'plain':!![]});if(!_0x113eb4)throw new Error(_0x2547('0x5b'));if(_0x113eb4['role']===_0x2547('0x5a')){var _0x52f8e6=_0x47952c[_0x2547('0x35')]({'plain':!![]});var _0x17f58f=_0x2547('0x36');return db[_0x2547('0x5c')][_0x2547('0x57')]({'where':{'name':_0x17f58f,'userProfileId':_0x113eb4[_0x2547('0x5d')]},'raw':!![]})[_0x2547('0x34')](function(_0x2e3116){if(_0x2e3116&&_0x2e3116['autoAssociation']===0x0){return db[_0x2547('0x37')][_0x2547('0x58')]({'name':_0x52f8e6[_0x2547('0x3a')],'resourceId':_0x52f8e6['id'],'type':_0x2e3116[_0x2547('0x3a')],'sectionId':_0x2e3116['id']},{})[_0x2547('0x34')](function(){return _0x47952c;});}else{return _0x47952c;}})[_0x2547('0x28')](function(_0x55aa65){logger[_0x2547('0x24')](_0x2547('0x5e'),_0x55aa65);throw _0x55aa65;});}return _0x47952c;})[_0x2547('0x34')](respondWithResult(_0x2db675,0xc9))[_0x2547('0x28')](handleError(_0x2db675,null));};exports['update']=function(_0x1ebc02,_0x50b501){if(_0x1ebc02[_0x2547('0x59')]['id']){delete _0x1ebc02['body']['id'];}return db[_0x2547('0x40')]['find']({'where':{'id':_0x1ebc02[_0x2547('0x5f')]['id']},'include':[{'model':db[_0x2547('0x3d')],'as':_0x2547('0x3e')}]})[_0x2547('0x34')](handleEntityNotFound(_0x50b501,null))[_0x2547('0x34')](saveUpdates(_0x1ebc02[_0x2547('0x59')],null))[_0x2547('0x34')](respondWithResult(_0x50b501,null))[_0x2547('0x28')](handleError(_0x50b501,null));};exports[_0x2547('0x38')]=function(_0x2494cb,_0x33fc25){return db[_0x2547('0x40')][_0x2547('0x57')]({'where':{'id':_0x2494cb['params']['id']}})[_0x2547('0x34')](handleEntityNotFound(_0x33fc25,null))[_0x2547('0x34')](removeEntity(_0x33fc25,null))['catch'](handleError(_0x33fc25,null));};exports[_0x2547('0x60')]=function(_0x3caf5a,_0x40aad7){return db['WhatsappAccount'][_0x2547('0x60')]()[_0x2547('0x34')](respondWithResult(_0x40aad7,null))[_0x2547('0x28')](handleError(_0x40aad7,null));};exports[_0x2547('0x61')]=function(_0x48a5a6,_0x246273,_0x5f66e6){if(_0x48a5a6[_0x2547('0x59')]['id']){delete _0x48a5a6[_0x2547('0x59')]['id'];}return db['WhatsappAccount'][_0x2547('0x57')]({'where':{'id':_0x48a5a6[_0x2547('0x5f')]['id']}})[_0x2547('0x34')](handleEntityNotFound(_0x246273,null))[_0x2547('0x34')](function(_0x636103){if(_0x636103){_0x48a5a6[_0x2547('0x59')][_0x2547('0x62')]=_0x636103['id'];return db[_0x2547('0x63')][_0x2547('0x58')](_0x48a5a6[_0x2547('0x59')]);}})[_0x2547('0x34')](respondWithResult(_0x246273,null))[_0x2547('0x28')](handleError(_0x246273,null));};exports[_0x2547('0x64')]=function(_0x530dbe,_0x1406a6,_0x470590){var _0x397060={'raw':![],'where':{}};var _0x1497c6={};var _0x1c323e={'count':0x0,'rows':[]};return db['WhatsappAccount'][_0x2547('0x65')]({'where':{'id':_0x530dbe[_0x2547('0x5f')]['id']}})['then'](handleEntityNotFound(_0x1406a6,null))['then'](function(_0x19de29){if(_0x19de29){_0x1497c6[_0x2547('0x47')]=_[_0x2547('0x43')](db[_0x2547('0x63')]['rawAttributes']);_0x1497c6[_0x2547('0x44')]=_[_0x2547('0x43')](_0x530dbe[_0x2547('0x44')]);_0x1497c6['filters']=_[_0x2547('0x46')](_0x1497c6[_0x2547('0x47')],_0x1497c6[_0x2547('0x44')]);_0x397060[_0x2547('0x48')]=_[_0x2547('0x46')](_0x1497c6[_0x2547('0x47')],qs[_0x2547('0x49')](_0x530dbe[_0x2547('0x44')][_0x2547('0x49')]));_0x397060[_0x2547('0x48')]=_0x397060[_0x2547('0x48')][_0x2547('0x4a')]?_0x397060['attributes']:_0x1497c6[_0x2547('0x47')];if(!_0x530dbe[_0x2547('0x44')]['hasOwnProperty'](_0x2547('0x4b'))){_0x397060[_0x2547('0x2d')]=qs[_0x2547('0x2d')](_0x530dbe[_0x2547('0x44')]['limit']);_0x397060['offset']=qs[_0x2547('0x2c')](_0x530dbe[_0x2547('0x44')]['offset']);}_0x397060[_0x2547('0x4c')]=qs['sort'](_0x530dbe[_0x2547('0x44')][_0x2547('0x4d')]);_0x397060[_0x2547('0x4f')]=qs['filters'](_[_0x2547('0x4e')](_0x530dbe['query'],_0x1497c6[_0x2547('0x45')]));_0x397060['where'][_0x2547('0x62')]=_0x19de29['id'];if(_0x530dbe[_0x2547('0x44')]['filter']){_0x397060['where']=_['merge'](_0x397060[_0x2547('0x4f')],{'$or':_[_0x2547('0x3f')](_0x397060[_0x2547('0x48')],function(_0x4c101c){var _0x45d70a={};_0x45d70a[_0x4c101c]={'$like':'%'+_0x530dbe[_0x2547('0x44')]['filter']+'%'};return _0x45d70a;})});}_0x397060=_[_0x2547('0x51')]({},_0x397060,_0x530dbe[_0x2547('0x52')]);return db[_0x2547('0x63')][_0x2547('0x2f')]({'where':_0x397060[_0x2547('0x4f')]})[_0x2547('0x34')](function(_0x2da54d){_0x1c323e[_0x2547('0x2f')]=_0x2da54d;if(_0x530dbe[_0x2547('0x44')][_0x2547('0x53')]){_0x397060[_0x2547('0x56')]=[{'all':!![]}];}return db['Disposition'][_0x2547('0x66')](_0x397060);})[_0x2547('0x34')](function(_0x3a04d0){_0x1c323e['rows']=_0x3a04d0;return _0x1c323e;});}})[_0x2547('0x34')](respondWithFilteredResult(_0x1406a6,_0x397060))[_0x2547('0x28')](handleError(_0x1406a6,null));};exports[_0x2547('0x67')]=function(_0x3cbcf0,_0x3f86b2,_0x13bea3){return db['WhatsappAccount'][_0x2547('0x57')]({'where':{'id':_0x3cbcf0[_0x2547('0x5f')]['id']}})[_0x2547('0x34')](handleEntityNotFound(_0x3f86b2,null))['then'](function(_0x463814){if(_0x463814){return _0x463814[_0x2547('0x67')](_0x3cbcf0[_0x2547('0x44')][_0x2547('0x68')]);}})[_0x2547('0x34')](respondWithStatusCode(_0x3f86b2,null))[_0x2547('0x28')](handleError(_0x3f86b2,null));};exports[_0x2547('0x69')]=function(_0x587190,_0x372df8,_0x15733a){if(_0x587190[_0x2547('0x59')]['id']){delete _0x587190['body']['id'];}return db[_0x2547('0x40')]['find']({'where':{'id':_0x587190['params']['id']}})['then'](handleEntityNotFound(_0x372df8,null))[_0x2547('0x34')](function(_0x24c5fd){if(_0x24c5fd){_0x587190['body']['WhatsappAccountId']=_0x24c5fd['id'];return db[_0x2547('0x6a')][_0x2547('0x58')](_0x587190[_0x2547('0x59')]);}})[_0x2547('0x34')](respondWithResult(_0x372df8,null))[_0x2547('0x28')](handleError(_0x372df8,null));};exports['getAnswers']=function(_0x1052fe,_0xad76bb,_0x23d03d){var _0x52b232={'raw':![],'where':{}};var _0x309efb={};var _0x491f17={'count':0x0,'rows':[]};return db[_0x2547('0x40')]['findOne']({'where':{'id':_0x1052fe['params']['id']}})['then'](handleEntityNotFound(_0xad76bb,null))[_0x2547('0x34')](function(_0x947eca){if(_0x947eca){_0x309efb[_0x2547('0x47')]=_[_0x2547('0x43')](db[_0x2547('0x6a')]['rawAttributes']);_0x309efb['query']=_[_0x2547('0x43')](_0x1052fe['query']);_0x309efb[_0x2547('0x45')]=_[_0x2547('0x46')](_0x309efb['model'],_0x309efb['query']);_0x52b232['attributes']=_['intersection'](_0x309efb[_0x2547('0x47')],qs[_0x2547('0x49')](_0x1052fe[_0x2547('0x44')][_0x2547('0x49')]));_0x52b232[_0x2547('0x48')]=_0x52b232[_0x2547('0x48')]['length']?_0x52b232[_0x2547('0x48')]:_0x309efb[_0x2547('0x47')];if(!_0x1052fe[_0x2547('0x44')][_0x2547('0x6b')]('nolimit')){_0x52b232['limit']=qs[_0x2547('0x2d')](_0x1052fe[_0x2547('0x44')]['limit']);_0x52b232[_0x2547('0x2c')]=qs[_0x2547('0x2c')](_0x1052fe[_0x2547('0x44')][_0x2547('0x2c')]);}_0x52b232[_0x2547('0x4c')]=qs[_0x2547('0x4d')](_0x1052fe[_0x2547('0x44')][_0x2547('0x4d')]);_0x52b232[_0x2547('0x4f')]=qs['filters'](_['pick'](_0x1052fe['query'],_0x309efb[_0x2547('0x45')]));_0x52b232['where'][_0x2547('0x62')]=_0x947eca['id'];if(_0x1052fe[_0x2547('0x44')][_0x2547('0x50')]){_0x52b232['where']=_[_0x2547('0x51')](_0x52b232[_0x2547('0x4f')],{'$or':_[_0x2547('0x3f')](_0x52b232[_0x2547('0x48')],function(_0xa7b7ee){var _0x4e3314={};_0x4e3314[_0xa7b7ee]={'$like':'%'+_0x1052fe['query'][_0x2547('0x50')]+'%'};return _0x4e3314;})});}_0x52b232=_[_0x2547('0x51')]({},_0x52b232,_0x1052fe['options']);return db[_0x2547('0x6a')][_0x2547('0x2f')]({'where':_0x52b232[_0x2547('0x4f')]})[_0x2547('0x34')](function(_0x19238c){_0x491f17['count']=_0x19238c;if(_0x1052fe[_0x2547('0x44')]['includeAll']){_0x52b232['include']=[{'all':!![]}];}return db[_0x2547('0x6a')][_0x2547('0x66')](_0x52b232);})[_0x2547('0x34')](function(_0x27f6fb){_0x491f17[_0x2547('0x54')]=_0x27f6fb;return _0x491f17;});}})['then'](respondWithFilteredResult(_0xad76bb,_0x52b232))[_0x2547('0x28')](handleError(_0xad76bb,null));};exports[_0x2547('0x6c')]=function(_0x543b27,_0x5be981,_0x47569f){return db[_0x2547('0x40')]['find']({'where':{'id':_0x543b27[_0x2547('0x5f')]['id']}})[_0x2547('0x34')](handleEntityNotFound(_0x5be981,null))[_0x2547('0x34')](function(_0x5c4165){if(_0x5c4165){return _0x5c4165[_0x2547('0x6c')](_0x543b27[_0x2547('0x44')][_0x2547('0x68')]);}})[_0x2547('0x34')](respondWithStatusCode(_0x5be981,null))[_0x2547('0x28')](handleError(_0x5be981,null));};exports[_0x2547('0x6d')]=function(_0x41ae3c,_0x5b4e9c,_0xfe1856){return db[_0x2547('0x40')][_0x2547('0x57')]({'where':{'id':_0x41ae3c[_0x2547('0x5f')]['id']}})[_0x2547('0x34')](handleEntityNotFound(_0x5b4e9c,null))[_0x2547('0x34')](function(_0x560dfe){if(_0x560dfe){return _0x560dfe[_0x2547('0x6d')](_0x41ae3c[_0x2547('0x59')][_0x2547('0x68')],_[_0x2547('0x6e')](_0x41ae3c['body'],[_0x2547('0x68'),'id'])||{})['spread'](function(_0x1543e9){for(var _0x4131cf=0x0;_0x4131cf<_0x41ae3c[_0x2547('0x59')]['ids']['length'];_0x4131cf+=0x1){socket[_0x2547('0x6f')](_0x2547('0x70'),{'UserId':Number(_0x41ae3c[_0x2547('0x59')][_0x2547('0x68')][_0x4131cf]),'WhatsappAccountId':Number(_0x41ae3c[_0x2547('0x5f')]['id'])});}return _0x1543e9;});}})['then'](respondWithResult(_0x5b4e9c,null))[_0x2547('0x28')](handleError(_0x5b4e9c,null));};exports['removeAgents']=function(_0x29a7ba,_0x26c265,_0x14c199){return db[_0x2547('0x40')]['find']({'where':{'id':_0x29a7ba[_0x2547('0x5f')]['id']}})[_0x2547('0x34')](handleEntityNotFound(_0x26c265,null))[_0x2547('0x34')](function(_0x48d6e0){if(_0x48d6e0){return _0x48d6e0[_0x2547('0x71')](_0x29a7ba[_0x2547('0x44')][_0x2547('0x68')])['then'](function(){if(_[_0x2547('0x72')](_0x29a7ba['query'][_0x2547('0x68')])){for(var _0x520634=0x0;_0x520634<_0x29a7ba[_0x2547('0x44')][_0x2547('0x68')]['length'];_0x520634+=0x1){socket[_0x2547('0x6f')](_0x2547('0x73'),{'UserId':Number(_0x29a7ba[_0x2547('0x44')][_0x2547('0x68')][_0x520634]),'WhatsappAccountId':Number(_0x29a7ba[_0x2547('0x5f')]['id'])});}}else{socket[_0x2547('0x6f')](_0x2547('0x73'),{'UserId':Number(_0x29a7ba['query'][_0x2547('0x68')]),'WhatsappAccountId':Number(_0x29a7ba[_0x2547('0x5f')]['id'])});}});}})[_0x2547('0x34')](respondWithStatusCode(_0x26c265,null))[_0x2547('0x28')](handleError(_0x26c265,null));};exports['getAgents']=function(_0x128d2a,_0x5499a5,_0x2be3a3){var _0xb3469b={};var _0x7d3677={};var _0x300fdb;var _0x25f084;return db['WhatsappAccount'][_0x2547('0x65')]({'where':{'id':_0x128d2a[_0x2547('0x5f')]['id']}})[_0x2547('0x34')](handleEntityNotFound(_0x5499a5,null))[_0x2547('0x34')](function(_0x51f811){if(_0x51f811){_0x300fdb=_0x51f811;_0x7d3677[_0x2547('0x47')]=_['keys'](db[_0x2547('0x74')]['rawAttributes']);_0x7d3677['query']=_[_0x2547('0x43')](_0x128d2a[_0x2547('0x44')]);_0x7d3677[_0x2547('0x45')]=_[_0x2547('0x46')](_0x7d3677[_0x2547('0x47')],_0x7d3677[_0x2547('0x44')]);_0xb3469b['attributes']=_['intersection'](_0x7d3677[_0x2547('0x47')],qs['fields'](_0x128d2a[_0x2547('0x44')]['fields']));_0xb3469b[_0x2547('0x48')]=_0xb3469b[_0x2547('0x48')][_0x2547('0x4a')]?_0xb3469b[_0x2547('0x48')]:_0x7d3677[_0x2547('0x47')];_0xb3469b['order']=qs['sort'](_0x128d2a['query']['sort']);_0xb3469b[_0x2547('0x4f')]=qs[_0x2547('0x45')](_[_0x2547('0x4e')](_0x128d2a[_0x2547('0x44')],_0x7d3677[_0x2547('0x45')]));if(_0x128d2a[_0x2547('0x44')][_0x2547('0x50')]){_0xb3469b[_0x2547('0x4f')]=_[_0x2547('0x51')](_0xb3469b['where'],{'$or':_[_0x2547('0x3f')](_0xb3469b[_0x2547('0x48')],function(_0x30646c){var _0x4c3550={};_0x4c3550[_0x30646c]={'$like':'%'+_0x128d2a[_0x2547('0x44')]['filter']+'%'};return _0x4c3550;})});}_0xb3469b=_[_0x2547('0x51')]({},_0xb3469b,_0x128d2a[_0x2547('0x52')]);return _0x300fdb['getAgents'](_0xb3469b);}})[_0x2547('0x34')](function(_0x9ecdaa){if(_0x9ecdaa){_0x25f084=_0x9ecdaa[_0x2547('0x4a')];if(!_0x128d2a['query'][_0x2547('0x6b')](_0x2547('0x4b'))){_0xb3469b[_0x2547('0x2d')]=qs[_0x2547('0x2d')](_0x128d2a[_0x2547('0x44')][_0x2547('0x2d')]);_0xb3469b['offset']=qs['offset'](_0x128d2a['query'][_0x2547('0x2c')]);}return _0x300fdb['getAgents'](_0xb3469b);}})['then'](function(_0x4ccd68){if(_0x4ccd68){return _0x4ccd68?{'count':_0x25f084,'rows':_0x4ccd68}:null;}})[_0x2547('0x34')](respondWithResult(_0x5499a5,null))[_0x2547('0x28')](handleError(_0x5499a5,null));};exports[_0x2547('0x75')]=function(_0x112d28,_0x276e46){var _0x15b4d4=_0x112d28['params']['id'];var _0x4a38c9=_0x112d28[_0x2547('0x59')];var _0x1eb822=0xc8;var _0x2bcc89=null;return db['sequelize']['transaction']({'isolationLevel':db[_0x2547('0x76')]['Transaction'][_0x2547('0x77')][_0x2547('0x78')]},function(_0x2a34aa){return db[_0x2547('0x40')]['findOne']({'where':{'id':_0x15b4d4},'transaction':_0x2a34aa})[_0x2547('0x34')](function(_0x4b5628){if(_0x4b5628){return db['WhatsappApplication'][_0x2547('0x38')]({'where':{'WhatsappAccountId':_0x15b4d4},'transaction':_0x2a34aa})[_0x2547('0x34')](function(){var _0x24f67e=_[_0x2547('0x3f')](_0x4a38c9,function(_0x470370){_0x470370['WhatsappAccountId']=_0x15b4d4;return _0x470370;});return db[_0x2547('0x79')][_0x2547('0x7a')](_0x24f67e,{'transaction':_0x2a34aa});});}else{_0x1eb822=0x194;_0x2bcc89=[];}});})[_0x2547('0x34')](function(){if(_0x1eb822!==0x194){return db[_0x2547('0x79')]['findAndCountAll']({'where':{'WhatsappAccountId':_0x15b4d4},'order':_0x2547('0x7b')})['then'](function(_0xf6ef6a){_0x2bcc89=_0xf6ef6a;});}})[_0x2547('0x28')](function(_0x24f35b){_0x1eb822=0x1f4;logger[_0x2547('0x24')](_0x24f35b[_0x2547('0x7c')]);if(_0x24f35b[_0x2547('0x3a')]){delete _0x24f35b[_0x2547('0x3a')];}_0x2bcc89=_0x24f35b;})[_0x2547('0x7d')](function(){if(_0x2bcc89===null){_0x276e46['sendStatus'](_0x1eb822);}else{if(_0x1eb822===0x1f4){_0x276e46[_0x2547('0x2a')](_0x1eb822)[_0x2547('0x3b')](_0x2bcc89);}else{_0x276e46[_0x2547('0x2a')](_0x1eb822)['json'](_0x2bcc89);}}});};exports['getApplications']=function(_0x55f1ae,_0x2e12d5,_0x2096a7){var _0xe9ec8b={};var _0x1e224c={};var _0x42ab63;var _0x2f583d;return db['WhatsappAccount'][_0x2547('0x65')]({'where':{'id':_0x55f1ae['params']['id']}})[_0x2547('0x34')](handleEntityNotFound(_0x2e12d5,null))[_0x2547('0x34')](function(_0x4691ac){if(_0x4691ac){_0x42ab63=_0x4691ac;_0x1e224c[_0x2547('0x47')]=_[_0x2547('0x43')](db[_0x2547('0x79')]['rawAttributes']);_0x1e224c['query']=_[_0x2547('0x43')](_0x55f1ae[_0x2547('0x44')]);_0x1e224c['filters']=_[_0x2547('0x46')](_0x1e224c['model'],_0x1e224c['query']);_0xe9ec8b['attributes']=_[_0x2547('0x46')](_0x1e224c[_0x2547('0x47')],qs[_0x2547('0x49')](_0x55f1ae[_0x2547('0x44')]['fields']));_0xe9ec8b[_0x2547('0x48')]=_0xe9ec8b[_0x2547('0x48')][_0x2547('0x4a')]?_0xe9ec8b[_0x2547('0x48')]:_0x1e224c['model'];_0xe9ec8b[_0x2547('0x4c')]=qs[_0x2547('0x4d')](_0x55f1ae[_0x2547('0x44')]['sort']);_0xe9ec8b[_0x2547('0x4f')]=qs[_0x2547('0x45')](_['pick'](_0x55f1ae[_0x2547('0x44')],_0x1e224c[_0x2547('0x45')]));if(_0x55f1ae['query'][_0x2547('0x50')]){_0xe9ec8b[_0x2547('0x4f')]=_[_0x2547('0x51')](_0xe9ec8b[_0x2547('0x4f')],{'$or':_[_0x2547('0x3f')](_0xe9ec8b[_0x2547('0x48')],function(_0x169b0d){var _0x58e296={};_0x58e296[_0x169b0d]={'$like':'%'+_0x55f1ae[_0x2547('0x44')][_0x2547('0x50')]+'%'};return _0x58e296;})});}_0xe9ec8b=_[_0x2547('0x51')]({},_0xe9ec8b,_0x55f1ae[_0x2547('0x52')]);return _0x42ab63[_0x2547('0x7e')](_0xe9ec8b);}})['then'](function(_0x57ba62){if(_0x57ba62){_0x2f583d=_0x57ba62[_0x2547('0x4a')];if(!_0x55f1ae['query'][_0x2547('0x6b')](_0x2547('0x4b'))){_0xe9ec8b['limit']=qs[_0x2547('0x2d')](_0x55f1ae[_0x2547('0x44')][_0x2547('0x2d')]);_0xe9ec8b[_0x2547('0x2c')]=qs[_0x2547('0x2c')](_0x55f1ae[_0x2547('0x44')]['offset']);}return _0x42ab63[_0x2547('0x7e')](_0xe9ec8b);}})[_0x2547('0x34')](function(_0xea3e59){if(_0xea3e59){return _0xea3e59?{'count':_0x2f583d,'rows':_0xea3e59}:null;}})[_0x2547('0x34')](respondWithResult(_0x2e12d5,null))[_0x2547('0x28')](handleError(_0x2e12d5,null));};exports['notify']=function(_0x2b877f,_0x2867ae,_0x3e49fc){var _0x19e310={'channel':_0x2547('0x7f')};var _0x43cdec=[];var _0x2e9f00=[];var _0x23ad3b={};return db['WhatsappAccount'][_0x2547('0x57')]({'where':{'id':_0x2b877f['params']['id']},'include':[{'model':db[_0x2547('0x79')],'as':_0x2547('0x80')}]})[_0x2547('0x34')](handleEntityNotFound(_0x2867ae,null))[_0x2547('0x34')](function(_0x1aeaca){_0x19e310[_0x2547('0x81')]=_0x1aeaca;if(_0x19e310[_0x2547('0x81')]&&_0x19e310[_0x2547('0x81')]['type']==='sinch'&&_0x2b877f[_0x2547('0x59')][_0x2547('0x82')]){if(_0x2b877f[_0x2547('0x59')][_0x2547('0x82')][_0x2547('0x4a')]===0x0)return;if(_0x2b877f[_0x2547('0x59')][_0x2547('0x82')][0x0]['state']!==_0x2547('0x83'))return;return db[_0x2547('0x84')][_0x2547('0x85')]({'read':!![],'readAt':_0x2b877f[_0x2547('0x59')][_0x2547('0x82')][0x0][_0x2547('0x86')]},{'where':{'messageId':_0x2b877f[_0x2547('0x59')][_0x2547('0x82')][0x0][_0x2547('0x87')]},'individualHooks':!![]})['then'](function(_0x3a990c){return _0x2867ae[_0x2547('0x2a')](0xc8)['json'](_0x3a990c);});}_0x19e310['applications']=_[_0x2547('0x88')](_0x1aeaca['Applications'],['priority'],[_0x2547('0x89')]);if(_0x19e310[_0x2547('0x81')][_0x2547('0x80')]){delete _0x19e310[_0x2547('0x81')][_0x2547('0x80')];}return db[_0x2547('0x8a')]['describe']()[_0x2547('0x34')](function(_0x36cafb){if(!_0x36cafb){throw new db[(_0x2547('0x8b'))][(_0x2547('0x8c'))](_0x2547('0x8d'));}_0x43cdec=_[_0x2547('0x8e')](_[_0x2547('0x43')](_0x36cafb),[_0x2547('0x8f'),'updatedAt']);_0x2e9f00=_['difference'](_[_0x2547('0x43')](_0x36cafb),[_0x2547('0x8f'),_0x2547('0x90'),_0x2547('0x91'),_0x2547('0x92')]);_0x19e310[_0x2547('0x59')]={'mapKey':_0x2547('0x93')};if(_0x19e310[_0x2547('0x81')]&&_0x19e310['account'][_0x2547('0x42')]==='twilio'){_0x19e310[_0x2547('0x59')]['from']=_0x2b877f[_0x2547('0x59')][_0x2547('0x94')][_0x2547('0x95')](_0x2547('0x96'),'');_0x19e310[_0x2547('0x59')][_0x2547('0x59')]=_0x2b877f[_0x2547('0x59')][_0x2547('0x97')];_0x19e310[_0x2547('0x59')]['messageId']=_0x2b877f['body']['MessageSid'];}if(_0x19e310[_0x2547('0x81')]&&_0x19e310[_0x2547('0x81')]['type']===_0x2547('0x98')){_0x19e310[_0x2547('0x59')][_0x2547('0x99')]=_0x2b877f[_0x2547('0x59')]['notifications'][0x0][_0x2547('0x99')];_0x19e310[_0x2547('0x59')][_0x2547('0x59')]=_0x2b877f[_0x2547('0x59')][_0x2547('0x9a')][0x0][_0x2547('0x26')][_0x2547('0x59')];_0x19e310[_0x2547('0x59')][_0x2547('0x9b')]=_0x2b877f[_0x2547('0x59')][_0x2547('0x9a')][0x0]['message_id'];}if(_0x19e310[_0x2547('0x59')]['id']){delete _0x19e310[_0x2547('0x59')]['id'];}if(_[_0x2547('0x9c')](_0x19e310['body']['from'])){throw new db['Sequelize'][(_0x2547('0x8c'))](_0x2547('0x9d'));}if(_[_0x2547('0x9c')](_0x19e310[_0x2547('0x59')]['body'])||_0x19e310[_0x2547('0x59')][_0x2547('0x59')]===''){throw new db[(_0x2547('0x8b'))][(_0x2547('0x8c'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x19e310[_0x2547('0x59')]['mapKey'])){throw new db[(_0x2547('0x8b'))][(_0x2547('0x8c'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2e9f00);}if(!_[_0x2547('0x9e')](_0x2e9f00,_0x19e310[_0x2547('0x59')][_0x2547('0x9f')])){throw new db[(_0x2547('0x8b'))]['ValidationError'](_0x2547('0xa0')+_0x2e9f00);}_0x23ad3b[_0x19e310['body'][_0x2547('0x9f')]]=_0x19e310[_0x2547('0x59')][_0x2547('0x99')];return db[_0x2547('0xa1')][_0x2547('0x57')]({'where':{'id':_0x19e310[_0x2547('0x81')]['ListId']},'include':[{'model':db[_0x2547('0x8a')],'as':_0x2547('0xa2'),'where':_0x23ad3b,'limit':0x1,'order':[[_0x2547('0x90'),'DESC']]}]});})['then'](handleEntityNotFound(_0x2867ae,null))[_0x2547('0x34')](function(_0x24923e){if(_0x24923e){_0x19e310['list']=_['omit'](_0x24923e,[_0x2547('0xa2')]);if(_0x24923e[_0x2547('0xa2')]['length']){return _0x24923e['Contacts'][0x0];}var _0x5e88c6=_[_0x2547('0x18')](_0x19e310[_0x2547('0x59')],{'firstName':_0x19e310['body'][_0x2547('0x99')],'ListId':_0x24923e['id']});_0x5e88c6[_0x19e310[_0x2547('0x59')][_0x2547('0x9f')]]=_0x19e310['body'][_0x2547('0x99')];return db['CmContact'][_0x2547('0x58')](_0x5e88c6,{'fields':_0x43cdec,'raw':!![]});}})[_0x2547('0x34')](handleEntityNotFound(_0x2867ae,null))[_0x2547('0x34')](function(_0x2422a9){if(_0x2422a9){_0x19e310[_0x2547('0xa3')]=_0x2422a9;var _0x12ee3f={'ContactId':_0x2422a9['id'],'phone':_0x19e310['body'][_0x2547('0x99')],'WhatsappAccountId':_0x2b877f[_0x2547('0x5f')]['id']};var _0x5245ef={'ContactId':_0x2422a9['id'],'WhatsappAccountId':_0x2b877f['params']['id'],'closed':![]};return db[_0x2547('0xa4')][_0x2547('0x57')]({'where':_0x5245ef})[_0x2547('0x34')](function(_0x2e7e2e){if(_0x2e7e2e){return[_0x2e7e2e,![]];}return db[_0x2547('0xa4')][_0x2547('0x58')](_0x12ee3f)[_0x2547('0x34')](function(_0x42b9a4){return[_0x42b9a4,!![]];});});}})[_0x2547('0xa5')](function(_0x477346,_0x2993c7){_0x19e310[_0x2547('0xa6')]=_0x477346[_0x2547('0x35')]({'plain':!![]});_0x19e310[_0x2547('0xa6')][_0x2547('0xa7')]=![];if(_0x2993c7){if(_0x19e310[_0x2547('0x81')]['autoclose']){_0x19e310[_0x2547('0xa8')][_0x2547('0xa9')]({'id':0x0,'priority':_0x19e310['applications'][_0x2547('0x4a')]+0x1,'app':_0x2547('0xaa'),'appdata':_0x2547('0xab'),'interval':_0x2547('0xac')});}_0x19e310[_0x2547('0xa6')][_0x2547('0xa7')]=!![];}return db[_0x2547('0x84')]['create']({'phone':_0x19e310['body'][_0x2547('0x99')],'messageId':_0x19e310[_0x2547('0x59')][_0x2547('0x9b')],'body':_0x19e310['body']['body'],'WhatsappAccountId':_0x2b877f[_0x2547('0x5f')]['id'],'WhatsappInteractionId':_0x477346['id'],'direction':'in','ContactId':_0x477346[_0x2547('0xad')],'AttachmentId':_0x19e310['body']['AttachmentId']});})[_0x2547('0x34')](function(_0x199e07){_0x19e310[_0x2547('0x26')]=_0x199e07;if(_0x19e310[_0x2547('0xa6')][_0x2547('0xae')]){return db[_0x2547('0x74')]['find']({'attributes':['id',_0x2547('0x3a')],'where':{'id':_0x19e310[_0x2547('0xa6')][_0x2547('0xae')]}})[_0x2547('0x34')](function(_0x338efc){if(_0x338efc){_0x19e310[_0x2547('0xa8')][_0x2547('0xaf')]({'id':0x0,'priority':0x0,'app':_0x2547('0xb0'),'appdata':_0x338efc[_0x2547('0x3a')]+','+(_0x19e310[_0x2547('0x81')][_0x2547('0xb1')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise('Start',_0x2547('0xb2'),_0x19e310);});}return respondWithRpcPromise(_0x2547('0xb3'),_0x2547('0xb2'),_0x19e310);})[_0x2547('0x34')](function(_0x25b969){if(_0x25b969){var _0x482e92=0xc8;var _0x35e5db=_0x2547('0xb4');logger[_0x2547('0x1f')](_0x2547('0x21'),_0x35e5db,_0x482e92,_0x2547('0xb5'));logger[_0x2547('0x20')](_0x2547('0xb6'),_0x35e5db,_0x482e92,_0x2547('0xb5'),JSON[_0x2547('0x23')](_0x25b969));if(_0x19e310[_0x2547('0x81')][_0x2547('0x42')]===_0x2547('0xb7')){return _0x2867ae['status'](_0x482e92)[_0x2547('0x30')](_0x2547('0xb8'),_0x2547('0xb9'))[_0x2547('0x3b')](_0x2547('0xba'));}else{return _0x2867ae[_0x2547('0x2a')](_0x482e92)[_0x2547('0x2b')](_0x25b969);}}});})[_0x2547('0x28')](handleError(_0x2867ae,null));};exports[_0x2547('0x3b')]=function(_0x38fb32,_0xea9bc4,_0x2c07f9){var _0x6904ae,_0x563108,_0x1f5faa;if(_[_0x2547('0x9c')](_0x38fb32['body']['body'])||_0x38fb32[_0x2547('0x59')]['body']===''){throw new db[(_0x2547('0x8b'))][(_0x2547('0x8c'))](_0x2547('0xbb'));}if(_['isNil'](_0x38fb32[_0x2547('0x59')]['to'])){throw new db[(_0x2547('0x8b'))][(_0x2547('0x8c'))](_0x2547('0xbc'));}_0x6904ae=_0x38fb32[_0x2547('0x59')]['to'];return db[_0x2547('0x40')][_0x2547('0x57')]({'where':{'id':_0x38fb32[_0x2547('0x5f')]['id']},'include':[{'model':db['CmList'],'as':_0x2547('0xbd'),'include':[{'model':db[_0x2547('0x8a')],'as':_0x2547('0xa2'),'where':{'mobile':_0x6904ae},'limit':0x1,'order':[[_0x2547('0x90'),'DESC']]}]}]})['then'](handleEntityNotFound(_0xea9bc4,null))[_0x2547('0x34')](function(_0x4936f6){if(_0x4936f6&&_0x4936f6[_0x2547('0xbd')]){_0x563108=_0x4936f6[_0x2547('0x35')]({'plain':!![]});if(_0x563108['List']&&_0x563108[_0x2547('0xbd')]['Contacts']['length']){return _0x563108[_0x2547('0xbd')]['Contacts'][0x0];}return db['CmContact'][_0x2547('0x58')](_[_0x2547('0x18')](_0x38fb32[_0x2547('0x59')],{'firstName':_0x6904ae,'mobile':_0x6904ae,'phone':_0x6904ae,'ListId':_0x563108[_0x2547('0x92')]}));}})[_0x2547('0x34')](handleEntityNotFound(_0xea9bc4,null))[_0x2547('0x34')](function(_0x124e20){if(_0x124e20){_0x1f5faa=_0x124e20;return db[_0x2547('0xa4')][_0x2547('0x57')]({'where':{'ContactId':_0x1f5faa['id'],'closed':![],'WhatsappAccountId':_0x563108['id']}})[_0x2547('0x34')](function(_0x5d1589){if(_0x5d1589){return[_0x5d1589,![]];}return db[_0x2547('0xa4')][_0x2547('0x58')]({'UserId':_0x38fb32[_0x2547('0x5a')]['id'],'ContactId':_0x1f5faa['id'],'WhatsappAccountId':_0x563108['id'],'phone':_0x6904ae,'firstMsgDirection':_0x2547('0xbe'),'Messages':[_[_0x2547('0x51')](_0x38fb32[_0x2547('0x59')],{'read':![],'body':_0x38fb32['body']['body'],'phone':_0x6904ae,'WhatsappAccountId':_0x563108['id'],'UserId':_0x38fb32[_0x2547('0x5a')]['id'],'ContactId':_0x1f5faa['id']})]},{'include':[{'model':db[_0x2547('0x84')],'as':_0x2547('0xbf')}]})[_0x2547('0x34')](function(_0x2875fb){return[_0x2875fb,!![]];});});}})['spread'](function(_0x231f9a,_0x23d790){if(_0x23d790){return _0x231f9a;}return db['WhatsappMessage'][_0x2547('0x58')](_[_0x2547('0x51')](_0x38fb32['body'],{'read':![],'body':_0x38fb32[_0x2547('0x59')][_0x2547('0x59')],'phone':_0x6904ae,'WhatsappAccountId':_0x563108['id'],'WhatsappInteractionId':_0x231f9a['id'],'UserId':_0x38fb32[_0x2547('0x5a')]['id'],'ContactId':_0x1f5faa['id']}))['then'](function(_0x11843e){_0x231f9a[_0x2547('0xc0')][_0x2547('0xbf')]=[];_0x231f9a[_0x2547('0xc0')][_0x2547('0xbf')]['push'](_0x11843e[_0x2547('0xc0')]);return _0x231f9a;});})['then'](respondWithResult(_0xea9bc4,null))['catch'](handleError(_0xea9bc4,null));};
\ No newline at end of file
index 00eb887..ad962c7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f5f=['remove','emit','hasOwnProperty','hook','exports','events','update'];(function(_0x59ee41,_0xaf7db8){var _0x3ecd3e=function(_0x2f9291){while(--_0x2f9291){_0x59ee41['push'](_0x59ee41['shift']());}};_0x3ecd3e(++_0xaf7db8);}(_0x5f5f,0x15c));var _0xf5f5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5f5f[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0xf5f5('0x0'));var WhatsappAccount=require('../../mysqldb')['db']['WhatsappAccount'];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xf5f5('0x1'),'afterDestroy':_0xf5f5('0x2')};function emitEvent(_0x469df2){return function(_0x209273,_0x2671c3,_0x273357){WhatsappAccountEvents[_0xf5f5('0x3')](_0x469df2+':'+_0x209273['id'],_0x209273);WhatsappAccountEvents[_0xf5f5('0x3')](_0x469df2,_0x209273);_0x273357(null);};}for(var e in events){if(events[_0xf5f5('0x4')](e)){var event=events[e];WhatsappAccount[_0xf5f5('0x5')](e,emitEvent(event));}}module[_0xf5f5('0x6')]=WhatsappAccountEvents;
\ No newline at end of file
+var _0x790b=['../../mysqldb','setMaxListeners','save','emit','hasOwnProperty','hook','exports'];(function(_0x879177,_0x55a48e){var _0x1f737a=function(_0x5ba11a){while(--_0x5ba11a){_0x879177['push'](_0x879177['shift']());}};_0x1f737a(++_0x55a48e);}(_0x790b,0x70));var _0xb790=function(_0x2cf986,_0x54bbea){_0x2cf986=_0x2cf986-0x0;var _0x20e954=_0x790b[_0x2cf986];return _0x20e954;};'use strict';var EventEmitter=require('events');var WhatsappAccount=require(_0xb790('0x0'))['db']['WhatsappAccount'];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0xb790('0x1')](0x0);var events={'afterCreate':_0xb790('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x1b481a){return function(_0x292fbe,_0x599fdf,_0xda25e8){WhatsappAccountEvents[_0xb790('0x3')](_0x1b481a+':'+_0x292fbe['id'],_0x292fbe);WhatsappAccountEvents[_0xb790('0x3')](_0x1b481a,_0x292fbe);_0xda25e8(null);};}for(var e in events){if(events[_0xb790('0x4')](e)){var event=events[e];WhatsappAccount[_0xb790('0x5')](e,emitEvent(event));}}module[_0xb790('0x6')]=WhatsappAccountEvents;
\ No newline at end of file
index 9db6499..105261f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7af8=['../../config/logger','moment','request-promise','path','../../config/environment','./whatsappAccount.attributes','WhatsappAccount','whatsapp_accounts','lodash','util'];(function(_0x414641,_0x24ef8c){var _0x1d17e4=function(_0x5e67d1){while(--_0x5e67d1){_0x414641['push'](_0x414641['shift']());}};_0x1d17e4(++_0x24ef8c);}(_0x7af8,0x152));var _0x87af=function(_0x186199,_0x4c6d33){_0x186199=_0x186199-0x0;var _0x3888fa=_0x7af8[_0x186199];return _0x3888fa;};'use strict';var _=require(_0x87af('0x0'));var util=require(_0x87af('0x1'));var logger=require(_0x87af('0x2'))('api');var moment=require(_0x87af('0x3'));var BPromise=require('bluebird');var rp=require(_0x87af('0x4'));var fs=require('fs');var path=require(_0x87af('0x5'));var rimraf=require('rimraf');var config=require(_0x87af('0x6'));var attributes=require(_0x87af('0x7'));module['exports']=function(_0x500e2d,_0x9631da){return _0x500e2d['define'](_0x87af('0x8'),attributes,{'tableName':_0x87af('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4828=['whatsapp_accounts','lodash','util','moment','bluebird','request-promise','path','rimraf','./whatsappAccount.attributes','exports','define','WhatsappAccount'];(function(_0x18e7e5,_0x5ad463){var _0x30c78a=function(_0x473e33){while(--_0x473e33){_0x18e7e5['push'](_0x18e7e5['shift']());}};_0x30c78a(++_0x5ad463);}(_0x4828,0x91));var _0x8482=function(_0x587f3a,_0x160bad){_0x587f3a=_0x587f3a-0x0;var _0x4fead2=_0x4828[_0x587f3a];return _0x4fead2;};'use strict';var _=require(_0x8482('0x0'));var util=require(_0x8482('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x8482('0x2'));var BPromise=require(_0x8482('0x3'));var rp=require(_0x8482('0x4'));var fs=require('fs');var path=require(_0x8482('0x5'));var rimraf=require(_0x8482('0x6'));var config=require('../../config/environment');var attributes=require(_0x8482('0x7'));module[_0x8482('0x8')]=function(_0x5080bf,_0xa0d35d){return _0x5080bf[_0x8482('0x9')](_0x8482('0xa'),attributes,{'tableName':_0x8482('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index cfdd858..a6d6253 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3427=['stringify','error','code','message','result','catch','ShowWhatsappAccount','find','options','raw','include','map','attributes','model','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','http','redis','socket.io-emitter','./whatsappAccount.socket','register','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','WhatsappAccount,\x20%s,\x20%s,\x20%s'];(function(_0x58e469,_0x95ee3e){var _0x4c01c5=function(_0x1ef7ae){while(--_0x1ef7ae){_0x58e469['push'](_0x58e469['shift']());}};_0x4c01c5(++_0x95ee3e);}(_0x3427,0x11f));var _0x7342=function(_0x379034,_0x3c7ccb){_0x379034=_0x379034-0x0;var _0x5aaf85=_0x3427[_0x379034];return _0x5aaf85;};'use strict';var _=require(_0x7342('0x0'));var util=require(_0x7342('0x1'));var moment=require(_0x7342('0x2'));var BPromise=require(_0x7342('0x3'));var rs=require(_0x7342('0x4'));var fs=require('fs');var Redis=require(_0x7342('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x7342('0x6'))(_0x7342('0x7'));var config=require(_0x7342('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7342('0x9')]({'port':0x232a});config[_0x7342('0xa')]=_['defaults'](config[_0x7342('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x7342('0xb'))(new Redis(config[_0x7342('0xa')]));require(_0x7342('0xc'))[_0x7342('0xd')](socket);function respondWithRpcPromise(_0x2bfca7,_0x5aee8c,_0x4752a4){return new BPromise(function(_0x5be5ca,_0x54d56f){return client['request'](_0x2bfca7,_0x4752a4)[_0x7342('0xe')](function(_0x33b71a){logger[_0x7342('0xf')](_0x7342('0x10'),_0x5aee8c,_0x7342('0x11'));logger['debug'](_0x7342('0x12'),_0x5aee8c,_0x7342('0x11'),JSON[_0x7342('0x13')](_0x33b71a));if(_0x33b71a['error']){if(_0x33b71a[_0x7342('0x14')][_0x7342('0x15')]===0x1f4){logger[_0x7342('0x14')](_0x7342('0x10'),_0x5aee8c,_0x33b71a[_0x7342('0x14')][_0x7342('0x16')]);return _0x54d56f(_0x33b71a['error'][_0x7342('0x16')]);}logger[_0x7342('0x14')]('WhatsappAccount,\x20%s,\x20%s',_0x5aee8c,_0x33b71a[_0x7342('0x14')]['message']);return _0x5be5ca(_0x33b71a[_0x7342('0x14')][_0x7342('0x16')]);}else{logger[_0x7342('0xf')](_0x7342('0x10'),_0x5aee8c,_0x7342('0x11'));_0x5be5ca(_0x33b71a[_0x7342('0x17')]['message']);}})[_0x7342('0x18')](function(_0x259d08){logger[_0x7342('0x14')](_0x7342('0x10'),_0x5aee8c,_0x259d08);_0x54d56f(_0x259d08);});});}exports[_0x7342('0x19')]=function(_0x3d2622){var _0x30576d=this;return new Promise(function(_0x588291,_0x6fa095){return db['WhatsappAccount'][_0x7342('0x1a')]({'raw':_0x3d2622[_0x7342('0x1b')]?_0x3d2622[_0x7342('0x1b')][_0x7342('0x1c')]===undefined?!![]:![]:!![],'where':_0x3d2622[_0x7342('0x1b')]?_0x3d2622[_0x7342('0x1b')]['where']||null:null,'attributes':_0x3d2622[_0x7342('0x1b')]?_0x3d2622[_0x7342('0x1b')]['attributes']||null:null,'include':_0x3d2622[_0x7342('0x1b')]?_0x3d2622[_0x7342('0x1b')][_0x7342('0x1d')]?_[_0x7342('0x1e')](_0x3d2622['options']['include'],function(_0xa0ce56){return{'model':db[_0xa0ce56['model']],'as':_0xa0ce56['as'],'attributes':_0xa0ce56[_0x7342('0x1f')],'include':_0xa0ce56['include']?_[_0x7342('0x1e')](_0xa0ce56[_0x7342('0x1d')],function(_0x4fddfa){return{'model':db[_0x4fddfa[_0x7342('0x20')]],'as':_0x4fddfa['as'],'attributes':_0x4fddfa[_0x7342('0x1f')],'include':_0x4fddfa[_0x7342('0x1d')]?_[_0x7342('0x1e')](_0x4fddfa['include'],function(_0x45b0db){return{'model':db[_0x45b0db[_0x7342('0x20')]],'as':_0x45b0db['as'],'attributes':_0x45b0db['attributes']};}):[]};}):[]};}):[]:[]})[_0x7342('0xe')](function(_0x4c33dd){logger[_0x7342('0xf')](_0x7342('0x19'),_0x3d2622);logger[_0x7342('0x21')](_0x7342('0x19'),_0x3d2622,JSON[_0x7342('0x13')](_0x4c33dd));_0x588291(_0x4c33dd);})[_0x7342('0x18')](function(_0x20eb47){logger[_0x7342('0x14')](_0x7342('0x19'),_0x20eb47[_0x7342('0x16')],_0x3d2622);_0x6fa095(_0x30576d[_0x7342('0x14')](0x1f4,_0x20eb47[_0x7342('0x16')]));});});};
\ No newline at end of file
+var _0xf0c3=['model','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','register','request','then','request\x20sent','WhatsappAccount,\x20%s,\x20%s,\x20%s','error','WhatsappAccount,\x20%s,\x20%s','message','info','result','catch','ShowWhatsappAccount','WhatsappAccount','find','options','where','attributes','include','map'];(function(_0x343bd9,_0x546514){var _0x3345e=function(_0x4aa917){while(--_0x4aa917){_0x343bd9['push'](_0x343bd9['shift']());}};_0x3345e(++_0x546514);}(_0xf0c3,0x104));var _0x3f0c=function(_0x283d91,_0x42bb77){_0x283d91=_0x283d91-0x0;var _0x7d21de=_0xf0c3[_0x283d91];return _0x7d21de;};'use strict';var _=require(_0x3f0c('0x0'));var util=require(_0x3f0c('0x1'));var moment=require('moment');var BPromise=require(_0x3f0c('0x2'));var rs=require(_0x3f0c('0x3'));var fs=require('fs');var Redis=require(_0x3f0c('0x4'));var db=require(_0x3f0c('0x5'))['db'];var utils=require(_0x3f0c('0x6'));var logger=require(_0x3f0c('0x7'))(_0x3f0c('0x8'));var config=require(_0x3f0c('0x9'));var jayson=require(_0x3f0c('0xa'));var client=jayson[_0x3f0c('0xb')]['http']({'port':0x232a});config[_0x3f0c('0xc')]=_[_0x3f0c('0xd')](config['redis'],{'host':_0x3f0c('0xe'),'port':0x18eb});var socket=require(_0x3f0c('0xf'))(new Redis(config[_0x3f0c('0xc')]));require(_0x3f0c('0x10'))[_0x3f0c('0x11')](socket);function respondWithRpcPromise(_0x17b594,_0x5d00d2,_0x54e770){return new BPromise(function(_0x184d7e,_0x34028c){return client[_0x3f0c('0x12')](_0x17b594,_0x54e770)[_0x3f0c('0x13')](function(_0x46bf3c){logger['info']('WhatsappAccount,\x20%s,\x20%s',_0x5d00d2,_0x3f0c('0x14'));logger['debug'](_0x3f0c('0x15'),_0x5d00d2,_0x3f0c('0x14'),JSON['stringify'](_0x46bf3c));if(_0x46bf3c[_0x3f0c('0x16')]){if(_0x46bf3c[_0x3f0c('0x16')]['code']===0x1f4){logger[_0x3f0c('0x16')](_0x3f0c('0x17'),_0x5d00d2,_0x46bf3c[_0x3f0c('0x16')][_0x3f0c('0x18')]);return _0x34028c(_0x46bf3c[_0x3f0c('0x16')][_0x3f0c('0x18')]);}logger[_0x3f0c('0x16')](_0x3f0c('0x17'),_0x5d00d2,_0x46bf3c['error'][_0x3f0c('0x18')]);return _0x184d7e(_0x46bf3c['error'][_0x3f0c('0x18')]);}else{logger[_0x3f0c('0x19')](_0x3f0c('0x17'),_0x5d00d2,_0x3f0c('0x14'));_0x184d7e(_0x46bf3c[_0x3f0c('0x1a')][_0x3f0c('0x18')]);}})[_0x3f0c('0x1b')](function(_0x22cf07){logger[_0x3f0c('0x16')](_0x3f0c('0x17'),_0x5d00d2,_0x22cf07);_0x34028c(_0x22cf07);});});}exports[_0x3f0c('0x1c')]=function(_0x50d15e){var _0x175620=this;return new Promise(function(_0x302aeb,_0xca5a95){return db[_0x3f0c('0x1d')][_0x3f0c('0x1e')]({'raw':_0x50d15e['options']?_0x50d15e[_0x3f0c('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x50d15e[_0x3f0c('0x1f')]?_0x50d15e[_0x3f0c('0x1f')][_0x3f0c('0x20')]||null:null,'attributes':_0x50d15e['options']?_0x50d15e[_0x3f0c('0x1f')][_0x3f0c('0x21')]||null:null,'include':_0x50d15e[_0x3f0c('0x1f')]?_0x50d15e['options'][_0x3f0c('0x22')]?_[_0x3f0c('0x23')](_0x50d15e[_0x3f0c('0x1f')][_0x3f0c('0x22')],function(_0x4dca78){return{'model':db[_0x4dca78[_0x3f0c('0x24')]],'as':_0x4dca78['as'],'attributes':_0x4dca78['attributes'],'include':_0x4dca78[_0x3f0c('0x22')]?_[_0x3f0c('0x23')](_0x4dca78[_0x3f0c('0x22')],function(_0x258c45){return{'model':db[_0x258c45[_0x3f0c('0x24')]],'as':_0x258c45['as'],'attributes':_0x258c45[_0x3f0c('0x21')],'include':_0x258c45[_0x3f0c('0x22')]?_[_0x3f0c('0x23')](_0x258c45[_0x3f0c('0x22')],function(_0x433b40){return{'model':db[_0x433b40[_0x3f0c('0x24')]],'as':_0x433b40['as'],'attributes':_0x433b40[_0x3f0c('0x21')]};}):[]};}):[]};}):[]:[]})[_0x3f0c('0x13')](function(_0x1706aa){logger['info'](_0x3f0c('0x1c'),_0x50d15e);logger['debug'](_0x3f0c('0x1c'),_0x50d15e,JSON['stringify'](_0x1706aa));_0x302aeb(_0x1706aa);})['catch'](function(_0xc999e7){logger[_0x3f0c('0x16')](_0x3f0c('0x1c'),_0xc999e7[_0x3f0c('0x18')],_0x50d15e);_0xca5a95(_0x175620[_0x3f0c('0x16')](0x1f4,_0xc999e7[_0x3f0c('0x18')]));});});};
\ No newline at end of file
index dd79d69..b4a8b7f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x43d2=['update','emit','register','whatsappAccount:','./whatsappAccount.events','save'];(function(_0x4e03de,_0x59aff5){var _0x5e4868=function(_0x3df580){while(--_0x3df580){_0x4e03de['push'](_0x4e03de['shift']());}};_0x5e4868(++_0x59aff5);}(_0x43d2,0x1b4));var _0x243d=function(_0x26707c,_0x1ee0cc){_0x26707c=_0x26707c-0x0;var _0x11e7aa=_0x43d2[_0x26707c];return _0x11e7aa;};'use strict';var WhatsappAccountEvents=require(_0x243d('0x0'));var events=[_0x243d('0x1'),'remove',_0x243d('0x2')];function createListener(_0x47f3bb,_0x5de3e1){return function(_0x35d25e){_0x5de3e1[_0x243d('0x3')](_0x47f3bb,_0x35d25e);};}function removeListener(_0x4c56e2,_0x32ccf9){return function(){WhatsappAccountEvents['removeListener'](_0x4c56e2,_0x32ccf9);};}exports[_0x243d('0x4')]=function(_0x58ff7a){for(var _0x293de9=0x0,_0x481f60=events['length'];_0x293de9<_0x481f60;_0x293de9++){var _0x314803=events[_0x293de9];var _0x2314da=createListener(_0x243d('0x5')+_0x314803,_0x58ff7a);WhatsappAccountEvents['on'](_0x314803,_0x2314da);}};
\ No newline at end of file
+var _0x2d4c=['./whatsappAccount.events','save','remove','update','emit','removeListener','whatsappAccount:'];(function(_0x146f9c,_0x43fa83){var _0x24d6b5=function(_0x14a8be){while(--_0x14a8be){_0x146f9c['push'](_0x146f9c['shift']());}};_0x24d6b5(++_0x43fa83);}(_0x2d4c,0x16c));var _0xc2d4=function(_0x162c59,_0x292e9d){_0x162c59=_0x162c59-0x0;var _0x5d812c=_0x2d4c[_0x162c59];return _0x5d812c;};'use strict';var WhatsappAccountEvents=require(_0xc2d4('0x0'));var events=[_0xc2d4('0x1'),_0xc2d4('0x2'),_0xc2d4('0x3')];function createListener(_0xaabc2c,_0x164453){return function(_0x3221ed){_0x164453[_0xc2d4('0x4')](_0xaabc2c,_0x3221ed);};}function removeListener(_0x46c7c1,_0x5a80ce){return function(){WhatsappAccountEvents[_0xc2d4('0x5')](_0x46c7c1,_0x5a80ce);};}exports['register']=function(_0x5ead4c){for(var _0x41b8ef=0x0,_0x1372f8=events['length'];_0x41b8ef<_0x1372f8;_0x41b8ef++){var _0x136d30=events[_0x41b8ef];var _0x8b98f0=createListener(_0xc2d4('0x6')+_0x136d30,_0x5ead4c);WhatsappAccountEvents['on'](_0x136d30,_0x8b98f0);}};
\ No newline at end of file
index bb82712..cd21b1d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4899=['util','path','connect-timeout','express','fs-extra','../../config/environment','./whatsappApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x4899,0x1df));var _0x9489=function(_0x285224,_0x4f0770){_0x285224=_0x285224-0x0;var _0xeb0aac=_0x4899[_0x285224];return _0xeb0aac;};'use strict';var multer=require(_0x9489('0x0'));var util=require(_0x9489('0x1'));var path=require(_0x9489('0x2'));var timeout=require(_0x9489('0x3'));var express=require(_0x9489('0x4'));var router=express['Router']();var fs_extra=require(_0x9489('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x9489('0x6'));var controller=require(_0x9489('0x7'));router[_0x9489('0x8')]('/',auth[_0x9489('0x9')](),controller[_0x9489('0xa')]);router[_0x9489('0x8')](_0x9489('0xb'),auth[_0x9489('0x9')](),controller[_0x9489('0xc')]);router[_0x9489('0xd')]('/',auth['isAuthenticated'](),controller[_0x9489('0xe')]);router[_0x9489('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x9489('0x10')]);router[_0x9489('0x11')](_0x9489('0xb'),auth[_0x9489('0x9')](),controller[_0x9489('0x12')]);module[_0x9489('0x13')]=router;
\ No newline at end of file
+var _0x1506=['/:id','show','post','isAuthenticated','create','put','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./whatsappApplication.controller','index','get'];(function(_0x249999,_0x288ff1){var _0x233078=function(_0x428d23){while(--_0x428d23){_0x249999['push'](_0x249999['shift']());}};_0x233078(++_0x288ff1);}(_0x1506,0x95));var _0x6150=function(_0x59dadc,_0x56896a){_0x59dadc=_0x59dadc-0x0;var _0xa26f74=_0x1506[_0x59dadc];return _0xa26f74;};'use strict';var multer=require('multer');var util=require(_0x6150('0x0'));var path=require(_0x6150('0x1'));var timeout=require(_0x6150('0x2'));var express=require(_0x6150('0x3'));var router=express[_0x6150('0x4')]();var fs_extra=require(_0x6150('0x5'));var auth=require(_0x6150('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x6150('0x7'));var controller=require(_0x6150('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x6150('0x9')]);router[_0x6150('0xa')](_0x6150('0xb'),auth['isAuthenticated'](),controller[_0x6150('0xc')]);router[_0x6150('0xd')]('/',auth[_0x6150('0xe')](),controller[_0x6150('0xf')]);router[_0x6150('0x10')](_0x6150('0xb'),auth[_0x6150('0xe')](),controller['update']);router[_0x6150('0x11')](_0x6150('0xb'),auth['isAuthenticated'](),controller[_0x6150('0x12')]);module[_0x6150('0x13')]=router;
\ No newline at end of file
index 20fabac..79ba87e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x105e=['exports','INTEGER','STRING','noop','TEXT','*,*,*,*','sequelize'];(function(_0x54bdf9,_0x4befd9){var _0x4f7035=function(_0x437767){while(--_0x437767){_0x54bdf9['push'](_0x54bdf9['shift']());}};_0x4f7035(++_0x4befd9);}(_0x105e,0x6f));var _0xe105=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x105e[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xe105('0x0'));module[_0xe105('0x1')]={'priority':{'type':Sequelize[_0xe105('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xe105('0x3')],'allowNull':![],'defaultValue':_0xe105('0x4')},'appdata':{'type':Sequelize[_0xe105('0x5')]()},'description':{'type':Sequelize[_0xe105('0x3')]},'interval':{'type':Sequelize[_0xe105('0x3')],'defaultValue':_0xe105('0x6')}};
\ No newline at end of file
+var _0xbef9=['INTEGER','noop','STRING','*,*,*,*','sequelize','exports'];(function(_0x1e4510,_0x178584){var _0x1f4b75=function(_0x23ea58){while(--_0x23ea58){_0x1e4510['push'](_0x1e4510['shift']());}};_0x1f4b75(++_0x178584);}(_0xbef9,0xe8));var _0x9bef=function(_0x190800,_0x35fc4e){_0x190800=_0x190800-0x0;var _0x3d1d4f=_0xbef9[_0x190800];return _0x3d1d4f;};'use strict';var Sequelize=require(_0x9bef('0x0'));module[_0x9bef('0x1')]={'priority':{'type':Sequelize[_0x9bef('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x9bef('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x9bef('0x4')]},'interval':{'type':Sequelize[_0x9bef('0x4')],'defaultValue':_0x9bef('0x5')}};
\ No newline at end of file
index 83cb5b9..e8ba494 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdcd5=['send','index','map','WhatsappApplication','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','include','findAll','rows','catch','show','params','keys','rawAttributes','length','includeAll','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','error','stack','name'];(function(_0xa5ab8c,_0x2d75d1){var _0x5b5003=function(_0x4e158c){while(--_0x4e158c){_0xa5ab8c['push'](_0xa5ab8c['shift']());}};_0x5b5003(++_0x2d75d1);}(_0xdcd5,0x110));var _0x5dcd=function(_0x386c3e,_0x44a375){_0x386c3e=_0x386c3e-0x0;var _0x4b8e13=_0xdcd5[_0x386c3e];return _0x4b8e13;};'use strict';var emlformat=require(_0x5dcd('0x0'));var rimraf=require(_0x5dcd('0x1'));var zipdir=require(_0x5dcd('0x2'));var jsonpatch=require(_0x5dcd('0x3'));var rp=require(_0x5dcd('0x4'));var moment=require(_0x5dcd('0x5'));var BPromise=require(_0x5dcd('0x6'));var Mustache=require('mustache');var util=require(_0x5dcd('0x7'));var path=require(_0x5dcd('0x8'));var sox=require(_0x5dcd('0x9'));var csv=require(_0x5dcd('0xa'));var ejs=require(_0x5dcd('0xb'));var fs=require('fs');var fs_extra=require(_0x5dcd('0xc'));var _=require(_0x5dcd('0xd'));var squel=require(_0x5dcd('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5dcd('0xf'));var toCsv=require(_0x5dcd('0xa'));var querystring=require(_0x5dcd('0x10'));var Papa=require('papaparse');var Redis=require(_0x5dcd('0x11'));var authService=require(_0x5dcd('0x12'));var qs=require(_0x5dcd('0x13'));var as=require(_0x5dcd('0x14'));var hardwareService=require(_0x5dcd('0x15'));var logger=require(_0x5dcd('0x16'))(_0x5dcd('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5dcd('0x18'));var db=require(_0x5dcd('0x19'))['db'];function respondWithStatusCode(_0x4e213f,_0x250f9a){_0x250f9a=_0x250f9a||0xcc;return function(_0x7cf873){if(_0x7cf873){return _0x4e213f[_0x5dcd('0x1a')](_0x250f9a);}return _0x4e213f[_0x5dcd('0x1b')](_0x250f9a)[_0x5dcd('0x1c')]();};}function respondWithResult(_0x2ff0cb,_0x2b66bf){_0x2b66bf=_0x2b66bf||0xc8;return function(_0x40062e){if(_0x40062e){return _0x2ff0cb['status'](_0x2b66bf)[_0x5dcd('0x1d')](_0x40062e);}};}function respondWithFilteredResult(_0x2b61bf,_0x538be9){return function(_0x43b71f){if(_0x43b71f){var _0x537aed=typeof _0x538be9[_0x5dcd('0x1e')]===_0x5dcd('0x1f')&&typeof _0x538be9[_0x5dcd('0x20')]==='undefined';var _0x1a4643=_0x43b71f[_0x5dcd('0x21')];var _0xc7d7d7=_0x537aed?0x0:_0x538be9['offset'];var _0x3e23fa=_0x537aed?_0x43b71f[_0x5dcd('0x21')]:_0x538be9[_0x5dcd('0x1e')]+_0x538be9['limit'];var _0x1e423c;if(_0x3e23fa>=_0x1a4643){_0x3e23fa=_0x1a4643;_0x1e423c=0xc8;}else{_0x1e423c=0xce;}_0x2b61bf[_0x5dcd('0x1b')](_0x1e423c);return _0x2b61bf[_0x5dcd('0x22')](_0x5dcd('0x23'),_0xc7d7d7+'-'+_0x3e23fa+'/'+_0x1a4643)['json'](_0x43b71f);}return null;};}function patchUpdates(_0x11d296){return function(_0x4c392a){try{jsonpatch['apply'](_0x4c392a,_0x11d296,!![]);}catch(_0x557e94){return BPromise[_0x5dcd('0x24')](_0x557e94);}return _0x4c392a[_0x5dcd('0x25')]();};}function saveUpdates(_0x23a21d,_0x8a43fc){return function(_0x305466){if(_0x305466){return _0x305466[_0x5dcd('0x26')](_0x23a21d)[_0x5dcd('0x27')](function(_0x46102a){return _0x46102a;});}return null;};}function removeEntity(_0x40e847,_0x270390){return function(_0x5d3fa0){if(_0x5d3fa0){return _0x5d3fa0[_0x5dcd('0x28')]()[_0x5dcd('0x27')](function(){_0x40e847[_0x5dcd('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x30fe1f,_0x4b07c7){return function(_0xc0cadb){if(!_0xc0cadb){_0x30fe1f[_0x5dcd('0x1a')](0x194);}return _0xc0cadb;};}function handleError(_0x3b2b2b,_0x5337a3){_0x5337a3=_0x5337a3||0x1f4;return function(_0xf30ac6){logger[_0x5dcd('0x29')](_0xf30ac6[_0x5dcd('0x2a')]);if(_0xf30ac6[_0x5dcd('0x2b')]){delete _0xf30ac6[_0x5dcd('0x2b')];}_0x3b2b2b['status'](_0x5337a3)[_0x5dcd('0x2c')](_0xf30ac6);};}exports[_0x5dcd('0x2d')]=function(_0x440e47,_0x28e53f){var _0x1a87a5={},_0x1ba4cf={},_0x24f91f={'count':0x0,'rows':[]};var _0x16c744=_[_0x5dcd('0x2e')](db[_0x5dcd('0x2f')]['rawAttributes'],function(_0x3bed3f){return{'name':_0x3bed3f['fieldName'],'type':_0x3bed3f['type'][_0x5dcd('0x30')]};});_0x1ba4cf[_0x5dcd('0x31')]=_['map'](_0x16c744,_0x5dcd('0x2b'));_0x1ba4cf[_0x5dcd('0x32')]=_['keys'](_0x440e47[_0x5dcd('0x32')]);_0x1ba4cf[_0x5dcd('0x33')]=_[_0x5dcd('0x34')](_0x1ba4cf[_0x5dcd('0x31')],_0x1ba4cf['query']);_0x1a87a5['attributes']=_[_0x5dcd('0x34')](_0x1ba4cf[_0x5dcd('0x31')],qs['fields'](_0x440e47['query'][_0x5dcd('0x35')]));_0x1a87a5['attributes']=_0x1a87a5[_0x5dcd('0x36')]['length']?_0x1a87a5['attributes']:_0x1ba4cf[_0x5dcd('0x31')];if(!_0x440e47[_0x5dcd('0x32')][_0x5dcd('0x37')](_0x5dcd('0x38'))){_0x1a87a5[_0x5dcd('0x20')]=qs[_0x5dcd('0x20')](_0x440e47[_0x5dcd('0x32')][_0x5dcd('0x20')]);_0x1a87a5[_0x5dcd('0x1e')]=qs[_0x5dcd('0x1e')](_0x440e47[_0x5dcd('0x32')][_0x5dcd('0x1e')]);}_0x1a87a5[_0x5dcd('0x39')]=qs[_0x5dcd('0x3a')](_0x440e47[_0x5dcd('0x32')][_0x5dcd('0x3a')]);_0x1a87a5[_0x5dcd('0x3b')]=qs[_0x5dcd('0x33')](_[_0x5dcd('0x3c')](_0x440e47['query'],_0x1ba4cf[_0x5dcd('0x33')]),_0x16c744);if(_0x440e47[_0x5dcd('0x32')]['filter']){_0x1a87a5[_0x5dcd('0x3b')]=_[_0x5dcd('0x3d')](_0x1a87a5[_0x5dcd('0x3b')],{'$or':_[_0x5dcd('0x2e')](_0x16c744,function(_0xab1e78){if(_0xab1e78[_0x5dcd('0x3e')]!==_0x5dcd('0x3f')){var _0x53df30={};_0x53df30[_0xab1e78[_0x5dcd('0x2b')]]={'$like':'%'+_0x440e47[_0x5dcd('0x32')][_0x5dcd('0x40')]+'%'};return _0x53df30;}})});}_0x1a87a5=_[_0x5dcd('0x3d')]({},_0x1a87a5,_0x440e47[_0x5dcd('0x41')]);var _0xc745a3={'where':_0x1a87a5['where']};return db['WhatsappApplication']['count'](_0xc745a3)[_0x5dcd('0x27')](function(_0x4888ae){_0x24f91f['count']=_0x4888ae;if(_0x440e47['query']['includeAll']){_0x1a87a5[_0x5dcd('0x42')]=[{'all':!![]}];}return db[_0x5dcd('0x2f')][_0x5dcd('0x43')](_0x1a87a5);})['then'](function(_0x14fdcc){_0x24f91f[_0x5dcd('0x44')]=_0x14fdcc;return _0x24f91f;})[_0x5dcd('0x27')](respondWithFilteredResult(_0x28e53f,_0x1a87a5))[_0x5dcd('0x45')](handleError(_0x28e53f,null));};exports[_0x5dcd('0x46')]=function(_0x39c46a,_0x28a5d3){var _0x419cf3={'raw':!![],'where':{'id':_0x39c46a[_0x5dcd('0x47')]['id']}},_0x3f3907={};_0x3f3907[_0x5dcd('0x31')]=_[_0x5dcd('0x48')](db[_0x5dcd('0x2f')][_0x5dcd('0x49')]);_0x3f3907['query']=_['keys'](_0x39c46a[_0x5dcd('0x32')]);_0x3f3907[_0x5dcd('0x33')]=_[_0x5dcd('0x34')](_0x3f3907[_0x5dcd('0x31')],_0x3f3907[_0x5dcd('0x32')]);_0x419cf3[_0x5dcd('0x36')]=_[_0x5dcd('0x34')](_0x3f3907['model'],qs[_0x5dcd('0x35')](_0x39c46a[_0x5dcd('0x32')][_0x5dcd('0x35')]));_0x419cf3[_0x5dcd('0x36')]=_0x419cf3[_0x5dcd('0x36')][_0x5dcd('0x4a')]?_0x419cf3[_0x5dcd('0x36')]:_0x3f3907[_0x5dcd('0x31')];if(_0x39c46a[_0x5dcd('0x32')][_0x5dcd('0x4b')]){_0x419cf3[_0x5dcd('0x42')]=[{'all':!![]}];}_0x419cf3=_[_0x5dcd('0x3d')]({},_0x419cf3,_0x39c46a[_0x5dcd('0x41')]);return db[_0x5dcd('0x2f')]['find'](_0x419cf3)[_0x5dcd('0x27')](handleEntityNotFound(_0x28a5d3,null))[_0x5dcd('0x27')](respondWithResult(_0x28a5d3,null))['catch'](handleError(_0x28a5d3,null));};exports[_0x5dcd('0x4c')]=function(_0x3caeab,_0x4bacf9){return db['WhatsappApplication'][_0x5dcd('0x4c')](_0x3caeab[_0x5dcd('0x4d')],{})[_0x5dcd('0x27')](respondWithResult(_0x4bacf9,0xc9))[_0x5dcd('0x45')](handleError(_0x4bacf9,null));};exports[_0x5dcd('0x26')]=function(_0x6105d3,_0x24caac){if(_0x6105d3['body']['id']){delete _0x6105d3[_0x5dcd('0x4d')]['id'];}return db[_0x5dcd('0x2f')][_0x5dcd('0x4e')]({'where':{'id':_0x6105d3[_0x5dcd('0x47')]['id']}})[_0x5dcd('0x27')](handleEntityNotFound(_0x24caac,null))[_0x5dcd('0x27')](saveUpdates(_0x6105d3[_0x5dcd('0x4d')],null))['then'](respondWithResult(_0x24caac,null))[_0x5dcd('0x45')](handleError(_0x24caac,null));};exports[_0x5dcd('0x28')]=function(_0x8e9b1,_0x32a25b){return db['WhatsappApplication'][_0x5dcd('0x4e')]({'where':{'id':_0x8e9b1[_0x5dcd('0x47')]['id']}})[_0x5dcd('0x27')](handleEntityNotFound(_0x32a25b,null))[_0x5dcd('0x27')](removeEntity(_0x32a25b,null))['catch'](handleError(_0x32a25b,null));};
\ No newline at end of file
+var _0x47c5=['rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','map','VIRTUAL','filter','merge','count','includeAll','include','findAll','show','params','options','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','destroy','then','stack','name','send','index','WhatsappApplication'];(function(_0x297913,_0x39132b){var _0x297c2f=function(_0x44592f){while(--_0x44592f){_0x297913['push'](_0x297913['shift']());}};_0x297c2f(++_0x39132b);}(_0x47c5,0x165));var _0x547c=function(_0x2dc367,_0x591c8a){_0x2dc367=_0x2dc367-0x0;var _0x14845a=_0x47c5[_0x2dc367];return _0x14845a;};'use strict';var emlformat=require(_0x547c('0x0'));var rimraf=require(_0x547c('0x1'));var zipdir=require(_0x547c('0x2'));var jsonpatch=require(_0x547c('0x3'));var rp=require(_0x547c('0x4'));var moment=require(_0x547c('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x547c('0x6'));var util=require(_0x547c('0x7'));var path=require('path');var sox=require(_0x547c('0x8'));var csv=require(_0x547c('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x547c('0xa'));var _=require(_0x547c('0xb'));var squel=require(_0x547c('0xc'));var crypto=require(_0x547c('0xd'));var jsforce=require(_0x547c('0xe'));var deskjs=require(_0x547c('0xf'));var toCsv=require(_0x547c('0x9'));var querystring=require(_0x547c('0x10'));var Papa=require(_0x547c('0x11'));var Redis=require(_0x547c('0x12'));var authService=require(_0x547c('0x13'));var qs=require(_0x547c('0x14'));var as=require(_0x547c('0x15'));var hardwareService=require(_0x547c('0x16'));var logger=require(_0x547c('0x17'))(_0x547c('0x18'));var utils=require(_0x547c('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x547c('0x1a'));var db=require(_0x547c('0x1b'))['db'];function respondWithStatusCode(_0x5eea67,_0x436c19){_0x436c19=_0x436c19||0xcc;return function(_0x201d95){if(_0x201d95){return _0x5eea67[_0x547c('0x1c')](_0x436c19);}return _0x5eea67[_0x547c('0x1d')](_0x436c19)[_0x547c('0x1e')]();};}function respondWithResult(_0x150317,_0x2bc289){_0x2bc289=_0x2bc289||0xc8;return function(_0xa3c7b0){if(_0xa3c7b0){return _0x150317[_0x547c('0x1d')](_0x2bc289)[_0x547c('0x1f')](_0xa3c7b0);}};}function respondWithFilteredResult(_0x240243,_0x103455){return function(_0x39f316){if(_0x39f316){var _0x23644b=typeof _0x103455[_0x547c('0x20')]===_0x547c('0x21')&&typeof _0x103455[_0x547c('0x22')]===_0x547c('0x21');var _0x49acca=_0x39f316['count'];var _0x23fa9e=_0x23644b?0x0:_0x103455[_0x547c('0x20')];var _0xeb059e=_0x23644b?_0x39f316['count']:_0x103455[_0x547c('0x20')]+_0x103455[_0x547c('0x22')];var _0x1ddbd3;if(_0xeb059e>=_0x49acca){_0xeb059e=_0x49acca;_0x1ddbd3=0xc8;}else{_0x1ddbd3=0xce;}_0x240243['status'](_0x1ddbd3);return _0x240243[_0x547c('0x23')](_0x547c('0x24'),_0x23fa9e+'-'+_0xeb059e+'/'+_0x49acca)['json'](_0x39f316);}return null;};}function patchUpdates(_0x5453f9){return function(_0x35040a){try{jsonpatch[_0x547c('0x25')](_0x35040a,_0x5453f9,!![]);}catch(_0x4f20c1){return BPromise[_0x547c('0x26')](_0x4f20c1);}return _0x35040a[_0x547c('0x27')]();};}function saveUpdates(_0x592e46,_0x2e317a){return function(_0x17fd97){if(_0x17fd97){return _0x17fd97[_0x547c('0x28')](_0x592e46)['then'](function(_0x3a55a0){return _0x3a55a0;});}return null;};}function removeEntity(_0x361c5c,_0x470694){return function(_0x26823c){if(_0x26823c){return _0x26823c[_0x547c('0x29')]()[_0x547c('0x2a')](function(){_0x361c5c[_0x547c('0x1d')](0xcc)[_0x547c('0x1e')]();});}};}function handleEntityNotFound(_0x507895,_0x39c5f9){return function(_0x4c66b9){if(!_0x4c66b9){_0x507895['sendStatus'](0x194);}return _0x4c66b9;};}function handleError(_0x4855fd,_0x478f04){_0x478f04=_0x478f04||0x1f4;return function(_0x2c725d){logger['error'](_0x2c725d[_0x547c('0x2b')]);if(_0x2c725d['name']){delete _0x2c725d[_0x547c('0x2c')];}_0x4855fd['status'](_0x478f04)[_0x547c('0x2d')](_0x2c725d);};}exports[_0x547c('0x2e')]=function(_0x2389de,_0x30a96c){var _0x198afb={},_0x569924={},_0x575c74={'count':0x0,'rows':[]};var _0x28c282=_['map'](db[_0x547c('0x2f')][_0x547c('0x30')],function(_0x3e7652){return{'name':_0x3e7652[_0x547c('0x31')],'type':_0x3e7652[_0x547c('0x32')][_0x547c('0x33')]};});_0x569924[_0x547c('0x34')]=_['map'](_0x28c282,'name');_0x569924[_0x547c('0x35')]=_[_0x547c('0x36')](_0x2389de[_0x547c('0x35')]);_0x569924[_0x547c('0x37')]=_[_0x547c('0x38')](_0x569924[_0x547c('0x34')],_0x569924[_0x547c('0x35')]);_0x198afb[_0x547c('0x39')]=_[_0x547c('0x38')](_0x569924[_0x547c('0x34')],qs[_0x547c('0x3a')](_0x2389de[_0x547c('0x35')][_0x547c('0x3a')]));_0x198afb[_0x547c('0x39')]=_0x198afb['attributes'][_0x547c('0x3b')]?_0x198afb['attributes']:_0x569924['model'];if(!_0x2389de['query'][_0x547c('0x3c')](_0x547c('0x3d'))){_0x198afb[_0x547c('0x22')]=qs[_0x547c('0x22')](_0x2389de[_0x547c('0x35')][_0x547c('0x22')]);_0x198afb['offset']=qs['offset'](_0x2389de['query'][_0x547c('0x20')]);}_0x198afb[_0x547c('0x3e')]=qs[_0x547c('0x3f')](_0x2389de[_0x547c('0x35')][_0x547c('0x3f')]);_0x198afb[_0x547c('0x40')]=qs['filters'](_[_0x547c('0x41')](_0x2389de['query'],_0x569924[_0x547c('0x37')]),_0x28c282);if(_0x2389de[_0x547c('0x35')]['filter']){_0x198afb[_0x547c('0x40')]=_['merge'](_0x198afb['where'],{'$or':_[_0x547c('0x42')](_0x28c282,function(_0x281d52){if(_0x281d52[_0x547c('0x32')]!==_0x547c('0x43')){var _0x4c36b9={};_0x4c36b9[_0x281d52['name']]={'$like':'%'+_0x2389de[_0x547c('0x35')][_0x547c('0x44')]+'%'};return _0x4c36b9;}})});}_0x198afb=_[_0x547c('0x45')]({},_0x198afb,_0x2389de['options']);var _0x3886ae={'where':_0x198afb[_0x547c('0x40')]};return db[_0x547c('0x2f')]['count'](_0x3886ae)[_0x547c('0x2a')](function(_0x3a6a0a){_0x575c74[_0x547c('0x46')]=_0x3a6a0a;if(_0x2389de['query'][_0x547c('0x47')]){_0x198afb[_0x547c('0x48')]=[{'all':!![]}];}return db['WhatsappApplication'][_0x547c('0x49')](_0x198afb);})[_0x547c('0x2a')](function(_0x9c3cb2){_0x575c74['rows']=_0x9c3cb2;return _0x575c74;})[_0x547c('0x2a')](respondWithFilteredResult(_0x30a96c,_0x198afb))['catch'](handleError(_0x30a96c,null));};exports[_0x547c('0x4a')]=function(_0x5393a2,_0xb86f5f){var _0x414b9d={'raw':!![],'where':{'id':_0x5393a2[_0x547c('0x4b')]['id']}},_0x3d37d7={};_0x3d37d7[_0x547c('0x34')]=_[_0x547c('0x36')](db['WhatsappApplication']['rawAttributes']);_0x3d37d7[_0x547c('0x35')]=_[_0x547c('0x36')](_0x5393a2[_0x547c('0x35')]);_0x3d37d7['filters']=_[_0x547c('0x38')](_0x3d37d7[_0x547c('0x34')],_0x3d37d7[_0x547c('0x35')]);_0x414b9d[_0x547c('0x39')]=_[_0x547c('0x38')](_0x3d37d7[_0x547c('0x34')],qs['fields'](_0x5393a2[_0x547c('0x35')][_0x547c('0x3a')]));_0x414b9d[_0x547c('0x39')]=_0x414b9d['attributes'][_0x547c('0x3b')]?_0x414b9d[_0x547c('0x39')]:_0x3d37d7[_0x547c('0x34')];if(_0x5393a2[_0x547c('0x35')]['includeAll']){_0x414b9d[_0x547c('0x48')]=[{'all':!![]}];}_0x414b9d=_['merge']({},_0x414b9d,_0x5393a2[_0x547c('0x4c')]);return db['WhatsappApplication'][_0x547c('0x4d')](_0x414b9d)[_0x547c('0x2a')](handleEntityNotFound(_0xb86f5f,null))['then'](respondWithResult(_0xb86f5f,null))[_0x547c('0x4e')](handleError(_0xb86f5f,null));};exports[_0x547c('0x4f')]=function(_0xa005cc,_0x1ddf30){return db['WhatsappApplication'][_0x547c('0x4f')](_0xa005cc['body'],{})['then'](respondWithResult(_0x1ddf30,0xc9))[_0x547c('0x4e')](handleError(_0x1ddf30,null));};exports[_0x547c('0x28')]=function(_0x3e3f52,_0x11a878){if(_0x3e3f52[_0x547c('0x50')]['id']){delete _0x3e3f52[_0x547c('0x50')]['id'];}return db[_0x547c('0x2f')][_0x547c('0x4d')]({'where':{'id':_0x3e3f52[_0x547c('0x4b')]['id']}})[_0x547c('0x2a')](handleEntityNotFound(_0x11a878,null))[_0x547c('0x2a')](saveUpdates(_0x3e3f52[_0x547c('0x50')],null))['then'](respondWithResult(_0x11a878,null))['catch'](handleError(_0x11a878,null));};exports[_0x547c('0x29')]=function(_0x21ea26,_0x48de6e){return db[_0x547c('0x2f')][_0x547c('0x4d')]({'where':{'id':_0x21ea26[_0x547c('0x4b')]['id']}})[_0x547c('0x2a')](handleEntityNotFound(_0x48de6e,null))[_0x547c('0x2a')](removeEntity(_0x48de6e,null))[_0x547c('0x4e')](handleError(_0x48de6e,null));};
\ No newline at end of file
index 59f42ee..397baba 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2209=['request-promise','rimraf','../../config/environment','./whatsappApplication.attributes','exports','define','WhatsappApplication','whatsapp_applications','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment'];(function(_0x1f161b,_0x361592){var _0x5f2b47=function(_0x9d795f){while(--_0x9d795f){_0x1f161b['push'](_0x1f161b['shift']());}};_0x5f2b47(++_0x361592);}(_0x2209,0x95));var _0x9220=function(_0x4074d9,_0x24cd34){_0x4074d9=_0x4074d9-0x0;var _0x2eeb6e=_0x2209[_0x4074d9];return _0x2eeb6e;};'use strict';var _=require(_0x9220('0x0'));var util=require(_0x9220('0x1'));var logger=require(_0x9220('0x2'))(_0x9220('0x3'));var moment=require(_0x9220('0x4'));var BPromise=require('bluebird');var rp=require(_0x9220('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9220('0x6'));var config=require(_0x9220('0x7'));var attributes=require(_0x9220('0x8'));module[_0x9220('0x9')]=function(_0x45bd2d,_0x300ed6){return _0x45bd2d[_0x9220('0xa')](_0x9220('0xb'),attributes,{'tableName':_0x9220('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x9220('0xd')});};
\ No newline at end of file
+var _0x4876=['utf8mb4','utf8mb4_unicode_ci','../../config/logger','bluebird','path','rimraf','../../config/environment','./whatsappApplication.attributes','WhatsappApplication','whatsapp_applications'];(function(_0x3e74b1,_0x2c8497){var _0x5c734e=function(_0x351f15){while(--_0x351f15){_0x3e74b1['push'](_0x3e74b1['shift']());}};_0x5c734e(++_0x2c8497);}(_0x4876,0x84));var _0x6487=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4876[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x6487('0x0'))('api');var moment=require('moment');var BPromise=require(_0x6487('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6487('0x2'));var rimraf=require(_0x6487('0x3'));var config=require(_0x6487('0x4'));var attributes=require(_0x6487('0x5'));module['exports']=function(_0x23e50b,_0x856b1c){return _0x23e50b['define'](_0x6487('0x6'),attributes,{'tableName':_0x6487('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6487('0x8'),'collate':_0x6487('0x9')});};
\ No newline at end of file
index 4ee65db..b6b77d3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb458=['WhatsappApplication,\x20%s,\x20%s,\x20%s','code','error','message','request\x20sent','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','then','info','WhatsappApplication,\x20%s,\x20%s','debug'];(function(_0x2235bf,_0x3a06a7){var _0x4c3a64=function(_0x3b3bb6){while(--_0x3b3bb6){_0x2235bf['push'](_0x2235bf['shift']());}};_0x4c3a64(++_0x3a06a7);}(_0xb458,0x103));var _0x8b45=function(_0x5d99cb,_0x28f75b){_0x5d99cb=_0x5d99cb-0x0;var _0x30dad6=_0xb458[_0x5d99cb];return _0x30dad6;};'use strict';var _=require(_0x8b45('0x0'));var util=require(_0x8b45('0x1'));var moment=require(_0x8b45('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8b45('0x3'));var db=require(_0x8b45('0x4'))['db'];var utils=require(_0x8b45('0x5'));var logger=require(_0x8b45('0x6'))('rpc');var config=require(_0x8b45('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x8b45('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x12bd05,_0x2daa9a,_0x3a8ccb){return new BPromise(function(_0x32342f,_0x4d1718){return client[_0x8b45('0x9')](_0x12bd05,_0x3a8ccb)[_0x8b45('0xa')](function(_0x33f30e){logger[_0x8b45('0xb')](_0x8b45('0xc'),_0x2daa9a,'request\x20sent');logger[_0x8b45('0xd')](_0x8b45('0xe'),_0x2daa9a,'request\x20sent',JSON['stringify'](_0x33f30e));if(_0x33f30e['error']){if(_0x33f30e['error'][_0x8b45('0xf')]===0x1f4){logger[_0x8b45('0x10')](_0x8b45('0xc'),_0x2daa9a,_0x33f30e['error'][_0x8b45('0x11')]);return _0x4d1718(_0x33f30e[_0x8b45('0x10')][_0x8b45('0x11')]);}logger[_0x8b45('0x10')](_0x8b45('0xc'),_0x2daa9a,_0x33f30e[_0x8b45('0x10')]['message']);return _0x32342f(_0x33f30e['error'][_0x8b45('0x11')]);}else{logger[_0x8b45('0xb')](_0x8b45('0xc'),_0x2daa9a,_0x8b45('0x12'));_0x32342f(_0x33f30e[_0x8b45('0x13')][_0x8b45('0x11')]);}})[_0x8b45('0x14')](function(_0x147d6b){logger[_0x8b45('0x10')](_0x8b45('0xc'),_0x2daa9a,_0x147d6b);_0x4d1718(_0x147d6b);});});}
\ No newline at end of file
+var _0xd6d6=['WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','WhatsappApplication,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x46f30c,_0xb757ea){var _0x2a0a07=function(_0x42e1f9){while(--_0x42e1f9){_0x46f30c['push'](_0x46f30c['shift']());}};_0x2a0a07(++_0xb757ea);}(_0xd6d6,0xbe));var _0x6d6d=function(_0x35d777,_0x442ed9){_0x35d777=_0x35d777-0x0;var _0x87dca8=_0xd6d6[_0x35d777];return _0x87dca8;};'use strict';var _=require(_0x6d6d('0x0'));var util=require(_0x6d6d('0x1'));var moment=require(_0x6d6d('0x2'));var BPromise=require(_0x6d6d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6d6d('0x4'));var db=require(_0x6d6d('0x5'))['db'];var utils=require(_0x6d6d('0x6'));var logger=require(_0x6d6d('0x7'))(_0x6d6d('0x8'));var config=require(_0x6d6d('0x9'));var jayson=require(_0x6d6d('0xa'));var client=jayson['client'][_0x6d6d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1bf731,_0x44f83d,_0x18f824){return new BPromise(function(_0xd49f57,_0x408f88){return client[_0x6d6d('0xc')](_0x1bf731,_0x18f824)['then'](function(_0x51dd38){logger[_0x6d6d('0xd')](_0x6d6d('0xe'),_0x44f83d,_0x6d6d('0xf'));logger[_0x6d6d('0x10')](_0x6d6d('0x11'),_0x44f83d,'request\x20sent',JSON[_0x6d6d('0x12')](_0x51dd38));if(_0x51dd38[_0x6d6d('0x13')]){if(_0x51dd38['error']['code']===0x1f4){logger[_0x6d6d('0x13')](_0x6d6d('0xe'),_0x44f83d,_0x51dd38[_0x6d6d('0x13')][_0x6d6d('0x14')]);return _0x408f88(_0x51dd38[_0x6d6d('0x13')][_0x6d6d('0x14')]);}logger[_0x6d6d('0x13')](_0x6d6d('0xe'),_0x44f83d,_0x51dd38['error'][_0x6d6d('0x14')]);return _0xd49f57(_0x51dd38[_0x6d6d('0x13')][_0x6d6d('0x14')]);}else{logger[_0x6d6d('0xd')](_0x6d6d('0xe'),_0x44f83d,'request\x20sent');_0xd49f57(_0x51dd38[_0x6d6d('0x15')]['message']);}})[_0x6d6d('0x16')](function(_0x2cbc86){logger[_0x6d6d('0x13')]('WhatsappApplication,\x20%s,\x20%s',_0x44f83d,_0x2cbc86);_0x408f88(_0x2cbc86);});});}
\ No newline at end of file
index e123994..ae6e4ce 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0d4d=['update','delete','/:id','whatsappinteraction:destroy','destroy','removeTags','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./whatsappInteraction.controller','isAuthenticated','index','get','show','getMessages','/:id/download','download','create','post','/:id/messages','addMessage','/:id/tags','tracked','addTags','put'];(function(_0x1a3253,_0x4e8303){var _0x542d95=function(_0x5595dd){while(--_0x5595dd){_0x1a3253['push'](_0x1a3253['shift']());}};_0x542d95(++_0x4e8303);}(_0x0d4d,0x132));var _0xd0d4=function(_0x5a0961,_0x30d78a){_0x5a0961=_0x5a0961-0x0;var _0x3f340f=_0x0d4d[_0x5a0961];return _0x3f340f;};'use strict';var multer=require(_0xd0d4('0x0'));var util=require(_0xd0d4('0x1'));var path=require(_0xd0d4('0x2'));var timeout=require(_0xd0d4('0x3'));var express=require(_0xd0d4('0x4'));var router=express[_0xd0d4('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xd0d4('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd0d4('0x7'));var controller=require(_0xd0d4('0x8'));router['get']('/',auth[_0xd0d4('0x9')](),controller[_0xd0d4('0xa')]);router[_0xd0d4('0xb')]('/describe',auth[_0xd0d4('0x9')](),controller['describe']);router[_0xd0d4('0xb')]('/:id',auth[_0xd0d4('0x9')](),controller[_0xd0d4('0xc')]);router[_0xd0d4('0xb')]('/:id/messages',auth[_0xd0d4('0x9')](),controller[_0xd0d4('0xd')]);router[_0xd0d4('0xb')](_0xd0d4('0xe'),auth[_0xd0d4('0x9')](),controller[_0xd0d4('0xf')]);router['post']('/',auth[_0xd0d4('0x9')](),controller[_0xd0d4('0x10')]);router[_0xd0d4('0x11')](_0xd0d4('0x12'),auth[_0xd0d4('0x9')](),controller[_0xd0d4('0x13')]);router['post'](_0xd0d4('0x14'),auth[_0xd0d4('0x9')](),interaction[_0xd0d4('0x15')]('whatsapp','whatsappinteraction:addtags'),controller[_0xd0d4('0x16')]);router[_0xd0d4('0x17')]('/:id',auth[_0xd0d4('0x9')](),interaction[_0xd0d4('0x15')]('whatsapp','whatsappinteraction:update'),controller[_0xd0d4('0x18')]);router[_0xd0d4('0x19')](_0xd0d4('0x1a'),auth['isAuthenticated'](),interaction['tracked']('whatsapp',_0xd0d4('0x1b')),controller[_0xd0d4('0x1c')]);router[_0xd0d4('0x19')]('/:id/tags',auth['isAuthenticated'](),controller[_0xd0d4('0x1d')]);module['exports']=router;
\ No newline at end of file
+var _0x4975=['removeTags','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/messages','getMessages','/:id/download','create','post','addMessage','/:id/tags','tracked','whatsapp','addTags','whatsappinteraction:update','update','delete','whatsappinteraction:destroy'];(function(_0x2cd1fb,_0x291f55){var _0x48fd2b=function(_0x18e23e){while(--_0x18e23e){_0x2cd1fb['push'](_0x2cd1fb['shift']());}};_0x48fd2b(++_0x291f55);}(_0x4975,0x86));var _0x5497=function(_0x9062c2,_0xfadf36){_0x9062c2=_0x9062c2-0x0;var _0xbb8117=_0x4975[_0x9062c2];return _0xbb8117;};'use strict';var multer=require(_0x5497('0x0'));var util=require('util');var path=require(_0x5497('0x1'));var timeout=require(_0x5497('0x2'));var express=require(_0x5497('0x3'));var router=express[_0x5497('0x4')]();var fs_extra=require(_0x5497('0x5'));var auth=require(_0x5497('0x6'));var interaction=require(_0x5497('0x7'));var config=require(_0x5497('0x8'));var controller=require(_0x5497('0x9'));router[_0x5497('0xa')]('/',auth['isAuthenticated'](),controller[_0x5497('0xb')]);router['get'](_0x5497('0xc'),auth[_0x5497('0xd')](),controller[_0x5497('0xe')]);router['get'](_0x5497('0xf'),auth['isAuthenticated'](),controller[_0x5497('0x10')]);router[_0x5497('0xa')](_0x5497('0x11'),auth[_0x5497('0xd')](),controller[_0x5497('0x12')]);router[_0x5497('0xa')](_0x5497('0x13'),auth[_0x5497('0xd')](),controller['download']);router['post']('/',auth['isAuthenticated'](),controller[_0x5497('0x14')]);router[_0x5497('0x15')](_0x5497('0x11'),auth[_0x5497('0xd')](),controller[_0x5497('0x16')]);router[_0x5497('0x15')](_0x5497('0x17'),auth[_0x5497('0xd')](),interaction[_0x5497('0x18')](_0x5497('0x19'),'whatsappinteraction:addtags'),controller[_0x5497('0x1a')]);router['put'](_0x5497('0xf'),auth[_0x5497('0xd')](),interaction[_0x5497('0x18')](_0x5497('0x19'),_0x5497('0x1b')),controller[_0x5497('0x1c')]);router[_0x5497('0x1d')]('/:id',auth['isAuthenticated'](),interaction[_0x5497('0x18')](_0x5497('0x19'),_0x5497('0x1e')),controller['destroy']);router[_0x5497('0x1d')](_0x5497('0x17'),auth[_0x5497('0xd')](),controller[_0x5497('0x1f')]);module[_0x5497('0x20')]=router;
\ No newline at end of file
index 7e59501..40f6654 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7f27=['ENUM','BOOLEAN','sequelize','moment','DATE','STRING'];(function(_0x5dc2a4,_0x5baf3d){var _0x40988f=function(_0x23c7e5){while(--_0x23c7e5){_0x5dc2a4['push'](_0x5dc2a4['shift']());}};_0x40988f(++_0x5baf3d);}(_0x7f27,0x12e));var _0x77f2=function(_0x5250ee,_0x46e3ed){_0x5250ee=_0x5250ee-0x0;var _0x83882a=_0x7f27[_0x5250ee];return _0x83882a;};'use strict';var Sequelize=require(_0x77f2('0x0'));var moment=require(_0x77f2('0x1'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x77f2('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x77f2('0x3')]},'note':{'type':Sequelize[_0x77f2('0x3')]},'phone':{'type':Sequelize[_0x77f2('0x3')]},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x77f2('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x77f2('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x77f2('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x77f2('0x5')],'defaultValue':![]}};
\ No newline at end of file
+var _0x4b19=['DATE','STRING','ENUM','sequelize','exports','BOOLEAN'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4b19,0x195));var _0x94b1=function(_0x26ee00,_0x4409f8){_0x26ee00=_0x26ee00-0x0;var _0x42f0e4=_0x4b19[_0x26ee00];return _0x42f0e4;};'use strict';var Sequelize=require(_0x94b1('0x0'));var moment=require('moment');module[_0x94b1('0x1')]={'closed':{'type':Sequelize[_0x94b1('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x94b1('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x94b1('0x4')]},'thirdDisposition':{'type':Sequelize[_0x94b1('0x4')]},'note':{'type':Sequelize[_0x94b1('0x4')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x94b1('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x94b1('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x94b1('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x94b1('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x94b1('0x2')],'defaultValue':![]}};
\ No newline at end of file
index 6182aef..0de5e61 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaf5a=['files','tmp','root','attachments','transcript-%d-%s.zip','CmContact','Contact','firstName','Attachment','Messages','createdAt','direction','secret','WhatsappAccount','Account','Owner','Whatsapp','YYYY-MM-DD\x20HH:mm:ss','closedAt','basename','existsSync','pipe','out','System','lastName','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','err','unlinkSync','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','socket.io-emitter','./whatsappInteraction.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','map','fullname','TagIds','forEach','push','catch','waiting','talking','answered','unmanaged','total','closed','UserId','index','WhatsappInteraction','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','pick','field','color','from','tools_tags','select','u.id','ui.WhatsappInteractionId','user_has_whatsapp_interactions','left_join','users','u.id\x20=\x20ui.UserId','whatsapp_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','whatsapp_accounts','a.id\x20=\x20i.WhatsappAccountId','whatsapp_messages','me.WhatsappInteractionId\x20=\x20i.id','whatsapp_interaction_has_tags','it.WhatsappInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','`\x20=\x200','having','`\x20>\x200','operator','$substring','value','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','body','some','compact','isEmpty','WhatsappAccountId','concat','parse','$lte','where','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','i.id\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','DESC','resolve','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','user','role','getWhatsappAccounts','i.WhatsappAccountId\x20IS\x20NULL','i.WhatsappAccountId\x20IN\x20?','agent','sequelize','toString','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.*','c.firstName','Contact.firstName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','WhatsappInteractionId','all','params','include','merge','options','create','update','describe','WhatsappMessage','addMessage','omit','ids','getMessages','findOne','nolimit','$gte','format','rows','addTags','setTags','spread','emit','whatsappInteractionTags:save','removeTags','download','unix','join','server'];(function(_0x18b949,_0x3fd773){var _0x30edd9=function(_0x40466a){while(--_0x40466a){_0x18b949['push'](_0x18b949['shift']());}};_0x30edd9(++_0x3fd773);}(_0xaf5a,0x116));var _0xaaf5=function(_0x4d729f,_0x52bf8b){_0x4d729f=_0x4d729f-0x0;var _0x5ce12a=_0xaf5a[_0x4d729f];return _0x5ce12a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xaaf5('0x0'));var zipdir=require(_0xaaf5('0x1'));var jsonpatch=require(_0xaaf5('0x2'));var rp=require(_0xaaf5('0x3'));var moment=require(_0xaaf5('0x4'));var BPromise=require(_0xaaf5('0x5'));var Mustache=require(_0xaaf5('0x6'));var util=require(_0xaaf5('0x7'));var path=require('path');var sox=require(_0xaaf5('0x8'));var csv=require(_0xaaf5('0x9'));var ejs=require(_0xaaf5('0xa'));var fs=require('fs');var fs_extra=require(_0xaaf5('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xaaf5('0xc'));var jsforce=require(_0xaaf5('0xd'));var deskjs=require(_0xaaf5('0xe'));var toCsv=require(_0xaaf5('0x9'));var querystring=require(_0xaaf5('0xf'));var Papa=require('papaparse');var Redis=require(_0xaaf5('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xaaf5('0x11'));var pdf=require(_0xaaf5('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xaaf5('0x13'))(_0xaaf5('0x14'));var utils=require(_0xaaf5('0x15'));var config=require(_0xaaf5('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xaaf5('0x17'))['db'];config[_0xaaf5('0x18')]=_['defaults'](config[_0xaaf5('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0xaaf5('0x19'))(new Redis(config[_0xaaf5('0x18')]));require(_0xaaf5('0x1a'))[_0xaaf5('0x1b')](socket);function respondWithStatusCode(_0x59d204,_0x3db5d0){_0x3db5d0=_0x3db5d0||0xcc;return function(_0x3079c3){if(_0x3079c3){return _0x59d204[_0xaaf5('0x1c')](_0x3db5d0);}return _0x59d204[_0xaaf5('0x1d')](_0x3db5d0)[_0xaaf5('0x1e')]();};}function respondWithResult(_0x10a50b,_0x27d66f){_0x27d66f=_0x27d66f||0xc8;return function(_0x4b1693){if(_0x4b1693){return _0x10a50b[_0xaaf5('0x1d')](_0x27d66f)[_0xaaf5('0x1f')](_0x4b1693);}};}function respondWithFilteredResult(_0x25bcb1,_0x3a036d){return function(_0x318d47){if(_0x318d47){var _0x403bb2=typeof _0x3a036d[_0xaaf5('0x20')]==='undefined'&&typeof _0x3a036d['limit']===_0xaaf5('0x21');var _0x45efc2=_0x318d47[_0xaaf5('0x22')];var _0x1b7567=_0x403bb2?0x0:_0x3a036d[_0xaaf5('0x20')];var _0x6131a3=_0x403bb2?_0x318d47['count']:_0x3a036d['offset']+_0x3a036d[_0xaaf5('0x23')];var _0x2f74aa;if(_0x6131a3>=_0x45efc2){_0x6131a3=_0x45efc2;_0x2f74aa=0xc8;}else{_0x2f74aa=0xce;}_0x25bcb1[_0xaaf5('0x1d')](_0x2f74aa);return _0x25bcb1[_0xaaf5('0x24')](_0xaaf5('0x25'),_0x1b7567+'-'+_0x6131a3+'/'+_0x45efc2)[_0xaaf5('0x1f')](_0x318d47);}return null;};}function patchUpdates(_0xe178ae){return function(_0x457b69){try{jsonpatch[_0xaaf5('0x26')](_0x457b69,_0xe178ae,!![]);}catch(_0x2aabab){return BPromise[_0xaaf5('0x27')](_0x2aabab);}return _0x457b69[_0xaaf5('0x28')]();};}function saveUpdates(_0xb2a0ec,_0x1dea57){return function(_0x5a1fea){if(_0x5a1fea){return _0x5a1fea['update'](_0xb2a0ec)[_0xaaf5('0x29')](function(_0x569c78){return _0x569c78;});}return null;};}function removeEntity(_0x44aef2,_0x4d2003){return function(_0x501017){if(_0x501017){return _0x501017[_0xaaf5('0x2a')]()[_0xaaf5('0x29')](function(){_0x44aef2[_0xaaf5('0x1d')](0xcc)[_0xaaf5('0x1e')]();});}};}function handleEntityNotFound(_0x11b2a9,_0x459059){return function(_0x490bb6){if(!_0x490bb6){_0x11b2a9[_0xaaf5('0x1c')](0x194);}return _0x490bb6;};}function handleError(_0x533bc8,_0x4beb05){_0x4beb05=_0x4beb05||0x1f4;return function(_0x24cd49){logger[_0xaaf5('0x2b')](_0x24cd49[_0xaaf5('0x2c')]);if(_0x24cd49[_0xaaf5('0x2d')]){delete _0x24cd49[_0xaaf5('0x2d')];}_0x533bc8[_0xaaf5('0x1d')](_0x4beb05)['send'](_0x24cd49);};}function getInteractionUsers(_0x23e7da,_0x4954af){return new BPromise(function(_0x39539f,_0x561800){try{if(_0x4954af[_0x23e7da['id']]){_0x23e7da['Users']=_[_0xaaf5('0x2e')](_0x4954af[_0x23e7da['id']],function(_0x4c08aa){return{'id':_0x4c08aa['id'],'fullname':_0x4c08aa[_0xaaf5('0x2f')]};});}}catch(_0x380cbb){_0x561800(_0x380cbb);}_0x39539f(_0x23e7da);});}function getInteractionTags(_0x591652,_0x3a94c0){return new BPromise(function(_0x487fb7,_0x379ba4){try{if(_0x591652[_0xaaf5('0x30')]){_0x591652['Tags']=[];_0x591652[_0xaaf5('0x30')]['split'](',')[_0xaaf5('0x31')](function(_0x2ddca4){_0x591652['Tags'][_0xaaf5('0x32')](_0x3a94c0[_0x2ddca4]);});}delete _0x591652['TagIds'];}catch(_0x2bb52a){_0x379ba4(_0x2bb52a);}_0x487fb7(_0x591652);});}function updateWhatsappInteraction(_0x18a117,_0x3b0b02,_0x310903){return new BPromise(function(_0x2a6f11,_0x2e9f7a){return getInteractionUsers(_0x18a117,_0x310903)[_0xaaf5('0x29')](function(_0x563daa){return getInteractionTags(_0x563daa,_0x3b0b02);})[_0xaaf5('0x29')](function(_0x30aecd){return getStateInteraction(_0x30aecd);})['then'](function(_0x20b370){_0x2a6f11(_0x20b370);})[_0xaaf5('0x33')](function(_0x3c428f){_0x2e9f7a(_0x3c428f);});});}function getStateInteraction(_0x302a5c){return new BPromise(function(_0x4a12b1){_0x302a5c[_0xaaf5('0x34')]=0x0;_0x302a5c[_0xaaf5('0x35')]=0x0;_0x302a5c[_0xaaf5('0x36')]=0x0;_0x302a5c[_0xaaf5('0x37')]=0x0;_0x302a5c[_0xaaf5('0x38')]=0x0;if(!_0x302a5c[_0xaaf5('0x39')]&&!_0x302a5c['UserId']){_0x302a5c[_0xaaf5('0x34')]+=0x1;}if(!_0x302a5c[_0xaaf5('0x39')]&&_0x302a5c['UserId']){_0x302a5c[_0xaaf5('0x35')]+=0x1;if(_0x302a5c[_0xaaf5('0x34')]){_0x302a5c[_0xaaf5('0x34')]-=0x1;}}if(_0x302a5c[_0xaaf5('0x39')]&&_0x302a5c['UserId']){_0x302a5c[_0xaaf5('0x36')]+=0x1;if(_0x302a5c['talking']){_0x302a5c[_0xaaf5('0x35')]-=0x1;}}if(_0x302a5c[_0xaaf5('0x39')]&&!_0x302a5c[_0xaaf5('0x3a')]){_0x302a5c[_0xaaf5('0x37')]+=0x1;if(_0x302a5c[_0xaaf5('0x34')]){_0x302a5c[_0xaaf5('0x34')]-=0x1;}}_0x302a5c[_0xaaf5('0x38')]+=0x1;_0x4a12b1(_0x302a5c);});}exports[_0xaaf5('0x3b')]=function(_0x1327e4,_0x2094f4){var _0x10bd04={},_0x294bf9={},_0x560cfd={'count':0x0,'rows':[]};var _0x37a4a1=_[_0xaaf5('0x2e')](db[_0xaaf5('0x3c')][_0xaaf5('0x3d')],function(_0x392a5e){return{'name':_0x392a5e[_0xaaf5('0x3e')],'type':_0x392a5e[_0xaaf5('0x3f')]['key']};});_0x294bf9[_0xaaf5('0x40')]=_[_0xaaf5('0x2e')](_0x37a4a1,_0xaaf5('0x2d'));_0x294bf9[_0xaaf5('0x41')]=_[_0xaaf5('0x42')](_0x1327e4[_0xaaf5('0x41')]);_0x294bf9[_0xaaf5('0x43')]=_[_0xaaf5('0x44')](_0x294bf9[_0xaaf5('0x40')],_0x294bf9[_0xaaf5('0x41')]);_0x10bd04[_0xaaf5('0x45')]=_[_0xaaf5('0x44')](_0x294bf9['model'],qs[_0xaaf5('0x46')](_0x1327e4[_0xaaf5('0x41')][_0xaaf5('0x46')]));_0x10bd04[_0xaaf5('0x45')]=_0x10bd04[_0xaaf5('0x45')][_0xaaf5('0x47')]?_0x10bd04[_0xaaf5('0x45')]:_0x294bf9[_0xaaf5('0x40')];if(!_0x1327e4['query'][_0xaaf5('0x48')]('nolimit')){_0x10bd04['limit']=qs[_0xaaf5('0x23')](_0x1327e4['query'][_0xaaf5('0x23')]);_0x10bd04[_0xaaf5('0x20')]=qs['offset'](_0x1327e4[_0xaaf5('0x41')]['offset']);}_0x10bd04['order']=qs[_0xaaf5('0x49')](_0x1327e4[_0xaaf5('0x41')][_0xaaf5('0x49')]);_0x10bd04['where']=qs[_0xaaf5('0x43')](_[_0xaaf5('0x4a')](_0x1327e4[_0xaaf5('0x41')],_0x294bf9[_0xaaf5('0x43')]),_0x37a4a1);var _0x47d566=[];var _0x461f9c=squel['select']()['field']('id')[_0xaaf5('0x4b')]('name')[_0xaaf5('0x4b')](_0xaaf5('0x4c'))[_0xaaf5('0x4d')](_0xaaf5('0x4e'));var _0x24144c=squel[_0xaaf5('0x4f')]()['field'](_0xaaf5('0x50'))[_0xaaf5('0x4b')]('u.fullname')[_0xaaf5('0x4b')](_0xaaf5('0x51'))[_0xaaf5('0x4d')](_0xaaf5('0x52'),'ui')[_0xaaf5('0x53')](_0xaaf5('0x54'),'u',_0xaaf5('0x55'));var _0x11511d=squel['select']()[_0xaaf5('0x4d')](_0xaaf5('0x56'),'i')[_0xaaf5('0x53')](_0xaaf5('0x57'),'c',_0xaaf5('0x58'))[_0xaaf5('0x53')]('users','o',_0xaaf5('0x59'))[_0xaaf5('0x53')](_0xaaf5('0x5a'),'a',_0xaaf5('0x5b'))[_0xaaf5('0x53')](_0xaaf5('0x5c'),'me',_0xaaf5('0x5d'))[_0xaaf5('0x53')](_0xaaf5('0x5e'),'it',_0xaaf5('0x5f'))['left_join'](_0xaaf5('0x4e'),'t',_0xaaf5('0x60'));var _0x487942=squel['expr']();var _0x1e8112=[];var _0x18cb4b=squel[_0xaaf5('0x61')]();var _0x3ab187;if(_0x1327e4['query'][_0xaaf5('0x62')]){_0x3ab187=as[_0xaaf5('0x63')](_0x1327e4['query'][_0xaaf5('0x62')]);var _0x3ec502=_0x3ab187[_0xaaf5('0x64')];for(var _0x13f6ad=0x0;_0x13f6ad<_0x3ab187[_0xaaf5('0x65')][_0xaaf5('0x47')];_0x13f6ad++){var _0x2a7dac=_0x3ab187[_0xaaf5('0x65')][_0x13f6ad];var _0x458cd4='i';var _0x2fa0bc=_[_0xaaf5('0x66')](_0x37a4a1,[_0xaaf5('0x2d'),_0x2a7dac[_0xaaf5('0x4b')]]);if(!_0x2fa0bc){switch(_0x2a7dac[_0xaaf5('0x4b')]){case _0xaaf5('0x67'):if(_0x2a7dac['value']==0x1){_0x11511d['having']('`'+_0x2a7dac[_0xaaf5('0x4b')]+_0xaaf5('0x68'));}else{_0x11511d[_0xaaf5('0x69')]('`'+_0x2a7dac['field']+_0xaaf5('0x6a'));}break;case'Contact':if(_0x2a7dac[_0xaaf5('0x6b')]===_0xaaf5('0x6c')){if(_0x2a7dac[_0xaaf5('0x6d')][_0xaaf5('0x6e')]('\x20')['length']>0x1){_0x487942[_0x3ec502](_0xaaf5('0x6f'),qs[_0xaaf5('0x70')](_0x2a7dac[_0xaaf5('0x6d')]),null);}else{var _0x57b07b='%'+_0x2a7dac[_0xaaf5('0x6d')]+'%';_0x487942[_0x3ec502](_0xaaf5('0x71'),_0x57b07b,_0x57b07b,_0x57b07b);}}else{_0x2fa0bc=_['find'](_0x37a4a1,[_0xaaf5('0x2d'),_0xaaf5('0x72')]);_0x2a7dac[_0xaaf5('0x4b')]=_0xaaf5('0x72');_0x5cb6e5=as[_0xaaf5('0x73')](_0x458cd4,_0x2fa0bc[_0xaaf5('0x3f')],_0x2a7dac);_0x487942[_0x3ec502](_0x5cb6e5[_0xaaf5('0x74')],_0x5cb6e5[_0xaaf5('0x6d')][_0xaaf5('0x75')],_0x5cb6e5[_0xaaf5('0x6d')][_0xaaf5('0x1e')]);}break;case _0xaaf5('0x76'):var _0x1a37c4=_0x2a7dac['value'][_0xaaf5('0x6e')](',')[_0xaaf5('0x2e')](function(_0x457da5){return Number(_0x457da5);});_0x1a37c4[_0xaaf5('0x31')](function(_0x7eb811){_0x18cb4b['or'](_0xaaf5('0x77'),'%,'+_0x7eb811+',%');});_0x1e8112=_[_0xaaf5('0x78')](_0x1e8112,_0x1a37c4);break;case _0xaaf5('0x79'):if(_0x2a7dac[_0xaaf5('0x6b')]==='$substring'){_0x487942[_0x3ec502](_0xaaf5('0x7a'),'%'+_0x2a7dac['value']+'%',null);}else{_0x2fa0bc=_['find'](_0x37a4a1,[_0xaaf5('0x2d'),_0xaaf5('0x3a')]);_0x2a7dac[_0xaaf5('0x4b')]='UserId';_0x5cb6e5=as['buildExpression'](_0x458cd4,_0x2fa0bc[_0xaaf5('0x3f')],_0x2a7dac);_0x487942[_0x3ec502](_0x5cb6e5['text'],_0x5cb6e5['value'][_0xaaf5('0x75')],_0x5cb6e5['value'][_0xaaf5('0x1e')]);}break;case _0xaaf5('0x7b'):_0x5cb6e5=as['buildExpression']('me',null,_0x2a7dac);_0x487942[_0x3ec502](_0x5cb6e5[_0xaaf5('0x74')],_0x5cb6e5['value'][_0xaaf5('0x75')],_0x5cb6e5['value'][_0xaaf5('0x1e')]);break;}}else{var _0x5cb6e5=as[_0xaaf5('0x73')](_0x458cd4,_0x2fa0bc[_0xaaf5('0x3f')],_0x2a7dac);_0x487942[_0x3ec502](_0x5cb6e5[_0xaaf5('0x74')],_0x5cb6e5[_0xaaf5('0x6d')]['start'],_0x5cb6e5[_0xaaf5('0x6d')][_0xaaf5('0x1e')]);}}}else{var _0x4639c2=_(_0x1327e4[_0xaaf5('0x41')])[_0xaaf5('0x42')]()[_0xaaf5('0x2e')](function(_0x37d32d){return _[_0xaaf5('0x7c')](_0x37a4a1,[_0xaaf5('0x2d'),_0x37d32d])?_0x37d32d:undefined;})[_0xaaf5('0x7d')]()[_0xaaf5('0x6d')]();if(!_[_0xaaf5('0x7e')](_0x4639c2)){_0x4639c2[_0xaaf5('0x31')](function(_0x50eac8){if(_0x50eac8===_0xaaf5('0x7f')){_0x11511d['where']('i.WhatsappAccountId\x20IN\x20?',[][_0xaaf5('0x80')](_0x1327e4[_0xaaf5('0x41')][_0x50eac8]));}else if(_0x50eac8==='createdAt'){var _0x4adbe6=JSON['parse'](_0x1327e4[_0xaaf5('0x41')][_0x50eac8])['$gte'];var _0x5f2b9f=JSON[_0xaaf5('0x81')](_0x1327e4['query'][_0x50eac8])[_0xaaf5('0x82')];_0x11511d[_0xaaf5('0x83')](_0xaaf5('0x84'),_0x4adbe6,_0x5f2b9f);}else{if(_0x1327e4[_0xaaf5('0x41')][_0x50eac8]==='null'){_0x11511d[_0xaaf5('0x83')]('i.'+_0x50eac8+_0xaaf5('0x85'));}else{_0x11511d[_0xaaf5('0x83')]('i.'+_0x50eac8+_0xaaf5('0x86'),_0x1327e4[_0xaaf5('0x41')][_0x50eac8]);}}});}if(_0x1327e4[_0xaaf5('0x41')][_0xaaf5('0x87')]){if(_0x1327e4['query'][_0xaaf5('0x87')]==0x1){_0x11511d['having']('`unreadMessages`\x20=\x200');}else{_0x11511d[_0xaaf5('0x69')](_0xaaf5('0x88'));}}if(_0x1327e4[_0xaaf5('0x41')][_0xaaf5('0x89')]){_0x1e8112=_[_0xaaf5('0x8a')](_0x1327e4['query'][_0xaaf5('0x89')])?_0x1327e4[_0xaaf5('0x41')][_0xaaf5('0x89')]:new Array(_0x1327e4[_0xaaf5('0x41')][_0xaaf5('0x89')]);_0x1e8112[_0xaaf5('0x31')](function(_0x45ba92){_0x18cb4b['or'](_0xaaf5('0x77'),'%,'+_0x45ba92+',%');});}if(_0x1327e4[_0xaaf5('0x41')]['filter']){var _0x2de8f6=_0x1327e4[_0xaaf5('0x41')][_0xaaf5('0x8b')][_0xaaf5('0x8c')]('\x5c','\x5c\x5c')[_0xaaf5('0x8c')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x2de8f6)){_0x487942['or'](_0xaaf5('0x8d'),_0x2de8f6+'%')['or']('i.phone\x20LIKE\x20?',_0x2de8f6+'%');}else{_0x487942['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x2de8f6))['or'](_0xaaf5('0x8e'),_0x2de8f6+'%');}}}_0x11511d[_0xaaf5('0x83')](_0x487942);_0x11511d[_0xaaf5('0x8f')](_0xaaf5('0x90'));var _0xbfbeeb={'type':db[_0xaaf5('0x91')]['QueryTypes']['SELECT'],'raw':!![]};var _0x886a7b=_0x11511d[_0xaaf5('0x92')]();_0x886a7b['field'](_0xaaf5('0x90'));_0x886a7b[_0xaaf5('0x4b')](_0xaaf5('0x93'),_0xaaf5('0x67'));if(_0x10bd04[_0xaaf5('0x94')]){_0x10bd04[_0xaaf5('0x94')][_0xaaf5('0x31')](function(_0x3f4e0d){var _0x49de9e=_0x3f4e0d[0x0]==='contactName'?_0x3f4e0d[0x0]:'i.'+_0x3f4e0d[0x0];_0x11511d[_0xaaf5('0x94')](_0x49de9e,_0x3f4e0d[0x1]===_0xaaf5('0x95')?![]:!![]);});}if(!_[_0xaaf5('0x7e')](_0x1e8112)){_0x11511d[_0xaaf5('0x69')](_0x18cb4b);_0x886a7b['where']('t.id\x20IN\x20?',_0x1e8112);}BPromise[_0xaaf5('0x96')]()[_0xaaf5('0x29')](function(){if(!_0x3ab187){if(_0x1327e4[_0xaaf5('0x41')]['WhatsappAccountId'])return;_0x886a7b[_0xaaf5('0x83')](_0xaaf5('0x97'));_0x11511d['where'](_0xaaf5('0x97'));return;}if(_0x1327e4[_0xaaf5('0x98')][_0xaaf5('0x99')]!=='agent')return;return _0x1327e4[_0xaaf5('0x98')][_0xaaf5('0x9a')]({'attributes':['id'],'raw':!![]})[_0xaaf5('0x29')](function(_0x263799){if(_[_0xaaf5('0x7e')](_0x263799)){_0x886a7b['where']('i.WhatsappAccountId\x20IS\x20NULL');_0x11511d[_0xaaf5('0x83')](_0xaaf5('0x9b'));}else{_0x886a7b[_0xaaf5('0x83')](_0xaaf5('0x9c'),_[_0xaaf5('0x2e')](_0x263799,'id'));_0x11511d[_0xaaf5('0x83')](_0xaaf5('0x9c'),_[_0xaaf5('0x2e')](_0x263799,'id'));}});})[_0xaaf5('0x29')](function(){if(_0x1327e4[_0xaaf5('0x98')]['role']===_0xaaf5('0x9d')&&!_0x3ab187&&!_0x1327e4['query'][_0xaaf5('0x7f')])return[];return db[_0xaaf5('0x9e')][_0xaaf5('0x41')](_0x886a7b[_0xaaf5('0x9f')](),_0xbfbeeb);})[_0xaaf5('0x29')](function(_0x11abf3){_0x560cfd['count']=_0x11abf3[_0xaaf5('0x47')];if(_0x560cfd[_0xaaf5('0x22')]===0x0)return[];return db[_0xaaf5('0x9e')]['query'](_0x461f9c[_0xaaf5('0x9f')](),_0xbfbeeb)[_0xaaf5('0x29')](function(_0x3afba5){_0x47d566=_['keyBy'](_0x3afba5,'id');_0xbfbeeb=_['merge'](_0xbfbeeb,{'model':db[_0xaaf5('0x3c')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x1327e4[_0xaaf5('0x41')][_0xaaf5('0x46')]){_0x10bd04[_0xaaf5('0x45')][_0xaaf5('0x31')](function(_0x21ee5e){_0x11511d[_0xaaf5('0x4b')]('i.'+_0x21ee5e);});}else{_0x11511d[_0xaaf5('0x4b')](_0xaaf5('0x93'),_0xaaf5('0x67'));_0x11511d[_0xaaf5('0x4b')](_0xaaf5('0xa0'),_0xaaf5('0xa1'));_0x11511d[_0xaaf5('0x4b')](_0xaaf5('0xa2'),_0xaaf5('0xa3'));_0x11511d['field'](_0xaaf5('0xa4'),_0xaaf5('0xa5'));_0x11511d[_0xaaf5('0x4b')](_0xaaf5('0xa6'));_0x11511d[_0xaaf5('0x4b')](_0xaaf5('0xa7'),_0xaaf5('0xa8'));_0x11511d['field']('c.lastName','Contact.lastName');_0x11511d['field'](_0xaaf5('0xa9'),_0xaaf5('0xaa'));_0x11511d['field'](_0xaaf5('0xab'),_0xaaf5('0xac'));_0x11511d[_0xaaf5('0x4b')](_0xaaf5('0xad'),_0xaaf5('0xae'));_0x11511d[_0xaaf5('0x4b')](_0xaaf5('0xaf'),_0xaaf5('0xb0'));_0x11511d[_0xaaf5('0x4b')](_0xaaf5('0xb1'),_0xaaf5('0xb2'));_0x11511d[_0xaaf5('0x4b')](_0xaaf5('0xb3'),_0xaaf5('0xb4'));_0x11511d[_0xaaf5('0x4b')](_0xaaf5('0xb5'),_0xaaf5('0x30'));}if(_0x10bd04[_0xaaf5('0x23')])_0x11511d[_0xaaf5('0x23')](_0x10bd04['limit']);if(_0x10bd04[_0xaaf5('0x20')])_0x11511d[_0xaaf5('0x20')](_0x10bd04[_0xaaf5('0x20')]);return db[_0xaaf5('0x9e')][_0xaaf5('0x41')](_0x11511d['toString'](),_0xbfbeeb);})[_0xaaf5('0x29')](function(_0x368f23){if(_0x368f23['length']>0x0)_0x24144c[_0xaaf5('0x83')]('ui.WhatsappInteractionId\x20IN\x20?',_['map'](_0x368f23,'id'));return db[_0xaaf5('0x9e')][_0xaaf5('0x41')](_0x24144c[_0xaaf5('0x9f')](),_0xbfbeeb)[_0xaaf5('0x29')](function(_0x332e70){var _0x230497=_[_0xaaf5('0xb6')](_0x332e70,_0xaaf5('0xb7'));var _0x16b5a7=[];_0x368f23[_0xaaf5('0x31')](function(_0x5074d8){_0x16b5a7[_0xaaf5('0x32')](updateWhatsappInteraction(_0x5074d8,_0x47d566,_0x230497));});return BPromise[_0xaaf5('0xb8')](_0x16b5a7);});});})[_0xaaf5('0x29')](function(_0x33525c){_0x560cfd['rows']=_0x33525c;return _0x560cfd;})[_0xaaf5('0x29')](respondWithFilteredResult(_0x2094f4,_0x10bd04))[_0xaaf5('0x33')](handleError(_0x2094f4,null));};exports['show']=function(_0x5effbe,_0x21769f){var _0x5ca015={'raw':![],'where':{'id':_0x5effbe[_0xaaf5('0xb9')]['id']}},_0x26d507={};_0x26d507[_0xaaf5('0x40')]=_[_0xaaf5('0x42')](db[_0xaaf5('0x3c')][_0xaaf5('0x3d')]);_0x26d507[_0xaaf5('0x41')]=_[_0xaaf5('0x42')](_0x5effbe['query']);_0x26d507[_0xaaf5('0x43')]=_[_0xaaf5('0x44')](_0x26d507[_0xaaf5('0x40')],_0x26d507[_0xaaf5('0x41')]);_0x5ca015['attributes']=_[_0xaaf5('0x44')](_0x26d507[_0xaaf5('0x40')],qs[_0xaaf5('0x46')](_0x5effbe[_0xaaf5('0x41')]['fields']));_0x5ca015['attributes']=_0x5ca015[_0xaaf5('0x45')]['length']?_0x5ca015[_0xaaf5('0x45')]:_0x26d507[_0xaaf5('0x40')];if(_0x5effbe[_0xaaf5('0x41')]['includeAll']){_0x5ca015[_0xaaf5('0xba')]=[{'all':!![]}];}_0x5ca015=_[_0xaaf5('0xbb')]({},_0x5ca015,_0x5effbe[_0xaaf5('0xbc')]);return db[_0xaaf5('0x3c')][_0xaaf5('0x66')](_0x5ca015)[_0xaaf5('0x29')](handleEntityNotFound(_0x21769f,null))['then'](respondWithResult(_0x21769f,null))['catch'](handleError(_0x21769f,null));};exports[_0xaaf5('0xbd')]=function(_0x58e62b,_0x1ef41b){return db[_0xaaf5('0x3c')][_0xaaf5('0xbd')](_0x58e62b[_0xaaf5('0x7b')],{})[_0xaaf5('0x29')](respondWithResult(_0x1ef41b,0xc9))[_0xaaf5('0x33')](handleError(_0x1ef41b,null));};exports[_0xaaf5('0xbe')]=function(_0x4cf4af,_0x86d460){if(_0x4cf4af[_0xaaf5('0x7b')]['id']){delete _0x4cf4af[_0xaaf5('0x7b')]['id'];}return db['WhatsappInteraction'][_0xaaf5('0x66')]({'where':{'id':_0x4cf4af[_0xaaf5('0xb9')]['id']}})[_0xaaf5('0x29')](handleEntityNotFound(_0x86d460,null))[_0xaaf5('0x29')](saveUpdates(_0x4cf4af['body'],null))[_0xaaf5('0x29')](respondWithResult(_0x86d460,null))[_0xaaf5('0x33')](handleError(_0x86d460,null));};exports['destroy']=function(_0x41f013,_0x177217){return db[_0xaaf5('0x3c')]['find']({'where':{'id':_0x41f013[_0xaaf5('0xb9')]['id']}})[_0xaaf5('0x29')](handleEntityNotFound(_0x177217,null))[_0xaaf5('0x29')](removeEntity(_0x177217,null))[_0xaaf5('0x33')](handleError(_0x177217,null));};exports['describe']=function(_0x56cee1,_0x3e42c8){return db[_0xaaf5('0x3c')][_0xaaf5('0xbf')]()['then'](respondWithResult(_0x3e42c8,null))[_0xaaf5('0x33')](handleError(_0x3e42c8,null));};exports['addMessage']=function(_0x37786b,_0x35532d,_0x43a419){return db[_0xaaf5('0xc0')]['find']({'where':{'id':_0x37786b['params']['id']}})[_0xaaf5('0x29')](handleEntityNotFound(_0x35532d,null))['then'](function(_0x1bd9d3){if(_0x1bd9d3){return _0x1bd9d3[_0xaaf5('0xc1')](_0x37786b[_0xaaf5('0x7b')]['ids'],_[_0xaaf5('0xc2')](_0x37786b[_0xaaf5('0x7b')],[_0xaaf5('0xc3'),'id'])||{});}})[_0xaaf5('0x29')](respondWithResult(_0x35532d,null))[_0xaaf5('0x33')](handleError(_0x35532d,null));};exports[_0xaaf5('0xc4')]=function(_0x1b9439,_0x31b27a,_0x5408d0){var _0xaad03f={'raw':![],'where':{}};var _0x5be9e6={};var _0x5bb099={'count':0x0,'rows':[]};return db['WhatsappInteraction'][_0xaaf5('0xc5')]({'where':{'id':_0x1b9439[_0xaaf5('0xb9')]['id']}})['then'](handleEntityNotFound(_0x31b27a,null))['then'](function(_0x409c0e){if(_0x409c0e){_0x5be9e6[_0xaaf5('0x40')]=_[_0xaaf5('0x42')](db[_0xaaf5('0xc0')][_0xaaf5('0x3d')]);_0x5be9e6[_0xaaf5('0x41')]=_['keys'](_0x1b9439[_0xaaf5('0x41')]);_0x5be9e6[_0xaaf5('0x43')]=_[_0xaaf5('0x44')](_0x5be9e6[_0xaaf5('0x40')],_0x5be9e6['query']);_0xaad03f[_0xaaf5('0x45')]=_[_0xaaf5('0x44')](_0x5be9e6[_0xaaf5('0x40')],qs['fields'](_0x1b9439[_0xaaf5('0x41')][_0xaaf5('0x46')]));_0xaad03f[_0xaaf5('0x45')]=_0xaad03f[_0xaaf5('0x45')]['length']?_0xaad03f[_0xaaf5('0x45')]:_0x5be9e6[_0xaaf5('0x40')];if(!_0x1b9439[_0xaaf5('0x41')][_0xaaf5('0x48')](_0xaaf5('0xc6'))){_0xaad03f[_0xaaf5('0x23')]=qs['limit'](_0x1b9439['query'][_0xaaf5('0x23')]);_0xaad03f[_0xaaf5('0x20')]=qs['offset'](_0x1b9439[_0xaaf5('0x41')][_0xaaf5('0x20')]);}_0xaad03f[_0xaaf5('0x94')]=qs[_0xaaf5('0x49')](_0x1b9439['query'][_0xaaf5('0x49')]);_0xaad03f[_0xaaf5('0x83')]=qs[_0xaaf5('0x43')](_['pick'](_0x1b9439[_0xaaf5('0x41')],_0x5be9e6['filters']));_0xaad03f['where'][_0xaaf5('0xb7')]=_0x409c0e['id'];if(_0x1b9439[_0xaaf5('0x41')]['filter']){_0xaad03f['where']=_[_0xaaf5('0xbb')](_0xaad03f[_0xaaf5('0x83')],{'$or':_[_0xaaf5('0x2e')](_0xaad03f[_0xaaf5('0x45')],function(_0x535d06){var _0xf92b9b={};_0xf92b9b[_0x535d06]={'$like':'%'+_0x1b9439[_0xaaf5('0x41')]['filter']+'%'};return _0xf92b9b;})});}if(_0x1b9439['query'][_0xaaf5('0xc7')]){var _0x26a585=_0x1b9439[_0xaaf5('0x41')][_0xaaf5('0xc7')]['split'](',');var _0x42ddf7={};_0x42ddf7[_0x26a585[0x0]]={'$gte':moment(_0x26a585[0x1])[_0xaaf5('0xc8')]('YYYY-MM-DD\x20HH:mm:ss')};_0xaad03f[_0xaaf5('0x83')]=_['merge'](_0xaad03f[_0xaaf5('0x83')],_0x42ddf7);}_0xaad03f=_[_0xaaf5('0xbb')]({},_0xaad03f,_0x1b9439[_0xaaf5('0xbc')]);return db[_0xaaf5('0xc0')]['count']({'where':_0xaad03f[_0xaaf5('0x83')]})[_0xaaf5('0x29')](function(_0x1ebf3f){_0x5bb099[_0xaaf5('0x22')]=_0x1ebf3f;if(_0x1b9439['query']['includeAll']){_0xaad03f[_0xaaf5('0xba')]=[{'all':!![]}];}return db['WhatsappMessage']['findAll'](_0xaad03f);})['then'](function(_0x8bd1ad){_0x5bb099[_0xaaf5('0xc9')]=_0x8bd1ad;return _0x5bb099;});}})['then'](respondWithFilteredResult(_0x31b27a,_0xaad03f))[_0xaaf5('0x33')](handleError(_0x31b27a,null));};exports[_0xaaf5('0xca')]=function(_0x1d87ee,_0x479534,_0x4db1f5){return db[_0xaaf5('0x3c')]['find']({'where':{'id':_0x1d87ee['params']['id']}})[_0xaaf5('0x29')](handleEntityNotFound(_0x479534,null))[_0xaaf5('0x29')](function(_0x8d73d7){if(_0x8d73d7){return _0x8d73d7[_0xaaf5('0xcb')](_0x1d87ee[_0xaaf5('0x7b')][_0xaaf5('0xc3')],_[_0xaaf5('0xc2')](_0x1d87ee[_0xaaf5('0x7b')],['ids','id'])||{})[_0xaaf5('0xcc')](function(){return db[_0xaaf5('0x76')]['findAll']({'attributes':['id',_0xaaf5('0x2d'),_0xaaf5('0x4c')],'where':{'id':_0x1d87ee[_0xaaf5('0x7b')][_0xaaf5('0xc3')]}});})[_0xaaf5('0x29')](function(_0x364663){socket[_0xaaf5('0xcd')](_0xaaf5('0xce'),{'id':Number(_0x1d87ee[_0xaaf5('0xb9')]['id']),'tags':_0x364663||[]});return{'id':Number(_0x1d87ee[_0xaaf5('0xb9')]['id']),'tags':_0x364663||[]};});}})[_0xaaf5('0x29')](respondWithResult(_0x479534,null))['catch'](handleError(_0x479534,null));};exports[_0xaaf5('0xcf')]=function(_0x462ff3,_0x19bd04,_0x7ae25e){return db[_0xaaf5('0x3c')]['find']({'where':{'id':_0x462ff3[_0xaaf5('0xb9')]['id']}})[_0xaaf5('0x29')](handleEntityNotFound(_0x19bd04,null))['then'](function(_0x1df815){if(_0x1df815){return _0x1df815[_0xaaf5('0xcf')](_0x462ff3[_0xaaf5('0x41')]['ids']);}})[_0xaaf5('0x29')](respondWithStatusCode(_0x19bd04,null))[_0xaaf5('0x33')](handleError(_0x19bd04,null));};exports[_0xaaf5('0xd0')]=function(_0x5317fc,_0x1febb5){var _0x3348ca=moment()[_0xaaf5('0xd1')]()[_0xaaf5('0x9f')]();var _0x1f0046=path[_0xaaf5('0xd2')](config['root'],_0xaaf5('0xd3'),_0xaaf5('0xd4'),_0xaaf5('0xd5'));var _0x3394fa=path[_0xaaf5('0xd2')](config[_0xaaf5('0xd6')],_0xaaf5('0xd3'),_0xaaf5('0xd4'),_0xaaf5('0xd7'));var _0x5420f4=path[_0xaaf5('0xd2')](_0x1f0046,_0x3348ca);var _0x37c17a=util[_0xaaf5('0xc8')](_0xaaf5('0xd8'),_0x5317fc[_0xaaf5('0xb9')]['id'],_0x3348ca);var _0x33d435=path[_0xaaf5('0xd2')](_0x1f0046,_0x37c17a);var _0x19efc3=[];_0x19efc3[_0xaaf5('0x32')]({'model':db['User'],'as':'User','attributes':['id',_0xaaf5('0x2f')],'raw':!![]});_0x19efc3[_0xaaf5('0x32')]({'model':db[_0xaaf5('0xd9')],'as':_0xaaf5('0xda'),'attributes':['id',_0xaaf5('0xdb'),'lastName'],'raw':!![]});if(_0x5317fc[_0xaaf5('0x41')]['attachments']){_0x19efc3[_0xaaf5('0x32')]({'model':db[_0xaaf5('0xdc')],'as':'Attachment','raw':!![]});}var _0xb87ddb=[{'model':db[_0xaaf5('0xc0')],'as':_0xaaf5('0xdd'),'attributes':['id','body',_0xaaf5('0xde'),_0xaaf5('0xdf'),_0xaaf5('0xe0'),_0xaaf5('0x87')],'include':_0x19efc3}];_0xb87ddb['push']({'model':db[_0xaaf5('0xe1')],'as':_0xaaf5('0xe2'),'attributes':['id',_0xaaf5('0x2d')]});_0xb87ddb['push']({'model':db[_0xaaf5('0x79')],'as':_0xaaf5('0xe3'),'attributes':['id','fullname']});return db[_0xaaf5('0x3c')][_0xaaf5('0x66')]({'where':{'id':_0x5317fc[_0xaaf5('0xb9')]['id']},'include':_0xb87ddb})[_0xaaf5('0x29')](handleEntityNotFound(_0x1febb5,null))[_0xaaf5('0x29')](function(_0x15dea3){if(_0x15dea3){var _0x2f4da2=_0x15dea3['get']({'plain':!![]});fs['mkdirSync'](_0x5420f4);var _0x3a415a={'channel':_0xaaf5('0xe4'),'account':_0x2f4da2[_0xaaf5('0xe2')][_0xaaf5('0x2d')],'agent':_0x2f4da2[_0xaaf5('0xe3')]?_0x2f4da2[_0xaaf5('0xe3')]['fullname']:'N.A.','createdAt':moment(_0x2f4da2[_0xaaf5('0xde')])[_0xaaf5('0xc8')](_0xaaf5('0xe5'))['toString'](),'closedAt':_0x2f4da2[_0xaaf5('0x39')]?moment(_0x2f4da2[_0xaaf5('0xe6')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0xaaf5('0x9f')]():'','disposition':_0x2f4da2['disposition'],'messages':_(_0x2f4da2[_0xaaf5('0xdd')])[_0xaaf5('0x8b')]({'secret':![]})[_0xaaf5('0x2e')](function(_0x1e1630){if(_0x1e1630['Attachment']){var _0xdde8c=path['join'](_0x3394fa,_0x1e1630[_0xaaf5('0xdc')][_0xaaf5('0xe7')]);if(fs[_0xaaf5('0xe8')](_0xdde8c)){fs['createReadStream'](_0xdde8c)[_0xaaf5('0xe9')](fs['createWriteStream'](path[_0xaaf5('0xd2')](_0x5420f4,_0x1e1630[_0xaaf5('0xdc')][_0xaaf5('0xe7')])));}}return{'date':moment(_0x1e1630[_0xaaf5('0xde')])[_0xaaf5('0xc8')](_0xaaf5('0xe5'))[_0xaaf5('0x9f')](),'sender':_0x1e1630[_0xaaf5('0xdf')]===_0xaaf5('0xea')?_0x1e1630[_0xaaf5('0x79')]?_0x1e1630[_0xaaf5('0x79')][_0xaaf5('0x2f')]:_0xaaf5('0xeb'):_0x1e1630[_0xaaf5('0xda')][_0xaaf5('0xdb')]+(_0x1e1630[_0xaaf5('0xda')][_0xaaf5('0xec')]?'\x20'+_0x1e1630[_0xaaf5('0xda')][_0xaaf5('0xec')]:''),'body':_0x1e1630[_0xaaf5('0xdc')]?_0x1e1630[_0xaaf5('0xdc')][_0xaaf5('0xe7')]:_0x1e1630[_0xaaf5('0x7b')],'direction':_0x1e1630['direction']===_0xaaf5('0xea')?'A':'C','secret':_0x1e1630[_0xaaf5('0xe0')],'read':_0x1e1630[_0xaaf5('0x87')],'attachment':_0x1e1630[_0xaaf5('0xdc')]};})[_0xaaf5('0x6d')]()};return ejs[_0xaaf5('0xed')](path[_0xaaf5('0xd2')](config['root'],'server',_0xaaf5('0xee'),_0xaaf5('0xef')),{'interaction':_0x3a415a})['then'](function(_0x13e20b){var _0x3b472a=path[_0xaaf5('0xd2')](_0x5420f4,_0xaaf5('0xf0')+_0x2f4da2['id']+'-'+_0x3348ca+_0xaaf5('0xf1'));var _0x1cf015={'path':_0x3b472a,'channel':_0xaaf5('0xe4'),'interactionId':_0x2f4da2['id']};return pdf[_0xaaf5('0xf2')](_0x13e20b,_0x1cf015);})[_0xaaf5('0x29')](function(){return new BPromise(function(_0x1d9943,_0xa71c9c){zipdir(_0x5420f4,{'saveTo':_0x33d435},function(_0x18e4a5,_0x11edcb){if(_0x18e4a5)return _0xa71c9c(_0x18e4a5);return _0x1d9943(_0x11edcb);});})[_0xaaf5('0x29')](function(){return new BPromise(function(_0x4784d8,_0x36d571){rimraf(_0x5420f4,function(_0x56eb41){if(_0x56eb41)_0x36d571(_0x56eb41);return _0x4784d8();});});})[_0xaaf5('0x29')](function(){return _0x1febb5[_0xaaf5('0xd0')](_0x33d435,_0x37c17a,function(_0x2402a7){if(_0x2402a7){console['log'](_0xaaf5('0xf3'),_0x2402a7);}else{fs[_0xaaf5('0xf4')](_0x33d435);}});});});}else{return _0x1febb5[_0xaaf5('0x1c')](0xc8);}})[_0xaaf5('0x33')](handleError(_0x1febb5,null));};
\ No newline at end of file
+var _0xf69c=['\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','having','isArray','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','isEmpty','t.id\x20IN\x20?','resolve','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','user','role','agent','toString','keyBy','merge','a.key','Account.key','Account.mandatoryDisposition','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','Contact.mobile','o.fullname','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','sequelize','ui.WhatsappInteractionId\x20IN\x20?','WhatsappInteractionId','show','params','keys','includeAll','include','options','create','body','describe','addMessage','ids','omit','getMessages','findOne','WhatsappMessage','pick','$gte','YYYY-MM-DD\x20HH:mm:ss','rows','setTags','spread','findAll','color','emit','whatsappInteractionTags:save','removeTags','download','unix','root','server','files','tmp','join','format','firstName','lastName','attachments','Attachment','direction','secret','WhatsappAccount','Account','Owner','get','mkdirSync','Whatsapp','N.A.','Messages','basename','createReadStream','pipe','out','System','renderFile','views','transcript-','createPdfFromHTML','log','err','unlinkSync','eml-format','zip-dir','fast-json-patch','moment','mustache','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','stack','name','Users','map','fullname','TagIds','Tags','split','forEach','push','catch','answered','unmanaged','total','closed','UserId','waiting','talking','WhatsappInteraction','rawAttributes','type','key','query','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','field','from','u.id','u.fullname','ui.WhatsappInteractionId','user_has_whatsapp_interactions','left_join','users','u.id\x20=\x20ui.UserId','select','whatsapp_interactions','cm_contacts','o.id\x20=\x20i.UserId','whatsapp_accounts','a.id\x20=\x20i.WhatsappAccountId','whatsapp_messages','me.WhatsappInteractionId\x20=\x20i.id','whatsapp_interaction_has_tags','it.WhatsappInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','length','unreadMessages','`\x20>\x200','Contact','$substring','value','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','text','start','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','buildExpression','WhatsappAccountId','i.WhatsappAccountId\x20IN\x20?','concat','createdAt','parse','i.createdAt\x20BETWEEN\x20?\x20AND\x20?'];(function(_0x270adf,_0x1daaa3){var _0x29eda9=function(_0x40afec){while(--_0x40afec){_0x270adf['push'](_0x270adf['shift']());}};_0x29eda9(++_0x1daaa3);}(_0xf69c,0x151));var _0xcf69=function(_0x210b46,_0x52a05f){_0x210b46=_0x210b46-0x0;var _0x203df2=_0xf69c[_0x210b46];return _0x203df2;};'use strict';var emlformat=require(_0xcf69('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcf69('0x1'));var jsonpatch=require(_0xcf69('0x2'));var rp=require('request-promise');var moment=require(_0xcf69('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xcf69('0x4'));var util=require('util');var path=require(_0xcf69('0x5'));var sox=require('sox');var csv=require(_0xcf69('0x6'));var ejs=require(_0xcf69('0x7'));var fs=require('fs');var fs_extra=require(_0xcf69('0x8'));var _=require(_0xcf69('0x9'));var squel=require(_0xcf69('0xa'));var crypto=require('crypto');var jsforce=require(_0xcf69('0xb'));var deskjs=require(_0xcf69('0xc'));var toCsv=require(_0xcf69('0x6'));var querystring=require(_0xcf69('0xd'));var Papa=require('papaparse');var Redis=require(_0xcf69('0xe'));var authService=require(_0xcf69('0xf'));var qs=require(_0xcf69('0x10'));var as=require(_0xcf69('0x11'));var pdf=require(_0xcf69('0x12'));var hardwareService=require(_0xcf69('0x13'));var logger=require('../../config/logger')(_0xcf69('0x14'));var utils=require('../../config/utils');var config=require(_0xcf69('0x15'));var licenseUtil=require(_0xcf69('0x16'));var db=require(_0xcf69('0x17'))['db'];config[_0xcf69('0x18')]=_[_0xcf69('0x19')](config[_0xcf69('0x18')],{'host':_0xcf69('0x1a'),'port':0x18eb});var socket=require(_0xcf69('0x1b'))(new Redis(config['redis']));require('./whatsappInteraction.socket')['register'](socket);function respondWithStatusCode(_0x525102,_0x41ff4a){_0x41ff4a=_0x41ff4a||0xcc;return function(_0x569d0b){if(_0x569d0b){return _0x525102[_0xcf69('0x1c')](_0x41ff4a);}return _0x525102[_0xcf69('0x1d')](_0x41ff4a)[_0xcf69('0x1e')]();};}function respondWithResult(_0x2ca371,_0x5691ec){_0x5691ec=_0x5691ec||0xc8;return function(_0x32cbcf){if(_0x32cbcf){return _0x2ca371[_0xcf69('0x1d')](_0x5691ec)['json'](_0x32cbcf);}};}function respondWithFilteredResult(_0x486e06,_0x438700){return function(_0x3198a6){if(_0x3198a6){var _0x39306a=typeof _0x438700[_0xcf69('0x1f')]===_0xcf69('0x20')&&typeof _0x438700[_0xcf69('0x21')]===_0xcf69('0x20');var _0x210630=_0x3198a6['count'];var _0x19b5ed=_0x39306a?0x0:_0x438700['offset'];var _0xbe9cd5=_0x39306a?_0x3198a6[_0xcf69('0x22')]:_0x438700[_0xcf69('0x1f')]+_0x438700[_0xcf69('0x21')];var _0x2af301;if(_0xbe9cd5>=_0x210630){_0xbe9cd5=_0x210630;_0x2af301=0xc8;}else{_0x2af301=0xce;}_0x486e06[_0xcf69('0x1d')](_0x2af301);return _0x486e06[_0xcf69('0x23')](_0xcf69('0x24'),_0x19b5ed+'-'+_0xbe9cd5+'/'+_0x210630)[_0xcf69('0x25')](_0x3198a6);}return null;};}function patchUpdates(_0x1061d4){return function(_0x11bd31){try{jsonpatch[_0xcf69('0x26')](_0x11bd31,_0x1061d4,!![]);}catch(_0x2170c1){return BPromise[_0xcf69('0x27')](_0x2170c1);}return _0x11bd31[_0xcf69('0x28')]();};}function saveUpdates(_0x5d16ef,_0x2b4c1b){return function(_0x1abce9){if(_0x1abce9){return _0x1abce9[_0xcf69('0x29')](_0x5d16ef)[_0xcf69('0x2a')](function(_0x9a006b){return _0x9a006b;});}return null;};}function removeEntity(_0x1a0b33,_0x5643b3){return function(_0x4a07c5){if(_0x4a07c5){return _0x4a07c5[_0xcf69('0x2b')]()['then'](function(){_0x1a0b33[_0xcf69('0x1d')](0xcc)[_0xcf69('0x1e')]();});}};}function handleEntityNotFound(_0xddec25,_0x42dbed){return function(_0x39a1b6){if(!_0x39a1b6){_0xddec25[_0xcf69('0x1c')](0x194);}return _0x39a1b6;};}function handleError(_0x17d1e5,_0x360bc2){_0x360bc2=_0x360bc2||0x1f4;return function(_0x54ad03){logger['error'](_0x54ad03[_0xcf69('0x2c')]);if(_0x54ad03[_0xcf69('0x2d')]){delete _0x54ad03[_0xcf69('0x2d')];}_0x17d1e5[_0xcf69('0x1d')](_0x360bc2)['send'](_0x54ad03);};}function getInteractionUsers(_0x200762,_0xd19ace){return new BPromise(function(_0x7a011b,_0x477511){try{if(_0xd19ace[_0x200762['id']]){_0x200762[_0xcf69('0x2e')]=_[_0xcf69('0x2f')](_0xd19ace[_0x200762['id']],function(_0x1a517f){return{'id':_0x1a517f['id'],'fullname':_0x1a517f[_0xcf69('0x30')]};});}}catch(_0xcdb8c5){_0x477511(_0xcdb8c5);}_0x7a011b(_0x200762);});}function getInteractionTags(_0x6ca69b,_0x4a5db6){return new BPromise(function(_0x38753b,_0x490c22){try{if(_0x6ca69b[_0xcf69('0x31')]){_0x6ca69b[_0xcf69('0x32')]=[];_0x6ca69b[_0xcf69('0x31')][_0xcf69('0x33')](',')[_0xcf69('0x34')](function(_0x1762b7){_0x6ca69b[_0xcf69('0x32')][_0xcf69('0x35')](_0x4a5db6[_0x1762b7]);});}delete _0x6ca69b[_0xcf69('0x31')];}catch(_0x1ada1f){_0x490c22(_0x1ada1f);}_0x38753b(_0x6ca69b);});}function updateWhatsappInteraction(_0x573618,_0x2753fe,_0x10da39){return new BPromise(function(_0x58739d,_0x171bd5){return getInteractionUsers(_0x573618,_0x10da39)['then'](function(_0x4018ac){return getInteractionTags(_0x4018ac,_0x2753fe);})['then'](function(_0x5211a0){return getStateInteraction(_0x5211a0);})[_0xcf69('0x2a')](function(_0x33ec6c){_0x58739d(_0x33ec6c);})[_0xcf69('0x36')](function(_0x40221e){_0x171bd5(_0x40221e);});});}function getStateInteraction(_0x1a105e){return new BPromise(function(_0x90d2b5){_0x1a105e['waiting']=0x0;_0x1a105e['talking']=0x0;_0x1a105e[_0xcf69('0x37')]=0x0;_0x1a105e[_0xcf69('0x38')]=0x0;_0x1a105e[_0xcf69('0x39')]=0x0;if(!_0x1a105e[_0xcf69('0x3a')]&&!_0x1a105e[_0xcf69('0x3b')]){_0x1a105e[_0xcf69('0x3c')]+=0x1;}if(!_0x1a105e[_0xcf69('0x3a')]&&_0x1a105e[_0xcf69('0x3b')]){_0x1a105e[_0xcf69('0x3d')]+=0x1;if(_0x1a105e[_0xcf69('0x3c')]){_0x1a105e[_0xcf69('0x3c')]-=0x1;}}if(_0x1a105e[_0xcf69('0x3a')]&&_0x1a105e[_0xcf69('0x3b')]){_0x1a105e[_0xcf69('0x37')]+=0x1;if(_0x1a105e[_0xcf69('0x3d')]){_0x1a105e[_0xcf69('0x3d')]-=0x1;}}if(_0x1a105e[_0xcf69('0x3a')]&&!_0x1a105e[_0xcf69('0x3b')]){_0x1a105e[_0xcf69('0x38')]+=0x1;if(_0x1a105e[_0xcf69('0x3c')]){_0x1a105e[_0xcf69('0x3c')]-=0x1;}}_0x1a105e['total']+=0x1;_0x90d2b5(_0x1a105e);});}exports['index']=function(_0x8179f8,_0x35c5ea){var _0x129d73={},_0x3f18c6={},_0x4d285f={'count':0x0,'rows':[]};var _0x104f3d=_[_0xcf69('0x2f')](db[_0xcf69('0x3e')][_0xcf69('0x3f')],function(_0x161f11){return{'name':_0x161f11['fieldName'],'type':_0x161f11[_0xcf69('0x40')][_0xcf69('0x41')]};});_0x3f18c6['model']=_[_0xcf69('0x2f')](_0x104f3d,_0xcf69('0x2d'));_0x3f18c6[_0xcf69('0x42')]=_['keys'](_0x8179f8[_0xcf69('0x42')]);_0x3f18c6['filters']=_[_0xcf69('0x43')](_0x3f18c6[_0xcf69('0x44')],_0x3f18c6['query']);_0x129d73['attributes']=_[_0xcf69('0x43')](_0x3f18c6[_0xcf69('0x44')],qs[_0xcf69('0x45')](_0x8179f8['query']['fields']));_0x129d73[_0xcf69('0x46')]=_0x129d73[_0xcf69('0x46')]['length']?_0x129d73[_0xcf69('0x46')]:_0x3f18c6[_0xcf69('0x44')];if(!_0x8179f8[_0xcf69('0x42')][_0xcf69('0x47')](_0xcf69('0x48'))){_0x129d73[_0xcf69('0x21')]=qs['limit'](_0x8179f8[_0xcf69('0x42')][_0xcf69('0x21')]);_0x129d73[_0xcf69('0x1f')]=qs['offset'](_0x8179f8[_0xcf69('0x42')]['offset']);}_0x129d73[_0xcf69('0x49')]=qs[_0xcf69('0x4a')](_0x8179f8[_0xcf69('0x42')][_0xcf69('0x4a')]);_0x129d73[_0xcf69('0x4b')]=qs['filters'](_['pick'](_0x8179f8[_0xcf69('0x42')],_0x3f18c6[_0xcf69('0x4c')]),_0x104f3d);var _0x43ded1=[];var _0x547d8c=squel['select']()['field']('id')[_0xcf69('0x4d')](_0xcf69('0x2d'))[_0xcf69('0x4d')]('color')[_0xcf69('0x4e')]('tools_tags');var _0x1cb56d=squel['select']()[_0xcf69('0x4d')](_0xcf69('0x4f'))[_0xcf69('0x4d')](_0xcf69('0x50'))[_0xcf69('0x4d')](_0xcf69('0x51'))[_0xcf69('0x4e')](_0xcf69('0x52'),'ui')[_0xcf69('0x53')](_0xcf69('0x54'),'u',_0xcf69('0x55'));var _0x52473a=squel[_0xcf69('0x56')]()[_0xcf69('0x4e')](_0xcf69('0x57'),'i')['left_join'](_0xcf69('0x58'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0xcf69('0x53')](_0xcf69('0x54'),'o',_0xcf69('0x59'))[_0xcf69('0x53')](_0xcf69('0x5a'),'a',_0xcf69('0x5b'))[_0xcf69('0x53')](_0xcf69('0x5c'),'me',_0xcf69('0x5d'))[_0xcf69('0x53')](_0xcf69('0x5e'),'it',_0xcf69('0x5f'))[_0xcf69('0x53')]('tools_tags','t',_0xcf69('0x60'));var _0x2d5fb3=squel[_0xcf69('0x61')]();var _0x4907b1=[];var _0x4ecf0f=squel[_0xcf69('0x61')]();var _0x5d0df7;if(_0x8179f8[_0xcf69('0x42')][_0xcf69('0x62')]){_0x5d0df7=as['parseSearch'](_0x8179f8[_0xcf69('0x42')]['search']);var _0x4eb387=_0x5d0df7[_0xcf69('0x63')];for(var _0x51234a=0x0;_0x51234a<_0x5d0df7[_0xcf69('0x64')][_0xcf69('0x65')];_0x51234a++){var _0x59294e=_0x5d0df7[_0xcf69('0x64')][_0x51234a];var _0x200813='i';var _0x19fd95=_['find'](_0x104f3d,['name',_0x59294e[_0xcf69('0x4d')]]);if(!_0x19fd95){switch(_0x59294e[_0xcf69('0x4d')]){case _0xcf69('0x66'):if(_0x59294e['value']==0x1){_0x52473a['having']('`'+_0x59294e['field']+'`\x20=\x200');}else{_0x52473a['having']('`'+_0x59294e['field']+_0xcf69('0x67'));}break;case _0xcf69('0x68'):if(_0x59294e['operator']===_0xcf69('0x69')){if(_0x59294e[_0xcf69('0x6a')][_0xcf69('0x33')]('\x20')[_0xcf69('0x65')]>0x1){_0x2d5fb3[_0x4eb387](_0xcf69('0x6b'),qs[_0xcf69('0x6c')](_0x59294e['value']),null);}else{var _0x5605f4='%'+_0x59294e[_0xcf69('0x6a')]+'%';_0x2d5fb3[_0x4eb387](_0xcf69('0x6d'),_0x5605f4,_0x5605f4,_0x5605f4);}}else{_0x19fd95=_[_0xcf69('0x6e')](_0x104f3d,[_0xcf69('0x2d'),'ContactId']);_0x59294e['field']='ContactId';_0x39db20=as['buildExpression'](_0x200813,_0x19fd95[_0xcf69('0x40')],_0x59294e);_0x2d5fb3[_0x4eb387](_0x39db20[_0xcf69('0x6f')],_0x39db20[_0xcf69('0x6a')][_0xcf69('0x70')],_0x39db20[_0xcf69('0x6a')][_0xcf69('0x1e')]);}break;case'Tag':var _0x2c249f=_0x59294e[_0xcf69('0x6a')][_0xcf69('0x33')](',')[_0xcf69('0x2f')](function(_0xcc88d6){return Number(_0xcc88d6);});_0x2c249f[_0xcf69('0x34')](function(_0x4227e8){_0x4ecf0f['or'](_0xcf69('0x71'),'%,'+_0x4227e8+',%');});_0x4907b1=_[_0xcf69('0x72')](_0x4907b1,_0x2c249f);break;case _0xcf69('0x73'):if(_0x59294e[_0xcf69('0x74')]==='$substring'){_0x2d5fb3[_0x4eb387](_0xcf69('0x75'),'%'+_0x59294e[_0xcf69('0x6a')]+'%',null);}else{_0x19fd95=_[_0xcf69('0x6e')](_0x104f3d,['name',_0xcf69('0x3b')]);_0x59294e['field']=_0xcf69('0x3b');_0x39db20=as['buildExpression'](_0x200813,_0x19fd95['type'],_0x59294e);_0x2d5fb3[_0x4eb387](_0x39db20[_0xcf69('0x6f')],_0x39db20[_0xcf69('0x6a')][_0xcf69('0x70')],_0x39db20[_0xcf69('0x6a')][_0xcf69('0x1e')]);}break;case'body':_0x39db20=as[_0xcf69('0x76')]('me',null,_0x59294e);_0x2d5fb3[_0x4eb387](_0x39db20[_0xcf69('0x6f')],_0x39db20[_0xcf69('0x6a')]['start'],_0x39db20['value']['end']);break;}}else{var _0x39db20=as[_0xcf69('0x76')](_0x200813,_0x19fd95['type'],_0x59294e);_0x2d5fb3[_0x4eb387](_0x39db20[_0xcf69('0x6f')],_0x39db20['value'][_0xcf69('0x70')],_0x39db20[_0xcf69('0x6a')][_0xcf69('0x1e')]);}}}else{var _0x12633e=_(_0x8179f8[_0xcf69('0x42')])['keys']()['map'](function(_0x277996){return _['some'](_0x104f3d,[_0xcf69('0x2d'),_0x277996])?_0x277996:undefined;})['compact']()['value']();if(!_['isEmpty'](_0x12633e)){_0x12633e[_0xcf69('0x34')](function(_0x24a361){if(_0x24a361===_0xcf69('0x77')){_0x52473a[_0xcf69('0x4b')](_0xcf69('0x78'),[][_0xcf69('0x79')](_0x8179f8['query'][_0x24a361]));}else if(_0x24a361===_0xcf69('0x7a')){var _0x4d372c=JSON[_0xcf69('0x7b')](_0x8179f8[_0xcf69('0x42')][_0x24a361])['$gte'];var _0x2bf787=JSON[_0xcf69('0x7b')](_0x8179f8[_0xcf69('0x42')][_0x24a361])['$lte'];_0x52473a['where'](_0xcf69('0x7c'),_0x4d372c,_0x2bf787);}else{if(_0x8179f8[_0xcf69('0x42')][_0x24a361]==='null'){_0x52473a[_0xcf69('0x4b')]('i.'+_0x24a361+_0xcf69('0x7d'));}else{_0x52473a[_0xcf69('0x4b')]('i.'+_0x24a361+'\x20=\x20?',_0x8179f8['query'][_0x24a361]);}}});}if(_0x8179f8[_0xcf69('0x42')]['read']){if(_0x8179f8[_0xcf69('0x42')][_0xcf69('0x7e')]==0x1){_0x52473a['having'](_0xcf69('0x7f'));}else{_0x52473a[_0xcf69('0x80')]('`unreadMessages`\x20>\x200');}}if(_0x8179f8[_0xcf69('0x42')]['tag']){_0x4907b1=_[_0xcf69('0x81')](_0x8179f8[_0xcf69('0x42')][_0xcf69('0x82')])?_0x8179f8[_0xcf69('0x42')][_0xcf69('0x82')]:new Array(_0x8179f8[_0xcf69('0x42')][_0xcf69('0x82')]);_0x4907b1['forEach'](function(_0x2ed020){_0x4ecf0f['or'](_0xcf69('0x71'),'%,'+_0x2ed020+',%');});}if(_0x8179f8[_0xcf69('0x42')][_0xcf69('0x83')]){var _0x54afbc=_0x8179f8['query'][_0xcf69('0x83')][_0xcf69('0x84')]('\x5c','\x5c\x5c')[_0xcf69('0x84')](/'/g,'\x27\x27');if(qs[_0xcf69('0x85')](_0x54afbc)){_0x2d5fb3['or'](_0xcf69('0x86'),_0x54afbc+'%')['or'](_0xcf69('0x87'),_0x54afbc+'%');}else{_0x2d5fb3['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xcf69('0x6c')](_0x54afbc))['or'](_0xcf69('0x88'),_0x54afbc+'%');}}}_0x52473a[_0xcf69('0x4b')](_0x2d5fb3);_0x52473a[_0xcf69('0x89')](_0xcf69('0x8a'));var _0x4f57f9={'type':db[_0xcf69('0x8b')]['QueryTypes']['SELECT'],'raw':!![]};var _0x96cf1d=_0x52473a[_0xcf69('0x8c')]();_0x96cf1d['field']('i.id');_0x96cf1d['field'](_0xcf69('0x8d'),_0xcf69('0x66'));if(_0x129d73[_0xcf69('0x49')]){_0x129d73[_0xcf69('0x49')][_0xcf69('0x34')](function(_0x19661b){var _0x49d1cc=_0x19661b[0x0]===_0xcf69('0x8e')?_0x19661b[0x0]:'i.'+_0x19661b[0x0];_0x52473a[_0xcf69('0x49')](_0x49d1cc,_0x19661b[0x1]==='DESC'?![]:!![]);});}if(!_[_0xcf69('0x8f')](_0x4907b1)){_0x52473a[_0xcf69('0x80')](_0x4ecf0f);_0x96cf1d[_0xcf69('0x4b')](_0xcf69('0x90'),_0x4907b1);}BPromise[_0xcf69('0x91')]()[_0xcf69('0x2a')](function(){if(!_0x5d0df7){if(_0x8179f8['query'][_0xcf69('0x77')])return;_0x96cf1d[_0xcf69('0x4b')](_0xcf69('0x92'));_0x52473a[_0xcf69('0x4b')]('i.WhatsappAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x8179f8[_0xcf69('0x93')][_0xcf69('0x94')]!==_0xcf69('0x95'))return;return _0x8179f8[_0xcf69('0x93')]['getWhatsappAccounts']({'attributes':['id'],'raw':!![]})[_0xcf69('0x2a')](function(_0x531d0e){if(_[_0xcf69('0x8f')](_0x531d0e)){_0x96cf1d[_0xcf69('0x4b')]('i.WhatsappAccountId\x20IS\x20NULL');_0x52473a['where']('i.WhatsappAccountId\x20IS\x20NULL');}else{_0x96cf1d[_0xcf69('0x4b')](_0xcf69('0x78'),_['map'](_0x531d0e,'id'));_0x52473a[_0xcf69('0x4b')](_0xcf69('0x78'),_[_0xcf69('0x2f')](_0x531d0e,'id'));}});})[_0xcf69('0x2a')](function(){if(_0x8179f8[_0xcf69('0x93')][_0xcf69('0x94')]===_0xcf69('0x95')&&!_0x5d0df7&&!_0x8179f8[_0xcf69('0x42')][_0xcf69('0x77')])return[];return db['sequelize'][_0xcf69('0x42')](_0x96cf1d[_0xcf69('0x96')](),_0x4f57f9);})[_0xcf69('0x2a')](function(_0x538755){_0x4d285f['count']=_0x538755['length'];if(_0x4d285f[_0xcf69('0x22')]===0x0)return[];return db['sequelize']['query'](_0x547d8c[_0xcf69('0x96')](),_0x4f57f9)[_0xcf69('0x2a')](function(_0x3a84fb){_0x43ded1=_[_0xcf69('0x97')](_0x3a84fb,'id');_0x4f57f9=_[_0xcf69('0x98')](_0x4f57f9,{'model':db[_0xcf69('0x3e')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x8179f8[_0xcf69('0x42')]['fields']){_0x129d73[_0xcf69('0x46')][_0xcf69('0x34')](function(_0x29e5fc){_0x52473a[_0xcf69('0x4d')]('i.'+_0x29e5fc);});}else{_0x52473a['field'](_0xcf69('0x8d'),_0xcf69('0x66'));_0x52473a[_0xcf69('0x4d')](_0xcf69('0x99'),_0xcf69('0x9a'));_0x52473a['field']('a.mandatoryDisposition',_0xcf69('0x9b'));_0x52473a[_0xcf69('0x4d')]('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',_0xcf69('0x8e'));_0x52473a[_0xcf69('0x4d')]('i.*');_0x52473a[_0xcf69('0x4d')]('c.firstName',_0xcf69('0x9c'));_0x52473a[_0xcf69('0x4d')](_0xcf69('0x9d'),_0xcf69('0x9e'));_0x52473a[_0xcf69('0x4d')](_0xcf69('0x9f'),_0xcf69('0xa0'));_0x52473a[_0xcf69('0x4d')](_0xcf69('0xa1'),_0xcf69('0xa2'));_0x52473a[_0xcf69('0x4d')]('c.mobile',_0xcf69('0xa3'));_0x52473a[_0xcf69('0x4d')]('c.fax','Contact.fax');_0x52473a[_0xcf69('0x4d')](_0xcf69('0xa4'),_0xcf69('0xa5'));_0x52473a['field']('o.internal',_0xcf69('0xa6'));_0x52473a[_0xcf69('0x4d')](_0xcf69('0xa7'),'TagIds');}if(_0x129d73[_0xcf69('0x21')])_0x52473a[_0xcf69('0x21')](_0x129d73[_0xcf69('0x21')]);if(_0x129d73['offset'])_0x52473a[_0xcf69('0x1f')](_0x129d73[_0xcf69('0x1f')]);return db[_0xcf69('0xa8')][_0xcf69('0x42')](_0x52473a[_0xcf69('0x96')](),_0x4f57f9);})[_0xcf69('0x2a')](function(_0x2d1bbf){if(_0x2d1bbf[_0xcf69('0x65')]>0x0)_0x1cb56d[_0xcf69('0x4b')](_0xcf69('0xa9'),_['map'](_0x2d1bbf,'id'));return db[_0xcf69('0xa8')][_0xcf69('0x42')](_0x1cb56d[_0xcf69('0x96')](),_0x4f57f9)[_0xcf69('0x2a')](function(_0x18db19){var _0x816161=_['groupBy'](_0x18db19,_0xcf69('0xaa'));var _0x333438=[];_0x2d1bbf[_0xcf69('0x34')](function(_0x1c4364){_0x333438[_0xcf69('0x35')](updateWhatsappInteraction(_0x1c4364,_0x43ded1,_0x816161));});return BPromise['all'](_0x333438);});});})[_0xcf69('0x2a')](function(_0x5b3431){_0x4d285f['rows']=_0x5b3431;return _0x4d285f;})[_0xcf69('0x2a')](respondWithFilteredResult(_0x35c5ea,_0x129d73))[_0xcf69('0x36')](handleError(_0x35c5ea,null));};exports[_0xcf69('0xab')]=function(_0x3dc521,_0x37991c){var _0x1d6dd7={'raw':![],'where':{'id':_0x3dc521[_0xcf69('0xac')]['id']}},_0x575c70={};_0x575c70[_0xcf69('0x44')]=_[_0xcf69('0xad')](db['WhatsappInteraction'][_0xcf69('0x3f')]);_0x575c70[_0xcf69('0x42')]=_[_0xcf69('0xad')](_0x3dc521[_0xcf69('0x42')]);_0x575c70[_0xcf69('0x4c')]=_[_0xcf69('0x43')](_0x575c70[_0xcf69('0x44')],_0x575c70['query']);_0x1d6dd7[_0xcf69('0x46')]=_[_0xcf69('0x43')](_0x575c70[_0xcf69('0x44')],qs['fields'](_0x3dc521[_0xcf69('0x42')][_0xcf69('0x45')]));_0x1d6dd7['attributes']=_0x1d6dd7['attributes'][_0xcf69('0x65')]?_0x1d6dd7[_0xcf69('0x46')]:_0x575c70[_0xcf69('0x44')];if(_0x3dc521[_0xcf69('0x42')][_0xcf69('0xae')]){_0x1d6dd7[_0xcf69('0xaf')]=[{'all':!![]}];}_0x1d6dd7=_[_0xcf69('0x98')]({},_0x1d6dd7,_0x3dc521[_0xcf69('0xb0')]);return db[_0xcf69('0x3e')][_0xcf69('0x6e')](_0x1d6dd7)[_0xcf69('0x2a')](handleEntityNotFound(_0x37991c,null))[_0xcf69('0x2a')](respondWithResult(_0x37991c,null))['catch'](handleError(_0x37991c,null));};exports[_0xcf69('0xb1')]=function(_0x3b8aaf,_0x15cddb){return db[_0xcf69('0x3e')][_0xcf69('0xb1')](_0x3b8aaf['body'],{})[_0xcf69('0x2a')](respondWithResult(_0x15cddb,0xc9))[_0xcf69('0x36')](handleError(_0x15cddb,null));};exports[_0xcf69('0x29')]=function(_0x39321a,_0x20de71){if(_0x39321a['body']['id']){delete _0x39321a[_0xcf69('0xb2')]['id'];}return db[_0xcf69('0x3e')][_0xcf69('0x6e')]({'where':{'id':_0x39321a[_0xcf69('0xac')]['id']}})[_0xcf69('0x2a')](handleEntityNotFound(_0x20de71,null))['then'](saveUpdates(_0x39321a['body'],null))['then'](respondWithResult(_0x20de71,null))[_0xcf69('0x36')](handleError(_0x20de71,null));};exports[_0xcf69('0x2b')]=function(_0x26455b,_0x46d90a){return db[_0xcf69('0x3e')]['find']({'where':{'id':_0x26455b[_0xcf69('0xac')]['id']}})[_0xcf69('0x2a')](handleEntityNotFound(_0x46d90a,null))['then'](removeEntity(_0x46d90a,null))['catch'](handleError(_0x46d90a,null));};exports[_0xcf69('0xb3')]=function(_0x2ca5e9,_0x2d929b){return db[_0xcf69('0x3e')]['describe']()['then'](respondWithResult(_0x2d929b,null))[_0xcf69('0x36')](handleError(_0x2d929b,null));};exports[_0xcf69('0xb4')]=function(_0x2bd6fd,_0xf36300,_0x33548e){return db['WhatsappMessage'][_0xcf69('0x6e')]({'where':{'id':_0x2bd6fd[_0xcf69('0xac')]['id']}})[_0xcf69('0x2a')](handleEntityNotFound(_0xf36300,null))[_0xcf69('0x2a')](function(_0x46e43a){if(_0x46e43a){return _0x46e43a[_0xcf69('0xb4')](_0x2bd6fd[_0xcf69('0xb2')][_0xcf69('0xb5')],_[_0xcf69('0xb6')](_0x2bd6fd[_0xcf69('0xb2')],[_0xcf69('0xb5'),'id'])||{});}})['then'](respondWithResult(_0xf36300,null))[_0xcf69('0x36')](handleError(_0xf36300,null));};exports[_0xcf69('0xb7')]=function(_0x4ad8f2,_0x2fb36f,_0xe78908){var _0x4edf0f={'raw':![],'where':{}};var _0x66f58={};var _0x12acde={'count':0x0,'rows':[]};return db[_0xcf69('0x3e')][_0xcf69('0xb8')]({'where':{'id':_0x4ad8f2['params']['id']}})[_0xcf69('0x2a')](handleEntityNotFound(_0x2fb36f,null))[_0xcf69('0x2a')](function(_0x198ac5){if(_0x198ac5){_0x66f58[_0xcf69('0x44')]=_['keys'](db[_0xcf69('0xb9')][_0xcf69('0x3f')]);_0x66f58['query']=_[_0xcf69('0xad')](_0x4ad8f2[_0xcf69('0x42')]);_0x66f58[_0xcf69('0x4c')]=_['intersection'](_0x66f58[_0xcf69('0x44')],_0x66f58[_0xcf69('0x42')]);_0x4edf0f[_0xcf69('0x46')]=_[_0xcf69('0x43')](_0x66f58[_0xcf69('0x44')],qs['fields'](_0x4ad8f2[_0xcf69('0x42')]['fields']));_0x4edf0f[_0xcf69('0x46')]=_0x4edf0f[_0xcf69('0x46')][_0xcf69('0x65')]?_0x4edf0f[_0xcf69('0x46')]:_0x66f58['model'];if(!_0x4ad8f2[_0xcf69('0x42')][_0xcf69('0x47')](_0xcf69('0x48'))){_0x4edf0f[_0xcf69('0x21')]=qs[_0xcf69('0x21')](_0x4ad8f2['query']['limit']);_0x4edf0f[_0xcf69('0x1f')]=qs[_0xcf69('0x1f')](_0x4ad8f2[_0xcf69('0x42')][_0xcf69('0x1f')]);}_0x4edf0f[_0xcf69('0x49')]=qs[_0xcf69('0x4a')](_0x4ad8f2[_0xcf69('0x42')][_0xcf69('0x4a')]);_0x4edf0f['where']=qs['filters'](_[_0xcf69('0xba')](_0x4ad8f2['query'],_0x66f58[_0xcf69('0x4c')]));_0x4edf0f[_0xcf69('0x4b')]['WhatsappInteractionId']=_0x198ac5['id'];if(_0x4ad8f2[_0xcf69('0x42')][_0xcf69('0x83')]){_0x4edf0f[_0xcf69('0x4b')]=_[_0xcf69('0x98')](_0x4edf0f['where'],{'$or':_[_0xcf69('0x2f')](_0x4edf0f[_0xcf69('0x46')],function(_0x2341fd){var _0x5966e0={};_0x5966e0[_0x2341fd]={'$like':'%'+_0x4ad8f2[_0xcf69('0x42')][_0xcf69('0x83')]+'%'};return _0x5966e0;})});}if(_0x4ad8f2[_0xcf69('0x42')]['$gte']){var _0x1ebc7f=_0x4ad8f2[_0xcf69('0x42')][_0xcf69('0xbb')]['split'](',');var _0x2c623d={};_0x2c623d[_0x1ebc7f[0x0]]={'$gte':moment(_0x1ebc7f[0x1])['format'](_0xcf69('0xbc'))};_0x4edf0f[_0xcf69('0x4b')]=_[_0xcf69('0x98')](_0x4edf0f[_0xcf69('0x4b')],_0x2c623d);}_0x4edf0f=_[_0xcf69('0x98')]({},_0x4edf0f,_0x4ad8f2['options']);return db['WhatsappMessage'][_0xcf69('0x22')]({'where':_0x4edf0f[_0xcf69('0x4b')]})[_0xcf69('0x2a')](function(_0x2afeb0){_0x12acde['count']=_0x2afeb0;if(_0x4ad8f2[_0xcf69('0x42')][_0xcf69('0xae')]){_0x4edf0f['include']=[{'all':!![]}];}return db['WhatsappMessage']['findAll'](_0x4edf0f);})['then'](function(_0x42affe){_0x12acde[_0xcf69('0xbd')]=_0x42affe;return _0x12acde;});}})['then'](respondWithFilteredResult(_0x2fb36f,_0x4edf0f))[_0xcf69('0x36')](handleError(_0x2fb36f,null));};exports['addTags']=function(_0x1df08f,_0x3fd78c,_0x14c3ad){return db['WhatsappInteraction']['find']({'where':{'id':_0x1df08f[_0xcf69('0xac')]['id']}})[_0xcf69('0x2a')](handleEntityNotFound(_0x3fd78c,null))[_0xcf69('0x2a')](function(_0x58c992){if(_0x58c992){return _0x58c992[_0xcf69('0xbe')](_0x1df08f[_0xcf69('0xb2')]['ids'],_[_0xcf69('0xb6')](_0x1df08f[_0xcf69('0xb2')],['ids','id'])||{})[_0xcf69('0xbf')](function(){return db['Tag'][_0xcf69('0xc0')]({'attributes':['id',_0xcf69('0x2d'),_0xcf69('0xc1')],'where':{'id':_0x1df08f[_0xcf69('0xb2')][_0xcf69('0xb5')]}});})[_0xcf69('0x2a')](function(_0x4d684d){socket[_0xcf69('0xc2')](_0xcf69('0xc3'),{'id':Number(_0x1df08f[_0xcf69('0xac')]['id']),'tags':_0x4d684d||[]});return{'id':Number(_0x1df08f[_0xcf69('0xac')]['id']),'tags':_0x4d684d||[]};});}})['then'](respondWithResult(_0x3fd78c,null))['catch'](handleError(_0x3fd78c,null));};exports[_0xcf69('0xc4')]=function(_0x2785d4,_0x530a9a,_0x421440){return db['WhatsappInteraction'][_0xcf69('0x6e')]({'where':{'id':_0x2785d4[_0xcf69('0xac')]['id']}})['then'](handleEntityNotFound(_0x530a9a,null))[_0xcf69('0x2a')](function(_0x4d7776){if(_0x4d7776){return _0x4d7776[_0xcf69('0xc4')](_0x2785d4['query'][_0xcf69('0xb5')]);}})[_0xcf69('0x2a')](respondWithStatusCode(_0x530a9a,null))[_0xcf69('0x36')](handleError(_0x530a9a,null));};exports[_0xcf69('0xc5')]=function(_0x14ba92,_0x511e49){var _0x5842d4=moment()[_0xcf69('0xc6')]()[_0xcf69('0x96')]();var _0x112c26=path['join'](config[_0xcf69('0xc7')],_0xcf69('0xc8'),_0xcf69('0xc9'),_0xcf69('0xca'));var _0x2c184e=path[_0xcf69('0xcb')](config['root'],_0xcf69('0xc8'),_0xcf69('0xc9'),'attachments');var _0x9e31ac=path[_0xcf69('0xcb')](_0x112c26,_0x5842d4);var _0x42cdf4=util[_0xcf69('0xcc')]('transcript-%d-%s.zip',_0x14ba92[_0xcf69('0xac')]['id'],_0x5842d4);var _0x2a4499=path[_0xcf69('0xcb')](_0x112c26,_0x42cdf4);var _0x32f86c=[];_0x32f86c['push']({'model':db['User'],'as':_0xcf69('0x73'),'attributes':['id',_0xcf69('0x30')],'raw':!![]});_0x32f86c[_0xcf69('0x35')]({'model':db['CmContact'],'as':_0xcf69('0x68'),'attributes':['id',_0xcf69('0xcd'),_0xcf69('0xce')],'raw':!![]});if(_0x14ba92[_0xcf69('0x42')][_0xcf69('0xcf')]){_0x32f86c[_0xcf69('0x35')]({'model':db[_0xcf69('0xd0')],'as':_0xcf69('0xd0'),'raw':!![]});}var _0x4ea0d9=[{'model':db['WhatsappMessage'],'as':'Messages','attributes':['id',_0xcf69('0xb2'),_0xcf69('0x7a'),_0xcf69('0xd1'),_0xcf69('0xd2'),_0xcf69('0x7e')],'include':_0x32f86c}];_0x4ea0d9['push']({'model':db[_0xcf69('0xd3')],'as':_0xcf69('0xd4'),'attributes':['id',_0xcf69('0x2d')]});_0x4ea0d9['push']({'model':db[_0xcf69('0x73')],'as':_0xcf69('0xd5'),'attributes':['id',_0xcf69('0x30')]});return db[_0xcf69('0x3e')][_0xcf69('0x6e')]({'where':{'id':_0x14ba92[_0xcf69('0xac')]['id']},'include':_0x4ea0d9})[_0xcf69('0x2a')](handleEntityNotFound(_0x511e49,null))[_0xcf69('0x2a')](function(_0x2532b3){if(_0x2532b3){var _0x1ae3d8=_0x2532b3[_0xcf69('0xd6')]({'plain':!![]});fs[_0xcf69('0xd7')](_0x9e31ac);var _0x34b401={'channel':_0xcf69('0xd8'),'account':_0x1ae3d8[_0xcf69('0xd4')]['name'],'agent':_0x1ae3d8[_0xcf69('0xd5')]?_0x1ae3d8[_0xcf69('0xd5')]['fullname']:_0xcf69('0xd9'),'createdAt':moment(_0x1ae3d8[_0xcf69('0x7a')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0xcf69('0x96')](),'closedAt':_0x1ae3d8[_0xcf69('0x3a')]?moment(_0x1ae3d8['closedAt'])[_0xcf69('0xcc')](_0xcf69('0xbc'))['toString']():'','disposition':_0x1ae3d8['disposition'],'messages':_(_0x1ae3d8[_0xcf69('0xda')])['filter']({'secret':![]})[_0xcf69('0x2f')](function(_0x2556f4){if(_0x2556f4[_0xcf69('0xd0')]){var _0xdaaba2=path[_0xcf69('0xcb')](_0x2c184e,_0x2556f4['Attachment'][_0xcf69('0xdb')]);if(fs['existsSync'](_0xdaaba2)){fs[_0xcf69('0xdc')](_0xdaaba2)[_0xcf69('0xdd')](fs['createWriteStream'](path[_0xcf69('0xcb')](_0x9e31ac,_0x2556f4[_0xcf69('0xd0')]['basename'])));}}return{'date':moment(_0x2556f4['createdAt'])[_0xcf69('0xcc')](_0xcf69('0xbc'))['toString'](),'sender':_0x2556f4[_0xcf69('0xd1')]===_0xcf69('0xde')?_0x2556f4[_0xcf69('0x73')]?_0x2556f4[_0xcf69('0x73')][_0xcf69('0x30')]:_0xcf69('0xdf'):_0x2556f4['Contact'][_0xcf69('0xcd')]+(_0x2556f4[_0xcf69('0x68')]['lastName']?'\x20'+_0x2556f4[_0xcf69('0x68')]['lastName']:''),'body':_0x2556f4[_0xcf69('0xd0')]?_0x2556f4[_0xcf69('0xd0')]['basename']:_0x2556f4[_0xcf69('0xb2')],'direction':_0x2556f4[_0xcf69('0xd1')]===_0xcf69('0xde')?'A':'C','secret':_0x2556f4[_0xcf69('0xd2')],'read':_0x2556f4[_0xcf69('0x7e')],'attachment':_0x2556f4[_0xcf69('0xd0')]};})[_0xcf69('0x6a')]()};return ejs[_0xcf69('0xe0')](path[_0xcf69('0xcb')](config[_0xcf69('0xc7')],_0xcf69('0xc8'),_0xcf69('0xe1'),'downloadInteraction.ejs'),{'interaction':_0x34b401})[_0xcf69('0x2a')](function(_0x1f7835){var _0x56ae3e=path['join'](_0x9e31ac,_0xcf69('0xe2')+_0x1ae3d8['id']+'-'+_0x5842d4+'.pdf');var _0x50af07={'path':_0x56ae3e,'channel':_0xcf69('0xd8'),'interactionId':_0x1ae3d8['id']};return pdf[_0xcf69('0xe3')](_0x1f7835,_0x50af07);})['then'](function(){return new BPromise(function(_0x32f766,_0x23d7f6){zipdir(_0x9e31ac,{'saveTo':_0x2a4499},function(_0x216e27,_0x41ca91){if(_0x216e27)return _0x23d7f6(_0x216e27);return _0x32f766(_0x41ca91);});})[_0xcf69('0x2a')](function(){return new BPromise(function(_0x412f67,_0xe07a85){rimraf(_0x9e31ac,function(_0x17990a){if(_0x17990a)_0xe07a85(_0x17990a);return _0x412f67();});});})[_0xcf69('0x2a')](function(){return _0x511e49[_0xcf69('0xc5')](_0x2a4499,_0x42cdf4,function(_0x4068e7){if(_0x4068e7){console[_0xcf69('0xe4')](_0xcf69('0xe5'),_0x4068e7);}else{fs[_0xcf69('0xe6')](_0x2a4499);}});});});}else{return _0x511e49[_0xcf69('0x1c')](0xc8);}})[_0xcf69('0x36')](handleError(_0x511e49,null));};
\ No newline at end of file
index af457c9..fb168c2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbf3f=['unreadMessages','emit','hasOwnProperty','hook','exports','events','save','update','remove','getUsers','then','setDataValue','map','findAll'];(function(_0x33be9d,_0x41618e){var _0x4a9267=function(_0x4f0e70){while(--_0x4f0e70){_0x33be9d['push'](_0x33be9d['shift']());}};_0x4a9267(++_0x41618e);}(_0xbf3f,0x10f));var _0xfbf3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbf3f[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0xfbf3('0x0'));var WhatsappInteraction=require('../../mysqldb')['db']['WhatsappInteraction'];var WhatsappMessage=require('../../mysqldb')['db']['WhatsappMessage'];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xfbf3('0x1'),'afterUpdate':_0xfbf3('0x2'),'afterDestroy':_0xfbf3('0x3')};function emitEvent(_0x5bc16d){return function(_0x4265e8,_0x14500f,_0x117730){_0x4265e8[_0xfbf3('0x4')]({'attributes':['id'],'raw':!![]})[_0xfbf3('0x5')](function(_0x154f23){_0x4265e8[_0xfbf3('0x6')]('Users',_0x154f23[_0xfbf3('0x7')](function(_0x274b37){return{'id':_0x274b37['id']};}));return WhatsappMessage[_0xfbf3('0x8')]({'where':{'WhatsappInteractionId':_0x4265e8['id'],'direction':'in','read':![]},'raw':!![]});})[_0xfbf3('0x5')](function(_0x2e0d86){_0x4265e8[_0xfbf3('0x6')](_0xfbf3('0x9'),_0x2e0d86['length']);WhatsappInteractionEvents[_0xfbf3('0xa')](_0x5bc16d+':'+_0x4265e8['id'],_0x4265e8);WhatsappInteractionEvents[_0xfbf3('0xa')](_0x5bc16d,_0x4265e8);_0x117730(null);})['catch'](_0x117730(null));};}for(var e in events){if(events[_0xfbf3('0xb')](e)){var event=events[e];WhatsappInteraction[_0xfbf3('0xc')](e,emitEvent(event));}}module[_0xfbf3('0xd')]=WhatsappInteractionEvents;
\ No newline at end of file
+var _0x01d3=['WhatsappMessage','save','update','remove','getUsers','then','setDataValue','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','exports','WhatsappInteraction','../../mysqldb'];(function(_0x513510,_0x554bae){var _0x32a434=function(_0xf207e){while(--_0xf207e){_0x513510['push'](_0x513510['shift']());}};_0x32a434(++_0x554bae);}(_0x01d3,0xdb));var _0x301d=function(_0x562ed4,_0x4320d3){_0x562ed4=_0x562ed4-0x0;var _0x4890de=_0x01d3[_0x562ed4];return _0x4890de;};'use strict';var EventEmitter=require('events');var WhatsappInteraction=require('../../mysqldb')['db'][_0x301d('0x0')];var WhatsappMessage=require(_0x301d('0x1'))['db'][_0x301d('0x2')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x301d('0x3'),'afterUpdate':_0x301d('0x4'),'afterDestroy':_0x301d('0x5')};function emitEvent(_0x11ba0e){return function(_0x13cd36,_0x4f3b25,_0x44f428){_0x13cd36[_0x301d('0x6')]({'attributes':['id'],'raw':!![]})[_0x301d('0x7')](function(_0x30e89e){_0x13cd36[_0x301d('0x8')]('Users',_0x30e89e[_0x301d('0x9')](function(_0x1d8e83){return{'id':_0x1d8e83['id']};}));return WhatsappMessage[_0x301d('0xa')]({'where':{'WhatsappInteractionId':_0x13cd36['id'],'direction':'in','read':![]},'raw':!![]});})[_0x301d('0x7')](function(_0xc54235){_0x13cd36[_0x301d('0x8')](_0x301d('0xb'),_0xc54235[_0x301d('0xc')]);WhatsappInteractionEvents[_0x301d('0xd')](_0x11ba0e+':'+_0x13cd36['id'],_0x13cd36);WhatsappInteractionEvents['emit'](_0x11ba0e,_0x13cd36);_0x44f428(null);})[_0x301d('0xe')](_0x44f428(null));};}for(var e in events){if(events[_0x301d('0xf')](e)){var event=events[e];WhatsappInteraction['hook'](e,emitEvent(event));}}module[_0x301d('0x10')]=WhatsappInteractionEvents;
\ No newline at end of file
index 217d85d..3485007 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc82e=['lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./whatsappInteraction.attributes','exports','define','whatsapp_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x54defc,_0x627178){var _0x1955d3=function(_0x299afe){while(--_0x299afe){_0x54defc['push'](_0x54defc['shift']());}};_0x1955d3(++_0x627178);}(_0xc82e,0x1dc));var _0xec82=function(_0x23bf2c,_0x152382){_0x23bf2c=_0x23bf2c-0x0;var _0x540e58=_0xc82e[_0x23bf2c];return _0x540e58;};'use strict';var _=require(_0xec82('0x0'));var util=require(_0xec82('0x1'));var logger=require(_0xec82('0x2'))(_0xec82('0x3'));var moment=require('moment');var BPromise=require(_0xec82('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xec82('0x5'));var rimraf=require(_0xec82('0x6'));var config=require(_0xec82('0x7'));var attributes=require(_0xec82('0x8'));module[_0xec82('0x9')]=function(_0x134e52,_0x49801a){return _0x134e52[_0xec82('0xa')]('WhatsappInteraction',attributes,{'tableName':_0xec82('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x612132,_0x2ef39b,_0x7df72e){if(_0x612132[_0xec82('0xc')](_0xec82('0xd'))){_0x612132[_0xec82('0xe')]=moment()[_0xec82('0xf')](_0xec82('0x10'));}_0x7df72e(null,_0x612132);}}});};
\ No newline at end of file
+var _0x8293=['./whatsappInteraction.attributes','exports','define','WhatsappInteraction','whatsapp_interactions','changed','closed','closedAt','format','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x12ed1d,_0x1fc9f3){var _0x23c8f7=function(_0x23c69f){while(--_0x23c69f){_0x12ed1d['push'](_0x12ed1d['shift']());}};_0x23c8f7(++_0x1fc9f3);}(_0x8293,0xb9));var _0x3829=function(_0x14ad31,_0x207db1){_0x14ad31=_0x14ad31-0x0;var _0x302540=_0x8293[_0x14ad31];return _0x302540;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x3829('0x0'));var moment=require(_0x3829('0x1'));var BPromise=require(_0x3829('0x2'));var rp=require(_0x3829('0x3'));var fs=require('fs');var path=require(_0x3829('0x4'));var rimraf=require(_0x3829('0x5'));var config=require(_0x3829('0x6'));var attributes=require(_0x3829('0x7'));module[_0x3829('0x8')]=function(_0x4ca9a2,_0x506872){return _0x4ca9a2[_0x3829('0x9')](_0x3829('0xa'),attributes,{'tableName':_0x3829('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x383578,_0x5d8943,_0x5ebea6){if(_0x383578[_0x3829('0xc')](_0x3829('0xd'))){_0x383578[_0x3829('0xe')]=moment()[_0x3829('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}_0x5ebea6(null,_0x383578);}}});};
\ No newline at end of file
index b860de7..1668dcc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdd69=['addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','redis','localhost','socket.io-emitter','./whatsappInteraction.socket','register','request','then','info','WhatsappInteraction,\x20%s,\x20%s','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','UpdateWhatsappInteraction','WhatsappInteraction','update','body','options','raw','where','attributes','stringify','catch','AddTagsToWhatsappInteraction'];(function(_0x23309f,_0x416c03){var _0x1afb42=function(_0x5d15ee){while(--_0x5d15ee){_0x23309f['push'](_0x23309f['shift']());}};_0x1afb42(++_0x416c03);}(_0xdd69,0x188));var _0x9dd6=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xdd69[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x9dd6('0x0'));var util=require(_0x9dd6('0x1'));var moment=require(_0x9dd6('0x2'));var BPromise=require(_0x9dd6('0x3'));var rs=require(_0x9dd6('0x4'));var fs=require('fs');var Redis=require(_0x9dd6('0x5'));var db=require(_0x9dd6('0x6'))['db'];var utils=require(_0x9dd6('0x7'));var logger=require('../../config/logger')(_0x9dd6('0x8'));var config=require(_0x9dd6('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x9dd6('0xa')]['http']({'port':0x232a});config[_0x9dd6('0xb')]=_['defaults'](config[_0x9dd6('0xb')],{'host':_0x9dd6('0xc'),'port':0x18eb});var socket=require(_0x9dd6('0xd'))(new Redis(config['redis']));require(_0x9dd6('0xe'))[_0x9dd6('0xf')](socket);function respondWithRpcPromise(_0x2d08da,_0x56920f,_0x5d896a){return new BPromise(function(_0x53853c,_0xacd5d){return client[_0x9dd6('0x10')](_0x2d08da,_0x5d896a)[_0x9dd6('0x11')](function(_0x3ad5c3){logger[_0x9dd6('0x12')](_0x9dd6('0x13'),_0x56920f,'request\x20sent');logger[_0x9dd6('0x14')](_0x9dd6('0x15'),_0x56920f,'request\x20sent',JSON['stringify'](_0x3ad5c3));if(_0x3ad5c3[_0x9dd6('0x16')]){if(_0x3ad5c3['error'][_0x9dd6('0x17')]===0x1f4){logger[_0x9dd6('0x16')](_0x9dd6('0x13'),_0x56920f,_0x3ad5c3[_0x9dd6('0x16')][_0x9dd6('0x18')]);return _0xacd5d(_0x3ad5c3[_0x9dd6('0x16')]['message']);}logger[_0x9dd6('0x16')](_0x9dd6('0x13'),_0x56920f,_0x3ad5c3[_0x9dd6('0x16')][_0x9dd6('0x18')]);return _0x53853c(_0x3ad5c3[_0x9dd6('0x16')][_0x9dd6('0x18')]);}else{logger[_0x9dd6('0x12')](_0x9dd6('0x13'),_0x56920f,_0x9dd6('0x19'));_0x53853c(_0x3ad5c3[_0x9dd6('0x1a')]['message']);}})['catch'](function(_0x504771){logger['error'](_0x9dd6('0x13'),_0x56920f,_0x504771);_0xacd5d(_0x504771);});});}exports[_0x9dd6('0x1b')]=function(_0x17392d){var _0x3e20c0=this;return new Promise(function(_0x246830,_0x1dcf66){return db[_0x9dd6('0x1c')][_0x9dd6('0x1d')](_0x17392d[_0x9dd6('0x1e')],{'raw':_0x17392d[_0x9dd6('0x1f')]?_0x17392d[_0x9dd6('0x1f')][_0x9dd6('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x17392d[_0x9dd6('0x1f')]?_0x17392d['options'][_0x9dd6('0x21')]||null:null,'attributes':_0x17392d['options']?_0x17392d[_0x9dd6('0x1f')][_0x9dd6('0x22')]||null:null,'limit':_0x17392d['options']?_0x17392d[_0x9dd6('0x1f')]['limit']||null:null})[_0x9dd6('0x11')](function(_0x2307bd){logger[_0x9dd6('0x12')](_0x9dd6('0x1b'),_0x17392d);logger[_0x9dd6('0x14')]('UpdateWhatsappInteraction',_0x17392d,JSON[_0x9dd6('0x23')](_0x2307bd));_0x246830(_0x2307bd);})[_0x9dd6('0x24')](function(_0x2aa185){logger[_0x9dd6('0x16')](_0x9dd6('0x1b'),_0x2aa185[_0x9dd6('0x18')],_0x17392d);_0x1dcf66(_0x3e20c0[_0x9dd6('0x16')](0x1f4,_0x2aa185['message']));});});};exports[_0x9dd6('0x25')]=function(_0x268747){return new Promise(function(_0x3c506d,_0xc797f3){return db[_0x9dd6('0x1c')]['find']({'where':_0x268747[_0x9dd6('0x1f')]?_0x268747[_0x9dd6('0x1f')][_0x9dd6('0x21')]||null:null})['then'](function(_0x5db7c9){if(_0x5db7c9){return _0x5db7c9[_0x9dd6('0x26')](_0x268747['body'][_0x9dd6('0x27')],_[_0x9dd6('0x28')](_0x268747[_0x9dd6('0x1e')],[_0x9dd6('0x27'),'id'])||{});}})[_0x9dd6('0x29')](function(_0x9c6e87){logger[_0x9dd6('0x12')](_0x9dd6('0x2a'),_0x268747);logger[_0x9dd6('0x14')](_0x9dd6('0x2a'),_0x268747,JSON[_0x9dd6('0x23')](_0x9c6e87));_0x3c506d(_0x9c6e87);})['catch'](function(_0x2cc716){logger[_0x9dd6('0x16')]('AddTags',_0x2cc716[_0x9dd6('0x18')],_0x268747);_0xc797f3(_this[_0x9dd6('0x16')](0x1f4,_0x2cc716[_0x9dd6('0x18')]));});});};
\ No newline at end of file
+var _0x4d82=['catch','UpdateWhatsappInteraction','update','body','options','raw','where','attributes','AddTagsToWhatsappInteraction','WhatsappInteraction','find','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','http','defaults','redis','register','request','then','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result'];(function(_0x2c24b8,_0x168e0b){var _0x563ed6=function(_0x7c1aa9){while(--_0x7c1aa9){_0x2c24b8['push'](_0x2c24b8['shift']());}};_0x563ed6(++_0x168e0b);}(_0x4d82,0x158));var _0x24d8=function(_0xef2a14,_0x4c359a){_0xef2a14=_0xef2a14-0x0;var _0x242a4d=_0x4d82[_0xef2a14];return _0x242a4d;};'use strict';var _=require(_0x24d8('0x0'));var util=require(_0x24d8('0x1'));var moment=require(_0x24d8('0x2'));var BPromise=require(_0x24d8('0x3'));var rs=require(_0x24d8('0x4'));var fs=require('fs');var Redis=require(_0x24d8('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x24d8('0x6'));var logger=require('../../config/logger')(_0x24d8('0x7'));var config=require(_0x24d8('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x24d8('0x9')][_0x24d8('0xa')]({'port':0x232a});config['redis']=_[_0x24d8('0xb')](config[_0x24d8('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x24d8('0xc')]));require('./whatsappInteraction.socket')[_0x24d8('0xd')](socket);function respondWithRpcPromise(_0xcd335e,_0x36f832,_0x459757){return new BPromise(function(_0x51e3d1,_0x69c0fc){return client[_0x24d8('0xe')](_0xcd335e,_0x459757)[_0x24d8('0xf')](function(_0x2a313d){logger[_0x24d8('0x10')](_0x24d8('0x11'),_0x36f832,_0x24d8('0x12'));logger[_0x24d8('0x13')]('WhatsappInteraction,\x20%s,\x20%s,\x20%s',_0x36f832,'request\x20sent',JSON[_0x24d8('0x14')](_0x2a313d));if(_0x2a313d[_0x24d8('0x15')]){if(_0x2a313d[_0x24d8('0x15')][_0x24d8('0x16')]===0x1f4){logger[_0x24d8('0x15')]('WhatsappInteraction,\x20%s,\x20%s',_0x36f832,_0x2a313d[_0x24d8('0x15')]['message']);return _0x69c0fc(_0x2a313d[_0x24d8('0x15')][_0x24d8('0x17')]);}logger[_0x24d8('0x15')](_0x24d8('0x11'),_0x36f832,_0x2a313d[_0x24d8('0x15')][_0x24d8('0x17')]);return _0x51e3d1(_0x2a313d[_0x24d8('0x15')][_0x24d8('0x17')]);}else{logger[_0x24d8('0x10')](_0x24d8('0x11'),_0x36f832,_0x24d8('0x12'));_0x51e3d1(_0x2a313d[_0x24d8('0x18')][_0x24d8('0x17')]);}})[_0x24d8('0x19')](function(_0xa52449){logger[_0x24d8('0x15')](_0x24d8('0x11'),_0x36f832,_0xa52449);_0x69c0fc(_0xa52449);});});}exports[_0x24d8('0x1a')]=function(_0x47a663){var _0x5e79ea=this;return new Promise(function(_0x2cc751,_0x4d0c3d){return db['WhatsappInteraction'][_0x24d8('0x1b')](_0x47a663[_0x24d8('0x1c')],{'raw':_0x47a663[_0x24d8('0x1d')]?_0x47a663[_0x24d8('0x1d')][_0x24d8('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x47a663[_0x24d8('0x1d')]?_0x47a663['options'][_0x24d8('0x1f')]||null:null,'attributes':_0x47a663[_0x24d8('0x1d')]?_0x47a663[_0x24d8('0x1d')][_0x24d8('0x20')]||null:null,'limit':_0x47a663['options']?_0x47a663['options']['limit']||null:null})['then'](function(_0x583894){logger['info'](_0x24d8('0x1a'),_0x47a663);logger['debug'](_0x24d8('0x1a'),_0x47a663,JSON['stringify'](_0x583894));_0x2cc751(_0x583894);})[_0x24d8('0x19')](function(_0x4ca52c){logger['error']('UpdateWhatsappInteraction',_0x4ca52c['message'],_0x47a663);_0x4d0c3d(_0x5e79ea[_0x24d8('0x15')](0x1f4,_0x4ca52c[_0x24d8('0x17')]));});});};exports[_0x24d8('0x21')]=function(_0x1e55d7){return new Promise(function(_0x11a352,_0xb45b74){return db[_0x24d8('0x22')][_0x24d8('0x23')]({'where':_0x1e55d7['options']?_0x1e55d7[_0x24d8('0x1d')][_0x24d8('0x1f')]||null:null})[_0x24d8('0xf')](function(_0x2b7119){if(_0x2b7119){return _0x2b7119[_0x24d8('0x24')](_0x1e55d7[_0x24d8('0x1c')][_0x24d8('0x25')],_[_0x24d8('0x26')](_0x1e55d7['body'],[_0x24d8('0x25'),'id'])||{});}})[_0x24d8('0x27')](function(_0x39f6b6){logger['info'](_0x24d8('0x28'),_0x1e55d7);logger[_0x24d8('0x13')]('AddTags',_0x1e55d7,JSON['stringify'](_0x39f6b6));_0x11a352(_0x39f6b6);})[_0x24d8('0x19')](function(_0x2424e9){logger[_0x24d8('0x15')](_0x24d8('0x28'),_0x2424e9[_0x24d8('0x17')],_0x1e55d7);_0xb45b74(_this[_0x24d8('0x15')](0x1f4,_0x2424e9['message']));});});};
\ No newline at end of file
index bc3c8c6..cc95d24 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdffe=['register','length','whatsappInteraction:','./whatsappInteraction.events','save','remove','emit'];(function(_0x2e4aa2,_0x11956a){var _0x5e6092=function(_0x4c12c2){while(--_0x4c12c2){_0x2e4aa2['push'](_0x2e4aa2['shift']());}};_0x5e6092(++_0x11956a);}(_0xdffe,0x1ae));var _0xedff=function(_0x796ed7,_0x2543a7){_0x796ed7=_0x796ed7-0x0;var _0x4e29b5=_0xdffe[_0x796ed7];return _0x4e29b5;};'use strict';var WhatsappInteractionEvents=require(_0xedff('0x0'));var events=[_0xedff('0x1'),_0xedff('0x2'),'update'];function createListener(_0x372d05,_0x1cae8b){return function(_0x151f51){_0x1cae8b[_0xedff('0x3')](_0x372d05,_0x151f51);};}function removeListener(_0x4ec0d0,_0x5cd84c){return function(){WhatsappInteractionEvents['removeListener'](_0x4ec0d0,_0x5cd84c);};}exports[_0xedff('0x4')]=function(_0x3572d3){for(var _0x21dc28=0x0,_0x19f46e=events[_0xedff('0x5')];_0x21dc28<_0x19f46e;_0x21dc28++){var _0x174558=events[_0x21dc28];var _0x4d24e4=createListener(_0xedff('0x6')+_0x174558,_0x3572d3);WhatsappInteractionEvents['on'](_0x174558,_0x4d24e4);}};
\ No newline at end of file
+var _0x747d=['save','remove','update','removeListener','whatsappInteraction:'];(function(_0x42fabe,_0xa440d0){var _0x38035a=function(_0x1d1091){while(--_0x1d1091){_0x42fabe['push'](_0x42fabe['shift']());}};_0x38035a(++_0xa440d0);}(_0x747d,0x1ef));var _0xd747=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x747d[_0x3dd15e];return _0x231fd0;};'use strict';var WhatsappInteractionEvents=require('./whatsappInteraction.events');var events=[_0xd747('0x0'),_0xd747('0x1'),_0xd747('0x2')];function createListener(_0x3baaee,_0x58086b){return function(_0x4f8628){_0x58086b['emit'](_0x3baaee,_0x4f8628);};}function removeListener(_0x40ef61,_0xa6406d){return function(){WhatsappInteractionEvents[_0xd747('0x3')](_0x40ef61,_0xa6406d);};}exports['register']=function(_0x58370a){for(var _0x5bf45b=0x0,_0x21e823=events['length'];_0x5bf45b<_0x21e823;_0x5bf45b++){var _0x243bdc=events[_0x5bf45b];var _0x4b58a0=createListener(_0xd747('0x4')+_0x243bdc,_0x58370a);WhatsappInteractionEvents['on'](_0x243bdc,_0x4b58a0);}};
\ No newline at end of file
index 24d3144..6633424 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xde5e=['/describe','describe','/:id','show','post','tracked','whatsapp','whatsappmessage:create','status','put','/:id/accept','accept','delete','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','index','get'];(function(_0x2e5c04,_0x514268){var _0x42f681=function(_0x24e8ac){while(--_0x24e8ac){_0x2e5c04['push'](_0x2e5c04['shift']());}};_0x42f681(++_0x514268);}(_0xde5e,0x122));var _0xede5=function(_0xe5f787,_0x49bf9f){_0xe5f787=_0xe5f787-0x0;var _0x3077f3=_0xde5e[_0xe5f787];return _0x3077f3;};'use strict';var multer=require(_0xede5('0x0'));var util=require('util');var path=require(_0xede5('0x1'));var timeout=require(_0xede5('0x2'));var express=require(_0xede5('0x3'));var router=express['Router']();var fs_extra=require(_0xede5('0x4'));var auth=require(_0xede5('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xede5('0x6'));var controller=require('./whatsappMessage.controller');router['get']('/',auth[_0xede5('0x7')](),controller[_0xede5('0x8')]);router[_0xede5('0x9')](_0xede5('0xa'),auth[_0xede5('0x7')](),controller[_0xede5('0xb')]);router[_0xede5('0x9')](_0xede5('0xc'),auth[_0xede5('0x7')](),controller[_0xede5('0xd')]);router[_0xede5('0xe')]('/',auth[_0xede5('0x7')](),interaction[_0xede5('0xf')](_0xede5('0x10'),_0xede5('0x11')),controller['create']);router['post']('/:id/status',controller[_0xede5('0x12')]);router[_0xede5('0x13')](_0xede5('0xc'),auth[_0xede5('0x7')](),controller['update']);router['put'](_0xede5('0x14'),auth[_0xede5('0x7')](),controller[_0xede5('0x15')]);router['put']('/:id/reject',auth[_0xede5('0x7')](),controller['reject']);router[_0xede5('0x16')](_0xede5('0xc'),auth[_0xede5('0x7')](),controller[_0xede5('0x17')]);module[_0xede5('0x18')]=router;
\ No newline at end of file
+var _0x3f8d=['tracked','whatsapp','whatsappmessage:create','/:id/status','status','put','/:id/accept','/:id/reject','reject','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./whatsappMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post'];(function(_0xd3842a,_0x56fefa){var _0x28f30b=function(_0x2aac75){while(--_0x2aac75){_0xd3842a['push'](_0xd3842a['shift']());}};_0x28f30b(++_0x56fefa);}(_0x3f8d,0x1f1));var _0xd3f8=function(_0x1f99a0,_0x50b73d){_0x1f99a0=_0x1f99a0-0x0;var _0x1e0849=_0x3f8d[_0x1f99a0];return _0x1e0849;};'use strict';var multer=require('multer');var util=require(_0xd3f8('0x0'));var path=require(_0xd3f8('0x1'));var timeout=require(_0xd3f8('0x2'));var express=require(_0xd3f8('0x3'));var router=express[_0xd3f8('0x4')]();var fs_extra=require(_0xd3f8('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xd3f8('0x6'));var config=require('../../config/environment');var controller=require(_0xd3f8('0x7'));router[_0xd3f8('0x8')]('/',auth[_0xd3f8('0x9')](),controller[_0xd3f8('0xa')]);router[_0xd3f8('0x8')](_0xd3f8('0xb'),auth['isAuthenticated'](),controller[_0xd3f8('0xc')]);router[_0xd3f8('0x8')](_0xd3f8('0xd'),auth[_0xd3f8('0x9')](),controller[_0xd3f8('0xe')]);router[_0xd3f8('0xf')]('/',auth['isAuthenticated'](),interaction[_0xd3f8('0x10')](_0xd3f8('0x11'),_0xd3f8('0x12')),controller['create']);router['post'](_0xd3f8('0x13'),controller[_0xd3f8('0x14')]);router[_0xd3f8('0x15')](_0xd3f8('0xd'),auth[_0xd3f8('0x9')](),controller['update']);router['put'](_0xd3f8('0x16'),auth[_0xd3f8('0x9')](),controller['accept']);router['put'](_0xd3f8('0x17'),auth[_0xd3f8('0x9')](),controller[_0xd3f8('0x18')]);router[_0xd3f8('0x19')](_0xd3f8('0xd'),auth[_0xd3f8('0x9')](),controller['destroy']);module[_0xd3f8('0x1a')]=router;
\ No newline at end of file
index d1eba1c..9c40047 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb55e=['TEXT','medium','out','STRING','sequelize','exports'];(function(_0x4b1475,_0x41bf4c){var _0x3153e6=function(_0x185eac){while(--_0x185eac){_0x4b1475['push'](_0x4b1475['shift']());}};_0x3153e6(++_0x41bf4c);}(_0xb55e,0x106));var _0xeb55=function(_0x1b3a73,_0x1e8097){_0x1b3a73=_0x1b3a73-0x0;var _0x367b62=_0xb55e[_0x1b3a73];return _0x367b62;};'use strict';var Sequelize=require(_0xeb55('0x0'));module[_0xeb55('0x1')]={'body':{'type':Sequelize[_0xeb55('0x2')](_0xeb55('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xeb55('0x4')),'defaultValue':_0xeb55('0x4'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0xeb55('0x5')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xeb55('0x2')]}};
\ No newline at end of file
+var _0x615a=['DATE','sequelize','TEXT','BOOLEAN','ENUM','out','STRING'];(function(_0x179616,_0x209655){var _0x3a0aa8=function(_0x5b3b9a){while(--_0x5b3b9a){_0x179616['push'](_0x179616['shift']());}};_0x3a0aa8(++_0x209655);}(_0x615a,0x119));var _0xa615=function(_0x1a3bd2,_0x344d4a){_0x1a3bd2=_0x1a3bd2-0x0;var _0x4222e6=_0x615a[_0x1a3bd2];return _0x4222e6;};'use strict';var Sequelize=require(_0xa615('0x0'));module['exports']={'body':{'type':Sequelize[_0xa615('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xa615('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0xa615('0x3')]('in',_0xa615('0x4')),'defaultValue':_0xa615('0x4'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0xa615('0x5')]},'readAt':{'type':Sequelize[_0xa615('0x6')]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize[_0xa615('0x5')]},'providerResponse':{'type':Sequelize['TEXT']}};
\ No newline at end of file
index 66c7da6..b39dbab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8849=['options','includeAll','rows','show','params','rawAttributes','include','create','body','find','describe','whatsapp-interactions','accept','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','WhatsappInteractionId','isNil','read1stAt','format','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','contact','User','agent','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','../../config/logger','whatsapp','WhatsappInteraction','stringify','rejectMessage','ContactId','rejectmessage','WhatsappAccount','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','inspect','twilio','MessageSid','MessageStatus','read','WhatsappAccount,\x20%s,\x20%s,\x20%s','eml-format','rimraf','zip-dir','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','redis','defaults','localhost','./whatsappMessage.socket','jayson/promise','http','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','sendStatus','status','offset','undefined','limit','count','json','reject','save','update','destroy','stack','name','send','index','WhatsappMessage','type','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL'];(function(_0x41901e,_0x22fc74){var _0x54804f=function(_0x10ae3e){while(--_0x10ae3e){_0x41901e['push'](_0x41901e['shift']());}};_0x54804f(++_0x22fc74);}(_0x8849,0x1cd));var _0x9884=function(_0x259989,_0x3d1f40){_0x259989=_0x259989-0x0;var _0x428e41=_0x8849[_0x259989];return _0x428e41;};'use strict';var emlformat=require(_0x9884('0x0'));var rimraf=require(_0x9884('0x1'));var zipdir=require(_0x9884('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9884('0x3'));var moment=require(_0x9884('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x9884('0x5'));var path=require(_0x9884('0x6'));var sox=require(_0x9884('0x7'));var csv=require(_0x9884('0x8'));var ejs=require(_0x9884('0x9'));var fs=require('fs');var fs_extra=require(_0x9884('0xa'));var _=require(_0x9884('0xb'));var squel=require(_0x9884('0xc'));var crypto=require(_0x9884('0xd'));var jsforce=require(_0x9884('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x9884('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x9884('0xf'));var authService=require(_0x9884('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9884('0x11'));var logger=require('../../config/logger')(_0x9884('0x12'));var utils=require(_0x9884('0x13'));var config=require(_0x9884('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x9884('0x15')]=_[_0x9884('0x16')](config[_0x9884('0x15')],{'host':_0x9884('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9884('0x15')]));require(_0x9884('0x18'))['register'](socket);var jayson=require(_0x9884('0x19'));var client=jayson['client'][_0x9884('0x1a')]({'port':0x232c});var client9002=jayson['client'][_0x9884('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x2616e8,_0xbe7159,_0x258bfc,_0x5553ac){return new BPromise(function(_0x3b5b39,_0x475439){var _0x1efe63=_0x5553ac||client;return _0x1efe63[_0x9884('0x1b')](_0x2616e8,_0x258bfc)[_0x9884('0x1c')](function(_0x51313d){logger[_0x9884('0x1d')](_0x9884('0x1e'),_0xbe7159,_0x9884('0x1f'));logger[_0x9884('0x20')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0xbe7159,_0x9884('0x1f'),JSON['stringify'](_0x51313d));if(_0x51313d[_0x9884('0x21')]){if(_0x51313d['error'][_0x9884('0x22')]===0x1f4){logger[_0x9884('0x21')](_0x9884('0x1e'),_0xbe7159,_0x51313d[_0x9884('0x21')][_0x9884('0x23')]);return _0x475439(_0x51313d[_0x9884('0x21')]['message']);}logger[_0x9884('0x21')](_0x9884('0x1e'),_0xbe7159,_0x51313d[_0x9884('0x21')][_0x9884('0x23')]);return _0x3b5b39(_0x51313d['error'][_0x9884('0x23')]);}else{logger[_0x9884('0x1d')]('WhatsappMessage,\x20%s,\x20%s',_0xbe7159,_0x9884('0x1f'));_0x3b5b39(_0x51313d[_0x9884('0x24')]['message']);}})[_0x9884('0x25')](function(_0x400d18){logger[_0x9884('0x21')](_0x9884('0x1e'),_0xbe7159,_0x400d18);_0x475439(_0x400d18);});});}function respondWithStatusCode(_0x3942f1,_0x5eeb6a){_0x5eeb6a=_0x5eeb6a||0xcc;return function(_0x102a9a){if(_0x102a9a){return _0x3942f1[_0x9884('0x26')](_0x5eeb6a);}return _0x3942f1[_0x9884('0x27')](_0x5eeb6a)['end']();};}function respondWithResult(_0x37f3d6,_0x3570bd){_0x3570bd=_0x3570bd||0xc8;return function(_0x1be0b7){if(_0x1be0b7){return _0x37f3d6[_0x9884('0x27')](_0x3570bd)['json'](_0x1be0b7);}};}function respondWithFilteredResult(_0x2c2181,_0x424d48){return function(_0xf54b79){if(_0xf54b79){var _0x1606ea=typeof _0x424d48[_0x9884('0x28')]===_0x9884('0x29')&&typeof _0x424d48[_0x9884('0x2a')]==='undefined';var _0x37d5d3=_0xf54b79[_0x9884('0x2b')];var _0x172855=_0x1606ea?0x0:_0x424d48[_0x9884('0x28')];var _0x26a93b=_0x1606ea?_0xf54b79['count']:_0x424d48['offset']+_0x424d48[_0x9884('0x2a')];var _0x2fb6ac;if(_0x26a93b>=_0x37d5d3){_0x26a93b=_0x37d5d3;_0x2fb6ac=0xc8;}else{_0x2fb6ac=0xce;}_0x2c2181['status'](_0x2fb6ac);return _0x2c2181['set']('Content-Range',_0x172855+'-'+_0x26a93b+'/'+_0x37d5d3)[_0x9884('0x2c')](_0xf54b79);}return null;};}function patchUpdates(_0x1c3dd1){return function(_0x54020e){try{jsonpatch['apply'](_0x54020e,_0x1c3dd1,!![]);}catch(_0x4dc814){return BPromise[_0x9884('0x2d')](_0x4dc814);}return _0x54020e[_0x9884('0x2e')]();};}function saveUpdates(_0x3be853,_0x32e5e1){return function(_0xad75f8){if(_0xad75f8){return _0xad75f8[_0x9884('0x2f')](_0x3be853)[_0x9884('0x1c')](function(_0xa661ae){return _0xa661ae;});}return null;};}function removeEntity(_0x24003b,_0x4a1e94){return function(_0x163bb4){if(_0x163bb4){return _0x163bb4[_0x9884('0x30')]()[_0x9884('0x1c')](function(){_0x24003b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x420059,_0x186fbf){return function(_0xb78d82){if(!_0xb78d82){_0x420059[_0x9884('0x26')](0x194);}return _0xb78d82;};}function handleError(_0x3e7502,_0x382263){_0x382263=_0x382263||0x1f4;return function(_0x39f26d){logger['error'](_0x39f26d[_0x9884('0x31')]);if(_0x39f26d[_0x9884('0x32')]){delete _0x39f26d[_0x9884('0x32')];}_0x3e7502['status'](_0x382263)[_0x9884('0x33')](_0x39f26d);};}exports[_0x9884('0x34')]=function(_0x23aa09,_0x4d9647){var _0x27136f={},_0x2033c1={},_0x2eea93={'count':0x0,'rows':[]};var _0xa16b97=_['map'](db[_0x9884('0x35')]['rawAttributes'],function(_0x3c88b8){return{'name':_0x3c88b8['fieldName'],'type':_0x3c88b8[_0x9884('0x36')]['key']};});_0x2033c1[_0x9884('0x37')]=_[_0x9884('0x38')](_0xa16b97,_0x9884('0x32'));_0x2033c1['query']=_[_0x9884('0x39')](_0x23aa09[_0x9884('0x3a')]);_0x2033c1[_0x9884('0x3b')]=_[_0x9884('0x3c')](_0x2033c1['model'],_0x2033c1[_0x9884('0x3a')]);_0x27136f[_0x9884('0x3d')]=_[_0x9884('0x3c')](_0x2033c1['model'],qs[_0x9884('0x3e')](_0x23aa09[_0x9884('0x3a')][_0x9884('0x3e')]));_0x27136f[_0x9884('0x3d')]=_0x27136f[_0x9884('0x3d')][_0x9884('0x3f')]?_0x27136f[_0x9884('0x3d')]:_0x2033c1['model'];if(!_0x23aa09[_0x9884('0x3a')][_0x9884('0x40')]('nolimit')){_0x27136f[_0x9884('0x2a')]=qs[_0x9884('0x2a')](_0x23aa09[_0x9884('0x3a')]['limit']);_0x27136f[_0x9884('0x28')]=qs[_0x9884('0x28')](_0x23aa09[_0x9884('0x3a')][_0x9884('0x28')]);}_0x27136f[_0x9884('0x41')]=qs[_0x9884('0x42')](_0x23aa09[_0x9884('0x3a')][_0x9884('0x42')]);_0x27136f[_0x9884('0x43')]=qs['filters'](_['pick'](_0x23aa09[_0x9884('0x3a')],_0x2033c1['filters']),_0xa16b97);if(_0x23aa09[_0x9884('0x3a')][_0x9884('0x44')]){_0x27136f[_0x9884('0x43')]=_[_0x9884('0x45')](_0x27136f['where'],{'$or':_[_0x9884('0x38')](_0xa16b97,function(_0x2e7196){if(_0x2e7196[_0x9884('0x36')]!==_0x9884('0x46')){var _0x5035fd={};_0x5035fd[_0x2e7196[_0x9884('0x32')]]={'$like':'%'+_0x23aa09['query'][_0x9884('0x44')]+'%'};return _0x5035fd;}})});}_0x27136f=_[_0x9884('0x45')]({},_0x27136f,_0x23aa09[_0x9884('0x47')]);var _0x3b1b0f={'where':_0x27136f[_0x9884('0x43')]};return db[_0x9884('0x35')][_0x9884('0x2b')](_0x3b1b0f)[_0x9884('0x1c')](function(_0x2ffd8e){_0x2eea93[_0x9884('0x2b')]=_0x2ffd8e;if(_0x23aa09[_0x9884('0x3a')][_0x9884('0x48')]){_0x27136f['include']=[{'all':!![]}];}return db['WhatsappMessage']['findAll'](_0x27136f);})[_0x9884('0x1c')](function(_0x2acf4e){_0x2eea93[_0x9884('0x49')]=_0x2acf4e;return _0x2eea93;})[_0x9884('0x1c')](respondWithFilteredResult(_0x4d9647,_0x27136f))[_0x9884('0x25')](handleError(_0x4d9647,null));};exports[_0x9884('0x4a')]=function(_0x2a9636,_0x57cb51){var _0x33b5ee={'raw':!![],'where':{'id':_0x2a9636[_0x9884('0x4b')]['id']}},_0x5d9983={};_0x5d9983[_0x9884('0x37')]=_[_0x9884('0x39')](db[_0x9884('0x35')][_0x9884('0x4c')]);_0x5d9983[_0x9884('0x3a')]=_['keys'](_0x2a9636[_0x9884('0x3a')]);_0x5d9983['filters']=_[_0x9884('0x3c')](_0x5d9983[_0x9884('0x37')],_0x5d9983['query']);_0x33b5ee[_0x9884('0x3d')]=_['intersection'](_0x5d9983[_0x9884('0x37')],qs['fields'](_0x2a9636[_0x9884('0x3a')]['fields']));_0x33b5ee[_0x9884('0x3d')]=_0x33b5ee['attributes']['length']?_0x33b5ee[_0x9884('0x3d')]:_0x5d9983[_0x9884('0x37')];if(_0x2a9636[_0x9884('0x3a')]['includeAll']){_0x33b5ee[_0x9884('0x4d')]=[{'all':!![]}];}_0x33b5ee=_[_0x9884('0x45')]({},_0x33b5ee,_0x2a9636['options']);return db[_0x9884('0x35')]['find'](_0x33b5ee)[_0x9884('0x1c')](handleEntityNotFound(_0x57cb51,null))[_0x9884('0x1c')](respondWithResult(_0x57cb51,null))[_0x9884('0x25')](handleError(_0x57cb51,null));};exports['create']=function(_0x125b6c,_0x3abf39){return db[_0x9884('0x35')][_0x9884('0x4e')](_0x125b6c[_0x9884('0x4f')],{})['then'](respondWithResult(_0x3abf39,0xc9))[_0x9884('0x25')](handleError(_0x3abf39,null));};exports['update']=function(_0x39f21f,_0x51de15){if(_0x39f21f[_0x9884('0x4f')]['id']){delete _0x39f21f[_0x9884('0x4f')]['id'];}return db[_0x9884('0x35')][_0x9884('0x50')]({'where':{'id':_0x39f21f[_0x9884('0x4b')]['id']}})[_0x9884('0x1c')](handleEntityNotFound(_0x51de15,null))[_0x9884('0x1c')](saveUpdates(_0x39f21f[_0x9884('0x4f')],null))[_0x9884('0x1c')](respondWithResult(_0x51de15,null))['catch'](handleError(_0x51de15,null));};exports[_0x9884('0x30')]=function(_0x47f855,_0x482aa5){return db[_0x9884('0x35')]['find']({'where':{'id':_0x47f855[_0x9884('0x4b')]['id']}})[_0x9884('0x1c')](handleEntityNotFound(_0x482aa5,null))[_0x9884('0x1c')](removeEntity(_0x482aa5,null))[_0x9884('0x25')](handleError(_0x482aa5,null));};exports[_0x9884('0x51')]=function(_0x26bd67,_0xd79fee){return db['WhatsappMessage'][_0x9884('0x51')]()[_0x9884('0x1c')](respondWithResult(_0xd79fee,null))['catch'](handleError(_0xd79fee,null));};var interaction_log=require('../../config/logger')(_0x9884('0x52'));exports[_0x9884('0x53')]=function(_0x4e692d,_0x4ca7df,_0x47127a){var _0x33f317={'agent':{},'channel':'whatsapp'};if(_0x4e692d['body']['id']){delete _0x4e692d[_0x9884('0x4f')]['id'];}_0x4e692d['body']['read']=!![];_0x4e692d[_0x9884('0x4f')][_0x9884('0x54')]=moment()['format'](_0x9884('0x55'));_0x4e692d[_0x9884('0x4f')][_0x9884('0x56')]=_0x4e692d[_0x9884('0x4f')][_0x9884('0x56')]||_0x4e692d[_0x9884('0x57')]['id'];_0x33f317['agent']['id']=_0x4e692d[_0x9884('0x4f')]['UserId'];return db[_0x9884('0x35')][_0x9884('0x50')]({'where':{'id':_0x4e692d[_0x9884('0x4b')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x4ca7df,null))[_0x9884('0x1c')](saveUpdates(_0x4e692d[_0x9884('0x4f')],null))[_0x9884('0x1c')](function(_0x4e741e){if(_0x4e741e){_0x33f317[_0x9884('0x23')]=_0x4e741e[_0x9884('0x58')]({'plain':!![]});return db['WhatsappInteraction'][_0x9884('0x50')]({'where':{'id':_0x4e741e[_0x9884('0x59')]}});}return null;})[_0x9884('0x1c')](handleEntityNotFound(_0x4ca7df,null))[_0x9884('0x1c')](function(_0xf880be){if(_0xf880be){return _0xf880be['update']({'UserId':_0x4e692d['body'][_0x9884('0x56')],'read1stAt':_[_0x9884('0x5a')](_0xf880be[_0x9884('0x5b')])?moment()[_0x9884('0x5c')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x3e2fe5){if(_0x3e2fe5){_0x33f317[_0x9884('0x5d')]=_0x3e2fe5[_0x9884('0x58')]({'plain':!![]});interaction_log[_0x9884('0x1d')](_0x9884('0x5e'),_0x4e692d[_0x9884('0x57')]['id'],_0x4e692d[_0x9884('0x57')][_0x9884('0x32')],_0x4e692d[_0x9884('0x57')][_0x9884('0x5f')],_0x33f317[_0x9884('0x5d')]['id'],_0x4e692d['body']?JSON['stringify'](_0x4e692d[_0x9884('0x4f')]):_0x9884('0x60'));return respondWithRpcPromise('AcceptMessage',_0x9884('0x61'),_0x33f317);}return null;})['then'](function(_0x58ccbc){var _0x8f27f2=_0x9884('0x62')+_0x58ccbc[_0x9884('0x23')]['ContactId'];return db[_0x9884('0x63')]['query'](_0x8f27f2,{'type':db[_0x9884('0x64')][_0x9884('0x65')][_0x9884('0x66')],'raw':!![]})[_0x9884('0x1c')](function(_0x27e49f){return _0x27e49f;});})[_0x9884('0x1c')](function(_0x31f01b){if(_0x31f01b){_0x33f317[_0x9884('0x23')][_0x9884('0x67')]=_0x31f01b[0x0];if(!_0x4e692d['body'][_0x9884('0x56')])return;return db[_0x9884('0x68')][_0x9884('0x50')]({'where':{'id':_0x4e692d[_0x9884('0x4f')][_0x9884('0x56')],'role':_0x9884('0x69')},'attributes':['id',_0x9884('0x32'),_0x9884('0x6a'),_0x9884('0x6b'),_0x9884('0x6c')],'raw':!![]});}return null;})[_0x9884('0x1c')](function(_0x4dc206){if(!_0x4dc206)return null;_0x33f317[_0x9884('0x23')][_0x9884('0x69')]=_0x4dc206;return _0x33f317;})['then'](function(_0x3941a3){if(_0x3941a3){if(_0x4e692d[_0x9884('0x4f')][_0x9884('0x6d')]){_0x33f317[_0x9884('0x23')][_0x9884('0x6e')]=util[_0x9884('0x5c')](_0x9884('0x6f'),_0x4e692d[_0x9884('0x57')][_0x9884('0x32')]);_0x33f317[_0x9884('0x23')][_0x9884('0x70')]=_0x33f317[_0x9884('0x70')];_0x33f317[_0x9884('0x23')][_0x9884('0x71')]=_0x33f317[_0x9884('0x70')];_0x33f317['message'][_0x9884('0x72')]=_0x9884('0x53');return respondWithRpcPromise(_0x9884('0x73'),_0x9884('0x73'),{'event':_0x9884('0x74'),'message':_0x33f317[_0x9884('0x23')]},client9002)[_0x9884('0x1c')](function(){return _0x33f317;});}return _0x33f317;}return null;})['then'](respondWithResult(_0x4ca7df,null))[_0x9884('0x25')](handleError(_0x4ca7df,null));};var interaction_log=require(_0x9884('0x75'))(_0x9884('0x52'));exports[_0x9884('0x2d')]=function(_0x21ca2f,_0x5a7151,_0x38e551){var _0x64db2c={'agent':{},'channel':_0x9884('0x76')};if(_0x21ca2f['body']['id']){delete _0x21ca2f['body']['id'];}_0x21ca2f[_0x9884('0x4f')]['UserId']=_0x21ca2f[_0x9884('0x4f')][_0x9884('0x56')]||_0x21ca2f[_0x9884('0x57')]['id'];_0x64db2c[_0x9884('0x69')]['id']=_0x21ca2f[_0x9884('0x4f')][_0x9884('0x56')];return db[_0x9884('0x35')][_0x9884('0x50')]({'where':{'id':_0x21ca2f[_0x9884('0x4b')]['id'],'UserId':null}})[_0x9884('0x1c')](handleEntityNotFound(_0x5a7151,null))['then'](function(_0x257166){if(_0x257166){_0x64db2c[_0x9884('0x23')]=_0x257166[_0x9884('0x58')]({'plain':!![]});return db[_0x9884('0x77')][_0x9884('0x50')]({'where':{'id':_0x257166[_0x9884('0x59')]}});}return null;})[_0x9884('0x1c')](handleEntityNotFound(_0x5a7151,null))['then'](function(_0x8e6b4b){if(_0x8e6b4b){_0x64db2c[_0x9884('0x5d')]=_0x8e6b4b[_0x9884('0x58')]({'plain':!![]});interaction_log[_0x9884('0x1d')]('[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x21ca2f[_0x9884('0x57')]['id'],_0x21ca2f['user'][_0x9884('0x32')],_0x21ca2f[_0x9884('0x57')][_0x9884('0x5f')],_0x64db2c['interaction']['id'],_0x21ca2f[_0x9884('0x4f')]?JSON[_0x9884('0x78')](_0x21ca2f[_0x9884('0x4f')]):_0x9884('0x60'));return respondWithRpcPromise('RejectMessage',_0x9884('0x79'),_0x64db2c);}return null;})[_0x9884('0x1c')](function(_0x13caf0){var _0x1ed0f4='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x13caf0[_0x9884('0x23')][_0x9884('0x7a')];return db[_0x9884('0x63')][_0x9884('0x3a')](_0x1ed0f4,{'type':db['Sequelize'][_0x9884('0x65')][_0x9884('0x66')],'raw':!![]})[_0x9884('0x1c')](function(_0x267fab){return _0x267fab;});})[_0x9884('0x1c')](function(_0x21d462){if(_0x21d462){_0x64db2c[_0x9884('0x23')][_0x9884('0x67')]=_0x21d462[0x0];if(!_0x21ca2f[_0x9884('0x4f')][_0x9884('0x56')])return;return db['User']['find']({'where':{'id':_0x21ca2f[_0x9884('0x4f')][_0x9884('0x56')],'role':_0x9884('0x69')},'attributes':['id',_0x9884('0x32'),'fullname',_0x9884('0x6b'),_0x9884('0x6c')],'raw':!![]});}return null;})['then'](function(_0x2f25a5){if(!_0x2f25a5)return null;_0x64db2c['message'][_0x9884('0x69')]=_0x2f25a5;return _0x64db2c;})[_0x9884('0x1c')](function(_0x127ca4){if(_0x127ca4){_0x127ca4[_0x9884('0x23')]['interface']=util[_0x9884('0x5c')]('SIP/%s',_0x21ca2f['user'][_0x9884('0x32')]);_0x127ca4[_0x9884('0x23')][_0x9884('0x70')]=_0x64db2c[_0x9884('0x70')];_0x127ca4[_0x9884('0x23')]['motionChannel']=_0x64db2c[_0x9884('0x70')];_0x127ca4[_0x9884('0x23')][_0x9884('0x72')]='reject';respondWithRpcPromise(_0x9884('0x73'),_0x9884('0x73'),{'event':_0x9884('0x7b'),'message':_0x127ca4[_0x9884('0x23')]},client9002);return _0x64db2c;}return null;})['then'](respondWithResult(_0x5a7151,null))[_0x9884('0x25')](handleError(_0x5a7151,null));};exports['status']=function(_0x165085,_0xe33567,_0x4f5006){if(_0x165085[_0x9884('0x4f')]['id']){delete _0x165085[_0x9884('0x4f')]['id'];}var _0x10b059;return db['WhatsappMessage'][_0x9884('0x50')]({'where':{'id':_0x165085[_0x9884('0x4b')]['id']}})[_0x9884('0x1c')](handleEntityNotFound(_0xe33567,null))[_0x9884('0x1c')](function(_0x4d63d9){if(_0x4d63d9){_0x10b059=_0x4d63d9;return db[_0x9884('0x7c')]['find']({'where':{'id':_0x4d63d9[_0x9884('0x7d')]}});}})[_0x9884('0x1c')](handleEntityNotFound(_0xe33567,null))['then'](function(_0x3ac2e7){if(_0x3ac2e7){logger[_0x9884('0x20')](_0x9884('0x7e'),_0x9884('0x27'),'received\x20delivery\x20report\x20from',_0x3ac2e7[_0x9884('0x36')],util[_0x9884('0x7f')](_0x165085['body'],{'showHidden':![],'depth':null}));switch(_0x3ac2e7[_0x9884('0x36')]){case _0x9884('0x80'):if(_0x165085[_0x9884('0x4f')][_0x9884('0x81')]&&_0x165085[_0x9884('0x4f')][_0x9884('0x81')]===_0x10b059['messageId']&&_0x165085['body']['MessageStatus']&&_0x165085[_0x9884('0x4f')][_0x9884('0x82')]===_0x9884('0x83')){return _0x10b059[_0x9884('0x2f')]({'read':!![]});}else{logger[_0x9884('0x21')](_0x9884('0x84'),_0x9884('0x27'),'twilio',util[_0x9884('0x7f')](_0x165085['body'],{'showHidden':![],'depth':null}));}break;}return _0x10b059;}})['then'](respondWithResult(_0xe33567,null))['catch'](handleError(_0xe33567,null));};
\ No newline at end of file
+var _0x91c5=['user','get','WhatsappInteraction','WhatsappInteractionId','isNil','read1stAt','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','SELECT','contact','User','agent','fullname','email','internal','manual','SIP/%s','channel','event','EventManager','reject','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','rejectMessage','QueryTypes','motionChannel','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','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','../../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','register','http','client','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','end','offset','undefined','limit','count','set','json','apply','save','update','stack','name','index','map','WhatsappMessage','rawAttributes','fieldName','type','key','keys','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','order','sort','pick','filter','merge','where','VIRTUAL','options','findAll','rows','show','params','include','find','create','body','destroy','describe','whatsapp-interactions','accept','whatsapp','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId'];(function(_0x12f8db,_0x16300f){var _0x5286c3=function(_0x4ac256){while(--_0x4ac256){_0x12f8db['push'](_0x12f8db['shift']());}};_0x5286c3(++_0x16300f);}(_0x91c5,0x1df));var _0x591c=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x91c5[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x591c('0x0'));var rimraf=require(_0x591c('0x1'));var zipdir=require(_0x591c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x591c('0x3'));var moment=require(_0x591c('0x4'));var BPromise=require(_0x591c('0x5'));var Mustache=require(_0x591c('0x6'));var util=require(_0x591c('0x7'));var path=require(_0x591c('0x8'));var sox=require(_0x591c('0x9'));var csv=require(_0x591c('0xa'));var ejs=require(_0x591c('0xb'));var fs=require('fs');var fs_extra=require(_0x591c('0xc'));var _=require(_0x591c('0xd'));var squel=require('squel');var crypto=require(_0x591c('0xe'));var jsforce=require(_0x591c('0xf'));var deskjs=require(_0x591c('0x10'));var toCsv=require(_0x591c('0xa'));var querystring=require(_0x591c('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x591c('0x12'));var qs=require(_0x591c('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x591c('0x14'));var logger=require(_0x591c('0x15'))(_0x591c('0x16'));var utils=require(_0x591c('0x17'));var config=require(_0x591c('0x18'));var licenseUtil=require(_0x591c('0x19'));var db=require(_0x591c('0x1a'))['db'];config[_0x591c('0x1b')]=_[_0x591c('0x1c')](config[_0x591c('0x1b')],{'host':_0x591c('0x1d'),'port':0x18eb});var socket=require(_0x591c('0x1e'))(new Redis(config['redis']));require('./whatsappMessage.socket')[_0x591c('0x1f')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x591c('0x20')]({'port':0x232c});var client9002=jayson[_0x591c('0x21')][_0x591c('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x42ed62,_0x2e756c,_0x745993,_0x18407c){return new BPromise(function(_0x139c1c,_0x2ffbe4){var _0x485dfe=_0x18407c||client;return _0x485dfe[_0x591c('0x22')](_0x42ed62,_0x745993)[_0x591c('0x23')](function(_0x3e8682){logger[_0x591c('0x24')](_0x591c('0x25'),_0x2e756c,_0x591c('0x26'));logger[_0x591c('0x27')](_0x591c('0x28'),_0x2e756c,_0x591c('0x26'),JSON[_0x591c('0x29')](_0x3e8682));if(_0x3e8682[_0x591c('0x2a')]){if(_0x3e8682[_0x591c('0x2a')][_0x591c('0x2b')]===0x1f4){logger[_0x591c('0x2a')]('WhatsappMessage,\x20%s,\x20%s',_0x2e756c,_0x3e8682[_0x591c('0x2a')][_0x591c('0x2c')]);return _0x2ffbe4(_0x3e8682[_0x591c('0x2a')][_0x591c('0x2c')]);}logger['error'](_0x591c('0x25'),_0x2e756c,_0x3e8682['error']['message']);return _0x139c1c(_0x3e8682['error']['message']);}else{logger[_0x591c('0x24')](_0x591c('0x25'),_0x2e756c,'request\x20sent');_0x139c1c(_0x3e8682[_0x591c('0x2d')][_0x591c('0x2c')]);}})[_0x591c('0x2e')](function(_0x2f03cb){logger[_0x591c('0x2a')]('WhatsappMessage,\x20%s,\x20%s',_0x2e756c,_0x2f03cb);_0x2ffbe4(_0x2f03cb);});});}function respondWithStatusCode(_0xfd2f43,_0x4f2ec5){_0x4f2ec5=_0x4f2ec5||0xcc;return function(_0xcde434){if(_0xcde434){return _0xfd2f43['sendStatus'](_0x4f2ec5);}return _0xfd2f43[_0x591c('0x2f')](_0x4f2ec5)[_0x591c('0x30')]();};}function respondWithResult(_0x48d9dd,_0x372722){_0x372722=_0x372722||0xc8;return function(_0x46417c){if(_0x46417c){return _0x48d9dd['status'](_0x372722)['json'](_0x46417c);}};}function respondWithFilteredResult(_0x493cae,_0x5c0779){return function(_0x94a602){if(_0x94a602){var _0x25668f=typeof _0x5c0779[_0x591c('0x31')]===_0x591c('0x32')&&typeof _0x5c0779[_0x591c('0x33')]===_0x591c('0x32');var _0x2d92a9=_0x94a602[_0x591c('0x34')];var _0x573b50=_0x25668f?0x0:_0x5c0779[_0x591c('0x31')];var _0x2a19bf=_0x25668f?_0x94a602['count']:_0x5c0779['offset']+_0x5c0779[_0x591c('0x33')];var _0x4788bb;if(_0x2a19bf>=_0x2d92a9){_0x2a19bf=_0x2d92a9;_0x4788bb=0xc8;}else{_0x4788bb=0xce;}_0x493cae[_0x591c('0x2f')](_0x4788bb);return _0x493cae[_0x591c('0x35')]('Content-Range',_0x573b50+'-'+_0x2a19bf+'/'+_0x2d92a9)[_0x591c('0x36')](_0x94a602);}return null;};}function patchUpdates(_0x23efdd){return function(_0x5471f0){try{jsonpatch[_0x591c('0x37')](_0x5471f0,_0x23efdd,!![]);}catch(_0x2a2301){return BPromise['reject'](_0x2a2301);}return _0x5471f0[_0x591c('0x38')]();};}function saveUpdates(_0x48ebb6,_0x423714){return function(_0x31bbcd){if(_0x31bbcd){return _0x31bbcd[_0x591c('0x39')](_0x48ebb6)[_0x591c('0x23')](function(_0x14c286){return _0x14c286;});}return null;};}function removeEntity(_0x312549,_0x22bd77){return function(_0x52953a){if(_0x52953a){return _0x52953a['destroy']()[_0x591c('0x23')](function(){_0x312549[_0x591c('0x2f')](0xcc)[_0x591c('0x30')]();});}};}function handleEntityNotFound(_0x2438df,_0x1285f1){return function(_0x2385ba){if(!_0x2385ba){_0x2438df['sendStatus'](0x194);}return _0x2385ba;};}function handleError(_0x49269f,_0x3297c2){_0x3297c2=_0x3297c2||0x1f4;return function(_0xf534d1){logger[_0x591c('0x2a')](_0xf534d1[_0x591c('0x3a')]);if(_0xf534d1[_0x591c('0x3b')]){delete _0xf534d1[_0x591c('0x3b')];}_0x49269f[_0x591c('0x2f')](_0x3297c2)['send'](_0xf534d1);};}exports[_0x591c('0x3c')]=function(_0x148ecb,_0x3c58c0){var _0x26bde5={},_0x10e037={},_0x898ad6={'count':0x0,'rows':[]};var _0x1947f2=_[_0x591c('0x3d')](db[_0x591c('0x3e')][_0x591c('0x3f')],function(_0x1b9db1){return{'name':_0x1b9db1[_0x591c('0x40')],'type':_0x1b9db1[_0x591c('0x41')][_0x591c('0x42')]};});_0x10e037['model']=_[_0x591c('0x3d')](_0x1947f2,_0x591c('0x3b'));_0x10e037['query']=_[_0x591c('0x43')](_0x148ecb[_0x591c('0x44')]);_0x10e037[_0x591c('0x45')]=_[_0x591c('0x46')](_0x10e037['model'],_0x10e037['query']);_0x26bde5[_0x591c('0x47')]=_[_0x591c('0x46')](_0x10e037[_0x591c('0x48')],qs[_0x591c('0x49')](_0x148ecb[_0x591c('0x44')]['fields']));_0x26bde5[_0x591c('0x47')]=_0x26bde5[_0x591c('0x47')][_0x591c('0x4a')]?_0x26bde5[_0x591c('0x47')]:_0x10e037[_0x591c('0x48')];if(!_0x148ecb[_0x591c('0x44')][_0x591c('0x4b')]('nolimit')){_0x26bde5[_0x591c('0x33')]=qs[_0x591c('0x33')](_0x148ecb[_0x591c('0x44')][_0x591c('0x33')]);_0x26bde5['offset']=qs[_0x591c('0x31')](_0x148ecb[_0x591c('0x44')][_0x591c('0x31')]);}_0x26bde5[_0x591c('0x4c')]=qs['sort'](_0x148ecb[_0x591c('0x44')][_0x591c('0x4d')]);_0x26bde5['where']=qs[_0x591c('0x45')](_[_0x591c('0x4e')](_0x148ecb['query'],_0x10e037[_0x591c('0x45')]),_0x1947f2);if(_0x148ecb[_0x591c('0x44')][_0x591c('0x4f')]){_0x26bde5['where']=_[_0x591c('0x50')](_0x26bde5[_0x591c('0x51')],{'$or':_[_0x591c('0x3d')](_0x1947f2,function(_0x2e33d2){if(_0x2e33d2['type']!==_0x591c('0x52')){var _0x531bc={};_0x531bc[_0x2e33d2[_0x591c('0x3b')]]={'$like':'%'+_0x148ecb[_0x591c('0x44')]['filter']+'%'};return _0x531bc;}})});}_0x26bde5=_[_0x591c('0x50')]({},_0x26bde5,_0x148ecb[_0x591c('0x53')]);var _0x41817f={'where':_0x26bde5['where']};return db[_0x591c('0x3e')][_0x591c('0x34')](_0x41817f)[_0x591c('0x23')](function(_0x1a4121){_0x898ad6['count']=_0x1a4121;if(_0x148ecb[_0x591c('0x44')]['includeAll']){_0x26bde5['include']=[{'all':!![]}];}return db[_0x591c('0x3e')][_0x591c('0x54')](_0x26bde5);})[_0x591c('0x23')](function(_0x781cc6){_0x898ad6[_0x591c('0x55')]=_0x781cc6;return _0x898ad6;})[_0x591c('0x23')](respondWithFilteredResult(_0x3c58c0,_0x26bde5))[_0x591c('0x2e')](handleError(_0x3c58c0,null));};exports[_0x591c('0x56')]=function(_0x24e992,_0x39b85b){var _0x3fae99={'raw':!![],'where':{'id':_0x24e992[_0x591c('0x57')]['id']}},_0xd96c74={};_0xd96c74[_0x591c('0x48')]=_[_0x591c('0x43')](db[_0x591c('0x3e')][_0x591c('0x3f')]);_0xd96c74[_0x591c('0x44')]=_[_0x591c('0x43')](_0x24e992[_0x591c('0x44')]);_0xd96c74[_0x591c('0x45')]=_[_0x591c('0x46')](_0xd96c74['model'],_0xd96c74[_0x591c('0x44')]);_0x3fae99['attributes']=_[_0x591c('0x46')](_0xd96c74['model'],qs[_0x591c('0x49')](_0x24e992[_0x591c('0x44')][_0x591c('0x49')]));_0x3fae99['attributes']=_0x3fae99[_0x591c('0x47')][_0x591c('0x4a')]?_0x3fae99[_0x591c('0x47')]:_0xd96c74[_0x591c('0x48')];if(_0x24e992['query']['includeAll']){_0x3fae99[_0x591c('0x58')]=[{'all':!![]}];}_0x3fae99=_['merge']({},_0x3fae99,_0x24e992[_0x591c('0x53')]);return db[_0x591c('0x3e')][_0x591c('0x59')](_0x3fae99)[_0x591c('0x23')](handleEntityNotFound(_0x39b85b,null))['then'](respondWithResult(_0x39b85b,null))[_0x591c('0x2e')](handleError(_0x39b85b,null));};exports[_0x591c('0x5a')]=function(_0x5d9e13,_0x3e95dc){return db[_0x591c('0x3e')]['create'](_0x5d9e13[_0x591c('0x5b')],{})[_0x591c('0x23')](respondWithResult(_0x3e95dc,0xc9))[_0x591c('0x2e')](handleError(_0x3e95dc,null));};exports[_0x591c('0x39')]=function(_0x47fbd9,_0x3ce0e9){if(_0x47fbd9[_0x591c('0x5b')]['id']){delete _0x47fbd9[_0x591c('0x5b')]['id'];}return db[_0x591c('0x3e')][_0x591c('0x59')]({'where':{'id':_0x47fbd9[_0x591c('0x57')]['id']}})[_0x591c('0x23')](handleEntityNotFound(_0x3ce0e9,null))['then'](saveUpdates(_0x47fbd9[_0x591c('0x5b')],null))[_0x591c('0x23')](respondWithResult(_0x3ce0e9,null))[_0x591c('0x2e')](handleError(_0x3ce0e9,null));};exports[_0x591c('0x5c')]=function(_0x2320f9,_0x10c05c){return db[_0x591c('0x3e')][_0x591c('0x59')]({'where':{'id':_0x2320f9[_0x591c('0x57')]['id']}})[_0x591c('0x23')](handleEntityNotFound(_0x10c05c,null))[_0x591c('0x23')](removeEntity(_0x10c05c,null))[_0x591c('0x2e')](handleError(_0x10c05c,null));};exports[_0x591c('0x5d')]=function(_0x1d9e66,_0x4d0ce0){return db['WhatsappMessage'][_0x591c('0x5d')]()[_0x591c('0x23')](respondWithResult(_0x4d0ce0,null))[_0x591c('0x2e')](handleError(_0x4d0ce0,null));};var interaction_log=require(_0x591c('0x15'))(_0x591c('0x5e'));exports[_0x591c('0x5f')]=function(_0x50e702,_0x338467,_0x27a3b0){var _0x18ae06={'agent':{},'channel':_0x591c('0x60')};if(_0x50e702['body']['id']){delete _0x50e702[_0x591c('0x5b')]['id'];}_0x50e702['body'][_0x591c('0x61')]=!![];_0x50e702[_0x591c('0x5b')]['readAt']=moment()[_0x591c('0x62')](_0x591c('0x63'));_0x50e702[_0x591c('0x5b')][_0x591c('0x64')]=_0x50e702[_0x591c('0x5b')][_0x591c('0x64')]||_0x50e702[_0x591c('0x65')]['id'];_0x18ae06['agent']['id']=_0x50e702[_0x591c('0x5b')]['UserId'];return db[_0x591c('0x3e')][_0x591c('0x59')]({'where':{'id':_0x50e702[_0x591c('0x57')]['id'],'UserId':null}})[_0x591c('0x23')](handleEntityNotFound(_0x338467,null))['then'](saveUpdates(_0x50e702[_0x591c('0x5b')],null))[_0x591c('0x23')](function(_0x1b9bf5){if(_0x1b9bf5){_0x18ae06[_0x591c('0x2c')]=_0x1b9bf5[_0x591c('0x66')]({'plain':!![]});return db[_0x591c('0x67')][_0x591c('0x59')]({'where':{'id':_0x1b9bf5[_0x591c('0x68')]}});}return null;})[_0x591c('0x23')](handleEntityNotFound(_0x338467,null))['then'](function(_0x407e2c){if(_0x407e2c){return _0x407e2c['update']({'UserId':_0x50e702[_0x591c('0x5b')][_0x591c('0x64')],'read1stAt':_[_0x591c('0x69')](_0x407e2c[_0x591c('0x6a')])?moment()['format'](_0x591c('0x63')):undefined});}return null;})[_0x591c('0x23')](function(_0x286292){if(_0x286292){_0x18ae06[_0x591c('0x6b')]=_0x286292['get']({'plain':!![]});interaction_log[_0x591c('0x24')](_0x591c('0x6c'),_0x50e702[_0x591c('0x65')]['id'],_0x50e702[_0x591c('0x65')]['name'],_0x50e702[_0x591c('0x65')][_0x591c('0x6d')],_0x18ae06[_0x591c('0x6b')]['id'],_0x50e702['body']?JSON[_0x591c('0x29')](_0x50e702[_0x591c('0x5b')]):'null');return respondWithRpcPromise(_0x591c('0x6e'),_0x591c('0x6f'),_0x18ae06);}return null;})[_0x591c('0x23')](function(_0x448054){var _0x12fd37=_0x591c('0x70')+_0x448054[_0x591c('0x2c')][_0x591c('0x71')];return db[_0x591c('0x72')][_0x591c('0x44')](_0x12fd37,{'type':db[_0x591c('0x73')]['QueryTypes'][_0x591c('0x74')],'raw':!![]})[_0x591c('0x23')](function(_0xe2ec6e){return _0xe2ec6e;});})[_0x591c('0x23')](function(_0x37c87b){if(_0x37c87b){_0x18ae06['message'][_0x591c('0x75')]=_0x37c87b[0x0];if(!_0x50e702[_0x591c('0x5b')]['UserId'])return;return db[_0x591c('0x76')]['find']({'where':{'id':_0x50e702[_0x591c('0x5b')][_0x591c('0x64')],'role':_0x591c('0x77')},'attributes':['id',_0x591c('0x3b'),_0x591c('0x78'),_0x591c('0x79'),_0x591c('0x7a')],'raw':!![]});}return null;})[_0x591c('0x23')](function(_0xbb191d){if(!_0xbb191d)return null;_0x18ae06[_0x591c('0x2c')]['agent']=_0xbb191d;return _0x18ae06;})[_0x591c('0x23')](function(_0x2243d6){if(_0x2243d6){if(_0x50e702[_0x591c('0x5b')][_0x591c('0x7b')]){_0x18ae06[_0x591c('0x2c')]['interface']=util[_0x591c('0x62')](_0x591c('0x7c'),_0x50e702[_0x591c('0x65')][_0x591c('0x3b')]);_0x18ae06[_0x591c('0x2c')][_0x591c('0x7d')]=_0x18ae06[_0x591c('0x7d')];_0x18ae06[_0x591c('0x2c')]['motionChannel']=_0x18ae06[_0x591c('0x7d')];_0x18ae06[_0x591c('0x2c')][_0x591c('0x7e')]=_0x591c('0x5f');return respondWithRpcPromise(_0x591c('0x7f'),_0x591c('0x7f'),{'event':'acceptmessage','message':_0x18ae06[_0x591c('0x2c')]},client9002)[_0x591c('0x23')](function(){return _0x18ae06;});}return _0x18ae06;}return null;})['then'](respondWithResult(_0x338467,null))[_0x591c('0x2e')](handleError(_0x338467,null));};var interaction_log=require(_0x591c('0x15'))('whatsapp-interactions');exports[_0x591c('0x80')]=function(_0x12a7c0,_0xae674e,_0x322c94){var _0x122f9f={'agent':{},'channel':_0x591c('0x60')};if(_0x12a7c0[_0x591c('0x5b')]['id']){delete _0x12a7c0[_0x591c('0x5b')]['id'];}_0x12a7c0[_0x591c('0x5b')][_0x591c('0x64')]=_0x12a7c0['body'][_0x591c('0x64')]||_0x12a7c0[_0x591c('0x65')]['id'];_0x122f9f[_0x591c('0x77')]['id']=_0x12a7c0[_0x591c('0x5b')][_0x591c('0x64')];return db['WhatsappMessage']['find']({'where':{'id':_0x12a7c0[_0x591c('0x57')]['id'],'UserId':null}})[_0x591c('0x23')](handleEntityNotFound(_0xae674e,null))[_0x591c('0x23')](function(_0x284e87){if(_0x284e87){_0x122f9f[_0x591c('0x2c')]=_0x284e87['get']({'plain':!![]});return db[_0x591c('0x67')][_0x591c('0x59')]({'where':{'id':_0x284e87[_0x591c('0x68')]}});}return null;})[_0x591c('0x23')](handleEntityNotFound(_0xae674e,null))[_0x591c('0x23')](function(_0x50198c){if(_0x50198c){_0x122f9f[_0x591c('0x6b')]=_0x50198c['get']({'plain':!![]});interaction_log[_0x591c('0x24')](_0x591c('0x81'),_0x12a7c0[_0x591c('0x65')]['id'],_0x12a7c0[_0x591c('0x65')][_0x591c('0x3b')],_0x12a7c0[_0x591c('0x65')][_0x591c('0x6d')],_0x122f9f[_0x591c('0x6b')]['id'],_0x12a7c0[_0x591c('0x5b')]?JSON[_0x591c('0x29')](_0x12a7c0[_0x591c('0x5b')]):_0x591c('0x82'));return respondWithRpcPromise('RejectMessage',_0x591c('0x83'),_0x122f9f);}return null;})[_0x591c('0x23')](function(_0x5e4a98){var _0x1f3017='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x5e4a98[_0x591c('0x2c')]['ContactId'];return db[_0x591c('0x72')][_0x591c('0x44')](_0x1f3017,{'type':db[_0x591c('0x73')][_0x591c('0x84')]['SELECT'],'raw':!![]})[_0x591c('0x23')](function(_0x9f2888){return _0x9f2888;});})['then'](function(_0x208647){if(_0x208647){_0x122f9f[_0x591c('0x2c')]['contact']=_0x208647[0x0];if(!_0x12a7c0[_0x591c('0x5b')]['UserId'])return;return db[_0x591c('0x76')]['find']({'where':{'id':_0x12a7c0[_0x591c('0x5b')][_0x591c('0x64')],'role':_0x591c('0x77')},'attributes':['id',_0x591c('0x3b'),'fullname','email',_0x591c('0x7a')],'raw':!![]});}return null;})[_0x591c('0x23')](function(_0x42a23d){if(!_0x42a23d)return null;_0x122f9f[_0x591c('0x2c')][_0x591c('0x77')]=_0x42a23d;return _0x122f9f;})['then'](function(_0x5ba949){if(_0x5ba949){_0x5ba949[_0x591c('0x2c')]['interface']=util[_0x591c('0x62')]('SIP/%s',_0x12a7c0[_0x591c('0x65')]['name']);_0x5ba949[_0x591c('0x2c')][_0x591c('0x7d')]=_0x122f9f['channel'];_0x5ba949[_0x591c('0x2c')][_0x591c('0x85')]=_0x122f9f[_0x591c('0x7d')];_0x5ba949[_0x591c('0x2c')][_0x591c('0x7e')]='reject';respondWithRpcPromise(_0x591c('0x7f'),'EventManager',{'event':_0x591c('0x86'),'message':_0x5ba949[_0x591c('0x2c')]},client9002);return _0x122f9f;}return null;})[_0x591c('0x23')](respondWithResult(_0xae674e,null))['catch'](handleError(_0xae674e,null));};exports[_0x591c('0x2f')]=function(_0x410ce5,_0x716882,_0x182642){if(_0x410ce5[_0x591c('0x5b')]['id']){delete _0x410ce5[_0x591c('0x5b')]['id'];}var _0x20afe9;return db['WhatsappMessage']['find']({'where':{'id':_0x410ce5[_0x591c('0x57')]['id']}})['then'](handleEntityNotFound(_0x716882,null))['then'](function(_0x5643e9){if(_0x5643e9){_0x20afe9=_0x5643e9;return db[_0x591c('0x87')][_0x591c('0x59')]({'where':{'id':_0x5643e9[_0x591c('0x88')]}});}})[_0x591c('0x23')](handleEntityNotFound(_0x716882,null))[_0x591c('0x23')](function(_0x329f18){if(_0x329f18){logger[_0x591c('0x27')](_0x591c('0x89'),_0x591c('0x2f'),_0x591c('0x8a'),_0x329f18[_0x591c('0x41')],util[_0x591c('0x8b')](_0x410ce5['body'],{'showHidden':![],'depth':null}));switch(_0x329f18['type']){case _0x591c('0x8c'):if(_0x410ce5[_0x591c('0x5b')][_0x591c('0x8d')]&&_0x410ce5[_0x591c('0x5b')][_0x591c('0x8d')]===_0x20afe9[_0x591c('0x8e')]&&_0x410ce5[_0x591c('0x5b')]['MessageStatus']&&_0x410ce5[_0x591c('0x5b')][_0x591c('0x8f')]===_0x591c('0x61')){return _0x20afe9[_0x591c('0x39')]({'read':!![]});}else{logger[_0x591c('0x2a')](_0x591c('0x90'),_0x591c('0x2f'),_0x591c('0x8c'),util['inspect'](_0x410ce5['body'],{'showHidden':![],'depth':null}));}break;}return _0x20afe9;}})[_0x591c('0x23')](respondWithResult(_0x716882,null))['catch'](handleError(_0x716882,null));};
\ No newline at end of file
index 2e7271e..49fd793 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x23a3=['update','remove','emit','hasOwnProperty','exports','setMaxListeners'];(function(_0xd82c81,_0x11ef1b){var _0x17232a=function(_0x1f02c3){while(--_0x1f02c3){_0xd82c81['push'](_0xd82c81['shift']());}};_0x17232a(++_0x11ef1b);}(_0x23a3,0x131));var _0x323a=function(_0x24583b,_0x1b2af9){_0x24583b=_0x24583b-0x0;var _0x477011=_0x23a3[_0x24583b];return _0x477011;};'use strict';var EventEmitter=require('events');var WhatsappMessage=require('../../mysqldb')['db']['WhatsappMessage'];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x323a('0x0')](0x0);var events={'afterCreate':'save','afterUpdate':_0x323a('0x1'),'afterDestroy':_0x323a('0x2')};function emitEvent(_0x122b97){return function(_0x250485,_0x46030e,_0x180066){WhatsappMessageEvents[_0x323a('0x3')](_0x122b97+':'+_0x250485['id'],_0x250485);WhatsappMessageEvents[_0x323a('0x3')](_0x122b97,_0x250485);_0x180066(null);};}for(var e in events){if(events[_0x323a('0x4')](e)){var event=events[e];WhatsappMessage['hook'](e,emitEvent(event));}}module[_0x323a('0x5')]=WhatsappMessageEvents;
\ No newline at end of file
+var _0x351d=['events','WhatsappMessage','setMaxListeners','save','remove','emit','hasOwnProperty','exports'];(function(_0x859a3a,_0x2864cd){var _0x48e4f0=function(_0x2dc3c1){while(--_0x2dc3c1){_0x859a3a['push'](_0x859a3a['shift']());}};_0x48e4f0(++_0x2864cd);}(_0x351d,0x90));var _0xd351=function(_0xdacf14,_0x257a3a){_0xdacf14=_0xdacf14-0x0;var _0x36d2cd=_0x351d[_0xdacf14];return _0x36d2cd;};'use strict';var EventEmitter=require(_0xd351('0x0'));var WhatsappMessage=require('../../mysqldb')['db'][_0xd351('0x1')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0xd351('0x2')](0x0);var events={'afterCreate':_0xd351('0x3'),'afterUpdate':'update','afterDestroy':_0xd351('0x4')};function emitEvent(_0x48f60e){return function(_0x41d16d,_0x151391,_0x49610f){WhatsappMessageEvents[_0xd351('0x5')](_0x48f60e+':'+_0x41d16d['id'],_0x41d16d);WhatsappMessageEvents[_0xd351('0x5')](_0x48f60e,_0x41d16d);_0x49610f(null);};}for(var e in events){if(events[_0xd351('0x6')](e)){var event=events[e];WhatsappMessage['hook'](e,emitEvent(event));}}module[_0xd351('0x7')]=WhatsappMessageEvents;
\ No newline at end of file
index e83a648..88f4eb8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x379e=['then','update','createdAt','catch','WhatsappAccount','find','WhatsappAccountId','type','twilio','authToken','phone','accountSid','messages','create','whatsapp:','remote','/status?token=','token','sid','error','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','baseUrl','/messages/','text','POST','application/json','message_id','err','finally','utf8mb4','lodash','moment','bluebird','request-promise','node-fetch','path','rimraf','../../config/environment','exports','define','WhatsappMessage','messageId','fti_whatsapp_messages','body','FULLTEXT','get','direction','toLowerCase','out','secret','isNil','UserId','WhatsappInteraction','findOne','WhatsappInteractionId'];(function(_0x3bceea,_0x58af75){var _0x30a8d3=function(_0x1550b5){while(--_0x1550b5){_0x3bceea['push'](_0x3bceea['shift']());}};_0x30a8d3(++_0x58af75);}(_0x379e,0x104));var _0xe379=function(_0x437ff1,_0x51cf6f){_0x437ff1=_0x437ff1-0x0;var _0x4956cb=_0x379e[_0x437ff1];return _0x4956cb;};'use strict';var _=require(_0xe379('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xe379('0x1'));var BPromise=require(_0xe379('0x2'));var rp=require(_0xe379('0x3'));var fetch=require(_0xe379('0x4'));var fs=require('fs');var path=require(_0xe379('0x5'));var rimraf=require(_0xe379('0x6'));var config=require(_0xe379('0x7'));var attributes=require('./whatsappMessage.attributes');module[_0xe379('0x8')]=function(_0x24221c,_0x166621){return _0x24221c[_0xe379('0x9')](_0xe379('0xa'),attributes,{'tableName':'whatsapp_messages','paranoid':![],'indexes':[{'name':_0xe379('0xb'),'fields':[_0xe379('0xb')]},{'name':_0xe379('0xc'),'fields':[_0xe379('0xd')],'type':_0xe379('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1a8d3b,_0x10c156,_0x8eb46c){var _0x6c4f40=_0x24221c['models'];var _0x3f7c7c=_0x1a8d3b[_0xe379('0xf')]({'plain':!![]});if(_0x3f7c7c[_0xe379('0x10')][_0xe379('0x11')]()==='in'||_0x3f7c7c['direction']['toLowerCase']()===_0xe379('0x12')&&!_0x3f7c7c[_0xe379('0x13')]&&!_[_0xe379('0x14')](_0x3f7c7c[_0xe379('0x15')])){_0x6c4f40[_0xe379('0x16')][_0xe379('0x17')]({'where':{'id':_0x3f7c7c[_0xe379('0x18')]}})[_0xe379('0x19')](function(_0x48d682){if(_0x48d682){_0x48d682[_0xe379('0x1a')]({'lastMsgAt':_0x3f7c7c[_0xe379('0x1b')],'lastMsgDirection':_0x3f7c7c[_0xe379('0x10')][_0xe379('0x11')]()});}})[_0xe379('0x1c')](function(_0x3fc4a0){console['error'](_0x3fc4a0);});}if(_0x3f7c7c[_0xe379('0x10')]==='out'&&!_0x3f7c7c[_0xe379('0x13')]){var _0x56c11d;_0x6c4f40[_0xe379('0x1d')][_0xe379('0x1e')]({'where':{'id':_0x3f7c7c[_0xe379('0x1f')]},'raw':!![]})[_0xe379('0x19')](function(_0x5e1882){_0x56c11d=_0x5e1882;if(_0x56c11d&&_0x56c11d[_0xe379('0x20')]){switch(_0x56c11d[_0xe379('0x20')]){case _0xe379('0x21'):var _0x2a86d9=require(_0xe379('0x21'));if(_0x56c11d['accountSid']&&_0x56c11d[_0xe379('0x22')]&&_0x56c11d[_0xe379('0x23')]){var _0x58a883=new _0x2a86d9(_0x56c11d[_0xe379('0x24')],_0x56c11d[_0xe379('0x22')]);_0x58a883[_0xe379('0x25')][_0xe379('0x26')]({'body':_0x3f7c7c[_0xe379('0xd')],'to':_0xe379('0x27')+_0x3f7c7c['phone'],'from':_0xe379('0x27')+_0x56c11d[_0xe379('0x23')],'statusCallback':_0x56c11d[_0xe379('0x28')]+'/api/whatsapp/messages/'+_0x3f7c7c['id']+_0xe379('0x29')+_0x56c11d[_0xe379('0x2a')]})['then'](function(_0x1f545f){if(_0x1f545f[_0xe379('0x2b')]){return _0x1a8d3b['update']({'messageId':_0x1f545f['sid']});}})[_0xe379('0x1c')](function(_0x1ce0b9){logger[_0xe379('0x2c')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0xe379('0x2d'),_0xe379('0x21'),util[_0xe379('0x2e')](_0x1ce0b9,{'showHidden':![],'depth':null}));});}else{logger[_0xe379('0x2c')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0xe379('0x2d'),_0xe379('0x21'),_0xe379('0x2f'));}break;case'sinch':var _0x33037d=_0x56c11d[_0xe379('0x24')];var _0x5d9ca1=_0x56c11d[_0xe379('0x22')];var _0x528a44=_0x56c11d[_0xe379('0x30')]+'/whatsapp/v1/'+_0x33037d+_0xe379('0x31');var _0x214a0c={'to':[_0x3f7c7c[_0xe379('0x23')]],'message':{'type':_0xe379('0x32'),'text':_0x3f7c7c[_0xe379('0xd')]}};var _0x14d36b={'method':_0xe379('0x33'),'uri':_0x528a44,'headers':{'Authorization':'Bearer\x20'+_0x5d9ca1,'Content-Type':_0xe379('0x34')},'body':_0x214a0c,'json':!![]};rp(_0x14d36b)[_0xe379('0x19')](function(_0x17396f){if(_0x17396f['statuses'][0x0][_0xe379('0x35')]){return _0x1a8d3b['update']({'messageId':_0x17396f['statuses'][0x0][_0xe379('0x35')]});}})[_0xe379('0x1c')](function(_0x2c773b){logger[_0xe379('0x36')]('WhatsappMessage,\x20%s',_0x2c773b);});break;}}})[_0xe379('0x37')](function(){_0x8eb46c();});}else{_0x8eb46c();}}},'charset':_0xe379('0x38'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x3819=['messages','create','body','whatsapp:','remote','/api/whatsapp/messages/','/status?token=','token','sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','statuses','message_id','err','WhatsappMessage,\x20%s','finally','utf8mb4','utf8mb4_unicode_ci','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./whatsappMessage.attributes','exports','define','WhatsappMessage','messageId','fti_whatsapp_messages','FULLTEXT','models','direction','toLowerCase','secret','isNil','UserId','WhatsappInteraction','then','update','createdAt','catch','error','out','WhatsappAccount','find','type','twilio','accountSid','authToken','phone'];(function(_0x55309e,_0x5f3918){var _0x2eb393=function(_0x2c7971){while(--_0x2c7971){_0x55309e['push'](_0x55309e['shift']());}};_0x2eb393(++_0x5f3918);}(_0x3819,0x83));var _0x9381=function(_0x15419f,_0x415967){_0x15419f=_0x15419f-0x0;var _0x3f7973=_0x3819[_0x15419f];return _0x3f7973;};'use strict';var _=require('lodash');var util=require(_0x9381('0x0'));var logger=require('../../config/logger')(_0x9381('0x1'));var moment=require(_0x9381('0x2'));var BPromise=require(_0x9381('0x3'));var rp=require(_0x9381('0x4'));var fetch=require('node-fetch');var fs=require('fs');var path=require('path');var rimraf=require(_0x9381('0x5'));var config=require(_0x9381('0x6'));var attributes=require(_0x9381('0x7'));module[_0x9381('0x8')]=function(_0x52577f,_0x508d28){return _0x52577f[_0x9381('0x9')](_0x9381('0xa'),attributes,{'tableName':'whatsapp_messages','paranoid':![],'indexes':[{'name':'messageId','fields':[_0x9381('0xb')]},{'name':_0x9381('0xc'),'fields':['body'],'type':_0x9381('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2357d6,_0x3e3443,_0x50b0c3){var _0x507623=_0x52577f[_0x9381('0xe')];var _0x287d41=_0x2357d6['get']({'plain':!![]});if(_0x287d41[_0x9381('0xf')]['toLowerCase']()==='in'||_0x287d41[_0x9381('0xf')][_0x9381('0x10')]()==='out'&&!_0x287d41[_0x9381('0x11')]&&!_[_0x9381('0x12')](_0x287d41[_0x9381('0x13')])){_0x507623[_0x9381('0x14')]['findOne']({'where':{'id':_0x287d41['WhatsappInteractionId']}})[_0x9381('0x15')](function(_0x3f693b){if(_0x3f693b){_0x3f693b[_0x9381('0x16')]({'lastMsgAt':_0x287d41[_0x9381('0x17')],'lastMsgDirection':_0x287d41[_0x9381('0xf')][_0x9381('0x10')]()});}})[_0x9381('0x18')](function(_0x2afb52){console[_0x9381('0x19')](_0x2afb52);});}if(_0x287d41[_0x9381('0xf')]===_0x9381('0x1a')&&!_0x287d41[_0x9381('0x11')]){var _0x57afca;_0x507623[_0x9381('0x1b')][_0x9381('0x1c')]({'where':{'id':_0x287d41['WhatsappAccountId']},'raw':!![]})[_0x9381('0x15')](function(_0x18b7f3){_0x57afca=_0x18b7f3;if(_0x57afca&&_0x57afca[_0x9381('0x1d')]){switch(_0x57afca['type']){case _0x9381('0x1e'):var _0x38ac59=require(_0x9381('0x1e'));if(_0x57afca[_0x9381('0x1f')]&&_0x57afca[_0x9381('0x20')]&&_0x57afca[_0x9381('0x21')]){var _0xead05c=new _0x38ac59(_0x57afca[_0x9381('0x1f')],_0x57afca[_0x9381('0x20')]);_0xead05c[_0x9381('0x22')][_0x9381('0x23')]({'body':_0x287d41[_0x9381('0x24')],'to':_0x9381('0x25')+_0x287d41[_0x9381('0x21')],'from':_0x9381('0x25')+_0x57afca[_0x9381('0x21')],'statusCallback':_0x57afca[_0x9381('0x26')]+_0x9381('0x27')+_0x287d41['id']+_0x9381('0x28')+_0x57afca[_0x9381('0x29')]})[_0x9381('0x15')](function(_0x447551){if(_0x447551[_0x9381('0x2a')]){return _0x2357d6[_0x9381('0x16')]({'messageId':_0x447551[_0x9381('0x2a')]});}})[_0x9381('0x18')](function(_0x23403c){logger['error'](_0x9381('0x2b'),_0x9381('0x2c'),'twilio',util[_0x9381('0x2d')](_0x23403c,{'showHidden':![],'depth':null}));});}else{logger[_0x9381('0x19')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x9381('0x2c'),_0x9381('0x1e'),_0x9381('0x2e'));}break;case _0x9381('0x2f'):var _0x38a14c=_0x57afca['accountSid'];var _0xb8aade=_0x57afca[_0x9381('0x20')];var _0x24bc9c=_0x57afca['baseUrl']+'/whatsapp/v1/'+_0x38a14c+'/messages/';var _0xa79480={'to':[_0x287d41[_0x9381('0x21')]],'message':{'type':'text','text':_0x287d41['body']}};var _0x1e2bdc={'method':'POST','uri':_0x24bc9c,'headers':{'Authorization':'Bearer\x20'+_0xb8aade,'Content-Type':'application/json'},'body':_0xa79480,'json':!![]};rp(_0x1e2bdc)[_0x9381('0x15')](function(_0x5c5af8){if(_0x5c5af8[_0x9381('0x30')][0x0][_0x9381('0x31')]){return _0x2357d6[_0x9381('0x16')]({'messageId':_0x5c5af8[_0x9381('0x30')][0x0][_0x9381('0x31')]});}})[_0x9381('0x18')](function(_0x784942){logger[_0x9381('0x32')](_0x9381('0x33'),_0x784942);});break;}}})[_0x9381('0x34')](function(){_0x50b0c3();});}else{_0x50b0c3();}}},'charset':_0x9381('0x35'),'collate':_0x9381('0x36')});};
\ No newline at end of file
index 9cadb43..09d1d32 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8362=['../../config/logger','../../config/environment','redis','localhost','socket.io-emitter','./whatsappMessage.socket','request','then','info','request\x20sent','debug','stringify','error','code','message','WhatsappMessage,\x20%s,\x20%s','result','catch','CreateWhatsappMessage','WhatsappMessage','create','options','raw','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x310c0a,_0x4ec103){var _0x599109=function(_0x18a58b){while(--_0x18a58b){_0x310c0a['push'](_0x310c0a['shift']());}};_0x599109(++_0x4ec103);}(_0x8362,0x113));var _0x2836=function(_0x1f8553,_0x187ed9){_0x1f8553=_0x1f8553-0x0;var _0xe1de71=_0x8362[_0x1f8553];return _0xe1de71;};'use strict';var _=require('lodash');var util=require(_0x2836('0x0'));var moment=require(_0x2836('0x1'));var BPromise=require(_0x2836('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2836('0x3'));var db=require(_0x2836('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x2836('0x5'))('rpc');var config=require(_0x2836('0x6'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config['redis']=_['defaults'](config[_0x2836('0x7')],{'host':_0x2836('0x8'),'port':0x18eb});var socket=require(_0x2836('0x9'))(new Redis(config[_0x2836('0x7')]));require(_0x2836('0xa'))['register'](socket);function respondWithRpcPromise(_0x2c27b5,_0x3af614,_0x10f0d3){return new BPromise(function(_0x39fdf6,_0x10d555){return client[_0x2836('0xb')](_0x2c27b5,_0x10f0d3)[_0x2836('0xc')](function(_0x2f81ee){logger[_0x2836('0xd')]('WhatsappMessage,\x20%s,\x20%s',_0x3af614,_0x2836('0xe'));logger[_0x2836('0xf')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x3af614,_0x2836('0xe'),JSON[_0x2836('0x10')](_0x2f81ee));if(_0x2f81ee[_0x2836('0x11')]){if(_0x2f81ee[_0x2836('0x11')][_0x2836('0x12')]===0x1f4){logger['error']('WhatsappMessage,\x20%s,\x20%s',_0x3af614,_0x2f81ee[_0x2836('0x11')][_0x2836('0x13')]);return _0x10d555(_0x2f81ee[_0x2836('0x11')]['message']);}logger[_0x2836('0x11')]('WhatsappMessage,\x20%s,\x20%s',_0x3af614,_0x2f81ee[_0x2836('0x11')][_0x2836('0x13')]);return _0x39fdf6(_0x2f81ee['error'][_0x2836('0x13')]);}else{logger['info'](_0x2836('0x14'),_0x3af614,'request\x20sent');_0x39fdf6(_0x2f81ee[_0x2836('0x15')][_0x2836('0x13')]);}})[_0x2836('0x16')](function(_0x52794c){logger['error']('WhatsappMessage,\x20%s,\x20%s',_0x3af614,_0x52794c);_0x10d555(_0x52794c);});});}exports[_0x2836('0x17')]=function(_0x17d94c){var _0x5012ff=this;return new Promise(function(_0x46ee92,_0x3c7376){return db[_0x2836('0x18')][_0x2836('0x19')](_0x17d94c['body'],{'raw':_0x17d94c[_0x2836('0x1a')]?_0x17d94c[_0x2836('0x1a')][_0x2836('0x1b')]===undefined?!![]:![]:!![]})[_0x2836('0xc')](function(_0x188ecb){logger[_0x2836('0xd')]('CreateWhatsappMessage',_0x17d94c);logger['debug'](_0x2836('0x17'),_0x17d94c,JSON['stringify'](_0x188ecb));_0x46ee92(_0x188ecb);})['catch'](function(_0x1241b8){logger[_0x2836('0x11')]('CreateWhatsappMessage',_0x1241b8['message'],_0x17d94c);_0x3c7376(_0x5012ff[_0x2836('0x11')](0x1f4,_0x1241b8[_0x2836('0x13')]));});});};
\ No newline at end of file
+var _0xe116=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','request','then','info','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappMessage,\x20%s,\x20%s','message','result','CreateWhatsappMessage','create','body','options','raw','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x29de96,_0x42cc38){var _0x1b9352=function(_0x4a288a){while(--_0x4a288a){_0x29de96['push'](_0x29de96['shift']());}};_0x1b9352(++_0x42cc38);}(_0xe116,0x1c2));var _0x6e11=function(_0x166983,_0x3da258){_0x166983=_0x166983-0x0;var _0x5b6366=_0xe116[_0x166983];return _0x5b6366;};'use strict';var _=require(_0x6e11('0x0'));var util=require(_0x6e11('0x1'));var moment=require(_0x6e11('0x2'));var BPromise=require(_0x6e11('0x3'));var rs=require(_0x6e11('0x4'));var fs=require('fs');var Redis=require(_0x6e11('0x5'));var db=require(_0x6e11('0x6'))['db'];var utils=require(_0x6e11('0x7'));var logger=require(_0x6e11('0x8'))('rpc');var config=require(_0x6e11('0x9'));var jayson=require(_0x6e11('0xa'));var client=jayson[_0x6e11('0xb')]['http']({'port':0x232a});config[_0x6e11('0xc')]=_[_0x6e11('0xd')](config['redis'],{'host':_0x6e11('0xe'),'port':0x18eb});var socket=require(_0x6e11('0xf'))(new Redis(config['redis']));require(_0x6e11('0x10'))['register'](socket);function respondWithRpcPromise(_0x21cf96,_0x2dd58f,_0x422006){return new BPromise(function(_0x15b361,_0x3c64df){return client[_0x6e11('0x11')](_0x21cf96,_0x422006)[_0x6e11('0x12')](function(_0x55346b){logger[_0x6e11('0x13')]('WhatsappMessage,\x20%s,\x20%s',_0x2dd58f,_0x6e11('0x14'));logger[_0x6e11('0x15')](_0x6e11('0x16'),_0x2dd58f,_0x6e11('0x14'),JSON[_0x6e11('0x17')](_0x55346b));if(_0x55346b[_0x6e11('0x18')]){if(_0x55346b['error'][_0x6e11('0x19')]===0x1f4){logger[_0x6e11('0x18')](_0x6e11('0x1a'),_0x2dd58f,_0x55346b[_0x6e11('0x18')][_0x6e11('0x1b')]);return _0x3c64df(_0x55346b[_0x6e11('0x18')][_0x6e11('0x1b')]);}logger[_0x6e11('0x18')]('WhatsappMessage,\x20%s,\x20%s',_0x2dd58f,_0x55346b['error'][_0x6e11('0x1b')]);return _0x15b361(_0x55346b[_0x6e11('0x18')]['message']);}else{logger['info'](_0x6e11('0x1a'),_0x2dd58f,_0x6e11('0x14'));_0x15b361(_0x55346b[_0x6e11('0x1c')][_0x6e11('0x1b')]);}})['catch'](function(_0xfb57eb){logger[_0x6e11('0x18')](_0x6e11('0x1a'),_0x2dd58f,_0xfb57eb);_0x3c64df(_0xfb57eb);});});}exports[_0x6e11('0x1d')]=function(_0xcf7de5){var _0x43b12f=this;return new Promise(function(_0x19be6d,_0x3d89e4){return db['WhatsappMessage'][_0x6e11('0x1e')](_0xcf7de5[_0x6e11('0x1f')],{'raw':_0xcf7de5[_0x6e11('0x20')]?_0xcf7de5[_0x6e11('0x20')][_0x6e11('0x21')]===undefined?!![]:![]:!![]})[_0x6e11('0x12')](function(_0x3fb0de){logger[_0x6e11('0x13')](_0x6e11('0x1d'),_0xcf7de5);logger[_0x6e11('0x15')](_0x6e11('0x1d'),_0xcf7de5,JSON['stringify'](_0x3fb0de));_0x19be6d(_0x3fb0de);})[_0x6e11('0x22')](function(_0x16279d){logger['error'](_0x6e11('0x1d'),_0x16279d[_0x6e11('0x1b')],_0xcf7de5);_0x3d89e4(_0x43b12f[_0x6e11('0x18')](0x1f4,_0x16279d[_0x6e11('0x1b')]));});});};
\ No newline at end of file
index 1982956..bc203ea 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9d64=['save','remove','update','emit','removeListener','length','./whatsappMessage.events'];(function(_0x14e9f0,_0x287f90){var _0xa63f7e=function(_0x4829d6){while(--_0x4829d6){_0x14e9f0['push'](_0x14e9f0['shift']());}};_0xa63f7e(++_0x287f90);}(_0x9d64,0x19c));var _0x49d6=function(_0x2aa56f,_0x5b85ea){_0x2aa56f=_0x2aa56f-0x0;var _0x58934e=_0x9d64[_0x2aa56f];return _0x58934e;};'use strict';var WhatsappMessageEvents=require(_0x49d6('0x0'));var events=[_0x49d6('0x1'),_0x49d6('0x2'),_0x49d6('0x3')];function createListener(_0x1f6770,_0x109a44){return function(_0x3bbe8e){_0x109a44[_0x49d6('0x4')](_0x1f6770,_0x3bbe8e);};}function removeListener(_0x1f2923,_0x1a2d13){return function(){WhatsappMessageEvents[_0x49d6('0x5')](_0x1f2923,_0x1a2d13);};}exports['register']=function(_0x2bb8ae){for(var _0x20e2ef=0x0,_0x4a4817=events[_0x49d6('0x6')];_0x20e2ef<_0x4a4817;_0x20e2ef++){var _0x1347e3=events[_0x20e2ef];var _0x250d2e=createListener('whatsappMessage:'+_0x1347e3,_0x2bb8ae);WhatsappMessageEvents['on'](_0x1347e3,_0x250d2e);}};
\ No newline at end of file
+var _0x367b=['./whatsappMessage.events','remove','update','emit','register','length','whatsappMessage:'];(function(_0x443984,_0x51a94f){var _0x44b14e=function(_0x5a5ff8){while(--_0x5a5ff8){_0x443984['push'](_0x443984['shift']());}};_0x44b14e(++_0x51a94f);}(_0x367b,0x1b9));var _0xb367=function(_0x32ad79,_0x3540de){_0x32ad79=_0x32ad79-0x0;var _0x22a942=_0x367b[_0x32ad79];return _0x22a942;};'use strict';var WhatsappMessageEvents=require(_0xb367('0x0'));var events=['save',_0xb367('0x1'),_0xb367('0x2')];function createListener(_0x1cb16e,_0x55629a){return function(_0x28fc05){_0x55629a[_0xb367('0x3')](_0x1cb16e,_0x28fc05);};}function removeListener(_0x5147ba,_0x459d80){return function(){WhatsappMessageEvents['removeListener'](_0x5147ba,_0x459d80);};}exports[_0xb367('0x4')]=function(_0x595b55){for(var _0x14bbfc=0x0,_0x355ad8=events[_0xb367('0x5')];_0x14bbfc<_0x355ad8;_0x14bbfc++){var _0x32ef96=events[_0x14bbfc];var _0x12b99a=createListener(_0xb367('0x6')+_0x32ef96,_0x595b55);WhatsappMessageEvents['on'](_0x32ef96,_0x12b99a);}};
\ No newline at end of file
index d2c13a6..a3dfde6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x09b9=['../../config/environment','./whatsappQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','/:id/teams','/:id/users','getAgents','post','addAgents','put','destroy','removeTeams','delete','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0xdeefbd,_0x9e1b3d){var _0x4ff63f=function(_0x4b51f9){while(--_0x4b51f9){_0xdeefbd['push'](_0xdeefbd['shift']());}};_0x4ff63f(++_0x9e1b3d);}(_0x09b9,0x17d));var _0x909b=function(_0x353cdd,_0x3f2bea){_0x353cdd=_0x353cdd-0x0;var _0x3739d9=_0x09b9[_0x353cdd];return _0x3739d9;};'use strict';var multer=require(_0x909b('0x0'));var util=require(_0x909b('0x1'));var path=require(_0x909b('0x2'));var timeout=require(_0x909b('0x3'));var express=require(_0x909b('0x4'));var router=express[_0x909b('0x5')]();var fs_extra=require(_0x909b('0x6'));var auth=require(_0x909b('0x7'));var interaction=require(_0x909b('0x8'));var config=require(_0x909b('0x9'));var controller=require(_0x909b('0xa'));router[_0x909b('0xb')]('/',auth[_0x909b('0xc')](),controller[_0x909b('0xd')]);router['get'](_0x909b('0xe'),auth[_0x909b('0xc')](),controller[_0x909b('0xf')]);router[_0x909b('0xb')](_0x909b('0x10'),auth[_0x909b('0xc')](),controller[_0x909b('0x11')]);router[_0x909b('0xb')](_0x909b('0x12'),auth['isAuthenticated'](),controller['getMembers']);router[_0x909b('0xb')](_0x909b('0x13'),auth[_0x909b('0xc')](),controller['getTeams']);router[_0x909b('0xb')](_0x909b('0x14'),auth[_0x909b('0xc')](),controller[_0x909b('0x15')]);router['post']('/',auth[_0x909b('0xc')](),controller['create']);router[_0x909b('0x16')]('/:id/teams',auth[_0x909b('0xc')](),controller['addTeams']);router[_0x909b('0x16')]('/:id/users',auth[_0x909b('0xc')](),controller[_0x909b('0x17')]);router[_0x909b('0x18')]('/:id',auth[_0x909b('0xc')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x909b('0x19')]);router['delete']('/:id/teams',auth[_0x909b('0xc')](),controller[_0x909b('0x1a')]);router[_0x909b('0x1b')](_0x909b('0x14'),auth[_0x909b('0xc')](),controller[_0x909b('0x1c')]);module[_0x909b('0x1d')]=router;
\ No newline at end of file
+var _0x4fdb=['index','/describe','isAuthenticated','describe','/:id','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post','create','addTeams','addAgents','put','destroy','delete','removeTeams','removeAgents','multer','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./whatsappQueue.controller','get'];(function(_0x1d4262,_0x27781b){var _0x1faf63=function(_0x5a9ae4){while(--_0x5a9ae4){_0x1d4262['push'](_0x1d4262['shift']());}};_0x1faf63(++_0x27781b);}(_0x4fdb,0x1a8));var _0xb4fd=function(_0x524760,_0x154745){_0x524760=_0x524760-0x0;var _0x55d019=_0x4fdb[_0x524760];return _0x55d019;};'use strict';var multer=require(_0xb4fd('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xb4fd('0x1'));var express=require(_0xb4fd('0x2'));var router=express[_0xb4fd('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xb4fd('0x4'));var config=require(_0xb4fd('0x5'));var controller=require(_0xb4fd('0x6'));router[_0xb4fd('0x7')]('/',auth['isAuthenticated'](),controller[_0xb4fd('0x8')]);router[_0xb4fd('0x7')](_0xb4fd('0x9'),auth[_0xb4fd('0xa')](),controller[_0xb4fd('0xb')]);router[_0xb4fd('0x7')](_0xb4fd('0xc'),auth[_0xb4fd('0xa')](),controller['show']);router[_0xb4fd('0x7')](_0xb4fd('0xd'),auth[_0xb4fd('0xa')](),controller[_0xb4fd('0xe')]);router[_0xb4fd('0x7')](_0xb4fd('0xf'),auth[_0xb4fd('0xa')](),controller[_0xb4fd('0x10')]);router[_0xb4fd('0x7')](_0xb4fd('0x11'),auth[_0xb4fd('0xa')](),controller['getAgents']);router[_0xb4fd('0x12')]('/',auth[_0xb4fd('0xa')](),controller[_0xb4fd('0x13')]);router[_0xb4fd('0x12')]('/:id/teams',auth[_0xb4fd('0xa')](),controller[_0xb4fd('0x14')]);router[_0xb4fd('0x12')](_0xb4fd('0x11'),auth[_0xb4fd('0xa')](),controller[_0xb4fd('0x15')]);router[_0xb4fd('0x16')](_0xb4fd('0xc'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xb4fd('0xc'),auth['isAuthenticated'](),controller[_0xb4fd('0x17')]);router[_0xb4fd('0x18')](_0xb4fd('0xf'),auth['isAuthenticated'](),controller[_0xb4fd('0x19')]);router['delete']('/:id/users',auth[_0xb4fd('0xa')](),controller[_0xb4fd('0x1a')]);module['exports']=router;
\ No newline at end of file
index 6ebb4ed..53bea00 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe74e=['beepall','roundrobin','exports','STRING','name','INTEGER','ENUM','rrmemory'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0xe74e,0x10a));var _0xee74=function(_0x597976,_0x554d6a){_0x597976=_0x597976-0x0;var _0x343437=_0xe74e[_0x597976];return _0x343437;};'use strict';var Sequelize=require('sequelize');module[_0xee74('0x0')]={'name':{'type':Sequelize[_0xee74('0x1')],'unique':_0xee74('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0xee74('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xee74('0x4')](_0xee74('0x5'),_0xee74('0x6'),_0xee74('0x7'))},'description':{'type':Sequelize[_0xee74('0x1')]}};
\ No newline at end of file
+var _0x9434=['sequelize','exports','STRING','name','INTEGER','ENUM','beepall','roundrobin'];(function(_0x2afc6c,_0x37986b){var _0x1fa040=function(_0x1aa9b5){while(--_0x1aa9b5){_0x2afc6c['push'](_0x2afc6c['shift']());}};_0x1fa040(++_0x37986b);}(_0x9434,0x168));var _0x4943=function(_0x1d83cb,_0x48a8f9){_0x1d83cb=_0x1d83cb-0x0;var _0x165101=_0x9434[_0x1d83cb];return _0x165101;};'use strict';var Sequelize=require(_0x4943('0x0'));module[_0x4943('0x1')]={'name':{'type':Sequelize[_0x4943('0x2')],'unique':_0x4943('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x4943('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x4943('0x5')]('rrmemory',_0x4943('0x6'),_0x4943('0x7'))},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 8e765bc..f38250f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbeb7=['pick','WhatsappQueueId','options','User','findAndCountAll','UserId','agent','whatsappPause','updatedAt','createdAt','getTeams','addTeams','ids','Team','online','voicePause','Agents','sequelize','transaction','each','findOrCreate','forEach','emit','userWhatsappQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_whatsapp_queues','join','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','TeamId','all','union','isEmpty','removeAgents','addAgents','omit','spread','isArray','userWhatsappQueue:remove','getAgents','eml-format','rimraf','zip-dir','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','sendStatus','end','status','offset','limit','undefined','count','Content-Range','json','save','update','destroy','then','get','UserProfileResource','name','send','index','WhatsappQueue','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','includeAll','include','findAll','rows','catch','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','WhatsappQueues','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','findOne','UserWhatsappQueue'];(function(_0x4ba425,_0x181dc5){var _0x4a7b61=function(_0x1defd5){while(--_0x1defd5){_0x4ba425['push'](_0x4ba425['shift']());}};_0x4a7b61(++_0x181dc5);}(_0xbeb7,0x13e));var _0x7beb=function(_0x3710b1,_0x3eefb1){_0x3710b1=_0x3710b1-0x0;var _0x237c02=_0xbeb7[_0x3710b1];return _0x237c02;};'use strict';var emlformat=require(_0x7beb('0x0'));var rimraf=require(_0x7beb('0x1'));var zipdir=require(_0x7beb('0x2'));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(_0x7beb('0x3'));var path=require(_0x7beb('0x4'));var sox=require(_0x7beb('0x5'));var csv=require(_0x7beb('0x6'));var ejs=require(_0x7beb('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7beb('0x8'));var squel=require('squel');var crypto=require(_0x7beb('0x9'));var jsforce=require(_0x7beb('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x7beb('0x6'));var querystring=require(_0x7beb('0xb'));var Papa=require(_0x7beb('0xc'));var Redis=require(_0x7beb('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x7beb('0xe'));var as=require(_0x7beb('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7beb('0x10'))('api');var utils=require(_0x7beb('0x11'));var config=require(_0x7beb('0x12'));var licenseUtil=require(_0x7beb('0x13'));var db=require('../../mysqldb')['db'];config[_0x7beb('0x14')]=_[_0x7beb('0x15')](config[_0x7beb('0x14')],{'host':'localhost','port':0x18eb});var socket=require(_0x7beb('0x16'))(new Redis(config[_0x7beb('0x14')]));require('./whatsappQueue.socket')['register'](socket);function respondWithStatusCode(_0x12d206,_0xc252af){_0xc252af=_0xc252af||0xcc;return function(_0x19a41c){if(_0x19a41c){return _0x12d206[_0x7beb('0x17')](_0xc252af);}return _0x12d206['status'](_0xc252af)[_0x7beb('0x18')]();};}function respondWithResult(_0x24d1fc,_0x3c56b6){_0x3c56b6=_0x3c56b6||0xc8;return function(_0x1e2ea1){if(_0x1e2ea1){return _0x24d1fc[_0x7beb('0x19')](_0x3c56b6)['json'](_0x1e2ea1);}};}function respondWithFilteredResult(_0x1b342c,_0x386c28){return function(_0x1c3578){if(_0x1c3578){var _0x1fd9e3=typeof _0x386c28[_0x7beb('0x1a')]==='undefined'&&typeof _0x386c28[_0x7beb('0x1b')]===_0x7beb('0x1c');var _0x55bd70=_0x1c3578[_0x7beb('0x1d')];var _0x46ee01=_0x1fd9e3?0x0:_0x386c28[_0x7beb('0x1a')];var _0x2912e8=_0x1fd9e3?_0x1c3578[_0x7beb('0x1d')]:_0x386c28[_0x7beb('0x1a')]+_0x386c28['limit'];var _0xdc78fc;if(_0x2912e8>=_0x55bd70){_0x2912e8=_0x55bd70;_0xdc78fc=0xc8;}else{_0xdc78fc=0xce;}_0x1b342c[_0x7beb('0x19')](_0xdc78fc);return _0x1b342c['set'](_0x7beb('0x1e'),_0x46ee01+'-'+_0x2912e8+'/'+_0x55bd70)[_0x7beb('0x1f')](_0x1c3578);}return null;};}function patchUpdates(_0x30cce1){return function(_0x5361f2){try{jsonpatch['apply'](_0x5361f2,_0x30cce1,!![]);}catch(_0x411106){return BPromise['reject'](_0x411106);}return _0x5361f2[_0x7beb('0x20')]();};}function saveUpdates(_0x5bb0f2,_0xe0bb3b){return function(_0x36e638){if(_0x36e638){return _0x36e638[_0x7beb('0x21')](_0x5bb0f2)['then'](function(_0x1468fb){return _0x1468fb;});}return null;};}function removeEntity(_0x6abdf6,_0x2b964d){return function(_0x37d9ca){if(_0x37d9ca){return _0x37d9ca[_0x7beb('0x22')]()[_0x7beb('0x23')](function(){var _0x650d75=_0x37d9ca[_0x7beb('0x24')]({'plain':!![]});var _0x35ea69='WhatsappQueues';return db[_0x7beb('0x25')][_0x7beb('0x22')]({'where':{'type':_0x35ea69,'resourceId':_0x650d75['id']}})[_0x7beb('0x23')](function(){return _0x37d9ca;});})[_0x7beb('0x23')](function(){_0x6abdf6[_0x7beb('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x14b927,_0x5e94a1){return function(_0xec824f){if(!_0xec824f){_0x14b927[_0x7beb('0x17')](0x194);}return _0xec824f;};}function handleError(_0x29199d,_0x4076ee){_0x4076ee=_0x4076ee||0x1f4;return function(_0x5da55b){logger['error'](_0x5da55b['stack']);if(_0x5da55b[_0x7beb('0x26')]){delete _0x5da55b[_0x7beb('0x26')];}_0x29199d['status'](_0x4076ee)[_0x7beb('0x27')](_0x5da55b);};}exports[_0x7beb('0x28')]=function(_0x505902,_0xdeb71b){var _0x3059d8={},_0x5064a7={},_0x53d1dc={'count':0x0,'rows':[]};var _0xa248ab=_['map'](db[_0x7beb('0x29')][_0x7beb('0x2a')],function(_0x4ce5e2){return{'name':_0x4ce5e2[_0x7beb('0x2b')],'type':_0x4ce5e2[_0x7beb('0x2c')][_0x7beb('0x2d')]};});_0x5064a7[_0x7beb('0x2e')]=_[_0x7beb('0x2f')](_0xa248ab,_0x7beb('0x26'));_0x5064a7[_0x7beb('0x30')]=_['keys'](_0x505902[_0x7beb('0x30')]);_0x5064a7[_0x7beb('0x31')]=_[_0x7beb('0x32')](_0x5064a7[_0x7beb('0x2e')],_0x5064a7[_0x7beb('0x30')]);_0x3059d8[_0x7beb('0x33')]=_[_0x7beb('0x32')](_0x5064a7[_0x7beb('0x2e')],qs[_0x7beb('0x34')](_0x505902[_0x7beb('0x30')][_0x7beb('0x34')]));_0x3059d8['attributes']=_0x3059d8['attributes'][_0x7beb('0x35')]?_0x3059d8[_0x7beb('0x33')]:_0x5064a7[_0x7beb('0x2e')];if(!_0x505902[_0x7beb('0x30')][_0x7beb('0x36')](_0x7beb('0x37'))){_0x3059d8[_0x7beb('0x1b')]=qs[_0x7beb('0x1b')](_0x505902['query'][_0x7beb('0x1b')]);_0x3059d8[_0x7beb('0x1a')]=qs[_0x7beb('0x1a')](_0x505902['query'][_0x7beb('0x1a')]);}_0x3059d8[_0x7beb('0x38')]=qs[_0x7beb('0x39')](_0x505902['query'][_0x7beb('0x39')]);_0x3059d8[_0x7beb('0x3a')]=qs[_0x7beb('0x31')](_['pick'](_0x505902[_0x7beb('0x30')],_0x5064a7[_0x7beb('0x31')]),_0xa248ab);if(_0x505902[_0x7beb('0x30')]['filter']){_0x3059d8['where']=_[_0x7beb('0x3b')](_0x3059d8[_0x7beb('0x3a')],{'$or':_[_0x7beb('0x2f')](_0xa248ab,function(_0x204009){if(_0x204009['type']!==_0x7beb('0x3c')){var _0x3664b8={};_0x3664b8[_0x204009[_0x7beb('0x26')]]={'$like':'%'+_0x505902[_0x7beb('0x30')][_0x7beb('0x3d')]+'%'};return _0x3664b8;}})});}_0x3059d8=_['merge']({},_0x3059d8,_0x505902['options']);var _0x55f051={'where':_0x3059d8[_0x7beb('0x3a')]};return db['WhatsappQueue'][_0x7beb('0x1d')](_0x55f051)['then'](function(_0x971625){_0x53d1dc['count']=_0x971625;if(_0x505902[_0x7beb('0x30')][_0x7beb('0x3e')]){_0x3059d8[_0x7beb('0x3f')]=[{'all':!![]}];}return db['WhatsappQueue'][_0x7beb('0x40')](_0x3059d8);})[_0x7beb('0x23')](function(_0x4e4765){_0x53d1dc[_0x7beb('0x41')]=_0x4e4765;return _0x53d1dc;})[_0x7beb('0x23')](respondWithFilteredResult(_0xdeb71b,_0x3059d8))[_0x7beb('0x42')](handleError(_0xdeb71b,null));};exports['show']=function(_0x52c5ae,_0x292505){var _0x52bec4={'raw':!![],'where':{'id':_0x52c5ae['params']['id']}},_0x5f58e0={};_0x5f58e0[_0x7beb('0x2e')]=_['keys'](db[_0x7beb('0x29')][_0x7beb('0x2a')]);_0x5f58e0[_0x7beb('0x30')]=_[_0x7beb('0x43')](_0x52c5ae[_0x7beb('0x30')]);_0x5f58e0[_0x7beb('0x31')]=_[_0x7beb('0x32')](_0x5f58e0[_0x7beb('0x2e')],_0x5f58e0[_0x7beb('0x30')]);_0x52bec4['attributes']=_[_0x7beb('0x32')](_0x5f58e0['model'],qs['fields'](_0x52c5ae[_0x7beb('0x30')][_0x7beb('0x34')]));_0x52bec4[_0x7beb('0x33')]=_0x52bec4[_0x7beb('0x33')][_0x7beb('0x35')]?_0x52bec4[_0x7beb('0x33')]:_0x5f58e0[_0x7beb('0x2e')];if(_0x52c5ae['query']['includeAll']){_0x52bec4['include']=[{'all':!![]}];}_0x52bec4=_[_0x7beb('0x3b')]({},_0x52bec4,_0x52c5ae['options']);return db[_0x7beb('0x29')][_0x7beb('0x44')](_0x52bec4)[_0x7beb('0x23')](handleEntityNotFound(_0x292505,null))[_0x7beb('0x23')](respondWithResult(_0x292505,null))['catch'](handleError(_0x292505,null));};exports[_0x7beb('0x45')]=function(_0x20d297,_0x483b8e){return db[_0x7beb('0x29')][_0x7beb('0x45')](_0x20d297[_0x7beb('0x46')],{})['then'](function(_0x4412e9){var _0x2270d8=_0x20d297[_0x7beb('0x47')][_0x7beb('0x24')]({'plain':!![]});if(!_0x2270d8)throw new Error(_0x7beb('0x48'));if(_0x2270d8[_0x7beb('0x49')]===_0x7beb('0x47')){var _0x32c0f6=_0x4412e9[_0x7beb('0x24')]({'plain':!![]});var _0x47ae3b=_0x7beb('0x4a');return db[_0x7beb('0x4b')]['find']({'where':{'name':_0x47ae3b,'userProfileId':_0x2270d8[_0x7beb('0x4c')]},'raw':!![]})['then'](function(_0x3bb5cd){if(_0x3bb5cd&&_0x3bb5cd['autoAssociation']===0x0){return db[_0x7beb('0x25')][_0x7beb('0x45')]({'name':_0x32c0f6[_0x7beb('0x26')],'resourceId':_0x32c0f6['id'],'type':_0x3bb5cd[_0x7beb('0x26')],'sectionId':_0x3bb5cd['id']},{})[_0x7beb('0x23')](function(){return _0x4412e9;});}else{return _0x4412e9;}})[_0x7beb('0x42')](function(_0x257833){logger[_0x7beb('0x4d')](_0x7beb('0x4e'),_0x257833);throw _0x257833;});}return _0x4412e9;})[_0x7beb('0x23')](respondWithResult(_0x483b8e,0xc9))[_0x7beb('0x42')](handleError(_0x483b8e,null));};exports[_0x7beb('0x21')]=function(_0x511302,_0x4cfd8c){if(_0x511302[_0x7beb('0x46')]['id']){delete _0x511302[_0x7beb('0x46')]['id'];}return db[_0x7beb('0x29')][_0x7beb('0x44')]({'where':{'id':_0x511302[_0x7beb('0x4f')]['id']}})[_0x7beb('0x23')](handleEntityNotFound(_0x4cfd8c,null))[_0x7beb('0x23')](saveUpdates(_0x511302[_0x7beb('0x46')],null))[_0x7beb('0x23')](respondWithResult(_0x4cfd8c,null))[_0x7beb('0x42')](handleError(_0x4cfd8c,null));};exports['destroy']=function(_0x3cf8dd,_0x41fb66){return db['WhatsappQueue'][_0x7beb('0x44')]({'where':{'id':_0x3cf8dd[_0x7beb('0x4f')]['id']}})[_0x7beb('0x23')](handleEntityNotFound(_0x41fb66,null))[_0x7beb('0x23')](removeEntity(_0x41fb66,null))[_0x7beb('0x42')](handleError(_0x41fb66,null));};exports['describe']=function(_0x2b2f19,_0x230997){return db[_0x7beb('0x29')][_0x7beb('0x50')]()[_0x7beb('0x23')](respondWithResult(_0x230997,null))[_0x7beb('0x42')](handleError(_0x230997,null));};exports[_0x7beb('0x51')]=function(_0x3c4c35,_0xbb359e,_0x2f99c6){var _0x2eb140={'raw':!![],'where':{}},_0x2ac7cc={},_0x1f2684;return db['WhatsappQueue'][_0x7beb('0x52')]({'where':{'id':_0x3c4c35[_0x7beb('0x4f')]['id']}})[_0x7beb('0x23')](handleEntityNotFound(_0xbb359e,null))[_0x7beb('0x23')](function(_0x4e8535){if(_0x4e8535){_0x1f2684=_0x4e8535['get']({'plain':!![]});_0x2ac7cc[_0x7beb('0x2e')]=_[_0x7beb('0x43')](db[_0x7beb('0x53')][_0x7beb('0x2a')]);_0x2ac7cc[_0x7beb('0x30')]=_['keys'](_0x3c4c35[_0x7beb('0x30')]);_0x2ac7cc[_0x7beb('0x31')]=_[_0x7beb('0x32')](_0x2ac7cc[_0x7beb('0x2e')],_0x2ac7cc[_0x7beb('0x30')]);_0x2eb140[_0x7beb('0x33')]=_['intersection'](_0x2ac7cc[_0x7beb('0x2e')],qs[_0x7beb('0x34')](_0x3c4c35[_0x7beb('0x30')][_0x7beb('0x34')]));_0x2eb140[_0x7beb('0x33')]=_0x2eb140[_0x7beb('0x33')][_0x7beb('0x35')]?_0x2eb140[_0x7beb('0x33')]:_0x2ac7cc['model'];if(!_0x3c4c35[_0x7beb('0x30')][_0x7beb('0x36')]('nolimit')){_0x2eb140[_0x7beb('0x1b')]=qs[_0x7beb('0x1b')](_0x3c4c35[_0x7beb('0x30')][_0x7beb('0x1b')]);_0x2eb140[_0x7beb('0x1a')]=qs[_0x7beb('0x1a')](_0x3c4c35['query']['offset']);}_0x2eb140['order']=qs['sort'](_0x3c4c35['query'][_0x7beb('0x39')]);_0x2eb140['where']=qs[_0x7beb('0x31')](_[_0x7beb('0x54')](_0x3c4c35['query'],_0x2ac7cc['filters']));_0x2eb140['where'][_0x7beb('0x55')]=_0x4e8535['id'];if(_0x3c4c35[_0x7beb('0x30')]['filter']){_0x2eb140['where']=_[_0x7beb('0x3b')](_0x2eb140[_0x7beb('0x3a')],{'$or':_['map'](_0x2eb140[_0x7beb('0x33')],function(_0x5bbfb5){var _0x74a17={};_0x74a17[_0x5bbfb5]={'$like':'%'+_0x3c4c35[_0x7beb('0x30')][_0x7beb('0x3d')]+'%'};return _0x74a17;})});}_0x2eb140=_[_0x7beb('0x3b')]({},_0x2eb140,_0x3c4c35[_0x7beb('0x56')]);return db[_0x7beb('0x53')][_0x7beb('0x40')](_0x2eb140);}})[_0x7beb('0x23')](function(_0x12c863){if(_0x12c863){return db[_0x7beb('0x57')][_0x7beb('0x58')]({'where':{'id':_[_0x7beb('0x2f')](_0x12c863,_0x7beb('0x59')),'role':_0x7beb('0x5a')},'attributes':['id','name',_0x7beb('0x5b'),_0x7beb('0x5c'),_0x7beb('0x5d')]});}})[_0x7beb('0x23')](function(_0x29680d){if(_0x29680d){return{'count':_0x29680d[_0x7beb('0x1d')],'rows':_[_0x7beb('0x2f')](_0x29680d[_0x7beb('0x41')],function(_0xd2bdf){return{'membername':_0xd2bdf[_0x7beb('0x26')],'UserId':_0xd2bdf['id'],'queue_name':_0x1f2684[_0x7beb('0x26')],'WhatsappQueueId':_0x1f2684['id'],'interface':util['format']('%s/%s','SIP',_0xd2bdf['name']),'penalty':0x0,'paused':_0xd2bdf[_0x7beb('0x5b')],'createdAt':_0xd2bdf['createdAt'],'updatedAt':_0xd2bdf[_0x7beb('0x5c')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x7beb('0x23')](respondWithFilteredResult(_0xbb359e,_0x2eb140))[_0x7beb('0x42')](handleError(_0xbb359e,null));};exports[_0x7beb('0x5e')]=function(_0x398e1b,_0x8bc21b,_0x49f267){var _0x52cdaa={};var _0x260a81={};var _0x15fc88;var _0x5a638c;return db[_0x7beb('0x29')][_0x7beb('0x52')]({'where':{'id':_0x398e1b['params']['id']}})[_0x7beb('0x23')](handleEntityNotFound(_0x8bc21b,null))[_0x7beb('0x23')](function(_0xe3e9e8){if(_0xe3e9e8){_0x15fc88=_0xe3e9e8;_0x260a81[_0x7beb('0x2e')]=_[_0x7beb('0x43')](db['Team'][_0x7beb('0x2a')]);_0x260a81['query']=_['keys'](_0x398e1b[_0x7beb('0x30')]);_0x260a81[_0x7beb('0x31')]=_['intersection'](_0x260a81['model'],_0x260a81[_0x7beb('0x30')]);_0x52cdaa[_0x7beb('0x33')]=_['intersection'](_0x260a81[_0x7beb('0x2e')],qs[_0x7beb('0x34')](_0x398e1b[_0x7beb('0x30')]['fields']));_0x52cdaa[_0x7beb('0x33')]=_0x52cdaa['attributes'][_0x7beb('0x35')]?_0x52cdaa[_0x7beb('0x33')]:_0x260a81[_0x7beb('0x2e')];_0x52cdaa[_0x7beb('0x38')]=qs[_0x7beb('0x39')](_0x398e1b['query'][_0x7beb('0x39')]);_0x52cdaa[_0x7beb('0x3a')]=qs[_0x7beb('0x31')](_[_0x7beb('0x54')](_0x398e1b[_0x7beb('0x30')],_0x260a81[_0x7beb('0x31')]));if(_0x398e1b[_0x7beb('0x30')][_0x7beb('0x3d')]){_0x52cdaa[_0x7beb('0x3a')]=_['merge'](_0x52cdaa['where'],{'$or':_[_0x7beb('0x2f')](_0x52cdaa[_0x7beb('0x33')],function(_0x12c148){var _0x2921ce={};_0x2921ce[_0x12c148]={'$like':'%'+_0x398e1b[_0x7beb('0x30')][_0x7beb('0x3d')]+'%'};return _0x2921ce;})});}_0x52cdaa=_[_0x7beb('0x3b')]({},_0x52cdaa,_0x398e1b[_0x7beb('0x56')]);return _0x15fc88['getTeams'](_0x52cdaa);}})[_0x7beb('0x23')](function(_0x2b9d8f){if(_0x2b9d8f){_0x5a638c=_0x2b9d8f['length'];if(!_0x398e1b[_0x7beb('0x30')]['hasOwnProperty']('nolimit')){_0x52cdaa[_0x7beb('0x1b')]=qs[_0x7beb('0x1b')](_0x398e1b[_0x7beb('0x30')][_0x7beb('0x1b')]);_0x52cdaa[_0x7beb('0x1a')]=qs[_0x7beb('0x1a')](_0x398e1b[_0x7beb('0x30')][_0x7beb('0x1a')]);}return _0x15fc88['getTeams'](_0x52cdaa);}})[_0x7beb('0x23')](function(_0x1e782a){if(_0x1e782a){return _0x1e782a?{'count':_0x5a638c,'rows':_0x1e782a}:null;}})[_0x7beb('0x23')](respondWithResult(_0x8bc21b,null))['catch'](handleError(_0x8bc21b,null));};exports[_0x7beb('0x5f')]=function(_0x504ac3,_0x2c0232,_0x2dd96e){var _0x33c879=_0x504ac3[_0x7beb('0x46')][_0x7beb('0x60')];return db[_0x7beb('0x61')]['findAll']({'where':{'id':_0x33c879},'attributes':['id'],'include':[{'model':db[_0x7beb('0x57')],'as':'Agents','attributes':['id','name',_0x7beb('0x62'),_0x7beb('0x63'),'interface'],'raw':!![]}]})[_0x7beb('0x23')](function(_0x45dfba){if(_0x45dfba){var _0x498871=_['flatMap'](_0x45dfba,function(_0x1980ab){var _0x2546dd=_0x1980ab[_0x7beb('0x24')]({'plain':!![]});return _0x2546dd[_0x7beb('0x64')];});return db['WhatsappQueue'][_0x7beb('0x44')]({'where':{'id':_0x504ac3[_0x7beb('0x4f')]['id']}})[_0x7beb('0x23')](function(_0x85f17c){return db[_0x7beb('0x65')][_0x7beb('0x66')](function(_0x16ea0a){return _0x85f17c[_0x7beb('0x5f')](_0x33c879,{'transaction':_0x16ea0a})['then'](function(){return BPromise[_0x7beb('0x67')](_0x498871,function(_0x119aea){return db['UserWhatsappQueue'][_0x7beb('0x68')]({'where':{'UserId':_0x119aea['id'],'WhatsappQueueId':_0x504ac3['params']['id']},'transaction':_0x16ea0a});});})[_0x7beb('0x23')](function(){_0x498871[_0x7beb('0x69')](function(_0x5c0906){socket[_0x7beb('0x6a')](_0x7beb('0x6b'),{'UserId':_0x5c0906['id'],'WhatsappQueueId':_0x85f17c['id']});});});});});}})[_0x7beb('0x23')](respondWithStatusCode(_0x2c0232,null))[_0x7beb('0x42')](handleError(_0x2c0232,null));};exports[_0x7beb('0x6c')]=function(_0x29a2f1,_0x141a89,_0x2a0d10){return db[_0x7beb('0x61')][_0x7beb('0x40')]({'where':{'id':_0x29a2f1['query'][_0x7beb('0x60')]},'attributes':['id'],'include':[{'model':db[_0x7beb('0x57')],'as':_0x7beb('0x64'),'attributes':['id'],'raw':!![]}]})[_0x7beb('0x23')](handleEntityNotFound(_0x141a89,null))[_0x7beb('0x23')](function(_0x448f20){var _0x20e0b5=_[_0x7beb('0x2f')](_0x448f20,'id');var _0x3300d9=[];var _0x1a197e=[];var _0x2fba8d=squel[_0x7beb('0x6d')]();_0x2fba8d[_0x7beb('0x6e')](_0x7beb('0x6f'))[_0x7beb('0x70')](_0x7beb('0x71'),'tq')[_0x7beb('0x72')]('user_has_teams','ut',_0x7beb('0x73'))[_0x7beb('0x3a')](_0x7beb('0x74'),_0x29a2f1[_0x7beb('0x4f')]['id']);for(var _0x3ffb93=0x0;_0x3ffb93<_0x448f20[_0x7beb('0x35')];_0x3ffb93+=0x1){let _0x39d575=_0x448f20[_0x3ffb93];for(var _0x1f850b=0x0;_0x1f850b<_0x39d575['Agents'][_0x7beb('0x35')];_0x1f850b+=0x1){let _0x3a2a0a=_0x39d575[_0x7beb('0x64')][_0x1f850b];var _0x41ba79=_0x2fba8d[_0x7beb('0x75')]();_0x41ba79[_0x7beb('0x3a')](_0x7beb('0x76'),_0x3a2a0a['id']);_0x1a197e[_0x7beb('0x77')](db[_0x7beb('0x65')][_0x7beb('0x30')](_0x41ba79['toString'](),{'type':db[_0x7beb('0x65')][_0x7beb('0x78')][_0x7beb('0x79')]})[_0x7beb('0x23')](function(_0x2de97a){if(_0x2de97a[_0x7beb('0x35')]===0x1){return _0x3a2a0a['id'];}else{var _0x53b79d=_[_0x7beb('0x7a')](_[_0x7beb('0x2f')](_0x2de97a,_0x7beb('0x7b')),function(_0x840e1b){return _['includes'](_0x20e0b5,_0x840e1b);});if(_0x53b79d){return _0x3a2a0a['id'];}}}));}}return BPromise[_0x7beb('0x7c')](_0x1a197e)[_0x7beb('0x23')](function(_0x4f4cf9){_0x3300d9=_(_0x3300d9)[_0x7beb('0x7d')](_0x4f4cf9)['compact']()['value']();return db[_0x7beb('0x29')][_0x7beb('0x44')]({'where':{'id':_0x29a2f1[_0x7beb('0x4f')]['id']}})[_0x7beb('0x23')](function(_0x2d5d38){return db['sequelize'][_0x7beb('0x66')](function(_0x24a217){return _0x2d5d38[_0x7beb('0x6c')](_0x29a2f1[_0x7beb('0x30')]['ids'],{'transaction':_0x24a217})[_0x7beb('0x23')](function(){if(!_[_0x7beb('0x7e')](_0x3300d9)){return _0x2d5d38[_0x7beb('0x7f')](_0x3300d9,{'transaction':_0x24a217});}})[_0x7beb('0x23')](function(){_0x3300d9['forEach'](function(_0x4101e5){socket[_0x7beb('0x6a')]('userWhatsappQueue:remove',{'UserId':_0x4101e5,'WhatsappQueueId':_0x2d5d38['id']});});});});});});})[_0x7beb('0x23')](respondWithStatusCode(_0x141a89,null))[_0x7beb('0x42')](handleError(_0x141a89,null));};exports[_0x7beb('0x80')]=function(_0x247a13,_0x4a9282,_0x52b1c7){return db[_0x7beb('0x29')][_0x7beb('0x44')]({'where':{'id':_0x247a13['params']['id']}})[_0x7beb('0x23')](handleEntityNotFound(_0x4a9282,null))[_0x7beb('0x23')](function(_0x10725f){if(_0x10725f){return _0x10725f[_0x7beb('0x80')](_0x247a13['body'][_0x7beb('0x60')],_[_0x7beb('0x81')](_0x247a13[_0x7beb('0x46')],[_0x7beb('0x60'),'id'])||{})[_0x7beb('0x82')](function(_0x22b389){for(var _0xa43652=0x0;_0xa43652<_0x247a13[_0x7beb('0x46')][_0x7beb('0x60')][_0x7beb('0x35')];_0xa43652+=0x1){socket['emit'](_0x7beb('0x6b'),{'UserId':Number(_0x247a13['body'][_0x7beb('0x60')][_0xa43652]),'WhatsappQueueId':Number(_0x247a13[_0x7beb('0x4f')]['id'])});}return _0x22b389;});}})[_0x7beb('0x23')](respondWithResult(_0x4a9282,null))[_0x7beb('0x42')](handleError(_0x4a9282,null));};exports[_0x7beb('0x7f')]=function(_0x5c10d1,_0x4afcea,_0x22e6a5){return db['WhatsappQueue'][_0x7beb('0x44')]({'where':{'id':_0x5c10d1[_0x7beb('0x4f')]['id']}})[_0x7beb('0x23')](handleEntityNotFound(_0x4afcea,null))['then'](function(_0x426cb3){if(_0x426cb3){return _0x426cb3['removeAgents'](_0x5c10d1['query'][_0x7beb('0x60')])[_0x7beb('0x23')](function(){if(_[_0x7beb('0x83')](_0x5c10d1[_0x7beb('0x30')]['ids'])){for(var _0x5e7e48=0x0;_0x5e7e48<_0x5c10d1[_0x7beb('0x30')][_0x7beb('0x60')][_0x7beb('0x35')];_0x5e7e48+=0x1){socket[_0x7beb('0x6a')](_0x7beb('0x84'),{'UserId':Number(_0x5c10d1[_0x7beb('0x30')][_0x7beb('0x60')][_0x5e7e48]),'WhatsappQueueId':Number(_0x5c10d1[_0x7beb('0x4f')]['id'])});}}else{socket[_0x7beb('0x6a')](_0x7beb('0x84'),{'UserId':Number(_0x5c10d1[_0x7beb('0x30')][_0x7beb('0x60')]),'WhatsappQueueId':Number(_0x5c10d1[_0x7beb('0x4f')]['id'])});}});}})[_0x7beb('0x23')](respondWithStatusCode(_0x4afcea,null))['catch'](handleError(_0x4afcea,null));};exports[_0x7beb('0x85')]=function(_0x20a762,_0x1b5ea4,_0x314bb2){var _0x5552c6={};var _0x4ce016={};var _0x2d403c;var _0x520913;return db['WhatsappQueue']['findOne']({'where':{'id':_0x20a762[_0x7beb('0x4f')]['id']}})[_0x7beb('0x23')](handleEntityNotFound(_0x1b5ea4,null))[_0x7beb('0x23')](function(_0x361009){if(_0x361009){_0x2d403c=_0x361009;_0x4ce016[_0x7beb('0x2e')]=_['keys'](db[_0x7beb('0x57')][_0x7beb('0x2a')]);_0x4ce016[_0x7beb('0x30')]=_[_0x7beb('0x43')](_0x20a762[_0x7beb('0x30')]);_0x4ce016[_0x7beb('0x31')]=_[_0x7beb('0x32')](_0x4ce016[_0x7beb('0x2e')],_0x4ce016[_0x7beb('0x30')]);_0x5552c6['attributes']=_[_0x7beb('0x32')](_0x4ce016[_0x7beb('0x2e')],qs['fields'](_0x20a762[_0x7beb('0x30')][_0x7beb('0x34')]));_0x5552c6[_0x7beb('0x33')]=_0x5552c6[_0x7beb('0x33')][_0x7beb('0x35')]?_0x5552c6[_0x7beb('0x33')]:_0x4ce016[_0x7beb('0x2e')];_0x5552c6['order']=qs[_0x7beb('0x39')](_0x20a762['query']['sort']);_0x5552c6[_0x7beb('0x3a')]=qs['filters'](_[_0x7beb('0x54')](_0x20a762[_0x7beb('0x30')],_0x4ce016[_0x7beb('0x31')]));if(_0x20a762['query']['filter']){_0x5552c6[_0x7beb('0x3a')]=_[_0x7beb('0x3b')](_0x5552c6[_0x7beb('0x3a')],{'$or':_[_0x7beb('0x2f')](_0x5552c6[_0x7beb('0x33')],function(_0x1158a8){var _0x4a4213={};_0x4a4213[_0x1158a8]={'$like':'%'+_0x20a762[_0x7beb('0x30')]['filter']+'%'};return _0x4a4213;})});}_0x5552c6=_[_0x7beb('0x3b')]({},_0x5552c6,_0x20a762[_0x7beb('0x56')]);return _0x2d403c[_0x7beb('0x85')](_0x5552c6);}})[_0x7beb('0x23')](function(_0x451767){if(_0x451767){_0x520913=_0x451767['length'];if(!_0x20a762[_0x7beb('0x30')][_0x7beb('0x36')]('nolimit')){_0x5552c6[_0x7beb('0x1b')]=qs[_0x7beb('0x1b')](_0x20a762['query']['limit']);_0x5552c6[_0x7beb('0x1a')]=qs[_0x7beb('0x1a')](_0x20a762['query']['offset']);}return _0x2d403c['getAgents'](_0x5552c6);}})[_0x7beb('0x23')](function(_0x35e72f){if(_0x35e72f){return _0x35e72f?{'count':_0x520913,'rows':_0x35e72f}:null;}})[_0x7beb('0x23')](respondWithResult(_0x1b5ea4,null))[_0x7beb('0x42')](handleError(_0x1b5ea4,null));};
\ No newline at end of file
+var _0x2b13=['../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','sendStatus','status','end','offset','limit','undefined','count','json','apply','then','destroy','WhatsappQueues','UserProfileResource','error','stack','send','index','map','WhatsappQueue','rawAttributes','fieldName','type','key','model','name','query','filters','attributes','intersection','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','params','keys','fields','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','getMembers','User','findAndCountAll','UserId','agent','whatsappPause','updatedAt','createdAt','format','SIP','getTeams','findOne','Team','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','findOrCreate','forEach','emit','userWhatsappQueue:save','removeTeams','field','tq.TeamId','from','team_has_whatsapp_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','includes','all','union','compact','value','isEmpty','removeAgents','userWhatsappQueue:remove','addAgents','spread','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x4a53e2,_0x13321e){var _0x3f2d76=function(_0x50c5cf){while(--_0x50c5cf){_0x4a53e2['push'](_0x4a53e2['shift']());}};_0x3f2d76(++_0x13321e);}(_0x2b13,0x101));var _0x32b1=function(_0xdb98f0,_0x12d521){_0xdb98f0=_0xdb98f0-0x0;var _0x5affc4=_0x2b13[_0xdb98f0];return _0x5affc4;};'use strict';var emlformat=require(_0x32b1('0x0'));var rimraf=require(_0x32b1('0x1'));var zipdir=require(_0x32b1('0x2'));var jsonpatch=require(_0x32b1('0x3'));var rp=require('request-promise');var moment=require(_0x32b1('0x4'));var BPromise=require(_0x32b1('0x5'));var Mustache=require(_0x32b1('0x6'));var util=require('util');var path=require(_0x32b1('0x7'));var sox=require(_0x32b1('0x8'));var csv=require(_0x32b1('0x9'));var ejs=require(_0x32b1('0xa'));var fs=require('fs');var fs_extra=require(_0x32b1('0xb'));var _=require(_0x32b1('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x32b1('0xd'));var deskjs=require(_0x32b1('0xe'));var toCsv=require(_0x32b1('0x9'));var querystring=require('querystring');var Papa=require(_0x32b1('0xf'));var Redis=require('ioredis');var authService=require(_0x32b1('0x10'));var qs=require(_0x32b1('0x11'));var as=require(_0x32b1('0x12'));var hardwareService=require(_0x32b1('0x13'));var logger=require('../../config/logger')(_0x32b1('0x14'));var utils=require(_0x32b1('0x15'));var config=require(_0x32b1('0x16'));var licenseUtil=require(_0x32b1('0x17'));var db=require(_0x32b1('0x18'))['db'];config['redis']=_[_0x32b1('0x19')](config[_0x32b1('0x1a')],{'host':_0x32b1('0x1b'),'port':0x18eb});var socket=require(_0x32b1('0x1c'))(new Redis(config[_0x32b1('0x1a')]));require('./whatsappQueue.socket')['register'](socket);function respondWithStatusCode(_0x54391c,_0x39fd83){_0x39fd83=_0x39fd83||0xcc;return function(_0x3dcd83){if(_0x3dcd83){return _0x54391c[_0x32b1('0x1d')](_0x39fd83);}return _0x54391c[_0x32b1('0x1e')](_0x39fd83)[_0x32b1('0x1f')]();};}function respondWithResult(_0x527221,_0x5d6cff){_0x5d6cff=_0x5d6cff||0xc8;return function(_0x52f14d){if(_0x52f14d){return _0x527221[_0x32b1('0x1e')](_0x5d6cff)['json'](_0x52f14d);}};}function respondWithFilteredResult(_0x1eadfd,_0x499edb){return function(_0x598e2d){if(_0x598e2d){var _0x4fce46=typeof _0x499edb[_0x32b1('0x20')]==='undefined'&&typeof _0x499edb[_0x32b1('0x21')]===_0x32b1('0x22');var _0x2e3b01=_0x598e2d[_0x32b1('0x23')];var _0x5e8dda=_0x4fce46?0x0:_0x499edb['offset'];var _0x4fa710=_0x4fce46?_0x598e2d[_0x32b1('0x23')]:_0x499edb[_0x32b1('0x20')]+_0x499edb['limit'];var _0x584ba4;if(_0x4fa710>=_0x2e3b01){_0x4fa710=_0x2e3b01;_0x584ba4=0xc8;}else{_0x584ba4=0xce;}_0x1eadfd['status'](_0x584ba4);return _0x1eadfd['set']('Content-Range',_0x5e8dda+'-'+_0x4fa710+'/'+_0x2e3b01)[_0x32b1('0x24')](_0x598e2d);}return null;};}function patchUpdates(_0x137382){return function(_0x2e314c){try{jsonpatch[_0x32b1('0x25')](_0x2e314c,_0x137382,!![]);}catch(_0x56d4ca){return BPromise['reject'](_0x56d4ca);}return _0x2e314c['save']();};}function saveUpdates(_0x12135b,_0x5a27f8){return function(_0x43c096){if(_0x43c096){return _0x43c096['update'](_0x12135b)[_0x32b1('0x26')](function(_0x295d5c){return _0x295d5c;});}return null;};}function removeEntity(_0x14d79b,_0x32f947){return function(_0x387cf6){if(_0x387cf6){return _0x387cf6[_0x32b1('0x27')]()['then'](function(){var _0x41b388=_0x387cf6['get']({'plain':!![]});var _0x17239c=_0x32b1('0x28');return db[_0x32b1('0x29')][_0x32b1('0x27')]({'where':{'type':_0x17239c,'resourceId':_0x41b388['id']}})[_0x32b1('0x26')](function(){return _0x387cf6;});})[_0x32b1('0x26')](function(){_0x14d79b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4e0e8c,_0x434b0c){return function(_0x2f904e){if(!_0x2f904e){_0x4e0e8c[_0x32b1('0x1d')](0x194);}return _0x2f904e;};}function handleError(_0x8f4454,_0x476193){_0x476193=_0x476193||0x1f4;return function(_0x1054b4){logger[_0x32b1('0x2a')](_0x1054b4[_0x32b1('0x2b')]);if(_0x1054b4['name']){delete _0x1054b4['name'];}_0x8f4454[_0x32b1('0x1e')](_0x476193)[_0x32b1('0x2c')](_0x1054b4);};}exports[_0x32b1('0x2d')]=function(_0x69a09d,_0x1934dc){var _0x24dc53={},_0x27383a={},_0x5154fa={'count':0x0,'rows':[]};var _0x50a6b2=_[_0x32b1('0x2e')](db[_0x32b1('0x2f')][_0x32b1('0x30')],function(_0x1a7eca){return{'name':_0x1a7eca[_0x32b1('0x31')],'type':_0x1a7eca[_0x32b1('0x32')][_0x32b1('0x33')]};});_0x27383a[_0x32b1('0x34')]=_[_0x32b1('0x2e')](_0x50a6b2,_0x32b1('0x35'));_0x27383a[_0x32b1('0x36')]=_['keys'](_0x69a09d[_0x32b1('0x36')]);_0x27383a[_0x32b1('0x37')]=_['intersection'](_0x27383a[_0x32b1('0x34')],_0x27383a[_0x32b1('0x36')]);_0x24dc53[_0x32b1('0x38')]=_[_0x32b1('0x39')](_0x27383a[_0x32b1('0x34')],qs['fields'](_0x69a09d[_0x32b1('0x36')]['fields']));_0x24dc53[_0x32b1('0x38')]=_0x24dc53['attributes'][_0x32b1('0x3a')]?_0x24dc53[_0x32b1('0x38')]:_0x27383a[_0x32b1('0x34')];if(!_0x69a09d['query'][_0x32b1('0x3b')](_0x32b1('0x3c'))){_0x24dc53[_0x32b1('0x21')]=qs[_0x32b1('0x21')](_0x69a09d['query'][_0x32b1('0x21')]);_0x24dc53[_0x32b1('0x20')]=qs['offset'](_0x69a09d[_0x32b1('0x36')][_0x32b1('0x20')]);}_0x24dc53[_0x32b1('0x3d')]=qs[_0x32b1('0x3e')](_0x69a09d[_0x32b1('0x36')][_0x32b1('0x3e')]);_0x24dc53[_0x32b1('0x3f')]=qs[_0x32b1('0x37')](_[_0x32b1('0x40')](_0x69a09d[_0x32b1('0x36')],_0x27383a[_0x32b1('0x37')]),_0x50a6b2);if(_0x69a09d[_0x32b1('0x36')][_0x32b1('0x41')]){_0x24dc53[_0x32b1('0x3f')]=_[_0x32b1('0x42')](_0x24dc53[_0x32b1('0x3f')],{'$or':_[_0x32b1('0x2e')](_0x50a6b2,function(_0x367667){if(_0x367667[_0x32b1('0x32')]!==_0x32b1('0x43')){var _0x4f44c5={};_0x4f44c5[_0x367667[_0x32b1('0x35')]]={'$like':'%'+_0x69a09d[_0x32b1('0x36')][_0x32b1('0x41')]+'%'};return _0x4f44c5;}})});}_0x24dc53=_[_0x32b1('0x42')]({},_0x24dc53,_0x69a09d[_0x32b1('0x44')]);var _0x13bf16={'where':_0x24dc53[_0x32b1('0x3f')]};return db[_0x32b1('0x2f')][_0x32b1('0x23')](_0x13bf16)[_0x32b1('0x26')](function(_0x3e6e1d){_0x5154fa[_0x32b1('0x23')]=_0x3e6e1d;if(_0x69a09d['query']['includeAll']){_0x24dc53[_0x32b1('0x45')]=[{'all':!![]}];}return db[_0x32b1('0x2f')][_0x32b1('0x46')](_0x24dc53);})[_0x32b1('0x26')](function(_0x5a47d7){_0x5154fa[_0x32b1('0x47')]=_0x5a47d7;return _0x5154fa;})['then'](respondWithFilteredResult(_0x1934dc,_0x24dc53))[_0x32b1('0x48')](handleError(_0x1934dc,null));};exports['show']=function(_0x58df67,_0x34d268){var _0x2ceaaf={'raw':!![],'where':{'id':_0x58df67[_0x32b1('0x49')]['id']}},_0x5938e2={};_0x5938e2[_0x32b1('0x34')]=_[_0x32b1('0x4a')](db[_0x32b1('0x2f')]['rawAttributes']);_0x5938e2[_0x32b1('0x36')]=_[_0x32b1('0x4a')](_0x58df67['query']);_0x5938e2[_0x32b1('0x37')]=_['intersection'](_0x5938e2[_0x32b1('0x34')],_0x5938e2[_0x32b1('0x36')]);_0x2ceaaf['attributes']=_[_0x32b1('0x39')](_0x5938e2[_0x32b1('0x34')],qs[_0x32b1('0x4b')](_0x58df67['query']['fields']));_0x2ceaaf[_0x32b1('0x38')]=_0x2ceaaf['attributes'][_0x32b1('0x3a')]?_0x2ceaaf[_0x32b1('0x38')]:_0x5938e2[_0x32b1('0x34')];if(_0x58df67['query']['includeAll']){_0x2ceaaf[_0x32b1('0x45')]=[{'all':!![]}];}_0x2ceaaf=_[_0x32b1('0x42')]({},_0x2ceaaf,_0x58df67['options']);return db[_0x32b1('0x2f')][_0x32b1('0x4c')](_0x2ceaaf)[_0x32b1('0x26')](handleEntityNotFound(_0x34d268,null))['then'](respondWithResult(_0x34d268,null))[_0x32b1('0x48')](handleError(_0x34d268,null));};exports['create']=function(_0x1244b4,_0x3e2862){return db[_0x32b1('0x2f')][_0x32b1('0x4d')](_0x1244b4[_0x32b1('0x4e')],{})[_0x32b1('0x26')](function(_0x6b20b){var _0x3d77bc=_0x1244b4['user'][_0x32b1('0x4f')]({'plain':!![]});if(!_0x3d77bc)throw new Error(_0x32b1('0x50'));if(_0x3d77bc[_0x32b1('0x51')]==='user'){var _0x1f9004=_0x6b20b[_0x32b1('0x4f')]({'plain':!![]});var _0x23c397=_0x32b1('0x28');return db['UserProfileSection']['find']({'where':{'name':_0x23c397,'userProfileId':_0x3d77bc[_0x32b1('0x52')]},'raw':!![]})[_0x32b1('0x26')](function(_0x11239e){if(_0x11239e&&_0x11239e[_0x32b1('0x53')]===0x0){return db[_0x32b1('0x29')][_0x32b1('0x4d')]({'name':_0x1f9004[_0x32b1('0x35')],'resourceId':_0x1f9004['id'],'type':_0x11239e['name'],'sectionId':_0x11239e['id']},{})['then'](function(){return _0x6b20b;});}else{return _0x6b20b;}})[_0x32b1('0x48')](function(_0x54e509){logger[_0x32b1('0x2a')](_0x32b1('0x54'),_0x54e509);throw _0x54e509;});}return _0x6b20b;})[_0x32b1('0x26')](respondWithResult(_0x3e2862,0xc9))[_0x32b1('0x48')](handleError(_0x3e2862,null));};exports[_0x32b1('0x55')]=function(_0x52e1d0,_0x126106){if(_0x52e1d0[_0x32b1('0x4e')]['id']){delete _0x52e1d0[_0x32b1('0x4e')]['id'];}return db[_0x32b1('0x2f')][_0x32b1('0x4c')]({'where':{'id':_0x52e1d0[_0x32b1('0x49')]['id']}})['then'](handleEntityNotFound(_0x126106,null))[_0x32b1('0x26')](saveUpdates(_0x52e1d0['body'],null))[_0x32b1('0x26')](respondWithResult(_0x126106,null))['catch'](handleError(_0x126106,null));};exports['destroy']=function(_0x430d23,_0x2afb40){return db['WhatsappQueue'][_0x32b1('0x4c')]({'where':{'id':_0x430d23[_0x32b1('0x49')]['id']}})[_0x32b1('0x26')](handleEntityNotFound(_0x2afb40,null))[_0x32b1('0x26')](removeEntity(_0x2afb40,null))[_0x32b1('0x48')](handleError(_0x2afb40,null));};exports['describe']=function(_0x55549b,_0x517f84){return db['WhatsappQueue'][_0x32b1('0x56')]()[_0x32b1('0x26')](respondWithResult(_0x517f84,null))['catch'](handleError(_0x517f84,null));};exports[_0x32b1('0x57')]=function(_0x3b534f,_0x2ef657,_0x15af8b){var _0xe19469={'raw':!![],'where':{}},_0x1ae9ed={},_0xdfbd28;return db[_0x32b1('0x2f')]['findOne']({'where':{'id':_0x3b534f['params']['id']}})[_0x32b1('0x26')](handleEntityNotFound(_0x2ef657,null))[_0x32b1('0x26')](function(_0x1fa0ec){if(_0x1fa0ec){_0xdfbd28=_0x1fa0ec[_0x32b1('0x4f')]({'plain':!![]});_0x1ae9ed[_0x32b1('0x34')]=_[_0x32b1('0x4a')](db['UserWhatsappQueue'][_0x32b1('0x30')]);_0x1ae9ed['query']=_[_0x32b1('0x4a')](_0x3b534f[_0x32b1('0x36')]);_0x1ae9ed[_0x32b1('0x37')]=_[_0x32b1('0x39')](_0x1ae9ed[_0x32b1('0x34')],_0x1ae9ed[_0x32b1('0x36')]);_0xe19469[_0x32b1('0x38')]=_['intersection'](_0x1ae9ed['model'],qs[_0x32b1('0x4b')](_0x3b534f[_0x32b1('0x36')][_0x32b1('0x4b')]));_0xe19469[_0x32b1('0x38')]=_0xe19469['attributes'][_0x32b1('0x3a')]?_0xe19469[_0x32b1('0x38')]:_0x1ae9ed[_0x32b1('0x34')];if(!_0x3b534f[_0x32b1('0x36')][_0x32b1('0x3b')](_0x32b1('0x3c'))){_0xe19469['limit']=qs['limit'](_0x3b534f[_0x32b1('0x36')][_0x32b1('0x21')]);_0xe19469[_0x32b1('0x20')]=qs[_0x32b1('0x20')](_0x3b534f['query']['offset']);}_0xe19469[_0x32b1('0x3d')]=qs[_0x32b1('0x3e')](_0x3b534f[_0x32b1('0x36')]['sort']);_0xe19469[_0x32b1('0x3f')]=qs[_0x32b1('0x37')](_[_0x32b1('0x40')](_0x3b534f['query'],_0x1ae9ed[_0x32b1('0x37')]));_0xe19469[_0x32b1('0x3f')]['WhatsappQueueId']=_0x1fa0ec['id'];if(_0x3b534f[_0x32b1('0x36')][_0x32b1('0x41')]){_0xe19469[_0x32b1('0x3f')]=_[_0x32b1('0x42')](_0xe19469[_0x32b1('0x3f')],{'$or':_[_0x32b1('0x2e')](_0xe19469[_0x32b1('0x38')],function(_0xdbbea5){var _0x45ed01={};_0x45ed01[_0xdbbea5]={'$like':'%'+_0x3b534f['query']['filter']+'%'};return _0x45ed01;})});}_0xe19469=_['merge']({},_0xe19469,_0x3b534f[_0x32b1('0x44')]);return db['UserWhatsappQueue'][_0x32b1('0x46')](_0xe19469);}})[_0x32b1('0x26')](function(_0x25ac69){if(_0x25ac69){return db[_0x32b1('0x58')][_0x32b1('0x59')]({'where':{'id':_[_0x32b1('0x2e')](_0x25ac69,_0x32b1('0x5a')),'role':_0x32b1('0x5b')},'attributes':['id','name',_0x32b1('0x5c'),_0x32b1('0x5d'),_0x32b1('0x5e')]});}})[_0x32b1('0x26')](function(_0x3ab9d9){if(_0x3ab9d9){return{'count':_0x3ab9d9[_0x32b1('0x23')],'rows':_[_0x32b1('0x2e')](_0x3ab9d9[_0x32b1('0x47')],function(_0x2fe669){return{'membername':_0x2fe669[_0x32b1('0x35')],'UserId':_0x2fe669['id'],'queue_name':_0xdfbd28[_0x32b1('0x35')],'WhatsappQueueId':_0xdfbd28['id'],'interface':util[_0x32b1('0x5f')]('%s/%s',_0x32b1('0x60'),_0x2fe669[_0x32b1('0x35')]),'penalty':0x0,'paused':_0x2fe669[_0x32b1('0x5c')],'createdAt':_0x2fe669[_0x32b1('0x5e')],'updatedAt':_0x2fe669[_0x32b1('0x5d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x32b1('0x26')](respondWithFilteredResult(_0x2ef657,_0xe19469))[_0x32b1('0x48')](handleError(_0x2ef657,null));};exports[_0x32b1('0x61')]=function(_0x561ff5,_0x2e9fc6,_0x14ecde){var _0x38a0c5={};var _0x21cd1b={};var _0x21ee7c;var _0x577cac;return db[_0x32b1('0x2f')][_0x32b1('0x62')]({'where':{'id':_0x561ff5['params']['id']}})[_0x32b1('0x26')](handleEntityNotFound(_0x2e9fc6,null))[_0x32b1('0x26')](function(_0x4847dc){if(_0x4847dc){_0x21ee7c=_0x4847dc;_0x21cd1b['model']=_[_0x32b1('0x4a')](db[_0x32b1('0x63')]['rawAttributes']);_0x21cd1b[_0x32b1('0x36')]=_[_0x32b1('0x4a')](_0x561ff5[_0x32b1('0x36')]);_0x21cd1b['filters']=_[_0x32b1('0x39')](_0x21cd1b[_0x32b1('0x34')],_0x21cd1b[_0x32b1('0x36')]);_0x38a0c5[_0x32b1('0x38')]=_[_0x32b1('0x39')](_0x21cd1b[_0x32b1('0x34')],qs[_0x32b1('0x4b')](_0x561ff5[_0x32b1('0x36')][_0x32b1('0x4b')]));_0x38a0c5[_0x32b1('0x38')]=_0x38a0c5['attributes'][_0x32b1('0x3a')]?_0x38a0c5[_0x32b1('0x38')]:_0x21cd1b[_0x32b1('0x34')];_0x38a0c5[_0x32b1('0x3d')]=qs['sort'](_0x561ff5[_0x32b1('0x36')][_0x32b1('0x3e')]);_0x38a0c5[_0x32b1('0x3f')]=qs[_0x32b1('0x37')](_[_0x32b1('0x40')](_0x561ff5['query'],_0x21cd1b[_0x32b1('0x37')]));if(_0x561ff5[_0x32b1('0x36')][_0x32b1('0x41')]){_0x38a0c5[_0x32b1('0x3f')]=_[_0x32b1('0x42')](_0x38a0c5[_0x32b1('0x3f')],{'$or':_['map'](_0x38a0c5[_0x32b1('0x38')],function(_0x4ca00f){var _0x509dda={};_0x509dda[_0x4ca00f]={'$like':'%'+_0x561ff5[_0x32b1('0x36')]['filter']+'%'};return _0x509dda;})});}_0x38a0c5=_[_0x32b1('0x42')]({},_0x38a0c5,_0x561ff5[_0x32b1('0x44')]);return _0x21ee7c[_0x32b1('0x61')](_0x38a0c5);}})[_0x32b1('0x26')](function(_0x380553){if(_0x380553){_0x577cac=_0x380553['length'];if(!_0x561ff5[_0x32b1('0x36')][_0x32b1('0x3b')]('nolimit')){_0x38a0c5['limit']=qs[_0x32b1('0x21')](_0x561ff5['query']['limit']);_0x38a0c5[_0x32b1('0x20')]=qs['offset'](_0x561ff5[_0x32b1('0x36')][_0x32b1('0x20')]);}return _0x21ee7c[_0x32b1('0x61')](_0x38a0c5);}})[_0x32b1('0x26')](function(_0x35ef57){if(_0x35ef57){return _0x35ef57?{'count':_0x577cac,'rows':_0x35ef57}:null;}})[_0x32b1('0x26')](respondWithResult(_0x2e9fc6,null))[_0x32b1('0x48')](handleError(_0x2e9fc6,null));};exports[_0x32b1('0x64')]=function(_0x44021f,_0x4a6882,_0x333e5b){var _0x5a457e=_0x44021f[_0x32b1('0x4e')][_0x32b1('0x65')];return db[_0x32b1('0x63')]['findAll']({'where':{'id':_0x5a457e},'attributes':['id'],'include':[{'model':db['User'],'as':_0x32b1('0x66'),'attributes':['id','name',_0x32b1('0x67'),_0x32b1('0x68'),_0x32b1('0x69')],'raw':!![]}]})[_0x32b1('0x26')](function(_0x46437e){if(_0x46437e){var _0x8b7c7e=_[_0x32b1('0x6a')](_0x46437e,function(_0x308f07){var _0x51af0c=_0x308f07[_0x32b1('0x4f')]({'plain':!![]});return _0x51af0c[_0x32b1('0x66')];});return db[_0x32b1('0x2f')][_0x32b1('0x4c')]({'where':{'id':_0x44021f[_0x32b1('0x49')]['id']}})[_0x32b1('0x26')](function(_0x3b6934){return db[_0x32b1('0x6b')][_0x32b1('0x6c')](function(_0x2100a9){return _0x3b6934[_0x32b1('0x64')](_0x5a457e,{'transaction':_0x2100a9})[_0x32b1('0x26')](function(){return BPromise['each'](_0x8b7c7e,function(_0x4621f3){return db['UserWhatsappQueue'][_0x32b1('0x6d')]({'where':{'UserId':_0x4621f3['id'],'WhatsappQueueId':_0x44021f['params']['id']},'transaction':_0x2100a9});});})[_0x32b1('0x26')](function(){_0x8b7c7e[_0x32b1('0x6e')](function(_0x3a0721){socket[_0x32b1('0x6f')](_0x32b1('0x70'),{'UserId':_0x3a0721['id'],'WhatsappQueueId':_0x3b6934['id']});});});});});}})[_0x32b1('0x26')](respondWithStatusCode(_0x4a6882,null))[_0x32b1('0x48')](handleError(_0x4a6882,null));};exports[_0x32b1('0x71')]=function(_0x11964e,_0x2c619d,_0x2ea684){return db[_0x32b1('0x63')][_0x32b1('0x46')]({'where':{'id':_0x11964e[_0x32b1('0x36')][_0x32b1('0x65')]},'attributes':['id'],'include':[{'model':db[_0x32b1('0x58')],'as':_0x32b1('0x66'),'attributes':['id'],'raw':!![]}]})[_0x32b1('0x26')](handleEntityNotFound(_0x2c619d,null))[_0x32b1('0x26')](function(_0x25ac61){var _0x561b51=_[_0x32b1('0x2e')](_0x25ac61,'id');var _0x253db5=[];var _0x120b2b=[];var _0x25cee4=squel['select']();_0x25cee4[_0x32b1('0x72')](_0x32b1('0x73'))[_0x32b1('0x74')](_0x32b1('0x75'),'tq')[_0x32b1('0x76')](_0x32b1('0x77'),'ut',_0x32b1('0x78'))[_0x32b1('0x3f')](_0x32b1('0x79'),_0x11964e[_0x32b1('0x49')]['id']);for(var _0x4388b2=0x0;_0x4388b2<_0x25ac61[_0x32b1('0x3a')];_0x4388b2+=0x1){let _0x5586be=_0x25ac61[_0x4388b2];for(var _0x244308=0x0;_0x244308<_0x5586be[_0x32b1('0x66')][_0x32b1('0x3a')];_0x244308+=0x1){let _0x5bd9c6=_0x5586be[_0x32b1('0x66')][_0x244308];var _0x25458a=_0x25cee4['clone']();_0x25458a['where'](_0x32b1('0x7a'),_0x5bd9c6['id']);_0x120b2b['push'](db[_0x32b1('0x6b')][_0x32b1('0x36')](_0x25458a[_0x32b1('0x7b')](),{'type':db[_0x32b1('0x6b')][_0x32b1('0x7c')][_0x32b1('0x7d')]})[_0x32b1('0x26')](function(_0x37d3dc){if(_0x37d3dc[_0x32b1('0x3a')]===0x1){return _0x5bd9c6['id'];}else{var _0x2963f7=_['every'](_[_0x32b1('0x2e')](_0x37d3dc,'TeamId'),function(_0x40a12d){return _[_0x32b1('0x7e')](_0x561b51,_0x40a12d);});if(_0x2963f7){return _0x5bd9c6['id'];}}}));}}return BPromise[_0x32b1('0x7f')](_0x120b2b)[_0x32b1('0x26')](function(_0x7797dd){_0x253db5=_(_0x253db5)[_0x32b1('0x80')](_0x7797dd)[_0x32b1('0x81')]()[_0x32b1('0x82')]();return db[_0x32b1('0x2f')][_0x32b1('0x4c')]({'where':{'id':_0x11964e[_0x32b1('0x49')]['id']}})[_0x32b1('0x26')](function(_0x272a39){return db[_0x32b1('0x6b')][_0x32b1('0x6c')](function(_0x1214a3){return _0x272a39[_0x32b1('0x71')](_0x11964e['query'][_0x32b1('0x65')],{'transaction':_0x1214a3})[_0x32b1('0x26')](function(){if(!_[_0x32b1('0x83')](_0x253db5)){return _0x272a39[_0x32b1('0x84')](_0x253db5,{'transaction':_0x1214a3});}})['then'](function(){_0x253db5[_0x32b1('0x6e')](function(_0x3abffb){socket['emit'](_0x32b1('0x85'),{'UserId':_0x3abffb,'WhatsappQueueId':_0x272a39['id']});});});});});});})['then'](respondWithStatusCode(_0x2c619d,null))[_0x32b1('0x48')](handleError(_0x2c619d,null));};exports[_0x32b1('0x86')]=function(_0x58906a,_0x458988,_0x25239b){return db[_0x32b1('0x2f')]['find']({'where':{'id':_0x58906a[_0x32b1('0x49')]['id']}})[_0x32b1('0x26')](handleEntityNotFound(_0x458988,null))[_0x32b1('0x26')](function(_0x554d9f){if(_0x554d9f){return _0x554d9f[_0x32b1('0x86')](_0x58906a['body']['ids'],_['omit'](_0x58906a['body'],['ids','id'])||{})[_0x32b1('0x87')](function(_0x19c4e7){for(var _0x1ac172=0x0;_0x1ac172<_0x58906a[_0x32b1('0x4e')][_0x32b1('0x65')][_0x32b1('0x3a')];_0x1ac172+=0x1){socket[_0x32b1('0x6f')]('userWhatsappQueue:save',{'UserId':Number(_0x58906a[_0x32b1('0x4e')][_0x32b1('0x65')][_0x1ac172]),'WhatsappQueueId':Number(_0x58906a['params']['id'])});}return _0x19c4e7;});}})[_0x32b1('0x26')](respondWithResult(_0x458988,null))[_0x32b1('0x48')](handleError(_0x458988,null));};exports['removeAgents']=function(_0x1b284f,_0x1ad499,_0x1630e6){return db[_0x32b1('0x2f')][_0x32b1('0x4c')]({'where':{'id':_0x1b284f[_0x32b1('0x49')]['id']}})[_0x32b1('0x26')](handleEntityNotFound(_0x1ad499,null))[_0x32b1('0x26')](function(_0x29f0bf){if(_0x29f0bf){return _0x29f0bf[_0x32b1('0x84')](_0x1b284f[_0x32b1('0x36')][_0x32b1('0x65')])['then'](function(){if(_[_0x32b1('0x88')](_0x1b284f[_0x32b1('0x36')][_0x32b1('0x65')])){for(var _0x5896d8=0x0;_0x5896d8<_0x1b284f[_0x32b1('0x36')][_0x32b1('0x65')]['length'];_0x5896d8+=0x1){socket[_0x32b1('0x6f')](_0x32b1('0x85'),{'UserId':Number(_0x1b284f['query']['ids'][_0x5896d8]),'WhatsappQueueId':Number(_0x1b284f[_0x32b1('0x49')]['id'])});}}else{socket['emit']('userWhatsappQueue:remove',{'UserId':Number(_0x1b284f[_0x32b1('0x36')][_0x32b1('0x65')]),'WhatsappQueueId':Number(_0x1b284f[_0x32b1('0x49')]['id'])});}});}})[_0x32b1('0x26')](respondWithStatusCode(_0x1ad499,null))[_0x32b1('0x48')](handleError(_0x1ad499,null));};exports['getAgents']=function(_0xc5e23e,_0x3f8af5,_0x240854){var _0x279565={};var _0x459037={};var _0x3ad98a;var _0x343d51;return db[_0x32b1('0x2f')][_0x32b1('0x62')]({'where':{'id':_0xc5e23e[_0x32b1('0x49')]['id']}})[_0x32b1('0x26')](handleEntityNotFound(_0x3f8af5,null))[_0x32b1('0x26')](function(_0x3e989b){if(_0x3e989b){_0x3ad98a=_0x3e989b;_0x459037[_0x32b1('0x34')]=_[_0x32b1('0x4a')](db[_0x32b1('0x58')][_0x32b1('0x30')]);_0x459037[_0x32b1('0x36')]=_['keys'](_0xc5e23e[_0x32b1('0x36')]);_0x459037[_0x32b1('0x37')]=_['intersection'](_0x459037[_0x32b1('0x34')],_0x459037['query']);_0x279565[_0x32b1('0x38')]=_[_0x32b1('0x39')](_0x459037[_0x32b1('0x34')],qs[_0x32b1('0x4b')](_0xc5e23e[_0x32b1('0x36')][_0x32b1('0x4b')]));_0x279565['attributes']=_0x279565[_0x32b1('0x38')]['length']?_0x279565[_0x32b1('0x38')]:_0x459037[_0x32b1('0x34')];_0x279565[_0x32b1('0x3d')]=qs[_0x32b1('0x3e')](_0xc5e23e[_0x32b1('0x36')][_0x32b1('0x3e')]);_0x279565[_0x32b1('0x3f')]=qs[_0x32b1('0x37')](_[_0x32b1('0x40')](_0xc5e23e['query'],_0x459037['filters']));if(_0xc5e23e['query'][_0x32b1('0x41')]){_0x279565['where']=_[_0x32b1('0x42')](_0x279565[_0x32b1('0x3f')],{'$or':_[_0x32b1('0x2e')](_0x279565['attributes'],function(_0x585293){var _0x3c4975={};_0x3c4975[_0x585293]={'$like':'%'+_0xc5e23e[_0x32b1('0x36')][_0x32b1('0x41')]+'%'};return _0x3c4975;})});}_0x279565=_[_0x32b1('0x42')]({},_0x279565,_0xc5e23e['options']);return _0x3ad98a['getAgents'](_0x279565);}})[_0x32b1('0x26')](function(_0x563337){if(_0x563337){_0x343d51=_0x563337[_0x32b1('0x3a')];if(!_0xc5e23e['query']['hasOwnProperty'](_0x32b1('0x3c'))){_0x279565[_0x32b1('0x21')]=qs[_0x32b1('0x21')](_0xc5e23e[_0x32b1('0x36')]['limit']);_0x279565[_0x32b1('0x20')]=qs['offset'](_0xc5e23e[_0x32b1('0x36')][_0x32b1('0x20')]);}return _0x3ad98a[_0x32b1('0x89')](_0x279565);}})[_0x32b1('0x26')](function(_0x1f55c3){if(_0x1f55c3){return _0x1f55c3?{'count':_0x343d51,'rows':_0x1f55c3}:null;}})['then'](respondWithResult(_0x3f8af5,null))['catch'](handleError(_0x3f8af5,null));};
\ No newline at end of file
index d99f506..28314c5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x22e5=['hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners','update','remove','emit'];(function(_0x5a762a,_0x1cdf6b){var _0x4eadf2=function(_0x5c355a){while(--_0x5c355a){_0x5a762a['push'](_0x5a762a['shift']());}};_0x4eadf2(++_0x1cdf6b);}(_0x22e5,0x13b));var _0x522e=function(_0x186f4a,_0x4de063){_0x186f4a=_0x186f4a-0x0;var _0xf35bdb=_0x22e5[_0x186f4a];return _0xf35bdb;};'use strict';var EventEmitter=require('events');var WhatsappQueue=require(_0x522e('0x0'))['db']['WhatsappQueue'];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x522e('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x522e('0x2'),'afterDestroy':_0x522e('0x3')};function emitEvent(_0x8fdd7c){return function(_0xc6b175,_0x81081d,_0x364016){WhatsappQueueEvents[_0x522e('0x4')](_0x8fdd7c+':'+_0xc6b175['id'],_0xc6b175);WhatsappQueueEvents[_0x522e('0x4')](_0x8fdd7c,_0xc6b175);_0x364016(null);};}for(var e in events){if(events[_0x522e('0x5')](e)){var event=events[e];WhatsappQueue[_0x522e('0x6')](e,emitEvent(event));}}module[_0x522e('0x7')]=WhatsappQueueEvents;
\ No newline at end of file
+var _0x0bf9=['save','update','remove','emit','hasOwnProperty','hook','exports','events','WhatsappQueue','setMaxListeners'];(function(_0x2aca6e,_0x3bae74){var _0x4cc000=function(_0x5a53f4){while(--_0x5a53f4){_0x2aca6e['push'](_0x2aca6e['shift']());}};_0x4cc000(++_0x3bae74);}(_0x0bf9,0xcf));var _0x90bf=function(_0x19281a,_0x32a151){_0x19281a=_0x19281a-0x0;var _0x3609bb=_0x0bf9[_0x19281a];return _0x3609bb;};'use strict';var EventEmitter=require(_0x90bf('0x0'));var WhatsappQueue=require('../../mysqldb')['db'][_0x90bf('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x90bf('0x2')](0x0);var events={'afterCreate':_0x90bf('0x3'),'afterUpdate':_0x90bf('0x4'),'afterDestroy':_0x90bf('0x5')};function emitEvent(_0x181d71){return function(_0x54c35f,_0x1fded3,_0x55d86f){WhatsappQueueEvents[_0x90bf('0x6')](_0x181d71+':'+_0x54c35f['id'],_0x54c35f);WhatsappQueueEvents[_0x90bf('0x6')](_0x181d71,_0x54c35f);_0x55d86f(null);};}for(var e in events){if(events[_0x90bf('0x7')](e)){var event=events[e];WhatsappQueue[_0x90bf('0x8')](e,emitEvent(event));}}module[_0x90bf('0x9')]=WhatsappQueueEvents;
\ No newline at end of file
index 2f9f9a3..173e13d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa13f=['whatsapp_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x46a6d8,_0x2e1ab5){var _0x9d4d8a=function(_0x4868a6){while(--_0x4868a6){_0x46a6d8['push'](_0x46a6d8['shift']());}};_0x9d4d8a(++_0x2e1ab5);}(_0xa13f,0xf8));var _0xfa13=function(_0x141415,_0x3e56a4){_0x141415=_0x141415-0x0;var _0x48b738=_0xa13f[_0x141415];return _0x48b738;};'use strict';var _=require(_0xfa13('0x0'));var util=require(_0xfa13('0x1'));var logger=require(_0xfa13('0x2'))(_0xfa13('0x3'));var moment=require(_0xfa13('0x4'));var BPromise=require(_0xfa13('0x5'));var rp=require(_0xfa13('0x6'));var fs=require('fs');var path=require(_0xfa13('0x7'));var rimraf=require(_0xfa13('0x8'));var config=require(_0xfa13('0x9'));var attributes=require('./whatsappQueue.attributes');module[_0xfa13('0xa')]=function(_0x1186c9,_0x16f18f){return _0x1186c9[_0xfa13('0xb')]('WhatsappQueue',attributes,{'tableName':_0xfa13('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc0bc=['exports','whatsapp_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x2378d7,_0x49801e){var _0x29c8c1=function(_0x58314d){while(--_0x58314d){_0x2378d7['push'](_0x2378d7['shift']());}};_0x29c8c1(++_0x49801e);}(_0xc0bc,0x1ee));var _0xcc0b=function(_0x1a8773,_0x27d2ce){_0x1a8773=_0x1a8773-0x0;var _0x1f6367=_0xc0bc[_0x1a8773];return _0x1f6367;};'use strict';var _=require(_0xcc0b('0x0'));var util=require(_0xcc0b('0x1'));var logger=require(_0xcc0b('0x2'))(_0xcc0b('0x3'));var moment=require(_0xcc0b('0x4'));var BPromise=require(_0xcc0b('0x5'));var rp=require(_0xcc0b('0x6'));var fs=require('fs');var path=require(_0xcc0b('0x7'));var rimraf=require(_0xcc0b('0x8'));var config=require(_0xcc0b('0x9'));var attributes=require('./whatsappQueue.attributes');module[_0xcc0b('0xa')]=function(_0x1bf83d,_0x25c402){return _0x1bf83d['define']('WhatsappQueue',attributes,{'tableName':_0xcc0b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index dc449d6..213e808 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7432=['attributes','limit','include','map','model','GetWhatsappQueue','stringify','ShowWhatsappQueue','find','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','then','info','WhatsappQueue,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','catch','findAll','options','raw'];(function(_0x4f6a2d,_0x129222){var _0x4ec2e5=function(_0x4da8a9){while(--_0x4da8a9){_0x4f6a2d['push'](_0x4f6a2d['shift']());}};_0x4ec2e5(++_0x129222);}(_0x7432,0x14a));var _0x2743=function(_0xf6074f,_0x40fe18){_0xf6074f=_0xf6074f-0x0;var _0x4c6c10=_0x7432[_0xf6074f];return _0x4c6c10;};'use strict';var _=require(_0x2743('0x0'));var util=require(_0x2743('0x1'));var moment=require(_0x2743('0x2'));var BPromise=require(_0x2743('0x3'));var rs=require(_0x2743('0x4'));var fs=require('fs');var Redis=require(_0x2743('0x5'));var db=require(_0x2743('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x2743('0x7'))('rpc');var config=require(_0x2743('0x8'));var jayson=require(_0x2743('0x9'));var client=jayson[_0x2743('0xa')][_0x2743('0xb')]({'port':0x232a});config[_0x2743('0xc')]=_[_0x2743('0xd')](config[_0x2743('0xc')],{'host':_0x2743('0xe'),'port':0x18eb});var socket=require(_0x2743('0xf'))(new Redis(config[_0x2743('0xc')]));require('./whatsappQueue.socket')[_0x2743('0x10')](socket);function respondWithRpcPromise(_0x474785,_0x4fe546,_0x477a91){return new BPromise(function(_0x1ddac1,_0x211c36){return client['request'](_0x474785,_0x477a91)[_0x2743('0x11')](function(_0x4e77be){logger[_0x2743('0x12')](_0x2743('0x13'),_0x4fe546,'request\x20sent');logger[_0x2743('0x14')]('WhatsappQueue,\x20%s,\x20%s,\x20%s',_0x4fe546,_0x2743('0x15'),JSON['stringify'](_0x4e77be));if(_0x4e77be[_0x2743('0x16')]){if(_0x4e77be[_0x2743('0x16')][_0x2743('0x17')]===0x1f4){logger[_0x2743('0x16')](_0x2743('0x13'),_0x4fe546,_0x4e77be[_0x2743('0x16')][_0x2743('0x18')]);return _0x211c36(_0x4e77be[_0x2743('0x16')][_0x2743('0x18')]);}logger[_0x2743('0x16')](_0x2743('0x13'),_0x4fe546,_0x4e77be[_0x2743('0x16')][_0x2743('0x18')]);return _0x1ddac1(_0x4e77be['error'][_0x2743('0x18')]);}else{logger[_0x2743('0x12')](_0x2743('0x13'),_0x4fe546,_0x2743('0x15'));_0x1ddac1(_0x4e77be[_0x2743('0x19')][_0x2743('0x18')]);}})[_0x2743('0x1a')](function(_0x2802c8){logger[_0x2743('0x16')](_0x2743('0x13'),_0x4fe546,_0x2802c8);_0x211c36(_0x2802c8);});});}exports['GetWhatsappQueue']=function(_0x978f1e){var _0x11af30=this;return new Promise(function(_0x2aad2e,_0x2b2cd4){return db['WhatsappQueue'][_0x2743('0x1b')]({'raw':_0x978f1e[_0x2743('0x1c')]?_0x978f1e[_0x2743('0x1c')][_0x2743('0x1d')]===undefined?!![]:![]:!![],'where':_0x978f1e[_0x2743('0x1c')]?_0x978f1e[_0x2743('0x1c')]['where']||null:null,'attributes':_0x978f1e[_0x2743('0x1c')]?_0x978f1e['options'][_0x2743('0x1e')]||null:null,'limit':_0x978f1e['options']?_0x978f1e[_0x2743('0x1c')][_0x2743('0x1f')]||null:null,'include':_0x978f1e[_0x2743('0x1c')]?_0x978f1e['options'][_0x2743('0x20')]?_[_0x2743('0x21')](_0x978f1e[_0x2743('0x1c')][_0x2743('0x20')],function(_0xd6bce2){return{'model':db[_0xd6bce2[_0x2743('0x22')]],'as':_0xd6bce2['as'],'attributes':_0xd6bce2['attributes'],'include':_0xd6bce2[_0x2743('0x20')]?_[_0x2743('0x21')](_0xd6bce2[_0x2743('0x20')],function(_0x5aebc6){return{'model':db[_0x5aebc6[_0x2743('0x22')]],'as':_0x5aebc6['as'],'attributes':_0x5aebc6[_0x2743('0x1e')],'include':_0x5aebc6[_0x2743('0x20')]?_[_0x2743('0x21')](_0x5aebc6[_0x2743('0x20')],function(_0x4e2700){return{'model':db[_0x4e2700['model']],'as':_0x4e2700['as'],'attributes':_0x4e2700[_0x2743('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x2743('0x11')](function(_0x16fc83){logger[_0x2743('0x12')]('GetWhatsappQueue',_0x978f1e);logger['debug'](_0x2743('0x23'),_0x978f1e,JSON[_0x2743('0x24')](_0x16fc83));_0x2aad2e(_0x16fc83);})[_0x2743('0x1a')](function(_0x2a3065){logger[_0x2743('0x16')](_0x2743('0x23'),_0x2a3065[_0x2743('0x18')],_0x978f1e);_0x2b2cd4(_0x11af30['error'](0x1f4,_0x2a3065['message']));});});};exports[_0x2743('0x25')]=function(_0x15721e){var _0x5e70bd=this;return new Promise(function(_0x5c6a2a,_0x423298){return db['WhatsappQueue'][_0x2743('0x26')]({'raw':_0x15721e[_0x2743('0x1c')]?_0x15721e['options']['raw']===undefined?!![]:![]:!![],'where':_0x15721e['options']?_0x15721e[_0x2743('0x1c')][_0x2743('0x27')]||null:null,'attributes':_0x15721e[_0x2743('0x1c')]?_0x15721e[_0x2743('0x1c')][_0x2743('0x1e')]||null:null,'include':_0x15721e[_0x2743('0x1c')]?_0x15721e['options']['include']?_[_0x2743('0x21')](_0x15721e['options']['include'],function(_0x5b30ed){return{'model':db[_0x5b30ed[_0x2743('0x22')]],'as':_0x5b30ed['as'],'attributes':_0x5b30ed[_0x2743('0x1e')],'include':_0x5b30ed[_0x2743('0x20')]?_['map'](_0x5b30ed[_0x2743('0x20')],function(_0x440f82){return{'model':db[_0x440f82[_0x2743('0x22')]],'as':_0x440f82['as'],'attributes':_0x440f82[_0x2743('0x1e')],'include':_0x440f82['include']?_['map'](_0x440f82['include'],function(_0x19b1fb){return{'model':db[_0x19b1fb[_0x2743('0x22')]],'as':_0x19b1fb['as'],'attributes':_0x19b1fb[_0x2743('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x2743('0x11')](function(_0x440b6d){logger[_0x2743('0x12')](_0x2743('0x25'),_0x15721e);logger[_0x2743('0x14')]('ShowWhatsappQueue',_0x15721e,JSON[_0x2743('0x24')](_0x440b6d));_0x5c6a2a(_0x440b6d);})[_0x2743('0x1a')](function(_0x1894d7){logger[_0x2743('0x16')]('ShowWhatsappQueue',_0x1894d7[_0x2743('0x18')],_0x15721e);_0x423298(_0x5e70bd[_0x2743('0x16')](0x1f4,_0x1894d7[_0x2743('0x18')]));});});};
\ No newline at end of file
+var _0x4be7=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','register','request','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetWhatsappQueue','WhatsappQueue','findAll','options','raw','where','attributes','limit','include','model','map','then','ShowWhatsappQueue','find','lodash','util'];(function(_0x316138,_0x129321){var _0x4f0cd9=function(_0x4cef4e){while(--_0x4cef4e){_0x316138['push'](_0x316138['shift']());}};_0x4f0cd9(++_0x129321);}(_0x4be7,0x1b6));var _0x74be=function(_0x1b892b,_0x4efe48){_0x1b892b=_0x1b892b-0x0;var _0xa99e57=_0x4be7[_0x1b892b];return _0xa99e57;};'use strict';var _=require(_0x74be('0x0'));var util=require(_0x74be('0x1'));var moment=require(_0x74be('0x2'));var BPromise=require(_0x74be('0x3'));var rs=require(_0x74be('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x74be('0x5'))['db'];var utils=require(_0x74be('0x6'));var logger=require('../../config/logger')(_0x74be('0x7'));var config=require(_0x74be('0x8'));var jayson=require(_0x74be('0x9'));var client=jayson[_0x74be('0xa')][_0x74be('0xb')]({'port':0x232a});config[_0x74be('0xc')]=_[_0x74be('0xd')](config[_0x74be('0xc')],{'host':_0x74be('0xe'),'port':0x18eb});var socket=require(_0x74be('0xf'))(new Redis(config[_0x74be('0xc')]));require(_0x74be('0x10'))[_0x74be('0x11')](socket);function respondWithRpcPromise(_0x3dc889,_0x174fa8,_0xba8032){return new BPromise(function(_0x10a306,_0x285fc6){return client[_0x74be('0x12')](_0x3dc889,_0xba8032)['then'](function(_0x1294e8){logger[_0x74be('0x13')](_0x74be('0x14'),_0x174fa8,_0x74be('0x15'));logger[_0x74be('0x16')](_0x74be('0x17'),_0x174fa8,_0x74be('0x15'),JSON[_0x74be('0x18')](_0x1294e8));if(_0x1294e8['error']){if(_0x1294e8[_0x74be('0x19')][_0x74be('0x1a')]===0x1f4){logger[_0x74be('0x19')](_0x74be('0x14'),_0x174fa8,_0x1294e8[_0x74be('0x19')][_0x74be('0x1b')]);return _0x285fc6(_0x1294e8[_0x74be('0x19')][_0x74be('0x1b')]);}logger[_0x74be('0x19')](_0x74be('0x14'),_0x174fa8,_0x1294e8[_0x74be('0x19')][_0x74be('0x1b')]);return _0x10a306(_0x1294e8['error'][_0x74be('0x1b')]);}else{logger['info']('WhatsappQueue,\x20%s,\x20%s',_0x174fa8,_0x74be('0x15'));_0x10a306(_0x1294e8[_0x74be('0x1c')]['message']);}})[_0x74be('0x1d')](function(_0x1d04fa){logger['error'](_0x74be('0x14'),_0x174fa8,_0x1d04fa);_0x285fc6(_0x1d04fa);});});}exports[_0x74be('0x1e')]=function(_0x1d9289){var _0xbf0a97=this;return new Promise(function(_0x4fc74b,_0x42a1b0){return db[_0x74be('0x1f')][_0x74be('0x20')]({'raw':_0x1d9289[_0x74be('0x21')]?_0x1d9289[_0x74be('0x21')][_0x74be('0x22')]===undefined?!![]:![]:!![],'where':_0x1d9289[_0x74be('0x21')]?_0x1d9289[_0x74be('0x21')][_0x74be('0x23')]||null:null,'attributes':_0x1d9289[_0x74be('0x21')]?_0x1d9289[_0x74be('0x21')][_0x74be('0x24')]||null:null,'limit':_0x1d9289['options']?_0x1d9289[_0x74be('0x21')][_0x74be('0x25')]||null:null,'include':_0x1d9289[_0x74be('0x21')]?_0x1d9289[_0x74be('0x21')][_0x74be('0x26')]?_['map'](_0x1d9289[_0x74be('0x21')][_0x74be('0x26')],function(_0x26a0b3){return{'model':db[_0x26a0b3[_0x74be('0x27')]],'as':_0x26a0b3['as'],'attributes':_0x26a0b3[_0x74be('0x24')],'include':_0x26a0b3['include']?_[_0x74be('0x28')](_0x26a0b3[_0x74be('0x26')],function(_0x54a54a){return{'model':db[_0x54a54a[_0x74be('0x27')]],'as':_0x54a54a['as'],'attributes':_0x54a54a[_0x74be('0x24')],'include':_0x54a54a[_0x74be('0x26')]?_['map'](_0x54a54a[_0x74be('0x26')],function(_0x53bd5d){return{'model':db[_0x53bd5d['model']],'as':_0x53bd5d['as'],'attributes':_0x53bd5d[_0x74be('0x24')]};}):[]};}):[]};}):[]:[]})[_0x74be('0x29')](function(_0x142efd){logger['info'](_0x74be('0x1e'),_0x1d9289);logger[_0x74be('0x16')](_0x74be('0x1e'),_0x1d9289,JSON[_0x74be('0x18')](_0x142efd));_0x4fc74b(_0x142efd);})['catch'](function(_0x30b22e){logger[_0x74be('0x19')](_0x74be('0x1e'),_0x30b22e[_0x74be('0x1b')],_0x1d9289);_0x42a1b0(_0xbf0a97['error'](0x1f4,_0x30b22e['message']));});});};exports[_0x74be('0x2a')]=function(_0x357199){var _0x346725=this;return new Promise(function(_0x40fbb0,_0x4f1a3b){return db['WhatsappQueue'][_0x74be('0x2b')]({'raw':_0x357199[_0x74be('0x21')]?_0x357199[_0x74be('0x21')][_0x74be('0x22')]===undefined?!![]:![]:!![],'where':_0x357199[_0x74be('0x21')]?_0x357199['options'][_0x74be('0x23')]||null:null,'attributes':_0x357199[_0x74be('0x21')]?_0x357199['options'][_0x74be('0x24')]||null:null,'include':_0x357199[_0x74be('0x21')]?_0x357199[_0x74be('0x21')][_0x74be('0x26')]?_[_0x74be('0x28')](_0x357199[_0x74be('0x21')][_0x74be('0x26')],function(_0x299b4c){return{'model':db[_0x299b4c[_0x74be('0x27')]],'as':_0x299b4c['as'],'attributes':_0x299b4c[_0x74be('0x24')],'include':_0x299b4c[_0x74be('0x26')]?_[_0x74be('0x28')](_0x299b4c['include'],function(_0x326cd4){return{'model':db[_0x326cd4['model']],'as':_0x326cd4['as'],'attributes':_0x326cd4[_0x74be('0x24')],'include':_0x326cd4[_0x74be('0x26')]?_[_0x74be('0x28')](_0x326cd4[_0x74be('0x26')],function(_0x252443){return{'model':db[_0x252443[_0x74be('0x27')]],'as':_0x252443['as'],'attributes':_0x252443[_0x74be('0x24')]};}):[]};}):[]};}):[]:[]})[_0x74be('0x29')](function(_0x4c0811){logger['info'](_0x74be('0x2a'),_0x357199);logger['debug'](_0x74be('0x2a'),_0x357199,JSON[_0x74be('0x18')](_0x4c0811));_0x40fbb0(_0x4c0811);})[_0x74be('0x1d')](function(_0x450fcf){logger[_0x74be('0x19')](_0x74be('0x2a'),_0x450fcf['message'],_0x357199);_0x4f1a3b(_0x346725[_0x74be('0x19')](0x1f4,_0x450fcf[_0x74be('0x1b')]));});});};
\ No newline at end of file
index e81c064..cfc78f1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x156e=['update','removeListener','register','length','whatsappQueue:','./whatsappQueue.events','remove'];(function(_0x43b6a9,_0x199f4d){var _0x263809=function(_0x1b73b1){while(--_0x1b73b1){_0x43b6a9['push'](_0x43b6a9['shift']());}};_0x263809(++_0x199f4d);}(_0x156e,0xbb));var _0xe156=function(_0x265c8d,_0x39e7b1){_0x265c8d=_0x265c8d-0x0;var _0x38904a=_0x156e[_0x265c8d];return _0x38904a;};'use strict';var WhatsappQueueEvents=require(_0xe156('0x0'));var events=['save',_0xe156('0x1'),_0xe156('0x2')];function createListener(_0x4abe29,_0x47a4cd){return function(_0x47bf47){_0x47a4cd['emit'](_0x4abe29,_0x47bf47);};}function removeListener(_0x55734e,_0x1528fd){return function(){WhatsappQueueEvents[_0xe156('0x3')](_0x55734e,_0x1528fd);};}exports[_0xe156('0x4')]=function(_0x3787f5){for(var _0x52df00=0x0,_0xe1770a=events[_0xe156('0x5')];_0x52df00<_0xe1770a;_0x52df00++){var _0x2a4007=events[_0x52df00];var _0x2b5d0c=createListener(_0xe156('0x6')+_0x2a4007,_0x3787f5);WhatsappQueueEvents['on'](_0x2a4007,_0x2b5d0c);}};
\ No newline at end of file
+var _0x1c64=['length','./whatsappQueue.events','save','emit','register'];(function(_0x58427a,_0x3f10d1){var _0x4852e8=function(_0x3b28fb){while(--_0x3b28fb){_0x58427a['push'](_0x58427a['shift']());}};_0x4852e8(++_0x3f10d1);}(_0x1c64,0x6f));var _0x41c6=function(_0x1aafcd,_0x223bc4){_0x1aafcd=_0x1aafcd-0x0;var _0x582d5c=_0x1c64[_0x1aafcd];return _0x582d5c;};'use strict';var WhatsappQueueEvents=require(_0x41c6('0x0'));var events=[_0x41c6('0x1'),'remove','update'];function createListener(_0x381520,_0x5651e5){return function(_0x2e9c14){_0x5651e5[_0x41c6('0x2')](_0x381520,_0x2e9c14);};}function removeListener(_0x53517f,_0x32d40e){return function(){WhatsappQueueEvents['removeListener'](_0x53517f,_0x32d40e);};}exports[_0x41c6('0x3')]=function(_0xb31a0b){for(var _0x328762=0x0,_0x5134d4=events[_0x41c6('0x4')];_0x328762<_0x5134d4;_0x328762++){var _0x553663=events[_0x328762];var _0x3ee68a=createListener('whatsappQueue:'+_0x553663,_0xb31a0b);WhatsappQueueEvents['on'](_0x553663,_0x3ee68a);}};
\ No newline at end of file
index 366fdae..17b77f3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x54e4=['exports','multer','path','express','fs-extra','../../components/interaction/service','../../config/environment','./whatsappQueueReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','create','delete'];(function(_0x247b8a,_0xb4cf0f){var _0x491409=function(_0x325898){while(--_0x325898){_0x247b8a['push'](_0x247b8a['shift']());}};_0x491409(++_0xb4cf0f);}(_0x54e4,0x169));var _0x454e=function(_0x2b5291,_0x12ee5f){_0x2b5291=_0x2b5291-0x0;var _0x26c5c9=_0x54e4[_0x2b5291];return _0x26c5c9;};'use strict';var multer=require(_0x454e('0x0'));var util=require('util');var path=require(_0x454e('0x1'));var timeout=require('connect-timeout');var express=require(_0x454e('0x2'));var router=express['Router']();var fs_extra=require(_0x454e('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x454e('0x4'));var config=require(_0x454e('0x5'));var controller=require(_0x454e('0x6'));router[_0x454e('0x7')]('/',auth['isAuthenticated'](),controller[_0x454e('0x8')]);router[_0x454e('0x7')](_0x454e('0x9'),auth[_0x454e('0xa')](),controller[_0x454e('0xb')]);router[_0x454e('0x7')](_0x454e('0xc'),auth['isAuthenticated'](),controller[_0x454e('0xd')]);router[_0x454e('0xe')]('/',auth[_0x454e('0xa')](),controller[_0x454e('0xf')]);router['put'](_0x454e('0xc'),auth[_0x454e('0xa')](),controller['update']);router[_0x454e('0x10')](_0x454e('0xc'),auth[_0x454e('0xa')](),controller['destroy']);module[_0x454e('0x11')]=router;
\ No newline at end of file
+var _0x0aff=['./whatsappQueueReport.controller','get','isAuthenticated','index','create','put','/:id','update','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x4353ac,_0x1e24d7){var _0x312a73=function(_0x26d2eb){while(--_0x26d2eb){_0x4353ac['push'](_0x4353ac['shift']());}};_0x312a73(++_0x1e24d7);}(_0x0aff,0xe1));var _0xf0af=function(_0x104a84,_0x285970){_0x104a84=_0x104a84-0x0;var _0x4973ff=_0x0aff[_0x104a84];return _0x4973ff;};'use strict';var multer=require(_0xf0af('0x0'));var util=require(_0xf0af('0x1'));var path=require(_0xf0af('0x2'));var timeout=require('connect-timeout');var express=require(_0xf0af('0x3'));var router=express[_0xf0af('0x4')]();var fs_extra=require(_0xf0af('0x5'));var auth=require(_0xf0af('0x6'));var interaction=require(_0xf0af('0x7'));var config=require(_0xf0af('0x8'));var controller=require(_0xf0af('0x9'));router[_0xf0af('0xa')]('/',auth[_0xf0af('0xb')](),controller[_0xf0af('0xc')]);router['get']('/describe',auth[_0xf0af('0xb')](),controller['describe']);router[_0xf0af('0xa')]('/:id',auth[_0xf0af('0xb')](),controller['show']);router['post']('/',auth[_0xf0af('0xb')](),controller[_0xf0af('0xd')]);router[_0xf0af('0xe')](_0xf0af('0xf'),auth[_0xf0af('0xb')](),controller[_0xf0af('0x10')]);router['delete'](_0xf0af('0xf'),auth[_0xf0af('0xb')](),controller[_0xf0af('0x11')]);module['exports']=router;
\ No newline at end of file
index 5bef96b..798da30 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['exports','STRING','DATE','sequelize'];(function(_0x43d440,_0x30a005){var _0x58a4ed=function(_0x2076d9){while(--_0x2076d9){_0x43d440['push'](_0x43d440['shift']());}};_0x58a4ed(++_0x30a005);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'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(_0x42d482,_0x4b6d46){var _0x347902=function(_0x12e81e){while(--_0x12e81e){_0x42d482['push'](_0x42d482['shift']());}};_0x347902(++_0x4b6d46);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'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 f55f497..dbd4927 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x757a=['include','findAll','rows','show','params','WhatsappQueueReport','find','create','body','catch','destroy','describe','rimraf','zip-dir','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','status','json','offset','undefined','count','limit','Content-Range','apply','update','then','end','sendStatus','error','stack','name','map','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll'];(function(_0x75060f,_0x32ff36){var _0x5eb3a7=function(_0x1a349a){while(--_0x1a349a){_0x75060f['push'](_0x75060f['shift']());}};_0x5eb3a7(++_0x32ff36);}(_0x757a,0xde));var _0xa757=function(_0x819598,_0x106860){_0x819598=_0x819598-0x0;var _0x4cb9cc=_0x757a[_0x819598];return _0x4cb9cc;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa757('0x0'));var zipdir=require(_0xa757('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xa757('0x2'));var Mustache=require(_0xa757('0x3'));var util=require(_0xa757('0x4'));var path=require(_0xa757('0x5'));var sox=require(_0xa757('0x6'));var csv=require(_0xa757('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa757('0x8'));var _=require(_0xa757('0x9'));var squel=require('squel');var crypto=require(_0xa757('0xa'));var jsforce=require(_0xa757('0xb'));var deskjs=require(_0xa757('0xc'));var toCsv=require(_0xa757('0x7'));var querystring=require(_0xa757('0xd'));var Papa=require('papaparse');var Redis=require(_0xa757('0xe'));var authService=require(_0xa757('0xf'));var qs=require(_0xa757('0x10'));var as=require(_0xa757('0x11'));var hardwareService=require(_0xa757('0x12'));var logger=require(_0xa757('0x13'))(_0xa757('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4db68e,_0x421040){_0x421040=_0x421040||0xcc;return function(_0x544b45){if(_0x544b45){return _0x4db68e['sendStatus'](_0x421040);}return _0x4db68e[_0xa757('0x15')](_0x421040)['end']();};}function respondWithResult(_0x481508,_0x32112b){_0x32112b=_0x32112b||0xc8;return function(_0x1b670e){if(_0x1b670e){return _0x481508[_0xa757('0x15')](_0x32112b)[_0xa757('0x16')](_0x1b670e);}};}function respondWithFilteredResult(_0x86abd,_0x31cfd2){return function(_0xf12b68){if(_0xf12b68){var _0x2f7947=typeof _0x31cfd2[_0xa757('0x17')]===_0xa757('0x18')&&typeof _0x31cfd2['limit']===_0xa757('0x18');var _0x44eab8=_0xf12b68[_0xa757('0x19')];var _0x4d9f58=_0x2f7947?0x0:_0x31cfd2['offset'];var _0x151c04=_0x2f7947?_0xf12b68[_0xa757('0x19')]:_0x31cfd2[_0xa757('0x17')]+_0x31cfd2[_0xa757('0x1a')];var _0x27f4ba;if(_0x151c04>=_0x44eab8){_0x151c04=_0x44eab8;_0x27f4ba=0xc8;}else{_0x27f4ba=0xce;}_0x86abd[_0xa757('0x15')](_0x27f4ba);return _0x86abd['set'](_0xa757('0x1b'),_0x4d9f58+'-'+_0x151c04+'/'+_0x44eab8)['json'](_0xf12b68);}return null;};}function patchUpdates(_0x32c2a1){return function(_0x167640){try{jsonpatch[_0xa757('0x1c')](_0x167640,_0x32c2a1,!![]);}catch(_0x2c9ec6){return BPromise['reject'](_0x2c9ec6);}return _0x167640['save']();};}function saveUpdates(_0x40ec48,_0x2159cf){return function(_0x2ba923){if(_0x2ba923){return _0x2ba923[_0xa757('0x1d')](_0x40ec48)[_0xa757('0x1e')](function(_0x40562f){return _0x40562f;});}return null;};}function removeEntity(_0x2ca10d,_0x21f1af){return function(_0x2bf276){if(_0x2bf276){return _0x2bf276['destroy']()[_0xa757('0x1e')](function(){_0x2ca10d['status'](0xcc)[_0xa757('0x1f')]();});}};}function handleEntityNotFound(_0x47903b,_0x40551d){return function(_0x3859ce){if(!_0x3859ce){_0x47903b[_0xa757('0x20')](0x194);}return _0x3859ce;};}function handleError(_0x4d58a4,_0x2b19d5){_0x2b19d5=_0x2b19d5||0x1f4;return function(_0xcd98bd){logger[_0xa757('0x21')](_0xcd98bd[_0xa757('0x22')]);if(_0xcd98bd['name']){delete _0xcd98bd[_0xa757('0x23')];}_0x4d58a4['status'](_0x2b19d5)['send'](_0xcd98bd);};}exports['index']=function(_0x4f8de2,_0xfdf69d){var _0x596ae2={},_0x2208f9={},_0x3bc24c={'count':0x0,'rows':[]};var _0x55c5f8=_[_0xa757('0x24')](db['WhatsappQueueReport'][_0xa757('0x25')],function(_0xa6d0f6){return{'name':_0xa6d0f6['fieldName'],'type':_0xa6d0f6[_0xa757('0x26')]['key']};});_0x2208f9[_0xa757('0x27')]=_[_0xa757('0x24')](_0x55c5f8,_0xa757('0x23'));_0x2208f9[_0xa757('0x28')]=_[_0xa757('0x29')](_0x4f8de2[_0xa757('0x28')]);_0x2208f9[_0xa757('0x2a')]=_[_0xa757('0x2b')](_0x2208f9[_0xa757('0x27')],_0x2208f9[_0xa757('0x28')]);_0x596ae2[_0xa757('0x2c')]=_[_0xa757('0x2b')](_0x2208f9[_0xa757('0x27')],qs[_0xa757('0x2d')](_0x4f8de2[_0xa757('0x28')][_0xa757('0x2d')]));_0x596ae2[_0xa757('0x2c')]=_0x596ae2[_0xa757('0x2c')][_0xa757('0x2e')]?_0x596ae2[_0xa757('0x2c')]:_0x2208f9[_0xa757('0x27')];if(!_0x4f8de2[_0xa757('0x28')][_0xa757('0x2f')](_0xa757('0x30'))){_0x596ae2['limit']=qs[_0xa757('0x1a')](_0x4f8de2[_0xa757('0x28')][_0xa757('0x1a')]);_0x596ae2[_0xa757('0x17')]=qs[_0xa757('0x17')](_0x4f8de2['query'][_0xa757('0x17')]);}_0x596ae2[_0xa757('0x31')]=qs[_0xa757('0x32')](_0x4f8de2[_0xa757('0x28')][_0xa757('0x32')]);_0x596ae2[_0xa757('0x33')]=qs['filters'](_[_0xa757('0x34')](_0x4f8de2[_0xa757('0x28')],_0x2208f9[_0xa757('0x2a')]),_0x55c5f8);if(_0x4f8de2[_0xa757('0x28')][_0xa757('0x35')]){_0x596ae2[_0xa757('0x33')]=_[_0xa757('0x36')](_0x596ae2[_0xa757('0x33')],{'$or':_[_0xa757('0x24')](_0x55c5f8,function(_0x4f9d98){if(_0x4f9d98[_0xa757('0x26')]!==_0xa757('0x37')){var _0x9f73c6={};_0x9f73c6[_0x4f9d98[_0xa757('0x23')]]={'$like':'%'+_0x4f8de2[_0xa757('0x28')][_0xa757('0x35')]+'%'};return _0x9f73c6;}})});}_0x596ae2=_['merge']({},_0x596ae2,_0x4f8de2[_0xa757('0x38')]);var _0x6d77ed={'where':_0x596ae2['where']};return db['WhatsappQueueReport'][_0xa757('0x19')](_0x6d77ed)[_0xa757('0x1e')](function(_0x5b11fe){_0x3bc24c['count']=_0x5b11fe;if(_0x4f8de2[_0xa757('0x28')][_0xa757('0x39')]){_0x596ae2[_0xa757('0x3a')]=[{'all':!![]}];}return db['WhatsappQueueReport'][_0xa757('0x3b')](_0x596ae2);})[_0xa757('0x1e')](function(_0x26802c){_0x3bc24c[_0xa757('0x3c')]=_0x26802c;return _0x3bc24c;})[_0xa757('0x1e')](respondWithFilteredResult(_0xfdf69d,_0x596ae2))['catch'](handleError(_0xfdf69d,null));};exports[_0xa757('0x3d')]=function(_0x52c728,_0x564d40){var _0x43329c={'raw':!![],'where':{'id':_0x52c728[_0xa757('0x3e')]['id']}},_0x57298b={};_0x57298b[_0xa757('0x27')]=_[_0xa757('0x29')](db['WhatsappQueueReport']['rawAttributes']);_0x57298b[_0xa757('0x28')]=_[_0xa757('0x29')](_0x52c728[_0xa757('0x28')]);_0x57298b[_0xa757('0x2a')]=_[_0xa757('0x2b')](_0x57298b[_0xa757('0x27')],_0x57298b['query']);_0x43329c[_0xa757('0x2c')]=_[_0xa757('0x2b')](_0x57298b['model'],qs[_0xa757('0x2d')](_0x52c728['query'][_0xa757('0x2d')]));_0x43329c[_0xa757('0x2c')]=_0x43329c['attributes'][_0xa757('0x2e')]?_0x43329c[_0xa757('0x2c')]:_0x57298b['model'];if(_0x52c728[_0xa757('0x28')][_0xa757('0x39')]){_0x43329c[_0xa757('0x3a')]=[{'all':!![]}];}_0x43329c=_[_0xa757('0x36')]({},_0x43329c,_0x52c728['options']);return db[_0xa757('0x3f')][_0xa757('0x40')](_0x43329c)[_0xa757('0x1e')](handleEntityNotFound(_0x564d40,null))[_0xa757('0x1e')](respondWithResult(_0x564d40,null))['catch'](handleError(_0x564d40,null));};exports[_0xa757('0x41')]=function(_0x5b6017,_0x50c131){return db[_0xa757('0x3f')][_0xa757('0x41')](_0x5b6017[_0xa757('0x42')],{})['then'](respondWithResult(_0x50c131,0xc9))[_0xa757('0x43')](handleError(_0x50c131,null));};exports['update']=function(_0x2ed63f,_0x151cc3){if(_0x2ed63f[_0xa757('0x42')]['id']){delete _0x2ed63f[_0xa757('0x42')]['id'];}return db[_0xa757('0x3f')][_0xa757('0x40')]({'where':{'id':_0x2ed63f[_0xa757('0x3e')]['id']}})[_0xa757('0x1e')](handleEntityNotFound(_0x151cc3,null))['then'](saveUpdates(_0x2ed63f[_0xa757('0x42')],null))[_0xa757('0x1e')](respondWithResult(_0x151cc3,null))[_0xa757('0x43')](handleError(_0x151cc3,null));};exports[_0xa757('0x44')]=function(_0x319988,_0x1f10cf){return db[_0xa757('0x3f')][_0xa757('0x40')]({'where':{'id':_0x319988[_0xa757('0x3e')]['id']}})[_0xa757('0x1e')](handleEntityNotFound(_0x1f10cf,null))[_0xa757('0x1e')](removeEntity(_0x1f10cf,null))[_0xa757('0x43')](handleError(_0x1f10cf,null));};exports[_0xa757('0x45')]=function(_0x354ad5,_0x388573){return db[_0xa757('0x3f')]['describe']()[_0xa757('0x1e')](respondWithResult(_0x388573,null))['catch'](handleError(_0x388573,null));};
\ No newline at end of file
+var _0x351d=['includeAll','include','catch','show','params','rawAttributes','create','body','find','describe','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','to-csv','ejs','fs-extra','squel','crypto','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','sendStatus','end','status','json','limit','count','offset','apply','reject','save','update','destroy','then','name','send','map','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','WhatsappQueueReport'];(function(_0x5e1ca7,_0x34b97d){var _0x182e83=function(_0xd6c287){while(--_0xd6c287){_0x5e1ca7['push'](_0x5e1ca7['shift']());}};_0x182e83(++_0x34b97d);}(_0x351d,0x90));var _0xd351=function(_0x5bc111,_0x3a0d3c){_0x5bc111=_0x5bc111-0x0;var _0x54285c=_0x351d[_0x5bc111];return _0x54285c;};'use strict';var emlformat=require(_0xd351('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd351('0x1'));var jsonpatch=require(_0xd351('0x2'));var rp=require(_0xd351('0x3'));var moment=require('moment');var BPromise=require(_0xd351('0x4'));var Mustache=require('mustache');var util=require(_0xd351('0x5'));var path=require(_0xd351('0x6'));var sox=require('sox');var csv=require(_0xd351('0x7'));var ejs=require(_0xd351('0x8'));var fs=require('fs');var fs_extra=require(_0xd351('0x9'));var _=require('lodash');var squel=require(_0xd351('0xa'));var crypto=require(_0xd351('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xd351('0xc'));var toCsv=require(_0xd351('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd351('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xd351('0xe'));var as=require(_0xd351('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd351('0x10'))(_0xd351('0x11'));var utils=require('../../config/utils');var config=require(_0xd351('0x12'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3eb40c,_0x15549a){_0x15549a=_0x15549a||0xcc;return function(_0x23445f){if(_0x23445f){return _0x3eb40c[_0xd351('0x13')](_0x15549a);}return _0x3eb40c['status'](_0x15549a)[_0xd351('0x14')]();};}function respondWithResult(_0x316cf6,_0x597d7c){_0x597d7c=_0x597d7c||0xc8;return function(_0xc5a145){if(_0xc5a145){return _0x316cf6[_0xd351('0x15')](_0x597d7c)[_0xd351('0x16')](_0xc5a145);}};}function respondWithFilteredResult(_0xf1c285,_0x3867fb){return function(_0x4d238c){if(_0x4d238c){var _0x9f790f=typeof _0x3867fb['offset']==='undefined'&&typeof _0x3867fb[_0xd351('0x17')]==='undefined';var _0x21e591=_0x4d238c[_0xd351('0x18')];var _0x4e0164=_0x9f790f?0x0:_0x3867fb['offset'];var _0x1e1a3c=_0x9f790f?_0x4d238c[_0xd351('0x18')]:_0x3867fb[_0xd351('0x19')]+_0x3867fb[_0xd351('0x17')];var _0x51f265;if(_0x1e1a3c>=_0x21e591){_0x1e1a3c=_0x21e591;_0x51f265=0xc8;}else{_0x51f265=0xce;}_0xf1c285[_0xd351('0x15')](_0x51f265);return _0xf1c285['set']('Content-Range',_0x4e0164+'-'+_0x1e1a3c+'/'+_0x21e591)[_0xd351('0x16')](_0x4d238c);}return null;};}function patchUpdates(_0x4a427b){return function(_0x33b1e5){try{jsonpatch[_0xd351('0x1a')](_0x33b1e5,_0x4a427b,!![]);}catch(_0x3634c9){return BPromise[_0xd351('0x1b')](_0x3634c9);}return _0x33b1e5[_0xd351('0x1c')]();};}function saveUpdates(_0x53e729,_0x18625b){return function(_0xbbc58){if(_0xbbc58){return _0xbbc58[_0xd351('0x1d')](_0x53e729)['then'](function(_0x1ce7f7){return _0x1ce7f7;});}return null;};}function removeEntity(_0x2d9aa0,_0x365bbc){return function(_0x59fb6d){if(_0x59fb6d){return _0x59fb6d[_0xd351('0x1e')]()[_0xd351('0x1f')](function(){_0x2d9aa0[_0xd351('0x15')](0xcc)[_0xd351('0x14')]();});}};}function handleEntityNotFound(_0x489c9a,_0x40f7f3){return function(_0x483c92){if(!_0x483c92){_0x489c9a[_0xd351('0x13')](0x194);}return _0x483c92;};}function handleError(_0x8ad0a6,_0x54f471){_0x54f471=_0x54f471||0x1f4;return function(_0x2648d0){logger['error'](_0x2648d0['stack']);if(_0x2648d0[_0xd351('0x20')]){delete _0x2648d0['name'];}_0x8ad0a6['status'](_0x54f471)[_0xd351('0x21')](_0x2648d0);};}exports['index']=function(_0x38471c,_0x2ddae8){var _0x407b50={},_0x4d3f48={},_0x71ce9c={'count':0x0,'rows':[]};var _0x4aa902=_[_0xd351('0x22')](db['WhatsappQueueReport']['rawAttributes'],function(_0xeb4da9){return{'name':_0xeb4da9[_0xd351('0x23')],'type':_0xeb4da9[_0xd351('0x24')][_0xd351('0x25')]};});_0x4d3f48['model']=_[_0xd351('0x22')](_0x4aa902,_0xd351('0x20'));_0x4d3f48[_0xd351('0x26')]=_[_0xd351('0x27')](_0x38471c[_0xd351('0x26')]);_0x4d3f48[_0xd351('0x28')]=_[_0xd351('0x29')](_0x4d3f48[_0xd351('0x2a')],_0x4d3f48[_0xd351('0x26')]);_0x407b50['attributes']=_[_0xd351('0x29')](_0x4d3f48[_0xd351('0x2a')],qs[_0xd351('0x2b')](_0x38471c[_0xd351('0x26')]['fields']));_0x407b50[_0xd351('0x2c')]=_0x407b50[_0xd351('0x2c')][_0xd351('0x2d')]?_0x407b50[_0xd351('0x2c')]:_0x4d3f48[_0xd351('0x2a')];if(!_0x38471c[_0xd351('0x26')][_0xd351('0x2e')](_0xd351('0x2f'))){_0x407b50[_0xd351('0x17')]=qs['limit'](_0x38471c['query'][_0xd351('0x17')]);_0x407b50[_0xd351('0x19')]=qs[_0xd351('0x19')](_0x38471c[_0xd351('0x26')][_0xd351('0x19')]);}_0x407b50[_0xd351('0x30')]=qs['sort'](_0x38471c['query'][_0xd351('0x31')]);_0x407b50['where']=qs[_0xd351('0x28')](_[_0xd351('0x32')](_0x38471c[_0xd351('0x26')],_0x4d3f48[_0xd351('0x28')]),_0x4aa902);if(_0x38471c[_0xd351('0x26')][_0xd351('0x33')]){_0x407b50[_0xd351('0x34')]=_[_0xd351('0x35')](_0x407b50[_0xd351('0x34')],{'$or':_[_0xd351('0x22')](_0x4aa902,function(_0x2b7170){if(_0x2b7170['type']!==_0xd351('0x36')){var _0x5f0b1c={};_0x5f0b1c[_0x2b7170[_0xd351('0x20')]]={'$like':'%'+_0x38471c[_0xd351('0x26')][_0xd351('0x33')]+'%'};return _0x5f0b1c;}})});}_0x407b50=_[_0xd351('0x35')]({},_0x407b50,_0x38471c[_0xd351('0x37')]);var _0x3db72a={'where':_0x407b50['where']};return db[_0xd351('0x38')][_0xd351('0x18')](_0x3db72a)['then'](function(_0x2e1219){_0x71ce9c[_0xd351('0x18')]=_0x2e1219;if(_0x38471c[_0xd351('0x26')][_0xd351('0x39')]){_0x407b50[_0xd351('0x3a')]=[{'all':!![]}];}return db['WhatsappQueueReport']['findAll'](_0x407b50);})[_0xd351('0x1f')](function(_0x3935aa){_0x71ce9c['rows']=_0x3935aa;return _0x71ce9c;})['then'](respondWithFilteredResult(_0x2ddae8,_0x407b50))[_0xd351('0x3b')](handleError(_0x2ddae8,null));};exports[_0xd351('0x3c')]=function(_0x4ff06a,_0x570d57){var _0x46af23={'raw':!![],'where':{'id':_0x4ff06a[_0xd351('0x3d')]['id']}},_0x18f9d1={};_0x18f9d1[_0xd351('0x2a')]=_[_0xd351('0x27')](db[_0xd351('0x38')][_0xd351('0x3e')]);_0x18f9d1[_0xd351('0x26')]=_[_0xd351('0x27')](_0x4ff06a['query']);_0x18f9d1['filters']=_[_0xd351('0x29')](_0x18f9d1[_0xd351('0x2a')],_0x18f9d1[_0xd351('0x26')]);_0x46af23[_0xd351('0x2c')]=_[_0xd351('0x29')](_0x18f9d1[_0xd351('0x2a')],qs[_0xd351('0x2b')](_0x4ff06a[_0xd351('0x26')][_0xd351('0x2b')]));_0x46af23[_0xd351('0x2c')]=_0x46af23[_0xd351('0x2c')][_0xd351('0x2d')]?_0x46af23[_0xd351('0x2c')]:_0x18f9d1[_0xd351('0x2a')];if(_0x4ff06a[_0xd351('0x26')][_0xd351('0x39')]){_0x46af23['include']=[{'all':!![]}];}_0x46af23=_[_0xd351('0x35')]({},_0x46af23,_0x4ff06a[_0xd351('0x37')]);return db[_0xd351('0x38')]['find'](_0x46af23)[_0xd351('0x1f')](handleEntityNotFound(_0x570d57,null))[_0xd351('0x1f')](respondWithResult(_0x570d57,null))[_0xd351('0x3b')](handleError(_0x570d57,null));};exports[_0xd351('0x3f')]=function(_0xbb92d4,_0x5bc86a){return db[_0xd351('0x38')]['create'](_0xbb92d4[_0xd351('0x40')],{})[_0xd351('0x1f')](respondWithResult(_0x5bc86a,0xc9))['catch'](handleError(_0x5bc86a,null));};exports['update']=function(_0x1bd727,_0x444206){if(_0x1bd727[_0xd351('0x40')]['id']){delete _0x1bd727['body']['id'];}return db[_0xd351('0x38')][_0xd351('0x41')]({'where':{'id':_0x1bd727['params']['id']}})[_0xd351('0x1f')](handleEntityNotFound(_0x444206,null))['then'](saveUpdates(_0x1bd727[_0xd351('0x40')],null))[_0xd351('0x1f')](respondWithResult(_0x444206,null))['catch'](handleError(_0x444206,null));};exports['destroy']=function(_0x25ea1e,_0x58ce5a){return db[_0xd351('0x38')][_0xd351('0x41')]({'where':{'id':_0x25ea1e[_0xd351('0x3d')]['id']}})['then'](handleEntityNotFound(_0x58ce5a,null))[_0xd351('0x1f')](removeEntity(_0x58ce5a,null))['catch'](handleError(_0x58ce5a,null));};exports['describe']=function(_0x48c287,_0x7e4bad){return db[_0xd351('0x38')][_0xd351('0x42')]()['then'](respondWithResult(_0x7e4bad,null))['catch'](handleError(_0x7e4bad,null));};
\ No newline at end of file
index bec3170..67b00ca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd8b8=['api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','WhatsappQueueReport','report_whatsapp_queue','uniqueid','../../config/logger'];(function(_0xd2b69,_0x1310bf){var _0x2af3dc=function(_0x233d83){while(--_0x233d83){_0xd2b69['push'](_0xd2b69['shift']());}};_0x2af3dc(++_0x1310bf);}(_0xd8b8,0x128));var _0x8d8b=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0xd8b8[_0x4e676e];return _0x336a3c;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x8d8b('0x0'))(_0x8d8b('0x1'));var moment=require(_0x8d8b('0x2'));var BPromise=require(_0x8d8b('0x3'));var rp=require(_0x8d8b('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8d8b('0x5'));var config=require(_0x8d8b('0x6'));var attributes=require('./whatsappQueueReport.attributes');module[_0x8d8b('0x7')]=function(_0x47d17c,_0x3deea4){return _0x47d17c['define'](_0x8d8b('0x8'),attributes,{'tableName':_0x8d8b('0x9'),'paranoid':![],'indexes':[{'name':_0x8d8b('0xa'),'fields':[_0x8d8b('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x91e0=['request-promise','path','rimraf','../../config/environment','./whatsappQueueReport.attributes','define','WhatsappQueueReport','uniqueid','bluebird'];(function(_0x14745d,_0x42451a){var _0x57008f=function(_0x51798b){while(--_0x51798b){_0x14745d['push'](_0x14745d['shift']());}};_0x57008f(++_0x42451a);}(_0x91e0,0xf2));var _0x091e=function(_0x1c5481,_0x2361da){_0x1c5481=_0x1c5481-0x0;var _0x515425=_0x91e0[_0x1c5481];return _0x515425;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x091e('0x0'));var rp=require(_0x091e('0x1'));var fs=require('fs');var path=require(_0x091e('0x2'));var rimraf=require(_0x091e('0x3'));var config=require(_0x091e('0x4'));var attributes=require(_0x091e('0x5'));module['exports']=function(_0x7cd103,_0x1451c2){return _0x7cd103[_0x091e('0x6')](_0x091e('0x7'),attributes,{'tableName':'report_whatsapp_queue','paranoid':![],'indexes':[{'name':_0x091e('0x8'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
index 7e26858..30aa203 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8305=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','WhatsappQueueReport','options','then','CreateWhatsappQueueReport','update','raw','where','attributes','limit','UpdateWhatsappQueueReport','util','moment'];(function(_0x27bcf5,_0x236765){var _0x4ce4cf=function(_0x4864ea){while(--_0x4864ea){_0x27bcf5['push'](_0x27bcf5['shift']());}};_0x4ce4cf(++_0x236765);}(_0x8305,0x1de));var _0x5830=function(_0x40adf2,_0x5a5f06){_0x40adf2=_0x40adf2-0x0;var _0x1600db=_0x8305[_0x40adf2];return _0x1600db;};'use strict';var _=require('lodash');var util=require(_0x5830('0x0'));var moment=require(_0x5830('0x1'));var BPromise=require(_0x5830('0x2'));var rs=require(_0x5830('0x3'));var fs=require('fs');var Redis=require(_0x5830('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x5830('0x5'));var logger=require(_0x5830('0x6'))('rpc');var config=require(_0x5830('0x7'));var jayson=require(_0x5830('0x8'));var client=jayson[_0x5830('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5534d6,_0x11f09c,_0x4076bd){return new BPromise(function(_0x48d939,_0x535e59){return client[_0x5830('0xa')](_0x5534d6,_0x4076bd)['then'](function(_0x1a36b1){logger[_0x5830('0xb')](_0x5830('0xc'),_0x11f09c,_0x5830('0xd'));logger[_0x5830('0xe')]('WhatsappQueueReport,\x20%s,\x20%s,\x20%s',_0x11f09c,_0x5830('0xd'),JSON['stringify'](_0x1a36b1));if(_0x1a36b1[_0x5830('0xf')]){if(_0x1a36b1[_0x5830('0xf')][_0x5830('0x10')]===0x1f4){logger[_0x5830('0xf')]('WhatsappQueueReport,\x20%s,\x20%s',_0x11f09c,_0x1a36b1[_0x5830('0xf')]['message']);return _0x535e59(_0x1a36b1[_0x5830('0xf')]['message']);}logger['error'](_0x5830('0xc'),_0x11f09c,_0x1a36b1[_0x5830('0xf')][_0x5830('0x11')]);return _0x48d939(_0x1a36b1[_0x5830('0xf')]['message']);}else{logger[_0x5830('0xb')]('WhatsappQueueReport,\x20%s,\x20%s',_0x11f09c,_0x5830('0xd'));_0x48d939(_0x1a36b1[_0x5830('0x12')][_0x5830('0x11')]);}})[_0x5830('0x13')](function(_0x5e027b){logger[_0x5830('0xf')]('WhatsappQueueReport,\x20%s,\x20%s',_0x11f09c,_0x5e027b);_0x535e59(_0x5e027b);});});}exports['CreateWhatsappQueueReport']=function(_0x3a2fc2){var _0x4a2f95=this;return new Promise(function(_0x9886a0,_0x4cfc1b){return db[_0x5830('0x14')]['create'](_0x3a2fc2['body'],{'raw':_0x3a2fc2[_0x5830('0x15')]?_0x3a2fc2[_0x5830('0x15')]['raw']===undefined?!![]:![]:!![]})[_0x5830('0x16')](function(_0x4d0154){logger[_0x5830('0xb')]('CreateWhatsappQueueReport',_0x3a2fc2);logger['debug'](_0x5830('0x17'),_0x3a2fc2,JSON['stringify'](_0x4d0154));_0x9886a0(_0x4d0154);})[_0x5830('0x13')](function(_0x1908f7){logger['error']('CreateWhatsappQueueReport',_0x1908f7['message'],_0x3a2fc2);_0x4cfc1b(_0x4a2f95[_0x5830('0xf')](0x1f4,_0x1908f7[_0x5830('0x11')]));});});};exports['UpdateWhatsappQueueReport']=function(_0x22c45b){var _0x261897=this;return new Promise(function(_0x4bd39b,_0x4b96e3){return db[_0x5830('0x14')][_0x5830('0x18')](_0x22c45b['body'],{'raw':_0x22c45b[_0x5830('0x15')]?_0x22c45b['options'][_0x5830('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x22c45b[_0x5830('0x15')]?_0x22c45b[_0x5830('0x15')][_0x5830('0x1a')]||null:null,'attributes':_0x22c45b[_0x5830('0x15')]?_0x22c45b['options'][_0x5830('0x1b')]||null:null,'limit':_0x22c45b['options']?_0x22c45b[_0x5830('0x15')][_0x5830('0x1c')]||null:null})[_0x5830('0x16')](function(_0x1a061f){logger['info'](_0x5830('0x1d'),_0x22c45b);logger[_0x5830('0xe')]('UpdateWhatsappQueueReport',_0x22c45b,JSON['stringify'](_0x1a061f));_0x4bd39b(_0x1a061f);})['catch'](function(_0x464985){logger[_0x5830('0xf')](_0x5830('0x1d'),_0x464985[_0x5830('0x11')],_0x22c45b);_0x4b96e3(_0x261897[_0x5830('0xf')](0x1f4,_0x464985[_0x5830('0x11')]));});});};
\ No newline at end of file
+var _0x2b33=['code','WhatsappQueueReport,\x20%s,\x20%s','message','info','result','catch','WhatsappQueueReport','body','options','raw','CreateWhatsappQueueReport','debug','update','attributes','limit','UpdateWhatsappQueueReport','stringify','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','request\x20sent','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','error'];(function(_0x13f374,_0x256cc2){var _0x5879bf=function(_0x5d8d3b){while(--_0x5d8d3b){_0x13f374['push'](_0x13f374['shift']());}};_0x5879bf(++_0x256cc2);}(_0x2b33,0x91));var _0x32b3=function(_0x5da2e1,_0x2adbbf){_0x5da2e1=_0x5da2e1-0x0;var _0x478240=_0x2b33[_0x5da2e1];return _0x478240;};'use strict';var _=require(_0x32b3('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x32b3('0x1'));var rs=require(_0x32b3('0x2'));var fs=require('fs');var Redis=require(_0x32b3('0x3'));var db=require(_0x32b3('0x4'))['db'];var utils=require(_0x32b3('0x5'));var logger=require(_0x32b3('0x6'))('rpc');var config=require(_0x32b3('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x32b3('0x8')][_0x32b3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1e455b,_0x4ccaeb,_0x5d2e6a){return new BPromise(function(_0x28917a,_0x30d471){return client[_0x32b3('0xa')](_0x1e455b,_0x5d2e6a)[_0x32b3('0xb')](function(_0x323a01){logger['info']('WhatsappQueueReport,\x20%s,\x20%s',_0x4ccaeb,_0x32b3('0xc'));logger['debug'](_0x32b3('0xd'),_0x4ccaeb,_0x32b3('0xc'),JSON['stringify'](_0x323a01));if(_0x323a01[_0x32b3('0xe')]){if(_0x323a01['error'][_0x32b3('0xf')]===0x1f4){logger[_0x32b3('0xe')](_0x32b3('0x10'),_0x4ccaeb,_0x323a01[_0x32b3('0xe')][_0x32b3('0x11')]);return _0x30d471(_0x323a01['error'][_0x32b3('0x11')]);}logger['error'](_0x32b3('0x10'),_0x4ccaeb,_0x323a01['error'][_0x32b3('0x11')]);return _0x28917a(_0x323a01[_0x32b3('0xe')]['message']);}else{logger[_0x32b3('0x12')]('WhatsappQueueReport,\x20%s,\x20%s',_0x4ccaeb,_0x32b3('0xc'));_0x28917a(_0x323a01[_0x32b3('0x13')][_0x32b3('0x11')]);}})[_0x32b3('0x14')](function(_0x1a3304){logger[_0x32b3('0xe')](_0x32b3('0x10'),_0x4ccaeb,_0x1a3304);_0x30d471(_0x1a3304);});});}exports['CreateWhatsappQueueReport']=function(_0x196e1a){var _0x339466=this;return new Promise(function(_0x3f6380,_0x377883){return db[_0x32b3('0x15')]['create'](_0x196e1a[_0x32b3('0x16')],{'raw':_0x196e1a[_0x32b3('0x17')]?_0x196e1a[_0x32b3('0x17')][_0x32b3('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0xbe8fa1){logger[_0x32b3('0x12')](_0x32b3('0x19'),_0x196e1a);logger[_0x32b3('0x1a')](_0x32b3('0x19'),_0x196e1a,JSON['stringify'](_0xbe8fa1));_0x3f6380(_0xbe8fa1);})[_0x32b3('0x14')](function(_0x3129cd){logger[_0x32b3('0xe')](_0x32b3('0x19'),_0x3129cd['message'],_0x196e1a);_0x377883(_0x339466[_0x32b3('0xe')](0x1f4,_0x3129cd[_0x32b3('0x11')]));});});};exports['UpdateWhatsappQueueReport']=function(_0xeefbd4){var _0x9cbec5=this;return new Promise(function(_0x46312d,_0x400568){return db['WhatsappQueueReport'][_0x32b3('0x1b')](_0xeefbd4[_0x32b3('0x16')],{'raw':_0xeefbd4['options']?_0xeefbd4['options'][_0x32b3('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xeefbd4[_0x32b3('0x17')]?_0xeefbd4[_0x32b3('0x17')]['where']||null:null,'attributes':_0xeefbd4['options']?_0xeefbd4[_0x32b3('0x17')][_0x32b3('0x1c')]||null:null,'limit':_0xeefbd4['options']?_0xeefbd4[_0x32b3('0x17')][_0x32b3('0x1d')]||null:null})['then'](function(_0x1820f1){logger[_0x32b3('0x12')]('UpdateWhatsappQueueReport',_0xeefbd4);logger[_0x32b3('0x1a')](_0x32b3('0x1e'),_0xeefbd4,JSON[_0x32b3('0x1f')](_0x1820f1));_0x46312d(_0x1820f1);})['catch'](function(_0x4a1c1e){logger[_0x32b3('0xe')](_0x32b3('0x1e'),_0x4a1c1e[_0x32b3('0x11')],_0xeefbd4);_0x400568(_0x9cbec5[_0x32b3('0xe')](0x1f4,_0x4a1c1e['message']));});});};
\ No newline at end of file
index 13c5f44..663e259 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd355=['update','destroy','exports','util','path','express','Router','../../components/interaction/service','./whatsappTransferReport.controller','isAuthenticated','get','/:id','post','put'];(function(_0x3ccd9f,_0x1b2b46){var _0x273cb8=function(_0x2fa6b8){while(--_0x2fa6b8){_0x3ccd9f['push'](_0x3ccd9f['shift']());}};_0x273cb8(++_0x1b2b46);}(_0xd355,0xe3));var _0x5d35=function(_0x2d6f29,_0x2f6366){_0x2d6f29=_0x2d6f29-0x0;var _0x291f5a=_0xd355[_0x2d6f29];return _0x291f5a;};'use strict';var multer=require('multer');var util=require(_0x5d35('0x0'));var path=require(_0x5d35('0x1'));var timeout=require('connect-timeout');var express=require(_0x5d35('0x2'));var router=express[_0x5d35('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x5d35('0x4'));var config=require('../../config/environment');var controller=require(_0x5d35('0x5'));router['get']('/',auth[_0x5d35('0x6')](),controller['index']);router['get']('/describe',auth[_0x5d35('0x6')](),controller['describe']);router[_0x5d35('0x7')](_0x5d35('0x8'),auth[_0x5d35('0x6')](),controller['show']);router[_0x5d35('0x9')]('/',auth[_0x5d35('0x6')](),controller['create']);router[_0x5d35('0xa')](_0x5d35('0x8'),auth[_0x5d35('0x6')](),controller[_0x5d35('0xb')]);router['delete']('/:id',auth[_0x5d35('0x6')](),controller[_0x5d35('0xc')]);module[_0x5d35('0xd')]=router;
\ No newline at end of file
+var _0x39d3=['/:id','show','post','create','delete','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./whatsappTransferReport.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x2e281a,_0x21ec9a){var _0x4749b0=function(_0x2593bc){while(--_0x2593bc){_0x2e281a['push'](_0x2e281a['shift']());}};_0x4749b0(++_0x21ec9a);}(_0x39d3,0x1aa));var _0x339d=function(_0x55678b,_0x4113ed){_0x55678b=_0x55678b-0x0;var _0x507605=_0x39d3[_0x55678b];return _0x507605;};'use strict';var multer=require(_0x339d('0x0'));var util=require(_0x339d('0x1'));var path=require(_0x339d('0x2'));var timeout=require('connect-timeout');var express=require(_0x339d('0x3'));var router=express[_0x339d('0x4')]();var fs_extra=require(_0x339d('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x339d('0x6'));var config=require(_0x339d('0x7'));var controller=require(_0x339d('0x8'));router[_0x339d('0x9')]('/',auth[_0x339d('0xa')](),controller[_0x339d('0xb')]);router[_0x339d('0x9')](_0x339d('0xc'),auth[_0x339d('0xa')](),controller[_0x339d('0xd')]);router['get'](_0x339d('0xe'),auth[_0x339d('0xa')](),controller[_0x339d('0xf')]);router[_0x339d('0x10')]('/',auth['isAuthenticated'](),controller[_0x339d('0x11')]);router['put'](_0x339d('0xe'),auth[_0x339d('0xa')](),controller['update']);router[_0x339d('0x12')](_0x339d('0xe'),auth[_0x339d('0xa')](),controller['destroy']);module[_0x339d('0x13')]=router;
\ No newline at end of file
index ae5f20e..35880f4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x35ff=['STRING','account','agent','DATE','exports'];(function(_0x27842c,_0x324fcb){var _0x493de8=function(_0x1f6c85){while(--_0x1f6c85){_0x27842c['push'](_0x27842c['shift']());}};_0x493de8(++_0x324fcb);}(_0x35ff,0xb3));var _0xf35f=function(_0x2e3c05,_0x7fc016){_0x2e3c05=_0x2e3c05-0x0;var _0xc631ac=_0x35ff[_0x2e3c05];return _0xc631ac;};'use strict';var Sequelize=require('sequelize');module[_0xf35f('0x0')]={'uniqueid':{'type':Sequelize[_0xf35f('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xf35f('0x2'),_0xf35f('0x3'),'queue'),'allowNull':![]},'transferredAt':{'type':Sequelize[_0xf35f('0x4')]}};
\ No newline at end of file
+var _0x6f54=['agent','queue','DATE','sequelize','exports','STRING'];(function(_0x1b6186,_0x1ec7f2){var _0x186121=function(_0x1748a8){while(--_0x1748a8){_0x1b6186['push'](_0x1b6186['shift']());}};_0x186121(++_0x1ec7f2);}(_0x6f54,0xcf));var _0x46f5=function(_0x99b432,_0x2b80a7){_0x99b432=_0x99b432-0x0;var _0x5e6301=_0x6f54[_0x99b432];return _0x5e6301;};'use strict';var Sequelize=require(_0x46f5('0x0'));module[_0x46f5('0x1')]={'uniqueid':{'type':Sequelize[_0x46f5('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM']('account',_0x46f5('0x3'),_0x46f5('0x4')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x46f5('0x5')]}};
\ No newline at end of file
index 1b69869..c0e4868 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd190=['type','merge','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','find','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','Content-Range','json','apply','save','update','then','destroy','end','error','send','index','map','WhatsappTransferReport','fieldName','key','name','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter'];(function(_0x4174e6,_0x11573e){var _0x345182=function(_0x35109b){while(--_0x35109b){_0x4174e6['push'](_0x4174e6['shift']());}};_0x345182(++_0x11573e);}(_0xd190,0xa7));var _0x0d19=function(_0x2b09ae,_0x475964){_0x2b09ae=_0x2b09ae-0x0;var _0x42c02d=_0xd190[_0x2b09ae];return _0x42c02d;};'use strict';var emlformat=require(_0x0d19('0x0'));var rimraf=require(_0x0d19('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0d19('0x2'));var rp=require(_0x0d19('0x3'));var moment=require(_0x0d19('0x4'));var BPromise=require(_0x0d19('0x5'));var Mustache=require(_0x0d19('0x6'));var util=require(_0x0d19('0x7'));var path=require('path');var sox=require(_0x0d19('0x8'));var csv=require(_0x0d19('0x9'));var ejs=require(_0x0d19('0xa'));var fs=require('fs');var fs_extra=require(_0x0d19('0xb'));var _=require('lodash');var squel=require(_0x0d19('0xc'));var crypto=require(_0x0d19('0xd'));var jsforce=require(_0x0d19('0xe'));var deskjs=require(_0x0d19('0xf'));var toCsv=require(_0x0d19('0x9'));var querystring=require(_0x0d19('0x10'));var Papa=require(_0x0d19('0x11'));var Redis=require(_0x0d19('0x12'));var authService=require(_0x0d19('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x0d19('0x14'));var hardwareService=require(_0x0d19('0x15'));var logger=require(_0x0d19('0x16'))(_0x0d19('0x17'));var utils=require(_0x0d19('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x0d19('0x19'));var db=require(_0x0d19('0x1a'))['db'];function respondWithStatusCode(_0x2188e1,_0x12c143){_0x12c143=_0x12c143||0xcc;return function(_0x42cc12){if(_0x42cc12){return _0x2188e1[_0x0d19('0x1b')](_0x12c143);}return _0x2188e1[_0x0d19('0x1c')](_0x12c143)['end']();};}function respondWithResult(_0x45ffc1,_0x4018e8){_0x4018e8=_0x4018e8||0xc8;return function(_0x5a007d){if(_0x5a007d){return _0x45ffc1[_0x0d19('0x1c')](_0x4018e8)['json'](_0x5a007d);}};}function respondWithFilteredResult(_0x18d4f9,_0x34fabc){return function(_0x351890){if(_0x351890){var _0x4c63aa=typeof _0x34fabc[_0x0d19('0x1d')]===_0x0d19('0x1e')&&typeof _0x34fabc[_0x0d19('0x1f')]===_0x0d19('0x1e');var _0x9981c=_0x351890[_0x0d19('0x20')];var _0x43763e=_0x4c63aa?0x0:_0x34fabc['offset'];var _0x3d3313=_0x4c63aa?_0x351890[_0x0d19('0x20')]:_0x34fabc[_0x0d19('0x1d')]+_0x34fabc[_0x0d19('0x1f')];var _0x2b56fb;if(_0x3d3313>=_0x9981c){_0x3d3313=_0x9981c;_0x2b56fb=0xc8;}else{_0x2b56fb=0xce;}_0x18d4f9[_0x0d19('0x1c')](_0x2b56fb);return _0x18d4f9['set'](_0x0d19('0x21'),_0x43763e+'-'+_0x3d3313+'/'+_0x9981c)[_0x0d19('0x22')](_0x351890);}return null;};}function patchUpdates(_0xfa5f6e){return function(_0x394d01){try{jsonpatch[_0x0d19('0x23')](_0x394d01,_0xfa5f6e,!![]);}catch(_0x459434){return BPromise['reject'](_0x459434);}return _0x394d01[_0x0d19('0x24')]();};}function saveUpdates(_0x33d37c,_0x2f3189){return function(_0x42afdd){if(_0x42afdd){return _0x42afdd[_0x0d19('0x25')](_0x33d37c)[_0x0d19('0x26')](function(_0xdf96bf){return _0xdf96bf;});}return null;};}function removeEntity(_0xd45eb8,_0x36840d){return function(_0x3a1c91){if(_0x3a1c91){return _0x3a1c91[_0x0d19('0x27')]()[_0x0d19('0x26')](function(){_0xd45eb8[_0x0d19('0x1c')](0xcc)[_0x0d19('0x28')]();});}};}function handleEntityNotFound(_0x23b203,_0x1f3157){return function(_0x1d7c94){if(!_0x1d7c94){_0x23b203['sendStatus'](0x194);}return _0x1d7c94;};}function handleError(_0x445e22,_0x4c6699){_0x4c6699=_0x4c6699||0x1f4;return function(_0x38d31c){logger[_0x0d19('0x29')](_0x38d31c['stack']);if(_0x38d31c['name']){delete _0x38d31c['name'];}_0x445e22[_0x0d19('0x1c')](_0x4c6699)[_0x0d19('0x2a')](_0x38d31c);};}exports[_0x0d19('0x2b')]=function(_0x548acd,_0x23b23a){var _0x1c342c={},_0x4e27ec={},_0x1459ed={'count':0x0,'rows':[]};var _0x5022ac=_[_0x0d19('0x2c')](db[_0x0d19('0x2d')]['rawAttributes'],function(_0x437803){return{'name':_0x437803[_0x0d19('0x2e')],'type':_0x437803['type'][_0x0d19('0x2f')]};});_0x4e27ec['model']=_[_0x0d19('0x2c')](_0x5022ac,_0x0d19('0x30'));_0x4e27ec[_0x0d19('0x31')]=_[_0x0d19('0x32')](_0x548acd[_0x0d19('0x31')]);_0x4e27ec[_0x0d19('0x33')]=_['intersection'](_0x4e27ec[_0x0d19('0x34')],_0x4e27ec['query']);_0x1c342c[_0x0d19('0x35')]=_[_0x0d19('0x36')](_0x4e27ec[_0x0d19('0x34')],qs[_0x0d19('0x37')](_0x548acd['query'][_0x0d19('0x37')]));_0x1c342c[_0x0d19('0x35')]=_0x1c342c[_0x0d19('0x35')][_0x0d19('0x38')]?_0x1c342c[_0x0d19('0x35')]:_0x4e27ec[_0x0d19('0x34')];if(!_0x548acd[_0x0d19('0x31')][_0x0d19('0x39')](_0x0d19('0x3a'))){_0x1c342c[_0x0d19('0x1f')]=qs[_0x0d19('0x1f')](_0x548acd[_0x0d19('0x31')][_0x0d19('0x1f')]);_0x1c342c['offset']=qs[_0x0d19('0x1d')](_0x548acd[_0x0d19('0x31')][_0x0d19('0x1d')]);}_0x1c342c[_0x0d19('0x3b')]=qs[_0x0d19('0x3c')](_0x548acd[_0x0d19('0x31')]['sort']);_0x1c342c[_0x0d19('0x3d')]=qs['filters'](_[_0x0d19('0x3e')](_0x548acd['query'],_0x4e27ec[_0x0d19('0x33')]),_0x5022ac);if(_0x548acd['query'][_0x0d19('0x3f')]){_0x1c342c['where']=_['merge'](_0x1c342c[_0x0d19('0x3d')],{'$or':_[_0x0d19('0x2c')](_0x5022ac,function(_0x50bc6f){if(_0x50bc6f[_0x0d19('0x40')]!=='VIRTUAL'){var _0x1701e5={};_0x1701e5[_0x50bc6f[_0x0d19('0x30')]]={'$like':'%'+_0x548acd[_0x0d19('0x31')]['filter']+'%'};return _0x1701e5;}})});}_0x1c342c=_[_0x0d19('0x41')]({},_0x1c342c,_0x548acd['options']);var _0x3f69c={'where':_0x1c342c[_0x0d19('0x3d')]};return db[_0x0d19('0x2d')][_0x0d19('0x20')](_0x3f69c)[_0x0d19('0x26')](function(_0x4ca828){_0x1459ed[_0x0d19('0x20')]=_0x4ca828;if(_0x548acd[_0x0d19('0x31')][_0x0d19('0x42')]){_0x1c342c[_0x0d19('0x43')]=[{'all':!![]}];}return db['WhatsappTransferReport'][_0x0d19('0x44')](_0x1c342c);})['then'](function(_0x1bf668){_0x1459ed[_0x0d19('0x45')]=_0x1bf668;return _0x1459ed;})[_0x0d19('0x26')](respondWithFilteredResult(_0x23b23a,_0x1c342c))[_0x0d19('0x46')](handleError(_0x23b23a,null));};exports[_0x0d19('0x47')]=function(_0x42ad74,_0x403068){var _0x86f73e={'raw':!![],'where':{'id':_0x42ad74[_0x0d19('0x48')]['id']}},_0x380604={};_0x380604[_0x0d19('0x34')]=_[_0x0d19('0x32')](db[_0x0d19('0x2d')][_0x0d19('0x49')]);_0x380604[_0x0d19('0x31')]=_[_0x0d19('0x32')](_0x42ad74[_0x0d19('0x31')]);_0x380604[_0x0d19('0x33')]=_['intersection'](_0x380604[_0x0d19('0x34')],_0x380604['query']);_0x86f73e[_0x0d19('0x35')]=_[_0x0d19('0x36')](_0x380604[_0x0d19('0x34')],qs[_0x0d19('0x37')](_0x42ad74[_0x0d19('0x31')][_0x0d19('0x37')]));_0x86f73e[_0x0d19('0x35')]=_0x86f73e[_0x0d19('0x35')]['length']?_0x86f73e[_0x0d19('0x35')]:_0x380604['model'];if(_0x42ad74[_0x0d19('0x31')][_0x0d19('0x42')]){_0x86f73e[_0x0d19('0x43')]=[{'all':!![]}];}_0x86f73e=_['merge']({},_0x86f73e,_0x42ad74['options']);return db[_0x0d19('0x2d')]['find'](_0x86f73e)[_0x0d19('0x26')](handleEntityNotFound(_0x403068,null))[_0x0d19('0x26')](respondWithResult(_0x403068,null))['catch'](handleError(_0x403068,null));};exports[_0x0d19('0x4a')]=function(_0x3ac1f7,_0x35cde6){return db[_0x0d19('0x2d')][_0x0d19('0x4a')](_0x3ac1f7['body'],{})[_0x0d19('0x26')](respondWithResult(_0x35cde6,0xc9))[_0x0d19('0x46')](handleError(_0x35cde6,null));};exports['update']=function(_0x2799bf,_0x1c599c){if(_0x2799bf[_0x0d19('0x4b')]['id']){delete _0x2799bf['body']['id'];}return db[_0x0d19('0x2d')][_0x0d19('0x4c')]({'where':{'id':_0x2799bf['params']['id']}})[_0x0d19('0x26')](handleEntityNotFound(_0x1c599c,null))[_0x0d19('0x26')](saveUpdates(_0x2799bf[_0x0d19('0x4b')],null))['then'](respondWithResult(_0x1c599c,null))[_0x0d19('0x46')](handleError(_0x1c599c,null));};exports[_0x0d19('0x27')]=function(_0x1ac58d,_0x30c514){return db['WhatsappTransferReport']['find']({'where':{'id':_0x1ac58d['params']['id']}})[_0x0d19('0x26')](handleEntityNotFound(_0x30c514,null))[_0x0d19('0x26')](removeEntity(_0x30c514,null))['catch'](handleError(_0x30c514,null));};exports['describe']=function(_0x4349e3,_0x49700d){return db['WhatsappTransferReport']['describe']()[_0x0d19('0x26')](respondWithResult(_0x49700d,null))['catch'](handleError(_0x49700d,null));};
\ No newline at end of file
+var _0x81fc=['zip-dir','fast-json-patch','moment','bluebird','util','sox','to-csv','ejs','fs-extra','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','save','update','then','end','error','stack','name','send','index','map','WhatsappTransferReport','rawAttributes','type','key','query','keys','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','find','create','body','params','describe','eml-format','rimraf'];(function(_0x37e0a8,_0x184bc8){var _0x5ca63c=function(_0x1af002){while(--_0x1af002){_0x37e0a8['push'](_0x37e0a8['shift']());}};_0x5ca63c(++_0x184bc8);}(_0x81fc,0x92));var _0xc81f=function(_0x45606c,_0x1132d6){_0x45606c=_0x45606c-0x0;var _0x18fd3f=_0x81fc[_0x45606c];return _0x18fd3f;};'use strict';var emlformat=require(_0xc81f('0x0'));var rimraf=require(_0xc81f('0x1'));var zipdir=require(_0xc81f('0x2'));var jsonpatch=require(_0xc81f('0x3'));var rp=require('request-promise');var moment=require(_0xc81f('0x4'));var BPromise=require(_0xc81f('0x5'));var Mustache=require('mustache');var util=require(_0xc81f('0x6'));var path=require('path');var sox=require(_0xc81f('0x7'));var csv=require(_0xc81f('0x8'));var ejs=require(_0xc81f('0x9'));var fs=require('fs');var fs_extra=require(_0xc81f('0xa'));var _=require('lodash');var squel=require(_0xc81f('0xb'));var crypto=require('crypto');var jsforce=require(_0xc81f('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc81f('0xd'));var Redis=require(_0xc81f('0xe'));var authService=require(_0xc81f('0xf'));var qs=require(_0xc81f('0x10'));var as=require(_0xc81f('0x11'));var hardwareService=require(_0xc81f('0x12'));var logger=require(_0xc81f('0x13'))(_0xc81f('0x14'));var utils=require('../../config/utils');var config=require(_0xc81f('0x15'));var licenseUtil=require(_0xc81f('0x16'));var db=require(_0xc81f('0x17'))['db'];function respondWithStatusCode(_0x89e86b,_0x3286f9){_0x3286f9=_0x3286f9||0xcc;return function(_0x5f02e4){if(_0x5f02e4){return _0x89e86b[_0xc81f('0x18')](_0x3286f9);}return _0x89e86b[_0xc81f('0x19')](_0x3286f9)['end']();};}function respondWithResult(_0x54809d,_0x395c36){_0x395c36=_0x395c36||0xc8;return function(_0x50d70b){if(_0x50d70b){return _0x54809d[_0xc81f('0x19')](_0x395c36)[_0xc81f('0x1a')](_0x50d70b);}};}function respondWithFilteredResult(_0x1999c1,_0x31b5b5){return function(_0x20a304){if(_0x20a304){var _0x52b87b=typeof _0x31b5b5[_0xc81f('0x1b')]==='undefined'&&typeof _0x31b5b5[_0xc81f('0x1c')]===_0xc81f('0x1d');var _0xac597b=_0x20a304['count'];var _0x1140a1=_0x52b87b?0x0:_0x31b5b5['offset'];var _0x18d96a=_0x52b87b?_0x20a304[_0xc81f('0x1e')]:_0x31b5b5[_0xc81f('0x1b')]+_0x31b5b5[_0xc81f('0x1c')];var _0x3f27e2;if(_0x18d96a>=_0xac597b){_0x18d96a=_0xac597b;_0x3f27e2=0xc8;}else{_0x3f27e2=0xce;}_0x1999c1['status'](_0x3f27e2);return _0x1999c1[_0xc81f('0x1f')](_0xc81f('0x20'),_0x1140a1+'-'+_0x18d96a+'/'+_0xac597b)[_0xc81f('0x1a')](_0x20a304);}return null;};}function patchUpdates(_0x450055){return function(_0x457a93){try{jsonpatch['apply'](_0x457a93,_0x450055,!![]);}catch(_0x53d182){return BPromise['reject'](_0x53d182);}return _0x457a93[_0xc81f('0x21')]();};}function saveUpdates(_0x3a9cdc,_0x361d60){return function(_0x263826){if(_0x263826){return _0x263826[_0xc81f('0x22')](_0x3a9cdc)[_0xc81f('0x23')](function(_0x306dfb){return _0x306dfb;});}return null;};}function removeEntity(_0x3dc3e5,_0x199554){return function(_0x1a2b72){if(_0x1a2b72){return _0x1a2b72['destroy']()['then'](function(){_0x3dc3e5[_0xc81f('0x19')](0xcc)[_0xc81f('0x24')]();});}};}function handleEntityNotFound(_0x512c88,_0x2b2520){return function(_0x108ff2){if(!_0x108ff2){_0x512c88[_0xc81f('0x18')](0x194);}return _0x108ff2;};}function handleError(_0x5c9c5b,_0x4e43bb){_0x4e43bb=_0x4e43bb||0x1f4;return function(_0x4d5a48){logger[_0xc81f('0x25')](_0x4d5a48[_0xc81f('0x26')]);if(_0x4d5a48[_0xc81f('0x27')]){delete _0x4d5a48[_0xc81f('0x27')];}_0x5c9c5b[_0xc81f('0x19')](_0x4e43bb)[_0xc81f('0x28')](_0x4d5a48);};}exports[_0xc81f('0x29')]=function(_0x35220a,_0xdfe216){var _0x43fe5a={},_0x14fc8f={},_0xca7d80={'count':0x0,'rows':[]};var _0x4c7043=_[_0xc81f('0x2a')](db[_0xc81f('0x2b')][_0xc81f('0x2c')],function(_0xb5d85){return{'name':_0xb5d85['fieldName'],'type':_0xb5d85[_0xc81f('0x2d')][_0xc81f('0x2e')]};});_0x14fc8f['model']=_['map'](_0x4c7043,_0xc81f('0x27'));_0x14fc8f[_0xc81f('0x2f')]=_[_0xc81f('0x30')](_0x35220a['query']);_0x14fc8f['filters']=_['intersection'](_0x14fc8f[_0xc81f('0x31')],_0x14fc8f['query']);_0x43fe5a[_0xc81f('0x32')]=_[_0xc81f('0x33')](_0x14fc8f['model'],qs['fields'](_0x35220a[_0xc81f('0x2f')][_0xc81f('0x34')]));_0x43fe5a['attributes']=_0x43fe5a[_0xc81f('0x32')][_0xc81f('0x35')]?_0x43fe5a[_0xc81f('0x32')]:_0x14fc8f[_0xc81f('0x31')];if(!_0x35220a[_0xc81f('0x2f')][_0xc81f('0x36')](_0xc81f('0x37'))){_0x43fe5a[_0xc81f('0x1c')]=qs[_0xc81f('0x1c')](_0x35220a[_0xc81f('0x2f')][_0xc81f('0x1c')]);_0x43fe5a['offset']=qs[_0xc81f('0x1b')](_0x35220a[_0xc81f('0x2f')][_0xc81f('0x1b')]);}_0x43fe5a[_0xc81f('0x38')]=qs['sort'](_0x35220a[_0xc81f('0x2f')][_0xc81f('0x39')]);_0x43fe5a[_0xc81f('0x3a')]=qs[_0xc81f('0x3b')](_[_0xc81f('0x3c')](_0x35220a[_0xc81f('0x2f')],_0x14fc8f['filters']),_0x4c7043);if(_0x35220a[_0xc81f('0x2f')][_0xc81f('0x3d')]){_0x43fe5a[_0xc81f('0x3a')]=_[_0xc81f('0x3e')](_0x43fe5a['where'],{'$or':_[_0xc81f('0x2a')](_0x4c7043,function(_0x137ccd){if(_0x137ccd[_0xc81f('0x2d')]!==_0xc81f('0x3f')){var _0x22719c={};_0x22719c[_0x137ccd[_0xc81f('0x27')]]={'$like':'%'+_0x35220a[_0xc81f('0x2f')][_0xc81f('0x3d')]+'%'};return _0x22719c;}})});}_0x43fe5a=_['merge']({},_0x43fe5a,_0x35220a[_0xc81f('0x40')]);var _0x282c91={'where':_0x43fe5a[_0xc81f('0x3a')]};return db[_0xc81f('0x2b')]['count'](_0x282c91)[_0xc81f('0x23')](function(_0x306e87){_0xca7d80[_0xc81f('0x1e')]=_0x306e87;if(_0x35220a['query'][_0xc81f('0x41')]){_0x43fe5a[_0xc81f('0x42')]=[{'all':!![]}];}return db[_0xc81f('0x2b')]['findAll'](_0x43fe5a);})[_0xc81f('0x23')](function(_0xf5c217){_0xca7d80[_0xc81f('0x43')]=_0xf5c217;return _0xca7d80;})[_0xc81f('0x23')](respondWithFilteredResult(_0xdfe216,_0x43fe5a))[_0xc81f('0x44')](handleError(_0xdfe216,null));};exports['show']=function(_0x2b8d55,_0x4556e3){var _0x48805c={'raw':!![],'where':{'id':_0x2b8d55['params']['id']}},_0x3176b8={};_0x3176b8['model']=_[_0xc81f('0x30')](db[_0xc81f('0x2b')][_0xc81f('0x2c')]);_0x3176b8['query']=_[_0xc81f('0x30')](_0x2b8d55[_0xc81f('0x2f')]);_0x3176b8[_0xc81f('0x3b')]=_['intersection'](_0x3176b8['model'],_0x3176b8[_0xc81f('0x2f')]);_0x48805c['attributes']=_[_0xc81f('0x33')](_0x3176b8[_0xc81f('0x31')],qs[_0xc81f('0x34')](_0x2b8d55[_0xc81f('0x2f')][_0xc81f('0x34')]));_0x48805c[_0xc81f('0x32')]=_0x48805c[_0xc81f('0x32')]['length']?_0x48805c[_0xc81f('0x32')]:_0x3176b8[_0xc81f('0x31')];if(_0x2b8d55[_0xc81f('0x2f')][_0xc81f('0x41')]){_0x48805c[_0xc81f('0x42')]=[{'all':!![]}];}_0x48805c=_['merge']({},_0x48805c,_0x2b8d55['options']);return db[_0xc81f('0x2b')][_0xc81f('0x45')](_0x48805c)[_0xc81f('0x23')](handleEntityNotFound(_0x4556e3,null))['then'](respondWithResult(_0x4556e3,null))['catch'](handleError(_0x4556e3,null));};exports['create']=function(_0x57a14e,_0x37ddf4){return db[_0xc81f('0x2b')][_0xc81f('0x46')](_0x57a14e[_0xc81f('0x47')],{})[_0xc81f('0x23')](respondWithResult(_0x37ddf4,0xc9))[_0xc81f('0x44')](handleError(_0x37ddf4,null));};exports[_0xc81f('0x22')]=function(_0x1208db,_0x54df9c){if(_0x1208db['body']['id']){delete _0x1208db[_0xc81f('0x47')]['id'];}return db[_0xc81f('0x2b')]['find']({'where':{'id':_0x1208db[_0xc81f('0x48')]['id']}})[_0xc81f('0x23')](handleEntityNotFound(_0x54df9c,null))[_0xc81f('0x23')](saveUpdates(_0x1208db[_0xc81f('0x47')],null))[_0xc81f('0x23')](respondWithResult(_0x54df9c,null))[_0xc81f('0x44')](handleError(_0x54df9c,null));};exports['destroy']=function(_0x36e83f,_0x3c0dce){return db[_0xc81f('0x2b')][_0xc81f('0x45')]({'where':{'id':_0x36e83f[_0xc81f('0x48')]['id']}})[_0xc81f('0x23')](handleEntityNotFound(_0x3c0dce,null))[_0xc81f('0x23')](removeEntity(_0x3c0dce,null))[_0xc81f('0x44')](handleError(_0x3c0dce,null));};exports[_0xc81f('0x49')]=function(_0x30ef56,_0x16d1ed){return db['WhatsappTransferReport'][_0xc81f('0x49')]()[_0xc81f('0x23')](respondWithResult(_0x16d1ed,null))[_0xc81f('0x44')](handleError(_0x16d1ed,null));};
\ No newline at end of file
index 961d189..8b19aac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x419e=['WhatsappTransferReport','report_whatsapp_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./whatsappTransferReport.attributes','exports','define'];(function(_0x39db0c,_0x4491da){var _0x590d26=function(_0x418d1c){while(--_0x418d1c){_0x39db0c['push'](_0x39db0c['shift']());}};_0x590d26(++_0x4491da);}(_0x419e,0x1df));var _0xe419=function(_0x5c6c64,_0x12d4cb){_0x5c6c64=_0x5c6c64-0x0;var _0x172174=_0x419e[_0x5c6c64];return _0x172174;};'use strict';var _=require(_0xe419('0x0'));var util=require(_0xe419('0x1'));var logger=require(_0xe419('0x2'))(_0xe419('0x3'));var moment=require(_0xe419('0x4'));var BPromise=require(_0xe419('0x5'));var rp=require(_0xe419('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xe419('0x7'));var attributes=require(_0xe419('0x8'));module[_0xe419('0x9')]=function(_0x58e8dd,_0x18c5fa){return _0x58e8dd[_0xe419('0xa')](_0xe419('0xb'),attributes,{'tableName':_0xe419('0xc'),'paranoid':![],'indexes':[{'name':_0xe419('0xd'),'fields':[_0xe419('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xa046=['rimraf','../../config/environment','./whatsappTransferReport.attributes','exports','define','WhatsappTransferReport','uniqueid','lodash','util','moment','bluebird','request-promise','path'];(function(_0x561771,_0x554760){var _0x54d16e=function(_0x381c1f){while(--_0x381c1f){_0x561771['push'](_0x561771['shift']());}};_0x54d16e(++_0x554760);}(_0xa046,0xb0));var _0x6a04=function(_0x2642cb,_0x4b917f){_0x2642cb=_0x2642cb-0x0;var _0xe6e41=_0xa046[_0x2642cb];return _0xe6e41;};'use strict';var _=require(_0x6a04('0x0'));var util=require(_0x6a04('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x6a04('0x2'));var BPromise=require(_0x6a04('0x3'));var rp=require(_0x6a04('0x4'));var fs=require('fs');var path=require(_0x6a04('0x5'));var rimraf=require(_0x6a04('0x6'));var config=require(_0x6a04('0x7'));var attributes=require(_0x6a04('0x8'));module[_0x6a04('0x9')]=function(_0x5d0970,_0x52d42b){return _0x5d0970[_0x6a04('0xa')](_0x6a04('0xb'),attributes,{'tableName':'report_whatsapp_transfer','paranoid':![],'indexes':[{'name':_0x6a04('0xc'),'fields':[_0x6a04('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
index 6bce601..4c41489 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2376=['WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','client','request','then','info'];(function(_0x543b96,_0x54fec4){var _0x4ae2f1=function(_0xc63ed6){while(--_0xc63ed6){_0x543b96['push'](_0x543b96['shift']());}};_0x4ae2f1(++_0x54fec4);}(_0x2376,0x1d7));var _0x6237=function(_0x2bc209,_0x1b2ea6){_0x2bc209=_0x2bc209-0x0;var _0x5a8590=_0x2376[_0x2bc209];return _0x5a8590;};'use strict';var _=require('lodash');var util=require(_0x6237('0x0'));var moment=require(_0x6237('0x1'));var BPromise=require(_0x6237('0x2'));var rs=require(_0x6237('0x3'));var fs=require('fs');var Redis=require(_0x6237('0x4'));var db=require(_0x6237('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x6237('0x6'));var config=require('../../config/environment');var jayson=require(_0x6237('0x7'));var client=jayson[_0x6237('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x35bcb0,_0x2675b1,_0xc1bc6b){return new BPromise(function(_0x2766fb,_0x1bac5e){return client[_0x6237('0x9')](_0x35bcb0,_0xc1bc6b)[_0x6237('0xa')](function(_0x517359){logger[_0x6237('0xb')](_0x6237('0xc'),_0x2675b1,_0x6237('0xd'));logger[_0x6237('0xe')](_0x6237('0xf'),_0x2675b1,_0x6237('0xd'),JSON['stringify'](_0x517359));if(_0x517359[_0x6237('0x10')]){if(_0x517359[_0x6237('0x10')][_0x6237('0x11')]===0x1f4){logger[_0x6237('0x10')]('WhatsappTransferReport,\x20%s,\x20%s',_0x2675b1,_0x517359['error'][_0x6237('0x12')]);return _0x1bac5e(_0x517359[_0x6237('0x10')]['message']);}logger[_0x6237('0x10')]('WhatsappTransferReport,\x20%s,\x20%s',_0x2675b1,_0x517359[_0x6237('0x10')][_0x6237('0x12')]);return _0x2766fb(_0x517359['error'][_0x6237('0x12')]);}else{logger[_0x6237('0xb')](_0x6237('0xc'),_0x2675b1,_0x6237('0xd'));_0x2766fb(_0x517359[_0x6237('0x13')][_0x6237('0x12')]);}})[_0x6237('0x14')](function(_0x48d3ab){logger[_0x6237('0x10')](_0x6237('0xc'),_0x2675b1,_0x48d3ab);_0x1bac5e(_0x48d3ab);});});}
\ No newline at end of file
+var _0x5ce4=['info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','lodash','util','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','then'];(function(_0x3fadae,_0x286c69){var _0x166651=function(_0x888400){while(--_0x888400){_0x3fadae['push'](_0x3fadae['shift']());}};_0x166651(++_0x286c69);}(_0x5ce4,0x1c1));var _0x45ce=function(_0x3299d1,_0x545733){_0x3299d1=_0x3299d1-0x0;var _0x44356e=_0x5ce4[_0x3299d1];return _0x44356e;};'use strict';var _=require(_0x45ce('0x0'));var util=require(_0x45ce('0x1'));var moment=require('moment');var BPromise=require(_0x45ce('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x45ce('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x45ce('0x4'))(_0x45ce('0x5'));var config=require(_0x45ce('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x45ce('0x7')][_0x45ce('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x549293,_0x531fd7,_0x58631e){return new BPromise(function(_0x5a64b8,_0x1f0e2d){return client['request'](_0x549293,_0x58631e)[_0x45ce('0x9')](function(_0x4271e2){logger[_0x45ce('0xa')](_0x45ce('0xb'),_0x531fd7,_0x45ce('0xc'));logger['debug'](_0x45ce('0xd'),_0x531fd7,_0x45ce('0xc'),JSON['stringify'](_0x4271e2));if(_0x4271e2['error']){if(_0x4271e2[_0x45ce('0xe')][_0x45ce('0xf')]===0x1f4){logger['error'](_0x45ce('0xb'),_0x531fd7,_0x4271e2['error']['message']);return _0x1f0e2d(_0x4271e2[_0x45ce('0xe')][_0x45ce('0x10')]);}logger[_0x45ce('0xe')](_0x45ce('0xb'),_0x531fd7,_0x4271e2['error'][_0x45ce('0x10')]);return _0x5a64b8(_0x4271e2[_0x45ce('0xe')]['message']);}else{logger[_0x45ce('0xa')](_0x45ce('0xb'),_0x531fd7,_0x45ce('0xc'));_0x5a64b8(_0x4271e2['result'][_0x45ce('0x10')]);}})['catch'](function(_0x1b72bd){logger[_0x45ce('0xe')](_0x45ce('0xb'),_0x531fd7,_0x1b72bd);_0x1f0e2d(_0x1b72bd);});});}
\ No newline at end of file
index 8723a78..e93f999 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3595=['app','./config/pm2','./config/pm2/config','./config/schedule/whatsapp','./config/schedule/transcribe','./config/schedule/cloud-provider','sequelize','sync','then','seedDB','default','info','start','filter','exitCode','number','\x20processes\x20failed\x20at\x20startup:\x20','map','pm2_env','name','Online\x20apps:','join','Offline\x20apps:','online','None','log','App\x20Ready!','catch','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./mysqldb','./config/seedDB','./rpc','./config/environment','./config/logger'];(function(_0x5da55f,_0x395dbb){var _0x5950de=function(_0x17e7e7){while(--_0x17e7e7){_0x5da55f['push'](_0x5da55f['shift']());}};_0x5950de(++_0x395dbb);}(_0x3595,0x147));var _0x5359=function(_0x98901a,_0x50052d){_0x98901a=_0x98901a-0x0;var _0x32f5ce=_0x3595[_0x98901a];return _0x32f5ce;};'use strict';var _=require(_0x5359('0x0'));var db=require(_0x5359('0x1'))['db'];var seedDb=require(_0x5359('0x2'));var checkLicense=require('./config/license');var rpc=require(_0x5359('0x3'));var config=require(_0x5359('0x4'));var logger=require(_0x5359('0x5'))(_0x5359('0x6'));var pm2=require(_0x5359('0x7'));var pm2Config=require(_0x5359('0x8'));var schedule=require('./config/schedule');var chat=require('./config/schedule/chat');var whatsapp=require(_0x5359('0x9'));var transcribe=require(_0x5359('0xa'));var provider=require(_0x5359('0xb'));function main(){return db[_0x5359('0xc')][_0x5359('0xd')]()[_0x5359('0xe')](function(){if(config[_0x5359('0xf')]){return seedDb[_0x5359('0x10')]();}})[_0x5359('0xe')](function(){return checkLicense[_0x5359('0x10')]();})['then'](function(){return rpc['listen']();})['then'](function(_0x541386){logger[_0x5359('0x11')](_0x541386);return chat[_0x5359('0x12')]();})[_0x5359('0xe')](function(){return whatsapp[_0x5359('0x12')]();})[_0x5359('0xe')](function(){return schedule[_0x5359('0x12')]();})[_0x5359('0xe')](function(){return transcribe[_0x5359('0x12')]();})[_0x5359('0xe')](function(){return provider[_0x5359('0x12')]();})[_0x5359('0xe')](function(_0x11d06c){logger[_0x5359('0x11')](_0x11d06c);return pm2[_0x5359('0x12')](pm2Config);})['then'](function(_0x51b3b7){var _0x445000=_0x51b3b7[_0x5359('0x13')](function(_0x11d494){return typeof _0x11d494[_0x5359('0x14')]===_0x5359('0x15')&&_0x11d494[_0x5359('0x14')]>=0x0;});if(_0x445000['length']>0x0){throw new Error(_0x445000['length']+_0x5359('0x16')+_[_0x5359('0x17')](_0x445000,function(_0x4de994){return'\x22'+_0x4de994[_0x5359('0x18')][_0x5359('0x19')]+'\x22';}));}logger[_0x5359('0x11')](_0x5359('0x1a'),_['map'](_['filter'](_0x51b3b7,{'status':'online'}),_0x5359('0x19'))[_0x5359('0x1b')]());logger['info'](_0x5359('0x1c'),_[_0x5359('0x17')](_[_0x5359('0x13')](_0x51b3b7,function(_0x41ab92){return _0x41ab92['status']!==_0x5359('0x1d');}),_0x5359('0x19'))['join']()||_0x5359('0x1e'));console[_0x5359('0x1f')](_0x5359('0x20'));})[_0x5359('0x21')](function(_0x45e623){console['log']('Server\x20failed\x20to\x20start\x20due\x20to\x20error!',_0x45e623);logger[_0x5359('0x22')](_0x5359('0x23'),_0x45e623);process[_0x5359('0x24')](0x1);});}main();
\ No newline at end of file
+var _0x5b20=['None','App\x20Ready!','catch','log','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./mysqldb','./config/seedDB','./config/license','./rpc','./config/environment','./config/logger','app','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/whatsapp','./config/schedule/transcribe','sequelize','sync','then','seedDB','default','listen','info','start','filter','number','exitCode','length','\x20processes\x20failed\x20at\x20startup:\x20','map','pm2_env','name','Online\x20apps:','online','join','Offline\x20apps:','status'];(function(_0x1954ba,_0x142730){var _0x432c9f=function(_0x5a2687){while(--_0x5a2687){_0x1954ba['push'](_0x1954ba['shift']());}};_0x432c9f(++_0x142730);}(_0x5b20,0x86));var _0x05b2=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0x5b20[_0x2be8c2];return _0x97f531;};'use strict';var _=require(_0x05b2('0x0'));var db=require(_0x05b2('0x1'))['db'];var seedDb=require(_0x05b2('0x2'));var checkLicense=require(_0x05b2('0x3'));var rpc=require(_0x05b2('0x4'));var config=require(_0x05b2('0x5'));var logger=require(_0x05b2('0x6'))(_0x05b2('0x7'));var pm2=require(_0x05b2('0x8'));var pm2Config=require(_0x05b2('0x9'));var schedule=require(_0x05b2('0xa'));var chat=require('./config/schedule/chat');var whatsapp=require(_0x05b2('0xb'));var transcribe=require(_0x05b2('0xc'));var provider=require('./config/schedule/cloud-provider');function main(){return db[_0x05b2('0xd')][_0x05b2('0xe')]()[_0x05b2('0xf')](function(){if(config[_0x05b2('0x10')]){return seedDb[_0x05b2('0x11')]();}})[_0x05b2('0xf')](function(){return checkLicense[_0x05b2('0x11')]();})[_0x05b2('0xf')](function(){return rpc[_0x05b2('0x12')]();})[_0x05b2('0xf')](function(_0x9a7fd7){logger[_0x05b2('0x13')](_0x9a7fd7);return chat[_0x05b2('0x14')]();})[_0x05b2('0xf')](function(){return whatsapp[_0x05b2('0x14')]();})[_0x05b2('0xf')](function(){return schedule['start']();})[_0x05b2('0xf')](function(){return transcribe[_0x05b2('0x14')]();})[_0x05b2('0xf')](function(){return provider[_0x05b2('0x14')]();})['then'](function(_0x1339ad){logger[_0x05b2('0x13')](_0x1339ad);return pm2[_0x05b2('0x14')](pm2Config);})['then'](function(_0x4e5c5d){var _0x961aca=_0x4e5c5d[_0x05b2('0x15')](function(_0x4d6d7e){return typeof _0x4d6d7e['exitCode']===_0x05b2('0x16')&&_0x4d6d7e[_0x05b2('0x17')]>=0x0;});if(_0x961aca[_0x05b2('0x18')]>0x0){throw new Error(_0x961aca[_0x05b2('0x18')]+_0x05b2('0x19')+_[_0x05b2('0x1a')](_0x961aca,function(_0x290cce){return'\x22'+_0x290cce[_0x05b2('0x1b')][_0x05b2('0x1c')]+'\x22';}));}logger[_0x05b2('0x13')](_0x05b2('0x1d'),_[_0x05b2('0x1a')](_[_0x05b2('0x15')](_0x4e5c5d,{'status':_0x05b2('0x1e')}),_0x05b2('0x1c'))[_0x05b2('0x1f')]());logger['info'](_0x05b2('0x20'),_[_0x05b2('0x1a')](_[_0x05b2('0x15')](_0x4e5c5d,function(_0x41bea5){return _0x41bea5[_0x05b2('0x21')]!==_0x05b2('0x1e');}),_0x05b2('0x1c'))['join']()||_0x05b2('0x22'));console['log'](_0x05b2('0x23'));})[_0x05b2('0x24')](function(_0x4b2eac){console[_0x05b2('0x25')](_0x05b2('0x26'),_0x4b2eac);logger[_0x05b2('0x27')](_0x05b2('0x28'),_0x4b2eac);process[_0x05b2('0x29')](0x1);});}main();
\ No newline at end of file
index 990cca8..e2546ab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x34e8=['validatePasswordPattern','test','Sequelize','ValidationError','validatePasswordHistory','decryptString','split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','length','splice','unshift','encryptString','join','promisify','sign','secret','secrets','payload','options','verify','toString','hex','../../mysqldb','../../config/environment','../../config/license/hardware','../../config/license/util','lodash','jsonwebtoken','express-jwt','composable-middleware','basic-auth','crypto','bluebird','moment','session','role','fullname','name','internal','email','userpic','permissions','md5secret','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','pauseType','showWebBar','lastPauseAt','crudPermissions','passwordResetAt','alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarExpires','phoneBarRemoteControl','phoneBarRemoteControlPort','interface','userProfileId','privacyEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions','downloadAttachments','ignorePauseForPreviewCalls','selectRecallMeCampaign','chatAutoanswer','emailAutoanswer','emailAutoanswerDelay','smsAutoanswer','smsAutoanswerDelay','openchannelAutoanswerDelay','faxAutoanswer','whatsappAutoanswer','whatsappAutoanswerDelay','isChatInteractionAuthorized','user','ChatInteraction','params','closed','disposition','unmanaged','Unmanaged.','Forbidden.','catch','authorization','startsWith','headers','Basic','User','find','pass','status','json','Wrong\x20credentials.','Unknown\x20authorization\x20format','query','getUuid','then','sub','Setting','allowedLoginAttempts','blockDuration','isEqual','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','Invalid\x20API\x20access\x20key','blockedAt','minutes','User\x20not\x20found.','canUpdate','use','getLicense','update','Forbidden','isWebrtcLicence','webrtc','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','motion.token','redirect','/dashboards/general','send','isNil','apiKeyNonce','apiKeyIat','generateApiKey','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one'];(function(_0x268017,_0xcf187b){var _0x40058a=function(_0x3a9871){while(--_0x3a9871){_0x268017['push'](_0x268017['shift']());}};_0x40058a(++_0xcf187b);}(_0x34e8,0x12c));var _0x834e=function(_0x30be00,_0x496ea3){_0x30be00=_0x30be00-0x0;var _0x1af865=_0x34e8[_0x30be00];return _0x1af865;};'use strict';var db=require(_0x834e('0x0'))['db'];var config=require(_0x834e('0x1'));var hardwareConf=require(_0x834e('0x2'));var licenseUtil=require(_0x834e('0x3'));var encryptor=require('../encryptor');var _=require(_0x834e('0x4'));var jwt=require(_0x834e('0x5'));var expressJwt=require(_0x834e('0x6'));var compose=require(_0x834e('0x7'));var basicAuth=require(_0x834e('0x8'));var crypto=require(_0x834e('0x9'));var BPromise=require(_0x834e('0xa'));var util=require('util');var moment=require(_0x834e('0xb'));var validateJwt=expressJwt({'secret':config['secrets'][_0x834e('0xc')]});var userAttributes=['id',_0x834e('0xd'),_0x834e('0xe'),_0x834e('0xf'),_0x834e('0x10'),_0x834e('0x11'),_0x834e('0x12'),_0x834e('0x13'),_0x834e('0x14'),_0x834e('0x15'),_0x834e('0x16'),_0x834e('0x17'),_0x834e('0x18'),_0x834e('0x19'),_0x834e('0x1a'),_0x834e('0x1b'),_0x834e('0x1c'),'lastLoginAt',_0x834e('0x1d'),_0x834e('0x1e'),'allowmessenger',_0x834e('0x1f'),_0x834e('0x20'),_0x834e('0x21'),_0x834e('0x22'),'phoneBarDnd',_0x834e('0x23'),_0x834e('0x24'),'phoneBarEnableSettings',_0x834e('0x25'),'phoneBarPrefixRequired',_0x834e('0x26'),_0x834e('0x27'),'hotdesk',_0x834e('0x28'),_0x834e('0x29'),_0x834e('0x2a'),'settingsEnabled',_0x834e('0x2b'),_0x834e('0x2c'),_0x834e('0x2d'),_0x834e('0x2e'),_0x834e('0x2f'),_0x834e('0x30'),_0x834e('0x31'),'chatAutoanswerDelay',_0x834e('0x32'),_0x834e('0x33'),_0x834e('0x34'),_0x834e('0x35'),'openchannelAutoanswer',_0x834e('0x36'),_0x834e('0x37'),'faxAutoanswerDelay',_0x834e('0x38'),_0x834e('0x39')];exports[_0x834e('0x3a')]=function(){return this['isAuthenticated'](!![])['use'](function(_0x231619,_0x34563b,_0x589dde){if(_0x231619[_0x834e('0x3b')]){_0x589dde();}else{return db[_0x834e('0x3c')]['findOne']({'where':{'id':_0x231619[_0x834e('0x3d')]['id']},'attributes':['id',_0x834e('0x3e'),_0x834e('0x3f')],'raw':!![]})['then'](function(_0x24fcf7){if(_0x24fcf7&&_0x24fcf7[_0x834e('0x3e')]){return _0x34563b['status'](_0x24fcf7['disposition']===_0x834e('0x40')?0x195:0x193)['json']({'message':_0x24fcf7[_0x834e('0x3f')]===_0x834e('0x40')?_0x834e('0x41'):_0x834e('0x42')});}else{_0x589dde();}})[_0x834e('0x43')](function(_0x130cc5){_0x589dde(_0x130cc5);});}});};exports['isAuthenticated']=function isAuthenticated(_0x510780){return compose()['use'](function(_0x58c1d7,_0x2c7a8d,_0x567cea){var _0x106d6a;if(_0x58c1d7['headers'][_0x834e('0x44')]){if(_[_0x834e('0x45')](_0x58c1d7[_0x834e('0x46')][_0x834e('0x44')],_0x834e('0x47'))){var _0x390119=basicAuth(_0x58c1d7);db[_0x834e('0x48')][_0x834e('0x49')]({'where':{'name':_0x390119[_0x834e('0xf')]}})['then'](function(_0xef9ec2){if(!_0xef9ec2||!_0xef9ec2['authenticate'](_0x390119[_0x834e('0x4a')])){return _0x2c7a8d[_0x834e('0x4b')](0x191)[_0x834e('0x4c')]({'message':_0x834e('0x4d')});}_0x58c1d7[_0x834e('0x3b')]={'id':_0xef9ec2['id']};_0x567cea();})[_0x834e('0x43')](function(_0x4696a1){_0x567cea(_0x4696a1);});}else if(_[_0x834e('0x45')](_0x58c1d7[_0x834e('0x46')][_0x834e('0x44')],'Bearer')){validateJwt(_0x58c1d7,_0x2c7a8d,_0x567cea);}else{if(_0x510780){_0x567cea();}else{return _0x2c7a8d[_0x834e('0x4b')](0x193)[_0x834e('0x4c')]({'message':_0x834e('0x4e')});}}}else if(_0x58c1d7[_0x834e('0x4f')]['apikey']){try{var _0x3f88ad={'audience':hardwareConf[_0x834e('0x50')](),'issuer':hardwareConf['getUuid']()};verifyJwt(_0x58c1d7['query']['apikey'],_0x3f88ad)[_0x834e('0x51')](function(_0x41bf4d){return db[_0x834e('0x48')][_0x834e('0x49')]({'where':{'id':_0x41bf4d[_0x834e('0x52')]}})[_0x834e('0x51')](function(_0x4c2ef6){_0x106d6a=_0x4c2ef6;return db[_0x834e('0x53')]['findOne']({'where':{'id':0x1},'attributes':[_0x834e('0x54'),_0x834e('0x55')],'raw':!![]});})['then'](function(_0x18ac3b){if(!_0x106d6a||!_[_0x834e('0x56')](_0x106d6a['apiKeyNonce'],_0x41bf4d['nonce'])){return _0x2c7a8d[_0x834e('0x4b')](0x191)[_0x834e('0x4c')]({'message':_0x834e('0x57')});}if(_0x106d6a[_0x834e('0x58')]){return _0x2c7a8d[_0x834e('0x4b')](0x191)['json']({'message':_0x834e('0x59')});}if(_0x106d6a['blocked']){if(_0x18ac3b['blockDuration']>0x0){if(moment(_0x106d6a[_0x834e('0x5a')])['add'](_0x18ac3b[_0x834e('0x55')],_0x834e('0x5b'))>moment()){return _0x2c7a8d[_0x834e('0x4b')](0x191)[_0x834e('0x4c')]({'message':_0x834e('0x59')});}}else{return _0x2c7a8d['status'](0x191)[_0x834e('0x4c')]({'message':_0x834e('0x59')});}}_0x58c1d7[_0x834e('0x3b')]={'id':_0x106d6a['id']};_0x567cea();});})['catch'](function(){return _0x2c7a8d[_0x834e('0x4b')](0x191)[_0x834e('0x4c')]({'message':'Invalid\x20API\x20access\x20key'});});}catch(_0x1e3e71){_0x567cea(_0x1e3e71);}}else if(_0x510780){_0x567cea();}else{return _0x2c7a8d['status'](0x193)[_0x834e('0x4c')]({'message':_0x834e('0x4e')});}})['use'](function(_0x4a6942,_0x22ea21,_0x16969b){if(_0x4a6942[_0x834e('0x3b')]){db[_0x834e('0x48')][_0x834e('0x49')]({'where':{'id':_0x4a6942[_0x834e('0x3b')]['id']},'attributes':userAttributes})[_0x834e('0x51')](function(_0x4a3381){if(!_0x4a3381){return _0x22ea21[_0x834e('0x4b')](0x194)['json']({'message':_0x834e('0x5c')});}_0x4a6942['user']=_0x4a3381;_0x16969b();})[_0x834e('0x43')](function(_0x5a5807){_0x16969b(_0x5a5807);});}else if(_0x510780){_0x16969b();}else{return _0x22ea21[_0x834e('0x4b')](0x194)[_0x834e('0x4c')]({'message':'User\x20object\x20not\x20found.'});}});};exports[_0x834e('0x5d')]=function canUpdate(){return compose()[_0x834e('0x5e')](function(_0xa880cb,_0xd55cc3,_0x252ea0){return licenseUtil[_0x834e('0x5f')]()[_0x834e('0x51')](function(_0x3ccd8e){if(_0x3ccd8e[_0x834e('0x60')]){_0x252ea0();}else{return _0xd55cc3[_0x834e('0x4b')](0x193)['json']({'message':_0x834e('0x61')});}})[_0x834e('0x43')](function(_0x47a8a9){_0x252ea0(_0x47a8a9);});});};exports[_0x834e('0x62')]=function isWebrtcLicence(){return compose()[_0x834e('0x5e')](function(_0x25b035,_0x2112d5,_0x19b5ef){return licenseUtil[_0x834e('0x5f')]()['then'](function(_0x59c855){if(_0x59c855[_0x834e('0x63')]){_0x19b5ef();}else{return _0x2112d5[_0x834e('0x4b')](0x193)[_0x834e('0x4c')]({'message':_0x834e('0x61')});}})[_0x834e('0x43')](function(_0xd1d83b){_0x19b5ef(_0xd1d83b);});});};exports[_0x834e('0x64')]=function(_0x43f599,_0x1419eb,_0x390c45){_0x43f599[_0x834e('0x64')]=!![];return _0x390c45();};exports[_0x834e('0x65')]=function signToken(_0x1a28f6){return signJwt(_0x1a28f6);};exports[_0x834e('0x66')]=function(_0x2aa072,_0x1a3855){if(!_0x2aa072[_0x834e('0x3b')]){return _0x1a3855[_0x834e('0x4b')](0x194)[_0x834e('0x4c')]({'message':_0x834e('0x67')});}var _0x4cfacd={'payload':{'id':_0x2aa072[_0x834e('0x3b')]['id'],'role':_0x2aa072[_0x834e('0x3b')]['role']},'options':{'expiresIn':0x15180}};return signJwt(_0x4cfacd)[_0x834e('0x51')](function(_0x3b0988){_0x1a3855['cookie'](_0x834e('0x68'),_0x3b0988);_0x1a3855[_0x834e('0x69')](_0x834e('0x6a'));})[_0x834e('0x43')](function(_0x4288e4){return _0x1a3855[_0x834e('0x4b')](0x1f4)[_0x834e('0x6b')](_0x4288e4);});};exports['retrieveApiKey']=function(_0x1ad7fe){if(_[_0x834e('0x6c')](_0x1ad7fe[_0x834e('0x6d')])||_[_0x834e('0x6c')](_0x1ad7fe[_0x834e('0x6e')])){return null;}else{return createJwt(_0x1ad7fe);}};exports[_0x834e('0x6f')]=function(_0x344b51){_0x344b51[_0x834e('0x6d')]=generateNonce();_0x344b51['apiKeyIat']=generateIssuedAt();return createJwt(_0x344b51);};exports[_0x834e('0x70')]=function(_0x4dc104,_0x2f4bde){var _0x53a9ee=_0x4dc104[_0x834e('0x4f')]['apikey'];if(_0x53a9ee){var _0x527eef={'nonce':_0x2f4bde[_0x834e('0x6d')],'iat':_0x2f4bde[_0x834e('0x6e')],'audience':hardwareConf['getUuid'](),'issuer':hardwareConf['getUuid']()};return verifyJwt(_0x53a9ee,_0x527eef)[_0x834e('0x51')](function(){return generateApiKey(_0x2f4bde);});}else{throw{'message':_0x834e('0x71')};}};exports[_0x834e('0x72')]=function(_0x387365){var _0x21c417=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x21c417[_0x834e('0x73')](_0x387365))throw new db[(_0x834e('0x74'))][(_0x834e('0x75'))]('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[_0x834e('0x76')]=function(_0x3c70bf,_0x5d5ac2,_0x281342){var _0x4e2b22=encryptor[_0x834e('0x77')](_0x5d5ac2)[_0x834e('0x78')](',');for(var _0x5160c4=0x0;_0x5160c4<_0x281342;_0x5160c4++){if(!_0x4e2b22[_0x5160c4])break;if(_0x3c70bf[_0x834e('0x79')]()===_0x4e2b22[_0x5160c4][_0x834e('0x79')]()){var _0x2de29a=util[_0x834e('0x7a')]('The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.',_0x281342);if(_0x281342===0x1){_0x2de29a=_0x834e('0x7b');}throw new db[(_0x834e('0x74'))][(_0x834e('0x75'))](_0x2de29a);}}return;};exports['updatePasswordsHistory']=function(_0x246b8e,_0x1fcae9){var _0x3a7683=_0x1fcae9?encryptor[_0x834e('0x77')](_0x1fcae9)[_0x834e('0x78')](','):[];if(_0x3a7683[_0x834e('0x7c')]===0x5){_0x3a7683[_0x834e('0x7d')](-0x1,0x1);}_0x3a7683[_0x834e('0x7e')](_0x246b8e);return encryptor[_0x834e('0x7f')](_0x3a7683[_0x834e('0x80')](','));};function signJwt(_0x1e4310){var _0x1dfa95=BPromise[_0x834e('0x81')](jwt[_0x834e('0x82')],{'context':jwt});var _0x460a7a=_0x1e4310[_0x834e('0x83')]||config[_0x834e('0x84')][_0x834e('0xc')];return new BPromise(function(_0x193a15,_0x3e3467){_0x1dfa95(_0x1e4310[_0x834e('0x85')],_0x460a7a,_0x1e4310[_0x834e('0x86')])['then'](function(_0x2145cf){_0x193a15(_0x2145cf);})[_0x834e('0x43')](function(_0x45bcc2){_0x3e3467(_0x45bcc2);});});}function verifyJwt(_0x36cc14,_0x4ca099,_0x30faa8){var _0x5a9c70=BPromise['promisify'](jwt[_0x834e('0x87')],{'context':jwt});var _0x2b1ec7=_0x30faa8||config[_0x834e('0x84')][_0x834e('0xc')];return new BPromise(function(_0x216105,_0x3821ad){_0x5a9c70(_0x36cc14,_0x2b1ec7,_0x4ca099)[_0x834e('0x51')](function(_0xe5c8f6){_0x216105(_0xe5c8f6);})['catch'](function(_0xdef8c4){_0x3821ad(_0xdef8c4);});});}function generateNonce(){return crypto['randomBytes'](0x10)[_0x834e('0x88')](_0x834e('0x89'));}function generateIssuedAt(){return Math['floor'](Date['now']()/0x3e8)[_0x834e('0x88')]();}function createJwt(_0x82f2a7){var _0x363cc2={'payload':{'iat':_0x82f2a7[_0x834e('0x6e')],'nonce':_0x82f2a7[_0x834e('0x6d')]},'options':{'algorithm':'HS512','subject':_0x82f2a7['id'][_0x834e('0x88')](),'issuer':hardwareConf[_0x834e('0x50')](),'audience':hardwareConf[_0x834e('0x50')]()}};return signJwt(_0x363cc2)[_0x834e('0x51')](function(_0x3181af){return{'iat':_0x82f2a7[_0x834e('0x6e')],'nonce':_0x82f2a7[_0x834e('0x6d')],'token':_0x3181af};});}
\ No newline at end of file
+var _0xf3cd=['role','name','userpic','permissions','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','pauseType','showWebBar','lastPauseAt','crudPermissions','allowmessenger','passwordResetAt','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk','interface','userProfileId','privacyEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions','downloadAttachments','ignorePauseForPreviewCalls','selectRecallMeCampaign','chatAutoanswer','chatAutoanswerDelay','emailAutoanswer','emailAutoanswerDelay','smsAutoanswer','smsAutoanswerDelay','openchannelAutoanswer','faxAutoanswerDelay','whatsappAutoanswerDelay','isChatInteractionAuthorized','isAuthenticated','use','user','ChatInteraction','findOne','params','closed','disposition','then','status','unmanaged','json','authorization','startsWith','Basic','User','authenticate','catch','Bearer','query','apikey','getUuid','find','sub','allowedLoginAttempts','isEqual','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','blockDuration','add','minutes','Invalid\x20API\x20access\x20key','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','getLicense','Forbidden','isWebrtcLicence','webrtc','isMiddleware','cookie','motion.token','send','retrieveApiKey','isNil','apiKeyIat','regenerateApiKey','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','validatePasswordHistory','decryptString','split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','ValidationError','updatePasswordsHistory','length','splice','encryptString','promisify','sign','secret','payload','options','verify','randomBytes','toString','hex','floor','now','HS512','../../mysqldb','../../config/environment','../../config/license/hardware','../../config/license/util','../encryptor','lodash','express-jwt','composable-middleware','basic-auth','bluebird','util','moment','secrets','session'];(function(_0x2bddb2,_0x1f4aaf){var _0x41cfbe=function(_0x4943c9){while(--_0x4943c9){_0x2bddb2['push'](_0x2bddb2['shift']());}};_0x41cfbe(++_0x1f4aaf);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x450d4e,_0xcacc3){_0x450d4e=_0x450d4e-0x0;var _0x300304=_0xf3cd[_0x450d4e];return _0x300304;};'use strict';var db=require(_0xdf3c('0x0'))['db'];var config=require(_0xdf3c('0x1'));var hardwareConf=require(_0xdf3c('0x2'));var licenseUtil=require(_0xdf3c('0x3'));var encryptor=require(_0xdf3c('0x4'));var _=require(_0xdf3c('0x5'));var jwt=require('jsonwebtoken');var expressJwt=require(_0xdf3c('0x6'));var compose=require(_0xdf3c('0x7'));var basicAuth=require(_0xdf3c('0x8'));var crypto=require('crypto');var BPromise=require(_0xdf3c('0x9'));var util=require(_0xdf3c('0xa'));var moment=require(_0xdf3c('0xb'));var validateJwt=expressJwt({'secret':config[_0xdf3c('0xc')][_0xdf3c('0xd')]});var userAttributes=['id',_0xdf3c('0xe'),'fullname',_0xdf3c('0xf'),'internal','email',_0xdf3c('0x10'),_0xdf3c('0x11'),'md5secret',_0xdf3c('0x12'),_0xdf3c('0x13'),_0xdf3c('0x14'),_0xdf3c('0x15'),_0xdf3c('0x16'),_0xdf3c('0x17'),_0xdf3c('0x18'),_0xdf3c('0x19'),'lastLoginAt',_0xdf3c('0x1a'),_0xdf3c('0x1b'),_0xdf3c('0x1c'),_0xdf3c('0x1d'),'alias',_0xdf3c('0x1e'),_0xdf3c('0x1f'),_0xdf3c('0x20'),'phoneBarEnableRecording',_0xdf3c('0x21'),_0xdf3c('0x22'),_0xdf3c('0x23'),_0xdf3c('0x24'),_0xdf3c('0x25'),_0xdf3c('0x26'),_0xdf3c('0x27'),_0xdf3c('0x28'),_0xdf3c('0x29'),_0xdf3c('0x2a'),'settingsEnabled',_0xdf3c('0x2b'),_0xdf3c('0x2c'),_0xdf3c('0x2d'),_0xdf3c('0x2e'),_0xdf3c('0x2f'),_0xdf3c('0x30'),_0xdf3c('0x31'),_0xdf3c('0x32'),_0xdf3c('0x33'),_0xdf3c('0x34'),_0xdf3c('0x35'),_0xdf3c('0x36'),_0xdf3c('0x37'),'openchannelAutoanswerDelay','faxAutoanswer',_0xdf3c('0x38'),'whatsappAutoanswer',_0xdf3c('0x39')];exports[_0xdf3c('0x3a')]=function(){return this[_0xdf3c('0x3b')](!![])[_0xdf3c('0x3c')](function(_0x33652f,_0x36ba1c,_0x50d8ca){if(_0x33652f[_0xdf3c('0x3d')]){_0x50d8ca();}else{return db[_0xdf3c('0x3e')][_0xdf3c('0x3f')]({'where':{'id':_0x33652f[_0xdf3c('0x40')]['id']},'attributes':['id',_0xdf3c('0x41'),_0xdf3c('0x42')],'raw':!![]})[_0xdf3c('0x43')](function(_0x155f54){if(_0x155f54&&_0x155f54[_0xdf3c('0x41')]){return _0x36ba1c[_0xdf3c('0x44')](_0x155f54['disposition']===_0xdf3c('0x45')?0x195:0x193)[_0xdf3c('0x46')]({'message':_0x155f54['disposition']===_0xdf3c('0x45')?'Unmanaged.':'Forbidden.'});}else{_0x50d8ca();}})['catch'](function(_0x14aac9){_0x50d8ca(_0x14aac9);});}});};exports[_0xdf3c('0x3b')]=function isAuthenticated(_0x52b8f6){return compose()['use'](function(_0x37ecfd,_0x1f2ce4,_0xd3cfcb){var _0x1ccdd4;if(_0x37ecfd['headers'][_0xdf3c('0x47')]){if(_[_0xdf3c('0x48')](_0x37ecfd['headers']['authorization'],_0xdf3c('0x49'))){var _0x46f0e3=basicAuth(_0x37ecfd);db[_0xdf3c('0x4a')]['find']({'where':{'name':_0x46f0e3[_0xdf3c('0xf')]}})[_0xdf3c('0x43')](function(_0x21e7b8){if(!_0x21e7b8||!_0x21e7b8[_0xdf3c('0x4b')](_0x46f0e3['pass'])){return _0x1f2ce4[_0xdf3c('0x44')](0x191)[_0xdf3c('0x46')]({'message':'Wrong\x20credentials.'});}_0x37ecfd[_0xdf3c('0x3d')]={'id':_0x21e7b8['id']};_0xd3cfcb();})[_0xdf3c('0x4c')](function(_0x217a65){_0xd3cfcb(_0x217a65);});}else if(_[_0xdf3c('0x48')](_0x37ecfd['headers'][_0xdf3c('0x47')],_0xdf3c('0x4d'))){validateJwt(_0x37ecfd,_0x1f2ce4,_0xd3cfcb);}else{if(_0x52b8f6){_0xd3cfcb();}else{return _0x1f2ce4[_0xdf3c('0x44')](0x193)[_0xdf3c('0x46')]({'message':'Unknown\x20authorization\x20format'});}}}else if(_0x37ecfd[_0xdf3c('0x4e')][_0xdf3c('0x4f')]){try{var _0x5ddd21={'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0xdf3c('0x50')]()};verifyJwt(_0x37ecfd['query'][_0xdf3c('0x4f')],_0x5ddd21)['then'](function(_0x57faba){return db['User'][_0xdf3c('0x51')]({'where':{'id':_0x57faba[_0xdf3c('0x52')]}})[_0xdf3c('0x43')](function(_0x29b5b7){_0x1ccdd4=_0x29b5b7;return db['Setting']['findOne']({'where':{'id':0x1},'attributes':[_0xdf3c('0x53'),'blockDuration'],'raw':!![]});})[_0xdf3c('0x43')](function(_0x17b502){if(!_0x1ccdd4||!_[_0xdf3c('0x54')](_0x1ccdd4[_0xdf3c('0x55')],_0x57faba[_0xdf3c('0x56')])){return _0x1f2ce4[_0xdf3c('0x44')](0x191)[_0xdf3c('0x46')]({'message':_0xdf3c('0x57')});}if(_0x1ccdd4[_0xdf3c('0x58')]){return _0x1f2ce4['status'](0x191)[_0xdf3c('0x46')]({'message':'Invalid\x20API\x20access\x20key'});}if(_0x1ccdd4['blocked']){if(_0x17b502[_0xdf3c('0x59')]>0x0){if(moment(_0x1ccdd4['blockedAt'])[_0xdf3c('0x5a')](_0x17b502['blockDuration'],_0xdf3c('0x5b'))>moment()){return _0x1f2ce4[_0xdf3c('0x44')](0x191)[_0xdf3c('0x46')]({'message':_0xdf3c('0x5c')});}}else{return _0x1f2ce4[_0xdf3c('0x44')](0x191)[_0xdf3c('0x46')]({'message':_0xdf3c('0x5c')});}}_0x37ecfd[_0xdf3c('0x3d')]={'id':_0x1ccdd4['id']};_0xd3cfcb();});})[_0xdf3c('0x4c')](function(){return _0x1f2ce4[_0xdf3c('0x44')](0x191)[_0xdf3c('0x46')]({'message':_0xdf3c('0x5c')});});}catch(_0x57e0ab){_0xd3cfcb(_0x57e0ab);}}else if(_0x52b8f6){_0xd3cfcb();}else{return _0x1f2ce4['status'](0x193)[_0xdf3c('0x46')]({'message':'Unknown\x20authorization\x20format'});}})[_0xdf3c('0x3c')](function(_0x14d8e1,_0x46194d,_0x328b18){if(_0x14d8e1['user']){db['User'][_0xdf3c('0x51')]({'where':{'id':_0x14d8e1[_0xdf3c('0x3d')]['id']},'attributes':userAttributes})[_0xdf3c('0x43')](function(_0x4c59ef){if(!_0x4c59ef){return _0x46194d[_0xdf3c('0x44')](0x194)[_0xdf3c('0x46')]({'message':_0xdf3c('0x5d')});}_0x14d8e1[_0xdf3c('0x3d')]=_0x4c59ef;_0x328b18();})['catch'](function(_0x127685){_0x328b18(_0x127685);});}else if(_0x52b8f6){_0x328b18();}else{return _0x46194d[_0xdf3c('0x44')](0x194)[_0xdf3c('0x46')]({'message':_0xdf3c('0x5e')});}});};exports[_0xdf3c('0x5f')]=function canUpdate(){return compose()['use'](function(_0x410aaf,_0x286b72,_0x437443){return licenseUtil[_0xdf3c('0x60')]()[_0xdf3c('0x43')](function(_0x344f1e){if(_0x344f1e['update']){_0x437443();}else{return _0x286b72['status'](0x193)[_0xdf3c('0x46')]({'message':_0xdf3c('0x61')});}})['catch'](function(_0x5c9885){_0x437443(_0x5c9885);});});};exports[_0xdf3c('0x62')]=function isWebrtcLicence(){return compose()[_0xdf3c('0x3c')](function(_0x46b2bd,_0x2aeb29,_0xaae4bc){return licenseUtil[_0xdf3c('0x60')]()[_0xdf3c('0x43')](function(_0x84c5c2){if(_0x84c5c2[_0xdf3c('0x63')]){_0xaae4bc();}else{return _0x2aeb29['status'](0x193)[_0xdf3c('0x46')]({'message':_0xdf3c('0x61')});}})[_0xdf3c('0x4c')](function(_0xe760dd){_0xaae4bc(_0xe760dd);});});};exports[_0xdf3c('0x64')]=function(_0x385824,_0x28a468,_0x553f70){_0x385824[_0xdf3c('0x64')]=!![];return _0x553f70();};exports['signToken']=function signToken(_0xa4e137){return signJwt(_0xa4e137);};exports['setTokenCookie']=function(_0x41b78c,_0x28144f){if(!_0x41b78c[_0xdf3c('0x3d')]){return _0x28144f[_0xdf3c('0x44')](0x194)['json']({'message':'It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.'});}var _0x4a068a={'payload':{'id':_0x41b78c[_0xdf3c('0x3d')]['id'],'role':_0x41b78c['user'][_0xdf3c('0xe')]},'options':{'expiresIn':0x15180}};return signJwt(_0x4a068a)[_0xdf3c('0x43')](function(_0x446713){_0x28144f[_0xdf3c('0x65')](_0xdf3c('0x66'),_0x446713);_0x28144f['redirect']('/dashboards/general');})[_0xdf3c('0x4c')](function(_0x27a541){return _0x28144f['status'](0x1f4)[_0xdf3c('0x67')](_0x27a541);});};exports[_0xdf3c('0x68')]=function(_0x168eaf){if(_[_0xdf3c('0x69')](_0x168eaf[_0xdf3c('0x55')])||_[_0xdf3c('0x69')](_0x168eaf[_0xdf3c('0x6a')])){return null;}else{return createJwt(_0x168eaf);}};exports['generateApiKey']=function(_0x4c98dc){_0x4c98dc[_0xdf3c('0x55')]=generateNonce();_0x4c98dc[_0xdf3c('0x6a')]=generateIssuedAt();return createJwt(_0x4c98dc);};exports[_0xdf3c('0x6b')]=function(_0x1ad771,_0x22de6c){var _0x39f38f=_0x1ad771[_0xdf3c('0x4e')][_0xdf3c('0x4f')];if(_0x39f38f){var _0x143d01={'nonce':_0x22de6c[_0xdf3c('0x55')],'iat':_0x22de6c[_0xdf3c('0x6a')],'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0xdf3c('0x50')]()};return verifyJwt(_0x39f38f,_0x143d01)['then'](function(){return generateApiKey(_0x22de6c);});}else{throw{'message':'Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one'};}};exports['validatePasswordPattern']=function(_0x58fcbf){var _0x541c57=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x541c57[_0xdf3c('0x6c')](_0x58fcbf))throw new db[(_0xdf3c('0x6d'))]['ValidationError'](_0xdf3c('0x6e'));return;};exports[_0xdf3c('0x6f')]=function(_0x51f8dd,_0xa8dddb,_0x28f935){var _0x10e9d5=encryptor[_0xdf3c('0x70')](_0xa8dddb)[_0xdf3c('0x71')](',');for(var _0x28f387=0x0;_0x28f387<_0x28f935;_0x28f387++){if(!_0x10e9d5[_0x28f387])break;if(_0x51f8dd[_0xdf3c('0x72')]()===_0x10e9d5[_0x28f387][_0xdf3c('0x72')]()){var _0x42efa2=util[_0xdf3c('0x73')](_0xdf3c('0x74'),_0x28f935);if(_0x28f935===0x1){_0x42efa2='The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.';}throw new db[(_0xdf3c('0x6d'))][(_0xdf3c('0x75'))](_0x42efa2);}}return;};exports[_0xdf3c('0x76')]=function(_0x5a3d63,_0x245c68){var _0x3e327e=_0x245c68?encryptor[_0xdf3c('0x70')](_0x245c68)['split'](','):[];if(_0x3e327e[_0xdf3c('0x77')]===0x5){_0x3e327e[_0xdf3c('0x78')](-0x1,0x1);}_0x3e327e['unshift'](_0x5a3d63);return encryptor[_0xdf3c('0x79')](_0x3e327e['join'](','));};function signJwt(_0x28c296){var _0x1b03e7=BPromise[_0xdf3c('0x7a')](jwt[_0xdf3c('0x7b')],{'context':jwt});var _0xed2a78=_0x28c296[_0xdf3c('0x7c')]||config[_0xdf3c('0xc')][_0xdf3c('0xd')];return new BPromise(function(_0x2922d8,_0x330730){_0x1b03e7(_0x28c296[_0xdf3c('0x7d')],_0xed2a78,_0x28c296[_0xdf3c('0x7e')])[_0xdf3c('0x43')](function(_0x206a18){_0x2922d8(_0x206a18);})[_0xdf3c('0x4c')](function(_0xe42432){_0x330730(_0xe42432);});});}function verifyJwt(_0xd7fb2d,_0x510538,_0x4dade5){var _0x2e8511=BPromise[_0xdf3c('0x7a')](jwt[_0xdf3c('0x7f')],{'context':jwt});var _0x596282=_0x4dade5||config[_0xdf3c('0xc')]['session'];return new BPromise(function(_0x574852,_0x184952){_0x2e8511(_0xd7fb2d,_0x596282,_0x510538)[_0xdf3c('0x43')](function(_0x1121b9){_0x574852(_0x1121b9);})[_0xdf3c('0x4c')](function(_0x68f487){_0x184952(_0x68f487);});});}function generateNonce(){return crypto[_0xdf3c('0x80')](0x10)[_0xdf3c('0x81')](_0xdf3c('0x82'));}function generateIssuedAt(){return Math[_0xdf3c('0x83')](Date[_0xdf3c('0x84')]()/0x3e8)[_0xdf3c('0x81')]();}function createJwt(_0x5a2dad){var _0x34000c={'payload':{'iat':_0x5a2dad['apiKeyIat'],'nonce':_0x5a2dad[_0xdf3c('0x55')]},'options':{'algorithm':_0xdf3c('0x85'),'subject':_0x5a2dad['id'][_0xdf3c('0x81')](),'issuer':hardwareConf[_0xdf3c('0x50')](),'audience':hardwareConf[_0xdf3c('0x50')]()}};return signJwt(_0x34000c)['then'](function(_0x18bf4f){return{'iat':_0x5a2dad[_0xdf3c('0x6a')],'nonce':_0x5a2dad[_0xdf3c('0x55')],'token':_0x18bf4f};});}
\ No newline at end of file
index d8576b7..35f7d1e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe790=['indexOf','hasOwnProperty','createReadStream','createWriteStream','createCipher','data','update','write','end','close','decryptFile','createDecipher','binary','final','unlink','encryptString','secret','utf8','decryptString','base64','crypto','bluebird','app','session','aes-256-ctr','aes192','encrypt','algorithm','join','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','getCiphers','filter'];(function(_0x170176,_0x1861cb){var _0x25f326=function(_0x2abb33){while(--_0x2abb33){_0x170176['push'](_0x170176['shift']());}};_0x25f326(++_0x1861cb);}(_0xe790,0x11c));var _0x0e79=function(_0x2f6bc9,_0x23dcbb){_0x2f6bc9=_0x2f6bc9-0x0;var _0xcecc0a=_0xe790[_0x2f6bc9];return _0xcecc0a;};'use strict';var crypto=require(_0x0e79('0x0'));var fs=require('fs');var BPromise=require(_0x0e79('0x1'));var _=require('lodash');var config=require('../../config/environment');var logger=require('../../config/logger')(_0x0e79('0x2'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config['secrets'][_0x0e79('0x3')],'algorithm':_0x0e79('0x4')};const fileOptions={'algorithm':_0x0e79('0x5')};if(config[_0x0e79('0x6')]&&config['encrypt'][_0x0e79('0x7')]){var isSupported=isAlgorithmSupported(config['encrypt'][_0x0e79('0x7')]);if(isSupported){fileOptions[_0x0e79('0x7')]=config[_0x0e79('0x6')][_0x0e79('0x7')];}else{var supportedAlgorithms=getSupportedCiphers()[_0x0e79('0x8')](',\x20');logger[_0x0e79('0x9')](config[_0x0e79('0x6')]['algorithm'],_0x0e79('0xa'),supportedAlgorithms);}}function isASupportedCipher(_0x4262ca){return AES_SUPPORTED_RX['test'](_0x4262ca);}function getSupportedCiphers(){return crypto[_0x0e79('0xb')]()[_0x0e79('0xc')](isASupportedCipher);}function isAlgorithmSupported(_0x419473){return getSupportedCiphers()[_0x0e79('0xd')](_0x419473)>-0x1;}function combineOptions(_0x5886eb){var _0x1f71b5={};for(var _0x55c580 in fileOptions){if(fileOptions[_0x0e79('0xe')](_0x55c580)){_0x1f71b5[_0x55c580]=fileOptions[_0x55c580];}}if(_0x5886eb){for(var _0x451990 in _0x5886eb){if(_0x5886eb[_0x0e79('0xe')](_0x451990)){_0x1f71b5[_0x451990]=_0x5886eb[_0x451990];}}}return _0x1f71b5;}exports['encryptFile']=function(_0xfb6597,_0x468937,_0xab0ba2,_0x32fa29){return new BPromise(function(_0x2162e3,_0xcc6964){_0x32fa29=combineOptions(_0x32fa29);var _0x486572=new Buffer(_0xab0ba2);var _0x3f0587=fs[_0x0e79('0xf')](_0xfb6597);var _0x504b4b=fs[_0x0e79('0x10')](_0x468937);var _0x1d79a7=crypto[_0x0e79('0x11')](_0x32fa29[_0x0e79('0x7')],_0x486572);_0x3f0587['on'](_0x0e79('0x12'),function(_0x526aa9){var _0x44fa77=new Buffer(_0x1d79a7[_0x0e79('0x13')](_0x526aa9),'binary');_0x504b4b[_0x0e79('0x14')](_0x44fa77);});_0x3f0587['on']('end',function(){try{var _0x56a7e9=new Buffer(_0x1d79a7['final']('binary'),'binary');_0x504b4b[_0x0e79('0x14')](_0x56a7e9);_0x504b4b[_0x0e79('0x15')]();_0x504b4b['on'](_0x0e79('0x16'),function(){return _0x2162e3(_0x468937);});}catch(_0x48423f){fs['unlink'](_0x468937);return _0xcc6964(_0x48423f);}});});};exports[_0x0e79('0x17')]=function(_0x14c839,_0x4c0a90,_0x44f953,_0x4196ec){return new BPromise(function(_0x4ead05,_0x3ba13a){_0x4196ec=combineOptions(_0x4196ec);var _0x486e5c=new Buffer(_0x44f953);var _0x2dc307=fs[_0x0e79('0xf')](_0x14c839);var _0x249803=fs[_0x0e79('0x10')](_0x4c0a90);var _0x119c5a=crypto[_0x0e79('0x18')](_0x4196ec[_0x0e79('0x7')],_0x486e5c);_0x2dc307['on'](_0x0e79('0x12'),function(_0xf0ce68){var _0x1f552b=new Buffer(_0x119c5a[_0x0e79('0x13')](_0xf0ce68),_0x0e79('0x19'));_0x249803[_0x0e79('0x14')](_0x1f552b);});_0x2dc307['on'](_0x0e79('0x15'),function(){try{var _0x3b3d7e=new Buffer(_0x119c5a[_0x0e79('0x1a')](_0x0e79('0x19')),_0x0e79('0x19'));_0x249803[_0x0e79('0x14')](_0x3b3d7e);_0x249803[_0x0e79('0x15')]();_0x249803['on'](_0x0e79('0x16'),function(){return _0x4ead05(_0x4c0a90);});}catch(_0x4b0bcd){fs[_0x0e79('0x1b')](_0x4c0a90);return _0x3ba13a(_0x4b0bcd);}});});};exports[_0x0e79('0x1c')]=function(_0x4879d0,_0x243525,_0xb3ac61){var _0x409602=_0xb3ac61||stringOptions[_0x0e79('0x7')];var _0x1b5b92=_0x243525||stringOptions[_0x0e79('0x1d')];var _0x4e691a=crypto[_0x0e79('0x11')](_0x409602,_0x1b5b92);var _0x1b5803=_0x4e691a[_0x0e79('0x13')](_0x4879d0,_0x0e79('0x1e'),'base64');_0x1b5803+=_0x4e691a[_0x0e79('0x1a')]('base64');return _0x1b5803;};exports[_0x0e79('0x1f')]=function(_0x87f046,_0x356003,_0x1cbd84){var _0x26c0b5=_0x1cbd84||stringOptions[_0x0e79('0x7')];var _0x4cb60f=_0x356003||stringOptions[_0x0e79('0x1d')];var _0x49cffc=crypto[_0x0e79('0x18')](_0x26c0b5,_0x4cb60f);var _0x4c83c4=_0x49cffc[_0x0e79('0x13')](_0x87f046,_0x0e79('0x20'),'utf8');_0x4c83c4+=_0x49cffc['final']('utf8');return _0x4c83c4;};
\ No newline at end of file
+var _0x7b40=['data','update','binary','write','end','close','unlink','decryptFile','createReadStream','createDecipher','encryptString','secret','base64','final','decryptString','utf8','crypto','bluebird','lodash','../../config/environment','../../config/logger','app','secrets','session','aes-256-ctr','aes192','encrypt','algorithm','join','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','filter','hasOwnProperty','createWriteStream','createCipher'];(function(_0x1fd313,_0xa26467){var _0x15a0b0=function(_0x522ccf){while(--_0x522ccf){_0x1fd313['push'](_0x1fd313['shift']());}};_0x15a0b0(++_0xa26467);}(_0x7b40,0x1e4));var _0x07b4=function(_0x52088c,_0x6ecd27){_0x52088c=_0x52088c-0x0;var _0x5d0869=_0x7b40[_0x52088c];return _0x5d0869;};'use strict';var crypto=require(_0x07b4('0x0'));var fs=require('fs');var BPromise=require(_0x07b4('0x1'));var _=require(_0x07b4('0x2'));var config=require(_0x07b4('0x3'));var logger=require(_0x07b4('0x4'))(_0x07b4('0x5'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x07b4('0x6')][_0x07b4('0x7')],'algorithm':_0x07b4('0x8')};const fileOptions={'algorithm':_0x07b4('0x9')};if(config[_0x07b4('0xa')]&&config[_0x07b4('0xa')][_0x07b4('0xb')]){var isSupported=isAlgorithmSupported(config['encrypt'][_0x07b4('0xb')]);if(isSupported){fileOptions['algorithm']=config[_0x07b4('0xa')][_0x07b4('0xb')];}else{var supportedAlgorithms=getSupportedCiphers()[_0x07b4('0xc')](',\x20');logger[_0x07b4('0xd')](config[_0x07b4('0xa')][_0x07b4('0xb')],_0x07b4('0xe'),supportedAlgorithms);}}function isASupportedCipher(_0x25369a){return AES_SUPPORTED_RX[_0x07b4('0xf')](_0x25369a);}function getSupportedCiphers(){return crypto['getCiphers']()[_0x07b4('0x10')](isASupportedCipher);}function isAlgorithmSupported(_0x28f18f){return getSupportedCiphers()['indexOf'](_0x28f18f)>-0x1;}function combineOptions(_0x559f37){var _0x313e47={};for(var _0x20dcfd in fileOptions){if(fileOptions[_0x07b4('0x11')](_0x20dcfd)){_0x313e47[_0x20dcfd]=fileOptions[_0x20dcfd];}}if(_0x559f37){for(var _0x1a2316 in _0x559f37){if(_0x559f37['hasOwnProperty'](_0x1a2316)){_0x313e47[_0x1a2316]=_0x559f37[_0x1a2316];}}}return _0x313e47;}exports['encryptFile']=function(_0x43d68e,_0x78fc8,_0x3eabef,_0xe78f2f){return new BPromise(function(_0xb41671,_0x100c6f){_0xe78f2f=combineOptions(_0xe78f2f);var _0x38ff3a=new Buffer(_0x3eabef);var _0x2097e3=fs['createReadStream'](_0x43d68e);var _0x5466d7=fs[_0x07b4('0x12')](_0x78fc8);var _0x53eeb8=crypto[_0x07b4('0x13')](_0xe78f2f[_0x07b4('0xb')],_0x38ff3a);_0x2097e3['on'](_0x07b4('0x14'),function(_0x494fdf){var _0x36e5e1=new Buffer(_0x53eeb8[_0x07b4('0x15')](_0x494fdf),_0x07b4('0x16'));_0x5466d7[_0x07b4('0x17')](_0x36e5e1);});_0x2097e3['on']('end',function(){try{var _0x4ae939=new Buffer(_0x53eeb8['final']('binary'),_0x07b4('0x16'));_0x5466d7[_0x07b4('0x17')](_0x4ae939);_0x5466d7[_0x07b4('0x18')]();_0x5466d7['on'](_0x07b4('0x19'),function(){return _0xb41671(_0x78fc8);});}catch(_0x5c30ac){fs[_0x07b4('0x1a')](_0x78fc8);return _0x100c6f(_0x5c30ac);}});});};exports[_0x07b4('0x1b')]=function(_0x4c56c9,_0x493004,_0x1650b6,_0x29fd85){return new BPromise(function(_0x50cf35,_0x369cdd){_0x29fd85=combineOptions(_0x29fd85);var _0x822e93=new Buffer(_0x1650b6);var _0x2a843a=fs[_0x07b4('0x1c')](_0x4c56c9);var _0x38df83=fs['createWriteStream'](_0x493004);var _0x11d5bf=crypto[_0x07b4('0x1d')](_0x29fd85[_0x07b4('0xb')],_0x822e93);_0x2a843a['on'](_0x07b4('0x14'),function(_0x4f6d3b){var _0x51647e=new Buffer(_0x11d5bf[_0x07b4('0x15')](_0x4f6d3b),_0x07b4('0x16'));_0x38df83[_0x07b4('0x17')](_0x51647e);});_0x2a843a['on']('end',function(){try{var _0x437397=new Buffer(_0x11d5bf['final'](_0x07b4('0x16')),_0x07b4('0x16'));_0x38df83[_0x07b4('0x17')](_0x437397);_0x38df83[_0x07b4('0x18')]();_0x38df83['on'](_0x07b4('0x19'),function(){return _0x50cf35(_0x493004);});}catch(_0x4d0dfa){fs[_0x07b4('0x1a')](_0x493004);return _0x369cdd(_0x4d0dfa);}});});};exports[_0x07b4('0x1e')]=function(_0x505c13,_0x45912e,_0xf11f77){var _0x15b13e=_0xf11f77||stringOptions[_0x07b4('0xb')];var _0x21ce72=_0x45912e||stringOptions[_0x07b4('0x1f')];var _0x16dfa6=crypto[_0x07b4('0x13')](_0x15b13e,_0x21ce72);var _0x50a0a2=_0x16dfa6[_0x07b4('0x15')](_0x505c13,'utf8',_0x07b4('0x20'));_0x50a0a2+=_0x16dfa6[_0x07b4('0x21')](_0x07b4('0x20'));return _0x50a0a2;};exports[_0x07b4('0x22')]=function(_0x1ef83b,_0x5e70e6,_0xc39966){var _0x3d8aaf=_0xc39966||stringOptions['algorithm'];var _0x3f3f7a=_0x5e70e6||stringOptions['secret'];var _0x10be51=crypto['createDecipher'](_0x3d8aaf,_0x3f3f7a);var _0x34dcce=_0x10be51[_0x07b4('0x15')](_0x1ef83b,_0x07b4('0x20'),_0x07b4('0x23'));_0x34dcce+=_0x10be51['final'](_0x07b4('0x23'));return _0x34dcce;};
\ No newline at end of file
index 049642a..25c6a13 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdb3f=['analytics','argv','savename','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','find','split','splitSizeCsv','then','sequelize','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','Empty','range','num','forEach','query','%s\x20limit\x20%d\x20OFFSET\x20%d','push','basename','.csv','length','existsSync','join','mkdirSync','each','%s%d.%s','%s.%s','csv','writeFileSync','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','CSV','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','finally','exit','path','to-csv','zip-dir','rimraf','../../mysqldb','dbH'];(function(_0x2f0769,_0x2106db){var _0x2f6c26=function(_0x365ccc){while(--_0x365ccc){_0x2f0769['push'](_0x2f0769['shift']());}};_0x2f6c26(++_0x2106db);}(_0xdb3f,0x1bc));var _0xfdb3=function(_0x1c8780,_0x5d68b7){_0x1c8780=_0x1c8780-0x0;var _0x36cd11=_0xdb3f[_0x1c8780];return _0x36cd11;};'use strict';var util=require('util');var path=require(_0xfdb3('0x0'));var _=require('lodash');var csv=require(_0xfdb3('0x1'));var fs=require('fs');var BPromise=require('bluebird');var zipdir=require(_0xfdb3('0x2'));var rimraf=require(_0xfdb3('0x3'));var db=require(_0xfdb3('0x4'))['db'];var dbH=require(_0xfdb3('0x4'))[_0xfdb3('0x5')];var logger=require('../../config/logger')(_0xfdb3('0x6'));var EXTRACTED_REPORT_ID=Number(process[_0xfdb3('0x7')][0x2]);var QUERY=process[_0xfdb3('0x7')][0x3];var PATH=process['argv'][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x541872,_0x497236){var _0x40d686={'status':_0x541872};var _0x1294f3={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x497236){_0x40d686[_0xfdb3('0x8')]=_0x497236;}return db[_0xfdb3('0x9')][_0xfdb3('0xa')](_0x40d686,_0x1294f3);}function main(){var _0x592a68=0x1388;var _0x1ae29a;logger[_0xfdb3('0xb')](util[_0xfdb3('0xc')](_0xfdb3('0xd'),EXTRACTED_REPORT_ID,'CSV'));return db['Setting'][_0xfdb3('0xe')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xfdb3('0xf'),_0xfdb3('0x10')]})[_0xfdb3('0x11')](function(_0x5a9bf9){if(_0x5a9bf9){_0x1ae29a=_0x5a9bf9;_0x592a68=_0x1ae29a[_0xfdb3('0x10')]||0x1388;}})[_0xfdb3('0x11')](function(){return dbH[_0xfdb3('0x12')]['query'](util[_0xfdb3('0xc')](_0xfdb3('0x13'),QUERY),{'type':dbH['sequelize'][_0xfdb3('0x14')][_0xfdb3('0x15')]});})['then'](function(_0x24c61f){if(!_0x24c61f[0x0]['num']){return analyticExtractedReport(_0xfdb3('0x16'));}var _0x23bd40=[];var _0x5d26b8=0x0;if(_0x1ae29a['split']){if(_0x24c61f&&_0x24c61f['length']){var _0x2addd8=_[_0xfdb3('0x17')](_0x24c61f[0x0][_0xfdb3('0x18')]/_0x592a68);var _0xddda9d=Number['isInteger'](_0x24c61f[0x0][_0xfdb3('0x18')]/_0x592a68)?_0x24c61f[0x0][_0xfdb3('0x18')]%_0x592a68:0x0;_0x2addd8[_0xfdb3('0x19')](function(_0x48cf03){if(_0x48cf03>0x0){_0x5d26b8+=_0x592a68;}_0x23bd40['push'](dbH[_0xfdb3('0x12')][_0xfdb3('0x1a')](util['format'](_0xfdb3('0x1b'),QUERY,_0x592a68,_0x5d26b8),{'type':dbH[_0xfdb3('0x12')][_0xfdb3('0x14')][_0xfdb3('0x15')]}));});if(_0xddda9d>0x0){_0x5d26b8+=_0x592a68;_0x23bd40[_0xfdb3('0x1c')](dbH[_0xfdb3('0x12')][_0xfdb3('0x1a')](util[_0xfdb3('0xc')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0xddda9d,_0x5d26b8),{'type':dbH[_0xfdb3('0x12')]['QueryTypes'][_0xfdb3('0x15')]}));}}}else{_0x23bd40['push'](dbH[_0xfdb3('0x12')][_0xfdb3('0x1a')](QUERY,{'type':dbH[_0xfdb3('0x12')]['QueryTypes'][_0xfdb3('0x15')]}));}var _0x295ee5=path['dirname'](PATH);var _0x2b6bae=path[_0xfdb3('0x1d')](PATH,_0xfdb3('0x1e'));var _0x5dfbbd=_0x1ae29a[_0xfdb3('0xf')]&&_0x23bd40[_0xfdb3('0x1f')]>0x1;var _0x38dc0b=[];if(!fs[_0xfdb3('0x20')](path[_0xfdb3('0x21')](_0x295ee5,_0x2b6bae))&&_0x5dfbbd){fs[_0xfdb3('0x22')](path['join'](_0x295ee5,_0x2b6bae));}return BPromise[_0xfdb3('0x23')](_0x23bd40,function(_0x3492af){_0x38dc0b['push'](_0x3492af);})[_0xfdb3('0x11')](function(){for(var _0xfdc6f=0x0;_0xfdc6f<_0x38dc0b[_0xfdb3('0x1f')];_0xfdc6f+=0x1){var _0x4c677d;var _0x2a4cce=_0x38dc0b[_0xfdc6f];if(_0x5dfbbd){_0x4c677d=path[_0xfdb3('0x21')](_0x295ee5,_0x2b6bae,util[_0xfdb3('0xc')](_0xfdb3('0x24'),_0x2b6bae,_0xfdc6f,'csv'));}else{_0x4c677d=path['join'](_0x295ee5,util['format'](_0xfdb3('0x25'),_0x2b6bae,_0xfdb3('0x26')));}fs[_0xfdb3('0x27')](_0x4c677d,csv(_0x2a4cce));}})[_0xfdb3('0x11')](function(){if(_0x5dfbbd){return new Promise(function(_0x574233){zipdir(path[_0xfdb3('0x21')](_0x295ee5,_0x2b6bae),{'saveTo':path['join'](_0x295ee5,util['format']('%s.%s',_0x2b6bae,_0xfdb3('0x28')))},function(_0x370e53,_0x178707){rimraf(path[_0xfdb3('0x21')](_0x295ee5,_0x2b6bae),function(){});_0x574233(_0xfdb3('0x29'));});});}})['then'](function(){logger[_0xfdb3('0xb')](util['format'](_0xfdb3('0x2a'),EXTRACTED_REPORT_ID,_0xfdb3('0x2b')));return analyticExtractedReport(_0xfdb3('0x2c'),_0x5dfbbd?util['format']('%s.%s',_0x2b6bae,_0x5dfbbd?_0xfdb3('0x28'):'csv'):null);});})[_0xfdb3('0x2d')](function(_0x493ae2){logger[_0xfdb3('0xb')](util[_0xfdb3('0xc')](_0xfdb3('0x2e'),EXTRACTED_REPORT_ID,_0xfdb3('0x2b')),util[_0xfdb3('0x2f')](_0x493ae2,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0xfdb3('0x30')](function(){process[_0xfdb3('0x31')](EXIT_CODE);});}main();
\ No newline at end of file
+var _0x8309=['CSV','Setting','split','splitSizeCsv','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','length','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','basename','.csv','join','mkdirSync','%s%d.%s','csv','%s.%s','writeFileSync','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','exit','path','to-csv','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format'];(function(_0x35fdff,_0x58bf32){var _0x44b12a=function(_0x5f5c1a){while(--_0x5f5c1a){_0x35fdff['push'](_0x35fdff['shift']());}};_0x44b12a(++_0x58bf32);}(_0x8309,0xaa));var _0x9830=function(_0x55e0f9,_0x38e14d){_0x55e0f9=_0x55e0f9-0x0;var _0x4ef1da=_0x8309[_0x55e0f9];return _0x4ef1da;};'use strict';var util=require('util');var path=require(_0x9830('0x0'));var _=require('lodash');var csv=require(_0x9830('0x1'));var fs=require('fs');var BPromise=require('bluebird');var zipdir=require('zip-dir');var rimraf=require(_0x9830('0x2'));var db=require(_0x9830('0x3'))['db'];var dbH=require(_0x9830('0x3'))[_0x9830('0x4')];var logger=require(_0x9830('0x5'))(_0x9830('0x6'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x9830('0x7')][0x3];var PATH=process['argv'][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0xbcbe67,_0x1030b3){var _0x128464={'status':_0xbcbe67};var _0x1ebfa8={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x1030b3){_0x128464[_0x9830('0x8')]=_0x1030b3;}return db[_0x9830('0x9')][_0x9830('0xa')](_0x128464,_0x1ebfa8);}function main(){var _0x5d718e=0x1388;var _0x5c8178;logger[_0x9830('0xb')](util[_0x9830('0xc')](_0x9830('0xd'),EXTRACTED_REPORT_ID,_0x9830('0xe')));return db[_0x9830('0xf')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x9830('0x10'),_0x9830('0x11')]})[_0x9830('0x12')](function(_0x1562a1){if(_0x1562a1){_0x5c8178=_0x1562a1;_0x5d718e=_0x5c8178[_0x9830('0x11')]||0x1388;}})['then'](function(){return dbH[_0x9830('0x13')][_0x9830('0x14')](util['format'](_0x9830('0x15'),QUERY),{'type':dbH[_0x9830('0x13')][_0x9830('0x16')][_0x9830('0x17')]});})['then'](function(_0x27421b){if(!_0x27421b[0x0][_0x9830('0x18')]){return analyticExtractedReport('Empty');}var _0x430b10=[];var _0x240f6d=0x0;if(_0x5c8178[_0x9830('0x10')]){if(_0x27421b&&_0x27421b[_0x9830('0x19')]){var _0x5ae89d=_['range'](_0x27421b[0x0][_0x9830('0x18')]/_0x5d718e);var _0x5a13e8=Number['isInteger'](_0x27421b[0x0]['num']/_0x5d718e)?_0x27421b[0x0]['num']%_0x5d718e:0x0;_0x5ae89d[_0x9830('0x1a')](function(_0xdf93b0){if(_0xdf93b0>0x0){_0x240f6d+=_0x5d718e;}_0x430b10[_0x9830('0x1b')](dbH[_0x9830('0x13')]['query'](util[_0x9830('0xc')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x5d718e,_0x240f6d),{'type':dbH[_0x9830('0x13')]['QueryTypes'][_0x9830('0x17')]}));});if(_0x5a13e8>0x0){_0x240f6d+=_0x5d718e;_0x430b10[_0x9830('0x1b')](dbH[_0x9830('0x13')][_0x9830('0x14')](util[_0x9830('0xc')](_0x9830('0x1c'),QUERY,_0x5a13e8,_0x240f6d),{'type':dbH[_0x9830('0x13')][_0x9830('0x16')][_0x9830('0x17')]}));}}}else{_0x430b10[_0x9830('0x1b')](dbH[_0x9830('0x13')]['query'](QUERY,{'type':dbH[_0x9830('0x13')][_0x9830('0x16')][_0x9830('0x17')]}));}var _0x4e05e3=path['dirname'](PATH);var _0x350bc9=path[_0x9830('0x1d')](PATH,_0x9830('0x1e'));var _0x2dccc2=_0x5c8178['split']&&_0x430b10['length']>0x1;var _0x4225d7=[];if(!fs['existsSync'](path[_0x9830('0x1f')](_0x4e05e3,_0x350bc9))&&_0x2dccc2){fs[_0x9830('0x20')](path[_0x9830('0x1f')](_0x4e05e3,_0x350bc9));}return BPromise['each'](_0x430b10,function(_0xdd4152){_0x4225d7[_0x9830('0x1b')](_0xdd4152);})[_0x9830('0x12')](function(){for(var _0xb6b696=0x0;_0xb6b696<_0x4225d7[_0x9830('0x19')];_0xb6b696+=0x1){var _0x4039c0;var _0x3ec651=_0x4225d7[_0xb6b696];if(_0x2dccc2){_0x4039c0=path[_0x9830('0x1f')](_0x4e05e3,_0x350bc9,util[_0x9830('0xc')](_0x9830('0x21'),_0x350bc9,_0xb6b696,_0x9830('0x22')));}else{_0x4039c0=path[_0x9830('0x1f')](_0x4e05e3,util[_0x9830('0xc')](_0x9830('0x23'),_0x350bc9,_0x9830('0x22')));}fs[_0x9830('0x24')](_0x4039c0,csv(_0x3ec651));}})[_0x9830('0x12')](function(){if(_0x2dccc2){return new Promise(function(_0x523d5c){zipdir(path[_0x9830('0x1f')](_0x4e05e3,_0x350bc9),{'saveTo':path[_0x9830('0x1f')](_0x4e05e3,util['format'](_0x9830('0x23'),_0x350bc9,_0x9830('0x25')))},function(_0x3bd303,_0x458291){rimraf(path[_0x9830('0x1f')](_0x4e05e3,_0x350bc9),function(){});_0x523d5c(_0x9830('0x26'));});});}})[_0x9830('0x12')](function(){logger[_0x9830('0xb')](util[_0x9830('0xc')](_0x9830('0x27'),EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport(_0x9830('0x28'),_0x2dccc2?util['format'](_0x9830('0x23'),_0x350bc9,_0x2dccc2?_0x9830('0x25'):_0x9830('0x22')):null);});})[_0x9830('0x29')](function(_0x17d883){logger['info'](util['format'](_0x9830('0x2a'),EXTRACTED_REPORT_ID,_0x9830('0xe')),util[_0x9830('0x2b')](_0x17d883,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x9830('0x2c'));})['finally'](function(){process[_0x9830('0x2d')](EXIT_CODE);});}main();
\ No newline at end of file
index 45c5801..a6677ad 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2ad4=['\x20/\x20','footer','black','num','find','split','splitSizePdf','then','range','sequelize','query','QueryTypes','SELECT','%s\x20limit\x20%d\x20OFFSET\x20%d','basename','.pdf','existsSync','mkdirSync','join','each','flatten','%s%d.%s','pdf','%s.%s','all','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','zip','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','PDF','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','channel','interactionId','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','createWriteStream','finish','error','end','createPdfFromHTML','createPdfKitDocument','catch','lodash','util','html-to-pdfmake','pdfmake/src/printer','jsdom','JSDOM','window','bluebird','../../mysqldb','dbH','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','update','tableHeader','map','pick','toString','fill','length','auto','body','push','concat','chunk','keys','forEach','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','format','endDate','header','before','margin','landscape'];(function(_0x546f7d,_0x19d51d){var _0x22b4b5=function(_0x3445d4){while(--_0x3445d4){_0x546f7d['push'](_0x546f7d['shift']());}};_0x22b4b5(++_0x19d51d);}(_0x2ad4,0x142));var _0x42ad=function(_0x4c06ac,_0x568788){_0x4c06ac=_0x4c06ac-0x0;var _0x2333cb=_0x2ad4[_0x4c06ac];return _0x2333cb;};'use strict';var _=require(_0x42ad('0x0'));var fs=require('fs');var util=require(_0x42ad('0x1'));var path=require('path');var moment=require('moment');var htmlToPdfmake=require(_0x42ad('0x2'));var PdfPrinter=require(_0x42ad('0x3'));var zipdir=require('zip-dir');var rimraf=require('rimraf');var JSDOM=require(_0x42ad('0x4'))[_0x42ad('0x5')];var window=new JSDOM('')[_0x42ad('0x6')];var BPromise=require(_0x42ad('0x7'));var db=require(_0x42ad('0x8'))['db'];var dbH=require(_0x42ad('0x8'))[_0x42ad('0x9')];var logger=require(_0x42ad('0xa'))(_0x42ad('0xb'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x42ad('0xc')][0x3];var PATH=process['argv'][0x4];var NAME=process[_0x42ad('0xc')][0x5];var FORMAT=_0x42ad('0xd');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x2b0bb6,_0x42771d){var _0x1d8ee2={'status':_0x2b0bb6};var _0x1c9336={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x42771d){_0x1d8ee2[_0x42ad('0xe')]=_0x42771d;}return db[_0x42ad('0xf')][_0x42ad('0x10')](_0x1d8ee2,_0x1c9336);}function getHeaders(_0x4284ff){return _['map'](_0x4284ff,function(_0x76af01){return{'text':_0x76af01,'style':_0x42ad('0x11')};});}function getRows(_0x342a7d,_0x5e47c6){return _[_0x42ad('0x12')](_0x5e47c6,function(_0x1e9ef2){return _(_0x1e9ef2)[_0x42ad('0x13')](_0x342a7d)[_0x42ad('0x12')](function(_0x5744dd){return _0x5744dd?_[_0x42ad('0x14')](_0x5744dd):'';})['value']();});}function createTable(_0x27bce3,_0x2c9f57){var _0x475dbb={'widths':_[_0x42ad('0x15')](Array(_0x27bce3[_0x42ad('0x16')]),0x91),'heights':function(_0x53234f){return _0x53234f===0x0?_0x42ad('0x17'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x17f2dd=getHeaders(_0x27bce3);_0x475dbb[_0x42ad('0x18')][_0x42ad('0x19')](_0x17f2dd);var _0x3adc82=getRows(_0x27bce3,_0x2c9f57);_0x475dbb[_0x42ad('0x18')]=_0x475dbb[_0x42ad('0x18')][_0x42ad('0x1a')](_0x3adc82);return _0x475dbb;}function createTables(_0x81340a){var _0x188e37=[];var _0x29be6e=_[_0x42ad('0x1b')](Object[_0x42ad('0x1c')](_0x81340a[0x0]),0x5);_0x29be6e[_0x42ad('0x1d')](function(_0x1a6caf){_0x188e37[_0x42ad('0x19')](createTable(_0x1a6caf,_0x81340a));});return _0x188e37;}function getPDFDocDefinition(_0x38e5d8){var _0x529d96=util['format'](_0x42ad('0x1e'),NAME,EXTRACTED_REPORT[_0x42ad('0x1f')],moment(EXTRACTED_REPORT['startDate'])[_0x42ad('0x20')](FORMAT),moment(EXTRACTED_REPORT[_0x42ad('0x21')])[_0x42ad('0x20')](FORMAT));var _0x69dc97=[];for(var _0x33554c=0x0;_0x33554c<_0x38e5d8[_0x42ad('0x16')];_0x33554c++){var _0x226dfa=[];if(_0x33554c===0x0){_0x226dfa[_0x42ad('0x19')]({'text':_0x529d96,'style':_0x42ad('0x22')});}var _0x2afbea={'table':_0x38e5d8[_0x33554c]};if(_0x33554c>0x0){_0x2afbea['pageBreak']=_0x42ad('0x23');_0x2afbea[_0x42ad('0x24')]=[0x0,0x46,0x0,0x0];}_0x226dfa[_0x42ad('0x19')](_0x2afbea);_0x69dc97['push'](_0x226dfa);}return{'pageSize':'A4','pageOrientation':_0x42ad('0x25'),'content':_0x69dc97,'footer':function(_0x180a6c,_0x4f0699){return{'text':_0x180a6c[_0x42ad('0x14')]()+_0x42ad('0x26')+_0x4f0699,'style':_0x42ad('0x27')};},'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x42ad('0x28')},'footer':{'alignment':'right','margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x5c2fea){var _0x535d8a=0x1388;var _0x21a4bf;if(!_0x5c2fea[0x0][_0x42ad('0x29')]){return analyticExtractedReport('Empty');}return db['Setting'][_0x42ad('0x2a')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x42ad('0x2b'),_0x42ad('0x2c')]})[_0x42ad('0x2d')](function(_0x186de6){if(_0x186de6){_0x21a4bf=_0x186de6;_0x535d8a=_0x21a4bf[_0x42ad('0x2c')]||0x3e8;}})[_0x42ad('0x2d')](function(){var _0x29cd98=[];var _0x2aa9f2=0x0;if(_0x21a4bf[_0x42ad('0x2b')]){if(_0x5c2fea&&_0x5c2fea['length']){var _0xd9678f=_[_0x42ad('0x2e')](_0x5c2fea[0x0]['num']/_0x535d8a);var _0x1446b0=Number['isInteger'](_0x5c2fea[0x0]['num']/_0x535d8a)?_0x5c2fea[0x0][_0x42ad('0x29')]%_0x535d8a:0x0;_0xd9678f['forEach'](function(_0x115463){if(_0x115463>0x0){_0x2aa9f2+=_0x535d8a;}_0x29cd98[_0x42ad('0x19')](dbH[_0x42ad('0x2f')][_0x42ad('0x30')](util[_0x42ad('0x20')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x535d8a,_0x2aa9f2),{'type':dbH[_0x42ad('0x2f')][_0x42ad('0x31')][_0x42ad('0x32')]}));});if(_0x1446b0>0x0){_0x2aa9f2+=_0x535d8a;_0x29cd98['push'](dbH[_0x42ad('0x2f')][_0x42ad('0x30')](util[_0x42ad('0x20')](_0x42ad('0x33'),QUERY,_0x1446b0,_0x2aa9f2),{'type':dbH[_0x42ad('0x2f')][_0x42ad('0x31')][_0x42ad('0x32')]}));}}}else{_0x29cd98[_0x42ad('0x19')](dbH[_0x42ad('0x2f')]['query'](QUERY,{'type':dbH[_0x42ad('0x2f')]['QueryTypes'][_0x42ad('0x32')]}));}var _0x20e67a=path['dirname'](PATH);var _0x5c7495=path[_0x42ad('0x34')](PATH,_0x42ad('0x35'));var _0x54453b=_0x21a4bf[_0x42ad('0x2b')]&&_0x29cd98['length']>0x1;var _0x278197=[];if(!fs[_0x42ad('0x36')](path['join'](_0x20e67a,_0x5c7495))&&_0x54453b){fs[_0x42ad('0x37')](path[_0x42ad('0x38')](_0x20e67a,_0x5c7495));}return BPromise[_0x42ad('0x39')](_0x29cd98,function(_0x3fc9c0){_0x278197['push'](_0x3fc9c0);})[_0x42ad('0x2d')](function(){var _0xb38300=[];for(var _0x45d26f=0x0;_0x45d26f<_0x278197[_0x42ad('0x16')];_0x45d26f+=0x1){var _0x5273b7=_0x278197[_0x45d26f];var _0x326871=createTables(_[_0x42ad('0x3a')](_0x5273b7));var _0x13a14e;var _0x52710d=getPDFDocDefinition(_0x326871);var _0x3d17f5=getPDFPrinter();var _0x5f01fa=_0x3d17f5['createPdfKitDocument'](_0x52710d);if(_0x54453b){_0x13a14e=path[_0x42ad('0x38')](_0x20e67a,_0x5c7495,util[_0x42ad('0x20')](_0x42ad('0x3b'),_0x5c7495,_0x45d26f,_0x42ad('0x3c')));}else{_0x13a14e=path['join'](_0x20e67a,util[_0x42ad('0x20')](_0x42ad('0x3d'),_0x5c7495,_0x42ad('0x3c')));}_0xb38300[_0x42ad('0x19')](writePDFDocument(_0x5f01fa,_0x13a14e));}return Promise[_0x42ad('0x3e')](_0xb38300);})['then'](function(){if(_0x54453b){return new Promise(function(_0x2ff4a7){zipdir(path[_0x42ad('0x38')](_0x20e67a,_0x5c7495),{'saveTo':path[_0x42ad('0x38')](_0x20e67a,util['format'](_0x42ad('0x3d'),_0x5c7495,'zip'))},function(){rimraf(path[_0x42ad('0x38')](_0x20e67a,_0x5c7495),function(){});_0x2ff4a7(_0x42ad('0x3f'));});});}})[_0x42ad('0x2d')](function(){if(!_0x54453b)return;rimraf(path['join'](_0x20e67a,_0x5c7495),function(){});})[_0x42ad('0x2d')](function(){logger[_0x42ad('0x40')](util[_0x42ad('0x20')](_0x42ad('0x41'),EXTRACTED_REPORT_ID,'PDF'));return analyticExtractedReport(_0x42ad('0x42'),_0x54453b?util[_0x42ad('0x20')]('%s.%s',_0x5c7495,_0x54453b?_0x42ad('0x43'):'pdf'):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger['info'](util['format'](_0x42ad('0x44'),EXTRACTED_REPORT_ID,_0x42ad('0x45')));return db['AnalyticExtractedReport'][_0x42ad('0x46')]({'where':{'id':EXTRACTED_REPORT_ID}})['then'](function(_0x4538d6){EXTRACTED_REPORT=_0x4538d6;return dbH[_0x42ad('0x2f')][_0x42ad('0x30')](util[_0x42ad('0x20')](_0x42ad('0x47'),QUERY),{'type':dbH[_0x42ad('0x2f')][_0x42ad('0x31')][_0x42ad('0x32')]});})['then'](extractReport)['catch'](function(_0xc1c8c6){logger[_0x42ad('0x40')](util[_0x42ad('0x20')](_0x42ad('0x48'),EXTRACTED_REPORT_ID,_0x42ad('0x45')),util[_0x42ad('0x49')](_0xc1c8c6,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x42ad('0x4a'));})['finally'](function(){process['exit'](EXIT_CODE);});}main();function getPDFPrinter(){var _0x1f890c=new PdfPrinter({'Arial':{'normal':__dirname+_0x42ad('0x4b'),'bold':__dirname+_0x42ad('0x4c'),'italics':__dirname+_0x42ad('0x4d'),'bolditalics':__dirname+_0x42ad('0x4e')}});return _0x1f890c;}function getPDFDocDefinitionFromHTML(_0x5c1bf2,_0x411701){var _0x296a40=util['format']('%s\x20#%d',_0x411701[_0x42ad('0x4f')],_0x411701[_0x42ad('0x50')]);var _0x4e6cf0=moment()[_0x42ad('0x20')]('YYYY-MM-DD')['toString']();var _0x5060e8=htmlToPdfmake(_0x5c1bf2,{'window':window,'tableAutoSize':!![]});return{'content':[_0x5060e8],'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':'center','margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':'center','margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':'center'}},'header':function(){return[{'text':_0x42ad('0x51'),'style':_0x42ad('0x22')}];},'footer':function(_0x26a345,_0x5a1b90){return[{'text':util[_0x42ad('0x20')](_0x42ad('0x52'),_0x296a40,_0x26a345,_0x5a1b90,_0x4e6cf0),'style':'footer'}];}};}function writePDFDocument(_0x187473,_0x513ddc){return new Promise(function(_0x2236cb,_0x56730c){var _0x53bfba=_0x187473['pipe'](fs[_0x42ad('0x53')](_0x513ddc));_0x53bfba['on'](_0x42ad('0x54'),function(){_0x2236cb(_0x42ad('0x54'));});_0x53bfba['on'](_0x42ad('0x55'),function(_0x4ae1b0){_0x56730c(_0x4ae1b0);});_0x187473[_0x42ad('0x56')]();});}exports[_0x42ad('0x57')]=function(_0x205354,_0x322029){var _0x52f864=getPDFPrinter();var _0x1ceb88=getPDFDocDefinitionFromHTML(_0x205354,_0x322029);var _0x4b6c72=_0x52f864[_0x42ad('0x58')](_0x1ceb88);return writePDFDocument(_0x4b6c72,_0x322029['path'])[_0x42ad('0x59')](function(_0x56663b){throw _0x56663b;});};
\ No newline at end of file
+var _0xb0c1=['push','header','pageBreak','landscape','\x20/\x20','Arial','black','Empty','Setting','find','split','then','num','isInteger','sequelize','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','query','SELECT','dirname','basename','.pdf','join','mkdirSync','%s%d.%s','pdf','%s.%s','all','zip','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','AnalyticExtractedReport','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','PDF','inspect','Failed','exit','/fonts/arial-regular.ttf','/fonts/arial-italic.ttf','%s\x20#%d','channel','interactionId','YYYY-MM-DD','center','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','footer','pipe','finish','end','lodash','util','path','moment','pdfmake/src/printer','rimraf','jsdom','JSDOM','../../mysqldb','dbH','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','update','map','toString','value','fill','length','auto','body','concat','keys','forEach','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','startDate','format','endDate'];(function(_0x220464,_0x15e026){var _0x21ca3e=function(_0x3a06ed){while(--_0x3a06ed){_0x220464['push'](_0x220464['shift']());}};_0x21ca3e(++_0x15e026);}(_0xb0c1,0x183));var _0x1b0c=function(_0x1100f5,_0xdbe2e7){_0x1100f5=_0x1100f5-0x0;var _0x15e288=_0xb0c1[_0x1100f5];return _0x15e288;};'use strict';var _=require(_0x1b0c('0x0'));var fs=require('fs');var util=require(_0x1b0c('0x1'));var path=require(_0x1b0c('0x2'));var moment=require(_0x1b0c('0x3'));var htmlToPdfmake=require('html-to-pdfmake');var PdfPrinter=require(_0x1b0c('0x4'));var zipdir=require('zip-dir');var rimraf=require(_0x1b0c('0x5'));var JSDOM=require(_0x1b0c('0x6'))[_0x1b0c('0x7')];var window=new JSDOM('')['window'];var BPromise=require('bluebird');var db=require(_0x1b0c('0x8'))['db'];var dbH=require(_0x1b0c('0x8'))[_0x1b0c('0x9')];var logger=require('../../config/logger')('analytics');var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x1b0c('0xa')][0x3];var PATH=process[_0x1b0c('0xa')][0x4];var NAME=process[_0x1b0c('0xa')][0x5];var FORMAT=_0x1b0c('0xb');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x501789,_0x172c20){var _0x1426c6={'status':_0x501789};var _0x6f6a60={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x172c20){_0x1426c6[_0x1b0c('0xc')]=_0x172c20;}return db['AnalyticExtractedReport'][_0x1b0c('0xd')](_0x1426c6,_0x6f6a60);}function getHeaders(_0x2b7a7f){return _[_0x1b0c('0xe')](_0x2b7a7f,function(_0x1f45e4){return{'text':_0x1f45e4,'style':'tableHeader'};});}function getRows(_0x34082d,_0x1b32e2){return _[_0x1b0c('0xe')](_0x1b32e2,function(_0x320b2c){return _(_0x320b2c)['pick'](_0x34082d)[_0x1b0c('0xe')](function(_0x241de3){return _0x241de3?_[_0x1b0c('0xf')](_0x241de3):'';})[_0x1b0c('0x10')]();});}function createTable(_0x199ed2,_0x364489){var _0x47b06e={'widths':_[_0x1b0c('0x11')](Array(_0x199ed2[_0x1b0c('0x12')]),0x91),'heights':function(_0x132d9d){return _0x132d9d===0x0?_0x1b0c('0x13'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x3b0362=getHeaders(_0x199ed2);_0x47b06e[_0x1b0c('0x14')]['push'](_0x3b0362);var _0x355169=getRows(_0x199ed2,_0x364489);_0x47b06e[_0x1b0c('0x14')]=_0x47b06e['body'][_0x1b0c('0x15')](_0x355169);return _0x47b06e;}function createTables(_0x517e94){var _0x4ff051=[];var _0x510238=_['chunk'](Object[_0x1b0c('0x16')](_0x517e94[0x0]),0x5);_0x510238[_0x1b0c('0x17')](function(_0xc7c47){_0x4ff051['push'](createTable(_0xc7c47,_0x517e94));});return _0x4ff051;}function getPDFDocDefinition(_0x2f8270){var _0x5cd8a4=util['format'](_0x1b0c('0x18'),NAME,EXTRACTED_REPORT['name'],moment(EXTRACTED_REPORT[_0x1b0c('0x19')])[_0x1b0c('0x1a')](FORMAT),moment(EXTRACTED_REPORT[_0x1b0c('0x1b')])[_0x1b0c('0x1a')](FORMAT));var _0x2ce80d=[];for(var _0x12121f=0x0;_0x12121f<_0x2f8270[_0x1b0c('0x12')];_0x12121f++){var _0x260b05=[];if(_0x12121f===0x0){_0x260b05[_0x1b0c('0x1c')]({'text':_0x5cd8a4,'style':_0x1b0c('0x1d')});}var _0x1787ed={'table':_0x2f8270[_0x12121f]};if(_0x12121f>0x0){_0x1787ed[_0x1b0c('0x1e')]='before';_0x1787ed['margin']=[0x0,0x46,0x0,0x0];}_0x260b05[_0x1b0c('0x1c')](_0x1787ed);_0x2ce80d[_0x1b0c('0x1c')](_0x260b05);}return{'pageSize':'A4','pageOrientation':_0x1b0c('0x1f'),'content':_0x2ce80d,'footer':function(_0xe98636,_0x1cc117){return{'text':_0xe98636['toString']()+_0x1b0c('0x20')+_0x1cc117,'style':'footer'};},'defaultStyle':{'font':_0x1b0c('0x21')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x1b0c('0x22')},'footer':{'alignment':'right','margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x22195c){var _0x3b0179=0x1388;var _0x458d4c;if(!_0x22195c[0x0]['num']){return analyticExtractedReport(_0x1b0c('0x23'));}return db[_0x1b0c('0x24')][_0x1b0c('0x25')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x1b0c('0x26'),'splitSizePdf']})['then'](function(_0x45acec){if(_0x45acec){_0x458d4c=_0x45acec;_0x3b0179=_0x458d4c['splitSizePdf']||0x3e8;}})[_0x1b0c('0x27')](function(){var _0x2115de=[];var _0x4fdb96=0x0;if(_0x458d4c['split']){if(_0x22195c&&_0x22195c['length']){var _0x24acbe=_['range'](_0x22195c[0x0][_0x1b0c('0x28')]/_0x3b0179);var _0x3672ce=Number[_0x1b0c('0x29')](_0x22195c[0x0][_0x1b0c('0x28')]/_0x3b0179)?_0x22195c[0x0][_0x1b0c('0x28')]%_0x3b0179:0x0;_0x24acbe[_0x1b0c('0x17')](function(_0x2c8f39){if(_0x2c8f39>0x0){_0x4fdb96+=_0x3b0179;}_0x2115de[_0x1b0c('0x1c')](dbH[_0x1b0c('0x2a')]['query'](util[_0x1b0c('0x1a')](_0x1b0c('0x2b'),QUERY,_0x3b0179,_0x4fdb96),{'type':dbH[_0x1b0c('0x2a')][_0x1b0c('0x2c')]['SELECT']}));});if(_0x3672ce>0x0){_0x4fdb96+=_0x3b0179;_0x2115de[_0x1b0c('0x1c')](dbH[_0x1b0c('0x2a')][_0x1b0c('0x2d')](util[_0x1b0c('0x1a')](_0x1b0c('0x2b'),QUERY,_0x3672ce,_0x4fdb96),{'type':dbH[_0x1b0c('0x2a')][_0x1b0c('0x2c')][_0x1b0c('0x2e')]}));}}}else{_0x2115de[_0x1b0c('0x1c')](dbH['sequelize'][_0x1b0c('0x2d')](QUERY,{'type':dbH['sequelize']['QueryTypes'][_0x1b0c('0x2e')]}));}var _0x14810d=path[_0x1b0c('0x2f')](PATH);var _0x1aec1b=path[_0x1b0c('0x30')](PATH,_0x1b0c('0x31'));var _0x5000a1=_0x458d4c[_0x1b0c('0x26')]&&_0x2115de[_0x1b0c('0x12')]>0x1;var _0xb00acd=[];if(!fs['existsSync'](path[_0x1b0c('0x32')](_0x14810d,_0x1aec1b))&&_0x5000a1){fs[_0x1b0c('0x33')](path['join'](_0x14810d,_0x1aec1b));}return BPromise['each'](_0x2115de,function(_0x42a490){_0xb00acd[_0x1b0c('0x1c')](_0x42a490);})['then'](function(){var _0x3f848b=[];for(var _0x22bbf2=0x0;_0x22bbf2<_0xb00acd[_0x1b0c('0x12')];_0x22bbf2+=0x1){var _0xbb53ca=_0xb00acd[_0x22bbf2];var _0x1b5f0=createTables(_['flatten'](_0xbb53ca));var _0x46ce8a;var _0xf36c1f=getPDFDocDefinition(_0x1b5f0);var _0x161b10=getPDFPrinter();var _0x36a0f7=_0x161b10['createPdfKitDocument'](_0xf36c1f);if(_0x5000a1){_0x46ce8a=path[_0x1b0c('0x32')](_0x14810d,_0x1aec1b,util[_0x1b0c('0x1a')](_0x1b0c('0x34'),_0x1aec1b,_0x22bbf2,_0x1b0c('0x35')));}else{_0x46ce8a=path[_0x1b0c('0x32')](_0x14810d,util[_0x1b0c('0x1a')](_0x1b0c('0x36'),_0x1aec1b,_0x1b0c('0x35')));}_0x3f848b[_0x1b0c('0x1c')](writePDFDocument(_0x36a0f7,_0x46ce8a));}return Promise[_0x1b0c('0x37')](_0x3f848b);})[_0x1b0c('0x27')](function(){if(_0x5000a1){return new Promise(function(_0x3b93c3){zipdir(path[_0x1b0c('0x32')](_0x14810d,_0x1aec1b),{'saveTo':path[_0x1b0c('0x32')](_0x14810d,util[_0x1b0c('0x1a')](_0x1b0c('0x36'),_0x1aec1b,_0x1b0c('0x38')))},function(){rimraf(path['join'](_0x14810d,_0x1aec1b),function(){});_0x3b93c3(_0x1b0c('0x39'));});});}})[_0x1b0c('0x27')](function(){if(!_0x5000a1)return;rimraf(path['join'](_0x14810d,_0x1aec1b),function(){});})[_0x1b0c('0x27')](function(){logger[_0x1b0c('0x3a')](util[_0x1b0c('0x1a')](_0x1b0c('0x3b'),EXTRACTED_REPORT_ID,'PDF'));return analyticExtractedReport(_0x1b0c('0x3c'),_0x5000a1?util['format'](_0x1b0c('0x36'),_0x1aec1b,_0x5000a1?_0x1b0c('0x38'):_0x1b0c('0x35')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x1b0c('0x3a')](util[_0x1b0c('0x1a')](_0x1b0c('0x3d'),EXTRACTED_REPORT_ID,'PDF'));return db[_0x1b0c('0x3e')][_0x1b0c('0x3f')]({'where':{'id':EXTRACTED_REPORT_ID}})['then'](function(_0x32f776){EXTRACTED_REPORT=_0x32f776;return dbH[_0x1b0c('0x2a')]['query'](util[_0x1b0c('0x1a')](_0x1b0c('0x40'),QUERY),{'type':dbH[_0x1b0c('0x2a')][_0x1b0c('0x2c')][_0x1b0c('0x2e')]});})[_0x1b0c('0x27')](extractReport)[_0x1b0c('0x41')](function(_0x31c7e8){logger[_0x1b0c('0x3a')](util[_0x1b0c('0x1a')](_0x1b0c('0x42'),EXTRACTED_REPORT_ID,_0x1b0c('0x43')),util[_0x1b0c('0x44')](_0x31c7e8,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x1b0c('0x45'));})['finally'](function(){process[_0x1b0c('0x46')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x710e7e=new PdfPrinter({'Arial':{'normal':__dirname+_0x1b0c('0x47'),'bold':__dirname+'/fonts/arial-bold.ttf','italics':__dirname+_0x1b0c('0x48'),'bolditalics':__dirname+'/fonts/arial-bold-italic.ttf'}});return _0x710e7e;}function getPDFDocDefinitionFromHTML(_0x2917b0,_0x4b41b8){var _0x5b3c57=util['format'](_0x1b0c('0x49'),_0x4b41b8[_0x1b0c('0x4a')],_0x4b41b8[_0x1b0c('0x4b')]);var _0x1a13b4=moment()['format'](_0x1b0c('0x4c'))[_0x1b0c('0xf')]();var _0x66334b=htmlToPdfmake(_0x2917b0,{'window':window,'tableAutoSize':!![]});return{'content':[_0x66334b],'defaultStyle':{'font':_0x1b0c('0x21')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x1b0c('0x4d'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x1b0c('0x4d'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':'center'}},'header':function(){return[{'text':'Interaction\x20Transcript','style':_0x1b0c('0x1d')}];},'footer':function(_0x55f3aa,_0x4f66f4){return[{'text':util[_0x1b0c('0x1a')](_0x1b0c('0x4e'),_0x5b3c57,_0x55f3aa,_0x4f66f4,_0x1a13b4),'style':_0x1b0c('0x4f')}];}};}function writePDFDocument(_0x111911,_0x2a4f66){return new Promise(function(_0x49f3d0,_0x5637f5){var _0x245b3d=_0x111911[_0x1b0c('0x50')](fs['createWriteStream'](_0x2a4f66));_0x245b3d['on'](_0x1b0c('0x51'),function(){_0x49f3d0(_0x1b0c('0x51'));});_0x245b3d['on']('error',function(_0x29274c){_0x5637f5(_0x29274c);});_0x111911[_0x1b0c('0x52')]();});}exports['createPdfFromHTML']=function(_0x31d2ab,_0x1e158f){var _0x5b8fb2=getPDFPrinter();var _0x3e5a16=getPDFDocDefinitionFromHTML(_0x31d2ab,_0x1e158f);var _0x5040b0=_0x5b8fb2['createPdfKitDocument'](_0x3e5a16);return writePDFDocument(_0x5040b0,_0x1e158f[_0x1b0c('0x2')])[_0x1b0c('0x41')](function(_0x3c677f){throw _0x3c677f;});};
\ No newline at end of file
index f08517a..22073a6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2868=['num','length','range','isInteger','push','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','dirname','basename','.xlsx','existsSync','join','each','%s%d.%s','xlsx','%s.%s','info','Completed','zip','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','finally','exit','util','lodash','json2xls','zip-dir','../../mysqldb','dbH','../../config/logger','argv','savename','AnalyticExtractedReport','update','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','find','split','splitSizeXlsx','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t'];(function(_0x187b01,_0x5d27a6){var _0x3f0877=function(_0x575f26){while(--_0x575f26){_0x187b01['push'](_0x187b01['shift']());}};_0x3f0877(++_0x5d27a6);}(_0x2868,0x191));var _0x8286=function(_0x5a0962,_0x4aae46){_0x5a0962=_0x5a0962-0x0;var _0x115869=_0x2868[_0x5a0962];return _0x115869;};'use strict';var util=require(_0x8286('0x0'));var path=require('path');var _=require(_0x8286('0x1'));var fs=require('fs');var json2xls=require(_0x8286('0x2'));var BPromise=require('bluebird');var zipdir=require(_0x8286('0x3'));var rimraf=require('rimraf');var db=require(_0x8286('0x4'))['db'];var dbH=require('../../mysqldb')[_0x8286('0x5')];var logger=require(_0x8286('0x6'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x8286('0x7')][0x2]);var QUERY=process[_0x8286('0x7')][0x3];var PATH=process[_0x8286('0x7')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x118d0e,_0x5be220){var _0x267cf4={'status':_0x118d0e};var _0x2310b1={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x5be220){_0x267cf4[_0x8286('0x8')]=_0x5be220;}return db[_0x8286('0x9')][_0x8286('0xa')](_0x267cf4,_0x2310b1);}function main(){var _0x1a6bcb=0x1388;var _0x3f6737;logger['info'](util[_0x8286('0xb')](_0x8286('0xc'),EXTRACTED_REPORT_ID,_0x8286('0xd')));return db[_0x8286('0xe')][_0x8286('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x8286('0x10'),_0x8286('0x11')]})[_0x8286('0x12')](function(_0x276dce){if(_0x276dce){_0x3f6737=_0x276dce;_0x1a6bcb=_0x3f6737['splitSizeXlsx']||0x1388;}})[_0x8286('0x12')](function(){return dbH[_0x8286('0x13')][_0x8286('0x14')](util[_0x8286('0xb')](_0x8286('0x15'),QUERY),{'type':dbH[_0x8286('0x13')]['QueryTypes']['SELECT']});})[_0x8286('0x12')](function(_0x13f2f1){if(!_0x13f2f1[0x0][_0x8286('0x16')]){return analyticExtractedReport('Empty');}var _0x543f45=[];var _0x37980f=0x0;if(_0x3f6737[_0x8286('0x10')]){if(_0x13f2f1&&_0x13f2f1[_0x8286('0x17')]){var _0x46b682=_[_0x8286('0x18')](_0x13f2f1[0x0][_0x8286('0x16')]/_0x1a6bcb);var _0x20296a=Number[_0x8286('0x19')](_0x13f2f1[0x0][_0x8286('0x16')]/_0x1a6bcb)?_0x13f2f1[0x0][_0x8286('0x16')]%_0x1a6bcb:0x0;_0x46b682['forEach'](function(_0x15d3cc){if(_0x15d3cc>0x0){_0x37980f+=_0x1a6bcb;}_0x543f45[_0x8286('0x1a')](dbH[_0x8286('0x13')][_0x8286('0x14')](util[_0x8286('0xb')](_0x8286('0x1b'),QUERY,_0x1a6bcb,_0x37980f),{'type':dbH[_0x8286('0x13')][_0x8286('0x1c')][_0x8286('0x1d')]}));});if(_0x20296a>0x0){_0x37980f+=_0x1a6bcb;_0x543f45[_0x8286('0x1a')](dbH[_0x8286('0x13')][_0x8286('0x14')](util[_0x8286('0xb')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x20296a,_0x37980f),{'type':dbH[_0x8286('0x13')][_0x8286('0x1c')][_0x8286('0x1d')]}));}}}else{_0x543f45[_0x8286('0x1a')](dbH[_0x8286('0x13')][_0x8286('0x14')](QUERY,{'type':dbH[_0x8286('0x13')][_0x8286('0x1c')][_0x8286('0x1d')]}));}var _0x302abe=path[_0x8286('0x1e')](PATH);var _0x942f50=path[_0x8286('0x1f')](PATH,_0x8286('0x20'));var _0x52d252=_0x3f6737[_0x8286('0x10')]&&_0x543f45[_0x8286('0x17')]>0x1;var _0x1efce9=[];if(!fs[_0x8286('0x21')](path['join'](_0x302abe,_0x942f50))&&_0x52d252){fs['mkdirSync'](path[_0x8286('0x22')](_0x302abe,_0x942f50));}return BPromise[_0x8286('0x23')](_0x543f45,function(_0x15342e){_0x1efce9['push'](_0x15342e);})[_0x8286('0x12')](function(){for(var _0x4ee1d9=0x0;_0x4ee1d9<_0x1efce9[_0x8286('0x17')];_0x4ee1d9+=0x1){var _0x45b93a;var _0x1b351c=_0x1efce9[_0x4ee1d9];if(_0x52d252){_0x45b93a=path[_0x8286('0x22')](_0x302abe,_0x942f50,util['format'](_0x8286('0x24'),_0x942f50,_0x4ee1d9,_0x8286('0x25')));}else{_0x45b93a=path[_0x8286('0x22')](_0x302abe,util[_0x8286('0xb')]('%s.%s',_0x942f50,_0x8286('0x25')));}fs['writeFileSync'](_0x45b93a,json2xls(_0x1b351c),'binary');}})['then'](function(){if(_0x52d252){return new Promise(function(_0x1c4987){zipdir(path[_0x8286('0x22')](_0x302abe,_0x942f50),{'saveTo':path[_0x8286('0x22')](_0x302abe,util[_0x8286('0xb')](_0x8286('0x26'),_0x942f50,'zip'))},function(_0x192920,_0x2cdb8d){rimraf(path[_0x8286('0x22')](_0x302abe,_0x942f50),function(){});_0x1c4987('zip\x20finished');});});}})[_0x8286('0x12')](function(){logger[_0x8286('0x27')](util[_0x8286('0xb')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,'XLSX'));return analyticExtractedReport(_0x8286('0x28'),_0x52d252?util[_0x8286('0xb')](_0x8286('0x26'),_0x942f50,_0x52d252?_0x8286('0x29'):_0x8286('0x25')):null);});})[_0x8286('0x2a')](function(_0x1c669f){logger[_0x8286('0x27')](util[_0x8286('0xb')](_0x8286('0x2b'),EXTRACTED_REPORT_ID,_0x8286('0xd')),util[_0x8286('0x2c')](_0x1c669f,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0x8286('0x2d')](function(){process[_0x8286('0x2e')](EXIT_CODE);});}main();
\ No newline at end of file
+var _0x4e19=['join','mkdirSync','each','xlsx','%s.%s','writeFileSync','binary','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','exit','util','lodash','json2xls','bluebird','zip-dir','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','split','splitSizeXlsx','then','sequelize','query','QueryTypes','SELECT','num','length','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','.xlsx','existsSync'];(function(_0x5f275e,_0x101a04){var _0x3d759a=function(_0x3f9da2){while(--_0x3f9da2){_0x5f275e['push'](_0x5f275e['shift']());}};_0x3d759a(++_0x101a04);}(_0x4e19,0xc2));var _0x94e1=function(_0x15497f,_0x15ecb3){_0x15497f=_0x15497f-0x0;var _0x3dff4e=_0x4e19[_0x15497f];return _0x3dff4e;};'use strict';var util=require(_0x94e1('0x0'));var path=require('path');var _=require(_0x94e1('0x1'));var fs=require('fs');var json2xls=require(_0x94e1('0x2'));var BPromise=require(_0x94e1('0x3'));var zipdir=require(_0x94e1('0x4'));var rimraf=require('rimraf');var db=require(_0x94e1('0x5'))['db'];var dbH=require(_0x94e1('0x5'))[_0x94e1('0x6')];var logger=require(_0x94e1('0x7'))(_0x94e1('0x8'));var EXTRACTED_REPORT_ID=Number(process[_0x94e1('0x9')][0x2]);var QUERY=process[_0x94e1('0x9')][0x3];var PATH=process['argv'][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x74f07f,_0x14458d){var _0x3bf47e={'status':_0x74f07f};var _0x13796e={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x14458d){_0x3bf47e[_0x94e1('0xa')]=_0x14458d;}return db[_0x94e1('0xb')][_0x94e1('0xc')](_0x3bf47e,_0x13796e);}function main(){var _0x344af1=0x1388;var _0x3d8373;logger[_0x94e1('0xd')](util[_0x94e1('0xe')](_0x94e1('0xf'),EXTRACTED_REPORT_ID,_0x94e1('0x10')));return db['Setting']['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x94e1('0x11'),_0x94e1('0x12')]})[_0x94e1('0x13')](function(_0x11bd27){if(_0x11bd27){_0x3d8373=_0x11bd27;_0x344af1=_0x3d8373[_0x94e1('0x12')]||0x1388;}})[_0x94e1('0x13')](function(){return dbH[_0x94e1('0x14')][_0x94e1('0x15')](util['format']('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x94e1('0x14')][_0x94e1('0x16')][_0x94e1('0x17')]});})['then'](function(_0xbb4bf1){if(!_0xbb4bf1[0x0][_0x94e1('0x18')]){return analyticExtractedReport('Empty');}var _0x32bc3d=[];var _0x1192d7=0x0;if(_0x3d8373[_0x94e1('0x11')]){if(_0xbb4bf1&&_0xbb4bf1[_0x94e1('0x19')]){var _0x255f35=_['range'](_0xbb4bf1[0x0][_0x94e1('0x18')]/_0x344af1);var _0x49f144=Number['isInteger'](_0xbb4bf1[0x0][_0x94e1('0x18')]/_0x344af1)?_0xbb4bf1[0x0][_0x94e1('0x18')]%_0x344af1:0x0;_0x255f35['forEach'](function(_0x16c1e5){if(_0x16c1e5>0x0){_0x1192d7+=_0x344af1;}_0x32bc3d[_0x94e1('0x1a')](dbH[_0x94e1('0x14')][_0x94e1('0x15')](util['format'](_0x94e1('0x1b'),QUERY,_0x344af1,_0x1192d7),{'type':dbH[_0x94e1('0x14')][_0x94e1('0x16')][_0x94e1('0x17')]}));});if(_0x49f144>0x0){_0x1192d7+=_0x344af1;_0x32bc3d[_0x94e1('0x1a')](dbH[_0x94e1('0x14')][_0x94e1('0x15')](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x49f144,_0x1192d7),{'type':dbH['sequelize']['QueryTypes']['SELECT']}));}}}else{_0x32bc3d['push'](dbH[_0x94e1('0x14')][_0x94e1('0x15')](QUERY,{'type':dbH[_0x94e1('0x14')]['QueryTypes']['SELECT']}));}var _0xb2b020=path[_0x94e1('0x1c')](PATH);var _0x3b56ef=path['basename'](PATH,_0x94e1('0x1d'));var _0x4928c7=_0x3d8373[_0x94e1('0x11')]&&_0x32bc3d[_0x94e1('0x19')]>0x1;var _0x39caad=[];if(!fs[_0x94e1('0x1e')](path[_0x94e1('0x1f')](_0xb2b020,_0x3b56ef))&&_0x4928c7){fs[_0x94e1('0x20')](path[_0x94e1('0x1f')](_0xb2b020,_0x3b56ef));}return BPromise[_0x94e1('0x21')](_0x32bc3d,function(_0x54a3ff){_0x39caad[_0x94e1('0x1a')](_0x54a3ff);})['then'](function(){for(var _0x19fca3=0x0;_0x19fca3<_0x39caad[_0x94e1('0x19')];_0x19fca3+=0x1){var _0x4b051;var _0x5d48ee=_0x39caad[_0x19fca3];if(_0x4928c7){_0x4b051=path['join'](_0xb2b020,_0x3b56ef,util[_0x94e1('0xe')]('%s%d.%s',_0x3b56ef,_0x19fca3,_0x94e1('0x22')));}else{_0x4b051=path['join'](_0xb2b020,util[_0x94e1('0xe')](_0x94e1('0x23'),_0x3b56ef,_0x94e1('0x22')));}fs[_0x94e1('0x24')](_0x4b051,json2xls(_0x5d48ee),_0x94e1('0x25'));}})[_0x94e1('0x13')](function(){if(_0x4928c7){return new Promise(function(_0x405696){zipdir(path[_0x94e1('0x1f')](_0xb2b020,_0x3b56ef),{'saveTo':path['join'](_0xb2b020,util[_0x94e1('0xe')](_0x94e1('0x23'),_0x3b56ef,_0x94e1('0x26')))},function(_0x2075bf,_0x43b659){rimraf(path[_0x94e1('0x1f')](_0xb2b020,_0x3b56ef),function(){});_0x405696(_0x94e1('0x27'));});});}})['then'](function(){logger[_0x94e1('0xd')](util[_0x94e1('0xe')](_0x94e1('0x28'),EXTRACTED_REPORT_ID,_0x94e1('0x10')));return analyticExtractedReport('Completed',_0x4928c7?util[_0x94e1('0xe')](_0x94e1('0x23'),_0x3b56ef,_0x4928c7?_0x94e1('0x26'):_0x94e1('0x22')):null);});})[_0x94e1('0x29')](function(_0x4e81f4){logger[_0x94e1('0xd')](util[_0x94e1('0xe')](_0x94e1('0x2a'),EXTRACTED_REPORT_ID,_0x94e1('0x10')),util[_0x94e1('0x2b')](_0x4e81f4,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})['finally'](function(){process[_0x94e1('0x2c')](EXIT_CODE);});}main();
\ No newline at end of file
index 05b8a4e..a5fdc47 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x37df=['VoiceExtension','IntervalId','uniq','filter','exten','playback','hasOwnProperty','priority','extensions','extension','find','push','Set','context','VoiceExtensionId','type','inbound','outbound','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','CDR(prefix)=${EXTEN:0:','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','toLowerCase','createdAt','interval','map','tag','CDR(tag)=','callerID','answer','indexOf','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','concat','bulkCreate','sortBy','catch','error','rewrite','lodash','Interval','findAll','then','intervals','models'];(function(_0x392e4d,_0x147817){var _0x22ca3c=function(_0x3a3578){while(--_0x3a3578){_0x392e4d['push'](_0x392e4d['shift']());}};_0x22ca3c(++_0x147817);}(_0x37df,0x1da));var _0xf37d=function(_0x514260,_0x1891e1){_0x514260=_0x514260-0x0;var _0x4ac81b=_0x37df[_0x514260];return _0x4ac81b;};'use strict';var _=require(_0xf37d('0x0'));var util=require('util');function rewrite(_0x4a23f7,_0x2b92bd){var _0x3c6536=this;return _0x4a23f7['models'][_0xf37d('0x1')][_0xf37d('0x2')]({'raw':!![]})[_0xf37d('0x3')](function(_0x324f18){_0x3c6536[_0xf37d('0x4')]=_0x324f18;return _0x4a23f7[_0xf37d('0x5')][_0xf37d('0x6')][_0xf37d('0x2')]({'where':{'IntervalId':_0x2b92bd[_0xf37d('0x7')]},'raw':!![]});})['then'](function(_0x23b391){return _0x4a23f7[_0xf37d('0x5')][_0xf37d('0x6')][_0xf37d('0x2')]({'where':{'exten':{'$in':_[_0xf37d('0x8')](_['map'](_0x23b391,'exten'))}},'order':[{'raw':'CAST(priority\x20AS\x20UNSIGNED)'}],'raw':!![]});})['then'](function(_0x249da3){var _0x5f08b3=_[_0xf37d('0x9')](_0x249da3,{'priority':'1'});var _0x596c49=_[_0xf37d('0x9')](_0x249da3,{'isApp':0x1});var _0xc448aa=_['groupBy'](_0x596c49,_0xf37d('0xa'));var _0x4cffca=['queue',_0xf37d('0xb')];var _0x5ec24b=[];var _0x464687=[];for(var _0x5e12e0 in _0xc448aa){if(_0xc448aa[_0xf37d('0xc')](_0x5e12e0)){_0x3c6536[_0xf37d('0xd')]=0x2;_0x3c6536[_0xf37d('0xe')]=[];_0x3c6536[_0xf37d('0xf')]=_[_0xf37d('0x10')](_0x5f08b3,{'exten':_0xc448aa[_0x5e12e0][0x0][_0xf37d('0xa')]});_0x3c6536[_0xf37d('0xe')][_0xf37d('0x11')]({'type':_0xc448aa[_0x5e12e0][0x0]['type'],'app':_0xf37d('0x12'),'appdata':util['format']('CDR(type)=%s',_0xc448aa[_0x5e12e0][0x0]['type']),'context':_0xc448aa[_0x5e12e0][0x0][_0xf37d('0x13')],'exten':_0xc448aa[_0x5e12e0][0x0][_0xf37d('0xa')],'priority':_0x3c6536[_0xf37d('0xd')]++,'VoiceExtensionId':_0xc448aa[_0x5e12e0][0x0][_0xf37d('0x14')]});if(_0xc448aa[_0x5e12e0][0x0][_0xf37d('0x15')]===_0xf37d('0x16')){_0x3c6536['extensions'][_0xf37d('0x11')]({'type':_0xc448aa[_0x5e12e0][0x0][_0xf37d('0x15')],'app':_0xf37d('0x12'),'appdata':'CDR(routeid)='+_0xc448aa[_0x5e12e0][0x0]['VoiceExtensionId'],'context':_0xc448aa[_0x5e12e0][0x0][_0xf37d('0x13')],'exten':_0xc448aa[_0x5e12e0][0x0][_0xf37d('0xa')],'priority':_0x3c6536[_0xf37d('0xd')]++,'VoiceExtensionId':_0xc448aa[_0x5e12e0][0x0][_0xf37d('0x14')]});}else if(_0xc448aa[_0x5e12e0][0x0][_0xf37d('0x15')]===_0xf37d('0x17')){if(_0x3c6536['extension']){_0x3c6536[_0xf37d('0xe')]['push']({'type':_0xc448aa[_0x5e12e0][0x0][_0xf37d('0x15')],'app':'Set','appdata':_0xf37d('0x18')+(_0x3c6536['extension'][_0xf37d('0x19')]?_0xf37d('0x1a')+_0x3c6536[_0xf37d('0xf')]['cutdigits']+'}':_0xf37d('0x1b')),'context':_0xc448aa[_0x5e12e0][0x0][_0xf37d('0x13')],'exten':_0xc448aa[_0x5e12e0][0x0]['exten'],'priority':_0x3c6536[_0xf37d('0xd')]++,'VoiceExtensionId':_0xc448aa[_0x5e12e0][0x0][_0xf37d('0x14')]});}_0x3c6536[_0xf37d('0xe')][_0xf37d('0x11')]({'type':_0xc448aa[_0x5e12e0][0x0][_0xf37d('0x15')],'app':_0xf37d('0x12'),'appdata':'CDR(routeid)='+_0xc448aa[_0x5e12e0][0x0][_0xf37d('0x14')],'context':_0xc448aa[_0x5e12e0][0x0][_0xf37d('0x13')],'exten':_0xc448aa[_0x5e12e0][0x0][_0xf37d('0xa')],'priority':_0x3c6536[_0xf37d('0xd')]++,'VoiceExtensionId':_0xc448aa[_0x5e12e0][0x0][_0xf37d('0x14')]});var _0x549cf2=_0x3c6536['priority']++;_0x3c6536[_0xf37d('0xe')][_0xf37d('0x11')]({'type':_0xc448aa[_0x5e12e0][0x0]['type'],'app':_0xf37d('0x1c'),'appdata':_0xf37d('0x1d')+(_0x549cf2+0x2)+'):Goto('+(_0x549cf2+0x1)+')','context':_0xc448aa[_0x5e12e0][0x0][_0xf37d('0x13')],'exten':_0xc448aa[_0x5e12e0][0x0][_0xf37d('0xa')],'priority':_0x549cf2,'VoiceExtensionId':_0xc448aa[_0x5e12e0][0x0][_0xf37d('0x14')]});if(_0x3c6536['extension']){_0x3c6536[_0xf37d('0xe')][_0xf37d('0x11')]({'type':_0xc448aa[_0x5e12e0][0x0][_0xf37d('0x15')],'app':_0xf37d('0x12'),'appdata':_0x3c6536[_0xf37d('0xf')][_0xf37d('0x19')]?_0xf37d('0x1e')+_0x3c6536['extension']['cutdigits']+'}':'CDR(prefix)=noprefix','context':_0xc448aa[_0x5e12e0][0x0]['context'],'exten':_0xc448aa[_0x5e12e0][0x0][_0xf37d('0xa')],'priority':_0x3c6536[_0xf37d('0xd')]++,'VoiceExtensionId':_0xc448aa[_0x5e12e0][0x0][_0xf37d('0x14')]});}_0x3c6536['extensions'][_0xf37d('0x11')]({'type':_0xc448aa[_0x5e12e0][0x0]['type'],'app':'Set','appdata':'outboundrouteid='+_0xc448aa[_0x5e12e0][0x0][_0xf37d('0x14')],'context':_0xc448aa[_0x5e12e0][0x0][_0xf37d('0x13')],'exten':_0xc448aa[_0x5e12e0][0x0]['exten'],'priority':_0x3c6536[_0xf37d('0xd')]++,'VoiceExtensionId':_0xc448aa[_0x5e12e0][0x0][_0xf37d('0x14')]});if(_0x3c6536[_0xf37d('0xf')]&&_0x3c6536['extension'][_0xf37d('0xc')](_0xf37d('0x1f'))&&_0x3c6536[_0xf37d('0xf')][_0xf37d('0x1f')]!==_0xf37d('0x20')){_0x3c6536[_0xf37d('0xe')][_0xf37d('0x11')]({'type':_0xc448aa[_0x5e12e0][0x0][_0xf37d('0x15')],'app':_0xf37d('0x12'),'appdata':_0xf37d('0x21'),'context':_0xc448aa[_0x5e12e0][0x0][_0xf37d('0x13')],'exten':_0xc448aa[_0x5e12e0][0x0]['exten'],'priority':_0x3c6536[_0xf37d('0xd')]++,'VoiceExtensionId':_0xc448aa[_0x5e12e0][0x0][_0xf37d('0x14')]});_0x3c6536[_0xf37d('0xe')][_0xf37d('0x11')]({'type':_0xc448aa[_0x5e12e0][0x0][_0xf37d('0x15')],'app':'Set','appdata':_0xf37d('0x22')+_0x3c6536[_0xf37d('0xf')][_0xf37d('0x1f')]||_0xf37d('0x23'),'context':_0xc448aa[_0x5e12e0][0x0]['context'],'exten':_0xc448aa[_0x5e12e0][0x0][_0xf37d('0xa')],'priority':_0x3c6536[_0xf37d('0xd')]++,'VoiceExtensionId':_0xc448aa[_0x5e12e0][0x0]['VoiceExtensionId']});}}_0x3c6536['extensions'][_0xf37d('0x11')]({'type':_0xc448aa[_0x5e12e0][0x0][_0xf37d('0x15')],'app':'Set','appdata':'XCALLY-MOTION-ANSWER=0','context':_0xc448aa[_0x5e12e0][0x0][_0xf37d('0x13')],'exten':_0xc448aa[_0x5e12e0][0x0][_0xf37d('0xa')],'priority':_0x3c6536['priority']++,'VoiceExtensionId':_0xc448aa[_0x5e12e0][0x0][_0xf37d('0x14')]});_0x3c6536[_0xf37d('0xe')][_0xf37d('0x11')]({'type':_0xc448aa[_0x5e12e0][0x0][_0xf37d('0x15')],'app':_0xf37d('0x12'),'appdata':_0xf37d('0x24'),'context':_0xc448aa[_0x5e12e0][0x0][_0xf37d('0x13')],'exten':_0xc448aa[_0x5e12e0][0x0][_0xf37d('0xa')],'priority':_0x3c6536[_0xf37d('0xd')]++,'VoiceExtensionId':_0xc448aa[_0x5e12e0][0x0]['VoiceExtensionId']});_0x3c6536['extensions'][_0xf37d('0x11')]({'type':_0xc448aa[_0x5e12e0][0x0][_0xf37d('0x15')],'app':_0xf37d('0x12'),'appdata':_0xf37d('0x25'),'context':_0xc448aa[_0x5e12e0][0x0][_0xf37d('0x13')],'exten':_0xc448aa[_0x5e12e0][0x0][_0xf37d('0xa')],'priority':_0x3c6536[_0xf37d('0xd')]++,'VoiceExtensionId':_0xc448aa[_0x5e12e0][0x0]['VoiceExtensionId']});for(var _0x5eb301=0x0,_0x49881e=0x0;_0x5eb301<_0xc448aa[_0x5e12e0][_0xf37d('0x26')];_0x5eb301+=0x1,_0x49881e=0x0){var _0x1adad2=_0xc448aa[_0x5e12e0][_0x5eb301];if(_0x1adad2['type']){_0x1adad2['type']=_0x1adad2[_0xf37d('0x15')][_0xf37d('0x27')]();}var _0x5e5e5a=[];var _0x29d289=[];delete _0x1adad2['id'];delete _0x1adad2[_0xf37d('0x28')];delete _0x1adad2['updatedAt'];var _0x502801=_0x1adad2[_0xf37d('0x29')]!=='*,*,*,*'?[_0x1adad2[_0xf37d('0x29')]]:_0x1adad2[_0xf37d('0x7')]?_[_0xf37d('0x2a')](_[_0xf37d('0x9')](_0x3c6536[_0xf37d('0x4')],{'IntervalId':_0x1adad2[_0xf37d('0x7')]}),_0xf37d('0x29')):[];if(_0x1adad2[_0xf37d('0xc')](_0xf37d('0x2b'))){if(_0x1adad2[_0xf37d('0x2b')]&&_0x1adad2[_0xf37d('0x2b')]!=='--'){_0x5e5e5a['push']({'type':_0x1adad2['type'],'app':_0xf37d('0x12'),'appdata':_0xf37d('0x2c')+_0x1adad2['tag'],'context':_0x1adad2[_0xf37d('0x13')],'exten':_0x1adad2[_0xf37d('0xa')],'priority':_0x502801['length']+_0x3c6536[_0xf37d('0xd')]+_0x49881e++,'VoiceExtensionId':_0x1adad2[_0xf37d('0x14')]});}}if(_0x1adad2['type']===_0xf37d('0x17')&&_0x1adad2[_0xf37d('0xc')]('callerID')){if(_0x1adad2[_0xf37d('0x2d')]){_0x5e5e5a[_0xf37d('0x11')]({'type':_0x1adad2[_0xf37d('0x15')],'app':_0xf37d('0x1c'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)='+_0x1adad2[_0xf37d('0x2d')]+')','context':_0x1adad2[_0xf37d('0x13')],'exten':_0x1adad2[_0xf37d('0xa')],'priority':_0x502801['length']+_0x3c6536[_0xf37d('0xd')]+_0x49881e++,'VoiceExtensionId':_0x1adad2[_0xf37d('0x14')]});}else{_0x5e5e5a[_0xf37d('0x11')]({'type':_0x1adad2[_0xf37d('0x15')],'app':'ExecIf','appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','context':_0x1adad2['context'],'exten':_0x1adad2[_0xf37d('0xa')],'priority':_0x502801[_0xf37d('0x26')]+_0x3c6536[_0xf37d('0xd')]+_0x49881e++,'VoiceExtensionId':_0x1adad2[_0xf37d('0x14')]});}}if(_0x1adad2[_0xf37d('0xc')](_0xf37d('0x2e'))){if(_0x4cffca[_0xf37d('0x2f')](_0x1adad2['app']['toLowerCase']())>=0x0&&_0x1adad2['appType']!=='custom'){if(_0x1adad2[_0xf37d('0x2e')]){_0x5e5e5a[_0xf37d('0x11')]({'type':_0x1adad2[_0xf37d('0x15')],'app':_0xf37d('0x1c'),'appdata':_0xf37d('0x30'),'context':_0x1adad2['context'],'exten':_0x1adad2[_0xf37d('0xa')],'priority':_0x502801[_0xf37d('0x26')]+_0x3c6536['priority']+_0x49881e++,'VoiceExtensionId':_0x1adad2[_0xf37d('0x14')]});_0x5e5e5a[_0xf37d('0x11')]({'type':_0x1adad2[_0xf37d('0x15')],'app':_0xf37d('0x12'),'appdata':_0xf37d('0x31'),'context':_0x1adad2['context'],'exten':_0x1adad2[_0xf37d('0xa')],'priority':_0x502801[_0xf37d('0x26')]+_0x3c6536[_0xf37d('0xd')]+_0x49881e++,'VoiceExtensionId':_0x1adad2[_0xf37d('0x14')]});}else{_0x5e5e5a[_0xf37d('0x11')]({'type':_0x1adad2[_0xf37d('0x15')],'app':'ExecIf','appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x1adad2[_0xf37d('0x13')],'exten':_0x1adad2[_0xf37d('0xa')],'priority':_0x502801[_0xf37d('0x26')]+_0x3c6536[_0xf37d('0xd')]+_0x49881e++,'VoiceExtensionId':_0x1adad2[_0xf37d('0x14')]});_0x5e5e5a[_0xf37d('0x11')]({'type':_0x1adad2[_0xf37d('0x15')],'app':_0xf37d('0x12'),'appdata':_0xf37d('0x32'),'context':_0x1adad2[_0xf37d('0x13')],'exten':_0x1adad2[_0xf37d('0xa')],'priority':_0x502801[_0xf37d('0x26')]+_0x3c6536['priority']+_0x49881e++,'VoiceExtensionId':_0x1adad2[_0xf37d('0x14')]});}}}for(var _0x291091=0x0;_0x291091<_0x502801[_0xf37d('0x26')];_0x291091+=0x1){var _0x54561c=_0x3c6536[_0xf37d('0xd')]+_0x502801[_0xf37d('0x26')];var _0x623744=_0x291091===_0x502801['length']-0x1?_0x3c6536[_0xf37d('0xd')]+_0x5e5e5a[_0xf37d('0x26')]+_0x29d289[_0xf37d('0x26')]+0x2:_0x3c6536[_0xf37d('0xd')]+_0x291091+0x1;_0x5e5e5a[_0xf37d('0x33')](_0x291091,0x0,{'type':_0x1adad2[_0xf37d('0x15')],'app':_0xf37d('0x34'),'appdata':_0x502801[_0x291091]+'?'+_0x1adad2[_0xf37d('0x13')]+_0xf37d('0x35')+_0x54561c+':'+_0x1adad2[_0xf37d('0x13')]+_0xf37d('0x35')+_0x623744,'exten':_0x1adad2[_0xf37d('0xa')],'context':_0x1adad2[_0xf37d('0x13')],'priority':_0x3c6536[_0xf37d('0xd')]+_0x291091,'VoiceExtensionId':_0xc448aa[_0x5e12e0][0x0][_0xf37d('0x14')]});}_0x1adad2[_0xf37d('0xd')]=_0x5e5e5a[_0xf37d('0x26')]?_['last'](_0x5e5e5a)[_0xf37d('0xd')]+0x1:_0x3c6536['priority'];_0x3c6536[_0xf37d('0xd')]=(_0x29d289['length']?_['last'](_0x29d289)['priority']:_0x1adad2['priority'])+0x1;_0x3c6536[_0xf37d('0xe')]=_[_0xf37d('0x36')](_0x3c6536['extensions'],_0x5e5e5a,[_0x1adad2],_0x29d289);}_0x3c6536[_0xf37d('0xe')]['push']({'type':_0xc448aa[_0x5e12e0][0x0][_0xf37d('0x15')],'app':'Hangup','exten':_0xc448aa[_0x5e12e0][0x0]['exten'],'context':_0xc448aa[_0x5e12e0][0x0][_0xf37d('0x13')],'priority':_0x3c6536[_0xf37d('0xd')],'VoiceExtensionId':_0xc448aa[_0x5e12e0][0x0][_0xf37d('0x14')]});_0x5ec24b[_0xf37d('0x11')](_0xc448aa[_0x5e12e0][0x0][_0xf37d('0x14')]);_0x464687=_[_0xf37d('0x36')](_0x464687,_0x3c6536[_0xf37d('0xe')]);}}return _0x4a23f7['transaction'](function(_0x263d43){return _0x4a23f7['models'][_0xf37d('0x6')]['destroy']({'where':{'VoiceExtensionId':{'$in':_0x5ec24b}},'transaction':_0x263d43})['then'](function(_0xdb10c9){return _0x4a23f7[_0xf37d('0x5')]['VoiceExtension'][_0xf37d('0x37')](_[_0xf37d('0x38')](_0x464687,_0xf37d('0xd')),{'transaction':_0x263d43});});});})[_0xf37d('0x39')](function(_0x27b9fb){console[_0xf37d('0x3a')](_0x27b9fb);});}exports[_0xf37d('0x3b')]=rewrite;
\ No newline at end of file
+var _0x1bb4=['map','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','exten','playback','hasOwnProperty','extensions','find','push','type','format','CDR(type)=%s','context','priority','VoiceExtensionId','inbound','Set','CDR(routeid)=','extension','CDR(destination)=','${EXTEN:','cutdigits','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-PROGRESS=0','length','toLowerCase','createdAt','updatedAt','interval','*,*,*,*','intervals','tag','outbound','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','answer','indexOf','app','appType','custom','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','Hangup','concat','transaction','then','sortBy','catch','rewrite','lodash','util','models','Interval','findAll','VoiceExtension','IntervalId'];(function(_0x3382e1,_0x1b69ee){var _0x166bd5=function(_0x548a6d){while(--_0x548a6d){_0x3382e1['push'](_0x3382e1['shift']());}};_0x166bd5(++_0x1b69ee);}(_0x1bb4,0x11d));var _0x41bb=function(_0x121228,_0x29c3a6){_0x121228=_0x121228-0x0;var _0x47a49a=_0x1bb4[_0x121228];return _0x47a49a;};'use strict';var _=require(_0x41bb('0x0'));var util=require(_0x41bb('0x1'));function rewrite(_0x3db127,_0x3fa52f){var _0x1bb934=this;return _0x3db127[_0x41bb('0x2')][_0x41bb('0x3')][_0x41bb('0x4')]({'raw':!![]})['then'](function(_0x205a2d){_0x1bb934['intervals']=_0x205a2d;return _0x3db127[_0x41bb('0x2')][_0x41bb('0x5')][_0x41bb('0x4')]({'where':{'IntervalId':_0x3fa52f[_0x41bb('0x6')]},'raw':!![]});})['then'](function(_0x185dc4){return _0x3db127[_0x41bb('0x2')][_0x41bb('0x5')][_0x41bb('0x4')]({'where':{'exten':{'$in':_['uniq'](_[_0x41bb('0x7')](_0x185dc4,'exten'))}},'order':[{'raw':_0x41bb('0x8')}],'raw':!![]});})['then'](function(_0xd0c89c){var _0x291392=_[_0x41bb('0x9')](_0xd0c89c,{'priority':'1'});var _0x1bdedb=_[_0x41bb('0x9')](_0xd0c89c,{'isApp':0x1});var _0x3e2ab4=_[_0x41bb('0xa')](_0x1bdedb,_0x41bb('0xb'));var _0x10d894=['queue',_0x41bb('0xc')];var _0x4cebf8=[];var _0x120168=[];for(var _0x3526d0 in _0x3e2ab4){if(_0x3e2ab4[_0x41bb('0xd')](_0x3526d0)){_0x1bb934['priority']=0x2;_0x1bb934[_0x41bb('0xe')]=[];_0x1bb934['extension']=_[_0x41bb('0xf')](_0x291392,{'exten':_0x3e2ab4[_0x3526d0][0x0][_0x41bb('0xb')]});_0x1bb934['extensions'][_0x41bb('0x10')]({'type':_0x3e2ab4[_0x3526d0][0x0][_0x41bb('0x11')],'app':'Set','appdata':util[_0x41bb('0x12')](_0x41bb('0x13'),_0x3e2ab4[_0x3526d0][0x0]['type']),'context':_0x3e2ab4[_0x3526d0][0x0][_0x41bb('0x14')],'exten':_0x3e2ab4[_0x3526d0][0x0][_0x41bb('0xb')],'priority':_0x1bb934[_0x41bb('0x15')]++,'VoiceExtensionId':_0x3e2ab4[_0x3526d0][0x0][_0x41bb('0x16')]});if(_0x3e2ab4[_0x3526d0][0x0][_0x41bb('0x11')]===_0x41bb('0x17')){_0x1bb934[_0x41bb('0xe')]['push']({'type':_0x3e2ab4[_0x3526d0][0x0][_0x41bb('0x11')],'app':_0x41bb('0x18'),'appdata':_0x41bb('0x19')+_0x3e2ab4[_0x3526d0][0x0]['VoiceExtensionId'],'context':_0x3e2ab4[_0x3526d0][0x0][_0x41bb('0x14')],'exten':_0x3e2ab4[_0x3526d0][0x0][_0x41bb('0xb')],'priority':_0x1bb934[_0x41bb('0x15')]++,'VoiceExtensionId':_0x3e2ab4[_0x3526d0][0x0][_0x41bb('0x16')]});}else if(_0x3e2ab4[_0x3526d0][0x0]['type']==='outbound'){if(_0x1bb934[_0x41bb('0x1a')]){_0x1bb934[_0x41bb('0xe')][_0x41bb('0x10')]({'type':_0x3e2ab4[_0x3526d0][0x0][_0x41bb('0x11')],'app':_0x41bb('0x18'),'appdata':_0x41bb('0x1b')+(_0x1bb934[_0x41bb('0x1a')]['cutdigits']?_0x41bb('0x1c')+_0x1bb934['extension'][_0x41bb('0x1d')]+'}':_0x41bb('0x1e')),'context':_0x3e2ab4[_0x3526d0][0x0][_0x41bb('0x14')],'exten':_0x3e2ab4[_0x3526d0][0x0][_0x41bb('0xb')],'priority':_0x1bb934[_0x41bb('0x15')]++,'VoiceExtensionId':_0x3e2ab4[_0x3526d0][0x0][_0x41bb('0x16')]});}_0x1bb934['extensions']['push']({'type':_0x3e2ab4[_0x3526d0][0x0][_0x41bb('0x11')],'app':_0x41bb('0x18'),'appdata':_0x41bb('0x19')+_0x3e2ab4[_0x3526d0][0x0][_0x41bb('0x16')],'context':_0x3e2ab4[_0x3526d0][0x0][_0x41bb('0x14')],'exten':_0x3e2ab4[_0x3526d0][0x0]['exten'],'priority':_0x1bb934['priority']++,'VoiceExtensionId':_0x3e2ab4[_0x3526d0][0x0][_0x41bb('0x16')]});var _0x59a0fb=_0x1bb934[_0x41bb('0x15')]++;_0x1bb934[_0x41bb('0xe')][_0x41bb('0x10')]({'type':_0x3e2ab4[_0x3526d0][0x0][_0x41bb('0x11')],'app':_0x41bb('0x1f'),'appdata':_0x41bb('0x20')+(_0x59a0fb+0x2)+_0x41bb('0x21')+(_0x59a0fb+0x1)+')','context':_0x3e2ab4[_0x3526d0][0x0][_0x41bb('0x14')],'exten':_0x3e2ab4[_0x3526d0][0x0]['exten'],'priority':_0x59a0fb,'VoiceExtensionId':_0x3e2ab4[_0x3526d0][0x0][_0x41bb('0x16')]});if(_0x1bb934[_0x41bb('0x1a')]){_0x1bb934[_0x41bb('0xe')][_0x41bb('0x10')]({'type':_0x3e2ab4[_0x3526d0][0x0]['type'],'app':_0x41bb('0x18'),'appdata':_0x1bb934[_0x41bb('0x1a')]['cutdigits']?_0x41bb('0x22')+_0x1bb934[_0x41bb('0x1a')]['cutdigits']+'}':_0x41bb('0x23'),'context':_0x3e2ab4[_0x3526d0][0x0][_0x41bb('0x14')],'exten':_0x3e2ab4[_0x3526d0][0x0][_0x41bb('0xb')],'priority':_0x1bb934[_0x41bb('0x15')]++,'VoiceExtensionId':_0x3e2ab4[_0x3526d0][0x0]['VoiceExtensionId']});}_0x1bb934[_0x41bb('0xe')][_0x41bb('0x10')]({'type':_0x3e2ab4[_0x3526d0][0x0][_0x41bb('0x11')],'app':_0x41bb('0x18'),'appdata':_0x41bb('0x24')+_0x3e2ab4[_0x3526d0][0x0][_0x41bb('0x16')],'context':_0x3e2ab4[_0x3526d0][0x0][_0x41bb('0x14')],'exten':_0x3e2ab4[_0x3526d0][0x0][_0x41bb('0xb')],'priority':_0x1bb934[_0x41bb('0x15')]++,'VoiceExtensionId':_0x3e2ab4[_0x3526d0][0x0][_0x41bb('0x16')]});if(_0x1bb934['extension']&&_0x1bb934[_0x41bb('0x1a')][_0x41bb('0xd')](_0x41bb('0x25'))&&_0x1bb934[_0x41bb('0x1a')][_0x41bb('0x25')]!==_0x41bb('0x26')){_0x1bb934[_0x41bb('0xe')]['push']({'type':_0x3e2ab4[_0x3526d0][0x0][_0x41bb('0x11')],'app':_0x41bb('0x18'),'appdata':_0x41bb('0x27'),'context':_0x3e2ab4[_0x3526d0][0x0][_0x41bb('0x14')],'exten':_0x3e2ab4[_0x3526d0][0x0]['exten'],'priority':_0x1bb934['priority']++,'VoiceExtensionId':_0x3e2ab4[_0x3526d0][0x0][_0x41bb('0x16')]});_0x1bb934[_0x41bb('0xe')][_0x41bb('0x10')]({'type':_0x3e2ab4[_0x3526d0][0x0]['type'],'app':_0x41bb('0x18'),'appdata':_0x41bb('0x28')+_0x1bb934[_0x41bb('0x1a')][_0x41bb('0x25')]||_0x41bb('0x29'),'context':_0x3e2ab4[_0x3526d0][0x0]['context'],'exten':_0x3e2ab4[_0x3526d0][0x0][_0x41bb('0xb')],'priority':_0x1bb934[_0x41bb('0x15')]++,'VoiceExtensionId':_0x3e2ab4[_0x3526d0][0x0][_0x41bb('0x16')]});}}_0x1bb934['extensions'][_0x41bb('0x10')]({'type':_0x3e2ab4[_0x3526d0][0x0][_0x41bb('0x11')],'app':'Set','appdata':'XCALLY-MOTION-ANSWER=0','context':_0x3e2ab4[_0x3526d0][0x0]['context'],'exten':_0x3e2ab4[_0x3526d0][0x0]['exten'],'priority':_0x1bb934[_0x41bb('0x15')]++,'VoiceExtensionId':_0x3e2ab4[_0x3526d0][0x0][_0x41bb('0x16')]});_0x1bb934[_0x41bb('0xe')]['push']({'type':_0x3e2ab4[_0x3526d0][0x0][_0x41bb('0x11')],'app':_0x41bb('0x18'),'appdata':_0x41bb('0x2a'),'context':_0x3e2ab4[_0x3526d0][0x0]['context'],'exten':_0x3e2ab4[_0x3526d0][0x0]['exten'],'priority':_0x1bb934[_0x41bb('0x15')]++,'VoiceExtensionId':_0x3e2ab4[_0x3526d0][0x0][_0x41bb('0x16')]});_0x1bb934[_0x41bb('0xe')][_0x41bb('0x10')]({'type':_0x3e2ab4[_0x3526d0][0x0]['type'],'app':_0x41bb('0x18'),'appdata':'MONITOR_OPTIONS=ab','context':_0x3e2ab4[_0x3526d0][0x0][_0x41bb('0x14')],'exten':_0x3e2ab4[_0x3526d0][0x0][_0x41bb('0xb')],'priority':_0x1bb934[_0x41bb('0x15')]++,'VoiceExtensionId':_0x3e2ab4[_0x3526d0][0x0]['VoiceExtensionId']});for(var _0x2410fa=0x0,_0x34bb0d=0x0;_0x2410fa<_0x3e2ab4[_0x3526d0][_0x41bb('0x2b')];_0x2410fa+=0x1,_0x34bb0d=0x0){var _0x8e200d=_0x3e2ab4[_0x3526d0][_0x2410fa];if(_0x8e200d[_0x41bb('0x11')]){_0x8e200d['type']=_0x8e200d[_0x41bb('0x11')][_0x41bb('0x2c')]();}var _0x50e6c9=[];var _0x18aeeb=[];delete _0x8e200d['id'];delete _0x8e200d[_0x41bb('0x2d')];delete _0x8e200d[_0x41bb('0x2e')];var _0x4e1a73=_0x8e200d[_0x41bb('0x2f')]!==_0x41bb('0x30')?[_0x8e200d[_0x41bb('0x2f')]]:_0x8e200d[_0x41bb('0x6')]?_[_0x41bb('0x7')](_[_0x41bb('0x9')](_0x1bb934[_0x41bb('0x31')],{'IntervalId':_0x8e200d[_0x41bb('0x6')]}),'interval'):[];if(_0x8e200d['hasOwnProperty'](_0x41bb('0x32'))){if(_0x8e200d['tag']&&_0x8e200d[_0x41bb('0x32')]!=='--'){_0x50e6c9[_0x41bb('0x10')]({'type':_0x8e200d[_0x41bb('0x11')],'app':_0x41bb('0x18'),'appdata':'CDR(tag)='+_0x8e200d[_0x41bb('0x32')],'context':_0x8e200d[_0x41bb('0x14')],'exten':_0x8e200d[_0x41bb('0xb')],'priority':_0x4e1a73[_0x41bb('0x2b')]+_0x1bb934[_0x41bb('0x15')]+_0x34bb0d++,'VoiceExtensionId':_0x8e200d[_0x41bb('0x16')]});}}if(_0x8e200d[_0x41bb('0x11')]===_0x41bb('0x33')&&_0x8e200d['hasOwnProperty'](_0x41bb('0x34'))){if(_0x8e200d[_0x41bb('0x34')]){_0x50e6c9[_0x41bb('0x10')]({'type':_0x8e200d[_0x41bb('0x11')],'app':_0x41bb('0x1f'),'appdata':_0x41bb('0x35')+_0x8e200d['callerID']+')','context':_0x8e200d[_0x41bb('0x14')],'exten':_0x8e200d['exten'],'priority':_0x4e1a73[_0x41bb('0x2b')]+_0x1bb934[_0x41bb('0x15')]+_0x34bb0d++,'VoiceExtensionId':_0x8e200d[_0x41bb('0x16')]});}else{_0x50e6c9['push']({'type':_0x8e200d[_0x41bb('0x11')],'app':_0x41bb('0x1f'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','context':_0x8e200d[_0x41bb('0x14')],'exten':_0x8e200d[_0x41bb('0xb')],'priority':_0x4e1a73[_0x41bb('0x2b')]+_0x1bb934[_0x41bb('0x15')]+_0x34bb0d++,'VoiceExtensionId':_0x8e200d[_0x41bb('0x16')]});}}if(_0x8e200d[_0x41bb('0xd')](_0x41bb('0x36'))){if(_0x10d894[_0x41bb('0x37')](_0x8e200d[_0x41bb('0x38')][_0x41bb('0x2c')]())>=0x0&&_0x8e200d[_0x41bb('0x39')]!==_0x41bb('0x3a')){if(_0x8e200d[_0x41bb('0x36')]){_0x50e6c9[_0x41bb('0x10')]({'type':_0x8e200d['type'],'app':_0x41bb('0x1f'),'appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x8e200d[_0x41bb('0x14')],'exten':_0x8e200d[_0x41bb('0xb')],'priority':_0x4e1a73[_0x41bb('0x2b')]+_0x1bb934['priority']+_0x34bb0d++,'VoiceExtensionId':_0x8e200d[_0x41bb('0x16')]});_0x50e6c9[_0x41bb('0x10')]({'type':_0x8e200d[_0x41bb('0x11')],'app':_0x41bb('0x18'),'appdata':_0x41bb('0x3b'),'context':_0x8e200d[_0x41bb('0x14')],'exten':_0x8e200d[_0x41bb('0xb')],'priority':_0x4e1a73[_0x41bb('0x2b')]+_0x1bb934[_0x41bb('0x15')]+_0x34bb0d++,'VoiceExtensionId':_0x8e200d[_0x41bb('0x16')]});}else{_0x50e6c9[_0x41bb('0x10')]({'type':_0x8e200d[_0x41bb('0x11')],'app':_0x41bb('0x1f'),'appdata':_0x41bb('0x3c'),'context':_0x8e200d['context'],'exten':_0x8e200d[_0x41bb('0xb')],'priority':_0x4e1a73[_0x41bb('0x2b')]+_0x1bb934[_0x41bb('0x15')]+_0x34bb0d++,'VoiceExtensionId':_0x8e200d['VoiceExtensionId']});_0x50e6c9['push']({'type':_0x8e200d['type'],'app':_0x41bb('0x18'),'appdata':_0x41bb('0x3d'),'context':_0x8e200d[_0x41bb('0x14')],'exten':_0x8e200d[_0x41bb('0xb')],'priority':_0x4e1a73[_0x41bb('0x2b')]+_0x1bb934[_0x41bb('0x15')]+_0x34bb0d++,'VoiceExtensionId':_0x8e200d['VoiceExtensionId']});}}}for(var _0x3a570a=0x0;_0x3a570a<_0x4e1a73[_0x41bb('0x2b')];_0x3a570a+=0x1){var _0x5ad0e9=_0x1bb934[_0x41bb('0x15')]+_0x4e1a73[_0x41bb('0x2b')];var _0x4bcee6=_0x3a570a===_0x4e1a73[_0x41bb('0x2b')]-0x1?_0x1bb934['priority']+_0x50e6c9['length']+_0x18aeeb[_0x41bb('0x2b')]+0x2:_0x1bb934[_0x41bb('0x15')]+_0x3a570a+0x1;_0x50e6c9[_0x41bb('0x3e')](_0x3a570a,0x0,{'type':_0x8e200d[_0x41bb('0x11')],'app':_0x41bb('0x3f'),'appdata':_0x4e1a73[_0x3a570a]+'?'+_0x8e200d[_0x41bb('0x14')]+_0x41bb('0x40')+_0x5ad0e9+':'+_0x8e200d[_0x41bb('0x14')]+_0x41bb('0x40')+_0x4bcee6,'exten':_0x8e200d['exten'],'context':_0x8e200d[_0x41bb('0x14')],'priority':_0x1bb934['priority']+_0x3a570a,'VoiceExtensionId':_0x3e2ab4[_0x3526d0][0x0]['VoiceExtensionId']});}_0x8e200d[_0x41bb('0x15')]=_0x50e6c9['length']?_['last'](_0x50e6c9)[_0x41bb('0x15')]+0x1:_0x1bb934[_0x41bb('0x15')];_0x1bb934[_0x41bb('0x15')]=(_0x18aeeb[_0x41bb('0x2b')]?_[_0x41bb('0x41')](_0x18aeeb)[_0x41bb('0x15')]:_0x8e200d[_0x41bb('0x15')])+0x1;_0x1bb934['extensions']=_['concat'](_0x1bb934['extensions'],_0x50e6c9,[_0x8e200d],_0x18aeeb);}_0x1bb934[_0x41bb('0xe')][_0x41bb('0x10')]({'type':_0x3e2ab4[_0x3526d0][0x0][_0x41bb('0x11')],'app':_0x41bb('0x42'),'exten':_0x3e2ab4[_0x3526d0][0x0][_0x41bb('0xb')],'context':_0x3e2ab4[_0x3526d0][0x0][_0x41bb('0x14')],'priority':_0x1bb934[_0x41bb('0x15')],'VoiceExtensionId':_0x3e2ab4[_0x3526d0][0x0][_0x41bb('0x16')]});_0x4cebf8[_0x41bb('0x10')](_0x3e2ab4[_0x3526d0][0x0][_0x41bb('0x16')]);_0x120168=_[_0x41bb('0x43')](_0x120168,_0x1bb934[_0x41bb('0xe')]);}}return _0x3db127[_0x41bb('0x44')](function(_0x485aea){return _0x3db127[_0x41bb('0x2')][_0x41bb('0x5')]['destroy']({'where':{'VoiceExtensionId':{'$in':_0x4cebf8}},'transaction':_0x485aea})[_0x41bb('0x45')](function(_0x229f60){return _0x3db127[_0x41bb('0x2')][_0x41bb('0x5')]['bulkCreate'](_[_0x41bb('0x46')](_0x120168,_0x41bb('0x15')),{'transaction':_0x485aea});});});})[_0x41bb('0x47')](function(_0x421aa2){console['error'](_0x421aa2);});}exports[_0x41bb('0x48')]=rewrite;
\ No newline at end of file
index bc15ab1..f381041 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa12f=['test','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','length','map','errors','message','join','hasOwnProperty','data','firstName\x20not\x20specified!','phone','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','find','duplicate','Duplicate\x20Contact','CmContact','create','keys','then','push','pick','Error\x20while\x20creating\x20contact:\x20','stringify','checkHopper','inspect','insert','cm_hopper','fromQuery','scheduledAt','createdAt','updatedAt','select','field','ContactId','toString','NOW()','from','cm_contacts','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','\x20=\x20?','into','id\x20IN\x20?','str','cm_hopper_final','VoiceQueue','findAll','outbound','Lists','get','dialCheckDuplicateType','sequelize','query','VoiceQueueId','catch','onlyIfOpen','all','CmList','BlackLists','Campaign','always','CampaignId','cmContact,\x20%s,\x20%s','generalCheckHopper','emit','resume','contact:csv_','unlinkSync','exit','SIGINT','info','CSV\x20import\x20process\x20stopped!','createReadStream','parse','pause','CSV\x20parsed\x20correctly!','Error\x20executing\x20contact\x20csv\x20import:','bluebird','lodash','squel','papaparse','../../../mysqldb','../../../config/logger','api','redis','defaults','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20socket_timestamp\x20parameter!','error','contact','index'];(function(_0x2ac089,_0x2fe389){var _0x275d89=function(_0x4345e3){while(--_0x4345e3){_0x2ac089['push'](_0x2ac089['shift']());}};_0x275d89(++_0x2fe389);}(_0xa12f,0x1a5));var _0xfa12=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xa12f[_0x3947c9];return _0x2e7871;};'use strict';var BPromise=require(_0xfa12('0x0'));var util=require('util');var _=require(_0xfa12('0x1'));var fs=require('fs');var squel=require(_0xfa12('0x2'));var Papa=require(_0xfa12('0x3'));var Redis=require('ioredis');var db=require(_0xfa12('0x4'))['db'];var config=require('../../../config/environment');var logger=require(_0xfa12('0x5'))(_0xfa12('0x6'));config[_0xfa12('0x7')]=_[_0xfa12('0x8')](config[_0xfa12('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0xfa12('0x9'))(new Redis(config['redis']));require(_0xfa12('0xa'))[_0xfa12('0xb')](socket);try{if(!process[_0xfa12('0xc')][0x2]||process[_0xfa12('0xc')][0x2]===_0xfa12('0xd')||process[_0xfa12('0xc')][0x2]===_0xfa12('0xe')){throw new Error(_0xfa12('0xf'));}var FILEPATH=process[_0xfa12('0xc')][0x2];if(!process[_0xfa12('0xc')][0x3]||process[_0xfa12('0xc')][0x3]===_0xfa12('0xd')||process[_0xfa12('0xc')][0x3]===_0xfa12('0xe')||!process[_0xfa12('0xc')][0x4]||process[_0xfa12('0xc')][0x4]===_0xfa12('0xd')||process[_0xfa12('0xc')][0x4]===_0xfa12('0xe')){throw new Error(_0xfa12('0x10'));}var FIELDS=_[_0xfa12('0x11')](process[_0xfa12('0xc')][0x3]['split'](','),process[_0xfa12('0xc')][0x4][_0xfa12('0x12')](','));if(!process['argv'][0x5]||process[_0xfa12('0xc')][0x5]==='undefined'||process[_0xfa12('0xc')][0x5]==='null'){throw new Error('Missing\x20ListId\x20parameter!');}var LISTID=process['argv'][0x5];var COMPANYID=process['argv'][0x6]&&process[_0xfa12('0xc')][0x6]!==_0xfa12('0xd')&&process[_0xfa12('0xc')][0x6]!==_0xfa12('0xe')?process['argv'][0x6]:null;var DUPLICATES=process[_0xfa12('0xc')][0x7]&&process[_0xfa12('0xc')][0x7]!=='undefined'&&process[_0xfa12('0xc')][0x7]!==_0xfa12('0xe')?process[_0xfa12('0xc')][0x7]:null;if(!process[_0xfa12('0xc')][0x8]||process[_0xfa12('0xc')][0x8]===_0xfa12('0xd')||process['argv'][0x8]===_0xfa12('0xe')){throw new Error(_0xfa12('0x13'));}var SOCKET_TIMESTAMP=process[_0xfa12('0xc')][0x8];}catch(_0xd37e86){logger[_0xfa12('0x14')](_0xd37e86);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(_0x45cd19,_0x467dfc,_0x3a9267,_0x39a6fd){var _0x77e892={'message':_0x467dfc};_0x77e892[_0x45cd19]=!![];if(_0x3a9267){_0x77e892[_0xfa12('0x15')]=_0x3a9267;}if(_0x39a6fd){_0x77e892[_0xfa12('0x16')]=_0x39a6fd;}return _0x77e892;}function isEmail(_0x1845a9){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))*$/[_0xfa12('0x17')](_0x1845a9);}function checkRow(_0x35a76c,_0x40a5b8,_0x22f3bd){return new BPromise(function(_0x591fd4,_0x5b3dd8){if(_[_0xfa12('0x18')](_0x35a76c)){return _0x5b3dd8(handleCheckRowError(_0xfa12('0x14'),_0xfa12('0x19'),null,_0x22f3bd));}if(_0x35a76c['errors']&&_0x35a76c['errors'][_0xfa12('0x1a')]){var _0x3ebec0=_[_0xfa12('0x1b')](_0x35a76c[_0xfa12('0x1c')],_0xfa12('0x1d'))[_0xfa12('0x1e')](';');return _0x5b3dd8(handleCheckRowError('error',_0x3ebec0,null,_0x22f3bd));}var _0x5af661={};for(var _0x1bc523 in FIELDS){if(FIELDS[_0xfa12('0x1f')](_0x1bc523)&&FIELDS[_0x1bc523]){_0x5af661[_0x1bc523]=_0x35a76c[_0xfa12('0x20')][0x0][FIELDS[_0x1bc523]]||_0x35a76c[_0xfa12('0x20')][0x0]['\ufeff'+FIELDS[_0x1bc523]];}}if(!_0x5af661['firstName']){return _0x5b3dd8(handleCheckRowError(_0xfa12('0x14'),_0xfa12('0x21'),null,_0x22f3bd));}if(!_0x5af661[_0xfa12('0x22')]){return _0x5b3dd8(handleCheckRowError(_0xfa12('0x14'),'phone\x20not\x20specified!',null,_0x22f3bd));}if(_0x5af661[_0xfa12('0x23')]){var _0x132865=moment(_0x5af661[_0xfa12('0x23')],_0xfa12('0x24'));if(!_0x132865[_0xfa12('0x25')]()){return _0x5b3dd8(handleCheckRowError('error',_0xfa12('0x26'),null,_0x22f3bd));}}if(_0x5af661[_0xfa12('0x27')]){if(!isEmail(_0x5af661['email'])){return _0x5b3dd8(handleCheckRowError(_0xfa12('0x14'),_0xfa12('0x28'),null,_0x22f3bd));}}_0x5af661[_0xfa12('0x29')]=LISTID;_0x5af661[_0xfa12('0x2a')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0xfa12('0x1a')]&&_0x40a5b8){var _0x1733bd={};for(var _0x319aac=0x0,_0x4b51a5=DUPLICATES[_0xfa12('0x1a')];_0x319aac<_0x4b51a5;_0x319aac+=0x1){_0x1733bd[DUPLICATES[_0x319aac]]=_0x5af661[DUPLICATES[_0x319aac]];}var _0x59ed63=_[_0xfa12('0x2b')](_0x40a5b8,_0x1733bd);if(_0x59ed63){return _0x5b3dd8(handleCheckRowError(_0xfa12('0x2c'),_0xfa12('0x2d'),_0x59ed63,_0x22f3bd));}}return db[_0xfa12('0x2e')][_0xfa12('0x2f')](_0x5af661,{'raw':!![],'hooks':![],'fields':_[_0xfa12('0x30')](_0x5af661)})[_0xfa12('0x31')](function(_0x29a8db){if(DUPLICATES&&DUPLICATES[_0xfa12('0x1a')]&&_0x40a5b8){_0x40a5b8[_0xfa12('0x32')](_[_0xfa12('0x33')](_0x5af661,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x29a8db['id'];return _0x591fd4();})['catch'](function(_0x2688af){return _0x5b3dd8(handleCheckRowError(_0xfa12('0x14'),_0xfa12('0x34')+(_0x2688af['message']||JSON[_0xfa12('0x35')](_0x2688af)),null,_0x22f3bd));});});}function checkHopper(){function _0x16d7f9(){return function(_0x3760b4){logger[_0xfa12('0x14')]('cmContact',_0xfa12('0x36'),util[_0xfa12('0x37')](_0x3760b4,{'showHidden':![],'depth':null}));};}var _0x49f61a=function(_0x106665,_0x37f50d){var _0x142dd4=squel[_0xfa12('0x38')]()['into'](_0xfa12('0x39'))[_0xfa12('0x3a')]([_0xfa12('0x22'),_0xfa12('0x3b'),'ContactId',_0xfa12('0x29'),_0x37f50d,_0xfa12('0x3c'),_0xfa12('0x3d')],squel[_0xfa12('0x3e')]()[_0xfa12('0x3f')](_0xfa12('0x22'),'phone')[_0xfa12('0x3f')]('NOW()',_0xfa12('0x3b'))[_0xfa12('0x3f')]('id',_0xfa12('0x40'))[_0xfa12('0x3f')](LISTID['toString'](),_0xfa12('0x29'))[_0xfa12('0x3f')](_0x106665['id'][_0xfa12('0x41')](),_0x37f50d)[_0xfa12('0x3f')](_0xfa12('0x42'),_0xfa12('0x3c'))['field'](_0xfa12('0x42'),_0xfa12('0x3d'))[_0xfa12('0x43')](_0xfa12('0x44'))[_0xfa12('0x45')](_0xfa12('0x46'))['where'](_0xfa12('0x47'),LISTID[_0xfa12('0x41')]())[_0xfa12('0x45')](_0xfa12('0x48'))[_0xfa12('0x45')](_0xfa12('0x49'),squel['select']()['field'](_0xfa12('0x22'))['from']('cm_hopper')['where'](_0x37f50d+_0xfa12('0x4a'),_0x106665['id'][_0xfa12('0x41')]())))['toString']();return _0x142dd4;};var _0x16482c=function(_0x29cb46,_0x28f3cd){var _0x18c209=squel[_0xfa12('0x38')]()[_0xfa12('0x4b')](_0xfa12('0x39'))[_0xfa12('0x3a')]([_0xfa12('0x22'),_0xfa12('0x3b'),'ContactId',_0xfa12('0x29'),_0x28f3cd,_0xfa12('0x3c'),'updatedAt'],squel['select']()[_0xfa12('0x3f')](_0xfa12('0x22'),'phone')[_0xfa12('0x3f')](_0xfa12('0x42'),_0xfa12('0x3b'))[_0xfa12('0x3f')]('id','ContactId')[_0xfa12('0x3f')](LISTID[_0xfa12('0x41')](),_0xfa12('0x29'))[_0xfa12('0x3f')](_0x29cb46['id'][_0xfa12('0x41')](),_0x28f3cd)[_0xfa12('0x3f')](_0xfa12('0x42'),_0xfa12('0x3c'))[_0xfa12('0x3f')]('NOW()','updatedAt')[_0xfa12('0x43')](_0xfa12('0x44'))[_0xfa12('0x45')]('deletedAt\x20IS\x20NULL')[_0xfa12('0x45')](_0xfa12('0x47'),LISTID[_0xfa12('0x41')]())[_0xfa12('0x45')](_0xfa12('0x4c'),squel[_0xfa12('0x4d')](hopperContacts))[_0xfa12('0x45')](_0xfa12('0x48'))['where'](_0xfa12('0x49'),squel['select']()[_0xfa12('0x3f')]('calleridnum')[_0xfa12('0x43')](_0xfa12('0x4e'))[_0xfa12('0x45')](_0x28f3cd+_0xfa12('0x4a'),_0x29cb46['id'][_0xfa12('0x41')]()))[_0xfa12('0x45')](_0xfa12('0x49'),squel[_0xfa12('0x3e')]()[_0xfa12('0x3f')](_0xfa12('0x22'))[_0xfa12('0x43')]('cm_hopper')['where'](_0x28f3cd+'\x20=\x20?',_0x29cb46['id']['toString']())))[_0xfa12('0x41')]();return _0x18c209;};function _0x35c72b(_0x1b6203,_0xa6db98){var _0x18137f=squel[_0xfa12('0x38')]()['into'](_0xfa12('0x39'))[_0xfa12('0x3a')]([_0xfa12('0x22'),_0xfa12('0x3b'),_0xfa12('0x40'),_0xfa12('0x29'),_0xa6db98,_0xfa12('0x3c'),'updatedAt'],squel[_0xfa12('0x3e')]()[_0xfa12('0x3f')]('phone',_0xfa12('0x22'))[_0xfa12('0x3f')](_0xfa12('0x42'),'scheduledAt')['field']('id',_0xfa12('0x40'))[_0xfa12('0x3f')](LISTID[_0xfa12('0x41')](),_0xfa12('0x29'))[_0xfa12('0x3f')](_0x1b6203['id']['toString'](),_0xa6db98)[_0xfa12('0x3f')](_0xfa12('0x42'),_0xfa12('0x3c'))[_0xfa12('0x3f')](_0xfa12('0x42'),_0xfa12('0x3d'))[_0xfa12('0x43')]('cm_contacts')[_0xfa12('0x45')](_0xfa12('0x46'))[_0xfa12('0x45')](_0xfa12('0x47'),LISTID[_0xfa12('0x41')]())[_0xfa12('0x45')](_0xfa12('0x4c'),squel[_0xfa12('0x4d')](hopperContacts))['where'](_0xfa12('0x48')))[_0xfa12('0x41')]();return _0x18137f;}function _0x2cbe63(_0x18b039,_0x1a83ea){var _0x46cb4e=squel[_0xfa12('0x38')]()['into']('cm_hopper_black')[_0xfa12('0x3a')]([_0xfa12('0x22'),'ContactId','ListId',_0x1a83ea,_0xfa12('0x3c'),_0xfa12('0x3d')],squel[_0xfa12('0x3e')]()[_0xfa12('0x3f')](_0xfa12('0x22'),_0xfa12('0x22'))[_0xfa12('0x3f')]('id',_0xfa12('0x40'))[_0xfa12('0x3f')](LISTID[_0xfa12('0x41')](),_0xfa12('0x29'))[_0xfa12('0x3f')](_0x18b039['id'][_0xfa12('0x41')](),_0x1a83ea)[_0xfa12('0x3f')](_0xfa12('0x42'),_0xfa12('0x3c'))[_0xfa12('0x3f')](_0xfa12('0x42'),_0xfa12('0x3d'))[_0xfa12('0x43')](_0xfa12('0x44'))['where'](_0xfa12('0x46'))[_0xfa12('0x45')](_0xfa12('0x47'),LISTID[_0xfa12('0x41')]())[_0xfa12('0x45')](_0xfa12('0x4c'),squel[_0xfa12('0x4d')](hopperContacts))['where'](_0xfa12('0x48')))[_0xfa12('0x41')]();return _0x46cb4e;}return db[_0xfa12('0x4f')][_0xfa12('0x50')]({'where':{'type':_0xfa12('0x51')},'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db['CmList'],'as':_0xfa12('0x52'),'where':{'id':LISTID}}]})[_0xfa12('0x31')](function(_0x3f1682){var _0x453c1b=[];if(_0x3f1682){var _0x41881d;for(var _0x4fe799=0x0,_0x2c3234;_0x4fe799<_0x3f1682['length'];_0x4fe799+=0x1){_0x2c3234=_0x3f1682[_0x4fe799][_0xfa12('0x53')]({'plain':!![]});switch(_0x2c3234[_0xfa12('0x54')]){case'always':_0x453c1b[_0xfa12('0x32')](db[_0xfa12('0x55')][_0xfa12('0x56')](_0x16482c(_0x2c3234,_0xfa12('0x57')))['then'](function(){})[_0xfa12('0x58')](_0x16d7f9()));break;case _0xfa12('0x59'):_0x453c1b[_0xfa12('0x32')](db[_0xfa12('0x55')]['query'](_0x49f61a(_0x2c3234,_0xfa12('0x57')))['then'](function(){})['catch'](_0x16d7f9()));break;default:_0x453c1b[_0xfa12('0x32')](db[_0xfa12('0x55')][_0xfa12('0x56')](_0x35c72b(_0x2c3234,_0xfa12('0x57')))[_0xfa12('0x31')](function(){})[_0xfa12('0x58')](_0x16d7f9()));}}}return _0x453c1b;})[_0xfa12('0x5a')]()[_0xfa12('0x31')](function(){return db[_0xfa12('0x4f')][_0xfa12('0x50')]({'where':{'type':_0xfa12('0x51')},'attributes':['id'],'include':[{'model':db[_0xfa12('0x5b')],'as':_0xfa12('0x5c'),'where':{'id':LISTID}}]})[_0xfa12('0x31')](function(_0x42cd94){var _0x19ce73=[];if(_0x42cd94){var _0x459107;for(var _0x1539e5=0x0,_0x2ac115;_0x1539e5<_0x42cd94['length'];_0x1539e5+=0x1){_0x2ac115=_0x42cd94[_0x1539e5][_0xfa12('0x53')]({'plain':!![]});_0x19ce73[_0xfa12('0x32')](db[_0xfa12('0x55')][_0xfa12('0x56')](_0x2cbe63(_0x2ac115,'VoiceQueueId'))[_0xfa12('0x31')](function(){})['catch'](_0x16d7f9()));}}return _0x19ce73;})[_0xfa12('0x5a')]();})[_0xfa12('0x31')](function(){return db[_0xfa12('0x5d')][_0xfa12('0x50')]({'attributes':['id',_0xfa12('0x54')],'include':[{'model':db[_0xfa12('0x5b')],'as':_0xfa12('0x52'),'where':{'id':LISTID}}]})[_0xfa12('0x31')](function(_0x14f8f1){var _0x52fa78=[];if(_0x14f8f1){for(var _0x5638b4=0x0,_0x5ae38e;_0x5638b4<_0x14f8f1['length'];_0x5638b4+=0x1){_0x5ae38e=_0x14f8f1[_0x5638b4][_0xfa12('0x53')]({'plain':!![]});switch(_0x5ae38e[_0xfa12('0x54')]){case _0xfa12('0x5e'):_0x52fa78['push'](db[_0xfa12('0x55')][_0xfa12('0x56')](_0x16482c(_0x5ae38e,_0xfa12('0x5f')))[_0xfa12('0x31')](function(){})[_0xfa12('0x58')](_0x16d7f9()));break;case _0xfa12('0x59'):_0x52fa78[_0xfa12('0x32')](db['sequelize'][_0xfa12('0x56')](_0x49f61a(_0x5ae38e,_0xfa12('0x5f')))[_0xfa12('0x31')](function(){})['catch'](_0x16d7f9()));break;default:_0x52fa78['push'](db[_0xfa12('0x55')][_0xfa12('0x56')](_0x35c72b(_0x5ae38e,_0xfa12('0x5f')))[_0xfa12('0x31')](function(){})[_0xfa12('0x58')](_0x16d7f9()));}}}return _0x52fa78;})[_0xfa12('0x5a')]();})[_0xfa12('0x31')](function(){return db[_0xfa12('0x5d')][_0xfa12('0x50')]({'attributes':['id'],'include':[{'model':db[_0xfa12('0x5b')],'as':_0xfa12('0x5c'),'where':{'id':LISTID}}]})[_0xfa12('0x31')](function(_0x169ba7){var _0x6051cd=[];if(_0x169ba7){for(var _0x58896b=0x0,_0x127241;_0x58896b<_0x169ba7['length'];_0x58896b+=0x1){_0x127241=_0x169ba7[_0x58896b][_0xfa12('0x53')]({'plain':!![]});_0x6051cd[_0xfa12('0x32')](db[_0xfa12('0x55')][_0xfa12('0x56')](_0x2cbe63(_0x127241,_0xfa12('0x5f')))['then'](function(){})[_0xfa12('0x58')](_0x16d7f9()));}}return _0x6051cd;})['all']();})[_0xfa12('0x58')](function(_0x594bfa){logger[_0xfa12('0x14')](_0xfa12('0x60'),_0xfa12('0x61'),_0x594bfa[_0xfa12('0x1d')]);});}var processPromises=function(_0x350395){return BPromise[_0xfa12('0x5a')](promises)[_0xfa12('0x31')](function(_0x7b1edc){})[_0xfa12('0x58')](function(_0x16ec00){logger[_0xfa12('0x14')]('Error\x20processing\x20rows\x20block:',JSON[_0xfa12('0x35')](_0x16ec00));})['finally'](function(){socket[_0xfa12('0x62')]('contact:csv_'+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x350395){return _0x350395[_0xfa12('0x63')]();}});};var endCsv=function(){return BPromise['resolve']()[_0xfa12('0x31')](function(){if(hopperContacts){return checkHopper();}})[_0xfa12('0x31')](function(){socket['emit'](_0xfa12('0x64')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0xfa12('0x65')](FILEPATH);}catch(_0xe64bdc){logger['error']('Unable\x20to\x20delete\x20temp\x20file:',JSON['stringify'](_0xe64bdc));}finally{process[_0xfa12('0x66')](0x0);}});};process['on'](_0xfa12('0x67'),function(){logger[_0xfa12('0x68')](_0xfa12('0x69'));endCsv();});function main(){return BPromise['resolve']()[_0xfa12('0x31')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0xfa12('0x12')](',');return db['CmContact'][_0xfa12('0x50')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0xfa12('0x31')](function(_0xbe8773){var _0xf8885c=fs[_0xfa12('0x6a')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0xfa12('0x6b')](_0xf8885c,{'header':!![],'skipEmptyLines':!![],'step':function(_0x324e6e,_0x1a5a0a){total+=0x1;var _0x5763e4=total;promises[_0xfa12('0x32')](checkRow(_0x324e6e,_0xbe8773,_0x5763e4)[_0xfa12('0x31')](function(){success+=0x1;})[_0xfa12('0x58')](function(_0x5e586a){if(_0x5e586a[_0xfa12('0x14')]){errors+=0x1;delete _0x5e586a[_0xfa12('0x14')];}else if(_0x5e586a[_0xfa12('0x2c')]){duplicates+=0x1;delete _0x5e586a[_0xfa12('0x2c')];}rows[_0xfa12('0x32')](_0x5e586a);}));if(total%0xc8===0x0){_0x1a5a0a[_0xfa12('0x6c')]();return processPromises(_0x1a5a0a);}},'complete':function(){return processPromises()[_0xfa12('0x31')](function(){logger[_0xfa12('0x68')](_0xfa12('0x6d'));endCsv();});},'error':function(_0x2d6a0b,_0x264cad){logger[_0xfa12('0x68')]('CSV\x20parse\x20error',JSON[_0xfa12('0x35')](_0x2d6a0b));endCsv();}});})[_0xfa12('0x58')](function(_0x67056c){logger['error'](_0xfa12('0x6e'),JSON[_0xfa12('0x35')](_0x67056c));});}main();
\ No newline at end of file
+var _0x9cb8=['then','get','always','sequelize','VoiceQueueId','push','query','all','BlackLists','Campaign','CampaignId','onlyIfOpen','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','finally','emit','resume','resolve','contact:csv_','Unable\x20to\x20delete\x20temp\x20file:','info','CSV\x20import\x20process\x20stopped!','CmContact','createReadStream','parse','pause','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','util','lodash','squel','papaparse','ioredis','../../../mysqldb','../../../config/environment','api','redis','localhost','socket.io-emitter','argv','null','undefined','Missing\x20binding\x20parameters!','split','Missing\x20socket_timestamp\x20parameter!','error','contact','index','test','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','message','join','hasOwnProperty','data','firstName','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','find','duplicate','Duplicate\x20Contact','create','keys','catch','stringify','cmContact','inspect','insert','cm_hopper','fromQuery','phone','scheduledAt','ContactId','createdAt','updatedAt','field','NOW()','toString','from','cm_contacts','where','deletedAt\x20IS\x20NULL','select','\x20=\x20?','into','ListId\x20=\x20?','id\x20IN\x20?','str','phone\x20IS\x20NOT\x20NULL','calleridnum','cm_hopper_final','phone\x20NOT\x20IN\x20(?)','VoiceQueue','findAll','outbound','dialCheckDuplicateType','CmList','Lists'];(function(_0x367ea5,_0xeb4c3f){var _0x1b0ede=function(_0xd0dcf8){while(--_0xd0dcf8){_0x367ea5['push'](_0x367ea5['shift']());}};_0x1b0ede(++_0xeb4c3f);}(_0x9cb8,0x89));var _0x89cb=function(_0x2fd8e2,_0x8cbd99){_0x2fd8e2=_0x2fd8e2-0x0;var _0x35bdb4=_0x9cb8[_0x2fd8e2];return _0x35bdb4;};'use strict';var BPromise=require('bluebird');var util=require(_0x89cb('0x0'));var _=require(_0x89cb('0x1'));var fs=require('fs');var squel=require(_0x89cb('0x2'));var Papa=require(_0x89cb('0x3'));var Redis=require(_0x89cb('0x4'));var db=require(_0x89cb('0x5'))['db'];var config=require(_0x89cb('0x6'));var logger=require('../../../config/logger')(_0x89cb('0x7'));config['redis']=_['defaults'](config[_0x89cb('0x8')],{'host':_0x89cb('0x9'),'port':0x18eb});var socket=require(_0x89cb('0xa'))(new Redis(config[_0x89cb('0x8')]));require('../../../api/cmContact/cmContact.socket')['register'](socket);try{if(!process[_0x89cb('0xb')][0x2]||process[_0x89cb('0xb')][0x2]==='undefined'||process[_0x89cb('0xb')][0x2]===_0x89cb('0xc')){throw new Error('Missing\x20filepath\x20parameter!');}var FILEPATH=process[_0x89cb('0xb')][0x2];if(!process[_0x89cb('0xb')][0x3]||process['argv'][0x3]===_0x89cb('0xd')||process[_0x89cb('0xb')][0x3]===_0x89cb('0xc')||!process[_0x89cb('0xb')][0x4]||process[_0x89cb('0xb')][0x4]===_0x89cb('0xd')||process['argv'][0x4]==='null'){throw new Error(_0x89cb('0xe'));}var FIELDS=_['zipObject'](process[_0x89cb('0xb')][0x3][_0x89cb('0xf')](','),process[_0x89cb('0xb')][0x4][_0x89cb('0xf')](','));if(!process[_0x89cb('0xb')][0x5]||process['argv'][0x5]===_0x89cb('0xd')||process['argv'][0x5]===_0x89cb('0xc')){throw new Error('Missing\x20ListId\x20parameter!');}var LISTID=process[_0x89cb('0xb')][0x5];var COMPANYID=process[_0x89cb('0xb')][0x6]&&process[_0x89cb('0xb')][0x6]!==_0x89cb('0xd')&&process[_0x89cb('0xb')][0x6]!==_0x89cb('0xc')?process[_0x89cb('0xb')][0x6]:null;var DUPLICATES=process[_0x89cb('0xb')][0x7]&&process[_0x89cb('0xb')][0x7]!=='undefined'&&process[_0x89cb('0xb')][0x7]!=='null'?process['argv'][0x7]:null;if(!process['argv'][0x8]||process[_0x89cb('0xb')][0x8]==='undefined'||process[_0x89cb('0xb')][0x8]==='null'){throw new Error(_0x89cb('0x10'));}var SOCKET_TIMESTAMP=process[_0x89cb('0xb')][0x8];}catch(_0xf028ce){logger[_0x89cb('0x11')](_0xf028ce);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(_0x4fb63a,_0x551096,_0x45b88c,_0x3bb723){var _0x128a42={'message':_0x551096};_0x128a42[_0x4fb63a]=!![];if(_0x45b88c){_0x128a42[_0x89cb('0x12')]=_0x45b88c;}if(_0x3bb723){_0x128a42[_0x89cb('0x13')]=_0x3bb723;}return _0x128a42;}function isEmail(_0x593fb4){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))*$/[_0x89cb('0x14')](_0x593fb4);}function checkRow(_0x11e49c,_0x3b4a11,_0x4615b2){return new BPromise(function(_0x46fd0b,_0x24c291){if(_[_0x89cb('0x15')](_0x11e49c)){return _0x24c291(handleCheckRowError(_0x89cb('0x11'),_0x89cb('0x16'),null,_0x4615b2));}if(_0x11e49c[_0x89cb('0x17')]&&_0x11e49c[_0x89cb('0x17')][_0x89cb('0x18')]){var _0x5f1d69=_['map'](_0x11e49c[_0x89cb('0x17')],_0x89cb('0x19'))[_0x89cb('0x1a')](';');return _0x24c291(handleCheckRowError(_0x89cb('0x11'),_0x5f1d69,null,_0x4615b2));}var _0x37602b={};for(var _0x15c57b in FIELDS){if(FIELDS[_0x89cb('0x1b')](_0x15c57b)&&FIELDS[_0x15c57b]){_0x37602b[_0x15c57b]=_0x11e49c[_0x89cb('0x1c')][0x0][FIELDS[_0x15c57b]]||_0x11e49c[_0x89cb('0x1c')][0x0]['\ufeff'+FIELDS[_0x15c57b]];}}if(!_0x37602b[_0x89cb('0x1d')]){return _0x24c291(handleCheckRowError(_0x89cb('0x11'),'firstName\x20not\x20specified!',null,_0x4615b2));}if(!_0x37602b['phone']){return _0x24c291(handleCheckRowError(_0x89cb('0x11'),_0x89cb('0x1e'),null,_0x4615b2));}if(_0x37602b[_0x89cb('0x1f')]){var _0x5becd7=moment(_0x37602b[_0x89cb('0x1f')],_0x89cb('0x20'));if(!_0x5becd7['isValid']()){return _0x24c291(handleCheckRowError(_0x89cb('0x11'),_0x89cb('0x21'),null,_0x4615b2));}}if(_0x37602b[_0x89cb('0x22')]){if(!isEmail(_0x37602b[_0x89cb('0x22')])){return _0x24c291(handleCheckRowError('error',_0x89cb('0x23'),null,_0x4615b2));}}_0x37602b[_0x89cb('0x24')]=LISTID;_0x37602b['CompanyId']=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x89cb('0x18')]&&_0x3b4a11){var _0x36627a={};for(var _0x1939b2=0x0,_0x233776=DUPLICATES[_0x89cb('0x18')];_0x1939b2<_0x233776;_0x1939b2+=0x1){_0x36627a[DUPLICATES[_0x1939b2]]=_0x37602b[DUPLICATES[_0x1939b2]];}var _0x5336ac=_[_0x89cb('0x25')](_0x3b4a11,_0x36627a);if(_0x5336ac){return _0x24c291(handleCheckRowError(_0x89cb('0x26'),_0x89cb('0x27'),_0x5336ac,_0x4615b2));}}return db['CmContact'][_0x89cb('0x28')](_0x37602b,{'raw':!![],'hooks':![],'fields':_[_0x89cb('0x29')](_0x37602b)})['then'](function(_0x3beec7){if(DUPLICATES&&DUPLICATES[_0x89cb('0x18')]&&_0x3b4a11){_0x3b4a11['push'](_['pick'](_0x37602b,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x3beec7['id'];return _0x46fd0b();})[_0x89cb('0x2a')](function(_0x52365e){return _0x24c291(handleCheckRowError(_0x89cb('0x11'),'Error\x20while\x20creating\x20contact:\x20'+(_0x52365e[_0x89cb('0x19')]||JSON[_0x89cb('0x2b')](_0x52365e)),null,_0x4615b2));});});}function checkHopper(){function _0x16ee24(){return function(_0xfe683f){logger[_0x89cb('0x11')](_0x89cb('0x2c'),'checkHopper',util[_0x89cb('0x2d')](_0xfe683f,{'showHidden':![],'depth':null}));};}var _0x48272f=function(_0x23c224,_0x47e356){var _0x458a0b=squel[_0x89cb('0x2e')]()['into'](_0x89cb('0x2f'))[_0x89cb('0x30')]([_0x89cb('0x31'),_0x89cb('0x32'),_0x89cb('0x33'),_0x89cb('0x24'),_0x47e356,_0x89cb('0x34'),_0x89cb('0x35')],squel['select']()[_0x89cb('0x36')](_0x89cb('0x31'),_0x89cb('0x31'))[_0x89cb('0x36')](_0x89cb('0x37'),_0x89cb('0x32'))[_0x89cb('0x36')]('id',_0x89cb('0x33'))[_0x89cb('0x36')](LISTID[_0x89cb('0x38')](),_0x89cb('0x24'))['field'](_0x23c224['id']['toString'](),_0x47e356)[_0x89cb('0x36')](_0x89cb('0x37'),_0x89cb('0x34'))[_0x89cb('0x36')]('NOW()',_0x89cb('0x35'))[_0x89cb('0x39')](_0x89cb('0x3a'))[_0x89cb('0x3b')](_0x89cb('0x3c'))[_0x89cb('0x3b')]('ListId\x20=\x20?',LISTID['toString']())['where']('phone\x20IS\x20NOT\x20NULL')[_0x89cb('0x3b')]('phone\x20NOT\x20IN\x20(?)',squel[_0x89cb('0x3d')]()['field'](_0x89cb('0x31'))[_0x89cb('0x39')]('cm_hopper')['where'](_0x47e356+_0x89cb('0x3e'),_0x23c224['id'][_0x89cb('0x38')]())))[_0x89cb('0x38')]();return _0x458a0b;};var _0x499864=function(_0x5b47bc,_0x1afe9e){var _0x5599a6=squel[_0x89cb('0x2e')]()[_0x89cb('0x3f')]('cm_hopper')[_0x89cb('0x30')]([_0x89cb('0x31'),_0x89cb('0x32'),_0x89cb('0x33'),_0x89cb('0x24'),_0x1afe9e,_0x89cb('0x34'),'updatedAt'],squel[_0x89cb('0x3d')]()[_0x89cb('0x36')](_0x89cb('0x31'),_0x89cb('0x31'))[_0x89cb('0x36')](_0x89cb('0x37'),_0x89cb('0x32'))[_0x89cb('0x36')]('id',_0x89cb('0x33'))[_0x89cb('0x36')](LISTID[_0x89cb('0x38')](),_0x89cb('0x24'))[_0x89cb('0x36')](_0x5b47bc['id'][_0x89cb('0x38')](),_0x1afe9e)['field'](_0x89cb('0x37'),_0x89cb('0x34'))['field'](_0x89cb('0x37'),_0x89cb('0x35'))[_0x89cb('0x39')]('cm_contacts')[_0x89cb('0x3b')]('deletedAt\x20IS\x20NULL')[_0x89cb('0x3b')](_0x89cb('0x40'),LISTID[_0x89cb('0x38')]())[_0x89cb('0x3b')](_0x89cb('0x41'),squel[_0x89cb('0x42')](hopperContacts))[_0x89cb('0x3b')](_0x89cb('0x43'))[_0x89cb('0x3b')]('phone\x20NOT\x20IN\x20(?)',squel[_0x89cb('0x3d')]()['field'](_0x89cb('0x44'))['from'](_0x89cb('0x45'))['where'](_0x1afe9e+_0x89cb('0x3e'),_0x5b47bc['id'][_0x89cb('0x38')]()))['where'](_0x89cb('0x46'),squel['select']()[_0x89cb('0x36')]('phone')[_0x89cb('0x39')](_0x89cb('0x2f'))['where'](_0x1afe9e+'\x20=\x20?',_0x5b47bc['id'][_0x89cb('0x38')]())))[_0x89cb('0x38')]();return _0x5599a6;};function _0x26b172(_0x71a42,_0x578db0){var _0x117e85=squel['insert']()[_0x89cb('0x3f')](_0x89cb('0x2f'))['fromQuery'](['phone',_0x89cb('0x32'),_0x89cb('0x33'),_0x89cb('0x24'),_0x578db0,_0x89cb('0x34'),_0x89cb('0x35')],squel[_0x89cb('0x3d')]()[_0x89cb('0x36')](_0x89cb('0x31'),_0x89cb('0x31'))['field'](_0x89cb('0x37'),'scheduledAt')[_0x89cb('0x36')]('id','ContactId')['field'](LISTID[_0x89cb('0x38')](),_0x89cb('0x24'))[_0x89cb('0x36')](_0x71a42['id'][_0x89cb('0x38')](),_0x578db0)[_0x89cb('0x36')](_0x89cb('0x37'),_0x89cb('0x34'))[_0x89cb('0x36')](_0x89cb('0x37'),_0x89cb('0x35'))[_0x89cb('0x39')](_0x89cb('0x3a'))[_0x89cb('0x3b')]('deletedAt\x20IS\x20NULL')[_0x89cb('0x3b')](_0x89cb('0x40'),LISTID['toString']())[_0x89cb('0x3b')]('id\x20IN\x20?',squel[_0x89cb('0x42')](hopperContacts))[_0x89cb('0x3b')](_0x89cb('0x43')))['toString']();return _0x117e85;}function _0x5e03a7(_0x59d9d4,_0x453fea){var _0x5e86eb=squel[_0x89cb('0x2e')]()[_0x89cb('0x3f')]('cm_hopper_black')[_0x89cb('0x30')]([_0x89cb('0x31'),_0x89cb('0x33'),_0x89cb('0x24'),_0x453fea,_0x89cb('0x34'),'updatedAt'],squel['select']()[_0x89cb('0x36')](_0x89cb('0x31'),_0x89cb('0x31'))[_0x89cb('0x36')]('id',_0x89cb('0x33'))[_0x89cb('0x36')](LISTID[_0x89cb('0x38')](),_0x89cb('0x24'))['field'](_0x59d9d4['id']['toString'](),_0x453fea)['field'](_0x89cb('0x37'),_0x89cb('0x34'))[_0x89cb('0x36')]('NOW()',_0x89cb('0x35'))['from'](_0x89cb('0x3a'))[_0x89cb('0x3b')](_0x89cb('0x3c'))['where'](_0x89cb('0x40'),LISTID[_0x89cb('0x38')]())[_0x89cb('0x3b')](_0x89cb('0x41'),squel[_0x89cb('0x42')](hopperContacts))[_0x89cb('0x3b')](_0x89cb('0x43')))[_0x89cb('0x38')]();return _0x5e86eb;}return db[_0x89cb('0x47')][_0x89cb('0x48')]({'where':{'type':_0x89cb('0x49')},'attributes':['id',_0x89cb('0x4a')],'include':[{'model':db[_0x89cb('0x4b')],'as':_0x89cb('0x4c'),'where':{'id':LISTID}}]})[_0x89cb('0x4d')](function(_0x283d0d){var _0xacfe0e=[];if(_0x283d0d){var _0x12d678;for(var _0x59e392=0x0,_0x360273;_0x59e392<_0x283d0d[_0x89cb('0x18')];_0x59e392+=0x1){_0x360273=_0x283d0d[_0x59e392][_0x89cb('0x4e')]({'plain':!![]});switch(_0x360273[_0x89cb('0x4a')]){case _0x89cb('0x4f'):_0xacfe0e['push'](db[_0x89cb('0x50')]['query'](_0x499864(_0x360273,_0x89cb('0x51')))['then'](function(){})[_0x89cb('0x2a')](_0x16ee24()));break;case'onlyIfOpen':_0xacfe0e[_0x89cb('0x52')](db[_0x89cb('0x50')][_0x89cb('0x53')](_0x48272f(_0x360273,'VoiceQueueId'))[_0x89cb('0x4d')](function(){})['catch'](_0x16ee24()));break;default:_0xacfe0e[_0x89cb('0x52')](db['sequelize'][_0x89cb('0x53')](_0x26b172(_0x360273,_0x89cb('0x51')))[_0x89cb('0x4d')](function(){})[_0x89cb('0x2a')](_0x16ee24()));}}}return _0xacfe0e;})[_0x89cb('0x54')]()[_0x89cb('0x4d')](function(){return db[_0x89cb('0x47')]['findAll']({'where':{'type':_0x89cb('0x49')},'attributes':['id'],'include':[{'model':db[_0x89cb('0x4b')],'as':_0x89cb('0x55'),'where':{'id':LISTID}}]})['then'](function(_0x34546c){var _0x4e7cdd=[];if(_0x34546c){var _0x9a1179;for(var _0x5b032e=0x0,_0x2f1c5f;_0x5b032e<_0x34546c[_0x89cb('0x18')];_0x5b032e+=0x1){_0x2f1c5f=_0x34546c[_0x5b032e]['get']({'plain':!![]});_0x4e7cdd[_0x89cb('0x52')](db[_0x89cb('0x50')]['query'](_0x5e03a7(_0x2f1c5f,_0x89cb('0x51')))['then'](function(){})[_0x89cb('0x2a')](_0x16ee24()));}}return _0x4e7cdd;})[_0x89cb('0x54')]();})[_0x89cb('0x4d')](function(){return db[_0x89cb('0x56')]['findAll']({'attributes':['id',_0x89cb('0x4a')],'include':[{'model':db[_0x89cb('0x4b')],'as':_0x89cb('0x4c'),'where':{'id':LISTID}}]})['then'](function(_0x269976){var _0x14f0df=[];if(_0x269976){for(var _0x3bf560=0x0,_0x535e6f;_0x3bf560<_0x269976[_0x89cb('0x18')];_0x3bf560+=0x1){_0x535e6f=_0x269976[_0x3bf560][_0x89cb('0x4e')]({'plain':!![]});switch(_0x535e6f[_0x89cb('0x4a')]){case'always':_0x14f0df[_0x89cb('0x52')](db[_0x89cb('0x50')][_0x89cb('0x53')](_0x499864(_0x535e6f,_0x89cb('0x57')))[_0x89cb('0x4d')](function(){})['catch'](_0x16ee24()));break;case _0x89cb('0x58'):_0x14f0df[_0x89cb('0x52')](db[_0x89cb('0x50')]['query'](_0x48272f(_0x535e6f,_0x89cb('0x57')))[_0x89cb('0x4d')](function(){})[_0x89cb('0x2a')](_0x16ee24()));break;default:_0x14f0df[_0x89cb('0x52')](db[_0x89cb('0x50')][_0x89cb('0x53')](_0x26b172(_0x535e6f,_0x89cb('0x57')))['then'](function(){})[_0x89cb('0x2a')](_0x16ee24()));}}}return _0x14f0df;})[_0x89cb('0x54')]();})[_0x89cb('0x4d')](function(){return db[_0x89cb('0x56')][_0x89cb('0x48')]({'attributes':['id'],'include':[{'model':db[_0x89cb('0x4b')],'as':_0x89cb('0x55'),'where':{'id':LISTID}}]})['then'](function(_0x273ca2){var _0x2fc84a=[];if(_0x273ca2){for(var _0x5b3dad=0x0,_0x2d16b2;_0x5b3dad<_0x273ca2['length'];_0x5b3dad+=0x1){_0x2d16b2=_0x273ca2[_0x5b3dad][_0x89cb('0x4e')]({'plain':!![]});_0x2fc84a['push'](db[_0x89cb('0x50')][_0x89cb('0x53')](_0x5e03a7(_0x2d16b2,_0x89cb('0x57')))[_0x89cb('0x4d')](function(){})[_0x89cb('0x2a')](_0x16ee24()));}}return _0x2fc84a;})[_0x89cb('0x54')]();})[_0x89cb('0x2a')](function(_0x285344){logger[_0x89cb('0x11')](_0x89cb('0x59'),_0x89cb('0x5a'),_0x285344[_0x89cb('0x19')]);});}var processPromises=function(_0x4b18e3){return BPromise[_0x89cb('0x54')](promises)[_0x89cb('0x4d')](function(_0x25d979){})[_0x89cb('0x2a')](function(_0x4cfbfc){logger[_0x89cb('0x11')](_0x89cb('0x5b'),JSON[_0x89cb('0x2b')](_0x4cfbfc));})[_0x89cb('0x5c')](function(){socket[_0x89cb('0x5d')]('contact:csv_'+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x4b18e3){return _0x4b18e3[_0x89cb('0x5e')]();}});};var endCsv=function(){return BPromise[_0x89cb('0x5f')]()[_0x89cb('0x4d')](function(){if(hopperContacts){return checkHopper();}})[_0x89cb('0x4d')](function(){socket[_0x89cb('0x5d')](_0x89cb('0x60')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs['unlinkSync'](FILEPATH);}catch(_0x51977e){logger[_0x89cb('0x11')](_0x89cb('0x61'),JSON[_0x89cb('0x2b')](_0x51977e));}finally{process['exit'](0x0);}});};process['on']('SIGINT',function(){logger[_0x89cb('0x62')](_0x89cb('0x63'));endCsv();});function main(){return BPromise[_0x89cb('0x5f')]()[_0x89cb('0x4d')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x89cb('0xf')](',');return db[_0x89cb('0x64')][_0x89cb('0x48')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x89cb('0x4d')](function(_0x1bcc8b){var _0x571583=fs[_0x89cb('0x65')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x89cb('0x66')](_0x571583,{'header':!![],'skipEmptyLines':!![],'step':function(_0x9c5eb6,_0x459a29){total+=0x1;var _0x5e6ebe=total;promises['push'](checkRow(_0x9c5eb6,_0x1bcc8b,_0x5e6ebe)[_0x89cb('0x4d')](function(){success+=0x1;})[_0x89cb('0x2a')](function(_0x4ba477){if(_0x4ba477['error']){errors+=0x1;delete _0x4ba477[_0x89cb('0x11')];}else if(_0x4ba477[_0x89cb('0x26')]){duplicates+=0x1;delete _0x4ba477[_0x89cb('0x26')];}rows['push'](_0x4ba477);}));if(total%0xc8===0x0){_0x459a29[_0x89cb('0x67')]();return processPromises(_0x459a29);}},'complete':function(){return processPromises()[_0x89cb('0x4d')](function(){logger[_0x89cb('0x62')](_0x89cb('0x68'));endCsv();});},'error':function(_0x44650a,_0xc22755){logger['info'](_0x89cb('0x69'),JSON[_0x89cb('0x2b')](_0x44650a));endCsv();}});})['catch'](function(_0x512f78){logger['error'](_0x89cb('0x6a'),JSON['stringify'](_0x512f78));});}main();
\ No newline at end of file
index 6cf5ee8..6a88be6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0186=['ListId\x20=\x20?','\x20=\x20','date_add(cm_contacts.scheduledat,interval\x20','.offset-cm_contacts.utcOffset\x20minute)','cm_contacts.ListId','updatedAt','priority','.id\x20=\x20','cm_contacts.createdAt','cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.createdAt','cm_contact_has_items.updatedAt','cm_hopper_additional_phones','CmHopperId','OrderBy','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','cm_hopper.ListId\x20=\x20?','concat','keys','CompanyId',')\x20NOT\x20IN\x20?','id\x20IN\x20?','MIN(id)','min_id','group','info','Received\x20SIGINT','error','message','exit','errors','push','code','query','spread','catch','campaigns.dialTimezone','campaigns','campaigns_has_cm_lists','campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId','sequelize','voice_queues.id','voice_queues.dialTimezone','voice_queues_has_cm_lists','voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId','timezones','isNil','utcOffset','set','offset','dialTimezone','main','send','start','socket_timestamp','root','server/files/tmp','.csv','includes','ContactItemType','name','_description','header','writeFileSync','parse','data','rows','find','hasOwnProperty','trim','replace','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNumber','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','itemTypeId','description','SystemRow','appendFileSync','emit','contact:import:','Abort\x20parser','abort','SystemError','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','campaigns_','voice_queues_','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);','each','dialTimezone,utcOffset',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','contactId','contactTypeId','voice_queues','VoiceQueueId','CampaignId','campaigns_has_cm_blacklists','voice_queues_has_cm_blacklists','finish','affectedRows','unlink','existsSync','file\x20doesn\x27t\x20exists','argv','binding','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','map','path','lodash','util','moment','squel','../../../mysqldb','../../../config/environment/shared','../../../config/logger','import','redis','defaults','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','select','field','phone','from','join','where','.dialCheckDuplicateType\x20IN\x20(','findAll','then','length','AdditionalPhones','all','split','filter','findOne','CmContactHasItem','update','updated','create','PHONE','inserted','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','into','cm_hopper','scheduledat','ContactId','ListId','createdAt','UserId','recallme','cm_contacts.ListId\x20=\x20','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','\x22always\x22','\x22onlyIfOpen\x22','cm_contacts.phone\x20NOT\x20IN\x20(?)','toString','cm_hopper_black','fromQuery','fields','cm_contacts','.CmListId'];(function(_0x4314f0,_0x4ebf54){var _0x20e377=function(_0xec3474){while(--_0xec3474){_0x4314f0['push'](_0x4314f0['shift']());}};_0x20e377(++_0x4ebf54);}(_0x0186,0x1f1));var _0x6018=function(_0x5d78ae,_0x5a43f7){_0x5d78ae=_0x5d78ae-0x0;var _0x137f34=_0x0186[_0x5d78ae];return _0x137f34;};'use strict';var fs=require('fs');var path=require(_0x6018('0x0'));var _=require(_0x6018('0x1'));var Papa=require('papaparse');var util=require(_0x6018('0x2'));var BPromise=require('bluebird');var moment=require(_0x6018('0x3'));var squel=require(_0x6018('0x4'));var Redis=require('ioredis');var db=require(_0x6018('0x5'))['db'];var config=require('../../../config/environment');var shared=require(_0x6018('0x6'));var logger=require(_0x6018('0x7'))(_0x6018('0x8'));config[_0x6018('0x9')]=_[_0x6018('0xa')](config[_0x6018('0x9')],{'host':_0x6018('0xb'),'port':0x18eb});var socket=require(_0x6018('0xc'))(new Redis(config[_0x6018('0x9')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()[_0x6018('0xd')](_0x6018('0xe'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()['format'](_0x6018('0xe'));function isEmail(_0x546156){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))*$/[_0x6018('0xf')](_0x546156);}function selectNotIn(_0xb619ee,_0x311558,_0x2c11c1,_0x499661,_0x37aeb1){return squel[_0x6018('0x10')]()[_0x6018('0x11')](_0x6018('0x12'))[_0x6018('0x13')](_0x499661)[_0x6018('0x14')](_0x311558,null,_0x311558+'.id\x20=\x20'+_0x499661+'.'+_0x2c11c1)[_0x6018('0x15')](_0x499661+'.'+_0x2c11c1+'\x20=\x20'+_0xb619ee+'.'+_0x2c11c1)[_0x6018('0x15')](_0x311558+_0x6018('0x16')+_0x37aeb1[_0x6018('0x14')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x1ad4c6,_0x4dc684){promisesAdditionalPhones=[];return db['CmContact'][_0x6018('0x17')]({'raw':!![],'attributes':['id','AdditionalPhones'],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})[_0x6018('0x18')](function(_0x571f54){if(_0x571f54!==null){var _0x3e7d55=[];for(var _0xe04081=0x0;_0xe04081<_0x571f54[_0x6018('0x19')];_0xe04081++){var _0x5c4e34=_0x571f54[_0xe04081];_0x3e7d55['push'](insertAdditionalPhones(_0x5c4e34));}}Promise['all'](_0x3e7d55)[_0x6018('0x18')](function(){_0x1ad4c6({'val':0x1});});});});}function insertAdditionalPhones(_0x24fd83){return new Promise(function(_0x238669,_0x2fcd8b){var _0x4d9b2a=_0x24fd83[_0x6018('0x1a')];var _0x4d36a7=_0x4d9b2a['split'](';');var _0xd33c91=[];orderBy=0x0;for(var _0x3a7552=0x0;_0x3a7552<_0x4d36a7['length'];_0x3a7552++){_0xd33c91['push'](splitAdditionalPhone(_0x24fd83['id'],_0x4d36a7[_0x3a7552]));}Promise[_0x6018('0x1b')](_0xd33c91)[_0x6018('0x18')](function(){_0x238669({'val':_0x4d36a7[_0x6018('0x19')]});});});}function splitAdditionalPhone(_0x2c9150,_0xd6d1df){return new Promise(function(_0x2dc0a8,_0x529073){var _0x1cf05f=_0xd6d1df[_0x6018('0x1c')](':');var _0x498e70=_0x1cf05f[0x0];var _0x214c96=_0x1cf05f[0x1];if(!_['isNil'](_0x214c96)){var _0x24bb42=_0x214c96['split']('|');var _0x58062d=[];for(var _0x2179b3=0x0;_0x2179b3<_0x24bb42[_0x6018('0x19')];_0x2179b3++){if(_0x24bb42[_0x2179b3]!==''){var _0x461246=_[_0x6018('0x1d')](promisesAdditionalPhones,{'contactId':_0x2c9150,'phone':_0x24bb42[_0x2179b3]});if(_0x461246[_0x6018('0x19')]==0x0){orderBy++;promisesAdditionalPhones['push']({'contactId':_0x2c9150,'contactTypeId':_0x498e70,'phone':_0x24bb42[_0x2179b3],'orderBy':orderBy});}}}_0x2dc0a8({'ok':0x1});}else _0x2dc0a8({'res':0x0});});}function createAdditionalPhone(_0x543b65,_0x27e08c,_0x544560,_0x448d35){var _0x3bb467='';var _0x27672d='';var _0x149caf=_0x544560[_0x6018('0x1c')]('§');_0x3bb467=_0x149caf[0x0];if(_0x149caf[_0x6018('0x19')]==0x2)_0x27672d=_0x149caf[0x1];return new Promise(function(_0x129257,_0x4d50df){return db['CmContactHasItem'][_0x6018('0x1e')]({'where':{'CmContactId':_0x543b65,'item':_0x3bb467}})[_0x6018('0x18')](function(_0x582818){if(_0x582818){return db[_0x6018('0x1f')][_0x6018('0x20')]({'ItemTypeId':_0x27e08c,'description':_0x27672d,'OrderBy':_0x448d35},{'where':{'CmContactId':_0x543b65,'item':_0x3bb467}})[_0x6018('0x18')](function(_0x452597){_0x129257({'res':_0x6018('0x21')});});}else{return db[_0x6018('0x1f')][_0x6018('0x22')]({'CmContactId':_0x543b65,'item':_0x3bb467,'description':_0x27672d,'ItemTypeId':_0x27e08c,'OrderBy':_0x448d35,'ItemClass':_0x6018('0x23')})[_0x6018('0x18')](function(_0x1745ba){_0x129257({'res':_0x6018('0x24')});});}});});}function insertCmHopper(_0x54df35,_0x483385,_0x34a80b,_0xa9986a,_0x4cb102){var _0x2f28ec=[_0x6018('0x25'),_0x6018('0x26'),_0x6018('0x27'),'cm_contacts.ListId',_0x483385+'.'+_0xa9986a,'cm_contacts.createdAt',_0x6018('0x28'),_0x6018('0x29'),_0x6018('0x2a'),'\x22'+_0x4cb102+'\x22'];return squel[_0x6018('0x2b')]()[_0x6018('0x2c')](_0x6018('0x2d'))['fromQuery']([_0x6018('0x12'),_0x6018('0x2e'),_0x6018('0x2f'),_0x6018('0x30'),_0xa9986a,_0x6018('0x31'),'updatedAt','priority',_0x6018('0x32'),_0x6018('0x33')],squel['select']()['fields'](_0x2f28ec)[_0x6018('0x13')](_0x483385)[_0x6018('0x14')]('cm_contacts',null,_0x6018('0x34')+_0x483385+'.CmListId')[_0x6018('0x14')](_0x34a80b,null,_0x34a80b+'.id\x20=\x20'+_0x483385+'.'+_0xa9986a)['where'](_0x483385+_0x6018('0x35'),_0x54df35)[_0x6018('0x15')](_0x6018('0x36'),NOW)[_0x6018('0x15')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x483385,_0x34a80b,_0xa9986a,_0x6018('0x2d'),[_0x6018('0x37'),_0x6018('0x38')]))[_0x6018('0x15')](_0x6018('0x39'),selectNotIn(_0x483385,_0x34a80b,_0xa9986a,_0x6018('0x2d'),[_0x6018('0x37')])))[_0x6018('0x3a')]();}function insertCmHopperBlack(_0x1e1984,_0x38a29d,_0x2e0b22,_0xbdd84e){var _0x214348=[_0x6018('0x25'),_0x6018('0x27'),'cm_contacts.ListId',_0x38a29d+'.'+_0xbdd84e,'cm_contacts.createdAt',_0x6018('0x28')];return squel['insert']()[_0x6018('0x2c')](_0x6018('0x3b'))[_0x6018('0x3c')]([_0x6018('0x12'),_0x6018('0x2f'),_0x6018('0x30'),_0xbdd84e,_0x6018('0x31'),'updatedAt'],squel[_0x6018('0x10')]()[_0x6018('0x3d')](_0x214348)['from'](_0x38a29d)[_0x6018('0x14')](_0x6018('0x3e'),null,_0x6018('0x34')+_0x38a29d+_0x6018('0x3f'))[_0x6018('0x14')](_0x2e0b22,null,_0x2e0b22+'.id\x20=\x20'+_0x38a29d+'.'+_0xbdd84e)['where'](_0x38a29d+_0x6018('0x35'),_0x1e1984)['where']('cm_contacts.createdAt\x20=\x20?',NOW)['where'](_0x6018('0x39'),squel[_0x6018('0x10')]()[_0x6018('0x11')]('phone')[_0x6018('0x13')]('cm_hopper_black')[_0x6018('0x15')](_0x6018('0x40'),_0x1e1984)[_0x6018('0x15')](_0xbdd84e+_0x6018('0x41')+_0x38a29d+'.'+_0xbdd84e)))[_0x6018('0x3a')]();}function insertTzCmHopper(_0x222155,_0x4f1584,_0x4b5184,_0x55b53f,_0x18d94c,_0x3c9ff9){var _0x5967c0=[_0x6018('0x25'),_0x6018('0x42')+_0x3c9ff9+_0x6018('0x43'),'cm_contacts.id',_0x6018('0x44'),_0x4f1584+'.'+_0x55b53f,'cm_contacts.createdAt',_0x6018('0x28'),_0x6018('0x29'),_0x6018('0x2a'),'\x22'+_0x18d94c+'\x22'];var _0x362155=squel[_0x6018('0x2b')]()[_0x6018('0x2c')](_0x6018('0x2d'))[_0x6018('0x3c')](['phone','scheduledat',_0x6018('0x2f'),'ListId',_0x55b53f,_0x6018('0x31'),_0x6018('0x45'),_0x6018('0x46'),_0x6018('0x32'),_0x6018('0x33')],squel[_0x6018('0x10')]()['fields'](_0x5967c0)[_0x6018('0x13')](_0x4f1584)[_0x6018('0x14')](_0x6018('0x3e'),null,_0x6018('0x34')+_0x4f1584+_0x6018('0x3f'))['join'](_0x4b5184,null,_0x4b5184+_0x6018('0x47')+_0x4f1584+'.'+_0x55b53f)['join'](_0x3c9ff9,null,_0x3c9ff9+_0x6018('0x47')+_0x4f1584+'.'+_0x55b53f)[_0x6018('0x15')](_0x4f1584+_0x6018('0x35'),_0x222155)[_0x6018('0x15')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0x6018('0x15')](_0x6018('0x39'),selectNotIn(_0x4f1584,_0x4b5184,_0x55b53f,'cm_hopper',[_0x6018('0x37'),_0x6018('0x38')]))[_0x6018('0x15')](_0x6018('0x39'),selectNotIn(_0x4f1584,_0x4b5184,_0x55b53f,_0x6018('0x2d'),[_0x6018('0x37')])))[_0x6018('0x3a')]();return _0x362155;}function insertTzCmHopperBlack(_0x3df8cf,_0x19ba62,_0xc6f74,_0x4db56d){var _0x5af5bb=[_0x6018('0x25'),'cm_contacts.id',_0x6018('0x44'),_0x19ba62+'.'+_0x4db56d,_0x6018('0x48'),'cm_contacts.updatedAt'];return squel[_0x6018('0x2b')]()[_0x6018('0x2c')](_0x6018('0x3b'))['fromQuery'](['phone',_0x6018('0x2f'),_0x6018('0x30'),_0x4db56d,_0x6018('0x31'),_0x6018('0x45')],squel[_0x6018('0x10')]()[_0x6018('0x3d')](_0x5af5bb)['from'](_0x19ba62)[_0x6018('0x14')](_0x6018('0x3e'),null,'cm_contacts.ListId\x20=\x20'+_0x19ba62+'.CmListId')[_0x6018('0x14')](_0xc6f74,null,_0xc6f74+_0x6018('0x47')+_0x19ba62+'.'+_0x4db56d)[_0x6018('0x15')](_0x19ba62+'.CmListId\x20=\x20?',_0x3df8cf)[_0x6018('0x15')](_0x6018('0x36'),NOW)[_0x6018('0x15')](_0x6018('0x39'),squel[_0x6018('0x10')]()[_0x6018('0x11')](_0x6018('0x12'))[_0x6018('0x13')](_0x6018('0x3b'))[_0x6018('0x15')]('ListId\x20=\x20?',_0x3df8cf)['where'](_0x4db56d+_0x6018('0x41')+_0x19ba62+'.'+_0x4db56d)))[_0x6018('0x3a')]();}function insertCmHopperAdditionalPhones(_0x826b6c){var _0x422a11=[_0x6018('0x49'),_0x6018('0x4a'),'cm_contact_has_items.OrderBy',_0x6018('0x4b'),_0x6018('0x4c')];return squel[_0x6018('0x2b')]()['into'](_0x6018('0x4d'))['fromQuery']([_0x6018('0x4e'),_0x6018('0x12'),_0x6018('0x4f'),_0x6018('0x31'),_0x6018('0x45')],squel[_0x6018('0x10')]()[_0x6018('0x3d')](_0x422a11)[_0x6018('0x13')](_0x6018('0x2d'))[_0x6018('0x14')](_0x6018('0x3e'),null,_0x6018('0x50'))['join']('cm_contact_has_items',null,_0x6018('0x51'))[_0x6018('0x15')](_0x6018('0x52'),_0x826b6c)['where'](_0x6018('0x36'),NOW))[_0x6018('0x3a')]();}function insertCmContact(_0x101f4b,_0x132390,_0x555488,_0xa65034){var _0x420f8b=_[_0x6018('0x53')](_[_0x6018('0x54')](_0xa65034),[_0x6018('0x30'),_0x6018('0x55'),_0x6018('0x31'),_0x6018('0x45')]);return squel[_0x6018('0x2b')]()['into']('cm_contacts')[_0x6018('0x3c')](_0x420f8b,squel['select']()[_0x6018('0x3d')](_0x420f8b)[_0x6018('0x13')](_0x132390)['where']('('+_0x555488[_0x6018('0x14')](',')+_0x6018('0x56'),squel[_0x6018('0x10')]()[_0x6018('0x3d')](_0x555488)['from']('cm_contacts')['where'](_0x6018('0x40'),_0x101f4b)['where']('deletedAt\x20IS\x20NULL'))[_0x6018('0x15')](_0x6018('0x57'),squel[_0x6018('0x10')]()[_0x6018('0x11')](_0x6018('0x58'),_0x6018('0x59'))[_0x6018('0x13')](_0x132390)[_0x6018('0x5a')](_0x555488[_0x6018('0x14')](','))))[_0x6018('0x3a')]();}function handleStop(){logger[_0x6018('0x5b')](_0x6018('0x5c'));stopped=!![];}function handleUncaughtException(_0x179f66){logger[_0x6018('0x5d')](_0x179f66[_0x6018('0x5e')]);process[_0x6018('0x5f')](0x1);}function handleError(_0x5e9706,_0x313c71){stats[_0x6018('0x60')][_0x6018('0x61')]({'name':_0x313c71[_0x6018('0x62')],'message':_0x313c71[_0x6018('0x5e')],'row':_0x5e9706});}function handleQuery(_0x1d36bb){logger['info'](_0x1d36bb);return db['sequelize'][_0x6018('0x63')](_0x1d36bb)[_0x6018('0x64')](function(_0x5683f2){results[_0x6018('0x61')](_0x5683f2);})[_0x6018('0x65')](function(_0x75ea81){logger['error'](_0x75ea81[_0x6018('0x5e')]);});}function updateTzCampaigns(_0x5d4332){return new Promise(function(_0x470c5f,_0x1039d2){var _0x210459=squel[_0x6018('0x10')]()[_0x6018('0x3d')](['campaigns.id',_0x6018('0x66')])['from'](_0x6018('0x67'))[_0x6018('0x14')](_0x6018('0x68'),null,_0x6018('0x69'))[_0x6018('0x15')]('campaigns_has_cm_lists.CmListId='+_0x5d4332);db[_0x6018('0x6a')][_0x6018('0x63')](_0x210459[_0x6018('0x3a')]())[_0x6018('0x64')](function(_0x5a1cfd){var _0x51170f=[];for(var _0x4829e0=0x0;_0x4829e0<_0x5a1cfd[_0x6018('0x19')];_0x4829e0++){_0x51170f[_0x6018('0x61')](getTimezoneData(_0x5a1cfd[_0x4829e0],tmp_campaigns));}BPromise[_0x6018('0x1b')](_0x51170f)['then'](function(){_0x470c5f({'val':0x1});});})['catch'](function(_0x5a34a6){logger[_0x6018('0x5d')](_0x5a34a6[_0x6018('0x5e')]);_0x470c5f({'val':0x0});});});}function updateTzVoiceQueues(_0x2eb8f6){return new Promise(function(_0x4ba207,_0x56a2e7){var _0x57c6c8=squel[_0x6018('0x10')]()[_0x6018('0x3d')]([_0x6018('0x6b'),_0x6018('0x6c')])[_0x6018('0x13')]('voice_queues')['join'](_0x6018('0x6d'),null,_0x6018('0x6e'))[_0x6018('0x15')]('voice_queues_has_cm_lists.CmListId='+_0x2eb8f6);db[_0x6018('0x6a')]['query'](_0x57c6c8[_0x6018('0x3a')]())['spread'](function(_0x50c7b4){var _0x37cb5f=[];for(var _0x4ea9c9=0x0;_0x4ea9c9<_0x50c7b4[_0x6018('0x19')];_0x4ea9c9++){_0x37cb5f[_0x6018('0x61')](getTimezoneData(_0x50c7b4[_0x4ea9c9],tmp_voice_queues));}BPromise['all'](_0x37cb5f)[_0x6018('0x18')](function(){_0x4ba207({'val':0x1});});})[_0x6018('0x65')](function(_0x224e91){logger[_0x6018('0x5d')](_0x224e91[_0x6018('0x5e')]);_0x4ba207({'val':0x0});});});}function getTimezoneData(_0xb67908,_0x5a7363){return new Promise(function(_0x195dd7,_0x5049c5){var _0x5f10d4=shared[_0x6018('0x6f')];var _0x54b959=_0x5f10d4[_0xb67908['dialTimezone']];if(_[_0x6018('0x70')](_0x54b959)){_0x195dd7({'ret':0x1});}else{var _0x46ee6d=_0x54b959[_0x6018('0x71')];var _0x39fd69=squel[_0x6018('0x2b')]()['into'](_0x5a7363)[_0x6018('0x72')]('id',_0xb67908['id'])[_0x6018('0x72')](_0x6018('0x73'),_0x46ee6d)[_0x6018('0x72')](_0x6018('0x74'),_0xb67908[_0x6018('0x74')])[_0x6018('0x3a')]();return db['sequelize'][_0x6018('0x63')](_0x39fd69)[_0x6018('0x64')](function(_0x501b91){_0x195dd7({'ret':0x1});})[_0x6018('0x65')](function(_0x572e93){logger['error'](_0x572e93[_0x6018('0x5e')]);_0x5049c5({'ret':0x1});});}});}function handleTZQuery(_0x21ebaa){logger[_0x6018('0x5b')](_0x21ebaa);return db[_0x6018('0x6a')][_0x6018('0x63')](_0x21ebaa)[_0x6018('0x64')](function(_0x4ed4f6){})['catch'](function(_0x4d0f5f){logger['error'](_0x4d0f5f[_0x6018('0x5e')]);});}function main(_0x1e0328,_0x4576b7,_0x5a0fc8,_0x29ae81){logger[_0x6018('0x5b')](_0x6018('0x75'),_0x1e0328,JSON['stringify'](_0x4576b7));process[_0x6018('0x76')](_0x6018('0x77'));var _0x279ce1=_0x4576b7['binding'];var _0x5c1c57=_['clone'](_0x279ce1);var _0x3f1bf6=_0x4576b7[_0x6018('0x78')];var _0x753fba=path['join'](config[_0x6018('0x79')],_0x6018('0x7a'),_0x3f1bf6+_0x6018('0x7b'));hasTZ=_['keys'](_0x279ce1)[_0x6018('0x7c')]('dialTimezone');var _0x363acd=_[_0x6018('0x54')](_0x279ce1)[_0x6018('0x14')]();logger[_0x6018('0x5b')]('header',_0x363acd);db[_0x6018('0x7d')][_0x6018('0x17')]({'raw':!![],'attributes':['id',_0x6018('0x7e')]})[_0x6018('0x18')](function(_0x22430c){for(var _0x4983a2=0x0;_0x4983a2<_0x22430c[_0x6018('0x19')];_0x4983a2++){if(_0x22430c[_0x4983a2]['name']in _0x279ce1){contactItemTypes[_0x6018('0x61')](_0x22430c[_0x4983a2]);delete _0x5c1c57[_0x22430c[_0x4983a2][_0x6018('0x7e')]];hasAdditionalPhones=!![];}for(var _0x4778c0 in _0x279ce1){if(_0x22430c[_0x4983a2][_0x6018('0x7e')]+_0x6018('0x7f')===_0x4778c0){phoneDescriptions['push']({'itemTypeId':_0x22430c[_0x4983a2]['id'],'description':_0x4778c0});delete _0x5c1c57[_0x4778c0];}}}if(hasAdditionalPhones)_0x5c1c57[_0x6018('0x1a')]='';var _0x19d2fe=_['keys'](_0x5c1c57)[_0x6018('0x14')]();logger['info'](_0x6018('0x80'),_0x19d2fe);fs[_0x6018('0x81')](_0x753fba,_0x19d2fe+'\x0a');Papa[_0x6018('0x82')](fs['createReadStream'](_0x1e0328),{'header':!![],'skipEmptyLines':!![],'step':function(_0x3e784c,_0x38efca){try{for(var _0x48730d=0x0,_0x4137cd=[];_0x48730d<_0x3e784c[_0x6018('0x83')][_0x6018('0x19')];_0x48730d++){stats[_0x6018('0x84')]+=0x1;if(_0x3e784c[_0x6018('0x60')][_0x48730d]){handleError(_0x3e784c[_0x6018('0x83')][_0x48730d],_0x3e784c[_0x6018('0x60')][_0x48730d]);}else{var _0x434e4e=[];var _0x523801=[];var _0x17a14d={};for(var _0x582ff8 in _0x279ce1){let _0x41cd85=contactItemTypes[_0x6018('0x85')](_0x5e8f5c=>_0x5e8f5c[_0x6018('0x7e')]===_0x582ff8);let _0x287171=contactItemTypes['find'](_0x183d4c=>_0x183d4c[_0x6018('0x7e')]+'_description'===_0x582ff8);if(_[_0x6018('0x70')](_0x41cd85)&&_[_0x6018('0x70')](_0x287171)){if(_0x279ce1[_0x6018('0x86')](_0x582ff8)){if(_0x3e784c[_0x6018('0x83')][_0x48730d][_0x279ce1[_0x582ff8]]){var _0x35367a=_[_0x6018('0x87')](_0x3e784c[_0x6018('0x83')][_0x48730d][_0x279ce1[_0x582ff8]][_0x6018('0x88')](/"/g,'\x27'));switch(_0x582ff8){case _0x6018('0x2e'):var _0x379b27=moment(_0x35367a,_0x6018('0xe'),!![]);if(_0x379b27[_0x6018('0x89')]()){_0x4137cd[_0x6018('0x61')]('\x22'+_0x35367a+'\x22');}else{_0x434e4e['push'](_0x6018('0x8a'));}break;case _0x6018('0x46'):var _0x45594f=parseInt(_0x35367a);_0x35367a=_['isNaN'](_0x45594f)||_0x45594f<0x0||_0x45594f>0x4?_0x29ae81?0x3:0x2:_0x45594f;_0x4137cd[_0x6018('0x61')]('\x22'+_0x35367a+'\x22');break;case _0x6018('0x32'):var _0x2f6af8=parseInt(_0x35367a);if(_[_0x6018('0x8b')](_0x2f6af8)&&_[_0x6018('0x7c')](_0x5a0fc8,_0x2f6af8)){_0x4137cd['push']('\x22'+_0x2f6af8+'\x22');}else{_0x434e4e[_0x6018('0x61')](_0x6018('0x8c'));}break;case _0x6018('0x8d'):if(isEmail(_0x35367a)){_0x4137cd[_0x6018('0x61')]('\x22'+_0x35367a+'\x22');}else{_0x434e4e[_0x6018('0x61')](_0x6018('0x8e'));}break;case _0x6018('0x8f'):var _0x1c0475=moment(_0x35367a,'YYYY-MM-DD',!![]);if(_0x1c0475['isValid']()){_0x4137cd['push']('\x22'+_0x35367a+'\x22');}else{_0x434e4e[_0x6018('0x61')](_0x6018('0x90'));}break;case _0x6018('0x74'):var _0x49a3b3=shared[_0x6018('0x6f')];var _0x33f475=_0x49a3b3[_0x35367a];if(!_[_0x6018('0x70')](_0x33f475)){var _0x158d33=_0x33f475['utcOffset'];_0x4137cd[_0x6018('0x61')]('\x22'+_0x35367a+'\x22');_0x4137cd[_0x6018('0x61')]('\x22'+_0x158d33+'\x22');}break;default:_0x4137cd['push']('\x22'+_0x35367a+'\x22');}}else{switch(_0x582ff8){case _0x6018('0x91'):case _0x6018('0x12'):_0x434e4e['push'](_0x582ff8+_0x6018('0x92'));break;default:_0x4137cd[_0x6018('0x61')]('\x22\x22');}}}}else{var _0x3582dd='';if(!_[_0x6018('0x70')](_0x41cd85)){if(!_0x17a14d[_0x6018('0x86')](_0x41cd85['id'])){if(!_[_0x6018('0x70')](_0x3e784c[_0x6018('0x83')][_0x48730d][_0x279ce1[_0x582ff8]])){var _0x35367a=_[_0x6018('0x87')](_0x3e784c[_0x6018('0x83')][_0x48730d][_0x279ce1[_0x582ff8]][_0x6018('0x88')](/"/g,'\x27'));var _0x4c5bd9=phoneDescriptions[_0x6018('0x85')](_0x40e9b6=>_0x40e9b6[_0x6018('0x93')]===_0x41cd85['id']);if(!_[_0x6018('0x70')](_0x4c5bd9)){var _0x2f91d6=_[_0x6018('0x87')](_0x3e784c[_0x6018('0x83')][_0x48730d][_0x279ce1[_0x4c5bd9[_0x6018('0x94')]]][_0x6018('0x88')](/"/g,'\x27'));if(!_[_0x6018('0x70')](_0x2f91d6))_0x35367a=_0x35367a+'§'+_0x2f91d6;}if(_0x3582dd=='')_0x3582dd=_0x35367a;else _0x3582dd+='|'+_0x35367a;}_0x523801[_0x6018('0x61')](_0x41cd85['id']+':'+_0x3582dd);_0x17a14d[_0x41cd85['id']]=0x1;}}}}if(hasAdditionalPhones){_0x4137cd[_0x6018('0x61')]('\x22'+_0x523801[_0x6018('0x14')](';')+'\x22');}if(_0x434e4e[_0x6018('0x19')]){handleError(_0x3e784c['data'][_0x48730d],{'code':_0x6018('0x95'),'message':_0x434e4e[_0x6018('0x14')]()});}else{fs[_0x6018('0x96')](_0x753fba,_0x4137cd[_0x6018('0x14')]()+'\x0a');}_0x4137cd=[];}if(!(stats[_0x6018('0x84')]%0xc8)){socket[_0x6018('0x97')](_0x6018('0x98')+_0x3f1bf6,stats);stats[_0x6018('0x60')]=[];}}if(stopped){logger[_0x6018('0x5b')](_0x6018('0x99'));_0x38efca[_0x6018('0x9a')]();}}catch(_0x50dca4){handleError(_0x3e784c[_0x6018('0x83')][_0x48730d],{'code':_0x6018('0x9b'),'message':_0x50dca4['message']});logger[_0x6018('0x5d')](_0x6018('0x9c'),_0x50dca4[_0x6018('0x5e')]);}},'complete':function(){try{var _0x31c7e7=[];var _0x5c71dc=[];var _0x12b7b7=_0x6018('0x3e');if(_0x4576b7[_0x6018('0x9d')]&&_0x4576b7[_0x6018('0x9d')][_0x6018('0x19')]){_0x12b7b7=_0x6018('0x9e')+_0x3f1bf6;_0x31c7e7['push'](_0x6018('0x9f')+_0x12b7b7+_0x6018('0xa0'));}tmp_campaigns=_0x6018('0xa1')+_0x3f1bf6;tmp_voice_queues=_0x6018('0xa2')+_0x3f1bf6;_0x5c71dc[_0x6018('0x61')]('CREATE\x20TABLE\x20'+tmp_campaigns+_0x6018('0xa3'));_0x5c71dc['push'](_0x6018('0x9f')+tmp_voice_queues+_0x6018('0xa3'));BPromise[_0x6018('0xa4')](_0x5c71dc,handleTZQuery)[_0x6018('0x18')](function(_0xb6942b){updateTzCampaigns(_0x4576b7[_0x6018('0x30')])[_0x6018('0x18')](function(_0x5e59f9){updateTzVoiceQueues(_0x4576b7['ListId'])['then'](function(_0x5f0af0){if(hasTZ)_0x19d2fe=_0x19d2fe['replace'](_0x6018('0x74'),_0x6018('0xa5'));var _0x461e68=util[_0x6018('0xd')]('LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',_0x753fba,_0x12b7b7,_0x19d2fe,_0x4576b7[_0x6018('0x30')],_0x4576b7[_0x6018('0x55')]||null,NOW,NOW);if(_[_0x6018('0x70')](_0x279ce1['scheduledat'])){_0x461e68+=_0x6018('0xa6');}_0x31c7e7[_0x6018('0x61')](_0x461e68);if(_0x4576b7[_0x6018('0x9d')]&&_0x4576b7[_0x6018('0x9d')][_0x6018('0x19')]){_0x31c7e7[_0x6018('0x61')](insertCmContact(_0x4576b7[_0x6018('0x30')],_0x12b7b7,_0x4576b7[_0x6018('0x9d')],_0x279ce1));_0x31c7e7['push'](_0x6018('0xa7')+_0x12b7b7+';');}BPromise[_0x6018('0xa4')](_0x31c7e7,handleQuery)['then'](function(_0x38bc4b){BPromise[_0x6018('0x1b')]([handleAdditionalPhones()])[_0x6018('0x18')](function(){_0x31c7e7=[];for(var _0x4f1832=0x0;_0x4f1832<promisesAdditionalPhones['length'];_0x4f1832++){if(promisesAdditionalPhones[_0x4f1832][_0x6018('0x12')]!='§'){_0x31c7e7[_0x6018('0x61')](createAdditionalPhone(promisesAdditionalPhones[_0x4f1832][_0x6018('0xa8')],promisesAdditionalPhones[_0x4f1832][_0x6018('0xa9')],promisesAdditionalPhones[_0x4f1832][_0x6018('0x12')],promisesAdditionalPhones[_0x4f1832]['orderBy']));}}BPromise[_0x6018('0x1b')](_0x31c7e7)[_0x6018('0x18')](function(){_0x31c7e7=[];if(hasTZ){_0x31c7e7['push'](insertTzCmHopper(_0x4576b7[_0x6018('0x30')],_0x6018('0x6d'),_0x6018('0xaa'),_0x6018('0xab'),_0x29ae81,tmp_voice_queues));_0x31c7e7[_0x6018('0x61')](insertTzCmHopperBlack(_0x4576b7['ListId'],'voice_queues_has_cm_blacklists',_0x6018('0xaa'),'VoiceQueueId'));_0x31c7e7[_0x6018('0x61')](insertTzCmHopper(_0x4576b7[_0x6018('0x30')],_0x6018('0x68'),'campaigns',_0x6018('0xac'),_0x29ae81,tmp_campaigns));_0x31c7e7['push'](insertTzCmHopperBlack(_0x4576b7['ListId'],_0x6018('0xad'),_0x6018('0x67'),_0x6018('0xac')));_0x31c7e7['push'](insertCmHopperAdditionalPhones(_0x4576b7[_0x6018('0x30')]));}else{_0x31c7e7['push'](insertCmHopper(_0x4576b7[_0x6018('0x30')],'voice_queues_has_cm_lists',_0x6018('0xaa'),_0x6018('0xab'),_0x29ae81));_0x31c7e7['push'](insertCmHopperBlack(_0x4576b7[_0x6018('0x30')],_0x6018('0xae'),_0x6018('0xaa'),_0x6018('0xab')));_0x31c7e7[_0x6018('0x61')](insertCmHopper(_0x4576b7[_0x6018('0x30')],_0x6018('0x68'),_0x6018('0x67'),_0x6018('0xac'),_0x29ae81));_0x31c7e7[_0x6018('0x61')](insertCmHopperBlack(_0x4576b7[_0x6018('0x30')],_0x6018('0xad'),_0x6018('0x67'),'CampaignId'));_0x31c7e7[_0x6018('0x61')](insertCmHopperAdditionalPhones(_0x4576b7[_0x6018('0x30')]));}_0x31c7e7['push'](_0x6018('0xa7')+tmp_campaigns+';');_0x31c7e7[_0x6018('0x61')](_0x6018('0xa7')+tmp_voice_queues+';');BPromise[_0x6018('0xa4')](_0x31c7e7,handleQuery)[_0x6018('0x18')](function(_0x172f0b){stats[_0x6018('0xaf')]=!![];stats['affectedRows']=_0x4576b7[_0x6018('0x9d')]&&_0x4576b7[_0x6018('0x9d')]['length']?results[0x2]['affectedRows']:results[0x0][_0x6018('0xb0')];socket['emit']('contact:import:'+_0x3f1bf6,stats);fs[_0x6018('0xb1')](_0x1e0328);fs[_0x6018('0xb1')](_0x753fba);process[_0x6018('0x5f')](0x0);})['catch'](function(_0x5ef7a2){logger[_0x6018('0x5d')](_0x5ef7a2[_0x6018('0x5e')]);process[_0x6018('0x5f')](0x1);});});});})[_0x6018('0x65')](function(_0x5baf54){logger[_0x6018('0x5d')](_0x5baf54[_0x6018('0x5e')]);process['exit'](0x1);});});});});}catch(_0x486e80){logger[_0x6018('0x5d')]('complete',_0x486e80[_0x6018('0x5e')]);process[_0x6018('0x5f')](0x1);}},'error':function(_0x47df02,_0x2195a6,_0x472d41,_0x3552ad){throw new Error(_0x3552ad);}});});}function validate(){if(process['argv']&&process['argv'][_0x6018('0x19')]<0x4){throw new Error('arguments\x20<filename>\x20<parameters>\x20<agents>');}var _0x36da0c=path['join'](config[_0x6018('0x79')],_0x6018('0x7a'),process['argv'][0x2]);if(!fs[_0x6018('0xb2')](_0x36da0c)){throw new Error(_0x6018('0xb3'));}var _0x5664bf={};try{_0x5664bf=JSON[_0x6018('0x82')](process[_0x6018('0xb4')][0x3]);if(!_0x5664bf[_0x6018('0xb5')]){throw new Error(_0x6018('0xb6'));}if(!_0x5664bf[_0x6018('0xb5')][_0x6018('0x12')]){throw new Error(_0x6018('0xb7'));}if(!_0x5664bf['binding'][_0x6018('0x91')]){throw new Error(_0x6018('0xb8'));}var _0x30abfe=0x0;if(_0x5664bf[_0x6018('0xb5')][_0x6018('0x32')]){_0x30abfe=0x1;}if(!_0x5664bf[_0x6018('0x30')]){throw new Error(_0x6018('0xb9'));}}catch(_0x5000ea){throw new Error('body\x20id\x20mandatory');}var _0x232fa5=[];try{_0x232fa5=_[_0x6018('0xba')](JSON[_0x6018('0x82')](process[_0x6018('0xb4')][0x4]),'id');}catch(_0x53711f){logger[_0x6018('0x5b')]('No\x20agent\x20available');}main(_0x36da0c,_0x5664bf,_0x232fa5,_0x30abfe);}validate();process['on']('SIGINT',handleStop);process['on']('uncaughtException',handleUncaughtException);
\ No newline at end of file
+var _0x1f2d=['campaigns_has_cm_lists','campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId','catch','voice_queues_has_cm_lists.CmListId=','set','offset','dialTimezone','main','stringify','send','start','clone','socket_timestamp','.csv','header','ContactItemType','name','_description','writeFileSync','data','rows','errors','find','hasOwnProperty','trim','replace','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','isNumber','includes','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','utcOffset','firstName','\x20not\x20specified','description','SystemRow','emit','Abort\x20parser','abort','SystemError','step','duplicates','CREATE\x20TABLE\x20','campaigns_','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);','each','dialTimezone,utcOffset','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','contactId','contactTypeId','orderBy','voice_queues_has_cm_lists','VoiceQueueId','voice_queues_has_cm_blacklists','voice_queues','CampaignId','campaigns_has_cm_blacklists','finish','affectedRows','contact:import:','unlink','complete','argv','arguments\x20<filename>\x20<parameters>\x20<agents>','root','existsSync','file\x20doesn\x27t\x20exists','parse','binding','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','papaparse','util','moment','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/environment/shared','../../../config/logger','import','redis','defaults','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','select','phone','from','join','.id\x20=\x20','where','\x20=\x20','findAll','AdditionalPhones','then','length','push','all','split','isNil','filter','CmContactHasItem','findOne','update','create','PHONE','cm_contacts.phone','cm_contacts.id','cm_contacts.ListId','cm_contacts.updatedAt','cm_contacts.UserId','insert','into','cm_hopper','fromQuery','ContactId','ListId','createdAt','updatedAt','priority','recallme','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22onlyIfOpen\x22','\x22always\x22','cm_contacts.createdAt','fields','field','ListId\x20=\x20?','toString','date_add(cm_contacts.scheduledat,interval\x20','cm_contacts.priority','scheduledat','UserId','cm_hopper_black','cm_contact_has_items.item','cm_contact_has_items.OrderBy','cm_contact_has_items.updatedAt','cm_hopper_additional_phones','CmHopperId','OrderBy','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','cm_hopper.ListId\x20=\x20?','concat','keys','CompanyId','deletedAt\x20IS\x20NULL','min_id','info','error','message','exit','code','sequelize','query','spread','campaigns.id','campaigns.dialTimezone','campaigns'];(function(_0x2aeac7,_0x1995e0){var _0x128bc4=function(_0x5ed43d){while(--_0x5ed43d){_0x2aeac7['push'](_0x2aeac7['shift']());}};_0x128bc4(++_0x1995e0);}(_0x1f2d,0x1c4));var _0xd1f2=function(_0x4b1032,_0x36952e){_0x4b1032=_0x4b1032-0x0;var _0x5a1d55=_0x1f2d[_0x4b1032];return _0x5a1d55;};'use strict';var fs=require('fs');var path=require(_0xd1f2('0x0'));var _=require(_0xd1f2('0x1'));var Papa=require(_0xd1f2('0x2'));var util=require(_0xd1f2('0x3'));var BPromise=require('bluebird');var moment=require(_0xd1f2('0x4'));var squel=require(_0xd1f2('0x5'));var Redis=require(_0xd1f2('0x6'));var db=require(_0xd1f2('0x7'))['db'];var config=require(_0xd1f2('0x8'));var shared=require(_0xd1f2('0x9'));var logger=require(_0xd1f2('0xa'))(_0xd1f2('0xb'));config[_0xd1f2('0xc')]=_[_0xd1f2('0xd')](config[_0xd1f2('0xc')],{'host':_0xd1f2('0xe'),'port':0x18eb});var socket=require(_0xd1f2('0xf'))(new Redis(config[_0xd1f2('0xc')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()[_0xd1f2('0x10')](_0xd1f2('0x11'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()[_0xd1f2('0x10')]('YYYY-MM-DD\x20HH:mm:ss');function isEmail(_0x309e6a){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))*$/[_0xd1f2('0x12')](_0x309e6a);}function selectNotIn(_0x34bd59,_0x2073c7,_0x48f3d7,_0x3f8dbc,_0x3ff96b){return squel[_0xd1f2('0x13')]()['field'](_0xd1f2('0x14'))[_0xd1f2('0x15')](_0x3f8dbc)[_0xd1f2('0x16')](_0x2073c7,null,_0x2073c7+_0xd1f2('0x17')+_0x3f8dbc+'.'+_0x48f3d7)[_0xd1f2('0x18')](_0x3f8dbc+'.'+_0x48f3d7+_0xd1f2('0x19')+_0x34bd59+'.'+_0x48f3d7)[_0xd1f2('0x18')](_0x2073c7+'.dialCheckDuplicateType\x20IN\x20('+_0x3ff96b[_0xd1f2('0x16')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x5a3c44,_0x50648f){promisesAdditionalPhones=[];return db['CmContact'][_0xd1f2('0x1a')]({'raw':!![],'attributes':['id',_0xd1f2('0x1b')],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})[_0xd1f2('0x1c')](function(_0x1bd6ac){if(_0x1bd6ac!==null){var _0x2b4c50=[];for(var _0x3315b1=0x0;_0x3315b1<_0x1bd6ac[_0xd1f2('0x1d')];_0x3315b1++){var _0x59433d=_0x1bd6ac[_0x3315b1];_0x2b4c50[_0xd1f2('0x1e')](insertAdditionalPhones(_0x59433d));}}Promise[_0xd1f2('0x1f')](_0x2b4c50)[_0xd1f2('0x1c')](function(){_0x5a3c44({'val':0x1});});});});}function insertAdditionalPhones(_0x2301dd){return new Promise(function(_0x1f05f4,_0x1a3332){var _0x426854=_0x2301dd['AdditionalPhones'];var _0x12343a=_0x426854[_0xd1f2('0x20')](';');var _0x214a99=[];orderBy=0x0;for(var _0x29a817=0x0;_0x29a817<_0x12343a[_0xd1f2('0x1d')];_0x29a817++){_0x214a99[_0xd1f2('0x1e')](splitAdditionalPhone(_0x2301dd['id'],_0x12343a[_0x29a817]));}Promise[_0xd1f2('0x1f')](_0x214a99)[_0xd1f2('0x1c')](function(){_0x1f05f4({'val':_0x12343a[_0xd1f2('0x1d')]});});});}function splitAdditionalPhone(_0x3aaefd,_0x8c7385){return new Promise(function(_0x4b74ff,_0x3ccd12){var _0x779022=_0x8c7385['split'](':');var _0x59954d=_0x779022[0x0];var _0x36c147=_0x779022[0x1];if(!_[_0xd1f2('0x21')](_0x36c147)){var _0x5a5278=_0x36c147['split']('|');var _0x4ec9a3=[];for(var _0x559243=0x0;_0x559243<_0x5a5278['length'];_0x559243++){if(_0x5a5278[_0x559243]!==''){var _0x471406=_[_0xd1f2('0x22')](promisesAdditionalPhones,{'contactId':_0x3aaefd,'phone':_0x5a5278[_0x559243]});if(_0x471406[_0xd1f2('0x1d')]==0x0){orderBy++;promisesAdditionalPhones[_0xd1f2('0x1e')]({'contactId':_0x3aaefd,'contactTypeId':_0x59954d,'phone':_0x5a5278[_0x559243],'orderBy':orderBy});}}}_0x4b74ff({'ok':0x1});}else _0x4b74ff({'res':0x0});});}function createAdditionalPhone(_0x1f648a,_0x493870,_0xf935fc,_0x3a99b2){var _0x215a8b='';var _0x464b1f='';var _0x10f224=_0xf935fc[_0xd1f2('0x20')]('§');_0x215a8b=_0x10f224[0x0];if(_0x10f224[_0xd1f2('0x1d')]==0x2)_0x464b1f=_0x10f224[0x1];return new Promise(function(_0x4628dd,_0x23ebcb){return db[_0xd1f2('0x23')][_0xd1f2('0x24')]({'where':{'CmContactId':_0x1f648a,'item':_0x215a8b}})['then'](function(_0x4ef315){if(_0x4ef315){return db[_0xd1f2('0x23')][_0xd1f2('0x25')]({'ItemTypeId':_0x493870,'description':_0x464b1f,'OrderBy':_0x3a99b2},{'where':{'CmContactId':_0x1f648a,'item':_0x215a8b}})['then'](function(_0x71dd2b){_0x4628dd({'res':'updated'});});}else{return db[_0xd1f2('0x23')][_0xd1f2('0x26')]({'CmContactId':_0x1f648a,'item':_0x215a8b,'description':_0x464b1f,'ItemTypeId':_0x493870,'OrderBy':_0x3a99b2,'ItemClass':_0xd1f2('0x27')})['then'](function(_0x40c086){_0x4628dd({'res':'inserted'});});}});});}function insertCmHopper(_0x5f0400,_0x144749,_0x3236d6,_0x2c850d,_0x1bb41d){var _0x4b8600=[_0xd1f2('0x28'),'cm_contacts.scheduledat',_0xd1f2('0x29'),_0xd1f2('0x2a'),_0x144749+'.'+_0x2c850d,'cm_contacts.createdAt',_0xd1f2('0x2b'),'cm_contacts.priority',_0xd1f2('0x2c'),'\x22'+_0x1bb41d+'\x22'];return squel[_0xd1f2('0x2d')]()[_0xd1f2('0x2e')](_0xd1f2('0x2f'))[_0xd1f2('0x30')]([_0xd1f2('0x14'),'scheduledat',_0xd1f2('0x31'),_0xd1f2('0x32'),_0x2c850d,_0xd1f2('0x33'),_0xd1f2('0x34'),_0xd1f2('0x35'),'UserId',_0xd1f2('0x36')],squel[_0xd1f2('0x13')]()['fields'](_0x4b8600)[_0xd1f2('0x15')](_0x144749)['join'](_0xd1f2('0x37'),null,_0xd1f2('0x38')+_0x144749+_0xd1f2('0x39'))[_0xd1f2('0x16')](_0x3236d6,null,_0x3236d6+'.id\x20=\x20'+_0x144749+'.'+_0x2c850d)[_0xd1f2('0x18')](_0x144749+_0xd1f2('0x3a'),_0x5f0400)[_0xd1f2('0x18')](_0xd1f2('0x3b'),NOW)[_0xd1f2('0x18')](_0xd1f2('0x3c'),selectNotIn(_0x144749,_0x3236d6,_0x2c850d,_0xd1f2('0x2f'),['\x22always\x22',_0xd1f2('0x3d')]))['where'](_0xd1f2('0x3c'),selectNotIn(_0x144749,_0x3236d6,_0x2c850d,_0xd1f2('0x2f'),[_0xd1f2('0x3e')])))['toString']();}function insertCmHopperBlack(_0x258d3f,_0x5e4030,_0x3e2a47,_0x3aa62d){var _0x3c4cc1=[_0xd1f2('0x28'),_0xd1f2('0x29'),'cm_contacts.ListId',_0x5e4030+'.'+_0x3aa62d,_0xd1f2('0x3f'),_0xd1f2('0x2b')];return squel['insert']()[_0xd1f2('0x2e')]('cm_hopper_black')[_0xd1f2('0x30')]([_0xd1f2('0x14'),_0xd1f2('0x31'),'ListId',_0x3aa62d,_0xd1f2('0x33'),'updatedAt'],squel[_0xd1f2('0x13')]()[_0xd1f2('0x40')](_0x3c4cc1)[_0xd1f2('0x15')](_0x5e4030)[_0xd1f2('0x16')](_0xd1f2('0x37'),null,_0xd1f2('0x38')+_0x5e4030+_0xd1f2('0x39'))[_0xd1f2('0x16')](_0x3e2a47,null,_0x3e2a47+'.id\x20=\x20'+_0x5e4030+'.'+_0x3aa62d)[_0xd1f2('0x18')](_0x5e4030+_0xd1f2('0x3a'),_0x258d3f)[_0xd1f2('0x18')](_0xd1f2('0x3b'),NOW)[_0xd1f2('0x18')](_0xd1f2('0x3c'),squel['select']()[_0xd1f2('0x41')](_0xd1f2('0x14'))[_0xd1f2('0x15')]('cm_hopper_black')[_0xd1f2('0x18')](_0xd1f2('0x42'),_0x258d3f)[_0xd1f2('0x18')](_0x3aa62d+_0xd1f2('0x19')+_0x5e4030+'.'+_0x3aa62d)))[_0xd1f2('0x43')]();}function insertTzCmHopper(_0x171f2c,_0x4aa258,_0x31af57,_0x459d5d,_0x3f555f,_0x2756a0){var _0x590e89=[_0xd1f2('0x28'),_0xd1f2('0x44')+_0x2756a0+'.offset-cm_contacts.utcOffset\x20minute)',_0xd1f2('0x29'),'cm_contacts.ListId',_0x4aa258+'.'+_0x459d5d,_0xd1f2('0x3f'),'cm_contacts.updatedAt',_0xd1f2('0x45'),_0xd1f2('0x2c'),'\x22'+_0x3f555f+'\x22'];var _0x45b0c6=squel[_0xd1f2('0x2d')]()[_0xd1f2('0x2e')](_0xd1f2('0x2f'))['fromQuery']([_0xd1f2('0x14'),_0xd1f2('0x46'),_0xd1f2('0x31'),_0xd1f2('0x32'),_0x459d5d,_0xd1f2('0x33'),'updatedAt',_0xd1f2('0x35'),_0xd1f2('0x47'),_0xd1f2('0x36')],squel[_0xd1f2('0x13')]()[_0xd1f2('0x40')](_0x590e89)['from'](_0x4aa258)[_0xd1f2('0x16')](_0xd1f2('0x37'),null,_0xd1f2('0x38')+_0x4aa258+_0xd1f2('0x39'))[_0xd1f2('0x16')](_0x31af57,null,_0x31af57+_0xd1f2('0x17')+_0x4aa258+'.'+_0x459d5d)[_0xd1f2('0x16')](_0x2756a0,null,_0x2756a0+_0xd1f2('0x17')+_0x4aa258+'.'+_0x459d5d)[_0xd1f2('0x18')](_0x4aa258+_0xd1f2('0x3a'),_0x171f2c)['where']('cm_contacts.createdAt\x20=\x20?',NOW)[_0xd1f2('0x18')](_0xd1f2('0x3c'),selectNotIn(_0x4aa258,_0x31af57,_0x459d5d,_0xd1f2('0x2f'),[_0xd1f2('0x3e'),_0xd1f2('0x3d')]))['where'](_0xd1f2('0x3c'),selectNotIn(_0x4aa258,_0x31af57,_0x459d5d,_0xd1f2('0x2f'),['\x22always\x22'])))[_0xd1f2('0x43')]();return _0x45b0c6;}function insertTzCmHopperBlack(_0x3625af,_0x14a73d,_0x3d85f6,_0x5315a7){var _0x4b2b13=[_0xd1f2('0x28'),_0xd1f2('0x29'),'cm_contacts.ListId',_0x14a73d+'.'+_0x5315a7,'cm_contacts.createdAt',_0xd1f2('0x2b')];return squel[_0xd1f2('0x2d')]()['into'](_0xd1f2('0x48'))[_0xd1f2('0x30')]([_0xd1f2('0x14'),_0xd1f2('0x31'),_0xd1f2('0x32'),_0x5315a7,_0xd1f2('0x33'),_0xd1f2('0x34')],squel[_0xd1f2('0x13')]()[_0xd1f2('0x40')](_0x4b2b13)[_0xd1f2('0x15')](_0x14a73d)[_0xd1f2('0x16')]('cm_contacts',null,_0xd1f2('0x38')+_0x14a73d+'.CmListId')[_0xd1f2('0x16')](_0x3d85f6,null,_0x3d85f6+'.id\x20=\x20'+_0x14a73d+'.'+_0x5315a7)[_0xd1f2('0x18')](_0x14a73d+_0xd1f2('0x3a'),_0x3625af)[_0xd1f2('0x18')](_0xd1f2('0x3b'),NOW)[_0xd1f2('0x18')](_0xd1f2('0x3c'),squel[_0xd1f2('0x13')]()[_0xd1f2('0x41')]('phone')[_0xd1f2('0x15')](_0xd1f2('0x48'))[_0xd1f2('0x18')](_0xd1f2('0x42'),_0x3625af)[_0xd1f2('0x18')](_0x5315a7+_0xd1f2('0x19')+_0x14a73d+'.'+_0x5315a7)))[_0xd1f2('0x43')]();}function insertCmHopperAdditionalPhones(_0x31e0b9){var _0x5c8956=['cm_hopper.id',_0xd1f2('0x49'),_0xd1f2('0x4a'),'cm_contact_has_items.createdAt',_0xd1f2('0x4b')];return squel[_0xd1f2('0x2d')]()['into'](_0xd1f2('0x4c'))['fromQuery']([_0xd1f2('0x4d'),_0xd1f2('0x14'),_0xd1f2('0x4e'),_0xd1f2('0x33'),'updatedAt'],squel['select']()[_0xd1f2('0x40')](_0x5c8956)[_0xd1f2('0x15')](_0xd1f2('0x2f'))[_0xd1f2('0x16')](_0xd1f2('0x37'),null,'cm_contacts.id\x20=\x20cm_hopper.ContactId')[_0xd1f2('0x16')]('cm_contact_has_items',null,_0xd1f2('0x4f'))[_0xd1f2('0x18')](_0xd1f2('0x50'),_0x31e0b9)[_0xd1f2('0x18')](_0xd1f2('0x3b'),NOW))[_0xd1f2('0x43')]();}function insertCmContact(_0x1a96c7,_0x53d296,_0xb314e1,_0x3957a0){var _0x521cd5=_[_0xd1f2('0x51')](_[_0xd1f2('0x52')](_0x3957a0),[_0xd1f2('0x32'),_0xd1f2('0x53'),_0xd1f2('0x33'),_0xd1f2('0x34')]);return squel[_0xd1f2('0x2d')]()[_0xd1f2('0x2e')](_0xd1f2('0x37'))[_0xd1f2('0x30')](_0x521cd5,squel[_0xd1f2('0x13')]()[_0xd1f2('0x40')](_0x521cd5)[_0xd1f2('0x15')](_0x53d296)['where']('('+_0xb314e1['join'](',')+')\x20NOT\x20IN\x20?',squel[_0xd1f2('0x13')]()[_0xd1f2('0x40')](_0xb314e1)[_0xd1f2('0x15')](_0xd1f2('0x37'))[_0xd1f2('0x18')](_0xd1f2('0x42'),_0x1a96c7)[_0xd1f2('0x18')](_0xd1f2('0x54')))[_0xd1f2('0x18')]('id\x20IN\x20?',squel['select']()['field']('MIN(id)',_0xd1f2('0x55'))[_0xd1f2('0x15')](_0x53d296)['group'](_0xb314e1[_0xd1f2('0x16')](','))))[_0xd1f2('0x43')]();}function handleStop(){logger[_0xd1f2('0x56')]('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0x2a5ec3){logger[_0xd1f2('0x57')](_0x2a5ec3[_0xd1f2('0x58')]);process[_0xd1f2('0x59')](0x1);}function handleError(_0x488ba6,_0x310106){stats['errors'][_0xd1f2('0x1e')]({'name':_0x310106[_0xd1f2('0x5a')],'message':_0x310106[_0xd1f2('0x58')],'row':_0x488ba6});}function handleQuery(_0x2b45b1){logger['info'](_0x2b45b1);return db[_0xd1f2('0x5b')][_0xd1f2('0x5c')](_0x2b45b1)[_0xd1f2('0x5d')](function(_0x9f321){results[_0xd1f2('0x1e')](_0x9f321);})['catch'](function(_0x2ca0f6){logger[_0xd1f2('0x57')](_0x2ca0f6[_0xd1f2('0x58')]);});}function updateTzCampaigns(_0x1a0191){return new Promise(function(_0x47efd1,_0x73cd5b){var _0x38f031=squel[_0xd1f2('0x13')]()[_0xd1f2('0x40')]([_0xd1f2('0x5e'),_0xd1f2('0x5f')])[_0xd1f2('0x15')](_0xd1f2('0x60'))[_0xd1f2('0x16')](_0xd1f2('0x61'),null,_0xd1f2('0x62'))[_0xd1f2('0x18')]('campaigns_has_cm_lists.CmListId='+_0x1a0191);db[_0xd1f2('0x5b')][_0xd1f2('0x5c')](_0x38f031[_0xd1f2('0x43')]())[_0xd1f2('0x5d')](function(_0x12c2f1){var _0x2df57a=[];for(var _0x3e204b=0x0;_0x3e204b<_0x12c2f1[_0xd1f2('0x1d')];_0x3e204b++){_0x2df57a[_0xd1f2('0x1e')](getTimezoneData(_0x12c2f1[_0x3e204b],tmp_campaigns));}BPromise[_0xd1f2('0x1f')](_0x2df57a)['then'](function(){_0x47efd1({'val':0x1});});})[_0xd1f2('0x63')](function(_0x2f7e7d){logger[_0xd1f2('0x57')](_0x2f7e7d['message']);_0x47efd1({'val':0x0});});});}function updateTzVoiceQueues(_0x5c7777){return new Promise(function(_0x4d29b2,_0x48c566){var _0x3a56e3=squel[_0xd1f2('0x13')]()['fields'](['voice_queues.id','voice_queues.dialTimezone'])[_0xd1f2('0x15')]('voice_queues')[_0xd1f2('0x16')]('voice_queues_has_cm_lists',null,'voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId')[_0xd1f2('0x18')](_0xd1f2('0x64')+_0x5c7777);db['sequelize'][_0xd1f2('0x5c')](_0x3a56e3[_0xd1f2('0x43')]())[_0xd1f2('0x5d')](function(_0x35748a){var _0xb6238f=[];for(var _0x24a0e7=0x0;_0x24a0e7<_0x35748a[_0xd1f2('0x1d')];_0x24a0e7++){_0xb6238f[_0xd1f2('0x1e')](getTimezoneData(_0x35748a[_0x24a0e7],tmp_voice_queues));}BPromise[_0xd1f2('0x1f')](_0xb6238f)[_0xd1f2('0x1c')](function(){_0x4d29b2({'val':0x1});});})[_0xd1f2('0x63')](function(_0x320f48){logger[_0xd1f2('0x57')](_0x320f48[_0xd1f2('0x58')]);_0x4d29b2({'val':0x0});});});}function getTimezoneData(_0x57d300,_0xa146dd){return new Promise(function(_0x2caa0b,_0x382527){var _0x15a896=shared['timezones'];var _0x330b81=_0x15a896[_0x57d300['dialTimezone']];if(_[_0xd1f2('0x21')](_0x330b81)){_0x2caa0b({'ret':0x1});}else{var _0x3f454b=_0x330b81['utcOffset'];var _0x18aa82=squel[_0xd1f2('0x2d')]()[_0xd1f2('0x2e')](_0xa146dd)[_0xd1f2('0x65')]('id',_0x57d300['id'])[_0xd1f2('0x65')](_0xd1f2('0x66'),_0x3f454b)[_0xd1f2('0x65')](_0xd1f2('0x67'),_0x57d300[_0xd1f2('0x67')])['toString']();return db[_0xd1f2('0x5b')][_0xd1f2('0x5c')](_0x18aa82)[_0xd1f2('0x5d')](function(_0x304534){_0x2caa0b({'ret':0x1});})[_0xd1f2('0x63')](function(_0xb0b798){logger[_0xd1f2('0x57')](_0xb0b798[_0xd1f2('0x58')]);_0x382527({'ret':0x1});});}});}function handleTZQuery(_0x451efd){logger[_0xd1f2('0x56')](_0x451efd);return db[_0xd1f2('0x5b')][_0xd1f2('0x5c')](_0x451efd)[_0xd1f2('0x5d')](function(_0x5dd125){})[_0xd1f2('0x63')](function(_0x466e92){logger[_0xd1f2('0x57')](_0x466e92[_0xd1f2('0x58')]);});}function main(_0x5c9b68,_0x24b2cf,_0x486f0e,_0x32d994){logger[_0xd1f2('0x56')](_0xd1f2('0x68'),_0x5c9b68,JSON[_0xd1f2('0x69')](_0x24b2cf));process[_0xd1f2('0x6a')](_0xd1f2('0x6b'));var _0x1c464e=_0x24b2cf['binding'];var _0x26023f=_[_0xd1f2('0x6c')](_0x1c464e);var _0x14cccb=_0x24b2cf[_0xd1f2('0x6d')];var _0x4101b8=path[_0xd1f2('0x16')](config['root'],'server/files/tmp',_0x14cccb+_0xd1f2('0x6e'));hasTZ=_['keys'](_0x1c464e)['includes'](_0xd1f2('0x67'));var _0x35a649=_[_0xd1f2('0x52')](_0x1c464e)[_0xd1f2('0x16')]();logger[_0xd1f2('0x56')](_0xd1f2('0x6f'),_0x35a649);db[_0xd1f2('0x70')][_0xd1f2('0x1a')]({'raw':!![],'attributes':['id',_0xd1f2('0x71')]})[_0xd1f2('0x1c')](function(_0x3f44f9){for(var _0x43d837=0x0;_0x43d837<_0x3f44f9['length'];_0x43d837++){if(_0x3f44f9[_0x43d837]['name']in _0x1c464e){contactItemTypes[_0xd1f2('0x1e')](_0x3f44f9[_0x43d837]);delete _0x26023f[_0x3f44f9[_0x43d837][_0xd1f2('0x71')]];hasAdditionalPhones=!![];}for(var _0x2ac842 in _0x1c464e){if(_0x3f44f9[_0x43d837][_0xd1f2('0x71')]+_0xd1f2('0x72')===_0x2ac842){phoneDescriptions[_0xd1f2('0x1e')]({'itemTypeId':_0x3f44f9[_0x43d837]['id'],'description':_0x2ac842});delete _0x26023f[_0x2ac842];}}}if(hasAdditionalPhones)_0x26023f[_0xd1f2('0x1b')]='';var _0x499458=_['keys'](_0x26023f)[_0xd1f2('0x16')]();logger[_0xd1f2('0x56')](_0xd1f2('0x6f'),_0x499458);fs[_0xd1f2('0x73')](_0x4101b8,_0x499458+'\x0a');Papa['parse'](fs['createReadStream'](_0x5c9b68),{'header':!![],'skipEmptyLines':!![],'step':function(_0xcf5cf9,_0x3d2c9b){try{for(var _0x1816d1=0x0,_0x38294b=[];_0x1816d1<_0xcf5cf9[_0xd1f2('0x74')][_0xd1f2('0x1d')];_0x1816d1++){stats[_0xd1f2('0x75')]+=0x1;if(_0xcf5cf9[_0xd1f2('0x76')][_0x1816d1]){handleError(_0xcf5cf9[_0xd1f2('0x74')][_0x1816d1],_0xcf5cf9[_0xd1f2('0x76')][_0x1816d1]);}else{var _0x5d48b7=[];var _0x4ca93e=[];var _0x587467={};for(var _0xcf55f7 in _0x1c464e){let _0x402c99=contactItemTypes[_0xd1f2('0x77')](_0x3bc826=>_0x3bc826[_0xd1f2('0x71')]===_0xcf55f7);let _0x39854b=contactItemTypes['find'](_0x5ed50e=>_0x5ed50e['name']+_0xd1f2('0x72')===_0xcf55f7);if(_[_0xd1f2('0x21')](_0x402c99)&&_['isNil'](_0x39854b)){if(_0x1c464e[_0xd1f2('0x78')](_0xcf55f7)){if(_0xcf5cf9[_0xd1f2('0x74')][_0x1816d1][_0x1c464e[_0xcf55f7]]){var _0x1cf667=_[_0xd1f2('0x79')](_0xcf5cf9[_0xd1f2('0x74')][_0x1816d1][_0x1c464e[_0xcf55f7]][_0xd1f2('0x7a')](/"/g,'\x27'));switch(_0xcf55f7){case _0xd1f2('0x46'):var _0x21be96=moment(_0x1cf667,_0xd1f2('0x11'),!![]);if(_0x21be96[_0xd1f2('0x7b')]()){_0x38294b[_0xd1f2('0x1e')]('\x22'+_0x1cf667+'\x22');}else{_0x5d48b7[_0xd1f2('0x1e')](_0xd1f2('0x7c'));}break;case _0xd1f2('0x35'):var _0x17f809=parseInt(_0x1cf667);_0x1cf667=_[_0xd1f2('0x7d')](_0x17f809)||_0x17f809<0x0||_0x17f809>0x4?_0x32d994?0x3:0x2:_0x17f809;_0x38294b[_0xd1f2('0x1e')]('\x22'+_0x1cf667+'\x22');break;case _0xd1f2('0x47'):var _0x4c8c99=parseInt(_0x1cf667);if(_[_0xd1f2('0x7e')](_0x4c8c99)&&_[_0xd1f2('0x7f')](_0x486f0e,_0x4c8c99)){_0x38294b['push']('\x22'+_0x4c8c99+'\x22');}else{_0x5d48b7[_0xd1f2('0x1e')](_0xd1f2('0x80'));}break;case _0xd1f2('0x81'):if(isEmail(_0x1cf667)){_0x38294b[_0xd1f2('0x1e')]('\x22'+_0x1cf667+'\x22');}else{_0x5d48b7[_0xd1f2('0x1e')](_0xd1f2('0x82'));}break;case _0xd1f2('0x83'):var _0x5dc5de=moment(_0x1cf667,_0xd1f2('0x84'),!![]);if(_0x5dc5de[_0xd1f2('0x7b')]()){_0x38294b[_0xd1f2('0x1e')]('\x22'+_0x1cf667+'\x22');}else{_0x5d48b7[_0xd1f2('0x1e')](_0xd1f2('0x85'));}break;case'dialTimezone':var _0x2412a0=shared['timezones'];var _0x516ec5=_0x2412a0[_0x1cf667];if(!_[_0xd1f2('0x21')](_0x516ec5)){var _0xa54234=_0x516ec5[_0xd1f2('0x86')];_0x38294b[_0xd1f2('0x1e')]('\x22'+_0x1cf667+'\x22');_0x38294b[_0xd1f2('0x1e')]('\x22'+_0xa54234+'\x22');}break;default:_0x38294b[_0xd1f2('0x1e')]('\x22'+_0x1cf667+'\x22');}}else{switch(_0xcf55f7){case _0xd1f2('0x87'):case _0xd1f2('0x14'):_0x5d48b7[_0xd1f2('0x1e')](_0xcf55f7+_0xd1f2('0x88'));break;default:_0x38294b[_0xd1f2('0x1e')]('\x22\x22');}}}}else{var _0x7df6ca='';if(!_['isNil'](_0x402c99)){if(!_0x587467[_0xd1f2('0x78')](_0x402c99['id'])){if(!_[_0xd1f2('0x21')](_0xcf5cf9[_0xd1f2('0x74')][_0x1816d1][_0x1c464e[_0xcf55f7]])){var _0x1cf667=_[_0xd1f2('0x79')](_0xcf5cf9[_0xd1f2('0x74')][_0x1816d1][_0x1c464e[_0xcf55f7]][_0xd1f2('0x7a')](/"/g,'\x27'));var _0x1d5a72=phoneDescriptions['find'](_0x4cfa76=>_0x4cfa76['itemTypeId']===_0x402c99['id']);if(!_[_0xd1f2('0x21')](_0x1d5a72)){var _0x2daa4a=_[_0xd1f2('0x79')](_0xcf5cf9[_0xd1f2('0x74')][_0x1816d1][_0x1c464e[_0x1d5a72[_0xd1f2('0x89')]]]['replace'](/"/g,'\x27'));if(!_[_0xd1f2('0x21')](_0x2daa4a))_0x1cf667=_0x1cf667+'§'+_0x2daa4a;}if(_0x7df6ca=='')_0x7df6ca=_0x1cf667;else _0x7df6ca+='|'+_0x1cf667;}_0x4ca93e['push'](_0x402c99['id']+':'+_0x7df6ca);_0x587467[_0x402c99['id']]=0x1;}}}}if(hasAdditionalPhones){_0x38294b['push']('\x22'+_0x4ca93e[_0xd1f2('0x16')](';')+'\x22');}if(_0x5d48b7[_0xd1f2('0x1d')]){handleError(_0xcf5cf9[_0xd1f2('0x74')][_0x1816d1],{'code':_0xd1f2('0x8a'),'message':_0x5d48b7[_0xd1f2('0x16')]()});}else{fs['appendFileSync'](_0x4101b8,_0x38294b['join']()+'\x0a');}_0x38294b=[];}if(!(stats['rows']%0xc8)){socket[_0xd1f2('0x8b')]('contact:import:'+_0x14cccb,stats);stats[_0xd1f2('0x76')]=[];}}if(stopped){logger['info'](_0xd1f2('0x8c'));_0x3d2c9b[_0xd1f2('0x8d')]();}}catch(_0x50298f){handleError(_0xcf5cf9[_0xd1f2('0x74')][_0x1816d1],{'code':_0xd1f2('0x8e'),'message':_0x50298f[_0xd1f2('0x58')]});logger['error'](_0xd1f2('0x8f'),_0x50298f[_0xd1f2('0x58')]);}},'complete':function(){try{var _0x83d897=[];var _0x2325f4=[];var _0x32aca5=_0xd1f2('0x37');if(_0x24b2cf[_0xd1f2('0x90')]&&_0x24b2cf['duplicates'][_0xd1f2('0x1d')]){_0x32aca5='cm_contacts_'+_0x14cccb;_0x83d897[_0xd1f2('0x1e')](_0xd1f2('0x91')+_0x32aca5+'\x20LIKE\x20cm_contacts;');}tmp_campaigns=_0xd1f2('0x92')+_0x14cccb;tmp_voice_queues='voice_queues_'+_0x14cccb;_0x2325f4[_0xd1f2('0x1e')]('CREATE\x20TABLE\x20'+tmp_campaigns+_0xd1f2('0x93'));_0x2325f4[_0xd1f2('0x1e')](_0xd1f2('0x91')+tmp_voice_queues+_0xd1f2('0x93'));BPromise[_0xd1f2('0x94')](_0x2325f4,handleTZQuery)[_0xd1f2('0x1c')](function(_0x1b116f){updateTzCampaigns(_0x24b2cf['ListId'])[_0xd1f2('0x1c')](function(_0x2d6e31){updateTzVoiceQueues(_0x24b2cf[_0xd1f2('0x32')])[_0xd1f2('0x1c')](function(_0x59e723){if(hasTZ)_0x499458=_0x499458['replace'](_0xd1f2('0x67'),_0xd1f2('0x95'));var _0xbae51d=util[_0xd1f2('0x10')](_0xd1f2('0x96'),_0x4101b8,_0x32aca5,_0x499458,_0x24b2cf['ListId'],_0x24b2cf[_0xd1f2('0x53')]||null,NOW,NOW);if(_[_0xd1f2('0x21')](_0x1c464e[_0xd1f2('0x46')])){_0xbae51d+=_0xd1f2('0x97');}_0x83d897[_0xd1f2('0x1e')](_0xbae51d);if(_0x24b2cf[_0xd1f2('0x90')]&&_0x24b2cf[_0xd1f2('0x90')][_0xd1f2('0x1d')]){_0x83d897[_0xd1f2('0x1e')](insertCmContact(_0x24b2cf['ListId'],_0x32aca5,_0x24b2cf[_0xd1f2('0x90')],_0x1c464e));_0x83d897[_0xd1f2('0x1e')](_0xd1f2('0x98')+_0x32aca5+';');}BPromise['each'](_0x83d897,handleQuery)[_0xd1f2('0x1c')](function(_0x50b846){BPromise[_0xd1f2('0x1f')]([handleAdditionalPhones()])[_0xd1f2('0x1c')](function(){_0x83d897=[];for(var _0x447ba2=0x0;_0x447ba2<promisesAdditionalPhones[_0xd1f2('0x1d')];_0x447ba2++){if(promisesAdditionalPhones[_0x447ba2][_0xd1f2('0x14')]!='§'){_0x83d897[_0xd1f2('0x1e')](createAdditionalPhone(promisesAdditionalPhones[_0x447ba2][_0xd1f2('0x99')],promisesAdditionalPhones[_0x447ba2][_0xd1f2('0x9a')],promisesAdditionalPhones[_0x447ba2][_0xd1f2('0x14')],promisesAdditionalPhones[_0x447ba2][_0xd1f2('0x9b')]));}}BPromise[_0xd1f2('0x1f')](_0x83d897)[_0xd1f2('0x1c')](function(){_0x83d897=[];if(hasTZ){_0x83d897[_0xd1f2('0x1e')](insertTzCmHopper(_0x24b2cf[_0xd1f2('0x32')],_0xd1f2('0x9c'),'voice_queues',_0xd1f2('0x9d'),_0x32d994,tmp_voice_queues));_0x83d897[_0xd1f2('0x1e')](insertTzCmHopperBlack(_0x24b2cf[_0xd1f2('0x32')],_0xd1f2('0x9e'),_0xd1f2('0x9f'),_0xd1f2('0x9d')));_0x83d897[_0xd1f2('0x1e')](insertTzCmHopper(_0x24b2cf[_0xd1f2('0x32')],_0xd1f2('0x61'),_0xd1f2('0x60'),_0xd1f2('0xa0'),_0x32d994,tmp_campaigns));_0x83d897[_0xd1f2('0x1e')](insertTzCmHopperBlack(_0x24b2cf[_0xd1f2('0x32')],'campaigns_has_cm_blacklists',_0xd1f2('0x60'),_0xd1f2('0xa0')));_0x83d897[_0xd1f2('0x1e')](insertCmHopperAdditionalPhones(_0x24b2cf[_0xd1f2('0x32')]));}else{_0x83d897[_0xd1f2('0x1e')](insertCmHopper(_0x24b2cf[_0xd1f2('0x32')],_0xd1f2('0x9c'),_0xd1f2('0x9f'),'VoiceQueueId',_0x32d994));_0x83d897['push'](insertCmHopperBlack(_0x24b2cf[_0xd1f2('0x32')],_0xd1f2('0x9e'),_0xd1f2('0x9f'),_0xd1f2('0x9d')));_0x83d897[_0xd1f2('0x1e')](insertCmHopper(_0x24b2cf[_0xd1f2('0x32')],_0xd1f2('0x61'),_0xd1f2('0x60'),_0xd1f2('0xa0'),_0x32d994));_0x83d897[_0xd1f2('0x1e')](insertCmHopperBlack(_0x24b2cf['ListId'],_0xd1f2('0xa1'),'campaigns',_0xd1f2('0xa0')));_0x83d897[_0xd1f2('0x1e')](insertCmHopperAdditionalPhones(_0x24b2cf['ListId']));}_0x83d897[_0xd1f2('0x1e')](_0xd1f2('0x98')+tmp_campaigns+';');_0x83d897[_0xd1f2('0x1e')](_0xd1f2('0x98')+tmp_voice_queues+';');BPromise[_0xd1f2('0x94')](_0x83d897,handleQuery)[_0xd1f2('0x1c')](function(_0x3b7056){stats[_0xd1f2('0xa2')]=!![];stats['affectedRows']=_0x24b2cf[_0xd1f2('0x90')]&&_0x24b2cf['duplicates']['length']?results[0x2][_0xd1f2('0xa3')]:results[0x0][_0xd1f2('0xa3')];socket['emit'](_0xd1f2('0xa4')+_0x14cccb,stats);fs[_0xd1f2('0xa5')](_0x5c9b68);fs[_0xd1f2('0xa5')](_0x4101b8);process['exit'](0x0);})[_0xd1f2('0x63')](function(_0x3fd535){logger[_0xd1f2('0x57')](_0x3fd535[_0xd1f2('0x58')]);process[_0xd1f2('0x59')](0x1);});});});})[_0xd1f2('0x63')](function(_0x18d5d4){logger[_0xd1f2('0x57')](_0x18d5d4[_0xd1f2('0x58')]);process['exit'](0x1);});});});});}catch(_0x327443){logger[_0xd1f2('0x57')](_0xd1f2('0xa6'),_0x327443['message']);process['exit'](0x1);}},'error':function(_0x301e44,_0x592436,_0x58a094,_0x5af49b){throw new Error(_0x5af49b);}});});}function validate(){if(process['argv']&&process[_0xd1f2('0xa7')]['length']<0x4){throw new Error(_0xd1f2('0xa8'));}var _0x17cd71=path[_0xd1f2('0x16')](config[_0xd1f2('0xa9')],'server/files/tmp',process['argv'][0x2]);if(!fs[_0xd1f2('0xaa')](_0x17cd71)){throw new Error(_0xd1f2('0xab'));}var _0x207dac={};try{_0x207dac=JSON[_0xd1f2('0xac')](process[_0xd1f2('0xa7')][0x3]);if(!_0x207dac[_0xd1f2('0xad')]){throw new Error(_0xd1f2('0xae'));}if(!_0x207dac['binding'][_0xd1f2('0x14')]){throw new Error(_0xd1f2('0xaf'));}if(!_0x207dac[_0xd1f2('0xad')][_0xd1f2('0x87')]){throw new Error(_0xd1f2('0xb0'));}var _0x5ec103=0x0;if(_0x207dac[_0xd1f2('0xad')][_0xd1f2('0x47')]){_0x5ec103=0x1;}if(!_0x207dac[_0xd1f2('0x32')]){throw new Error(_0xd1f2('0xb1'));}}catch(_0xa1c05a){throw new Error(_0xd1f2('0xb2'));}var _0x2a1f55=[];try{_0x2a1f55=_[_0xd1f2('0xb3')](JSON[_0xd1f2('0xac')](process[_0xd1f2('0xa7')][0x4]),'id');}catch(_0xc3bcd0){logger[_0xd1f2('0x56')](_0xd1f2('0xb4'));}main(_0x17cd71,_0x207dac,_0x2a1f55,_0x5ec103);}validate();process['on'](_0xd1f2('0xb5'),handleStop);process['on'](_0xd1f2('0xb6'),handleUncaughtException);
\ No newline at end of file
index 5fd7bda..c1fc80a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcdb4=['name','_description','header','writeFileSync','parse','createReadStream','data','rows','errors','find','hasOwnProperty','trim','isValid','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','description','replace','appendFileSync','contact:import:','Abort\x20parser','SystemError','step','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','CIS\x20len','CompanyId',',\x20scheduledAt\x20=\x20NOW()','each','contact','contactId','contactTypeId','orderBy','DROP\x20TABLE\x20','unlink','catch','complete','argv','existsSync','file\x20doesn\x27t\x20exists','map','No\x20agent\x20available','SIGINT','uncaughtException','path','bluebird','moment','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','import','localhost','redis','YYYY-MM-DD\x20HH:mm:ss','cm_contacts_temp_','format','YYYYMMDDHHmmss','test','field','phone','from','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','query','select\x20*\x20from\x20','spread','length','isNil','AdditionalPhones','push','all','then','error','message','split','filter','CmContactHasItem','findOne','update','updated','PHONE','inserted','CmHopper','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.priority','cm_contacts.UserId','insert','into','cm_hopper','fromQuery','scheduledat','ContactId','createdAt','updatedAt','priority','UserId','fields','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22onlyIfOpen\x22','toString','cm_contacts.updatedAt','select','cm_contacts','cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.createdAt','cm_contact_has_items.updatedAt','cm_hopper_additional_phones','CmHopperId','OrderBy','cm_contact_has_items','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','cm_hopper.ListId\x20=\x20?','concat','keys','ListId','ListId\x20=\x20?','info','exit','code','sequelize','main','stringify','send','start','binding','clone','root','server/files/tmp','.csv','body','ContactItemType'];(function(_0x5f4176,_0x3d4f7b){var _0x96801d=function(_0x5963ac){while(--_0x5963ac){_0x5f4176['push'](_0x5f4176['shift']());}};_0x96801d(++_0x3d4f7b);}(_0xcdb4,0x1f3));var _0x4cdb=function(_0x4b52c4,_0x2f763b){_0x4b52c4=_0x4b52c4-0x0;var _0x2f3fe8=_0xcdb4[_0x4b52c4];return _0x2f3fe8;};'use strict';var fs=require('fs');var path=require(_0x4cdb('0x0'));var _=require('lodash');var Papa=require('papaparse');var util=require('util');var BPromise=require(_0x4cdb('0x1'));var moment=require(_0x4cdb('0x2'));var squel=require(_0x4cdb('0x3'));var Redis=require(_0x4cdb('0x4'));var db=require(_0x4cdb('0x5'))['db'];var config=require(_0x4cdb('0x6'));var logger=require(_0x4cdb('0x7'))(_0x4cdb('0x8'));config['redis']=_['defaults'](config['redis'],{'host':_0x4cdb('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4cdb('0xa')]));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'](_0x4cdb('0xb'));var tempTableName=_0x4cdb('0xc')+moment()[_0x4cdb('0xd')](_0x4cdb('0xe'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x1ec84d){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))*$/[_0x4cdb('0xf')](_0x1ec84d);}function selectNotIn(_0x3337c8,_0x50ea32,_0xc6d1a8,_0x56ff36,_0x1d719f){return squel['select']()[_0x4cdb('0x10')](_0x4cdb('0x11'))[_0x4cdb('0x12')](_0x56ff36)[_0x4cdb('0x13')](_0x50ea32,null,_0x50ea32+_0x4cdb('0x14')+_0x56ff36+'.'+_0xc6d1a8)[_0x4cdb('0x15')](_0x56ff36+'.'+_0xc6d1a8+_0x4cdb('0x16')+_0x3337c8+'.'+_0xc6d1a8)[_0x4cdb('0x15')](_0x50ea32+_0x4cdb('0x17')+_0x1d719f[_0x4cdb('0x13')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x1dd042,_0x34b53a){promisesAdditionalPhones=[];promisesContact=[];return db['sequelize'][_0x4cdb('0x18')](_0x4cdb('0x19')+tempTableName)[_0x4cdb('0x1a')](function(_0x4ac3e1){if(_0x4ac3e1!==null){var _0x280a06=[];for(var _0x26d5bd=0x0;_0x26d5bd<_0x4ac3e1[_0x4cdb('0x1b')];_0x26d5bd++){var _0x255804=_0x4ac3e1[_0x26d5bd];if(!_[_0x4cdb('0x1c')](_0x255804[_0x4cdb('0x11')])){if(!_[_0x4cdb('0x1c')](_0x255804[_0x4cdb('0x1d')]))_0x280a06[_0x4cdb('0x1e')](insertAdditionalPhones(_0x255804));promisesContact[_0x4cdb('0x1e')]({'contact':_0x255804});}}}Promise[_0x4cdb('0x1f')](_0x280a06)[_0x4cdb('0x20')](function(){_0x1dd042({'val':0x1});});})['catch'](function(_0x128500){logger[_0x4cdb('0x21')](_0x128500[_0x4cdb('0x22')]);});});}function insertAdditionalPhones(_0x3f0a6e){return new Promise(function(_0x115d12,_0x21b688){var _0x244128=_0x3f0a6e['AdditionalPhones'];if(_[_0x4cdb('0x1c')](_0x244128))_0x21b688({'val':0x0});else{var _0x1bd71=_0x244128[_0x4cdb('0x23')](';');var _0x3afe49=[];orderBy=0x0;for(var _0x269151=0x0;_0x269151<_0x1bd71[_0x4cdb('0x1b')];_0x269151++){_0x3afe49[_0x4cdb('0x1e')](splitAdditionalPhone(_0x3f0a6e['id'],_0x1bd71[_0x269151]));}Promise[_0x4cdb('0x1f')](_0x3afe49)[_0x4cdb('0x20')](function(){_0x115d12({'val':_0x1bd71[_0x4cdb('0x1b')]});});}});}function splitAdditionalPhone(_0x10587c,_0x5acfb3){return new Promise(function(_0x13e920,_0x2a9bdc){var _0x3df88d=_0x5acfb3[_0x4cdb('0x23')](':');var _0x4c664c=_0x3df88d[0x0];var _0x794807=_0x3df88d[0x1];if(_0x794807!==''){var _0x29680c=_0x794807[_0x4cdb('0x23')]('|');var _0xa36cc2=[];for(var _0xe56e41=0x0;_0xe56e41<_0x29680c['length'];_0xe56e41++){if(_0x29680c[_0xe56e41]!==''){var _0x4f3da1=_[_0x4cdb('0x24')](promisesAdditionalPhones,{'contactId':_0x10587c,'phone':_0x29680c[_0xe56e41]});if(_0x4f3da1[_0x4cdb('0x1b')]==0x0){orderBy++;promisesAdditionalPhones[_0x4cdb('0x1e')]({'contactId':_0x10587c,'contactTypeId':_0x4c664c,'phone':_0x29680c[_0xe56e41],'orderBy':orderBy});}}}_0x13e920({'ok':0x1});}else _0x13e920({'res':0x0});});}function createAdditionalPhone(_0x301aa2,_0x2d8fa4,_0x48ce9e,_0x413171){var _0x2d15b3='';var _0x203cdf='';var _0x112565=_0x48ce9e[_0x4cdb('0x23')]('§');_0x2d15b3=_0x112565[0x0];if(_0x112565['length']==0x2)_0x203cdf=_0x112565[0x1];return new Promise(function(_0x4e6b02,_0xf0621b){return db[_0x4cdb('0x25')][_0x4cdb('0x26')]({'where':{'CmContactId':_0x301aa2,'item':_0x2d15b3}})[_0x4cdb('0x20')](function(_0x34a4aa){if(_0x34a4aa){return db[_0x4cdb('0x25')][_0x4cdb('0x27')]({'ItemTypeId':_0x2d8fa4,'description':_0x203cdf,'OrderBy':_0x413171},{'where':{'CmContactId':_0x301aa2,'item':_0x2d15b3}})[_0x4cdb('0x20')](function(_0xc0efa9){_0x4e6b02({'res':_0x4cdb('0x28')});});}else{return db[_0x4cdb('0x25')]['create']({'CmContactId':_0x301aa2,'item':_0x2d15b3,'ItemTypeId':_0x2d8fa4,'description':_0x203cdf,'OrderBy':_0x413171,'ItemClass':_0x4cdb('0x29')})[_0x4cdb('0x20')](function(_0x4f67bd){_0x4e6b02({'res':_0x4cdb('0x2a')});});}});});}function updateContact(_0x446fa7){return new Promise(function(_0x53c8b7,_0x3cb139){var _0x497867=_0x446fa7['id'];delete _0x446fa7['id'];return db['CmContact'][_0x4cdb('0x27')](_0x446fa7,{'where':{'id':_0x497867}})[_0x4cdb('0x20')](function(_0x477aaf){updatedRows+=0x1;return db[_0x4cdb('0x2b')][_0x4cdb('0x27')]({'phone':_0x446fa7[_0x4cdb('0x11')]},{'where':{'ContactId':_0x497867}})[_0x4cdb('0x20')](function(_0x4278da){_0x53c8b7({'ret':'OK'});});});});}function insertCmHopper(_0x7ae26f,_0x366a07,_0x5dfd4c,_0x4457bc,_0x2b49aa){var _0x44d846=[_0x4cdb('0x2c'),_0x4cdb('0x2d'),_0x4cdb('0x2e'),_0x4cdb('0x2f'),_0x366a07+'.'+_0x4457bc,_0x4cdb('0x30'),'cm_contacts.updatedAt',_0x4cdb('0x31'),_0x4cdb('0x32'),'\x22'+_0x2b49aa+'\x22'];return squel[_0x4cdb('0x33')]()[_0x4cdb('0x34')](_0x4cdb('0x35'))[_0x4cdb('0x36')]([_0x4cdb('0x11'),_0x4cdb('0x37'),_0x4cdb('0x38'),'ListId',_0x4457bc,_0x4cdb('0x39'),_0x4cdb('0x3a'),_0x4cdb('0x3b'),_0x4cdb('0x3c'),'recallme'],squel['select']()[_0x4cdb('0x3d')](_0x44d846)[_0x4cdb('0x12')](_0x366a07)[_0x4cdb('0x13')]('cm_contacts',null,_0x4cdb('0x3e')+_0x366a07+_0x4cdb('0x3f'))[_0x4cdb('0x13')](_0x5dfd4c,null,_0x5dfd4c+_0x4cdb('0x14')+_0x366a07+'.'+_0x4457bc)['where'](_0x366a07+_0x4cdb('0x40'),_0x7ae26f)[_0x4cdb('0x15')](_0x4cdb('0x41'),NOW)['where'](_0x4cdb('0x42'),selectNotIn(_0x366a07,_0x5dfd4c,_0x4457bc,_0x4cdb('0x35'),['\x22always\x22',_0x4cdb('0x43')]))[_0x4cdb('0x15')](_0x4cdb('0x42'),selectNotIn(_0x366a07,_0x5dfd4c,_0x4457bc,_0x4cdb('0x35'),['\x22always\x22'])))[_0x4cdb('0x44')]();}function insertCmHopperBlack(_0x562b78,_0x41c451,_0x29140a,_0x2a82c6){var _0xfde754=[_0x4cdb('0x2c'),_0x4cdb('0x2e'),_0x4cdb('0x2f'),_0x41c451+'.'+_0x2a82c6,_0x4cdb('0x30'),_0x4cdb('0x45')];return squel[_0x4cdb('0x33')]()[_0x4cdb('0x34')]('cm_hopper_black')[_0x4cdb('0x36')]([_0x4cdb('0x11'),_0x4cdb('0x38'),'ListId',_0x2a82c6,_0x4cdb('0x39'),'updatedAt'],squel[_0x4cdb('0x46')]()['fields'](_0xfde754)[_0x4cdb('0x12')](_0x41c451)[_0x4cdb('0x13')](_0x4cdb('0x47'),null,_0x4cdb('0x3e')+_0x41c451+_0x4cdb('0x3f'))[_0x4cdb('0x13')](_0x29140a,null,_0x29140a+_0x4cdb('0x14')+_0x41c451+'.'+_0x2a82c6)[_0x4cdb('0x15')](_0x41c451+_0x4cdb('0x40'),_0x562b78)[_0x4cdb('0x15')](_0x4cdb('0x41'),NOW)[_0x4cdb('0x15')](_0x4cdb('0x42'),squel[_0x4cdb('0x46')]()[_0x4cdb('0x10')]('phone')['from']('cm_hopper_black')[_0x4cdb('0x15')]('ListId\x20=\x20?',_0x562b78)[_0x4cdb('0x15')](_0x2a82c6+'\x20=\x20?',_0x41c451+'.'+_0x2a82c6)))[_0x4cdb('0x44')]();}function insertCmHopperAdditionalPhones(_0xc90abc){var _0x3db665=[_0x4cdb('0x48'),_0x4cdb('0x49'),'cm_contact_has_items.OrderBy',_0x4cdb('0x4a'),_0x4cdb('0x4b')];return squel[_0x4cdb('0x33')]()[_0x4cdb('0x34')](_0x4cdb('0x4c'))[_0x4cdb('0x36')]([_0x4cdb('0x4d'),_0x4cdb('0x11'),_0x4cdb('0x4e'),_0x4cdb('0x39'),_0x4cdb('0x3a')],squel[_0x4cdb('0x46')]()[_0x4cdb('0x3d')](_0x3db665)[_0x4cdb('0x12')](_0x4cdb('0x35'))[_0x4cdb('0x13')]('cm_contacts',null,'cm_contacts.id\x20=\x20cm_hopper.ContactId')[_0x4cdb('0x13')](_0x4cdb('0x4f'),null,_0x4cdb('0x50'))[_0x4cdb('0x15')](_0x4cdb('0x51'),_0xc90abc)[_0x4cdb('0x15')]('cm_contacts.createdAt\x20=\x20?',NOW))[_0x4cdb('0x44')]();}function insertCmContact(_0x2a4f05,_0x564040,_0x30e653,_0x378f42){var _0x293167=_[_0x4cdb('0x52')](_[_0x4cdb('0x53')](_0x378f42),[_0x4cdb('0x54'),'CompanyId',_0x4cdb('0x39'),_0x4cdb('0x3a')]);return squel[_0x4cdb('0x33')]()[_0x4cdb('0x34')](_0x4cdb('0x47'))['fromQuery'](_0x293167,squel['select']()[_0x4cdb('0x3d')](_0x293167)[_0x4cdb('0x12')](_0x564040)[_0x4cdb('0x15')]('('+_0x30e653[_0x4cdb('0x13')](',')+')\x20NOT\x20IN\x20?',squel[_0x4cdb('0x46')]()['fields'](_0x30e653)[_0x4cdb('0x12')](_0x4cdb('0x47'))[_0x4cdb('0x15')](_0x4cdb('0x55'),_0x2a4f05))[_0x4cdb('0x15')]('id\x20IN\x20?',squel[_0x4cdb('0x46')]()['field']('MIN(id)','min_id')[_0x4cdb('0x12')](_0x564040)['group'](_0x30e653[_0x4cdb('0x13')](','))))[_0x4cdb('0x44')]();}function handleStop(){logger[_0x4cdb('0x56')]('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0xd1f6f9){logger[_0x4cdb('0x21')](_0xd1f6f9[_0x4cdb('0x22')]);process[_0x4cdb('0x57')](0x1);}function handleError(_0x1c93ee,_0xed3466){stats['errors']['push']({'name':_0xed3466[_0x4cdb('0x58')],'message':_0xed3466['message'],'row':_0x1c93ee});}function handleQuery(_0x408e9b){logger[_0x4cdb('0x56')](_0x408e9b);return db[_0x4cdb('0x59')][_0x4cdb('0x18')](_0x408e9b)[_0x4cdb('0x1a')](function(_0x4b6624){results[_0x4cdb('0x1e')](_0x4b6624);})['catch'](function(_0x23204f){logger['error'](_0x23204f['message']);});}function main(_0x5b855e,_0x3df9cf,_0xc47c04,_0x3dde14){logger['info'](_0x4cdb('0x5a'),_0x5b855e,JSON[_0x4cdb('0x5b')](_0x3df9cf));process[_0x4cdb('0x5c')](_0x4cdb('0x5d'));var _0x456ef1=_0x3df9cf[_0x4cdb('0x5e')];var _0x2f190d=_[_0x4cdb('0x5f')](_0x456ef1);var _0x5c6811=_0x3df9cf['socket_timestamp'];var _0x53ae51=path[_0x4cdb('0x13')](config[_0x4cdb('0x60')],_0x4cdb('0x61'),_0x5c6811+_0x4cdb('0x62'));logger[_0x4cdb('0x56')](_0x4cdb('0x63'),_0x3df9cf);db[_0x4cdb('0x64')]['findAll']({'raw':!![],'attributes':['id','name']})[_0x4cdb('0x20')](function(_0x35cdbf){for(var _0x895406=0x0;_0x895406<_0x35cdbf[_0x4cdb('0x1b')];_0x895406++){if(_0x35cdbf[_0x895406]['name']in _0x456ef1){contactItemTypes[_0x4cdb('0x1e')](_0x35cdbf[_0x895406]);delete _0x2f190d[_0x35cdbf[_0x895406][_0x4cdb('0x65')]];hasAdditionalPhones=!![];}for(var _0x33f10d in _0x456ef1){if(_0x35cdbf[_0x895406][_0x4cdb('0x65')]+_0x4cdb('0x66')===_0x33f10d){phoneDescriptions[_0x4cdb('0x1e')]({'itemTypeId':_0x35cdbf[_0x895406]['id'],'description':_0x33f10d});delete _0x2f190d[_0x33f10d];}}}if(hasAdditionalPhones)_0x2f190d[_0x4cdb('0x1d')]='';var _0x4ed28a=_['keys'](_0x2f190d)[_0x4cdb('0x13')]();logger['info'](_0x4cdb('0x67'),_0x4ed28a);fs[_0x4cdb('0x68')](_0x53ae51,_0x4ed28a+'\x0a');Papa[_0x4cdb('0x69')](fs[_0x4cdb('0x6a')](_0x5b855e),{'header':!![],'skipEmptyLines':!![],'step':function(_0x172bd9,_0x15064a){try{for(var _0x13e21a=0x0,_0x5a92a6=[];_0x13e21a<_0x172bd9[_0x4cdb('0x6b')][_0x4cdb('0x1b')];_0x13e21a++){stats[_0x4cdb('0x6c')]+=0x1;if(_0x172bd9['errors'][_0x13e21a]){handleError(_0x172bd9[_0x4cdb('0x6b')][_0x13e21a],_0x172bd9[_0x4cdb('0x6d')][_0x13e21a]);}else{var _0x487724=[];var _0x9b501c=[];var _0x4fbd73={};for(var _0x3be957 in _0x456ef1){let _0x7b969d=contactItemTypes[_0x4cdb('0x6e')](_0x56d3b9=>_0x56d3b9['name']===_0x3be957);let _0x16db6f=contactItemTypes[_0x4cdb('0x6e')](_0x35fedd=>_0x35fedd[_0x4cdb('0x65')]+_0x4cdb('0x66')===_0x3be957);if(_[_0x4cdb('0x1c')](_0x7b969d)&&_[_0x4cdb('0x1c')](_0x16db6f)){if(_0x456ef1[_0x4cdb('0x6f')](_0x3be957)){if(_0x172bd9[_0x4cdb('0x6b')][_0x13e21a][_0x456ef1[_0x3be957]]){var _0x4ced72=_[_0x4cdb('0x70')](_0x172bd9['data'][_0x13e21a][_0x456ef1[_0x3be957]]['replace'](/"/g,'\x27'));switch(_0x3be957){case _0x4cdb('0x37'):var _0x4d5c3c=moment(_0x4ced72,_0x4cdb('0xb'),!![]);if(_0x4d5c3c[_0x4cdb('0x71')]()){_0x5a92a6['push']('\x22'+_0x4ced72+'\x22');}else{_0x487724[_0x4cdb('0x1e')]('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case _0x4cdb('0x3b'):var _0x483ed0=parseInt(_0x4ced72);_0x4ced72=_['isNaN'](_0x483ed0)||_0x483ed0<0x0||_0x483ed0>0x4?_0x3dde14?0x3:0x2:_0x483ed0;_0x5a92a6[_0x4cdb('0x1e')]('\x22'+_0x4ced72+'\x22');break;case _0x4cdb('0x3c'):var _0x350207=parseInt(_0x4ced72);if(_['isNumber'](_0x350207)&&_['includes'](_0xc47c04,_0x350207)){_0x5a92a6[_0x4cdb('0x1e')]('\x22'+_0x350207+'\x22');}else{_0x487724[_0x4cdb('0x1e')](_0x4cdb('0x72'));}break;case _0x4cdb('0x73'):if(isEmail(_0x4ced72)){_0x5a92a6[_0x4cdb('0x1e')]('\x22'+_0x4ced72+'\x22');}else{_0x487724[_0x4cdb('0x1e')](_0x4cdb('0x74'));}break;case _0x4cdb('0x75'):var _0x137556=moment(_0x4ced72,_0x4cdb('0x76'),!![]);if(_0x137556[_0x4cdb('0x71')]()){_0x5a92a6['push']('\x22'+_0x4ced72+'\x22');}else{_0x487724[_0x4cdb('0x1e')](_0x4cdb('0x77'));}break;default:_0x5a92a6[_0x4cdb('0x1e')]('\x22'+_0x4ced72+'\x22');}}else{switch(_0x3be957){case _0x4cdb('0x78'):case _0x4cdb('0x11'):_0x487724[_0x4cdb('0x1e')](_0x3be957+_0x4cdb('0x79'));break;default:_0x5a92a6['push']('\x22\x22');}}}}else{var _0x1d8276='';if(!_[_0x4cdb('0x1c')](_0x7b969d)){if(!_0x4fbd73['hasOwnProperty'](_0x7b969d['id'])){for(var _0x1bef4f=0x0;_0x1bef4f<_0x456ef1[_0x3be957][_0x4cdb('0x1b')];_0x1bef4f++){var _0x4ced72=_[_0x4cdb('0x70')](_0x172bd9[_0x4cdb('0x6b')][_0x13e21a][_0x456ef1[_0x3be957][_0x1bef4f]]['replace'](/"/g,'\x27'));var _0x16c6b8=phoneDescriptions[_0x4cdb('0x6e')](_0x3258a3=>_0x3258a3['itemTypeId']===_0x7b969d['id']);if(!_[_0x4cdb('0x1c')](_0x16c6b8)){var _0x5dd5cb=_[_0x4cdb('0x70')](_0x172bd9[_0x4cdb('0x6b')][_0x13e21a][_0x456ef1[_0x16c6b8[_0x4cdb('0x7a')]][0x0]][_0x4cdb('0x7b')](/"/g,'\x27'));if(!_[_0x4cdb('0x1c')](_0x5dd5cb))_0x4ced72=_0x4ced72+'§'+_0x5dd5cb;}if(_0x1d8276=='')_0x1d8276=_0x4ced72;else _0x1d8276+='|'+_0x4ced72;}_0x9b501c['push'](_0x7b969d['id']+':'+_0x1d8276);_0x4fbd73[_0x7b969d['id']]=0x1;}}}}if(hasAdditionalPhones){_0x5a92a6[_0x4cdb('0x1e')]('\x22'+_0x9b501c['join'](';')+'\x22');}if(_0x487724['length']){handleError(_0x172bd9[_0x4cdb('0x6b')][_0x13e21a],{'code':'SystemRow','message':_0x487724[_0x4cdb('0x13')]()});}else{fs[_0x4cdb('0x7c')](_0x53ae51,_0x5a92a6['join']()+'\x0a');}_0x5a92a6=[];}if(!(stats['rows']%0xc8)){socket['emit'](_0x4cdb('0x7d')+_0x5c6811,stats);stats[_0x4cdb('0x6d')]=[];}}if(stopped){logger[_0x4cdb('0x56')](_0x4cdb('0x7e'));_0x15064a['abort']();}}catch(_0x3aa096){handleError(_0x172bd9[_0x4cdb('0x6b')][_0x13e21a],{'code':_0x4cdb('0x7f'),'message':_0x3aa096[_0x4cdb('0x22')]});logger[_0x4cdb('0x21')](_0x4cdb('0x80'),_0x3aa096[_0x4cdb('0x22')]);}},'complete':function(){try{var _0xff49dd=[];var _0x3bf3d5=tempTableName;_0xff49dd[_0x4cdb('0x1e')](_0x4cdb('0x81')+_0x3bf3d5+_0x4cdb('0x82'));logger[_0x4cdb('0x56')](_0x4cdb('0x83'),contactItemTypes[_0x4cdb('0x1b')]);var _0x4b7a87=util[_0x4cdb('0xd')]('LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',_0x53ae51,_0x3bf3d5,_0x4ed28a,_0x3df9cf[_0x4cdb('0x54')],_0x3df9cf[_0x4cdb('0x84')]||null,NOW,NOW);if(_[_0x4cdb('0x1c')](_0x456ef1['scheduledat'])){_0x4b7a87+=_0x4cdb('0x85');}_0xff49dd[_0x4cdb('0x1e')](_0x4b7a87);BPromise[_0x4cdb('0x86')](_0xff49dd,handleQuery)['then'](function(_0xeeb886){BPromise[_0x4cdb('0x1f')]([handleAdditionalPhones()])[_0x4cdb('0x20')](function(){_0xff49dd=[];for(var _0x3bb955=0x0;_0x3bb955<promisesContact['length'];_0x3bb955++){_0xff49dd[_0x4cdb('0x1e')](updateContact(promisesContact[_0x3bb955][_0x4cdb('0x87')]));}BPromise[_0x4cdb('0x1f')](_0xff49dd)['then'](function(){_0xff49dd=[];for(var _0x25cea2=0x0;_0x25cea2<promisesAdditionalPhones[_0x4cdb('0x1b')];_0x25cea2++){_0xff49dd['push'](createAdditionalPhone(promisesAdditionalPhones[_0x25cea2][_0x4cdb('0x88')],promisesAdditionalPhones[_0x25cea2][_0x4cdb('0x89')],promisesAdditionalPhones[_0x25cea2][_0x4cdb('0x11')],promisesAdditionalPhones[_0x25cea2][_0x4cdb('0x8a')]));}BPromise['all'](_0xff49dd)['then'](function(){_0xff49dd=[];_0xff49dd[_0x4cdb('0x1e')](insertCmHopperAdditionalPhones(_0x3df9cf['ListId']));_0xff49dd[_0x4cdb('0x1e')](_0x4cdb('0x8b')+_0x3bf3d5+';');BPromise[_0x4cdb('0x86')](_0xff49dd,handleQuery)[_0x4cdb('0x20')](function(_0x43ccbf){stats['finish']=!![];stats['affectedRows']=updatedRows;socket['emit'](_0x4cdb('0x7d')+_0x5c6811,stats);fs[_0x4cdb('0x8c')](_0x5b855e);fs[_0x4cdb('0x8c')](_0x53ae51);process[_0x4cdb('0x57')](0x0);})[_0x4cdb('0x8d')](function(_0x29a2c3){logger[_0x4cdb('0x21')](_0x29a2c3[_0x4cdb('0x22')]);process[_0x4cdb('0x57')](0x1);});});});});})[_0x4cdb('0x8d')](function(_0x4b9f4e){logger[_0x4cdb('0x21')](_0x4b9f4e[_0x4cdb('0x22')]);process[_0x4cdb('0x57')](0x1);});}catch(_0x2e5575){logger[_0x4cdb('0x21')](_0x4cdb('0x8e'),_0x2e5575['message']);process['exit'](0x1);}},'error':function(_0x337be5,_0x132782,_0x545c3d,_0x24324c){throw new Error(_0x24324c);}});});}function validate(){if(process[_0x4cdb('0x8f')]&&process[_0x4cdb('0x8f')][_0x4cdb('0x1b')]<0x4){throw new Error('arguments\x20<filename>\x20<parameters>\x20<agents>');}var _0x1e1165=path[_0x4cdb('0x13')](config[_0x4cdb('0x60')],_0x4cdb('0x61'),process['argv'][0x2]);if(!fs[_0x4cdb('0x90')](_0x1e1165)){throw new Error(_0x4cdb('0x91'));}var _0x16b8ea={};try{_0x16b8ea=JSON['parse'](process[_0x4cdb('0x8f')][0x3]);if(!_0x16b8ea[_0x4cdb('0x5e')]){throw new Error('binding\x20doesn\x27t\x20exists');}var _0x3fa981=0x0;if(_0x16b8ea['binding'][_0x4cdb('0x3c')]){_0x3fa981=0x1;}if(!_0x16b8ea[_0x4cdb('0x54')]){throw new Error('ListId\x20is\x20mandatory');}}catch(_0x228a0c){throw new Error('body\x20id\x20mandatory');}var _0x15de5e=[];try{_0x15de5e=_[_0x4cdb('0x92')](JSON['parse'](process[_0x4cdb('0x8f')][0x4]),'id');}catch(_0x293f56){logger[_0x4cdb('0x56')](_0x4cdb('0x93'));}main(_0x1e1165,_0x16b8ea,_0x15de5e,_0x3fa981);}validate();process['on'](_0x4cdb('0x94'),handleStop);process['on'](_0x4cdb('0x95'),handleUncaughtException);
\ No newline at end of file
+var _0xf15d=['cm_contacts.createdAt','cm_contacts.priority','cm_contacts.UserId','into','cm_hopper','fromQuery','scheduledat','ContactId','ListId','updatedAt','priority','UserId','select','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','\x22always\x22','\x22onlyIfOpen\x22','cm_contacts.phone\x20NOT\x20IN\x20(?)','cm_contacts.updatedAt','insert','createdAt','.CmListId','field','cm_hopper_black','toString','cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.OrderBy','cm_hopper_additional_phones','CmHopperId','OrderBy','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contact_has_items','cm_hopper.ListId\x20=\x20?','concat','CompanyId',')\x20NOT\x20IN\x20?','ListId\x20=\x20?','id\x20IN\x20?','MIN(id)','group','info','Received\x20SIGINT','exit','errors','query','spread','main','stringify','send','start','binding','clone','socket_timestamp','.csv','body','ContactItemType','name','_description','keys','header','writeFileSync','createReadStream','data','rows','find','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','isNumber','includes','agent\x20not\x20exists','email\x20wrong\x20format','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','\x20not\x20specified','replace','itemTypeId','trim','description','SystemRow','appendFileSync','emit','Abort\x20parser','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()','contactId','contactTypeId','orderBy','DROP\x20TABLE\x20','each','finish','affectedRows','unlink','complete','argv','arguments\x20<filename>\x20<parameters>\x20<agents>','root','server/files/tmp','file\x20doesn\x27t\x20exists','parse','binding\x20doesn\x27t\x20exists','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','path','papaparse','moment','squel','ioredis','../../../mysqldb','../../../config/logger','import','redis','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','cm_contacts_temp_','YYYYMMDDHHmmss','test','from','join','.id\x20=\x20','where','\x20=\x20','sequelize','select\x20*\x20from\x20','length','isNil','AdditionalPhones','push','all','then','catch','error','message','split','filter','CmContactHasItem','updated','create','PHONE','inserted','CmContact','CmHopper','update','phone','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId'];(function(_0x13606d,_0x30f265){var _0x1b85b0=function(_0x285c1b){while(--_0x285c1b){_0x13606d['push'](_0x13606d['shift']());}};_0x1b85b0(++_0x30f265);}(_0xf15d,0x113));var _0xdf15=function(_0x396c1c,_0x24fc77){_0x396c1c=_0x396c1c-0x0;var _0x74f196=_0xf15d[_0x396c1c];return _0x74f196;};'use strict';var fs=require('fs');var path=require(_0xdf15('0x0'));var _=require('lodash');var Papa=require(_0xdf15('0x1'));var util=require('util');var BPromise=require('bluebird');var moment=require(_0xdf15('0x2'));var squel=require(_0xdf15('0x3'));var Redis=require(_0xdf15('0x4'));var db=require(_0xdf15('0x5'))['db'];var config=require('../../../config/environment');var logger=require(_0xdf15('0x6'))(_0xdf15('0x7'));config[_0xdf15('0x8')]=_['defaults'](config[_0xdf15('0x8')],{'host':_0xdf15('0x9'),'port':0x18eb});var socket=require(_0xdf15('0xa'))(new Redis(config[_0xdf15('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()[_0xdf15('0xb')](_0xdf15('0xc'));var tempTableName=_0xdf15('0xd')+moment()[_0xdf15('0xb')](_0xdf15('0xe'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x43f5ea){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))*$/[_0xdf15('0xf')](_0x43f5ea);}function selectNotIn(_0x5d7666,_0x1075dd,_0x9762b8,_0x22e309,_0x427fd7){return squel['select']()['field']('phone')[_0xdf15('0x10')](_0x22e309)[_0xdf15('0x11')](_0x1075dd,null,_0x1075dd+_0xdf15('0x12')+_0x22e309+'.'+_0x9762b8)[_0xdf15('0x13')](_0x22e309+'.'+_0x9762b8+_0xdf15('0x14')+_0x5d7666+'.'+_0x9762b8)[_0xdf15('0x13')](_0x1075dd+'.dialCheckDuplicateType\x20IN\x20('+_0x427fd7[_0xdf15('0x11')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x1a66aa,_0x4f89d8){promisesAdditionalPhones=[];promisesContact=[];return db[_0xdf15('0x15')]['query'](_0xdf15('0x16')+tempTableName)['spread'](function(_0xbd1de2){if(_0xbd1de2!==null){var _0x53a875=[];for(var _0x34109e=0x0;_0x34109e<_0xbd1de2[_0xdf15('0x17')];_0x34109e++){var _0x57305d=_0xbd1de2[_0x34109e];if(!_['isNil'](_0x57305d['phone'])){if(!_[_0xdf15('0x18')](_0x57305d[_0xdf15('0x19')]))_0x53a875[_0xdf15('0x1a')](insertAdditionalPhones(_0x57305d));promisesContact['push']({'contact':_0x57305d});}}}Promise[_0xdf15('0x1b')](_0x53a875)[_0xdf15('0x1c')](function(){_0x1a66aa({'val':0x1});});})[_0xdf15('0x1d')](function(_0x8749da){logger[_0xdf15('0x1e')](_0x8749da[_0xdf15('0x1f')]);});});}function insertAdditionalPhones(_0x485449){return new Promise(function(_0x32f2f4,_0x1d3d3a){var _0x2b742c=_0x485449[_0xdf15('0x19')];if(_['isNil'](_0x2b742c))_0x1d3d3a({'val':0x0});else{var _0x235b49=_0x2b742c['split'](';');var _0x169704=[];orderBy=0x0;for(var _0x2b4d8a=0x0;_0x2b4d8a<_0x235b49[_0xdf15('0x17')];_0x2b4d8a++){_0x169704['push'](splitAdditionalPhone(_0x485449['id'],_0x235b49[_0x2b4d8a]));}Promise[_0xdf15('0x1b')](_0x169704)['then'](function(){_0x32f2f4({'val':_0x235b49[_0xdf15('0x17')]});});}});}function splitAdditionalPhone(_0x5059d8,_0x4d3701){return new Promise(function(_0x3fbbd7,_0x4b7b91){var _0x14a214=_0x4d3701['split'](':');var _0x372909=_0x14a214[0x0];var _0x4142fc=_0x14a214[0x1];if(_0x4142fc!==''){var _0x2c8d71=_0x4142fc[_0xdf15('0x20')]('|');var _0x37e13b=[];for(var _0x435f89=0x0;_0x435f89<_0x2c8d71['length'];_0x435f89++){if(_0x2c8d71[_0x435f89]!==''){var _0x518101=_[_0xdf15('0x21')](promisesAdditionalPhones,{'contactId':_0x5059d8,'phone':_0x2c8d71[_0x435f89]});if(_0x518101[_0xdf15('0x17')]==0x0){orderBy++;promisesAdditionalPhones[_0xdf15('0x1a')]({'contactId':_0x5059d8,'contactTypeId':_0x372909,'phone':_0x2c8d71[_0x435f89],'orderBy':orderBy});}}}_0x3fbbd7({'ok':0x1});}else _0x3fbbd7({'res':0x0});});}function createAdditionalPhone(_0x2a75c7,_0x351b55,_0x5e95b1,_0x5a67c1){var _0x1c761b='';var _0x194626='';var _0xac3af6=_0x5e95b1['split']('§');_0x1c761b=_0xac3af6[0x0];if(_0xac3af6[_0xdf15('0x17')]==0x2)_0x194626=_0xac3af6[0x1];return new Promise(function(_0x226b21,_0x271d31){return db[_0xdf15('0x22')]['findOne']({'where':{'CmContactId':_0x2a75c7,'item':_0x1c761b}})[_0xdf15('0x1c')](function(_0x254189){if(_0x254189){return db[_0xdf15('0x22')]['update']({'ItemTypeId':_0x351b55,'description':_0x194626,'OrderBy':_0x5a67c1},{'where':{'CmContactId':_0x2a75c7,'item':_0x1c761b}})[_0xdf15('0x1c')](function(_0x15f94d){_0x226b21({'res':_0xdf15('0x23')});});}else{return db[_0xdf15('0x22')][_0xdf15('0x24')]({'CmContactId':_0x2a75c7,'item':_0x1c761b,'ItemTypeId':_0x351b55,'description':_0x194626,'OrderBy':_0x5a67c1,'ItemClass':_0xdf15('0x25')})['then'](function(_0x112bf1){_0x226b21({'res':_0xdf15('0x26')});});}});});}function updateContact(_0x458493){return new Promise(function(_0x4b0dc7,_0xb2399c){var _0x2278d5=_0x458493['id'];delete _0x458493['id'];return db[_0xdf15('0x27')]['update'](_0x458493,{'where':{'id':_0x2278d5}})[_0xdf15('0x1c')](function(_0x3a25d5){updatedRows+=0x1;return db[_0xdf15('0x28')][_0xdf15('0x29')]({'phone':_0x458493[_0xdf15('0x2a')]},{'where':{'ContactId':_0x2278d5}})[_0xdf15('0x1c')](function(_0x5249b2){_0x4b0dc7({'ret':'OK'});});});});}function insertCmHopper(_0x158927,_0x400a4a,_0x2d2dca,_0x4e8893,_0x50ed){var _0x40ac0c=[_0xdf15('0x2b'),_0xdf15('0x2c'),_0xdf15('0x2d'),_0xdf15('0x2e'),_0x400a4a+'.'+_0x4e8893,_0xdf15('0x2f'),'cm_contacts.updatedAt',_0xdf15('0x30'),_0xdf15('0x31'),'\x22'+_0x50ed+'\x22'];return squel['insert']()[_0xdf15('0x32')](_0xdf15('0x33'))[_0xdf15('0x34')]([_0xdf15('0x2a'),_0xdf15('0x35'),_0xdf15('0x36'),_0xdf15('0x37'),_0x4e8893,'createdAt',_0xdf15('0x38'),_0xdf15('0x39'),_0xdf15('0x3a'),'recallme'],squel[_0xdf15('0x3b')]()[_0xdf15('0x3c')](_0x40ac0c)[_0xdf15('0x10')](_0x400a4a)[_0xdf15('0x11')](_0xdf15('0x3d'),null,_0xdf15('0x3e')+_0x400a4a+'.CmListId')['join'](_0x2d2dca,null,_0x2d2dca+_0xdf15('0x12')+_0x400a4a+'.'+_0x4e8893)[_0xdf15('0x13')](_0x400a4a+_0xdf15('0x3f'),_0x158927)['where'](_0xdf15('0x40'),NOW)[_0xdf15('0x13')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x400a4a,_0x2d2dca,_0x4e8893,_0xdf15('0x33'),[_0xdf15('0x41'),_0xdf15('0x42')]))['where'](_0xdf15('0x43'),selectNotIn(_0x400a4a,_0x2d2dca,_0x4e8893,'cm_hopper',[_0xdf15('0x41')])))['toString']();}function insertCmHopperBlack(_0x411ed4,_0x1b90c8,_0x271d91,_0x2fb1cf){var _0x6d974d=[_0xdf15('0x2b'),_0xdf15('0x2d'),_0xdf15('0x2e'),_0x1b90c8+'.'+_0x2fb1cf,'cm_contacts.createdAt',_0xdf15('0x44')];return squel[_0xdf15('0x45')]()[_0xdf15('0x32')]('cm_hopper_black')[_0xdf15('0x34')](['phone','ContactId',_0xdf15('0x37'),_0x2fb1cf,_0xdf15('0x46'),_0xdf15('0x38')],squel[_0xdf15('0x3b')]()[_0xdf15('0x3c')](_0x6d974d)[_0xdf15('0x10')](_0x1b90c8)[_0xdf15('0x11')](_0xdf15('0x3d'),null,_0xdf15('0x3e')+_0x1b90c8+_0xdf15('0x47'))[_0xdf15('0x11')](_0x271d91,null,_0x271d91+_0xdf15('0x12')+_0x1b90c8+'.'+_0x2fb1cf)[_0xdf15('0x13')](_0x1b90c8+_0xdf15('0x3f'),_0x411ed4)[_0xdf15('0x13')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0xdf15('0x13')](_0xdf15('0x43'),squel[_0xdf15('0x3b')]()[_0xdf15('0x48')](_0xdf15('0x2a'))[_0xdf15('0x10')](_0xdf15('0x49'))[_0xdf15('0x13')]('ListId\x20=\x20?',_0x411ed4)['where'](_0x2fb1cf+'\x20=\x20?',_0x1b90c8+'.'+_0x2fb1cf)))[_0xdf15('0x4a')]();}function insertCmHopperAdditionalPhones(_0x413caf){var _0x492566=[_0xdf15('0x4b'),_0xdf15('0x4c'),_0xdf15('0x4d'),'cm_contact_has_items.createdAt','cm_contact_has_items.updatedAt'];return squel[_0xdf15('0x45')]()[_0xdf15('0x32')](_0xdf15('0x4e'))['fromQuery']([_0xdf15('0x4f'),'phone',_0xdf15('0x50'),_0xdf15('0x46'),'updatedAt'],squel[_0xdf15('0x3b')]()[_0xdf15('0x3c')](_0x492566)[_0xdf15('0x10')](_0xdf15('0x33'))[_0xdf15('0x11')](_0xdf15('0x3d'),null,_0xdf15('0x51'))[_0xdf15('0x11')](_0xdf15('0x52'),null,'cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId')['where'](_0xdf15('0x53'),_0x413caf)['where'](_0xdf15('0x40'),NOW))[_0xdf15('0x4a')]();}function insertCmContact(_0x223a99,_0x33d5c0,_0x33f7ff,_0xf18b8e){var _0x2f371d=_[_0xdf15('0x54')](_['keys'](_0xf18b8e),[_0xdf15('0x37'),_0xdf15('0x55'),_0xdf15('0x46'),_0xdf15('0x38')]);return squel[_0xdf15('0x45')]()['into']('cm_contacts')['fromQuery'](_0x2f371d,squel[_0xdf15('0x3b')]()[_0xdf15('0x3c')](_0x2f371d)[_0xdf15('0x10')](_0x33d5c0)['where']('('+_0x33f7ff[_0xdf15('0x11')](',')+_0xdf15('0x56'),squel[_0xdf15('0x3b')]()[_0xdf15('0x3c')](_0x33f7ff)[_0xdf15('0x10')](_0xdf15('0x3d'))[_0xdf15('0x13')](_0xdf15('0x57'),_0x223a99))[_0xdf15('0x13')](_0xdf15('0x58'),squel[_0xdf15('0x3b')]()[_0xdf15('0x48')](_0xdf15('0x59'),'min_id')[_0xdf15('0x10')](_0x33d5c0)[_0xdf15('0x5a')](_0x33f7ff[_0xdf15('0x11')](','))))[_0xdf15('0x4a')]();}function handleStop(){logger[_0xdf15('0x5b')](_0xdf15('0x5c'));stopped=!![];}function handleUncaughtException(_0x4a838){logger[_0xdf15('0x1e')](_0x4a838[_0xdf15('0x1f')]);process[_0xdf15('0x5d')](0x1);}function handleError(_0x57758d,_0x46236c){stats[_0xdf15('0x5e')]['push']({'name':_0x46236c['code'],'message':_0x46236c[_0xdf15('0x1f')],'row':_0x57758d});}function handleQuery(_0x2bd969){logger[_0xdf15('0x5b')](_0x2bd969);return db[_0xdf15('0x15')][_0xdf15('0x5f')](_0x2bd969)[_0xdf15('0x60')](function(_0x3222dc){results[_0xdf15('0x1a')](_0x3222dc);})['catch'](function(_0xce2816){logger[_0xdf15('0x1e')](_0xce2816[_0xdf15('0x1f')]);});}function main(_0x50d429,_0x58beea,_0x2bcfef,_0x5a48db){logger[_0xdf15('0x5b')](_0xdf15('0x61'),_0x50d429,JSON[_0xdf15('0x62')](_0x58beea));process[_0xdf15('0x63')](_0xdf15('0x64'));var _0x4768ba=_0x58beea[_0xdf15('0x65')];var _0x18657e=_[_0xdf15('0x66')](_0x4768ba);var _0x5bcf36=_0x58beea[_0xdf15('0x67')];var _0x195fa2=path[_0xdf15('0x11')](config['root'],'server/files/tmp',_0x5bcf36+_0xdf15('0x68'));logger[_0xdf15('0x5b')](_0xdf15('0x69'),_0x58beea);db[_0xdf15('0x6a')]['findAll']({'raw':!![],'attributes':['id',_0xdf15('0x6b')]})[_0xdf15('0x1c')](function(_0x1543ce){for(var _0x3844cc=0x0;_0x3844cc<_0x1543ce['length'];_0x3844cc++){if(_0x1543ce[_0x3844cc]['name']in _0x4768ba){contactItemTypes['push'](_0x1543ce[_0x3844cc]);delete _0x18657e[_0x1543ce[_0x3844cc]['name']];hasAdditionalPhones=!![];}for(var _0x5223db in _0x4768ba){if(_0x1543ce[_0x3844cc]['name']+_0xdf15('0x6c')===_0x5223db){phoneDescriptions['push']({'itemTypeId':_0x1543ce[_0x3844cc]['id'],'description':_0x5223db});delete _0x18657e[_0x5223db];}}}if(hasAdditionalPhones)_0x18657e[_0xdf15('0x19')]='';var _0x3366c4=_[_0xdf15('0x6d')](_0x18657e)[_0xdf15('0x11')]();logger[_0xdf15('0x5b')](_0xdf15('0x6e'),_0x3366c4);fs[_0xdf15('0x6f')](_0x195fa2,_0x3366c4+'\x0a');Papa['parse'](fs[_0xdf15('0x70')](_0x50d429),{'header':!![],'skipEmptyLines':!![],'step':function(_0x3df369,_0x5a04f4){try{for(var _0x3c74f2=0x0,_0x21affc=[];_0x3c74f2<_0x3df369[_0xdf15('0x71')][_0xdf15('0x17')];_0x3c74f2++){stats[_0xdf15('0x72')]+=0x1;if(_0x3df369['errors'][_0x3c74f2]){handleError(_0x3df369[_0xdf15('0x71')][_0x3c74f2],_0x3df369[_0xdf15('0x5e')][_0x3c74f2]);}else{var _0x30867d=[];var _0x5767ca=[];var _0x1607cd={};for(var _0x590385 in _0x4768ba){let _0x5b2799=contactItemTypes['find'](_0x294d7d=>_0x294d7d[_0xdf15('0x6b')]===_0x590385);let _0x52dbbe=contactItemTypes[_0xdf15('0x73')](_0x395469=>_0x395469[_0xdf15('0x6b')]+_0xdf15('0x6c')===_0x590385);if(_[_0xdf15('0x18')](_0x5b2799)&&_[_0xdf15('0x18')](_0x52dbbe)){if(_0x4768ba['hasOwnProperty'](_0x590385)){if(_0x3df369[_0xdf15('0x71')][_0x3c74f2][_0x4768ba[_0x590385]]){var _0x89adf=_['trim'](_0x3df369[_0xdf15('0x71')][_0x3c74f2][_0x4768ba[_0x590385]]['replace'](/"/g,'\x27'));switch(_0x590385){case'scheduledat':var _0x55402a=moment(_0x89adf,_0xdf15('0xc'),!![]);if(_0x55402a[_0xdf15('0x74')]()){_0x21affc['push']('\x22'+_0x89adf+'\x22');}else{_0x30867d[_0xdf15('0x1a')](_0xdf15('0x75'));}break;case _0xdf15('0x39'):var _0x566563=parseInt(_0x89adf);_0x89adf=_[_0xdf15('0x76')](_0x566563)||_0x566563<0x0||_0x566563>0x4?_0x5a48db?0x3:0x2:_0x566563;_0x21affc[_0xdf15('0x1a')]('\x22'+_0x89adf+'\x22');break;case _0xdf15('0x3a'):var _0x523089=parseInt(_0x89adf);if(_[_0xdf15('0x77')](_0x523089)&&_[_0xdf15('0x78')](_0x2bcfef,_0x523089)){_0x21affc['push']('\x22'+_0x523089+'\x22');}else{_0x30867d[_0xdf15('0x1a')](_0xdf15('0x79'));}break;case'email':if(isEmail(_0x89adf)){_0x21affc[_0xdf15('0x1a')]('\x22'+_0x89adf+'\x22');}else{_0x30867d[_0xdf15('0x1a')](_0xdf15('0x7a'));}break;case'dateOfBirth':var _0x135e38=moment(_0x89adf,_0xdf15('0x7b'),!![]);if(_0x135e38[_0xdf15('0x74')]()){_0x21affc[_0xdf15('0x1a')]('\x22'+_0x89adf+'\x22');}else{_0x30867d[_0xdf15('0x1a')](_0xdf15('0x7c'));}break;default:_0x21affc['push']('\x22'+_0x89adf+'\x22');}}else{switch(_0x590385){case'firstName':case _0xdf15('0x2a'):_0x30867d[_0xdf15('0x1a')](_0x590385+_0xdf15('0x7d'));break;default:_0x21affc[_0xdf15('0x1a')]('\x22\x22');}}}}else{var _0x502c90='';if(!_[_0xdf15('0x18')](_0x5b2799)){if(!_0x1607cd['hasOwnProperty'](_0x5b2799['id'])){for(var _0x1c656b=0x0;_0x1c656b<_0x4768ba[_0x590385][_0xdf15('0x17')];_0x1c656b++){var _0x89adf=_['trim'](_0x3df369[_0xdf15('0x71')][_0x3c74f2][_0x4768ba[_0x590385][_0x1c656b]][_0xdf15('0x7e')](/"/g,'\x27'));var _0x5439c8=phoneDescriptions['find'](_0x13e437=>_0x13e437[_0xdf15('0x7f')]===_0x5b2799['id']);if(!_[_0xdf15('0x18')](_0x5439c8)){var _0x20f4b0=_[_0xdf15('0x80')](_0x3df369[_0xdf15('0x71')][_0x3c74f2][_0x4768ba[_0x5439c8[_0xdf15('0x81')]][0x0]][_0xdf15('0x7e')](/"/g,'\x27'));if(!_[_0xdf15('0x18')](_0x20f4b0))_0x89adf=_0x89adf+'§'+_0x20f4b0;}if(_0x502c90=='')_0x502c90=_0x89adf;else _0x502c90+='|'+_0x89adf;}_0x5767ca[_0xdf15('0x1a')](_0x5b2799['id']+':'+_0x502c90);_0x1607cd[_0x5b2799['id']]=0x1;}}}}if(hasAdditionalPhones){_0x21affc[_0xdf15('0x1a')]('\x22'+_0x5767ca[_0xdf15('0x11')](';')+'\x22');}if(_0x30867d[_0xdf15('0x17')]){handleError(_0x3df369[_0xdf15('0x71')][_0x3c74f2],{'code':_0xdf15('0x82'),'message':_0x30867d[_0xdf15('0x11')]()});}else{fs[_0xdf15('0x83')](_0x195fa2,_0x21affc[_0xdf15('0x11')]()+'\x0a');}_0x21affc=[];}if(!(stats[_0xdf15('0x72')]%0xc8)){socket[_0xdf15('0x84')]('contact:import:'+_0x5bcf36,stats);stats['errors']=[];}}if(stopped){logger[_0xdf15('0x5b')](_0xdf15('0x85'));_0x5a04f4['abort']();}}catch(_0x46076a){handleError(_0x3df369[_0xdf15('0x71')][_0x3c74f2],{'code':'SystemError','message':_0x46076a[_0xdf15('0x1f')]});logger['error']('step',_0x46076a['message']);}},'complete':function(){try{var _0xc1b1b9=[];var _0x5d79d0=tempTableName;_0xc1b1b9[_0xdf15('0x1a')](_0xdf15('0x86')+_0x5d79d0+_0xdf15('0x87'));logger[_0xdf15('0x5b')](_0xdf15('0x88'),contactItemTypes['length']);var _0x267901=util[_0xdf15('0xb')](_0xdf15('0x89'),_0x195fa2,_0x5d79d0,_0x3366c4,_0x58beea[_0xdf15('0x37')],_0x58beea[_0xdf15('0x55')]||null,NOW,NOW);if(_[_0xdf15('0x18')](_0x4768ba[_0xdf15('0x35')])){_0x267901+=_0xdf15('0x8a');}_0xc1b1b9['push'](_0x267901);BPromise['each'](_0xc1b1b9,handleQuery)[_0xdf15('0x1c')](function(_0xf50787){BPromise[_0xdf15('0x1b')]([handleAdditionalPhones()])[_0xdf15('0x1c')](function(){_0xc1b1b9=[];for(var _0x5eb89c=0x0;_0x5eb89c<promisesContact[_0xdf15('0x17')];_0x5eb89c++){_0xc1b1b9['push'](updateContact(promisesContact[_0x5eb89c]['contact']));}BPromise[_0xdf15('0x1b')](_0xc1b1b9)[_0xdf15('0x1c')](function(){_0xc1b1b9=[];for(var _0x4bf2c1=0x0;_0x4bf2c1<promisesAdditionalPhones[_0xdf15('0x17')];_0x4bf2c1++){_0xc1b1b9[_0xdf15('0x1a')](createAdditionalPhone(promisesAdditionalPhones[_0x4bf2c1][_0xdf15('0x8b')],promisesAdditionalPhones[_0x4bf2c1][_0xdf15('0x8c')],promisesAdditionalPhones[_0x4bf2c1]['phone'],promisesAdditionalPhones[_0x4bf2c1][_0xdf15('0x8d')]));}BPromise[_0xdf15('0x1b')](_0xc1b1b9)[_0xdf15('0x1c')](function(){_0xc1b1b9=[];_0xc1b1b9[_0xdf15('0x1a')](insertCmHopperAdditionalPhones(_0x58beea[_0xdf15('0x37')]));_0xc1b1b9['push'](_0xdf15('0x8e')+_0x5d79d0+';');BPromise[_0xdf15('0x8f')](_0xc1b1b9,handleQuery)[_0xdf15('0x1c')](function(_0x5ee8fe){stats[_0xdf15('0x90')]=!![];stats[_0xdf15('0x91')]=updatedRows;socket[_0xdf15('0x84')]('contact:import:'+_0x5bcf36,stats);fs[_0xdf15('0x92')](_0x50d429);fs[_0xdf15('0x92')](_0x195fa2);process[_0xdf15('0x5d')](0x0);})[_0xdf15('0x1d')](function(_0x3ccd1f){logger['error'](_0x3ccd1f['message']);process['exit'](0x1);});});});});})[_0xdf15('0x1d')](function(_0x3ec5e3){logger[_0xdf15('0x1e')](_0x3ec5e3[_0xdf15('0x1f')]);process[_0xdf15('0x5d')](0x1);});}catch(_0x1895f9){logger[_0xdf15('0x1e')](_0xdf15('0x93'),_0x1895f9[_0xdf15('0x1f')]);process['exit'](0x1);}},'error':function(_0x4e0c80,_0x924461,_0x516e24,_0x4acfb2){throw new Error(_0x4acfb2);}});});}function validate(){if(process[_0xdf15('0x94')]&&process[_0xdf15('0x94')][_0xdf15('0x17')]<0x4){throw new Error(_0xdf15('0x95'));}var _0x516fcc=path['join'](config[_0xdf15('0x96')],_0xdf15('0x97'),process[_0xdf15('0x94')][0x2]);if(!fs['existsSync'](_0x516fcc)){throw new Error(_0xdf15('0x98'));}var _0x370ce6={};try{_0x370ce6=JSON[_0xdf15('0x99')](process[_0xdf15('0x94')][0x3]);if(!_0x370ce6[_0xdf15('0x65')]){throw new Error(_0xdf15('0x9a'));}var _0x5af9c3=0x0;if(_0x370ce6[_0xdf15('0x65')]['UserId']){_0x5af9c3=0x1;}if(!_0x370ce6[_0xdf15('0x37')]){throw new Error(_0xdf15('0x9b'));}}catch(_0x48be86){throw new Error(_0xdf15('0x9c'));}var _0x3212fb=[];try{_0x3212fb=_[_0xdf15('0x9d')](JSON[_0xdf15('0x99')](process[_0xdf15('0x94')][0x4]),'id');}catch(_0x3f941d){logger['info'](_0xdf15('0x9e'));}main(_0x516fcc,_0x370ce6,_0x3212fb,_0x5af9c3);}validate();process['on'](_0xdf15('0x9f'),handleStop);process['on'](_0xdf15('0xa0'),handleUncaughtException);
\ No newline at end of file
index df2ee5a..fcb46b5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x82b1=['Member\x20Name','Answer\x20Time','answertime','Complete\x20Time','Duration','duration','billableseconds','string','[xCALLY\x20Ticket]','toLowerCase','voice','inbound','queue','push','variable','calleridnum','getDescriptions','***\x20Call\x20Info\x20***','keyValue','Caller\x20Number','Caller\x20Name','calleridname','Call\x20To','destexten','UniqueId','uniqueid','Date','agentcalledAt','Agent\x20Name','Agent\x20Number','destcalleridnum','***\x20Time\x20Info\x20***','Agent\x20Ring','Agent\x20Connect','Agent\x20Complete','Hold\x20Time','Talk\x20Time','talktime','outbound','Called\x20Number'];(function(_0x3d3ef3,_0x446b4c){var _0xb5d433=function(_0x44a22a){while(--_0x44a22a){_0x3d3ef3['push'](_0x3d3ef3['shift']());}};_0xb5d433(++_0x446b4c);}(_0x82b1,0x7f));var _0x182b=function(_0x1ef7ad,_0xfbe45b){_0x1ef7ad=_0x1ef7ad-0x0;var _0x1346a8=_0x82b1[_0x1ef7ad];return _0x1346a8;};'use strict';exports['getSubjects']=function(_0x131b4b,_0x23e86d){var _0x37b959=[{'type':_0x182b('0x0'),'content':_0x182b('0x1'),'variableName':null}];switch(_0x131b4b[_0x182b('0x2')]()){case _0x182b('0x3'):switch(_0x23e86d[_0x182b('0x2')]()){case _0x182b('0x4'):_0x37b959['push']({'type':'variable','content':'','variableName':_0x182b('0x5')});_0x37b959[_0x182b('0x6')]({'type':_0x182b('0x7'),'content':'','variableName':_0x182b('0x8')});break;case'outbound':_0x37b959[_0x182b('0x6')]({'type':'string','content':'Outbound\x20Call','variableName':null});_0x37b959[_0x182b('0x6')]({'type':_0x182b('0x7'),'content':'','variableName':'destcalleridnum'});break;}}return _0x37b959;};exports[_0x182b('0x9')]=function(_0x5ac139,_0x4e894b){var _0x5b95e9=[];switch(_0x5ac139[_0x182b('0x2')]()){case _0x182b('0x3'):switch(_0x4e894b[_0x182b('0x2')]()){case _0x182b('0x4'):_0x5b95e9=[{'type':_0x182b('0x0'),'content':_0x182b('0xa'),'key':null,'keyType':null,'variableName':null},{'type':_0x182b('0xb'),'content':'','key':_0x182b('0xc'),'keyType':_0x182b('0x7'),'variableName':'calleridnum'},{'type':_0x182b('0xb'),'content':'','key':_0x182b('0xd'),'keyType':'variable','variableName':_0x182b('0xe')},{'type':_0x182b('0xb'),'content':'','key':_0x182b('0xf'),'keyType':_0x182b('0x7'),'variableName':_0x182b('0x10')},{'type':'keyValue','content':'','key':'Queue','keyType':'variable','variableName':'queue'},{'type':_0x182b('0xb'),'content':'','key':_0x182b('0x11'),'keyType':_0x182b('0x7'),'variableName':_0x182b('0x12')},{'type':_0x182b('0xb'),'content':'','key':_0x182b('0x13'),'keyType':'variable','variableName':_0x182b('0x14')},{'type':_0x182b('0x0'),'content':'***\x20Agent\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0x182b('0x15'),'keyType':_0x182b('0x7'),'variableName':'destcalleridname'},{'type':_0x182b('0xb'),'content':'','key':_0x182b('0x16'),'keyType':'variable','variableName':_0x182b('0x17')},{'type':_0x182b('0x0'),'content':_0x182b('0x18'),'key':null,'keyType':null,'variableName':null},{'type':_0x182b('0xb'),'content':'','key':_0x182b('0x19'),'keyType':_0x182b('0x7'),'variableName':_0x182b('0x14')},{'type':'keyValue','content':'','key':_0x182b('0x1a'),'keyType':_0x182b('0x7'),'variableName':'agentconnectAt'},{'type':_0x182b('0xb'),'content':'','key':_0x182b('0x1b'),'keyType':_0x182b('0x7'),'variableName':'agentcompleteAt'},{'type':_0x182b('0xb'),'content':'','key':_0x182b('0x1c'),'keyType':_0x182b('0x7'),'variableName':'holdtime'},{'type':_0x182b('0xb'),'content':'','key':_0x182b('0x1d'),'keyType':_0x182b('0x7'),'variableName':_0x182b('0x1e')}];break;case _0x182b('0x1f'):_0x5b95e9=[{'type':_0x182b('0x0'),'content':_0x182b('0xa'),'variableName':null},{'type':_0x182b('0xb'),'content':'','key':_0x182b('0x20'),'keyType':_0x182b('0x7'),'keyContent':'','variableName':_0x182b('0x17')},{'type':'keyValue','content':'','key':_0x182b('0x21'),'keyType':'variable','keyContent':'','variableName':'membername'},{'type':_0x182b('0xb'),'content':'','key':_0x182b('0x11'),'keyType':_0x182b('0x7'),'keyContent':'','variableName':_0x182b('0x12')},{'type':'keyValue','content':'','key':_0x182b('0x13'),'keyType':_0x182b('0x7'),'keyContent':'','variableName':'starttime'},{'type':_0x182b('0x0'),'content':_0x182b('0x18')},{'type':_0x182b('0xb'),'content':'','key':_0x182b('0x22'),'keyType':_0x182b('0x7'),'keyContent':'','variableName':_0x182b('0x23')},{'type':_0x182b('0xb'),'content':'','key':_0x182b('0x24'),'keyType':'variable','keyContent':'','variableName':'endtime'},{'type':'keyValue','content':'','key':_0x182b('0x25'),'keyType':_0x182b('0x7'),'keyContent':'','variableName':_0x182b('0x26')},{'type':_0x182b('0xb'),'content':'','key':'Billable\x20Time','keyType':_0x182b('0x7'),'keyContent':'','variableName':_0x182b('0x27')}];break;}}return _0x5b95e9;};
\ No newline at end of file
+var _0x664b=['destexten','Queue','UniqueId','agentcalledAt','***\x20Agent\x20Info\x20***','destcalleridname','Agent\x20Number','destcalleridnum','***\x20Time\x20Info\x20***','Agent\x20Ring','Agent\x20Complete','agentcompleteAt','Hold\x20Time','Talk\x20Time','talktime','Called\x20Number','Member\x20Name','membername','uniqueid','Date','starttime','Answer\x20Time','answertime','Complete\x20Time','Billable\x20Time','billableseconds','getSubjects','string','[xCALLY\x20Ticket]','toLowerCase','voice','inbound','push','variable','calleridnum','outbound','Outbound\x20Call','getDescriptions','***\x20Call\x20Info\x20***','Caller\x20Number','keyValue','calleridname','Call\x20To'];(function(_0x1ebb10,_0x156b3e){var _0x20d709=function(_0x4cc093){while(--_0x4cc093){_0x1ebb10['push'](_0x1ebb10['shift']());}};_0x20d709(++_0x156b3e);}(_0x664b,0xf1));var _0xb664=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x664b[_0x42cae2];return _0x5f256f;};'use strict';exports[_0xb664('0x0')]=function(_0xab14ed,_0x5c0933){var _0x524ca2=[{'type':_0xb664('0x1'),'content':_0xb664('0x2'),'variableName':null}];switch(_0xab14ed[_0xb664('0x3')]()){case _0xb664('0x4'):switch(_0x5c0933[_0xb664('0x3')]()){case _0xb664('0x5'):_0x524ca2[_0xb664('0x6')]({'type':_0xb664('0x7'),'content':'','variableName':'queue'});_0x524ca2[_0xb664('0x6')]({'type':'variable','content':'','variableName':_0xb664('0x8')});break;case _0xb664('0x9'):_0x524ca2[_0xb664('0x6')]({'type':_0xb664('0x1'),'content':_0xb664('0xa'),'variableName':null});_0x524ca2[_0xb664('0x6')]({'type':_0xb664('0x7'),'content':'','variableName':'destcalleridnum'});break;}}return _0x524ca2;};exports[_0xb664('0xb')]=function(_0x1e1cfc,_0x42f9ea){var _0x5cef63=[];switch(_0x1e1cfc[_0xb664('0x3')]()){case'voice':switch(_0x42f9ea[_0xb664('0x3')]()){case'inbound':_0x5cef63=[{'type':'string','content':_0xb664('0xc'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0xb664('0xd'),'keyType':_0xb664('0x7'),'variableName':_0xb664('0x8')},{'type':_0xb664('0xe'),'content':'','key':'Caller\x20Name','keyType':_0xb664('0x7'),'variableName':_0xb664('0xf')},{'type':'keyValue','content':'','key':_0xb664('0x10'),'keyType':'variable','variableName':_0xb664('0x11')},{'type':_0xb664('0xe'),'content':'','key':_0xb664('0x12'),'keyType':_0xb664('0x7'),'variableName':'queue'},{'type':_0xb664('0xe'),'content':'','key':_0xb664('0x13'),'keyType':_0xb664('0x7'),'variableName':'uniqueid'},{'type':_0xb664('0xe'),'content':'','key':'Date','keyType':_0xb664('0x7'),'variableName':_0xb664('0x14')},{'type':_0xb664('0x1'),'content':_0xb664('0x15'),'key':null,'keyType':null,'variableName':null},{'type':_0xb664('0xe'),'content':'','key':'Agent\x20Name','keyType':_0xb664('0x7'),'variableName':_0xb664('0x16')},{'type':_0xb664('0xe'),'content':'','key':_0xb664('0x17'),'keyType':_0xb664('0x7'),'variableName':_0xb664('0x18')},{'type':'string','content':_0xb664('0x19'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0xb664('0x1a'),'keyType':'variable','variableName':_0xb664('0x14')},{'type':_0xb664('0xe'),'content':'','key':'Agent\x20Connect','keyType':'variable','variableName':'agentconnectAt'},{'type':_0xb664('0xe'),'content':'','key':_0xb664('0x1b'),'keyType':_0xb664('0x7'),'variableName':_0xb664('0x1c')},{'type':_0xb664('0xe'),'content':'','key':_0xb664('0x1d'),'keyType':_0xb664('0x7'),'variableName':'holdtime'},{'type':_0xb664('0xe'),'content':'','key':_0xb664('0x1e'),'keyType':_0xb664('0x7'),'variableName':_0xb664('0x1f')}];break;case _0xb664('0x9'):_0x5cef63=[{'type':_0xb664('0x1'),'content':_0xb664('0xc'),'variableName':null},{'type':'keyValue','content':'','key':_0xb664('0x20'),'keyType':'variable','keyContent':'','variableName':'destcalleridnum'},{'type':_0xb664('0xe'),'content':'','key':_0xb664('0x21'),'keyType':_0xb664('0x7'),'keyContent':'','variableName':_0xb664('0x22')},{'type':'keyValue','content':'','key':'UniqueId','keyType':'variable','keyContent':'','variableName':_0xb664('0x23')},{'type':_0xb664('0xe'),'content':'','key':_0xb664('0x24'),'keyType':_0xb664('0x7'),'keyContent':'','variableName':_0xb664('0x25')},{'type':_0xb664('0x1'),'content':'***\x20Time\x20Info\x20***'},{'type':_0xb664('0xe'),'content':'','key':_0xb664('0x26'),'keyType':_0xb664('0x7'),'keyContent':'','variableName':_0xb664('0x27')},{'type':'keyValue','content':'','key':_0xb664('0x28'),'keyType':'variable','keyContent':'','variableName':'endtime'},{'type':_0xb664('0xe'),'content':'','key':'Duration','keyType':'variable','keyContent':'','variableName':'duration'},{'type':_0xb664('0xe'),'content':'','key':_0xb664('0x29'),'keyType':'variable','keyContent':'','variableName':_0xb664('0x2a')}];break;}}return _0x5cef63;};
\ No newline at end of file
index 68efcdf..66e72e4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd3f9=['unknown','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','name','role','null','Interaction','then','update','info','catch','error','tracked','user','query','clone','body','omit','html','phone','fax','mobile','../../mysqldb','../../config/logger','mail-interactions','fax-interactions','sms-interactions','chat-interactions','upperFirst','InteractionId'];(function(_0x54faff,_0x9a3b5e){var _0x5a784c=function(_0x3d1147){while(--_0x3d1147){_0x54faff['push'](_0x54faff['shift']());}};_0x5a784c(++_0x9a3b5e);}(_0xd3f9,0xca));var _0x9d3f=function(_0x8ca6fa,_0x11fcee){_0x8ca6fa=_0x8ca6fa-0x0;var _0x234f10=_0xd3f9[_0x8ca6fa];return _0x234f10;};'use strict';var _=require('lodash');var db=require(_0x9d3f('0x0'))['db'];var loggers={'openchannel':require(_0x9d3f('0x1'))('openchannel-interactions'),'mail':require(_0x9d3f('0x1'))(_0x9d3f('0x2')),'fax':require(_0x9d3f('0x1'))(_0x9d3f('0x3')),'sms':require(_0x9d3f('0x1'))(_0x9d3f('0x4')),'chat':require(_0x9d3f('0x1'))(_0x9d3f('0x5')),'whatsapp':require('../../config/logger')('whatsapp-interactions')};function getInteractionId(_0xc51e10,_0x129901,_0x11cf69){if(_0xc51e10&&_0xc51e10[_[_0x9d3f('0x6')](_0x11cf69)+'InteractionId']){return _0xc51e10[_[_0x9d3f('0x6')](_0x11cf69)+_0x9d3f('0x7')];}else if(_0xc51e10&&_0xc51e10['id']){return _0xc51e10['id'];}else if(_0x129901&&_0x129901['id']){return _0x129901['id'];}else{return _0x9d3f('0x8');}}function log(_0x375cab,_0x384292,_0x1890e5,_0x581b42,_0xe5edb6,_0x572c67){loggers[_0xe5edb6[_0x9d3f('0x9')]()][_0x375cab](_0x9d3f('0xa'),_0x572c67['toUpperCase'](),_0x384292?_0x384292['id']:null,_0x384292?_0x384292[_0x9d3f('0xb')]:null,_0x384292?_0x384292[_0x9d3f('0xc')]:null,getInteractionId(_0x1890e5,_0x581b42,_0xe5edb6),_0x1890e5?JSON['stringify'](_0x1890e5):_0x9d3f('0xd'));}function updateUser(_0x45acd6,_0x360452,_0x42ef92,_0xf9a935,_0x3b6cdc){db[_[_0x9d3f('0x6')](_0xf9a935)+_0x9d3f('0xe')]['findOne']({'where':{'id':getInteractionId(_0x360452,_0x42ef92,_0xf9a935)}})[_0x9d3f('0xf')](function(_0x120faa){if(_0x120faa){return _0x120faa[_0x9d3f('0x10')]({'UserId':_0x45acd6?_0x45acd6['id']:null});}})[_0x9d3f('0xf')](function(_0x3a158c){if(_0x3a158c){log(_0x9d3f('0x11'),_0x45acd6,_0x360452,_0x42ef92,_0xf9a935,_0x3b6cdc);}})[_0x9d3f('0x12')](function(){log(_0x9d3f('0x13'),_0x45acd6,_0x360452,_0x42ef92,_0xf9a935,_0x3b6cdc);});}exports[_0x9d3f('0x14')]=function(_0x2728ab,_0x4d58b5){return function(_0xc16c15,_0x487524,_0x468e53){var _0x5f43b0=_0xc16c15[_0x9d3f('0x15')];var _0x1b94d3={};var _0x57a442=_0xc16c15[_0x9d3f('0x16')];if(_0x1b94d3){_0x1b94d3=_[_0x9d3f('0x17')](_0xc16c15[_0x9d3f('0x18')]);_0x1b94d3=_[_0x9d3f('0x19')](_0x1b94d3,[_0x9d3f('0x18'),_0x9d3f('0x1a'),_0x9d3f('0x1b'),_0x9d3f('0x1c'),_0x9d3f('0x1d')]);}updateUser(_0x5f43b0,_0x1b94d3,_0x57a442,_0x2728ab,_0x4d58b5);_0x468e53(null);};};
\ No newline at end of file
+var _0x0069=['stringify','null','Interaction','findOne','then','update','info','error','tracked','user','query','clone','body','html','phone','fax','mobile','lodash','../../mysqldb','../../config/logger','openchannel-interactions','mail-interactions','fax-interactions','chat-interactions','whatsapp-interactions','InteractionId','unknown','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0069,0x89));var _0x9006=function(_0x1dc337,_0x163446){_0x1dc337=_0x1dc337-0x0;var _0x2c4d04=_0x0069[_0x1dc337];return _0x2c4d04;};'use strict';var _=require(_0x9006('0x0'));var db=require(_0x9006('0x1'))['db'];var loggers={'openchannel':require(_0x9006('0x2'))(_0x9006('0x3')),'mail':require(_0x9006('0x2'))(_0x9006('0x4')),'fax':require(_0x9006('0x2'))(_0x9006('0x5')),'sms':require(_0x9006('0x2'))('sms-interactions'),'chat':require(_0x9006('0x2'))(_0x9006('0x6')),'whatsapp':require(_0x9006('0x2'))(_0x9006('0x7'))};function getInteractionId(_0x142c6b,_0x3941b8,_0x4c5150){if(_0x142c6b&&_0x142c6b[_['upperFirst'](_0x4c5150)+_0x9006('0x8')]){return _0x142c6b[_['upperFirst'](_0x4c5150)+'InteractionId'];}else if(_0x142c6b&&_0x142c6b['id']){return _0x142c6b['id'];}else if(_0x3941b8&&_0x3941b8['id']){return _0x3941b8['id'];}else{return _0x9006('0x9');}}function log(_0x49f7c5,_0x47eca5,_0x100faa,_0x4c3892,_0x419ea4,_0x5b07a1){loggers[_0x419ea4[_0x9006('0xa')]()][_0x49f7c5](_0x9006('0xb'),_0x5b07a1['toUpperCase'](),_0x47eca5?_0x47eca5['id']:null,_0x47eca5?_0x47eca5['name']:null,_0x47eca5?_0x47eca5[_0x9006('0xc')]:null,getInteractionId(_0x100faa,_0x4c3892,_0x419ea4),_0x100faa?JSON[_0x9006('0xd')](_0x100faa):_0x9006('0xe'));}function updateUser(_0x3fdcd4,_0x54305e,_0x24ee94,_0x3468f1,_0x61519f){db[_['upperFirst'](_0x3468f1)+_0x9006('0xf')][_0x9006('0x10')]({'where':{'id':getInteractionId(_0x54305e,_0x24ee94,_0x3468f1)}})[_0x9006('0x11')](function(_0x1fc801){if(_0x1fc801){return _0x1fc801[_0x9006('0x12')]({'UserId':_0x3fdcd4?_0x3fdcd4['id']:null});}})[_0x9006('0x11')](function(_0x20390f){if(_0x20390f){log(_0x9006('0x13'),_0x3fdcd4,_0x54305e,_0x24ee94,_0x3468f1,_0x61519f);}})['catch'](function(){log(_0x9006('0x14'),_0x3fdcd4,_0x54305e,_0x24ee94,_0x3468f1,_0x61519f);});}exports[_0x9006('0x15')]=function(_0x38ef17,_0x5828cd){return function(_0x6caad4,_0x12321d,_0x4c0d5a){var _0x30b7c1=_0x6caad4[_0x9006('0x16')];var _0x2af9cd={};var _0x13c181=_0x6caad4[_0x9006('0x17')];if(_0x2af9cd){_0x2af9cd=_[_0x9006('0x18')](_0x6caad4[_0x9006('0x19')]);_0x2af9cd=_['omit'](_0x2af9cd,[_0x9006('0x19'),_0x9006('0x1a'),_0x9006('0x1b'),_0x9006('0x1c'),_0x9006('0x1d')]);}updateUser(_0x30b7c1,_0x2af9cd,_0x13c181,_0x38ef17,_0x5828cd);_0x4c0d5a(null);};};
\ No newline at end of file
index 74432d4..950dac2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1a9e=['utf8','final','parse','hasOwnProperty','use','License','findOne','then','status','catch','User','user','isUserLimit','crypto','util','composable-middleware','../../mysqldb','../../config/environment','data1','license','split','createDecipher','aes-256-ctr','update'];(function(_0xaaf2e2,_0x19d28a){var _0x28bc36=function(_0x53bdb5){while(--_0x53bdb5){_0xaaf2e2['push'](_0xaaf2e2['shift']());}};_0x28bc36(++_0x19d28a);}(_0x1a9e,0xfd));var _0xe1a9=function(_0x58126e,_0x4bb254){_0x58126e=_0x58126e-0x0;var _0x59617c=_0x1a9e[_0x58126e];return _0x59617c;};'use strict';var crypto=require(_0xe1a9('0x0'));var util=require(_0xe1a9('0x1'));var compose=require(_0xe1a9('0x2'));var db=require(_0xe1a9('0x3'))['db'];var config=require(_0xe1a9('0x4'));function getValueFromLicense(_0x17a8de,_0x303701){if(_0x17a8de&&_0x303701){if(_0x303701[_0xe1a9('0x5')]&&_0x303701[_0xe1a9('0x6')]){var _0x1cf361=_0x303701['data1'];var _0x58faba=_0x303701[_0xe1a9('0x6')];var _0x3d239d=_0x1cf361[_0xe1a9('0x7')]('-')[0x4];var _0xd8675b=_0x1cf361['split']('-')[0x0];var _0x334793=crypto[_0xe1a9('0x8')](_0xe1a9('0x9'),util['format']('%s:%s:%s',_0x3d239d,_0x1cf361,_0xd8675b));var _0x45d3e0=_0x334793[_0xe1a9('0xa')](_0x58faba,'base64',_0xe1a9('0xb'));_0x45d3e0+=_0x334793[_0xe1a9('0xc')](_0xe1a9('0xb'));var _0x26c7ed=JSON[_0xe1a9('0xd')](_0x45d3e0);return _0x26c7ed[_0xe1a9('0xe')](_0x17a8de)?_0x26c7ed[_0x17a8de]:null;}}return null;}function isLimit(_0x4b5775,_0x5d83a6,_0x43b7be,_0x39c0c3){var _0x1264c5=_0x5d83a6;return compose()[_0xe1a9('0xf')](function(_0x230218,_0x315364,_0x55b321){return db[_0xe1a9('0x10')][_0xe1a9('0x11')]({'where':{'id':0x1},'raw':!![]})[_0xe1a9('0x12')](function(_0x15b141){var _0x231a9f=getValueFromLicense(_0x4b5775,_0x15b141);return _0x231a9f?_0x231a9f:_0x1264c5;})[_0xe1a9('0x12')](function(_0x4b96d9){_0x1264c5=_0x4b96d9;return _0x43b7be['count'](_0x39c0c3);})[_0xe1a9('0x12')](function(_0x1b3f8c){if(_0x1b3f8c>=_0x1264c5){return _0x315364[_0xe1a9('0x13')](0x193)['json']({'message':util['format']('Maximum\x20%s\x20limit\x20have\x20been\x20reached',_0x4b5775)});}_0x55b321();})[_0xe1a9('0x14')](function(_0x4ea08f){_0x55b321(_0x4ea08f);});});}function isUserLimit(){return isLimit('users',0x1,db[_0xe1a9('0x15')],{'where':{'$or':[{'role':'admin'},{'role':_0xe1a9('0x16')}]}});}exports[_0xe1a9('0x17')]=isUserLimit;
\ No newline at end of file
+var _0x8f68=['split','createDecipher','aes-256-ctr','%s:%s:%s','update','base64','final','utf8','parse','hasOwnProperty','License','then','count','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','User','admin','user','isUserLimit','crypto','util','composable-middleware','../../mysqldb','../../config/environment','data1','license'];(function(_0x3b7276,_0x9db638){var _0x528210=function(_0x49c552){while(--_0x49c552){_0x3b7276['push'](_0x3b7276['shift']());}};_0x528210(++_0x9db638);}(_0x8f68,0xe1));var _0x88f6=function(_0x3be56b,_0x135bc6){_0x3be56b=_0x3be56b-0x0;var _0x30af13=_0x8f68[_0x3be56b];return _0x30af13;};'use strict';var crypto=require(_0x88f6('0x0'));var util=require(_0x88f6('0x1'));var compose=require(_0x88f6('0x2'));var db=require(_0x88f6('0x3'))['db'];var config=require(_0x88f6('0x4'));function getValueFromLicense(_0x5040ad,_0x45c104){if(_0x5040ad&&_0x45c104){if(_0x45c104[_0x88f6('0x5')]&&_0x45c104[_0x88f6('0x6')]){var _0x3b7359=_0x45c104[_0x88f6('0x5')];var _0x3cbaaf=_0x45c104[_0x88f6('0x6')];var _0x1e78fb=_0x3b7359[_0x88f6('0x7')]('-')[0x4];var _0x536acd=_0x3b7359['split']('-')[0x0];var _0x1c5f95=crypto[_0x88f6('0x8')](_0x88f6('0x9'),util['format'](_0x88f6('0xa'),_0x1e78fb,_0x3b7359,_0x536acd));var _0x446161=_0x1c5f95[_0x88f6('0xb')](_0x3cbaaf,_0x88f6('0xc'),'utf8');_0x446161+=_0x1c5f95[_0x88f6('0xd')](_0x88f6('0xe'));var _0x4c4167=JSON[_0x88f6('0xf')](_0x446161);return _0x4c4167[_0x88f6('0x10')](_0x5040ad)?_0x4c4167[_0x5040ad]:null;}}return null;}function isLimit(_0x314806,_0x207d9d,_0xcb90eb,_0x3746b3){var _0x4b7c0c=_0x207d9d;return compose()['use'](function(_0xddcecd,_0xb58653,_0x23fff1){return db[_0x88f6('0x11')]['findOne']({'where':{'id':0x1},'raw':!![]})[_0x88f6('0x12')](function(_0x138f7d){var _0x3a6380=getValueFromLicense(_0x314806,_0x138f7d);return _0x3a6380?_0x3a6380:_0x4b7c0c;})[_0x88f6('0x12')](function(_0x598e20){_0x4b7c0c=_0x598e20;return _0xcb90eb[_0x88f6('0x13')](_0x3746b3);})[_0x88f6('0x12')](function(_0x23d62c){if(_0x23d62c>=_0x4b7c0c){return _0xb58653[_0x88f6('0x14')](0x193)[_0x88f6('0x15')]({'message':util['format'](_0x88f6('0x16'),_0x314806)});}_0x23fff1();})[_0x88f6('0x17')](function(_0x575d4e){_0x23fff1(_0x575d4e);});});}function isUserLimit(){return isLimit(_0x88f6('0x18'),0x1,db[_0x88f6('0x19')],{'where':{'$or':[{'role':_0x88f6('0x1a')},{'role':_0x88f6('0x1b')}]}});}exports[_0x88f6('0x1c')]=isUserLimit;
\ No newline at end of file
index 3d85a8c..a6df9b5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6813=['>=\x20?','$substring','start','pop','utcOffset','hours','minutes','seconds','lodash','parseSearch','sqlOperator','replace','[$and]','[$or]','split','length','shift','match','forEach','indexOf','map','buildExpression','DATE','operator','$eq','$between','value','includes','$gt','$lte','add','format','castTo','text','CAST(','field','\x20AS\x20','$notIn','\x20OR\x20','\x20IS\x20NULL)','$in','IN\x20?','NOT\x20IN\x20?','=\x20?','<>\x20?','$startsWith','$endsWith','LIKE\x20?','$lt','<\x20?','>\x20?','<=\x20?','$gte'];(function(_0x4a747d,_0x3b747f){var _0x3a5b5c=function(_0x4b3e81){while(--_0x4b3e81){_0x4a747d['push'](_0x4a747d['shift']());}};_0x3a5b5c(++_0x3b747f);}(_0x6813,0x17b));var _0x3681=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x6813[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x3681('0x0'));var moment=require('moment');exports[_0x3681('0x1')]=function(_0x3a318c){var _0x44b360={'conditions':[]};_0x44b360[_0x3681('0x2')]=_['startsWith'](_0x3a318c,'[$or]')?'or':'and';var _0x2b13dc=_0x3a318c[_0x3681('0x3')](_0x3681('0x4'),'')[_0x3681('0x3')](_0x3681('0x5'),'')[_0x3681('0x6')]('||');for(var _0xb9161a=0x0;_0xb9161a<_0x2b13dc[_0x3681('0x7')];_0xb9161a++){var _0x53c107=_0x2b13dc[_0xb9161a][_0x3681('0x6')](':=');var _0x395107=_0x53c107[0x0];var _0xbe7cda=_0x53c107['slice'](0x1);_0xbe7cda['forEach'](function(_0x4b20fd){var _0x432307=_0x4b20fd[_0x3681('0x6')]('[')[_0x3681('0x8')]();var _0x182077=_0x4b20fd[_0x3681('0x9')](/\[(.*?)\]/g);_0x182077[_0x3681('0xa')](function(_0x448526){var _0x29583b=_0x448526[_0x3681('0x6')]('[')['filter'](function(_0x3112e5){return _0x3112e5[_0x3681('0xb')](']')>-0x1;})[_0x3681('0xc')](function(_0x27abc0){return _0x27abc0[_0x3681('0x6')](']')[0x0];})[0x0];_0x44b360['conditions']['push']({'field':_0x395107,'operator':_0x432307,'value':_0x29583b});});});}return _0x44b360;};exports[_0x3681('0xd')]=function(_0x33c0d0,_0x37c195,_0x1ecb74){var _0x2d2041={};if(_0x37c195===_0x3681('0xe')){if(_0x1ecb74[_0x3681('0xf')]===_0x3681('0x10')){_0x1ecb74[_0x3681('0xf')]=_0x3681('0x11');_0x1ecb74['value']+=','+_0x1ecb74[_0x3681('0x12')];}else if(_[_0x3681('0x13')]([_0x3681('0x14'),_0x3681('0x15')],_0x1ecb74['operator'])){_0x1ecb74[_0x3681('0x12')]=moment(_0x1ecb74[_0x3681('0x12')])[_0x3681('0x16')](0x1,'days')[_0x3681('0x17')]('YYYY-MM-DD');}}if(_0x1ecb74[_0x3681('0x18')]){_0x37c195=_0x1ecb74['castTo'];_0x2d2041[_0x3681('0x19')]=_0x3681('0x1a')+_0x33c0d0+'.'+_0x1ecb74[_0x3681('0x1b')]+_0x3681('0x1c')+_0x1ecb74[_0x3681('0x18')]+')\x20'+parseOperator(_0x1ecb74[_0x3681('0xf')]);}else{_0x2d2041[_0x3681('0x19')]=_0x33c0d0+'.'+_0x1ecb74[_0x3681('0x1b')]+'\x20'+parseOperator(_0x1ecb74['operator']);}if(_['includes'](['$ne',_0x3681('0x1d')],_0x1ecb74['operator']))_0x2d2041[_0x3681('0x19')]='('+_0x2d2041[_0x3681('0x19')]+_0x3681('0x1e')+_0x33c0d0+'.'+_0x1ecb74[_0x3681('0x1b')]+_0x3681('0x1f');_0x2d2041['value']=parseValue(_0x37c195,_0x1ecb74['operator'],_0x1ecb74[_0x3681('0x12')]);return _0x2d2041;};function parseOperator(_0x24ab05){var _0x5830ec;switch(_0x24ab05){case _0x3681('0x20'):_0x5830ec=_0x3681('0x21');break;case _0x3681('0x1d'):_0x5830ec=_0x3681('0x22');break;case _0x3681('0x10'):_0x5830ec=_0x3681('0x23');break;case'$ne':_0x5830ec=_0x3681('0x24');break;case'$substring':case _0x3681('0x25'):case _0x3681('0x26'):_0x5830ec=_0x3681('0x27');break;case _0x3681('0x28'):_0x5830ec=_0x3681('0x29');break;case _0x3681('0x14'):_0x5830ec=_0x3681('0x2a');break;case _0x3681('0x15'):_0x5830ec=_0x3681('0x2b');break;case _0x3681('0x2c'):_0x5830ec=_0x3681('0x2d');break;case'$between':_0x5830ec='BETWEEN\x20?\x20AND\x20?';break;}return _0x5830ec;}function parseValue(_0x12d58d,_0x4e63d8,_0x40bd45){var _0x2e0a85={'start':undefined,'end':undefined};switch(_0x4e63d8){case _0x3681('0x20'):case _0x3681('0x1d'):_0x2e0a85['start']=_0x40bd45[_0x3681('0x6')](',');break;case _0x3681('0x2e'):_0x2e0a85[_0x3681('0x2f')]='%'+_0x40bd45+'%';break;case _0x3681('0x25'):_0x2e0a85[_0x3681('0x2f')]=_0x40bd45+'%';break;case _0x3681('0x26'):_0x2e0a85[_0x3681('0x2f')]='%'+_0x40bd45;break;case _0x3681('0x11'):var _0x2f7d0c=_0x40bd45[_0x3681('0x6')](',');var _0x40bd45=_0x2f7d0c[_0x3681('0x8')]();var _0x3da77a=_0x2f7d0c[_0x3681('0x30')]();if(_0x12d58d===_0x3681('0xe')){_0x40bd45=moment(_0x40bd45)['utcOffset'](0x0,!![])[_0x3681('0x17')]();_0x3da77a=moment(_0x3da77a)[_0x3681('0x31')](0x0,!![])['add'](0x17,_0x3681('0x32'))[_0x3681('0x16')](0x3b,_0x3681('0x33'))[_0x3681('0x16')](0x3b,_0x3681('0x34'))[_0x3681('0x17')]();}_0x2e0a85={'start':_0x40bd45,'end':_0x3da77a};break;default:_0x2e0a85['start']=_0x40bd45;break;}return _0x2e0a85;}
\ No newline at end of file
+var _0x0cbc=['sqlOperator','startsWith','and','[$and]','[$or]','split','slice','forEach','shift','match','filter','indexOf','map','conditions','push','buildExpression','DATE','$eq','operator','$between','value','includes','$gt','$lte','add','days','format','YYYY-MM-DD','castTo','text','CAST(','field','\x20AS\x20','$ne','\x20OR\x20','\x20IS\x20NULL)','$in','IN\x20?','$notIn','NOT\x20IN\x20?','=\x20?','$substring','$startsWith','$endsWith','LIKE\x20?','$lt','<\x20?','>\x20?','$gte','>=\x20?','start','pop','utcOffset','hours','minutes','seconds','moment','parseSearch'];(function(_0x13eb4c,_0x15fb3c){var _0x183daf=function(_0x398118){while(--_0x398118){_0x13eb4c['push'](_0x13eb4c['shift']());}};_0x183daf(++_0x15fb3c);}(_0x0cbc,0x194));var _0xc0cb=function(_0x450689,_0x3b857c){_0x450689=_0x450689-0x0;var _0x46ffb0=_0x0cbc[_0x450689];return _0x46ffb0;};'use strict';var _=require('lodash');var moment=require(_0xc0cb('0x0'));exports[_0xc0cb('0x1')]=function(_0x16d76f){var _0x4daf5e={'conditions':[]};_0x4daf5e[_0xc0cb('0x2')]=_[_0xc0cb('0x3')](_0x16d76f,'[$or]')?'or':_0xc0cb('0x4');var _0x5a34b4=_0x16d76f['replace'](_0xc0cb('0x5'),'')['replace'](_0xc0cb('0x6'),'')[_0xc0cb('0x7')]('||');for(var _0x3181c5=0x0;_0x3181c5<_0x5a34b4['length'];_0x3181c5++){var _0x195940=_0x5a34b4[_0x3181c5]['split'](':=');var _0x393d8b=_0x195940[0x0];var _0x56daff=_0x195940[_0xc0cb('0x8')](0x1);_0x56daff[_0xc0cb('0x9')](function(_0x3eaddd){var _0x312087=_0x3eaddd[_0xc0cb('0x7')]('[')[_0xc0cb('0xa')]();var _0x421da3=_0x3eaddd[_0xc0cb('0xb')](/\[(.*?)\]/g);_0x421da3['forEach'](function(_0x43146c){var _0x54308e=_0x43146c[_0xc0cb('0x7')]('[')[_0xc0cb('0xc')](function(_0x5bb874){return _0x5bb874[_0xc0cb('0xd')](']')>-0x1;})[_0xc0cb('0xe')](function(_0x348e90){return _0x348e90[_0xc0cb('0x7')](']')[0x0];})[0x0];_0x4daf5e[_0xc0cb('0xf')][_0xc0cb('0x10')]({'field':_0x393d8b,'operator':_0x312087,'value':_0x54308e});});});}return _0x4daf5e;};exports[_0xc0cb('0x11')]=function(_0x4cc1fa,_0x819945,_0x4a0e3f){var _0x34d96c={};if(_0x819945===_0xc0cb('0x12')){if(_0x4a0e3f['operator']===_0xc0cb('0x13')){_0x4a0e3f[_0xc0cb('0x14')]=_0xc0cb('0x15');_0x4a0e3f[_0xc0cb('0x16')]+=','+_0x4a0e3f[_0xc0cb('0x16')];}else if(_[_0xc0cb('0x17')]([_0xc0cb('0x18'),_0xc0cb('0x19')],_0x4a0e3f[_0xc0cb('0x14')])){_0x4a0e3f[_0xc0cb('0x16')]=moment(_0x4a0e3f[_0xc0cb('0x16')])[_0xc0cb('0x1a')](0x1,_0xc0cb('0x1b'))[_0xc0cb('0x1c')](_0xc0cb('0x1d'));}}if(_0x4a0e3f[_0xc0cb('0x1e')]){_0x819945=_0x4a0e3f[_0xc0cb('0x1e')];_0x34d96c[_0xc0cb('0x1f')]=_0xc0cb('0x20')+_0x4cc1fa+'.'+_0x4a0e3f[_0xc0cb('0x21')]+_0xc0cb('0x22')+_0x4a0e3f[_0xc0cb('0x1e')]+')\x20'+parseOperator(_0x4a0e3f['operator']);}else{_0x34d96c['text']=_0x4cc1fa+'.'+_0x4a0e3f['field']+'\x20'+parseOperator(_0x4a0e3f[_0xc0cb('0x14')]);}if(_[_0xc0cb('0x17')]([_0xc0cb('0x23'),'$notIn'],_0x4a0e3f[_0xc0cb('0x14')]))_0x34d96c[_0xc0cb('0x1f')]='('+_0x34d96c[_0xc0cb('0x1f')]+_0xc0cb('0x24')+_0x4cc1fa+'.'+_0x4a0e3f['field']+_0xc0cb('0x25');_0x34d96c[_0xc0cb('0x16')]=parseValue(_0x819945,_0x4a0e3f[_0xc0cb('0x14')],_0x4a0e3f[_0xc0cb('0x16')]);return _0x34d96c;};function parseOperator(_0xf00e19){var _0x35ad5d;switch(_0xf00e19){case _0xc0cb('0x26'):_0x35ad5d=_0xc0cb('0x27');break;case _0xc0cb('0x28'):_0x35ad5d=_0xc0cb('0x29');break;case'$eq':_0x35ad5d=_0xc0cb('0x2a');break;case _0xc0cb('0x23'):_0x35ad5d='<>\x20?';break;case _0xc0cb('0x2b'):case _0xc0cb('0x2c'):case _0xc0cb('0x2d'):_0x35ad5d=_0xc0cb('0x2e');break;case _0xc0cb('0x2f'):_0x35ad5d=_0xc0cb('0x30');break;case _0xc0cb('0x18'):_0x35ad5d=_0xc0cb('0x31');break;case'$lte':_0x35ad5d='<=\x20?';break;case _0xc0cb('0x32'):_0x35ad5d=_0xc0cb('0x33');break;case _0xc0cb('0x15'):_0x35ad5d='BETWEEN\x20?\x20AND\x20?';break;}return _0x35ad5d;}function parseValue(_0x410f3f,_0x2fb541,_0x63e9be){var _0x538c3f={'start':undefined,'end':undefined};switch(_0x2fb541){case _0xc0cb('0x26'):case _0xc0cb('0x28'):_0x538c3f[_0xc0cb('0x34')]=_0x63e9be[_0xc0cb('0x7')](',');break;case _0xc0cb('0x2b'):_0x538c3f['start']='%'+_0x63e9be+'%';break;case'$startsWith':_0x538c3f[_0xc0cb('0x34')]=_0x63e9be+'%';break;case _0xc0cb('0x2d'):_0x538c3f[_0xc0cb('0x34')]='%'+_0x63e9be;break;case'$between':var _0x283f7d=_0x63e9be['split'](',');var _0x63e9be=_0x283f7d[_0xc0cb('0xa')]();var _0x2315a9=_0x283f7d[_0xc0cb('0x35')]();if(_0x410f3f==='DATE'){_0x63e9be=moment(_0x63e9be)[_0xc0cb('0x36')](0x0,!![])[_0xc0cb('0x1c')]();_0x2315a9=moment(_0x2315a9)['utcOffset'](0x0,!![])[_0xc0cb('0x1a')](0x17,_0xc0cb('0x37'))[_0xc0cb('0x1a')](0x3b,_0xc0cb('0x38'))['add'](0x3b,_0xc0cb('0x39'))[_0xc0cb('0x1c')]();}_0x538c3f={'start':_0x63e9be,'end':_0x2315a9};break;default:_0x538c3f[_0xc0cb('0x34')]=_0x63e9be;break;}return _0x538c3f;}
\ No newline at end of file
index 0736f72..879fbdc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x277c=['DATE','$gte','YYYY-MM-DD','utc','format','subtract','name','uniqueid','isArray','limit','offset','sort','map','indexOf','priority','cast','col','unsigned','substr','DESC','ASC','isEmpty','length','omit','isObject','isString','hasOwnProperty','match','^[+]?[0-9]*$','isEmail','forEach','replace','join','getOptions','$id','query','model','attributes','nolimit','pick','filter','object','columns','type','VIRTUAL','where','lower','merge','options','lodash','moment','parse','keys','includes','fields','split','filters','find'];(function(_0x55b6ae,_0x51f1c8){var _0x25447c=function(_0x3c7f25){while(--_0x3c7f25){_0x55b6ae['push'](_0x55b6ae['shift']());}};_0x25447c(++_0x51f1c8);}(_0x277c,0x153));var _0xc277=function(_0x5905c2,_0x3458d7){_0x5905c2=_0x5905c2-0x0;var _0x23a0fc=_0x277c[_0x5905c2];return _0x23a0fc;};'use strict';var _=require(_0xc277('0x0'));var sequelize=require('sequelize');var moment=require(_0xc277('0x1'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x3420cf){var _0x3cd265=['ne'];try{var _0x21d6f2=JSON[_0xc277('0x2')](_0x3420cf);var _0x1fcae3=Object[_0xc277('0x3')](_0x21d6f2)[0x0];return _0x3cd265[_0xc277('0x4')](_0x1fcae3);}catch(_0x4f78ab){return![];}}function getOperatorValue(_0x4bfaeb){var _0x1a6582=JSON['parse'](_0x4bfaeb);var _0x77e168=Object['keys'](_0x1a6582)[0x0];var _0x378158=_0x1a6582[_0x77e168];return{['$'+_0x77e168]:_0x378158};}exports[_0xc277('0x5')]=function(_0x55be1f){var _0x324ef7=null;if(_0x55be1f){_0x324ef7=_0x55be1f[_0xc277('0x6')](',');}return _0x324ef7;};exports[_0xc277('0x7')]=function(_0x1b1db0,_0x3f766f){var _0x1e4087={};if(!_['isEmpty'](_0x1b1db0)){_['forOwn'](_0x1b1db0,function(_0x30a5dc,_0x1632bb){try{if(_0x3f766f){var _0x2df373=_[_0xc277('0x8')](_0x3f766f,{'name':_0x1632bb})||{};if(hasSequelizeOperator(_0x30a5dc)){_0x1e4087[_0x1632bb]=getOperatorValue(_0x30a5dc);}else if(_0x2df373['type']===_0xc277('0x9')&&_['isPlainObject'](_0x30a5dc)){var _0xb6b933=JSON[_0xc277('0x2')](_0x30a5dc);var _0x1850eb={'$gte':moment(moment(_0xb6b933[_0xc277('0xa')])['format'](_0xc277('0xb')))[_0xc277('0xc')]()[_0xc277('0xd')](),'$lte':moment(moment(_0xb6b933['$lte'])['format'](_0xc277('0xb')))['utc']()[_0xc277('0xe')](0x1,'s')['format']()};_0x1e4087[_0x1632bb]=_0x1850eb;}else if(_0x2df373[_0xc277('0xf')]===_0xc277('0x10')){_0x1e4087[_0x1632bb]=_0x30a5dc;}else{_0x1e4087[_0x1632bb]=_[_0xc277('0x11')](_0x30a5dc)?_0x30a5dc:JSON['parse'](_0x30a5dc);}}else{_0x1e4087[_0x1632bb]=_['isArray'](_0x30a5dc)?_0x30a5dc:JSON[_0xc277('0x2')](_0x30a5dc);}}catch(_0x4d23a7){_0x1e4087[_0x1632bb]=_0x30a5dc['split'](',');}});}return _0x1e4087;};exports[_0xc277('0x12')]=function(_0xba31f6){_0xba31f6=parseInt(_0xba31f6,0xa);if(!_0xba31f6||_0xba31f6<0x0){_0xba31f6=LIMIT_VALUE;}return _0xba31f6;};exports[_0xc277('0x13')]=function(_0x176dfb){_0x176dfb=parseInt(_0x176dfb,0xa);if(!_0x176dfb||_0x176dfb<0x0){_0x176dfb=0x0;}return _0x176dfb;};exports[_0xc277('0x14')]=function(_0x355eee){var _0x391cc3,_0x4a7a79=null;if(_0x355eee){_0x391cc3=_0x355eee['split'](',');_0x4a7a79=_[_0xc277('0x15')](_0x391cc3,function(_0x28900e){if(_0x28900e[_0xc277('0x16')]('-')===0x0){return[_0x28900e===_0xc277('0x17')?sequelize[_0xc277('0x18')](sequelize[_0xc277('0x19')](_0xc277('0x17')),_0xc277('0x1a')):_0x28900e[_0xc277('0x1b')](0x1),_0xc277('0x1c')];}else{return[_0x28900e===_0xc277('0x17')?sequelize['cast'](sequelize[_0xc277('0x19')](_0xc277('0x17')),'unsigned'):_0x28900e,_0xc277('0x1d')];}});}return _0x4a7a79;};exports['omit']=function(_0x48124d,_0x3292ab){if(_[_0xc277('0x1e')](_0x48124d)){return _0x48124d;}if(_[_0xc277('0x11')](_0x48124d)){for(var _0x436784=0x0;_0x436784<_0x48124d[_0xc277('0x1f')];_0x436784+=0x1){_0x48124d[_0x436784]=this[_0xc277('0x20')](_0x48124d[_0x436784],_0x3292ab);}return _0x48124d;}if(!_[_0xc277('0x21')](_0x48124d)){return _0x48124d;}if(_[_0xc277('0x22')](_0x3292ab)){_0x3292ab=[_0x3292ab];}if(!_[_0xc277('0x11')](_0x3292ab)){return _0x48124d;}for(var _0x3e04cb=0x0;_0x3e04cb<_0x3292ab[_0xc277('0x1f')];_0x3e04cb+=0x1){_['unset'](_0x48124d,_0x3292ab[_0x3e04cb]);}for(var _0x5f3933 in _0x48124d){if(_0x48124d[_0xc277('0x23')](_0x5f3933)){_0x48124d[_0x5f3933]=this[_0xc277('0x20')](_0x48124d[_0x5f3933],_0x3292ab);}}return _0x48124d;};exports['isNumeric']=function(_0x4efc1e){return _0x4efc1e[_0xc277('0x24')](RegExp(_0xc277('0x25')))?!![]:![];};exports[_0xc277('0x26')]=function(_0x21c78c){return _0x21c78c[_0xc277('0x24')](/^\S+@\S+$/)?!![]:![];};exports['getFullTextValue']=function(_0x43757c){var _0x5edf7e=[];_0x43757c[_0xc277('0x6')](/[ ,]+/)[_0xc277('0x27')](function(_0x4348d9){_0x4348d9=_0x4348d9[_0xc277('0x28')](/([^:]")"+/g,'$1');_0x4348d9='+'+_0x4348d9+'*';var _0x5e9f22=/[ `!@#$%^&*()_\-?~]/;if(_0x4348d9[_0xc277('0x24')](_0x5e9f22))_0x4348d9='\x22'+_0x4348d9+'\x22';_0x5edf7e['push'](_0x4348d9);});return _0x5edf7e[_0xc277('0x29')]('\x20');};exports[_0xc277('0x2a')]=function(_0xbc1a66,_0x3591ab,_0x4f1603){var _0x278e56={},_0x3a7294={};if(_0x3591ab['query'][_0xc277('0x2b')]){_0x3591ab['query']['id']=_0x3591ab[_0xc277('0x2c')][_0xc277('0x2b')];delete _0x3591ab[_0xc277('0x2c')][_0xc277('0x2b')];}_0x278e56[_0xc277('0x2d')]=_[_0xc277('0x15')](_0xbc1a66,_0xc277('0xf'));_0x278e56[_0xc277('0x2c')]=_[_0xc277('0x3')](_0x3591ab[_0xc277('0x2c')]);_0x278e56[_0xc277('0x7')]=_['intersection'](_0x278e56[_0xc277('0x2d')],_0x278e56[_0xc277('0x2c')]);_0x3a7294[_0xc277('0x2e')]=_['intersection'](_0x278e56[_0xc277('0x2d')],this[_0xc277('0x5')](_0x3591ab[_0xc277('0x2c')][_0xc277('0x5')]));_0x3a7294[_0xc277('0x2e')]=_0x3a7294['attributes']['length']?_0x3a7294[_0xc277('0x2e')]:_0x278e56['model'];if(!_0x3591ab[_0xc277('0x2c')][_0xc277('0x23')](_0xc277('0x2f'))){_0x3a7294[_0xc277('0x12')]=this[_0xc277('0x12')](_0x3591ab[_0xc277('0x2c')][_0xc277('0x12')]);_0x3a7294[_0xc277('0x13')]=this[_0xc277('0x13')](_0x3591ab[_0xc277('0x2c')][_0xc277('0x13')]);}_0x3a7294['order']=this[_0xc277('0x14')](_0x3591ab[_0xc277('0x2c')][_0xc277('0x14')]);_0x3a7294['where']=this[_0xc277('0x7')](_[_0xc277('0x30')](_0x3591ab['query'],_0x278e56['filters']),_0xbc1a66);if(_0x3591ab[_0xc277('0x2c')][_0xc277('0x31')]){var _0x22c5b3=_0xbc1a66;var _0x1ca33a=_0x3591ab[_0xc277('0x2c')][_0xc277('0x31')];if(typeof _0x1ca33a===_0xc277('0x32')){_0x22c5b3=_['filter'](_0xbc1a66,function(_0x2561dd){return _[_0xc277('0x4')](_0x1ca33a[_0xc277('0x33')],_0x2561dd['name']);});_0x1ca33a=_0x1ca33a['value'];}_0x3a7294['where']=_['merge'](_0x3a7294['where'],{'$or':_[_0xc277('0x15')](_0x22c5b3,function(_0x4a26e3){if(_0x4a26e3[_0xc277('0x34')]!==_0xc277('0x35')){if(_0x4f1603){return sequelize[_0xc277('0x36')](sequelize['fn']('lower',sequelize[_0xc277('0x19')](_0x4a26e3[_0xc277('0xf')])),{'$like':sequelize['fn'](_0xc277('0x37'),'%'+_0x3591ab[_0xc277('0x2c')]['filter']+'%')});}else{var _0x284630={};_0x284630[_0x4a26e3[_0xc277('0xf')]]={'$like':'%'+_0x3591ab['query'][_0xc277('0x31')]+'%'};return _0x284630;}}})});}_0x3a7294=_[_0xc277('0x38')]({},_0x3a7294,_0x3591ab[_0xc277('0x39')]);return _0x3a7294;};
\ No newline at end of file
+var _0x44e8=['sort','map','indexOf','col','priority','unsigned','substr','cast','ASC','omit','length','isObject','unset','hasOwnProperty','isNumeric','match','isEmail','getFullTextValue','forEach','replace','push','join','getOptions','query','$id','model','intersection','attributes','fields','nolimit','filter','object','columns','value','where','lower','merge','options','lodash','parse','keys','includes','split','filters','isEmpty','forOwn','find','type','isPlainObject','$gte','YYYY-MM-DD','utc','format','subtract','name','uniqueid','isArray','limit','offset'];(function(_0x241a78,_0x18e674){var _0x268acc=function(_0x55274e){while(--_0x55274e){_0x241a78['push'](_0x241a78['shift']());}};_0x268acc(++_0x18e674);}(_0x44e8,0xd7));var _0x844e=function(_0x198cda,_0x39ecc7){_0x198cda=_0x198cda-0x0;var _0x312688=_0x44e8[_0x198cda];return _0x312688;};'use strict';var _=require(_0x844e('0x0'));var sequelize=require('sequelize');var moment=require('moment');var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x1b5be7){var _0x21307e=['ne'];try{var _0x2afcef=JSON[_0x844e('0x1')](_0x1b5be7);var _0x49ce1b=Object[_0x844e('0x2')](_0x2afcef)[0x0];return _0x21307e[_0x844e('0x3')](_0x49ce1b);}catch(_0x2c8b9e){return![];}}function getOperatorValue(_0x446f47){var _0x5c8f67=JSON[_0x844e('0x1')](_0x446f47);var _0x238796=Object[_0x844e('0x2')](_0x5c8f67)[0x0];var _0x11cbd6=_0x5c8f67[_0x238796];return{['$'+_0x238796]:_0x11cbd6};}exports['fields']=function(_0x31ab50){var _0x7dff16=null;if(_0x31ab50){_0x7dff16=_0x31ab50[_0x844e('0x4')](',');}return _0x7dff16;};exports[_0x844e('0x5')]=function(_0x32c6c7,_0x1f9921){var _0x536601={};if(!_[_0x844e('0x6')](_0x32c6c7)){_[_0x844e('0x7')](_0x32c6c7,function(_0x183c7e,_0x285a64){try{if(_0x1f9921){var _0x14909f=_[_0x844e('0x8')](_0x1f9921,{'name':_0x285a64})||{};if(hasSequelizeOperator(_0x183c7e)){_0x536601[_0x285a64]=getOperatorValue(_0x183c7e);}else if(_0x14909f[_0x844e('0x9')]==='DATE'&&_[_0x844e('0xa')](_0x183c7e)){var _0x23df3f=JSON['parse'](_0x183c7e);var _0x3a09d0={'$gte':moment(moment(_0x23df3f[_0x844e('0xb')])['format'](_0x844e('0xc')))[_0x844e('0xd')]()[_0x844e('0xe')](),'$lte':moment(moment(_0x23df3f['$lte'])[_0x844e('0xe')](_0x844e('0xc')))[_0x844e('0xd')]()[_0x844e('0xf')](0x1,'s')[_0x844e('0xe')]()};_0x536601[_0x285a64]=_0x3a09d0;}else if(_0x14909f[_0x844e('0x10')]===_0x844e('0x11')){_0x536601[_0x285a64]=_0x183c7e;}else{_0x536601[_0x285a64]=_[_0x844e('0x12')](_0x183c7e)?_0x183c7e:JSON['parse'](_0x183c7e);}}else{_0x536601[_0x285a64]=_[_0x844e('0x12')](_0x183c7e)?_0x183c7e:JSON['parse'](_0x183c7e);}}catch(_0x3c307f){_0x536601[_0x285a64]=_0x183c7e['split'](',');}});}return _0x536601;};exports[_0x844e('0x13')]=function(_0x55bcd6){_0x55bcd6=parseInt(_0x55bcd6,0xa);if(!_0x55bcd6||_0x55bcd6<0x0){_0x55bcd6=LIMIT_VALUE;}return _0x55bcd6;};exports[_0x844e('0x14')]=function(_0x10739f){_0x10739f=parseInt(_0x10739f,0xa);if(!_0x10739f||_0x10739f<0x0){_0x10739f=0x0;}return _0x10739f;};exports[_0x844e('0x15')]=function(_0x410325){var _0x3ea7da,_0x2b58c7=null;if(_0x410325){_0x3ea7da=_0x410325[_0x844e('0x4')](',');_0x2b58c7=_[_0x844e('0x16')](_0x3ea7da,function(_0x4ffb86){if(_0x4ffb86[_0x844e('0x17')]('-')===0x0){return[_0x4ffb86==='priority'?sequelize['cast'](sequelize[_0x844e('0x18')](_0x844e('0x19')),_0x844e('0x1a')):_0x4ffb86[_0x844e('0x1b')](0x1),'DESC'];}else{return[_0x4ffb86===_0x844e('0x19')?sequelize[_0x844e('0x1c')](sequelize['col'](_0x844e('0x19')),_0x844e('0x1a')):_0x4ffb86,_0x844e('0x1d')];}});}return _0x2b58c7;};exports[_0x844e('0x1e')]=function(_0x35236b,_0x3a65fc){if(_['isEmpty'](_0x35236b)){return _0x35236b;}if(_[_0x844e('0x12')](_0x35236b)){for(var _0xadf0d8=0x0;_0xadf0d8<_0x35236b[_0x844e('0x1f')];_0xadf0d8+=0x1){_0x35236b[_0xadf0d8]=this[_0x844e('0x1e')](_0x35236b[_0xadf0d8],_0x3a65fc);}return _0x35236b;}if(!_[_0x844e('0x20')](_0x35236b)){return _0x35236b;}if(_['isString'](_0x3a65fc)){_0x3a65fc=[_0x3a65fc];}if(!_[_0x844e('0x12')](_0x3a65fc)){return _0x35236b;}for(var _0x5080c1=0x0;_0x5080c1<_0x3a65fc['length'];_0x5080c1+=0x1){_[_0x844e('0x21')](_0x35236b,_0x3a65fc[_0x5080c1]);}for(var _0x130d87 in _0x35236b){if(_0x35236b[_0x844e('0x22')](_0x130d87)){_0x35236b[_0x130d87]=this['omit'](_0x35236b[_0x130d87],_0x3a65fc);}}return _0x35236b;};exports[_0x844e('0x23')]=function(_0x2d4acd){return _0x2d4acd[_0x844e('0x24')](RegExp('^[+]?[0-9]*$'))?!![]:![];};exports[_0x844e('0x25')]=function(_0x81d4de){return _0x81d4de[_0x844e('0x24')](/^\S+@\S+$/)?!![]:![];};exports[_0x844e('0x26')]=function(_0x454b68){var _0x799cde=[];_0x454b68[_0x844e('0x4')](/[ ,]+/)[_0x844e('0x27')](function(_0x618bf6){_0x618bf6=_0x618bf6[_0x844e('0x28')](/([^:]")"+/g,'$1');_0x618bf6='+'+_0x618bf6+'*';var _0x550240=/[ `!@#$%^&*()_\-?~]/;if(_0x618bf6[_0x844e('0x24')](_0x550240))_0x618bf6='\x22'+_0x618bf6+'\x22';_0x799cde[_0x844e('0x29')](_0x618bf6);});return _0x799cde[_0x844e('0x2a')]('\x20');};exports[_0x844e('0x2b')]=function(_0x43ae36,_0x31754e,_0x27e5b3){var _0x55c488={},_0x26d6f2={};if(_0x31754e[_0x844e('0x2c')][_0x844e('0x2d')]){_0x31754e['query']['id']=_0x31754e[_0x844e('0x2c')][_0x844e('0x2d')];delete _0x31754e['query'][_0x844e('0x2d')];}_0x55c488[_0x844e('0x2e')]=_['map'](_0x43ae36,_0x844e('0x10'));_0x55c488[_0x844e('0x2c')]=_[_0x844e('0x2')](_0x31754e[_0x844e('0x2c')]);_0x55c488[_0x844e('0x5')]=_[_0x844e('0x2f')](_0x55c488[_0x844e('0x2e')],_0x55c488['query']);_0x26d6f2[_0x844e('0x30')]=_[_0x844e('0x2f')](_0x55c488[_0x844e('0x2e')],this[_0x844e('0x31')](_0x31754e[_0x844e('0x2c')][_0x844e('0x31')]));_0x26d6f2[_0x844e('0x30')]=_0x26d6f2[_0x844e('0x30')][_0x844e('0x1f')]?_0x26d6f2[_0x844e('0x30')]:_0x55c488[_0x844e('0x2e')];if(!_0x31754e['query']['hasOwnProperty'](_0x844e('0x32'))){_0x26d6f2[_0x844e('0x13')]=this[_0x844e('0x13')](_0x31754e[_0x844e('0x2c')][_0x844e('0x13')]);_0x26d6f2[_0x844e('0x14')]=this[_0x844e('0x14')](_0x31754e[_0x844e('0x2c')][_0x844e('0x14')]);}_0x26d6f2['order']=this[_0x844e('0x15')](_0x31754e['query'][_0x844e('0x15')]);_0x26d6f2['where']=this[_0x844e('0x5')](_['pick'](_0x31754e[_0x844e('0x2c')],_0x55c488[_0x844e('0x5')]),_0x43ae36);if(_0x31754e[_0x844e('0x2c')][_0x844e('0x33')]){var _0x2eb412=_0x43ae36;var _0x3b4c9e=_0x31754e[_0x844e('0x2c')][_0x844e('0x33')];if(typeof _0x3b4c9e===_0x844e('0x34')){_0x2eb412=_[_0x844e('0x33')](_0x43ae36,function(_0x3bdf19){return _['includes'](_0x3b4c9e[_0x844e('0x35')],_0x3bdf19[_0x844e('0x10')]);});_0x3b4c9e=_0x3b4c9e[_0x844e('0x36')];}_0x26d6f2['where']=_['merge'](_0x26d6f2[_0x844e('0x37')],{'$or':_[_0x844e('0x16')](_0x2eb412,function(_0x1a7817){if(_0x1a7817['type']!=='VIRTUAL'){if(_0x27e5b3){return sequelize['where'](sequelize['fn']('lower',sequelize[_0x844e('0x18')](_0x1a7817[_0x844e('0x10')])),{'$like':sequelize['fn'](_0x844e('0x38'),'%'+_0x31754e[_0x844e('0x2c')][_0x844e('0x33')]+'%')});}else{var _0x4c756b={};_0x4c756b[_0x1a7817[_0x844e('0x10')]]={'$like':'%'+_0x31754e['query']['filter']+'%'};return _0x4c756b;}}})});}_0x26d6f2=_[_0x844e('0x39')]({},_0x26d6f2,_0x31754e[_0x844e('0x3a')]);return _0x26d6f2;};
\ No newline at end of file
index 16470dd..8ac1ed0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['get','production','set','appPath','public','join','root','client','use','toISOString','split','static','views','/server/views','engine','html','ejs','urlencoded','50mb','json','initialize','express','method-override','cookie-parser','passport','./environment','default'];(function(_0x3f2a90,_0x50baf1){var _0xb46279=function(_0x5e47b5){while(--_0x5e47b5){_0x3f2a90['push'](_0x3f2a90['shift']());}};_0xb46279(++_0x50baf1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xa9e0[_0x2b10c6];return _0x3789d2;};'use strict';var express=require(_0x0a9e('0x0'));var methodOverride=require(_0x0a9e('0x1'));var cookieParser=require(_0x0a9e('0x2'));var errorHandler=require('errorhandler');var path=require('path');var passport=require(_0x0a9e('0x3'));var cors=require('cors');var config=require(_0x0a9e('0x4'));exports[_0x0a9e('0x5')]=function(_0x2ab90b){var _0x991246=_0x2ab90b[_0x0a9e('0x6')]('env');if(_0x991246===_0x0a9e('0x7')){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path['join'](config['root'],_0x0a9e('0xa')));}if(_0x991246==='development'||_0x991246==='test'){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path[_0x0a9e('0xb')](config[_0x0a9e('0xc')],_0x0a9e('0xd')));_0x2ab90b[_0x0a9e('0xe')](errorHandler());}_0x2ab90b['set']('json\x20replacer',function(_0x527cdd,_0x4cfe67){if(this[_0x527cdd]instanceof Date){_0x4cfe67=this[_0x527cdd][_0x0a9e('0xf')]()[_0x0a9e('0x10')]('.')[0x0]+'Z';}return _0x4cfe67;});_0x2ab90b[_0x0a9e('0xe')](express[_0x0a9e('0x11')](_0x2ab90b[_0x0a9e('0x6')](_0x0a9e('0x9'))));_0x2ab90b['set'](_0x0a9e('0x12'),config[_0x0a9e('0xc')]+_0x0a9e('0x13'));_0x2ab90b[_0x0a9e('0x14')](_0x0a9e('0x15'),require(_0x0a9e('0x16'))['renderFile']);_0x2ab90b[_0x0a9e('0x8')]('view\x20engine',_0x0a9e('0x15'));_0x2ab90b['use'](express[_0x0a9e('0x17')]({'limit':_0x0a9e('0x18'),'extended':!![]}));_0x2ab90b['use'](express[_0x0a9e('0x19')]({'limit':'50mb'}));_0x2ab90b[_0x0a9e('0xe')](cors());_0x2ab90b[_0x0a9e('0xe')](methodOverride());_0x2ab90b[_0x0a9e('0xe')](cookieParser());_0x2ab90b[_0x0a9e('0xe')](passport[_0x0a9e('0x1a')]());};
\ No newline at end of file
+var _0xa9e0=['get','production','set','appPath','public','join','root','client','use','toISOString','split','static','views','/server/views','engine','html','ejs','urlencoded','50mb','json','initialize','express','method-override','cookie-parser','passport','./environment','default'];(function(_0x5bda3b,_0x41160f){var _0x431bb9=function(_0x160122){while(--_0x160122){_0x5bda3b['push'](_0x5bda3b['shift']());}};_0x431bb9(++_0x41160f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0xa9e0[_0x5c3c0b];return _0x52ecd2;};'use strict';var express=require(_0x0a9e('0x0'));var methodOverride=require(_0x0a9e('0x1'));var cookieParser=require(_0x0a9e('0x2'));var errorHandler=require('errorhandler');var path=require('path');var passport=require(_0x0a9e('0x3'));var cors=require('cors');var config=require(_0x0a9e('0x4'));exports[_0x0a9e('0x5')]=function(_0x2ab90b){var _0x991246=_0x2ab90b[_0x0a9e('0x6')]('env');if(_0x991246===_0x0a9e('0x7')){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path['join'](config['root'],_0x0a9e('0xa')));}if(_0x991246==='development'||_0x991246==='test'){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path[_0x0a9e('0xb')](config[_0x0a9e('0xc')],_0x0a9e('0xd')));_0x2ab90b[_0x0a9e('0xe')](errorHandler());}_0x2ab90b['set']('json\x20replacer',function(_0x527cdd,_0x4cfe67){if(this[_0x527cdd]instanceof Date){_0x4cfe67=this[_0x527cdd][_0x0a9e('0xf')]()[_0x0a9e('0x10')]('.')[0x0]+'Z';}return _0x4cfe67;});_0x2ab90b[_0x0a9e('0xe')](express[_0x0a9e('0x11')](_0x2ab90b[_0x0a9e('0x6')](_0x0a9e('0x9'))));_0x2ab90b['set'](_0x0a9e('0x12'),config[_0x0a9e('0xc')]+_0x0a9e('0x13'));_0x2ab90b[_0x0a9e('0x14')](_0x0a9e('0x15'),require(_0x0a9e('0x16'))['renderFile']);_0x2ab90b[_0x0a9e('0x8')]('view\x20engine',_0x0a9e('0x15'));_0x2ab90b['use'](express[_0x0a9e('0x17')]({'limit':_0x0a9e('0x18'),'extended':!![]}));_0x2ab90b['use'](express[_0x0a9e('0x19')]({'limit':'50mb'}));_0x2ab90b[_0x0a9e('0xe')](cors());_0x2ab90b[_0x0a9e('0xe')](methodOverride());_0x2ab90b[_0x0a9e('0xe')](cookieParser());_0x2ab90b[_0x0a9e('0xe')](passport[_0x0a9e('0x1a')]());};
\ No newline at end of file
index 0fb2fef..1c5fd35 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9ca7=['00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','cpus','map','model','join','md5','update','getUuid','platform','licenseToken','test','win32','dmidecode\x20--string\x20system-uuid','hostname','macAddress','digest','substring','crypto','bimedia-machine-uuid','execSync','networkInterfaces','orderBy','keys','length','filter','family','internal','concat','mac'];(function(_0x129b53,_0x2110ef){var _0x2fdc2c=function(_0x2e7e34){while(--_0x2e7e34){_0x129b53['push'](_0x129b53['shift']());}};_0x2fdc2c(++_0x2110ef);}(_0x9ca7,0x94));var _0x79ca=function(_0x3138b1,_0x2d2944){_0x3138b1=_0x3138b1-0x0;var _0x1b285d=_0x9ca7[_0x3138b1];return _0x1b285d;};'use strict';var _=require('lodash');var os=require('os');var crypto=require(_0x79ca('0x0'));var machine=require(_0x79ca('0x1'));var exec=require('child_process')[_0x79ca('0x2')];var config=require('../environment');function getInterfaces(){var _0x2fa29b=[];var _0x5d0c7b=os[_0x79ca('0x3')]();var _0x16f3f5=_[_0x79ca('0x4')](_[_0x79ca('0x5')](_0x5d0c7b));for(var _0x267de9=0x0;_0x267de9<_0x16f3f5[_0x79ca('0x6')];_0x267de9++){var _0x1be0a4=_0x5d0c7b[_0x16f3f5[_0x267de9]][_0x79ca('0x7')](function(_0x4fb532){return _0x4fb532[_0x79ca('0x8')]==='IPv4'&&_0x4fb532[_0x79ca('0x9')]===![];});_0x2fa29b=_0x2fa29b[_0x79ca('0xa')](_0x1be0a4);}return _0x2fa29b;}function getFirstInterface(){var _0x2c8fbe=_['head'](getInterfaces());return{'macAddress':_0x2c8fbe&&_0x2c8fbe[_0x79ca('0xb')]?_0x2c8fbe['mac']:_0x79ca('0xc'),'ipAddress':_0x2c8fbe&&_0x2c8fbe[_0x79ca('0xd')]?_0x2c8fbe['address']:_0x79ca('0xe')};}exports[_0x79ca('0xf')]=getFirstInterface;function getCPUhash(){var _0x348137=_['orderBy'](os[_0x79ca('0x10')]()[_0x79ca('0x11')](function(_0x28c65a){return _0x28c65a[_0x79ca('0x12')];}))[_0x79ca('0x13')](':');return crypto['createHash'](_0x79ca('0x14'))[_0x79ca('0x15')](_0x348137)['digest']('hex');}exports[_0x79ca('0x16')]=function(){var _0x309d50=os[_0x79ca('0x17')]();var _0x14efd3=/[0-9a-f-]{36}/;if(config[_0x79ca('0x18')]&&_0x14efd3[_0x79ca('0x19')](config['licenseToken'])){return config[_0x79ca('0x18')];}else if(_0x309d50===_0x79ca('0x1a')){return exec(_0x79ca('0x1b'),{'encoding':'utf8'})['replace']('\x0d\x0a','');}else{var _0x323cd1=getFirstInterface();var _0x6ebb83=getCPUhash();var _0x549bfd=_0x6ebb83+'|'+os[_0x79ca('0x1c')]()+'|'+_0x323cd1[_0x79ca('0x1d')]+'|'+_0x323cd1['ipAddress'];var _0x53406e=crypto['createHash']('md5')['update'](_0x549bfd)[_0x79ca('0x1e')]('hex');return _0x53406e[_0x79ca('0x1f')](0x0,0x8)+'-'+_0x53406e[_0x79ca('0x1f')](0x8,0xc)+'-'+_0x53406e[_0x79ca('0x1f')](0xc,0x10)+'-'+_0x53406e[_0x79ca('0x1f')](0x10,0x14)+'-'+_0x53406e[_0x79ca('0x1f')](0x14);}};
\ No newline at end of file
+var _0xa4de=['substring','lodash','crypto','child_process','networkInterfaces','keys','length','filter','family','IPv4','internal','concat','head','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','orderBy','cpus','map','model','join','createHash','md5','update','hex','getUuid','test','licenseToken','dmidecode\x20--string\x20system-uuid','hostname','macAddress','ipAddress','digest'];(function(_0x57a755,_0xfffd78){var _0x182e75=function(_0x5f2642){while(--_0x5f2642){_0x57a755['push'](_0x57a755['shift']());}};_0x182e75(++_0xfffd78);}(_0xa4de,0x6a));var _0xea4d=function(_0x2075db,_0x70a905){_0x2075db=_0x2075db-0x0;var _0x2a615b=_0xa4de[_0x2075db];return _0x2a615b;};'use strict';var _=require(_0xea4d('0x0'));var os=require('os');var crypto=require(_0xea4d('0x1'));var machine=require('bimedia-machine-uuid');var exec=require(_0xea4d('0x2'))['execSync'];var config=require('../environment');function getInterfaces(){var _0xc65040=[];var _0x193b22=os[_0xea4d('0x3')]();var _0x4aee10=_['orderBy'](_[_0xea4d('0x4')](_0x193b22));for(var _0x24f15f=0x0;_0x24f15f<_0x4aee10[_0xea4d('0x5')];_0x24f15f++){var _0xb192f0=_0x193b22[_0x4aee10[_0x24f15f]][_0xea4d('0x6')](function(_0x2075a2){return _0x2075a2[_0xea4d('0x7')]===_0xea4d('0x8')&&_0x2075a2[_0xea4d('0x9')]===![];});_0xc65040=_0xc65040[_0xea4d('0xa')](_0xb192f0);}return _0xc65040;}function getFirstInterface(){var _0xaae1ee=_[_0xea4d('0xb')](getInterfaces());return{'macAddress':_0xaae1ee&&_0xaae1ee[_0xea4d('0xc')]?_0xaae1ee[_0xea4d('0xc')]:_0xea4d('0xd'),'ipAddress':_0xaae1ee&&_0xaae1ee[_0xea4d('0xe')]?_0xaae1ee[_0xea4d('0xe')]:_0xea4d('0xf')};}exports[_0xea4d('0x10')]=getFirstInterface;function getCPUhash(){var _0x5a14ad=_[_0xea4d('0x11')](os[_0xea4d('0x12')]()[_0xea4d('0x13')](function(_0x2cadbf){return _0x2cadbf[_0xea4d('0x14')];}))[_0xea4d('0x15')](':');return crypto[_0xea4d('0x16')](_0xea4d('0x17'))[_0xea4d('0x18')](_0x5a14ad)['digest'](_0xea4d('0x19'));}exports[_0xea4d('0x1a')]=function(){var _0x1196fb=os['platform']();var _0x19db97=/[0-9a-f-]{36}/;if(config['licenseToken']&&_0x19db97[_0xea4d('0x1b')](config[_0xea4d('0x1c')])){return config[_0xea4d('0x1c')];}else if(_0x1196fb==='win32'){return exec(_0xea4d('0x1d'),{'encoding':'utf8'})['replace']('\x0d\x0a','');}else{var _0x367cd8=getFirstInterface();var _0x5f4993=getCPUhash();var _0x207f9e=_0x5f4993+'|'+os[_0xea4d('0x1e')]()+'|'+_0x367cd8[_0xea4d('0x1f')]+'|'+_0x367cd8[_0xea4d('0x20')];var _0x333fc2=crypto[_0xea4d('0x16')]('md5')[_0xea4d('0x18')](_0x207f9e)[_0xea4d('0x21')]('hex');return _0x333fc2[_0xea4d('0x22')](0x0,0x8)+'-'+_0x333fc2[_0xea4d('0x22')](0x8,0xc)+'-'+_0x333fc2[_0xea4d('0x22')](0xc,0x10)+'-'+_0x333fc2[_0xea4d('0x22')](0x10,0x14)+'-'+_0x333fc2[_0xea4d('0x22')](0x14);}};
\ No newline at end of file
index 2d62da4..7048674 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9a8c=['exports','GET','then','catch','get','data1','active','license','data2','info','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','error','finally','getUuid','License','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','message','default','util','moment','request-promise','pkginfo','../../mysqldb','../../components/encryptor','./hardware','../logger','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','version','%s/api/servers/%s/check?version=%s&oldtoken=%s'];(function(_0x38841c,_0x1af0bf){var _0x500610=function(_0x225955){while(--_0x225955){_0x38841c['push'](_0x38841c['shift']());}};_0x500610(++_0x1af0bf);}(_0x9a8c,0x1d4));var _0xc9a8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9a8c[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0xc9a8('0x0'));var moment=require(_0xc9a8('0x1'));var rp=require(_0xc9a8('0x2'));var BPromise=require('bluebird');var pkginfo=require(_0xc9a8('0x3'))(module,'version');var db=require(_0xc9a8('0x4'))['db'];var encryptor=require(_0xc9a8('0x5'));var hardware=require(_0xc9a8('0x6'));var logger=require(_0xc9a8('0x7'))('license');var HOST=_0xc9a8('0x8');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x4e4a0d){return new BPromise(function(_0x59057c,_0x73221){var _0x413ae3=util[_0xc9a8('0x9')](_0xc9a8('0xa'),HOST,_0x4e4a0d,module['exports'][_0xc9a8('0xb')]);if(oldToken){_0x413ae3=util[_0xc9a8('0x9')](_0xc9a8('0xc'),HOST,_0x4e4a0d,module[_0xc9a8('0xd')][_0xc9a8('0xb')],oldToken);}var _0x54688d={'uri':_0x413ae3,'method':_0xc9a8('0xe'),'timeout':0xea60,'json':!![]};return rp(_0x54688d)[_0xc9a8('0xf')](function(_0x44ae38){_0x59057c(_0x44ae38);})[_0xc9a8('0x10')](function(_0x2d4abd){_0x73221(_0x2d4abd);});});}function manageLicense(_0x37d3ab,_0x539de6){var _0x53ef03=_0x539de6[_0xc9a8('0x11')]({'plain':!![]});if(!isOldTokenSent&&_0x53ef03[_0xc9a8('0x12')]!==_0x37d3ab&&!_0x53ef03['data2']){oldToken=_0x53ef03['data1'];}httpRequest(_0x37d3ab)[_0xc9a8('0xf')](function(_0x5e6e87){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x5e6e87[_0xc9a8('0x13')]){isOldTokenSent=![];if(!_0x53ef03[_0xc9a8('0x14')]&&_0x53ef03['license']!=_0x5e6e87[_0xc9a8('0x14')]||_0x53ef03[_0xc9a8('0x14')]&&_0x53ef03[_0xc9a8('0x15')]){logger[_0xc9a8('0x16')]('THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED');}if(_0x53ef03[_0xc9a8('0x14')]&&!_0x53ef03[_0xc9a8('0x15')]&&_0x53ef03['license']!=_0x5e6e87[_0xc9a8('0x14')]){logger[_0xc9a8('0x16')](_0xc9a8('0x17'));}if(_0x53ef03[_0xc9a8('0x14')]&&!_0x53ef03[_0xc9a8('0x15')]&&_0x53ef03[_0xc9a8('0x14')]==_0x5e6e87['license']){return _0x539de6;}return _0x539de6[_0xc9a8('0x18')]({'data1':_0x37d3ab,'data2':null,'license':_0x5e6e87[_0xc9a8('0x14')]});}else{if(_0x5e6e87['license']||_0x53ef03[_0xc9a8('0x14')]){if(!_0x53ef03[_0xc9a8('0x15')]){if(_0x53ef03[_0xc9a8('0x12')]==_0x37d3ab){GRAY_PERIOD_REASON='Disabled';logger['info']('THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED');}else{GRAY_PERIOD_REASON=_0xc9a8('0x19');logger[_0xc9a8('0x16')](_0xc9a8('0x1a'),_0x53ef03['data1'],_0x37d3ab);}logger['info'](_0xc9a8('0x1b'),GRAY_PERIOD_REASON['toUpperCase'](),moment()[_0xc9a8('0x9')]('YYYY-MM-DD\x20HH:mm'));return _0x539de6['update']({'data2':encryptor['encryptString'](moment()[_0xc9a8('0x9')]('YYYY-MM-DD\x20HH:mm'))});}else{if(moment()['diff'](encryptor['decryptString'](_0x53ef03['data2']),'days')>DAYS){logger[_0xc9a8('0x16')]('DEMO\x20START\x20AT\x20%s',moment()[_0xc9a8('0x9')]('YYYY-MM-DD\x20HH:mm'));isOldTokenSent=![];return _0x539de6['update']({'data1':_0x37d3ab,'data2':null,'license':null});}}}else{if(_0x53ef03[_0xc9a8('0x12')]!=_0x37d3ab){logger[_0xc9a8('0x16')](_0xc9a8('0x1a'),_0x53ef03['data1'],_0x37d3ab);return _0x539de6['update']({'data1':_0x37d3ab,'data2':null,'license':null});}}}return _0x539de6;})['then'](function(_0x377800){_0x539de6=_0x377800;})[_0xc9a8('0x10')](function(_0x2d4bb7){logger[_0xc9a8('0x1c')](_0x2d4bb7['message']);})[_0xc9a8('0x1d')](function(){setTimeout(function(){manageLicense(hardware['getUuid'](),_0x539de6);},TIME);});}function defaultLicense(){var _0x54931a=hardware[_0xc9a8('0x1e')]();if(_0x54931a){return db[_0xc9a8('0x1f')][_0xc9a8('0x20')]({'where':{'id':0x1},'defaults':{'data1':_0x54931a}})[_0xc9a8('0x21')](function(_0x4f7eac,_0x506717){logger[_0xc9a8('0x16')](_0xc9a8('0x22'),_0x54931a);manageLicense(_0x54931a,_0x4f7eac);})['catch'](function(_0x94a56d){logger[_0xc9a8('0x1c')](_0x94a56d[_0xc9a8('0x23')]);});}}exports[_0xc9a8('0x24')]=defaultLicense;
\ No newline at end of file
+var _0xa05e=['./hardware','license','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','exports','version','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','then','catch','get','data1','data2','active','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','encryptString','diff','days','DEMO\x20START\x20AT\x20%s','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','message','finally','getUuid','License','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','error','default','util','request-promise','bluebird','pkginfo','../../mysqldb','../../components/encryptor'];(function(_0x5e5c16,_0xf14e8d){var _0x551241=function(_0x1b8cd){while(--_0x1b8cd){_0x5e5c16['push'](_0x5e5c16['shift']());}};_0x551241(++_0xf14e8d);}(_0xa05e,0x1b2));var _0xea05=function(_0x37e4d6,_0x4ed6e8){_0x37e4d6=_0x37e4d6-0x0;var _0x2d3a0a=_0xa05e[_0x37e4d6];return _0x2d3a0a;};'use strict';var util=require(_0xea05('0x0'));var moment=require('moment');var rp=require(_0xea05('0x1'));var BPromise=require(_0xea05('0x2'));var pkginfo=require(_0xea05('0x3'))(module,'version');var db=require(_0xea05('0x4'))['db'];var encryptor=require(_0xea05('0x5'));var hardware=require(_0xea05('0x6'));var logger=require('../logger')(_0xea05('0x7'));var HOST=_0xea05('0x8');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x405732){return new BPromise(function(_0x1c18f4,_0x5bdd40){var _0x1ca4bc=util[_0xea05('0x9')](_0xea05('0xa'),HOST,_0x405732,module[_0xea05('0xb')][_0xea05('0xc')]);if(oldToken){_0x1ca4bc=util['format'](_0xea05('0xd'),HOST,_0x405732,module[_0xea05('0xb')][_0xea05('0xc')],oldToken);}var _0x4c06ad={'uri':_0x1ca4bc,'method':_0xea05('0xe'),'timeout':0xea60,'json':!![]};return rp(_0x4c06ad)[_0xea05('0xf')](function(_0x91915d){_0x1c18f4(_0x91915d);})[_0xea05('0x10')](function(_0x1b6ff1){_0x5bdd40(_0x1b6ff1);});});}function manageLicense(_0x403a2d,_0x3d2dd3){var _0x4dd8a5=_0x3d2dd3[_0xea05('0x11')]({'plain':!![]});if(!isOldTokenSent&&_0x4dd8a5[_0xea05('0x12')]!==_0x403a2d&&!_0x4dd8a5[_0xea05('0x13')]){oldToken=_0x4dd8a5[_0xea05('0x12')];}httpRequest(_0x403a2d)[_0xea05('0xf')](function(_0x21fb1b){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x21fb1b[_0xea05('0x14')]){isOldTokenSent=![];if(!_0x4dd8a5[_0xea05('0x7')]&&_0x4dd8a5['license']!=_0x21fb1b['license']||_0x4dd8a5[_0xea05('0x7')]&&_0x4dd8a5[_0xea05('0x13')]){logger[_0xea05('0x15')](_0xea05('0x16'));}if(_0x4dd8a5[_0xea05('0x7')]&&!_0x4dd8a5[_0xea05('0x13')]&&_0x4dd8a5[_0xea05('0x7')]!=_0x21fb1b[_0xea05('0x7')]){logger[_0xea05('0x15')](_0xea05('0x17'));}if(_0x4dd8a5[_0xea05('0x7')]&&!_0x4dd8a5[_0xea05('0x13')]&&_0x4dd8a5[_0xea05('0x7')]==_0x21fb1b[_0xea05('0x7')]){return _0x3d2dd3;}return _0x3d2dd3[_0xea05('0x18')]({'data1':_0x403a2d,'data2':null,'license':_0x21fb1b[_0xea05('0x7')]});}else{if(_0x21fb1b[_0xea05('0x7')]||_0x4dd8a5['license']){if(!_0x4dd8a5[_0xea05('0x13')]){if(_0x4dd8a5[_0xea05('0x12')]==_0x403a2d){GRAY_PERIOD_REASON=_0xea05('0x19');logger[_0xea05('0x15')](_0xea05('0x1a'));}else{GRAY_PERIOD_REASON=_0xea05('0x1b');logger[_0xea05('0x15')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x4dd8a5[_0xea05('0x12')],_0x403a2d);}logger[_0xea05('0x15')](_0xea05('0x1c'),GRAY_PERIOD_REASON[_0xea05('0x1d')](),moment()[_0xea05('0x9')](_0xea05('0x1e')));return _0x3d2dd3[_0xea05('0x18')]({'data2':encryptor[_0xea05('0x1f')](moment()[_0xea05('0x9')](_0xea05('0x1e')))});}else{if(moment()[_0xea05('0x20')](encryptor['decryptString'](_0x4dd8a5[_0xea05('0x13')]),_0xea05('0x21'))>DAYS){logger['info'](_0xea05('0x22'),moment()['format'](_0xea05('0x1e')));isOldTokenSent=![];return _0x3d2dd3['update']({'data1':_0x403a2d,'data2':null,'license':null});}}}else{if(_0x4dd8a5[_0xea05('0x12')]!=_0x403a2d){logger[_0xea05('0x15')](_0xea05('0x23'),_0x4dd8a5[_0xea05('0x12')],_0x403a2d);return _0x3d2dd3[_0xea05('0x18')]({'data1':_0x403a2d,'data2':null,'license':null});}}}return _0x3d2dd3;})[_0xea05('0xf')](function(_0x5df941){_0x3d2dd3=_0x5df941;})[_0xea05('0x10')](function(_0x3a354b){logger['error'](_0x3a354b[_0xea05('0x24')]);})[_0xea05('0x25')](function(){setTimeout(function(){manageLicense(hardware['getUuid'](),_0x3d2dd3);},TIME);});}function defaultLicense(){var _0x51dd0c=hardware[_0xea05('0x26')]();if(_0x51dd0c){return db[_0xea05('0x27')]['findOrCreate']({'where':{'id':0x1},'defaults':{'data1':_0x51dd0c}})[_0xea05('0x28')](function(_0x41d40e,_0xc25316){logger[_0xea05('0x15')](_0xea05('0x29'),_0x51dd0c);manageLicense(_0x51dd0c,_0x41d40e);})['catch'](function(_0x131705){logger[_0xea05('0x2a')](_0x131705['message']);});}}exports[_0xea05('0x2b')]=defaultLicense;
\ No newline at end of file
index 33a1ffe..a059d5a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4777=['uuid','data1','license','isEmpty','data2','split','decryptString','format','demo','gray','deadline','add','days','grayReason','machineUuid','changed','disabled','message','findAll','role','sequelize','COUNT','col','telephone','telephones','forEach','admin','user','pick','countBy','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','util','lodash','moment','./hardware','../../components/encryptor','2027-01-01T00:00:00.000Z','Demo\x20license','getUuid','Breaking\x20license','License','defaults','then','catch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4777,0x12e));var _0x7477=function(_0x3f2a90,_0x50baf1){_0x3f2a90=_0x3f2a90-0x0;var _0xb46279=_0x4777[_0x3f2a90];return _0xb46279;};'use strict';var util=require(_0x7477('0x0'));var _=require(_0x7477('0x1'));var moment=require(_0x7477('0x2'));var BPromise=require('bluebird');var hardware=require(_0x7477('0x3'));var encryptor=require(_0x7477('0x4'));var db=require('../../mysqldb')['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x7477('0x5'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x7477('0x6'),'machineUuid':hardware[_0x7477('0x7')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x7477('0x5'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x7477('0x8'),'machineUuid':hardware[_0x7477('0x7')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x25b0da){return new BPromise(function(_0x52be0e,_0x384b01){return db[_0x7477('0x9')]['find'](_[_0x7477('0xa')](_0x25b0da,{'raw':!![],'where':{'id':0x1}}))['then'](function(_0x58e6d6){return checkLicense(_0x58e6d6,null);})[_0x7477('0xb')](function(_0x2b2dae){_0x52be0e(_0x2b2dae);return;})[_0x7477('0xc')](function(_0x4ee14d){_0x384b01(_0x4ee14d);});});}function checkLicense(_0xe2bf2b,_0x4b07be){if(!_0xe2bf2b){demoLicense[_0x7477('0xd')]=_0xe2bf2b[_0x7477('0xe')];return demoLicense;}try{var _0x2dac82=_0x4b07be||_0xe2bf2b[_0x7477('0xf')];if(_[_0x7477('0x10')](_0x2dac82)){throw new Error('License\x20key\x20value\x20not\x20found');}var _0x4b7548=_0xe2bf2b[_0x7477('0xe')];var _0x3c5216=_0xe2bf2b[_0x7477('0x11')];var _0x3db901=_0x4b7548['split']('-')[0x4];var _0x479d30=_0x4b7548[_0x7477('0x12')]('-')[0x0];var _0x2f5b2c=encryptor[_0x7477('0x13')](_0x2dac82,util[_0x7477('0x14')]('%s:%s:%s',_0x3db901,_0x4b7548,_0x479d30));var _0x3d4b0a=JSON['parse'](_0x2f5b2c);_0x3d4b0a[_0x7477('0x15')]=![];_0x3d4b0a[_0x7477('0xd')]=_0x4b7548;_0x3d4b0a['machineUuid']=hardware[_0x7477('0x7')]();if(_0x3c5216){var _0x4f6284=encryptor[_0x7477('0x13')](_0x3c5216);_0x3d4b0a[_0x7477('0x16')]=_0x4f6284;_0x3d4b0a[_0x7477('0x17')]=moment(_0x4f6284)[_0x7477('0x18')](0x7,_0x7477('0x19'))['format']();_0x3d4b0a[_0x7477('0x1a')]=_0x3d4b0a[_0x7477('0xd')]!=_0x3d4b0a[_0x7477('0x1b')]?_0x7477('0x1c'):_0x7477('0x1d');}return _0x3d4b0a;}catch(_0x53d49e){breakingLicense[_0x7477('0xd')]=_0xe2bf2b[_0x7477('0xe')];breakingLicense[_0x7477('0x1e')]=_0x53d49e[_0x7477('0x1e')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x5c9e9a,_0x1c3b71){getLicense()[_0x7477('0xb')](function(_0x261ff2){return db['User'][_0x7477('0x1f')]({'attributes':[_0x7477('0x20'),[db[_0x7477('0x21')]['fn'](_0x7477('0x22'),db['sequelize'][_0x7477('0x23')](_0x7477('0x20'))),'count']],'group':_0x7477('0x20'),'where':{'role':{'$or':['admin','user',_0x7477('0x24')]}},'raw':!![]})[_0x7477('0xb')](function(_0x28f1e0){var _0x1f68d3={'user':_0x261ff2['users']||0x0,'telephone':_0x261ff2[_0x7477('0x25')]||0x0};_0x28f1e0[_0x7477('0x26')](function(_0x487fce){var _0x18b1f9=_0x487fce[_0x7477('0x20')]===_0x7477('0x27')?_0x7477('0x28'):_0x487fce[_0x7477('0x20')];_0x1f68d3[_0x18b1f9]-=_0x487fce['count'];if(_0x1f68d3[_0x18b1f9]<0x0)_0x1f68d3[_0x18b1f9]=0x0;});_0x5c9e9a(_0x1f68d3);return;});})['catch'](function(_0x535f33){_0x1c3b71(_0x535f33);});});}function checkUserLimits(_0x445bc1){return new BPromise(function(_0x394eb6,_0x17bf15){getLimits()[_0x7477('0xb')](function(_0x2c39f6){var _0x1636de=_[_0x7477('0x29')](_[_0x7477('0x2a')](_0x445bc1,_0x7477('0x20')),[_0x7477('0x27'),_0x7477('0x28'),_0x7477('0x24')]);var _0xeaf008=(_0x1636de[_0x7477('0x27')]||0x0)+(_0x1636de[_0x7477('0x28')]||0x0);var _0x1c33e8=_0x1636de[_0x7477('0x24')]||0x0;if(_0xeaf008>_0x2c39f6[_0x7477('0x28')])return _0x17bf15(_0x7477('0x2b'));if(_0x1c33e8>_0x2c39f6[_0x7477('0x24')])return _0x17bf15(_0x7477('0x2c'));return _0x394eb6();})[_0x7477('0xc')](function(_0x54411b){_0x17bf15(_0x54411b);});});}module['exports']={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense};
\ No newline at end of file
+var _0xaac4=['sequelize','col','count','user','telephone','users','admin','pick','License\x20limit\x20reached\x20for\x20telephones','exports','util','lodash','moment','./hardware','../../components/encryptor','../../mysqldb','2027-01-01T00:00:00.000Z','Demo\x20license','getUuid','Breaking\x20license','find','defaults','then','catch','uuid','isEmpty','data1','data2','split','decryptString','format','%s:%s:%s','parse','demo','machineUuid','gray','add','days','grayReason','disabled','message','findAll','role','COUNT'];(function(_0x38433b,_0x2e0de2){var _0x40309e=function(_0x256025){while(--_0x256025){_0x38433b['push'](_0x38433b['shift']());}};_0x40309e(++_0x2e0de2);}(_0xaac4,0x1ee));var _0x4aac=function(_0x3e9b06,_0x417393){_0x3e9b06=_0x3e9b06-0x0;var _0x442af8=_0xaac4[_0x3e9b06];return _0x442af8;};'use strict';var util=require(_0x4aac('0x0'));var _=require(_0x4aac('0x1'));var moment=require(_0x4aac('0x2'));var BPromise=require('bluebird');var hardware=require(_0x4aac('0x3'));var encryptor=require(_0x4aac('0x4'));var db=require(_0x4aac('0x5'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x4aac('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x4aac('0x7'),'machineUuid':hardware[_0x4aac('0x8')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x4aac('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x4aac('0x9'),'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x388cf8){return new BPromise(function(_0x25dbf6,_0x52438d){return db['License'][_0x4aac('0xa')](_[_0x4aac('0xb')](_0x388cf8,{'raw':!![],'where':{'id':0x1}}))['then'](function(_0x2f88a1){return checkLicense(_0x2f88a1,null);})[_0x4aac('0xc')](function(_0xa4d73){_0x25dbf6(_0xa4d73);return;})[_0x4aac('0xd')](function(_0xcba3c2){_0x52438d(_0xcba3c2);});});}function checkLicense(_0x7dec97,_0x5098dd){if(!_0x7dec97){demoLicense[_0x4aac('0xe')]=_0x7dec97['data1'];return demoLicense;}try{var _0x219071=_0x5098dd||_0x7dec97['license'];if(_[_0x4aac('0xf')](_0x219071)){throw new Error('License\x20key\x20value\x20not\x20found');}var _0xd7c2a4=_0x7dec97[_0x4aac('0x10')];var _0x14160e=_0x7dec97[_0x4aac('0x11')];var _0x44a33a=_0xd7c2a4[_0x4aac('0x12')]('-')[0x4];var _0x113b29=_0xd7c2a4[_0x4aac('0x12')]('-')[0x0];var _0x38e737=encryptor[_0x4aac('0x13')](_0x219071,util[_0x4aac('0x14')](_0x4aac('0x15'),_0x44a33a,_0xd7c2a4,_0x113b29));var _0x4a342a=JSON[_0x4aac('0x16')](_0x38e737);_0x4a342a[_0x4aac('0x17')]=![];_0x4a342a['uuid']=_0xd7c2a4;_0x4a342a[_0x4aac('0x18')]=hardware[_0x4aac('0x8')]();if(_0x14160e){var _0x46655c=encryptor[_0x4aac('0x13')](_0x14160e);_0x4a342a[_0x4aac('0x19')]=_0x46655c;_0x4a342a['deadline']=moment(_0x46655c)[_0x4aac('0x1a')](0x7,_0x4aac('0x1b'))[_0x4aac('0x14')]();_0x4a342a[_0x4aac('0x1c')]=_0x4a342a[_0x4aac('0xe')]!=_0x4a342a[_0x4aac('0x18')]?'changed':_0x4aac('0x1d');}return _0x4a342a;}catch(_0x42b314){breakingLicense['uuid']=_0x7dec97[_0x4aac('0x10')];breakingLicense[_0x4aac('0x1e')]=_0x42b314[_0x4aac('0x1e')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x4918bf,_0x336289){getLicense()[_0x4aac('0xc')](function(_0x1b5de5){return db['User'][_0x4aac('0x1f')]({'attributes':[_0x4aac('0x20'),[db['sequelize']['fn'](_0x4aac('0x21'),db[_0x4aac('0x22')][_0x4aac('0x23')](_0x4aac('0x20'))),_0x4aac('0x24')]],'group':'role','where':{'role':{'$or':['admin',_0x4aac('0x25'),_0x4aac('0x26')]}},'raw':!![]})[_0x4aac('0xc')](function(_0x125e04){var _0x492cfd={'user':_0x1b5de5[_0x4aac('0x27')]||0x0,'telephone':_0x1b5de5['telephones']||0x0};_0x125e04['forEach'](function(_0x200f4f){var _0x4017a3=_0x200f4f['role']===_0x4aac('0x28')?_0x4aac('0x25'):_0x200f4f[_0x4aac('0x20')];_0x492cfd[_0x4017a3]-=_0x200f4f[_0x4aac('0x24')];if(_0x492cfd[_0x4017a3]<0x0)_0x492cfd[_0x4017a3]=0x0;});_0x4918bf(_0x492cfd);return;});})['catch'](function(_0x373255){_0x336289(_0x373255);});});}function checkUserLimits(_0x2ffcd5){return new BPromise(function(_0x5eb0f8,_0x1c4e98){getLimits()[_0x4aac('0xc')](function(_0x33dbbf){var _0x257c8a=_[_0x4aac('0x29')](_['countBy'](_0x2ffcd5,_0x4aac('0x20')),['admin','user',_0x4aac('0x26')]);var _0x2a803b=(_0x257c8a['admin']||0x0)+(_0x257c8a['user']||0x0);var _0x25becc=_0x257c8a['telephone']||0x0;if(_0x2a803b>_0x33dbbf[_0x4aac('0x25')])return _0x1c4e98('License\x20limit\x20reached\x20for\x20users');if(_0x25becc>_0x33dbbf[_0x4aac('0x26')])return _0x1c4e98(_0x4aac('0x2a'));return _0x5eb0f8();})[_0x4aac('0xd')](function(_0x43a584){_0x1c4e98(_0x43a584);});});}module[_0x4aac('0x2b')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense};
\ No newline at end of file
index 8e7a57e..28ac300 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6343=['myappanuglar-secret','app-id'];(function(_0x57d549,_0x322148){var _0x27b217=function(_0x249675){while(--_0x249675){_0x57d549['push'](_0x57d549['shift']());}};_0x27b217(++_0x322148);}(_0x6343,0x168));var _0x3634=function(_0x2ea9ac,_0x35e53c){_0x2ea9ac=_0x2ea9ac-0x0;var _0xaf1280=_0x6343[_0x2ea9ac];return _0xaf1280;};'use strict';module['exports']={'DOMAIN':'http://localhost:9000','SESSION_SECRET':_0x3634('0x0'),'GOOGLE_ID':_0x3634('0x1'),'GOOGLE_SECRET':'secret','DEBUG':''};
\ No newline at end of file
+var _0x8aad=['http://localhost:9000','app-id','exports'];(function(_0x2b778d,_0x5dd9e4){var _0x46a581=function(_0x3eb2ee){while(--_0x3eb2ee){_0x2b778d['push'](_0x2b778d['shift']());}};_0x46a581(++_0x5dd9e4);}(_0x8aad,0x146));var _0xd8aa=function(_0x22f769,_0x1a6720){_0x22f769=_0x22f769-0x0;var _0x131e28=_0x8aad[_0x22f769];return _0x131e28;};'use strict';module[_0xd8aa('0x0')]={'DOMAIN':_0xd8aa('0x1'),'SESSION_SECRET':'myappanuglar-secret','GOOGLE_ID':_0xd8aa('0x2'),'GOOGLE_SECRET':'secret','DEBUG':''};
\ No newline at end of file
index 3fba3b0..abddec1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9bc3=['../utils/loggers','exports'];(function(_0x5c365f,_0x3b40ed){var _0x295e1b=function(_0x226683){while(--_0x226683){_0x5c365f['push'](_0x5c365f['shift']());}};_0x295e1b(++_0x3b40ed);}(_0x9bc3,0x172));var _0x39bc=function(_0x143d6d,_0x295a66){_0x143d6d=_0x143d6d-0x0;var _0x45c605=_0x9bc3[_0x143d6d];return _0x45c605;};'use strict';var fileLogger=require(_0x39bc('0x0'))['fileLogger'];module[_0x39bc('0x1')]=fileLogger;
\ No newline at end of file
+var _0x7a55=['../utils/loggers','fileLogger','exports'];(function(_0x292649,_0x571e2f){var _0x4d74fd=function(_0x5e741c){while(--_0x5e741c){_0x292649['push'](_0x292649['shift']());}};_0x4d74fd(++_0x571e2f);}(_0x7a55,0x159));var _0x57a5=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x7a55[_0x20a584];return _0x4b41a8;};'use strict';var fileLogger=require(_0x57a5('0x0'))[_0x57a5('0x1')];module[_0x57a5('0x2')]=fileLogger;
\ No newline at end of file
index bbfdb44..197df86 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x804c=['ami','../../services/ami/index.js','email','../../services/email/index.js','routing','xdr','../../services/xdr/index.js','exports','path','express','join','../../services/express/index.js'];(function(_0x38b0bd,_0x4519a2){var _0xa6e47e=function(_0x10a4c3){while(--_0x10a4c3){_0x38b0bd['push'](_0x38b0bd['shift']());}};_0xa6e47e(++_0x4519a2);}(_0x804c,0x140));var _0xc804=function(_0x3a03cc,_0x10f54b){_0x3a03cc=_0x3a03cc-0x0;var _0x283607=_0x804c[_0x3a03cc];return _0x283607;};'use strict';var path=require(_0xc804('0x0'));var os=require('os');var config={'apps':[{'name':_0xc804('0x1'),'script':path[_0xc804('0x2')](__dirname,_0xc804('0x3'))},{'name':_0xc804('0x4'),'script':path[_0xc804('0x2')](__dirname,_0xc804('0x5'))},{'name':'agi','script':path[_0xc804('0x2')](__dirname,'../../services/agi/index.js')},{'name':_0xc804('0x6'),'script':path[_0xc804('0x2')](__dirname,_0xc804('0x7'))},{'name':_0xc804('0x8'),'script':path[_0xc804('0x2')](__dirname,'../../services/routing/index.js')},{'name':_0xc804('0x9'),'script':path[_0xc804('0x2')](__dirname,_0xc804('0xa'))}]};module[_0xc804('0xb')]=config;
\ No newline at end of file
+var _0xa425=['join','../../services/ami/index.js','agi','email','routing','../../services/routing/index.js','xdr','path','../../services/express/index.js','ami'];(function(_0x888385,_0x9cdc66){var _0x22d5c2=function(_0x3b1599){while(--_0x3b1599){_0x888385['push'](_0x888385['shift']());}};_0x22d5c2(++_0x9cdc66);}(_0xa425,0x133));var _0x5a42=function(_0x28669c,_0x1f62c4){_0x28669c=_0x28669c-0x0;var _0x4a3af6=_0xa425[_0x28669c];return _0x4a3af6;};'use strict';var path=require(_0x5a42('0x0'));var os=require('os');var config={'apps':[{'name':'express','script':path['join'](__dirname,_0x5a42('0x1'))},{'name':_0x5a42('0x2'),'script':path[_0x5a42('0x3')](__dirname,_0x5a42('0x4'))},{'name':_0x5a42('0x5'),'script':path[_0x5a42('0x3')](__dirname,'../../services/agi/index.js')},{'name':_0x5a42('0x6'),'script':path[_0x5a42('0x3')](__dirname,'../../services/email/index.js')},{'name':_0x5a42('0x7'),'script':path[_0x5a42('0x3')](__dirname,_0x5a42('0x8'))},{'name':_0x5a42('0x9'),'script':path['join'](__dirname,'../../services/xdr/index.js')}]};module['exports']=config;
\ No newline at end of file
index ff5a48e..2487f24 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa964=['delete','dump','saved','bluebird','./config','connect','connected','start','disconnect','stop','then','restart','list','describe'];(function(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0xa964,0x161));var _0x4a96=function(_0x154940,_0x4a448a){_0x154940=_0x154940-0x0;var _0x401409=_0xa964[_0x154940];return _0x401409;};'use strict';var pm2=require('pm2');var BPromise=require(_0x4a96('0x0'));var config=require(_0x4a96('0x1'));function connect(){return new BPromise(function(_0x2e426f,_0x547367){return pm2[_0x4a96('0x2')](function(_0x1be950){if(_0x1be950){return _0x547367(_0x1be950);}return _0x2e426f(_0x4a96('0x3'));});});};exports[_0x4a96('0x4')]=function(_0x510a26){return connect()['then'](function(){return new BPromise(function(_0x28c899,_0x2885e3){return pm2[_0x4a96('0x4')](_0x510a26,function(_0xc5e440,_0x279023){if(_0xc5e440){return _0x2885e3(_0xc5e440);}pm2[_0x4a96('0x5')]();return _0x28c899(_0x279023);});});});};exports[_0x4a96('0x6')]=function(_0x590c33){return connect()[_0x4a96('0x7')](function(){return new BPromise(function(_0x56d66f,_0x57e540){return pm2[_0x4a96('0x6')](_0x590c33,function(_0x2e3d25,_0x5a8dc7){if(_0x2e3d25){return _0x57e540(_0x2e3d25);}pm2[_0x4a96('0x5')]();return _0x56d66f(_0x5a8dc7);});});});};exports[_0x4a96('0x8')]=function(_0x4cafce){return connect()[_0x4a96('0x7')](function(){return new BPromise(function(_0x3e4d0d,_0x2fafee){return pm2[_0x4a96('0x8')](_0x4cafce,function(_0x15b0b3,_0x293646){if(_0x15b0b3){return _0x2fafee(_0x15b0b3);}pm2[_0x4a96('0x5')]();return _0x3e4d0d(_0x293646);});});});};exports[_0x4a96('0x9')]=function(){return connect()['then'](function(){return new BPromise(function(_0x24bc4c,_0x3fcbd9){return pm2[_0x4a96('0x9')](function(_0x5d1f56,_0x10dfc0){if(_0x5d1f56){return _0x3fcbd9(_0x5d1f56);}pm2[_0x4a96('0x5')]();return _0x24bc4c(_0x10dfc0);});});});};exports[_0x4a96('0xa')]=function(_0x107d98){return connect()[_0x4a96('0x7')](function(){return new BPromise(function(_0x4bc503,_0x58ba50){return pm2[_0x4a96('0xa')](_0x107d98,function(_0x5c0630,_0x2e6e19){if(_0x5c0630){return _0x58ba50(_0x5c0630);}pm2[_0x4a96('0x5')]();return _0x4bc503(_0x2e6e19);});});});};exports[_0x4a96('0xb')]=function(_0x183b83){return connect()['then'](function(){return new BPromise(function(_0x1396df,_0x3edbe6){return pm2[_0x4a96('0xb')](_0x183b83,function(_0x472b83,_0xd50e12){if(_0x472b83){return _0x3edbe6(_0x472b83);}pm2[_0x4a96('0x5')]();return _0x1396df(_0xd50e12);});});});};exports[_0x4a96('0xc')]=function(){return connect()[_0x4a96('0x7')](function(){return new BPromise(function(_0x59d5b3,_0x42211c){return pm2[_0x4a96('0xc')](function(_0x4419a1){if(_0x4419a1){return _0x42211c(_0x4419a1);}return _0x59d5b3(_0x4a96('0xd'));});});});};
\ No newline at end of file
+var _0xbba2=['then','disconnect','stop','list','describe','delete','dump','saved','pm2','start'];(function(_0x56b18b,_0x4eedd5){var _0x46720f=function(_0x4e72e4){while(--_0x4e72e4){_0x56b18b['push'](_0x56b18b['shift']());}};_0x46720f(++_0x4eedd5);}(_0xbba2,0xe4));var _0x2bba=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbba2[_0x3dd15e];return _0x231fd0;};'use strict';var pm2=require(_0x2bba('0x0'));var BPromise=require('bluebird');var config=require('./config');function connect(){return new BPromise(function(_0x295ca2,_0x9d01ed){return pm2['connect'](function(_0x3fada8){if(_0x3fada8){return _0x9d01ed(_0x3fada8);}return _0x295ca2('connected');});});};exports[_0x2bba('0x1')]=function(_0x3f2242){return connect()[_0x2bba('0x2')](function(){return new BPromise(function(_0xdb7db5,_0x24b294){return pm2[_0x2bba('0x1')](_0x3f2242,function(_0x5a2ae4,_0x115f8a){if(_0x5a2ae4){return _0x24b294(_0x5a2ae4);}pm2[_0x2bba('0x3')]();return _0xdb7db5(_0x115f8a);});});});};exports['stop']=function(_0x5bbefa){return connect()[_0x2bba('0x2')](function(){return new BPromise(function(_0x286b2c,_0x4d785f){return pm2[_0x2bba('0x4')](_0x5bbefa,function(_0x52338d,_0x993a7a){if(_0x52338d){return _0x4d785f(_0x52338d);}pm2[_0x2bba('0x3')]();return _0x286b2c(_0x993a7a);});});});};exports['restart']=function(_0x354229){return connect()[_0x2bba('0x2')](function(){return new BPromise(function(_0xcbd952,_0x5cc1d3){return pm2['restart'](_0x354229,function(_0x4e10ad,_0x16e50d){if(_0x4e10ad){return _0x5cc1d3(_0x4e10ad);}pm2[_0x2bba('0x3')]();return _0xcbd952(_0x16e50d);});});});};exports[_0x2bba('0x5')]=function(){return connect()[_0x2bba('0x2')](function(){return new BPromise(function(_0x1f6ce8,_0x3fe23d){return pm2[_0x2bba('0x5')](function(_0x29d7e3,_0x4702cd){if(_0x29d7e3){return _0x3fe23d(_0x29d7e3);}pm2[_0x2bba('0x3')]();return _0x1f6ce8(_0x4702cd);});});});};exports[_0x2bba('0x6')]=function(_0x371a4c){return connect()['then'](function(){return new BPromise(function(_0x3d3f02,_0x27f3ba){return pm2[_0x2bba('0x6')](_0x371a4c,function(_0xb2d8b,_0x432c85){if(_0xb2d8b){return _0x27f3ba(_0xb2d8b);}pm2[_0x2bba('0x3')]();return _0x3d3f02(_0x432c85);});});});};exports[_0x2bba('0x7')]=function(_0x423a71){return connect()[_0x2bba('0x2')](function(){return new BPromise(function(_0x2b42fe,_0x1f91ab){return pm2[_0x2bba('0x7')](_0x423a71,function(_0x346822,_0x10054f){if(_0x346822){return _0x1f91ab(_0x346822);}pm2['disconnect']();return _0x2b42fe(_0x10054f);});});});};exports[_0x2bba('0x8')]=function(){return connect()[_0x2bba('0x2')](function(){return new BPromise(function(_0x593667,_0x1f0012){return pm2[_0x2bba('0x8')](function(_0x37bc4f){if(_0x37bc4f){return _0x1f0012(_0x37bc4f);}return _0x593667(_0x2bba('0x9'));});});});};
\ No newline at end of file
index 636e85c..7ab5ee3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe7dc=['YYYY-MM-DD\x20HH:mm:ss','length','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','emit','catch','error','[CHAT]\x20Error\x20closing\x20interactions','inspect','start','lodash','moment','ioredis','util','../../mysqldb','../logger','redis','defaults','localhost','socket.io-emitter','Setting','find','chatTimeout','findAll','lastMsgAt','subtract','then','info','[CHAT]\x20Interactions\x20to\x20close:','join','ChatInteraction','update','timeout','format'];(function(_0x301c34,_0x15701e){var _0x1a8c5a=function(_0x297b4f){while(--_0x297b4f){_0x301c34['push'](_0x301c34['shift']());}};_0x1a8c5a(++_0x15701e);}(_0xe7dc,0x132));var _0xce7d=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe7dc[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xce7d('0x0'));var moment=require(_0xce7d('0x1'));var Redis=require(_0xce7d('0x2'));var util=require(_0xce7d('0x3'));var config=require('../../config/environment');var db=require(_0xce7d('0x4'))['db'];var logger=require(_0xce7d('0x5'))('schedule');config[_0xce7d('0x6')]=_[_0xce7d('0x7')](config['redis'],{'host':_0xce7d('0x8'),'port':0x18eb});var io=require(_0xce7d('0x9'))(new Redis(config[_0xce7d('0x6')]));function closeInteractions(){var _0x46c00a=0x0;var _0x3b6d68=[];return db[_0xce7d('0xa')][_0xce7d('0xb')]({'raw':!![],'attributes':['id',_0xce7d('0xc')],'where':{'id':0x1}})['then'](function(_0x37aa27){_0x46c00a=_0x37aa27['chatTimeout'];if(_0x46c00a){return db['ChatInteraction'][_0xce7d('0xd')]({'raw':!![],'attributes':['id',_0xce7d('0xe')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0xce7d('0xf')](_0x37aa27[_0xce7d('0xc')],'minutes')}}});}else{return[];}})[_0xce7d('0x10')](function(_0x3cbb12){if(_0x3cbb12&&_0x3cbb12['length']){_0x3b6d68=_['map'](_0x3cbb12||[],'id');logger[_0xce7d('0x11')](_0xce7d('0x12'),_0x3b6d68[_0xce7d('0x13')]());return db[_0xce7d('0x14')][_0xce7d('0x15')]({'closeReason':'system','disposition':_0xce7d('0x16'),'closed':!![],'closedAt':moment()[_0xce7d('0x17')](_0xce7d('0x18'))},{'where':{'id':_0x3b6d68}});}})[_0xce7d('0x10')](function(){if(_0x3b6d68&&_0x3b6d68[_0xce7d('0x19')]){logger[_0xce7d('0x11')](_0xce7d('0x1a'),_0x3b6d68[_0xce7d('0x13')]());for(var _0x155c7a=0x0;_0x155c7a<_0x3b6d68[_0xce7d('0x19')];_0x155c7a++){io[_0xce7d('0x1b')]('chatInteraction:update',{'id':_0x3b6d68[_0x155c7a],'closed':!![]});}}})[_0xce7d('0x1c')](function(_0x307c1a){logger[_0xce7d('0x1d')](_0xce7d('0x1e'),_0x307c1a?util[_0xce7d('0x1f')](_0x307c1a,{'showHidden':![],'depth':null}):'');});}exports[_0xce7d('0x20')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();};
\ No newline at end of file
+var _0x2315=['emit','catch','error','inspect','start','ioredis','util','../../mysqldb','redis','defaults','socket.io-emitter','Setting','find','chatTimeout','then','ChatInteraction','findAll','lastMsgAt','minutes','length','info','join','update','system','format','YYYY-MM-DD\x20HH:mm:ss','[CHAT]\x20Sending\x20updates\x20for\x20interactions:'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x2315,0x1d0));var _0x5231=function(_0x5ae639,_0x239056){_0x5ae639=_0x5ae639-0x0;var _0x2d0693=_0x2315[_0x5ae639];return _0x2d0693;};'use strict';var _=require('lodash');var moment=require('moment');var Redis=require(_0x5231('0x0'));var util=require(_0x5231('0x1'));var config=require('../../config/environment');var db=require(_0x5231('0x2'))['db'];var logger=require('../logger')('schedule');config[_0x5231('0x3')]=_[_0x5231('0x4')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x5231('0x5'))(new Redis(config[_0x5231('0x3')]));function closeInteractions(){var _0x36d2d6=0x0;var _0x58478f=[];return db[_0x5231('0x6')][_0x5231('0x7')]({'raw':!![],'attributes':['id',_0x5231('0x8')],'where':{'id':0x1}})[_0x5231('0x9')](function(_0x52cfaa){_0x36d2d6=_0x52cfaa['chatTimeout'];if(_0x36d2d6){return db[_0x5231('0xa')][_0x5231('0xb')]({'raw':!![],'attributes':['id',_0x5231('0xc')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()['subtract'](_0x52cfaa[_0x5231('0x8')],_0x5231('0xd'))}}});}else{return[];}})[_0x5231('0x9')](function(_0x115ebb){if(_0x115ebb&&_0x115ebb[_0x5231('0xe')]){_0x58478f=_['map'](_0x115ebb||[],'id');logger[_0x5231('0xf')]('[CHAT]\x20Interactions\x20to\x20close:',_0x58478f[_0x5231('0x10')]());return db[_0x5231('0xa')][_0x5231('0x11')]({'closeReason':_0x5231('0x12'),'disposition':'timeout','closed':!![],'closedAt':moment()[_0x5231('0x13')](_0x5231('0x14'))},{'where':{'id':_0x58478f}});}})[_0x5231('0x9')](function(){if(_0x58478f&&_0x58478f[_0x5231('0xe')]){logger[_0x5231('0xf')](_0x5231('0x15'),_0x58478f[_0x5231('0x10')]());for(var _0x291cf7=0x0;_0x291cf7<_0x58478f[_0x5231('0xe')];_0x291cf7++){io[_0x5231('0x16')]('chatInteraction:update',{'id':_0x58478f[_0x291cf7],'closed':!![]});}}})[_0x5231('0x17')](function(_0x1da91c){logger[_0x5231('0x18')]('[CHAT]\x20Error\x20closing\x20interactions',_0x1da91c?util[_0x5231('0x19')](_0x1da91c,{'showHidden':![],'depth':null}):'');});}exports[_0x5231('0x1a')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();};
\ No newline at end of file
index 5bb9bc3..6c50c12 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe7cc=['startAllRefreshIntervals'];(function(_0x4f244f,_0x3e661d){var _0x4e1338=function(_0x26c30d){while(--_0x26c30d){_0x4f244f['push'](_0x4f244f['shift']());}};_0x4e1338(++_0x3e661d);}(_0xe7cc,0x15d));var _0xce7c=function(_0x15293b,_0x322926){_0x15293b=_0x15293b-0x0;var _0xfcb5b=_0xe7cc[_0x15293b];return _0xfcb5b;};'use strict';function start(){var _0x1ed11c=require('../../api/cloudProvider/cloudProvider.oauth.js');return _0x1ed11c[_0xce7c('0x0')]();}module['exports']={'intervals':{},'start':start};
\ No newline at end of file
+var _0x7c4b=['../../api/cloudProvider/cloudProvider.oauth.js','exports'];(function(_0x2f1f41,_0x1937cb){var _0x269870=function(_0x351844){while(--_0x351844){_0x2f1f41['push'](_0x2f1f41['shift']());}};_0x269870(++_0x1937cb);}(_0x7c4b,0x8a));var _0xb7c4=function(_0x541a29,_0x2577c9){_0x541a29=_0x541a29-0x0;var _0x31263c=_0x7c4b[_0x541a29];return _0x31263c;};'use strict';function start(){var _0x414792=require(_0xb7c4('0x0'));return _0x414792['startAllRefreshIntervals']();}module[_0xb7c4('0x1')]={'intervals':{},'start':start};
\ No newline at end of file
index 5ad7d5c..6f869f7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5304=['my\x20id','resolve','run\x20job','cron','active','isBetween','startAt','add','start','add\x20cron','stop\x20cron','endAt','update','update\x20cron','run','util','path','jayson/promise','bluebird','../logger','../../mysqldb','../../api/analyticDefaultReport/analyticDefaultReport.controller','http','info','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','getSmtpOptions','user','bcc','format','Report\x20%s\x20last\x20%s\x20%s','name','subtractNumber','subtractUnit','../../files/reports','savename','%s.%s','basename','extname','zip','join','existsSync','status','message','text','Sent','attachments','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','request','SendMail','error','error\x20mail','stringify','email\x20sent','catch','Smtp','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','YYYY-MM-DD\x20HH:mm:ss','scheduled','exec\x20defaul\x20report\x20id:%s','runReport','DefaultReportId','then','CustomReportId','exec\x20custom\x20report\x20id:%s','no\x20report\x20id','MailServerOut','CloudProvider','keys','jobs','map','toString','keyBy','difference','intersection','length','exists','stop','deleteJob','delete\x20cron','toRun','index'];(function(_0x26de59,_0x3fb2d4){var _0x4b6982=function(_0x523d4a){while(--_0x523d4a){_0x26de59['push'](_0x26de59['shift']());}};_0x4b6982(++_0x3fb2d4);}(_0x5304,0x167));var _0x4530=function(_0xefd519,_0xc62635){_0xefd519=_0xefd519-0x0;var _0x4bb882=_0x5304[_0xefd519];return _0x4bb882;};'use strict';var fs=require('fs');var util=require(_0x4530('0x0'));var path=require(_0x4530('0x1'));var _=require('lodash');var moment=require('moment');var CronJobManager=require('cron-job-manager');var jayson=require(_0x4530('0x2'));var BPromise=require(_0x4530('0x3'));var logger=require(_0x4530('0x4'))('schedule');var db=require(_0x4530('0x5'))['db'];var analyticCustomReportController=require('../../api/analyticCustomReport/analyticCustomReport.controller');var analyticDefaultReportController=require(_0x4530('0x6'));var client=jayson['client'][_0x4530('0x7')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x578432,_0x18d8de){return function(){logger[_0x4530('0x8')](_0x4530('0x9'),_0x578432[_0x4530('0xa')]);var _0x230db3=!![];var _0x5dc4e7=_0x578432[_0x4530('0xb')][_0x4530('0xc')]();var _0x417a1a={'account':_0x5dc4e7,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0x578432['MailAccount']['name'],_0x578432['MailAccount']['email']||_0x578432['MailAccount']['Smtp'][_0x4530('0xd')]),'to':_0x578432[_0x4530('0xa')],'cc':_0x578432['cc'],'bcc':_0x578432[_0x4530('0xe')],'subject':util[_0x4530('0xf')](_0x4530('0x10'),_0x18d8de[_0x4530('0x11')],_0x578432[_0x4530('0x12')],_0x578432[_0x4530('0x13')])}};var _0x1bd136=path['join'](__dirname,_0x4530('0x14'));var _0x46363f=_0x18d8de[_0x4530('0x15')];var _0x18b1df=util['format'](_0x4530('0x16'),path[_0x4530('0x17')](_0x18d8de[_0x4530('0x15')],path[_0x4530('0x18')](_0x18d8de[_0x4530('0x15')])),_0x4530('0x19'));var _0x50c690=path[_0x4530('0x1a')](_0x1bd136,_0x46363f);var _0x2e39bb=path[_0x4530('0x1a')](_0x1bd136,_0x18b1df);if(fs[_0x4530('0x1b')](_0x50c690)){_0x18d8de[_0x4530('0x1c')]='Sent';_0x417a1a[_0x4530('0x1d')]['attachments']=[{'filename':_0x46363f,'path':_0x50c690}];_0x417a1a[_0x4530('0x1d')][_0x4530('0x1e')]=util[_0x4530('0xf')]('Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a',JSON['stringify'](_0x18d8de,null,0x2));}else if(fs['existsSync'](_0x2e39bb)){_0x18d8de['status']=_0x4530('0x1f');_0x417a1a['message'][_0x4530('0x20')]=[{'filename':_0x18b1df,'path':_0x2e39bb}];}else{_0x417a1a[_0x4530('0x1d')][_0x4530('0x1e')]='Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a';if(!_0x578432[_0x4530('0x21')]){_0x230db3=![];logger[_0x4530('0x8')](_0x4530('0x22'));}}if(_0x230db3){return client[_0x4530('0x23')](_0x4530('0x24'),_0x417a1a)['then'](function(_0x2cb050){if(_0x2cb050[_0x4530('0x25')]){return logger[_0x4530('0x25')](_0x4530('0x26'),JSON[_0x4530('0x27')](_0x2cb050));}return logger[_0x4530('0x8')](_0x4530('0x28'));})[_0x4530('0x29')](function(_0x12e6a8){return logger[_0x4530('0x25')]('error\x20mail',JSON[_0x4530('0x27')](_0x12e6a8));});}};}function handleError(){return function(_0x1cbf7e){return logger[_0x4530('0x25')](JSON['stringify'](_0x1cbf7e));};}function handleResult(_0x256e8a){return function(_0x1ad531){logger['info']('data',JSON['stringify'](_0x1ad531));if(_0x256e8a[_0x4530('0xb')]&&_0x256e8a[_0x4530('0xb')][_0x4530('0x2a')]&&!_[_0x4530('0x2b')](_0x256e8a['email'])){setTimeout(handleSendEmail(_0x256e8a,_0x1ad531),0x3c*0x3e8);}};}function handleJob(_0x5218e4){return function(){try{if(_[_0x4530('0x2b')](_0x5218e4[_0x4530('0x12')])){return logger[_0x4530('0x8')](_0x4530('0x2c'));}if(_[_0x4530('0x2b')](_0x5218e4['subtractUnit'])){return logger[_0x4530('0x8')](_0x4530('0x2d'));}var _0x5389e7={'startDate':moment()['subtract'](_0x5218e4['subtractNumber'],_0x5218e4[_0x4530('0x13')])[_0x4530('0xf')](_0x4530('0x2e')),'endDate':moment()[_0x4530('0xf')](_0x4530('0x2e')),'type':_0x4530('0x2f'),'output':_0x5218e4['output'],'name':_0x5218e4[_0x4530('0x11')]};if(!_[_0x4530('0x2b')](_0x5218e4['DefaultReportId'])){logger[_0x4530('0x8')](_0x4530('0x30'),_0x5218e4['DefaultReportId']);return analyticDefaultReportController[_0x4530('0x31')]({'id':_0x5218e4[_0x4530('0x32')]},_0x5389e7)[_0x4530('0x33')](handleResult(_0x5218e4))[_0x4530('0x29')](handleError());}if(!_[_0x4530('0x2b')](_0x5218e4[_0x4530('0x34')])){logger[_0x4530('0x8')](_0x4530('0x35'),_0x5218e4[_0x4530('0x34')]);return analyticCustomReportController[_0x4530('0x31')]({'id':_0x5218e4[_0x4530('0x34')]},_0x5389e7)[_0x4530('0x33')](handleResult(_0x5218e4))['catch'](handleError());}}catch(_0x3c5edc){logger['error'](JSON['stringify'](_0x3c5edc));}return logger[_0x4530('0x8')](_0x4530('0x36'));};}function getJobs(_0x455583){var _0x27331b={};if(_0x455583){_0x27331b['id']=_0x455583;}return db['Schedule']['findAll']({'where':_0x27331b,'include':[{'model':db['MailAccount'],'attributes':['id',_0x4530('0x11'),_0x4530('0xa')],'include':[{'model':db[_0x4530('0x37')],'as':_0x4530('0x2a'),'include':[{'model':db[_0x4530('0x38')],'as':_0x4530('0x38')}]}]}]})[_0x4530('0x33')](function(_0x1bed7b){var _0x2d3c54=_[_0x4530('0x39')](manager[_0x4530('0x3a')]);var _0x223e3a=_[_0x4530('0x3b')](_0x1bed7b,function(_0xee368b){return _0xee368b['id'][_0x4530('0x3c')]();});var _0xb2368b=_[_0x4530('0x3d')](_0x1bed7b,function(_0x103172){return _0x103172['id'][_0x4530('0x3c')]();});var _0x35d3f1=_0x455583?_0x223e3a:_[_0x4530('0x3e')](_0x223e3a,_0x2d3c54);var _0x386cb5=_[_0x4530('0x3f')](_0x223e3a,_0x2d3c54);var _0x5608cc=_[_0x4530('0x3e')](_0x2d3c54,_0x223e3a);var _0x423453;var _0x35503d;for(_0x423453=0x0;_0x423453<_0x5608cc[_0x4530('0x40')]&&!_0x455583;_0x423453+=0x1){_0x35503d=_0x5608cc[_0x423453][_0x4530('0x3c')]();if(manager[_0x4530('0x41')](_0x35503d)){manager[_0x4530('0x42')](_0x35503d);manager[_0x4530('0x43')](_0x35503d);logger[_0x4530('0x8')](_0x4530('0x44'),_0x35503d);}}logger[_0x4530('0x8')](_0x4530('0x45'),JSON[_0x4530('0x27')](_0x35d3f1));for(_0x423453=0x0;_0x423453<_0x35d3f1['length'];_0x423453+=0x1){_0x35503d=_0x35d3f1[_0x423453]['toString']();logger[_0x4530('0x8')](_0x4530('0x46'),_0x35503d);if(_0x455583){logger[_0x4530('0x8')](_0x4530('0x47'),_0x455583);logger[_0x4530('0x8')](JSON[_0x4530('0x27')](_0xb2368b[_0x35503d]));BPromise[_0x4530('0x48')]()['then'](handleJob(_0xb2368b[_0x35503d]));logger[_0x4530('0x8')](_0x4530('0x49'),_0xb2368b[_0x35503d]['name'],_0xb2368b[_0x35503d][_0x4530('0x4a')]);}else if(_0xb2368b[_0x35503d][_0x4530('0x4a')]&&_0xb2368b[_0x35503d][_0x4530('0x4b')]&&moment()[_0x4530('0x4c')](_0xb2368b[_0x35503d][_0x4530('0x4d')],_0xb2368b[_0x35503d]['endAt'])){manager[_0x4530('0x4e')](_0x35503d,_0xb2368b[_0x35503d][_0x4530('0x4a')],handleJob(_0xb2368b[_0x35503d]));manager[_0x4530('0x4f')](_0x35503d);logger[_0x4530('0x8')](_0x4530('0x50'),_0xb2368b[_0x35503d]['name'],_0xb2368b[_0x35503d][_0x4530('0x4a')]);}else if(manager[_0x4530('0x41')](_0x35503d)){manager[_0x4530('0x42')](_0x35503d);manager['deleteJob'](_0x35503d);logger['info'](_0x4530('0x51'),_0xb2368b[_0x35503d][_0x4530('0x11')],_0xb2368b[_0x35503d][_0x4530('0x4a')]);}}for(_0x423453=0x0,_0x35503d;_0x423453<_0x386cb5['length']&&!_0x455583;_0x423453+=0x1){_0x35503d=_0x386cb5[_0x423453][_0x4530('0x3c')]();if(manager['exists'](_0x35503d)){if(_0xb2368b[_0x35503d][_0x4530('0x4a')]&&_0xb2368b[_0x35503d][_0x4530('0x4b')]&&moment()['isBetween'](_0xb2368b[_0x35503d][_0x4530('0x4d')],_0xb2368b[_0x35503d][_0x4530('0x52')])){manager[_0x4530('0x53')](_0x35503d,_0xb2368b[_0x35503d][_0x4530('0x4a')],handleJob(_0xb2368b[_0x35503d]));logger['info'](_0x4530('0x54'),_0xb2368b[_0x35503d][_0x4530('0x11')],_0xb2368b[_0x35503d]['cron']);}else{manager[_0x4530('0x42')](_0x35503d);manager[_0x4530('0x43')](_0x35503d);logger['info'](_0x4530('0x51'),_0xb2368b[_0x35503d][_0x4530('0x11')],_0xb2368b[_0x35503d][_0x4530('0x4a')]);}}}})['catch'](function(_0x511870){logger[_0x4530('0x25')](JSON[_0x4530('0x27')](_0x511870));});}exports[_0x4530('0x55')]=function(_0x5477d4){return getJobs(_0x5477d4);};exports[_0x4530('0x4f')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();};
\ No newline at end of file
+var _0x450f=['bcc','Report\x20%s\x20last\x20%s\x20%s','join','../../files/reports','savename','extname','zip','existsSync','status','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','Sent','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','request','SendMail','error','error\x20mail','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','runReport','then','catch','CustomReportId','no\x20report\x20id','Schedule','findAll','MailServerOut','CloudProvider','keys','jobs','toString','keyBy','difference','intersection','length','exists','stop','deleteJob','toRun','index','my\x20id','run\x20job','cron','active','startAt','endAt','add','start','stop\x20cron','isBetween','update','update\x20cron','run','util','lodash','moment','cron-job-manager','jayson/promise','bluebird','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','http','info','Try\x20to\x20send\x20a\x20mail\x20to','MailAccount','getSmtpOptions','format','name','email','Smtp'];(function(_0x1d046a,_0x30db41){var _0x2c0b0c=function(_0x30a3c5){while(--_0x30a3c5){_0x1d046a['push'](_0x1d046a['shift']());}};_0x2c0b0c(++_0x30db41);}(_0x450f,0xe9));var _0xf450=function(_0x145eff,_0x269003){_0x145eff=_0x145eff-0x0;var _0x1a7a9e=_0x450f[_0x145eff];return _0x1a7a9e;};'use strict';var fs=require('fs');var util=require(_0xf450('0x0'));var path=require('path');var _=require(_0xf450('0x1'));var moment=require(_0xf450('0x2'));var CronJobManager=require(_0xf450('0x3'));var jayson=require(_0xf450('0x4'));var BPromise=require(_0xf450('0x5'));var logger=require('../logger')(_0xf450('0x6'));var db=require(_0xf450('0x7'))['db'];var analyticCustomReportController=require(_0xf450('0x8'));var analyticDefaultReportController=require(_0xf450('0x9'));var client=jayson['client'][_0xf450('0xa')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0xad03b,_0x61b23){return function(){logger[_0xf450('0xb')](_0xf450('0xc'),_0xad03b['email']);var _0x1c98ec=!![];var _0xeb8a80=_0xad03b[_0xf450('0xd')][_0xf450('0xe')]();var _0x2129ad={'account':_0xeb8a80,'message':{'from':util[_0xf450('0xf')]('\x22%s\x22\x20<%s>',_0xad03b[_0xf450('0xd')][_0xf450('0x10')],_0xad03b[_0xf450('0xd')][_0xf450('0x11')]||_0xad03b[_0xf450('0xd')][_0xf450('0x12')]['user']),'to':_0xad03b['email'],'cc':_0xad03b['cc'],'bcc':_0xad03b[_0xf450('0x13')],'subject':util[_0xf450('0xf')](_0xf450('0x14'),_0x61b23[_0xf450('0x10')],_0xad03b['subtractNumber'],_0xad03b['subtractUnit'])}};var _0x18048b=path[_0xf450('0x15')](__dirname,_0xf450('0x16'));var _0x18d736=_0x61b23[_0xf450('0x17')];var _0x24bf15=util[_0xf450('0xf')]('%s.%s',path['basename'](_0x61b23[_0xf450('0x17')],path[_0xf450('0x18')](_0x61b23[_0xf450('0x17')])),_0xf450('0x19'));var _0x28357c=path[_0xf450('0x15')](_0x18048b,_0x18d736);var _0x1b662c=path[_0xf450('0x15')](_0x18048b,_0x24bf15);if(fs[_0xf450('0x1a')](_0x28357c)){_0x61b23[_0xf450('0x1b')]='Sent';_0x2129ad[_0xf450('0x1c')][_0xf450('0x1d')]=[{'filename':_0x18d736,'path':_0x28357c}];_0x2129ad[_0xf450('0x1c')][_0xf450('0x1e')]=util['format'](_0xf450('0x1f'),JSON[_0xf450('0x20')](_0x61b23,null,0x2));}else if(fs[_0xf450('0x1a')](_0x1b662c)){_0x61b23[_0xf450('0x1b')]=_0xf450('0x21');_0x2129ad[_0xf450('0x1c')][_0xf450('0x1d')]=[{'filename':_0x24bf15,'path':_0x1b662c}];}else{_0x2129ad[_0xf450('0x1c')][_0xf450('0x1e')]=_0xf450('0x22');if(!_0xad03b[_0xf450('0x23')]){_0x1c98ec=![];logger['info']('empty\x20file,\x20email\x20not\x20sent');}}if(_0x1c98ec){return client[_0xf450('0x24')](_0xf450('0x25'),_0x2129ad)['then'](function(_0x15e5e8){if(_0x15e5e8['error']){return logger[_0xf450('0x26')]('error\x20mail',JSON[_0xf450('0x20')](_0x15e5e8));}return logger[_0xf450('0xb')]('email\x20sent');})['catch'](function(_0x3fc349){return logger[_0xf450('0x26')](_0xf450('0x27'),JSON[_0xf450('0x20')](_0x3fc349));});}};}function handleError(){return function(_0x127f9a){return logger['error'](JSON['stringify'](_0x127f9a));};}function handleResult(_0x56abcb){return function(_0x2f9e42){logger[_0xf450('0xb')](_0xf450('0x28'),JSON[_0xf450('0x20')](_0x2f9e42));if(_0x56abcb[_0xf450('0xd')]&&_0x56abcb['MailAccount'][_0xf450('0x12')]&&!_[_0xf450('0x29')](_0x56abcb['email'])){setTimeout(handleSendEmail(_0x56abcb,_0x2f9e42),0x3c*0x3e8);}};}function handleJob(_0x4a9325){return function(){try{if(_[_0xf450('0x29')](_0x4a9325['subtractNumber'])){return logger[_0xf450('0xb')](_0xf450('0x2a'));}if(_['isNil'](_0x4a9325[_0xf450('0x2b')])){return logger['info'](_0xf450('0x2c'));}var _0x4d5c8c={'startDate':moment()[_0xf450('0x2d')](_0x4a9325['subtractNumber'],_0x4a9325[_0xf450('0x2b')])[_0xf450('0xf')](_0xf450('0x2e')),'endDate':moment()[_0xf450('0xf')]('YYYY-MM-DD\x20HH:mm:ss'),'type':_0xf450('0x2f'),'output':_0x4a9325[_0xf450('0x30')],'name':_0x4a9325['name']};if(!_[_0xf450('0x29')](_0x4a9325[_0xf450('0x31')])){logger[_0xf450('0xb')]('exec\x20defaul\x20report\x20id:%s',_0x4a9325[_0xf450('0x31')]);return analyticDefaultReportController[_0xf450('0x32')]({'id':_0x4a9325[_0xf450('0x31')]},_0x4d5c8c)[_0xf450('0x33')](handleResult(_0x4a9325))[_0xf450('0x34')](handleError());}if(!_[_0xf450('0x29')](_0x4a9325[_0xf450('0x35')])){logger['info']('exec\x20custom\x20report\x20id:%s',_0x4a9325['CustomReportId']);return analyticCustomReportController[_0xf450('0x32')]({'id':_0x4a9325[_0xf450('0x35')]},_0x4d5c8c)['then'](handleResult(_0x4a9325))[_0xf450('0x34')](handleError());}}catch(_0x5b3bda){logger[_0xf450('0x26')](JSON[_0xf450('0x20')](_0x5b3bda));}return logger[_0xf450('0xb')](_0xf450('0x36'));};}function getJobs(_0x244296){var _0x1cb51a={};if(_0x244296){_0x1cb51a['id']=_0x244296;}return db[_0xf450('0x37')][_0xf450('0x38')]({'where':_0x1cb51a,'include':[{'model':db[_0xf450('0xd')],'attributes':['id',_0xf450('0x10'),_0xf450('0x11')],'include':[{'model':db[_0xf450('0x39')],'as':_0xf450('0x12'),'include':[{'model':db[_0xf450('0x3a')],'as':_0xf450('0x3a')}]}]}]})[_0xf450('0x33')](function(_0x5a39fe){var _0x39090a=_[_0xf450('0x3b')](manager[_0xf450('0x3c')]);var _0x83e39d=_['map'](_0x5a39fe,function(_0x389ac7){return _0x389ac7['id'][_0xf450('0x3d')]();});var _0x1488d7=_[_0xf450('0x3e')](_0x5a39fe,function(_0x3cc69f){return _0x3cc69f['id']['toString']();});var _0x499486=_0x244296?_0x83e39d:_[_0xf450('0x3f')](_0x83e39d,_0x39090a);var _0x140364=_[_0xf450('0x40')](_0x83e39d,_0x39090a);var _0x35d770=_['difference'](_0x39090a,_0x83e39d);var _0x56629c;var _0x5aef34;for(_0x56629c=0x0;_0x56629c<_0x35d770[_0xf450('0x41')]&&!_0x244296;_0x56629c+=0x1){_0x5aef34=_0x35d770[_0x56629c]['toString']();if(manager[_0xf450('0x42')](_0x5aef34)){manager[_0xf450('0x43')](_0x5aef34);manager[_0xf450('0x44')](_0x5aef34);logger[_0xf450('0xb')]('delete\x20cron',_0x5aef34);}}logger[_0xf450('0xb')](_0xf450('0x45'),JSON[_0xf450('0x20')](_0x499486));for(_0x56629c=0x0;_0x56629c<_0x499486['length'];_0x56629c+=0x1){_0x5aef34=_0x499486[_0x56629c][_0xf450('0x3d')]();logger['info'](_0xf450('0x46'),_0x5aef34);if(_0x244296){logger[_0xf450('0xb')](_0xf450('0x47'),_0x244296);logger[_0xf450('0xb')](JSON['stringify'](_0x1488d7[_0x5aef34]));BPromise['resolve']()[_0xf450('0x33')](handleJob(_0x1488d7[_0x5aef34]));logger['info'](_0xf450('0x48'),_0x1488d7[_0x5aef34][_0xf450('0x10')],_0x1488d7[_0x5aef34][_0xf450('0x49')]);}else if(_0x1488d7[_0x5aef34][_0xf450('0x49')]&&_0x1488d7[_0x5aef34][_0xf450('0x4a')]&&moment()['isBetween'](_0x1488d7[_0x5aef34][_0xf450('0x4b')],_0x1488d7[_0x5aef34][_0xf450('0x4c')])){manager[_0xf450('0x4d')](_0x5aef34,_0x1488d7[_0x5aef34][_0xf450('0x49')],handleJob(_0x1488d7[_0x5aef34]));manager[_0xf450('0x4e')](_0x5aef34);logger[_0xf450('0xb')]('add\x20cron',_0x1488d7[_0x5aef34][_0xf450('0x10')],_0x1488d7[_0x5aef34][_0xf450('0x49')]);}else if(manager[_0xf450('0x42')](_0x5aef34)){manager[_0xf450('0x43')](_0x5aef34);manager['deleteJob'](_0x5aef34);logger[_0xf450('0xb')](_0xf450('0x4f'),_0x1488d7[_0x5aef34][_0xf450('0x10')],_0x1488d7[_0x5aef34][_0xf450('0x49')]);}}for(_0x56629c=0x0,_0x5aef34;_0x56629c<_0x140364[_0xf450('0x41')]&&!_0x244296;_0x56629c+=0x1){_0x5aef34=_0x140364[_0x56629c][_0xf450('0x3d')]();if(manager['exists'](_0x5aef34)){if(_0x1488d7[_0x5aef34][_0xf450('0x49')]&&_0x1488d7[_0x5aef34]['active']&&moment()[_0xf450('0x50')](_0x1488d7[_0x5aef34][_0xf450('0x4b')],_0x1488d7[_0x5aef34][_0xf450('0x4c')])){manager[_0xf450('0x51')](_0x5aef34,_0x1488d7[_0x5aef34][_0xf450('0x49')],handleJob(_0x1488d7[_0x5aef34]));logger['info'](_0xf450('0x52'),_0x1488d7[_0x5aef34][_0xf450('0x10')],_0x1488d7[_0x5aef34][_0xf450('0x49')]);}else{manager[_0xf450('0x43')](_0x5aef34);manager['deleteJob'](_0x5aef34);logger[_0xf450('0xb')]('stop\x20cron',_0x1488d7[_0x5aef34][_0xf450('0x10')],_0x1488d7[_0x5aef34][_0xf450('0x49')]);}}}})[_0xf450('0x34')](function(_0xb486e7){logger[_0xf450('0x26')](JSON['stringify'](_0xb486e7));});}exports[_0xf450('0x53')]=function(_0x210b2e){return getJobs(_0x210b2e);};exports[_0xf450('0x4e')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();};
\ No newline at end of file
index b52d5ee..67bf2f9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3f19=['TranscriptFileUri','[RECORDING:%d]\x20Transcript\x20downloaded','transcripts','results','length','transcript','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','sentimentRegion','bucket','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','findOne','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','language','Sentiment','SentimentScore','Positive','Mixed','Neutral','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','CloudProvider','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','catch','name','SequelizeValidationError','inspect','VoiceRecording','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Setting','transcribeAccountId','Transcribe\x20not\x20configured','all','error','start','lodash','bluebird','../../config/logger','transcribe','TranscribeService','getTranscriptionJob','Comprehend','detectSentiment','substring','info','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','data2','transcribeRegion','then','format','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','fileText','COMPLETED','Transcript','[RECORDING:%d]\x20Get\x20transcript'];(function(_0x119b9b,_0x41c966){var _0x1d51e3=function(_0x521c05){while(--_0x521c05){_0x119b9b['push'](_0x119b9b['shift']());}};_0x1d51e3(++_0x41c966);}(_0x3f19,0xc0));var _0x93f1=function(_0x2483f6,_0x70bc75){_0x2483f6=_0x2483f6-0x0;var _0x44f7b9=_0x3f19[_0x2483f6];return _0x44f7b9;};var _=require(_0x93f1('0x0'));var AWS=require('aws-sdk');var rp=require('request-promise');var util=require('util');var BPromise=require(_0x93f1('0x1'));var db=require('../../mysqldb')['db'];var logger=require(_0x93f1('0x2'))(_0x93f1('0x3'));function getTranscriptionJob(_0x3bd3fa,_0x2057aa,_0x5dbfbc,_0x1ca333){return new Promise(function(_0x522769,_0x999026){var _0x425c6f=new AWS[(_0x93f1('0x4'))]({'accessKeyId':_0x2057aa,'secretAccessKey':_0x3bd3fa,'region':_0x5dbfbc});_0x425c6f[_0x93f1('0x5')]({'TranscriptionJobName':_0x1ca333},function(_0x5d7374,_0x1874da){if(_0x5d7374){return _0x999026(_0x5d7374);}else{return _0x522769(_0x1874da);}});});}function sentiment(_0xf3d309,_0x765520,_0x240758,_0xfe4f0,_0x558623){return new Promise(function(_0x2ee885,_0x19b137){var _0x225b20=new AWS[(_0x93f1('0x6'))]({'accessKeyId':_0x765520,'secretAccessKey':_0xf3d309,'region':_0x240758});_0x225b20[_0x93f1('0x7')]({'Text':_0xfe4f0,'LanguageCode':_0x558623[_0x93f1('0x8')](0x0,0x2)},function(_0x3ba517,_0x7cf148){if(_0x3ba517){return _0x19b137(_0x3ba517);}else{return _0x2ee885(_0x7cf148);}});});}function checkTranscribeJob(_0x1f9058,_0x3348ab,_0x5b4aa3){var _0x4080a8;return new BPromise(function(_0x455ca5,_0x2e15ef){logger[_0x93f1('0x9')](util['format'](_0x93f1('0xa'),_0x1f9058['id'],_0x1f9058[_0x93f1('0xb')]));return getTranscriptionJob(_0x5b4aa3[_0x93f1('0xc')],_0x5b4aa3[_0x93f1('0xd')],_0x3348ab[_0x93f1('0xe')],_0x1f9058[_0x93f1('0xb')])[_0x93f1('0xf')](function(_0x48e0a1){logger[_0x93f1('0x9')](util[_0x93f1('0x10')](_0x93f1('0x11'),_0x1f9058['id'],_0x1f9058[_0x93f1('0xb')],_0x48e0a1[_0x93f1('0x12')][_0x93f1('0x13')]));if(!_0x1f9058[_0x93f1('0x14')]){switch(_0x48e0a1[_0x93f1('0x12')][_0x93f1('0x13')]){case _0x93f1('0x15'):var _0x2c6d6b={'transcribeStatus':_0x48e0a1['TranscriptionJob']['TranscriptionJobStatus'],'fileUri':_0x48e0a1['TranscriptionJob'][_0x93f1('0x16')]['TranscriptFileUri']};logger[_0x93f1('0x9')](util[_0x93f1('0x10')](_0x93f1('0x17'),_0x1f9058['id']));return rp({'uri':_0x48e0a1[_0x93f1('0x12')]['Transcript'][_0x93f1('0x18')],'json':!![]})['then'](function(_0xe7cea3){logger[_0x93f1('0x9')](util['format'](_0x93f1('0x19'),_0x1f9058['id']));if(_0xe7cea3&&_0xe7cea3['results']&&_0xe7cea3['results'][_0x93f1('0x1a')]&&_0xe7cea3[_0x93f1('0x1b')]['transcripts'][_0x93f1('0x1c')]){_0x2c6d6b['fileText']='';for(var _0x1a6357=0x0;_0x1a6357<_0xe7cea3['results']['transcripts'][_0x93f1('0x1c')];_0x1a6357++){_0x2c6d6b[_0x93f1('0x14')]+=_0xe7cea3[_0x93f1('0x1b')][_0x93f1('0x1a')][_0x1a6357][_0x93f1('0x1d')]+'';}}return _0x1f9058[_0x93f1('0x1e')](_0x2c6d6b);})['then'](function(){logger[_0x93f1('0x9')](util['format'](_0x93f1('0x1f'),_0x1f9058['id']));if(!_0x1f9058[_0x93f1('0x20')]){throw new db[(_0x93f1('0x21'))][(_0x93f1('0x22'))](_0x93f1('0x23'));}if(!_0x3348ab[_0x93f1('0x24')]||!_0x3348ab[_0x93f1('0x25')]||!_0x3348ab[_0x93f1('0x26')]||!_0x3348ab['language']||!_0x3348ab[_0x93f1('0x27')]){throw new db[(_0x93f1('0x21'))][(_0x93f1('0x22'))](_0x93f1('0x28'));}if(!_0x2c6d6b['fileText']){throw new Error(_0x93f1('0x29'));}if(_0x3348ab[_0x93f1('0x25')]===_0x5b4aa3['id']){return _0x5b4aa3;}else{return db['CloudProvider'][_0x93f1('0x2a')]({'where':{'id':_settings[_0x93f1('0x25')]}});}})['then'](function(_0x496acd){if(!_0x496acd){throw new db[(_0x93f1('0x21'))]['ValidationError']('Cloud\x20Provider\x20not\x20available');}if(!_0x496acd['data1']||!_0x496acd['data2']){throw new db[(_0x93f1('0x21'))][(_0x93f1('0x22'))]('Cloud\x20Provider\x20not\x20configured');}_0x4080a8=_0x496acd;logger[_0x93f1('0x9')](util[_0x93f1('0x10')](_0x93f1('0x2b'),_0x1f9058['id']));return sentiment(_0x4080a8[_0x93f1('0xc')],_0x4080a8[_0x93f1('0xd')],_0x3348ab[_0x93f1('0x26')],_0x2c6d6b[_0x93f1('0x14')],_0x3348ab[_0x93f1('0x2c')]);})[_0x93f1('0xf')](function(_0xf999a6){logger[_0x93f1('0x9')](util['format']('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x1f9058['id']));return _0x1f9058[_0x93f1('0x1e')]({'sentiment':_0xf999a6[_0x93f1('0x2d')],'sPositive':_0xf999a6[_0x93f1('0x2e')][_0x93f1('0x2f')],'sNegative':_0xf999a6['SentimentScore']['Negative'],'sMixed':_0xf999a6[_0x93f1('0x2e')][_0x93f1('0x30')],'sNeutral':_0xf999a6['SentimentScore'][_0x93f1('0x31')]});})[_0x93f1('0xf')](function(){logger[_0x93f1('0x9')](util[_0x93f1('0x10')](_0x93f1('0x1f'),_0x1f9058['id']));_0x455ca5();});case _0x93f1('0x32'):return _0x1f9058[_0x93f1('0x1e')]({'transcribeStatus':_0x93f1('0x32'),'failureReason':_0x48e0a1[_0x93f1('0x12')][_0x93f1('0x33')]})['then'](function(){logger['info'](util[_0x93f1('0x10')](_0x93f1('0x1f'),_0x1f9058['id']));_0x455ca5();});default:logger[_0x93f1('0x9')](util[_0x93f1('0x10')](_0x93f1('0x34'),_0x1f9058['id']));break;}}else{return BPromise[_0x93f1('0x35')]()[_0x93f1('0xf')](function(){if(!_0x1f9058[_0x93f1('0x20')]){throw new db[(_0x93f1('0x21'))][(_0x93f1('0x22'))](_0x93f1('0x23'));}if(!_0x3348ab['sentiment']||!_0x3348ab[_0x93f1('0x25')]||!_0x3348ab['sentimentRegion']||!_0x3348ab[_0x93f1('0x2c')]||!_0x3348ab[_0x93f1('0x27')]){throw new db[(_0x93f1('0x21'))][(_0x93f1('0x22'))](_0x93f1('0x28'));}if(!_0x1f9058[_0x93f1('0x14')]){throw new Error(_0x93f1('0x29'));}if(_0x3348ab[_0x93f1('0x25')]===_0x5b4aa3['id']){return _0x5b4aa3;}else{return db[_0x93f1('0x36')][_0x93f1('0x2a')]({'where':{'id':_settings[_0x93f1('0x25')]}});}})['then'](function(_0x49eb8c){if(!_0x49eb8c){throw new db['Sequelize'][(_0x93f1('0x22'))](_0x93f1('0x37'));}if(!_0x49eb8c[_0x93f1('0xc')]||!_0x49eb8c[_0x93f1('0xd')]){throw new db['Sequelize'][(_0x93f1('0x22'))](_0x93f1('0x38'));}_0x4080a8=_0x49eb8c;logger[_0x93f1('0x9')](util[_0x93f1('0x10')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x1f9058['id']));return sentiment(_0x4080a8['data1'],_0x4080a8[_0x93f1('0xd')],_0x3348ab[_0x93f1('0x26')],_0x1f9058['fileText'],_0x3348ab[_0x93f1('0x2c')]);})[_0x93f1('0xf')](function(_0xdc15ae){logger[_0x93f1('0x9')](util[_0x93f1('0x10')](_0x93f1('0x39'),_0x1f9058['id']));return _0x1f9058[_0x93f1('0x1e')]({'sentiment':_0xdc15ae[_0x93f1('0x2d')],'sPositive':_0xdc15ae['SentimentScore'][_0x93f1('0x2f')],'sNegative':_0xdc15ae['SentimentScore']['Negative'],'sMixed':_0xdc15ae[_0x93f1('0x2e')][_0x93f1('0x30')],'sNeutral':_0xdc15ae[_0x93f1('0x2e')][_0x93f1('0x31')],'transcribeStatus':_0x93f1('0x15')});})['then'](function(){logger[_0x93f1('0x9')](util[_0x93f1('0x10')](_0x93f1('0x1f'),_0x1f9058['id']));_0x455ca5();});}})[_0x93f1('0x3a')](function(_0x102d72){if(_0x102d72){if(!_0x102d72[_0x93f1('0x3b')]||_0x102d72['name']!==_0x93f1('0x3c')){logger['error'](util[_0x93f1('0x10')]('[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis',_0x1f9058['id']),util[_0x93f1('0x3d')](_0x102d72,{'showHidden':![],'depth':null}));}}_0x455ca5();});});}function checkTranscribe(){var _0x644865;var _0x561537;var _0x36095d;return db[_0x93f1('0x3e')][_0x93f1('0x3f')]({'where':{'transcribeStatus':_0x93f1('0x40')}})['then'](function(_0x5620a3){if(!_0x5620a3||!_0x5620a3[_0x93f1('0x1c')]){throw new db[(_0x93f1('0x21'))]['ValidationError'](_0x93f1('0x41'));}_0x644865=_0x5620a3;return db[_0x93f1('0x42')]['findOne']({'where':{'id':0x1}});})[_0x93f1('0xf')](function(_0x1e6fb3){if(!_0x1e6fb3){throw new db[(_0x93f1('0x21'))][(_0x93f1('0x22'))]('Settings\x20not\x20available');}_0x561537=_0x1e6fb3;if(!_0x561537[_0x93f1('0x3')]||!_0x561537[_0x93f1('0x43')]||!_0x561537[_0x93f1('0xe')]||!_0x561537[_0x93f1('0x2c')]||!_0x561537[_0x93f1('0x27')]){throw new db[(_0x93f1('0x21'))][(_0x93f1('0x22'))](_0x93f1('0x44'));}return db[_0x93f1('0x36')][_0x93f1('0x2a')]({'where':{'id':_0x561537[_0x93f1('0x43')]}});})[_0x93f1('0xf')](function(_0x57ba35){if(!_0x57ba35){throw new db[(_0x93f1('0x21'))]['ValidationError'](_0x93f1('0x37'));}if(!_0x57ba35[_0x93f1('0xc')]||!_0x57ba35[_0x93f1('0xd')]){throw new db[(_0x93f1('0x21'))][(_0x93f1('0x22'))](_0x93f1('0x38'));}_0x36095d=_0x57ba35;var _0x444bee=[];_0x644865['forEach'](function(_0x30d5ad){_0x444bee['push'](checkTranscribeJob(_0x30d5ad,_0x561537,_0x36095d));});return BPromise[_0x93f1('0x45')](_0x444bee);})['catch'](function(_0x1bf771){if(_0x1bf771){if(!_0x1bf771[_0x93f1('0x3b')]||_0x1bf771[_0x93f1('0x3b')]!==_0x93f1('0x3c')){logger[_0x93f1('0x46')](util[_0x93f1('0x3d')](_0x1bf771,{'showHidden':![],'depth':null}));}}});}exports[_0x93f1('0x47')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();};
\ No newline at end of file
+var _0x5a1c=['Neutral','FAILED','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','Sentiment\x20Analysis\x20not\x20requested','findOne','sentimentAccountId','Cloud\x20Provider\x20not\x20available','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','Mixed','catch','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','findAll','No\x20transcribe\x20job\x20to\x20check','Setting','forEach','push','all','start','lodash','aws-sdk','bluebird','../../config/logger','transcribe','TranscribeService','getTranscriptionJob','Comprehend','detectSentiment','info','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','data1','data2','transcribeRegion','transcribeName','then','format','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','fileText','COMPLETED','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','results','transcripts','length','transcript','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','Sequelize','ValidationError','sentiment','sentimentRegion','bucket','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','CloudProvider','Cloud\x20Provider\x20not\x20configured','language','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','SentimentScore','Positive','Negative'];(function(_0x3018a9,_0xbb3d81){var _0x357d4d=function(_0x592f7d){while(--_0x592f7d){_0x3018a9['push'](_0x3018a9['shift']());}};_0x357d4d(++_0xbb3d81);}(_0x5a1c,0x1b5));var _0xc5a1=function(_0x23b57,_0x5b7329){_0x23b57=_0x23b57-0x0;var _0x180823=_0x5a1c[_0x23b57];return _0x180823;};var _=require(_0xc5a1('0x0'));var AWS=require(_0xc5a1('0x1'));var rp=require('request-promise');var util=require('util');var BPromise=require(_0xc5a1('0x2'));var db=require('../../mysqldb')['db'];var logger=require(_0xc5a1('0x3'))(_0xc5a1('0x4'));function getTranscriptionJob(_0x71fc1,_0x5c3f2d,_0x57b342,_0x429a68){return new Promise(function(_0x3d356e,_0x1ed54a){var _0x5782b9=new AWS[(_0xc5a1('0x5'))]({'accessKeyId':_0x5c3f2d,'secretAccessKey':_0x71fc1,'region':_0x57b342});_0x5782b9[_0xc5a1('0x6')]({'TranscriptionJobName':_0x429a68},function(_0x1ce1df,_0x111921){if(_0x1ce1df){return _0x1ed54a(_0x1ce1df);}else{return _0x3d356e(_0x111921);}});});}function sentiment(_0x42b181,_0x54a2de,_0x28234b,_0x45c8b8,_0x2fb166){return new Promise(function(_0x364ef4,_0x363a3e){var _0x501d85=new AWS[(_0xc5a1('0x7'))]({'accessKeyId':_0x54a2de,'secretAccessKey':_0x42b181,'region':_0x28234b});_0x501d85[_0xc5a1('0x8')]({'Text':_0x45c8b8,'LanguageCode':_0x2fb166['substring'](0x0,0x2)},function(_0x5bac8b,_0xb6fe3b){if(_0x5bac8b){return _0x363a3e(_0x5bac8b);}else{return _0x364ef4(_0xb6fe3b);}});});}function checkTranscribeJob(_0x514744,_0x17d063,_0x5f2534){var _0x37b863;return new BPromise(function(_0x3fafdc,_0x4f4b59){logger[_0xc5a1('0x9')](util['format'](_0xc5a1('0xa'),_0x514744['id'],_0x514744['transcribeName']));return getTranscriptionJob(_0x5f2534[_0xc5a1('0xb')],_0x5f2534[_0xc5a1('0xc')],_0x17d063[_0xc5a1('0xd')],_0x514744[_0xc5a1('0xe')])[_0xc5a1('0xf')](function(_0x5af680){logger[_0xc5a1('0x9')](util[_0xc5a1('0x10')](_0xc5a1('0x11'),_0x514744['id'],_0x514744[_0xc5a1('0xe')],_0x5af680[_0xc5a1('0x12')][_0xc5a1('0x13')]));if(!_0x514744[_0xc5a1('0x14')]){switch(_0x5af680['TranscriptionJob'][_0xc5a1('0x13')]){case _0xc5a1('0x15'):var _0x3b7e90={'transcribeStatus':_0x5af680[_0xc5a1('0x12')]['TranscriptionJobStatus'],'fileUri':_0x5af680[_0xc5a1('0x12')][_0xc5a1('0x16')][_0xc5a1('0x17')]};logger[_0xc5a1('0x9')](util[_0xc5a1('0x10')](_0xc5a1('0x18'),_0x514744['id']));return rp({'uri':_0x5af680[_0xc5a1('0x12')][_0xc5a1('0x16')]['TranscriptFileUri'],'json':!![]})[_0xc5a1('0xf')](function(_0x578788){logger[_0xc5a1('0x9')](util[_0xc5a1('0x10')]('[RECORDING:%d]\x20Transcript\x20downloaded',_0x514744['id']));if(_0x578788&&_0x578788[_0xc5a1('0x19')]&&_0x578788[_0xc5a1('0x19')]['transcripts']&&_0x578788['results'][_0xc5a1('0x1a')][_0xc5a1('0x1b')]){_0x3b7e90['fileText']='';for(var _0x9168e2=0x0;_0x9168e2<_0x578788['results'][_0xc5a1('0x1a')][_0xc5a1('0x1b')];_0x9168e2++){_0x3b7e90[_0xc5a1('0x14')]+=_0x578788[_0xc5a1('0x19')][_0xc5a1('0x1a')][_0x9168e2][_0xc5a1('0x1c')]+'';}}return _0x514744[_0xc5a1('0x1d')](_0x3b7e90);})[_0xc5a1('0xf')](function(){logger[_0xc5a1('0x9')](util[_0xc5a1('0x10')](_0xc5a1('0x1e'),_0x514744['id']));if(!_0x514744['tempSentiment']){throw new db[(_0xc5a1('0x1f'))][(_0xc5a1('0x20'))]('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x17d063[_0xc5a1('0x21')]||!_0x17d063['sentimentAccountId']||!_0x17d063[_0xc5a1('0x22')]||!_0x17d063['language']||!_0x17d063[_0xc5a1('0x23')]){throw new db[(_0xc5a1('0x1f'))][(_0xc5a1('0x20'))](_0xc5a1('0x24'));}if(!_0x3b7e90[_0xc5a1('0x14')]){throw new Error(_0xc5a1('0x25'));}if(_0x17d063['sentimentAccountId']===_0x5f2534['id']){return _0x5f2534;}else{return db[_0xc5a1('0x26')]['findOne']({'where':{'id':_settings['sentimentAccountId']}});}})[_0xc5a1('0xf')](function(_0x2ec457){if(!_0x2ec457){throw new db[(_0xc5a1('0x1f'))][(_0xc5a1('0x20'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x2ec457[_0xc5a1('0xb')]||!_0x2ec457['data2']){throw new db[(_0xc5a1('0x1f'))]['ValidationError'](_0xc5a1('0x27'));}_0x37b863=_0x2ec457;logger[_0xc5a1('0x9')](util[_0xc5a1('0x10')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x514744['id']));return sentiment(_0x37b863[_0xc5a1('0xb')],_0x37b863[_0xc5a1('0xc')],_0x17d063[_0xc5a1('0x22')],_0x3b7e90['fileText'],_0x17d063[_0xc5a1('0x28')]);})['then'](function(_0x2d4d56){logger['info'](util[_0xc5a1('0x10')](_0xc5a1('0x29'),_0x514744['id']));return _0x514744[_0xc5a1('0x1d')]({'sentiment':_0x2d4d56[_0xc5a1('0x2a')],'sPositive':_0x2d4d56[_0xc5a1('0x2b')][_0xc5a1('0x2c')],'sNegative':_0x2d4d56[_0xc5a1('0x2b')][_0xc5a1('0x2d')],'sMixed':_0x2d4d56['SentimentScore']['Mixed'],'sNeutral':_0x2d4d56[_0xc5a1('0x2b')][_0xc5a1('0x2e')]});})[_0xc5a1('0xf')](function(){logger[_0xc5a1('0x9')](util['format'](_0xc5a1('0x1e'),_0x514744['id']));_0x3fafdc();});case _0xc5a1('0x2f'):return _0x514744[_0xc5a1('0x1d')]({'transcribeStatus':_0xc5a1('0x2f'),'failureReason':_0x5af680['TranscriptionJob']['FailureReason']})[_0xc5a1('0xf')](function(){logger['info'](util['format'](_0xc5a1('0x1e'),_0x514744['id']));_0x3fafdc();});default:logger[_0xc5a1('0x9')](util[_0xc5a1('0x10')](_0xc5a1('0x30'),_0x514744['id']));break;}}else{return BPromise[_0xc5a1('0x31')]()[_0xc5a1('0xf')](function(){if(!_0x514744['tempSentiment']){throw new db[(_0xc5a1('0x1f'))][(_0xc5a1('0x20'))](_0xc5a1('0x32'));}if(!_0x17d063[_0xc5a1('0x21')]||!_0x17d063['sentimentAccountId']||!_0x17d063['sentimentRegion']||!_0x17d063[_0xc5a1('0x28')]||!_0x17d063[_0xc5a1('0x23')]){throw new db[(_0xc5a1('0x1f'))][(_0xc5a1('0x20'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x514744['fileText']){throw new Error(_0xc5a1('0x25'));}if(_0x17d063['sentimentAccountId']===_0x5f2534['id']){return _0x5f2534;}else{return db[_0xc5a1('0x26')][_0xc5a1('0x33')]({'where':{'id':_settings[_0xc5a1('0x34')]}});}})['then'](function(_0x5cd707){if(!_0x5cd707){throw new db[(_0xc5a1('0x1f'))][(_0xc5a1('0x20'))](_0xc5a1('0x35'));}if(!_0x5cd707[_0xc5a1('0xb')]||!_0x5cd707[_0xc5a1('0xc')]){throw new db[(_0xc5a1('0x1f'))][(_0xc5a1('0x20'))](_0xc5a1('0x27'));}_0x37b863=_0x5cd707;logger[_0xc5a1('0x9')](util[_0xc5a1('0x10')](_0xc5a1('0x36'),_0x514744['id']));return sentiment(_0x37b863[_0xc5a1('0xb')],_0x37b863['data2'],_0x17d063['sentimentRegion'],_0x514744[_0xc5a1('0x14')],_0x17d063[_0xc5a1('0x28')]);})['then'](function(_0xb0fa81){logger['info'](util['format'](_0xc5a1('0x29'),_0x514744['id']));return _0x514744[_0xc5a1('0x1d')]({'sentiment':_0xb0fa81[_0xc5a1('0x2a')],'sPositive':_0xb0fa81[_0xc5a1('0x2b')][_0xc5a1('0x2c')],'sNegative':_0xb0fa81['SentimentScore'][_0xc5a1('0x2d')],'sMixed':_0xb0fa81[_0xc5a1('0x2b')][_0xc5a1('0x37')],'sNeutral':_0xb0fa81[_0xc5a1('0x2b')][_0xc5a1('0x2e')],'transcribeStatus':_0xc5a1('0x15')});})[_0xc5a1('0xf')](function(){logger['info'](util[_0xc5a1('0x10')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x514744['id']));_0x3fafdc();});}})[_0xc5a1('0x38')](function(_0x207524){if(_0x207524){if(!_0x207524[_0xc5a1('0x39')]||_0x207524[_0xc5a1('0x39')]!==_0xc5a1('0x3a')){logger[_0xc5a1('0x3b')](util[_0xc5a1('0x10')](_0xc5a1('0x3c'),_0x514744['id']),util[_0xc5a1('0x3d')](_0x207524,{'showHidden':![],'depth':null}));}}_0x3fafdc();});});}function checkTranscribe(){var _0x12e97f;var _0xc98bde;var _0x57e111;return db['VoiceRecording'][_0xc5a1('0x3e')]({'where':{'transcribeStatus':'IN_PROGRESS'}})['then'](function(_0xfe4a4f){if(!_0xfe4a4f||!_0xfe4a4f[_0xc5a1('0x1b')]){throw new db[(_0xc5a1('0x1f'))][(_0xc5a1('0x20'))](_0xc5a1('0x3f'));}_0x12e97f=_0xfe4a4f;return db[_0xc5a1('0x40')][_0xc5a1('0x33')]({'where':{'id':0x1}});})[_0xc5a1('0xf')](function(_0x3e74af){if(!_0x3e74af){throw new db['Sequelize'][(_0xc5a1('0x20'))]('Settings\x20not\x20available');}_0xc98bde=_0x3e74af;if(!_0xc98bde[_0xc5a1('0x4')]||!_0xc98bde['transcribeAccountId']||!_0xc98bde['transcribeRegion']||!_0xc98bde[_0xc5a1('0x28')]||!_0xc98bde[_0xc5a1('0x23')]){throw new db[(_0xc5a1('0x1f'))][(_0xc5a1('0x20'))]('Transcribe\x20not\x20configured');}return db['CloudProvider'][_0xc5a1('0x33')]({'where':{'id':_0xc98bde['transcribeAccountId']}});})[_0xc5a1('0xf')](function(_0x55f332){if(!_0x55f332){throw new db['Sequelize'][(_0xc5a1('0x20'))](_0xc5a1('0x35'));}if(!_0x55f332['data1']||!_0x55f332[_0xc5a1('0xc')]){throw new db[(_0xc5a1('0x1f'))]['ValidationError'](_0xc5a1('0x27'));}_0x57e111=_0x55f332;var _0x2e93e5=[];_0x12e97f[_0xc5a1('0x41')](function(_0x6ce549){_0x2e93e5[_0xc5a1('0x42')](checkTranscribeJob(_0x6ce549,_0xc98bde,_0x57e111));});return BPromise[_0xc5a1('0x43')](_0x2e93e5);})[_0xc5a1('0x38')](function(_0x10dc18){if(_0x10dc18){if(!_0x10dc18[_0xc5a1('0x39')]||_0x10dc18[_0xc5a1('0x39')]!==_0xc5a1('0x3a')){logger[_0xc5a1('0x3b')](util[_0xc5a1('0x3d')](_0x10dc18,{'showHidden':![],'depth':null}));}}});}exports[_0xc5a1('0x44')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();};
\ No newline at end of file
index 1e69aa3..f6e42c7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5e60=['map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','join','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','whatsappInteraction:update','catch','error','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','start','moment','ioredis','util','../../mysqldb','schedule','defaults','localhost','WhatsappInteraction','findAll','lastMsgAt','subtract','then','length'];(function(_0x6e0735,_0x55ab00){var _0x2c5973=function(_0x3905bd){while(--_0x3905bd){_0x6e0735['push'](_0x6e0735['shift']());}};_0x2c5973(++_0x55ab00);}(_0x5e60,0x179));var _0x05e6=function(_0x379de0,_0x46cc59){_0x379de0=_0x379de0-0x0;var _0x34b287=_0x5e60[_0x379de0];return _0x34b287;};'use strict';var _=require('lodash');var moment=require(_0x05e6('0x0'));var Redis=require(_0x05e6('0x1'));var util=require(_0x05e6('0x2'));var config=require('../../config/environment');var db=require(_0x05e6('0x3'))['db'];var logger=require('../logger')(_0x05e6('0x4'));config['redis']=_[_0x05e6('0x5')](config['redis'],{'host':_0x05e6('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function closeInteractions(){var _0x59ac5e=[];return db[_0x05e6('0x7')][_0x05e6('0x8')]({'raw':!![],'attributes':['id',_0x05e6('0x9')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x05e6('0xa')](0x18,'hours')}}})[_0x05e6('0xb')](function(_0x140e91){if(_0x140e91&&_0x140e91[_0x05e6('0xc')]){_0x59ac5e=_[_0x05e6('0xd')](_0x140e91||[],'id');logger[_0x05e6('0xe')](_0x05e6('0xf'),_0x59ac5e[_0x05e6('0x10')]());return db[_0x05e6('0x7')][_0x05e6('0x11')]({'closeReason':_0x05e6('0x12'),'disposition':_0x05e6('0x13'),'closed':!![],'closedAt':moment()[_0x05e6('0x14')](_0x05e6('0x15'))},{'where':{'id':_0x59ac5e}});}})[_0x05e6('0xb')](function(){if(_0x59ac5e&&_0x59ac5e[_0x05e6('0xc')]){logger[_0x05e6('0xe')](_0x05e6('0x16'),_0x59ac5e['join']());for(var _0x4bf777=0x0;_0x4bf777<_0x59ac5e[_0x05e6('0xc')];_0x4bf777++){io[_0x05e6('0x17')](_0x05e6('0x18'),{'id':_0x59ac5e[_0x4bf777],'closed':!![]});}}})[_0x05e6('0x19')](function(_0x21eb0a){logger[_0x05e6('0x1a')](_0x05e6('0x1b'),_0x21eb0a?util[_0x05e6('0x1c')](_0x21eb0a,{'showHidden':![],'depth':null}):'');});}exports[_0x05e6('0x1d')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();};
\ No newline at end of file
+var _0xab9c=['util','../../config/environment','../../mysqldb','../logger','schedule','redis','defaults','localhost','socket.io-emitter','WhatsappInteraction','findAll','lastMsgAt','hours','then','length','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','join','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','whatsappInteraction:update','catch','error','[WHATSAPP]\x20Error\x20closing\x20interactions','moment','ioredis'];(function(_0x162167,_0x52203f){var _0x13fda6=function(_0x47848e){while(--_0x47848e){_0x162167['push'](_0x162167['shift']());}};_0x13fda6(++_0x52203f);}(_0xab9c,0xd0));var _0xcab9=function(_0x339b8d,_0x585742){_0x339b8d=_0x339b8d-0x0;var _0x41b9ab=_0xab9c[_0x339b8d];return _0x41b9ab;};'use strict';var _=require('lodash');var moment=require(_0xcab9('0x0'));var Redis=require(_0xcab9('0x1'));var util=require(_0xcab9('0x2'));var config=require(_0xcab9('0x3'));var db=require(_0xcab9('0x4'))['db'];var logger=require(_0xcab9('0x5'))(_0xcab9('0x6'));config[_0xcab9('0x7')]=_[_0xcab9('0x8')](config['redis'],{'host':_0xcab9('0x9'),'port':0x18eb});var io=require(_0xcab9('0xa'))(new Redis(config[_0xcab9('0x7')]));function closeInteractions(){var _0x4ecd1b=[];return db[_0xcab9('0xb')][_0xcab9('0xc')]({'raw':!![],'attributes':['id',_0xcab9('0xd')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()['subtract'](0x18,_0xcab9('0xe'))}}})[_0xcab9('0xf')](function(_0x225d42){if(_0x225d42&&_0x225d42[_0xcab9('0x10')]){_0x4ecd1b=_[_0xcab9('0x11')](_0x225d42||[],'id');logger[_0xcab9('0x12')](_0xcab9('0x13'),_0x4ecd1b[_0xcab9('0x14')]());return db[_0xcab9('0xb')][_0xcab9('0x15')]({'closeReason':_0xcab9('0x16'),'disposition':_0xcab9('0x17'),'closed':!![],'closedAt':moment()[_0xcab9('0x18')](_0xcab9('0x19'))},{'where':{'id':_0x4ecd1b}});}})[_0xcab9('0xf')](function(){if(_0x4ecd1b&&_0x4ecd1b[_0xcab9('0x10')]){logger[_0xcab9('0x12')]('[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:',_0x4ecd1b[_0xcab9('0x14')]());for(var _0x45b091=0x0;_0x45b091<_0x4ecd1b[_0xcab9('0x10')];_0x45b091++){io['emit'](_0xcab9('0x1a'),{'id':_0x4ecd1b[_0x45b091],'closed':!![]});}}})[_0xcab9('0x1b')](function(_0xaae9a4){logger[_0xcab9('0x1c')](_0xcab9('0x1d'),_0xaae9a4?util['inspect'](_0xaae9a4,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();};
\ No newline at end of file
index 7d2d2ef..d093690 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2f8d=['innocenzo.biondo','@xcally.com','now','destroy','then','CmContact','bulkCreate','log','finished\x20populating','CmHopper','hopper2','catch','util','../mysqldb','push','Innocenzo','Biondo'];(function(_0x5096c9,_0x5581fd){var _0xfcf62=function(_0x40d1b6){while(--_0x40d1b6){_0x5096c9['push'](_0x5096c9['shift']());}};_0xfcf62(++_0x5581fd);}(_0x2f8d,0x94));var _0xd2f8=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0x2f8d[_0xc6be3a];return _0x56a310;};'use strict';var util=require(_0xd2f8('0x0'));var db=require(_0xd2f8('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0xd2f8('0x2')]({'id':i,'firstName':_0xd2f8('0x3')+i,'lastName':_0xd2f8('0x4')+i,'phone':0xf879fb460+i,'email':_0xd2f8('0x5')+i+_0xd2f8('0x6')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0xd2f8('0x2')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xd2f8('0x7')](),'updatedAt':Date[_0xd2f8('0x7')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0xd2f8('0x2')]({'id':i,'firstName':_0xd2f8('0x3')+i,'lastName':_0xd2f8('0x4')+i,'phone':0xf879fb460+i,'email':_0xd2f8('0x5')+i+'@xcally.com'});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0xd2f8('0x2')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xd2f8('0x7')](),'updatedAt':Date[_0xd2f8('0x7')]()});}db['CmContact'][_0xd2f8('0x8')]({'where':{}})[_0xd2f8('0x9')](function(){return db[_0xd2f8('0xa')][_0xd2f8('0xb')](contacts);})[_0xd2f8('0x9')](function(){console[_0xd2f8('0xc')](_0xd2f8('0xd'),'contacts1');return db[_0xd2f8('0xe')]['destroy']({'where':{}});})[_0xd2f8('0x9')](function(){return db[_0xd2f8('0xe')]['bulkCreate'](hopper);})['then'](function(){console[_0xd2f8('0xc')](_0xd2f8('0xd'),'hopper1');return db[_0xd2f8('0xa')][_0xd2f8('0xb')](contacts2);})['then'](function(){console[_0xd2f8('0xc')](_0xd2f8('0xd'),'contacts2');return db[_0xd2f8('0xe')]['bulkCreate'](hopper2);})['then'](function(){console['log'](_0xd2f8('0xd'),_0xd2f8('0xf'));})[_0xd2f8('0x10')](function(_0x4dde70){console[_0xd2f8('0xc')](_0x4dde70);});
\ No newline at end of file
+var _0xe7c6=['catch','util','../mysqldb','Innocenzo','Biondo','innocenzo.biondo','@xcally.com','push','now','destroy','then','log','finished\x20populating','CmHopper','bulkCreate','CmContact','hopper2'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xe7c6,0x177));var _0x6e7c=function(_0x1c2062,_0x2d3964){_0x1c2062=_0x1c2062-0x0;var _0x29de73=_0xe7c6[_0x1c2062];return _0x29de73;};'use strict';var util=require(_0x6e7c('0x0'));var db=require(_0x6e7c('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts['push']({'id':i,'firstName':_0x6e7c('0x2')+i,'lastName':_0x6e7c('0x3')+i,'phone':0xf879fb460+i,'email':_0x6e7c('0x4')+i+_0x6e7c('0x5')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x6e7c('0x6')]({'id':i,'active':![],'scheduledat':Date[_0x6e7c('0x7')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x6e7c('0x7')](),'updatedAt':Date[_0x6e7c('0x7')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2['push']({'id':i,'firstName':_0x6e7c('0x2')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0x6e7c('0x5')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2['push']({'id':i,'active':![],'scheduledat':Date[_0x6e7c('0x7')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x6e7c('0x7')](),'updatedAt':Date[_0x6e7c('0x7')]()});}db['CmContact'][_0x6e7c('0x8')]({'where':{}})[_0x6e7c('0x9')](function(){return db['CmContact']['bulkCreate'](contacts);})['then'](function(){console[_0x6e7c('0xa')](_0x6e7c('0xb'),'contacts1');return db[_0x6e7c('0xc')][_0x6e7c('0x8')]({'where':{}});})[_0x6e7c('0x9')](function(){return db['CmHopper'][_0x6e7c('0xd')](hopper);})[_0x6e7c('0x9')](function(){console[_0x6e7c('0xa')]('finished\x20populating','hopper1');return db[_0x6e7c('0xe')][_0x6e7c('0xd')](contacts2);})['then'](function(){console[_0x6e7c('0xa')]('finished\x20populating','contacts2');return db[_0x6e7c('0xc')][_0x6e7c('0xd')](hopper2);})[_0x6e7c('0x9')](function(){console[_0x6e7c('0xa')](_0x6e7c('0xb'),_0x6e7c('0xf'));})[_0x6e7c('0x10')](function(_0x4cd28c){console[_0x6e7c('0xa')](_0x4cd28c);});
\ No newline at end of file
index c8daf05..edc167d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x109e=['/etc/pki/tls/private/motion.key','actpass','\x22%s\x22\x20<%s>','User','then','log','add\x20user','catch','util','../mysqldb','push','format','%s%s','agent','%s%s@xcally.com','password','friend','wss','all','yes'];(function(_0x475fc2,_0x2db53c){var _0x1f8c55=function(_0x102791){while(--_0x102791){_0x475fc2['push'](_0x475fc2['shift']());}};_0x1f8c55(++_0x2db53c);}(_0x109e,0xbc));var _0xe109=function(_0xbc5974,_0x272e2c){_0xbc5974=_0xbc5974-0x0;var _0x2f5b3a=_0x109e[_0xbc5974];return _0x2f5b3a;};'use strict';var util=require(_0xe109('0x0'));var db=require(_0xe109('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0xe109('0x2')]({'name':util[_0xe109('0x3')](_0xe109('0x4'),_0xe109('0x5'),i),'fullname':util[_0xe109('0x3')](_0xe109('0x4'),_0xe109('0x5'),i),'email':util[_0xe109('0x3')](_0xe109('0x6'),'agent',i),'role':_0xe109('0x5'),'password':_0xe109('0x7'),'internal':0xfa0+i,'type':_0xe109('0x8'),'transport':['udp','ws',_0xe109('0x9')],'disallow':[_0xe109('0xa')],'allow':['ulaw'],'defaultuser':util[_0xe109('0x3')](_0xe109('0x4'),_0xe109('0x5'),i),'encryption':_0xe109('0xb'),'avpf':'yes','force_avp':_0xe109('0xb'),'icesupport':_0xe109('0xb'),'dtlsenable':'yes','dtlsverify':'no','dtlscertfile':'/etc/pki/tls/certs/motion.crt','dtlsprivatekey':_0xe109('0xc'),'dtlssetup':_0xe109('0xd'),'callerid':util[_0xe109('0x3')](_0xe109('0xe'),util[_0xe109('0x3')](_0xe109('0x4'),_0xe109('0x5'),i),0xfa0+i)});}db[_0xe109('0xf')]['bulkCreate'](users)[_0xe109('0x10')](function(){console[_0xe109('0x11')](_0xe109('0x12'));})[_0xe109('0x13')](function(_0x49c101){console[_0xe109('0x11')](_0x49c101);});
\ No newline at end of file
+var _0xca8e=['format','%s%s','agent','password','udp','ulaw','yes','actpass','\x22%s\x22\x20<%s>','User','bulkCreate','then','log','catch','push'];(function(_0x440d49,_0x4d456d){var _0x55bc4f=function(_0x63c17){while(--_0x63c17){_0x440d49['push'](_0x440d49['shift']());}};_0x55bc4f(++_0x4d456d);}(_0xca8e,0x149));var _0xeca8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xca8e[_0x3dd15e];return _0x231fd0;};'use strict';var util=require('util');var db=require('../mysqldb')['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0xeca8('0x0')]({'name':util[_0xeca8('0x1')](_0xeca8('0x2'),'agent',i),'fullname':util[_0xeca8('0x1')](_0xeca8('0x2'),_0xeca8('0x3'),i),'email':util['format']('%s%s@xcally.com','agent',i),'role':_0xeca8('0x3'),'password':_0xeca8('0x4'),'internal':0xfa0+i,'type':'friend','transport':[_0xeca8('0x5'),'ws','wss'],'disallow':['all'],'allow':[_0xeca8('0x6')],'defaultuser':util[_0xeca8('0x1')](_0xeca8('0x2'),'agent',i),'encryption':_0xeca8('0x7'),'avpf':_0xeca8('0x7'),'force_avp':'yes','icesupport':'yes','dtlsenable':'yes','dtlsverify':'no','dtlscertfile':'/etc/pki/tls/certs/motion.crt','dtlsprivatekey':'/etc/pki/tls/private/motion.key','dtlssetup':_0xeca8('0x8'),'callerid':util[_0xeca8('0x1')](_0xeca8('0x9'),util[_0xeca8('0x1')](_0xeca8('0x2'),_0xeca8('0x3'),i),0xfa0+i)});}db[_0xeca8('0xa')][_0xeca8('0xb')](users)[_0xeca8('0xc')](function(){console[_0xeca8('0xd')]('add\x20user');})[_0xeca8('0xe')](function(_0x3b3a76){console['log'](_0x3b3a76);});
\ No newline at end of file
index ae1e075..5fa619c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa4a9=['removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','log','join','default','connection','setMaxListeners','remoteAddress','request','remotePort','connectedAt','SocketIO\x20','nsp','address','disconnect','DISCONNECTED','CONNECTED','util','bluebird','../mysqldb','./environment','Agents','name','role','agent','type','ivr','UserProfileSection','findOne','autoAssociation','FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','WhatsappQueues','findAll','Telephones','Trunks','IvrCampaigns','resourceId','then','map','User','telephone','where','%s:queue:%s','length','format','user:%s','handshake','query','find','userProfileId','ChatInteraction','MailInteraction','MailInteractions','FaxInteraction','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','admin','voice:inbound','voice:outbound','hasOwnProperty','include','push','VoiceQueue','ChatQueue','FaxQueue','SmsQueue','MailQueue','WhatsappQueue','Campaign','VoiceQueues','Trunk','getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues','getMailQueues','getWhatsappQueues','all','voice','chat','sms','openchannel','telephone:%s','trunk:%s','campaign:%s:%s','leave','ChatInteractions','removeChatInteractions','user_has_chat_interactions:remove','removeMailInteractions','emit','user_has_mail_interactions:remove','FaxInteractions','removeFaxInteractions','user_has_fax_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions'];(function(_0x1cc40b,_0x199abd){var _0x2488fd=function(_0x315a61){while(--_0x315a61){_0x1cc40b['push'](_0x1cc40b['shift']());}};_0x2488fd(++_0x199abd);}(_0xa4a9,0x7a));var _0x9a4a=function(_0x2f8c05,_0x551e3d){_0x2f8c05=_0x2f8c05-0x0;var _0x14cfde=_0xa4a9[_0x2f8c05];return _0x14cfde;};'use strict';var _=require('lodash');var util=require(_0x9a4a('0x0'));var BPromise=require(_0x9a4a('0x1'));var db=require(_0x9a4a('0x2'))['db'];var config=require(_0x9a4a('0x3'));var queryQueues={'attributes':['id','name'],'include':[{'as':_0x9a4a('0x4'),'model':db['User'],'attributes':['id',_0x9a4a('0x5'),_0x9a4a('0x6')],'raw':!![],'where':{'role':_0x9a4a('0x7')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x9a4a('0x5')],'where':{'role':'telephone'}};var queryTrunks={'raw':!![],'attributes':['id',_0x9a4a('0x5')]};var queryAgents={'raw':!![],'attributes':['id','name'],'where':{'role':_0x9a4a('0x7')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x9a4a('0x5'),_0x9a4a('0x8')],'where':{'type':_0x9a4a('0x9')}};function getAssociatedResources(_0x2976d6,_0x22d9d0,_0x294af8){return db[_0x9a4a('0xa')][_0x9a4a('0xb')]({'where':{'name':_0x2976d6,'userProfileId':_0x22d9d0},'raw':!![]})['then'](function(_0x222a44){if(_0x222a44){if(_0x222a44[_0x9a4a('0xc')]){switch(_0x2976d6){case'VoiceQueues':case'ChatQueues':case _0x9a4a('0xd'):case _0x9a4a('0xe'):case _0x9a4a('0xf'):case _0x9a4a('0x10'):case _0x9a4a('0x11'):return db[_0x294af8][_0x9a4a('0x12')](queryQueues);case _0x9a4a('0x13'):return db[_0x294af8][_0x9a4a('0x12')](queryTelephones);case _0x9a4a('0x14'):return db[_0x294af8][_0x9a4a('0x12')](queryTrunks);case _0x9a4a('0x15'):return db[_0x294af8]['findAll'](queryCampaigns);}}else{return db['UserProfileResource'][_0x9a4a('0x12')]({'attributes':[_0x9a4a('0x16')],'where':{'sectionId':_0x222a44['id']},'raw':!![]})[_0x9a4a('0x17')](function(_0x1061b8){if(_0x1061b8){var _0x324284={'where':{'id':_[_0x9a4a('0x18')](_0x1061b8,_0x9a4a('0x16'))},'raw':!![]};switch(_0x294af8){case _0x9a4a('0x19'):_0x324284['where'][_0x9a4a('0x6')]=_0x9a4a('0x1a');break;case'Campaign':_0x324284[_0x9a4a('0x1b')][_0x9a4a('0x8')]=_0x9a4a('0x9');break;}return db[_0x294af8][_0x9a4a('0x12')](_0x324284);}else{return[];}});}}else{return[];}})['then'](function(_0x4f8c16){return _0x4f8c16;});}function joinOrLeaveQueues(_0xa6a265,_0x1fab42,_0x3703e2,_0x50b1bf){_0xa6a265[_0x1fab42](util['format'](_0x9a4a('0x1c'),_0x3703e2,_0x50b1bf[_0x9a4a('0x5')]));if(_0x50b1bf[_0x9a4a('0x4')]){for(var _0x261dc2=0x0;_0x261dc2<_0x50b1bf['Agents'][_0x9a4a('0x1d')];_0x261dc2+=0x1){_0xa6a265[_0x1fab42](util[_0x9a4a('0x1e')](_0x9a4a('0x1f'),_0x50b1bf[_0x9a4a('0x4')][_0x261dc2][_0x9a4a('0x5')]));}}}function joinOrLeave(_0x39d000,_0x100540,_0x5afe83){var _0x79e2f4;if(_0x39d000[_0x9a4a('0x20')][_0x9a4a('0x21')]['id']){db['User'][_0x9a4a('0x22')]({'attributes':['id',_0x9a4a('0x5'),_0x9a4a('0x6'),_0x9a4a('0x23')],'where':{'id':_0x39d000[_0x9a4a('0x20')][_0x9a4a('0x21')]['id']},'include':[{'model':db[_0x9a4a('0x24')],'as':'ChatInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x9a4a('0x25')],'as':_0x9a4a('0x26'),'attributes':['id'],'raw':!![]},{'model':db[_0x9a4a('0x27')],'as':'FaxInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x9a4a('0x28')],'as':_0x9a4a('0x29'),'attributes':['id'],'raw':!![]},{'model':db[_0x9a4a('0x2a')],'as':_0x9a4a('0x2b'),'attributes':['id'],'raw':!![]},{'model':db['WhatsappInteraction'],'as':'WhatsappInteractions','attributes':['id'],'raw':!![]}]})['then'](function(_0xfa6e89){if(_0xfa6e89){_0x79e2f4=_0xfa6e89;_0x39d000[_0x100540](util[_0x9a4a('0x1e')](_0x9a4a('0x1f'),_0xfa6e89[_0x9a4a('0x5')]));var _0x556e6a=[];switch(_0xfa6e89['role']){case _0x9a4a('0x2c'):_0x39d000[_0x100540](_0x9a4a('0x2d'));_0x39d000[_0x100540](_0x9a4a('0x2e'));if(queryQueues[_0x9a4a('0x2f')]('include')){delete queryQueues[_0x9a4a('0x30')];}_0x556e6a[_0x9a4a('0x31')](db[_0x9a4a('0x32')][_0x9a4a('0x12')](queryQueues));_0x556e6a['push'](db[_0x9a4a('0x33')][_0x9a4a('0x12')](queryQueues));_0x556e6a['push'](db[_0x9a4a('0x34')][_0x9a4a('0x12')](queryQueues));_0x556e6a[_0x9a4a('0x31')](db[_0x9a4a('0x35')]['findAll'](queryQueues));_0x556e6a['push'](db[_0x9a4a('0x36')][_0x9a4a('0x12')](queryQueues));_0x556e6a[_0x9a4a('0x31')](db['OpenchannelQueue'][_0x9a4a('0x12')](queryQueues));_0x556e6a['push'](db[_0x9a4a('0x37')]['findAll'](queryQueues));_0x556e6a[_0x9a4a('0x31')](db[_0x9a4a('0x19')][_0x9a4a('0x12')](queryTelephones));_0x556e6a[_0x9a4a('0x31')](db['Trunk']['findAll'](queryTrunks));_0x556e6a[_0x9a4a('0x31')](db[_0x9a4a('0x38')][_0x9a4a('0x12')](queryCampaigns));_0x556e6a[_0x9a4a('0x31')](db[_0x9a4a('0x19')]['findAll'](queryAgents));break;case'user':_0x39d000[_0x100540](_0x9a4a('0x2d'));_0x39d000[_0x100540]('voice:outbound');_0x556e6a[_0x9a4a('0x31')](getAssociatedResources(_0x9a4a('0x39'),_0xfa6e89[_0x9a4a('0x23')],'VoiceQueue'));_0x556e6a['push'](getAssociatedResources('ChatQueues',_0xfa6e89['userProfileId'],_0x9a4a('0x33')));_0x556e6a['push'](getAssociatedResources(_0x9a4a('0xd'),_0xfa6e89[_0x9a4a('0x23')],'FaxQueue'));_0x556e6a['push'](getAssociatedResources(_0x9a4a('0xe'),_0xfa6e89[_0x9a4a('0x23')],_0x9a4a('0x35')));_0x556e6a[_0x9a4a('0x31')](getAssociatedResources(_0x9a4a('0xf'),_0xfa6e89['userProfileId'],_0x9a4a('0x36')));_0x556e6a[_0x9a4a('0x31')](getAssociatedResources(_0x9a4a('0x10'),_0xfa6e89[_0x9a4a('0x23')],'OpenchannelQueue'));_0x556e6a[_0x9a4a('0x31')](getAssociatedResources(_0x9a4a('0x11'),_0xfa6e89[_0x9a4a('0x23')],'WhatsappQueue'));_0x556e6a['push'](getAssociatedResources(_0x9a4a('0x13'),_0xfa6e89[_0x9a4a('0x23')],_0x9a4a('0x19')));_0x556e6a['push'](getAssociatedResources(_0x9a4a('0x14'),_0xfa6e89[_0x9a4a('0x23')],_0x9a4a('0x3a')));_0x556e6a[_0x9a4a('0x31')](getAssociatedResources(_0x9a4a('0x15'),_0xfa6e89[_0x9a4a('0x23')],_0x9a4a('0x38')));_0x556e6a[_0x9a4a('0x31')](db['User']['findAll'](queryAgents));break;case _0x9a4a('0x7'):_0x39d000[_0x100540]('voice:inbound');_0x39d000[_0x100540](_0x9a4a('0x2e'));_0x556e6a['push'](_0xfa6e89[_0x9a4a('0x3b')]({'attributes':['id',_0x9a4a('0x5')]}));_0x556e6a['push'](_0xfa6e89[_0x9a4a('0x3c')]({'attributes':['id',_0x9a4a('0x5')]}));_0x556e6a[_0x9a4a('0x31')](_0xfa6e89[_0x9a4a('0x3d')]({'attributes':['id',_0x9a4a('0x5')]}));_0x556e6a[_0x9a4a('0x31')](_0xfa6e89[_0x9a4a('0x3e')]({'attributes':['id',_0x9a4a('0x5')]}));_0x556e6a[_0x9a4a('0x31')](_0xfa6e89[_0x9a4a('0x3f')]({'attributes':['id',_0x9a4a('0x5')]}));_0x556e6a[_0x9a4a('0x31')](_0xfa6e89['getOpenchannelQueues']({'attributes':['id',_0x9a4a('0x5')]}));_0x556e6a[_0x9a4a('0x31')](_0xfa6e89[_0x9a4a('0x40')]({'attributes':['id',_0x9a4a('0x5')]}));break;}return BPromise[_0x9a4a('0x41')](_0x556e6a);}})['then'](function(_0x37a62a){if(_0x37a62a&&_0x37a62a[_0x9a4a('0x1d')]){for(var _0x202821=0x0;_0x202821<_0x37a62a[_0x9a4a('0x1d')];_0x202821+=0x1){for(var _0x347da3=0x0;_0x347da3<_0x37a62a[_0x202821]['length'];_0x347da3+=0x1){switch(_0x202821){case 0x0:joinOrLeaveQueues(_0x39d000,_0x100540,_0x9a4a('0x42'),_0x37a62a[_0x202821][_0x347da3]);break;case 0x1:joinOrLeaveQueues(_0x39d000,_0x100540,_0x9a4a('0x43'),_0x37a62a[_0x202821][_0x347da3]);break;case 0x2:joinOrLeaveQueues(_0x39d000,_0x100540,'fax',_0x37a62a[_0x202821][_0x347da3]);break;case 0x3:joinOrLeaveQueues(_0x39d000,_0x100540,_0x9a4a('0x44'),_0x37a62a[_0x202821][_0x347da3]);break;case 0x4:joinOrLeaveQueues(_0x39d000,_0x100540,'mail',_0x37a62a[_0x202821][_0x347da3]);break;case 0x5:joinOrLeaveQueues(_0x39d000,_0x100540,_0x9a4a('0x45'),_0x37a62a[_0x202821][_0x347da3]);break;case 0x6:joinOrLeaveQueues(_0x39d000,_0x100540,'whatsapp',_0x37a62a[_0x202821][_0x347da3]);break;case 0x7:if(_0x79e2f4['role']!==_0x9a4a('0x7'))_0x39d000[_0x100540](util[_0x9a4a('0x1e')](_0x9a4a('0x46'),_0x37a62a[_0x202821][_0x347da3]['name']));break;case 0x8:if(_0x79e2f4[_0x9a4a('0x6')]!=='agent')_0x39d000[_0x100540](util['format'](_0x9a4a('0x47'),_0x37a62a[_0x202821][_0x347da3][_0x9a4a('0x5')]));break;case 0x9:if(_0x79e2f4[_0x9a4a('0x6')]!==_0x9a4a('0x7'))_0x39d000[_0x100540](util[_0x9a4a('0x1e')](_0x9a4a('0x48'),_0x37a62a[_0x202821][_0x347da3][_0x9a4a('0x8')],_0x37a62a[_0x202821][_0x347da3]['name']));break;case 0xa:_0x39d000[_0x100540](util[_0x9a4a('0x1e')](_0x9a4a('0x1f'),_0x37a62a[_0x202821][_0x347da3]['name']));break;}}}}})[_0x9a4a('0x17')](function(){if(_0x100540===_0x9a4a('0x49')){var _0x2965cd=_['map'](_0x79e2f4[_0x9a4a('0x4a')],'id');return _0x79e2f4[_0x9a4a('0x4b')](_0x2965cd)[_0x9a4a('0x17')](function(){for(var _0x44813c=0x0;_0x44813c<_0x2965cd[_0x9a4a('0x1d')];_0x44813c+=0x1){_0x5afe83['emit'](_0x9a4a('0x4c'),{'ChatInteractionId':Number(_0x2965cd[_0x44813c]),'UserId':Number(_0x79e2f4['id'])});}});}})[_0x9a4a('0x17')](function(){if(_0x100540==='leave'){var _0x55a148=_[_0x9a4a('0x18')](_0x79e2f4[_0x9a4a('0x26')],'id');return _0x79e2f4[_0x9a4a('0x4d')](_0x55a148)[_0x9a4a('0x17')](function(){for(var _0x8d27ad=0x0;_0x8d27ad<_0x55a148[_0x9a4a('0x1d')];_0x8d27ad+=0x1){_0x5afe83[_0x9a4a('0x4e')](_0x9a4a('0x4f'),{'MailInteractionId':Number(_0x55a148[_0x8d27ad]),'UserId':Number(_0x79e2f4['id'])});}});}})[_0x9a4a('0x17')](function(){if(_0x100540===_0x9a4a('0x49')){var _0x476d38=_[_0x9a4a('0x18')](_0x79e2f4[_0x9a4a('0x50')],'id');return _0x79e2f4[_0x9a4a('0x51')](_0x476d38)[_0x9a4a('0x17')](function(){for(var _0x3e97db=0x0;_0x3e97db<_0x476d38[_0x9a4a('0x1d')];_0x3e97db+=0x1){_0x5afe83[_0x9a4a('0x4e')](_0x9a4a('0x52'),{'FaxInteractionId':Number(_0x476d38[_0x3e97db]),'UserId':Number(_0x79e2f4['id'])});}});}})[_0x9a4a('0x17')](function(){if(_0x100540==='leave'){var _0x43fbf3=_[_0x9a4a('0x18')](_0x79e2f4[_0x9a4a('0x29')],'id');return _0x79e2f4[_0x9a4a('0x53')](_0x43fbf3)[_0x9a4a('0x17')](function(){for(var _0x260602=0x0;_0x260602<_0x43fbf3[_0x9a4a('0x1d')];_0x260602+=0x1){_0x5afe83[_0x9a4a('0x4e')](_0x9a4a('0x54'),{'SmsInteractionId':Number(_0x43fbf3[_0x260602]),'UserId':Number(_0x79e2f4['id'])});}});}})[_0x9a4a('0x17')](function(){if(_0x100540===_0x9a4a('0x49')){var _0x5c684d=_[_0x9a4a('0x18')](_0x79e2f4['OpenchannelInteractions'],'id');return _0x79e2f4[_0x9a4a('0x55')](_0x5c684d)['then'](function(){for(var _0x249ad3=0x0;_0x249ad3<_0x5c684d[_0x9a4a('0x1d')];_0x249ad3+=0x1){_0x5afe83[_0x9a4a('0x4e')]('user_has_openchannel_interactions:remove',{'OpenchannelInteractionId':Number(_0x5c684d[_0x249ad3]),'UserId':Number(_0x79e2f4['id'])});}});}})[_0x9a4a('0x17')](function(){if(_0x100540===_0x9a4a('0x49')){var _0x40a387=_[_0x9a4a('0x18')](_0x79e2f4['WhatsappInteractions'],'id');return _0x79e2f4[_0x9a4a('0x56')](_0x40a387)[_0x9a4a('0x17')](function(){for(var _0x20d1db=0x0;_0x20d1db<_0x40a387[_0x9a4a('0x1d')];_0x20d1db+=0x1){_0x5afe83[_0x9a4a('0x4e')](_0x9a4a('0x57'),{'WhatsappInteractionId':Number(_0x40a387[_0x20d1db]),'UserId':Number(_0x79e2f4['id'])});}});}})[_0x9a4a('0x58')](function(_0x352898){_0x39d000[_0x9a4a('0x59')](_0x352898);});}}function onDisconnect(_0x43d422,_0x557774){joinOrLeave(_0x43d422,_0x9a4a('0x49'),_0x557774);}function onConnect(_0x120179){joinOrLeave(_0x120179,_0x9a4a('0x5a'));}exports[_0x9a4a('0x5b')]=function(_0x278983){_0x278983['on'](_0x9a4a('0x5c'),function(_0x2701e1){_0x2701e1[_0x9a4a('0x5d')](0x0);_0x2701e1['address']=_0x2701e1['request'][_0x9a4a('0x5c')][_0x9a4a('0x5e')]+':'+_0x2701e1[_0x9a4a('0x5f')][_0x9a4a('0x5c')][_0x9a4a('0x60')];_0x2701e1[_0x9a4a('0x61')]=new Date();_0x2701e1[_0x9a4a('0x59')]=function(_0x4bcb62){console[_0x9a4a('0x59')](_0x9a4a('0x62')+_0x2701e1[_0x9a4a('0x63')]['name']+'['+_0x2701e1[_0x9a4a('0x64')]+']',_0x4bcb62);};_0x2701e1['on'](_0x9a4a('0x65'),function(){onDisconnect(_0x2701e1,_0x278983);_0x2701e1[_0x9a4a('0x59')](_0x9a4a('0x66'));});onConnect(_0x2701e1);_0x2701e1[_0x9a4a('0x59')](_0x9a4a('0x67'));});};
\ No newline at end of file
+var _0x7939=['query','User','userProfileId','ChatInteraction','ChatInteractions','MailInteraction','MailInteractions','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','user:%s','admin','voice:outbound','hasOwnProperty','include','push','VoiceQueue','ChatQueue','FaxQueue','SmsQueue','MailQueue','OpenchannelQueue','WhatsappQueue','Trunk','Campaign','user','voice:inbound','OpenchannelQueues','getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues','all','voice','chat','fax','sms','mail','telephone:%s','trunk:%s','leave','removeChatInteractions','user_has_chat_interactions:remove','removeMailInteractions','user_has_mail_interactions:remove','removeFaxInteractions','user_has_fax_interactions:remove','removeSmsInteractions','emit','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','join','default','connection','request','remoteAddress','remotePort','connectedAt','log','SocketIO\x20','nsp','address','disconnect','DISCONNECTED','CONNECTED','util','bluebird','../mysqldb','./environment','name','role','agent','telephone','type','ivr','findOne','then','autoAssociation','VoiceQueues','ChatQueues','FaxQueues','SmsQueues','WhatsappQueues','findAll','Telephones','Trunks','IvrCampaigns','UserProfileResource','resourceId','map','where','format','%s:queue:%s','Agents','length','handshake'];(function(_0xd09668,_0x1435b2){var _0x68726=function(_0x54a030){while(--_0x54a030){_0xd09668['push'](_0xd09668['shift']());}};_0x68726(++_0x1435b2);}(_0x7939,0x11c));var _0x9793=function(_0xb920be,_0x48e21e){_0xb920be=_0xb920be-0x0;var _0x54a992=_0x7939[_0xb920be];return _0x54a992;};'use strict';var _=require('lodash');var util=require(_0x9793('0x0'));var BPromise=require(_0x9793('0x1'));var db=require(_0x9793('0x2'))['db'];var config=require(_0x9793('0x3'));var queryQueues={'attributes':['id','name'],'include':[{'as':'Agents','model':db['User'],'attributes':['id',_0x9793('0x4'),_0x9793('0x5')],'raw':!![],'where':{'role':_0x9793('0x6')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x9793('0x4')],'where':{'role':_0x9793('0x7')}};var queryTrunks={'raw':!![],'attributes':['id',_0x9793('0x4')]};var queryAgents={'raw':!![],'attributes':['id',_0x9793('0x4')],'where':{'role':'agent'}};var queryCampaigns={'raw':!![],'attributes':['id',_0x9793('0x4'),_0x9793('0x8')],'where':{'type':_0x9793('0x9')}};function getAssociatedResources(_0x2a9b7c,_0x4e5923,_0x3901f3){return db['UserProfileSection'][_0x9793('0xa')]({'where':{'name':_0x2a9b7c,'userProfileId':_0x4e5923},'raw':!![]})[_0x9793('0xb')](function(_0x5ea2e2){if(_0x5ea2e2){if(_0x5ea2e2[_0x9793('0xc')]){switch(_0x2a9b7c){case _0x9793('0xd'):case _0x9793('0xe'):case _0x9793('0xf'):case _0x9793('0x10'):case'MailQueues':case'OpenchannelQueues':case _0x9793('0x11'):return db[_0x3901f3][_0x9793('0x12')](queryQueues);case _0x9793('0x13'):return db[_0x3901f3][_0x9793('0x12')](queryTelephones);case _0x9793('0x14'):return db[_0x3901f3][_0x9793('0x12')](queryTrunks);case _0x9793('0x15'):return db[_0x3901f3][_0x9793('0x12')](queryCampaigns);}}else{return db[_0x9793('0x16')][_0x9793('0x12')]({'attributes':[_0x9793('0x17')],'where':{'sectionId':_0x5ea2e2['id']},'raw':!![]})[_0x9793('0xb')](function(_0x4f0d68){if(_0x4f0d68){var _0x277e9b={'where':{'id':_[_0x9793('0x18')](_0x4f0d68,'resourceId')},'raw':!![]};switch(_0x3901f3){case'User':_0x277e9b[_0x9793('0x19')]['role']=_0x9793('0x7');break;case'Campaign':_0x277e9b[_0x9793('0x19')][_0x9793('0x8')]=_0x9793('0x9');break;}return db[_0x3901f3]['findAll'](_0x277e9b);}else{return[];}});}}else{return[];}})['then'](function(_0x2d6656){return _0x2d6656;});}function joinOrLeaveQueues(_0x53aa43,_0x5407c5,_0x369f5e,_0x4d1769){_0x53aa43[_0x5407c5](util[_0x9793('0x1a')](_0x9793('0x1b'),_0x369f5e,_0x4d1769[_0x9793('0x4')]));if(_0x4d1769[_0x9793('0x1c')]){for(var _0x23b51e=0x0;_0x23b51e<_0x4d1769['Agents'][_0x9793('0x1d')];_0x23b51e+=0x1){_0x53aa43[_0x5407c5](util[_0x9793('0x1a')]('user:%s',_0x4d1769[_0x9793('0x1c')][_0x23b51e]['name']));}}}function joinOrLeave(_0x3054ec,_0x1f079d,_0x566c92){var _0x4eacb2;if(_0x3054ec[_0x9793('0x1e')][_0x9793('0x1f')]['id']){db[_0x9793('0x20')]['find']({'attributes':['id',_0x9793('0x4'),_0x9793('0x5'),_0x9793('0x21')],'where':{'id':_0x3054ec[_0x9793('0x1e')][_0x9793('0x1f')]['id']},'include':[{'model':db[_0x9793('0x22')],'as':_0x9793('0x23'),'attributes':['id'],'raw':!![]},{'model':db[_0x9793('0x24')],'as':_0x9793('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0x9793('0x26')],'as':_0x9793('0x27'),'attributes':['id'],'raw':!![]},{'model':db[_0x9793('0x28')],'as':_0x9793('0x29'),'attributes':['id'],'raw':!![]},{'model':db['OpenchannelInteraction'],'as':_0x9793('0x2a'),'attributes':['id'],'raw':!![]},{'model':db[_0x9793('0x2b')],'as':_0x9793('0x2c'),'attributes':['id'],'raw':!![]}]})[_0x9793('0xb')](function(_0x481e8a){if(_0x481e8a){_0x4eacb2=_0x481e8a;_0x3054ec[_0x1f079d](util[_0x9793('0x1a')](_0x9793('0x2d'),_0x481e8a['name']));var _0x3048d8=[];switch(_0x481e8a[_0x9793('0x5')]){case _0x9793('0x2e'):_0x3054ec[_0x1f079d]('voice:inbound');_0x3054ec[_0x1f079d](_0x9793('0x2f'));if(queryQueues[_0x9793('0x30')](_0x9793('0x31'))){delete queryQueues['include'];}_0x3048d8[_0x9793('0x32')](db[_0x9793('0x33')]['findAll'](queryQueues));_0x3048d8[_0x9793('0x32')](db[_0x9793('0x34')]['findAll'](queryQueues));_0x3048d8[_0x9793('0x32')](db[_0x9793('0x35')][_0x9793('0x12')](queryQueues));_0x3048d8[_0x9793('0x32')](db[_0x9793('0x36')][_0x9793('0x12')](queryQueues));_0x3048d8[_0x9793('0x32')](db[_0x9793('0x37')][_0x9793('0x12')](queryQueues));_0x3048d8[_0x9793('0x32')](db[_0x9793('0x38')][_0x9793('0x12')](queryQueues));_0x3048d8['push'](db[_0x9793('0x39')][_0x9793('0x12')](queryQueues));_0x3048d8[_0x9793('0x32')](db['User']['findAll'](queryTelephones));_0x3048d8['push'](db[_0x9793('0x3a')]['findAll'](queryTrunks));_0x3048d8[_0x9793('0x32')](db[_0x9793('0x3b')][_0x9793('0x12')](queryCampaigns));_0x3048d8[_0x9793('0x32')](db[_0x9793('0x20')][_0x9793('0x12')](queryAgents));break;case _0x9793('0x3c'):_0x3054ec[_0x1f079d](_0x9793('0x3d'));_0x3054ec[_0x1f079d]('voice:outbound');_0x3048d8[_0x9793('0x32')](getAssociatedResources(_0x9793('0xd'),_0x481e8a[_0x9793('0x21')],_0x9793('0x33')));_0x3048d8[_0x9793('0x32')](getAssociatedResources('ChatQueues',_0x481e8a['userProfileId'],_0x9793('0x34')));_0x3048d8[_0x9793('0x32')](getAssociatedResources(_0x9793('0xf'),_0x481e8a[_0x9793('0x21')],_0x9793('0x35')));_0x3048d8[_0x9793('0x32')](getAssociatedResources('SmsQueues',_0x481e8a[_0x9793('0x21')],_0x9793('0x36')));_0x3048d8[_0x9793('0x32')](getAssociatedResources('MailQueues',_0x481e8a[_0x9793('0x21')],'MailQueue'));_0x3048d8[_0x9793('0x32')](getAssociatedResources(_0x9793('0x3e'),_0x481e8a['userProfileId'],'OpenchannelQueue'));_0x3048d8[_0x9793('0x32')](getAssociatedResources(_0x9793('0x11'),_0x481e8a[_0x9793('0x21')],_0x9793('0x39')));_0x3048d8['push'](getAssociatedResources(_0x9793('0x13'),_0x481e8a['userProfileId'],'User'));_0x3048d8[_0x9793('0x32')](getAssociatedResources(_0x9793('0x14'),_0x481e8a['userProfileId'],'Trunk'));_0x3048d8[_0x9793('0x32')](getAssociatedResources(_0x9793('0x15'),_0x481e8a[_0x9793('0x21')],_0x9793('0x3b')));_0x3048d8['push'](db[_0x9793('0x20')]['findAll'](queryAgents));break;case _0x9793('0x6'):_0x3054ec[_0x1f079d](_0x9793('0x3d'));_0x3054ec[_0x1f079d](_0x9793('0x2f'));_0x3048d8[_0x9793('0x32')](_0x481e8a[_0x9793('0x3f')]({'attributes':['id',_0x9793('0x4')]}));_0x3048d8[_0x9793('0x32')](_0x481e8a[_0x9793('0x40')]({'attributes':['id',_0x9793('0x4')]}));_0x3048d8[_0x9793('0x32')](_0x481e8a[_0x9793('0x41')]({'attributes':['id','name']}));_0x3048d8[_0x9793('0x32')](_0x481e8a[_0x9793('0x42')]({'attributes':['id',_0x9793('0x4')]}));_0x3048d8['push'](_0x481e8a[_0x9793('0x43')]({'attributes':['id',_0x9793('0x4')]}));_0x3048d8[_0x9793('0x32')](_0x481e8a[_0x9793('0x44')]({'attributes':['id','name']}));_0x3048d8[_0x9793('0x32')](_0x481e8a[_0x9793('0x45')]({'attributes':['id','name']}));break;}return BPromise[_0x9793('0x46')](_0x3048d8);}})['then'](function(_0xe4171c){if(_0xe4171c&&_0xe4171c['length']){for(var _0x6c8092=0x0;_0x6c8092<_0xe4171c[_0x9793('0x1d')];_0x6c8092+=0x1){for(var _0x1c9d48=0x0;_0x1c9d48<_0xe4171c[_0x6c8092][_0x9793('0x1d')];_0x1c9d48+=0x1){switch(_0x6c8092){case 0x0:joinOrLeaveQueues(_0x3054ec,_0x1f079d,_0x9793('0x47'),_0xe4171c[_0x6c8092][_0x1c9d48]);break;case 0x1:joinOrLeaveQueues(_0x3054ec,_0x1f079d,_0x9793('0x48'),_0xe4171c[_0x6c8092][_0x1c9d48]);break;case 0x2:joinOrLeaveQueues(_0x3054ec,_0x1f079d,_0x9793('0x49'),_0xe4171c[_0x6c8092][_0x1c9d48]);break;case 0x3:joinOrLeaveQueues(_0x3054ec,_0x1f079d,_0x9793('0x4a'),_0xe4171c[_0x6c8092][_0x1c9d48]);break;case 0x4:joinOrLeaveQueues(_0x3054ec,_0x1f079d,_0x9793('0x4b'),_0xe4171c[_0x6c8092][_0x1c9d48]);break;case 0x5:joinOrLeaveQueues(_0x3054ec,_0x1f079d,'openchannel',_0xe4171c[_0x6c8092][_0x1c9d48]);break;case 0x6:joinOrLeaveQueues(_0x3054ec,_0x1f079d,'whatsapp',_0xe4171c[_0x6c8092][_0x1c9d48]);break;case 0x7:if(_0x4eacb2['role']!=='agent')_0x3054ec[_0x1f079d](util[_0x9793('0x1a')](_0x9793('0x4c'),_0xe4171c[_0x6c8092][_0x1c9d48]['name']));break;case 0x8:if(_0x4eacb2[_0x9793('0x5')]!==_0x9793('0x6'))_0x3054ec[_0x1f079d](util[_0x9793('0x1a')](_0x9793('0x4d'),_0xe4171c[_0x6c8092][_0x1c9d48][_0x9793('0x4')]));break;case 0x9:if(_0x4eacb2['role']!=='agent')_0x3054ec[_0x1f079d](util[_0x9793('0x1a')]('campaign:%s:%s',_0xe4171c[_0x6c8092][_0x1c9d48]['type'],_0xe4171c[_0x6c8092][_0x1c9d48][_0x9793('0x4')]));break;case 0xa:_0x3054ec[_0x1f079d](util[_0x9793('0x1a')]('user:%s',_0xe4171c[_0x6c8092][_0x1c9d48][_0x9793('0x4')]));break;}}}}})[_0x9793('0xb')](function(){if(_0x1f079d===_0x9793('0x4e')){var _0x2445fa=_['map'](_0x4eacb2[_0x9793('0x23')],'id');return _0x4eacb2[_0x9793('0x4f')](_0x2445fa)[_0x9793('0xb')](function(){for(var _0x3ca143=0x0;_0x3ca143<_0x2445fa[_0x9793('0x1d')];_0x3ca143+=0x1){_0x566c92['emit'](_0x9793('0x50'),{'ChatInteractionId':Number(_0x2445fa[_0x3ca143]),'UserId':Number(_0x4eacb2['id'])});}});}})[_0x9793('0xb')](function(){if(_0x1f079d===_0x9793('0x4e')){var _0xed9987=_['map'](_0x4eacb2['MailInteractions'],'id');return _0x4eacb2[_0x9793('0x51')](_0xed9987)[_0x9793('0xb')](function(){for(var _0xb15e63=0x0;_0xb15e63<_0xed9987['length'];_0xb15e63+=0x1){_0x566c92['emit'](_0x9793('0x52'),{'MailInteractionId':Number(_0xed9987[_0xb15e63]),'UserId':Number(_0x4eacb2['id'])});}});}})[_0x9793('0xb')](function(){if(_0x1f079d===_0x9793('0x4e')){var _0x3dbf43=_['map'](_0x4eacb2[_0x9793('0x27')],'id');return _0x4eacb2[_0x9793('0x53')](_0x3dbf43)[_0x9793('0xb')](function(){for(var _0x2298c6=0x0;_0x2298c6<_0x3dbf43['length'];_0x2298c6+=0x1){_0x566c92['emit'](_0x9793('0x54'),{'FaxInteractionId':Number(_0x3dbf43[_0x2298c6]),'UserId':Number(_0x4eacb2['id'])});}});}})[_0x9793('0xb')](function(){if(_0x1f079d===_0x9793('0x4e')){var _0x40c043=_['map'](_0x4eacb2['SmsInteractions'],'id');return _0x4eacb2[_0x9793('0x55')](_0x40c043)[_0x9793('0xb')](function(){for(var _0x1ffe3d=0x0;_0x1ffe3d<_0x40c043[_0x9793('0x1d')];_0x1ffe3d+=0x1){_0x566c92[_0x9793('0x56')](_0x9793('0x57'),{'SmsInteractionId':Number(_0x40c043[_0x1ffe3d]),'UserId':Number(_0x4eacb2['id'])});}});}})[_0x9793('0xb')](function(){if(_0x1f079d==='leave'){var _0x1d6f8b=_[_0x9793('0x18')](_0x4eacb2['OpenchannelInteractions'],'id');return _0x4eacb2[_0x9793('0x58')](_0x1d6f8b)[_0x9793('0xb')](function(){for(var _0x43e872=0x0;_0x43e872<_0x1d6f8b[_0x9793('0x1d')];_0x43e872+=0x1){_0x566c92[_0x9793('0x56')](_0x9793('0x59'),{'OpenchannelInteractionId':Number(_0x1d6f8b[_0x43e872]),'UserId':Number(_0x4eacb2['id'])});}});}})['then'](function(){if(_0x1f079d===_0x9793('0x4e')){var _0x3572db=_[_0x9793('0x18')](_0x4eacb2[_0x9793('0x2c')],'id');return _0x4eacb2[_0x9793('0x5a')](_0x3572db)[_0x9793('0xb')](function(){for(var _0x4fd474=0x0;_0x4fd474<_0x3572db[_0x9793('0x1d')];_0x4fd474+=0x1){_0x566c92[_0x9793('0x56')]('user_has_whatsapp_interactions:remove',{'WhatsappInteractionId':Number(_0x3572db[_0x4fd474]),'UserId':Number(_0x4eacb2['id'])});}});}})['catch'](function(_0x31fad5){_0x3054ec['log'](_0x31fad5);});}}function onDisconnect(_0x3cccfa,_0x14bcba){joinOrLeave(_0x3cccfa,_0x9793('0x4e'),_0x14bcba);}function onConnect(_0x37e70b){joinOrLeave(_0x37e70b,_0x9793('0x5b'));}exports[_0x9793('0x5c')]=function(_0x643d8){_0x643d8['on'](_0x9793('0x5d'),function(_0x1f5b60){_0x1f5b60['setMaxListeners'](0x0);_0x1f5b60['address']=_0x1f5b60[_0x9793('0x5e')]['connection'][_0x9793('0x5f')]+':'+_0x1f5b60[_0x9793('0x5e')][_0x9793('0x5d')][_0x9793('0x60')];_0x1f5b60[_0x9793('0x61')]=new Date();_0x1f5b60['log']=function(_0x23dccc){console[_0x9793('0x62')](_0x9793('0x63')+_0x1f5b60[_0x9793('0x64')][_0x9793('0x4')]+'['+_0x1f5b60[_0x9793('0x65')]+']',_0x23dccc);};_0x1f5b60['on'](_0x9793('0x66'),function(){onDisconnect(_0x1f5b60,_0x643d8);_0x1f5b60[_0x9793('0x62')](_0x9793('0x67'));});onConnect(_0x1f5b60);_0x1f5b60[_0x9793('0x62')](_0x9793('0x68'));});};
\ No newline at end of file
index cc5aae7..7a2a4f4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9db0=['length','model','hook','callback','toLowerCase','util','../../mysqldb','../logger','client','Chat','ChatInteraction','afterCreate','afterUpdate','closedinteraction','ChatOfflineMessage','Sms','newinteraction','SmsMessage','Whatsapp','WhatsappInteraction','WhatsappMessage','FaxInteraction','Fax','FaxMessage','Mail','Openchannel','OpenchannelInteraction','OpenchannelMessage','request','EventManager','info','Trigger,\x20%s','error','code','get','channel','motionChannel','event','resolve','then','ContactId','undefined','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','query','Sequelize','QueryTypes','UserId','interface','format','SIP/%s','name','agent','outgoingmessage','catch','AfterCreateMessage','offlineMessage','SELECT','contact','AfterCreate','changed','closed','substatus','AfterUpdate','User','find','fullname','email','default'];(function(_0xfbf8bc,_0x1f6598){var _0x1cb4fd=function(_0x2c6223){while(--_0x2c6223){_0xfbf8bc['push'](_0xfbf8bc['shift']());}};_0x1cb4fd(++_0x1f6598);}(_0x9db0,0xd4));var _0x09db=function(_0x39d45a,_0x425ff1){_0x39d45a=_0x39d45a-0x0;var _0xbfd32=_0x9db0[_0x39d45a];return _0xbfd32;};'use strict';var util=require(_0x09db('0x0'));var db=require(_0x09db('0x1'))['db'];var jayson=require('jayson/promise');var logger=require(_0x09db('0x2'))('triggers');var client=jayson[_0x09db('0x3')]['http']({'port':0x232a});var triggers=[{'channel':_0x09db('0x4'),'model':_0x09db('0x5'),'event':_0x09db('0x6'),'condition':'newinteraction','callback':afterCreate},{'channel':_0x09db('0x4'),'model':_0x09db('0x5'),'event':_0x09db('0x7'),'condition':_0x09db('0x8'),'callback':afterUpdate},{'channel':'Chat','model':'ChatMessage','event':'afterCreate','condition':'newmessage','callback':afterCreateMessage},{'channel':_0x09db('0x4'),'model':_0x09db('0x9'),'event':_0x09db('0x6'),'condition':'newmessage','callback':afterCreateOfflineMessage},{'channel':_0x09db('0xa'),'model':'SmsInteraction','event':_0x09db('0x6'),'condition':_0x09db('0xb'),'callback':afterCreate},{'channel':_0x09db('0xa'),'model':'SmsInteraction','event':_0x09db('0x7'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0x09db('0xa'),'model':_0x09db('0xc'),'event':'afterCreate','condition':'newmessage','callback':afterCreateMessage},{'channel':_0x09db('0xd'),'model':_0x09db('0xe'),'event':_0x09db('0x6'),'condition':_0x09db('0xb'),'callback':afterCreate},{'channel':_0x09db('0xd'),'model':'WhatsappInteraction','event':_0x09db('0x7'),'condition':_0x09db('0x8'),'callback':afterUpdate},{'channel':'Whatsapp','model':_0x09db('0xf'),'event':_0x09db('0x6'),'condition':'newmessage','callback':afterCreateMessage},{'channel':'Fax','model':_0x09db('0x10'),'event':'afterCreate','condition':_0x09db('0xb'),'callback':afterCreate},{'channel':_0x09db('0x11'),'model':'FaxInteraction','event':_0x09db('0x7'),'condition':_0x09db('0x8'),'callback':afterUpdate},{'channel':_0x09db('0x11'),'model':_0x09db('0x12'),'event':_0x09db('0x6'),'condition':'newmessage','callback':afterCreateMessage},{'channel':'Mail','model':'MailInteraction','event':_0x09db('0x6'),'condition':_0x09db('0xb'),'callback':afterCreate},{'channel':_0x09db('0x13'),'model':'MailInteraction','event':'afterUpdate','condition':_0x09db('0x8'),'callback':afterUpdate},{'channel':_0x09db('0x13'),'model':'MailMessage','event':'afterCreate','condition':'newmessage','callback':afterCreateMessage},{'channel':_0x09db('0x14'),'model':_0x09db('0x15'),'event':_0x09db('0x6'),'condition':'newinteraction','callback':afterCreate},{'channel':_0x09db('0x14'),'model':_0x09db('0x15'),'event':'afterUpdate','condition':'closedinteraction','callback':afterUpdate},{'channel':_0x09db('0x14'),'model':_0x09db('0x16'),'event':_0x09db('0x6'),'condition':'newmessage','callback':afterCreateMessage}];function request(_0x4088a0){return client[_0x09db('0x17')](_0x09db('0x18'),_0x4088a0)['then'](function(_0x5ddd43){logger[_0x09db('0x19')](_0x09db('0x1a'),_0x09db('0x18'),_0x5ddd43);if(_0x5ddd43[_0x09db('0x1b')]){if(_0x5ddd43[_0x09db('0x1b')][_0x09db('0x1c')]===0x1f4){logger[_0x09db('0x1b')](_0x09db('0x1a'),_0x09db('0x18'),_0x5ddd43['error']);}}})['catch'](function(_0x35c214){logger[_0x09db('0x1b')](_0x09db('0x1a'),_0x09db('0x18'),_0x35c214);});}function afterCreateMessage(_0x4e66e5){return function(_0x446765){_0x446765=_0x446765[_0x09db('0x1d')]({'plain':!![]});_0x446765[_0x09db('0x1e')]=_0x4e66e5;_0x446765[_0x09db('0x1f')]=_0x4e66e5;_0x446765[_0x09db('0x20')]=_0x446765['direction'];Promise[_0x09db('0x21')]()[_0x09db('0x22')](function(){if(typeof _0x446765[_0x09db('0x23')]===_0x09db('0x24'))return null;var _0x317f00=_0x09db('0x25')+_0x446765[_0x09db('0x23')];return db[_0x09db('0x26')][_0x09db('0x27')](_0x317f00,{'type':db[_0x09db('0x28')][_0x09db('0x29')]['SELECT'],'raw':!![]});})['then'](function(_0x1c064e){if(_0x1c064e){_0x446765['contact']=_0x1c064e[0x0];}if(typeof _0x446765['UserId']==='undefined')return;return getAgent(_0x446765[_0x09db('0x2a')]);})['then'](function(_0x2e45f5){if(_0x2e45f5){_0x446765[_0x09db('0x2b')]=util[_0x09db('0x2c')](_0x09db('0x2d'),_0x2e45f5[_0x09db('0x2e')]);_0x446765[_0x09db('0x2f')]=_0x2e45f5;_0x446765[_0x09db('0x1e')]=_0x4e66e5;return request({'event':'incomingmessage','message':_0x446765});}else{return request({'event':_0x09db('0x30'),'message':_0x446765});}})[_0x09db('0x31')](function(_0x538ef6){logger[_0x09db('0x1b')](_0x09db('0x1a'),_0x09db('0x32'),_0x538ef6);});};}function afterCreateOfflineMessage(_0xca23f7){return function(_0x34c83b){_0x34c83b=_0x34c83b[_0x09db('0x1d')]({'plain':!![]});_0x34c83b[_0x09db('0x1e')]=_0xca23f7;_0x34c83b['motionChannel']=_0xca23f7;_0x34c83b[_0x09db('0x20')]=_0x09db('0x33');return request({'event':_0x34c83b[_0x09db('0x20')],'message':_0x34c83b});};}function afterCreate(_0x3649d1,_0x3b6b0e){return function(_0x52b852){_0x52b852=_0x52b852[_0x09db('0x1d')]({'plain':!![]});_0x52b852['channel']=_0x3649d1;_0x52b852[_0x09db('0x1f')]=_0x3649d1;_0x52b852[_0x09db('0x20')]='opened';Promise[_0x09db('0x21')]()[_0x09db('0x22')](function(){var _0x8459ff='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x52b852[_0x09db('0x23')];return db['sequelize']['query'](_0x8459ff,{'type':db[_0x09db('0x28')][_0x09db('0x29')][_0x09db('0x34')],'raw':!![]});})[_0x09db('0x22')](function(_0x4babe4){if(_0x4babe4){_0x52b852[_0x09db('0x35')]=_0x4babe4[0x0];}if(typeof _0x52b852['UserId']==='undefined')return;return getAgent(_0x52b852[_0x09db('0x2a')]);})[_0x09db('0x22')](function(_0x2ddaa0){if(_0x2ddaa0){_0x52b852['interface']=util[_0x09db('0x2c')]('SIP/%s',_0x2ddaa0[_0x09db('0x2e')]);_0x52b852[_0x09db('0x2f')]=_0x2ddaa0;}return request({'event':_0x3b6b0e,'message':_0x52b852});})[_0x09db('0x31')](function(_0xedf242){logger[_0x09db('0x1b')]('Trigger,\x20%s',_0x09db('0x36'),_0xedf242);});};}function afterUpdate(_0x4c9f5b){return function(_0x43f072){var _0x5db86f=_0x43f072[_0x09db('0x37')](_0x09db('0x38'))&&_0x43f072[_0x09db('0x38')];var _0x3c2862=_0x43f072[_0x09db('0x37')](_0x09db('0x39'));if(_0x5db86f||_0x3c2862){var _0x4681a6=_0x5db86f?_0x09db('0x8'):_0x09db('0x39');var _0x2290c0=_0x43f072['get']({'plain':!![]});_0x2290c0[_0x09db('0x1e')]=_0x4c9f5b;_0x2290c0[_0x09db('0x1f')]=_0x4c9f5b;_0x2290c0[_0x09db('0x20')]=_0x5db86f?_0x09db('0x38'):'substatus';var _0x596109=_0x09db('0x25')+_0x2290c0[_0x09db('0x23')];return db[_0x09db('0x26')][_0x09db('0x27')](_0x596109,{'type':db[_0x09db('0x28')][_0x09db('0x29')]['SELECT'],'raw':!![]})['then'](function(_0x523db7){if(_0x523db7){_0x2290c0[_0x09db('0x35')]=_0x523db7[0x0];}if(typeof _0x2290c0[_0x09db('0x2a')]===_0x09db('0x24'))return;return getAgent(_0x2290c0[_0x09db('0x2a')]);})[_0x09db('0x22')](function(_0x2adf2a){if(_0x2adf2a){_0x2290c0[_0x09db('0x2b')]=util[_0x09db('0x2c')]('SIP/%s',_0x2adf2a[_0x09db('0x2e')]);_0x2290c0[_0x09db('0x2f')]=_0x2adf2a;}return request({'event':_0x4681a6,'message':_0x2290c0});})['catch'](function(_0xc3932){logger[_0x09db('0x1b')](_0x09db('0x1a'),_0x09db('0x3a'),_0xc3932);});}};}function getAgent(_0x43f62f){return db[_0x09db('0x3b')][_0x09db('0x3c')]({'where':{'id':_0x43f62f},'attributes':['id','name',_0x09db('0x3d'),_0x09db('0x3e'),'internal'],'raw':!![]})[_0x09db('0x22')](function(_0x26c8dd){return _0x26c8dd;});}exports[_0x09db('0x3f')]=function(){for(var _0x17f3de=0x0;_0x17f3de<triggers[_0x09db('0x40')];_0x17f3de+=0x1){if(db['hasOwnProperty'](triggers[_0x17f3de][_0x09db('0x41')])){db[triggers[_0x17f3de]['model']][_0x09db('0x42')](triggers[_0x17f3de][_0x09db('0x20')],triggers[_0x17f3de][_0x09db('0x43')](triggers[_0x17f3de][_0x09db('0x1e')][_0x09db('0x44')](),triggers[_0x17f3de]['condition']));}}};
\ No newline at end of file
+var _0x67b2=['QueryTypes','contact','UserId','SIP/%s','name','agent','incomingmessage','outgoingmessage','AfterCreateMessage','get','offlineMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','Sequelize','SELECT','interface','format','changed','closed','substatus','AfterUpdate','User','find','fullname','email','internal','default','length','hasOwnProperty','model','hook','toLowerCase','condition','util','jayson/promise','triggers','client','Chat','ChatInteraction','afterUpdate','closedinteraction','ChatMessage','afterCreate','newmessage','ChatOfflineMessage','Sms','SmsInteraction','newinteraction','SmsMessage','Whatsapp','WhatsappInteraction','Fax','FaxInteraction','FaxMessage','MailInteraction','Mail','Openchannel','OpenchannelMessage','request','EventManager','then','Trigger,\x20%s','error','catch','channel','motionChannel','event','direction','resolve','ContactId','undefined','sequelize','query'];(function(_0x295c6d,_0x11a9fb){var _0xa31b90=function(_0x454527){while(--_0x454527){_0x295c6d['push'](_0x295c6d['shift']());}};_0xa31b90(++_0x11a9fb);}(_0x67b2,0x188));var _0x267b=function(_0x489b87,_0xd51c93){_0x489b87=_0x489b87-0x0;var _0x1823b6=_0x67b2[_0x489b87];return _0x1823b6;};'use strict';var util=require(_0x267b('0x0'));var db=require('../../mysqldb')['db'];var jayson=require(_0x267b('0x1'));var logger=require('../logger')(_0x267b('0x2'));var client=jayson[_0x267b('0x3')]['http']({'port':0x232a});var triggers=[{'channel':_0x267b('0x4'),'model':_0x267b('0x5'),'event':'afterCreate','condition':'newinteraction','callback':afterCreate},{'channel':_0x267b('0x4'),'model':'ChatInteraction','event':_0x267b('0x6'),'condition':_0x267b('0x7'),'callback':afterUpdate},{'channel':_0x267b('0x4'),'model':_0x267b('0x8'),'event':_0x267b('0x9'),'condition':_0x267b('0xa'),'callback':afterCreateMessage},{'channel':_0x267b('0x4'),'model':_0x267b('0xb'),'event':'afterCreate','condition':_0x267b('0xa'),'callback':afterCreateOfflineMessage},{'channel':_0x267b('0xc'),'model':_0x267b('0xd'),'event':_0x267b('0x9'),'condition':_0x267b('0xe'),'callback':afterCreate},{'channel':'Sms','model':_0x267b('0xd'),'event':'afterUpdate','condition':'closedinteraction','callback':afterUpdate},{'channel':'Sms','model':_0x267b('0xf'),'event':_0x267b('0x9'),'condition':_0x267b('0xa'),'callback':afterCreateMessage},{'channel':_0x267b('0x10'),'model':_0x267b('0x11'),'event':_0x267b('0x9'),'condition':_0x267b('0xe'),'callback':afterCreate},{'channel':_0x267b('0x10'),'model':_0x267b('0x11'),'event':_0x267b('0x6'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0x267b('0x10'),'model':'WhatsappMessage','event':_0x267b('0x9'),'condition':_0x267b('0xa'),'callback':afterCreateMessage},{'channel':_0x267b('0x12'),'model':_0x267b('0x13'),'event':_0x267b('0x9'),'condition':_0x267b('0xe'),'callback':afterCreate},{'channel':_0x267b('0x12'),'model':_0x267b('0x13'),'event':_0x267b('0x6'),'condition':_0x267b('0x7'),'callback':afterUpdate},{'channel':_0x267b('0x12'),'model':_0x267b('0x14'),'event':_0x267b('0x9'),'condition':'newmessage','callback':afterCreateMessage},{'channel':'Mail','model':_0x267b('0x15'),'event':_0x267b('0x9'),'condition':_0x267b('0xe'),'callback':afterCreate},{'channel':_0x267b('0x16'),'model':_0x267b('0x15'),'event':_0x267b('0x6'),'condition':_0x267b('0x7'),'callback':afterUpdate},{'channel':'Mail','model':'MailMessage','event':_0x267b('0x9'),'condition':_0x267b('0xa'),'callback':afterCreateMessage},{'channel':_0x267b('0x17'),'model':'OpenchannelInteraction','event':_0x267b('0x9'),'condition':'newinteraction','callback':afterCreate},{'channel':_0x267b('0x17'),'model':'OpenchannelInteraction','event':'afterUpdate','condition':'closedinteraction','callback':afterUpdate},{'channel':_0x267b('0x17'),'model':_0x267b('0x18'),'event':_0x267b('0x9'),'condition':_0x267b('0xa'),'callback':afterCreateMessage}];function request(_0x17ef3d){return client[_0x267b('0x19')](_0x267b('0x1a'),_0x17ef3d)[_0x267b('0x1b')](function(_0x184339){logger['info'](_0x267b('0x1c'),'EventManager',_0x184339);if(_0x184339['error']){if(_0x184339[_0x267b('0x1d')]['code']===0x1f4){logger['error'](_0x267b('0x1c'),_0x267b('0x1a'),_0x184339['error']);}}})[_0x267b('0x1e')](function(_0x2b477a){logger[_0x267b('0x1d')](_0x267b('0x1c'),_0x267b('0x1a'),_0x2b477a);});}function afterCreateMessage(_0x3e2d15){return function(_0x266784){_0x266784=_0x266784['get']({'plain':!![]});_0x266784[_0x267b('0x1f')]=_0x3e2d15;_0x266784[_0x267b('0x20')]=_0x3e2d15;_0x266784[_0x267b('0x21')]=_0x266784[_0x267b('0x22')];Promise[_0x267b('0x23')]()[_0x267b('0x1b')](function(){if(typeof _0x266784[_0x267b('0x24')]===_0x267b('0x25'))return null;var _0x424900='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x266784[_0x267b('0x24')];return db[_0x267b('0x26')][_0x267b('0x27')](_0x424900,{'type':db['Sequelize'][_0x267b('0x28')]['SELECT'],'raw':!![]});})[_0x267b('0x1b')](function(_0x1f3461){if(_0x1f3461){_0x266784[_0x267b('0x29')]=_0x1f3461[0x0];}if(typeof _0x266784['UserId']===_0x267b('0x25'))return;return getAgent(_0x266784[_0x267b('0x2a')]);})[_0x267b('0x1b')](function(_0x163d49){if(_0x163d49){_0x266784['interface']=util['format'](_0x267b('0x2b'),_0x163d49[_0x267b('0x2c')]);_0x266784[_0x267b('0x2d')]=_0x163d49;_0x266784['channel']=_0x3e2d15;return request({'event':_0x267b('0x2e'),'message':_0x266784});}else{return request({'event':_0x267b('0x2f'),'message':_0x266784});}})[_0x267b('0x1e')](function(_0x332a18){logger[_0x267b('0x1d')](_0x267b('0x1c'),_0x267b('0x30'),_0x332a18);});};}function afterCreateOfflineMessage(_0x56be00){return function(_0x4f27ea){_0x4f27ea=_0x4f27ea[_0x267b('0x31')]({'plain':!![]});_0x4f27ea[_0x267b('0x1f')]=_0x56be00;_0x4f27ea[_0x267b('0x20')]=_0x56be00;_0x4f27ea[_0x267b('0x21')]=_0x267b('0x32');return request({'event':_0x4f27ea['event'],'message':_0x4f27ea});};}function afterCreate(_0x533d13,_0x386aef){return function(_0x1c452c){_0x1c452c=_0x1c452c['get']({'plain':!![]});_0x1c452c['channel']=_0x533d13;_0x1c452c[_0x267b('0x20')]=_0x533d13;_0x1c452c[_0x267b('0x21')]='opened';Promise[_0x267b('0x23')]()[_0x267b('0x1b')](function(){var _0x120fbc=_0x267b('0x33')+_0x1c452c[_0x267b('0x24')];return db[_0x267b('0x26')][_0x267b('0x27')](_0x120fbc,{'type':db[_0x267b('0x34')][_0x267b('0x28')][_0x267b('0x35')],'raw':!![]});})[_0x267b('0x1b')](function(_0x4f364f){if(_0x4f364f){_0x1c452c[_0x267b('0x29')]=_0x4f364f[0x0];}if(typeof _0x1c452c['UserId']===_0x267b('0x25'))return;return getAgent(_0x1c452c[_0x267b('0x2a')]);})[_0x267b('0x1b')](function(_0x21d2c9){if(_0x21d2c9){_0x1c452c[_0x267b('0x36')]=util[_0x267b('0x37')](_0x267b('0x2b'),_0x21d2c9[_0x267b('0x2c')]);_0x1c452c[_0x267b('0x2d')]=_0x21d2c9;}return request({'event':_0x386aef,'message':_0x1c452c});})[_0x267b('0x1e')](function(_0x1200e4){logger[_0x267b('0x1d')](_0x267b('0x1c'),'AfterCreate',_0x1200e4);});};}function afterUpdate(_0x2d926b){return function(_0x1e4a9a){var _0xa643f2=_0x1e4a9a[_0x267b('0x38')](_0x267b('0x39'))&&_0x1e4a9a[_0x267b('0x39')];var _0x3a5fff=_0x1e4a9a[_0x267b('0x38')]('substatus');if(_0xa643f2||_0x3a5fff){var _0x5b2cbd=_0xa643f2?_0x267b('0x7'):'substatus';var _0x33885a=_0x1e4a9a['get']({'plain':!![]});_0x33885a['channel']=_0x2d926b;_0x33885a[_0x267b('0x20')]=_0x2d926b;_0x33885a[_0x267b('0x21')]=_0xa643f2?_0x267b('0x39'):_0x267b('0x3a');var _0x1e9ec1='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x33885a[_0x267b('0x24')];return db[_0x267b('0x26')][_0x267b('0x27')](_0x1e9ec1,{'type':db[_0x267b('0x34')][_0x267b('0x28')][_0x267b('0x35')],'raw':!![]})['then'](function(_0x8cc153){if(_0x8cc153){_0x33885a['contact']=_0x8cc153[0x0];}if(typeof _0x33885a['UserId']===_0x267b('0x25'))return;return getAgent(_0x33885a[_0x267b('0x2a')]);})['then'](function(_0x197c06){if(_0x197c06){_0x33885a[_0x267b('0x36')]=util[_0x267b('0x37')](_0x267b('0x2b'),_0x197c06[_0x267b('0x2c')]);_0x33885a['agent']=_0x197c06;}return request({'event':_0x5b2cbd,'message':_0x33885a});})[_0x267b('0x1e')](function(_0x4e335c){logger[_0x267b('0x1d')]('Trigger,\x20%s',_0x267b('0x3b'),_0x4e335c);});}};}function getAgent(_0x312a21){return db[_0x267b('0x3c')][_0x267b('0x3d')]({'where':{'id':_0x312a21},'attributes':['id',_0x267b('0x2c'),_0x267b('0x3e'),_0x267b('0x3f'),_0x267b('0x40')],'raw':!![]})['then'](function(_0x411784){return _0x411784;});}exports[_0x267b('0x41')]=function(){for(var _0x34b196=0x0;_0x34b196<triggers[_0x267b('0x42')];_0x34b196+=0x1){if(db[_0x267b('0x43')](triggers[_0x34b196]['model'])){db[triggers[_0x34b196][_0x267b('0x44')]][_0x267b('0x45')](triggers[_0x34b196][_0x267b('0x21')],triggers[_0x34b196]['callback'](triggers[_0x34b196]['channel'][_0x267b('0x46')](),triggers[_0x34b196][_0x267b('0x47')]));}}};
\ No newline at end of file
index dc63736..a6cf5fb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x73a6=['isUndefined','blockedAt','updateAttributes','role','agent','count','getLicense','agents','bluebird','../mysqldb','./license/util','mail','chat','fax','sms','whatsapp','openchannel','getChannels','isValidChannel','toLowerCase','clearBlockUser'];(function(_0xfbaf14,_0x5f4cc1){var _0x5e00ca=function(_0x587485){while(--_0x587485){_0xfbaf14['push'](_0xfbaf14['shift']());}};_0x5e00ca(++_0x5f4cc1);}(_0x73a6,0x197));var _0x673a=function(_0x382930,_0x24eee9){_0x382930=_0x382930-0x0;var _0x3b6697=_0x73a6[_0x382930];return _0x3b6697;};'use strict';var _=require('lodash');var BPromise=require(_0x673a('0x0'));var db=require(_0x673a('0x1'))['db'];var util=require(_0x673a('0x2'));var channels=['voice',_0x673a('0x3'),_0x673a('0x4'),_0x673a('0x5'),_0x673a('0x6'),_0x673a('0x7'),_0x673a('0x8')];exports[_0x673a('0x9')]=function(){return channels;};exports[_0x673a('0xa')]=function(_0x4bfff6){_0x4bfff6=_0x4bfff6[_0x673a('0xb')]();return _['includes'](channels,_0x4bfff6);};exports[_0x673a('0xc')]=function(_0x1dcf85,_0x192b1e,_0x1c7e49,_0x1649a8){var _0x777344={'loginAttempts':_0x192b1e,'blocked':_0x1c7e49};if(!_[_0x673a('0xd')](_0x1649a8)){_0x777344[_0x673a('0xe')]=_0x1649a8;}return _0x1dcf85[_0x673a('0xf')](_0x777344);};exports['getLicense']=function(_0xce75fc){return new BPromise(function(_0xeb9174,_0x1656b2){var _0x23b896=0x0;if(_0xce75fc[_0x673a('0x10')]!==_0x673a('0x11')){_0xeb9174(_0xce75fc);}db['User'][_0x673a('0x12')]({'where':{'role':_0x673a('0x11'),'online':!![],'id':{'$ne':_0xce75fc['id']}}})['then'](function(_0x9534ac){_0x23b896=_0x9534ac;return util[_0x673a('0x13')]();})['then'](function(_0x15ac5a){if(_0x15ac5a&&_0x15ac5a[_0x673a('0x14')]&&_0x23b896>=_0x15ac5a[_0x673a('0x14')]){throw Error('Maximum\x20login\x20has\x20been\x20reached');}_0xeb9174(_0xce75fc);})['catch'](function(_0x4b7f07){_0x1656b2(_0x4b7f07);});});};
\ No newline at end of file
+var _0xf233=['isUndefined','updateAttributes','getLicense','role','agent','User','count','then','agents','Maximum\x20login\x20has\x20been\x20reached','catch','lodash','../mysqldb','./license/util','mail','fax','sms','whatsapp','openchannel','getChannels','isValidChannel','includes','clearBlockUser'];(function(_0x1eb88a,_0x2f76fd){var _0x283b7a=function(_0x1bf545){while(--_0x1bf545){_0x1eb88a['push'](_0x1eb88a['shift']());}};_0x283b7a(++_0x2f76fd);}(_0xf233,0x136));var _0x3f23=function(_0x24b792,_0xcc2a4d){_0x24b792=_0x24b792-0x0;var _0x4a85e1=_0xf233[_0x24b792];return _0x4a85e1;};'use strict';var _=require(_0x3f23('0x0'));var BPromise=require('bluebird');var db=require(_0x3f23('0x1'))['db'];var util=require(_0x3f23('0x2'));var channels=['voice',_0x3f23('0x3'),'chat',_0x3f23('0x4'),_0x3f23('0x5'),_0x3f23('0x6'),_0x3f23('0x7')];exports[_0x3f23('0x8')]=function(){return channels;};exports[_0x3f23('0x9')]=function(_0x83eaad){_0x83eaad=_0x83eaad['toLowerCase']();return _[_0x3f23('0xa')](channels,_0x83eaad);};exports[_0x3f23('0xb')]=function(_0x2efc8e,_0x43417b,_0x17aabd,_0x18ac72){var _0x5f4953={'loginAttempts':_0x43417b,'blocked':_0x17aabd};if(!_[_0x3f23('0xc')](_0x18ac72)){_0x5f4953['blockedAt']=_0x18ac72;}return _0x2efc8e[_0x3f23('0xd')](_0x5f4953);};exports[_0x3f23('0xe')]=function(_0x29e3b1){return new BPromise(function(_0xa0bc2b,_0x89eb5b){var _0x5bb326=0x0;if(_0x29e3b1[_0x3f23('0xf')]!==_0x3f23('0x10')){_0xa0bc2b(_0x29e3b1);}db[_0x3f23('0x11')][_0x3f23('0x12')]({'where':{'role':_0x3f23('0x10'),'online':!![],'id':{'$ne':_0x29e3b1['id']}}})[_0x3f23('0x13')](function(_0x4f5543){_0x5bb326=_0x4f5543;return util['getLicense']();})[_0x3f23('0x13')](function(_0x382dd4){if(_0x382dd4&&_0x382dd4[_0x3f23('0x14')]&&_0x5bb326>=_0x382dd4[_0x3f23('0x14')]){throw Error(_0x3f23('0x15'));}_0xa0bc2b(_0x29e3b1);})[_0x3f23('0x16')](function(_0x3358b0){_0x89eb5b(_0x3358b0);});});};
\ No newline at end of file
index 7fbdf21..ac0e025 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3979=['send','404','status','render','json'];(function(_0x26042f,_0x144649){var _0x2295c6=function(_0x39d16b){while(--_0x39d16b){_0x26042f['push'](_0x26042f['shift']());}};_0x2295c6(++_0x144649);}(_0x3979,0x114));var _0x9397=function(_0x2ad978,_0xb08d0e){_0x2ad978=_0x2ad978-0x0;var _0x1b0a7a=_0x3979[_0x2ad978];return _0x1b0a7a;};'use strict';module['exports'][0x194]=function pageNotFound(_0x3eb931,_0xce1725){var _0x2948b2=_0x9397('0x0');var _0x223095=0x194;var _0x356149={'status':_0x223095};_0xce1725['status'](_0x356149[_0x9397('0x1')]);_0xce1725[_0x9397('0x2')](_0x2948b2,{},function(_0x1ba049,_0x47fb81){if(_0x1ba049){return _0xce1725[_0x9397('0x1')](_0x356149[_0x9397('0x1')])[_0x9397('0x3')](_0x356149);}_0xce1725[_0x9397('0x4')](_0x47fb81);});};
\ No newline at end of file
+var _0x8bec=['render','send','exports','status'];(function(_0x3af2a6,_0x407540){var _0x4eaa15=function(_0x193ee4){while(--_0x193ee4){_0x3af2a6['push'](_0x3af2a6['shift']());}};_0x4eaa15(++_0x407540);}(_0x8bec,0x6e));var _0xc8be=function(_0xb05e5f,_0x58f114){_0xb05e5f=_0xb05e5f-0x0;var _0x4e4fa5=_0x8bec[_0xb05e5f];return _0x4e4fa5;};'use strict';module[_0xc8be('0x0')][0x194]=function pageNotFound(_0xa6272f,_0x1ce28a){var _0x66a07e='404';var _0x238bf8=0x194;var _0x377f23={'status':_0x238bf8};_0x1ce28a[_0xc8be('0x1')](_0x377f23[_0xc8be('0x1')]);_0x1ce28a[_0xc8be('0x2')](_0x66a07e,{},function(_0x1b827b,_0x5376a8){if(_0x1b827b){return _0x1ce28a[_0xc8be('0x1')](_0x377f23['status'])['json'](_0x377f23);}_0x1ce28a[_0xc8be('0x3')](_0x5376a8);});};
\ No newline at end of file
index 368af6c..bcc19ba 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3da5=['../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','../api/chatQueue/chatQueue.model','../api/chatGroup/chatGroup.model','ChatProactiveAction','CmCompany','../api/cmCompany/cmCompany.model','../api/cmContact/cmContact.model','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','Action','../api/action/action.model','Automation','../api/automation/automation.model','CannedAnswer','Disposition','../api/disposition/disposition.model','../api/condition/condition.model','Interval','../api/interval/interval.model','Pause','../api/pause/pause.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','ContactItemType','../api/contactItemType/contactItemType.model','CmContactHasItem','../api/cmContactHasItem/cmContactHasItem.model','CmHopperAdditionalPhone','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model','Template','Trigger','../api/trigger/trigger.model','../api/integration/integration.model','IntegrationReport','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskField','../api/intZendeskField/intZendeskField.model','../api/intFreshdeskAccount/intFreshdeskAccount.model','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','VtigerField','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','ServicenowField','Dynamics365Account','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','Integration','Network','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','SquareOdbc','SquareProject','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','License','../api/license/license.model','Campaign','../api/campaign/campaign.model','Migration','../api/migration/migration.model','Attachment','Plugin','MailTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','../api/cmList/cmList.model','VoicePrefix','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','../api/userProfileResource/userProfileResource.model','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','UserSetting','../api/user-setting/user-setting.model','UserId','hasOne','userSetting','cascade','hasMany','Recordings','VoiceQueuesRt','HopperFinals','HopperHistory','OpenchannelInteractions','SmsInteractions','FaxInteraction','MailInteractions','WhatsappInteractions','UserNotifications','SenderId','UserProfile','userProfileId','belongsToMany','ChatGroup','Groups','chat_group_has_users','Contacts','CmList','Lists','cm_user_has_lists','user_has_teams','ChatInteractions','user_has_chat_interactions','FaxInteractions','user_has_fax_interactions','user_has_sms_interactions','user_has_whatsapp_interactions','UserVoiceQueue','VoicePrefixes','MailQueues','ChatQueue','ChatQueues','SmsQueues','OpenchannelQueues','ChatWebsites','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','WhatsappAccounts','user_has_whatsapp_accounts','SquareProjects','user_has_square_projects','SpiedAgents','ChanSpyId','VoiceMusicOnHold','Sounds','moh_has_sounds','Members','VoiceQueueId','CmHopper','Hoppers','HopperHistories','CmHopperBlack','HopperBlacks','Trunk','TrunkBackup','belongsTo','IntervalId','mandatoryDispositionPauseId','voice_queues_has_cm_lists','Agents','Teams','Messages','mailbox','mailboxuser','uniqueid','Contact','ContactId','MailAccountId','restrict','CloudProviderId','Answers','Interactions','List','TemplateId','mandatoryDispositionPause','team_has_mail_queues','MailInteractionId','Account','Owner','Tags','mail_interaction_has_tags','ThroughTags','Users','user_has_mail_interactions','CmContact','Interaction','ChatWebsiteId','ChatOfflineMessageId','TagId','MailQueueReport','Dashboard','Items','Dispositions','FaxAccountId','Applications','Exntensions','ListId','FaxInteractionId','AttachmentId','UserFaxQueue','team_has_fax_queues','SmsAccountId','user_has_sms_accounts','sms_interaction_has_tags','SmsInteractionId','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelMessage','OpenchannelInteractionId','openchannel_interaction_has_tags','user_has_openchannel_interactions','OpenchannelQueueId','team_has_openchannel_queues','ProactiveActions','ChatMessage','OpenchannelQueueReport','Agent','Queue','Website','ChatInteractionId','chat_interaction_has_tags','Attachments','team_has_chat_queues','ChatGroupId','CompanyId','Phones','Company','cm_user_has_contacts','cm_contact_has_tags','AdditionalPhones','CmHopperId','CampaignId','OwnerId','All','AutomationAllId','Condition','Any','OneAny','AutomationAnyId','Actions','ParentId','Intervals','Extensions','ChatApplications','FaxApplications','DefaultReportId','CustomReportId','Mohs','fax_interaction_has_tags','whatsapp_interaction_has_tags','ItemType','ItemTypeId','CmContactId','AllConditions','AllCondition','TriggerAllId','AnyConditions','AnyCondition','Fields','MetricId','SalesforceConfiguration','AccountId','SubjectId','Descriptions','DescriptionId','FieldId','Description','Field','Variable','SugarcrmField','VariableId','Configurations','DeskField','int_desk_configuration_has_tags','Subject','Subjects','ZendeskConfiguration','int_zendesk_configuration_has_tags','FreshdeskConfiguration','int_freshdesk_configuration_has_tags','FreshsalesConfiguration','FromId','JscriptyQuestionReport','SessionId','ProjectId','JscriptyProject','VoiceQueues','FaxQueues','team_has_whatsapp_queues','WhatsappQueues','TrunkId','TrunkBackupId','BlackLists','FromUserId','FromAgent','ToUserId','ToAgent','ToQueue','ToMailAccountId','ToAccount','ChatTransferReport','FromAccount','ToChatWebsiteId','FromFaxAccountId','ToFaxQueueId','FromOpenchannelAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','SmsTransferReport','FromSmsAccountId','ToSmsQueueId','ToSmsAccountId','CustomFields','Queues','UserProfileSections','UserProfileResource','WhatsappAccountId','WhatsappMessage','WhatsappApplication','WhatsappInteractionId','WhatsappTransferReport','ToWhatsappAccountId','ToQueueId','WhatsappQueueId','user','Imap','Smtp','exports','sequelize','determine','defaultsDeep','motion2','xcall','xC@LL1234','127.0.0.1','mysql','utf8mb4','name','utf8_general_ci','sequelizeHistory','utf8','database','password','options','User','import','../api/user/user.model','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','VoiceMailMessage','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','../api/trunk/trunk.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','../api/userVoiceQueue/userVoiceQueue.model','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','../api/mailQueueReport/mailQueueReport.model','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue'];(function(_0x10f6a5,_0x5dcbe3){var _0x173b77=function(_0x563458){while(--_0x563458){_0x10f6a5['push'](_0x10f6a5['shift']());}};_0x173b77(++_0x5dcbe3);}(_0x3da5,0x19b));var _0x53da=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x3da5[_0x57b54c];return _0x59cc19;};'use strict';var config=require('../config/environment');var Sequelize=require(_0x53da('0x0'));var _=require('lodash');var jstz=require('jstz');var timezone=jstz[_0x53da('0x1')]();config['sequelize']=_[_0x53da('0x2')](config[_0x53da('0x0')],{'database':_0x53da('0x3'),'username':_0x53da('0x4'),'password':_0x53da('0x5'),'options':{'host':_0x53da('0x6'),'port':0xcea,'dialect':_0x53da('0x7'),'dialectOptions':{'charset':_0x53da('0x8')},'logging':![],'timezone':timezone[_0x53da('0x9')](),'define':{'charset':'utf8','collate':_0x53da('0xa')}}});config[_0x53da('0xb')]=_[_0x53da('0x2')](config['sequelizeHistory'],{'database':_0x53da('0x3'),'username':'xcall','password':_0x53da('0x5'),'options':{'host':_0x53da('0x6'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0x53da('0x8')},'logging':![],'timezone':timezone[_0x53da('0x9')](),'define':{'charset':_0x53da('0xc'),'collate':_0x53da('0xa')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x53da('0x0')][_0x53da('0xd')],config[_0x53da('0x0')]['username'],config[_0x53da('0x0')][_0x53da('0xe')],config['sequelize']['options'])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x53da('0xb')][_0x53da('0xd')],config[_0x53da('0xb')]['username'],config['sequelizeHistory'][_0x53da('0xe')],config[_0x53da('0xb')][_0x53da('0xf')])};db[_0x53da('0x10')]=db[_0x53da('0x0')][_0x53da('0x11')](_0x53da('0x12'));db[_0x53da('0x13')]=db[_0x53da('0x0')]['import'](_0x53da('0x14'));db[_0x53da('0x15')]=db[_0x53da('0x0')][_0x53da('0x11')](_0x53da('0x16'));db[_0x53da('0x17')]=db[_0x53da('0x0')][_0x53da('0x11')](_0x53da('0x18'));db['VoiceMusicOnHold']=db[_0x53da('0x0')][_0x53da('0x11')](_0x53da('0x19'));db[_0x53da('0x1a')]=db[_0x53da('0x0')][_0x53da('0x11')](_0x53da('0x1b'));db[_0x53da('0x1c')]=db['sequelize']['import'](_0x53da('0x1d'));db[_0x53da('0x1e')]=db[_0x53da('0x0')]['import'](_0x53da('0x1f'));db[_0x53da('0x20')]=db[_0x53da('0x0')][_0x53da('0x11')](_0x53da('0x21'));db[_0x53da('0x22')]=db[_0x53da('0x0')][_0x53da('0x11')]('../api/voiceMailMessage/voiceMailMessage.model');db[_0x53da('0x23')]=db[_0x53da('0x0')]['import'](_0x53da('0x24'));db[_0x53da('0x25')]=db[_0x53da('0x0')]['import'](_0x53da('0x26'));db[_0x53da('0x27')]=db[_0x53da('0x0')][_0x53da('0x11')](_0x53da('0x28'));db[_0x53da('0x29')]=db[_0x53da('0x0')][_0x53da('0x11')](_0x53da('0x2a'));db[_0x53da('0x2b')]=db['sequelize'][_0x53da('0x11')](_0x53da('0x2c'));db['Trunk']=db[_0x53da('0x0')]['import'](_0x53da('0x2d'));db[_0x53da('0x2e')]=db[_0x53da('0x0')][_0x53da('0x11')](_0x53da('0x2f'));db[_0x53da('0x30')]=db['sequelize'][_0x53da('0x11')](_0x53da('0x31'));db['UserVoiceQueue']=db[_0x53da('0x0')][_0x53da('0x11')](_0x53da('0x32'));db['UserChatQueue']=db[_0x53da('0x0')][_0x53da('0x11')](_0x53da('0x33'));db[_0x53da('0x34')]=db['sequelize']['import'](_0x53da('0x35'));db['UserFaxQueue']=db[_0x53da('0x0')]['import'](_0x53da('0x36'));db[_0x53da('0x37')]=db[_0x53da('0x0')]['import'](_0x53da('0x38'));db[_0x53da('0x39')]=db[_0x53da('0x0')]['import'](_0x53da('0x3a'));db[_0x53da('0x3b')]=db['sequelize'][_0x53da('0x11')](_0x53da('0x3c'));db[_0x53da('0x3d')]=db['sequelize'][_0x53da('0x11')](_0x53da('0x3e'));db[_0x53da('0x3f')]=db[_0x53da('0x0')]['import'](_0x53da('0x40'));db[_0x53da('0x41')]=db[_0x53da('0x0')]['import'](_0x53da('0x42'));db[_0x53da('0x43')]=db[_0x53da('0x0')][_0x53da('0x11')](_0x53da('0x44'));db[_0x53da('0x45')]=db[_0x53da('0x0')][_0x53da('0x11')](_0x53da('0x46'));db[_0x53da('0x47')]=db[_0x53da('0x0')][_0x53da('0x11')]('../api/mailInteraction/mailInteraction.model');db[_0x53da('0x48')]=db['sequelize'][_0x53da('0x11')](_0x53da('0x49'));db[_0x53da('0x4a')]=db[_0x53da('0x0')]['import'](_0x53da('0x4b'));db['MailQueueReport']=db[_0x53da('0x0')][_0x53da('0x11')](_0x53da('0x4c'));db['Dashboard']=db[_0x53da('0x0')]['import'](_0x53da('0x4d'));db[_0x53da('0x4e')]=db[_0x53da('0x0')]['import'](_0x53da('0x4f'));db[_0x53da('0x50')]=db['sequelize'][_0x53da('0x11')](_0x53da('0x51'));db[_0x53da('0x52')]=db[_0x53da('0x0')][_0x53da('0x11')](_0x53da('0x53'));db['FaxInteraction']=db[_0x53da('0x0')][_0x53da('0x11')]('../api/faxInteraction/faxInteraction.model');db[_0x53da('0x54')]=db[_0x53da('0x0')][_0x53da('0x11')](_0x53da('0x55'));db[_0x53da('0x56')]=db['sequelize']['import'](_0x53da('0x57'));db[_0x53da('0x58')]=db[_0x53da('0x0')][_0x53da('0x11')](_0x53da('0x59'));db[_0x53da('0x5a')]=db[_0x53da('0x0')][_0x53da('0x11')]('../api/smsAccount/smsAccount.model');db[_0x53da('0x5b')]=db['sequelize'][_0x53da('0x11')](_0x53da('0x5c'));db[_0x53da('0x5d')]=db['sequelize'][_0x53da('0x11')](_0x53da('0x5e'));db[_0x53da('0x5f')]=db[_0x53da('0x0')]['import']('../api/smsMessage/smsMessage.model');db[_0x53da('0x60')]=db[_0x53da('0x0')][_0x53da('0x11')](_0x53da('0x61'));db[_0x53da('0x62')]=db[_0x53da('0x0')][_0x53da('0x11')](_0x53da('0x63'));db[_0x53da('0x64')]=db['sequelize'][_0x53da('0x11')](_0x53da('0x65'));db[_0x53da('0x66')]=db['sequelize']['import']('../api/openchannelInteraction/openchannelInteraction.model');db['OpenchannelMessage']=db['sequelize'][_0x53da('0x11')](_0x53da('0x67'));db[_0x53da('0x68')]=db[_0x53da('0x0')][_0x53da('0x11')](_0x53da('0x69'));db[_0x53da('0x6a')]=db['sequelize'][_0x53da('0x11')](_0x53da('0x6b'));db['OpenchannelQueueReport']=db[_0x53da('0x0')][_0x53da('0x11')](_0x53da('0x6c'));db[_0x53da('0x6d')]=db['sequelize'][_0x53da('0x11')](_0x53da('0x6e'));db[_0x53da('0x6f')]=db[_0x53da('0x0')][_0x53da('0x11')](_0x53da('0x70'));db['ChatMessage']=db[_0x53da('0x0')][_0x53da('0x11')]('../api/chatMessage/chatMessage.model');db[_0x53da('0x71')]=db['sequelize'][_0x53da('0x11')](_0x53da('0x72'));db['ChatQueue']=db[_0x53da('0x0')][_0x53da('0x11')](_0x53da('0x73'));db['ChatGroup']=db[_0x53da('0x0')][_0x53da('0x11')](_0x53da('0x74'));db[_0x53da('0x75')]=db[_0x53da('0x0')][_0x53da('0x11')]('../api/chatProactiveAction/chatProactiveAction.model');db[_0x53da('0x76')]=db['sequelize']['import'](_0x53da('0x77'));db['CmContact']=db[_0x53da('0x0')][_0x53da('0x11')](_0x53da('0x78'));db['CmHopper']=db[_0x53da('0x0')]['import']('../api/cmHopper/cmHopper.model');db['CmHopperBlack']=db[_0x53da('0x0')][_0x53da('0x11')](_0x53da('0x79'));db[_0x53da('0x7a')]=db[_0x53da('0x0')][_0x53da('0x11')](_0x53da('0x7b'));db[_0x53da('0x7c')]=db[_0x53da('0x0')][_0x53da('0x11')](_0x53da('0x7d'));db[_0x53da('0x7e')]=db[_0x53da('0x0')][_0x53da('0x11')](_0x53da('0x7f'));db[_0x53da('0x80')]=db['sequelize']['import']('../api/cmCustomField/cmCustomField.model');db[_0x53da('0x81')]=db['sequelize']['import'](_0x53da('0x82'));db[_0x53da('0x83')]=db['sequelize'][_0x53da('0x11')](_0x53da('0x84'));db[_0x53da('0x85')]=db[_0x53da('0x0')][_0x53da('0x11')]('../api/cannedAnswer/cannedAnswer.model');db[_0x53da('0x86')]=db[_0x53da('0x0')][_0x53da('0x11')](_0x53da('0x87'));db['Condition']=db[_0x53da('0x0')][_0x53da('0x11')](_0x53da('0x88'));db[_0x53da('0x89')]=db[_0x53da('0x0')]['import'](_0x53da('0x8a'));db[_0x53da('0x8b')]=db[_0x53da('0x0')]['import'](_0x53da('0x8c'));db['Cdr']=db[_0x53da('0x0')][_0x53da('0x11')]('../api/cdr/cdr.model');db[_0x53da('0x8d')]=db['sequelize'][_0x53da('0x11')](_0x53da('0x8e'));db[_0x53da('0x8f')]=db[_0x53da('0x0')][_0x53da('0x11')](_0x53da('0x90'));db[_0x53da('0x91')]=db['sequelize'][_0x53da('0x11')](_0x53da('0x92'));db[_0x53da('0x93')]=db[_0x53da('0x0')][_0x53da('0x11')]('../api/tag/tag.model');db[_0x53da('0x94')]=db[_0x53da('0x0')][_0x53da('0x11')](_0x53da('0x95'));db[_0x53da('0x96')]=db[_0x53da('0x0')]['import'](_0x53da('0x97'));db[_0x53da('0x98')]=db[_0x53da('0x0')]['import'](_0x53da('0x99'));db[_0x53da('0x9a')]=db[_0x53da('0x0')][_0x53da('0x11')]('../api/template/template.model');db[_0x53da('0x9b')]=db['sequelize'][_0x53da('0x11')](_0x53da('0x9c'));db['Variable']=db[_0x53da('0x0')]['import']('../api/variable/variable.model');db['Integration']=db[_0x53da('0x0')][_0x53da('0x11')](_0x53da('0x9d'));db[_0x53da('0x9e')]=db['sequelize']['import']('../api/integrationReport/integrationReport.model');db[_0x53da('0x9f')]=db[_0x53da('0x0')][_0x53da('0x11')](_0x53da('0xa0'));db[_0x53da('0xa1')]=db[_0x53da('0x0')][_0x53da('0x11')](_0x53da('0xa2'));db[_0x53da('0xa3')]=db[_0x53da('0x0')][_0x53da('0x11')](_0x53da('0xa4'));db[_0x53da('0xa5')]=db[_0x53da('0x0')][_0x53da('0x11')](_0x53da('0xa6'));db[_0x53da('0xa7')]=db[_0x53da('0x0')][_0x53da('0x11')](_0x53da('0xa8'));db['AnalyticTreeReport']=db[_0x53da('0x0')][_0x53da('0x11')]('../api/analyticTreeReport/analyticTreeReport.model');db[_0x53da('0xa9')]=db['sequelize'][_0x53da('0x11')](_0x53da('0xaa'));db['SalesforceConfiguration']=db[_0x53da('0x0')][_0x53da('0x11')]('../api/intSalesforceConfiguration/intSalesforceConfiguration.model');db[_0x53da('0xab')]=db[_0x53da('0x0')][_0x53da('0x11')](_0x53da('0xac'));db[_0x53da('0xad')]=db[_0x53da('0x0')][_0x53da('0x11')](_0x53da('0xae'));db[_0x53da('0xaf')]=db['sequelize'][_0x53da('0x11')](_0x53da('0xb0'));db['SugarcrmField']=db[_0x53da('0x0')]['import'](_0x53da('0xb1'));db[_0x53da('0xb2')]=db['sequelize']['import']('../api/intDeskAccount/intDeskAccount.model');db[_0x53da('0xb3')]=db[_0x53da('0x0')]['import'](_0x53da('0xb4'));db['DeskField']=db['sequelize'][_0x53da('0x11')]('../api/intDeskField/intDeskField.model');db[_0x53da('0xb5')]=db[_0x53da('0x0')]['import'](_0x53da('0xb6'));db[_0x53da('0xb7')]=db['sequelize'][_0x53da('0x11')]('../api/intZohoConfiguration/intZohoConfiguration.model');db[_0x53da('0xb8')]=db[_0x53da('0x0')][_0x53da('0x11')](_0x53da('0xb9'));db[_0x53da('0xba')]=db['sequelize']['import'](_0x53da('0xbb'));db['ZendeskConfiguration']=db[_0x53da('0x0')][_0x53da('0x11')]('../api/intZendeskConfiguration/intZendeskConfiguration.model');db[_0x53da('0xbc')]=db['sequelize'][_0x53da('0x11')](_0x53da('0xbd'));db['FreshdeskAccount']=db[_0x53da('0x0')][_0x53da('0x11')](_0x53da('0xbe'));db['FreshdeskConfiguration']=db['sequelize'][_0x53da('0x11')](_0x53da('0xbf'));db[_0x53da('0xc0')]=db[_0x53da('0x0')][_0x53da('0x11')](_0x53da('0xc1'));db[_0x53da('0xc2')]=db[_0x53da('0x0')][_0x53da('0x11')](_0x53da('0xc3'));db[_0x53da('0xc4')]=db['sequelize'][_0x53da('0x11')]('../api/intVtigerConfiguration/intVtigerConfiguration.model');db[_0x53da('0xc5')]=db[_0x53da('0x0')][_0x53da('0x11')]('../api/intVtigerField/intVtigerField.model');db[_0x53da('0xc6')]=db['sequelize'][_0x53da('0x11')](_0x53da('0xc7'));db[_0x53da('0xc8')]=db[_0x53da('0x0')][_0x53da('0x11')]('../api/intServicenowConfiguration/intServicenowConfiguration.model');db[_0x53da('0xc9')]=db[_0x53da('0x0')]['import']('../api/intServicenowField/intServicenowField.model');db[_0x53da('0xca')]=db[_0x53da('0x0')][_0x53da('0x11')]('../api/intDynamics365Account/intDynamics365Account.model');db[_0x53da('0xcb')]=db[_0x53da('0x0')][_0x53da('0x11')](_0x53da('0xcc'));db[_0x53da('0xcd')]=db[_0x53da('0x0')][_0x53da('0x11')](_0x53da('0xce'));db[_0x53da('0xcf')]=db[_0x53da('0x0')]['import']('../api/intFreshsalesAccount/intFreshsalesAccount.model');db['FreshsalesConfiguration']=db['sequelize'][_0x53da('0x11')](_0x53da('0xd0'));db[_0x53da('0xd1')]=db[_0x53da('0x0')][_0x53da('0x11')]('../api/intFreshsalesField/intFreshsalesField.model');db[_0x53da('0xd2')]=db[_0x53da('0x0')][_0x53da('0x11')]('../api/integration/integration.model');db[_0x53da('0xd3')]=db[_0x53da('0x0')][_0x53da('0x11')](_0x53da('0xd4'));db[_0x53da('0xd5')]=db[_0x53da('0x0')]['import'](_0x53da('0xd6'));db[_0x53da('0xd7')]=db['sequelize'][_0x53da('0x11')](_0x53da('0xd8'));db[_0x53da('0xd9')]=db['sequelize'][_0x53da('0x11')](_0x53da('0xda'));db['JscriptyQuestionReport']=db[_0x53da('0x0')]['import']('../api/jscriptyQuestionReport/jscriptyQuestionReport.model');db[_0x53da('0xdb')]=db[_0x53da('0x0')][_0x53da('0x11')](_0x53da('0xdc'));db[_0x53da('0xdd')]=db['sequelize']['import'](_0x53da('0xde'));db['SquareReport']=db[_0x53da('0x0')]['import'](_0x53da('0xdf'));db[_0x53da('0xe0')]=db[_0x53da('0x0')]['import'](_0x53da('0xe1'));db['JscriptyProject']=db['sequelize'][_0x53da('0x11')](_0x53da('0xe2'));db[_0x53da('0xe3')]=db[_0x53da('0x0')][_0x53da('0x11')](_0x53da('0xe4'));db[_0x53da('0xe5')]=db[_0x53da('0x0')][_0x53da('0x11')]('../api/squareOdbc/squareOdbc.model');db[_0x53da('0xe6')]=db[_0x53da('0x0')]['import'](_0x53da('0xe7'));db[_0x53da('0xe8')]=db[_0x53da('0x0')][_0x53da('0x11')](_0x53da('0xe9'));db[_0x53da('0xea')]=db[_0x53da('0x0')][_0x53da('0x11')](_0x53da('0xeb'));db[_0x53da('0xec')]=db[_0x53da('0x0')][_0x53da('0x11')](_0x53da('0xed'));db[_0x53da('0xee')]=db['sequelize'][_0x53da('0x11')](_0x53da('0xef'));db[_0x53da('0xf0')]=db[_0x53da('0x0')][_0x53da('0x11')](_0x53da('0xf1'));db[_0x53da('0xf2')]=db[_0x53da('0x0')][_0x53da('0x11')](_0x53da('0xf3'));db[_0x53da('0xf4')]=db[_0x53da('0x0')][_0x53da('0x11')]('../api/attachment/attachment.model');db[_0x53da('0xf5')]=db['sequelize'][_0x53da('0x11')]('../api/plugin/plugin.model');db[_0x53da('0xf6')]=db[_0x53da('0x0')][_0x53da('0x11')]('../api/mailTransferReport/mailTransferReport.model');db['ChatTransferReport']=db['sequelize'][_0x53da('0x11')](_0x53da('0xf7'));db[_0x53da('0xf8')]=db[_0x53da('0x0')]['import']('../api/faxTransferReport/faxTransferReport.model');db[_0x53da('0xf9')]=db['sequelize'][_0x53da('0x11')](_0x53da('0xfa'));db['SmsTransferReport']=db[_0x53da('0x0')][_0x53da('0x11')]('../api/smsTransferReport/smsTransferReport.model');db['CmList']=db[_0x53da('0x0')][_0x53da('0x11')](_0x53da('0xfb'));db[_0x53da('0xfc')]=db[_0x53da('0x0')][_0x53da('0x11')]('../api/voicePrefix/voicePrefix.model');db['UserProfile']=db[_0x53da('0x0')][_0x53da('0x11')](_0x53da('0xfd'));db[_0x53da('0xfe')]=db[_0x53da('0x0')][_0x53da('0x11')](_0x53da('0xff'));db['UserProfileResource']=db[_0x53da('0x0')]['import'](_0x53da('0x100'));db['UserNotification']=db['sequelize'][_0x53da('0x11')](_0x53da('0x101'));db[_0x53da('0x102')]=db[_0x53da('0x0')][_0x53da('0x11')](_0x53da('0x103'));db['WhatsappApplication']=db[_0x53da('0x0')][_0x53da('0x11')](_0x53da('0x104'));db[_0x53da('0x105')]=db[_0x53da('0x0')][_0x53da('0x11')](_0x53da('0x106'));db['WhatsappMessage']=db['sequelize'][_0x53da('0x11')](_0x53da('0x107'));db[_0x53da('0x108')]=db[_0x53da('0x0')]['import']('../api/whatsappQueueReport/whatsappQueueReport.model');db['WhatsappTransferReport']=db['sequelize'][_0x53da('0x11')]('../api/whatsappTransferReport/whatsappTransferReport.model');db[_0x53da('0x109')]=db[_0x53da('0x0')]['import'](_0x53da('0x10a'));db[_0x53da('0x10b')]=db[_0x53da('0x0')][_0x53da('0x11')](_0x53da('0x10c'));db[_0x53da('0x10d')]=db[_0x53da('0x0')][_0x53da('0x11')](_0x53da('0x10e'));db[_0x53da('0x10f')]=db['sequelize'][_0x53da('0x11')](_0x53da('0x110'));db[_0x53da('0x111')]=db[_0x53da('0x0')]['import'](_0x53da('0x112'));db[_0x53da('0x113')]=db[_0x53da('0x0')][_0x53da('0x11')](_0x53da('0x114'));db[_0x53da('0x10')]['hasOne'](db[_0x53da('0x20')],{'as':_0x53da('0x20'),'onDelete':'cascade','foreignKey':_0x53da('0x115')});db[_0x53da('0x10')][_0x53da('0x116')](db[_0x53da('0x113')],{'as':_0x53da('0x117'),'onDelete':_0x53da('0x118'),'foreignKey':_0x53da('0x115')});db[_0x53da('0x10')][_0x53da('0x119')](db[_0x53da('0x1c')],{'as':_0x53da('0x11a'),'foreignKey':_0x53da('0x115')});db[_0x53da('0x10')][_0x53da('0x119')](db['UserVoiceQueueRt'],{'as':_0x53da('0x11b'),'foreignKey':_0x53da('0x115')});db['User'][_0x53da('0x119')](db['VoiceExtension'],{'as':'Extensions','onDelete':_0x53da('0x118'),'hooks':!![]});db[_0x53da('0x10')][_0x53da('0x119')](db['CmHopperFinal'],{'as':_0x53da('0x11c'),'foreignKey':_0x53da('0x115')});db[_0x53da('0x10')][_0x53da('0x119')](db[_0x53da('0x7c')],{'as':_0x53da('0x11d'),'foreignKey':'UserId'});db[_0x53da('0x10')]['hasMany'](db[_0x53da('0x7e')],{'as':_0x53da('0x7e'),'foreignKey':_0x53da('0x115')});db[_0x53da('0x10')][_0x53da('0x119')](db[_0x53da('0x66')],{'as':_0x53da('0x11e'),'foreignKey':_0x53da('0x115')});db['User'][_0x53da('0x119')](db['ChatInteraction'],{'as':'ChatInteractions','foreignKey':_0x53da('0x115')});db[_0x53da('0x10')]['hasMany'](db[_0x53da('0x5d')],{'as':_0x53da('0x11f'),'foreignKey':'UserId'});db[_0x53da('0x10')][_0x53da('0x119')](db[_0x53da('0x120')],{'as':'FaxInteractions','foreignKey':_0x53da('0x115')});db[_0x53da('0x10')][_0x53da('0x119')](db['MailInteraction'],{'as':_0x53da('0x121'),'foreignKey':_0x53da('0x115')});db[_0x53da('0x10')][_0x53da('0x119')](db[_0x53da('0x105')],{'as':_0x53da('0x122'),'foreignKey':'UserId'});db['User'][_0x53da('0x119')](db['UserNotification'],{'as':_0x53da('0x123'),'foreignKey':_0x53da('0x124')});db[_0x53da('0x10')]['belongsTo'](db[_0x53da('0x125')],{'as':'UserProfile','foreignKey':_0x53da('0x126')});db[_0x53da('0x10')][_0x53da('0x127')](db[_0x53da('0x128')],{'as':_0x53da('0x129'),'through':_0x53da('0x12a')});db[_0x53da('0x10')]['belongsToMany'](db['CmContact'],{'as':_0x53da('0x12b'),'through':'cm_user_has_contacts'});db[_0x53da('0x10')][_0x53da('0x127')](db[_0x53da('0x12c')],{'as':_0x53da('0x12d'),'through':_0x53da('0x12e')});db[_0x53da('0x10')]['belongsToMany'](db[_0x53da('0xec')],{'through':_0x53da('0x12f')});db[_0x53da('0x10')][_0x53da('0x127')](db[_0x53da('0x47')],{'as':'MailInteractions','through':'user_has_mail_interactions'});db[_0x53da('0x10')][_0x53da('0x127')](db[_0x53da('0x6f')],{'as':_0x53da('0x130'),'through':_0x53da('0x131')});db['User'][_0x53da('0x127')](db[_0x53da('0x120')],{'as':_0x53da('0x132'),'through':_0x53da('0x133')});db[_0x53da('0x10')][_0x53da('0x127')](db[_0x53da('0x5d')],{'as':_0x53da('0x11f'),'through':_0x53da('0x134')});db['User'][_0x53da('0x127')](db[_0x53da('0x66')],{'as':_0x53da('0x11e'),'through':'user_has_openchannel_interactions'});db[_0x53da('0x10')][_0x53da('0x127')](db[_0x53da('0x105')],{'as':_0x53da('0x122'),'through':_0x53da('0x135')});db[_0x53da('0x10')][_0x53da('0x127')](db[_0x53da('0x1a')],{'as':'VoiceQueues','through':_0x53da('0x136'),'required':![]});db['User'][_0x53da('0x127')](db[_0x53da('0xfc')],{'as':_0x53da('0x137'),'through':'UserVoicePrefix','required':![]});db[_0x53da('0x10')][_0x53da('0x127')](db[_0x53da('0x43')],{'as':_0x53da('0x138'),'through':_0x53da('0x34'),'required':![]});db['User'][_0x53da('0x127')](db[_0x53da('0x139')],{'as':_0x53da('0x13a'),'through':'UserChatQueue','required':![],'hooks':!![]});db[_0x53da('0x10')][_0x53da('0x127')](db['FaxQueue'],{'as':'FaxQueues','through':'UserFaxQueue','required':![]});db[_0x53da('0x10')][_0x53da('0x127')](db[_0x53da('0x60')],{'as':_0x53da('0x13b'),'through':_0x53da('0x37'),'required':![]});db[_0x53da('0x10')][_0x53da('0x127')](db['OpenchannelQueue'],{'as':_0x53da('0x13c'),'through':_0x53da('0x39'),'required':![]});db[_0x53da('0x10')][_0x53da('0x127')](db[_0x53da('0x109')],{'as':'WhatsappQueues','through':'UserWhatsappQueue','required':![]});db[_0x53da('0x10')][_0x53da('0x127')](db['CmList'],{'through':_0x53da('0x12e')});db[_0x53da('0x10')][_0x53da('0x127')](db[_0x53da('0x6a')],{'as':_0x53da('0x13d'),'through':'user_has_chat_websites'});db[_0x53da('0x10')]['belongsToMany'](db['FaxAccount'],{'as':'FaxAccounts','through':_0x53da('0x13e')});db[_0x53da('0x10')][_0x53da('0x127')](db['MailAccount'],{'as':_0x53da('0x13f'),'through':_0x53da('0x140')});db[_0x53da('0x10')][_0x53da('0x127')](db['OpenchannelAccount'],{'as':_0x53da('0x141'),'through':_0x53da('0x142')});db[_0x53da('0x10')][_0x53da('0x127')](db[_0x53da('0x5a')],{'as':_0x53da('0x143'),'through':'user_has_sms_accounts'});db['User']['belongsToMany'](db[_0x53da('0x102')],{'as':_0x53da('0x144'),'through':_0x53da('0x145')});db[_0x53da('0x10')][_0x53da('0x127')](db[_0x53da('0xe6')],{'as':_0x53da('0x146'),'through':_0x53da('0x147')});db[_0x53da('0x13')]['hasMany'](db['VoiceExtension'],{'as':_0x53da('0x148'),'onDelete':_0x53da('0x118'),'foreignKey':_0x53da('0x149')});db['VoiceContext']['hasMany'](db[_0x53da('0x17')],{'onDelete':'cascade'});db[_0x53da('0x17')]['hasMany'](db[_0x53da('0x17')],{'as':'Applications','onDelete':'cascade'});db[_0x53da('0x14a')][_0x53da('0x127')](db[_0x53da('0x91')],{'as':_0x53da('0x14b'),'through':_0x53da('0x14c')});db[_0x53da('0x1a')][_0x53da('0x119')](db['UserVoiceQueueRt'],{'as':_0x53da('0x14d'),'foreignKey':_0x53da('0x14e')});db[_0x53da('0x1a')]['hasMany'](db[_0x53da('0x14f')],{'as':_0x53da('0x150'),'foreignKey':'VoiceQueueId'});db[_0x53da('0x1a')]['hasMany'](db[_0x53da('0x7a')],{'as':_0x53da('0x11c'),'foreignKey':_0x53da('0x14e')});db[_0x53da('0x1a')][_0x53da('0x119')](db['CmHopperHistory'],{'as':_0x53da('0x151'),'foreignKey':'VoiceQueueId'});db[_0x53da('0x1a')][_0x53da('0x119')](db[_0x53da('0x7e')],{'as':'ReportAgentPreview','foreignKey':_0x53da('0x14e')});db[_0x53da('0x1a')][_0x53da('0x119')](db[_0x53da('0x152')],{'as':_0x53da('0x153'),'foreignKey':'VoiceQueueId'});db[_0x53da('0x1a')][_0x53da('0x119')](db[_0x53da('0xdb')],{'as':'JscriptySessions','foreignKey':_0x53da('0x14e')});db[_0x53da('0x1a')]['belongsTo'](db[_0x53da('0x154')],{'as':_0x53da('0x154'),'foreignKey':'TrunkId'});db['VoiceQueue']['belongsTo'](db[_0x53da('0x154')],{'as':_0x53da('0x155'),'foreignKey':'TrunkBackupId'});db[_0x53da('0x1a')][_0x53da('0x156')](db[_0x53da('0x89')],{'as':_0x53da('0x89'),'foreignKey':_0x53da('0x157')});db[_0x53da('0x1a')][_0x53da('0x156')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x53da('0x158')});db[_0x53da('0x1a')][_0x53da('0x127')](db[_0x53da('0x12c')],{'as':_0x53da('0x12d'),'through':_0x53da('0x159')});db[_0x53da('0x1a')][_0x53da('0x127')](db[_0x53da('0x10')],{'as':_0x53da('0x15a'),'through':'UserVoiceQueue'});db[_0x53da('0x1a')][_0x53da('0x127')](db['Team'],{'as':_0x53da('0x15b'),'through':_0x53da('0x10d')});db[_0x53da('0x1a')][_0x53da('0x127')](db[_0x53da('0x12c')],{'as':'BlackLists','through':'voice_queues_has_cm_blacklists'});db[_0x53da('0x1c')][_0x53da('0x156')](db[_0x53da('0x10')],{'as':_0x53da('0x10'),'foreignKey':_0x53da('0x115')});db['ScreenRecording'][_0x53da('0x156')](db[_0x53da('0x10')],{'as':_0x53da('0x10'),'foreignKey':_0x53da('0x115')});db[_0x53da('0x20')][_0x53da('0x119')](db['VoiceMailMessage'],{'as':_0x53da('0x15c'),'onDelete':'cascade','foreignKey':'mailboxuser','sourceKey':_0x53da('0x15d')});db[_0x53da('0x22')]['belongsTo'](db[_0x53da('0x20')],{'foreignKey':_0x53da('0x15e'),'targetKey':_0x53da('0x15d')});db[_0x53da('0x23')]['hasMany'](db[_0x53da('0x29')],{'as':'QueueCalls','foreignKey':_0x53da('0x15f'),'constraints':![]});db['VoiceCallReport'][_0x53da('0x119')](db[_0x53da('0x27')],{'as':'AgentReports','foreignKey':_0x53da('0x15f'),'constraints':![]});db['VoiceCallReport'][_0x53da('0x156')](db[_0x53da('0x10')],{'as':_0x53da('0x10'),'foreignKey':_0x53da('0x115')});db['VoiceCallReport'][_0x53da('0x156')](db['CmContact'],{'as':_0x53da('0x160'),'foreignKey':_0x53da('0x161')});db[_0x53da('0x3d')]['belongsTo'](db['MailAccount'],{'as':'MailAccount','foreignKey':_0x53da('0x162')});db['MailServerIn'][_0x53da('0x156')](db['CloudProvider'],{'as':'CloudProvider','foreignKey':'CloudProviderId','onDelete':_0x53da('0x163')});db[_0x53da('0x3f')]['belongsTo'](db[_0x53da('0x41')],{'as':'MailAccount','foreignKey':_0x53da('0x162')});db['MailServerOut'][_0x53da('0x156')](db[_0x53da('0x10b')],{'as':_0x53da('0x10b'),'foreignKey':_0x53da('0x164'),'onDelete':_0x53da('0x163')});db[_0x53da('0x41')]['hasOne'](db['MailServerIn'],{'as':'Imap','onDelete':_0x53da('0x118')});db[_0x53da('0x41')]['hasOne'](db[_0x53da('0x3f')],{'as':'Smtp','onDelete':_0x53da('0x118')});db['MailAccount'][_0x53da('0x119')](db[_0x53da('0x86')],{'as':'Dispositions','foreignKey':'MailAccountId','onDelete':'cascade'});db[_0x53da('0x41')][_0x53da('0x119')](db['CannedAnswer'],{'as':_0x53da('0x165'),'foreignKey':_0x53da('0x162')});db['MailAccount'][_0x53da('0x119')](db[_0x53da('0x48')],{'as':_0x53da('0x15c'),'foreignKey':_0x53da('0x162')});db[_0x53da('0x41')][_0x53da('0x119')](db[_0x53da('0x47')],{'as':_0x53da('0x166')});db[_0x53da('0x41')][_0x53da('0x119')](db[_0x53da('0x4a')],{'as':'Applications'});db['MailAccount'][_0x53da('0x156')](db[_0x53da('0x12c')],{'as':_0x53da('0x167'),'foreignKey':'ListId'});db[_0x53da('0x41')]['belongsTo'](db['Template'],{'as':'Template','foreignKey':_0x53da('0x168')});db[_0x53da('0x41')][_0x53da('0x156')](db['Pause'],{'as':_0x53da('0x169'),'foreignKey':'mandatoryDispositionPauseId'});db['MailAccount'][_0x53da('0x127')](db[_0x53da('0x10')],{'as':_0x53da('0x15a'),'through':_0x53da('0x140')});db[_0x53da('0x43')][_0x53da('0x127')](db[_0x53da('0x10')],{'as':_0x53da('0x15a'),'through':'UserMailQueue'});db[_0x53da('0x43')]['belongsToMany'](db[_0x53da('0xec')],{'through':_0x53da('0x16a'),'as':_0x53da('0x15b')});db[_0x53da('0x47')][_0x53da('0x119')](db[_0x53da('0x48')],{'as':'Messages','onDelete':'cascade','foreignKey':_0x53da('0x16b')});db[_0x53da('0x47')]['belongsTo'](db[_0x53da('0x41')],{'as':_0x53da('0x16c'),'foreignKey':_0x53da('0x162')});db[_0x53da('0x47')][_0x53da('0x156')](db['CmContact'],{'as':_0x53da('0x160'),'foreignKey':_0x53da('0x161')});db[_0x53da('0x47')][_0x53da('0x156')](db['User'],{'as':_0x53da('0x16d'),'foreignKey':_0x53da('0x115')});db[_0x53da('0x47')]['belongsToMany'](db[_0x53da('0x93')],{'through':'mail_interaction_has_tags','as':_0x53da('0x16e')});db[_0x53da('0x47')]['belongsToMany'](db[_0x53da('0x93')],{'through':_0x53da('0x16f'),'as':_0x53da('0x170')});db[_0x53da('0x47')][_0x53da('0x127')](db['User'],{'as':_0x53da('0x171'),'through':_0x53da('0x172'),'foreignKey':_0x53da('0x16b')});db[_0x53da('0x48')]['hasMany'](db['Attachment'],{'as':'Attachments','onDelete':_0x53da('0x118')});db[_0x53da('0x48')][_0x53da('0x156')](db['User'],{'as':_0x53da('0x10')});db[_0x53da('0x48')][_0x53da('0x156')](db[_0x53da('0x173')],{'onDelete':_0x53da('0x118'),'as':_0x53da('0x160')});db['MailMessage'][_0x53da('0x156')](db[_0x53da('0x47')],{'as':_0x53da('0x174'),'foreignKey':'MailInteractionId'});db[_0x53da('0x48')][_0x53da('0x156')](db[_0x53da('0x41')],{'as':_0x53da('0x16c'),'foreignKey':_0x53da('0x162')});db[_0x53da('0x48')][_0x53da('0x156')](db[_0x53da('0x6a')],{'as':'ChatWebsite','foreignKey':_0x53da('0x175')});db[_0x53da('0x48')][_0x53da('0x156')](db[_0x53da('0x71')],{'as':'ChatOfflineMessage','foreignKey':_0x53da('0x176')});db['MailApplication'][_0x53da('0x156')](db[_0x53da('0x10')],{'onDelete':_0x53da('0x163')});db[_0x53da('0x4a')]['belongsTo'](db[_0x53da('0x43')],{'onDelete':_0x53da('0x163')});db['MailApplication']['belongsTo'](db['MailAccount'],{'onDelete':'restrict'});db[_0x53da('0x4a')][_0x53da('0x156')](db[_0x53da('0x89')],{'onDelete':_0x53da('0x163'),'foreignKey':_0x53da('0x157')});db[_0x53da('0x4a')]['belongsTo'](db['Tag'],{'onDelete':_0x53da('0x163'),'foreignKey':_0x53da('0x177')});db[_0x53da('0x178')][_0x53da('0x156')](db['MailAccount'],{});db[_0x53da('0x178')]['belongsTo'](db[_0x53da('0x12c')],{'as':_0x53da('0x167'),'foreignKey':'ListId'});db['MailQueueReport'][_0x53da('0x156')](db[_0x53da('0x173')],{'as':_0x53da('0x160'),'foreignKey':'ContactId'});db['MailQueueReport'][_0x53da('0x156')](db[_0x53da('0x47')],{});db[_0x53da('0x178')][_0x53da('0x156')](db[_0x53da('0x48')],{});db[_0x53da('0x178')]['belongsTo'](db['User'],{});db[_0x53da('0x178')][_0x53da('0x156')](db['MailQueue'],{});db[_0x53da('0x179')][_0x53da('0x119')](db[_0x53da('0x4e')],{'as':_0x53da('0x17a'),'onDelete':_0x53da('0x118')});db[_0x53da('0x50')][_0x53da('0x119')](db[_0x53da('0x86')],{'as':_0x53da('0x17b'),'foreignKey':_0x53da('0x17c'),'onDelete':_0x53da('0x118')});db[_0x53da('0x50')][_0x53da('0x119')](db['CannedAnswer'],{'as':_0x53da('0x165'),'foreignKey':_0x53da('0x17c')});db[_0x53da('0x50')]['hasMany'](db[_0x53da('0x120')],{'as':'Interactions'});db[_0x53da('0x50')]['hasMany'](db['FaxApplication'],{'as':_0x53da('0x17d')});db['FaxAccount'][_0x53da('0x119')](db[_0x53da('0x17')],{'as':_0x53da('0x17e'),'onDelete':_0x53da('0x118')});db[_0x53da('0x50')]['hasMany'](db[_0x53da('0x54')],{'as':_0x53da('0x15c')});db[_0x53da('0x50')][_0x53da('0x156')](db['Trunk'],{'as':_0x53da('0x154')});db['FaxAccount'][_0x53da('0x156')](db['CmList'],{'as':_0x53da('0x167'),'foreignKey':_0x53da('0x17f')});db[_0x53da('0x50')]['belongsTo'](db['Pause'],{'as':_0x53da('0x169'),'foreignKey':_0x53da('0x158')});db[_0x53da('0x50')]['belongsToMany'](db['User'],{'as':_0x53da('0x15a'),'through':_0x53da('0x13e')});db[_0x53da('0x52')][_0x53da('0x156')](db['User'],{'onDelete':_0x53da('0x163')});db[_0x53da('0x52')][_0x53da('0x156')](db[_0x53da('0x56')],{'onDelete':_0x53da('0x163')});db[_0x53da('0x52')]['belongsTo'](db[_0x53da('0x50')],{'onDelete':_0x53da('0x163')});db[_0x53da('0x52')]['belongsTo'](db['Tag'],{'onDelete':'restrict','foreignKey':_0x53da('0x177')});db['FaxInteraction'][_0x53da('0x119')](db[_0x53da('0x54')],{'as':_0x53da('0x15c'),'onDelete':'cascade','foreignKey':'FaxInteractionId'});db[_0x53da('0x120')]['belongsTo'](db[_0x53da('0x50')],{'as':'Account','foreignKey':_0x53da('0x17c')});db[_0x53da('0x120')][_0x53da('0x156')](db[_0x53da('0x173')],{'as':'Contact','foreignKey':_0x53da('0x161')});db[_0x53da('0x120')][_0x53da('0x156')](db[_0x53da('0x10')],{'as':'Owner','foreignKey':_0x53da('0x115')});db['FaxInteraction']['belongsToMany'](db['Tag'],{'through':'fax_interaction_has_tags','as':_0x53da('0x16e')});db['FaxInteraction'][_0x53da('0x127')](db[_0x53da('0x93')],{'through':'fax_interaction_has_tags','as':_0x53da('0x170')});db['FaxInteraction'][_0x53da('0x127')](db[_0x53da('0x10')],{'as':_0x53da('0x171'),'through':_0x53da('0x133'),'foreignKey':_0x53da('0x180')});db[_0x53da('0x54')][_0x53da('0x156')](db[_0x53da('0x10')],{'onDelete':_0x53da('0x118'),'as':_0x53da('0x10')});db[_0x53da('0x54')]['belongsTo'](db[_0x53da('0x120')],{'as':_0x53da('0x174'),'foreignKey':'FaxInteractionId'});db[_0x53da('0x54')][_0x53da('0x156')](db[_0x53da('0x173')],{'onDelete':_0x53da('0x118'),'as':_0x53da('0x160')});db[_0x53da('0x54')]['belongsTo'](db[_0x53da('0xf4')],{'as':'Attachment','foreignKey':_0x53da('0x181')});db[_0x53da('0x54')][_0x53da('0x156')](db[_0x53da('0x50')],{'as':_0x53da('0x16c'),'foreignKey':'FaxAccountId'});db['FaxQueue'][_0x53da('0x127')](db[_0x53da('0x10')],{'as':'Agents','through':_0x53da('0x182')});db[_0x53da('0x56')][_0x53da('0x127')](db[_0x53da('0xec')],{'through':_0x53da('0x183'),'as':_0x53da('0x15b')});db[_0x53da('0x58')][_0x53da('0x156')](db[_0x53da('0x50')],{});db[_0x53da('0x58')][_0x53da('0x156')](db[_0x53da('0x12c')],{'as':_0x53da('0x167'),'foreignKey':_0x53da('0x17f')});db[_0x53da('0x58')][_0x53da('0x156')](db['CmContact'],{'as':_0x53da('0x160'),'foreignKey':_0x53da('0x161')});db[_0x53da('0x58')]['belongsTo'](db[_0x53da('0x120')],{});db[_0x53da('0x58')][_0x53da('0x156')](db[_0x53da('0x54')],{});db[_0x53da('0x58')][_0x53da('0x156')](db['User'],{});db[_0x53da('0x58')]['belongsTo'](db[_0x53da('0x56')],{});db[_0x53da('0x5a')][_0x53da('0x119')](db[_0x53da('0x86')],{'as':_0x53da('0x17b'),'foreignKey':_0x53da('0x184'),'onDelete':'cascade'});db[_0x53da('0x5a')][_0x53da('0x119')](db['CannedAnswer'],{'as':'Answers','foreignKey':_0x53da('0x184')});db[_0x53da('0x5a')]['hasMany'](db[_0x53da('0x5f')],{'as':_0x53da('0x15c'),'foreignKey':_0x53da('0x184')});db['SmsAccount'][_0x53da('0x119')](db[_0x53da('0x5d')],{'as':'Interactions'});db['SmsAccount'][_0x53da('0x119')](db['SmsApplication'],{'as':_0x53da('0x17d')});db[_0x53da('0x5a')][_0x53da('0x156')](db[_0x53da('0x12c')],{'as':_0x53da('0x167'),'foreignKey':_0x53da('0x17f')});db['SmsAccount'][_0x53da('0x156')](db[_0x53da('0x8b')],{'as':_0x53da('0x169'),'foreignKey':_0x53da('0x158')});db[_0x53da('0x5a')][_0x53da('0x127')](db['User'],{'as':_0x53da('0x15a'),'through':_0x53da('0x185')});db[_0x53da('0x5b')][_0x53da('0x156')](db[_0x53da('0x10')],{'onDelete':_0x53da('0x163')});db[_0x53da('0x5b')][_0x53da('0x156')](db[_0x53da('0x60')],{'onDelete':_0x53da('0x163')});db[_0x53da('0x5b')][_0x53da('0x156')](db['SmsAccount'],{'onDelete':_0x53da('0x163')});db['SmsApplication'][_0x53da('0x156')](db[_0x53da('0x89')],{'onDelete':'restrict','foreignKey':_0x53da('0x157')});db[_0x53da('0x5b')]['belongsTo'](db[_0x53da('0x93')],{'onDelete':_0x53da('0x163'),'foreignKey':_0x53da('0x177')});db['SmsInteraction']['hasMany'](db[_0x53da('0x5f')],{'as':_0x53da('0x15c'),'onDelete':_0x53da('0x118'),'foreignKey':'SmsInteractionId'});db['SmsInteraction']['belongsTo'](db[_0x53da('0x5a')],{'as':_0x53da('0x16c'),'foreignKey':_0x53da('0x184')});db[_0x53da('0x5d')][_0x53da('0x156')](db[_0x53da('0x173')],{'as':_0x53da('0x160'),'foreignKey':_0x53da('0x161')});db[_0x53da('0x5d')][_0x53da('0x156')](db[_0x53da('0x10')],{'as':_0x53da('0x16d'),'foreignKey':'UserId'});db['SmsInteraction'][_0x53da('0x127')](db[_0x53da('0x93')],{'through':_0x53da('0x186'),'as':_0x53da('0x16e')});db[_0x53da('0x5d')][_0x53da('0x127')](db[_0x53da('0x93')],{'through':_0x53da('0x186'),'as':'ThroughTags'});db[_0x53da('0x5d')][_0x53da('0x127')](db[_0x53da('0x10')],{'as':'Users','through':_0x53da('0x134'),'foreignKey':_0x53da('0x187')});db[_0x53da('0x5f')][_0x53da('0x156')](db['User'],{'as':'User'});db[_0x53da('0x5f')][_0x53da('0x156')](db[_0x53da('0x173')],{'onDelete':_0x53da('0x118'),'as':_0x53da('0x160')});db['SmsMessage'][_0x53da('0x156')](db[_0x53da('0x5d')],{'onDelete':_0x53da('0x118'),'as':_0x53da('0x174'),'foreignKey':_0x53da('0x187')});db[_0x53da('0x5f')][_0x53da('0x156')](db['SmsAccount'],{'as':_0x53da('0x16c'),'foreignKey':_0x53da('0x184')});db[_0x53da('0x60')][_0x53da('0x127')](db[_0x53da('0x10')],{'as':_0x53da('0x15a'),'through':'UserSmsQueue','foreignKey':_0x53da('0x188')});db[_0x53da('0x60')][_0x53da('0x127')](db['Team'],{'through':_0x53da('0x189'),'as':'Teams'});db['OpenchannelAccount'][_0x53da('0x119')](db[_0x53da('0x86')],{'as':_0x53da('0x17b'),'foreignKey':_0x53da('0x18a'),'onDelete':_0x53da('0x118')});db[_0x53da('0x62')]['hasMany'](db[_0x53da('0x85')],{'as':_0x53da('0x165'),'foreignKey':_0x53da('0x18a')});db[_0x53da('0x62')]['hasMany'](db[_0x53da('0x66')],{'as':'Interactions','foreignKey':'OpenchannelAccountId'});db[_0x53da('0x62')]['hasMany'](db[_0x53da('0x18b')],{'as':_0x53da('0x15c'),'foreignKey':'OpenchannelAccountId'});db[_0x53da('0x62')][_0x53da('0x119')](db[_0x53da('0x64')],{'as':_0x53da('0x17d'),'foreignKey':'OpenchannelAccountId'});db[_0x53da('0x62')][_0x53da('0x156')](db[_0x53da('0x12c')],{'as':_0x53da('0x167'),'foreignKey':_0x53da('0x17f')});db[_0x53da('0x62')][_0x53da('0x156')](db[_0x53da('0x8b')],{'as':_0x53da('0x169'),'foreignKey':_0x53da('0x158')});db[_0x53da('0x62')]['belongsToMany'](db[_0x53da('0x10')],{'as':_0x53da('0x15a'),'through':_0x53da('0x142')});db[_0x53da('0x64')]['belongsTo'](db[_0x53da('0x10')],{'onDelete':_0x53da('0x163')});db[_0x53da('0x64')]['belongsTo'](db[_0x53da('0x68')],{'onDelete':_0x53da('0x163'),'foreignKey':'OpenchannelQueueId'});db['OpenchannelApplication'][_0x53da('0x156')](db[_0x53da('0x62')],{'onDelete':_0x53da('0x163'),'foreignKey':_0x53da('0x18a')});db['OpenchannelApplication']['belongsTo'](db[_0x53da('0x89')],{'onDelete':'restrict','foreignKey':_0x53da('0x157')});db['OpenchannelApplication'][_0x53da('0x156')](db[_0x53da('0x93')],{'onDelete':_0x53da('0x163'),'foreignKey':_0x53da('0x177')});db[_0x53da('0x66')][_0x53da('0x119')](db[_0x53da('0x18b')],{'as':_0x53da('0x15c'),'onDelete':_0x53da('0x118'),'foreignKey':_0x53da('0x18c')});db[_0x53da('0x66')][_0x53da('0x156')](db[_0x53da('0x62')],{'as':_0x53da('0x16c'),'foreignKey':_0x53da('0x18a')});db[_0x53da('0x66')][_0x53da('0x156')](db['CmContact'],{'as':_0x53da('0x160'),'foreignKey':'ContactId'});db[_0x53da('0x66')][_0x53da('0x156')](db[_0x53da('0x10')],{'as':_0x53da('0x16d'),'foreignKey':_0x53da('0x115')});db[_0x53da('0x66')]['belongsToMany'](db[_0x53da('0x93')],{'through':_0x53da('0x18d'),'as':_0x53da('0x16e')});db[_0x53da('0x66')][_0x53da('0x127')](db['Tag'],{'through':_0x53da('0x18d'),'as':'ThroughTags'});db[_0x53da('0x66')][_0x53da('0x127')](db['User'],{'as':'Users','through':_0x53da('0x18e'),'foreignKey':_0x53da('0x18c')});db[_0x53da('0x18b')][_0x53da('0x156')](db[_0x53da('0x10')],{'onDelete':_0x53da('0x118'),'as':_0x53da('0x10')});db[_0x53da('0x18b')][_0x53da('0x156')](db[_0x53da('0x173')],{'onDelete':_0x53da('0x118'),'as':_0x53da('0x160')});db[_0x53da('0x18b')]['belongsTo'](db[_0x53da('0x66')],{'onDelete':_0x53da('0x118'),'as':_0x53da('0x174'),'foreignKey':_0x53da('0x18c')});db[_0x53da('0x18b')][_0x53da('0x156')](db[_0x53da('0xf4')],{'as':'Attachment','foreignKey':_0x53da('0x181')});db['OpenchannelMessage'][_0x53da('0x156')](db[_0x53da('0x62')],{'as':_0x53da('0x16c'),'foreignKey':_0x53da('0x18a')});db['OpenchannelQueue']['belongsToMany'](db[_0x53da('0x10')],{'as':_0x53da('0x15a'),'through':_0x53da('0x39'),'foreignKey':_0x53da('0x18f')});db[_0x53da('0x68')][_0x53da('0x127')](db['Team'],{'through':_0x53da('0x190'),'as':_0x53da('0x15b')});db[_0x53da('0x6a')][_0x53da('0x119')](db[_0x53da('0x86')],{'as':_0x53da('0x17b'),'foreignKey':_0x53da('0x175'),'onDelete':'cascade'});db[_0x53da('0x6a')]['hasMany'](db[_0x53da('0x85')],{'as':_0x53da('0x165'),'foreignKey':_0x53da('0x175')});db[_0x53da('0x6a')][_0x53da('0x119')](db[_0x53da('0x75')],{'as':_0x53da('0x191')});db[_0x53da('0x6a')]['hasMany'](db['ChatInteraction'],{'as':'Interactions'});db[_0x53da('0x6a')]['hasMany'](db[_0x53da('0x6d')],{'as':_0x53da('0x17d')});db['ChatWebsite']['hasMany'](db[_0x53da('0x192')],{'as':'Messages'});db[_0x53da('0x6a')][_0x53da('0x156')](db['CmList'],{'as':'List','foreignKey':_0x53da('0x17f')});db[_0x53da('0x6a')][_0x53da('0x156')](db['Interval'],{'as':_0x53da('0x89'),'foreignKey':_0x53da('0x157')});db['ChatWebsite'][_0x53da('0x156')](db['MailAccount'],{'as':_0x53da('0x41'),'foreignKey':_0x53da('0x162')});db[_0x53da('0x6a')]['belongsTo'](db['Pause'],{'as':_0x53da('0x169'),'foreignKey':_0x53da('0x158')});db['ChatWebsite'][_0x53da('0x127')](db['User'],{'as':'Agents','through':'user_has_chat_websites'});db[_0x53da('0x193')][_0x53da('0x156')](db[_0x53da('0x62')],{});db[_0x53da('0x193')][_0x53da('0x156')](db[_0x53da('0x12c')],{'as':'List','foreignKey':_0x53da('0x17f')});db[_0x53da('0x193')][_0x53da('0x156')](db[_0x53da('0x173')],{'as':_0x53da('0x160'),'foreignKey':_0x53da('0x161')});db[_0x53da('0x193')][_0x53da('0x156')](db[_0x53da('0x66')],{});db['OpenchannelQueueReport']['belongsTo'](db['OpenchannelMessage'],{});db['OpenchannelQueueReport'][_0x53da('0x156')](db[_0x53da('0x10')],{});db[_0x53da('0x193')][_0x53da('0x156')](db[_0x53da('0x68')],{});db[_0x53da('0x6d')][_0x53da('0x156')](db['User'],{'as':_0x53da('0x194'),'foreignKey':'UserId','onDelete':_0x53da('0x163')});db['ChatApplication'][_0x53da('0x156')](db[_0x53da('0x139')],{'as':_0x53da('0x195'),'foreignKey':'ChatQueueId','onDelete':_0x53da('0x163')});db[_0x53da('0x6d')][_0x53da('0x156')](db[_0x53da('0x6a')],{'as':_0x53da('0x196'),'foreignKey':_0x53da('0x175'),'onDelete':'restrict'});db['ChatApplication'][_0x53da('0x156')](db[_0x53da('0x93')],{'onDelete':_0x53da('0x163'),'foreignKey':'TagId'});db[_0x53da('0x6f')][_0x53da('0x119')](db[_0x53da('0x192')],{'as':'Messages','onDelete':'cascade','foreignKey':_0x53da('0x197')});db[_0x53da('0x6f')][_0x53da('0x156')](db[_0x53da('0x6a')],{'as':_0x53da('0x16c'),'foreignKey':'ChatWebsiteId'});db[_0x53da('0x6f')][_0x53da('0x156')](db['CmContact'],{'as':_0x53da('0x160'),'foreignKey':_0x53da('0x161')});db['ChatInteraction'][_0x53da('0x156')](db[_0x53da('0x10')],{'as':_0x53da('0x16d'),'foreignKey':_0x53da('0x115')});db['ChatInteraction'][_0x53da('0x127')](db['Tag'],{'through':_0x53da('0x198'),'as':_0x53da('0x16e')});db[_0x53da('0x6f')][_0x53da('0x127')](db[_0x53da('0x93')],{'through':'chat_interaction_has_tags','as':_0x53da('0x170')});db[_0x53da('0x6f')][_0x53da('0x127')](db[_0x53da('0x10')],{'as':_0x53da('0x171'),'through':_0x53da('0x131'),'foreignKey':'ChatInteractionId'});db['ChatMessage']['belongsTo'](db['User'],{'onDelete':_0x53da('0x118'),'as':_0x53da('0x10')});db[_0x53da('0x192')][_0x53da('0x156')](db[_0x53da('0x173')],{'onDelete':'cascade','as':'Contact','foreignKey':'ContactId'});db['ChatMessage'][_0x53da('0x156')](db[_0x53da('0x6f')],{'onDelete':_0x53da('0x118'),'as':'Interaction','foreignKey':_0x53da('0x197')});db[_0x53da('0x192')][_0x53da('0x156')](db['Attachment'],{'as':'Attachment','foreignKey':'AttachmentId'});db[_0x53da('0x192')][_0x53da('0x156')](db['ChatWebsite'],{'as':_0x53da('0x16c'),'foreignKey':_0x53da('0x175')});db[_0x53da('0x71')][_0x53da('0x119')](db['Attachment'],{'as':_0x53da('0x199'),'foreignKey':_0x53da('0x176'),'onDelete':'cascade','hooks':!![]});db['ChatOfflineMessage'][_0x53da('0x156')](db[_0x53da('0x173')],{'onDelete':_0x53da('0x118'),'as':_0x53da('0x160'),'foreignKey':_0x53da('0x161')});db[_0x53da('0x71')]['belongsTo'](db[_0x53da('0x6a')],{'as':_0x53da('0x16c'),'foreignKey':_0x53da('0x175')});db[_0x53da('0x139')]['belongsToMany'](db[_0x53da('0x10')],{'as':'Agents','through':'UserChatQueue','hooks':!![]});db[_0x53da('0x139')]['belongsToMany'](db[_0x53da('0xec')],{'through':_0x53da('0x19a'),'as':'Teams'});db[_0x53da('0x128')]['hasMany'](db[_0x53da('0xd7')],{'as':_0x53da('0x15c'),'foreignKey':_0x53da('0x19b'),'onDelete':_0x53da('0x118')});db[_0x53da('0x128')][_0x53da('0x127')](db[_0x53da('0x10')],{'as':_0x53da('0x14d'),'through':_0x53da('0x12a')});db['ChatProactiveAction']['belongsTo'](db[_0x53da('0x6a')],{'as':_0x53da('0x196'),'foreignKey':'ChatWebsiteId'});db[_0x53da('0x76')]['hasMany'](db[_0x53da('0x173')],{'as':_0x53da('0x12b'),'foreignKey':_0x53da('0x19c')});db[_0x53da('0x173')][_0x53da('0x119')](db['CmContactHasItem'],{'as':_0x53da('0x19d'),'foreignKey':'CmContactId'});db[_0x53da('0x173')][_0x53da('0x119')](db[_0x53da('0x14f')],{'as':'Hoppers','foreignKey':'ContactId'});db[_0x53da('0x173')]['hasMany'](db['CmHopperFinal'],{'as':_0x53da('0x11c'),'foreignKey':_0x53da('0x161')});db[_0x53da('0x173')]['hasMany'](db[_0x53da('0x7c')],{'as':_0x53da('0x151'),'foreignKey':_0x53da('0x161')});db['CmContact'][_0x53da('0x119')](db[_0x53da('0x7e')],{'as':_0x53da('0x7e'),'foreignKey':_0x53da('0x161')});db['CmContact'][_0x53da('0x119')](db[_0x53da('0xdb')],{'as':'JscriptySessions','foreignKey':_0x53da('0x161')});db[_0x53da('0x173')][_0x53da('0x119')](db[_0x53da('0x66')],{'as':'OpenchannelInteractions','foreignKey':_0x53da('0x161'),'onDelete':_0x53da('0x163')});db[_0x53da('0x173')]['hasMany'](db[_0x53da('0x6f')],{'as':_0x53da('0x130'),'foreignKey':'ContactId','onDelete':'restrict'});db[_0x53da('0x173')]['hasMany'](db[_0x53da('0x5d')],{'as':'SmsInteractions','foreignKey':_0x53da('0x161'),'onDelete':_0x53da('0x163')});db['CmContact'][_0x53da('0x119')](db[_0x53da('0x120')],{'as':_0x53da('0x132'),'foreignKey':_0x53da('0x161'),'onDelete':_0x53da('0x163')});db[_0x53da('0x173')][_0x53da('0x119')](db[_0x53da('0x47')],{'as':'MailInteractions','foreignKey':_0x53da('0x161'),'onDelete':'restrict'});db[_0x53da('0x173')][_0x53da('0x156')](db[_0x53da('0x76')],{'as':_0x53da('0x19e'),'foreignKey':_0x53da('0x19c')});db[_0x53da('0x173')][_0x53da('0x156')](db['CmList'],{'as':'List','foreignKey':_0x53da('0x17f'),'onDelete':_0x53da('0x118')});db['CmContact']['belongsToMany'](db[_0x53da('0x10')],{'as':_0x53da('0x171'),'through':_0x53da('0x19f')});db[_0x53da('0x173')][_0x53da('0x127')](db[_0x53da('0x93')],{'as':'Tags','through':_0x53da('0x1a0')});db[_0x53da('0x173')][_0x53da('0x127')](db['Tag'],{'through':_0x53da('0x1a0'),'as':'ThroughTags'});db[_0x53da('0x14f')][_0x53da('0x119')](db[_0x53da('0x98')],{'as':_0x53da('0x1a1'),'foreignKey':_0x53da('0x1a2')});db[_0x53da('0x14f')][_0x53da('0x156')](db[_0x53da('0x173')],{'as':_0x53da('0x160'),'foreignKey':_0x53da('0x161'),'onDelete':_0x53da('0x118')});db['CmHopper']['belongsTo'](db[_0x53da('0x12c')],{'as':_0x53da('0x167'),'foreignKey':_0x53da('0x17f'),'onDelete':_0x53da('0x118')});db['CmHopper']['belongsTo'](db[_0x53da('0x10')],{'as':_0x53da('0x194'),'foreignKey':_0x53da('0x115')});db['CmHopper'][_0x53da('0x156')](db[_0x53da('0x1a')],{'as':_0x53da('0x195'),'foreignKey':_0x53da('0x14e'),'onDelete':'cascade'});db[_0x53da('0x14f')]['belongsTo'](db['Campaign'],{'as':_0x53da('0xf0'),'foreignKey':_0x53da('0x1a3'),'onDelete':'cascade'});db[_0x53da('0x14f')][_0x53da('0x156')](db[_0x53da('0x10')],{'as':_0x53da('0x16d'),'foreignKey':_0x53da('0x1a4')});db[_0x53da('0x152')]['belongsTo'](db[_0x53da('0x173')],{'as':_0x53da('0x160'),'foreignKey':_0x53da('0x161'),'onDelete':_0x53da('0x118')});db[_0x53da('0x152')][_0x53da('0x156')](db[_0x53da('0x12c')],{'as':_0x53da('0x167'),'foreignKey':_0x53da('0x17f'),'onDelete':_0x53da('0x118')});db[_0x53da('0x152')]['belongsTo'](db['VoiceQueue'],{'as':'Queue','foreignKey':_0x53da('0x14e'),'onDelete':_0x53da('0x118')});db['CmHopperBlack'][_0x53da('0x156')](db['Campaign'],{'as':_0x53da('0xf0'),'foreignKey':_0x53da('0x1a3'),'onDelete':'cascade'});db[_0x53da('0x83')][_0x53da('0x119')](db['Condition'],{'as':{'plural':_0x53da('0x1a5'),'singular':'OneAll'},'foreignKey':_0x53da('0x1a6'),'onDelete':'cascade','hooks':!![]});db[_0x53da('0x83')][_0x53da('0x119')](db[_0x53da('0x1a7')],{'as':{'plural':_0x53da('0x1a8'),'singular':_0x53da('0x1a9')},'foreignKey':_0x53da('0x1aa'),'onDelete':'cascade','hooks':!![]});db['Automation'][_0x53da('0x119')](db[_0x53da('0x81')],{'as':_0x53da('0x1ab'),'foreignKey':'AutomationId','onDelete':_0x53da('0x118'),'hooks':!![]});db['Disposition'][_0x53da('0x119')](db[_0x53da('0x86')],{'as':_0x53da('0x17b'),'foreignKey':_0x53da('0x1ac'),'onDelete':_0x53da('0x118')});db[_0x53da('0x89')][_0x53da('0x119')](db['Interval'],{'as':_0x53da('0x1ad'),'foreignKey':_0x53da('0x157'),'onDelete':_0x53da('0x118'),'hooks':!![],'required':![]});db[_0x53da('0x89')][_0x53da('0x119')](db[_0x53da('0x17')],{'as':_0x53da('0x1ae'),'foreignKey':_0x53da('0x157'),'onDelete':_0x53da('0x163')});db['Interval'][_0x53da('0x119')](db[_0x53da('0x4a')],{'as':'MailApplications','foreignKey':_0x53da('0x157')});db[_0x53da('0x89')][_0x53da('0x119')](db['ChatApplication'],{'as':_0x53da('0x1af'),'foreignKey':_0x53da('0x157')});db[_0x53da('0x89')]['hasMany'](db[_0x53da('0x52')],{'as':_0x53da('0x1b0'),'foreignKey':_0x53da('0x157')});db[_0x53da('0x89')][_0x53da('0x119')](db['SmsApplication'],{'as':'SmsApplications','foreignKey':_0x53da('0x157')});db[_0x53da('0x8f')][_0x53da('0x156')](db[_0x53da('0x41')],{});db[_0x53da('0x8f')][_0x53da('0x156')](db[_0x53da('0xa1')],{'foreignKey':_0x53da('0x1b1')});db[_0x53da('0x8f')][_0x53da('0x156')](db[_0x53da('0x9f')],{'foreignKey':_0x53da('0x1b2')});db[_0x53da('0x91')]['belongsToMany'](db[_0x53da('0x14a')],{'as':_0x53da('0x1b3'),'through':_0x53da('0x14c'),'onDelete':'restrict'});db['Tag'][_0x53da('0x127')](db[_0x53da('0x173')],{'through':_0x53da('0x1a0')});db[_0x53da('0x93')][_0x53da('0x127')](db['ChatInteraction'],{'through':'chat_interaction_has_tags'});db['Tag'][_0x53da('0x127')](db['MailInteraction'],{'through':'mail_interaction_has_tags'});db[_0x53da('0x93')]['belongsToMany'](db['SmsInteraction'],{'through':'sms_interaction_has_tags'});db[_0x53da('0x93')][_0x53da('0x127')](db[_0x53da('0x120')],{'through':_0x53da('0x1b4')});db[_0x53da('0x93')][_0x53da('0x127')](db[_0x53da('0x66')],{'through':'openchannel_interaction_has_tags'});db[_0x53da('0x93')][_0x53da('0x127')](db[_0x53da('0x105')],{'through':_0x53da('0x1b5')});db[_0x53da('0x96')]['belongsTo'](db[_0x53da('0x94')],{'as':_0x53da('0x1b6'),'foreignKey':_0x53da('0x1b7')});db[_0x53da('0x98')][_0x53da('0x156')](db['CmHopper'],{'as':'Hopper','foreignKey':'CmHopperId'});db[_0x53da('0x96')][_0x53da('0x156')](db[_0x53da('0x173')],{'as':_0x53da('0x160'),'foreignKey':_0x53da('0x1b8')});db[_0x53da('0x9b')][_0x53da('0x119')](db[_0x53da('0x1a7')],{'as':{'plural':_0x53da('0x1b9'),'singular':_0x53da('0x1ba')},'foreignKey':_0x53da('0x1bb'),'onDelete':'cascade','hooks':!![]});db[_0x53da('0x9b')][_0x53da('0x119')](db[_0x53da('0x1a7')],{'as':{'plural':_0x53da('0x1bc'),'singular':_0x53da('0x1bd')},'foreignKey':'TriggerAnyId','onDelete':_0x53da('0x118'),'hooks':!![]});db[_0x53da('0x9b')][_0x53da('0x119')](db[_0x53da('0x81')],{'as':_0x53da('0x1ab'),'foreignKey':'TriggerId','onDelete':_0x53da('0x118'),'hooks':!![]});db[_0x53da('0x9f')]['hasMany'](db[_0x53da('0xa7')],{'as':_0x53da('0x1be'),'onDelete':_0x53da('0x118'),'foreignKey':'CustomReportId','hooks':!![]});db[_0x53da('0xa1')]['hasMany'](db[_0x53da('0xa7')],{'as':_0x53da('0x1be'),'onDelete':_0x53da('0x118'),'foreignKey':_0x53da('0x1b1')});db['AnalyticMetric']['hasMany'](db['AnalyticFieldReport'],{'as':_0x53da('0x1be'),'onDelete':_0x53da('0x118'),'foreignKey':'MetricId'});db[_0x53da('0xa7')]['belongsTo'](db['AnalyticMetric'],{'foreignKey':_0x53da('0x1bf')});db['SalesforceAccount'][_0x53da('0x119')](db[_0x53da('0x1c0')],{'as':'Configurations','onDelete':_0x53da('0x118'),'foreignKey':_0x53da('0x1c1')});db['SalesforceConfiguration'][_0x53da('0x119')](db[_0x53da('0xab')],{'as':'Subjects','onDelete':_0x53da('0x118'),'foreignKey':_0x53da('0x1c2')});db[_0x53da('0x1c0')][_0x53da('0x119')](db['SalesforceField'],{'as':_0x53da('0x1c3'),'onDelete':'cascade','foreignKey':_0x53da('0x1c4')});db['SalesforceConfiguration']['hasMany'](db['SalesforceField'],{'as':_0x53da('0x1be'),'onDelete':_0x53da('0x118'),'foreignKey':_0x53da('0x1c5')});db[_0x53da('0x1c0')]['belongsTo'](db['SalesforceAccount'],{'as':_0x53da('0x16c'),'foreignKey':_0x53da('0x1c1')});db[_0x53da('0xab')]['hasMany'](db[_0x53da('0xab')],{'as':'Subject','foreignKey':_0x53da('0x1c2')});db[_0x53da('0xab')][_0x53da('0x119')](db[_0x53da('0xab')],{'as':_0x53da('0x1c6'),'foreignKey':'DescriptionId'});db[_0x53da('0xab')]['hasMany'](db[_0x53da('0xab')],{'as':_0x53da('0x1c7'),'foreignKey':_0x53da('0x1c5')});db[_0x53da('0xab')][_0x53da('0x156')](db[_0x53da('0x1c8')],{'as':_0x53da('0x1c8'),'foreignKey':'VariableId'});db[_0x53da('0xad')][_0x53da('0x119')](db[_0x53da('0xaf')],{'as':'Configurations','onDelete':_0x53da('0x118'),'foreignKey':_0x53da('0x1c1')});db[_0x53da('0xaf')]['hasMany'](db[_0x53da('0x1c9')],{'as':'Subjects','onDelete':'cascade','foreignKey':'SubjectId'});db[_0x53da('0xaf')][_0x53da('0x119')](db['SugarcrmField'],{'as':'Descriptions','onDelete':_0x53da('0x118'),'foreignKey':_0x53da('0x1c4')});db[_0x53da('0xaf')][_0x53da('0x119')](db[_0x53da('0x1c9')],{'as':_0x53da('0x1be'),'onDelete':_0x53da('0x118'),'foreignKey':_0x53da('0x1c5')});db[_0x53da('0xaf')][_0x53da('0x156')](db[_0x53da('0xad')],{'as':_0x53da('0x16c'),'foreignKey':'AccountId'});db[_0x53da('0x1c9')][_0x53da('0x119')](db['SugarcrmField'],{'as':'Subject','foreignKey':_0x53da('0x1c2')});db[_0x53da('0x1c9')][_0x53da('0x119')](db[_0x53da('0x1c9')],{'as':_0x53da('0x1c6'),'foreignKey':_0x53da('0x1c4')});db[_0x53da('0x1c9')]['hasMany'](db[_0x53da('0x1c9')],{'as':'Field','foreignKey':_0x53da('0x1c5')});db[_0x53da('0x1c9')][_0x53da('0x156')](db['Variable'],{'as':_0x53da('0x1c8'),'foreignKey':_0x53da('0x1ca')});db[_0x53da('0xb2')][_0x53da('0x119')](db[_0x53da('0xb3')],{'as':_0x53da('0x1cb'),'onDelete':'cascade','foreignKey':'AccountId'});db[_0x53da('0xb3')][_0x53da('0x119')](db[_0x53da('0x1cc')],{'as':'Subjects','onDelete':_0x53da('0x118'),'foreignKey':_0x53da('0x1c2')});db[_0x53da('0xb3')][_0x53da('0x119')](db[_0x53da('0x1cc')],{'as':'Descriptions','onDelete':'cascade','foreignKey':_0x53da('0x1c4')});db['DeskConfiguration'][_0x53da('0x119')](db[_0x53da('0x1cc')],{'as':_0x53da('0x1be'),'onDelete':_0x53da('0x118'),'foreignKey':_0x53da('0x1c5')});db[_0x53da('0xb3')][_0x53da('0x156')](db[_0x53da('0xb2')],{'as':_0x53da('0x16c'),'foreignKey':_0x53da('0x1c1')});db[_0x53da('0xb3')][_0x53da('0x127')](db[_0x53da('0x93')],{'through':_0x53da('0x1cd')});db[_0x53da('0x1cc')][_0x53da('0x119')](db[_0x53da('0x1cc')],{'as':_0x53da('0x1ce'),'foreignKey':_0x53da('0x1c2')});db[_0x53da('0x1cc')][_0x53da('0x119')](db[_0x53da('0x1cc')],{'as':_0x53da('0x1c6'),'foreignKey':_0x53da('0x1c4')});db[_0x53da('0x1cc')][_0x53da('0x119')](db['DeskField'],{'as':_0x53da('0x1c7'),'foreignKey':'FieldId'});db[_0x53da('0x1cc')][_0x53da('0x156')](db[_0x53da('0x1c8')],{'as':_0x53da('0x1c8'),'foreignKey':_0x53da('0x1ca')});db[_0x53da('0xb5')][_0x53da('0x119')](db['ZohoConfiguration'],{'as':_0x53da('0x1cb'),'onDelete':_0x53da('0x118'),'foreignKey':_0x53da('0x1c1')});db[_0x53da('0xb7')][_0x53da('0x119')](db[_0x53da('0xb8')],{'as':_0x53da('0x1cf'),'onDelete':_0x53da('0x118'),'foreignKey':_0x53da('0x1c2')});db[_0x53da('0xb7')][_0x53da('0x119')](db['ZohoField'],{'as':'Descriptions','onDelete':_0x53da('0x118'),'foreignKey':'DescriptionId'});db[_0x53da('0xb7')][_0x53da('0x119')](db[_0x53da('0xb8')],{'as':_0x53da('0x1be'),'onDelete':'cascade','foreignKey':_0x53da('0x1c5')});db[_0x53da('0xb7')][_0x53da('0x156')](db[_0x53da('0xb5')],{'as':_0x53da('0x16c'),'foreignKey':'AccountId'});db[_0x53da('0xb8')]['hasMany'](db[_0x53da('0xb8')],{'as':_0x53da('0x1ce'),'foreignKey':_0x53da('0x1c2')});db[_0x53da('0xb8')]['hasMany'](db['ZohoField'],{'as':'Description','foreignKey':_0x53da('0x1c4')});db[_0x53da('0xb8')]['hasMany'](db[_0x53da('0xb8')],{'as':_0x53da('0x1c7'),'foreignKey':_0x53da('0x1c5')});db['ZohoField']['belongsTo'](db[_0x53da('0x1c8')],{'as':'Variable','foreignKey':_0x53da('0x1ca')});db[_0x53da('0xba')][_0x53da('0x119')](db[_0x53da('0x1d0')],{'as':_0x53da('0x1cb'),'onDelete':_0x53da('0x118'),'foreignKey':_0x53da('0x1c1')});db[_0x53da('0x1d0')][_0x53da('0x119')](db['ZendeskField'],{'as':'Subjects','foreignKey':_0x53da('0x1c2')});db[_0x53da('0x1d0')][_0x53da('0x119')](db[_0x53da('0xbc')],{'as':_0x53da('0x1c3'),'foreignKey':'DescriptionId'});db[_0x53da('0x1d0')][_0x53da('0x119')](db[_0x53da('0xbc')],{'as':_0x53da('0x1be'),'foreignKey':_0x53da('0x1c5')});db[_0x53da('0x1d0')]['belongsTo'](db['ZendeskAccount'],{'as':'Account','foreignKey':_0x53da('0x1c1')});db[_0x53da('0x1d0')]['belongsToMany'](db['Tag'],{'through':_0x53da('0x1d1')});db[_0x53da('0xbc')][_0x53da('0x119')](db['ZendeskField'],{'as':_0x53da('0x1ce'),'foreignKey':_0x53da('0x1c2')});db['ZendeskField'][_0x53da('0x119')](db['ZendeskField'],{'as':_0x53da('0x1c6'),'foreignKey':'DescriptionId'});db[_0x53da('0xbc')][_0x53da('0x119')](db['ZendeskField'],{'as':_0x53da('0x1c7'),'foreignKey':_0x53da('0x1c5')});db[_0x53da('0xbc')]['belongsTo'](db['Variable'],{'as':_0x53da('0x1c8'),'foreignKey':_0x53da('0x1ca')});db['FreshdeskAccount'][_0x53da('0x119')](db[_0x53da('0x1d2')],{'as':_0x53da('0x1cb'),'onDelete':_0x53da('0x118'),'foreignKey':_0x53da('0x1c1')});db[_0x53da('0x1d2')][_0x53da('0x119')](db[_0x53da('0xc0')],{'as':_0x53da('0x1cf'),'onDelete':_0x53da('0x118'),'foreignKey':_0x53da('0x1c2')});db['FreshdeskConfiguration'][_0x53da('0x119')](db['FreshdeskField'],{'as':'Descriptions','onDelete':_0x53da('0x118'),'foreignKey':'DescriptionId'});db['FreshdeskConfiguration']['hasMany'](db[_0x53da('0xc0')],{'as':'Fields','onDelete':_0x53da('0x118'),'foreignKey':'FieldId'});db[_0x53da('0x1d2')][_0x53da('0x156')](db['FreshdeskAccount'],{'as':_0x53da('0x16c'),'foreignKey':_0x53da('0x1c1')});db[_0x53da('0x1d2')][_0x53da('0x127')](db[_0x53da('0x93')],{'through':_0x53da('0x1d3')});db[_0x53da('0xc0')][_0x53da('0x119')](db[_0x53da('0xc0')],{'as':_0x53da('0x1ce'),'foreignKey':_0x53da('0x1c2')});db[_0x53da('0xc0')][_0x53da('0x119')](db[_0x53da('0xc0')],{'as':_0x53da('0x1c6'),'foreignKey':_0x53da('0x1c4')});db[_0x53da('0xc0')][_0x53da('0x119')](db[_0x53da('0xc0')],{'as':'Field','foreignKey':'FieldId'});db[_0x53da('0xc0')][_0x53da('0x156')](db[_0x53da('0x1c8')],{'as':_0x53da('0x1c8'),'foreignKey':'VariableId'});db['VtigerAccount'][_0x53da('0x119')](db[_0x53da('0xc4')],{'as':_0x53da('0x1cb'),'onDelete':'cascade','foreignKey':_0x53da('0x1c1')});db['VtigerConfiguration']['hasMany'](db[_0x53da('0xc5')],{'as':_0x53da('0x1cf'),'foreignKey':_0x53da('0x1c2')});db[_0x53da('0xc4')][_0x53da('0x119')](db[_0x53da('0xc5')],{'as':_0x53da('0x1c3'),'foreignKey':_0x53da('0x1c4')});db['VtigerConfiguration'][_0x53da('0x119')](db['VtigerField'],{'as':_0x53da('0x1be'),'foreignKey':_0x53da('0x1c5')});db['VtigerConfiguration'][_0x53da('0x156')](db[_0x53da('0xc2')],{'as':'Account','foreignKey':_0x53da('0x1c1')});db[_0x53da('0xc5')]['hasMany'](db[_0x53da('0xc5')],{'as':_0x53da('0x1ce'),'foreignKey':_0x53da('0x1c2')});db[_0x53da('0xc5')][_0x53da('0x119')](db[_0x53da('0xc5')],{'as':_0x53da('0x1c6'),'foreignKey':_0x53da('0x1c4')});db[_0x53da('0xc5')]['hasMany'](db[_0x53da('0xc5')],{'as':_0x53da('0x1c7'),'foreignKey':_0x53da('0x1c5')});db[_0x53da('0xc5')][_0x53da('0x156')](db[_0x53da('0x1c8')],{'as':_0x53da('0x1c8'),'foreignKey':_0x53da('0x1ca')});db[_0x53da('0xc6')][_0x53da('0x119')](db[_0x53da('0xc8')],{'as':_0x53da('0x1cb'),'onDelete':_0x53da('0x118'),'foreignKey':'AccountId'});db[_0x53da('0xc8')][_0x53da('0x119')](db[_0x53da('0xc9')],{'as':_0x53da('0x1cf'),'foreignKey':'SubjectId'});db[_0x53da('0xc8')][_0x53da('0x119')](db[_0x53da('0xc9')],{'as':_0x53da('0x1c3'),'foreignKey':'DescriptionId'});db['ServicenowConfiguration'][_0x53da('0x119')](db[_0x53da('0xc9')],{'as':_0x53da('0x1be'),'foreignKey':'FieldId'});db['ServicenowConfiguration'][_0x53da('0x156')](db[_0x53da('0xc6')],{'as':'Account','foreignKey':_0x53da('0x1c1')});db[_0x53da('0xc9')][_0x53da('0x119')](db['ServicenowField'],{'as':_0x53da('0x1ce'),'foreignKey':_0x53da('0x1c2')});db[_0x53da('0xc9')][_0x53da('0x119')](db[_0x53da('0xc9')],{'as':_0x53da('0x1c6'),'foreignKey':_0x53da('0x1c4')});db[_0x53da('0xc9')][_0x53da('0x119')](db[_0x53da('0xc9')],{'as':_0x53da('0x1c7'),'foreignKey':_0x53da('0x1c5')});db[_0x53da('0xc9')]['belongsTo'](db['Variable'],{'as':_0x53da('0x1c8'),'foreignKey':_0x53da('0x1ca')});db[_0x53da('0xca')][_0x53da('0x119')](db[_0x53da('0xcb')],{'as':_0x53da('0x1cb'),'onDelete':_0x53da('0x118'),'foreignKey':_0x53da('0x1c1')});db[_0x53da('0xca')][_0x53da('0x156')](db['CloudProvider'],{'as':_0x53da('0x10b'),'foreignKey':_0x53da('0x164')});db[_0x53da('0xcb')][_0x53da('0x119')](db[_0x53da('0xcd')],{'as':_0x53da('0x1cf'),'onDelete':_0x53da('0x118'),'foreignKey':_0x53da('0x1c2')});db[_0x53da('0xcb')][_0x53da('0x119')](db[_0x53da('0xcd')],{'as':'Descriptions','onDelete':_0x53da('0x118'),'foreignKey':_0x53da('0x1c4')});db[_0x53da('0xcb')]['hasMany'](db['Dynamics365Field'],{'as':_0x53da('0x1be'),'onDelete':_0x53da('0x118'),'foreignKey':_0x53da('0x1c5')});db['Dynamics365Configuration']['belongsTo'](db['Dynamics365Account'],{'as':_0x53da('0x16c'),'foreignKey':_0x53da('0x1c1')});db[_0x53da('0xcd')][_0x53da('0x119')](db['Dynamics365Field'],{'as':_0x53da('0x1ce'),'foreignKey':_0x53da('0x1c2')});db['Dynamics365Field'][_0x53da('0x119')](db[_0x53da('0xcd')],{'as':_0x53da('0x1c6'),'foreignKey':_0x53da('0x1c4')});db[_0x53da('0xcd')][_0x53da('0x119')](db[_0x53da('0xcd')],{'as':'Field','foreignKey':'FieldId'});db[_0x53da('0xcd')][_0x53da('0x156')](db[_0x53da('0x1c8')],{'as':_0x53da('0x1c8'),'foreignKey':_0x53da('0x1ca')});db[_0x53da('0xcf')][_0x53da('0x119')](db[_0x53da('0x1d4')],{'as':_0x53da('0x1cb'),'onDelete':_0x53da('0x118'),'foreignKey':_0x53da('0x1c1')});db[_0x53da('0x1d4')]['hasMany'](db[_0x53da('0xd1')],{'as':_0x53da('0x1cf'),'foreignKey':_0x53da('0x1c2')});db[_0x53da('0x1d4')]['hasMany'](db['FreshsalesField'],{'as':_0x53da('0x1c3'),'foreignKey':_0x53da('0x1c4')});db[_0x53da('0x1d4')]['hasMany'](db[_0x53da('0xd1')],{'as':_0x53da('0x1be'),'foreignKey':_0x53da('0x1c5')});db['FreshsalesConfiguration']['belongsTo'](db[_0x53da('0xcf')],{'as':_0x53da('0x16c'),'foreignKey':_0x53da('0x1c1')});db['FreshsalesField'][_0x53da('0x119')](db[_0x53da('0xd1')],{'as':_0x53da('0x1ce'),'foreignKey':_0x53da('0x1c2')});db[_0x53da('0xd1')][_0x53da('0x119')](db[_0x53da('0xd1')],{'as':'Description','foreignKey':'DescriptionId'});db[_0x53da('0xd1')]['hasMany'](db[_0x53da('0xd1')],{'as':_0x53da('0x1c7'),'foreignKey':'FieldId'});db[_0x53da('0xd1')][_0x53da('0x156')](db[_0x53da('0x1c8')],{'as':_0x53da('0x1c8'),'foreignKey':_0x53da('0x1ca')});db[_0x53da('0xd5')][_0x53da('0x156')](db[_0x53da('0x6a')],{});db[_0x53da('0xd5')][_0x53da('0x156')](db[_0x53da('0x12c')],{'as':'List','foreignKey':_0x53da('0x17f')});db[_0x53da('0xd5')][_0x53da('0x156')](db['CmContact'],{'as':_0x53da('0x160'),'foreignKey':'ContactId'});db['ChatQueueReport']['belongsTo'](db[_0x53da('0x6f')],{});db[_0x53da('0xd5')][_0x53da('0x156')](db[_0x53da('0x192')],{});db[_0x53da('0xd5')][_0x53da('0x156')](db['User'],{});db['ChatQueueReport']['belongsTo'](db['ChatQueue'],{});db[_0x53da('0xd7')][_0x53da('0x156')](db[_0x53da('0x10')],{'onDelete':_0x53da('0x118'),'foreignKey':_0x53da('0x1d5')});db[_0x53da('0xd7')][_0x53da('0x156')](db['User'],{'onDelete':_0x53da('0x118'),'foreignKey':'ToId'});db[_0x53da('0xdb')][_0x53da('0x119')](db[_0x53da('0x1d6')],{'foreignKey':_0x53da('0x1d7'),'onDelete':_0x53da('0x118')});db[_0x53da('0xdb')][_0x53da('0x119')](db[_0x53da('0xd9')],{'foreignKey':_0x53da('0x1d7'),'onDelete':'cascade'});db[_0x53da('0xdd')][_0x53da('0x156')](db[_0x53da('0x5a')],{});db[_0x53da('0xdd')][_0x53da('0x156')](db[_0x53da('0x12c')],{'as':_0x53da('0x167'),'foreignKey':_0x53da('0x17f')});db[_0x53da('0xdd')][_0x53da('0x156')](db['CmContact'],{'as':'Contact','foreignKey':_0x53da('0x161')});db[_0x53da('0xdd')][_0x53da('0x156')](db[_0x53da('0x5d')],{});db[_0x53da('0xdd')][_0x53da('0x156')](db['SmsMessage'],{});db['SmsQueueReport'][_0x53da('0x156')](db[_0x53da('0x10')],{});db['SmsQueueReport']['belongsTo'](db['SmsQueue'],{});db['JscriptyProject'][_0x53da('0x119')](db[_0x53da('0xdb')],{'foreignKey':_0x53da('0x1d8')});db[_0x53da('0x1d9')]['hasMany'](db['JscriptyQuestionReport'],{'foreignKey':_0x53da('0x1d8')});db[_0x53da('0x1d9')]['hasMany'](db[_0x53da('0xd9')],{'foreignKey':_0x53da('0x1d8')});db[_0x53da('0xe6')][_0x53da('0x127')](db[_0x53da('0x10')],{'as':_0x53da('0x171'),'through':_0x53da('0x147')});db[_0x53da('0xec')][_0x53da('0x127')](db['User'],{'as':_0x53da('0x15a'),'through':_0x53da('0x12f')});db[_0x53da('0xec')][_0x53da('0x127')](db[_0x53da('0x1a')],{'through':_0x53da('0x10d'),'as':_0x53da('0x1da')});db[_0x53da('0xec')]['belongsToMany'](db[_0x53da('0x43')],{'through':_0x53da('0x16a'),'as':_0x53da('0x138')});db[_0x53da('0xec')]['belongsToMany'](db[_0x53da('0x139')],{'through':'team_has_chat_queues','as':'ChatQueues'});db['Team'][_0x53da('0x127')](db[_0x53da('0x56')],{'through':_0x53da('0x183'),'as':_0x53da('0x1db')});db['Team'][_0x53da('0x127')](db[_0x53da('0x60')],{'through':_0x53da('0x189'),'as':'SmsQueues'});db['Team'][_0x53da('0x127')](db[_0x53da('0x68')],{'through':_0x53da('0x190'),'as':'OpenchannelQueues'});db[_0x53da('0xec')][_0x53da('0x127')](db[_0x53da('0x109')],{'through':_0x53da('0x1dc'),'as':_0x53da('0x1dd')});db[_0x53da('0xec')]['belongsToMany'](db[_0x53da('0xfc')],{'through':_0x53da('0x10f'),'as':_0x53da('0x137')});db['Campaign'][_0x53da('0x119')](db['CmHopper'],{'as':_0x53da('0x150'),'foreignKey':_0x53da('0x1a3')});db[_0x53da('0xf0')]['hasMany'](db[_0x53da('0x7a')],{'as':_0x53da('0x11c'),'foreignKey':_0x53da('0x1a3')});db['Campaign']['hasMany'](db[_0x53da('0x7c')],{'as':'HopperHistories','foreignKey':'CampaignId'});db['Campaign'][_0x53da('0x119')](db[_0x53da('0x152')],{'as':_0x53da('0x153'),'foreignKey':_0x53da('0x1a3')});db[_0x53da('0xf0')][_0x53da('0x156')](db['Trunk'],{'as':_0x53da('0x154'),'foreignKey':_0x53da('0x1de')});db[_0x53da('0xf0')][_0x53da('0x156')](db[_0x53da('0x154')],{'as':_0x53da('0x155'),'foreignKey':_0x53da('0x1df')});db['Campaign'][_0x53da('0x156')](db['Interval'],{'as':_0x53da('0x89'),'foreignKey':_0x53da('0x157')});db[_0x53da('0xf0')][_0x53da('0x156')](db[_0x53da('0xe6')],{'as':_0x53da('0xe6'),'foreignKey':'SquareProjectId'});db[_0x53da('0xf0')][_0x53da('0x127')](db['CmList'],{'as':_0x53da('0x12d'),'through':'campaigns_has_cm_lists'});db[_0x53da('0xf0')][_0x53da('0x127')](db['CmList'],{'as':_0x53da('0x1e0'),'through':'campaigns_has_cm_blacklists'});db[_0x53da('0xf4')]['belongsTo'](db[_0x53da('0x71')],{'as':_0x53da('0x71'),'foreignKey':_0x53da('0x176')});db[_0x53da('0xf6')][_0x53da('0x156')](db[_0x53da('0x48')],{});db[_0x53da('0xf6')][_0x53da('0x156')](db['MailInteraction'],{});db[_0x53da('0xf6')][_0x53da('0x156')](db[_0x53da('0x41')],{'foreignKey':'FromMailAccountId','as':'FromAccount'});db[_0x53da('0xf6')]['belongsTo'](db['User'],{'foreignKey':_0x53da('0x1e1'),'as':_0x53da('0x1e2')});db[_0x53da('0xf6')][_0x53da('0x156')](db[_0x53da('0x10')],{'foreignKey':_0x53da('0x1e3'),'as':_0x53da('0x1e4')});db[_0x53da('0xf6')][_0x53da('0x156')](db[_0x53da('0x43')],{'foreignKey':'ToMailQueueId','as':_0x53da('0x1e5')});db['MailTransferReport'][_0x53da('0x156')](db['MailAccount'],{'foreignKey':_0x53da('0x1e6'),'as':_0x53da('0x1e7')});db[_0x53da('0x1e8')][_0x53da('0x156')](db[_0x53da('0x192')],{});db[_0x53da('0x1e8')][_0x53da('0x156')](db[_0x53da('0x6f')],{});db[_0x53da('0x1e8')]['belongsTo'](db[_0x53da('0x6a')],{'foreignKey':'FromChatWebsiteId','as':_0x53da('0x1e9')});db['ChatTransferReport'][_0x53da('0x156')](db['User'],{'foreignKey':'FromUserId','as':_0x53da('0x1e2')});db[_0x53da('0x1e8')][_0x53da('0x156')](db[_0x53da('0x10')],{'foreignKey':_0x53da('0x1e3'),'as':_0x53da('0x1e4')});db[_0x53da('0x1e8')]['belongsTo'](db['ChatQueue'],{'foreignKey':'ToChatQueueId','as':_0x53da('0x1e5')});db[_0x53da('0x1e8')]['belongsTo'](db[_0x53da('0x6a')],{'foreignKey':_0x53da('0x1ea'),'as':_0x53da('0x1e7')});db[_0x53da('0xf8')][_0x53da('0x156')](db[_0x53da('0x54')],{});db[_0x53da('0xf8')][_0x53da('0x156')](db['FaxInteraction'],{});db[_0x53da('0xf8')][_0x53da('0x156')](db[_0x53da('0x50')],{'foreignKey':_0x53da('0x1eb'),'as':_0x53da('0x1e9')});db[_0x53da('0xf8')][_0x53da('0x156')](db[_0x53da('0x10')],{'foreignKey':_0x53da('0x1e1'),'as':_0x53da('0x1e2')});db['FaxTransferReport'][_0x53da('0x156')](db[_0x53da('0x10')],{'foreignKey':_0x53da('0x1e3'),'as':_0x53da('0x1e4')});db[_0x53da('0xf8')][_0x53da('0x156')](db[_0x53da('0x56')],{'foreignKey':_0x53da('0x1ec'),'as':'ToQueue'});db[_0x53da('0xf8')][_0x53da('0x156')](db[_0x53da('0x50')],{'foreignKey':'ToFaxAccountId','as':_0x53da('0x1e7')});db[_0x53da('0xf9')][_0x53da('0x156')](db[_0x53da('0x18b')],{});db[_0x53da('0xf9')]['belongsTo'](db[_0x53da('0x66')],{});db[_0x53da('0xf9')][_0x53da('0x156')](db[_0x53da('0x62')],{'foreignKey':_0x53da('0x1ed'),'as':_0x53da('0x1e9')});db['OpenchannelTransferReport'][_0x53da('0x156')](db['User'],{'foreignKey':_0x53da('0x1e1'),'as':_0x53da('0x1e2')});db[_0x53da('0xf9')][_0x53da('0x156')](db[_0x53da('0x10')],{'foreignKey':_0x53da('0x1e3'),'as':'ToAgent'});db[_0x53da('0xf9')][_0x53da('0x156')](db[_0x53da('0x68')],{'foreignKey':_0x53da('0x1ee'),'as':'ToQueue'});db['OpenchannelTransferReport']['belongsTo'](db['OpenchannelAccount'],{'foreignKey':_0x53da('0x1ef'),'as':_0x53da('0x1e7')});db[_0x53da('0x1f0')][_0x53da('0x156')](db[_0x53da('0x5f')],{});db[_0x53da('0x1f0')][_0x53da('0x156')](db[_0x53da('0x5d')],{});db[_0x53da('0x1f0')]['belongsTo'](db[_0x53da('0x5a')],{'foreignKey':_0x53da('0x1f1'),'as':_0x53da('0x1e9')});db['SmsTransferReport'][_0x53da('0x156')](db[_0x53da('0x10')],{'foreignKey':_0x53da('0x1e1'),'as':_0x53da('0x1e2')});db[_0x53da('0x1f0')][_0x53da('0x156')](db[_0x53da('0x10')],{'foreignKey':_0x53da('0x1e3'),'as':'ToAgent'});db['SmsTransferReport'][_0x53da('0x156')](db['SmsQueue'],{'foreignKey':_0x53da('0x1f2'),'as':_0x53da('0x1e5')});db['SmsTransferReport'][_0x53da('0x156')](db['SmsAccount'],{'foreignKey':_0x53da('0x1f3'),'as':_0x53da('0x1e7')});db[_0x53da('0x12c')][_0x53da('0x119')](db['Disposition'],{'as':_0x53da('0x17b'),'foreignKey':_0x53da('0x17f'),'onDelete':'cascade'});db[_0x53da('0x12c')]['hasMany'](db['CmCustomField'],{'as':_0x53da('0x1f4'),'foreignKey':_0x53da('0x17f')});db[_0x53da('0x12c')][_0x53da('0x119')](db[_0x53da('0x173')],{'as':_0x53da('0x12b'),'onDelete':_0x53da('0x118'),'foreignKey':_0x53da('0x17f')});db[_0x53da('0x12c')][_0x53da('0x119')](db[_0x53da('0x7a')],{'as':_0x53da('0x11c'),'foreignKey':_0x53da('0x17f')});db[_0x53da('0x12c')][_0x53da('0x119')](db[_0x53da('0x7c')],{'as':'HopperHistory','foreignKey':_0x53da('0x17f')});db[_0x53da('0x12c')][_0x53da('0x119')](db[_0x53da('0x7e')],{'as':'ReportAgentPreview','foreignKey':_0x53da('0x17f')});db['CmList'][_0x53da('0x127')](db[_0x53da('0x1a')],{'as':_0x53da('0x1f5'),'through':_0x53da('0x159')});db[_0x53da('0x12c')][_0x53da('0x127')](db[_0x53da('0x10')],{'as':_0x53da('0x15a'),'through':'cm_user_has_lists'});db[_0x53da('0xfc')][_0x53da('0x119')](db[_0x53da('0x17')],{'as':_0x53da('0x1ae'),'onDelete':_0x53da('0x118')});db[_0x53da('0xfc')][_0x53da('0x127')](db[_0x53da('0x10')],{'as':'Agents','through':_0x53da('0x111')});db[_0x53da('0xfc')]['belongsToMany'](db['Team'],{'through':'TeamVoicePrefix','as':_0x53da('0x15b')});db['UserProfile'][_0x53da('0x119')](db['User'],{'as':_0x53da('0x171'),'foreignKey':_0x53da('0x126')});db[_0x53da('0x125')][_0x53da('0x119')](db[_0x53da('0xfe')],{'as':_0x53da('0x1f6'),'foreignKey':'userProfileId','onDelete':'cascade'});db[_0x53da('0xfe')][_0x53da('0x119')](db[_0x53da('0x1f7')],{'as':'Resources','foreignKey':'sectionId','onDelete':_0x53da('0x118')});db['WhatsappAccount'][_0x53da('0x119')](db[_0x53da('0x86')],{'as':'Dispositions','foreignKey':_0x53da('0x1f8'),'onDelete':_0x53da('0x118')});db[_0x53da('0x102')][_0x53da('0x119')](db[_0x53da('0x85')],{'as':_0x53da('0x165'),'foreignKey':_0x53da('0x1f8')});db[_0x53da('0x102')][_0x53da('0x119')](db[_0x53da('0x1f9')],{'as':_0x53da('0x15c'),'foreignKey':_0x53da('0x1f8')});db[_0x53da('0x102')][_0x53da('0x119')](db[_0x53da('0x105')],{'as':_0x53da('0x166')});db['WhatsappAccount'][_0x53da('0x119')](db['WhatsappApplication'],{'as':_0x53da('0x17d')});db[_0x53da('0x102')][_0x53da('0x156')](db[_0x53da('0x12c')],{'as':_0x53da('0x167'),'foreignKey':_0x53da('0x17f')});db['WhatsappAccount']['belongsTo'](db[_0x53da('0x8b')],{'as':_0x53da('0x169'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x53da('0x102')][_0x53da('0x127')](db[_0x53da('0x10')],{'as':_0x53da('0x15a'),'through':'user_has_whatsapp_accounts'});db[_0x53da('0x1fa')][_0x53da('0x156')](db[_0x53da('0x10')],{'onDelete':_0x53da('0x163')});db[_0x53da('0x1fa')][_0x53da('0x156')](db[_0x53da('0x109')],{'onDelete':'restrict'});db[_0x53da('0x1fa')][_0x53da('0x156')](db[_0x53da('0x102')],{'onDelete':_0x53da('0x163')});db[_0x53da('0x1fa')][_0x53da('0x156')](db[_0x53da('0x89')],{'onDelete':_0x53da('0x163'),'foreignKey':_0x53da('0x157')});db['WhatsappApplication'][_0x53da('0x156')](db[_0x53da('0x93')],{'onDelete':_0x53da('0x163'),'foreignKey':_0x53da('0x177')});db['WhatsappInteraction'][_0x53da('0x119')](db['WhatsappMessage'],{'as':_0x53da('0x15c'),'onDelete':'cascade','foreignKey':'WhatsappInteractionId'});db[_0x53da('0x105')][_0x53da('0x156')](db['WhatsappAccount'],{'as':_0x53da('0x16c'),'foreignKey':_0x53da('0x1f8')});db['WhatsappInteraction'][_0x53da('0x156')](db['CmContact'],{'as':_0x53da('0x160'),'foreignKey':'ContactId'});db['WhatsappInteraction'][_0x53da('0x156')](db[_0x53da('0x10')],{'as':_0x53da('0x16d'),'foreignKey':'UserId'});db[_0x53da('0x105')][_0x53da('0x127')](db[_0x53da('0x93')],{'through':_0x53da('0x1b5'),'as':'Tags'});db[_0x53da('0x105')]['belongsToMany'](db['Tag'],{'through':_0x53da('0x1b5'),'as':_0x53da('0x170')});db['WhatsappInteraction'][_0x53da('0x127')](db[_0x53da('0x10')],{'as':_0x53da('0x171'),'through':_0x53da('0x135'),'foreignKey':_0x53da('0x1fb')});db[_0x53da('0x1f9')]['belongsTo'](db[_0x53da('0x10')],{'as':_0x53da('0x10')});db[_0x53da('0x1f9')]['belongsTo'](db['CmContact'],{'onDelete':_0x53da('0x118'),'as':_0x53da('0x160')});db['WhatsappMessage'][_0x53da('0x156')](db[_0x53da('0x105')],{'onDelete':_0x53da('0x118'),'as':_0x53da('0x174'),'foreignKey':_0x53da('0x1fb')});db[_0x53da('0x1f9')]['belongsTo'](db[_0x53da('0x102')],{'as':_0x53da('0x16c'),'foreignKey':_0x53da('0x1f8')});db[_0x53da('0x108')][_0x53da('0x156')](db[_0x53da('0x102')],{});db[_0x53da('0x108')][_0x53da('0x156')](db[_0x53da('0x12c')],{'as':_0x53da('0x167'),'foreignKey':_0x53da('0x17f')});db[_0x53da('0x108')]['belongsTo'](db['CmContact'],{'as':_0x53da('0x160'),'foreignKey':_0x53da('0x161')});db[_0x53da('0x108')][_0x53da('0x156')](db[_0x53da('0x105')],{});db[_0x53da('0x108')][_0x53da('0x156')](db[_0x53da('0x109')],{});db[_0x53da('0x108')][_0x53da('0x156')](db[_0x53da('0x1f9')],{});db['WhatsappQueueReport'][_0x53da('0x156')](db[_0x53da('0x10')],{});db[_0x53da('0x1fc')][_0x53da('0x156')](db[_0x53da('0x1f9')],{});db[_0x53da('0x1fc')][_0x53da('0x156')](db[_0x53da('0x105')],{});db[_0x53da('0x1fc')]['belongsTo'](db[_0x53da('0x102')],{'foreignKey':'FromWhatsappAccountId','as':_0x53da('0x1e9')});db['WhatsappTransferReport'][_0x53da('0x156')](db['WhatsappAccount'],{'foreignKey':_0x53da('0x1fd'),'as':'ToAccount'});db[_0x53da('0x1fc')]['belongsTo'](db[_0x53da('0x109')],{'foreignKey':_0x53da('0x1fe'),'as':'ToQueue'});db[_0x53da('0x1fc')]['belongsTo'](db[_0x53da('0x10')],{'foreignKey':_0x53da('0x1e1'),'as':_0x53da('0x1e2')});db['WhatsappTransferReport'][_0x53da('0x156')](db[_0x53da('0x10')],{'foreignKey':_0x53da('0x1e3'),'as':_0x53da('0x1e4')});db[_0x53da('0x109')]['belongsToMany'](db[_0x53da('0x10')],{'as':_0x53da('0x15a'),'through':_0x53da('0x3b'),'foreignKey':_0x53da('0x1ff')});db[_0x53da('0x109')][_0x53da('0x127')](db[_0x53da('0xec')],{'through':_0x53da('0x1dc'),'as':_0x53da('0x15b')});db['UserSetting'][_0x53da('0x156')](db[_0x53da('0x10')],{'as':_0x53da('0x200'),'foreignKey':_0x53da('0x115'),'onDelete':_0x53da('0x118'),'hooks':!![]});db[_0x53da('0x10b')][_0x53da('0x116')](db[_0x53da('0xca')],{'as':_0x53da('0xca'),'onDelete':'restrict'});db['CloudProvider']['hasOne'](db[_0x53da('0x3d')],{'as':_0x53da('0x201'),'onDelete':'restrict'});db[_0x53da('0x10b')]['hasOne'](db[_0x53da('0x3f')],{'as':_0x53da('0x202'),'onDelete':_0x53da('0x163')});module[_0x53da('0x203')]={'db':db,'dbH':dbH};
\ No newline at end of file
+var _0x4cf9=['Dispositions','Answers','Messages','Interactions','Applications','List','ListId','Template','Agents','MailInteractionId','Owner','mail_interaction_has_tags','Tags','ThroughTags','Users','Attachments','Interaction','ChatWebsiteId','ChatOfflineMessageId','TagId','MailQueueReport','Dashboard','Items','FaxAccountId','Exntensions','FaxMessage','FaxInteractionId','Account','fax_interaction_has_tags','AttachmentId','team_has_fax_queues','FaxQueueReport','SmsAccountId','sms_interaction_has_tags','SmsInteractionId','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','openchannel_interaction_has_tags','user_has_openchannel_interactions','OpenchannelInteractionId','OpenchannelQueueId','team_has_openchannel_queues','ProactiveActions','user_has_chat_websites','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','ChatGroupId','CmContactHasItem','Hoppers','Company','CompanyId','cm_contact_has_tags','CmHopperId','Agent','Campaign','CampaignId','OwnerId','Automation','Condition','OneAll','Any','AutomationAnyId','AutomationId','ParentId','Intervals','Extensions','ChatApplications','FaxApplications','SmsApplications','DefaultReportId','Mohs','WhatsappInteraction','ItemType','Hopper','CmContactId','Trigger','AllConditions','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','Actions','TriggerId','AnalyticFieldReport','Fields','CustomReportId','MetricId','Configurations','AccountId','Subjects','DescriptionId','FieldId','Subject','SubjectId','Description','Field','SugarcrmField','Descriptions','VariableId','DeskAccount','DeskField','int_desk_configuration_has_tags','ZohoConfiguration','ZohoAccount','int_zendesk_configuration_has_tags','int_freshdesk_configuration_has_tags','ToId','SessionId','JscriptyAnswerReport','SmsQueueReport','ProjectId','user_has_square_projects','team_has_mail_queues','team_has_chat_queues','team_has_whatsapp_queues','WhatsappQueues','VoicePrefixes','TrunkId','SquareProjectId','Lists','campaigns_has_cm_lists','campaigns_has_cm_blacklists','MailTransferReport','FromMailAccountId','FromAccount','FromUserId','FromAgent','ToUserId','ToAgent','ToMailQueueId','ChatTransferReport','FromChatWebsiteId','ToChatQueueId','ToQueue','ToChatWebsiteId','ToAccount','ToFaxAccountId','OpenchannelTransferReport','ToOpenchannelQueueId','ToOpenchannelAccountId','SmsTransferReport','CustomFields','Queues','voice_queues_has_cm_lists','sectionId','WhatsappAccountId','WhatsappMessage','whatsapp_interaction_has_tags','WhatsappInteractionId','WhatsappQueueReport','ToQueueId','exports','../config/environment','sequelize','lodash','jstz','determine','defaultsDeep','motion2','xcall','xC@LL1234','127.0.0.1','mysql','utf8mb4','name','sequelizeHistory','utf8_general_ci','database','username','password','options','User','import','../api/user/user.model','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','../api/screenRecording/screenRecording.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','../api/voiceAgentReport/voiceAgentReport.model','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailInteraction/mailInteraction.model','MailMessage','MailApplication','../api/mailApplication/mailApplication.model','../api/mailQueueReport/mailQueueReport.model','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxQueue','../api/faxQueue/faxQueue.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatMessage','../api/chatMessage/chatMessage.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','../api/cmContact/cmContact.model','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','../api/cmHopperFinal/cmHopperFinal.model','../api/cmHopperHistory/cmHopperHistory.model','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','../api/automation/automation.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','../api/condition/condition.model','Interval','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','ContactItemType','../api/cmContactHasItem/cmContactHasItem.model','CmHopperAdditionalPhone','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model','../api/template/template.model','../api/trigger/trigger.model','Variable','../api/variable/variable.model','Integration','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmField/intSugarcrmField.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','../api/intDeskField/intDeskField.model','../api/intZohoAccount/intZohoAccount.model','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','ServicenowAccount','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/integration/integration.model','Network','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','../api/squareReport/squareReport.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','../api/squareOdbc/squareOdbc.model','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','License','../api/campaign/campaign.model','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','../api/openchannelTransferReport/openchannelTransferReport.model','../api/smsTransferReport/smsTransferReport.model','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','UserProfileSection','../api/userProfileSection/userProfileSection.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','../api/userNotification/userNotification.model','WhatsappAccount','WhatsappApplication','../api/whatsappInteraction/whatsappInteraction.model','../api/whatsappMessage/whatsappMessage.model','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','VoiceMail','hasOne','UserSetting','cascade','UserId','hasMany','VoiceQueuesRt','CmHopperFinal','HopperFinals','CmHopperHistory','HopperHistory','ReportAgentPreview','OpenchannelInteractions','ChatInteractions','MailInteraction','MailInteractions','WhatsappInteractions','UserNotification','UserNotifications','belongsTo','userProfileId','belongsToMany','Groups','chat_group_has_users','CmContact','Contacts','cm_user_has_contacts','CmList','user_has_teams','user_has_mail_interactions','user_has_chat_interactions','FaxInteractions','user_has_fax_interactions','SmsInteractions','user_has_sms_interactions','user_has_whatsapp_interactions','VoiceQueues','MailQueues','ChatQueues','FaxQueues','SmsQueues','OpenchannelQueues','cm_user_has_lists','ChatWebsites','FaxAccount','FaxAccounts','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','user_has_sms_accounts','WhatsappAccounts','user_has_whatsapp_accounts','SquareProject','SquareProjects','SpiedAgents','ChanSpyId','Sounds','moh_has_sounds','Members','VoiceQueueId','CmHopper','HopperHistories','HopperBlacks','JscriptySessions','TrunkBackup','TrunkBackupId','IntervalId','mandatoryDispositionPause','mandatoryDispositionPauseId','Teams','BlackLists','voice_queues_has_cm_blacklists','ScreenRecording','mailboxuser','mailbox','VoiceQueueReport','QueueCalls','uniqueid','VoiceAgentReport','AgentReports','Contact','ContactId','MailAccountId','CloudProvider','CloudProviderId','restrict','Imap','Smtp'];(function(_0x5a0fdb,_0x3ad7a6){var _0x1f7b18=function(_0x3e00fc){while(--_0x3e00fc){_0x5a0fdb['push'](_0x5a0fdb['shift']());}};_0x1f7b18(++_0x3ad7a6);}(_0x4cf9,0x9d));var _0x94cf=function(_0xd8442b,_0x439852){_0xd8442b=_0xd8442b-0x0;var _0x27ef78=_0x4cf9[_0xd8442b];return _0x27ef78;};'use strict';var config=require(_0x94cf('0x0'));var Sequelize=require(_0x94cf('0x1'));var _=require(_0x94cf('0x2'));var jstz=require(_0x94cf('0x3'));var timezone=jstz[_0x94cf('0x4')]();config['sequelize']=_[_0x94cf('0x5')](config[_0x94cf('0x1')],{'database':_0x94cf('0x6'),'username':_0x94cf('0x7'),'password':_0x94cf('0x8'),'options':{'host':_0x94cf('0x9'),'port':0xcea,'dialect':_0x94cf('0xa'),'dialectOptions':{'charset':_0x94cf('0xb')},'logging':![],'timezone':timezone[_0x94cf('0xc')](),'define':{'charset':'utf8','collate':'utf8_general_ci'}}});config['sequelizeHistory']=_[_0x94cf('0x5')](config[_0x94cf('0xd')],{'database':_0x94cf('0x6'),'username':'xcall','password':_0x94cf('0x8'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':_0x94cf('0xa'),'dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone[_0x94cf('0xc')](),'define':{'charset':'utf8','collate':_0x94cf('0xe')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x94cf('0x1')][_0x94cf('0xf')],config[_0x94cf('0x1')][_0x94cf('0x10')],config[_0x94cf('0x1')][_0x94cf('0x11')],config['sequelize'][_0x94cf('0x12')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelizeHistory']['database'],config[_0x94cf('0xd')][_0x94cf('0x10')],config[_0x94cf('0xd')]['password'],config['sequelizeHistory'][_0x94cf('0x12')])};db[_0x94cf('0x13')]=db[_0x94cf('0x1')][_0x94cf('0x14')](_0x94cf('0x15'));db[_0x94cf('0x16')]=db[_0x94cf('0x1')]['import'](_0x94cf('0x17'));db[_0x94cf('0x18')]=db[_0x94cf('0x1')]['import'](_0x94cf('0x19'));db[_0x94cf('0x1a')]=db['sequelize'][_0x94cf('0x14')](_0x94cf('0x1b'));db[_0x94cf('0x1c')]=db[_0x94cf('0x1')]['import'](_0x94cf('0x1d'));db[_0x94cf('0x1e')]=db['sequelize'][_0x94cf('0x14')](_0x94cf('0x1f'));db[_0x94cf('0x20')]=db[_0x94cf('0x1')][_0x94cf('0x14')](_0x94cf('0x21'));db['ScreenRecording']=db[_0x94cf('0x1')][_0x94cf('0x14')](_0x94cf('0x22'));db['VoiceMail']=db['sequelize'][_0x94cf('0x14')]('../api/voiceMail/voiceMail.model');db[_0x94cf('0x23')]=db[_0x94cf('0x1')][_0x94cf('0x14')](_0x94cf('0x24'));db[_0x94cf('0x25')]=db[_0x94cf('0x1')][_0x94cf('0x14')](_0x94cf('0x26'));db[_0x94cf('0x27')]=db[_0x94cf('0x1')][_0x94cf('0x14')](_0x94cf('0x28'));db['VoiceAgentReport']=db[_0x94cf('0x1')][_0x94cf('0x14')](_0x94cf('0x29'));db['VoiceQueueReport']=db[_0x94cf('0x1')][_0x94cf('0x14')](_0x94cf('0x2a'));db[_0x94cf('0x2b')]=db[_0x94cf('0x1')]['import'](_0x94cf('0x2c'));db[_0x94cf('0x2d')]=db['sequelize']['import'](_0x94cf('0x2e'));db[_0x94cf('0x2f')]=db[_0x94cf('0x1')][_0x94cf('0x14')](_0x94cf('0x30'));db[_0x94cf('0x31')]=db[_0x94cf('0x1')]['import']('../api/userVoiceQueueRt/userVoiceQueueRt.model');db[_0x94cf('0x32')]=db[_0x94cf('0x1')][_0x94cf('0x14')](_0x94cf('0x33'));db[_0x94cf('0x34')]=db['sequelize'][_0x94cf('0x14')](_0x94cf('0x35'));db[_0x94cf('0x36')]=db[_0x94cf('0x1')][_0x94cf('0x14')](_0x94cf('0x37'));db[_0x94cf('0x38')]=db[_0x94cf('0x1')][_0x94cf('0x14')]('../api/userFaxQueue/userFaxQueue.model');db[_0x94cf('0x39')]=db[_0x94cf('0x1')][_0x94cf('0x14')](_0x94cf('0x3a'));db[_0x94cf('0x3b')]=db['sequelize'][_0x94cf('0x14')](_0x94cf('0x3c'));db[_0x94cf('0x3d')]=db['sequelize'][_0x94cf('0x14')]('../api/userWhatsappQueue/userWhatsappQueue.model');db[_0x94cf('0x3e')]=db[_0x94cf('0x1')][_0x94cf('0x14')](_0x94cf('0x3f'));db[_0x94cf('0x40')]=db[_0x94cf('0x1')]['import']('../api/mailServerOut/mailServerOut.model');db[_0x94cf('0x41')]=db[_0x94cf('0x1')][_0x94cf('0x14')](_0x94cf('0x42'));db[_0x94cf('0x43')]=db[_0x94cf('0x1')][_0x94cf('0x14')](_0x94cf('0x44'));db[_0x94cf('0x45')]=db['sequelize']['import']('../api/mailSubstatus/mailSubstatus.model');db['MailInteraction']=db[_0x94cf('0x1')][_0x94cf('0x14')](_0x94cf('0x46'));db[_0x94cf('0x47')]=db[_0x94cf('0x1')][_0x94cf('0x14')]('../api/mailMessage/mailMessage.model');db[_0x94cf('0x48')]=db[_0x94cf('0x1')][_0x94cf('0x14')](_0x94cf('0x49'));db['MailQueueReport']=db[_0x94cf('0x1')][_0x94cf('0x14')](_0x94cf('0x4a'));db['Dashboard']=db[_0x94cf('0x1')][_0x94cf('0x14')](_0x94cf('0x4b'));db[_0x94cf('0x4c')]=db[_0x94cf('0x1')]['import'](_0x94cf('0x4d'));db['FaxAccount']=db['sequelize'][_0x94cf('0x14')](_0x94cf('0x4e'));db[_0x94cf('0x4f')]=db[_0x94cf('0x1')][_0x94cf('0x14')](_0x94cf('0x50'));db[_0x94cf('0x51')]=db['sequelize'][_0x94cf('0x14')](_0x94cf('0x52'));db['FaxMessage']=db[_0x94cf('0x1')][_0x94cf('0x14')]('../api/faxMessage/faxMessage.model');db[_0x94cf('0x53')]=db[_0x94cf('0x1')][_0x94cf('0x14')](_0x94cf('0x54'));db['FaxQueueReport']=db[_0x94cf('0x1')]['import']('../api/faxQueueReport/faxQueueReport.model');db[_0x94cf('0x55')]=db[_0x94cf('0x1')][_0x94cf('0x14')](_0x94cf('0x56'));db[_0x94cf('0x57')]=db[_0x94cf('0x1')][_0x94cf('0x14')](_0x94cf('0x58'));db[_0x94cf('0x59')]=db[_0x94cf('0x1')][_0x94cf('0x14')](_0x94cf('0x5a'));db[_0x94cf('0x5b')]=db[_0x94cf('0x1')][_0x94cf('0x14')](_0x94cf('0x5c'));db[_0x94cf('0x5d')]=db[_0x94cf('0x1')][_0x94cf('0x14')](_0x94cf('0x5e'));db[_0x94cf('0x5f')]=db[_0x94cf('0x1')]['import'](_0x94cf('0x60'));db[_0x94cf('0x61')]=db[_0x94cf('0x1')][_0x94cf('0x14')]('../api/openchannelApplication/openchannelApplication.model');db[_0x94cf('0x62')]=db[_0x94cf('0x1')][_0x94cf('0x14')](_0x94cf('0x63'));db[_0x94cf('0x64')]=db[_0x94cf('0x1')]['import'](_0x94cf('0x65'));db[_0x94cf('0x66')]=db[_0x94cf('0x1')][_0x94cf('0x14')]('../api/openchannelQueue/openchannelQueue.model');db[_0x94cf('0x67')]=db[_0x94cf('0x1')][_0x94cf('0x14')](_0x94cf('0x68'));db[_0x94cf('0x69')]=db['sequelize'][_0x94cf('0x14')](_0x94cf('0x6a'));db[_0x94cf('0x6b')]=db['sequelize'][_0x94cf('0x14')](_0x94cf('0x6c'));db[_0x94cf('0x6d')]=db['sequelize'][_0x94cf('0x14')](_0x94cf('0x6e'));db[_0x94cf('0x6f')]=db[_0x94cf('0x1')][_0x94cf('0x14')](_0x94cf('0x70'));db[_0x94cf('0x71')]=db[_0x94cf('0x1')][_0x94cf('0x14')](_0x94cf('0x72'));db[_0x94cf('0x73')]=db[_0x94cf('0x1')]['import']('../api/chatQueue/chatQueue.model');db[_0x94cf('0x74')]=db[_0x94cf('0x1')][_0x94cf('0x14')](_0x94cf('0x75'));db[_0x94cf('0x76')]=db[_0x94cf('0x1')][_0x94cf('0x14')](_0x94cf('0x77'));db[_0x94cf('0x78')]=db[_0x94cf('0x1')][_0x94cf('0x14')](_0x94cf('0x79'));db['CmContact']=db[_0x94cf('0x1')]['import'](_0x94cf('0x7a'));db['CmHopper']=db[_0x94cf('0x1')][_0x94cf('0x14')](_0x94cf('0x7b'));db[_0x94cf('0x7c')]=db['sequelize'][_0x94cf('0x14')](_0x94cf('0x7d'));db['CmHopperFinal']=db[_0x94cf('0x1')]['import'](_0x94cf('0x7e'));db['CmHopperHistory']=db['sequelize'][_0x94cf('0x14')](_0x94cf('0x7f'));db['ReportAgentPreview']=db[_0x94cf('0x1')][_0x94cf('0x14')](_0x94cf('0x80'));db[_0x94cf('0x81')]=db[_0x94cf('0x1')]['import'](_0x94cf('0x82'));db[_0x94cf('0x83')]=db['sequelize'][_0x94cf('0x14')](_0x94cf('0x84'));db['Automation']=db[_0x94cf('0x1')]['import'](_0x94cf('0x85'));db[_0x94cf('0x86')]=db[_0x94cf('0x1')][_0x94cf('0x14')](_0x94cf('0x87'));db[_0x94cf('0x88')]=db['sequelize'][_0x94cf('0x14')](_0x94cf('0x89'));db['Condition']=db[_0x94cf('0x1')][_0x94cf('0x14')](_0x94cf('0x8a'));db[_0x94cf('0x8b')]=db[_0x94cf('0x1')][_0x94cf('0x14')]('../api/interval/interval.model');db[_0x94cf('0x8c')]=db[_0x94cf('0x1')][_0x94cf('0x14')](_0x94cf('0x8d'));db[_0x94cf('0x8e')]=db[_0x94cf('0x1')]['import'](_0x94cf('0x8f'));db[_0x94cf('0x90')]=db[_0x94cf('0x1')][_0x94cf('0x14')](_0x94cf('0x91'));db[_0x94cf('0x92')]=db[_0x94cf('0x1')][_0x94cf('0x14')]('../api/schedule/schedule.model');db[_0x94cf('0x93')]=db[_0x94cf('0x1')][_0x94cf('0x14')](_0x94cf('0x94'));db[_0x94cf('0x95')]=db[_0x94cf('0x1')][_0x94cf('0x14')](_0x94cf('0x96'));db[_0x94cf('0x97')]=db[_0x94cf('0x1')][_0x94cf('0x14')]('../api/contactItemType/contactItemType.model');db['CmContactHasItem']=db[_0x94cf('0x1')][_0x94cf('0x14')](_0x94cf('0x98'));db[_0x94cf('0x99')]=db[_0x94cf('0x1')][_0x94cf('0x14')](_0x94cf('0x9a'));db['Template']=db['sequelize'][_0x94cf('0x14')](_0x94cf('0x9b'));db['Trigger']=db['sequelize']['import'](_0x94cf('0x9c'));db[_0x94cf('0x9d')]=db[_0x94cf('0x1')][_0x94cf('0x14')](_0x94cf('0x9e'));db[_0x94cf('0x9f')]=db[_0x94cf('0x1')]['import']('../api/integration/integration.model');db[_0x94cf('0xa0')]=db['sequelize'][_0x94cf('0x14')](_0x94cf('0xa1'));db[_0x94cf('0xa2')]=db[_0x94cf('0x1')][_0x94cf('0x14')]('../api/analyticCustomReport/analyticCustomReport.model');db[_0x94cf('0xa3')]=db[_0x94cf('0x1')][_0x94cf('0x14')](_0x94cf('0xa4'));db[_0x94cf('0xa5')]=db['sequelize'][_0x94cf('0x14')](_0x94cf('0xa6'));db[_0x94cf('0xa7')]=db[_0x94cf('0x1')]['import'](_0x94cf('0xa8'));db['AnalyticFieldReport']=db[_0x94cf('0x1')][_0x94cf('0x14')](_0x94cf('0xa9'));db[_0x94cf('0xaa')]=db[_0x94cf('0x1')]['import'](_0x94cf('0xab'));db[_0x94cf('0xac')]=db[_0x94cf('0x1')][_0x94cf('0x14')](_0x94cf('0xad'));db[_0x94cf('0xae')]=db['sequelize'][_0x94cf('0x14')](_0x94cf('0xaf'));db[_0x94cf('0xb0')]=db['sequelize']['import'](_0x94cf('0xb1'));db[_0x94cf('0xb2')]=db[_0x94cf('0x1')][_0x94cf('0x14')](_0x94cf('0xb3'));db[_0x94cf('0xb4')]=db[_0x94cf('0x1')][_0x94cf('0x14')]('../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model');db['SugarcrmField']=db[_0x94cf('0x1')][_0x94cf('0x14')](_0x94cf('0xb5'));db['DeskAccount']=db['sequelize'][_0x94cf('0x14')]('../api/intDeskAccount/intDeskAccount.model');db[_0x94cf('0xb6')]=db[_0x94cf('0x1')][_0x94cf('0x14')](_0x94cf('0xb7'));db['DeskField']=db['sequelize'][_0x94cf('0x14')](_0x94cf('0xb8'));db['ZohoAccount']=db[_0x94cf('0x1')][_0x94cf('0x14')](_0x94cf('0xb9'));db['ZohoConfiguration']=db[_0x94cf('0x1')][_0x94cf('0x14')]('../api/intZohoConfiguration/intZohoConfiguration.model');db[_0x94cf('0xba')]=db[_0x94cf('0x1')][_0x94cf('0x14')](_0x94cf('0xbb'));db[_0x94cf('0xbc')]=db[_0x94cf('0x1')][_0x94cf('0x14')](_0x94cf('0xbd'));db[_0x94cf('0xbe')]=db[_0x94cf('0x1')][_0x94cf('0x14')]('../api/intZendeskConfiguration/intZendeskConfiguration.model');db[_0x94cf('0xbf')]=db[_0x94cf('0x1')]['import'](_0x94cf('0xc0'));db[_0x94cf('0xc1')]=db[_0x94cf('0x1')][_0x94cf('0x14')](_0x94cf('0xc2'));db[_0x94cf('0xc3')]=db['sequelize'][_0x94cf('0x14')](_0x94cf('0xc4'));db[_0x94cf('0xc5')]=db['sequelize'][_0x94cf('0x14')](_0x94cf('0xc6'));db[_0x94cf('0xc7')]=db[_0x94cf('0x1')][_0x94cf('0x14')]('../api/intVtigerAccount/intVtigerAccount.model');db[_0x94cf('0xc8')]=db[_0x94cf('0x1')][_0x94cf('0x14')](_0x94cf('0xc9'));db[_0x94cf('0xca')]=db[_0x94cf('0x1')][_0x94cf('0x14')]('../api/intVtigerField/intVtigerField.model');db[_0x94cf('0xcb')]=db[_0x94cf('0x1')][_0x94cf('0x14')]('../api/intServicenowAccount/intServicenowAccount.model');db[_0x94cf('0xcc')]=db[_0x94cf('0x1')][_0x94cf('0x14')](_0x94cf('0xcd'));db[_0x94cf('0xce')]=db[_0x94cf('0x1')][_0x94cf('0x14')](_0x94cf('0xcf'));db[_0x94cf('0xd0')]=db[_0x94cf('0x1')]['import'](_0x94cf('0xd1'));db[_0x94cf('0xd2')]=db[_0x94cf('0x1')][_0x94cf('0x14')](_0x94cf('0xd3'));db[_0x94cf('0xd4')]=db['sequelize'][_0x94cf('0x14')]('../api/intDynamics365Field/intDynamics365Field.model');db[_0x94cf('0xd5')]=db[_0x94cf('0x1')][_0x94cf('0x14')](_0x94cf('0xd6'));db[_0x94cf('0xd7')]=db['sequelize'][_0x94cf('0x14')](_0x94cf('0xd8'));db[_0x94cf('0xd9')]=db[_0x94cf('0x1')][_0x94cf('0x14')]('../api/intFreshsalesField/intFreshsalesField.model');db['Integration']=db[_0x94cf('0x1')][_0x94cf('0x14')](_0x94cf('0xda'));db[_0x94cf('0xdb')]=db[_0x94cf('0x1')][_0x94cf('0x14')](_0x94cf('0xdc'));db[_0x94cf('0xdd')]=db['sequelize'][_0x94cf('0x14')](_0x94cf('0xde'));db[_0x94cf('0xdf')]=db[_0x94cf('0x1')]['import'](_0x94cf('0xe0'));db['JscriptyAnswerReport']=db[_0x94cf('0x1')][_0x94cf('0x14')](_0x94cf('0xe1'));db[_0x94cf('0xe2')]=db[_0x94cf('0x1')]['import'](_0x94cf('0xe3'));db[_0x94cf('0xe4')]=db[_0x94cf('0x1')][_0x94cf('0x14')](_0x94cf('0xe5'));db['SmsQueueReport']=db[_0x94cf('0x1')][_0x94cf('0x14')]('../api/smsQueueReport/smsQueueReport.model');db['SquareReport']=db[_0x94cf('0x1')]['import'](_0x94cf('0xe6'));db['SquareDetailsReport']=db[_0x94cf('0x1')][_0x94cf('0x14')]('../api/squareReportDetail/squareReportDetail.model');db[_0x94cf('0xe7')]=db[_0x94cf('0x1')]['import'](_0x94cf('0xe8'));db[_0x94cf('0xe9')]=db[_0x94cf('0x1')][_0x94cf('0x14')]('../api/setting/setting.model');db['SquareOdbc']=db[_0x94cf('0x1')][_0x94cf('0x14')](_0x94cf('0xea'));db['SquareProject']=db[_0x94cf('0x1')][_0x94cf('0x14')](_0x94cf('0xeb'));db[_0x94cf('0xec')]=db[_0x94cf('0x1')][_0x94cf('0x14')](_0x94cf('0xed'));db[_0x94cf('0xee')]=db[_0x94cf('0x1')][_0x94cf('0x14')](_0x94cf('0xef'));db[_0x94cf('0xf0')]=db['sequelize'][_0x94cf('0x14')](_0x94cf('0xf1'));db[_0x94cf('0xf2')]=db[_0x94cf('0x1')][_0x94cf('0x14')]('../api/license/license.model');db['Campaign']=db['sequelize'][_0x94cf('0x14')](_0x94cf('0xf3'));db[_0x94cf('0xf4')]=db[_0x94cf('0x1')][_0x94cf('0x14')](_0x94cf('0xf5'));db[_0x94cf('0xf6')]=db[_0x94cf('0x1')]['import'](_0x94cf('0xf7'));db[_0x94cf('0xf8')]=db[_0x94cf('0x1')][_0x94cf('0x14')](_0x94cf('0xf9'));db['MailTransferReport']=db['sequelize'][_0x94cf('0x14')]('../api/mailTransferReport/mailTransferReport.model');db['ChatTransferReport']=db[_0x94cf('0x1')][_0x94cf('0x14')](_0x94cf('0xfa'));db[_0x94cf('0xfb')]=db[_0x94cf('0x1')][_0x94cf('0x14')](_0x94cf('0xfc'));db['OpenchannelTransferReport']=db[_0x94cf('0x1')][_0x94cf('0x14')](_0x94cf('0xfd'));db['SmsTransferReport']=db[_0x94cf('0x1')][_0x94cf('0x14')](_0x94cf('0xfe'));db['CmList']=db[_0x94cf('0x1')][_0x94cf('0x14')](_0x94cf('0xff'));db[_0x94cf('0x100')]=db[_0x94cf('0x1')][_0x94cf('0x14')](_0x94cf('0x101'));db[_0x94cf('0x102')]=db['sequelize'][_0x94cf('0x14')]('../api/userProfile/userProfile.model');db[_0x94cf('0x103')]=db[_0x94cf('0x1')][_0x94cf('0x14')](_0x94cf('0x104'));db[_0x94cf('0x105')]=db[_0x94cf('0x1')]['import'](_0x94cf('0x106'));db['UserNotification']=db[_0x94cf('0x1')][_0x94cf('0x14')](_0x94cf('0x107'));db[_0x94cf('0x108')]=db[_0x94cf('0x1')][_0x94cf('0x14')]('../api/whatsappAccount/whatsappAccount.model');db[_0x94cf('0x109')]=db[_0x94cf('0x1')][_0x94cf('0x14')]('../api/whatsappApplication/whatsappApplication.model');db['WhatsappInteraction']=db[_0x94cf('0x1')][_0x94cf('0x14')](_0x94cf('0x10a'));db['WhatsappMessage']=db[_0x94cf('0x1')][_0x94cf('0x14')](_0x94cf('0x10b'));db['WhatsappQueueReport']=db[_0x94cf('0x1')]['import'](_0x94cf('0x10c'));db[_0x94cf('0x10d')]=db[_0x94cf('0x1')][_0x94cf('0x14')](_0x94cf('0x10e'));db[_0x94cf('0x10f')]=db[_0x94cf('0x1')]['import'](_0x94cf('0x110'));db['CloudProvider']=db['sequelize']['import']('../api/cloudProvider/cloudProvider.model');db[_0x94cf('0x111')]=db[_0x94cf('0x1')][_0x94cf('0x14')](_0x94cf('0x112'));db[_0x94cf('0x113')]=db[_0x94cf('0x1')]['import'](_0x94cf('0x114'));db[_0x94cf('0x115')]=db[_0x94cf('0x1')]['import']('../api/userVoicePrefix/userVoicePrefix.model');db['UserSetting']=db[_0x94cf('0x1')]['import']('../api/user-setting/user-setting.model');db[_0x94cf('0x13')]['hasOne'](db[_0x94cf('0x116')],{'as':'VoiceMail','onDelete':'cascade','foreignKey':'UserId'});db[_0x94cf('0x13')][_0x94cf('0x117')](db[_0x94cf('0x118')],{'as':'userSetting','onDelete':_0x94cf('0x119'),'foreignKey':_0x94cf('0x11a')});db[_0x94cf('0x13')][_0x94cf('0x11b')](db['VoiceRecording'],{'as':'Recordings','foreignKey':_0x94cf('0x11a')});db[_0x94cf('0x13')][_0x94cf('0x11b')](db['UserVoiceQueueRt'],{'as':_0x94cf('0x11c'),'foreignKey':_0x94cf('0x11a')});db['User'][_0x94cf('0x11b')](db[_0x94cf('0x1a')],{'as':'Extensions','onDelete':'cascade','hooks':!![]});db[_0x94cf('0x13')][_0x94cf('0x11b')](db[_0x94cf('0x11d')],{'as':_0x94cf('0x11e'),'foreignKey':_0x94cf('0x11a')});db[_0x94cf('0x13')][_0x94cf('0x11b')](db[_0x94cf('0x11f')],{'as':_0x94cf('0x120'),'foreignKey':_0x94cf('0x11a')});db[_0x94cf('0x13')][_0x94cf('0x11b')](db[_0x94cf('0x121')],{'as':_0x94cf('0x121'),'foreignKey':_0x94cf('0x11a')});db[_0x94cf('0x13')][_0x94cf('0x11b')](db[_0x94cf('0x62')],{'as':_0x94cf('0x122'),'foreignKey':'UserId'});db[_0x94cf('0x13')][_0x94cf('0x11b')](db['ChatInteraction'],{'as':_0x94cf('0x123'),'foreignKey':_0x94cf('0x11a')});db[_0x94cf('0x13')][_0x94cf('0x11b')](db[_0x94cf('0x59')],{'as':'SmsInteractions','foreignKey':'UserId'});db['User']['hasMany'](db[_0x94cf('0x51')],{'as':'FaxInteractions','foreignKey':_0x94cf('0x11a')});db['User'][_0x94cf('0x11b')](db[_0x94cf('0x124')],{'as':_0x94cf('0x125'),'foreignKey':_0x94cf('0x11a')});db[_0x94cf('0x13')][_0x94cf('0x11b')](db['WhatsappInteraction'],{'as':_0x94cf('0x126'),'foreignKey':_0x94cf('0x11a')});db['User'][_0x94cf('0x11b')](db[_0x94cf('0x127')],{'as':_0x94cf('0x128'),'foreignKey':'SenderId'});db[_0x94cf('0x13')][_0x94cf('0x129')](db[_0x94cf('0x102')],{'as':'UserProfile','foreignKey':_0x94cf('0x12a')});db[_0x94cf('0x13')][_0x94cf('0x12b')](db[_0x94cf('0x74')],{'as':_0x94cf('0x12c'),'through':_0x94cf('0x12d')});db['User']['belongsToMany'](db[_0x94cf('0x12e')],{'as':_0x94cf('0x12f'),'through':_0x94cf('0x130')});db[_0x94cf('0x13')]['belongsToMany'](db[_0x94cf('0x131')],{'as':'Lists','through':'cm_user_has_lists'});db[_0x94cf('0x13')][_0x94cf('0x12b')](db[_0x94cf('0xf0')],{'through':_0x94cf('0x132')});db[_0x94cf('0x13')][_0x94cf('0x12b')](db[_0x94cf('0x124')],{'as':_0x94cf('0x125'),'through':_0x94cf('0x133')});db[_0x94cf('0x13')][_0x94cf('0x12b')](db[_0x94cf('0x6d')],{'as':_0x94cf('0x123'),'through':_0x94cf('0x134')});db[_0x94cf('0x13')][_0x94cf('0x12b')](db['FaxInteraction'],{'as':_0x94cf('0x135'),'through':_0x94cf('0x136')});db[_0x94cf('0x13')][_0x94cf('0x12b')](db['SmsInteraction'],{'as':_0x94cf('0x137'),'through':_0x94cf('0x138')});db[_0x94cf('0x13')][_0x94cf('0x12b')](db[_0x94cf('0x62')],{'as':_0x94cf('0x122'),'through':'user_has_openchannel_interactions'});db[_0x94cf('0x13')][_0x94cf('0x12b')](db['WhatsappInteraction'],{'as':'WhatsappInteractions','through':_0x94cf('0x139')});db[_0x94cf('0x13')][_0x94cf('0x12b')](db['VoiceQueue'],{'as':_0x94cf('0x13a'),'through':_0x94cf('0x32'),'required':![]});db[_0x94cf('0x13')][_0x94cf('0x12b')](db['VoicePrefix'],{'as':'VoicePrefixes','through':'UserVoicePrefix','required':![]});db['User']['belongsToMany'](db['MailQueue'],{'as':_0x94cf('0x13b'),'through':'UserMailQueue','required':![]});db[_0x94cf('0x13')][_0x94cf('0x12b')](db[_0x94cf('0x73')],{'as':_0x94cf('0x13c'),'through':_0x94cf('0x34'),'required':![],'hooks':!![]});db['User'][_0x94cf('0x12b')](db['FaxQueue'],{'as':_0x94cf('0x13d'),'through':_0x94cf('0x38'),'required':![]});db[_0x94cf('0x13')][_0x94cf('0x12b')](db[_0x94cf('0x5d')],{'as':_0x94cf('0x13e'),'through':'UserSmsQueue','required':![]});db[_0x94cf('0x13')][_0x94cf('0x12b')](db[_0x94cf('0x66')],{'as':_0x94cf('0x13f'),'through':_0x94cf('0x3b'),'required':![]});db[_0x94cf('0x13')][_0x94cf('0x12b')](db[_0x94cf('0x10f')],{'as':'WhatsappQueues','through':'UserWhatsappQueue','required':![]});db['User'][_0x94cf('0x12b')](db[_0x94cf('0x131')],{'through':_0x94cf('0x140')});db[_0x94cf('0x13')][_0x94cf('0x12b')](db[_0x94cf('0x67')],{'as':_0x94cf('0x141'),'through':'user_has_chat_websites'});db['User'][_0x94cf('0x12b')](db[_0x94cf('0x142')],{'as':_0x94cf('0x143'),'through':_0x94cf('0x144')});db[_0x94cf('0x13')][_0x94cf('0x12b')](db[_0x94cf('0x41')],{'as':_0x94cf('0x145'),'through':_0x94cf('0x146')});db[_0x94cf('0x13')][_0x94cf('0x12b')](db[_0x94cf('0x5f')],{'as':_0x94cf('0x147'),'through':_0x94cf('0x148')});db[_0x94cf('0x13')][_0x94cf('0x12b')](db[_0x94cf('0x55')],{'as':'SmsAccounts','through':_0x94cf('0x149')});db[_0x94cf('0x13')][_0x94cf('0x12b')](db[_0x94cf('0x108')],{'as':_0x94cf('0x14a'),'through':_0x94cf('0x14b')});db[_0x94cf('0x13')][_0x94cf('0x12b')](db[_0x94cf('0x14c')],{'as':_0x94cf('0x14d'),'through':'user_has_square_projects'});db[_0x94cf('0x16')][_0x94cf('0x11b')](db[_0x94cf('0x1a')],{'as':_0x94cf('0x14e'),'onDelete':_0x94cf('0x119'),'foreignKey':_0x94cf('0x14f')});db['VoiceContext']['hasMany'](db['VoiceExtension'],{'onDelete':_0x94cf('0x119')});db[_0x94cf('0x1a')][_0x94cf('0x11b')](db[_0x94cf('0x1a')],{'as':'Applications','onDelete':_0x94cf('0x119')});db[_0x94cf('0x1c')]['belongsToMany'](db[_0x94cf('0x93')],{'as':_0x94cf('0x150'),'through':_0x94cf('0x151')});db[_0x94cf('0x1e')]['hasMany'](db[_0x94cf('0x31')],{'as':_0x94cf('0x152'),'foreignKey':_0x94cf('0x153')});db['VoiceQueue'][_0x94cf('0x11b')](db[_0x94cf('0x154')],{'as':'Hoppers','foreignKey':_0x94cf('0x153')});db[_0x94cf('0x1e')]['hasMany'](db[_0x94cf('0x11d')],{'as':_0x94cf('0x11e'),'foreignKey':_0x94cf('0x153')});db[_0x94cf('0x1e')][_0x94cf('0x11b')](db[_0x94cf('0x11f')],{'as':_0x94cf('0x155'),'foreignKey':_0x94cf('0x153')});db[_0x94cf('0x1e')][_0x94cf('0x11b')](db['ReportAgentPreview'],{'as':_0x94cf('0x121'),'foreignKey':_0x94cf('0x153')});db[_0x94cf('0x1e')][_0x94cf('0x11b')](db[_0x94cf('0x7c')],{'as':_0x94cf('0x156'),'foreignKey':_0x94cf('0x153')});db[_0x94cf('0x1e')][_0x94cf('0x11b')](db[_0x94cf('0xe4')],{'as':_0x94cf('0x157'),'foreignKey':_0x94cf('0x153')});db['VoiceQueue'][_0x94cf('0x129')](db[_0x94cf('0x2d')],{'as':_0x94cf('0x2d'),'foreignKey':'TrunkId'});db[_0x94cf('0x1e')][_0x94cf('0x129')](db['Trunk'],{'as':_0x94cf('0x158'),'foreignKey':_0x94cf('0x159')});db[_0x94cf('0x1e')][_0x94cf('0x129')](db[_0x94cf('0x8b')],{'as':_0x94cf('0x8b'),'foreignKey':_0x94cf('0x15a')});db[_0x94cf('0x1e')][_0x94cf('0x129')](db[_0x94cf('0x8c')],{'as':_0x94cf('0x15b'),'foreignKey':_0x94cf('0x15c')});db['VoiceQueue'][_0x94cf('0x12b')](db[_0x94cf('0x131')],{'as':'Lists','through':'voice_queues_has_cm_lists'});db['VoiceQueue'][_0x94cf('0x12b')](db[_0x94cf('0x13')],{'as':'Agents','through':'UserVoiceQueue'});db[_0x94cf('0x1e')][_0x94cf('0x12b')](db[_0x94cf('0xf0')],{'as':_0x94cf('0x15d'),'through':_0x94cf('0x111')});db[_0x94cf('0x1e')][_0x94cf('0x12b')](db[_0x94cf('0x131')],{'as':_0x94cf('0x15e'),'through':_0x94cf('0x15f')});db[_0x94cf('0x20')][_0x94cf('0x129')](db[_0x94cf('0x13')],{'as':_0x94cf('0x13'),'foreignKey':_0x94cf('0x11a')});db[_0x94cf('0x160')][_0x94cf('0x129')](db[_0x94cf('0x13')],{'as':_0x94cf('0x13'),'foreignKey':_0x94cf('0x11a')});db['VoiceMail'][_0x94cf('0x11b')](db[_0x94cf('0x23')],{'as':'Messages','onDelete':_0x94cf('0x119'),'foreignKey':_0x94cf('0x161'),'sourceKey':'mailbox'});db['VoiceMailMessage'][_0x94cf('0x129')](db['VoiceMail'],{'foreignKey':'mailboxuser','targetKey':_0x94cf('0x162')});db[_0x94cf('0x25')][_0x94cf('0x11b')](db[_0x94cf('0x163')],{'as':_0x94cf('0x164'),'foreignKey':_0x94cf('0x165'),'constraints':![]});db[_0x94cf('0x25')]['hasMany'](db[_0x94cf('0x166')],{'as':_0x94cf('0x167'),'foreignKey':'uniqueid','constraints':![]});db['VoiceCallReport'][_0x94cf('0x129')](db[_0x94cf('0x13')],{'as':'User','foreignKey':_0x94cf('0x11a')});db['VoiceCallReport'][_0x94cf('0x129')](db['CmContact'],{'as':_0x94cf('0x168'),'foreignKey':_0x94cf('0x169')});db[_0x94cf('0x3e')]['belongsTo'](db[_0x94cf('0x41')],{'as':_0x94cf('0x41'),'foreignKey':_0x94cf('0x16a')});db[_0x94cf('0x3e')][_0x94cf('0x129')](db[_0x94cf('0x16b')],{'as':'CloudProvider','foreignKey':_0x94cf('0x16c'),'onDelete':_0x94cf('0x16d')});db[_0x94cf('0x40')]['belongsTo'](db[_0x94cf('0x41')],{'as':_0x94cf('0x41'),'foreignKey':_0x94cf('0x16a')});db[_0x94cf('0x40')]['belongsTo'](db['CloudProvider'],{'as':_0x94cf('0x16b'),'foreignKey':_0x94cf('0x16c'),'onDelete':_0x94cf('0x16d')});db['MailAccount'][_0x94cf('0x117')](db[_0x94cf('0x3e')],{'as':_0x94cf('0x16e'),'onDelete':'cascade'});db[_0x94cf('0x41')][_0x94cf('0x117')](db[_0x94cf('0x40')],{'as':_0x94cf('0x16f'),'onDelete':'cascade'});db[_0x94cf('0x41')]['hasMany'](db[_0x94cf('0x88')],{'as':_0x94cf('0x170'),'foreignKey':_0x94cf('0x16a'),'onDelete':_0x94cf('0x119')});db[_0x94cf('0x41')]['hasMany'](db['CannedAnswer'],{'as':_0x94cf('0x171'),'foreignKey':'MailAccountId'});db[_0x94cf('0x41')]['hasMany'](db[_0x94cf('0x47')],{'as':_0x94cf('0x172'),'foreignKey':_0x94cf('0x16a')});db[_0x94cf('0x41')][_0x94cf('0x11b')](db[_0x94cf('0x124')],{'as':_0x94cf('0x173')});db['MailAccount'][_0x94cf('0x11b')](db['MailApplication'],{'as':_0x94cf('0x174')});db[_0x94cf('0x41')][_0x94cf('0x129')](db['CmList'],{'as':_0x94cf('0x175'),'foreignKey':_0x94cf('0x176')});db[_0x94cf('0x41')][_0x94cf('0x129')](db[_0x94cf('0x177')],{'as':'Template','foreignKey':'TemplateId'});db[_0x94cf('0x41')][_0x94cf('0x129')](db[_0x94cf('0x8c')],{'as':_0x94cf('0x15b'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x94cf('0x41')][_0x94cf('0x12b')](db[_0x94cf('0x13')],{'as':_0x94cf('0x178'),'through':'user_has_mail_accounts'});db[_0x94cf('0x43')]['belongsToMany'](db['User'],{'as':'Agents','through':_0x94cf('0x36')});db[_0x94cf('0x43')][_0x94cf('0x12b')](db[_0x94cf('0xf0')],{'through':'team_has_mail_queues','as':_0x94cf('0x15d')});db[_0x94cf('0x124')]['hasMany'](db['MailMessage'],{'as':_0x94cf('0x172'),'onDelete':_0x94cf('0x119'),'foreignKey':_0x94cf('0x179')});db['MailInteraction'][_0x94cf('0x129')](db[_0x94cf('0x41')],{'as':'Account','foreignKey':_0x94cf('0x16a')});db[_0x94cf('0x124')][_0x94cf('0x129')](db[_0x94cf('0x12e')],{'as':_0x94cf('0x168'),'foreignKey':_0x94cf('0x169')});db[_0x94cf('0x124')][_0x94cf('0x129')](db[_0x94cf('0x13')],{'as':_0x94cf('0x17a'),'foreignKey':_0x94cf('0x11a')});db[_0x94cf('0x124')][_0x94cf('0x12b')](db[_0x94cf('0x95')],{'through':_0x94cf('0x17b'),'as':_0x94cf('0x17c')});db[_0x94cf('0x124')]['belongsToMany'](db[_0x94cf('0x95')],{'through':_0x94cf('0x17b'),'as':_0x94cf('0x17d')});db[_0x94cf('0x124')][_0x94cf('0x12b')](db[_0x94cf('0x13')],{'as':_0x94cf('0x17e'),'through':_0x94cf('0x133'),'foreignKey':'MailInteractionId'});db[_0x94cf('0x47')]['hasMany'](db[_0x94cf('0xf6')],{'as':_0x94cf('0x17f'),'onDelete':_0x94cf('0x119')});db[_0x94cf('0x47')][_0x94cf('0x129')](db[_0x94cf('0x13')],{'as':_0x94cf('0x13')});db[_0x94cf('0x47')]['belongsTo'](db['CmContact'],{'onDelete':_0x94cf('0x119'),'as':_0x94cf('0x168')});db['MailMessage'][_0x94cf('0x129')](db[_0x94cf('0x124')],{'as':_0x94cf('0x180'),'foreignKey':_0x94cf('0x179')});db[_0x94cf('0x47')][_0x94cf('0x129')](db[_0x94cf('0x41')],{'as':'Account','foreignKey':_0x94cf('0x16a')});db['MailMessage'][_0x94cf('0x129')](db['ChatWebsite'],{'as':_0x94cf('0x67'),'foreignKey':_0x94cf('0x181')});db['MailMessage'][_0x94cf('0x129')](db[_0x94cf('0x71')],{'as':_0x94cf('0x71'),'foreignKey':_0x94cf('0x182')});db[_0x94cf('0x48')][_0x94cf('0x129')](db[_0x94cf('0x13')],{'onDelete':_0x94cf('0x16d')});db['MailApplication'][_0x94cf('0x129')](db[_0x94cf('0x43')],{'onDelete':_0x94cf('0x16d')});db[_0x94cf('0x48')][_0x94cf('0x129')](db[_0x94cf('0x41')],{'onDelete':'restrict'});db[_0x94cf('0x48')]['belongsTo'](db[_0x94cf('0x8b')],{'onDelete':_0x94cf('0x16d'),'foreignKey':'IntervalId'});db[_0x94cf('0x48')]['belongsTo'](db[_0x94cf('0x95')],{'onDelete':_0x94cf('0x16d'),'foreignKey':_0x94cf('0x183')});db['MailQueueReport'][_0x94cf('0x129')](db[_0x94cf('0x41')],{});db[_0x94cf('0x184')]['belongsTo'](db['CmList'],{'as':_0x94cf('0x175'),'foreignKey':_0x94cf('0x176')});db[_0x94cf('0x184')][_0x94cf('0x129')](db['CmContact'],{'as':_0x94cf('0x168'),'foreignKey':'ContactId'});db[_0x94cf('0x184')][_0x94cf('0x129')](db[_0x94cf('0x124')],{});db[_0x94cf('0x184')][_0x94cf('0x129')](db[_0x94cf('0x47')],{});db[_0x94cf('0x184')][_0x94cf('0x129')](db[_0x94cf('0x13')],{});db['MailQueueReport']['belongsTo'](db['MailQueue'],{});db[_0x94cf('0x185')][_0x94cf('0x11b')](db[_0x94cf('0x4c')],{'as':_0x94cf('0x186'),'onDelete':_0x94cf('0x119')});db[_0x94cf('0x142')][_0x94cf('0x11b')](db['Disposition'],{'as':_0x94cf('0x170'),'foreignKey':_0x94cf('0x187'),'onDelete':_0x94cf('0x119')});db[_0x94cf('0x142')][_0x94cf('0x11b')](db[_0x94cf('0x86')],{'as':_0x94cf('0x171'),'foreignKey':'FaxAccountId'});db[_0x94cf('0x142')]['hasMany'](db[_0x94cf('0x51')],{'as':'Interactions'});db['FaxAccount'][_0x94cf('0x11b')](db[_0x94cf('0x4f')],{'as':_0x94cf('0x174')});db['FaxAccount']['hasMany'](db[_0x94cf('0x1a')],{'as':_0x94cf('0x188'),'onDelete':_0x94cf('0x119')});db['FaxAccount'][_0x94cf('0x11b')](db[_0x94cf('0x189')],{'as':'Messages'});db[_0x94cf('0x142')][_0x94cf('0x129')](db['Trunk'],{'as':_0x94cf('0x2d')});db[_0x94cf('0x142')][_0x94cf('0x129')](db['CmList'],{'as':_0x94cf('0x175'),'foreignKey':_0x94cf('0x176')});db[_0x94cf('0x142')][_0x94cf('0x129')](db['Pause'],{'as':_0x94cf('0x15b'),'foreignKey':_0x94cf('0x15c')});db['FaxAccount']['belongsToMany'](db[_0x94cf('0x13')],{'as':_0x94cf('0x178'),'through':_0x94cf('0x144')});db[_0x94cf('0x4f')][_0x94cf('0x129')](db[_0x94cf('0x13')],{'onDelete':_0x94cf('0x16d')});db['FaxApplication']['belongsTo'](db[_0x94cf('0x53')],{'onDelete':_0x94cf('0x16d')});db[_0x94cf('0x4f')]['belongsTo'](db[_0x94cf('0x142')],{'onDelete':_0x94cf('0x16d')});db[_0x94cf('0x4f')][_0x94cf('0x129')](db['Tag'],{'onDelete':'restrict','foreignKey':_0x94cf('0x183')});db[_0x94cf('0x51')]['hasMany'](db[_0x94cf('0x189')],{'as':_0x94cf('0x172'),'onDelete':'cascade','foreignKey':_0x94cf('0x18a')});db[_0x94cf('0x51')][_0x94cf('0x129')](db[_0x94cf('0x142')],{'as':_0x94cf('0x18b'),'foreignKey':_0x94cf('0x187')});db[_0x94cf('0x51')]['belongsTo'](db[_0x94cf('0x12e')],{'as':_0x94cf('0x168'),'foreignKey':_0x94cf('0x169')});db['FaxInteraction'][_0x94cf('0x129')](db[_0x94cf('0x13')],{'as':_0x94cf('0x17a'),'foreignKey':_0x94cf('0x11a')});db[_0x94cf('0x51')]['belongsToMany'](db[_0x94cf('0x95')],{'through':_0x94cf('0x18c'),'as':_0x94cf('0x17c')});db[_0x94cf('0x51')][_0x94cf('0x12b')](db['Tag'],{'through':_0x94cf('0x18c'),'as':'ThroughTags'});db[_0x94cf('0x51')]['belongsToMany'](db[_0x94cf('0x13')],{'as':_0x94cf('0x17e'),'through':_0x94cf('0x136'),'foreignKey':_0x94cf('0x18a')});db[_0x94cf('0x189')][_0x94cf('0x129')](db[_0x94cf('0x13')],{'onDelete':_0x94cf('0x119'),'as':_0x94cf('0x13')});db['FaxMessage'][_0x94cf('0x129')](db[_0x94cf('0x51')],{'as':_0x94cf('0x180'),'foreignKey':_0x94cf('0x18a')});db[_0x94cf('0x189')][_0x94cf('0x129')](db[_0x94cf('0x12e')],{'onDelete':_0x94cf('0x119'),'as':_0x94cf('0x168')});db[_0x94cf('0x189')][_0x94cf('0x129')](db[_0x94cf('0xf6')],{'as':_0x94cf('0xf6'),'foreignKey':_0x94cf('0x18d')});db[_0x94cf('0x189')]['belongsTo'](db['FaxAccount'],{'as':_0x94cf('0x18b'),'foreignKey':'FaxAccountId'});db[_0x94cf('0x53')]['belongsToMany'](db[_0x94cf('0x13')],{'as':'Agents','through':'UserFaxQueue'});db[_0x94cf('0x53')][_0x94cf('0x12b')](db[_0x94cf('0xf0')],{'through':_0x94cf('0x18e'),'as':'Teams'});db[_0x94cf('0x18f')]['belongsTo'](db[_0x94cf('0x142')],{});db['FaxQueueReport'][_0x94cf('0x129')](db[_0x94cf('0x131')],{'as':_0x94cf('0x175'),'foreignKey':_0x94cf('0x176')});db['FaxQueueReport'][_0x94cf('0x129')](db[_0x94cf('0x12e')],{'as':_0x94cf('0x168'),'foreignKey':_0x94cf('0x169')});db[_0x94cf('0x18f')][_0x94cf('0x129')](db['FaxInteraction'],{});db[_0x94cf('0x18f')][_0x94cf('0x129')](db[_0x94cf('0x189')],{});db[_0x94cf('0x18f')][_0x94cf('0x129')](db[_0x94cf('0x13')],{});db['FaxQueueReport'][_0x94cf('0x129')](db[_0x94cf('0x53')],{});db['SmsAccount'][_0x94cf('0x11b')](db[_0x94cf('0x88')],{'as':'Dispositions','foreignKey':_0x94cf('0x190'),'onDelete':_0x94cf('0x119')});db['SmsAccount'][_0x94cf('0x11b')](db[_0x94cf('0x86')],{'as':'Answers','foreignKey':'SmsAccountId'});db[_0x94cf('0x55')]['hasMany'](db['SmsMessage'],{'as':_0x94cf('0x172'),'foreignKey':_0x94cf('0x190')});db['SmsAccount'][_0x94cf('0x11b')](db['SmsInteraction'],{'as':'Interactions'});db['SmsAccount']['hasMany'](db['SmsApplication'],{'as':_0x94cf('0x174')});db[_0x94cf('0x55')][_0x94cf('0x129')](db[_0x94cf('0x131')],{'as':_0x94cf('0x175'),'foreignKey':_0x94cf('0x176')});db[_0x94cf('0x55')][_0x94cf('0x129')](db['Pause'],{'as':_0x94cf('0x15b'),'foreignKey':_0x94cf('0x15c')});db[_0x94cf('0x55')][_0x94cf('0x12b')](db[_0x94cf('0x13')],{'as':_0x94cf('0x178'),'through':_0x94cf('0x149')});db[_0x94cf('0x57')][_0x94cf('0x129')](db[_0x94cf('0x13')],{'onDelete':'restrict'});db[_0x94cf('0x57')][_0x94cf('0x129')](db['SmsQueue'],{'onDelete':_0x94cf('0x16d')});db[_0x94cf('0x57')][_0x94cf('0x129')](db[_0x94cf('0x55')],{'onDelete':_0x94cf('0x16d')});db[_0x94cf('0x57')][_0x94cf('0x129')](db[_0x94cf('0x8b')],{'onDelete':_0x94cf('0x16d'),'foreignKey':_0x94cf('0x15a')});db[_0x94cf('0x57')]['belongsTo'](db[_0x94cf('0x95')],{'onDelete':_0x94cf('0x16d'),'foreignKey':'TagId'});db[_0x94cf('0x59')]['hasMany'](db[_0x94cf('0x5b')],{'as':_0x94cf('0x172'),'onDelete':_0x94cf('0x119'),'foreignKey':'SmsInteractionId'});db['SmsInteraction'][_0x94cf('0x129')](db['SmsAccount'],{'as':_0x94cf('0x18b'),'foreignKey':_0x94cf('0x190')});db['SmsInteraction'][_0x94cf('0x129')](db['CmContact'],{'as':_0x94cf('0x168'),'foreignKey':_0x94cf('0x169')});db[_0x94cf('0x59')][_0x94cf('0x129')](db['User'],{'as':_0x94cf('0x17a'),'foreignKey':_0x94cf('0x11a')});db['SmsInteraction'][_0x94cf('0x12b')](db[_0x94cf('0x95')],{'through':_0x94cf('0x191'),'as':_0x94cf('0x17c')});db[_0x94cf('0x59')][_0x94cf('0x12b')](db[_0x94cf('0x95')],{'through':_0x94cf('0x191'),'as':'ThroughTags'});db[_0x94cf('0x59')][_0x94cf('0x12b')](db['User'],{'as':_0x94cf('0x17e'),'through':_0x94cf('0x138'),'foreignKey':_0x94cf('0x192')});db[_0x94cf('0x5b')][_0x94cf('0x129')](db['User'],{'as':_0x94cf('0x13')});db[_0x94cf('0x5b')][_0x94cf('0x129')](db[_0x94cf('0x12e')],{'onDelete':_0x94cf('0x119'),'as':'Contact'});db[_0x94cf('0x5b')][_0x94cf('0x129')](db['SmsInteraction'],{'onDelete':'cascade','as':'Interaction','foreignKey':_0x94cf('0x192')});db['SmsMessage'][_0x94cf('0x129')](db[_0x94cf('0x55')],{'as':_0x94cf('0x18b'),'foreignKey':_0x94cf('0x190')});db[_0x94cf('0x5d')][_0x94cf('0x12b')](db[_0x94cf('0x13')],{'as':_0x94cf('0x178'),'through':_0x94cf('0x39'),'foreignKey':_0x94cf('0x193')});db[_0x94cf('0x5d')][_0x94cf('0x12b')](db[_0x94cf('0xf0')],{'through':_0x94cf('0x194'),'as':_0x94cf('0x15d')});db[_0x94cf('0x5f')][_0x94cf('0x11b')](db[_0x94cf('0x88')],{'as':_0x94cf('0x170'),'foreignKey':_0x94cf('0x195'),'onDelete':_0x94cf('0x119')});db[_0x94cf('0x5f')]['hasMany'](db[_0x94cf('0x86')],{'as':_0x94cf('0x171'),'foreignKey':'OpenchannelAccountId'});db[_0x94cf('0x5f')][_0x94cf('0x11b')](db[_0x94cf('0x62')],{'as':'Interactions','foreignKey':'OpenchannelAccountId'});db[_0x94cf('0x5f')][_0x94cf('0x11b')](db['OpenchannelMessage'],{'as':_0x94cf('0x172'),'foreignKey':_0x94cf('0x195')});db[_0x94cf('0x5f')]['hasMany'](db[_0x94cf('0x61')],{'as':_0x94cf('0x174'),'foreignKey':_0x94cf('0x195')});db['OpenchannelAccount'][_0x94cf('0x129')](db[_0x94cf('0x131')],{'as':_0x94cf('0x175'),'foreignKey':_0x94cf('0x176')});db[_0x94cf('0x5f')][_0x94cf('0x129')](db[_0x94cf('0x8c')],{'as':_0x94cf('0x15b'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x94cf('0x5f')][_0x94cf('0x12b')](db['User'],{'as':_0x94cf('0x178'),'through':_0x94cf('0x148')});db[_0x94cf('0x61')]['belongsTo'](db[_0x94cf('0x13')],{'onDelete':_0x94cf('0x16d')});db['OpenchannelApplication'][_0x94cf('0x129')](db['OpenchannelQueue'],{'onDelete':'restrict','foreignKey':'OpenchannelQueueId'});db['OpenchannelApplication'][_0x94cf('0x129')](db[_0x94cf('0x5f')],{'onDelete':_0x94cf('0x16d'),'foreignKey':_0x94cf('0x195')});db[_0x94cf('0x61')][_0x94cf('0x129')](db[_0x94cf('0x8b')],{'onDelete':_0x94cf('0x16d'),'foreignKey':'IntervalId'});db['OpenchannelApplication'][_0x94cf('0x129')](db[_0x94cf('0x95')],{'onDelete':_0x94cf('0x16d'),'foreignKey':_0x94cf('0x183')});db[_0x94cf('0x62')]['hasMany'](db['OpenchannelMessage'],{'as':_0x94cf('0x172'),'onDelete':'cascade','foreignKey':'OpenchannelInteractionId'});db['OpenchannelInteraction']['belongsTo'](db[_0x94cf('0x5f')],{'as':_0x94cf('0x18b'),'foreignKey':_0x94cf('0x195')});db[_0x94cf('0x62')][_0x94cf('0x129')](db[_0x94cf('0x12e')],{'as':_0x94cf('0x168'),'foreignKey':_0x94cf('0x169')});db['OpenchannelInteraction'][_0x94cf('0x129')](db[_0x94cf('0x13')],{'as':_0x94cf('0x17a'),'foreignKey':'UserId'});db['OpenchannelInteraction']['belongsToMany'](db[_0x94cf('0x95')],{'through':_0x94cf('0x196'),'as':_0x94cf('0x17c')});db[_0x94cf('0x62')][_0x94cf('0x12b')](db[_0x94cf('0x95')],{'through':_0x94cf('0x196'),'as':'ThroughTags'});db[_0x94cf('0x62')][_0x94cf('0x12b')](db[_0x94cf('0x13')],{'as':_0x94cf('0x17e'),'through':_0x94cf('0x197'),'foreignKey':_0x94cf('0x198')});db[_0x94cf('0x64')][_0x94cf('0x129')](db['User'],{'onDelete':_0x94cf('0x119'),'as':'User'});db[_0x94cf('0x64')][_0x94cf('0x129')](db[_0x94cf('0x12e')],{'onDelete':_0x94cf('0x119'),'as':'Contact'});db[_0x94cf('0x64')]['belongsTo'](db[_0x94cf('0x62')],{'onDelete':_0x94cf('0x119'),'as':_0x94cf('0x180'),'foreignKey':_0x94cf('0x198')});db[_0x94cf('0x64')][_0x94cf('0x129')](db['Attachment'],{'as':_0x94cf('0xf6'),'foreignKey':_0x94cf('0x18d')});db[_0x94cf('0x64')][_0x94cf('0x129')](db[_0x94cf('0x5f')],{'as':'Account','foreignKey':_0x94cf('0x195')});db['OpenchannelQueue'][_0x94cf('0x12b')](db[_0x94cf('0x13')],{'as':_0x94cf('0x178'),'through':_0x94cf('0x3b'),'foreignKey':_0x94cf('0x199')});db[_0x94cf('0x66')][_0x94cf('0x12b')](db[_0x94cf('0xf0')],{'through':_0x94cf('0x19a'),'as':_0x94cf('0x15d')});db[_0x94cf('0x67')][_0x94cf('0x11b')](db[_0x94cf('0x88')],{'as':'Dispositions','foreignKey':'ChatWebsiteId','onDelete':_0x94cf('0x119')});db[_0x94cf('0x67')][_0x94cf('0x11b')](db[_0x94cf('0x86')],{'as':_0x94cf('0x171'),'foreignKey':_0x94cf('0x181')});db[_0x94cf('0x67')][_0x94cf('0x11b')](db['ChatProactiveAction'],{'as':_0x94cf('0x19b')});db[_0x94cf('0x67')][_0x94cf('0x11b')](db[_0x94cf('0x6d')],{'as':'Interactions'});db[_0x94cf('0x67')]['hasMany'](db['ChatApplication'],{'as':'Applications'});db['ChatWebsite'][_0x94cf('0x11b')](db[_0x94cf('0x6f')],{'as':_0x94cf('0x172')});db['ChatWebsite'][_0x94cf('0x129')](db[_0x94cf('0x131')],{'as':_0x94cf('0x175'),'foreignKey':_0x94cf('0x176')});db['ChatWebsite'][_0x94cf('0x129')](db['Interval'],{'as':_0x94cf('0x8b'),'foreignKey':_0x94cf('0x15a')});db['ChatWebsite'][_0x94cf('0x129')](db[_0x94cf('0x41')],{'as':_0x94cf('0x41'),'foreignKey':_0x94cf('0x16a')});db[_0x94cf('0x67')]['belongsTo'](db[_0x94cf('0x8c')],{'as':_0x94cf('0x15b'),'foreignKey':_0x94cf('0x15c')});db[_0x94cf('0x67')]['belongsToMany'](db[_0x94cf('0x13')],{'as':_0x94cf('0x178'),'through':_0x94cf('0x19c')});db[_0x94cf('0x69')][_0x94cf('0x129')](db[_0x94cf('0x5f')],{});db[_0x94cf('0x69')][_0x94cf('0x129')](db[_0x94cf('0x131')],{'as':_0x94cf('0x175'),'foreignKey':'ListId'});db[_0x94cf('0x69')]['belongsTo'](db[_0x94cf('0x12e')],{'as':_0x94cf('0x168'),'foreignKey':_0x94cf('0x169')});db[_0x94cf('0x69')][_0x94cf('0x129')](db[_0x94cf('0x62')],{});db[_0x94cf('0x69')][_0x94cf('0x129')](db[_0x94cf('0x64')],{});db[_0x94cf('0x69')][_0x94cf('0x129')](db[_0x94cf('0x13')],{});db[_0x94cf('0x69')][_0x94cf('0x129')](db[_0x94cf('0x66')],{});db['ChatApplication']['belongsTo'](db[_0x94cf('0x13')],{'as':'Agent','foreignKey':_0x94cf('0x11a'),'onDelete':_0x94cf('0x16d')});db[_0x94cf('0x6b')]['belongsTo'](db['ChatQueue'],{'as':_0x94cf('0x19d'),'foreignKey':_0x94cf('0x19e'),'onDelete':'restrict'});db[_0x94cf('0x6b')]['belongsTo'](db['ChatWebsite'],{'as':_0x94cf('0x19f'),'foreignKey':_0x94cf('0x181'),'onDelete':'restrict'});db[_0x94cf('0x6b')]['belongsTo'](db[_0x94cf('0x95')],{'onDelete':'restrict','foreignKey':_0x94cf('0x183')});db[_0x94cf('0x6d')][_0x94cf('0x11b')](db[_0x94cf('0x6f')],{'as':_0x94cf('0x172'),'onDelete':'cascade','foreignKey':_0x94cf('0x1a0')});db[_0x94cf('0x6d')][_0x94cf('0x129')](db[_0x94cf('0x67')],{'as':'Account','foreignKey':_0x94cf('0x181')});db[_0x94cf('0x6d')][_0x94cf('0x129')](db[_0x94cf('0x12e')],{'as':_0x94cf('0x168'),'foreignKey':'ContactId'});db[_0x94cf('0x6d')][_0x94cf('0x129')](db[_0x94cf('0x13')],{'as':_0x94cf('0x17a'),'foreignKey':_0x94cf('0x11a')});db[_0x94cf('0x6d')][_0x94cf('0x12b')](db[_0x94cf('0x95')],{'through':'chat_interaction_has_tags','as':'Tags'});db[_0x94cf('0x6d')]['belongsToMany'](db[_0x94cf('0x95')],{'through':_0x94cf('0x1a1'),'as':_0x94cf('0x17d')});db[_0x94cf('0x6d')]['belongsToMany'](db[_0x94cf('0x13')],{'as':_0x94cf('0x17e'),'through':_0x94cf('0x134'),'foreignKey':_0x94cf('0x1a0')});db['ChatMessage'][_0x94cf('0x129')](db[_0x94cf('0x13')],{'onDelete':_0x94cf('0x119'),'as':_0x94cf('0x13')});db[_0x94cf('0x6f')][_0x94cf('0x129')](db[_0x94cf('0x12e')],{'onDelete':_0x94cf('0x119'),'as':'Contact','foreignKey':'ContactId'});db[_0x94cf('0x6f')][_0x94cf('0x129')](db[_0x94cf('0x6d')],{'onDelete':'cascade','as':_0x94cf('0x180'),'foreignKey':_0x94cf('0x1a0')});db[_0x94cf('0x6f')][_0x94cf('0x129')](db[_0x94cf('0xf6')],{'as':'Attachment','foreignKey':'AttachmentId'});db[_0x94cf('0x6f')][_0x94cf('0x129')](db[_0x94cf('0x67')],{'as':_0x94cf('0x18b'),'foreignKey':_0x94cf('0x181')});db[_0x94cf('0x71')][_0x94cf('0x11b')](db['Attachment'],{'as':'Attachments','foreignKey':'ChatOfflineMessageId','onDelete':_0x94cf('0x119'),'hooks':!![]});db['ChatOfflineMessage'][_0x94cf('0x129')](db[_0x94cf('0x12e')],{'onDelete':'cascade','as':_0x94cf('0x168'),'foreignKey':_0x94cf('0x169')});db['ChatOfflineMessage'][_0x94cf('0x129')](db['ChatWebsite'],{'as':'Account','foreignKey':'ChatWebsiteId'});db['ChatQueue'][_0x94cf('0x12b')](db[_0x94cf('0x13')],{'as':_0x94cf('0x178'),'through':'UserChatQueue','hooks':!![]});db[_0x94cf('0x73')][_0x94cf('0x12b')](db[_0x94cf('0xf0')],{'through':'team_has_chat_queues','as':'Teams'});db['ChatGroup'][_0x94cf('0x11b')](db[_0x94cf('0xdf')],{'as':_0x94cf('0x172'),'foreignKey':_0x94cf('0x1a2'),'onDelete':'cascade'});db[_0x94cf('0x74')][_0x94cf('0x12b')](db['User'],{'as':_0x94cf('0x152'),'through':_0x94cf('0x12d')});db[_0x94cf('0x76')][_0x94cf('0x129')](db[_0x94cf('0x67')],{'as':_0x94cf('0x19f'),'foreignKey':_0x94cf('0x181')});db[_0x94cf('0x78')][_0x94cf('0x11b')](db[_0x94cf('0x12e')],{'as':'Contacts','foreignKey':'CompanyId'});db[_0x94cf('0x12e')][_0x94cf('0x11b')](db[_0x94cf('0x1a3')],{'as':'Phones','foreignKey':'CmContactId'});db[_0x94cf('0x12e')][_0x94cf('0x11b')](db[_0x94cf('0x154')],{'as':_0x94cf('0x1a4'),'foreignKey':_0x94cf('0x169')});db[_0x94cf('0x12e')][_0x94cf('0x11b')](db[_0x94cf('0x11d')],{'as':_0x94cf('0x11e'),'foreignKey':_0x94cf('0x169')});db[_0x94cf('0x12e')]['hasMany'](db['CmHopperHistory'],{'as':'HopperHistories','foreignKey':_0x94cf('0x169')});db[_0x94cf('0x12e')]['hasMany'](db[_0x94cf('0x121')],{'as':_0x94cf('0x121'),'foreignKey':_0x94cf('0x169')});db[_0x94cf('0x12e')][_0x94cf('0x11b')](db['JscriptySessionReport'],{'as':_0x94cf('0x157'),'foreignKey':_0x94cf('0x169')});db[_0x94cf('0x12e')][_0x94cf('0x11b')](db[_0x94cf('0x62')],{'as':'OpenchannelInteractions','foreignKey':'ContactId','onDelete':'restrict'});db[_0x94cf('0x12e')][_0x94cf('0x11b')](db[_0x94cf('0x6d')],{'as':_0x94cf('0x123'),'foreignKey':'ContactId','onDelete':_0x94cf('0x16d')});db[_0x94cf('0x12e')]['hasMany'](db[_0x94cf('0x59')],{'as':_0x94cf('0x137'),'foreignKey':'ContactId','onDelete':'restrict'});db[_0x94cf('0x12e')][_0x94cf('0x11b')](db[_0x94cf('0x51')],{'as':_0x94cf('0x135'),'foreignKey':_0x94cf('0x169'),'onDelete':_0x94cf('0x16d')});db['CmContact'][_0x94cf('0x11b')](db['MailInteraction'],{'as':_0x94cf('0x125'),'foreignKey':_0x94cf('0x169'),'onDelete':_0x94cf('0x16d')});db[_0x94cf('0x12e')][_0x94cf('0x129')](db[_0x94cf('0x78')],{'as':_0x94cf('0x1a5'),'foreignKey':_0x94cf('0x1a6')});db['CmContact'][_0x94cf('0x129')](db[_0x94cf('0x131')],{'as':_0x94cf('0x175'),'foreignKey':_0x94cf('0x176'),'onDelete':'cascade'});db['CmContact'][_0x94cf('0x12b')](db[_0x94cf('0x13')],{'as':_0x94cf('0x17e'),'through':_0x94cf('0x130')});db[_0x94cf('0x12e')][_0x94cf('0x12b')](db[_0x94cf('0x95')],{'as':_0x94cf('0x17c'),'through':_0x94cf('0x1a7')});db['CmContact']['belongsToMany'](db[_0x94cf('0x95')],{'through':_0x94cf('0x1a7'),'as':_0x94cf('0x17d')});db[_0x94cf('0x154')][_0x94cf('0x11b')](db[_0x94cf('0x99')],{'as':'AdditionalPhones','foreignKey':_0x94cf('0x1a8')});db['CmHopper']['belongsTo'](db[_0x94cf('0x12e')],{'as':_0x94cf('0x168'),'foreignKey':_0x94cf('0x169'),'onDelete':'cascade'});db[_0x94cf('0x154')][_0x94cf('0x129')](db['CmList'],{'as':_0x94cf('0x175'),'foreignKey':_0x94cf('0x176'),'onDelete':'cascade'});db[_0x94cf('0x154')][_0x94cf('0x129')](db[_0x94cf('0x13')],{'as':_0x94cf('0x1a9'),'foreignKey':'UserId'});db[_0x94cf('0x154')][_0x94cf('0x129')](db[_0x94cf('0x1e')],{'as':_0x94cf('0x19d'),'foreignKey':_0x94cf('0x153'),'onDelete':_0x94cf('0x119')});db[_0x94cf('0x154')]['belongsTo'](db[_0x94cf('0x1aa')],{'as':'Campaign','foreignKey':_0x94cf('0x1ab'),'onDelete':_0x94cf('0x119')});db[_0x94cf('0x154')][_0x94cf('0x129')](db[_0x94cf('0x13')],{'as':_0x94cf('0x17a'),'foreignKey':_0x94cf('0x1ac')});db[_0x94cf('0x7c')][_0x94cf('0x129')](db[_0x94cf('0x12e')],{'as':_0x94cf('0x168'),'foreignKey':_0x94cf('0x169'),'onDelete':_0x94cf('0x119')});db[_0x94cf('0x7c')]['belongsTo'](db[_0x94cf('0x131')],{'as':_0x94cf('0x175'),'foreignKey':_0x94cf('0x176'),'onDelete':'cascade'});db['CmHopperBlack'][_0x94cf('0x129')](db['VoiceQueue'],{'as':_0x94cf('0x19d'),'foreignKey':_0x94cf('0x153'),'onDelete':_0x94cf('0x119')});db[_0x94cf('0x7c')][_0x94cf('0x129')](db[_0x94cf('0x1aa')],{'as':_0x94cf('0x1aa'),'foreignKey':_0x94cf('0x1ab'),'onDelete':_0x94cf('0x119')});db[_0x94cf('0x1ad')][_0x94cf('0x11b')](db[_0x94cf('0x1ae')],{'as':{'plural':'All','singular':_0x94cf('0x1af')},'foreignKey':'AutomationAllId','onDelete':_0x94cf('0x119'),'hooks':!![]});db[_0x94cf('0x1ad')][_0x94cf('0x11b')](db[_0x94cf('0x1ae')],{'as':{'plural':_0x94cf('0x1b0'),'singular':'OneAny'},'foreignKey':_0x94cf('0x1b1'),'onDelete':_0x94cf('0x119'),'hooks':!![]});db[_0x94cf('0x1ad')][_0x94cf('0x11b')](db[_0x94cf('0x83')],{'as':'Actions','foreignKey':_0x94cf('0x1b2'),'onDelete':_0x94cf('0x119'),'hooks':!![]});db['Disposition'][_0x94cf('0x11b')](db[_0x94cf('0x88')],{'as':'Dispositions','foreignKey':_0x94cf('0x1b3'),'onDelete':_0x94cf('0x119')});db[_0x94cf('0x8b')][_0x94cf('0x11b')](db['Interval'],{'as':_0x94cf('0x1b4'),'foreignKey':_0x94cf('0x15a'),'onDelete':'cascade','hooks':!![],'required':![]});db['Interval'][_0x94cf('0x11b')](db[_0x94cf('0x1a')],{'as':_0x94cf('0x1b5'),'foreignKey':_0x94cf('0x15a'),'onDelete':_0x94cf('0x16d')});db[_0x94cf('0x8b')][_0x94cf('0x11b')](db[_0x94cf('0x48')],{'as':'MailApplications','foreignKey':_0x94cf('0x15a')});db[_0x94cf('0x8b')][_0x94cf('0x11b')](db[_0x94cf('0x6b')],{'as':_0x94cf('0x1b6'),'foreignKey':'IntervalId'});db[_0x94cf('0x8b')][_0x94cf('0x11b')](db[_0x94cf('0x4f')],{'as':_0x94cf('0x1b7'),'foreignKey':_0x94cf('0x15a')});db['Interval'][_0x94cf('0x11b')](db[_0x94cf('0x57')],{'as':_0x94cf('0x1b8'),'foreignKey':_0x94cf('0x15a')});db[_0x94cf('0x92')][_0x94cf('0x129')](db[_0x94cf('0x41')],{});db['Schedule'][_0x94cf('0x129')](db[_0x94cf('0xa3')],{'foreignKey':_0x94cf('0x1b9')});db['Schedule'][_0x94cf('0x129')](db[_0x94cf('0xa2')],{'foreignKey':'CustomReportId'});db['Sound'][_0x94cf('0x12b')](db[_0x94cf('0x1c')],{'as':_0x94cf('0x1ba'),'through':_0x94cf('0x151'),'onDelete':_0x94cf('0x16d')});db['Tag'][_0x94cf('0x12b')](db[_0x94cf('0x12e')],{'through':_0x94cf('0x1a7')});db['Tag'][_0x94cf('0x12b')](db[_0x94cf('0x6d')],{'through':_0x94cf('0x1a1')});db[_0x94cf('0x95')][_0x94cf('0x12b')](db[_0x94cf('0x124')],{'through':_0x94cf('0x17b')});db[_0x94cf('0x95')][_0x94cf('0x12b')](db[_0x94cf('0x59')],{'through':_0x94cf('0x191')});db[_0x94cf('0x95')][_0x94cf('0x12b')](db['FaxInteraction'],{'through':_0x94cf('0x18c')});db['Tag'][_0x94cf('0x12b')](db[_0x94cf('0x62')],{'through':'openchannel_interaction_has_tags'});db[_0x94cf('0x95')][_0x94cf('0x12b')](db[_0x94cf('0x1bb')],{'through':'whatsapp_interaction_has_tags'});db[_0x94cf('0x1a3')][_0x94cf('0x129')](db[_0x94cf('0x97')],{'as':_0x94cf('0x1bc'),'foreignKey':'ItemTypeId'});db[_0x94cf('0x99')][_0x94cf('0x129')](db[_0x94cf('0x154')],{'as':_0x94cf('0x1bd'),'foreignKey':_0x94cf('0x1a8')});db[_0x94cf('0x1a3')]['belongsTo'](db[_0x94cf('0x12e')],{'as':_0x94cf('0x168'),'foreignKey':_0x94cf('0x1be')});db[_0x94cf('0x1bf')][_0x94cf('0x11b')](db[_0x94cf('0x1ae')],{'as':{'plural':_0x94cf('0x1c0'),'singular':_0x94cf('0x1c1')},'foreignKey':_0x94cf('0x1c2'),'onDelete':_0x94cf('0x119'),'hooks':!![]});db[_0x94cf('0x1bf')]['hasMany'](db[_0x94cf('0x1ae')],{'as':{'plural':_0x94cf('0x1c3'),'singular':_0x94cf('0x1c4')},'foreignKey':_0x94cf('0x1c5'),'onDelete':_0x94cf('0x119'),'hooks':!![]});db[_0x94cf('0x1bf')][_0x94cf('0x11b')](db[_0x94cf('0x83')],{'as':_0x94cf('0x1c6'),'foreignKey':_0x94cf('0x1c7'),'onDelete':_0x94cf('0x119'),'hooks':!![]});db['AnalyticCustomReport'][_0x94cf('0x11b')](db[_0x94cf('0x1c8')],{'as':_0x94cf('0x1c9'),'onDelete':'cascade','foreignKey':_0x94cf('0x1ca'),'hooks':!![]});db['AnalyticDefaultReport'][_0x94cf('0x11b')](db['AnalyticFieldReport'],{'as':_0x94cf('0x1c9'),'onDelete':_0x94cf('0x119'),'foreignKey':_0x94cf('0x1b9')});db[_0x94cf('0xa7')][_0x94cf('0x11b')](db[_0x94cf('0x1c8')],{'as':_0x94cf('0x1c9'),'onDelete':_0x94cf('0x119'),'foreignKey':_0x94cf('0x1cb')});db[_0x94cf('0x1c8')][_0x94cf('0x129')](db[_0x94cf('0xa7')],{'foreignKey':'MetricId'});db['SalesforceAccount'][_0x94cf('0x11b')](db[_0x94cf('0xae')],{'as':_0x94cf('0x1cc'),'onDelete':_0x94cf('0x119'),'foreignKey':_0x94cf('0x1cd')});db['SalesforceConfiguration'][_0x94cf('0x11b')](db[_0x94cf('0xb0')],{'as':_0x94cf('0x1ce'),'onDelete':_0x94cf('0x119'),'foreignKey':'SubjectId'});db['SalesforceConfiguration'][_0x94cf('0x11b')](db['SalesforceField'],{'as':'Descriptions','onDelete':_0x94cf('0x119'),'foreignKey':_0x94cf('0x1cf')});db[_0x94cf('0xae')][_0x94cf('0x11b')](db[_0x94cf('0xb0')],{'as':_0x94cf('0x1c9'),'onDelete':_0x94cf('0x119'),'foreignKey':_0x94cf('0x1d0')});db[_0x94cf('0xae')]['belongsTo'](db[_0x94cf('0xac')],{'as':'Account','foreignKey':'AccountId'});db[_0x94cf('0xb0')][_0x94cf('0x11b')](db[_0x94cf('0xb0')],{'as':_0x94cf('0x1d1'),'foreignKey':_0x94cf('0x1d2')});db[_0x94cf('0xb0')][_0x94cf('0x11b')](db[_0x94cf('0xb0')],{'as':_0x94cf('0x1d3'),'foreignKey':_0x94cf('0x1cf')});db['SalesforceField']['hasMany'](db['SalesforceField'],{'as':_0x94cf('0x1d4'),'foreignKey':'FieldId'});db[_0x94cf('0xb0')][_0x94cf('0x129')](db[_0x94cf('0x9d')],{'as':_0x94cf('0x9d'),'foreignKey':'VariableId'});db[_0x94cf('0xb2')][_0x94cf('0x11b')](db[_0x94cf('0xb4')],{'as':_0x94cf('0x1cc'),'onDelete':_0x94cf('0x119'),'foreignKey':'AccountId'});db[_0x94cf('0xb4')][_0x94cf('0x11b')](db['SugarcrmField'],{'as':'Subjects','onDelete':_0x94cf('0x119'),'foreignKey':'SubjectId'});db[_0x94cf('0xb4')][_0x94cf('0x11b')](db[_0x94cf('0x1d5')],{'as':_0x94cf('0x1d6'),'onDelete':'cascade','foreignKey':_0x94cf('0x1cf')});db[_0x94cf('0xb4')][_0x94cf('0x11b')](db[_0x94cf('0x1d5')],{'as':_0x94cf('0x1c9'),'onDelete':_0x94cf('0x119'),'foreignKey':'FieldId'});db[_0x94cf('0xb4')][_0x94cf('0x129')](db[_0x94cf('0xb2')],{'as':_0x94cf('0x18b'),'foreignKey':_0x94cf('0x1cd')});db[_0x94cf('0x1d5')][_0x94cf('0x11b')](db[_0x94cf('0x1d5')],{'as':_0x94cf('0x1d1'),'foreignKey':_0x94cf('0x1d2')});db['SugarcrmField'][_0x94cf('0x11b')](db['SugarcrmField'],{'as':_0x94cf('0x1d3'),'foreignKey':_0x94cf('0x1cf')});db[_0x94cf('0x1d5')][_0x94cf('0x11b')](db['SugarcrmField'],{'as':'Field','foreignKey':_0x94cf('0x1d0')});db[_0x94cf('0x1d5')][_0x94cf('0x129')](db[_0x94cf('0x9d')],{'as':_0x94cf('0x9d'),'foreignKey':_0x94cf('0x1d7')});db[_0x94cf('0x1d8')]['hasMany'](db['DeskConfiguration'],{'as':'Configurations','onDelete':'cascade','foreignKey':_0x94cf('0x1cd')});db[_0x94cf('0xb6')][_0x94cf('0x11b')](db[_0x94cf('0x1d9')],{'as':'Subjects','onDelete':_0x94cf('0x119'),'foreignKey':_0x94cf('0x1d2')});db[_0x94cf('0xb6')][_0x94cf('0x11b')](db[_0x94cf('0x1d9')],{'as':'Descriptions','onDelete':'cascade','foreignKey':_0x94cf('0x1cf')});db[_0x94cf('0xb6')][_0x94cf('0x11b')](db[_0x94cf('0x1d9')],{'as':'Fields','onDelete':_0x94cf('0x119'),'foreignKey':_0x94cf('0x1d0')});db['DeskConfiguration'][_0x94cf('0x129')](db[_0x94cf('0x1d8')],{'as':_0x94cf('0x18b'),'foreignKey':_0x94cf('0x1cd')});db['DeskConfiguration']['belongsToMany'](db[_0x94cf('0x95')],{'through':_0x94cf('0x1da')});db[_0x94cf('0x1d9')][_0x94cf('0x11b')](db[_0x94cf('0x1d9')],{'as':_0x94cf('0x1d1'),'foreignKey':_0x94cf('0x1d2')});db['DeskField'][_0x94cf('0x11b')](db[_0x94cf('0x1d9')],{'as':_0x94cf('0x1d3'),'foreignKey':'DescriptionId'});db[_0x94cf('0x1d9')][_0x94cf('0x11b')](db[_0x94cf('0x1d9')],{'as':_0x94cf('0x1d4'),'foreignKey':_0x94cf('0x1d0')});db[_0x94cf('0x1d9')][_0x94cf('0x129')](db[_0x94cf('0x9d')],{'as':'Variable','foreignKey':'VariableId'});db['ZohoAccount'][_0x94cf('0x11b')](db['ZohoConfiguration'],{'as':_0x94cf('0x1cc'),'onDelete':_0x94cf('0x119'),'foreignKey':_0x94cf('0x1cd')});db[_0x94cf('0x1db')]['hasMany'](db[_0x94cf('0xba')],{'as':_0x94cf('0x1ce'),'onDelete':_0x94cf('0x119'),'foreignKey':_0x94cf('0x1d2')});db[_0x94cf('0x1db')]['hasMany'](db['ZohoField'],{'as':'Descriptions','onDelete':_0x94cf('0x119'),'foreignKey':_0x94cf('0x1cf')});db[_0x94cf('0x1db')]['hasMany'](db['ZohoField'],{'as':_0x94cf('0x1c9'),'onDelete':_0x94cf('0x119'),'foreignKey':_0x94cf('0x1d0')});db[_0x94cf('0x1db')]['belongsTo'](db[_0x94cf('0x1dc')],{'as':'Account','foreignKey':_0x94cf('0x1cd')});db[_0x94cf('0xba')][_0x94cf('0x11b')](db[_0x94cf('0xba')],{'as':_0x94cf('0x1d1'),'foreignKey':_0x94cf('0x1d2')});db[_0x94cf('0xba')][_0x94cf('0x11b')](db[_0x94cf('0xba')],{'as':'Description','foreignKey':'DescriptionId'});db[_0x94cf('0xba')][_0x94cf('0x11b')](db[_0x94cf('0xba')],{'as':_0x94cf('0x1d4'),'foreignKey':'FieldId'});db['ZohoField'][_0x94cf('0x129')](db['Variable'],{'as':_0x94cf('0x9d'),'foreignKey':_0x94cf('0x1d7')});db[_0x94cf('0xbc')][_0x94cf('0x11b')](db[_0x94cf('0xbe')],{'as':'Configurations','onDelete':'cascade','foreignKey':_0x94cf('0x1cd')});db[_0x94cf('0xbe')][_0x94cf('0x11b')](db[_0x94cf('0xbf')],{'as':'Subjects','foreignKey':'SubjectId'});db[_0x94cf('0xbe')][_0x94cf('0x11b')](db[_0x94cf('0xbf')],{'as':_0x94cf('0x1d6'),'foreignKey':_0x94cf('0x1cf')});db[_0x94cf('0xbe')][_0x94cf('0x11b')](db[_0x94cf('0xbf')],{'as':'Fields','foreignKey':'FieldId'});db[_0x94cf('0xbe')][_0x94cf('0x129')](db[_0x94cf('0xbc')],{'as':_0x94cf('0x18b'),'foreignKey':'AccountId'});db[_0x94cf('0xbe')][_0x94cf('0x12b')](db[_0x94cf('0x95')],{'through':_0x94cf('0x1dd')});db[_0x94cf('0xbf')][_0x94cf('0x11b')](db[_0x94cf('0xbf')],{'as':_0x94cf('0x1d1'),'foreignKey':_0x94cf('0x1d2')});db['ZendeskField'][_0x94cf('0x11b')](db[_0x94cf('0xbf')],{'as':_0x94cf('0x1d3'),'foreignKey':_0x94cf('0x1cf')});db['ZendeskField']['hasMany'](db['ZendeskField'],{'as':_0x94cf('0x1d4'),'foreignKey':_0x94cf('0x1d0')});db['ZendeskField'][_0x94cf('0x129')](db[_0x94cf('0x9d')],{'as':_0x94cf('0x9d'),'foreignKey':_0x94cf('0x1d7')});db[_0x94cf('0xc1')][_0x94cf('0x11b')](db[_0x94cf('0xc3')],{'as':_0x94cf('0x1cc'),'onDelete':_0x94cf('0x119'),'foreignKey':_0x94cf('0x1cd')});db[_0x94cf('0xc3')][_0x94cf('0x11b')](db[_0x94cf('0xc5')],{'as':_0x94cf('0x1ce'),'onDelete':_0x94cf('0x119'),'foreignKey':'SubjectId'});db[_0x94cf('0xc3')][_0x94cf('0x11b')](db[_0x94cf('0xc5')],{'as':_0x94cf('0x1d6'),'onDelete':_0x94cf('0x119'),'foreignKey':_0x94cf('0x1cf')});db[_0x94cf('0xc3')][_0x94cf('0x11b')](db['FreshdeskField'],{'as':_0x94cf('0x1c9'),'onDelete':_0x94cf('0x119'),'foreignKey':'FieldId'});db['FreshdeskConfiguration'][_0x94cf('0x129')](db[_0x94cf('0xc1')],{'as':_0x94cf('0x18b'),'foreignKey':_0x94cf('0x1cd')});db[_0x94cf('0xc3')]['belongsToMany'](db[_0x94cf('0x95')],{'through':_0x94cf('0x1de')});db[_0x94cf('0xc5')][_0x94cf('0x11b')](db[_0x94cf('0xc5')],{'as':_0x94cf('0x1d1'),'foreignKey':_0x94cf('0x1d2')});db['FreshdeskField']['hasMany'](db[_0x94cf('0xc5')],{'as':_0x94cf('0x1d3'),'foreignKey':_0x94cf('0x1cf')});db[_0x94cf('0xc5')][_0x94cf('0x11b')](db[_0x94cf('0xc5')],{'as':_0x94cf('0x1d4'),'foreignKey':_0x94cf('0x1d0')});db[_0x94cf('0xc5')]['belongsTo'](db['Variable'],{'as':_0x94cf('0x9d'),'foreignKey':'VariableId'});db[_0x94cf('0xc7')][_0x94cf('0x11b')](db[_0x94cf('0xc8')],{'as':_0x94cf('0x1cc'),'onDelete':_0x94cf('0x119'),'foreignKey':_0x94cf('0x1cd')});db[_0x94cf('0xc8')][_0x94cf('0x11b')](db[_0x94cf('0xca')],{'as':'Subjects','foreignKey':'SubjectId'});db[_0x94cf('0xc8')]['hasMany'](db['VtigerField'],{'as':_0x94cf('0x1d6'),'foreignKey':'DescriptionId'});db[_0x94cf('0xc8')]['hasMany'](db[_0x94cf('0xca')],{'as':_0x94cf('0x1c9'),'foreignKey':_0x94cf('0x1d0')});db[_0x94cf('0xc8')][_0x94cf('0x129')](db[_0x94cf('0xc7')],{'as':'Account','foreignKey':_0x94cf('0x1cd')});db[_0x94cf('0xca')][_0x94cf('0x11b')](db[_0x94cf('0xca')],{'as':_0x94cf('0x1d1'),'foreignKey':_0x94cf('0x1d2')});db['VtigerField'][_0x94cf('0x11b')](db[_0x94cf('0xca')],{'as':_0x94cf('0x1d3'),'foreignKey':_0x94cf('0x1cf')});db[_0x94cf('0xca')][_0x94cf('0x11b')](db['VtigerField'],{'as':_0x94cf('0x1d4'),'foreignKey':'FieldId'});db[_0x94cf('0xca')]['belongsTo'](db[_0x94cf('0x9d')],{'as':'Variable','foreignKey':_0x94cf('0x1d7')});db[_0x94cf('0xcb')][_0x94cf('0x11b')](db['ServicenowConfiguration'],{'as':'Configurations','onDelete':_0x94cf('0x119'),'foreignKey':_0x94cf('0x1cd')});db[_0x94cf('0xcc')]['hasMany'](db[_0x94cf('0xce')],{'as':_0x94cf('0x1ce'),'foreignKey':_0x94cf('0x1d2')});db[_0x94cf('0xcc')][_0x94cf('0x11b')](db[_0x94cf('0xce')],{'as':_0x94cf('0x1d6'),'foreignKey':_0x94cf('0x1cf')});db[_0x94cf('0xcc')]['hasMany'](db[_0x94cf('0xce')],{'as':'Fields','foreignKey':_0x94cf('0x1d0')});db['ServicenowConfiguration'][_0x94cf('0x129')](db[_0x94cf('0xcb')],{'as':'Account','foreignKey':_0x94cf('0x1cd')});db[_0x94cf('0xce')][_0x94cf('0x11b')](db[_0x94cf('0xce')],{'as':_0x94cf('0x1d1'),'foreignKey':_0x94cf('0x1d2')});db[_0x94cf('0xce')][_0x94cf('0x11b')](db[_0x94cf('0xce')],{'as':_0x94cf('0x1d3'),'foreignKey':_0x94cf('0x1cf')});db['ServicenowField'][_0x94cf('0x11b')](db['ServicenowField'],{'as':'Field','foreignKey':_0x94cf('0x1d0')});db['ServicenowField'][_0x94cf('0x129')](db[_0x94cf('0x9d')],{'as':'Variable','foreignKey':'VariableId'});db[_0x94cf('0xd0')][_0x94cf('0x11b')](db['Dynamics365Configuration'],{'as':_0x94cf('0x1cc'),'onDelete':_0x94cf('0x119'),'foreignKey':_0x94cf('0x1cd')});db[_0x94cf('0xd0')][_0x94cf('0x129')](db[_0x94cf('0x16b')],{'as':_0x94cf('0x16b'),'foreignKey':_0x94cf('0x16c')});db[_0x94cf('0xd2')][_0x94cf('0x11b')](db[_0x94cf('0xd4')],{'as':_0x94cf('0x1ce'),'onDelete':_0x94cf('0x119'),'foreignKey':'SubjectId'});db['Dynamics365Configuration']['hasMany'](db[_0x94cf('0xd4')],{'as':_0x94cf('0x1d6'),'onDelete':_0x94cf('0x119'),'foreignKey':_0x94cf('0x1cf')});db[_0x94cf('0xd2')][_0x94cf('0x11b')](db['Dynamics365Field'],{'as':_0x94cf('0x1c9'),'onDelete':'cascade','foreignKey':_0x94cf('0x1d0')});db['Dynamics365Configuration']['belongsTo'](db['Dynamics365Account'],{'as':_0x94cf('0x18b'),'foreignKey':_0x94cf('0x1cd')});db['Dynamics365Field'][_0x94cf('0x11b')](db[_0x94cf('0xd4')],{'as':_0x94cf('0x1d1'),'foreignKey':_0x94cf('0x1d2')});db[_0x94cf('0xd4')][_0x94cf('0x11b')](db['Dynamics365Field'],{'as':_0x94cf('0x1d3'),'foreignKey':_0x94cf('0x1cf')});db[_0x94cf('0xd4')][_0x94cf('0x11b')](db[_0x94cf('0xd4')],{'as':_0x94cf('0x1d4'),'foreignKey':_0x94cf('0x1d0')});db[_0x94cf('0xd4')][_0x94cf('0x129')](db[_0x94cf('0x9d')],{'as':_0x94cf('0x9d'),'foreignKey':'VariableId'});db[_0x94cf('0xd5')]['hasMany'](db['FreshsalesConfiguration'],{'as':_0x94cf('0x1cc'),'onDelete':_0x94cf('0x119'),'foreignKey':_0x94cf('0x1cd')});db['FreshsalesConfiguration'][_0x94cf('0x11b')](db[_0x94cf('0xd9')],{'as':'Subjects','foreignKey':_0x94cf('0x1d2')});db['FreshsalesConfiguration'][_0x94cf('0x11b')](db['FreshsalesField'],{'as':'Descriptions','foreignKey':_0x94cf('0x1cf')});db[_0x94cf('0xd7')][_0x94cf('0x11b')](db['FreshsalesField'],{'as':_0x94cf('0x1c9'),'foreignKey':_0x94cf('0x1d0')});db['FreshsalesConfiguration'][_0x94cf('0x129')](db[_0x94cf('0xd5')],{'as':_0x94cf('0x18b'),'foreignKey':_0x94cf('0x1cd')});db[_0x94cf('0xd9')][_0x94cf('0x11b')](db[_0x94cf('0xd9')],{'as':_0x94cf('0x1d1'),'foreignKey':_0x94cf('0x1d2')});db['FreshsalesField'][_0x94cf('0x11b')](db[_0x94cf('0xd9')],{'as':'Description','foreignKey':_0x94cf('0x1cf')});db[_0x94cf('0xd9')][_0x94cf('0x11b')](db['FreshsalesField'],{'as':_0x94cf('0x1d4'),'foreignKey':'FieldId'});db['FreshsalesField'][_0x94cf('0x129')](db[_0x94cf('0x9d')],{'as':_0x94cf('0x9d'),'foreignKey':'VariableId'});db[_0x94cf('0xdd')]['belongsTo'](db[_0x94cf('0x67')],{});db['ChatQueueReport'][_0x94cf('0x129')](db[_0x94cf('0x131')],{'as':_0x94cf('0x175'),'foreignKey':'ListId'});db[_0x94cf('0xdd')][_0x94cf('0x129')](db['CmContact'],{'as':'Contact','foreignKey':_0x94cf('0x169')});db[_0x94cf('0xdd')]['belongsTo'](db[_0x94cf('0x6d')],{});db[_0x94cf('0xdd')][_0x94cf('0x129')](db[_0x94cf('0x6f')],{});db[_0x94cf('0xdd')]['belongsTo'](db[_0x94cf('0x13')],{});db[_0x94cf('0xdd')][_0x94cf('0x129')](db[_0x94cf('0x73')],{});db['ChatInternalMessage']['belongsTo'](db[_0x94cf('0x13')],{'onDelete':'cascade','foreignKey':'FromId'});db['ChatInternalMessage'][_0x94cf('0x129')](db['User'],{'onDelete':'cascade','foreignKey':_0x94cf('0x1df')});db[_0x94cf('0xe4')][_0x94cf('0x11b')](db[_0x94cf('0xe2')],{'foreignKey':_0x94cf('0x1e0'),'onDelete':'cascade'});db[_0x94cf('0xe4')][_0x94cf('0x11b')](db[_0x94cf('0x1e1')],{'foreignKey':_0x94cf('0x1e0'),'onDelete':'cascade'});db[_0x94cf('0x1e2')][_0x94cf('0x129')](db[_0x94cf('0x55')],{});db['SmsQueueReport'][_0x94cf('0x129')](db[_0x94cf('0x131')],{'as':_0x94cf('0x175'),'foreignKey':_0x94cf('0x176')});db[_0x94cf('0x1e2')][_0x94cf('0x129')](db[_0x94cf('0x12e')],{'as':_0x94cf('0x168'),'foreignKey':_0x94cf('0x169')});db[_0x94cf('0x1e2')][_0x94cf('0x129')](db[_0x94cf('0x59')],{});db['SmsQueueReport']['belongsTo'](db[_0x94cf('0x5b')],{});db[_0x94cf('0x1e2')]['belongsTo'](db[_0x94cf('0x13')],{});db[_0x94cf('0x1e2')]['belongsTo'](db[_0x94cf('0x5d')],{});db[_0x94cf('0xe7')][_0x94cf('0x11b')](db[_0x94cf('0xe4')],{'foreignKey':_0x94cf('0x1e3')});db[_0x94cf('0xe7')][_0x94cf('0x11b')](db[_0x94cf('0xe2')],{'foreignKey':_0x94cf('0x1e3')});db[_0x94cf('0xe7')][_0x94cf('0x11b')](db[_0x94cf('0x1e1')],{'foreignKey':_0x94cf('0x1e3')});db['SquareProject'][_0x94cf('0x12b')](db[_0x94cf('0x13')],{'as':'Users','through':_0x94cf('0x1e4')});db[_0x94cf('0xf0')][_0x94cf('0x12b')](db[_0x94cf('0x13')],{'as':_0x94cf('0x178'),'through':_0x94cf('0x132')});db[_0x94cf('0xf0')]['belongsToMany'](db[_0x94cf('0x1e')],{'through':_0x94cf('0x111'),'as':_0x94cf('0x13a')});db[_0x94cf('0xf0')][_0x94cf('0x12b')](db[_0x94cf('0x43')],{'through':_0x94cf('0x1e5'),'as':_0x94cf('0x13b')});db[_0x94cf('0xf0')]['belongsToMany'](db['ChatQueue'],{'through':_0x94cf('0x1e6'),'as':'ChatQueues'});db['Team'][_0x94cf('0x12b')](db[_0x94cf('0x53')],{'through':_0x94cf('0x18e'),'as':_0x94cf('0x13d')});db[_0x94cf('0xf0')]['belongsToMany'](db['SmsQueue'],{'through':_0x94cf('0x194'),'as':_0x94cf('0x13e')});db[_0x94cf('0xf0')]['belongsToMany'](db[_0x94cf('0x66')],{'through':'team_has_openchannel_queues','as':_0x94cf('0x13f')});db[_0x94cf('0xf0')]['belongsToMany'](db['WhatsappQueue'],{'through':_0x94cf('0x1e7'),'as':_0x94cf('0x1e8')});db['Team'][_0x94cf('0x12b')](db[_0x94cf('0x100')],{'through':'TeamVoicePrefix','as':_0x94cf('0x1e9')});db[_0x94cf('0x1aa')][_0x94cf('0x11b')](db[_0x94cf('0x154')],{'as':_0x94cf('0x1a4'),'foreignKey':'CampaignId'});db[_0x94cf('0x1aa')]['hasMany'](db[_0x94cf('0x11d')],{'as':_0x94cf('0x11e'),'foreignKey':_0x94cf('0x1ab')});db[_0x94cf('0x1aa')][_0x94cf('0x11b')](db[_0x94cf('0x11f')],{'as':_0x94cf('0x155'),'foreignKey':_0x94cf('0x1ab')});db[_0x94cf('0x1aa')][_0x94cf('0x11b')](db[_0x94cf('0x7c')],{'as':_0x94cf('0x156'),'foreignKey':_0x94cf('0x1ab')});db['Campaign'][_0x94cf('0x129')](db[_0x94cf('0x2d')],{'as':_0x94cf('0x2d'),'foreignKey':_0x94cf('0x1ea')});db[_0x94cf('0x1aa')][_0x94cf('0x129')](db[_0x94cf('0x2d')],{'as':_0x94cf('0x158'),'foreignKey':_0x94cf('0x159')});db['Campaign']['belongsTo'](db['Interval'],{'as':_0x94cf('0x8b'),'foreignKey':_0x94cf('0x15a')});db[_0x94cf('0x1aa')][_0x94cf('0x129')](db['SquareProject'],{'as':_0x94cf('0x14c'),'foreignKey':_0x94cf('0x1eb')});db[_0x94cf('0x1aa')][_0x94cf('0x12b')](db['CmList'],{'as':_0x94cf('0x1ec'),'through':_0x94cf('0x1ed')});db['Campaign'][_0x94cf('0x12b')](db[_0x94cf('0x131')],{'as':_0x94cf('0x15e'),'through':_0x94cf('0x1ee')});db[_0x94cf('0xf6')][_0x94cf('0x129')](db[_0x94cf('0x71')],{'as':'ChatOfflineMessage','foreignKey':_0x94cf('0x182')});db[_0x94cf('0x1ef')][_0x94cf('0x129')](db[_0x94cf('0x47')],{});db[_0x94cf('0x1ef')][_0x94cf('0x129')](db[_0x94cf('0x124')],{});db[_0x94cf('0x1ef')][_0x94cf('0x129')](db[_0x94cf('0x41')],{'foreignKey':_0x94cf('0x1f0'),'as':_0x94cf('0x1f1')});db[_0x94cf('0x1ef')][_0x94cf('0x129')](db[_0x94cf('0x13')],{'foreignKey':_0x94cf('0x1f2'),'as':_0x94cf('0x1f3')});db[_0x94cf('0x1ef')]['belongsTo'](db[_0x94cf('0x13')],{'foreignKey':_0x94cf('0x1f4'),'as':_0x94cf('0x1f5')});db[_0x94cf('0x1ef')][_0x94cf('0x129')](db[_0x94cf('0x43')],{'foreignKey':_0x94cf('0x1f6'),'as':'ToQueue'});db[_0x94cf('0x1ef')][_0x94cf('0x129')](db[_0x94cf('0x41')],{'foreignKey':'ToMailAccountId','as':'ToAccount'});db[_0x94cf('0x1f7')][_0x94cf('0x129')](db[_0x94cf('0x6f')],{});db['ChatTransferReport']['belongsTo'](db[_0x94cf('0x6d')],{});db[_0x94cf('0x1f7')]['belongsTo'](db[_0x94cf('0x67')],{'foreignKey':_0x94cf('0x1f8'),'as':_0x94cf('0x1f1')});db[_0x94cf('0x1f7')]['belongsTo'](db[_0x94cf('0x13')],{'foreignKey':_0x94cf('0x1f2'),'as':_0x94cf('0x1f3')});db[_0x94cf('0x1f7')][_0x94cf('0x129')](db[_0x94cf('0x13')],{'foreignKey':_0x94cf('0x1f4'),'as':_0x94cf('0x1f5')});db[_0x94cf('0x1f7')][_0x94cf('0x129')](db[_0x94cf('0x73')],{'foreignKey':_0x94cf('0x1f9'),'as':_0x94cf('0x1fa')});db['ChatTransferReport'][_0x94cf('0x129')](db['ChatWebsite'],{'foreignKey':_0x94cf('0x1fb'),'as':_0x94cf('0x1fc')});db['FaxTransferReport'][_0x94cf('0x129')](db[_0x94cf('0x189')],{});db[_0x94cf('0xfb')][_0x94cf('0x129')](db[_0x94cf('0x51')],{});db[_0x94cf('0xfb')][_0x94cf('0x129')](db[_0x94cf('0x142')],{'foreignKey':'FromFaxAccountId','as':_0x94cf('0x1f1')});db[_0x94cf('0xfb')][_0x94cf('0x129')](db['User'],{'foreignKey':_0x94cf('0x1f2'),'as':'FromAgent'});db[_0x94cf('0xfb')][_0x94cf('0x129')](db[_0x94cf('0x13')],{'foreignKey':_0x94cf('0x1f4'),'as':_0x94cf('0x1f5')});db[_0x94cf('0xfb')][_0x94cf('0x129')](db[_0x94cf('0x53')],{'foreignKey':'ToFaxQueueId','as':_0x94cf('0x1fa')});db[_0x94cf('0xfb')][_0x94cf('0x129')](db['FaxAccount'],{'foreignKey':_0x94cf('0x1fd'),'as':_0x94cf('0x1fc')});db[_0x94cf('0x1fe')][_0x94cf('0x129')](db[_0x94cf('0x64')],{});db['OpenchannelTransferReport']['belongsTo'](db['OpenchannelInteraction'],{});db[_0x94cf('0x1fe')][_0x94cf('0x129')](db[_0x94cf('0x5f')],{'foreignKey':'FromOpenchannelAccountId','as':_0x94cf('0x1f1')});db[_0x94cf('0x1fe')][_0x94cf('0x129')](db[_0x94cf('0x13')],{'foreignKey':_0x94cf('0x1f2'),'as':'FromAgent'});db['OpenchannelTransferReport'][_0x94cf('0x129')](db[_0x94cf('0x13')],{'foreignKey':_0x94cf('0x1f4'),'as':_0x94cf('0x1f5')});db[_0x94cf('0x1fe')]['belongsTo'](db[_0x94cf('0x66')],{'foreignKey':_0x94cf('0x1ff'),'as':_0x94cf('0x1fa')});db[_0x94cf('0x1fe')]['belongsTo'](db[_0x94cf('0x5f')],{'foreignKey':_0x94cf('0x200'),'as':_0x94cf('0x1fc')});db[_0x94cf('0x201')][_0x94cf('0x129')](db['SmsMessage'],{});db['SmsTransferReport'][_0x94cf('0x129')](db[_0x94cf('0x59')],{});db[_0x94cf('0x201')][_0x94cf('0x129')](db[_0x94cf('0x55')],{'foreignKey':'FromSmsAccountId','as':'FromAccount'});db['SmsTransferReport'][_0x94cf('0x129')](db['User'],{'foreignKey':_0x94cf('0x1f2'),'as':_0x94cf('0x1f3')});db[_0x94cf('0x201')][_0x94cf('0x129')](db['User'],{'foreignKey':_0x94cf('0x1f4'),'as':_0x94cf('0x1f5')});db['SmsTransferReport'][_0x94cf('0x129')](db['SmsQueue'],{'foreignKey':'ToSmsQueueId','as':_0x94cf('0x1fa')});db[_0x94cf('0x201')][_0x94cf('0x129')](db[_0x94cf('0x55')],{'foreignKey':'ToSmsAccountId','as':_0x94cf('0x1fc')});db[_0x94cf('0x131')][_0x94cf('0x11b')](db[_0x94cf('0x88')],{'as':_0x94cf('0x170'),'foreignKey':_0x94cf('0x176'),'onDelete':'cascade'});db['CmList'][_0x94cf('0x11b')](db[_0x94cf('0x81')],{'as':_0x94cf('0x202'),'foreignKey':_0x94cf('0x176')});db['CmList']['hasMany'](db['CmContact'],{'as':_0x94cf('0x12f'),'onDelete':'cascade','foreignKey':'ListId'});db[_0x94cf('0x131')][_0x94cf('0x11b')](db['CmHopperFinal'],{'as':'HopperFinals','foreignKey':_0x94cf('0x176')});db[_0x94cf('0x131')]['hasMany'](db[_0x94cf('0x11f')],{'as':_0x94cf('0x120'),'foreignKey':_0x94cf('0x176')});db['CmList']['hasMany'](db[_0x94cf('0x121')],{'as':_0x94cf('0x121'),'foreignKey':_0x94cf('0x176')});db[_0x94cf('0x131')][_0x94cf('0x12b')](db[_0x94cf('0x1e')],{'as':_0x94cf('0x203'),'through':_0x94cf('0x204')});db[_0x94cf('0x131')][_0x94cf('0x12b')](db[_0x94cf('0x13')],{'as':_0x94cf('0x178'),'through':_0x94cf('0x140')});db[_0x94cf('0x100')][_0x94cf('0x11b')](db[_0x94cf('0x1a')],{'as':_0x94cf('0x1b5'),'onDelete':_0x94cf('0x119')});db['VoicePrefix'][_0x94cf('0x12b')](db[_0x94cf('0x13')],{'as':_0x94cf('0x178'),'through':'UserVoicePrefix'});db[_0x94cf('0x100')][_0x94cf('0x12b')](db[_0x94cf('0xf0')],{'through':_0x94cf('0x113'),'as':_0x94cf('0x15d')});db['UserProfile'][_0x94cf('0x11b')](db[_0x94cf('0x13')],{'as':_0x94cf('0x17e'),'foreignKey':'userProfileId'});db[_0x94cf('0x102')][_0x94cf('0x11b')](db[_0x94cf('0x103')],{'as':'UserProfileSections','foreignKey':'userProfileId','onDelete':'cascade'});db['UserProfileSection'][_0x94cf('0x11b')](db[_0x94cf('0x105')],{'as':'Resources','foreignKey':_0x94cf('0x205'),'onDelete':'cascade'});db[_0x94cf('0x108')][_0x94cf('0x11b')](db[_0x94cf('0x88')],{'as':_0x94cf('0x170'),'foreignKey':_0x94cf('0x206'),'onDelete':_0x94cf('0x119')});db[_0x94cf('0x108')]['hasMany'](db[_0x94cf('0x86')],{'as':_0x94cf('0x171'),'foreignKey':_0x94cf('0x206')});db[_0x94cf('0x108')][_0x94cf('0x11b')](db[_0x94cf('0x207')],{'as':_0x94cf('0x172'),'foreignKey':_0x94cf('0x206')});db[_0x94cf('0x108')]['hasMany'](db[_0x94cf('0x1bb')],{'as':'Interactions'});db['WhatsappAccount'][_0x94cf('0x11b')](db['WhatsappApplication'],{'as':_0x94cf('0x174')});db[_0x94cf('0x108')][_0x94cf('0x129')](db['CmList'],{'as':_0x94cf('0x175'),'foreignKey':_0x94cf('0x176')});db[_0x94cf('0x108')]['belongsTo'](db[_0x94cf('0x8c')],{'as':'mandatoryDispositionPause','foreignKey':_0x94cf('0x15c')});db[_0x94cf('0x108')][_0x94cf('0x12b')](db['User'],{'as':'Agents','through':_0x94cf('0x14b')});db['WhatsappApplication'][_0x94cf('0x129')](db[_0x94cf('0x13')],{'onDelete':_0x94cf('0x16d')});db[_0x94cf('0x109')][_0x94cf('0x129')](db['WhatsappQueue'],{'onDelete':_0x94cf('0x16d')});db[_0x94cf('0x109')][_0x94cf('0x129')](db[_0x94cf('0x108')],{'onDelete':'restrict'});db[_0x94cf('0x109')][_0x94cf('0x129')](db[_0x94cf('0x8b')],{'onDelete':_0x94cf('0x16d'),'foreignKey':_0x94cf('0x15a')});db[_0x94cf('0x109')]['belongsTo'](db[_0x94cf('0x95')],{'onDelete':_0x94cf('0x16d'),'foreignKey':_0x94cf('0x183')});db[_0x94cf('0x1bb')][_0x94cf('0x11b')](db['WhatsappMessage'],{'as':_0x94cf('0x172'),'onDelete':_0x94cf('0x119'),'foreignKey':'WhatsappInteractionId'});db[_0x94cf('0x1bb')][_0x94cf('0x129')](db[_0x94cf('0x108')],{'as':'Account','foreignKey':_0x94cf('0x206')});db[_0x94cf('0x1bb')][_0x94cf('0x129')](db[_0x94cf('0x12e')],{'as':_0x94cf('0x168'),'foreignKey':_0x94cf('0x169')});db[_0x94cf('0x1bb')]['belongsTo'](db[_0x94cf('0x13')],{'as':_0x94cf('0x17a'),'foreignKey':_0x94cf('0x11a')});db[_0x94cf('0x1bb')][_0x94cf('0x12b')](db[_0x94cf('0x95')],{'through':_0x94cf('0x208'),'as':_0x94cf('0x17c')});db[_0x94cf('0x1bb')]['belongsToMany'](db[_0x94cf('0x95')],{'through':'whatsapp_interaction_has_tags','as':_0x94cf('0x17d')});db[_0x94cf('0x1bb')][_0x94cf('0x12b')](db[_0x94cf('0x13')],{'as':_0x94cf('0x17e'),'through':'user_has_whatsapp_interactions','foreignKey':_0x94cf('0x209')});db[_0x94cf('0x207')]['belongsTo'](db[_0x94cf('0x13')],{'as':'User'});db[_0x94cf('0x207')]['belongsTo'](db[_0x94cf('0x12e')],{'onDelete':'cascade','as':_0x94cf('0x168')});db['WhatsappMessage'][_0x94cf('0x129')](db[_0x94cf('0x1bb')],{'onDelete':_0x94cf('0x119'),'as':'Interaction','foreignKey':_0x94cf('0x209')});db[_0x94cf('0x207')]['belongsTo'](db[_0x94cf('0x108')],{'as':_0x94cf('0x18b'),'foreignKey':_0x94cf('0x206')});db[_0x94cf('0x20a')][_0x94cf('0x129')](db[_0x94cf('0x108')],{});db['WhatsappQueueReport'][_0x94cf('0x129')](db['CmList'],{'as':_0x94cf('0x175'),'foreignKey':_0x94cf('0x176')});db['WhatsappQueueReport'][_0x94cf('0x129')](db['CmContact'],{'as':'Contact','foreignKey':_0x94cf('0x169')});db[_0x94cf('0x20a')][_0x94cf('0x129')](db[_0x94cf('0x1bb')],{});db[_0x94cf('0x20a')][_0x94cf('0x129')](db[_0x94cf('0x10f')],{});db[_0x94cf('0x20a')][_0x94cf('0x129')](db[_0x94cf('0x207')],{});db[_0x94cf('0x20a')][_0x94cf('0x129')](db[_0x94cf('0x13')],{});db[_0x94cf('0x10d')][_0x94cf('0x129')](db['WhatsappMessage'],{});db[_0x94cf('0x10d')][_0x94cf('0x129')](db[_0x94cf('0x1bb')],{});db['WhatsappTransferReport'][_0x94cf('0x129')](db['WhatsappAccount'],{'foreignKey':'FromWhatsappAccountId','as':'FromAccount'});db[_0x94cf('0x10d')][_0x94cf('0x129')](db['WhatsappAccount'],{'foreignKey':'ToWhatsappAccountId','as':_0x94cf('0x1fc')});db['WhatsappTransferReport'][_0x94cf('0x129')](db['WhatsappQueue'],{'foreignKey':_0x94cf('0x20b'),'as':'ToQueue'});db[_0x94cf('0x10d')][_0x94cf('0x129')](db[_0x94cf('0x13')],{'foreignKey':_0x94cf('0x1f2'),'as':_0x94cf('0x1f3')});db['WhatsappTransferReport'][_0x94cf('0x129')](db[_0x94cf('0x13')],{'foreignKey':_0x94cf('0x1f4'),'as':_0x94cf('0x1f5')});db[_0x94cf('0x10f')][_0x94cf('0x12b')](db['User'],{'as':_0x94cf('0x178'),'through':_0x94cf('0x3d'),'foreignKey':'WhatsappQueueId'});db[_0x94cf('0x10f')][_0x94cf('0x12b')](db[_0x94cf('0xf0')],{'through':_0x94cf('0x1e7'),'as':_0x94cf('0x15d')});db[_0x94cf('0x118')][_0x94cf('0x129')](db[_0x94cf('0x13')],{'as':'user','foreignKey':_0x94cf('0x11a'),'onDelete':_0x94cf('0x119'),'hooks':!![]});db[_0x94cf('0x16b')]['hasOne'](db['Dynamics365Account'],{'as':'Dynamics365Account','onDelete':_0x94cf('0x16d')});db[_0x94cf('0x16b')]['hasOne'](db[_0x94cf('0x3e')],{'as':_0x94cf('0x16e'),'onDelete':_0x94cf('0x16d')});db[_0x94cf('0x16b')][_0x94cf('0x117')](db[_0x94cf('0x40')],{'as':_0x94cf('0x16f'),'onDelete':'restrict'});module[_0x94cf('0x20c')]={'db':db,'dbH':dbH};
\ No newline at end of file
index b002537..1871086 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdcb7=['/api/chat/offline_messages','./api/chatOfflineMessage','./api/chatQueue','/api/chat/groups','/api/chat/proactive_actions','./api/cmCompany','./api/cmContact','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmCustomField','/api/actions','/api/automations','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/dispositions','./api/disposition','/api/conditions','./api/condition','./api/pause','/api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','./api/schedule','/api/sounds','./api/sound','./api/tag','/api/contact_item_types','/api/cm_contact_has_items','./api/cmContactHasItem','/api/cm_hopper_additional_phones','/api/templates','./api/template','./api/trigger','./api/variable','./api/integration','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','./api/analyticExtractedReport','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','/api/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/intZohoField','./api/intZendeskAccount','/api/integrations/zendesk/configurations','/api/integrations/zendesk/fields','./api/intZendeskField','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/accounts','/api/integrations/servicenow/configurations','/api/integrations/servicenow/fields','./api/intServicenowField','./api/intDynamics365Account','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','./api/intFreshsalesField','/api/networks','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','/api/settings','./api/setting','/api/square/odbc','./api/squareOdbc','/api/square/projects','./api/squareProject','/api/square/recordings','./api/squareRecording','/api/square/messages','./api/squareMessage','/api/teams','./api/team','/api/license','./api/license','/api/campaigns','./api/campaign','/api/migrations','./api/migration','/api/attachments','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','/api/fax/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','./api/cmList','./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/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','/api/realtime','./api/realtime','./api/user-setting','./api/authLocal','./api/authGoogle','/api/auth/activedirectory','/api/jira','./api/jira','/api/rpc','./api/rpc','/api/version','./api/version','./api/system','/api/pm2','./api/pm2','/api/webbar','./api/webbar','/api/logs','/apidoc','static','/www','join','/demo','/snippet','root','snippet','3.0.0','/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','appPath','/index.html','path','./errors','./config/environment','setupLoggers','default','then','use','/api/users','./api/user','./api/voiceChanSpy','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','./api/memberReport','/api/trunks','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','./api/mailMessage','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','./api/dashboard','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','/api/fax/applications','/api/fax/interactions','./api/faxInteraction','./api/faxMessage','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','./api/smsMessage','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','./api/openchannelInteraction','/api/openchannel/messages','/api/openchannel/queues','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/interactions','./api/chatInteraction'];(function(_0x12124a,_0x35e1b6){var _0x2b3dd9=function(_0x521f07){while(--_0x521f07){_0x12124a['push'](_0x12124a['shift']());}};_0x2b3dd9(++_0x35e1b6);}(_0xdcb7,0xc4));var _0x7dcb=function(_0xa643b7,_0x36a756){_0xa643b7=_0xa643b7-0x0;var _0x2ed420=_0xdcb7[_0xa643b7];return _0x2ed420;};'use strict';var path=require(_0x7dcb('0x0'));var express=require('express');var errors=require(_0x7dcb('0x1'));var config=require(_0x7dcb('0x2'));var setupLoggers=require('./utils/client-side-logger')[_0x7dcb('0x3')];var clientSideLogs=require('./api/client-side-logs');exports[_0x7dcb('0x4')]=function(_0x13720b){return setupLoggers(_0x13720b)[_0x7dcb('0x5')](function(){_0x13720b[_0x7dcb('0x6')](_0x7dcb('0x7'),require(_0x7dcb('0x8')));_0x13720b['use']('/api/voice/chanspy',require(_0x7dcb('0x9')));_0x13720b[_0x7dcb('0x6')]('/api/voice/contexts',require(_0x7dcb('0xa')));_0x13720b['use'](_0x7dcb('0xb'),require(_0x7dcb('0xc')));_0x13720b[_0x7dcb('0x6')](_0x7dcb('0xd'),require(_0x7dcb('0xe')));_0x13720b[_0x7dcb('0x6')](_0x7dcb('0xf'),require(_0x7dcb('0x10')));_0x13720b['use'](_0x7dcb('0x11'),require(_0x7dcb('0x12')));_0x13720b['use'](_0x7dcb('0x13'),require('./api/screenRecording'));_0x13720b[_0x7dcb('0x6')](_0x7dcb('0x14'),require(_0x7dcb('0x15')));_0x13720b[_0x7dcb('0x6')](_0x7dcb('0x16'),require(_0x7dcb('0x17')));_0x13720b[_0x7dcb('0x6')](_0x7dcb('0x18'),require(_0x7dcb('0x19')));_0x13720b[_0x7dcb('0x6')](_0x7dcb('0x1a'),require('./api/voiceDialReport'));_0x13720b['use'](_0x7dcb('0x1b'),require(_0x7dcb('0x1c')));_0x13720b['use'](_0x7dcb('0x1d'),require(_0x7dcb('0x1e')));_0x13720b[_0x7dcb('0x6')]('/api/members/reports',require(_0x7dcb('0x1f')));_0x13720b[_0x7dcb('0x6')](_0x7dcb('0x20'),require(_0x7dcb('0x21')));_0x13720b[_0x7dcb('0x6')](_0x7dcb('0x22'),require(_0x7dcb('0x23')));_0x13720b['use'](_0x7dcb('0x24'),require(_0x7dcb('0x25')));_0x13720b['use'](_0x7dcb('0x26'),require('./api/mailAccount'));_0x13720b[_0x7dcb('0x6')](_0x7dcb('0x27'),require(_0x7dcb('0x28')));_0x13720b['use'](_0x7dcb('0x29'),require(_0x7dcb('0x2a')));_0x13720b[_0x7dcb('0x6')](_0x7dcb('0x2b'),require(_0x7dcb('0x2c')));_0x13720b[_0x7dcb('0x6')](_0x7dcb('0x2d'),require(_0x7dcb('0x2e')));_0x13720b[_0x7dcb('0x6')](_0x7dcb('0x2f'),require(_0x7dcb('0x30')));_0x13720b[_0x7dcb('0x6')](_0x7dcb('0x31'),require(_0x7dcb('0x32')));_0x13720b['use'](_0x7dcb('0x33'),require(_0x7dcb('0x34')));_0x13720b[_0x7dcb('0x6')](_0x7dcb('0x35'),require(_0x7dcb('0x36')));_0x13720b[_0x7dcb('0x6')](_0x7dcb('0x37'),require(_0x7dcb('0x38')));_0x13720b[_0x7dcb('0x6')](_0x7dcb('0x39'),require('./api/faxApplication'));_0x13720b['use'](_0x7dcb('0x3a'),require(_0x7dcb('0x3b')));_0x13720b[_0x7dcb('0x6')]('/api/fax/messages',require(_0x7dcb('0x3c')));_0x13720b[_0x7dcb('0x6')]('/api/fax/queues',require(_0x7dcb('0x3d')));_0x13720b[_0x7dcb('0x6')](_0x7dcb('0x3e'),require(_0x7dcb('0x3f')));_0x13720b[_0x7dcb('0x6')]('/api/sms/accounts',require(_0x7dcb('0x40')));_0x13720b[_0x7dcb('0x6')](_0x7dcb('0x41'),require(_0x7dcb('0x42')));_0x13720b[_0x7dcb('0x6')](_0x7dcb('0x43'),require(_0x7dcb('0x44')));_0x13720b[_0x7dcb('0x6')]('/api/sms/messages',require(_0x7dcb('0x45')));_0x13720b[_0x7dcb('0x6')](_0x7dcb('0x46'),require(_0x7dcb('0x47')));_0x13720b[_0x7dcb('0x6')](_0x7dcb('0x48'),require(_0x7dcb('0x49')));_0x13720b[_0x7dcb('0x6')](_0x7dcb('0x4a'),require(_0x7dcb('0x4b')));_0x13720b[_0x7dcb('0x6')]('/api/openchannel/interactions',require(_0x7dcb('0x4c')));_0x13720b[_0x7dcb('0x6')](_0x7dcb('0x4d'),require('./api/openchannelMessage'));_0x13720b[_0x7dcb('0x6')](_0x7dcb('0x4e'),require('./api/openchannelQueue'));_0x13720b[_0x7dcb('0x6')]('/api/chat/websites',require('./api/chatWebsite'));_0x13720b[_0x7dcb('0x6')](_0x7dcb('0x4f'),require(_0x7dcb('0x50')));_0x13720b[_0x7dcb('0x6')](_0x7dcb('0x51'),require(_0x7dcb('0x52')));_0x13720b[_0x7dcb('0x6')](_0x7dcb('0x53'),require(_0x7dcb('0x54')));_0x13720b['use']('/api/chat/messages',require('./api/chatMessage'));_0x13720b[_0x7dcb('0x6')](_0x7dcb('0x55'),require(_0x7dcb('0x56')));_0x13720b['use']('/api/chat/queues',require(_0x7dcb('0x57')));_0x13720b['use'](_0x7dcb('0x58'),require('./api/chatGroup'));_0x13720b[_0x7dcb('0x6')](_0x7dcb('0x59'),require('./api/chatProactiveAction'));_0x13720b[_0x7dcb('0x6')]('/api/cm/companies',require(_0x7dcb('0x5a')));_0x13720b[_0x7dcb('0x6')]('/api/cm/contacts',require(_0x7dcb('0x5b')));_0x13720b[_0x7dcb('0x6')]('/api/cm/hopper',require(_0x7dcb('0x5c')));_0x13720b[_0x7dcb('0x6')](_0x7dcb('0x5d'),require(_0x7dcb('0x5e')));_0x13720b[_0x7dcb('0x6')]('/api/cm/hopper_final',require(_0x7dcb('0x5f')));_0x13720b['use'](_0x7dcb('0x60'),require('./api/cmHopperHistory'));_0x13720b['use']('/api/cm/custom_fields',require(_0x7dcb('0x61')));_0x13720b[_0x7dcb('0x6')](_0x7dcb('0x62'),require('./api/action'));_0x13720b[_0x7dcb('0x6')](_0x7dcb('0x63'),require(_0x7dcb('0x64')));_0x13720b['use'](_0x7dcb('0x65'),require(_0x7dcb('0x66')));_0x13720b[_0x7dcb('0x6')](_0x7dcb('0x67'),require(_0x7dcb('0x68')));_0x13720b[_0x7dcb('0x6')](_0x7dcb('0x69'),require(_0x7dcb('0x6a')));_0x13720b['use']('/api/intervals',require('./api/interval'));_0x13720b['use']('/api/pauses',require(_0x7dcb('0x6b')));_0x13720b[_0x7dcb('0x6')](_0x7dcb('0x6c'),require('./api/cdr'));_0x13720b[_0x7dcb('0x6')](_0x7dcb('0x6d'),require(_0x7dcb('0x6e')));_0x13720b['use']('/api/schedules',require(_0x7dcb('0x6f')));_0x13720b[_0x7dcb('0x6')](_0x7dcb('0x70'),require(_0x7dcb('0x71')));_0x13720b[_0x7dcb('0x6')]('/api/tags',require(_0x7dcb('0x72')));_0x13720b[_0x7dcb('0x6')](_0x7dcb('0x73'),require('./api/contactItemType'));_0x13720b['use'](_0x7dcb('0x74'),require(_0x7dcb('0x75')));_0x13720b[_0x7dcb('0x6')](_0x7dcb('0x76'),require('./api/cmHopperAdditionalPhone'));_0x13720b[_0x7dcb('0x6')](_0x7dcb('0x77'),require(_0x7dcb('0x78')));_0x13720b[_0x7dcb('0x6')]('/api/triggers',require(_0x7dcb('0x79')));_0x13720b[_0x7dcb('0x6')]('/api/variables',require(_0x7dcb('0x7a')));_0x13720b[_0x7dcb('0x6')]('/api/integrations',require(_0x7dcb('0x7b')));_0x13720b['use'](_0x7dcb('0x7c'),require(_0x7dcb('0x7d')));_0x13720b[_0x7dcb('0x6')](_0x7dcb('0x7e'),require(_0x7dcb('0x7f')));_0x13720b[_0x7dcb('0x6')]('/api/analytics/default_reports',require('./api/analyticDefaultReport'));_0x13720b[_0x7dcb('0x6')]('/api/analytics/extracted_reports',require(_0x7dcb('0x80')));_0x13720b['use']('/api/analytics/metrics',require('./api/analyticMetric'));_0x13720b[_0x7dcb('0x6')](_0x7dcb('0x81'),require(_0x7dcb('0x82')));_0x13720b['use'](_0x7dcb('0x83'),require('./api/analyticTreeReport'));_0x13720b[_0x7dcb('0x6')]('/api/integrations/salesforce/accounts',require(_0x7dcb('0x84')));_0x13720b[_0x7dcb('0x6')](_0x7dcb('0x85'),require(_0x7dcb('0x86')));_0x13720b[_0x7dcb('0x6')](_0x7dcb('0x87'),require('./api/intSalesforceField'));_0x13720b[_0x7dcb('0x6')](_0x7dcb('0x88'),require(_0x7dcb('0x89')));_0x13720b['use'](_0x7dcb('0x8a'),require(_0x7dcb('0x8b')));_0x13720b[_0x7dcb('0x6')](_0x7dcb('0x8c'),require(_0x7dcb('0x8d')));_0x13720b[_0x7dcb('0x6')](_0x7dcb('0x8e'),require(_0x7dcb('0x8f')));_0x13720b[_0x7dcb('0x6')](_0x7dcb('0x90'),require(_0x7dcb('0x91')));_0x13720b['use'](_0x7dcb('0x92'),require(_0x7dcb('0x93')));_0x13720b['use'](_0x7dcb('0x94'),require(_0x7dcb('0x95')));_0x13720b['use'](_0x7dcb('0x96'),require(_0x7dcb('0x97')));_0x13720b[_0x7dcb('0x6')](_0x7dcb('0x98'),require(_0x7dcb('0x99')));_0x13720b[_0x7dcb('0x6')]('/api/integrations/zendesk/accounts',require(_0x7dcb('0x9a')));_0x13720b[_0x7dcb('0x6')](_0x7dcb('0x9b'),require('./api/intZendeskConfiguration'));_0x13720b[_0x7dcb('0x6')](_0x7dcb('0x9c'),require(_0x7dcb('0x9d')));_0x13720b['use']('/api/integrations/freshdesk/accounts',require(_0x7dcb('0x9e')));_0x13720b[_0x7dcb('0x6')](_0x7dcb('0x9f'),require(_0x7dcb('0xa0')));_0x13720b[_0x7dcb('0x6')]('/api/integrations/freshdesk/fields',require(_0x7dcb('0xa1')));_0x13720b[_0x7dcb('0x6')](_0x7dcb('0xa2'),require(_0x7dcb('0xa3')));_0x13720b['use'](_0x7dcb('0xa4'),require(_0x7dcb('0xa5')));_0x13720b[_0x7dcb('0x6')](_0x7dcb('0xa6'),require(_0x7dcb('0xa7')));_0x13720b['use'](_0x7dcb('0xa8'),require('./api/intServicenowAccount'));_0x13720b[_0x7dcb('0x6')](_0x7dcb('0xa9'),require('./api/intServicenowConfiguration'));_0x13720b['use'](_0x7dcb('0xaa'),require(_0x7dcb('0xab')));_0x13720b[_0x7dcb('0x6')]('/api/integrations/dynamics365/accounts',require(_0x7dcb('0xac')));_0x13720b[_0x7dcb('0x6')]('/api/integrations/dynamics365/configurations',require(_0x7dcb('0xad')));_0x13720b['use'](_0x7dcb('0xae'),require('./api/intDynamics365Field'));_0x13720b['use'](_0x7dcb('0xaf'),require(_0x7dcb('0xb0')));_0x13720b[_0x7dcb('0x6')](_0x7dcb('0xb1'),require(_0x7dcb('0xb2')));_0x13720b[_0x7dcb('0x6')](_0x7dcb('0xb3'),require(_0x7dcb('0xb4')));_0x13720b[_0x7dcb('0x6')](_0x7dcb('0xb5'),require('./api/network'));_0x13720b['use'](_0x7dcb('0xb6'),require(_0x7dcb('0xb7')));_0x13720b[_0x7dcb('0x6')](_0x7dcb('0xb8'),require(_0x7dcb('0xb9')));_0x13720b[_0x7dcb('0x6')](_0x7dcb('0xba'),require(_0x7dcb('0xbb')));_0x13720b['use'](_0x7dcb('0xbc'),require('./api/jscriptyQuestionReport'));_0x13720b[_0x7dcb('0x6')](_0x7dcb('0xbd'),require(_0x7dcb('0xbe')));_0x13720b[_0x7dcb('0x6')](_0x7dcb('0xbf'),require(_0x7dcb('0xc0')));_0x13720b[_0x7dcb('0x6')](_0x7dcb('0xc1'),require('./api/squareReport'));_0x13720b[_0x7dcb('0x6')](_0x7dcb('0xc2'),require(_0x7dcb('0xc3')));_0x13720b[_0x7dcb('0x6')](_0x7dcb('0xc4'),require(_0x7dcb('0xc5')));_0x13720b[_0x7dcb('0x6')](_0x7dcb('0xc6'),require(_0x7dcb('0xc7')));_0x13720b['use'](_0x7dcb('0xc8'),require(_0x7dcb('0xc9')));_0x13720b[_0x7dcb('0x6')](_0x7dcb('0xca'),require(_0x7dcb('0xcb')));_0x13720b[_0x7dcb('0x6')](_0x7dcb('0xcc'),require(_0x7dcb('0xcd')));_0x13720b[_0x7dcb('0x6')](_0x7dcb('0xce'),require(_0x7dcb('0xcf')));_0x13720b[_0x7dcb('0x6')](_0x7dcb('0xd0'),require(_0x7dcb('0xd1')));_0x13720b[_0x7dcb('0x6')](_0x7dcb('0xd2'),require(_0x7dcb('0xd3')));_0x13720b[_0x7dcb('0x6')](_0x7dcb('0xd4'),require(_0x7dcb('0xd5')));_0x13720b['use'](_0x7dcb('0xd6'),require(_0x7dcb('0xd7')));_0x13720b[_0x7dcb('0x6')](_0x7dcb('0xd8'),require('./api/attachment'));_0x13720b[_0x7dcb('0x6')]('/api/plugins',require(_0x7dcb('0xd9')));_0x13720b[_0x7dcb('0x6')](_0x7dcb('0xda'),require(_0x7dcb('0xdb')));_0x13720b[_0x7dcb('0x6')](_0x7dcb('0xdc'),require('./api/chatTransferReport'));_0x13720b['use'](_0x7dcb('0xdd'),require('./api/faxTransferReport'));_0x13720b['use']('/api/openchannel/reports/transfer',require(_0x7dcb('0xde')));_0x13720b[_0x7dcb('0x6')](_0x7dcb('0xdf'),require(_0x7dcb('0xe0')));_0x13720b['use'](_0x7dcb('0xe1'),require(_0x7dcb('0xe2')));_0x13720b['use']('/api/voice/prefixes',require('./api/voicePrefix'));_0x13720b[_0x7dcb('0x6')]('/api/userProfiles',require(_0x7dcb('0xe3')));_0x13720b[_0x7dcb('0x6')](_0x7dcb('0xe4'),require(_0x7dcb('0xe5')));_0x13720b[_0x7dcb('0x6')](_0x7dcb('0xe6'),require(_0x7dcb('0xe7')));_0x13720b['use'](_0x7dcb('0xe8'),require('./api/userNotification'));_0x13720b[_0x7dcb('0x6')](_0x7dcb('0xe9'),require(_0x7dcb('0xea')));_0x13720b[_0x7dcb('0x6')](_0x7dcb('0xeb'),require(_0x7dcb('0xec')));_0x13720b[_0x7dcb('0x6')](_0x7dcb('0xed'),require(_0x7dcb('0xee')));_0x13720b[_0x7dcb('0x6')](_0x7dcb('0xef'),require(_0x7dcb('0xf0')));_0x13720b['use'](_0x7dcb('0xf1'),require('./api/whatsappQueueReport'));_0x13720b[_0x7dcb('0x6')](_0x7dcb('0xf2'),require(_0x7dcb('0xf3')));_0x13720b['use'](_0x7dcb('0xf4'),require(_0x7dcb('0xf5')));_0x13720b[_0x7dcb('0x6')](_0x7dcb('0xf6'),require(_0x7dcb('0xf7')));_0x13720b[_0x7dcb('0x6')](_0x7dcb('0xf8'),require(_0x7dcb('0xf9')));_0x13720b[_0x7dcb('0x6')]('/api/user-settings',require(_0x7dcb('0xfa')));_0x13720b[_0x7dcb('0x6')]('/api/auth/local',require(_0x7dcb('0xfb')));_0x13720b[_0x7dcb('0x6')]('/api/auth/google',require(_0x7dcb('0xfc')));_0x13720b[_0x7dcb('0x6')](_0x7dcb('0xfd'),require('./api/authActiveDirectory'));_0x13720b['use'](_0x7dcb('0xfe'),require(_0x7dcb('0xff')));_0x13720b['use'](_0x7dcb('0x100'),require(_0x7dcb('0x101')));_0x13720b['use'](_0x7dcb('0x102'),require(_0x7dcb('0x103')));_0x13720b[_0x7dcb('0x6')]('/api/system',require(_0x7dcb('0x104')));_0x13720b[_0x7dcb('0x6')](_0x7dcb('0x105'),require(_0x7dcb('0x106')));_0x13720b[_0x7dcb('0x6')](_0x7dcb('0x107'),require(_0x7dcb('0x108')));_0x13720b[_0x7dcb('0x6')](_0x7dcb('0x109'),clientSideLogs);_0x13720b[_0x7dcb('0x6')](_0x7dcb('0x10a'),express[_0x7dcb('0x10b')](path['join'](config['root'],_0x7dcb('0x10a'))));_0x13720b['use'](_0x7dcb('0x10c'),express[_0x7dcb('0x10b')](path[_0x7dcb('0x10d')](config['root'],_0x7dcb('0x10c'))));_0x13720b[_0x7dcb('0x6')](_0x7dcb('0x10e'),express['static'](path[_0x7dcb('0x10d')](config['root'],_0x7dcb('0x10e'))));_0x13720b[_0x7dcb('0x6')](_0x7dcb('0x10f'),express['static'](path[_0x7dcb('0x10d')](config[_0x7dcb('0x110')],_0x7dcb('0x111'),_0x7dcb('0x112'))));_0x13720b['use'](_0x7dcb('0x113'),express[_0x7dcb('0x10b')](path[_0x7dcb('0x10d')](config[_0x7dcb('0x110')],'/server/files/plugins')));_0x13720b[_0x7dcb('0x114')](_0x7dcb('0x115'))[_0x7dcb('0x116')](errors[0x194]);_0x13720b[_0x7dcb('0x114')]('/*')['get'](function(_0x48a919,_0x3adbca){_0x3adbca['sendFile'](path['resolve'](_0x13720b[_0x7dcb('0x116')](_0x7dcb('0x117'))+_0x7dcb('0x118')));});return _0x13720b;});};
\ No newline at end of file
+var _0xb22f=['/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','./api/userNotification','/api/whatsapp/accounts','./api/whatsappAccount','./api/whatsappApplication','/api/whatsapp/interactions','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','./api/cloudProvider','/api/realtime','/api/user-settings','/api/auth/local','./api/authLocal','/api/auth/google','./api/authGoogle','/api/auth/activedirectory','./api/authActiveDirectory','/api/jira','/api/rpc','./api/rpc','/api/system','/api/pm2','./api/pm2','/api/webbar','/api/logs','/apidoc','root','/www','static','/demo','snippet','3.0.0','join','/:url(api|auth|components|app|bower_components|assets)/*','route','get','appPath','/index.html','path','express','./config/environment','./utils/client-side-logger','./api/client-side-logs','default','then','use','/api/users','./api/user','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','/api/voice/extensions','./api/voiceExtension','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','/api/voice/mails','./api/voiceMail','./api/voiceMailMessage','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','./api/voiceQueueReport','./api/trunk','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','./api/mailMessage','./api/mailApplication','/api/mail/reports/queue','/api/dashboards','./api/dashboard','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','/api/fax/applications','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','./api/faxMessage','./api/faxQueue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','/api/sms/applications','./api/smsApplication','./api/smsInteraction','/api/sms/messages','./api/openchannelApplication','./api/openchannelInteraction','/api/openchannel/messages','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','./api/chatInteraction','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','/api/chat/groups','./api/chatGroup','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','./api/action','/api/automations','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/dispositions','/api/conditions','./api/condition','./api/interval','/api/pauses','./api/pause','/api/cdr','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','./api/schedule','/api/sounds','/api/tags','./api/tag','/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/variables','./api/variable','/api/integrations','./api/integration','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','./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/integrations/zoho/configurations','/api/integrations/zoho/fields','./api/intZohoField','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','/api/integrations/servicenow/accounts','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','./api/intFreshsalesField','/api/networks','./api/network','/api/chat/reports/queue','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','./api/squareReport','/api/square/details/reports','/api/jscripty/projects','./api/jscriptyProject','/api/settings','./api/setting','/api/square/odbc','./api/squareOdbc','/api/square/projects','./api/squareProject','/api/square/recordings','./api/squareRecording','/api/square/messages','./api/squareMessage','./api/team','/api/migrations','./api/migration','/api/attachments','/api/plugins','./api/plugin','./api/chatTransferReport','/api/fax/reports/transfer','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','/api/cm/lists','./api/cmList','/api/voice/prefixes','/api/userProfiles'];(function(_0x5781d0,_0x235a43){var _0x1e175b=function(_0x1c4dee){while(--_0x1c4dee){_0x5781d0['push'](_0x5781d0['shift']());}};_0x1e175b(++_0x235a43);}(_0xb22f,0x141));var _0xfb22=function(_0x1c7994,_0x454316){_0x1c7994=_0x1c7994-0x0;var _0x108f9a=_0xb22f[_0x1c7994];return _0x108f9a;};'use strict';var path=require(_0xfb22('0x0'));var express=require(_0xfb22('0x1'));var errors=require('./errors');var config=require(_0xfb22('0x2'));var setupLoggers=require(_0xfb22('0x3'))['setupLoggers'];var clientSideLogs=require(_0xfb22('0x4'));exports[_0xfb22('0x5')]=function(_0x45ea6d){return setupLoggers(_0x45ea6d)[_0xfb22('0x6')](function(){_0x45ea6d[_0xfb22('0x7')](_0xfb22('0x8'),require(_0xfb22('0x9')));_0x45ea6d[_0xfb22('0x7')](_0xfb22('0xa'),require(_0xfb22('0xb')));_0x45ea6d[_0xfb22('0x7')](_0xfb22('0xc'),require('./api/voiceContext'));_0x45ea6d[_0xfb22('0x7')](_0xfb22('0xd'),require(_0xfb22('0xe')));_0x45ea6d[_0xfb22('0x7')](_0xfb22('0xf'),require(_0xfb22('0x10')));_0x45ea6d[_0xfb22('0x7')](_0xfb22('0x11'),require(_0xfb22('0x12')));_0x45ea6d[_0xfb22('0x7')](_0xfb22('0x13'),require(_0xfb22('0x14')));_0x45ea6d['use'](_0xfb22('0x15'),require(_0xfb22('0x16')));_0x45ea6d[_0xfb22('0x7')](_0xfb22('0x17'),require(_0xfb22('0x18')));_0x45ea6d['use']('/api/voice/mails/messages',require(_0xfb22('0x19')));_0x45ea6d['use']('/api/voice/calls/reports',require(_0xfb22('0x1a')));_0x45ea6d[_0xfb22('0x7')](_0xfb22('0x1b'),require(_0xfb22('0x1c')));_0x45ea6d[_0xfb22('0x7')](_0xfb22('0x1d'),require(_0xfb22('0x1e')));_0x45ea6d['use']('/api/voice/queues/reports',require(_0xfb22('0x1f')));_0x45ea6d['use']('/api/members/reports',require('./api/memberReport'));_0x45ea6d[_0xfb22('0x7')]('/api/trunks',require(_0xfb22('0x20')));_0x45ea6d[_0xfb22('0x7')]('/api/voice/transfers/reports',require(_0xfb22('0x21')));_0x45ea6d['use'](_0xfb22('0x22'),require(_0xfb22('0x23')));_0x45ea6d['use'](_0xfb22('0x24'),require('./api/mailAccount'));_0x45ea6d[_0xfb22('0x7')]('/api/mail/queues',require(_0xfb22('0x25')));_0x45ea6d['use'](_0xfb22('0x26'),require(_0xfb22('0x27')));_0x45ea6d[_0xfb22('0x7')](_0xfb22('0x28'),require(_0xfb22('0x29')));_0x45ea6d[_0xfb22('0x7')]('/api/mail/messages',require(_0xfb22('0x2a')));_0x45ea6d[_0xfb22('0x7')]('/api/mail/applications',require(_0xfb22('0x2b')));_0x45ea6d[_0xfb22('0x7')](_0xfb22('0x2c'),require('./api/mailQueueReport'));_0x45ea6d['use'](_0xfb22('0x2d'),require(_0xfb22('0x2e')));_0x45ea6d[_0xfb22('0x7')](_0xfb22('0x2f'),require(_0xfb22('0x30')));_0x45ea6d[_0xfb22('0x7')](_0xfb22('0x31'),require('./api/faxAccount'));_0x45ea6d['use'](_0xfb22('0x32'),require('./api/faxApplication'));_0x45ea6d[_0xfb22('0x7')](_0xfb22('0x33'),require(_0xfb22('0x34')));_0x45ea6d[_0xfb22('0x7')](_0xfb22('0x35'),require(_0xfb22('0x36')));_0x45ea6d[_0xfb22('0x7')]('/api/fax/queues',require(_0xfb22('0x37')));_0x45ea6d[_0xfb22('0x7')]('/api/fax/reports/queue',require(_0xfb22('0x38')));_0x45ea6d[_0xfb22('0x7')](_0xfb22('0x39'),require(_0xfb22('0x3a')));_0x45ea6d[_0xfb22('0x7')](_0xfb22('0x3b'),require(_0xfb22('0x3c')));_0x45ea6d[_0xfb22('0x7')]('/api/sms/interactions',require(_0xfb22('0x3d')));_0x45ea6d[_0xfb22('0x7')](_0xfb22('0x3e'),require('./api/smsMessage'));_0x45ea6d[_0xfb22('0x7')]('/api/sms/queues',require('./api/smsQueue'));_0x45ea6d[_0xfb22('0x7')]('/api/openchannel/accounts',require('./api/openchannelAccount'));_0x45ea6d[_0xfb22('0x7')]('/api/openchannel/applications',require(_0xfb22('0x3f')));_0x45ea6d[_0xfb22('0x7')]('/api/openchannel/interactions',require(_0xfb22('0x40')));_0x45ea6d[_0xfb22('0x7')](_0xfb22('0x41'),require('./api/openchannelMessage'));_0x45ea6d['use'](_0xfb22('0x42'),require(_0xfb22('0x43')));_0x45ea6d[_0xfb22('0x7')](_0xfb22('0x44'),require(_0xfb22('0x45')));_0x45ea6d['use'](_0xfb22('0x46'),require(_0xfb22('0x47')));_0x45ea6d[_0xfb22('0x7')](_0xfb22('0x48'),require(_0xfb22('0x49')));_0x45ea6d[_0xfb22('0x7')]('/api/chat/interactions',require(_0xfb22('0x4a')));_0x45ea6d[_0xfb22('0x7')](_0xfb22('0x4b'),require(_0xfb22('0x4c')));_0x45ea6d[_0xfb22('0x7')](_0xfb22('0x4d'),require(_0xfb22('0x4e')));_0x45ea6d[_0xfb22('0x7')](_0xfb22('0x4f'),require(_0xfb22('0x50')));_0x45ea6d[_0xfb22('0x7')](_0xfb22('0x51'),require(_0xfb22('0x52')));_0x45ea6d[_0xfb22('0x7')]('/api/chat/proactive_actions',require(_0xfb22('0x53')));_0x45ea6d['use'](_0xfb22('0x54'),require(_0xfb22('0x55')));_0x45ea6d[_0xfb22('0x7')](_0xfb22('0x56'),require(_0xfb22('0x57')));_0x45ea6d[_0xfb22('0x7')](_0xfb22('0x58'),require(_0xfb22('0x59')));_0x45ea6d[_0xfb22('0x7')](_0xfb22('0x5a'),require(_0xfb22('0x5b')));_0x45ea6d[_0xfb22('0x7')](_0xfb22('0x5c'),require('./api/cmHopperFinal'));_0x45ea6d['use'](_0xfb22('0x5d'),require(_0xfb22('0x5e')));_0x45ea6d[_0xfb22('0x7')](_0xfb22('0x5f'),require(_0xfb22('0x60')));_0x45ea6d[_0xfb22('0x7')]('/api/actions',require(_0xfb22('0x61')));_0x45ea6d['use'](_0xfb22('0x62'),require(_0xfb22('0x63')));_0x45ea6d[_0xfb22('0x7')](_0xfb22('0x64'),require(_0xfb22('0x65')));_0x45ea6d[_0xfb22('0x7')](_0xfb22('0x66'),require('./api/disposition'));_0x45ea6d['use'](_0xfb22('0x67'),require(_0xfb22('0x68')));_0x45ea6d[_0xfb22('0x7')]('/api/intervals',require(_0xfb22('0x69')));_0x45ea6d[_0xfb22('0x7')](_0xfb22('0x6a'),require(_0xfb22('0x6b')));_0x45ea6d[_0xfb22('0x7')](_0xfb22('0x6c'),require(_0xfb22('0x6d')));_0x45ea6d['use'](_0xfb22('0x6e'),require(_0xfb22('0x6f')));_0x45ea6d['use']('/api/schedules',require(_0xfb22('0x70')));_0x45ea6d[_0xfb22('0x7')](_0xfb22('0x71'),require('./api/sound'));_0x45ea6d[_0xfb22('0x7')](_0xfb22('0x72'),require(_0xfb22('0x73')));_0x45ea6d['use'](_0xfb22('0x74'),require(_0xfb22('0x75')));_0x45ea6d['use'](_0xfb22('0x76'),require(_0xfb22('0x77')));_0x45ea6d[_0xfb22('0x7')](_0xfb22('0x78'),require(_0xfb22('0x79')));_0x45ea6d[_0xfb22('0x7')](_0xfb22('0x7a'),require(_0xfb22('0x7b')));_0x45ea6d[_0xfb22('0x7')]('/api/triggers',require('./api/trigger'));_0x45ea6d[_0xfb22('0x7')](_0xfb22('0x7c'),require(_0xfb22('0x7d')));_0x45ea6d[_0xfb22('0x7')](_0xfb22('0x7e'),require(_0xfb22('0x7f')));_0x45ea6d[_0xfb22('0x7')]('/api/integrations/reports',require('./api/integrationReport'));_0x45ea6d[_0xfb22('0x7')](_0xfb22('0x80'),require(_0xfb22('0x81')));_0x45ea6d[_0xfb22('0x7')](_0xfb22('0x82'),require(_0xfb22('0x83')));_0x45ea6d[_0xfb22('0x7')]('/api/analytics/extracted_reports',require(_0xfb22('0x84')));_0x45ea6d[_0xfb22('0x7')](_0xfb22('0x85'),require(_0xfb22('0x86')));_0x45ea6d['use'](_0xfb22('0x87'),require(_0xfb22('0x88')));_0x45ea6d[_0xfb22('0x7')](_0xfb22('0x89'),require('./api/analyticTreeReport'));_0x45ea6d[_0xfb22('0x7')](_0xfb22('0x8a'),require(_0xfb22('0x8b')));_0x45ea6d[_0xfb22('0x7')]('/api/integrations/salesforce/configurations',require(_0xfb22('0x8c')));_0x45ea6d[_0xfb22('0x7')](_0xfb22('0x8d'),require(_0xfb22('0x8e')));_0x45ea6d['use'](_0xfb22('0x8f'),require(_0xfb22('0x90')));_0x45ea6d[_0xfb22('0x7')]('/api/integrations/sugarcrm/configurations',require(_0xfb22('0x91')));_0x45ea6d[_0xfb22('0x7')](_0xfb22('0x92'),require(_0xfb22('0x93')));_0x45ea6d[_0xfb22('0x7')](_0xfb22('0x94'),require(_0xfb22('0x95')));_0x45ea6d[_0xfb22('0x7')](_0xfb22('0x96'),require(_0xfb22('0x97')));_0x45ea6d[_0xfb22('0x7')](_0xfb22('0x98'),require(_0xfb22('0x99')));_0x45ea6d['use'](_0xfb22('0x9a'),require('./api/intZohoAccount'));_0x45ea6d[_0xfb22('0x7')](_0xfb22('0x9b'),require('./api/intZohoConfiguration'));_0x45ea6d[_0xfb22('0x7')](_0xfb22('0x9c'),require(_0xfb22('0x9d')));_0x45ea6d['use']('/api/integrations/zendesk/accounts',require(_0xfb22('0x9e')));_0x45ea6d[_0xfb22('0x7')](_0xfb22('0x9f'),require(_0xfb22('0xa0')));_0x45ea6d[_0xfb22('0x7')](_0xfb22('0xa1'),require(_0xfb22('0xa2')));_0x45ea6d['use']('/api/integrations/freshdesk/accounts',require(_0xfb22('0xa3')));_0x45ea6d['use'](_0xfb22('0xa4'),require(_0xfb22('0xa5')));_0x45ea6d[_0xfb22('0x7')](_0xfb22('0xa6'),require(_0xfb22('0xa7')));_0x45ea6d[_0xfb22('0x7')](_0xfb22('0xa8'),require(_0xfb22('0xa9')));_0x45ea6d[_0xfb22('0x7')](_0xfb22('0xaa'),require(_0xfb22('0xab')));_0x45ea6d[_0xfb22('0x7')](_0xfb22('0xac'),require('./api/intVtigerField'));_0x45ea6d[_0xfb22('0x7')](_0xfb22('0xad'),require('./api/intServicenowAccount'));_0x45ea6d['use'](_0xfb22('0xae'),require(_0xfb22('0xaf')));_0x45ea6d[_0xfb22('0x7')](_0xfb22('0xb0'),require(_0xfb22('0xb1')));_0x45ea6d[_0xfb22('0x7')](_0xfb22('0xb2'),require(_0xfb22('0xb3')));_0x45ea6d[_0xfb22('0x7')](_0xfb22('0xb4'),require(_0xfb22('0xb5')));_0x45ea6d[_0xfb22('0x7')](_0xfb22('0xb6'),require(_0xfb22('0xb7')));_0x45ea6d[_0xfb22('0x7')](_0xfb22('0xb8'),require(_0xfb22('0xb9')));_0x45ea6d[_0xfb22('0x7')](_0xfb22('0xba'),require(_0xfb22('0xbb')));_0x45ea6d[_0xfb22('0x7')]('/api/integrations/freshsales/fields',require(_0xfb22('0xbc')));_0x45ea6d[_0xfb22('0x7')](_0xfb22('0xbd'),require(_0xfb22('0xbe')));_0x45ea6d[_0xfb22('0x7')](_0xfb22('0xbf'),require('./api/chatQueueReport'));_0x45ea6d['use']('/api/chat/internal/messages',require('./api/chatInternalMessage'));_0x45ea6d[_0xfb22('0x7')]('/api/jscripty/answers/reports',require(_0xfb22('0xc0')));_0x45ea6d[_0xfb22('0x7')](_0xfb22('0xc1'),require(_0xfb22('0xc2')));_0x45ea6d[_0xfb22('0x7')](_0xfb22('0xc3'),require(_0xfb22('0xc4')));_0x45ea6d[_0xfb22('0x7')](_0xfb22('0xc5'),require(_0xfb22('0xc6')));_0x45ea6d[_0xfb22('0x7')](_0xfb22('0xc7'),require(_0xfb22('0xc8')));_0x45ea6d[_0xfb22('0x7')](_0xfb22('0xc9'),require('./api/squareReportDetail'));_0x45ea6d[_0xfb22('0x7')](_0xfb22('0xca'),require(_0xfb22('0xcb')));_0x45ea6d[_0xfb22('0x7')](_0xfb22('0xcc'),require(_0xfb22('0xcd')));_0x45ea6d[_0xfb22('0x7')](_0xfb22('0xce'),require(_0xfb22('0xcf')));_0x45ea6d[_0xfb22('0x7')](_0xfb22('0xd0'),require(_0xfb22('0xd1')));_0x45ea6d[_0xfb22('0x7')](_0xfb22('0xd2'),require(_0xfb22('0xd3')));_0x45ea6d['use'](_0xfb22('0xd4'),require(_0xfb22('0xd5')));_0x45ea6d[_0xfb22('0x7')]('/api/teams',require(_0xfb22('0xd6')));_0x45ea6d['use']('/api/license',require('./api/license'));_0x45ea6d[_0xfb22('0x7')]('/api/campaigns',require('./api/campaign'));_0x45ea6d['use'](_0xfb22('0xd7'),require(_0xfb22('0xd8')));_0x45ea6d[_0xfb22('0x7')](_0xfb22('0xd9'),require('./api/attachment'));_0x45ea6d['use'](_0xfb22('0xda'),require(_0xfb22('0xdb')));_0x45ea6d[_0xfb22('0x7')]('/api/mail/reports/transfer',require('./api/mailTransferReport'));_0x45ea6d[_0xfb22('0x7')]('/api/chat/reports/transfer',require(_0xfb22('0xdc')));_0x45ea6d[_0xfb22('0x7')](_0xfb22('0xdd'),require('./api/faxTransferReport'));_0x45ea6d['use'](_0xfb22('0xde'),require(_0xfb22('0xdf')));_0x45ea6d['use'](_0xfb22('0xe0'),require('./api/smsTransferReport'));_0x45ea6d[_0xfb22('0x7')](_0xfb22('0xe1'),require(_0xfb22('0xe2')));_0x45ea6d[_0xfb22('0x7')](_0xfb22('0xe3'),require('./api/voicePrefix'));_0x45ea6d[_0xfb22('0x7')](_0xfb22('0xe4'),require('./api/userProfile'));_0x45ea6d[_0xfb22('0x7')](_0xfb22('0xe5'),require(_0xfb22('0xe6')));_0x45ea6d[_0xfb22('0x7')](_0xfb22('0xe7'),require(_0xfb22('0xe8')));_0x45ea6d[_0xfb22('0x7')]('/api/userNotifications',require(_0xfb22('0xe9')));_0x45ea6d[_0xfb22('0x7')](_0xfb22('0xea'),require(_0xfb22('0xeb')));_0x45ea6d['use']('/api/whatsapp/applications',require(_0xfb22('0xec')));_0x45ea6d[_0xfb22('0x7')](_0xfb22('0xed'),require('./api/whatsappInteraction'));_0x45ea6d[_0xfb22('0x7')](_0xfb22('0xee'),require(_0xfb22('0xef')));_0x45ea6d[_0xfb22('0x7')](_0xfb22('0xf0'),require(_0xfb22('0xf1')));_0x45ea6d[_0xfb22('0x7')](_0xfb22('0xf2'),require(_0xfb22('0xf3')));_0x45ea6d[_0xfb22('0x7')](_0xfb22('0xf4'),require('./api/whatsappQueue'));_0x45ea6d[_0xfb22('0x7')]('/api/cloudProviders',require(_0xfb22('0xf5')));_0x45ea6d['use'](_0xfb22('0xf6'),require('./api/realtime'));_0x45ea6d[_0xfb22('0x7')](_0xfb22('0xf7'),require('./api/user-setting'));_0x45ea6d[_0xfb22('0x7')](_0xfb22('0xf8'),require(_0xfb22('0xf9')));_0x45ea6d['use'](_0xfb22('0xfa'),require(_0xfb22('0xfb')));_0x45ea6d[_0xfb22('0x7')](_0xfb22('0xfc'),require(_0xfb22('0xfd')));_0x45ea6d['use'](_0xfb22('0xfe'),require('./api/jira'));_0x45ea6d[_0xfb22('0x7')](_0xfb22('0xff'),require(_0xfb22('0x100')));_0x45ea6d['use']('/api/version',require('./api/version'));_0x45ea6d['use'](_0xfb22('0x101'),require('./api/system'));_0x45ea6d['use'](_0xfb22('0x102'),require(_0xfb22('0x103')));_0x45ea6d[_0xfb22('0x7')](_0xfb22('0x104'),require('./api/webbar'));_0x45ea6d['use'](_0xfb22('0x105'),clientSideLogs);_0x45ea6d['use'](_0xfb22('0x106'),express['static'](path['join'](config[_0xfb22('0x107')],'/apidoc')));_0x45ea6d[_0xfb22('0x7')](_0xfb22('0x108'),express[_0xfb22('0x109')](path['join'](config[_0xfb22('0x107')],'/www')));_0x45ea6d[_0xfb22('0x7')](_0xfb22('0x10a'),express['static'](path['join'](config['root'],_0xfb22('0x10a'))));_0x45ea6d[_0xfb22('0x7')]('/snippet',express[_0xfb22('0x109')](path['join'](config[_0xfb22('0x107')],_0xfb22('0x10b'),_0xfb22('0x10c'))));_0x45ea6d[_0xfb22('0x7')]('/plugins',express[_0xfb22('0x109')](path[_0xfb22('0x10d')](config[_0xfb22('0x107')],'/server/files/plugins')));_0x45ea6d['route'](_0xfb22('0x10e'))['get'](errors[0x194]);_0x45ea6d[_0xfb22('0x10f')]('/*')[_0xfb22('0x110')](function(_0x45f107,_0x24359f){_0x24359f['sendFile'](path['resolve'](_0x45ea6d['get'](_0xfb22('0x111'))+_0xfb22('0x112')));});return _0x45ea6d;});};
\ No newline at end of file
index 5afce1f..51300dd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5057=['error','listen','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','RPC\x20listening\x20on\x20','jayson/promise','lodash','../config/environment','merge','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailInteraction/mailInteraction.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intServicenowAccount/intServicenowAccount.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'];(function(_0x17ada2,_0xeab565){var _0x2c96e6=function(_0xb9196f){while(--_0xb9196f){_0x17ada2['push'](_0x17ada2['shift']());}};_0x2c96e6(++_0xeab565);}(_0x5057,0x151));var _0x7505=function(_0x91792,_0x34e10a){_0x91792=_0x91792-0x0;var _0x559ee1=_0x5057[_0x91792];return _0x559ee1;};'use strict';var jayson=require(_0x7505('0x0'));var _=require(_0x7505('0x1'));var config=require(_0x7505('0x2'));exports['listen']=function(){return new Promise(function(_0x25f187,_0x1db2e4){var _0x3a0a9e={};_0x3a0a9e=_[_0x7505('0x3')](_0x3a0a9e,require('../api/user/user.rpc'));_0x3a0a9e=_[_0x7505('0x3')](_0x3a0a9e,require(_0x7505('0x4')));_0x3a0a9e=_['merge'](_0x3a0a9e,require(_0x7505('0x5')));_0x3a0a9e=_[_0x7505('0x3')](_0x3a0a9e,require(_0x7505('0x6')));_0x3a0a9e=_[_0x7505('0x3')](_0x3a0a9e,require(_0x7505('0x7')));_0x3a0a9e=_[_0x7505('0x3')](_0x3a0a9e,require('../api/voiceDialReport/voiceDialReport.rpc'));_0x3a0a9e=_[_0x7505('0x3')](_0x3a0a9e,require('../api/voiceAgentReport/voiceAgentReport.rpc'));_0x3a0a9e=_[_0x7505('0x3')](_0x3a0a9e,require(_0x7505('0x8')));_0x3a0a9e=_[_0x7505('0x3')](_0x3a0a9e,require('../api/memberReport/memberReport.rpc'));_0x3a0a9e=_['merge'](_0x3a0a9e,require(_0x7505('0x9')));_0x3a0a9e=_[_0x7505('0x3')](_0x3a0a9e,require(_0x7505('0xa')));_0x3a0a9e=_[_0x7505('0x3')](_0x3a0a9e,require(_0x7505('0xb')));_0x3a0a9e=_['merge'](_0x3a0a9e,require(_0x7505('0xc')));_0x3a0a9e=_[_0x7505('0x3')](_0x3a0a9e,require('../api/mailAccount/mailAccount.rpc'));_0x3a0a9e=_[_0x7505('0x3')](_0x3a0a9e,require('../api/mailQueue/mailQueue.rpc'));_0x3a0a9e=_[_0x7505('0x3')](_0x3a0a9e,require(_0x7505('0xd')));_0x3a0a9e=_[_0x7505('0x3')](_0x3a0a9e,require('../api/mailMessage/mailMessage.rpc'));_0x3a0a9e=_[_0x7505('0x3')](_0x3a0a9e,require('../api/mailApplication/mailApplication.rpc'));_0x3a0a9e=_[_0x7505('0x3')](_0x3a0a9e,require('../api/mailQueueReport/mailQueueReport.rpc'));_0x3a0a9e=_[_0x7505('0x3')](_0x3a0a9e,require('../api/faxAccount/faxAccount.rpc'));_0x3a0a9e=_[_0x7505('0x3')](_0x3a0a9e,require('../api/faxApplication/faxApplication.rpc'));_0x3a0a9e=_[_0x7505('0x3')](_0x3a0a9e,require(_0x7505('0xe')));_0x3a0a9e=_[_0x7505('0x3')](_0x3a0a9e,require(_0x7505('0xf')));_0x3a0a9e=_[_0x7505('0x3')](_0x3a0a9e,require('../api/faxQueue/faxQueue.rpc'));_0x3a0a9e=_[_0x7505('0x3')](_0x3a0a9e,require(_0x7505('0x10')));_0x3a0a9e=_[_0x7505('0x3')](_0x3a0a9e,require(_0x7505('0x11')));_0x3a0a9e=_[_0x7505('0x3')](_0x3a0a9e,require(_0x7505('0x12')));_0x3a0a9e=_[_0x7505('0x3')](_0x3a0a9e,require(_0x7505('0x13')));_0x3a0a9e=_[_0x7505('0x3')](_0x3a0a9e,require(_0x7505('0x14')));_0x3a0a9e=_[_0x7505('0x3')](_0x3a0a9e,require('../api/openchannelApplication/openchannelApplication.rpc'));_0x3a0a9e=_['merge'](_0x3a0a9e,require(_0x7505('0x15')));_0x3a0a9e=_[_0x7505('0x3')](_0x3a0a9e,require(_0x7505('0x16')));_0x3a0a9e=_['merge'](_0x3a0a9e,require(_0x7505('0x17')));_0x3a0a9e=_[_0x7505('0x3')](_0x3a0a9e,require(_0x7505('0x18')));_0x3a0a9e=_[_0x7505('0x3')](_0x3a0a9e,require('../api/chatInteraction/chatInteraction.rpc'));_0x3a0a9e=_['merge'](_0x3a0a9e,require(_0x7505('0x19')));_0x3a0a9e=_[_0x7505('0x3')](_0x3a0a9e,require(_0x7505('0x1a')));_0x3a0a9e=_[_0x7505('0x3')](_0x3a0a9e,require('../api/cmContact/cmContact.rpc'));_0x3a0a9e=_[_0x7505('0x3')](_0x3a0a9e,require(_0x7505('0x1b')));_0x3a0a9e=_[_0x7505('0x3')](_0x3a0a9e,require(_0x7505('0x1c')));_0x3a0a9e=_[_0x7505('0x3')](_0x3a0a9e,require('../api/cmHopperFinal/cmHopperFinal.rpc'));_0x3a0a9e=_[_0x7505('0x3')](_0x3a0a9e,require(_0x7505('0x1d')));_0x3a0a9e=_['merge'](_0x3a0a9e,require(_0x7505('0x1e')));_0x3a0a9e=_[_0x7505('0x3')](_0x3a0a9e,require('../api/interval/interval.rpc'));_0x3a0a9e=_[_0x7505('0x3')](_0x3a0a9e,require(_0x7505('0x1f')));_0x3a0a9e=_['merge'](_0x3a0a9e,require(_0x7505('0x20')));_0x3a0a9e=_['merge'](_0x3a0a9e,require('../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc'));_0x3a0a9e=_['merge'](_0x3a0a9e,require(_0x7505('0x21')));_0x3a0a9e=_['merge'](_0x3a0a9e,require(_0x7505('0x22')));_0x3a0a9e=_[_0x7505('0x3')](_0x3a0a9e,require(_0x7505('0x23')));_0x3a0a9e=_[_0x7505('0x3')](_0x3a0a9e,require(_0x7505('0x24')));_0x3a0a9e=_[_0x7505('0x3')](_0x3a0a9e,require(_0x7505('0x25')));_0x3a0a9e=_[_0x7505('0x3')](_0x3a0a9e,require(_0x7505('0x26')));_0x3a0a9e=_['merge'](_0x3a0a9e,require('../api/intZohoAccount/intZohoAccount.rpc'));_0x3a0a9e=_[_0x7505('0x3')](_0x3a0a9e,require(_0x7505('0x27')));_0x3a0a9e=_[_0x7505('0x3')](_0x3a0a9e,require(_0x7505('0x28')));_0x3a0a9e=_[_0x7505('0x3')](_0x3a0a9e,require('../api/intVtigerAccount/intVtigerAccount.rpc'));_0x3a0a9e=_[_0x7505('0x3')](_0x3a0a9e,require(_0x7505('0x29')));_0x3a0a9e=_[_0x7505('0x3')](_0x3a0a9e,require('../api/intDynamics365Account/intDynamics365Account.rpc'));_0x3a0a9e=_[_0x7505('0x3')](_0x3a0a9e,require('../api/intFreshsalesAccount/intFreshsalesAccount.rpc'));_0x3a0a9e=_[_0x7505('0x3')](_0x3a0a9e,require(_0x7505('0x2a')));_0x3a0a9e=_[_0x7505('0x3')](_0x3a0a9e,require(_0x7505('0x2b')));_0x3a0a9e=_['merge'](_0x3a0a9e,require(_0x7505('0x2c')));_0x3a0a9e=_['merge'](_0x3a0a9e,require(_0x7505('0x2d')));_0x3a0a9e=_[_0x7505('0x3')](_0x3a0a9e,require('../api/setting/setting.rpc'));_0x3a0a9e=_[_0x7505('0x3')](_0x3a0a9e,require('../api/squareOdbc/squareOdbc.rpc'));_0x3a0a9e=_[_0x7505('0x3')](_0x3a0a9e,require(_0x7505('0x2e')));_0x3a0a9e=_[_0x7505('0x3')](_0x3a0a9e,require(_0x7505('0x2f')));_0x3a0a9e=_['merge'](_0x3a0a9e,require(_0x7505('0x30')));_0x3a0a9e=_[_0x7505('0x3')](_0x3a0a9e,require('../api/campaign/campaign.rpc'));_0x3a0a9e=_[_0x7505('0x3')](_0x3a0a9e,require(_0x7505('0x31')));_0x3a0a9e=_['merge'](_0x3a0a9e,require(_0x7505('0x32')));_0x3a0a9e=_[_0x7505('0x3')](_0x3a0a9e,require(_0x7505('0x33')));_0x3a0a9e=_[_0x7505('0x3')](_0x3a0a9e,require(_0x7505('0x34')));_0x3a0a9e=_['merge'](_0x3a0a9e,require(_0x7505('0x35')));_0x3a0a9e=_[_0x7505('0x3')](_0x3a0a9e,require(_0x7505('0x36')));_0x3a0a9e=_[_0x7505('0x3')](_0x3a0a9e,require(_0x7505('0x37')));var _0x1c02e2=jayson['server'](_0x3a0a9e)['http']();var _0x3337bd=config[_0x7505('0x38')]['port']||config[_0x7505('0x39')]+0x1;var _0x1e6fdd=config[_0x7505('0x38')]['ip']||_0x7505('0x3a');_0x1c02e2['on'](_0x7505('0x3b'),function(_0x31c6d1){return _0x1db2e4(_0x31c6d1);});_0x1c02e2[_0x7505('0x3c')](_0x3337bd,_0x1e6fdd,function(){console[_0x7505('0x3d')](_0x7505('0x3e'),_0x1e6fdd,_0x3337bd);require(_0x7505('0x3f'))[_0x7505('0x40')]();return _0x25f187(_0x7505('0x41')+_0x1e6fdd+':'+_0x3337bd);});});};
\ No newline at end of file
+var _0x25d9=['../api/smsAccount/smsAccount.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/sound/sound.rpc','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc','../api/template/template.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.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','rpc','port','error','log','../config/triggers','default','jayson/promise','lodash','../config/environment','listen','merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc'];(function(_0x164d76,_0x33e840){var _0x48ada5=function(_0x180dd4){while(--_0x180dd4){_0x164d76['push'](_0x164d76['shift']());}};_0x48ada5(++_0x33e840);}(_0x25d9,0x16d));var _0x925d=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x25d9[_0xfae23b];return _0x200640;};'use strict';var jayson=require(_0x925d('0x0'));var _=require(_0x925d('0x1'));var config=require(_0x925d('0x2'));exports[_0x925d('0x3')]=function(){return new Promise(function(_0x106af9,_0xceac12){var _0x5bbb1f={};_0x5bbb1f=_[_0x925d('0x4')](_0x5bbb1f,require(_0x925d('0x5')));_0x5bbb1f=_[_0x925d('0x4')](_0x5bbb1f,require(_0x925d('0x6')));_0x5bbb1f=_[_0x925d('0x4')](_0x5bbb1f,require(_0x925d('0x7')));_0x5bbb1f=_[_0x925d('0x4')](_0x5bbb1f,require(_0x925d('0x8')));_0x5bbb1f=_[_0x925d('0x4')](_0x5bbb1f,require(_0x925d('0x9')));_0x5bbb1f=_[_0x925d('0x4')](_0x5bbb1f,require(_0x925d('0xa')));_0x5bbb1f=_[_0x925d('0x4')](_0x5bbb1f,require(_0x925d('0xb')));_0x5bbb1f=_[_0x925d('0x4')](_0x5bbb1f,require(_0x925d('0xc')));_0x5bbb1f=_['merge'](_0x5bbb1f,require(_0x925d('0xd')));_0x5bbb1f=_['merge'](_0x5bbb1f,require('../api/trunk/trunk.rpc'));_0x5bbb1f=_['merge'](_0x5bbb1f,require('../api/voiceTransferReport/voiceTransferReport.rpc'));_0x5bbb1f=_[_0x925d('0x4')](_0x5bbb1f,require('../api/userVoiceQueueRt/userVoiceQueueRt.rpc'));_0x5bbb1f=_['merge'](_0x5bbb1f,require(_0x925d('0xe')));_0x5bbb1f=_['merge'](_0x5bbb1f,require(_0x925d('0xf')));_0x5bbb1f=_[_0x925d('0x4')](_0x5bbb1f,require(_0x925d('0x10')));_0x5bbb1f=_['merge'](_0x5bbb1f,require(_0x925d('0x11')));_0x5bbb1f=_['merge'](_0x5bbb1f,require(_0x925d('0x12')));_0x5bbb1f=_[_0x925d('0x4')](_0x5bbb1f,require(_0x925d('0x13')));_0x5bbb1f=_[_0x925d('0x4')](_0x5bbb1f,require('../api/mailQueueReport/mailQueueReport.rpc'));_0x5bbb1f=_[_0x925d('0x4')](_0x5bbb1f,require(_0x925d('0x14')));_0x5bbb1f=_[_0x925d('0x4')](_0x5bbb1f,require(_0x925d('0x15')));_0x5bbb1f=_[_0x925d('0x4')](_0x5bbb1f,require(_0x925d('0x16')));_0x5bbb1f=_[_0x925d('0x4')](_0x5bbb1f,require('../api/faxMessage/faxMessage.rpc'));_0x5bbb1f=_['merge'](_0x5bbb1f,require(_0x925d('0x17')));_0x5bbb1f=_[_0x925d('0x4')](_0x5bbb1f,require(_0x925d('0x18')));_0x5bbb1f=_[_0x925d('0x4')](_0x5bbb1f,require(_0x925d('0x19')));_0x5bbb1f=_[_0x925d('0x4')](_0x5bbb1f,require('../api/smsInteraction/smsInteraction.rpc'));_0x5bbb1f=_[_0x925d('0x4')](_0x5bbb1f,require('../api/smsMessage/smsMessage.rpc'));_0x5bbb1f=_[_0x925d('0x4')](_0x5bbb1f,require(_0x925d('0x1a')));_0x5bbb1f=_[_0x925d('0x4')](_0x5bbb1f,require('../api/openchannelApplication/openchannelApplication.rpc'));_0x5bbb1f=_[_0x925d('0x4')](_0x5bbb1f,require(_0x925d('0x1b')));_0x5bbb1f=_[_0x925d('0x4')](_0x5bbb1f,require(_0x925d('0x1c')));_0x5bbb1f=_[_0x925d('0x4')](_0x5bbb1f,require(_0x925d('0x1d')));_0x5bbb1f=_[_0x925d('0x4')](_0x5bbb1f,require('../api/openchannelQueueReport/openchannelQueueReport.rpc'));_0x5bbb1f=_[_0x925d('0x4')](_0x5bbb1f,require(_0x925d('0x1e')));_0x5bbb1f=_[_0x925d('0x4')](_0x5bbb1f,require(_0x925d('0x1f')));_0x5bbb1f=_[_0x925d('0x4')](_0x5bbb1f,require(_0x925d('0x20')));_0x5bbb1f=_[_0x925d('0x4')](_0x5bbb1f,require('../api/cmContact/cmContact.rpc'));_0x5bbb1f=_[_0x925d('0x4')](_0x5bbb1f,require(_0x925d('0x21')));_0x5bbb1f=_[_0x925d('0x4')](_0x5bbb1f,require(_0x925d('0x22')));_0x5bbb1f=_['merge'](_0x5bbb1f,require('../api/cmHopperFinal/cmHopperFinal.rpc'));_0x5bbb1f=_[_0x925d('0x4')](_0x5bbb1f,require('../api/cmHopperHistory/cmHopperHistory.rpc'));_0x5bbb1f=_['merge'](_0x5bbb1f,require(_0x925d('0x23')));_0x5bbb1f=_[_0x925d('0x4')](_0x5bbb1f,require(_0x925d('0x24')));_0x5bbb1f=_[_0x925d('0x4')](_0x5bbb1f,require('../api/pause/pause.rpc'));_0x5bbb1f=_['merge'](_0x5bbb1f,require(_0x925d('0x25')));_0x5bbb1f=_[_0x925d('0x4')](_0x5bbb1f,require(_0x925d('0x26')));_0x5bbb1f=_[_0x925d('0x4')](_0x5bbb1f,require(_0x925d('0x27')));_0x5bbb1f=_['merge'](_0x5bbb1f,require('../api/trigger/trigger.rpc'));_0x5bbb1f=_[_0x925d('0x4')](_0x5bbb1f,require('../api/variable/variable.rpc'));_0x5bbb1f=_[_0x925d('0x4')](_0x5bbb1f,require('../api/intSalesforceAccount/intSalesforceAccount.rpc'));_0x5bbb1f=_['merge'](_0x5bbb1f,require(_0x925d('0x28')));_0x5bbb1f=_[_0x925d('0x4')](_0x5bbb1f,require(_0x925d('0x29')));_0x5bbb1f=_['merge'](_0x5bbb1f,require(_0x925d('0x2a')));_0x5bbb1f=_[_0x925d('0x4')](_0x5bbb1f,require(_0x925d('0x2b')));_0x5bbb1f=_[_0x925d('0x4')](_0x5bbb1f,require(_0x925d('0x2c')));_0x5bbb1f=_[_0x925d('0x4')](_0x5bbb1f,require('../api/intVtigerAccount/intVtigerAccount.rpc'));_0x5bbb1f=_[_0x925d('0x4')](_0x5bbb1f,require(_0x925d('0x2d')));_0x5bbb1f=_[_0x925d('0x4')](_0x5bbb1f,require(_0x925d('0x2e')));_0x5bbb1f=_[_0x925d('0x4')](_0x5bbb1f,require('../api/intFreshsalesAccount/intFreshsalesAccount.rpc'));_0x5bbb1f=_[_0x925d('0x4')](_0x5bbb1f,require(_0x925d('0x2f')));_0x5bbb1f=_[_0x925d('0x4')](_0x5bbb1f,require(_0x925d('0x30')));_0x5bbb1f=_[_0x925d('0x4')](_0x5bbb1f,require('../api/squareReport/squareReport.rpc'));_0x5bbb1f=_[_0x925d('0x4')](_0x5bbb1f,require('../api/squareReportDetail/squareReportDetail.rpc'));_0x5bbb1f=_[_0x925d('0x4')](_0x5bbb1f,require(_0x925d('0x31')));_0x5bbb1f=_[_0x925d('0x4')](_0x5bbb1f,require(_0x925d('0x32')));_0x5bbb1f=_['merge'](_0x5bbb1f,require(_0x925d('0x33')));_0x5bbb1f=_[_0x925d('0x4')](_0x5bbb1f,require(_0x925d('0x34')));_0x5bbb1f=_[_0x925d('0x4')](_0x5bbb1f,require('../api/squareMessage/squareMessage.rpc'));_0x5bbb1f=_[_0x925d('0x4')](_0x5bbb1f,require('../api/campaign/campaign.rpc'));_0x5bbb1f=_[_0x925d('0x4')](_0x5bbb1f,require(_0x925d('0x35')));_0x5bbb1f=_['merge'](_0x5bbb1f,require(_0x925d('0x36')));_0x5bbb1f=_[_0x925d('0x4')](_0x5bbb1f,require(_0x925d('0x37')));_0x5bbb1f=_[_0x925d('0x4')](_0x5bbb1f,require(_0x925d('0x38')));_0x5bbb1f=_[_0x925d('0x4')](_0x5bbb1f,require(_0x925d('0x39')));_0x5bbb1f=_[_0x925d('0x4')](_0x5bbb1f,require('../api/whatsappQueueReport/whatsappQueueReport.rpc'));_0x5bbb1f=_[_0x925d('0x4')](_0x5bbb1f,require(_0x925d('0x3a')));var _0x4a95d0=jayson['server'](_0x5bbb1f)['http']();var _0x17aafe=config[_0x925d('0x3b')][_0x925d('0x3c')]||config['port']+0x1;var _0x16eca1=config['rpc']['ip']||'localhost';_0x4a95d0['on'](_0x925d('0x3d'),function(_0x54b6bb){return _0xceac12(_0x54b6bb);});_0x4a95d0[_0x925d('0x3')](_0x17aafe,_0x16eca1,function(){console[_0x925d('0x3e')]('Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!',_0x16eca1,_0x17aafe);require(_0x925d('0x3f'))[_0x925d('0x40')]();return _0x106af9('RPC\x20listening\x20on\x20'+_0x16eca1+':'+_0x17aafe);});});};
\ No newline at end of file
index dc04076..3ef1383 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3249=['replace','indexOf','substr','startsWith','match','error','E_AGI_SOCKET_ERROR','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','command','write','prototype','sendRequest','sync','answer','ANSWER','getData','beep','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','format','VERBOSE\x20\x22%s\x22','exec','isArray','join','EXEC\x20%s\x20%s','setContext','SET\x20CONTEXT\x20%s','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','isBoolean','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','sayPhonetic','continueAt','extension','noop','GOTO\x20%s\x20%s\x20%s','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','agi','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','util','lodash','events','./reply','./error','setEncoding','utf8','headers','emit','ready','line','toLowerCase','hangup','substring','520-Invalid','search','520\x20End\x20of\x20proper','function'];(function(_0x3faa01,_0x2f6848){var _0xbf40df=function(_0x249644){while(--_0x249644){_0x3faa01['push'](_0x3faa01['shift']());}};_0xbf40df(++_0x2f6848);}(_0x3249,0xd2));var _0x9324=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0x3249[_0x68c979];return _0x4f0001;};'use strict';var util=require(_0x9324('0x0'));var _=require(_0x9324('0x1'));var EventEmitter=require(_0x9324('0x2'))['EventEmitter'];var AGIReply=require(_0x9324('0x3'));var AGIError=require(_0x9324('0x4'));function AGIChannel(_0x5f28e7){var _0x4b4067=this,_0x5f3977=new AGIReply(),_0x1677cf=![],_0xa59a0d={};EventEmitter['call'](_0x4b4067);_0x5f28e7[_0x9324('0x5')](_0x9324('0x6'));_0x5f28e7['setTimeout'](0x8*0x3c*0x3c*0x3e8);_0x5f3977['setEncoding'](_0x9324('0x6'));_0x5f3977['on'](_0x9324('0x7'),function(_0x4a3f08){for(var _0x22e764 in _0x4a3f08){_0x4b4067[_0x22e764]=_0x4a3f08[_0x22e764];}_0x4b4067[_0x9324('0x8')](_0x9324('0x9'));});_0x5f3977['on'](_0x9324('0xa'),function(_0x58bc71){if(_0x58bc71[_0x9324('0xb')]()==_0x9324('0xc')){_0x4b4067[_0x9324('0x8')]('hangup');return;}if(_0x58bc71[_0x9324('0xd')](0x0,0xb)==_0x9324('0xe')){_0x1677cf=!![];}if(_0x1677cf){_0xa59a0d['rx']+=_0x58bc71+'\x0a';if(_0x58bc71[_0x9324('0xf')](_0x9324('0x10'))!=-0x1){_0x1677cf=![];}}else{_0xa59a0d['rx']=_0x58bc71;}if(_0x1677cf){return;}if(typeof _0xa59a0d['cb']==_0x9324('0x11')){var _0x19e827=_0xa59a0d['rx'][_0x9324('0xd')](0x0,0x3),_0x4ff411=null,_0x1b903c=null;_0x19e827=parseInt(_0x19e827);if(isNaN(_0x19e827)){_0xa59a0d['cb'](null,{'code':0x1f4,'result':-0x1,'extra':'no\x20code'});return;}if(_0x19e827!=0xc8){_0xa59a0d['cb'](null,{'code':_0x19e827,'result':-0x1,'extra':'KO'});return;}_0x4ff411=_0xa59a0d['rx'][_0x9324('0xd')](0x4)[_0x9324('0x12')]('result=','');if(_0x4ff411[_0x9324('0x13')]('\x20')!=-0x1){_0x4ff411=_0x4ff411[_0x9324('0x14')](0x0,_0x4ff411[_0x9324('0x13')]('\x20'));}if(_[_0x9324('0x15')](_0x4ff411,'-1')){_0x4ff411=parseInt(_0x4ff411);}_0x1b903c=_0xa59a0d['rx']['split']('\x20');if(_0x1b903c['length']==0x3){_0x1b903c=_0x1b903c[0x2][_0x9324('0xd')](0x1,_0x1b903c[0x2]['length']-0x1);}else if(_0x1b903c['length']>0x3){var _0x187520=/\((.+)\)/;var _0x3d259f=_0xa59a0d['rx'][_0x9324('0x16')](_0x187520);if(_0x3d259f){_0x1b903c=_0x3d259f[0x1];}else{_0x1b903c=null;}}else{_0x1b903c=null;}_0xa59a0d['cb'](null,{'code':_0x19e827,'result':_0x4ff411,'extra':_0x1b903c});}});_0x5f28e7['on'](_0x9324('0x17'),function(_0x2045f7){_0x4b4067['emit'](_0x9324('0x17'),new AGIError(_0x9324('0x18'),_0x2045f7['code']));});_0x5f28e7['on']('close',function(){_0x4b4067['emit'](_0x9324('0x19'),new AGIError(_0x9324('0x1a')));});_0x5f28e7['on'](_0x9324('0x1b'),function(){_0x4b4067['emit'](_0x9324('0x1b'),new AGIError(_0x9324('0x1c')));_0x5f28e7[_0x9324('0x1d')]();});_0x5f28e7[_0x9324('0x1e')](_0x5f3977);this[_0x9324('0x1f')]=function(_0x4b31ed,_0x1db44d){var _0x4b31ed=_0x4b31ed||'',_0x1db44d=typeof _0x1db44d==_0x9324('0x11')?_0x1db44d:new Function();_0xa59a0d={'tx':_0x4b31ed,'rx':'','cb':_0x1db44d};_0x5f28e7[_0x9324('0x20')](_0x4b31ed+'\x0a');},this[_0x9324('0x19')]=function(){_0x5f28e7[_0x9324('0x1d')]();};}util['inherits'](AGIChannel,EventEmitter);AGIChannel[_0x9324('0x21')][_0x9324('0x22')]=function(_0x5727ac){return this[_0x9324('0x1f')][_0x9324('0x23')](this,_0x5727ac);};AGIChannel[_0x9324('0x21')][_0x9324('0x24')]=function(){return this[_0x9324('0x22')](_0x9324('0x25'));};AGIChannel[_0x9324('0x21')][_0x9324('0x26')]=function(_0x9aff86,_0x2c992c,_0x22f131){_0x9aff86=_0x9aff86===undefined?_0x9324('0x27'):_0x9aff86;_0x2c992c=_0x2c992c===undefined?'5':_0x2c992c;_0x22f131=_0x22f131===undefined?'1':_0x22f131;return this[_0x9324('0x22')](util['format'](_0x9324('0x28'),_0x9aff86,_0x2c992c*0x3e8,_0x22f131));};AGIChannel[_0x9324('0x21')]['noop']=function(_0x168b1c){_0x168b1c=_0x168b1c||'NO\x20MESSAGE';return this[_0x9324('0x22')](util[_0x9324('0x29')](_0x9324('0x2a'),_0x168b1c));};AGIChannel[_0x9324('0x21')][_0x9324('0x2b')]=function(_0xaa75d2,_0x1cc7d8){if(_[_0x9324('0x2c')](_0x1cc7d8)){return this['sendRequest'](util[_0x9324('0x29')]('EXEC\x20%s\x20%s',_0xaa75d2,_0x1cc7d8[_0x9324('0x2d')](',')));}return this[_0x9324('0x22')](util[_0x9324('0x29')](_0x9324('0x2e'),_0xaa75d2,_0x1cc7d8));};AGIChannel[_0x9324('0x21')][_0x9324('0x2f')]=function(_0x266d81){return this[_0x9324('0x22')](util[_0x9324('0x29')](_0x9324('0x30'),_0x266d81));};AGIChannel[_0x9324('0x21')]['setExtension']=function(_0x3650d0){return this[_0x9324('0x22')](util[_0x9324('0x29')](_0x9324('0x31'),_0x3650d0));};AGIChannel[_0x9324('0x21')][_0x9324('0x32')]=function(_0x527134){return this[_0x9324('0x22')](util[_0x9324('0x29')](_0x9324('0x33'),_0x527134));};AGIChannel[_0x9324('0x21')][_0x9324('0xc')]=function(){return this[_0x9324('0x22')]('HANGUP');};AGIChannel[_0x9324('0x21')]['setVariable']=function(_0x349610,_0x5517d4){var _0x3df123=_[_0x9324('0x34')](_0x5517d4)||_[_0x9324('0x35')](_0x5517d4)?_0x5517d4[_0x9324('0x36')]():_0x5517d4;return this[_0x9324('0x22')](util['format'](_0x9324('0x37'),_0x349610,_0x3df123?_0x3df123['toString']()[_0x9324('0x12')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x9324('0x21')][_0x9324('0x38')]=function(_0x37984a,_0x3dcb4a){return this['sendRequest'](util[_0x9324('0x29')](_0x9324('0x39'),_0x37984a,_0x3dcb4a));};AGIChannel[_0x9324('0x21')][_0x9324('0x3a')]=function(_0x597f0c,_0x2e8cf0){return this[_0x9324('0x22')](util[_0x9324('0x29')]('SAY\x20DIGITS\x20%s\x20%s',_0x597f0c,_0x2e8cf0));};AGIChannel['prototype'][_0x9324('0x3b')]=function(_0xd01c01,_0x48a2fc){return this[_0x9324('0x22')](util['format']('SAY\x20PHONETIC\x20\x22%s\x22\x20%s',_0xd01c01,_0x48a2fc));};AGIChannel[_0x9324('0x21')][_0x9324('0x3c')]=function(_0x68fe4a,_0x9d2160,_0x5065b1){_0x9d2160=_0x9d2160||this[_0x9324('0x3d')];_0x5065b1=_0x5065b1||0x1;this['setContext'](_0x68fe4a);this['setExtension'](_0x9d2160);this[_0x9324('0x32')](_0x5065b1);return this[_0x9324('0x3e')](util['format'](_0x9324('0x3f'),_0x68fe4a,_0x9d2160,_0x5065b1));};AGIChannel[_0x9324('0x21')]['getVariable']=function(_0x8de757){return this[_0x9324('0x22')](util[_0x9324('0x29')](_0x9324('0x40'),_0x8de757));};AGIChannel[_0x9324('0x21')][_0x9324('0x41')]=function(_0x5aa769,_0x538256,_0x35259c,_0x4cc82f,_0x214f36,_0x57dc5f){_0x538256=_0x538256||_0x9324('0x42');_0x35259c=_0x35259c||'';_0x4cc82f=_0x4cc82f===undefined?-0x1:_0x4cc82f==='-1'?-0x1:_0x4cc82f*0x3e8;_0x214f36=_0x214f36===undefined?'':'s='+_0x214f36;_0x57dc5f=_0x57dc5f?_0x9324('0x43'):'';return this[_0x9324('0x22')](util[_0x9324('0x29')](_0x9324('0x44'),_0x5aa769,_0x538256,_0x35259c,_0x4cc82f,_0x57dc5f,_0x214f36));};AGIChannel[_0x9324('0x21')][_0x9324('0x45')]=function(_0x473ee4,_0x1742e3){_0x1742e3=_0x1742e3||'';return this[_0x9324('0x22')](util[_0x9324('0x29')]('STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22',_0x473ee4,_0x1742e3));};AGIChannel['prototype'][_0x9324('0x46')]=function(_0x1c0185){return this['exec']('AGI',_0x1c0185);};AGIChannel['prototype'][_0x9324('0x47')]=function(_0x159833){return this['exec'](_0x9324('0x48'),_0x159833);};AGIChannel['prototype'][_0x9324('0x17')]=function(_0x3bb698,_0x5e8c1f){this[_0x9324('0x3e')](util[_0x9324('0x29')](_0x9324('0x49'),_0x3bb698['id'],_0x3bb698[_0x9324('0x4a')],_0x5e8c1f));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x9324('0x4b')]=AGIChannel;
\ No newline at end of file
+var _0x11c3=['label','util','lodash','events','EventEmitter','./error','call','setEncoding','utf8','setTimeout','headers','ready','hangup','substring','520-Invalid','search','function','no\x20code','replace','result=','indexOf','substr','startsWith','split','length','match','error','emit','E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','command','inherits','prototype','sendRequest','sync','answer','ANSWER','getData','beep','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','exec','isArray','EXEC\x20%s\x20%s','join','setContext','SET\x20CONTEXT\x20%s','setExtension','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\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','noop','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','agi','AGI','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s'];(function(_0x4b7db0,_0x4de404){var _0x57ae37=function(_0x25505c){while(--_0x25505c){_0x4b7db0['push'](_0x4b7db0['shift']());}};_0x57ae37(++_0x4de404);}(_0x11c3,0xee));var _0x311c=function(_0x3efa65,_0x44862f){_0x3efa65=_0x3efa65-0x0;var _0x2dd8f3=_0x11c3[_0x3efa65];return _0x2dd8f3;};'use strict';var util=require(_0x311c('0x0'));var _=require(_0x311c('0x1'));var EventEmitter=require(_0x311c('0x2'))[_0x311c('0x3')];var AGIReply=require('./reply');var AGIError=require(_0x311c('0x4'));function AGIChannel(_0x527270){var _0x10f679=this,_0x408a8a=new AGIReply(),_0x42920c=![],_0x1ec201={};EventEmitter[_0x311c('0x5')](_0x10f679);_0x527270[_0x311c('0x6')](_0x311c('0x7'));_0x527270[_0x311c('0x8')](0x8*0x3c*0x3c*0x3e8);_0x408a8a[_0x311c('0x6')]('utf8');_0x408a8a['on'](_0x311c('0x9'),function(_0x51aeb8){for(var _0xa5224 in _0x51aeb8){_0x10f679[_0xa5224]=_0x51aeb8[_0xa5224];}_0x10f679['emit'](_0x311c('0xa'));});_0x408a8a['on']('line',function(_0x2966b5){if(_0x2966b5['toLowerCase']()==_0x311c('0xb')){_0x10f679['emit']('hangup');return;}if(_0x2966b5[_0x311c('0xc')](0x0,0xb)==_0x311c('0xd')){_0x42920c=!![];}if(_0x42920c){_0x1ec201['rx']+=_0x2966b5+'\x0a';if(_0x2966b5[_0x311c('0xe')]('520\x20End\x20of\x20proper')!=-0x1){_0x42920c=![];}}else{_0x1ec201['rx']=_0x2966b5;}if(_0x42920c){return;}if(typeof _0x1ec201['cb']==_0x311c('0xf')){var _0x5311f8=_0x1ec201['rx'][_0x311c('0xc')](0x0,0x3),_0x38c245=null,_0x2b3c6d=null;_0x5311f8=parseInt(_0x5311f8);if(isNaN(_0x5311f8)){_0x1ec201['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x311c('0x10')});return;}if(_0x5311f8!=0xc8){_0x1ec201['cb'](null,{'code':_0x5311f8,'result':-0x1,'extra':'KO'});return;}_0x38c245=_0x1ec201['rx'][_0x311c('0xc')](0x4)[_0x311c('0x11')](_0x311c('0x12'),'');if(_0x38c245[_0x311c('0x13')]('\x20')!=-0x1){_0x38c245=_0x38c245[_0x311c('0x14')](0x0,_0x38c245['indexOf']('\x20'));}if(_[_0x311c('0x15')](_0x38c245,'-1')){_0x38c245=parseInt(_0x38c245);}_0x2b3c6d=_0x1ec201['rx'][_0x311c('0x16')]('\x20');if(_0x2b3c6d['length']==0x3){_0x2b3c6d=_0x2b3c6d[0x2][_0x311c('0xc')](0x1,_0x2b3c6d[0x2][_0x311c('0x17')]-0x1);}else if(_0x2b3c6d['length']>0x3){var _0xf9f1d9=/\((.+)\)/;var _0x47d4ad=_0x1ec201['rx'][_0x311c('0x18')](_0xf9f1d9);if(_0x47d4ad){_0x2b3c6d=_0x47d4ad[0x1];}else{_0x2b3c6d=null;}}else{_0x2b3c6d=null;}_0x1ec201['cb'](null,{'code':_0x5311f8,'result':_0x38c245,'extra':_0x2b3c6d});}});_0x527270['on'](_0x311c('0x19'),function(_0xd9a203){_0x10f679[_0x311c('0x1a')]('error',new AGIError(_0x311c('0x1b'),_0xd9a203[_0x311c('0x1c')]));});_0x527270['on'](_0x311c('0x1d'),function(){_0x10f679[_0x311c('0x1a')](_0x311c('0x1d'),new AGIError(_0x311c('0x1e')));});_0x527270['on'](_0x311c('0x1f'),function(){_0x10f679[_0x311c('0x1a')](_0x311c('0x1f'),new AGIError(_0x311c('0x20')));_0x527270[_0x311c('0x21')]();});_0x527270[_0x311c('0x22')](_0x408a8a);this[_0x311c('0x23')]=function(_0x5250ba,_0x55d271){var _0x5250ba=_0x5250ba||'',_0x55d271=typeof _0x55d271==_0x311c('0xf')?_0x55d271:new Function();_0x1ec201={'tx':_0x5250ba,'rx':'','cb':_0x55d271};_0x527270['write'](_0x5250ba+'\x0a');},this['close']=function(){_0x527270['destroy']();};}util[_0x311c('0x24')](AGIChannel,EventEmitter);AGIChannel[_0x311c('0x25')][_0x311c('0x26')]=function(_0xa1cfce){return this[_0x311c('0x23')][_0x311c('0x27')](this,_0xa1cfce);};AGIChannel['prototype'][_0x311c('0x28')]=function(){return this['sendRequest'](_0x311c('0x29'));};AGIChannel['prototype'][_0x311c('0x2a')]=function(_0x534047,_0x1074a0,_0x237c67){_0x534047=_0x534047===undefined?_0x311c('0x2b'):_0x534047;_0x1074a0=_0x1074a0===undefined?'5':_0x1074a0;_0x237c67=_0x237c67===undefined?'1':_0x237c67;return this['sendRequest'](util[_0x311c('0x2c')](_0x311c('0x2d'),_0x534047,_0x1074a0*0x3e8,_0x237c67));};AGIChannel[_0x311c('0x25')]['noop']=function(_0x5d63df){_0x5d63df=_0x5d63df||_0x311c('0x2e');return this[_0x311c('0x26')](util[_0x311c('0x2c')](_0x311c('0x2f'),_0x5d63df));};AGIChannel['prototype'][_0x311c('0x30')]=function(_0x1c4ca6,_0x449b66){if(_[_0x311c('0x31')](_0x449b66)){return this[_0x311c('0x26')](util[_0x311c('0x2c')](_0x311c('0x32'),_0x1c4ca6,_0x449b66[_0x311c('0x33')](',')));}return this['sendRequest'](util[_0x311c('0x2c')](_0x311c('0x32'),_0x1c4ca6,_0x449b66));};AGIChannel[_0x311c('0x25')][_0x311c('0x34')]=function(_0x17b95c){return this[_0x311c('0x26')](util[_0x311c('0x2c')](_0x311c('0x35'),_0x17b95c));};AGIChannel[_0x311c('0x25')][_0x311c('0x36')]=function(_0xf9ef18){return this[_0x311c('0x26')](util['format']('SET\x20EXTENSION\x20%s',_0xf9ef18));};AGIChannel['prototype'][_0x311c('0x37')]=function(_0xbb6e33){return this[_0x311c('0x26')](util['format'](_0x311c('0x38'),_0xbb6e33));};AGIChannel['prototype'][_0x311c('0xb')]=function(){return this[_0x311c('0x26')](_0x311c('0x39'));};AGIChannel[_0x311c('0x25')]['setVariable']=function(_0x257006,_0xef1aef){var _0x31f687=_[_0x311c('0x3a')](_0xef1aef)||_[_0x311c('0x3b')](_0xef1aef)?_0xef1aef[_0x311c('0x3c')]():_0xef1aef;return this['sendRequest'](util[_0x311c('0x2c')](_0x311c('0x3d'),_0x257006,_0x31f687?_0x31f687[_0x311c('0x3c')]()['replace'](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x311c('0x25')][_0x311c('0x3e')]=function(_0x470a15,_0x750feb){return this['sendRequest'](util[_0x311c('0x2c')](_0x311c('0x3f'),_0x470a15,_0x750feb));};AGIChannel[_0x311c('0x25')][_0x311c('0x40')]=function(_0x35dbe1,_0x3cbd31){return this[_0x311c('0x26')](util[_0x311c('0x2c')](_0x311c('0x41'),_0x35dbe1,_0x3cbd31));};AGIChannel[_0x311c('0x25')][_0x311c('0x42')]=function(_0x2f84d4,_0x2d5dff){return this['sendRequest'](util[_0x311c('0x2c')](_0x311c('0x43'),_0x2f84d4,_0x2d5dff));};AGIChannel['prototype'][_0x311c('0x44')]=function(_0x2b7cc8,_0x285025,_0x4d6b71){_0x285025=_0x285025||this['extension'];_0x4d6b71=_0x4d6b71||0x1;this['setContext'](_0x2b7cc8);this['setExtension'](_0x285025);this['setPriority'](_0x4d6b71);return this[_0x311c('0x45')](util[_0x311c('0x2c')]('GOTO\x20%s\x20%s\x20%s',_0x2b7cc8,_0x285025,_0x4d6b71));};AGIChannel[_0x311c('0x25')]['getVariable']=function(_0x3ad049){return this[_0x311c('0x26')](util[_0x311c('0x2c')]('GET\x20VARIABLE\x20\x22%s\x22',_0x3ad049));};AGIChannel[_0x311c('0x25')]['recordFile']=function(_0x11c12a,_0x15a7f5,_0x891324,_0x117558,_0x152f73,_0x3f8347){_0x15a7f5=_0x15a7f5||_0x311c('0x46');_0x891324=_0x891324||'';_0x117558=_0x117558===undefined?-0x1:_0x117558==='-1'?-0x1:_0x117558*0x3e8;_0x152f73=_0x152f73===undefined?'':'s='+_0x152f73;_0x3f8347=_0x3f8347?_0x311c('0x47'):'';return this[_0x311c('0x26')](util[_0x311c('0x2c')](_0x311c('0x48'),_0x11c12a,_0x15a7f5,_0x891324,_0x117558,_0x3f8347,_0x152f73));};AGIChannel[_0x311c('0x25')][_0x311c('0x49')]=function(_0x234b51,_0x3e20ce){_0x3e20ce=_0x3e20ce||'';return this[_0x311c('0x26')](util[_0x311c('0x2c')](_0x311c('0x4a'),_0x234b51,_0x3e20ce));};AGIChannel[_0x311c('0x25')][_0x311c('0x4b')]=function(_0x333192){return this[_0x311c('0x30')](_0x311c('0x4c'),_0x333192);};AGIChannel[_0x311c('0x25')]['wait']=function(_0x5981d4){return this['exec']('WAIT',_0x5981d4);};AGIChannel[_0x311c('0x25')]['error']=function(_0x3e682d,_0x1848ba){this[_0x311c('0x45')](util[_0x311c('0x2c')](_0x311c('0x4d'),_0x3e682d['id'],_0x3e682d[_0x311c('0x4e')],_0x1848ba));return{'code':0x1f4,'result':'-1','extra':''};};module['exports']=AGIChannel;
\ No newline at end of file
index 8535528..f20086f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x12b8=['Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','message','exports','util'];(function(_0x27c9d7,_0x233c74){var _0x38c768=function(_0x3b7d9b){while(--_0x3b7d9b){_0x27c9d7['push'](_0x27c9d7['shift']());}};_0x38c768(++_0x233c74);}(_0x12b8,0x1c6));var _0x812b=function(_0x3f6f78,_0x222d85){_0x3f6f78=_0x3f6f78-0x0;var _0x534963=_0x12b8[_0x3f6f78];return _0x534963;};'use strict';var util=require(_0x812b('0x0'));var error={'E_AGI_UNDEFINED':'Undefined\x20error.','E_AGI_ARGUMENT_PORT':_0x812b('0x1'),'E_AGI_SERVER_ERROR':_0x812b('0x2'),'E_AGI_SERVER_CLOSE':_0x812b('0x3'),'E_AGI_SERVER_MAXCONNECTION':'[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','E_AGI_SERVER_VOICE_DISABLED':_0x812b('0x4'),'E_AGI_SOCKET_ERROR':'Socket\x20error.\x20Code:\x20%s.','E_AGI_SOCKET_CLOSE':'Socket\x20closed.','E_AGI_SOCKET_TIMEOUT':_0x812b('0x5'),'E_AGI_COMMAND_EMPTY':_0x812b('0x6'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x812b('0x7'),'E_AGI_IVR_ENTRY':_0x812b('0x8')};function AGIError(_0x1baf1a){var _0x1baf1a=_0x1baf1a||null,_0x33a800=_0x33a800||[],_0x4edf6f=0x1,_0x369328='';if(!error[_0x1baf1a]){_0x1baf1a=_0x812b('0x9');}_0x33a800[_0x812b('0xa')](error[_0x1baf1a]);while(arguments[_0x4edf6f]){_0x33a800[_0x812b('0xa')](arguments[_0x4edf6f]);_0x4edf6f++;}_0x369328=util['format']['apply'](util,_0x33a800);this[_0x812b('0xb')]=_0x369328;this['name']=_0x1baf1a;}module[_0x812b('0xc')]=AGIError;
\ No newline at end of file
+var _0x010b=['Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_UNDEFINED','push','format','apply','name','exports','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Socket\x20timeout.'];(function(_0x24542b,_0x7752de){var _0x4c7f41=function(_0x4d9c60){while(--_0x4d9c60){_0x24542b['push'](_0x24542b['shift']());}};_0x4c7f41(++_0x7752de);}(_0x010b,0x13a));var _0xb010=function(_0xdd1562,_0x4cb7a4){_0xdd1562=_0xdd1562-0x0;var _0x10920c=_0x010b[_0xdd1562];return _0x10920c;};'use strict';var util=require(_0xb010('0x0'));var error={'E_AGI_UNDEFINED':_0xb010('0x1'),'E_AGI_ARGUMENT_PORT':_0xb010('0x2'),'E_AGI_SERVER_ERROR':_0xb010('0x3'),'E_AGI_SERVER_CLOSE':_0xb010('0x4'),'E_AGI_SERVER_MAXCONNECTION':_0xb010('0x5'),'E_AGI_SERVER_VOICE_DISABLED':_0xb010('0x6'),'E_AGI_SOCKET_ERROR':_0xb010('0x7'),'E_AGI_SOCKET_CLOSE':_0xb010('0x8'),'E_AGI_SOCKET_TIMEOUT':_0xb010('0x9'),'E_AGI_COMMAND_EMPTY':_0xb010('0xa'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0xb010('0xb'),'E_AGI_IVR_ENTRY':'Missing\x20\x27ivr.entry\x27\x20menu.'};function AGIError(_0x5cdd2f){var _0x5cdd2f=_0x5cdd2f||null,_0x39e1b7=_0x39e1b7||[],_0x4eec28=0x1,_0x2d8b43='';if(!error[_0x5cdd2f]){_0x5cdd2f=_0xb010('0xc');}_0x39e1b7['push'](error[_0x5cdd2f]);while(arguments[_0x4eec28]){_0x39e1b7[_0xb010('0xd')](arguments[_0x4eec28]);_0x4eec28++;}_0x2d8b43=util[_0xb010('0xe')][_0xb010('0xf')](util,_0x39e1b7);this['message']=_0x2d8b43;this[_0xb010('0x10')]=_0x5cdd2f;}module[_0xb010('0x11')]=AGIError;
\ No newline at end of file
index 5f0594f..c677505 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x96a0=['length','no\x20edge/s\x20available','condition','split','agicommand','vswitch','target','default','menu','default\x20on\x20switch\x20not\x20found','includes','max\x20retry\x20reach','condition\x20not\x20found','exports','lodash','../../../config/logger','agi','vertices','edges','numberOfEdges','prototype','addVertex','push','size','getVertex','traverseBFS','info','no\x20vertex\x20found','stop\x20traverse'];(function(_0x5c648b,_0x19efb3){var _0x5e9732=function(_0x116c2c){while(--_0x116c2c){_0x5c648b['push'](_0x5c648b['shift']());}};_0x5e9732(++_0x19efb3);}(_0x96a0,0x1c1));var _0x096a=function(_0x103bf1,_0x1e3c63){_0x103bf1=_0x103bf1-0x0;var _0x4eb895=_0x96a0[_0x103bf1];return _0x4eb895;};'use strict';var _=require(_0x096a('0x0'));var logger=require(_0x096a('0x1'))(_0x096a('0x2'));var verticesWithRetry=['menu','getdigits','getsecretdigits'];var Graph=function(){this[_0x096a('0x3')]={};this[_0x096a('0x4')]={};this[_0x096a('0x5')]=0x0;};Graph[_0x096a('0x6')][_0x096a('0x7')]=function(_0x24597e){this[_0x096a('0x3')][_0x24597e['id']]=_0x24597e;this[_0x096a('0x4')][_0x24597e['id']]=[];};Graph[_0x096a('0x6')]['addEdge']=function(_0x2b748e,_0x4810fe,_0xaca709){this[_0x096a('0x4')][_0x2b748e][_0x096a('0x8')]({'target':_0x4810fe,'condition':_0xaca709});this[_0x096a('0x5')]+=0x1;};Graph[_0x096a('0x6')][_0x096a('0x9')]=function(){return _['size'](this[_0x096a('0x3')]);};Graph['prototype']['relations']=function(){return this[_0x096a('0x5')];};Graph['prototype'][_0x096a('0xa')]=function(_0x81f5d7){return this[_0x096a('0x3')][_0x81f5d7];};Graph[_0x096a('0x6')][_0x096a('0xb')]=function(_0x321673,_0x7a6c38){if(!this[_0x096a('0x3')][_0x321673]){return logger[_0x096a('0xc')](_0x096a('0xd'));}var _0x2c7eeb=_0x7a6c38(this[_0x096a('0x3')][_0x321673]);if(!_0x2c7eeb){return logger[_0x096a('0xc')](_0x096a('0xe'));}if(this['edges'][_0x321673][_0x096a('0xf')]===0x0){return logger[_0x096a('0xc')](_0x096a('0x10'));}for(var _0x512644=0x0,_0x5e6126=[],_0x14722f=![];_0x512644<this[_0x096a('0x4')][_0x321673]['length'];_0x512644+=0x1){if(this[_0x096a('0x4')][_0x321673][_0x512644][_0x096a('0x11')]){_0x5e6126=this[_0x096a('0x4')][_0x321673][_0x512644][_0x096a('0x11')][_0x096a('0x12')](',');for(var _0x44f118=0x0;_0x44f118<_0x5e6126[_0x096a('0xf')];_0x44f118+=0x1){if(this[_0x096a('0x3')][_0x321673][_0x096a('0x13')]===_0x096a('0x14')&&_0x5e6126[_0x44f118]==='-'){_0x14722f=this['edges'][_0x321673][_0x512644][_0x096a('0x15')];logger[_0x096a('0xc')](_0x096a('0x16'),_0x5e6126[_0x44f118],this[_0x096a('0x4')][_0x321673][_0x512644][_0x096a('0x15')]);}else if(this[_0x096a('0x3')][_0x321673][_0x096a('0x13')]===_0x096a('0x17')&&_0x5e6126[_0x44f118]==='i'){_0x14722f=this['edges'][_0x321673][_0x512644][_0x096a('0x15')];logger[_0x096a('0xc')]('invalid',_0x5e6126[_0x44f118],this[_0x096a('0x4')][_0x321673][_0x512644][_0x096a('0x15')]);}if(_0x5e6126[_0x44f118]===_0x2c7eeb){return this[_0x096a('0xb')](this[_0x096a('0x4')][_0x321673][_0x512644][_0x096a('0x15')],_0x7a6c38);}}}else{return this[_0x096a('0xb')](this['edges'][_0x321673][_0x512644][_0x096a('0x15')],_0x7a6c38);}}if(_0x5e6126['length']){if(this[_0x096a('0x3')][_0x321673][_0x096a('0x13')]===_0x096a('0x14')){if(_0x14722f){return this[_0x096a('0xb')](_0x14722f,_0x7a6c38);}return logger[_0x096a('0xc')](_0x096a('0x18'));}else if(_[_0x096a('0x19')](verticesWithRetry,this['vertices'][_0x321673][_0x096a('0x13')])){if(_0x2c7eeb==='-'){return logger[_0x096a('0xc')](_0x096a('0x1a'));}if(_0x14722f&&_0x2c7eeb!=='t'){return this[_0x096a('0xb')](_0x14722f,_0x7a6c38);}return this[_0x096a('0xb')](_0x321673,_0x7a6c38);}return logger['info'](_0x096a('0x1b'));}};module[_0x096a('0x1c')]=Graph;
\ No newline at end of file
+var _0x7b9a=['addEdge','push','size','no\x20vertex\x20found','info','stop\x20traverse','no\x20edge/s\x20available','length','condition','split','agicommand','vswitch','target','default','invalid','traverseBFS','default\x20on\x20switch\x20not\x20found','includes','max\x20retry\x20reach','lodash','../../../config/logger','menu','vertices','edges','addVertex','prototype'];(function(_0x253b5c,_0x5062ff){var _0x1ba8e6=function(_0x5407f2){while(--_0x5407f2){_0x253b5c['push'](_0x253b5c['shift']());}};_0x1ba8e6(++_0x5062ff);}(_0x7b9a,0x1e7));var _0xa7b9=function(_0x47abd7,_0x57892e){_0x47abd7=_0x47abd7-0x0;var _0x6d4d17=_0x7b9a[_0x47abd7];return _0x6d4d17;};'use strict';var _=require(_0xa7b9('0x0'));var logger=require(_0xa7b9('0x1'))('agi');var verticesWithRetry=[_0xa7b9('0x2'),'getdigits','getsecretdigits'];var Graph=function(){this[_0xa7b9('0x3')]={};this[_0xa7b9('0x4')]={};this['numberOfEdges']=0x0;};Graph['prototype'][_0xa7b9('0x5')]=function(_0x38275e){this[_0xa7b9('0x3')][_0x38275e['id']]=_0x38275e;this[_0xa7b9('0x4')][_0x38275e['id']]=[];};Graph[_0xa7b9('0x6')][_0xa7b9('0x7')]=function(_0x1bda0f,_0x51af29,_0x2e17cc){this['edges'][_0x1bda0f][_0xa7b9('0x8')]({'target':_0x51af29,'condition':_0x2e17cc});this['numberOfEdges']+=0x1;};Graph['prototype']['size']=function(){return _[_0xa7b9('0x9')](this[_0xa7b9('0x3')]);};Graph[_0xa7b9('0x6')]['relations']=function(){return this['numberOfEdges'];};Graph[_0xa7b9('0x6')]['getVertex']=function(_0x472ecd){return this[_0xa7b9('0x3')][_0x472ecd];};Graph[_0xa7b9('0x6')]['traverseBFS']=function(_0x395bf4,_0x18f9d0){if(!this[_0xa7b9('0x3')][_0x395bf4]){return logger['info'](_0xa7b9('0xa'));}var _0x30051b=_0x18f9d0(this[_0xa7b9('0x3')][_0x395bf4]);if(!_0x30051b){return logger[_0xa7b9('0xb')](_0xa7b9('0xc'));}if(this[_0xa7b9('0x4')][_0x395bf4]['length']===0x0){return logger[_0xa7b9('0xb')](_0xa7b9('0xd'));}for(var _0x53723a=0x0,_0x2e8727=[],_0x14f30d=![];_0x53723a<this[_0xa7b9('0x4')][_0x395bf4][_0xa7b9('0xe')];_0x53723a+=0x1){if(this[_0xa7b9('0x4')][_0x395bf4][_0x53723a][_0xa7b9('0xf')]){_0x2e8727=this[_0xa7b9('0x4')][_0x395bf4][_0x53723a][_0xa7b9('0xf')][_0xa7b9('0x10')](',');for(var _0x155873=0x0;_0x155873<_0x2e8727[_0xa7b9('0xe')];_0x155873+=0x1){if(this[_0xa7b9('0x3')][_0x395bf4][_0xa7b9('0x11')]===_0xa7b9('0x12')&&_0x2e8727[_0x155873]==='-'){_0x14f30d=this[_0xa7b9('0x4')][_0x395bf4][_0x53723a][_0xa7b9('0x13')];logger[_0xa7b9('0xb')](_0xa7b9('0x14'),_0x2e8727[_0x155873],this[_0xa7b9('0x4')][_0x395bf4][_0x53723a][_0xa7b9('0x13')]);}else if(this[_0xa7b9('0x3')][_0x395bf4]['agicommand']===_0xa7b9('0x2')&&_0x2e8727[_0x155873]==='i'){_0x14f30d=this[_0xa7b9('0x4')][_0x395bf4][_0x53723a][_0xa7b9('0x13')];logger[_0xa7b9('0xb')](_0xa7b9('0x15'),_0x2e8727[_0x155873],this[_0xa7b9('0x4')][_0x395bf4][_0x53723a][_0xa7b9('0x13')]);}if(_0x2e8727[_0x155873]===_0x30051b){return this[_0xa7b9('0x16')](this[_0xa7b9('0x4')][_0x395bf4][_0x53723a][_0xa7b9('0x13')],_0x18f9d0);}}}else{return this[_0xa7b9('0x16')](this[_0xa7b9('0x4')][_0x395bf4][_0x53723a]['target'],_0x18f9d0);}}if(_0x2e8727[_0xa7b9('0xe')]){if(this['vertices'][_0x395bf4][_0xa7b9('0x11')]===_0xa7b9('0x12')){if(_0x14f30d){return this[_0xa7b9('0x16')](_0x14f30d,_0x18f9d0);}return logger['info'](_0xa7b9('0x17'));}else if(_[_0xa7b9('0x18')](verticesWithRetry,this[_0xa7b9('0x3')][_0x395bf4][_0xa7b9('0x11')])){if(_0x30051b==='-'){return logger[_0xa7b9('0xb')](_0xa7b9('0x19'));}if(_0x14f30d&&_0x30051b!=='t'){return this[_0xa7b9('0x16')](_0x14f30d,_0x18f9d0);}return this[_0xa7b9('0x16')](_0x395bf4,_0x18f9d0);}return logger['info']('condition\x20not\x20found');}};module['exports']=Graph;
\ No newline at end of file
index 6a6eaf0..2700f9b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3385=['[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','hangup','sync','production','start','root','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','result','isUndefined','toString','response','agicommand\x20not\x20found','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','continueAt','Project\x20%s\x20not\x20published','Project\x20%s\x20not\x20found','voice','callysquare','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','./server','listening','connection','xml2json','syncho','moment','agi','../../config/license/util','./rpc','./mailRpc','./vertices','defaults','127.0.0.1','nextTick','error','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','info','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','message','format','[%s]\x20%s','name','[ERROR]\x20%s','stack','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','callerid','dnid','arg_1','calleridname','uniqueid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','toJson','mxGraphModel','agicommand','hasOwnProperty','retry','maxRetry','omit','mxCell','isArray','length','source','target','addEdge','value','getSquareProject','createSquareReport','then','indexOf','agi_','substring','inspect','debug','variables','stringify'];(function(_0x47a349,_0x4699d9){var _0x18ab75=function(_0x210796){while(--_0x210796){_0x47a349['push'](_0x47a349['shift']());}};_0x18ab75(++_0x4699d9);}(_0x3385,0x135));var _0x5338=function(_0x26da89,_0x264785){_0x26da89=_0x26da89-0x0;var _0xc95b7b=_0x3385[_0x26da89];return _0xc95b7b;};'use strict';var parser=require(_0x5338('0x0'));var _=require('lodash');var syncho=require(_0x5338('0x1'));var util=require('util');var moment=require(_0x5338('0x2'));var config=require('../../config/environment');var logger=require('../../config/logger')(_0x5338('0x3'));var utilLicense=require(_0x5338('0x4'));var rpc=require(_0x5338('0x5'));var mailRpc=require(_0x5338('0x6'));var Graph=require('./graph');var Vertices=require(_0x5338('0x7'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0x5338('0x3')]=_[_0x5338('0x8')](config[_0x5338('0x3')],{'ip':_0x5338('0x9'),'port':0x11dd});function connectionHandler(_0x7a64fa){process[_0x5338('0xa')](function(){syncho(function(){try{setChannelVariables(_0x7a64fa);agiHandler(_0x7a64fa);}catch(_0x272e5f){logger[_0x5338('0xb')](_0x272e5f['stack']);}});});}function listeningHandler(){console[_0x5338('0xc')](_0x5338('0xd'),config[_0x5338('0x3')][_0x5338('0xe')]);logger[_0x5338('0xf')](util['format'](_0x5338('0x10'),config['agi']['ip'],config[_0x5338('0x3')][_0x5338('0xe')]));}function errorHandler(_0x5d1a23){if(_0x5d1a23&&_0x5d1a23['name']&&_0x5d1a23[_0x5338('0x11')]){logger[_0x5338('0xb')](util[_0x5338('0x12')](_0x5338('0x13'),_0x5d1a23[_0x5338('0x14')],_0x5d1a23['message']));}else{logger[_0x5338('0xb')](util['format'](_0x5338('0x15'),_0x5d1a23[_0x5338('0x16')]));}}function closeHandler(){logger[_0x5338('0xf')](util[_0x5338('0x12')](_0x5338('0x17'),this['arg_1'],this['calleridname'],this[_0x5338('0x18')],this[_0x5338('0x19')],this['uniqueid']));try{createSquareReport(this);}catch(_0x3026f){logger[_0x5338('0xb')](_0x3026f['stack']);}}function timeoutHandler(){logger['info'](util[_0x5338('0x12')]('[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x5338('0x1a')],this[_0x5338('0x1b')],this[_0x5338('0x18')],this['dnid'],this[_0x5338('0x1c')]));}function hangupHandler(){logger['info'](util[_0x5338('0x12')](_0x5338('0x1d'),this[_0x5338('0x1a')],this[_0x5338('0x1b')],this[_0x5338('0x18')],this[_0x5338('0x19')],this[_0x5338('0x1c')]));this[_0x5338('0x1e')]=!![];}function getRoot(_0x2d873a){return parser[_0x5338('0x1f')](_0x2d873a,{'object':!![]})[_0x5338('0x20')]['root'];}function addVertex(_0x2392b2,_0x4c6173,_0x6380a4){_0x4c6173[_0x5338('0x21')]=_0x6380a4;if(_0x4c6173[_0x5338('0x22')](_0x5338('0x23'))){_0x4c6173[_0x5338('0x24')]=parseInt(_0x4c6173['retry'],0xa);}_0x2392b2['addVertex'](_[_0x5338('0x25')](_0x4c6173,_0x5338('0x26')));}function initGraph(_0x4547d7,_0x5a4f73){var _0x262e42=new Graph();for(var _0x3986c3 in _0x4547d7){if(_0x4547d7[_0x5338('0x22')](_0x3986c3)){if(_[_0x5338('0x27')](_0x4547d7[_0x3986c3])){for(var _0x376fb0=0x0;_0x376fb0<_0x4547d7[_0x3986c3][_0x5338('0x28')];_0x376fb0+=0x1){addVertex(_0x262e42,_0x4547d7[_0x3986c3][_0x376fb0],_0x3986c3);}}else{addVertex(_0x262e42,_0x4547d7[_0x3986c3],_0x3986c3);}}}for(var _0x11b9b2=0x0;_0x11b9b2<_0x5a4f73[_0x5338('0x28')];_0x11b9b2+=0x1){if(_0x5a4f73[_0x11b9b2][_0x5338('0x29')]&&_0x5a4f73[_0x11b9b2][_0x5338('0x2a')]){_0x262e42[_0x5338('0x2b')](_0x5a4f73[_0x11b9b2][_0x5338('0x29')],_0x5a4f73[_0x11b9b2][_0x5338('0x2a')],_0x5a4f73[_0x11b9b2][_0x5338('0x2c')]);}}return _0x262e42;}function getSquareProject(_0x2de613,_0x31bc90){rpc[_0x5338('0x2d')](_0x2de613)['then'](function(_0x456f37){_0x31bc90(null,_0x456f37);})['catch'](function(_0x501654){_0x31bc90(null,_0x501654);});}function createSquareReport(_0x460ebb,_0x41bae6){rpc[_0x5338('0x2e')](_0x460ebb)[_0x5338('0x2f')](function(_0x1e22b2){if(_0x41bae6){_0x41bae6(null,_0x1e22b2);}})['catch'](function(_0x4d1d01){if(_0x41bae6){_0x41bae6(null,_0x4d1d01);}});}function setChannelVariables(_0x5d8520){for(var _0x5d3308 in _0x5d8520){if(_0x5d8520['hasOwnProperty'](_0x5d3308)){if(_0x5d3308[_0x5338('0x30')](_0x5338('0x31'))===0x0){_0x5d8520[_0x5d3308[_0x5338('0x32')](0x4)]=_0x5d8520[_0x5d3308];delete _0x5d8520[_0x5d3308];}}}}function getLogFromObject(_0x22090d){return util[_0x5338('0x33')](_0x22090d,{'showHidden':![],'depth':null});}function agiHandler(_0x4a5071){var _0x3410f3,_0x1d86c8,_0x43d8de,_0x28c454,_0x2fd8f8;logger[_0x5338('0x34')](_0x5338('0x35'),JSON[_0x5338('0x36')](_0x4a5071,null,0x2));logger[_0x5338('0xf')](util[_0x5338('0x12')](_0x5338('0x37'),_0x4a5071[_0x5338('0x1a')],_0x4a5071['calleridname'],_0x4a5071[_0x5338('0x18')],_0x4a5071[_0x5338('0x19')],_0x4a5071[_0x5338('0x1c')]));_0x4a5071['on'](_0x5338('0xb'),errorHandler);_0x4a5071['on'](_0x5338('0x38'),closeHandler);_0x4a5071['on']('timeout',timeoutHandler);_0x4a5071[_0x5338('0x1e')]=![];_0x4a5071['on'](_0x5338('0x39'),hangupHandler);var _0x101a6b=getSquareProject[_0x5338('0x3a')](null,_0x4a5071[_0x5338('0x1a')]);if(_0x101a6b){if(_0x101a6b[_0x5338('0x3b')]){_0x3410f3=getRoot(_0x101a6b[_0x5338('0x3b')]);if(_0x3410f3&&_0x3410f3[_0x5338('0x3c')]){logger[_0x5338('0x34')](_0x5338('0x3d'),JSON['stringify'](_0x3410f3,null,0x2));_0x4a5071['joinAt']=moment()[_0x5338('0x12')](_0x5338('0x3e'));_0x1d86c8=initGraph(_[_0x5338('0x25')](_0x3410f3,'mxCell'),_0x3410f3[_0x5338('0x26')]);_0x43d8de=new Vertices(_0x4a5071,rpc,mailRpc);logger[_0x5338('0xf')](util['format'](_0x5338('0x3f'),_0x4a5071[_0x5338('0x1a')],_0x4a5071[_0x5338('0x1b')],_0x4a5071[_0x5338('0x18')],_0x4a5071[_0x5338('0x19')],_0x4a5071[_0x5338('0x1c')]));_0x1d86c8[_0x5338('0x40')](_0x3410f3[_0x5338('0x3c')]['id'],function(_0x2cb2c0){try{_0x2cb2c0=_0x43d8de[_0x5338('0x41')](_0x2cb2c0);logger['debug'](_0x5338('0x42'),JSON[_0x5338('0x36')](_0x2cb2c0,null,0x2));if(_0x2cb2c0[_0x5338('0x21')]===_0x5338('0x43')){logger[_0x5338('0xf')](_0x5338('0x44'));_0x4a5071[_0x5338('0x45')]=_0x2cb2c0[_0x5338('0x45')]||_0x4a5071['context'];_0x4a5071[_0x5338('0x46')]=_0x2cb2c0[_0x5338('0x46')];_0x4a5071[_0x5338('0x47')]=_0x2cb2c0['priority']?_0x2cb2c0[_0x5338('0x47')]-0x1:0x1;return null;}else if(_0x2cb2c0&&_0x43d8de[_0x2cb2c0['agicommand']]){_0x2fd8f8=_0x43d8de[_0x2cb2c0['agicommand']](_0x2cb2c0);logger[_0x5338('0xf')]('response',JSON[_0x5338('0x36')](_0x2fd8f8,null,0x2));if(_0x2fd8f8&&_0x2fd8f8['code']===AGI_CODE_SUCCESS&&_0x2fd8f8[_0x5338('0x48')]!==AGI_RESULT_ERROR&&!_0x4a5071['evtHangup']){logger[_0x5338('0x34')]('response',getLogFromObject(_0x2fd8f8));return _[_0x5338('0x49')](_0x2fd8f8['result'])?null:_0x2fd8f8[_0x5338('0x48')][_0x5338('0x4a')]();}else{logger[_0x5338('0xb')](_0x5338('0x4b'),getLogFromObject(_0x2fd8f8));return null;}}else{logger[_0x5338('0xb')](_0x5338('0x4c'));return null;}}catch(_0x54ce8b){logger[_0x5338('0xb')](_0x54ce8b[_0x5338('0x16')]);return null;}});if(_0x3410f3[_0x5338('0x4d')]){logger[_0x5338('0xf')](util['format'](_0x5338('0x4e'),_0x4a5071['arg_1'],_0x4a5071[_0x5338('0x1b')],_0x4a5071[_0x5338('0x18')],_0x4a5071[_0x5338('0x19')],_0x4a5071['uniqueid']));_0x1d86c8['traverseBFS'](_0x3410f3[_0x5338('0x4d')]['id'],function(_0x15f6fb){try{_0x15f6fb=_0x43d8de[_0x5338('0x41')](_0x15f6fb);logger[_0x5338('0x34')](_0x5338('0x42'),JSON[_0x5338('0x36')](_0x15f6fb,null,0x2));if(_0x15f6fb&&_0x43d8de[_0x15f6fb[_0x5338('0x21')]]){_0x2fd8f8=_0x43d8de[_0x15f6fb[_0x5338('0x21')]](_0x15f6fb);if(_0x2fd8f8){logger['debug'](_0x5338('0x4b'),getLogFromObject(_0x2fd8f8));return _['isUndefined'](_0x2fd8f8[_0x5338('0x48')])?null:_0x2fd8f8['result'][_0x5338('0x4a')]();}else{logger[_0x5338('0xb')]('response',getLogFromObject(_0x2fd8f8));return null;}}else{logger[_0x5338('0xb')](_0x5338('0x4c'));return null;}}catch(_0x155f1f){logger[_0x5338('0xb')](_0x155f1f[_0x5338('0x16')]);return null;}});}logger[_0x5338('0xf')](util[_0x5338('0x12')](_0x5338('0x4f'),_0x4a5071[_0x5338('0x1a')],_0x4a5071[_0x5338('0x1b')],_0x4a5071['callerid'],_0x4a5071[_0x5338('0x19')],_0x4a5071['uniqueid']));logger[_0x5338('0xf')](util[_0x5338('0x12')]('[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s',_0x4a5071[_0x5338('0x45')],_0x4a5071[_0x5338('0x46')],parseInt(_0x4a5071[_0x5338('0x47')],0xa)+0x1));_0x4a5071[_0x5338('0x50')](_0x4a5071['context'],_0x4a5071[_0x5338('0x46')],parseInt(_0x4a5071[_0x5338('0x47')],0xa)+0x1);_0x4a5071[_0x5338('0x38')]();}}else{logger[_0x5338('0xb')](util[_0x5338('0x12')](_0x5338('0x51'),_0x4a5071['arg_1']));_0x4a5071[_0x5338('0x50')](_0x4a5071[_0x5338('0x45')],_0x4a5071[_0x5338('0x46')],parseInt(_0x4a5071[_0x5338('0x47')],0xa)+0x1);_0x4a5071[_0x5338('0x38')]();}}else{logger[_0x5338('0xb')](util[_0x5338('0x12')](_0x5338('0x52'),_0x4a5071[_0x5338('0x1a')]));_0x4a5071[_0x5338('0x50')](_0x4a5071[_0x5338('0x45')],_0x4a5071[_0x5338('0x46')],parseInt(_0x4a5071[_0x5338('0x47')],0xa)+0x1);_0x4a5071[_0x5338('0x38')]();}}function main(){var _0x5f4203;return utilLicense['getLicense']()[_0x5338('0x2f')](function(_0x39cf5c){if(_0x39cf5c){if(_0x39cf5c[_0x5338('0x53')]){if(_0x39cf5c[_0x5338('0x54')]&&_0x39cf5c['callysquare']>0x0){logger[_0x5338('0xf')](util[_0x5338('0x12')]('[LICENSE]\x20CHANNELS:\x20%s',_0x39cf5c[_0x5338('0x54')]));_0x5f4203=_0x39cf5c[_0x5338('0x54')];}else{logger[_0x5338('0xf')](_0x5338('0x55'));}}else{logger['info'](_0x5338('0x56'));_0x5f4203=-0x1;}}})['catch'](function(_0x12d54f){logger['error'](_0x5338('0x57'),_0x12d54f[_0x5338('0x16')]);})[_0x5338('0x4d')](function(){var _0x2ca13d=require(_0x5338('0x58'))(config[_0x5338('0x3')][_0x5338('0xe')],config[_0x5338('0x3')]['ip'],_0x5f4203);_0x2ca13d['on'](_0x5338('0xb'),errorHandler);_0x2ca13d['on'](_0x5338('0x59'),listeningHandler);_0x2ca13d['on'](_0x5338('0x5a'),connectionHandler);_0x2ca13d['on'](_0x5338('0x38'),closeHandler);});}main();
\ No newline at end of file
+var _0xa18d=['log','port','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','[%s]\x20%s','error','[ERROR]\x20%s','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','dnid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','mxGraphModel','agicommand','hasOwnProperty','retry','maxRetry','omit','isArray','length','source','target','addEdge','value','getSquareProject','then','catch','createSquareReport','indexOf','agi_','substring','inspect','variables','stringify','timeout','hangup','sync','production','start','debug','YYYY-MM-DD\x20HH:mm:ss','mxCell','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','clear','vertex','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','result','isUndefined','agicommand\x20not\x20found','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','toString','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','close','Project\x20%s\x20not\x20published','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','connection','xml2json','lodash','syncho','moment','../../config/environment','../../config/logger','agi','../../config/license/util','./rpc','./graph','./vertices','defaults','127.0.0.1','nextTick','stack'];(function(_0x36ed48,_0x1ee0d4){var _0x51c63a=function(_0x2d0a40){while(--_0x2d0a40){_0x36ed48['push'](_0x36ed48['shift']());}};_0x51c63a(++_0x1ee0d4);}(_0xa18d,0x1b8));var _0xda18=function(_0x244118,_0x3b2b04){_0x244118=_0x244118-0x0;var _0x27a6aa=_0xa18d[_0x244118];return _0x27a6aa;};'use strict';var parser=require(_0xda18('0x0'));var _=require(_0xda18('0x1'));var syncho=require(_0xda18('0x2'));var util=require('util');var moment=require(_0xda18('0x3'));var config=require(_0xda18('0x4'));var logger=require(_0xda18('0x5'))(_0xda18('0x6'));var utilLicense=require(_0xda18('0x7'));var rpc=require(_0xda18('0x8'));var mailRpc=require('./mailRpc');var Graph=require(_0xda18('0x9'));var Vertices=require(_0xda18('0xa'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0xda18('0x6')]=_[_0xda18('0xb')](config['agi'],{'ip':_0xda18('0xc'),'port':0x11dd});function connectionHandler(_0x2be09a){process[_0xda18('0xd')](function(){syncho(function(){try{setChannelVariables(_0x2be09a);agiHandler(_0x2be09a);}catch(_0x31be54){logger['error'](_0x31be54[_0xda18('0xe')]);}});});}function listeningHandler(){console[_0xda18('0xf')]('Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!',config[_0xda18('0x6')][_0xda18('0x10')]);logger[_0xda18('0x11')](util[_0xda18('0x12')](_0xda18('0x13'),config[_0xda18('0x6')]['ip'],config[_0xda18('0x6')][_0xda18('0x10')]));}function errorHandler(_0x509aaf){if(_0x509aaf&&_0x509aaf[_0xda18('0x14')]&&_0x509aaf['message']){logger['error'](util[_0xda18('0x12')](_0xda18('0x15'),_0x509aaf[_0xda18('0x14')],_0x509aaf['message']));}else{logger[_0xda18('0x16')](util[_0xda18('0x12')](_0xda18('0x17'),_0x509aaf[_0xda18('0xe')]));}}function closeHandler(){logger[_0xda18('0x11')](util['format'](_0xda18('0x18'),this[_0xda18('0x19')],this[_0xda18('0x1a')],this[_0xda18('0x1b')],this[_0xda18('0x1c')],this[_0xda18('0x1d')]));try{createSquareReport(this);}catch(_0x51c376){logger[_0xda18('0x16')](_0x51c376[_0xda18('0xe')]);}}function timeoutHandler(){logger[_0xda18('0x11')](util[_0xda18('0x12')](_0xda18('0x1e'),this[_0xda18('0x19')],this['calleridname'],this['callerid'],this['dnid'],this[_0xda18('0x1d')]));}function hangupHandler(){logger[_0xda18('0x11')](util[_0xda18('0x12')](_0xda18('0x1f'),this[_0xda18('0x19')],this['calleridname'],this['callerid'],this[_0xda18('0x1c')],this[_0xda18('0x1d')]));this[_0xda18('0x20')]=!![];}function getRoot(_0x12defb){return parser['toJson'](_0x12defb,{'object':!![]})[_0xda18('0x21')]['root'];}function addVertex(_0x474616,_0x59f170,_0x568edc){_0x59f170[_0xda18('0x22')]=_0x568edc;if(_0x59f170[_0xda18('0x23')](_0xda18('0x24'))){_0x59f170[_0xda18('0x25')]=parseInt(_0x59f170[_0xda18('0x24')],0xa);}_0x474616['addVertex'](_[_0xda18('0x26')](_0x59f170,'mxCell'));}function initGraph(_0x5feff8,_0x28d602){var _0x1ee843=new Graph();for(var _0x360709 in _0x5feff8){if(_0x5feff8['hasOwnProperty'](_0x360709)){if(_[_0xda18('0x27')](_0x5feff8[_0x360709])){for(var _0x403183=0x0;_0x403183<_0x5feff8[_0x360709][_0xda18('0x28')];_0x403183+=0x1){addVertex(_0x1ee843,_0x5feff8[_0x360709][_0x403183],_0x360709);}}else{addVertex(_0x1ee843,_0x5feff8[_0x360709],_0x360709);}}}for(var _0x252227=0x0;_0x252227<_0x28d602['length'];_0x252227+=0x1){if(_0x28d602[_0x252227][_0xda18('0x29')]&&_0x28d602[_0x252227][_0xda18('0x2a')]){_0x1ee843[_0xda18('0x2b')](_0x28d602[_0x252227]['source'],_0x28d602[_0x252227][_0xda18('0x2a')],_0x28d602[_0x252227][_0xda18('0x2c')]);}}return _0x1ee843;}function getSquareProject(_0x24fabd,_0xc25b56){rpc[_0xda18('0x2d')](_0x24fabd)[_0xda18('0x2e')](function(_0x12490a){_0xc25b56(null,_0x12490a);})[_0xda18('0x2f')](function(_0x4f500a){_0xc25b56(null,_0x4f500a);});}function createSquareReport(_0x41f31f,_0x55ed2d){rpc[_0xda18('0x30')](_0x41f31f)['then'](function(_0x2f57c8){if(_0x55ed2d){_0x55ed2d(null,_0x2f57c8);}})['catch'](function(_0x6b3d82){if(_0x55ed2d){_0x55ed2d(null,_0x6b3d82);}});}function setChannelVariables(_0x443488){for(var _0x34027d in _0x443488){if(_0x443488['hasOwnProperty'](_0x34027d)){if(_0x34027d[_0xda18('0x31')](_0xda18('0x32'))===0x0){_0x443488[_0x34027d[_0xda18('0x33')](0x4)]=_0x443488[_0x34027d];delete _0x443488[_0x34027d];}}}}function getLogFromObject(_0x449903){return util[_0xda18('0x34')](_0x449903,{'showHidden':![],'depth':null});}function agiHandler(_0x391f82){var _0x54ae82,_0x4778e4,_0x44eb37,_0x99d6cd,_0x2ecf6f;logger['debug'](_0xda18('0x35'),JSON[_0xda18('0x36')](_0x391f82,null,0x2));logger[_0xda18('0x11')](util[_0xda18('0x12')]('[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x391f82[_0xda18('0x19')],_0x391f82[_0xda18('0x1a')],_0x391f82[_0xda18('0x1b')],_0x391f82[_0xda18('0x1c')],_0x391f82[_0xda18('0x1d')]));_0x391f82['on'](_0xda18('0x16'),errorHandler);_0x391f82['on']('close',closeHandler);_0x391f82['on'](_0xda18('0x37'),timeoutHandler);_0x391f82[_0xda18('0x20')]=![];_0x391f82['on'](_0xda18('0x38'),hangupHandler);var _0x5acda0=getSquareProject[_0xda18('0x39')](null,_0x391f82[_0xda18('0x19')]);if(_0x5acda0){if(_0x5acda0[_0xda18('0x3a')]){_0x54ae82=getRoot(_0x5acda0['production']);if(_0x54ae82&&_0x54ae82[_0xda18('0x3b')]){logger[_0xda18('0x3c')]('root',JSON[_0xda18('0x36')](_0x54ae82,null,0x2));_0x391f82['joinAt']=moment()[_0xda18('0x12')](_0xda18('0x3d'));_0x4778e4=initGraph(_['omit'](_0x54ae82,_0xda18('0x3e')),_0x54ae82['mxCell']);_0x44eb37=new Vertices(_0x391f82,rpc,mailRpc);logger['info'](util[_0xda18('0x12')](_0xda18('0x3f'),_0x391f82[_0xda18('0x19')],_0x391f82['calleridname'],_0x391f82[_0xda18('0x1b')],_0x391f82[_0xda18('0x1c')],_0x391f82[_0xda18('0x1d')]));_0x4778e4[_0xda18('0x40')](_0x54ae82[_0xda18('0x3b')]['id'],function(_0x4659ca){try{_0x4659ca=_0x44eb37[_0xda18('0x41')](_0x4659ca);logger[_0xda18('0x3c')](_0xda18('0x42'),JSON[_0xda18('0x36')](_0x4659ca,null,0x2));if(_0x4659ca[_0xda18('0x22')]===_0xda18('0x43')){logger['info'](_0xda18('0x44'));_0x391f82['context']=_0x4659ca[_0xda18('0x45')]||_0x391f82[_0xda18('0x45')];_0x391f82[_0xda18('0x46')]=_0x4659ca[_0xda18('0x46')];_0x391f82[_0xda18('0x47')]=_0x4659ca['priority']?_0x4659ca[_0xda18('0x47')]-0x1:0x1;return null;}else if(_0x4659ca&&_0x44eb37[_0x4659ca[_0xda18('0x22')]]){_0x2ecf6f=_0x44eb37[_0x4659ca[_0xda18('0x22')]](_0x4659ca);logger[_0xda18('0x11')](_0xda18('0x48'),JSON[_0xda18('0x36')](_0x2ecf6f,null,0x2));if(_0x2ecf6f&&_0x2ecf6f['code']===AGI_CODE_SUCCESS&&_0x2ecf6f[_0xda18('0x49')]!==AGI_RESULT_ERROR&&!_0x391f82[_0xda18('0x20')]){logger[_0xda18('0x3c')]('response',getLogFromObject(_0x2ecf6f));return _[_0xda18('0x4a')](_0x2ecf6f[_0xda18('0x49')])?null:_0x2ecf6f[_0xda18('0x49')]['toString']();}else{logger[_0xda18('0x16')]('response',getLogFromObject(_0x2ecf6f));return null;}}else{logger['error'](_0xda18('0x4b'));return null;}}catch(_0xf2127b){logger['error'](_0xf2127b[_0xda18('0xe')]);return null;}});if(_0x54ae82[_0xda18('0x4c')]){logger['info'](util['format'](_0xda18('0x4d'),_0x391f82[_0xda18('0x19')],_0x391f82[_0xda18('0x1a')],_0x391f82[_0xda18('0x1b')],_0x391f82[_0xda18('0x1c')],_0x391f82[_0xda18('0x1d')]));_0x4778e4[_0xda18('0x40')](_0x54ae82[_0xda18('0x4c')]['id'],function(_0x2c327a){try{_0x2c327a=_0x44eb37[_0xda18('0x41')](_0x2c327a);logger[_0xda18('0x3c')]('vertex',JSON[_0xda18('0x36')](_0x2c327a,null,0x2));if(_0x2c327a&&_0x44eb37[_0x2c327a[_0xda18('0x22')]]){_0x2ecf6f=_0x44eb37[_0x2c327a[_0xda18('0x22')]](_0x2c327a);if(_0x2ecf6f){logger[_0xda18('0x3c')](_0xda18('0x48'),getLogFromObject(_0x2ecf6f));return _[_0xda18('0x4a')](_0x2ecf6f[_0xda18('0x49')])?null:_0x2ecf6f[_0xda18('0x49')][_0xda18('0x4e')]();}else{logger[_0xda18('0x16')](_0xda18('0x48'),getLogFromObject(_0x2ecf6f));return null;}}else{logger[_0xda18('0x16')](_0xda18('0x4b'));return null;}}catch(_0x17e878){logger[_0xda18('0x16')](_0x17e878['stack']);return null;}});}logger[_0xda18('0x11')](util[_0xda18('0x12')](_0xda18('0x4f'),_0x391f82[_0xda18('0x19')],_0x391f82[_0xda18('0x1a')],_0x391f82['callerid'],_0x391f82[_0xda18('0x1c')],_0x391f82[_0xda18('0x1d')]));logger[_0xda18('0x11')](util[_0xda18('0x12')](_0xda18('0x50'),_0x391f82[_0xda18('0x45')],_0x391f82['extension'],parseInt(_0x391f82['priority'],0xa)+0x1));_0x391f82[_0xda18('0x51')](_0x391f82[_0xda18('0x45')],_0x391f82[_0xda18('0x46')],parseInt(_0x391f82['priority'],0xa)+0x1);_0x391f82[_0xda18('0x52')]();}}else{logger[_0xda18('0x16')](util[_0xda18('0x12')](_0xda18('0x53'),_0x391f82[_0xda18('0x19')]));_0x391f82[_0xda18('0x51')](_0x391f82[_0xda18('0x45')],_0x391f82[_0xda18('0x46')],parseInt(_0x391f82[_0xda18('0x47')],0xa)+0x1);_0x391f82[_0xda18('0x52')]();}}else{logger['error'](util[_0xda18('0x12')]('Project\x20%s\x20not\x20found',_0x391f82[_0xda18('0x19')]));_0x391f82[_0xda18('0x51')](_0x391f82[_0xda18('0x45')],_0x391f82['extension'],parseInt(_0x391f82['priority'],0xa)+0x1);_0x391f82['close']();}}function main(){var _0x55c288;return utilLicense[_0xda18('0x54')]()[_0xda18('0x2e')](function(_0x14f365){if(_0x14f365){if(_0x14f365[_0xda18('0x55')]){if(_0x14f365[_0xda18('0x56')]&&_0x14f365[_0xda18('0x56')]>0x0){logger['info'](util[_0xda18('0x12')]('[LICENSE]\x20CHANNELS:\x20%s',_0x14f365['callysquare']));_0x55c288=_0x14f365['callysquare'];}else{logger[_0xda18('0x11')](_0xda18('0x57'));}}else{logger[_0xda18('0x11')](_0xda18('0x58'));_0x55c288=-0x1;}}})['catch'](function(_0x5d5991){logger[_0xda18('0x16')](_0xda18('0x59'),_0x5d5991[_0xda18('0xe')]);})[_0xda18('0x4c')](function(){var _0x300ac1=require('./server')(config[_0xda18('0x6')][_0xda18('0x10')],config['agi']['ip'],_0x55c288);_0x300ac1['on'](_0xda18('0x16'),errorHandler);_0x300ac1['on']('listening',listeningHandler);_0x300ac1['on'](_0xda18('0x5a'),connectionHandler);_0x300ac1['on'](_0xda18('0x52'),closeHandler);});}main();
\ No newline at end of file
index 4640565..0c72214 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x956d=['then','error','message','result','SendMail','client','http'];(function(_0x11996d,_0x1b4470){var _0x2ebe8d=function(_0x2bed2b){while(--_0x2bed2b){_0x11996d['push'](_0x11996d['shift']());}};_0x2ebe8d(++_0x1b4470);}(_0x956d,0x1c5));var _0xd956=function(_0x398d1f,_0x234b00){_0x398d1f=_0x398d1f-0x0;var _0x5e6ff5=_0x956d[_0x398d1f];return _0x5e6ff5;};'use strict';var BPromise=require('bluebird');var jayson=require('jayson/promise');var client=jayson[_0xd956('0x0')][_0xd956('0x1')]({'port':0x232b});function request(_0x3ac8f7,_0x35b1f1){return new BPromise(function(_0x5f396a,_0x165594){return client['request'](_0x3ac8f7,_0x35b1f1)[_0xd956('0x2')](function(_0x55af5e){if(_0x55af5e['error']){return _0x165594(_0x55af5e[_0xd956('0x3')][_0xd956('0x4')]);}else{return _0x5f396a(_0x55af5e[_0xd956('0x5')]);}})['catch'](function(_0x5bc08d){return _0x165594(_0x5bc08d);});});}exports['sendMailMessage']=function(_0x1fbc13,_0x3c6c63){return request(_0xd956('0x6'),{'account':_0x1fbc13,'message':_0x3c6c63});};
\ No newline at end of file
+var _0xb966=['http','request','then','error','message','result','catch','sendMailMessage','jayson/promise','client'];(function(_0x5787f5,_0x880cdd){var _0x3c69b6=function(_0xdaac49){while(--_0xdaac49){_0x5787f5['push'](_0x5787f5['shift']());}};_0x3c69b6(++_0x880cdd);}(_0xb966,0x12a));var _0x6b96=function(_0x371d88,_0x4acbb9){_0x371d88=_0x371d88-0x0;var _0x3c36b4=_0xb966[_0x371d88];return _0x3c36b4;};'use strict';var BPromise=require('bluebird');var jayson=require(_0x6b96('0x0'));var client=jayson[_0x6b96('0x1')][_0x6b96('0x2')]({'port':0x232b});function request(_0x1f98f1,_0x1e97e8){return new BPromise(function(_0x5a0efa,_0x117822){return client[_0x6b96('0x3')](_0x1f98f1,_0x1e97e8)[_0x6b96('0x4')](function(_0x211e59){if(_0x211e59[_0x6b96('0x5')]){return _0x117822(_0x211e59[_0x6b96('0x5')][_0x6b96('0x6')]);}else{return _0x5a0efa(_0x211e59[_0x6b96('0x7')]);}})[_0x6b96('0x8')](function(_0x2d6495){return _0x117822(_0x2d6495);});});}exports[_0x6b96('0x9')]=function(_0x139192,_0x174f6a){return request('SendMail',{'account':_0x139192,'message':_0x174f6a});};
\ No newline at end of file
index 45c1829..b8eba6b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x073c=['length','split','indexOf','slice','trim','emit','headers','line','stream','Transform','call','_localBuffer','_inBody','prototype','toString','substring'];(function(_0x451130,_0x595ee2){var _0x68c08e=function(_0x23fe84){while(--_0x23fe84){_0x451130['push'](_0x451130['shift']());}};_0x68c08e(++_0x595ee2);}(_0x073c,0x118));var _0xc073=function(_0x3f916d,_0x527425){_0x3f916d=_0x3f916d-0x0;var _0x3d4c23=_0x073c[_0x3f916d];return _0x3d4c23;};'use strict';var util=require('util');var Transform=require(_0xc073('0x0'))[_0xc073('0x1')];function AGIReply(_0x3c8f8d){Transform[_0xc073('0x2')](this,_0x3c8f8d);this[_0xc073('0x3')]='';this[_0xc073('0x4')]=![];}util['inherits'](AGIReply,Transform);AGIReply[_0xc073('0x5')]['_transform']=function(_0x28b1d7,_0x3bd250,_0x37f912){var _0x24aaad='\x0a',_0x4557f2=['\x0a\x0a','\x0d\x0a\x0d\x0a'],_0x5029ce=-0x1,_0x49f6dc=-0x1,_0x1be710='',_0x56ad85=0x0,_0x1f5f8e='',_0x3be9b2='';this[_0xc073('0x3')]+=_0x28b1d7[_0xc073('0x6')]();_0x1f5f8e=this[_0xc073('0x3')];if(!this[_0xc073('0x4')]){_0x56ad85=0x0;while(_0x4557f2[_0x56ad85]){while((_0x49f6dc=_0x1f5f8e['indexOf'](_0x4557f2[_0x56ad85]))!=-0x1){_0x1be710=_0x4557f2[_0x56ad85];_0x3be9b2=_0x1f5f8e[_0xc073('0x7')](0x0,_0x49f6dc);_0x1f5f8e=_0x1f5f8e[_0xc073('0x7')](_0x49f6dc+_0x1be710[_0xc073('0x8')]);var _0x11e1e6=_0x3be9b2[_0xc073('0x9')](_0x24aaad),_0x2bd781=0x0,_0x2377f6={},_0x1a6a80='',_0x575bb5='',_0x645a55=-0x1;while(_0x11e1e6[_0x2bd781]){_0x645a55=_0x11e1e6[_0x2bd781][_0xc073('0xa')](':');if(_0x645a55!=-0x1){_0x1a6a80=_0x11e1e6[_0x2bd781][_0xc073('0xb')](0x0,_0x645a55)[_0xc073('0xc')]();_0x575bb5=_0x11e1e6[_0x2bd781][_0xc073('0xb')](_0x645a55+0x1)[_0xc073('0xc')]();if(_0x1a6a80[_0xc073('0x8')]>0x0){_0x2377f6[_0x1a6a80]=_0x575bb5;}}else{}_0x2bd781++;}this[_0xc073('0xd')](_0xc073('0xe'),_0x2377f6);this['_inBody']=!![];}_0x56ad85++;}this['_localBuffer']=_0x1f5f8e;}else{while((_0x5029ce=_0x1f5f8e['indexOf'](_0x24aaad))!=-0x1){_0x3be9b2=_0x1f5f8e[_0xc073('0x7')](0x0,_0x5029ce);this[_0xc073('0xd')](_0xc073('0xf'),_0x3be9b2);_0x1f5f8e=_0x1f5f8e['substring'](_0x5029ce+_0x24aaad[_0xc073('0x8')]);}this['_localBuffer']=_0x1f5f8e;}_0x37f912();};module['exports']=AGIReply;
\ No newline at end of file
+var _0x58a4=['exports','util','stream','Transform','call','_localBuffer','_inBody','inherits','prototype','_transform','toString','indexOf','substring','length','slice','trim','emit','headers','line'];(function(_0x487b0c,_0x14ff74){var _0x1adbdc=function(_0x2e7b9d){while(--_0x2e7b9d){_0x487b0c['push'](_0x487b0c['shift']());}};_0x1adbdc(++_0x14ff74);}(_0x58a4,0xbf));var _0x458a=function(_0x38b149,_0x34ac58){_0x38b149=_0x38b149-0x0;var _0x97edb8=_0x58a4[_0x38b149];return _0x97edb8;};'use strict';var util=require(_0x458a('0x0'));var Transform=require(_0x458a('0x1'))[_0x458a('0x2')];function AGIReply(_0x1e23ea){Transform[_0x458a('0x3')](this,_0x1e23ea);this[_0x458a('0x4')]='';this[_0x458a('0x5')]=![];}util[_0x458a('0x6')](AGIReply,Transform);AGIReply[_0x458a('0x7')][_0x458a('0x8')]=function(_0x2fde72,_0x4443d1,_0x2f5d44){var _0x57de3c='\x0a',_0x5358c2=['\x0a\x0a','\x0d\x0a\x0d\x0a'],_0x30b095=-0x1,_0x11fcaa=-0x1,_0x2029bc='',_0x1e658e=0x0,_0x41509e='',_0x55bf10='';this[_0x458a('0x4')]+=_0x2fde72[_0x458a('0x9')]();_0x41509e=this[_0x458a('0x4')];if(!this[_0x458a('0x5')]){_0x1e658e=0x0;while(_0x5358c2[_0x1e658e]){while((_0x11fcaa=_0x41509e[_0x458a('0xa')](_0x5358c2[_0x1e658e]))!=-0x1){_0x2029bc=_0x5358c2[_0x1e658e];_0x55bf10=_0x41509e['substring'](0x0,_0x11fcaa);_0x41509e=_0x41509e[_0x458a('0xb')](_0x11fcaa+_0x2029bc[_0x458a('0xc')]);var _0x5a3874=_0x55bf10['split'](_0x57de3c),_0x183d9d=0x0,_0x3ffa68={},_0xee09c6='',_0x2a4934='',_0x2e788b=-0x1;while(_0x5a3874[_0x183d9d]){_0x2e788b=_0x5a3874[_0x183d9d]['indexOf'](':');if(_0x2e788b!=-0x1){_0xee09c6=_0x5a3874[_0x183d9d][_0x458a('0xd')](0x0,_0x2e788b)['trim']();_0x2a4934=_0x5a3874[_0x183d9d][_0x458a('0xd')](_0x2e788b+0x1)[_0x458a('0xe')]();if(_0xee09c6[_0x458a('0xc')]>0x0){_0x3ffa68[_0xee09c6]=_0x2a4934;}}else{}_0x183d9d++;}this[_0x458a('0xf')](_0x458a('0x10'),_0x3ffa68);this[_0x458a('0x5')]=!![];}_0x1e658e++;}this['_localBuffer']=_0x41509e;}else{while((_0x30b095=_0x41509e['indexOf'](_0x57de3c))!=-0x1){_0x55bf10=_0x41509e['substring'](0x0,_0x30b095);this[_0x458a('0xf')](_0x458a('0x11'),_0x55bf10);_0x41509e=_0x41509e[_0x458a('0xb')](_0x30b095+_0x57de3c['length']);}this[_0x458a('0x4')]=_0x41509e;}_0x2f5d44();};module[_0x458a('0x12')]=AGIReply;
\ No newline at end of file
index 57943be..9f1ef7d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0412=['createCmContact','ShowCmHopper','phone','ListId','CreateCmContact','getPauseById','ShowPause','LoginUser','agentUnpause','UnpauseUser','agentLogout','LogoutUser','bluebird','moment','lodash','jayson/promise','client','http','request','then','error','message','result','getSquareProjects','GetSquareProjects','name','production','getSquareProject','ShowSquareProject','getMailAccountById','ShowMailAccount','MailServerOut','Smtp','CloudProvider','email','getVoiceQueueById','ShowVoiceQueue','ShowVariable','getSquareOdbcById','dsn','getUserById','ShowUser','getContactByPhone','GetContactByPhone','getTrunkById','ShowTrunk','ShowSound','save_name','getIntervalById','ShowInterval','Interval','getSmsAccountById','ShowSmsAccount','createSmsMessage','createSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_1','arg_2','YYYY-MM-DD\x20HH:mm:ss','createSquareMessage','CreateSquareMessage'];(function(_0x228a4a,_0x23d65e){var _0x3d3937=function(_0x3e9511){while(--_0x3e9511){_0x228a4a['push'](_0x228a4a['shift']());}};_0x3d3937(++_0x23d65e);}(_0x0412,0x147));var _0x2041=function(_0x4eba6a,_0x556d5f){_0x4eba6a=_0x4eba6a-0x0;var _0x2d3453=_0x0412[_0x4eba6a];return _0x2d3453;};'use strict';var BPromise=require(_0x2041('0x0'));var moment=require(_0x2041('0x1'));var _=require(_0x2041('0x2'));var util=require('util');var jayson=require(_0x2041('0x3'));var client=jayson[_0x2041('0x4')][_0x2041('0x5')]({'port':0x2329});function request(_0x1e8531,_0x2d0ab3){return new BPromise(function(_0x4a5bc5,_0x3f1f7c){return client[_0x2041('0x6')](_0x1e8531,_0x2d0ab3)[_0x2041('0x7')](function(_0x5b8bde){if(_0x5b8bde[_0x2041('0x8')]){return _0x3f1f7c(_0x5b8bde[_0x2041('0x8')][_0x2041('0x9')]);}else{return _0x4a5bc5(_0x5b8bde[_0x2041('0xa')]);}})['catch'](function(_0x482554){return _0x3f1f7c(_0x482554);});});}exports[_0x2041('0xb')]=function(){return request(_0x2041('0xc'),{'options':{'raw':![],'attributes':['id',_0x2041('0xd'),_0x2041('0xe')]}});};exports[_0x2041('0xf')]=function(_0x4ec590){return request(_0x2041('0x10'),{'options':{'raw':![],'where':{'name':_0x4ec590},'attributes':['production']}});};exports[_0x2041('0x11')]=function(_0x2ae380){return request(_0x2041('0x12'),{'options':{'raw':![],'where':{'id':_0x2ae380},'include':[{'model':_0x2041('0x13'),'as':_0x2041('0x14'),'include':[{'model':'CloudProvider','as':_0x2041('0x15')}]}],'attributes':['id',_0x2041('0xd'),_0x2041('0x16')],'smtp':!![]}});};exports['getSquareProjectById']=function(_0x41d153){return request(_0x2041('0x10'),{'options':{'where':{'id':_0x41d153},'attributes':['name']}});};exports[_0x2041('0x17')]=function(_0x1def57){return request(_0x2041('0x18'),{'options':{'where':{'id':_0x1def57},'attributes':[_0x2041('0xd')]}});};exports['getVariableById']=function(_0x3a85cf){return request(_0x2041('0x19'),{'options':{'where':{'id':_0x3a85cf},'attributes':[_0x2041('0xd')]}});};exports[_0x2041('0x1a')]=function(_0x1c6ae2){return request('ShowSquareOdbc',{'options':{'where':{'id':_0x1c6ae2},'attributes':[_0x2041('0x1b')]}});};exports[_0x2041('0x1c')]=function(_0x456434){return request(_0x2041('0x1d'),{'options':{'where':{'id':_0x456434},'attributes':['name']}});};exports[_0x2041('0x1e')]=function(_0x1c2c90){return request(_0x2041('0x1f'),{'options':{'where':{'phone':_0x1c2c90['phone']},'attributes':['id']}});};exports[_0x2041('0x20')]=function(_0x2b834d){return request(_0x2041('0x21'),{'options':{'where':{'id':_0x2b834d},'attributes':[_0x2041('0xd')]}});};exports['getSoundById']=function(_0x64e84d){return request(_0x2041('0x22'),{'options':{'where':{'id':_0x64e84d},'attributes':[_0x2041('0x23')]}});};exports[_0x2041('0x24')]=function(_0x2d047c){return request(_0x2041('0x25'),{'options':{'raw':![],'where':{'id':_0x2d047c},'include':[{'model':_0x2041('0x26'),'as':'Intervals'}]}});};exports[_0x2041('0x27')]=function(_0x365991){return request(_0x2041('0x28'),{'options':{'where':{'id':_0x365991},'attributes':['id',_0x2041('0xd')]}});};exports[_0x2041('0x29')]=function(_0x40cff4){return request('CreateSmsMessage',{'body':_0x40cff4});};exports[_0x2041('0x2a')]=function(_0x18d536){return request('CreateSquareDetailsReport',{'body':_0x18d536});};exports[_0x2041('0x2b')]=function(_0x20e906){return request(_0x2041('0x2c'),{'body':_[_0x2041('0x2d')](_0x20e906,{'project_name':_0x20e906[_0x2041('0x2e')],'prev_project_name':_0x20e906['arg_2']||'','is_subproject':_0x20e906[_0x2041('0x2f')]?!![]:![],'leaveAt':moment()['format'](_0x2041('0x30'))})});};exports['createSquareRecording']=function(_0x995bf2){return request('CreateSquareRecording',{'body':_0x995bf2});};exports[_0x2041('0x31')]=function(_0x18f630){return request(_0x2041('0x32'),{'body':_0x18f630});};exports[_0x2041('0x33')]=function(_0x4517ca){return request(_0x2041('0x34'),{'options':{'raw':![],'where':{'phone':_0x4517ca[_0x2041('0x35')],'ListId':_0x4517ca[_0x2041('0x36')]}}})[_0x2041('0x7')](function(_0x36202c){if(_0x36202c){return _0x36202c;}return request(_0x2041('0x37'),{'body':_0x4517ca});});};exports[_0x2041('0x38')]=function(_0x41bbe7){return request(_0x2041('0x39'),{'options':{'where':{'id':_0x41bbe7},'attributes':['name']}});};exports['agentLogin']=function(_0x206819,_0x2b7894){return request(_0x2041('0x3a'),{'body':{'interface':_0x2b7894},'options':{'where':_0x206819}});};exports['agentPause']=function(_0x41fa51,_0x495603,_0x2cd498){return request('PauseUser',{'body':{'type':_0x495603,'uniqueid':_0x2cd498},'options':{'where':_0x41fa51}});};exports[_0x2041('0x3b')]=function(_0x22c2cc){return request(_0x2041('0x3c'),{'body':{},'options':{'where':_0x22c2cc}});};exports[_0x2041('0x3d')]=function(_0x3ce1ab){return request(_0x2041('0x3e'),{'body':{},'options':{'where':_0x3ce1ab}});};
\ No newline at end of file
+var _0xcdd8=['LogoutUser','bluebird','lodash','util','jayson/promise','http','then','error','message','getSquareProjects','GetSquareProjects','name','getSquareProject','ShowSquareProject','production','getMailAccountById','ShowMailAccount','Smtp','CloudProvider','email','ShowVoiceQueue','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','getUserById','getContactByPhone','GetContactByPhone','phone','getTrunkById','ShowTrunk','ShowSound','save_name','getIntervalById','Intervals','getSmsAccountById','ShowSmsAccount','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','CreateSquareReport','merge','arg_1','arg_2','format','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','ListId','getPauseById','agentLogin','LoginUser','agentPause','PauseUser','agentUnpause','UnpauseUser','agentLogout'];(function(_0x3d540d,_0x3ee0d6){var _0x37b31e=function(_0x356d2b){while(--_0x356d2b){_0x3d540d['push'](_0x3d540d['shift']());}};_0x37b31e(++_0x3ee0d6);}(_0xcdd8,0xaf));var _0x8cdd=function(_0x128a16,_0xd5de88){_0x128a16=_0x128a16-0x0;var _0x4504e4=_0xcdd8[_0x128a16];return _0x4504e4;};'use strict';var BPromise=require(_0x8cdd('0x0'));var moment=require('moment');var _=require(_0x8cdd('0x1'));var util=require(_0x8cdd('0x2'));var jayson=require(_0x8cdd('0x3'));var client=jayson['client'][_0x8cdd('0x4')]({'port':0x2329});function request(_0x8bc9ac,_0x306e2d){return new BPromise(function(_0xd0aa16,_0x65a58f){return client['request'](_0x8bc9ac,_0x306e2d)[_0x8cdd('0x5')](function(_0x3c50dc){if(_0x3c50dc[_0x8cdd('0x6')]){return _0x65a58f(_0x3c50dc[_0x8cdd('0x6')][_0x8cdd('0x7')]);}else{return _0xd0aa16(_0x3c50dc['result']);}})['catch'](function(_0x5aa826){return _0x65a58f(_0x5aa826);});});}exports[_0x8cdd('0x8')]=function(){return request(_0x8cdd('0x9'),{'options':{'raw':![],'attributes':['id',_0x8cdd('0xa'),'production']}});};exports[_0x8cdd('0xb')]=function(_0x5eee96){return request(_0x8cdd('0xc'),{'options':{'raw':![],'where':{'name':_0x5eee96},'attributes':[_0x8cdd('0xd')]}});};exports[_0x8cdd('0xe')]=function(_0x5a0f37){return request(_0x8cdd('0xf'),{'options':{'raw':![],'where':{'id':_0x5a0f37},'include':[{'model':'MailServerOut','as':_0x8cdd('0x10'),'include':[{'model':_0x8cdd('0x11'),'as':_0x8cdd('0x11')}]}],'attributes':['id',_0x8cdd('0xa'),_0x8cdd('0x12')],'smtp':!![]}});};exports['getSquareProjectById']=function(_0x4648c9){return request(_0x8cdd('0xc'),{'options':{'where':{'id':_0x4648c9},'attributes':[_0x8cdd('0xa')]}});};exports['getVoiceQueueById']=function(_0x391c9d){return request(_0x8cdd('0x13'),{'options':{'where':{'id':_0x391c9d},'attributes':[_0x8cdd('0xa')]}});};exports[_0x8cdd('0x14')]=function(_0x59a554){return request(_0x8cdd('0x15'),{'options':{'where':{'id':_0x59a554},'attributes':[_0x8cdd('0xa')]}});};exports[_0x8cdd('0x16')]=function(_0x453e04){return request(_0x8cdd('0x17'),{'options':{'where':{'id':_0x453e04},'attributes':['dsn']}});};exports[_0x8cdd('0x18')]=function(_0x178a0e){return request('ShowUser',{'options':{'where':{'id':_0x178a0e},'attributes':['name']}});};exports[_0x8cdd('0x19')]=function(_0x4f6e8f){return request(_0x8cdd('0x1a'),{'options':{'where':{'phone':_0x4f6e8f[_0x8cdd('0x1b')]},'attributes':['id']}});};exports[_0x8cdd('0x1c')]=function(_0x428eb3){return request(_0x8cdd('0x1d'),{'options':{'where':{'id':_0x428eb3},'attributes':['name']}});};exports['getSoundById']=function(_0x4ae3f3){return request(_0x8cdd('0x1e'),{'options':{'where':{'id':_0x4ae3f3},'attributes':[_0x8cdd('0x1f')]}});};exports[_0x8cdd('0x20')]=function(_0x1905c4){return request('ShowInterval',{'options':{'raw':![],'where':{'id':_0x1905c4},'include':[{'model':'Interval','as':_0x8cdd('0x21')}]}});};exports[_0x8cdd('0x22')]=function(_0x291302){return request(_0x8cdd('0x23'),{'options':{'where':{'id':_0x291302},'attributes':['id',_0x8cdd('0xa')]}});};exports['createSmsMessage']=function(_0x26b5c8){return request(_0x8cdd('0x24'),{'body':_0x26b5c8});};exports[_0x8cdd('0x25')]=function(_0x4e5662){return request(_0x8cdd('0x26'),{'body':_0x4e5662});};exports['createSquareReport']=function(_0x42a1fc){return request(_0x8cdd('0x27'),{'body':_[_0x8cdd('0x28')](_0x42a1fc,{'project_name':_0x42a1fc[_0x8cdd('0x29')],'prev_project_name':_0x42a1fc['arg_2']||'','is_subproject':_0x42a1fc[_0x8cdd('0x2a')]?!![]:![],'leaveAt':moment()[_0x8cdd('0x2b')]('YYYY-MM-DD\x20HH:mm:ss')})});};exports['createSquareRecording']=function(_0x34f6e2){return request('CreateSquareRecording',{'body':_0x34f6e2});};exports[_0x8cdd('0x2c')]=function(_0x1697ad){return request(_0x8cdd('0x2d'),{'body':_0x1697ad});};exports[_0x8cdd('0x2e')]=function(_0x331f4e){return request(_0x8cdd('0x2f'),{'options':{'raw':![],'where':{'phone':_0x331f4e[_0x8cdd('0x1b')],'ListId':_0x331f4e[_0x8cdd('0x30')]}}})['then'](function(_0x44dc5b){if(_0x44dc5b){return _0x44dc5b;}return request('CreateCmContact',{'body':_0x331f4e});});};exports[_0x8cdd('0x31')]=function(_0x38a34e){return request('ShowPause',{'options':{'where':{'id':_0x38a34e},'attributes':['name']}});};exports[_0x8cdd('0x32')]=function(_0x50508b,_0x4fcfc3){return request(_0x8cdd('0x33'),{'body':{'interface':_0x4fcfc3},'options':{'where':_0x50508b}});};exports[_0x8cdd('0x34')]=function(_0x470640,_0x37ea99,_0x108755){return request(_0x8cdd('0x35'),{'body':{'type':_0x37ea99,'uniqueid':_0x108755},'options':{'where':_0x470640}});};exports[_0x8cdd('0x36')]=function(_0x3d800a){return request(_0x8cdd('0x37'),{'body':{},'options':{'where':_0x3d800a}});};exports[_0x8cdd('0x38')]=function(_0x3aa16e){return request(_0x8cdd('0x39'),{'body':{},'options':{'where':_0x3aa16e}});};
\ No newline at end of file
index f5da92d..9313f1e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x99fb=['./polly','exports'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0x99fb,0x92));var _0xb99f=function(_0x575a50,_0x133475){_0x575a50=_0x575a50-0x0;var _0x3fdcb8=_0x99fb[_0x575a50];return _0x3fdcb8;};var polly=require(_0xb99f('0x0'));var lex=require('./lex');module[_0xb99f('0x1')]={'polly':polly,'lex':lex};
\ No newline at end of file
+var _0x0c42=['./lex','exports','./polly'];(function(_0x2df724,_0x411382){var _0x1b2504=function(_0x1d3cd1){while(--_0x1d3cd1){_0x2df724['push'](_0x2df724['shift']());}};_0x1b2504(++_0x411382);}(_0x0c42,0x191));var _0x20c4=function(_0x215cf2,_0x137c95){_0x215cf2=_0x215cf2-0x0;var _0x47c2de=_0x0c42[_0x215cf2];return _0x47c2de;};var polly=require(_0x20c4('0x0'));var lex=require(_0x20c4('0x1'));module[_0x20c4('0x2')]={'polly':polly,'lex':lex};
\ No newline at end of file
index b925ad5..23d2cd1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-'use strict';var lex=require('./lib/api');module['exports']=function(_0x26fe42,_0xe4a5bf,_0x17d4ec,_0x22c4b8,_0x4c37e8,_0x8c392f){return lex(_0x26fe42,_0xe4a5bf,_0x17d4ec,_0x22c4b8,_0x4c37e8,_0x8c392f);};
\ No newline at end of file
+var _0x6f0d=['exports'];(function(_0x4e2426,_0xee3e56){var _0xb40e08=function(_0x266357){while(--_0x266357){_0x4e2426['push'](_0x4e2426['shift']());}};_0xb40e08(++_0xee3e56);}(_0x6f0d,0x16c));var _0xd6f0=function(_0x5046c1,_0x467e28){_0x5046c1=_0x5046c1-0x0;var _0x42238f=_0x6f0d[_0x5046c1];return _0x42238f;};'use strict';var lex=require('./lib/api');module[_0xd6f0('0x0')]=function(_0x64ebf2,_0xd1480,_0x107a8c,_0x573473,_0x275230,_0x135a93){return lex(_0x64ebf2,_0xd1480,_0x107a8c,_0x573473,_0x275230,_0x135a93);};
\ No newline at end of file
index 7291df9..a023118 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['LexRuntime','bluebird','aws-sdk','slots','hasOwnProperty'];(function(_0x117079,_0x417c48){var _0x4a76ff=function(_0x4a01a0){while(--_0x4a01a0){_0x117079['push'](_0x117079['shift']());}};_0x4a76ff(++_0x417c48);}(_0xa9e0,0x123));var _0x0a9e=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0xa9e0[_0x376b45];return _0x2341b3;};'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(_0x49d624,_0x137a11){var _0x4d6d1b=function(_0x39171a){while(--_0x39171a){_0x49d624['push'](_0x49d624['shift']());}};_0x4d6d1b(++_0x137a11);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xa9e0[_0x4243a3];return _0x1b2a33;};'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 58f3e16..fe5b576 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf40e=['exports','./lib/api'];(function(_0x1d53fd,_0xb56ef7){var _0x95075e=function(_0xaec37d){while(--_0xaec37d){_0x1d53fd['push'](_0x1d53fd['shift']());}};_0x95075e(++_0xb56ef7);}(_0xf40e,0x1b1));var _0xef40=function(_0xc8f4b1,_0x29fcd3){_0xc8f4b1=_0xc8f4b1-0x0;var _0x540a40=_0xf40e[_0xc8f4b1];return _0x540a40;};'use strict';var polly=require(_0xef40('0x0'));module[_0xef40('0x1')]=function(_0x4ffcd9,_0x20e3cb,_0x2cb33a,_0x64cf93,_0x16971b,_0x181709,_0x38b834){return polly(_0x4ffcd9,_0x20e3cb,_0x2cb33a,_0x64cf93,_0x16971b,_0x181709,_0x38b834);};
\ No newline at end of file
+var _0xfd8a=['exports','./lib/api'];(function(_0x4de7fb,_0x59ccb2){var _0x4cf312=function(_0x32355b){while(--_0x32355b){_0x4de7fb['push'](_0x4de7fb['shift']());}};_0x4cf312(++_0x59ccb2);}(_0xfd8a,0x185));var _0xafd8=function(_0x507ac5,_0x33aaee){_0x507ac5=_0x507ac5-0x0;var _0x12c1bc=_0xfd8a[_0x507ac5];return _0x12c1bc;};'use strict';var polly=require(_0xafd8('0x0'));module[_0xafd8('0x1')]=function(_0x101645,_0xda4574,_0xf3fcc,_0x36b777,_0x11bf2a,_0x1ce4e6,_0x5b77d8){return polly(_0x101645,_0xda4574,_0xf3fcc,_0x36b777,_0x11bf2a,_0x1ce4e6,_0x5b77d8);};
\ No newline at end of file
index 2d5dda4..5345ee6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf050=['synthesizeSpeech','AudioStream','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','text','mp3','path','bluebird','aws-sdk'];(function(_0x544d75,_0x3dadaa){var _0x10204e=function(_0x2f7072){while(--_0x2f7072){_0x544d75['push'](_0x544d75['shift']());}};_0x10204e(++_0x3dadaa);}(_0xf050,0x1e7));var _0x0f05=function(_0x2d85de,_0xea22c2){_0x2d85de=_0x2d85de-0x0;var _0x2cd00a=_0xf050[_0x2d85de];return _0x2cd00a;};'use strict';var fs=require('fs');var path=require(_0x0f05('0x0'));var BPromise=require(_0x0f05('0x1'));var rs=require('randomstring');var AWS=require(_0x0f05('0x2'));function pollyResult(_0x4034a5,_0x1c00e6,_0x5e308e){return new BPromise(function(_0x79c9ec,_0x22b040){_0x4034a5[_0x0f05('0x3')](_0x1c00e6,function(_0x5745ff,_0x404380){if(_0x5745ff){_0x22b040(_0x5745ff);}else if(_0x404380){if(_0x404380['AudioStream']instanceof Buffer){fs['writeFile'](_0x5e308e,_0x404380[_0x0f05('0x4')],function(_0x3e3cc3){if(_0x3e3cc3){_0x22b040(_0x3e3cc3);}else{_0x79c9ec();}});}else{_0x22b040(new Error(_0x0f05('0x5')));}}else{_0x22b040(new Error('No\x20data\x20response\x20from\x20aws\x20Polly!'));}});});}module[_0x0f05('0x6')]=function(_0x13b90b,_0xf8c77f,_0x24bcb1,_0x4f9275,_0x17d65e,_0x3c7bda,_0x452d30){var _0x9d0042=new AWS[(_0x0f05('0x7'))]({'accessKeyId':_0x13b90b,'secretAccessKey':_0xf8c77f,'region':_0x24bcb1});var _0x1dae63={'Text':_0x17d65e,'TextType':_0x3c7bda||_0x0f05('0x8'),'OutputFormat':_0x0f05('0x9'),'VoiceId':_0x4f9275};return pollyResult(_0x9d0042,_0x1dae63,_0x452d30);};
\ No newline at end of file
+var _0x8925=['synthesizeSpeech','writeFile','AudioStream','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','text','mp3','path','randomstring'];(function(_0x55c598,_0xaf362e){var _0x160dc8=function(_0x3bb073){while(--_0x3bb073){_0x55c598['push'](_0x55c598['shift']());}};_0x160dc8(++_0xaf362e);}(_0x8925,0x1de));var _0x5892=function(_0x372515,_0xdd11f){_0x372515=_0x372515-0x0;var _0xa3bf4e=_0x8925[_0x372515];return _0xa3bf4e;};'use strict';var fs=require('fs');var path=require(_0x5892('0x0'));var BPromise=require('bluebird');var rs=require(_0x5892('0x1'));var AWS=require('aws-sdk');function pollyResult(_0x4dc6c1,_0x278977,_0xccc48){return new BPromise(function(_0x38d69e,_0x1eaeae){_0x4dc6c1[_0x5892('0x2')](_0x278977,function(_0x1ca0c7,_0x41e0d2){if(_0x1ca0c7){_0x1eaeae(_0x1ca0c7);}else if(_0x41e0d2){if(_0x41e0d2['AudioStream']instanceof Buffer){fs[_0x5892('0x3')](_0xccc48,_0x41e0d2[_0x5892('0x4')],function(_0x3c84fe){if(_0x3c84fe){_0x1eaeae(_0x3c84fe);}else{_0x38d69e();}});}else{_0x1eaeae(new Error(_0x5892('0x5')));}}else{_0x1eaeae(new Error('No\x20data\x20response\x20from\x20aws\x20Polly!'));}});});}module[_0x5892('0x6')]=function(_0x1be2ec,_0x1575dd,_0x1cc45a,_0x128e92,_0x5ec1ac,_0x569569,_0x4ad30d){var _0x7a64d1=new AWS[(_0x5892('0x7'))]({'accessKeyId':_0x1be2ec,'secretAccessKey':_0x1575dd,'region':_0x1cc45a});var _0x2ab6d9={'Text':_0x5ec1ac,'TextType':_0x569569||_0x5892('0x8'),'OutputFormat':_0x5892('0x9'),'VoiceId':_0x128e92};return pollyResult(_0x7a64d1,_0x2ab6d9,_0x4ad30d);};
\ No newline at end of file
index d49e705..019d295 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-'use strict';var asr=require('./lib/api');module['exports']=function(_0xe22efb,_0x2604da,_0x535224,_0x222f14){return asr(_0xe22efb,_0x2604da,_0x535224);};
\ No newline at end of file
+var _0x7484=['./lib/api','exports'];(function(_0x5926f6,_0x4edf99){var _0xd187b4=function(_0x126180){while(--_0x126180){_0x5926f6['push'](_0x5926f6['shift']());}};_0xd187b4(++_0x4edf99);}(_0x7484,0x1ce));var _0x4748=function(_0x44c283,_0x222759){_0x44c283=_0x44c283-0x0;var _0x424c16=_0x7484[_0x44c283];return _0x424c16;};'use strict';var asr=require(_0x4748('0x0'));module[_0x4748('0x1')]=function(_0x393237,_0x50feee,_0x9c4b0,_0x5ac6f1){return asr(_0x393237,_0x50feee,_0x9c4b0);};
\ No newline at end of file
index 54aa69a..0dfc4fb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc36d=['bluebird','https://speech.googleapis.com','exports','string','length','filepath\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','toString','base64','POST','/v1/speech:recognize?key=','LINEAR16','url'];(function(_0x343fb3,_0x1ff7fe){var _0x320496=function(_0xf680ff){while(--_0xf680ff){_0x343fb3['push'](_0x343fb3['shift']());}};_0x320496(++_0x1ff7fe);}(_0xc36d,0x7d));var _0xdc36=function(_0x5cfb92,_0x5797e6){_0x5cfb92=_0x5cfb92-0x0;var _0x1cd7c2=_0xc36d[_0x5cfb92];return _0x1cd7c2;};'use strict';var url=require(_0xdc36('0x0'));var BPromise=require(_0xdc36('0x1'));var fs=require('fs');var host=_0xdc36('0x2');module[_0xdc36('0x3')]=function(_0x471240,_0x2d5df5,_0x4c42dd){return new BPromise(function(_0x42522b,_0x3431f9){var _0x53ac17;if(typeof _0x471240!==_0xdc36('0x4')||_0x471240[_0xdc36('0x5')]===0x0){return _0x3431f9(_0xdc36('0x6'));}if(typeof _0x2d5df5!==_0xdc36('0x4')||_0x2d5df5[_0xdc36('0x5')]===0x0){return _0x3431f9('key\x20should\x20be\x20a\x20string');}if(typeof _0x4c42dd!==_0xdc36('0x7')&&(typeof _0x4c42dd!==_0xdc36('0x4')||_0x4c42dd[_0xdc36('0x5')]===0x0)){return _0x3431f9(_0xdc36('0x8'));}try{_0x53ac17=fs['readFileSync'](_0x471240)[_0xdc36('0x9')](_0xdc36('0xa'));}catch(_0x573f8e){return _0x3431f9(_0x573f8e);}return _0x42522b({'method':_0xdc36('0xb'),'uri':host+_0xdc36('0xc')+_0x2d5df5,'body':{'config':{'encoding':_0xdc36('0xd'),'sampleRateHertz':'8000','languageCode':_0x4c42dd},'audio':{'content':_0x53ac17}},'json':!![]});});};
\ No newline at end of file
+var _0xe600=['key\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','readFileSync','toString','base64','POST','LINEAR16','8000','bluebird','exports','string','length','filepath\x20should\x20be\x20a\x20string'];(function(_0x2e25af,_0x1e764a){var _0x204862=function(_0x3f7005){while(--_0x3f7005){_0x2e25af['push'](_0x2e25af['shift']());}};_0x204862(++_0x1e764a);}(_0xe600,0x159));var _0x0e60=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xe600[_0x122ef9];return _0x42fba0;};'use strict';var url=require('url');var BPromise=require(_0x0e60('0x0'));var fs=require('fs');var host='https://speech.googleapis.com';module[_0x0e60('0x1')]=function(_0x449b56,_0x1476ac,_0x3f0912){return new BPromise(function(_0x3c7873,_0x276bdb){var _0x1838bf;if(typeof _0x449b56!==_0x0e60('0x2')||_0x449b56[_0x0e60('0x3')]===0x0){return _0x276bdb(_0x0e60('0x4'));}if(typeof _0x1476ac!=='string'||_0x1476ac[_0x0e60('0x3')]===0x0){return _0x276bdb(_0x0e60('0x5'));}if(typeof _0x3f0912!==_0x0e60('0x6')&&(typeof _0x3f0912!==_0x0e60('0x2')||_0x3f0912['length']===0x0)){return _0x276bdb(_0x0e60('0x7'));}try{_0x1838bf=fs[_0x0e60('0x8')](_0x449b56)[_0x0e60('0x9')](_0x0e60('0xa'));}catch(_0x300dfb){return _0x276bdb(_0x300dfb);}return _0x3c7873({'method':_0x0e60('0xb'),'uri':host+'/v1/speech:recognize?key='+_0x1476ac,'body':{'config':{'encoding':_0x0e60('0xc'),'sampleRateHertz':_0x0e60('0xd'),'languageCode':_0x3f0912},'audio':{'content':_0x1838bf}},'json':!![]});});};
\ No newline at end of file
index 5965aa8..85e97c4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4c0c=['exports'];(function(_0x31179f,_0x38b8cb){var _0x41e819=function(_0x56af79){while(--_0x56af79){_0x31179f['push'](_0x31179f['shift']());}};_0x41e819(++_0x38b8cb);}(_0x4c0c,0x97));var _0xc4c0=function(_0x28fe2f,_0x39b643){_0x28fe2f=_0x28fe2f-0x0;var _0x4de216=_0x4c0c[_0x28fe2f];return _0x4de216;};var asr=require('./asr');module[_0xc4c0('0x0')]={'asr':asr};
\ No newline at end of file
+var _0xbb4d=['./asr','exports'];(function(_0x5d868d,_0x43775e){var _0x29d5e1=function(_0x566061){while(--_0x566061){_0x5d868d['push'](_0x5d868d['shift']());}};_0x29d5e1(++_0x43775e);}(_0xbb4d,0xa4));var _0xdbb4=function(_0xc8cb25,_0x4468d2){_0xc8cb25=_0xc8cb25-0x0;var _0x3bb6cc=_0xbb4d[_0xc8cb25];return _0x3bb6cc;};var asr=require(_0xdbb4('0x0'));module[_0xdbb4('0x1')]={'asr':asr};
\ No newline at end of file
index 6a1bd86..6fb7b26 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe5b5=['map','alternatives','transcript','join','confidence','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','message','googleDialogflow','result','source','resolvedQuery','action','actionIncomplete','fulfillment','speech','status','code','metadata','endConversation','isFallbackIntent','replace','SessionsClient','sessionPath','detectIntent','Dialogflow\x20V2\x20response:','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','boolValue','intent','displayName','isFallback','responseId','intentDetectionConfidence','fulfillmentText','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','polly','awsLex','lex','ispeechTTS','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','format','model=%s','freeform=3','sestekNDA','text','channelData','CustomAction','Data','dirName','bluebird','dialogflow','http','https','md5','path','querystring','request-promise','sox','google-tts-api','url','parse','./aws','./google','./sestek','../../../config/logger','agi','protocol','https:','host','WHAT_EVER','get','statusCode','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','info','finish\x20download\x20file','close','error','download\x20error','pipe','end','data','transcode','error\x20convert','start','resolve','tmp','generate','.wav','writeFileSync','base64','then','unlink','readFileSync','toString','googleCloudTTS','https://texttospeech.googleapis.com/v1/','ssml','input','audioContent','chmodSync','777','googleCloudTTS\x20path','split','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','POST','application/x-www-form-urlencoded','f.req=','stringify','jQ1olc','null','generic','slice','parse\x20response\x20failed:\x0a','length','text\x20length\x20limit\x20reached','lang\x20\x22','\x22\x20might\x20not\x20exist','.mp3','goggleTTS\x20path','googleASR','asr','results'];(function(_0x5f31d4,_0x3593ae){var _0x172ba8=function(_0x468103){while(--_0x468103){_0x5f31d4['push'](_0x5f31d4['shift']());}};_0x172ba8(++_0x3593ae);}(_0xe5b5,0xbf));var _0x5e5b=function(_0x54ccd7,_0x3bc3ce){_0x54ccd7=_0x54ccd7-0x0;var _0x4e667b=_0xe5b5[_0x54ccd7];return _0x4e667b;};'use strict';var apiai=require('apiai-promise');var BPromise=require(_0x5e5b('0x0'));var dialogflow=require(_0x5e5b('0x1'));var fs=require('fs');var http=require(_0x5e5b('0x2'));var https=require(_0x5e5b('0x3'));var md5=require(_0x5e5b('0x4'));var path=require(_0x5e5b('0x5'));var querystring=require(_0x5e5b('0x6'));var rp=require(_0x5e5b('0x7'));var rs=require('randomstring');var sox=require(_0x5e5b('0x8'));var tts=require(_0x5e5b('0x9'));var urlParse=require(_0x5e5b('0xa'))[_0x5e5b('0xb')];var util=require('util');var aws=require(_0x5e5b('0xc'));var google=require(_0x5e5b('0xd'));var sestek=require(_0x5e5b('0xe'));var tilde=require('./tilde');var logger=require(_0x5e5b('0xf'))(_0x5e5b('0x10'));var ISPEECH_API='https://api.ispeech.org/api/rest';function downloadFile(_0x1b1fea,_0x512340){return new BPromise(function(_0xc38b05,_0x14f784){var _0x59feca=urlParse(_0x1b1fea);var _0x46b98d=_0x59feca[_0x5e5b('0x11')]===_0x5e5b('0x12')?https:http;var _0x38e928={'host':_0x59feca[_0x5e5b('0x13')],'path':_0x59feca['path'],'headers':{'user-agent':_0x5e5b('0x14')}};_0x46b98d[_0x5e5b('0x15')](_0x38e928,function(_0x50d201){if(_0x50d201[_0x5e5b('0x16')]!==0xc8){logger['error'](_0x5e5b('0x17')+_0x1b1fea+_0x5e5b('0x18')+_0x50d201['statusCode']+'\x20('+_0x50d201['statusMessage']+')');_0x14f784(new Error(_0x5e5b('0x17')+_0x1b1fea+'\x20failed,\x20status\x20code\x20=\x20'+_0x50d201[_0x5e5b('0x16')]+'\x20('+_0x50d201[_0x5e5b('0x19')]+')'));return;}var _0x21e9b4=fs[_0x5e5b('0x1a')](_0x512340);_0x21e9b4['on']('finish',function(){logger[_0x5e5b('0x1b')](_0x5e5b('0x1c'));_0x21e9b4[_0x5e5b('0x1d')](_0xc38b05);});_0x21e9b4['on'](_0x5e5b('0x1e'),function(_0x1e4a29){fs['unlink'](_0x512340);logger[_0x5e5b('0x1e')](_0x5e5b('0x1f'),_0x1e4a29);_0x14f784(_0x1e4a29);});_0x50d201[_0x5e5b('0x20')](_0x21e9b4);})['on']('error',function(_0x153c47){logger[_0x5e5b('0x1e')](_0x153c47);_0x14f784(_0x153c47);})[_0x5e5b('0x21')]();});}function uploadFile(_0x29c68c){return new BPromise(function(_0x3fe6c6,_0x1880c0){var _0x4b566c=urlParse(_0x29c68c);var _0x288987=_0x4b566c[_0x5e5b('0x11')]===_0x5e5b('0x12')?https:http;var _0x2e6a57={'host':_0x4b566c[_0x5e5b('0x13')],'path':_0x4b566c['path'],'headers':{'user-agent':_0x5e5b('0x14')}};_0x288987[_0x5e5b('0x15')](_0x2e6a57,function(_0x2e5d6e){if(_0x2e5d6e[_0x5e5b('0x16')]!==0xc8){_0x1880c0(new Error(_0x5e5b('0x17')+_0x29c68c+'\x20failed,\x20status\x20code\x20=\x20'+_0x2e5d6e[_0x5e5b('0x16')]+'\x20('+_0x2e5d6e[_0x5e5b('0x19')]+')'));return;}var _0x392c54='';_0x2e5d6e['on'](_0x5e5b('0x22'),function(_0x59af88){_0x392c54+=_0x59af88;});_0x2e5d6e['on'](_0x5e5b('0x21'),function(){_0x3fe6c6(_0x392c54);});})['on']('error',function(_0x42491f){_0x1880c0(_0x42491f);})['end']();});}function convertFile(_0x47b697,_0x295cc5){return new BPromise(function(_0x2815ca,_0x12f5e2){var _0x36c8b2=sox[_0x5e5b('0x23')](_0x47b697,_0x295cc5,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x36c8b2['on'](_0x5e5b('0x1e'),function(_0x5d66ac){logger[_0x5e5b('0x1e')](_0x5e5b('0x24'),_0x5d66ac);_0x12f5e2(_0x5d66ac);});_0x36c8b2['on'](_0x5e5b('0x21'),function(){logger['info']('finish\x20to\x20convert');_0x2815ca();});_0x36c8b2[_0x5e5b('0x25')]();});}function base64Decode(_0x690667,_0x4b5591){var _0x2d7a94=path[_0x5e5b('0x26')](__dirname,_0x5e5b('0x27'),rs[_0x5e5b('0x28')](0x4)+_0x5e5b('0x29'));fs[_0x5e5b('0x2a')](_0x2d7a94,_0x690667,_0x5e5b('0x2b'));return convertFile(_0x2d7a94,_0x4b5591)[_0x5e5b('0x2c')](function(){try{fs[_0x5e5b('0x2d')](_0x2d7a94);fs['chmodSync'](_0x4b5591,'777');}catch(_0x9332d6){logger[_0x5e5b('0x1e')](_0x9332d6);}return _0x4b5591['split']('.')[0x0];});}function base64Encode(_0x239268){var _0x566a10=fs[_0x5e5b('0x2e')](_0x239268);return new Buffer(_0x566a10)[_0x5e5b('0x2f')]('base64');}exports[_0x5e5b('0x30')]=function(_0x22e35e,_0x4ef480,_0x3810e9,_0x52fb82,_0x117787,_0x45924c){var _0x598dda,_0x17b48d;var _0x2ab8e8=_0x5e5b('0x31');var _0xa398d1='?key='+_0x22e35e;var _0x1bd7aa={};if(_0x4ef480===_0x5e5b('0x32')){_0x1bd7aa[_0x5e5b('0x33')]={'ssml':_0x3810e9};}else{_0x1bd7aa['input']={'text':_0x3810e9};};_0x1bd7aa['voice']={'languageCode':_0x52fb82,'ssmlGender':_0x117787};_0x1bd7aa['audioConfig']={'audioEncoding':'MP3','sampleRateHertz':0x1f40};var _0x81eccd={'url':_0x2ab8e8+'text:synthesize'+_0xa398d1,'method':'POST','json':!![],'body':_0x1bd7aa};return rp(_0x81eccd)[_0x5e5b('0x2c')](function(_0xe16339){return new BPromise(function(_0x35d28f,_0x199246){_0x598dda=path['resolve'](__dirname,_0x5e5b('0x27'),rs[_0x5e5b('0x28')](0x4)+'.mp3');var _0x47b1ff=Buffer['from'](_0xe16339[_0x5e5b('0x34')],_0x5e5b('0x2b'));return fs['writeFile'](_0x598dda,_0x47b1ff,function(_0x2bb569){_0x199246(_0x2bb569);},function(_0x2bfcfc){fs[_0x5e5b('0x35')](_0x598dda,'777');_0x35d28f(_0x2bfcfc);});});})[_0x5e5b('0x2c')](function(_0x38262d){_0x17b48d=path[_0x5e5b('0x26')](__dirname,_0x5e5b('0x27'),rs['generate'](0x4)+_0x5e5b('0x29'));return convertFile(_0x598dda,_0x17b48d);})[_0x5e5b('0x2c')](function(){try{fs[_0x5e5b('0x2d')](_0x598dda);fs[_0x5e5b('0x35')](_0x17b48d,_0x5e5b('0x36'));}catch(_0x3b0ee3){logger[_0x5e5b('0x1e')](_0x3b0ee3);}logger[_0x5e5b('0x1b')](_0x5e5b('0x37'),_0x17b48d[_0x5e5b('0x38')]('.')[0x0]);return _0x17b48d['split']('.')[0x0];});};exports[_0x5e5b('0x39')]=function(_0x586980,_0x5f11b5){var _0x42c267=_0x5e5b('0x3a');var _0x2af6c1,_0x336261;var _0x5414f5;var _0x56324c={'encoding':'utf8','method':_0x5e5b('0x3b'),'timeout':0x2710,'url':_0x42c267,'headers':{'Content-Type':_0x5e5b('0x3c')},'body':_0x5e5b('0x3d')+encodeURIComponent(JSON[_0x5e5b('0x3e')]([[[_0x5e5b('0x3f'),JSON[_0x5e5b('0x3e')]([_0x586980,_0x5f11b5||'en',![],_0x5e5b('0x40')]),null,_0x5e5b('0x41')]]]))};return rp(_0x56324c)[_0x5e5b('0x2c')](function(_0xf3346e){try{_0x5414f5=eval(_0xf3346e[_0x5e5b('0x42')](0x5))[0x0][0x2];}catch(_0x4d816b){throw new Error(_0x5e5b('0x43')+_0xf3346e[_0x5e5b('0x22')]);}if(!_0x5414f5){if(_0x586980[_0x5e5b('0x44')]>0xc8){throw new Error(_0x5e5b('0x45'));}else{throw new Error(_0x5e5b('0x46')+_0x5f11b5+_0x5e5b('0x47'));}}try{_0x5414f5=eval(_0x5414f5)[0x0];}catch(_0xdcae23){throw new Error(_0x5e5b('0x43')+res[_0x5e5b('0x22')]);}const _0x15dfab=_0x5414f5;_0x2af6c1=path[_0x5e5b('0x26')](__dirname,_0x5e5b('0x27'),rs[_0x5e5b('0x28')](0x4)+_0x5e5b('0x48'));fs[_0x5e5b('0x2a')](_0x2af6c1,_0x5414f5,{'encoding':'base64'});_0x336261=path[_0x5e5b('0x26')](__dirname,_0x5e5b('0x27'),rs['generate'](0x4)+_0x5e5b('0x29'));return convertFile(_0x2af6c1,_0x336261);})[_0x5e5b('0x2c')](function(){try{fs['unlink'](_0x2af6c1);fs[_0x5e5b('0x35')](_0x336261,_0x5e5b('0x36'));}catch(_0x5d6ebf){logger[_0x5e5b('0x1e')](_0x5d6ebf);}logger['info'](_0x5e5b('0x49'),_0x336261[_0x5e5b('0x38')]('.')[0x0]);return _0x336261[_0x5e5b('0x38')]('.')[0x0];});};exports[_0x5e5b('0x4a')]=function(_0x133f31,_0x5a0d2f,_0x34c422){return google[_0x5e5b('0x4b')](_0x133f31,_0x5a0d2f,_0x34c422)[_0x5e5b('0x2c')](function(_0x3aa65c){logger[_0x5e5b('0x1b')](_0x3aa65c['uri']);return rp(_0x3aa65c);})[_0x5e5b('0x2c')](function(_0xb835e5){var _0xbfbd26='';var _0x497179=0x0;try{fs['unlink'](_0x133f31);}catch(_0x20d5f2){logger[_0x5e5b('0x1e')](_0x20d5f2);}if(_0xb835e5&&_0xb835e5[_0x5e5b('0x4c')]){_0xbfbd26=_0xb835e5[_0x5e5b('0x4c')][_0x5e5b('0x4d')](function(_0x2ae8da){return _0x2ae8da&&_0x2ae8da['alternatives'][0x0]&&_0x2ae8da[_0x5e5b('0x4e')][0x0]['transcript']?_0x2ae8da[_0x5e5b('0x4e')][0x0][_0x5e5b('0x4f')]:'';})[_0x5e5b('0x50')]('\x0a');_0x497179=_0xb835e5[_0x5e5b('0x4c')][_0x5e5b('0x4d')](function(_0x39f18a){return _0x39f18a&&_0x39f18a[_0x5e5b('0x4e')][0x0]&&_0x39f18a[_0x5e5b('0x4e')][0x0][_0x5e5b('0x51')]?_0x39f18a[_0x5e5b('0x4e')][0x0]['confidence']:0x0;})[_0x5e5b('0x50')]('\x0a');}logger['info']('googleASR\x20transcription',_0xbfbd26);logger[_0x5e5b('0x1b')](_0x5e5b('0x52'),_0x497179);return{'transcript':_0xbfbd26,'confidence':_0x497179};})[_0x5e5b('0x53')](function(_0x4209af){logger[_0x5e5b('0x1e')](_0x5e5b('0x54'),_0x4209af[_0x5e5b('0x16')],_0x4209af[_0x5e5b('0x55')],_0x4209af[_0x5e5b('0x56')]);});};exports[_0x5e5b('0x57')]=function(_0x56bb81,_0x20ed65,_0x22a93e,_0x4c77a4){var _0x5e9989=apiai(_0x20ed65,{'language':_0x4c77a4||'en'});return _0x5e9989['textRequest'](_0x22a93e,{'sessionId':md5(_0x56bb81)})[_0x5e5b('0x2c')](function(_0x4e6b8c){logger['info'](JSON['stringify'](_0x4e6b8c));return{'source':_0x4e6b8c[_0x5e5b('0x58')][_0x5e5b('0x59')],'resolvedQuery':_0x4e6b8c['result'][_0x5e5b('0x5a')],'action':_0x4e6b8c[_0x5e5b('0x58')][_0x5e5b('0x5b')],'actionIncomplete':_0x4e6b8c[_0x5e5b('0x58')][_0x5e5b('0x5c')],'speech':_0x4e6b8c[_0x5e5b('0x58')][_0x5e5b('0x5d')][_0x5e5b('0x5e')],'score':_0x4e6b8c[_0x5e5b('0x58')]['score'],'statusCode':_0x4e6b8c[_0x5e5b('0x5f')][_0x5e5b('0x60')],'endConversation':_0x4e6b8c[_0x5e5b('0x58')][_0x5e5b('0x61')][_0x5e5b('0x62')]||![],'isFallbackIntent':_0x4e6b8c['result'][_0x5e5b('0x61')][_0x5e5b('0x63')]};});};exports['googleDialogflowV2']=function(_0x18f989,_0x3cae83,_0x30e8d2,_0x39bc6f,_0x1fd09a,_0xb08635){var _0x11c21a=_0x39bc6f[_0x5e5b('0x64')](/\\n/g,'\x0a');var _0xb9519a={'credentials':{'private_key':_0x11c21a,'client_email':_0x30e8d2}};var _0x235c65=new dialogflow[(_0x5e5b('0x65'))](_0xb9519a);var _0x542176=_0x235c65[_0x5e5b('0x66')](_0x3cae83,md5(_0x18f989));var _0x9239c={'session':_0x542176,'queryInput':{'text':{'text':_0x1fd09a,'languageCode':_0xb08635}}};return _0x235c65[_0x5e5b('0x67')](_0x9239c)[_0x5e5b('0x2c')](function(_0x20673c){if(_0x20673c&&_0x20673c['length']){logger[_0x5e5b('0x1b')](_0x5e5b('0x68'),JSON['stringify'](_0x20673c));var _0x458fae=_0x20673c[0x0];if(_0x458fae){var _0x5d6443={'action':_0x458fae[_0x5e5b('0x69')][_0x5e5b('0x5b')],'allRequiredParamsPresent':_0x458fae[_0x5e5b('0x69')][_0x5e5b('0x6a')],'endConversation':_0x458fae[_0x5e5b('0x69')]['diagnosticInfo']&&_0x458fae[_0x5e5b('0x69')][_0x5e5b('0x6b')][_0x5e5b('0x6c')]?_0x458fae[_0x5e5b('0x69')][_0x5e5b('0x6b')]['fields'][_0x5e5b('0x6d')][_0x5e5b('0x6e')]:![],'fulfillmentText':_0x458fae[_0x5e5b('0x69')]['fulfillmentText'],'intentName':_0x458fae[_0x5e5b('0x69')]['intent']['name'],'intentDisplayName':_0x458fae[_0x5e5b('0x69')][_0x5e5b('0x6f')][_0x5e5b('0x70')],'isFallbackIntent':_0x458fae[_0x5e5b('0x69')][_0x5e5b('0x6f')][_0x5e5b('0x71')],'languageCode':_0x458fae[_0x5e5b('0x69')]['languageCode'],'queryText':_0x458fae['queryResult']['queryText'],'responseId':_0x458fae[_0x5e5b('0x72')],'score':_0x458fae[_0x5e5b('0x69')][_0x5e5b('0x73')],'speech':_0x458fae[_0x5e5b('0x69')][_0x5e5b('0x74')],'providerResponse':JSON[_0x5e5b('0x3e')](_0x20673c)};return _0x5d6443;}}});};exports['tildeASR']=function(_0x34acbf,_0x32e684,_0x28af07,_0x256613){return tilde[_0x5e5b('0x4b')](_0x34acbf,_0x32e684,_0x28af07,_0x256613)[_0x5e5b('0x2c')](function(_0x4376ca){try{fs[_0x5e5b('0x2d')](_0x34acbf);}catch(_0x14a609){logger[_0x5e5b('0x1e')](_0x14a609);}logger[_0x5e5b('0x1b')](_0x5e5b('0x75'),_0x4376ca[_0x5e5b('0x4f')]);logger[_0x5e5b('0x1b')](_0x5e5b('0x76'),_0x4376ca[_0x5e5b('0x51')]);return _0x4376ca;});};exports['awsPolly']=function(_0x593571,_0x50471a,_0x4a81fc,_0x45cb44,_0x5be4d8,_0x4e0b49){var _0x495173=path['resolve'](__dirname,'tmp',rs[_0x5e5b('0x28')](0x4)+_0x5e5b('0x48'));var _0x12a161;return aws[_0x5e5b('0x77')](_0x593571,_0x50471a,_0x4a81fc,_0x45cb44,_0x5be4d8,_0x4e0b49,_0x495173)[_0x5e5b('0x2c')](function(){_0x12a161=path['resolve'](__dirname,_0x5e5b('0x27'),rs[_0x5e5b('0x28')](0x4)+_0x5e5b('0x29'));return convertFile(_0x495173,_0x12a161);})[_0x5e5b('0x2c')](function(){try{fs[_0x5e5b('0x2d')](_0x495173);fs[_0x5e5b('0x35')](_0x12a161,_0x5e5b('0x36'));}catch(_0x3355f0){logger[_0x5e5b('0x1e')](_0x3355f0);}return _0x12a161[_0x5e5b('0x38')]('.')[0x0];});};exports[_0x5e5b('0x78')]=function(_0xbe2338,_0x5871db,_0x30c471,_0x196c86,_0x16eef8,_0x50a4d1){return aws[_0x5e5b('0x79')](_0xbe2338,_0x5871db,_0x30c471,_0x196c86,_0x16eef8,_0x50a4d1)[_0x5e5b('0x2c')](function(_0x1a5d19){logger[_0x5e5b('0x1b')](JSON[_0x5e5b('0x3e')](_0x1a5d19));return _0x1a5d19;});};exports[_0x5e5b('0x7a')]=function(_0x3c9a07,_0x4154a7,_0x5b0adb,_0x1a9489){var _0x4a7f67=util['format'](_0x5e5b('0x7b'),ISPEECH_API,_0x3c9a07,encodeURIComponent(_0x4154a7),_0x5b0adb,_0x1a9489);var _0x14d050=path[_0x5e5b('0x26')](__dirname,_0x5e5b('0x27'),rs[_0x5e5b('0x28')](0x4)+_0x5e5b('0x48'));var _0x5a0779;return downloadFile(_0x4a7f67,_0x14d050)[_0x5e5b('0x2c')](function(){_0x5a0779=path[_0x5e5b('0x26')](__dirname,'tmp',rs[_0x5e5b('0x28')](0x4)+'.wav');return convertFile(_0x14d050,_0x5a0779);})[_0x5e5b('0x2c')](function(){try{fs[_0x5e5b('0x2d')](_0x14d050);fs[_0x5e5b('0x35')](_0x5a0779,_0x5e5b('0x36'));}catch(_0x1f16e8){logger['error'](_0x1f16e8);}return _0x5a0779[_0x5e5b('0x38')]('.')[0x0];});};exports[_0x5e5b('0x7c')]=function(_0x3bb9be,_0x43f1d0,_0xa7e5d,_0x5ac903){var _0xd2ed3=util[_0x5e5b('0x7d')]('%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s',ISPEECH_API,_0x43f1d0,_0xa7e5d,base64Encode(_0x3bb9be),_0x5ac903?util['format'](_0x5e5b('0x7e'),encodeURIComponent(_0x5ac903)):_0x5e5b('0x7f'));return uploadFile(_0xd2ed3)['then'](function(_0x24b060){return querystring['parse'](_0x24b060);});};exports[_0x5e5b('0x80')]=function(_0x9df846,_0x3e6ca3){return sestek['nda'](_0x9df846,_0x3e6ca3)['then'](function(_0x5017de){logger[_0x5e5b('0x1b')](JSON[_0x5e5b('0x3e')](_0x5017de));var _0x39ca19={'speech':_0x5017de[_0x5e5b('0x81')],'action':_0x5017de[_0x5e5b('0x82')]?_0x5017de[_0x5e5b('0x82')][_0x5e5b('0x83')]:undefined,'actiondata':_0x5017de[_0x5e5b('0x82')]?_0x5017de[_0x5e5b('0x82')]['CustomActionData']:undefined};if(_0x5017de[_0x5e5b('0x82')]&&_0x5017de['channelData']['AudioFromTts']){return base64Decode(_0x5017de['channelData']['AudioFromTts'][_0x5e5b('0x84')],path[_0x5e5b('0x26')](__dirname,_0x5e5b('0x27'),rs['generate'](0x4)+_0x5e5b('0x29')))['then'](function(_0xa2f481){_0x39ca19['audiofile']=_0xa2f481;return _0x39ca19;});}return _0x39ca19;});};exports[_0x5e5b('0x85')]=function(){return __dirname;};
\ No newline at end of file
+var _0x0dcb=['writeFileSync','base64','then','unlink','chmodSync','777','split','toString','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','MP3','POST','tmp','from','audioContent','writeFile','googleCloudTTS\x20path','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','application/x-www-form-urlencoded','f.req=','jQ1olc','stringify','text\x20length\x20limit\x20reached','lang\x20\x22','\x22\x20might\x20not\x20exist','.mp3','goggleTTS\x20path','googleASR','asr','uri','results','map','transcript','alternatives','confidence','googleASR\x20transcription','catch','[%s]\x20%s:%s','name','googleDialogflow','result','resolvedQuery','action','actionIncomplete','fulfillment','speech','score','code','metadata','endConversation','isFallbackIntent','googleDialogflowV2','SessionsClient','sessionPath','length','Dialogflow\x20V2\x20response:','queryResult','diagnosticInfo','fields','end_conversation','boolValue','fulfillmentText','intent','displayName','languageCode','queryText','responseId','intentDetectionConfidence','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','polly','awsLex','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','freeform=3','parse','sestekNDA','nda','channelData','CustomAction','CustomActionData','AudioFromTts','Data','audiofile','dirName','apiai-promise','bluebird','http','https','path','querystring','request-promise','randomstring','sox','google-tts-api','url','util','./aws','./sestek','../../../config/logger','agi','https://api.ispeech.org/api/rest','protocol','host','WHAT_EVER','get','error','\x20failed,\x20status\x20code\x20=\x20','statusCode','statusMessage','request\x20to\x20','createWriteStream','finish','info','finish\x20download\x20file','close','download\x20error','pipe','end','https:','data','transcode','wav','error\x20convert','resolve','generate','.wav'];(function(_0x1d408d,_0x2fef27){var _0x112a98=function(_0x5615a8){while(--_0x5615a8){_0x1d408d['push'](_0x1d408d['shift']());}};_0x112a98(++_0x2fef27);}(_0x0dcb,0x16b));var _0xb0dc=function(_0x3ebd38,_0x459828){_0x3ebd38=_0x3ebd38-0x0;var _0x59d797=_0x0dcb[_0x3ebd38];return _0x59d797;};'use strict';var apiai=require(_0xb0dc('0x0'));var BPromise=require(_0xb0dc('0x1'));var dialogflow=require('dialogflow');var fs=require('fs');var http=require(_0xb0dc('0x2'));var https=require(_0xb0dc('0x3'));var md5=require('md5');var path=require(_0xb0dc('0x4'));var querystring=require(_0xb0dc('0x5'));var rp=require(_0xb0dc('0x6'));var rs=require(_0xb0dc('0x7'));var sox=require(_0xb0dc('0x8'));var tts=require(_0xb0dc('0x9'));var urlParse=require(_0xb0dc('0xa'))['parse'];var util=require(_0xb0dc('0xb'));var aws=require(_0xb0dc('0xc'));var google=require('./google');var sestek=require(_0xb0dc('0xd'));var tilde=require('./tilde');var logger=require(_0xb0dc('0xe'))(_0xb0dc('0xf'));var ISPEECH_API=_0xb0dc('0x10');function downloadFile(_0x3700b3,_0x49f008){return new BPromise(function(_0x275e55,_0x31185c){var _0x218b5c=urlParse(_0x3700b3);var _0x4b9eeb=_0x218b5c[_0xb0dc('0x11')]==='https:'?https:http;var _0x3f650d={'host':_0x218b5c[_0xb0dc('0x12')],'path':_0x218b5c['path'],'headers':{'user-agent':_0xb0dc('0x13')}};_0x4b9eeb[_0xb0dc('0x14')](_0x3f650d,function(_0x13d697){if(_0x13d697['statusCode']!==0xc8){logger[_0xb0dc('0x15')]('request\x20to\x20'+_0x3700b3+_0xb0dc('0x16')+_0x13d697[_0xb0dc('0x17')]+'\x20('+_0x13d697[_0xb0dc('0x18')]+')');_0x31185c(new Error(_0xb0dc('0x19')+_0x3700b3+_0xb0dc('0x16')+_0x13d697[_0xb0dc('0x17')]+'\x20('+_0x13d697[_0xb0dc('0x18')]+')'));return;}var _0x3b1200=fs[_0xb0dc('0x1a')](_0x49f008);_0x3b1200['on'](_0xb0dc('0x1b'),function(){logger[_0xb0dc('0x1c')](_0xb0dc('0x1d'));_0x3b1200[_0xb0dc('0x1e')](_0x275e55);});_0x3b1200['on'](_0xb0dc('0x15'),function(_0x2855b9){fs['unlink'](_0x49f008);logger['error'](_0xb0dc('0x1f'),_0x2855b9);_0x31185c(_0x2855b9);});_0x13d697[_0xb0dc('0x20')](_0x3b1200);})['on'](_0xb0dc('0x15'),function(_0x4a9e01){logger['error'](_0x4a9e01);_0x31185c(_0x4a9e01);})[_0xb0dc('0x21')]();});}function uploadFile(_0x2e3383){return new BPromise(function(_0x52cb55,_0x1c7d0d){var _0x49be71=urlParse(_0x2e3383);var _0x5abfce=_0x49be71[_0xb0dc('0x11')]===_0xb0dc('0x22')?https:http;var _0x29c761={'host':_0x49be71[_0xb0dc('0x12')],'path':_0x49be71[_0xb0dc('0x4')],'headers':{'user-agent':'WHAT_EVER'}};_0x5abfce[_0xb0dc('0x14')](_0x29c761,function(_0x472c35){if(_0x472c35[_0xb0dc('0x17')]!==0xc8){_0x1c7d0d(new Error(_0xb0dc('0x19')+_0x2e3383+_0xb0dc('0x16')+_0x472c35['statusCode']+'\x20('+_0x472c35[_0xb0dc('0x18')]+')'));return;}var _0x1245b8='';_0x472c35['on'](_0xb0dc('0x23'),function(_0x5867fd){_0x1245b8+=_0x5867fd;});_0x472c35['on'](_0xb0dc('0x21'),function(){_0x52cb55(_0x1245b8);});})['on'](_0xb0dc('0x15'),function(_0x4e4b1b){_0x1c7d0d(_0x4e4b1b);})[_0xb0dc('0x21')]();});}function convertFile(_0x2250f7,_0xa0e140){return new BPromise(function(_0x3c7141,_0x2dbda5){var _0x2e134f=sox[_0xb0dc('0x24')](_0x2250f7,_0xa0e140,{'sampleRate':0x1f40,'format':_0xb0dc('0x25'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x2e134f['on'](_0xb0dc('0x15'),function(_0x1e7558){logger[_0xb0dc('0x15')](_0xb0dc('0x26'),_0x1e7558);_0x2dbda5(_0x1e7558);});_0x2e134f['on']('end',function(){logger[_0xb0dc('0x1c')]('finish\x20to\x20convert');_0x3c7141();});_0x2e134f['start']();});}function base64Decode(_0x4b5cb0,_0x19d876){var _0x2dda94=path[_0xb0dc('0x27')](__dirname,'tmp',rs[_0xb0dc('0x28')](0x4)+_0xb0dc('0x29'));fs[_0xb0dc('0x2a')](_0x2dda94,_0x4b5cb0,_0xb0dc('0x2b'));return convertFile(_0x2dda94,_0x19d876)[_0xb0dc('0x2c')](function(){try{fs[_0xb0dc('0x2d')](_0x2dda94);fs[_0xb0dc('0x2e')](_0x19d876,_0xb0dc('0x2f'));}catch(_0x443812){logger['error'](_0x443812);}return _0x19d876[_0xb0dc('0x30')]('.')[0x0];});}function base64Encode(_0x40db7b){var _0x10d24f=fs['readFileSync'](_0x40db7b);return new Buffer(_0x10d24f)[_0xb0dc('0x31')](_0xb0dc('0x2b'));}exports[_0xb0dc('0x32')]=function(_0x27cec9,_0x1cb4ba,_0x5464f6,_0x243c22,_0x5e53e7,_0x1263fe){var _0x2b6da1,_0x46fe36;var _0x24ebda=_0xb0dc('0x33');var _0x1fb3ea=_0xb0dc('0x34')+_0x27cec9;var _0xb2189f={};if(_0x1cb4ba===_0xb0dc('0x35')){_0xb2189f['input']={'ssml':_0x5464f6};}else{_0xb2189f[_0xb0dc('0x36')]={'text':_0x5464f6};};_0xb2189f['voice']={'languageCode':_0x243c22,'ssmlGender':_0x5e53e7};_0xb2189f['audioConfig']={'audioEncoding':_0xb0dc('0x37'),'sampleRateHertz':0x1f40};var _0xfb66b={'url':_0x24ebda+'text:synthesize'+_0x1fb3ea,'method':_0xb0dc('0x38'),'json':!![],'body':_0xb2189f};return rp(_0xfb66b)[_0xb0dc('0x2c')](function(_0x2f9ca9){return new BPromise(function(_0x24c8ce,_0x1f56af){_0x2b6da1=path[_0xb0dc('0x27')](__dirname,_0xb0dc('0x39'),rs[_0xb0dc('0x28')](0x4)+'.mp3');var _0x33ceb9=Buffer[_0xb0dc('0x3a')](_0x2f9ca9[_0xb0dc('0x3b')],_0xb0dc('0x2b'));return fs[_0xb0dc('0x3c')](_0x2b6da1,_0x33ceb9,function(_0x69f6af){_0x1f56af(_0x69f6af);},function(_0x999ff0){fs['chmodSync'](_0x2b6da1,'777');_0x24c8ce(_0x999ff0);});});})[_0xb0dc('0x2c')](function(_0x481ec0){_0x46fe36=path[_0xb0dc('0x27')](__dirname,_0xb0dc('0x39'),rs[_0xb0dc('0x28')](0x4)+_0xb0dc('0x29'));return convertFile(_0x2b6da1,_0x46fe36);})['then'](function(){try{fs[_0xb0dc('0x2d')](_0x2b6da1);fs[_0xb0dc('0x2e')](_0x46fe36,_0xb0dc('0x2f'));}catch(_0x5a2b62){logger[_0xb0dc('0x15')](_0x5a2b62);}logger[_0xb0dc('0x1c')](_0xb0dc('0x3d'),_0x46fe36['split']('.')[0x0]);return _0x46fe36[_0xb0dc('0x30')]('.')[0x0];});};exports[_0xb0dc('0x3e')]=function(_0xda79cf,_0x39d52d){var _0x1046ea=_0xb0dc('0x3f');var _0x1248ad,_0x272e59;var _0x598e5c;var _0x42bab5={'encoding':'utf8','method':_0xb0dc('0x38'),'timeout':0x2710,'url':_0x1046ea,'headers':{'Content-Type':_0xb0dc('0x40')},'body':_0xb0dc('0x41')+encodeURIComponent(JSON['stringify']([[[_0xb0dc('0x42'),JSON[_0xb0dc('0x43')]([_0xda79cf,_0x39d52d||'en',![],'null']),null,'generic']]]))};return rp(_0x42bab5)[_0xb0dc('0x2c')](function(_0x3e650b){try{_0x598e5c=eval(_0x3e650b['slice'](0x5))[0x0][0x2];}catch(_0x8a45c8){throw new Error('parse\x20response\x20failed:\x0a'+_0x3e650b['data']);}if(!_0x598e5c){if(_0xda79cf['length']>0xc8){throw new Error(_0xb0dc('0x44'));}else{throw new Error(_0xb0dc('0x45')+_0x39d52d+_0xb0dc('0x46'));}}try{_0x598e5c=eval(_0x598e5c)[0x0];}catch(_0x2ca514){throw new Error('parse\x20response\x20failed:\x0a'+res[_0xb0dc('0x23')]);}const _0x1682f3=_0x598e5c;_0x1248ad=path[_0xb0dc('0x27')](__dirname,'tmp',rs[_0xb0dc('0x28')](0x4)+_0xb0dc('0x47'));fs[_0xb0dc('0x2a')](_0x1248ad,_0x598e5c,{'encoding':_0xb0dc('0x2b')});_0x272e59=path['resolve'](__dirname,_0xb0dc('0x39'),rs[_0xb0dc('0x28')](0x4)+_0xb0dc('0x29'));return convertFile(_0x1248ad,_0x272e59);})['then'](function(){try{fs['unlink'](_0x1248ad);fs[_0xb0dc('0x2e')](_0x272e59,_0xb0dc('0x2f'));}catch(_0x5dffb7){logger[_0xb0dc('0x15')](_0x5dffb7);}logger['info'](_0xb0dc('0x48'),_0x272e59[_0xb0dc('0x30')]('.')[0x0]);return _0x272e59[_0xb0dc('0x30')]('.')[0x0];});};exports[_0xb0dc('0x49')]=function(_0x11b420,_0x131be6,_0x1ea579){return google[_0xb0dc('0x4a')](_0x11b420,_0x131be6,_0x1ea579)['then'](function(_0xe4ceba){logger[_0xb0dc('0x1c')](_0xe4ceba[_0xb0dc('0x4b')]);return rp(_0xe4ceba);})[_0xb0dc('0x2c')](function(_0x1f66c0){var _0x19f7db='';var _0x41c1ea=0x0;try{fs[_0xb0dc('0x2d')](_0x11b420);}catch(_0x1ebd85){logger[_0xb0dc('0x15')](_0x1ebd85);}if(_0x1f66c0&&_0x1f66c0[_0xb0dc('0x4c')]){_0x19f7db=_0x1f66c0['results'][_0xb0dc('0x4d')](function(_0x110c2e){return _0x110c2e&&_0x110c2e['alternatives'][0x0]&&_0x110c2e['alternatives'][0x0][_0xb0dc('0x4e')]?_0x110c2e[_0xb0dc('0x4f')][0x0][_0xb0dc('0x4e')]:'';})['join']('\x0a');_0x41c1ea=_0x1f66c0['results']['map'](function(_0x592eb8){return _0x592eb8&&_0x592eb8[_0xb0dc('0x4f')][0x0]&&_0x592eb8[_0xb0dc('0x4f')][0x0]['confidence']?_0x592eb8[_0xb0dc('0x4f')][0x0][_0xb0dc('0x50')]:0x0;})['join']('\x0a');}logger[_0xb0dc('0x1c')](_0xb0dc('0x51'),_0x19f7db);logger[_0xb0dc('0x1c')]('googleASR\x20confidence',_0x41c1ea);return{'transcript':_0x19f7db,'confidence':_0x41c1ea};})[_0xb0dc('0x52')](function(_0x264d9e){logger[_0xb0dc('0x15')](_0xb0dc('0x53'),_0x264d9e[_0xb0dc('0x17')],_0x264d9e[_0xb0dc('0x54')],_0x264d9e['message']);});};exports[_0xb0dc('0x55')]=function(_0x3a093c,_0x3be01e,_0x16581d,_0x3e020e){var _0x3b49a6=apiai(_0x3be01e,{'language':_0x3e020e||'en'});return _0x3b49a6['textRequest'](_0x16581d,{'sessionId':md5(_0x3a093c)})[_0xb0dc('0x2c')](function(_0x4934b8){logger[_0xb0dc('0x1c')](JSON[_0xb0dc('0x43')](_0x4934b8));return{'source':_0x4934b8[_0xb0dc('0x56')]['source'],'resolvedQuery':_0x4934b8[_0xb0dc('0x56')][_0xb0dc('0x57')],'action':_0x4934b8[_0xb0dc('0x56')][_0xb0dc('0x58')],'actionIncomplete':_0x4934b8[_0xb0dc('0x56')][_0xb0dc('0x59')],'speech':_0x4934b8['result'][_0xb0dc('0x5a')][_0xb0dc('0x5b')],'score':_0x4934b8[_0xb0dc('0x56')][_0xb0dc('0x5c')],'statusCode':_0x4934b8['status'][_0xb0dc('0x5d')],'endConversation':_0x4934b8[_0xb0dc('0x56')][_0xb0dc('0x5e')][_0xb0dc('0x5f')]||![],'isFallbackIntent':_0x4934b8[_0xb0dc('0x56')][_0xb0dc('0x5e')][_0xb0dc('0x60')]};});};exports[_0xb0dc('0x61')]=function(_0x1cbf70,_0x25bda5,_0x361558,_0x2c8052,_0xc662e3,_0x5bbf20){var _0x22a4c4=_0x2c8052['replace'](/\\n/g,'\x0a');var _0x1afdfa={'credentials':{'private_key':_0x22a4c4,'client_email':_0x361558}};var _0x4641a4=new dialogflow[(_0xb0dc('0x62'))](_0x1afdfa);var _0x451c1d=_0x4641a4[_0xb0dc('0x63')](_0x25bda5,md5(_0x1cbf70));var _0x45a584={'session':_0x451c1d,'queryInput':{'text':{'text':_0xc662e3,'languageCode':_0x5bbf20}}};return _0x4641a4['detectIntent'](_0x45a584)[_0xb0dc('0x2c')](function(_0x4f20e7){if(_0x4f20e7&&_0x4f20e7[_0xb0dc('0x64')]){logger['info'](_0xb0dc('0x65'),JSON['stringify'](_0x4f20e7));var _0x175111=_0x4f20e7[0x0];if(_0x175111){var _0x30c7dd={'action':_0x175111[_0xb0dc('0x66')][_0xb0dc('0x58')],'allRequiredParamsPresent':_0x175111[_0xb0dc('0x66')]['allRequiredParamsPresent'],'endConversation':_0x175111['queryResult']['diagnosticInfo']&&_0x175111[_0xb0dc('0x66')][_0xb0dc('0x67')]['fields']?_0x175111[_0xb0dc('0x66')][_0xb0dc('0x67')][_0xb0dc('0x68')][_0xb0dc('0x69')][_0xb0dc('0x6a')]:![],'fulfillmentText':_0x175111[_0xb0dc('0x66')][_0xb0dc('0x6b')],'intentName':_0x175111[_0xb0dc('0x66')][_0xb0dc('0x6c')]['name'],'intentDisplayName':_0x175111[_0xb0dc('0x66')]['intent'][_0xb0dc('0x6d')],'isFallbackIntent':_0x175111[_0xb0dc('0x66')][_0xb0dc('0x6c')]['isFallback'],'languageCode':_0x175111['queryResult'][_0xb0dc('0x6e')],'queryText':_0x175111['queryResult'][_0xb0dc('0x6f')],'responseId':_0x175111[_0xb0dc('0x70')],'score':_0x175111[_0xb0dc('0x66')][_0xb0dc('0x71')],'speech':_0x175111['queryResult'][_0xb0dc('0x6b')],'providerResponse':JSON[_0xb0dc('0x43')](_0x4f20e7)};return _0x30c7dd;}}});};exports[_0xb0dc('0x72')]=function(_0x450361,_0x3629b8,_0x13b5a0,_0x18f577){return tilde[_0xb0dc('0x4a')](_0x450361,_0x3629b8,_0x13b5a0,_0x18f577)['then'](function(_0x188aca){try{fs['unlink'](_0x450361);}catch(_0x411a96){logger['error'](_0x411a96);}logger[_0xb0dc('0x1c')](_0xb0dc('0x73'),_0x188aca[_0xb0dc('0x4e')]);logger[_0xb0dc('0x1c')](_0xb0dc('0x74'),_0x188aca['confidence']);return _0x188aca;});};exports[_0xb0dc('0x75')]=function(_0xc724b6,_0x5b103d,_0x4f159f,_0x21c587,_0x19180a,_0x1d4b5b){var _0x461b96=path[_0xb0dc('0x27')](__dirname,_0xb0dc('0x39'),rs[_0xb0dc('0x28')](0x4)+_0xb0dc('0x47'));var _0x4ef643;return aws[_0xb0dc('0x76')](_0xc724b6,_0x5b103d,_0x4f159f,_0x21c587,_0x19180a,_0x1d4b5b,_0x461b96)[_0xb0dc('0x2c')](function(){_0x4ef643=path[_0xb0dc('0x27')](__dirname,_0xb0dc('0x39'),rs[_0xb0dc('0x28')](0x4)+_0xb0dc('0x29'));return convertFile(_0x461b96,_0x4ef643);})[_0xb0dc('0x2c')](function(){try{fs[_0xb0dc('0x2d')](_0x461b96);fs[_0xb0dc('0x2e')](_0x4ef643,_0xb0dc('0x2f'));}catch(_0x35499b){logger['error'](_0x35499b);}return _0x4ef643[_0xb0dc('0x30')]('.')[0x0];});};exports[_0xb0dc('0x77')]=function(_0x397aa4,_0x18b1d9,_0x520f31,_0x3ce760,_0x5c8825,_0x1a9cce){return aws['lex'](_0x397aa4,_0x18b1d9,_0x520f31,_0x3ce760,_0x5c8825,_0x1a9cce)[_0xb0dc('0x2c')](function(_0x29a1b0){logger[_0xb0dc('0x1c')](JSON[_0xb0dc('0x43')](_0x29a1b0));return _0x29a1b0;});};exports[_0xb0dc('0x78')]=function(_0x271d59,_0x4fc0c1,_0x1c38da,_0xa04e2e){var _0x143602=util[_0xb0dc('0x79')](_0xb0dc('0x7a'),ISPEECH_API,_0x271d59,encodeURIComponent(_0x4fc0c1),_0x1c38da,_0xa04e2e);var _0x2b12a0=path[_0xb0dc('0x27')](__dirname,'tmp',rs['generate'](0x4)+'.mp3');var _0x21ebda;return downloadFile(_0x143602,_0x2b12a0)[_0xb0dc('0x2c')](function(){_0x21ebda=path[_0xb0dc('0x27')](__dirname,_0xb0dc('0x39'),rs['generate'](0x4)+_0xb0dc('0x29'));return convertFile(_0x2b12a0,_0x21ebda);})['then'](function(){try{fs['unlink'](_0x2b12a0);fs[_0xb0dc('0x2e')](_0x21ebda,_0xb0dc('0x2f'));}catch(_0xcd1fe8){logger[_0xb0dc('0x15')](_0xcd1fe8);}return _0x21ebda[_0xb0dc('0x30')]('.')[0x0];});};exports[_0xb0dc('0x7b')]=function(_0x57573a,_0x2cb918,_0x53cbdf,_0x3a20b9){var _0x15ce8b=util[_0xb0dc('0x79')]('%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s',ISPEECH_API,_0x2cb918,_0x53cbdf,base64Encode(_0x57573a),_0x3a20b9?util[_0xb0dc('0x79')]('model=%s',encodeURIComponent(_0x3a20b9)):_0xb0dc('0x7c'));return uploadFile(_0x15ce8b)[_0xb0dc('0x2c')](function(_0x57f972){return querystring[_0xb0dc('0x7d')](_0x57f972);});};exports[_0xb0dc('0x7e')]=function(_0x333bd2,_0x295fcb){return sestek[_0xb0dc('0x7f')](_0x333bd2,_0x295fcb)['then'](function(_0x5bd355){logger[_0xb0dc('0x1c')](JSON[_0xb0dc('0x43')](_0x5bd355));var _0x2078ea={'speech':_0x5bd355['text'],'action':_0x5bd355['channelData']?_0x5bd355[_0xb0dc('0x80')][_0xb0dc('0x81')]:undefined,'actiondata':_0x5bd355[_0xb0dc('0x80')]?_0x5bd355['channelData'][_0xb0dc('0x82')]:undefined};if(_0x5bd355[_0xb0dc('0x80')]&&_0x5bd355[_0xb0dc('0x80')][_0xb0dc('0x83')]){return base64Decode(_0x5bd355['channelData'][_0xb0dc('0x83')][_0xb0dc('0x84')],path['resolve'](__dirname,_0xb0dc('0x39'),rs[_0xb0dc('0x28')](0x4)+_0xb0dc('0x29')))[_0xb0dc('0x2c')](function(_0x28b57c){_0x2078ea[_0xb0dc('0x85')]=_0x28b57c;return _0x2078ea;});}return _0x2078ea;});};exports[_0xb0dc('0x86')]=function(){return __dirname;};
\ No newline at end of file
index 5c723f2..e7eae17 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa256=['./nda','exports'];(function(_0x46361e,_0x243aaf){var _0x14e302=function(_0x9ebecf){while(--_0x9ebecf){_0x46361e['push'](_0x46361e['shift']());}};_0x14e302(++_0x243aaf);}(_0xa256,0xf6));var _0x6a25=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xa256[_0x3b380d];return _0x54502b;};var nda=require(_0x6a25('0x0'));module[_0x6a25('0x1')]={'nda':nda};
\ No newline at end of file
+var _0x0e5c=['./nda'];(function(_0x54d058,_0x34c39a){var _0x748135=function(_0x5bfe11){while(--_0x5bfe11){_0x54d058['push'](_0x54d058['shift']());}};_0x748135(++_0x34c39a);}(_0x0e5c,0x1d3));var _0xc0e5=function(_0x4ab99,_0x219ed2){_0x4ab99=_0x4ab99-0x0;var _0x29e39c=_0x0e5c[_0x4ab99];return _0x29e39c;};var nda=require(_0xc0e5('0x0'));module['exports']={'nda':nda};
\ No newline at end of file
index e394faf..5a699ae 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd61e=['ndagenerate_audio','audio/wav','custom_action','custom_action_data','info','request-promise','url','../../../../../config/logger','agi','exports','POST','resolve','ndauth_url','/token','password','username','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','calleridname','dnid','project','body','channelData','ProjectName'];(function(_0x5e8c8c,_0x2edd7e){var _0x2bed65=function(_0x35681a){while(--_0x35681a){_0x5e8c8c['push'](_0x5e8c8c['shift']());}};_0x2bed65(++_0x2edd7e);}(_0xd61e,0x13d));var _0xed61=function(_0x1570c0,_0x5a21e8){_0x1570c0=_0x1570c0-0x0;var _0x2ae577=_0xd61e[_0x1570c0];return _0x2ae577;};'use strict';var rp=require(_0xed61('0x0'));var url=require(_0xed61('0x1'));var logger=require(_0xed61('0x2'))(_0xed61('0x3'));module[_0xed61('0x4')]=function(_0x22d436,_0x5ae3f8){var _0x123e01={'method':_0xed61('0x5'),'uri':url[_0xed61('0x6')](_0x5ae3f8[_0xed61('0x7')],_0xed61('0x8')),'form':{'grant_type':_0xed61('0x9'),'username':_0x5ae3f8[_0xed61('0xa')],'password':_0x5ae3f8['password']},'json':!![]};return rp(_0x123e01)['then'](function(_0x59ef0e){var _0x5cbbd7={'method':'POST','uri':url[_0xed61('0x6')](_0x5ae3f8[_0xed61('0xb')],_0xed61('0xc')),'body':{'type':_0x5ae3f8[_0xed61('0xd')]||_0xed61('0xe'),'channelId':'Nda','conversation':{'id':_0x22d436['uniqueid']},'from':{'id':_0x22d436['callerid'],'name':_0x22d436[_0xed61('0xf')]},'recipient':{'id':_0x22d436[_0xed61('0x10')],'name':_0x22d436['extension']},'text':_0x5ae3f8['text'],'channelData':{}},'headers':{'Authorization':'Bearer\x20'+_0x59ef0e['access_token']},'json':!![]};if(_0x5ae3f8[_0xed61('0x11')]){_0x5cbbd7[_0xed61('0x12')][_0xed61('0x13')][_0xed61('0x14')]=_0x5ae3f8['project'];}if(_0x5ae3f8[_0xed61('0x15')]=='1'){_0x5cbbd7[_0xed61('0x12')][_0xed61('0x13')]['AudioOutputSettings']={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0xed61('0x16')};}if(_0x5ae3f8[_0xed61('0x17')]){_0x5cbbd7[_0xed61('0x12')][_0xed61('0x13')]['CustomAction']=_0x5ae3f8[_0xed61('0x17')];if(_0x5ae3f8[_0xed61('0x18')]){_0x5cbbd7[_0xed61('0x12')][_0xed61('0x13')]['CustomActionData']=_0x5ae3f8[_0xed61('0x18')];}}logger[_0xed61('0x19')](JSON['stringify'](_0x5cbbd7));return rp(_0x5cbbd7);});};
\ No newline at end of file
+var _0x2504=['../../../../../config/logger','agi','exports','POST','resolve','ndauth_url','/token','username','ndassistant_url','ndaactivity_type','Nda','uniqueid','calleridname','text','Bearer\x20','access_token','project','body','ProjectName','ndagenerate_audio','channelData','AudioOutputSettings','custom_action','CustomAction','custom_action_data','CustomActionData','info','stringify','request-promise','url'];(function(_0x59edca,_0x15dd30){var _0x4634c2=function(_0x2b8fe1){while(--_0x2b8fe1){_0x59edca['push'](_0x59edca['shift']());}};_0x4634c2(++_0x15dd30);}(_0x2504,0xee));var _0x4250=function(_0x5a7c6d,_0x3fe94d){_0x5a7c6d=_0x5a7c6d-0x0;var _0x4d6cc6=_0x2504[_0x5a7c6d];return _0x4d6cc6;};'use strict';var rp=require(_0x4250('0x0'));var url=require(_0x4250('0x1'));var logger=require(_0x4250('0x2'))(_0x4250('0x3'));module[_0x4250('0x4')]=function(_0x67c47b,_0x41d71d){var _0x320d79={'method':_0x4250('0x5'),'uri':url[_0x4250('0x6')](_0x41d71d[_0x4250('0x7')],_0x4250('0x8')),'form':{'grant_type':'password','username':_0x41d71d[_0x4250('0x9')],'password':_0x41d71d['password']},'json':!![]};return rp(_0x320d79)['then'](function(_0x370998){var _0x477312={'method':_0x4250('0x5'),'uri':url[_0x4250('0x6')](_0x41d71d[_0x4250('0xa')],'/api/NaturalDialogAssistant/v1/Run'),'body':{'type':_0x41d71d[_0x4250('0xb')]||'message','channelId':_0x4250('0xc'),'conversation':{'id':_0x67c47b[_0x4250('0xd')]},'from':{'id':_0x67c47b['callerid'],'name':_0x67c47b[_0x4250('0xe')]},'recipient':{'id':_0x67c47b['dnid'],'name':_0x67c47b['extension']},'text':_0x41d71d[_0x4250('0xf')],'channelData':{}},'headers':{'Authorization':_0x4250('0x10')+_0x370998[_0x4250('0x11')]},'json':!![]};if(_0x41d71d[_0x4250('0x12')]){_0x477312[_0x4250('0x13')]['channelData'][_0x4250('0x14')]=_0x41d71d[_0x4250('0x12')];}if(_0x41d71d[_0x4250('0x15')]=='1'){_0x477312[_0x4250('0x13')][_0x4250('0x16')][_0x4250('0x17')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':'audio/wav'};}if(_0x41d71d[_0x4250('0x18')]){_0x477312[_0x4250('0x13')][_0x4250('0x16')][_0x4250('0x19')]=_0x41d71d[_0x4250('0x18')];if(_0x41d71d[_0x4250('0x1a')]){_0x477312[_0x4250('0x13')]['channelData'][_0x4250('0x1b')]=_0x41d71d[_0x4250('0x1a')];}}logger[_0x4250('0x1c')](JSON[_0x4250('0x1d')](_0x477312));return rp(_0x477312);});};
\ No newline at end of file
index 59125b9..b441a13 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xde16=['./lib/api','exports'];(function(_0x5f8483,_0x5be60b){var _0x3ead4d=function(_0x449e65){while(--_0x449e65){_0x5f8483['push'](_0x5f8483['shift']());}};_0x3ead4d(++_0x5be60b);}(_0xde16,0x108));var _0x6de1=function(_0x45a317,_0x50839b){_0x45a317=_0x45a317-0x0;var _0x38fa33=_0xde16[_0x45a317];return _0x38fa33;};'use strict';var asr=require(_0x6de1('0x0'));module[_0x6de1('0x1')]=function(_0x3b7557,_0x36ea3b,_0x26f3f6,_0x50d133){return asr(_0x3b7557,_0x36ea3b,_0x26f3f6,_0x50d133);};
\ No newline at end of file
+var _0x0243=['./lib/api','exports'];(function(_0xc4a8ce,_0x594f53){var _0x536fc2=function(_0x4a39d9){while(--_0x4a39d9){_0xc4a8ce['push'](_0xc4a8ce['shift']());}};_0x536fc2(++_0x594f53);}(_0x0243,0x17c));var _0x3024=function(_0xbaf497,_0x1b5105){_0xbaf497=_0xbaf497-0x0;var _0x34fd88=_0x0243[_0xbaf497];return _0x34fd88;};'use strict';var asr=require(_0x3024('0x0'));module[_0x3024('0x1')]=function(_0x1c3344,_0x282d7f,_0x19f9d5,_0x1e35f3){return asr(_0x1c3344,_0x282d7f,_0x19f9d5,_0x1e35f3);};
\ No newline at end of file
index 7a56957..6618ea6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf362=['bluebird','lodash','moment','crypto','../../../../../../config/logger','info','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','sha1','update','digest','unix','send','stringify','createReadStream','data','close','error','Tilde\x20ASR\x20send\x20error','terminate','parse','status','result','Tilde\x20ASR\x20hypoteses','transcript','likelihood','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isObject','open'];(function(_0x4cb5a8,_0x3a517a){var _0x447cdd=function(_0x191531){while(--_0x191531){_0x4cb5a8['push'](_0x4cb5a8['shift']());}};_0x447cdd(++_0x3a517a);}(_0xf362,0xfc));var _0x2f36=function(_0x3f5067,_0x9a2065){_0x3f5067=_0x3f5067-0x0;var _0x47a199=_0xf362[_0x3f5067];return _0x47a199;};'use strict';var BPromise=require(_0x2f36('0x0'));var _=require(_0x2f36('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x2f36('0x2'));var crypto=require(_0x2f36('0x3'));var logger=require(_0x2f36('0x4'))('agi');module['exports']=function(_0x5eddf4,_0x488444,_0x509dcd,_0x26e476){return new BPromise(function(_0xe5d3bc,_0x526ca1){logger[_0x2f36('0x5')]('Tilde\x20URI',_0x26e476||_0x2f36('0x6'));var _0x27b70a=new WebSocket(_0x26e476||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE',{'perMessageDeflate':![]});var _0x4e2a3e='';var _0x417eac='0';var _0x242f04='1';var _0x2d0de0=_0x2f36('0x7');function _0x53a116(_0x57f04c){var _0x34fa43=crypto[_0x2f36('0x8')](_0x2f36('0x9'));_0x34fa43[_0x2f36('0xa')](_0x57f04c);return _0x34fa43[_0x2f36('0xb')]('hex');}function _0x1267c9(){try{logger['info']('Open\x20Tilde\x20ASR\x20socket');var _0x37f868=moment()[_0x2f36('0xc')]();var _0x395a9c=_0x53a116(_0x37f868+_0x488444+_0x509dcd);_0x27b70a[_0x2f36('0xd')](JSON[_0x2f36('0xe')]({'appID':_0x488444,'timestamp':_0x37f868,'appKey':_0x395a9c}));var _0x333b4e=fs[_0x2f36('0xf')](_0x5eddf4);_0x333b4e['on'](_0x2f36('0x10'),function(_0x2e6f8f){_0x27b70a[_0x2f36('0xd')](_0x2e6f8f);});_0x333b4e['on'](_0x2f36('0x11'),function(){_0x27b70a[_0x2f36('0xd')]('EOS');});}catch(_0x153db8){logger[_0x2f36('0x12')](_0x2f36('0x13'),JSON[_0x2f36('0xe')](_0x153db8));_0x27b70a[_0x2f36('0x14')]();}}function _0x26259a(_0x3f786b){try{if(_0x3f786b){var _0x55defb=JSON[_0x2f36('0x15')](_0x3f786b);switch(_0x55defb[_0x2f36('0x16')]){case 0x0:if(_0x55defb[_0x2f36('0x17')]){if(_0x55defb[_0x2f36('0x17')]['final']){logger[_0x2f36('0x5')](_0x2f36('0x18'),JSON['stringify'](_0x55defb['result']['hypotheses']));_0x4e2a3e=_0x55defb[_0x2f36('0x17')]['hypotheses'][0x0][_0x2f36('0x19')];_0x417eac=_0x55defb[_0x2f36('0x17')]['hypotheses'][0x0][_0x2f36('0x1a')];_0x242f04='0';_0x2d0de0='Success.';_0x27b70a[_0x2f36('0x14')]();}}break;case 0x1:logger[_0x2f36('0x5')](_0x2f36('0x7'));_0x242f04='1';_0x2d0de0='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';break;case 0x2:logger[_0x2f36('0x5')](_0x2f36('0x1b'));_0x242f04='2';_0x2d0de0=_0x2f36('0x1b');break;case 0x9:logger[_0x2f36('0x5')](_0x2f36('0x1c'));_0x242f04='9';_0x2d0de0=_0x2f36('0x1c');break;case 0xa:logger[_0x2f36('0x5')](_0x2f36('0x1d'));_0x242f04='10';_0x2d0de0=_0x2f36('0x1d');break;case 0xb:logger[_0x2f36('0x5')](_0x2f36('0x1e'));_0x242f04='11';_0x2d0de0=_0x2f36('0x1e');}}}catch(_0x559db6){logger[_0x2f36('0x12')](_0x2f36('0x1f'),JSON[_0x2f36('0xe')](_0x559db6));_0x27b70a[_0x2f36('0x14')]();}}function _0x352902(){logger[_0x2f36('0x5')](_0x2f36('0x20'));_0xe5d3bc({'transcript':_0x4e2a3e,'confidence':_0x417eac,'status':_0x242f04,'status_message':_0x2d0de0});}function _0x33f819(_0x493828){logger[_0x2f36('0x12')](_0x2f36('0x21'));if(!_['isNil'](_0x493828)){logger[_0x2f36('0x12')](_[_0x2f36('0x22')](_0x493828)?JSON[_0x2f36('0xe')](_0x493828):_0x493828);}}_0x27b70a['on'](_0x2f36('0x23'),_0x1267c9);_0x27b70a['on']('message',_0x26259a);_0x27b70a['on']('close',_0x352902);_0x27b70a['on'](_0x2f36('0x12'),_0x33f819);});};
\ No newline at end of file
+var _0xe78c=['send','stringify','createReadStream','data','close','EOS','error','Tilde\x20ASR\x20send\x20error','terminate','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','likelihood','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','open','message','bluebird','lodash','moment','crypto','../../../../../../config/logger','agi','exports','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','sha1','update','digest','info','Open\x20Tilde\x20ASR\x20socket','unix'];(function(_0x33e315,_0x27cec9){var _0x206675=function(_0x331afb){while(--_0x331afb){_0x33e315['push'](_0x33e315['shift']());}};_0x206675(++_0x27cec9);}(_0xe78c,0x123));var _0xce78=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xe78c[_0x40a045];return _0x1a687c;};'use strict';var BPromise=require(_0xce78('0x0'));var _=require(_0xce78('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xce78('0x2'));var crypto=require(_0xce78('0x3'));var logger=require(_0xce78('0x4'))(_0xce78('0x5'));module[_0xce78('0x6')]=function(_0x8b6d69,_0x18a873,_0x259048,_0x3700c1){return new BPromise(function(_0x3a6d3d,_0x11c048){logger['info'](_0xce78('0x7'),_0x3700c1||_0xce78('0x8'));var _0x175e51=new WebSocket(_0x3700c1||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE',{'perMessageDeflate':![]});var _0x202eea='';var _0x5962de='0';var _0x531c3e='1';var _0x3c88a1=_0xce78('0x9');function _0x35eca4(_0x44fb60){var _0x1ebeba=crypto[_0xce78('0xa')](_0xce78('0xb'));_0x1ebeba[_0xce78('0xc')](_0x44fb60);return _0x1ebeba[_0xce78('0xd')]('hex');}function _0xf88972(){try{logger[_0xce78('0xe')](_0xce78('0xf'));var _0x43c70e=moment()[_0xce78('0x10')]();var _0x1e6e0f=_0x35eca4(_0x43c70e+_0x18a873+_0x259048);_0x175e51[_0xce78('0x11')](JSON[_0xce78('0x12')]({'appID':_0x18a873,'timestamp':_0x43c70e,'appKey':_0x1e6e0f}));var _0x574040=fs[_0xce78('0x13')](_0x8b6d69);_0x574040['on'](_0xce78('0x14'),function(_0x15114d){_0x175e51[_0xce78('0x11')](_0x15114d);});_0x574040['on'](_0xce78('0x15'),function(){_0x175e51['send'](_0xce78('0x16'));});}catch(_0x346978){logger[_0xce78('0x17')](_0xce78('0x18'),JSON['stringify'](_0x346978));_0x175e51[_0xce78('0x19')]();}}function _0x275253(_0x1435d8){try{if(_0x1435d8){var _0x5aa4c4=JSON['parse'](_0x1435d8);switch(_0x5aa4c4['status']){case 0x0:if(_0x5aa4c4[_0xce78('0x1a')]){if(_0x5aa4c4[_0xce78('0x1a')][_0xce78('0x1b')]){logger['info'](_0xce78('0x1c'),JSON['stringify'](_0x5aa4c4[_0xce78('0x1a')][_0xce78('0x1d')]));_0x202eea=_0x5aa4c4[_0xce78('0x1a')][_0xce78('0x1d')][0x0][_0xce78('0x1e')];_0x5962de=_0x5aa4c4[_0xce78('0x1a')][_0xce78('0x1d')][0x0][_0xce78('0x1f')];_0x531c3e='0';_0x3c88a1=_0xce78('0x20');_0x175e51['terminate']();}}break;case 0x1:logger[_0xce78('0xe')](_0xce78('0x9'));_0x531c3e='1';_0x3c88a1='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';break;case 0x2:logger['info'](_0xce78('0x21'));_0x531c3e='2';_0x3c88a1=_0xce78('0x21');break;case 0x9:logger[_0xce78('0xe')](_0xce78('0x22'));_0x531c3e='9';_0x3c88a1=_0xce78('0x22');break;case 0xa:logger[_0xce78('0xe')](_0xce78('0x23'));_0x531c3e='10';_0x3c88a1=_0xce78('0x23');break;case 0xb:logger[_0xce78('0xe')](_0xce78('0x24'));_0x531c3e='11';_0x3c88a1=_0xce78('0x24');}}}catch(_0x1dc05d){logger[_0xce78('0x17')](_0xce78('0x25'),JSON[_0xce78('0x12')](_0x1dc05d));_0x175e51[_0xce78('0x19')]();}}function _0x3b60f7(){logger[_0xce78('0xe')](_0xce78('0x26'));_0x3a6d3d({'transcript':_0x202eea,'confidence':_0x5962de,'status':_0x531c3e,'status_message':_0x3c88a1});}function _0x19a4cf(_0x4ff0e9){logger['error'](_0xce78('0x27'));if(!_[_0xce78('0x28')](_0x4ff0e9)){logger[_0xce78('0x17')](_[_0xce78('0x29')](_0x4ff0e9)?JSON[_0xce78('0x12')](_0x4ff0e9):_0x4ff0e9);}}_0x175e51['on'](_0xce78('0x2a'),_0xf88972);_0x175e51['on'](_0xce78('0x2b'),_0x275253);_0x175e51['on'](_0xce78('0x15'),_0x3b60f7);_0x175e51['on'](_0xce78('0x17'),_0x19a4cf);});};
\ No newline at end of file
index 750059f..a94d812 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x534c=['exports','./asr'];(function(_0x3500fe,_0x2ffd3a){var _0x3b0cc7=function(_0x5eddd0){while(--_0x5eddd0){_0x3500fe['push'](_0x3500fe['shift']());}};_0x3b0cc7(++_0x2ffd3a);}(_0x534c,0xa7));var _0xc534=function(_0x1f197f,_0x4c9393){_0x1f197f=_0x1f197f-0x0;var _0x2f6efc=_0x534c[_0x1f197f];return _0x2f6efc;};var asr=require(_0xc534('0x0'));module[_0xc534('0x1')]={'asr':asr};
\ No newline at end of file
+var _0x8e3b=['exports','./asr'];(function(_0x3deefd,_0x1c02b7){var _0x5ef1a1=function(_0x3f279b){while(--_0x3f279b){_0x3deefd['push'](_0x3deefd['shift']());}};_0x5ef1a1(++_0x1c02b7);}(_0x8e3b,0x113));var _0xb8e3=function(_0x21d383,_0x71056d){_0x21d383=_0x21d383-0x0;var _0x3ea4a5=_0x8e3b[_0x21d383];return _0x3ea4a5;};var asr=require(_0xb8e3('0x0'));module[_0xb8e3('0x1')]={'asr':asr};
\ No newline at end of file
index ef26095..fb7bc45 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x34e2=['E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','ready','connection','code','close','exports','./channel','127.0.0.1','error','E_AGI_ARGUMENT_PORT','listening','emit'];(function(_0x35d2ea,_0x3950dd){var _0x3e0269=function(_0x4fdee5){while(--_0x4fdee5){_0x35d2ea['push'](_0x35d2ea['shift']());}};_0x3e0269(++_0x3950dd);}(_0x34e2,0x13c));var _0x234e=function(_0x46d238,_0x27dbbb){_0x46d238=_0x46d238-0x0;var _0x2f845e=_0x34e2[_0x46d238];return _0x2f845e;};'use strict';var util=require('util');var net=require('net');var EventEmitter=require('events')['EventEmitter'];var AGIError=require('./error');var AGIChannel=require(_0x234e('0x0'));var AGIServer=function(_0x1688f8,_0x664060,_0x31f37d){var _0x28a1b6=this,_0x1688f8=_0x1688f8||0x11dd,_0x664060=_0x664060||_0x234e('0x1'),_0x19fcef=null,_0x232d47=0x0;EventEmitter['call'](_0x28a1b6);function _0x291b4d(){if(!_0x1688f8){_0x28a1b6['emit'](_0x234e('0x2'),new AGIError(_0x234e('0x3')));return![];}_0x19fcef=net['createServer']();_0x19fcef['listen'](_0x1688f8,_0x664060);_0x19fcef['on'](_0x234e('0x4'),function(){_0x28a1b6[_0x234e('0x5')]('listening');});_0x19fcef['on']('connection',function(_0x3eceeb){_0x19fcef['getConnections'](function(_0x4ba5c4,_0x212f83){if(_0x4ba5c4){_0x28a1b6[_0x234e('0x5')](_0x234e('0x2'),new AGIError(_0x234e('0x6'),_0x4ba5c4));}else if(_0x31f37d&&_0x31f37d<0x0){_0x28a1b6['emit']('error',new AGIError(_0x234e('0x7')));_0x3eceeb['destroy']();}else if(_0x31f37d&&_0x31f37d>0x0&&_0x31f37d<_0x212f83){_0x232d47+=0x1;_0x28a1b6[_0x234e('0x5')](_0x234e('0x2'),new AGIError('E_AGI_SERVER_MAXCONNECTION',_0x232d47));_0x3eceeb[_0x234e('0x8')]();}else{var _0x3c5c48=new AGIChannel(_0x3eceeb);_0x3c5c48['on'](_0x234e('0x9'),function(){_0x28a1b6[_0x234e('0x5')](_0x234e('0xa'),_0x3c5c48);});}});});_0x19fcef['on'](_0x234e('0x2'),function(_0x1d2443){_0x28a1b6[_0x234e('0x5')](_0x234e('0x2'),new AGIError(_0x234e('0x6'),_0x1d2443[_0x234e('0xb')]));});_0x19fcef['on'](_0x234e('0xc'),function(){_0x28a1b6[_0x234e('0x5')](_0x234e('0xc'),new AGIError('E_AGI_SERVER_CLOSE'));});}process['nextTick'](function(){_0x291b4d();});};util['inherits'](AGIServer,EventEmitter);module[_0x234e('0xd')]=function(_0x1043b3,_0x2298a1,_0xd35726){return new AGIServer(_0x1043b3,_0x2298a1,_0xd35726);};
\ No newline at end of file
+var _0x2d7e=['getConnections','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','ready','E_AGI_SERVER_ERROR','close','E_AGI_SERVER_CLOSE','nextTick','exports','util','net','events','EventEmitter','./error','./channel','127.0.0.1','call','emit','error','E_AGI_ARGUMENT_PORT','listening','connection'];(function(_0x1fae3c,_0x5bc218){var _0x55b8c6=function(_0x5e901f){while(--_0x5e901f){_0x1fae3c['push'](_0x1fae3c['shift']());}};_0x55b8c6(++_0x5bc218);}(_0x2d7e,0x66));var _0xe2d7=function(_0x2601b4,_0x315e78){_0x2601b4=_0x2601b4-0x0;var _0x3e3661=_0x2d7e[_0x2601b4];return _0x3e3661;};'use strict';var util=require(_0xe2d7('0x0'));var net=require(_0xe2d7('0x1'));var EventEmitter=require(_0xe2d7('0x2'))[_0xe2d7('0x3')];var AGIError=require(_0xe2d7('0x4'));var AGIChannel=require(_0xe2d7('0x5'));var AGIServer=function(_0xffd08c,_0x66c598,_0x254e2b){var _0x79a65=this,_0xffd08c=_0xffd08c||0x11dd,_0x66c598=_0x66c598||_0xe2d7('0x6'),_0x24ff6b=null,_0x175ee5=0x0;EventEmitter[_0xe2d7('0x7')](_0x79a65);function _0x15d51c(){if(!_0xffd08c){_0x79a65[_0xe2d7('0x8')](_0xe2d7('0x9'),new AGIError(_0xe2d7('0xa')));return![];}_0x24ff6b=net['createServer']();_0x24ff6b['listen'](_0xffd08c,_0x66c598);_0x24ff6b['on'](_0xe2d7('0xb'),function(){_0x79a65[_0xe2d7('0x8')](_0xe2d7('0xb'));});_0x24ff6b['on'](_0xe2d7('0xc'),function(_0xdd334f){_0x24ff6b[_0xe2d7('0xd')](function(_0x539b7e,_0x239fd9){if(_0x539b7e){_0x79a65[_0xe2d7('0x8')]('error',new AGIError('E_AGI_SERVER_ERROR',_0x539b7e));}else if(_0x254e2b&&_0x254e2b<0x0){_0x79a65[_0xe2d7('0x8')](_0xe2d7('0x9'),new AGIError(_0xe2d7('0xe')));_0xdd334f[_0xe2d7('0xf')]();}else if(_0x254e2b&&_0x254e2b>0x0&&_0x254e2b<_0x239fd9){_0x175ee5+=0x1;_0x79a65[_0xe2d7('0x8')](_0xe2d7('0x9'),new AGIError(_0xe2d7('0x10'),_0x175ee5));_0xdd334f[_0xe2d7('0xf')]();}else{var _0x2388d8=new AGIChannel(_0xdd334f);_0x2388d8['on'](_0xe2d7('0x11'),function(){_0x79a65[_0xe2d7('0x8')]('connection',_0x2388d8);});}});});_0x24ff6b['on'](_0xe2d7('0x9'),function(_0x48a7d5){_0x79a65['emit'](_0xe2d7('0x9'),new AGIError(_0xe2d7('0x12'),_0x48a7d5['code']));});_0x24ff6b['on'](_0xe2d7('0x13'),function(){_0x79a65[_0xe2d7('0x8')](_0xe2d7('0x13'),new AGIError(_0xe2d7('0x14')));});}process[_0xe2d7('0x15')](function(){_0x15d51c();});};util['inherits'](AGIServer,EventEmitter);module[_0xe2d7('0x16')]=function(_0x26b8cf,_0x114d12,_0x74257b){return new AGIServer(_0x26b8cf,_0x114d12,_0x74257b);};
\ No newline at end of file
index 16395ab..94b1e1d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x80df=['internal','%s/%s@from-sip/n','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','timeout','includes','POST','toUpperCase','body','rawBody','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','render','stringify','statusCode','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','client_email','dialogflowV2_language','sestekNDA','ispeechTTS','ispeech_tts_language','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','aws_polly_voice','Amy','aws_text_type','awsLex','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appsecret','uri','clear','clone','hasOwnProperty','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','isPlainObject','saveRestApiResult','isArray','length','%s.%s','setVariable','split','replaceAll','getAndSetVariable','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','extra','maxRetry','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','MRCPSynth','result','Executed\x20command\x20MRCPSynth\x20%s','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','no\x20grammar\x20configured','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','Enter\x20in\x20CALLBACK\x20(%s)\x20block','delay','add','minutes','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','Executed\x20command\x20%s\x20%s','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','no\x20text\x20configured','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','MRCPRecog','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','no\x20odbc\x20database\x20found','no\x20query\x20configured','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','forEach','%s[%s][%s]','%s_ROWS_COUNT','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','no\x20user\x20selected','no\x20user\x20found','DIAL','opts','Executed\x20command\x20%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','DIALOGFLOW_%s','out','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','dialogflowV2_project_id','no\x20client_email\x20configured','no\x20private_key\x20configured','Trying\x20DialogflowV2:\x20%s','googleDialogflowV2','providerResponse','speech','DialogflowV2\x20Result\x20%s','sesteknda','ndauth_url','no\x20ndauth\x20url\x20configured','no\x20username\x20configured','password','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','audiofile','streamFile','.wav','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','no\x20trunk\x20found','trunk_name','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','retry','file_id','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','getData','response','maxdigit','test','mindigit','hiddendigitsnum','hiddendigitspos','first','substr','generate','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','goalname','GOAL\x20%s','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','Trying\x20Amazon\x20Lex:\x20%s','isString','AWS_LEX_%s','message','amazonlex','Amazon\x20Lex\x20Result\x20%s','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','recordFile','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','no\x20appsecret\x20configured','wav','%s/recordings/%s','NOBEEP','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','gotoif','condition','no\x20condition\x20configured','true','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','beep','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','unlink','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','FIND\x20AGENT\x20%s\x20BY\x20%s','findBy','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','Enter\x20in\x20LOGOUT\x20(%s)\x20block','no\x20find\x20by\x20configured','math','Enter\x20in\x20MATH\x20(%s)\x20block','no\x20operation\x20configured','math\x20%s','operation','no\x20variable\x20found','%s[%s]','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','output','pause','getPause','pause_id','agentPause','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','no\x20queue\x20found','indexOf','toLowerCase','QUEUE','macro','gosub','position','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','Response:','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','200','%s_STATUS_MESSAGE','statusMessage','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','number','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','Smtp','no\x20mail\x20account\x20found','email','bcc','subject','template_id','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','smtpOptions','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','yes','Answer','Skipped\x20Answer','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','127.0.0.1','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','mailbox','VOICEMAIL','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','no\x20variable\x20selected','join','exports','util','lodash','shelljs','odbc','moment','mustache','request-promise','../../config/logger','agi','../../config/environment','../../config/environment/shared','./scripts','/var/opt/motion2/server/files','rawHeaders','menu','getdigits','getsecretdigits','channel','rpc','mailRpc','prototype','getVariable','name','getVoiceQueue','getVoiceQueueById','then','catch','getSquareProject','getSquareProjectById','getSquareOdbc','dsn','getUser','getUserById','getTrunkById','getSound','getSoundById','getSoundPath','save_name','getMailAccount','sendMailMessage','getIntervals','IntervalId','interval','map','Intervals','format','%s/sounds/converted/%s','getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','query','Error\x20executing\x20query\x20%s','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','agicommand','arg_1','callerid','createSquareRecording','calleridname','context','extension','priority','dnid','file','createSquareMessage','createCmContact','isEmpty','callback_','random','lastName','isNil','phone','list_id','scheduledAt','callback','Callback\x20scheduled\x20at\x20','toString','callback_priority','agentUnpause','agent','agentLogout','agentLogin'];(function(_0x273c39,_0x1052e6){var _0x46d6b5=function(_0x44f1fb){while(--_0x44f1fb){_0x273c39['push'](_0x273c39['shift']());}};_0x46d6b5(++_0x1052e6);}(_0x80df,0x17e));var _0xf80d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x80df[_0x321bb2];return _0x9c12ed;};'use strict';var fs=require('fs');var util=require(_0xf80d('0x0'));var _=require(_0xf80d('0x1'));var sh=require(_0xf80d('0x2'));var odbc=require(_0xf80d('0x3'))();var rs=require('randomstring');var moment=require(_0xf80d('0x4'));var Mustache=require(_0xf80d('0x5'));var rp=require(_0xf80d('0x6'));var logger=require(_0xf80d('0x7'))(_0xf80d('0x8'));var config=require(_0xf80d('0x9'));var shared=require(_0xf80d('0xa'));var scripts=require(_0xf80d('0xb'));var FILES_PATH=_0xf80d('0xc');var recursiveMapAttributes=[_0xf80d('0xd'),'rawBody'];var verticesWithRetry=[_0xf80d('0xe'),_0xf80d('0xf'),_0xf80d('0x10')];var AGIVertices=function(_0x15fa69,_0x215035,_0x186339){this[_0xf80d('0x11')]=_0x15fa69;this[_0xf80d('0x12')]=_0x215035;this[_0xf80d('0x13')]=_0x186339;};AGIVertices[_0xf80d('0x14')][_0xf80d('0x15')]=function(_0x1987de,_0x24bebe){this[_0xf80d('0x12')]['getVariableById'](_0x1987de)['then'](function(_0x2ad8a7){_0x24bebe(null,_0x2ad8a7?_0x2ad8a7[_0xf80d('0x16')]:![]);})['catch'](function(_0x34e130){_0x24bebe(_0x34e130);});};AGIVertices['prototype'][_0xf80d('0x17')]=function(_0x56fb71,_0x4285de){this['rpc'][_0xf80d('0x18')](_0x56fb71)[_0xf80d('0x19')](function(_0x369609){_0x4285de(null,_0x369609?_0x369609[_0xf80d('0x16')]:![]);})[_0xf80d('0x1a')](function(_0x45751c){_0x4285de(_0x45751c);});};AGIVertices[_0xf80d('0x14')][_0xf80d('0x1b')]=function(_0x3db0e7,_0x3b8a82){this[_0xf80d('0x12')][_0xf80d('0x1c')](_0x3db0e7)[_0xf80d('0x19')](function(_0x1d104a){_0x3b8a82(null,_0x1d104a?_0x1d104a[_0xf80d('0x16')]:![]);})[_0xf80d('0x1a')](function(_0x7ba89c){_0x3b8a82(_0x7ba89c);});};AGIVertices[_0xf80d('0x14')][_0xf80d('0x1d')]=function(_0x5392c5,_0x440aab){this[_0xf80d('0x12')]['getSquareOdbcById'](_0x5392c5)[_0xf80d('0x19')](function(_0x539c80){_0x440aab(null,_0x539c80?_0x539c80[_0xf80d('0x1e')]:![]);})[_0xf80d('0x1a')](function(_0x2d5e46){_0x440aab(_0x2d5e46);});};AGIVertices[_0xf80d('0x14')][_0xf80d('0x1f')]=function(_0x25d031,_0x446153){this[_0xf80d('0x12')][_0xf80d('0x20')](_0x25d031)[_0xf80d('0x19')](function(_0x33d58c){_0x446153(null,_0x33d58c?_0x33d58c[_0xf80d('0x16')]:![]);})['catch'](function(_0x32ad42){_0x446153(_0x32ad42);});};AGIVertices[_0xf80d('0x14')]['getTrunk']=function(_0x3353a3,_0x1d0b43){this[_0xf80d('0x12')][_0xf80d('0x21')](_0x3353a3)['then'](function(_0x79142a){_0x1d0b43(null,_0x79142a?_0x79142a[_0xf80d('0x16')]:![]);})[_0xf80d('0x1a')](function(_0x2a4597){_0x1d0b43(_0x2a4597);});};AGIVertices[_0xf80d('0x14')][_0xf80d('0x22')]=function(_0x2fc429,_0x68f2c6){var _0x162fb4=this;this['rpc'][_0xf80d('0x23')](_0x2fc429)[_0xf80d('0x19')](function(_0x3e2c8c){_0x68f2c6(null,_0x3e2c8c?_0x162fb4[_0xf80d('0x24')](_0x3e2c8c[_0xf80d('0x25')]):![]);})[_0xf80d('0x1a')](function(_0x401cfb){_0x68f2c6(_0x401cfb);});};AGIVertices['prototype'][_0xf80d('0x26')]=function(_0x27887e,_0x214bff){this[_0xf80d('0x12')]['getMailAccountById'](_0x27887e)['then'](function(_0x2359f1){_0x214bff(null,_0x2359f1?_0x2359f1:![]);})['catch'](function(_0x29793b){_0x214bff(_0x29793b);});};AGIVertices[_0xf80d('0x14')][_0xf80d('0x27')]=function(_0x5aea6e,_0x3c7fb9,_0x314585){this['mailRpc'][_0xf80d('0x27')](_0x5aea6e,_0x3c7fb9)[_0xf80d('0x19')](function(){_0x314585(null);})[_0xf80d('0x1a')](function(_0x5e8f0e){_0x314585(_0x5e8f0e);});};AGIVertices[_0xf80d('0x14')][_0xf80d('0x28')]=function(_0x3d8bbc,_0x3c36f6){this[_0xf80d('0x12')]['getIntervalById'](_0x3d8bbc)[_0xf80d('0x19')](function(_0x5eb7bb){if(_0x5eb7bb){if(_0x5eb7bb[_0xf80d('0x29')]){_0x3c36f6(null,[_0x5eb7bb[_0xf80d('0x2a')]]);}else{_0x3c36f6(null,_[_0xf80d('0x2b')](_0x5eb7bb[_0xf80d('0x2c')],'interval'));}}else{_0x3c36f6(null,![]);}})[_0xf80d('0x1a')](function(_0x35a7a0){_0x3c36f6(_0x35a7a0);});};AGIVertices[_0xf80d('0x14')][_0xf80d('0x24')]=function(_0x4e9d80){return util[_0xf80d('0x2d')](_0xf80d('0x2e'),FILES_PATH,_0x4e9d80);};AGIVertices[_0xf80d('0x14')][_0xf80d('0x2f')]=function(_0x1f7c18,_0x39f970,_0x35039f){odbc[_0xf80d('0x30')](_0x1f7c18,function(_0x503b42){if(_0x503b42){logger[_0xf80d('0x31')](_0xf80d('0x32'),_0x503b42);_0x35039f(_0x503b42);}else{logger[_0xf80d('0x33')]('ODBC\x20connection\x20successfully');odbc[_0xf80d('0x34')](_0x39f970,function(_0x47cd14,_0x224d14){if(_0x47cd14){logger[_0xf80d('0x33')](_0xf80d('0x35'),_0x39f970);_0x35039f(_0x47cd14);}else{logger[_0xf80d('0x33')]('Query\x20executed\x20correctly\x20%s',_0x39f970);odbc['close'](function(_0x5a3f99){if(_0x5a3f99){logger[_0xf80d('0x31')](_0xf80d('0x36'),_0x5a3f99);}_0x35039f(null,_0x224d14);});}});}});};AGIVertices[_0xf80d('0x14')][_0xf80d('0x37')]=function(_0x651863,_0x100dc7){this['rpc'][_0xf80d('0x38')](_0x651863)[_0xf80d('0x19')](function(_0x7ada46){_0x100dc7(null,_0x7ada46?_0x7ada46:![]);})['catch'](function(_0x14314a){_0x100dc7(_0x14314a);});};AGIVertices['prototype'][_0xf80d('0x39')]=function(_0x3afdcb,_0x151cdb){this[_0xf80d('0x12')][_0xf80d('0x39')](_0x3afdcb)[_0xf80d('0x19')](function(_0x2d2a2b){_0x151cdb(null,_0x2d2a2b);})[_0xf80d('0x1a')](function(_0x99e531){_0x151cdb(_0x99e531);});};AGIVertices[_0xf80d('0x14')][_0xf80d('0x3a')]=function(_0x437e44,_0x1a68fb,_0x1e78f1){this[_0xf80d('0x12')][_0xf80d('0x3a')]({'uniqueid':this[_0xf80d('0x11')][_0xf80d('0x3b')],'node':_0x437e44[_0xf80d('0x3c')],'application':_0x437e44[_0xf80d('0x3d')],'data':_0x1a68fb||null,'project_name':this[_0xf80d('0x11')][_0xf80d('0x3e')],'callerid':this[_0xf80d('0x11')][_0xf80d('0x3f')]})[_0xf80d('0x19')](function(_0x5c859c){if(_0x1e78f1){_0x1e78f1(null,_0x5c859c);}})[_0xf80d('0x1a')](function(_0x1791db){if(_0x1e78f1){_0x1e78f1(_0x1791db);}});};AGIVertices[_0xf80d('0x14')][_0xf80d('0x40')]=function(_0x2fbbe5,_0x558c24,_0x1bacb3,_0x26a848){this[_0xf80d('0x12')][_0xf80d('0x40')]({'uniqueid':this[_0xf80d('0x11')][_0xf80d('0x3b')],'callerid':this[_0xf80d('0x11')][_0xf80d('0x3f')],'calleridname':this[_0xf80d('0x11')][_0xf80d('0x41')],'context':this[_0xf80d('0x11')][_0xf80d('0x42')],'extension':this[_0xf80d('0x11')][_0xf80d('0x43')],'priority':this[_0xf80d('0x11')][_0xf80d('0x44')],'accountcode':this[_0xf80d('0x11')]['accountcode'],'dnid':this[_0xf80d('0x11')][_0xf80d('0x45')],'projectName':this[_0xf80d('0x11')]['arg_1'],'saveName':_0x558c24,'filename':_0x2fbbe5[_0xf80d('0x46')]||_0x558c24,'savePath':_0x1bacb3})[_0xf80d('0x19')](function(_0x51e367){_0x26a848(null,_0x51e367);})['catch'](function(_0x1e5cad){_0x26a848(_0x1e5cad);});};AGIVertices['prototype'][_0xf80d('0x47')]=function(_0x24c70e,_0x31b135,_0x26fcee,_0x45f8cd,_0x217ed2){this[_0xf80d('0x12')][_0xf80d('0x47')]({'uniqueid':this[_0xf80d('0x11')][_0xf80d('0x3b')],'body':_0x24c70e,'direction':_0x31b135,'providerName':_0x26fcee,'providerResponse':_0x45f8cd})[_0xf80d('0x19')](function(_0x27a78b){if(_0x217ed2){_0x217ed2(null,_0x27a78b);}})['catch'](function(_0x1f220d){if(_0x217ed2){_0x217ed2(_0x1f220d);}});};AGIVertices[_0xf80d('0x14')][_0xf80d('0x48')]=function(_0x5c3c41,_0x34305b){this[_0xf80d('0x12')]['createCmContact']({'firstName':_[_0xf80d('0x49')](_0x5c3c41[_0xf80d('0x16')])||_['isNil'](_0x5c3c41[_0xf80d('0x16')])?_0xf80d('0x4a')+Math[_0xf80d('0x4b')]():_0x5c3c41[_0xf80d('0x16')],'lastName':_['isEmpty'](_0x5c3c41[_0xf80d('0x4c')])||_[_0xf80d('0x4d')](_0x5c3c41[_0xf80d('0x4c')])?null:_0x5c3c41['lastName'],'phone':_0x5c3c41[_0xf80d('0x4e')],'ListId':_0x5c3c41[_0xf80d('0x4f')],'scheduledat':_0x5c3c41[_0xf80d('0x50')],'callbackUniqueid':this[_0xf80d('0x11')][_0xf80d('0x3b')],'tags':_0xf80d('0x51'),'description':_0xf80d('0x52')+_0x5c3c41[_0xf80d('0x50')][_0xf80d('0x53')](),'priority':_0x5c3c41[_0xf80d('0x54')]})['then'](function(_0x112342){_0x34305b(null,_0x112342);})[_0xf80d('0x1a')](function(_0x4501f4){_0x34305b(_0x4501f4);});};AGIVertices[_0xf80d('0x14')]['getPause']=function(_0x51b8ce,_0x2e2273){this[_0xf80d('0x12')]['getPauseById'](_0x51b8ce)[_0xf80d('0x19')](function(_0x38f2ec){_0x2e2273(null,_0x38f2ec?_0x38f2ec[_0xf80d('0x16')]:![]);})[_0xf80d('0x1a')](function(_0x4d3e67){_0x2e2273(_0x4d3e67);});};AGIVertices[_0xf80d('0x14')]['agentPause']=function(_0x4339f8,_0x540214,_0x1d30a7){var _0x4933ba={'role':'agent'};_0x4933ba[_0x4339f8]=this[_0xf80d('0x11')][_0xf80d('0x3f')];this['rpc']['agentPause'](_0x4933ba,_0x540214,this[_0xf80d('0x11')][_0xf80d('0x3b')])[_0xf80d('0x19')](function(_0x2ee28c){_0x1d30a7(null,_[_0xf80d('0x4d')](_0x2ee28c)?![]:!![]);})[_0xf80d('0x1a')](function(_0x20a325){logger[_0xf80d('0x31')](_0x20a325);_0x1d30a7(null,![]);});};AGIVertices['prototype'][_0xf80d('0x55')]=function(_0x5e8c88,_0x246d1d){var _0x4f7670={'role':_0xf80d('0x56')};_0x4f7670[_0x5e8c88]=this[_0xf80d('0x11')]['callerid'];this[_0xf80d('0x12')][_0xf80d('0x55')](_0x4f7670)[_0xf80d('0x19')](function(_0x51f3aa){_0x246d1d(null,_[_0xf80d('0x4d')](_0x51f3aa)?![]:!![]);})[_0xf80d('0x1a')](function(_0x38fe01){logger['error'](_0x38fe01);_0x246d1d(null,![]);});};AGIVertices['prototype'][_0xf80d('0x57')]=function(_0x2457b3,_0x4a57b9){var _0x222306={'role':'agent'};_0x222306[_0x2457b3]=this[_0xf80d('0x11')][_0xf80d('0x3f')];this[_0xf80d('0x12')]['agentLogout'](_0x222306)[_0xf80d('0x19')](function(_0x422daa){_0x4a57b9(null,_[_0xf80d('0x4d')](_0x422daa)?![]:!![]);})[_0xf80d('0x1a')](function(_0x24c608){logger[_0xf80d('0x31')](_0x24c608);_0x4a57b9(null,![]);});};AGIVertices[_0xf80d('0x14')][_0xf80d('0x58')]=function(_0x1e87d6,_0x3a810f){var _0x3bd5dd={'role':_0xf80d('0x56')};_0x3bd5dd[_0x1e87d6]=this['channel'][_0xf80d('0x3f')];var _0x1eb3e2=_0x1e87d6!=_0xf80d('0x59')?util['format'](_0xf80d('0x5a'),_0xf80d('0x5b'),this['channel']['callerid']):undefined;this[_0xf80d('0x12')][_0xf80d('0x58')](_0x3bd5dd,_0x1eb3e2)['then'](function(_0x285257){_0x3a810f(null,_[_0xf80d('0x4d')](_0x285257)?![]:!![]);})[_0xf80d('0x1a')](function(_0x4ea3b4){logger['error'](_0x4ea3b4);_0x3a810f(null,![]);});};AGIVertices[_0xf80d('0x14')][_0xf80d('0x5c')]=function(_0x361bbf,_0x435271){sh[_0xf80d('0x5d')](_['trim'](_0x361bbf),function(_0x37daca,_0x201e77){var _0x5bcbd9=_0x201e77[_0xf80d('0x5e')](/(\r\n|\n|\r)/gm,'');_0x435271(null,_0x5bcbd9);});};AGIVertices[_0xf80d('0x14')][_0xf80d('0x5f')]=function(_0x22bf28,_0x5a1648){scripts[_0xf80d('0x5f')](_0x22bf28[_0xf80d('0x60')],_0x22bf28[_0xf80d('0x61')]||_0xf80d('0x62'),_0x22bf28[_0xf80d('0x62')],_0x22bf28[_0xf80d('0x63')]||_0xf80d('0x64'),_0x22bf28[_0xf80d('0x65')]||_0xf80d('0x66'),_0x22bf28[_0xf80d('0x67')]||_0xf80d('0x68'))[_0xf80d('0x19')](function(_0x213868){_0x5a1648(null,_0x213868);})[_0xf80d('0x1a')](function(_0x43c68f){_0x5a1648(_0x43c68f);});};AGIVertices[_0xf80d('0x14')][_0xf80d('0x69')]=function(_0x4dd391,_0x498fb9){scripts[_0xf80d('0x69')](_0x4dd391[_0xf80d('0x62')],_0x4dd391[_0xf80d('0x6a')]||'en',0x1)[_0xf80d('0x19')](function(_0x55e759){_0x498fb9(null,_0x55e759);})[_0xf80d('0x1a')](function(_0x424ae2){_0x498fb9(_0x424ae2);});};AGIVertices[_0xf80d('0x14')][_0xf80d('0x6b')]=function(_0x4637cd,_0x1d13ad){var _0x3bf472={'uri':_0x4637cd[_0xf80d('0x6c')],'method':_0x4637cd['method'],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x4637cd[_0xf80d('0x6d')])==='number'&&parseInt(_0x4637cd[_0xf80d('0x6d')])>=0x1?parseInt(_0x4637cd[_0xf80d('0x6d')])*0x3e8:0x5*0x3e8};if(_[_0xf80d('0x6e')]([_0xf80d('0x6f'),'PUT'],_0x3bf472['method'][_0xf80d('0x70')]())){try{_0x3bf472[_0xf80d('0x71')]=_0x4637cd[_0xf80d('0x72')]?JSON[_0xf80d('0x73')](_0x4637cd['rawBody']):{};}catch(_0x36e9ad){logger[_0xf80d('0x31')](_0xf80d('0x74'),_0x36e9ad);}}try{_0x3bf472[_0xf80d('0x75')]=_0x4637cd['rawHeaders']?JSON[_0xf80d('0x73')](_0x4637cd['rawHeaders']):{};}catch(_0x297b5d){logger[_0xf80d('0x31')](_0xf80d('0x76'),_0x297b5d);}if(_0x4637cd[_0xf80d('0x77')]){try{var _0x299410=require(_0x4637cd[_0xf80d('0x77')])[_0xf80d('0x78')](this,_0x3bf472);_0x3bf472['uri']=Mustache['render'](_0x4637cd[_0xf80d('0x6c')],_0x299410,{},['$$','$$']);if(_0x3bf472[_0xf80d('0x75')]){_0x3bf472[_0xf80d('0x75')]=JSON[_0xf80d('0x73')](Mustache['render'](JSON['stringify'](_0x3bf472['headers']),_0x299410,{},['$$','$$']));}if(_0x3bf472[_0xf80d('0x71')]){_0x3bf472[_0xf80d('0x71')]=JSON[_0xf80d('0x73')](Mustache[_0xf80d('0x79')](JSON[_0xf80d('0x7a')](_0x3bf472['body']),_0x299410,{},['$$','$$']));}}catch(_0x349b81){logger[_0xf80d('0x31')]('An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function',_0x349b81);}}rp(_0x3bf472)[_0xf80d('0x19')](function(_0x3c0b8c){var _0x484b7c={'statusCode':_0x3c0b8c[_0xf80d('0x7b')]||0xc8,'statusMessage':_0x3c0b8c['statusMessage']||'OK','headers':_0x3c0b8c[_0xf80d('0x75')]||{},'body':_0x3c0b8c[_0xf80d('0x71')]||{}};_0x1d13ad(null,_0x484b7c);})[_0xf80d('0x1a')](function(_0x4f1f8d){var _0x3ce54d={'statusCode':_0x4f1f8d['statusCode']||0x1f4,'statusMessage':_0x4f1f8d['message']||_0xf80d('0x7c'),'headers':_0x4f1f8d[_0xf80d('0x7d')][_0xf80d('0x75')]||{},'body':_0x4f1f8d[_0xf80d('0x7d')][_0xf80d('0x71')]||{}};_0x1d13ad(null,_0x3ce54d);});};AGIVertices[_0xf80d('0x14')]['googleDialogflow']=function(_0x1c390d,_0x36007d){scripts[_0xf80d('0x7e')](this['channel'][_0xf80d('0x3b')],_0x1c390d[_0xf80d('0x7f')],_0x1c390d['text'],_0x1c390d['dialogflow_language']||'en')[_0xf80d('0x19')](function(_0x2f3bec){_0x36007d(null,_0x2f3bec);})[_0xf80d('0x1a')](function(_0x3ffeba){_0x36007d(_0x3ffeba);});};AGIVertices[_0xf80d('0x14')]['googleDialogflowV2']=function(_0x4b70c2,_0x488521){scripts['googleDialogflowV2'](this['channel'][_0xf80d('0x3b')],_0x4b70c2['dialogflowV2_project_id'],_0x4b70c2[_0xf80d('0x80')],_0x4b70c2['private_key'],_0x4b70c2[_0xf80d('0x62')],_0x4b70c2[_0xf80d('0x81')]||'en')[_0xf80d('0x19')](function(_0x5798b1){_0x488521(null,_0x5798b1);})[_0xf80d('0x1a')](function(_0x561fea){_0x488521(_0x561fea);});};AGIVertices[_0xf80d('0x14')]['sestekNDA']=function(_0x39850e,_0x6d5c03){scripts[_0xf80d('0x82')](this[_0xf80d('0x11')],_0x39850e)[_0xf80d('0x19')](function(_0x7d7ec1){_0x6d5c03(null,_0x7d7ec1);})[_0xf80d('0x1a')](function(_0x2d644e){_0x6d5c03(_0x2d644e);});};AGIVertices[_0xf80d('0x14')][_0xf80d('0x83')]=function(_0x24e7cb,_0x5ec1f3){scripts['ispeechTTS'](_0x24e7cb[_0xf80d('0x7f')],_0x24e7cb[_0xf80d('0x62')],_0x24e7cb[_0xf80d('0x84')]||'en-US',_0x24e7cb['speed'])['then'](function(_0x575dcf){_0x5ec1f3(null,_0x575dcf);})[_0xf80d('0x1a')](function(_0x2d93ea){_0x5ec1f3(_0x2d93ea);});};AGIVertices[_0xf80d('0x14')][_0xf80d('0x85')]=function(_0x59c063,_0x2d339a,_0x5b297a){scripts[_0xf80d('0x85')](_0x2d339a,_0x59c063[_0xf80d('0x7f')],_0x59c063[_0xf80d('0x86')]||'en-US',this[_0xf80d('0x87')](_0x59c063['model'])?_0x59c063[_0xf80d('0x88')]:undefined)['then'](function(_0x2c21c4){_0x5b297a(null,_0x2c21c4);})['catch'](function(_0x4a099e){_0x5b297a(_0x4a099e);});};AGIVertices[_0xf80d('0x14')][_0xf80d('0x89')]=function(_0x5d1fec,_0x1fc616){scripts[_0xf80d('0x89')](_0x5d1fec[_0xf80d('0x8a')],_0x5d1fec[_0xf80d('0x8b')],_0x5d1fec[_0xf80d('0x8c')],_0x5d1fec[_0xf80d('0x8d')]||_0xf80d('0x8e'),_0x5d1fec[_0xf80d('0x62')],_0x5d1fec[_0xf80d('0x8f')]||_0xf80d('0x62'))['then'](function(_0x438a3e){_0x1fc616(null,_0x438a3e);})[_0xf80d('0x1a')](function(_0x26e47b){_0x1fc616(_0x26e47b);});};AGIVertices[_0xf80d('0x14')][_0xf80d('0x90')]=function(_0x12e7b5,_0x12d6f5){scripts[_0xf80d('0x90')](this[_0xf80d('0x11')][_0xf80d('0x3b')],_0x12e7b5[_0xf80d('0x8a')],_0x12e7b5[_0xf80d('0x8b')],_0x12e7b5[_0xf80d('0x91')],_0x12e7b5[_0xf80d('0x62')],_0x12e7b5[_0xf80d('0x92')])[_0xf80d('0x19')](function(_0x4ef680){_0x12d6f5(null,_0x4ef680);})['catch'](function(_0x450149){_0x12d6f5(_0x450149);});};AGIVertices['prototype'][_0xf80d('0x93')]=function(_0x4469c4,_0x2c579d,_0x54f58c){scripts[_0xf80d('0x93')](_0x2c579d,_0x4469c4[_0xf80d('0x7f')],_0x4469c4[_0xf80d('0x94')]||'en-US')[_0xf80d('0x19')](function(_0x3e94f4){_0x54f58c(null,_0x3e94f4);})[_0xf80d('0x1a')](function(_0x247f9a){_0x54f58c(_0x247f9a);});};AGIVertices[_0xf80d('0x14')][_0xf80d('0x95')]=function(_0x3609e3,_0x189424,_0x57f7fe){scripts[_0xf80d('0x95')](_0x189424,_0x3609e3['appid'],_0x3609e3[_0xf80d('0x96')],_0x3609e3[_0xf80d('0x97')])[_0xf80d('0x19')](function(_0x555333){_0x57f7fe(null,_0x555333);})['catch'](function(_0x2999e5){_0x57f7fe(_0x2999e5);});};AGIVertices[_0xf80d('0x14')][_0xf80d('0x98')]=function(_0x3ebb56){var _0x33f617=_['includes'](verticesWithRetry,_0x3ebb56[_0xf80d('0x3d')])?_0x3ebb56:_[_0xf80d('0x99')](_0x3ebb56);for(var _0x2f74e7 in _0x33f617){if(_0x33f617[_0xf80d('0x9a')](_0x2f74e7)){if(_0x33f617[_0x2f74e7]&&_['isString'](_0x33f617[_0x2f74e7])){if(_['includes'](recursiveMapAttributes,_0x2f74e7)){_0x33f617[_0x2f74e7]=this[_0xf80d('0x9b')](_0x33f617[_0x2f74e7]);}else{_0x33f617[_0x2f74e7]=this[_0xf80d('0x9c')](_0x33f617[_0x2f74e7]);}}}}return _0x33f617;};AGIVertices['prototype'][_0xf80d('0x9d')]=function(_0x133f29){for(var _0x1d99e6 in _0x133f29){if(_0x133f29[_0xf80d('0x9a')](_0x1d99e6)){if(_[_0xf80d('0x9e')](_0x133f29[_0x1d99e6])){this['recursiveNodeIndex'](_0x133f29[_0x1d99e6]);}else if(_['isArray'](_0x133f29[_0x1d99e6])){for(var _0x3051e9=0x0;_0x3051e9<_0x133f29[_0x1d99e6]['length'];_0x3051e9++){this['recursiveNodeIndex'](_0x133f29[_0x1d99e6][_0x3051e9]);}}else if(_['isString'](_0x133f29[_0x1d99e6])){_0x133f29[_0x1d99e6]=this[_0xf80d('0x9c')](_0x133f29[_0x1d99e6]);}}}};AGIVertices[_0xf80d('0x14')][_0xf80d('0x9f')]=function(_0x3aa53f,_0x14e44f){for(var _0x34e4c1 in _0x3aa53f){if(_0x3aa53f[_0xf80d('0x9a')](_0x34e4c1)){if(_[_0xf80d('0x9e')](_0x3aa53f[_0x34e4c1])){if(!_[_0xf80d('0x49')](_0x3aa53f[_0x34e4c1])){this[_0xf80d('0x9f')](_0x3aa53f[_0x34e4c1],util['format']('%s.%s',_0x14e44f,_0x34e4c1));}}else if(_[_0xf80d('0xa0')](_0x3aa53f[_0x34e4c1])){for(var _0x2932d2=0x0;_0x2932d2<_0x3aa53f[_0x34e4c1][_0xf80d('0xa1')];_0x2932d2++){this[_0xf80d('0x9f')](_0x3aa53f[_0x34e4c1][_0x2932d2],util['format'](_0xf80d('0xa2'),_0x14e44f,_0x34e4c1+'['+_0x2932d2+']'));}}else{if(!_[_0xf80d('0x4d')](_0x3aa53f[_0x34e4c1])){this[_0xf80d('0x11')][_0xf80d('0xa3')](util[_0xf80d('0x2d')](_0xf80d('0xa2'),_0x14e44f,_0x34e4c1),_0x3aa53f[_0x34e4c1]);}}}}};AGIVertices['prototype'][_0xf80d('0x9b')]=function(_0x599409){try{var _0x996b24=JSON[_0xf80d('0x73')](_0x599409);this[_0xf80d('0x9d')](_0x996b24);return JSON[_0xf80d('0x7a')](_0x996b24);}catch(_0x1932af){return this['replaceAllVariables'](_0x599409);}};AGIVertices[_0xf80d('0x14')][_0xf80d('0x9c')]=function(_0x2fcc5c){var _0x2fc1ec=_0x2fcc5c[_0xf80d('0xa4')]('{');for(var _0x1a2196=0x1;_0x1a2196<_0x2fc1ec[_0xf80d('0xa1')];_0x1a2196+=0x1){var _0x45b948=_0x2fc1ec[_0x1a2196][_0xf80d('0xa4')]('}');if(_0x45b948[_0xf80d('0xa1')]>0x1){_0x2fcc5c=_0x2fcc5c[_0xf80d('0xa5')]('{'+_0x45b948[0x0]+'}',this['channel'][_0xf80d('0x15')](_0x45b948[0x0])['extra']||_0x45b948[0x0]);}}if(_0x2fc1ec[_0xf80d('0xa1')]===0x1){return _0x2fcc5c['toString']();}return this[_0xf80d('0x9c')](_0x2fcc5c);};AGIVertices[_0xf80d('0x14')][_0xf80d('0xa6')]=function(_0x3493c7,_0x540e1d){var _0x41ff3b=this[_0xf80d('0x11')][_0xf80d('0x15')](_0x3493c7);if(_0x41ff3b['result']===-0x1){return _0x41ff3b;}logger[_0xf80d('0x33')](util['format'](_0xf80d('0xa7'),_0x540e1d,_0x41ff3b[_0xf80d('0xa8')]));return this[_0xf80d('0x11')][_0xf80d('0xa3')](_0x540e1d,_0x41ff3b[_0xf80d('0xa8')]);};AGIVertices['prototype'][_0xf80d('0x87')]=function(_0x544b5b){return _0x544b5b&&_0x544b5b!=='0'&&_0x544b5b!=='-1'&&_0x544b5b!=='';};AGIVertices[_0xf80d('0x14')][_0xf80d('0xa9')]=function(_0x5a80fe){this[_0xf80d('0x3a')][_0xf80d('0x78')](this,_0x5a80fe,'-');_0x5a80fe['retry']=_0x5a80fe[_0xf80d('0xa9')];return{'code':0xc8,'result':'-'};};AGIVertices[_0xf80d('0x14')]['mrcpsynth']=function(_0x24e080){logger[_0xf80d('0x33')](util[_0xf80d('0x2d')](_0xf80d('0xaa'),_0x24e080[_0xf80d('0x3c')]));if(!this[_0xf80d('0x87')](_0x24e080['text'])){return this['channel'][_0xf80d('0xab')]('no\x20text\x20configured');}var _0x2aa9b4='\x22'+_0x24e080['text']+'\x22';if(this[_0xf80d('0x87')](_0x24e080['options'])){_0x2aa9b4+=','+_0x24e080['options'];}var _0x1a3436=this[_0xf80d('0x11')][_0xf80d('0x5d')](_0xf80d('0xac'),_0x2aa9b4);if(_0x1a3436[_0xf80d('0xad')]===-0x1){return _0x1a3436;}return this[_0xf80d('0x11')][_0xf80d('0xab')](util[_0xf80d('0x2d')](_0xf80d('0xae'),_0x2aa9b4));};AGIVertices['prototype']['mrcprecog']=function(_0x508d54){logger[_0xf80d('0x33')](util[_0xf80d('0x2d')](_0xf80d('0xaf'),_0x508d54[_0xf80d('0x3c')]));if(!this[_0xf80d('0x87')](_0x508d54[_0xf80d('0xb0')])){return this[_0xf80d('0x11')]['noop'](_0xf80d('0xb1'));}var _0x38239a=_0x508d54[_0xf80d('0xb0')];if(this[_0xf80d('0x87')](_0x508d54[_0xf80d('0x7d')])){_0x38239a+=','+_0x508d54[_0xf80d('0x7d')];}var _0x4600af=this[_0xf80d('0x11')][_0xf80d('0x5d')]('MRCPRecog',_0x38239a);if(_0x4600af[_0xf80d('0xad')]===-0x1){return _0x4600af;}var _0xea5734=this[_0xf80d('0xa6')](_0xf80d('0xb2'),_0xf80d('0xb3'));if(_0xea5734[_0xf80d('0xad')]===-0x1){return _0xea5734;}var _0x123660=this['getAndSetVariable'](_0xf80d('0xb4'),'MRCP_RECOG_TRANSCRIPT');if(_0x123660[_0xf80d('0xad')]===-0x1){return _0x123660;}var _0x4d193d=this['getAndSetVariable'](_0xf80d('0xb5'),_0xf80d('0xb6'));if(_0x4d193d[_0xf80d('0xad')]===-0x1){return _0x4d193d;}return this[_0xf80d('0x11')]['noop'](util[_0xf80d('0x2d')](_0xf80d('0xb7'),_0x38239a));};AGIVertices[_0xf80d('0x14')]['agi']=function(_0x19855d){logger[_0xf80d('0x33')](util[_0xf80d('0x2d')](_0xf80d('0xb8'),_0x19855d[_0xf80d('0x3c')]));return this[_0xf80d('0x11')]['agi']([_0x19855d[_0xf80d('0xb9')],_0x19855d[_0xf80d('0xba')]]);};AGIVertices[_0xf80d('0x14')][_0xf80d('0xbb')]=function(_0xb060f8){logger[_0xf80d('0x33')](util['format'](_0xf80d('0xbc'),_0xb060f8[_0xf80d('0x3c')]));if(this[_0xf80d('0x87')](_0xb060f8[_0xf80d('0x6d')])){logger[_0xf80d('0x33')](util[_0xf80d('0x2d')](_0xf80d('0xbd'),_0xb060f8['timeout']));var _0x2119df=this[_0xf80d('0x11')]['wait'](_0xb060f8[_0xf80d('0x6d')]);if(_0x2119df['result']===-0x1){return _0x2119df;}}return this[_0xf80d('0x11')][_0xf80d('0xbb')]();};AGIVertices[_0xf80d('0x14')]['callback']=function(_0x51a28e){logger[_0xf80d('0x33')](util[_0xf80d('0x2d')](_0xf80d('0xbe'),_0x51a28e[_0xf80d('0x3c')]));if(!this[_0xf80d('0x87')](_0x51a28e[_0xf80d('0x4f')])){return this['channel'][_0xf80d('0x31')](_0x51a28e,'no\x20list\x20selected');}_0x51a28e['scheduledAt']=moment();if(this[_0xf80d('0x87')](_0x51a28e[_0xf80d('0xbf')])){_0x51a28e['scheduledAt']=moment()[_0xf80d('0xc0')](_0x51a28e['delay'],_0xf80d('0xc1'));}if(!this['isConfigured'](_0x51a28e['callback_priority'])){_0x51a28e[_0xf80d('0x54')]=0x2;}this['createCmContact']['sync'](this,_0x51a28e);return this[_0xf80d('0x11')][_0xf80d('0xab')](util['format'](_0xf80d('0xc2'),_0x51a28e[_0xf80d('0x4e')],_0x51a28e[_0xf80d('0x4f')],_0x51a28e[_0xf80d('0x50')]));};AGIVertices[_0xf80d('0x14')][_0xf80d('0xc3')]=function(_0x2748f4){logger['info'](util['format'](_0xf80d('0xc4'),_0x2748f4[_0xf80d('0x3c')]));var _0x8e4ba7=this['channel']['exec'](_0x2748f4[_0xf80d('0xc5')],_0x2748f4['options']);if(_0x8e4ba7['result']===-0x1){return _0x8e4ba7;}return this['channel']['noop'](util[_0xf80d('0x2d')](_0xf80d('0xc6'),_0x2748f4[_0xf80d('0xc5')],_0x2748f4[_0xf80d('0x7d')]));};AGIVertices['prototype']['lumenvoxtts']=function(_0x53750f){logger[_0xf80d('0x33')](util[_0xf80d('0x2d')](_0xf80d('0xc7'),_0x53750f[_0xf80d('0x3c')]));if(!this[_0xf80d('0x87')](_0x53750f[_0xf80d('0x62')])){return this['channel'][_0xf80d('0xab')](_0xf80d('0xc8'));}var _0x41a6b5='\x22'+_0x53750f[_0xf80d('0x62')]+'\x22';if(this[_0xf80d('0x87')](_0x53750f[_0xf80d('0x7d')])){_0x41a6b5+=','+_0x53750f[_0xf80d('0x7d')];}var _0x145d20=this[_0xf80d('0x11')][_0xf80d('0x5d')](_0xf80d('0xac'),_0x41a6b5);if(_0x145d20[_0xf80d('0xad')]===-0x1){return _0x145d20;}return this[_0xf80d('0x11')][_0xf80d('0xab')](util[_0xf80d('0x2d')](_0xf80d('0xae'),_0x41a6b5));};AGIVertices['prototype'][_0xf80d('0xc9')]=function(_0x4ce3ca){logger['info'](util[_0xf80d('0x2d')](_0xf80d('0xca'),_0x4ce3ca[_0xf80d('0x3c')]));if(!this[_0xf80d('0x87')](_0x4ce3ca[_0xf80d('0x62')])){return this[_0xf80d('0x11')][_0xf80d('0xab')]('no\x20text\x20configured');}var _0x361268='\x22'+_0x4ce3ca[_0xf80d('0x62')]+'\x22';if(this[_0xf80d('0x87')](_0x4ce3ca[_0xf80d('0x7d')])){_0x361268+=','+_0x4ce3ca[_0xf80d('0x7d')];}var _0x134f9e=this[_0xf80d('0x11')]['exec'](_0xf80d('0xac'),_0x361268);if(_0x134f9e['result']===-0x1){return _0x134f9e;}return this[_0xf80d('0x11')][_0xf80d('0xab')](util[_0xf80d('0x2d')](_0xf80d('0xae'),_0x361268));};AGIVertices['prototype'][_0xf80d('0xcb')]=function(_0xd25164){logger['info'](util[_0xf80d('0x2d')](_0xf80d('0xcc'),_0xd25164['label']));if(!this[_0xf80d('0x87')](_0xd25164[_0xf80d('0xb0')])){return this['channel'][_0xf80d('0xab')](_0xf80d('0xb1'));}var _0x3a7e55=_0xd25164[_0xf80d('0xb0')];if(this['isConfigured'](_0xd25164[_0xf80d('0x7d')])){_0x3a7e55+=','+_0xd25164[_0xf80d('0x7d')];}var _0x2db44e=this['channel']['exec'](_0xf80d('0xcd'),_0x3a7e55);if(_0x2db44e['result']===-0x1){return _0x2db44e;}var _0x1ed735=this[_0xf80d('0xa6')](_0xf80d('0xb2'),_0xf80d('0xce'));if(_0x1ed735[_0xf80d('0xad')]===-0x1){return _0x1ed735;}var _0x569a98=this[_0xf80d('0xa6')]('RECOG_INPUT()',_0xf80d('0xcf'));if(_0x569a98[_0xf80d('0xad')]===-0x1){return _0x569a98;}var _0x2c0972=this[_0xf80d('0xa6')](_0xf80d('0xb5'),'LUMENVOX_ASR_INSTANCE');if(_0x2c0972['result']===-0x1){return _0x2c0972;}return this[_0xf80d('0x11')][_0xf80d('0xab')](util['format'](_0xf80d('0xb7'),_0x3a7e55));};AGIVertices['prototype']['sestekasr']=function(_0x4ed605){logger[_0xf80d('0x33')](util[_0xf80d('0x2d')](_0xf80d('0xd0'),_0x4ed605[_0xf80d('0x3c')]));if(!this[_0xf80d('0x87')](_0x4ed605[_0xf80d('0xb0')])){return this[_0xf80d('0x11')][_0xf80d('0xab')](_0xf80d('0xb1'));}var _0x346077=_0x4ed605[_0xf80d('0xb0')];if(this[_0xf80d('0x87')](_0x4ed605['options'])){_0x346077+=','+_0x4ed605[_0xf80d('0x7d')];}var _0x3af816=this['channel'][_0xf80d('0x5d')]('MRCPRecog',_0x346077);if(_0x3af816[_0xf80d('0xad')]===-0x1){return _0x3af816;}var _0xd5998d=this[_0xf80d('0xa6')](_0xf80d('0xb2'),_0xf80d('0xd1'));if(_0xd5998d[_0xf80d('0xad')]===-0x1){return _0xd5998d;}var _0x332bf1=this[_0xf80d('0xa6')](_0xf80d('0xb4'),_0xf80d('0xd2'));if(_0x332bf1[_0xf80d('0xad')]===-0x1){return _0x332bf1;}var _0x43ccbe=this['getAndSetVariable'](_0xf80d('0xb5'),_0xf80d('0xd3'));if(_0x43ccbe[_0xf80d('0xad')]===-0x1){return _0x43ccbe;}return this[_0xf80d('0x11')][_0xf80d('0xab')](util[_0xf80d('0x2d')](_0xf80d('0xb7'),_0x346077));};AGIVertices[_0xf80d('0x14')][_0xf80d('0xd4')]=function(_0x44bdb8){logger[_0xf80d('0x33')](util[_0xf80d('0x2d')](_0xf80d('0xd5'),_0x44bdb8[_0xf80d('0x3c')]));if(!this[_0xf80d('0x87')](_0x44bdb8[_0xf80d('0xd6')])){return this[_0xf80d('0x11')][_0xf80d('0x31')](_0x44bdb8,_0xf80d('0xd7'));}var _0x5c9f97=this[_0xf80d('0x1d')][_0xf80d('0x78')](this,_0x44bdb8[_0xf80d('0xd6')]);if(!_0x5c9f97){return this[_0xf80d('0x11')][_0xf80d('0x31')](_0x44bdb8,_0xf80d('0xd8'));}if(!this['isConfigured'](_0x44bdb8[_0xf80d('0x34')])){return this['channel'][_0xf80d('0x31')](_0x44bdb8,_0xf80d('0xd9'));}var _0x53c6bd=_0x44bdb8['query'][_0xf80d('0x5e')](/(\r\n|\n|\r)/gm,'\x20');this[_0xf80d('0x11')][_0xf80d('0xab')](util['format'](_0xf80d('0xda'),_0x53c6bd));var _0x1ad8bf=this['getQueryOdbc'][_0xf80d('0x78')](this,_0x5c9f97,_0x53c6bd);this[_0xf80d('0x3a')][_0xf80d('0x78')](this,_0x44bdb8,_0x53c6bd);if(!this['isConfigured'](_0x44bdb8[_0xf80d('0xdb')])){return this[_0xf80d('0x11')]['noop'](_0xf80d('0xdc'));}var _0x759c0b=this['getVariable'][_0xf80d('0x78')](this,_0x44bdb8['variable_id']);if(!_0x759c0b){return this[_0xf80d('0x11')]['error'](_0x44bdb8,'no\x20variable\x20found');}var _0x25b55a=this;_0x1ad8bf[_0xf80d('0xdd')](function(_0xf90aab,_0x467281){Object['keys'](_0xf90aab)[_0xf80d('0xdd')](function(_0x118e57){_0x25b55a['channel'][_0xf80d('0xa3')](util['format'](_0xf80d('0xde'),_0x759c0b,_0x467281,_0x118e57),_0xf90aab[_0x118e57]);});});this['channel'][_0xf80d('0xa3')](util['format'](_0xf80d('0xdf'),_0x759c0b),_0x1ad8bf['length']);return this['channel'][_0xf80d('0xab')](util[_0xf80d('0x2d')]('variable\x20%s\x20set',_0x759c0b));};AGIVertices[_0xf80d('0x14')][_0xf80d('0xe0')]=function(_0x5421a0){logger[_0xf80d('0xe1')](util[_0xf80d('0x2d')](_0xf80d('0xe2'),_0x5421a0[_0xf80d('0x3c')]));if(!this[_0xf80d('0x87')](_0x5421a0['sip_id'])){return this[_0xf80d('0x11')][_0xf80d('0x31')](_0x5421a0,_0xf80d('0xe3'));}var _0x1054c3=this[_0xf80d('0x1f')][_0xf80d('0x78')](this,_0x5421a0['sip_id']);if(!_0x1054c3){return this[_0xf80d('0x11')]['error'](_0x5421a0,_0xf80d('0xe4'));}var _0x79330=this[_0xf80d('0x11')][_0xf80d('0x5d')](_0xf80d('0xe5'),[util['format']('SIP/%s',_0x1054c3),_0x5421a0[_0xf80d('0x6d')],_0x5421a0[_0xf80d('0xe6')],_0x5421a0[_0xf80d('0x6c')]]);if(_0x79330[_0xf80d('0xad')]===-0x1){return _0x79330;}return this[_0xf80d('0x11')]['noop'](util[_0xf80d('0x2d')](_0xf80d('0xe7'),_0xf80d('0xe5')));};AGIVertices[_0xf80d('0x14')][_0xf80d('0xe8')]=function(_0x42bd6c){logger['info'](util[_0xf80d('0x2d')](_0xf80d('0xe9'),_0x42bd6c[_0xf80d('0x3c')]));if(!this[_0xf80d('0x87')](_0x42bd6c[_0xf80d('0x7f')])){return this['channel'][_0xf80d('0xab')](_0xf80d('0xea'));}if(!this[_0xf80d('0x87')](_0x42bd6c[_0xf80d('0x62')])){return this[_0xf80d('0x11')][_0xf80d('0xab')](_0xf80d('0xc8'));}this[_0xf80d('0x11')][_0xf80d('0xeb')]=!![];this[_0xf80d('0x3a')](_0x42bd6c);this[_0xf80d('0x47')](_0x42bd6c[_0xf80d('0x62')],'in','','');this['channel'][_0xf80d('0xab')](util[_0xf80d('0x2d')]('Trying\x20Dialogflow:\x20%s',_0x42bd6c[_0xf80d('0x62')]));var _0x8cf931=this['googleDialogflow'][_0xf80d('0x78')](this,_0x42bd6c);if(_0x8cf931){for(var _0x2e301e in _0x8cf931){if(_0x8cf931[_0xf80d('0x9a')](_0x2e301e)){this[_0xf80d('0x11')][_0xf80d('0xa3')](util[_0xf80d('0x2d')](_0xf80d('0xec'),_0x2e301e[_0xf80d('0x70')]()),_0x8cf931[_0x2e301e]);}}this[_0xf80d('0x47')](_0x8cf931['speech'],_0xf80d('0xed'),'dialogflow','');return this[_0xf80d('0x11')]['noop'](util[_0xf80d('0x2d')](_0xf80d('0xee'),_0x8cf931['speech']));}return this[_0xf80d('0x11')][_0xf80d('0x31')](_0x42bd6c,_0xf80d('0xef'));};AGIVertices[_0xf80d('0x14')][_0xf80d('0xf0')]=function(_0x2d52c3){logger[_0xf80d('0x33')](util['format'](_0xf80d('0xf1'),_0x2d52c3['label']));if(!this['isConfigured'](_0x2d52c3[_0xf80d('0xf2')])){return this[_0xf80d('0x11')][_0xf80d('0xab')]('no\x20project_id\x20configured');}if(!this[_0xf80d('0x87')](_0x2d52c3[_0xf80d('0x80')])){return this[_0xf80d('0x11')][_0xf80d('0xab')](_0xf80d('0xf3'));}if(!this[_0xf80d('0x87')](_0x2d52c3['private_key'])){return this[_0xf80d('0x11')][_0xf80d('0xab')](_0xf80d('0xf4'));}if(!this[_0xf80d('0x87')](_0x2d52c3['dialogflowV2_language'])){return this[_0xf80d('0x11')][_0xf80d('0xab')]('no\x20anguage\x20configured');}if(!this[_0xf80d('0x87')](_0x2d52c3[_0xf80d('0x62')])){return this[_0xf80d('0x11')][_0xf80d('0xab')](_0xf80d('0xc8'));}this[_0xf80d('0x11')][_0xf80d('0xeb')]=!![];this[_0xf80d('0x3a')](_0x2d52c3);this['createSquareMessage'](_0x2d52c3[_0xf80d('0x62')],'in','','');this[_0xf80d('0x11')][_0xf80d('0xab')](util['format'](_0xf80d('0xf5'),_0x2d52c3['text']));var _0x56e705=this[_0xf80d('0xf6')][_0xf80d('0x78')](this,_0x2d52c3);if(_0x56e705){for(var _0x1d5c3b in _0x56e705){if(_0x56e705[_0xf80d('0x9a')](_0x1d5c3b)){if(_0x1d5c3b!==_0xf80d('0xf7')){this[_0xf80d('0x11')]['setVariable'](util[_0xf80d('0x2d')]('DIALOGFLOW_%s',_0x1d5c3b[_0xf80d('0x70')]()),_0x56e705[_0x1d5c3b]);}}}this[_0xf80d('0x47')](_0x56e705[_0xf80d('0xf8')],_0xf80d('0xed'),_0xf80d('0xf0'),_0x56e705[_0xf80d('0xf7')]);return this[_0xf80d('0x11')][_0xf80d('0xab')](util['format'](_0xf80d('0xf9'),_0x56e705[_0xf80d('0xf8')]));}return this['channel'][_0xf80d('0x31')](_0x2d52c3,'DialogflowV2\x20is\x20unreachable');};AGIVertices[_0xf80d('0x14')][_0xf80d('0xfa')]=function(_0x59d047){logger[_0xf80d('0x33')](util['format']('Enter\x20in\x20SESTEKNDA\x20(%s)\x20block',_0x59d047[_0xf80d('0x3c')]));if(!this[_0xf80d('0x87')](_0x59d047[_0xf80d('0xfb')])){return this[_0xf80d('0x11')]['noop'](_0xf80d('0xfc'));}if(!this[_0xf80d('0x87')](_0x59d047['username'])){return this[_0xf80d('0x11')]['noop'](_0xf80d('0xfd'));}if(!this[_0xf80d('0x87')](_0x59d047[_0xf80d('0xfe')])){return this['channel'][_0xf80d('0xab')]('no\x20password\x20configured');}if(!this['isConfigured'](_0x59d047[_0xf80d('0xff')])){return this[_0xf80d('0x11')]['noop']('no\x20text\x20configured');}this[_0xf80d('0x11')][_0xf80d('0xeb')]=!![];this['createSquareDetailsReport'](_0x59d047);this[_0xf80d('0x47')](_0x59d047[_0xf80d('0x62')],'in','','');this[_0xf80d('0x11')][_0xf80d('0xab')](util['format'](_0xf80d('0x100'),_0x59d047['text']));var _0x2f34f5=this[_0xf80d('0x82')][_0xf80d('0x78')](this,_0x59d047);if(_0x2f34f5){for(var _0x3f1093 in _0x2f34f5){if(_0x2f34f5[_0xf80d('0x9a')](_0x3f1093)){this[_0xf80d('0x11')][_0xf80d('0xa3')](util[_0xf80d('0x2d')](_0xf80d('0x101'),_0x3f1093[_0xf80d('0x70')]()),_0x2f34f5[_0x3f1093]);}}this[_0xf80d('0x47')](_0x2f34f5['speech'],_0xf80d('0xed'),_0xf80d('0xfa'),'');if(_0x2f34f5[_0xf80d('0x102')]){this['channel'][_0xf80d('0xab')](util[_0xf80d('0x2d')]('Sestek\x20NDA\x20%s\x20file\x20created',_0x2f34f5[_0xf80d('0x102')]));var _0x44891d=this[_0xf80d('0x11')][_0xf80d('0x103')](_0x2f34f5[_0xf80d('0x102')]);try{fs['unlink'](_0x2f34f5[_0xf80d('0x102')]+_0xf80d('0x104'));}catch(_0x1e38d5){logger[_0xf80d('0x31')](_0x1e38d5);}return _0x44891d;}else{return this[_0xf80d('0x11')][_0xf80d('0xab')](util[_0xf80d('0x2d')](_0xf80d('0x105'),_0x2f34f5['speech']));}}return this[_0xf80d('0x11')][_0xf80d('0x31')](_0x59d047,_0xf80d('0x106'));};AGIVertices[_0xf80d('0x14')][_0xf80d('0x107')]=function(_0x5b3462){logger[_0xf80d('0x33')](util[_0xf80d('0x2d')](_0xf80d('0x108'),_0x5b3462['label']));return this[_0xf80d('0x11')][_0xf80d('0xab')](_0xf80d('0x107'));};AGIVertices[_0xf80d('0x14')]['ext_dial']=function(_0xd93843){logger[_0xf80d('0x33')](util[_0xf80d('0x2d')](_0xf80d('0x109'),_0xd93843['label']));var _0x28bda2='';if(_0xd93843[_0xf80d('0x10a')]){if(!this[_0xf80d('0x87')](_0xd93843[_0xf80d('0x10a')])){return this[_0xf80d('0x11')][_0xf80d('0x31')](_0xd93843,_0xf80d('0x10b'));}else{var _0x44d92b=parseInt(_0xd93843[_0xf80d('0x10a')],0xa);if(isNaN(_0x44d92b)){_0x28bda2=_0xd93843[_0xf80d('0x10a')];}else{_0x28bda2=this['getTrunk']['sync'](this,_0xd93843[_0xf80d('0x10a')]);if(!_0x28bda2){return this[_0xf80d('0x11')][_0xf80d('0x31')](_0xd93843,_0xf80d('0x10c'));}}}}else if(_0xd93843[_0xf80d('0x10d')]){_0x28bda2=_0xd93843['trunk_name'];}else{return this[_0xf80d('0x11')][_0xf80d('0x31')](_0xd93843,_0xf80d('0x10b'));}var _0xc732ab=this[_0xf80d('0x11')]['exec']('DIAL',[util[_0xf80d('0x2d')]('SIP/%s/%s',_0x28bda2,_0xd93843[_0xf80d('0x4e')]),_0xd93843[_0xf80d('0x6d')],_0xd93843[_0xf80d('0xe6')],_0xd93843[_0xf80d('0x6c')]]);if(_0xc732ab['result']===-0x1){return _0xc732ab;}return this['channel']['noop'](util['format'](_0xf80d('0xe7'),_0xf80d('0xe5')));};AGIVertices['prototype'][_0xf80d('0x10e')]=function(_0x3017d2){logger['info'](util[_0xf80d('0x2d')](_0xf80d('0x10f'),_0x3017d2[_0xf80d('0x3c')]));return this[_0xf80d('0x11')][_0xf80d('0xab')]('finally');};AGIVertices[_0xf80d('0x14')]['getdigits']=function(_0x1373cb){logger['info'](util[_0xf80d('0x2d')](_0xf80d('0x110'),_0x1373cb[_0xf80d('0x3c')]));if(_0x1373cb[_0xf80d('0x111')]===0x0){return this['maxRetry'](_0x1373cb);}_0x1373cb['retry']-=0x1;if(!this[_0xf80d('0x87')](_0x1373cb[_0xf80d('0x112')])){return this['channel']['error'](_0x1373cb,_0xf80d('0x113'));}var _0xf470ca=this[_0xf80d('0x22')]['sync'](this,_0x1373cb[_0xf80d('0x112')]);if(!_0xf470ca){return this[_0xf80d('0x11')][_0xf80d('0x31')](_0x1373cb,_0xf80d('0x114'));}if(!this[_0xf80d('0x87')](_0x1373cb[_0xf80d('0xdb')])){return this[_0xf80d('0x11')][_0xf80d('0x31')](_0xf80d('0xdc'));}var _0x575ad7=this[_0xf80d('0x11')][_0xf80d('0x115')](_0xf470ca,_0x1373cb[_0xf80d('0x116')],_0x1373cb[_0xf80d('0x117')]);var _0x369b21=_0x575ad7[_0xf80d('0xad')]?_0x575ad7[_0xf80d('0xad')][_0xf80d('0x53')]():'';logger['info'](_0xf80d('0x118'),JSON[_0xf80d('0x7a')](_0x575ad7));if(_0x575ad7[_0xf80d('0xad')]===-0x1){this['createSquareDetailsReport']['sync'](this,_0x1373cb,_0x369b21);return _0x575ad7;}else if(_0x575ad7[_0xf80d('0xa8')]==='timeout'){_0x575ad7[_0xf80d('0xad')]=_0x369b21[_0xf80d('0xa1')]>=parseInt(_0x1373cb[_0xf80d('0x119')])?'x':'i';}else{_0x575ad7[_0xf80d('0xad')]=_0x369b21[_0xf80d('0xa1')]>=parseInt(_0x1373cb['mindigit'])&&_0x369b21['length']<=parseInt(_0x1373cb[_0xf80d('0x117')])?'x':'i';}var _0x26b919=this[_0xf80d('0x15')][_0xf80d('0x78')](this,_0x1373cb[_0xf80d('0xdb')]);if(!_0x26b919){return this[_0xf80d('0x11')][_0xf80d('0x31')](_0x1373cb,'no\x20variable\x20found');}this['channel'][_0xf80d('0xa3')](_0x26b919,_0x369b21);if(this[_0xf80d('0x87')](_0x1373cb[_0xf80d('0x11a')])){var _0x585c96=parseInt(_0x1373cb['hiddendigitsnum'],0xa);var _0x43f4a6=rs['generate']({'charset':'*','length':_0x585c96});var _0x4e9662=_0x369b21['length'];if(_0x4e9662>0x0){if(_0x4e9662>_0x585c96){this[_0xf80d('0x3a')][_0xf80d('0x78')](this,_0x1373cb,_0x1373cb[_0xf80d('0x11b')]===_0xf80d('0x11c')?_0x43f4a6+_0x369b21[_0xf80d('0x11d')](_0x585c96):_0x369b21['substr'](0x0,_0x4e9662-_0x585c96)+_0x43f4a6);}else{this[_0xf80d('0x3a')][_0xf80d('0x78')](this,_0x1373cb,rs[_0xf80d('0x11e')]({'charset':'*','length':_0x4e9662}));}}else{this[_0xf80d('0x3a')][_0xf80d('0x78')](this,_0x1373cb,'');}}else{this[_0xf80d('0x3a')]['sync'](this,_0x1373cb,_0x369b21);}return _0x575ad7;};AGIVertices[_0xf80d('0x14')][_0xf80d('0x10')]=function(_0x2f0b66){logger[_0xf80d('0x33')](util['format'](_0xf80d('0x11f'),_0x2f0b66[_0xf80d('0x3c')]));return this[_0xf80d('0xf')](_0x2f0b66);};AGIVertices[_0xf80d('0x14')][_0xf80d('0x120')]=function(_0xa3b25a){logger[_0xf80d('0x33')](util['format']('Enter\x20in\x20GOAL\x20(%s)\x20block',_0xa3b25a['label']));this['createSquareDetailsReport'][_0xf80d('0x78')](this,_0xa3b25a,_0xa3b25a[_0xf80d('0x121')]);return this[_0xf80d('0x11')][_0xf80d('0xab')](util[_0xf80d('0x2d')](_0xf80d('0x122'),_0xa3b25a[_0xf80d('0x121')]));};AGIVertices[_0xf80d('0x14')][_0xf80d('0x123')]=function(_0x568231){logger[_0xf80d('0x33')](util[_0xf80d('0x2d')](_0xf80d('0x124'),_0x568231[_0xf80d('0x3c')]));if(!this[_0xf80d('0x87')](_0x568231[_0xf80d('0x8a')])||!this[_0xf80d('0x87')](_0x568231['aws_secret_access_key'])){return this[_0xf80d('0x11')][_0xf80d('0xab')](_0xf80d('0x125'));}if(!this[_0xf80d('0x87')](_0x568231[_0xf80d('0x62')])){return this[_0xf80d('0x11')][_0xf80d('0xab')](_0xf80d('0xc8'));}this[_0xf80d('0x11')][_0xf80d('0xab')](util[_0xf80d('0x2d')](_0xf80d('0x126'),_0x568231[_0xf80d('0x62')]));var _0x2e729b=this[_0xf80d('0x89')][_0xf80d('0x78')](this,_0x568231);if(_0x2e729b){this[_0xf80d('0x11')][_0xf80d('0xab')](util['format'](_0xf80d('0x127'),_0x2e729b));var _0x256314=this[_0xf80d('0x11')][_0xf80d('0x103')](_0x2e729b);try{fs['unlink'](_0x2e729b+_0xf80d('0x104'));}catch(_0x1ccf6c){logger[_0xf80d('0x31')](_0x1ccf6c);}return _0x256314;}return this[_0xf80d('0x11')][_0xf80d('0x31')](_0x568231,_0xf80d('0x128'));};AGIVertices[_0xf80d('0x14')][_0xf80d('0x129')]=function(_0x3cb3b8){logger['info'](util[_0xf80d('0x2d')](_0xf80d('0x12a'),_0x3cb3b8['label']));if(!this[_0xf80d('0x87')](_0x3cb3b8[_0xf80d('0x8a')])||!this[_0xf80d('0x87')](_0x3cb3b8[_0xf80d('0x8b')])){return this[_0xf80d('0x11')][_0xf80d('0xab')](_0xf80d('0x125'));}if(!this['isConfigured'](_0x3cb3b8[_0xf80d('0x92')])){return this['channel'][_0xf80d('0xab')]('no\x20bot\x20name\x20configured');}if(!this['isConfigured'](_0x3cb3b8[_0xf80d('0x62')])){return this[_0xf80d('0x11')][_0xf80d('0xab')](_0xf80d('0xc8'));}this[_0xf80d('0x11')]['bot']=!![];this[_0xf80d('0x3a')](_0x3cb3b8);this[_0xf80d('0x47')](_0x3cb3b8['text'],'in','','');this[_0xf80d('0x11')][_0xf80d('0xab')](util['format'](_0xf80d('0x12b'),_0x3cb3b8[_0xf80d('0x62')]));var _0x2c4b23=this[_0xf80d('0x90')][_0xf80d('0x78')](this,_0x3cb3b8);if(_0x2c4b23){for(var _0x57dfb3 in _0x2c4b23){if(_0x2c4b23[_0xf80d('0x9a')](_0x57dfb3)&&_[_0xf80d('0x12c')](_0x2c4b23[_0x57dfb3])){this[_0xf80d('0x11')][_0xf80d('0xa3')](util[_0xf80d('0x2d')](_0xf80d('0x12d'),_0x57dfb3[_0xf80d('0x70')]()),_0x2c4b23[_0x57dfb3]);}}if(_[_0xf80d('0x4d')](_0x2c4b23[_0xf80d('0x12e')])){return this['channel'][_0xf80d('0xab')]('Amazon\x20Lex\x20ready\x20for\x20fulfillment');}else{this['createSquareMessage'](_0x2c4b23[_0xf80d('0x12e')],_0xf80d('0xed'),_0xf80d('0x12f'),'');return this[_0xf80d('0x11')][_0xf80d('0xab')](util[_0xf80d('0x2d')](_0xf80d('0x130'),_0x2c4b23[_0xf80d('0x12e')]));}}return this[_0xf80d('0x11')][_0xf80d('0x31')](_0x3cb3b8,'Amazon\x20Lex\x20is\x20unreachable');};AGIVertices[_0xf80d('0x14')][_0xf80d('0x131')]=function(_0x2a0833){logger['info'](util['format'](_0xf80d('0x132'),_0x2a0833[_0xf80d('0x3c')],_0x2a0833[_0xf80d('0x6d')]));if(!this['isConfigured'](_0x2a0833[_0xf80d('0x7f')])){return this[_0xf80d('0x11')][_0xf80d('0xab')](_0xf80d('0xea'));}var _0x455a54='wav';var _0x29ee9c=util[_0xf80d('0x2d')]('%s/recordings/%s',FILES_PATH,rs['generate'](0x4));var _0x30acd3=util[_0xf80d('0x2d')](_0xf80d('0xa2'),_0x29ee9c,_0x455a54);var _0x46862c=!![];if(_0x2a0833['beep']==='NOBEEP'){_0x46862c=![];}var _0x25d2f2=this[_0xf80d('0x11')][_0xf80d('0x133')](_0x29ee9c,_0x455a54,_0x2a0833[_0xf80d('0x134')],_0x2a0833[_0xf80d('0x6d')],undefined,_0x46862c);if(_0x25d2f2[_0xf80d('0xad')]!==-0x1){this['channel'][_0xf80d('0xab')](util['format'](_0xf80d('0x135'),_0x30acd3));var _0x2229cd=this[_0xf80d('0x93')][_0xf80d('0x78')](this,_0x2a0833,_0x30acd3);if(_0x2229cd){for(var _0x30a074 in _0x2229cd){if(_0x2229cd[_0xf80d('0x9a')](_0x30a074)){this[_0xf80d('0x11')]['setVariable'](util[_0xf80d('0x2d')](_0xf80d('0x136'),_0x30a074[_0xf80d('0x70')]()),_0x2229cd[_0x30a074]);}}return this[_0xf80d('0x11')][_0xf80d('0xab')](util[_0xf80d('0x2d')](_0xf80d('0x137'),JSON[_0xf80d('0x7a')](_0x2229cd)));}}return _0x25d2f2;};AGIVertices['prototype'][_0xf80d('0x138')]=function(_0x415f7d){logger['info'](util['format'](_0xf80d('0x139'),_0x415f7d[_0xf80d('0x3c')]));if(!this[_0xf80d('0x87')](_0x415f7d['appid'])){return this[_0xf80d('0x11')]['noop'](_0xf80d('0x13a'));}if(!this['isConfigured'](_0x415f7d['appsecret'])){return this[_0xf80d('0x11')]['noop'](_0xf80d('0x13b'));}var _0x3b050d=_0xf80d('0x13c');var _0x3a168c=util[_0xf80d('0x2d')](_0xf80d('0x13d'),FILES_PATH,rs['generate'](0x4));var _0x5b5350=util[_0xf80d('0x2d')](_0xf80d('0xa2'),_0x3a168c,_0x3b050d);var _0x2471dc=!![];if(_0x415f7d['beep']===_0xf80d('0x13e')){_0x2471dc=![];}var _0x1ea7a1=this['channel'][_0xf80d('0x133')](_0x3a168c,_0x3b050d,_0x415f7d[_0xf80d('0x134')],_0x415f7d[_0xf80d('0x6d')],undefined,_0x2471dc);if(_0x1ea7a1[_0xf80d('0xad')]!==-0x1){this[_0xf80d('0x11')][_0xf80d('0xab')](util[_0xf80d('0x2d')](_0xf80d('0x13f'),_0x5b5350));var _0x172a9e=this['tildeASR'][_0xf80d('0x78')](this,_0x415f7d,_0x5b5350);if(_0x172a9e){for(var _0x36fbd2 in _0x172a9e){if(_0x172a9e['hasOwnProperty'](_0x36fbd2)){this['channel'][_0xf80d('0xa3')](util[_0xf80d('0x2d')](_0xf80d('0x140'),_0x36fbd2[_0xf80d('0x70')]()),_0x172a9e[_0x36fbd2]);}}return this[_0xf80d('0x11')][_0xf80d('0xab')](util['format'](_0xf80d('0x141'),JSON[_0xf80d('0x7a')](_0x172a9e)));}}return _0x1ea7a1;};AGIVertices[_0xf80d('0x14')][_0xf80d('0x142')]=function(_0x487a04){logger['info'](util[_0xf80d('0x2d')](_0xf80d('0x143'),_0x487a04[_0xf80d('0x3c')]));return this[_0xf80d('0x11')]['continueAt'](_0x487a04[_0xf80d('0x42')],_0x487a04[_0xf80d('0x43')],_0x487a04[_0xf80d('0x44')]);};AGIVertices[_0xf80d('0x14')][_0xf80d('0x144')]=function(_0xaaf7b9){logger[_0xf80d('0x33')](util['format']('Enter\x20in\x20GOTOIF\x20(%s)\x20block',_0xaaf7b9[_0xf80d('0x3c')]));if(!this[_0xf80d('0x87')](_0xaaf7b9[_0xf80d('0x145')])){return this[_0xf80d('0x11')][_0xf80d('0x31')](_0xaaf7b9,_0xf80d('0x146'));}try{var _0x341da2=eval(_0xaaf7b9[_0xf80d('0x145')])?_0xf80d('0x147'):_0xf80d('0x148');this[_0xf80d('0x11')][_0xf80d('0xab')](util[_0xf80d('0x2d')](_0xf80d('0x149'),_0xaaf7b9[_0xf80d('0x145')],_0x341da2));return{'code':0xc8,'result':_0x341da2};}catch(_0x2d734e){return{'code':0xc8,'result':_0xf80d('0x148')};}};AGIVertices['prototype'][_0xf80d('0x14a')]=function(_0x1fdece){logger[_0xf80d('0x33')](util['format'](_0xf80d('0x14b'),_0x1fdece[_0xf80d('0x3c')]));if(!this['isConfigured'](_0x1fdece[_0xf80d('0x14c')])){return this['channel'][_0xf80d('0x31')](_0x1fdece,_0xf80d('0x14d'));}var _0x7195fd=this[_0xf80d('0x28')][_0xf80d('0x78')](this,_0x1fdece['interval_id']);if(!_0x7195fd){return this[_0xf80d('0x11')][_0xf80d('0x31')](_0x1fdece,'no\x20intervals\x20found');}for(var _0x21ad01=0x0;_0x21ad01<_0x7195fd['length'];_0x21ad01+=0x1){var _0x20adc6=this['channel'][_0xf80d('0x15')](util[_0xf80d('0x2d')](_0xf80d('0x14e'),_0x7195fd[_0x21ad01]));if(_0x20adc6['result']===-0x1){return _0x20adc6;}logger[_0xf80d('0x33')](util['format'](_0xf80d('0x14f'),_0x7195fd[_0x21ad01],_0x20adc6[_0xf80d('0xa8')]));if(_0x20adc6[_0xf80d('0xa8')]===_0xf80d('0x147')){logger[_0xf80d('0x33')](util[_0xf80d('0x2d')](_0xf80d('0x14f'),_0x7195fd[_0x21ad01],_0xf80d('0x147')));this['channel'][_0xf80d('0xab')](util['format'](_0xf80d('0x14f'),_0x7195fd[_0x21ad01],_0xf80d('0x147')));return{'code':0xc8,'result':_0xf80d('0x147')};}else{logger[_0xf80d('0x33')](util['format'](_0xf80d('0x14f'),_0x7195fd[_0x21ad01],_0xf80d('0x148')));this['channel'][_0xf80d('0xab')](util['format'](_0xf80d('0x14f'),_0x7195fd[_0x21ad01],_0xf80d('0x148')));}}return{'code':0xc8,'result':_0xf80d('0x148')};};AGIVertices[_0xf80d('0x14')][_0xf80d('0x150')]=function(_0x25021c){logger[_0xf80d('0x33')](util['format'](_0xf80d('0x151'),_0x25021c[_0xf80d('0x3c')]));return this['channel'][_0xf80d('0x150')]();};AGIVertices[_0xf80d('0x14')][_0xf80d('0x152')]=function(_0x26b59e){logger[_0xf80d('0x33')](util['format'](_0xf80d('0x153'),_0x26b59e[_0xf80d('0x3c')]));if(!this[_0xf80d('0x87')](_0x26b59e[_0xf80d('0x7f')])){return this[_0xf80d('0x11')][_0xf80d('0xab')]('no\x20key\x20configured');}var _0xc54925=_0xf80d('0x13c');var _0x7b7929=util[_0xf80d('0x2d')]('%s/recordings/%s',FILES_PATH,rs[_0xf80d('0x11e')](0x4));var _0x18853a=util[_0xf80d('0x2d')](_0xf80d('0xa2'),_0x7b7929,_0xc54925);var _0x1bacdc=!![];if(_0x26b59e[_0xf80d('0x154')]===_0xf80d('0x13e')){_0x1bacdc=![];}var _0x4c1649=this['channel'][_0xf80d('0x133')](_0x7b7929,_0xc54925,_0x26b59e[_0xf80d('0x134')],_0x26b59e['timeout'],undefined,_0x1bacdc);if(_0x4c1649['result']!==-0x1){this[_0xf80d('0x11')][_0xf80d('0xab')](util['format'](_0xf80d('0x155'),_0x18853a));var _0x51c7c5=this[_0xf80d('0x85')][_0xf80d('0x78')](this,_0x26b59e,_0x18853a);if(_0x51c7c5){for(var _0x5ed3ac in _0x51c7c5){if(_0x51c7c5['hasOwnProperty'](_0x5ed3ac)){this[_0xf80d('0x11')][_0xf80d('0xa3')](util['format'](_0xf80d('0x156'),_0x5ed3ac[_0xf80d('0x70')]()),_0x51c7c5[_0x5ed3ac]);}}return this[_0xf80d('0x11')][_0xf80d('0xab')](util[_0xf80d('0x2d')]('IspeechASR\x20Result\x20%s',JSON[_0xf80d('0x7a')](_0x51c7c5)));}}return _0x4c1649;};AGIVertices[_0xf80d('0x14')][_0xf80d('0x157')]=function(_0x55a946){logger[_0xf80d('0x33')](util[_0xf80d('0x2d')](_0xf80d('0x158'),_0x55a946[_0xf80d('0x3c')]));if(!this['isConfigured'](_0x55a946[_0xf80d('0x7f')])){return this[_0xf80d('0x11')]['noop'](_0xf80d('0xea'));}if(!this[_0xf80d('0x87')](_0x55a946[_0xf80d('0x62')])){return this[_0xf80d('0x11')][_0xf80d('0xab')](_0xf80d('0xc8'));}this[_0xf80d('0x11')][_0xf80d('0xab')](util[_0xf80d('0x2d')](_0xf80d('0x159'),_0x55a946[_0xf80d('0x62')]));var _0x1e4049=this['ispeechTTS'][_0xf80d('0x78')](this,_0x55a946);if(_0x1e4049){this[_0xf80d('0x11')][_0xf80d('0xab')](util['format']('ispeech\x20%s\x20file\x20created',_0x1e4049));var _0x20e121=this['channel'][_0xf80d('0x103')](_0x1e4049,_0x55a946['intKey']);try{fs[_0xf80d('0x15a')](_0x1e4049+'.wav');}catch(_0x2aa65d){logger[_0xf80d('0x31')](_0x2aa65d);}return _0x20e121;}return this[_0xf80d('0x11')][_0xf80d('0x31')](_0x55a946,'ispeech\x20TTS\x20is\x20unreachable');};AGIVertices[_0xf80d('0x14')][_0xf80d('0x15b')]=function(_0xdc130e){logger[_0xf80d('0x33')](util[_0xf80d('0x2d')](_0xf80d('0x15c'),_0xdc130e[_0xf80d('0x3c')]));if(!this['isConfigured'](_0xdc130e['findBy'])){return this[_0xf80d('0x11')][_0xf80d('0x31')](_0xdc130e,'no\x20find\x20by\x20configured');}logger[_0xf80d('0x33')](util[_0xf80d('0x2d')](_0xf80d('0x15d'),this[_0xf80d('0x11')][_0xf80d('0x3f')],_0xdc130e[_0xf80d('0x15e')]));var _0x3824c0=this[_0xf80d('0x58')][_0xf80d('0x78')](this,_0xdc130e[_0xf80d('0x15e')]);if(_0x3824c0){logger[_0xf80d('0x33')](util['format'](_0xf80d('0x15f'),this[_0xf80d('0x11')][_0xf80d('0x3f')],_0xdc130e[_0xf80d('0x15e')]));this[_0xf80d('0x11')]['noop'](util[_0xf80d('0x2d')](_0xf80d('0x15f'),this[_0xf80d('0x11')]['callerid'],_0xdc130e[_0xf80d('0x15e')]));return{'code':0xc8,'result':_0xf80d('0x160')};}else{logger[_0xf80d('0x33')](util[_0xf80d('0x2d')](_0xf80d('0x161'),this['channel']['callerid'],_0xdc130e['findBy']));this[_0xf80d('0x11')][_0xf80d('0xab')](util[_0xf80d('0x2d')](_0xf80d('0x161'),this['channel'][_0xf80d('0x3f')],_0xdc130e[_0xf80d('0x15e')]));return{'code':0xc8,'result':_0xf80d('0x162')};}};AGIVertices['prototype']['logout']=function(_0x1474bd){logger[_0xf80d('0x33')](util[_0xf80d('0x2d')](_0xf80d('0x163'),_0x1474bd[_0xf80d('0x3c')]));if(!this[_0xf80d('0x87')](_0x1474bd[_0xf80d('0x15e')])){return this['channel'][_0xf80d('0x31')](_0x1474bd,_0xf80d('0x164'));}logger['info'](util['format'](_0xf80d('0x15d'),this['channel']['callerid'],_0x1474bd['findBy']));var _0x1ea54f=this['agentLogout'][_0xf80d('0x78')](this,_0x1474bd['findBy']);if(_0x1ea54f){logger[_0xf80d('0x33')](util[_0xf80d('0x2d')](_0xf80d('0x15f'),this[_0xf80d('0x11')][_0xf80d('0x3f')],_0x1474bd[_0xf80d('0x15e')]));this[_0xf80d('0x11')][_0xf80d('0xab')](util[_0xf80d('0x2d')](_0xf80d('0x15f'),this[_0xf80d('0x11')]['callerid'],_0x1474bd[_0xf80d('0x15e')]));return{'code':0xc8,'result':_0xf80d('0x160')};}else{logger[_0xf80d('0x33')](util['format'](_0xf80d('0x161'),this[_0xf80d('0x11')]['callerid'],_0x1474bd[_0xf80d('0x15e')]));this['channel'][_0xf80d('0xab')](util[_0xf80d('0x2d')](_0xf80d('0x161'),this[_0xf80d('0x11')][_0xf80d('0x3f')],_0x1474bd[_0xf80d('0x15e')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0xf80d('0x14')][_0xf80d('0x165')]=function(_0x57002b){logger[_0xf80d('0x33')](util[_0xf80d('0x2d')](_0xf80d('0x166'),_0x57002b['label']));if(!this['isConfigured'](_0x57002b['operation'])){return this[_0xf80d('0x11')][_0xf80d('0x31')](_0x57002b,_0xf80d('0x167'));}this[_0xf80d('0x11')][_0xf80d('0xab')](util[_0xf80d('0x2d')](_0xf80d('0x168'),_0x57002b[_0xf80d('0x169')]));var _0x59df65=eval(_0x57002b[_0xf80d('0x169')]);if(!this['isConfigured'](_0x57002b['variable_id'])){return this[_0xf80d('0x11')][_0xf80d('0xab')](_0xf80d('0xdc'));}var _0x27527a=this[_0xf80d('0x15')][_0xf80d('0x78')](this,_0x57002b['variable_id']);if(!_0x27527a){return this[_0xf80d('0x11')][_0xf80d('0x31')](_0x57002b,_0xf80d('0x16a'));}if(_['isArray'](_0x59df65)){var _0x247d2a=this;_0x59df65[_0xf80d('0xdd')](function(_0x2686e3,_0x1f5ea4){_0x247d2a[_0xf80d('0x11')][_0xf80d('0xa3')](util[_0xf80d('0x2d')](_0xf80d('0x16b'),_0x27527a,_0x1f5ea4),_0x2686e3);});return this[_0xf80d('0x11')]['noop'](util['format'](_0xf80d('0x16c'),_0x27527a));}else{return this['channel']['setVariable'](_0x27527a,_0x59df65);}};AGIVertices['prototype']['menu']=function(_0x42ed56){logger[_0xf80d('0x33')](util[_0xf80d('0x2d')](_0xf80d('0x16d'),_0x42ed56[_0xf80d('0x3c')]));if(_0x42ed56[_0xf80d('0x111')]===0x0){return this[_0xf80d('0xa9')](_0x42ed56);}_0x42ed56[_0xf80d('0x111')]-=0x1;if(!this[_0xf80d('0x87')](_0x42ed56[_0xf80d('0x112')])){return this['channel'][_0xf80d('0x31')](_0x42ed56,_0xf80d('0x113'));}var _0x16ca77=this[_0xf80d('0x22')][_0xf80d('0x78')](this,_0x42ed56[_0xf80d('0x112')]);if(!_0x16ca77){return this['channel'][_0xf80d('0x31')](_0x42ed56,_0xf80d('0x114'));}var _0x10a5f8=this[_0xf80d('0x11')][_0xf80d('0x115')](_0x16ca77,_0x42ed56['response'],_0x42ed56['digit']);var _0x2ef196=_0x10a5f8[_0xf80d('0xad')];if(_0x10a5f8[_0xf80d('0xad')]===-0x1){this['createSquareDetailsReport']['sync'](this,_0x42ed56,'-1');return _0x10a5f8;}else if(_0x10a5f8['extra']===_0xf80d('0x6d')){_0x10a5f8['result']=_0x10a5f8[_0xf80d('0xad')][_0xf80d('0xa1')]>0x0?_0x10a5f8[_0xf80d('0xad')]:'t';}else if(_[_0xf80d('0x49')](_0x10a5f8[_0xf80d('0xad')])){_0x10a5f8[_0xf80d('0xad')]='#';_0x2ef196='#';}if(!this['isConfigured'](_0x42ed56['variable_id'])){this['channel'][_0xf80d('0xab')](_0xf80d('0xdc'));}else{var _0x244a80=this[_0xf80d('0x15')][_0xf80d('0x78')](this,_0x42ed56['variable_id']);if(!_0x244a80){return this['channel'][_0xf80d('0x31')](_0x42ed56,'no\x20variable\x20found');}this[_0xf80d('0x11')]['setVariable'](_0x244a80,_0x2ef196);}this[_0xf80d('0x3a')][_0xf80d('0x78')](this,_0x42ed56,_0x2ef196);return _0x10a5f8;};AGIVertices[_0xf80d('0x14')][_0xf80d('0xab')]=function(_0x5d80a7){logger[_0xf80d('0x33')](util[_0xf80d('0x2d')]('Enter\x20in\x20NOOP\x20(%s)\x20block',_0x5d80a7[_0xf80d('0x3c')]));return this[_0xf80d('0x11')]['noop'](_0x5d80a7[_0xf80d('0x16e')]||_0x5d80a7[_0xf80d('0x3c')]);};AGIVertices[_0xf80d('0x14')][_0xf80d('0x16f')]=function(_0x4b78c6){logger[_0xf80d('0x33')](util['format']('Enter\x20in\x20PAUSE\x20(%s)\x20block',_0x4b78c6[_0xf80d('0x3c')]));if(!this[_0xf80d('0x87')](_0x4b78c6[_0xf80d('0x15e')])){return this[_0xf80d('0x11')][_0xf80d('0x31')](_0x4b78c6,_0xf80d('0x164'));}logger[_0xf80d('0x33')](util['format']('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0xf80d('0x11')]['callerid'],_0x4b78c6[_0xf80d('0x15e')]));var _0x54e5c5=this[_0xf80d('0x170')][_0xf80d('0x78')](this,_0x4b78c6[_0xf80d('0x171')]);var _0x2ee584=this[_0xf80d('0x172')][_0xf80d('0x78')](this,_0x4b78c6[_0xf80d('0x15e')],_0x54e5c5);if(_0x2ee584){logger[_0xf80d('0x33')](util[_0xf80d('0x2d')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xf80d('0x11')][_0xf80d('0x3f')],_0x4b78c6[_0xf80d('0x15e')]));this[_0xf80d('0x11')][_0xf80d('0xab')](util[_0xf80d('0x2d')](_0xf80d('0x15f'),this[_0xf80d('0x11')]['callerid'],_0x4b78c6['findBy']));return{'code':0xc8,'result':_0xf80d('0x160')};}else{logger[_0xf80d('0x33')](util['format'](_0xf80d('0x161'),this[_0xf80d('0x11')][_0xf80d('0x3f')],_0x4b78c6[_0xf80d('0x15e')]));this[_0xf80d('0x11')][_0xf80d('0xab')](util[_0xf80d('0x2d')](_0xf80d('0x15f'),this['channel']['callerid'],_0x4b78c6[_0xf80d('0x15e')]));return{'code':0xc8,'result':_0xf80d('0x162')};}};AGIVertices[_0xf80d('0x14')][_0xf80d('0x173')]=function(_0x3c9d13){logger['info'](util[_0xf80d('0x2d')](_0xf80d('0x174'),_0x3c9d13['label']));if(!this[_0xf80d('0x87')](_0x3c9d13[_0xf80d('0x112')])){return this['channel'][_0xf80d('0x31')](_0x3c9d13,_0xf80d('0x113'));}var _0x1411bd=this[_0xf80d('0x22')]['sync'](this,_0x3c9d13['file_id']);if(!_0x1411bd){return this['channel'][_0xf80d('0x31')](_0x3c9d13,_0xf80d('0x114'));}var _0x177c14=this['channel'][_0xf80d('0x5d')]('PLAYBACK',[_0x1411bd,_0x3c9d13['opts']]);if(_0x177c14[_0xf80d('0xad')]===-0x1){return _0x177c14;}return this[_0xf80d('0x11')][_0xf80d('0xab')](util['format'](_0xf80d('0xc6'),_0xf80d('0x175'),_0x1411bd));};AGIVertices['prototype'][_0xf80d('0x176')]=function(_0x43adad){logger[_0xf80d('0x33')](util[_0xf80d('0x2d')](_0xf80d('0x177'),_0x43adad[_0xf80d('0x3c')]));if(!this[_0xf80d('0x87')](_0x43adad[_0xf80d('0x178')])){return this[_0xf80d('0x11')][_0xf80d('0x31')](_0x43adad,_0xf80d('0x179'));}var _0x3b9b49='';var _0x33f359=parseInt(_0x43adad[_0xf80d('0x178')],0xa);if(isNaN(_0x33f359)){_0x3b9b49=_0x43adad[_0xf80d('0x178')];}else{_0x3b9b49=this[_0xf80d('0x17')][_0xf80d('0x78')](this,_0x43adad[_0xf80d('0x178')]);if(!_0x3b9b49){return this[_0xf80d('0x11')][_0xf80d('0x31')](_0x43adad,_0xf80d('0x17a'));}}var _0x14015a='';if(this[_0xf80d('0x87')](_0x43adad[_0xf80d('0x112')])){var _0x57d006=this[_0xf80d('0x22')][_0xf80d('0x78')](this,_0x43adad[_0xf80d('0x112')]);if(_0x57d006){_0x14015a=_0x57d006;}}this[_0xf80d('0x3a')][_0xf80d('0x78')](this,_0x43adad,_0x3b9b49);if(_0x43adad[_0xf80d('0xe6')][_0xf80d('0x17b')]('x')<0x0){_0x43adad[_0xf80d('0xe6')]+='x';}if(_0x43adad[_0xf80d('0xe6')][_0xf80d('0x17b')]('X')<0x0){_0x43adad['opts']+='X';}this['channel'][_0xf80d('0xa3')]('XMCS-QUEUE',_0x3b9b49?_0x3b9b49[_0xf80d('0x17c')]():'');var _0xf7f005=this[_0xf80d('0x11')][_0xf80d('0x5d')](_0xf80d('0x17d'),[_0x3b9b49,_0x43adad[_0xf80d('0xe6')],_0x43adad['url'],_0x14015a,_0x43adad[_0xf80d('0x6d')],_0x43adad[_0xf80d('0x8')],_0x43adad[_0xf80d('0x17e')],_0x43adad[_0xf80d('0x17f')],'',_0x43adad[_0xf80d('0x180')]]);if(_0xf7f005[_0xf80d('0xad')]===-0x1){return _0xf7f005;}return this['channel'][_0xf80d('0xab')](util['format'](_0xf80d('0xc6'),_0xf80d('0x17d'),_0x3b9b49));};AGIVertices[_0xf80d('0x14')]['record']=function(_0x471200){logger[_0xf80d('0x33')](util[_0xf80d('0x2d')](_0xf80d('0x181'),_0x471200[_0xf80d('0x3c')]));var _0x4b5ad5=_0x471200[_0xf80d('0x182')]||'wav';var _0x5b8f0d=util[_0xf80d('0x2d')](_0xf80d('0x183'),this[_0xf80d('0x11')][_0xf80d('0x3b')],rs[_0xf80d('0x11e')](0x5));var _0x43052b=util[_0xf80d('0x2d')]('%s/recordings/%s.%s',FILES_PATH,_0x5b8f0d,_0x4b5ad5);var _0x58962c=util[_0xf80d('0x2d')](_0xf80d('0x13d'),FILES_PATH,_0x5b8f0d);this[_0xf80d('0x40')][_0xf80d('0x78')](this,_0x471200,_0x5b8f0d,_0x43052b);this[_0xf80d('0x11')][_0xf80d('0xa3')](_0xf80d('0x184'),_0x5b8f0d);logger['info'](_0xf80d('0x185'),_0x58962c,_0x4b5ad5,_0x471200['escape_digits'],_0x471200['timeout']);return this[_0xf80d('0x11')][_0xf80d('0x133')](_0x58962c,_0x4b5ad5,_0x471200[_0xf80d('0x186')],_0x471200[_0xf80d('0x6d')],undefined,!![]);};AGIVertices[_0xf80d('0x14')][_0xf80d('0x187')]=function(_0x4d59ec){logger[_0xf80d('0x33')](util[_0xf80d('0x2d')](_0xf80d('0x188'),_0x4d59ec[_0xf80d('0x3c')]));if(!this[_0xf80d('0x87')](_0x4d59ec[_0xf80d('0x6c')])){return this[_0xf80d('0x11')][_0xf80d('0xab')]('no\x20url\x20configured');}var _0x377786=this[_0xf80d('0x6b')][_0xf80d('0x78')](this,_0x4d59ec);logger[_0xf80d('0x33')](util[_0xf80d('0x2d')](_0xf80d('0x189'),util[_0xf80d('0x18a')](_0x377786,{'showHidden':![],'depth':null})));if(!this[_0xf80d('0x87')](_0x4d59ec[_0xf80d('0xdb')])){return this[_0xf80d('0x11')][_0xf80d('0xab')](_0xf80d('0x18b'));}var _0x1bc9eb=this[_0xf80d('0x15')][_0xf80d('0x78')](this,_0x4d59ec['variable_id']);if(!_0x1bc9eb){return this['channel'][_0xf80d('0x31')](_0x4d59ec,_0xf80d('0x16a'));}this[_0xf80d('0x11')][_0xf80d('0xa3')](util['format'](_0xf80d('0x18c'),_0x1bc9eb),_0x377786['statusCode']?_0x377786[_0xf80d('0x7b')]:_0xf80d('0x18d'));this['channel'][_0xf80d('0xa3')](util[_0xf80d('0x2d')](_0xf80d('0x18e'),_0x1bc9eb),_0x377786[_0xf80d('0x18f')]?_0x377786[_0xf80d('0x18f')]:'OK');if(_0x377786[_0xf80d('0x71')]){try{this[_0xf80d('0x9f')](_0x377786[_0xf80d('0x71')],_0x1bc9eb);}catch(_0x5bb2b3){logger[_0xf80d('0x31')](util['format'](_0xf80d('0x190'),_0x1bc9eb));}}return this[_0xf80d('0x11')][_0xf80d('0xab')](util[_0xf80d('0x2d')]('variable\x20%s\x20set',_0x1bc9eb));};AGIVertices['prototype'][_0xf80d('0x191')]=function(_0x40e3ef){logger[_0xf80d('0x33')](util[_0xf80d('0x2d')](_0xf80d('0x192'),_0x40e3ef[_0xf80d('0x3c')]));return this['channel'][_0xf80d('0x193')](_0x40e3ef[_0xf80d('0x194')][_0xf80d('0x5e')](/\s+/g,''),_0x40e3ef[_0xf80d('0x186')]);};AGIVertices[_0xf80d('0x14')][_0xf80d('0x195')]=function(_0xe422a4){logger['info'](util['format'](_0xf80d('0x196'),_0xe422a4[_0xf80d('0x3c')]));return this[_0xf80d('0x11')][_0xf80d('0x197')](_0xe422a4[_0xf80d('0x198')]['replace'](/\s+/g,''),_0xe422a4[_0xf80d('0x186')]);};AGIVertices[_0xf80d('0x14')][_0xf80d('0x199')]=function(_0x9ccedb){logger[_0xf80d('0x33')](util[_0xf80d('0x2d')](_0xf80d('0x19a'),_0x9ccedb[_0xf80d('0x3c')]));return this[_0xf80d('0x11')][_0xf80d('0x19b')](_0x9ccedb[_0xf80d('0x62')],_0x9ccedb[_0xf80d('0x186')]);};AGIVertices[_0xf80d('0x14')][_0xf80d('0x19c')]=function(_0x35ab2c){logger[_0xf80d('0x33')](util[_0xf80d('0x2d')](_0xf80d('0x19d'),_0x35ab2c['label']));if(!this[_0xf80d('0x87')](_0x35ab2c[_0xf80d('0x19e')])){return this[_0xf80d('0x11')]['noop'](_0xf80d('0x19f'));}var _0x2abb2e=this['getMailAccount']['sync'](this,_0x35ab2c[_0xf80d('0x19e')]);if(!_0x2abb2e||!_0x2abb2e[_0xf80d('0x1a0')]){return this[_0xf80d('0x11')]['error'](_0x35ab2c,_0xf80d('0x1a1'));}var _0x5796d7={'from':util[_0xf80d('0x2d')]('\x22%s\x22\x20<%s>',_0x2abb2e['name'],_0x2abb2e[_0xf80d('0x1a2')]||_0x2abb2e[_0xf80d('0x1a0')]['user']),'to':_0x35ab2c['to']||'','cc':_0x35ab2c['cc']||'','bcc':_0x35ab2c[_0xf80d('0x1a3')]||'','subject':_0x35ab2c[_0xf80d('0x1a4')],'html':_0x35ab2c[_0xf80d('0x62')],'text':_0x35ab2c[_0xf80d('0x62')]};if(this[_0xf80d('0x87')](_0x35ab2c[_0xf80d('0x1a5')])){}logger[_0xf80d('0xe1')](_0xf80d('0x1a6'),JSON['stringify'](_0x5796d7));this[_0xf80d('0x3a')][_0xf80d('0x78')](this,_0x35ab2c,_0x35ab2c[_0xf80d('0x19e')]);this[_0xf80d('0x11')]['noop'](util[_0xf80d('0x2d')](_0xf80d('0x1a7'),_0x2abb2e['name']));this[_0xf80d('0x27')][_0xf80d('0x78')](this,_0x2abb2e[_0xf80d('0x1a8')],_0x5796d7);return this[_0xf80d('0x11')][_0xf80d('0xab')]('Mail\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0xf80d('0x14')]['sendFax']=function(_0x146c8d){logger['info'](util[_0xf80d('0x2d')](_0xf80d('0x1a9'),_0x146c8d[_0xf80d('0x3c')]));return this['channel']['noop'](_0xf80d('0x1aa'));};AGIVertices[_0xf80d('0x14')][_0xf80d('0x1ab')]=function(_0x3d0196){logger['info'](util[_0xf80d('0x2d')](_0xf80d('0x1ac'),_0x3d0196[_0xf80d('0x3c')]));if(!this[_0xf80d('0x87')](_0x3d0196[_0xf80d('0x1ad')])){return this[_0xf80d('0x11')]['noop']('no\x20sms\x20account\x20configured');}var _0x301369=this[_0xf80d('0x37')]['sync'](this,_0x3d0196[_0xf80d('0x1ad')]);if(!_0x301369){return this['channel']['error'](_0x3d0196,_0xf80d('0x1ae'));}var _0x2fe286={'body':_0x3d0196[_0xf80d('0x1af')],'phone':_0x3d0196['to']||'','SmsAccountId':_0x301369['id']};logger['debug'](_0xf80d('0x1b0'),JSON[_0xf80d('0x7a')](_0x2fe286));this[_0xf80d('0x3a')][_0xf80d('0x78')](this,_0x3d0196,_0x3d0196[_0xf80d('0x1ad')]);this['channel'][_0xf80d('0xab')](util['format'](_0xf80d('0x1b1'),_0x301369[_0xf80d('0x16')]));this[_0xf80d('0x39')]['sync'](this,_0x2fe286);return this['channel'][_0xf80d('0xab')](_0xf80d('0x1b2'));};AGIVertices[_0xf80d('0x14')][_0xf80d('0x1b3')]=function(_0x5ac82f){logger[_0xf80d('0x33')](util['format']('Enter\x20in\x20SET\x20(%s)\x20block',_0x5ac82f[_0xf80d('0x3c')]));if(!this[_0xf80d('0x87')](_0x5ac82f[_0xf80d('0xdb')])){return this[_0xf80d('0x11')][_0xf80d('0x31')](_0x5ac82f,'no\x20variable\x20selected');}var _0x12e6fe=this[_0xf80d('0x15')]['sync'](this,_0x5ac82f[_0xf80d('0xdb')]);if(!_0x12e6fe){return this['channel']['error'](_0x5ac82f,_0xf80d('0x16a'));}return this['channel'][_0xf80d('0xa3')](_0x12e6fe,_0x5ac82f[_0xf80d('0x1b4')]);};AGIVertices[_0xf80d('0x14')][_0xf80d('0x1b5')]=function(_0x58c20f){logger[_0xf80d('0x33')](util[_0xf80d('0x2d')](_0xf80d('0x1b6'),_0x58c20f[_0xf80d('0x3c')]));this[_0xf80d('0x11')][_0xf80d('0xab')](_0xf80d('0x1b7'));if(_0x58c20f['answer']===_0xf80d('0x1b8')){this['channel'][_0xf80d('0xab')](_0xf80d('0x1b9'));return this[_0xf80d('0x11')][_0xf80d('0xbb')]();}return this[_0xf80d('0x11')][_0xf80d('0xab')](_0xf80d('0x1ba'));};AGIVertices['prototype']['subproject']=function(_0x561ecd){logger[_0xf80d('0x33')](util[_0xf80d('0x2d')](_0xf80d('0x1bb'),_0x561ecd[_0xf80d('0x3c')]));if(!this[_0xf80d('0x87')](_0x561ecd[_0xf80d('0x1bc')])){return this[_0xf80d('0x11')]['error'](_0x561ecd,_0xf80d('0x1bd'));}var _0x3bfe96=this[_0xf80d('0x1b')][_0xf80d('0x78')](this,_0x561ecd[_0xf80d('0x1bc')]);if(!this[_0xf80d('0x87')](_0x3bfe96)){return this[_0xf80d('0x11')][_0xf80d('0x31')](_0x561ecd,util[_0xf80d('0x2d')]('no\x20subproject\x20found\x20with\x20id\x20%d',_0x561ecd[_0xf80d('0x1bc')]));}if(_0x3bfe96===this['channel'][_0xf80d('0x3e')]){return this[_0xf80d('0x11')]['error'](_0x561ecd,_0xf80d('0x1be'));}this[_0xf80d('0x3a')][_0xf80d('0x78')](this,_0x561ecd,_0x3bfe96);var _0x23b301=this['channel'][_0xf80d('0x5d')](_0xf80d('0x1bf'),util[_0xf80d('0x2d')](_0xf80d('0x1c0'),config['agi']['host']||_0xf80d('0x1c1'),_0x3bfe96,this['channel']['arg_1']));if(_0x23b301['result']===-0x1){return _0x23b301;}return this['channel'][_0xf80d('0xab')](util[_0xf80d('0x2d')](_0xf80d('0xc6'),_0xf80d('0x1bf'),_0x3bfe96));};AGIVertices[_0xf80d('0x14')]['system']=function(_0x5c2f1a){logger[_0xf80d('0x33')](util[_0xf80d('0x2d')](_0xf80d('0x1c2'),_0x5c2f1a[_0xf80d('0x3c')]));var _0x388e68=this[_0xf80d('0x5c')][_0xf80d('0x78')](this,_0x5c2f1a[_0xf80d('0xb9')]);this[_0xf80d('0x3a')][_0xf80d('0x78')](this,_0x5c2f1a,_0x5c2f1a[_0xf80d('0xb9')]);if(this[_0xf80d('0x87')](_0x5c2f1a[_0xf80d('0xdb')])){var _0x53d7be=this[_0xf80d('0x15')]['sync'](this,_0x5c2f1a[_0xf80d('0xdb')]);if(_0x53d7be){this[_0xf80d('0x11')][_0xf80d('0xa3')](_0x53d7be,_0x388e68);return this['channel'][_0xf80d('0xab')](util['format'](_0xf80d('0x1c3'),_0x5c2f1a[_0xf80d('0xb9')],_0x53d7be));}}return this['channel'][_0xf80d('0xab')](util[_0xf80d('0x2d')](_0xf80d('0x1c4'),_0x5c2f1a[_0xf80d('0xb9')]));};AGIVertices['prototype'][_0xf80d('0x1c5')]=function(_0x13ffb3){logger['info'](util['format'](_0xf80d('0x1c6'),_0x13ffb3[_0xf80d('0x3c')]));_0x13ffb3['text']=_0x13ffb3['text'][_0xf80d('0x5e')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xf80d('0x87')](_0x13ffb3[_0xf80d('0x60')])){return this[_0xf80d('0x11')]['noop'](_0xf80d('0x1c7'));}if(!this[_0xf80d('0x87')](_0x13ffb3[_0xf80d('0x62')])){return this[_0xf80d('0x11')]['noop'](_0xf80d('0xc8'));}this[_0xf80d('0x11')]['noop'](util[_0xf80d('0x2d')]('Trying\x20Google\x20Cloud\x20TTS\x20%s',_0x13ffb3[_0xf80d('0x62')]));var _0x5b5dbd=this['googleCloudTTS'][_0xf80d('0x78')](this,_0x13ffb3);if(_0x5b5dbd){this[_0xf80d('0x11')][_0xf80d('0xab')](util[_0xf80d('0x2d')](_0xf80d('0x1c8'),_0x5b5dbd));var _0x441409=this[_0xf80d('0x11')]['streamFile'](_0x5b5dbd);try{fs['unlink'](_0x5b5dbd+_0xf80d('0x104'));}catch(_0x5ddcfb){logger['error'](_0x5ddcfb);}return _0x441409;}return this[_0xf80d('0x11')]['error'](_0x13ffb3,_0xf80d('0x1c9'));};AGIVertices[_0xf80d('0x14')][_0xf80d('0x1ca')]=function(_0x3a9130){logger[_0xf80d('0x33')](util['format'](_0xf80d('0x1cb'),_0x3a9130[_0xf80d('0x3c')]));_0x3a9130[_0xf80d('0x62')]=_0x3a9130['text'][_0xf80d('0x5e')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xf80d('0x87')](_0x3a9130[_0xf80d('0x62')])){return this[_0xf80d('0x11')][_0xf80d('0xab')](_0xf80d('0xc8'));}this[_0xf80d('0x11')][_0xf80d('0xab')](util[_0xf80d('0x2d')](_0xf80d('0x1cc'),_0x3a9130['text']));var _0x2218c1=this[_0xf80d('0x69')]['sync'](this,_0x3a9130);if(_0x2218c1){this[_0xf80d('0x11')][_0xf80d('0xab')](util[_0xf80d('0x2d')](_0xf80d('0x1cd'),_0x2218c1));var _0x4f33aa=this[_0xf80d('0x11')][_0xf80d('0x103')](_0x2218c1);try{fs[_0xf80d('0x15a')](_0x2218c1+_0xf80d('0x104'));}catch(_0x2deb1e){logger[_0xf80d('0x31')](_0x2deb1e);}return _0x4f33aa;}return this['channel'][_0xf80d('0x31')](_0x3a9130,_0xf80d('0x1ce'));};AGIVertices['prototype']['unpause']=function(_0x5c6561){logger[_0xf80d('0x33')](util[_0xf80d('0x2d')]('Enter\x20in\x20UNPAUSE\x20(%s)\x20block',_0x5c6561[_0xf80d('0x3c')]));if(!this['isConfigured'](_0x5c6561[_0xf80d('0x15e')])){return this[_0xf80d('0x11')][_0xf80d('0x31')](_0x5c6561,_0xf80d('0x164'));}logger['info'](util[_0xf80d('0x2d')](_0xf80d('0x15d'),this[_0xf80d('0x11')][_0xf80d('0x3f')],_0x5c6561[_0xf80d('0x15e')]));var _0x58f819=this[_0xf80d('0x55')]['sync'](this,_0x5c6561[_0xf80d('0x15e')]);if(_0x58f819){logger[_0xf80d('0x33')](util[_0xf80d('0x2d')](_0xf80d('0x15f'),this['channel'][_0xf80d('0x3f')],_0x5c6561[_0xf80d('0x15e')]));this['channel'][_0xf80d('0xab')](util[_0xf80d('0x2d')](_0xf80d('0x15f'),this['channel']['callerid'],_0x5c6561[_0xf80d('0x15e')]));return{'code':0xc8,'result':_0xf80d('0x160')};}else{logger['info'](util[_0xf80d('0x2d')](_0xf80d('0x161'),this['channel'][_0xf80d('0x3f')],_0x5c6561[_0xf80d('0x15e')]));this[_0xf80d('0x11')][_0xf80d('0xab')](util[_0xf80d('0x2d')](_0xf80d('0x161'),this[_0xf80d('0x11')][_0xf80d('0x3f')],_0x5c6561[_0xf80d('0x15e')]));return{'code':0xc8,'result':_0xf80d('0x162')};}};AGIVertices['prototype']['voicemail']=function(_0x240763){logger[_0xf80d('0x33')](util['format'](_0xf80d('0x1cf'),_0x240763[_0xf80d('0x3c')]));var _0x2630d6=this[_0xf80d('0x11')][_0xf80d('0x5d')]('VOICEMAIL',[_0x240763[_0xf80d('0x1d0')],_0x240763[_0xf80d('0x7d')]]);if(_0x2630d6['result']===-0x1){return _0x2630d6;}return this[_0xf80d('0x11')]['noop'](util['format'](_0xf80d('0xc6'),_0xf80d('0x1d1'),_0x240763[_0xf80d('0x1d0')]));};AGIVertices[_0xf80d('0x14')][_0xf80d('0x1d2')]=function(_0x48c2ac){logger[_0xf80d('0x33')](util[_0xf80d('0x2d')](_0xf80d('0x1d3'),_0x48c2ac['label']));if(!this[_0xf80d('0x87')](_0x48c2ac[_0xf80d('0xdb')])){return this[_0xf80d('0x11')][_0xf80d('0x31')](_0x48c2ac,_0xf80d('0x1d4'));}var _0x3b66c7=this[_0xf80d('0x15')]['sync'](this,_0x48c2ac[_0xf80d('0xdb')]);if(!_0x3b66c7){return this[_0xf80d('0x11')][_0xf80d('0x31')](_0x48c2ac,_0xf80d('0x16a'));}var _0x37cfcb=this[_0xf80d('0x11')][_0xf80d('0x15')](_0x3b66c7);return{'code':0xc8,'result':_0x37cfcb[_0xf80d('0xa8')]?_0x37cfcb['extra']:'-'};};String[_0xf80d('0x14')]['replaceAll']=function(_0x4ca3b5,_0x3dcb3b){return this[_0xf80d('0xa4')](_0x4ca3b5)[_0xf80d('0x1d5')](_0x3dcb3b);};module[_0xf80d('0x1d6')]=AGIVertices;
\ No newline at end of file
+var _0x7fb3=['variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','keys','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','sip_id','no\x20user\x20selected','no\x20user\x20found','DIAL','opts','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','toUpperCase','speech','Dialogflow\x20Result\x20%s','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','no\x20client_email\x20configured','private_key','no\x20private_key\x20configured','no\x20anguage\x20configured','googleDialogflowV2','providerResponse','out','DialogflowV2\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','username','no\x20username\x20configured','password','no\x20password\x20configured','ndassistant_url','SESTEK_NDA_%s','audiofile','streamFile','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','trunk_name','SIP/%s/%s','Enter\x20in\x20FINALLY\x20(%s)\x20block','getdigits','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','getData','response','maxdigit','test','mindigit','hiddendigitsnum','generate','hiddendigitspos','first','substr','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','aws_secret_access_key','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','unlink','aws\x20Polly\x20is\x20unreachable','awslex','awsLex','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','message','amazonlex','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','beep','NOBEEP','intKey','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','%s/recordings/%s','recordFile','tilde\x20%s\x20file\x20created','tildeASR','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','priority','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','no\x20interval\x20configured','interval_id','no\x20intervals\x20found','IFTIME(%s?true:false)','true','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','no\x20find\x20by\x20configured','findBy','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','FIND\x20AGENT\x20%s\x20BY\x20%s','agentLogout','failure','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','math\x20%s','%s[%s]','menu','Enter\x20in\x20MENU\x20(%s)\x20block','getSound','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','getVoiceQueue','no\x20queue\x20found','indexOf','toLowerCase','QUEUE','macro','gosub','position','record','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','Response:','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','200','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','user','subject','Trying\x20SendMail\x20with\x20account\x20%s','smtpOptions','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','sms_account_id','no\x20sms\x20account\x20configured','getSmsAccount','no\x20sms\x20account\x20found','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','no\x20variable\x20selected','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','yes','Answer','Skipped\x20Answer','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','no\x20subproject\x20selected','project_id','no\x20subproject\x20found\x20with\x20id\x20%d','arg_1','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','agi://%s/square,\x22%s\x22,\x22%s\x22','host','AGI','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','shellCommand','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','util','lodash','shelljs','odbc','moment','mustache','request-promise','../../config/logger','../../config/environment','../../config/environment/shared','./scripts','/var/opt/motion2/server/files','rawHeaders','rawBody','channel','rpc','mailRpc','prototype','getVariable','getVariableById','then','name','catch','getVoiceQueueById','getSquareProject','getSquareProjectById','getSquareOdbc','getSquareOdbcById','dsn','getUser','getUserById','getTrunk','getTrunkById','getSoundById','getSoundPath','save_name','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','getIntervalById','interval','map','Intervals','%s/sounds/converted/%s','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','query','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','agicommand','callerid','createSquareRecording','calleridname','context','extension','accountcode','file','createSquareMessage','createCmContact','random','isEmpty','lastName','isNil','phone','list_id','callback','scheduledAt','toString','callback_priority','getPause','getPauseById','agentPause','agent','agentUnpause','%s/%s@from-sip/n','LOCAL','agentLogin','exec','trim','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','en-US','ssmlGender','MALE','audioEncoding','MP3','googleTTS','google_tts_language','restAPI','url','number','timeout','includes','POST','PUT','method','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','computedVariables','uri','render','stringify','body','statusMessage','statusCode','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','dialogflowV2_project_id','client_email','dialogflowV2_language','sestekNDA','ispeechTTS','ispeech_tts_language','speed','ispeechASR','model','awsPolly','aws_access_key_id','aws_polly_voice','Amy','aws_text_type','aws_lex_region','aws_bot_name','googleASR','google_asr_language','appid','appsecret','clone','hasOwnProperty','isString','replaceAllVariables','recursiveNodeIndex','isPlainObject','length','saveRestApiResult','format','%s.%s','isArray','setVariable','replaceObjectAllVariables','split','replaceAll','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','extra','maxRetry','retry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','no\x20text\x20configured','MRCPSynth','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','isConfigured','grammar','MRCPRecog','RECOG_CONFIDENCE()','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','agi','Enter\x20in\x20AGI\x20(%s)\x20block','label','command','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','no\x20list\x20selected','delay','add','minutes','sync','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','Executed\x20command\x20%s\x20%s','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','Executed\x20command\x20MRCPSynth\x20%s','sestektts','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','no\x20grammar\x20configured','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_TRANSCRIPT','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20odbc\x20database\x20found','no\x20query\x20configured','query:\x20%s','getQueryOdbc'];(function(_0x2f1353,_0x580811){var _0x34f492=function(_0x4c85a1){while(--_0x4c85a1){_0x2f1353['push'](_0x2f1353['shift']());}};_0x34f492(++_0x580811);}(_0x7fb3,0xf9));var _0x37fb=function(_0x37ae17,_0x12491a){_0x37ae17=_0x37ae17-0x0;var _0x24b60f=_0x7fb3[_0x37ae17];return _0x24b60f;};'use strict';var fs=require('fs');var util=require(_0x37fb('0x0'));var _=require(_0x37fb('0x1'));var sh=require(_0x37fb('0x2'));var odbc=require(_0x37fb('0x3'))();var rs=require('randomstring');var moment=require(_0x37fb('0x4'));var Mustache=require(_0x37fb('0x5'));var rp=require(_0x37fb('0x6'));var logger=require(_0x37fb('0x7'))('agi');var config=require(_0x37fb('0x8'));var shared=require(_0x37fb('0x9'));var scripts=require(_0x37fb('0xa'));var FILES_PATH=_0x37fb('0xb');var recursiveMapAttributes=[_0x37fb('0xc'),_0x37fb('0xd')];var verticesWithRetry=['menu','getdigits','getsecretdigits'];var AGIVertices=function(_0x33887f,_0x346943,_0x1f4810){this[_0x37fb('0xe')]=_0x33887f;this[_0x37fb('0xf')]=_0x346943;this[_0x37fb('0x10')]=_0x1f4810;};AGIVertices[_0x37fb('0x11')][_0x37fb('0x12')]=function(_0x5199de,_0x5605ce){this[_0x37fb('0xf')][_0x37fb('0x13')](_0x5199de)[_0x37fb('0x14')](function(_0x116dcc){_0x5605ce(null,_0x116dcc?_0x116dcc[_0x37fb('0x15')]:![]);})[_0x37fb('0x16')](function(_0x12364d){_0x5605ce(_0x12364d);});};AGIVertices[_0x37fb('0x11')]['getVoiceQueue']=function(_0x5da9e5,_0x359238){this[_0x37fb('0xf')][_0x37fb('0x17')](_0x5da9e5)[_0x37fb('0x14')](function(_0x5d0627){_0x359238(null,_0x5d0627?_0x5d0627[_0x37fb('0x15')]:![]);})['catch'](function(_0x2efec0){_0x359238(_0x2efec0);});};AGIVertices[_0x37fb('0x11')][_0x37fb('0x18')]=function(_0xae35e,_0x42b5ce){this[_0x37fb('0xf')][_0x37fb('0x19')](_0xae35e)[_0x37fb('0x14')](function(_0x100977){_0x42b5ce(null,_0x100977?_0x100977[_0x37fb('0x15')]:![]);})[_0x37fb('0x16')](function(_0x2ea308){_0x42b5ce(_0x2ea308);});};AGIVertices[_0x37fb('0x11')][_0x37fb('0x1a')]=function(_0x383326,_0x85b030){this[_0x37fb('0xf')][_0x37fb('0x1b')](_0x383326)[_0x37fb('0x14')](function(_0x47443b){_0x85b030(null,_0x47443b?_0x47443b[_0x37fb('0x1c')]:![]);})['catch'](function(_0x3b8ec6){_0x85b030(_0x3b8ec6);});};AGIVertices['prototype'][_0x37fb('0x1d')]=function(_0x19014b,_0x1d68b5){this[_0x37fb('0xf')][_0x37fb('0x1e')](_0x19014b)[_0x37fb('0x14')](function(_0x205dc2){_0x1d68b5(null,_0x205dc2?_0x205dc2['name']:![]);})[_0x37fb('0x16')](function(_0x4f7705){_0x1d68b5(_0x4f7705);});};AGIVertices['prototype'][_0x37fb('0x1f')]=function(_0x5e1cef,_0x2bbb78){this[_0x37fb('0xf')][_0x37fb('0x20')](_0x5e1cef)[_0x37fb('0x14')](function(_0x408024){_0x2bbb78(null,_0x408024?_0x408024[_0x37fb('0x15')]:![]);})[_0x37fb('0x16')](function(_0x2840ac){_0x2bbb78(_0x2840ac);});};AGIVertices[_0x37fb('0x11')]['getSound']=function(_0x20b834,_0x283af9){var _0x4e620b=this;this['rpc'][_0x37fb('0x21')](_0x20b834)[_0x37fb('0x14')](function(_0xfe4421){_0x283af9(null,_0xfe4421?_0x4e620b[_0x37fb('0x22')](_0xfe4421[_0x37fb('0x23')]):![]);})[_0x37fb('0x16')](function(_0x531e03){_0x283af9(_0x531e03);});};AGIVertices[_0x37fb('0x11')][_0x37fb('0x24')]=function(_0x472f49,_0x59c964){this[_0x37fb('0xf')][_0x37fb('0x25')](_0x472f49)[_0x37fb('0x14')](function(_0x203a00){_0x59c964(null,_0x203a00?_0x203a00:![]);})[_0x37fb('0x16')](function(_0x332713){_0x59c964(_0x332713);});};AGIVertices[_0x37fb('0x11')][_0x37fb('0x26')]=function(_0x447d0b,_0xafe001,_0x38b0f4){this['mailRpc'][_0x37fb('0x26')](_0x447d0b,_0xafe001)[_0x37fb('0x14')](function(){_0x38b0f4(null);})[_0x37fb('0x16')](function(_0x5b93bc){_0x38b0f4(_0x5b93bc);});};AGIVertices[_0x37fb('0x11')][_0x37fb('0x27')]=function(_0x597e3a,_0x2f41a2){this[_0x37fb('0xf')][_0x37fb('0x28')](_0x597e3a)[_0x37fb('0x14')](function(_0x208708){if(_0x208708){if(_0x208708['IntervalId']){_0x2f41a2(null,[_0x208708[_0x37fb('0x29')]]);}else{_0x2f41a2(null,_[_0x37fb('0x2a')](_0x208708[_0x37fb('0x2b')],'interval'));}}else{_0x2f41a2(null,![]);}})[_0x37fb('0x16')](function(_0x5c0d9f){_0x2f41a2(_0x5c0d9f);});};AGIVertices[_0x37fb('0x11')]['getSoundPath']=function(_0x1b491f){return util['format'](_0x37fb('0x2c'),FILES_PATH,_0x1b491f);};AGIVertices[_0x37fb('0x11')]['getQueryOdbc']=function(_0x49aae0,_0x2b7464,_0x481ce6){odbc[_0x37fb('0x2d')](_0x49aae0,function(_0x13b622){if(_0x13b622){logger[_0x37fb('0x2e')](_0x37fb('0x2f'),_0x13b622);_0x481ce6(_0x13b622);}else{logger[_0x37fb('0x30')](_0x37fb('0x31'));odbc[_0x37fb('0x32')](_0x2b7464,function(_0x5ab1b6,_0x22a8f1){if(_0x5ab1b6){logger[_0x37fb('0x30')](_0x37fb('0x33'),_0x2b7464);_0x481ce6(_0x5ab1b6);}else{logger['info'](_0x37fb('0x34'),_0x2b7464);odbc['close'](function(_0x29efbc){if(_0x29efbc){logger[_0x37fb('0x2e')](_0x37fb('0x35'),_0x29efbc);}_0x481ce6(null,_0x22a8f1);});}});}});};AGIVertices[_0x37fb('0x11')]['getSmsAccount']=function(_0x4e0057,_0x4a0d40){this[_0x37fb('0xf')][_0x37fb('0x36')](_0x4e0057)[_0x37fb('0x14')](function(_0x37d793){_0x4a0d40(null,_0x37d793?_0x37d793:![]);})[_0x37fb('0x16')](function(_0x43d607){_0x4a0d40(_0x43d607);});};AGIVertices[_0x37fb('0x11')][_0x37fb('0x37')]=function(_0x361595,_0x50dc83){this[_0x37fb('0xf')][_0x37fb('0x37')](_0x361595)['then'](function(_0xb1f7d5){_0x50dc83(null,_0xb1f7d5);})[_0x37fb('0x16')](function(_0x245dd8){_0x50dc83(_0x245dd8);});};AGIVertices[_0x37fb('0x11')]['createSquareDetailsReport']=function(_0x333ab0,_0x499cd5,_0x2466d6){this[_0x37fb('0xf')][_0x37fb('0x38')]({'uniqueid':this[_0x37fb('0xe')][_0x37fb('0x39')],'node':_0x333ab0['label'],'application':_0x333ab0[_0x37fb('0x3a')],'data':_0x499cd5||null,'project_name':this[_0x37fb('0xe')]['arg_1'],'callerid':this[_0x37fb('0xe')][_0x37fb('0x3b')]})[_0x37fb('0x14')](function(_0x3cfac5){if(_0x2466d6){_0x2466d6(null,_0x3cfac5);}})[_0x37fb('0x16')](function(_0x15cc89){if(_0x2466d6){_0x2466d6(_0x15cc89);}});};AGIVertices[_0x37fb('0x11')]['createSquareRecording']=function(_0x3eb51c,_0x3c1075,_0x5c7d77,_0x1f7f77){this[_0x37fb('0xf')][_0x37fb('0x3c')]({'uniqueid':this[_0x37fb('0xe')]['uniqueid'],'callerid':this[_0x37fb('0xe')][_0x37fb('0x3b')],'calleridname':this['channel'][_0x37fb('0x3d')],'context':this[_0x37fb('0xe')][_0x37fb('0x3e')],'extension':this[_0x37fb('0xe')][_0x37fb('0x3f')],'priority':this['channel']['priority'],'accountcode':this[_0x37fb('0xe')][_0x37fb('0x40')],'dnid':this[_0x37fb('0xe')]['dnid'],'projectName':this[_0x37fb('0xe')]['arg_1'],'saveName':_0x3c1075,'filename':_0x3eb51c[_0x37fb('0x41')]||_0x3c1075,'savePath':_0x5c7d77})[_0x37fb('0x14')](function(_0x443f22){_0x1f7f77(null,_0x443f22);})[_0x37fb('0x16')](function(_0x528957){_0x1f7f77(_0x528957);});};AGIVertices[_0x37fb('0x11')][_0x37fb('0x42')]=function(_0x3f9cb7,_0x1c4420,_0x40d0ce,_0x2dd2ce,_0x2f871d){this[_0x37fb('0xf')][_0x37fb('0x42')]({'uniqueid':this[_0x37fb('0xe')]['uniqueid'],'body':_0x3f9cb7,'direction':_0x1c4420,'providerName':_0x40d0ce,'providerResponse':_0x2dd2ce})[_0x37fb('0x14')](function(_0x5e1672){if(_0x2f871d){_0x2f871d(null,_0x5e1672);}})[_0x37fb('0x16')](function(_0x37bc1a){if(_0x2f871d){_0x2f871d(_0x37bc1a);}});};AGIVertices[_0x37fb('0x11')][_0x37fb('0x43')]=function(_0x1a70ac,_0x491dc3){this['rpc'][_0x37fb('0x43')]({'firstName':_['isEmpty'](_0x1a70ac[_0x37fb('0x15')])||_['isNil'](_0x1a70ac['name'])?'callback_'+Math[_0x37fb('0x44')]():_0x1a70ac[_0x37fb('0x15')],'lastName':_[_0x37fb('0x45')](_0x1a70ac[_0x37fb('0x46')])||_[_0x37fb('0x47')](_0x1a70ac[_0x37fb('0x46')])?null:_0x1a70ac[_0x37fb('0x46')],'phone':_0x1a70ac[_0x37fb('0x48')],'ListId':_0x1a70ac[_0x37fb('0x49')],'scheduledat':_0x1a70ac['scheduledAt'],'callbackUniqueid':this[_0x37fb('0xe')][_0x37fb('0x39')],'tags':_0x37fb('0x4a'),'description':'Callback\x20scheduled\x20at\x20'+_0x1a70ac[_0x37fb('0x4b')][_0x37fb('0x4c')](),'priority':_0x1a70ac[_0x37fb('0x4d')]})[_0x37fb('0x14')](function(_0x716a8e){_0x491dc3(null,_0x716a8e);})[_0x37fb('0x16')](function(_0x447feb){_0x491dc3(_0x447feb);});};AGIVertices['prototype'][_0x37fb('0x4e')]=function(_0x20d647,_0x59f373){this[_0x37fb('0xf')][_0x37fb('0x4f')](_0x20d647)[_0x37fb('0x14')](function(_0x3cdd23){_0x59f373(null,_0x3cdd23?_0x3cdd23[_0x37fb('0x15')]:![]);})[_0x37fb('0x16')](function(_0x516a59){_0x59f373(_0x516a59);});};AGIVertices['prototype'][_0x37fb('0x50')]=function(_0x777c60,_0x48f3b9,_0x4de509){var _0x55e4d1={'role':_0x37fb('0x51')};_0x55e4d1[_0x777c60]=this[_0x37fb('0xe')][_0x37fb('0x3b')];this[_0x37fb('0xf')][_0x37fb('0x50')](_0x55e4d1,_0x48f3b9,this[_0x37fb('0xe')][_0x37fb('0x39')])['then'](function(_0x4f00a3){_0x4de509(null,_['isNil'](_0x4f00a3)?![]:!![]);})[_0x37fb('0x16')](function(_0x267fb5){logger[_0x37fb('0x2e')](_0x267fb5);_0x4de509(null,![]);});};AGIVertices[_0x37fb('0x11')][_0x37fb('0x52')]=function(_0x450495,_0x299c80){var _0x5d2983={'role':_0x37fb('0x51')};_0x5d2983[_0x450495]=this[_0x37fb('0xe')]['callerid'];this['rpc']['agentUnpause'](_0x5d2983)[_0x37fb('0x14')](function(_0xb91573){_0x299c80(null,_[_0x37fb('0x47')](_0xb91573)?![]:!![]);})['catch'](function(_0x232ebd){logger[_0x37fb('0x2e')](_0x232ebd);_0x299c80(null,![]);});};AGIVertices[_0x37fb('0x11')]['agentLogout']=function(_0x10085d,_0x578b83){var _0x4e5102={'role':_0x37fb('0x51')};_0x4e5102[_0x10085d]=this[_0x37fb('0xe')][_0x37fb('0x3b')];this['rpc']['agentLogout'](_0x4e5102)[_0x37fb('0x14')](function(_0x3ba2a8){_0x578b83(null,_[_0x37fb('0x47')](_0x3ba2a8)?![]:!![]);})[_0x37fb('0x16')](function(_0x5e4162){logger[_0x37fb('0x2e')](_0x5e4162);_0x578b83(null,![]);});};AGIVertices[_0x37fb('0x11')]['agentLogin']=function(_0xd6967f,_0x54d562){var _0x107208={'role':_0x37fb('0x51')};_0x107208[_0xd6967f]=this['channel'][_0x37fb('0x3b')];var _0x22cb67=_0xd6967f!='internal'?util['format'](_0x37fb('0x53'),_0x37fb('0x54'),this['channel'][_0x37fb('0x3b')]):undefined;this[_0x37fb('0xf')][_0x37fb('0x55')](_0x107208,_0x22cb67)[_0x37fb('0x14')](function(_0x249bb9){_0x54d562(null,_['isNil'](_0x249bb9)?![]:!![]);})[_0x37fb('0x16')](function(_0x79c4fc){logger[_0x37fb('0x2e')](_0x79c4fc);_0x54d562(null,![]);});};AGIVertices[_0x37fb('0x11')]['shellCommand']=function(_0x38f8b0,_0x3641ba){sh[_0x37fb('0x56')](_[_0x37fb('0x57')](_0x38f8b0),function(_0x259525,_0x35df02){var _0x2fcd53=_0x35df02[_0x37fb('0x58')](/(\r\n|\n|\r)/gm,'');_0x3641ba(null,_0x2fcd53);});};AGIVertices[_0x37fb('0x11')]['googleCloudTTS']=function(_0x1e3560,_0x4c6c17){scripts[_0x37fb('0x59')](_0x1e3560[_0x37fb('0x5a')],_0x1e3560[_0x37fb('0x5b')]||_0x37fb('0x5c'),_0x1e3560['text'],_0x1e3560[_0x37fb('0x5d')]||_0x37fb('0x5e'),_0x1e3560[_0x37fb('0x5f')]||_0x37fb('0x60'),_0x1e3560[_0x37fb('0x61')]||_0x37fb('0x62'))[_0x37fb('0x14')](function(_0x36adaa){_0x4c6c17(null,_0x36adaa);})[_0x37fb('0x16')](function(_0x280f1a){_0x4c6c17(_0x280f1a);});};AGIVertices[_0x37fb('0x11')][_0x37fb('0x63')]=function(_0x2e87b4,_0x33c1f7){scripts[_0x37fb('0x63')](_0x2e87b4[_0x37fb('0x5c')],_0x2e87b4[_0x37fb('0x64')]||'en',0x1)[_0x37fb('0x14')](function(_0x3dee45){_0x33c1f7(null,_0x3dee45);})[_0x37fb('0x16')](function(_0x3322ca){_0x33c1f7(_0x3322ca);});};AGIVertices[_0x37fb('0x11')][_0x37fb('0x65')]=function(_0x421817,_0x11741b){var _0x23883e={'uri':_0x421817[_0x37fb('0x66')],'method':_0x421817['method'],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x421817['timeout'])===_0x37fb('0x67')&&parseInt(_0x421817['timeout'])>=0x1?parseInt(_0x421817[_0x37fb('0x68')])*0x3e8:0x5*0x3e8};if(_[_0x37fb('0x69')]([_0x37fb('0x6a'),_0x37fb('0x6b')],_0x23883e[_0x37fb('0x6c')]['toUpperCase']())){try{_0x23883e['body']=_0x421817[_0x37fb('0xd')]?JSON[_0x37fb('0x6d')](_0x421817['rawBody']):{};}catch(_0x2c6716){logger[_0x37fb('0x2e')](_0x37fb('0x6e'),_0x2c6716);}}try{_0x23883e[_0x37fb('0x6f')]=_0x421817[_0x37fb('0xc')]?JSON['parse'](_0x421817['rawHeaders']):{};}catch(_0x40c554){logger['error']('An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function',_0x40c554);}if(_0x421817[_0x37fb('0x70')]){try{var _0x5207d5=require(_0x421817[_0x37fb('0x70')])['sync'](this,_0x23883e);_0x23883e[_0x37fb('0x71')]=Mustache['render'](_0x421817[_0x37fb('0x66')],_0x5207d5,{},['$$','$$']);if(_0x23883e[_0x37fb('0x6f')]){_0x23883e['headers']=JSON['parse'](Mustache[_0x37fb('0x72')](JSON[_0x37fb('0x73')](_0x23883e[_0x37fb('0x6f')]),_0x5207d5,{},['$$','$$']));}if(_0x23883e[_0x37fb('0x74')]){_0x23883e[_0x37fb('0x74')]=JSON[_0x37fb('0x6d')](Mustache[_0x37fb('0x72')](JSON[_0x37fb('0x73')](_0x23883e[_0x37fb('0x74')]),_0x5207d5,{},['$$','$$']));}}catch(_0x2fc545){logger[_0x37fb('0x2e')]('An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function',_0x2fc545);}}rp(_0x23883e)[_0x37fb('0x14')](function(_0x53315d){var _0x545366={'statusCode':_0x53315d['statusCode']||0xc8,'statusMessage':_0x53315d[_0x37fb('0x75')]||'OK','headers':_0x53315d[_0x37fb('0x6f')]||{},'body':_0x53315d['body']||{}};_0x11741b(null,_0x545366);})[_0x37fb('0x16')](function(_0xb5320d){var _0xf9cabe={'statusCode':_0xb5320d[_0x37fb('0x76')]||0x1f4,'statusMessage':_0xb5320d['message']||_0x37fb('0x77'),'headers':_0xb5320d['options']['headers']||{},'body':_0xb5320d[_0x37fb('0x78')][_0x37fb('0x74')]||{}};_0x11741b(null,_0xf9cabe);});};AGIVertices[_0x37fb('0x11')][_0x37fb('0x79')]=function(_0x1d8dbe,_0xcac83e){scripts['googleDialogflow'](this[_0x37fb('0xe')]['uniqueid'],_0x1d8dbe[_0x37fb('0x7a')],_0x1d8dbe[_0x37fb('0x5c')],_0x1d8dbe[_0x37fb('0x7b')]||'en')[_0x37fb('0x14')](function(_0x3481c9){_0xcac83e(null,_0x3481c9);})[_0x37fb('0x16')](function(_0x1c551e){_0xcac83e(_0x1c551e);});};AGIVertices[_0x37fb('0x11')]['googleDialogflowV2']=function(_0x3ceb27,_0x42be10){scripts['googleDialogflowV2'](this['channel'][_0x37fb('0x39')],_0x3ceb27[_0x37fb('0x7c')],_0x3ceb27[_0x37fb('0x7d')],_0x3ceb27['private_key'],_0x3ceb27[_0x37fb('0x5c')],_0x3ceb27[_0x37fb('0x7e')]||'en')[_0x37fb('0x14')](function(_0xad4be5){_0x42be10(null,_0xad4be5);})[_0x37fb('0x16')](function(_0x2a157f){_0x42be10(_0x2a157f);});};AGIVertices[_0x37fb('0x11')][_0x37fb('0x7f')]=function(_0x1e3b84,_0x266797){scripts['sestekNDA'](this['channel'],_0x1e3b84)[_0x37fb('0x14')](function(_0x1de059){_0x266797(null,_0x1de059);})[_0x37fb('0x16')](function(_0x2b9772){_0x266797(_0x2b9772);});};AGIVertices[_0x37fb('0x11')]['ispeechTTS']=function(_0x325242,_0x24fd83){scripts[_0x37fb('0x80')](_0x325242[_0x37fb('0x7a')],_0x325242[_0x37fb('0x5c')],_0x325242[_0x37fb('0x81')]||_0x37fb('0x5e'),_0x325242[_0x37fb('0x82')])[_0x37fb('0x14')](function(_0x15c106){_0x24fd83(null,_0x15c106);})[_0x37fb('0x16')](function(_0x2df555){_0x24fd83(_0x2df555);});};AGIVertices[_0x37fb('0x11')][_0x37fb('0x83')]=function(_0x5700b3,_0x5a4409,_0x441603){scripts[_0x37fb('0x83')](_0x5a4409,_0x5700b3[_0x37fb('0x7a')],_0x5700b3['ispeech_asr_language']||_0x37fb('0x5e'),this['isConfigured'](_0x5700b3[_0x37fb('0x84')])?_0x5700b3['model']:undefined)['then'](function(_0x188f10){_0x441603(null,_0x188f10);})[_0x37fb('0x16')](function(_0x1edc92){_0x441603(_0x1edc92);});};AGIVertices[_0x37fb('0x11')][_0x37fb('0x85')]=function(_0xe175eb,_0x112737){scripts[_0x37fb('0x85')](_0xe175eb[_0x37fb('0x86')],_0xe175eb['aws_secret_access_key'],_0xe175eb['aws_polly_region'],_0xe175eb[_0x37fb('0x87')]||_0x37fb('0x88'),_0xe175eb[_0x37fb('0x5c')],_0xe175eb[_0x37fb('0x89')]||'text')['then'](function(_0x19b7bf){_0x112737(null,_0x19b7bf);})[_0x37fb('0x16')](function(_0x268ac3){_0x112737(_0x268ac3);});};AGIVertices['prototype']['awsLex']=function(_0x4cb6ff,_0x19c86c){scripts['awsLex'](this[_0x37fb('0xe')][_0x37fb('0x39')],_0x4cb6ff[_0x37fb('0x86')],_0x4cb6ff['aws_secret_access_key'],_0x4cb6ff[_0x37fb('0x8a')],_0x4cb6ff['text'],_0x4cb6ff[_0x37fb('0x8b')])[_0x37fb('0x14')](function(_0x5c331c){_0x19c86c(null,_0x5c331c);})[_0x37fb('0x16')](function(_0x49e3ea){_0x19c86c(_0x49e3ea);});};AGIVertices[_0x37fb('0x11')][_0x37fb('0x8c')]=function(_0x3a1914,_0x50d0d2,_0x313f38){scripts['googleASR'](_0x50d0d2,_0x3a1914[_0x37fb('0x7a')],_0x3a1914[_0x37fb('0x8d')]||_0x37fb('0x5e'))[_0x37fb('0x14')](function(_0x16ae98){_0x313f38(null,_0x16ae98);})[_0x37fb('0x16')](function(_0x2b4e8e){_0x313f38(_0x2b4e8e);});};AGIVertices[_0x37fb('0x11')]['tildeASR']=function(_0x434fc1,_0x2e56f2,_0xa0a3b5){scripts['tildeASR'](_0x2e56f2,_0x434fc1[_0x37fb('0x8e')],_0x434fc1[_0x37fb('0x8f')],_0x434fc1[_0x37fb('0x71')])['then'](function(_0x5ab0c9){_0xa0a3b5(null,_0x5ab0c9);})[_0x37fb('0x16')](function(_0x5d3d9d){_0xa0a3b5(_0x5d3d9d);});};AGIVertices[_0x37fb('0x11')]['clear']=function(_0x1a0f5f){var _0x1b0f48=_[_0x37fb('0x69')](verticesWithRetry,_0x1a0f5f[_0x37fb('0x3a')])?_0x1a0f5f:_[_0x37fb('0x90')](_0x1a0f5f);for(var _0x209c04 in _0x1b0f48){if(_0x1b0f48[_0x37fb('0x91')](_0x209c04)){if(_0x1b0f48[_0x209c04]&&_[_0x37fb('0x92')](_0x1b0f48[_0x209c04])){if(_[_0x37fb('0x69')](recursiveMapAttributes,_0x209c04)){_0x1b0f48[_0x209c04]=this['replaceObjectAllVariables'](_0x1b0f48[_0x209c04]);}else{_0x1b0f48[_0x209c04]=this[_0x37fb('0x93')](_0x1b0f48[_0x209c04]);}}}}return _0x1b0f48;};AGIVertices[_0x37fb('0x11')][_0x37fb('0x94')]=function(_0x202427){for(var _0x3751dc in _0x202427){if(_0x202427[_0x37fb('0x91')](_0x3751dc)){if(_[_0x37fb('0x95')](_0x202427[_0x3751dc])){this['recursiveNodeIndex'](_0x202427[_0x3751dc]);}else if(_['isArray'](_0x202427[_0x3751dc])){for(var _0x4c8086=0x0;_0x4c8086<_0x202427[_0x3751dc][_0x37fb('0x96')];_0x4c8086++){this[_0x37fb('0x94')](_0x202427[_0x3751dc][_0x4c8086]);}}else if(_[_0x37fb('0x92')](_0x202427[_0x3751dc])){_0x202427[_0x3751dc]=this[_0x37fb('0x93')](_0x202427[_0x3751dc]);}}}};AGIVertices[_0x37fb('0x11')][_0x37fb('0x97')]=function(_0x12d56e,_0x2dd852){for(var _0x162f8a in _0x12d56e){if(_0x12d56e[_0x37fb('0x91')](_0x162f8a)){if(_['isPlainObject'](_0x12d56e[_0x162f8a])){if(!_[_0x37fb('0x45')](_0x12d56e[_0x162f8a])){this[_0x37fb('0x97')](_0x12d56e[_0x162f8a],util[_0x37fb('0x98')](_0x37fb('0x99'),_0x2dd852,_0x162f8a));}}else if(_[_0x37fb('0x9a')](_0x12d56e[_0x162f8a])){for(var _0x4078b4=0x0;_0x4078b4<_0x12d56e[_0x162f8a][_0x37fb('0x96')];_0x4078b4++){this[_0x37fb('0x97')](_0x12d56e[_0x162f8a][_0x4078b4],util[_0x37fb('0x98')]('%s.%s',_0x2dd852,_0x162f8a+'['+_0x4078b4+']'));}}else{if(!_[_0x37fb('0x47')](_0x12d56e[_0x162f8a])){this[_0x37fb('0xe')][_0x37fb('0x9b')](util[_0x37fb('0x98')](_0x37fb('0x99'),_0x2dd852,_0x162f8a),_0x12d56e[_0x162f8a]);}}}}};AGIVertices['prototype'][_0x37fb('0x9c')]=function(_0x425c88){try{var _0x641a5c=JSON[_0x37fb('0x6d')](_0x425c88);this['recursiveNodeIndex'](_0x641a5c);return JSON[_0x37fb('0x73')](_0x641a5c);}catch(_0xb85177){return this['replaceAllVariables'](_0x425c88);}};AGIVertices[_0x37fb('0x11')][_0x37fb('0x93')]=function(_0x3c4381){var _0x2b79be=_0x3c4381[_0x37fb('0x9d')]('{');for(var _0x4d35bc=0x1;_0x4d35bc<_0x2b79be[_0x37fb('0x96')];_0x4d35bc+=0x1){var _0x3dd03d=_0x2b79be[_0x4d35bc][_0x37fb('0x9d')]('}');if(_0x3dd03d[_0x37fb('0x96')]>0x1){_0x3c4381=_0x3c4381[_0x37fb('0x9e')]('{'+_0x3dd03d[0x0]+'}',this[_0x37fb('0xe')][_0x37fb('0x12')](_0x3dd03d[0x0])['extra']||_0x3dd03d[0x0]);}}if(_0x2b79be['length']===0x1){return _0x3c4381[_0x37fb('0x4c')]();}return this[_0x37fb('0x93')](_0x3c4381);};AGIVertices[_0x37fb('0x11')][_0x37fb('0x9f')]=function(_0x1b36e5,_0x55bd1a){var _0x27d7b8=this['channel'][_0x37fb('0x12')](_0x1b36e5);if(_0x27d7b8[_0x37fb('0xa0')]===-0x1){return _0x27d7b8;}logger[_0x37fb('0x30')](util[_0x37fb('0x98')](_0x37fb('0xa1'),_0x55bd1a,_0x27d7b8[_0x37fb('0xa2')]));return this[_0x37fb('0xe')]['setVariable'](_0x55bd1a,_0x27d7b8[_0x37fb('0xa2')]);};AGIVertices[_0x37fb('0x11')]['isConfigured']=function(_0xa5ca03){return _0xa5ca03&&_0xa5ca03!=='0'&&_0xa5ca03!=='-1'&&_0xa5ca03!=='';};AGIVertices[_0x37fb('0x11')][_0x37fb('0xa3')]=function(_0x3b0683){this[_0x37fb('0x38')]['sync'](this,_0x3b0683,'-');_0x3b0683[_0x37fb('0xa4')]=_0x3b0683[_0x37fb('0xa3')];return{'code':0xc8,'result':'-'};};AGIVertices[_0x37fb('0x11')][_0x37fb('0xa5')]=function(_0x25e9e1){logger['info'](util[_0x37fb('0x98')](_0x37fb('0xa6'),_0x25e9e1['label']));if(!this['isConfigured'](_0x25e9e1[_0x37fb('0x5c')])){return this[_0x37fb('0xe')][_0x37fb('0xa7')](_0x37fb('0xa8'));}var _0x3e9c40='\x22'+_0x25e9e1[_0x37fb('0x5c')]+'\x22';if(this['isConfigured'](_0x25e9e1[_0x37fb('0x78')])){_0x3e9c40+=','+_0x25e9e1[_0x37fb('0x78')];}var _0xafed41=this[_0x37fb('0xe')]['exec'](_0x37fb('0xa9'),_0x3e9c40);if(_0xafed41['result']===-0x1){return _0xafed41;}return this['channel'][_0x37fb('0xa7')](util['format']('Executed\x20command\x20MRCPSynth\x20%s',_0x3e9c40));};AGIVertices[_0x37fb('0x11')][_0x37fb('0xaa')]=function(_0x22e50f){logger[_0x37fb('0x30')](util[_0x37fb('0x98')](_0x37fb('0xab'),_0x22e50f['label']));if(!this[_0x37fb('0xac')](_0x22e50f[_0x37fb('0xad')])){return this['channel'][_0x37fb('0xa7')]('no\x20grammar\x20configured');}var _0x16779f=_0x22e50f[_0x37fb('0xad')];if(this[_0x37fb('0xac')](_0x22e50f[_0x37fb('0x78')])){_0x16779f+=','+_0x22e50f[_0x37fb('0x78')];}var _0x44d7f3=this[_0x37fb('0xe')][_0x37fb('0x56')](_0x37fb('0xae'),_0x16779f);if(_0x44d7f3[_0x37fb('0xa0')]===-0x1){return _0x44d7f3;}var _0x38f5f8=this[_0x37fb('0x9f')](_0x37fb('0xaf'),'MRCP_RECOG_CONFIDENCE');if(_0x38f5f8[_0x37fb('0xa0')]===-0x1){return _0x38f5f8;}var _0x541b59=this['getAndSetVariable'](_0x37fb('0xb0'),_0x37fb('0xb1'));if(_0x541b59['result']===-0x1){return _0x541b59;}var _0x159e7e=this[_0x37fb('0x9f')](_0x37fb('0xb2'),_0x37fb('0xb3'));if(_0x159e7e[_0x37fb('0xa0')]===-0x1){return _0x159e7e;}return this[_0x37fb('0xe')]['noop'](util[_0x37fb('0x98')](_0x37fb('0xb4'),_0x16779f));};AGIVertices[_0x37fb('0x11')][_0x37fb('0xb5')]=function(_0xf222f3){logger['info'](util[_0x37fb('0x98')](_0x37fb('0xb6'),_0xf222f3[_0x37fb('0xb7')]));return this[_0x37fb('0xe')]['agi']([_0xf222f3[_0x37fb('0xb8')],_0xf222f3[_0x37fb('0xb9')]]);};AGIVertices[_0x37fb('0x11')][_0x37fb('0xba')]=function(_0x41b817){logger[_0x37fb('0x30')](util[_0x37fb('0x98')](_0x37fb('0xbb'),_0x41b817[_0x37fb('0xb7')]));if(this[_0x37fb('0xac')](_0x41b817['timeout'])){logger[_0x37fb('0x30')](util['format'](_0x37fb('0xbc'),_0x41b817[_0x37fb('0x68')]));var _0x2e1593=this['channel'][_0x37fb('0xbd')](_0x41b817['timeout']);if(_0x2e1593[_0x37fb('0xa0')]===-0x1){return _0x2e1593;}}return this[_0x37fb('0xe')][_0x37fb('0xba')]();};AGIVertices[_0x37fb('0x11')][_0x37fb('0x4a')]=function(_0x13d048){logger[_0x37fb('0x30')](util[_0x37fb('0x98')]('Enter\x20in\x20CALLBACK\x20(%s)\x20block',_0x13d048['label']));if(!this[_0x37fb('0xac')](_0x13d048['list_id'])){return this['channel'][_0x37fb('0x2e')](_0x13d048,_0x37fb('0xbe'));}_0x13d048[_0x37fb('0x4b')]=moment();if(this[_0x37fb('0xac')](_0x13d048[_0x37fb('0xbf')])){_0x13d048[_0x37fb('0x4b')]=moment()[_0x37fb('0xc0')](_0x13d048[_0x37fb('0xbf')],_0x37fb('0xc1'));}if(!this[_0x37fb('0xac')](_0x13d048[_0x37fb('0x4d')])){_0x13d048[_0x37fb('0x4d')]=0x2;}this['createCmContact'][_0x37fb('0xc2')](this,_0x13d048);return this[_0x37fb('0xe')][_0x37fb('0xa7')](util['format'](_0x37fb('0xc3'),_0x13d048[_0x37fb('0x48')],_0x13d048[_0x37fb('0x49')],_0x13d048[_0x37fb('0x4b')]));};AGIVertices[_0x37fb('0x11')][_0x37fb('0xc4')]=function(_0x5c4a28){logger[_0x37fb('0x30')](util['format'](_0x37fb('0xc5'),_0x5c4a28[_0x37fb('0xb7')]));var _0x33790e=this['channel'][_0x37fb('0x56')](_0x5c4a28['application'],_0x5c4a28[_0x37fb('0x78')]);if(_0x33790e[_0x37fb('0xa0')]===-0x1){return _0x33790e;}return this['channel'][_0x37fb('0xa7')](util['format'](_0x37fb('0xc6'),_0x5c4a28['application'],_0x5c4a28[_0x37fb('0x78')]));};AGIVertices[_0x37fb('0x11')]['lumenvoxtts']=function(_0x5e678f){logger[_0x37fb('0x30')](util[_0x37fb('0x98')](_0x37fb('0xc7'),_0x5e678f['label']));if(!this['isConfigured'](_0x5e678f[_0x37fb('0x5c')])){return this['channel'][_0x37fb('0xa7')]('no\x20text\x20configured');}var _0x3fc73a='\x22'+_0x5e678f['text']+'\x22';if(this[_0x37fb('0xac')](_0x5e678f[_0x37fb('0x78')])){_0x3fc73a+=','+_0x5e678f[_0x37fb('0x78')];}var _0x23bf88=this[_0x37fb('0xe')][_0x37fb('0x56')](_0x37fb('0xa9'),_0x3fc73a);if(_0x23bf88[_0x37fb('0xa0')]===-0x1){return _0x23bf88;}return this[_0x37fb('0xe')]['noop'](util[_0x37fb('0x98')](_0x37fb('0xc8'),_0x3fc73a));};AGIVertices[_0x37fb('0x11')][_0x37fb('0xc9')]=function(_0x55e04f){logger['info'](util[_0x37fb('0x98')]('Enter\x20in\x20SESTEKTTS\x20(%s)\x20block',_0x55e04f[_0x37fb('0xb7')]));if(!this[_0x37fb('0xac')](_0x55e04f[_0x37fb('0x5c')])){return this[_0x37fb('0xe')]['noop']('no\x20text\x20configured');}var _0x5ed6c1='\x22'+_0x55e04f[_0x37fb('0x5c')]+'\x22';if(this[_0x37fb('0xac')](_0x55e04f[_0x37fb('0x78')])){_0x5ed6c1+=','+_0x55e04f[_0x37fb('0x78')];}var _0xf3bf47=this['channel']['exec'](_0x37fb('0xa9'),_0x5ed6c1);if(_0xf3bf47[_0x37fb('0xa0')]===-0x1){return _0xf3bf47;}return this[_0x37fb('0xe')][_0x37fb('0xa7')](util[_0x37fb('0x98')](_0x37fb('0xc8'),_0x5ed6c1));};AGIVertices[_0x37fb('0x11')][_0x37fb('0xca')]=function(_0x55d0f6){logger[_0x37fb('0x30')](util[_0x37fb('0x98')](_0x37fb('0xcb'),_0x55d0f6[_0x37fb('0xb7')]));if(!this[_0x37fb('0xac')](_0x55d0f6[_0x37fb('0xad')])){return this['channel']['noop'](_0x37fb('0xcc'));}var _0x5e0809=_0x55d0f6[_0x37fb('0xad')];if(this['isConfigured'](_0x55d0f6[_0x37fb('0x78')])){_0x5e0809+=','+_0x55d0f6[_0x37fb('0x78')];}var _0x2d32da=this[_0x37fb('0xe')]['exec'](_0x37fb('0xae'),_0x5e0809);if(_0x2d32da[_0x37fb('0xa0')]===-0x1){return _0x2d32da;}var _0x50285a=this['getAndSetVariable'](_0x37fb('0xaf'),_0x37fb('0xcd'));if(_0x50285a[_0x37fb('0xa0')]===-0x1){return _0x50285a;}var _0x7f8195=this['getAndSetVariable'](_0x37fb('0xb0'),_0x37fb('0xce'));if(_0x7f8195[_0x37fb('0xa0')]===-0x1){return _0x7f8195;}var _0x486f39=this['getAndSetVariable'](_0x37fb('0xb2'),_0x37fb('0xcf'));if(_0x486f39[_0x37fb('0xa0')]===-0x1){return _0x486f39;}return this[_0x37fb('0xe')][_0x37fb('0xa7')](util[_0x37fb('0x98')](_0x37fb('0xb4'),_0x5e0809));};AGIVertices[_0x37fb('0x11')]['sestekasr']=function(_0x4dc2b5){logger['info'](util[_0x37fb('0x98')](_0x37fb('0xd0'),_0x4dc2b5['label']));if(!this[_0x37fb('0xac')](_0x4dc2b5[_0x37fb('0xad')])){return this['channel'][_0x37fb('0xa7')](_0x37fb('0xcc'));}var _0x1b17a9=_0x4dc2b5[_0x37fb('0xad')];if(this[_0x37fb('0xac')](_0x4dc2b5[_0x37fb('0x78')])){_0x1b17a9+=','+_0x4dc2b5[_0x37fb('0x78')];}var _0x143edf=this[_0x37fb('0xe')]['exec'](_0x37fb('0xae'),_0x1b17a9);if(_0x143edf[_0x37fb('0xa0')]===-0x1){return _0x143edf;}var _0x5e0dfd=this[_0x37fb('0x9f')](_0x37fb('0xaf'),'SESTEK_ASR_CONFIDENCE');if(_0x5e0dfd[_0x37fb('0xa0')]===-0x1){return _0x5e0dfd;}var _0x5b19aa=this[_0x37fb('0x9f')](_0x37fb('0xb0'),_0x37fb('0xd1'));if(_0x5b19aa[_0x37fb('0xa0')]===-0x1){return _0x5b19aa;}var _0x91f29a=this[_0x37fb('0x9f')](_0x37fb('0xb2'),'SESTEK_ASR_INSTANCE');if(_0x91f29a[_0x37fb('0xa0')]===-0x1){return _0x91f29a;}return this[_0x37fb('0xe')][_0x37fb('0xa7')](util['format'](_0x37fb('0xb4'),_0x1b17a9));};AGIVertices[_0x37fb('0x11')][_0x37fb('0xd2')]=function(_0x175fdd){logger[_0x37fb('0x30')](util[_0x37fb('0x98')](_0x37fb('0xd3'),_0x175fdd[_0x37fb('0xb7')]));if(!this[_0x37fb('0xac')](_0x175fdd[_0x37fb('0xd4')])){return this['channel'][_0x37fb('0x2e')](_0x175fdd,'no\x20database\x20selected');}var _0x2a1ea9=this[_0x37fb('0x1a')]['sync'](this,_0x175fdd['odbc_id']);if(!_0x2a1ea9){return this[_0x37fb('0xe')][_0x37fb('0x2e')](_0x175fdd,_0x37fb('0xd5'));}if(!this[_0x37fb('0xac')](_0x175fdd[_0x37fb('0x32')])){return this[_0x37fb('0xe')][_0x37fb('0x2e')](_0x175fdd,_0x37fb('0xd6'));}var _0x312cb1=_0x175fdd[_0x37fb('0x32')][_0x37fb('0x58')](/(\r\n|\n|\r)/gm,'\x20');this['channel'][_0x37fb('0xa7')](util['format'](_0x37fb('0xd7'),_0x312cb1));var _0x58f091=this[_0x37fb('0xd8')][_0x37fb('0xc2')](this,_0x2a1ea9,_0x312cb1);this['createSquareDetailsReport']['sync'](this,_0x175fdd,_0x312cb1);if(!this[_0x37fb('0xac')](_0x175fdd[_0x37fb('0xd9')])){return this[_0x37fb('0xe')][_0x37fb('0xa7')](_0x37fb('0xda'));}var _0x770840=this[_0x37fb('0x12')][_0x37fb('0xc2')](this,_0x175fdd['variable_id']);if(!_0x770840){return this[_0x37fb('0xe')][_0x37fb('0x2e')](_0x175fdd,_0x37fb('0xdb'));}var _0x8fc48=this;_0x58f091[_0x37fb('0xdc')](function(_0x213eb1,_0x1fc76c){Object[_0x37fb('0xdd')](_0x213eb1)[_0x37fb('0xdc')](function(_0x464be3){_0x8fc48[_0x37fb('0xe')][_0x37fb('0x9b')](util[_0x37fb('0x98')]('%s[%s][%s]',_0x770840,_0x1fc76c,_0x464be3),_0x213eb1[_0x464be3]);});});this[_0x37fb('0xe')][_0x37fb('0x9b')](util[_0x37fb('0x98')](_0x37fb('0xde'),_0x770840),_0x58f091[_0x37fb('0x96')]);return this[_0x37fb('0xe')][_0x37fb('0xa7')](util['format'](_0x37fb('0xdf'),_0x770840));};AGIVertices[_0x37fb('0x11')][_0x37fb('0xe0')]=function(_0x712d38){logger[_0x37fb('0xe1')](util[_0x37fb('0x98')]('Enter\x20in\x20DIAL\x20(%s)\x20block',_0x712d38['label']));if(!this['isConfigured'](_0x712d38[_0x37fb('0xe2')])){return this[_0x37fb('0xe')][_0x37fb('0x2e')](_0x712d38,_0x37fb('0xe3'));}var _0x566fbd=this[_0x37fb('0x1d')][_0x37fb('0xc2')](this,_0x712d38['sip_id']);if(!_0x566fbd){return this[_0x37fb('0xe')]['error'](_0x712d38,_0x37fb('0xe4'));}var _0x4b801a=this[_0x37fb('0xe')][_0x37fb('0x56')](_0x37fb('0xe5'),[util['format']('SIP/%s',_0x566fbd),_0x712d38[_0x37fb('0x68')],_0x712d38[_0x37fb('0xe6')],_0x712d38[_0x37fb('0x66')]]);if(_0x4b801a[_0x37fb('0xa0')]===-0x1){return _0x4b801a;}return this[_0x37fb('0xe')][_0x37fb('0xa7')](util['format']('Executed\x20command\x20%s','DIAL'));};AGIVertices[_0x37fb('0x11')][_0x37fb('0xe7')]=function(_0x43fd93){logger[_0x37fb('0x30')](util[_0x37fb('0x98')](_0x37fb('0xe8'),_0x43fd93[_0x37fb('0xb7')]));if(!this[_0x37fb('0xac')](_0x43fd93['key'])){return this[_0x37fb('0xe')][_0x37fb('0xa7')](_0x37fb('0xe9'));}if(!this[_0x37fb('0xac')](_0x43fd93[_0x37fb('0x5c')])){return this[_0x37fb('0xe')][_0x37fb('0xa7')]('no\x20text\x20configured');}this['channel'][_0x37fb('0xea')]=!![];this[_0x37fb('0x38')](_0x43fd93);this[_0x37fb('0x42')](_0x43fd93[_0x37fb('0x5c')],'in','','');this['channel']['noop'](util[_0x37fb('0x98')](_0x37fb('0xeb'),_0x43fd93[_0x37fb('0x5c')]));var _0x5494e9=this[_0x37fb('0x79')][_0x37fb('0xc2')](this,_0x43fd93);if(_0x5494e9){for(var _0x420105 in _0x5494e9){if(_0x5494e9[_0x37fb('0x91')](_0x420105)){this[_0x37fb('0xe')][_0x37fb('0x9b')](util[_0x37fb('0x98')]('DIALOGFLOW_%s',_0x420105[_0x37fb('0xec')]()),_0x5494e9[_0x420105]);}}this[_0x37fb('0x42')](_0x5494e9[_0x37fb('0xed')],'out','dialogflow','');return this[_0x37fb('0xe')][_0x37fb('0xa7')](util[_0x37fb('0x98')](_0x37fb('0xee'),_0x5494e9[_0x37fb('0xed')]));}return this[_0x37fb('0xe')][_0x37fb('0x2e')](_0x43fd93,'Dialogflow\x20is\x20unreachable');};AGIVertices['prototype'][_0x37fb('0xef')]=function(_0x5ebbd4){logger['info'](util[_0x37fb('0x98')](_0x37fb('0xf0'),_0x5ebbd4[_0x37fb('0xb7')]));if(!this[_0x37fb('0xac')](_0x5ebbd4[_0x37fb('0x7c')])){return this[_0x37fb('0xe')][_0x37fb('0xa7')](_0x37fb('0xf1'));}if(!this[_0x37fb('0xac')](_0x5ebbd4['client_email'])){return this['channel'][_0x37fb('0xa7')](_0x37fb('0xf2'));}if(!this[_0x37fb('0xac')](_0x5ebbd4[_0x37fb('0xf3')])){return this[_0x37fb('0xe')][_0x37fb('0xa7')](_0x37fb('0xf4'));}if(!this[_0x37fb('0xac')](_0x5ebbd4[_0x37fb('0x7e')])){return this[_0x37fb('0xe')][_0x37fb('0xa7')](_0x37fb('0xf5'));}if(!this['isConfigured'](_0x5ebbd4['text'])){return this[_0x37fb('0xe')]['noop']('no\x20text\x20configured');}this[_0x37fb('0xe')][_0x37fb('0xea')]=!![];this[_0x37fb('0x38')](_0x5ebbd4);this[_0x37fb('0x42')](_0x5ebbd4[_0x37fb('0x5c')],'in','','');this[_0x37fb('0xe')][_0x37fb('0xa7')](util[_0x37fb('0x98')]('Trying\x20DialogflowV2:\x20%s',_0x5ebbd4[_0x37fb('0x5c')]));var _0x382b60=this[_0x37fb('0xf6')][_0x37fb('0xc2')](this,_0x5ebbd4);if(_0x382b60){for(var _0x236c63 in _0x382b60){if(_0x382b60[_0x37fb('0x91')](_0x236c63)){if(_0x236c63!==_0x37fb('0xf7')){this[_0x37fb('0xe')]['setVariable'](util[_0x37fb('0x98')]('DIALOGFLOW_%s',_0x236c63[_0x37fb('0xec')]()),_0x382b60[_0x236c63]);}}}this[_0x37fb('0x42')](_0x382b60[_0x37fb('0xed')],_0x37fb('0xf8'),_0x37fb('0xef'),_0x382b60['providerResponse']);return this[_0x37fb('0xe')][_0x37fb('0xa7')](util[_0x37fb('0x98')]('DialogflowV2\x20Result\x20%s',_0x382b60[_0x37fb('0xed')]));}return this[_0x37fb('0xe')]['error'](_0x5ebbd4,_0x37fb('0xf9'));};AGIVertices[_0x37fb('0x11')][_0x37fb('0xfa')]=function(_0x1699f5){logger[_0x37fb('0x30')](util[_0x37fb('0x98')](_0x37fb('0xfb'),_0x1699f5[_0x37fb('0xb7')]));if(!this[_0x37fb('0xac')](_0x1699f5[_0x37fb('0xfc')])){return this['channel'][_0x37fb('0xa7')]('no\x20ndauth\x20url\x20configured');}if(!this[_0x37fb('0xac')](_0x1699f5[_0x37fb('0xfd')])){return this[_0x37fb('0xe')][_0x37fb('0xa7')](_0x37fb('0xfe'));}if(!this[_0x37fb('0xac')](_0x1699f5[_0x37fb('0xff')])){return this[_0x37fb('0xe')]['noop'](_0x37fb('0x100'));}if(!this[_0x37fb('0xac')](_0x1699f5[_0x37fb('0x101')])){return this[_0x37fb('0xe')]['noop']('no\x20text\x20configured');}this[_0x37fb('0xe')][_0x37fb('0xea')]=!![];this['createSquareDetailsReport'](_0x1699f5);this['createSquareMessage'](_0x1699f5[_0x37fb('0x5c')],'in','','');this['channel'][_0x37fb('0xa7')](util['format']('Trying\x20SestekNDA:\x20%s',_0x1699f5[_0x37fb('0x5c')]));var _0x5dbe62=this[_0x37fb('0x7f')][_0x37fb('0xc2')](this,_0x1699f5);if(_0x5dbe62){for(var _0x3c7f79 in _0x5dbe62){if(_0x5dbe62['hasOwnProperty'](_0x3c7f79)){this['channel'][_0x37fb('0x9b')](util[_0x37fb('0x98')](_0x37fb('0x102'),_0x3c7f79[_0x37fb('0xec')]()),_0x5dbe62[_0x3c7f79]);}}this[_0x37fb('0x42')](_0x5dbe62['speech'],'out',_0x37fb('0xfa'),'');if(_0x5dbe62[_0x37fb('0x103')]){this[_0x37fb('0xe')][_0x37fb('0xa7')](util[_0x37fb('0x98')]('Sestek\x20NDA\x20%s\x20file\x20created',_0x5dbe62[_0x37fb('0x103')]));var _0x410d8a=this['channel'][_0x37fb('0x104')](_0x5dbe62[_0x37fb('0x103')]);try{fs['unlink'](_0x5dbe62[_0x37fb('0x103')]+_0x37fb('0x105'));}catch(_0x4e9982){logger[_0x37fb('0x2e')](_0x4e9982);}return _0x410d8a;}else{return this[_0x37fb('0xe')][_0x37fb('0xa7')](util[_0x37fb('0x98')](_0x37fb('0x106'),_0x5dbe62[_0x37fb('0xed')]));}}return this[_0x37fb('0xe')][_0x37fb('0x2e')](_0x1699f5,_0x37fb('0x107'));};AGIVertices['prototype'][_0x37fb('0x108')]=function(_0x4951de){logger[_0x37fb('0x30')](util[_0x37fb('0x98')](_0x37fb('0x109'),_0x4951de['label']));return this[_0x37fb('0xe')][_0x37fb('0xa7')](_0x37fb('0x108'));};AGIVertices[_0x37fb('0x11')][_0x37fb('0x10a')]=function(_0x414c46){logger[_0x37fb('0x30')](util['format'](_0x37fb('0x10b'),_0x414c46['label']));var _0x3b54a='';if(_0x414c46[_0x37fb('0x10c')]){if(!this['isConfigured'](_0x414c46['trunk_id'])){return this[_0x37fb('0xe')][_0x37fb('0x2e')](_0x414c46,_0x37fb('0x10d'));}else{var _0x21266c=parseInt(_0x414c46[_0x37fb('0x10c')],0xa);if(isNaN(_0x21266c)){_0x3b54a=_0x414c46[_0x37fb('0x10c')];}else{_0x3b54a=this['getTrunk'][_0x37fb('0xc2')](this,_0x414c46['trunk_id']);if(!_0x3b54a){return this[_0x37fb('0xe')][_0x37fb('0x2e')](_0x414c46,'no\x20trunk\x20found');}}}}else if(_0x414c46[_0x37fb('0x10e')]){_0x3b54a=_0x414c46[_0x37fb('0x10e')];}else{return this[_0x37fb('0xe')][_0x37fb('0x2e')](_0x414c46,_0x37fb('0x10d'));}var _0x2c8ff3=this[_0x37fb('0xe')][_0x37fb('0x56')](_0x37fb('0xe5'),[util[_0x37fb('0x98')](_0x37fb('0x10f'),_0x3b54a,_0x414c46[_0x37fb('0x48')]),_0x414c46['timeout'],_0x414c46[_0x37fb('0xe6')],_0x414c46['url']]);if(_0x2c8ff3['result']===-0x1){return _0x2c8ff3;}return this['channel'][_0x37fb('0xa7')](util[_0x37fb('0x98')]('Executed\x20command\x20%s',_0x37fb('0xe5')));};AGIVertices['prototype']['finally']=function(_0x120f11){logger[_0x37fb('0x30')](util[_0x37fb('0x98')](_0x37fb('0x110'),_0x120f11[_0x37fb('0xb7')]));return this[_0x37fb('0xe')]['noop']('finally');};AGIVertices[_0x37fb('0x11')][_0x37fb('0x111')]=function(_0x4f220d){logger['info'](util['format'](_0x37fb('0x112'),_0x4f220d[_0x37fb('0xb7')]));if(_0x4f220d[_0x37fb('0xa4')]===0x0){return this[_0x37fb('0xa3')](_0x4f220d);}_0x4f220d['retry']-=0x1;if(!this[_0x37fb('0xac')](_0x4f220d[_0x37fb('0x113')])){return this[_0x37fb('0xe')][_0x37fb('0x2e')](_0x4f220d,_0x37fb('0x114'));}var _0x417710=this['getSound'][_0x37fb('0xc2')](this,_0x4f220d[_0x37fb('0x113')]);if(!_0x417710){return this[_0x37fb('0xe')]['error'](_0x4f220d,_0x37fb('0x115'));}if(!this[_0x37fb('0xac')](_0x4f220d[_0x37fb('0xd9')])){return this[_0x37fb('0xe')][_0x37fb('0x2e')](_0x37fb('0xda'));}var _0x2d132a=this[_0x37fb('0xe')][_0x37fb('0x116')](_0x417710,_0x4f220d[_0x37fb('0x117')],_0x4f220d[_0x37fb('0x118')]);var _0x2474fe=_0x2d132a['result']?_0x2d132a[_0x37fb('0xa0')][_0x37fb('0x4c')]():'';logger[_0x37fb('0x30')](_0x37fb('0x119'),JSON[_0x37fb('0x73')](_0x2d132a));if(_0x2d132a[_0x37fb('0xa0')]===-0x1){this[_0x37fb('0x38')][_0x37fb('0xc2')](this,_0x4f220d,_0x2474fe);return _0x2d132a;}else if(_0x2d132a['extra']===_0x37fb('0x68')){_0x2d132a[_0x37fb('0xa0')]=_0x2474fe[_0x37fb('0x96')]>=parseInt(_0x4f220d[_0x37fb('0x11a')])?'x':'i';}else{_0x2d132a[_0x37fb('0xa0')]=_0x2474fe[_0x37fb('0x96')]>=parseInt(_0x4f220d[_0x37fb('0x11a')])&&_0x2474fe[_0x37fb('0x96')]<=parseInt(_0x4f220d[_0x37fb('0x118')])?'x':'i';}var _0x4d167a=this[_0x37fb('0x12')][_0x37fb('0xc2')](this,_0x4f220d[_0x37fb('0xd9')]);if(!_0x4d167a){return this[_0x37fb('0xe')][_0x37fb('0x2e')](_0x4f220d,_0x37fb('0xdb'));}this[_0x37fb('0xe')][_0x37fb('0x9b')](_0x4d167a,_0x2474fe);if(this[_0x37fb('0xac')](_0x4f220d[_0x37fb('0x11b')])){var _0x4003a8=parseInt(_0x4f220d[_0x37fb('0x11b')],0xa);var _0x14956f=rs[_0x37fb('0x11c')]({'charset':'*','length':_0x4003a8});var _0x22dac5=_0x2474fe['length'];if(_0x22dac5>0x0){if(_0x22dac5>_0x4003a8){this['createSquareDetailsReport']['sync'](this,_0x4f220d,_0x4f220d[_0x37fb('0x11d')]===_0x37fb('0x11e')?_0x14956f+_0x2474fe[_0x37fb('0x11f')](_0x4003a8):_0x2474fe[_0x37fb('0x11f')](0x0,_0x22dac5-_0x4003a8)+_0x14956f);}else{this[_0x37fb('0x38')]['sync'](this,_0x4f220d,rs[_0x37fb('0x11c')]({'charset':'*','length':_0x22dac5}));}}else{this[_0x37fb('0x38')][_0x37fb('0xc2')](this,_0x4f220d,'');}}else{this[_0x37fb('0x38')][_0x37fb('0xc2')](this,_0x4f220d,_0x2474fe);}return _0x2d132a;};AGIVertices['prototype']['getsecretdigits']=function(_0x1673e1){logger[_0x37fb('0x30')](util['format']('Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block',_0x1673e1[_0x37fb('0xb7')]));return this[_0x37fb('0x111')](_0x1673e1);};AGIVertices['prototype'][_0x37fb('0x120')]=function(_0x29b509){logger[_0x37fb('0x30')](util[_0x37fb('0x98')](_0x37fb('0x121'),_0x29b509[_0x37fb('0xb7')]));this[_0x37fb('0x38')][_0x37fb('0xc2')](this,_0x29b509,_0x29b509[_0x37fb('0x122')]);return this[_0x37fb('0xe')]['noop'](util['format'](_0x37fb('0x123'),_0x29b509[_0x37fb('0x122')]));};AGIVertices[_0x37fb('0x11')][_0x37fb('0x124')]=function(_0x198e6c){logger[_0x37fb('0x30')](util[_0x37fb('0x98')](_0x37fb('0x125'),_0x198e6c[_0x37fb('0xb7')]));if(!this[_0x37fb('0xac')](_0x198e6c[_0x37fb('0x86')])||!this[_0x37fb('0xac')](_0x198e6c[_0x37fb('0x126')])){return this['channel'][_0x37fb('0xa7')](_0x37fb('0x127'));}if(!this['isConfigured'](_0x198e6c['text'])){return this[_0x37fb('0xe')][_0x37fb('0xa7')](_0x37fb('0xa8'));}this[_0x37fb('0xe')][_0x37fb('0xa7')](util[_0x37fb('0x98')](_0x37fb('0x128'),_0x198e6c[_0x37fb('0x5c')]));var _0x5e6730=this['awsPolly'][_0x37fb('0xc2')](this,_0x198e6c);if(_0x5e6730){this[_0x37fb('0xe')][_0x37fb('0xa7')](util[_0x37fb('0x98')](_0x37fb('0x129'),_0x5e6730));var _0x120184=this[_0x37fb('0xe')][_0x37fb('0x104')](_0x5e6730);try{fs[_0x37fb('0x12a')](_0x5e6730+'.wav');}catch(_0x388620){logger['error'](_0x388620);}return _0x120184;}return this[_0x37fb('0xe')][_0x37fb('0x2e')](_0x198e6c,_0x37fb('0x12b'));};AGIVertices[_0x37fb('0x11')][_0x37fb('0x12c')]=function(_0x44b2a3){logger[_0x37fb('0x30')](util[_0x37fb('0x98')]('Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block',_0x44b2a3[_0x37fb('0xb7')]));if(!this[_0x37fb('0xac')](_0x44b2a3[_0x37fb('0x86')])||!this[_0x37fb('0xac')](_0x44b2a3[_0x37fb('0x126')])){return this['channel'][_0x37fb('0xa7')](_0x37fb('0x127'));}if(!this[_0x37fb('0xac')](_0x44b2a3[_0x37fb('0x8b')])){return this[_0x37fb('0xe')][_0x37fb('0xa7')]('no\x20bot\x20name\x20configured');}if(!this[_0x37fb('0xac')](_0x44b2a3['text'])){return this['channel'][_0x37fb('0xa7')](_0x37fb('0xa8'));}this['channel'][_0x37fb('0xea')]=!![];this[_0x37fb('0x38')](_0x44b2a3);this[_0x37fb('0x42')](_0x44b2a3[_0x37fb('0x5c')],'in','','');this[_0x37fb('0xe')][_0x37fb('0xa7')](util['format']('Trying\x20Amazon\x20Lex:\x20%s',_0x44b2a3[_0x37fb('0x5c')]));var _0x2373e2=this[_0x37fb('0x12d')][_0x37fb('0xc2')](this,_0x44b2a3);if(_0x2373e2){for(var _0x556b18 in _0x2373e2){if(_0x2373e2['hasOwnProperty'](_0x556b18)&&_[_0x37fb('0x92')](_0x2373e2[_0x556b18])){this[_0x37fb('0xe')][_0x37fb('0x9b')](util[_0x37fb('0x98')](_0x37fb('0x12e'),_0x556b18[_0x37fb('0xec')]()),_0x2373e2[_0x556b18]);}}if(_['isNil'](_0x2373e2['message'])){return this[_0x37fb('0xe')][_0x37fb('0xa7')](_0x37fb('0x12f'));}else{this[_0x37fb('0x42')](_0x2373e2[_0x37fb('0x130')],_0x37fb('0xf8'),_0x37fb('0x131'),'');return this[_0x37fb('0xe')][_0x37fb('0xa7')](util[_0x37fb('0x98')](_0x37fb('0x132'),_0x2373e2[_0x37fb('0x130')]));}}return this[_0x37fb('0xe')][_0x37fb('0x2e')](_0x44b2a3,_0x37fb('0x133'));};AGIVertices[_0x37fb('0x11')][_0x37fb('0x134')]=function(_0x47f0b7){logger[_0x37fb('0x30')](util['format'](_0x37fb('0x135'),_0x47f0b7[_0x37fb('0xb7')],_0x47f0b7[_0x37fb('0x68')]));if(!this['isConfigured'](_0x47f0b7[_0x37fb('0x7a')])){return this[_0x37fb('0xe')][_0x37fb('0xa7')](_0x37fb('0xe9'));}var _0x321cd6=_0x37fb('0x136');var _0x33d1ad=util[_0x37fb('0x98')]('%s/recordings/%s',FILES_PATH,rs[_0x37fb('0x11c')](0x4));var _0x531b28=util[_0x37fb('0x98')]('%s.%s',_0x33d1ad,_0x321cd6);var _0x33b9f1=!![];if(_0x47f0b7[_0x37fb('0x137')]===_0x37fb('0x138')){_0x33b9f1=![];}var _0x5ef2ac=this[_0x37fb('0xe')]['recordFile'](_0x33d1ad,_0x321cd6,_0x47f0b7[_0x37fb('0x139')],_0x47f0b7['timeout'],undefined,_0x33b9f1);if(_0x5ef2ac[_0x37fb('0xa0')]!==-0x1){this['channel'][_0x37fb('0xa7')](util[_0x37fb('0x98')]('google\x20%s\x20file\x20created',_0x531b28));var _0x336b0e=this[_0x37fb('0x8c')][_0x37fb('0xc2')](this,_0x47f0b7,_0x531b28);if(_0x336b0e){for(var _0x82a120 in _0x336b0e){if(_0x336b0e[_0x37fb('0x91')](_0x82a120)){this['channel']['setVariable'](util['format'](_0x37fb('0x13a'),_0x82a120['toUpperCase']()),_0x336b0e[_0x82a120]);}}return this[_0x37fb('0xe')][_0x37fb('0xa7')](util[_0x37fb('0x98')](_0x37fb('0x13b'),JSON['stringify'](_0x336b0e)));}}return _0x5ef2ac;};AGIVertices[_0x37fb('0x11')][_0x37fb('0x13c')]=function(_0x1d66a8){logger[_0x37fb('0x30')](util[_0x37fb('0x98')](_0x37fb('0x13d'),_0x1d66a8[_0x37fb('0xb7')]));if(!this['isConfigured'](_0x1d66a8[_0x37fb('0x8e')])){return this['channel'][_0x37fb('0xa7')](_0x37fb('0x13e'));}if(!this['isConfigured'](_0x1d66a8[_0x37fb('0x8f')])){return this[_0x37fb('0xe')][_0x37fb('0xa7')]('no\x20appsecret\x20configured');}var _0x13b2aa=_0x37fb('0x136');var _0x1eb35e=util[_0x37fb('0x98')](_0x37fb('0x13f'),FILES_PATH,rs[_0x37fb('0x11c')](0x4));var _0x4de758=util['format'](_0x37fb('0x99'),_0x1eb35e,_0x13b2aa);var _0x47a117=!![];if(_0x1d66a8[_0x37fb('0x137')]==='NOBEEP'){_0x47a117=![];}var _0x3ff3b0=this['channel'][_0x37fb('0x140')](_0x1eb35e,_0x13b2aa,_0x1d66a8['intKey'],_0x1d66a8['timeout'],undefined,_0x47a117);if(_0x3ff3b0[_0x37fb('0xa0')]!==-0x1){this[_0x37fb('0xe')][_0x37fb('0xa7')](util[_0x37fb('0x98')](_0x37fb('0x141'),_0x4de758));var _0x332165=this[_0x37fb('0x142')][_0x37fb('0xc2')](this,_0x1d66a8,_0x4de758);if(_0x332165){for(var _0x3a9ebb in _0x332165){if(_0x332165[_0x37fb('0x91')](_0x3a9ebb)){this['channel'][_0x37fb('0x9b')](util['format'](_0x37fb('0x143'),_0x3a9ebb[_0x37fb('0xec')]()),_0x332165[_0x3a9ebb]);}}return this['channel'][_0x37fb('0xa7')](util[_0x37fb('0x98')](_0x37fb('0x144'),JSON[_0x37fb('0x73')](_0x332165)));}}return _0x3ff3b0;};AGIVertices['prototype'][_0x37fb('0x145')]=function(_0x198466){logger[_0x37fb('0x30')](util['format'](_0x37fb('0x146'),_0x198466['label']));return this['channel'][_0x37fb('0x147')](_0x198466[_0x37fb('0x3e')],_0x198466[_0x37fb('0x3f')],_0x198466[_0x37fb('0x148')]);};AGIVertices[_0x37fb('0x11')]['gotoif']=function(_0x3f8684){logger[_0x37fb('0x30')](util[_0x37fb('0x98')](_0x37fb('0x149'),_0x3f8684[_0x37fb('0xb7')]));if(!this['isConfigured'](_0x3f8684[_0x37fb('0x14a')])){return this[_0x37fb('0xe')][_0x37fb('0x2e')](_0x3f8684,_0x37fb('0x14b'));}try{var _0x4ab462=eval(_0x3f8684[_0x37fb('0x14a')])?'true':_0x37fb('0x14c');this[_0x37fb('0xe')][_0x37fb('0xa7')](util[_0x37fb('0x98')](_0x37fb('0x14d'),_0x3f8684[_0x37fb('0x14a')],_0x4ab462));return{'code':0xc8,'result':_0x4ab462};}catch(_0x23b8f0){return{'code':0xc8,'result':_0x37fb('0x14c')};}};AGIVertices[_0x37fb('0x11')][_0x37fb('0x14e')]=function(_0x413c0a){logger['info'](util[_0x37fb('0x98')]('Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block',_0x413c0a[_0x37fb('0xb7')]));if(!this['isConfigured'](_0x413c0a['interval_id'])){return this['channel'][_0x37fb('0x2e')](_0x413c0a,_0x37fb('0x14f'));}var _0xff8e82=this[_0x37fb('0x27')][_0x37fb('0xc2')](this,_0x413c0a[_0x37fb('0x150')]);if(!_0xff8e82){return this[_0x37fb('0xe')]['error'](_0x413c0a,_0x37fb('0x151'));}for(var _0x2e5515=0x0;_0x2e5515<_0xff8e82[_0x37fb('0x96')];_0x2e5515+=0x1){var _0x2718aa=this[_0x37fb('0xe')][_0x37fb('0x12')](util[_0x37fb('0x98')](_0x37fb('0x152'),_0xff8e82[_0x2e5515]));if(_0x2718aa[_0x37fb('0xa0')]===-0x1){return _0x2718aa;}logger[_0x37fb('0x30')](util[_0x37fb('0x98')]('IFTIME\x20%s\x20%s',_0xff8e82[_0x2e5515],_0x2718aa[_0x37fb('0xa2')]));if(_0x2718aa[_0x37fb('0xa2')]===_0x37fb('0x153')){logger[_0x37fb('0x30')](util[_0x37fb('0x98')](_0x37fb('0x154'),_0xff8e82[_0x2e5515],'true'));this[_0x37fb('0xe')][_0x37fb('0xa7')](util['format']('IFTIME\x20%s\x20%s',_0xff8e82[_0x2e5515],'true'));return{'code':0xc8,'result':_0x37fb('0x153')};}else{logger['info'](util[_0x37fb('0x98')](_0x37fb('0x154'),_0xff8e82[_0x2e5515],_0x37fb('0x14c')));this['channel'][_0x37fb('0xa7')](util[_0x37fb('0x98')]('IFTIME\x20%s\x20%s',_0xff8e82[_0x2e5515],_0x37fb('0x14c')));}}return{'code':0xc8,'result':_0x37fb('0x14c')};};AGIVertices[_0x37fb('0x11')][_0x37fb('0x155')]=function(_0x579cc0){logger['info'](util[_0x37fb('0x98')](_0x37fb('0x156'),_0x579cc0[_0x37fb('0xb7')]));return this[_0x37fb('0xe')][_0x37fb('0x155')]();};AGIVertices['prototype']['ispeechasr']=function(_0x2861d0){logger[_0x37fb('0x30')](util['format'](_0x37fb('0x157'),_0x2861d0[_0x37fb('0xb7')]));if(!this[_0x37fb('0xac')](_0x2861d0[_0x37fb('0x7a')])){return this[_0x37fb('0xe')][_0x37fb('0xa7')]('no\x20key\x20configured');}var _0x1090fd=_0x37fb('0x136');var _0x1d4fb0=util[_0x37fb('0x98')]('%s/recordings/%s',FILES_PATH,rs[_0x37fb('0x11c')](0x4));var _0x245b28=util['format'](_0x37fb('0x99'),_0x1d4fb0,_0x1090fd);var _0x162554=!![];if(_0x2861d0[_0x37fb('0x137')]===_0x37fb('0x138')){_0x162554=![];}var _0x564e74=this[_0x37fb('0xe')][_0x37fb('0x140')](_0x1d4fb0,_0x1090fd,_0x2861d0[_0x37fb('0x139')],_0x2861d0[_0x37fb('0x68')],undefined,_0x162554);if(_0x564e74[_0x37fb('0xa0')]!==-0x1){this[_0x37fb('0xe')][_0x37fb('0xa7')](util[_0x37fb('0x98')]('ispeech\x20%s\x20file\x20created',_0x245b28));var _0x3685c2=this[_0x37fb('0x83')][_0x37fb('0xc2')](this,_0x2861d0,_0x245b28);if(_0x3685c2){for(var _0x4a43e9 in _0x3685c2){if(_0x3685c2[_0x37fb('0x91')](_0x4a43e9)){this['channel'][_0x37fb('0x9b')](util[_0x37fb('0x98')](_0x37fb('0x158'),_0x4a43e9[_0x37fb('0xec')]()),_0x3685c2[_0x4a43e9]);}}return this[_0x37fb('0xe')][_0x37fb('0xa7')](util[_0x37fb('0x98')](_0x37fb('0x159'),JSON[_0x37fb('0x73')](_0x3685c2)));}}return _0x564e74;};AGIVertices[_0x37fb('0x11')][_0x37fb('0x15a')]=function(_0x1e1f9d){logger['info'](util[_0x37fb('0x98')]('Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block',_0x1e1f9d[_0x37fb('0xb7')]));if(!this[_0x37fb('0xac')](_0x1e1f9d['key'])){return this[_0x37fb('0xe')]['noop'](_0x37fb('0xe9'));}if(!this['isConfigured'](_0x1e1f9d['text'])){return this[_0x37fb('0xe')][_0x37fb('0xa7')]('no\x20text\x20configured');}this[_0x37fb('0xe')][_0x37fb('0xa7')](util[_0x37fb('0x98')](_0x37fb('0x15b'),_0x1e1f9d[_0x37fb('0x5c')]));var _0x11ef87=this['ispeechTTS'][_0x37fb('0xc2')](this,_0x1e1f9d);if(_0x11ef87){this['channel']['noop'](util[_0x37fb('0x98')]('ispeech\x20%s\x20file\x20created',_0x11ef87));var _0x4352ba=this[_0x37fb('0xe')]['streamFile'](_0x11ef87,_0x1e1f9d['intKey']);try{fs[_0x37fb('0x12a')](_0x11ef87+_0x37fb('0x105'));}catch(_0xe9ccc1){logger[_0x37fb('0x2e')](_0xe9ccc1);}return _0x4352ba;}return this[_0x37fb('0xe')][_0x37fb('0x2e')](_0x1e1f9d,_0x37fb('0x15c'));};AGIVertices[_0x37fb('0x11')][_0x37fb('0x15d')]=function(_0x12715c){logger[_0x37fb('0x30')](util[_0x37fb('0x98')](_0x37fb('0x15e'),_0x12715c[_0x37fb('0xb7')]));if(!this[_0x37fb('0xac')](_0x12715c['findBy'])){return this['channel']['error'](_0x12715c,_0x37fb('0x15f'));}logger['info'](util[_0x37fb('0x98')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this['channel']['callerid'],_0x12715c[_0x37fb('0x160')]));var _0x578147=this[_0x37fb('0x55')][_0x37fb('0xc2')](this,_0x12715c[_0x37fb('0x160')]);if(_0x578147){logger['info'](util[_0x37fb('0x98')](_0x37fb('0x161'),this['channel']['callerid'],_0x12715c[_0x37fb('0x160')]));this[_0x37fb('0xe')][_0x37fb('0xa7')](util[_0x37fb('0x98')](_0x37fb('0x161'),this[_0x37fb('0xe')][_0x37fb('0x3b')],_0x12715c['findBy']));return{'code':0xc8,'result':_0x37fb('0x162')};}else{logger[_0x37fb('0x30')](util[_0x37fb('0x98')](_0x37fb('0x163'),this['channel'][_0x37fb('0x3b')],_0x12715c[_0x37fb('0x160')]));this['channel'][_0x37fb('0xa7')](util[_0x37fb('0x98')](_0x37fb('0x163'),this['channel'][_0x37fb('0x3b')],_0x12715c[_0x37fb('0x160')]));return{'code':0xc8,'result':'failure'};}};AGIVertices['prototype'][_0x37fb('0x164')]=function(_0x2dc47f){logger[_0x37fb('0x30')](util['format'](_0x37fb('0x165'),_0x2dc47f['label']));if(!this[_0x37fb('0xac')](_0x2dc47f[_0x37fb('0x160')])){return this[_0x37fb('0xe')][_0x37fb('0x2e')](_0x2dc47f,_0x37fb('0x15f'));}logger[_0x37fb('0x30')](util['format'](_0x37fb('0x166'),this[_0x37fb('0xe')][_0x37fb('0x3b')],_0x2dc47f['findBy']));var _0x51b6ec=this[_0x37fb('0x167')][_0x37fb('0xc2')](this,_0x2dc47f['findBy']);if(_0x51b6ec){logger[_0x37fb('0x30')](util['format'](_0x37fb('0x161'),this[_0x37fb('0xe')]['callerid'],_0x2dc47f[_0x37fb('0x160')]));this[_0x37fb('0xe')]['noop'](util[_0x37fb('0x98')](_0x37fb('0x161'),this[_0x37fb('0xe')]['callerid'],_0x2dc47f['findBy']));return{'code':0xc8,'result':_0x37fb('0x162')};}else{logger[_0x37fb('0x30')](util[_0x37fb('0x98')](_0x37fb('0x163'),this[_0x37fb('0xe')][_0x37fb('0x3b')],_0x2dc47f['findBy']));this[_0x37fb('0xe')][_0x37fb('0xa7')](util['format'](_0x37fb('0x163'),this['channel'][_0x37fb('0x3b')],_0x2dc47f[_0x37fb('0x160')]));return{'code':0xc8,'result':_0x37fb('0x168')};}};AGIVertices[_0x37fb('0x11')][_0x37fb('0x169')]=function(_0x188a40){logger[_0x37fb('0x30')](util[_0x37fb('0x98')](_0x37fb('0x16a'),_0x188a40[_0x37fb('0xb7')]));if(!this[_0x37fb('0xac')](_0x188a40[_0x37fb('0x16b')])){return this[_0x37fb('0xe')][_0x37fb('0x2e')](_0x188a40,_0x37fb('0x16c'));}this['channel']['noop'](util[_0x37fb('0x98')](_0x37fb('0x16d'),_0x188a40['operation']));var _0x8829b3=eval(_0x188a40[_0x37fb('0x16b')]);if(!this['isConfigured'](_0x188a40[_0x37fb('0xd9')])){return this[_0x37fb('0xe')][_0x37fb('0xa7')](_0x37fb('0xda'));}var _0x171f96=this[_0x37fb('0x12')][_0x37fb('0xc2')](this,_0x188a40[_0x37fb('0xd9')]);if(!_0x171f96){return this['channel']['error'](_0x188a40,'no\x20variable\x20found');}if(_[_0x37fb('0x9a')](_0x8829b3)){var _0x51703d=this;_0x8829b3[_0x37fb('0xdc')](function(_0x4418df,_0x140ff6){_0x51703d['channel'][_0x37fb('0x9b')](util[_0x37fb('0x98')](_0x37fb('0x16e'),_0x171f96,_0x140ff6),_0x4418df);});return this[_0x37fb('0xe')][_0x37fb('0xa7')](util[_0x37fb('0x98')]('variable\x20%s[key]\x20set',_0x171f96));}else{return this[_0x37fb('0xe')][_0x37fb('0x9b')](_0x171f96,_0x8829b3);}};AGIVertices[_0x37fb('0x11')][_0x37fb('0x16f')]=function(_0x52781f){logger[_0x37fb('0x30')](util[_0x37fb('0x98')](_0x37fb('0x170'),_0x52781f[_0x37fb('0xb7')]));if(_0x52781f[_0x37fb('0xa4')]===0x0){return this['maxRetry'](_0x52781f);}_0x52781f[_0x37fb('0xa4')]-=0x1;if(!this[_0x37fb('0xac')](_0x52781f['file_id'])){return this['channel']['error'](_0x52781f,_0x37fb('0x114'));}var _0x445058=this[_0x37fb('0x171')][_0x37fb('0xc2')](this,_0x52781f[_0x37fb('0x113')]);if(!_0x445058){return this['channel'][_0x37fb('0x2e')](_0x52781f,'no\x20file\x20audio\x20found');}var _0x267677=this[_0x37fb('0xe')][_0x37fb('0x116')](_0x445058,_0x52781f['response'],_0x52781f[_0x37fb('0x172')]);var _0x64fc32=_0x267677[_0x37fb('0xa0')];if(_0x267677[_0x37fb('0xa0')]===-0x1){this['createSquareDetailsReport'][_0x37fb('0xc2')](this,_0x52781f,'-1');return _0x267677;}else if(_0x267677[_0x37fb('0xa2')]===_0x37fb('0x68')){_0x267677['result']=_0x267677[_0x37fb('0xa0')]['length']>0x0?_0x267677[_0x37fb('0xa0')]:'t';}else if(_[_0x37fb('0x45')](_0x267677[_0x37fb('0xa0')])){_0x267677['result']='#';_0x64fc32='#';}if(!this[_0x37fb('0xac')](_0x52781f[_0x37fb('0xd9')])){this[_0x37fb('0xe')][_0x37fb('0xa7')](_0x37fb('0xda'));}else{var _0x33811f=this[_0x37fb('0x12')]['sync'](this,_0x52781f[_0x37fb('0xd9')]);if(!_0x33811f){return this[_0x37fb('0xe')][_0x37fb('0x2e')](_0x52781f,_0x37fb('0xdb'));}this[_0x37fb('0xe')][_0x37fb('0x9b')](_0x33811f,_0x64fc32);}this['createSquareDetailsReport']['sync'](this,_0x52781f,_0x64fc32);return _0x267677;};AGIVertices[_0x37fb('0x11')]['noop']=function(_0x17f3e1){logger['info'](util[_0x37fb('0x98')](_0x37fb('0x173'),_0x17f3e1[_0x37fb('0xb7')]));return this[_0x37fb('0xe')]['noop'](_0x17f3e1[_0x37fb('0x174')]||_0x17f3e1[_0x37fb('0xb7')]);};AGIVertices[_0x37fb('0x11')]['pause']=function(_0x2ea3da){logger[_0x37fb('0x30')](util[_0x37fb('0x98')](_0x37fb('0x175'),_0x2ea3da[_0x37fb('0xb7')]));if(!this['isConfigured'](_0x2ea3da['findBy'])){return this['channel']['error'](_0x2ea3da,_0x37fb('0x15f'));}logger['info'](util[_0x37fb('0x98')](_0x37fb('0x166'),this[_0x37fb('0xe')][_0x37fb('0x3b')],_0x2ea3da[_0x37fb('0x160')]));var _0x1916ea=this[_0x37fb('0x4e')][_0x37fb('0xc2')](this,_0x2ea3da[_0x37fb('0x176')]);var _0x1f08d8=this[_0x37fb('0x50')][_0x37fb('0xc2')](this,_0x2ea3da[_0x37fb('0x160')],_0x1916ea);if(_0x1f08d8){logger[_0x37fb('0x30')](util[_0x37fb('0x98')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x37fb('0xe')][_0x37fb('0x3b')],_0x2ea3da[_0x37fb('0x160')]));this[_0x37fb('0xe')][_0x37fb('0xa7')](util[_0x37fb('0x98')](_0x37fb('0x161'),this[_0x37fb('0xe')][_0x37fb('0x3b')],_0x2ea3da[_0x37fb('0x160')]));return{'code':0xc8,'result':_0x37fb('0x162')};}else{logger[_0x37fb('0x30')](util[_0x37fb('0x98')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0x37fb('0x3b')],_0x2ea3da['findBy']));this['channel'][_0x37fb('0xa7')](util[_0x37fb('0x98')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x37fb('0x3b')],_0x2ea3da[_0x37fb('0x160')]));return{'code':0xc8,'result':_0x37fb('0x168')};}};AGIVertices['prototype']['playback']=function(_0x4d035a){logger[_0x37fb('0x30')](util[_0x37fb('0x98')](_0x37fb('0x177'),_0x4d035a[_0x37fb('0xb7')]));if(!this['isConfigured'](_0x4d035a[_0x37fb('0x113')])){return this[_0x37fb('0xe')][_0x37fb('0x2e')](_0x4d035a,_0x37fb('0x114'));}var _0x1edd00=this[_0x37fb('0x171')][_0x37fb('0xc2')](this,_0x4d035a['file_id']);if(!_0x1edd00){return this['channel'][_0x37fb('0x2e')](_0x4d035a,'no\x20file\x20audio\x20found');}var _0x25cf85=this[_0x37fb('0xe')]['exec'](_0x37fb('0x178'),[_0x1edd00,_0x4d035a[_0x37fb('0xe6')]]);if(_0x25cf85[_0x37fb('0xa0')]===-0x1){return _0x25cf85;}return this[_0x37fb('0xe')][_0x37fb('0xa7')](util[_0x37fb('0x98')](_0x37fb('0xc6'),_0x37fb('0x178'),_0x1edd00));};AGIVertices[_0x37fb('0x11')]['queue']=function(_0x4f2447){logger[_0x37fb('0x30')](util[_0x37fb('0x98')](_0x37fb('0x179'),_0x4f2447['label']));if(!this[_0x37fb('0xac')](_0x4f2447[_0x37fb('0x17a')])){return this['channel'][_0x37fb('0x2e')](_0x4f2447,_0x37fb('0x17b'));}var _0x440ecb='';var _0x360f9c=parseInt(_0x4f2447['queue_id'],0xa);if(isNaN(_0x360f9c)){_0x440ecb=_0x4f2447[_0x37fb('0x17a')];}else{_0x440ecb=this[_0x37fb('0x17c')]['sync'](this,_0x4f2447[_0x37fb('0x17a')]);if(!_0x440ecb){return this[_0x37fb('0xe')][_0x37fb('0x2e')](_0x4f2447,_0x37fb('0x17d'));}}var _0x55dba1='';if(this[_0x37fb('0xac')](_0x4f2447[_0x37fb('0x113')])){var _0x2763dd=this['getSound']['sync'](this,_0x4f2447[_0x37fb('0x113')]);if(_0x2763dd){_0x55dba1=_0x2763dd;}}this['createSquareDetailsReport']['sync'](this,_0x4f2447,_0x440ecb);if(_0x4f2447[_0x37fb('0xe6')][_0x37fb('0x17e')]('x')<0x0){_0x4f2447[_0x37fb('0xe6')]+='x';}if(_0x4f2447[_0x37fb('0xe6')][_0x37fb('0x17e')]('X')<0x0){_0x4f2447[_0x37fb('0xe6')]+='X';}this[_0x37fb('0xe')][_0x37fb('0x9b')]('XMCS-QUEUE',_0x440ecb?_0x440ecb[_0x37fb('0x17f')]():'');var _0x3e87fe=this[_0x37fb('0xe')][_0x37fb('0x56')](_0x37fb('0x180'),[_0x440ecb,_0x4f2447['opts'],_0x4f2447[_0x37fb('0x66')],_0x55dba1,_0x4f2447['timeout'],_0x4f2447[_0x37fb('0xb5')],_0x4f2447[_0x37fb('0x181')],_0x4f2447[_0x37fb('0x182')],'',_0x4f2447[_0x37fb('0x183')]]);if(_0x3e87fe[_0x37fb('0xa0')]===-0x1){return _0x3e87fe;}return this[_0x37fb('0xe')][_0x37fb('0xa7')](util[_0x37fb('0x98')](_0x37fb('0xc6'),_0x37fb('0x180'),_0x440ecb));};AGIVertices[_0x37fb('0x11')][_0x37fb('0x184')]=function(_0x31b549){logger[_0x37fb('0x30')](util[_0x37fb('0x98')]('Enter\x20in\x20RECORD\x20(%s)\x20block',_0x31b549[_0x37fb('0xb7')]));var _0x1c58c8=_0x31b549['recordingFormat']||_0x37fb('0x136');var _0x499875=util[_0x37fb('0x98')]('%s_%s',this[_0x37fb('0xe')]['uniqueid'],rs[_0x37fb('0x11c')](0x5));var _0x141039=util[_0x37fb('0x98')]('%s/recordings/%s.%s',FILES_PATH,_0x499875,_0x1c58c8);var _0x3392c7=util[_0x37fb('0x98')]('%s/recordings/%s',FILES_PATH,_0x499875);this[_0x37fb('0x3c')][_0x37fb('0xc2')](this,_0x31b549,_0x499875,_0x141039);this[_0x37fb('0xe')]['setVariable']('RECORDING_SAVENAME',_0x499875);logger[_0x37fb('0x30')](_0x37fb('0x185'),_0x3392c7,_0x1c58c8,_0x31b549[_0x37fb('0x186')],_0x31b549[_0x37fb('0x68')]);return this['channel'][_0x37fb('0x140')](_0x3392c7,_0x1c58c8,_0x31b549['escape_digits'],_0x31b549['timeout'],undefined,!![]);};AGIVertices[_0x37fb('0x11')]['restapi']=function(_0x4d82b5){logger[_0x37fb('0x30')](util[_0x37fb('0x98')](_0x37fb('0x187'),_0x4d82b5[_0x37fb('0xb7')]));if(!this[_0x37fb('0xac')](_0x4d82b5[_0x37fb('0x66')])){return this['channel'][_0x37fb('0xa7')](_0x37fb('0x188'));}var _0x5be217=this[_0x37fb('0x65')][_0x37fb('0xc2')](this,_0x4d82b5);logger[_0x37fb('0x30')](util['format'](_0x37fb('0x189'),util[_0x37fb('0x18a')](_0x5be217,{'showHidden':![],'depth':null})));if(!this[_0x37fb('0xac')](_0x4d82b5['variable_id'])){return this['channel'][_0x37fb('0xa7')](_0x37fb('0x18b'));}var _0x7cdf42=this['getVariable'][_0x37fb('0xc2')](this,_0x4d82b5['variable_id']);if(!_0x7cdf42){return this[_0x37fb('0xe')][_0x37fb('0x2e')](_0x4d82b5,_0x37fb('0xdb'));}this['channel'][_0x37fb('0x9b')](util[_0x37fb('0x98')](_0x37fb('0x18c'),_0x7cdf42),_0x5be217[_0x37fb('0x76')]?_0x5be217[_0x37fb('0x76')]:_0x37fb('0x18d'));this[_0x37fb('0xe')][_0x37fb('0x9b')](util[_0x37fb('0x98')]('%s_STATUS_MESSAGE',_0x7cdf42),_0x5be217['statusMessage']?_0x5be217[_0x37fb('0x75')]:'OK');if(_0x5be217[_0x37fb('0x74')]){try{this['saveRestApiResult'](_0x5be217['body'],_0x7cdf42);}catch(_0x302bf8){logger[_0x37fb('0x2e')](util[_0x37fb('0x98')](_0x37fb('0x18e'),_0x7cdf42));}}return this[_0x37fb('0xe')][_0x37fb('0xa7')](util['format'](_0x37fb('0xdf'),_0x7cdf42));};AGIVertices['prototype'][_0x37fb('0x18f')]=function(_0x4766df){logger['info'](util[_0x37fb('0x98')](_0x37fb('0x190'),_0x4766df[_0x37fb('0xb7')]));return this['channel'][_0x37fb('0x191')](_0x4766df[_0x37fb('0x192')]['replace'](/\s+/g,''),_0x4766df['escape_digits']);};AGIVertices[_0x37fb('0x11')][_0x37fb('0x193')]=function(_0x2e7b65){logger[_0x37fb('0x30')](util[_0x37fb('0x98')](_0x37fb('0x194'),_0x2e7b65[_0x37fb('0xb7')]));return this[_0x37fb('0xe')]['sayNumber'](_0x2e7b65[_0x37fb('0x67')][_0x37fb('0x58')](/\s+/g,''),_0x2e7b65[_0x37fb('0x186')]);};AGIVertices[_0x37fb('0x11')][_0x37fb('0x195')]=function(_0x38e68d){logger['info'](util['format'](_0x37fb('0x196'),_0x38e68d['label']));return this['channel'][_0x37fb('0x197')](_0x38e68d[_0x37fb('0x5c')],_0x38e68d[_0x37fb('0x186')]);};AGIVertices[_0x37fb('0x11')][_0x37fb('0x198')]=function(_0x3a61f6){logger[_0x37fb('0x30')](util[_0x37fb('0x98')](_0x37fb('0x199'),_0x3a61f6['label']));if(!this['isConfigured'](_0x3a61f6['account_id'])){return this[_0x37fb('0xe')]['noop']('no\x20mail\x20account\x20configured');}var _0x32a570=this[_0x37fb('0x24')][_0x37fb('0xc2')](this,_0x3a61f6[_0x37fb('0x19a')]);if(!_0x32a570||!_0x32a570[_0x37fb('0x19b')]){return this[_0x37fb('0xe')][_0x37fb('0x2e')](_0x3a61f6,_0x37fb('0x19c'));}var _0x2488ca={'from':util[_0x37fb('0x98')](_0x37fb('0x19d'),_0x32a570[_0x37fb('0x15')],_0x32a570[_0x37fb('0x19e')]||_0x32a570['Smtp'][_0x37fb('0x19f')]),'to':_0x3a61f6['to']||'','cc':_0x3a61f6['cc']||'','bcc':_0x3a61f6['bcc']||'','subject':_0x3a61f6[_0x37fb('0x1a0')],'html':_0x3a61f6['text'],'text':_0x3a61f6[_0x37fb('0x5c')]};if(this[_0x37fb('0xac')](_0x3a61f6['template_id'])){}logger['debug']('sendMail\x20message',JSON[_0x37fb('0x73')](_0x2488ca));this[_0x37fb('0x38')][_0x37fb('0xc2')](this,_0x3a61f6,_0x3a61f6[_0x37fb('0x19a')]);this[_0x37fb('0xe')][_0x37fb('0xa7')](util[_0x37fb('0x98')](_0x37fb('0x1a1'),_0x32a570[_0x37fb('0x15')]));this[_0x37fb('0x26')][_0x37fb('0xc2')](this,_0x32a570[_0x37fb('0x1a2')],_0x2488ca);return this[_0x37fb('0xe')][_0x37fb('0xa7')](_0x37fb('0x1a3'));};AGIVertices['prototype'][_0x37fb('0x1a4')]=function(_0x2646ad){logger[_0x37fb('0x30')](util[_0x37fb('0x98')](_0x37fb('0x1a5'),_0x2646ad[_0x37fb('0xb7')]));return this[_0x37fb('0xe')]['noop'](_0x37fb('0x1a6'));};AGIVertices[_0x37fb('0x11')][_0x37fb('0x1a7')]=function(_0x4a3cf9){logger[_0x37fb('0x30')](util['format']('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0x4a3cf9['label']));if(!this[_0x37fb('0xac')](_0x4a3cf9[_0x37fb('0x1a8')])){return this['channel'][_0x37fb('0xa7')](_0x37fb('0x1a9'));}var _0x28b06a=this[_0x37fb('0x1aa')][_0x37fb('0xc2')](this,_0x4a3cf9[_0x37fb('0x1a8')]);if(!_0x28b06a){return this[_0x37fb('0xe')]['error'](_0x4a3cf9,_0x37fb('0x1ab'));}var _0x3b5d09={'body':_0x4a3cf9['sms_text'],'phone':_0x4a3cf9['to']||'','SmsAccountId':_0x28b06a['id']};logger[_0x37fb('0xe1')](_0x37fb('0x1ac'),JSON[_0x37fb('0x73')](_0x3b5d09));this[_0x37fb('0x38')][_0x37fb('0xc2')](this,_0x4a3cf9,_0x4a3cf9['sms_account_id']);this[_0x37fb('0xe')][_0x37fb('0xa7')](util['format'](_0x37fb('0x1ad'),_0x28b06a[_0x37fb('0x15')]));this[_0x37fb('0x37')][_0x37fb('0xc2')](this,_0x3b5d09);return this[_0x37fb('0xe')][_0x37fb('0xa7')](_0x37fb('0x1ae'));};AGIVertices[_0x37fb('0x11')][_0x37fb('0x1af')]=function(_0x20986a){logger[_0x37fb('0x30')](util['format']('Enter\x20in\x20SET\x20(%s)\x20block',_0x20986a[_0x37fb('0xb7')]));if(!this[_0x37fb('0xac')](_0x20986a[_0x37fb('0xd9')])){return this['channel']['error'](_0x20986a,_0x37fb('0x1b0'));}var _0x4d7993=this['getVariable']['sync'](this,_0x20986a[_0x37fb('0xd9')]);if(!_0x4d7993){return this[_0x37fb('0xe')][_0x37fb('0x2e')](_0x20986a,_0x37fb('0xdb'));}return this['channel']['setVariable'](_0x4d7993,_0x20986a['variable_value']);};AGIVertices[_0x37fb('0x11')][_0x37fb('0x1b1')]=function(_0xb97807){logger[_0x37fb('0x30')](util[_0x37fb('0x98')](_0x37fb('0x1b2'),_0xb97807['label']));this[_0x37fb('0xe')][_0x37fb('0xa7')](_0x37fb('0x1b3'));if(_0xb97807[_0x37fb('0xba')]===_0x37fb('0x1b4')){this[_0x37fb('0xe')]['noop'](_0x37fb('0x1b5'));return this[_0x37fb('0xe')]['answer']();}return this[_0x37fb('0xe')][_0x37fb('0xa7')](_0x37fb('0x1b6'));};AGIVertices[_0x37fb('0x11')]['subproject']=function(_0x4dd683){logger[_0x37fb('0x30')](util['format'](_0x37fb('0x1b7'),_0x4dd683[_0x37fb('0xb7')]));if(!this[_0x37fb('0xac')](_0x4dd683['project_id'])){return this[_0x37fb('0xe')][_0x37fb('0x2e')](_0x4dd683,_0x37fb('0x1b8'));}var _0x3a7d3e=this['getSquareProject'][_0x37fb('0xc2')](this,_0x4dd683[_0x37fb('0x1b9')]);if(!this[_0x37fb('0xac')](_0x3a7d3e)){return this[_0x37fb('0xe')]['error'](_0x4dd683,util[_0x37fb('0x98')](_0x37fb('0x1ba'),_0x4dd683['project_id']));}if(_0x3a7d3e===this['channel'][_0x37fb('0x1bb')]){return this[_0x37fb('0xe')]['error'](_0x4dd683,_0x37fb('0x1bc'));}this['createSquareDetailsReport'][_0x37fb('0xc2')](this,_0x4dd683,_0x3a7d3e);var _0x414fcc=this[_0x37fb('0xe')]['exec']('AGI',util['format'](_0x37fb('0x1bd'),config[_0x37fb('0xb5')][_0x37fb('0x1be')]||'127.0.0.1',_0x3a7d3e,this[_0x37fb('0xe')]['arg_1']));if(_0x414fcc[_0x37fb('0xa0')]===-0x1){return _0x414fcc;}return this[_0x37fb('0xe')]['noop'](util['format'](_0x37fb('0xc6'),_0x37fb('0x1bf'),_0x3a7d3e));};AGIVertices['prototype'][_0x37fb('0x1c0')]=function(_0x53888d){logger[_0x37fb('0x30')](util['format'](_0x37fb('0x1c1'),_0x53888d[_0x37fb('0xb7')]));var _0x2829b5=this[_0x37fb('0x1c2')][_0x37fb('0xc2')](this,_0x53888d[_0x37fb('0xb8')]);this[_0x37fb('0x38')][_0x37fb('0xc2')](this,_0x53888d,_0x53888d[_0x37fb('0xb8')]);if(this['isConfigured'](_0x53888d[_0x37fb('0xd9')])){var _0x2ee548=this['getVariable'][_0x37fb('0xc2')](this,_0x53888d[_0x37fb('0xd9')]);if(_0x2ee548){this[_0x37fb('0xe')]['setVariable'](_0x2ee548,_0x2829b5);return this[_0x37fb('0xe')][_0x37fb('0xa7')](util[_0x37fb('0x98')](_0x37fb('0x1c3'),_0x53888d[_0x37fb('0xb8')],_0x2ee548));}}return this[_0x37fb('0xe')][_0x37fb('0xa7')](util[_0x37fb('0x98')]('sh\x20command:\x20%s\x20result\x20no\x20stored',_0x53888d[_0x37fb('0xb8')]));};AGIVertices[_0x37fb('0x11')]['google_cloud_tts']=function(_0x5cdcd6){logger[_0x37fb('0x30')](util[_0x37fb('0x98')](_0x37fb('0x1c4'),_0x5cdcd6[_0x37fb('0xb7')]));_0x5cdcd6['text']=_0x5cdcd6[_0x37fb('0x5c')][_0x37fb('0x58')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x37fb('0xac')](_0x5cdcd6[_0x37fb('0x5a')])){return this['channel'][_0x37fb('0xa7')](_0x37fb('0x1c5'));}if(!this['isConfigured'](_0x5cdcd6[_0x37fb('0x5c')])){return this['channel']['noop'](_0x37fb('0xa8'));}this[_0x37fb('0xe')][_0x37fb('0xa7')](util['format']('Trying\x20Google\x20Cloud\x20TTS\x20%s',_0x5cdcd6[_0x37fb('0x5c')]));var _0x114c99=this['googleCloudTTS'][_0x37fb('0xc2')](this,_0x5cdcd6);if(_0x114c99){this[_0x37fb('0xe')][_0x37fb('0xa7')](util[_0x37fb('0x98')](_0x37fb('0x1c6'),_0x114c99));var _0x427643=this[_0x37fb('0xe')]['streamFile'](_0x114c99);try{fs[_0x37fb('0x12a')](_0x114c99+_0x37fb('0x105'));}catch(_0x40d031){logger[_0x37fb('0x2e')](_0x40d031);}return _0x427643;}return this[_0x37fb('0xe')]['error'](_0x5cdcd6,'Google\x20Cloud\x20TTS\x20is\x20unreachable');};AGIVertices[_0x37fb('0x11')][_0x37fb('0x1c7')]=function(_0x263e02){logger['info'](util['format'](_0x37fb('0x1c8'),_0x263e02[_0x37fb('0xb7')]));_0x263e02[_0x37fb('0x5c')]=_0x263e02[_0x37fb('0x5c')][_0x37fb('0x58')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x37fb('0xac')](_0x263e02[_0x37fb('0x5c')])){return this[_0x37fb('0xe')][_0x37fb('0xa7')]('no\x20text\x20configured');}this[_0x37fb('0xe')][_0x37fb('0xa7')](util['format']('Trying\x20Google\x20TTS\x20%s',_0x263e02['text']));var _0x133c78=this[_0x37fb('0x63')][_0x37fb('0xc2')](this,_0x263e02);if(_0x133c78){this[_0x37fb('0xe')][_0x37fb('0xa7')](util[_0x37fb('0x98')](_0x37fb('0x1c9'),_0x133c78));var _0x31b6b4=this['channel'][_0x37fb('0x104')](_0x133c78);try{fs[_0x37fb('0x12a')](_0x133c78+'.wav');}catch(_0x1d1b16){logger[_0x37fb('0x2e')](_0x1d1b16);}return _0x31b6b4;}return this[_0x37fb('0xe')][_0x37fb('0x2e')](_0x263e02,_0x37fb('0x1ca'));};AGIVertices[_0x37fb('0x11')][_0x37fb('0x1cb')]=function(_0x38088a){logger['info'](util[_0x37fb('0x98')]('Enter\x20in\x20UNPAUSE\x20(%s)\x20block',_0x38088a['label']));if(!this[_0x37fb('0xac')](_0x38088a[_0x37fb('0x160')])){return this[_0x37fb('0xe')][_0x37fb('0x2e')](_0x38088a,_0x37fb('0x15f'));}logger[_0x37fb('0x30')](util['format']('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x37fb('0xe')]['callerid'],_0x38088a['findBy']));var _0x1e02b5=this[_0x37fb('0x52')][_0x37fb('0xc2')](this,_0x38088a[_0x37fb('0x160')]);if(_0x1e02b5){logger['info'](util[_0x37fb('0x98')](_0x37fb('0x161'),this[_0x37fb('0xe')][_0x37fb('0x3b')],_0x38088a['findBy']));this[_0x37fb('0xe')]['noop'](util[_0x37fb('0x98')](_0x37fb('0x161'),this['channel'][_0x37fb('0x3b')],_0x38088a[_0x37fb('0x160')]));return{'code':0xc8,'result':'success'};}else{logger[_0x37fb('0x30')](util[_0x37fb('0x98')](_0x37fb('0x163'),this[_0x37fb('0xe')]['callerid'],_0x38088a['findBy']));this['channel'][_0x37fb('0xa7')](util['format'](_0x37fb('0x163'),this[_0x37fb('0xe')][_0x37fb('0x3b')],_0x38088a[_0x37fb('0x160')]));return{'code':0xc8,'result':_0x37fb('0x168')};}};AGIVertices[_0x37fb('0x11')][_0x37fb('0x1cc')]=function(_0x254004){logger['info'](util[_0x37fb('0x98')](_0x37fb('0x1cd'),_0x254004[_0x37fb('0xb7')]));var _0x33a5b8=this['channel'][_0x37fb('0x56')](_0x37fb('0x1ce'),[_0x254004[_0x37fb('0x1cf')],_0x254004['options']]);if(_0x33a5b8[_0x37fb('0xa0')]===-0x1){return _0x33a5b8;}return this['channel'][_0x37fb('0xa7')](util[_0x37fb('0x98')](_0x37fb('0xc6'),'VOICEMAIL',_0x254004[_0x37fb('0x1cf')]));};AGIVertices[_0x37fb('0x11')]['vswitch']=function(_0x40aec5){logger[_0x37fb('0x30')](util['format'](_0x37fb('0x1d0'),_0x40aec5[_0x37fb('0xb7')]));if(!this[_0x37fb('0xac')](_0x40aec5['variable_id'])){return this[_0x37fb('0xe')][_0x37fb('0x2e')](_0x40aec5,_0x37fb('0x1b0'));}var _0x188fbf=this[_0x37fb('0x12')]['sync'](this,_0x40aec5['variable_id']);if(!_0x188fbf){return this[_0x37fb('0xe')]['error'](_0x40aec5,_0x37fb('0xdb'));}var _0x53b286=this[_0x37fb('0xe')][_0x37fb('0x12')](_0x188fbf);return{'code':0xc8,'result':_0x53b286[_0x37fb('0xa2')]?_0x53b286[_0x37fb('0xa2')]:'-'};};String[_0x37fb('0x11')][_0x37fb('0x9e')]=function(_0xea3478,_0x43fe0a){return this[_0x37fb('0x9d')](_0xea3478)[_0x37fb('0x1d1')](_0x43fe0a);};module['exports']=AGIVertices;
\ No newline at end of file
index 572e8f2..760212e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7d17=['Auto-Pause','exports','lodash','../ami','../../../config/logger','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','syncHangupRequest','bind','hangup','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncAgentConnectPreview','milliseconds','diff','seconds','interface','queue','mandatoryDisposition','mandatoryDispositionPause','name','Action','QueuePause','then','getAgent','voicePause','info','attended','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','stopAcw','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','update','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','finally','[ACW][START]\x20%s','message','prototype','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','[ACW][STOP]\x20%s','acw','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','[%s][HANGUP:UNIQUEID]','linkedid','isUndefined','[%s][HANGUP:LINKEDID]','startAcw','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','syncBlindTransfer','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','stringify','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','all'];(function(_0x4867b0,_0x4a5e33){var _0x150861=function(_0x54cac2){while(--_0x54cac2){_0x4867b0['push'](_0x4867b0['shift']());}};_0x150861(++_0x4a5e33);}(_0x7d17,0x10a));var _0x77d1=function(_0xc4ff80,_0x81a47c){_0xc4ff80=_0xc4ff80-0x0;var _0x48e8c5=_0x7d17[_0xc4ff80];return _0x48e8c5;};'use strict';var util=require('util');var _=require(_0x77d1('0x0'));var moment=require('moment');var ami=require(_0x77d1('0x1'));var logger=require(_0x77d1('0x2'))('acw');var RpcUser=require(_0x77d1('0x3'));var RpcVoiceAgentReport=require(_0x77d1('0x4'));function Acw(_0x531c14){this[_0x77d1('0x5')]=_0x531c14[_0x77d1('0x5')];this[_0x77d1('0x6')]=_0x531c14[_0x77d1('0x6')];this[_0x77d1('0x7')]=_0x531c14[_0x77d1('0x7')];this[_0x77d1('0x8')]={};ami['on'](_0x77d1('0x9'),this[_0x77d1('0xa')]['bind'](this));ami['on']('hanguprequest',this[_0x77d1('0xb')][_0x77d1('0xc')](this));ami['on'](_0x77d1('0xd'),this[_0x77d1('0xe')]['bind'](this));ami['on'](_0x77d1('0xf'),this[_0x77d1('0x10')][_0x77d1('0xc')](this));ami['on'](_0x77d1('0x11'),this[_0x77d1('0x12')]['bind'](this));ami['on'](_0x77d1('0x13'),this['syncBlindTransfer']['bind'](this));ami['on']('custom:agentConnectPreview',this[_0x77d1('0x14')][_0x77d1('0xc')](this));}function getDiff(_0xbe9291){var _0x4622ae=moment()[_0x77d1('0x15')](0x0);var _0x502417=moment(_0xbe9291)['milliseconds'](0x0);return _0x4622ae[_0x77d1('0x16')](_0x502417,_0x77d1('0x17'));}Acw['prototype']['startAcw']=function(_0x322e60){try{var _0x458778=this;var _0x1efa76=this[_0x77d1('0x8')][_0x322e60][_0x77d1('0x18')];var _0x232392=this[_0x77d1('0x8')][_0x322e60][_0x77d1('0x19')];var _0x1be33d=this['voiceQueues'][_0x232392];var _0x45e3b8=![];var _0x3a8a68='ACW';if(_0x1be33d[_0x77d1('0x1a')]){if(_0x1be33d[_0x77d1('0x1b')][_0x77d1('0x1c')]){_0x45e3b8=!![];_0x3a8a68=_0x1be33d['mandatoryDispositionPause']['name'];}}ami[_0x77d1('0x1d')]({'action':_0x77d1('0x1e'),'interface':_0x1efa76,'paused':!![],'reason':_0x3a8a68})[_0x77d1('0x1f')](function(_0x295d05){if(_0x458778['agents'][_0x1efa76]){return RpcUser[_0x77d1('0x20')](_0x458778[_0x77d1('0x6')][_0x1efa76]['id'])['then'](function(_0x34f82c){if(_0x34f82c&&!_0x34f82c[_0x77d1('0x21')]){logger[_0x77d1('0x22')]('[%s][START][AGENT:%s][QUEUE:%s]',_0x322e60,_0x1efa76,_0x232392);var _0x3f6ed4=_0x458778[_0x77d1('0x8')][_0x322e60][_0x77d1('0x23')]&&_0x458778[_0x77d1('0x8')][_0x322e60][_0x77d1('0x24')]?_0x458778['channels'][_0x322e60][_0x77d1('0x24')]:_0x322e60;return RpcUser[_0x77d1('0x25')](_0x458778['agents'][_0x1efa76],_0x3a8a68,_0x3f6ed4)[_0x77d1('0x1f')](function(_0x15c9a1){if(!_0x45e3b8){_0x458778['timers'][_0x1efa76]={};logger[_0x77d1('0x22')](_0x77d1('0x26'),_0x322e60,_0x458778[_0x77d1('0x5')][_0x232392][_0x77d1('0x27')],_0x1efa76,_0x232392);_0x458778[_0x77d1('0x7')][_0x1efa76][_0x77d1('0x28')]=setTimeout(_0x458778[_0x77d1('0x29')]['bind'](_0x458778,_0x1efa76),_0x458778[_0x77d1('0x5')][_0x232392][_0x77d1('0x27')]*0x3e8);_0x458778[_0x77d1('0x7')][_0x1efa76][_0x77d1('0x2a')]=moment()[_0x77d1('0x2b')](_0x77d1('0x2c'));_0x458778[_0x77d1('0x7')][_0x1efa76][_0x77d1('0x2d')]=_0x322e60;_0x458778[_0x77d1('0x7')][_0x1efa76]['queue']=_0x232392;_0x458778['timers'][_0x1efa76]['updateAcw']=function(){var _0x4edff3=getDiff(_0x458778[_0x77d1('0x7')][_0x1efa76][_0x77d1('0x2a')]);clearTimeout(_0x458778[_0x77d1('0x7')][_0x1efa76]['timer']);_0x458778[_0x77d1('0x7')][_0x1efa76][_0x77d1('0x28')]=![];RpcVoiceAgentReport[_0x77d1('0x2e')]({'acwtime':_0x4edff3},_0x458778[_0x77d1('0x7')][_0x1efa76][_0x77d1('0x2d')],_0x1efa76)[_0x77d1('0x1f')](function(_0x229abe){logger['info'](_0x77d1('0x2f'),_0x322e60,_0x4edff3,_0x229abe);})[_0x77d1('0x30')](function(_0x595136){logger[_0x77d1('0x31')](_0x77d1('0x32'),_0x322e60,_0x595136);});delete _0x458778[_0x77d1('0x7')][_0x1efa76];};}});}else{logger[_0x77d1('0x22')](_0x77d1('0x33'),_0x322e60,_0x1efa76,_0x232392);}});}})['catch'](function(_0x5c049f){logger[_0x77d1('0x31')](_0x77d1('0x26'),_0x322e60,_0x458778[_0x77d1('0x5')][_0x232392][_0x77d1('0x27')],_0x1efa76,_0x232392);})[_0x77d1('0x34')](function(){delete _0x458778['channels'][_0x322e60];});}catch(_0x4c472a){logger[_0x77d1('0x31')](_0x77d1('0x35'),_0x4c472a[_0x77d1('0x36')]);}};Acw[_0x77d1('0x37')]['stopAcw']=function(_0x531529){try{var _0x268d0c=this;if(_0x268d0c[_0x77d1('0x7')][_0x531529]){_0x268d0c[_0x77d1('0x7')][_0x531529][_0x77d1('0x28')]=![];var _0x1cb561=_0x268d0c[_0x77d1('0x7')][_0x531529][_0x77d1('0x2d')];var _0x156525=_0x268d0c[_0x77d1('0x7')][_0x531529]['queue'];var _0x31dc7=_0x268d0c[_0x77d1('0x5')][_0x156525]['acwTimeout'];logger['info'](_0x77d1('0x38'),_0x1cb561,_0x531529);RpcUser[_0x77d1('0x39')](this[_0x77d1('0x6')][_0x531529]);RpcVoiceAgentReport[_0x77d1('0x2e')]({'acwtime':_0x31dc7,'agentacw':!![]},_0x1cb561,_0x531529)[_0x77d1('0x1f')](function(_0x3a147c){logger[_0x77d1('0x22')](_0x77d1('0x2f'),_0x1cb561,_0x31dc7,_0x3a147c);})[_0x77d1('0x30')](function(_0x3a70d1){logger[_0x77d1('0x31')](_0x77d1('0x32'),_0x1cb561,_0x3a70d1);});}else{logger[_0x77d1('0x31')](_0x77d1('0x3a'),_0x531529);if(_0x268d0c[_0x77d1('0x7')]){logger['info'](_0x77d1('0x3b'),JSON['stringify'](_0x268d0c[_0x77d1('0x7')]));}}}catch(_0x534333){logger['error'](_0x77d1('0x3c'),_0x534333[_0x77d1('0x36')]);}};Acw[_0x77d1('0x37')][_0x77d1('0xa')]=function(_0x44e07b){try{if(this['voiceQueues'][_0x44e07b['queue']]&&(this[_0x77d1('0x5')][_0x44e07b[_0x77d1('0x19')]][_0x77d1('0x3d')]||this[_0x77d1('0x5')][_0x44e07b[_0x77d1('0x19')]]['mandatoryDisposition'])){if(this[_0x77d1('0x6')][_0x44e07b[_0x77d1('0x18')]]){this[_0x77d1('0x8')][_0x44e07b[_0x77d1('0x2d')]]={'queue':_0x44e07b[_0x77d1('0x19')],'interface':_0x44e07b['interface'],'destlinkedid':_0x44e07b['destlinkedid']};}}}catch(_0x539d85){logger['error'](_0x77d1('0x3e'),_0x539d85[_0x77d1('0x36')]);}};Acw[_0x77d1('0x37')][_0x77d1('0x14')]=function(_0x3c2ca4){try{if(this[_0x77d1('0x5')][_0x3c2ca4[_0x77d1('0x19')]]&&(this[_0x77d1('0x5')][_0x3c2ca4[_0x77d1('0x19')]]['acw']||this[_0x77d1('0x5')][_0x3c2ca4[_0x77d1('0x19')]][_0x77d1('0x1a')])){if(this['agents'][_0x3c2ca4[_0x77d1('0x18')]]){this['channels'][_0x3c2ca4[_0x77d1('0x2d')]]={'queue':_0x3c2ca4['queue'],'interface':_0x3c2ca4[_0x77d1('0x18')]};}}}catch(_0x4942ae){logger[_0x77d1('0x31')](_0x77d1('0x3f'),_0x4942ae[_0x77d1('0x36')]);}};Acw['prototype']['syncHangupRequest']=function(_0x2b22b3){try{if(this[_0x77d1('0x8')][_0x2b22b3[_0x77d1('0x2d')]]&&_['isUndefined'](this[_0x77d1('0x8')][_0x2b22b3['uniqueid']][_0x77d1('0x23')])){logger['info'](_0x77d1('0x40'),_0x2b22b3[_0x77d1('0x2d')]);this['startAcw'](_0x2b22b3[_0x77d1('0x2d')]);}else if(this[_0x77d1('0x8')][_0x2b22b3[_0x77d1('0x41')]]&&_[_0x77d1('0x42')](this[_0x77d1('0x8')][_0x2b22b3[_0x77d1('0x41')]][_0x77d1('0x23')])){logger[_0x77d1('0x22')](_0x77d1('0x43'),_0x2b22b3[_0x77d1('0x41')]);this[_0x77d1('0x44')](_0x2b22b3[_0x77d1('0x41')]);}}catch(_0x30ed1d){logger[_0x77d1('0x31')](_0x77d1('0x45'),_0x30ed1d['message']);}};Acw[_0x77d1('0x37')][_0x77d1('0xe')]=function(_0x2317cf){try{if(this['channels'][_0x2317cf[_0x77d1('0x2d')]]&&this[_0x77d1('0x8')][_0x2317cf[_0x77d1('0x2d')]][_0x77d1('0x23')]){logger['info'](_0x77d1('0x46'),_0x2317cf[_0x77d1('0x2d')]);this['startAcw'](_0x2317cf['uniqueid']);}else if(this[_0x77d1('0x8')][_0x2317cf[_0x77d1('0x41')]]&&this['channels'][_0x2317cf[_0x77d1('0x41')]][_0x77d1('0x23')]){logger[_0x77d1('0x22')]('[%s][HANGUPATTENDEDTRANSFER:LINKEDID]',_0x2317cf[_0x77d1('0x41')]);this['startAcw'](_0x2317cf[_0x77d1('0x41')]);}}catch(_0x158039){logger[_0x77d1('0x31')](_0x77d1('0x47'),_0x158039[_0x77d1('0x36')]);}};Acw[_0x77d1('0x37')][_0x77d1('0x12')]=function(_0x3aedb7){try{if(!_[_0x77d1('0x48')](this['channels'][_0x3aedb7[_0x77d1('0x49')]])){this[_0x77d1('0x44')](_0x3aedb7[_0x77d1('0x49')]);if(this[_0x77d1('0x8')][_0x3aedb7['secondtransfereruniqueid']]){this['channels'][_0x3aedb7[_0x77d1('0x4a')]][_0x77d1('0x23')]=!![];this[_0x77d1('0x8')][_0x3aedb7[_0x77d1('0x4b')]]=this[_0x77d1('0x8')][_0x3aedb7['secondtransfereruniqueid']];delete this[_0x77d1('0x8')][_0x3aedb7[_0x77d1('0x4a')]];}}else if(!_[_0x77d1('0x48')](this['channels'][_0x3aedb7[_0x77d1('0x4b')]])){this[_0x77d1('0x44')](_0x3aedb7[_0x77d1('0x4b')]);if(this[_0x77d1('0x8')][_0x3aedb7[_0x77d1('0x4c')]]){this[_0x77d1('0x8')][_0x3aedb7[_0x77d1('0x4c')]][_0x77d1('0x23')]=!![];this[_0x77d1('0x8')][_0x3aedb7[_0x77d1('0x49')]]=this[_0x77d1('0x8')][_0x3aedb7[_0x77d1('0x4c')]];delete this[_0x77d1('0x8')][_0x3aedb7[_0x77d1('0x4c')]];}}}catch(_0x22b25c){logger['error'](_0x77d1('0x4d'),_0x22b25c[_0x77d1('0x36')]);}};Acw['prototype'][_0x77d1('0x4e')]=function(_0x53caa0){try{if(this[_0x77d1('0x8')][_0x53caa0[_0x77d1('0x4f')]]){logger['info'](_0x77d1('0x50'),JSON[_0x77d1('0x51')](_0x53caa0[_0x77d1('0x4f')]));this['startAcw'](_0x53caa0[_0x77d1('0x4f')]);}else if(this[_0x77d1('0x8')][_0x53caa0[_0x77d1('0x52')]]){logger[_0x77d1('0x22')](_0x77d1('0x53'),JSON[_0x77d1('0x51')](_0x53caa0['transfererlinkedid']));this[_0x77d1('0x44')](_0x53caa0['transfererlinkedid']);}}catch(_0x585d77){logger[_0x77d1('0x31')](_0x77d1('0x54'),_0x585d77['message']);}};Acw[_0x77d1('0x37')]['syncAgentRingNoAnswer']=function(_0x37ab9d){try{if(this[_0x77d1('0x5')][_0x37ab9d[_0x77d1('0x19')]]&&this[_0x77d1('0x5')][_0x37ab9d[_0x77d1('0x19')]]['autopause']===_0x77d1('0x55')){if(this[_0x77d1('0x6')][_0x37ab9d['interface']]){logger['info']('[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]',_0x37ab9d[_0x77d1('0x2d')],_0x37ab9d[_0x77d1('0x18')],_0x37ab9d['queue']);return RpcUser[_0x77d1('0x25')](this[_0x77d1('0x6')][_0x37ab9d[_0x77d1('0x18')]],_0x77d1('0x56'),_0x37ab9d[_0x77d1('0x2d')]);}}}catch(_0x59347f){logger['error']('[ACW][syncAgentRingNoAnswer]\x20%s',_0x59347f[_0x77d1('0x36')]);}};module[_0x77d1('0x57')]=Acw;
\ No newline at end of file
+var _0x3dfa=['update','uniqueid','catch','error','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','finally','[ACW][START]\x20%s','message','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','[ACW][STOP]\x20%s','syncAgentConnect','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','linkedid','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','syncAttendedTransfer','transfereeuniqueid','isNil','transfertargetuniqueid','origtransfereruniqueid','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','stringify','[%s][BLINDTRANSFER:LINKEDID]','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','util','lodash','moment','../ami','../../../config/logger','acw','../rpc/user','../rpc/voiceAgentReport','agents','bind','hanguprequest','syncHangupRequest','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','blindtransfer','syncBlindTransfer','syncAgentConnectPreview','milliseconds','diff','seconds','prototype','startAcw','interface','channels','queue','mandatoryDisposition','name','mandatoryDispositionPause','Action','then','getAgent','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','timers','info','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','voiceQueues','acwTimeout','stopAcw','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','updateAcw','timer'];(function(_0x45806b,_0x53eeae){var _0x3e228e=function(_0x3ee031){while(--_0x3ee031){_0x45806b['push'](_0x45806b['shift']());}};_0x3e228e(++_0x53eeae);}(_0x3dfa,0x1ce));var _0xa3df=function(_0x511cf2,_0x44cbeb){_0x511cf2=_0x511cf2-0x0;var _0x30654c=_0x3dfa[_0x511cf2];return _0x30654c;};'use strict';var util=require(_0xa3df('0x0'));var _=require(_0xa3df('0x1'));var moment=require(_0xa3df('0x2'));var ami=require(_0xa3df('0x3'));var logger=require(_0xa3df('0x4'))(_0xa3df('0x5'));var RpcUser=require(_0xa3df('0x6'));var RpcVoiceAgentReport=require(_0xa3df('0x7'));function Acw(_0x3c4993){this['voiceQueues']=_0x3c4993['voiceQueues'];this[_0xa3df('0x8')]=_0x3c4993[_0xa3df('0x8')];this['timers']=_0x3c4993['timers'];this['channels']={};ami['on']('agentconnect',this['syncAgentConnect'][_0xa3df('0x9')](this));ami['on'](_0xa3df('0xa'),this[_0xa3df('0xb')][_0xa3df('0x9')](this));ami['on']('hangup',this[_0xa3df('0xc')][_0xa3df('0x9')](this));ami['on'](_0xa3df('0xd'),this[_0xa3df('0xe')][_0xa3df('0x9')](this));ami['on'](_0xa3df('0xf'),this['syncAttendedTransfer'][_0xa3df('0x9')](this));ami['on'](_0xa3df('0x10'),this[_0xa3df('0x11')][_0xa3df('0x9')](this));ami['on']('custom:agentConnectPreview',this[_0xa3df('0x12')]['bind'](this));}function getDiff(_0x488587){var _0x44d9e6=moment()[_0xa3df('0x13')](0x0);var _0x37f0fb=moment(_0x488587)['milliseconds'](0x0);return _0x44d9e6[_0xa3df('0x14')](_0x37f0fb,_0xa3df('0x15'));}Acw[_0xa3df('0x16')][_0xa3df('0x17')]=function(_0x2cb070){try{var _0x268cd3=this;var _0x422a28=this['channels'][_0x2cb070][_0xa3df('0x18')];var _0x4f7bfe=this[_0xa3df('0x19')][_0x2cb070][_0xa3df('0x1a')];var _0x13b2c5=this['voiceQueues'][_0x4f7bfe];var _0x5149fd=![];var _0x10e535='ACW';if(_0x13b2c5[_0xa3df('0x1b')]){if(_0x13b2c5['mandatoryDispositionPause'][_0xa3df('0x1c')]){_0x5149fd=!![];_0x10e535=_0x13b2c5[_0xa3df('0x1d')][_0xa3df('0x1c')];}}ami[_0xa3df('0x1e')]({'action':'QueuePause','interface':_0x422a28,'paused':!![],'reason':_0x10e535})[_0xa3df('0x1f')](function(_0x4cce6c){if(_0x268cd3[_0xa3df('0x8')][_0x422a28]){return RpcUser[_0xa3df('0x20')](_0x268cd3[_0xa3df('0x8')][_0x422a28]['id'])[_0xa3df('0x1f')](function(_0x3e6f61){if(_0x3e6f61&&!_0x3e6f61['voicePause']){logger['info'](_0xa3df('0x21'),_0x2cb070,_0x422a28,_0x4f7bfe);var _0x48f058=_0x268cd3['channels'][_0x2cb070][_0xa3df('0x22')]&&_0x268cd3['channels'][_0x2cb070][_0xa3df('0x23')]?_0x268cd3[_0xa3df('0x19')][_0x2cb070][_0xa3df('0x23')]:_0x2cb070;return RpcUser[_0xa3df('0x24')](_0x268cd3[_0xa3df('0x8')][_0x422a28],_0x10e535,_0x48f058)[_0xa3df('0x1f')](function(_0x79dc6f){if(!_0x5149fd){_0x268cd3[_0xa3df('0x25')][_0x422a28]={};logger[_0xa3df('0x26')](_0xa3df('0x27'),_0x2cb070,_0x268cd3[_0xa3df('0x28')][_0x4f7bfe][_0xa3df('0x29')],_0x422a28,_0x4f7bfe);_0x268cd3[_0xa3df('0x25')][_0x422a28]['timer']=setTimeout(_0x268cd3[_0xa3df('0x2a')][_0xa3df('0x9')](_0x268cd3,_0x422a28),_0x268cd3[_0xa3df('0x28')][_0x4f7bfe][_0xa3df('0x29')]*0x3e8);_0x268cd3[_0xa3df('0x25')][_0x422a28][_0xa3df('0x2b')]=moment()[_0xa3df('0x2c')](_0xa3df('0x2d'));_0x268cd3[_0xa3df('0x25')][_0x422a28]['uniqueid']=_0x2cb070;_0x268cd3[_0xa3df('0x25')][_0x422a28][_0xa3df('0x1a')]=_0x4f7bfe;_0x268cd3[_0xa3df('0x25')][_0x422a28][_0xa3df('0x2e')]=function(){var _0x53ffaf=getDiff(_0x268cd3[_0xa3df('0x25')][_0x422a28]['lastPauseAt']);clearTimeout(_0x268cd3[_0xa3df('0x25')][_0x422a28]['timer']);_0x268cd3['timers'][_0x422a28][_0xa3df('0x2f')]=![];RpcVoiceAgentReport[_0xa3df('0x30')]({'acwtime':_0x53ffaf},_0x268cd3[_0xa3df('0x25')][_0x422a28][_0xa3df('0x31')],_0x422a28)[_0xa3df('0x1f')](function(_0x5e8d60){logger[_0xa3df('0x26')]('[%s][UPDATE][ACWTIME:%s]',_0x2cb070,_0x53ffaf,_0x5e8d60);})[_0xa3df('0x32')](function(_0x2cdffc){logger[_0xa3df('0x33')](_0xa3df('0x34'),_0x2cb070,_0x2cdffc);});delete _0x268cd3[_0xa3df('0x25')][_0x422a28];};}});}else{logger['info'](_0xa3df('0x35'),_0x2cb070,_0x422a28,_0x4f7bfe);}});}})[_0xa3df('0x32')](function(_0x3688b8){logger[_0xa3df('0x33')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x2cb070,_0x268cd3['voiceQueues'][_0x4f7bfe][_0xa3df('0x29')],_0x422a28,_0x4f7bfe);})[_0xa3df('0x36')](function(){delete _0x268cd3[_0xa3df('0x19')][_0x2cb070];});}catch(_0x3605af){logger['error'](_0xa3df('0x37'),_0x3605af[_0xa3df('0x38')]);}};Acw['prototype'][_0xa3df('0x2a')]=function(_0xe2df47){try{var _0x3213be=this;if(_0x3213be[_0xa3df('0x25')][_0xe2df47]){_0x3213be[_0xa3df('0x25')][_0xe2df47][_0xa3df('0x2f')]=![];var _0x283d3d=_0x3213be[_0xa3df('0x25')][_0xe2df47]['uniqueid'];var _0x65660=_0x3213be[_0xa3df('0x25')][_0xe2df47][_0xa3df('0x1a')];var _0x4ffe27=_0x3213be[_0xa3df('0x28')][_0x65660][_0xa3df('0x29')];logger[_0xa3df('0x26')](_0xa3df('0x39'),_0x283d3d,_0xe2df47);RpcUser[_0xa3df('0x3a')](this[_0xa3df('0x8')][_0xe2df47]);RpcVoiceAgentReport[_0xa3df('0x30')]({'acwtime':_0x4ffe27,'agentacw':!![]},_0x283d3d,_0xe2df47)[_0xa3df('0x1f')](function(_0x215406){logger[_0xa3df('0x26')]('[%s][UPDATE][ACWTIME:%s]',_0x283d3d,_0x4ffe27,_0x215406);})[_0xa3df('0x32')](function(_0x34c4ac){logger[_0xa3df('0x33')](_0xa3df('0x34'),_0x283d3d,_0x34c4ac);});}else{logger[_0xa3df('0x33')](_0xa3df('0x3b'),_0xe2df47);if(_0x3213be[_0xa3df('0x25')]){logger[_0xa3df('0x26')](_0xa3df('0x3c'),JSON['stringify'](_0x3213be[_0xa3df('0x25')]));}}}catch(_0x340328){logger[_0xa3df('0x33')](_0xa3df('0x3d'),_0x340328[_0xa3df('0x38')]);}};Acw[_0xa3df('0x16')][_0xa3df('0x3e')]=function(_0x105679){try{if(this[_0xa3df('0x28')][_0x105679[_0xa3df('0x1a')]]&&(this[_0xa3df('0x28')][_0x105679[_0xa3df('0x1a')]][_0xa3df('0x5')]||this['voiceQueues'][_0x105679[_0xa3df('0x1a')]]['mandatoryDisposition'])){if(this['agents'][_0x105679[_0xa3df('0x18')]]){this[_0xa3df('0x19')][_0x105679['uniqueid']]={'queue':_0x105679['queue'],'interface':_0x105679['interface'],'destlinkedid':_0x105679[_0xa3df('0x23')]};}}}catch(_0x3fa020){logger['error'](_0xa3df('0x3f'),_0x3fa020['message']);}};Acw[_0xa3df('0x16')]['syncAgentConnectPreview']=function(_0x2189f7){try{if(this[_0xa3df('0x28')][_0x2189f7['queue']]&&(this[_0xa3df('0x28')][_0x2189f7[_0xa3df('0x1a')]]['acw']||this[_0xa3df('0x28')][_0x2189f7[_0xa3df('0x1a')]][_0xa3df('0x1b')])){if(this[_0xa3df('0x8')][_0x2189f7[_0xa3df('0x18')]]){this['channels'][_0x2189f7[_0xa3df('0x31')]]={'queue':_0x2189f7[_0xa3df('0x1a')],'interface':_0x2189f7[_0xa3df('0x18')]};}}}catch(_0x4b9967){logger[_0xa3df('0x33')](_0xa3df('0x40'),_0x4b9967[_0xa3df('0x38')]);}};Acw[_0xa3df('0x16')][_0xa3df('0xb')]=function(_0x2e0c7b){try{if(this[_0xa3df('0x19')][_0x2e0c7b['uniqueid']]&&_['isUndefined'](this[_0xa3df('0x19')][_0x2e0c7b[_0xa3df('0x31')]][_0xa3df('0x22')])){logger[_0xa3df('0x26')]('[%s][HANGUP:UNIQUEID]',_0x2e0c7b[_0xa3df('0x31')]);this['startAcw'](_0x2e0c7b[_0xa3df('0x31')]);}else if(this[_0xa3df('0x19')][_0x2e0c7b['linkedid']]&&_['isUndefined'](this[_0xa3df('0x19')][_0x2e0c7b[_0xa3df('0x41')]]['attended'])){logger['info']('[%s][HANGUP:LINKEDID]',_0x2e0c7b['linkedid']);this[_0xa3df('0x17')](_0x2e0c7b[_0xa3df('0x41')]);}}catch(_0x3e3b61){logger['error'](_0xa3df('0x42'),_0x3e3b61[_0xa3df('0x38')]);}};Acw['prototype'][_0xa3df('0xc')]=function(_0x3fd46a){try{if(this['channels'][_0x3fd46a[_0xa3df('0x31')]]&&this[_0xa3df('0x19')][_0x3fd46a[_0xa3df('0x31')]][_0xa3df('0x22')]){logger['info'](_0xa3df('0x43'),_0x3fd46a['uniqueid']);this[_0xa3df('0x17')](_0x3fd46a['uniqueid']);}else if(this['channels'][_0x3fd46a[_0xa3df('0x41')]]&&this['channels'][_0x3fd46a[_0xa3df('0x41')]][_0xa3df('0x22')]){logger[_0xa3df('0x26')](_0xa3df('0x44'),_0x3fd46a[_0xa3df('0x41')]);this[_0xa3df('0x17')](_0x3fd46a['linkedid']);}}catch(_0x4b255c){logger['error']('[ACW][syncHangup]\x20%s',_0x4b255c[_0xa3df('0x38')]);}};Acw[_0xa3df('0x16')][_0xa3df('0x45')]=function(_0x10b76d){try{if(!_['isNil'](this[_0xa3df('0x19')][_0x10b76d[_0xa3df('0x46')]])){this[_0xa3df('0x17')](_0x10b76d['transfereeuniqueid']);if(this[_0xa3df('0x19')][_0x10b76d['secondtransfereruniqueid']]){this[_0xa3df('0x19')][_0x10b76d['secondtransfereruniqueid']][_0xa3df('0x22')]=!![];this[_0xa3df('0x19')][_0x10b76d['transfertargetuniqueid']]=this[_0xa3df('0x19')][_0x10b76d['secondtransfereruniqueid']];delete this[_0xa3df('0x19')][_0x10b76d['secondtransfereruniqueid']];}}else if(!_[_0xa3df('0x47')](this[_0xa3df('0x19')][_0x10b76d[_0xa3df('0x48')]])){this['startAcw'](_0x10b76d[_0xa3df('0x48')]);if(this['channels'][_0x10b76d[_0xa3df('0x49')]]){this[_0xa3df('0x19')][_0x10b76d[_0xa3df('0x49')]][_0xa3df('0x22')]=!![];this[_0xa3df('0x19')][_0x10b76d[_0xa3df('0x46')]]=this['channels'][_0x10b76d[_0xa3df('0x49')]];delete this[_0xa3df('0x19')][_0x10b76d[_0xa3df('0x49')]];}}}catch(_0xefece9){logger[_0xa3df('0x33')]('[ACW][syncAttendedTransfer]\x20%s',_0xefece9[_0xa3df('0x38')]);}};Acw[_0xa3df('0x16')][_0xa3df('0x11')]=function(_0x513d91){try{if(this[_0xa3df('0x19')][_0x513d91[_0xa3df('0x4a')]]){logger[_0xa3df('0x26')](_0xa3df('0x4b'),JSON[_0xa3df('0x4c')](_0x513d91[_0xa3df('0x4a')]));this[_0xa3df('0x17')](_0x513d91[_0xa3df('0x4a')]);}else if(this['channels'][_0x513d91['transfererlinkedid']]){logger[_0xa3df('0x26')](_0xa3df('0x4d'),JSON[_0xa3df('0x4c')](_0x513d91['transfererlinkedid']));this[_0xa3df('0x17')](_0x513d91[_0xa3df('0x4e')]);}}catch(_0x3449c4){logger[_0xa3df('0x33')](_0xa3df('0x4f'),_0x3449c4['message']);}};Acw[_0xa3df('0x16')][_0xa3df('0xe')]=function(_0x290079){try{if(this[_0xa3df('0x28')][_0x290079[_0xa3df('0x1a')]]&&this[_0xa3df('0x28')][_0x290079[_0xa3df('0x1a')]]['autopause']===_0xa3df('0x50')){if(this[_0xa3df('0x8')][_0x290079[_0xa3df('0x18')]]){logger[_0xa3df('0x26')](_0xa3df('0x51'),_0x290079[_0xa3df('0x31')],_0x290079[_0xa3df('0x18')],_0x290079['queue']);return RpcUser[_0xa3df('0x24')](this[_0xa3df('0x8')][_0x290079[_0xa3df('0x18')]],_0xa3df('0x52'),_0x290079['uniqueid']);}}}catch(_0x52fd72){logger[_0xa3df('0x33')](_0xa3df('0x53'),_0x52fd72['message']);}};module[_0xa3df('0x54')]=Acw;
\ No newline at end of file
index 36bf509..b00c8f8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0b0e=['../../config/environment','asterisk','port','username','password','promisify','action','error','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','format','Action','sipshowregistry','actionDeviceStateList','devicestatelist','actionQueueSummary','actionCoreShowChannels','coreshowchannels','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','close','shutdown','info','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','then','actionSipPeerStatus','catch','[ami.js][fullybooted]','once','asterisk-manager','moment','lodash','../../config/logger','ami'];(function(_0x212dee,_0x526a2a){var _0x21a4f9=function(_0x1d575c){while(--_0x1d575c){_0x212dee['push'](_0x212dee['shift']());}};_0x21a4f9(++_0x526a2a);}(_0x0b0e,0x187));var _0xe0b0=function(_0x404957,_0x5192a4){_0x404957=_0x404957-0x0;var _0x4e0365=_0x0b0e[_0x404957];return _0x4e0365;};'use strict';var Manager=require(_0xe0b0('0x0'));var BPromise=require('bluebird');var moment=require(_0xe0b0('0x1'));var util=require('util');var _=require(_0xe0b0('0x2'));var logger=require(_0xe0b0('0x3'))(_0xe0b0('0x4'));var config=require(_0xe0b0('0x5'));var ami=new Manager(config[_0xe0b0('0x6')][_0xe0b0('0x7')],config[_0xe0b0('0x6')]['ip'],config[_0xe0b0('0x6')][_0xe0b0('0x8')],config[_0xe0b0('0x6')][_0xe0b0('0x9')],!![]);ami['keepConnected']();ami['Action']=BPromise[_0xe0b0('0xa')](ami[_0xe0b0('0xb')]);function error(_0xc4a085){logger[_0xe0b0('0xc')](util['format'](_0xe0b0('0xd'),config[_0xe0b0('0x6')]['username'],config[_0xe0b0('0x6')]['ip'],config[_0xe0b0('0x6')]['port'],util[_0xe0b0('0xe')](_0xc4a085,![],null)));}function close(){logger[_0xe0b0('0xc')](util[_0xe0b0('0xf')]('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config[_0xe0b0('0x6')][_0xe0b0('0x8')],config[_0xe0b0('0x6')]['ip'],config[_0xe0b0('0x6')][_0xe0b0('0x7')]));}ami['actionSipShowRegistry']=function(){return function(){return ami[_0xe0b0('0x10')]({'action':_0xe0b0('0x11')});};};ami[_0xe0b0('0x12')]=function(){return function(){return ami[_0xe0b0('0x10')]({'action':_0xe0b0('0x13')});};};ami['actionSipPeerStatus']=function(){return function(){return ami[_0xe0b0('0x10')]({'action':'sippeerstatus'});};};ami[_0xe0b0('0x14')]=function(){return function(){return ami[_0xe0b0('0x10')]({'action':'queuesummary'});};};ami[_0xe0b0('0x15')]=function(){return function(){return ami['Action']({'action':_0xe0b0('0x16')});};};function connect(_0x100204){logger['info'](util['format'](_0xe0b0('0x17'),config['asterisk']['username'],config['asterisk']['ip'],config[_0xe0b0('0x6')]['port']));ami['once'](_0xe0b0('0xc'),error);ami['once'](_0xe0b0('0x18'),close);}ami['on']('connect',connect);ami['on'](_0xe0b0('0x19'),function(_0x1cd7c4){logger[_0xe0b0('0x1a')](util[_0xe0b0('0xf')](_0xe0b0('0x1b'),config['asterisk']['username'],config[_0xe0b0('0x6')]['ip'],config['asterisk'][_0xe0b0('0x7')],util[_0xe0b0('0xe')](_0x1cd7c4,![],null)));});ami['on']('fullybooted',function(_0x170ad8){logger['info'](util[_0xe0b0('0xf')]('Fullybooted\x20\x22%s\x22\x20to\x20%s:%s',config[_0xe0b0('0x6')]['username'],config[_0xe0b0('0x6')]['ip'],config['asterisk'][_0xe0b0('0x7')]));return BPromise['resolve']()[_0xe0b0('0x1c')](ami['actionSipShowRegistry']())[_0xe0b0('0x1c')](ami[_0xe0b0('0x12')]())[_0xe0b0('0x1c')](ami[_0xe0b0('0x1d')]())[_0xe0b0('0x1c')](ami[_0xe0b0('0x14')]())['then'](ami[_0xe0b0('0x15')]())[_0xe0b0('0x1e')](function(_0x5b7a64){logger[_0xe0b0('0xc')](_0xe0b0('0x1f'),util[_0xe0b0('0xe')](_0x5b7a64,{'showHidden':![],'depth':null}));});});ami[_0xe0b0('0x20')](_0xe0b0('0xc'),error);ami[_0xe0b0('0x20')](_0xe0b0('0x18'),close);module['exports']=ami;
\ No newline at end of file
+var _0x757a=['devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','queuesummary','actionCoreShowChannels','coreshowchannels','info','once','connect','shutdown','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','[ami.js][fullybooted]','close','exports','bluebird','moment','ami','../../config/environment','asterisk','port','password','Action','promisify','action','error','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','username','inspect','actionSipShowRegistry','actionDeviceStateList'];(function(_0x179c13,_0x15e4c5){var _0x1ee81c=function(_0x172124){while(--_0x172124){_0x179c13['push'](_0x179c13['shift']());}};_0x1ee81c(++_0x15e4c5);}(_0x757a,0xde));var _0xa757=function(_0xf0c0d,_0x18fec0){_0xf0c0d=_0xf0c0d-0x0;var _0xc3868=_0x757a[_0xf0c0d];return _0xc3868;};'use strict';var Manager=require('asterisk-manager');var BPromise=require(_0xa757('0x0'));var moment=require(_0xa757('0x1'));var util=require('util');var _=require('lodash');var logger=require('../../config/logger')(_0xa757('0x2'));var config=require(_0xa757('0x3'));var ami=new Manager(config[_0xa757('0x4')][_0xa757('0x5')],config[_0xa757('0x4')]['ip'],config[_0xa757('0x4')]['username'],config[_0xa757('0x4')][_0xa757('0x6')],!![]);ami['keepConnected']();ami[_0xa757('0x7')]=BPromise[_0xa757('0x8')](ami[_0xa757('0x9')]);function error(_0x1a95ee){logger[_0xa757('0xa')](util['format'](_0xa757('0xb'),config[_0xa757('0x4')][_0xa757('0xc')],config[_0xa757('0x4')]['ip'],config[_0xa757('0x4')][_0xa757('0x5')],util[_0xa757('0xd')](_0x1a95ee,![],null)));}function close(){logger['error'](util['format']('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config['asterisk']['username'],config[_0xa757('0x4')]['ip'],config['asterisk']['port']));}ami[_0xa757('0xe')]=function(){return function(){return ami['Action']({'action':'sipshowregistry'});};};ami[_0xa757('0xf')]=function(){return function(){return ami[_0xa757('0x7')]({'action':_0xa757('0x10')});};};ami[_0xa757('0x11')]=function(){return function(){return ami[_0xa757('0x7')]({'action':_0xa757('0x12')});};};ami[_0xa757('0x13')]=function(){return function(){return ami[_0xa757('0x7')]({'action':_0xa757('0x14')});};};ami[_0xa757('0x15')]=function(){return function(){return ami['Action']({'action':_0xa757('0x16')});};};function connect(_0x44eab8){logger[_0xa757('0x17')](util['format']('Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s',config[_0xa757('0x4')][_0xa757('0xc')],config[_0xa757('0x4')]['ip'],config[_0xa757('0x4')][_0xa757('0x5')]));ami[_0xa757('0x18')]('error',error);ami[_0xa757('0x18')]('close',close);}ami['on'](_0xa757('0x19'),connect);ami['on'](_0xa757('0x1a'),function(_0x14014c){logger[_0xa757('0x17')](util['format']('Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s',config[_0xa757('0x4')][_0xa757('0xc')],config[_0xa757('0x4')]['ip'],config[_0xa757('0x4')][_0xa757('0x5')],util[_0xa757('0xd')](_0x14014c,![],null)));});ami['on'](_0xa757('0x1b'),function(_0x21f1af){logger[_0xa757('0x17')](util['format'](_0xa757('0x1c'),config['asterisk'][_0xa757('0xc')],config['asterisk']['ip'],config[_0xa757('0x4')][_0xa757('0x5')]));return BPromise[_0xa757('0x1d')]()['then'](ami[_0xa757('0xe')]())[_0xa757('0x1e')](ami[_0xa757('0xf')]())[_0xa757('0x1e')](ami['actionSipPeerStatus']())[_0xa757('0x1e')](ami['actionQueueSummary']())['then'](ami['actionCoreShowChannels']())['catch'](function(_0xfdf69d){logger['error'](_0xa757('0x1f'),util[_0xa757('0xd')](_0xfdf69d,{'showHidden':![],'depth':null}));});});ami['once'](_0xa757('0xa'),error);ami['once'](_0xa757('0x20'),close);module[_0xa757('0x21')]=ami;
\ No newline at end of file
index 3ad3593..54e98e7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xda3f=['then','rpc','memberReport','error','message','result','catch','exports','bluebird','../../config/logger','Request','request'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xda3f,0xec));var _0xfda3=function(_0x3eac6e,_0xb03cc4){_0x3eac6e=_0x3eac6e-0x0;var _0x1d558b=_0xda3f[_0x3eac6e];return _0x1d558b;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0xfda3('0x0'));var logger=require(_0xfda3('0x1'))('ami');var client=jayson['client']['http']({'port':0x2329});client[_0xfda3('0x2')]=function(_0x581693,_0x36dc71){return new BPromise(function(_0x22187d,_0x516500){return client[_0xfda3('0x3')](_0x581693,_0x36dc71)[_0xfda3('0x4')](function(_0x47e7e2){logger['debug'](_0xfda3('0x5'),_0xfda3('0x6'),_0x581693,_0x36dc71,_0x47e7e2);if(_0x47e7e2[_0xfda3('0x7')]){logger[_0xfda3('0x7')](_0xfda3('0x5'),_0xfda3('0x6'),_0x581693,_0x47e7e2[_0xfda3('0x7')][_0xfda3('0x8')],_0x36dc71);return _0x516500(_0x47e7e2[_0xfda3('0x7')][_0xfda3('0x8')]);}else{return _0x22187d(_0x47e7e2[_0xfda3('0x9')]);}})[_0xfda3('0xa')](function(_0x4d7841){logger[_0xfda3('0x7')](_0xfda3('0x5'),_0xfda3('0x6'),_0x581693,_0x4d7841,_0x36dc71);return _0x516500(_0x4d7841);});});};module[_0xfda3('0xb')]=client;
\ No newline at end of file
+var _0xac4a=['ami','client','http','then','debug','memberReport','error','message','result','catch','rpc','jayson/promise','bluebird','../../config/logger'];(function(_0x50148e,_0x4c99c7){var _0x446e9d=function(_0x42a9ed){while(--_0x42a9ed){_0x50148e['push'](_0x50148e['shift']());}};_0x446e9d(++_0x4c99c7);}(_0xac4a,0x13f));var _0xaac4=function(_0x473668,_0x2452fb){_0x473668=_0x473668-0x0;var _0x59f76c=_0xac4a[_0x473668];return _0x59f76c;};'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 276f412..5c39883 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc04a=['countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','starttime','format','callback','callbackuniqueid','callbackat','recallme','originatecalleridname','prototype','getCaller','voiceQueue','dialCutDigit','getQueue','exports','isNil','string','uniqueid','name','Contact','phone','firstName','lastName','number','queue','active','type','scheduledat','countbusyretry'];(function(_0x2b351e,_0x46fe9c){var _0x1c4edd=function(_0x2757d1){while(--_0x2757d1){_0x2b351e['push'](_0x2b351e['shift']());}};_0x1c4edd(++_0x46fe9c);}(_0xc04a,0x13a));var _0xac04=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc04a[_0x3dd15e];return _0x231fd0;};'use strict';var util=require('util');var _=require('lodash');var moment=require('moment');function checkNameSurname(_0x325100,_0x2c8b93,_0x5d7651){var _0x2bd31b='';if(!_[_0xac04('0x0')](_0x2c8b93)&&_0xac04('0x1')===typeof _0x2c8b93){_0x2bd31b+=_0x2c8b93;}if(!_[_0xac04('0x0')](_0x5d7651)&&_0xac04('0x1')===typeof _0x5d7651){_0x2bd31b+='\x20'+_0x5d7651;}if(_0x2bd31b!==''){return _0x2bd31b;}return _0x325100;}function Action(_0x7c99cd,_0x45bb2f,_0x3ff1a1){this['voiceQueue']=_0x7c99cd;this[_0xac04('0x2')]=_0x3ff1a1||undefined;this[_0xac04('0x3')]=checkNameSurname(_0x45bb2f[_0xac04('0x4')][_0xac04('0x5')],_0x45bb2f[_0xac04('0x4')][_0xac04('0x6')],_0x45bb2f['Contact'][_0xac04('0x7')]);this[_0xac04('0x8')]=_0x45bb2f[_0xac04('0x5')];this[_0xac04('0x9')]=_0x7c99cd[_0xac04('0x3')];this[_0xac04('0xa')]=_0x45bb2f['active']||![];this[_0xac04('0xb')]=_0x7c99cd[_0xac04('0xb')];this['dialQueueTimeout']=_0x7c99cd['dialQueueTimeout']||0x3;this[_0xac04('0xc')]=_0x45bb2f[_0xac04('0xc')];this[_0xac04('0xd')]=_0x45bb2f[_0xac04('0xd')];this[_0xac04('0xe')]=_0x45bb2f[_0xac04('0xe')];this['countnoanswerretry']=_0x45bb2f[_0xac04('0xf')];this[_0xac04('0x10')]=_0x45bb2f[_0xac04('0x10')];this[_0xac04('0x11')]=_0x45bb2f[_0xac04('0x11')];this['countabandonedretry']=_0x45bb2f[_0xac04('0x12')];this[_0xac04('0x13')]=_0x45bb2f['countmachineretry'];this[_0xac04('0x14')]=_0x45bb2f[_0xac04('0x14')];this[_0xac04('0x15')]=_0x45bb2f[_0xac04('0x15')];this['ListId']=_0x45bb2f[_0xac04('0x16')];this[_0xac04('0x17')]=_0x45bb2f['UserId'];this[_0xac04('0x18')]=_0x45bb2f[_0xac04('0x18')];this[_0xac04('0x19')]=_0x45bb2f[_0xac04('0x19')];this[_0xac04('0x1a')]=_0x45bb2f['id'];this[_0xac04('0x1b')]=_0x45bb2f[_0xac04('0x4')]['firstName']||'';this[_0xac04('0x1c')]=moment()[_0xac04('0x1d')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xac04('0x1e')]=_0x45bb2f['callback'];this['callbackuniqueid']=_0x45bb2f[_0xac04('0x1f')];this[_0xac04('0x20')]=_0x45bb2f['callbackat'];this['recallme']=_0x45bb2f[_0xac04('0x21')];this['originatecalleridnum']='';this[_0xac04('0x22')]='';}Action[_0xac04('0x23')][_0xac04('0x24')]=function(){return util[_0xac04('0x1d')]('\x22%s\x22\x20<%s>',this[_0xac04('0x3')],this[_0xac04('0x25')][_0xac04('0x26')]>0x0?this[_0xac04('0x8')]['substring'](this['voiceQueue'][_0xac04('0x26')]):this['number']);};Action[_0xac04('0x23')][_0xac04('0x27')]=function(){return this[_0xac04('0x9')];};module[_0xac04('0x28')]=Action;
\ No newline at end of file
+var _0xccfb=['string','voiceQueue','uniqueid','name','Contact','phone','number','queue','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','getQueue','util','moment','isNil'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0xccfb,0x1b5));var _0xbccf=function(_0x413f57,_0x1ee8b6){_0x413f57=_0x413f57-0x0;var _0x216a7a=_0xccfb[_0x413f57];return _0x216a7a;};'use strict';var util=require(_0xbccf('0x0'));var _=require('lodash');var moment=require(_0xbccf('0x1'));function checkNameSurname(_0x379e4b,_0x3ac6ab,_0x29d886){var _0x136186='';if(!_[_0xbccf('0x2')](_0x3ac6ab)&&_0xbccf('0x3')===typeof _0x3ac6ab){_0x136186+=_0x3ac6ab;}if(!_[_0xbccf('0x2')](_0x29d886)&&_0xbccf('0x3')===typeof _0x29d886){_0x136186+='\x20'+_0x29d886;}if(_0x136186!==''){return _0x136186;}return _0x379e4b;}function Action(_0x193cda,_0x52c0fa,_0xed5763){this[_0xbccf('0x4')]=_0x193cda;this[_0xbccf('0x5')]=_0xed5763||undefined;this[_0xbccf('0x6')]=checkNameSurname(_0x52c0fa[_0xbccf('0x7')][_0xbccf('0x8')],_0x52c0fa[_0xbccf('0x7')]['firstName'],_0x52c0fa[_0xbccf('0x7')]['lastName']);this[_0xbccf('0x9')]=_0x52c0fa[_0xbccf('0x8')];this[_0xbccf('0xa')]=_0x193cda['name'];this['active']=_0x52c0fa['active']||![];this[_0xbccf('0xb')]=_0x193cda[_0xbccf('0xb')];this[_0xbccf('0xc')]=_0x193cda[_0xbccf('0xc')]||0x3;this['scheduledat']=_0x52c0fa[_0xbccf('0xd')];this[_0xbccf('0xe')]=_0x52c0fa[_0xbccf('0xe')];this[_0xbccf('0xf')]=_0x52c0fa[_0xbccf('0xf')];this[_0xbccf('0x10')]=_0x52c0fa[_0xbccf('0x10')];this[_0xbccf('0x11')]=_0x52c0fa[_0xbccf('0x11')];this[_0xbccf('0x12')]=_0x52c0fa['countdropretry'];this[_0xbccf('0x13')]=_0x52c0fa[_0xbccf('0x13')];this[_0xbccf('0x14')]=_0x52c0fa['countmachineretry'];this['countagentrejectretry']=_0x52c0fa[_0xbccf('0x15')];this['ContactId']=_0x52c0fa[_0xbccf('0x16')];this['ListId']=_0x52c0fa[_0xbccf('0x17')];this[_0xbccf('0x18')]=_0x52c0fa[_0xbccf('0x18')];this[_0xbccf('0x19')]=_0x52c0fa[_0xbccf('0x19')];this[_0xbccf('0x1a')]=_0x52c0fa[_0xbccf('0x1a')];this[_0xbccf('0x1b')]=_0x52c0fa['id'];this['ContactFirstName']=_0x52c0fa['Contact']['firstName']||'';this['starttime']=moment()[_0xbccf('0x1c')](_0xbccf('0x1d'));this[_0xbccf('0x1e')]=_0x52c0fa[_0xbccf('0x1e')];this['callbackuniqueid']=_0x52c0fa[_0xbccf('0x1f')];this[_0xbccf('0x20')]=_0x52c0fa[_0xbccf('0x20')];this[_0xbccf('0x21')]=_0x52c0fa[_0xbccf('0x21')];this[_0xbccf('0x22')]='';this[_0xbccf('0x23')]='';}Action[_0xbccf('0x24')][_0xbccf('0x25')]=function(){return util[_0xbccf('0x1c')](_0xbccf('0x26'),this['name'],this['voiceQueue']['dialCutDigit']>0x0?this[_0xbccf('0x9')]['substring'](this[_0xbccf('0x4')]['dialCutDigit']):this[_0xbccf('0x9')]);};Action[_0xbccf('0x24')][_0xbccf('0x27')]=function(){return this[_0xbccf('0xa')];};module['exports']=Action;
\ No newline at end of file
index 6993b8f..b684f2b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe9f7=['VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','calleridname','name','calleridnum','starttime','responsetime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','UserId'];(function(_0x2eb7ef,_0x2748f9){var _0x44dfec=function(_0x204b1d){while(--_0x204b1d){_0x2eb7ef['push'](_0x2eb7ef['shift']());}};_0x44dfec(++_0x2748f9);}(_0xe9f7,0x1a7));var _0x7e9f=function(_0x46ae5a,_0x2a38d0){_0x46ae5a=_0x46ae5a-0x0;var _0x434986=_0xe9f7[_0x46ae5a];return _0x434986;};'use strict';var util=require(_0x7e9f('0x0'));var _=require('lodash');var moment=require('moment');function getSeconds(_0x47048a,_0x1c33a4){var _0x3482f6=moment(_0x47048a)[_0x7e9f('0x1')](0x0);var _0x4d92d7=moment(_0x1c33a4)['milliseconds'](0x0);return _0x3482f6[_0x7e9f('0x2')](_0x4d92d7,_0x7e9f('0x3'));}function AdditionalPhone(_0x408cff){this['uniqueid']=_0x408cff[_0x7e9f('0x4')];this[_0x7e9f('0x5')]=_0x408cff[_0x7e9f('0x5')]||undefined;this['type']=_0x408cff[_0x7e9f('0x6')];this[_0x7e9f('0x7')]=_0x408cff[_0x7e9f('0x6')]===_0x7e9f('0x8')?_0x7e9f('0x9'):_0x408cff['type'];this[_0x7e9f('0xa')]=_0x408cff['countbusyretry'];this[_0x7e9f('0xb')]=_0x408cff[_0x7e9f('0xb')];this[_0x7e9f('0xc')]=_0x408cff['countnoanswerretry'];this[_0x7e9f('0xd')]=_0x408cff[_0x7e9f('0xa')]+_0x408cff['countcongestionretry']+_0x408cff['countnoanswerretry']+_0x408cff['countnosuchnumberretry']+_0x408cff[_0x7e9f('0xe')]+_0x408cff[_0x7e9f('0xf')]+_0x408cff[_0x7e9f('0x10')]+_0x408cff[_0x7e9f('0x11')];this[_0x7e9f('0x12')]=_0x408cff[_0x7e9f('0x12')];this[_0x7e9f('0xe')]=_0x408cff['countdropretry'];this[_0x7e9f('0xf')]=_0x408cff[_0x7e9f('0xf')];this[_0x7e9f('0x10')]=_0x408cff['countmachineretry'];this[_0x7e9f('0x11')]=_0x408cff[_0x7e9f('0x11')];this['queue']=_0x408cff[_0x7e9f('0x9')];this[_0x7e9f('0x13')]=_0x408cff[_0x7e9f('0x14')];this[_0x7e9f('0x15')]=_0x408cff['number'];this[_0x7e9f('0x16')]=_0x408cff[_0x7e9f('0x16')];this[_0x7e9f('0x17')]=_0x408cff[_0x7e9f('0x17')];this['endtime']=_0x408cff[_0x7e9f('0x17')];this[_0x7e9f('0x18')]=getSeconds(_0x408cff[_0x7e9f('0x17')],_0x408cff[_0x7e9f('0x16')]);this[_0x7e9f('0x19')]=0x0;this[_0x7e9f('0x1a')]=0x0;this[_0x7e9f('0x1b')]=_0x408cff[_0x7e9f('0x1b')];this[_0x7e9f('0x1c')]=_0x408cff[_0x7e9f('0x1c')];this[_0x7e9f('0x1d')]=_0x408cff[_0x7e9f('0x1d')];this[_0x7e9f('0x1e')]=_0x408cff['recallme'];this[_0x7e9f('0x1f')]=_0x408cff[_0x7e9f('0x1f')];this['ListId']=_0x408cff['ListId'];this[_0x7e9f('0x20')]=_0x408cff[_0x7e9f('0x20')];this[_0x7e9f('0x21')]=_0x408cff[_0x7e9f('0x21')];this[_0x7e9f('0x22')]=_0x408cff[_0x7e9f('0x22')];this[_0x7e9f('0x23')]=_0x408cff['originatecalleridnum']||'';this[_0x7e9f('0x24')]=_0x408cff['originatecalleridname']||'';}module[_0x7e9f('0x25')]=History;
\ No newline at end of file
+var _0x7de7=['responsetime','endtime','ringtime','holdtime','callback','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countcongestionretry','countnoanswerretry','countglobal','countbusyretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','calleridname','starttime'];(function(_0xba1da7,_0x58c389){var _0x1afc4d=function(_0x45c70c){while(--_0x45c70c){_0xba1da7['push'](_0xba1da7['shift']());}};_0x1afc4d(++_0x58c389);}(_0x7de7,0xbe));var _0x77de=function(_0xd299c3,_0x4ba0f1){_0xd299c3=_0xd299c3-0x0;var _0x376574=_0x7de7[_0xd299c3];return _0x376574;};'use strict';var util=require(_0x77de('0x0'));var _=require('lodash');var moment=require('moment');function getSeconds(_0x275e9b,_0x5831de){var _0x208c2e=moment(_0x275e9b)[_0x77de('0x1')](0x0);var _0x9e19c9=moment(_0x5831de)['milliseconds'](0x0);return _0x208c2e[_0x77de('0x2')](_0x9e19c9,_0x77de('0x3'));}function AdditionalPhone(_0x1e12a0){this[_0x77de('0x4')]=_0x1e12a0[_0x77de('0x4')];this[_0x77de('0x5')]=_0x1e12a0[_0x77de('0x5')]||undefined;this[_0x77de('0x6')]=_0x1e12a0[_0x77de('0x6')];this[_0x77de('0x7')]=_0x1e12a0['type']===_0x77de('0x8')?_0x77de('0x9'):_0x1e12a0[_0x77de('0x6')];this['countbusyretry']=_0x1e12a0['countbusyretry'];this[_0x77de('0xa')]=_0x1e12a0[_0x77de('0xa')];this[_0x77de('0xb')]=_0x1e12a0[_0x77de('0xb')];this[_0x77de('0xc')]=_0x1e12a0[_0x77de('0xd')]+_0x1e12a0[_0x77de('0xa')]+_0x1e12a0['countnoanswerretry']+_0x1e12a0['countnosuchnumberretry']+_0x1e12a0[_0x77de('0xe')]+_0x1e12a0['countabandonedretry']+_0x1e12a0[_0x77de('0xf')]+_0x1e12a0[_0x77de('0x10')];this['countnosuchnumberretry']=_0x1e12a0['countnosuchnumberretry'];this['countdropretry']=_0x1e12a0['countdropretry'];this[_0x77de('0x11')]=_0x1e12a0[_0x77de('0x11')];this[_0x77de('0xf')]=_0x1e12a0[_0x77de('0xf')];this[_0x77de('0x10')]=_0x1e12a0[_0x77de('0x10')];this[_0x77de('0x9')]=_0x1e12a0['queue'];this[_0x77de('0x12')]=_0x1e12a0['name'];this['calleridnum']=_0x1e12a0['number'];this['starttime']=_0x1e12a0[_0x77de('0x13')];this[_0x77de('0x14')]=_0x1e12a0[_0x77de('0x14')];this[_0x77de('0x15')]=_0x1e12a0['responsetime'];this[_0x77de('0x16')]=getSeconds(_0x1e12a0[_0x77de('0x14')],_0x1e12a0[_0x77de('0x13')]);this[_0x77de('0x17')]=0x0;this['talktime']=0x0;this[_0x77de('0x18')]=_0x1e12a0[_0x77de('0x18')];this['callbackuniqueid']=_0x1e12a0['callbackuniqueid'];this[_0x77de('0x19')]=_0x1e12a0[_0x77de('0x19')];this[_0x77de('0x1a')]=_0x1e12a0[_0x77de('0x1a')];this['ContactId']=_0x1e12a0[_0x77de('0x1b')];this[_0x77de('0x1c')]=_0x1e12a0[_0x77de('0x1c')];this[_0x77de('0x1d')]=_0x1e12a0[_0x77de('0x1d')];this[_0x77de('0x1e')]=_0x1e12a0[_0x77de('0x1e')];this['CampaignId']=_0x1e12a0[_0x77de('0x1f')];this[_0x77de('0x20')]=_0x1e12a0['originatecalleridnum']||'';this['originatecalleridname']=_0x1e12a0[_0x77de('0x21')]||'';}module[_0x77de('0x22')]=History;
\ No newline at end of file
index fd0c781..b76bacd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb72f=['calleridnum','number','starttime','responsetime','answertime','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','endtime','membername','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','lodash','moment','milliseconds','seconds','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countnoanswerretry','countglobal','countcongestionretry','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','name'];(function(_0x373698,_0xa32475){var _0x36f3d9=function(_0x2de6f8){while(--_0x2de6f8){_0x373698['push'](_0x373698['shift']());}};_0x36f3d9(++_0xa32475);}(_0xb72f,0x1d8));var _0xfb72=function(_0x27beea,_0x3bc9f4){_0x27beea=_0x27beea-0x0;var _0x122645=_0xb72f[_0x27beea];return _0x122645;};'use strict';var util=require(_0xfb72('0x0'));var _=require(_0xfb72('0x1'));var moment=require(_0xfb72('0x2'));function getSeconds(_0x588b4c,_0x26458e){var _0x1e2ae4=moment(_0x588b4c)[_0xfb72('0x3')](0x0);var _0x45ce83=moment(_0x26458e)[_0xfb72('0x3')](0x0);return _0x1e2ae4['diff'](_0x45ce83,_0xfb72('0x4'));}function AgentComplete(_0x31e623,_0x194402){this[_0xfb72('0x5')]=0x4;this[_0xfb72('0x6')]=_0xfb72('0x7');this[_0xfb72('0x8')]=_0x31e623[_0xfb72('0x8')];this[_0xfb72('0x9')]=_0x31e623[_0xfb72('0x9')];this[_0xfb72('0xa')]=_0x31e623[_0xfb72('0x9')]===_0xfb72('0xb')?_0xfb72('0xc'):_0x31e623[_0xfb72('0x9')];this[_0xfb72('0xd')]=_0x31e623[_0xfb72('0xd')];this['countcongestionretry']=_0x31e623['countcongestionretry'];this[_0xfb72('0xe')]=_0x31e623[_0xfb72('0xe')];this[_0xfb72('0xf')]=_0x31e623['countbusyretry']+_0x31e623[_0xfb72('0x10')]+_0x31e623[_0xfb72('0xe')]+_0x31e623[_0xfb72('0x11')]+_0x31e623[_0xfb72('0x12')]+_0x31e623['countabandonedretry']+_0x31e623[_0xfb72('0x13')]+_0x31e623[_0xfb72('0x14')];this[_0xfb72('0x11')]=_0x31e623[_0xfb72('0x11')];this[_0xfb72('0x12')]=_0x31e623[_0xfb72('0x12')];this[_0xfb72('0x15')]=_0x31e623[_0xfb72('0x15')];this[_0xfb72('0x13')]=_0x31e623[_0xfb72('0x13')];this[_0xfb72('0x14')]=_0x31e623[_0xfb72('0x14')];this['uniqueid']=_0x194402['uniqueid'];this['calleridname']=_0x31e623[_0xfb72('0x16')];this[_0xfb72('0x17')]=_0x31e623[_0xfb72('0x18')];this[_0xfb72('0x19')]=_0x31e623[_0xfb72('0x19')];this['responsetime']=_0x31e623[_0xfb72('0x1a')];this['answertime']=_0x31e623[_0xfb72('0x1b')];this['endtime']=moment()['format'](_0xfb72('0x1c'));this[_0xfb72('0x1d')]=getSeconds(_0x31e623['responsetime'],_0x31e623[_0xfb72('0x19')]);this[_0xfb72('0x1e')]=getSeconds(_0x31e623[_0xfb72('0x1b')],_0x31e623[_0xfb72('0x1a')]);this[_0xfb72('0x1f')]=getSeconds(this[_0xfb72('0x20')],_0x31e623['answertime']);this['queue']=_0x194402['queue'];this[_0xfb72('0x21')]=_0x194402[_0xfb72('0x21')];this['reason']=_0x194402['reason'];this[_0xfb72('0x22')]=_0x31e623[_0xfb72('0x22')];this[_0xfb72('0x23')]=_0x31e623[_0xfb72('0x23')];this['callbackat']=_0x31e623[_0xfb72('0x24')];this[_0xfb72('0x25')]=_0x31e623['recallme'];this[_0xfb72('0x26')]=_0x31e623[_0xfb72('0x26')];this[_0xfb72('0x27')]=_0x31e623[_0xfb72('0x27')];this[_0xfb72('0x28')]=_0x31e623[_0xfb72('0x28')];this[_0xfb72('0x29')]=_0x31e623[_0xfb72('0x29')];this['CampaignId']=_0x31e623[_0xfb72('0x2a')];this[_0xfb72('0x2b')]=_0x31e623[_0xfb72('0x2b')]||'';this['originatecalleridname']=_0x31e623[_0xfb72('0x2c')]||'';}module['exports']=AgentComplete;
\ No newline at end of file
+var _0xacb4=['util','lodash','moment','diff','seconds','state','Answer','scheduledat','type','campaigntype','queue','countcongestionretry','countnoanswerretry','countglobal','countbusyretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','holdtime','talktime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname'];(function(_0x2bde6c,_0x5bb643){var _0x187c7b=function(_0x4d1fdb){while(--_0x4d1fdb){_0x2bde6c['push'](_0x2bde6c['shift']());}};_0x187c7b(++_0x5bb643);}(_0xacb4,0x142));var _0x4acb=function(_0x127c7b,_0x1f65e7){_0x127c7b=_0x127c7b-0x0;var _0x1708eb=_0xacb4[_0x127c7b];return _0x1708eb;};'use strict';var util=require(_0x4acb('0x0'));var _=require(_0x4acb('0x1'));var moment=require(_0x4acb('0x2'));function getSeconds(_0x4bc4cb,_0x48fb45){var _0x610b33=moment(_0x4bc4cb)['milliseconds'](0x0);var _0x3c07f3=moment(_0x48fb45)['milliseconds'](0x0);return _0x610b33[_0x4acb('0x3')](_0x3c07f3,_0x4acb('0x4'));}function AgentComplete(_0x1985b2,_0x47efac){this[_0x4acb('0x5')]=0x4;this['statedesc']=_0x4acb('0x6');this[_0x4acb('0x7')]=_0x1985b2[_0x4acb('0x7')];this[_0x4acb('0x8')]=_0x1985b2[_0x4acb('0x8')];this[_0x4acb('0x9')]=_0x1985b2['type']==='outbound'?_0x4acb('0xa'):_0x1985b2[_0x4acb('0x8')];this['countbusyretry']=_0x1985b2['countbusyretry'];this[_0x4acb('0xb')]=_0x1985b2[_0x4acb('0xb')];this[_0x4acb('0xc')]=_0x1985b2[_0x4acb('0xc')];this[_0x4acb('0xd')]=_0x1985b2[_0x4acb('0xe')]+_0x1985b2['countcongestionretry']+_0x1985b2[_0x4acb('0xc')]+_0x1985b2['countnosuchnumberretry']+_0x1985b2[_0x4acb('0xf')]+_0x1985b2[_0x4acb('0x10')]+_0x1985b2[_0x4acb('0x11')]+_0x1985b2[_0x4acb('0x12')];this['countnosuchnumberretry']=_0x1985b2[_0x4acb('0x13')];this['countdropretry']=_0x1985b2[_0x4acb('0xf')];this[_0x4acb('0x10')]=_0x1985b2[_0x4acb('0x10')];this[_0x4acb('0x11')]=_0x1985b2['countmachineretry'];this[_0x4acb('0x12')]=_0x1985b2['countagentrejectretry'];this[_0x4acb('0x14')]=_0x47efac[_0x4acb('0x14')];this[_0x4acb('0x15')]=_0x1985b2[_0x4acb('0x16')];this[_0x4acb('0x17')]=_0x1985b2[_0x4acb('0x18')];this[_0x4acb('0x19')]=_0x1985b2[_0x4acb('0x19')];this[_0x4acb('0x1a')]=_0x1985b2[_0x4acb('0x1a')];this[_0x4acb('0x1b')]=_0x1985b2[_0x4acb('0x1b')];this[_0x4acb('0x1c')]=moment()[_0x4acb('0x1d')](_0x4acb('0x1e'));this['ringtime']=getSeconds(_0x1985b2['responsetime'],_0x1985b2[_0x4acb('0x19')]);this[_0x4acb('0x1f')]=getSeconds(_0x1985b2['answertime'],_0x1985b2[_0x4acb('0x1a')]);this[_0x4acb('0x20')]=getSeconds(this[_0x4acb('0x1c')],_0x1985b2['answertime']);this['queue']=_0x47efac[_0x4acb('0xa')];this[_0x4acb('0x21')]=_0x47efac[_0x4acb('0x21')];this[_0x4acb('0x22')]=_0x47efac['reason'];this['callback']=_0x1985b2[_0x4acb('0x23')];this[_0x4acb('0x24')]=_0x1985b2[_0x4acb('0x24')];this[_0x4acb('0x25')]=_0x1985b2['callbackat'];this[_0x4acb('0x26')]=_0x1985b2[_0x4acb('0x26')];this[_0x4acb('0x27')]=_0x1985b2[_0x4acb('0x27')];this[_0x4acb('0x28')]=_0x1985b2[_0x4acb('0x28')];this[_0x4acb('0x29')]=_0x1985b2[_0x4acb('0x29')];this[_0x4acb('0x2a')]=_0x1985b2['VoiceQueueId'];this[_0x4acb('0x2b')]=_0x1985b2[_0x4acb('0x2b')];this[_0x4acb('0x2c')]=_0x1985b2[_0x4acb('0x2c')]||'';this[_0x4acb('0x2d')]=_0x1985b2[_0x4acb('0x2d')]||'';}module['exports']=AgentComplete;
\ No newline at end of file
index 41546b9..e71a4cb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x29d4=['moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util'];(function(_0x1c5aa8,_0x49a908){var _0x326c66=function(_0x36d230){while(--_0x36d230){_0x1c5aa8['push'](_0x1c5aa8['shift']());}};_0x326c66(++_0x49a908);}(_0x29d4,0x1a1));var _0x429d=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x29d4[_0xbca1b1];return _0x4e1686;};'use strict';var util=require(_0x429d('0x0'));var _=require('lodash');var moment=require(_0x429d('0x1'));function getSeconds(_0x40881e,_0x16ce75){var _0x472fc9=moment(_0x40881e)[_0x429d('0x2')](0x0);var _0x4e287b=moment(_0x16ce75)[_0x429d('0x2')](0x0);return _0x472fc9[_0x429d('0x3')](_0x4e287b,_0x429d('0x4'));}function Final(_0x5e2a9c){this[_0x429d('0x5')]=_0x5e2a9c[_0x429d('0x5')];this[_0x429d('0x6')]=_0x5e2a9c[_0x429d('0x6')];this['type']=_0x5e2a9c[_0x429d('0x7')];this['campaigntype']=_0x5e2a9c[_0x429d('0x7')]===_0x429d('0x8')?_0x429d('0x9'):_0x5e2a9c['type'];this[_0x429d('0xa')]=_0x5e2a9c[_0x429d('0xa')];this['countcongestionretry']=_0x5e2a9c[_0x429d('0xb')];this[_0x429d('0xc')]=_0x5e2a9c[_0x429d('0xc')];this['countglobal']=_0x5e2a9c[_0x429d('0xa')]+_0x5e2a9c[_0x429d('0xb')]+_0x5e2a9c[_0x429d('0xc')]+_0x5e2a9c[_0x429d('0xd')]+_0x5e2a9c['countdropretry']+_0x5e2a9c[_0x429d('0xe')]+_0x5e2a9c[_0x429d('0xf')]+_0x5e2a9c[_0x429d('0x10')];this['countnosuchnumberretry']=_0x5e2a9c[_0x429d('0xd')];this[_0x429d('0x11')]=_0x5e2a9c['countdropretry'];this[_0x429d('0xe')]=_0x5e2a9c[_0x429d('0xe')];this[_0x429d('0xf')]=_0x5e2a9c[_0x429d('0xf')];this[_0x429d('0x10')]=_0x5e2a9c[_0x429d('0x10')];this['queue']=_0x5e2a9c[_0x429d('0x9')];this['calleridname']=_0x5e2a9c[_0x429d('0x12')];this[_0x429d('0x13')]=_0x5e2a9c[_0x429d('0x13')];this[_0x429d('0x14')]=_0x5e2a9c['starttime'];this[_0x429d('0x15')]=_0x5e2a9c[_0x429d('0x15')];this[_0x429d('0x16')]=_0x5e2a9c['responsetime'];this[_0x429d('0x17')]=_0x5e2a9c[_0x429d('0x17')]||0x0;this[_0x429d('0x18')]=_0x5e2a9c[_0x429d('0x18')]||0x0;this[_0x429d('0x19')]=_0x5e2a9c[_0x429d('0x19')]||0x0;this['callback']=_0x5e2a9c[_0x429d('0x1a')];this[_0x429d('0x1b')]=_0x5e2a9c[_0x429d('0x1b')];this['callbackat']=_0x5e2a9c[_0x429d('0x1c')];this[_0x429d('0x1d')]=_0x5e2a9c[_0x429d('0x1d')];this[_0x429d('0x1e')]=_0x5e2a9c[_0x429d('0x1e')];this[_0x429d('0x1f')]=_0x5e2a9c['ListId'];this[_0x429d('0x20')]=_0x5e2a9c[_0x429d('0x20')];this['VoiceQueueId']=_0x5e2a9c[_0x429d('0x21')];this[_0x429d('0x22')]=_0x5e2a9c[_0x429d('0x22')];this[_0x429d('0x23')]=_0x5e2a9c['originatecalleridnum']||'';this[_0x429d('0x24')]=_0x5e2a9c[_0x429d('0x24')]||'';}module[_0x429d('0x25')]=Final;
\ No newline at end of file
+var _0x7118=['talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','countdropretry','calleridname','calleridnum','starttime','endtime','responsetime','ringtime','holdtime'];(function(_0x588783,_0x550af0){var _0x146ed6=function(_0x27ffe9){while(--_0x27ffe9){_0x588783['push'](_0x588783['shift']());}};_0x146ed6(++_0x550af0);}(_0x7118,0x159));var _0x8711=function(_0x342143,_0x416fbb){_0x342143=_0x342143-0x0;var _0x50cc24=_0x7118[_0x342143];return _0x50cc24;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x8711('0x0'));function getSeconds(_0xf50b2e,_0x5c64d4){var _0x1758c5=moment(_0xf50b2e)[_0x8711('0x1')](0x0);var _0x348e88=moment(_0x5c64d4)[_0x8711('0x1')](0x0);return _0x1758c5[_0x8711('0x2')](_0x348e88,_0x8711('0x3'));}function Final(_0x206b82){this['uniqueid']=_0x206b82[_0x8711('0x4')];this[_0x8711('0x5')]=_0x206b82[_0x8711('0x5')];this[_0x8711('0x6')]=_0x206b82[_0x8711('0x6')];this[_0x8711('0x7')]=_0x206b82[_0x8711('0x6')]===_0x8711('0x8')?_0x8711('0x9'):_0x206b82[_0x8711('0x6')];this[_0x8711('0xa')]=_0x206b82['countbusyretry'];this['countcongestionretry']=_0x206b82[_0x8711('0xb')];this[_0x8711('0xc')]=_0x206b82[_0x8711('0xc')];this['countglobal']=_0x206b82['countbusyretry']+_0x206b82[_0x8711('0xb')]+_0x206b82[_0x8711('0xc')]+_0x206b82['countnosuchnumberretry']+_0x206b82['countdropretry']+_0x206b82[_0x8711('0xd')]+_0x206b82[_0x8711('0xe')]+_0x206b82[_0x8711('0xf')];this[_0x8711('0x10')]=_0x206b82[_0x8711('0x10')];this[_0x8711('0x11')]=_0x206b82[_0x8711('0x11')];this['countabandonedretry']=_0x206b82[_0x8711('0xd')];this[_0x8711('0xe')]=_0x206b82[_0x8711('0xe')];this[_0x8711('0xf')]=_0x206b82[_0x8711('0xf')];this[_0x8711('0x9')]=_0x206b82['queue'];this[_0x8711('0x12')]=_0x206b82[_0x8711('0x12')];this[_0x8711('0x13')]=_0x206b82[_0x8711('0x13')];this[_0x8711('0x14')]=_0x206b82['starttime'];this['responsetime']=_0x206b82['responsetime'];this[_0x8711('0x15')]=_0x206b82[_0x8711('0x16')];this[_0x8711('0x17')]=_0x206b82['ringtime']||0x0;this['holdtime']=_0x206b82[_0x8711('0x18')]||0x0;this[_0x8711('0x19')]=_0x206b82[_0x8711('0x19')]||0x0;this[_0x8711('0x1a')]=_0x206b82[_0x8711('0x1a')];this[_0x8711('0x1b')]=_0x206b82[_0x8711('0x1b')];this[_0x8711('0x1c')]=_0x206b82[_0x8711('0x1c')];this[_0x8711('0x1d')]=_0x206b82['recallme'];this[_0x8711('0x1e')]=_0x206b82[_0x8711('0x1e')];this[_0x8711('0x1f')]=_0x206b82[_0x8711('0x1f')];this['UserId']=_0x206b82[_0x8711('0x20')];this[_0x8711('0x21')]=_0x206b82[_0x8711('0x21')];this['CampaignId']=_0x206b82[_0x8711('0x22')];this[_0x8711('0x23')]=_0x206b82[_0x8711('0x23')]||'';this[_0x8711('0x24')]=_0x206b82[_0x8711('0x24')]||'';}module['exports']=Final;
\ No newline at end of file
index 0bb4379..fe6c19e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6f68=['callbackuniqueid','callbackat','recallme','ContactId','ListId','VoiceQueueId','CampaignId','exports','lodash','milliseconds','diff','statedesc','Answer','scheduledat','campaigntype','type','queue','countbusyretry','countnoanswerretry','countglobal','countcongestionretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','calleridnum','number','starttime','responsetime','endtime','ringtime','membername','IVR','reason','callback'];(function(_0x47d1ae,_0x41e056){var _0x47328a=function(_0x35adb5){while(--_0x35adb5){_0x47d1ae['push'](_0x47d1ae['shift']());}};_0x47328a(++_0x41e056);}(_0x6f68,0x138));var _0x86f6=function(_0x792269,_0x53a7ba){_0x792269=_0x792269-0x0;var _0xb0c97e=_0x6f68[_0x792269];return _0xb0c97e;};'use strict';var util=require('util');var _=require(_0x86f6('0x0'));var moment=require('moment');function getSeconds(_0x599aac,_0x5f59f0){var _0x3fc945=moment(_0x599aac)['milliseconds'](0x0);var _0x2e730f=moment(_0x5f59f0)[_0x86f6('0x1')](0x0);return _0x3fc945[_0x86f6('0x2')](_0x2e730f,'seconds');}function Hangup(_0x34b27b,_0xad315f){this['state']=0x4;this[_0x86f6('0x3')]=_0x86f6('0x4');this[_0x86f6('0x5')]=_0x34b27b[_0x86f6('0x5')];this['type']=_0x34b27b['type'];this[_0x86f6('0x6')]=_0x34b27b[_0x86f6('0x7')]==='outbound'?_0x86f6('0x8'):_0x34b27b[_0x86f6('0x7')];this[_0x86f6('0x9')]=_0x34b27b[_0x86f6('0x9')];this['countcongestionretry']=_0x34b27b['countcongestionretry'];this[_0x86f6('0xa')]=_0x34b27b[_0x86f6('0xa')];this[_0x86f6('0xb')]=_0x34b27b['countbusyretry']+_0x34b27b[_0x86f6('0xc')]+_0x34b27b[_0x86f6('0xa')]+_0x34b27b[_0x86f6('0xd')]+_0x34b27b[_0x86f6('0xe')]+_0x34b27b[_0x86f6('0xf')]+_0x34b27b[_0x86f6('0x10')]+_0x34b27b[_0x86f6('0x11')];this['countnosuchnumberretry']=_0x34b27b['countnosuchnumberretry'];this[_0x86f6('0xe')]=_0x34b27b[_0x86f6('0xe')];this[_0x86f6('0xf')]=_0x34b27b['countabandonedretry'];this[_0x86f6('0x10')]=_0x34b27b[_0x86f6('0x10')];this['countagentrejectretry']=_0x34b27b[_0x86f6('0x11')];this[_0x86f6('0x12')]=_0xad315f[_0x86f6('0x12')];this[_0x86f6('0x13')]=_0x34b27b['name'];this[_0x86f6('0x14')]=_0x34b27b[_0x86f6('0x15')];this[_0x86f6('0x16')]=_0x34b27b[_0x86f6('0x16')];this['responsetime']=_0x34b27b[_0x86f6('0x17')];this[_0x86f6('0x18')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x86f6('0x19')]=getSeconds(_0x34b27b['responsetime'],_0x34b27b[_0x86f6('0x16')]);this['holdtime']=0x0;this['talktime']=getSeconds(this[_0x86f6('0x18')],_0x34b27b[_0x86f6('0x17')]);this['queue']=_0x34b27b[_0x86f6('0x8')];this[_0x86f6('0x1a')]=_0x86f6('0x1b');this[_0x86f6('0x1c')]=_0xad315f['cause-txt'];this['callback']=_0x34b27b[_0x86f6('0x1d')];this[_0x86f6('0x1e')]=_0x34b27b[_0x86f6('0x1e')];this['callbackat']=_0x34b27b[_0x86f6('0x1f')];this[_0x86f6('0x20')]=_0x34b27b[_0x86f6('0x20')];this[_0x86f6('0x21')]=_0x34b27b[_0x86f6('0x21')];this[_0x86f6('0x22')]=_0x34b27b[_0x86f6('0x22')];this['UserId']=_0x34b27b['UserId'];this[_0x86f6('0x23')]=_0x34b27b[_0x86f6('0x23')];this[_0x86f6('0x24')]=_0x34b27b[_0x86f6('0x24')];}module[_0x86f6('0x25')]=Hangup;
\ No newline at end of file
+var _0xb580=['recallme','ContactId','ListId','UserId','VoiceQueueId','exports','util','lodash','moment','milliseconds','seconds','state','scheduledat','type','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countagentrejectretry','countabandonedretry','countmachineretry','uniqueid','name','calleridnum','number','starttime','responsetime','endtime','YYYY-MM-DD\x20HH:mm:ss','ringtime','talktime','queue','IVR','cause-txt','callback','callbackuniqueid','callbackat'];(function(_0x33443b,_0x3ffdf6){var _0x228f8b=function(_0x176b71){while(--_0x176b71){_0x33443b['push'](_0x33443b['shift']());}};_0x228f8b(++_0x3ffdf6);}(_0xb580,0x1e6));var _0x0b58=function(_0x4df188,_0x355add){_0x4df188=_0x4df188-0x0;var _0xbbdc5=_0xb580[_0x4df188];return _0xbbdc5;};'use strict';var util=require(_0x0b58('0x0'));var _=require(_0x0b58('0x1'));var moment=require(_0x0b58('0x2'));function getSeconds(_0x578198,_0x59a188){var _0x180a50=moment(_0x578198)[_0x0b58('0x3')](0x0);var _0x1b8083=moment(_0x59a188)['milliseconds'](0x0);return _0x180a50['diff'](_0x1b8083,_0x0b58('0x4'));}function Hangup(_0x3bc151,_0x593d15){this[_0x0b58('0x5')]=0x4;this['statedesc']='Answer';this['scheduledat']=_0x3bc151[_0x0b58('0x6')];this[_0x0b58('0x7')]=_0x3bc151[_0x0b58('0x7')];this['campaigntype']=_0x3bc151[_0x0b58('0x7')]===_0x0b58('0x8')?'queue':_0x3bc151[_0x0b58('0x7')];this['countbusyretry']=_0x3bc151[_0x0b58('0x9')];this[_0x0b58('0xa')]=_0x3bc151[_0x0b58('0xa')];this[_0x0b58('0xb')]=_0x3bc151[_0x0b58('0xb')];this[_0x0b58('0xc')]=_0x3bc151[_0x0b58('0x9')]+_0x3bc151[_0x0b58('0xa')]+_0x3bc151['countnoanswerretry']+_0x3bc151[_0x0b58('0xd')]+_0x3bc151[_0x0b58('0xe')]+_0x3bc151['countabandonedretry']+_0x3bc151['countmachineretry']+_0x3bc151[_0x0b58('0xf')];this['countnosuchnumberretry']=_0x3bc151[_0x0b58('0xd')];this[_0x0b58('0xe')]=_0x3bc151[_0x0b58('0xe')];this[_0x0b58('0x10')]=_0x3bc151['countabandonedretry'];this['countmachineretry']=_0x3bc151[_0x0b58('0x11')];this[_0x0b58('0xf')]=_0x3bc151[_0x0b58('0xf')];this[_0x0b58('0x12')]=_0x593d15[_0x0b58('0x12')];this['calleridname']=_0x3bc151[_0x0b58('0x13')];this[_0x0b58('0x14')]=_0x3bc151[_0x0b58('0x15')];this['starttime']=_0x3bc151[_0x0b58('0x16')];this[_0x0b58('0x17')]=_0x3bc151['responsetime'];this[_0x0b58('0x18')]=moment()['format'](_0x0b58('0x19'));this[_0x0b58('0x1a')]=getSeconds(_0x3bc151[_0x0b58('0x17')],_0x3bc151[_0x0b58('0x16')]);this['holdtime']=0x0;this[_0x0b58('0x1b')]=getSeconds(this[_0x0b58('0x18')],_0x3bc151['responsetime']);this[_0x0b58('0x1c')]=_0x3bc151[_0x0b58('0x1c')];this['membername']=_0x0b58('0x1d');this['reason']=_0x593d15[_0x0b58('0x1e')];this[_0x0b58('0x1f')]=_0x3bc151[_0x0b58('0x1f')];this[_0x0b58('0x20')]=_0x3bc151[_0x0b58('0x20')];this[_0x0b58('0x21')]=_0x3bc151[_0x0b58('0x21')];this[_0x0b58('0x22')]=_0x3bc151[_0x0b58('0x22')];this[_0x0b58('0x23')]=_0x3bc151[_0x0b58('0x23')];this[_0x0b58('0x24')]=_0x3bc151[_0x0b58('0x24')];this[_0x0b58('0x25')]=_0x3bc151[_0x0b58('0x25')];this['VoiceQueueId']=_0x3bc151[_0x0b58('0x26')];this['CampaignId']=_0x3bc151['CampaignId'];}module[_0x0b58('0x27')]=Hangup;
\ No newline at end of file
index 0eca6a7..6653dc2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc774=['CampaignId','originatecalleridnum','originatecalleridname','exports','util','moment','milliseconds','diff','uniqueid','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countmachineretry','countagentrejectretry','countnosuchnumberretry','countdropretry','countabandonedretry','calleridname','calleridnum','number','starttime','responsetime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId'];(function(_0x456a84,_0x46bc0b){var _0x1117d6=function(_0x20f9d1){while(--_0x20f9d1){_0x456a84['push'](_0x456a84['shift']());}};_0x1117d6(++_0x46bc0b);}(_0xc774,0x180));var _0x4c77=function(_0x27b09c,_0x587b4a){_0x27b09c=_0x27b09c-0x0;var _0x2173a1=_0xc774[_0x27b09c];return _0x2173a1;};'use strict';var util=require(_0x4c77('0x0'));var _=require('lodash');var moment=require(_0x4c77('0x1'));function getSeconds(_0xe60e61,_0x1d4984){var _0x5a56a4=moment(_0xe60e61)[_0x4c77('0x2')](0x0);var _0x2089bb=moment(_0x1d4984)[_0x4c77('0x2')](0x0);return _0x5a56a4[_0x4c77('0x3')](_0x2089bb,'seconds');}function History(_0x587c32){this['uniqueid']=_0x587c32[_0x4c77('0x4')];this[_0x4c77('0x5')]=_0x587c32[_0x4c77('0x5')]||undefined;this[_0x4c77('0x6')]=_0x587c32['type'];this['campaigntype']=_0x587c32[_0x4c77('0x6')]===_0x4c77('0x7')?_0x4c77('0x8'):_0x587c32[_0x4c77('0x6')];this[_0x4c77('0x9')]=_0x587c32[_0x4c77('0x9')];this[_0x4c77('0xa')]=_0x587c32[_0x4c77('0xa')];this['countnoanswerretry']=_0x587c32[_0x4c77('0xb')];this[_0x4c77('0xc')]=_0x587c32[_0x4c77('0x9')]+_0x587c32[_0x4c77('0xa')]+_0x587c32[_0x4c77('0xb')]+_0x587c32['countnosuchnumberretry']+_0x587c32['countdropretry']+_0x587c32['countabandonedretry']+_0x587c32[_0x4c77('0xd')]+_0x587c32[_0x4c77('0xe')];this[_0x4c77('0xf')]=_0x587c32['countnosuchnumberretry'];this[_0x4c77('0x10')]=_0x587c32[_0x4c77('0x10')];this[_0x4c77('0x11')]=_0x587c32[_0x4c77('0x11')];this['countmachineretry']=_0x587c32['countmachineretry'];this[_0x4c77('0xe')]=_0x587c32[_0x4c77('0xe')];this['queue']=_0x587c32['queue'];this[_0x4c77('0x12')]=_0x587c32['name'];this[_0x4c77('0x13')]=_0x587c32[_0x4c77('0x14')];this[_0x4c77('0x15')]=_0x587c32['starttime'];this['responsetime']=_0x587c32['responsetime'];this['endtime']=_0x587c32[_0x4c77('0x16')];this[_0x4c77('0x17')]=getSeconds(_0x587c32['responsetime'],_0x587c32[_0x4c77('0x15')]);this[_0x4c77('0x18')]=0x0;this[_0x4c77('0x19')]=0x0;this[_0x4c77('0x1a')]=_0x587c32[_0x4c77('0x1a')];this[_0x4c77('0x1b')]=_0x587c32['callbackuniqueid'];this['callbackat']=_0x587c32[_0x4c77('0x1c')];this['recallme']=_0x587c32[_0x4c77('0x1d')];this[_0x4c77('0x1e')]=_0x587c32[_0x4c77('0x1e')];this[_0x4c77('0x1f')]=_0x587c32['ListId'];this[_0x4c77('0x20')]=_0x587c32[_0x4c77('0x20')];this[_0x4c77('0x21')]=_0x587c32[_0x4c77('0x21')];this['CampaignId']=_0x587c32[_0x4c77('0x22')];this['originatecalleridnum']=_0x587c32[_0x4c77('0x23')]||'';this[_0x4c77('0x24')]=_0x587c32['originatecalleridname']||'';}module[_0x4c77('0x25')]=History;
\ No newline at end of file
+var _0x8be7=['campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','name','calleridnum','number','starttime','responsetime','endtime','ringtime','talktime','callback','callbackat','recallme','ListId','UserId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','diff','seconds','uniqueid','scheduledat','type'];(function(_0x58a7c4,_0x164298){var _0x3906fa=function(_0x1741ec){while(--_0x1741ec){_0x58a7c4['push'](_0x58a7c4['shift']());}};_0x3906fa(++_0x164298);}(_0x8be7,0x82));var _0x78be=function(_0x87867b,_0x2cc4fb){_0x87867b=_0x87867b-0x0;var _0xc95e2e=_0x8be7[_0x87867b];return _0xc95e2e;};'use strict';var util=require(_0x78be('0x0'));var _=require('lodash');var moment=require('moment');function getSeconds(_0x933a28,_0x188461){var _0x32d1e1=moment(_0x933a28)['milliseconds'](0x0);var _0x1c4bde=moment(_0x188461)['milliseconds'](0x0);return _0x32d1e1[_0x78be('0x1')](_0x1c4bde,_0x78be('0x2'));}function History(_0x5c0862){this[_0x78be('0x3')]=_0x5c0862[_0x78be('0x3')];this['scheduledat']=_0x5c0862[_0x78be('0x4')]||undefined;this[_0x78be('0x5')]=_0x5c0862['type'];this[_0x78be('0x6')]=_0x5c0862[_0x78be('0x5')]==='outbound'?_0x78be('0x7'):_0x5c0862[_0x78be('0x5')];this['countbusyretry']=_0x5c0862[_0x78be('0x8')];this[_0x78be('0x9')]=_0x5c0862['countcongestionretry'];this[_0x78be('0xa')]=_0x5c0862['countnoanswerretry'];this['countglobal']=_0x5c0862['countbusyretry']+_0x5c0862[_0x78be('0x9')]+_0x5c0862[_0x78be('0xa')]+_0x5c0862[_0x78be('0xb')]+_0x5c0862[_0x78be('0xc')]+_0x5c0862[_0x78be('0xd')]+_0x5c0862[_0x78be('0xe')]+_0x5c0862[_0x78be('0xf')];this[_0x78be('0xb')]=_0x5c0862[_0x78be('0xb')];this['countdropretry']=_0x5c0862[_0x78be('0xc')];this[_0x78be('0xd')]=_0x5c0862[_0x78be('0xd')];this[_0x78be('0xe')]=_0x5c0862[_0x78be('0xe')];this[_0x78be('0xf')]=_0x5c0862['countagentrejectretry'];this[_0x78be('0x7')]=_0x5c0862[_0x78be('0x7')];this[_0x78be('0x10')]=_0x5c0862[_0x78be('0x11')];this[_0x78be('0x12')]=_0x5c0862[_0x78be('0x13')];this[_0x78be('0x14')]=_0x5c0862[_0x78be('0x14')];this[_0x78be('0x15')]=_0x5c0862['responsetime'];this[_0x78be('0x16')]=_0x5c0862[_0x78be('0x15')];this[_0x78be('0x17')]=getSeconds(_0x5c0862[_0x78be('0x15')],_0x5c0862[_0x78be('0x14')]);this['holdtime']=0x0;this[_0x78be('0x18')]=0x0;this[_0x78be('0x19')]=_0x5c0862[_0x78be('0x19')];this['callbackuniqueid']=_0x5c0862['callbackuniqueid'];this[_0x78be('0x1a')]=_0x5c0862[_0x78be('0x1a')];this['recallme']=_0x5c0862[_0x78be('0x1b')];this['ContactId']=_0x5c0862['ContactId'];this[_0x78be('0x1c')]=_0x5c0862[_0x78be('0x1c')];this[_0x78be('0x1d')]=_0x5c0862[_0x78be('0x1d')];this['VoiceQueueId']=_0x5c0862['VoiceQueueId'];this[_0x78be('0x1e')]=_0x5c0862[_0x78be('0x1e')];this['originatecalleridnum']=_0x5c0862[_0x78be('0x1f')]||'';this['originatecalleridname']=_0x5c0862[_0x78be('0x20')]||'';}module[_0x78be('0x21')]=History;
\ No newline at end of file
index 494b12c..df4fe14 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd6d2=['all','some','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','checkDialMethod','progressive','handlePower','power','Queue','method\x20not\x20recognized','checkPreviewRecallReminder','handlePreviewRecallNotifications','Agent','user:%s','user:dialPreviewRecallReminder','launchHandleIvr','handleIvr','dialMethod','dialGlobalInterval','dialTimezone','[syncQueueSummary]','dialPreviewRecallmeReminder','checkIsTrunkReachable','pow','random','match','object','originate','voiceQueue\x20is\x20undefine','phone','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','ACTIVE','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','Contact','tags','createdAt','updatedAt','XMD-','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','SIP/%s/%s%s','substring','dialCutDigit','trim','[originateError]:\x20%s','[originate][error]','Error','originate\x20action\x20Error','getQueue','response','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','dialNoAnswerMaxRetry','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialAbandonedMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','reason','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','NoAnswer','custom:agentnoanswer','noanswer','dialNoAnswerRetryFrequency','reason\x203\x20ringing\x20no\x20answer','Busy','custom:agentbusy','reason\x205\x20busy','Congestion','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','reason\x2011\x20abandoned','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','floor','predictiveIntervalHitRate','[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','started\x20in\x20predictive\x20at','averageHandleTime','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','busyFactor','[getDataPredictive]','check\x20failure','getDataPredictiveOld','outboundQueuePauses','abandonmentRate','[CatchErlangB]','one\x20call\x20every:','[handlePredictive]','UserId','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','actionOriginate','dialRecallMeTimeout','voicePause','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','[Originate][HistoryRecallClose]','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','limitCalls','dialOrderByScheduledAt','[getContactCampaign2][Empty]','RUNNING','emptyContact','Contact.phone','checkContactBlack','loggerHandler','dialLimitQueue','not_inuse','[actionOriginate]\x20','[getContactDialer2]','tryOriginatePredictive','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','p\x20=\x20','interval\x20=\x20','Amax\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','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','Umin\x20=\x20','exports','util','lodash','uuid','moment','ioredis','../../../config/environment/','../../../config/logger','dialer','booked','predictive','predictiveCalls','syncQueueSummary','../ami','redis','defaults','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperFinal','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/setting','./action','./history','./agentComplete','./queueCallerAbandon','./hangup','env','127.0.0.1','rrmemory','enqueue','tail','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','actions','contactsId','uniqueId','optionPredictive','startPredictive','startProgressive','queueBooked','queueBookedRR','agentconnect','queuecallerabandon','syncOriginateResponse','bind','agentcomplete','syncAgentComplete','hangup','syncHangup','newexten','syncNewExten','varset','queuemember','syncQueueMember','syncQueueStatusComplete','loopCampaigns','then','previewRecallmeReminderInterval','message','AGENTS_NOT_LOGGED','name','\x20AGENTS\x20NOT\x20LOGGED','\x20NOT\x20Active','Interval','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Intervals','[ifTime][Action]','stringify','milliseconds','diff','seconds','emit','type','outbound','strategy','answered','available','loggedIn','pTalking','sumDuration','sumHoldTime','talking','total','abandoned','waiting','loggedInDb','dialActive','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','Trunk','active','callerid','md5','format','voice:queue:%s','ivr','campaign:ivr:%s','campaign:save','isEmpty','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','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','---------------------------','isUndefined','predictiveIntervalAvgTalktime','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','merge','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','inspect','length','undefined','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','NOT_ACTIVE','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','IS_DISACTIVED','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','statedesc','prototype','loopClearZombieChannels','clearZombieChannels','[actions]','status','channel','No\x20such\x20channel','queue','[Dialer][checkChannel]','updateOriginated','[Dialer][checkChannel][ivr]','countReScheduled','resolve','catch','[countReScheduled]\x20','checkIsBlackList','[checkIsBlackList]\x20','verifyAdditionalPhones','swapAdditionalPhones','[swapAdditionalPhone]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','avgHandleTime','rescheduleContact','unlockContact','[unlockContact]\x20','getContactDialer','temp','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','createHistory','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','pick','ContactId','ListId','VoiceQueueId','CampaignId','isSuccess','isTrunkReachable','reachable','unmonitored','saveInDb','syncVarSet','uniqueid','isNil','amdstatus','exten','xcally-motion-dialer','dialAMDActive','HANGUP','outboundAnswerCallsDay','state','HangupInAMD','membername','AMD','custom:amd','buildObj','amd','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','value','MACHINE','Machine','countmachineretry','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','reason\x2019\x20machine....','minutes','YYYY-MM-DD\x20HH:mm:ss','[rescheduleContact][Machine]','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','countglobal','dialMachineMaxRetry','createStateFinal','add','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AnswerAGI','outboundUnknownCallsDay','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','[syncAgentComplete]','syncAgentConnect','answertime','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','syncQueueCallerAbandon','droptime','responsetime','dialQueueTimeout','dropreason','TIMEOUT','dialDropRetryFrequency','callAdditionalPhoneAfterMin','additional','dialDropMaxRetry','[rescheduleContact][Drop]','Drop','starttime','endtime','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','Abandoned','dialAbandonedRetryFrequency','voiceQueue','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','actionid','paused','stateinterface','locked','push','idHopper','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','roundrobin','run','finally','_rr','unlockRR','[booked][RR]','contactAgent-idHopper:\x20','[booked][RR][finaly]','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','resetActiveCalls','syncCampaigns','TrunkBackup','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','checkIfTimeIntervals','Failure','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\x20','timezones','\x20Timezone\x20unknow\x20','isArray','Action','command','iftime\x20%s,%s','interval','content','indexOf','true'];(function(_0x360d3e,_0x2a6e0d){var _0x4cc33c=function(_0x21f13a){while(--_0x21f13a){_0x360d3e['push'](_0x360d3e['shift']());}};_0x4cc33c(++_0x2a6e0d);}(_0xd6d2,0xcb));var _0x2d6d=function(_0x1934a7,_0x333e54){_0x1934a7=_0x1934a7-0x0;var _0x1f403f=_0xd6d2[_0x1934a7];return _0x1f403f;};'use strict';var util=require(_0x2d6d('0x0'));var _=require(_0x2d6d('0x1'));var BPromise=require('bluebird');var uuid=require(_0x2d6d('0x2'));var moment=require(_0x2d6d('0x3'));var rr=require('rr');var md5=require('md5');var Redis=require(_0x2d6d('0x4'));var ut=require('../preview/util/util');var config=require(_0x2d6d('0x5'));var logger=require(_0x2d6d('0x6'))(_0x2d6d('0x7'));var loggerBooked=require('../../../config/logger')(_0x2d6d('0x8'));var loggerPredictive=require(_0x2d6d('0x6'))(_0x2d6d('0x9'));var loggerPredictiveCalls=require(_0x2d6d('0x6'))(_0x2d6d('0xa'));var loggerSyncQueueSummary=require(_0x2d6d('0x6'))(_0x2d6d('0xb'));var ami=require(_0x2d6d('0xc'));config[_0x2d6d('0xd')]=_[_0x2d6d('0xe')](config[_0x2d6d('0xd')],{'host':'localhost','port':0x18eb});var io=require(_0x2d6d('0xf'))(new Redis(config[_0x2d6d('0xd')]));var cmHopper=require(_0x2d6d('0x10'));var cmHopperHistory=require(_0x2d6d('0x11'));var cmHopperFinal=require(_0x2d6d('0x12'));var cmHopperAdditionalPhone=require('../rpc/cmHopperAdditionalPhone');var cmHopperBlack=require(_0x2d6d('0x13'));var voiceQueueRt=require(_0x2d6d('0x14'));var RpcSetting=require(_0x2d6d('0x15'));var Action=require(_0x2d6d('0x16'));var History=require(_0x2d6d('0x17'));var Final=require('./final');var AgentComplete=require(_0x2d6d('0x18'));var QueueCallerAbandon=require(_0x2d6d('0x19'));var Hangup=require(_0x2d6d('0x1a'));var ipAgi=process[_0x2d6d('0x1b')]['XCALLY_IP_AGI']||_0x2d6d('0x1c');var strategy={'rrmemory':_0x2d6d('0x1d'),'roundrobin':'roundrobin'};var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence['prototype'][_0x2d6d('0x1e')]=function(_0x17340f){this[_0x2d6d('0x1f')]=this['tail']?this[_0x2d6d('0x1f')]['finally'](_0x17340f):_0x17340f();};function Dialer(_0x55c1fc,_0x4c3092){this[_0x2d6d('0x20')]=new Sequence();this[_0x2d6d('0x21')]=_0x4c3092;this[_0x2d6d('0x22')]=_0x55c1fc[_0x2d6d('0x22')];this[_0x2d6d('0x23')]=_0x55c1fc[_0x2d6d('0x23')];this[_0x2d6d('0x24')]=_0x55c1fc[_0x2d6d('0x24')];this[_0x2d6d('0x25')]=_0x55c1fc['trunks'];this[_0x2d6d('0x26')]=config[_0x2d6d('0x26')]||0x2;this['channels']={};this[_0x2d6d('0x27')]={};this[_0x2d6d('0x28')]={};this[_0x2d6d('0x29')]={};this[_0x2d6d('0x2a')]={};this[_0x2d6d('0x2b')]={};this[_0x2d6d('0x2c')]={};this['ivrOriginated']={};this[_0x2d6d('0x2d')]={};this[_0x2d6d('0x2e')]={};ami['on'](_0x2d6d('0x2f'),this['syncAgentConnect']['bind'](this));ami['on'](_0x2d6d('0x30'),this['syncQueueCallerAbandon']['bind'](this));ami['on']('originateresponse',this[_0x2d6d('0x31')][_0x2d6d('0x32')](this));ami['on'](_0x2d6d('0x33'),this[_0x2d6d('0x34')][_0x2d6d('0x32')](this));ami['on']('custom:queuesummary',this[_0x2d6d('0xb')][_0x2d6d('0x32')](this));ami['on'](_0x2d6d('0x35'),this[_0x2d6d('0x36')][_0x2d6d('0x32')](this));ami['on'](_0x2d6d('0x37'),this[_0x2d6d('0x38')][_0x2d6d('0x32')](this));ami['on'](_0x2d6d('0x39'),this['syncVarSet'][_0x2d6d('0x32')](this));ami['on'](_0x2d6d('0x3a'),this[_0x2d6d('0x3b')][_0x2d6d('0x32')](this));ami['on']('queuestatuscomplete',this[_0x2d6d('0x3c')]['bind'](this));this[_0x2d6d('0x3d')]();this['loopClearZombieChannels']();RpcSetting['getSettings']()[_0x2d6d('0x3e')](function(_0x557ad8){previewRecallmeReminderInterval=_0x557ad8[_0x2d6d('0x3f')];});}function isNotNull(_0x138435){return _0x138435!==null&&!_['isUndefined'](_0x138435);}function checkIsLoggedIn(_0x3df236,_0x4864a6){return function(){if(_0x4864a6<=0x0){_0x3df236[_0x2d6d('0x40')]=_0x2d6d('0x41');throw _0x3df236[_0x2d6d('0x42')]+_0x2d6d('0x43');}};}function isActive(_0x21aed9){return _0x21aed9;}function checkIsActive(_0x29394e,_0x27ac32){return function(){if(!isActive(_0x27ac32)){_0x29394e[_0x2d6d('0x40')]='NOT_ACTIVE';throw _0x29394e[_0x2d6d('0x42')]+_0x2d6d('0x44');}};}function checkInterval(_0x489f47){return function(){if(!isNotNull(_0x489f47[_0x2d6d('0x45')])){_0x489f47[_0x2d6d('0x40')]=_0x2d6d('0x46');throw _0x489f47[_0x2d6d('0x42')]+_0x2d6d('0x47');}if(!isNotNull(_0x489f47['Interval']['Intervals'])){_0x489f47['message']=_0x2d6d('0x46');throw _0x489f47[_0x2d6d('0x42')]+_0x2d6d('0x47');}if(!isNotNull(_['isEmpty'](_0x489f47[_0x2d6d('0x45')][_0x2d6d('0x48')]))){_0x489f47[_0x2d6d('0x40')]=_0x2d6d('0x46');throw _0x489f47['name']+_0x2d6d('0x47');}};}function msgResponse(_0x2bdc1b,_0x23cc39,_0x15f9af){return{'action':_0x2bdc1b,'response':_0x23cc39,'message':_0x15f9af,'stack':_0x15f9af};}function myreject(_0x535046){return function(_0x3be16a){return _0x535046(msgResponse(_0x2d6d('0x49'),'Error',JSON[_0x2d6d('0x4a')](_0x3be16a)));};}function getSeconds(_0x9b47f8,_0x134388){var _0x3d4723=moment(_0x9b47f8)[_0x2d6d('0x4b')](0x0);var _0x5e5446=moment(_0x134388)[_0x2d6d('0x4b')](0x0);return _0x3d4723[_0x2d6d('0x4c')](_0x5e5446,_0x2d6d('0x4d'));}function emit(_0x4616df,_0x65d69c,_0x108f7c){io['to'](_0x4616df)[_0x2d6d('0x4e')](_0x65d69c,_0x108f7c);}function emitVoiceQueueSummary(_0x124fc2){if(_0x124fc2[_0x2d6d('0x4f')]===_0x2d6d('0x50')){var _0x3d2fea={'id':_0x124fc2['id'],'name':_0x124fc2[_0x2d6d('0x42')],'strategy':_0x124fc2[_0x2d6d('0x51')],'answered':_0x124fc2[_0x2d6d('0x52')],'available':_0x124fc2[_0x2d6d('0x53')],'loggedIn':_0x124fc2[_0x2d6d('0x54')],'pTalking':_0x124fc2[_0x2d6d('0x55')],'sumBillable':_0x124fc2['sumBillable'],'sumDuration':_0x124fc2[_0x2d6d('0x56')],'sumHoldTime':_0x124fc2[_0x2d6d('0x57')]||0x0,'talking':_0x124fc2[_0x2d6d('0x58')],'total':_0x124fc2[_0x2d6d('0x59')],'type':_0x124fc2[_0x2d6d('0x4f')],'unmanaged':_0x124fc2['unmanaged'],'abandoned':_0x124fc2[_0x2d6d('0x5a')],'waiting':_0x124fc2[_0x2d6d('0x5b')],'loggedInDb':_0x124fc2[_0x2d6d('0x5c')],'dialActive':_0x124fc2[_0x2d6d('0x5d')],'dialMethod':_0x124fc2['dialMethod'],'dialOriginateCallerIdName':_0x124fc2[_0x2d6d('0x5e')],'dialOriginateCallerIdNumber':_0x124fc2[_0x2d6d('0x5f')],'dialOriginateTimeout':_0x124fc2[_0x2d6d('0x60')],'dialPrefix':_0x124fc2[_0x2d6d('0x61')],'outboundAnswerAgiCallsDay':_0x124fc2[_0x2d6d('0x62')],'outboundAnswerCallsDay':_0x124fc2['outboundAnswerCallsDay'],'outboundBlacklistCallsDay':_0x124fc2[_0x2d6d('0x63')],'outboundBusyCallsDay':_0x124fc2[_0x2d6d('0x64')],'outboundCongestionCallsDay':_0x124fc2['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x124fc2[_0x2d6d('0x65')],'outboundDropCallsDayCallersExit':_0x124fc2[_0x2d6d('0x66')],'outboundDropCallsDayTimeout':_0x124fc2[_0x2d6d('0x67')],'outboundNoAnswerCallsDay':_0x124fc2['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x124fc2[_0x2d6d('0x68')],'outboundOriginateFailureCallsDay':_0x124fc2[_0x2d6d('0x69')],'outboundReCallsDay':_0x124fc2['outboundReCallsDay'],'outboundRejectCallsDay':_0x124fc2['outboundRejectCallsDay'],'outboundUnknownCallsDay':_0x124fc2['outboundUnknownCallsDay'],'predictiveIntervalAnsweredCalls':_0x124fc2[_0x2d6d('0x6a')],'predictiveIntervalAvgHoldtime':_0x124fc2[_0x2d6d('0x6b')],'predictiveIntervalAvgTalktime':_0x124fc2['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x124fc2[_0x2d6d('0x6c')],'predictiveIntervalDroppedCallsTimeout':_0x124fc2[_0x2d6d('0x6d')],'predictiveIntervalErlangCalls':_0x124fc2[_0x2d6d('0x6e')],'predictiveIntervalErlangCallsDroppedCalls':_0x124fc2[_0x2d6d('0x6f')],'predictiveIntervalHitRate':_0x124fc2['predictiveIntervalHitRate'],'predictiveIntervalMultiplicativeFactor':_0x124fc2[_0x2d6d('0x70')],'predictiveIntervalPauses':_0x124fc2[_0x2d6d('0x71')],'predictiveIntervalAvailable':_0x124fc2['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x124fc2[_0x2d6d('0x72')],'message':_0x124fc2[_0x2d6d('0x40')],'originated':_0x124fc2[_0x2d6d('0x73')],'erlangCalls':_0x124fc2[_0x2d6d('0x74')],'erlangCallToSecond':_0x124fc2[_0x2d6d('0x75')],'erlangAbandonmentRate':_0x124fc2[_0x2d6d('0x76')],'erlangBusyFactor':_0x124fc2[_0x2d6d('0x77')],'startPredictive':_0x124fc2['startPredictive'],'startProgressive':_0x124fc2[_0x2d6d('0x2c')]};if(_0x124fc2[_0x2d6d('0x78')]){_0x3d2fea[_0x2d6d('0x78')]={'id':_0x124fc2['Trunk']['id'],'name':_0x124fc2['Trunk'][_0x2d6d('0x42')],'active':_0x124fc2[_0x2d6d('0x78')][_0x2d6d('0x79')],'callerid':_0x124fc2['Trunk'][_0x2d6d('0x7a')]};}if(_0x124fc2[_0x2d6d('0x45')]){_0x3d2fea['Interval']={'id':_0x124fc2[_0x2d6d('0x45')]['id'],'name':_0x124fc2[_0x2d6d('0x45')][_0x2d6d('0x42')]};}var _0x1ec507=md5(JSON[_0x2d6d('0x4a')](_0x3d2fea));if(_0x124fc2[_0x2d6d('0x7b')]!==_0x1ec507){_0x124fc2[_0x2d6d('0x7b')]=_0x1ec507;emit(util[_0x2d6d('0x7c')](_0x2d6d('0x7d'),_0x3d2fea[_0x2d6d('0x42')]),'voice_queue:save',_0x3d2fea);}}}function emitCampaignSummary(_0xd89457){if(_0xd89457[_0x2d6d('0x4f')]===_0x2d6d('0x7e')){emit(util['format'](_0x2d6d('0x7f'),_0xd89457[_0x2d6d('0x42')]),_0x2d6d('0x80'),_0xd89457);}}function checkGetDataPredictive(_0x2dbcdc){if(isNotNull(_0x2dbcdc)&&!_[_0x2d6d('0x81')](_0x2dbcdc)){loggerPredictive[_0x2d6d('0x82')](_0x2d6d('0x83'));loggerPredictive['info'](_0x2d6d('0x84'),_0x2dbcdc[_0x2d6d('0x72')]);loggerPredictive['info'](_0x2d6d('0x85'),_0x2dbcdc[_0x2d6d('0x6a')]);loggerPredictive['info'](_0x2d6d('0x86'),_0x2dbcdc[_0x2d6d('0x6d')]);loggerPredictive['info'](_0x2d6d('0x87'),_0x2dbcdc[_0x2d6d('0x6c')]);loggerPredictive[_0x2d6d('0x82')](_0x2d6d('0x88'),_0x2dbcdc[_0x2d6d('0x6b')]);loggerPredictive[_0x2d6d('0x82')](_0x2d6d('0x89'),_0x2dbcdc['predictiveIntervalAvgTalktime']);loggerPredictive['info'](_0x2d6d('0x8a'));if(_0x2dbcdc['predictiveIntervalTotalCalls']>0x0){if(!_[_0x2d6d('0x8b')](_0x2dbcdc[_0x2d6d('0x8c')])&&_0x2dbcdc[_0x2d6d('0x8c')]>0x0){return!![];}loggerPredictive['info'](_0x2d6d('0x8d'));if(!_['isUndefined'](_0x2dbcdc[_0x2d6d('0x6b')])&&_0x2dbcdc[_0x2d6d('0x6b')]>0x0){return!![];}loggerPredictive[_0x2d6d('0x82')](_0x2d6d('0x8e'));}else{loggerPredictive[_0x2d6d('0x82')](_0x2d6d('0x8f'));}}else{loggerPredictive[_0x2d6d('0x82')](_0x2d6d('0x90'));}return![];}function mergeDataErlangB(_0x4bf94c){return function(_0x33d375){loggerPredictive[_0x2d6d('0x82')](_0x2d6d('0x91'));loggerPredictive['info']('Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x33d375['erlangCalls']);loggerPredictive[_0x2d6d('0x82')]('One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x33d375[_0x2d6d('0x75')]);loggerPredictive[_0x2d6d('0x82')](_0x2d6d('0x92'),_0x33d375[_0x2d6d('0x76')]);loggerPredictive[_0x2d6d('0x82')](_0x2d6d('0x93'),_0x33d375['erlangBusyFactor']);loggerPredictive[_0x2d6d('0x82')](_0x2d6d('0x92'),_0x33d375[_0x2d6d('0x76')]);loggerPredictive[_0x2d6d('0x82')](_0x2d6d('0x8a'));_[_0x2d6d('0x94')](_0x4bf94c,_0x33d375);};}function getDiff(_0x4bbbeb){var _0x1c6b87=moment()[_0x2d6d('0x4b')](0x0);var _0x15e812=moment(_0x4bbbeb)[_0x2d6d('0x4b')](0x0);return _0x1c6b87['diff'](_0x15e812,_0x2d6d('0x4d'));}function ifInterval(_0x3a07cf,_0xb7ae2b){if(_['isUndefined'](_0xb7ae2b)){return![];}return getDiff(_0xb7ae2b)<_0x3a07cf*0x3c;}function freeVariablesPredictive(_0x195165){if(isNotNull(_0x195165)){if(!_[_0x2d6d('0x8b')](_0x195165[_0x2d6d('0x2c')])){_0x195165['startProgressive']=undefined;loggerPredictive[_0x2d6d('0x82')](_0x195165['name'],_0x2d6d('0x95'));}if(!_[_0x2d6d('0x8b')](_0x195165[_0x2d6d('0x2b')])){_0x195165[_0x2d6d('0x2b')]=undefined;loggerPredictive[_0x2d6d('0x82')](_0x195165[_0x2d6d('0x42')],_0x2d6d('0x96'));}if(!_[_0x2d6d('0x8b')](_0x195165['handlePredictive'])){clearInterval(_0x195165[_0x2d6d('0x97')]);_0x195165[_0x2d6d('0x97')]=undefined;loggerPredictive[_0x2d6d('0x82')](_0x195165[_0x2d6d('0x42')],_0x2d6d('0x98'));}}}function erlangb(_0x584682,_0x187499){if(_0x187499===0x0){return 0x0;}var _0x483fda=0x1;for(var _0x2ab4f2=0x1;_0x2ab4f2<=_0x187499;_0x2ab4f2+=0x1){_0x483fda=0x1+_0x483fda*_0x2ab4f2/_0x584682;}return 0x1/_0x483fda;}function isVoiceQueueOutbound(_0xe3855e){return _0xe3855e===_0x2d6d('0x50');}function isNotPreview(_0x41b44b){return _0x41b44b!==_0x2d6d('0x21');}function isCampaignIvr(_0x405f27){return _0x405f27===_0x2d6d('0x7e');}function getCallerId(_0x27506e,_0x4bd9d4,_0x2a4f38){if(!_[_0x2d6d('0x8b')](_0x2a4f38)&&typeof _0x2a4f38===_0x2d6d('0x99')&&!_[_0x2d6d('0x81')](_0x2a4f38)){if(!_[_0x2d6d('0x8b')](_0x4bd9d4)&&typeof _0x4bd9d4==='string'&&!_['isEmpty'](_0x4bd9d4)){return util['format'](_0x2d6d('0x9a'),_0x4bd9d4,_0x2a4f38);}return util[_0x2d6d('0x7c')](_0x2d6d('0x9a'),_0x2a4f38,_0x2a4f38);}if(!_[_0x2d6d('0x8b')](_0x27506e)&&typeof _0x27506e===_0x2d6d('0x99')&&!_[_0x2d6d('0x81')](_0x27506e)){return _0x27506e;}return _0x2d6d('0x9b');}function loggerCatchQueueSummary(_0x471a4b,_0x30927f){return function(_0x572d55){freeVariablesPredictive(_0x30927f);emitVoiceQueueSummary(_0x30927f);emitCampaignSummary(_0x30927f);loggerSyncQueueSummary[_0x2d6d('0x9c')](_0x471a4b,util['inspect'](_0x572d55,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x5c071f,_0xa8dc2d){return function(_0x3ba0b7){loggerPredictive[_0x2d6d('0x9c')](_0xa8dc2d[_0x2d6d('0x42')],_0x5c071f);loggerPredictive[_0x2d6d('0x9c')](_0x3ba0b7['stack']);freeVariablesPredictive(_0xa8dc2d);};}function loggerCatch(_0x331ea6){return function(_0xa7e0b7){logger['error'](_0x331ea6,util[_0x2d6d('0x9d')](_0xa7e0b7,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x43566a){return _0x43566a&&!_[_0x2d6d('0x8b')](_0x43566a)&&_0x43566a[_0x2d6d('0x9e')]>0x0;}function decremetOriginate(_0x88feb0){if(!_['isUndefined'](_0x88feb0)&&_0x88feb0!==null){if(typeof _0x88feb0[_0x2d6d('0x73')]!==_0x2d6d('0x9f')){if(_0x88feb0[_0x2d6d('0x73')]>0x0){_0x88feb0[_0x2d6d('0x73')]-=0x1;}else{logger[_0x2d6d('0x9c')](_0x2d6d('0xa0'));}}}else{logger[_0x2d6d('0x9c')](_0x2d6d('0xa1'));}}function checkContactLowerLimitOriginate(_0x4c7fbd,_0x3a20c6,_0x3a6ccb){if(_0x3a20c6>_0x3a6ccb){for(var _0x406b43=0x0;_0x406b43<_0x3a20c6-_0x3a6ccb;_0x406b43+=0x1){decremetOriginate(_0x4c7fbd);}}}function loggerGetContactDialer(_0x1d1434,_0x5084e7,_0x455d3b){return function(_0x4cc4c2){checkContactLowerLimitOriginate(_0x5084e7,_0x455d3b,0x0);logger['error'](_0x1d1434,util['inspect'](_0x4cc4c2,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x5c3218){return function(_0x54b0e0){if(isNotNull(_0x54b0e0)&&isNotNull(_0x54b0e0[0x0])){if(_0x54b0e0[0x0][_0x2d6d('0xa2')]>0x0){_0x5c3218[_0x2d6d('0x40')]=_0x2d6d('0xa3');logger[_0x2d6d('0x82')](_0x2d6d('0xa4')+_0x5c3218[_0x2d6d('0x42')],_0x54b0e0[0x0][_0x2d6d('0xa2')],'contacts');}else{_0x5c3218[_0x2d6d('0x40')]=_0x2d6d('0xa5');logger['info'](_0x2d6d('0xa6')+_0x5c3218[_0x2d6d('0x42')]);}}};}function notSendMessagesQueue(_0x47dcbe){if(_0x47dcbe[_0x2d6d('0xa7')]){freeVariablesPredictive(_0x47dcbe);if(_0x47dcbe[_0x2d6d('0x73')]===0x0&&_0x47dcbe[_0x2d6d('0x58')]===0x0&&_0x47dcbe['waiting']===0x0&&(_0x47dcbe[_0x2d6d('0x55')]||0x0)===0x0){_0x47dcbe[_0x2d6d('0xa7')]=![];_0x47dcbe[_0x2d6d('0x53')]=0x0;_0x47dcbe[_0x2d6d('0x40')]=_0x2d6d('0xa8');loggerSyncQueueSummary['error'](_0x2d6d('0xa9'),_0x47dcbe['name'],_0x2d6d('0xaa'));}else{_0x47dcbe[_0x2d6d('0x40')]=_0x2d6d('0xab');loggerSyncQueueSummary['error']('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x47dcbe[_0x2d6d('0x42')],_0x2d6d('0xac'));}emitVoiceQueueSummary(_0x47dcbe);}}function notSendMessagesCampaign(_0x5ed368){if(_0x5ed368[_0x2d6d('0xa7')]){if(_0x5ed368[_0x2d6d('0x73')]===0x0){_0x5ed368['sendMessageOneNotActive']=![];_0x5ed368[_0x2d6d('0x40')]=_0x2d6d('0xa8');loggerSyncQueueSummary[_0x2d6d('0x9c')](_0x2d6d('0xad'),_0x5ed368[_0x2d6d('0x42')],_0x2d6d('0xaa'));}else{_0x5ed368['message']=_0x2d6d('0xab');loggerSyncQueueSummary[_0x2d6d('0x9c')](_0x2d6d('0xad'),_0x5ed368[_0x2d6d('0x42')],'is\x20disactive');}emitCampaignSummary(_0x5ed368);}}function createObjHistory(_0x53a670,_0x52c330,_0x32fd50,_0x578da6,_0x2b26fd){_0x53a670[_0x2d6d('0x40')]=_0x32fd50;var _0x58e1a0=new Action(_0x53a670,_0x52c330);var _0x20b2bd=new History(_0x58e1a0);_0x20b2bd['state']=_0x578da6;_0x20b2bd[_0x2d6d('0xae')]=_0x2b26fd;_0x20b2bd['endtime']=_0x58e1a0['starttime'];return _0x20b2bd;}Dialer[_0x2d6d('0xaf')][_0x2d6d('0xb0')]=function(){var _0x492694=this;setInterval(function(){_0x492694[_0x2d6d('0xb1')](_0x492694[_0x2d6d('0x29')],'[uniqueid]');_0x492694[_0x2d6d('0xb1')](_0x492694[_0x2d6d('0x27')],_0x2d6d('0xb2'));},0x32c8);};Dialer[_0x2d6d('0xaf')][_0x2d6d('0xb1')]=function(_0x5203ba,_0x230f56){var _0x28d9ad=this;for(var _0x4861bf in _0x5203ba){if(typeof _0x5203ba[_0x4861bf]!=='undefined'){this[_0x2d6d('0x20')][_0x2d6d('0x1e')](function(){if(!_['isNil'](_0x5203ba[_0x4861bf])){return ami['Action']({'action':_0x2d6d('0xb3'),'channel':_0x5203ba[_0x4861bf][_0x2d6d('0xb4')]})['catch'](function(_0x1af719){if(_0x1af719[_0x2d6d('0x40')]===_0x2d6d('0xb5')){setTimeout(function(){if(_0x5203ba[_0x4861bf]&&_0x5203ba[_0x4861bf][_0x2d6d('0x4f')]!=='ivr'){_0x28d9ad['updateOriginated'](_0x28d9ad[_0x2d6d('0x22')][_0x5203ba[_0x4861bf][_0x2d6d('0xb6')]]);logger[_0x2d6d('0x9c')](_0x2d6d('0xb7'),_0x230f56,_0x4861bf,_0x5203ba[_0x4861bf][_0x2d6d('0xb6')]);delete _0x5203ba[_0x4861bf];}if(_0x5203ba[_0x4861bf]&&_0x5203ba[_0x4861bf][_0x2d6d('0x4f')]===_0x2d6d('0x7e')){_0x28d9ad[_0x2d6d('0xb8')](_0x28d9ad['campaigns'][_0x5203ba[_0x4861bf][_0x2d6d('0xb6')]]);logger[_0x2d6d('0x9c')](_0x2d6d('0xb9'),_0x230f56,_0x4861bf,_0x5203ba[_0x4861bf][_0x2d6d('0xb6')]);delete _0x5203ba[_0x4861bf];}},0x2328);}});}});}}};Dialer[_0x2d6d('0xaf')][_0x2d6d('0xba')]=function(_0x44418d){return BPromise[_0x2d6d('0xbb')]()[_0x2d6d('0x3e')](cmHopper['countReScheduled'](_0x44418d))[_0x2d6d('0xbc')](loggerCatch(_0x2d6d('0xbd')));};Dialer[_0x2d6d('0xaf')][_0x2d6d('0xbe')]=function(_0x162d0f){return BPromise['resolve']()[_0x2d6d('0x3e')](cmHopperBlack[_0x2d6d('0xbe')](_0x162d0f))[_0x2d6d('0xbc')](loggerCatch(_0x2d6d('0xbf')));};Dialer[_0x2d6d('0xaf')][_0x2d6d('0xc0')]=function(_0x3e6be0,_0x1e08aa,_0x4101df){return BPromise[_0x2d6d('0xbb')]()['then'](cmHopperAdditionalPhone[_0x2d6d('0xc0')](_0x3e6be0,_0x1e08aa,_0x4101df))[_0x2d6d('0xbc')](loggerCatch('[verifyAdditionalPhone]\x20'));};Dialer[_0x2d6d('0xaf')][_0x2d6d('0xc1')]=function(_0xf43a92,_0x451a6e,_0x51b479){return BPromise[_0x2d6d('0xbb')]()[_0x2d6d('0x3e')](cmHopperAdditionalPhone[_0x2d6d('0xc1')](_0xf43a92,_0x451a6e,_0x51b479))[_0x2d6d('0xbc')](loggerCatch(_0x2d6d('0xc2')));};Dialer[_0x2d6d('0xaf')][_0x2d6d('0xc3')]=function(_0x40877b){return BPromise['resolve']()[_0x2d6d('0x3e')](cmHopperBlack[_0x2d6d('0xc3')](_0x40877b))[_0x2d6d('0xbc')](loggerCatch(_0x2d6d('0xc4')));};Dialer[_0x2d6d('0xaf')]['averageHandleTime']=function(_0x3ba3fe){return BPromise[_0x2d6d('0xbb')]()[_0x2d6d('0x3e')](cmHopperHistory[_0x2d6d('0xc5')](_0x3ba3fe))['catch'](loggerCatch('[averageHandleTime]\x20'));};Dialer[_0x2d6d('0xaf')][_0x2d6d('0xc6')]=function(_0x114ad9){return BPromise[_0x2d6d('0xbb')]()[_0x2d6d('0x3e')](cmHopper[_0x2d6d('0xc6')](_0x114ad9))[_0x2d6d('0xbc')](loggerCatch('[rescheduleContact]\x20'));};Dialer[_0x2d6d('0xaf')]['unlockContact']=function(_0x48130a,_0x1c3163,_0x3cfccd){return BPromise[_0x2d6d('0xbb')]()[_0x2d6d('0x3e')](cmHopper[_0x2d6d('0xc7')](_0x48130a,_0x1c3163,_0x3cfccd))[_0x2d6d('0xbc')](loggerCatch(_0x2d6d('0xc8')));};Dialer[_0x2d6d('0xaf')][_0x2d6d('0xc9')]=function(_0x1bf9cf,_0x347f09,_0x499d2b,_0x3d2288,_0x10cd2c){return BPromise[_0x2d6d('0xbb')]()['then'](cmHopper['getContactDialer'](_0x1bf9cf,_0x347f09,_0x499d2b,_0x3d2288))[_0x2d6d('0xbc')](function(_0x212c77){_0x10cd2c[_0x2d6d('0xca')]-=_0x499d2b;_0x10cd2c[_0x2d6d('0xca')]=_0x10cd2c[_0x2d6d('0xca')]>0x0?_0x10cd2c[_0x2d6d('0xca')]:0x0;loggerCatch('[getContactDialer]\x20')(_0x212c77);});};Dialer[_0x2d6d('0xaf')][_0x2d6d('0xcb')]=function(_0x7a7f09,_0x25a1b,_0x418f92,_0x57505b){return BPromise[_0x2d6d('0xbb')]()[_0x2d6d('0x3e')](cmHopper[_0x2d6d('0xcb')](_0x7a7f09,_0x25a1b,_0x418f92))[_0x2d6d('0xbc')](function(_0x33a8d4){_0x57505b[_0x2d6d('0xca')]-=_0x25a1b;_0x57505b[_0x2d6d('0xca')]=_0x57505b[_0x2d6d('0xca')]>0x0?_0x57505b[_0x2d6d('0xca')]:0x0;loggerCatch(_0x2d6d('0xcc'))(_0x33a8d4);});};Dialer[_0x2d6d('0xaf')][_0x2d6d('0xcd')]=function(_0x499dd2){return BPromise[_0x2d6d('0xbb')]()[_0x2d6d('0x3e')](voiceQueueRt[_0x2d6d('0xcd')](_0x499dd2))[_0x2d6d('0xbc')](loggerCatch(_0x2d6d('0xce')));};Dialer[_0x2d6d('0xaf')][_0x2d6d('0xcf')]=function(_0x11f85d){return BPromise['resolve']()[_0x2d6d('0x3e')](cmHopper['moveContactManagedDialer'](_0x11f85d))['catch'](loggerCatch('[moveContactManagedDialer]\x20'));};Dialer[_0x2d6d('0xaf')][_0x2d6d('0xd0')]=function(_0x5ed7bf){return BPromise[_0x2d6d('0xbb')]()['then'](cmHopperHistory['createHistory'](_0x5ed7bf))[_0x2d6d('0xbc')](loggerCatch('[createHistory]\x20'));};Dialer[_0x2d6d('0xaf')][_0x2d6d('0xb8')]=function(_0x5cf2f7){if(!_[_0x2d6d('0x8b')](_0x5cf2f7)&&_0x5cf2f7!==null){if(typeof _0x5cf2f7[_0x2d6d('0x73')]!==_0x2d6d('0x9f')){if(_0x5cf2f7[_0x2d6d('0x73')]>0x0){_0x5cf2f7[_0x2d6d('0x73')]-=0x1;}else{logger['error'](_0x2d6d('0xd1'));}}}else{logger[_0x2d6d('0x9c')](_0x2d6d('0xd2'));}};Dialer[_0x2d6d('0xaf')]['loggerHandler']=function(_0x2927f3,_0x227518){var _0x3a6f41=this;return function(_0x571c1a){_0x3a6f41[_0x2d6d('0xb8')](_0x227518);logger[_0x2d6d('0x9c')](_0x2927f3,util['inspect'](_0x571c1a,{'showHidden':![],'depth':null}));};};Dialer[_0x2d6d('0xaf')]['emptyContact']=function(_0x5e0c30,_0x502f53,_0x3e2c0c){var _0x10d5f7={'state':0x19,'statedesc':'notFound'};this[_0x2d6d('0xb8')](_0x502f53);this['saveInDb'](_[_0x2d6d('0x94')](_0x10d5f7,_[_0x2d6d('0xd3')](_0x3e2c0c,[_0x2d6d('0xd4'),_0x2d6d('0xd5'),'UserId',_0x2d6d('0xd6'),_0x2d6d('0xd7')])),'[emptyContact][createHistory]','[emptyContact]');logger['error'](_0x5e0c30);};Dialer['prototype'][_0x2d6d('0xd8')]=function(_0x3cdcf2){return _0x3cdcf2==='Success';};Dialer[_0x2d6d('0xaf')][_0x2d6d('0xd9')]=function(_0x5341c9){return!_[_0x2d6d('0x8b')](_0x5341c9)&&_0x5341c9&&!_[_0x2d6d('0x8b')](_0x5341c9[_0x2d6d('0x42')])&&!_[_0x2d6d('0x8b')](_0x5341c9['active'])&&_0x5341c9[_0x2d6d('0x79')]&&(this[_0x2d6d('0x25')][util['format']('SIP/%s',_0x5341c9['name'])][_0x2d6d('0xb3')]===_0x2d6d('0xda')||this[_0x2d6d('0x25')][util[_0x2d6d('0x7c')]('SIP/%s',_0x5341c9[_0x2d6d('0x42')])][_0x2d6d('0xb3')]===_0x2d6d('0xdb'));};Dialer[_0x2d6d('0xaf')][_0x2d6d('0xdc')]=function(_0x4ccdb5,_0x185cb0,_0x327e46){this[_0x2d6d('0xd0')](_0x4ccdb5)['catch'](loggerCatch(_0x185cb0));this[_0x2d6d('0xcf')](_0x4ccdb5)['catch'](loggerCatch(_0x327e46));};Dialer[_0x2d6d('0xaf')][_0x2d6d('0xdd')]=function(_0x38ce8a){var _0x2fa44f=this[_0x2d6d('0x29')][_0x38ce8a[_0x2d6d('0xde')]];var _0x4fd85b;if(!_[_0x2d6d('0xdf')](_0x38ce8a)&&!_[_0x2d6d('0xdf')](_0x38ce8a['variable'])&&!_[_0x2d6d('0xdf')](_0x38ce8a['variable'][_0x2d6d('0xe0')])&&_0x38ce8a[_0x2d6d('0xe1')]===_0x2d6d('0xe2')&&_0x2fa44f){if(_0x2fa44f['type']!==_0x2d6d('0x7e')&&this['voiceQueues'][_0x2fa44f[_0x2d6d('0xb6')]][_0x2d6d('0xe3')]&&_0x38ce8a['value']===_0x2d6d('0xe4')){delete this[_0x2d6d('0x29')][_0x38ce8a['uniqueid']];this[_0x2d6d('0xb8')](this[_0x2d6d('0x22')][_0x2fa44f[_0x2d6d('0xb6')]]);this[_0x2d6d('0x22')][_0x2fa44f['queue']][_0x2d6d('0xe5')]+=0x1;this['voiceQueues'][_0x2fa44f[_0x2d6d('0xb6')]][_0x2d6d('0x62')]+=0x1;_0x4fd85b=new Hangup(_0x2fa44f,_0x38ce8a);_0x4fd85b[_0x2d6d('0xe6')]=0x12;_0x4fd85b['statedesc']=_0x2d6d('0xe7');_0x4fd85b[_0x2d6d('0xe8')]=_0x2d6d('0xe9');ami['emit'](_0x2d6d('0xea'),ut[_0x2d6d('0xeb')](_0x4fd85b,_0x2d6d('0xec')));this[_0x2d6d('0xdc')](_0x4fd85b,_0x2d6d('0xed'),_0x2d6d('0xee'));}if(_0x2fa44f[_0x2d6d('0x4f')]!==_0x2d6d('0x7e')&&this[_0x2d6d('0x22')][_0x2fa44f[_0x2d6d('0xb6')]][_0x2d6d('0xe3')]&&_0x38ce8a[_0x2d6d('0xef')]===_0x2d6d('0xf0')){var _0x143259=this;return new BPromise(function(_0x411a01,_0xf35bbf){delete _0x143259[_0x2d6d('0x29')][_0x38ce8a['uniqueid']];_0x143259['updateOriginated'](_0x143259[_0x2d6d('0x22')][_0x2fa44f[_0x2d6d('0xb6')]]);_0x143259[_0x2d6d('0x22')][_0x2fa44f[_0x2d6d('0xb6')]]['outboundAnswerCallsDay']+=0x1;_0x143259['voiceQueues'][_0x2fa44f[_0x2d6d('0xb6')]][_0x2d6d('0x62')]+=0x1;var _0xf13ecf=_0x143259[_0x2d6d('0x22')][_0x2fa44f['queue']];var _0x4e81f6=new Hangup(_0x2fa44f,_0x38ce8a);_0x4e81f6[_0x2d6d('0xe6')]=0x13;_0x4e81f6['statedesc']=_0x2d6d('0xf1');_0x4e81f6['membername']='AMD';_0x4e81f6[_0x2d6d('0xf2')]+=0x1;_0x4e81f6['countglobal']+=0x1;_0x4e81f6[_0x2d6d('0xec')]=!![];ami['emit']('custom:amd',ut[_0x2d6d('0xeb')](_0x4e81f6,_0x2d6d('0xec')));_0x143259[_0x2d6d('0xd0')](_0x4e81f6)[_0x2d6d('0xbc')](loggerCatch(_0x2d6d('0xf3')));if(_0x4e81f6[_0x2d6d('0xf4')]+_0x4e81f6[_0x2d6d('0xf5')]+_0x4e81f6[_0x2d6d('0xf6')]+_0x4e81f6[_0x2d6d('0xf7')]+_0x4e81f6[_0x2d6d('0xf8')]+_0x4e81f6[_0x2d6d('0xf9')]+_0x4e81f6[_0x2d6d('0xf2')]+_0x4e81f6[_0x2d6d('0xfa')]>=_0xf13ecf[_0x2d6d('0xfb')]){_0x143259[_0x2d6d('0xfc')](_0x4e81f6,_0x411a01,_0xf35bbf,_0x2d6d('0xfd'));}else{if(_0x4e81f6['countmachineretry']>=_0xf13ecf['dialMachineMaxRetry']){_0x143259['createStateFinal'](_0x4e81f6,_0x411a01,_0xf35bbf,_0x2d6d('0xfe'));}else{_0x143259[_0x2d6d('0xc6')]({'active':![],'countmachineretry':_0x4e81f6['countmachineretry'],'scheduledat':moment()['add'](_0xf13ecf['dialMachineRetryFrequency'],_0x2d6d('0xff'))[_0x2d6d('0x7c')](_0x2d6d('0x100')),'ContactId':_0x4e81f6[_0x2d6d('0xd4')],'ListId':_0x4e81f6[_0x2d6d('0xd5')],'VoiceQueueId':_0x4e81f6['VoiceQueueId']||undefined,'CampaignId':_0x4e81f6['CampaignId']||undefined})[_0x2d6d('0xbc')](loggerCatch(_0x2d6d('0x101')));_0x411a01({'reschedule':0x1});}}});}if(_0x2fa44f[_0x2d6d('0x4f')]===_0x2d6d('0x7e')&&this[_0x2d6d('0x23')][_0x2fa44f['queue']][_0x2d6d('0xe3')]&&_0x38ce8a[_0x2d6d('0xef')]==='HANGUP'){delete this[_0x2d6d('0x29')][_0x38ce8a[_0x2d6d('0xde')]];this[_0x2d6d('0xb8')](this[_0x2d6d('0x23')][_0x2fa44f[_0x2d6d('0xb6')]]);_0x4fd85b=new Hangup(_0x2fa44f,_0x38ce8a);_0x4fd85b[_0x2d6d('0xe6')]=0x12;_0x4fd85b['statedesc']=_0x2d6d('0xe7');_0x4fd85b[_0x2d6d('0xe8')]=_0x2d6d('0xe9');ami[_0x2d6d('0x4e')](_0x2d6d('0xea'),ut[_0x2d6d('0xeb')](_0x4fd85b,'amd'));this[_0x2d6d('0xdc')](_0x4fd85b,_0x2d6d('0x102'),_0x2d6d('0x103'));}if(_0x2fa44f['type']===_0x2d6d('0x7e')&&this[_0x2d6d('0x23')][_0x2fa44f[_0x2d6d('0xb6')]]['dialAMDActive']&&_0x38ce8a[_0x2d6d('0xef')]==='MACHINE'){var _0x143259=this;return new BPromise(function(_0x35a15b,_0x4a97ef){delete _0x143259[_0x2d6d('0x29')][_0x38ce8a['uniqueid']];_0x143259[_0x2d6d('0xb8')](_0x143259[_0x2d6d('0x23')][_0x2fa44f[_0x2d6d('0xb6')]]);_0x143259[_0x2d6d('0x23')][_0x2fa44f[_0x2d6d('0xb6')]][_0x2d6d('0xe5')]+=0x1;_0x143259[_0x2d6d('0x23')][_0x2fa44f[_0x2d6d('0xb6')]][_0x2d6d('0x62')]+=0x1;var _0x52f823=_0x143259[_0x2d6d('0x23')][_0x2fa44f[_0x2d6d('0xb6')]];var _0x277857=new Hangup(_0x2fa44f,_0x38ce8a);_0x277857[_0x2d6d('0xe6')]=0x13;_0x277857[_0x2d6d('0xae')]=_0x2d6d('0xf1');_0x277857[_0x2d6d('0xe8')]=_0x2d6d('0xe9');_0x277857[_0x2d6d('0xf2')]+=0x1;_0x277857[_0x2d6d('0x104')]+=0x1;_0x277857[_0x2d6d('0xec')]=!![];ami['emit'](_0x2d6d('0xea'),ut[_0x2d6d('0xeb')](_0x277857,_0x2d6d('0xec')));_0x143259[_0x2d6d('0xd0')](_0x277857)[_0x2d6d('0xbc')](loggerCatch(_0x2d6d('0xf3')));if(_0x277857[_0x2d6d('0xf4')]+_0x277857[_0x2d6d('0xf5')]+_0x277857['countnoanswerretry']+_0x277857[_0x2d6d('0xf7')]+_0x277857[_0x2d6d('0xf8')]+_0x277857[_0x2d6d('0xf9')]+_0x277857[_0x2d6d('0xf2')]+_0x277857['countagentrejectretry']>=_0x52f823[_0x2d6d('0xfb')]){_0x143259[_0x2d6d('0xfc')](_0x277857,_0x35a15b,_0x4a97ef,'reason19\x20machine....');}else{if(_0x277857[_0x2d6d('0xf2')]>=_0x52f823[_0x2d6d('0x105')]){_0x143259[_0x2d6d('0x106')](_0x277857,_0x35a15b,_0x4a97ef,_0x2d6d('0xfe'));}else{_0x143259['rescheduleContact']({'active':![],'countmachineretry':_0x277857[_0x2d6d('0xf2')],'scheduledat':moment()[_0x2d6d('0x107')](_0x52f823['dialMachineRetryFrequency'],_0x2d6d('0xff'))[_0x2d6d('0x7c')](_0x2d6d('0x100')),'ContactId':_0x277857['ContactId'],'ListId':_0x277857[_0x2d6d('0xd5')],'VoiceQueueId':_0x277857[_0x2d6d('0xd6')]||undefined,'CampaignId':_0x277857['CampaignId']||undefined})[_0x2d6d('0xbc')](loggerCatch('[rescheduleContact][Machine]'));_0x35a15b({'reschedule':0x1});}}});}}};Dialer['prototype'][_0x2d6d('0x36')]=function(_0x21d806){var _0x2c03dd=this[_0x2d6d('0x29')][_0x21d806[_0x2d6d('0xde')]];var _0x70934f=this;var _0x5185cb;if(_0x2c03dd&&_0x2c03dd[_0x2d6d('0x4f')]==='ivr'){delete this[_0x2d6d('0x29')][_0x21d806['uniqueid']];this[_0x2d6d('0xb8')](this['campaigns'][_0x2c03dd[_0x2d6d('0xb6')]]);this[_0x2d6d('0x23')][_0x2c03dd['queue']]['ivrAnswerCallsDay']+=0x1;_0x5185cb=new Hangup(_0x2c03dd,_0x21d806);this[_0x2d6d('0xd0')](_0x5185cb)[_0x2d6d('0xbc')](loggerCatch(_0x2d6d('0x108')));this[_0x2d6d('0xcf')](_0x5185cb)[_0x2d6d('0xbc')](loggerCatch(_0x2d6d('0x109')));}if(_0x2c03dd&&_0x2c03dd[_0x2d6d('0x4f')]!==_0x2d6d('0x7e')&&isNotNull(this[_0x2d6d('0x22')][_0x2c03dd[_0x2d6d('0xb6')]][_0x2d6d('0x10a')])){delete this[_0x2d6d('0x29')][_0x21d806['uniqueid']];this[_0x2d6d('0xb8')](this[_0x2d6d('0x22')][_0x2c03dd['queue']]);this['voiceQueues'][_0x2c03dd['queue']][_0x2d6d('0xe5')]+=0x1;this['voiceQueues'][_0x2c03dd[_0x2d6d('0xb6')]]['outboundAnswerAgiCallsDay']+=0x1;_0x5185cb=new Hangup(_0x2c03dd,_0x21d806);_0x5185cb[_0x2d6d('0xe6')]=0x10;_0x5185cb[_0x2d6d('0xae')]=_0x2d6d('0x10b');_0x5185cb['membername']='AGI';this[_0x2d6d('0xd0')](_0x5185cb)[_0x2d6d('0xbc')](loggerCatch('[syncHangupIvr][createHistory]'));this['moveContactManagedDialer'](_0x5185cb)['catch'](loggerCatch(_0x2d6d('0x109')));}if(_0x2c03dd&&_0x2c03dd[_0x2d6d('0x4f')]!=='ivr'&&!isNotNull(this[_0x2d6d('0x22')][_0x2c03dd[_0x2d6d('0xb6')]]['dialQueueProject'])){delete this['uniqueId'][_0x21d806['uniqueid']];this[_0x2d6d('0xb8')](this['voiceQueues'][_0x2c03dd['queue']]);this[_0x2d6d('0x22')][_0x2c03dd[_0x2d6d('0xb6')]][_0x2d6d('0x10c')]+=0x1;_0x5185cb=new Hangup(_0x2c03dd,_0x21d806);_0x5185cb[_0x2d6d('0xe6')]=0xc;_0x5185cb[_0x2d6d('0xae')]=_0x21d806['cause-txt'];_0x5185cb[_0x2d6d('0xe8')]='Unknow';this[_0x2d6d('0xd0')](_0x5185cb)[_0x2d6d('0xbc')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0x2d6d('0xcf')](_0x5185cb)[_0x2d6d('0xbc')](loggerCatch(_0x2d6d('0x109')));}};Dialer[_0x2d6d('0xaf')]['syncAgentComplete']=function(_0x169fd5){var _0x30500d=this['uniqueId'][_0x169fd5[_0x2d6d('0xde')]];var _0x548588=this;if(this[_0x2d6d('0x22')][_0x169fd5[_0x2d6d('0xb6')]]){if(_0x30500d&&_0x30500d[_0x2d6d('0x4f')]!==_0x2d6d('0x7e')){delete this[_0x2d6d('0x29')][_0x169fd5[_0x2d6d('0xde')]];this[_0x2d6d('0x22')][_0x169fd5['queue']][_0x2d6d('0xe5')]+=0x1;var _0x1abd28=new AgentComplete(_0x30500d,_0x169fd5);if(_0x169fd5['reason']===_0x2d6d('0x10d')){_0x1abd28[_0x2d6d('0x10e')]=this[_0x2d6d('0x22')][_0x169fd5['queue']][_0x2d6d('0x10f')]&&this[_0x2d6d('0x22')][_0x169fd5[_0x2d6d('0xb6')]][_0x2d6d('0x110')]?moment()['format'](_0x2d6d('0x100')):undefined;}this[_0x2d6d('0xd0')](_0x1abd28)[_0x2d6d('0xbc')](loggerCatch(_0x2d6d('0x111')));this[_0x2d6d('0xcf')](_0x1abd28)[_0x2d6d('0xbc')](loggerCatch(_0x2d6d('0x112')));}}};Dialer[_0x2d6d('0xaf')][_0x2d6d('0x113')]=function(_0x203fd0){if(this[_0x2d6d('0x22')][_0x203fd0[_0x2d6d('0xb6')]]){if(this[_0x2d6d('0x29')][_0x203fd0[_0x2d6d('0xde')]]&&this[_0x2d6d('0x29')][_0x203fd0[_0x2d6d('0xde')]]['type']!=='ivr'){this[_0x2d6d('0xb8')](this[_0x2d6d('0x22')][_0x203fd0[_0x2d6d('0xb6')]]);this[_0x2d6d('0x29')][_0x203fd0[_0x2d6d('0xde')]][_0x2d6d('0x114')]=moment()['format'](_0x2d6d('0x100'));}}};Dialer[_0x2d6d('0xaf')][_0x2d6d('0x115')]=function(_0x45c1aa,_0x32c4ce){this[_0x2d6d('0xd0')](_0x45c1aa)[_0x2d6d('0xbc')](loggerCatch(_0x2d6d('0x111')));if(_0x32c4ce==0x0){this[_0x2d6d('0xcf')](_0x45c1aa)['catch'](loggerCatch(_0x2d6d('0x116')));}};Dialer[_0x2d6d('0xaf')][_0x2d6d('0x117')]=function(_0xf59ae4){var _0x3443be=this[_0x2d6d('0x29')][_0xf59ae4[_0x2d6d('0xde')]];var _0x5cf1c6=this;var _0x11deff=![];var _0x41b910;var _0x310611;if(this[_0x2d6d('0x22')][_0xf59ae4[_0x2d6d('0xb6')]]){if(_0x3443be&&_0x3443be[_0x2d6d('0x4f')]!==_0x2d6d('0x7e')){delete this['uniqueId'][_0xf59ae4[_0x2d6d('0xde')]];this[_0x2d6d('0xb8')](this['voiceQueues'][_0xf59ae4[_0x2d6d('0xb6')]]);_0x3443be['droptime']=moment()[_0x2d6d('0x7c')](_0x2d6d('0x100'));var _0x35cc77=new QueueCallerAbandon(_0x3443be,_0xf59ae4);if(getSeconds(_0x3443be[_0x2d6d('0x118')],_0x3443be[_0x2d6d('0x119')])>=_0x3443be[_0x2d6d('0x11a')]){this[_0x2d6d('0x22')][_0xf59ae4[_0x2d6d('0xb6')]]['predictiveIntervalDroppedCallsTimeout']+=0x1;this[_0x2d6d('0x22')][_0xf59ae4[_0x2d6d('0xb6')]][_0x2d6d('0x67')]+=0x1;this[_0x2d6d('0x22')][_0xf59ae4[_0x2d6d('0xb6')]]['predictiveIntervalErlangCallsDroppedCalls']+=0x1;_0x35cc77['state']=0xa;_0x35cc77[_0x2d6d('0xae')]='Drop';_0x35cc77[_0x2d6d('0x11b')]=_0x2d6d('0x11c');_0x35cc77[_0x2d6d('0x10e')]=this['voiceQueues'][_0xf59ae4[_0x2d6d('0xb6')]][_0x2d6d('0x10f')]?moment()[_0x2d6d('0x7c')](_0x2d6d('0x100')):undefined;_0x35cc77['countdropretry']+=0x1;_0x35cc77['countglobal']+=0x1;_0x41b910=this[_0x2d6d('0x22')][_0xf59ae4[_0x2d6d('0xb6')]][_0x2d6d('0x11d')];_0x310611=this[_0x2d6d('0x22')][_0xf59ae4['queue']][_0x2d6d('0x11e')];_0x5cf1c6[_0x2d6d('0xc0')](_0x35cc77,_0x35cc77[_0x2d6d('0xe6')],_0x3443be['voiceQueue'])[_0x2d6d('0x3e')](function(_0x5b5fc0){_0x11deff=_0x5b5fc0[_0x2d6d('0x11f')]==0x1;if(_0x35cc77['countdropretry']>=_0x5cf1c6[_0x2d6d('0x22')][_0xf59ae4['queue']][_0x2d6d('0x120')]){_0x5cf1c6['queueCallerAbandonCreateState'](_0x35cc77,_0x5b5fc0[_0x2d6d('0x11f')]);}else{_0x5cf1c6[_0x2d6d('0xc6')]({'active':![],'countdropretry':_0x35cc77[_0x2d6d('0xf8')],'scheduledat':moment()[_0x2d6d('0x107')](_0x5cf1c6['voiceQueues'][_0xf59ae4[_0x2d6d('0xb6')]]['dialDropRetryFrequency'],_0x2d6d('0xff'))[_0x2d6d('0x7c')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x3443be[_0x2d6d('0xd4')],'ListId':_0x3443be['ListId'],'VoiceQueueId':_0x3443be[_0x2d6d('0xd6')]||undefined,'CampaignId':_0x3443be[_0x2d6d('0xd7')]||undefined})['catch'](loggerCatch(_0x2d6d('0x121')));var _0x1e1ec2=new History(_0x35cc77);_0x1e1ec2[_0x2d6d('0xe6')]=0xa;_0x1e1ec2[_0x2d6d('0xae')]=_0x2d6d('0x122');_0x1e1ec2[_0x2d6d('0x123')]=moment()['format'](_0x2d6d('0x100'));_0x1e1ec2[_0x2d6d('0x124')]=_0x1e1ec2[_0x2d6d('0x123')];_0x1e1ec2[_0x2d6d('0x125')]=_0x35cc77[_0x2d6d('0x125')];_0x1e1ec2[_0x2d6d('0x126')]=_0x35cc77[_0x2d6d('0x126')];_0x5cf1c6[_0x2d6d('0xd0')](_0x1e1ec2)[_0x2d6d('0xbc')](loggerCatch(_0x2d6d('0x127')));}})[_0x2d6d('0x3e')](function(_0x40b0d3){if(_0x11deff)_0x5cf1c6['swapAdditionalPhones'](_0x35cc77,_0x41b910,_0x310611)[_0x2d6d('0x3e')](function(_0x446dff){return 0x1;});});}else{this[_0x2d6d('0x22')][_0xf59ae4[_0x2d6d('0xb6')]][_0x2d6d('0x6c')]+=0x1;this[_0x2d6d('0x22')][_0xf59ae4['queue']][_0x2d6d('0x66')]+=0x1;_0x35cc77[_0x2d6d('0xe6')]=0xb;_0x35cc77[_0x2d6d('0xae')]=_0x2d6d('0x128');_0x35cc77['dropreason']='CALLEREXIT';_0x35cc77['countabandonedretry']+=0x1;_0x35cc77[_0x2d6d('0x104')]+=0x1;_0x41b910=this[_0x2d6d('0x22')][_0xf59ae4[_0x2d6d('0xb6')]][_0x2d6d('0x129')];_0x310611=this[_0x2d6d('0x22')][_0xf59ae4[_0x2d6d('0xb6')]][_0x2d6d('0x11e')];_0x5cf1c6[_0x2d6d('0xc0')](_0x35cc77,_0x35cc77[_0x2d6d('0xe6')],_0x3443be[_0x2d6d('0x12a')])[_0x2d6d('0x3e')](function(_0x1eb5c6){if(_0x35cc77[_0x2d6d('0xf9')]>=_0x5cf1c6[_0x2d6d('0x22')][_0xf59ae4[_0x2d6d('0xb6')]]['dialAbandonedMaxRetry']){_0x5cf1c6[_0x2d6d('0x115')](_0x35cc77,_0x1eb5c6['additional']);}else{_0x5cf1c6[_0x2d6d('0xc6')]({'active':![],'countabandonedretry':_0x35cc77[_0x2d6d('0xf9')],'scheduledat':moment()[_0x2d6d('0x107')](_0x5cf1c6[_0x2d6d('0x22')][_0xf59ae4[_0x2d6d('0xb6')]][_0x2d6d('0x129')],'minutes')[_0x2d6d('0x7c')](_0x2d6d('0x100')),'ContactId':_0x3443be['ContactId'],'ListId':_0x3443be[_0x2d6d('0xd5')],'VoiceQueueId':_0x3443be['VoiceQueueId']||undefined,'CampaignId':_0x3443be['CampaignId']||undefined})[_0x2d6d('0xbc')](loggerCatch(_0x2d6d('0x12b')));var _0x3a1d67=new History(_0x35cc77);_0x3a1d67[_0x2d6d('0xe6')]=0xb;_0x3a1d67[_0x2d6d('0xae')]=_0x2d6d('0x128');_0x3a1d67[_0x2d6d('0x123')]=moment()[_0x2d6d('0x7c')](_0x2d6d('0x100'));_0x3a1d67['endtime']=_0x3a1d67[_0x2d6d('0x123')];_0x3a1d67[_0x2d6d('0x125')]=_0x35cc77['calleridname'];_0x3a1d67['calleridnum']=_0x35cc77[_0x2d6d('0x126')];_0x5cf1c6[_0x2d6d('0xd0')](_0x3a1d67)[_0x2d6d('0xbc')](loggerCatch(_0x2d6d('0x12c')));}})['then'](function(_0x1a95e8){if(_0x11deff)_0x5cf1c6[_0x2d6d('0xc1')](_0x35cc77,_0x41b910,_0x310611)[_0x2d6d('0x3e')](function(_0x56fa40){return 0x1;});});}}}};Dialer[_0x2d6d('0xaf')][_0x2d6d('0x38')]=function(_0xc0501f){if(this[_0x2d6d('0x27')][_0xc0501f[_0x2d6d('0xde')]]){this['actions'][_0xc0501f[_0x2d6d('0xde')]][_0x2d6d('0xb4')]=_0xc0501f[_0x2d6d('0xb4')];}if(this[_0x2d6d('0x29')][_0xc0501f['uniqueid']]){this[_0x2d6d('0x29')][_0xc0501f[_0x2d6d('0xde')]][_0x2d6d('0xb4')]=_0xc0501f['channel'];}};Dialer[_0x2d6d('0xaf')]['syncQueueMember']=function(_0x14e19a){if(strategy[this[_0x2d6d('0x22')][this[_0x2d6d('0x27')][_0x14e19a[_0x2d6d('0x12d')]][_0x2d6d('0xb6')]][_0x2d6d('0x51')]]==='roundrobin'){if(this[_0x2d6d('0x27')][_0x14e19a[_0x2d6d('0x12d')]]&&_[_0x2d6d('0xdf')](this['actions'][_0x14e19a[_0x2d6d('0x12d')]]['locked'])&&_0x14e19a[_0x2d6d('0xb3')]==='1'&&_0x14e19a[_0x2d6d('0x12e')]==='0'){if(this[_0x2d6d('0x24')][_0x14e19a[_0x2d6d('0x12f')]]){if(!this['agents'][_0x14e19a[_0x2d6d('0x12f')]]['locked']){this[_0x2d6d('0x24')][_0x14e19a[_0x2d6d('0x12f')]][_0x2d6d('0x130')]=!![];this[_0x2d6d('0x27')][_0x14e19a[_0x2d6d('0x12d')]][_0x2d6d('0x130')]=!![];this[_0x2d6d('0x27')][_0x14e19a[_0x2d6d('0x12d')]]['stateinterface']=_0x14e19a[_0x2d6d('0x12f')];}}}}else if((strategy[this[_0x2d6d('0x22')][this['actions'][_0x14e19a[_0x2d6d('0x12d')]][_0x2d6d('0xb6')]][_0x2d6d('0x51')]]||_0x2d6d('0x1d'))===_0x2d6d('0x1d')){if(this[_0x2d6d('0x27')][_0x14e19a['actionid']]){if(this[_0x2d6d('0x24')][_0x14e19a[_0x2d6d('0x12f')]]){this['actions'][_0x14e19a['actionid']]['stateinterface']=_0x14e19a[_0x2d6d('0x12f')];if(_[_0x2d6d('0xdf')](this[_0x2d6d('0x2d')][this[_0x2d6d('0x27')][_0x14e19a[_0x2d6d('0x12d')]][_0x2d6d('0xb6')]])){this[_0x2d6d('0x2d')][this[_0x2d6d('0x27')][_0x14e19a[_0x2d6d('0x12d')]]['queue']]=[];}this[_0x2d6d('0x2d')][this[_0x2d6d('0x27')][_0x14e19a[_0x2d6d('0x12d')]][_0x2d6d('0xb6')]][_0x2d6d('0x131')](_[_0x2d6d('0x94')](_[_0x2d6d('0xd3')](this[_0x2d6d('0x27')][_0x14e19a[_0x2d6d('0x12d')]],[_0x2d6d('0x132'),_0x2d6d('0x12f')]),{'status':_0x14e19a[_0x2d6d('0xb3')],'paused':_0x14e19a[_0x2d6d('0x12e')]}));}}}};function unlockQueueStatus(_0xf03fd3,_0x1d34b9){setTimeout(function(){if(_[_0x2d6d('0x8b')](_0xf03fd3[_0x2d6d('0x133')])){loggerBooked['error'](_0x2d6d('0x134'),_0x1d34b9);}_0xf03fd3[_0x2d6d('0x133')]=!![];loggerBooked['info'](_0x2d6d('0x135'),_0x1d34b9,JSON['stringify'](_[_0x2d6d('0xd3')](_0xf03fd3,[_0x2d6d('0x42'),_0x2d6d('0x133')])));},0x1f3);}Dialer[_0x2d6d('0xaf')][_0x2d6d('0x3c')]=function(_0x1a528a){var _0x39cd38=this;var _0x1e6c35=_0x39cd38['voiceQueues'][_0x39cd38[_0x2d6d('0x27')][_0x1a528a[_0x2d6d('0x12d')]][_0x2d6d('0xb6')]];if(strategy[this[_0x2d6d('0x22')][this[_0x2d6d('0x27')][_0x1a528a[_0x2d6d('0x12d')]][_0x2d6d('0xb6')]][_0x2d6d('0x51')]]===_0x2d6d('0x136')){if(this[_0x2d6d('0x27')][_0x1a528a[_0x2d6d('0x12d')]]&&this['actions'][_0x1a528a['actionid']][_0x2d6d('0x12f')]){this[_0x2d6d('0x21')][_0x2d6d('0x137')](this[_0x2d6d('0x27')][_0x1a528a[_0x2d6d('0x12d')]]['idHopper'],this[_0x2d6d('0x27')][_0x1a528a[_0x2d6d('0x12d')]][_0x2d6d('0x12f')])[_0x2d6d('0xbc')](function(_0x473152){logger[_0x2d6d('0x9c')]('[Catch][Preview][syncQueueStatusComplete]',util['inspect'](_0x473152,{'showHidden':![],'depth':null}));})[_0x2d6d('0x138')](function(){_0x39cd38[_0x2d6d('0xb8')](_0x39cd38['voiceQueues'][_0x39cd38['actions'][_0x1a528a[_0x2d6d('0x12d')]][_0x2d6d('0xb6')]]);_0x39cd38[_0x2d6d('0x24')][_0x39cd38[_0x2d6d('0x27')][_0x1a528a[_0x2d6d('0x12d')]]['stateinterface']][_0x2d6d('0x130')]=![];delete _0x39cd38[_0x2d6d('0x27')][_0x1a528a[_0x2d6d('0x12d')]];unlockQueueStatus(_0x1e6c35);});}else{this[_0x2d6d('0xb8')](this['voiceQueues'][this[_0x2d6d('0x27')][_0x1a528a[_0x2d6d('0x12d')]][_0x2d6d('0xb6')]]);this['rescheduleContact']({'active':![],'ContactId':this[_0x2d6d('0x27')][_0x1a528a[_0x2d6d('0x12d')]][_0x2d6d('0xd4')],'ListId':this[_0x2d6d('0x27')][_0x1a528a[_0x2d6d('0x12d')]]['ListId'],'VoiceQueueId':this['actions'][_0x1a528a[_0x2d6d('0x12d')]][_0x2d6d('0xd6')]||undefined,'CampaignId':this[_0x2d6d('0x27')][_0x1a528a[_0x2d6d('0x12d')]][_0x2d6d('0xd7')]||undefined})['catch'](loggerCatch('[unlock][syncQueueStatusComplete]'));delete this['actions'][_0x1a528a['actionid']];unlockQueueStatus(_0x1e6c35);}}else if((strategy[this[_0x2d6d('0x22')][this['actions'][_0x1a528a[_0x2d6d('0x12d')]][_0x2d6d('0xb6')]][_0x2d6d('0x51')]]||'rrmemory')==='rrmemory'){var _0x11e398;if(this[_0x2d6d('0x27')][_0x1a528a[_0x2d6d('0x12d')]]&&!_[_0x2d6d('0x81')](this[_0x2d6d('0x2d')][this[_0x2d6d('0x27')][_0x1a528a[_0x2d6d('0x12d')]][_0x2d6d('0xb6')]])){if(this['queueBookedRR'][_0x39cd38['actions'][_0x1a528a[_0x2d6d('0x12d')]][_0x2d6d('0xb6')]]){this['queueBookedRR'][_0x39cd38[_0x2d6d('0x27')][_0x1a528a[_0x2d6d('0x12d')]][_0x2d6d('0xb6')]]=this[_0x2d6d('0x2e')][this[_0x2d6d('0x27')][_0x1a528a[_0x2d6d('0x12d')]][_0x2d6d('0xb6')]]?this[_0x2d6d('0x2e')][this['actions'][_0x1a528a['actionid']]['queue']]:this['queueBooked'][this[_0x2d6d('0x27')][_0x1a528a['actionid']][_0x2d6d('0xb6')]]?this[_0x2d6d('0x2d')][this['actions'][_0x1a528a['actionid']]['queue']][_0x2d6d('0x139')]||0x0:0x0;}this[_0x2d6d('0x2d')][this[_0x2d6d('0x27')][_0x1a528a[_0x2d6d('0x12d')]]['queue']][_0x2d6d('0x139')]=this[_0x2d6d('0x2e')][this[_0x2d6d('0x27')][_0x1a528a[_0x2d6d('0x12d')]][_0x2d6d('0xb6')]];for(var _0x2fa31b=0x0;_0x2fa31b<this['queueBooked'][this[_0x2d6d('0x27')][_0x1a528a[_0x2d6d('0x12d')]][_0x2d6d('0xb6')]][_0x2d6d('0x9e')];_0x2fa31b+=0x1){_0x11e398=rr(this[_0x2d6d('0x2d')][this[_0x2d6d('0x27')][_0x1a528a[_0x2d6d('0x12d')]][_0x2d6d('0xb6')]]);this[_0x2d6d('0x2e')][_0x39cd38[_0x2d6d('0x27')][_0x1a528a[_0x2d6d('0x12d')]]['queue']]=this[_0x2d6d('0x2d')][this['actions'][_0x1a528a['actionid']][_0x2d6d('0xb6')]]['_rr'];if(_0x11e398[_0x2d6d('0xb3')]==='1'&&_0x11e398['paused']==='0'){break;}}if(!_[_0x2d6d('0xdf')](_0x11e398)){this[_0x2d6d('0x24')][_0x11e398[_0x2d6d('0x12f')]][_0x2d6d('0x13a')]=_[_0x2d6d('0x8b')](this['agents'][_0x11e398[_0x2d6d('0x12f')]]['unlockRR'])?!![]:this[_0x2d6d('0x24')][_0x11e398[_0x2d6d('0x12f')]][_0x2d6d('0x13a')];}loggerBooked[_0x2d6d('0x82')](_0x2d6d('0x13b'),_0x1a528a[_0x2d6d('0x12d')],'Agent:\x20',JSON['stringify'](_[_0x2d6d('0xd3')](this[_0x2d6d('0x24')][_0x11e398[_0x2d6d('0x12f')]],['name','unlockRR'])),_0x2d6d('0x13c'),JSON[_0x2d6d('0x4a')](_0x11e398[_0x2d6d('0x132')]));if(!_[_0x2d6d('0xdf')](_0x11e398)&&_0x11e398[_0x2d6d('0xb3')]==='1'&&_0x11e398[_0x2d6d('0x12e')]==='0'&&this[_0x2d6d('0x24')][_0x11e398['stateinterface']][_0x2d6d('0x13a')]){this['agents'][_0x11e398[_0x2d6d('0x12f')]][_0x2d6d('0x13a')]=![];this[_0x2d6d('0x2d')][_0x39cd38[_0x2d6d('0x27')][_0x1a528a[_0x2d6d('0x12d')]][_0x2d6d('0xb6')]]=[];this[_0x2d6d('0x21')]['run'](_0x11e398['idHopper'],_0x11e398[_0x2d6d('0x12f')])[_0x2d6d('0xbc')](function(_0x5dc231){logger[_0x2d6d('0x9c')]('[Catch][Preview][syncQueueStatusComplete]',util[_0x2d6d('0x9d')](_0x5dc231,{'showHidden':![],'depth':null}));})[_0x2d6d('0x138')](function(){_0x39cd38[_0x2d6d('0xb8')](_0x39cd38[_0x2d6d('0x22')][_0x39cd38['actions'][_0x1a528a[_0x2d6d('0x12d')]][_0x2d6d('0xb6')]]);setTimeout(function(){_0x39cd38[_0x2d6d('0x24')][_0x11e398[_0x2d6d('0x12f')]][_0x2d6d('0x13a')]=!![];loggerBooked[_0x2d6d('0x82')](_0x2d6d('0x13d'),_0x1a528a['actionid'],'Agent:\x20',JSON[_0x2d6d('0x4a')](_[_0x2d6d('0xd3')](_0x39cd38[_0x2d6d('0x24')][_0x11e398[_0x2d6d('0x12f')]],[_0x2d6d('0x42'),_0x2d6d('0x13a')])),'contactAgent-idHopper:\x20',JSON['stringify'](_0x11e398[_0x2d6d('0x132')]));},0xc7);delete _0x39cd38[_0x2d6d('0x27')][_0x1a528a[_0x2d6d('0x12d')]];unlockQueueStatus(_0x1e6c35,_0x1a528a[_0x2d6d('0x12d')]);});}else{loggerBooked[_0x2d6d('0x82')](_0x2d6d('0x13e'));this[_0x2d6d('0xb8')](this[_0x2d6d('0x22')][this[_0x2d6d('0x27')][_0x1a528a[_0x2d6d('0x12d')]]['queue']]);this[_0x2d6d('0xc6')]({'active':![],'ContactId':this[_0x2d6d('0x27')][_0x1a528a['actionid']][_0x2d6d('0xd4')],'ListId':this[_0x2d6d('0x27')][_0x1a528a[_0x2d6d('0x12d')]][_0x2d6d('0xd5')],'VoiceQueueId':this[_0x2d6d('0x27')][_0x1a528a[_0x2d6d('0x12d')]][_0x2d6d('0xd6')]||undefined,'CampaignId':this[_0x2d6d('0x27')][_0x1a528a['actionid']]['CampaignId']||undefined})[_0x2d6d('0xbc')](loggerCatch('[unlock][syncQueueStatusComplete]'));delete this[_0x2d6d('0x27')][_0x1a528a[_0x2d6d('0x12d')]];unlockQueueStatus(_0x1e6c35);}}else{loggerBooked[_0x2d6d('0x82')](_0x2d6d('0x13f'));this[_0x2d6d('0xb8')](this[_0x2d6d('0x22')][this[_0x2d6d('0x27')][_0x1a528a[_0x2d6d('0x12d')]][_0x2d6d('0xb6')]]);this['rescheduleContact']({'active':![],'ContactId':this[_0x2d6d('0x27')][_0x1a528a[_0x2d6d('0x12d')]][_0x2d6d('0xd4')],'ListId':this['actions'][_0x1a528a[_0x2d6d('0x12d')]][_0x2d6d('0xd5')],'VoiceQueueId':this['actions'][_0x1a528a[_0x2d6d('0x12d')]][_0x2d6d('0xd6')]||undefined,'CampaignId':this[_0x2d6d('0x27')][_0x1a528a[_0x2d6d('0x12d')]][_0x2d6d('0xd7')]||undefined})[_0x2d6d('0xbc')](loggerCatch(_0x2d6d('0x140')));delete this[_0x2d6d('0x27')][_0x1a528a['actionid']];unlockQueueStatus(_0x1e6c35);}}else{loggerBooked[_0x2d6d('0x82')](_0x2d6d('0x141'));this[_0x2d6d('0xb8')](this[_0x2d6d('0x22')][this['actions'][_0x1a528a[_0x2d6d('0x12d')]][_0x2d6d('0xb6')]]);this[_0x2d6d('0xc6')]({'active':![],'ContactId':this[_0x2d6d('0x27')][_0x1a528a[_0x2d6d('0x12d')]][_0x2d6d('0xd4')],'ListId':this['actions'][_0x1a528a['actionid']][_0x2d6d('0xd5')],'VoiceQueueId':this[_0x2d6d('0x27')][_0x1a528a['actionid']][_0x2d6d('0xd6')]||undefined,'CampaignId':this[_0x2d6d('0x27')][_0x1a528a[_0x2d6d('0x12d')]]['CampaignId']||undefined})[_0x2d6d('0xbc')](loggerCatch(_0x2d6d('0x142')));delete this['actions'][_0x1a528a[_0x2d6d('0x12d')]];unlockQueueStatus(_0x1e6c35);}};Dialer[_0x2d6d('0xaf')][_0x2d6d('0x3d')]=function(){var _0x429004=this;return BPromise[_0x2d6d('0xbb')]()[_0x2d6d('0x3e')](cmHopper[_0x2d6d('0x143')]({}))[_0x2d6d('0x3e')](function(){setInterval(function(){_0x429004[_0x2d6d('0x144')]();},0x3e8);});};Dialer[_0x2d6d('0xaf')]['checkIsTrunkReachable']=function(_0x3788e7){var _0x239123=this;return function(){if(!_0x239123[_0x2d6d('0xd9')](_0x3788e7[_0x2d6d('0x78')])){if(!_0x239123[_0x2d6d('0xd9')](_0x3788e7[_0x2d6d('0x145')])){_0x3788e7[_0x2d6d('0x40')]=_0x2d6d('0x146');throw _0x3788e7[_0x2d6d('0x42')]+_0x2d6d('0x147');}}};};Dialer[_0x2d6d('0xaf')][_0x2d6d('0x148')]=function(_0x4c0532,_0x4c0d18,_0xb02567,_0x143f3a){var _0x5b8c87=this;return function(){var _0x10c09e=!![];return _0x5b8c87[_0x2d6d('0x149')](_0x4c0532,_0x4c0d18,_0xb02567,_0x143f3a,_0x10c09e);};};Dialer[_0x2d6d('0xaf')][_0x2d6d('0x14a')]=function(_0x461ccd,_0x2c08b2,_0x535339,_0x402655){var _0x16a39c=this;return function(){var _0x181b71=![];return _0x16a39c[_0x2d6d('0x149')](_0x461ccd['Intervals'],_0x2c08b2,_0x535339,_0x402655,_0x181b71);};};Dialer['prototype'][_0x2d6d('0x149')]=function(_0x2a38d3,_0x169133,_0x25948f,_0x596610,_0x31b915){var _0x55ced3=[];return new BPromise(function(_0x252626,_0x24d50f){if(!isNotNull(_0x2a38d3)){_0x596610[_0x2d6d('0x40')]='INTERVAL_IS_NULL';return _0x24d50f(msgResponse(_0x2d6d('0x149'),_0x2d6d('0x14b'),_0x25948f+'\x20Intervals\x20is\x20null\x20'));}if(_['isEmpty'](_0x2a38d3)){_0x596610[_0x2d6d('0x40')]=_0x2d6d('0x14c');return _0x24d50f(msgResponse(_0x2d6d('0x149'),_0x2d6d('0x14b'),_0x25948f+_0x2d6d('0x14d')));}if(_0x169133&&_[_0x2d6d('0x8b')](config[_0x2d6d('0x14e')][_0x169133])){_0x596610['message']='TIMEZONE_UNKNOW';return _0x24d50f(msgResponse(_0x2d6d('0x149'),_0x2d6d('0x14b'),_0x25948f+_0x2d6d('0x14f')+_0x169133));}if(_[_0x2d6d('0x150')](_0x2a38d3)){for(var _0x4e8ff8=0x0;_0x4e8ff8<_0x2a38d3[_0x2d6d('0x9e')];_0x4e8ff8+=0x1){_0x55ced3[_0x2d6d('0x131')](ami[_0x2d6d('0x151')]({'action':_0x2d6d('0x152'),'command':util['format'](_0x2d6d('0x153'),_0x2a38d3[_0x4e8ff8][_0x2d6d('0x154')],!_[_0x2d6d('0x8b')](config[_0x2d6d('0x14e')][_0x169133])?_0x169133:'')})[_0x2d6d('0x3e')](function(_0x4e6bed){return _0x4e6bed[_0x2d6d('0x155')][_0x2d6d('0x156')](_0x2d6d('0x157'))>=0x0;})[_0x2d6d('0xbc')](myreject(_0x24d50f)));}}else{_0x55ced3[_0x2d6d('0x131')](ami[_0x2d6d('0x151')]({'action':_0x2d6d('0x152'),'command':util[_0x2d6d('0x7c')](_0x2d6d('0x153'),_0x2a38d3,!_['isUndefined'](config[_0x2d6d('0x14e')][_0x169133])?_0x169133:'')})[_0x2d6d('0x3e')](function(_0x394311){return _0x394311[_0x2d6d('0x155')]['indexOf']('true')>=0x0;})[_0x2d6d('0xbc')](myreject(_0x24d50f)));}BPromise[_0x2d6d('0x158')](_0x55ced3)[_0x2d6d('0x3e')](function(_0x33e0b7){var _0x351794=_[_0x2d6d('0x159')](_0x33e0b7);if(_0x351794){return _0x252626(_0x351794);}else{_0x596610['message']=_0x31b915?_0x2d6d('0x15a'):_0x2d6d('0x15b');return _0x24d50f(msgResponse('[ifTime][promiseAll]',_0x2d6d('0x14b'),_0x2d6d('0x15c')+_0x31b915+'\x20'+_0x25948f+_0x2d6d('0x15d')+util[_0x2d6d('0x9d')](_0x2a38d3,{'showHidden':![],'depth':null})+_0x2d6d('0x15e')+_0x169133));}})[_0x2d6d('0xbc')](function(_0x3bbbfd){return _0x24d50f(msgResponse(_0x2d6d('0x149'),'Failure',JSON[_0x2d6d('0x4a')](_0x3bbbfd)));});});};Dialer[_0x2d6d('0xaf')][_0x2d6d('0x15f')]=function(_0x154113){var _0x138775=this;return function(){switch(_0x154113['dialMethod']){case _0x2d6d('0x160'):freeVariablesPredictive(_0x154113);_0x138775[_0x2d6d('0x161')](_0x154113,0x1);break;case _0x2d6d('0x162'):freeVariablesPredictive(_0x154113);_0x138775[_0x2d6d('0x161')](_0x154113,_0x154113['dialPowerLevel']);break;case'predictive':_0x138775[_0x2d6d('0x9')](_0x154113);break;case'booked':freeVariablesPredictive(_0x154113);_0x138775[_0x2d6d('0x161')](_0x154113,0x1);break;default:freeVariablesPredictive(_0x154113);logger[_0x2d6d('0x9c')](_0x2d6d('0x163'),_0x154113[_0x2d6d('0x42')],_0x2d6d('0x164'));}};};Dialer[_0x2d6d('0xaf')][_0x2d6d('0x165')]=function(_0x30301c){return BPromise[_0x2d6d('0xbb')]()[_0x2d6d('0x3e')](cmHopper[_0x2d6d('0x166')](_0x30301c['id'],previewRecallmeReminderInterval))['then'](function(_0x434a6e){for(var _0x58acfb=0x0;_0x58acfb<_0x434a6e['length'];_0x58acfb++){var _0x20ec52=_0x434a6e[_0x58acfb][_0x2d6d('0x167')]['name'];if(_0x20ec52)io['to'](util[_0x2d6d('0x7c')](_0x2d6d('0x168'),_0x20ec52))['emit'](_0x2d6d('0x169'),{'hopper':_0x434a6e[_0x58acfb]});}})[_0x2d6d('0xbc')](function(_0x2dc4f4){});};Dialer[_0x2d6d('0xaf')][_0x2d6d('0x16a')]=function(_0x4bb5cb){var _0x3198c2=this;return function(){_0x3198c2[_0x2d6d('0x16b')](_0x4bb5cb);};};Dialer[_0x2d6d('0xaf')][_0x2d6d('0xb')]=function(_0x103386){var _0x38bdd7=this;if(isNotPreview(_0x103386[_0x2d6d('0x16c')])){if(isVoiceQueueOutbound(_0x103386[_0x2d6d('0x4f')])&&isActive(_0x103386[_0x2d6d('0x5d')])){_0x103386[_0x2d6d('0xa7')]=!![];BPromise[_0x2d6d('0xbb')]()[_0x2d6d('0x3e')](checkIsLoggedIn(_0x103386,_0x103386[_0x2d6d('0x54')]))[_0x2d6d('0x3e')](checkIsActive(_0x103386,_0x103386['dialActive']))[_0x2d6d('0x3e')](checkInterval(_0x103386))[_0x2d6d('0x3e')](_0x38bdd7['checkIsTrunkReachable'](_0x103386))[_0x2d6d('0x3e')](_0x38bdd7['checkIfTime'](_0x103386[_0x2d6d('0x16d')],_0x103386[_0x2d6d('0x16e')],_0x103386['name'],_0x103386))[_0x2d6d('0x3e')](_0x38bdd7[_0x2d6d('0x14a')](_0x103386['Interval'],_0x103386[_0x2d6d('0x16e')],_0x103386[_0x2d6d('0x42')],_0x103386))[_0x2d6d('0x3e')](_0x38bdd7['checkDialMethod'](_0x103386))[_0x2d6d('0xbc')](loggerCatchQueueSummary(_0x2d6d('0x16f'),_0x103386));}else{notSendMessagesQueue(_0x103386);}}else{freeVariablesPredictive(_0x103386);if(_0x103386[_0x2d6d('0x170')]){_0x38bdd7[_0x2d6d('0x165')](_0x103386);}}};Dialer[_0x2d6d('0xaf')][_0x2d6d('0x144')]=function(){var _0x168df7=this;var _0x407bac;for(var _0x4678f7 in this[_0x2d6d('0x23')]){if(typeof this['campaigns'][_0x4678f7]!==_0x2d6d('0x9f')){_0x407bac=this[_0x2d6d('0x23')][_0x4678f7];if(isCampaignIvr(_0x407bac[_0x2d6d('0x4f')])&&isActive(_0x407bac[_0x2d6d('0x79')])){_0x407bac[_0x2d6d('0xa7')]=!![];BPromise[_0x2d6d('0xbb')]()[_0x2d6d('0x3e')](checkIsActive(_0x407bac,_0x407bac[_0x2d6d('0x79')]))['then'](checkInterval(_0x407bac))[_0x2d6d('0x3e')](_0x168df7[_0x2d6d('0x171')](_0x407bac))[_0x2d6d('0x3e')](_0x168df7[_0x2d6d('0x148')](_0x407bac['dialGlobalInterval'],_0x407bac[_0x2d6d('0x16e')],_0x407bac[_0x2d6d('0x42')],_0x407bac))[_0x2d6d('0x3e')](_0x168df7[_0x2d6d('0x14a')](_0x407bac[_0x2d6d('0x45')],_0x407bac[_0x2d6d('0x16e')],_0x407bac[_0x2d6d('0x42')],_0x407bac))[_0x2d6d('0x3e')](_0x168df7[_0x2d6d('0x16a')](_0x407bac))[_0x2d6d('0xbc')](loggerCatchQueueSummary('[syncCampaigns]',_0x407bac));}else{notSendMessagesCampaign(_0x407bac);}}}};function getCallerIdRandom(_0x2c009d,_0x50df2c){var _0x4b7fee;var _0x1f6f1a;var _0x5bfbe2;if(_0x50df2c<=0x0){_0x50df2c=0x1;}_0x4b7fee=new RegExp('\x5cw{0,'+_0x50df2c+'}$');_0x1f6f1a=Math[_0x2d6d('0x172')](0xa,_0x50df2c-0x1);_0x5bfbe2=Math[_0x2d6d('0x172')](0xa,_0x50df2c)-0x1;return util[_0x2d6d('0x7c')]('%s',_['replace'](_0x2c009d,_0x4b7fee,_[_0x2d6d('0x173')](_0x1f6f1a,_0x5bfbe2)));}function extractCalleridName(_0x4b9d88){var _0x109996=_0x4b9d88[_0x2d6d('0x174')](/"(.*?)"/);return _0x109996?_0x109996[0x1]:_0x4b9d88;}function extractCalleridNumber(_0x5ad159){var _0x2a7da3=_0x5ad159['match'](/<(.*?)>/);return _0x2a7da3?_0x2a7da3[0x1]:_0x5ad159;}Dialer[_0x2d6d('0xaf')]['actionOriginate']=function(_0x1b1497,_0xf29346){var _0x4124ba=this;var _0x12bc49=uuid['v4']();this[_0x2d6d('0x27')][_0x12bc49]=new Action(_0x1b1497,_0xf29346,_0x12bc49);return new BPromise(function(_0xa6957c,_0x512e3a){if(_[_0x2d6d('0x8b')](_0x1b1497)&&typeof _0x1b1497!==_0x2d6d('0x175')){return _0x512e3a(msgResponse(_0x2d6d('0x176'),'Failure',_0x2d6d('0x177')));}if(_[_0x2d6d('0x8b')](_0xf29346[_0x2d6d('0x178')])||_0xf29346[_0x2d6d('0x178')]===null){return _0x512e3a(msgResponse(_0x2d6d('0x176'),'Failure',_0x2d6d('0x179')));}var _0x361cf7={'XMD-CALLERID':_0x4124ba['actions'][_0x12bc49][_0x2d6d('0x17a')](),'XMD-AGI':_0x1b1497['dialQueueProject']?util[_0x2d6d('0x7c')](_0x2d6d('0x17b'),ipAgi,_0x1b1497[_0x2d6d('0x10a')]):_0x2d6d('0x17c'),'XMD-AGIAFTER':_0x1b1497['dialQueueProject2']?util[_0x2d6d('0x7c')](_0x2d6d('0x17b'),ipAgi,_0x1b1497[_0x2d6d('0x10f')]):_0x2d6d('0x17c'),'XMD-QUEUE':_0x1b1497['type']==='outbound'?util[_0x2d6d('0x7c')](_0x2d6d('0x17d'),_0x1b1497[_0x2d6d('0x42')],_0x1b1497[_0x2d6d('0x17e')]||'',_0x1b1497[_0x2d6d('0x110')]?'c':'',_0x1b1497[_0x2d6d('0x11a')]||0x3):_0x2d6d('0x17c'),'XMD-CONTACTID':_0xf29346[_0x2d6d('0xd4')],'XMD-CDRTYPE':_0x2d6d('0x7'),'CALLERID(all)':_0x4124ba[_0x2d6d('0x27')][_0x12bc49][_0x2d6d('0x17a')](),'XMD-AMD':_0x1b1497[_0x2d6d('0xe3')]?_0x2d6d('0x17f'):_0x2d6d('0x17c'),'XMD-DESTINATION':'xcally-motion-dialer'};if(_0x1b1497[_0x2d6d('0xe3')]){_0x361cf7[_0x2d6d('0x180')]=_0x1b1497[_0x2d6d('0x181')]||0x9c4;_0x361cf7['XMD-AMDGREETING']=_0x1b1497[_0x2d6d('0x182')]||0x5dc;_0x361cf7[_0x2d6d('0x183')]=_0x1b1497['dialAMDAfterGreetingSilence']||0x320;_0x361cf7[_0x2d6d('0x184')]=_0x1b1497[_0x2d6d('0x185')]||0x1388;_0x361cf7[_0x2d6d('0x186')]=_0x1b1497[_0x2d6d('0x187')]||0x64;_0x361cf7['XMD-AMDBETWEENWORDSSILENCE']=_0x1b1497[_0x2d6d('0x188')]||0x32;_0x361cf7[_0x2d6d('0x189')]=_0x1b1497[_0x2d6d('0x18a')]||0x3;_0x361cf7[_0x2d6d('0x18b')]=_0x1b1497[_0x2d6d('0x18c')]||0x100;_0x361cf7[_0x2d6d('0x18d')]=_0x1b1497[_0x2d6d('0x18e')]||0x1388;}if(_0x1b1497[_0x2d6d('0x4f')]==='outbound'){_0x361cf7[_0x2d6d('0x18f')]=_0xf29346[_0x2d6d('0xd6')];}else{_0x361cf7[_0x2d6d('0x190')]=_0xf29346[_0x2d6d('0xd7')];}for(var _0x34261f in _0xf29346[_0x2d6d('0x191')]){if(typeof _0xf29346[_0x2d6d('0x191')][_0x34261f]!==_0x2d6d('0x9f')){if(isNotNull(_0xf29346[_0x2d6d('0x191')][_0x34261f])&&_0x34261f!=='id'&&_0x34261f!==_0x2d6d('0x192')&&_0x34261f!==_0x2d6d('0x193')&&_0x34261f!==_0x2d6d('0x194')){_0x361cf7[util[_0x2d6d('0x7c')]('%s%s',_0x2d6d('0x195'),_['toUpper'](_0x34261f))]=_0xf29346[_0x2d6d('0x191')][_0x34261f];}}}var _0x299e00=_0x4124ba[_0x2d6d('0xd9')](_0x1b1497[_0x2d6d('0x78')])?getCallerId(_0x1b1497[_0x2d6d('0x78')][_0x2d6d('0x7a')],_0x1b1497[_0x2d6d('0x5e')],_0x1b1497[_0x2d6d('0x196')]>0x0?getCallerIdRandom(_0x1b1497['dialOriginateCallerIdNumber'],_0x1b1497[_0x2d6d('0x196')]):_0x1b1497[_0x2d6d('0x5f')]):getCallerId(_['isNil'](_0x1b1497['TrunkBackup'])?_0x1b1497['Trunk'][_0x2d6d('0x7a')]:_0x1b1497['TrunkBackup'][_0x2d6d('0x7a')],_0x1b1497[_0x2d6d('0x5e')],_0x1b1497[_0x2d6d('0x196')]>0x0?getCallerIdRandom(_0x1b1497[_0x2d6d('0x5f')],_0x1b1497[_0x2d6d('0x196')]):_0x1b1497[_0x2d6d('0x5f')]);if(_0x299e00){_0x361cf7[_0x2d6d('0x197')]=_0x4124ba['actions'][_0x12bc49]['originatecalleridname']=extractCalleridName(_0x299e00);_0x361cf7['XMD-ORIGINATECALLERIDNUM']=_0xf29346[_0x2d6d('0x178')];}return ami[_0x2d6d('0x151')]({'actionid':_0x12bc49,'action':_0x2d6d('0x176'),'channel':_0x4124ba[_0x2d6d('0xd9')](_0x1b1497[_0x2d6d('0x78')])?util['format'](_0x2d6d('0x198'),_0x1b1497['Trunk'][_0x2d6d('0x42')],isNotNull(_0x1b1497['dialPrefix'])?_0x1b1497[_0x2d6d('0x61')]['trim']()||'':'',_0x1b1497['dialCutDigit']>0x0?_0xf29346[_0x2d6d('0x178')][_0x2d6d('0x199')](_0x1b1497[_0x2d6d('0x19a')]):_0xf29346[_0x2d6d('0x178')]):util['format'](_0x2d6d('0x198'),_[_0x2d6d('0xdf')](_0x1b1497[_0x2d6d('0x145')])?_0x1b1497['Trunk'][_0x2d6d('0x42')]:_0x1b1497[_0x2d6d('0x145')]['name'],isNotNull(_0x1b1497['dialPrefix'])?_0x1b1497[_0x2d6d('0x61')][_0x2d6d('0x19b')]()||'':'',_0x1b1497['dialCutDigit']>0x0?_0xf29346[_0x2d6d('0x178')][_0x2d6d('0x199')](_0x1b1497[_0x2d6d('0x19a')]):_0xf29346[_0x2d6d('0x178')]),'callerid':_0x299e00,'Exten':_0x2d6d('0xe2'),'Context':'from-sip','Priority':'1','variable':_0x361cf7,'timeout':(_0x1b1497[_0x2d6d('0x60')]||0x1e)*0x3e8,'async':!![],'channelid':_0x12bc49})[_0x2d6d('0x3e')](function(_0x5ea8a5){return _0xa6957c(_0x5ea8a5);})['catch'](function(_0xe67c79){_0x1b1497[_0x2d6d('0x69')]+=0x1;var _0xd4ba06=new History(_0x4124ba[_0x2d6d('0x27')][_0x12bc49]);logger[_0x2d6d('0x9c')](util[_0x2d6d('0x7c')](_0x2d6d('0x19c'),JSON[_0x2d6d('0x4a')](_0xe67c79)));_0xd4ba06['state']=0xe;_0xd4ba06[_0x2d6d('0xae')]='OriginateError';_0xd4ba06['starttime']=moment()[_0x2d6d('0x7c')](_0x2d6d('0x100'));_0xd4ba06[_0x2d6d('0x124')]=_0xd4ba06['starttime'];_0x4124ba[_0x2d6d('0xd0')](_0xd4ba06)['catch'](loggerCatch('[originate][error]'));_0x4124ba[_0x2d6d('0xcf')](_0xd4ba06)['catch'](loggerCatch(_0x2d6d('0x19d')))[_0x2d6d('0x138')](function(){delete _0x4124ba[_0x2d6d('0x27')][_0x12bc49];return _0x512e3a(msgResponse(_0x2d6d('0x176'),_0x2d6d('0x19e'),_0x2d6d('0x19f')));});});});};Dialer[_0x2d6d('0xaf')][_0x2d6d('0x31')]=function(_0x186805){var _0xbf4f37=this[_0x2d6d('0x27')][_0x186805[_0x2d6d('0x12d')]];if(_0xbf4f37){delete this[_0x2d6d('0x27')][_0x186805[_0x2d6d('0x12d')]];_0xbf4f37[_0x2d6d('0x119')]=moment()[_0x2d6d('0x7c')](_0x2d6d('0x100'));var _0x87ce02=_0xbf4f37['type']===_0x2d6d('0x7e')?this[_0x2d6d('0x23')][_0xbf4f37[_0x2d6d('0xb6')]]:this['voiceQueues'][_0xbf4f37[_0x2d6d('0x1a0')]()];if(!this[_0x2d6d('0xd8')](_0x186805[_0x2d6d('0x1a1')])){this[_0x2d6d('0xb8')](_0x87ce02);return this[_0x2d6d('0x1a2')](_0xbf4f37,_0x87ce02,_0x186805)[_0x2d6d('0xbc')](loggerCatch(_0x2d6d('0x1a3')));}this[_0x2d6d('0x29')][_0x186805[_0x2d6d('0xde')]]=_0xbf4f37;}};Dialer['prototype'][_0x2d6d('0x1a4')]=function(_0x269601,_0xcef559,_0x4103f4){var _0xbfc3c5=new History(_0xcef559);if(_0xbfc3c5[_0x2d6d('0xf4')]+_0xbfc3c5[_0x2d6d('0xf5')]+_0xbfc3c5['countnoanswerretry']+_0xbfc3c5[_0x2d6d('0xf7')]+_0xbfc3c5[_0x2d6d('0xf8')]+_0xbfc3c5['countabandonedretry']+_0xbfc3c5[_0x2d6d('0xf2')]+_0xbfc3c5['countagentrejectretry']>=_0x4103f4['dialGlobalMaxRetry']-0x1){return!![];}switch(_0x269601){case 0x3:if(_0xbfc3c5['countnoanswerretry']>=_0x4103f4[_0x2d6d('0x1a5')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countnoanswerretry':_0xbfc3c5[_0x2d6d('0xf6')]+=0x1,'scheduledat':moment()['add'](_0x4103f4['dialNoAnswerRetryFrequency'],_0x2d6d('0xff'))[_0x2d6d('0x7c')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0xbfc3c5['ContactId'],'ListId':_0xbfc3c5['ListId'],'VoiceQueueId':_0xbfc3c5[_0x2d6d('0xd6')]||undefined,'CampaignId':_0xbfc3c5[_0x2d6d('0xd7')]||undefined})[_0x2d6d('0xbc')](loggerCatch(_0x2d6d('0x1a6')));break;case 0x5:if(_0xbfc3c5[_0x2d6d('0xf4')]>=_0x4103f4[_0x2d6d('0x1a7')]-0x1){return!![];}this[_0x2d6d('0xc6')]({'active':![],'countbusyretry':_0xbfc3c5['countbusyretry']+=0x1,'scheduledat':moment()[_0x2d6d('0x107')](_0x4103f4[_0x2d6d('0x1a8')],'minutes')['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0xbfc3c5[_0x2d6d('0xd4')],'ListId':_0xbfc3c5[_0x2d6d('0xd5')],'VoiceQueueId':_0xbfc3c5[_0x2d6d('0xd6')]||undefined,'CampaignId':_0xbfc3c5[_0x2d6d('0xd7')]||undefined})[_0x2d6d('0xbc')](loggerCatch(_0x2d6d('0x1a9')));break;case 0x8:if(_0xbfc3c5[_0x2d6d('0xf5')]>=_0x4103f4[_0x2d6d('0x1aa')]-0x1){return!![];}this[_0x2d6d('0xc6')]({'active':![],'countcongestionretry':_0xbfc3c5[_0x2d6d('0xf5')]+=0x1,'scheduledat':moment()[_0x2d6d('0x107')](_0x4103f4[_0x2d6d('0x1ab')],_0x2d6d('0xff'))[_0x2d6d('0x7c')](_0x2d6d('0x100')),'ContactId':_0xbfc3c5['ContactId'],'ListId':_0xbfc3c5[_0x2d6d('0xd5')],'VoiceQueueId':_0xbfc3c5[_0x2d6d('0xd6')]||undefined,'CampaignId':_0xbfc3c5[_0x2d6d('0xd7')]||undefined})[_0x2d6d('0xbc')](loggerCatch(_0x2d6d('0x1ac')));break;case 0x0:if(_0xbfc3c5['countnosuchnumberretry']>=_0x4103f4[_0x2d6d('0x1ad')]-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countnosuchnumberretry':_0xbfc3c5['countnosuchnumberretry']+=0x1,'scheduledat':moment()[_0x2d6d('0x107')](_0x4103f4[_0x2d6d('0x1ae')],_0x2d6d('0xff'))[_0x2d6d('0x7c')](_0x2d6d('0x100')),'ContactId':_0xbfc3c5[_0x2d6d('0xd4')],'ListId':_0xbfc3c5[_0x2d6d('0xd5')],'VoiceQueueId':_0xbfc3c5['VoiceQueueId']||undefined,'CampaignId':_0xbfc3c5[_0x2d6d('0xd7')]||undefined})[_0x2d6d('0xbc')](loggerCatch(_0x2d6d('0x1af')));}break;case 0xa:if(_0xbfc3c5[_0x2d6d('0xf8')]>=_0x4103f4['dialDropMaxRetry']-0x1){return!![];}this[_0x2d6d('0xc6')]({'active':![],'countdropretry':_0xbfc3c5[_0x2d6d('0xf8')]+=0x1,'scheduledat':moment()[_0x2d6d('0x107')](_0x4103f4['dialDropRetryFrequency'],_0x2d6d('0xff'))[_0x2d6d('0x7c')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0xbfc3c5['ContactId'],'ListId':_0xbfc3c5[_0x2d6d('0xd5')],'VoiceQueueId':_0xbfc3c5['VoiceQueueId']||undefined,'CampaignId':_0xbfc3c5['CampaignId']||undefined})[_0x2d6d('0xbc')](loggerCatch(_0x2d6d('0x121')));break;case 0xb:if(_0xbfc3c5[_0x2d6d('0xf9')]>=_0x4103f4[_0x2d6d('0x1b0')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countabandonedretry':_0xbfc3c5[_0x2d6d('0xf9')]+=0x1,'scheduledat':moment()['add'](_0x4103f4[_0x2d6d('0x129')],'minutes')['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0xbfc3c5[_0x2d6d('0xd4')],'ListId':_0xbfc3c5[_0x2d6d('0xd5')],'VoiceQueueId':_0xbfc3c5[_0x2d6d('0xd6')]||undefined,'CampaignId':_0xbfc3c5[_0x2d6d('0xd7')]||undefined})['catch'](loggerCatch(_0x2d6d('0x12b')));break;case 0x13:if(_0xbfc3c5['countmachineretry']>=_0x4103f4[_0x2d6d('0x105')]-0x1){return!![];}this[_0x2d6d('0xc6')]({'active':![],'countmachineretry':_0xbfc3c5[_0x2d6d('0xf2')]+=0x1,'scheduledat':moment()[_0x2d6d('0x107')](_0x4103f4[_0x2d6d('0x1b1')],_0x2d6d('0xff'))[_0x2d6d('0x7c')](_0x2d6d('0x100')),'ContactId':_0xbfc3c5['ContactId'],'ListId':_0xbfc3c5[_0x2d6d('0xd5')],'VoiceQueueId':_0xbfc3c5[_0x2d6d('0xd6')]||undefined,'CampaignId':_0xbfc3c5[_0x2d6d('0xd7')]||undefined})['catch'](loggerCatch('[rescheduleContact][Machine]'));break;case 0x14:if(_0xbfc3c5['countagentrejectretry']>=_0x4103f4[_0x2d6d('0x1b2')]-0x1){return!![];}this[_0x2d6d('0xc6')]({'active':![],'countagentrejectretry':_0xbfc3c5['countagentrejectretry']+=0x1,'scheduledat':moment()['add'](_0x4103f4[_0x2d6d('0x1b3')],_0x2d6d('0xff'))[_0x2d6d('0x7c')](_0x2d6d('0x100')),'ContactId':_0xbfc3c5[_0x2d6d('0xd4')],'ListId':_0xbfc3c5['ListId'],'VoiceQueueId':_0xbfc3c5['VoiceQueueId']||undefined,'CampaignId':_0xbfc3c5[_0x2d6d('0xd7')]||undefined})[_0x2d6d('0xbc')](loggerCatch(_0x2d6d('0x1b4')));break;default:return!![];}};Dialer[_0x2d6d('0xaf')][_0x2d6d('0x1a2')]=function(_0x35be60,_0x54cea5,_0x87a75e){var _0x515f91=this;var _0xa01b35=new History(_0x35be60);var _0x27593c=![];var _0x8c0755;var _0x375577;return new BPromise(function(_0x4c89f2,_0x543edb){if(_[_0x2d6d('0x8b')](_0x54cea5)&&typeof _0x54cea5!==_0x2d6d('0x175')){return _0x543edb(msgResponse(_0x2d6d('0x1b5'),_0x2d6d('0x14b'),_0x2d6d('0x1b6')));}if(_[_0x2d6d('0x8b')](_0x87a75e)&&typeof _0x87a75e!==_0x2d6d('0x175')){return _0x543edb(msgResponse('[callProgressDetecting]','Failure',_0x2d6d('0x1b7')));}_0x515f91[_0x2d6d('0xc0')](_0xa01b35,_0x87a75e[_0x2d6d('0x1b8')],_0x54cea5)[_0x2d6d('0x3e')](function(_0x25770e){if(_0x25770e['additional']==0x1)_0x27593c=!![];switch(_0x87a75e[_0x2d6d('0x1b8')]){case'0':_0x54cea5[_0x2d6d('0x68')]+=0x1;_0xa01b35[_0x2d6d('0xe6')]=0x0;_0xa01b35[_0x2d6d('0xae')]=_0x2d6d('0x1b9');_0xa01b35[_0x2d6d('0xf7')]+=0x1;_0xa01b35['countglobal']+=0x1;ami[_0x2d6d('0x4e')](_0x2d6d('0x1ba'),ut[_0x2d6d('0xeb')](_0x35be60,_0x2d6d('0x1bb')));_0x8c0755=_0x54cea5[_0x2d6d('0x1ae')];_0x375577=_0x54cea5['callAdditionalPhoneAfterMin'];_0x515f91[_0x2d6d('0xd0')](_0xa01b35)[_0x2d6d('0xbc')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x515f91['checkRetriveMax'](0x0,_0x35be60,_0x54cea5)&&!_0x27593c){if(_0xa01b35[_0x2d6d('0xf7')]>=_0x54cea5[_0x2d6d('0x1ad')]){_0x515f91[_0x2d6d('0x106')](_0xa01b35,_0x4c89f2,_0x543edb,_0x2d6d('0x1bc'));}else{_0x515f91[_0x2d6d('0xfc')](_0xa01b35,_0x4c89f2,_0x543edb,'reason\x200\x20no\x20such\x20number....');}}break;case'3':_0x54cea5[_0x2d6d('0x1bd')]+=0x1;_0xa01b35[_0x2d6d('0xe6')]=0x3;_0xa01b35[_0x2d6d('0xae')]=_0x2d6d('0x1be');_0xa01b35[_0x2d6d('0xf6')]+=0x1;_0xa01b35[_0x2d6d('0x104')]+=0x1;ami[_0x2d6d('0x4e')](_0x2d6d('0x1bf'),ut[_0x2d6d('0xeb')](_0x35be60,_0x2d6d('0x1c0')));_0x8c0755=_0x54cea5[_0x2d6d('0x1c1')];_0x375577=_0x54cea5[_0x2d6d('0x11e')];_0x515f91['createHistory'](_0xa01b35)[_0x2d6d('0xbc')](loggerCatch('[syncAgentComplete][createHistory][3]'));if(_0x515f91[_0x2d6d('0x1a4')](0x3,_0x35be60,_0x54cea5)&&!_0x27593c){if(_0xa01b35['countnoanswerretry']>=_0x54cea5[_0x2d6d('0x1a5')]){_0x515f91[_0x2d6d('0x106')](_0xa01b35,_0x4c89f2,_0x543edb,_0x2d6d('0x1c2'));}else{_0x515f91[_0x2d6d('0xfc')](_0xa01b35,_0x4c89f2,_0x543edb,_0x2d6d('0x1c2'));}}break;case'5':_0x54cea5[_0x2d6d('0x64')]+=0x1;_0xa01b35[_0x2d6d('0xe6')]=0x5;_0xa01b35[_0x2d6d('0xae')]=_0x2d6d('0x1c3');_0xa01b35[_0x2d6d('0xf4')]+=0x1;_0xa01b35['countglobal']+=0x1;ami['emit'](_0x2d6d('0x1c4'),ut[_0x2d6d('0xeb')](_0x35be60,'busy'));_0x8c0755=_0x54cea5[_0x2d6d('0x1a8')];_0x375577=_0x54cea5[_0x2d6d('0x11e')];_0x515f91[_0x2d6d('0xd0')](_0xa01b35)[_0x2d6d('0xbc')](loggerCatch('[syncAgentComplete][createHistory][5]'));if(_0x515f91[_0x2d6d('0x1a4')](0x5,_0x35be60,_0x54cea5)&&!_0x27593c){if(_0xa01b35['countbusyretry']>=_0x54cea5[_0x2d6d('0x1a7')]){_0x515f91[_0x2d6d('0x106')](_0xa01b35,_0x4c89f2,_0x543edb,_0x2d6d('0x1c5'));}else{_0x515f91[_0x2d6d('0xfc')](_0xa01b35,_0x4c89f2,_0x543edb,_0x2d6d('0x1c5'));}}break;case'8':_0x54cea5['outboundCongestionCallsDay']+=0x1;_0xa01b35[_0x2d6d('0xe6')]=0x8;_0xa01b35['statedesc']=_0x2d6d('0x1c6');_0xa01b35['countcongestionretry']+=0x1;_0xa01b35[_0x2d6d('0x104')]+=0x1;_0x8c0755=_0x54cea5['dialCongestionRetryFrequency'];_0x375577=_0x54cea5[_0x2d6d('0x11e')];ami[_0x2d6d('0x4e')](_0x2d6d('0x1c7'),ut['buildObj'](_0x35be60,_0x2d6d('0x1c8')));_0x515f91['createHistory'](_0xa01b35)[_0x2d6d('0xbc')](loggerCatch(_0x2d6d('0x1c9')));if(_0x515f91['checkRetriveMax'](0x8,_0x35be60,_0x54cea5)&&!_0x27593c){if(_0xa01b35[_0x2d6d('0xf5')]>=_0x54cea5[_0x2d6d('0x1aa')]){_0x515f91[_0x2d6d('0x106')](_0xa01b35,_0x4c89f2,_0x543edb,_0x2d6d('0x1ca'));}else{_0x515f91['stateGlobal'](_0xa01b35,_0x4c89f2,_0x543edb,_0x2d6d('0x1ca'));}}break;case'11':_0x54cea5['outboundAbandonedCallsDay']+=0x1;_0xa01b35['state']=0xb;_0xa01b35[_0x2d6d('0xae')]=_0x2d6d('0x128');_0xa01b35[_0x2d6d('0xf9')]+=0x1;_0xa01b35[_0x2d6d('0x104')]+=0x1;_0x8c0755=_0x54cea5['dialAbandonedRetryFrequency'];_0x375577=_0x54cea5[_0x2d6d('0x11e')];_0x515f91[_0x2d6d('0xd0')](_0xa01b35)[_0x2d6d('0xbc')](loggerCatch('[syncAgentComplete][createHistory][11]'));if(_0x515f91[_0x2d6d('0x1a4')](0xb,_0x35be60,_0x54cea5)&&!_0x27593c){if(_0xa01b35[_0x2d6d('0xf9')]>=_0x54cea5[_0x2d6d('0x1b0')]){_0x515f91[_0x2d6d('0x106')](_0xa01b35,_0x4c89f2,_0x543edb,_0x2d6d('0x1cb'));}else{_0x515f91[_0x2d6d('0xfc')](_0xa01b35,_0x4c89f2,_0x543edb,_0x2d6d('0x1cb'));}}break;case'20':_0x54cea5['outboundRejectCallsDay']+=0x1;_0xa01b35[_0x2d6d('0xe6')]=0x14;_0xa01b35[_0x2d6d('0xae')]='AgentReject';_0xa01b35['countagentrejectretry']+=0x1;_0xa01b35[_0x2d6d('0x104')]+=0x1;_0x8c0755=_0x54cea5['dialAgentRejectRetryFrequency'];_0x375577=_0x54cea5['callAdditionalPhoneAfterMin'];ami[_0x2d6d('0x4e')](_0x2d6d('0x1cc'),ut[_0x2d6d('0xeb')](_0x35be60,_0x2d6d('0x1cd')));_0x515f91[_0x2d6d('0xd0')](_0xa01b35)[_0x2d6d('0xbc')](loggerCatch(_0x2d6d('0x1ce')));if(_0x515f91['checkRetriveMax'](0x14,_0x35be60,_0x54cea5)&&!_0x27593c){if(_0xa01b35[_0x2d6d('0xfa')]>=_0x54cea5[_0x2d6d('0x1b2')]){_0x515f91[_0x2d6d('0x106')](_0xa01b35,_0x4c89f2,_0x543edb,'reason\x2020\x20agentreject');}else{_0x515f91[_0x2d6d('0xfc')](_0xa01b35,_0x4c89f2,_0x543edb,_0x2d6d('0x1cf'));}}break;default:_0x54cea5[_0x2d6d('0x10c')]+=0x1;_0xa01b35['state']=0xc;_0xa01b35[_0x2d6d('0xae')]=_0x87a75e[_0x2d6d('0x1b8')];_0x8c0755=_0x54cea5['dialAgentRejectRetryFrequency'];_0x375577=_0x54cea5['callAdditionalPhoneAfterMin'];_0x515f91[_0x2d6d('0xd0')](_0xa01b35)[_0x2d6d('0xbc')](loggerCatch(_0x2d6d('0x1d0')));if(_0x515f91[_0x2d6d('0x1a4')](_0x87a75e['reason'],_0x35be60,_0x54cea5)&&!_0x27593c){if(_0xa01b35[_0x2d6d('0xf4')]+_0xa01b35[_0x2d6d('0xf5')]+_0xa01b35[_0x2d6d('0xf6')]+_0xa01b35[_0x2d6d('0xf7')]+_0xa01b35[_0x2d6d('0xf8')]+_0xa01b35[_0x2d6d('0xf9')]+_0xa01b35[_0x2d6d('0xf2')]+_0xa01b35[_0x2d6d('0xfa')]>=_0x54cea5[_0x2d6d('0xfb')]){_0x515f91[_0x2d6d('0xfc')](_0xa01b35,_0x4c89f2,_0x543edb,_0x87a75e[_0x2d6d('0x1b8')]);}else{_0x515f91[_0x2d6d('0x106')](_0xa01b35,_0x4c89f2,_0x543edb,_0x87a75e['reason']);}}}})[_0x2d6d('0x3e')](function(_0x1d64e3){if(_0x27593c){_0x515f91[_0x2d6d('0xc1')](_0xa01b35,_0x8c0755,_0x375577)[_0x2d6d('0x3e')](function(_0x4cfe6d){return _0x4c89f2(0x1);});}});});};Dialer[_0x2d6d('0xaf')][_0x2d6d('0xfc')]=function(_0x3ff96c,_0x179bce,_0x57b752,_0x4cb011){var _0x125292=new Final(_0x3ff96c);_0x125292[_0x2d6d('0xe6')]=0xf;_0x125292[_0x2d6d('0xae')]=_0x2d6d('0x1d1');this['createStateFinal'](_0x125292,_0x179bce,_0x57b752,_0x4cb011);};Dialer[_0x2d6d('0xaf')][_0x2d6d('0x106')]=function(_0x98b5d4,_0x22155f,_0x4a243b,_0x360d12){this[_0x2d6d('0xcf')](_0x98b5d4)[_0x2d6d('0x3e')](function(){return _0x22155f(msgResponse(_0x2d6d('0x1b5'),'Success',_0x360d12));})[_0x2d6d('0xbc')](function(){return _0x4a243b(msgResponse(_0x2d6d('0x1d2'),_0x2d6d('0x14b'),_0x2d6d('0x1d3')));});};Dialer[_0x2d6d('0xaf')][_0x2d6d('0x9')]=function(_0x1d7caf){var _0x38b439=_0x1d7caf[_0x2d6d('0x1d4')]/0x64;var _0x3e62d1=_0x1d7caf[_0x2d6d('0x67')]/(_0x1d7caf[_0x2d6d('0x67')]+_0x1d7caf[_0x2d6d('0xe5')]);var _0xc5e886=Math[_0x2d6d('0x1d5')](_0x1d7caf[_0x2d6d('0x1d6')]*(_0x1d7caf[_0x2d6d('0x1d7')]/0x64));var _0x3b25b0=Math[_0x2d6d('0x1d5')](_0x1d7caf[_0x2d6d('0x1d6')]*(_0x1d7caf[_0x2d6d('0x1d8')]/0x64));var _0x149b76=_0x1d7caf[_0x2d6d('0x53')]+_0x1d7caf[_0x2d6d('0x58')];var _0x38e59b=Math[_0x2d6d('0x1d9')](_0x1d7caf[_0x2d6d('0x74')]*_0x1d7caf['erlangAbandonmentRate']*_0x1d7caf[_0x2d6d('0x1da')]*_0x1d7caf[_0x2d6d('0x70')]);if(_[_0x2d6d('0x8b')](_0x1d7caf[_0x2d6d('0x2c')])){if(!_[_0x2d6d('0x8b')](_0x1d7caf[_0x2d6d('0x2b')])){_0x1d7caf['startPredictive']=undefined;loggerPredictive[_0x2d6d('0x9c')]('[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine');}if(!_[_0x2d6d('0x8b')](_0x1d7caf[_0x2d6d('0x97')])){loggerPredictive[_0x2d6d('0x9c')](_0x2d6d('0x1db'),_0x2d6d('0x1dc'));clearInterval(_0x1d7caf[_0x2d6d('0x97')]);_0x1d7caf[_0x2d6d('0x97')]=undefined;}_0x1d7caf[_0x2d6d('0x2c')]=moment()[_0x2d6d('0x7c')](_0x2d6d('0x100'));loggerPredictive[_0x2d6d('0x82')](_0x1d7caf[_0x2d6d('0x42')],_0x2d6d('0x1dd'),_0x1d7caf[_0x2d6d('0x2c')]);this[_0x2d6d('0x161')](_0x1d7caf,0x1);}else if(ifInterval(_0x1d7caf[_0x2d6d('0x1de')],_0x1d7caf[_0x2d6d('0x2c')])){this[_0x2d6d('0x161')](_0x1d7caf,0x1);loggerPredictiveCalls[_0x2d6d('0x82')](_0x2d6d('0x1df'),_0x1d7caf[_0x2d6d('0x2c')],_0x1d7caf[_0x2d6d('0x42')]);_0x1d7caf[_0x2d6d('0x74')]=0x0;_0x1d7caf[_0x2d6d('0x6f')]=0x0;}else if(_0x38b439<_0x3e62d1&&_0x1d7caf[_0x2d6d('0x1e0')]===_0x2d6d('0x1e1')){freeVariablesPredictive(_0x1d7caf);loggerPredictive[_0x2d6d('0x82')](_0x2d6d('0x1e2'),'Dropped\x20calls\x20day',_0x3e62d1,_0x2d6d('0x2c'),_0x1d7caf[_0x2d6d('0x42')]);}else if(_0x38e59b<_0x1d7caf['predictiveIntervalErlangCallsDroppedCalls']&&_0x1d7caf[_0x2d6d('0x1e0')]===_0x2d6d('0x1e1')){freeVariablesPredictive(_0x1d7caf);loggerPredictive[_0x2d6d('0x82')](_0x2d6d('0x1e3'),_0x2d6d('0x1e4'),_0x38e59b,'Drop\x20in\x20this\x20interval',_0x1d7caf[_0x2d6d('0x6f')],_0x2d6d('0x2c'),_0x1d7caf['name']);}else if(!ifInterval(_0x1d7caf[_0x2d6d('0x1de')],_0x1d7caf[_0x2d6d('0x2c')])&&_['isUndefined'](_0x1d7caf[_0x2d6d('0x2b')])&&!_[_0x2d6d('0x8b')](_0x1d7caf['startProgressive'])){_0x1d7caf[_0x2d6d('0x2b')]=moment()[_0x2d6d('0x7c')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x2d6d('0x82')](_0x1d7caf[_0x2d6d('0x42')],_0x2d6d('0x1e5'),_0x1d7caf['startPredictive']);this[_0x2d6d('0x1e6')](_0x1d7caf[_0x2d6d('0x1de')])['then'](this[_0x2d6d('0x1e7')](_0x1d7caf))[_0x2d6d('0x3e')](mergeDataErlangB(_0x1d7caf))['then'](this[_0x2d6d('0x1e8')](_0x1d7caf))[_0x2d6d('0xbc')](loggerCatchPredictive(_0x2d6d('0x1e9'),_0x1d7caf));}else if(!ifInterval(_0x1d7caf[_0x2d6d('0x1de')],_0x1d7caf['startPredictive'])){_0x1d7caf[_0x2d6d('0x6f')]=0x0;_0x1d7caf['startPredictive']=moment()[_0x2d6d('0x7c')](_0x2d6d('0x100'));loggerPredictive[_0x2d6d('0x82')](_0x1d7caf[_0x2d6d('0x42')],_0x2d6d('0x1ea'),_0x1d7caf['startPredictive']);clearInterval(_0x1d7caf[_0x2d6d('0x97')]);_0x1d7caf['handlePredictive']=undefined;this['averageHandleTime'](_0x1d7caf[_0x2d6d('0x1de')])[_0x2d6d('0x3e')](this[_0x2d6d('0x1e7')](_0x1d7caf))[_0x2d6d('0x3e')](mergeDataErlangB(_0x1d7caf))[_0x2d6d('0x3e')](this[_0x2d6d('0x1e8')](_0x1d7caf))[_0x2d6d('0xbc')](loggerCatchPredictive('Predictive\x20for\x20every\x20interval',_0x1d7caf));}else if(_0x1d7caf['predictiveIntervalAvailable']&&_0x149b76<_0x1d7caf[_0x2d6d('0x1d6')]-_0x3b25b0){freeVariablesPredictive(_0x1d7caf);loggerPredictive['info'](_0x1d7caf[_0x2d6d('0x42')],_0x2d6d('0x1eb'),_0x149b76,_0x2d6d('0x1ec'),_0x1d7caf['predictiveIntervalAvailable'],'-',_0x3b25b0,'=',_0x1d7caf['predictiveIntervalAvailable']-_0x3b25b0,')');}else if(_0x1d7caf['predictiveIntervalAvailable']&&_0x149b76>_0x1d7caf[_0x2d6d('0x1d6')]+_0xc5e886){freeVariablesPredictive(_0x1d7caf);loggerPredictive[_0x2d6d('0x82')](_0x1d7caf['name'],_0x2d6d('0x1eb'),_0x149b76,_0x2d6d('0x1ed'),_0x1d7caf[_0x2d6d('0x1d6')],'+',_0xc5e886,'=',_0x1d7caf['predictiveIntervalAvailable']+_0xc5e886,')');}};Dialer[_0x2d6d('0xaf')][_0x2d6d('0x1e7')]=function(_0x4db689){var _0x501e41=this;return function(_0xf1063d){return new BPromise(function(_0x597ca4,_0x53e5b9){_[_0x2d6d('0x94')](_0x4db689,_0xf1063d[0x0]);if(checkGetDataPredictive(_0xf1063d[0x0])){var _0x209df8=_0x4db689[_0x2d6d('0x1d6')]=_0x4db689[_0x2d6d('0x58')]+_0x4db689[_0x2d6d('0x53')];var _0x20d8e5=_0x4db689[_0x2d6d('0x1de')]*0x3c;var _0x11b64c=_0xf1063d[0x0]['predictiveIntervalAvgTalktime']+_0xf1063d[0x0][_0x2d6d('0x6b')];var _0x479cc9=(_0xf1063d[0x0][_0x2d6d('0x6a')]+_0xf1063d[0x0]['predictiveIntervalDroppedCallsTimeout']+_0xf1063d[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0xf1063d[0x0][_0x2d6d('0x72')];_0x4db689['predictiveIntervalHitRate']=_0x479cc9>0x0?_0x479cc9:0x1;switch(_0x4db689[_0x2d6d('0x1e0')]){case _0x2d6d('0x1e1'):var _0x2a9355=_0x4db689[_0x2d6d('0x1d4')]/0x64;return _0x501e41['abandonmentRate'](_0x209df8,_0x20d8e5,_0x11b64c,_0x479cc9,_0x2a9355)[_0x2d6d('0x3e')](function(_0x4e6f84){return _0x597ca4(_0x4e6f84);});case'agentBusyFactor':var _0x6ba5e2=_0x4db689['dialPredictiveOptimizationPercentage']/0x64;return _0x501e41[_0x2d6d('0x1ee')](_0x209df8,_0x20d8e5,_0x11b64c,_0x479cc9,_0x6ba5e2)[_0x2d6d('0x3e')](function(_0x314957){return _0x597ca4(_0x314957);});default:return _0x53e5b9(msgResponse(_0x2d6d('0x1ef'),_0x2d6d('0x14b'),'Unknown\x20Predictive'));}}else{return _0x53e5b9(msgResponse(_0x2d6d('0x1ef'),_0x2d6d('0x14b'),_0x2d6d('0x1f0')));}});};};Dialer[_0x2d6d('0xaf')][_0x2d6d('0x1f1')]=function(_0x29757b){var _0x35b33d=this;return function(_0x1a024b){return new BPromise(function(_0x278b2b,_0x333082){_['merge'](_0x29757b,_0x1a024b[0x0]);if(checkGetDataPredictive(_0x1a024b[0x0])){loggerPredictive['info'](JSON['stringify'](_0x1a024b[0x0]));if(_0x29757b[_0x2d6d('0x1e0')]===_0x2d6d('0x1e1')){return _0x35b33d[_0x2d6d('0xcd')](_0x29757b['id'])['then'](function(_0x8e78b7){var _0x59bad0=_0x29757b[_0x2d6d('0x54')]-_0x8e78b7[0x0]['outboundQueuePauses'];var _0x4bbc76=_0x29757b[_0x2d6d('0x1de')]*0x3c;var _0x38ef84=_0x1a024b[0x0]['predictiveIntervalAvgTalktime']+_0x1a024b[0x0][_0x2d6d('0x6b')];var _0x57f7ab=(_0x1a024b[0x0][_0x2d6d('0x6a')]+_0x1a024b[0x0][_0x2d6d('0x6d')]+_0x1a024b[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x1a024b[0x0][_0x2d6d('0x72')];var _0x2b573a=_0x29757b[_0x2d6d('0x1d4')]/0x64;_0x29757b[_0x2d6d('0x71')]=_0x8e78b7[0x0][_0x2d6d('0x1f2')]||0x0;_0x29757b[_0x2d6d('0x1da')]=_0x57f7ab>0x0?_0x57f7ab:0x1;return _0x35b33d[_0x2d6d('0x1f3')](_0x59bad0,_0x4bbc76,_0x38ef84,_0x57f7ab,_0x2b573a);})[_0x2d6d('0x3e')](function(_0x3e5bf9){return _0x278b2b(_0x3e5bf9);})[_0x2d6d('0xbc')](function(_0x259cdc){return _0x333082(msgResponse('[CatchErlangB]',_0x2d6d('0x14b'),JSON[_0x2d6d('0x4a')](_0x259cdc)));});}if(_0x29757b[_0x2d6d('0x1e0')]==='agentBusyFactor'){return _0x35b33d[_0x2d6d('0xcd')](_0x29757b['id'])['then'](function(_0x2f7e1e){var _0xb844a7=_0x29757b['loggedIn']-_0x2f7e1e[0x0][_0x2d6d('0x1f2')];var _0x40ddd7=_0x29757b[_0x2d6d('0x1de')]*0x3c;var _0x547787=_0x1a024b[0x0][_0x2d6d('0x8c')]+_0x1a024b[0x0][_0x2d6d('0x6b')];var _0x591ae2=(_0x1a024b[0x0][_0x2d6d('0x6a')]+_0x1a024b[0x0][_0x2d6d('0x6d')]+_0x1a024b[0x0][_0x2d6d('0x6c')])/_0x1a024b[0x0]['predictiveIntervalTotalCalls'];var _0x12b440=_0x29757b[_0x2d6d('0x1d4')]/0x64;_0x29757b[_0x2d6d('0x71')]=_0x2f7e1e[0x0][_0x2d6d('0x1f2')]||0x0;_0x29757b['predictiveIntervalHitRate']=_0x591ae2>0x0?_0x591ae2:0x1;return _0x35b33d[_0x2d6d('0x1ee')](_0xb844a7,_0x40ddd7,_0x547787,_0x591ae2,_0x12b440);})[_0x2d6d('0x3e')](function(_0x259a49){return _0x278b2b(_0x259a49);})[_0x2d6d('0xbc')](function(_0x283f45){return _0x333082(msgResponse(_0x2d6d('0x1f4'),_0x2d6d('0x14b'),JSON['stringify'](_0x283f45)));});}}else{return _0x333082(msgResponse('[getDataPredictive]',_0x2d6d('0x14b'),'check\x20failure'));}});};};Dialer[_0x2d6d('0xaf')][_0x2d6d('0x1e8')]=function(_0x3d3b2f){var _0x2d60da=this;return function(){var _0x40e425=0x0;var _0x1ea152=Math['floor'](_0x3d3b2f[_0x2d6d('0x75')]*0x3e8);if(_0x1ea152>0x0){_0x1ea152=_0x1ea152<0x64?0x64:_0x1ea152;loggerPredictive['info'](_0x3d3b2f[_0x2d6d('0x42')],_0x2d6d('0x1f5'),_0x1ea152,_0x2d6d('0x4b'));_0x3d3b2f[_0x2d6d('0x97')]=setInterval(function(){_0x2d60da[_0x2d6d('0x97')](_0x3d3b2f);loggerPredictiveCalls[_0x2d6d('0x82')](_0x2d6d('0x1f6'),_0x40e425+=0x1);},_0x1ea152);}else{loggerPredictive[_0x2d6d('0x82')](_0x3d3b2f[_0x2d6d('0x42')],'fail\x20to\x20scheduled\x20calls');}};};Dialer['prototype']['checkContactBlack']=function(_0x422d95,_0x2a1606){var _0x119309=this;return function(_0x502b5b){if(_[_0x2d6d('0x81')](_0x502b5b)){if(_['isNil'](_0x2a1606[_0x2d6d('0x1f7')])||!_0x2a1606['recallme']){if(_0x422d95[_0x2d6d('0x16c')]==='booked'){_0x422d95[_0x2d6d('0x133')]=_['isUndefined'](_0x422d95['queueStatusComplete'])?!![]:_0x422d95[_0x2d6d('0x133')];var _0x546887=uuid['v4']();_0x119309[_0x2d6d('0x27')][_0x546887]=new Action(_0x422d95,_0x2a1606,_0x546887);loggerBooked[_0x2d6d('0x82')]('[booked][checkContactBlack]',_0x546887,_0x2d6d('0x1f8'),JSON[_0x2d6d('0x4a')](_0x422d95[_0x2d6d('0x133')]),_0x2d6d('0x1f9'),_0x422d95[_0x2d6d('0x42')]);if(_0x422d95[_0x2d6d('0x133')]){_0x422d95[_0x2d6d('0x133')]=![];_0x119309['queueBooked'][_0x119309[_0x2d6d('0x27')][_0x546887][_0x2d6d('0xb6')]]=[];ami[_0x2d6d('0x151')]({'actionid':_0x546887,'action':_0x2d6d('0x1fa'),'queue':_0x422d95['name']})[_0x2d6d('0xbc')](function(){_0x119309['updateOriginated'](_0x422d95);_0x119309[_0x2d6d('0xc6')]({'active':![],'ContactId':_0x119309[_0x2d6d('0x27')][_0x546887]['ContactId'],'ListId':_0x119309[_0x2d6d('0x27')][_0x546887][_0x2d6d('0xd5')],'VoiceQueueId':_0x119309[_0x2d6d('0x27')][_0x546887][_0x2d6d('0xd6')]||undefined,'CampaignId':_0x119309[_0x2d6d('0x27')][_0x546887][_0x2d6d('0xd7')]||undefined})[_0x2d6d('0xbc')](loggerCatch(_0x2d6d('0x1fb')));delete _0x119309[_0x2d6d('0x27')][_0x546887];});}else{loggerBooked[_0x2d6d('0x82')]('[booked][checkContactBlack][else]',JSON['stringify'](_0x422d95['queueStatusComplete']),_0x2d6d('0x1f9'),_0x422d95[_0x2d6d('0x42')]);_0x119309[_0x2d6d('0xb8')](_0x422d95);_0x119309[_0x2d6d('0xc6')]({'active':![],'ContactId':_0x119309[_0x2d6d('0x27')][_0x546887][_0x2d6d('0xd4')],'ListId':_0x119309['actions'][_0x546887][_0x2d6d('0xd5')],'VoiceQueueId':_0x119309['actions'][_0x546887][_0x2d6d('0xd6')]||undefined,'CampaignId':_0x119309['actions'][_0x546887][_0x2d6d('0xd7')]||undefined})[_0x2d6d('0xbc')](loggerCatch(_0x2d6d('0x1fb')));delete _0x119309[_0x2d6d('0x27')][_0x546887];}}else{return _0x119309[_0x2d6d('0x1fc')](_0x422d95,_0x2a1606);}}else{if(getDiff(_0x2a1606['scheduledat'])<_0x422d95[_0x2d6d('0x1fd')]*0x3c){if(_0x2a1606[_0x2d6d('0x167')]&&!_0x2a1606['Agent'][_0x2d6d('0x1fe')]){_0x119309['preview']['run'](_0x2a1606['id'])['finally'](function(){_0x119309[_0x2d6d('0xb8')](_0x422d95);});}else{_0x119309[_0x2d6d('0xc7')]({'active':![]},_0x2a1606['id'],0x1)[_0x2d6d('0x138')](function(){_0x119309['updateOriginated'](_0x422d95);});}}else{_0x422d95['outboundReCallsDay']+=0x1;_0x119309[_0x2d6d('0xb8')](_0x422d95);if(_0x422d95['dialRecallInQueue']){_0x119309[_0x2d6d('0xc6')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x2a1606[_0x2d6d('0xd4')],'ListId':_0x2a1606[_0x2d6d('0xd5')],'VoiceQueueId':_0x2a1606[_0x2d6d('0xd6')]||undefined,'CampaignId':_0x2a1606[_0x2d6d('0xd7')]||undefined})[_0x2d6d('0xbc')](loggerCatch(_0x2d6d('0x1ff')));_0x119309[_0x2d6d('0xd0')](createObjHistory(_0x422d95,_0x2a1606,_0x2d6d('0x200'),0x17,'RecallInQueue'))[_0x2d6d('0xbc')](loggerCatch('[Originate][HistoryDialRecallInQueue][historyCatch]'));}else{_0x119309[_0x2d6d('0xdc')](createObjHistory(_0x422d95,_0x2a1606,'RECALLFAILEDTIMEOUT',0x16,'RecallFailedTimeout'),'[Originate][HistoryRecallClose][historyCatch]',_0x2d6d('0x201'));}}}}else{_0x422d95[_0x2d6d('0x63')]+=0x1;_0x119309[_0x2d6d('0xdc')](createObjHistory(_0x422d95,_0x2a1606,_0x2d6d('0x202'),0xd,_0x2d6d('0x203')),_0x2d6d('0x204'),_0x2d6d('0x205'));throw'inBlackList';}};};Dialer[_0x2d6d('0xaf')][_0x2d6d('0x16b')]=function(_0x4084a3){var _0x50ad4c=this;var _0x389cac=_0x4084a3[_0x2d6d('0x206')]-_0x4084a3[_0x2d6d('0x73')]-_0x4084a3['temp'];emitCampaignSummary(_0x4084a3);if(_0x389cac>0x0){if(_0x389cac>this[_0x2d6d('0x26')]){_0x389cac=this[_0x2d6d('0x26')];}_0x4084a3[_0x2d6d('0xca')]+=_0x389cac;this['getContactDialerIvr'](_0x4084a3['id'],_0x389cac,_0x4084a3[_0x2d6d('0x207')],_0x4084a3)[_0x2d6d('0x3e')](function(_0x12e523){_0x4084a3[_0x2d6d('0xca')]-=_0x389cac;_0x4084a3[_0x2d6d('0xca')]=_0x4084a3['temp']>0x0?_0x4084a3[_0x2d6d('0xca')]:0x0;if(!checkContactEmpty(_0x12e523)){_0x4084a3[_0x2d6d('0x40')]=_0x2d6d('0xa5');logger[_0x2d6d('0x82')](_0x2d6d('0x208')+_0x4084a3[_0x2d6d('0x42')]);}else{_0x4084a3[_0x2d6d('0x73')]+=_0x12e523[_0x2d6d('0x9e')];_0x4084a3[_0x2d6d('0x40')]=_0x2d6d('0x209');for(var _0x5e8a07=0x0;_0x5e8a07<_0x12e523[_0x2d6d('0x9e')];_0x5e8a07+=0x1){_0x4084a3['ivrTotalCallsDays']+=0x1;if(_[_0x2d6d('0xdf')](_0x12e523[_0x5e8a07])||_[_0x2d6d('0xdf')](_0x12e523[_0x5e8a07][_0x2d6d('0x191')])||_['isNil'](_0x12e523[_0x5e8a07]['phone'])){_0x50ad4c[_0x2d6d('0x20a')]('[actionOriginate]\x20',_0x4084a3,_0x12e523[_0x5e8a07]);}else{_0x50ad4c[_0x2d6d('0xc3')](_[_0x2d6d('0xd3')](_0x12e523[_0x5e8a07],['CampaignId',_0x2d6d('0x20b')]))[_0x2d6d('0x3e')](_0x50ad4c[_0x2d6d('0x20c')](_0x4084a3,_0x12e523[_0x5e8a07]))['catch'](_0x50ad4c[_0x2d6d('0x20d')]('[actionOriginateIvr]\x20',_0x4084a3));}}}})[_0x2d6d('0xbc')](loggerGetContactDialer('[getContactCampaign2]',_0x4084a3,_0x389cac));}};Dialer[_0x2d6d('0xaf')][_0x2d6d('0x161')]=function(_0x544133,_0x369fed){var _0x5a4efd=this;var _0x5b7563=[];var _0x32aa22=_0x369fed>=0x1?_0x369fed:0x1;if(_0x544133[_0x2d6d('0x16c')]===_0x2d6d('0x8')){_0x32aa22=0x1;}var _0x24795f=Math[_0x2d6d('0x1d9')](_0x544133[_0x2d6d('0x53')]*_0x32aa22)-_0x544133['originated']-_0x544133[_0x2d6d('0xca')];emitVoiceQueueSummary(_0x544133);if(_0x544133['dialLimitQueue']>0x0){var _0x345456=_0x544133[_0x2d6d('0x20e')]-_0x544133[_0x2d6d('0x73')]-_0x544133[_0x2d6d('0x58')]-_0x544133[_0x2d6d('0xca')]-_0x544133['pTalking'];if(_0x24795f>_0x345456){_0x24795f=_0x345456;}}if(_0x24795f>0x0){if(_0x544133[_0x2d6d('0x16c')]===_0x2d6d('0x8')){_0x24795f=0x1;}if(_0x24795f>this[_0x2d6d('0x26')]){_0x24795f=this[_0x2d6d('0x26')];}_0x544133[_0x2d6d('0xca')]+=_0x24795f;for(var _0x1a2652 in this[_0x2d6d('0x24')]){if(typeof this['agents'][_0x1a2652]!=='undefined'){if(this['agents'][_0x1a2652][_0x2d6d('0xe6')]===_0x2d6d('0x20f')&&this['agents'][_0x1a2652][_0x2d6d('0xb3')]==='reachable'){_0x5b7563[_0x2d6d('0x131')](this['agents'][_0x1a2652]['id']);}}}this[_0x2d6d('0xc9')](_0x544133['id'],_0x5b7563,_0x24795f,_0x544133[_0x2d6d('0x207')],_0x544133)[_0x2d6d('0x3e')](function(_0xa4f68c){_0x544133[_0x2d6d('0xca')]-=_0x24795f;_0x544133[_0x2d6d('0xca')]=_0x544133[_0x2d6d('0xca')]>0x0?_0x544133[_0x2d6d('0xca')]:0x0;if(!checkContactEmpty(_0xa4f68c)){_0x5a4efd[_0x2d6d('0xba')](_0x544133)[_0x2d6d('0x3e')](sendMessageReschedule(_0x544133))[_0x2d6d('0xbc')](loggerCatch(_0x2d6d('0xbd')));}else{_0x544133['originated']+=_0xa4f68c[_0x2d6d('0x9e')];_0x544133['message']=_0x544133[_0x2d6d('0x16c')]==='booked'?_0x2d6d('0x17f'):_0x2d6d('0x209');for(var _0x76dca6=0x0;_0x76dca6<_0xa4f68c[_0x2d6d('0x9e')];_0x76dca6+=0x1){if(_[_0x2d6d('0xdf')](_0xa4f68c[_0x76dca6])||_[_0x2d6d('0xdf')](_0xa4f68c[_0x76dca6][_0x2d6d('0x191')])||_['isNil'](_0xa4f68c[_0x76dca6][_0x2d6d('0x178')])){_0x5a4efd['emptyContact'](_0x2d6d('0x210'),_0x544133,_0xa4f68c[_0x76dca6]);}else{_0x5a4efd[_0x2d6d('0xbe')](_['pick'](_0xa4f68c[_0x76dca6],[_0x2d6d('0xd6'),'Contact.phone']))['then'](_0x5a4efd[_0x2d6d('0x20c')](_0x544133,_0xa4f68c[_0x76dca6]))[_0x2d6d('0xbc')](_0x5a4efd[_0x2d6d('0x20d')]('[actionOriginate]\x20',_0x544133));}}}})[_0x2d6d('0xbc')](loggerGetContactDialer(_0x2d6d('0x211'),_0x544133,_0x24795f));}};Dialer[_0x2d6d('0xaf')][_0x2d6d('0x97')]=function(_0x27ce03){if(_0x27ce03[_0x2d6d('0x20e')]>0x0){var _0x1dc1ca=_0x27ce03['dialLimitQueue']-_0x27ce03[_0x2d6d('0x73')]-_0x27ce03[_0x2d6d('0x58')];if(_0x1dc1ca>0x0){this[_0x2d6d('0x212')](_0x27ce03);}else{loggerPredictiveCalls[_0x2d6d('0x82')]('[handlePredictive][limitChannel]');}}else{this[_0x2d6d('0x212')](_0x27ce03);}};Dialer[_0x2d6d('0xaf')]['tryOriginatePredictive']=function(_0x48aef4){var _0x15d3c4=this;var _0x427ad6=[];_0x48aef4['originated']+=0x1;for(var _0x41b383 in this[_0x2d6d('0x24')]){if(typeof this['agents'][_0x41b383]!==_0x2d6d('0x9f')){if(this[_0x2d6d('0x24')][_0x41b383][_0x2d6d('0xe6')]===_0x2d6d('0x20f')&&this[_0x2d6d('0x24')][_0x41b383][_0x2d6d('0xb3')]===_0x2d6d('0xda')){_0x427ad6[_0x2d6d('0x131')](this[_0x2d6d('0x24')][_0x41b383]['id']);}}}this[_0x2d6d('0xc9')](_0x48aef4['id'],_0x427ad6,0x1,_0x48aef4[_0x2d6d('0x207')],_0x48aef4)[_0x2d6d('0x3e')](function(_0x5a72e0){if(!checkContactEmpty(_0x5a72e0)){checkContactLowerLimitOriginate(_0x48aef4,0x1,0x0);_0x15d3c4[_0x2d6d('0xba')](_0x48aef4)[_0x2d6d('0x3e')](sendMessageReschedule(_0x48aef4))['catch'](loggerCatch(_0x2d6d('0xbd')));}else{_0x48aef4[_0x2d6d('0x40')]=_0x2d6d('0x209');if(_[_0x2d6d('0xdf')](_0x5a72e0[0x0])||_['isNil'](_0x5a72e0[0x0][_0x2d6d('0x191')])||_[_0x2d6d('0xdf')](_0x5a72e0[0x0]['phone'])){_0x15d3c4[_0x2d6d('0x20a')](_0x2d6d('0x210'),_0x48aef4,_0x5a72e0[0x0]);}else{_0x15d3c4[_0x2d6d('0xbe')](_['pick'](_0x5a72e0[0x0],['VoiceQueueId',_0x2d6d('0x20b')]))[_0x2d6d('0x3e')](_0x15d3c4['checkContactBlack'](_0x48aef4,_0x5a72e0[0x0]))[_0x2d6d('0xbc')](_0x15d3c4[_0x2d6d('0x20d')]('[actionOriginatePredictive]\x20',_0x48aef4));}}})[_0x2d6d('0xbc')](loggerGetContactDialer(_0x2d6d('0x213'),_0x48aef4,0x1));emitVoiceQueueSummary(_0x48aef4);};Dialer['prototype'][_0x2d6d('0x1f3')]=function(_0x188635,_0x4c46a1,_0x431694,_0x1af954,_0x36187e,_0x2e2be0){loggerPredictive[_0x2d6d('0x82')](_0x2d6d('0x214'));loggerPredictive['info'](_0x2d6d('0x215'),_0x188635);loggerPredictive[_0x2d6d('0x82')](_0x2d6d('0x216'),_0x4c46a1);loggerPredictive['info'](_0x2d6d('0x217'),_0x431694);loggerPredictive[_0x2d6d('0x82')]('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',_0x1af954);loggerPredictive[_0x2d6d('0x82')](_0x2d6d('0x218'),_0x36187e);loggerPredictive['info'](_0x2d6d('0x8a'));return new BPromise(function(_0x3b04f4,_0x38c8e9){if(_0x188635<=0x0||isNaN(_0x188635)){return _0x38c8e9(msgResponse(_0x2d6d('0x219'),'Error',_0x2d6d('0x21a')+_0x188635));}if(_0x431694<=0x0||isNaN(_0x431694)){return _0x38c8e9(msgResponse(_0x2d6d('0x219'),_0x2d6d('0x19e'),'Ts\x20=\x20'+_0x431694));}if(_0x1af954<=0x0||isNaN(_0x1af954)){return _0x38c8e9(msgResponse(_0x2d6d('0x219'),_0x2d6d('0x19e'),_0x2d6d('0x21b')+_0x1af954));}if(_0x4c46a1<=0x0||isNaN(_0x4c46a1)){return _0x38c8e9(msgResponse(_0x2d6d('0x219'),'Error',_0x2d6d('0x21c')+_0x4c46a1));}if(_0x36187e<=0x0||isNaN(_0x36187e)){return _0x38c8e9(msgResponse('[abandonmentRate]','Error',_0x2d6d('0x21d')+_0x36187e));}_0x2e2be0=_0x2e2be0||0x0;var _0x4c9140=0x1/_0x431694;var _0x1b60b5=0x0;var _0x29b8b6=0x0;var _0x5298ad=0x0;var _0x2bfe46=0x0;for(var _0x32d240=0x0;_0x5298ad<_0x36187e;_0x32d240+=0x1){_0x29b8b6=_0x32d240/_0x4c46a1;_0x1b60b5=(_0x1af954*_0x29b8b6+_0x2e2be0)/_0x4c9140;_0x5298ad=erlangb(_0x1b60b5,_0x188635);_0x2bfe46=_0x1b60b5/_0x188635*(0x1-erlangb(_0x1b60b5,_0x188635));}return _0x3b04f4({'erlangCalls':_0x32d240,'erlangCallToSecond':_0x4c46a1/_0x32d240,'erlangAbandonmentRate':_0x5298ad,'erlangBusyFactor':_0x2bfe46});});};Dialer[_0x2d6d('0xaf')][_0x2d6d('0x1ee')]=function(_0x48ebb4,_0x5ae370,_0x50ddac,_0xfa91aa,_0x2588c9,_0x30eb7d){loggerPredictive[_0x2d6d('0x82')]('----\x20Agent\x20Busy\x20Factor\x20----');loggerPredictive['info'](_0x2d6d('0x215'),_0x48ebb4);loggerPredictive[_0x2d6d('0x82')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5ae370);loggerPredictive[_0x2d6d('0x82')](_0x2d6d('0x217'),_0x50ddac);loggerPredictive[_0x2d6d('0x82')](_0x2d6d('0x21e'),_0xfa91aa);loggerPredictive['info'](_0x2d6d('0x21f'),_0x2588c9);loggerPredictive[_0x2d6d('0x82')](_0x2d6d('0x8a'));return new BPromise(function(_0x1e2aa9,_0xf6bbbd){if(_0x48ebb4<=0x0||isNaN(_0x48ebb4)){return _0xf6bbbd(msgResponse(_0x2d6d('0x220'),_0x2d6d('0x19e'),'m\x20=\x20'+_0x48ebb4));}if(_0x50ddac<=0x0||isNaN(_0x50ddac)){return _0xf6bbbd(msgResponse('[busyFactor]',_0x2d6d('0x19e'),'Ts\x20=\x20'+_0x50ddac));}if(_0xfa91aa<=0x0||isNaN(_0xfa91aa)){return _0xf6bbbd(msgResponse('[busyFactor]',_0x2d6d('0x19e'),_0x2d6d('0x21b')+_0xfa91aa));}if(_0x5ae370<=0x0||isNaN(_0x5ae370)){return _0xf6bbbd(msgResponse(_0x2d6d('0x220'),_0x2d6d('0x19e'),_0x2d6d('0x21c')+_0x5ae370));}if(_0x2588c9<=0x0||isNaN(_0x2588c9)){return _0xf6bbbd(msgResponse(_0x2d6d('0x220'),_0x2d6d('0x19e'),_0x2d6d('0x221')+_0x2588c9));}_0x30eb7d=_0x30eb7d||0x0;var _0x2fa0c6=0x1/_0x50ddac;var _0x1f81a4=0x0;var _0x58ec84=0x0;var _0x40d543=0x0;var _0x22e3a2=0x0;for(var _0x17e9d6=0x0;_0x22e3a2<_0x2588c9;_0x17e9d6+=0x1){_0x58ec84=_0x17e9d6/_0x5ae370;_0x1f81a4=(_0xfa91aa*_0x58ec84+_0x30eb7d)/_0x2fa0c6;_0x40d543=erlangb(_0x1f81a4,_0x48ebb4);_0x22e3a2=_0x1f81a4/_0x48ebb4*(0x1-erlangb(_0x1f81a4,_0x48ebb4));}return _0x1e2aa9({'erlangCalls':_0x17e9d6,'erlangCallToSecond':_0x5ae370/_0x17e9d6,'erlangAbandonmentRate':_0x40d543,'erlangBusyFactor':_0x22e3a2});});};module[_0x2d6d('0x222')]=Dialer;
\ No newline at end of file
+var _0x3b6e=['syncNewExten','varset','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','getSettings','previewRecallmeReminderInterval','isUndefined','message','AGENTS_NOT_LOGGED','name','\x20NOT\x20Active','Interval','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Intervals','isEmpty','stringify','milliseconds','diff','seconds','emit','outbound','answered','available','loggedIn','pTalking','sumBillable','total','type','unmanaged','dialActive','dialOriginateCallerIdNumber','dialOriginateTimeout','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundDropCallsDayACS','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','Trunk','active','format','voice:queue:%s','voice_queue:save','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','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgHoldtime','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCallToSecond','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','merge','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','ivr','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','inspect','[decremetOriginate]\x20is\x20null\x20or\x20undefined','RESCHEDULED_CONTACTS','contacts','AVAILABLE_CONTACTS_FINISHED','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','IS_DISACTIVED','NOT_ACTIVE','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20disactive','state','starttime','clearZombieChannels','[uniqueid]','undefined','isNil','Action','channel','No\x20such\x20channel','updateOriginated','queue','[Dialer][checkChannel][ivr]','resolve','catch','[countReScheduled]\x20','checkIsBlackList','verifyAdditionalPhones','[verifyAdditionalPhone]\x20','then','swapAdditionalPhones','[swapAdditionalPhone]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','avgHandleTime','rescheduleContact','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','getContactDialer','temp','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','pick','ContactId','ListId','UserId','VoiceQueueId','[emptyContact][createHistory]','isSuccess','Success','isTrunkReachable','SIP/%s','status','unmonitored','saveInDb','uniqueid','variable','amdstatus','exten','xcally-motion-dialer','dialAMDActive','value','HANGUP','statedesc','HangupInAMD','custom:amd','buildObj','amd','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','membername','countmachineretry','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','minutes','YYYY-MM-DD\x20HH:mm:ss','CampaignId','[rescheduleContact][Machine]','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','MACHINE','AMD','countglobal','countabandonedretry','reason\x2019\x20machine....','add','dialMachineRetryFrequency','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','AnswerAGI','dialQueueProject','Unknow','reason','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','answertime','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','droptime','Drop','dropreason','TIMEOUT','callAdditionalPhoneAfterMin','voiceQueue','additional','dialDropMaxRetry','dialDropRetryFrequency','endtime','calleridname','calleridnum','Abandoned','dialAbandonedRetryFrequency','dialAbandonedMaxRetry','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','actions','strategy','actionid','locked','paused','stateinterface','queueBooked','idHopper','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','run','[Catch][Preview][syncQueueStatusComplete]','finally','[unlock][syncQueueStatusComplete]','_rr','Agent:\x20','unlockRR','contactAgent-idHopper:\x20','[booked][RR][finaly]','[booked][unlock]','[booked][unlock2]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','resetActiveCalls','syncCampaigns','checkIsTrunkReachable','TrunkBackup','\x20trunk\x20is\x20not\x20reachable','ifTime','checkIfTimeIntervals','Failure','\x20Intervals\x20is\x20empty\x20','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','isArray','length','push','command','iftime\x20%s,%s','interval','content','indexOf','true','timezones','all','some','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','checkDialMethod','dialMethod','progressive','handlePower','Queue','method\x20not\x20recognized','checkPreviewRecallReminder','handlePreviewRecallNotifications','Agent','user:%s','user:dialPreviewRecallReminder','launchHandleIvr','dialGlobalInterval','dialTimezone','dialPreviewRecallmeReminder','checkIfTime','[syncCampaigns]','\x5cw{0,','pow','replace','match','object','originate','phone','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','dialQueueTimeout','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','Contact','createdAt','updatedAt','%s%s','XMD-','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','callerid','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','SIP/%s/%s%s','dialPrefix','dialCutDigit','substring','trim','OriginateError','[originate][error]','Error','originate\x20action\x20Error','getQueue','response','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','dialNoAnswerMaxRetry','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','[rescheduleContact][Drop]','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','[callProgressDetecting]','evt\x20is\x20undefine','NoSuchNumber','custom:agentnosuchnumber','dialNoSuchNumberMaxRetry','reason\x200\x20no\x20such\x20number....','custom:agentnoanswer','noanswer','dialNoAnswerRetryFrequency','reason\x203\x20ringing\x20no\x20answer','custom:agentbusy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','outboundCongestionCallsDay','Congestion','dialCongestionRetryFrequency','custom:agentcongestion','congestion','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','AgentReject','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','dialAgentRejectMaxRetry','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','contact\x20not\x20moved','round','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','talking','floor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','dropRate','Dropped\x20calls\x20day','dialPredictiveOptimization','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(','abandonmentRate','agentBusyFactor','dialPredictiveOptimizationPercentage','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','outboundQueuePauses','[CatchErlangB]','one\x20call\x20every:','recallme','queueStatusComplete','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','actionOriginate','scheduledat','dialRecallMeTimeout','voicePause','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RecallInQueue','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','handleIvr','limitCalls','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','Contact.phone','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','reachable','dialOrderByScheduledAt','countReScheduled','ACTIVE','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','not_inuse','[actionOriginatePredictive]\x20','--------\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]','Ts\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','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','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','m\x20=\x20','[busyFactor]','Umin\x20=\x20','exports','util','lodash','bluebird','moment','md5','ioredis','../../../config/environment/','dialer','../../../config/logger','booked','predictive','predictiveCalls','syncQueueSummary','../ami','socket.io-emitter','redis','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperFinal','../rpc/cmHopperAdditionalPhone','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/setting','./history','./queueCallerAbandon','./hangup','env','XCALLY_IP_AGI','127.0.0.1','rrmemory','roundrobin','prototype','enqueue','tail','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','contactsId','uniqueId','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBookedRR','agentconnect','syncAgentConnect','bind','queuecallerabandon','syncQueueCallerAbandon','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','hangup','syncHangup','newexten'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x3b6e,0x1ea));var _0xe3b6=function(_0x19337f,_0x3e3ff4){_0x19337f=_0x19337f-0x0;var _0x1b89fa=_0x3b6e[_0x19337f];return _0x1b89fa;};'use strict';var util=require(_0xe3b6('0x0'));var _=require(_0xe3b6('0x1'));var BPromise=require(_0xe3b6('0x2'));var uuid=require('uuid');var moment=require(_0xe3b6('0x3'));var rr=require('rr');var md5=require(_0xe3b6('0x4'));var Redis=require(_0xe3b6('0x5'));var ut=require('../preview/util/util');var config=require(_0xe3b6('0x6'));var logger=require('../../../config/logger')(_0xe3b6('0x7'));var loggerBooked=require(_0xe3b6('0x8'))(_0xe3b6('0x9'));var loggerPredictive=require(_0xe3b6('0x8'))(_0xe3b6('0xa'));var loggerPredictiveCalls=require(_0xe3b6('0x8'))(_0xe3b6('0xb'));var loggerSyncQueueSummary=require(_0xe3b6('0x8'))(_0xe3b6('0xc'));var ami=require(_0xe3b6('0xd'));config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xe3b6('0xe'))(new Redis(config[_0xe3b6('0xf')]));var cmHopper=require(_0xe3b6('0x10'));var cmHopperHistory=require(_0xe3b6('0x11'));var cmHopperFinal=require(_0xe3b6('0x12'));var cmHopperAdditionalPhone=require(_0xe3b6('0x13'));var cmHopperBlack=require(_0xe3b6('0x14'));var voiceQueueRt=require(_0xe3b6('0x15'));var RpcSetting=require(_0xe3b6('0x16'));var Action=require('./action');var History=require(_0xe3b6('0x17'));var Final=require('./final');var AgentComplete=require('./agentComplete');var QueueCallerAbandon=require(_0xe3b6('0x18'));var Hangup=require(_0xe3b6('0x19'));var ipAgi=process[_0xe3b6('0x1a')][_0xe3b6('0x1b')]||_0xe3b6('0x1c');var strategy={'rrmemory':_0xe3b6('0x1d'),'roundrobin':_0xe3b6('0x1e')};var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0xe3b6('0x1f')][_0xe3b6('0x20')]=function(_0x148e5c){this['tail']=this[_0xe3b6('0x21')]?this[_0xe3b6('0x21')]['finally'](_0x148e5c):_0x148e5c();};function Dialer(_0x2304ce,_0x112c12){this['sequence']=new Sequence();this[_0xe3b6('0x22')]=_0x112c12;this[_0xe3b6('0x23')]=_0x2304ce[_0xe3b6('0x23')];this[_0xe3b6('0x24')]=_0x2304ce['campaigns'];this[_0xe3b6('0x25')]=_0x2304ce[_0xe3b6('0x25')];this[_0xe3b6('0x26')]=_0x2304ce[_0xe3b6('0x26')];this[_0xe3b6('0x27')]=config['maxNumberOriginate']||0x2;this[_0xe3b6('0x28')]={};this['actions']={};this[_0xe3b6('0x29')]={};this[_0xe3b6('0x2a')]={};this[_0xe3b6('0x2b')]={};this[_0xe3b6('0x2c')]={};this[_0xe3b6('0x2d')]={};this[_0xe3b6('0x2e')]={};this['queueBooked']={};this[_0xe3b6('0x2f')]={};ami['on'](_0xe3b6('0x30'),this[_0xe3b6('0x31')][_0xe3b6('0x32')](this));ami['on'](_0xe3b6('0x33'),this[_0xe3b6('0x34')]['bind'](this));ami['on']('originateresponse',this[_0xe3b6('0x35')][_0xe3b6('0x32')](this));ami['on'](_0xe3b6('0x36'),this[_0xe3b6('0x37')][_0xe3b6('0x32')](this));ami['on'](_0xe3b6('0x38'),this[_0xe3b6('0xc')][_0xe3b6('0x32')](this));ami['on'](_0xe3b6('0x39'),this[_0xe3b6('0x3a')][_0xe3b6('0x32')](this));ami['on'](_0xe3b6('0x3b'),this[_0xe3b6('0x3c')][_0xe3b6('0x32')](this));ami['on'](_0xe3b6('0x3d'),this[_0xe3b6('0x3e')][_0xe3b6('0x32')](this));ami['on'](_0xe3b6('0x3f'),this[_0xe3b6('0x40')][_0xe3b6('0x32')](this));ami['on'](_0xe3b6('0x41'),this[_0xe3b6('0x42')][_0xe3b6('0x32')](this));this[_0xe3b6('0x43')]();this['loopClearZombieChannels']();RpcSetting[_0xe3b6('0x44')]()['then'](function(_0x1241e3){previewRecallmeReminderInterval=_0x1241e3[_0xe3b6('0x45')];});}function isNotNull(_0x106dbe){return _0x106dbe!==null&&!_[_0xe3b6('0x46')](_0x106dbe);}function checkIsLoggedIn(_0x467e98,_0x5ab5e){return function(){if(_0x5ab5e<=0x0){_0x467e98[_0xe3b6('0x47')]=_0xe3b6('0x48');throw _0x467e98[_0xe3b6('0x49')]+'\x20AGENTS\x20NOT\x20LOGGED';}};}function isActive(_0x517a03){return _0x517a03;}function checkIsActive(_0x57f3c2,_0xac84c5){return function(){if(!isActive(_0xac84c5)){_0x57f3c2['message']='NOT_ACTIVE';throw _0x57f3c2[_0xe3b6('0x49')]+_0xe3b6('0x4a');}};}function checkInterval(_0x15437e){return function(){if(!isNotNull(_0x15437e[_0xe3b6('0x4b')])){_0x15437e['message']=_0xe3b6('0x4c');throw _0x15437e['name']+_0xe3b6('0x4d');}if(!isNotNull(_0x15437e[_0xe3b6('0x4b')][_0xe3b6('0x4e')])){_0x15437e[_0xe3b6('0x47')]=_0xe3b6('0x4c');throw _0x15437e['name']+_0xe3b6('0x4d');}if(!isNotNull(_[_0xe3b6('0x4f')](_0x15437e['Interval'][_0xe3b6('0x4e')]))){_0x15437e['message']=_0xe3b6('0x4c');throw _0x15437e[_0xe3b6('0x49')]+_0xe3b6('0x4d');}};}function msgResponse(_0x19c6c0,_0x4fdbcf,_0x1a68d){return{'action':_0x19c6c0,'response':_0x4fdbcf,'message':_0x1a68d,'stack':_0x1a68d};}function myreject(_0x7515c0){return function(_0x25da77){return _0x7515c0(msgResponse('[ifTime][Action]','Error',JSON[_0xe3b6('0x50')](_0x25da77)));};}function getSeconds(_0x2e3fd7,_0x2d984c){var _0x5a0440=moment(_0x2e3fd7)[_0xe3b6('0x51')](0x0);var _0x3d2e49=moment(_0x2d984c)[_0xe3b6('0x51')](0x0);return _0x5a0440[_0xe3b6('0x52')](_0x3d2e49,_0xe3b6('0x53'));}function emit(_0x5e893b,_0x52ec9e,_0x5478ea){io['to'](_0x5e893b)[_0xe3b6('0x54')](_0x52ec9e,_0x5478ea);}function emitVoiceQueueSummary(_0x3e8cc5){if(_0x3e8cc5['type']===_0xe3b6('0x55')){var _0x25967f={'id':_0x3e8cc5['id'],'name':_0x3e8cc5['name'],'strategy':_0x3e8cc5['strategy'],'answered':_0x3e8cc5[_0xe3b6('0x56')],'available':_0x3e8cc5[_0xe3b6('0x57')],'loggedIn':_0x3e8cc5[_0xe3b6('0x58')],'pTalking':_0x3e8cc5[_0xe3b6('0x59')],'sumBillable':_0x3e8cc5[_0xe3b6('0x5a')],'sumDuration':_0x3e8cc5['sumDuration'],'sumHoldTime':_0x3e8cc5['sumHoldTime']||0x0,'talking':_0x3e8cc5['talking'],'total':_0x3e8cc5[_0xe3b6('0x5b')],'type':_0x3e8cc5[_0xe3b6('0x5c')],'unmanaged':_0x3e8cc5[_0xe3b6('0x5d')],'abandoned':_0x3e8cc5['abandoned'],'waiting':_0x3e8cc5['waiting'],'loggedInDb':_0x3e8cc5['loggedInDb'],'dialActive':_0x3e8cc5[_0xe3b6('0x5e')],'dialMethod':_0x3e8cc5['dialMethod'],'dialOriginateCallerIdName':_0x3e8cc5['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x3e8cc5[_0xe3b6('0x5f')],'dialOriginateTimeout':_0x3e8cc5[_0xe3b6('0x60')],'dialPrefix':_0x3e8cc5['dialPrefix'],'outboundAnswerAgiCallsDay':_0x3e8cc5[_0xe3b6('0x61')],'outboundAnswerCallsDay':_0x3e8cc5[_0xe3b6('0x62')],'outboundBlacklistCallsDay':_0x3e8cc5[_0xe3b6('0x63')],'outboundBusyCallsDay':_0x3e8cc5[_0xe3b6('0x64')],'outboundCongestionCallsDay':_0x3e8cc5['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x3e8cc5[_0xe3b6('0x65')],'outboundDropCallsDayCallersExit':_0x3e8cc5['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x3e8cc5[_0xe3b6('0x66')],'outboundNoAnswerCallsDay':_0x3e8cc5[_0xe3b6('0x67')],'outboundNoSuchCallsDay':_0x3e8cc5[_0xe3b6('0x68')],'outboundOriginateFailureCallsDay':_0x3e8cc5[_0xe3b6('0x69')],'outboundReCallsDay':_0x3e8cc5[_0xe3b6('0x6a')],'outboundRejectCallsDay':_0x3e8cc5[_0xe3b6('0x6b')],'outboundUnknownCallsDay':_0x3e8cc5[_0xe3b6('0x6c')],'predictiveIntervalAnsweredCalls':_0x3e8cc5[_0xe3b6('0x6d')],'predictiveIntervalAvgHoldtime':_0x3e8cc5['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x3e8cc5[_0xe3b6('0x6e')],'predictiveIntervalDroppedCallsCallersExit':_0x3e8cc5[_0xe3b6('0x6f')],'predictiveIntervalDroppedCallsTimeout':_0x3e8cc5[_0xe3b6('0x70')],'predictiveIntervalErlangCalls':_0x3e8cc5[_0xe3b6('0x71')],'predictiveIntervalErlangCallsDroppedCalls':_0x3e8cc5[_0xe3b6('0x72')],'predictiveIntervalHitRate':_0x3e8cc5[_0xe3b6('0x73')],'predictiveIntervalMultiplicativeFactor':_0x3e8cc5[_0xe3b6('0x74')],'predictiveIntervalPauses':_0x3e8cc5[_0xe3b6('0x75')],'predictiveIntervalAvailable':_0x3e8cc5[_0xe3b6('0x76')],'predictiveIntervalTotalCalls':_0x3e8cc5[_0xe3b6('0x77')],'message':_0x3e8cc5[_0xe3b6('0x47')],'originated':_0x3e8cc5[_0xe3b6('0x78')],'erlangCalls':_0x3e8cc5[_0xe3b6('0x79')],'erlangCallToSecond':_0x3e8cc5['erlangCallToSecond'],'erlangAbandonmentRate':_0x3e8cc5[_0xe3b6('0x7a')],'erlangBusyFactor':_0x3e8cc5[_0xe3b6('0x7b')],'startPredictive':_0x3e8cc5[_0xe3b6('0x2c')],'startProgressive':_0x3e8cc5['startProgressive']};if(_0x3e8cc5[_0xe3b6('0x7c')]){_0x25967f['Trunk']={'id':_0x3e8cc5[_0xe3b6('0x7c')]['id'],'name':_0x3e8cc5[_0xe3b6('0x7c')]['name'],'active':_0x3e8cc5[_0xe3b6('0x7c')][_0xe3b6('0x7d')],'callerid':_0x3e8cc5[_0xe3b6('0x7c')]['callerid']};}if(_0x3e8cc5[_0xe3b6('0x4b')]){_0x25967f[_0xe3b6('0x4b')]={'id':_0x3e8cc5[_0xe3b6('0x4b')]['id'],'name':_0x3e8cc5[_0xe3b6('0x4b')][_0xe3b6('0x49')]};}var _0x9c9dcf=md5(JSON[_0xe3b6('0x50')](_0x25967f));if(_0x3e8cc5[_0xe3b6('0x4')]!==_0x9c9dcf){_0x3e8cc5[_0xe3b6('0x4')]=_0x9c9dcf;emit(util[_0xe3b6('0x7e')](_0xe3b6('0x7f'),_0x25967f[_0xe3b6('0x49')]),_0xe3b6('0x80'),_0x25967f);}}}function emitCampaignSummary(_0x49ad22){if(_0x49ad22['type']==='ivr'){emit(util['format'](_0xe3b6('0x81'),_0x49ad22[_0xe3b6('0x49')]),_0xe3b6('0x82'),_0x49ad22);}}function checkGetDataPredictive(_0x42e5c5){if(isNotNull(_0x42e5c5)&&!_[_0xe3b6('0x4f')](_0x42e5c5)){loggerPredictive[_0xe3b6('0x83')](_0xe3b6('0x84'));loggerPredictive[_0xe3b6('0x83')](_0xe3b6('0x85'),_0x42e5c5[_0xe3b6('0x77')]);loggerPredictive[_0xe3b6('0x83')](_0xe3b6('0x86'),_0x42e5c5[_0xe3b6('0x6d')]);loggerPredictive[_0xe3b6('0x83')](_0xe3b6('0x87'),_0x42e5c5[_0xe3b6('0x70')]);loggerPredictive['info']('Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x42e5c5[_0xe3b6('0x6f')]);loggerPredictive[_0xe3b6('0x83')](_0xe3b6('0x88'),_0x42e5c5[_0xe3b6('0x89')]);loggerPredictive[_0xe3b6('0x83')](_0xe3b6('0x8a'),_0x42e5c5[_0xe3b6('0x6e')]);loggerPredictive[_0xe3b6('0x83')](_0xe3b6('0x8b'));if(_0x42e5c5[_0xe3b6('0x77')]>0x0){if(!_[_0xe3b6('0x46')](_0x42e5c5[_0xe3b6('0x6e')])&&_0x42e5c5['predictiveIntervalAvgTalktime']>0x0){return!![];}loggerPredictive['info'](_0xe3b6('0x8c'));if(!_['isUndefined'](_0x42e5c5[_0xe3b6('0x89')])&&_0x42e5c5[_0xe3b6('0x89')]>0x0){return!![];}loggerPredictive[_0xe3b6('0x83')](_0xe3b6('0x8d'));}else{loggerPredictive[_0xe3b6('0x83')](_0xe3b6('0x8e'));}}else{loggerPredictive[_0xe3b6('0x83')]('History\x20information\x20are\x20empty');}return![];}function mergeDataErlangB(_0x3697cd){return function(_0x3803da){loggerPredictive[_0xe3b6('0x83')](_0xe3b6('0x8f'));loggerPredictive['info'](_0xe3b6('0x90'),_0x3803da['erlangCalls']);loggerPredictive[_0xe3b6('0x83')](_0xe3b6('0x91'),_0x3803da[_0xe3b6('0x92')]);loggerPredictive[_0xe3b6('0x83')](_0xe3b6('0x93'),_0x3803da[_0xe3b6('0x7a')]);loggerPredictive[_0xe3b6('0x83')](_0xe3b6('0x94'),_0x3803da['erlangBusyFactor']);loggerPredictive[_0xe3b6('0x83')](_0xe3b6('0x93'),_0x3803da[_0xe3b6('0x7a')]);loggerPredictive['info']('---------------------------');_[_0xe3b6('0x95')](_0x3697cd,_0x3803da);};}function getDiff(_0x590b7c){var _0xd76e76=moment()[_0xe3b6('0x51')](0x0);var _0xb20daf=moment(_0x590b7c)[_0xe3b6('0x51')](0x0);return _0xd76e76['diff'](_0xb20daf,'seconds');}function ifInterval(_0xfce54e,_0x454752){if(_['isUndefined'](_0x454752)){return![];}return getDiff(_0x454752)<_0xfce54e*0x3c;}function freeVariablesPredictive(_0x421b60){if(isNotNull(_0x421b60)){if(!_[_0xe3b6('0x46')](_0x421b60[_0xe3b6('0x2d')])){_0x421b60[_0xe3b6('0x2d')]=undefined;loggerPredictive['info'](_0x421b60[_0xe3b6('0x49')],_0xe3b6('0x96'));}if(!_[_0xe3b6('0x46')](_0x421b60['startPredictive'])){_0x421b60[_0xe3b6('0x2c')]=undefined;loggerPredictive[_0xe3b6('0x83')](_0x421b60['name'],_0xe3b6('0x97'));}if(!_[_0xe3b6('0x46')](_0x421b60[_0xe3b6('0x98')])){clearInterval(_0x421b60['handlePredictive']);_0x421b60[_0xe3b6('0x98')]=undefined;loggerPredictive[_0xe3b6('0x83')](_0x421b60[_0xe3b6('0x49')],_0xe3b6('0x99'));}}}function erlangb(_0x1759eb,_0x1933c6){if(_0x1933c6===0x0){return 0x0;}var _0x67f3cb=0x1;for(var _0x1840dd=0x1;_0x1840dd<=_0x1933c6;_0x1840dd+=0x1){_0x67f3cb=0x1+_0x67f3cb*_0x1840dd/_0x1759eb;}return 0x1/_0x67f3cb;}function isVoiceQueueOutbound(_0x302714){return _0x302714===_0xe3b6('0x55');}function isNotPreview(_0x2a2b7f){return _0x2a2b7f!==_0xe3b6('0x22');}function isCampaignIvr(_0xb218ed){return _0xb218ed===_0xe3b6('0x9a');}function getCallerId(_0x26b89d,_0x42cccf,_0x38e769){if(!_[_0xe3b6('0x46')](_0x38e769)&&typeof _0x38e769===_0xe3b6('0x9b')&&!_[_0xe3b6('0x4f')](_0x38e769)){if(!_[_0xe3b6('0x46')](_0x42cccf)&&typeof _0x42cccf==='string'&&!_[_0xe3b6('0x4f')](_0x42cccf)){return util['format'](_0xe3b6('0x9c'),_0x42cccf,_0x38e769);}return util[_0xe3b6('0x7e')]('\x22%s\x22\x20<%s>',_0x38e769,_0x38e769);}if(!_[_0xe3b6('0x46')](_0x26b89d)&&typeof _0x26b89d===_0xe3b6('0x9b')&&!_[_0xe3b6('0x4f')](_0x26b89d)){return _0x26b89d;}return _0xe3b6('0x9d');}function loggerCatchQueueSummary(_0x1ee7a6,_0x4e47f2){return function(_0x21afbe){freeVariablesPredictive(_0x4e47f2);emitVoiceQueueSummary(_0x4e47f2);emitCampaignSummary(_0x4e47f2);loggerSyncQueueSummary[_0xe3b6('0x9e')](_0x1ee7a6,util[_0xe3b6('0x9f')](_0x21afbe,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x55c8be,_0x540c66){return function(_0x31c5c3){loggerPredictive['error'](_0x540c66[_0xe3b6('0x49')],_0x55c8be);loggerPredictive[_0xe3b6('0x9e')](_0x31c5c3['stack']);freeVariablesPredictive(_0x540c66);};}function loggerCatch(_0x15c0f2){return function(_0x4b435d){logger[_0xe3b6('0x9e')](_0x15c0f2,util[_0xe3b6('0x9f')](_0x4b435d,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x328168){return _0x328168&&!_[_0xe3b6('0x46')](_0x328168)&&_0x328168['length']>0x0;}function decremetOriginate(_0x1cb57d){if(!_['isUndefined'](_0x1cb57d)&&_0x1cb57d!==null){if(typeof _0x1cb57d['originated']!=='undefined'){if(_0x1cb57d[_0xe3b6('0x78')]>0x0){_0x1cb57d[_0xe3b6('0x78')]-=0x1;}else{logger['error']('[decremetOriginate]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0xe3b6('0x9e')](_0xe3b6('0xa0'));}}function checkContactLowerLimitOriginate(_0x452148,_0x386f49,_0x26421e){if(_0x386f49>_0x26421e){for(var _0x1b563c=0x0;_0x1b563c<_0x386f49-_0x26421e;_0x1b563c+=0x1){decremetOriginate(_0x452148);}}}function loggerGetContactDialer(_0x30709b,_0x4e003f,_0x46f236){return function(_0x3305e1){checkContactLowerLimitOriginate(_0x4e003f,_0x46f236,0x0);logger[_0xe3b6('0x9e')](_0x30709b,util[_0xe3b6('0x9f')](_0x3305e1,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x36e6f5){return function(_0x574b2c){if(isNotNull(_0x574b2c)&&isNotNull(_0x574b2c[0x0])){if(_0x574b2c[0x0]['contactsRescheduled']>0x0){_0x36e6f5[_0xe3b6('0x47')]=_0xe3b6('0xa1');logger['info']('[getContactDialer2][ReScheduled]'+_0x36e6f5['name'],_0x574b2c[0x0]['contactsRescheduled'],_0xe3b6('0xa2'));}else{_0x36e6f5['message']=_0xe3b6('0xa3');logger[_0xe3b6('0x83')]('[getContactDialer2][Empty]'+_0x36e6f5[_0xe3b6('0x49')]);}}};}function notSendMessagesQueue(_0x3fd1a6){if(_0x3fd1a6[_0xe3b6('0xa4')]){freeVariablesPredictive(_0x3fd1a6);if(_0x3fd1a6['originated']===0x0&&_0x3fd1a6['talking']===0x0&&_0x3fd1a6['waiting']===0x0&&(_0x3fd1a6[_0xe3b6('0x59')]||0x0)===0x0){_0x3fd1a6[_0xe3b6('0xa4')]=![];_0x3fd1a6[_0xe3b6('0x57')]=0x0;_0x3fd1a6['message']='NOT_ACTIVE';loggerSyncQueueSummary[_0xe3b6('0x9e')](_0xe3b6('0xa5'),_0x3fd1a6['name'],_0xe3b6('0xa6'));}else{_0x3fd1a6[_0xe3b6('0x47')]=_0xe3b6('0xa7');loggerSyncQueueSummary[_0xe3b6('0x9e')](_0xe3b6('0xa5'),_0x3fd1a6[_0xe3b6('0x49')],'is\x20disactive');}emitVoiceQueueSummary(_0x3fd1a6);}}function notSendMessagesCampaign(_0x1bf61a){if(_0x1bf61a[_0xe3b6('0xa4')]){if(_0x1bf61a[_0xe3b6('0x78')]===0x0){_0x1bf61a[_0xe3b6('0xa4')]=![];_0x1bf61a[_0xe3b6('0x47')]=_0xe3b6('0xa8');loggerSyncQueueSummary[_0xe3b6('0x9e')](_0xe3b6('0xa9'),_0x1bf61a[_0xe3b6('0x49')],'is\x20not\x20active');}else{_0x1bf61a[_0xe3b6('0x47')]=_0xe3b6('0xa7');loggerSyncQueueSummary[_0xe3b6('0x9e')](_0xe3b6('0xa9'),_0x1bf61a['name'],_0xe3b6('0xaa'));}emitCampaignSummary(_0x1bf61a);}}function createObjHistory(_0x327dbe,_0x3c7fbf,_0x17e51f,_0x113f97,_0x27a3f8){_0x327dbe[_0xe3b6('0x47')]=_0x17e51f;var _0x5b3530=new Action(_0x327dbe,_0x3c7fbf);var _0x38494c=new History(_0x5b3530);_0x38494c[_0xe3b6('0xab')]=_0x113f97;_0x38494c['statedesc']=_0x27a3f8;_0x38494c['endtime']=_0x5b3530[_0xe3b6('0xac')];return _0x38494c;}Dialer['prototype']['loopClearZombieChannels']=function(){var _0x490d1a=this;setInterval(function(){_0x490d1a[_0xe3b6('0xad')](_0x490d1a[_0xe3b6('0x2a')],_0xe3b6('0xae'));_0x490d1a[_0xe3b6('0xad')](_0x490d1a['actions'],'[actions]');},0x32c8);};Dialer[_0xe3b6('0x1f')][_0xe3b6('0xad')]=function(_0x420a42,_0xd85e96){var _0x45d117=this;for(var _0x51eedb in _0x420a42){if(typeof _0x420a42[_0x51eedb]!==_0xe3b6('0xaf')){this['sequence']['enqueue'](function(){if(!_[_0xe3b6('0xb0')](_0x420a42[_0x51eedb])){return ami[_0xe3b6('0xb1')]({'action':'status','channel':_0x420a42[_0x51eedb][_0xe3b6('0xb2')]})['catch'](function(_0x202785){if(_0x202785['message']===_0xe3b6('0xb3')){setTimeout(function(){if(_0x420a42[_0x51eedb]&&_0x420a42[_0x51eedb][_0xe3b6('0x5c')]!=='ivr'){_0x45d117[_0xe3b6('0xb4')](_0x45d117['voiceQueues'][_0x420a42[_0x51eedb]['queue']]);logger[_0xe3b6('0x9e')]('[Dialer][checkChannel]',_0xd85e96,_0x51eedb,_0x420a42[_0x51eedb][_0xe3b6('0xb5')]);delete _0x420a42[_0x51eedb];}if(_0x420a42[_0x51eedb]&&_0x420a42[_0x51eedb]['type']===_0xe3b6('0x9a')){_0x45d117['updateOriginated'](_0x45d117[_0xe3b6('0x24')][_0x420a42[_0x51eedb][_0xe3b6('0xb5')]]);logger[_0xe3b6('0x9e')](_0xe3b6('0xb6'),_0xd85e96,_0x51eedb,_0x420a42[_0x51eedb][_0xe3b6('0xb5')]);delete _0x420a42[_0x51eedb];}},0x2328);}});}});}}};Dialer[_0xe3b6('0x1f')]['countReScheduled']=function(_0x2e64af){return BPromise[_0xe3b6('0xb7')]()['then'](cmHopper['countReScheduled'](_0x2e64af))[_0xe3b6('0xb8')](loggerCatch(_0xe3b6('0xb9')));};Dialer['prototype']['checkIsBlackList']=function(_0x202a37){return BPromise[_0xe3b6('0xb7')]()['then'](cmHopperBlack[_0xe3b6('0xba')](_0x202a37))[_0xe3b6('0xb8')](loggerCatch('[checkIsBlackList]\x20'));};Dialer[_0xe3b6('0x1f')][_0xe3b6('0xbb')]=function(_0x4cfbf9,_0x2116f7,_0x5e342a){return BPromise[_0xe3b6('0xb7')]()['then'](cmHopperAdditionalPhone[_0xe3b6('0xbb')](_0x4cfbf9,_0x2116f7,_0x5e342a))[_0xe3b6('0xb8')](loggerCatch(_0xe3b6('0xbc')));};Dialer['prototype']['swapAdditionalPhones']=function(_0x25fbbb,_0xc5cb60,_0x3bac69){return BPromise[_0xe3b6('0xb7')]()[_0xe3b6('0xbd')](cmHopperAdditionalPhone[_0xe3b6('0xbe')](_0x25fbbb,_0xc5cb60,_0x3bac69))[_0xe3b6('0xb8')](loggerCatch(_0xe3b6('0xbf')));};Dialer[_0xe3b6('0x1f')][_0xe3b6('0xc0')]=function(_0x679e25){return BPromise[_0xe3b6('0xb7')]()[_0xe3b6('0xbd')](cmHopperBlack[_0xe3b6('0xc0')](_0x679e25))[_0xe3b6('0xb8')](loggerCatch(_0xe3b6('0xc1')));};Dialer[_0xe3b6('0x1f')][_0xe3b6('0xc2')]=function(_0xb06a94){return BPromise[_0xe3b6('0xb7')]()[_0xe3b6('0xbd')](cmHopperHistory[_0xe3b6('0xc3')](_0xb06a94))['catch'](loggerCatch('[averageHandleTime]\x20'));};Dialer[_0xe3b6('0x1f')][_0xe3b6('0xc4')]=function(_0x507ca6){return BPromise[_0xe3b6('0xb7')]()[_0xe3b6('0xbd')](cmHopper[_0xe3b6('0xc4')](_0x507ca6))['catch'](loggerCatch(_0xe3b6('0xc5')));};Dialer[_0xe3b6('0x1f')][_0xe3b6('0xc6')]=function(_0x5ab18d,_0x6f18fe,_0x163d0d){return BPromise[_0xe3b6('0xb7')]()['then'](cmHopper[_0xe3b6('0xc6')](_0x5ab18d,_0x6f18fe,_0x163d0d))[_0xe3b6('0xb8')](loggerCatch(_0xe3b6('0xc7')));};Dialer[_0xe3b6('0x1f')][_0xe3b6('0xc8')]=function(_0x5a574d,_0x1e7a78,_0x2a435b,_0x4f401e,_0xb9556){return BPromise[_0xe3b6('0xb7')]()['then'](cmHopper['getContactDialer'](_0x5a574d,_0x1e7a78,_0x2a435b,_0x4f401e))[_0xe3b6('0xb8')](function(_0x148e76){_0xb9556[_0xe3b6('0xc9')]-=_0x2a435b;_0xb9556[_0xe3b6('0xc9')]=_0xb9556['temp']>0x0?_0xb9556['temp']:0x0;loggerCatch('[getContactDialer]\x20')(_0x148e76);});};Dialer[_0xe3b6('0x1f')][_0xe3b6('0xca')]=function(_0xd84a64,_0x233d4a,_0x3227b5,_0x3c4ecc){return BPromise[_0xe3b6('0xb7')]()[_0xe3b6('0xbd')](cmHopper[_0xe3b6('0xca')](_0xd84a64,_0x233d4a,_0x3227b5))['catch'](function(_0x33318b){_0x3c4ecc[_0xe3b6('0xc9')]-=_0x233d4a;_0x3c4ecc[_0xe3b6('0xc9')]=_0x3c4ecc[_0xe3b6('0xc9')]>0x0?_0x3c4ecc['temp']:0x0;loggerCatch(_0xe3b6('0xcb'))(_0x33318b);});};Dialer[_0xe3b6('0x1f')]['getVoiceQueueRtPauses']=function(_0x73ca70){return BPromise['resolve']()['then'](voiceQueueRt[_0xe3b6('0xcc')](_0x73ca70))[_0xe3b6('0xb8')](loggerCatch(_0xe3b6('0xcd')));};Dialer['prototype'][_0xe3b6('0xce')]=function(_0x1052f4){return BPromise[_0xe3b6('0xb7')]()['then'](cmHopper[_0xe3b6('0xce')](_0x1052f4))[_0xe3b6('0xb8')](loggerCatch(_0xe3b6('0xcf')));};Dialer[_0xe3b6('0x1f')][_0xe3b6('0xd0')]=function(_0x3e29bd){return BPromise['resolve']()[_0xe3b6('0xbd')](cmHopperHistory[_0xe3b6('0xd0')](_0x3e29bd))[_0xe3b6('0xb8')](loggerCatch(_0xe3b6('0xd1')));};Dialer[_0xe3b6('0x1f')][_0xe3b6('0xb4')]=function(_0x3a3c3e){if(!_[_0xe3b6('0x46')](_0x3a3c3e)&&_0x3a3c3e!==null){if(typeof _0x3a3c3e[_0xe3b6('0x78')]!==_0xe3b6('0xaf')){if(_0x3a3c3e[_0xe3b6('0x78')]>0x0){_0x3a3c3e[_0xe3b6('0x78')]-=0x1;}else{logger[_0xe3b6('0x9e')]('[updateOriginated]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0xe3b6('0x9e')](_0xe3b6('0xd2'));}};Dialer[_0xe3b6('0x1f')][_0xe3b6('0xd3')]=function(_0x24cd56,_0x1b9418){var _0x655329=this;return function(_0x4e850c){_0x655329['updateOriginated'](_0x1b9418);logger[_0xe3b6('0x9e')](_0x24cd56,util[_0xe3b6('0x9f')](_0x4e850c,{'showHidden':![],'depth':null}));};};Dialer[_0xe3b6('0x1f')][_0xe3b6('0xd4')]=function(_0x382cef,_0x5bd850,_0x33823e){var _0x2d80a7={'state':0x19,'statedesc':_0xe3b6('0xd5')};this[_0xe3b6('0xb4')](_0x5bd850);this['saveInDb'](_['merge'](_0x2d80a7,_[_0xe3b6('0xd6')](_0x33823e,[_0xe3b6('0xd7'),_0xe3b6('0xd8'),_0xe3b6('0xd9'),_0xe3b6('0xda'),'CampaignId'])),_0xe3b6('0xdb'),'[emptyContact]');logger['error'](_0x382cef);};Dialer[_0xe3b6('0x1f')][_0xe3b6('0xdc')]=function(_0x29b060){return _0x29b060===_0xe3b6('0xdd');};Dialer['prototype'][_0xe3b6('0xde')]=function(_0xd2bcd7){return!_['isUndefined'](_0xd2bcd7)&&_0xd2bcd7&&!_[_0xe3b6('0x46')](_0xd2bcd7['name'])&&!_['isUndefined'](_0xd2bcd7[_0xe3b6('0x7d')])&&_0xd2bcd7['active']&&(this[_0xe3b6('0x26')][util[_0xe3b6('0x7e')](_0xe3b6('0xdf'),_0xd2bcd7[_0xe3b6('0x49')])]['status']==='reachable'||this[_0xe3b6('0x26')][util['format'](_0xe3b6('0xdf'),_0xd2bcd7[_0xe3b6('0x49')])][_0xe3b6('0xe0')]===_0xe3b6('0xe1'));};Dialer[_0xe3b6('0x1f')][_0xe3b6('0xe2')]=function(_0x1cc4c4,_0x202701,_0x117095){this[_0xe3b6('0xd0')](_0x1cc4c4)[_0xe3b6('0xb8')](loggerCatch(_0x202701));this[_0xe3b6('0xce')](_0x1cc4c4)['catch'](loggerCatch(_0x117095));};Dialer[_0xe3b6('0x1f')][_0xe3b6('0x3e')]=function(_0x504d48){var _0x4510b5=this[_0xe3b6('0x2a')][_0x504d48[_0xe3b6('0xe3')]];var _0x140058;if(!_[_0xe3b6('0xb0')](_0x504d48)&&!_['isNil'](_0x504d48[_0xe3b6('0xe4')])&&!_[_0xe3b6('0xb0')](_0x504d48[_0xe3b6('0xe4')][_0xe3b6('0xe5')])&&_0x504d48[_0xe3b6('0xe6')]===_0xe3b6('0xe7')&&_0x4510b5){if(_0x4510b5[_0xe3b6('0x5c')]!==_0xe3b6('0x9a')&&this[_0xe3b6('0x23')][_0x4510b5[_0xe3b6('0xb5')]][_0xe3b6('0xe8')]&&_0x504d48[_0xe3b6('0xe9')]===_0xe3b6('0xea')){delete this['uniqueId'][_0x504d48[_0xe3b6('0xe3')]];this[_0xe3b6('0xb4')](this[_0xe3b6('0x23')][_0x4510b5[_0xe3b6('0xb5')]]);this[_0xe3b6('0x23')][_0x4510b5[_0xe3b6('0xb5')]][_0xe3b6('0x62')]+=0x1;this[_0xe3b6('0x23')][_0x4510b5[_0xe3b6('0xb5')]][_0xe3b6('0x61')]+=0x1;_0x140058=new Hangup(_0x4510b5,_0x504d48);_0x140058[_0xe3b6('0xab')]=0x12;_0x140058[_0xe3b6('0xeb')]=_0xe3b6('0xec');_0x140058['membername']='AMD';ami[_0xe3b6('0x54')](_0xe3b6('0xed'),ut[_0xe3b6('0xee')](_0x140058,_0xe3b6('0xef')));this[_0xe3b6('0xe2')](_0x140058,_0xe3b6('0xf0'),_0xe3b6('0xf1'));}if(_0x4510b5[_0xe3b6('0x5c')]!=='ivr'&&this['voiceQueues'][_0x4510b5[_0xe3b6('0xb5')]][_0xe3b6('0xe8')]&&_0x504d48['value']==='MACHINE'){var _0x2c8464=this;return new BPromise(function(_0x558023,_0x5b0875){delete _0x2c8464['uniqueId'][_0x504d48[_0xe3b6('0xe3')]];_0x2c8464[_0xe3b6('0xb4')](_0x2c8464[_0xe3b6('0x23')][_0x4510b5[_0xe3b6('0xb5')]]);_0x2c8464['voiceQueues'][_0x4510b5[_0xe3b6('0xb5')]]['outboundAnswerCallsDay']+=0x1;_0x2c8464[_0xe3b6('0x23')][_0x4510b5[_0xe3b6('0xb5')]][_0xe3b6('0x61')]+=0x1;var _0x2b80a2=_0x2c8464[_0xe3b6('0x23')][_0x4510b5['queue']];var _0x533023=new Hangup(_0x4510b5,_0x504d48);_0x533023[_0xe3b6('0xab')]=0x13;_0x533023['statedesc']='Machine';_0x533023[_0xe3b6('0xf2')]='AMD';_0x533023[_0xe3b6('0xf3')]+=0x1;_0x533023['countglobal']+=0x1;_0x533023[_0xe3b6('0xef')]=!![];ami['emit'](_0xe3b6('0xed'),ut[_0xe3b6('0xee')](_0x533023,_0xe3b6('0xef')));_0x2c8464[_0xe3b6('0xd0')](_0x533023)[_0xe3b6('0xb8')](loggerCatch(_0xe3b6('0xf4')));if(_0x533023[_0xe3b6('0xf5')]+_0x533023[_0xe3b6('0xf6')]+_0x533023[_0xe3b6('0xf7')]+_0x533023[_0xe3b6('0xf8')]+_0x533023[_0xe3b6('0xf9')]+_0x533023['countabandonedretry']+_0x533023['countmachineretry']+_0x533023[_0xe3b6('0xfa')]>=_0x2b80a2[_0xe3b6('0xfb')]){_0x2c8464[_0xe3b6('0xfc')](_0x533023,_0x558023,_0x5b0875,_0xe3b6('0xfd'));}else{if(_0x533023[_0xe3b6('0xf3')]>=_0x2b80a2[_0xe3b6('0xfe')]){_0x2c8464[_0xe3b6('0xff')](_0x533023,_0x558023,_0x5b0875,'reason\x2019\x20machine....');}else{_0x2c8464[_0xe3b6('0xc4')]({'active':![],'countmachineretry':_0x533023[_0xe3b6('0xf3')],'scheduledat':moment()['add'](_0x2b80a2['dialMachineRetryFrequency'],_0xe3b6('0x100'))[_0xe3b6('0x7e')](_0xe3b6('0x101')),'ContactId':_0x533023[_0xe3b6('0xd7')],'ListId':_0x533023['ListId'],'VoiceQueueId':_0x533023[_0xe3b6('0xda')]||undefined,'CampaignId':_0x533023[_0xe3b6('0x102')]||undefined})['catch'](loggerCatch(_0xe3b6('0x103')));_0x558023({'reschedule':0x1});}}});}if(_0x4510b5[_0xe3b6('0x5c')]===_0xe3b6('0x9a')&&this[_0xe3b6('0x24')][_0x4510b5[_0xe3b6('0xb5')]][_0xe3b6('0xe8')]&&_0x504d48[_0xe3b6('0xe9')]===_0xe3b6('0xea')){delete this[_0xe3b6('0x2a')][_0x504d48[_0xe3b6('0xe3')]];this['updateOriginated'](this[_0xe3b6('0x24')][_0x4510b5[_0xe3b6('0xb5')]]);_0x140058=new Hangup(_0x4510b5,_0x504d48);_0x140058[_0xe3b6('0xab')]=0x12;_0x140058[_0xe3b6('0xeb')]=_0xe3b6('0xec');_0x140058[_0xe3b6('0xf2')]='AMD';ami[_0xe3b6('0x54')](_0xe3b6('0xed'),ut[_0xe3b6('0xee')](_0x140058,'amd'));this[_0xe3b6('0xe2')](_0x140058,_0xe3b6('0x104'),_0xe3b6('0x105'));}if(_0x4510b5[_0xe3b6('0x5c')]===_0xe3b6('0x9a')&&this[_0xe3b6('0x24')][_0x4510b5[_0xe3b6('0xb5')]][_0xe3b6('0xe8')]&&_0x504d48['value']===_0xe3b6('0x106')){var _0x2c8464=this;return new BPromise(function(_0x36e6c8,_0x31fd7f){delete _0x2c8464[_0xe3b6('0x2a')][_0x504d48['uniqueid']];_0x2c8464[_0xe3b6('0xb4')](_0x2c8464['campaigns'][_0x4510b5[_0xe3b6('0xb5')]]);_0x2c8464[_0xe3b6('0x24')][_0x4510b5['queue']][_0xe3b6('0x62')]+=0x1;_0x2c8464[_0xe3b6('0x24')][_0x4510b5[_0xe3b6('0xb5')]][_0xe3b6('0x61')]+=0x1;var _0x69bb24=_0x2c8464[_0xe3b6('0x24')][_0x4510b5[_0xe3b6('0xb5')]];var _0x1552eb=new Hangup(_0x4510b5,_0x504d48);_0x1552eb[_0xe3b6('0xab')]=0x13;_0x1552eb[_0xe3b6('0xeb')]='Machine';_0x1552eb[_0xe3b6('0xf2')]=_0xe3b6('0x107');_0x1552eb[_0xe3b6('0xf3')]+=0x1;_0x1552eb[_0xe3b6('0x108')]+=0x1;_0x1552eb[_0xe3b6('0xef')]=!![];ami['emit'](_0xe3b6('0xed'),ut[_0xe3b6('0xee')](_0x1552eb,_0xe3b6('0xef')));_0x2c8464[_0xe3b6('0xd0')](_0x1552eb)['catch'](loggerCatch(_0xe3b6('0xf4')));if(_0x1552eb['countbusyretry']+_0x1552eb['countcongestionretry']+_0x1552eb[_0xe3b6('0xf7')]+_0x1552eb[_0xe3b6('0xf8')]+_0x1552eb['countdropretry']+_0x1552eb[_0xe3b6('0x109')]+_0x1552eb[_0xe3b6('0xf3')]+_0x1552eb[_0xe3b6('0xfa')]>=_0x69bb24[_0xe3b6('0xfb')]){_0x2c8464[_0xe3b6('0xfc')](_0x1552eb,_0x36e6c8,_0x31fd7f,'reason19\x20machine....');}else{if(_0x1552eb[_0xe3b6('0xf3')]>=_0x69bb24['dialMachineMaxRetry']){_0x2c8464['createStateFinal'](_0x1552eb,_0x36e6c8,_0x31fd7f,_0xe3b6('0x10a'));}else{_0x2c8464[_0xe3b6('0xc4')]({'active':![],'countmachineretry':_0x1552eb[_0xe3b6('0xf3')],'scheduledat':moment()[_0xe3b6('0x10b')](_0x69bb24[_0xe3b6('0x10c')],_0xe3b6('0x100'))[_0xe3b6('0x7e')](_0xe3b6('0x101')),'ContactId':_0x1552eb['ContactId'],'ListId':_0x1552eb[_0xe3b6('0xd8')],'VoiceQueueId':_0x1552eb['VoiceQueueId']||undefined,'CampaignId':_0x1552eb[_0xe3b6('0x102')]||undefined})[_0xe3b6('0xb8')](loggerCatch(_0xe3b6('0x103')));_0x36e6c8({'reschedule':0x1});}}});}}};Dialer['prototype'][_0xe3b6('0x3a')]=function(_0x129295){var _0x37a413=this[_0xe3b6('0x2a')][_0x129295[_0xe3b6('0xe3')]];var _0x1990a3=this;var _0x232989;if(_0x37a413&&_0x37a413['type']===_0xe3b6('0x9a')){delete this[_0xe3b6('0x2a')][_0x129295[_0xe3b6('0xe3')]];this[_0xe3b6('0xb4')](this['campaigns'][_0x37a413[_0xe3b6('0xb5')]]);this[_0xe3b6('0x24')][_0x37a413['queue']][_0xe3b6('0x10d')]+=0x1;_0x232989=new Hangup(_0x37a413,_0x129295);this[_0xe3b6('0xd0')](_0x232989)[_0xe3b6('0xb8')](loggerCatch(_0xe3b6('0x10e')));this[_0xe3b6('0xce')](_0x232989)['catch'](loggerCatch(_0xe3b6('0x10f')));}if(_0x37a413&&_0x37a413[_0xe3b6('0x5c')]!==_0xe3b6('0x9a')&&isNotNull(this[_0xe3b6('0x23')][_0x37a413['queue']]['dialQueueProject'])){delete this[_0xe3b6('0x2a')][_0x129295[_0xe3b6('0xe3')]];this[_0xe3b6('0xb4')](this['voiceQueues'][_0x37a413[_0xe3b6('0xb5')]]);this['voiceQueues'][_0x37a413['queue']][_0xe3b6('0x62')]+=0x1;this[_0xe3b6('0x23')][_0x37a413[_0xe3b6('0xb5')]][_0xe3b6('0x61')]+=0x1;_0x232989=new Hangup(_0x37a413,_0x129295);_0x232989[_0xe3b6('0xab')]=0x10;_0x232989[_0xe3b6('0xeb')]=_0xe3b6('0x110');_0x232989[_0xe3b6('0xf2')]='AGI';this['createHistory'](_0x232989)['catch'](loggerCatch(_0xe3b6('0x10e')));this[_0xe3b6('0xce')](_0x232989)[_0xe3b6('0xb8')](loggerCatch(_0xe3b6('0x10f')));}if(_0x37a413&&_0x37a413[_0xe3b6('0x5c')]!==_0xe3b6('0x9a')&&!isNotNull(this[_0xe3b6('0x23')][_0x37a413[_0xe3b6('0xb5')]][_0xe3b6('0x111')])){delete this[_0xe3b6('0x2a')][_0x129295['uniqueid']];this['updateOriginated'](this['voiceQueues'][_0x37a413[_0xe3b6('0xb5')]]);this[_0xe3b6('0x23')][_0x37a413[_0xe3b6('0xb5')]][_0xe3b6('0x6c')]+=0x1;_0x232989=new Hangup(_0x37a413,_0x129295);_0x232989[_0xe3b6('0xab')]=0xc;_0x232989[_0xe3b6('0xeb')]=_0x129295['cause-txt'];_0x232989[_0xe3b6('0xf2')]=_0xe3b6('0x112');this[_0xe3b6('0xd0')](_0x232989)[_0xe3b6('0xb8')](loggerCatch(_0xe3b6('0x10e')));this[_0xe3b6('0xce')](_0x232989)[_0xe3b6('0xb8')](loggerCatch('[syncHangupIvr]'));}};Dialer[_0xe3b6('0x1f')][_0xe3b6('0x37')]=function(_0x48e56c){var _0x19eb93=this[_0xe3b6('0x2a')][_0x48e56c['uniqueid']];var _0x2506f7=this;if(this[_0xe3b6('0x23')][_0x48e56c[_0xe3b6('0xb5')]]){if(_0x19eb93&&_0x19eb93[_0xe3b6('0x5c')]!==_0xe3b6('0x9a')){delete this[_0xe3b6('0x2a')][_0x48e56c['uniqueid']];this['voiceQueues'][_0x48e56c['queue']][_0xe3b6('0x62')]+=0x1;var _0x23c9f9=new AgentComplete(_0x19eb93,_0x48e56c);if(_0x48e56c[_0xe3b6('0x113')]===_0xe3b6('0x114')){_0x23c9f9[_0xe3b6('0x115')]=this[_0xe3b6('0x23')][_0x48e56c[_0xe3b6('0xb5')]][_0xe3b6('0x116')]&&this[_0xe3b6('0x23')][_0x48e56c[_0xe3b6('0xb5')]][_0xe3b6('0x117')]?moment()[_0xe3b6('0x7e')](_0xe3b6('0x101')):undefined;}this[_0xe3b6('0xd0')](_0x23c9f9)[_0xe3b6('0xb8')](loggerCatch(_0xe3b6('0x118')));this[_0xe3b6('0xce')](_0x23c9f9)[_0xe3b6('0xb8')](loggerCatch('[syncAgentComplete]'));}}};Dialer[_0xe3b6('0x1f')][_0xe3b6('0x31')]=function(_0x2247ae){if(this[_0xe3b6('0x23')][_0x2247ae[_0xe3b6('0xb5')]]){if(this[_0xe3b6('0x2a')][_0x2247ae[_0xe3b6('0xe3')]]&&this['uniqueId'][_0x2247ae[_0xe3b6('0xe3')]]['type']!==_0xe3b6('0x9a')){this[_0xe3b6('0xb4')](this[_0xe3b6('0x23')][_0x2247ae[_0xe3b6('0xb5')]]);this[_0xe3b6('0x2a')][_0x2247ae['uniqueid']][_0xe3b6('0x119')]=moment()[_0xe3b6('0x7e')]('YYYY-MM-DD\x20HH:mm:ss');}}};Dialer['prototype'][_0xe3b6('0x11a')]=function(_0x278955,_0x9059d9){this[_0xe3b6('0xd0')](_0x278955)[_0xe3b6('0xb8')](loggerCatch(_0xe3b6('0x118')));if(_0x9059d9==0x0){this[_0xe3b6('0xce')](_0x278955)['catch'](loggerCatch(_0xe3b6('0x11b')));}};Dialer['prototype'][_0xe3b6('0x34')]=function(_0x4548e2){var _0x4d9a5a=this[_0xe3b6('0x2a')][_0x4548e2[_0xe3b6('0xe3')]];var _0x510fd6=this;var _0x13c6e9=![];var _0x3d2d87;var _0x1a6023;if(this[_0xe3b6('0x23')][_0x4548e2[_0xe3b6('0xb5')]]){if(_0x4d9a5a&&_0x4d9a5a['type']!==_0xe3b6('0x9a')){delete this[_0xe3b6('0x2a')][_0x4548e2['uniqueid']];this[_0xe3b6('0xb4')](this[_0xe3b6('0x23')][_0x4548e2[_0xe3b6('0xb5')]]);_0x4d9a5a[_0xe3b6('0x11c')]=moment()[_0xe3b6('0x7e')](_0xe3b6('0x101'));var _0xa9293f=new QueueCallerAbandon(_0x4d9a5a,_0x4548e2);if(getSeconds(_0x4d9a5a[_0xe3b6('0x11c')],_0x4d9a5a['responsetime'])>=_0x4d9a5a['dialQueueTimeout']){this[_0xe3b6('0x23')][_0x4548e2['queue']]['predictiveIntervalDroppedCallsTimeout']+=0x1;this['voiceQueues'][_0x4548e2[_0xe3b6('0xb5')]][_0xe3b6('0x66')]+=0x1;this[_0xe3b6('0x23')][_0x4548e2[_0xe3b6('0xb5')]][_0xe3b6('0x72')]+=0x1;_0xa9293f['state']=0xa;_0xa9293f[_0xe3b6('0xeb')]=_0xe3b6('0x11d');_0xa9293f[_0xe3b6('0x11e')]=_0xe3b6('0x11f');_0xa9293f['agiafterat']=this['voiceQueues'][_0x4548e2[_0xe3b6('0xb5')]][_0xe3b6('0x116')]?moment()['format'](_0xe3b6('0x101')):undefined;_0xa9293f[_0xe3b6('0xf9')]+=0x1;_0xa9293f[_0xe3b6('0x108')]+=0x1;_0x3d2d87=this['voiceQueues'][_0x4548e2[_0xe3b6('0xb5')]]['dialDropRetryFrequency'];_0x1a6023=this['voiceQueues'][_0x4548e2[_0xe3b6('0xb5')]][_0xe3b6('0x120')];_0x510fd6[_0xe3b6('0xbb')](_0xa9293f,_0xa9293f[_0xe3b6('0xab')],_0x4d9a5a[_0xe3b6('0x121')])[_0xe3b6('0xbd')](function(_0x2279cf){_0x13c6e9=_0x2279cf[_0xe3b6('0x122')]==0x1;if(_0xa9293f[_0xe3b6('0xf9')]>=_0x510fd6[_0xe3b6('0x23')][_0x4548e2[_0xe3b6('0xb5')]][_0xe3b6('0x123')]){_0x510fd6[_0xe3b6('0x11a')](_0xa9293f,_0x2279cf[_0xe3b6('0x122')]);}else{_0x510fd6['rescheduleContact']({'active':![],'countdropretry':_0xa9293f[_0xe3b6('0xf9')],'scheduledat':moment()[_0xe3b6('0x10b')](_0x510fd6['voiceQueues'][_0x4548e2[_0xe3b6('0xb5')]][_0xe3b6('0x124')],_0xe3b6('0x100'))[_0xe3b6('0x7e')](_0xe3b6('0x101')),'ContactId':_0x4d9a5a[_0xe3b6('0xd7')],'ListId':_0x4d9a5a[_0xe3b6('0xd8')],'VoiceQueueId':_0x4d9a5a[_0xe3b6('0xda')]||undefined,'CampaignId':_0x4d9a5a[_0xe3b6('0x102')]||undefined})[_0xe3b6('0xb8')](loggerCatch('[rescheduleContact][Drop]'));var _0x4db0ef=new History(_0xa9293f);_0x4db0ef[_0xe3b6('0xab')]=0xa;_0x4db0ef[_0xe3b6('0xeb')]='Drop';_0x4db0ef[_0xe3b6('0xac')]=moment()[_0xe3b6('0x7e')](_0xe3b6('0x101'));_0x4db0ef[_0xe3b6('0x125')]=_0x4db0ef[_0xe3b6('0xac')];_0x4db0ef[_0xe3b6('0x126')]=_0xa9293f['calleridname'];_0x4db0ef[_0xe3b6('0x127')]=_0xa9293f['calleridnum'];_0x510fd6['createHistory'](_0x4db0ef)[_0xe3b6('0xb8')](loggerCatch('[syncAgentComplete][createHistory][10]'));}})['then'](function(_0x523a54){if(_0x13c6e9)_0x510fd6[_0xe3b6('0xbe')](_0xa9293f,_0x3d2d87,_0x1a6023)['then'](function(_0x44dd12){return 0x1;});});}else{this[_0xe3b6('0x23')][_0x4548e2[_0xe3b6('0xb5')]][_0xe3b6('0x6f')]+=0x1;this[_0xe3b6('0x23')][_0x4548e2['queue']]['outboundDropCallsDayCallersExit']+=0x1;_0xa9293f['state']=0xb;_0xa9293f[_0xe3b6('0xeb')]=_0xe3b6('0x128');_0xa9293f[_0xe3b6('0x11e')]='CALLEREXIT';_0xa9293f['countabandonedretry']+=0x1;_0xa9293f[_0xe3b6('0x108')]+=0x1;_0x3d2d87=this['voiceQueues'][_0x4548e2['queue']][_0xe3b6('0x129')];_0x1a6023=this['voiceQueues'][_0x4548e2[_0xe3b6('0xb5')]][_0xe3b6('0x120')];_0x510fd6[_0xe3b6('0xbb')](_0xa9293f,_0xa9293f['state'],_0x4d9a5a[_0xe3b6('0x121')])[_0xe3b6('0xbd')](function(_0x1c760b){if(_0xa9293f['countabandonedretry']>=_0x510fd6[_0xe3b6('0x23')][_0x4548e2['queue']][_0xe3b6('0x12a')]){_0x510fd6[_0xe3b6('0x11a')](_0xa9293f,_0x1c760b[_0xe3b6('0x122')]);}else{_0x510fd6[_0xe3b6('0xc4')]({'active':![],'countabandonedretry':_0xa9293f[_0xe3b6('0x109')],'scheduledat':moment()[_0xe3b6('0x10b')](_0x510fd6[_0xe3b6('0x23')][_0x4548e2[_0xe3b6('0xb5')]][_0xe3b6('0x129')],_0xe3b6('0x100'))[_0xe3b6('0x7e')](_0xe3b6('0x101')),'ContactId':_0x4d9a5a[_0xe3b6('0xd7')],'ListId':_0x4d9a5a[_0xe3b6('0xd8')],'VoiceQueueId':_0x4d9a5a['VoiceQueueId']||undefined,'CampaignId':_0x4d9a5a[_0xe3b6('0x102')]||undefined})[_0xe3b6('0xb8')](loggerCatch(_0xe3b6('0x12b')));var _0x169909=new History(_0xa9293f);_0x169909[_0xe3b6('0xab')]=0xb;_0x169909[_0xe3b6('0xeb')]=_0xe3b6('0x128');_0x169909[_0xe3b6('0xac')]=moment()[_0xe3b6('0x7e')](_0xe3b6('0x101'));_0x169909['endtime']=_0x169909['starttime'];_0x169909[_0xe3b6('0x126')]=_0xa9293f[_0xe3b6('0x126')];_0x169909[_0xe3b6('0x127')]=_0xa9293f[_0xe3b6('0x127')];_0x510fd6[_0xe3b6('0xd0')](_0x169909)[_0xe3b6('0xb8')](loggerCatch(_0xe3b6('0x12c')));}})[_0xe3b6('0xbd')](function(_0x353639){if(_0x13c6e9)_0x510fd6[_0xe3b6('0xbe')](_0xa9293f,_0x3d2d87,_0x1a6023)[_0xe3b6('0xbd')](function(_0x4e784b){return 0x1;});});}}}};Dialer[_0xe3b6('0x1f')][_0xe3b6('0x3c')]=function(_0x25c0d7){if(this['actions'][_0x25c0d7['uniqueid']]){this[_0xe3b6('0x12d')][_0x25c0d7['uniqueid']][_0xe3b6('0xb2')]=_0x25c0d7[_0xe3b6('0xb2')];}if(this[_0xe3b6('0x2a')][_0x25c0d7[_0xe3b6('0xe3')]]){this[_0xe3b6('0x2a')][_0x25c0d7[_0xe3b6('0xe3')]][_0xe3b6('0xb2')]=_0x25c0d7[_0xe3b6('0xb2')];}};Dialer[_0xe3b6('0x1f')][_0xe3b6('0x40')]=function(_0x5bd485){if(strategy[this[_0xe3b6('0x23')][this['actions'][_0x5bd485['actionid']]['queue']][_0xe3b6('0x12e')]]===_0xe3b6('0x1e')){if(this[_0xe3b6('0x12d')][_0x5bd485[_0xe3b6('0x12f')]]&&_[_0xe3b6('0xb0')](this[_0xe3b6('0x12d')][_0x5bd485[_0xe3b6('0x12f')]][_0xe3b6('0x130')])&&_0x5bd485[_0xe3b6('0xe0')]==='1'&&_0x5bd485[_0xe3b6('0x131')]==='0'){if(this[_0xe3b6('0x25')][_0x5bd485['stateinterface']]){if(!this[_0xe3b6('0x25')][_0x5bd485[_0xe3b6('0x132')]][_0xe3b6('0x130')]){this['agents'][_0x5bd485['stateinterface']][_0xe3b6('0x130')]=!![];this[_0xe3b6('0x12d')][_0x5bd485[_0xe3b6('0x12f')]][_0xe3b6('0x130')]=!![];this[_0xe3b6('0x12d')][_0x5bd485[_0xe3b6('0x12f')]]['stateinterface']=_0x5bd485[_0xe3b6('0x132')];}}}}else if((strategy[this[_0xe3b6('0x23')][this[_0xe3b6('0x12d')][_0x5bd485['actionid']][_0xe3b6('0xb5')]][_0xe3b6('0x12e')]]||_0xe3b6('0x1d'))===_0xe3b6('0x1d')){if(this[_0xe3b6('0x12d')][_0x5bd485['actionid']]){if(this['agents'][_0x5bd485['stateinterface']]){this[_0xe3b6('0x12d')][_0x5bd485[_0xe3b6('0x12f')]]['stateinterface']=_0x5bd485[_0xe3b6('0x132')];if(_['isNil'](this['queueBooked'][this[_0xe3b6('0x12d')][_0x5bd485[_0xe3b6('0x12f')]][_0xe3b6('0xb5')]])){this['queueBooked'][this['actions'][_0x5bd485[_0xe3b6('0x12f')]][_0xe3b6('0xb5')]]=[];}this[_0xe3b6('0x133')][this[_0xe3b6('0x12d')][_0x5bd485['actionid']]['queue']]['push'](_[_0xe3b6('0x95')](_[_0xe3b6('0xd6')](this['actions'][_0x5bd485[_0xe3b6('0x12f')]],[_0xe3b6('0x134'),_0xe3b6('0x132')]),{'status':_0x5bd485['status'],'paused':_0x5bd485[_0xe3b6('0x131')]}));}}}};function unlockQueueStatus(_0x316d38,_0x82ebe0){setTimeout(function(){if(_[_0xe3b6('0x46')](_0x316d38['queueStatusComplete'])){loggerBooked['error'](_0xe3b6('0x135'),_0x82ebe0);}_0x316d38['queueStatusComplete']=!![];loggerBooked[_0xe3b6('0x83')](_0xe3b6('0x136'),_0x82ebe0,JSON[_0xe3b6('0x50')](_[_0xe3b6('0xd6')](_0x316d38,[_0xe3b6('0x49'),'queueStatusComplete'])));},0x1f3);}Dialer[_0xe3b6('0x1f')][_0xe3b6('0x42')]=function(_0x3c08d3){var _0x205b17=this;var _0x2f8293=_0x205b17['voiceQueues'][_0x205b17['actions'][_0x3c08d3['actionid']][_0xe3b6('0xb5')]];if(strategy[this[_0xe3b6('0x23')][this['actions'][_0x3c08d3[_0xe3b6('0x12f')]][_0xe3b6('0xb5')]][_0xe3b6('0x12e')]]===_0xe3b6('0x1e')){if(this['actions'][_0x3c08d3['actionid']]&&this['actions'][_0x3c08d3[_0xe3b6('0x12f')]][_0xe3b6('0x132')]){this[_0xe3b6('0x22')][_0xe3b6('0x137')](this['actions'][_0x3c08d3[_0xe3b6('0x12f')]][_0xe3b6('0x134')],this[_0xe3b6('0x12d')][_0x3c08d3['actionid']][_0xe3b6('0x132')])['catch'](function(_0x1e67fc){logger['error'](_0xe3b6('0x138'),util[_0xe3b6('0x9f')](_0x1e67fc,{'showHidden':![],'depth':null}));})[_0xe3b6('0x139')](function(){_0x205b17['updateOriginated'](_0x205b17[_0xe3b6('0x23')][_0x205b17[_0xe3b6('0x12d')][_0x3c08d3[_0xe3b6('0x12f')]]['queue']]);_0x205b17[_0xe3b6('0x25')][_0x205b17[_0xe3b6('0x12d')][_0x3c08d3[_0xe3b6('0x12f')]][_0xe3b6('0x132')]]['locked']=![];delete _0x205b17[_0xe3b6('0x12d')][_0x3c08d3['actionid']];unlockQueueStatus(_0x2f8293);});}else{this['updateOriginated'](this['voiceQueues'][this['actions'][_0x3c08d3[_0xe3b6('0x12f')]][_0xe3b6('0xb5')]]);this[_0xe3b6('0xc4')]({'active':![],'ContactId':this[_0xe3b6('0x12d')][_0x3c08d3[_0xe3b6('0x12f')]][_0xe3b6('0xd7')],'ListId':this[_0xe3b6('0x12d')][_0x3c08d3[_0xe3b6('0x12f')]][_0xe3b6('0xd8')],'VoiceQueueId':this['actions'][_0x3c08d3[_0xe3b6('0x12f')]][_0xe3b6('0xda')]||undefined,'CampaignId':this[_0xe3b6('0x12d')][_0x3c08d3[_0xe3b6('0x12f')]][_0xe3b6('0x102')]||undefined})[_0xe3b6('0xb8')](loggerCatch(_0xe3b6('0x13a')));delete this[_0xe3b6('0x12d')][_0x3c08d3['actionid']];unlockQueueStatus(_0x2f8293);}}else if((strategy[this[_0xe3b6('0x23')][this[_0xe3b6('0x12d')][_0x3c08d3[_0xe3b6('0x12f')]][_0xe3b6('0xb5')]]['strategy']]||'rrmemory')===_0xe3b6('0x1d')){var _0x4a93f8;if(this[_0xe3b6('0x12d')][_0x3c08d3[_0xe3b6('0x12f')]]&&!_['isEmpty'](this[_0xe3b6('0x133')][this[_0xe3b6('0x12d')][_0x3c08d3[_0xe3b6('0x12f')]]['queue']])){if(this[_0xe3b6('0x2f')][_0x205b17[_0xe3b6('0x12d')][_0x3c08d3[_0xe3b6('0x12f')]][_0xe3b6('0xb5')]]){this['queueBookedRR'][_0x205b17[_0xe3b6('0x12d')][_0x3c08d3[_0xe3b6('0x12f')]][_0xe3b6('0xb5')]]=this[_0xe3b6('0x2f')][this[_0xe3b6('0x12d')][_0x3c08d3[_0xe3b6('0x12f')]][_0xe3b6('0xb5')]]?this[_0xe3b6('0x2f')][this[_0xe3b6('0x12d')][_0x3c08d3[_0xe3b6('0x12f')]][_0xe3b6('0xb5')]]:this['queueBooked'][this[_0xe3b6('0x12d')][_0x3c08d3['actionid']]['queue']]?this[_0xe3b6('0x133')][this[_0xe3b6('0x12d')][_0x3c08d3[_0xe3b6('0x12f')]][_0xe3b6('0xb5')]][_0xe3b6('0x13b')]||0x0:0x0;}this['queueBooked'][this[_0xe3b6('0x12d')][_0x3c08d3[_0xe3b6('0x12f')]][_0xe3b6('0xb5')]][_0xe3b6('0x13b')]=this[_0xe3b6('0x2f')][this[_0xe3b6('0x12d')][_0x3c08d3[_0xe3b6('0x12f')]][_0xe3b6('0xb5')]];for(var _0x5c966d=0x0;_0x5c966d<this['queueBooked'][this['actions'][_0x3c08d3[_0xe3b6('0x12f')]][_0xe3b6('0xb5')]]['length'];_0x5c966d+=0x1){_0x4a93f8=rr(this['queueBooked'][this[_0xe3b6('0x12d')][_0x3c08d3[_0xe3b6('0x12f')]][_0xe3b6('0xb5')]]);this[_0xe3b6('0x2f')][_0x205b17[_0xe3b6('0x12d')][_0x3c08d3[_0xe3b6('0x12f')]]['queue']]=this[_0xe3b6('0x133')][this['actions'][_0x3c08d3[_0xe3b6('0x12f')]][_0xe3b6('0xb5')]][_0xe3b6('0x13b')];if(_0x4a93f8[_0xe3b6('0xe0')]==='1'&&_0x4a93f8[_0xe3b6('0x131')]==='0'){break;}}if(!_[_0xe3b6('0xb0')](_0x4a93f8)){this[_0xe3b6('0x25')][_0x4a93f8[_0xe3b6('0x132')]]['unlockRR']=_['isUndefined'](this['agents'][_0x4a93f8[_0xe3b6('0x132')]]['unlockRR'])?!![]:this[_0xe3b6('0x25')][_0x4a93f8[_0xe3b6('0x132')]]['unlockRR'];}loggerBooked['info']('[booked][RR]',_0x3c08d3[_0xe3b6('0x12f')],_0xe3b6('0x13c'),JSON[_0xe3b6('0x50')](_['pick'](this['agents'][_0x4a93f8['stateinterface']],[_0xe3b6('0x49'),_0xe3b6('0x13d')])),_0xe3b6('0x13e'),JSON[_0xe3b6('0x50')](_0x4a93f8[_0xe3b6('0x134')]));if(!_[_0xe3b6('0xb0')](_0x4a93f8)&&_0x4a93f8[_0xe3b6('0xe0')]==='1'&&_0x4a93f8['paused']==='0'&&this[_0xe3b6('0x25')][_0x4a93f8['stateinterface']][_0xe3b6('0x13d')]){this[_0xe3b6('0x25')][_0x4a93f8[_0xe3b6('0x132')]][_0xe3b6('0x13d')]=![];this[_0xe3b6('0x133')][_0x205b17['actions'][_0x3c08d3['actionid']][_0xe3b6('0xb5')]]=[];this[_0xe3b6('0x22')]['run'](_0x4a93f8['idHopper'],_0x4a93f8[_0xe3b6('0x132')])[_0xe3b6('0xb8')](function(_0x5210e1){logger['error'](_0xe3b6('0x138'),util['inspect'](_0x5210e1,{'showHidden':![],'depth':null}));})['finally'](function(){_0x205b17[_0xe3b6('0xb4')](_0x205b17['voiceQueues'][_0x205b17[_0xe3b6('0x12d')][_0x3c08d3['actionid']][_0xe3b6('0xb5')]]);setTimeout(function(){_0x205b17[_0xe3b6('0x25')][_0x4a93f8[_0xe3b6('0x132')]][_0xe3b6('0x13d')]=!![];loggerBooked['info'](_0xe3b6('0x13f'),_0x3c08d3[_0xe3b6('0x12f')],_0xe3b6('0x13c'),JSON[_0xe3b6('0x50')](_[_0xe3b6('0xd6')](_0x205b17[_0xe3b6('0x25')][_0x4a93f8[_0xe3b6('0x132')]],[_0xe3b6('0x49'),_0xe3b6('0x13d')])),'contactAgent-idHopper:\x20',JSON[_0xe3b6('0x50')](_0x4a93f8[_0xe3b6('0x134')]));},0xc7);delete _0x205b17[_0xe3b6('0x12d')][_0x3c08d3[_0xe3b6('0x12f')]];unlockQueueStatus(_0x2f8293,_0x3c08d3['actionid']);});}else{loggerBooked[_0xe3b6('0x83')](_0xe3b6('0x140'));this['updateOriginated'](this[_0xe3b6('0x23')][this[_0xe3b6('0x12d')][_0x3c08d3[_0xe3b6('0x12f')]][_0xe3b6('0xb5')]]);this[_0xe3b6('0xc4')]({'active':![],'ContactId':this[_0xe3b6('0x12d')][_0x3c08d3[_0xe3b6('0x12f')]][_0xe3b6('0xd7')],'ListId':this[_0xe3b6('0x12d')][_0x3c08d3[_0xe3b6('0x12f')]][_0xe3b6('0xd8')],'VoiceQueueId':this['actions'][_0x3c08d3[_0xe3b6('0x12f')]]['VoiceQueueId']||undefined,'CampaignId':this[_0xe3b6('0x12d')][_0x3c08d3[_0xe3b6('0x12f')]][_0xe3b6('0x102')]||undefined})['catch'](loggerCatch(_0xe3b6('0x13a')));delete this[_0xe3b6('0x12d')][_0x3c08d3[_0xe3b6('0x12f')]];unlockQueueStatus(_0x2f8293);}}else{loggerBooked[_0xe3b6('0x83')](_0xe3b6('0x141'));this[_0xe3b6('0xb4')](this[_0xe3b6('0x23')][this[_0xe3b6('0x12d')][_0x3c08d3['actionid']]['queue']]);this['rescheduleContact']({'active':![],'ContactId':this[_0xe3b6('0x12d')][_0x3c08d3[_0xe3b6('0x12f')]][_0xe3b6('0xd7')],'ListId':this['actions'][_0x3c08d3[_0xe3b6('0x12f')]][_0xe3b6('0xd8')],'VoiceQueueId':this[_0xe3b6('0x12d')][_0x3c08d3[_0xe3b6('0x12f')]][_0xe3b6('0xda')]||undefined,'CampaignId':this[_0xe3b6('0x12d')][_0x3c08d3['actionid']]['CampaignId']||undefined})['catch'](loggerCatch('[unlock2][syncQueueStatusComplete]'));delete this['actions'][_0x3c08d3['actionid']];unlockQueueStatus(_0x2f8293);}}else{loggerBooked['info'](_0xe3b6('0x142'));this[_0xe3b6('0xb4')](this['voiceQueues'][this[_0xe3b6('0x12d')][_0x3c08d3[_0xe3b6('0x12f')]]['queue']]);this['rescheduleContact']({'active':![],'ContactId':this[_0xe3b6('0x12d')][_0x3c08d3[_0xe3b6('0x12f')]]['ContactId'],'ListId':this[_0xe3b6('0x12d')][_0x3c08d3[_0xe3b6('0x12f')]][_0xe3b6('0xd8')],'VoiceQueueId':this['actions'][_0x3c08d3[_0xe3b6('0x12f')]][_0xe3b6('0xda')]||undefined,'CampaignId':this[_0xe3b6('0x12d')][_0x3c08d3[_0xe3b6('0x12f')]][_0xe3b6('0x102')]||undefined})['catch'](loggerCatch(_0xe3b6('0x143')));delete this['actions'][_0x3c08d3[_0xe3b6('0x12f')]];unlockQueueStatus(_0x2f8293);}};Dialer[_0xe3b6('0x1f')]['loopCampaigns']=function(){var _0x4d8ab7=this;return BPromise['resolve']()[_0xe3b6('0xbd')](cmHopper[_0xe3b6('0x144')]({}))[_0xe3b6('0xbd')](function(){setInterval(function(){_0x4d8ab7[_0xe3b6('0x145')]();},0x3e8);});};Dialer['prototype'][_0xe3b6('0x146')]=function(_0x5e6bf3){var _0x49db26=this;return function(){if(!_0x49db26[_0xe3b6('0xde')](_0x5e6bf3[_0xe3b6('0x7c')])){if(!_0x49db26[_0xe3b6('0xde')](_0x5e6bf3[_0xe3b6('0x147')])){_0x5e6bf3[_0xe3b6('0x47')]='TRUNK_IS_NOT_REACHABLE';throw _0x5e6bf3['name']+_0xe3b6('0x148');}}};};Dialer[_0xe3b6('0x1f')]['checkIfTime']=function(_0x1b0dd3,_0x4d24fe,_0x397eca,_0x402c9b){var _0x4b85b4=this;return function(){var _0x29e1da=!![];return _0x4b85b4[_0xe3b6('0x149')](_0x1b0dd3,_0x4d24fe,_0x397eca,_0x402c9b,_0x29e1da);};};Dialer[_0xe3b6('0x1f')][_0xe3b6('0x14a')]=function(_0x43eb2d,_0x519393,_0x1899e2,_0x2c9f39){var _0x2d9f4c=this;return function(){var _0x3b843f=![];return _0x2d9f4c[_0xe3b6('0x149')](_0x43eb2d[_0xe3b6('0x4e')],_0x519393,_0x1899e2,_0x2c9f39,_0x3b843f);};};Dialer[_0xe3b6('0x1f')][_0xe3b6('0x149')]=function(_0x5b4be9,_0x21df35,_0x2867fc,_0x4be9e7,_0x12f0c4){var _0x54a506=[];return new BPromise(function(_0x56c297,_0x25462f){if(!isNotNull(_0x5b4be9)){_0x4be9e7[_0xe3b6('0x47')]='INTERVAL_IS_NULL';return _0x25462f(msgResponse('ifTime',_0xe3b6('0x14b'),_0x2867fc+'\x20Intervals\x20is\x20null\x20'));}if(_['isEmpty'](_0x5b4be9)){_0x4be9e7[_0xe3b6('0x47')]='INTERVAL_IS_EMPTY';return _0x25462f(msgResponse(_0xe3b6('0x149'),_0xe3b6('0x14b'),_0x2867fc+_0xe3b6('0x14c')));}if(_0x21df35&&_[_0xe3b6('0x46')](config['timezones'][_0x21df35])){_0x4be9e7[_0xe3b6('0x47')]=_0xe3b6('0x14d');return _0x25462f(msgResponse(_0xe3b6('0x149'),'Failure',_0x2867fc+_0xe3b6('0x14e')+_0x21df35));}if(_[_0xe3b6('0x14f')](_0x5b4be9)){for(var _0x4a2771=0x0;_0x4a2771<_0x5b4be9[_0xe3b6('0x150')];_0x4a2771+=0x1){_0x54a506[_0xe3b6('0x151')](ami['Action']({'action':_0xe3b6('0x152'),'command':util[_0xe3b6('0x7e')](_0xe3b6('0x153'),_0x5b4be9[_0x4a2771][_0xe3b6('0x154')],!_['isUndefined'](config['timezones'][_0x21df35])?_0x21df35:'')})[_0xe3b6('0xbd')](function(_0x367218){return _0x367218[_0xe3b6('0x155')][_0xe3b6('0x156')](_0xe3b6('0x157'))>=0x0;})['catch'](myreject(_0x25462f)));}}else{_0x54a506[_0xe3b6('0x151')](ami['Action']({'action':_0xe3b6('0x152'),'command':util[_0xe3b6('0x7e')]('iftime\x20%s,%s',_0x5b4be9,!_[_0xe3b6('0x46')](config[_0xe3b6('0x158')][_0x21df35])?_0x21df35:'')})[_0xe3b6('0xbd')](function(_0x467fc6){return _0x467fc6[_0xe3b6('0x155')][_0xe3b6('0x156')](_0xe3b6('0x157'))>=0x0;})[_0xe3b6('0xb8')](myreject(_0x25462f)));}BPromise[_0xe3b6('0x159')](_0x54a506)[_0xe3b6('0xbd')](function(_0x410c57){var _0x4cdf06=_[_0xe3b6('0x15a')](_0x410c57);if(_0x4cdf06){return _0x56c297(_0x4cdf06);}else{_0x4be9e7[_0xe3b6('0x47')]=_0x12f0c4?_0xe3b6('0x15b'):_0xe3b6('0x15c');return _0x25462f(msgResponse(_0xe3b6('0x15d'),_0xe3b6('0x14b'),_0xe3b6('0x15e')+_0x12f0c4+'\x20'+_0x2867fc+'\x20Interval\x20is\x20overtime:\x20'+util[_0xe3b6('0x9f')](_0x5b4be9,{'showHidden':![],'depth':null})+'Timezone:\x20'+_0x21df35));}})['catch'](function(_0xfbee03){return _0x25462f(msgResponse(_0xe3b6('0x149'),_0xe3b6('0x14b'),JSON[_0xe3b6('0x50')](_0xfbee03)));});});};Dialer[_0xe3b6('0x1f')][_0xe3b6('0x15f')]=function(_0x1b48a5){var _0x4d9e2f=this;return function(){switch(_0x1b48a5[_0xe3b6('0x160')]){case _0xe3b6('0x161'):freeVariablesPredictive(_0x1b48a5);_0x4d9e2f['handlePower'](_0x1b48a5,0x1);break;case'power':freeVariablesPredictive(_0x1b48a5);_0x4d9e2f[_0xe3b6('0x162')](_0x1b48a5,_0x1b48a5['dialPowerLevel']);break;case _0xe3b6('0xa'):_0x4d9e2f[_0xe3b6('0xa')](_0x1b48a5);break;case _0xe3b6('0x9'):freeVariablesPredictive(_0x1b48a5);_0x4d9e2f[_0xe3b6('0x162')](_0x1b48a5,0x1);break;default:freeVariablesPredictive(_0x1b48a5);logger[_0xe3b6('0x9e')](_0xe3b6('0x163'),_0x1b48a5[_0xe3b6('0x49')],_0xe3b6('0x164'));}};};Dialer['prototype'][_0xe3b6('0x165')]=function(_0x25bd1c){return BPromise[_0xe3b6('0xb7')]()[_0xe3b6('0xbd')](cmHopper[_0xe3b6('0x166')](_0x25bd1c['id'],previewRecallmeReminderInterval))[_0xe3b6('0xbd')](function(_0x7865cf){for(var _0x126c76=0x0;_0x126c76<_0x7865cf[_0xe3b6('0x150')];_0x126c76++){var _0x22eeb4=_0x7865cf[_0x126c76][_0xe3b6('0x167')][_0xe3b6('0x49')];if(_0x22eeb4)io['to'](util[_0xe3b6('0x7e')](_0xe3b6('0x168'),_0x22eeb4))[_0xe3b6('0x54')](_0xe3b6('0x169'),{'hopper':_0x7865cf[_0x126c76]});}})[_0xe3b6('0xb8')](function(_0x3a9fdc){});};Dialer[_0xe3b6('0x1f')][_0xe3b6('0x16a')]=function(_0x53b09a){var _0x119f9d=this;return function(){_0x119f9d['handleIvr'](_0x53b09a);};};Dialer[_0xe3b6('0x1f')][_0xe3b6('0xc')]=function(_0x4e4e60){var _0xa346bd=this;if(isNotPreview(_0x4e4e60['dialMethod'])){if(isVoiceQueueOutbound(_0x4e4e60[_0xe3b6('0x5c')])&&isActive(_0x4e4e60[_0xe3b6('0x5e')])){_0x4e4e60[_0xe3b6('0xa4')]=!![];BPromise[_0xe3b6('0xb7')]()[_0xe3b6('0xbd')](checkIsLoggedIn(_0x4e4e60,_0x4e4e60['loggedIn']))['then'](checkIsActive(_0x4e4e60,_0x4e4e60['dialActive']))['then'](checkInterval(_0x4e4e60))['then'](_0xa346bd[_0xe3b6('0x146')](_0x4e4e60))['then'](_0xa346bd['checkIfTime'](_0x4e4e60[_0xe3b6('0x16b')],_0x4e4e60[_0xe3b6('0x16c')],_0x4e4e60[_0xe3b6('0x49')],_0x4e4e60))['then'](_0xa346bd[_0xe3b6('0x14a')](_0x4e4e60[_0xe3b6('0x4b')],_0x4e4e60['dialTimezone'],_0x4e4e60[_0xe3b6('0x49')],_0x4e4e60))[_0xe3b6('0xbd')](_0xa346bd[_0xe3b6('0x15f')](_0x4e4e60))[_0xe3b6('0xb8')](loggerCatchQueueSummary('[syncQueueSummary]',_0x4e4e60));}else{notSendMessagesQueue(_0x4e4e60);}}else{freeVariablesPredictive(_0x4e4e60);if(_0x4e4e60[_0xe3b6('0x16d')]){_0xa346bd[_0xe3b6('0x165')](_0x4e4e60);}}};Dialer['prototype'][_0xe3b6('0x145')]=function(){var _0xe8d3ef=this;var _0x2f6b86;for(var _0x1c4712 in this[_0xe3b6('0x24')]){if(typeof this['campaigns'][_0x1c4712]!==_0xe3b6('0xaf')){_0x2f6b86=this[_0xe3b6('0x24')][_0x1c4712];if(isCampaignIvr(_0x2f6b86[_0xe3b6('0x5c')])&&isActive(_0x2f6b86['active'])){_0x2f6b86[_0xe3b6('0xa4')]=!![];BPromise[_0xe3b6('0xb7')]()[_0xe3b6('0xbd')](checkIsActive(_0x2f6b86,_0x2f6b86[_0xe3b6('0x7d')]))[_0xe3b6('0xbd')](checkInterval(_0x2f6b86))[_0xe3b6('0xbd')](_0xe8d3ef[_0xe3b6('0x146')](_0x2f6b86))['then'](_0xe8d3ef[_0xe3b6('0x16e')](_0x2f6b86[_0xe3b6('0x16b')],_0x2f6b86[_0xe3b6('0x16c')],_0x2f6b86[_0xe3b6('0x49')],_0x2f6b86))[_0xe3b6('0xbd')](_0xe8d3ef[_0xe3b6('0x14a')](_0x2f6b86[_0xe3b6('0x4b')],_0x2f6b86['dialTimezone'],_0x2f6b86['name'],_0x2f6b86))[_0xe3b6('0xbd')](_0xe8d3ef[_0xe3b6('0x16a')](_0x2f6b86))['catch'](loggerCatchQueueSummary(_0xe3b6('0x16f'),_0x2f6b86));}else{notSendMessagesCampaign(_0x2f6b86);}}}};function getCallerIdRandom(_0x6b3003,_0x2c6de5){var _0x111519;var _0x4cf23d;var _0x26c32a;if(_0x2c6de5<=0x0){_0x2c6de5=0x1;}_0x111519=new RegExp(_0xe3b6('0x170')+_0x2c6de5+'}$');_0x4cf23d=Math['pow'](0xa,_0x2c6de5-0x1);_0x26c32a=Math[_0xe3b6('0x171')](0xa,_0x2c6de5)-0x1;return util[_0xe3b6('0x7e')]('%s',_[_0xe3b6('0x172')](_0x6b3003,_0x111519,_['random'](_0x4cf23d,_0x26c32a)));}function extractCalleridName(_0x23bc49){var _0x5b33a1=_0x23bc49[_0xe3b6('0x173')](/"(.*?)"/);return _0x5b33a1?_0x5b33a1[0x1]:_0x23bc49;}function extractCalleridNumber(_0x4e3164){var _0x4aa4d6=_0x4e3164[_0xe3b6('0x173')](/<(.*?)>/);return _0x4aa4d6?_0x4aa4d6[0x1]:_0x4e3164;}Dialer[_0xe3b6('0x1f')]['actionOriginate']=function(_0x5329a0,_0x19b159){var _0x21e915=this;var _0x3de750=uuid['v4']();this[_0xe3b6('0x12d')][_0x3de750]=new Action(_0x5329a0,_0x19b159,_0x3de750);return new BPromise(function(_0x111c37,_0x2631f2){if(_[_0xe3b6('0x46')](_0x5329a0)&&typeof _0x5329a0!==_0xe3b6('0x174')){return _0x2631f2(msgResponse(_0xe3b6('0x175'),'Failure','voiceQueue\x20is\x20undefine'));}if(_[_0xe3b6('0x46')](_0x19b159[_0xe3b6('0x176')])||_0x19b159['phone']===null){return _0x2631f2(msgResponse(_0xe3b6('0x175'),_0xe3b6('0x14b'),_0xe3b6('0x177')));}var _0x57a542={'XMD-CALLERID':_0x21e915[_0xe3b6('0x12d')][_0x3de750][_0xe3b6('0x178')](),'XMD-AGI':_0x5329a0[_0xe3b6('0x111')]?util[_0xe3b6('0x7e')](_0xe3b6('0x179'),ipAgi,_0x5329a0[_0xe3b6('0x111')]):_0xe3b6('0x17a'),'XMD-AGIAFTER':_0x5329a0['dialQueueProject2']?util['format'](_0xe3b6('0x179'),ipAgi,_0x5329a0[_0xe3b6('0x116')]):_0xe3b6('0x17a'),'XMD-QUEUE':_0x5329a0['type']===_0xe3b6('0x55')?util[_0xe3b6('0x7e')]('\x22%s,%s%s,,,%s\x22',_0x5329a0[_0xe3b6('0x49')],_0x5329a0['dialQueueOptions']||'',_0x5329a0['dialAgiAfterHangupAgent']?'c':'',_0x5329a0[_0xe3b6('0x17b')]||0x3):_0xe3b6('0x17a'),'XMD-CONTACTID':_0x19b159[_0xe3b6('0xd7')],'XMD-CDRTYPE':_0xe3b6('0x7'),'CALLERID(all)':_0x21e915[_0xe3b6('0x12d')][_0x3de750][_0xe3b6('0x178')](),'XMD-AMD':_0x5329a0[_0xe3b6('0xe8')]?'ACTIVE':_0xe3b6('0x17a'),'XMD-DESTINATION':_0xe3b6('0xe7')};if(_0x5329a0[_0xe3b6('0xe8')]){_0x57a542[_0xe3b6('0x17c')]=_0x5329a0[_0xe3b6('0x17d')]||0x9c4;_0x57a542[_0xe3b6('0x17e')]=_0x5329a0[_0xe3b6('0x17f')]||0x5dc;_0x57a542['XMD-AMDAFTERGREETINGSILENCE']=_0x5329a0[_0xe3b6('0x180')]||0x320;_0x57a542['XMD-AMDTOTALANALYSISTIME']=_0x5329a0[_0xe3b6('0x181')]||0x1388;_0x57a542[_0xe3b6('0x182')]=_0x5329a0[_0xe3b6('0x183')]||0x64;_0x57a542[_0xe3b6('0x184')]=_0x5329a0[_0xe3b6('0x185')]||0x32;_0x57a542[_0xe3b6('0x186')]=_0x5329a0[_0xe3b6('0x187')]||0x3;_0x57a542[_0xe3b6('0x188')]=_0x5329a0[_0xe3b6('0x189')]||0x100;_0x57a542[_0xe3b6('0x18a')]=_0x5329a0[_0xe3b6('0x18b')]||0x1388;}if(_0x5329a0[_0xe3b6('0x5c')]===_0xe3b6('0x55')){_0x57a542[_0xe3b6('0x18c')]=_0x19b159[_0xe3b6('0xda')];}else{_0x57a542['XMD-CAMPAIGNID']=_0x19b159[_0xe3b6('0x102')];}for(var _0x19297a in _0x19b159[_0xe3b6('0x18d')]){if(typeof _0x19b159['Contact'][_0x19297a]!==_0xe3b6('0xaf')){if(isNotNull(_0x19b159['Contact'][_0x19297a])&&_0x19297a!=='id'&&_0x19297a!=='tags'&&_0x19297a!==_0xe3b6('0x18e')&&_0x19297a!==_0xe3b6('0x18f')){_0x57a542[util[_0xe3b6('0x7e')](_0xe3b6('0x190'),_0xe3b6('0x191'),_['toUpper'](_0x19297a))]=_0x19b159[_0xe3b6('0x18d')][_0x19297a];}}}var _0x3af250=_0x21e915[_0xe3b6('0xde')](_0x5329a0[_0xe3b6('0x7c')])?getCallerId(_0x5329a0[_0xe3b6('0x7c')]['callerid'],_0x5329a0[_0xe3b6('0x192')],_0x5329a0['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0x5329a0[_0xe3b6('0x5f')],_0x5329a0[_0xe3b6('0x193')]):_0x5329a0[_0xe3b6('0x5f')]):getCallerId(_[_0xe3b6('0xb0')](_0x5329a0[_0xe3b6('0x147')])?_0x5329a0[_0xe3b6('0x7c')][_0xe3b6('0x194')]:_0x5329a0[_0xe3b6('0x147')][_0xe3b6('0x194')],_0x5329a0['dialOriginateCallerIdName'],_0x5329a0[_0xe3b6('0x193')]>0x0?getCallerIdRandom(_0x5329a0['dialOriginateCallerIdNumber'],_0x5329a0[_0xe3b6('0x193')]):_0x5329a0[_0xe3b6('0x5f')]);if(_0x3af250){_0x57a542[_0xe3b6('0x195')]=_0x21e915[_0xe3b6('0x12d')][_0x3de750][_0xe3b6('0x196')]=extractCalleridName(_0x3af250);_0x57a542[_0xe3b6('0x197')]=_0x19b159[_0xe3b6('0x176')];}return ami[_0xe3b6('0xb1')]({'actionid':_0x3de750,'action':'originate','channel':_0x21e915[_0xe3b6('0xde')](_0x5329a0[_0xe3b6('0x7c')])?util[_0xe3b6('0x7e')](_0xe3b6('0x198'),_0x5329a0['Trunk'][_0xe3b6('0x49')],isNotNull(_0x5329a0['dialPrefix'])?_0x5329a0[_0xe3b6('0x199')]['trim']()||'':'',_0x5329a0[_0xe3b6('0x19a')]>0x0?_0x19b159[_0xe3b6('0x176')][_0xe3b6('0x19b')](_0x5329a0[_0xe3b6('0x19a')]):_0x19b159[_0xe3b6('0x176')]):util[_0xe3b6('0x7e')](_0xe3b6('0x198'),_['isNil'](_0x5329a0[_0xe3b6('0x147')])?_0x5329a0[_0xe3b6('0x7c')][_0xe3b6('0x49')]:_0x5329a0[_0xe3b6('0x147')][_0xe3b6('0x49')],isNotNull(_0x5329a0[_0xe3b6('0x199')])?_0x5329a0[_0xe3b6('0x199')][_0xe3b6('0x19c')]()||'':'',_0x5329a0['dialCutDigit']>0x0?_0x19b159[_0xe3b6('0x176')][_0xe3b6('0x19b')](_0x5329a0['dialCutDigit']):_0x19b159[_0xe3b6('0x176')]),'callerid':_0x3af250,'Exten':'xcally-motion-dialer','Context':'from-sip','Priority':'1','variable':_0x57a542,'timeout':(_0x5329a0[_0xe3b6('0x60')]||0x1e)*0x3e8,'async':!![],'channelid':_0x3de750})[_0xe3b6('0xbd')](function(_0x413a39){return _0x111c37(_0x413a39);})[_0xe3b6('0xb8')](function(_0x237a0c){_0x5329a0['outboundOriginateFailureCallsDay']+=0x1;var _0x44468a=new History(_0x21e915[_0xe3b6('0x12d')][_0x3de750]);logger['error'](util[_0xe3b6('0x7e')]('[originateError]:\x20%s',JSON[_0xe3b6('0x50')](_0x237a0c)));_0x44468a[_0xe3b6('0xab')]=0xe;_0x44468a[_0xe3b6('0xeb')]=_0xe3b6('0x19d');_0x44468a[_0xe3b6('0xac')]=moment()[_0xe3b6('0x7e')]('YYYY-MM-DD\x20HH:mm:ss');_0x44468a[_0xe3b6('0x125')]=_0x44468a['starttime'];_0x21e915[_0xe3b6('0xd0')](_0x44468a)[_0xe3b6('0xb8')](loggerCatch(_0xe3b6('0x19e')));_0x21e915[_0xe3b6('0xce')](_0x44468a)[_0xe3b6('0xb8')](loggerCatch(_0xe3b6('0x19e')))['finally'](function(){delete _0x21e915[_0xe3b6('0x12d')][_0x3de750];return _0x2631f2(msgResponse(_0xe3b6('0x175'),_0xe3b6('0x19f'),_0xe3b6('0x1a0')));});});});};Dialer[_0xe3b6('0x1f')][_0xe3b6('0x35')]=function(_0x3f8dd7){var _0x11dea5=this['actions'][_0x3f8dd7[_0xe3b6('0x12f')]];if(_0x11dea5){delete this[_0xe3b6('0x12d')][_0x3f8dd7[_0xe3b6('0x12f')]];_0x11dea5['responsetime']=moment()[_0xe3b6('0x7e')](_0xe3b6('0x101'));var _0x1f0378=_0x11dea5['type']===_0xe3b6('0x9a')?this[_0xe3b6('0x24')][_0x11dea5[_0xe3b6('0xb5')]]:this[_0xe3b6('0x23')][_0x11dea5[_0xe3b6('0x1a1')]()];if(!this[_0xe3b6('0xdc')](_0x3f8dd7[_0xe3b6('0x1a2')])){this[_0xe3b6('0xb4')](_0x1f0378);return this[_0xe3b6('0x1a3')](_0x11dea5,_0x1f0378,_0x3f8dd7)[_0xe3b6('0xb8')](loggerCatch(_0xe3b6('0x1a4')));}this[_0xe3b6('0x2a')][_0x3f8dd7[_0xe3b6('0xe3')]]=_0x11dea5;}};Dialer[_0xe3b6('0x1f')][_0xe3b6('0x1a5')]=function(_0x402a43,_0x58315c,_0x11a124){var _0x8b0948=new History(_0x58315c);if(_0x8b0948[_0xe3b6('0xf5')]+_0x8b0948[_0xe3b6('0xf6')]+_0x8b0948[_0xe3b6('0xf7')]+_0x8b0948[_0xe3b6('0xf8')]+_0x8b0948[_0xe3b6('0xf9')]+_0x8b0948[_0xe3b6('0x109')]+_0x8b0948[_0xe3b6('0xf3')]+_0x8b0948[_0xe3b6('0xfa')]>=_0x11a124[_0xe3b6('0xfb')]-0x1){return!![];}switch(_0x402a43){case 0x3:if(_0x8b0948[_0xe3b6('0xf7')]>=_0x11a124[_0xe3b6('0x1a6')]-0x1){return!![];}this[_0xe3b6('0xc4')]({'active':![],'countnoanswerretry':_0x8b0948[_0xe3b6('0xf7')]+=0x1,'scheduledat':moment()['add'](_0x11a124['dialNoAnswerRetryFrequency'],_0xe3b6('0x100'))['format'](_0xe3b6('0x101')),'ContactId':_0x8b0948['ContactId'],'ListId':_0x8b0948[_0xe3b6('0xd8')],'VoiceQueueId':_0x8b0948[_0xe3b6('0xda')]||undefined,'CampaignId':_0x8b0948['CampaignId']||undefined})[_0xe3b6('0xb8')](loggerCatch(_0xe3b6('0x1a7')));break;case 0x5:if(_0x8b0948['countbusyretry']>=_0x11a124[_0xe3b6('0x1a8')]-0x1){return!![];}this[_0xe3b6('0xc4')]({'active':![],'countbusyretry':_0x8b0948[_0xe3b6('0xf5')]+=0x1,'scheduledat':moment()['add'](_0x11a124[_0xe3b6('0x1a9')],_0xe3b6('0x100'))[_0xe3b6('0x7e')](_0xe3b6('0x101')),'ContactId':_0x8b0948[_0xe3b6('0xd7')],'ListId':_0x8b0948[_0xe3b6('0xd8')],'VoiceQueueId':_0x8b0948[_0xe3b6('0xda')]||undefined,'CampaignId':_0x8b0948[_0xe3b6('0x102')]||undefined})['catch'](loggerCatch(_0xe3b6('0x1aa')));break;case 0x8:if(_0x8b0948[_0xe3b6('0xf6')]>=_0x11a124[_0xe3b6('0x1ab')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countcongestionretry':_0x8b0948['countcongestionretry']+=0x1,'scheduledat':moment()[_0xe3b6('0x10b')](_0x11a124['dialCongestionRetryFrequency'],_0xe3b6('0x100'))[_0xe3b6('0x7e')](_0xe3b6('0x101')),'ContactId':_0x8b0948[_0xe3b6('0xd7')],'ListId':_0x8b0948['ListId'],'VoiceQueueId':_0x8b0948[_0xe3b6('0xda')]||undefined,'CampaignId':_0x8b0948[_0xe3b6('0x102')]||undefined})[_0xe3b6('0xb8')](loggerCatch(_0xe3b6('0x1ac')));break;case 0x0:if(_0x8b0948[_0xe3b6('0xf8')]>=_0x11a124['dialNoSuchNumberMaxRetry']-0x1){return!![];}else{this[_0xe3b6('0xc4')]({'active':![],'countnosuchnumberretry':_0x8b0948[_0xe3b6('0xf8')]+=0x1,'scheduledat':moment()[_0xe3b6('0x10b')](_0x11a124[_0xe3b6('0x1ad')],_0xe3b6('0x100'))[_0xe3b6('0x7e')](_0xe3b6('0x101')),'ContactId':_0x8b0948[_0xe3b6('0xd7')],'ListId':_0x8b0948['ListId'],'VoiceQueueId':_0x8b0948[_0xe3b6('0xda')]||undefined,'CampaignId':_0x8b0948[_0xe3b6('0x102')]||undefined})[_0xe3b6('0xb8')](loggerCatch(_0xe3b6('0x1ae')));}break;case 0xa:if(_0x8b0948['countdropretry']>=_0x11a124[_0xe3b6('0x123')]-0x1){return!![];}this[_0xe3b6('0xc4')]({'active':![],'countdropretry':_0x8b0948[_0xe3b6('0xf9')]+=0x1,'scheduledat':moment()['add'](_0x11a124[_0xe3b6('0x124')],_0xe3b6('0x100'))[_0xe3b6('0x7e')](_0xe3b6('0x101')),'ContactId':_0x8b0948[_0xe3b6('0xd7')],'ListId':_0x8b0948[_0xe3b6('0xd8')],'VoiceQueueId':_0x8b0948['VoiceQueueId']||undefined,'CampaignId':_0x8b0948[_0xe3b6('0x102')]||undefined})[_0xe3b6('0xb8')](loggerCatch(_0xe3b6('0x1af')));break;case 0xb:if(_0x8b0948[_0xe3b6('0x109')]>=_0x11a124[_0xe3b6('0x12a')]-0x1){return!![];}this[_0xe3b6('0xc4')]({'active':![],'countabandonedretry':_0x8b0948[_0xe3b6('0x109')]+=0x1,'scheduledat':moment()['add'](_0x11a124['dialAbandonedRetryFrequency'],_0xe3b6('0x100'))['format'](_0xe3b6('0x101')),'ContactId':_0x8b0948[_0xe3b6('0xd7')],'ListId':_0x8b0948[_0xe3b6('0xd8')],'VoiceQueueId':_0x8b0948[_0xe3b6('0xda')]||undefined,'CampaignId':_0x8b0948[_0xe3b6('0x102')]||undefined})[_0xe3b6('0xb8')](loggerCatch(_0xe3b6('0x12b')));break;case 0x13:if(_0x8b0948[_0xe3b6('0xf3')]>=_0x11a124[_0xe3b6('0xfe')]-0x1){return!![];}this[_0xe3b6('0xc4')]({'active':![],'countmachineretry':_0x8b0948[_0xe3b6('0xf3')]+=0x1,'scheduledat':moment()[_0xe3b6('0x10b')](_0x11a124[_0xe3b6('0x10c')],_0xe3b6('0x100'))[_0xe3b6('0x7e')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x8b0948[_0xe3b6('0xd7')],'ListId':_0x8b0948[_0xe3b6('0xd8')],'VoiceQueueId':_0x8b0948[_0xe3b6('0xda')]||undefined,'CampaignId':_0x8b0948[_0xe3b6('0x102')]||undefined})['catch'](loggerCatch('[rescheduleContact][Machine]'));break;case 0x14:if(_0x8b0948[_0xe3b6('0xfa')]>=_0x11a124['dialAgentRejectMaxRetry']-0x1){return!![];}this[_0xe3b6('0xc4')]({'active':![],'countagentrejectretry':_0x8b0948[_0xe3b6('0xfa')]+=0x1,'scheduledat':moment()[_0xe3b6('0x10b')](_0x11a124[_0xe3b6('0x1b0')],'minutes')[_0xe3b6('0x7e')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x8b0948[_0xe3b6('0xd7')],'ListId':_0x8b0948[_0xe3b6('0xd8')],'VoiceQueueId':_0x8b0948['VoiceQueueId']||undefined,'CampaignId':_0x8b0948['CampaignId']||undefined})[_0xe3b6('0xb8')](loggerCatch(_0xe3b6('0x1b1')));break;default:return!![];}};Dialer[_0xe3b6('0x1f')]['callProgressDetecting']=function(_0x3c53e9,_0x553e78,_0x2ed8b7){var _0x1e06ef=this;var _0x512dd8=new History(_0x3c53e9);var _0x384ff8=![];var _0x1dbfb2;var _0xf761f3;return new BPromise(function(_0x1a52c9,_0x59e468){if(_[_0xe3b6('0x46')](_0x553e78)&&typeof _0x553e78!==_0xe3b6('0x174')){return _0x59e468(msgResponse('[callProgressDetecting]',_0xe3b6('0x14b'),'entity\x20is\x20undefine'));}if(_['isUndefined'](_0x2ed8b7)&&typeof _0x2ed8b7!=='object'){return _0x59e468(msgResponse(_0xe3b6('0x1b2'),_0xe3b6('0x14b'),_0xe3b6('0x1b3')));}_0x1e06ef[_0xe3b6('0xbb')](_0x512dd8,_0x2ed8b7['reason'],_0x553e78)[_0xe3b6('0xbd')](function(_0x4b7bb6){if(_0x4b7bb6['additional']==0x1)_0x384ff8=!![];switch(_0x2ed8b7['reason']){case'0':_0x553e78[_0xe3b6('0x68')]+=0x1;_0x512dd8['state']=0x0;_0x512dd8[_0xe3b6('0xeb')]=_0xe3b6('0x1b4');_0x512dd8[_0xe3b6('0xf8')]+=0x1;_0x512dd8[_0xe3b6('0x108')]+=0x1;ami[_0xe3b6('0x54')](_0xe3b6('0x1b5'),ut[_0xe3b6('0xee')](_0x3c53e9,'nosuchnumber'));_0x1dbfb2=_0x553e78[_0xe3b6('0x1ad')];_0xf761f3=_0x553e78[_0xe3b6('0x120')];_0x1e06ef[_0xe3b6('0xd0')](_0x512dd8)['catch'](loggerCatch(_0xe3b6('0xf4')));if(_0x1e06ef['checkRetriveMax'](0x0,_0x3c53e9,_0x553e78)&&!_0x384ff8){if(_0x512dd8['countnosuchnumberretry']>=_0x553e78[_0xe3b6('0x1b6')]){_0x1e06ef[_0xe3b6('0xff')](_0x512dd8,_0x1a52c9,_0x59e468,_0xe3b6('0x1b7'));}else{_0x1e06ef[_0xe3b6('0xfc')](_0x512dd8,_0x1a52c9,_0x59e468,_0xe3b6('0x1b7'));}}break;case'3':_0x553e78[_0xe3b6('0x67')]+=0x1;_0x512dd8['state']=0x3;_0x512dd8[_0xe3b6('0xeb')]='NoAnswer';_0x512dd8[_0xe3b6('0xf7')]+=0x1;_0x512dd8[_0xe3b6('0x108')]+=0x1;ami[_0xe3b6('0x54')](_0xe3b6('0x1b8'),ut[_0xe3b6('0xee')](_0x3c53e9,_0xe3b6('0x1b9')));_0x1dbfb2=_0x553e78[_0xe3b6('0x1ba')];_0xf761f3=_0x553e78[_0xe3b6('0x120')];_0x1e06ef[_0xe3b6('0xd0')](_0x512dd8)[_0xe3b6('0xb8')](loggerCatch('[syncAgentComplete][createHistory][3]'));if(_0x1e06ef['checkRetriveMax'](0x3,_0x3c53e9,_0x553e78)&&!_0x384ff8){if(_0x512dd8[_0xe3b6('0xf7')]>=_0x553e78['dialNoAnswerMaxRetry']){_0x1e06ef[_0xe3b6('0xff')](_0x512dd8,_0x1a52c9,_0x59e468,_0xe3b6('0x1bb'));}else{_0x1e06ef[_0xe3b6('0xfc')](_0x512dd8,_0x1a52c9,_0x59e468,_0xe3b6('0x1bb'));}}break;case'5':_0x553e78[_0xe3b6('0x64')]+=0x1;_0x512dd8[_0xe3b6('0xab')]=0x5;_0x512dd8[_0xe3b6('0xeb')]='Busy';_0x512dd8[_0xe3b6('0xf5')]+=0x1;_0x512dd8[_0xe3b6('0x108')]+=0x1;ami[_0xe3b6('0x54')](_0xe3b6('0x1bc'),ut[_0xe3b6('0xee')](_0x3c53e9,_0xe3b6('0x1bd')));_0x1dbfb2=_0x553e78[_0xe3b6('0x1a9')];_0xf761f3=_0x553e78[_0xe3b6('0x120')];_0x1e06ef[_0xe3b6('0xd0')](_0x512dd8)[_0xe3b6('0xb8')](loggerCatch(_0xe3b6('0x1be')));if(_0x1e06ef[_0xe3b6('0x1a5')](0x5,_0x3c53e9,_0x553e78)&&!_0x384ff8){if(_0x512dd8[_0xe3b6('0xf5')]>=_0x553e78[_0xe3b6('0x1a8')]){_0x1e06ef[_0xe3b6('0xff')](_0x512dd8,_0x1a52c9,_0x59e468,_0xe3b6('0x1bf'));}else{_0x1e06ef[_0xe3b6('0xfc')](_0x512dd8,_0x1a52c9,_0x59e468,'reason\x205\x20busy');}}break;case'8':_0x553e78[_0xe3b6('0x1c0')]+=0x1;_0x512dd8['state']=0x8;_0x512dd8[_0xe3b6('0xeb')]=_0xe3b6('0x1c1');_0x512dd8['countcongestionretry']+=0x1;_0x512dd8[_0xe3b6('0x108')]+=0x1;_0x1dbfb2=_0x553e78[_0xe3b6('0x1c2')];_0xf761f3=_0x553e78['callAdditionalPhoneAfterMin'];ami['emit'](_0xe3b6('0x1c3'),ut['buildObj'](_0x3c53e9,_0xe3b6('0x1c4')));_0x1e06ef[_0xe3b6('0xd0')](_0x512dd8)[_0xe3b6('0xb8')](loggerCatch('[syncAgentComplete][createHistory][8]'));if(_0x1e06ef[_0xe3b6('0x1a5')](0x8,_0x3c53e9,_0x553e78)&&!_0x384ff8){if(_0x512dd8[_0xe3b6('0xf6')]>=_0x553e78[_0xe3b6('0x1ab')]){_0x1e06ef[_0xe3b6('0xff')](_0x512dd8,_0x1a52c9,_0x59e468,_0xe3b6('0x1c5'));}else{_0x1e06ef[_0xe3b6('0xfc')](_0x512dd8,_0x1a52c9,_0x59e468,'reason\x208\x20congestion');}}break;case'11':_0x553e78[_0xe3b6('0x1c6')]+=0x1;_0x512dd8[_0xe3b6('0xab')]=0xb;_0x512dd8[_0xe3b6('0xeb')]='Abandoned';_0x512dd8[_0xe3b6('0x109')]+=0x1;_0x512dd8[_0xe3b6('0x108')]+=0x1;_0x1dbfb2=_0x553e78[_0xe3b6('0x129')];_0xf761f3=_0x553e78[_0xe3b6('0x120')];_0x1e06ef[_0xe3b6('0xd0')](_0x512dd8)['catch'](loggerCatch(_0xe3b6('0x12c')));if(_0x1e06ef[_0xe3b6('0x1a5')](0xb,_0x3c53e9,_0x553e78)&&!_0x384ff8){if(_0x512dd8[_0xe3b6('0x109')]>=_0x553e78[_0xe3b6('0x12a')]){_0x1e06ef[_0xe3b6('0xff')](_0x512dd8,_0x1a52c9,_0x59e468,'reason\x2011\x20abandoned');}else{_0x1e06ef[_0xe3b6('0xfc')](_0x512dd8,_0x1a52c9,_0x59e468,_0xe3b6('0x1c7'));}}break;case'20':_0x553e78[_0xe3b6('0x6b')]+=0x1;_0x512dd8['state']=0x14;_0x512dd8['statedesc']=_0xe3b6('0x1c8');_0x512dd8[_0xe3b6('0xfa')]+=0x1;_0x512dd8[_0xe3b6('0x108')]+=0x1;_0x1dbfb2=_0x553e78[_0xe3b6('0x1b0')];_0xf761f3=_0x553e78[_0xe3b6('0x120')];ami['emit'](_0xe3b6('0x1c9'),ut[_0xe3b6('0xee')](_0x3c53e9,_0xe3b6('0x1ca')));_0x1e06ef[_0xe3b6('0xd0')](_0x512dd8)[_0xe3b6('0xb8')](loggerCatch(_0xe3b6('0x1cb')));if(_0x1e06ef[_0xe3b6('0x1a5')](0x14,_0x3c53e9,_0x553e78)&&!_0x384ff8){if(_0x512dd8[_0xe3b6('0xfa')]>=_0x553e78[_0xe3b6('0x1cc')]){_0x1e06ef[_0xe3b6('0xff')](_0x512dd8,_0x1a52c9,_0x59e468,_0xe3b6('0x1cd'));}else{_0x1e06ef[_0xe3b6('0xfc')](_0x512dd8,_0x1a52c9,_0x59e468,_0xe3b6('0x1cd'));}}break;default:_0x553e78[_0xe3b6('0x6c')]+=0x1;_0x512dd8['state']=0xc;_0x512dd8[_0xe3b6('0xeb')]=_0x2ed8b7[_0xe3b6('0x113')];_0x1dbfb2=_0x553e78['dialAgentRejectRetryFrequency'];_0xf761f3=_0x553e78[_0xe3b6('0x120')];_0x1e06ef[_0xe3b6('0xd0')](_0x512dd8)[_0xe3b6('0xb8')](loggerCatch(_0xe3b6('0x1ce')));if(_0x1e06ef[_0xe3b6('0x1a5')](_0x2ed8b7[_0xe3b6('0x113')],_0x3c53e9,_0x553e78)&&!_0x384ff8){if(_0x512dd8[_0xe3b6('0xf5')]+_0x512dd8[_0xe3b6('0xf6')]+_0x512dd8[_0xe3b6('0xf7')]+_0x512dd8[_0xe3b6('0xf8')]+_0x512dd8[_0xe3b6('0xf9')]+_0x512dd8[_0xe3b6('0x109')]+_0x512dd8[_0xe3b6('0xf3')]+_0x512dd8[_0xe3b6('0xfa')]>=_0x553e78['dialGlobalMaxRetry']){_0x1e06ef[_0xe3b6('0xfc')](_0x512dd8,_0x1a52c9,_0x59e468,_0x2ed8b7['reason']);}else{_0x1e06ef['createStateFinal'](_0x512dd8,_0x1a52c9,_0x59e468,_0x2ed8b7[_0xe3b6('0x113')]);}}}})['then'](function(_0x9aff2b){if(_0x384ff8){_0x1e06ef['swapAdditionalPhones'](_0x512dd8,_0x1dbfb2,_0xf761f3)['then'](function(_0x74175c){return _0x1a52c9(0x1);});}});});};Dialer['prototype'][_0xe3b6('0xfc')]=function(_0x1a371a,_0x1da5c2,_0x2802cf,_0x4634a4){var _0x219b2d=new Final(_0x1a371a);_0x219b2d['state']=0xf;_0x219b2d[_0xe3b6('0xeb')]=_0xe3b6('0x1cf');this[_0xe3b6('0xff')](_0x219b2d,_0x1da5c2,_0x2802cf,_0x4634a4);};Dialer[_0xe3b6('0x1f')]['createStateFinal']=function(_0x2b9966,_0x20f0ee,_0x4cb223,_0x2ec587){this[_0xe3b6('0xce')](_0x2b9966)[_0xe3b6('0xbd')](function(){return _0x20f0ee(msgResponse(_0xe3b6('0x1b2'),_0xe3b6('0xdd'),_0x2ec587));})[_0xe3b6('0xb8')](function(){return _0x4cb223(msgResponse('[moveContactManagedDialer][0]','Failure',_0xe3b6('0x1d0')));});};Dialer['prototype'][_0xe3b6('0xa')]=function(_0x2cec39){var _0xee7c2a=_0x2cec39['dialPredictiveOptimizationPercentage']/0x64;var _0x41ad10=_0x2cec39['outboundDropCallsDayTimeout']/(_0x2cec39[_0xe3b6('0x66')]+_0x2cec39[_0xe3b6('0x62')]);var _0x37cd41=Math[_0xe3b6('0x1d1')](_0x2cec39['predictiveIntervalAvailable']*(_0x2cec39[_0xe3b6('0x1d2')]/0x64));var _0xa3b6a1=Math[_0xe3b6('0x1d1')](_0x2cec39['predictiveIntervalAvailable']*(_0x2cec39[_0xe3b6('0x1d3')]/0x64));var _0x2b7943=_0x2cec39[_0xe3b6('0x57')]+_0x2cec39[_0xe3b6('0x1d4')];var _0x30f7bf=Math[_0xe3b6('0x1d5')](_0x2cec39['erlangCalls']*_0x2cec39[_0xe3b6('0x7a')]*_0x2cec39['predictiveIntervalHitRate']*_0x2cec39['predictiveIntervalMultiplicativeFactor']);if(_[_0xe3b6('0x46')](_0x2cec39[_0xe3b6('0x2d')])){if(!_[_0xe3b6('0x46')](_0x2cec39[_0xe3b6('0x2c')])){_0x2cec39['startPredictive']=undefined;loggerPredictive[_0xe3b6('0x9e')](_0xe3b6('0x1d6'),_0xe3b6('0x1d7'));}if(!_[_0xe3b6('0x46')](_0x2cec39[_0xe3b6('0x98')])){loggerPredictive[_0xe3b6('0x9e')](_0xe3b6('0x1d6'),_0xe3b6('0x1d8'));clearInterval(_0x2cec39['handlePredictive']);_0x2cec39['handlePredictive']=undefined;}_0x2cec39['startProgressive']=moment()[_0xe3b6('0x7e')](_0xe3b6('0x101'));loggerPredictive[_0xe3b6('0x83')](_0x2cec39[_0xe3b6('0x49')],_0xe3b6('0x1d9'),_0x2cec39[_0xe3b6('0x2d')]);this[_0xe3b6('0x162')](_0x2cec39,0x1);}else if(ifInterval(_0x2cec39[_0xe3b6('0x1da')],_0x2cec39[_0xe3b6('0x2d')])){this['handlePower'](_0x2cec39,0x1);loggerPredictiveCalls[_0xe3b6('0x83')]('[startMethodPredictive][StartProgressive][Loop]',_0x2cec39[_0xe3b6('0x2d')],_0x2cec39[_0xe3b6('0x49')]);_0x2cec39[_0xe3b6('0x79')]=0x0;_0x2cec39['predictiveIntervalErlangCallsDroppedCalls']=0x0;}else if(_0xee7c2a<_0x41ad10&&_0x2cec39['dialPredictiveOptimization']===_0xe3b6('0x1db')){freeVariablesPredictive(_0x2cec39);loggerPredictive[_0xe3b6('0x83')]('[stopMethodPredictive][ReStartProgressive][ExceededDropDay]',_0xe3b6('0x1dc'),_0x41ad10,_0xe3b6('0x2d'),_0x2cec39['name']);}else if(_0x30f7bf<_0x2cec39['predictiveIntervalErlangCallsDroppedCalls']&&_0x2cec39[_0xe3b6('0x1dd')]===_0xe3b6('0x1db')){freeVariablesPredictive(_0x2cec39);loggerPredictive[_0xe3b6('0x83')](_0xe3b6('0x1de'),_0xe3b6('0x1df'),_0x30f7bf,_0xe3b6('0x1e0'),_0x2cec39[_0xe3b6('0x72')],'startProgressive',_0x2cec39[_0xe3b6('0x49')]);}else if(!ifInterval(_0x2cec39[_0xe3b6('0x1da')],_0x2cec39['startProgressive'])&&_[_0xe3b6('0x46')](_0x2cec39[_0xe3b6('0x2c')])&&!_['isUndefined'](_0x2cec39[_0xe3b6('0x2d')])){_0x2cec39[_0xe3b6('0x2c')]=moment()[_0xe3b6('0x7e')](_0xe3b6('0x101'));loggerPredictive[_0xe3b6('0x83')](_0x2cec39['name'],_0xe3b6('0x1e1'),_0x2cec39['startPredictive']);this['averageHandleTime'](_0x2cec39['dialPredictiveInterval'])[_0xe3b6('0xbd')](this[_0xe3b6('0x1e2')](_0x2cec39))[_0xe3b6('0xbd')](mergeDataErlangB(_0x2cec39))['then'](this[_0xe3b6('0x1e3')](_0x2cec39))[_0xe3b6('0xb8')](loggerCatchPredictive(_0xe3b6('0x1e4'),_0x2cec39));}else if(!ifInterval(_0x2cec39[_0xe3b6('0x1da')],_0x2cec39[_0xe3b6('0x2c')])){_0x2cec39['predictiveIntervalErlangCallsDroppedCalls']=0x0;_0x2cec39[_0xe3b6('0x2c')]=moment()[_0xe3b6('0x7e')](_0xe3b6('0x101'));loggerPredictive[_0xe3b6('0x83')](_0x2cec39[_0xe3b6('0x49')],'recalculate\x20predictive\x20at',_0x2cec39[_0xe3b6('0x2c')]);clearInterval(_0x2cec39['handlePredictive']);_0x2cec39[_0xe3b6('0x98')]=undefined;this['averageHandleTime'](_0x2cec39[_0xe3b6('0x1da')])[_0xe3b6('0xbd')](this[_0xe3b6('0x1e2')](_0x2cec39))[_0xe3b6('0xbd')](mergeDataErlangB(_0x2cec39))[_0xe3b6('0xbd')](this['startMethodPredictive'](_0x2cec39))[_0xe3b6('0xb8')](loggerCatchPredictive(_0xe3b6('0x1e5'),_0x2cec39));}else if(_0x2cec39[_0xe3b6('0x76')]&&_0x2b7943<_0x2cec39[_0xe3b6('0x76')]-_0xa3b6a1){freeVariablesPredictive(_0x2cec39);loggerPredictive[_0xe3b6('0x83')](_0x2cec39['name'],_0xe3b6('0x1e6'),_0x2b7943,')\x20are\x20less\x20than\x20threshold\x20(',_0x2cec39[_0xe3b6('0x76')],'-',_0xa3b6a1,'=',_0x2cec39[_0xe3b6('0x76')]-_0xa3b6a1,')');}else if(_0x2cec39[_0xe3b6('0x76')]&&_0x2b7943>_0x2cec39[_0xe3b6('0x76')]+_0x37cd41){freeVariablesPredictive(_0x2cec39);loggerPredictive[_0xe3b6('0x83')](_0x2cec39[_0xe3b6('0x49')],_0xe3b6('0x1e6'),_0x2b7943,')\x20are\x20more\x20than\x20threshold\x20(',_0x2cec39['predictiveIntervalAvailable'],'+',_0x37cd41,'=',_0x2cec39[_0xe3b6('0x76')]+_0x37cd41,')');}};Dialer['prototype'][_0xe3b6('0x1e2')]=function(_0x317ca6){var _0x3af07c=this;return function(_0x31ef3f){return new BPromise(function(_0x26682e,_0x2fb8c4){_[_0xe3b6('0x95')](_0x317ca6,_0x31ef3f[0x0]);if(checkGetDataPredictive(_0x31ef3f[0x0])){var _0x3b4b7d=_0x317ca6[_0xe3b6('0x76')]=_0x317ca6[_0xe3b6('0x1d4')]+_0x317ca6[_0xe3b6('0x57')];var _0x35d4a7=_0x317ca6['dialPredictiveInterval']*0x3c;var _0x3c4013=_0x31ef3f[0x0][_0xe3b6('0x6e')]+_0x31ef3f[0x0][_0xe3b6('0x89')];var _0x13b096=(_0x31ef3f[0x0][_0xe3b6('0x6d')]+_0x31ef3f[0x0][_0xe3b6('0x70')]+_0x31ef3f[0x0][_0xe3b6('0x6f')])/_0x31ef3f[0x0]['predictiveIntervalTotalCalls'];_0x317ca6[_0xe3b6('0x73')]=_0x13b096>0x0?_0x13b096:0x1;switch(_0x317ca6[_0xe3b6('0x1dd')]){case _0xe3b6('0x1db'):var _0xbba2a8=_0x317ca6['dialPredictiveOptimizationPercentage']/0x64;return _0x3af07c[_0xe3b6('0x1e7')](_0x3b4b7d,_0x35d4a7,_0x3c4013,_0x13b096,_0xbba2a8)[_0xe3b6('0xbd')](function(_0x19ce3f){return _0x26682e(_0x19ce3f);});case _0xe3b6('0x1e8'):var _0x15f296=_0x317ca6[_0xe3b6('0x1e9')]/0x64;return _0x3af07c[_0xe3b6('0x1ea')](_0x3b4b7d,_0x35d4a7,_0x3c4013,_0x13b096,_0x15f296)[_0xe3b6('0xbd')](function(_0x2bdaf5){return _0x26682e(_0x2bdaf5);});default:return _0x2fb8c4(msgResponse(_0xe3b6('0x1eb'),_0xe3b6('0x14b'),_0xe3b6('0x1ec')));}}else{return _0x2fb8c4(msgResponse(_0xe3b6('0x1eb'),'Failure',_0xe3b6('0x1ed')));}});};};Dialer[_0xe3b6('0x1f')][_0xe3b6('0x1ee')]=function(_0x5966a9){var _0x12ad24=this;return function(_0x40e41d){return new BPromise(function(_0x26fda6,_0x478a72){_[_0xe3b6('0x95')](_0x5966a9,_0x40e41d[0x0]);if(checkGetDataPredictive(_0x40e41d[0x0])){loggerPredictive[_0xe3b6('0x83')](JSON[_0xe3b6('0x50')](_0x40e41d[0x0]));if(_0x5966a9['dialPredictiveOptimization']===_0xe3b6('0x1db')){return _0x12ad24[_0xe3b6('0xcc')](_0x5966a9['id'])['then'](function(_0x5da53b){var _0x334b92=_0x5966a9[_0xe3b6('0x58')]-_0x5da53b[0x0]['outboundQueuePauses'];var _0x302f27=_0x5966a9[_0xe3b6('0x1da')]*0x3c;var _0xbae7e9=_0x40e41d[0x0][_0xe3b6('0x6e')]+_0x40e41d[0x0]['predictiveIntervalAvgHoldtime'];var _0x27892a=(_0x40e41d[0x0]['predictiveIntervalAnsweredCalls']+_0x40e41d[0x0][_0xe3b6('0x70')]+_0x40e41d[0x0][_0xe3b6('0x6f')])/_0x40e41d[0x0]['predictiveIntervalTotalCalls'];var _0x4baf26=_0x5966a9[_0xe3b6('0x1e9')]/0x64;_0x5966a9[_0xe3b6('0x75')]=_0x5da53b[0x0][_0xe3b6('0x1ef')]||0x0;_0x5966a9[_0xe3b6('0x73')]=_0x27892a>0x0?_0x27892a:0x1;return _0x12ad24['abandonmentRate'](_0x334b92,_0x302f27,_0xbae7e9,_0x27892a,_0x4baf26);})['then'](function(_0xd9d284){return _0x26fda6(_0xd9d284);})[_0xe3b6('0xb8')](function(_0x14c5fc){return _0x478a72(msgResponse(_0xe3b6('0x1f0'),_0xe3b6('0x14b'),JSON['stringify'](_0x14c5fc)));});}if(_0x5966a9['dialPredictiveOptimization']==='agentBusyFactor'){return _0x12ad24[_0xe3b6('0xcc')](_0x5966a9['id'])[_0xe3b6('0xbd')](function(_0x1f9a9c){var _0x374260=_0x5966a9['loggedIn']-_0x1f9a9c[0x0]['outboundQueuePauses'];var _0x446952=_0x5966a9[_0xe3b6('0x1da')]*0x3c;var _0x213590=_0x40e41d[0x0][_0xe3b6('0x6e')]+_0x40e41d[0x0][_0xe3b6('0x89')];var _0xf2824e=(_0x40e41d[0x0]['predictiveIntervalAnsweredCalls']+_0x40e41d[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x40e41d[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x40e41d[0x0][_0xe3b6('0x77')];var _0x2c444c=_0x5966a9[_0xe3b6('0x1e9')]/0x64;_0x5966a9[_0xe3b6('0x75')]=_0x1f9a9c[0x0][_0xe3b6('0x1ef')]||0x0;_0x5966a9[_0xe3b6('0x73')]=_0xf2824e>0x0?_0xf2824e:0x1;return _0x12ad24[_0xe3b6('0x1ea')](_0x374260,_0x446952,_0x213590,_0xf2824e,_0x2c444c);})[_0xe3b6('0xbd')](function(_0x37464f){return _0x26fda6(_0x37464f);})[_0xe3b6('0xb8')](function(_0x52230d){return _0x478a72(msgResponse('[CatchErlangB]',_0xe3b6('0x14b'),JSON[_0xe3b6('0x50')](_0x52230d)));});}}else{return _0x478a72(msgResponse(_0xe3b6('0x1eb'),'Failure',_0xe3b6('0x1ed')));}});};};Dialer[_0xe3b6('0x1f')][_0xe3b6('0x1e3')]=function(_0x117384){var _0x43567d=this;return function(){var _0x2da3b0=0x0;var _0x6fe43a=Math[_0xe3b6('0x1d5')](_0x117384[_0xe3b6('0x92')]*0x3e8);if(_0x6fe43a>0x0){_0x6fe43a=_0x6fe43a<0x64?0x64:_0x6fe43a;loggerPredictive[_0xe3b6('0x83')](_0x117384[_0xe3b6('0x49')],_0xe3b6('0x1f1'),_0x6fe43a,_0xe3b6('0x51'));_0x117384[_0xe3b6('0x98')]=setInterval(function(){_0x43567d['handlePredictive'](_0x117384);loggerPredictiveCalls[_0xe3b6('0x83')]('[handlePredictive]',_0x2da3b0+=0x1);},_0x6fe43a);}else{loggerPredictive[_0xe3b6('0x83')](_0x117384[_0xe3b6('0x49')],'fail\x20to\x20scheduled\x20calls');}};};Dialer[_0xe3b6('0x1f')]['checkContactBlack']=function(_0x21d0f8,_0x4c6c81){var _0x5a4a0e=this;return function(_0x56461a){if(_[_0xe3b6('0x4f')](_0x56461a)){if(_['isNil'](_0x4c6c81['UserId'])||!_0x4c6c81[_0xe3b6('0x1f2')]){if(_0x21d0f8[_0xe3b6('0x160')]==='booked'){_0x21d0f8[_0xe3b6('0x1f3')]=_[_0xe3b6('0x46')](_0x21d0f8[_0xe3b6('0x1f3')])?!![]:_0x21d0f8['queueStatusComplete'];var _0xacfe48=uuid['v4']();_0x5a4a0e[_0xe3b6('0x12d')][_0xacfe48]=new Action(_0x21d0f8,_0x4c6c81,_0xacfe48);loggerBooked[_0xe3b6('0x83')](_0xe3b6('0x1f4'),_0xacfe48,_0xe3b6('0x1f5'),JSON[_0xe3b6('0x50')](_0x21d0f8[_0xe3b6('0x1f3')]),_0xe3b6('0x1f6'),_0x21d0f8[_0xe3b6('0x49')]);if(_0x21d0f8[_0xe3b6('0x1f3')]){_0x21d0f8[_0xe3b6('0x1f3')]=![];_0x5a4a0e['queueBooked'][_0x5a4a0e[_0xe3b6('0x12d')][_0xacfe48][_0xe3b6('0xb5')]]=[];ami[_0xe3b6('0xb1')]({'actionid':_0xacfe48,'action':_0xe3b6('0x1f7'),'queue':_0x21d0f8['name']})[_0xe3b6('0xb8')](function(){_0x5a4a0e['updateOriginated'](_0x21d0f8);_0x5a4a0e['rescheduleContact']({'active':![],'ContactId':_0x5a4a0e[_0xe3b6('0x12d')][_0xacfe48]['ContactId'],'ListId':_0x5a4a0e[_0xe3b6('0x12d')][_0xacfe48]['ListId'],'VoiceQueueId':_0x5a4a0e[_0xe3b6('0x12d')][_0xacfe48][_0xe3b6('0xda')]||undefined,'CampaignId':_0x5a4a0e[_0xe3b6('0x12d')][_0xacfe48][_0xe3b6('0x102')]||undefined})[_0xe3b6('0xb8')](loggerCatch(_0xe3b6('0x1f8')));delete _0x5a4a0e[_0xe3b6('0x12d')][_0xacfe48];});}else{loggerBooked['info']('[booked][checkContactBlack][else]',JSON['stringify'](_0x21d0f8[_0xe3b6('0x1f3')]),_0xe3b6('0x1f6'),_0x21d0f8[_0xe3b6('0x49')]);_0x5a4a0e[_0xe3b6('0xb4')](_0x21d0f8);_0x5a4a0e['rescheduleContact']({'active':![],'ContactId':_0x5a4a0e['actions'][_0xacfe48][_0xe3b6('0xd7')],'ListId':_0x5a4a0e['actions'][_0xacfe48][_0xe3b6('0xd8')],'VoiceQueueId':_0x5a4a0e[_0xe3b6('0x12d')][_0xacfe48][_0xe3b6('0xda')]||undefined,'CampaignId':_0x5a4a0e[_0xe3b6('0x12d')][_0xacfe48][_0xe3b6('0x102')]||undefined})['catch'](loggerCatch(_0xe3b6('0x1f8')));delete _0x5a4a0e['actions'][_0xacfe48];}}else{return _0x5a4a0e[_0xe3b6('0x1f9')](_0x21d0f8,_0x4c6c81);}}else{if(getDiff(_0x4c6c81[_0xe3b6('0x1fa')])<_0x21d0f8[_0xe3b6('0x1fb')]*0x3c){if(_0x4c6c81[_0xe3b6('0x167')]&&!_0x4c6c81[_0xe3b6('0x167')][_0xe3b6('0x1fc')]){_0x5a4a0e[_0xe3b6('0x22')]['run'](_0x4c6c81['id'])[_0xe3b6('0x139')](function(){_0x5a4a0e[_0xe3b6('0xb4')](_0x21d0f8);});}else{_0x5a4a0e['unlockContact']({'active':![]},_0x4c6c81['id'],0x1)[_0xe3b6('0x139')](function(){_0x5a4a0e[_0xe3b6('0xb4')](_0x21d0f8);});}}else{_0x21d0f8['outboundReCallsDay']+=0x1;_0x5a4a0e[_0xe3b6('0xb4')](_0x21d0f8);if(_0x21d0f8['dialRecallInQueue']){_0x5a4a0e[_0xe3b6('0xc4')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x4c6c81[_0xe3b6('0xd7')],'ListId':_0x4c6c81[_0xe3b6('0xd8')],'VoiceQueueId':_0x4c6c81[_0xe3b6('0xda')]||undefined,'CampaignId':_0x4c6c81['CampaignId']||undefined})[_0xe3b6('0xb8')](loggerCatch(_0xe3b6('0x1fd')));_0x5a4a0e[_0xe3b6('0xd0')](createObjHistory(_0x21d0f8,_0x4c6c81,_0xe3b6('0x1fe'),0x17,_0xe3b6('0x1ff')))[_0xe3b6('0xb8')](loggerCatch('[Originate][HistoryDialRecallInQueue][historyCatch]'));}else{_0x5a4a0e[_0xe3b6('0xe2')](createObjHistory(_0x21d0f8,_0x4c6c81,_0xe3b6('0x200'),0x16,_0xe3b6('0x201')),'[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]');}}}}else{_0x21d0f8[_0xe3b6('0x63')]+=0x1;_0x5a4a0e[_0xe3b6('0xe2')](createObjHistory(_0x21d0f8,_0x4c6c81,'BLACKLIST',0xd,'Blacklist'),_0xe3b6('0x202'),_0xe3b6('0x203'));throw'inBlackList';}};};Dialer[_0xe3b6('0x1f')][_0xe3b6('0x204')]=function(_0x4bfb7c){var _0x2f2c9f=this;var _0x17ccc8=_0x4bfb7c[_0xe3b6('0x205')]-_0x4bfb7c[_0xe3b6('0x78')]-_0x4bfb7c['temp'];emitCampaignSummary(_0x4bfb7c);if(_0x17ccc8>0x0){if(_0x17ccc8>this[_0xe3b6('0x27')]){_0x17ccc8=this['maxNumberOriginate'];}_0x4bfb7c[_0xe3b6('0xc9')]+=_0x17ccc8;this[_0xe3b6('0xca')](_0x4bfb7c['id'],_0x17ccc8,_0x4bfb7c['dialOrderByScheduledAt'],_0x4bfb7c)[_0xe3b6('0xbd')](function(_0x16bc5d){_0x4bfb7c[_0xe3b6('0xc9')]-=_0x17ccc8;_0x4bfb7c['temp']=_0x4bfb7c['temp']>0x0?_0x4bfb7c[_0xe3b6('0xc9')]:0x0;if(!checkContactEmpty(_0x16bc5d)){_0x4bfb7c[_0xe3b6('0x47')]=_0xe3b6('0xa3');logger[_0xe3b6('0x83')](_0xe3b6('0x206')+_0x4bfb7c['name']);}else{_0x4bfb7c[_0xe3b6('0x78')]+=_0x16bc5d[_0xe3b6('0x150')];_0x4bfb7c['message']=_0xe3b6('0x207');for(var _0x552c62=0x0;_0x552c62<_0x16bc5d[_0xe3b6('0x150')];_0x552c62+=0x1){_0x4bfb7c[_0xe3b6('0x208')]+=0x1;if(_[_0xe3b6('0xb0')](_0x16bc5d[_0x552c62])||_[_0xe3b6('0xb0')](_0x16bc5d[_0x552c62][_0xe3b6('0x18d')])||_[_0xe3b6('0xb0')](_0x16bc5d[_0x552c62][_0xe3b6('0x176')])){_0x2f2c9f['emptyContact'](_0xe3b6('0x209'),_0x4bfb7c,_0x16bc5d[_0x552c62]);}else{_0x2f2c9f[_0xe3b6('0xc0')](_[_0xe3b6('0xd6')](_0x16bc5d[_0x552c62],['CampaignId',_0xe3b6('0x20a')]))[_0xe3b6('0xbd')](_0x2f2c9f['checkContactBlack'](_0x4bfb7c,_0x16bc5d[_0x552c62]))[_0xe3b6('0xb8')](_0x2f2c9f[_0xe3b6('0xd3')](_0xe3b6('0x20b'),_0x4bfb7c));}}}})[_0xe3b6('0xb8')](loggerGetContactDialer(_0xe3b6('0x20c'),_0x4bfb7c,_0x17ccc8));}};Dialer[_0xe3b6('0x1f')][_0xe3b6('0x162')]=function(_0x4ca254,_0x2599bc){var _0x4adc08=this;var _0x29c8a4=[];var _0x3ef391=_0x2599bc>=0x1?_0x2599bc:0x1;if(_0x4ca254[_0xe3b6('0x160')]==='booked'){_0x3ef391=0x1;}var _0x487e1c=Math[_0xe3b6('0x1d5')](_0x4ca254['available']*_0x3ef391)-_0x4ca254[_0xe3b6('0x78')]-_0x4ca254[_0xe3b6('0xc9')];emitVoiceQueueSummary(_0x4ca254);if(_0x4ca254[_0xe3b6('0x20d')]>0x0){var _0x546ba3=_0x4ca254['dialLimitQueue']-_0x4ca254[_0xe3b6('0x78')]-_0x4ca254[_0xe3b6('0x1d4')]-_0x4ca254[_0xe3b6('0xc9')]-_0x4ca254[_0xe3b6('0x59')];if(_0x487e1c>_0x546ba3){_0x487e1c=_0x546ba3;}}if(_0x487e1c>0x0){if(_0x4ca254['dialMethod']==='booked'){_0x487e1c=0x1;}if(_0x487e1c>this[_0xe3b6('0x27')]){_0x487e1c=this[_0xe3b6('0x27')];}_0x4ca254['temp']+=_0x487e1c;for(var _0x97111e in this[_0xe3b6('0x25')]){if(typeof this[_0xe3b6('0x25')][_0x97111e]!==_0xe3b6('0xaf')){if(this[_0xe3b6('0x25')][_0x97111e][_0xe3b6('0xab')]==='not_inuse'&&this[_0xe3b6('0x25')][_0x97111e][_0xe3b6('0xe0')]===_0xe3b6('0x20e')){_0x29c8a4[_0xe3b6('0x151')](this[_0xe3b6('0x25')][_0x97111e]['id']);}}}this[_0xe3b6('0xc8')](_0x4ca254['id'],_0x29c8a4,_0x487e1c,_0x4ca254[_0xe3b6('0x20f')],_0x4ca254)['then'](function(_0x4c2da6){_0x4ca254[_0xe3b6('0xc9')]-=_0x487e1c;_0x4ca254['temp']=_0x4ca254[_0xe3b6('0xc9')]>0x0?_0x4ca254['temp']:0x0;if(!checkContactEmpty(_0x4c2da6)){_0x4adc08[_0xe3b6('0x210')](_0x4ca254)[_0xe3b6('0xbd')](sendMessageReschedule(_0x4ca254))[_0xe3b6('0xb8')](loggerCatch(_0xe3b6('0xb9')));}else{_0x4ca254[_0xe3b6('0x78')]+=_0x4c2da6['length'];_0x4ca254[_0xe3b6('0x47')]=_0x4ca254[_0xe3b6('0x160')]===_0xe3b6('0x9')?_0xe3b6('0x211'):_0xe3b6('0x207');for(var _0x4b417e=0x0;_0x4b417e<_0x4c2da6['length'];_0x4b417e+=0x1){if(_[_0xe3b6('0xb0')](_0x4c2da6[_0x4b417e])||_[_0xe3b6('0xb0')](_0x4c2da6[_0x4b417e]['Contact'])||_[_0xe3b6('0xb0')](_0x4c2da6[_0x4b417e][_0xe3b6('0x176')])){_0x4adc08['emptyContact']('[actionOriginate]\x20',_0x4ca254,_0x4c2da6[_0x4b417e]);}else{_0x4adc08['checkIsBlackList'](_['pick'](_0x4c2da6[_0x4b417e],[_0xe3b6('0xda'),_0xe3b6('0x20a')]))['then'](_0x4adc08['checkContactBlack'](_0x4ca254,_0x4c2da6[_0x4b417e]))[_0xe3b6('0xb8')](_0x4adc08['loggerHandler'](_0xe3b6('0x209'),_0x4ca254));}}}})[_0xe3b6('0xb8')](loggerGetContactDialer(_0xe3b6('0x212'),_0x4ca254,_0x487e1c));}};Dialer[_0xe3b6('0x1f')][_0xe3b6('0x98')]=function(_0x435f88){if(_0x435f88[_0xe3b6('0x20d')]>0x0){var _0x2d24a4=_0x435f88[_0xe3b6('0x20d')]-_0x435f88[_0xe3b6('0x78')]-_0x435f88[_0xe3b6('0x1d4')];if(_0x2d24a4>0x0){this[_0xe3b6('0x213')](_0x435f88);}else{loggerPredictiveCalls['info'](_0xe3b6('0x214'));}}else{this[_0xe3b6('0x213')](_0x435f88);}};Dialer['prototype'][_0xe3b6('0x213')]=function(_0x2f3045){var _0x1587d8=this;var _0x4ca501=[];_0x2f3045[_0xe3b6('0x78')]+=0x1;for(var _0x422f05 in this['agents']){if(typeof this[_0xe3b6('0x25')][_0x422f05]!==_0xe3b6('0xaf')){if(this[_0xe3b6('0x25')][_0x422f05][_0xe3b6('0xab')]===_0xe3b6('0x215')&&this[_0xe3b6('0x25')][_0x422f05][_0xe3b6('0xe0')]==='reachable'){_0x4ca501['push'](this[_0xe3b6('0x25')][_0x422f05]['id']);}}}this[_0xe3b6('0xc8')](_0x2f3045['id'],_0x4ca501,0x1,_0x2f3045[_0xe3b6('0x20f')],_0x2f3045)[_0xe3b6('0xbd')](function(_0x4eaf3a){if(!checkContactEmpty(_0x4eaf3a)){checkContactLowerLimitOriginate(_0x2f3045,0x1,0x0);_0x1587d8[_0xe3b6('0x210')](_0x2f3045)[_0xe3b6('0xbd')](sendMessageReschedule(_0x2f3045))[_0xe3b6('0xb8')](loggerCatch(_0xe3b6('0xb9')));}else{_0x2f3045[_0xe3b6('0x47')]=_0xe3b6('0x207');if(_[_0xe3b6('0xb0')](_0x4eaf3a[0x0])||_[_0xe3b6('0xb0')](_0x4eaf3a[0x0][_0xe3b6('0x18d')])||_['isNil'](_0x4eaf3a[0x0][_0xe3b6('0x176')])){_0x1587d8[_0xe3b6('0xd4')](_0xe3b6('0x209'),_0x2f3045,_0x4eaf3a[0x0]);}else{_0x1587d8[_0xe3b6('0xba')](_[_0xe3b6('0xd6')](_0x4eaf3a[0x0],['VoiceQueueId','Contact.phone']))[_0xe3b6('0xbd')](_0x1587d8['checkContactBlack'](_0x2f3045,_0x4eaf3a[0x0]))[_0xe3b6('0xb8')](_0x1587d8[_0xe3b6('0xd3')](_0xe3b6('0x216'),_0x2f3045));}}})[_0xe3b6('0xb8')](loggerGetContactDialer('[getContactDialerPredictive]',_0x2f3045,0x1));emitVoiceQueueSummary(_0x2f3045);};Dialer[_0xe3b6('0x1f')][_0xe3b6('0x1e7')]=function(_0x19639a,_0x4c8aa3,_0x5f2c29,_0x2457f9,_0x4ef6da,_0xd2f7f3){loggerPredictive[_0xe3b6('0x83')](_0xe3b6('0x217'));loggerPredictive[_0xe3b6('0x83')](_0xe3b6('0x218'),_0x19639a);loggerPredictive[_0xe3b6('0x83')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x4c8aa3);loggerPredictive['info']('Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5f2c29);loggerPredictive[_0xe3b6('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',_0x2457f9);loggerPredictive[_0xe3b6('0x83')](_0xe3b6('0x219'),_0x4ef6da);loggerPredictive['info'](_0xe3b6('0x8b'));return new BPromise(function(_0x36115b,_0x2218b0){if(_0x19639a<=0x0||isNaN(_0x19639a)){return _0x2218b0(msgResponse(_0xe3b6('0x21a'),_0xe3b6('0x19f'),'m\x20=\x20'+_0x19639a));}if(_0x5f2c29<=0x0||isNaN(_0x5f2c29)){return _0x2218b0(msgResponse(_0xe3b6('0x21a'),_0xe3b6('0x19f'),_0xe3b6('0x21b')+_0x5f2c29));}if(_0x2457f9<=0x0||isNaN(_0x2457f9)){return _0x2218b0(msgResponse('[abandonmentRate]',_0xe3b6('0x19f'),'p\x20=\x20'+_0x2457f9));}if(_0x4c8aa3<=0x0||isNaN(_0x4c8aa3)){return _0x2218b0(msgResponse('[abandonmentRate]','Error',_0xe3b6('0x21c')+_0x4c8aa3));}if(_0x4ef6da<=0x0||isNaN(_0x4ef6da)){return _0x2218b0(msgResponse(_0xe3b6('0x21a'),_0xe3b6('0x19f'),_0xe3b6('0x21d')+_0x4ef6da));}_0xd2f7f3=_0xd2f7f3||0x0;var _0x1cf6bb=0x1/_0x5f2c29;var _0x3f3b0c=0x0;var _0x3706aa=0x0;var _0x5c6543=0x0;var _0x45f70a=0x0;for(var _0x2e261c=0x0;_0x5c6543<_0x4ef6da;_0x2e261c+=0x1){_0x3706aa=_0x2e261c/_0x4c8aa3;_0x3f3b0c=(_0x2457f9*_0x3706aa+_0xd2f7f3)/_0x1cf6bb;_0x5c6543=erlangb(_0x3f3b0c,_0x19639a);_0x45f70a=_0x3f3b0c/_0x19639a*(0x1-erlangb(_0x3f3b0c,_0x19639a));}return _0x36115b({'erlangCalls':_0x2e261c,'erlangCallToSecond':_0x4c8aa3/_0x2e261c,'erlangAbandonmentRate':_0x5c6543,'erlangBusyFactor':_0x45f70a});});};Dialer[_0xe3b6('0x1f')]['busyFactor']=function(_0x378e37,_0x29c37e,_0x462339,_0x57d02a,_0x2d907e,_0x3dd85e){loggerPredictive[_0xe3b6('0x83')](_0xe3b6('0x21e'));loggerPredictive[_0xe3b6('0x83')]('M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x378e37);loggerPredictive['info'](_0xe3b6('0x21f'),_0x29c37e);loggerPredictive['info']('Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x462339);loggerPredictive[_0xe3b6('0x83')](_0xe3b6('0x220'),_0x57d02a);loggerPredictive[_0xe3b6('0x83')](_0xe3b6('0x221'),_0x2d907e);loggerPredictive[_0xe3b6('0x83')](_0xe3b6('0x8b'));return new BPromise(function(_0xa5e640,_0x3db2b4){if(_0x378e37<=0x0||isNaN(_0x378e37)){return _0x3db2b4(msgResponse('[busyFactor]',_0xe3b6('0x19f'),_0xe3b6('0x222')+_0x378e37));}if(_0x462339<=0x0||isNaN(_0x462339)){return _0x3db2b4(msgResponse(_0xe3b6('0x223'),'Error',_0xe3b6('0x21b')+_0x462339));}if(_0x57d02a<=0x0||isNaN(_0x57d02a)){return _0x3db2b4(msgResponse(_0xe3b6('0x223'),_0xe3b6('0x19f'),'p\x20=\x20'+_0x57d02a));}if(_0x29c37e<=0x0||isNaN(_0x29c37e)){return _0x3db2b4(msgResponse(_0xe3b6('0x223'),_0xe3b6('0x19f'),'interval\x20=\x20'+_0x29c37e));}if(_0x2d907e<=0x0||isNaN(_0x2d907e)){return _0x3db2b4(msgResponse(_0xe3b6('0x223'),_0xe3b6('0x19f'),_0xe3b6('0x224')+_0x2d907e));}_0x3dd85e=_0x3dd85e||0x0;var _0x199d7f=0x1/_0x462339;var _0x26a395=0x0;var _0x392578=0x0;var _0x3352e7=0x0;var _0x2763be=0x0;for(var _0x2f8fd8=0x0;_0x2763be<_0x2d907e;_0x2f8fd8+=0x1){_0x392578=_0x2f8fd8/_0x29c37e;_0x26a395=(_0x57d02a*_0x392578+_0x3dd85e)/_0x199d7f;_0x3352e7=erlangb(_0x26a395,_0x378e37);_0x2763be=_0x26a395/_0x378e37*(0x1-erlangb(_0x26a395,_0x378e37));}return _0xa5e640({'erlangCalls':_0x2f8fd8,'erlangCallToSecond':_0x29c37e/_0x2f8fd8,'erlangAbandonmentRate':_0x3352e7,'erlangBusyFactor':_0x2763be});});};module[_0xe3b6('0x225')]=Dialer;
\ No newline at end of file
index a003c3d..f59555d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa188=['callback','callbackuniqueid','callbackat','recallme','ContactId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','lodash','milliseconds','diff','seconds','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','number','starttime','responsetime','endtime','ringtime','holdtime','talktime','reason'];(function(_0x52bdde,_0x11dc8e){var _0x4b84f5=function(_0x2dbb6c){while(--_0x2dbb6c){_0x52bdde['push'](_0x52bdde['shift']());}};_0x4b84f5(++_0x11dc8e);}(_0xa188,0x133));var _0x8a18=function(_0x276811,_0x2d467b){_0x276811=_0x276811-0x0;var _0x19ca05=_0xa188[_0x276811];return _0x19ca05;};'use strict';var util=require('util');var _=require(_0x8a18('0x0'));var moment=require('moment');function getSeconds(_0xcfe1dd,_0x1a0a95){var _0x59bef8=moment(_0xcfe1dd)['milliseconds'](0x0);var _0x123102=moment(_0x1a0a95)[_0x8a18('0x1')](0x0);return _0x59bef8[_0x8a18('0x2')](_0x123102,_0x8a18('0x3'));}function QueueCallerAbandon(_0xebb3cf,_0x2da396){this['scheduledat']=_0xebb3cf[_0x8a18('0x4')];this[_0x8a18('0x5')]=_0xebb3cf[_0x8a18('0x5')];this[_0x8a18('0x6')]=_0xebb3cf['type']===_0x8a18('0x7')?_0x8a18('0x8'):_0xebb3cf[_0x8a18('0x5')];this['countbusyretry']=_0xebb3cf[_0x8a18('0x9')];this[_0x8a18('0xa')]=_0xebb3cf['countcongestionretry'];this[_0x8a18('0xb')]=_0xebb3cf[_0x8a18('0xb')];this['countglobal']=_0xebb3cf['countbusyretry']+_0xebb3cf['countcongestionretry']+_0xebb3cf[_0x8a18('0xb')]+_0xebb3cf[_0x8a18('0xc')]+_0xebb3cf[_0x8a18('0xd')]+_0xebb3cf[_0x8a18('0xe')]+_0xebb3cf[_0x8a18('0xf')]+_0xebb3cf[_0x8a18('0x10')];this[_0x8a18('0xc')]=_0xebb3cf[_0x8a18('0xc')];this[_0x8a18('0xd')]=_0xebb3cf[_0x8a18('0xd')];this[_0x8a18('0xe')]=_0xebb3cf['countabandonedretry'];this[_0x8a18('0xf')]=_0xebb3cf[_0x8a18('0xf')];this[_0x8a18('0x10')]=_0xebb3cf[_0x8a18('0x10')];this['uniqueid']=_0x2da396[_0x8a18('0x11')];this['calleridname']=_0xebb3cf['name'];this['calleridnum']=_0xebb3cf[_0x8a18('0x12')];this['starttime']=_0xebb3cf[_0x8a18('0x13')];this[_0x8a18('0x14')]=_0xebb3cf[_0x8a18('0x14')];this['droptime']=_0xebb3cf['droptime'];this[_0x8a18('0x15')]=this['droptime'];this[_0x8a18('0x16')]=getSeconds(_0xebb3cf[_0x8a18('0x14')],_0xebb3cf[_0x8a18('0x13')]);this[_0x8a18('0x17')]=getSeconds(this['droptime'],_0xebb3cf[_0x8a18('0x14')]);this[_0x8a18('0x18')]=0x0;this['queue']=_0x2da396[_0x8a18('0x8')];this['membername']=_0x2da396['connectedlinename'];this[_0x8a18('0x19')]=_0x2da396[_0x8a18('0x19')];this[_0x8a18('0x1a')]=_0xebb3cf[_0x8a18('0x1a')];this[_0x8a18('0x1b')]=_0xebb3cf[_0x8a18('0x1b')];this[_0x8a18('0x1c')]=_0xebb3cf[_0x8a18('0x1c')];this[_0x8a18('0x1d')]=_0xebb3cf[_0x8a18('0x1d')];this[_0x8a18('0x1e')]=_0xebb3cf[_0x8a18('0x1e')];this['ListId']=_0xebb3cf['ListId'];this[_0x8a18('0x1f')]=_0xebb3cf['UserId'];this[_0x8a18('0x20')]=_0xebb3cf[_0x8a18('0x20')];this[_0x8a18('0x21')]=_0xebb3cf[_0x8a18('0x21')];this[_0x8a18('0x22')]=_0xebb3cf['originatecalleridnum']||'';this[_0x8a18('0x23')]=_0xebb3cf[_0x8a18('0x23')]||'';}module[_0x8a18('0x24')]=QueueCallerAbandon;
\ No newline at end of file
+var _0x197a=['countmachineretry','countagentrejectretry','uniqueid','number','starttime','responsetime','droptime','endtime','ringtime','holdtime','talktime','queue','membername','connectedlinename','reason','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','moment','milliseconds','diff','seconds','scheduledat','type','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry'];(function(_0x4767da,_0x20aa50){var _0x5d1743=function(_0x2384ff){while(--_0x2384ff){_0x4767da['push'](_0x4767da['shift']());}};_0x5d1743(++_0x20aa50);}(_0x197a,0x162));var _0xa197=function(_0x2abd03,_0x15bd78){_0x2abd03=_0x2abd03-0x0;var _0x397306=_0x197a[_0x2abd03];return _0x397306;};'use strict';var util=require(_0xa197('0x0'));var _=require('lodash');var moment=require(_0xa197('0x1'));function getSeconds(_0x22bef3,_0x1b9b7d){var _0x3461d2=moment(_0x22bef3)[_0xa197('0x2')](0x0);var _0x5adff8=moment(_0x1b9b7d)[_0xa197('0x2')](0x0);return _0x3461d2[_0xa197('0x3')](_0x5adff8,_0xa197('0x4'));}function QueueCallerAbandon(_0x42a3c1,_0x4acc78){this[_0xa197('0x5')]=_0x42a3c1[_0xa197('0x5')];this[_0xa197('0x6')]=_0x42a3c1[_0xa197('0x6')];this['campaigntype']=_0x42a3c1['type']===_0xa197('0x7')?'queue':_0x42a3c1[_0xa197('0x6')];this[_0xa197('0x8')]=_0x42a3c1[_0xa197('0x8')];this['countcongestionretry']=_0x42a3c1[_0xa197('0x9')];this[_0xa197('0xa')]=_0x42a3c1[_0xa197('0xa')];this[_0xa197('0xb')]=_0x42a3c1['countbusyretry']+_0x42a3c1['countcongestionretry']+_0x42a3c1['countnoanswerretry']+_0x42a3c1[_0xa197('0xc')]+_0x42a3c1[_0xa197('0xd')]+_0x42a3c1[_0xa197('0xe')]+_0x42a3c1[_0xa197('0xf')]+_0x42a3c1[_0xa197('0x10')];this['countnosuchnumberretry']=_0x42a3c1[_0xa197('0xc')];this[_0xa197('0xd')]=_0x42a3c1[_0xa197('0xd')];this[_0xa197('0xe')]=_0x42a3c1['countabandonedretry'];this[_0xa197('0xf')]=_0x42a3c1[_0xa197('0xf')];this[_0xa197('0x10')]=_0x42a3c1[_0xa197('0x10')];this['uniqueid']=_0x4acc78[_0xa197('0x11')];this['calleridname']=_0x42a3c1['name'];this['calleridnum']=_0x42a3c1[_0xa197('0x12')];this[_0xa197('0x13')]=_0x42a3c1['starttime'];this[_0xa197('0x14')]=_0x42a3c1['responsetime'];this['droptime']=_0x42a3c1[_0xa197('0x15')];this[_0xa197('0x16')]=this[_0xa197('0x15')];this[_0xa197('0x17')]=getSeconds(_0x42a3c1[_0xa197('0x14')],_0x42a3c1['starttime']);this[_0xa197('0x18')]=getSeconds(this['droptime'],_0x42a3c1[_0xa197('0x14')]);this[_0xa197('0x19')]=0x0;this[_0xa197('0x1a')]=_0x4acc78[_0xa197('0x1a')];this[_0xa197('0x1b')]=_0x4acc78[_0xa197('0x1c')];this[_0xa197('0x1d')]=_0x4acc78[_0xa197('0x1d')];this['callback']=_0x42a3c1['callback'];this[_0xa197('0x1e')]=_0x42a3c1['callbackuniqueid'];this[_0xa197('0x1f')]=_0x42a3c1[_0xa197('0x1f')];this[_0xa197('0x20')]=_0x42a3c1['recallme'];this[_0xa197('0x21')]=_0x42a3c1[_0xa197('0x21')];this[_0xa197('0x22')]=_0x42a3c1[_0xa197('0x22')];this['UserId']=_0x42a3c1[_0xa197('0x23')];this[_0xa197('0x24')]=_0x42a3c1[_0xa197('0x24')];this[_0xa197('0x25')]=_0x42a3c1['CampaignId'];this[_0xa197('0x26')]=_0x42a3c1[_0xa197('0x26')]||'';this[_0xa197('0x27')]=_0x42a3c1[_0xa197('0x27')]||'';}module[_0xa197('0x28')]=QueueCallerAbandon;
\ No newline at end of file
index fd8ae4c..d917cb4 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(_0x3eb51c,_0x4eea98){var _0x4aabe0=function(_0x50d1f2){while(--_0x50d1f2){_0x3eb51c['push'](_0x3eb51c['shift']());}};_0x4aabe0(++_0x4eea98);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0xa9e0[_0x1b349a];return _0x5d1f7c;};'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(_0x43b9d4,_0x89c3e2){var _0x1b7a4a=function(_0x1847c4){while(--_0x1847c4){_0x43b9d4['push'](_0x43b9d4['shift']());}};_0x1b7a4a(++_0x89c3e2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xa9e0[_0x56482c];return _0x5aae7a;};'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 c55019e..6c000ec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf4f4=['./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','faxAccounts','trunks','actions','newchannel','syncNewchannel','bind','newstate','syncNewState','newexten','syncNewExten','faxstatus','receivefax','syncReceiveFax','syncHangup','prototype','context','from-voip-provider','hasOwnProperty','exten','channels','uniqueid','channel','name','info','syncVarSet','variable','channelstate','channelstatedesc','value','syncFaxStatus','operation','status','localstationid','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','\x20result\x20conversion\x20file\x20','message','parse','.pdf','application/pdf','then','notify','error','stringify','catch','\x20receiveFax\x20','syncOriginateResponse','AttachmentId','update','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','SUCCESS','updateStatus','SENDING\x20FAILED:\x20','faxstatusstring','SENDING\x20FAILED','send','execOriginate','FaxAccountId','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','checkTrunk','Trunk','isValid','Trunk\x20Reachable','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','%s/%s.tif','dir','Convert\x20pdf\x20to\x20tif','variablesAction','Action','ext','isTrunkReachable','isNil','active','SIP/%s','reachable','unmonitored','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Is\x20Valid','exports','util','lodash','uuid','moment','path','tiff2pdf','./util/gs','fax','./rpcDb','./channel','./util/util'];(function(_0x190c86,_0x31a0ba){var _0x2ba35a=function(_0x3b0877){while(--_0x3b0877){_0x190c86['push'](_0x190c86['shift']());}};_0x2ba35a(++_0x31a0ba);}(_0xf4f4,0xe3));var _0x4f4f=function(_0xf29c93,_0x31af07){_0xf29c93=_0xf29c93-0x0;var _0x143296=_0xf4f4[_0xf29c93];return _0x143296;};'use strict';var util=require(_0x4f4f('0x0'));var _=require(_0x4f4f('0x1'));var BPromise=require('bluebird');var uuid=require(_0x4f4f('0x2'));var moment=require(_0x4f4f('0x3'));var path=require(_0x4f4f('0x4'));var tiff2pdf=require(_0x4f4f('0x5'));var gs=require(_0x4f4f('0x6'));var logger=require('../../../config/logger')(_0x4f4f('0x7'));var ami=require('../ami');var rpcDb=require(_0x4f4f('0x8'));var Channel=require(_0x4f4f('0x9'));var ut=require(_0x4f4f('0xa'));var Action=require(_0x4f4f('0xb'));var faxAccount=require(_0x4f4f('0xc'));var attachment=require(_0x4f4f('0xd'));var faxMessage=require(_0x4f4f('0xe'));function Fax(_0x3768d7){this['channels']={};this[_0x4f4f('0xf')]=_0x3768d7[_0x4f4f('0xf')];this[_0x4f4f('0x10')]=_0x3768d7[_0x4f4f('0x10')];this[_0x4f4f('0x11')]={};ami['on'](_0x4f4f('0x12'),this[_0x4f4f('0x13')][_0x4f4f('0x14')](this));ami['on']('varset',this['syncVarSet'][_0x4f4f('0x14')](this));ami['on'](_0x4f4f('0x15'),this[_0x4f4f('0x16')][_0x4f4f('0x14')](this));ami['on'](_0x4f4f('0x17'),this[_0x4f4f('0x18')]['bind'](this));ami['on'](_0x4f4f('0x19'),this['syncFaxStatus'][_0x4f4f('0x14')](this));ami['on'](_0x4f4f('0x1a'),this[_0x4f4f('0x1b')][_0x4f4f('0x14')](this));ami['on']('hangup',this[_0x4f4f('0x1c')]['bind'](this));ami['on']('originateresponse',this['syncOriginateResponse'][_0x4f4f('0x14')](this));}Fax[_0x4f4f('0x1d')][_0x4f4f('0x13')]=function(_0x1af189){if(_0x1af189[_0x4f4f('0x1e')]===_0x4f4f('0x1f')){for(var _0x1245c4 in this[_0x4f4f('0xf')]){if(this[_0x4f4f('0xf')][_0x4f4f('0x20')](_0x1245c4)){if(_0x1af189[_0x4f4f('0x21')]===this[_0x4f4f('0xf')][_0x1245c4]['localstationid']){this[_0x4f4f('0x22')][_0x1af189[_0x4f4f('0x23')]]={};this[_0x4f4f('0x22')][_0x1af189[_0x4f4f('0x23')]][_0x4f4f('0x24')]=_0x1af189[_0x4f4f('0x24')];this[_0x4f4f('0x22')][_0x1af189[_0x4f4f('0x23')]]['id']=this[_0x4f4f('0xf')][_0x1245c4]['id'];this[_0x4f4f('0x22')][_0x1af189[_0x4f4f('0x23')]][_0x4f4f('0x25')]=this[_0x4f4f('0xf')][_0x1245c4][_0x4f4f('0x25')];logger['info'](_0x1af189['uniqueid'],'\x20syncNewchannel\x20');}}}}if(this[_0x4f4f('0x11')][_0x1af189[_0x4f4f('0x23')]]){this['channels'][_0x1af189[_0x4f4f('0x23')]]={};this[_0x4f4f('0x22')][_0x1af189[_0x4f4f('0x23')]][_0x4f4f('0x24')]=_0x1af189[_0x4f4f('0x24')];logger[_0x4f4f('0x26')](_0x1af189[_0x4f4f('0x23')],'\x20syncNewchannel\x20');}};Fax[_0x4f4f('0x1d')][_0x4f4f('0x27')]=function(_0x18e718){if(this[_0x4f4f('0x22')][_0x18e718[_0x4f4f('0x23')]]){for(var _0x4ad33d in _0x18e718[_0x4f4f('0x28')]){if(_0x18e718[_0x4f4f('0x28')][_0x4f4f('0x20')](_0x4ad33d)){this['channels'][_0x18e718['uniqueid']][_0x4ad33d]=_0x18e718['value'];}}}};Fax[_0x4f4f('0x1d')]['syncNewState']=function(_0x354266){if(this[_0x4f4f('0x22')][_0x354266[_0x4f4f('0x23')]]){this['channels'][_0x354266[_0x4f4f('0x23')]][_0x4f4f('0x29')]=_0x354266['channelstate'];this[_0x4f4f('0x22')][_0x354266[_0x4f4f('0x23')]][_0x4f4f('0x2a')]=_0x354266['channelstatedesc'];}};Fax[_0x4f4f('0x1d')][_0x4f4f('0x18')]=function(_0x59bdb0){if(this['channels'][_0x59bdb0[_0x4f4f('0x23')]]){for(var _0x305bf7 in _0x59bdb0[_0x4f4f('0x28')]){if(_0x59bdb0[_0x4f4f('0x28')][_0x4f4f('0x20')](_0x305bf7)){this[_0x4f4f('0x22')][_0x59bdb0[_0x4f4f('0x23')]][_0x305bf7]=_0x59bdb0[_0x4f4f('0x2b')];}}}};Fax[_0x4f4f('0x1d')][_0x4f4f('0x2c')]=function(_0x54c095){if(this['channels'][_0x54c095[_0x4f4f('0x23')]]){this['channels'][_0x54c095[_0x4f4f('0x23')]][_0x4f4f('0x2d')]=_0x54c095[_0x4f4f('0x2d')];this[_0x4f4f('0x22')][_0x54c095[_0x4f4f('0x23')]][_0x4f4f('0x2e')]=_0x54c095[_0x4f4f('0x2e')];this[_0x4f4f('0x22')][_0x54c095[_0x4f4f('0x23')]][_0x4f4f('0x2f')]=_0x54c095[_0x4f4f('0x2f')];this[_0x4f4f('0x22')][_0x54c095['uniqueid']][_0x4f4f('0x30')]=_0x54c095[_0x4f4f('0x30')];logger[_0x4f4f('0x26')](_0x54c095[_0x4f4f('0x23')],_0x4f4f('0x31'));}};Fax[_0x4f4f('0x1d')][_0x4f4f('0x1b')]=function(_0x32b077){var _0x1d1f4c=this;if(this['channels'][_0x32b077[_0x4f4f('0x23')]]){var _0x17dceb=this[_0x4f4f('0x22')][_0x32b077['uniqueid']]['id'];this['channels'][_0x32b077[_0x4f4f('0x23')]][_0x4f4f('0x32')]=_0x32b077[_0x4f4f('0x32')];this[_0x4f4f('0x22')][_0x32b077[_0x4f4f('0x23')]][_0x4f4f('0x33')]=_0x32b077[_0x4f4f('0x33')];this[_0x4f4f('0x22')][_0x32b077[_0x4f4f('0x23')]][_0x4f4f('0x2f')]=_0x32b077[_0x4f4f('0x2f')];this[_0x4f4f('0x22')][_0x32b077['uniqueid']][_0x4f4f('0x34')]=_0x32b077[_0x4f4f('0x34')];this[_0x4f4f('0x22')][_0x32b077[_0x4f4f('0x23')]][_0x4f4f('0x35')]=_0x32b077['transferrate'];this['channels'][_0x32b077[_0x4f4f('0x23')]][_0x4f4f('0x30')]=_0x32b077[_0x4f4f('0x30')];this[_0x4f4f('0x22')][_0x32b077['uniqueid']][_0x4f4f('0x36')]=_0x32b077['calleridnum'];if(this[_0x4f4f('0x22')][_0x32b077['uniqueid']]['pagestransferred']>0x0){tiff2pdf(_0x32b077[_0x4f4f('0x30')],'/var/opt/motion2/server/files/attachments/',function(_0x27303d){logger[_0x4f4f('0x26')](_0x32b077['uniqueid'],_0x4f4f('0x37'),_0x27303d[_0x4f4f('0x38')]);attachment['create']({'name':path[_0x4f4f('0x39')](_0x32b077[_0x4f4f('0x30')])[_0x4f4f('0x25')],'basename':path[_0x4f4f('0x39')](_0x32b077[_0x4f4f('0x30')])[_0x4f4f('0x25')]+_0x4f4f('0x3a'),'type':_0x4f4f('0x3b')})[_0x4f4f('0x3c')](function(_0x1c029a){faxAccount[_0x4f4f('0x3d')](_0x17dceb,{'from':_0x32b077[_0x4f4f('0x36')],'mapKey':_0x4f4f('0x7'),'body':path[_0x4f4f('0x39')](_0x32b077[_0x4f4f('0x30')])['name']+_0x4f4f('0x3a'),'AttachmentId':_0x1c029a['id']})['catch'](function(_0x5a0063){logger[_0x4f4f('0x3e')](_0x32b077[_0x4f4f('0x23')],'\x20notify\x20',JSON[_0x4f4f('0x3f')](_0x5a0063));});})[_0x4f4f('0x40')](function(_0xea9617){logger[_0x4f4f('0x3e')](_0x32b077[_0x4f4f('0x23')],'\x20receiveFax\x20',JSON[_0x4f4f('0x3f')](_0xea9617));});});}logger[_0x4f4f('0x26')](_0x32b077[_0x4f4f('0x23')],_0x4f4f('0x41'));}};Fax[_0x4f4f('0x1d')][_0x4f4f('0x42')]=function(_0x29314b){if(this[_0x4f4f('0x11')][_0x29314b[_0x4f4f('0x23')]]){_['merge'](this[_0x4f4f('0x22')][_0x29314b[_0x4f4f('0x23')]],_['pick'](_0x29314b,['response','reason']));}};function updateStatus(_0x146126){if(_0x146126[_0x4f4f('0x43')]){faxMessage[_0x4f4f('0x44')](_0x146126['AttachmentId'],{'failMessage':_0x4f4f('0x45')})['then'](function(_0xf13a0){ut[_0x4f4f('0x46')](_0x4f4f('0x47'),_0xf13a0);})[_0x4f4f('0x40')](function(_0xe03548){ut[_0x4f4f('0x46')](_0x4f4f('0x48'),_0xe03548);});}else{ut[_0x4f4f('0x46')](_0x4f4f('0x49'));}}Fax['prototype']['updateStatus']=function(_0x36cfcf,_0x8edee4,_0x4c04eb){var _0x557ba3=this;var _0x31058a={};if(_0x8edee4){_0x31058a={'read':_0x8edee4};}else{_0x31058a={'failMessage':_0x4c04eb};}if(this[_0x4f4f('0x11')][_0x36cfcf][_0x4f4f('0x43')]){faxMessage['update'](this['actions'][_0x36cfcf][_0x4f4f('0x43')],_0x31058a)[_0x4f4f('0x3c')](function(_0x179998){ut[_0x4f4f('0x46')](_0x4f4f('0x4a'),_0x179998);})[_0x4f4f('0x40')](function(_0xe66fc){ut[_0x4f4f('0x46')](_0x4f4f('0x4b'),_0xe66fc);})[_0x4f4f('0x4c')](function(){delete _0x557ba3[_0x4f4f('0x22')][_0x36cfcf];delete _0x557ba3['actions'][_0x36cfcf];});}else{ut['logger'](_0x4f4f('0x4d'));delete this[_0x4f4f('0x22')][_0x36cfcf];delete this[_0x4f4f('0x11')][_0x36cfcf];}};Fax[_0x4f4f('0x1d')]['syncHangup']=function(_0x1bef77){var _0x57a11f=this;if(this[_0x4f4f('0x22')][_0x1bef77[_0x4f4f('0x23')]]){if(this[_0x4f4f('0x11')][_0x1bef77['uniqueid']]){this[_0x4f4f('0x22')][_0x1bef77[_0x4f4f('0x23')]]['id']=this[_0x4f4f('0x11')][_0x1bef77['uniqueid']]['id'];this[_0x4f4f('0x22')][_0x1bef77[_0x4f4f('0x23')]][_0x4f4f('0x25')]=this['actions'][_0x1bef77[_0x4f4f('0x23')]][_0x4f4f('0x25')];}logger[_0x4f4f('0x26')](_0x1bef77['uniqueid'],this[_0x4f4f('0x11')][_0x1bef77['uniqueid']]?_0x4f4f('0x4e'):_0x4f4f('0x4f'),JSON[_0x4f4f('0x3f')](this[_0x4f4f('0x22')][_0x1bef77[_0x4f4f('0x23')]]));if(this[_0x4f4f('0x11')][_0x1bef77[_0x4f4f('0x23')]]){if(this[_0x4f4f('0x22')][_0x1bef77[_0x4f4f('0x23')]][_0x4f4f('0x50')]>0x0&&this[_0x4f4f('0x22')][_0x1bef77['uniqueid']][_0x4f4f('0x19')]===_0x4f4f('0x51')){this[_0x4f4f('0x52')](_0x1bef77['uniqueid'],!![]);}else{this[_0x4f4f('0x52')](_0x1bef77[_0x4f4f('0x23')],![],this[_0x4f4f('0x22')][_0x1bef77[_0x4f4f('0x23')]]['faxstatusstring']?_0x4f4f('0x53')+this[_0x4f4f('0x22')][_0x1bef77[_0x4f4f('0x23')]][_0x4f4f('0x54')]:_0x4f4f('0x55'));}}}};Fax['prototype'][_0x4f4f('0x56')]=function(_0x484ae2){var _0x19f927=this;return new BPromise(function(_0x320fd3,_0x2da4ea){_0x19f927[_0x4f4f('0x57')](_0x484ae2,_0x19f927[_0x4f4f('0xf')][_0x484ae2[_0x4f4f('0x58')]])['then'](function(_0x50590c){ut[_0x4f4f('0x46')]('[Fax][execOriginate][success]',_0x50590c);_0x320fd3(ut[_0x4f4f('0x38')](_0x4f4f('0x59')));})[_0x4f4f('0x40')](function(_0x1156f9){ut[_0x4f4f('0x46')](_0x4f4f('0x5a'),_0x1156f9);updateStatus(_0x484ae2);_0x2da4ea(ut[_0x4f4f('0x38')](_0x4f4f('0x5b')));});});};Fax[_0x4f4f('0x1d')][_0x4f4f('0x5c')]=function(_0x1f1599){var _0x4fb751=this;return new BPromise(function(_0x5bb03d,_0x533ab2){var _0x3849ee=_0x4fb751[_0x4f4f('0x5d')](_0x4fb751['faxAccounts'][_0x1f1599[_0x4f4f('0x58')]][_0x4f4f('0x5e')],_0x1f1599);if(_0x3849ee[_0x4f4f('0x5f')]){_0x5bb03d(ut[_0x4f4f('0x38')](_0x4f4f('0x60')));}else{_0x533ab2(ut[_0x4f4f('0x38')](_0x3849ee['message']));}});};function originate(_0x3961e8,_0x12597f,_0x434bcd){return new BPromise(function(_0x24ed71,_0x33f4fd){if(_0x434bcd){var _0x36299e=util[_0x4f4f('0x61')](_0x4f4f('0x62'),path['parse'](_0x3961e8[_0x4f4f('0x4')])[_0x4f4f('0x25')],_0x3961e8[_0x4f4f('0x4')]);gs[_0x4f4f('0x63')](_0x36299e)['then'](function(){_0x3961e8[_0x4f4f('0x4')]=util['format'](_0x4f4f('0x64'),path['parse'](_0x3961e8['path'])[_0x4f4f('0x65')],path[_0x4f4f('0x39')](_0x3961e8[_0x4f4f('0x4')])[_0x4f4f('0x25')]);_0x12597f['XMF-PATH']=_0x3961e8[_0x4f4f('0x4')];ut['logger'](_0x4f4f('0x66'),'');ami['Action'](ut[_0x4f4f('0x67')](_0x3961e8,_0x12597f))[_0x4f4f('0x3c')](function(_0x27eb97){_0x24ed71(_0x27eb97);})['catch'](function(_0x41c31c){_0x33f4fd(_0x41c31c);});})['catch'](function(_0x34b4ca){_0x33f4fd(_0x34b4ca);});}else{ami[_0x4f4f('0x68')](ut[_0x4f4f('0x67')](_0x3961e8,_0x12597f))[_0x4f4f('0x3c')](function(_0x2594ce){_0x24ed71(_0x2594ce);})[_0x4f4f('0x40')](function(_0x2525a0){_0x33f4fd(_0x2525a0);});}});}Fax[_0x4f4f('0x1d')][_0x4f4f('0x57')]=function(_0x4b06ff,_0x6e7ab6){var _0x2fa3ae=this;return new BPromise(function(_0x3cf675,_0x14e4f3){var _0x42c638=uuid['v4']();var _0x383d09=ut['addVariables'](_0x4b06ff,_0x6e7ab6);_0x2fa3ae[_0x4f4f('0x11')][_0x42c638]=new Action(_0x42c638,_0x6e7ab6,_0x4b06ff);var _0x18332b=_0x2fa3ae[_0x4f4f('0x11')][_0x42c638];if(path[_0x4f4f('0x39')](_0x4b06ff['path'])[_0x4f4f('0x69')]===_0x4f4f('0x3a')){originate(_0x18332b,_0x383d09,!![])[_0x4f4f('0x3c')](function(_0x563465){_0x3cf675(_0x563465);})[_0x4f4f('0x40')](function(_0x40bab8){_0x14e4f3(_0x40bab8);});}else{originate(_0x18332b,_0x383d09,![])['then'](function(_0x43694b){_0x3cf675(_0x43694b);})[_0x4f4f('0x40')](function(_0x41a715){_0x14e4f3(_0x41a715);});}});};Fax[_0x4f4f('0x1d')][_0x4f4f('0x6a')]=function(_0x25cd1c){return!_['isNil'](_0x25cd1c)&&!_[_0x4f4f('0x6b')](_0x25cd1c[_0x4f4f('0x25')])&&!_[_0x4f4f('0x6b')](_0x25cd1c[_0x4f4f('0x6c')])&&_0x25cd1c[_0x4f4f('0x6c')]&&!_[_0x4f4f('0x6b')](this['trunks'][util[_0x4f4f('0x61')](_0x4f4f('0x6d'),_0x25cd1c[_0x4f4f('0x25')])])&&!_['isNil'](this[_0x4f4f('0x10')][util[_0x4f4f('0x61')](_0x4f4f('0x6d'),_0x25cd1c[_0x4f4f('0x25')])][_0x4f4f('0x2e')])&&(this['trunks'][util[_0x4f4f('0x61')]('SIP/%s',_0x25cd1c['name'])][_0x4f4f('0x2e')]===_0x4f4f('0x6e')||this[_0x4f4f('0x10')][util[_0x4f4f('0x61')](_0x4f4f('0x6d'),_0x25cd1c[_0x4f4f('0x25')])][_0x4f4f('0x2e')]===_0x4f4f('0x6f'));};Fax[_0x4f4f('0x1d')]['checkTrunk']=function(_0x1104b4,_0x4b95f1){if(!this[_0x4f4f('0x6a')](_0x1104b4)){ut[_0x4f4f('0x46')]('[Fax][checkTrunk][Trunk\x20not\x20work]',_[_0x4f4f('0x6b')](_0x1104b4)?'':_0x1104b4[_0x4f4f('0x25')]+_0x4f4f('0x70'));return{'isValid':![],'message':_0x4f4f('0x71')};}if(_[_0x4f4f('0x6b')](_0x4b95f1[_0x4f4f('0x7')])){ut[_0x4f4f('0x46')](_0x4f4f('0x72'),JSON['stringify'](_0x4b95f1));return{'isValid':![],'message':_0x4f4f('0x73')};}if(_[_0x4f4f('0x6b')](_0x4b95f1[_0x4f4f('0x4')])){ut['logger'](_0x4f4f('0x74'),JSON['stringify'](_0x4b95f1));return{'isValid':![],'message':'Empty\x20path'};}return{'isValid':!![],'message':_0x4f4f('0x75')};};module[_0x4f4f('0x76')]=Fax;
\ No newline at end of file
+var _0xae60=['../rpc/attachment','../rpc/faxMessage','faxAccounts','trunks','newchannel','syncNewchannel','bind','varset','syncVarSet','newstate','syncNewState','newexten','syncNewExten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','hangup','syncHangup','originateresponse','syncOriginateResponse','prototype','context','from-voip-provider','hasOwnProperty','exten','localstationid','channels','uniqueid','channel','name','info','actions','variable','value','channelstate','channelstatedesc','operation','filename','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','create','parse','.pdf','then','notify','catch','error','stringify','merge','response','reason','update','logger','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','AttachmentId','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','faxpages','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','send','execOriginate','FaxAccountId','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkTrunk','Trunk','isValid','Trunk\x20Reachable','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','%s/%s.tif','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','status','reachable','unmonitored','Trunk\x20not\x20working','Empty\x20Fax','Empty\x20path','util','lodash','bluebird','moment','path','tiff2pdf','../../../config/logger','fax','./rpcDb','./channel','./util/util','./action','../rpc/faxAccount'];(function(_0x4a59ed,_0x47bd50){var _0x499f15=function(_0x245462){while(--_0x245462){_0x4a59ed['push'](_0x4a59ed['shift']());}};_0x499f15(++_0x47bd50);}(_0xae60,0x1c7));var _0x0ae6=function(_0x36884e,_0x48008f){_0x36884e=_0x36884e-0x0;var _0x1cc367=_0xae60[_0x36884e];return _0x1cc367;};'use strict';var util=require(_0x0ae6('0x0'));var _=require(_0x0ae6('0x1'));var BPromise=require(_0x0ae6('0x2'));var uuid=require('uuid');var moment=require(_0x0ae6('0x3'));var path=require(_0x0ae6('0x4'));var tiff2pdf=require(_0x0ae6('0x5'));var gs=require('./util/gs');var logger=require(_0x0ae6('0x6'))(_0x0ae6('0x7'));var ami=require('../ami');var rpcDb=require(_0x0ae6('0x8'));var Channel=require(_0x0ae6('0x9'));var ut=require(_0x0ae6('0xa'));var Action=require(_0x0ae6('0xb'));var faxAccount=require(_0x0ae6('0xc'));var attachment=require(_0x0ae6('0xd'));var faxMessage=require(_0x0ae6('0xe'));function Fax(_0x1b5e80){this['channels']={};this[_0x0ae6('0xf')]=_0x1b5e80[_0x0ae6('0xf')];this[_0x0ae6('0x10')]=_0x1b5e80[_0x0ae6('0x10')];this['actions']={};ami['on'](_0x0ae6('0x11'),this[_0x0ae6('0x12')][_0x0ae6('0x13')](this));ami['on'](_0x0ae6('0x14'),this[_0x0ae6('0x15')][_0x0ae6('0x13')](this));ami['on'](_0x0ae6('0x16'),this[_0x0ae6('0x17')][_0x0ae6('0x13')](this));ami['on'](_0x0ae6('0x18'),this[_0x0ae6('0x19')][_0x0ae6('0x13')](this));ami['on'](_0x0ae6('0x1a'),this[_0x0ae6('0x1b')]['bind'](this));ami['on'](_0x0ae6('0x1c'),this[_0x0ae6('0x1d')][_0x0ae6('0x13')](this));ami['on'](_0x0ae6('0x1e'),this[_0x0ae6('0x1f')][_0x0ae6('0x13')](this));ami['on'](_0x0ae6('0x20'),this[_0x0ae6('0x21')][_0x0ae6('0x13')](this));}Fax[_0x0ae6('0x22')][_0x0ae6('0x12')]=function(_0x22e8a5){if(_0x22e8a5[_0x0ae6('0x23')]===_0x0ae6('0x24')){for(var _0xda4f01 in this[_0x0ae6('0xf')]){if(this[_0x0ae6('0xf')][_0x0ae6('0x25')](_0xda4f01)){if(_0x22e8a5[_0x0ae6('0x26')]===this[_0x0ae6('0xf')][_0xda4f01][_0x0ae6('0x27')]){this[_0x0ae6('0x28')][_0x22e8a5['uniqueid']]={};this[_0x0ae6('0x28')][_0x22e8a5[_0x0ae6('0x29')]][_0x0ae6('0x2a')]=_0x22e8a5[_0x0ae6('0x2a')];this[_0x0ae6('0x28')][_0x22e8a5[_0x0ae6('0x29')]]['id']=this[_0x0ae6('0xf')][_0xda4f01]['id'];this[_0x0ae6('0x28')][_0x22e8a5['uniqueid']][_0x0ae6('0x2b')]=this[_0x0ae6('0xf')][_0xda4f01][_0x0ae6('0x2b')];logger[_0x0ae6('0x2c')](_0x22e8a5[_0x0ae6('0x29')],'\x20syncNewchannel\x20');}}}}if(this[_0x0ae6('0x2d')][_0x22e8a5[_0x0ae6('0x29')]]){this[_0x0ae6('0x28')][_0x22e8a5[_0x0ae6('0x29')]]={};this[_0x0ae6('0x28')][_0x22e8a5[_0x0ae6('0x29')]]['channel']=_0x22e8a5[_0x0ae6('0x2a')];logger[_0x0ae6('0x2c')](_0x22e8a5['uniqueid'],'\x20syncNewchannel\x20');}};Fax[_0x0ae6('0x22')][_0x0ae6('0x15')]=function(_0x17360e){if(this['channels'][_0x17360e[_0x0ae6('0x29')]]){for(var _0xb68cbe in _0x17360e[_0x0ae6('0x2e')]){if(_0x17360e['variable'][_0x0ae6('0x25')](_0xb68cbe)){this[_0x0ae6('0x28')][_0x17360e[_0x0ae6('0x29')]][_0xb68cbe]=_0x17360e[_0x0ae6('0x2f')];}}}};Fax[_0x0ae6('0x22')][_0x0ae6('0x17')]=function(_0x4fc7bd){if(this['channels'][_0x4fc7bd[_0x0ae6('0x29')]]){this[_0x0ae6('0x28')][_0x4fc7bd['uniqueid']]['channelstate']=_0x4fc7bd[_0x0ae6('0x30')];this[_0x0ae6('0x28')][_0x4fc7bd[_0x0ae6('0x29')]][_0x0ae6('0x31')]=_0x4fc7bd['channelstatedesc'];}};Fax[_0x0ae6('0x22')][_0x0ae6('0x19')]=function(_0x2f32df){if(this['channels'][_0x2f32df[_0x0ae6('0x29')]]){for(var _0x42d13f in _0x2f32df[_0x0ae6('0x2e')]){if(_0x2f32df[_0x0ae6('0x2e')][_0x0ae6('0x25')](_0x42d13f)){this[_0x0ae6('0x28')][_0x2f32df[_0x0ae6('0x29')]][_0x42d13f]=_0x2f32df[_0x0ae6('0x2f')];}}}};Fax[_0x0ae6('0x22')][_0x0ae6('0x1b')]=function(_0x4cb7d4){if(this[_0x0ae6('0x28')][_0x4cb7d4[_0x0ae6('0x29')]]){this['channels'][_0x4cb7d4[_0x0ae6('0x29')]][_0x0ae6('0x32')]=_0x4cb7d4[_0x0ae6('0x32')];this['channels'][_0x4cb7d4[_0x0ae6('0x29')]]['status']=_0x4cb7d4['status'];this[_0x0ae6('0x28')][_0x4cb7d4[_0x0ae6('0x29')]][_0x0ae6('0x27')]=_0x4cb7d4[_0x0ae6('0x27')];this[_0x0ae6('0x28')][_0x4cb7d4['uniqueid']]['filename']=_0x4cb7d4[_0x0ae6('0x33')];logger['info'](_0x4cb7d4[_0x0ae6('0x29')],'\x20syncFaxStatus\x20');}};Fax[_0x0ae6('0x22')]['syncReceiveFax']=function(_0x7998e3){var _0x1640e4=this;if(this[_0x0ae6('0x28')][_0x7998e3[_0x0ae6('0x29')]]){var _0x5be17f=this['channels'][_0x7998e3[_0x0ae6('0x29')]]['id'];this[_0x0ae6('0x28')][_0x7998e3[_0x0ae6('0x29')]]['remotestationid']=_0x7998e3[_0x0ae6('0x34')];this['channels'][_0x7998e3[_0x0ae6('0x29')]][_0x0ae6('0x35')]=_0x7998e3[_0x0ae6('0x35')];this[_0x0ae6('0x28')][_0x7998e3[_0x0ae6('0x29')]][_0x0ae6('0x27')]=_0x7998e3['localstationid'];this[_0x0ae6('0x28')][_0x7998e3[_0x0ae6('0x29')]][_0x0ae6('0x36')]=_0x7998e3[_0x0ae6('0x36')];this[_0x0ae6('0x28')][_0x7998e3[_0x0ae6('0x29')]][_0x0ae6('0x37')]=_0x7998e3[_0x0ae6('0x37')];this['channels'][_0x7998e3[_0x0ae6('0x29')]][_0x0ae6('0x33')]=_0x7998e3[_0x0ae6('0x33')];this[_0x0ae6('0x28')][_0x7998e3[_0x0ae6('0x29')]][_0x0ae6('0x38')]=_0x7998e3[_0x0ae6('0x38')];if(this[_0x0ae6('0x28')][_0x7998e3[_0x0ae6('0x29')]][_0x0ae6('0x35')]>0x0){tiff2pdf(_0x7998e3[_0x0ae6('0x33')],_0x0ae6('0x39'),function(_0x22a3f4){logger[_0x0ae6('0x2c')](_0x7998e3[_0x0ae6('0x29')],_0x0ae6('0x3a'),_0x22a3f4[_0x0ae6('0x3b')]);attachment[_0x0ae6('0x3c')]({'name':path['parse'](_0x7998e3[_0x0ae6('0x33')])[_0x0ae6('0x2b')],'basename':path[_0x0ae6('0x3d')](_0x7998e3[_0x0ae6('0x33')])[_0x0ae6('0x2b')]+_0x0ae6('0x3e'),'type':'application/pdf'})[_0x0ae6('0x3f')](function(_0x1af021){faxAccount[_0x0ae6('0x40')](_0x5be17f,{'from':_0x7998e3[_0x0ae6('0x38')],'mapKey':'fax','body':path['parse'](_0x7998e3['filename'])[_0x0ae6('0x2b')]+_0x0ae6('0x3e'),'AttachmentId':_0x1af021['id']})[_0x0ae6('0x41')](function(_0x4ff1de){logger[_0x0ae6('0x42')](_0x7998e3[_0x0ae6('0x29')],'\x20notify\x20',JSON[_0x0ae6('0x43')](_0x4ff1de));});})[_0x0ae6('0x41')](function(_0x4f26e0){logger[_0x0ae6('0x42')](_0x7998e3[_0x0ae6('0x29')],'\x20receiveFax\x20',JSON[_0x0ae6('0x43')](_0x4f26e0));});});}logger[_0x0ae6('0x2c')](_0x7998e3[_0x0ae6('0x29')],'\x20receiveFax\x20');}};Fax[_0x0ae6('0x22')][_0x0ae6('0x21')]=function(_0x46075a){if(this[_0x0ae6('0x2d')][_0x46075a[_0x0ae6('0x29')]]){_[_0x0ae6('0x44')](this[_0x0ae6('0x28')][_0x46075a['uniqueid']],_['pick'](_0x46075a,[_0x0ae6('0x45'),_0x0ae6('0x46')]));}};function updateStatus(_0x1f164f){if(_0x1f164f['AttachmentId']){faxMessage[_0x0ae6('0x47')](_0x1f164f['AttachmentId'],{'failMessage':'SENDING\x20FAILED\x20'})[_0x0ae6('0x3f')](function(_0x33a0c4){ut[_0x0ae6('0x48')]('[Fax][Message][Error][Updated]',_0x33a0c4);})[_0x0ae6('0x41')](function(_0x21e5be){ut[_0x0ae6('0x48')](_0x0ae6('0x49'),_0x21e5be);});}else{ut[_0x0ae6('0x48')](_0x0ae6('0x4a'));}}Fax[_0x0ae6('0x22')][_0x0ae6('0x4b')]=function(_0x102573,_0x117d24,_0x1cc515){var _0x64d254=this;var _0x17c71c={};if(_0x117d24){_0x17c71c={'read':_0x117d24};}else{_0x17c71c={'failMessage':_0x1cc515};}if(this[_0x0ae6('0x2d')][_0x102573][_0x0ae6('0x4c')]){faxMessage['update'](this['actions'][_0x102573][_0x0ae6('0x4c')],_0x17c71c)[_0x0ae6('0x3f')](function(_0x29d8bf){ut[_0x0ae6('0x48')](_0x0ae6('0x4d'),_0x29d8bf);})[_0x0ae6('0x41')](function(_0x3fa2ba){ut[_0x0ae6('0x48')](_0x0ae6('0x4e'),_0x3fa2ba);})[_0x0ae6('0x4f')](function(){delete _0x64d254[_0x0ae6('0x28')][_0x102573];delete _0x64d254[_0x0ae6('0x2d')][_0x102573];});}else{ut[_0x0ae6('0x48')](_0x0ae6('0x50'));delete this[_0x0ae6('0x28')][_0x102573];delete this[_0x0ae6('0x2d')][_0x102573];}};Fax[_0x0ae6('0x22')][_0x0ae6('0x1f')]=function(_0x481784){var _0x26d313=this;if(this[_0x0ae6('0x28')][_0x481784[_0x0ae6('0x29')]]){if(this[_0x0ae6('0x2d')][_0x481784[_0x0ae6('0x29')]]){this[_0x0ae6('0x28')][_0x481784[_0x0ae6('0x29')]]['id']=this[_0x0ae6('0x2d')][_0x481784[_0x0ae6('0x29')]]['id'];this[_0x0ae6('0x28')][_0x481784['uniqueid']][_0x0ae6('0x2b')]=this[_0x0ae6('0x2d')][_0x481784[_0x0ae6('0x29')]][_0x0ae6('0x2b')];}logger[_0x0ae6('0x2c')](_0x481784[_0x0ae6('0x29')],this[_0x0ae6('0x2d')][_0x481784[_0x0ae6('0x29')]]?_0x0ae6('0x51'):'\x20hangup\x20faxRiceive\x20',JSON['stringify'](this[_0x0ae6('0x28')][_0x481784[_0x0ae6('0x29')]]));if(this['actions'][_0x481784['uniqueid']]){if(this[_0x0ae6('0x28')][_0x481784[_0x0ae6('0x29')]][_0x0ae6('0x52')]>0x0&&this[_0x0ae6('0x28')][_0x481784[_0x0ae6('0x29')]][_0x0ae6('0x1a')]===_0x0ae6('0x53')){this['updateStatus'](_0x481784[_0x0ae6('0x29')],!![]);}else{this['updateStatus'](_0x481784[_0x0ae6('0x29')],![],this[_0x0ae6('0x28')][_0x481784['uniqueid']][_0x0ae6('0x54')]?_0x0ae6('0x55')+this[_0x0ae6('0x28')][_0x481784['uniqueid']][_0x0ae6('0x54')]:'SENDING\x20FAILED');}}}};Fax[_0x0ae6('0x22')][_0x0ae6('0x56')]=function(_0x19f63f){var _0x12c43d=this;return new BPromise(function(_0x54fff7,_0x4d74f7){_0x12c43d[_0x0ae6('0x57')](_0x19f63f,_0x12c43d[_0x0ae6('0xf')][_0x19f63f[_0x0ae6('0x58')]])[_0x0ae6('0x3f')](function(_0x13a742){ut[_0x0ae6('0x48')]('[Fax][execOriginate][success]',_0x13a742);_0x54fff7(ut['message'](_0x0ae6('0x59')));})[_0x0ae6('0x41')](function(_0x39846c){ut[_0x0ae6('0x48')](_0x0ae6('0x5a'),_0x39846c);updateStatus(_0x19f63f);_0x4d74f7(ut[_0x0ae6('0x3b')](_0x0ae6('0x5b')));});});};Fax[_0x0ae6('0x22')]['checkAfterSend']=function(_0x40eba7){var _0x45adc9=this;return new BPromise(function(_0x1c98bb,_0x7e222c){var _0x361b4a=_0x45adc9[_0x0ae6('0x5c')](_0x45adc9['faxAccounts'][_0x40eba7['FaxAccountId']][_0x0ae6('0x5d')],_0x40eba7);if(_0x361b4a[_0x0ae6('0x5e')]){_0x1c98bb(ut['message'](_0x0ae6('0x5f')));}else{_0x7e222c(ut[_0x0ae6('0x3b')](_0x361b4a[_0x0ae6('0x3b')]));}});};function originate(_0x37ad9b,_0x5cd03b,_0x2d9ec4){return new BPromise(function(_0x243e86,_0x42470){if(_0x2d9ec4){var _0x253c17=util[_0x0ae6('0x60')](_0x0ae6('0x61'),path[_0x0ae6('0x3d')](_0x37ad9b[_0x0ae6('0x4')])['name'],_0x37ad9b[_0x0ae6('0x4')]);gs[_0x0ae6('0x62')](_0x253c17)[_0x0ae6('0x3f')](function(){_0x37ad9b[_0x0ae6('0x4')]=util[_0x0ae6('0x60')](_0x0ae6('0x63'),path[_0x0ae6('0x3d')](_0x37ad9b[_0x0ae6('0x4')])[_0x0ae6('0x64')],path[_0x0ae6('0x3d')](_0x37ad9b[_0x0ae6('0x4')])[_0x0ae6('0x2b')]);_0x5cd03b[_0x0ae6('0x65')]=_0x37ad9b[_0x0ae6('0x4')];ut[_0x0ae6('0x48')](_0x0ae6('0x66'),'');ami[_0x0ae6('0x67')](ut[_0x0ae6('0x68')](_0x37ad9b,_0x5cd03b))[_0x0ae6('0x3f')](function(_0x1a114d){_0x243e86(_0x1a114d);})[_0x0ae6('0x41')](function(_0x5c8d9d){_0x42470(_0x5c8d9d);});})[_0x0ae6('0x41')](function(_0x3518f5){_0x42470(_0x3518f5);});}else{ami[_0x0ae6('0x67')](ut[_0x0ae6('0x68')](_0x37ad9b,_0x5cd03b))['then'](function(_0xe8fabd){_0x243e86(_0xe8fabd);})[_0x0ae6('0x41')](function(_0xf1c98f){_0x42470(_0xf1c98f);});}});}Fax[_0x0ae6('0x22')][_0x0ae6('0x57')]=function(_0xf673a8,_0x4827d0){var _0x93493e=this;return new BPromise(function(_0x5750f0,_0x21b970){var _0x2273fa=uuid['v4']();var _0x368a48=ut[_0x0ae6('0x69')](_0xf673a8,_0x4827d0);_0x93493e[_0x0ae6('0x2d')][_0x2273fa]=new Action(_0x2273fa,_0x4827d0,_0xf673a8);var _0x15003f=_0x93493e[_0x0ae6('0x2d')][_0x2273fa];if(path['parse'](_0xf673a8['path'])[_0x0ae6('0x6a')]===_0x0ae6('0x3e')){originate(_0x15003f,_0x368a48,!![])[_0x0ae6('0x3f')](function(_0x104625){_0x5750f0(_0x104625);})['catch'](function(_0x502af0){_0x21b970(_0x502af0);});}else{originate(_0x15003f,_0x368a48,![])[_0x0ae6('0x3f')](function(_0x4bf489){_0x5750f0(_0x4bf489);})[_0x0ae6('0x41')](function(_0x3c764b){_0x21b970(_0x3c764b);});}});};Fax[_0x0ae6('0x22')][_0x0ae6('0x6b')]=function(_0x154d75){return!_[_0x0ae6('0x6c')](_0x154d75)&&!_['isNil'](_0x154d75['name'])&&!_['isNil'](_0x154d75[_0x0ae6('0x6d')])&&_0x154d75['active']&&!_['isNil'](this['trunks'][util['format'](_0x0ae6('0x6e'),_0x154d75['name'])])&&!_[_0x0ae6('0x6c')](this['trunks'][util[_0x0ae6('0x60')](_0x0ae6('0x6e'),_0x154d75[_0x0ae6('0x2b')])][_0x0ae6('0x6f')])&&(this[_0x0ae6('0x10')][util['format'](_0x0ae6('0x6e'),_0x154d75[_0x0ae6('0x2b')])][_0x0ae6('0x6f')]===_0x0ae6('0x70')||this[_0x0ae6('0x10')][util[_0x0ae6('0x60')](_0x0ae6('0x6e'),_0x154d75['name'])][_0x0ae6('0x6f')]===_0x0ae6('0x71'));};Fax[_0x0ae6('0x22')][_0x0ae6('0x5c')]=function(_0x460d90,_0x16115e){if(!this['isTrunkReachable'](_0x460d90)){ut['logger']('[Fax][checkTrunk][Trunk\x20not\x20work]',_[_0x0ae6('0x6c')](_0x460d90)?'':_0x460d90[_0x0ae6('0x2b')]+'\x20Trunk\x20is\x20not\x20active');return{'isValid':![],'message':_0x0ae6('0x72')};}if(_[_0x0ae6('0x6c')](_0x16115e[_0x0ae6('0x7')])){ut['logger']('[Fax][checkTrunk][Empty\x20Fax]',JSON[_0x0ae6('0x43')](_0x16115e));return{'isValid':![],'message':_0x0ae6('0x73')};}if(_['isNil'](_0x16115e['path'])){ut[_0x0ae6('0x48')]('[Fax][checkTrunk][Empty\x20path]',JSON['stringify'](_0x16115e));return{'isValid':![],'message':_0x0ae6('0x74')};}return{'isValid':!![],'message':'Is\x20Valid'};};module['exports']=Fax;
\ No newline at end of file
index 9972550..96a1c39 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5230=['../../../config/logger','lodash','../rpc/faxAccount','error','inspect','notify','then','catch','[Notify]\x20','util','bluebird'];(function(_0x476e0f,_0x22622b){var _0x303890=function(_0x44d4dd){while(--_0x44d4dd){_0x476e0f['push'](_0x476e0f['shift']());}};_0x303890(++_0x22622b);}(_0x5230,0x148));var _0x0523=function(_0x4453b5,_0x434697){_0x4453b5=_0x4453b5-0x0;var _0x4b30d3=_0x5230[_0x4453b5];return _0x4b30d3;};'use strict';var util=require(_0x0523('0x0'));var BPromise=require(_0x0523('0x1'));var logger=require(_0x0523('0x2'))('preview');var _=require(_0x0523('0x3'));var faxAccount=require(_0x0523('0x4'));function loggerCatch(_0x2b14bd){return function(_0x45cf3c){logger[_0x0523('0x5')](_0x2b14bd,util[_0x0523('0x6')](_0x45cf3c,{'showHidden':![],'depth':null}));};}exports[_0x0523('0x7')]=function(_0x208363,_0x4a8f7b){return BPromise['resolve']()[_0x0523('0x8')](faxAccount[_0x0523('0x7')](_0x208363,_0x4a8f7b))[_0x0523('0x9')](loggerCatch(_0x0523('0xa')));};
\ No newline at end of file
+var _0xf35b=['util','../../../config/logger','preview','lodash','inspect','notify','resolve','then','catch'];(function(_0x17c98b,_0x520370){var _0x153891=function(_0x370425){while(--_0x370425){_0x17c98b['push'](_0x17c98b['shift']());}};_0x153891(++_0x520370);}(_0xf35b,0x129));var _0xbf35=function(_0x540de4,_0x2aefad){_0x540de4=_0x540de4-0x0;var _0x55ccdf=_0xf35b[_0x540de4];return _0x55ccdf;};'use strict';var util=require(_0xbf35('0x0'));var BPromise=require('bluebird');var logger=require(_0xbf35('0x1'))(_0xbf35('0x2'));var _=require(_0xbf35('0x3'));var faxAccount=require('../rpc/faxAccount');function loggerCatch(_0x32c2fb){return function(_0x134e36){logger['error'](_0x32c2fb,util[_0xbf35('0x4')](_0x134e36,{'showHidden':![],'depth':null}));};}exports[_0xbf35('0x5')]=function(_0x28a606,_0x4cd3f9){return BPromise[_0xbf35('0x6')]()[_0xbf35('0x7')](faxAccount[_0xbf35('0x5')](_0x28a606,_0x4cd3f9))[_0xbf35('0x8')](loggerCatch('[Notify]\x20'));};
\ No newline at end of file
index 409e09e..d670107 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf6c4=['inspect','util','../../../../config/logger','fax','bluebird','child_process','exec','execute','info','Exec\x20gs'];(function(_0x49aafe,_0x2c7fb3){var _0x242185=function(_0x40fc23){while(--_0x40fc23){_0x49aafe['push'](_0x49aafe['shift']());}};_0x242185(++_0x2c7fb3);}(_0xf6c4,0x1af));var _0x4f6c=function(_0x110fc1,_0x897ab3){_0x110fc1=_0x110fc1-0x0;var _0x4142a6=_0xf6c4[_0x110fc1];return _0x4142a6;};'use strict';var util=require(_0x4f6c('0x0'));var logger=require(_0x4f6c('0x1'))(_0x4f6c('0x2'));var BPromise=require(_0x4f6c('0x3'));var exec=require(_0x4f6c('0x4'))[_0x4f6c('0x5')];exports[_0x4f6c('0x6')]=function(_0x483863){return new BPromise(function(_0x11ee31,_0x380e09){exec(_0x483863,function(_0x33805e,_0x365cd8,_0x7a122c){logger[_0x4f6c('0x7')](_0x4f6c('0x8'),_0x365cd8);if(_0x33805e){logger['info'](_0x4f6c('0x8'),'\x20Error\x20:',util[_0x4f6c('0x9')](_0x33805e,{'showHidden':![],'depth':null}),_0x365cd8,_0x7a122c);_0x380e09(_0x33805e);}_0x11ee31(_0x365cd8);});});};
\ No newline at end of file
+var _0x9ca5=['util','fax','bluebird','child_process','execute','Exec\x20gs','info','\x20Error\x20:','inspect'];(function(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0x9ca5,0x75));var _0x59ca=function(_0x45a945,_0x2e8b66){_0x45a945=_0x45a945-0x0;var _0x403af5=_0x9ca5[_0x45a945];return _0x403af5;};'use strict';var util=require(_0x59ca('0x0'));var logger=require('../../../../config/logger')(_0x59ca('0x1'));var BPromise=require(_0x59ca('0x2'));var exec=require(_0x59ca('0x3'))['exec'];exports[_0x59ca('0x4')]=function(_0x1416fc){return new BPromise(function(_0x4363ea,_0x476e6c){exec(_0x1416fc,function(_0x1084d0,_0x481500,_0x29cded){logger['info'](_0x59ca('0x5'),_0x481500);if(_0x1084d0){logger[_0x59ca('0x6')](_0x59ca('0x5'),_0x59ca('0x7'),util[_0x59ca('0x8')](_0x1084d0,{'showHidden':![],'depth':null}),_0x481500,_0x29cded);_0x476e6c(_0x1084d0);}_0x4363ea(_0x481500);});});};
\ No newline at end of file
index 72cd5c7..e440e0c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9482=['lodash','moment','fax','message','logger','inspect','addVariables','headerinfo','maxrate','format','\x22%s\x22','modem','gateway','faxdetect','t38timeout','path','originate','xcally-motion-fax','from-sip','uniqueid','util'];(function(_0x125d8a,_0x23162d){var _0x5b130f=function(_0x26a09c){while(--_0x26a09c){_0x125d8a['push'](_0x125d8a['shift']());}};_0x5b130f(++_0x23162d);}(_0x9482,0x110));var _0x2948=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x9482[_0x465028];return _0xb783d4;};'use strict';var util=require(_0x2948('0x0'));var _=require(_0x2948('0x1'));var moment=require(_0x2948('0x2'));var logger=require('../../../../config/logger')(_0x2948('0x3'));exports[_0x2948('0x4')]=function(_0x2fcb6b){return{'message':_0x2fcb6b};};exports[_0x2948('0x5')]=function(_0x1aa812,_0x4c333b){logger['info'](_0x1aa812,util[_0x2948('0x6')](_0x4c333b,{'showHidden':![],'depth':null}));};exports[_0x2948('0x7')]=function(_0x2c0038,_0x45eed7){var _0x18432c={'XMF-ECM':_0x45eed7['ecm'],'XMF-HEADERINFO':_0x45eed7[_0x2948('0x8')],'XMF-MINRATE':_0x45eed7['minrate'],'XMF-MAXRATE':_0x45eed7[_0x2948('0x9')],'XMF-MODEM':util[_0x2948('0xa')](_0x2948('0xb'),_0x45eed7[_0x2948('0xc')]),'XMF-GATEWAY':_0x45eed7[_0x2948('0xd')],'XMF-FAXDETECT':_0x45eed7[_0x2948('0xe')],'XMF-T38TIMEOUT':_0x45eed7[_0x2948('0xf')],'XMF-LOCALSTATIONID':_0x45eed7['localstationid'],'XMF-PATH':_0x2c0038[_0x2948('0x10')]};return _0x18432c;};exports['variablesAction']=function(_0x54fb11,_0x243f8e){return{'actionid':_0x54fb11['uniqueid'],'action':_0x2948('0x11'),'channel':_0x54fb11['channel'],'Exten':_0x2948('0x12'),'Context':_0x2948('0x13'),'Priority':'1','callerid':util[_0x2948('0xa')]('\x22%s\x22\x20<%s>',_0x54fb11[_0x2948('0x8')]?_0x54fb11[_0x2948('0x8')]:'',_0x54fb11['localstationid']),'variable':_0x243f8e,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x54fb11[_0x2948('0x14')]};};
\ No newline at end of file
+var _0xdd91=['moment','../../../../config/logger','fax','logger','inspect','addVariables','ecm','minrate','maxrate','format','\x22%s\x22','modem','gateway','localstationid','path','variablesAction','uniqueid','originate','channel','headerinfo'];(function(_0x1d5e54,_0x5115e6){var _0x420d64=function(_0x14c1dc){while(--_0x14c1dc){_0x1d5e54['push'](_0x1d5e54['shift']());}};_0x420d64(++_0x5115e6);}(_0xdd91,0x168));var _0x1dd9=function(_0x590ecf,_0x341182){_0x590ecf=_0x590ecf-0x0;var _0x34754c=_0xdd91[_0x590ecf];return _0x34754c;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x1dd9('0x0'));var logger=require(_0x1dd9('0x1'))(_0x1dd9('0x2'));exports['message']=function(_0x3254da){return{'message':_0x3254da};};exports[_0x1dd9('0x3')]=function(_0x2e29bd,_0x1787e3){logger['info'](_0x2e29bd,util[_0x1dd9('0x4')](_0x1787e3,{'showHidden':![],'depth':null}));};exports[_0x1dd9('0x5')]=function(_0xf606a8,_0x43e5af){var _0x1be06c={'XMF-ECM':_0x43e5af[_0x1dd9('0x6')],'XMF-HEADERINFO':_0x43e5af['headerinfo'],'XMF-MINRATE':_0x43e5af[_0x1dd9('0x7')],'XMF-MAXRATE':_0x43e5af[_0x1dd9('0x8')],'XMF-MODEM':util[_0x1dd9('0x9')](_0x1dd9('0xa'),_0x43e5af[_0x1dd9('0xb')]),'XMF-GATEWAY':_0x43e5af[_0x1dd9('0xc')],'XMF-FAXDETECT':_0x43e5af['faxdetect'],'XMF-T38TIMEOUT':_0x43e5af['t38timeout'],'XMF-LOCALSTATIONID':_0x43e5af[_0x1dd9('0xd')],'XMF-PATH':_0xf606a8[_0x1dd9('0xe')]};return _0x1be06c;};exports[_0x1dd9('0xf')]=function(_0x28cd7b,_0x57f376){return{'actionid':_0x28cd7b[_0x1dd9('0x10')],'action':_0x1dd9('0x11'),'channel':_0x28cd7b[_0x1dd9('0x12')],'Exten':'xcally-motion-fax','Context':'from-sip','Priority':'1','callerid':util[_0x1dd9('0x9')]('\x22%s\x22\x20<%s>',_0x28cd7b[_0x1dd9('0x13')]?_0x28cd7b[_0x1dd9('0x13')]:'',_0x28cd7b[_0x1dd9('0xd')]),'variable':_0x57f376,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x28cd7b[_0x1dd9('0x10')]};};
\ No newline at end of file
index e5b2e74..09a42b1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9949=['../../config/logger','ami','hour','get','resolve','then','getAgents','initAgents','getTelephones','initTelephones','initTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTriggers','getTemplates','initTemplates','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','initCampaigns','getVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','error','inspect','sync','[index.js][main]','bluebird','util','moment','./realtime','./report','./acw','./trigger','./dialer','./preview','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365'];(function(_0x190fef,_0x20e9f8){var _0x20e0f6=function(_0x4b49d9){while(--_0x4b49d9){_0x190fef['push'](_0x190fef['shift']());}};_0x20e0f6(++_0x20e9f8);}(_0x9949,0x1ad));var _0x9994=function(_0x2ba314,_0x23cfea){_0x2ba314=_0x2ba314-0x0;var _0x2ca114=_0x9949[_0x2ba314];return _0x2ca114;};'use strict';var BPromise=require(_0x9994('0x0'));var util=require(_0x9994('0x1'));var moment=require(_0x9994('0x2'));var server=require('./server');var Realtime=require(_0x9994('0x3'));var Report=require(_0x9994('0x4'));var Acw=require(_0x9994('0x5'));var Trigger=require(_0x9994('0x6'));var Dialer=require(_0x9994('0x7'));var Preview=require(_0x9994('0x8'));var Fax=require(_0x9994('0x9'));var user=require(_0x9994('0xa'));var voiceQueue=require(_0x9994('0xb'));var voiceQueueReport=require(_0x9994('0xc'));var voiceCallReport=require(_0x9994('0xd'));var trunk=require(_0x9994('0xe'));var trigger=require('./rpc/trigger');var template=require(_0x9994('0xf'));var cmHopperHistory=require(_0x9994('0x10'));var campaign=require(_0x9994('0x11'));var voiceExtension=require(_0x9994('0x12'));var faxAccount=require(_0x9994('0x13'));var zendesk=require(_0x9994('0x14'));var salesforce=require(_0x9994('0x15'));var sugarcrm=require(_0x9994('0x16'));var freshdesk=require('./rpc/integrations/freshdesk');var desk=require('./rpc/integrations/desk');var zoho=require('./rpc/integrations/zoho');var vtiger=require(_0x9994('0x17'));var freshsales=require(_0x9994('0x18'));var servicenow=require(_0x9994('0x19'));var dynamics365=require(_0x9994('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 logger=require(_0x9994('0x1b'))(_0x9994('0x1c'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()['get'](_0x9994('0x1d'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x9994('0x1e')]('hour')===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x9994('0x1f')]()[_0x9994('0x20')](user[_0x9994('0x21')]())[_0x9994('0x20')](realtime[_0x9994('0x22')]())[_0x9994('0x20')](user[_0x9994('0x23')]())[_0x9994('0x20')](realtime[_0x9994('0x24')]())['then'](trunk['getTrunks']())[_0x9994('0x20')](realtime[_0x9994('0x25')]())[_0x9994('0x20')](voiceQueue[_0x9994('0x26')]())[_0x9994('0x20')](realtime[_0x9994('0x27')]())[_0x9994('0x20')](trigger[_0x9994('0x28')]())[_0x9994('0x20')](realtime[_0x9994('0x29')]())[_0x9994('0x20')](template[_0x9994('0x2a')]())[_0x9994('0x20')](realtime[_0x9994('0x2b')]())[_0x9994('0x20')](zendesk['getZendeskAccounts']())[_0x9994('0x20')](realtime[_0x9994('0x2c')]())['then'](salesforce[_0x9994('0x2d')]())[_0x9994('0x20')](realtime[_0x9994('0x2e')]())[_0x9994('0x20')](sugarcrm[_0x9994('0x2f')]())[_0x9994('0x20')](realtime[_0x9994('0x30')]())[_0x9994('0x20')](freshdesk[_0x9994('0x31')]())[_0x9994('0x20')](realtime['initFreshdeskAccounts']())[_0x9994('0x20')](desk['getDeskAccounts']())[_0x9994('0x20')](realtime[_0x9994('0x32')]())['then'](zoho[_0x9994('0x33')]())['then'](realtime[_0x9994('0x34')]())[_0x9994('0x20')](vtiger['getVtigerAccounts']())['then'](realtime[_0x9994('0x35')]())[_0x9994('0x20')](freshsales[_0x9994('0x36')]())[_0x9994('0x20')](realtime[_0x9994('0x37')]())[_0x9994('0x20')](servicenow[_0x9994('0x38')]())[_0x9994('0x20')](realtime[_0x9994('0x39')]())[_0x9994('0x20')](dynamics365[_0x9994('0x3a')]())[_0x9994('0x20')](realtime[_0x9994('0x3b')]())['then'](campaign['getCampaigns']())[_0x9994('0x20')](realtime[_0x9994('0x3c')]())[_0x9994('0x20')](voiceExtension[_0x9994('0x3d')]())[_0x9994('0x20')](realtime['initVoiceExtensions']())[_0x9994('0x20')](faxAccount[_0x9994('0x3e')]())[_0x9994('0x20')](realtime[_0x9994('0x3f')]())['then'](function(){return realtime;});}function initParams(){return BPromise['resolve']()[_0x9994('0x20')](voiceQueueReport[_0x9994('0x40')]())[_0x9994('0x20')](realtime[_0x9994('0x41')]())[_0x9994('0x20')](cmHopperHistory[_0x9994('0x42')]())[_0x9994('0x20')](realtime[_0x9994('0x43')]())[_0x9994('0x20')](cmHopperHistory[_0x9994('0x44')]())[_0x9994('0x20')](realtime[_0x9994('0x45')]())[_0x9994('0x20')](voiceCallReport[_0x9994('0x46')]())[_0x9994('0x20')](realtime[_0x9994('0x47')]())['catch'](function(_0x57c27a){logger[_0x9994('0x48')]('[index.js][initParams]',util[_0x9994('0x49')](_0x57c27a,{'showHidden':![],'depth':null}));});}function main(){return server['listen'](realtime,preview,fax)[_0x9994('0x20')](function(_0x3ab63f){return initRealtime();})['then'](function(){return initParams();})[_0x9994('0x20')](function(){report[_0x9994('0x4a')]();setInterval(initRealtime,0x1388);})['catch'](function(_0x353c22){logger[_0x9994('0x48')](_0x9994('0x4b'),util[_0x9994('0x49')](_0x353c22,{'showHidden':![],'depth':null}));});}main();
\ No newline at end of file
+var _0xa621=['initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','error','[index.js][initParams]','listen','sync','catch','[index.js][main]','inspect','util','./server','./report','./acw','./trigger','./fax','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/template','./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/dynamics365','../../config/logger','ami','get','resolve','then','getTelephones','getTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTemplates','getZendeskAccounts','initZendeskAccounts','initSalesforceAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','initZohoAccounts','getVtigerAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','getCampaigns','initVoiceExtensions'];(function(_0x159f9b,_0x5b015c){var _0x5af408=function(_0x3d8a15){while(--_0x3d8a15){_0x159f9b['push'](_0x159f9b['shift']());}};_0x5af408(++_0x5b015c);}(_0xa621,0x175));var _0x1a62=function(_0x1a03e2,_0x481b9a){_0x1a03e2=_0x1a03e2-0x0;var _0x72d9ec=_0xa621[_0x1a03e2];return _0x72d9ec;};'use strict';var BPromise=require('bluebird');var util=require(_0x1a62('0x0'));var moment=require('moment');var server=require(_0x1a62('0x1'));var Realtime=require('./realtime');var Report=require(_0x1a62('0x2'));var Acw=require(_0x1a62('0x3'));var Trigger=require(_0x1a62('0x4'));var Dialer=require('./dialer');var Preview=require('./preview');var Fax=require(_0x1a62('0x5'));var user=require('./rpc/user');var voiceQueue=require(_0x1a62('0x6'));var voiceQueueReport=require(_0x1a62('0x7'));var voiceCallReport=require(_0x1a62('0x8'));var trunk=require(_0x1a62('0x9'));var trigger=require('./rpc/trigger');var template=require(_0x1a62('0xa'));var cmHopperHistory=require('./rpc/cmHopperHistory');var campaign=require('./rpc/campaign');var voiceExtension=require(_0x1a62('0xb'));var faxAccount=require(_0x1a62('0xc'));var zendesk=require(_0x1a62('0xd'));var salesforce=require(_0x1a62('0xe'));var sugarcrm=require(_0x1a62('0xf'));var freshdesk=require(_0x1a62('0x10'));var desk=require('./rpc/integrations/desk');var zoho=require(_0x1a62('0x11'));var vtiger=require(_0x1a62('0x12'));var freshsales=require(_0x1a62('0x13'));var servicenow=require('./rpc/integrations/servicenow');var dynamics365=require(_0x1a62('0x14'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require(_0x1a62('0x15'))(_0x1a62('0x16'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x1a62('0x17')]('hour')===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x1a62('0x17')]('hour')===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x1a62('0x18')]()[_0x1a62('0x19')](user['getAgents']())[_0x1a62('0x19')](realtime['initAgents']())[_0x1a62('0x19')](user[_0x1a62('0x1a')]())[_0x1a62('0x19')](realtime['initTelephones']())['then'](trunk[_0x1a62('0x1b')]())[_0x1a62('0x19')](realtime['initTrunks']())[_0x1a62('0x19')](voiceQueue[_0x1a62('0x1c')]())[_0x1a62('0x19')](realtime[_0x1a62('0x1d')]())[_0x1a62('0x19')](trigger[_0x1a62('0x1e')]())[_0x1a62('0x19')](realtime['initTriggers']())[_0x1a62('0x19')](template['getTemplates']())[_0x1a62('0x19')](realtime[_0x1a62('0x1f')]())[_0x1a62('0x19')](zendesk[_0x1a62('0x20')]())['then'](realtime[_0x1a62('0x21')]())[_0x1a62('0x19')](salesforce['getSalesforceAccounts']())[_0x1a62('0x19')](realtime[_0x1a62('0x22')]())[_0x1a62('0x19')](sugarcrm['getSugarcrmAccounts']())[_0x1a62('0x19')](realtime[_0x1a62('0x23')]())[_0x1a62('0x19')](freshdesk[_0x1a62('0x24')]())['then'](realtime[_0x1a62('0x25')]())['then'](desk[_0x1a62('0x26')]())[_0x1a62('0x19')](realtime[_0x1a62('0x27')]())[_0x1a62('0x19')](zoho['getZohoAccounts']())[_0x1a62('0x19')](realtime[_0x1a62('0x28')]())[_0x1a62('0x19')](vtiger[_0x1a62('0x29')]())[_0x1a62('0x19')](realtime['initVtigerAccounts']())['then'](freshsales['getFreshsalesAccounts']())['then'](realtime['initFreshsalesAccounts']())['then'](servicenow[_0x1a62('0x2a')]())['then'](realtime[_0x1a62('0x2b')]())[_0x1a62('0x19')](dynamics365[_0x1a62('0x2c')]())[_0x1a62('0x19')](realtime['initDynamics365Accounts']())[_0x1a62('0x19')](campaign[_0x1a62('0x2d')]())[_0x1a62('0x19')](realtime['initCampaigns']())[_0x1a62('0x19')](voiceExtension['getVoiceExtensions']())[_0x1a62('0x19')](realtime[_0x1a62('0x2e')]())[_0x1a62('0x19')](faxAccount['getFaxAccounts']())['then'](realtime['initFaxAccounts']())[_0x1a62('0x19')](function(){return realtime;});}function initParams(){return BPromise[_0x1a62('0x18')]()[_0x1a62('0x19')](voiceQueueReport['getVoiceQueueReports']())[_0x1a62('0x19')](realtime[_0x1a62('0x2f')]())[_0x1a62('0x19')](cmHopperHistory[_0x1a62('0x30')]())['then'](realtime[_0x1a62('0x31')]())[_0x1a62('0x19')](cmHopperHistory['getCampaignHopperHistory']())[_0x1a62('0x19')](realtime[_0x1a62('0x32')]())[_0x1a62('0x19')](voiceCallReport[_0x1a62('0x33')]())[_0x1a62('0x19')](realtime[_0x1a62('0x34')]())['catch'](function(_0x4e7b9f){logger[_0x1a62('0x35')](_0x1a62('0x36'),util['inspect'](_0x4e7b9f,{'showHidden':![],'depth':null}));});}function main(){return server[_0x1a62('0x37')](realtime,preview,fax)[_0x1a62('0x19')](function(_0x23bb55){return initRealtime();})[_0x1a62('0x19')](function(){return initParams();})['then'](function(){report[_0x1a62('0x38')]();setInterval(initRealtime,0x1388);})[_0x1a62('0x39')](function(_0x2faec9){logger[_0x1a62('0x35')](_0x1a62('0x3a'),util[_0x1a62('0x3b')](_0x2faec9,{'showHidden':![],'depth':null}));});}main();
\ No newline at end of file
index b457feb..b25cd27 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(_0x27a1e9,_0x238d04){var _0x18463c=function(_0x27ea0a){while(--_0x27ea0a){_0x27a1e9['push'](_0x27a1e9['shift']());}};_0x18463c(++_0x238d04);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3071('0x0'));var md5=require(_0x3071('0x1'));var Redis=require(_0x3071('0x2'));var config=require(_0x3071('0x3'));config[_0x3071('0x4')]=_['defaults'](config[_0x3071('0x4')],{'host':_0x3071('0x5'),'port':0x18eb});var io=require(_0x3071('0x6'))(new Redis(config[_0x3071('0x4')]));function Agent(_0xabd7b6){this['id']=_0xabd7b6['id']||0x0;this[_0x3071('0x7')]=_0xabd7b6[_0x3071('0x7')]||'';this[_0x3071('0x8')]=_0xabd7b6[_0x3071('0x8')]||'';this[_0x3071('0x9')]=_0xabd7b6[_0x3071('0x9')]||'';this[_0x3071('0xa')]=_0xabd7b6[_0x3071('0xa')]||'';this['state']=_0x3071('0xb');this[_0x3071('0xc')]=0x0;this[_0x3071('0xd')]=_0x3071('0xb');this[_0x3071('0xe')]='';this['phone']='';this[_0x3071('0xf')]='';this[_0x3071('0x10')]='';this[_0x3071('0x11')]=_0xabd7b6[_0x3071('0x11')]||![];this[_0x3071('0x12')]='unknown';this['voiceStatusTime']=0x0;this[_0x3071('0x13')]='';this['voiceStatusQueue']='';this[_0x3071('0x14')]=![];this[_0x3071('0x15')]=![];this['md5']='';}Agent[_0x3071('0x16')]['updateStatusRealtime']=function(_0x2fc15d){var _0x45c93b;if(_0x2fc15d&&_0x2fc15d[_0x3071('0x17')]){_0x45c93b=_0x2fc15d[_0x3071('0x17')][_0x3071('0x18')]();switch(_0x45c93b){case _0x3071('0x19'):_0x45c93b=_0x3071('0x1a');break;case _0x3071('0x1b'):_0x45c93b=_0x3071('0x1c');break;}}if(_0x45c93b&&this[_0x3071('0x12')]!==_0x45c93b||_0x2fc15d['statePause']){this[_0x3071('0x1d')]=_[_0x3071('0x1e')](moment()[_0x3071('0x1f')]('x'));}if(_0x45c93b){this[_0x3071('0x12')]=_0x45c93b;}var _0x3acf0e={'id':this['id'],'name':this[_0x3071('0x7')],'email':this[_0x3071('0x8')],'accountcode':this[_0x3071('0x9')],'fullname':this['fullname'],'state':this[_0x3071('0x17')],'stateTime':this[_0x3071('0xc')],'status':this[_0x3071('0xd')],'address':this['address'],'online':this[_0x3071('0x11')],'voiceStatus':this['voiceStatus'],'voiceStatusTime':this[_0x3071('0x1d')],'voiceStatusCallerIdNumber':this[_0x3071('0x13')],'voiceStatusQueue':this[_0x3071('0x20')],'interface':this[_0x3071('0x10')],'onhold':this[_0x3071('0x14')]};var _0x34c50e=md5(JSON[_0x3071('0x21')](_0x3acf0e));if(this[_0x3071('0x1')]!==_0x34c50e){this['md5']=_0x34c50e;io['to'](util['format'](_0x3071('0x22'),_0x3acf0e[_0x3071('0x7')]))[_0x3071('0x23')](_0x3071('0x24'),_0x3acf0e);io[_0x3071('0x23')](_0x3071('0x25'),_0x3acf0e);}};module[_0x3071('0x26')]=Agent;
\ No newline at end of file
+var _0x0713=['idle','inuse','talking','voiceStatusTime','toNumber','format','voiceStatusQueue','stringify','user:%s','emit','user:save','user:presence','exports','moment','md5','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','email','accountcode','fullname','unknown','stateTime','status','address','mobile','interface','online','voiceStatus','voiceStatusCallerIdNumber','onhold','local','prototype','state','toLowerCase','not_inuse'];(function(_0x46e8ec,_0x418424){var _0xe65e17=function(_0xf5dbcb){while(--_0xf5dbcb){_0x46e8ec['push'](_0x46e8ec['shift']());}};_0xe65e17(++_0x418424);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3071('0x0'));var md5=require(_0x3071('0x1'));var Redis=require(_0x3071('0x2'));var config=require(_0x3071('0x3'));config[_0x3071('0x4')]=_['defaults'](config[_0x3071('0x4')],{'host':_0x3071('0x5'),'port':0x18eb});var io=require(_0x3071('0x6'))(new Redis(config[_0x3071('0x4')]));function Agent(_0xabd7b6){this['id']=_0xabd7b6['id']||0x0;this[_0x3071('0x7')]=_0xabd7b6[_0x3071('0x7')]||'';this[_0x3071('0x8')]=_0xabd7b6[_0x3071('0x8')]||'';this[_0x3071('0x9')]=_0xabd7b6[_0x3071('0x9')]||'';this[_0x3071('0xa')]=_0xabd7b6[_0x3071('0xa')]||'';this['state']=_0x3071('0xb');this[_0x3071('0xc')]=0x0;this[_0x3071('0xd')]=_0x3071('0xb');this[_0x3071('0xe')]='';this['phone']='';this[_0x3071('0xf')]='';this[_0x3071('0x10')]='';this[_0x3071('0x11')]=_0xabd7b6[_0x3071('0x11')]||![];this[_0x3071('0x12')]='unknown';this['voiceStatusTime']=0x0;this[_0x3071('0x13')]='';this['voiceStatusQueue']='';this[_0x3071('0x14')]=![];this[_0x3071('0x15')]=![];this['md5']='';}Agent[_0x3071('0x16')]['updateStatusRealtime']=function(_0x2fc15d){var _0x45c93b;if(_0x2fc15d&&_0x2fc15d[_0x3071('0x17')]){_0x45c93b=_0x2fc15d[_0x3071('0x17')][_0x3071('0x18')]();switch(_0x45c93b){case _0x3071('0x19'):_0x45c93b=_0x3071('0x1a');break;case _0x3071('0x1b'):_0x45c93b=_0x3071('0x1c');break;}}if(_0x45c93b&&this[_0x3071('0x12')]!==_0x45c93b||_0x2fc15d['statePause']){this[_0x3071('0x1d')]=_[_0x3071('0x1e')](moment()[_0x3071('0x1f')]('x'));}if(_0x45c93b){this[_0x3071('0x12')]=_0x45c93b;}var _0x3acf0e={'id':this['id'],'name':this[_0x3071('0x7')],'email':this[_0x3071('0x8')],'accountcode':this[_0x3071('0x9')],'fullname':this['fullname'],'state':this[_0x3071('0x17')],'stateTime':this[_0x3071('0xc')],'status':this[_0x3071('0xd')],'address':this['address'],'online':this[_0x3071('0x11')],'voiceStatus':this['voiceStatus'],'voiceStatusTime':this[_0x3071('0x1d')],'voiceStatusCallerIdNumber':this[_0x3071('0x13')],'voiceStatusQueue':this[_0x3071('0x20')],'interface':this[_0x3071('0x10')],'onhold':this[_0x3071('0x14')]};var _0x34c50e=md5(JSON[_0x3071('0x21')](_0x3acf0e));if(this[_0x3071('0x1')]!==_0x34c50e){this['md5']=_0x34c50e;io['to'](util['format'](_0x3071('0x22'),_0x3acf0e[_0x3071('0x7')]))[_0x3071('0x23')](_0x3071('0x24'),_0x3acf0e);io[_0x3071('0x23')](_0x3071('0x25'),_0x3acf0e);}};module[_0x3071('0x26')]=Agent;
\ No newline at end of file
index 96dc30b..51e5f00 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbc46=['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','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','name','type','campaign','originated','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency'];(function(_0x24f280,_0x5a14bc){var _0x202ae7=function(_0x2e2add){while(--_0x2e2add){_0x24f280['push'](_0x24f280['shift']());}};_0x202ae7(++_0x5a14bc);}(_0xbc46,0x113));var _0x6bc4=function(_0x1a3aa3,_0x29bb9b){_0x1a3aa3=_0x1a3aa3-0x0;var _0x315002=_0xbc46[_0x1a3aa3];return _0x315002;};'use strict';function Campaign(_0x31393b){this['id']=_0x31393b['id']||0x0;this[_0x6bc4('0x0')]=_0x31393b[_0x6bc4('0x0')]||'';this[_0x6bc4('0x1')]=_0x31393b[_0x6bc4('0x1')]||_0x6bc4('0x2');this[_0x6bc4('0x3')]=0x0;this['temp']=0x0;this['ivrAnswerCallsDay']=0x0;this['ivrTotalCallsDays']=0x0;this['message']='';this['sendMessageOneNotActive']=!![];this['active']=_0x31393b[_0x6bc4('0x4')];this[_0x6bc4('0x5')]=_0x31393b[_0x6bc4('0x5')];this[_0x6bc4('0x6')]=_0x31393b['dialTimezone']||null;this[_0x6bc4('0x7')]=_0x31393b[_0x6bc4('0x7')]?_0x31393b[_0x6bc4('0x7')]:null;this[_0x6bc4('0x8')]=_0x31393b[_0x6bc4('0x8')];this['dialOriginateCallerIdNumber']=_0x31393b[_0x6bc4('0x9')];this[_0x6bc4('0xa')]=_0x31393b[_0x6bc4('0xa')]||0x1e;this['dialCongestionMaxRetry']=_0x31393b[_0x6bc4('0xb')];this['dialCongestionRetryFrequency']=_0x31393b[_0x6bc4('0xc')];this['dialBusyMaxRetry']=_0x31393b[_0x6bc4('0xd')];this[_0x6bc4('0xe')]=_0x31393b[_0x6bc4('0xe')];this[_0x6bc4('0xf')]=_0x31393b[_0x6bc4('0xf')];this['dialNoAnswerRetryFrequency']=_0x31393b[_0x6bc4('0x10')];this[_0x6bc4('0x11')]=_0x31393b[_0x6bc4('0x11')];this[_0x6bc4('0x12')]=_0x31393b[_0x6bc4('0x12')]||0x3;this[_0x6bc4('0x13')]=_0x31393b[_0x6bc4('0x13')]||0x96;this[_0x6bc4('0x14')]=_0x31393b[_0x6bc4('0x14')]||0x3;this['dialDropRetryFrequency']=_0x31393b[_0x6bc4('0x15')]||0x96;this[_0x6bc4('0x16')]=_0x31393b[_0x6bc4('0x16')]||0x3;this[_0x6bc4('0x17')]=_0x31393b[_0x6bc4('0x17')]||0x96;this['dialMachineMaxRetry']=_0x31393b[_0x6bc4('0x18')]||0x3;this[_0x6bc4('0x19')]=_0x31393b[_0x6bc4('0x19')]||0x96;this['dialAgentRejectMaxRetry']=_0x31393b[_0x6bc4('0x1a')]||0x3;this[_0x6bc4('0x1b')]=_0x31393b['dialAgentRejectRetryFrequency']||0x96;this[_0x6bc4('0x1c')]=_0x31393b[_0x6bc4('0x1c')]||_0x6bc4('0x1d');this[_0x6bc4('0x1e')]=_0x31393b[_0x6bc4('0x1e')]||undefined;this['dialRandomLastDigitCallerIdNumber']=_0x31393b[_0x6bc4('0x1f')]||undefined;this[_0x6bc4('0x20')]=_0x31393b['dialCutDigit']||undefined;this[_0x6bc4('0x21')]=_0x31393b['TrunkBackup']?_0x31393b[_0x6bc4('0x21')]:undefined;this[_0x6bc4('0x22')]=_0x31393b[_0x6bc4('0x22')]?_0x31393b[_0x6bc4('0x22')]:undefined;this[_0x6bc4('0x23')]=_0x31393b['Interval']?_0x31393b['Interval']:undefined;this[_0x6bc4('0x24')]=_0x31393b['SquareProject']?_0x31393b['SquareProject']:undefined;this[_0x6bc4('0x25')]=_0x31393b[_0x6bc4('0x24')]?_0x31393b['SquareProject'][_0x6bc4('0x0')]:undefined;this[_0x6bc4('0x26')]=_0x31393b[_0x6bc4('0x26')]||![];this[_0x6bc4('0x27')]=_0x31393b['dialAMDInitialSilence'];this[_0x6bc4('0x28')]=_0x31393b[_0x6bc4('0x28')];this[_0x6bc4('0x29')]=_0x31393b[_0x6bc4('0x29')];this[_0x6bc4('0x2a')]=_0x31393b[_0x6bc4('0x2a')];this['dialAMDMinWordLength']=_0x31393b[_0x6bc4('0x2b')];this[_0x6bc4('0x2c')]=_0x31393b['dialAMDBetweenWordsSilence'];this[_0x6bc4('0x2d')]=_0x31393b['dialAMDMaximumNumberOfWords'];this[_0x6bc4('0x2e')]=_0x31393b[_0x6bc4('0x2e')];this[_0x6bc4('0x2f')]=_0x31393b[_0x6bc4('0x2f')];}module['exports']=Campaign;
\ No newline at end of file
+var _0x24cb=['dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','originated','temp','ivrAnswerCallsDay','ivrTotalCallsDays','message','sendMessageOneNotActive','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout'];(function(_0x574123,_0x273efe){var _0x4440cf=function(_0x33e880){while(--_0x33e880){_0x574123['push'](_0x574123['shift']());}};_0x4440cf(++_0x273efe);}(_0x24cb,0x189));var _0xb24c=function(_0x58afd5,_0x534a48){_0x58afd5=_0x58afd5-0x0;var _0x3e503b=_0x24cb[_0x58afd5];return _0x3e503b;};'use strict';function Campaign(_0xe20ff6){this['id']=_0xe20ff6['id']||0x0;this[_0xb24c('0x0')]=_0xe20ff6['name']||'';this['type']=_0xe20ff6[_0xb24c('0x1')]||_0xb24c('0x2');this[_0xb24c('0x3')]=0x0;this[_0xb24c('0x4')]=0x0;this[_0xb24c('0x5')]=0x0;this[_0xb24c('0x6')]=0x0;this[_0xb24c('0x7')]='';this[_0xb24c('0x8')]=!![];this['active']=_0xe20ff6['active'];this['limitCalls']=_0xe20ff6[_0xb24c('0x9')];this[_0xb24c('0xa')]=_0xe20ff6[_0xb24c('0xa')]||null;this[_0xb24c('0xb')]=_0xe20ff6[_0xb24c('0xb')]?_0xe20ff6[_0xb24c('0xb')]:null;this['dialOriginateCallerIdName']=_0xe20ff6[_0xb24c('0xc')];this[_0xb24c('0xd')]=_0xe20ff6['dialOriginateCallerIdNumber'];this[_0xb24c('0xe')]=_0xe20ff6['dialOriginateTimeout']||0x1e;this[_0xb24c('0xf')]=_0xe20ff6[_0xb24c('0xf')];this[_0xb24c('0x10')]=_0xe20ff6[_0xb24c('0x10')];this['dialBusyMaxRetry']=_0xe20ff6[_0xb24c('0x11')];this[_0xb24c('0x12')]=_0xe20ff6['dialBusyRetryFrequency'];this[_0xb24c('0x13')]=_0xe20ff6[_0xb24c('0x13')];this['dialNoAnswerRetryFrequency']=_0xe20ff6[_0xb24c('0x14')];this['dialGlobalMaxRetry']=_0xe20ff6[_0xb24c('0x15')];this[_0xb24c('0x16')]=_0xe20ff6[_0xb24c('0x16')]||0x3;this[_0xb24c('0x17')]=_0xe20ff6[_0xb24c('0x17')]||0x96;this[_0xb24c('0x18')]=_0xe20ff6['dialDropMaxRetry']||0x3;this[_0xb24c('0x19')]=_0xe20ff6[_0xb24c('0x19')]||0x96;this[_0xb24c('0x1a')]=_0xe20ff6[_0xb24c('0x1a')]||0x3;this[_0xb24c('0x1b')]=_0xe20ff6[_0xb24c('0x1b')]||0x96;this[_0xb24c('0x1c')]=_0xe20ff6['dialMachineMaxRetry']||0x3;this[_0xb24c('0x1d')]=_0xe20ff6['dialMachineRetryFrequency']||0x96;this['dialAgentRejectMaxRetry']=_0xe20ff6['dialAgentRejectMaxRetry']||0x3;this[_0xb24c('0x1e')]=_0xe20ff6[_0xb24c('0x1e')]||0x96;this[_0xb24c('0x1f')]=_0xe20ff6[_0xb24c('0x1f')]||'DESC';this[_0xb24c('0x20')]=_0xe20ff6[_0xb24c('0x20')]||undefined;this[_0xb24c('0x21')]=_0xe20ff6[_0xb24c('0x21')]||undefined;this[_0xb24c('0x22')]=_0xe20ff6[_0xb24c('0x22')]||undefined;this[_0xb24c('0x23')]=_0xe20ff6[_0xb24c('0x23')]?_0xe20ff6[_0xb24c('0x23')]:undefined;this[_0xb24c('0x24')]=_0xe20ff6[_0xb24c('0x24')]?_0xe20ff6[_0xb24c('0x24')]:undefined;this['Interval']=_0xe20ff6[_0xb24c('0x25')]?_0xe20ff6['Interval']:undefined;this[_0xb24c('0x26')]=_0xe20ff6[_0xb24c('0x26')]?_0xe20ff6['SquareProject']:undefined;this[_0xb24c('0x27')]=_0xe20ff6[_0xb24c('0x26')]?_0xe20ff6[_0xb24c('0x26')][_0xb24c('0x0')]:undefined;this[_0xb24c('0x28')]=_0xe20ff6[_0xb24c('0x28')]||![];this[_0xb24c('0x29')]=_0xe20ff6[_0xb24c('0x29')];this['dialAMDGreeting']=_0xe20ff6[_0xb24c('0x2a')];this[_0xb24c('0x2b')]=_0xe20ff6[_0xb24c('0x2b')];this[_0xb24c('0x2c')]=_0xe20ff6[_0xb24c('0x2c')];this['dialAMDMinWordLength']=_0xe20ff6[_0xb24c('0x2d')];this['dialAMDBetweenWordsSilence']=_0xe20ff6[_0xb24c('0x2e')];this[_0xb24c('0x2f')]=_0xe20ff6[_0xb24c('0x2f')];this[_0xb24c('0x30')]=_0xe20ff6[_0xb24c('0x30')];this['dialAMDMaximumWordLength']=_0xe20ff6[_0xb24c('0x31')];}module[_0xb24c('0x32')]=Campaign;
\ No newline at end of file
index 1949043..1480198 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x02ce=['monitorFilename','queue','monitors','transfercalleridnum','transferconnectedlinenum','transferType','mohtime','exports','starttime','channel','destinationchannel','calleridname','connectedlinename','accountcode','context','uniqueid','linkedid','exten','answered','answertime','endtime','lastapplication','lastdata','duration','billableseconds','holdtime','type','tag','disposition','monitor'];(function(_0x116727,_0x2e05f0){var _0x592eda=function(_0x17103a){while(--_0x17103a){_0x116727['push'](_0x116727['shift']());}};_0x592eda(++_0x2e05f0);}(_0x02ce,0x1ac));var _0xe02c=function(_0x1d71eb,_0x502007){_0x1d71eb=_0x1d71eb-0x0;var _0x1ff24a=_0x02ce[_0x1d71eb];return _0x1ff24a;};'use strict';function Channel(){this[_0xe02c('0x0')]=null;this[_0xe02c('0x1')]='';this[_0xe02c('0x2')]='';this['calleridnum']=0x0;this[_0xe02c('0x3')]='';this['connectedlinenum']=undefined;this[_0xe02c('0x4')]=undefined;this[_0xe02c('0x5')]=0x0;this[_0xe02c('0x6')]='';this[_0xe02c('0x7')]=0x0;this[_0xe02c('0x8')]=0x0;this[_0xe02c('0x9')]=0x0;this[_0xe02c('0xa')]=![];this[_0xe02c('0xb')]=null;this[_0xe02c('0xc')]=null;this['unmanaged']=![];this['abandoned']=![];this[_0xe02c('0xd')]='';this[_0xe02c('0xe')]='';this[_0xe02c('0xf')]=0x0;this[_0xe02c('0x10')]=0x0;this[_0xe02c('0x11')]=0x0;this[_0xe02c('0x12')]=null;this[_0xe02c('0x13')]=null;this[_0xe02c('0x14')]=null;this[_0xe02c('0x15')]=![];this[_0xe02c('0x16')]=null;this[_0xe02c('0x17')]=null;this[_0xe02c('0x18')]=[];this[_0xe02c('0x19')]=undefined;this[_0xe02c('0x1a')]=undefined;this[_0xe02c('0x1b')]=undefined;this[_0xe02c('0x1c')]=0x0;}module[_0xe02c('0x1d')]=Channel;
\ No newline at end of file
+var _0x3eaf=['uniqueid','exten','answertime','endtime','unmanaged','lastapplication','duration','billableseconds','type','disposition','monitor','monitors','transfercalleridnum','transferconnectedlinenum','mohtime','exports','starttime','channel','destinationchannel','calleridnum','calleridname','connectedlinenum','accountcode','context'];(function(_0x1a252d,_0x567894){var _0x1ee0fc=function(_0x1b9da3){while(--_0x1b9da3){_0x1a252d['push'](_0x1a252d['shift']());}};_0x1ee0fc(++_0x567894);}(_0x3eaf,0x190));var _0xf3ea=function(_0x42432c,_0xadc54f){_0x42432c=_0x42432c-0x0;var _0x403c71=_0x3eaf[_0x42432c];return _0x403c71;};'use strict';function Channel(){this[_0xf3ea('0x0')]=null;this[_0xf3ea('0x1')]='';this[_0xf3ea('0x2')]='';this[_0xf3ea('0x3')]=0x0;this[_0xf3ea('0x4')]='';this[_0xf3ea('0x5')]=undefined;this['connectedlinename']=undefined;this[_0xf3ea('0x6')]=0x0;this[_0xf3ea('0x7')]='';this[_0xf3ea('0x8')]=0x0;this['linkedid']=0x0;this[_0xf3ea('0x9')]=0x0;this['answered']=![];this[_0xf3ea('0xa')]=null;this[_0xf3ea('0xb')]=null;this[_0xf3ea('0xc')]=![];this['abandoned']=![];this[_0xf3ea('0xd')]='';this['lastdata']='';this[_0xf3ea('0xe')]=0x0;this[_0xf3ea('0xf')]=0x0;this['holdtime']=0x0;this[_0xf3ea('0x10')]=null;this['tag']=null;this[_0xf3ea('0x11')]=null;this[_0xf3ea('0x12')]=![];this['monitorFilename']=null;this['queue']=null;this[_0xf3ea('0x13')]=[];this[_0xf3ea('0x14')]=undefined;this[_0xf3ea('0x15')]=undefined;this['transferType']=undefined;this[_0xf3ea('0x16')]=0x0;}module[_0xf3ea('0x17')]=Channel;
\ No newline at end of file
index 0260d9c..b15b48e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd41d=['name','username','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','exports'];(function(_0x5535ea,_0x45d75a){var _0x4e4bc9=function(_0x102b6b){while(--_0x102b6b){_0x5535ea['push'](_0x5535ea['shift']());}};_0x4e4bc9(++_0x45d75a);}(_0xd41d,0x1a0));var _0xdd41=function(_0x240dae,_0x2f8c73){_0x240dae=_0x240dae-0x0;var _0x78f752=_0xd41d[_0x240dae];return _0x78f752;};'use strict';function DeskAccount(_0x5a1b14){this['id']=_0x5a1b14['id']||0x0;this[_0xdd41('0x0')]=_0x5a1b14[_0xdd41('0x0')]||'';this['username']=_0x5a1b14[_0xdd41('0x1')]||'';this[_0xdd41('0x2')]=_0x5a1b14[_0xdd41('0x2')]||'';this[_0xdd41('0x3')]=_0x5a1b14[_0xdd41('0x3')]||'';this['password']=_0x5a1b14[_0xdd41('0x4')]||'';this['consumerKey']=_0x5a1b14[_0xdd41('0x5')]||'';this['consumerSecret']=_0x5a1b14[_0xdd41('0x6')]||'';this['token']=_0x5a1b14[_0xdd41('0x7')]||'';this['tokenSecret']=_0x5a1b14[_0xdd41('0x8')]||'';this[_0xdd41('0x9')]=_0x5a1b14[_0xdd41('0x9')]||'';this[_0xdd41('0xa')]=_0x5a1b14[_0xdd41('0xa')]||'';this[_0xdd41('0xb')]=_0x5a1b14['Configurations']||{};}module[_0xdd41('0xc')]=DeskAccount;
\ No newline at end of file
+var _0xac99=['serverUrl','Configurations','exports','username','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','type'];(function(_0x3d593d,_0x1dec8d){var _0x501ec5=function(_0x1b7039){while(--_0x1b7039){_0x3d593d['push'](_0x3d593d['shift']());}};_0x501ec5(++_0x1dec8d);}(_0xac99,0x117));var _0x9ac9=function(_0x49b9ef,_0x55547f){_0x49b9ef=_0x49b9ef-0x0;var _0x4de813=_0xac99[_0x49b9ef];return _0x4de813;};'use strict';function DeskAccount(_0xbf4189){this['id']=_0xbf4189['id']||0x0;this['name']=_0xbf4189['name']||'';this[_0x9ac9('0x0')]=_0xbf4189['username']||'';this[_0x9ac9('0x1')]=_0xbf4189['remoteUri']||'';this[_0x9ac9('0x2')]=_0xbf4189[_0x9ac9('0x2')]||'';this[_0x9ac9('0x3')]=_0xbf4189[_0x9ac9('0x3')]||'';this[_0x9ac9('0x4')]=_0xbf4189[_0x9ac9('0x4')]||'';this[_0x9ac9('0x5')]=_0xbf4189['consumerSecret']||'';this[_0x9ac9('0x6')]=_0xbf4189[_0x9ac9('0x6')]||'';this['tokenSecret']=_0xbf4189[_0x9ac9('0x7')]||'';this[_0x9ac9('0x8')]=_0xbf4189[_0x9ac9('0x8')]||'';this[_0x9ac9('0x9')]=_0xbf4189[_0x9ac9('0x9')]||'';this[_0x9ac9('0xa')]=_0xbf4189[_0x9ac9('0xa')]||{};}module[_0x9ac9('0xb')]=DeskAccount;
\ No newline at end of file
index 56e65a3..78d82a9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa70a=['remoteUri','tenantId','clientId','clientSecret','serverUrl','modernAuthentication','Configurations','CloudProvider','exports','username','password'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xa70a,0x1e2));var _0xaa70=function(_0x3896e7,_0x2bfa3b){_0x3896e7=_0x3896e7-0x0;var _0xd99960=_0xa70a[_0x3896e7];return _0xd99960;};'use strict';function Dynamics365Account(_0x436dc4){this['id']=_0x436dc4['id']||0x0;this['name']=_0x436dc4['name']||'';this[_0xaa70('0x0')]=_0x436dc4[_0xaa70('0x0')]||'';this[_0xaa70('0x1')]=_0x436dc4[_0xaa70('0x1')]||'';this['remoteUri']=_0x436dc4[_0xaa70('0x2')]||'';this[_0xaa70('0x3')]=_0x436dc4[_0xaa70('0x3')]||'';this['clientId']=_0x436dc4[_0xaa70('0x4')]||'';this[_0xaa70('0x5')]=_0x436dc4[_0xaa70('0x5')]||{};this[_0xaa70('0x6')]=_0x436dc4[_0xaa70('0x6')]||'';this['modernAuthentication']=_0x436dc4[_0xaa70('0x7')]||![];this['Configurations']=_0x436dc4[_0xaa70('0x8')]||{};this[_0xaa70('0x9')]=_0x436dc4['CloudProvider']||{};}module[_0xaa70('0xa')]=Dynamics365Account;
\ No newline at end of file
+var _0x2a78=['username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl','modernAuthentication','Configurations','exports','name'];(function(_0x3d53ee,_0x5b2f8b){var _0x1be1f7=function(_0x585a11){while(--_0x585a11){_0x3d53ee['push'](_0x3d53ee['shift']());}};_0x1be1f7(++_0x5b2f8b);}(_0x2a78,0x149));var _0x82a7=function(_0x33e9c3,_0x5df2a8){_0x33e9c3=_0x33e9c3-0x0;var _0x5d752f=_0x2a78[_0x33e9c3];return _0x5d752f;};'use strict';function Dynamics365Account(_0x19dd2a){this['id']=_0x19dd2a['id']||0x0;this['name']=_0x19dd2a[_0x82a7('0x0')]||'';this['username']=_0x19dd2a[_0x82a7('0x1')]||'';this[_0x82a7('0x2')]=_0x19dd2a[_0x82a7('0x2')]||'';this['remoteUri']=_0x19dd2a[_0x82a7('0x3')]||'';this[_0x82a7('0x4')]=_0x19dd2a[_0x82a7('0x4')]||'';this[_0x82a7('0x5')]=_0x19dd2a[_0x82a7('0x5')]||'';this[_0x82a7('0x6')]=_0x19dd2a[_0x82a7('0x6')]||{};this[_0x82a7('0x7')]=_0x19dd2a[_0x82a7('0x7')]||'';this['modernAuthentication']=_0x19dd2a[_0x82a7('0x8')]||![];this['Configurations']=_0x19dd2a[_0x82a7('0x9')]||{};this['CloudProvider']=_0x19dd2a['CloudProvider']||{};}module[_0x82a7('0xa')]=Dynamics365Account;
\ No newline at end of file
index 531b206..9aae057 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xec04=['SIP','Trunk','ListId','key','exports','name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout'];(function(_0x3e112d,_0x2bb132){var _0x531c31=function(_0x1954bc){while(--_0x1954bc){_0x3e112d['push'](_0x3e112d['shift']());}};_0x531c31(++_0x2bb132);}(_0xec04,0x1e1));var _0x4ec0=function(_0x2c7223,_0x38777a){_0x2c7223=_0x2c7223-0x0;var _0x6a8d96=_0xec04[_0x2c7223];return _0x6a8d96;};'use strict';function FaxAccount(_0x4ec1e1){this['id']=_0x4ec1e1['id']||0x0;this[_0x4ec0('0x0')]=_0x4ec1e1[_0x4ec0('0x0')]||'';this[_0x4ec0('0x1')]=_0x4ec1e1[_0x4ec0('0x1')];this[_0x4ec0('0x2')]=_0x4ec1e1[_0x4ec0('0x2')];this[_0x4ec0('0x3')]=_0x4ec1e1[_0x4ec0('0x3')];this[_0x4ec0('0x4')]=_0x4ec1e1[_0x4ec0('0x4')];this['minrate']=_0x4ec1e1[_0x4ec0('0x5')]||0x960;this[_0x4ec0('0x6')]=_0x4ec1e1[_0x4ec0('0x6')]||0x3840;this[_0x4ec0('0x7')]=_0x4ec1e1[_0x4ec0('0x7')]||_0x4ec0('0x8');this[_0x4ec0('0x9')]=_0x4ec1e1[_0x4ec0('0x9')]||'no';this[_0x4ec0('0xa')]=_0x4ec1e1[_0x4ec0('0xa')]||'no';this['t38timeout']=_0x4ec1e1[_0x4ec0('0xb')]||0x1388;this['tech']=_0x4ec1e1['tech']||_0x4ec0('0xc');this[_0x4ec0('0xd')]=_0x4ec1e1['Trunk']?_0x4ec1e1[_0x4ec0('0xd')]:undefined;this['ListId']=_0x4ec1e1[_0x4ec0('0xe')];this[_0x4ec0('0xf')]=_0x4ec1e1[_0x4ec0('0xf')];}module[_0x4ec0('0x10')]=FaxAccount;
\ No newline at end of file
+var _0x5fc5=['SIP','Trunk','ListId','key','name','description','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech'];(function(_0x35e9e6,_0x10dc1b){var _0xe3ba5e=function(_0x29252d){while(--_0x29252d){_0x35e9e6['push'](_0x35e9e6['shift']());}};_0xe3ba5e(++_0x10dc1b);}(_0x5fc5,0x114));var _0x55fc=function(_0x17d11c,_0x1df580){_0x17d11c=_0x17d11c-0x0;var _0x1bb2c3=_0x5fc5[_0x17d11c];return _0x1bb2c3;};'use strict';function FaxAccount(_0x4b4175){this['id']=_0x4b4175['id']||0x0;this[_0x55fc('0x0')]=_0x4b4175[_0x55fc('0x0')]||'';this[_0x55fc('0x1')]=_0x4b4175[_0x55fc('0x1')];this['ecm']=_0x4b4175['ecm'];this[_0x55fc('0x2')]=_0x4b4175[_0x55fc('0x2')];this[_0x55fc('0x3')]=_0x4b4175['localstationid'];this[_0x55fc('0x4')]=_0x4b4175[_0x55fc('0x4')]||0x960;this[_0x55fc('0x5')]=_0x4b4175['maxrate']||0x3840;this[_0x55fc('0x6')]=_0x4b4175[_0x55fc('0x6')]||_0x55fc('0x7');this['gateway']=_0x4b4175[_0x55fc('0x8')]||'no';this['faxdetect']=_0x4b4175[_0x55fc('0x9')]||'no';this[_0x55fc('0xa')]=_0x4b4175[_0x55fc('0xa')]||0x1388;this[_0x55fc('0xb')]=_0x4b4175[_0x55fc('0xb')]||_0x55fc('0xc');this[_0x55fc('0xd')]=_0x4b4175[_0x55fc('0xd')]?_0x4b4175[_0x55fc('0xd')]:undefined;this[_0x55fc('0xe')]=_0x4b4175[_0x55fc('0xe')];this[_0x55fc('0xf')]=_0x4b4175['key'];}module['exports']=FaxAccount;
\ No newline at end of file
index 5585180..0bad42f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd3ae=['remoteUri','serverUrl','Configurations','name','username'];(function(_0x5ab27f,_0x21a462){var _0x23826c=function(_0x4292ac){while(--_0x4292ac){_0x5ab27f['push'](_0x5ab27f['shift']());}};_0x23826c(++_0x21a462);}(_0xd3ae,0x9e));var _0xed3a=function(_0x575a16,_0x18eefa){_0x575a16=_0x575a16-0x0;var _0x298d59=_0xd3ae[_0x575a16];return _0x298d59;};'use strict';function FreshdeskAccount(_0x224e52){this['id']=_0x224e52['id']||0x0;this[_0xed3a('0x0')]=_0x224e52[_0xed3a('0x0')]||'';this[_0xed3a('0x1')]=_0x224e52[_0xed3a('0x1')]||'';this['apiKey']=_0x224e52['token']||'';this[_0xed3a('0x2')]=_0x224e52[_0xed3a('0x2')]||'';this['serverUrl']=_0x224e52[_0xed3a('0x3')]||'';this[_0xed3a('0x4')]=_0x224e52[_0xed3a('0x4')]||{};}module['exports']=FreshdeskAccount;
\ No newline at end of file
+var _0x76c8=['remoteUri','Configurations','exports','name','username','apiKey','token'];(function(_0xc694ff,_0x1498ad){var _0x59dba2=function(_0x4c3ccd){while(--_0x4c3ccd){_0xc694ff['push'](_0xc694ff['shift']());}};_0x59dba2(++_0x1498ad);}(_0x76c8,0x145));var _0x876c=function(_0x3b8710,_0x32a948){_0x3b8710=_0x3b8710-0x0;var _0x5947fd=_0x76c8[_0x3b8710];return _0x5947fd;};'use strict';function FreshdeskAccount(_0x9c5153){this['id']=_0x9c5153['id']||0x0;this[_0x876c('0x0')]=_0x9c5153[_0x876c('0x0')]||'';this[_0x876c('0x1')]=_0x9c5153[_0x876c('0x1')]||'';this[_0x876c('0x2')]=_0x9c5153[_0x876c('0x3')]||'';this[_0x876c('0x4')]=_0x9c5153[_0x876c('0x4')]||'';this['serverUrl']=_0x9c5153['serverUrl']||'';this[_0x876c('0x5')]=_0x9c5153[_0x876c('0x5')]||{};}module[_0x876c('0x6')]=FreshdeskAccount;
\ No newline at end of file
index 8139094..73bd4a4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3079=['username','token','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x406e46,_0x5799cb){var _0x4a3742=function(_0x1fa435){while(--_0x1fa435){_0x406e46['push'](_0x406e46['shift']());}};_0x4a3742(++_0x5799cb);}(_0x3079,0x110));var _0x9307=function(_0x4ffe17,_0x49ce92){_0x4ffe17=_0x4ffe17-0x0;var _0x3f5d9d=_0x3079[_0x4ffe17];return _0x3f5d9d;};'use strict';function FreshsalesAccount(_0x454290){this['id']=_0x454290['id']||0x0;this[_0x9307('0x0')]=_0x454290[_0x9307('0x0')]||'';this[_0x9307('0x1')]=_0x454290[_0x9307('0x1')]||'';this['apiKey']=_0x454290[_0x9307('0x2')]||'';this[_0x9307('0x3')]=_0x454290['remoteUri']||'';this['serverUrl']=_0x454290[_0x9307('0x4')]||'';this[_0x9307('0x5')]=_0x454290[_0x9307('0x5')]||{};}module[_0x9307('0x6')]=FreshsalesAccount;
\ No newline at end of file
+var _0x4fb4=['name','username','apiKey','token','remoteUri','serverUrl','Configurations','exports'];(function(_0x92e68e,_0x132bc2){var _0x4ec11f=function(_0xf2e69d){while(--_0xf2e69d){_0x92e68e['push'](_0x92e68e['shift']());}};_0x4ec11f(++_0x132bc2);}(_0x4fb4,0x190));var _0x44fb=function(_0x5e4799,_0x43055b){_0x5e4799=_0x5e4799-0x0;var _0x333dea=_0x4fb4[_0x5e4799];return _0x333dea;};'use strict';function FreshsalesAccount(_0x2983b0){this['id']=_0x2983b0['id']||0x0;this[_0x44fb('0x0')]=_0x2983b0[_0x44fb('0x0')]||'';this[_0x44fb('0x1')]=_0x2983b0[_0x44fb('0x1')]||'';this[_0x44fb('0x2')]=_0x2983b0[_0x44fb('0x3')]||'';this['remoteUri']=_0x2983b0[_0x44fb('0x4')]||'';this[_0x44fb('0x5')]=_0x2983b0[_0x44fb('0x5')]||'';this[_0x44fb('0x6')]=_0x2983b0[_0x44fb('0x6')]||{};}module[_0x44fb('0x7')]=FreshsalesAccount;
\ No newline at end of file
index ff3c510..8ce71e7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4d5f=['connectedlinename','context','holdtime','lastAssignedTo','motionChannel','variables','exports','type','inbound','uniqueid','calleridname','queue','queuecallerleaveAt','position','count','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallerexit','originalposition','channel'];(function(_0x4eae7a,_0x2e7d08){var _0x4676a9=function(_0x2b73cd){while(--_0x2b73cd){_0x4eae7a['push'](_0x4eae7a['shift']());}};_0x4676a9(++_0x2e7d08);}(_0x4d5f,0x118));var _0xf4d5=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x4d5f[_0x618414];return _0x21c19a;};'use strict';function QueueReport(){this[_0xf4d5('0x0')]=_0xf4d5('0x1');this[_0xf4d5('0x2')]='';this['calleridnum']='';this[_0xf4d5('0x3')]='';this[_0xf4d5('0x4')]='';this['queuecallerjoinAt']=null;this[_0xf4d5('0x5')]=null;this[_0xf4d5('0x6')]=0x1;this[_0xf4d5('0x7')]=0x1;this[_0xf4d5('0x8')]=![];this[_0xf4d5('0x9')]=null;this[_0xf4d5('0xa')]=![];this['queuecallercompleteAt']=null;this[_0xf4d5('0xb')]=![];this['queuecallerexitAt']=null;this[_0xf4d5('0xc')]=0x1;this[_0xf4d5('0xd')]='';this['connectedlinenum']='';this[_0xf4d5('0xe')]='';this['accountcode']='';this[_0xf4d5('0xf')]='';this['exten']='';this['priority']='';this[_0xf4d5('0x10')]=0x0;this['assigned']=![];this[_0xf4d5('0x11')]='';this[_0xf4d5('0x12')]='voice';this['mohtime']=0x0;this[_0xf4d5('0x13')]={};}module[_0xf4d5('0x14')]=QueueReport;
\ No newline at end of file
+var _0xd37c=['mohtime','variables','type','inbound','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','count','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','originalposition','connectedlinename','accountcode','context','exten','priority','holdtime','lastAssignedTo','motionChannel','voice'];(function(_0xefc732,_0x126e41){var _0x440b48=function(_0x4cbb43){while(--_0x4cbb43){_0xefc732['push'](_0xefc732['shift']());}};_0x440b48(++_0x126e41);}(_0xd37c,0x160));var _0xcd37=function(_0x4934a5,_0x3c6d4c){_0x4934a5=_0x4934a5-0x0;var _0x3e7285=_0xd37c[_0x4934a5];return _0x3e7285;};'use strict';function QueueReport(){this[_0xcd37('0x0')]=_0xcd37('0x1');this[_0xcd37('0x2')]='';this[_0xcd37('0x3')]='';this[_0xcd37('0x4')]='';this[_0xcd37('0x5')]='';this[_0xcd37('0x6')]=null;this[_0xcd37('0x7')]=null;this['position']=0x1;this[_0xcd37('0x8')]=0x1;this['queuecallerabandon']=![];this[_0xcd37('0x9')]=null;this[_0xcd37('0xa')]=![];this[_0xcd37('0xb')]=null;this[_0xcd37('0xc')]=![];this['queuecallerexitAt']=null;this[_0xcd37('0xd')]=0x1;this['channel']='';this['connectedlinenum']='';this[_0xcd37('0xe')]='';this[_0xcd37('0xf')]='';this[_0xcd37('0x10')]='';this[_0xcd37('0x11')]='';this[_0xcd37('0x12')]='';this[_0xcd37('0x13')]=0x0;this['assigned']=![];this[_0xcd37('0x14')]='';this[_0xcd37('0x15')]=_0xcd37('0x16');this[_0xcd37('0x17')]=0x0;this[_0xcd37('0x18')]={};}module['exports']=QueueReport;
\ No newline at end of file
index 2215dda..8572b8f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0bd5=['type','integrationTab','Configurations','name','username','remoteUri','password','clientId','clientSecret','securityToken'];(function(_0x45c48f,_0x4aa891){var _0xaf5037=function(_0x3e3c1f){while(--_0x3e3c1f){_0x45c48f['push'](_0x45c48f['shift']());}};_0xaf5037(++_0x4aa891);}(_0x0bd5,0x189));var _0x50bd=function(_0x503ee0,_0x25e035){_0x503ee0=_0x503ee0-0x0;var _0x97031b=_0x0bd5[_0x503ee0];return _0x97031b;};'use strict';function SalesforceAccount(_0x29a688){this['id']=_0x29a688['id']||0x0;this[_0x50bd('0x0')]=_0x29a688[_0x50bd('0x0')]||'';this[_0x50bd('0x1')]=_0x29a688[_0x50bd('0x1')]||'';this[_0x50bd('0x2')]=_0x29a688['remoteUri']||'';this[_0x50bd('0x3')]=_0x29a688[_0x50bd('0x3')]||'';this[_0x50bd('0x4')]=_0x29a688[_0x50bd('0x4')]||'';this[_0x50bd('0x5')]=_0x29a688[_0x50bd('0x5')]||'';this[_0x50bd('0x6')]=_0x29a688[_0x50bd('0x6')]||'';this[_0x50bd('0x7')]=_0x29a688[_0x50bd('0x7')]||_0x50bd('0x8');this['serverUrl']=_0x29a688['serverUrl']||'';this[_0x50bd('0x9')]=_0x29a688[_0x50bd('0x9')]||{};}module['exports']=SalesforceAccount;
\ No newline at end of file
+var _0xafb4=['clientSecret','securityToken','type','integrationTab','serverUrl','Configurations','name','username','remoteUri','password','clientId'];(function(_0x4fc9e6,_0xc51915){var _0x551d28=function(_0x1a603b){while(--_0x1a603b){_0x4fc9e6['push'](_0x4fc9e6['shift']());}};_0x551d28(++_0xc51915);}(_0xafb4,0x1be));var _0x4afb=function(_0x549278,_0x450754){_0x549278=_0x549278-0x0;var _0x1ea9a1=_0xafb4[_0x549278];return _0x1ea9a1;};'use strict';function SalesforceAccount(_0x1194e5){this['id']=_0x1194e5['id']||0x0;this['name']=_0x1194e5[_0x4afb('0x0')]||'';this[_0x4afb('0x1')]=_0x1194e5[_0x4afb('0x1')]||'';this['remoteUri']=_0x1194e5[_0x4afb('0x2')]||'';this['password']=_0x1194e5[_0x4afb('0x3')]||'';this[_0x4afb('0x4')]=_0x1194e5[_0x4afb('0x4')]||'';this[_0x4afb('0x5')]=_0x1194e5['clientSecret']||'';this[_0x4afb('0x6')]=_0x1194e5[_0x4afb('0x6')]||'';this[_0x4afb('0x7')]=_0x1194e5[_0x4afb('0x7')]||_0x4afb('0x8');this[_0x4afb('0x9')]=_0x1194e5[_0x4afb('0x9')]||'';this['Configurations']=_0x1194e5[_0x4afb('0xa')]||{};}module['exports']=SalesforceAccount;
\ No newline at end of file
index 4402e83..bebd1bd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7d66=['password','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0xc192b9,_0x275d09){var _0x114ffd=function(_0x1a6267){while(--_0x1a6267){_0xc192b9['push'](_0xc192b9['shift']());}};_0x114ffd(++_0x275d09);}(_0x7d66,0x17f));var _0x67d6=function(_0x10291b,_0x518773){_0x10291b=_0x10291b-0x0;var _0x1d5fbe=_0x7d66[_0x10291b];return _0x1d5fbe;};'use strict';function ServicenowAccount(_0x138d8b){this['id']=_0x138d8b['id']||0x0;this['name']=_0x138d8b[_0x67d6('0x0')]||'';this[_0x67d6('0x1')]=_0x138d8b[_0x67d6('0x1')]||'';this[_0x67d6('0x2')]=_0x138d8b[_0x67d6('0x2')]||'';this[_0x67d6('0x3')]=_0x138d8b[_0x67d6('0x3')]||'';this['serverUrl']=_0x138d8b[_0x67d6('0x4')]||'';this[_0x67d6('0x5')]=_0x138d8b[_0x67d6('0x5')]||{};}module[_0x67d6('0x6')]=ServicenowAccount;
\ No newline at end of file
+var _0xfba0=['username','password','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x1909e6,_0x25aff7){var _0x543b11=function(_0x3ed8b8){while(--_0x3ed8b8){_0x1909e6['push'](_0x1909e6['shift']());}};_0x543b11(++_0x25aff7);}(_0xfba0,0x1c6));var _0x0fba=function(_0x1043eb,_0xa099ad){_0x1043eb=_0x1043eb-0x0;var _0x4de8ed=_0xfba0[_0x1043eb];return _0x4de8ed;};'use strict';function ServicenowAccount(_0x1db8c0){this['id']=_0x1db8c0['id']||0x0;this[_0x0fba('0x0')]=_0x1db8c0['name']||'';this[_0x0fba('0x1')]=_0x1db8c0[_0x0fba('0x1')]||'';this[_0x0fba('0x2')]=_0x1db8c0['password']||'';this['remoteUri']=_0x1db8c0[_0x0fba('0x3')]||'';this[_0x0fba('0x4')]=_0x1db8c0[_0x0fba('0x4')]||'';this[_0x0fba('0x5')]=_0x1db8c0[_0x0fba('0x5')]||{};}module[_0x0fba('0x6')]=ServicenowAccount;
\ No newline at end of file
index 49fd400..0a938b5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x38fb=['password','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0xc68d4,_0x2e99ce){var _0xf21aa6=function(_0x2823eb){while(--_0x2823eb){_0xc68d4['push'](_0xc68d4['shift']());}};_0xf21aa6(++_0x2e99ce);}(_0x38fb,0x1b0));var _0xb38f=function(_0x5b7963,_0x10bff5){_0x5b7963=_0x5b7963-0x0;var _0x57f611=_0x38fb[_0x5b7963];return _0x57f611;};'use strict';function SugarcrmAccount(_0x1f5142){this['id']=_0x1f5142['id']||0x0;this[_0xb38f('0x0')]=_0x1f5142[_0xb38f('0x0')]||'';this[_0xb38f('0x1')]=_0x1f5142[_0xb38f('0x1')]||'';this[_0xb38f('0x2')]=_0x1f5142[_0xb38f('0x2')]||'';this[_0xb38f('0x3')]=_0x1f5142[_0xb38f('0x3')]||'';this[_0xb38f('0x4')]=_0x1f5142[_0xb38f('0x4')]||'';this[_0xb38f('0x5')]=_0x1f5142[_0xb38f('0x5')]||{};}module[_0xb38f('0x6')]=SugarcrmAccount;
\ No newline at end of file
+var _0x37ab=['remoteUri','serverUrl','Configurations','exports','name','username','password'];(function(_0x1aef5f,_0x135d18){var _0x3b13a2=function(_0x4817a3){while(--_0x4817a3){_0x1aef5f['push'](_0x1aef5f['shift']());}};_0x3b13a2(++_0x135d18);}(_0x37ab,0x193));var _0xb37a=function(_0x1df803,_0x25192d){_0x1df803=_0x1df803-0x0;var _0x20ef12=_0x37ab[_0x1df803];return _0x20ef12;};'use strict';function SugarcrmAccount(_0x31ad56){this['id']=_0x31ad56['id']||0x0;this[_0xb37a('0x0')]=_0x31ad56[_0xb37a('0x0')]||'';this[_0xb37a('0x1')]=_0x31ad56['username']||'';this[_0xb37a('0x2')]=_0x31ad56[_0xb37a('0x2')]||'';this[_0xb37a('0x3')]=_0x31ad56[_0xb37a('0x3')]||'';this['serverUrl']=_0x31ad56[_0xb37a('0x4')]||'';this[_0xb37a('0x5')]=_0x31ad56['Configurations']||{};}module[_0xb37a('0x6')]=SugarcrmAccount;
\ No newline at end of file
index c040198..7d97d90 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x35ba=['name','accountcode','state','unknown','stateTime','status','address'];(function(_0x15593e,_0x48eaf6){var _0x2b1a7c=function(_0x1b674f){while(--_0x1b674f){_0x15593e['push'](_0x15593e['shift']());}};_0x2b1a7c(++_0x48eaf6);}(_0x35ba,0x8c));var _0xa35b=function(_0x229066,_0x443063){_0x229066=_0x229066-0x0;var _0xd7c89=_0x35ba[_0x229066];return _0xd7c89;};'use strict';function Telephone(_0x235f89){this['id']=_0x235f89['id']||0x0;this[_0xa35b('0x0')]=_0x235f89[_0xa35b('0x0')]||'';this[_0xa35b('0x1')]=_0x235f89['accountcode']||'';this[_0xa35b('0x2')]=_0xa35b('0x3');this[_0xa35b('0x4')]=0x0;this[_0xa35b('0x5')]=_0xa35b('0x3');this[_0xa35b('0x6')]='';}module['exports']=Telephone;
\ No newline at end of file
+var _0x1f8f=['accountcode','state','unknown','stateTime','status','address','name'];(function(_0x594fae,_0x1f5cda){var _0x3dfcac=function(_0xf806c6){while(--_0xf806c6){_0x594fae['push'](_0x594fae['shift']());}};_0x3dfcac(++_0x1f5cda);}(_0x1f8f,0x19c));var _0xf1f8=function(_0x2f241e,_0x3c11ac){_0x2f241e=_0x2f241e-0x0;var _0x254eb4=_0x1f8f[_0x2f241e];return _0x254eb4;};'use strict';function Telephone(_0x32eb9c){this['id']=_0x32eb9c['id']||0x0;this[_0xf1f8('0x0')]=_0x32eb9c['name']||'';this[_0xf1f8('0x1')]=_0x32eb9c[_0xf1f8('0x1')]||'';this[_0xf1f8('0x2')]=_0xf1f8('0x3');this[_0xf1f8('0x4')]=0x0;this[_0xf1f8('0x5')]='unknown';this[_0xf1f8('0x6')]='';}module['exports']=Telephone;
\ No newline at end of file
index bafc91d..339e730 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb10b=['name','html'];(function(_0x542250,_0x29bfe5){var _0x3ec222=function(_0x3744ed){while(--_0x3744ed){_0x542250['push'](_0x542250['shift']());}};_0x3ec222(++_0x29bfe5);}(_0xb10b,0x12a));var _0xbb10=function(_0x266703,_0x120c3b){_0x266703=_0x266703-0x0;var _0x37d275=_0xb10b[_0x266703];return _0x37d275;};'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
+var _0xa9e0=['exports','name'];(function(_0x2bb876,_0x31c991){var _0x58883b=function(_0x346b4c){while(--_0x346b4c){_0x2bb876['push'](_0x2bb876['shift']());}};_0x58883b(++_0x31c991);}(_0xa9e0,0x123));var _0x0a9e=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xa9e0[_0x29b609];return _0x54c952;};'use strict';function template(_0x1f0015){this['id']=_0x1f0015['id']||0x0;this[_0x0a9e('0x0')]=_0x1f0015[_0x0a9e('0x0')]||'';this['html']=_0x1f0015['html']||'';}module[_0x0a9e('0x1')]=template;
\ No newline at end of file
index 887d22e..8586a2e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2032=['exports','name','channel','voice','status','AllConditions','AnyConditions','Actions'];(function(_0x1c1d04,_0x1cc372){var _0x2b22e6=function(_0x178cf1){while(--_0x178cf1){_0x1c1d04['push'](_0x1c1d04['shift']());}};_0x2b22e6(++_0x1cc372);}(_0x2032,0xd9));var _0x2203=function(_0x49ac39,_0x4251ca){_0x49ac39=_0x49ac39-0x0;var _0x3a4d1d=_0x2032[_0x49ac39];return _0x3a4d1d;};'use strict';function Trigger(_0x4d6c97){this['id']=_0x4d6c97['id']||0x0;this[_0x2203('0x0')]=_0x4d6c97[_0x2203('0x0')]||'';this[_0x2203('0x1')]=_0x4d6c97['channel']||_0x2203('0x2');this[_0x2203('0x3')]=_0x4d6c97['status']||![];this[_0x2203('0x4')]=_0x4d6c97[_0x2203('0x4')]||[];this[_0x2203('0x5')]=_0x4d6c97[_0x2203('0x5')]||[];this[_0x2203('0x6')]=_0x4d6c97[_0x2203('0x6')]||[];}module[_0x2203('0x7')]=Trigger;
\ No newline at end of file
+var _0xbaf0=['Actions','exports','name','channel','voice','status','AllConditions','AnyConditions'];(function(_0x158a58,_0x28e8e7){var _0x4935d9=function(_0x1e698c){while(--_0x1e698c){_0x158a58['push'](_0x158a58['shift']());}};_0x4935d9(++_0x28e8e7);}(_0xbaf0,0x12a));var _0x0baf=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xbaf0[_0x2f5ac5];return _0x37c9a8;};'use strict';function Trigger(_0x61caa9){this['id']=_0x61caa9['id']||0x0;this[_0x0baf('0x0')]=_0x61caa9[_0x0baf('0x0')]||'';this[_0x0baf('0x1')]=_0x61caa9[_0x0baf('0x1')]||_0x0baf('0x2');this[_0x0baf('0x3')]=_0x61caa9['status']||![];this[_0x0baf('0x4')]=_0x61caa9[_0x0baf('0x4')]||[];this[_0x0baf('0x5')]=_0x61caa9[_0x0baf('0x5')]||[];this[_0x0baf('0x6')]=_0x61caa9[_0x0baf('0x6')]||[];}module[_0x0baf('0x7')]=Trigger;
\ No newline at end of file
index 7be147a..9070bf2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb60e=['name','unknown','registry','indexOf','split','host','port','domain','stateRegistry','address','exports'];(function(_0x5340c0,_0x51e8be){var _0x501707=function(_0x1d247a){while(--_0x1d247a){_0x5340c0['push'](_0x5340c0['shift']());}};_0x501707(++_0x51e8be);}(_0xb60e,0x176));var _0xeb60=function(_0x13fd59,_0x2e05b1){_0x13fd59=_0x13fd59-0x0;var _0x2e6ce7=_0xb60e[_0x13fd59];return _0x2e6ce7;};'use strict';function Trunk(_0x3d544a){this['id']=_0x3d544a['id']||0x0;this['active']=_0x3d544a['active']||![];this[_0xeb60('0x0')]=_0x3d544a[_0xeb60('0x0')]||'';this['state']=_0xeb60('0x1');this['stateTime']=0x0;this['status']=_0xeb60('0x1');this[_0xeb60('0x2')]=_0x3d544a[_0xeb60('0x2')]&&_0x3d544a[_0xeb60('0x2')][_0xeb60('0x3')](':')?_0x3d544a[_0xeb60('0x2')][_0xeb60('0x4')](':')[0x0]:'';this[_0xeb60('0x5')]='';this[_0xeb60('0x6')]='';this[_0xeb60('0x7')]='';this['domainport']='';this['refresh']='';this[_0xeb60('0x8')]=_0xeb60('0x1');this['registrationtime']='';this[_0xeb60('0x9')]='';this['defaultuser']=_0x3d544a['defaultuser']||'';}module[_0xeb60('0xa')]=Trunk;
\ No newline at end of file
+var _0x9c8b=['domain','domainport','stateRegistry','defaultuser','exports','active','name','state','unknown','stateTime','status','registry','split','host','port'];(function(_0x2aabcd,_0x4c2a05){var _0x2eb03b=function(_0x117e28){while(--_0x117e28){_0x2aabcd['push'](_0x2aabcd['shift']());}};_0x2eb03b(++_0x4c2a05);}(_0x9c8b,0x113));var _0xb9c8=function(_0x43af6f,_0x3af2f3){_0x43af6f=_0x43af6f-0x0;var _0x263537=_0x9c8b[_0x43af6f];return _0x263537;};'use strict';function Trunk(_0x4447c){this['id']=_0x4447c['id']||0x0;this['active']=_0x4447c[_0xb9c8('0x0')]||![];this[_0xb9c8('0x1')]=_0x4447c['name']||'';this[_0xb9c8('0x2')]=_0xb9c8('0x3');this[_0xb9c8('0x4')]=0x0;this[_0xb9c8('0x5')]=_0xb9c8('0x3');this[_0xb9c8('0x6')]=_0x4447c['registry']&&_0x4447c[_0xb9c8('0x6')]['indexOf'](':')?_0x4447c['registry'][_0xb9c8('0x7')](':')[0x0]:'';this[_0xb9c8('0x8')]='';this[_0xb9c8('0x9')]='';this[_0xb9c8('0xa')]='';this[_0xb9c8('0xb')]='';this['refresh']='';this[_0xb9c8('0xc')]=_0xb9c8('0x3');this['registrationtime']='';this['address']='';this[_0xb9c8('0xd')]=_0x4447c[_0xb9c8('0xd')]||'';}module[_0xb9c8('0xe')]=Trunk;
\ No newline at end of file
index a604ec8..0ef34c7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc2c2=['exports','exten','recordingFormat','mandatoryDisposition'];(function(_0x390c56,_0x4ae5d5){var _0x17b44a=function(_0x1ad5f9){while(--_0x1ad5f9){_0x390c56['push'](_0x390c56['shift']());}};_0x17b44a(++_0x4ae5d5);}(_0xc2c2,0x165));var _0x2c2c=function(_0x10e841,_0x1c2b81){_0x10e841=_0x10e841-0x0;var _0x4f779f=_0xc2c2[_0x10e841];return _0x4f779f;};'use strict';function voiceExtension(_0x5f4324){this['id']=_0x5f4324['id']||0x0;this['exten']=_0x5f4324[_0x2c2c('0x0')]||'';this[_0x2c2c('0x1')]=_0x5f4324[_0x2c2c('0x1')]||'none';this['mandatoryDisposition']=_0x5f4324[_0x2c2c('0x2')]||![];}module[_0x2c2c('0x3')]=voiceExtension;
\ No newline at end of file
+var _0x7e42=['mandatoryDisposition','exports','exten','recordingFormat'];(function(_0x47799a,_0x2d0a9d){var _0x5d25f2=function(_0x8fab94){while(--_0x8fab94){_0x47799a['push'](_0x47799a['shift']());}};_0x5d25f2(++_0x2d0a9d);}(_0x7e42,0xee));var _0x27e4=function(_0x264b9d,_0x276056){_0x264b9d=_0x264b9d-0x0;var _0x149b91=_0x7e42[_0x264b9d];return _0x149b91;};'use strict';function voiceExtension(_0x40b3b0){this['id']=_0x40b3b0['id']||0x0;this[_0x27e4('0x0')]=_0x40b3b0[_0x27e4('0x0')]||'';this['recordingFormat']=_0x40b3b0[_0x27e4('0x1')]||'none';this[_0x27e4('0x2')]=_0x40b3b0[_0x27e4('0x2')]||![];}module[_0x27e4('0x3')]=voiceExtension;
\ No newline at end of file
index 0b3dce4..90e466d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe945=['gsm','rrmemory','name','monitor_format','type','inbound','waiting','talking','total','answered','sumDuration','sumHoldTime','sumBillable','unmanaged','abandoned','available','acw','acwTimeout','autopause','sendMessageOneNotActive','message','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundNoAnswerCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundAbandonedDay','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','unknown','inuse','invalid','ringing','ringinuse','wav','wav49'];(function(_0x3942e4,_0x3497c5){var _0x3a81ab=function(_0x5efc0b){while(--_0x5efc0b){_0x3942e4['push'](_0x3942e4['shift']());}};_0x3a81ab(++_0x3497c5);}(_0xe945,0x15b));var _0x5e94=function(_0x5e1047,_0xdcae75){_0x5e1047=_0x5e1047-0x0;var _0x5e217e=_0xe945[_0x5e1047];return _0x5e217e;};'use strict';var statusDesc=[_0x5e94('0x0'),'not_inuse',_0x5e94('0x1'),'busy',_0x5e94('0x2'),'unavailable',_0x5e94('0x3'),_0x5e94('0x4'),'onhold'];var monitorFormat={'wav':_0x5e94('0x5'),'wav49':_0x5e94('0x6'),'gsm':_0x5e94('0x7')};var strategy={'rrmemory':_0x5e94('0x8'),'roundrobin':'roundrobin'};function VoiceQueue(_0x3558d9){this['id']=_0x3558d9['id']||0x0;this[_0x5e94('0x9')]=_0x3558d9['name']||'';this['monitor_format']=_0x3558d9[_0x5e94('0xa')]||'';this[_0x5e94('0xb')]=_0x3558d9[_0x5e94('0xb')]||_0x5e94('0xc');this[_0x5e94('0xd')]=0x0;this[_0x5e94('0xe')]=0x0;this[_0x5e94('0xf')]=0x0;this[_0x5e94('0x10')]=0x0;this[_0x5e94('0x11')]=0x0;this[_0x5e94('0x12')]=0x0;this[_0x5e94('0x13')]=0x0;this[_0x5e94('0x14')]=0x0;this[_0x5e94('0x15')]=0x0;this['loggedIn']=0x0;this[_0x5e94('0x16')]=0x0;this[_0x5e94('0x17')]=_0x3558d9[_0x5e94('0x17')]||![];this[_0x5e94('0x18')]=_0x3558d9['acwTimeout']||0xa;this[_0x5e94('0x19')]=_0x3558d9['autopause']||'no';this[_0x5e94('0x1a')]=!![];this[_0x5e94('0x1b')]='';this[_0x5e94('0x1c')]=0x0;this[_0x5e94('0x1d')]=0x0;this[_0x5e94('0x1e')]=_0x3558d9[_0x5e94('0x1e')]||null;this[_0x5e94('0x1f')]=_0x3558d9[_0x5e94('0x1f')]?_0x3558d9[_0x5e94('0x1f')]:null;this['dialActive']=_0x3558d9[_0x5e94('0x20')];this[_0x5e94('0x21')]=_0x3558d9[_0x5e94('0x21')]||'progressive';this['dialLimitChannel']=_0x3558d9['dialLimitChannel']||0x0;this['dialLimitQueue']=_0x3558d9[_0x5e94('0x22')]||0x0;this[_0x5e94('0x23')]=_0x3558d9['dialPowerLevel']||0x1;this[_0x5e94('0x24')]=_0x3558d9[_0x5e94('0x24')]||_0x5e94('0x25');this[_0x5e94('0x26')]=_0x3558d9[_0x5e94('0x26')]||0.03;this[_0x5e94('0x27')]=_0x3558d9[_0x5e94('0x27')]||0x258;this[_0x5e94('0x28')]=_0x3558d9['dialOriginateCallerIdName']||_0x5e94('0x29');this['dialOriginateCallerIdNumber']=_0x3558d9[_0x5e94('0x2a')]||_0x5e94('0x29');this['dialOriginateTimeout']=_0x3558d9[_0x5e94('0x2b')]||0x1e;this[_0x5e94('0x2c')]=_0x3558d9[_0x5e94('0x2c')]||'tTxX';this['dialQueueTimeout']=_0x3558d9['dialQueueTimeout']||0x3;this[_0x5e94('0x2d')]=_0x3558d9['dialQueueProject']||undefined;this['dialCongestionMaxRetry']=_0x3558d9[_0x5e94('0x2e')]||0x3;this[_0x5e94('0x2f')]=_0x3558d9['dialCongestionRetryFrequency']||0x96;this[_0x5e94('0x30')]=_0x3558d9[_0x5e94('0x30')]||0x3;this[_0x5e94('0x31')]=_0x3558d9[_0x5e94('0x31')]||0x96;this[_0x5e94('0x32')]=_0x3558d9[_0x5e94('0x32')]||0x3;this['dialNoAnswerRetryFrequency']=_0x3558d9[_0x5e94('0x33')]||0x96;this['dialNoSuchNumberMaxRetry']=_0x3558d9[_0x5e94('0x34')]||0x3;this['dialNoSuchNumberRetryFrequency']=_0x3558d9[_0x5e94('0x35')]||0x96;this[_0x5e94('0x36')]=_0x3558d9[_0x5e94('0x36')]||0x3;this[_0x5e94('0x37')]=_0x3558d9[_0x5e94('0x37')]||0x96;this[_0x5e94('0x38')]=_0x3558d9[_0x5e94('0x38')]||0x3;this[_0x5e94('0x39')]=_0x3558d9['dialAbandonedRetryFrequency']||0x96;this[_0x5e94('0x3a')]=_0x3558d9[_0x5e94('0x3a')]||0x3;this[_0x5e94('0x3b')]=_0x3558d9['dialMachineRetryFrequency']||0x96;this[_0x5e94('0x3c')]=_0x3558d9[_0x5e94('0x3c')]||0x3;this[_0x5e94('0x3d')]=_0x3558d9[_0x5e94('0x3d')]||0x96;this['callAdditionalPhoneAfterMin']=_0x3558d9[_0x5e94('0x3e')]||0x3;this[_0x5e94('0x3f')]=_0x3558d9['dialGlobalMaxRetry']||0x4;this['Trunk']=_0x3558d9[_0x5e94('0x40')]?_0x3558d9[_0x5e94('0x40')]:undefined;this[_0x5e94('0x41')]=_0x3558d9['TrunkBackup']?_0x3558d9[_0x5e94('0x41')]:undefined;this['dialPrefix']=_0x3558d9[_0x5e94('0x42')]||undefined;this[_0x5e94('0x43')]=_0x3558d9[_0x5e94('0x43')]?_0x3558d9[_0x5e94('0x43')]:undefined;this['dialOrderByScheduledAt']=_0x3558d9['dialOrderByScheduledAt']||_0x5e94('0x44');this['dialRandomLastDigitCallerIdNumber']=_0x3558d9[_0x5e94('0x45')]||undefined;this['dialCutDigit']=_0x3558d9[_0x5e94('0x46')]||undefined;this[_0x5e94('0x47')]=strategy[_0x3558d9[_0x5e94('0x47')]]||_0x5e94('0x8');this[_0x5e94('0x48')]=!![];this[_0x5e94('0x49')]=_0x3558d9[_0x5e94('0x49')]||![];this[_0x5e94('0x4a')]=_0x3558d9[_0x5e94('0x4a')];this['dialAMDGreeting']=_0x3558d9[_0x5e94('0x4b')];this[_0x5e94('0x4c')]=_0x3558d9[_0x5e94('0x4c')];this[_0x5e94('0x4d')]=_0x3558d9[_0x5e94('0x4d')];this[_0x5e94('0x4e')]=_0x3558d9[_0x5e94('0x4e')];this[_0x5e94('0x4f')]=_0x3558d9['dialAMDBetweenWordsSilence'];this[_0x5e94('0x50')]=_0x3558d9[_0x5e94('0x50')];this[_0x5e94('0x51')]=_0x3558d9[_0x5e94('0x51')];this['dialAMDMaximumWordLength']=_0x3558d9[_0x5e94('0x52')];this[_0x5e94('0x53')]=0x0;this[_0x5e94('0x54')]=0x0;this[_0x5e94('0x55')]=_0x3558d9[_0x5e94('0x55')];this['outboundAnswerCallsDay']=0x0;this['outboundAnswerAgiCallsDay']=0x0;this[_0x5e94('0x56')]=0x0;this['outboundBusyCallsDay']=0x0;this['outboundCongestionCallsDay']=0x0;this['outboundNoSuchCallsDay']=0x0;this[_0x5e94('0x57')]=0x0;this[_0x5e94('0x58')]=0x0;this[_0x5e94('0x59')]=0x0;this['outboundDropCallsDayCallersExit']=0x0;this[_0x5e94('0x5a')]=0x0;this[_0x5e94('0x5b')]=0x0;this['outboundReCallsDay']=0x0;this[_0x5e94('0x5c')]=0x0;this['startProgressive']=undefined;this['startPredictive']=undefined;this[_0x5e94('0x5d')]=undefined;this[_0x5e94('0x5e')]=1.05;this[_0x5e94('0x5f')]=0x0;this['predictiveIntervalAnsweredCalls']=0x0;this[_0x5e94('0x60')]=0x0;this[_0x5e94('0x61')]=0x0;this[_0x5e94('0x62')]=0x0;this[_0x5e94('0x63')]=0x0;this[_0x5e94('0x64')]=0x0;this[_0x5e94('0x65')]=0x0;this[_0x5e94('0x66')]=_0x3558d9[_0x5e94('0x67')]||0x14;this[_0x5e94('0x68')]=_0x3558d9[_0x5e94('0x67')]||0xa;this[_0x5e94('0x69')]=0x0;this[_0x5e94('0x6a')]=0x0;this['predictiveIntervalHitRate']=0x1;this['erlangCalls']=0x0;this['erlangCallToSecond']=0x0;this[_0x5e94('0x6b')]=0x0;this[_0x5e94('0x6c')]=0x0;this[_0x5e94('0x6d')]=_0x3558d9[_0x5e94('0x6d')]||0x1e;this[_0x5e94('0x6e')]=_0x3558d9[_0x5e94('0x6e')]||![];this[_0x5e94('0x6f')]=!!_0x3558d9['dialPreviewAutoRecallMe']||![];this[_0x5e94('0x70')]=!!_0x3558d9['dialPreviewRecallmeReminder']||![];this[_0x5e94('0x71')]=_0x3558d9[_0x5e94('0x71')]||undefined;this[_0x5e94('0x72')]=_0x3558d9['dialAgiAfterHangupClient']||![];this[_0x5e94('0x73')]=_0x3558d9[_0x5e94('0x73')]||![];this[_0x5e94('0xa')]=monitorFormat[_0x3558d9[_0x5e94('0xa')]]?monitorFormat[_0x3558d9[_0x5e94('0xa')]]:undefined;this[_0x5e94('0x74')]=_0x3558d9[_0x5e94('0x74')]||![];this[_0x5e94('0x75')]=_0x3558d9[_0x5e94('0x75')]?_0x3558d9[_0x5e94('0x75')]:undefined;}module['exports']=VoiceQueue;
\ No newline at end of file
+var _0x60a7=['dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundNoAnswerCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundBlacklistCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startProgressive','startPredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','unknown','not_inuse','inuse','busy','invalid','unavailable','ringing','ringinuse','onhold','wav49','gsm','rrmemory','name','monitor_format','type','waiting','talking','total','answered','sumDuration','sumHoldTime','sumBillable','unmanaged','abandoned','acw','acwTimeout','sendMessageOneNotActive','message','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','anonymous','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerRetryFrequency','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','dialAMDActive','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords'];(function(_0x1c546c,_0x5c57cb){var _0x2cc384=function(_0x4dee11){while(--_0x4dee11){_0x1c546c['push'](_0x1c546c['shift']());}};_0x2cc384(++_0x5c57cb);}(_0x60a7,0x115));var _0x760a=function(_0x3a370b,_0x52a6a9){_0x3a370b=_0x3a370b-0x0;var _0x2ae6a3=_0x60a7[_0x3a370b];return _0x2ae6a3;};'use strict';var statusDesc=[_0x760a('0x0'),_0x760a('0x1'),_0x760a('0x2'),_0x760a('0x3'),_0x760a('0x4'),_0x760a('0x5'),_0x760a('0x6'),_0x760a('0x7'),_0x760a('0x8')];var monitorFormat={'wav':'wav','wav49':_0x760a('0x9'),'gsm':_0x760a('0xa')};var strategy={'rrmemory':_0x760a('0xb'),'roundrobin':'roundrobin'};function VoiceQueue(_0xdb8c32){this['id']=_0xdb8c32['id']||0x0;this[_0x760a('0xc')]=_0xdb8c32[_0x760a('0xc')]||'';this[_0x760a('0xd')]=_0xdb8c32[_0x760a('0xd')]||'';this['type']=_0xdb8c32[_0x760a('0xe')]||'inbound';this[_0x760a('0xf')]=0x0;this[_0x760a('0x10')]=0x0;this[_0x760a('0x11')]=0x0;this[_0x760a('0x12')]=0x0;this[_0x760a('0x13')]=0x0;this[_0x760a('0x14')]=0x0;this[_0x760a('0x15')]=0x0;this[_0x760a('0x16')]=0x0;this[_0x760a('0x17')]=0x0;this['loggedIn']=0x0;this['available']=0x0;this['acw']=_0xdb8c32[_0x760a('0x18')]||![];this['acwTimeout']=_0xdb8c32[_0x760a('0x19')]||0xa;this['autopause']=_0xdb8c32['autopause']||'no';this[_0x760a('0x1a')]=!![];this[_0x760a('0x1b')]='';this[_0x760a('0x1c')]=0x0;this[_0x760a('0x1d')]=0x0;this[_0x760a('0x1e')]=_0xdb8c32[_0x760a('0x1e')]||null;this[_0x760a('0x1f')]=_0xdb8c32['dialGlobalInterval']?_0xdb8c32['dialGlobalInterval']:null;this[_0x760a('0x20')]=_0xdb8c32['dialActive'];this[_0x760a('0x21')]=_0xdb8c32[_0x760a('0x21')]||_0x760a('0x22');this[_0x760a('0x23')]=_0xdb8c32[_0x760a('0x23')]||0x0;this[_0x760a('0x24')]=_0xdb8c32[_0x760a('0x24')]||0x0;this['dialPowerLevel']=_0xdb8c32['dialPowerLevel']||0x1;this['dialPredictiveOptimization']=_0xdb8c32['dialPredictiveOptimization']||_0x760a('0x25');this[_0x760a('0x26')]=_0xdb8c32[_0x760a('0x26')]||0.03;this[_0x760a('0x27')]=_0xdb8c32[_0x760a('0x27')]||0x258;this[_0x760a('0x28')]=_0xdb8c32[_0x760a('0x28')]||'anonymous';this[_0x760a('0x29')]=_0xdb8c32['dialOriginateCallerIdNumber']||_0x760a('0x2a');this[_0x760a('0x2b')]=_0xdb8c32[_0x760a('0x2b')]||0x1e;this[_0x760a('0x2c')]=_0xdb8c32[_0x760a('0x2c')]||_0x760a('0x2d');this['dialQueueTimeout']=_0xdb8c32[_0x760a('0x2e')]||0x3;this[_0x760a('0x2f')]=_0xdb8c32['dialQueueProject']||undefined;this[_0x760a('0x30')]=_0xdb8c32[_0x760a('0x30')]||0x3;this[_0x760a('0x31')]=_0xdb8c32[_0x760a('0x31')]||0x96;this[_0x760a('0x32')]=_0xdb8c32[_0x760a('0x32')]||0x3;this[_0x760a('0x33')]=_0xdb8c32[_0x760a('0x33')]||0x96;this['dialNoAnswerMaxRetry']=_0xdb8c32['dialNoAnswerMaxRetry']||0x3;this[_0x760a('0x34')]=_0xdb8c32[_0x760a('0x34')]||0x96;this['dialNoSuchNumberMaxRetry']=_0xdb8c32['dialNoSuchNumberMaxRetry']||0x3;this[_0x760a('0x35')]=_0xdb8c32[_0x760a('0x35')]||0x96;this[_0x760a('0x36')]=_0xdb8c32['dialDropMaxRetry']||0x3;this[_0x760a('0x37')]=_0xdb8c32[_0x760a('0x37')]||0x96;this[_0x760a('0x38')]=_0xdb8c32[_0x760a('0x38')]||0x3;this['dialAbandonedRetryFrequency']=_0xdb8c32['dialAbandonedRetryFrequency']||0x96;this['dialMachineMaxRetry']=_0xdb8c32['dialMachineMaxRetry']||0x3;this[_0x760a('0x39')]=_0xdb8c32[_0x760a('0x39')]||0x96;this['dialAgentRejectMaxRetry']=_0xdb8c32[_0x760a('0x3a')]||0x3;this[_0x760a('0x3b')]=_0xdb8c32[_0x760a('0x3b')]||0x96;this[_0x760a('0x3c')]=_0xdb8c32[_0x760a('0x3c')]||0x3;this[_0x760a('0x3d')]=_0xdb8c32[_0x760a('0x3d')]||0x4;this[_0x760a('0x3e')]=_0xdb8c32[_0x760a('0x3e')]?_0xdb8c32['Trunk']:undefined;this[_0x760a('0x3f')]=_0xdb8c32[_0x760a('0x3f')]?_0xdb8c32[_0x760a('0x3f')]:undefined;this['dialPrefix']=_0xdb8c32[_0x760a('0x40')]||undefined;this['Interval']=_0xdb8c32[_0x760a('0x41')]?_0xdb8c32['Interval']:undefined;this[_0x760a('0x42')]=_0xdb8c32[_0x760a('0x42')]||_0x760a('0x43');this[_0x760a('0x44')]=_0xdb8c32[_0x760a('0x44')]||undefined;this['dialCutDigit']=_0xdb8c32[_0x760a('0x45')]||undefined;this['strategy']=strategy[_0xdb8c32[_0x760a('0x46')]]||_0x760a('0xb');this['queueStatusComplete']=!![];this[_0x760a('0x47')]=_0xdb8c32[_0x760a('0x47')]||![];this['dialAMDInitialSilence']=_0xdb8c32['dialAMDInitialSilence'];this['dialAMDGreeting']=_0xdb8c32['dialAMDGreeting'];this[_0x760a('0x48')]=_0xdb8c32[_0x760a('0x48')];this['dialAMDTotalAnalysisTime']=_0xdb8c32[_0x760a('0x49')];this[_0x760a('0x4a')]=_0xdb8c32['dialAMDMinWordLength'];this[_0x760a('0x4b')]=_0xdb8c32['dialAMDBetweenWordsSilence'];this['dialAMDMaximumNumberOfWords']=_0xdb8c32[_0x760a('0x4c')];this['dialAMDSilenceThreshold']=_0xdb8c32[_0x760a('0x4d')];this['dialAMDMaximumWordLength']=_0xdb8c32[_0x760a('0x4e')];this[_0x760a('0x4f')]=0x0;this[_0x760a('0x50')]=0x0;this['timeout']=_0xdb8c32[_0x760a('0x51')];this['outboundAnswerCallsDay']=0x0;this['outboundAnswerAgiCallsDay']=0x0;this[_0x760a('0x52')]=0x0;this['outboundBusyCallsDay']=0x0;this[_0x760a('0x53')]=0x0;this[_0x760a('0x54')]=0x0;this['outboundUnknownCallsDay']=0x0;this[_0x760a('0x55')]=0x0;this['outboundOriginateFailureCallsDay']=0x0;this[_0x760a('0x56')]=0x0;this[_0x760a('0x57')]=0x0;this[_0x760a('0x58')]=0x0;this[_0x760a('0x59')]=0x0;this[_0x760a('0x5a')]=0x0;this[_0x760a('0x5b')]=undefined;this[_0x760a('0x5c')]=undefined;this['handlePredictive']=undefined;this[_0x760a('0x5d')]=1.05;this['predictiveIntervalTotalCalls']=0x0;this[_0x760a('0x5e')]=0x0;this[_0x760a('0x5f')]=0x0;this[_0x760a('0x60')]=0x0;this[_0x760a('0x61')]=0x0;this[_0x760a('0x62')]=0x0;this[_0x760a('0x63')]=0x0;this[_0x760a('0x64')]=0x0;this[_0x760a('0x65')]=_0xdb8c32[_0x760a('0x66')]||0x14;this[_0x760a('0x67')]=_0xdb8c32[_0x760a('0x66')]||0xa;this[_0x760a('0x68')]=0x0;this[_0x760a('0x69')]=0x0;this[_0x760a('0x6a')]=0x1;this['erlangCalls']=0x0;this['erlangCallToSecond']=0x0;this['erlangAbandonmentRate']=0x0;this[_0x760a('0x6b')]=0x0;this[_0x760a('0x6c')]=_0xdb8c32[_0x760a('0x6c')]||0x1e;this[_0x760a('0x6d')]=_0xdb8c32[_0x760a('0x6d')]||![];this[_0x760a('0x6e')]=!!_0xdb8c32[_0x760a('0x6e')]||![];this[_0x760a('0x6f')]=!!_0xdb8c32[_0x760a('0x6f')]||![];this[_0x760a('0x70')]=_0xdb8c32[_0x760a('0x70')]||undefined;this[_0x760a('0x71')]=_0xdb8c32['dialAgiAfterHangupClient']||![];this[_0x760a('0x72')]=_0xdb8c32[_0x760a('0x72')]||![];this['monitor_format']=monitorFormat[_0xdb8c32['monitor_format']]?monitorFormat[_0xdb8c32[_0x760a('0xd')]]:undefined;this['mandatoryDisposition']=_0xdb8c32[_0x760a('0x73')]||![];this[_0x760a('0x74')]=_0xdb8c32[_0x760a('0x74')]?_0xdb8c32['mandatoryDispositionPause']:undefined;}module[_0x760a('0x75')]=VoiceQueue;
\ No newline at end of file
index 674071a..1cf78bc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf1f3=['accessKey','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x43ac9a,_0xc05f63){var _0x30b7fe=function(_0x1e9df9){while(--_0x1e9df9){_0x43ac9a['push'](_0x43ac9a['shift']());}};_0x30b7fe(++_0xc05f63);}(_0xf1f3,0x155));var _0x3f1f=function(_0x51b32c,_0x33907a){_0x51b32c=_0x51b32c-0x0;var _0x22c6ea=_0xf1f3[_0x51b32c];return _0x22c6ea;};'use strict';function VtigerAccount(_0x475256){this['id']=_0x475256['id']||0x0;this['name']=_0x475256[_0x3f1f('0x0')]||'';this[_0x3f1f('0x1')]=_0x475256[_0x3f1f('0x1')]||'';this[_0x3f1f('0x2')]=_0x475256[_0x3f1f('0x2')]||'';this[_0x3f1f('0x3')]=_0x475256[_0x3f1f('0x3')]||'';this[_0x3f1f('0x4')]=_0x475256['serverUrl']||'';this['Configurations']=_0x475256[_0x3f1f('0x5')]||{};}module[_0x3f1f('0x6')]=VtigerAccount;
\ No newline at end of file
+var _0xc349=['accessKey','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x234660,_0x4b44fa){var _0x1929de=function(_0x279874){while(--_0x279874){_0x234660['push'](_0x234660['shift']());}};_0x1929de(++_0x4b44fa);}(_0xc349,0x14e));var _0x9c34=function(_0x2b63e1,_0xa6a299){_0x2b63e1=_0x2b63e1-0x0;var _0x130738=_0xc349[_0x2b63e1];return _0x130738;};'use strict';function VtigerAccount(_0x19ebd6){this['id']=_0x19ebd6['id']||0x0;this[_0x9c34('0x0')]=_0x19ebd6[_0x9c34('0x0')]||'';this['username']=_0x19ebd6[_0x9c34('0x1')]||'';this[_0x9c34('0x2')]=_0x19ebd6[_0x9c34('0x2')]||'';this['remoteUri']=_0x19ebd6[_0x9c34('0x3')]||'';this['serverUrl']=_0x19ebd6[_0x9c34('0x4')]||'';this[_0x9c34('0x5')]=_0x19ebd6[_0x9c34('0x5')]||{};}module[_0x9c34('0x6')]=VtigerAccount;
\ No newline at end of file
index 3a6b414..896572d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x799d=['type','serverUrl','Configurations','exports','name','username','token','remoteUri','authType'];(function(_0x521786,_0x51c6a4){var _0x276349=function(_0xfa4956){while(--_0xfa4956){_0x521786['push'](_0x521786['shift']());}};_0x276349(++_0x51c6a4);}(_0x799d,0x1a2));var _0xd799=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0x799d[_0x2be8c2];return _0x97f531;};'use strict';function ZendeskAccount(_0x256ea1){this['id']=_0x256ea1['id']||0x0;this['name']=_0x256ea1[_0xd799('0x0')]||'';this[_0xd799('0x1')]=_0x256ea1[_0xd799('0x1')]||'';this['password']=_0x256ea1['password']||'';this[_0xd799('0x2')]=_0x256ea1[_0xd799('0x2')]||'';this[_0xd799('0x3')]=_0x256ea1['remoteUri']||'';this[_0xd799('0x4')]=_0x256ea1[_0xd799('0x4')]||'';this[_0xd799('0x5')]=_0x256ea1[_0xd799('0x5')]||'integrationTab';this[_0xd799('0x6')]=_0x256ea1['serverUrl']||'';this['Configurations']=_0x256ea1[_0xd799('0x7')]||{};}module[_0xd799('0x8')]=ZendeskAccount;
\ No newline at end of file
+var _0xdd4f=['type','integrationTab','serverUrl','Configurations','exports','name','username','password','token','remoteUri','authType'];(function(_0x6576cc,_0x261556){var _0x1a5069=function(_0x2870ac){while(--_0x2870ac){_0x6576cc['push'](_0x6576cc['shift']());}};_0x1a5069(++_0x261556);}(_0xdd4f,0x144));var _0xfdd4=function(_0x40aec9,_0x43ab43){_0x40aec9=_0x40aec9-0x0;var _0x37f182=_0xdd4f[_0x40aec9];return _0x37f182;};'use strict';function ZendeskAccount(_0x475278){this['id']=_0x475278['id']||0x0;this[_0xfdd4('0x0')]=_0x475278['name']||'';this[_0xfdd4('0x1')]=_0x475278[_0xfdd4('0x1')]||'';this[_0xfdd4('0x2')]=_0x475278[_0xfdd4('0x2')]||'';this[_0xfdd4('0x3')]=_0x475278['token']||'';this['remoteUri']=_0x475278[_0xfdd4('0x4')]||'';this[_0xfdd4('0x5')]=_0x475278[_0xfdd4('0x5')]||'';this[_0xfdd4('0x6')]=_0x475278[_0xfdd4('0x6')]||_0xfdd4('0x7');this['serverUrl']=_0x475278[_0xfdd4('0x8')]||'';this['Configurations']=_0x475278[_0xfdd4('0x9')]||{};}module[_0xfdd4('0xa')]=ZendeskAccount;
\ No newline at end of file
index 21ac7fe..de8874c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2a5f=['serverUrl','code','Configurations','exports','description','host','zone','clientId','clientSecret'];(function(_0x3d6ce0,_0x2d61ba){var _0x476b99=function(_0x38aa34){while(--_0x38aa34){_0x3d6ce0['push'](_0x3d6ce0['shift']());}};_0x476b99(++_0x2d61ba);}(_0x2a5f,0xd3));var _0xf2a5=function(_0x421725,_0x318a04){_0x421725=_0x421725-0x0;var _0x51b322=_0x2a5f[_0x421725];return _0x51b322;};'use strict';function ZohoAccount(_0x18f783){this['id']=_0x18f783['id']||0x0;this['name']=_0x18f783['name']||'';this[_0xf2a5('0x0')]=_0x18f783['description']||'';this[_0xf2a5('0x1')]=_0x18f783[_0xf2a5('0x1')]||'';this[_0xf2a5('0x2')]=_0x18f783[_0xf2a5('0x2')]||'';this['clientId']=_0x18f783[_0xf2a5('0x3')]||'';this[_0xf2a5('0x4')]=_0x18f783[_0xf2a5('0x4')]||'';this[_0xf2a5('0x5')]=_0x18f783[_0xf2a5('0x5')]||'';this[_0xf2a5('0x6')]=_0x18f783['code']||'';this['refreshToken']=_0x18f783['refreshToken']||'';this[_0xf2a5('0x7')]=_0x18f783[_0xf2a5('0x7')]||{};}module[_0xf2a5('0x8')]=ZohoAccount;
\ No newline at end of file
+var _0xba1f=['name','description','host','zone','clientId','clientSecret','serverUrl','code','refreshToken','Configurations'];(function(_0x5f309e,_0x66e31){var _0x487b5e=function(_0x44f203){while(--_0x44f203){_0x5f309e['push'](_0x5f309e['shift']());}};_0x487b5e(++_0x66e31);}(_0xba1f,0xe6));var _0xfba1=function(_0xbfacc,_0x205ba2){_0xbfacc=_0xbfacc-0x0;var _0x2f7e3f=_0xba1f[_0xbfacc];return _0x2f7e3f;};'use strict';function ZohoAccount(_0x760895){this['id']=_0x760895['id']||0x0;this[_0xfba1('0x0')]=_0x760895['name']||'';this[_0xfba1('0x1')]=_0x760895[_0xfba1('0x1')]||'';this[_0xfba1('0x2')]=_0x760895[_0xfba1('0x2')]||'';this[_0xfba1('0x3')]=_0x760895[_0xfba1('0x3')]||'';this[_0xfba1('0x4')]=_0x760895[_0xfba1('0x4')]||'';this[_0xfba1('0x5')]=_0x760895[_0xfba1('0x5')]||'';this[_0xfba1('0x6')]=_0x760895[_0xfba1('0x6')]||'';this['code']=_0x760895[_0xfba1('0x7')]||'';this[_0xfba1('0x8')]=_0x760895[_0xfba1('0x8')]||'';this['Configurations']=_0x760895[_0xfba1('0x9')]||{};}module['exports']=ZohoAccount;
\ No newline at end of file
index 70f2214..8c0480a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x065e=['callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','\x22%s\x22\x20<%s>','calleridname','number','util','isNil','string','uniqueid','queue','name','type','campaigntype','dialAnswer','membername','Agent','format','SIP/%s','Contact','phone','firstName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countabandonedretry','countagentrejectretry'];(function(_0x4c5476,_0x5d183b){var _0xa85797=function(_0x9bfe01){while(--_0x9bfe01){_0x4c5476['push'](_0x4c5476['shift']());}};_0xa85797(++_0x5d183b);}(_0x065e,0x1a7));var _0xe065=function(_0x3a51ae,_0x4f6f48){_0x3a51ae=_0x3a51ae-0x0;var _0x3230ed=_0x065e[_0x3a51ae];return _0x3230ed;};'use strict';var util=require(_0xe065('0x0'));var _=require('lodash');var moment=require('moment');function checkNameSurname(_0x59293c,_0x1c0754,_0x240146){var _0x163f28='';if(!_['isNil'](_0x1c0754)&&'string'===typeof _0x1c0754){_0x163f28+=_0x1c0754;}if(!_[_0xe065('0x1')](_0x240146)&&_0xe065('0x2')===typeof _0x240146){_0x163f28+='\x20'+_0x240146;}if(_0x163f28!==''){return _0x163f28;}return _0x59293c;}function Action(_0x5b099e,_0x10b45f,_0x1e7e69,_0x189d72,_0x52403a){this[_0xe065('0x3')]=_0x1e7e69||undefined;this['idContact']=_0x5b099e['id'];this[_0xe065('0x4')]=_0x10b45f[_0xe065('0x5')];this[_0xe065('0x6')]=_0x10b45f[_0xe065('0x6')];this[_0xe065('0x7')]='queue';this[_0xe065('0x8')]=![];this[_0xe065('0x9')]=_[_0xe065('0x1')](_0x5b099e[_0xe065('0xa')])?undefined:_0x5b099e[_0xe065('0xa')][_0xe065('0x5')];this['channelAgent']=this['membername']?util[_0xe065('0xb')](_0xe065('0xc'),this[_0xe065('0x9')]):_0x189d72||undefined;this['calleridname']=checkNameSurname(_0x5b099e[_0xe065('0xd')][_0xe065('0xe')],_0x5b099e[_0xe065('0xd')][_0xe065('0xf')],_0x5b099e[_0xe065('0xd')]['lastName']);this[_0xe065('0x10')]=_0x5b099e[_0xe065('0x10')]||![];this[_0xe065('0x11')]=_0x5b099e[_0xe065('0xe')];this[_0xe065('0x12')]=_0x5b099e[_0xe065('0x12')];this[_0xe065('0x13')]=_0x5b099e['countbusyretry']||0x0;this[_0xe065('0x14')]=_0x5b099e[_0xe065('0x14')]||0x0;this['countnoanswerretry']=_0x5b099e[_0xe065('0x15')]||0x0;this[_0xe065('0x16')]=(_0x5b099e[_0xe065('0x13')]||0x0)+(_0x5b099e[_0xe065('0x14')]||0x0)+(_0x5b099e[_0xe065('0x15')]||0x0)+(_0x5b099e[_0xe065('0x17')]||0x0)+(_0x5b099e[_0xe065('0x18')]||0x0)+(_0x5b099e['countabandonedretry']||0x0)+(_0x5b099e[_0xe065('0x19')]||0x0)+(_0x5b099e['countagentrejectretry']||0x0);this[_0xe065('0x17')]=_0x5b099e[_0xe065('0x17')]||0x0;this['countdropretry']=_0x5b099e[_0xe065('0x18')]||0x0;this['countabandonedretry']=_0x5b099e[_0xe065('0x1a')]||0x0;this[_0xe065('0x19')]=_0x5b099e[_0xe065('0x19')]||0x0;this[_0xe065('0x1b')]=_0x5b099e[_0xe065('0x1b')]||0x0;this[_0xe065('0x1c')]=_0x5b099e[_0xe065('0x1c')];this[_0xe065('0x1d')]=_0x5b099e[_0xe065('0x1d')];this['callbackat']=_0x5b099e[_0xe065('0x1e')];this[_0xe065('0x1f')]=_0x5b099e[_0xe065('0x1f')];this[_0xe065('0x20')]=_0x5b099e['ContactId'];this['ListId']=_0x5b099e[_0xe065('0x21')];this['UserId']=_[_0xe065('0x1')](_0x5b099e[_0xe065('0xa')])?_0x5b099e[_0xe065('0x22')]:_0x5b099e[_0xe065('0xa')]['id'];this[_0xe065('0x23')]=_0x5b099e[_0xe065('0x23')];this[_0xe065('0x24')]='';this[_0xe065('0x25')]='';}Action['prototype']['getCaller']=function(){return util[_0xe065('0xb')](_0xe065('0x26'),this[_0xe065('0x27')],this[_0xe065('0x28')]);};module['exports']=Action;
\ No newline at end of file
+var _0xb44a=['recallme','ContactId','ListId','VoiceQueueId','originatecalleridnum','originatecalleridname','getCaller','calleridname','number','exports','moment','isNil','string','uniqueid','idContact','queue','name','type','membername','Agent','channelAgent','format','SIP/%s','Contact','lastName','active','calleridnum','phone','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','callback','callbackuniqueid','callbackat'];(function(_0x57b90a,_0x246933){var _0x9b9abd=function(_0x347cc9){while(--_0x347cc9){_0x57b90a['push'](_0x57b90a['shift']());}};_0x9b9abd(++_0x246933);}(_0xb44a,0x1c2));var _0xab44=function(_0x53f37f,_0xfb0b18){_0x53f37f=_0x53f37f-0x0;var _0x2fe5f8=_0xb44a[_0x53f37f];return _0x2fe5f8;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0xab44('0x0'));function checkNameSurname(_0x492c1a,_0x186fec,_0x5c825d){var _0x50cb3c='';if(!_[_0xab44('0x1')](_0x186fec)&&'string'===typeof _0x186fec){_0x50cb3c+=_0x186fec;}if(!_[_0xab44('0x1')](_0x5c825d)&&_0xab44('0x2')===typeof _0x5c825d){_0x50cb3c+='\x20'+_0x5c825d;}if(_0x50cb3c!==''){return _0x50cb3c;}return _0x492c1a;}function Action(_0x2e3662,_0x28681a,_0x2f3948,_0x3303b1,_0x3ead8d){this[_0xab44('0x3')]=_0x2f3948||undefined;this[_0xab44('0x4')]=_0x2e3662['id'];this[_0xab44('0x5')]=_0x28681a[_0xab44('0x6')];this[_0xab44('0x7')]=_0x28681a[_0xab44('0x7')];this['campaigntype']=_0xab44('0x5');this['dialAnswer']=![];this[_0xab44('0x8')]=_['isNil'](_0x2e3662['Agent'])?undefined:_0x2e3662[_0xab44('0x9')][_0xab44('0x6')];this[_0xab44('0xa')]=this[_0xab44('0x8')]?util[_0xab44('0xb')](_0xab44('0xc'),this['membername']):_0x3303b1||undefined;this['calleridname']=checkNameSurname(_0x2e3662[_0xab44('0xd')]['phone'],_0x2e3662[_0xab44('0xd')]['firstName'],_0x2e3662[_0xab44('0xd')][_0xab44('0xe')]);this[_0xab44('0xf')]=_0x2e3662[_0xab44('0xf')]||![];this[_0xab44('0x10')]=_0x2e3662[_0xab44('0x11')];this['scheduledat']=_0x2e3662['scheduledat'];this[_0xab44('0x12')]=_0x2e3662[_0xab44('0x12')]||0x0;this[_0xab44('0x13')]=_0x2e3662[_0xab44('0x13')]||0x0;this[_0xab44('0x14')]=_0x2e3662[_0xab44('0x14')]||0x0;this[_0xab44('0x15')]=(_0x2e3662[_0xab44('0x12')]||0x0)+(_0x2e3662[_0xab44('0x13')]||0x0)+(_0x2e3662[_0xab44('0x14')]||0x0)+(_0x2e3662[_0xab44('0x16')]||0x0)+(_0x2e3662['countdropretry']||0x0)+(_0x2e3662[_0xab44('0x17')]||0x0)+(_0x2e3662[_0xab44('0x18')]||0x0)+(_0x2e3662[_0xab44('0x19')]||0x0);this[_0xab44('0x16')]=_0x2e3662[_0xab44('0x16')]||0x0;this['countdropretry']=_0x2e3662[_0xab44('0x1a')]||0x0;this['countabandonedretry']=_0x2e3662[_0xab44('0x17')]||0x0;this[_0xab44('0x18')]=_0x2e3662[_0xab44('0x18')]||0x0;this[_0xab44('0x19')]=_0x2e3662['countagentrejectretry']||0x0;this[_0xab44('0x1b')]=_0x2e3662[_0xab44('0x1b')];this[_0xab44('0x1c')]=_0x2e3662[_0xab44('0x1c')];this[_0xab44('0x1d')]=_0x2e3662[_0xab44('0x1d')];this[_0xab44('0x1e')]=_0x2e3662['recallme'];this['ContactId']=_0x2e3662[_0xab44('0x1f')];this['ListId']=_0x2e3662[_0xab44('0x20')];this['UserId']=_[_0xab44('0x1')](_0x2e3662['Agent'])?_0x2e3662['UserId']:_0x2e3662[_0xab44('0x9')]['id'];this[_0xab44('0x21')]=_0x2e3662[_0xab44('0x21')];this[_0xab44('0x22')]='';this[_0xab44('0x23')]='';}Action['prototype'][_0xab44('0x24')]=function(){return util[_0xab44('0xb')]('\x22%s\x22\x20<%s>',this[_0xab44('0x25')],this[_0xab44('0x26')]);};module[_0xab44('0x27')]=Action;
\ No newline at end of file
index 517c515..fad598d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalPauses','predictiveIntervalTotalCalls','message','originated','erlangCalls','erlangCallToSecond','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','stringify','voice:queue:%s','voice_queue:save','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','format','emit','voice_queue_presence:remove','sendMessageOneNotActive','paused','NOT_ACTIVE','logger','\x20is\x20not\x20active','[CampaignPreview]\x20Campaign\x20Queue:\x20','syncCampaigns','hasOwnProperty','dialMethod','booked','clearZombieChannels','type','outbound','setMessage','dialPreviewAutoRecallMe','recallMe','clearZombieChannel','isNil','Queue','queue','originated:\x20','pTalking:\x20','dialAnswer','pick','contactId','UserId','ListId','Action','catch','No\x20such\x20channel','updateOriginated','decrementTalkink','[clearZombieChannel]','loggerError','size','getContactRecallMe','then','length','getDiff','scheduledat','Agent','voicePause','run','logger2','disableContact','starttime','logCustomer','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','createCustomerFinal','[HistoryRecallClose]','[getContactRecallMe]','IsNotLoggedIn','AGENTS_NOT_LOGGED','isActive','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','countglobal','totalGlobal','custom:agentnosuchnumber','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','verifyAdditionalPhones','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','cloneAction','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','countnosuchnumberretry','rescheduleContact','unlockAgent','activeContact','linkedid','actioncountonusuch','idContact','incrementPreviewCounters','swapAdditionalPhones','ANSWER','YYYY-MM-DD\x20HH:mm:ss','responsetime','answertime','[syncHangup][talking][increment]','uniqueid','\x20Queue','buildObj','connect','acw','custom:agentConnectPreview','buildAcw','complete','[16]','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','talktime','BUSY','dialBusyRetryFrequency','busy','[callProgressDetectingCustomer][logBusy]','additional','countbusyretry','dialBusyMaxRetry','scheduledAt','NOANSWER','outboundNoAnswerCallsDay','NoAnswer','dialNoAnswerRetryFrequency','custom:agentnoanswer','noanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','countnoanswerretry','dialNoAnswerMaxRetry','CONGESTION','countcongestionretry','dialCongestionRetryFrequency','congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','CANCEL','countagentrejectretry','dialAgentRejectRetryFrequency','agentreject','AgentReject','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','ABANDONED','countabandonedretry','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','outboundUnknownCallsDay','countmachineretry','cause-txt','dialstatus','[callProgressDetectingCustomer][hangupInAMD]','custom:amd','amd','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','isUndefined','reason','logAgent','NoSuchNumber','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','Congestion','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','resolve','[swapAdditionalPhone]\x20','[incrementPreviewCounters]\x20','VoiceQueueId','Contact\x20is\x20undefined','lookAgent','isEmpty','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','custom:agentcalled','called','[Preview][execCall][failure]','Call\x20failed','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','status','SIP/%s','execRun','recallme','validateContact','isValid','phone','checkInBlack','[Preview][checkIsBlackList]','[Preview][getContactPreview]','Call\x20unsuccessful','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20work','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','execCall','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','substring','getCallerId','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','toLowerVariables','variablesAction','OriginateError','[originateFailure][logOriginateFailure]','syncNewExten','channel','actionid','logLookAgent','clone','isFailure','response','unlockContact','custom:agentringnoanswer','rejected','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','statedesc','dialQueueProject','transfer','[syncHangup][talking][transfer]','[syncHangup][talking][cause]','destuniqueid','addVariable','variables','filterKey','keys','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','bluebird','md5','../../../config/environment','../../../config/logger','preview','actionPreview','./rpcDb','../rpc/cmHopperAdditionalPhone','./action','defaults','socket.io-emitter','redis','prototype','enqueue','tail','sequence','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','hangup','syncHangupRequest','dialend','syncDialEnd','newexten','varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','name','strategy','answered','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','abandoned','waiting','loggedInDb','dialActive','dialOriginateCallerIdName','dialOriginateTimeout','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS'];(function(_0x1ca9e9,_0x1c4391){var _0x309f3c=function(_0x5ab318){while(--_0x5ab318){_0x1ca9e9['push'](_0x1ca9e9['shift']());}};_0x309f3c(++_0x1c4391);}(_0xa9e0,0x123));var _0x0a9e=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0xa9e0[_0x8de54f];return _0x14cba4;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var BPromise=require(_0x0a9e('0x2'));var uuid=require('uuid');var moment=require('moment');var md5=require(_0x0a9e('0x3'));var Redis=require('ioredis');var config=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var loggerAction=require(_0x0a9e('0x5'))(_0x0a9e('0x7'));var ami=require('../ami');var rpcDb=require(_0x0a9e('0x8'));var cmHopperAdditionalPhone=require(_0x0a9e('0x9'));var Action=require(_0x0a9e('0xa'));var ut=require('./util/util');config['redis']=_[_0x0a9e('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x0a9e('0xc'))(new Redis(config[_0x0a9e('0xd')]));var Sequence=function(){};Sequence[_0x0a9e('0xe')][_0x0a9e('0xf')]=function(_0xfeb75b){this[_0x0a9e('0x10')]=this['tail']?this['tail']['finally'](_0xfeb75b):_0xfeb75b();};function Preview(_0x4cfe67){this[_0x0a9e('0x11')]=new Sequence();this[_0x0a9e('0x12')]=_0x4cfe67[_0x0a9e('0x13')];this[_0x0a9e('0x14')]=_0x4cfe67[_0x0a9e('0x14')];this[_0x0a9e('0x15')]={};this['agents']=_0x4cfe67[_0x0a9e('0x16')];this[_0x0a9e('0x17')]=0x0;ami['on'](_0x0a9e('0x18'),this[_0x0a9e('0x19')][_0x0a9e('0x1a')](this));ami['on'](_0x0a9e('0x1b'),this['syncHangup'][_0x0a9e('0x1a')](this));ami['on']('hanguprequest',this[_0x0a9e('0x1c')]['bind'](this));ami['on'](_0x0a9e('0x1d'),this[_0x0a9e('0x1e')]['bind'](this));ami['on'](_0x0a9e('0x1f'),this['syncNewExten'][_0x0a9e('0x1a')](this));ami['on'](_0x0a9e('0x20'),this[_0x0a9e('0x21')][_0x0a9e('0x1a')](this));ami['on'](_0x0a9e('0x22'),this[_0x0a9e('0x23')][_0x0a9e('0x1a')](this));ami['on'](_0x0a9e('0x24'),this[_0x0a9e('0x25')][_0x0a9e('0x1a')](this));this[_0x0a9e('0x26')](this[_0x0a9e('0x12')]);}function emit(_0x4bb1e3,_0x2c3407,_0x155cce){io['to'](_0x4bb1e3)['emit'](_0x2c3407,_0x155cce);}function emitCampaignPreview(_0x20f109){if(_0x20f109['type']==='outbound'){var _0x3a02e1={'id':_0x20f109['id'],'name':_0x20f109[_0x0a9e('0x27')],'strategy':_0x20f109[_0x0a9e('0x28')],'answered':_0x20f109[_0x0a9e('0x29')],'available':_0x20f109['available'],'loggedIn':_0x20f109[_0x0a9e('0x2a')],'pTalking':_0x20f109[_0x0a9e('0x2b')],'sumBillable':_0x20f109[_0x0a9e('0x2c')],'sumDuration':_0x20f109[_0x0a9e('0x2d')],'sumHoldTime':_0x20f109[_0x0a9e('0x2e')]||0x0,'talking':_0x20f109[_0x0a9e('0x2f')],'total':_0x20f109[_0x0a9e('0x30')],'type':_0x20f109['type'],'unmanaged':_0x20f109['unmanaged'],'abandoned':_0x20f109[_0x0a9e('0x31')],'waiting':_0x20f109[_0x0a9e('0x32')],'loggedInDb':_0x20f109[_0x0a9e('0x33')],'dialActive':_0x20f109[_0x0a9e('0x34')],'dialMethod':_0x20f109['dialMethod'],'dialOriginateCallerIdName':_0x20f109[_0x0a9e('0x35')],'dialOriginateCallerIdNumber':_0x20f109['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x20f109[_0x0a9e('0x36')],'dialPrefix':_0x20f109['dialPrefix'],'outboundAnswerAgiCallsDay':_0x20f109[_0x0a9e('0x37')],'outboundAnswerCallsDay':_0x20f109[_0x0a9e('0x38')],'outboundBlacklistCallsDay':_0x20f109[_0x0a9e('0x39')],'outboundBusyCallsDay':_0x20f109[_0x0a9e('0x3a')],'outboundCongestionCallsDay':_0x20f109[_0x0a9e('0x3b')],'outboundDropCallsDayACS':_0x20f109[_0x0a9e('0x3c')],'outboundDropCallsDayCallersExit':_0x20f109[_0x0a9e('0x3d')],'outboundDropCallsDayTimeout':_0x20f109[_0x0a9e('0x3e')],'outboundNoAnswerCallsDay':_0x20f109['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x20f109[_0x0a9e('0x3f')],'outboundOriginateFailureCallsDay':_0x20f109[_0x0a9e('0x40')],'outboundReCallsDay':_0x20f109[_0x0a9e('0x41')],'outboundRejectCallsDay':_0x20f109[_0x0a9e('0x42')],'outboundUnknownCallsDay':_0x20f109['outboundUnknownCallsDay'],'outboundAbandonedCallsDay':_0x20f109[_0x0a9e('0x43')],'predictiveIntervalAnsweredCalls':_0x20f109[_0x0a9e('0x44')],'predictiveIntervalAvgHoldtime':_0x20f109[_0x0a9e('0x45')],'predictiveIntervalAvgTalktime':_0x20f109[_0x0a9e('0x46')],'predictiveIntervalDroppedCallsCallersExit':_0x20f109[_0x0a9e('0x47')],'predictiveIntervalDroppedCallsTimeout':_0x20f109[_0x0a9e('0x48')],'predictiveIntervalErlangCalls':_0x20f109[_0x0a9e('0x49')],'predictiveIntervalErlangCallsDroppedCalls':_0x20f109[_0x0a9e('0x4a')],'predictiveIntervalHitRate':_0x20f109[_0x0a9e('0x4b')],'predictiveIntervalMultiplicativeFactor':_0x20f109['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x20f109[_0x0a9e('0x4c')],'predictiveIntervalAvailable':_0x20f109['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x20f109[_0x0a9e('0x4d')],'message':_0x20f109[_0x0a9e('0x4e')],'originated':_0x20f109[_0x0a9e('0x4f')],'erlangCalls':_0x20f109[_0x0a9e('0x50')],'erlangCallToSecond':_0x20f109[_0x0a9e('0x51')],'erlangAbandonmentRate':_0x20f109['erlangAbandonmentRate'],'erlangBusyFactor':_0x20f109[_0x0a9e('0x52')],'startPredictive':_0x20f109[_0x0a9e('0x53')],'startProgressive':_0x20f109[_0x0a9e('0x54')]};if(_0x20f109[_0x0a9e('0x55')]){_0x3a02e1[_0x0a9e('0x55')]={'id':_0x20f109[_0x0a9e('0x55')]['id'],'name':_0x20f109[_0x0a9e('0x55')][_0x0a9e('0x27')],'active':_0x20f109['Trunk'][_0x0a9e('0x56')],'callerid':_0x20f109['Trunk'][_0x0a9e('0x57')]};}if(_0x20f109[_0x0a9e('0x58')]){_0x3a02e1[_0x0a9e('0x58')]={'id':_0x20f109[_0x0a9e('0x58')]['id'],'name':_0x20f109['Interval'][_0x0a9e('0x27')]};}var _0xd1836d=md5(JSON[_0x0a9e('0x59')](_0x3a02e1));if(_0x20f109[_0x0a9e('0x3')]!==_0xd1836d){_0x20f109['md5']=_0xd1836d;emit(util['format'](_0x0a9e('0x5a'),_0x3a02e1['name']),_0x0a9e('0x5b'),_0x3a02e1);}}}function emitVoiceQueueChannelRemove(_0x3d9717){logger[_0x0a9e('0x5c')](_0x0a9e('0x5d'),JSON['stringify'](_0x3d9717));emit(util[_0x0a9e('0x5e')](_0x0a9e('0x5a'),_0x3d9717[_0x0a9e('0x27')]),'voice_queue_channel:remove',_0x3d9717);io[_0x0a9e('0x5f')](_0x0a9e('0x60'),_0x3d9717);}function notSendMessagesQueue(_0x289467){if(_0x289467['sendMessageOneNotActive']){if(_0x289467['originated']===0x0&&_0x289467[_0x0a9e('0x2b')]===0x0){_0x289467[_0x0a9e('0x61')]=![];_0x289467['available']=0x0;_0x289467[_0x0a9e('0x62')]=0x0;_0x289467[_0x0a9e('0x4e')]=_0x0a9e('0x63');ut[_0x0a9e('0x64')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x289467['name']+_0x0a9e('0x65'));}else{_0x289467[_0x0a9e('0x4e')]='IS_DISACTIVED';ut[_0x0a9e('0x64')](_0x0a9e('0x66'),_0x289467[_0x0a9e('0x27')]+'\x20is\x20disactive');}emitCampaignPreview(_0x289467);}}Preview[_0x0a9e('0xe')][_0x0a9e('0x26')]=function(){var _0x274e8e=this;setInterval(function(){_0x274e8e[_0x0a9e('0x67')]();},0x7cf);};Preview[_0x0a9e('0xe')][_0x0a9e('0x67')]=function(){var _0x2881b3=this[_0x0a9e('0x12')];this[_0x0a9e('0x17')]+=0x1;for(var _0x3da2cd in _0x2881b3){if(_0x2881b3[_0x0a9e('0x68')](_0x3da2cd)&&(_0x2881b3[_0x3da2cd][_0x0a9e('0x69')]===_0x0a9e('0x6')||_0x2881b3[_0x3da2cd][_0x0a9e('0x69')]===_0x0a9e('0x6a'))&&_0x2881b3[_0x3da2cd]['type']==='outbound'){if(this[_0x0a9e('0x17')]>0x7){this[_0x0a9e('0x17')]=0x0;this[_0x0a9e('0x6b')]();}}if(_0x2881b3[_0x0a9e('0x68')](_0x3da2cd)&&_0x2881b3[_0x3da2cd][_0x0a9e('0x69')]===_0x0a9e('0x6')&&_0x2881b3[_0x3da2cd][_0x0a9e('0x6c')]===_0x0a9e('0x6d')){if(_0x2881b3[_0x3da2cd][_0x0a9e('0x34')]){this[_0x0a9e('0x6e')](_0x2881b3[_0x3da2cd]);if(_0x2881b3[_0x3da2cd][_0x0a9e('0x6f')])this[_0x0a9e('0x70')](_0x2881b3[_0x3da2cd]);}else{notSendMessagesQueue(_0x2881b3[_0x3da2cd]);}}}};Preview['prototype'][_0x0a9e('0x71')]=function(_0x138b8b){var _0xdd268f=this;this[_0x0a9e('0x11')][_0x0a9e('0xf')](function(){if(!_[_0x0a9e('0x72')](_0xdd268f[_0x0a9e('0x15')][_0x138b8b])){loggerAction[_0x0a9e('0x5c')]('[clearZombieChannels][talking]',_0x138b8b,_0x0a9e('0x73'),_0xdd268f['actions'][_0x138b8b][_0x0a9e('0x74')],_0x0a9e('0x75'),JSON[_0x0a9e('0x59')](_0xdd268f['campaignsPreview'][_0xdd268f[_0x0a9e('0x15')][_0x138b8b][_0x0a9e('0x74')]][_0x0a9e('0x4f')]),_0x0a9e('0x76'),JSON[_0x0a9e('0x59')](_0xdd268f[_0x0a9e('0x12')][_0xdd268f[_0x0a9e('0x15')][_0x138b8b]['queue']][_0x0a9e('0x2b')]),JSON[_0x0a9e('0x59')](_0xdd268f[_0x0a9e('0x15')][_0x138b8b][_0x0a9e('0x77')]),JSON[_0x0a9e('0x59')](_[_0x0a9e('0x78')](_0xdd268f[_0x0a9e('0x15')][_0x138b8b],[_0x0a9e('0x79'),_0x0a9e('0x7a'),'VoiceQueueId',_0x0a9e('0x7b')])));return ami[_0x0a9e('0x7c')]({'action':'status','channel':_0xdd268f['actions'][_0x138b8b]['channel']})[_0x0a9e('0x7d')](function(_0x4317e3){if(_0x4317e3[_0x0a9e('0x4e')]===_0x0a9e('0x7e')){setTimeout(function(){if(_0xdd268f[_0x0a9e('0x15')][_0x138b8b]){ut[_0x0a9e('0x7f')](_0xdd268f[_0x0a9e('0x12')][_0xdd268f[_0x0a9e('0x15')][_0x138b8b]['queue']],'[clearZombieChannel]');if(_0xdd268f['actions'][_0x138b8b][_0x0a9e('0x77')]===!![]){ut[_0x0a9e('0x80')](_0xdd268f[_0x0a9e('0x12')][_0xdd268f['actions'][_0x138b8b][_0x0a9e('0x74')]],_0x0a9e('0x81'));ut['loggerError']('[Dialer][checkChannel][pTalking][Preview]'+_0x138b8b,_0xdd268f[_0x0a9e('0x15')][_0x138b8b]['queue']);}ut[_0x0a9e('0x82')]('[Dialer][checkChannel][Preview]'+_0x138b8b,_0xdd268f[_0x0a9e('0x15')][_0x138b8b][_0x0a9e('0x74')]);delete _0xdd268f[_0x0a9e('0x15')][_0x138b8b];}},0x2328);}});}});};Preview['prototype'][_0x0a9e('0x6b')]=function(){var _0x1bf38a=this;loggerAction['info']('[action]',_[_0x0a9e('0x83')](this[_0x0a9e('0x15')]));for(var _0x49c095 in this[_0x0a9e('0x15')]){if(_0x1bf38a['actions'][_0x0a9e('0x68')](_0x49c095)){_0x1bf38a['clearZombieChannel'](_0x49c095);}}};Preview[_0x0a9e('0xe')]['recallMe']=function(_0x5da27d){var _0x5df0ad=this;rpcDb[_0x0a9e('0x84')](_0x5da27d['id'],ut['agentReadyId'](this[_0x0a9e('0x16')]))[_0x0a9e('0x85')](function(_0x3cfd00){if(!_[_0x0a9e('0x72')](_0x3cfd00)){for(var _0x232830=0x0;_0x232830<_0x3cfd00[_0x0a9e('0x86')];_0x232830+=0x1){if(ut[_0x0a9e('0x87')](_0x3cfd00[_0x232830][_0x0a9e('0x88')])<_0x5da27d['dialRecallMeTimeout']*0x3c){if(_0x3cfd00[_0x232830][_0x0a9e('0x89')]&&!_0x3cfd00[_0x232830][_0x0a9e('0x89')][_0x0a9e('0x8a')]){_0x5df0ad[_0x0a9e('0x8b')](_0x3cfd00[_0x232830]['id'])[_0x0a9e('0x85')](ut[_0x0a9e('0x8c')]('[RecallMe]'))[_0x0a9e('0x7d')](ut[_0x0a9e('0x8c')]('[RecallMe]'));}else{rpcDb[_0x0a9e('0x8d')](_0x3cfd00[_0x232830]['id']);}}else{var _0x5cc8fb=new Action(_0x3cfd00[_0x232830],_0x5da27d);_0x5cc8fb[_0x0a9e('0x8e')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x5da27d['outboundReCallsDay']+=0x1;ut[_0x0a9e('0x8f')](_0x5cc8fb,0x17,'RecallInQueue');if(_0x5da27d[_0x0a9e('0x90')]){rpcDb[_0x0a9e('0x91')](ut[_0x0a9e('0x92')](_0x3cfd00[_0x232830]));rpcDb[_0x0a9e('0x93')](_0x5cc8fb,_0x0a9e('0x94'));}else{ut[_0x0a9e('0x8f')](_0x5cc8fb,0x16,'RecallFailedTimeout');rpcDb[_0x0a9e('0x93')](_0x5cc8fb,'[HistoryRecallClose]');rpcDb[_0x0a9e('0x95')](_0x5cc8fb,_0x0a9e('0x96'));}}}}})[_0x0a9e('0x7d')](ut['logger2'](_0x0a9e('0x97')));};Preview[_0x0a9e('0xe')][_0x0a9e('0x6e')]=function(_0x32e134){_0x32e134['sendMessageOneNotActive']=!![];if(ut[_0x0a9e('0x98')](_0x32e134[_0x0a9e('0x2a')])){_0x32e134['message']=_0x0a9e('0x99');}else if(!ut[_0x0a9e('0x9a')](_0x32e134[_0x0a9e('0x34')])){_0x32e134[_0x0a9e('0x4e')]=_0x0a9e('0x63');}else if(!this['isTrunkReachable'](_0x32e134[_0x0a9e('0x55')])){if(!this[_0x0a9e('0x9b')](_0x32e134[_0x0a9e('0x9c')])){_0x32e134['message']=_0x0a9e('0x9d');}else{_0x32e134['message']='ACTIVE';}}else{_0x32e134[_0x0a9e('0x4e')]=_0x0a9e('0x9e');}emitCampaignPreview(_0x32e134);};Preview[_0x0a9e('0xe')][_0x0a9e('0x9f')]=function(_0x186f39,_0xc8c264,_0x387489){var _0x54a37d=this;var _0x2d7205=this[_0x0a9e('0x15')][_0xc8c264];var _0x2e89b7=this[_0x0a9e('0x12')][_0x2d7205[_0x0a9e('0x74')]];var _0x2b8192;var _0x320898=![];var _0x412a72=0x2;var _0x2a28c0=0x3;if(_0x2e89b7){switch(_0x387489){case'1':_0x2e89b7[_0x0a9e('0x3f')]+=0x1;_0x2d7205['countnosuchnumberretry']+=0x1;_0x2d7205[_0x0a9e('0xa0')]=ut[_0x0a9e('0xa1')](_0x2d7205);ut[_0x0a9e('0x8f')](_0x2d7205,0x0,'NoSuchNumber');ami[_0x0a9e('0x5f')](_0x0a9e('0xa2'),ut['buildObj'](_0x2d7205,_0x0a9e('0xa3')));rpcDb[_0x0a9e('0x93')](_0x2d7205,_0x0a9e('0xa4'));_0x54a37d[_0x0a9e('0xa5')](_0x2d7205,'0',_0x2e89b7)[_0x0a9e('0x85')](function(_0x4a43a8){_0x320898=_0x4a43a8['additional']==0x1;_0x412a72=_0x2e89b7['dialNoSuchNumberRetryFrequency'];_0x2a28c0=_0x2e89b7[_0x0a9e('0xa6')];if(!_0x320898){if(ut[_0x0a9e('0xa1')](_0x2d7205)>=_0x2e89b7[_0x0a9e('0xa7')]){_0x2b8192=ut[_0x0a9e('0xa8')](_0x2d7205,0xf,_0x0a9e('0xa9'));rpcDb[_0x0a9e('0x95')](_0x2b8192,_0x0a9e('0xaa'));}else{if(_0x2d7205[_0x0a9e('0xab')]>=_0x2e89b7['dialNoSuchNumberMaxRetry']){rpcDb[_0x0a9e('0x95')](_0x2d7205,_0x0a9e('0xaa'));}else{rpcDb[_0x0a9e('0xac')](ut['scheduledAt'](_0x2d7205,_0x0a9e('0xab'),_0x2e89b7['dialNoSuchNumberRetryFrequency']),_0x2d7205[_0x0a9e('0xad')],_0x2d7205[_0x0a9e('0xae')]);}}delete this['actions'][_0x186f39[_0x0a9e('0xaf')]];}else{_0x2d7205[_0x0a9e('0xab')]++;logger[_0x0a9e('0x5c')](_0x0a9e('0xb0'),_0x2d7205['countnosuchnumberretry']);logger[_0x0a9e('0x5c')]('id',_0x2d7205[_0x0a9e('0xb1')]);_0x54a37d[_0x0a9e('0xb2')]({'id':_0x2d7205[_0x0a9e('0xb1')],'field':{'countnosuchnumberretry':_0x2d7205['countnosuchnumberretry']}})[_0x0a9e('0x85')](function(){_0x54a37d[_0x0a9e('0xb3')](_0x2d7205,_0x412a72,_0x2a28c0)[_0x0a9e('0x85')](function(){});});}});break;case _0x0a9e('0xb4'):var _0x4abc8f=moment()[_0x0a9e('0x5e')](_0x0a9e('0xb5'));_0x2d7205[_0x0a9e('0xb6')]=_0x4abc8f;_0x2d7205[_0x0a9e('0xb7')]=_0x4abc8f;_0x2d7205[_0x0a9e('0x77')]=!![];_0x2e89b7[_0x0a9e('0x2b')]+=0x1;logger[_0x0a9e('0x5c')](_0x0a9e('0xb8'),_0x2d7205[_0x0a9e('0xb9')],_0x0a9e('0xba'),_0x2e89b7[_0x0a9e('0x27')],_0x0a9e('0x76'),_0x2e89b7[_0x0a9e('0x2b')]);ami[_0x0a9e('0x5f')]('custom:agentconnect',ut[_0x0a9e('0xbb')](_0x2d7205,_0x0a9e('0xbc'),this[_0x0a9e('0x12')][_0x2d7205['queue']]));if(_0x2e89b7[_0x0a9e('0xbd')]){ami[_0x0a9e('0x5f')](_0x0a9e('0xbe'),ut[_0x0a9e('0xbf')](_0x2d7205));}break;case'16':ami['emit']('custom:agentcomplete',ut[_0x0a9e('0xbb')](_0x2d7205,_0x0a9e('0xc0'),this['campaignsPreview'][_0x2d7205[_0x0a9e('0x74')]]));emitVoiceQueueChannelRemove(ut['buildObj'](_0x2d7205,_0x0a9e('0xc0')));_0x2e89b7[_0x0a9e('0x38')]+=0x1;_0x2e89b7['total']+=0x1;_0x2e89b7[_0x0a9e('0x29')]+=0x1;ut[_0x0a9e('0x80')](_0x2e89b7,_0x0a9e('0xc1'));_0x2d7205[_0x0a9e('0xa0')]=ut[_0x0a9e('0xa1')](_0x2d7205);ut[_0x0a9e('0x8f')](_0x2d7205,0x4,_0x0a9e('0xc2'));rpcDb['createCustomerHistory'](_0x2d7205,_0x0a9e('0xc3'));rpcDb[_0x0a9e('0x95')](_0x2d7205,_0x0a9e('0xc4'));rpcDb[_0x0a9e('0xc5')](_0x2d7205);_0x2e89b7['sumDuration']+=_0x2d7205[_0x0a9e('0xc6')];_0x2e89b7[_0x0a9e('0x2c')]+=_0x2d7205['talktime'];logger[_0x0a9e('0x5c')]('[syncHangup][talking][decrement]',_0x2d7205[_0x0a9e('0xb9')],_0x0a9e('0xba'),_0x2e89b7[_0x0a9e('0x27')],_0x0a9e('0x76'),_0x2e89b7['pTalking']);delete this['actions'][_0x186f39[_0x0a9e('0xaf')]];break;case _0x0a9e('0xc7'):_0x2e89b7[_0x0a9e('0x3a')]+=0x1;_0x2d7205['countbusyretry']+=0x1;_0x2d7205[_0x0a9e('0xa0')]=ut[_0x0a9e('0xa1')](_0x2d7205);ut['logCustomer'](_0x2d7205,0x5,'Busy');_0x412a72=_0x2e89b7[_0x0a9e('0xc8')];_0x2a28c0=_0x2e89b7['callAdditionalPhoneAfterMin'];ami['emit']('custom:agentbusy',ut[_0x0a9e('0xbb')](_0x2d7205,_0x0a9e('0xc9')));rpcDb[_0x0a9e('0x93')](_0x2d7205,_0x0a9e('0xca'));_0x54a37d[_0x0a9e('0xa5')](_0x2d7205,'5',_0x2e89b7)[_0x0a9e('0x85')](function(_0x5a8854){_0x320898=_0x5a8854[_0x0a9e('0xcb')]==0x1;if(!_0x320898){if(ut['totalGlobal'](_0x2d7205)>=_0x2e89b7[_0x0a9e('0xa7')]){_0x2b8192=ut[_0x0a9e('0xa8')](_0x2d7205,0xf,_0x0a9e('0xa9'));rpcDb[_0x0a9e('0x95')](_0x2b8192,'[callProgressDetectingCustomer][logBusyGlobal]');}else{if(_0x2d7205[_0x0a9e('0xcc')]>=_0x2e89b7[_0x0a9e('0xcd')]){rpcDb[_0x0a9e('0x95')](_0x2d7205,'[callProgressDetectingCustomer][logBusy]');}else{rpcDb[_0x0a9e('0xac')](ut[_0x0a9e('0xce')](_0x2d7205,_0x0a9e('0xcc'),_0x2e89b7[_0x0a9e('0xc8')]),_0x2d7205[_0x0a9e('0xad')],_0x2d7205[_0x0a9e('0xae')]);}}}else{_0x2d7205[_0x0a9e('0xcc')]++;_0x54a37d[_0x0a9e('0xb2')]({'id':_0x2d7205['idContact'],'field':{'countbusyretry':_0x2d7205[_0x0a9e('0xcc')]}})[_0x0a9e('0x85')](function(){_0x54a37d['swapAdditionalPhones'](_0x2d7205,_0x412a72,_0x2a28c0)[_0x0a9e('0x85')](function(){});});}});break;case _0x0a9e('0xcf'):_0x2e89b7[_0x0a9e('0xd0')]+=0x1;_0x2d7205['countnoanswerretry']+=0x1;_0x2d7205[_0x0a9e('0xa0')]=ut['totalGlobal'](_0x2d7205);ut[_0x0a9e('0x8f')](_0x2d7205,0x3,_0x0a9e('0xd1'));_0x412a72=_0x2e89b7[_0x0a9e('0xd2')];_0x2a28c0=_0x2e89b7[_0x0a9e('0xa6')];ami[_0x0a9e('0x5f')](_0x0a9e('0xd3'),ut[_0x0a9e('0xbb')](_0x2d7205,_0x0a9e('0xd4')));rpcDb['createCustomerHistory'](_0x2d7205,_0x0a9e('0xd5'));_0x54a37d[_0x0a9e('0xa5')](_0x2d7205,'3',_0x2e89b7)[_0x0a9e('0x85')](function(_0x30ef6e){_0x320898=_0x30ef6e[_0x0a9e('0xcb')]==0x1;if(!_0x320898){if(ut[_0x0a9e('0xa1')](_0x2d7205)>=_0x2e89b7[_0x0a9e('0xa7')]){_0x2b8192=ut[_0x0a9e('0xa8')](_0x2d7205,0xf,_0x0a9e('0xa9'));rpcDb[_0x0a9e('0x95')](_0x2b8192,_0x0a9e('0xd6'));}else{if(_0x2d7205[_0x0a9e('0xd7')]>=_0x2e89b7[_0x0a9e('0xd8')]){rpcDb['createCustomerFinal'](_0x2d7205,_0x0a9e('0xd5'));}else{rpcDb[_0x0a9e('0xac')](ut[_0x0a9e('0xce')](_0x2d7205,_0x0a9e('0xd7'),_0x2e89b7[_0x0a9e('0xd2')]),_0x2d7205['unlockAgent'],_0x2d7205[_0x0a9e('0xae')]);}}}else{_0x2d7205[_0x0a9e('0xd7')]++;_0x54a37d['incrementPreviewCounters']({'id':_0x2d7205[_0x0a9e('0xb1')],'field':{'countnoanswerretry':_0x2d7205['countnoanswerretry']}})[_0x0a9e('0x85')](function(){_0x54a37d[_0x0a9e('0xb3')](_0x2d7205,_0x412a72,_0x2a28c0)[_0x0a9e('0x85')](function(){});});}});break;case _0x0a9e('0xd9'):_0x2e89b7['outboundCongestionCallsDay']+=0x1;_0x2d7205[_0x0a9e('0xda')]+=0x1;_0x2d7205['countglobal']=ut[_0x0a9e('0xa1')](_0x2d7205);ut[_0x0a9e('0x8f')](_0x2d7205,0x8,'Congestion');_0x412a72=_0x2e89b7[_0x0a9e('0xdb')];_0x2a28c0=_0x2e89b7[_0x0a9e('0xa6')];ami[_0x0a9e('0x5f')]('custom:agentcongestion',ut['buildObj'](_0x2d7205,_0x0a9e('0xdc')));rpcDb[_0x0a9e('0x93')](_0x2d7205,_0x0a9e('0xdd'));_0x54a37d[_0x0a9e('0xa5')](_0x2d7205,'8',_0x2e89b7)[_0x0a9e('0x85')](function(_0x2450a8){_0x320898=_0x2450a8[_0x0a9e('0xcb')]==0x1;if(!_0x320898){if(ut[_0x0a9e('0xa1')](_0x2d7205)>=_0x2e89b7[_0x0a9e('0xa7')]){_0x2b8192=ut['cloneAction'](_0x2d7205,0xf,_0x0a9e('0xa9'));rpcDb['createCustomerFinal'](_0x2b8192,_0x0a9e('0xde'));}else{if(_0x2d7205[_0x0a9e('0xda')]>=_0x2e89b7[_0x0a9e('0xdf')]){rpcDb[_0x0a9e('0x95')](_0x2d7205,_0x0a9e('0xdd'));}else{rpcDb['rescheduleContact'](ut[_0x0a9e('0xce')](_0x2d7205,_0x0a9e('0xda'),_0x2e89b7[_0x0a9e('0xc8')]),_0x2d7205[_0x0a9e('0xad')],_0x2d7205[_0x0a9e('0xae')]);}}}else{_0x2d7205['countcongestionretry']++;_0x54a37d['incrementPreviewCounters']({'id':_0x2d7205[_0x0a9e('0xb1')],'field':{'countcongestionretry':_0x2d7205['countcongestionretry']}})[_0x0a9e('0x85')](function(){_0x54a37d[_0x0a9e('0xb3')](_0x2d7205,_0x412a72,_0x2a28c0)[_0x0a9e('0x85')](function(){});});}});break;case _0x0a9e('0xe0'):_0x2e89b7[_0x0a9e('0x42')]+=0x1;_0x2d7205[_0x0a9e('0xe1')]+=0x1;_0x2d7205['countglobal']=ut['totalGlobal'](_0x2d7205);ut[_0x0a9e('0x8f')](_0x2d7205,0x14,'AgentReject');_0x412a72=_0x2e89b7[_0x0a9e('0xe2')];_0x2a28c0=_0x2e89b7['callAdditionalPhoneAfterMin'];ami[_0x0a9e('0x5f')]('custom:agentreject',ut['buildObj'](_0x2d7205,_0x0a9e('0xe3')));rpcDb[_0x0a9e('0x93')](_0x2d7205,'[syncHangupRequest][logAgentReject]');_0x54a37d[_0x0a9e('0xa5')](_0x2d7205,'20',_0x2e89b7)[_0x0a9e('0x85')](function(_0x15c6b9){_0x320898=_0x15c6b9[_0x0a9e('0xcb')]==0x1;if(!_0x320898){if(ut[_0x0a9e('0xa1')](_0x2d7205)>=_0x2e89b7['dialGlobalMaxRetry']){_0x2b8192=ut['cloneAction'](_0x2d7205,0x14,_0x0a9e('0xe4'));rpcDb[_0x0a9e('0x95')](_0x2b8192,_0x0a9e('0xe5'));}else{if(_0x2d7205[_0x0a9e('0xe1')]>=_0x2e89b7[_0x0a9e('0xe6')]){rpcDb['createCustomerFinal'](_0x2d7205,_0x0a9e('0xe5'));}else{rpcDb[_0x0a9e('0xac')](ut['scheduledAt'](_0x2d7205,_0x0a9e('0xe1'),_0x2e89b7[_0x0a9e('0xe2')]),_0x2d7205[_0x0a9e('0xad')],_0x2d7205[_0x0a9e('0xae')]);}}}else{_0x2d7205[_0x0a9e('0xd7')]++;_0x54a37d[_0x0a9e('0xb2')]({'id':_0x2d7205[_0x0a9e('0xb1')],'field':{'countnoanswerretry':_0x2d7205[_0x0a9e('0xd7')]}})[_0x0a9e('0x85')](function(){_0x54a37d[_0x0a9e('0xb3')](_0x2d7205,_0x412a72,_0x2a28c0)['then'](function(){});});}});break;case _0x0a9e('0xe7'):_0x2e89b7[_0x0a9e('0x43')]+=0x1;_0x2d7205[_0x0a9e('0xe8')]+=0x1;_0x2d7205[_0x0a9e('0xa0')]=ut[_0x0a9e('0xa1')](_0x2d7205);ut['logCustomer'](_0x2d7205,0xb,'Abandoned');rpcDb[_0x0a9e('0x93')](_0x2d7205,_0x0a9e('0xe9'));_0x54a37d[_0x0a9e('0xa5')](_0x2d7205,'11',_0x2e89b7)[_0x0a9e('0x85')](function(_0x34f7b5){_0x320898=_0x34f7b5['additional']==0x1;if(!_0x320898){if(ut[_0x0a9e('0xa1')](_0x2d7205)>=_0x2e89b7[_0x0a9e('0xa7')]){_0x2b8192=ut[_0x0a9e('0xa8')](_0x2d7205,0xf,'Global');rpcDb[_0x0a9e('0x95')](_0x2b8192,'[callProgressDetectingCustomer][logAbandoned]');}else{if(_0x2d7205[_0x0a9e('0xea')]>=_0x2e89b7['dialAbandonedMaxRety']){rpcDb[_0x0a9e('0x95')](_0x2d7205,_0x0a9e('0xe9'));}else{rpcDb[_0x0a9e('0xac')](ut['scheduledAt'](_0x2d7205,_0x0a9e('0xe8'),_0x2e89b7['dialAbandonedRetryFrequency']),_0x2d7205[_0x0a9e('0xad')],_0x2d7205[_0x0a9e('0xae')]);}}}else{_0x2d7205[_0x0a9e('0xd7')]++;_0x54a37d[_0x0a9e('0xb2')]({'id':_0x2d7205[_0x0a9e('0xb1')],'field':{'countnoanswerretry':_0x2d7205[_0x0a9e('0xd7')]}})[_0x0a9e('0x85')](function(){_0x54a37d[_0x0a9e('0xb3')](_0x2d7205,_0x412a72,_0x2a28c0)[_0x0a9e('0x85')](function(){});});}});break;case'18':_0x2e89b7[_0x0a9e('0xeb')]+=0x1;_0x2d7205[_0x0a9e('0xec')]+=0x1;_0x2d7205[_0x0a9e('0xa0')]=ut[_0x0a9e('0xa1')](_0x2d7205);ut[_0x0a9e('0x8f')](_0x2d7205,0x12,_0x186f39[_0x0a9e('0xed')]||_0x186f39[_0x0a9e('0xee')]);ami['emit']('custom:amd',ut[_0x0a9e('0xbb')](_0x2d7205,'amd'));rpcDb[_0x0a9e('0x93')](_0x2d7205,_0x0a9e('0xef'));_0x54a37d['verifyAdditionalPhones'](_0x2d7205,'18',_0x2e89b7)[_0x0a9e('0x85')](function(_0xe2b083){_0x320898=_0xe2b083[_0x0a9e('0xcb')]==0x1;if(!_0x320898){if(ut[_0x0a9e('0xa1')](_0x2d7205)>=_0x2e89b7['dialGlobalMaxRetry']){_0x2b8192=ut[_0x0a9e('0xa8')](_0x2d7205,0x12,_0x0a9e('0xa9'));rpcDb[_0x0a9e('0x95')](_0x2b8192,_0x0a9e('0xef'));}else{rpcDb['createCustomerFinal'](_0x2d7205,_0x0a9e('0xef'));}}else{_0x2d7205[_0x0a9e('0xd7')]++;_0x54a37d[_0x0a9e('0xb2')]({'id':_0x2d7205['idContact'],'field':{'countnoanswerretry':_0x2d7205[_0x0a9e('0xd7')]}})[_0x0a9e('0x85')](function(){_0x54a37d[_0x0a9e('0xb3')](_0x2d7205,_0x412a72,_0x2a28c0)['then'](function(){});});}});delete this[_0x0a9e('0x15')][_0x186f39[_0x0a9e('0xaf')]];break;case'19':_0x2e89b7[_0x0a9e('0xeb')]+=0x1;_0x2d7205[_0x0a9e('0xa0')]=ut[_0x0a9e('0xa1')](_0x2d7205);ut['logCustomer'](_0x2d7205,0x13,_0x186f39[_0x0a9e('0xed')]||_0x186f39[_0x0a9e('0xee')]);ami['emit'](_0x0a9e('0xf0'),ut[_0x0a9e('0xbb')](_0x2d7205,_0x0a9e('0xf1')));rpcDb['createCustomerHistory'](_0x2d7205,'[callProgressDetectingCustomer][machine]');_0x54a37d['verifyAdditionalPhones'](_0x2d7205,'18',_0x2e89b7)[_0x0a9e('0x85')](function(_0x4a70ce){_0x320898=_0x4a70ce['additional']==0x1;if(!_0x320898){if(ut[_0x0a9e('0xa1')](_0x2d7205)>=_0x2e89b7[_0x0a9e('0xa7')]){_0x2b8192=ut[_0x0a9e('0xa8')](_0x2d7205,0xf,'Global');rpcDb[_0x0a9e('0x95')](_0x2b8192,_0x0a9e('0xf2'));}else{rpcDb[_0x0a9e('0x95')](_0x2d7205,_0x0a9e('0xf2'));}}else{_0x2d7205[_0x0a9e('0xd7')]++;_0x54a37d[_0x0a9e('0xb2')]({'id':_0x2d7205[_0x0a9e('0xb1')],'field':{'countnoanswerretry':_0x2d7205[_0x0a9e('0xd7')]}})[_0x0a9e('0x85')](function(){_0x54a37d['swapAdditionalPhones'](_0x2d7205,_0x412a72,_0x2a28c0)[_0x0a9e('0x85')](function(){});});}});delete this['actions'][_0x186f39[_0x0a9e('0xaf')]];break;default:if(_0x2d7205[_0x0a9e('0x77')]){ut[_0x0a9e('0x80')](_0x2e89b7,_0x0a9e('0xf3'));ut[_0x0a9e('0x82')](_0x0a9e('0xf4')+_0x2e89b7['name'],_0x186f39);}_0x2e89b7[_0x0a9e('0xeb')]+=0x1;_0x2d7205[_0x0a9e('0xa0')]=ut[_0x0a9e('0xa1')](_0x2d7205);ut[_0x0a9e('0x8f')](_0x2d7205,0xc,_0x186f39['cause-txt']||_0x186f39[_0x0a9e('0xee')]);_0x412a72=_0x2e89b7[_0x0a9e('0xe2')];_0x2a28c0=_0x2e89b7[_0x0a9e('0xa6')];rpcDb[_0x0a9e('0x93')](_0x2d7205,_0x0a9e('0xf5'));_0x54a37d[_0x0a9e('0xa5')](_0x2d7205,'20',_0x2e89b7)[_0x0a9e('0x85')](function(_0x25931e){_0x320898=_0x25931e[_0x0a9e('0xcb')]==0x1;if(!_0x320898){if(ut[_0x0a9e('0xa1')](_0x2d7205)>=_0x2e89b7['dialGlobalMaxRetry']){_0x2b8192=ut[_0x0a9e('0xa8')](_0x2d7205,0xf,_0x0a9e('0xa9'));rpcDb[_0x0a9e('0x95')](_0x2b8192,_0x0a9e('0xf6'));}else{rpcDb[_0x0a9e('0x95')](_0x2d7205,_0x0a9e('0xf6'));}delete this[_0x0a9e('0x15')][_0x186f39[_0x0a9e('0xaf')]];}else{_0x54a37d['swapAdditionalPhones'](_0x2d7205,_0x412a72,_0x2a28c0)[_0x0a9e('0x85')](function(_0xd2391){});}});}if(!(_0x2d7205[_0x0a9e('0x77')]&&_0x387489==='16')){ut['updateOriginated'](_0x2e89b7,_0x0a9e('0xf7'));logger[_0x0a9e('0x5c')](_0x0a9e('0xf8'),_0x2d7205[_0x0a9e('0xb9')],_0x0a9e('0xba'),_0x2e89b7[_0x0a9e('0x27')],_0x0a9e('0x75'),_0x2e89b7[_0x0a9e('0x4f')]);}if(_0x387489!==_0x0a9e('0xb4')){delete this[_0x0a9e('0x15')][_0x186f39['linkedid']];delete this[_0x0a9e('0x15')][_0x186f39[_0x0a9e('0xf9')]];}}};Preview[_0x0a9e('0xe')][_0x0a9e('0xfa')]=function(_0x2b624e,_0x3942fd,_0x5cb48d){if(_[_0x0a9e('0xfb')](_0x3942fd)&&'object'!==typeof _0x3942fd){return;}if(_['isUndefined'](_0x5cb48d)&&'object'!==typeof _0x5cb48d){return;}switch(_0x5cb48d[_0x0a9e('0xfc')]){case'0':ut[_0x0a9e('0xfd')](_0x2b624e,0x0,_0x0a9e('0xfe'));rpcDb[_0x0a9e('0xff')](_0x2b624e,'[callProgressDetectingAgent][logNoSuch]');break;case'3':ut[_0x0a9e('0xfd')](_0x2b624e,0x3,_0x0a9e('0xd1'));rpcDb[_0x0a9e('0xff')](_0x2b624e,_0x0a9e('0x100'));break;case'5':ut[_0x0a9e('0xfd')](_0x2b624e,0x5,'Busy');rpcDb['createAgentHistory'](_0x2b624e,_0x0a9e('0x101'));break;case'8':ut[_0x0a9e('0xfd')](_0x2b624e,0x8,_0x0a9e('0x102'));rpcDb['createAgentHistory'](_0x2b624e,_0x0a9e('0x103'));break;case'22':ut[_0x0a9e('0xfd')](_0x2b624e,0x16,_0x0a9e('0x104'));rpcDb['createAgentHistory'](_0x2b624e,_0x0a9e('0x105'));break;default:ut[_0x0a9e('0xfd')](_0x2b624e,0xc,_0x5cb48d[_0x0a9e('0xfc')]);rpcDb['createAgentHistory'](_0x2b624e,_0x0a9e('0x103'));}ut[_0x0a9e('0x7f')](_0x3942fd,_0x0a9e('0x106'));logger['info']('[originated][decrement][callProgressDetectingAgent]',_0x2b624e['uniqueid'],_0x0a9e('0xba'),_0x3942fd[_0x0a9e('0x27')],_0x0a9e('0x75'),_0x3942fd[_0x0a9e('0x4f')]);delete this['actions'][_0x2b624e[_0x0a9e('0xb9')]];};Preview['prototype'][_0x0a9e('0xa5')]=function(_0x2ff2ab,_0x242f23,_0x57f673){return BPromise[_0x0a9e('0x107')]()[_0x0a9e('0x85')](cmHopperAdditionalPhone[_0x0a9e('0xa5')](_0x2ff2ab,_0x242f23,_0x57f673))['catch'](logger[_0x0a9e('0x5c')]('[verifyAdditionalPhone]\x20'));};Preview[_0x0a9e('0xe')]['swapAdditionalPhones']=function(_0x41b90a,_0x57b7d4,_0xb14971){return BPromise[_0x0a9e('0x107')]()[_0x0a9e('0x85')](cmHopperAdditionalPhone[_0x0a9e('0xb3')](_0x41b90a,_0x57b7d4,_0xb14971))[_0x0a9e('0x7d')](logger[_0x0a9e('0x5c')](_0x0a9e('0x108')));};Preview['prototype'][_0x0a9e('0xb2')]=function(_0x1c9ea2){return BPromise['resolve']()[_0x0a9e('0x85')](cmHopperAdditionalPhone[_0x0a9e('0xb2')](_0x1c9ea2))['catch'](logger[_0x0a9e('0x5c')](_0x0a9e('0x109')));};Preview[_0x0a9e('0xe')]['checkInBlack']=function(_0x3766d7,_0xf49ed4,_0xdeb5e4,_0x3f0d64,_0x2003bc){var _0x29fdfe=this;return new BPromise(function(_0x3ba897,_0x74d9b8){if(_[_0x0a9e('0x72')](_0xf49ed4)||_[_0x0a9e('0x72')](_0xf49ed4['Contact'])||_[_0x0a9e('0x72')](_0xf49ed4['phone'])||_[_0x0a9e('0x72')](_0xf49ed4[_0x0a9e('0x10a')])){_0x74d9b8(ut[_0x0a9e('0x4e')](_0x0a9e('0x10b'),_0x3f0d64,_0x2003bc));return;}var _0x5d577b=uuid['v4']();var _0x2d45db=_0x29fdfe['campaignsPreview'][_0xf49ed4[_0x0a9e('0x73')][_0x0a9e('0x27')]];var _0x2977a7=_0xdeb5e4?_0x29fdfe['agents'][_0xdeb5e4]['id']:undefined;_0x29fdfe[_0x0a9e('0x15')][_0x5d577b]=new Action(_0xf49ed4,_0x2d45db,_0x5d577b,_0xdeb5e4,_0x2977a7);var _0x402544=_0x29fdfe[_0x0a9e('0x15')][_0x5d577b];_0x402544[_0x0a9e('0xad')]=_0x3f0d64;_0x402544[_0x0a9e('0xae')]=_0x2003bc;_0x402544[_0x0a9e('0x10c')]=_0xdeb5e4;if(_[_0x0a9e('0x10d')](_0x3766d7)){_0x29fdfe['execCall'](_0x402544,_0x2d45db,_0xf49ed4,_0xdeb5e4)[_0x0a9e('0x85')](function(_0x228c10){logger[_0x0a9e('0x5c')](_0x0a9e('0x10e'),_0x0a9e('0x10f')+_0x402544[_0x0a9e('0x74')]+_0x0a9e('0x110')+_0x402544['idContact'],JSON['stringify'](_0x228c10));ami[_0x0a9e('0x5f')](_0x0a9e('0x111'),ut[_0x0a9e('0xbb')](_0x402544,_0x0a9e('0x112'),_0x29fdfe[_0x0a9e('0x12')][_0x402544[_0x0a9e('0x74')]]));_0x3ba897(ut[_0x0a9e('0x4e')]('Calling'));})[_0x0a9e('0x7d')](function(_0x1d7fc4){ut[_0x0a9e('0x64')](_0x0a9e('0x113'),_0x1d7fc4);_0x74d9b8(ut[_0x0a9e('0x4e')](_0x0a9e('0x114'),_0x3f0d64,_0x2003bc));});}else{_0x2d45db[_0x0a9e('0x39')]+=0x1;ut['logBlacklist'](_0x402544);rpcDb[_0x0a9e('0x115')](_0x402544,_0x0a9e('0x116'));delete _0x29fdfe[_0x0a9e('0x15')][_0x5d577b];_0x74d9b8(ut['message'](_0x0a9e('0x117'),_0x3f0d64,_0x2003bc));}});};Preview[_0x0a9e('0xe')][_0x0a9e('0x9b')]=function(_0x292f02){return!_['isNil'](_0x292f02)&&!_[_0x0a9e('0x72')](_0x292f02[_0x0a9e('0x27')])&&!_[_0x0a9e('0x72')](_0x292f02[_0x0a9e('0x56')])&&_0x292f02[_0x0a9e('0x56')]&&!_[_0x0a9e('0x72')](this[_0x0a9e('0x14')][util[_0x0a9e('0x5e')]('SIP/%s',_0x292f02[_0x0a9e('0x27')])])&&!_[_0x0a9e('0x72')](this[_0x0a9e('0x14')][util[_0x0a9e('0x5e')]('SIP/%s',_0x292f02['name'])][_0x0a9e('0x118')])&&(this[_0x0a9e('0x14')][util[_0x0a9e('0x5e')]('SIP/%s',_0x292f02[_0x0a9e('0x27')])][_0x0a9e('0x118')]==='reachable'||this[_0x0a9e('0x14')][util['format'](_0x0a9e('0x119'),_0x292f02['name'])]['status']==='unmonitored');};Preview[_0x0a9e('0xe')][_0x0a9e('0x8b')]=function(_0x19f800,_0x20007e){var _0x7d59a9=this;return new BPromise(function(_0xe17af8,_0x48fbef){_0x7d59a9[_0x0a9e('0x11a')](_0x19f800,_0x20007e)[_0x0a9e('0x85')](function(_0x1713a7){_0xe17af8(_[_0x0a9e('0x78')](_0x1713a7,[_0x0a9e('0x4e')]));})[_0x0a9e('0x7d')](function(_0x31c937){if(_0x31c937['unlock']){rpcDb['unlockContact'](_0x19f800);}if(_0x31c937[_0x0a9e('0x56')]){rpcDb['disableContact'](_0x19f800);}_0x48fbef(_[_0x0a9e('0x78')](_0x31c937,[_0x0a9e('0x4e')]));});});};Preview[_0x0a9e('0xe')][_0x0a9e('0x11a')]=function(_0x37a448,_0x383dd8){var _0x594f25=this;return new BPromise(function(_0x4716d1,_0x59b872){var _0x50e32a,_0x504403;rpcDb['getContactPreview'](_0x37a448)[_0x0a9e('0x85')](function(_0x5dc978){if(!_['isNil'](_0x5dc978[0x0])){_0x504403=_0x5dc978[0x0][_0x0a9e('0x11b')]?![]:!![];_0x50e32a=_0x5dc978[0x0]['recallme']?!![]:![];_0x50e32a=_0x383dd8?!![]:_0x50e32a;}var _0x24470a=_0x594f25[_0x0a9e('0x11c')](_0x5dc978);if(_0x24470a[_0x0a9e('0x11d')]){rpcDb['checkIsBlackList'](_[_0x0a9e('0x78')](_0x5dc978[0x0],[_0x0a9e('0x10a'),_0x0a9e('0x11e')]))['then'](function(_0x5236c9){_0x594f25[_0x0a9e('0x11f')](_0x5236c9,_0x5dc978[0x0],_0x383dd8,_0x504403,_0x50e32a)[_0x0a9e('0x85')](function(_0x89d2cb){_0x4716d1(_0x89d2cb);})[_0x0a9e('0x7d')](function(_0x3b0db2){_0x59b872(_0x3b0db2);});})[_0x0a9e('0x7d')](function(_0x247a6c){ut[_0x0a9e('0x64')](_0x0a9e('0x120'),_0x247a6c);_0x59b872(ut[_0x0a9e('0x4e')]('Call\x20unsuccessful',_0x504403,_0x50e32a));});}else{_0x59b872(ut['message'](_0x24470a['message'],_0x504403,_0x50e32a));}})[_0x0a9e('0x7d')](function(_0x19dcc2){ut[_0x0a9e('0x64')](_0x0a9e('0x121'),_0x19dcc2);_0x59b872(ut[_0x0a9e('0x4e')](_0x0a9e('0x122'),![],!![]));});});};Preview[_0x0a9e('0xe')][_0x0a9e('0x11c')]=function(_0x5d74e9){if(_['isNil'](_0x5d74e9)||_[_0x0a9e('0x10d')](_0x5d74e9)||!_[_0x0a9e('0x72')](_0x5d74e9[0x0]['Agent'])&&_[_0x0a9e('0x72')](_0x5d74e9[0x0][_0x0a9e('0x89')][_0x0a9e('0x27')])){ut[_0x0a9e('0x64')](_0x0a9e('0x123'),_0x5d74e9);return{'isValid':![],'message':_0x0a9e('0x124')};}var _0x167196=this[_0x0a9e('0x12')][_0x5d74e9[0x0][_0x0a9e('0x73')][_0x0a9e('0x27')]];_0x167196[_0x0a9e('0x4e')]=_0x0a9e('0x9e');if(_['isNil'](_0x167196)){ut[_0x0a9e('0x64')](_0x0a9e('0x125'),_0x167196);return{'isValid':![],'message':_0x0a9e('0x126')};}if(!this[_0x0a9e('0x9b')](_0x167196[_0x0a9e('0x55')])){ut[_0x0a9e('0x64')](_0x0a9e('0x127'),_0x0a9e('0x128')+_0x167196[_0x0a9e('0x27')]+_0x0a9e('0x129'));if(!this[_0x0a9e('0x9b')](_0x167196[_0x0a9e('0x9c')])){ut['logger']('[Preview][validateContact][Trunk\x20not\x20work]',_0x167196[_0x0a9e('0x27')]+_0x0a9e('0x12a'));return{'isValid':![],'message':_0x0a9e('0x12b')};}}if(!ut[_0x0a9e('0x9a')](_0x167196[_0x0a9e('0x34')])){ut[_0x0a9e('0x64')](_0x0a9e('0x12c'),_0x167196['name']+_0x0a9e('0x12d'));return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x167196[_0x0a9e('0x27')]+_0x0a9e('0x12d')};}return{'isValid':!![],'message':_0x0a9e('0x12e')};};Preview[_0x0a9e('0xe')][_0x0a9e('0x12f')]=function(_0x358f74,_0x465003,_0x261eca,_0xa7a754){var _0x32a199=this;return new BPromise(function(_0x39d367,_0x8231e5){var _0x43111e=_0x358f74[_0x0a9e('0xb9')];var _0x3c8a9a=_0x32a199[_0x0a9e('0x9b')](_0x465003['Trunk'])?util['format'](_0x0a9e('0x130'),_0x465003[_0x0a9e('0x55')]['name'],_['isNil'](_0x465003[_0x0a9e('0x131')])?'':_0x465003[_0x0a9e('0x131')][_0x0a9e('0x132')]()||'',_0x465003['dialCutDigit']>0x0?_0x261eca[_0x0a9e('0x11e')]['substring'](_0x465003[_0x0a9e('0x133')]):_0x261eca['phone']):util[_0x0a9e('0x5e')]('SIP/%s/%s%s',_[_0x0a9e('0x72')](_0x465003[_0x0a9e('0x9c')])?_0x465003[_0x0a9e('0x55')]['name']:_0x465003[_0x0a9e('0x9c')]['name'],_['isNil'](_0x465003[_0x0a9e('0x131')])?'':_0x465003[_0x0a9e('0x131')][_0x0a9e('0x132')]()||'',_0x465003[_0x0a9e('0x133')]>0x0?_0x261eca[_0x0a9e('0x11e')][_0x0a9e('0x134')](_0x465003[_0x0a9e('0x133')]):_0x261eca[_0x0a9e('0x11e')]);var _0x1a3143=_0x32a199[_0x0a9e('0x9b')](_0x465003[_0x0a9e('0x55')])?ut[_0x0a9e('0x135')](_0x465003[_0x0a9e('0x55')][_0x0a9e('0x57')],_0x465003[_0x0a9e('0x35')],_0x465003[_0x0a9e('0x136')]>0x0?ut[_0x0a9e('0x137')](_0x465003[_0x0a9e('0x138')],_0x465003[_0x0a9e('0x136')]):_0x465003['dialOriginateCallerIdNumber']):ut[_0x0a9e('0x135')](_[_0x0a9e('0x72')](_0x465003[_0x0a9e('0x9c')])?_0x465003[_0x0a9e('0x55')]['callerid']:_0x465003['TrunkBackup']['callerid'],_0x465003[_0x0a9e('0x35')],_0x465003['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0x0a9e('0x137')](_0x465003[_0x0a9e('0x138')],_0x465003[_0x0a9e('0x136')]):_0x465003[_0x0a9e('0x138')]);if(_0x1a3143){_0x358f74[_0x0a9e('0x139')]=ut[_0x0a9e('0x13a')](_0x1a3143);_0x358f74[_0x0a9e('0x13b')]=ut[_0x0a9e('0x13c')](_0x1a3143);}var _0x2154d8=ut[_0x0a9e('0x13d')](_0x465003,_0x261eca,_0x3c8a9a,_0x1a3143,_0x43111e,_0x358f74);_['merge'](_0x358f74,ut[_0x0a9e('0x13e')](_0x2154d8));_0x358f74['starttime']=moment()[_0x0a9e('0x5e')]('YYYY-MM-DD\x20HH:mm:ss');ami[_0x0a9e('0x7c')](ut[_0x0a9e('0x13f')](_0x358f74,_0x465003,_0x2154d8,_0x358f74[_0x0a9e('0xae')],_0xa7a754))['then'](function(_0x920ad8){_0x465003[_0x0a9e('0x4f')]+=0x1;logger['info']('[originated][increment]',_0x43111e,_0x0a9e('0xba'),_0x465003[_0x0a9e('0x27')],_0x0a9e('0x75'),_0x465003['originated']);_0x39d367(_0x920ad8);})['catch'](function(_0x4869c1){ut[_0x0a9e('0xfd')](_0x358f74,0xe,_0x0a9e('0x140'));rpcDb[_0x0a9e('0xff')](_0x358f74,_0x0a9e('0x141'));_0x8231e5(_0x4869c1);});});};Preview[_0x0a9e('0xe')][_0x0a9e('0x142')]=function(_0x183b9b){if(this[_0x0a9e('0x15')][_0x183b9b[_0x0a9e('0xaf')]]){this[_0x0a9e('0x15')][_0x183b9b[_0x0a9e('0xaf')]][_0x0a9e('0x143')]=_0x183b9b[_0x0a9e('0x143')];}};Preview[_0x0a9e('0xe')][_0x0a9e('0x19')]=function(_0x1a74c4){var _0x94e69b=this;var _0x320367=this['actions'][_0x1a74c4[_0x0a9e('0x144')]];if(_0x320367){if(_0x320367[_0x0a9e('0x10c')]&&this[_0x0a9e('0x16')][_0x320367[_0x0a9e('0x10c')]]){ut[_0x0a9e('0x145')](_0x320367,this[_0x0a9e('0x16')][_0x320367['lookAgent']][_0x0a9e('0x27')],this[_0x0a9e('0x16')][_0x320367[_0x0a9e('0x10c')]]['id']);}var _0x1109de=_[_0x0a9e('0x146')](_0x320367);_0x1109de[_0x0a9e('0xb6')]=moment()[_0x0a9e('0x5e')](_0x0a9e('0xb5'));var _0x4175a6=_0x94e69b['campaignsPreview'][_0x320367['queue']];if(ut[_0x0a9e('0x147')](_0x1a74c4[_0x0a9e('0x148')])){if(_0x320367['unlockAgent']){rpcDb[_0x0a9e('0x149')](_0x320367[_0x0a9e('0xb1')]);}if(_0x320367['activeContact']){rpcDb[_0x0a9e('0x8d')](_0x320367['idContact']);}ami[_0x0a9e('0x5f')](_0x0a9e('0x14a'),ut['buildObj'](_0x320367,_0x0a9e('0x14b'),this[_0x0a9e('0x12')][_0x320367['queue']]));this[_0x0a9e('0xfa')](_0x1109de,_0x4175a6,_0x1a74c4);}else{_0x320367[_0x0a9e('0x8e')]=moment()['format'](_0x0a9e('0xb5'));ut[_0x0a9e('0xfd')](_0x1109de,0x4,_0x0a9e('0xc2'));rpcDb[_0x0a9e('0xff')](_0x1109de,_0x0a9e('0x14c'));}}};Preview[_0x0a9e('0xe')]['syncHangup']=function(_0x1e5b09){var _0x36dc4f=this;var _0x51e697=this[_0x0a9e('0x15')][_0x1e5b09[_0x0a9e('0xaf')]];var _0x22c390;if(_0x51e697){_0x22c390=this[_0x0a9e('0x12')][_0x51e697[_0x0a9e('0x74')]];logger[_0x0a9e('0x5c')](_0x0a9e('0x14d'),_0x1e5b09['linkedid'],'\x20Queue',_0x22c390['name'],'pTalking:\x20',_0x22c390['pTalking']);}if(this[_0x0a9e('0x15')][_0x1e5b09[_0x0a9e('0xaf')]]&&_0x1e5b09['linkedid']!==_0x1e5b09['uniqueid']){if(_0x1e5b09[_0x0a9e('0x14e')]==='16'&&this['actions'][_0x1e5b09[_0x0a9e('0xaf')]][_0x0a9e('0x77')]){this[_0x0a9e('0x9f')](_0x1e5b09,_0x1e5b09[_0x0a9e('0xaf')],_0x1e5b09[_0x0a9e('0x14e')]);}else if(this[_0x0a9e('0x15')][_0x1e5b09['linkedid']][_0x0a9e('0x77')]){logger[_0x0a9e('0x5c')]('[syncHangup][talking][cause]',_0x1e5b09[_0x0a9e('0xaf')],_0x1e5b09[_0x0a9e('0x14e')],_0x0a9e('0xba'),_0x22c390[_0x0a9e('0x27')],_0x0a9e('0x76'),_0x22c390[_0x0a9e('0x2b')]);this[_0x0a9e('0x9f')](_0x1e5b09,_0x1e5b09['linkedid'],_0x1e5b09[_0x0a9e('0x14e')]);}}else if(_0x51e697&&_['isNil'](_0x51e697[_0x0a9e('0x14f')])&&_0x22c390[_0x0a9e('0x150')]&&_0x1e5b09['linkedid']===_0x1e5b09[_0x0a9e('0xb9')]&&_[_0x0a9e('0x72')](_0x1e5b09['reason'])&&_0x1e5b09[_0x0a9e('0x14e')]==='16'&&_0x1e5b09['channelstate']==='6'&&_[_0x0a9e('0xfb')](_0x51e697[_0x0a9e('0x151')])){if(_0x51e697['unlockAgent']){rpcDb[_0x0a9e('0x149')](_0x51e697['idContact']);}if(_0x51e697[_0x0a9e('0xae')]){rpcDb[_0x0a9e('0x8d')](_0x51e697[_0x0a9e('0xb1')]);}_0x1e5b09[_0x0a9e('0xfc')]='22';this[_0x0a9e('0xfa')](_0x51e697,_0x22c390,_0x1e5b09);}else if(_0x51e697&&_0x51e697[_0x0a9e('0x151')]){if(_0x1e5b09[_0x0a9e('0x14e')]==='16'&&this['actions'][_0x1e5b09[_0x0a9e('0xaf')]][_0x0a9e('0x77')]){logger[_0x0a9e('0x5c')](_0x0a9e('0x152'),_0x1e5b09[_0x0a9e('0xaf')],_0x1e5b09['cause'],_0x0a9e('0xba'),_0x22c390['name'],'pTalking:\x20',_0x22c390[_0x0a9e('0x2b')]);this['callProgressDetectingCustomer'](_0x1e5b09,_0x1e5b09[_0x0a9e('0xaf')],_0x1e5b09[_0x0a9e('0x14e')]);}else if(this['actions'][_0x1e5b09[_0x0a9e('0xaf')]][_0x0a9e('0x77')]){logger[_0x0a9e('0x5c')](_0x0a9e('0x153'),_0x1e5b09[_0x0a9e('0xaf')],_0x1e5b09[_0x0a9e('0x14e')],_0x0a9e('0xba'),_0x22c390[_0x0a9e('0x27')],_0x0a9e('0x76'),_0x22c390['pTalking']);this[_0x0a9e('0x9f')](_0x1e5b09,_0x1e5b09[_0x0a9e('0xaf')],_0x1e5b09[_0x0a9e('0x14e')]);}}};Preview[_0x0a9e('0xe')]['syncDialEnd']=function(_0x38d95a){if(this[_0x0a9e('0x15')][_0x38d95a[_0x0a9e('0xf9')]]&&_0x38d95a['destlinkedid']!==_0x38d95a[_0x0a9e('0x154')]){this[_0x0a9e('0x9f')](_0x38d95a,_0x38d95a[_0x0a9e('0xf9')],_0x38d95a['dialstatus']);}};Preview[_0x0a9e('0xe')]['syncHangupRequest']=function(_0x2394f2){if(this[_0x0a9e('0x15')][_0x2394f2[_0x0a9e('0xaf')]]&&_0x2394f2[_0x0a9e('0xaf')]!==_0x2394f2[_0x0a9e('0xb9')]&&!this[_0x0a9e('0x15')][_0x2394f2[_0x0a9e('0xaf')]]['dialAnswer']){if(_0x2394f2[_0x0a9e('0x14e')]==='1'){this[_0x0a9e('0x9f')](_0x2394f2,_0x2394f2[_0x0a9e('0xaf')],_0x2394f2[_0x0a9e('0x14e')]);}}};Preview[_0x0a9e('0xe')][_0x0a9e('0x155')]=function(_0x3a4def,_0x2670f5,_0x2310ca){if(this[_0x0a9e('0x15')][_0x3a4def]){if(_[_0x0a9e('0x72')](this[_0x0a9e('0x15')][_0x3a4def][_0x0a9e('0x156')])){this[_0x0a9e('0x15')][_0x3a4def][_0x0a9e('0x156')]={};}this[_0x0a9e('0x15')][_0x3a4def][_0x0a9e('0x156')][_0x2670f5]=_0x2310ca;}};Preview[_0x0a9e('0xe')][_0x0a9e('0x21')]=function(_0x611e46){try{if(!_[_0x0a9e('0x72')](_0x611e46)){if(ut[_0x0a9e('0x157')](_[_0x0a9e('0x158')](_0x611e46['variable'])[0x0])){this[_0x0a9e('0x155')](_0x611e46[_0x0a9e('0xb9')],_[_0x0a9e('0x158')](_0x611e46['variable'])[0x0],_0x611e46[_0x0a9e('0x159')]);}}}catch(_0x4c925e){logger[_0x0a9e('0x15a')](_0x0a9e('0x15b'),util[_0x0a9e('0x15c')](_0x4c925e,{'showHidden':![],'depth':null}));}};Preview[_0x0a9e('0xe')][_0x0a9e('0x23')]=function(_0xb09ef6){if(_0xb09ef6){if(this[_0x0a9e('0x15')][_0xb09ef6[_0x0a9e('0x15d')]]){this['actions'][_0xb09ef6[_0x0a9e('0x15d')]][_0x0a9e('0x151')]=!![];}}};Preview['prototype'][_0x0a9e('0x25')]=function(_0x2db8fe){if(_0x2db8fe){if(this[_0x0a9e('0x15')][_0x2db8fe['transfererlinkedid']]){this[_0x0a9e('0x15')][_0x2db8fe[_0x0a9e('0x15e')]][_0x0a9e('0x151')]=!![];}}};module[_0x0a9e('0x15f')]=Preview;
\ No newline at end of file
+var _0xa9e0=['outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalPauses','predictiveIntervalTotalCalls','message','originated','erlangCalls','erlangCallToSecond','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','stringify','voice:queue:%s','voice_queue:save','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','format','emit','voice_queue_presence:remove','sendMessageOneNotActive','paused','NOT_ACTIVE','logger','\x20is\x20not\x20active','[CampaignPreview]\x20Campaign\x20Queue:\x20','syncCampaigns','hasOwnProperty','dialMethod','booked','clearZombieChannels','type','outbound','setMessage','dialPreviewAutoRecallMe','recallMe','clearZombieChannel','isNil','Queue','queue','originated:\x20','pTalking:\x20','dialAnswer','pick','contactId','UserId','ListId','Action','catch','No\x20such\x20channel','updateOriginated','decrementTalkink','[clearZombieChannel]','loggerError','size','getContactRecallMe','then','length','getDiff','scheduledat','Agent','voicePause','run','logger2','disableContact','starttime','logCustomer','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','createCustomerFinal','[HistoryRecallClose]','[getContactRecallMe]','IsNotLoggedIn','AGENTS_NOT_LOGGED','isActive','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','countglobal','totalGlobal','custom:agentnosuchnumber','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','verifyAdditionalPhones','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','cloneAction','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','countnosuchnumberretry','rescheduleContact','unlockAgent','activeContact','linkedid','actioncountonusuch','idContact','incrementPreviewCounters','swapAdditionalPhones','ANSWER','YYYY-MM-DD\x20HH:mm:ss','responsetime','answertime','[syncHangup][talking][increment]','uniqueid','\x20Queue','buildObj','connect','acw','custom:agentConnectPreview','buildAcw','complete','[16]','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','talktime','BUSY','dialBusyRetryFrequency','busy','[callProgressDetectingCustomer][logBusy]','additional','countbusyretry','dialBusyMaxRetry','scheduledAt','NOANSWER','outboundNoAnswerCallsDay','NoAnswer','dialNoAnswerRetryFrequency','custom:agentnoanswer','noanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','countnoanswerretry','dialNoAnswerMaxRetry','CONGESTION','countcongestionretry','dialCongestionRetryFrequency','congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','CANCEL','countagentrejectretry','dialAgentRejectRetryFrequency','agentreject','AgentReject','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','ABANDONED','countabandonedretry','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','outboundUnknownCallsDay','countmachineretry','cause-txt','dialstatus','[callProgressDetectingCustomer][hangupInAMD]','custom:amd','amd','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','isUndefined','reason','logAgent','NoSuchNumber','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','Congestion','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','resolve','[swapAdditionalPhone]\x20','[incrementPreviewCounters]\x20','VoiceQueueId','Contact\x20is\x20undefined','lookAgent','isEmpty','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','custom:agentcalled','called','[Preview][execCall][failure]','Call\x20failed','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','status','SIP/%s','execRun','recallme','validateContact','isValid','phone','checkInBlack','[Preview][checkIsBlackList]','[Preview][getContactPreview]','Call\x20unsuccessful','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20work','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','execCall','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','substring','getCallerId','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','toLowerVariables','variablesAction','OriginateError','[originateFailure][logOriginateFailure]','syncNewExten','channel','actionid','logLookAgent','clone','isFailure','response','unlockContact','custom:agentringnoanswer','rejected','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','statedesc','dialQueueProject','transfer','[syncHangup][talking][transfer]','[syncHangup][talking][cause]','destuniqueid','addVariable','variables','filterKey','keys','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','bluebird','md5','../../../config/environment','../../../config/logger','preview','actionPreview','./rpcDb','../rpc/cmHopperAdditionalPhone','./action','defaults','socket.io-emitter','redis','prototype','enqueue','tail','sequence','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','hangup','syncHangupRequest','dialend','syncDialEnd','newexten','varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','name','strategy','answered','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','abandoned','waiting','loggedInDb','dialActive','dialOriginateCallerIdName','dialOriginateTimeout','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS'];(function(_0x55abd9,_0x1148af){var _0x3e5669=function(_0x6f2105){while(--_0x6f2105){_0x55abd9['push'](_0x55abd9['shift']());}};_0x3e5669(++_0x1148af);}(_0xa9e0,0x123));var _0x0a9e=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0xa9e0[_0x32d457];return _0x338386;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var BPromise=require(_0x0a9e('0x2'));var uuid=require('uuid');var moment=require('moment');var md5=require(_0x0a9e('0x3'));var Redis=require('ioredis');var config=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var loggerAction=require(_0x0a9e('0x5'))(_0x0a9e('0x7'));var ami=require('../ami');var rpcDb=require(_0x0a9e('0x8'));var cmHopperAdditionalPhone=require(_0x0a9e('0x9'));var Action=require(_0x0a9e('0xa'));var ut=require('./util/util');config['redis']=_[_0x0a9e('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x0a9e('0xc'))(new Redis(config[_0x0a9e('0xd')]));var Sequence=function(){};Sequence[_0x0a9e('0xe')][_0x0a9e('0xf')]=function(_0xfeb75b){this[_0x0a9e('0x10')]=this['tail']?this['tail']['finally'](_0xfeb75b):_0xfeb75b();};function Preview(_0x4cfe67){this[_0x0a9e('0x11')]=new Sequence();this[_0x0a9e('0x12')]=_0x4cfe67[_0x0a9e('0x13')];this[_0x0a9e('0x14')]=_0x4cfe67[_0x0a9e('0x14')];this[_0x0a9e('0x15')]={};this['agents']=_0x4cfe67[_0x0a9e('0x16')];this[_0x0a9e('0x17')]=0x0;ami['on'](_0x0a9e('0x18'),this[_0x0a9e('0x19')][_0x0a9e('0x1a')](this));ami['on'](_0x0a9e('0x1b'),this['syncHangup'][_0x0a9e('0x1a')](this));ami['on']('hanguprequest',this[_0x0a9e('0x1c')]['bind'](this));ami['on'](_0x0a9e('0x1d'),this[_0x0a9e('0x1e')]['bind'](this));ami['on'](_0x0a9e('0x1f'),this['syncNewExten'][_0x0a9e('0x1a')](this));ami['on'](_0x0a9e('0x20'),this[_0x0a9e('0x21')][_0x0a9e('0x1a')](this));ami['on'](_0x0a9e('0x22'),this[_0x0a9e('0x23')][_0x0a9e('0x1a')](this));ami['on'](_0x0a9e('0x24'),this[_0x0a9e('0x25')][_0x0a9e('0x1a')](this));this[_0x0a9e('0x26')](this[_0x0a9e('0x12')]);}function emit(_0x4bb1e3,_0x2c3407,_0x155cce){io['to'](_0x4bb1e3)['emit'](_0x2c3407,_0x155cce);}function emitCampaignPreview(_0x20f109){if(_0x20f109['type']==='outbound'){var _0x3a02e1={'id':_0x20f109['id'],'name':_0x20f109[_0x0a9e('0x27')],'strategy':_0x20f109[_0x0a9e('0x28')],'answered':_0x20f109[_0x0a9e('0x29')],'available':_0x20f109['available'],'loggedIn':_0x20f109[_0x0a9e('0x2a')],'pTalking':_0x20f109[_0x0a9e('0x2b')],'sumBillable':_0x20f109[_0x0a9e('0x2c')],'sumDuration':_0x20f109[_0x0a9e('0x2d')],'sumHoldTime':_0x20f109[_0x0a9e('0x2e')]||0x0,'talking':_0x20f109[_0x0a9e('0x2f')],'total':_0x20f109[_0x0a9e('0x30')],'type':_0x20f109['type'],'unmanaged':_0x20f109['unmanaged'],'abandoned':_0x20f109[_0x0a9e('0x31')],'waiting':_0x20f109[_0x0a9e('0x32')],'loggedInDb':_0x20f109[_0x0a9e('0x33')],'dialActive':_0x20f109[_0x0a9e('0x34')],'dialMethod':_0x20f109['dialMethod'],'dialOriginateCallerIdName':_0x20f109[_0x0a9e('0x35')],'dialOriginateCallerIdNumber':_0x20f109['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x20f109[_0x0a9e('0x36')],'dialPrefix':_0x20f109['dialPrefix'],'outboundAnswerAgiCallsDay':_0x20f109[_0x0a9e('0x37')],'outboundAnswerCallsDay':_0x20f109[_0x0a9e('0x38')],'outboundBlacklistCallsDay':_0x20f109[_0x0a9e('0x39')],'outboundBusyCallsDay':_0x20f109[_0x0a9e('0x3a')],'outboundCongestionCallsDay':_0x20f109[_0x0a9e('0x3b')],'outboundDropCallsDayACS':_0x20f109[_0x0a9e('0x3c')],'outboundDropCallsDayCallersExit':_0x20f109[_0x0a9e('0x3d')],'outboundDropCallsDayTimeout':_0x20f109[_0x0a9e('0x3e')],'outboundNoAnswerCallsDay':_0x20f109['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x20f109[_0x0a9e('0x3f')],'outboundOriginateFailureCallsDay':_0x20f109[_0x0a9e('0x40')],'outboundReCallsDay':_0x20f109[_0x0a9e('0x41')],'outboundRejectCallsDay':_0x20f109[_0x0a9e('0x42')],'outboundUnknownCallsDay':_0x20f109['outboundUnknownCallsDay'],'outboundAbandonedCallsDay':_0x20f109[_0x0a9e('0x43')],'predictiveIntervalAnsweredCalls':_0x20f109[_0x0a9e('0x44')],'predictiveIntervalAvgHoldtime':_0x20f109[_0x0a9e('0x45')],'predictiveIntervalAvgTalktime':_0x20f109[_0x0a9e('0x46')],'predictiveIntervalDroppedCallsCallersExit':_0x20f109[_0x0a9e('0x47')],'predictiveIntervalDroppedCallsTimeout':_0x20f109[_0x0a9e('0x48')],'predictiveIntervalErlangCalls':_0x20f109[_0x0a9e('0x49')],'predictiveIntervalErlangCallsDroppedCalls':_0x20f109[_0x0a9e('0x4a')],'predictiveIntervalHitRate':_0x20f109[_0x0a9e('0x4b')],'predictiveIntervalMultiplicativeFactor':_0x20f109['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x20f109[_0x0a9e('0x4c')],'predictiveIntervalAvailable':_0x20f109['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x20f109[_0x0a9e('0x4d')],'message':_0x20f109[_0x0a9e('0x4e')],'originated':_0x20f109[_0x0a9e('0x4f')],'erlangCalls':_0x20f109[_0x0a9e('0x50')],'erlangCallToSecond':_0x20f109[_0x0a9e('0x51')],'erlangAbandonmentRate':_0x20f109['erlangAbandonmentRate'],'erlangBusyFactor':_0x20f109[_0x0a9e('0x52')],'startPredictive':_0x20f109[_0x0a9e('0x53')],'startProgressive':_0x20f109[_0x0a9e('0x54')]};if(_0x20f109[_0x0a9e('0x55')]){_0x3a02e1[_0x0a9e('0x55')]={'id':_0x20f109[_0x0a9e('0x55')]['id'],'name':_0x20f109[_0x0a9e('0x55')][_0x0a9e('0x27')],'active':_0x20f109['Trunk'][_0x0a9e('0x56')],'callerid':_0x20f109['Trunk'][_0x0a9e('0x57')]};}if(_0x20f109[_0x0a9e('0x58')]){_0x3a02e1[_0x0a9e('0x58')]={'id':_0x20f109[_0x0a9e('0x58')]['id'],'name':_0x20f109['Interval'][_0x0a9e('0x27')]};}var _0xd1836d=md5(JSON[_0x0a9e('0x59')](_0x3a02e1));if(_0x20f109[_0x0a9e('0x3')]!==_0xd1836d){_0x20f109['md5']=_0xd1836d;emit(util['format'](_0x0a9e('0x5a'),_0x3a02e1['name']),_0x0a9e('0x5b'),_0x3a02e1);}}}function emitVoiceQueueChannelRemove(_0x3d9717){logger[_0x0a9e('0x5c')](_0x0a9e('0x5d'),JSON['stringify'](_0x3d9717));emit(util[_0x0a9e('0x5e')](_0x0a9e('0x5a'),_0x3d9717[_0x0a9e('0x27')]),'voice_queue_channel:remove',_0x3d9717);io[_0x0a9e('0x5f')](_0x0a9e('0x60'),_0x3d9717);}function notSendMessagesQueue(_0x289467){if(_0x289467['sendMessageOneNotActive']){if(_0x289467['originated']===0x0&&_0x289467[_0x0a9e('0x2b')]===0x0){_0x289467[_0x0a9e('0x61')]=![];_0x289467['available']=0x0;_0x289467[_0x0a9e('0x62')]=0x0;_0x289467[_0x0a9e('0x4e')]=_0x0a9e('0x63');ut[_0x0a9e('0x64')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x289467['name']+_0x0a9e('0x65'));}else{_0x289467[_0x0a9e('0x4e')]='IS_DISACTIVED';ut[_0x0a9e('0x64')](_0x0a9e('0x66'),_0x289467[_0x0a9e('0x27')]+'\x20is\x20disactive');}emitCampaignPreview(_0x289467);}}Preview[_0x0a9e('0xe')][_0x0a9e('0x26')]=function(){var _0x274e8e=this;setInterval(function(){_0x274e8e[_0x0a9e('0x67')]();},0x7cf);};Preview[_0x0a9e('0xe')][_0x0a9e('0x67')]=function(){var _0x2881b3=this[_0x0a9e('0x12')];this[_0x0a9e('0x17')]+=0x1;for(var _0x3da2cd in _0x2881b3){if(_0x2881b3[_0x0a9e('0x68')](_0x3da2cd)&&(_0x2881b3[_0x3da2cd][_0x0a9e('0x69')]===_0x0a9e('0x6')||_0x2881b3[_0x3da2cd][_0x0a9e('0x69')]===_0x0a9e('0x6a'))&&_0x2881b3[_0x3da2cd]['type']==='outbound'){if(this[_0x0a9e('0x17')]>0x7){this[_0x0a9e('0x17')]=0x0;this[_0x0a9e('0x6b')]();}}if(_0x2881b3[_0x0a9e('0x68')](_0x3da2cd)&&_0x2881b3[_0x3da2cd][_0x0a9e('0x69')]===_0x0a9e('0x6')&&_0x2881b3[_0x3da2cd][_0x0a9e('0x6c')]===_0x0a9e('0x6d')){if(_0x2881b3[_0x3da2cd][_0x0a9e('0x34')]){this[_0x0a9e('0x6e')](_0x2881b3[_0x3da2cd]);if(_0x2881b3[_0x3da2cd][_0x0a9e('0x6f')])this[_0x0a9e('0x70')](_0x2881b3[_0x3da2cd]);}else{notSendMessagesQueue(_0x2881b3[_0x3da2cd]);}}}};Preview['prototype'][_0x0a9e('0x71')]=function(_0x138b8b){var _0xdd268f=this;this[_0x0a9e('0x11')][_0x0a9e('0xf')](function(){if(!_[_0x0a9e('0x72')](_0xdd268f[_0x0a9e('0x15')][_0x138b8b])){loggerAction[_0x0a9e('0x5c')]('[clearZombieChannels][talking]',_0x138b8b,_0x0a9e('0x73'),_0xdd268f['actions'][_0x138b8b][_0x0a9e('0x74')],_0x0a9e('0x75'),JSON[_0x0a9e('0x59')](_0xdd268f['campaignsPreview'][_0xdd268f[_0x0a9e('0x15')][_0x138b8b][_0x0a9e('0x74')]][_0x0a9e('0x4f')]),_0x0a9e('0x76'),JSON[_0x0a9e('0x59')](_0xdd268f[_0x0a9e('0x12')][_0xdd268f[_0x0a9e('0x15')][_0x138b8b]['queue']][_0x0a9e('0x2b')]),JSON[_0x0a9e('0x59')](_0xdd268f[_0x0a9e('0x15')][_0x138b8b][_0x0a9e('0x77')]),JSON[_0x0a9e('0x59')](_[_0x0a9e('0x78')](_0xdd268f[_0x0a9e('0x15')][_0x138b8b],[_0x0a9e('0x79'),_0x0a9e('0x7a'),'VoiceQueueId',_0x0a9e('0x7b')])));return ami[_0x0a9e('0x7c')]({'action':'status','channel':_0xdd268f['actions'][_0x138b8b]['channel']})[_0x0a9e('0x7d')](function(_0x4317e3){if(_0x4317e3[_0x0a9e('0x4e')]===_0x0a9e('0x7e')){setTimeout(function(){if(_0xdd268f[_0x0a9e('0x15')][_0x138b8b]){ut[_0x0a9e('0x7f')](_0xdd268f[_0x0a9e('0x12')][_0xdd268f[_0x0a9e('0x15')][_0x138b8b]['queue']],'[clearZombieChannel]');if(_0xdd268f['actions'][_0x138b8b][_0x0a9e('0x77')]===!![]){ut[_0x0a9e('0x80')](_0xdd268f[_0x0a9e('0x12')][_0xdd268f['actions'][_0x138b8b][_0x0a9e('0x74')]],_0x0a9e('0x81'));ut['loggerError']('[Dialer][checkChannel][pTalking][Preview]'+_0x138b8b,_0xdd268f[_0x0a9e('0x15')][_0x138b8b]['queue']);}ut[_0x0a9e('0x82')]('[Dialer][checkChannel][Preview]'+_0x138b8b,_0xdd268f[_0x0a9e('0x15')][_0x138b8b][_0x0a9e('0x74')]);delete _0xdd268f[_0x0a9e('0x15')][_0x138b8b];}},0x2328);}});}});};Preview['prototype'][_0x0a9e('0x6b')]=function(){var _0x1bf38a=this;loggerAction['info']('[action]',_[_0x0a9e('0x83')](this[_0x0a9e('0x15')]));for(var _0x49c095 in this[_0x0a9e('0x15')]){if(_0x1bf38a['actions'][_0x0a9e('0x68')](_0x49c095)){_0x1bf38a['clearZombieChannel'](_0x49c095);}}};Preview[_0x0a9e('0xe')]['recallMe']=function(_0x5da27d){var _0x5df0ad=this;rpcDb[_0x0a9e('0x84')](_0x5da27d['id'],ut['agentReadyId'](this[_0x0a9e('0x16')]))[_0x0a9e('0x85')](function(_0x3cfd00){if(!_[_0x0a9e('0x72')](_0x3cfd00)){for(var _0x232830=0x0;_0x232830<_0x3cfd00[_0x0a9e('0x86')];_0x232830+=0x1){if(ut[_0x0a9e('0x87')](_0x3cfd00[_0x232830][_0x0a9e('0x88')])<_0x5da27d['dialRecallMeTimeout']*0x3c){if(_0x3cfd00[_0x232830][_0x0a9e('0x89')]&&!_0x3cfd00[_0x232830][_0x0a9e('0x89')][_0x0a9e('0x8a')]){_0x5df0ad[_0x0a9e('0x8b')](_0x3cfd00[_0x232830]['id'])[_0x0a9e('0x85')](ut[_0x0a9e('0x8c')]('[RecallMe]'))[_0x0a9e('0x7d')](ut[_0x0a9e('0x8c')]('[RecallMe]'));}else{rpcDb[_0x0a9e('0x8d')](_0x3cfd00[_0x232830]['id']);}}else{var _0x5cc8fb=new Action(_0x3cfd00[_0x232830],_0x5da27d);_0x5cc8fb[_0x0a9e('0x8e')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x5da27d['outboundReCallsDay']+=0x1;ut[_0x0a9e('0x8f')](_0x5cc8fb,0x17,'RecallInQueue');if(_0x5da27d[_0x0a9e('0x90')]){rpcDb[_0x0a9e('0x91')](ut[_0x0a9e('0x92')](_0x3cfd00[_0x232830]));rpcDb[_0x0a9e('0x93')](_0x5cc8fb,_0x0a9e('0x94'));}else{ut[_0x0a9e('0x8f')](_0x5cc8fb,0x16,'RecallFailedTimeout');rpcDb[_0x0a9e('0x93')](_0x5cc8fb,'[HistoryRecallClose]');rpcDb[_0x0a9e('0x95')](_0x5cc8fb,_0x0a9e('0x96'));}}}}})[_0x0a9e('0x7d')](ut['logger2'](_0x0a9e('0x97')));};Preview[_0x0a9e('0xe')][_0x0a9e('0x6e')]=function(_0x32e134){_0x32e134['sendMessageOneNotActive']=!![];if(ut[_0x0a9e('0x98')](_0x32e134[_0x0a9e('0x2a')])){_0x32e134['message']=_0x0a9e('0x99');}else if(!ut[_0x0a9e('0x9a')](_0x32e134[_0x0a9e('0x34')])){_0x32e134[_0x0a9e('0x4e')]=_0x0a9e('0x63');}else if(!this['isTrunkReachable'](_0x32e134[_0x0a9e('0x55')])){if(!this[_0x0a9e('0x9b')](_0x32e134[_0x0a9e('0x9c')])){_0x32e134['message']=_0x0a9e('0x9d');}else{_0x32e134['message']='ACTIVE';}}else{_0x32e134[_0x0a9e('0x4e')]=_0x0a9e('0x9e');}emitCampaignPreview(_0x32e134);};Preview[_0x0a9e('0xe')][_0x0a9e('0x9f')]=function(_0x186f39,_0xc8c264,_0x387489){var _0x54a37d=this;var _0x2d7205=this[_0x0a9e('0x15')][_0xc8c264];var _0x2e89b7=this[_0x0a9e('0x12')][_0x2d7205[_0x0a9e('0x74')]];var _0x2b8192;var _0x320898=![];var _0x412a72=0x2;var _0x2a28c0=0x3;if(_0x2e89b7){switch(_0x387489){case'1':_0x2e89b7[_0x0a9e('0x3f')]+=0x1;_0x2d7205['countnosuchnumberretry']+=0x1;_0x2d7205[_0x0a9e('0xa0')]=ut[_0x0a9e('0xa1')](_0x2d7205);ut[_0x0a9e('0x8f')](_0x2d7205,0x0,'NoSuchNumber');ami[_0x0a9e('0x5f')](_0x0a9e('0xa2'),ut['buildObj'](_0x2d7205,_0x0a9e('0xa3')));rpcDb[_0x0a9e('0x93')](_0x2d7205,_0x0a9e('0xa4'));_0x54a37d[_0x0a9e('0xa5')](_0x2d7205,'0',_0x2e89b7)[_0x0a9e('0x85')](function(_0x4a43a8){_0x320898=_0x4a43a8['additional']==0x1;_0x412a72=_0x2e89b7['dialNoSuchNumberRetryFrequency'];_0x2a28c0=_0x2e89b7[_0x0a9e('0xa6')];if(!_0x320898){if(ut[_0x0a9e('0xa1')](_0x2d7205)>=_0x2e89b7[_0x0a9e('0xa7')]){_0x2b8192=ut[_0x0a9e('0xa8')](_0x2d7205,0xf,_0x0a9e('0xa9'));rpcDb[_0x0a9e('0x95')](_0x2b8192,_0x0a9e('0xaa'));}else{if(_0x2d7205[_0x0a9e('0xab')]>=_0x2e89b7['dialNoSuchNumberMaxRetry']){rpcDb[_0x0a9e('0x95')](_0x2d7205,_0x0a9e('0xaa'));}else{rpcDb[_0x0a9e('0xac')](ut['scheduledAt'](_0x2d7205,_0x0a9e('0xab'),_0x2e89b7['dialNoSuchNumberRetryFrequency']),_0x2d7205[_0x0a9e('0xad')],_0x2d7205[_0x0a9e('0xae')]);}}delete this['actions'][_0x186f39[_0x0a9e('0xaf')]];}else{_0x2d7205[_0x0a9e('0xab')]++;logger[_0x0a9e('0x5c')](_0x0a9e('0xb0'),_0x2d7205['countnosuchnumberretry']);logger[_0x0a9e('0x5c')]('id',_0x2d7205[_0x0a9e('0xb1')]);_0x54a37d[_0x0a9e('0xb2')]({'id':_0x2d7205[_0x0a9e('0xb1')],'field':{'countnosuchnumberretry':_0x2d7205['countnosuchnumberretry']}})[_0x0a9e('0x85')](function(){_0x54a37d[_0x0a9e('0xb3')](_0x2d7205,_0x412a72,_0x2a28c0)[_0x0a9e('0x85')](function(){});});}});break;case _0x0a9e('0xb4'):var _0x4abc8f=moment()[_0x0a9e('0x5e')](_0x0a9e('0xb5'));_0x2d7205[_0x0a9e('0xb6')]=_0x4abc8f;_0x2d7205[_0x0a9e('0xb7')]=_0x4abc8f;_0x2d7205[_0x0a9e('0x77')]=!![];_0x2e89b7[_0x0a9e('0x2b')]+=0x1;logger[_0x0a9e('0x5c')](_0x0a9e('0xb8'),_0x2d7205[_0x0a9e('0xb9')],_0x0a9e('0xba'),_0x2e89b7[_0x0a9e('0x27')],_0x0a9e('0x76'),_0x2e89b7[_0x0a9e('0x2b')]);ami[_0x0a9e('0x5f')]('custom:agentconnect',ut[_0x0a9e('0xbb')](_0x2d7205,_0x0a9e('0xbc'),this[_0x0a9e('0x12')][_0x2d7205['queue']]));if(_0x2e89b7[_0x0a9e('0xbd')]){ami[_0x0a9e('0x5f')](_0x0a9e('0xbe'),ut[_0x0a9e('0xbf')](_0x2d7205));}break;case'16':ami['emit']('custom:agentcomplete',ut[_0x0a9e('0xbb')](_0x2d7205,_0x0a9e('0xc0'),this['campaignsPreview'][_0x2d7205[_0x0a9e('0x74')]]));emitVoiceQueueChannelRemove(ut['buildObj'](_0x2d7205,_0x0a9e('0xc0')));_0x2e89b7[_0x0a9e('0x38')]+=0x1;_0x2e89b7['total']+=0x1;_0x2e89b7[_0x0a9e('0x29')]+=0x1;ut[_0x0a9e('0x80')](_0x2e89b7,_0x0a9e('0xc1'));_0x2d7205[_0x0a9e('0xa0')]=ut[_0x0a9e('0xa1')](_0x2d7205);ut[_0x0a9e('0x8f')](_0x2d7205,0x4,_0x0a9e('0xc2'));rpcDb['createCustomerHistory'](_0x2d7205,_0x0a9e('0xc3'));rpcDb[_0x0a9e('0x95')](_0x2d7205,_0x0a9e('0xc4'));rpcDb[_0x0a9e('0xc5')](_0x2d7205);_0x2e89b7['sumDuration']+=_0x2d7205[_0x0a9e('0xc6')];_0x2e89b7[_0x0a9e('0x2c')]+=_0x2d7205['talktime'];logger[_0x0a9e('0x5c')]('[syncHangup][talking][decrement]',_0x2d7205[_0x0a9e('0xb9')],_0x0a9e('0xba'),_0x2e89b7[_0x0a9e('0x27')],_0x0a9e('0x76'),_0x2e89b7['pTalking']);delete this['actions'][_0x186f39[_0x0a9e('0xaf')]];break;case _0x0a9e('0xc7'):_0x2e89b7[_0x0a9e('0x3a')]+=0x1;_0x2d7205['countbusyretry']+=0x1;_0x2d7205[_0x0a9e('0xa0')]=ut[_0x0a9e('0xa1')](_0x2d7205);ut['logCustomer'](_0x2d7205,0x5,'Busy');_0x412a72=_0x2e89b7[_0x0a9e('0xc8')];_0x2a28c0=_0x2e89b7['callAdditionalPhoneAfterMin'];ami['emit']('custom:agentbusy',ut[_0x0a9e('0xbb')](_0x2d7205,_0x0a9e('0xc9')));rpcDb[_0x0a9e('0x93')](_0x2d7205,_0x0a9e('0xca'));_0x54a37d[_0x0a9e('0xa5')](_0x2d7205,'5',_0x2e89b7)[_0x0a9e('0x85')](function(_0x5a8854){_0x320898=_0x5a8854[_0x0a9e('0xcb')]==0x1;if(!_0x320898){if(ut['totalGlobal'](_0x2d7205)>=_0x2e89b7[_0x0a9e('0xa7')]){_0x2b8192=ut[_0x0a9e('0xa8')](_0x2d7205,0xf,_0x0a9e('0xa9'));rpcDb[_0x0a9e('0x95')](_0x2b8192,'[callProgressDetectingCustomer][logBusyGlobal]');}else{if(_0x2d7205[_0x0a9e('0xcc')]>=_0x2e89b7[_0x0a9e('0xcd')]){rpcDb[_0x0a9e('0x95')](_0x2d7205,'[callProgressDetectingCustomer][logBusy]');}else{rpcDb[_0x0a9e('0xac')](ut[_0x0a9e('0xce')](_0x2d7205,_0x0a9e('0xcc'),_0x2e89b7[_0x0a9e('0xc8')]),_0x2d7205[_0x0a9e('0xad')],_0x2d7205[_0x0a9e('0xae')]);}}}else{_0x2d7205[_0x0a9e('0xcc')]++;_0x54a37d[_0x0a9e('0xb2')]({'id':_0x2d7205['idContact'],'field':{'countbusyretry':_0x2d7205[_0x0a9e('0xcc')]}})[_0x0a9e('0x85')](function(){_0x54a37d['swapAdditionalPhones'](_0x2d7205,_0x412a72,_0x2a28c0)[_0x0a9e('0x85')](function(){});});}});break;case _0x0a9e('0xcf'):_0x2e89b7[_0x0a9e('0xd0')]+=0x1;_0x2d7205['countnoanswerretry']+=0x1;_0x2d7205[_0x0a9e('0xa0')]=ut['totalGlobal'](_0x2d7205);ut[_0x0a9e('0x8f')](_0x2d7205,0x3,_0x0a9e('0xd1'));_0x412a72=_0x2e89b7[_0x0a9e('0xd2')];_0x2a28c0=_0x2e89b7[_0x0a9e('0xa6')];ami[_0x0a9e('0x5f')](_0x0a9e('0xd3'),ut[_0x0a9e('0xbb')](_0x2d7205,_0x0a9e('0xd4')));rpcDb['createCustomerHistory'](_0x2d7205,_0x0a9e('0xd5'));_0x54a37d[_0x0a9e('0xa5')](_0x2d7205,'3',_0x2e89b7)[_0x0a9e('0x85')](function(_0x30ef6e){_0x320898=_0x30ef6e[_0x0a9e('0xcb')]==0x1;if(!_0x320898){if(ut[_0x0a9e('0xa1')](_0x2d7205)>=_0x2e89b7[_0x0a9e('0xa7')]){_0x2b8192=ut[_0x0a9e('0xa8')](_0x2d7205,0xf,_0x0a9e('0xa9'));rpcDb[_0x0a9e('0x95')](_0x2b8192,_0x0a9e('0xd6'));}else{if(_0x2d7205[_0x0a9e('0xd7')]>=_0x2e89b7[_0x0a9e('0xd8')]){rpcDb['createCustomerFinal'](_0x2d7205,_0x0a9e('0xd5'));}else{rpcDb[_0x0a9e('0xac')](ut[_0x0a9e('0xce')](_0x2d7205,_0x0a9e('0xd7'),_0x2e89b7[_0x0a9e('0xd2')]),_0x2d7205['unlockAgent'],_0x2d7205[_0x0a9e('0xae')]);}}}else{_0x2d7205[_0x0a9e('0xd7')]++;_0x54a37d['incrementPreviewCounters']({'id':_0x2d7205[_0x0a9e('0xb1')],'field':{'countnoanswerretry':_0x2d7205['countnoanswerretry']}})[_0x0a9e('0x85')](function(){_0x54a37d[_0x0a9e('0xb3')](_0x2d7205,_0x412a72,_0x2a28c0)[_0x0a9e('0x85')](function(){});});}});break;case _0x0a9e('0xd9'):_0x2e89b7['outboundCongestionCallsDay']+=0x1;_0x2d7205[_0x0a9e('0xda')]+=0x1;_0x2d7205['countglobal']=ut[_0x0a9e('0xa1')](_0x2d7205);ut[_0x0a9e('0x8f')](_0x2d7205,0x8,'Congestion');_0x412a72=_0x2e89b7[_0x0a9e('0xdb')];_0x2a28c0=_0x2e89b7[_0x0a9e('0xa6')];ami[_0x0a9e('0x5f')]('custom:agentcongestion',ut['buildObj'](_0x2d7205,_0x0a9e('0xdc')));rpcDb[_0x0a9e('0x93')](_0x2d7205,_0x0a9e('0xdd'));_0x54a37d[_0x0a9e('0xa5')](_0x2d7205,'8',_0x2e89b7)[_0x0a9e('0x85')](function(_0x2450a8){_0x320898=_0x2450a8[_0x0a9e('0xcb')]==0x1;if(!_0x320898){if(ut[_0x0a9e('0xa1')](_0x2d7205)>=_0x2e89b7[_0x0a9e('0xa7')]){_0x2b8192=ut['cloneAction'](_0x2d7205,0xf,_0x0a9e('0xa9'));rpcDb['createCustomerFinal'](_0x2b8192,_0x0a9e('0xde'));}else{if(_0x2d7205[_0x0a9e('0xda')]>=_0x2e89b7[_0x0a9e('0xdf')]){rpcDb[_0x0a9e('0x95')](_0x2d7205,_0x0a9e('0xdd'));}else{rpcDb['rescheduleContact'](ut[_0x0a9e('0xce')](_0x2d7205,_0x0a9e('0xda'),_0x2e89b7[_0x0a9e('0xc8')]),_0x2d7205[_0x0a9e('0xad')],_0x2d7205[_0x0a9e('0xae')]);}}}else{_0x2d7205['countcongestionretry']++;_0x54a37d['incrementPreviewCounters']({'id':_0x2d7205[_0x0a9e('0xb1')],'field':{'countcongestionretry':_0x2d7205['countcongestionretry']}})[_0x0a9e('0x85')](function(){_0x54a37d[_0x0a9e('0xb3')](_0x2d7205,_0x412a72,_0x2a28c0)[_0x0a9e('0x85')](function(){});});}});break;case _0x0a9e('0xe0'):_0x2e89b7[_0x0a9e('0x42')]+=0x1;_0x2d7205[_0x0a9e('0xe1')]+=0x1;_0x2d7205['countglobal']=ut['totalGlobal'](_0x2d7205);ut[_0x0a9e('0x8f')](_0x2d7205,0x14,'AgentReject');_0x412a72=_0x2e89b7[_0x0a9e('0xe2')];_0x2a28c0=_0x2e89b7['callAdditionalPhoneAfterMin'];ami[_0x0a9e('0x5f')]('custom:agentreject',ut['buildObj'](_0x2d7205,_0x0a9e('0xe3')));rpcDb[_0x0a9e('0x93')](_0x2d7205,'[syncHangupRequest][logAgentReject]');_0x54a37d[_0x0a9e('0xa5')](_0x2d7205,'20',_0x2e89b7)[_0x0a9e('0x85')](function(_0x15c6b9){_0x320898=_0x15c6b9[_0x0a9e('0xcb')]==0x1;if(!_0x320898){if(ut[_0x0a9e('0xa1')](_0x2d7205)>=_0x2e89b7['dialGlobalMaxRetry']){_0x2b8192=ut['cloneAction'](_0x2d7205,0x14,_0x0a9e('0xe4'));rpcDb[_0x0a9e('0x95')](_0x2b8192,_0x0a9e('0xe5'));}else{if(_0x2d7205[_0x0a9e('0xe1')]>=_0x2e89b7[_0x0a9e('0xe6')]){rpcDb['createCustomerFinal'](_0x2d7205,_0x0a9e('0xe5'));}else{rpcDb[_0x0a9e('0xac')](ut['scheduledAt'](_0x2d7205,_0x0a9e('0xe1'),_0x2e89b7[_0x0a9e('0xe2')]),_0x2d7205[_0x0a9e('0xad')],_0x2d7205[_0x0a9e('0xae')]);}}}else{_0x2d7205[_0x0a9e('0xd7')]++;_0x54a37d[_0x0a9e('0xb2')]({'id':_0x2d7205[_0x0a9e('0xb1')],'field':{'countnoanswerretry':_0x2d7205[_0x0a9e('0xd7')]}})[_0x0a9e('0x85')](function(){_0x54a37d[_0x0a9e('0xb3')](_0x2d7205,_0x412a72,_0x2a28c0)['then'](function(){});});}});break;case _0x0a9e('0xe7'):_0x2e89b7[_0x0a9e('0x43')]+=0x1;_0x2d7205[_0x0a9e('0xe8')]+=0x1;_0x2d7205[_0x0a9e('0xa0')]=ut[_0x0a9e('0xa1')](_0x2d7205);ut['logCustomer'](_0x2d7205,0xb,'Abandoned');rpcDb[_0x0a9e('0x93')](_0x2d7205,_0x0a9e('0xe9'));_0x54a37d[_0x0a9e('0xa5')](_0x2d7205,'11',_0x2e89b7)[_0x0a9e('0x85')](function(_0x34f7b5){_0x320898=_0x34f7b5['additional']==0x1;if(!_0x320898){if(ut[_0x0a9e('0xa1')](_0x2d7205)>=_0x2e89b7[_0x0a9e('0xa7')]){_0x2b8192=ut[_0x0a9e('0xa8')](_0x2d7205,0xf,'Global');rpcDb[_0x0a9e('0x95')](_0x2b8192,'[callProgressDetectingCustomer][logAbandoned]');}else{if(_0x2d7205[_0x0a9e('0xea')]>=_0x2e89b7['dialAbandonedMaxRety']){rpcDb[_0x0a9e('0x95')](_0x2d7205,_0x0a9e('0xe9'));}else{rpcDb[_0x0a9e('0xac')](ut['scheduledAt'](_0x2d7205,_0x0a9e('0xe8'),_0x2e89b7['dialAbandonedRetryFrequency']),_0x2d7205[_0x0a9e('0xad')],_0x2d7205[_0x0a9e('0xae')]);}}}else{_0x2d7205[_0x0a9e('0xd7')]++;_0x54a37d[_0x0a9e('0xb2')]({'id':_0x2d7205[_0x0a9e('0xb1')],'field':{'countnoanswerretry':_0x2d7205[_0x0a9e('0xd7')]}})[_0x0a9e('0x85')](function(){_0x54a37d[_0x0a9e('0xb3')](_0x2d7205,_0x412a72,_0x2a28c0)[_0x0a9e('0x85')](function(){});});}});break;case'18':_0x2e89b7[_0x0a9e('0xeb')]+=0x1;_0x2d7205[_0x0a9e('0xec')]+=0x1;_0x2d7205[_0x0a9e('0xa0')]=ut[_0x0a9e('0xa1')](_0x2d7205);ut[_0x0a9e('0x8f')](_0x2d7205,0x12,_0x186f39[_0x0a9e('0xed')]||_0x186f39[_0x0a9e('0xee')]);ami['emit']('custom:amd',ut[_0x0a9e('0xbb')](_0x2d7205,'amd'));rpcDb[_0x0a9e('0x93')](_0x2d7205,_0x0a9e('0xef'));_0x54a37d['verifyAdditionalPhones'](_0x2d7205,'18',_0x2e89b7)[_0x0a9e('0x85')](function(_0xe2b083){_0x320898=_0xe2b083[_0x0a9e('0xcb')]==0x1;if(!_0x320898){if(ut[_0x0a9e('0xa1')](_0x2d7205)>=_0x2e89b7['dialGlobalMaxRetry']){_0x2b8192=ut[_0x0a9e('0xa8')](_0x2d7205,0x12,_0x0a9e('0xa9'));rpcDb[_0x0a9e('0x95')](_0x2b8192,_0x0a9e('0xef'));}else{rpcDb['createCustomerFinal'](_0x2d7205,_0x0a9e('0xef'));}}else{_0x2d7205[_0x0a9e('0xd7')]++;_0x54a37d[_0x0a9e('0xb2')]({'id':_0x2d7205['idContact'],'field':{'countnoanswerretry':_0x2d7205[_0x0a9e('0xd7')]}})[_0x0a9e('0x85')](function(){_0x54a37d[_0x0a9e('0xb3')](_0x2d7205,_0x412a72,_0x2a28c0)['then'](function(){});});}});delete this[_0x0a9e('0x15')][_0x186f39[_0x0a9e('0xaf')]];break;case'19':_0x2e89b7[_0x0a9e('0xeb')]+=0x1;_0x2d7205[_0x0a9e('0xa0')]=ut[_0x0a9e('0xa1')](_0x2d7205);ut['logCustomer'](_0x2d7205,0x13,_0x186f39[_0x0a9e('0xed')]||_0x186f39[_0x0a9e('0xee')]);ami['emit'](_0x0a9e('0xf0'),ut[_0x0a9e('0xbb')](_0x2d7205,_0x0a9e('0xf1')));rpcDb['createCustomerHistory'](_0x2d7205,'[callProgressDetectingCustomer][machine]');_0x54a37d['verifyAdditionalPhones'](_0x2d7205,'18',_0x2e89b7)[_0x0a9e('0x85')](function(_0x4a70ce){_0x320898=_0x4a70ce['additional']==0x1;if(!_0x320898){if(ut[_0x0a9e('0xa1')](_0x2d7205)>=_0x2e89b7[_0x0a9e('0xa7')]){_0x2b8192=ut[_0x0a9e('0xa8')](_0x2d7205,0xf,'Global');rpcDb[_0x0a9e('0x95')](_0x2b8192,_0x0a9e('0xf2'));}else{rpcDb[_0x0a9e('0x95')](_0x2d7205,_0x0a9e('0xf2'));}}else{_0x2d7205[_0x0a9e('0xd7')]++;_0x54a37d[_0x0a9e('0xb2')]({'id':_0x2d7205[_0x0a9e('0xb1')],'field':{'countnoanswerretry':_0x2d7205[_0x0a9e('0xd7')]}})[_0x0a9e('0x85')](function(){_0x54a37d['swapAdditionalPhones'](_0x2d7205,_0x412a72,_0x2a28c0)[_0x0a9e('0x85')](function(){});});}});delete this['actions'][_0x186f39[_0x0a9e('0xaf')]];break;default:if(_0x2d7205[_0x0a9e('0x77')]){ut[_0x0a9e('0x80')](_0x2e89b7,_0x0a9e('0xf3'));ut[_0x0a9e('0x82')](_0x0a9e('0xf4')+_0x2e89b7['name'],_0x186f39);}_0x2e89b7[_0x0a9e('0xeb')]+=0x1;_0x2d7205[_0x0a9e('0xa0')]=ut[_0x0a9e('0xa1')](_0x2d7205);ut[_0x0a9e('0x8f')](_0x2d7205,0xc,_0x186f39['cause-txt']||_0x186f39[_0x0a9e('0xee')]);_0x412a72=_0x2e89b7[_0x0a9e('0xe2')];_0x2a28c0=_0x2e89b7[_0x0a9e('0xa6')];rpcDb[_0x0a9e('0x93')](_0x2d7205,_0x0a9e('0xf5'));_0x54a37d[_0x0a9e('0xa5')](_0x2d7205,'20',_0x2e89b7)[_0x0a9e('0x85')](function(_0x25931e){_0x320898=_0x25931e[_0x0a9e('0xcb')]==0x1;if(!_0x320898){if(ut[_0x0a9e('0xa1')](_0x2d7205)>=_0x2e89b7['dialGlobalMaxRetry']){_0x2b8192=ut[_0x0a9e('0xa8')](_0x2d7205,0xf,_0x0a9e('0xa9'));rpcDb[_0x0a9e('0x95')](_0x2b8192,_0x0a9e('0xf6'));}else{rpcDb[_0x0a9e('0x95')](_0x2d7205,_0x0a9e('0xf6'));}delete this[_0x0a9e('0x15')][_0x186f39[_0x0a9e('0xaf')]];}else{_0x54a37d['swapAdditionalPhones'](_0x2d7205,_0x412a72,_0x2a28c0)[_0x0a9e('0x85')](function(_0xd2391){});}});}if(!(_0x2d7205[_0x0a9e('0x77')]&&_0x387489==='16')){ut['updateOriginated'](_0x2e89b7,_0x0a9e('0xf7'));logger[_0x0a9e('0x5c')](_0x0a9e('0xf8'),_0x2d7205[_0x0a9e('0xb9')],_0x0a9e('0xba'),_0x2e89b7[_0x0a9e('0x27')],_0x0a9e('0x75'),_0x2e89b7[_0x0a9e('0x4f')]);}if(_0x387489!==_0x0a9e('0xb4')){delete this[_0x0a9e('0x15')][_0x186f39['linkedid']];delete this[_0x0a9e('0x15')][_0x186f39[_0x0a9e('0xf9')]];}}};Preview[_0x0a9e('0xe')][_0x0a9e('0xfa')]=function(_0x2b624e,_0x3942fd,_0x5cb48d){if(_[_0x0a9e('0xfb')](_0x3942fd)&&'object'!==typeof _0x3942fd){return;}if(_['isUndefined'](_0x5cb48d)&&'object'!==typeof _0x5cb48d){return;}switch(_0x5cb48d[_0x0a9e('0xfc')]){case'0':ut[_0x0a9e('0xfd')](_0x2b624e,0x0,_0x0a9e('0xfe'));rpcDb[_0x0a9e('0xff')](_0x2b624e,'[callProgressDetectingAgent][logNoSuch]');break;case'3':ut[_0x0a9e('0xfd')](_0x2b624e,0x3,_0x0a9e('0xd1'));rpcDb[_0x0a9e('0xff')](_0x2b624e,_0x0a9e('0x100'));break;case'5':ut[_0x0a9e('0xfd')](_0x2b624e,0x5,'Busy');rpcDb['createAgentHistory'](_0x2b624e,_0x0a9e('0x101'));break;case'8':ut[_0x0a9e('0xfd')](_0x2b624e,0x8,_0x0a9e('0x102'));rpcDb['createAgentHistory'](_0x2b624e,_0x0a9e('0x103'));break;case'22':ut[_0x0a9e('0xfd')](_0x2b624e,0x16,_0x0a9e('0x104'));rpcDb['createAgentHistory'](_0x2b624e,_0x0a9e('0x105'));break;default:ut[_0x0a9e('0xfd')](_0x2b624e,0xc,_0x5cb48d[_0x0a9e('0xfc')]);rpcDb['createAgentHistory'](_0x2b624e,_0x0a9e('0x103'));}ut[_0x0a9e('0x7f')](_0x3942fd,_0x0a9e('0x106'));logger['info']('[originated][decrement][callProgressDetectingAgent]',_0x2b624e['uniqueid'],_0x0a9e('0xba'),_0x3942fd[_0x0a9e('0x27')],_0x0a9e('0x75'),_0x3942fd[_0x0a9e('0x4f')]);delete this['actions'][_0x2b624e[_0x0a9e('0xb9')]];};Preview['prototype'][_0x0a9e('0xa5')]=function(_0x2ff2ab,_0x242f23,_0x57f673){return BPromise[_0x0a9e('0x107')]()[_0x0a9e('0x85')](cmHopperAdditionalPhone[_0x0a9e('0xa5')](_0x2ff2ab,_0x242f23,_0x57f673))['catch'](logger[_0x0a9e('0x5c')]('[verifyAdditionalPhone]\x20'));};Preview[_0x0a9e('0xe')]['swapAdditionalPhones']=function(_0x41b90a,_0x57b7d4,_0xb14971){return BPromise[_0x0a9e('0x107')]()[_0x0a9e('0x85')](cmHopperAdditionalPhone[_0x0a9e('0xb3')](_0x41b90a,_0x57b7d4,_0xb14971))[_0x0a9e('0x7d')](logger[_0x0a9e('0x5c')](_0x0a9e('0x108')));};Preview['prototype'][_0x0a9e('0xb2')]=function(_0x1c9ea2){return BPromise['resolve']()[_0x0a9e('0x85')](cmHopperAdditionalPhone[_0x0a9e('0xb2')](_0x1c9ea2))['catch'](logger[_0x0a9e('0x5c')](_0x0a9e('0x109')));};Preview[_0x0a9e('0xe')]['checkInBlack']=function(_0x3766d7,_0xf49ed4,_0xdeb5e4,_0x3f0d64,_0x2003bc){var _0x29fdfe=this;return new BPromise(function(_0x3ba897,_0x74d9b8){if(_[_0x0a9e('0x72')](_0xf49ed4)||_[_0x0a9e('0x72')](_0xf49ed4['Contact'])||_[_0x0a9e('0x72')](_0xf49ed4['phone'])||_[_0x0a9e('0x72')](_0xf49ed4[_0x0a9e('0x10a')])){_0x74d9b8(ut[_0x0a9e('0x4e')](_0x0a9e('0x10b'),_0x3f0d64,_0x2003bc));return;}var _0x5d577b=uuid['v4']();var _0x2d45db=_0x29fdfe['campaignsPreview'][_0xf49ed4[_0x0a9e('0x73')][_0x0a9e('0x27')]];var _0x2977a7=_0xdeb5e4?_0x29fdfe['agents'][_0xdeb5e4]['id']:undefined;_0x29fdfe[_0x0a9e('0x15')][_0x5d577b]=new Action(_0xf49ed4,_0x2d45db,_0x5d577b,_0xdeb5e4,_0x2977a7);var _0x402544=_0x29fdfe[_0x0a9e('0x15')][_0x5d577b];_0x402544[_0x0a9e('0xad')]=_0x3f0d64;_0x402544[_0x0a9e('0xae')]=_0x2003bc;_0x402544[_0x0a9e('0x10c')]=_0xdeb5e4;if(_[_0x0a9e('0x10d')](_0x3766d7)){_0x29fdfe['execCall'](_0x402544,_0x2d45db,_0xf49ed4,_0xdeb5e4)[_0x0a9e('0x85')](function(_0x228c10){logger[_0x0a9e('0x5c')](_0x0a9e('0x10e'),_0x0a9e('0x10f')+_0x402544[_0x0a9e('0x74')]+_0x0a9e('0x110')+_0x402544['idContact'],JSON['stringify'](_0x228c10));ami[_0x0a9e('0x5f')](_0x0a9e('0x111'),ut[_0x0a9e('0xbb')](_0x402544,_0x0a9e('0x112'),_0x29fdfe[_0x0a9e('0x12')][_0x402544[_0x0a9e('0x74')]]));_0x3ba897(ut[_0x0a9e('0x4e')]('Calling'));})[_0x0a9e('0x7d')](function(_0x1d7fc4){ut[_0x0a9e('0x64')](_0x0a9e('0x113'),_0x1d7fc4);_0x74d9b8(ut[_0x0a9e('0x4e')](_0x0a9e('0x114'),_0x3f0d64,_0x2003bc));});}else{_0x2d45db[_0x0a9e('0x39')]+=0x1;ut['logBlacklist'](_0x402544);rpcDb[_0x0a9e('0x115')](_0x402544,_0x0a9e('0x116'));delete _0x29fdfe[_0x0a9e('0x15')][_0x5d577b];_0x74d9b8(ut['message'](_0x0a9e('0x117'),_0x3f0d64,_0x2003bc));}});};Preview[_0x0a9e('0xe')][_0x0a9e('0x9b')]=function(_0x292f02){return!_['isNil'](_0x292f02)&&!_[_0x0a9e('0x72')](_0x292f02[_0x0a9e('0x27')])&&!_[_0x0a9e('0x72')](_0x292f02[_0x0a9e('0x56')])&&_0x292f02[_0x0a9e('0x56')]&&!_[_0x0a9e('0x72')](this[_0x0a9e('0x14')][util[_0x0a9e('0x5e')]('SIP/%s',_0x292f02[_0x0a9e('0x27')])])&&!_[_0x0a9e('0x72')](this[_0x0a9e('0x14')][util[_0x0a9e('0x5e')]('SIP/%s',_0x292f02['name'])][_0x0a9e('0x118')])&&(this[_0x0a9e('0x14')][util[_0x0a9e('0x5e')]('SIP/%s',_0x292f02[_0x0a9e('0x27')])][_0x0a9e('0x118')]==='reachable'||this[_0x0a9e('0x14')][util['format'](_0x0a9e('0x119'),_0x292f02['name'])]['status']==='unmonitored');};Preview[_0x0a9e('0xe')][_0x0a9e('0x8b')]=function(_0x19f800,_0x20007e){var _0x7d59a9=this;return new BPromise(function(_0xe17af8,_0x48fbef){_0x7d59a9[_0x0a9e('0x11a')](_0x19f800,_0x20007e)[_0x0a9e('0x85')](function(_0x1713a7){_0xe17af8(_[_0x0a9e('0x78')](_0x1713a7,[_0x0a9e('0x4e')]));})[_0x0a9e('0x7d')](function(_0x31c937){if(_0x31c937['unlock']){rpcDb['unlockContact'](_0x19f800);}if(_0x31c937[_0x0a9e('0x56')]){rpcDb['disableContact'](_0x19f800);}_0x48fbef(_[_0x0a9e('0x78')](_0x31c937,[_0x0a9e('0x4e')]));});});};Preview[_0x0a9e('0xe')][_0x0a9e('0x11a')]=function(_0x37a448,_0x383dd8){var _0x594f25=this;return new BPromise(function(_0x4716d1,_0x59b872){var _0x50e32a,_0x504403;rpcDb['getContactPreview'](_0x37a448)[_0x0a9e('0x85')](function(_0x5dc978){if(!_['isNil'](_0x5dc978[0x0])){_0x504403=_0x5dc978[0x0][_0x0a9e('0x11b')]?![]:!![];_0x50e32a=_0x5dc978[0x0]['recallme']?!![]:![];_0x50e32a=_0x383dd8?!![]:_0x50e32a;}var _0x24470a=_0x594f25[_0x0a9e('0x11c')](_0x5dc978);if(_0x24470a[_0x0a9e('0x11d')]){rpcDb['checkIsBlackList'](_[_0x0a9e('0x78')](_0x5dc978[0x0],[_0x0a9e('0x10a'),_0x0a9e('0x11e')]))['then'](function(_0x5236c9){_0x594f25[_0x0a9e('0x11f')](_0x5236c9,_0x5dc978[0x0],_0x383dd8,_0x504403,_0x50e32a)[_0x0a9e('0x85')](function(_0x89d2cb){_0x4716d1(_0x89d2cb);})[_0x0a9e('0x7d')](function(_0x3b0db2){_0x59b872(_0x3b0db2);});})[_0x0a9e('0x7d')](function(_0x247a6c){ut[_0x0a9e('0x64')](_0x0a9e('0x120'),_0x247a6c);_0x59b872(ut[_0x0a9e('0x4e')]('Call\x20unsuccessful',_0x504403,_0x50e32a));});}else{_0x59b872(ut['message'](_0x24470a['message'],_0x504403,_0x50e32a));}})[_0x0a9e('0x7d')](function(_0x19dcc2){ut[_0x0a9e('0x64')](_0x0a9e('0x121'),_0x19dcc2);_0x59b872(ut[_0x0a9e('0x4e')](_0x0a9e('0x122'),![],!![]));});});};Preview[_0x0a9e('0xe')][_0x0a9e('0x11c')]=function(_0x5d74e9){if(_['isNil'](_0x5d74e9)||_[_0x0a9e('0x10d')](_0x5d74e9)||!_[_0x0a9e('0x72')](_0x5d74e9[0x0]['Agent'])&&_[_0x0a9e('0x72')](_0x5d74e9[0x0][_0x0a9e('0x89')][_0x0a9e('0x27')])){ut[_0x0a9e('0x64')](_0x0a9e('0x123'),_0x5d74e9);return{'isValid':![],'message':_0x0a9e('0x124')};}var _0x167196=this[_0x0a9e('0x12')][_0x5d74e9[0x0][_0x0a9e('0x73')][_0x0a9e('0x27')]];_0x167196[_0x0a9e('0x4e')]=_0x0a9e('0x9e');if(_['isNil'](_0x167196)){ut[_0x0a9e('0x64')](_0x0a9e('0x125'),_0x167196);return{'isValid':![],'message':_0x0a9e('0x126')};}if(!this[_0x0a9e('0x9b')](_0x167196[_0x0a9e('0x55')])){ut[_0x0a9e('0x64')](_0x0a9e('0x127'),_0x0a9e('0x128')+_0x167196[_0x0a9e('0x27')]+_0x0a9e('0x129'));if(!this[_0x0a9e('0x9b')](_0x167196[_0x0a9e('0x9c')])){ut['logger']('[Preview][validateContact][Trunk\x20not\x20work]',_0x167196[_0x0a9e('0x27')]+_0x0a9e('0x12a'));return{'isValid':![],'message':_0x0a9e('0x12b')};}}if(!ut[_0x0a9e('0x9a')](_0x167196[_0x0a9e('0x34')])){ut[_0x0a9e('0x64')](_0x0a9e('0x12c'),_0x167196['name']+_0x0a9e('0x12d'));return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x167196[_0x0a9e('0x27')]+_0x0a9e('0x12d')};}return{'isValid':!![],'message':_0x0a9e('0x12e')};};Preview[_0x0a9e('0xe')][_0x0a9e('0x12f')]=function(_0x358f74,_0x465003,_0x261eca,_0xa7a754){var _0x32a199=this;return new BPromise(function(_0x39d367,_0x8231e5){var _0x43111e=_0x358f74[_0x0a9e('0xb9')];var _0x3c8a9a=_0x32a199[_0x0a9e('0x9b')](_0x465003['Trunk'])?util['format'](_0x0a9e('0x130'),_0x465003[_0x0a9e('0x55')]['name'],_['isNil'](_0x465003[_0x0a9e('0x131')])?'':_0x465003[_0x0a9e('0x131')][_0x0a9e('0x132')]()||'',_0x465003['dialCutDigit']>0x0?_0x261eca[_0x0a9e('0x11e')]['substring'](_0x465003[_0x0a9e('0x133')]):_0x261eca['phone']):util[_0x0a9e('0x5e')]('SIP/%s/%s%s',_[_0x0a9e('0x72')](_0x465003[_0x0a9e('0x9c')])?_0x465003[_0x0a9e('0x55')]['name']:_0x465003[_0x0a9e('0x9c')]['name'],_['isNil'](_0x465003[_0x0a9e('0x131')])?'':_0x465003[_0x0a9e('0x131')][_0x0a9e('0x132')]()||'',_0x465003[_0x0a9e('0x133')]>0x0?_0x261eca[_0x0a9e('0x11e')][_0x0a9e('0x134')](_0x465003[_0x0a9e('0x133')]):_0x261eca[_0x0a9e('0x11e')]);var _0x1a3143=_0x32a199[_0x0a9e('0x9b')](_0x465003[_0x0a9e('0x55')])?ut[_0x0a9e('0x135')](_0x465003[_0x0a9e('0x55')][_0x0a9e('0x57')],_0x465003[_0x0a9e('0x35')],_0x465003[_0x0a9e('0x136')]>0x0?ut[_0x0a9e('0x137')](_0x465003[_0x0a9e('0x138')],_0x465003[_0x0a9e('0x136')]):_0x465003['dialOriginateCallerIdNumber']):ut[_0x0a9e('0x135')](_[_0x0a9e('0x72')](_0x465003[_0x0a9e('0x9c')])?_0x465003[_0x0a9e('0x55')]['callerid']:_0x465003['TrunkBackup']['callerid'],_0x465003[_0x0a9e('0x35')],_0x465003['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0x0a9e('0x137')](_0x465003[_0x0a9e('0x138')],_0x465003[_0x0a9e('0x136')]):_0x465003[_0x0a9e('0x138')]);if(_0x1a3143){_0x358f74[_0x0a9e('0x139')]=ut[_0x0a9e('0x13a')](_0x1a3143);_0x358f74[_0x0a9e('0x13b')]=ut[_0x0a9e('0x13c')](_0x1a3143);}var _0x2154d8=ut[_0x0a9e('0x13d')](_0x465003,_0x261eca,_0x3c8a9a,_0x1a3143,_0x43111e,_0x358f74);_['merge'](_0x358f74,ut[_0x0a9e('0x13e')](_0x2154d8));_0x358f74['starttime']=moment()[_0x0a9e('0x5e')]('YYYY-MM-DD\x20HH:mm:ss');ami[_0x0a9e('0x7c')](ut[_0x0a9e('0x13f')](_0x358f74,_0x465003,_0x2154d8,_0x358f74[_0x0a9e('0xae')],_0xa7a754))['then'](function(_0x920ad8){_0x465003[_0x0a9e('0x4f')]+=0x1;logger['info']('[originated][increment]',_0x43111e,_0x0a9e('0xba'),_0x465003[_0x0a9e('0x27')],_0x0a9e('0x75'),_0x465003['originated']);_0x39d367(_0x920ad8);})['catch'](function(_0x4869c1){ut[_0x0a9e('0xfd')](_0x358f74,0xe,_0x0a9e('0x140'));rpcDb[_0x0a9e('0xff')](_0x358f74,_0x0a9e('0x141'));_0x8231e5(_0x4869c1);});});};Preview[_0x0a9e('0xe')][_0x0a9e('0x142')]=function(_0x183b9b){if(this[_0x0a9e('0x15')][_0x183b9b[_0x0a9e('0xaf')]]){this[_0x0a9e('0x15')][_0x183b9b[_0x0a9e('0xaf')]][_0x0a9e('0x143')]=_0x183b9b[_0x0a9e('0x143')];}};Preview[_0x0a9e('0xe')][_0x0a9e('0x19')]=function(_0x1a74c4){var _0x94e69b=this;var _0x320367=this['actions'][_0x1a74c4[_0x0a9e('0x144')]];if(_0x320367){if(_0x320367[_0x0a9e('0x10c')]&&this[_0x0a9e('0x16')][_0x320367[_0x0a9e('0x10c')]]){ut[_0x0a9e('0x145')](_0x320367,this[_0x0a9e('0x16')][_0x320367['lookAgent']][_0x0a9e('0x27')],this[_0x0a9e('0x16')][_0x320367[_0x0a9e('0x10c')]]['id']);}var _0x1109de=_[_0x0a9e('0x146')](_0x320367);_0x1109de[_0x0a9e('0xb6')]=moment()[_0x0a9e('0x5e')](_0x0a9e('0xb5'));var _0x4175a6=_0x94e69b['campaignsPreview'][_0x320367['queue']];if(ut[_0x0a9e('0x147')](_0x1a74c4[_0x0a9e('0x148')])){if(_0x320367['unlockAgent']){rpcDb[_0x0a9e('0x149')](_0x320367[_0x0a9e('0xb1')]);}if(_0x320367['activeContact']){rpcDb[_0x0a9e('0x8d')](_0x320367['idContact']);}ami[_0x0a9e('0x5f')](_0x0a9e('0x14a'),ut['buildObj'](_0x320367,_0x0a9e('0x14b'),this[_0x0a9e('0x12')][_0x320367['queue']]));this[_0x0a9e('0xfa')](_0x1109de,_0x4175a6,_0x1a74c4);}else{_0x320367[_0x0a9e('0x8e')]=moment()['format'](_0x0a9e('0xb5'));ut[_0x0a9e('0xfd')](_0x1109de,0x4,_0x0a9e('0xc2'));rpcDb[_0x0a9e('0xff')](_0x1109de,_0x0a9e('0x14c'));}}};Preview[_0x0a9e('0xe')]['syncHangup']=function(_0x1e5b09){var _0x36dc4f=this;var _0x51e697=this[_0x0a9e('0x15')][_0x1e5b09[_0x0a9e('0xaf')]];var _0x22c390;if(_0x51e697){_0x22c390=this[_0x0a9e('0x12')][_0x51e697[_0x0a9e('0x74')]];logger[_0x0a9e('0x5c')](_0x0a9e('0x14d'),_0x1e5b09['linkedid'],'\x20Queue',_0x22c390['name'],'pTalking:\x20',_0x22c390['pTalking']);}if(this[_0x0a9e('0x15')][_0x1e5b09[_0x0a9e('0xaf')]]&&_0x1e5b09['linkedid']!==_0x1e5b09['uniqueid']){if(_0x1e5b09[_0x0a9e('0x14e')]==='16'&&this['actions'][_0x1e5b09[_0x0a9e('0xaf')]][_0x0a9e('0x77')]){this[_0x0a9e('0x9f')](_0x1e5b09,_0x1e5b09[_0x0a9e('0xaf')],_0x1e5b09[_0x0a9e('0x14e')]);}else if(this[_0x0a9e('0x15')][_0x1e5b09['linkedid']][_0x0a9e('0x77')]){logger[_0x0a9e('0x5c')]('[syncHangup][talking][cause]',_0x1e5b09[_0x0a9e('0xaf')],_0x1e5b09[_0x0a9e('0x14e')],_0x0a9e('0xba'),_0x22c390[_0x0a9e('0x27')],_0x0a9e('0x76'),_0x22c390[_0x0a9e('0x2b')]);this[_0x0a9e('0x9f')](_0x1e5b09,_0x1e5b09['linkedid'],_0x1e5b09[_0x0a9e('0x14e')]);}}else if(_0x51e697&&_['isNil'](_0x51e697[_0x0a9e('0x14f')])&&_0x22c390[_0x0a9e('0x150')]&&_0x1e5b09['linkedid']===_0x1e5b09[_0x0a9e('0xb9')]&&_[_0x0a9e('0x72')](_0x1e5b09['reason'])&&_0x1e5b09[_0x0a9e('0x14e')]==='16'&&_0x1e5b09['channelstate']==='6'&&_[_0x0a9e('0xfb')](_0x51e697[_0x0a9e('0x151')])){if(_0x51e697['unlockAgent']){rpcDb[_0x0a9e('0x149')](_0x51e697['idContact']);}if(_0x51e697[_0x0a9e('0xae')]){rpcDb[_0x0a9e('0x8d')](_0x51e697[_0x0a9e('0xb1')]);}_0x1e5b09[_0x0a9e('0xfc')]='22';this[_0x0a9e('0xfa')](_0x51e697,_0x22c390,_0x1e5b09);}else if(_0x51e697&&_0x51e697[_0x0a9e('0x151')]){if(_0x1e5b09[_0x0a9e('0x14e')]==='16'&&this['actions'][_0x1e5b09[_0x0a9e('0xaf')]][_0x0a9e('0x77')]){logger[_0x0a9e('0x5c')](_0x0a9e('0x152'),_0x1e5b09[_0x0a9e('0xaf')],_0x1e5b09['cause'],_0x0a9e('0xba'),_0x22c390['name'],'pTalking:\x20',_0x22c390[_0x0a9e('0x2b')]);this['callProgressDetectingCustomer'](_0x1e5b09,_0x1e5b09[_0x0a9e('0xaf')],_0x1e5b09[_0x0a9e('0x14e')]);}else if(this['actions'][_0x1e5b09[_0x0a9e('0xaf')]][_0x0a9e('0x77')]){logger[_0x0a9e('0x5c')](_0x0a9e('0x153'),_0x1e5b09[_0x0a9e('0xaf')],_0x1e5b09[_0x0a9e('0x14e')],_0x0a9e('0xba'),_0x22c390[_0x0a9e('0x27')],_0x0a9e('0x76'),_0x22c390['pTalking']);this[_0x0a9e('0x9f')](_0x1e5b09,_0x1e5b09[_0x0a9e('0xaf')],_0x1e5b09[_0x0a9e('0x14e')]);}}};Preview[_0x0a9e('0xe')]['syncDialEnd']=function(_0x38d95a){if(this[_0x0a9e('0x15')][_0x38d95a[_0x0a9e('0xf9')]]&&_0x38d95a['destlinkedid']!==_0x38d95a[_0x0a9e('0x154')]){this[_0x0a9e('0x9f')](_0x38d95a,_0x38d95a[_0x0a9e('0xf9')],_0x38d95a['dialstatus']);}};Preview[_0x0a9e('0xe')]['syncHangupRequest']=function(_0x2394f2){if(this[_0x0a9e('0x15')][_0x2394f2[_0x0a9e('0xaf')]]&&_0x2394f2[_0x0a9e('0xaf')]!==_0x2394f2[_0x0a9e('0xb9')]&&!this[_0x0a9e('0x15')][_0x2394f2[_0x0a9e('0xaf')]]['dialAnswer']){if(_0x2394f2[_0x0a9e('0x14e')]==='1'){this[_0x0a9e('0x9f')](_0x2394f2,_0x2394f2[_0x0a9e('0xaf')],_0x2394f2[_0x0a9e('0x14e')]);}}};Preview[_0x0a9e('0xe')][_0x0a9e('0x155')]=function(_0x3a4def,_0x2670f5,_0x2310ca){if(this[_0x0a9e('0x15')][_0x3a4def]){if(_[_0x0a9e('0x72')](this[_0x0a9e('0x15')][_0x3a4def][_0x0a9e('0x156')])){this[_0x0a9e('0x15')][_0x3a4def][_0x0a9e('0x156')]={};}this[_0x0a9e('0x15')][_0x3a4def][_0x0a9e('0x156')][_0x2670f5]=_0x2310ca;}};Preview[_0x0a9e('0xe')][_0x0a9e('0x21')]=function(_0x611e46){try{if(!_[_0x0a9e('0x72')](_0x611e46)){if(ut[_0x0a9e('0x157')](_[_0x0a9e('0x158')](_0x611e46['variable'])[0x0])){this[_0x0a9e('0x155')](_0x611e46[_0x0a9e('0xb9')],_[_0x0a9e('0x158')](_0x611e46['variable'])[0x0],_0x611e46[_0x0a9e('0x159')]);}}}catch(_0x4c925e){logger[_0x0a9e('0x15a')](_0x0a9e('0x15b'),util[_0x0a9e('0x15c')](_0x4c925e,{'showHidden':![],'depth':null}));}};Preview[_0x0a9e('0xe')][_0x0a9e('0x23')]=function(_0xb09ef6){if(_0xb09ef6){if(this[_0x0a9e('0x15')][_0xb09ef6[_0x0a9e('0x15d')]]){this['actions'][_0xb09ef6[_0x0a9e('0x15d')]][_0x0a9e('0x151')]=!![];}}};Preview['prototype'][_0x0a9e('0x25')]=function(_0x2db8fe){if(_0x2db8fe){if(this[_0x0a9e('0x15')][_0x2db8fe['transfererlinkedid']]){this[_0x0a9e('0x15')][_0x2db8fe[_0x0a9e('0x15e')]][_0x0a9e('0x151')]=!![];}}};module[_0x0a9e('0x15f')]=Preview;
\ No newline at end of file
index 927d2c5..d54d06c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2e16=['create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','../../../config/logger','preview','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/agentReportPreview','error','inspect','resolve','then','createHistory','catch','[createHistory]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','createAgentHistory','createCustomerHistory','rescheduleContact','UserId','active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','disableContact','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','membername','context','from-sip','assigned','lastAssignedTo','COMPLETED'];(function(_0x8585ff,_0x9232d){var _0x3ff111=function(_0x1c40bc){while(--_0x1c40bc){_0x8585ff['push'](_0x8585ff['shift']());}};_0x3ff111(++_0x9232d);}(_0x2e16,0xe2));var _0x62e1=function(_0x3e4b50,_0x17ca32){_0x3e4b50=_0x3e4b50-0x0;var _0x1a0678=_0x2e16[_0x3e4b50];return _0x1a0678;};'use strict';var util=require(_0x62e1('0x0'));var BPromise=require('bluebird');var logger=require(_0x62e1('0x1'))(_0x62e1('0x2'));var _=require('lodash');var cmHopper=require(_0x62e1('0x3'));var cmHopperFinal=require(_0x62e1('0x4'));var cmHopperHistory=require(_0x62e1('0x5'));var cmHopperBlack=require(_0x62e1('0x6'));var voiceQueueRt=require('../rpc/voiceQueueRt');var agentReportPreview=require(_0x62e1('0x7'));var voiceQueueReport=require('../rpc/voiceQueueReport');function loggerCatch(_0x9d1423){return function(_0x267533){logger[_0x62e1('0x8')](_0x9d1423,util[_0x62e1('0x9')](_0x267533,{'showHidden':![],'depth':null}));};}function create(_0x127bc){return BPromise[_0x62e1('0xa')]()[_0x62e1('0xb')](cmHopperHistory[_0x62e1('0xc')](_0x127bc))[_0x62e1('0xd')](loggerCatch(_0x62e1('0xe')));}function createAgent(_0x42ed51){return BPromise['resolve']()[_0x62e1('0xb')](agentReportPreview['createHistory'](_0x42ed51))['catch'](loggerCatch('[createHistory]\x20'));}function moveContact(_0xc4a0e1){return BPromise[_0x62e1('0xa')]()[_0x62e1('0xb')](cmHopper[_0x62e1('0xf')](_0xc4a0e1,!![]))[_0x62e1('0xd')](loggerCatch(_0x62e1('0x10')));}exports[_0x62e1('0x11')]=function(_0x1b7d57){return BPromise[_0x62e1('0xa')]()[_0x62e1('0xb')](cmHopperBlack[_0x62e1('0x11')](_0x1b7d57))[_0x62e1('0xd')](loggerCatch(_0x62e1('0x12')));};exports['getContactPreview']=function(_0x155a31){return BPromise[_0x62e1('0xa')]()[_0x62e1('0xb')](cmHopper['getContactPreview'](_0x155a31))[_0x62e1('0xd')](loggerCatch('[getContactPreview]\x20'));};exports[_0x62e1('0xc')]=function(_0x435d32,_0x477ac6){create(_0x435d32)[_0x62e1('0xd')](loggerCatch(_0x477ac6));moveContact(_0x435d32)['catch'](loggerCatch(_0x477ac6));};exports[_0x62e1('0x13')]=function(_0xfcbc3b,_0x4681ee){createAgent(_0xfcbc3b)[_0x62e1('0xd')](loggerCatch(_0x4681ee));};exports[_0x62e1('0x14')]=function(_0x425ca0,_0x48b474){create(_0x425ca0)[_0x62e1('0xd')](loggerCatch(_0x48b474));};exports['createCustomerFinal']=function(_0x56a70c,_0xfbe323){moveContact(_0x56a70c)['catch'](loggerCatch(_0xfbe323));};exports[_0x62e1('0x15')]=function(_0x14a6c5,_0xb23d95,_0x50e25e){if(_0xb23d95){_0x14a6c5[_0x62e1('0x16')]=null;}if(_0x50e25e){_0x14a6c5[_0x62e1('0x17')]=![];}return BPromise[_0x62e1('0xa')]()[_0x62e1('0xb')](cmHopper[_0x62e1('0x15')](_0x14a6c5))[_0x62e1('0xd')](loggerCatch(_0x62e1('0x18')));};exports['countReScheduled']=function(_0x554e39){return BPromise[_0x62e1('0xa')]()[_0x62e1('0xb')](cmHopper[_0x62e1('0x19')](_0x554e39))['catch'](loggerCatch(_0x62e1('0x1a')));};exports[_0x62e1('0x1b')]=function(_0x7e3e18){return BPromise[_0x62e1('0xa')]()[_0x62e1('0xb')](cmHopper['unlockContact']({'UserId':null},_0x7e3e18,0x1))[_0x62e1('0xd')](loggerCatch(_0x62e1('0x1c')));};exports[_0x62e1('0x1d')]=function(_0xc39b12){return BPromise[_0x62e1('0xa')]()[_0x62e1('0xb')](cmHopper[_0x62e1('0x1b')]({'active':![]},_0xc39b12,0x1))[_0x62e1('0xd')](loggerCatch('[activeContact]\x20'));};exports[_0x62e1('0x1e')]=function(_0x5de03d){var _0x1df336={};_0x1df336[_0x62e1('0x1f')]=_0x5de03d[_0x62e1('0x1f')];_0x1df336['uniqueid']=_0x5de03d[_0x62e1('0x20')];_0x1df336['calleridnum']=_0x5de03d[_0x62e1('0x21')];_0x1df336[_0x62e1('0x22')]=_0x5de03d[_0x62e1('0x22')];_0x1df336[_0x62e1('0x23')]=_0x5de03d[_0x62e1('0x23')];_0x1df336[_0x62e1('0x24')]=_0x5de03d[_0x62e1('0x25')];_0x1df336[_0x62e1('0x26')]=_0x5de03d[_0x62e1('0x25')];_0x1df336[_0x62e1('0x27')]=0x1;_0x1df336[_0x62e1('0x28')]=_0x5de03d[_0x62e1('0x29')];_0x1df336[_0x62e1('0x2a')]=_0x5de03d[_0x62e1('0x2b')];_0x1df336[_0x62e1('0x2c')]=_0x62e1('0x2d');_0x1df336['exten']='xcally-motion-preview';_0x1df336['holdtime']=0x0;_0x1df336[_0x62e1('0x2e')]=0x1;_0x1df336[_0x62e1('0x2f')]=_0x5de03d['membername'];_0x1df336['queuecallerexitreason']=_0x62e1('0x30');return BPromise['resolve']()[_0x62e1('0xb')](voiceQueueReport[_0x62e1('0x31')](_0x1df336))['catch'](loggerCatch(_0x62e1('0x32')));};exports['getContactRecallMe']=function(_0xef9d12,_0x50222f){return BPromise['resolve']()['then'](cmHopper[_0x62e1('0x33')](_0xef9d12,_0x50222f))[_0x62e1('0xd')](loggerCatch(_0x62e1('0x34')));};exports[_0x62e1('0x35')]=function(_0x339b14){return BPromise[_0x62e1('0xa')]()[_0x62e1('0xb')](cmHopper[_0x62e1('0x15')](_0x339b14,!![],!![]))['catch'](loggerCatch(_0x62e1('0x36')));};
\ No newline at end of file
+var _0x9b89=['rescheduleContact','countReScheduled','unlockContact','[unlockContact]\x20','[activeContact]\x20','crateCustomerReportQueue','uniqueid','calleridnum','calleridname','queue','answertime','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','context','from-sip','exten','xcally-motion-preview','holdtime','assigned','lastAssignedTo','membername','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','[GetContactRecallMe]\x20','util','bluebird','../../../config/logger','preview','lodash','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/agentReportPreview','error','inspect','resolve','catch','[createHistory]\x20','then','createHistory','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createCustomerFinal'];(function(_0x55ee69,_0x3eec19){var _0x2b9aef=function(_0xd8b357){while(--_0xd8b357){_0x55ee69['push'](_0x55ee69['shift']());}};_0x2b9aef(++_0x3eec19);}(_0x9b89,0x87));var _0x99b8=function(_0xadaa,_0x501ab2){_0xadaa=_0xadaa-0x0;var _0x3d71d6=_0x9b89[_0xadaa];return _0x3d71d6;};'use strict';var util=require(_0x99b8('0x0'));var BPromise=require(_0x99b8('0x1'));var logger=require(_0x99b8('0x2'))(_0x99b8('0x3'));var _=require(_0x99b8('0x4'));var cmHopper=require(_0x99b8('0x5'));var cmHopperFinal=require('../rpc/cmHopperFinal');var cmHopperHistory=require(_0x99b8('0x6'));var cmHopperBlack=require(_0x99b8('0x7'));var voiceQueueRt=require(_0x99b8('0x8'));var agentReportPreview=require(_0x99b8('0x9'));var voiceQueueReport=require('../rpc/voiceQueueReport');function loggerCatch(_0x57686f){return function(_0x2f9c91){logger[_0x99b8('0xa')](_0x57686f,util[_0x99b8('0xb')](_0x2f9c91,{'showHidden':![],'depth':null}));};}function create(_0x1f60c1){return BPromise[_0x99b8('0xc')]()['then'](cmHopperHistory['createHistory'](_0x1f60c1))[_0x99b8('0xd')](loggerCatch(_0x99b8('0xe')));}function createAgent(_0x19c799){return BPromise[_0x99b8('0xc')]()[_0x99b8('0xf')](agentReportPreview[_0x99b8('0x10')](_0x19c799))[_0x99b8('0xd')](loggerCatch(_0x99b8('0xe')));}function moveContact(_0x1ae478){return BPromise[_0x99b8('0xc')]()['then'](cmHopper[_0x99b8('0x11')](_0x1ae478,!![]))[_0x99b8('0xd')](loggerCatch(_0x99b8('0x12')));}exports[_0x99b8('0x13')]=function(_0x1cd535){return BPromise[_0x99b8('0xc')]()[_0x99b8('0xf')](cmHopperBlack['checkIsBlackList'](_0x1cd535))['catch'](loggerCatch(_0x99b8('0x14')));};exports['getContactPreview']=function(_0x4e50ae){return BPromise['resolve']()['then'](cmHopper[_0x99b8('0x15')](_0x4e50ae))['catch'](loggerCatch(_0x99b8('0x16')));};exports[_0x99b8('0x10')]=function(_0xa8d625,_0x55558b){create(_0xa8d625)['catch'](loggerCatch(_0x55558b));moveContact(_0xa8d625)['catch'](loggerCatch(_0x55558b));};exports['createAgentHistory']=function(_0x444388,_0x2e0e0b){createAgent(_0x444388)[_0x99b8('0xd')](loggerCatch(_0x2e0e0b));};exports['createCustomerHistory']=function(_0xad3af6,_0x173d2c){create(_0xad3af6)[_0x99b8('0xd')](loggerCatch(_0x173d2c));};exports[_0x99b8('0x17')]=function(_0x47f359,_0x818794){moveContact(_0x47f359)[_0x99b8('0xd')](loggerCatch(_0x818794));};exports[_0x99b8('0x18')]=function(_0x1a9606,_0x463de1,_0x30f3dd){if(_0x463de1){_0x1a9606['UserId']=null;}if(_0x30f3dd){_0x1a9606['active']=![];}return BPromise[_0x99b8('0xc')]()['then'](cmHopper[_0x99b8('0x18')](_0x1a9606))['catch'](loggerCatch('[rescheduleContact]\x20'));};exports[_0x99b8('0x19')]=function(_0x10d287){return BPromise[_0x99b8('0xc')]()[_0x99b8('0xf')](cmHopper[_0x99b8('0x19')](_0x10d287))[_0x99b8('0xd')](loggerCatch('[countReScheduled]\x20'));};exports[_0x99b8('0x1a')]=function(_0x40164e){return BPromise[_0x99b8('0xc')]()[_0x99b8('0xf')](cmHopper[_0x99b8('0x1a')]({'UserId':null},_0x40164e,0x1))[_0x99b8('0xd')](loggerCatch(_0x99b8('0x1b')));};exports['disableContact']=function(_0x268868){return BPromise[_0x99b8('0xc')]()['then'](cmHopper[_0x99b8('0x1a')]({'active':![]},_0x268868,0x1))[_0x99b8('0xd')](loggerCatch(_0x99b8('0x1c')));};exports[_0x99b8('0x1d')]=function(_0x584d80){var _0x3c434d={};_0x3c434d['type']=_0x584d80['type'];_0x3c434d[_0x99b8('0x1e')]=_0x584d80['uniqueid'];_0x3c434d[_0x99b8('0x1f')]=_0x584d80[_0x99b8('0x1f')];_0x3c434d[_0x99b8('0x20')]=_0x584d80[_0x99b8('0x20')];_0x3c434d['queue']=_0x584d80[_0x99b8('0x21')];_0x3c434d['queuecallerjoinAt']=_0x584d80[_0x99b8('0x22')];_0x3c434d[_0x99b8('0x23')]=_0x584d80[_0x99b8('0x22')];_0x3c434d[_0x99b8('0x24')]=0x1;_0x3c434d[_0x99b8('0x25')]=_0x584d80[_0x99b8('0x26')];_0x3c434d[_0x99b8('0x27')]=_0x584d80['membername'];_0x3c434d[_0x99b8('0x28')]=_0x99b8('0x29');_0x3c434d[_0x99b8('0x2a')]=_0x99b8('0x2b');_0x3c434d[_0x99b8('0x2c')]=0x0;_0x3c434d[_0x99b8('0x2d')]=0x1;_0x3c434d[_0x99b8('0x2e')]=_0x584d80[_0x99b8('0x2f')];_0x3c434d[_0x99b8('0x30')]=_0x99b8('0x31');return BPromise['resolve']()['then'](voiceQueueReport[_0x99b8('0x32')](_0x3c434d))[_0x99b8('0xd')](loggerCatch(_0x99b8('0x33')));};exports['getContactRecallMe']=function(_0x3f76e6,_0x2e35aa){return BPromise[_0x99b8('0xc')]()[_0x99b8('0xf')](cmHopper['getContactRecallMe'](_0x3f76e6,_0x2e35aa))[_0x99b8('0xd')](loggerCatch(_0x99b8('0x34')));};exports['rescheduleContactInQueue']=function(_0x4d0113){return BPromise[_0x99b8('0xc')]()[_0x99b8('0xf')](cmHopper[_0x99b8('0x18')](_0x4d0113,!![],!![]))[_0x99b8('0xd')](loggerCatch('[rescheduleContactInQueue]\x20'));};
\ No newline at end of file
index 90f55ea..7352216 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdc19=['moment','../../../../config/logger','preview','env','XCALLY_IP_AGI','127.0.0.1','milliseconds','diff','loggerCatch','inspect','logger','loggerError','error','logger2','info','message','getCallerId','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','isNil','addVariables','Queue','name','calleridname','calleridnum','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','originatecalleridname','xcally-motion-preview','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','tags','createdAt','updatedAt','%s%s','XMD-','toLowerVariables','toLower','updateOriginated','originated','[updateOriginated]\x20is\x20null\x20or\x20undefined','YYYY-MM-DD\x20HH:mm:ss','state','Blacklist','starttime','responsetime','endtime','logAgent','statedesc','ringtime','membername','answertime','Failure','variablesAction','BOOKED','channelAgent','from-sip','timeout','uniqueid','totalGlobal','countcongestionretry','countnoanswerretry','countagentrejectretry','cloneAction','clone','Global','active','scheduledat','minutes','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','buildObj','lastevent','queue','voice','mandatoryDisposition','buildAcw','interface','not_inuse','status','push','getDiff','seconds','createBody','CampaignId','idContact','type','dialAnswer','countbusyretry','countglobal','callbackat','recallme','UserId','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-contactid','xmd-cdrtype','xmd-agiafter','xmd-agi','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','bridgepeer','bridgepvtcallid','getCallerIdRandom','pow','replace','random','extractCalleridName','match','extractCalleridNumber','util','lodash'];(function(_0x5c9f1e,_0xeb543d){var _0x14ce1f=function(_0x103f12){while(--_0x103f12){_0x5c9f1e['push'](_0x5c9f1e['shift']());}};_0x14ce1f(++_0xeb543d);}(_0xdc19,0x90));var _0x9dc1=function(_0x282dda,_0x5e014d){_0x282dda=_0x282dda-0x0;var _0x19e41b=_0xdc19[_0x282dda];return _0x19e41b;};'use strict';var util=require(_0x9dc1('0x0'));var _=require(_0x9dc1('0x1'));var moment=require(_0x9dc1('0x2'));var logger=require(_0x9dc1('0x3'))(_0x9dc1('0x4'));var ipAgi=process[_0x9dc1('0x5')][_0x9dc1('0x6')]||_0x9dc1('0x7');function getSeconds(_0x5c13a9,_0x1fbab1){var _0x5a4696=moment(_0x5c13a9)[_0x9dc1('0x8')](0x0);var _0x56e8a4=moment(_0x1fbab1)[_0x9dc1('0x8')](0x0);return _0x5a4696[_0x9dc1('0x9')](_0x56e8a4,'seconds');}exports[_0x9dc1('0xa')]=function(_0x68d55c){return function(_0x4d2151){logger['error'](_0x68d55c,util[_0x9dc1('0xb')](_0x4d2151,{'showHidden':![],'depth':null}));};};exports[_0x9dc1('0xc')]=function(_0x420f5b,_0x1b4c55){logger['info'](_0x420f5b,util[_0x9dc1('0xb')](_0x1b4c55,{'showHidden':![],'depth':null}));};exports[_0x9dc1('0xd')]=function(_0x1ae963,_0x6e1fb){logger[_0x9dc1('0xe')](_0x1ae963,util[_0x9dc1('0xb')](_0x6e1fb,{'showHidden':![],'depth':null}));};exports[_0x9dc1('0xf')]=function(_0x384590){return function(_0x43e6a3){logger[_0x9dc1('0x10')](_0x384590,util[_0x9dc1('0xb')](_0x43e6a3,{'showHidden':![],'depth':null}));};};exports[_0x9dc1('0x11')]=function(_0x5285b5,_0x49ce5b,_0x2a6d6d){return{'message':_0x5285b5,'unlock':_0x49ce5b,'active':_0x2a6d6d};};exports[_0x9dc1('0x12')]=function(_0xa0e977,_0x4c30c2,_0x5d4e88){if(!_[_0x9dc1('0x13')](_0x5d4e88)&&_0x9dc1('0x14')===typeof _0x5d4e88&&!_['isEmpty'](_0x5d4e88)){if(!_[_0x9dc1('0x13')](_0x4c30c2)&&_0x9dc1('0x14')===typeof _0x4c30c2&&!_[_0x9dc1('0x15')](_0x4c30c2)){return util[_0x9dc1('0x16')](_0x9dc1('0x17'),_0x4c30c2,_0x5d4e88);}return util[_0x9dc1('0x16')](_0x9dc1('0x17'),_0x5d4e88,_0x5d4e88);}if(!_['isUndefined'](_0xa0e977)&&'string'===typeof _0xa0e977&&!_['isEmpty'](_0xa0e977)){return _0xa0e977;}return _0x9dc1('0x18');};exports[_0x9dc1('0x19')]=function(_0xf011da){if(_[_0x9dc1('0x1a')](_0xf011da)){return![];}return _0xf011da;};exports[_0x9dc1('0x1b')]=function(_0x1675da,_0x3fd455,_0x1fead0,_0x7ea95f,_0x40b482,_0x3146c1){var _0x132200={'XMD-QUEUE':_0x3fd455[_0x9dc1('0x1c')]?_0x3fd455[_0x9dc1('0x1c')][_0x9dc1('0x1d')]:'','XMD-CALLERID':_0x7ea95f,'XMD-CALLERID-PREVIEW':_0x3146c1?util['format'](_0x9dc1('0x17'),_0x3146c1[_0x9dc1('0x1e')],_0x3146c1[_0x9dc1('0x1f')]):_0x7ea95f,'XMD-DIALID':_0x40b482,'XMD-CONTACTID':_0x3fd455[_0x9dc1('0x20')],'XMD-CDRTYPE':_0x9dc1('0x21'),'CALLERID(all)':_0x7ea95f,'XMD-VOICEQUEUEID':_0x3fd455[_0x9dc1('0x22')],'XMD-DIALCHANNEL':_0x1fead0,'XMD-DIALTIMEOUT':_0x1675da[_0x9dc1('0x23')]||0x1e,'XMD-DIALOPTIONS':util[_0x9dc1('0x16')](_0x9dc1('0x24'),_0x1675da[_0x9dc1('0x25')]?'g':'',_['isEmpty'](_0x1675da[_0x9dc1('0x26')])?'':_0x9dc1('0x27')),'XMD-DIALURL':_0x1675da[_0x9dc1('0x28')]||'','XMD-AGI':_0x1675da[_0x9dc1('0x29')]?util['format'](_0x9dc1('0x2a'),ipAgi,_0x1675da[_0x9dc1('0x29')]):'NONE','XMD-AGIAFTER':_0x1675da[_0x9dc1('0x25')]?util[_0x9dc1('0x16')](_0x9dc1('0x2a'),ipAgi,_0x1675da['dialQueueProject2']):_0x9dc1('0x2b'),'XMD-ORIGINATECALLERIDNUM':_0x3146c1?_0x3146c1[_0x9dc1('0x2c')]:'','XMD-ORIGINATECALLERIDNAME':_0x3146c1?_0x3146c1[_0x9dc1('0x2d')]:'','XMD-DESTINATION':_0x9dc1('0x2e'),'SIPADDHEADER':'Call-Type:\x20PREVIEW'};if(!_[_0x9dc1('0x15')](_0x1675da[_0x9dc1('0x26')])){_0x132200[util[_0x9dc1('0x16')]('%s',_0x9dc1('0x2f'))]=_0x1675da[_0x9dc1('0x26')];_0x132200[util[_0x9dc1('0x16')]('%s',_0x9dc1('0x30'))]=_0x40b482;}if(_0x3fd455&&_0x3fd455[_0x9dc1('0x31')]){for(var _0x2c3e48 in _0x3fd455[_0x9dc1('0x31')]){if(_0x3fd455['Contact'][_0x9dc1('0x32')](_0x2c3e48)){if(!_[_0x9dc1('0x1a')](_0x3fd455[_0x9dc1('0x31')][_0x2c3e48])&&_0x2c3e48!=='id'&&_0x2c3e48!==_0x9dc1('0x33')&&_0x2c3e48!==_0x9dc1('0x34')&&_0x2c3e48!==_0x9dc1('0x35')){_0x132200[util[_0x9dc1('0x16')](_0x9dc1('0x36'),_0x9dc1('0x37'),_['toUpper'](_0x2c3e48))]=_0x3fd455[_0x9dc1('0x31')][_0x2c3e48];}}}}return _0x132200;};exports[_0x9dc1('0x38')]=function(_0x4e8b22){var _0x22e8d0={};for(var _0x58ec4d in _0x4e8b22){if(_0x4e8b22[_0x9dc1('0x32')](_0x58ec4d)){_0x22e8d0[util[_0x9dc1('0x16')]('%s',_[_0x9dc1('0x39')](_0x58ec4d))]=_0x4e8b22[_0x58ec4d];}}return{'variables':_0x22e8d0};};exports[_0x9dc1('0x3a')]=function(_0x284092,_0x412b7b){if(!_[_0x9dc1('0x1a')](_0x284092)){if(_0x284092[_0x9dc1('0x32')]('originated')){if(_0x284092['originated']>0x0){_0x284092[_0x9dc1('0x3b')]-=0x1;}else{logger['error']('[updateOriginated]\x20object\x20originated\x20is\x20negative',_0x412b7b);}}}else{logger[_0x9dc1('0xe')](_0x9dc1('0x3c'),_0x412b7b);}};exports['logBlacklist']=function(_0x5ce3fb){var _0x239b22=moment()[_0x9dc1('0x16')](_0x9dc1('0x3d'));_0x5ce3fb[_0x9dc1('0x3e')]=0xd;_0x5ce3fb['statedesc']=_0x9dc1('0x3f');_0x5ce3fb[_0x9dc1('0x40')]=_0x239b22;_0x5ce3fb[_0x9dc1('0x41')]=_0x239b22;_0x5ce3fb[_0x9dc1('0x42')]=_0x239b22;};exports[_0x9dc1('0x43')]=function(_0x3206dc,_0x1630a6,_0x3c8450){var _0x9e2131=moment()[_0x9dc1('0x16')]('YYYY-MM-DD\x20HH:mm:ss');_0x3206dc['state']=_0x1630a6;_0x3206dc[_0x9dc1('0x44')]=_0x3c8450;_0x3206dc[_0x9dc1('0x41')]=_0x9e2131;_0x3206dc[_0x9dc1('0x45')]=getSeconds(_0x3206dc[_0x9dc1('0x41')],_0x3206dc['starttime']);};exports['logLookAgent']=function(_0x52f8c1,_0x5c4c47,_0x36caab){_0x52f8c1[_0x9dc1('0x46')]=_0x5c4c47;_0x52f8c1['UserId']=_0x36caab;};exports['logCustomer']=function(_0x14101e,_0x42440e,_0x2bf627){var _0x2ff3fd=moment()[_0x9dc1('0x16')](_0x9dc1('0x3d'));_0x14101e['state']=_0x42440e;_0x14101e[_0x9dc1('0x44')]=_0x2bf627;_0x14101e[_0x9dc1('0x41')]=_0x14101e[_0x9dc1('0x41')]?_0x14101e[_0x9dc1('0x41')]:_0x2ff3fd;_0x14101e[_0x9dc1('0x42')]=_0x14101e['endtime']?_0x14101e[_0x9dc1('0x42')]:_0x2ff3fd;_0x14101e[_0x9dc1('0x45')]=getSeconds(_0x14101e['responsetime']||0x0,_0x14101e['starttime']||0x0);_0x14101e['talktime']=_0x14101e[_0x9dc1('0x47')]?getSeconds(_0x14101e[_0x9dc1('0x42')],_0x14101e['answertime']):0x0;};exports['isFailure']=function(_0x2fa1c9){return _0x2fa1c9===_0x9dc1('0x48');};exports[_0x9dc1('0x49')]=function(_0x58248c,_0x3e4e59,_0x2d1243,_0x1ca828,_0x3fe070){var _0xc958c2=_0x1ca828?'RECALL':_0x58248c['calleridname'];_0xc958c2=_0x3fe070?_0x9dc1('0x4a'):_0xc958c2;return{'actionid':_0x58248c['uniqueid'],'action':'originate','channel':_0x58248c[_0x9dc1('0x4b')],'callerid':util[_0x9dc1('0x16')](_0x9dc1('0x17'),_0xc958c2,_0x58248c['calleridnum']),'Exten':_0x9dc1('0x2e'),'Context':_0x9dc1('0x4c'),'Priority':'1','variable':_0x2d1243,'timeout':(_0x3e4e59[_0x9dc1('0x4d')]||0x1e)*0x3e8,'async':!![],'channelid':_0x58248c[_0x9dc1('0x4e')]};};exports[_0x9dc1('0x4f')]=function(_0x1c375e){return _0x1c375e['countbusyretry']+_0x1c375e[_0x9dc1('0x50')]+_0x1c375e[_0x9dc1('0x51')]+_0x1c375e[_0x9dc1('0x52')]+_0x1c375e['countnosuchnumberretry'];};exports[_0x9dc1('0x53')]=function(_0x3b351f){var _0x6a0a89=_[_0x9dc1('0x54')](_0x3b351f);_0x6a0a89[_0x9dc1('0x3e')]=0xf;_0x6a0a89['statedesc']=_0x9dc1('0x55');return _0x6a0a89;};exports['scheduledAt']=function(_0x42eb37,_0x139b37,_0x53a2ca){var _0x5ca60a={};_0x5ca60a[_0x139b37]=_0x42eb37[_0x139b37];_0x5ca60a[_0x9dc1('0x56')]=![];_0x5ca60a[_0x9dc1('0x57')]=moment()['add'](_0x53a2ca,_0x9dc1('0x58'))[_0x9dc1('0x16')](_0x9dc1('0x3d'));_0x5ca60a[_0x9dc1('0x20')]=_0x42eb37[_0x9dc1('0x20')];_0x5ca60a[_0x9dc1('0x59')]=_0x42eb37[_0x9dc1('0x59')];_0x5ca60a['VoiceQueueId']=_0x42eb37[_0x9dc1('0x22')]||undefined;return _0x5ca60a;};exports[_0x9dc1('0x5a')]=function(_0x3d5148,_0x5ca165){if(!_[_0x9dc1('0x1a')](_0x3d5148)){if(_0x3d5148[_0x9dc1('0x5b')]>0x0){_0x3d5148[_0x9dc1('0x5b')]-=0x1;}else{logger[_0x9dc1('0xe')](_0x5ca165,_0x9dc1('0x5c'));}}else{logger['error'](_0x5ca165,_0x9dc1('0x5d'));}};exports[_0x9dc1('0x5e')]=function(_0x41c947){if(_0x41c947<=0x0){return!![];}return![];};exports[_0x9dc1('0x5f')]=function(_0x1668ee,_0x18bca5,_0x54268f){_0x1668ee[_0x9dc1('0x60')]=_0x18bca5;_0x1668ee['name']=_0x1668ee[_0x9dc1('0x61')];_0x1668ee['interface']=_0x1668ee[_0x9dc1('0x4b')];_0x1668ee['motionChannel']=_0x9dc1('0x62');if(_0x54268f){_0x1668ee[_0x9dc1('0x63')]=_0x54268f['mandatoryDisposition'];}return _0x1668ee;};exports[_0x9dc1('0x64')]=function(_0x5e50e9){var _0x4880e7={};_0x4880e7[_0x9dc1('0x61')]=_0x5e50e9['queue'];_0x4880e7[_0x9dc1('0x65')]=_0x5e50e9[_0x9dc1('0x4b')];_0x4880e7[_0x9dc1('0x4e')]=_0x5e50e9[_0x9dc1('0x4e')];return _0x4880e7;};exports['agentReadyId']=function(_0x113fa7){var _0x326fb9=[];for(var _0x3685cf in _0x113fa7){if(_0x113fa7[_0x9dc1('0x32')](_0x3685cf)){if(!_[_0x9dc1('0x1a')](_0x113fa7[_0x3685cf])&&_0x113fa7[_0x3685cf]['state']===_0x9dc1('0x66')&&_0x113fa7[_0x3685cf][_0x9dc1('0x67')]==='reachable'){_0x326fb9[_0x9dc1('0x68')](_0x113fa7[_0x3685cf]['id']);}}}return _0x326fb9;};exports[_0x9dc1('0x69')]=function(_0x1f6ed5){var _0x1dea68=moment()[_0x9dc1('0x8')](0x0);var _0x5ef93f=moment(_0x1f6ed5)[_0x9dc1('0x8')](0x0);return _0x1dea68[_0x9dc1('0x9')](_0x5ef93f,_0x9dc1('0x6a'));};exports[_0x9dc1('0x6b')]=function(_0x219a50){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x219a50[_0x9dc1('0x20')],'ListId':_0x219a50['ListId'],'VoiceQueueId':_0x219a50[_0x9dc1('0x22')]||undefined,'CampaignId':_0x219a50[_0x9dc1('0x6c')]||undefined};};exports['filterKey']=function(_0x6e8f70){if(_0x6e8f70==='uniqueid'||_0x6e8f70===_0x9dc1('0x6d')||_0x6e8f70===_0x9dc1('0x61')||_0x6e8f70===_0x9dc1('0x6e')||_0x6e8f70==='campaigntype'||_0x6e8f70===_0x9dc1('0x6f')||_0x6e8f70===_0x9dc1('0x46')||_0x6e8f70===_0x9dc1('0x4b')||_0x6e8f70===_0x9dc1('0x1e')||_0x6e8f70===_0x9dc1('0x56')||_0x6e8f70===_0x9dc1('0x1f')||_0x6e8f70===_0x9dc1('0x57')||_0x6e8f70===_0x9dc1('0x70')||_0x6e8f70===_0x9dc1('0x50')||_0x6e8f70===_0x9dc1('0x51')||_0x6e8f70===_0x9dc1('0x71')||_0x6e8f70==='callback'||_0x6e8f70==='callbackuniqueid'||_0x6e8f70===_0x9dc1('0x72')||_0x6e8f70===_0x9dc1('0x73')||_0x6e8f70===_0x9dc1('0x20')||_0x6e8f70===_0x9dc1('0x59')||_0x6e8f70===_0x9dc1('0x74')||_0x6e8f70===_0x9dc1('0x22')||_0x6e8f70===_0x9dc1('0x75')||_0x6e8f70===_0x9dc1('0x76')||_0x6e8f70===_0x9dc1('0x77')||_0x6e8f70===_0x9dc1('0x78')||_0x6e8f70===_0x9dc1('0x79')||_0x6e8f70===_0x9dc1('0x7a')||_0x6e8f70===_0x9dc1('0x7b')||_0x6e8f70===_0x9dc1('0x7c')||_0x6e8f70===_0x9dc1('0x7d')||_0x6e8f70==='xmd-dialchannel'||_0x6e8f70===_0x9dc1('0x7e')||_0x6e8f70===_0x9dc1('0x7f')||_0x6e8f70==='xmd-callerid'||_0x6e8f70===_0x9dc1('0x80')||_0x6e8f70===_0x9dc1('0x81')||_0x6e8f70==='rtpaudioqos'||_0x6e8f70===_0x9dc1('0x82')||_0x6e8f70===_0x9dc1('0x83')||_0x6e8f70===_0x9dc1('0x84')||_0x6e8f70===_0x9dc1('0x85')||_0x6e8f70===_0x9dc1('0x86')||_0x6e8f70===_0x9dc1('0x87')||_0x6e8f70==='rtpaudioqosrttbridged'||_0x6e8f70==='rtpaudioqos'||_0x6e8f70===_0x9dc1('0x82')||_0x6e8f70===_0x9dc1('0x83')||_0x6e8f70==='rtpaudioqosjitterbridged'||_0x6e8f70===_0x9dc1('0x85')||_0x6e8f70==='rtpaudioqoslossbridged'||_0x6e8f70===_0x9dc1('0x87')||_0x6e8f70===_0x9dc1('0x88')||_0x6e8f70===_0x9dc1('0x89')||_0x6e8f70===_0x9dc1('0x8a')||_0x6e8f70===_0x9dc1('0x3e')||_0x6e8f70===_0x9dc1('0x44')){return![];}return!![];};exports[_0x9dc1('0x8b')]=function(_0x503ba0,_0x310dcf){var _0x5d1d7c,_0x486016,_0x3b123b;if(_0x310dcf<=0x0){_0x310dcf=0x1;}_0x5d1d7c=new RegExp('\x5cw{0,'+_0x310dcf+'}$');_0x486016=Math[_0x9dc1('0x8c')](0xa,_0x310dcf-0x1);_0x3b123b=Math['pow'](0xa,_0x310dcf)-0x1;return util[_0x9dc1('0x16')]('%s',_[_0x9dc1('0x8d')](_0x503ba0,_0x5d1d7c,_[_0x9dc1('0x8e')](_0x486016,_0x3b123b)));};exports[_0x9dc1('0x8f')]=function(_0x524376){var _0x347302=_0x524376[_0x9dc1('0x90')](/"(.*?)"/);return _0x347302?_0x347302[0x1]:_0x524376;};exports[_0x9dc1('0x91')]=function(_0x56320a){var _0x13d50f=_0x56320a[_0x9dc1('0x90')](/<(.*?)>/);return _0x13d50f?_0x13d50f[0x1]:_0x56320a;};
\ No newline at end of file
+var _0x9900=['statedesc','Blacklist','starttime','responsetime','endtime','YYYY-MM-DD\x20HH:mm:ss','ringtime','logLookAgent','membername','UserId','logCustomer','talktime','answertime','isFailure','RECALL','BOOKED','originate','channelAgent','xcally-motion-preview','from-sip','uniqueid','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','clone','Global','scheduledAt','scheduledat','add','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','buildObj','lastevent','name','queue','interface','motionChannel','mandatoryDisposition','agentReadyId','not_inuse','status','reachable','push','getDiff','ListId','CampaignId','filterKey','type','campaigntype','dialAnswer','active','countglobal','callback','callbackat','sipcallid','xmd-queue','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrttbridged','rtpaudioqosjitterbridged','rtpaudioqosrtt','bridgepvtcallid','getCallerIdRandom','pow','replace','random','extractCalleridName','match','extractCalleridNumber','util','moment','../../../../config/logger','env','XCALLY_IP_AGI','127.0.0.1','milliseconds','diff','seconds','loggerCatch','error','logger','info','inspect','logger2','message','getCallerId','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','isActive','isNil','addVariables','Queue','calleridname','calleridnum','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','dialPreviewUrl','\x22agi://%s/square,%s\x22','dialQueueProject','NONE','originatecalleridname','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_FORMAT','Contact','hasOwnProperty','tags','createdAt','updatedAt','XMD-','toLower','updateOriginated','originated','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','state'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x9900,0x174));var _0x0990=function(_0x590c18,_0x11f5fd){_0x590c18=_0x590c18-0x0;var _0x32f91e=_0x9900[_0x590c18];return _0x32f91e;};'use strict';var util=require(_0x0990('0x0'));var _=require('lodash');var moment=require(_0x0990('0x1'));var logger=require(_0x0990('0x2'))('preview');var ipAgi=process[_0x0990('0x3')][_0x0990('0x4')]||_0x0990('0x5');function getSeconds(_0x516b53,_0x1d864f){var _0x15fe64=moment(_0x516b53)[_0x0990('0x6')](0x0);var _0x39a933=moment(_0x1d864f)[_0x0990('0x6')](0x0);return _0x15fe64[_0x0990('0x7')](_0x39a933,_0x0990('0x8'));}exports[_0x0990('0x9')]=function(_0x2c5181){return function(_0x3e7b54){logger[_0x0990('0xa')](_0x2c5181,util['inspect'](_0x3e7b54,{'showHidden':![],'depth':null}));};};exports[_0x0990('0xb')]=function(_0x5b4fda,_0x42f2ca){logger[_0x0990('0xc')](_0x5b4fda,util['inspect'](_0x42f2ca,{'showHidden':![],'depth':null}));};exports['loggerError']=function(_0x155885,_0x5b80bc){logger[_0x0990('0xa')](_0x155885,util[_0x0990('0xd')](_0x5b80bc,{'showHidden':![],'depth':null}));};exports[_0x0990('0xe')]=function(_0x5e71f4){return function(_0x40391f){logger[_0x0990('0xc')](_0x5e71f4,util[_0x0990('0xd')](_0x40391f,{'showHidden':![],'depth':null}));};};exports[_0x0990('0xf')]=function(_0x5f29e2,_0x5ac97d,_0x44a7ae){return{'message':_0x5f29e2,'unlock':_0x5ac97d,'active':_0x44a7ae};};exports[_0x0990('0x10')]=function(_0x29873b,_0x2e83ce,_0x542809){if(!_[_0x0990('0x11')](_0x542809)&&_0x0990('0x12')===typeof _0x542809&&!_[_0x0990('0x13')](_0x542809)){if(!_['isUndefined'](_0x2e83ce)&&'string'===typeof _0x2e83ce&&!_[_0x0990('0x13')](_0x2e83ce)){return util[_0x0990('0x14')](_0x0990('0x15'),_0x2e83ce,_0x542809);}return util[_0x0990('0x14')]('\x22%s\x22\x20<%s>',_0x542809,_0x542809);}if(!_[_0x0990('0x11')](_0x29873b)&&_0x0990('0x12')===typeof _0x29873b&&!_['isEmpty'](_0x29873b)){return _0x29873b;}return'\x22\x22\x20<>';};exports[_0x0990('0x16')]=function(_0x195bf6){if(_[_0x0990('0x17')](_0x195bf6)){return![];}return _0x195bf6;};exports[_0x0990('0x18')]=function(_0x464ea4,_0x630030,_0xdcc034,_0x74e724,_0x4f5273,_0x29b198){var _0x351c0a={'XMD-QUEUE':_0x630030[_0x0990('0x19')]?_0x630030[_0x0990('0x19')]['name']:'','XMD-CALLERID':_0x74e724,'XMD-CALLERID-PREVIEW':_0x29b198?util[_0x0990('0x14')](_0x0990('0x15'),_0x29b198[_0x0990('0x1a')],_0x29b198[_0x0990('0x1b')]):_0x74e724,'XMD-DIALID':_0x4f5273,'XMD-CONTACTID':_0x630030[_0x0990('0x1c')],'XMD-CDRTYPE':_0x0990('0x1d'),'CALLERID(all)':_0x74e724,'XMD-VOICEQUEUEID':_0x630030[_0x0990('0x1e')],'XMD-DIALCHANNEL':_0xdcc034,'XMD-DIALTIMEOUT':_0x464ea4[_0x0990('0x1f')]||0x1e,'XMD-DIALOPTIONS':util[_0x0990('0x14')](_0x0990('0x20'),_0x464ea4[_0x0990('0x21')]?'g':'',_[_0x0990('0x13')](_0x464ea4[_0x0990('0x22')])?'':'U(xcally-mixmonitor-context)'),'XMD-DIALURL':_0x464ea4[_0x0990('0x23')]||'','XMD-AGI':_0x464ea4['dialQueueProject']?util[_0x0990('0x14')](_0x0990('0x24'),ipAgi,_0x464ea4[_0x0990('0x25')]):'NONE','XMD-AGIAFTER':_0x464ea4[_0x0990('0x21')]?util[_0x0990('0x14')](_0x0990('0x24'),ipAgi,_0x464ea4[_0x0990('0x21')]):_0x0990('0x26'),'XMD-ORIGINATECALLERIDNUM':_0x29b198?_0x29b198['originatecalleridnum']:'','XMD-ORIGINATECALLERIDNAME':_0x29b198?_0x29b198[_0x0990('0x27')]:'','XMD-DESTINATION':'xcally-motion-preview','SIPADDHEADER':_0x0990('0x28')};if(!_[_0x0990('0x13')](_0x464ea4[_0x0990('0x22')])){_0x351c0a[util[_0x0990('0x14')]('%s',_0x0990('0x29'))]=_0x464ea4['monitor_format'];_0x351c0a[util[_0x0990('0x14')]('%s','_XCALLY_MIXMONITOR_UNIQUEID')]=_0x4f5273;}if(_0x630030&&_0x630030[_0x0990('0x2a')]){for(var _0xf10b95 in _0x630030[_0x0990('0x2a')]){if(_0x630030[_0x0990('0x2a')][_0x0990('0x2b')](_0xf10b95)){if(!_[_0x0990('0x17')](_0x630030[_0x0990('0x2a')][_0xf10b95])&&_0xf10b95!=='id'&&_0xf10b95!==_0x0990('0x2c')&&_0xf10b95!==_0x0990('0x2d')&&_0xf10b95!==_0x0990('0x2e')){_0x351c0a[util[_0x0990('0x14')]('%s%s',_0x0990('0x2f'),_['toUpper'](_0xf10b95))]=_0x630030[_0x0990('0x2a')][_0xf10b95];}}}}return _0x351c0a;};exports['toLowerVariables']=function(_0x256229){var _0x5ff424={};for(var _0x227790 in _0x256229){if(_0x256229['hasOwnProperty'](_0x227790)){_0x5ff424[util[_0x0990('0x14')]('%s',_[_0x0990('0x30')](_0x227790))]=_0x256229[_0x227790];}}return{'variables':_0x5ff424};};exports[_0x0990('0x31')]=function(_0x33ab25,_0x13ef5f){if(!_['isNil'](_0x33ab25)){if(_0x33ab25['hasOwnProperty'](_0x0990('0x32'))){if(_0x33ab25['originated']>0x0){_0x33ab25[_0x0990('0x32')]-=0x1;}else{logger[_0x0990('0xa')]('[updateOriginated]\x20object\x20originated\x20is\x20negative',_0x13ef5f);}}}else{logger[_0x0990('0xa')](_0x0990('0x33'),_0x13ef5f);}};exports[_0x0990('0x34')]=function(_0x54cfc5){var _0x39e62a=moment()[_0x0990('0x14')]('YYYY-MM-DD\x20HH:mm:ss');_0x54cfc5[_0x0990('0x35')]=0xd;_0x54cfc5[_0x0990('0x36')]=_0x0990('0x37');_0x54cfc5[_0x0990('0x38')]=_0x39e62a;_0x54cfc5[_0x0990('0x39')]=_0x39e62a;_0x54cfc5[_0x0990('0x3a')]=_0x39e62a;};exports['logAgent']=function(_0xd92a2b,_0x2f49b0,_0x5e6ce1){var _0x56cc85=moment()[_0x0990('0x14')](_0x0990('0x3b'));_0xd92a2b[_0x0990('0x35')]=_0x2f49b0;_0xd92a2b[_0x0990('0x36')]=_0x5e6ce1;_0xd92a2b['responsetime']=_0x56cc85;_0xd92a2b[_0x0990('0x3c')]=getSeconds(_0xd92a2b[_0x0990('0x39')],_0xd92a2b['starttime']);};exports[_0x0990('0x3d')]=function(_0x1fa612,_0x394992,_0x436cc9){_0x1fa612[_0x0990('0x3e')]=_0x394992;_0x1fa612[_0x0990('0x3f')]=_0x436cc9;};exports[_0x0990('0x40')]=function(_0xc56cb2,_0x44a2ee,_0x3e8d16){var _0x478fff=moment()[_0x0990('0x14')](_0x0990('0x3b'));_0xc56cb2[_0x0990('0x35')]=_0x44a2ee;_0xc56cb2['statedesc']=_0x3e8d16;_0xc56cb2[_0x0990('0x39')]=_0xc56cb2['responsetime']?_0xc56cb2[_0x0990('0x39')]:_0x478fff;_0xc56cb2[_0x0990('0x3a')]=_0xc56cb2[_0x0990('0x3a')]?_0xc56cb2[_0x0990('0x3a')]:_0x478fff;_0xc56cb2[_0x0990('0x3c')]=getSeconds(_0xc56cb2[_0x0990('0x39')]||0x0,_0xc56cb2[_0x0990('0x38')]||0x0);_0xc56cb2[_0x0990('0x41')]=_0xc56cb2[_0x0990('0x42')]?getSeconds(_0xc56cb2[_0x0990('0x3a')],_0xc56cb2['answertime']):0x0;};exports[_0x0990('0x43')]=function(_0x5554c0){return _0x5554c0==='Failure';};exports['variablesAction']=function(_0x4ef47d,_0x2740c6,_0x3f725a,_0x121532,_0x4cf382){var _0x25e732=_0x121532?_0x0990('0x44'):_0x4ef47d[_0x0990('0x1a')];_0x25e732=_0x4cf382?_0x0990('0x45'):_0x25e732;return{'actionid':_0x4ef47d['uniqueid'],'action':_0x0990('0x46'),'channel':_0x4ef47d[_0x0990('0x47')],'callerid':util['format'](_0x0990('0x15'),_0x25e732,_0x4ef47d[_0x0990('0x1b')]),'Exten':_0x0990('0x48'),'Context':_0x0990('0x49'),'Priority':'1','variable':_0x3f725a,'timeout':(_0x2740c6['timeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x4ef47d[_0x0990('0x4a')]};};exports[_0x0990('0x4b')]=function(_0x38d54f){return _0x38d54f[_0x0990('0x4c')]+_0x38d54f[_0x0990('0x4d')]+_0x38d54f[_0x0990('0x4e')]+_0x38d54f[_0x0990('0x4f')]+_0x38d54f[_0x0990('0x50')];};exports['cloneAction']=function(_0xc59ba6){var _0x2dc1c9=_[_0x0990('0x51')](_0xc59ba6);_0x2dc1c9[_0x0990('0x35')]=0xf;_0x2dc1c9['statedesc']=_0x0990('0x52');return _0x2dc1c9;};exports[_0x0990('0x53')]=function(_0xaf1dfe,_0x44d4c7,_0xda4d5a){var _0x216fee={};_0x216fee[_0x44d4c7]=_0xaf1dfe[_0x44d4c7];_0x216fee['active']=![];_0x216fee[_0x0990('0x54')]=moment()[_0x0990('0x55')](_0xda4d5a,'minutes')[_0x0990('0x14')](_0x0990('0x3b'));_0x216fee[_0x0990('0x1c')]=_0xaf1dfe['ContactId'];_0x216fee['ListId']=_0xaf1dfe['ListId'];_0x216fee[_0x0990('0x1e')]=_0xaf1dfe['VoiceQueueId']||undefined;return _0x216fee;};exports[_0x0990('0x56')]=function(_0x47fe88,_0x2a4726){if(!_[_0x0990('0x17')](_0x47fe88)){if(_0x47fe88[_0x0990('0x57')]>0x0){_0x47fe88[_0x0990('0x57')]-=0x1;}else{logger[_0x0990('0xa')](_0x2a4726,_0x0990('0x58'));}}else{logger[_0x0990('0xa')](_0x2a4726,_0x0990('0x59'));}};exports[_0x0990('0x5a')]=function(_0x1363c7){if(_0x1363c7<=0x0){return!![];}return![];};exports[_0x0990('0x5b')]=function(_0x57f63c,_0x176dc6,_0x328719){_0x57f63c[_0x0990('0x5c')]=_0x176dc6;_0x57f63c[_0x0990('0x5d')]=_0x57f63c[_0x0990('0x5e')];_0x57f63c[_0x0990('0x5f')]=_0x57f63c[_0x0990('0x47')];_0x57f63c[_0x0990('0x60')]='voice';if(_0x328719){_0x57f63c[_0x0990('0x61')]=_0x328719['mandatoryDisposition'];}return _0x57f63c;};exports['buildAcw']=function(_0x439cb7){var _0x5fb01={};_0x5fb01[_0x0990('0x5e')]=_0x439cb7[_0x0990('0x5e')];_0x5fb01[_0x0990('0x5f')]=_0x439cb7[_0x0990('0x47')];_0x5fb01[_0x0990('0x4a')]=_0x439cb7[_0x0990('0x4a')];return _0x5fb01;};exports[_0x0990('0x62')]=function(_0x5a633b){var _0x21635c=[];for(var _0x5ae483 in _0x5a633b){if(_0x5a633b['hasOwnProperty'](_0x5ae483)){if(!_[_0x0990('0x17')](_0x5a633b[_0x5ae483])&&_0x5a633b[_0x5ae483][_0x0990('0x35')]===_0x0990('0x63')&&_0x5a633b[_0x5ae483][_0x0990('0x64')]===_0x0990('0x65')){_0x21635c[_0x0990('0x66')](_0x5a633b[_0x5ae483]['id']);}}}return _0x21635c;};exports[_0x0990('0x67')]=function(_0x4f1b5f){var _0x4e6fb8=moment()[_0x0990('0x6')](0x0);var _0x1d0ef9=moment(_0x4f1b5f)[_0x0990('0x6')](0x0);return _0x4e6fb8['diff'](_0x1d0ef9,'seconds');};exports['createBody']=function(_0xc5e48d){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0xc5e48d[_0x0990('0x1c')],'ListId':_0xc5e48d[_0x0990('0x68')],'VoiceQueueId':_0xc5e48d[_0x0990('0x1e')]||undefined,'CampaignId':_0xc5e48d[_0x0990('0x69')]||undefined};};exports[_0x0990('0x6a')]=function(_0xbb9d4b){if(_0xbb9d4b===_0x0990('0x4a')||_0xbb9d4b==='idContact'||_0xbb9d4b===_0x0990('0x5e')||_0xbb9d4b===_0x0990('0x6b')||_0xbb9d4b===_0x0990('0x6c')||_0xbb9d4b===_0x0990('0x6d')||_0xbb9d4b==='membername'||_0xbb9d4b===_0x0990('0x47')||_0xbb9d4b==='calleridname'||_0xbb9d4b===_0x0990('0x6e')||_0xbb9d4b==='calleridnum'||_0xbb9d4b===_0x0990('0x54')||_0xbb9d4b===_0x0990('0x4c')||_0xbb9d4b===_0x0990('0x4d')||_0xbb9d4b===_0x0990('0x4e')||_0xbb9d4b===_0x0990('0x6f')||_0xbb9d4b===_0x0990('0x70')||_0xbb9d4b==='callbackuniqueid'||_0xbb9d4b===_0x0990('0x71')||_0xbb9d4b==='recallme'||_0xbb9d4b===_0x0990('0x1c')||_0xbb9d4b===_0x0990('0x68')||_0xbb9d4b==='UserId'||_0xbb9d4b===_0x0990('0x1e')||_0xbb9d4b===_0x0990('0x72')||_0xbb9d4b==='xmd-voicequeueid'||_0xbb9d4b===_0x0990('0x73')||_0xbb9d4b==='xmd-phone'||_0xbb9d4b==='xmd-listid'||_0xbb9d4b===_0x0990('0x74')||_0xbb9d4b===_0x0990('0x75')||_0xbb9d4b===_0x0990('0x76')||_0xbb9d4b===_0x0990('0x77')||_0xbb9d4b===_0x0990('0x78')||_0xbb9d4b===_0x0990('0x79')||_0xbb9d4b===_0x0990('0x7a')||_0xbb9d4b===_0x0990('0x7b')||_0xbb9d4b===_0x0990('0x7c')||_0xbb9d4b===_0x0990('0x7d')||_0xbb9d4b===_0x0990('0x7e')||_0xbb9d4b===_0x0990('0x7f')||_0xbb9d4b===_0x0990('0x80')||_0xbb9d4b==='rtpaudioqosjitterbridged'||_0xbb9d4b===_0x0990('0x81')||_0xbb9d4b===_0x0990('0x82')||_0xbb9d4b==='rtpaudioqosrtt'||_0xbb9d4b===_0x0990('0x83')||_0xbb9d4b==='rtpaudioqos'||_0xbb9d4b==='rtpaudioqosbridged'||_0xbb9d4b===_0x0990('0x80')||_0xbb9d4b===_0x0990('0x84')||_0xbb9d4b===_0x0990('0x81')||_0xbb9d4b==='rtpaudioqoslossbridged'||_0xbb9d4b===_0x0990('0x85')||_0xbb9d4b===_0x0990('0x83')||_0xbb9d4b==='bridgepeer'||_0xbb9d4b===_0x0990('0x86')||_0xbb9d4b===_0x0990('0x35')||_0xbb9d4b===_0x0990('0x36')){return![];}return!![];};exports[_0x0990('0x87')]=function(_0x398491,_0x140bae){var _0x364583,_0x30926b,_0x24c82e;if(_0x140bae<=0x0){_0x140bae=0x1;}_0x364583=new RegExp('\x5cw{0,'+_0x140bae+'}$');_0x30926b=Math[_0x0990('0x88')](0xa,_0x140bae-0x1);_0x24c82e=Math[_0x0990('0x88')](0xa,_0x140bae)-0x1;return util[_0x0990('0x14')]('%s',_[_0x0990('0x89')](_0x398491,_0x364583,_[_0x0990('0x8a')](_0x30926b,_0x24c82e)));};exports[_0x0990('0x8b')]=function(_0x394f90){var _0x6a56ab=_0x394f90[_0x0990('0x8c')](/"(.*?)"/);return _0x6a56ab?_0x6a56ab[0x1]:_0x394f90;};exports[_0x0990('0x8d')]=function(_0x3136d4){var _0x2272e7=_0x3136d4[_0x0990('0x8c')](/<(.*?)>/);return _0x2272e7?_0x2272e7[0x1]:_0x3136d4;};
\ No newline at end of file
index d2836d5..0461c48 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8f70=['voicechannel','voicequeuechannelhangup','voicequeuechannelredirect','queueadd','string','queueremove','queuepause','boolean','reload','voicequeuechannel'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x8f70,0xdf));var _0x08f7=function(_0x15d478,_0x72e874){_0x15d478=_0x15d478-0x0;var _0x365a0c=_0x8f70[_0x15d478];return _0x365a0c;};'use strict';exports[_0x08f7('0x0')]={'queue':{'type':_0x08f7('0x1'),'required':!![]},'interface':{'type':_0x08f7('0x1'),'required':!![]},'membername':{'type':'string','required':!![]},'penalty':{'type':'number','required':![]},'paused':{'type':'boolean','required':![]}};exports[_0x08f7('0x2')]={'queue':{'type':'string','required':!![]},'interface':{'type':'string','required':!![]}};exports[_0x08f7('0x3')]={'interface':{'type':_0x08f7('0x1'),'required':!![]},'paused':{'type':_0x08f7('0x4')},'reason':{'type':_0x08f7('0x1'),'required':![]}};exports[_0x08f7('0x5')]={'module':{'type':_0x08f7('0x1'),'required':![]}};exports[_0x08f7('0x6')]={'uniqueid':{'type':_0x08f7('0x1'),'required':!![]}};exports[_0x08f7('0x7')]={'uniqueid':{'type':_0x08f7('0x1'),'required':!![]},'filename':{'type':_0x08f7('0x1')},'format':{'type':_0x08f7('0x1')},'mixmonitorid':{'type':'string'}};exports[_0x08f7('0x8')]={'uniqueid':{'type':_0x08f7('0x1'),'required':!![]}};exports[_0x08f7('0x9')]={'uniqueid':{'type':_0x08f7('0x1'),'required':!![]},'exten':{'type':_0x08f7('0x1'),'required':!![]},'context':{'type':_0x08f7('0x1')}};
\ No newline at end of file
+var _0x715c=['voicequeuechannel','voicechannel','voicequeuechannelhangup','queueadd','string','queueremove','boolean'];(function(_0x5089bb,_0x1d024e){var _0xd5213e=function(_0x523775){while(--_0x523775){_0x5089bb['push'](_0x5089bb['shift']());}};_0xd5213e(++_0x1d024e);}(_0x715c,0x14c));var _0xc715=function(_0x15a6de,_0x11df7a){_0x15a6de=_0x15a6de-0x0;var _0xc305b4=_0x715c[_0x15a6de];return _0xc305b4;};'use strict';exports[_0xc715('0x0')]={'queue':{'type':_0xc715('0x1'),'required':!![]},'interface':{'type':'string','required':!![]},'membername':{'type':_0xc715('0x1'),'required':!![]},'penalty':{'type':'number','required':![]},'paused':{'type':'boolean','required':![]}};exports[_0xc715('0x2')]={'queue':{'type':_0xc715('0x1'),'required':!![]},'interface':{'type':_0xc715('0x1'),'required':!![]}};exports['queuepause']={'interface':{'type':_0xc715('0x1'),'required':!![]},'paused':{'type':_0xc715('0x3')},'reason':{'type':_0xc715('0x1'),'required':![]}};exports['reload']={'module':{'type':_0xc715('0x1'),'required':![]}};exports[_0xc715('0x4')]={'uniqueid':{'type':_0xc715('0x1'),'required':!![]}};exports[_0xc715('0x5')]={'uniqueid':{'type':_0xc715('0x1'),'required':!![]},'filename':{'type':_0xc715('0x1')},'format':{'type':_0xc715('0x1')},'mixmonitorid':{'type':_0xc715('0x1')}};exports[_0xc715('0x6')]={'uniqueid':{'type':'string','required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':_0xc715('0x1'),'required':!![]},'exten':{'type':'string','required':!![]},'context':{'type':_0xc715('0x1')}};
\ No newline at end of file
index 02ebd0d..b8ca770 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3f65=['mergeFromDatabase','initAgents','length','telephones','isUndefined','initTrunks','trunks','initVoiceQueues','initTriggers','initZendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','initZohoAccounts','initDeskAccounts','initSugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','servicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','freshsalesAccounts','initVoiceQueueHopperHistory','initVoiceQueueReports','groupBy','queue','queuecallerexit','queuecallerabandon','abandoned','queuecallerleaveAt','diff','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerexitAt','initVoiceCallReports','duration','disposition','ANSWERED','billableseconds','sumBillable','initCampaigns','SquareProject','merge','exports','bluebird','util','lodash','moment','../model/voiceQueue','../model/campaign','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','agents','voiceQueues','triggers','campaigns','templates','outbound','voiceExtensions','channels','queueChannels','outboundChannels','timers','settings','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','dynamics365Accounts','faxAccounts','mapKeys','hasOwnProperty','format','SIP/%s','isNil','interface','name','sumHoldTime','sumDuration','ivrTotalCallsDays','ivrAnswerCallsDay','isEmpty','total','answered','unmanaged','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundRejectCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype'];(function(_0x2eb495,_0x28ad1e){var _0x2e348e=function(_0x1c433e){while(--_0x1c433e){_0x2eb495['push'](_0x2eb495['shift']());}};_0x2e348e(++_0x28ad1e);}(_0x3f65,0x1d8));var _0x53f6=function(_0x5216e3,_0x1bbee2){_0x5216e3=_0x5216e3-0x0;var _0x49f7db=_0x3f65[_0x5216e3];return _0x49f7db;};'use strict';var BPromise=require(_0x53f6('0x0'));var util=require(_0x53f6('0x1'));var _=require(_0x53f6('0x2'));var moment=require(_0x53f6('0x3'));var Agent=require('../model/agent');var Telephone=require('../model/telephone');var Trunk=require('../model/trunk');var VoiceQueue=require(_0x53f6('0x4'));var Trigger=require('../model/trigger');var Template=require('../model/template');var Campaign=require(_0x53f6('0x5'));var VoiceExtension=require('../model/voiceExtension');var ZendeskAccount=require('../model/zendeskAccount');var SalesforceAccount=require(_0x53f6('0x6'));var FreshdeskAccount=require(_0x53f6('0x7'));var SugarcrmAccount=require(_0x53f6('0x8'));var ZohoAccount=require(_0x53f6('0x9'));var DeskAccount=require(_0x53f6('0xa'));var VtigerAccount=require(_0x53f6('0xb'));var ServicenowAccount=require('../model/servicenowAccount');var Dynamics365Account=require(_0x53f6('0xc'));var FreshsalesAccount=require(_0x53f6('0xd'));var FaxAccount=require(_0x53f6('0xe'));var Realtime=function(){this[_0x53f6('0xf')]={};this['telephones']={};this['trunks']={};this[_0x53f6('0x10')]={};this[_0x53f6('0x11')]={};this[_0x53f6('0x12')]={};this[_0x53f6('0x13')]={};this[_0x53f6('0x14')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x53f6('0x15')]={};this[_0x53f6('0x16')]={};this[_0x53f6('0x17')]={};this[_0x53f6('0x18')]={};this[_0x53f6('0x19')]={};this[_0x53f6('0x1a')]={};this[_0x53f6('0x1b')]={};this[_0x53f6('0x1c')]={};this[_0x53f6('0x1d')]={};this[_0x53f6('0x1e')]={};this[_0x53f6('0x1f')]={};this[_0x53f6('0x20')]={};this[_0x53f6('0x21')]={};this['servicenowAccounts']={};this[_0x53f6('0x22')]={};this['freshsalesAccounts']={};this[_0x53f6('0x23')]={};};function freeIsNotKey(_0x1a96ef,_0x46b81a,_0x3c5cf3){var _0x4665e9=_[_0x53f6('0x24')](_0x1a96ef,function(_0x471dc7,_0x454032){return _0x471dc7[_0x3c5cf3];});for(var _0x24764b in _0x46b81a){if(_0x46b81a[_0x53f6('0x25')](_0x24764b)){if(!_0x4665e9[_0x24764b]){delete _0x46b81a[_0x24764b];}}}}function freeIsNotKeySip(_0x11c915,_0x3a4bc2){var _0x1d5df0=_[_0x53f6('0x24')](_0x11c915,function(_0x500cb9,_0x3ceb26){return util[_0x53f6('0x26')](_0x53f6('0x27'),_0x500cb9['name']);});for(var _0x14502d in _0x3a4bc2){if(_0x3a4bc2['hasOwnProperty'](_0x14502d)){if(!_0x1d5df0[_0x14502d]){delete _0x3a4bc2[_0x14502d];}}}}function freeIsNotKeyAgent(_0x12a54a,_0x34f0df){var _0x1f7771=_[_0x53f6('0x24')](_0x12a54a,function(_0x509824,_0x232a5b){var _0x4d7b99=_[_0x53f6('0x28')](_0x509824[_0x53f6('0x29')])?util[_0x53f6('0x26')](_0x53f6('0x27'),_0x509824[_0x53f6('0x2a')]):_0x509824[_0x53f6('0x29')];return _0x4d7b99;});for(var _0x2ef389 in _0x34f0df){if(_0x34f0df['hasOwnProperty'](_0x2ef389)){if(!_0x1f7771[_0x2ef389]){delete _0x34f0df[_0x2ef389];}}}}function clearVoiceCallReports(_0x47215f){_0x47215f['total']=0x0;_0x47215f['answered']=0x0;_0x47215f[_0x53f6('0x2b')]=0x0;_0x47215f[_0x53f6('0x2c')]=0x0;_0x47215f['sumBillable']=0x0;}function clearCampaigns(_0x829392){if(!_['isEmpty'](_0x829392)){for(var _0x9fc6a8 in _0x829392){if(_0x829392['hasOwnProperty'](_0x9fc6a8)){_0x829392[_0x9fc6a8][_0x53f6('0x2d')]=0x0;_0x829392[_0x9fc6a8][_0x53f6('0x2e')]=0x0;}}}}function clearVoiceQueues(_0x278280){if(!_[_0x53f6('0x2f')](_0x278280)){for(var _0x463a80 in _0x278280){if(_0x278280[_0x53f6('0x25')](_0x463a80)){_0x278280[_0x463a80][_0x53f6('0x30')]=0x0;_0x278280[_0x463a80][_0x53f6('0x31')]=0x0;_0x278280[_0x463a80][_0x53f6('0x32')]=0x0;_0x278280[_0x463a80]['abandoned']=0x0;_0x278280[_0x463a80][_0x53f6('0x2b')]=0x0;_0x278280[_0x463a80][_0x53f6('0x2c')]=0x0;_0x278280[_0x463a80]['sumBillable']=0x0;_0x278280[_0x463a80][_0x53f6('0x33')]=0x0;_0x278280[_0x463a80][_0x53f6('0x34')]=0x0;_0x278280[_0x463a80]['outboundBusyCallsDay']=0x0;_0x278280[_0x463a80][_0x53f6('0x35')]=0x0;_0x278280[_0x463a80][_0x53f6('0x36')]=0x0;_0x278280[_0x463a80][_0x53f6('0x37')]=0x0;_0x278280[_0x463a80][_0x53f6('0x38')]=0x0;_0x278280[_0x463a80][_0x53f6('0x39')]=0x0;_0x278280[_0x463a80][_0x53f6('0x3a')]=0x0;_0x278280[_0x463a80]['outboundOriginateFailureCallsDay']=0x0;_0x278280[_0x463a80][_0x53f6('0x3b')]=0x0;_0x278280[_0x463a80]['outboundReCallsDay']=0x0;_0x278280[_0x463a80][_0x53f6('0x33')]=0x0;_0x278280[_0x463a80][_0x53f6('0x3c')]=0x0;_0x278280[_0x463a80][_0x53f6('0x3d')]=!![];}}}}Realtime[_0x53f6('0x3e')][_0x53f6('0x3f')]=function(_0x323a09,_0x3a137d){for(var _0x19c553 in _0x3a137d){if(_0x323a09['hasOwnProperty'](_0x19c553)){_0x323a09[_0x19c553]=_0x3a137d[_0x19c553];}}};Realtime[_0x53f6('0x3e')][_0x53f6('0x40')]=function(){var _0x1e227a=this;return function(_0x5694f1){if(_0x5694f1){freeIsNotKeyAgent(_0x5694f1,_0x1e227a[_0x53f6('0xf')]);for(var _0x399081=0x0,_0x95e19={},_0x4bbeef={};_0x399081<_0x5694f1[_0x53f6('0x41')];_0x399081+=0x1){_0x95e19=_0x5694f1[_0x399081];var _0x868173=_['isNil'](_0x95e19[_0x53f6('0x29')])?util[_0x53f6('0x26')]('SIP/%s',_0x95e19[_0x53f6('0x2a')]):_0x95e19[_0x53f6('0x29')];if(_['isUndefined'](_0x1e227a[_0x53f6('0xf')][_0x868173])){_0x1e227a[_0x53f6('0xf')][_0x868173]=new Agent(_0x95e19);}else{_0x1e227a[_0x53f6('0x3f')](_0x1e227a[_0x53f6('0xf')][_0x868173],_0x95e19);}}}return _0x1e227a['agents'];};};Realtime[_0x53f6('0x3e')]['initTelephones']=function(){var _0x410d0d=this;return function(_0x27f27e){if(_0x27f27e){freeIsNotKeySip(_0x27f27e,_0x410d0d[_0x53f6('0x42')]);for(var _0x3db3ca=0x0,_0x55ef17={},_0x1895b0={};_0x3db3ca<_0x27f27e[_0x53f6('0x41')];_0x3db3ca+=0x1){_0x55ef17=_0x27f27e[_0x3db3ca];if(_[_0x53f6('0x43')](_0x410d0d[_0x53f6('0x42')][util[_0x53f6('0x26')](_0x53f6('0x27'),_0x55ef17[_0x53f6('0x2a')])])){_0x410d0d['telephones'][util['format'](_0x53f6('0x27'),_0x55ef17[_0x53f6('0x2a')])]=new Telephone(_0x55ef17);}else{_0x410d0d[_0x53f6('0x3f')](_0x410d0d[_0x53f6('0x42')][util['format'](_0x53f6('0x27'),_0x55ef17[_0x53f6('0x2a')])],_0x55ef17);}}}return _0x410d0d['telephones'];};};Realtime[_0x53f6('0x3e')][_0x53f6('0x44')]=function(){var _0xaaa76c=this;return function(_0x5a205c){if(_0x5a205c){freeIsNotKeySip(_0x5a205c,_0xaaa76c[_0x53f6('0x45')]);for(var _0x3bbcaf=0x0,_0x1900a2={},_0x258c89={};_0x3bbcaf<_0x5a205c[_0x53f6('0x41')];_0x3bbcaf+=0x1){_0x1900a2=_0x5a205c[_0x3bbcaf];if(_['isUndefined'](_0xaaa76c['trunks'][util[_0x53f6('0x26')]('SIP/%s',_0x1900a2[_0x53f6('0x2a')])])){_0xaaa76c[_0x53f6('0x45')][util[_0x53f6('0x26')](_0x53f6('0x27'),_0x1900a2[_0x53f6('0x2a')])]=new Trunk(_0x1900a2);}else{_0xaaa76c[_0x53f6('0x3f')](_0xaaa76c[_0x53f6('0x45')][util['format'](_0x53f6('0x27'),_0x1900a2[_0x53f6('0x2a')])],_0x1900a2);}}}return _0xaaa76c['trunks'];};};Realtime[_0x53f6('0x3e')][_0x53f6('0x46')]=function(){var _0xd17b91=this;return function(_0x3a53b0){if(_0x3a53b0){freeIsNotKey(_0x3a53b0,_0xd17b91['voiceQueues'],_0x53f6('0x2a'));for(var _0x367c6b=0x0,_0x863a8={},_0x28f503={};_0x367c6b<_0x3a53b0[_0x53f6('0x41')];_0x367c6b+=0x1){_0x863a8=_0x3a53b0[_0x367c6b];if(_[_0x53f6('0x43')](_0xd17b91['voiceQueues'][_0x863a8[_0x53f6('0x2a')]])){_0xd17b91['voiceQueues'][_0x863a8[_0x53f6('0x2a')]]=new VoiceQueue(_0x863a8);}else{_0xd17b91[_0x53f6('0x3f')](_0xd17b91[_0x53f6('0x10')][_0x863a8[_0x53f6('0x2a')]],_0x863a8);}}}return _0xd17b91['voiceQueues'];};};Realtime[_0x53f6('0x3e')][_0x53f6('0x47')]=function(){var _0xf7698a=this;return function(_0x220921){if(_0x220921){freeIsNotKey(_0x220921,_0xf7698a[_0x53f6('0x11')],'id');for(var _0x399e05=0x0,_0x3ce34b={},_0x52b373={};_0x399e05<_0x220921['length'];_0x399e05+=0x1){_0x3ce34b=_0x220921[_0x399e05];if(_[_0x53f6('0x43')](_0xf7698a[_0x53f6('0x11')][_0x3ce34b['id']])){_0xf7698a[_0x53f6('0x11')][_0x3ce34b['id']]=new Trigger(_0x3ce34b);}else{_0xf7698a['mergeFromDatabase'](_0xf7698a[_0x53f6('0x11')][_0x3ce34b['id']],_0x3ce34b);}}}return _0xf7698a[_0x53f6('0x11')];};};Realtime[_0x53f6('0x3e')]['initTemplates']=function(){var _0x184730=this;return function(_0x583253){if(_0x583253){freeIsNotKey(_0x583253,_0x184730[_0x53f6('0x13')],'id');for(var _0x3d5536=0x0,_0x2f6efd={},_0x4ba2fe={};_0x3d5536<_0x583253[_0x53f6('0x41')];_0x3d5536+=0x1){_0x2f6efd=_0x583253[_0x3d5536];if(_[_0x53f6('0x43')](_0x184730['templates'][_0x2f6efd['id']])){_0x184730['templates'][_0x2f6efd['id']]=new Template(_0x2f6efd);}else{_0x184730[_0x53f6('0x3f')](_0x184730['templates'][_0x2f6efd['id']],_0x2f6efd);}}}return _0x184730[_0x53f6('0x13')];};};Realtime[_0x53f6('0x3e')][_0x53f6('0x48')]=function(){var _0x5dbb75=this;return function(_0x4d03aa){if(_0x4d03aa){freeIsNotKey(_0x4d03aa,_0x5dbb75[_0x53f6('0x1b')],'id');for(var _0x45be98=0x0,_0x5b9948={},_0x49d7a9={};_0x45be98<_0x4d03aa[_0x53f6('0x41')];_0x45be98+=0x1){_0x5b9948=_0x4d03aa[_0x45be98];if(_[_0x53f6('0x43')](_0x5dbb75['zendeskAccounts'][_0x5b9948['id']])){_0x5dbb75[_0x53f6('0x1b')][_0x5b9948['id']]=new ZendeskAccount(_0x5b9948);}else{_0x5dbb75['mergeFromDatabase'](_0x5dbb75[_0x53f6('0x1b')][_0x5b9948['id']],_0x5b9948);}}}return _0x5dbb75[_0x53f6('0x1b')];};};Realtime[_0x53f6('0x3e')][_0x53f6('0x49')]=function(){var _0x4507f7=this;return function(_0x404f99){if(_0x404f99){freeIsNotKey(_0x404f99,_0x4507f7[_0x53f6('0x1c')],'id');for(var _0x48a325=0x0,_0x28facc={},_0x38a181={};_0x48a325<_0x404f99['length'];_0x48a325+=0x1){_0x28facc=_0x404f99[_0x48a325];if(_[_0x53f6('0x43')](_0x4507f7['salesforceAccounts'][_0x28facc['id']])){_0x4507f7[_0x53f6('0x1c')][_0x28facc['id']]=new SalesforceAccount(_0x28facc);}else{_0x4507f7[_0x53f6('0x3f')](_0x4507f7[_0x53f6('0x1c')][_0x28facc['id']],_0x28facc);}}}return _0x4507f7[_0x53f6('0x1c')];};};Realtime['prototype'][_0x53f6('0x4a')]=function(){var _0x36ffb9=this;return function(_0x528634){if(_0x528634){freeIsNotKey(_0x528634,_0x36ffb9[_0x53f6('0x1e')],'id');for(var _0x230508=0x0,_0x1b9955={},_0x45c2f3={};_0x230508<_0x528634[_0x53f6('0x41')];_0x230508+=0x1){_0x1b9955=_0x528634[_0x230508];if(_[_0x53f6('0x43')](_0x36ffb9[_0x53f6('0x1e')][_0x1b9955['id']])){_0x36ffb9[_0x53f6('0x1e')][_0x1b9955['id']]=new FreshdeskAccount(_0x1b9955);}else{_0x36ffb9['mergeFromDatabase'](_0x36ffb9[_0x53f6('0x1e')][_0x1b9955['id']],_0x1b9955);}}}return _0x36ffb9[_0x53f6('0x1e')];};};Realtime['prototype'][_0x53f6('0x4b')]=function(){var _0x5f0ce6=this;return function(_0x216817){if(_0x216817){freeIsNotKey(_0x216817,_0x5f0ce6[_0x53f6('0x1f')],'id');for(var _0x260aab=0x0,_0x3eda22={},_0x23ee64={};_0x260aab<_0x216817['length'];_0x260aab+=0x1){_0x3eda22=_0x216817[_0x260aab];if(_['isUndefined'](_0x5f0ce6['zohoAccounts'][_0x3eda22['id']])){_0x5f0ce6[_0x53f6('0x1f')][_0x3eda22['id']]=new ZohoAccount(_0x3eda22);}else{_0x5f0ce6[_0x53f6('0x3f')](_0x5f0ce6[_0x53f6('0x1f')][_0x3eda22['id']],_0x3eda22);}}}return _0x5f0ce6[_0x53f6('0x1f')];};};Realtime[_0x53f6('0x3e')][_0x53f6('0x4c')]=function(){var _0x15f0c0=this;return function(_0x2f1a1a){if(_0x2f1a1a){freeIsNotKey(_0x2f1a1a,_0x15f0c0[_0x53f6('0x20')],'id');for(var _0x2c3e7f=0x0,_0x89d012={},_0x51442e={};_0x2c3e7f<_0x2f1a1a[_0x53f6('0x41')];_0x2c3e7f+=0x1){_0x89d012=_0x2f1a1a[_0x2c3e7f];if(_['isUndefined'](_0x15f0c0['deskAccounts'][_0x89d012['id']])){_0x15f0c0['deskAccounts'][_0x89d012['id']]=new DeskAccount(_0x89d012);}else{_0x15f0c0[_0x53f6('0x3f')](_0x15f0c0[_0x53f6('0x20')][_0x89d012['id']],_0x89d012);}}}return _0x15f0c0['deskAccounts'];};};Realtime[_0x53f6('0x3e')][_0x53f6('0x4d')]=function(){var _0x13b73c=this;return function(_0x20297c){if(_0x20297c){freeIsNotKey(_0x20297c,_0x13b73c[_0x53f6('0x1d')],'id');for(var _0x45f8ca=0x0,_0x172c6e={},_0x145bf5={};_0x45f8ca<_0x20297c['length'];_0x45f8ca+=0x1){_0x172c6e=_0x20297c[_0x45f8ca];if(_[_0x53f6('0x43')](_0x13b73c[_0x53f6('0x1d')][_0x172c6e['id']])){_0x13b73c[_0x53f6('0x1d')][_0x172c6e['id']]=new SugarcrmAccount(_0x172c6e);}else{_0x13b73c['mergeFromDatabase'](_0x13b73c[_0x53f6('0x1d')][_0x172c6e['id']],_0x172c6e);}}}return _0x13b73c[_0x53f6('0x1d')];};};Realtime[_0x53f6('0x3e')][_0x53f6('0x4e')]=function(){var _0x39890f=this;return function(_0xa7e327){if(_0xa7e327){freeIsNotKey(_0xa7e327,_0x39890f[_0x53f6('0x21')],'id');for(var _0x43fc95=0x0,_0xb6b70d={},_0x5b6aea={};_0x43fc95<_0xa7e327[_0x53f6('0x41')];_0x43fc95+=0x1){_0xb6b70d=_0xa7e327[_0x43fc95];if(_[_0x53f6('0x43')](_0x39890f[_0x53f6('0x21')][_0xb6b70d['id']])){_0x39890f[_0x53f6('0x21')][_0xb6b70d['id']]=new VtigerAccount(_0xb6b70d);}else{_0x39890f[_0x53f6('0x3f')](_0x39890f[_0x53f6('0x21')][_0xb6b70d['id']],_0xb6b70d);}}}return _0x39890f[_0x53f6('0x21')];};};Realtime['prototype'][_0x53f6('0x4f')]=function(){var _0x170f2f=this;return function(_0x32502a){if(_0x32502a){freeIsNotKey(_0x32502a,_0x170f2f['servicenowAccounts'],'id');for(var _0x7c5e3e=0x0,_0x3b821e={},_0x44e1f8={};_0x7c5e3e<_0x32502a[_0x53f6('0x41')];_0x7c5e3e+=0x1){_0x3b821e=_0x32502a[_0x7c5e3e];if(_[_0x53f6('0x43')](_0x170f2f[_0x53f6('0x50')][_0x3b821e['id']])){_0x170f2f[_0x53f6('0x50')][_0x3b821e['id']]=new ServicenowAccount(_0x3b821e);}else{_0x170f2f[_0x53f6('0x3f')](_0x170f2f[_0x53f6('0x50')][_0x3b821e['id']],_0x3b821e);}}}return _0x170f2f[_0x53f6('0x50')];};};Realtime[_0x53f6('0x3e')][_0x53f6('0x51')]=function(){var _0x2fedb7=this;return function(_0x1d9194){if(_0x1d9194){freeIsNotKey(_0x1d9194,_0x2fedb7[_0x53f6('0x22')],'id');for(var _0x15e7d1=0x0,_0x311478={},_0x337857={};_0x15e7d1<_0x1d9194['length'];_0x15e7d1+=0x1){_0x311478=_0x1d9194[_0x15e7d1];if(_[_0x53f6('0x43')](_0x2fedb7['dynamics365Accounts'][_0x311478['id']])){_0x2fedb7[_0x53f6('0x22')][_0x311478['id']]=new Dynamics365Account(_0x311478);}else{_0x2fedb7[_0x53f6('0x3f')](_0x2fedb7['dynamics365Accounts'][_0x311478['id']],_0x311478);}}}return _0x2fedb7[_0x53f6('0x22')];};};Realtime[_0x53f6('0x3e')][_0x53f6('0x52')]=function(){var _0x168c3f=this;return function(_0x657d7e){if(_0x657d7e){freeIsNotKey(_0x657d7e,_0x168c3f[_0x53f6('0x53')],'id');for(var _0x337cac=0x0,_0x4c7915={},_0xcc704c={};_0x337cac<_0x657d7e[_0x53f6('0x41')];_0x337cac+=0x1){_0x4c7915=_0x657d7e[_0x337cac];if(_['isUndefined'](_0x168c3f[_0x53f6('0x53')][_0x4c7915['id']])){_0x168c3f['freshsalesAccounts'][_0x4c7915['id']]=new FreshsalesAccount(_0x4c7915);}else{_0x168c3f[_0x53f6('0x3f')](_0x168c3f[_0x53f6('0x53')][_0x4c7915['id']],_0x4c7915);}}}return _0x168c3f[_0x53f6('0x53')];};};Realtime[_0x53f6('0x3e')][_0x53f6('0x54')]=function(){var _0x55e763=this;return function(_0x181e02){for(var _0x58aa3d=0x0;_0x58aa3d<_0x181e02[_0x53f6('0x41')];_0x58aa3d+=0x1){_['merge'](_0x55e763[_0x53f6('0x10')][_0x181e02[_0x58aa3d][_0x53f6('0x2a')]],_0x181e02[_0x58aa3d]);}return _0x55e763['voiceQueues'];};};Realtime[_0x53f6('0x3e')][_0x53f6('0x55')]=function(){var _0x261a78=this;return function(_0x1e6134){clearVoiceQueues(_0x261a78[_0x53f6('0x10')]);if(_0x1e6134){_0x1e6134=_[_0x53f6('0x56')](_0x1e6134,'uniqueid');for(var _0x41cd41 in _0x1e6134){if(_0x1e6134[_0x53f6('0x25')](_0x41cd41)){var _0x30445f={};for(var _0xbe0d7a=0x0;_0xbe0d7a<_0x1e6134[_0x41cd41][_0x53f6('0x41')];_0xbe0d7a+=0x1){var _0x40bcb7=_0x1e6134[_0x41cd41][_0xbe0d7a][_0x53f6('0x57')];if(_0x261a78[_0x53f6('0x10')][_0x40bcb7]){if(_0x1e6134[_0x41cd41][_0xbe0d7a][_0x53f6('0x58')]){_0x261a78[_0x53f6('0x10')][_0x40bcb7][_0x53f6('0x32')]+=0x1;}if(_0x1e6134[_0x41cd41][_0xbe0d7a][_0x53f6('0x59')]){_0x261a78[_0x53f6('0x10')][_0x40bcb7][_0x53f6('0x5a')]+=0x1;}_0x261a78[_0x53f6('0x10')][_0x40bcb7][_0x53f6('0x2b')]+=moment(_0x1e6134[_0x41cd41][_0xbe0d7a][_0x53f6('0x5b')])[_0x53f6('0x5c')](moment(_0x1e6134[_0x41cd41][_0xbe0d7a][_0x53f6('0x5d')]),_0x53f6('0x5e'))||0x0;if(_0xbe0d7a===_0x1e6134[_0x41cd41][_0x53f6('0x41')]-0x1){_0x261a78[_0x53f6('0x10')][_0x40bcb7]['sumDuration']+=moment(_0x1e6134[_0x41cd41][_0xbe0d7a][_0x53f6('0x5f')]||_0x1e6134[_0x41cd41][_0xbe0d7a]['queuecallerabandonAt']||_0x1e6134[_0x41cd41][_0xbe0d7a][_0x53f6('0x60')])[_0x53f6('0x5c')](moment(_0x1e6134[_0x41cd41][_0xbe0d7a]['queuecallerjoinAt']),'seconds')||0x0;_0x261a78[_0x53f6('0x10')][_0x40bcb7][_0x53f6('0x30')]+=0x1;if(_0x1e6134[_0x41cd41][_0xbe0d7a]['queuecallercomplete']){_0x261a78[_0x53f6('0x10')][_0x40bcb7][_0x53f6('0x31')]+=0x1;_0x261a78[_0x53f6('0x10')][_0x40bcb7]['sumBillable']+=moment(_0x1e6134[_0x41cd41][_0xbe0d7a][_0x53f6('0x5f')])[_0x53f6('0x5c')](moment(_0x1e6134[_0x41cd41][_0xbe0d7a]['queuecallerleaveAt']),_0x53f6('0x5e'))||0x0;}}else{_0x261a78[_0x53f6('0x10')][_0x40bcb7][_0x53f6('0x2c')]+=_0x261a78['voiceQueues'][_0x40bcb7]['sumHoldTime']||0x0;}}}}}}return _0x261a78[_0x53f6('0x10')];};};Realtime['prototype'][_0x53f6('0x61')]=function(){var _0x34768c=this;return function(_0x105763){clearVoiceCallReports(_0x34768c[_0x53f6('0x14')]);if(_0x105763){for(var _0x4d3c29=0x0;_0x4d3c29<_0x105763[_0x53f6('0x41')];_0x4d3c29+=0x1){_0x34768c['outbound']['total']+=0x1;_0x34768c[_0x53f6('0x14')][_0x53f6('0x2c')]+=_0x105763[_0x4d3c29][_0x53f6('0x62')];if(_0x105763[_0x4d3c29][_0x53f6('0x63')]===_0x53f6('0x64')){_0x34768c['outbound'][_0x53f6('0x31')]+=0x1;_0x34768c[_0x53f6('0x14')][_0x53f6('0x2b')]+=_0x105763[_0x4d3c29][_0x53f6('0x62')]-_0x105763[_0x4d3c29][_0x53f6('0x65')]||0x0;_0x34768c[_0x53f6('0x14')][_0x53f6('0x66')]+=_0x105763[_0x4d3c29]['billableseconds'];}}}return _0x34768c[_0x53f6('0x14')];};};Realtime[_0x53f6('0x3e')][_0x53f6('0x67')]=function(){var _0x2d27aa=this;return function(_0x393b8f){if(_0x393b8f){freeIsNotKey(_0x393b8f,_0x2d27aa['campaigns'],_0x53f6('0x2a'));for(var _0x4aa2e8=0x0,_0x3d8ed3={};_0x4aa2e8<_0x393b8f[_0x53f6('0x41')];_0x4aa2e8+=0x1){_0x3d8ed3=_0x393b8f[_0x4aa2e8];if(_[_0x53f6('0x43')](_0x2d27aa['campaigns'][_0x3d8ed3[_0x53f6('0x2a')]])){_0x2d27aa[_0x53f6('0x12')][_0x3d8ed3[_0x53f6('0x2a')]]=new Campaign(_0x3d8ed3);}else{_0x2d27aa['mergeFromDatabase'](_0x2d27aa[_0x53f6('0x12')][_0x3d8ed3[_0x53f6('0x2a')]],_0x3d8ed3);_0x2d27aa[_0x53f6('0x12')][_0x3d8ed3['name']]['dialQueueProject']=_0x3d8ed3[_0x53f6('0x68')]?_0x3d8ed3[_0x53f6('0x68')][_0x53f6('0x2a')]:undefined;}}}return _0x2d27aa['campaigns'];};};Realtime[_0x53f6('0x3e')]['initVoiceExtensions']=function(){var _0x3510a0=this;return function(_0x388db2){if(_0x388db2){freeIsNotKey(_0x388db2,_0x3510a0['voiceExtensions'],'id');for(var _0x193bbe=0x0,_0x4caf7a={};_0x193bbe<_0x388db2['length'];_0x193bbe+=0x1){_0x4caf7a=_0x388db2[_0x193bbe];if(_[_0x53f6('0x43')](_0x3510a0['voiceExtensions'][_0x4caf7a['id']])){_0x3510a0[_0x53f6('0x15')][_0x4caf7a['id']]=new VoiceExtension(_0x4caf7a);}else{_0x3510a0['mergeFromDatabase'](_0x3510a0[_0x53f6('0x15')][_0x4caf7a['id']],_0x4caf7a);}}}return _0x3510a0[_0x53f6('0x15')];};};Realtime[_0x53f6('0x3e')]['initCampaignHopperHistory']=function(){var _0x1258a5=this;return function(_0x4b46b3){clearCampaigns(_0x1258a5[_0x53f6('0x12')]);for(var _0x5166f1=0x0;_0x5166f1<_0x4b46b3[_0x53f6('0x41')];_0x5166f1+=0x1){_[_0x53f6('0x69')](_0x1258a5['campaigns'][_0x4b46b3[_0x5166f1]['name']],_0x4b46b3[_0x5166f1]);}return _0x1258a5[_0x53f6('0x12')];};};Realtime[_0x53f6('0x3e')]['initFaxAccounts']=function(){var _0x2006b7=this;return function(_0x5d3bcb){if(_0x5d3bcb){freeIsNotKey(_0x5d3bcb,_0x2006b7[_0x53f6('0x23')],'id');for(var _0xd658f1=0x0,_0x2028f7={},_0x537198={};_0xd658f1<_0x5d3bcb[_0x53f6('0x41')];_0xd658f1+=0x1){_0x2028f7=_0x5d3bcb[_0xd658f1];if(_[_0x53f6('0x43')](_0x2006b7[_0x53f6('0x23')][_0x2028f7['id']])){_0x2006b7['faxAccounts'][_0x2028f7['id']]=new FaxAccount(_0x2028f7);}else{_0x2006b7[_0x53f6('0x3f')](_0x2006b7[_0x53f6('0x23')][_0x2028f7['id']],_0x2028f7);}}}return _0x2006b7[_0x53f6('0x23')];};};module[_0x53f6('0x6a')]=Realtime;
\ No newline at end of file
+var _0x48df=['name','mapKeys','interface','total','sumBillable','isEmpty','ivrTotalCallsDays','answered','unmanaged','abandoned','sumDuration','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerCallsDay','prototype','mergeFromDatabase','agents','length','isUndefined','initTelephones','voiceQueues','initTemplates','initZendeskAccounts','initSalesforceAccounts','salesforceAccounts','initFreshdeskAccounts','freshdeskAccounts','initDeskAccounts','initVtigerAccounts','vtigerAccounts','initServicenowAccounts','initDynamics365Accounts','dynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','merge','groupBy','queue','queuecallerexit','sumHoldTime','queuecallerleaveAt','queuecallerjoinAt','queuecallercompleteAt','queuecallerexitAt','seconds','queuecallercomplete','diff','initVoiceCallReports','duration','disposition','ANSWERED','billableseconds','initCampaigns','campaigns','SquareProject','initVoiceExtensions','initCampaignHopperHistory','initFaxAccounts','faxAccounts','exports','bluebird','util','lodash','moment','../model/agent','../model/telephone','../model/trunk','../model/voiceQueue','../model/trigger','../model/template','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/zohoAccount','../model/deskAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','telephones','trunks','triggers','templates','outbound','voiceExtensions','queueChannels','outboundChannels','timers','settings','zendeskAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','servicenowAccounts','freshsalesAccounts','hasOwnProperty','format','SIP/%s'];(function(_0x2faf27,_0x4f2a34){var _0x49ee0a=function(_0xd4a2aa){while(--_0xd4a2aa){_0x2faf27['push'](_0x2faf27['shift']());}};_0x49ee0a(++_0x4f2a34);}(_0x48df,0x189));var _0xf48d=function(_0x267d8d,_0xe90f65){_0x267d8d=_0x267d8d-0x0;var _0x11a98f=_0x48df[_0x267d8d];return _0x11a98f;};'use strict';var BPromise=require(_0xf48d('0x0'));var util=require(_0xf48d('0x1'));var _=require(_0xf48d('0x2'));var moment=require(_0xf48d('0x3'));var Agent=require(_0xf48d('0x4'));var Telephone=require(_0xf48d('0x5'));var Trunk=require(_0xf48d('0x6'));var VoiceQueue=require(_0xf48d('0x7'));var Trigger=require(_0xf48d('0x8'));var Template=require(_0xf48d('0x9'));var Campaign=require(_0xf48d('0xa'));var VoiceExtension=require(_0xf48d('0xb'));var ZendeskAccount=require(_0xf48d('0xc'));var SalesforceAccount=require(_0xf48d('0xd'));var FreshdeskAccount=require(_0xf48d('0xe'));var SugarcrmAccount=require('../model/sugarcrmAccount');var ZohoAccount=require(_0xf48d('0xf'));var DeskAccount=require(_0xf48d('0x10'));var VtigerAccount=require('../model/vtigerAccount');var ServicenowAccount=require('../model/servicenowAccount');var Dynamics365Account=require(_0xf48d('0x11'));var FreshsalesAccount=require(_0xf48d('0x12'));var FaxAccount=require(_0xf48d('0x13'));var Realtime=function(){this['agents']={};this[_0xf48d('0x14')]={};this[_0xf48d('0x15')]={};this['voiceQueues']={};this[_0xf48d('0x16')]={};this['campaigns']={};this[_0xf48d('0x17')]={};this[_0xf48d('0x18')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0xf48d('0x19')]={};this['channels']={};this[_0xf48d('0x1a')]={};this[_0xf48d('0x1b')]={};this[_0xf48d('0x1c')]={};this[_0xf48d('0x1d')]={};this[_0xf48d('0x1e')]={};this['salesforceAccounts']={};this[_0xf48d('0x1f')]={};this['freshdeskAccounts']={};this[_0xf48d('0x20')]={};this[_0xf48d('0x21')]={};this['vtigerAccounts']={};this[_0xf48d('0x22')]={};this['dynamics365Accounts']={};this[_0xf48d('0x23')]={};this['faxAccounts']={};};function freeIsNotKey(_0x292b5c,_0x2c140f,_0x4ff338){var _0x390286=_['mapKeys'](_0x292b5c,function(_0x59a3b7,_0x96669b){return _0x59a3b7[_0x4ff338];});for(var _0x4404a0 in _0x2c140f){if(_0x2c140f[_0xf48d('0x24')](_0x4404a0)){if(!_0x390286[_0x4404a0]){delete _0x2c140f[_0x4404a0];}}}}function freeIsNotKeySip(_0x938e7d,_0x4e0ad9){var _0x4088f1=_['mapKeys'](_0x938e7d,function(_0xd820e0,_0x2c87f0){return util[_0xf48d('0x25')](_0xf48d('0x26'),_0xd820e0[_0xf48d('0x27')]);});for(var _0x193030 in _0x4e0ad9){if(_0x4e0ad9[_0xf48d('0x24')](_0x193030)){if(!_0x4088f1[_0x193030]){delete _0x4e0ad9[_0x193030];}}}}function freeIsNotKeyAgent(_0x2b47a4,_0x3e4a86){var _0x1fd6a9=_[_0xf48d('0x28')](_0x2b47a4,function(_0x3f9eb2,_0x29f4da){var _0x3a6575=_['isNil'](_0x3f9eb2[_0xf48d('0x29')])?util[_0xf48d('0x25')](_0xf48d('0x26'),_0x3f9eb2['name']):_0x3f9eb2[_0xf48d('0x29')];return _0x3a6575;});for(var _0x430e66 in _0x3e4a86){if(_0x3e4a86[_0xf48d('0x24')](_0x430e66)){if(!_0x1fd6a9[_0x430e66]){delete _0x3e4a86[_0x430e66];}}}}function clearVoiceCallReports(_0x251f5c){_0x251f5c[_0xf48d('0x2a')]=0x0;_0x251f5c['answered']=0x0;_0x251f5c['sumHoldTime']=0x0;_0x251f5c['sumDuration']=0x0;_0x251f5c[_0xf48d('0x2b')]=0x0;}function clearCampaigns(_0x2062a5){if(!_[_0xf48d('0x2c')](_0x2062a5)){for(var _0x1169f5 in _0x2062a5){if(_0x2062a5[_0xf48d('0x24')](_0x1169f5)){_0x2062a5[_0x1169f5][_0xf48d('0x2d')]=0x0;_0x2062a5[_0x1169f5]['ivrAnswerCallsDay']=0x0;}}}}function clearVoiceQueues(_0x13e03f){if(!_[_0xf48d('0x2c')](_0x13e03f)){for(var _0x104a1a in _0x13e03f){if(_0x13e03f[_0xf48d('0x24')](_0x104a1a)){_0x13e03f[_0x104a1a][_0xf48d('0x2a')]=0x0;_0x13e03f[_0x104a1a][_0xf48d('0x2e')]=0x0;_0x13e03f[_0x104a1a][_0xf48d('0x2f')]=0x0;_0x13e03f[_0x104a1a][_0xf48d('0x30')]=0x0;_0x13e03f[_0x104a1a]['sumHoldTime']=0x0;_0x13e03f[_0x104a1a][_0xf48d('0x31')]=0x0;_0x13e03f[_0x104a1a][_0xf48d('0x2b')]=0x0;_0x13e03f[_0x104a1a][_0xf48d('0x32')]=0x0;_0x13e03f[_0x104a1a][_0xf48d('0x33')]=0x0;_0x13e03f[_0x104a1a][_0xf48d('0x34')]=0x0;_0x13e03f[_0x104a1a][_0xf48d('0x35')]=0x0;_0x13e03f[_0x104a1a][_0xf48d('0x36')]=0x0;_0x13e03f[_0x104a1a]['outboundUnknownCallsDay']=0x0;_0x13e03f[_0x104a1a][_0xf48d('0x37')]=0x0;_0x13e03f[_0x104a1a][_0xf48d('0x38')]=0x0;_0x13e03f[_0x104a1a][_0xf48d('0x39')]=0x0;_0x13e03f[_0x104a1a][_0xf48d('0x3a')]=0x0;_0x13e03f[_0x104a1a][_0xf48d('0x3b')]=0x0;_0x13e03f[_0x104a1a][_0xf48d('0x3c')]=0x0;_0x13e03f[_0x104a1a][_0xf48d('0x32')]=0x0;_0x13e03f[_0x104a1a][_0xf48d('0x3d')]=0x0;_0x13e03f[_0x104a1a]['queueStatusComplete']=!![];}}}}Realtime[_0xf48d('0x3e')][_0xf48d('0x3f')]=function(_0x5c21ea,_0xed7926){for(var _0x420afa in _0xed7926){if(_0x5c21ea[_0xf48d('0x24')](_0x420afa)){_0x5c21ea[_0x420afa]=_0xed7926[_0x420afa];}}};Realtime[_0xf48d('0x3e')]['initAgents']=function(){var _0x5c3cd0=this;return function(_0x332255){if(_0x332255){freeIsNotKeyAgent(_0x332255,_0x5c3cd0[_0xf48d('0x40')]);for(var _0x315b5f=0x0,_0x52715c={},_0x48f4d6={};_0x315b5f<_0x332255[_0xf48d('0x41')];_0x315b5f+=0x1){_0x52715c=_0x332255[_0x315b5f];var _0x9e958f=_['isNil'](_0x52715c['interface'])?util[_0xf48d('0x25')](_0xf48d('0x26'),_0x52715c[_0xf48d('0x27')]):_0x52715c[_0xf48d('0x29')];if(_[_0xf48d('0x42')](_0x5c3cd0[_0xf48d('0x40')][_0x9e958f])){_0x5c3cd0['agents'][_0x9e958f]=new Agent(_0x52715c);}else{_0x5c3cd0['mergeFromDatabase'](_0x5c3cd0[_0xf48d('0x40')][_0x9e958f],_0x52715c);}}}return _0x5c3cd0['agents'];};};Realtime[_0xf48d('0x3e')][_0xf48d('0x43')]=function(){var _0xff0eaa=this;return function(_0xbb0431){if(_0xbb0431){freeIsNotKeySip(_0xbb0431,_0xff0eaa[_0xf48d('0x14')]);for(var _0x104a9f=0x0,_0x284d9f={},_0x3a64fb={};_0x104a9f<_0xbb0431['length'];_0x104a9f+=0x1){_0x284d9f=_0xbb0431[_0x104a9f];if(_[_0xf48d('0x42')](_0xff0eaa[_0xf48d('0x14')][util[_0xf48d('0x25')](_0xf48d('0x26'),_0x284d9f['name'])])){_0xff0eaa[_0xf48d('0x14')][util[_0xf48d('0x25')]('SIP/%s',_0x284d9f[_0xf48d('0x27')])]=new Telephone(_0x284d9f);}else{_0xff0eaa[_0xf48d('0x3f')](_0xff0eaa['telephones'][util[_0xf48d('0x25')]('SIP/%s',_0x284d9f['name'])],_0x284d9f);}}}return _0xff0eaa[_0xf48d('0x14')];};};Realtime[_0xf48d('0x3e')]['initTrunks']=function(){var _0x1a9935=this;return function(_0x4e2a5f){if(_0x4e2a5f){freeIsNotKeySip(_0x4e2a5f,_0x1a9935[_0xf48d('0x15')]);for(var _0x18daf7=0x0,_0x4e6847={},_0x6ae826={};_0x18daf7<_0x4e2a5f[_0xf48d('0x41')];_0x18daf7+=0x1){_0x4e6847=_0x4e2a5f[_0x18daf7];if(_[_0xf48d('0x42')](_0x1a9935['trunks'][util['format'](_0xf48d('0x26'),_0x4e6847['name'])])){_0x1a9935[_0xf48d('0x15')][util[_0xf48d('0x25')](_0xf48d('0x26'),_0x4e6847[_0xf48d('0x27')])]=new Trunk(_0x4e6847);}else{_0x1a9935[_0xf48d('0x3f')](_0x1a9935[_0xf48d('0x15')][util[_0xf48d('0x25')](_0xf48d('0x26'),_0x4e6847[_0xf48d('0x27')])],_0x4e6847);}}}return _0x1a9935['trunks'];};};Realtime[_0xf48d('0x3e')]['initVoiceQueues']=function(){var _0x3bce6c=this;return function(_0x42b193){if(_0x42b193){freeIsNotKey(_0x42b193,_0x3bce6c[_0xf48d('0x44')],_0xf48d('0x27'));for(var _0x3a1b4c=0x0,_0x59419f={},_0x19776e={};_0x3a1b4c<_0x42b193[_0xf48d('0x41')];_0x3a1b4c+=0x1){_0x59419f=_0x42b193[_0x3a1b4c];if(_[_0xf48d('0x42')](_0x3bce6c[_0xf48d('0x44')][_0x59419f[_0xf48d('0x27')]])){_0x3bce6c[_0xf48d('0x44')][_0x59419f[_0xf48d('0x27')]]=new VoiceQueue(_0x59419f);}else{_0x3bce6c['mergeFromDatabase'](_0x3bce6c[_0xf48d('0x44')][_0x59419f[_0xf48d('0x27')]],_0x59419f);}}}return _0x3bce6c[_0xf48d('0x44')];};};Realtime[_0xf48d('0x3e')]['initTriggers']=function(){var _0x413551=this;return function(_0x54a2c5){if(_0x54a2c5){freeIsNotKey(_0x54a2c5,_0x413551[_0xf48d('0x16')],'id');for(var _0x2d9c89=0x0,_0x207e78={},_0x1a4508={};_0x2d9c89<_0x54a2c5[_0xf48d('0x41')];_0x2d9c89+=0x1){_0x207e78=_0x54a2c5[_0x2d9c89];if(_['isUndefined'](_0x413551[_0xf48d('0x16')][_0x207e78['id']])){_0x413551[_0xf48d('0x16')][_0x207e78['id']]=new Trigger(_0x207e78);}else{_0x413551['mergeFromDatabase'](_0x413551[_0xf48d('0x16')][_0x207e78['id']],_0x207e78);}}}return _0x413551['triggers'];};};Realtime[_0xf48d('0x3e')][_0xf48d('0x45')]=function(){var _0x371602=this;return function(_0x2eda8f){if(_0x2eda8f){freeIsNotKey(_0x2eda8f,_0x371602['templates'],'id');for(var _0x4d70e4=0x0,_0x327d89={},_0x3a6816={};_0x4d70e4<_0x2eda8f['length'];_0x4d70e4+=0x1){_0x327d89=_0x2eda8f[_0x4d70e4];if(_[_0xf48d('0x42')](_0x371602['templates'][_0x327d89['id']])){_0x371602[_0xf48d('0x17')][_0x327d89['id']]=new Template(_0x327d89);}else{_0x371602[_0xf48d('0x3f')](_0x371602['templates'][_0x327d89['id']],_0x327d89);}}}return _0x371602[_0xf48d('0x17')];};};Realtime[_0xf48d('0x3e')][_0xf48d('0x46')]=function(){var _0x511a65=this;return function(_0x291764){if(_0x291764){freeIsNotKey(_0x291764,_0x511a65[_0xf48d('0x1e')],'id');for(var _0x343d76=0x0,_0x1782eb={},_0x21e7a6={};_0x343d76<_0x291764[_0xf48d('0x41')];_0x343d76+=0x1){_0x1782eb=_0x291764[_0x343d76];if(_['isUndefined'](_0x511a65[_0xf48d('0x1e')][_0x1782eb['id']])){_0x511a65['zendeskAccounts'][_0x1782eb['id']]=new ZendeskAccount(_0x1782eb);}else{_0x511a65['mergeFromDatabase'](_0x511a65[_0xf48d('0x1e')][_0x1782eb['id']],_0x1782eb);}}}return _0x511a65[_0xf48d('0x1e')];};};Realtime[_0xf48d('0x3e')][_0xf48d('0x47')]=function(){var _0xf40cda=this;return function(_0x10e1b9){if(_0x10e1b9){freeIsNotKey(_0x10e1b9,_0xf40cda[_0xf48d('0x48')],'id');for(var _0x375ea7=0x0,_0x14cfca={},_0x4cb272={};_0x375ea7<_0x10e1b9[_0xf48d('0x41')];_0x375ea7+=0x1){_0x14cfca=_0x10e1b9[_0x375ea7];if(_[_0xf48d('0x42')](_0xf40cda[_0xf48d('0x48')][_0x14cfca['id']])){_0xf40cda[_0xf48d('0x48')][_0x14cfca['id']]=new SalesforceAccount(_0x14cfca);}else{_0xf40cda[_0xf48d('0x3f')](_0xf40cda[_0xf48d('0x48')][_0x14cfca['id']],_0x14cfca);}}}return _0xf40cda[_0xf48d('0x48')];};};Realtime[_0xf48d('0x3e')][_0xf48d('0x49')]=function(){var _0x9bc2a3=this;return function(_0x66230a){if(_0x66230a){freeIsNotKey(_0x66230a,_0x9bc2a3[_0xf48d('0x4a')],'id');for(var _0x5bba3a=0x0,_0xcdf7ab={},_0x2c56af={};_0x5bba3a<_0x66230a['length'];_0x5bba3a+=0x1){_0xcdf7ab=_0x66230a[_0x5bba3a];if(_['isUndefined'](_0x9bc2a3['freshdeskAccounts'][_0xcdf7ab['id']])){_0x9bc2a3['freshdeskAccounts'][_0xcdf7ab['id']]=new FreshdeskAccount(_0xcdf7ab);}else{_0x9bc2a3[_0xf48d('0x3f')](_0x9bc2a3[_0xf48d('0x4a')][_0xcdf7ab['id']],_0xcdf7ab);}}}return _0x9bc2a3[_0xf48d('0x4a')];};};Realtime['prototype']['initZohoAccounts']=function(){var _0x48bb7b=this;return function(_0x2c54fb){if(_0x2c54fb){freeIsNotKey(_0x2c54fb,_0x48bb7b[_0xf48d('0x20')],'id');for(var _0x1d0fb8=0x0,_0x297735={},_0x4c4610={};_0x1d0fb8<_0x2c54fb[_0xf48d('0x41')];_0x1d0fb8+=0x1){_0x297735=_0x2c54fb[_0x1d0fb8];if(_['isUndefined'](_0x48bb7b[_0xf48d('0x20')][_0x297735['id']])){_0x48bb7b[_0xf48d('0x20')][_0x297735['id']]=new ZohoAccount(_0x297735);}else{_0x48bb7b['mergeFromDatabase'](_0x48bb7b[_0xf48d('0x20')][_0x297735['id']],_0x297735);}}}return _0x48bb7b[_0xf48d('0x20')];};};Realtime[_0xf48d('0x3e')][_0xf48d('0x4b')]=function(){var _0x36c3b7=this;return function(_0x3e1ebf){if(_0x3e1ebf){freeIsNotKey(_0x3e1ebf,_0x36c3b7[_0xf48d('0x21')],'id');for(var _0x286ae2=0x0,_0x1e957e={},_0x38f89d={};_0x286ae2<_0x3e1ebf['length'];_0x286ae2+=0x1){_0x1e957e=_0x3e1ebf[_0x286ae2];if(_[_0xf48d('0x42')](_0x36c3b7[_0xf48d('0x21')][_0x1e957e['id']])){_0x36c3b7[_0xf48d('0x21')][_0x1e957e['id']]=new DeskAccount(_0x1e957e);}else{_0x36c3b7['mergeFromDatabase'](_0x36c3b7[_0xf48d('0x21')][_0x1e957e['id']],_0x1e957e);}}}return _0x36c3b7[_0xf48d('0x21')];};};Realtime[_0xf48d('0x3e')]['initSugarcrmAccounts']=function(){var _0x21c13f=this;return function(_0x3b355b){if(_0x3b355b){freeIsNotKey(_0x3b355b,_0x21c13f['sugarcrmAccounts'],'id');for(var _0x555496=0x0,_0x37969f={},_0x5f3c3a={};_0x555496<_0x3b355b[_0xf48d('0x41')];_0x555496+=0x1){_0x37969f=_0x3b355b[_0x555496];if(_[_0xf48d('0x42')](_0x21c13f['sugarcrmAccounts'][_0x37969f['id']])){_0x21c13f[_0xf48d('0x1f')][_0x37969f['id']]=new SugarcrmAccount(_0x37969f);}else{_0x21c13f[_0xf48d('0x3f')](_0x21c13f['sugarcrmAccounts'][_0x37969f['id']],_0x37969f);}}}return _0x21c13f[_0xf48d('0x1f')];};};Realtime[_0xf48d('0x3e')][_0xf48d('0x4c')]=function(){var _0x1ef507=this;return function(_0x5d7c71){if(_0x5d7c71){freeIsNotKey(_0x5d7c71,_0x1ef507[_0xf48d('0x4d')],'id');for(var _0x3c6727=0x0,_0x11709b={},_0x568c46={};_0x3c6727<_0x5d7c71[_0xf48d('0x41')];_0x3c6727+=0x1){_0x11709b=_0x5d7c71[_0x3c6727];if(_['isUndefined'](_0x1ef507[_0xf48d('0x4d')][_0x11709b['id']])){_0x1ef507[_0xf48d('0x4d')][_0x11709b['id']]=new VtigerAccount(_0x11709b);}else{_0x1ef507[_0xf48d('0x3f')](_0x1ef507[_0xf48d('0x4d')][_0x11709b['id']],_0x11709b);}}}return _0x1ef507[_0xf48d('0x4d')];};};Realtime['prototype'][_0xf48d('0x4e')]=function(){var _0x34a147=this;return function(_0x395747){if(_0x395747){freeIsNotKey(_0x395747,_0x34a147['servicenowAccounts'],'id');for(var _0x8c6cc4=0x0,_0x50e4fb={},_0x1759a7={};_0x8c6cc4<_0x395747[_0xf48d('0x41')];_0x8c6cc4+=0x1){_0x50e4fb=_0x395747[_0x8c6cc4];if(_[_0xf48d('0x42')](_0x34a147[_0xf48d('0x22')][_0x50e4fb['id']])){_0x34a147[_0xf48d('0x22')][_0x50e4fb['id']]=new ServicenowAccount(_0x50e4fb);}else{_0x34a147[_0xf48d('0x3f')](_0x34a147[_0xf48d('0x22')][_0x50e4fb['id']],_0x50e4fb);}}}return _0x34a147['servicenowAccounts'];};};Realtime['prototype'][_0xf48d('0x4f')]=function(){var _0x573f80=this;return function(_0x412a42){if(_0x412a42){freeIsNotKey(_0x412a42,_0x573f80[_0xf48d('0x50')],'id');for(var _0x3ad8fa=0x0,_0x413a80={},_0x1c7125={};_0x3ad8fa<_0x412a42[_0xf48d('0x41')];_0x3ad8fa+=0x1){_0x413a80=_0x412a42[_0x3ad8fa];if(_['isUndefined'](_0x573f80['dynamics365Accounts'][_0x413a80['id']])){_0x573f80[_0xf48d('0x50')][_0x413a80['id']]=new Dynamics365Account(_0x413a80);}else{_0x573f80['mergeFromDatabase'](_0x573f80[_0xf48d('0x50')][_0x413a80['id']],_0x413a80);}}}return _0x573f80[_0xf48d('0x50')];};};Realtime[_0xf48d('0x3e')][_0xf48d('0x51')]=function(){var _0x243462=this;return function(_0x362325){if(_0x362325){freeIsNotKey(_0x362325,_0x243462[_0xf48d('0x23')],'id');for(var _0x2d3d6a=0x0,_0x417751={},_0xcb3f2={};_0x2d3d6a<_0x362325[_0xf48d('0x41')];_0x2d3d6a+=0x1){_0x417751=_0x362325[_0x2d3d6a];if(_[_0xf48d('0x42')](_0x243462['freshsalesAccounts'][_0x417751['id']])){_0x243462[_0xf48d('0x23')][_0x417751['id']]=new FreshsalesAccount(_0x417751);}else{_0x243462[_0xf48d('0x3f')](_0x243462[_0xf48d('0x23')][_0x417751['id']],_0x417751);}}}return _0x243462['freshsalesAccounts'];};};Realtime[_0xf48d('0x3e')][_0xf48d('0x52')]=function(){var _0x2e72cb=this;return function(_0x26bdc8){for(var _0x4bfcd8=0x0;_0x4bfcd8<_0x26bdc8[_0xf48d('0x41')];_0x4bfcd8+=0x1){_[_0xf48d('0x53')](_0x2e72cb[_0xf48d('0x44')][_0x26bdc8[_0x4bfcd8][_0xf48d('0x27')]],_0x26bdc8[_0x4bfcd8]);}return _0x2e72cb[_0xf48d('0x44')];};};Realtime[_0xf48d('0x3e')]['initVoiceQueueReports']=function(){var _0x1f529a=this;return function(_0x2dff4b){clearVoiceQueues(_0x1f529a['voiceQueues']);if(_0x2dff4b){_0x2dff4b=_[_0xf48d('0x54')](_0x2dff4b,'uniqueid');for(var _0x417e4b in _0x2dff4b){if(_0x2dff4b[_0xf48d('0x24')](_0x417e4b)){var _0x2d858c={};for(var _0x1594ae=0x0;_0x1594ae<_0x2dff4b[_0x417e4b]['length'];_0x1594ae+=0x1){var _0xcba770=_0x2dff4b[_0x417e4b][_0x1594ae][_0xf48d('0x55')];if(_0x1f529a['voiceQueues'][_0xcba770]){if(_0x2dff4b[_0x417e4b][_0x1594ae][_0xf48d('0x56')]){_0x1f529a[_0xf48d('0x44')][_0xcba770][_0xf48d('0x2f')]+=0x1;}if(_0x2dff4b[_0x417e4b][_0x1594ae]['queuecallerabandon']){_0x1f529a[_0xf48d('0x44')][_0xcba770][_0xf48d('0x30')]+=0x1;}_0x1f529a['voiceQueues'][_0xcba770][_0xf48d('0x57')]+=moment(_0x2dff4b[_0x417e4b][_0x1594ae][_0xf48d('0x58')])['diff'](moment(_0x2dff4b[_0x417e4b][_0x1594ae][_0xf48d('0x59')]),'seconds')||0x0;if(_0x1594ae===_0x2dff4b[_0x417e4b]['length']-0x1){_0x1f529a['voiceQueues'][_0xcba770][_0xf48d('0x31')]+=moment(_0x2dff4b[_0x417e4b][_0x1594ae][_0xf48d('0x5a')]||_0x2dff4b[_0x417e4b][_0x1594ae]['queuecallerabandonAt']||_0x2dff4b[_0x417e4b][_0x1594ae][_0xf48d('0x5b')])['diff'](moment(_0x2dff4b[_0x417e4b][_0x1594ae][_0xf48d('0x59')]),_0xf48d('0x5c'))||0x0;_0x1f529a['voiceQueues'][_0xcba770][_0xf48d('0x2a')]+=0x1;if(_0x2dff4b[_0x417e4b][_0x1594ae][_0xf48d('0x5d')]){_0x1f529a[_0xf48d('0x44')][_0xcba770][_0xf48d('0x2e')]+=0x1;_0x1f529a[_0xf48d('0x44')][_0xcba770][_0xf48d('0x2b')]+=moment(_0x2dff4b[_0x417e4b][_0x1594ae][_0xf48d('0x5a')])[_0xf48d('0x5e')](moment(_0x2dff4b[_0x417e4b][_0x1594ae][_0xf48d('0x58')]),_0xf48d('0x5c'))||0x0;}}else{_0x1f529a[_0xf48d('0x44')][_0xcba770]['sumDuration']+=_0x1f529a['voiceQueues'][_0xcba770][_0xf48d('0x57')]||0x0;}}}}}}return _0x1f529a['voiceQueues'];};};Realtime['prototype'][_0xf48d('0x5f')]=function(){var _0x395a8e=this;return function(_0x41cedb){clearVoiceCallReports(_0x395a8e[_0xf48d('0x18')]);if(_0x41cedb){for(var _0x4df489=0x0;_0x4df489<_0x41cedb[_0xf48d('0x41')];_0x4df489+=0x1){_0x395a8e[_0xf48d('0x18')][_0xf48d('0x2a')]+=0x1;_0x395a8e[_0xf48d('0x18')][_0xf48d('0x31')]+=_0x41cedb[_0x4df489][_0xf48d('0x60')];if(_0x41cedb[_0x4df489][_0xf48d('0x61')]===_0xf48d('0x62')){_0x395a8e[_0xf48d('0x18')][_0xf48d('0x2e')]+=0x1;_0x395a8e[_0xf48d('0x18')][_0xf48d('0x57')]+=_0x41cedb[_0x4df489]['duration']-_0x41cedb[_0x4df489][_0xf48d('0x63')]||0x0;_0x395a8e['outbound']['sumBillable']+=_0x41cedb[_0x4df489]['billableseconds'];}}}return _0x395a8e[_0xf48d('0x18')];};};Realtime[_0xf48d('0x3e')][_0xf48d('0x64')]=function(){var _0x56f445=this;return function(_0x301201){if(_0x301201){freeIsNotKey(_0x301201,_0x56f445[_0xf48d('0x65')],_0xf48d('0x27'));for(var _0x5a3ff6=0x0,_0xd70b92={};_0x5a3ff6<_0x301201[_0xf48d('0x41')];_0x5a3ff6+=0x1){_0xd70b92=_0x301201[_0x5a3ff6];if(_[_0xf48d('0x42')](_0x56f445[_0xf48d('0x65')][_0xd70b92['name']])){_0x56f445[_0xf48d('0x65')][_0xd70b92[_0xf48d('0x27')]]=new Campaign(_0xd70b92);}else{_0x56f445[_0xf48d('0x3f')](_0x56f445[_0xf48d('0x65')][_0xd70b92[_0xf48d('0x27')]],_0xd70b92);_0x56f445['campaigns'][_0xd70b92[_0xf48d('0x27')]]['dialQueueProject']=_0xd70b92[_0xf48d('0x66')]?_0xd70b92[_0xf48d('0x66')]['name']:undefined;}}}return _0x56f445['campaigns'];};};Realtime[_0xf48d('0x3e')][_0xf48d('0x67')]=function(){var _0x4460cf=this;return function(_0x59c5c7){if(_0x59c5c7){freeIsNotKey(_0x59c5c7,_0x4460cf['voiceExtensions'],'id');for(var _0x235209=0x0,_0x384009={};_0x235209<_0x59c5c7['length'];_0x235209+=0x1){_0x384009=_0x59c5c7[_0x235209];if(_[_0xf48d('0x42')](_0x4460cf['voiceExtensions'][_0x384009['id']])){_0x4460cf[_0xf48d('0x19')][_0x384009['id']]=new VoiceExtension(_0x384009);}else{_0x4460cf[_0xf48d('0x3f')](_0x4460cf['voiceExtensions'][_0x384009['id']],_0x384009);}}}return _0x4460cf['voiceExtensions'];};};Realtime['prototype'][_0xf48d('0x68')]=function(){var _0x3e6758=this;return function(_0x1a27ee){clearCampaigns(_0x3e6758[_0xf48d('0x65')]);for(var _0x452882=0x0;_0x452882<_0x1a27ee[_0xf48d('0x41')];_0x452882+=0x1){_['merge'](_0x3e6758[_0xf48d('0x65')][_0x1a27ee[_0x452882][_0xf48d('0x27')]],_0x1a27ee[_0x452882]);}return _0x3e6758['campaigns'];};};Realtime[_0xf48d('0x3e')][_0xf48d('0x69')]=function(){var _0x5b51e7=this;return function(_0x1a4052){if(_0x1a4052){freeIsNotKey(_0x1a4052,_0x5b51e7[_0xf48d('0x6a')],'id');for(var _0x525a76=0x0,_0x1e0077={},_0x5dda43={};_0x525a76<_0x1a4052[_0xf48d('0x41')];_0x525a76+=0x1){_0x1e0077=_0x1a4052[_0x525a76];if(_[_0xf48d('0x42')](_0x5b51e7[_0xf48d('0x6a')][_0x1e0077['id']])){_0x5b51e7['faxAccounts'][_0x1e0077['id']]=new FaxAccount(_0x1e0077);}else{_0x5b51e7[_0xf48d('0x3f')](_0x5b51e7['faxAccounts'][_0x1e0077['id']],_0x1e0077);}}}return _0x5b51e7[_0xf48d('0x6a')];};};module[_0xf48d('0x6b')]=Realtime;
\ No newline at end of file
index 6e5590e..587b115 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x47ba=['isNil','queuecallercomplete','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','create','getAgentByInternal','keys','getCallType','channel','split','calleridnum','internal','destination','type','dialer','lastapplication','queue','lastdata','context','from-voip-provider','callerid','from-sip','xcally-motion-preview','calleridpreview','destinationchannel','disposition','ANSWERED','\x22%s\x22\x20<%s>','calleridname','transfers','linkedid','uniqueid','blindTransfer','UserId','membername','monitors','monitorFilename','createdAt','exten','connectedlinename','voiceAgentReport','startsWith','Local','indexOf','mobile','lastIndexOf','exports','lodash','moment','util','../../../config/environment','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceDialReport','./userReport','telephones','sync','realtime','xdr','voiceQueueReport','bind','voiceCallReport','custom:voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','attendedtransfer','attendedTransfer','prototype','findAgent','find','agents','accountcode','name','interface','format','SIP/%s','length','connectedlinenum','assigned','lastAssignedTo'];(function(_0x29c4ba,_0x35cf72){var _0x319b56=function(_0x4a6f9b){while(--_0x4a6f9b){_0x29c4ba['push'](_0x29c4ba['shift']());}};_0x319b56(++_0x35cf72);}(_0x47ba,0x1ec));var _0xa47b=function(_0x4b17b8,_0x26aabe){_0x4b17b8=_0x4b17b8-0x0;var _0x414f8d=_0x47ba[_0x4b17b8];return _0x414f8d;};'use strict';var _=require(_0xa47b('0x0'));var moment=require(_0xa47b('0x1'));var util=require(_0xa47b('0x2'));var config=require(_0xa47b('0x3'));var ami=require(_0xa47b('0x4'));var RpcVoiceAgentReport=require(_0xa47b('0x5'));var RpcVoiceCallReport=require(_0xa47b('0x6'));var RpcVoiceDialReport=require(_0xa47b('0x7'));var RpcMemberReport=require(_0xa47b('0x8'));var RpcVoiceQueueReport=require(_0xa47b('0x9'));var RpcVoiceRecording=require(_0xa47b('0xa'));var RpcVoiceTransferReport=require(_0xa47b('0xb'));var VoiceQueueReport=require(_0xa47b('0xc'));var VoiceCallReport=require(_0xa47b('0xd'));var VoiceAgentReport=require('./voiceAgentReport');var VoiceDialReport=require(_0xa47b('0xe'));var UserReport=require(_0xa47b('0xf'));function Report(_0x367776){this['realtime']=_0x367776;this['agents']=_0x367776['agents'];this[_0xa47b('0x10')]=_0x367776[_0xa47b('0x10')];}Report['prototype'][_0xa47b('0x11')]=function(_0x51feef){var _0x5f497c=new VoiceQueueReport(this['realtime']);var _0x1e06b6=new VoiceAgentReport(this[_0xa47b('0x12')]);var _0x3de8aa=new VoiceDialReport(this['realtime']);var _0x7ed7e0=new VoiceCallReport(this[_0xa47b('0x12')]);var _0x4295c2=new UserReport(this[_0xa47b('0x12')]);if(config[_0xa47b('0x13')]&&config[_0xa47b('0x13')]['disabled']){ami['on']('custom:voiceQueueReport',this[_0xa47b('0x14')][_0xa47b('0x15')](this));ami['on']('custom:voiceCallReport',this[_0xa47b('0x16')][_0xa47b('0x15')](this));ami['on'](_0xa47b('0x17'),this['voiceAgentReport'][_0xa47b('0x15')](this));ami['on'](_0xa47b('0x18'),this[_0xa47b('0x19')][_0xa47b('0x15')](this));ami['on'](_0xa47b('0x1a'),this['blindTransfer'][_0xa47b('0x15')](this));ami['on'](_0xa47b('0x1b'),this[_0xa47b('0x1c')][_0xa47b('0x15')](this));}};Report[_0xa47b('0x1d')][_0xa47b('0x1e')]=function(_0x386766){var _0x1498f4;_0x1498f4=_[_0xa47b('0x1f')](this[_0xa47b('0x20')],function(_0x463e4c){return _0x463e4c[_0xa47b('0x21')]==_0x386766||_0x463e4c[_0xa47b('0x22')]==_0x386766;});if(_['isNil'](_0x1498f4)){var _0xef60a9=_[_0xa47b('0x1f')](this[_0xa47b('0x10')],function(_0x5874ba){return _0x5874ba[_0xa47b('0x21')]==_0x386766||_0x5874ba['name']==_0x386766;});if(_0xef60a9){_0x1498f4=_[_0xa47b('0x1f')](this[_0xa47b('0x20')],function(_0x2da340){return _0x2da340[_0xa47b('0x23')]==util[_0xa47b('0x24')](_0xa47b('0x25'),_0xef60a9[_0xa47b('0x22')]);});}}return _0x1498f4;};Report[_0xa47b('0x1d')]['voiceQueueReport']=function(_0x321973){for(var _0x23570c=0x0;_0x23570c<_0x321973[_0xa47b('0x26')];_0x23570c+=0x1){var _0x1b5c11=this[_0xa47b('0x1e')](_0x321973[_0x23570c][_0xa47b('0x27')]);if(_0x1b5c11){_0x321973[_0x23570c][_0xa47b('0x21')]=_0x1b5c11[_0xa47b('0x21')];_0x321973[_0x23570c][_0xa47b('0x28')]=!![];_0x321973[_0x23570c][_0xa47b('0x29')]=_0x1b5c11[_0xa47b('0x22')];_0x321973[_0x23570c]['interface']=_[_0xa47b('0x2a')](_0x1b5c11['interface'])?util['format'](_0xa47b('0x25'),_0x1b5c11[_0xa47b('0x22')]):_0x1b5c11['interface'];if(_0x321973[_0x23570c][_0xa47b('0x2b')]){_0x321973[_0x23570c]['queuecallercompleteAt']=moment()['format'](_0xa47b('0x2c'));}if(_0x321973[_0x23570c][_0xa47b('0x2d')]){_0x321973[_0x23570c]['queuecallerexitAt']=moment()[_0xa47b('0x24')](_0xa47b('0x2c'));}RpcMemberReport[_0xa47b('0x14')](_0x321973[_0x23570c]);}RpcVoiceQueueReport[_0xa47b('0x2e')](_0x321973[_0x23570c]);}};function extractCalleridNumber(_0x47f1a9){var _0x32ad75=_0x47f1a9['match'](/<(.*?)>/);return _0x32ad75?_0x32ad75[0x1]:_0x47f1a9;}Report[_0xa47b('0x1d')][_0xa47b('0x2f')]=function(_0x47275a){for(var _0x30b0a1=0x0;_0x30b0a1<Object[_0xa47b('0x30')](this[_0xa47b('0x20')])[_0xa47b('0x26')];_0x30b0a1++){var _0x50b682=Object[_0xa47b('0x30')](this[_0xa47b('0x20')])[_0x30b0a1];var _0x5671f2=this[_0xa47b('0x20')][_0x50b682];if(_0x5671f2[_0xa47b('0x21')]===Number(_0x47275a))return _0x5671f2;}return null;};Report[_0xa47b('0x1d')][_0xa47b('0x31')]=function(_0x237f3d){var _0x162db5=_0x237f3d[_0xa47b('0x32')][_0xa47b('0x33')]('-')[0x0];var _0x3ffb09=this['agents'][_0x162db5];if(!_0x3ffb09)_0x3ffb09=this[_0xa47b('0x2f')](_0x237f3d[_0xa47b('0x34')]);return!_0x3ffb09?'outbound':_0xa47b('0x35');};Report[_0xa47b('0x1d')][_0xa47b('0x16')]=function(_0x47dedc){_0x47dedc[_0xa47b('0x36')]=_0x47dedc[_0xa47b('0x36')]||_0x47dedc['exten'];if(_0x47dedc[_0xa47b('0x37')]==_0xa47b('0x38')){_0x47dedc[_0xa47b('0x39')]=_0xa47b('0x3a');_0x47dedc[_0xa47b('0x3b')]=_0x47dedc[_0xa47b('0x3a')];if(_0x47dedc[_0xa47b('0x3c')]==_0xa47b('0x3d')){_0x47dedc[_0xa47b('0x21')]='';_0x47dedc[_0xa47b('0x36')]=extractCalleridNumber(_0x47dedc[_0xa47b('0x3e')]);}else if(_0x47dedc[_0xa47b('0x3c')]==_0xa47b('0x3f')){if(_0x47dedc[_0xa47b('0x36')]==_0xa47b('0x40')){_0x47dedc[_0xa47b('0x36')]=extractCalleridNumber(_0x47dedc[_0xa47b('0x41')]);_0x47dedc[_0xa47b('0x34')]=_0x47dedc['originatecalleridnum'];_0x47dedc[_0xa47b('0x42')]=[_0x47dedc['channel'],_0x47dedc[_0xa47b('0x32')]=_0x47dedc[_0xa47b('0x42')]][0x0];_0x47dedc['callerid']=_0x47dedc[_0xa47b('0x41')];}else{_0x47dedc['destination']=_0x47dedc[_0xa47b('0x34')];_0x47dedc[_0xa47b('0x34')]=_0x47dedc['originatecalleridnum'];if(_0x47dedc[_0xa47b('0x43')]==_0xa47b('0x44')){_0x47dedc['accountcode']=_0x47dedc[_0xa47b('0x27')];}else{_0x47dedc[_0xa47b('0x21')]='';}}}}else{_0x47dedc[_0xa47b('0x3e')]=util[_0xa47b('0x24')](_0xa47b('0x45'),_0x47dedc[_0xa47b('0x46')],_0x47dedc[_0xa47b('0x34')]);}if(RpcVoiceTransferReport[_0xa47b('0x47')][_0x47dedc[_0xa47b('0x48')]]){var _0x549d18=RpcVoiceTransferReport[_0xa47b('0x47')][_0x47dedc['linkedid']];_0x549d18['transfereelinkedid']=_0x47dedc[_0xa47b('0x49')];RpcVoiceTransferReport[_0xa47b('0x4a')](_0x549d18);delete RpcVoiceTransferReport[_0xa47b('0x47')][_0x47dedc['linkedid']];}if(_[_0xa47b('0x2a')](_0x47dedc[_0xa47b('0x37')])){_0x47dedc[_0xa47b('0x37')]=this[_0xa47b('0x31')](_0x47dedc);}if(_[_0xa47b('0x2a')](_0x47dedc[_0xa47b('0x4b')])){var _0x49d5aa=_0x47dedc[_0xa47b('0x32')][_0xa47b('0x33')]('-')[0x0];var _0x42aece=this[_0xa47b('0x20')][_0x49d5aa];if(!_0x42aece)_0x42aece=this[_0xa47b('0x2f')](_0x47dedc[_0xa47b('0x21')]);if(_0x42aece){_0x47dedc[_0xa47b('0x4b')]=_0x42aece['id'];_0x47dedc[_0xa47b('0x4c')]=_0x42aece[_0xa47b('0x22')];}}RpcVoiceCallReport[_0xa47b('0x2e')](_0x47dedc);if(_0x47dedc['monitor']){for(var _0x1fa908=0x0;_0x1fa908<_0x47dedc[_0xa47b('0x4d')][_0xa47b('0x26')];_0x1fa908+=0x1){_0x47dedc[_0xa47b('0x4e')]=_0x47dedc[_0xa47b('0x4d')][_0x1fa908]['filename'];_0x47dedc[_0xa47b('0x4f')]=_0x47dedc[_0xa47b('0x4d')][_0x1fa908]['createdAt'];if(_0x47dedc[_0xa47b('0x50')]==_0xa47b('0x40')){_0x47dedc[_0xa47b('0x34')]=_0x47dedc[_0xa47b('0x27')];_0x47dedc[_0xa47b('0x46')]=_0x47dedc[_0xa47b('0x51')];_0x47dedc[_0xa47b('0x27')]=_0x47dedc[_0xa47b('0x21')];_0x47dedc[_0xa47b('0x51')]=_0x47dedc['membername'];_0x47dedc[_0xa47b('0x50')]=_0x47dedc['originatecalleridnum'];}else if(_0x47dedc[_0xa47b('0x50')]=='xcally-motion-dialer'){_0x47dedc['calleridnum']=_0x47dedc[_0xa47b('0x36')];_0x47dedc[_0xa47b('0x50')]=_0x47dedc['originatecalleridnum'];}RpcVoiceRecording[_0xa47b('0x2e')](_0x47dedc);}}};Report[_0xa47b('0x1d')][_0xa47b('0x52')]=function(_0x538669){if(_['isArray'](_0x538669)){_0x538669['forEach'](function(_0x4ee997){RpcVoiceAgentReport[_0xa47b('0x2e')](_0x4ee997);});}else{RpcVoiceAgentReport[_0xa47b('0x2e')](_0x538669);}};Report[_0xa47b('0x1d')][_0xa47b('0x19')]=function(_0x15f52e){RpcVoiceDialReport[_0xa47b('0x2e')](_0x15f52e);var _0x54391c;var _0x29b81c;var _0x534cfa=_0x15f52e['channel'];if(_[_0xa47b('0x53')](_0x534cfa,_0xa47b('0x54'))){_0x29b81c=_0x534cfa['substring'](_0x534cfa[_0xa47b('0x55')]('/')+0x1,_0x534cfa['indexOf']('@'));_0x54391c=_[_0xa47b('0x1f')](this['agents'],function(_0x3243a7){return _0x3243a7[_0xa47b('0x56')]==_0x29b81c||_0x3243a7['phone']==_0x29b81c||_0x3243a7[_0xa47b('0x21')]==_0x29b81c;});}else{_0x29b81c=_0x534cfa['substring'](_0x534cfa[_0xa47b('0x55')]('/')+0x1,_0x534cfa[_0xa47b('0x57')]('-'));_0x54391c=this[_0xa47b('0x1e')](_0x29b81c);}if(_0x54391c){_0x15f52e[_0xa47b('0x23')]=_['isNil'](_0x54391c['interface'])?util['format'](_0xa47b('0x25'),_0x54391c[_0xa47b('0x22')]):_0x54391c[_0xa47b('0x23')];_0x15f52e[_0xa47b('0x4c')]=_0x54391c[_0xa47b('0x22')];_0x15f52e['accountcode']=_0x54391c[_0xa47b('0x21')];RpcMemberReport[_0xa47b('0x19')](_0x15f52e);}};Report[_0xa47b('0x1d')][_0xa47b('0x4a')]=function(_0x17d23c){RpcVoiceTransferReport[_0xa47b('0x47')][_0x17d23c['transfererlinkedid']]=_0x17d23c;};Report['prototype'][_0xa47b('0x1c')]=function(_0x55a063){RpcVoiceTransferReport[_0xa47b('0x1c')](_0x55a063);};module[_0xa47b('0x58')]=Report;
\ No newline at end of file
+var _0x4655=['disposition','calleridname','transfers','linkedid','uniqueid','UserId','membername','create','monitors','monitorFilename','filename','createdAt','exten','connectedlinename','xcally-motion-dialer','Local','substring','indexOf','mobile','phone','lastIndexOf','exports','moment','../ami','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','./userReport','realtime','agents','telephones','prototype','sync','xdr','custom:voiceQueueReport','voiceQueueReport','bind','custom:voiceCallReport','voiceAgentReport','voiceDialReport','blindtransfer','blindTransfer','attendedtransfer','attendedTransfer','findAgent','accountcode','name','isNil','find','interface','format','length','connectedlinenum','lastAssignedTo','SIP/%s','queuecallercomplete','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexitAt','match','keys','getCallType','channel','split','getAgentByInternal','calleridnum','outbound','internal','voiceCallReport','destination','type','dialer','lastapplication','queue','lastdata','context','from-voip-provider','from-sip','xcally-motion-preview','calleridpreview','originatecalleridnum','destinationchannel','callerid'];(function(_0x3545d4,_0x426d0a){var _0x2e4550=function(_0xb6bcd){while(--_0xb6bcd){_0x3545d4['push'](_0x3545d4['shift']());}};_0x2e4550(++_0x426d0a);}(_0x4655,0x1d8));var _0x5465=function(_0x21fc07,_0x16c1c4){_0x21fc07=_0x21fc07-0x0;var _0x16ead9=_0x4655[_0x21fc07];return _0x16ead9;};'use strict';var _=require('lodash');var moment=require(_0x5465('0x0'));var util=require('util');var config=require('../../../config/environment');var ami=require(_0x5465('0x1'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');var RpcVoiceCallReport=require(_0x5465('0x2'));var RpcVoiceDialReport=require(_0x5465('0x3'));var RpcMemberReport=require(_0x5465('0x4'));var RpcVoiceQueueReport=require(_0x5465('0x5'));var RpcVoiceRecording=require(_0x5465('0x6'));var RpcVoiceTransferReport=require(_0x5465('0x7'));var VoiceQueueReport=require(_0x5465('0x8'));var VoiceCallReport=require(_0x5465('0x9'));var VoiceAgentReport=require(_0x5465('0xa'));var VoiceDialReport=require(_0x5465('0xb'));var UserReport=require(_0x5465('0xc'));function Report(_0x5dc2a8){this[_0x5465('0xd')]=_0x5dc2a8;this[_0x5465('0xe')]=_0x5dc2a8[_0x5465('0xe')];this[_0x5465('0xf')]=_0x5dc2a8['telephones'];}Report[_0x5465('0x10')][_0x5465('0x11')]=function(_0x43a84e){var _0x2610e8=new VoiceQueueReport(this[_0x5465('0xd')]);var _0x1e1c56=new VoiceAgentReport(this[_0x5465('0xd')]);var _0x20aed3=new VoiceDialReport(this[_0x5465('0xd')]);var _0x8f4c46=new VoiceCallReport(this['realtime']);var _0x1fdfa5=new UserReport(this[_0x5465('0xd')]);if(config['xdr']&&config[_0x5465('0x12')]['disabled']){ami['on'](_0x5465('0x13'),this[_0x5465('0x14')][_0x5465('0x15')](this));ami['on'](_0x5465('0x16'),this['voiceCallReport'][_0x5465('0x15')](this));ami['on']('custom:voiceAgentReport',this[_0x5465('0x17')][_0x5465('0x15')](this));ami['on']('custom:voiceDialReport',this[_0x5465('0x18')]['bind'](this));ami['on'](_0x5465('0x19'),this[_0x5465('0x1a')]['bind'](this));ami['on'](_0x5465('0x1b'),this[_0x5465('0x1c')][_0x5465('0x15')](this));}};Report[_0x5465('0x10')][_0x5465('0x1d')]=function(_0x3dfd41){var _0x45d624;_0x45d624=_['find'](this[_0x5465('0xe')],function(_0x1b1410){return _0x1b1410[_0x5465('0x1e')]==_0x3dfd41||_0x1b1410[_0x5465('0x1f')]==_0x3dfd41;});if(_[_0x5465('0x20')](_0x45d624)){var _0x5930d7=_['find'](this[_0x5465('0xf')],function(_0x2ad96){return _0x2ad96[_0x5465('0x1e')]==_0x3dfd41||_0x2ad96[_0x5465('0x1f')]==_0x3dfd41;});if(_0x5930d7){_0x45d624=_[_0x5465('0x21')](this[_0x5465('0xe')],function(_0x175368){return _0x175368[_0x5465('0x22')]==util[_0x5465('0x23')]('SIP/%s',_0x5930d7['name']);});}}return _0x45d624;};Report[_0x5465('0x10')][_0x5465('0x14')]=function(_0x506365){for(var _0x32c7ac=0x0;_0x32c7ac<_0x506365[_0x5465('0x24')];_0x32c7ac+=0x1){var _0x2e8e4b=this[_0x5465('0x1d')](_0x506365[_0x32c7ac][_0x5465('0x25')]);if(_0x2e8e4b){_0x506365[_0x32c7ac][_0x5465('0x1e')]=_0x2e8e4b['accountcode'];_0x506365[_0x32c7ac]['assigned']=!![];_0x506365[_0x32c7ac][_0x5465('0x26')]=_0x2e8e4b[_0x5465('0x1f')];_0x506365[_0x32c7ac][_0x5465('0x22')]=_[_0x5465('0x20')](_0x2e8e4b[_0x5465('0x22')])?util[_0x5465('0x23')](_0x5465('0x27'),_0x2e8e4b['name']):_0x2e8e4b[_0x5465('0x22')];if(_0x506365[_0x32c7ac][_0x5465('0x28')]){_0x506365[_0x32c7ac][_0x5465('0x29')]=moment()[_0x5465('0x23')](_0x5465('0x2a'));}if(_0x506365[_0x32c7ac]['queuecallerexit']){_0x506365[_0x32c7ac][_0x5465('0x2b')]=moment()[_0x5465('0x23')](_0x5465('0x2a'));}RpcMemberReport[_0x5465('0x14')](_0x506365[_0x32c7ac]);}RpcVoiceQueueReport['create'](_0x506365[_0x32c7ac]);}};function extractCalleridNumber(_0x439ef8){var _0x3c2795=_0x439ef8[_0x5465('0x2c')](/<(.*?)>/);return _0x3c2795?_0x3c2795[0x1]:_0x439ef8;}Report[_0x5465('0x10')]['getAgentByInternal']=function(_0x4c2c64){for(var _0x2b7a27=0x0;_0x2b7a27<Object[_0x5465('0x2d')](this[_0x5465('0xe')])['length'];_0x2b7a27++){var _0x47a7a9=Object[_0x5465('0x2d')](this[_0x5465('0xe')])[_0x2b7a27];var _0x4acb94=this['agents'][_0x47a7a9];if(_0x4acb94[_0x5465('0x1e')]===Number(_0x4c2c64))return _0x4acb94;}return null;};Report['prototype'][_0x5465('0x2e')]=function(_0x3524d0){var _0x883396=_0x3524d0[_0x5465('0x2f')][_0x5465('0x30')]('-')[0x0];var _0x4da059=this['agents'][_0x883396];if(!_0x4da059)_0x4da059=this[_0x5465('0x31')](_0x3524d0[_0x5465('0x32')]);return!_0x4da059?_0x5465('0x33'):_0x5465('0x34');};Report[_0x5465('0x10')][_0x5465('0x35')]=function(_0x353c9e){_0x353c9e[_0x5465('0x36')]=_0x353c9e[_0x5465('0x36')]||_0x353c9e['exten'];if(_0x353c9e[_0x5465('0x37')]==_0x5465('0x38')){_0x353c9e[_0x5465('0x39')]=_0x5465('0x3a');_0x353c9e[_0x5465('0x3b')]=_0x353c9e[_0x5465('0x3a')];if(_0x353c9e[_0x5465('0x3c')]==_0x5465('0x3d')){_0x353c9e['accountcode']='';_0x353c9e[_0x5465('0x36')]=extractCalleridNumber(_0x353c9e['callerid']);}else if(_0x353c9e['context']==_0x5465('0x3e')){if(_0x353c9e[_0x5465('0x36')]==_0x5465('0x3f')){_0x353c9e[_0x5465('0x36')]=extractCalleridNumber(_0x353c9e[_0x5465('0x40')]);_0x353c9e[_0x5465('0x32')]=_0x353c9e[_0x5465('0x41')];_0x353c9e['destinationchannel']=[_0x353c9e['channel'],_0x353c9e[_0x5465('0x2f')]=_0x353c9e[_0x5465('0x42')]][0x0];_0x353c9e[_0x5465('0x43')]=_0x353c9e[_0x5465('0x40')];}else{_0x353c9e[_0x5465('0x36')]=_0x353c9e[_0x5465('0x32')];_0x353c9e['calleridnum']=_0x353c9e[_0x5465('0x41')];if(_0x353c9e[_0x5465('0x44')]=='ANSWERED'){_0x353c9e['accountcode']=_0x353c9e[_0x5465('0x25')];}else{_0x353c9e['accountcode']='';}}}}else{_0x353c9e[_0x5465('0x43')]=util[_0x5465('0x23')]('\x22%s\x22\x20<%s>',_0x353c9e[_0x5465('0x45')],_0x353c9e['calleridnum']);}if(RpcVoiceTransferReport[_0x5465('0x46')][_0x353c9e[_0x5465('0x47')]]){var _0x39c6f6=RpcVoiceTransferReport[_0x5465('0x46')][_0x353c9e['linkedid']];_0x39c6f6['transfereelinkedid']=_0x353c9e[_0x5465('0x48')];RpcVoiceTransferReport[_0x5465('0x1a')](_0x39c6f6);delete RpcVoiceTransferReport[_0x5465('0x46')][_0x353c9e[_0x5465('0x47')]];}if(_[_0x5465('0x20')](_0x353c9e[_0x5465('0x37')])){_0x353c9e[_0x5465('0x37')]=this[_0x5465('0x2e')](_0x353c9e);}if(_[_0x5465('0x20')](_0x353c9e[_0x5465('0x49')])){var _0x170877=_0x353c9e[_0x5465('0x2f')][_0x5465('0x30')]('-')[0x0];var _0x377ef7=this[_0x5465('0xe')][_0x170877];if(!_0x377ef7)_0x377ef7=this[_0x5465('0x31')](_0x353c9e[_0x5465('0x1e')]);if(_0x377ef7){_0x353c9e[_0x5465('0x49')]=_0x377ef7['id'];_0x353c9e[_0x5465('0x4a')]=_0x377ef7[_0x5465('0x1f')];}}RpcVoiceCallReport[_0x5465('0x4b')](_0x353c9e);if(_0x353c9e['monitor']){for(var _0x44cb67=0x0;_0x44cb67<_0x353c9e[_0x5465('0x4c')][_0x5465('0x24')];_0x44cb67+=0x1){_0x353c9e[_0x5465('0x4d')]=_0x353c9e[_0x5465('0x4c')][_0x44cb67][_0x5465('0x4e')];_0x353c9e[_0x5465('0x4f')]=_0x353c9e['monitors'][_0x44cb67]['createdAt'];if(_0x353c9e[_0x5465('0x50')]=='xcally-motion-preview'){_0x353c9e['calleridnum']=_0x353c9e[_0x5465('0x25')];_0x353c9e[_0x5465('0x45')]=_0x353c9e['connectedlinename'];_0x353c9e['connectedlinenum']=_0x353c9e['accountcode'];_0x353c9e[_0x5465('0x51')]=_0x353c9e[_0x5465('0x4a')];_0x353c9e['exten']=_0x353c9e[_0x5465('0x41')];}else if(_0x353c9e[_0x5465('0x50')]==_0x5465('0x52')){_0x353c9e[_0x5465('0x32')]=_0x353c9e[_0x5465('0x36')];_0x353c9e[_0x5465('0x50')]=_0x353c9e[_0x5465('0x41')];}RpcVoiceRecording[_0x5465('0x4b')](_0x353c9e);}}};Report[_0x5465('0x10')][_0x5465('0x17')]=function(_0x1fce3d){if(_['isArray'](_0x1fce3d)){_0x1fce3d['forEach'](function(_0xcdd790){RpcVoiceAgentReport['create'](_0xcdd790);});}else{RpcVoiceAgentReport[_0x5465('0x4b')](_0x1fce3d);}};Report[_0x5465('0x10')]['voiceDialReport']=function(_0x5f3d84){RpcVoiceDialReport[_0x5465('0x4b')](_0x5f3d84);var _0x3ab74f;var _0x4ed336;var _0x41cf91=_0x5f3d84[_0x5465('0x2f')];if(_['startsWith'](_0x41cf91,_0x5465('0x53'))){_0x4ed336=_0x41cf91[_0x5465('0x54')](_0x41cf91[_0x5465('0x55')]('/')+0x1,_0x41cf91[_0x5465('0x55')]('@'));_0x3ab74f=_[_0x5465('0x21')](this[_0x5465('0xe')],function(_0x44ff6c){return _0x44ff6c[_0x5465('0x56')]==_0x4ed336||_0x44ff6c[_0x5465('0x57')]==_0x4ed336||_0x44ff6c[_0x5465('0x1e')]==_0x4ed336;});}else{_0x4ed336=_0x41cf91['substring'](_0x41cf91[_0x5465('0x55')]('/')+0x1,_0x41cf91[_0x5465('0x58')]('-'));_0x3ab74f=this[_0x5465('0x1d')](_0x4ed336);}if(_0x3ab74f){_0x5f3d84[_0x5465('0x22')]=_[_0x5465('0x20')](_0x3ab74f['interface'])?util[_0x5465('0x23')](_0x5465('0x27'),_0x3ab74f[_0x5465('0x1f')]):_0x3ab74f[_0x5465('0x22')];_0x5f3d84['membername']=_0x3ab74f[_0x5465('0x1f')];_0x5f3d84[_0x5465('0x1e')]=_0x3ab74f['accountcode'];RpcMemberReport[_0x5465('0x18')](_0x5f3d84);}};Report['prototype'][_0x5465('0x1a')]=function(_0x256039){RpcVoiceTransferReport[_0x5465('0x46')][_0x256039['transfererlinkedid']]=_0x256039;};Report['prototype'][_0x5465('0x1c')]=function(_0x2e5b4c){RpcVoiceTransferReport[_0x5465('0x1c')](_0x2e5b4c);};module[_0x5465('0x59')]=Report;
\ No newline at end of file
index a993feb..4c2dd7f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x41f3=['trunk:%s','name','trunk:save','[userReport][registry]','[userReport][devicestatechange]\x20device:%s\x20state:%s','device','[userReport][devicestatechange]','toLowerCase','inuse','local','stateTime','toNumber','[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:','telephone:%s','telephone:save','[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:','Local','indexOf','mobile','phone','accountcode','updateStatusRealtime','[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s','peer','address','registered','status','[userReport][peerstatus]\x20sending\x20trunk:save\x20event:','[userReport][peerstatus]','exports','moment','ioredis','bluebird','ami','../ami','redis','defaults','localhost','trunks','agents','telephones','bind','registry','syncDeviceState','peerstatus','syncPeerStatus','resolve','actionSipShowRegistry','catch','error','[userReport][sipshowregistry]','inspect','then','actionDeviceStateList','actionSipPeerStatus','[userReport][sippeerstatus]','prototype','syncRealtimeShow','isUndefined','emit','isNotNull','info','[userReport][registry]\x20registry:%s\x20state:%s','state','debug','find','event','actionid','[userReport][registry]\x20sending\x20trunk:save\x20event:','format'];(function(_0x4fc6ba,_0x24edbd){var _0x164ddf=function(_0x3994b5){while(--_0x3994b5){_0x4fc6ba['push'](_0x4fc6ba['shift']());}};_0x164ddf(++_0x24edbd);}(_0x41f3,0x17c));var _0x341f=function(_0x171e87,_0x293ab1){_0x171e87=_0x171e87-0x0;var _0x1d104d=_0x41f3[_0x171e87];return _0x1d104d;};'use strict';var _=require('lodash');var moment=require(_0x341f('0x0'));var util=require('util');var Redis=require(_0x341f('0x1'));var BPromise=require(_0x341f('0x2'));var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0x341f('0x3'));var ami=require(_0x341f('0x4'));config[_0x341f('0x5')]=_[_0x341f('0x6')](config[_0x341f('0x5')],{'host':_0x341f('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x341f('0x5')]));function UserReport(_0x34ea31){this['trunks']=_0x34ea31[_0x341f('0x8')];this[_0x341f('0x9')]=_0x34ea31['agents'];this[_0x341f('0xa')]=_0x34ea31['telephones'];ami['on']('registryentry',this['syncRegistry'][_0x341f('0xb')](this));ami['on'](_0x341f('0xc'),this['syncRegistry'][_0x341f('0xb')](this));ami['on']('devicestatechange',this[_0x341f('0xd')][_0x341f('0xb')](this));ami['on'](_0x341f('0xe'),this[_0x341f('0xf')][_0x341f('0xb')](this));return this['syncRealtimeShow']();}function showSipRegistrations(){Promise[_0x341f('0x10')]()['then'](ami[_0x341f('0x11')]())[_0x341f('0x12')](function(_0x3a05cf){logger[_0x341f('0x13')](_0x341f('0x14'),util[_0x341f('0x15')](_0x3a05cf,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise[_0x341f('0x10')]()[_0x341f('0x16')](ami[_0x341f('0x17')]())[_0x341f('0x12')](function(_0x2306f5){logger[_0x341f('0x13')]('[userReport][devicestatelist]',util[_0x341f('0x15')](_0x2306f5,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0x341f('0x10')]()['then'](ami[_0x341f('0x18')]())[_0x341f('0x12')](function(_0x34896d){logger[_0x341f('0x13')](_0x341f('0x19'),util[_0x341f('0x15')](_0x34896d,{'showHidden':![],'depth':null}));});}UserReport[_0x341f('0x1a')][_0x341f('0x1b')]=function(){setInterval(function(){BPromise[_0x341f('0x10')]()['then'](showSipRegistrations())[_0x341f('0x16')](listDeviceStates())[_0x341f('0x16')](showPeersStatus());},0x32c8);};UserReport['prototype']['isNotNull']=function(_0x3c6208){return _0x3c6208!==null&&!_[_0x341f('0x1c')](_0x3c6208);};UserReport[_0x341f('0x1a')][_0x341f('0x1d')]=function(_0x2b62e9,_0x25bb4e,_0x4beba0){io['to'](_0x2b62e9)[_0x341f('0x1d')](_0x25bb4e,_0x4beba0);};UserReport[_0x341f('0x1a')]['syncRegistry']=function(_0x359808){try{if(this[_0x341f('0x1e')](_0x359808)){logger[_0x341f('0x1f')](_0x341f('0x20'),_0x359808['username'],_0x359808[_0x341f('0x21')]);logger[_0x341f('0x22')]('[userReport][registry]',util[_0x341f('0x15')](_0x359808,{'showHidden':![],'depth':null}));var _0x596cf2=_[_0x341f('0x23')](this[_0x341f('0x8')],{'defaultuser':_0x359808['username']});if(_0x596cf2){_0x359808['stateRegistry']=_0x359808[_0x341f('0x21')];_['merge'](_0x596cf2,_['omit'](_0x359808,[_0x341f('0x24'),_0x341f('0x25'),'username','state']));logger['debug'](_0x341f('0x26'),util[_0x341f('0x15')](_0x596cf2,{'showHidden':![],'depth':null}));this[_0x341f('0x1d')](util[_0x341f('0x27')](_0x341f('0x28'),_0x596cf2[_0x341f('0x29')]),_0x341f('0x2a'),_0x596cf2);}}}catch(_0x1b094d){logger[_0x341f('0x13')](_0x341f('0x2b'),util[_0x341f('0x15')](_0x1b094d,{'showHidden':![],'depth':null}));}};UserReport[_0x341f('0x1a')][_0x341f('0xd')]=function(_0x55f079){try{if(this[_0x341f('0x1e')](_0x55f079)){logger['info'](_0x341f('0x2c'),_0x55f079[_0x341f('0x2d')],_0x55f079[_0x341f('0x21')]);logger['debug'](_0x341f('0x2e'),util[_0x341f('0x15')](_0x55f079,{'showHidden':![],'depth':null}));if(this[_0x341f('0x9')][_0x55f079[_0x341f('0x2d')]]){if(!this[_0x341f('0x9')][_0x55f079[_0x341f('0x2d')]]['local']||_0x55f079[_0x341f('0x21')][_0x341f('0x2f')]()==_0x341f('0x30')){this[_0x341f('0x9')][_0x55f079['device']][_0x341f('0x31')]=![];if(this[_0x341f('0x9')][_0x55f079[_0x341f('0x2d')]][_0x341f('0x21')]!==_0x55f079[_0x341f('0x21')][_0x341f('0x2f')]()){this[_0x341f('0x9')][_0x55f079[_0x341f('0x2d')]][_0x341f('0x32')]=_[_0x341f('0x33')](moment()[_0x341f('0x27')]('x'));}this[_0x341f('0x9')][_0x55f079[_0x341f('0x2d')]]['state']=_0x55f079[_0x341f('0x21')][_0x341f('0x2f')]();this[_0x341f('0x9')][_0x55f079['device']]['updateStatusRealtime'](_0x55f079);}}else if(this[_0x341f('0xa')][_0x55f079[_0x341f('0x2d')]]){if(this['telephones'][_0x55f079[_0x341f('0x2d')]][_0x341f('0x21')]!==_0x55f079['state'][_0x341f('0x2f')]()){this[_0x341f('0xa')][_0x55f079[_0x341f('0x2d')]][_0x341f('0x32')]=_['toNumber'](moment()['format']('x'));}this[_0x341f('0xa')][_0x55f079[_0x341f('0x2d')]][_0x341f('0x21')]=_0x55f079['state'][_0x341f('0x2f')]();logger[_0x341f('0x22')](_0x341f('0x34'),util[_0x341f('0x15')](this[_0x341f('0xa')][_0x55f079['device']],{'showHidden':![],'depth':null}));this[_0x341f('0x1d')](util[_0x341f('0x27')](_0x341f('0x35'),this[_0x341f('0xa')][_0x55f079[_0x341f('0x2d')]]['name']),_0x341f('0x36'),this[_0x341f('0xa')][_0x55f079[_0x341f('0x2d')]]);}else if(this[_0x341f('0x8')][_0x55f079['device']]){if(this[_0x341f('0x8')][_0x55f079['device']]['state']!==_0x55f079[_0x341f('0x21')][_0x341f('0x2f')]()){this[_0x341f('0x8')][_0x55f079[_0x341f('0x2d')]][_0x341f('0x32')]=_[_0x341f('0x33')](moment()[_0x341f('0x27')]('x'));}this[_0x341f('0x8')][_0x55f079[_0x341f('0x2d')]]['state']=_0x55f079[_0x341f('0x21')]['toLowerCase']();logger[_0x341f('0x22')](_0x341f('0x37'),util[_0x341f('0x15')](this[_0x341f('0x8')][_0x55f079[_0x341f('0x2d')]],{'showHidden':![],'depth':null}));this[_0x341f('0x1d')](util[_0x341f('0x27')]('trunk:%s',this['trunks'][_0x55f079[_0x341f('0x2d')]][_0x341f('0x29')]),'trunk:save',this['trunks'][_0x55f079[_0x341f('0x2d')]]);}else if(_['startsWith'](_0x55f079[_0x341f('0x2d')],_0x341f('0x38'))){var _0x4d52aa=_0x55f079[_0x341f('0x2d')];var _0x117ced=_0x4d52aa['substring'](_0x4d52aa[_0x341f('0x39')]('/')+0x1,_0x4d52aa[_0x341f('0x39')]('@'));var _0x133756=_[_0x341f('0x23')](this[_0x341f('0x9')],function(_0x5dcc3e){return _0x5dcc3e[_0x341f('0x3a')]==_0x117ced||_0x5dcc3e[_0x341f('0x3b')]==_0x117ced||_0x5dcc3e[_0x341f('0x3c')]==_0x117ced;});if(_0x133756){if(_0x133756[_0x341f('0x21')]!==_0x55f079['state'][_0x341f('0x2f')]()){_0x133756['stateTime']=_['toNumber'](moment()[_0x341f('0x27')]('x'));}_0x133756[_0x341f('0x21')]=_0x55f079[_0x341f('0x21')][_0x341f('0x2f')]();_0x133756['local']=!![];_0x133756[_0x341f('0x3d')](_0x55f079);}}}}catch(_0x5412fd){logger['error'](_0x341f('0x2e'),util['inspect'](_0x5412fd,{'showHidden':![],'depth':null}));}};UserReport[_0x341f('0x1a')][_0x341f('0xf')]=function(_0x2441b9){try{if(this['isNotNull'](_0x2441b9)&&this['isNotNull'](_0x2441b9[_0x341f('0xe')])){logger[_0x341f('0x1f')](_0x341f('0x3e'),_0x2441b9[_0x341f('0x3f')],_0x2441b9[_0x341f('0x40')],_0x2441b9[_0x341f('0xe')]);logger['debug']('[userReport][peerstatus]',util[_0x341f('0x15')](_0x2441b9,{'showHidden':![],'depth':null}));if(this[_0x341f('0x9')][_0x2441b9[_0x341f('0x3f')]]){if(!this[_0x341f('0x9')][_0x2441b9['peer']]['local']||_0x2441b9[_0x341f('0xe')][_0x341f('0x2f')]()==_0x341f('0x41')){this[_0x341f('0x9')][_0x2441b9['peer']]['local']=![];this[_0x341f('0x9')][_0x2441b9[_0x341f('0x3f')]][_0x341f('0x42')]=_0x2441b9['peerstatus'][_0x341f('0x2f')]();this[_0x341f('0x9')][_0x2441b9[_0x341f('0x3f')]][_0x341f('0x40')]=_0x2441b9[_0x341f('0x40')];this[_0x341f('0x9')][_0x2441b9['peer']][_0x341f('0x3d')](_0x2441b9);}}else if(this['telephones'][_0x2441b9[_0x341f('0x3f')]]){this[_0x341f('0xa')][_0x2441b9['peer']][_0x341f('0x42')]=_0x2441b9[_0x341f('0xe')][_0x341f('0x2f')]();this['telephones'][_0x2441b9[_0x341f('0x3f')]][_0x341f('0x40')]=_0x2441b9[_0x341f('0x40')];logger[_0x341f('0x22')]('[userReport][peerstatus]\x20sending\x20telephone:save\x20event:',util[_0x341f('0x15')](this[_0x341f('0xa')][_0x2441b9[_0x341f('0x3f')]],{'showHidden':![],'depth':null}));this[_0x341f('0x1d')](util[_0x341f('0x27')](_0x341f('0x35'),this[_0x341f('0xa')][_0x2441b9['peer']][_0x341f('0x29')]),_0x341f('0x36'),this[_0x341f('0xa')][_0x2441b9['peer']]);}else if(this[_0x341f('0x8')][_0x2441b9[_0x341f('0x3f')]]){this['trunks'][_0x2441b9[_0x341f('0x3f')]][_0x341f('0x42')]=_0x2441b9[_0x341f('0xe')][_0x341f('0x2f')]();this[_0x341f('0x8')][_0x2441b9[_0x341f('0x3f')]][_0x341f('0x40')]=_0x2441b9[_0x341f('0x40')];logger['debug'](_0x341f('0x43'),util['inspect'](this['trunks'][_0x2441b9[_0x341f('0x3f')]],{'showHidden':![],'depth':null}));this[_0x341f('0x1d')](util[_0x341f('0x27')](_0x341f('0x28'),this[_0x341f('0x8')][_0x2441b9['peer']][_0x341f('0x29')]),_0x341f('0x2a'),this['trunks'][_0x2441b9[_0x341f('0x3f')]]);}}}catch(_0x40811a){logger['error'](_0x341f('0x44'),util[_0x341f('0x15')](_0x40811a,{'showHidden':![],'depth':null}));}};module[_0x341f('0x45')]=UserReport;
\ No newline at end of file
+var _0x6504=['substring','indexOf','mobile','phone','accountcode','peer','address','peerstatus','[userReport][peerstatus]','registered','status','[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','[userReport][peerstatus]\x20sending\x20trunk:save\x20event:','trunk:save','exports','util','ami','defaults','localhost','socket.io-emitter','redis','trunks','agents','telephones','syncRegistry','bind','devicestatechange','syncDeviceState','syncPeerStatus','resolve','then','catch','error','inspect','actionDeviceStateList','[userReport][devicestatelist]','actionSipPeerStatus','prototype','syncRealtimeShow','isUndefined','emit','isNotNull','[userReport][registry]\x20registry:%s\x20state:%s','debug','[userReport][registry]','find','username','state','merge','event','actionid','format','trunk:%s','name','info','[userReport][devicestatechange]\x20device:%s\x20state:%s','[userReport][devicestatechange]','device','local','toLowerCase','inuse','toNumber','updateStatusRealtime','stateTime','[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:','telephone:%s','telephone:save','[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:','startsWith','Local'];(function(_0x19d8f2,_0x538ea9){var _0x1738af=function(_0x826212){while(--_0x826212){_0x19d8f2['push'](_0x19d8f2['shift']());}};_0x1738af(++_0x538ea9);}(_0x6504,0xe1));var _0x4650=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6504[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var moment=require('moment');var util=require(_0x4650('0x0'));var Redis=require('ioredis');var BPromise=require('bluebird');var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0x4650('0x1'));var ami=require('../ami');config['redis']=_[_0x4650('0x2')](config['redis'],{'host':_0x4650('0x3'),'port':0x18eb});var io=require(_0x4650('0x4'))(new Redis(config[_0x4650('0x5')]));function UserReport(_0x45b825){this[_0x4650('0x6')]=_0x45b825[_0x4650('0x6')];this['agents']=_0x45b825[_0x4650('0x7')];this[_0x4650('0x8')]=_0x45b825[_0x4650('0x8')];ami['on']('registryentry',this[_0x4650('0x9')]['bind'](this));ami['on']('registry',this['syncRegistry'][_0x4650('0xa')](this));ami['on'](_0x4650('0xb'),this[_0x4650('0xc')]['bind'](this));ami['on']('peerstatus',this[_0x4650('0xd')][_0x4650('0xa')](this));return this['syncRealtimeShow']();}function showSipRegistrations(){Promise[_0x4650('0xe')]()[_0x4650('0xf')](ami['actionSipShowRegistry']())[_0x4650('0x10')](function(_0x3d23c2){logger[_0x4650('0x11')]('[userReport][sipshowregistry]',util[_0x4650('0x12')](_0x3d23c2,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise[_0x4650('0xe')]()[_0x4650('0xf')](ami[_0x4650('0x13')]())[_0x4650('0x10')](function(_0x57a40c){logger[_0x4650('0x11')](_0x4650('0x14'),util[_0x4650('0x12')](_0x57a40c,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0x4650('0xe')]()[_0x4650('0xf')](ami[_0x4650('0x15')]())['catch'](function(_0x702abc){logger[_0x4650('0x11')]('[userReport][sippeerstatus]',util[_0x4650('0x12')](_0x702abc,{'showHidden':![],'depth':null}));});}UserReport[_0x4650('0x16')][_0x4650('0x17')]=function(){setInterval(function(){BPromise[_0x4650('0xe')]()[_0x4650('0xf')](showSipRegistrations())[_0x4650('0xf')](listDeviceStates())[_0x4650('0xf')](showPeersStatus());},0x32c8);};UserReport[_0x4650('0x16')]['isNotNull']=function(_0x55be3a){return _0x55be3a!==null&&!_[_0x4650('0x18')](_0x55be3a);};UserReport['prototype'][_0x4650('0x19')]=function(_0xdede96,_0x5d89b7,_0x369fa5){io['to'](_0xdede96)[_0x4650('0x19')](_0x5d89b7,_0x369fa5);};UserReport['prototype'][_0x4650('0x9')]=function(_0x3517cc){try{if(this[_0x4650('0x1a')](_0x3517cc)){logger['info'](_0x4650('0x1b'),_0x3517cc['username'],_0x3517cc['state']);logger[_0x4650('0x1c')](_0x4650('0x1d'),util[_0x4650('0x12')](_0x3517cc,{'showHidden':![],'depth':null}));var _0x1fffca=_[_0x4650('0x1e')](this[_0x4650('0x6')],{'defaultuser':_0x3517cc[_0x4650('0x1f')]});if(_0x1fffca){_0x3517cc['stateRegistry']=_0x3517cc[_0x4650('0x20')];_[_0x4650('0x21')](_0x1fffca,_['omit'](_0x3517cc,[_0x4650('0x22'),_0x4650('0x23'),'username',_0x4650('0x20')]));logger['debug']('[userReport][registry]\x20sending\x20trunk:save\x20event:',util[_0x4650('0x12')](_0x1fffca,{'showHidden':![],'depth':null}));this[_0x4650('0x19')](util[_0x4650('0x24')](_0x4650('0x25'),_0x1fffca[_0x4650('0x26')]),'trunk:save',_0x1fffca);}}}catch(_0x4f1911){logger[_0x4650('0x11')](_0x4650('0x1d'),util[_0x4650('0x12')](_0x4f1911,{'showHidden':![],'depth':null}));}};UserReport['prototype']['syncDeviceState']=function(_0x2a59d5){try{if(this['isNotNull'](_0x2a59d5)){logger[_0x4650('0x27')](_0x4650('0x28'),_0x2a59d5['device'],_0x2a59d5['state']);logger[_0x4650('0x1c')](_0x4650('0x29'),util[_0x4650('0x12')](_0x2a59d5,{'showHidden':![],'depth':null}));if(this['agents'][_0x2a59d5['device']]){if(!this['agents'][_0x2a59d5[_0x4650('0x2a')]][_0x4650('0x2b')]||_0x2a59d5[_0x4650('0x20')][_0x4650('0x2c')]()==_0x4650('0x2d')){this[_0x4650('0x7')][_0x2a59d5[_0x4650('0x2a')]]['local']=![];if(this['agents'][_0x2a59d5['device']][_0x4650('0x20')]!==_0x2a59d5[_0x4650('0x20')][_0x4650('0x2c')]()){this[_0x4650('0x7')][_0x2a59d5[_0x4650('0x2a')]]['stateTime']=_[_0x4650('0x2e')](moment()[_0x4650('0x24')]('x'));}this[_0x4650('0x7')][_0x2a59d5[_0x4650('0x2a')]][_0x4650('0x20')]=_0x2a59d5[_0x4650('0x20')][_0x4650('0x2c')]();this['agents'][_0x2a59d5[_0x4650('0x2a')]][_0x4650('0x2f')](_0x2a59d5);}}else if(this[_0x4650('0x8')][_0x2a59d5[_0x4650('0x2a')]]){if(this[_0x4650('0x8')][_0x2a59d5[_0x4650('0x2a')]][_0x4650('0x20')]!==_0x2a59d5[_0x4650('0x20')][_0x4650('0x2c')]()){this[_0x4650('0x8')][_0x2a59d5[_0x4650('0x2a')]][_0x4650('0x30')]=_['toNumber'](moment()[_0x4650('0x24')]('x'));}this[_0x4650('0x8')][_0x2a59d5[_0x4650('0x2a')]]['state']=_0x2a59d5[_0x4650('0x20')][_0x4650('0x2c')]();logger[_0x4650('0x1c')](_0x4650('0x31'),util[_0x4650('0x12')](this[_0x4650('0x8')][_0x2a59d5[_0x4650('0x2a')]],{'showHidden':![],'depth':null}));this['emit'](util[_0x4650('0x24')](_0x4650('0x32'),this[_0x4650('0x8')][_0x2a59d5['device']][_0x4650('0x26')]),_0x4650('0x33'),this[_0x4650('0x8')][_0x2a59d5[_0x4650('0x2a')]]);}else if(this[_0x4650('0x6')][_0x2a59d5[_0x4650('0x2a')]]){if(this[_0x4650('0x6')][_0x2a59d5[_0x4650('0x2a')]][_0x4650('0x20')]!==_0x2a59d5[_0x4650('0x20')][_0x4650('0x2c')]()){this['trunks'][_0x2a59d5[_0x4650('0x2a')]]['stateTime']=_[_0x4650('0x2e')](moment()[_0x4650('0x24')]('x'));}this[_0x4650('0x6')][_0x2a59d5[_0x4650('0x2a')]][_0x4650('0x20')]=_0x2a59d5[_0x4650('0x20')][_0x4650('0x2c')]();logger[_0x4650('0x1c')](_0x4650('0x34'),util[_0x4650('0x12')](this['trunks'][_0x2a59d5['device']],{'showHidden':![],'depth':null}));this[_0x4650('0x19')](util[_0x4650('0x24')]('trunk:%s',this[_0x4650('0x6')][_0x2a59d5[_0x4650('0x2a')]][_0x4650('0x26')]),'trunk:save',this['trunks'][_0x2a59d5[_0x4650('0x2a')]]);}else if(_[_0x4650('0x35')](_0x2a59d5[_0x4650('0x2a')],_0x4650('0x36'))){var _0x419e3c=_0x2a59d5[_0x4650('0x2a')];var _0x3a0ea7=_0x419e3c[_0x4650('0x37')](_0x419e3c['indexOf']('/')+0x1,_0x419e3c[_0x4650('0x38')]('@'));var _0x921409=_[_0x4650('0x1e')](this[_0x4650('0x7')],function(_0x9cd42d){return _0x9cd42d[_0x4650('0x39')]==_0x3a0ea7||_0x9cd42d[_0x4650('0x3a')]==_0x3a0ea7||_0x9cd42d[_0x4650('0x3b')]==_0x3a0ea7;});if(_0x921409){if(_0x921409[_0x4650('0x20')]!==_0x2a59d5['state'][_0x4650('0x2c')]()){_0x921409[_0x4650('0x30')]=_[_0x4650('0x2e')](moment()[_0x4650('0x24')]('x'));}_0x921409[_0x4650('0x20')]=_0x2a59d5[_0x4650('0x20')][_0x4650('0x2c')]();_0x921409['local']=!![];_0x921409[_0x4650('0x2f')](_0x2a59d5);}}}}catch(_0x95d408){logger[_0x4650('0x11')](_0x4650('0x29'),util[_0x4650('0x12')](_0x95d408,{'showHidden':![],'depth':null}));}};UserReport[_0x4650('0x16')]['syncPeerStatus']=function(_0x50cdbd){try{if(this[_0x4650('0x1a')](_0x50cdbd)&&this[_0x4650('0x1a')](_0x50cdbd['peerstatus'])){logger['info']('[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s',_0x50cdbd[_0x4650('0x3c')],_0x50cdbd[_0x4650('0x3d')],_0x50cdbd[_0x4650('0x3e')]);logger['debug'](_0x4650('0x3f'),util['inspect'](_0x50cdbd,{'showHidden':![],'depth':null}));if(this[_0x4650('0x7')][_0x50cdbd[_0x4650('0x3c')]]){if(!this['agents'][_0x50cdbd[_0x4650('0x3c')]][_0x4650('0x2b')]||_0x50cdbd[_0x4650('0x3e')][_0x4650('0x2c')]()==_0x4650('0x40')){this[_0x4650('0x7')][_0x50cdbd[_0x4650('0x3c')]][_0x4650('0x2b')]=![];this[_0x4650('0x7')][_0x50cdbd[_0x4650('0x3c')]]['status']=_0x50cdbd['peerstatus']['toLowerCase']();this[_0x4650('0x7')][_0x50cdbd[_0x4650('0x3c')]][_0x4650('0x3d')]=_0x50cdbd[_0x4650('0x3d')];this[_0x4650('0x7')][_0x50cdbd[_0x4650('0x3c')]][_0x4650('0x2f')](_0x50cdbd);}}else if(this[_0x4650('0x8')][_0x50cdbd['peer']]){this['telephones'][_0x50cdbd['peer']][_0x4650('0x41')]=_0x50cdbd[_0x4650('0x3e')]['toLowerCase']();this[_0x4650('0x8')][_0x50cdbd[_0x4650('0x3c')]][_0x4650('0x3d')]=_0x50cdbd[_0x4650('0x3d')];logger[_0x4650('0x1c')](_0x4650('0x42'),util[_0x4650('0x12')](this[_0x4650('0x8')][_0x50cdbd[_0x4650('0x3c')]],{'showHidden':![],'depth':null}));this[_0x4650('0x19')](util['format'](_0x4650('0x32'),this['telephones'][_0x50cdbd[_0x4650('0x3c')]][_0x4650('0x26')]),_0x4650('0x33'),this[_0x4650('0x8')][_0x50cdbd[_0x4650('0x3c')]]);}else if(this[_0x4650('0x6')][_0x50cdbd[_0x4650('0x3c')]]){this[_0x4650('0x6')][_0x50cdbd[_0x4650('0x3c')]][_0x4650('0x41')]=_0x50cdbd[_0x4650('0x3e')][_0x4650('0x2c')]();this[_0x4650('0x6')][_0x50cdbd[_0x4650('0x3c')]][_0x4650('0x3d')]=_0x50cdbd[_0x4650('0x3d')];logger[_0x4650('0x1c')](_0x4650('0x43'),util[_0x4650('0x12')](this[_0x4650('0x6')][_0x50cdbd['peer']],{'showHidden':![],'depth':null}));this[_0x4650('0x19')](util[_0x4650('0x24')](_0x4650('0x25'),this[_0x4650('0x6')][_0x50cdbd[_0x4650('0x3c')]][_0x4650('0x26')]),_0x4650('0x44'),this['trunks'][_0x50cdbd[_0x4650('0x3c')]]);}}}catch(_0x4b323b){logger[_0x4650('0x11')](_0x4650('0x3f'),util[_0x4650('0x12')](_0x4b323b,{'showHidden':![],'depth':null}));}};module[_0x4650('0x45')]=UserReport;
\ No newline at end of file
index fec0432..e2cea09 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5457=['format','YYYY-MM-DD\x20HH:mm:ss','called','queue','type','inbound','voice','merge','omit','event','debug','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','custom:agentcalled','interface','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:','user:%s','user:called','[%s][voiceAgentReport][agentcalled]','[%s][voiceAgentReport][agentconnect]\x20event:','hasOwnProperty','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connectedlinename','connectedlinenum','destchannelstate','destchannelstatedesc','holdtime','lastevent','connect','routealias','pick','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:','custom:agentconnect','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:','user:agentconnect','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere','agentringnoanswerAt','answeredelsewheremembername','reason','answered_elsewhere','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:','custom:agentansweredelsewhere','error','[%s][voiceAgentReport][agentconnect]','[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected','rejected','[%s][voiceAgentReport][agentringnoanswer]','[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:','custom:agentqueuecallerabandon','[%s][voiceAgentReport][queuecallerabandon]','[%s][voiceAgentReport][agentcomplete]\x20event:','agentcomplete','agentcompleteAt','complete','talktime','acw','acwtime','acwTimeout','agentacw','destconnectedlinenum','custom:agentcomplete','[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:','destaccountcode','user:agentcomplete','[%s][voiceAgentReport][agentcomplete]','[%s][voiceAgentReport][varset]\x20event:','addVariable','keys','variable','value','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepvtcallid','membercalls','memberdynamic','memberlastcall','memberpenalty','memberrealtime','isNil','includes','syncHangup','[%s][voiceAgentReport][hangup]\x20event:','transfer','[%s][voiceAgentReport][hangup]\x20destuniqueid:%s','[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:','values','[%s][voiceAgentReport][attendedtransfer]\x20event:','transfereeuniqueid','diff','seconds','secondtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]','[%s][voiceAgentReport][blindtransfer]\x20event:','transfereruniqueid','[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','[%s][voiceAgentReport][blindtransfer]','[%s][voiceAgentReport][musiconholdstart]\x20event:','channel','substring','lastIndexOf','onhold','syncMusicOnHoldStop','[%s][voiceAgentReport][musiconholdstop]\x20event:','[%s][voiceAgentReport][musiconholdstop]\x20interface:%s','[%s][voiceAgentReport][musiconholdstop]','exports','lodash','moment','util','ioredis','../../../config/environment','../../../config/logger','ami','../ami','redis','defaults','localhost','socket.io-emitter','channels','voiceChannels','voiceQueues','agents','variables','bind','agentconnect','syncAgentConnect','agentringnoanswer','syncAgentRingNoAnswer','queuecallerabandon','syncQueueCallerAbandon','syncAgentComplete','varset','syncVarSet','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','prototype','emit','isNotNull','isUndefined','syncAgentCalled','info','[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','uniqueid','membername','destuniqueid','inspect'];(function(_0x1adef9,_0xa5d73a){var _0x2d561e=function(_0x196dfe){while(--_0x196dfe){_0x1adef9['push'](_0x1adef9['shift']());}};_0x2d561e(++_0xa5d73a);}(_0x5457,0x115));var _0x7545=function(_0x3c6869,_0x3334bb){_0x3c6869=_0x3c6869-0x0;var _0x20c49a=_0x5457[_0x3c6869];return _0x20c49a;};'use strict';var _=require(_0x7545('0x0'));var moment=require(_0x7545('0x1'));var util=require(_0x7545('0x2'));var Redis=require(_0x7545('0x3'));var config=require(_0x7545('0x4'));var logger=require(_0x7545('0x5'))(_0x7545('0x6'));var ami=require(_0x7545('0x7'));config[_0x7545('0x8')]=_[_0x7545('0x9')](config[_0x7545('0x8')],{'host':_0x7545('0xa'),'port':0x18eb});var io=require(_0x7545('0xb'))(new Redis(config['redis']));function VoiceAgentReport(_0x12dcd5){this[_0x7545('0xc')]={};this[_0x7545('0xd')]=_0x12dcd5['channels'];this[_0x7545('0xe')]=_0x12dcd5['voiceQueues'];this[_0x7545('0xf')]=_0x12dcd5[_0x7545('0xf')];this[_0x7545('0x10')]={};ami['on']('agentcalled',this['syncAgentCalled'][_0x7545('0x11')](this));ami['on'](_0x7545('0x12'),this[_0x7545('0x13')][_0x7545('0x11')](this));ami['on'](_0x7545('0x14'),this[_0x7545('0x15')]['bind'](this));ami['on'](_0x7545('0x16'),this[_0x7545('0x17')][_0x7545('0x11')](this));ami['on']('agentcomplete',this[_0x7545('0x18')]['bind'](this));ami['on'](_0x7545('0x19'),this[_0x7545('0x1a')]['bind'](this));ami['on']('hangup',this['syncHangup'][_0x7545('0x11')](this));ami['on'](_0x7545('0x1b'),this[_0x7545('0x1c')][_0x7545('0x11')](this));ami['on'](_0x7545('0x1d'),this['syncMusicOnHoldStop'][_0x7545('0x11')](this));ami['on'](_0x7545('0x1e'),this[_0x7545('0x1f')][_0x7545('0x11')](this));ami['on'](_0x7545('0x20'),this[_0x7545('0x21')][_0x7545('0x11')](this));}VoiceAgentReport[_0x7545('0x22')]['emit']=function(_0x1a0e4e,_0x25c172,_0x1098a3){io['to'](_0x1a0e4e)[_0x7545('0x23')](_0x25c172,_0x1098a3);};VoiceAgentReport[_0x7545('0x22')][_0x7545('0x24')]=function(_0x213911){return _0x213911!==null&&!_[_0x7545('0x25')](_0x213911);};VoiceAgentReport[_0x7545('0x22')][_0x7545('0x26')]=function(_0x91f404){try{if(this[_0x7545('0x24')](_0x91f404)){logger[_0x7545('0x27')](_0x7545('0x28'),_0x91f404[_0x7545('0x29')],_0x91f404[_0x7545('0x2a')],_0x91f404[_0x7545('0x2b')]);logger['debug']('[%s][voiceAgentReport][agentcalled]\x20event:',_0x91f404[_0x7545('0x29')],util[_0x7545('0x2c')](_0x91f404,{'showHidden':![],'depth':null}));if(_[_0x7545('0x25')](this[_0x7545('0xc')][_0x91f404[_0x7545('0x29')]])){this['channels'][_0x91f404[_0x7545('0x29')]]={};}if(_[_0x7545('0x25')](this[_0x7545('0xc')][_0x91f404[_0x7545('0x29')]][_0x91f404[_0x7545('0x2b')]])){this[_0x7545('0xc')][_0x91f404[_0x7545('0x29')]][_0x91f404[_0x7545('0x2b')]]={'agentcalledAt':moment()[_0x7545('0x2d')](_0x7545('0x2e')),'lastevent':_0x7545('0x2f'),'mandatoryDisposition':this[_0x7545('0xe')][_0x91f404[_0x7545('0x30')]]?this[_0x7545('0xe')][_0x91f404[_0x7545('0x30')]]['mandatoryDisposition']||![]:![],'type':this[_0x7545('0xe')][_0x91f404[_0x7545('0x30')]]?this[_0x7545('0xe')][_0x91f404[_0x7545('0x30')]][_0x7545('0x31')]||_0x7545('0x32'):_0x7545('0x32'),'variables':this['variables'][_0x91f404[_0x7545('0x29')]],'motionChannel':_0x7545('0x33')};}_[_0x7545('0x34')](this[_0x7545('0xc')][_0x91f404[_0x7545('0x29')]][_0x91f404[_0x7545('0x2b')]],_[_0x7545('0x35')](_0x91f404,[_0x7545('0x36'),'privilege']));logger[_0x7545('0x37')](_0x7545('0x38'),_0x91f404[_0x7545('0x29')],util[_0x7545('0x2c')](this['channels'][_0x91f404['uniqueid']][_0x91f404[_0x7545('0x2b')]],{'showHidden':![],'depth':null}));ami['emit'](_0x7545('0x39'),this[_0x7545('0xc')][_0x91f404[_0x7545('0x29')]][_0x91f404[_0x7545('0x2b')]]);var _0x11792b={'id':this[_0x7545('0xf')][_0x91f404[_0x7545('0x3a')]]['id'],'calleridnum':this[_0x7545('0xc')][_0x91f404[_0x7545('0x29')]][_0x91f404[_0x7545('0x2b')]]['calleridnum'],'queue':this[_0x7545('0xc')][_0x91f404['uniqueid']][_0x91f404[_0x7545('0x2b')]][_0x7545('0x30')],'variables':this[_0x7545('0xc')][_0x91f404[_0x7545('0x29')]][_0x91f404['destuniqueid']][_0x7545('0x10')]};logger[_0x7545('0x37')](_0x7545('0x3b'),_0x91f404[_0x7545('0x29')],util[_0x7545('0x2c')](_0x11792b,{'showHidden':![],'depth':null}));this[_0x7545('0x23')](util[_0x7545('0x2d')](_0x7545('0x3c'),_0x91f404[_0x7545('0x2a')]),_0x7545('0x3d'),_0x11792b);}}catch(_0x1c1b84){logger['error'](_0x7545('0x3e'),_0x91f404[_0x7545('0x29')],util[_0x7545('0x2c')](_0x1c1b84,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x7545('0x13')]=function(_0x28deaa){try{if(this[_0x7545('0x24')](_0x28deaa)){if(this[_0x7545('0xc')][_0x28deaa[_0x7545('0x29')]]){logger[_0x7545('0x37')](_0x7545('0x3f'),_0x28deaa[_0x7545('0x29')],util[_0x7545('0x2c')](_0x28deaa,{'showHidden':![],'depth':null}));for(var _0x98bca0 in this[_0x7545('0xc')][_0x28deaa['uniqueid']]){if(this[_0x7545('0xc')][_0x28deaa[_0x7545('0x29')]][_0x7545('0x40')](_0x98bca0)){if(_0x28deaa[_0x7545('0x2b')]===_0x98bca0){logger['info'](_0x7545('0x41'),_0x28deaa[_0x7545('0x29')],_0x28deaa[_0x7545('0x2a')],_0x28deaa[_0x7545('0x2b')]);this[_0x7545('0xc')][_0x28deaa['uniqueid']][_0x98bca0][_0x7545('0x42')]=moment()[_0x7545('0x2d')](_0x7545('0x2e'));this[_0x7545('0xc')][_0x28deaa[_0x7545('0x29')]][_0x98bca0][_0x7545('0x43')]=_0x28deaa['connectedlinename'];this[_0x7545('0xc')][_0x28deaa[_0x7545('0x29')]][_0x98bca0][_0x7545('0x44')]=_0x28deaa[_0x7545('0x44')];this[_0x7545('0xc')][_0x28deaa[_0x7545('0x29')]][_0x98bca0][_0x7545('0x45')]=_0x28deaa[_0x7545('0x45')];this[_0x7545('0xc')][_0x28deaa[_0x7545('0x29')]][_0x98bca0]['destchannelstatedesc']=_0x28deaa[_0x7545('0x46')];this[_0x7545('0xc')][_0x28deaa[_0x7545('0x29')]][_0x98bca0]['holdtime']=_0x28deaa[_0x7545('0x47')];this['channels'][_0x28deaa['uniqueid']][_0x98bca0][_0x7545('0x48')]=_0x7545('0x49');if(this[_0x7545('0xd')][this[_0x7545('0xc')][_0x28deaa[_0x7545('0x29')]][_0x98bca0]['uniqueid']]){var _0x593d21=this[_0x7545('0xd')][this[_0x7545('0xc')][_0x28deaa[_0x7545('0x29')]][_0x98bca0]['uniqueid']][_0x7545('0x4a')];this['channels'][_0x28deaa[_0x7545('0x29')]][_0x98bca0][_0x7545('0x4a')]=_0x593d21;_0x28deaa[_0x7545('0x4a')]=_0x593d21;}_[_0x7545('0x34')](this['agents'][_0x28deaa['interface']],_[_0x7545('0x4b')](_0x28deaa,['queue','destconnectedlinenum',_0x7545('0x4a')]));logger[_0x7545('0x37')](_0x7545('0x4c'),_0x28deaa['uniqueid'],util['inspect'](this[_0x7545('0xc')][_0x28deaa[_0x7545('0x29')]][_0x28deaa[_0x7545('0x2b')]],{'showHidden':![],'depth':null}));ami[_0x7545('0x23')](_0x7545('0x4d'),this[_0x7545('0xc')][_0x28deaa['uniqueid']][_0x28deaa['destuniqueid']]);logger[_0x7545('0x37')](_0x7545('0x4e'),_0x28deaa[_0x7545('0x29')],util[_0x7545('0x2c')](this['channels'][_0x28deaa[_0x7545('0x29')]][_0x28deaa[_0x7545('0x2b')]],{'showHidden':![],'depth':null}));this['emit'](util[_0x7545('0x2d')]('user:%s',_0x28deaa['membername']),_0x7545('0x4f'),this[_0x7545('0xc')][_0x28deaa['uniqueid']][_0x28deaa[_0x7545('0x2b')]]);}else if(!this[_0x7545('0xc')][_0x28deaa[_0x7545('0x29')]][_0x98bca0]['agentringnoanswer']&&!this[_0x7545('0xc')][_0x28deaa[_0x7545('0x29')]][_0x98bca0]['agentcomplete']){logger['info'](_0x7545('0x50'),_0x28deaa[_0x7545('0x29')],this[_0x7545('0xc')][_0x28deaa['uniqueid']][_0x98bca0][_0x7545('0x2a')],_0x98bca0);this[_0x7545('0xc')][_0x28deaa['uniqueid']][_0x98bca0]['agentringnoanswer']=!![];this[_0x7545('0xc')][_0x28deaa[_0x7545('0x29')]][_0x98bca0][_0x7545('0x51')]=moment()[_0x7545('0x2d')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x7545('0xc')][_0x28deaa[_0x7545('0x29')]][_0x98bca0]['answeredelsewheredestinationuniqueid']=_0x28deaa[_0x7545('0x2b')];this['channels'][_0x28deaa[_0x7545('0x29')]][_0x98bca0][_0x7545('0x52')]=_0x28deaa[_0x7545('0x2a')];this[_0x7545('0xc')][_0x28deaa[_0x7545('0x29')]][_0x98bca0][_0x7545('0x48')]='answered_elsewhere';this[_0x7545('0xc')][_0x28deaa[_0x7545('0x29')]][_0x98bca0][_0x7545('0x53')]=_0x7545('0x54');logger[_0x7545('0x37')](_0x7545('0x55'),_0x28deaa[_0x7545('0x29')],util[_0x7545('0x2c')](this[_0x7545('0xc')][_0x28deaa[_0x7545('0x29')]][_0x98bca0],{'showHidden':![],'depth':null}));ami[_0x7545('0x23')](_0x7545('0x56'),this[_0x7545('0xc')][_0x28deaa[_0x7545('0x29')]][_0x98bca0]);}}}}}}catch(_0x403c86){logger[_0x7545('0x57')](_0x7545('0x58'),_0x28deaa[_0x7545('0x29')],util[_0x7545('0x2c')](_0x403c86,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x7545('0x22')][_0x7545('0x15')]=function(_0x5490ac){try{if(this[_0x7545('0x24')](_0x5490ac)){logger[_0x7545('0x37')]('[%s][voiceAgentReport][agentringnoanswer]\x20event:',_0x5490ac[_0x7545('0x29')],util[_0x7545('0x2c')](_0x5490ac,{'showHidden':![],'depth':null}));if(this[_0x7545('0xc')][_0x5490ac[_0x7545('0x29')]]&&this['channels'][_0x5490ac[_0x7545('0x29')]][_0x5490ac[_0x7545('0x2b')]]){logger[_0x7545('0x27')](_0x7545('0x59'),_0x5490ac[_0x7545('0x29')],_0x5490ac['membername'],_0x5490ac[_0x7545('0x2b')]);this['channels'][_0x5490ac['uniqueid']][_0x5490ac[_0x7545('0x2b')]][_0x7545('0x14')]=!![];this['channels'][_0x5490ac[_0x7545('0x29')]][_0x5490ac[_0x7545('0x2b')]][_0x7545('0x51')]=moment()[_0x7545('0x2d')](_0x7545('0x2e'));this[_0x7545('0xc')][_0x5490ac['uniqueid']][_0x5490ac[_0x7545('0x2b')]][_0x7545('0x48')]=_0x7545('0x5a');this[_0x7545('0xc')][_0x5490ac[_0x7545('0x29')]][_0x5490ac[_0x7545('0x2b')]][_0x7545('0x53')]=_0x7545('0x5a');logger[_0x7545('0x37')]('[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:',_0x5490ac['uniqueid'],util[_0x7545('0x2c')](this[_0x7545('0xc')][_0x5490ac['uniqueid']][_0x5490ac[_0x7545('0x2b')]],{'showHidden':![],'depth':null}));ami[_0x7545('0x23')]('custom:agentringnoanswer',this[_0x7545('0xc')][_0x5490ac['uniqueid']][_0x5490ac[_0x7545('0x2b')]]);}}}catch(_0x3d1b8b){logger[_0x7545('0x57')](_0x7545('0x5b'),_0x5490ac['uniqueid'],util[_0x7545('0x2c')](_0x3d1b8b,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x7545('0x17')]=function(_0x54971d){try{if(this[_0x7545('0x24')](_0x54971d)){logger[_0x7545('0x37')]('[%s][voiceAgentReport][queuecallerabandon]\x20event:',_0x54971d[_0x7545('0x29')],util[_0x7545('0x2c')](_0x54971d,{'showHidden':![],'depth':null}));if(this[_0x7545('0xc')][_0x54971d[_0x7545('0x29')]]){for(var _0x59ebe8 in this['channels'][_0x54971d[_0x7545('0x29')]]){if(this[_0x7545('0xc')][_0x54971d[_0x7545('0x29')]][_0x7545('0x40')](_0x59ebe8)&&!this[_0x7545('0xc')][_0x54971d[_0x7545('0x29')]][_0x59ebe8][_0x7545('0x14')]&&!this[_0x7545('0xc')][_0x54971d[_0x7545('0x29')]][_0x59ebe8]['agentcomplete']){logger[_0x7545('0x27')](_0x7545('0x5c'),_0x54971d[_0x7545('0x29')],this[_0x7545('0xc')][_0x54971d[_0x7545('0x29')]][_0x59ebe8][_0x7545('0x2a')],_0x59ebe8);this[_0x7545('0xc')][_0x54971d[_0x7545('0x29')]][_0x59ebe8][_0x7545('0x14')]=!![];this[_0x7545('0xc')][_0x54971d[_0x7545('0x29')]][_0x59ebe8]['agentringnoanswerAt']=moment()[_0x7545('0x2d')](_0x7545('0x2e'));this[_0x7545('0xc')][_0x54971d[_0x7545('0x29')]][_0x59ebe8][_0x7545('0x48')]=_0x7545('0x5d');this['channels'][_0x54971d[_0x7545('0x29')]][_0x59ebe8]['reason']=_0x7545('0x5d');logger['debug'](_0x7545('0x5e'),_0x54971d['uniqueid'],util[_0x7545('0x2c')](this[_0x7545('0xc')][_0x54971d[_0x7545('0x29')]][_0x59ebe8],{'showHidden':![],'depth':null}));ami[_0x7545('0x23')](_0x7545('0x5f'),this['channels'][_0x54971d[_0x7545('0x29')]][_0x59ebe8]);}}}}}catch(_0x517504){logger[_0x7545('0x57')](_0x7545('0x60'),_0x54971d[_0x7545('0x29')],util[_0x7545('0x2c')](_0x517504,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x7545('0x18')]=function(_0x5e2b2e){try{if(this['isNotNull'](_0x5e2b2e)){logger[_0x7545('0x37')](_0x7545('0x61'),_0x5e2b2e[_0x7545('0x29')],util[_0x7545('0x2c')](_0x5e2b2e,{'showHidden':![],'depth':null}));if(this['channels'][_0x5e2b2e['uniqueid']]){for(var _0x5c8900 in this[_0x7545('0xc')][_0x5e2b2e[_0x7545('0x29')]]){if(this[_0x7545('0xc')][_0x5e2b2e[_0x7545('0x29')]][_0x7545('0x40')](_0x5c8900)){if(this[_0x7545('0xc')][_0x5e2b2e[_0x7545('0x29')]][_0x5c8900][_0x7545('0x42')]&&!this[_0x7545('0xc')][_0x5e2b2e[_0x7545('0x29')]][_0x5c8900][_0x7545('0x62')]){logger[_0x7545('0x27')]('[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x5e2b2e[_0x7545('0x29')],this['channels'][_0x5e2b2e[_0x7545('0x29')]][_0x5c8900][_0x7545('0x2a')],_0x5c8900);this[_0x7545('0xc')][_0x5e2b2e['uniqueid']][_0x5c8900][_0x7545('0x62')]=!![];this[_0x7545('0xc')][_0x5e2b2e[_0x7545('0x29')]][_0x5c8900][_0x7545('0x63')]=moment()[_0x7545('0x2d')](_0x7545('0x2e'));this['channels'][_0x5e2b2e[_0x7545('0x29')]][_0x5c8900]['lastevent']=_0x7545('0x64');this[_0x7545('0xc')][_0x5e2b2e['uniqueid']][_0x5c8900][_0x7545('0x53')]=_0x5e2b2e['reason']=='transfer'?'agent':_0x5e2b2e[_0x7545('0x53')];this['channels'][_0x5e2b2e[_0x7545('0x29')]][_0x5c8900][_0x7545('0x65')]=_0x5e2b2e['talktime'];if(this[_0x7545('0xe')][_0x5e2b2e['queue']]&&this[_0x7545('0xe')][_0x5e2b2e[_0x7545('0x30')]][_0x7545('0x66')]){this['channels'][_0x5e2b2e['uniqueid']][_0x5c8900][_0x7545('0x67')]=this[_0x7545('0xe')][_0x5e2b2e[_0x7545('0x30')]][_0x7545('0x68')];this['channels'][_0x5e2b2e[_0x7545('0x29')]][_0x5c8900][_0x7545('0x69')]=!![];}this[_0x7545('0xf')][_0x5e2b2e[_0x7545('0x3a')]]=_['omit'](this[_0x7545('0xf')][_0x5e2b2e[_0x7545('0x3a')]],[_0x7545('0x30'),_0x7545('0x6a')]);logger[_0x7545('0x37')]('[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:',_0x5e2b2e['uniqueid'],util[_0x7545('0x2c')](this[_0x7545('0xc')][_0x5e2b2e[_0x7545('0x29')]][_0x5c8900],{'showHidden':![],'depth':null}));ami[_0x7545('0x23')](_0x7545('0x6b'),this[_0x7545('0xc')][_0x5e2b2e[_0x7545('0x29')]][_0x5c8900]);logger[_0x7545('0x37')](_0x7545('0x6c'),_0x5e2b2e['uniqueid'],util['inspect']({'id':this[_0x7545('0xf')][_0x5e2b2e[_0x7545('0x3a')]]['id'],'destaccountcode':_0x5e2b2e[_0x7545('0x6d')]},{'showHidden':![],'depth':null}));this[_0x7545('0x23')](util[_0x7545('0x2d')](_0x7545('0x3c'),_0x5e2b2e['membername']),_0x7545('0x6e'),{'id':this[_0x7545('0xf')][_0x5e2b2e[_0x7545('0x3a')]]['id'],'destaccountcode':_0x5e2b2e[_0x7545('0x6d')]});}}}}}}catch(_0x4c24ab){logger['error'](_0x7545('0x6f'),_0x5e2b2e['uniqueid'],util['inspect'](_0x4c24ab,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x7545('0x22')][_0x7545('0x1a')]=function(_0x4e4120){try{if(this[_0x7545('0x24')](_0x4e4120)){logger['debug'](_0x7545('0x70'),_0x4e4120[_0x7545('0x29')],util[_0x7545('0x2c')](_0x4e4120,{'showHidden':![],'depth':null}));this[_0x7545('0x71')](_0x4e4120[_0x7545('0x29')],_[_0x7545('0x72')](_0x4e4120[_0x7545('0x73')])[0x0],_0x4e4120[_0x7545('0x74')]);if(this[_0x7545('0xc')][_0x4e4120[_0x7545('0x29')]]){for(var _0x38f3fe in this[_0x7545('0xc')][_0x4e4120[_0x7545('0x29')]]){if(this[_0x7545('0xc')][_0x4e4120[_0x7545('0x29')]][_0x7545('0x40')](_0x38f3fe)){logger[_0x7545('0x27')](_0x7545('0x75'),_0x4e4120[_0x7545('0x29')],_0x38f3fe,_['keys'](_0x4e4120['variable'])[0x0],_0x4e4120[_0x7545('0x74')]);if(_[_0x7545('0x25')](this['channels'][_0x4e4120['uniqueid']][_0x38f3fe][_0x7545('0x10')])){this[_0x7545('0xc')][_0x4e4120[_0x7545('0x29')]][_0x38f3fe]['variables']={};}this[_0x7545('0xc')][_0x4e4120['uniqueid']][_0x38f3fe][_0x7545('0x10')]=this[_0x7545('0x10')][_0x4e4120['uniqueid']];}}}}}catch(_0x2eebc3){logger[_0x7545('0x57')]('[%s][voiceAgentReport][varset]',_0x4e4120[_0x7545('0x29')],util[_0x7545('0x2c')](_0x2eebc3,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x7545('0x22')][_0x7545('0x71')]=function(_0x18215e,_0x3434c5,_0x8baab7){var _0x4fe0e=[_0x7545('0x76'),'rtpaudioqosbridged',_0x7545('0x77'),_0x7545('0x78'),_0x7545('0x79'),_0x7545('0x7a'),_0x7545('0x7b'),_0x7545('0x7c'),_0x7545('0x7d'),_0x7545('0x7e'),'bridgepeer',_0x7545('0x7f'),_0x7545('0x80'),_0x7545('0x81'),'memberinterface',_0x7545('0x82'),_0x7545('0x2a'),_0x7545('0x83'),_0x7545('0x84')];if(!_[_0x7545('0x85')](_0x3434c5)&&!_[_0x7545('0x86')](_0x4fe0e,_0x3434c5)){if(_[_0x7545('0x25')](this[_0x7545('0x10')][_0x18215e])){this[_0x7545('0x10')][_0x18215e]={};}this['variables'][_0x18215e][_0x3434c5]=_0x8baab7;}};VoiceAgentReport['prototype'][_0x7545('0x87')]=function(_0xac5afe){try{if(this['isNotNull'](_0xac5afe)){logger[_0x7545('0x37')](_0x7545('0x88'),_0xac5afe[_0x7545('0x29')],util[_0x7545('0x2c')](_0xac5afe,{'showHidden':![],'depth':null}));if(this[_0x7545('0xc')][_0xac5afe[_0x7545('0x29')]]){for(var _0x58b7fe in this[_0x7545('0xc')][_0xac5afe['uniqueid']]){if(this[_0x7545('0xc')][_0xac5afe[_0x7545('0x29')]][_0x7545('0x40')](_0x58b7fe)){if(this[_0x7545('0xc')][_0xac5afe[_0x7545('0x29')]][_0x58b7fe]['reason']==_0x7545('0x89')&&this[_0x7545('0xc')][_0xac5afe['uniqueid']][_0x58b7fe][_0x7545('0x62')]){logger[_0x7545('0x27')](_0x7545('0x8a'),_0xac5afe['uniqueid'],_0x58b7fe);this[_0x7545('0xc')][_0xac5afe['uniqueid']][_0x58b7fe][_0x7545('0x63')]=moment()[_0x7545('0x2d')](_0x7545('0x2e'));}}}logger[_0x7545('0x37')](_0x7545('0x8b'),_0xac5afe[_0x7545('0x29')],util['inspect'](_[_0x7545('0x8c')](this[_0x7545('0xc')][_0xac5afe[_0x7545('0x29')]]),{'showHidden':![],'depth':null}));ami[_0x7545('0x23')]('custom:voiceAgentReport',_[_0x7545('0x8c')](this['channels'][_0xac5afe[_0x7545('0x29')]]));delete this[_0x7545('0xc')][_0xac5afe[_0x7545('0x29')]];}if(this[_0x7545('0x10')][_0xac5afe[_0x7545('0x29')]]){delete this[_0x7545('0x10')][_0xac5afe[_0x7545('0x29')]];}}}catch(_0x282234){logger[_0x7545('0x57')]('[%s][voiceAgentReport][hangup]',_0xac5afe[_0x7545('0x29')],util[_0x7545('0x2c')](_0x282234,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x7545('0x22')][_0x7545('0x1f')]=function(_0x4f8bcf){try{if(this[_0x7545('0x24')](_0x4f8bcf)){logger[_0x7545('0x37')](_0x7545('0x8d'),_0x4f8bcf['uniqueid'],util[_0x7545('0x2c')](_0x4f8bcf,{'showHidden':![],'depth':null}));if(this[_0x7545('0xc')][_0x4f8bcf[_0x7545('0x8e')]]){for(var _0x5d1d2a in this[_0x7545('0xc')][_0x4f8bcf[_0x7545('0x8e')]]){if(this[_0x7545('0xc')][_0x4f8bcf[_0x7545('0x8e')]][_0x7545('0x40')](_0x5d1d2a)){if(_0x4f8bcf['origtransfereruniqueid']===_0x5d1d2a){logger['info']('[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x4f8bcf[_0x7545('0x29')],this[_0x7545('0xc')][_0x4f8bcf[_0x7545('0x8e')]][_0x5d1d2a][_0x7545('0x2a')],_0x5d1d2a);var _0x3875d9=moment();this[_0x7545('0xc')][_0x4f8bcf[_0x7545('0x8e')]][_0x5d1d2a][_0x7545('0x62')]=!![];this['channels'][_0x4f8bcf[_0x7545('0x8e')]][_0x5d1d2a][_0x7545('0x63')]=moment()[_0x7545('0x2d')](_0x7545('0x2e'));this['channels'][_0x4f8bcf[_0x7545('0x8e')]][_0x5d1d2a][_0x7545('0x48')]='complete';this[_0x7545('0xc')][_0x4f8bcf[_0x7545('0x8e')]][_0x5d1d2a][_0x7545('0x53')]=_0x7545('0x89');this[_0x7545('0xc')][_0x4f8bcf['transfereeuniqueid']][_0x5d1d2a][_0x7545('0x65')]=_0x3875d9[_0x7545('0x8f')](this[_0x7545('0xc')][_0x4f8bcf[_0x7545('0x8e')]][_0x5d1d2a]['agentconnectAt'],_0x7545('0x90'));}}}}if(this[_0x7545('0xc')][_0x4f8bcf[_0x7545('0x91')]]){var _0x539714=this['channels'][_0x4f8bcf['secondtransfereruniqueid']];this[_0x7545('0xc')][_0x4f8bcf[_0x7545('0x91')]]=this[_0x7545('0xc')][_0x4f8bcf['transfereeuniqueid']];this[_0x7545('0xc')][_0x4f8bcf[_0x7545('0x8e')]]=_0x539714;}}}catch(_0x5c21c1){logger['error'](_0x7545('0x92'),_0x4f8bcf[_0x7545('0x29')],util['inspect'](_0x5c21c1,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x7545('0x22')]['syncBlindTransfer']=function(_0x326f95){try{if(this[_0x7545('0x24')](_0x326f95)){logger[_0x7545('0x37')](_0x7545('0x93'),_0x326f95[_0x7545('0x29')],util[_0x7545('0x2c')](_0x326f95,{'showHidden':![],'depth':null}));if(this[_0x7545('0xc')][_0x326f95['transfereeuniqueid']]){for(var _0x17fd3d in this['channels'][_0x326f95['transfereeuniqueid']]){if(this[_0x7545('0xc')][_0x326f95[_0x7545('0x8e')]][_0x7545('0x40')](_0x17fd3d)){if(_0x326f95[_0x7545('0x94')]===_0x17fd3d){logger[_0x7545('0x27')](_0x7545('0x95'),_0x326f95[_0x7545('0x29')],this[_0x7545('0xc')][_0x326f95[_0x7545('0x8e')]][_0x17fd3d]['membername'],_0x17fd3d);var _0x4f8cbb=moment();this[_0x7545('0xc')][_0x326f95[_0x7545('0x8e')]][_0x17fd3d][_0x7545('0x62')]=!![];this['channels'][_0x326f95['transfereeuniqueid']][_0x17fd3d][_0x7545('0x63')]=_0x4f8cbb;this[_0x7545('0xc')][_0x326f95['transfereeuniqueid']][_0x17fd3d]['lastevent']=_0x7545('0x64');this['channels'][_0x326f95[_0x7545('0x8e')]][_0x17fd3d]['reason']=_0x7545('0x89');this[_0x7545('0xc')][_0x326f95[_0x7545('0x8e')]][_0x17fd3d][_0x7545('0x65')]=_0x4f8cbb['diff'](this[_0x7545('0xc')][_0x326f95[_0x7545('0x8e')]][_0x17fd3d]['agentconnectAt'],_0x7545('0x90'));}}}}}}catch(_0x16f520){logger['error'](_0x7545('0x96'),_0x326f95[_0x7545('0x29')],util['inspect'](_0x16f520,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x7545('0x22')]['syncMusicOnHoldStart']=function(_0x3d6ae9){var _0x3be5cd='';try{if(this[_0x7545('0x24')](_0x3d6ae9)){logger[_0x7545('0x37')](_0x7545('0x97'),_0x3d6ae9['uniqueid'],util[_0x7545('0x2c')](_0x3d6ae9,{'showHidden':![],'depth':null}));if(_0x3d6ae9[_0x7545('0x98')]){_0x3be5cd=_0x3d6ae9[_0x7545('0x98')][_0x7545('0x99')](0x0,_0x3d6ae9['channel'][_0x7545('0x9a')]('-'));if(this[_0x7545('0xf')][_0x3be5cd]){logger['info']('[%s][voiceAgentReport][musiconholdstart]\x20interface:%s',_0x3d6ae9['uniqueid'],_0x3be5cd);this['agents'][_0x3be5cd][_0x7545('0x9b')]=!![];}}}}catch(_0x3d0723){logger[_0x7545('0x57')]('[%s][voiceAgentReport][musiconholdstart]',_0x3d6ae9[_0x7545('0x29')],util[_0x7545('0x2c')](_0x3d0723,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x7545('0x9c')]=function(_0x5571de){var _0x4c0dff='';try{if(this[_0x7545('0x24')](_0x5571de)){logger[_0x7545('0x37')](_0x7545('0x9d'),_0x5571de['uniqueid'],util['inspect'](_0x5571de,{'showHidden':![],'depth':null}));if(_0x5571de['channel']){_0x4c0dff=_0x5571de[_0x7545('0x98')][_0x7545('0x99')](0x0,_0x5571de[_0x7545('0x98')]['lastIndexOf']('-'));if(this[_0x7545('0xf')][_0x4c0dff]){logger['info'](_0x7545('0x9e'),_0x5571de[_0x7545('0x29')],_0x4c0dff);this['agents'][_0x4c0dff][_0x7545('0x9b')]=![];}}}}catch(_0x11a672){logger[_0x7545('0x57')](_0x7545('0x9f'),_0x5571de[_0x7545('0x29')],util['inspect'](_0x11a672,{'showHidden':![],'depth':null}));}};module[_0x7545('0xa0')]=VoiceAgentReport;
\ No newline at end of file
+var _0x3e65=['[%s][voiceAgentReport][queuecallerabandon]\x20event:','[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:','[%s][voiceAgentReport][agentcomplete]\x20event:','agentcomplete','[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','complete','agent','talktime','acw','acwtime','[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:','destaccountcode','[%s][voiceAgentReport][agentcomplete]','[%s][voiceAgentReport][varset]\x20event:','keys','variable','value','[%s][voiceAgentReport][varset]','addVariable','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberlastcall','memberpenalty','memberrealtime','isNil','includes','[%s][voiceAgentReport][hangup]\x20event:','[%s][voiceAgentReport][hangup]\x20destuniqueid:%s','values','custom:voiceAgentReport','[%s][voiceAgentReport][hangup]','syncAttendedTransfer','[%s][voiceAgentReport][attendedtransfer]\x20event:','transfereeuniqueid','origtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','transfer','diff','secondtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]','syncBlindTransfer','[%s][voiceAgentReport][blindtransfer]\x20event:','seconds','[%s][voiceAgentReport][blindtransfer]','[%s][voiceAgentReport][musiconholdstart]\x20event:','channel','lastIndexOf','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','onhold','[%s][voiceAgentReport][musiconholdstart]','[%s][voiceAgentReport][musiconholdstop]\x20interface:%s','[%s][voiceAgentReport][musiconholdstop]','exports','lodash','util','ioredis','../../../config/environment','ami','redis','localhost','socket.io-emitter','channels','voiceChannels','agents','bind','syncAgentConnect','agentringnoanswer','syncAgentRingNoAnswer','queuecallerabandon','syncQueueCallerAbandon','syncAgentComplete','varset','syncVarSet','hangup','syncHangup','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','blindtransfer','emit','isUndefined','prototype','syncAgentCalled','info','[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','uniqueid','membername','destuniqueid','debug','inspect','format','YYYY-MM-DD\x20HH:mm:ss','called','voiceQueues','queue','mandatoryDisposition','type','inbound','voice','omit','event','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','custom:agentcalled','interface','variables','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:','user:%s','user:called','error','[%s][voiceAgentReport][agentcalled]','hasOwnProperty','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connectedlinename','connectedlinenum','destchannelstate','destchannelstatedesc','holdtime','connect','routealias','merge','pick','destconnectedlinenum','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:','custom:agentconnect','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:','user:agentconnect','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere','agentringnoanswerAt','answeredelsewheredestinationuniqueid','answeredelsewheremembername','reason','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:','custom:agentansweredelsewhere','[%s][voiceAgentReport][agentconnect]','[%s][voiceAgentReport][agentringnoanswer]\x20event:','[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected','lastevent','rejected','[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:','[%s][voiceAgentReport][agentringnoanswer]','isNotNull'];(function(_0xe525b8,_0x1a1d17){var _0x38d9d6=function(_0x3550a3){while(--_0x3550a3){_0xe525b8['push'](_0xe525b8['shift']());}};_0x38d9d6(++_0x1a1d17);}(_0x3e65,0xde));var _0x53e6=function(_0x19f3ae,_0x50c2b8){_0x19f3ae=_0x19f3ae-0x0;var _0x3394f8=_0x3e65[_0x19f3ae];return _0x3394f8;};'use strict';var _=require(_0x53e6('0x0'));var moment=require('moment');var util=require(_0x53e6('0x1'));var Redis=require(_0x53e6('0x2'));var config=require(_0x53e6('0x3'));var logger=require('../../../config/logger')(_0x53e6('0x4'));var ami=require('../ami');config[_0x53e6('0x5')]=_['defaults'](config[_0x53e6('0x5')],{'host':_0x53e6('0x6'),'port':0x18eb});var io=require(_0x53e6('0x7'))(new Redis(config['redis']));function VoiceAgentReport(_0x5f377f){this[_0x53e6('0x8')]={};this[_0x53e6('0x9')]=_0x5f377f[_0x53e6('0x8')];this['voiceQueues']=_0x5f377f['voiceQueues'];this[_0x53e6('0xa')]=_0x5f377f['agents'];this['variables']={};ami['on']('agentcalled',this['syncAgentCalled'][_0x53e6('0xb')](this));ami['on']('agentconnect',this[_0x53e6('0xc')][_0x53e6('0xb')](this));ami['on'](_0x53e6('0xd'),this[_0x53e6('0xe')][_0x53e6('0xb')](this));ami['on'](_0x53e6('0xf'),this[_0x53e6('0x10')][_0x53e6('0xb')](this));ami['on']('agentcomplete',this[_0x53e6('0x11')]['bind'](this));ami['on'](_0x53e6('0x12'),this[_0x53e6('0x13')][_0x53e6('0xb')](this));ami['on'](_0x53e6('0x14'),this[_0x53e6('0x15')][_0x53e6('0xb')](this));ami['on'](_0x53e6('0x16'),this[_0x53e6('0x17')][_0x53e6('0xb')](this));ami['on'](_0x53e6('0x18'),this[_0x53e6('0x19')][_0x53e6('0xb')](this));ami['on']('attendedtransfer',this['syncAttendedTransfer']['bind'](this));ami['on'](_0x53e6('0x1a'),this['syncBlindTransfer'][_0x53e6('0xb')](this));}VoiceAgentReport['prototype'][_0x53e6('0x1b')]=function(_0x573ba7,_0xcc92aa,_0x22b388){io['to'](_0x573ba7)[_0x53e6('0x1b')](_0xcc92aa,_0x22b388);};VoiceAgentReport['prototype']['isNotNull']=function(_0x265d7f){return _0x265d7f!==null&&!_[_0x53e6('0x1c')](_0x265d7f);};VoiceAgentReport[_0x53e6('0x1d')][_0x53e6('0x1e')]=function(_0x3d7a89){try{if(this['isNotNull'](_0x3d7a89)){logger[_0x53e6('0x1f')](_0x53e6('0x20'),_0x3d7a89[_0x53e6('0x21')],_0x3d7a89[_0x53e6('0x22')],_0x3d7a89[_0x53e6('0x23')]);logger[_0x53e6('0x24')]('[%s][voiceAgentReport][agentcalled]\x20event:',_0x3d7a89['uniqueid'],util[_0x53e6('0x25')](_0x3d7a89,{'showHidden':![],'depth':null}));if(_[_0x53e6('0x1c')](this[_0x53e6('0x8')][_0x3d7a89['uniqueid']])){this[_0x53e6('0x8')][_0x3d7a89['uniqueid']]={};}if(_[_0x53e6('0x1c')](this[_0x53e6('0x8')][_0x3d7a89['uniqueid']][_0x3d7a89['destuniqueid']])){this['channels'][_0x3d7a89[_0x53e6('0x21')]][_0x3d7a89[_0x53e6('0x23')]]={'agentcalledAt':moment()[_0x53e6('0x26')](_0x53e6('0x27')),'lastevent':_0x53e6('0x28'),'mandatoryDisposition':this[_0x53e6('0x29')][_0x3d7a89[_0x53e6('0x2a')]]?this['voiceQueues'][_0x3d7a89[_0x53e6('0x2a')]][_0x53e6('0x2b')]||![]:![],'type':this[_0x53e6('0x29')][_0x3d7a89['queue']]?this['voiceQueues'][_0x3d7a89[_0x53e6('0x2a')]][_0x53e6('0x2c')]||_0x53e6('0x2d'):'inbound','variables':this['variables'][_0x3d7a89['uniqueid']],'motionChannel':_0x53e6('0x2e')};}_['merge'](this[_0x53e6('0x8')][_0x3d7a89[_0x53e6('0x21')]][_0x3d7a89[_0x53e6('0x23')]],_[_0x53e6('0x2f')](_0x3d7a89,[_0x53e6('0x30'),'privilege']));logger[_0x53e6('0x24')](_0x53e6('0x31'),_0x3d7a89['uniqueid'],util[_0x53e6('0x25')](this['channels'][_0x3d7a89[_0x53e6('0x21')]][_0x3d7a89[_0x53e6('0x23')]],{'showHidden':![],'depth':null}));ami['emit'](_0x53e6('0x32'),this[_0x53e6('0x8')][_0x3d7a89[_0x53e6('0x21')]][_0x3d7a89[_0x53e6('0x23')]]);var _0x3fd8ce={'id':this[_0x53e6('0xa')][_0x3d7a89[_0x53e6('0x33')]]['id'],'calleridnum':this[_0x53e6('0x8')][_0x3d7a89[_0x53e6('0x21')]][_0x3d7a89[_0x53e6('0x23')]]['calleridnum'],'queue':this['channels'][_0x3d7a89[_0x53e6('0x21')]][_0x3d7a89[_0x53e6('0x23')]][_0x53e6('0x2a')],'variables':this['channels'][_0x3d7a89[_0x53e6('0x21')]][_0x3d7a89[_0x53e6('0x23')]][_0x53e6('0x34')]};logger['debug'](_0x53e6('0x35'),_0x3d7a89[_0x53e6('0x21')],util['inspect'](_0x3fd8ce,{'showHidden':![],'depth':null}));this['emit'](util[_0x53e6('0x26')](_0x53e6('0x36'),_0x3d7a89[_0x53e6('0x22')]),_0x53e6('0x37'),_0x3fd8ce);}}catch(_0x22e671){logger[_0x53e6('0x38')](_0x53e6('0x39'),_0x3d7a89[_0x53e6('0x21')],util[_0x53e6('0x25')](_0x22e671,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x53e6('0x1d')][_0x53e6('0xc')]=function(_0x563d61){try{if(this['isNotNull'](_0x563d61)){if(this[_0x53e6('0x8')][_0x563d61[_0x53e6('0x21')]]){logger[_0x53e6('0x24')]('[%s][voiceAgentReport][agentconnect]\x20event:',_0x563d61[_0x53e6('0x21')],util[_0x53e6('0x25')](_0x563d61,{'showHidden':![],'depth':null}));for(var _0xe46b70 in this['channels'][_0x563d61[_0x53e6('0x21')]]){if(this[_0x53e6('0x8')][_0x563d61[_0x53e6('0x21')]][_0x53e6('0x3a')](_0xe46b70)){if(_0x563d61[_0x53e6('0x23')]===_0xe46b70){logger['info'](_0x53e6('0x3b'),_0x563d61[_0x53e6('0x21')],_0x563d61[_0x53e6('0x22')],_0x563d61[_0x53e6('0x23')]);this[_0x53e6('0x8')][_0x563d61[_0x53e6('0x21')]][_0xe46b70][_0x53e6('0x3c')]=moment()['format'](_0x53e6('0x27'));this[_0x53e6('0x8')][_0x563d61[_0x53e6('0x21')]][_0xe46b70]['connectedlinename']=_0x563d61[_0x53e6('0x3d')];this[_0x53e6('0x8')][_0x563d61[_0x53e6('0x21')]][_0xe46b70][_0x53e6('0x3e')]=_0x563d61[_0x53e6('0x3e')];this[_0x53e6('0x8')][_0x563d61[_0x53e6('0x21')]][_0xe46b70][_0x53e6('0x3f')]=_0x563d61[_0x53e6('0x3f')];this['channels'][_0x563d61[_0x53e6('0x21')]][_0xe46b70][_0x53e6('0x40')]=_0x563d61['destchannelstatedesc'];this[_0x53e6('0x8')][_0x563d61[_0x53e6('0x21')]][_0xe46b70]['holdtime']=_0x563d61[_0x53e6('0x41')];this[_0x53e6('0x8')][_0x563d61['uniqueid']][_0xe46b70]['lastevent']=_0x53e6('0x42');if(this[_0x53e6('0x9')][this[_0x53e6('0x8')][_0x563d61[_0x53e6('0x21')]][_0xe46b70][_0x53e6('0x21')]]){var _0x2621f0=this[_0x53e6('0x9')][this[_0x53e6('0x8')][_0x563d61[_0x53e6('0x21')]][_0xe46b70]['uniqueid']][_0x53e6('0x43')];this['channels'][_0x563d61['uniqueid']][_0xe46b70][_0x53e6('0x43')]=_0x2621f0;_0x563d61[_0x53e6('0x43')]=_0x2621f0;}_[_0x53e6('0x44')](this[_0x53e6('0xa')][_0x563d61[_0x53e6('0x33')]],_[_0x53e6('0x45')](_0x563d61,[_0x53e6('0x2a'),_0x53e6('0x46'),_0x53e6('0x43')]));logger[_0x53e6('0x24')](_0x53e6('0x47'),_0x563d61[_0x53e6('0x21')],util[_0x53e6('0x25')](this[_0x53e6('0x8')][_0x563d61[_0x53e6('0x21')]][_0x563d61[_0x53e6('0x23')]],{'showHidden':![],'depth':null}));ami[_0x53e6('0x1b')](_0x53e6('0x48'),this[_0x53e6('0x8')][_0x563d61[_0x53e6('0x21')]][_0x563d61['destuniqueid']]);logger[_0x53e6('0x24')](_0x53e6('0x49'),_0x563d61['uniqueid'],util[_0x53e6('0x25')](this[_0x53e6('0x8')][_0x563d61['uniqueid']][_0x563d61[_0x53e6('0x23')]],{'showHidden':![],'depth':null}));this[_0x53e6('0x1b')](util[_0x53e6('0x26')](_0x53e6('0x36'),_0x563d61[_0x53e6('0x22')]),_0x53e6('0x4a'),this['channels'][_0x563d61[_0x53e6('0x21')]][_0x563d61[_0x53e6('0x23')]]);}else if(!this[_0x53e6('0x8')][_0x563d61[_0x53e6('0x21')]][_0xe46b70][_0x53e6('0xd')]&&!this['channels'][_0x563d61[_0x53e6('0x21')]][_0xe46b70]['agentcomplete']){logger[_0x53e6('0x1f')](_0x53e6('0x4b'),_0x563d61['uniqueid'],this[_0x53e6('0x8')][_0x563d61[_0x53e6('0x21')]][_0xe46b70][_0x53e6('0x22')],_0xe46b70);this[_0x53e6('0x8')][_0x563d61['uniqueid']][_0xe46b70][_0x53e6('0xd')]=!![];this[_0x53e6('0x8')][_0x563d61['uniqueid']][_0xe46b70][_0x53e6('0x4c')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x53e6('0x8')][_0x563d61[_0x53e6('0x21')]][_0xe46b70][_0x53e6('0x4d')]=_0x563d61['destuniqueid'];this['channels'][_0x563d61[_0x53e6('0x21')]][_0xe46b70][_0x53e6('0x4e')]=_0x563d61[_0x53e6('0x22')];this[_0x53e6('0x8')][_0x563d61['uniqueid']][_0xe46b70]['lastevent']='answered_elsewhere';this[_0x53e6('0x8')][_0x563d61[_0x53e6('0x21')]][_0xe46b70][_0x53e6('0x4f')]='answered_elsewhere';logger[_0x53e6('0x24')](_0x53e6('0x50'),_0x563d61['uniqueid'],util['inspect'](this[_0x53e6('0x8')][_0x563d61[_0x53e6('0x21')]][_0xe46b70],{'showHidden':![],'depth':null}));ami[_0x53e6('0x1b')](_0x53e6('0x51'),this[_0x53e6('0x8')][_0x563d61[_0x53e6('0x21')]][_0xe46b70]);}}}}}}catch(_0x4f7fe9){logger['error'](_0x53e6('0x52'),_0x563d61[_0x53e6('0x21')],util['inspect'](_0x4f7fe9,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x53e6('0x1d')][_0x53e6('0xe')]=function(_0x2053a3){try{if(this['isNotNull'](_0x2053a3)){logger[_0x53e6('0x24')](_0x53e6('0x53'),_0x2053a3['uniqueid'],util[_0x53e6('0x25')](_0x2053a3,{'showHidden':![],'depth':null}));if(this['channels'][_0x2053a3[_0x53e6('0x21')]]&&this['channels'][_0x2053a3[_0x53e6('0x21')]][_0x2053a3[_0x53e6('0x23')]]){logger[_0x53e6('0x1f')](_0x53e6('0x54'),_0x2053a3[_0x53e6('0x21')],_0x2053a3[_0x53e6('0x22')],_0x2053a3[_0x53e6('0x23')]);this[_0x53e6('0x8')][_0x2053a3[_0x53e6('0x21')]][_0x2053a3[_0x53e6('0x23')]][_0x53e6('0xd')]=!![];this[_0x53e6('0x8')][_0x2053a3['uniqueid']][_0x2053a3['destuniqueid']]['agentringnoanswerAt']=moment()[_0x53e6('0x26')](_0x53e6('0x27'));this['channels'][_0x2053a3[_0x53e6('0x21')]][_0x2053a3[_0x53e6('0x23')]][_0x53e6('0x55')]=_0x53e6('0x56');this[_0x53e6('0x8')][_0x2053a3[_0x53e6('0x21')]][_0x2053a3[_0x53e6('0x23')]]['reason']='rejected';logger[_0x53e6('0x24')](_0x53e6('0x57'),_0x2053a3[_0x53e6('0x21')],util[_0x53e6('0x25')](this['channels'][_0x2053a3[_0x53e6('0x21')]][_0x2053a3[_0x53e6('0x23')]],{'showHidden':![],'depth':null}));ami[_0x53e6('0x1b')]('custom:agentringnoanswer',this['channels'][_0x2053a3[_0x53e6('0x21')]][_0x2053a3[_0x53e6('0x23')]]);}}}catch(_0x5ee964){logger[_0x53e6('0x38')](_0x53e6('0x58'),_0x2053a3[_0x53e6('0x21')],util[_0x53e6('0x25')](_0x5ee964,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x53e6('0x10')]=function(_0xd58263){try{if(this[_0x53e6('0x59')](_0xd58263)){logger[_0x53e6('0x24')](_0x53e6('0x5a'),_0xd58263[_0x53e6('0x21')],util['inspect'](_0xd58263,{'showHidden':![],'depth':null}));if(this[_0x53e6('0x8')][_0xd58263[_0x53e6('0x21')]]){for(var _0x3689f5 in this[_0x53e6('0x8')][_0xd58263[_0x53e6('0x21')]]){if(this['channels'][_0xd58263[_0x53e6('0x21')]][_0x53e6('0x3a')](_0x3689f5)&&!this['channels'][_0xd58263['uniqueid']][_0x3689f5][_0x53e6('0xd')]&&!this[_0x53e6('0x8')][_0xd58263[_0x53e6('0x21')]][_0x3689f5]['agentcomplete']){logger[_0x53e6('0x1f')](_0x53e6('0x5b'),_0xd58263[_0x53e6('0x21')],this[_0x53e6('0x8')][_0xd58263[_0x53e6('0x21')]][_0x3689f5][_0x53e6('0x22')],_0x3689f5);this['channels'][_0xd58263['uniqueid']][_0x3689f5][_0x53e6('0xd')]=!![];this[_0x53e6('0x8')][_0xd58263[_0x53e6('0x21')]][_0x3689f5][_0x53e6('0x4c')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x53e6('0x8')][_0xd58263['uniqueid']][_0x3689f5][_0x53e6('0x55')]='abandoned';this[_0x53e6('0x8')][_0xd58263[_0x53e6('0x21')]][_0x3689f5][_0x53e6('0x4f')]=_0x53e6('0x5c');logger['debug'](_0x53e6('0x5d'),_0xd58263[_0x53e6('0x21')],util[_0x53e6('0x25')](this[_0x53e6('0x8')][_0xd58263[_0x53e6('0x21')]][_0x3689f5],{'showHidden':![],'depth':null}));ami[_0x53e6('0x1b')]('custom:agentqueuecallerabandon',this[_0x53e6('0x8')][_0xd58263[_0x53e6('0x21')]][_0x3689f5]);}}}}}catch(_0x1f9362){logger[_0x53e6('0x38')]('[%s][voiceAgentReport][queuecallerabandon]',_0xd58263[_0x53e6('0x21')],util[_0x53e6('0x25')](_0x1f9362,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x53e6('0x1d')]['syncAgentComplete']=function(_0xe51428){try{if(this[_0x53e6('0x59')](_0xe51428)){logger[_0x53e6('0x24')](_0x53e6('0x5e'),_0xe51428['uniqueid'],util[_0x53e6('0x25')](_0xe51428,{'showHidden':![],'depth':null}));if(this['channels'][_0xe51428[_0x53e6('0x21')]]){for(var _0x51fa3a in this['channels'][_0xe51428['uniqueid']]){if(this[_0x53e6('0x8')][_0xe51428[_0x53e6('0x21')]][_0x53e6('0x3a')](_0x51fa3a)){if(this[_0x53e6('0x8')][_0xe51428[_0x53e6('0x21')]][_0x51fa3a][_0x53e6('0x3c')]&&!this[_0x53e6('0x8')][_0xe51428[_0x53e6('0x21')]][_0x51fa3a][_0x53e6('0x5f')]){logger['info'](_0x53e6('0x60'),_0xe51428[_0x53e6('0x21')],this['channels'][_0xe51428[_0x53e6('0x21')]][_0x51fa3a]['membername'],_0x51fa3a);this['channels'][_0xe51428[_0x53e6('0x21')]][_0x51fa3a]['agentcomplete']=!![];this[_0x53e6('0x8')][_0xe51428[_0x53e6('0x21')]][_0x51fa3a][_0x53e6('0x61')]=moment()[_0x53e6('0x26')](_0x53e6('0x27'));this[_0x53e6('0x8')][_0xe51428[_0x53e6('0x21')]][_0x51fa3a][_0x53e6('0x55')]=_0x53e6('0x62');this['channels'][_0xe51428[_0x53e6('0x21')]][_0x51fa3a][_0x53e6('0x4f')]=_0xe51428[_0x53e6('0x4f')]=='transfer'?_0x53e6('0x63'):_0xe51428[_0x53e6('0x4f')];this[_0x53e6('0x8')][_0xe51428[_0x53e6('0x21')]][_0x51fa3a][_0x53e6('0x64')]=_0xe51428[_0x53e6('0x64')];if(this[_0x53e6('0x29')][_0xe51428[_0x53e6('0x2a')]]&&this['voiceQueues'][_0xe51428[_0x53e6('0x2a')]][_0x53e6('0x65')]){this[_0x53e6('0x8')][_0xe51428[_0x53e6('0x21')]][_0x51fa3a][_0x53e6('0x66')]=this[_0x53e6('0x29')][_0xe51428['queue']]['acwTimeout'];this[_0x53e6('0x8')][_0xe51428['uniqueid']][_0x51fa3a]['agentacw']=!![];}this[_0x53e6('0xa')][_0xe51428[_0x53e6('0x33')]]=_[_0x53e6('0x2f')](this['agents'][_0xe51428[_0x53e6('0x33')]],[_0x53e6('0x2a'),_0x53e6('0x46')]);logger[_0x53e6('0x24')](_0x53e6('0x67'),_0xe51428[_0x53e6('0x21')],util[_0x53e6('0x25')](this[_0x53e6('0x8')][_0xe51428[_0x53e6('0x21')]][_0x51fa3a],{'showHidden':![],'depth':null}));ami['emit']('custom:agentcomplete',this[_0x53e6('0x8')][_0xe51428['uniqueid']][_0x51fa3a]);logger[_0x53e6('0x24')]('[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:',_0xe51428[_0x53e6('0x21')],util['inspect']({'id':this[_0x53e6('0xa')][_0xe51428[_0x53e6('0x33')]]['id'],'destaccountcode':_0xe51428[_0x53e6('0x68')]},{'showHidden':![],'depth':null}));this[_0x53e6('0x1b')](util[_0x53e6('0x26')](_0x53e6('0x36'),_0xe51428['membername']),'user:agentcomplete',{'id':this['agents'][_0xe51428['interface']]['id'],'destaccountcode':_0xe51428[_0x53e6('0x68')]});}}}}}}catch(_0x45f7e9){logger['error'](_0x53e6('0x69'),_0xe51428[_0x53e6('0x21')],util[_0x53e6('0x25')](_0x45f7e9,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x53e6('0x1d')][_0x53e6('0x13')]=function(_0x3399af){try{if(this['isNotNull'](_0x3399af)){logger['debug'](_0x53e6('0x6a'),_0x3399af[_0x53e6('0x21')],util[_0x53e6('0x25')](_0x3399af,{'showHidden':![],'depth':null}));this['addVariable'](_0x3399af['uniqueid'],_[_0x53e6('0x6b')](_0x3399af[_0x53e6('0x6c')])[0x0],_0x3399af[_0x53e6('0x6d')]);if(this[_0x53e6('0x8')][_0x3399af[_0x53e6('0x21')]]){for(var _0x33f63b in this['channels'][_0x3399af[_0x53e6('0x21')]]){if(this[_0x53e6('0x8')][_0x3399af[_0x53e6('0x21')]][_0x53e6('0x3a')](_0x33f63b)){logger[_0x53e6('0x1f')]('[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s',_0x3399af[_0x53e6('0x21')],_0x33f63b,_[_0x53e6('0x6b')](_0x3399af[_0x53e6('0x6c')])[0x0],_0x3399af[_0x53e6('0x6d')]);if(_['isUndefined'](this[_0x53e6('0x8')][_0x3399af[_0x53e6('0x21')]][_0x33f63b][_0x53e6('0x34')])){this[_0x53e6('0x8')][_0x3399af[_0x53e6('0x21')]][_0x33f63b][_0x53e6('0x34')]={};}this[_0x53e6('0x8')][_0x3399af[_0x53e6('0x21')]][_0x33f63b][_0x53e6('0x34')]=this[_0x53e6('0x34')][_0x3399af[_0x53e6('0x21')]];}}}}}catch(_0x4f91bb){logger[_0x53e6('0x38')](_0x53e6('0x6e'),_0x3399af[_0x53e6('0x21')],util['inspect'](_0x4f91bb,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x53e6('0x1d')][_0x53e6('0x6f')]=function(_0x4054f0,_0x17f467,_0x4fb6a0){var _0x5160e1=['rtpaudioqos',_0x53e6('0x70'),'rtpaudioqosjitter',_0x53e6('0x71'),_0x53e6('0x72'),_0x53e6('0x73'),_0x53e6('0x74'),_0x53e6('0x75'),_0x53e6('0x76'),'sipuri',_0x53e6('0x77'),_0x53e6('0x78'),_0x53e6('0x79'),_0x53e6('0x7a'),_0x53e6('0x7b'),_0x53e6('0x7c'),_0x53e6('0x22'),_0x53e6('0x7d'),_0x53e6('0x7e')];if(!_[_0x53e6('0x7f')](_0x17f467)&&!_[_0x53e6('0x80')](_0x5160e1,_0x17f467)){if(_['isUndefined'](this[_0x53e6('0x34')][_0x4054f0])){this['variables'][_0x4054f0]={};}this[_0x53e6('0x34')][_0x4054f0][_0x17f467]=_0x4fb6a0;}};VoiceAgentReport[_0x53e6('0x1d')]['syncHangup']=function(_0x5c4c01){try{if(this[_0x53e6('0x59')](_0x5c4c01)){logger[_0x53e6('0x24')](_0x53e6('0x81'),_0x5c4c01['uniqueid'],util['inspect'](_0x5c4c01,{'showHidden':![],'depth':null}));if(this['channels'][_0x5c4c01['uniqueid']]){for(var _0x1c95a7 in this[_0x53e6('0x8')][_0x5c4c01['uniqueid']]){if(this[_0x53e6('0x8')][_0x5c4c01['uniqueid']][_0x53e6('0x3a')](_0x1c95a7)){if(this['channels'][_0x5c4c01[_0x53e6('0x21')]][_0x1c95a7]['reason']=='transfer'&&this[_0x53e6('0x8')][_0x5c4c01[_0x53e6('0x21')]][_0x1c95a7]['agentcomplete']){logger[_0x53e6('0x1f')](_0x53e6('0x82'),_0x5c4c01['uniqueid'],_0x1c95a7);this[_0x53e6('0x8')][_0x5c4c01[_0x53e6('0x21')]][_0x1c95a7][_0x53e6('0x61')]=moment()['format'](_0x53e6('0x27'));}}}logger['debug']('[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:',_0x5c4c01['uniqueid'],util[_0x53e6('0x25')](_[_0x53e6('0x83')](this[_0x53e6('0x8')][_0x5c4c01[_0x53e6('0x21')]]),{'showHidden':![],'depth':null}));ami[_0x53e6('0x1b')](_0x53e6('0x84'),_[_0x53e6('0x83')](this[_0x53e6('0x8')][_0x5c4c01[_0x53e6('0x21')]]));delete this[_0x53e6('0x8')][_0x5c4c01[_0x53e6('0x21')]];}if(this[_0x53e6('0x34')][_0x5c4c01[_0x53e6('0x21')]]){delete this[_0x53e6('0x34')][_0x5c4c01[_0x53e6('0x21')]];}}}catch(_0x49fc43){logger[_0x53e6('0x38')](_0x53e6('0x85'),_0x5c4c01[_0x53e6('0x21')],util[_0x53e6('0x25')](_0x49fc43,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x53e6('0x86')]=function(_0x13154a){try{if(this[_0x53e6('0x59')](_0x13154a)){logger[_0x53e6('0x24')](_0x53e6('0x87'),_0x13154a[_0x53e6('0x21')],util[_0x53e6('0x25')](_0x13154a,{'showHidden':![],'depth':null}));if(this[_0x53e6('0x8')][_0x13154a[_0x53e6('0x88')]]){for(var _0x42da1c in this[_0x53e6('0x8')][_0x13154a['transfereeuniqueid']]){if(this['channels'][_0x13154a[_0x53e6('0x88')]]['hasOwnProperty'](_0x42da1c)){if(_0x13154a[_0x53e6('0x89')]===_0x42da1c){logger[_0x53e6('0x1f')](_0x53e6('0x8a'),_0x13154a[_0x53e6('0x21')],this[_0x53e6('0x8')][_0x13154a[_0x53e6('0x88')]][_0x42da1c][_0x53e6('0x22')],_0x42da1c);var _0x26d5fc=moment();this[_0x53e6('0x8')][_0x13154a[_0x53e6('0x88')]][_0x42da1c][_0x53e6('0x5f')]=!![];this[_0x53e6('0x8')][_0x13154a[_0x53e6('0x88')]][_0x42da1c]['agentcompleteAt']=moment()[_0x53e6('0x26')](_0x53e6('0x27'));this[_0x53e6('0x8')][_0x13154a[_0x53e6('0x88')]][_0x42da1c][_0x53e6('0x55')]=_0x53e6('0x62');this['channels'][_0x13154a['transfereeuniqueid']][_0x42da1c][_0x53e6('0x4f')]=_0x53e6('0x8b');this[_0x53e6('0x8')][_0x13154a[_0x53e6('0x88')]][_0x42da1c][_0x53e6('0x64')]=_0x26d5fc[_0x53e6('0x8c')](this[_0x53e6('0x8')][_0x13154a['transfereeuniqueid']][_0x42da1c][_0x53e6('0x3c')],'seconds');}}}}if(this[_0x53e6('0x8')][_0x13154a[_0x53e6('0x8d')]]){var _0x4d4bf8=this['channels'][_0x13154a[_0x53e6('0x8d')]];this[_0x53e6('0x8')][_0x13154a[_0x53e6('0x8d')]]=this[_0x53e6('0x8')][_0x13154a['transfereeuniqueid']];this[_0x53e6('0x8')][_0x13154a[_0x53e6('0x88')]]=_0x4d4bf8;}}}catch(_0x45c334){logger['error'](_0x53e6('0x8e'),_0x13154a[_0x53e6('0x21')],util[_0x53e6('0x25')](_0x45c334,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x53e6('0x1d')][_0x53e6('0x8f')]=function(_0x3f942b){try{if(this['isNotNull'](_0x3f942b)){logger[_0x53e6('0x24')](_0x53e6('0x90'),_0x3f942b['uniqueid'],util[_0x53e6('0x25')](_0x3f942b,{'showHidden':![],'depth':null}));if(this[_0x53e6('0x8')][_0x3f942b['transfereeuniqueid']]){for(var _0x552e21 in this['channels'][_0x3f942b['transfereeuniqueid']]){if(this[_0x53e6('0x8')][_0x3f942b['transfereeuniqueid']][_0x53e6('0x3a')](_0x552e21)){if(_0x3f942b['transfereruniqueid']===_0x552e21){logger[_0x53e6('0x1f')]('[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x3f942b['uniqueid'],this[_0x53e6('0x8')][_0x3f942b[_0x53e6('0x88')]][_0x552e21][_0x53e6('0x22')],_0x552e21);var _0x56c446=moment();this[_0x53e6('0x8')][_0x3f942b['transfereeuniqueid']][_0x552e21]['agentcomplete']=!![];this[_0x53e6('0x8')][_0x3f942b[_0x53e6('0x88')]][_0x552e21][_0x53e6('0x61')]=_0x56c446;this[_0x53e6('0x8')][_0x3f942b[_0x53e6('0x88')]][_0x552e21][_0x53e6('0x55')]=_0x53e6('0x62');this[_0x53e6('0x8')][_0x3f942b[_0x53e6('0x88')]][_0x552e21][_0x53e6('0x4f')]=_0x53e6('0x8b');this[_0x53e6('0x8')][_0x3f942b[_0x53e6('0x88')]][_0x552e21]['talktime']=_0x56c446['diff'](this[_0x53e6('0x8')][_0x3f942b['transfereeuniqueid']][_0x552e21][_0x53e6('0x3c')],_0x53e6('0x91'));}}}}}}catch(_0x4f2d8d){logger[_0x53e6('0x38')](_0x53e6('0x92'),_0x3f942b[_0x53e6('0x21')],util[_0x53e6('0x25')](_0x4f2d8d,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x53e6('0x1d')]['syncMusicOnHoldStart']=function(_0x2bf03e){var _0x31e9c8='';try{if(this[_0x53e6('0x59')](_0x2bf03e)){logger[_0x53e6('0x24')](_0x53e6('0x93'),_0x2bf03e[_0x53e6('0x21')],util[_0x53e6('0x25')](_0x2bf03e,{'showHidden':![],'depth':null}));if(_0x2bf03e[_0x53e6('0x94')]){_0x31e9c8=_0x2bf03e['channel']['substring'](0x0,_0x2bf03e[_0x53e6('0x94')][_0x53e6('0x95')]('-'));if(this[_0x53e6('0xa')][_0x31e9c8]){logger['info'](_0x53e6('0x96'),_0x2bf03e['uniqueid'],_0x31e9c8);this[_0x53e6('0xa')][_0x31e9c8][_0x53e6('0x97')]=!![];}}}}catch(_0x2640e){logger[_0x53e6('0x38')](_0x53e6('0x98'),_0x2bf03e['uniqueid'],util[_0x53e6('0x25')](_0x2640e,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x53e6('0x1d')][_0x53e6('0x19')]=function(_0x52b530){var _0x4041b3='';try{if(this[_0x53e6('0x59')](_0x52b530)){logger['debug']('[%s][voiceAgentReport][musiconholdstop]\x20event:',_0x52b530['uniqueid'],util['inspect'](_0x52b530,{'showHidden':![],'depth':null}));if(_0x52b530[_0x53e6('0x94')]){_0x4041b3=_0x52b530[_0x53e6('0x94')]['substring'](0x0,_0x52b530['channel'][_0x53e6('0x95')]('-'));if(this[_0x53e6('0xa')][_0x4041b3]){logger['info'](_0x53e6('0x99'),_0x52b530['uniqueid'],_0x4041b3);this[_0x53e6('0xa')][_0x4041b3]['onhold']=![];}}}}catch(_0x30990e){logger[_0x53e6('0x38')](_0x53e6('0x9a'),_0x52b530[_0x53e6('0x21')],util['inspect'](_0x30990e,{'showHidden':![],'depth':null}));}};module[_0x53e6('0x9b')]=VoiceAgentReport;
\ No newline at end of file
index a12b899..457139b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaa88=['seconds','includes','lastapplication','set','cdr(','match','type','[%s][voiceCallReport][newexten]','[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s','calleridname','calleridnum','[%s][voiceCallReport][newstate]\x20event:','answered','answertime','holdtime','diff','destinationchannel','UserId','membername','routealias','[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:','[%s][voiceCallReport][newstate]','syncMixMonitorFilename','[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s','monitor','.wav49','replace','.WAV','monitorFilename','find','monitors','isNil','push','rec','[%s][voiceCallReport][mixMonitorFilename]','syncVarSet','[%s][voiceCallReport][varset]\x20event:','variable','mixmonitor_filename','[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s','xmd-phone','[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s','value','xmd-callerid','[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s','callerid','[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s','xmd-originatecalleridnum','originatecalleridnum','[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s','destination','xmd-callerid-preview','xmcs-queue','[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s','sipcallid','[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','sipcalluniqueid','parse','sipcalllinkedid','[%s][voiceCallReport][varset]','syncHangup','cause-txt','endtime','billableseconds','omit','[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:','user:agentcomplete','length','transferType','resolve','undefined','isEmpty','then','stopRecordingOnTransfer','Action','StopMixMonitor','catch','finally','event','BlindTransfer','outbound','[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:','custom:voiceCallReport','[%s][voiceCallReport][hangup]','[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','origtransferercalleridnum','transfertargetcalleridnum','[%s][voiceCallReport][attendedtransfer]\x20event:','transfereeuniqueid','transfercalleridnum','transferconnectedlinenum','secondtransfereruniqueid','ATTENDED','transfertargetuniqueid','origtransfereruniqueid','origtransfererlinkedid','routeid','[%s][voiceCallReport][attendedtransfer]','transfereecalleridnum','extension','[%s][voiceCallReport][blindtransfer]\x20event:','BLIND','transfererchannel','transfereruniqueid','mohstarttime','[%s][voiceCallReport][musiconholdstart]','[%s][voiceCallReport][musiconholdstop]\x20event:','milliseconds','[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s','mohtime','[%s][voiceCallReport][musiconholdstop]','exports','lodash','moment','util','path','../../../config/environment','../../../config/logger','ami','../ami','../model/channel','../rpc/setting','agi','playback','voicemail','NO\x20ANSWER','FAILED','BUSY','defaults','redis','socket.io-emitter','channels','agents','coreshowchannel','newexten','syncNewExten','bind','newchannel','syncNewChannel','newstate','syncNewState','syncNewCallerId','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','musiconholdstart','syncMusicOnHoldStart','syncMusicOnHoldStop','info','actionCoreShowChannels','error','[voiceCallReport][coreshowchannels]','inspect','isNotNull','isUndefined','emit','prototype','[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s','uniqueid','debug','linkedid','merge','pick','keys','context','from-sip','channel','split','exten','xcally-motion-preview','format','user:%s','accountcode','connectedlinenum','[%s][voiceCallReport][newcallerid]','[%s][voiceCallReport][newchannel]\x20event:','blindTransfers','[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s','starttime','YYYY-MM-DD\x20HH:mm:ss','disposition','toNumber','channelstate','destconnectedlinenum','[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:','name','user:agentconnect','[%s][voiceCallReport][newchannel]','[%s][voiceCallReport][newexten]\x20event:','OutgoingSpoolFailed','application','toLowerCase','applicationdata','CDR(routeAlias)','queue','[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s','duration','subtract'];(function(_0x187193,_0x24e49d){var _0x5002aa=function(_0x2ede6b){while(--_0x2ede6b){_0x187193['push'](_0x187193['shift']());}};_0x5002aa(++_0x24e49d);}(_0xaa88,0x137));var _0x8aa8=function(_0x3f2228,_0x3b27d5){_0x3f2228=_0x3f2228-0x0;var _0x285ae4=_0xaa88[_0x3f2228];return _0x285ae4;};'use strict';var _=require(_0x8aa8('0x0'));var moment=require(_0x8aa8('0x1'));var util=require(_0x8aa8('0x2'));var path=require(_0x8aa8('0x3'));var Redis=require('ioredis');var config=require(_0x8aa8('0x4'));var logger=require(_0x8aa8('0x5'))(_0x8aa8('0x6'));var ami=require(_0x8aa8('0x7'));var Channel=require(_0x8aa8('0x8'));var RpcSetting=require(_0x8aa8('0x9'));var applications=['set','queue',_0x8aa8('0xa'),'dial',_0x8aa8('0xb'),_0x8aa8('0xc')];var dispositions=[_0x8aa8('0xd'),_0x8aa8('0xe'),'FAILED',_0x8aa8('0xd'),_0x8aa8('0xd'),_0x8aa8('0xd'),'ANSWERED',_0x8aa8('0xf'),_0x8aa8('0xe'),_0x8aa8('0xe'),_0x8aa8('0xe')];config['redis']=_[_0x8aa8('0x10')](config[_0x8aa8('0x11')],{'host':'localhost','port':0x18eb});var io=require(_0x8aa8('0x12'))(new Redis(config[_0x8aa8('0x11')]));function VoiceCallReport(_0x28132f){this['channels']=_0x28132f[_0x8aa8('0x13')];this[_0x8aa8('0x14')]=_0x28132f[_0x8aa8('0x14')];this['blindTransfers']={};ami['on'](_0x8aa8('0x15'),this['syncNewExten']['bind'](this));ami['on'](_0x8aa8('0x16'),this[_0x8aa8('0x17')][_0x8aa8('0x18')](this));ami['on'](_0x8aa8('0x19'),this[_0x8aa8('0x1a')][_0x8aa8('0x18')](this));ami['on'](_0x8aa8('0x1b'),this[_0x8aa8('0x1c')][_0x8aa8('0x18')](this));ami['on']('varset',this['syncVarSet'][_0x8aa8('0x18')](this));ami['on']('hangup',this['syncHangup'][_0x8aa8('0x18')](this));ami['on']('newcallerid',this[_0x8aa8('0x1d')][_0x8aa8('0x18')](this));ami['on'](_0x8aa8('0x1e'),this[_0x8aa8('0x1f')]['bind'](this));ami['on'](_0x8aa8('0x20'),this[_0x8aa8('0x21')][_0x8aa8('0x18')](this));ami['on'](_0x8aa8('0x22'),this[_0x8aa8('0x23')][_0x8aa8('0x18')](this));ami['on']('musiconholdstop',this[_0x8aa8('0x24')]['bind'](this));try{logger[_0x8aa8('0x25')]('[voiceCallReport][coreshowchannels]\x20started');ami[_0x8aa8('0x26')]();}catch(_0x557e4e){logger[_0x8aa8('0x27')](_0x8aa8('0x28'),util[_0x8aa8('0x29')](_0x557e4e,{'showHidden':![],'depth':null}));}}VoiceCallReport['prototype'][_0x8aa8('0x2a')]=function(_0xe978ab){return _0xe978ab!==null&&!_[_0x8aa8('0x2b')](_0xe978ab);};VoiceCallReport['prototype']['emit']=function(_0x2d1508,_0x44e2d8,_0x2f91f3){io['to'](_0x2d1508)[_0x8aa8('0x2c')](_0x44e2d8,_0x2f91f3);};VoiceCallReport[_0x8aa8('0x2d')]['syncNewCallerId']=function(_0x2bc34a){try{if(this['isNotNull'](_0x2bc34a)){logger[_0x8aa8('0x25')](_0x8aa8('0x2e'),_0x2bc34a[_0x8aa8('0x2f')],_0x2bc34a['calleridname'],_0x2bc34a['calleridnum']);logger[_0x8aa8('0x30')]('[%s][voiceCallReport][newcallerid]\x20event:',_0x2bc34a[_0x8aa8('0x2f')],util[_0x8aa8('0x29')](_0x2bc34a,{'showHidden':![],'depth':null}));if(_0x2bc34a[_0x8aa8('0x2f')]===_0x2bc34a[_0x8aa8('0x31')]){if(!_[_0x8aa8('0x2b')](this['channels'][_0x2bc34a[_0x8aa8('0x2f')]])){_[_0x8aa8('0x32')](this['channels'][_0x2bc34a[_0x8aa8('0x2f')]],_[_0x8aa8('0x33')](_0x2bc34a,_[_0x8aa8('0x34')](this['channels'][_0x2bc34a[_0x8aa8('0x2f')]])));}}if(_0x2bc34a[_0x8aa8('0x35')]===_0x8aa8('0x36')){if(this[_0x8aa8('0x14')][_0x2bc34a[_0x8aa8('0x37')][_0x8aa8('0x38')]('-')[0x0]]){if(_0x2bc34a[_0x8aa8('0x39')]==_0x8aa8('0x3a')){this[_0x8aa8('0x14')][_0x2bc34a[_0x8aa8('0x37')][_0x8aa8('0x38')]('-')[0x0]]['destconnectedlinenum']=_0x2bc34a['connectedlinenum'];this[_0x8aa8('0x2c')](util[_0x8aa8('0x3b')](_0x8aa8('0x3c'),this[_0x8aa8('0x14')][_0x2bc34a[_0x8aa8('0x37')][_0x8aa8('0x38')]('-')[0x0]]['name']),'user:agentconnect',{'destaccountcode':this[_0x8aa8('0x14')][_0x2bc34a['channel'][_0x8aa8('0x38')]('-')[0x0]][_0x8aa8('0x3d')],'destconnectedlinenum':_0x2bc34a[_0x8aa8('0x3e')]});}}}}}catch(_0x59041c){logger[_0x8aa8('0x27')](_0x8aa8('0x3f'),_0x2bc34a[_0x8aa8('0x2f')],util['inspect'](_0x59041c,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x8aa8('0x1a')]=function(_0x1f90fc){try{if(this['isNotNull'](_0x1f90fc)){logger[_0x8aa8('0x30')](_0x8aa8('0x40'),_0x1f90fc['uniqueid'],util[_0x8aa8('0x29')](_0x1f90fc,{'showHidden':![],'depth':null}));if(this['channels'][_0x1f90fc['uniqueid']])return;if(_0x1f90fc[_0x8aa8('0x37')]==='OutgoingSpoolFailed')return;if(_0x1f90fc[_0x8aa8('0x2f')]!==_0x1f90fc[_0x8aa8('0x31')]&&!this[_0x8aa8('0x41')][_0x1f90fc[_0x8aa8('0x31')]])return;logger['info'](_0x8aa8('0x42'),_0x1f90fc[_0x8aa8('0x2f')],_0x1f90fc['context'],_0x1f90fc[_0x8aa8('0x39')]);this[_0x8aa8('0x13')][_0x1f90fc['uniqueid']]=new Channel();this[_0x8aa8('0x13')][_0x1f90fc[_0x8aa8('0x2f')]][_0x8aa8('0x43')]=moment()[_0x8aa8('0x3b')](_0x8aa8('0x44'));this[_0x8aa8('0x13')][_0x1f90fc[_0x8aa8('0x2f')]][_0x8aa8('0x45')]=dispositions[_[_0x8aa8('0x46')](_0x1f90fc[_0x8aa8('0x47')])];_[_0x8aa8('0x32')](this[_0x8aa8('0x13')][_0x1f90fc[_0x8aa8('0x2f')]],_[_0x8aa8('0x33')](_0x1f90fc,_[_0x8aa8('0x34')](this[_0x8aa8('0x13')][_0x1f90fc['uniqueid']])));if(_0x1f90fc[_0x8aa8('0x35')]==='from-sip'){if(this['agents'][_0x1f90fc['channel'][_0x8aa8('0x38')]('-')[0x0]]){if(_['isUndefined'](this['agents'][_0x1f90fc[_0x8aa8('0x37')]['split']('-')[0x0]][_0x8aa8('0x48')])){this['agents'][_0x1f90fc['channel'][_0x8aa8('0x38')]('-')[0x0]][_0x8aa8('0x48')]=_0x1f90fc[_0x8aa8('0x39')];logger[_0x8aa8('0x30')](_0x8aa8('0x49'),_0x1f90fc[_0x8aa8('0x2f')],util[_0x8aa8('0x29')]({'id':this['agents'][_0x1f90fc[_0x8aa8('0x37')]['split']('-')[0x0]]['id'],'destaccountcode':this[_0x8aa8('0x14')][_0x1f90fc[_0x8aa8('0x37')][_0x8aa8('0x38')]('-')[0x0]][_0x8aa8('0x3d')],'destconnectedlinenum':_0x1f90fc[_0x8aa8('0x39')]},{'showHidden':![],'depth':null}));this[_0x8aa8('0x2c')](util['format']('user:%s',this[_0x8aa8('0x14')][_0x1f90fc[_0x8aa8('0x37')]['split']('-')[0x0]][_0x8aa8('0x4a')]),_0x8aa8('0x4b'),{'id':this[_0x8aa8('0x14')][_0x1f90fc['channel']['split']('-')[0x0]]['id'],'destaccountcode':this['agents'][_0x1f90fc['channel'][_0x8aa8('0x38')]('-')[0x0]][_0x8aa8('0x3d')],'destconnectedlinenum':_0x1f90fc['exten']});}}}}}catch(_0x3db0d3){logger[_0x8aa8('0x27')](_0x8aa8('0x4c'),_0x1f90fc[_0x8aa8('0x2f')],util[_0x8aa8('0x29')](_0x3db0d3,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x8aa8('0x2d')]['syncNewExten']=function(_0x4da826){try{if(this[_0x8aa8('0x2a')](_0x4da826)){logger['debug'](_0x8aa8('0x4d'),_0x4da826['uniqueid'],util[_0x8aa8('0x29')](_0x4da826,{'showHidden':![],'depth':null}));if(_0x4da826[_0x8aa8('0x37')]===_0x8aa8('0x4e')||_0x4da826[_0x8aa8('0x39')]==='h')return;if(_0x4da826[_0x8aa8('0x2f')]===_0x4da826[_0x8aa8('0x31')]||this[_0x8aa8('0x41')][_0x4da826[_0x8aa8('0x31')]]){_0x4da826[_0x8aa8('0x4f')]=_0x4da826[_0x8aa8('0x4f')][_0x8aa8('0x50')]();_0x4da826[_0x8aa8('0x51')]=_0x4da826['appdata']||_0x4da826[_0x8aa8('0x51')];if(_0x4da826['appdata']&&!_0x4da826['appdata']['startsWith'](_0x8aa8('0x52'))&&_0x4da826['application']!==_0x8aa8('0x53')){_0x4da826[_0x8aa8('0x51')]=_0x4da826[_0x8aa8('0x51')]['toLowerCase']();}logger[_0x8aa8('0x25')](_0x8aa8('0x54'),_0x4da826[_0x8aa8('0x2f')],_0x4da826[_0x8aa8('0x4f')],_0x4da826['applicationdata']);if(_['isUndefined'](this[_0x8aa8('0x13')][_0x4da826[_0x8aa8('0x2f')]])){this[_0x8aa8('0x13')][_0x4da826[_0x8aa8('0x2f')]]=new Channel();this['channels'][_0x4da826['uniqueid']][_0x8aa8('0x43')]=_0x4da826[_0x8aa8('0x55')]?moment()[_0x8aa8('0x56')](moment['duration'](_0x4da826[_0x8aa8('0x55')])[_0x8aa8('0x57')](),'seconds')['format']('YYYY-MM-DD\x20HH:mm:ss'):moment()['format'](_0x8aa8('0x44'));this['channels'][_0x4da826[_0x8aa8('0x2f')]][_0x8aa8('0x45')]='NO\x20ANSWER';}_['merge'](this[_0x8aa8('0x13')][_0x4da826[_0x8aa8('0x2f')]],_['pick'](_0x4da826,_['keys'](this['channels'][_0x4da826[_0x8aa8('0x2f')]])));if(_[_0x8aa8('0x58')](applications,_0x4da826['application'])){this['channels'][_0x4da826[_0x8aa8('0x2f')]][_0x8aa8('0x59')]=_0x4da826['application'];this[_0x8aa8('0x13')][_0x4da826[_0x8aa8('0x2f')]]['lastdata']=_0x4da826[_0x8aa8('0x51')];if(_0x4da826['application']===_0x8aa8('0x5a')&&_['startsWith'](_0x4da826[_0x8aa8('0x51')][_0x8aa8('0x50')](),_0x8aa8('0x5b'))){var _0x417a34=_0x4da826[_0x8aa8('0x51')]['split']('=');var _0x379c66=_0x417a34[0x0][_0x8aa8('0x50')]()[_0x8aa8('0x5c')](/cdr\((.*)\)/);if(_0x379c66){if(_0x379c66[0x1]===_0x8aa8('0x5d')&&!_['isNil'](this[_0x8aa8('0x13')][_0x4da826[_0x8aa8('0x2f')]][_0x379c66[0x1]]))return;this['channels'][_0x4da826[_0x8aa8('0x2f')]][_0x379c66[0x1]]=_0x417a34[0x1];}}else if(_0x4da826[_0x8aa8('0x4f')]===_0x8aa8('0x53')){this[_0x8aa8('0x13')][_0x4da826[_0x8aa8('0x2f')]][_0x8aa8('0x53')]=_0x4da826[_0x8aa8('0x51')]['split'](',')[0x0];}}}}}catch(_0x54f38b){logger['error'](_0x8aa8('0x5e'),_0x4da826[_0x8aa8('0x2f')],util[_0x8aa8('0x29')](_0x54f38b,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x8aa8('0x2d')][_0x8aa8('0x1c')]=function(_0x28f792){try{if(this[_0x8aa8('0x2a')](_0x28f792)){logger[_0x8aa8('0x25')](_0x8aa8('0x5f'),_0x28f792[_0x8aa8('0x2f')],_0x28f792[_0x8aa8('0x31')],_0x28f792[_0x8aa8('0x60')],_0x28f792[_0x8aa8('0x61')]);logger[_0x8aa8('0x30')](_0x8aa8('0x62'),_0x28f792[_0x8aa8('0x2f')],util[_0x8aa8('0x29')](_0x28f792,{'showHidden':![],'depth':null}));if(_0x28f792[_0x8aa8('0x47')]!=='6')return;if(_0x28f792[_0x8aa8('0x2f')]!==_0x28f792['linkedid']){var _0x3b0e4d=moment();if(this[_0x8aa8('0x13')][_0x28f792[_0x8aa8('0x31')]]){if(!this[_0x8aa8('0x13')][_0x28f792[_0x8aa8('0x31')]][_0x8aa8('0x63')]){this[_0x8aa8('0x13')][_0x28f792[_0x8aa8('0x31')]][_0x8aa8('0x63')]=!![];this['channels'][_0x28f792[_0x8aa8('0x31')]][_0x8aa8('0x64')]=_0x3b0e4d['format'](_0x8aa8('0x44'));if(this['channels'][_0x28f792[_0x8aa8('0x31')]][_0x8aa8('0x43')]){this['channels'][_0x28f792[_0x8aa8('0x31')]][_0x8aa8('0x65')]=_0x3b0e4d[_0x8aa8('0x66')](this[_0x8aa8('0x13')][_0x28f792[_0x8aa8('0x31')]][_0x8aa8('0x43')],_0x8aa8('0x57'));}}this['channels'][_0x28f792[_0x8aa8('0x31')]][_0x8aa8('0x31')]=_0x28f792[_0x8aa8('0x2f')];if(_0x28f792[_0x8aa8('0x61')]!=='xcally-motion-preview'){this['channels'][_0x28f792[_0x8aa8('0x31')]][_0x8aa8('0x3e')]=_0x28f792[_0x8aa8('0x61')];}this[_0x8aa8('0x13')][_0x28f792['linkedid']]['connectedlinename']=_0x28f792['calleridname'];this[_0x8aa8('0x13')][_0x28f792[_0x8aa8('0x31')]][_0x8aa8('0x67')]=_0x28f792[_0x8aa8('0x37')];this[_0x8aa8('0x13')][_0x28f792[_0x8aa8('0x31')]][_0x8aa8('0x45')]=dispositions[_[_0x8aa8('0x46')](_0x28f792[_0x8aa8('0x47')])];if(this['agents'][_0x28f792[_0x8aa8('0x37')]['split']('-')[0x0]]){this['channels'][_0x28f792[_0x8aa8('0x31')]][_0x8aa8('0x68')]=this[_0x8aa8('0x14')][_0x28f792['channel'][_0x8aa8('0x38')]('-')[0x0]]['id'];this['channels'][_0x28f792[_0x8aa8('0x31')]][_0x8aa8('0x69')]=this[_0x8aa8('0x14')][_0x28f792[_0x8aa8('0x37')][_0x8aa8('0x38')]('-')[0x0]]['name'];}}if(this['channels'][_0x28f792[_0x8aa8('0x2f')]]){if(!this[_0x8aa8('0x13')][_0x28f792[_0x8aa8('0x2f')]][_0x8aa8('0x63')]){this[_0x8aa8('0x13')][_0x28f792[_0x8aa8('0x2f')]][_0x8aa8('0x63')]=!![];this[_0x8aa8('0x13')][_0x28f792['uniqueid']][_0x8aa8('0x64')]=_0x3b0e4d[_0x8aa8('0x3b')]('YYYY-MM-DD\x20HH:mm:ss');if(this['channels'][_0x28f792[_0x8aa8('0x2f')]][_0x8aa8('0x43')]){this['channels'][_0x28f792[_0x8aa8('0x2f')]][_0x8aa8('0x65')]=_0x3b0e4d[_0x8aa8('0x66')](this['channels'][_0x28f792['uniqueid']]['starttime'],_0x8aa8('0x57'));}}if(_0x28f792[_0x8aa8('0x61')]!==_0x8aa8('0x3a')){this[_0x8aa8('0x13')][_0x28f792['uniqueid']][_0x8aa8('0x3e')]=_0x28f792[_0x8aa8('0x61')];}this[_0x8aa8('0x13')][_0x28f792[_0x8aa8('0x2f')]]['connectedlinename']=_0x28f792[_0x8aa8('0x60')];this['channels'][_0x28f792['uniqueid']][_0x8aa8('0x67')]=_0x28f792['channel'];this[_0x8aa8('0x13')][_0x28f792[_0x8aa8('0x2f')]][_0x8aa8('0x45')]=dispositions[_['toNumber'](_0x28f792[_0x8aa8('0x47')])];}}else{if(this[_0x8aa8('0x13')][_0x28f792[_0x8aa8('0x2f')]]){if(this[_0x8aa8('0x14')][_0x28f792[_0x8aa8('0x37')][_0x8aa8('0x38')]('-')[0x0]]){this['channels'][_0x28f792['uniqueid']][_0x8aa8('0x68')]=this['agents'][_0x28f792['channel']['split']('-')[0x0]]['id'];this['channels'][_0x28f792['uniqueid']][_0x8aa8('0x69')]=this[_0x8aa8('0x14')][_0x28f792[_0x8aa8('0x37')][_0x8aa8('0x38')]('-')[0x0]][_0x8aa8('0x4a')];}}}if(_0x28f792[_0x8aa8('0x35')]===_0x8aa8('0x36')){if(this[_0x8aa8('0x14')][_0x28f792[_0x8aa8('0x37')][_0x8aa8('0x38')]('-')[0x0]]){this['agents'][_0x28f792['channel'][_0x8aa8('0x38')]('-')[0x0]][_0x8aa8('0x48')]=_0x28f792[_0x8aa8('0x39')];var _0x4a6624,_0x26599f;if(this[_0x8aa8('0x13')][_0x28f792[_0x8aa8('0x2f')]]){_0x4a6624=this[_0x8aa8('0x13')][_0x28f792['uniqueid']][_0x8aa8('0x6a')];_0x26599f=this[_0x8aa8('0x13')][_0x28f792[_0x8aa8('0x2f')]]['queue'];}else if(this[_0x8aa8('0x13')][_0x28f792[_0x8aa8('0x31')]]){_0x4a6624=this['channels'][_0x28f792[_0x8aa8('0x31')]][_0x8aa8('0x6a')];_0x26599f=this[_0x8aa8('0x13')][_0x28f792[_0x8aa8('0x31')]][_0x8aa8('0x53')];}logger['debug'](_0x8aa8('0x6b'),_0x28f792[_0x8aa8('0x2f')],util[_0x8aa8('0x29')]({'id':this['agents'][_0x28f792[_0x8aa8('0x37')][_0x8aa8('0x38')]('-')[0x0]]['id'],'destaccountcode':this[_0x8aa8('0x14')][_0x28f792[_0x8aa8('0x37')][_0x8aa8('0x38')]('-')[0x0]][_0x8aa8('0x3d')],'destconnectedlinenum':_0x28f792['exten'],'routealias':_0x4a6624,'queue':_0x26599f||undefined},{'showHidden':![],'depth':null}));this[_0x8aa8('0x2c')](util['format'](_0x8aa8('0x3c'),this[_0x8aa8('0x14')][_0x28f792[_0x8aa8('0x37')][_0x8aa8('0x38')]('-')[0x0]][_0x8aa8('0x4a')]),'user:agentconnect',{'id':this[_0x8aa8('0x14')][_0x28f792[_0x8aa8('0x37')][_0x8aa8('0x38')]('-')[0x0]]['id'],'agentconnected':!![],'destaccountcode':this[_0x8aa8('0x14')][_0x28f792[_0x8aa8('0x37')][_0x8aa8('0x38')]('-')[0x0]][_0x8aa8('0x3d')],'destconnectedlinenum':_0x28f792['exten'],'routealias':_0x4a6624,'queue':_0x26599f||undefined});}}}}catch(_0x51e859){logger[_0x8aa8('0x27')](_0x8aa8('0x6c'),_0x28f792[_0x8aa8('0x2f')],util[_0x8aa8('0x29')](_0x51e859,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x8aa8('0x2d')][_0x8aa8('0x6d')]=function(_0x351d4e,_0x3b151f){try{if(this['channels'][_0x351d4e]){logger[_0x8aa8('0x25')](_0x8aa8('0x6e'),_0x351d4e,_0x3b151f);this['channels'][_0x351d4e][_0x8aa8('0x6f')]=!![];if(_['endsWith'](_0x3b151f,_0x8aa8('0x70'))){_0x3b151f=_0x3b151f[_0x8aa8('0x71')](_0x8aa8('0x70'),_0x8aa8('0x72'));}this[_0x8aa8('0x13')][_0x351d4e][_0x8aa8('0x73')]=_0x3b151f;var _0x593021=_[_0x8aa8('0x74')](this[_0x8aa8('0x13')][_0x351d4e][_0x8aa8('0x75')],{'filename':_0x3b151f});if(_[_0x8aa8('0x76')](_0x593021)){this[_0x8aa8('0x13')][_0x351d4e]['monitors'][_0x8aa8('0x77')]({'filename':_0x3b151f,'createdAt':moment()[_0x8aa8('0x3b')](_0x8aa8('0x44')),'mixmonitorid':'','status':_0x8aa8('0x78')});}}}catch(_0xba50e0){logger[_0x8aa8('0x27')](_0x8aa8('0x79'),_0x351d4e,util[_0x8aa8('0x29')](_0xba50e0,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x8aa8('0x2d')][_0x8aa8('0x7a')]=function(_0x55f52d){try{if(this['isNotNull'](_0x55f52d)){logger[_0x8aa8('0x30')](_0x8aa8('0x7b'),_0x55f52d[_0x8aa8('0x2f')],util[_0x8aa8('0x29')](_0x55f52d,{'showHidden':![],'depth':null}));if(this[_0x8aa8('0x13')][_0x55f52d[_0x8aa8('0x2f')]]&&_0x55f52d['channel']!=_0x8aa8('0x4e')){if(this['isNotNull'](_0x55f52d[_0x8aa8('0x7c')])){if(this[_0x8aa8('0x2a')](_0x55f52d[_0x8aa8('0x7c')][_0x8aa8('0x7d')])){logger['info'](_0x8aa8('0x7e'),_0x55f52d[_0x8aa8('0x2f')],_0x55f52d['value']);this['syncMixMonitorFilename'](_0x55f52d[_0x8aa8('0x2f')],_0x55f52d['value']);}else if(this['isNotNull'](_0x55f52d[_0x8aa8('0x7c')][_0x8aa8('0x7f')])){logger['info'](_0x8aa8('0x80'),_0x55f52d[_0x8aa8('0x2f')],_0x55f52d[_0x8aa8('0x81')]);this[_0x8aa8('0x13')][_0x55f52d['uniqueid']][_0x8aa8('0x61')]=_0x55f52d[_0x8aa8('0x81')];}else if(this[_0x8aa8('0x2a')](_0x55f52d[_0x8aa8('0x7c')][_0x8aa8('0x82')])){logger[_0x8aa8('0x25')](_0x8aa8('0x83'),_0x55f52d[_0x8aa8('0x2f')],_0x55f52d[_0x8aa8('0x81')]);this[_0x8aa8('0x13')][_0x55f52d['uniqueid']][_0x8aa8('0x84')]=_0x55f52d[_0x8aa8('0x81')];}else if(this[_0x8aa8('0x2a')](_0x55f52d[_0x8aa8('0x7c')]['xmd-cdrtype'])){logger[_0x8aa8('0x25')](_0x8aa8('0x85'),_0x55f52d[_0x8aa8('0x2f')],_0x55f52d[_0x8aa8('0x81')]);this['channels'][_0x55f52d[_0x8aa8('0x2f')]][_0x8aa8('0x5d')]=_0x55f52d['value'];}else if(this['isNotNull'](_0x55f52d[_0x8aa8('0x7c')]['xmd-queue'])){logger[_0x8aa8('0x25')]('[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s',_0x55f52d['uniqueid'],_0x55f52d[_0x8aa8('0x81')][_0x8aa8('0x38')](',')[0x0]);this[_0x8aa8('0x13')][_0x55f52d[_0x8aa8('0x2f')]]['queue']=_0x55f52d[_0x8aa8('0x81')][_0x8aa8('0x38')](',')[0x0];}else if(this[_0x8aa8('0x2a')](_0x55f52d[_0x8aa8('0x7c')][_0x8aa8('0x86')])){logger[_0x8aa8('0x25')]('[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s',_0x55f52d['uniqueid'],_0x55f52d[_0x8aa8('0x81')]);this[_0x8aa8('0x13')][_0x55f52d[_0x8aa8('0x2f')]][_0x8aa8('0x87')]=_0x55f52d[_0x8aa8('0x81')];}else if(this['isNotNull'](_0x55f52d['variable']['xmd-destination'])){logger['info'](_0x8aa8('0x88'),_0x55f52d[_0x8aa8('0x2f')],_0x55f52d['value']);this[_0x8aa8('0x13')][_0x55f52d[_0x8aa8('0x2f')]][_0x8aa8('0x89')]=_0x55f52d['value'];}else if(this['isNotNull'](_0x55f52d[_0x8aa8('0x7c')][_0x8aa8('0x8a')])){logger[_0x8aa8('0x25')]('[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s',_0x55f52d[_0x8aa8('0x2f')],_0x55f52d['value']);this[_0x8aa8('0x13')][_0x55f52d[_0x8aa8('0x2f')]]['calleridpreview']=_0x55f52d[_0x8aa8('0x81')];}else if(this[_0x8aa8('0x2a')](_0x55f52d[_0x8aa8('0x7c')][_0x8aa8('0x8b')])){logger['info'](_0x8aa8('0x8c'),_0x55f52d['uniqueid'],_0x55f52d[_0x8aa8('0x81')]);this[_0x8aa8('0x13')][_0x55f52d[_0x8aa8('0x2f')]]['queue']=_0x55f52d['value'];}else if(this[_0x8aa8('0x2a')](_0x55f52d[_0x8aa8('0x7c')][_0x8aa8('0x8d')])){logger[_0x8aa8('0x25')](_0x8aa8('0x8e'),_0x55f52d['uniqueid'],_0x55f52d[_0x8aa8('0x81')]);this[_0x8aa8('0x13')][_0x55f52d[_0x8aa8('0x2f')]][_0x8aa8('0x8f')]=_0x55f52d[_0x8aa8('0x81')];}}}else if(this[_0x8aa8('0x2a')](_0x55f52d[_0x8aa8('0x7c')][_0x8aa8('0x7d')])){if(_0x55f52d[_0x8aa8('0x81')]){var _0x24741a=path[_0x8aa8('0x90')](_0x55f52d['value'])[_0x8aa8('0x4a')];logger['info'](_0x8aa8('0x7e'),_0x24741a,_0x55f52d[_0x8aa8('0x81')]);this[_0x8aa8('0x6d')](_0x24741a,_0x55f52d[_0x8aa8('0x81')]);}}else if(this[_0x8aa8('0x13')][_0x55f52d[_0x8aa8('0x31')]]){if(this['isNotNull'](_0x55f52d['variable'])){if(this['isNotNull'](_0x55f52d[_0x8aa8('0x7c')][_0x8aa8('0x8d')])){logger[_0x8aa8('0x25')](_0x8aa8('0x8e'),_0x55f52d['linkedid'],_0x55f52d[_0x8aa8('0x81')]);this[_0x8aa8('0x13')][_0x55f52d[_0x8aa8('0x31')]][_0x8aa8('0x91')]=_0x55f52d[_0x8aa8('0x81')];}}}}}catch(_0x5e35e3){logger[_0x8aa8('0x27')](_0x8aa8('0x92'),_0x55f52d[_0x8aa8('0x2f')],util[_0x8aa8('0x29')](_0x5e35e3,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x8aa8('0x2d')][_0x8aa8('0x93')]=function(_0x549aac){try{if(this[_0x8aa8('0x2a')](_0x549aac)){logger[_0x8aa8('0x30')]('[%s][voiceCallReport][hangup]\x20event:',_0x549aac['uniqueid'],util[_0x8aa8('0x29')](_0x549aac,{'showHidden':![],'depth':null}));if(this['blindTransfers'][_0x549aac['linkedid']]){if(this['channels'][this[_0x8aa8('0x41')][_0x549aac['linkedid']]['linkedid']]){this[_0x8aa8('0x13')][this[_0x8aa8('0x41')][_0x549aac[_0x8aa8('0x31')]][_0x8aa8('0x31')]][_0x8aa8('0x2f')]=_0x549aac[_0x8aa8('0x2f')];this[_0x8aa8('0x13')][this[_0x8aa8('0x41')][_0x549aac['linkedid']][_0x8aa8('0x31')]][_0x8aa8('0x63')]=this[_0x8aa8('0x13')][_0x549aac['uniqueid']][_0x8aa8('0x63')];this[_0x8aa8('0x13')][this[_0x8aa8('0x41')][_0x549aac['linkedid']][_0x8aa8('0x31')]][_0x8aa8('0x64')]=this[_0x8aa8('0x13')][_0x549aac[_0x8aa8('0x2f')]][_0x8aa8('0x64')];this['channels'][this['blindTransfers'][_0x549aac[_0x8aa8('0x31')]][_0x8aa8('0x31')]]['destinationchannel']=this[_0x8aa8('0x13')][this[_0x8aa8('0x41')][_0x549aac[_0x8aa8('0x31')]][_0x8aa8('0x31')]][_0x8aa8('0x37')];this[_0x8aa8('0x13')][this['blindTransfers'][_0x549aac[_0x8aa8('0x31')]][_0x8aa8('0x31')]]['disposition']=this[_0x8aa8('0x13')][_0x549aac['uniqueid']][_0x8aa8('0x45')];this[_0x8aa8('0x13')][_0x549aac[_0x8aa8('0x2f')]]=this['channels'][this['blindTransfers'][_0x549aac['linkedid']]['linkedid']];delete this[_0x8aa8('0x13')][this[_0x8aa8('0x41')][_0x549aac['linkedid']][_0x8aa8('0x31')]];}else if(this['channels'][this[_0x8aa8('0x41')][_0x549aac[_0x8aa8('0x31')]][_0x8aa8('0x2f')]]){this[_0x8aa8('0x13')][this['blindTransfers'][_0x549aac[_0x8aa8('0x31')]]['uniqueid']][_0x8aa8('0x2f')]=[this['channels'][this[_0x8aa8('0x41')][_0x549aac['linkedid']][_0x8aa8('0x2f')]][_0x8aa8('0x31')],this['channels'][this['blindTransfers'][_0x549aac['linkedid']][_0x8aa8('0x2f')]][_0x8aa8('0x31')]=this[_0x8aa8('0x13')][this[_0x8aa8('0x41')][_0x549aac[_0x8aa8('0x31')]][_0x8aa8('0x2f')]][_0x8aa8('0x2f')]][0x0];this['channels'][this[_0x8aa8('0x41')][_0x549aac[_0x8aa8('0x31')]][_0x8aa8('0x2f')]][_0x8aa8('0x63')]=this[_0x8aa8('0x13')][_0x549aac[_0x8aa8('0x2f')]][_0x8aa8('0x63')];this[_0x8aa8('0x13')][this[_0x8aa8('0x41')][_0x549aac[_0x8aa8('0x31')]][_0x8aa8('0x2f')]][_0x8aa8('0x64')]=this[_0x8aa8('0x13')][_0x549aac[_0x8aa8('0x2f')]]['answertime'];this[_0x8aa8('0x13')][this[_0x8aa8('0x41')][_0x549aac['linkedid']]['uniqueid']]['destinationchannel']=this[_0x8aa8('0x13')][this[_0x8aa8('0x41')][_0x549aac[_0x8aa8('0x31')]]['uniqueid']][_0x8aa8('0x37')];this[_0x8aa8('0x13')][this[_0x8aa8('0x41')][_0x549aac[_0x8aa8('0x31')]][_0x8aa8('0x2f')]][_0x8aa8('0x45')]=this[_0x8aa8('0x13')][_0x549aac[_0x8aa8('0x2f')]][_0x8aa8('0x45')];this[_0x8aa8('0x13')][_0x549aac[_0x8aa8('0x2f')]]=this[_0x8aa8('0x13')][this[_0x8aa8('0x41')][_0x549aac[_0x8aa8('0x31')]][_0x8aa8('0x2f')]];delete this['channels'][this[_0x8aa8('0x41')][_0x549aac['linkedid']][_0x8aa8('0x2f')]];}}if(this[_0x8aa8('0x13')][_0x549aac['uniqueid']]){logger[_0x8aa8('0x25')]('[%s][voiceCallReport][hangup]\x20reason:%s',_0x549aac[_0x8aa8('0x2f')],_0x549aac[_0x8aa8('0x94')]);var _0x1654fa=moment();this['channels'][_0x549aac[_0x8aa8('0x2f')]][_0x8aa8('0x95')]=_0x1654fa['format']('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x549aac['uniqueid']][_0x8aa8('0x55')]=_0x1654fa[_0x8aa8('0x66')](this[_0x8aa8('0x13')][_0x549aac[_0x8aa8('0x2f')]][_0x8aa8('0x43')],_0x8aa8('0x57'));if(this['channels'][_0x549aac[_0x8aa8('0x2f')]][_0x8aa8('0x63')]){this[_0x8aa8('0x13')][_0x549aac[_0x8aa8('0x2f')]]['billableseconds']=_0x1654fa['diff'](this['channels'][_0x549aac[_0x8aa8('0x2f')]][_0x8aa8('0x64')],_0x8aa8('0x57'));this['channels'][_0x549aac['uniqueid']][_0x8aa8('0x65')]=this[_0x8aa8('0x13')][_0x549aac['uniqueid']][_0x8aa8('0x55')]-this[_0x8aa8('0x13')][_0x549aac[_0x8aa8('0x2f')]][_0x8aa8('0x96')];}if(_0x549aac['context']===_0x8aa8('0x36')){if(this['agents'][_0x549aac[_0x8aa8('0x37')][_0x8aa8('0x38')]('-')[0x0]]){this['agents'][_0x549aac[_0x8aa8('0x37')][_0x8aa8('0x38')]('-')[0x0]]=_[_0x8aa8('0x97')](this['agents'][_0x549aac[_0x8aa8('0x37')]['split']('-')[0x0]],[_0x8aa8('0x48')]);logger[_0x8aa8('0x30')](_0x8aa8('0x98'),_0x549aac[_0x8aa8('0x2f')],util[_0x8aa8('0x29')]({'id':this[_0x8aa8('0x14')][_0x549aac['channel'][_0x8aa8('0x38')]('-')[0x0]]['id'],'destaccountcode':this[_0x8aa8('0x14')][_0x549aac[_0x8aa8('0x37')][_0x8aa8('0x38')]('-')[0x0]]['accountcode']},{'showHidden':![],'depth':null}));this[_0x8aa8('0x2c')](util['format'](_0x8aa8('0x3c'),this['agents'][_0x549aac['channel'][_0x8aa8('0x38')]('-')[0x0]][_0x8aa8('0x4a')]),_0x8aa8('0x99'),{'id':this[_0x8aa8('0x14')][_0x549aac[_0x8aa8('0x37')]['split']('-')[0x0]]['id'],'destaccountcode':this[_0x8aa8('0x14')][_0x549aac[_0x8aa8('0x37')][_0x8aa8('0x38')]('-')[0x0]][_0x8aa8('0x3d')]});for(var _0x446998=0x0;_0x446998<Object[_0x8aa8('0x34')](this[_0x8aa8('0x14')])[_0x8aa8('0x9a')];_0x446998++){var _0x46f7d1=Object[_0x8aa8('0x34')](this[_0x8aa8('0x14')])[_0x446998];var _0x4ba35b=this[_0x8aa8('0x14')][_0x46f7d1];if(_0x4ba35b['accountcode']===Number(_0x549aac[_0x8aa8('0x3e')])){this['emit'](util[_0x8aa8('0x3b')]('user:%s',_0x4ba35b[_0x8aa8('0x4a')]),_0x8aa8('0x99'),{'id':_0x4ba35b['id'],'destaccountcode':_0x4ba35b[_0x8aa8('0x3d')],'transfer':this[_0x8aa8('0x13')][_0x549aac[_0x8aa8('0x2f')]][_0x8aa8('0x9b')]});break;}}}}var _0x113930=this;Promise[_0x8aa8('0x9c')]()['then'](function(){var _0x323e7d=_0x113930['channels'][_0x549aac[_0x8aa8('0x2f')]];if(typeof _0x323e7d[_0x8aa8('0x9b')]===_0x8aa8('0x9d'))return;if(_[_0x8aa8('0x9e')](_0x323e7d[_0x8aa8('0x75')]))return;return RpcSetting['getSettings']()[_0x8aa8('0x9f')](function(_0x46dc50){if(!_0x46dc50[_0x8aa8('0xa0')])return;return Promise['resolve']()[_0x8aa8('0x9f')](function(){return ami[_0x8aa8('0xa1')]({'action':_0x8aa8('0xa2'),'channel':_0x323e7d[_0x8aa8('0x37')]})[_0x8aa8('0xa3')](function(){});})[_0x8aa8('0x9f')](function(){return ami[_0x8aa8('0xa1')]({'action':_0x8aa8('0xa2'),'channel':_0x323e7d[_0x8aa8('0x67')]})[_0x8aa8('0xa3')](function(){})[_0x8aa8('0xa4')](function(){var _0x228435=_0x113930['agents'][_0x323e7d[_0x8aa8('0x67')]['split']('-')[0x0]];if(!_0x228435)return;io[_0x8aa8('0x2c')]('webbar:stopmonitors',{'agentId':_0x228435['id'],'uniqueid':_0x323e7d[_0x8aa8('0x2f')]});});});});})[_0x8aa8('0x9f')](function(){if(_0x549aac[_0x8aa8('0xa5')]===_0x8aa8('0xa6')){_0x113930[_0x8aa8('0x41')][_0x549aac[_0x8aa8('0x2f')]]=_0x549aac;}else{if(_0x113930['channels'][_0x549aac['uniqueid']][_0x8aa8('0x5d')]===_0x8aa8('0xa7')&&_0x113930[_0x8aa8('0x41')][_0x549aac['uniqueid']]){_0x113930['channels'][_0x549aac[_0x8aa8('0x2f')]][_0x8aa8('0x2f')]=[_0x113930['channels'][_0x549aac[_0x8aa8('0x2f')]][_0x8aa8('0x31')],_0x113930[_0x8aa8('0x13')][_0x549aac[_0x8aa8('0x2f')]][_0x8aa8('0x31')]=_0x113930[_0x8aa8('0x13')][_0x549aac[_0x8aa8('0x2f')]][_0x8aa8('0x2f')]][0x0];delete _0x113930[_0x8aa8('0x41')][_0x549aac[_0x8aa8('0x2f')]];}}logger[_0x8aa8('0x30')](_0x8aa8('0xa8'),_0x549aac[_0x8aa8('0x2f')],util[_0x8aa8('0x29')](_0x113930['channels'][_0x549aac[_0x8aa8('0x2f')]],{'showHidden':![],'depth':null}));ami['emit'](_0x8aa8('0xa9'),_0x113930['channels'][_0x549aac['uniqueid']]);delete _0x113930[_0x8aa8('0x13')][_0x549aac['uniqueid']];});}}}catch(_0x129b24){logger[_0x8aa8('0x27')](_0x8aa8('0xaa'),_0x549aac[_0x8aa8('0x2f')],util['inspect'](_0x129b24,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x8aa8('0x2d')]['syncAttendedTransfer']=function(_0x169368){try{if(this['isNotNull'](_0x169368)){logger[_0x8aa8('0x25')](_0x8aa8('0xab'),_0x169368[_0x8aa8('0x2f')],_0x169368[_0x8aa8('0xac')],_0x169368[_0x8aa8('0xad')]);logger['debug'](_0x8aa8('0xae'),_0x169368[_0x8aa8('0x2f')],util[_0x8aa8('0x29')](_0x169368,{'showHidden':![],'depth':null}));var _0x1919d8;if(this['channels'][_0x169368[_0x8aa8('0xaf')]]){this['channels'][_0x169368['transfereeuniqueid']][_0x8aa8('0xb0')]=_0x169368['origtransferercalleridnum'];this[_0x8aa8('0x13')][_0x169368[_0x8aa8('0xaf')]][_0x8aa8('0xb1')]=_0x169368[_0x8aa8('0xad')];if(this[_0x8aa8('0x13')][_0x169368[_0x8aa8('0xb2')]]){_0x1919d8=this['channels'][_0x169368[_0x8aa8('0xb2')]];this[_0x8aa8('0x13')][_0x169368['secondtransfereruniqueid']]=this[_0x8aa8('0x13')][_0x169368[_0x8aa8('0xaf')]];this[_0x8aa8('0x13')][_0x169368[_0x8aa8('0xaf')]]=_0x1919d8;}this[_0x8aa8('0x13')][_0x169368[_0x8aa8('0xb2')]][_0x8aa8('0x9b')]=_0x8aa8('0xb3');}else if(this[_0x8aa8('0x13')][_0x169368[_0x8aa8('0xb4')]]){this[_0x8aa8('0x13')][_0x169368[_0x8aa8('0xb4')]]['transfercalleridnum']=_0x169368['origtransferercalleridnum'];this[_0x8aa8('0x13')][_0x169368[_0x8aa8('0xb4')]][_0x8aa8('0xb1')]=_0x169368['transfertargetcalleridnum'];if(this[_0x8aa8('0x13')][_0x169368[_0x8aa8('0xb5')]]){_0x1919d8=this[_0x8aa8('0x13')][_0x169368[_0x8aa8('0xb5')]];this[_0x8aa8('0x13')][_0x169368[_0x8aa8('0xb5')]]=this[_0x8aa8('0x13')][_0x169368[_0x8aa8('0xb4')]];this['channels'][_0x169368[_0x8aa8('0xb4')]]=_0x1919d8;}this[_0x8aa8('0x13')][_0x169368['transfertargetuniqueid']][_0x8aa8('0x9b')]='ATTENDED';}if((this[_0x8aa8('0x13')][_0x169368['origtransfereruniqueid']]||this['channels'][_0x169368[_0x8aa8('0xb6')]])&&this[_0x8aa8('0x13')][_0x169368[_0x8aa8('0xb2')]]){var _0x301b4b=_['some']([this[_0x8aa8('0x13')][_0x169368[_0x8aa8('0xb5')]],this[_0x8aa8('0x13')][_0x169368[_0x8aa8('0xb6')]],this['channels'][_0x169368[_0x8aa8('0xb2')]]],function(_0x3392b9){return _0x3392b9&&_0x3392b9[_0x8aa8('0x5d')]===_0x8aa8('0xa7')&&_0x3392b9[_0x8aa8('0xb7')];});if(_0x301b4b){if(this[_0x8aa8('0x13')][_0x169368[_0x8aa8('0xb5')]])this[_0x8aa8('0x13')][_0x169368[_0x8aa8('0xb5')]][_0x8aa8('0x9b')]='ATTENDED';if(this[_0x8aa8('0x13')][_0x169368[_0x8aa8('0xb6')]])this[_0x8aa8('0x13')][_0x169368[_0x8aa8('0xb6')]][_0x8aa8('0x9b')]=_0x8aa8('0xb3');this['channels'][_0x169368[_0x8aa8('0xb2')]]['transferType']=_0x8aa8('0xb3');}}}}catch(_0x36ab5e){logger['error'](_0x8aa8('0xb8'),_0x169368['uniqueid'],util[_0x8aa8('0x29')](_0x36ab5e,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x8aa8('0x2d')][_0x8aa8('0x21')]=function(_0x5042cb){try{if(this[_0x8aa8('0x2a')](_0x5042cb)){logger['info']('[%s][voiceCallReport][blindtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s',_0x5042cb[_0x8aa8('0x2f')],_0x5042cb[_0x8aa8('0xb9')],_0x5042cb[_0x8aa8('0xba')]);logger[_0x8aa8('0x30')](_0x8aa8('0xbb'),_0x5042cb[_0x8aa8('0x2f')],util[_0x8aa8('0x29')](_0x5042cb,{'showHidden':![],'depth':null}));if(this['channels'][_0x5042cb[_0x8aa8('0xaf')]]){this['channels'][_0x5042cb[_0x8aa8('0xaf')]][_0x8aa8('0xb0')]=_0x5042cb[_0x8aa8('0xb9')];this['channels'][_0x5042cb[_0x8aa8('0xaf')]]['transferconnectedlinenum']=_0x5042cb[_0x8aa8('0xba')];this['channels'][_0x5042cb['transfereeuniqueid']][_0x8aa8('0x9b')]=_0x8aa8('0xbc');this[_0x8aa8('0x93')]({'event':'BlindTransfer','uniqueid':_0x5042cb['transfereeuniqueid'],'linkedid':_0x5042cb['transfereruniqueid'],'context':_0x5042cb['context'],'channel':_0x5042cb[_0x8aa8('0xbd')]});}else{this['channels'][_0x5042cb[_0x8aa8('0xbe')]][_0x8aa8('0x9b')]='BLIND';this[_0x8aa8('0x93')]({'event':_0x8aa8('0xa6'),'uniqueid':_0x5042cb['transfereruniqueid'],'linkedid':_0x5042cb[_0x8aa8('0xaf')],'context':_0x5042cb[_0x8aa8('0x35')],'channel':_0x5042cb['transfererchannel']});}}}catch(_0x43a7f2){logger[_0x8aa8('0x27')]('[%s][voiceCallReport][blindtransfer]',_0x5042cb[_0x8aa8('0x2f')],util['inspect'](_0x43a7f2,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype']['syncMusicOnHoldStart']=function(_0x5c40ef){try{if(this['isNotNull'](_0x5c40ef)){logger[_0x8aa8('0x30')]('[%s][voiceCallReport][musiconholdstart]\x20event:',_0x5c40ef[_0x8aa8('0x2f')],util[_0x8aa8('0x29')](_0x5c40ef,{'showHidden':![],'depth':null}));if(this[_0x8aa8('0x13')][_0x5c40ef[_0x8aa8('0x2f')]]){if(!_[_0x8aa8('0x76')](this[_0x8aa8('0x13')][_0x5c40ef[_0x8aa8('0x2f')]][_0x8aa8('0x64')])){this[_0x8aa8('0x13')][_0x5c40ef[_0x8aa8('0x2f')]][_0x8aa8('0xbf')]=moment()[_0x8aa8('0x3b')]('YYYY-MM-DD\x20HH:mm:ss');logger['info']('[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s',_0x5c40ef[_0x8aa8('0x2f')],this[_0x8aa8('0x13')][_0x5c40ef['uniqueid']][_0x8aa8('0xbf')]);}}}}catch(_0x7deeac){logger['error'](_0x8aa8('0xc0'),_0x5c40ef[_0x8aa8('0x2f')],util[_0x8aa8('0x29')](_0x7deeac,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x8aa8('0x2d')][_0x8aa8('0x24')]=function(_0xc5a5fd){try{if(this[_0x8aa8('0x2a')](_0xc5a5fd)){logger[_0x8aa8('0x30')](_0x8aa8('0xc1'),_0xc5a5fd[_0x8aa8('0x2f')],util['inspect'](_0xc5a5fd,{'showHidden':![],'depth':null}));if(this[_0x8aa8('0x13')][_0xc5a5fd[_0x8aa8('0x2f')]]){if(!_['isNil'](this[_0x8aa8('0x13')][_0xc5a5fd[_0x8aa8('0x2f')]][_0x8aa8('0xbf')])){this['channels'][_0xc5a5fd[_0x8aa8('0x2f')]]['mohtime']+=moment()[_0x8aa8('0xc2')](0x0)['diff'](this['channels'][_0xc5a5fd[_0x8aa8('0x2f')]]['mohstarttime'],_0x8aa8('0x57'));logger['info'](_0x8aa8('0xc3'),_0xc5a5fd[_0x8aa8('0x2f')],this[_0x8aa8('0x13')][_0xc5a5fd[_0x8aa8('0x2f')]][_0x8aa8('0xc4')]);delete this[_0x8aa8('0x13')][_0xc5a5fd[_0x8aa8('0x2f')]]['mohstarttime'];}}}}catch(_0x5d31bb){logger[_0x8aa8('0x27')](_0x8aa8('0xc5'),_0xc5a5fd[_0x8aa8('0x2f')],util[_0x8aa8('0x29')](_0x5d31bb,{'showHidden':![],'depth':null}));}};module[_0x8aa8('0xc6')]=VoiceCallReport;
\ No newline at end of file
+var _0x00bb=['cdr(','match','isNil','[%s][voiceCallReport][newexten]','[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s','answered','answertime','holdtime','diff','connectedlinename','destinationchannel','UserId','membername','xcally-motion-preview','routealias','[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:','syncMixMonitorFilename','monitor','endsWith','.wav49','find','monitors','push','[%s][voiceCallReport][mixMonitorFilename]','syncVarSet','[%s][voiceCallReport][varset]\x20event:','variable','mixmonitor_filename','[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s','value','[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s','xmd-callerid','[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s','callerid','[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s','type','xmd-queue','[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s','xmd-originatecalleridnum','originatecalleridnum','xmd-destination','[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s','destination','xmd-callerid-preview','[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s','calleridpreview','xmcs-queue','sipcallid','[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','sipcalluniqueid','parse','sipcalllinkedid','[%s][voiceCallReport][hangup]\x20reason:%s','endtime','billableseconds','user:agentcomplete','length','resolve','then','transferType','undefined','getSettings','stopRecordingOnTransfer','Action','StopMixMonitor','catch','finally','webbar:stopmonitors','event','outbound','[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:','custom:voiceCallReport','[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','transfertargetcalleridnum','transfereeuniqueid','transfercalleridnum','origtransferercalleridnum','transferconnectedlinenum','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','ATTENDED','origtransfererlinkedid','routeid','syncBlindTransfer','[%s][voiceCallReport][blindtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','extension','BlindTransfer','transfererchannel','transfereruniqueid','BLIND','[%s][voiceCallReport][blindtransfer]','[%s][voiceCallReport][musiconholdstart]\x20event:','mohstarttime','[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s','mohtime','milliseconds','[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s','[%s][voiceCallReport][musiconholdstop]','exports','lodash','moment','util','ioredis','../../../config/logger','ami','../model/channel','../rpc/setting','dial','playback','voicemail','NO\x20ANSWER','FAILED','ANSWERED','BUSY','redis','socket.io-emitter','channels','agents','blindTransfers','coreshowchannel','bind','newexten','newchannel','newstate','syncNewState','varset','syncHangup','newcallerid','attendedtransfer','blindtransfer','musiconholdstart','syncMusicOnHoldStart','syncMusicOnHoldStop','info','[voiceCallReport][coreshowchannels]\x20started','error','inspect','prototype','isUndefined','emit','isNotNull','[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s','uniqueid','calleridname','calleridnum','[%s][voiceCallReport][newcallerid]\x20event:','linkedid','merge','pick','keys','from-sip','split','exten','destconnectedlinenum','connectedlinenum','format','user:%s','user:agentconnect','channel','[%s][voiceCallReport][newcallerid]','syncNewChannel','debug','OutgoingSpoolFailed','[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s','context','starttime','YYYY-MM-DD\x20HH:mm:ss','disposition','toNumber','channelstate','accountcode','name','[%s][voiceCallReport][newchannel]','application','toLowerCase','applicationdata','appdata','queue','[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s','duration','seconds','includes','lastapplication','lastdata','set'];(function(_0x3fda04,_0x3b6081){var _0x1accc3=function(_0x2a1a1f){while(--_0x2a1a1f){_0x3fda04['push'](_0x3fda04['shift']());}};_0x1accc3(++_0x3b6081);}(_0x00bb,0x1d8));var _0xb00b=function(_0x23e7c1,_0x35110c){_0x23e7c1=_0x23e7c1-0x0;var _0x1add43=_0x00bb[_0x23e7c1];return _0x1add43;};'use strict';var _=require(_0xb00b('0x0'));var moment=require(_0xb00b('0x1'));var util=require(_0xb00b('0x2'));var path=require('path');var Redis=require(_0xb00b('0x3'));var config=require('../../../config/environment');var logger=require(_0xb00b('0x4'))(_0xb00b('0x5'));var ami=require('../ami');var Channel=require(_0xb00b('0x6'));var RpcSetting=require(_0xb00b('0x7'));var applications=['set','queue','agi',_0xb00b('0x8'),_0xb00b('0x9'),_0xb00b('0xa')];var dispositions=[_0xb00b('0xb'),_0xb00b('0xc'),_0xb00b('0xc'),'NO\x20ANSWER','NO\x20ANSWER',_0xb00b('0xb'),_0xb00b('0xd'),_0xb00b('0xe'),_0xb00b('0xc'),_0xb00b('0xc'),'FAILED'];config[_0xb00b('0xf')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xb00b('0x10'))(new Redis(config[_0xb00b('0xf')]));function VoiceCallReport(_0x1be8aa){this[_0xb00b('0x11')]=_0x1be8aa[_0xb00b('0x11')];this[_0xb00b('0x12')]=_0x1be8aa['agents'];this[_0xb00b('0x13')]={};ami['on'](_0xb00b('0x14'),this['syncNewExten'][_0xb00b('0x15')](this));ami['on'](_0xb00b('0x16'),this['syncNewExten']['bind'](this));ami['on'](_0xb00b('0x17'),this['syncNewChannel']['bind'](this));ami['on'](_0xb00b('0x18'),this[_0xb00b('0x19')][_0xb00b('0x15')](this));ami['on'](_0xb00b('0x1a'),this['syncVarSet'][_0xb00b('0x15')](this));ami['on']('hangup',this[_0xb00b('0x1b')]['bind'](this));ami['on'](_0xb00b('0x1c'),this['syncNewCallerId'][_0xb00b('0x15')](this));ami['on'](_0xb00b('0x1d'),this['syncAttendedTransfer']['bind'](this));ami['on'](_0xb00b('0x1e'),this['syncBlindTransfer'][_0xb00b('0x15')](this));ami['on'](_0xb00b('0x1f'),this[_0xb00b('0x20')][_0xb00b('0x15')](this));ami['on']('musiconholdstop',this[_0xb00b('0x21')]['bind'](this));try{logger[_0xb00b('0x22')](_0xb00b('0x23'));ami['actionCoreShowChannels']();}catch(_0x231293){logger[_0xb00b('0x24')]('[voiceCallReport][coreshowchannels]',util[_0xb00b('0x25')](_0x231293,{'showHidden':![],'depth':null}));}}VoiceCallReport[_0xb00b('0x26')]['isNotNull']=function(_0x44efe5){return _0x44efe5!==null&&!_[_0xb00b('0x27')](_0x44efe5);};VoiceCallReport[_0xb00b('0x26')][_0xb00b('0x28')]=function(_0x520e55,_0x50be6c,_0x3785e9){io['to'](_0x520e55)['emit'](_0x50be6c,_0x3785e9);};VoiceCallReport['prototype']['syncNewCallerId']=function(_0x16ac55){try{if(this[_0xb00b('0x29')](_0x16ac55)){logger[_0xb00b('0x22')](_0xb00b('0x2a'),_0x16ac55[_0xb00b('0x2b')],_0x16ac55[_0xb00b('0x2c')],_0x16ac55[_0xb00b('0x2d')]);logger['debug'](_0xb00b('0x2e'),_0x16ac55['uniqueid'],util[_0xb00b('0x25')](_0x16ac55,{'showHidden':![],'depth':null}));if(_0x16ac55[_0xb00b('0x2b')]===_0x16ac55[_0xb00b('0x2f')]){if(!_['isUndefined'](this[_0xb00b('0x11')][_0x16ac55[_0xb00b('0x2b')]])){_[_0xb00b('0x30')](this[_0xb00b('0x11')][_0x16ac55[_0xb00b('0x2b')]],_[_0xb00b('0x31')](_0x16ac55,_[_0xb00b('0x32')](this[_0xb00b('0x11')][_0x16ac55[_0xb00b('0x2b')]])));}}if(_0x16ac55['context']===_0xb00b('0x33')){if(this[_0xb00b('0x12')][_0x16ac55['channel'][_0xb00b('0x34')]('-')[0x0]]){if(_0x16ac55[_0xb00b('0x35')]=='xcally-motion-preview'){this[_0xb00b('0x12')][_0x16ac55['channel'][_0xb00b('0x34')]('-')[0x0]][_0xb00b('0x36')]=_0x16ac55[_0xb00b('0x37')];this[_0xb00b('0x28')](util[_0xb00b('0x38')](_0xb00b('0x39'),this[_0xb00b('0x12')][_0x16ac55['channel']['split']('-')[0x0]]['name']),_0xb00b('0x3a'),{'destaccountcode':this[_0xb00b('0x12')][_0x16ac55[_0xb00b('0x3b')][_0xb00b('0x34')]('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x16ac55[_0xb00b('0x37')]});}}}}}catch(_0x266f8e){logger[_0xb00b('0x24')](_0xb00b('0x3c'),_0x16ac55[_0xb00b('0x2b')],util[_0xb00b('0x25')](_0x266f8e,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xb00b('0x26')][_0xb00b('0x3d')]=function(_0x5efc18){try{if(this['isNotNull'](_0x5efc18)){logger[_0xb00b('0x3e')]('[%s][voiceCallReport][newchannel]\x20event:',_0x5efc18[_0xb00b('0x2b')],util[_0xb00b('0x25')](_0x5efc18,{'showHidden':![],'depth':null}));if(this[_0xb00b('0x11')][_0x5efc18[_0xb00b('0x2b')]])return;if(_0x5efc18[_0xb00b('0x3b')]===_0xb00b('0x3f'))return;if(_0x5efc18[_0xb00b('0x2b')]!==_0x5efc18['linkedid']&&!this[_0xb00b('0x13')][_0x5efc18[_0xb00b('0x2f')]])return;logger[_0xb00b('0x22')](_0xb00b('0x40'),_0x5efc18[_0xb00b('0x2b')],_0x5efc18[_0xb00b('0x41')],_0x5efc18['exten']);this[_0xb00b('0x11')][_0x5efc18[_0xb00b('0x2b')]]=new Channel();this['channels'][_0x5efc18[_0xb00b('0x2b')]][_0xb00b('0x42')]=moment()[_0xb00b('0x38')](_0xb00b('0x43'));this[_0xb00b('0x11')][_0x5efc18['uniqueid']][_0xb00b('0x44')]=dispositions[_[_0xb00b('0x45')](_0x5efc18[_0xb00b('0x46')])];_[_0xb00b('0x30')](this['channels'][_0x5efc18['uniqueid']],_[_0xb00b('0x31')](_0x5efc18,_[_0xb00b('0x32')](this[_0xb00b('0x11')][_0x5efc18[_0xb00b('0x2b')]])));if(_0x5efc18[_0xb00b('0x41')]===_0xb00b('0x33')){if(this[_0xb00b('0x12')][_0x5efc18['channel'][_0xb00b('0x34')]('-')[0x0]]){if(_[_0xb00b('0x27')](this[_0xb00b('0x12')][_0x5efc18[_0xb00b('0x3b')][_0xb00b('0x34')]('-')[0x0]][_0xb00b('0x36')])){this[_0xb00b('0x12')][_0x5efc18[_0xb00b('0x3b')][_0xb00b('0x34')]('-')[0x0]][_0xb00b('0x36')]=_0x5efc18[_0xb00b('0x35')];logger[_0xb00b('0x3e')]('[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:',_0x5efc18[_0xb00b('0x2b')],util[_0xb00b('0x25')]({'id':this[_0xb00b('0x12')][_0x5efc18[_0xb00b('0x3b')][_0xb00b('0x34')]('-')[0x0]]['id'],'destaccountcode':this[_0xb00b('0x12')][_0x5efc18[_0xb00b('0x3b')][_0xb00b('0x34')]('-')[0x0]][_0xb00b('0x47')],'destconnectedlinenum':_0x5efc18[_0xb00b('0x35')]},{'showHidden':![],'depth':null}));this[_0xb00b('0x28')](util[_0xb00b('0x38')]('user:%s',this['agents'][_0x5efc18['channel'][_0xb00b('0x34')]('-')[0x0]][_0xb00b('0x48')]),'user:agentconnect',{'id':this[_0xb00b('0x12')][_0x5efc18[_0xb00b('0x3b')][_0xb00b('0x34')]('-')[0x0]]['id'],'destaccountcode':this[_0xb00b('0x12')][_0x5efc18['channel']['split']('-')[0x0]][_0xb00b('0x47')],'destconnectedlinenum':_0x5efc18[_0xb00b('0x35')]});}}}}}catch(_0x49778a){logger['error'](_0xb00b('0x49'),_0x5efc18[_0xb00b('0x2b')],util['inspect'](_0x49778a,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xb00b('0x26')]['syncNewExten']=function(_0x4bc61e){try{if(this['isNotNull'](_0x4bc61e)){logger[_0xb00b('0x3e')]('[%s][voiceCallReport][newexten]\x20event:',_0x4bc61e[_0xb00b('0x2b')],util[_0xb00b('0x25')](_0x4bc61e,{'showHidden':![],'depth':null}));if(_0x4bc61e[_0xb00b('0x3b')]===_0xb00b('0x3f')||_0x4bc61e[_0xb00b('0x35')]==='h')return;if(_0x4bc61e[_0xb00b('0x2b')]===_0x4bc61e['linkedid']||this['blindTransfers'][_0x4bc61e[_0xb00b('0x2f')]]){_0x4bc61e[_0xb00b('0x4a')]=_0x4bc61e['application'][_0xb00b('0x4b')]();_0x4bc61e[_0xb00b('0x4c')]=_0x4bc61e['appdata']||_0x4bc61e[_0xb00b('0x4c')];if(_0x4bc61e[_0xb00b('0x4d')]&&!_0x4bc61e[_0xb00b('0x4d')]['startsWith']('CDR(routeAlias)')&&_0x4bc61e[_0xb00b('0x4a')]!==_0xb00b('0x4e')){_0x4bc61e[_0xb00b('0x4c')]=_0x4bc61e[_0xb00b('0x4c')]['toLowerCase']();}logger[_0xb00b('0x22')](_0xb00b('0x4f'),_0x4bc61e['uniqueid'],_0x4bc61e['application'],_0x4bc61e[_0xb00b('0x4c')]);if(_['isUndefined'](this[_0xb00b('0x11')][_0x4bc61e[_0xb00b('0x2b')]])){this[_0xb00b('0x11')][_0x4bc61e[_0xb00b('0x2b')]]=new Channel();this[_0xb00b('0x11')][_0x4bc61e[_0xb00b('0x2b')]]['starttime']=_0x4bc61e[_0xb00b('0x50')]?moment()['subtract'](moment[_0xb00b('0x50')](_0x4bc61e[_0xb00b('0x50')])[_0xb00b('0x51')](),'seconds')[_0xb00b('0x38')](_0xb00b('0x43')):moment()[_0xb00b('0x38')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xb00b('0x11')][_0x4bc61e[_0xb00b('0x2b')]][_0xb00b('0x44')]=_0xb00b('0xb');}_[_0xb00b('0x30')](this[_0xb00b('0x11')][_0x4bc61e[_0xb00b('0x2b')]],_[_0xb00b('0x31')](_0x4bc61e,_['keys'](this[_0xb00b('0x11')][_0x4bc61e[_0xb00b('0x2b')]])));if(_[_0xb00b('0x52')](applications,_0x4bc61e['application'])){this[_0xb00b('0x11')][_0x4bc61e[_0xb00b('0x2b')]][_0xb00b('0x53')]=_0x4bc61e[_0xb00b('0x4a')];this[_0xb00b('0x11')][_0x4bc61e['uniqueid']][_0xb00b('0x54')]=_0x4bc61e[_0xb00b('0x4c')];if(_0x4bc61e[_0xb00b('0x4a')]===_0xb00b('0x55')&&_['startsWith'](_0x4bc61e[_0xb00b('0x4c')][_0xb00b('0x4b')](),_0xb00b('0x56'))){var _0x2d73bb=_0x4bc61e[_0xb00b('0x4c')][_0xb00b('0x34')]('=');var _0x2f2032=_0x2d73bb[0x0]['toLowerCase']()[_0xb00b('0x57')](/cdr\((.*)\)/);if(_0x2f2032){if(_0x2f2032[0x1]==='type'&&!_[_0xb00b('0x58')](this['channels'][_0x4bc61e[_0xb00b('0x2b')]][_0x2f2032[0x1]]))return;this['channels'][_0x4bc61e[_0xb00b('0x2b')]][_0x2f2032[0x1]]=_0x2d73bb[0x1];}}else if(_0x4bc61e['application']===_0xb00b('0x4e')){this[_0xb00b('0x11')][_0x4bc61e[_0xb00b('0x2b')]]['queue']=_0x4bc61e['applicationdata']['split'](',')[0x0];}}}}}catch(_0x21a53d){logger[_0xb00b('0x24')](_0xb00b('0x59'),_0x4bc61e['uniqueid'],util[_0xb00b('0x25')](_0x21a53d,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xb00b('0x26')][_0xb00b('0x19')]=function(_0x2ddba4){try{if(this[_0xb00b('0x29')](_0x2ddba4)){logger['info'](_0xb00b('0x5a'),_0x2ddba4[_0xb00b('0x2b')],_0x2ddba4['linkedid'],_0x2ddba4[_0xb00b('0x2c')],_0x2ddba4[_0xb00b('0x2d')]);logger[_0xb00b('0x3e')]('[%s][voiceCallReport][newstate]\x20event:',_0x2ddba4['uniqueid'],util[_0xb00b('0x25')](_0x2ddba4,{'showHidden':![],'depth':null}));if(_0x2ddba4[_0xb00b('0x46')]!=='6')return;if(_0x2ddba4[_0xb00b('0x2b')]!==_0x2ddba4['linkedid']){var _0x5aac5f=moment();if(this['channels'][_0x2ddba4['linkedid']]){if(!this[_0xb00b('0x11')][_0x2ddba4['linkedid']][_0xb00b('0x5b')]){this[_0xb00b('0x11')][_0x2ddba4['linkedid']][_0xb00b('0x5b')]=!![];this[_0xb00b('0x11')][_0x2ddba4[_0xb00b('0x2f')]][_0xb00b('0x5c')]=_0x5aac5f[_0xb00b('0x38')]('YYYY-MM-DD\x20HH:mm:ss');if(this[_0xb00b('0x11')][_0x2ddba4[_0xb00b('0x2f')]][_0xb00b('0x42')]){this[_0xb00b('0x11')][_0x2ddba4[_0xb00b('0x2f')]][_0xb00b('0x5d')]=_0x5aac5f[_0xb00b('0x5e')](this['channels'][_0x2ddba4[_0xb00b('0x2f')]][_0xb00b('0x42')],_0xb00b('0x51'));}}this[_0xb00b('0x11')][_0x2ddba4[_0xb00b('0x2f')]][_0xb00b('0x2f')]=_0x2ddba4[_0xb00b('0x2b')];if(_0x2ddba4[_0xb00b('0x2d')]!=='xcally-motion-preview'){this[_0xb00b('0x11')][_0x2ddba4[_0xb00b('0x2f')]][_0xb00b('0x37')]=_0x2ddba4[_0xb00b('0x2d')];}this[_0xb00b('0x11')][_0x2ddba4[_0xb00b('0x2f')]][_0xb00b('0x5f')]=_0x2ddba4[_0xb00b('0x2c')];this['channels'][_0x2ddba4[_0xb00b('0x2f')]][_0xb00b('0x60')]=_0x2ddba4[_0xb00b('0x3b')];this[_0xb00b('0x11')][_0x2ddba4[_0xb00b('0x2f')]][_0xb00b('0x44')]=dispositions[_[_0xb00b('0x45')](_0x2ddba4['channelstate'])];if(this[_0xb00b('0x12')][_0x2ddba4[_0xb00b('0x3b')][_0xb00b('0x34')]('-')[0x0]]){this[_0xb00b('0x11')][_0x2ddba4[_0xb00b('0x2f')]][_0xb00b('0x61')]=this['agents'][_0x2ddba4[_0xb00b('0x3b')]['split']('-')[0x0]]['id'];this[_0xb00b('0x11')][_0x2ddba4['linkedid']][_0xb00b('0x62')]=this[_0xb00b('0x12')][_0x2ddba4[_0xb00b('0x3b')]['split']('-')[0x0]]['name'];}}if(this[_0xb00b('0x11')][_0x2ddba4[_0xb00b('0x2b')]]){if(!this[_0xb00b('0x11')][_0x2ddba4[_0xb00b('0x2b')]][_0xb00b('0x5b')]){this[_0xb00b('0x11')][_0x2ddba4[_0xb00b('0x2b')]][_0xb00b('0x5b')]=!![];this[_0xb00b('0x11')][_0x2ddba4[_0xb00b('0x2b')]][_0xb00b('0x5c')]=_0x5aac5f[_0xb00b('0x38')](_0xb00b('0x43'));if(this[_0xb00b('0x11')][_0x2ddba4['uniqueid']]['starttime']){this[_0xb00b('0x11')][_0x2ddba4[_0xb00b('0x2b')]]['holdtime']=_0x5aac5f['diff'](this[_0xb00b('0x11')][_0x2ddba4[_0xb00b('0x2b')]][_0xb00b('0x42')],'seconds');}}if(_0x2ddba4[_0xb00b('0x2d')]!==_0xb00b('0x63')){this[_0xb00b('0x11')][_0x2ddba4[_0xb00b('0x2b')]][_0xb00b('0x37')]=_0x2ddba4[_0xb00b('0x2d')];}this[_0xb00b('0x11')][_0x2ddba4['uniqueid']][_0xb00b('0x5f')]=_0x2ddba4['calleridname'];this[_0xb00b('0x11')][_0x2ddba4[_0xb00b('0x2b')]]['destinationchannel']=_0x2ddba4[_0xb00b('0x3b')];this[_0xb00b('0x11')][_0x2ddba4[_0xb00b('0x2b')]][_0xb00b('0x44')]=dispositions[_[_0xb00b('0x45')](_0x2ddba4[_0xb00b('0x46')])];}}else{if(this[_0xb00b('0x11')][_0x2ddba4[_0xb00b('0x2b')]]){if(this[_0xb00b('0x12')][_0x2ddba4[_0xb00b('0x3b')][_0xb00b('0x34')]('-')[0x0]]){this[_0xb00b('0x11')][_0x2ddba4['uniqueid']][_0xb00b('0x61')]=this[_0xb00b('0x12')][_0x2ddba4[_0xb00b('0x3b')][_0xb00b('0x34')]('-')[0x0]]['id'];this['channels'][_0x2ddba4[_0xb00b('0x2b')]][_0xb00b('0x62')]=this[_0xb00b('0x12')][_0x2ddba4[_0xb00b('0x3b')][_0xb00b('0x34')]('-')[0x0]]['name'];}}}if(_0x2ddba4[_0xb00b('0x41')]===_0xb00b('0x33')){if(this[_0xb00b('0x12')][_0x2ddba4[_0xb00b('0x3b')]['split']('-')[0x0]]){this[_0xb00b('0x12')][_0x2ddba4['channel'][_0xb00b('0x34')]('-')[0x0]][_0xb00b('0x36')]=_0x2ddba4[_0xb00b('0x35')];var _0x165442,_0x188349;if(this[_0xb00b('0x11')][_0x2ddba4[_0xb00b('0x2b')]]){_0x165442=this[_0xb00b('0x11')][_0x2ddba4[_0xb00b('0x2b')]][_0xb00b('0x64')];_0x188349=this[_0xb00b('0x11')][_0x2ddba4['uniqueid']][_0xb00b('0x4e')];}else if(this[_0xb00b('0x11')][_0x2ddba4[_0xb00b('0x2f')]]){_0x165442=this[_0xb00b('0x11')][_0x2ddba4['linkedid']][_0xb00b('0x64')];_0x188349=this[_0xb00b('0x11')][_0x2ddba4['linkedid']][_0xb00b('0x4e')];}logger['debug'](_0xb00b('0x65'),_0x2ddba4[_0xb00b('0x2b')],util[_0xb00b('0x25')]({'id':this['agents'][_0x2ddba4[_0xb00b('0x3b')][_0xb00b('0x34')]('-')[0x0]]['id'],'destaccountcode':this[_0xb00b('0x12')][_0x2ddba4[_0xb00b('0x3b')][_0xb00b('0x34')]('-')[0x0]][_0xb00b('0x47')],'destconnectedlinenum':_0x2ddba4[_0xb00b('0x35')],'routealias':_0x165442,'queue':_0x188349||undefined},{'showHidden':![],'depth':null}));this[_0xb00b('0x28')](util[_0xb00b('0x38')]('user:%s',this['agents'][_0x2ddba4[_0xb00b('0x3b')][_0xb00b('0x34')]('-')[0x0]][_0xb00b('0x48')]),_0xb00b('0x3a'),{'id':this['agents'][_0x2ddba4[_0xb00b('0x3b')][_0xb00b('0x34')]('-')[0x0]]['id'],'agentconnected':!![],'destaccountcode':this['agents'][_0x2ddba4[_0xb00b('0x3b')][_0xb00b('0x34')]('-')[0x0]][_0xb00b('0x47')],'destconnectedlinenum':_0x2ddba4['exten'],'routealias':_0x165442,'queue':_0x188349||undefined});}}}}catch(_0x1abcd8){logger[_0xb00b('0x24')]('[%s][voiceCallReport][newstate]',_0x2ddba4[_0xb00b('0x2b')],util[_0xb00b('0x25')](_0x1abcd8,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xb00b('0x26')][_0xb00b('0x66')]=function(_0x476c6c,_0x294f38){try{if(this[_0xb00b('0x11')][_0x476c6c]){logger[_0xb00b('0x22')]('[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s',_0x476c6c,_0x294f38);this[_0xb00b('0x11')][_0x476c6c][_0xb00b('0x67')]=!![];if(_[_0xb00b('0x68')](_0x294f38,_0xb00b('0x69'))){_0x294f38=_0x294f38['replace'](_0xb00b('0x69'),'.WAV');}this[_0xb00b('0x11')][_0x476c6c]['monitorFilename']=_0x294f38;var _0x14b743=_[_0xb00b('0x6a')](this[_0xb00b('0x11')][_0x476c6c][_0xb00b('0x6b')],{'filename':_0x294f38});if(_[_0xb00b('0x58')](_0x14b743)){this['channels'][_0x476c6c][_0xb00b('0x6b')][_0xb00b('0x6c')]({'filename':_0x294f38,'createdAt':moment()['format'](_0xb00b('0x43')),'mixmonitorid':'','status':'rec'});}}}catch(_0x20a690){logger[_0xb00b('0x24')](_0xb00b('0x6d'),_0x476c6c,util[_0xb00b('0x25')](_0x20a690,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xb00b('0x6e')]=function(_0x76b483){try{if(this[_0xb00b('0x29')](_0x76b483)){logger[_0xb00b('0x3e')](_0xb00b('0x6f'),_0x76b483['uniqueid'],util['inspect'](_0x76b483,{'showHidden':![],'depth':null}));if(this[_0xb00b('0x11')][_0x76b483[_0xb00b('0x2b')]]&&_0x76b483[_0xb00b('0x3b')]!=_0xb00b('0x3f')){if(this[_0xb00b('0x29')](_0x76b483['variable'])){if(this['isNotNull'](_0x76b483[_0xb00b('0x70')][_0xb00b('0x71')])){logger[_0xb00b('0x22')](_0xb00b('0x72'),_0x76b483[_0xb00b('0x2b')],_0x76b483[_0xb00b('0x73')]);this[_0xb00b('0x66')](_0x76b483['uniqueid'],_0x76b483[_0xb00b('0x73')]);}else if(this['isNotNull'](_0x76b483[_0xb00b('0x70')]['xmd-phone'])){logger[_0xb00b('0x22')](_0xb00b('0x74'),_0x76b483[_0xb00b('0x2b')],_0x76b483[_0xb00b('0x73')]);this[_0xb00b('0x11')][_0x76b483[_0xb00b('0x2b')]][_0xb00b('0x2d')]=_0x76b483[_0xb00b('0x73')];}else if(this[_0xb00b('0x29')](_0x76b483[_0xb00b('0x70')][_0xb00b('0x75')])){logger['info'](_0xb00b('0x76'),_0x76b483[_0xb00b('0x2b')],_0x76b483[_0xb00b('0x73')]);this[_0xb00b('0x11')][_0x76b483['uniqueid']][_0xb00b('0x77')]=_0x76b483[_0xb00b('0x73')];}else if(this['isNotNull'](_0x76b483[_0xb00b('0x70')]['xmd-cdrtype'])){logger[_0xb00b('0x22')](_0xb00b('0x78'),_0x76b483['uniqueid'],_0x76b483[_0xb00b('0x73')]);this[_0xb00b('0x11')][_0x76b483[_0xb00b('0x2b')]][_0xb00b('0x79')]=_0x76b483[_0xb00b('0x73')];}else if(this[_0xb00b('0x29')](_0x76b483['variable'][_0xb00b('0x7a')])){logger['info'](_0xb00b('0x7b'),_0x76b483[_0xb00b('0x2b')],_0x76b483[_0xb00b('0x73')][_0xb00b('0x34')](',')[0x0]);this['channels'][_0x76b483[_0xb00b('0x2b')]][_0xb00b('0x4e')]=_0x76b483[_0xb00b('0x73')]['split'](',')[0x0];}else if(this[_0xb00b('0x29')](_0x76b483[_0xb00b('0x70')][_0xb00b('0x7c')])){logger[_0xb00b('0x22')]('[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s',_0x76b483[_0xb00b('0x2b')],_0x76b483[_0xb00b('0x73')]);this[_0xb00b('0x11')][_0x76b483[_0xb00b('0x2b')]][_0xb00b('0x7d')]=_0x76b483[_0xb00b('0x73')];}else if(this['isNotNull'](_0x76b483['variable'][_0xb00b('0x7e')])){logger[_0xb00b('0x22')](_0xb00b('0x7f'),_0x76b483[_0xb00b('0x2b')],_0x76b483[_0xb00b('0x73')]);this['channels'][_0x76b483[_0xb00b('0x2b')]][_0xb00b('0x80')]=_0x76b483[_0xb00b('0x73')];}else if(this[_0xb00b('0x29')](_0x76b483[_0xb00b('0x70')][_0xb00b('0x81')])){logger['info'](_0xb00b('0x82'),_0x76b483[_0xb00b('0x2b')],_0x76b483[_0xb00b('0x73')]);this[_0xb00b('0x11')][_0x76b483[_0xb00b('0x2b')]][_0xb00b('0x83')]=_0x76b483[_0xb00b('0x73')];}else if(this[_0xb00b('0x29')](_0x76b483[_0xb00b('0x70')][_0xb00b('0x84')])){logger['info']('[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s',_0x76b483[_0xb00b('0x2b')],_0x76b483[_0xb00b('0x73')]);this[_0xb00b('0x11')][_0x76b483['uniqueid']]['queue']=_0x76b483['value'];}else if(this[_0xb00b('0x29')](_0x76b483[_0xb00b('0x70')][_0xb00b('0x85')])){logger['info'](_0xb00b('0x86'),_0x76b483[_0xb00b('0x2b')],_0x76b483[_0xb00b('0x73')]);this[_0xb00b('0x11')][_0x76b483['uniqueid']][_0xb00b('0x87')]=_0x76b483[_0xb00b('0x73')];}}}else if(this[_0xb00b('0x29')](_0x76b483[_0xb00b('0x70')][_0xb00b('0x71')])){if(_0x76b483[_0xb00b('0x73')]){var _0x198e83=path[_0xb00b('0x88')](_0x76b483['value'])[_0xb00b('0x48')];logger[_0xb00b('0x22')](_0xb00b('0x72'),_0x198e83,_0x76b483[_0xb00b('0x73')]);this[_0xb00b('0x66')](_0x198e83,_0x76b483[_0xb00b('0x73')]);}}else if(this[_0xb00b('0x11')][_0x76b483[_0xb00b('0x2f')]]){if(this['isNotNull'](_0x76b483[_0xb00b('0x70')])){if(this[_0xb00b('0x29')](_0x76b483[_0xb00b('0x70')][_0xb00b('0x85')])){logger['info'](_0xb00b('0x86'),_0x76b483[_0xb00b('0x2f')],_0x76b483[_0xb00b('0x73')]);this[_0xb00b('0x11')][_0x76b483[_0xb00b('0x2f')]][_0xb00b('0x89')]=_0x76b483[_0xb00b('0x73')];}}}}}catch(_0x3184de){logger['error']('[%s][voiceCallReport][varset]',_0x76b483[_0xb00b('0x2b')],util[_0xb00b('0x25')](_0x3184de,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xb00b('0x26')]['syncHangup']=function(_0x3aa890){try{if(this[_0xb00b('0x29')](_0x3aa890)){logger[_0xb00b('0x3e')]('[%s][voiceCallReport][hangup]\x20event:',_0x3aa890[_0xb00b('0x2b')],util[_0xb00b('0x25')](_0x3aa890,{'showHidden':![],'depth':null}));if(this[_0xb00b('0x13')][_0x3aa890['linkedid']]){if(this['channels'][this[_0xb00b('0x13')][_0x3aa890['linkedid']][_0xb00b('0x2f')]]){this['channels'][this['blindTransfers'][_0x3aa890[_0xb00b('0x2f')]][_0xb00b('0x2f')]][_0xb00b('0x2b')]=_0x3aa890[_0xb00b('0x2b')];this[_0xb00b('0x11')][this['blindTransfers'][_0x3aa890[_0xb00b('0x2f')]]['linkedid']]['answered']=this[_0xb00b('0x11')][_0x3aa890[_0xb00b('0x2b')]][_0xb00b('0x5b')];this[_0xb00b('0x11')][this[_0xb00b('0x13')][_0x3aa890[_0xb00b('0x2f')]]['linkedid']][_0xb00b('0x5c')]=this['channels'][_0x3aa890[_0xb00b('0x2b')]][_0xb00b('0x5c')];this[_0xb00b('0x11')][this['blindTransfers'][_0x3aa890[_0xb00b('0x2f')]][_0xb00b('0x2f')]][_0xb00b('0x60')]=this[_0xb00b('0x11')][this['blindTransfers'][_0x3aa890['linkedid']][_0xb00b('0x2f')]]['channel'];this['channels'][this[_0xb00b('0x13')][_0x3aa890['linkedid']]['linkedid']][_0xb00b('0x44')]=this[_0xb00b('0x11')][_0x3aa890[_0xb00b('0x2b')]][_0xb00b('0x44')];this['channels'][_0x3aa890['uniqueid']]=this[_0xb00b('0x11')][this[_0xb00b('0x13')][_0x3aa890[_0xb00b('0x2f')]]['linkedid']];delete this['channels'][this[_0xb00b('0x13')][_0x3aa890['linkedid']]['linkedid']];}else if(this[_0xb00b('0x11')][this['blindTransfers'][_0x3aa890[_0xb00b('0x2f')]]['uniqueid']]){this[_0xb00b('0x11')][this['blindTransfers'][_0x3aa890[_0xb00b('0x2f')]][_0xb00b('0x2b')]][_0xb00b('0x2b')]=[this['channels'][this[_0xb00b('0x13')][_0x3aa890['linkedid']][_0xb00b('0x2b')]][_0xb00b('0x2f')],this['channels'][this['blindTransfers'][_0x3aa890['linkedid']]['uniqueid']][_0xb00b('0x2f')]=this['channels'][this[_0xb00b('0x13')][_0x3aa890['linkedid']][_0xb00b('0x2b')]][_0xb00b('0x2b')]][0x0];this[_0xb00b('0x11')][this[_0xb00b('0x13')][_0x3aa890[_0xb00b('0x2f')]]['uniqueid']][_0xb00b('0x5b')]=this[_0xb00b('0x11')][_0x3aa890[_0xb00b('0x2b')]][_0xb00b('0x5b')];this['channels'][this['blindTransfers'][_0x3aa890[_0xb00b('0x2f')]][_0xb00b('0x2b')]][_0xb00b('0x5c')]=this[_0xb00b('0x11')][_0x3aa890[_0xb00b('0x2b')]][_0xb00b('0x5c')];this[_0xb00b('0x11')][this[_0xb00b('0x13')][_0x3aa890[_0xb00b('0x2f')]]['uniqueid']][_0xb00b('0x60')]=this[_0xb00b('0x11')][this['blindTransfers'][_0x3aa890[_0xb00b('0x2f')]]['uniqueid']][_0xb00b('0x3b')];this[_0xb00b('0x11')][this['blindTransfers'][_0x3aa890['linkedid']][_0xb00b('0x2b')]][_0xb00b('0x44')]=this[_0xb00b('0x11')][_0x3aa890['uniqueid']][_0xb00b('0x44')];this[_0xb00b('0x11')][_0x3aa890[_0xb00b('0x2b')]]=this['channels'][this[_0xb00b('0x13')][_0x3aa890['linkedid']]['uniqueid']];delete this['channels'][this[_0xb00b('0x13')][_0x3aa890['linkedid']][_0xb00b('0x2b')]];}}if(this[_0xb00b('0x11')][_0x3aa890['uniqueid']]){logger['info'](_0xb00b('0x8a'),_0x3aa890[_0xb00b('0x2b')],_0x3aa890['cause-txt']);var _0x2f131e=moment();this[_0xb00b('0x11')][_0x3aa890[_0xb00b('0x2b')]][_0xb00b('0x8b')]=_0x2f131e[_0xb00b('0x38')](_0xb00b('0x43'));this['channels'][_0x3aa890[_0xb00b('0x2b')]][_0xb00b('0x50')]=_0x2f131e['diff'](this[_0xb00b('0x11')][_0x3aa890['uniqueid']]['starttime'],_0xb00b('0x51'));if(this['channels'][_0x3aa890[_0xb00b('0x2b')]][_0xb00b('0x5b')]){this[_0xb00b('0x11')][_0x3aa890['uniqueid']]['billableseconds']=_0x2f131e['diff'](this[_0xb00b('0x11')][_0x3aa890[_0xb00b('0x2b')]]['answertime'],_0xb00b('0x51'));this[_0xb00b('0x11')][_0x3aa890[_0xb00b('0x2b')]][_0xb00b('0x5d')]=this[_0xb00b('0x11')][_0x3aa890[_0xb00b('0x2b')]][_0xb00b('0x50')]-this[_0xb00b('0x11')][_0x3aa890['uniqueid']][_0xb00b('0x8c')];}if(_0x3aa890[_0xb00b('0x41')]===_0xb00b('0x33')){if(this['agents'][_0x3aa890['channel']['split']('-')[0x0]]){this[_0xb00b('0x12')][_0x3aa890[_0xb00b('0x3b')][_0xb00b('0x34')]('-')[0x0]]=_['omit'](this[_0xb00b('0x12')][_0x3aa890[_0xb00b('0x3b')][_0xb00b('0x34')]('-')[0x0]],[_0xb00b('0x36')]);logger[_0xb00b('0x3e')]('[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:',_0x3aa890[_0xb00b('0x2b')],util['inspect']({'id':this[_0xb00b('0x12')][_0x3aa890[_0xb00b('0x3b')][_0xb00b('0x34')]('-')[0x0]]['id'],'destaccountcode':this[_0xb00b('0x12')][_0x3aa890[_0xb00b('0x3b')][_0xb00b('0x34')]('-')[0x0]]['accountcode']},{'showHidden':![],'depth':null}));this[_0xb00b('0x28')](util[_0xb00b('0x38')](_0xb00b('0x39'),this[_0xb00b('0x12')][_0x3aa890[_0xb00b('0x3b')][_0xb00b('0x34')]('-')[0x0]][_0xb00b('0x48')]),_0xb00b('0x8d'),{'id':this[_0xb00b('0x12')][_0x3aa890[_0xb00b('0x3b')]['split']('-')[0x0]]['id'],'destaccountcode':this[_0xb00b('0x12')][_0x3aa890[_0xb00b('0x3b')]['split']('-')[0x0]][_0xb00b('0x47')]});for(var _0x5175c6=0x0;_0x5175c6<Object['keys'](this['agents'])[_0xb00b('0x8e')];_0x5175c6++){var _0x4d6930=Object[_0xb00b('0x32')](this[_0xb00b('0x12')])[_0x5175c6];var _0x237afa=this[_0xb00b('0x12')][_0x4d6930];if(_0x237afa[_0xb00b('0x47')]===Number(_0x3aa890[_0xb00b('0x37')])){this[_0xb00b('0x28')](util[_0xb00b('0x38')](_0xb00b('0x39'),_0x237afa[_0xb00b('0x48')]),_0xb00b('0x8d'),{'id':_0x237afa['id'],'destaccountcode':_0x237afa[_0xb00b('0x47')],'transfer':this[_0xb00b('0x11')][_0x3aa890[_0xb00b('0x2b')]]['transferType']});break;}}}}var _0x31d2f0=this;Promise[_0xb00b('0x8f')]()[_0xb00b('0x90')](function(){var _0x43350d=_0x31d2f0[_0xb00b('0x11')][_0x3aa890['uniqueid']];if(typeof _0x43350d[_0xb00b('0x91')]===_0xb00b('0x92'))return;if(_['isEmpty'](_0x43350d['monitors']))return;return RpcSetting[_0xb00b('0x93')]()[_0xb00b('0x90')](function(_0x2cb311){if(!_0x2cb311[_0xb00b('0x94')])return;return Promise[_0xb00b('0x8f')]()[_0xb00b('0x90')](function(){return ami[_0xb00b('0x95')]({'action':_0xb00b('0x96'),'channel':_0x43350d[_0xb00b('0x3b')]})[_0xb00b('0x97')](function(){});})[_0xb00b('0x90')](function(){return ami['Action']({'action':_0xb00b('0x96'),'channel':_0x43350d['destinationchannel']})[_0xb00b('0x97')](function(){})[_0xb00b('0x98')](function(){var _0x14420f=_0x31d2f0[_0xb00b('0x12')][_0x43350d[_0xb00b('0x60')][_0xb00b('0x34')]('-')[0x0]];if(!_0x14420f)return;io['emit'](_0xb00b('0x99'),{'agentId':_0x14420f['id'],'uniqueid':_0x43350d[_0xb00b('0x2b')]});});});});})[_0xb00b('0x90')](function(){if(_0x3aa890[_0xb00b('0x9a')]==='BlindTransfer'){_0x31d2f0[_0xb00b('0x13')][_0x3aa890[_0xb00b('0x2b')]]=_0x3aa890;}else{if(_0x31d2f0['channels'][_0x3aa890[_0xb00b('0x2b')]][_0xb00b('0x79')]===_0xb00b('0x9b')&&_0x31d2f0[_0xb00b('0x13')][_0x3aa890[_0xb00b('0x2b')]]){_0x31d2f0[_0xb00b('0x11')][_0x3aa890[_0xb00b('0x2b')]][_0xb00b('0x2b')]=[_0x31d2f0[_0xb00b('0x11')][_0x3aa890['uniqueid']][_0xb00b('0x2f')],_0x31d2f0[_0xb00b('0x11')][_0x3aa890['uniqueid']][_0xb00b('0x2f')]=_0x31d2f0[_0xb00b('0x11')][_0x3aa890[_0xb00b('0x2b')]][_0xb00b('0x2b')]][0x0];delete _0x31d2f0[_0xb00b('0x13')][_0x3aa890[_0xb00b('0x2b')]];}}logger[_0xb00b('0x3e')](_0xb00b('0x9c'),_0x3aa890[_0xb00b('0x2b')],util[_0xb00b('0x25')](_0x31d2f0[_0xb00b('0x11')][_0x3aa890['uniqueid']],{'showHidden':![],'depth':null}));ami[_0xb00b('0x28')](_0xb00b('0x9d'),_0x31d2f0[_0xb00b('0x11')][_0x3aa890['uniqueid']]);delete _0x31d2f0[_0xb00b('0x11')][_0x3aa890[_0xb00b('0x2b')]];});}}}catch(_0x3f0479){logger[_0xb00b('0x24')]('[%s][voiceCallReport][hangup]',_0x3aa890[_0xb00b('0x2b')],util[_0xb00b('0x25')](_0x3f0479,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype']['syncAttendedTransfer']=function(_0x249455){try{if(this[_0xb00b('0x29')](_0x249455)){logger['info'](_0xb00b('0x9e'),_0x249455['uniqueid'],_0x249455['origtransferercalleridnum'],_0x249455[_0xb00b('0x9f')]);logger['debug']('[%s][voiceCallReport][attendedtransfer]\x20event:',_0x249455[_0xb00b('0x2b')],util[_0xb00b('0x25')](_0x249455,{'showHidden':![],'depth':null}));var _0x37d3d1;if(this[_0xb00b('0x11')][_0x249455[_0xb00b('0xa0')]]){this[_0xb00b('0x11')][_0x249455[_0xb00b('0xa0')]][_0xb00b('0xa1')]=_0x249455[_0xb00b('0xa2')];this[_0xb00b('0x11')][_0x249455[_0xb00b('0xa0')]][_0xb00b('0xa3')]=_0x249455[_0xb00b('0x9f')];if(this[_0xb00b('0x11')][_0x249455['secondtransfereruniqueid']]){_0x37d3d1=this[_0xb00b('0x11')][_0x249455[_0xb00b('0xa4')]];this['channels'][_0x249455[_0xb00b('0xa4')]]=this['channels'][_0x249455[_0xb00b('0xa0')]];this[_0xb00b('0x11')][_0x249455[_0xb00b('0xa0')]]=_0x37d3d1;}this['channels'][_0x249455[_0xb00b('0xa4')]][_0xb00b('0x91')]='ATTENDED';}else if(this[_0xb00b('0x11')][_0x249455[_0xb00b('0xa5')]]){this[_0xb00b('0x11')][_0x249455[_0xb00b('0xa5')]]['transfercalleridnum']=_0x249455[_0xb00b('0xa2')];this[_0xb00b('0x11')][_0x249455[_0xb00b('0xa5')]]['transferconnectedlinenum']=_0x249455['transfertargetcalleridnum'];if(this['channels'][_0x249455[_0xb00b('0xa6')]]){_0x37d3d1=this[_0xb00b('0x11')][_0x249455[_0xb00b('0xa6')]];this[_0xb00b('0x11')][_0x249455[_0xb00b('0xa6')]]=this[_0xb00b('0x11')][_0x249455[_0xb00b('0xa5')]];this[_0xb00b('0x11')][_0x249455[_0xb00b('0xa5')]]=_0x37d3d1;}this['channels'][_0x249455['transfertargetuniqueid']][_0xb00b('0x91')]=_0xb00b('0xa7');}if((this['channels'][_0x249455[_0xb00b('0xa6')]]||this['channels'][_0x249455[_0xb00b('0xa8')]])&&this['channels'][_0x249455[_0xb00b('0xa4')]]){var _0x1425da=_['some']([this[_0xb00b('0x11')][_0x249455[_0xb00b('0xa6')]],this['channels'][_0x249455[_0xb00b('0xa8')]],this['channels'][_0x249455[_0xb00b('0xa4')]]],function(_0x24a84c){return _0x24a84c&&_0x24a84c[_0xb00b('0x79')]===_0xb00b('0x9b')&&_0x24a84c[_0xb00b('0xa9')];});if(_0x1425da){if(this[_0xb00b('0x11')][_0x249455[_0xb00b('0xa6')]])this[_0xb00b('0x11')][_0x249455[_0xb00b('0xa6')]][_0xb00b('0x91')]='ATTENDED';if(this['channels'][_0x249455[_0xb00b('0xa8')]])this['channels'][_0x249455[_0xb00b('0xa8')]]['transferType']=_0xb00b('0xa7');this[_0xb00b('0x11')][_0x249455['secondtransfereruniqueid']][_0xb00b('0x91')]='ATTENDED';}}}}catch(_0x3196ae){logger[_0xb00b('0x24')]('[%s][voiceCallReport][attendedtransfer]',_0x249455[_0xb00b('0x2b')],util[_0xb00b('0x25')](_0x3196ae,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xb00b('0x26')][_0xb00b('0xaa')]=function(_0x278dd0){try{if(this['isNotNull'](_0x278dd0)){logger[_0xb00b('0x22')](_0xb00b('0xab'),_0x278dd0['uniqueid'],_0x278dd0['transfereecalleridnum'],_0x278dd0[_0xb00b('0xac')]);logger['debug']('[%s][voiceCallReport][blindtransfer]\x20event:',_0x278dd0['uniqueid'],util[_0xb00b('0x25')](_0x278dd0,{'showHidden':![],'depth':null}));if(this[_0xb00b('0x11')][_0x278dd0[_0xb00b('0xa0')]]){this[_0xb00b('0x11')][_0x278dd0['transfereeuniqueid']][_0xb00b('0xa1')]=_0x278dd0['transfereecalleridnum'];this[_0xb00b('0x11')][_0x278dd0[_0xb00b('0xa0')]][_0xb00b('0xa3')]=_0x278dd0[_0xb00b('0xac')];this['channels'][_0x278dd0[_0xb00b('0xa0')]][_0xb00b('0x91')]='BLIND';this[_0xb00b('0x1b')]({'event':_0xb00b('0xad'),'uniqueid':_0x278dd0[_0xb00b('0xa0')],'linkedid':_0x278dd0['transfereruniqueid'],'context':_0x278dd0['context'],'channel':_0x278dd0[_0xb00b('0xae')]});}else{this[_0xb00b('0x11')][_0x278dd0[_0xb00b('0xaf')]][_0xb00b('0x91')]=_0xb00b('0xb0');this[_0xb00b('0x1b')]({'event':_0xb00b('0xad'),'uniqueid':_0x278dd0['transfereruniqueid'],'linkedid':_0x278dd0['transfereeuniqueid'],'context':_0x278dd0[_0xb00b('0x41')],'channel':_0x278dd0['transfererchannel']});}}}catch(_0x50b0ae){logger[_0xb00b('0x24')](_0xb00b('0xb1'),_0x278dd0['uniqueid'],util[_0xb00b('0x25')](_0x50b0ae,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xb00b('0x26')][_0xb00b('0x20')]=function(_0x4b33fd){try{if(this[_0xb00b('0x29')](_0x4b33fd)){logger[_0xb00b('0x3e')](_0xb00b('0xb2'),_0x4b33fd[_0xb00b('0x2b')],util[_0xb00b('0x25')](_0x4b33fd,{'showHidden':![],'depth':null}));if(this[_0xb00b('0x11')][_0x4b33fd[_0xb00b('0x2b')]]){if(!_['isNil'](this[_0xb00b('0x11')][_0x4b33fd[_0xb00b('0x2b')]]['answertime'])){this['channels'][_0x4b33fd['uniqueid']][_0xb00b('0xb3')]=moment()[_0xb00b('0x38')](_0xb00b('0x43'));logger[_0xb00b('0x22')](_0xb00b('0xb4'),_0x4b33fd[_0xb00b('0x2b')],this[_0xb00b('0x11')][_0x4b33fd['uniqueid']]['mohstarttime']);}}}}catch(_0x1290d9){logger[_0xb00b('0x24')]('[%s][voiceCallReport][musiconholdstart]',_0x4b33fd[_0xb00b('0x2b')],util[_0xb00b('0x25')](_0x1290d9,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xb00b('0x21')]=function(_0x5ade48){try{if(this[_0xb00b('0x29')](_0x5ade48)){logger['debug']('[%s][voiceCallReport][musiconholdstop]\x20event:',_0x5ade48['uniqueid'],util[_0xb00b('0x25')](_0x5ade48,{'showHidden':![],'depth':null}));if(this[_0xb00b('0x11')][_0x5ade48[_0xb00b('0x2b')]]){if(!_[_0xb00b('0x58')](this['channels'][_0x5ade48[_0xb00b('0x2b')]][_0xb00b('0xb3')])){this[_0xb00b('0x11')][_0x5ade48[_0xb00b('0x2b')]][_0xb00b('0xb5')]+=moment()[_0xb00b('0xb6')](0x0)[_0xb00b('0x5e')](this[_0xb00b('0x11')][_0x5ade48[_0xb00b('0x2b')]][_0xb00b('0xb3')],'seconds');logger['info'](_0xb00b('0xb7'),_0x5ade48[_0xb00b('0x2b')],this[_0xb00b('0x11')][_0x5ade48[_0xb00b('0x2b')]][_0xb00b('0xb5')]);delete this[_0xb00b('0x11')][_0x5ade48[_0xb00b('0x2b')]][_0xb00b('0xb3')];}}}}catch(_0x2bba6e){logger['error'](_0xb00b('0xb8'),_0x5ade48[_0xb00b('0x2b')],util[_0xb00b('0x25')](_0x2bba6e,{'showHidden':![],'depth':null}));}};module[_0xb00b('0xb9')]=VoiceCallReport;
\ No newline at end of file
index deda83b..f249d85 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5fab=['[%s][voiceDialReport][hangup]','[%s][voiceDialReport][newexten]\x20event:','application','set','applicationdata','appdata','toLowerCase','startsWith','[%s][voiceDialReport][newexten]\x20application:%s\x20appdata:%s','split','match','exports','lodash','moment','ioredis','../../../config/environment','../../../config/logger','ami','../ami','redis','defaults','localhost','socket.io-emitter','channels','outboundChannels','outbound','applications','variables','dialbegin','dialend','syncDialEnd','bind','varset','syncVarSet','hangup','syncHangup','isNotNull','prototype','emit','debug','[%s][voiceDialReport][dialbegin]\x20event:','uniqueid','merge','format','YYYY-MM-DD\x20HH:mm:ss','called','channel','substring','lastIndexOf','omit','event','info','[%s][voiceDialReport][dialbegin]\x20agent:%s\x20interface:%s\x20lastevent:called','membername','interface','[%s][voiceDialReport][dialbegin]\x20sending\x20voice_outbound_channel:save\x20event:','inspect','voice:outbound','voice_outbound_channel:save','[%s][voiceDialReport][dialbegin]\x20sending\x20dialbegin\x20event:','custom:dialbegin','error','[%s][voiceDialReport][dialbegin]','[%s][voiceDialReport][dialend]\x20event:','dialstatus','ANSWER','connectedlinenum','connectedlinename','answertime','lastevent','[%s][voiceDialReport][dialend]\x20agent:%s\x20lastevent:connect','[%s][voiceDialReport][dialend]\x20sending\x20dialconnect\x20event:','custom:dialconnect','[%s][voiceDialReport][dialend]','[%s][voiceDialReport][varset]\x20event:','addVariable','keys','variable','isUndefined','value','voice','[%s][voiceDialReport][varset]\x20outboundrouteid:%s\x20variable:%s\x20value:%s','outboundrouteid','[%s][voiceDialReport][varset]\x20sending\x20voice_outbound_channel:save\x20event:','[%s][voiceDialReport][varset]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrttbridged','sipuri','bridgepeer','bridgepvtcallid','memberdynamic','memberinterface','memberpenalty','memberrealtime','isNil','includes','[%s][voiceDialReport][hangup]\x20event:','[%s][voiceDialReport][hangup]\x20reason:%s\x20lasteevent:complete','cause-txt','endtime','diff','starttime','seconds','complete','total','holdtime','billableseconds','sumHoldTime','sumBillable','duration','[%s][voiceDialReport][hangup]\x20sending\x20dialend\x20event:','custom:dialend','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound:save\x20event:','[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event','stringify','linkedid'];(function(_0x31e5cb,_0x2f5adf){var _0x4170df=function(_0x31c53e){while(--_0x31c53e){_0x31e5cb['push'](_0x31e5cb['shift']());}};_0x4170df(++_0x2f5adf);}(_0x5fab,0x177));var _0xb5fa=function(_0x2c4d22,_0x4ca120){_0x2c4d22=_0x2c4d22-0x0;var _0x1f0537=_0x5fab[_0x2c4d22];return _0x1f0537;};'use strict';var _=require(_0xb5fa('0x0'));var moment=require(_0xb5fa('0x1'));var util=require('util');var Redis=require(_0xb5fa('0x2'));var config=require(_0xb5fa('0x3'));var logger=require(_0xb5fa('0x4'))(_0xb5fa('0x5'));var ami=require(_0xb5fa('0x6'));config[_0xb5fa('0x7')]=_[_0xb5fa('0x8')](config[_0xb5fa('0x7')],{'host':_0xb5fa('0x9'),'port':0x18eb});var io=require(_0xb5fa('0xa'))(new Redis(config['redis']));function VoiceDialReport(_0x5d70f6){this[_0xb5fa('0xb')]=_0x5d70f6[_0xb5fa('0xc')];this[_0xb5fa('0xd')]=_0x5d70f6['outbound'];this[_0xb5fa('0xe')]={};this[_0xb5fa('0xf')]={};ami['on'](_0xb5fa('0x10'),this['syncDialBegin']['bind'](this));ami['on'](_0xb5fa('0x11'),this[_0xb5fa('0x12')][_0xb5fa('0x13')](this));ami['on'](_0xb5fa('0x14'),this[_0xb5fa('0x15')][_0xb5fa('0x13')](this));ami['on'](_0xb5fa('0x16'),this[_0xb5fa('0x17')][_0xb5fa('0x13')](this));}VoiceDialReport['prototype'][_0xb5fa('0x18')]=function(_0x3dad4d){return _0x3dad4d!==null&&!_['isUndefined'](_0x3dad4d);};VoiceDialReport[_0xb5fa('0x19')]['emit']=function(_0x265992,_0x3fc372,_0x40c914){io['to'](_0x265992)[_0xb5fa('0x1a')](_0x3fc372,_0x40c914);};VoiceDialReport[_0xb5fa('0x19')]['syncDialBegin']=function(_0x567f31){try{if(this[_0xb5fa('0x18')](_0x567f31)){logger[_0xb5fa('0x1b')](_0xb5fa('0x1c'),_0x567f31[_0xb5fa('0x1d')],util['inspect'](_0x567f31,{'showHidden':![],'depth':null}));if(this['channels'][_0x567f31[_0xb5fa('0x1d')]]){_[_0xb5fa('0x1e')](this[_0xb5fa('0xb')][_0x567f31[_0xb5fa('0x1d')]],{'starttime':moment()[_0xb5fa('0x1f')](_0xb5fa('0x20')),'lastevent':_0xb5fa('0x21'),'interface':_0x567f31[_0xb5fa('0x22')][_0xb5fa('0x23')](0x0,_0x567f31[_0xb5fa('0x22')][_0xb5fa('0x24')]('-')),'membername':_0x567f31[_0xb5fa('0x22')]['substring'](_0x567f31[_0xb5fa('0x22')]['lastIndexOf']('/')+0x1,_0x567f31[_0xb5fa('0x22')]['lastIndexOf']('-'))},_[_0xb5fa('0x25')](_0x567f31,[_0xb5fa('0x26'),'privilege']));logger[_0xb5fa('0x27')](_0xb5fa('0x28'),_0x567f31[_0xb5fa('0x1d')],this['channels'][_0x567f31[_0xb5fa('0x1d')]][_0xb5fa('0x29')],this[_0xb5fa('0xb')][_0x567f31['uniqueid']][_0xb5fa('0x2a')]);logger['debug'](_0xb5fa('0x2b'),_0x567f31[_0xb5fa('0x1d')],util[_0xb5fa('0x2c')](this[_0xb5fa('0xb')][_0x567f31[_0xb5fa('0x1d')]],{'showHidden':![],'depth':null}));if(this[_0xb5fa('0xe')][_0x567f31[_0xb5fa('0x1d')]])_[_0xb5fa('0x1e')](this['channels'][_0x567f31['uniqueid']],this['applications'][_0x567f31['uniqueid']]);this[_0xb5fa('0x1a')](_0xb5fa('0x2d'),_0xb5fa('0x2e'),this[_0xb5fa('0xb')][_0x567f31[_0xb5fa('0x1d')]]);logger[_0xb5fa('0x1b')](_0xb5fa('0x2f'),_0x567f31[_0xb5fa('0x1d')],util[_0xb5fa('0x2c')](this[_0xb5fa('0xb')][_0x567f31[_0xb5fa('0x1d')]],{'showHidden':![],'depth':null}));ami[_0xb5fa('0x1a')](_0xb5fa('0x30'),this[_0xb5fa('0xb')][_0x567f31[_0xb5fa('0x1d')]]);}}}catch(_0x116773){logger[_0xb5fa('0x31')](_0xb5fa('0x32'),_0x567f31[_0xb5fa('0x1d')],util[_0xb5fa('0x2c')](_0x116773,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xb5fa('0x19')][_0xb5fa('0x12')]=function(_0x10fb43){try{if(this[_0xb5fa('0x18')](_0x10fb43)){logger['debug'](_0xb5fa('0x33'),_0x10fb43['uniqueid'],util['inspect'](_0x10fb43,{'showHidden':![],'depth':null}));if(this['channels'][_0x10fb43[_0xb5fa('0x1d')]]){this['channels'][_0x10fb43[_0xb5fa('0x1d')]]['dialstatus']=_0x10fb43['dialstatus'];if(_0x10fb43[_0xb5fa('0x34')]===_0xb5fa('0x35')){this['channels'][_0x10fb43['uniqueid']][_0xb5fa('0x36')]=_0x10fb43[_0xb5fa('0x36')];this[_0xb5fa('0xb')][_0x10fb43['uniqueid']][_0xb5fa('0x37')]=_0x10fb43[_0xb5fa('0x37')];this['channels'][_0x10fb43[_0xb5fa('0x1d')]][_0xb5fa('0x38')]=moment()[_0xb5fa('0x1f')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xb5fa('0xb')][_0x10fb43[_0xb5fa('0x1d')]][_0xb5fa('0x39')]='connect';logger[_0xb5fa('0x27')](_0xb5fa('0x3a'),_0x10fb43[_0xb5fa('0x1d')],_0x10fb43[_0xb5fa('0x22')]['substring'](_0x10fb43['channel']['lastIndexOf']('/')+0x1,_0x10fb43['channel']['lastIndexOf']('-')));logger['debug'](_0xb5fa('0x3b'),_0x10fb43['uniqueid'],util[_0xb5fa('0x2c')](this[_0xb5fa('0xb')][_0x10fb43[_0xb5fa('0x1d')]],{'showHidden':![],'depth':null}));ami[_0xb5fa('0x1a')](_0xb5fa('0x3c'),this[_0xb5fa('0xb')][_0x10fb43['uniqueid']]);}logger['debug']('[%s][voiceDialReport][dialend]\x20sending\x20voice_outbound_channel:save\x20event:',_0x10fb43[_0xb5fa('0x1d')],util['inspect'](this[_0xb5fa('0xb')][_0x10fb43['uniqueid']],{'showHidden':![],'depth':null}));this['emit'](_0xb5fa('0x2d'),_0xb5fa('0x2e'),this[_0xb5fa('0xb')][_0x10fb43[_0xb5fa('0x1d')]]);}}}catch(_0x5bc93f){logger[_0xb5fa('0x31')](_0xb5fa('0x3d'),_0x10fb43[_0xb5fa('0x1d')],util[_0xb5fa('0x2c')](_0x5bc93f,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xb5fa('0x19')]['syncVarSet']=function(_0x284bbb){try{if(this['isNotNull'](_0x284bbb)){logger[_0xb5fa('0x1b')](_0xb5fa('0x3e'),_0x284bbb[_0xb5fa('0x1d')],util[_0xb5fa('0x2c')](_0x284bbb,{'showHidden':![],'depth':null}));this[_0xb5fa('0x3f')](_0x284bbb[_0xb5fa('0x1d')],_[_0xb5fa('0x40')](_0x284bbb[_0xb5fa('0x41')])[0x0],_0x284bbb['value']);if(this[_0xb5fa('0x18')](_0x284bbb[_0xb5fa('0x41')])&&this['isNotNull'](_0x284bbb[_0xb5fa('0x41')]['outboundrouteid'])){if(_[_0xb5fa('0x42')](this[_0xb5fa('0xb')][_0x284bbb['uniqueid']])){this['channels'][_0x284bbb[_0xb5fa('0x1d')]]={'routeId':_0x284bbb[_0xb5fa('0x43')],'variables':this[_0xb5fa('0xf')][_0x284bbb[_0xb5fa('0x1d')]],'motionChannel':_0xb5fa('0x44')};logger[_0xb5fa('0x27')](_0xb5fa('0x45'),_0x284bbb[_0xb5fa('0x1d')],_0x284bbb['variable'][_0xb5fa('0x46')],_[_0xb5fa('0x40')](_0x284bbb['variable'])[0x0],_0x284bbb[_0xb5fa('0x43')]);logger[_0xb5fa('0x1b')](_0xb5fa('0x47'),_0x284bbb[_0xb5fa('0x1d')],util[_0xb5fa('0x2c')](this[_0xb5fa('0xb')][_0x284bbb[_0xb5fa('0x1d')]],{'showHidden':![],'depth':null}));this[_0xb5fa('0x1a')](_0xb5fa('0x2d'),_0xb5fa('0x2e'),this[_0xb5fa('0xb')][_0x284bbb[_0xb5fa('0x1d')]]);}}}}catch(_0x6ae261){logger[_0xb5fa('0x31')](_0xb5fa('0x48'),_0x284bbb[_0xb5fa('0x1d')],util['inspect'](_0x6ae261,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype'][_0xb5fa('0x3f')]=function(_0x55268f,_0x14fbb0,_0x1049d9){var _0x5404f6=[_0xb5fa('0x49'),_0xb5fa('0x4a'),_0xb5fa('0x4b'),_0xb5fa('0x4c'),_0xb5fa('0x4d'),_0xb5fa('0x4e'),'rtpaudioqosrtt',_0xb5fa('0x4f'),'sipcallid',_0xb5fa('0x50'),_0xb5fa('0x51'),_0xb5fa('0x52'),'membercalls',_0xb5fa('0x53'),_0xb5fa('0x54'),'memberlastcall','membername',_0xb5fa('0x55'),_0xb5fa('0x56')];if(!_[_0xb5fa('0x57')](_0x14fbb0)&&!_[_0xb5fa('0x58')](_0x5404f6,_0x14fbb0)){if(_[_0xb5fa('0x42')](this[_0xb5fa('0xf')][_0x55268f])){this[_0xb5fa('0xf')][_0x55268f]={};}this[_0xb5fa('0xf')][_0x55268f][_0x14fbb0]=_0x1049d9;}};VoiceDialReport[_0xb5fa('0x19')][_0xb5fa('0x17')]=function(_0x25de19){try{if(this[_0xb5fa('0x18')](_0x25de19)){logger[_0xb5fa('0x1b')](_0xb5fa('0x59'),_0x25de19[_0xb5fa('0x1d')],util[_0xb5fa('0x2c')](_0x25de19,{'showHidden':![],'depth':null}));if(this[_0xb5fa('0xb')][_0x25de19[_0xb5fa('0x1d')]]){logger['info'](_0xb5fa('0x5a'),_0x25de19[_0xb5fa('0x1d')],_0x25de19[_0xb5fa('0x5b')]);this[_0xb5fa('0xb')][_0x25de19[_0xb5fa('0x1d')]][_0xb5fa('0x5c')]=moment()[_0xb5fa('0x1f')](_0xb5fa('0x20'));this[_0xb5fa('0xb')][_0x25de19[_0xb5fa('0x1d')]]['duration']=moment(this['channels'][_0x25de19[_0xb5fa('0x1d')]][_0xb5fa('0x5c')])[_0xb5fa('0x5d')](this['channels'][_0x25de19[_0xb5fa('0x1d')]][_0xb5fa('0x5e')],_0xb5fa('0x5f'));this[_0xb5fa('0xb')][_0x25de19[_0xb5fa('0x1d')]][_0xb5fa('0x39')]=_0xb5fa('0x60');this['outbound'][_0xb5fa('0x61')]+=0x1;if(this[_0xb5fa('0xb')][_0x25de19['uniqueid']][_0xb5fa('0x38')]){this[_0xb5fa('0xd')]['answered']+=0x1;this[_0xb5fa('0xb')][_0x25de19[_0xb5fa('0x1d')]][_0xb5fa('0x62')]=moment(this[_0xb5fa('0xb')][_0x25de19[_0xb5fa('0x1d')]][_0xb5fa('0x38')])[_0xb5fa('0x5d')](this[_0xb5fa('0xb')][_0x25de19[_0xb5fa('0x1d')]][_0xb5fa('0x5e')],_0xb5fa('0x5f'));this[_0xb5fa('0xb')][_0x25de19[_0xb5fa('0x1d')]][_0xb5fa('0x63')]=moment(this[_0xb5fa('0xb')][_0x25de19[_0xb5fa('0x1d')]][_0xb5fa('0x5c')])[_0xb5fa('0x5d')](this[_0xb5fa('0xb')][_0x25de19[_0xb5fa('0x1d')]][_0xb5fa('0x38')],_0xb5fa('0x5f'));this['outbound'][_0xb5fa('0x64')]+=this[_0xb5fa('0xb')][_0x25de19[_0xb5fa('0x1d')]]['holdtime']||0x0;this[_0xb5fa('0xd')][_0xb5fa('0x65')]+=this['channels'][_0x25de19[_0xb5fa('0x1d')]][_0xb5fa('0x63')];}this[_0xb5fa('0xd')]['sumDuration']+=this['channels'][_0x25de19[_0xb5fa('0x1d')]][_0xb5fa('0x66')];logger[_0xb5fa('0x1b')]('[%s][voiceDialReport][hangup]\x20sending\x20voiceDialReport\x20event:',_0x25de19[_0xb5fa('0x1d')],util[_0xb5fa('0x2c')](this[_0xb5fa('0xb')][_0x25de19[_0xb5fa('0x1d')]],{'showHidden':![],'depth':null}));ami['emit']('custom:voiceDialReport',this['channels'][_0x25de19[_0xb5fa('0x1d')]]);logger[_0xb5fa('0x1b')](_0xb5fa('0x67'),_0x25de19['uniqueid'],util[_0xb5fa('0x2c')](this[_0xb5fa('0xb')][_0x25de19[_0xb5fa('0x1d')]],{'showHidden':![],'depth':null}));ami[_0xb5fa('0x1a')](_0xb5fa('0x68'),this[_0xb5fa('0xb')][_0x25de19[_0xb5fa('0x1d')]]);logger[_0xb5fa('0x1b')](_0xb5fa('0x69'),_0x25de19[_0xb5fa('0x1d')],util[_0xb5fa('0x2c')](this[_0xb5fa('0xb')][_0x25de19[_0xb5fa('0x1d')]],{'showHidden':![],'depth':null}));this[_0xb5fa('0x1a')](_0xb5fa('0x2d'),'voice_outbound:save',this[_0xb5fa('0xd')]);logger['info'](_0xb5fa('0x6a'),JSON[_0xb5fa('0x6b')](this[_0xb5fa('0xb')][_0x25de19[_0xb5fa('0x1d')]]));logger[_0xb5fa('0x1b')]('[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound_channel:remove\x20event:',_0x25de19[_0xb5fa('0x1d')],util['inspect'](this[_0xb5fa('0xb')][_0x25de19[_0xb5fa('0x1d')]],{'showHidden':![],'depth':null}));this[_0xb5fa('0x1a')](_0xb5fa('0x2d'),'voice_outbound_channel:remove',this['channels'][_0x25de19['uniqueid']]);delete this[_0xb5fa('0xb')][_0x25de19[_0xb5fa('0x1d')]];}else if(this[_0xb5fa('0xb')][_0x25de19[_0xb5fa('0x6c')]]){this[_0xb5fa('0xb')][_0x25de19[_0xb5fa('0x6c')]]['uniqueid']=this[_0xb5fa('0xb')][_0x25de19['linkedid']]['destuniqueid'];}if(this[_0xb5fa('0xf')][_0x25de19['uniqueid']]){delete this['variables'][_0x25de19['uniqueid']];}}}catch(_0x193e63){logger['error'](_0xb5fa('0x6d'),_0x25de19[_0xb5fa('0x1d')],util[_0xb5fa('0x2c')](_0x193e63,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype']['syncNewExten']=function(_0xb1fcac){try{if(this[_0xb5fa('0x18')](_0xb1fcac)){logger['debug'](_0xb5fa('0x6e'),_0xb1fcac[_0xb5fa('0x1d')],util[_0xb5fa('0x2c')](_0xb1fcac,{'showHidden':![],'depth':null}));if(_0xb1fcac[_0xb5fa('0x6f')]['toLowerCase']()===_0xb5fa('0x70')){_0xb1fcac[_0xb5fa('0x71')]=(_0xb1fcac[_0xb5fa('0x72')]||_0xb1fcac[_0xb5fa('0x71')])[_0xb5fa('0x73')]();if(_[_0xb5fa('0x74')](_0xb1fcac[_0xb5fa('0x71')],'cdr(')){if(_[_0xb5fa('0x42')](this['applications'][_0xb1fcac[_0xb5fa('0x1d')]]))this[_0xb5fa('0xe')][_0xb1fcac['uniqueid']]={};logger[_0xb5fa('0x27')](_0xb5fa('0x75'),_0xb1fcac[_0xb5fa('0x1d')],_0xb1fcac[_0xb5fa('0x6f')],_0xb1fcac[_0xb5fa('0x71')]);var _0x8ce5b8=_0xb1fcac[_0xb5fa('0x71')][_0xb5fa('0x76')]('=');var _0x4b1135=_0x8ce5b8[0x0][_0xb5fa('0x77')](/cdr\((.*)\)/);if(_0x4b1135)this[_0xb5fa('0xe')][_0xb1fcac[_0xb5fa('0x1d')]][_0x4b1135[0x1]]=_0x8ce5b8[0x1];}}}}catch(_0x20ffa1){logger['error']('[%s][voiceDialReport][newexten]',_0xb1fcac['uniqueid'],util['inspect'](_0x20ffa1,{'showHidden':![],'depth':null}));}};module[_0xb5fa('0x78')]=VoiceDialReport;
\ No newline at end of file
+var _0x71ab=['syncDialBegin','dialend','bind','varset','syncVarSet','hangup','isUndefined','prototype','emit','isNotNull','debug','[%s][voiceDialReport][dialbegin]\x20event:','uniqueid','inspect','merge','format','YYYY-MM-DD\x20HH:mm:ss','called','channel','substring','lastIndexOf','omit','privilege','info','[%s][voiceDialReport][dialbegin]\x20agent:%s\x20interface:%s\x20lastevent:called','membername','interface','[%s][voiceDialReport][dialbegin]\x20sending\x20voice_outbound_channel:save\x20event:','voice:outbound','voice_outbound_channel:save','[%s][voiceDialReport][dialbegin]\x20sending\x20dialbegin\x20event:','error','syncDialEnd','[%s][voiceDialReport][dialend]\x20event:','dialstatus','ANSWER','connectedlinenum','connectedlinename','answertime','connect','[%s][voiceDialReport][dialend]\x20agent:%s\x20lastevent:connect','[%s][voiceDialReport][dialend]\x20sending\x20dialconnect\x20event:','custom:dialconnect','[%s][voiceDialReport][dialend]\x20sending\x20voice_outbound_channel:save\x20event:','[%s][voiceDialReport][dialend]','addVariable','keys','variable','value','outboundrouteid','voice','[%s][voiceDialReport][varset]\x20outboundrouteid:%s\x20variable:%s\x20value:%s','[%s][voiceDialReport][varset]\x20sending\x20voice_outbound_channel:save\x20event:','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrttbridged','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberlastcall','memberpenalty','memberrealtime','syncHangup','[%s][voiceDialReport][hangup]\x20event:','[%s][voiceDialReport][hangup]\x20reason:%s\x20lasteevent:complete','cause-txt','endtime','diff','starttime','seconds','total','sumHoldTime','holdtime','billableseconds','sumDuration','[%s][voiceDialReport][hangup]\x20sending\x20voiceDialReport\x20event:','[%s][voiceDialReport][hangup]\x20sending\x20dialend\x20event:','custom:dialend','voice_outbound:save','[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event','stringify','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound_channel:remove\x20event:','voice_outbound_channel:remove','linkedid','destuniqueid','syncNewExten','application','toLowerCase','applicationdata','startsWith','cdr(','split','match','[%s][voiceDialReport][newexten]','exports','moment','ioredis','../../../config/logger','ami','../ami','redis','defaults','localhost','socket.io-emitter','channels','outboundChannels','outbound','applications','variables','dialbegin'];(function(_0x46e7ef,_0x33e840){var _0x191e21=function(_0x349257){while(--_0x349257){_0x46e7ef['push'](_0x46e7ef['shift']());}};_0x191e21(++_0x33e840);}(_0x71ab,0x64));var _0xb71a=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x71ab[_0x3e5086];return _0xfeb102;};'use strict';var _=require('lodash');var moment=require(_0xb71a('0x0'));var util=require('util');var Redis=require(_0xb71a('0x1'));var config=require('../../../config/environment');var logger=require(_0xb71a('0x2'))(_0xb71a('0x3'));var ami=require(_0xb71a('0x4'));config[_0xb71a('0x5')]=_[_0xb71a('0x6')](config[_0xb71a('0x5')],{'host':_0xb71a('0x7'),'port':0x18eb});var io=require(_0xb71a('0x8'))(new Redis(config[_0xb71a('0x5')]));function VoiceDialReport(_0x35a84e){this[_0xb71a('0x9')]=_0x35a84e[_0xb71a('0xa')];this[_0xb71a('0xb')]=_0x35a84e[_0xb71a('0xb')];this[_0xb71a('0xc')]={};this[_0xb71a('0xd')]={};ami['on'](_0xb71a('0xe'),this[_0xb71a('0xf')]['bind'](this));ami['on'](_0xb71a('0x10'),this['syncDialEnd'][_0xb71a('0x11')](this));ami['on'](_0xb71a('0x12'),this[_0xb71a('0x13')]['bind'](this));ami['on'](_0xb71a('0x14'),this['syncHangup'][_0xb71a('0x11')](this));}VoiceDialReport['prototype']['isNotNull']=function(_0x3346a5){return _0x3346a5!==null&&!_[_0xb71a('0x15')](_0x3346a5);};VoiceDialReport[_0xb71a('0x16')][_0xb71a('0x17')]=function(_0x483d77,_0x47ee48,_0x5364e3){io['to'](_0x483d77)[_0xb71a('0x17')](_0x47ee48,_0x5364e3);};VoiceDialReport[_0xb71a('0x16')][_0xb71a('0xf')]=function(_0x42fc55){try{if(this[_0xb71a('0x18')](_0x42fc55)){logger[_0xb71a('0x19')](_0xb71a('0x1a'),_0x42fc55[_0xb71a('0x1b')],util[_0xb71a('0x1c')](_0x42fc55,{'showHidden':![],'depth':null}));if(this['channels'][_0x42fc55[_0xb71a('0x1b')]]){_[_0xb71a('0x1d')](this[_0xb71a('0x9')][_0x42fc55[_0xb71a('0x1b')]],{'starttime':moment()[_0xb71a('0x1e')](_0xb71a('0x1f')),'lastevent':_0xb71a('0x20'),'interface':_0x42fc55[_0xb71a('0x21')][_0xb71a('0x22')](0x0,_0x42fc55[_0xb71a('0x21')][_0xb71a('0x23')]('-')),'membername':_0x42fc55['channel']['substring'](_0x42fc55[_0xb71a('0x21')][_0xb71a('0x23')]('/')+0x1,_0x42fc55['channel']['lastIndexOf']('-'))},_[_0xb71a('0x24')](_0x42fc55,['event',_0xb71a('0x25')]));logger[_0xb71a('0x26')](_0xb71a('0x27'),_0x42fc55[_0xb71a('0x1b')],this[_0xb71a('0x9')][_0x42fc55[_0xb71a('0x1b')]][_0xb71a('0x28')],this[_0xb71a('0x9')][_0x42fc55['uniqueid']][_0xb71a('0x29')]);logger[_0xb71a('0x19')](_0xb71a('0x2a'),_0x42fc55[_0xb71a('0x1b')],util[_0xb71a('0x1c')](this[_0xb71a('0x9')][_0x42fc55[_0xb71a('0x1b')]],{'showHidden':![],'depth':null}));if(this[_0xb71a('0xc')][_0x42fc55[_0xb71a('0x1b')]])_[_0xb71a('0x1d')](this[_0xb71a('0x9')][_0x42fc55[_0xb71a('0x1b')]],this[_0xb71a('0xc')][_0x42fc55['uniqueid']]);this[_0xb71a('0x17')](_0xb71a('0x2b'),_0xb71a('0x2c'),this[_0xb71a('0x9')][_0x42fc55[_0xb71a('0x1b')]]);logger[_0xb71a('0x19')](_0xb71a('0x2d'),_0x42fc55[_0xb71a('0x1b')],util[_0xb71a('0x1c')](this[_0xb71a('0x9')][_0x42fc55[_0xb71a('0x1b')]],{'showHidden':![],'depth':null}));ami['emit']('custom:dialbegin',this[_0xb71a('0x9')][_0x42fc55['uniqueid']]);}}}catch(_0x70299a){logger[_0xb71a('0x2e')]('[%s][voiceDialReport][dialbegin]',_0x42fc55[_0xb71a('0x1b')],util[_0xb71a('0x1c')](_0x70299a,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xb71a('0x16')][_0xb71a('0x2f')]=function(_0x3d3d81){try{if(this[_0xb71a('0x18')](_0x3d3d81)){logger['debug'](_0xb71a('0x30'),_0x3d3d81[_0xb71a('0x1b')],util[_0xb71a('0x1c')](_0x3d3d81,{'showHidden':![],'depth':null}));if(this[_0xb71a('0x9')][_0x3d3d81['uniqueid']]){this[_0xb71a('0x9')][_0x3d3d81[_0xb71a('0x1b')]][_0xb71a('0x31')]=_0x3d3d81[_0xb71a('0x31')];if(_0x3d3d81[_0xb71a('0x31')]===_0xb71a('0x32')){this[_0xb71a('0x9')][_0x3d3d81[_0xb71a('0x1b')]][_0xb71a('0x33')]=_0x3d3d81[_0xb71a('0x33')];this['channels'][_0x3d3d81['uniqueid']][_0xb71a('0x34')]=_0x3d3d81[_0xb71a('0x34')];this[_0xb71a('0x9')][_0x3d3d81[_0xb71a('0x1b')]][_0xb71a('0x35')]=moment()[_0xb71a('0x1e')](_0xb71a('0x1f'));this['channels'][_0x3d3d81[_0xb71a('0x1b')]]['lastevent']=_0xb71a('0x36');logger[_0xb71a('0x26')](_0xb71a('0x37'),_0x3d3d81[_0xb71a('0x1b')],_0x3d3d81['channel'][_0xb71a('0x22')](_0x3d3d81[_0xb71a('0x21')][_0xb71a('0x23')]('/')+0x1,_0x3d3d81[_0xb71a('0x21')][_0xb71a('0x23')]('-')));logger[_0xb71a('0x19')](_0xb71a('0x38'),_0x3d3d81[_0xb71a('0x1b')],util[_0xb71a('0x1c')](this['channels'][_0x3d3d81[_0xb71a('0x1b')]],{'showHidden':![],'depth':null}));ami['emit'](_0xb71a('0x39'),this[_0xb71a('0x9')][_0x3d3d81[_0xb71a('0x1b')]]);}logger[_0xb71a('0x19')](_0xb71a('0x3a'),_0x3d3d81[_0xb71a('0x1b')],util['inspect'](this['channels'][_0x3d3d81['uniqueid']],{'showHidden':![],'depth':null}));this[_0xb71a('0x17')]('voice:outbound',_0xb71a('0x2c'),this[_0xb71a('0x9')][_0x3d3d81[_0xb71a('0x1b')]]);}}}catch(_0x396d36){logger[_0xb71a('0x2e')](_0xb71a('0x3b'),_0x3d3d81['uniqueid'],util[_0xb71a('0x1c')](_0x396d36,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xb71a('0x16')][_0xb71a('0x13')]=function(_0x8bf582){try{if(this[_0xb71a('0x18')](_0x8bf582)){logger[_0xb71a('0x19')]('[%s][voiceDialReport][varset]\x20event:',_0x8bf582[_0xb71a('0x1b')],util[_0xb71a('0x1c')](_0x8bf582,{'showHidden':![],'depth':null}));this[_0xb71a('0x3c')](_0x8bf582[_0xb71a('0x1b')],_[_0xb71a('0x3d')](_0x8bf582[_0xb71a('0x3e')])[0x0],_0x8bf582[_0xb71a('0x3f')]);if(this['isNotNull'](_0x8bf582['variable'])&&this[_0xb71a('0x18')](_0x8bf582[_0xb71a('0x3e')][_0xb71a('0x40')])){if(_[_0xb71a('0x15')](this['channels'][_0x8bf582[_0xb71a('0x1b')]])){this['channels'][_0x8bf582[_0xb71a('0x1b')]]={'routeId':_0x8bf582[_0xb71a('0x3f')],'variables':this['variables'][_0x8bf582[_0xb71a('0x1b')]],'motionChannel':_0xb71a('0x41')};logger[_0xb71a('0x26')](_0xb71a('0x42'),_0x8bf582['uniqueid'],_0x8bf582[_0xb71a('0x3e')][_0xb71a('0x40')],_[_0xb71a('0x3d')](_0x8bf582['variable'])[0x0],_0x8bf582[_0xb71a('0x3f')]);logger[_0xb71a('0x19')](_0xb71a('0x43'),_0x8bf582['uniqueid'],util[_0xb71a('0x1c')](this[_0xb71a('0x9')][_0x8bf582[_0xb71a('0x1b')]],{'showHidden':![],'depth':null}));this[_0xb71a('0x17')](_0xb71a('0x2b'),'voice_outbound_channel:save',this[_0xb71a('0x9')][_0x8bf582[_0xb71a('0x1b')]]);}}}}catch(_0x45e961){logger[_0xb71a('0x2e')]('[%s][voiceDialReport][varset]',_0x8bf582['uniqueid'],util[_0xb71a('0x1c')](_0x45e961,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xb71a('0x16')][_0xb71a('0x3c')]=function(_0x170978,_0x174f30,_0x2f2187){var _0x2a7804=[_0xb71a('0x44'),_0xb71a('0x45'),_0xb71a('0x46'),'rtpaudioqosjitterbridged',_0xb71a('0x47'),_0xb71a('0x48'),'rtpaudioqosrtt',_0xb71a('0x49'),'sipcallid',_0xb71a('0x4a'),_0xb71a('0x4b'),_0xb71a('0x4c'),_0xb71a('0x4d'),_0xb71a('0x4e'),'memberinterface',_0xb71a('0x4f'),'membername',_0xb71a('0x50'),_0xb71a('0x51')];if(!_['isNil'](_0x174f30)&&!_['includes'](_0x2a7804,_0x174f30)){if(_[_0xb71a('0x15')](this[_0xb71a('0xd')][_0x170978])){this['variables'][_0x170978]={};}this['variables'][_0x170978][_0x174f30]=_0x2f2187;}};VoiceDialReport['prototype'][_0xb71a('0x52')]=function(_0x57ef8f){try{if(this['isNotNull'](_0x57ef8f)){logger[_0xb71a('0x19')](_0xb71a('0x53'),_0x57ef8f[_0xb71a('0x1b')],util[_0xb71a('0x1c')](_0x57ef8f,{'showHidden':![],'depth':null}));if(this['channels'][_0x57ef8f[_0xb71a('0x1b')]]){logger[_0xb71a('0x26')](_0xb71a('0x54'),_0x57ef8f['uniqueid'],_0x57ef8f[_0xb71a('0x55')]);this[_0xb71a('0x9')][_0x57ef8f['uniqueid']][_0xb71a('0x56')]=moment()[_0xb71a('0x1e')](_0xb71a('0x1f'));this['channels'][_0x57ef8f[_0xb71a('0x1b')]]['duration']=moment(this[_0xb71a('0x9')][_0x57ef8f[_0xb71a('0x1b')]]['endtime'])[_0xb71a('0x57')](this[_0xb71a('0x9')][_0x57ef8f[_0xb71a('0x1b')]][_0xb71a('0x58')],_0xb71a('0x59'));this[_0xb71a('0x9')][_0x57ef8f[_0xb71a('0x1b')]]['lastevent']='complete';this[_0xb71a('0xb')][_0xb71a('0x5a')]+=0x1;if(this[_0xb71a('0x9')][_0x57ef8f[_0xb71a('0x1b')]][_0xb71a('0x35')]){this['outbound']['answered']+=0x1;this[_0xb71a('0x9')][_0x57ef8f[_0xb71a('0x1b')]]['holdtime']=moment(this[_0xb71a('0x9')][_0x57ef8f[_0xb71a('0x1b')]]['answertime'])[_0xb71a('0x57')](this[_0xb71a('0x9')][_0x57ef8f[_0xb71a('0x1b')]][_0xb71a('0x58')],'seconds');this[_0xb71a('0x9')][_0x57ef8f[_0xb71a('0x1b')]]['billableseconds']=moment(this[_0xb71a('0x9')][_0x57ef8f[_0xb71a('0x1b')]][_0xb71a('0x56')])[_0xb71a('0x57')](this[_0xb71a('0x9')][_0x57ef8f[_0xb71a('0x1b')]][_0xb71a('0x35')],_0xb71a('0x59'));this['outbound'][_0xb71a('0x5b')]+=this[_0xb71a('0x9')][_0x57ef8f['uniqueid']][_0xb71a('0x5c')]||0x0;this[_0xb71a('0xb')]['sumBillable']+=this[_0xb71a('0x9')][_0x57ef8f[_0xb71a('0x1b')]][_0xb71a('0x5d')];}this[_0xb71a('0xb')][_0xb71a('0x5e')]+=this[_0xb71a('0x9')][_0x57ef8f['uniqueid']]['duration'];logger[_0xb71a('0x19')](_0xb71a('0x5f'),_0x57ef8f[_0xb71a('0x1b')],util['inspect'](this[_0xb71a('0x9')][_0x57ef8f['uniqueid']],{'showHidden':![],'depth':null}));ami[_0xb71a('0x17')]('custom:voiceDialReport',this['channels'][_0x57ef8f[_0xb71a('0x1b')]]);logger[_0xb71a('0x19')](_0xb71a('0x60'),_0x57ef8f[_0xb71a('0x1b')],util[_0xb71a('0x1c')](this['channels'][_0x57ef8f[_0xb71a('0x1b')]],{'showHidden':![],'depth':null}));ami['emit'](_0xb71a('0x61'),this[_0xb71a('0x9')][_0x57ef8f[_0xb71a('0x1b')]]);logger['debug']('[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound:save\x20event:',_0x57ef8f[_0xb71a('0x1b')],util[_0xb71a('0x1c')](this[_0xb71a('0x9')][_0x57ef8f[_0xb71a('0x1b')]],{'showHidden':![],'depth':null}));this[_0xb71a('0x17')]('voice:outbound',_0xb71a('0x62'),this[_0xb71a('0xb')]);logger[_0xb71a('0x26')](_0xb71a('0x63'),JSON[_0xb71a('0x64')](this['channels'][_0x57ef8f['uniqueid']]));logger[_0xb71a('0x19')](_0xb71a('0x65'),_0x57ef8f[_0xb71a('0x1b')],util[_0xb71a('0x1c')](this[_0xb71a('0x9')][_0x57ef8f[_0xb71a('0x1b')]],{'showHidden':![],'depth':null}));this[_0xb71a('0x17')]('voice:outbound',_0xb71a('0x66'),this[_0xb71a('0x9')][_0x57ef8f['uniqueid']]);delete this[_0xb71a('0x9')][_0x57ef8f[_0xb71a('0x1b')]];}else if(this[_0xb71a('0x9')][_0x57ef8f['linkedid']]){this[_0xb71a('0x9')][_0x57ef8f[_0xb71a('0x67')]][_0xb71a('0x1b')]=this['channels'][_0x57ef8f[_0xb71a('0x67')]][_0xb71a('0x68')];}if(this[_0xb71a('0xd')][_0x57ef8f[_0xb71a('0x1b')]]){delete this[_0xb71a('0xd')][_0x57ef8f[_0xb71a('0x1b')]];}}}catch(_0x2cdaf9){logger[_0xb71a('0x2e')]('[%s][voiceDialReport][hangup]',_0x57ef8f[_0xb71a('0x1b')],util[_0xb71a('0x1c')](_0x2cdaf9,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xb71a('0x16')][_0xb71a('0x69')]=function(_0x43e4b8){try{if(this[_0xb71a('0x18')](_0x43e4b8)){logger[_0xb71a('0x19')]('[%s][voiceDialReport][newexten]\x20event:',_0x43e4b8[_0xb71a('0x1b')],util['inspect'](_0x43e4b8,{'showHidden':![],'depth':null}));if(_0x43e4b8[_0xb71a('0x6a')][_0xb71a('0x6b')]()==='set'){_0x43e4b8[_0xb71a('0x6c')]=(_0x43e4b8['appdata']||_0x43e4b8[_0xb71a('0x6c')])['toLowerCase']();if(_[_0xb71a('0x6d')](_0x43e4b8[_0xb71a('0x6c')],_0xb71a('0x6e'))){if(_[_0xb71a('0x15')](this['applications'][_0x43e4b8[_0xb71a('0x1b')]]))this[_0xb71a('0xc')][_0x43e4b8['uniqueid']]={};logger[_0xb71a('0x26')]('[%s][voiceDialReport][newexten]\x20application:%s\x20appdata:%s',_0x43e4b8['uniqueid'],_0x43e4b8['application'],_0x43e4b8['applicationdata']);var _0x37a38f=_0x43e4b8[_0xb71a('0x6c')][_0xb71a('0x6f')]('=');var _0x5554e8=_0x37a38f[0x0][_0xb71a('0x70')](/cdr\((.*)\)/);if(_0x5554e8)this[_0xb71a('0xc')][_0x43e4b8['uniqueid']][_0x5554e8[0x1]]=_0x37a38f[0x1];}}}}catch(_0x299349){logger[_0xb71a('0x2e')](_0xb71a('0x71'),_0x43e4b8[_0xb71a('0x1b')],util[_0xb71a('0x1c')](_0x299349,{'showHidden':![],'depth':null}));}};module[_0xb71a('0x72')]=VoiceDialReport;
\ No newline at end of file
index cd8dd9f..758b4be 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1802=['clearqueuereport','emit','emitVoiceQueueChannelSave','debug','[%s][voiceQueueReport][',']\x20sending\x20voice_queue_channel:save\x20event:','uniqueid','inspect','format','name','voice_queue_channel:save',']\x20sending\x20voice_queue_channel:remove\x20event:','queuecallerexitreason','ATTENDEDTRANSFER','voice:queue:%s','voice_queue_channel:remove','voice_queue_presence:remove','emitVoiceQueueSummary','type','inbound','strategy','loggedIn','pTalking','sumDuration','unmanaged','abandoned','Trunk','callerid','Interval','stringify','md5',']\x20sending\x20voice_queue:save\x20event:','voice_queue:save','isNotNull','Action','queues','loopQueueSummary','[voiceQueueReport][queuesummary]','syncQueueSummary','queue','[voiceQueueReport][queuesummary]\x20event:','info','[voiceQueueReport][queuesummary]\x20name:%s','countBy','callers','toNumber','loggedin','available','custom:queuesummary','[voiceQueueReport][queuesummarycomplete]\x20event:','isUndefined','queuecallerjoinAt','position','count','routealias','merge','keys','push','[%s][voiceQueueReport][queuecallerjoin]','queuecallercompleteAt','holdtime','originalposition','ABANDONED','[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s','[%s][voiceQueueReport][queuecallerleave]','last','queuecallerleaveAt','YYYY-MM-DD\x20HH:mm:ss','connectedlinenum','connectedlinename','[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s','[%s][voiceQueueReport][agentconnect]','COMPLETEDBYAGENT','[%s][voiceQueueReport][agentcomplete]','queuecallerabandonAt','assigned','membername','queuecallercomplete','queuecallerexit','queuecallerexitAt','transfer','reason','COMPLETED','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED','local/','linkedid','add','FORWARDTRANSFER','FORWARD','transferuniqueid','toUpperCase','[%s][voiceQueueReport][varset]','variable','queuestatus','value','CONTINUE','TIMEOUT','timeout','custom:timeout','queueposition','variables','addVariable','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','memberdynamic','memberinterface','memberlastcall','memberpenalty','memberrealtime','includes','syncHangup','[%s][voiceQueueReport][hangup]','length','sumHoldTime','diff','seconds','total','answered','sumBillable','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerunmanaged\x20event:','custom:queuecallerunmanaged','lastevent','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerabandon\x20event:','[%s][voiceQueueReport][hangup]\x20name:%s\x20type:%s\x20reason:%s','[%s][voiceQueueReport][hangup]\x20sending\x20voiceQueueReport\x20event:','custom:voiceQueueReport','[%s][voiceQueueReport][attendedtransfer]','transfereeuniqueid','secondtransfereruniqueid','ATTENDED','[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','transferexten','transfertargetuniqueid','origtransfereruniqueid','transfertype','BLINDTRANSFER','extension','[%s][voiceQueueReport][blindTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','BlindTransfer','transfererchannel','[%s][voiceQueueReport][blindtransfer]','mohstarttime','syncMusicOnHoldStop','milliseconds','mohtime','[%s][voiceQueueReport][musiconholdstop]','syncNewExten','[%s][voiceQueueReport][newexten]\x20event:','toLowerCase','set','appdata','startsWith','CDR(routeAlias)','applicationdata','cdr(','[%s][voiceQueueReport][newexten]\x20application:%s\x20appdata:%s','split','match','[%s][voiceQueueReport][newexten]','exports','lodash','moment','util','ioredis','../../../config/environment','../../../config/logger','ami','../model/queueReport','redis','defaults','socket.io-emitter','prototype','enqueue','tail','finally','sequence','queueReports','agents','channels','queueChannels','voiceQueues','flagQueueSummary','campaigns','queuesummary','bind','queuesummarycomplete','syncQueueSummaryComplete','queuecallerjoin','queuecallerabandon','syncQueueCallerAbandon','queuecallerleave','syncQueueCallerLeave','agentcomplete','syncAgentComplete','agentconnect','syncAgentConnect','varset','syncVarSet','hangup','fullybooted','syncFullyBooted','musiconholdstart','syncMusicOnHoldStart','blindtransfer','syncBlindTransfer','isEmpty','hasOwnProperty','talking','waiting','unlockRR','clearZombieChannels','switch','isNil','status','channel','catch','error','[%s][voiceQueueReport][checkChannel]','[%s][voiceQueueReport][checkQueueReport]','[%s][voiceQueueReport][checkVariables]','[FullyBooted]\x20clear\x20realtime','emitVoiceQueueChannelRemove'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0x1802,0xa8));var _0x2180=function(_0x30f355,_0x4e496c){_0x30f355=_0x30f355-0x0;var _0x1a6fd5=_0x1802[_0x30f355];return _0x1a6fd5;};'use strict';var _=require(_0x2180('0x0'));var moment=require(_0x2180('0x1'));var util=require(_0x2180('0x2'));var md5=require('md5');var Redis=require(_0x2180('0x3'));var config=require(_0x2180('0x4'));var logger=require(_0x2180('0x5'))(_0x2180('0x6'));var ami=require('../ami');var QueueReport=require(_0x2180('0x7'));config[_0x2180('0x8')]=_[_0x2180('0x9')](config[_0x2180('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0x2180('0xa'))(new Redis(config[_0x2180('0x8')]));var Sequence=function(){};Sequence[_0x2180('0xb')][_0x2180('0xc')]=function(_0x1bd4fc){this['tail']=this[_0x2180('0xd')]?this['tail'][_0x2180('0xe')](_0x1bd4fc):_0x1bd4fc();};function VoiceQueueReport(_0x28cadc){this[_0x2180('0xf')]=new Sequence();this[_0x2180('0x10')]={};this[_0x2180('0x11')]=_0x28cadc[_0x2180('0x11')];this[_0x2180('0x12')]=_0x28cadc[_0x2180('0x13')];this[_0x2180('0x14')]=_0x28cadc[_0x2180('0x14')];this[_0x2180('0x15')]=!![];this[_0x2180('0x16')]=_0x28cadc[_0x2180('0x16')];this['variables']={};ami['on'](_0x2180('0x17'),this['syncQueueSummary'][_0x2180('0x18')](this));ami['on'](_0x2180('0x19'),this[_0x2180('0x1a')]['bind'](this));ami['on'](_0x2180('0x1b'),this['syncQueueCallerJoin'][_0x2180('0x18')](this));ami['on'](_0x2180('0x1c'),this[_0x2180('0x1d')][_0x2180('0x18')](this));ami['on'](_0x2180('0x1e'),this[_0x2180('0x1f')][_0x2180('0x18')](this));ami['on'](_0x2180('0x20'),this[_0x2180('0x21')][_0x2180('0x18')](this));ami['on'](_0x2180('0x22'),this[_0x2180('0x23')][_0x2180('0x18')](this));ami['on'](_0x2180('0x24'),this[_0x2180('0x25')]['bind'](this));ami['on'](_0x2180('0x26'),this['syncHangup']['bind'](this));ami['on'](_0x2180('0x27'),this[_0x2180('0x28')]['bind'](this));ami['on'](_0x2180('0x29'),this[_0x2180('0x2a')][_0x2180('0x18')](this));ami['on']('musiconholdstop',this['syncMusicOnHoldStop']['bind'](this));ami['on']('attendedtransfer',this['syncAttendedTransfer'][_0x2180('0x18')](this));ami['on'](_0x2180('0x2b'),this[_0x2180('0x2c')][_0x2180('0x18')](this));this['loopQueueSummary']();this['loopQueueShow']();}function clearChannels(_0x581cda){if(!_[_0x2180('0x2d')](_0x581cda)){for(var _0x11ff6c in _0x581cda){if(_0x581cda[_0x2180('0x2e')](_0x11ff6c)){delete _0x581cda[_0x11ff6c];}}}}function clearCampaigns(_0x10a91c){if(!_['isEmpty'](_0x10a91c)){for(var _0x411e53 in _0x10a91c){if(_0x10a91c[_0x2180('0x2e')](_0x411e53)){_0x10a91c[_0x411e53]['originated']=0x0;}}}}function clearVoiceQueues(_0x3828ea){if(!_[_0x2180('0x2d')](_0x3828ea)){for(var _0x374135 in _0x3828ea){if(_0x3828ea[_0x2180('0x2e')](_0x374135)){_0x3828ea[_0x374135]['originated']=0x0;_0x3828ea[_0x374135][_0x2180('0x2f')]=0x0;_0x3828ea[_0x374135]['pTalking']=0x0;_0x3828ea[_0x374135][_0x2180('0x30')]=0x0;_0x3828ea[_0x374135]['queueStatusComplete']=!![];}}}}function clearAgentBooked(_0x2d2493){if(!_[_0x2180('0x2d')](_0x2d2493)){for(var _0x3ddda1 in _0x2d2493){if(_0x2d2493[_0x2180('0x2e')](_0x3ddda1)){_0x2d2493[_0x3ddda1][_0x2180('0x31')]=!![];}}}}VoiceQueueReport['prototype'][_0x2180('0x32')]=function(){var _0x3cd5f1=this;for(var _0x5c8b60 in this[_0x2180('0x12')]){if(this[_0x2180('0x12')]['hasOwnProperty'](_0x5c8b60)&&!this[_0x2180('0x12')][_0x5c8b60][_0x2180('0x33')]){this[_0x2180('0xf')][_0x2180('0xc')](function(){if(!_[_0x2180('0x34')](_0x3cd5f1[_0x2180('0x12')][_0x5c8b60])){return ami['Action']({'action':_0x2180('0x35'),'channel':_0x3cd5f1[_0x2180('0x12')][_0x5c8b60][_0x2180('0x36')]})[_0x2180('0x37')](function(_0x3bcf98){if(_0x3bcf98['message']==='No\x20such\x20channel'){setTimeout(function(){if(_0x3cd5f1[_0x2180('0x12')][_0x5c8b60]){delete _0x3cd5f1[_0x2180('0x12')][_0x5c8b60];logger[_0x2180('0x38')](_0x2180('0x39'),_0x5c8b60,util['inspect'](_0x3bcf98,{'showHidden':![],'depth':null}));}if(_0x3cd5f1[_0x2180('0x10')][_0x5c8b60]){delete _0x3cd5f1['queueReports'][_0x5c8b60];logger[_0x2180('0x38')](_0x2180('0x3a'),_0x5c8b60,util['inspect'](_0x3bcf98,{'showHidden':![],'depth':null}));}if(_0x3cd5f1['variables'][_0x5c8b60]){delete _0x3cd5f1['variables'][_0x5c8b60];logger[_0x2180('0x38')](_0x2180('0x3b'),_0x5c8b60,util['inspect'](_0x3bcf98,{'showHidden':![],'depth':null}));}},0x1f40);}});}});}}};VoiceQueueReport[_0x2180('0xb')][_0x2180('0x28')]=function(){logger[_0x2180('0x38')](_0x2180('0x3c'));clearChannels(this[_0x2180('0x12')]);this['clearQueueReport'](this[_0x2180('0x10')]);clearAgentBooked(this[_0x2180('0x11')]);clearVoiceQueues(this['voiceQueues']);clearCampaigns(this[_0x2180('0x16')]);};VoiceQueueReport[_0x2180('0xb')]['clearQueueReport']=function(_0xc7c354){var _0x5ceeae=this;if(!_[_0x2180('0x2d')](_0xc7c354)){for(var _0x3972e2 in _0xc7c354){if(_0xc7c354[_0x2180('0x2e')](_0x3972e2)){_0x5ceeae[_0x2180('0x3d')](_0xc7c354[_0x3972e2],_0x2180('0x3e'));delete _0xc7c354[_0x3972e2];}}}};VoiceQueueReport['prototype'][_0x2180('0x3f')]=function(_0x41b89d,_0x1e66a5,_0x4cb0e5){io['to'](_0x41b89d)[_0x2180('0x3f')](_0x1e66a5,_0x4cb0e5);};VoiceQueueReport[_0x2180('0xb')][_0x2180('0x40')]=function(_0x275340,_0x21fb62){logger[_0x2180('0x41')](_0x2180('0x42')+_0x21fb62+_0x2180('0x43'),_0x275340[_0x2180('0x44')],util[_0x2180('0x45')](_0x275340,{'showHidden':![],'depth':null}));this[_0x2180('0x3f')](util[_0x2180('0x46')]('voice:queue:%s',_0x275340[_0x2180('0x47')]),_0x2180('0x48'),_0x275340);io[_0x2180('0x3f')]('voice_queue_presence:save',_0x275340);};VoiceQueueReport[_0x2180('0xb')]['emitVoiceQueueChannelRemove']=function(_0x23890a,_0x7ec5b7){logger[_0x2180('0x41')](_0x2180('0x42')+_0x7ec5b7+_0x2180('0x49'),_0x23890a[_0x2180('0x44')],util['inspect'](_0x23890a,{'showHidden':![],'depth':null}));if(_0x23890a[_0x2180('0x4a')]===_0x2180('0x4b'))return;this[_0x2180('0x3f')](util[_0x2180('0x46')](_0x2180('0x4c'),_0x23890a[_0x2180('0x47')]),_0x2180('0x4d'),_0x23890a);io[_0x2180('0x3f')](_0x2180('0x4e'),_0x23890a);};VoiceQueueReport[_0x2180('0xb')][_0x2180('0x4f')]=function(_0x3c0aff,_0x3bffd1){if(_0x3c0aff[_0x2180('0x50')]===_0x2180('0x51')){var _0x469714={'id':_0x3c0aff['id'],'name':_0x3c0aff['name'],'strategy':_0x3c0aff[_0x2180('0x52')],'answered':_0x3c0aff['answered'],'available':_0x3c0aff['available'],'loggedIn':_0x3c0aff[_0x2180('0x53')],'pTalking':_0x3c0aff[_0x2180('0x54')],'sumBillable':_0x3c0aff['sumBillable'],'sumDuration':_0x3c0aff[_0x2180('0x55')],'sumHoldTime':_0x3c0aff['sumHoldTime']||0x0,'talking':_0x3c0aff[_0x2180('0x2f')],'total':_0x3c0aff['total'],'type':_0x3c0aff[_0x2180('0x50')],'unmanaged':_0x3c0aff[_0x2180('0x56')],'abandoned':_0x3c0aff[_0x2180('0x57')],'waiting':_0x3c0aff[_0x2180('0x30')]};if(_0x3c0aff[_0x2180('0x58')]){_0x469714['Trunk']={'id':_0x3c0aff[_0x2180('0x58')]['id'],'name':_0x3c0aff[_0x2180('0x58')][_0x2180('0x47')],'active':_0x3c0aff['Trunk']['active'],'callerid':_0x3c0aff[_0x2180('0x58')][_0x2180('0x59')]};}if(_0x3c0aff['Interval']){_0x469714[_0x2180('0x5a')]={'id':_0x3c0aff['Interval']['id'],'name':_0x3c0aff['Interval']['name']};}var _0x3f0686=md5(JSON[_0x2180('0x5b')](_0x469714));if(_0x3c0aff[_0x2180('0x5c')]!==_0x3f0686){_0x3c0aff['md5']=_0x3f0686;logger[_0x2180('0x41')]('[voiceQueueReport]['+_0x3bffd1+_0x2180('0x5d'),util[_0x2180('0x45')](_0x469714,{'showHidden':![],'depth':null}));this['emit'](util[_0x2180('0x46')]('voice:queue:%s',_0x469714[_0x2180('0x47')]),_0x2180('0x5e'),_0x469714);}}};VoiceQueueReport['prototype'][_0x2180('0x5f')]=function(_0x47a81c){return _0x47a81c!==null&&!_['isUndefined'](_0x47a81c);};VoiceQueueReport[_0x2180('0xb')]['loopQueueShow']=function(){var _0x4e5433=this;setInterval(function(){_0x4e5433['clearZombieChannels']();ami[_0x2180('0x60')]({'action':_0x2180('0x61')})[_0x2180('0x37')](function(_0xea3b44){logger[_0x2180('0x38')]('[voiceQueueReport][queues]',util[_0x2180('0x45')](_0xea3b44,{'showHidden':![],'depth':null}));});},0x2710);};VoiceQueueReport[_0x2180('0xb')][_0x2180('0x62')]=function(){var _0x372582=this;setInterval(function(){if(_0x372582['flagQueueSummary']){return ami[_0x2180('0x60')]({'action':_0x2180('0x17')})['then'](function(){_0x372582['flagQueueSummary']=![];})[_0x2180('0x37')](function(_0x16a99e){logger[_0x2180('0x38')](_0x2180('0x63'),util['inspect'](_0x16a99e,{'showHidden':![],'depth':null}));});}},0x3e8);};VoiceQueueReport[_0x2180('0xb')][_0x2180('0x64')]=function(_0x30efc5){try{if(this[_0x2180('0x5f')](_0x30efc5)&&this[_0x2180('0x5f')](_0x30efc5[_0x2180('0x65')])){logger['debug'](_0x2180('0x66'),util['inspect'](_0x30efc5,{'showHidden':![],'depth':null}));if(this[_0x2180('0x14')][_0x30efc5['queue']]){logger[_0x2180('0x67')](_0x2180('0x68'),_0x30efc5[_0x2180('0x65')]);var _0x163d66=_[_0x2180('0x69')](this[_0x2180('0x12')],_0x2180('0x65'))[_0x30efc5['queue']]||0x0;var _0x228dd1=_0x163d66-_0x30efc5[_0x2180('0x6a')];if(this[_0x2180('0x14')][_0x30efc5[_0x2180('0x65')]][_0x2180('0x30')]!==_[_0x2180('0x6b')](_0x30efc5[_0x2180('0x6a')])||this['voiceQueues'][_0x30efc5[_0x2180('0x65')]]['loggedIn']!==_[_0x2180('0x6b')](_0x30efc5[_0x2180('0x6c')])||this[_0x2180('0x14')][_0x30efc5[_0x2180('0x65')]]['available']!==_['toNumber'](_0x30efc5[_0x2180('0x6d')])||this['voiceQueues'][_0x30efc5['queue']]['talking']!==_0x228dd1){this[_0x2180('0x14')][_0x30efc5[_0x2180('0x65')]][_0x2180('0x30')]=_[_0x2180('0x6b')](_0x30efc5[_0x2180('0x6a')]);this[_0x2180('0x14')][_0x30efc5[_0x2180('0x65')]]['loggedIn']=_[_0x2180('0x6b')](_0x30efc5[_0x2180('0x6c')]);this[_0x2180('0x14')][_0x30efc5[_0x2180('0x65')]][_0x2180('0x6d')]=_[_0x2180('0x6b')](_0x30efc5[_0x2180('0x6d')]);this['voiceQueues'][_0x30efc5[_0x2180('0x65')]][_0x2180('0x2f')]=_0x228dd1>0x0?_0x228dd1:0x0;this['voiceQueues'][_0x30efc5[_0x2180('0x65')]][_0x2180('0x2f')]=this['voiceQueues'][_0x30efc5[_0x2180('0x65')]][_0x2180('0x2f')]>_[_0x2180('0x6b')](_0x30efc5[_0x2180('0x6c')])?_['toNumber'](_0x30efc5['loggedin']):this['voiceQueues'][_0x30efc5['queue']]['talking'];this['emitVoiceQueueSummary'](this[_0x2180('0x14')][_0x30efc5['queue']],_0x2180('0x17'));}logger[_0x2180('0x41')]('[voiceQueueReport][queuesummary]\x20sending\x20queuesummary\x20event:',util[_0x2180('0x45')](this[_0x2180('0x14')][_0x30efc5[_0x2180('0x65')]],{'showHidden':![],'depth':null}));ami[_0x2180('0x3f')](_0x2180('0x6e'),this[_0x2180('0x14')][_0x30efc5[_0x2180('0x65')]]);}}}catch(_0x142365){logger[_0x2180('0x38')](_0x2180('0x63'),util[_0x2180('0x45')](_0x142365,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2180('0xb')]['syncQueueSummaryComplete']=function(_0x2a9bbb){logger['debug'](_0x2180('0x6f'),util['inspect'](_0x2a9bbb,{'showHidden':![],'depth':null}));this[_0x2180('0x15')]=!![];};VoiceQueueReport[_0x2180('0xb')]['syncQueueCallerJoin']=function(_0x1fcbd8){try{if(this[_0x2180('0x5f')](_0x1fcbd8)){logger[_0x2180('0x41')]('[%s][voiceQueueReport][queuecallerjoin]',_0x1fcbd8[_0x2180('0x44')],util[_0x2180('0x45')](_0x1fcbd8,{'showHidden':![],'depth':null}));if(_[_0x2180('0x70')](this['queueReports'][_0x1fcbd8[_0x2180('0x44')]]))this[_0x2180('0x10')][_0x1fcbd8['uniqueid']]=[];if(_[_0x2180('0x70')](this[_0x2180('0x12')][_0x1fcbd8[_0x2180('0x44')]]))this[_0x2180('0x12')][_0x1fcbd8[_0x2180('0x44')]]={};var _0x4adf65=new QueueReport();_0x4adf65[_0x2180('0x47')]=_0x1fcbd8[_0x2180('0x65')];_0x4adf65[_0x2180('0x50')]=this[_0x2180('0x14')][_0x4adf65[_0x2180('0x47')]]&&this[_0x2180('0x14')][_0x4adf65[_0x2180('0x47')]]['type']?this[_0x2180('0x14')][_0x4adf65[_0x2180('0x47')]]['type']||_0x2180('0x51'):'inbound';_0x4adf65[_0x2180('0x65')]=_0x1fcbd8['queue'];_0x4adf65[_0x2180('0x71')]=moment()[_0x2180('0x46')]('YYYY-MM-DD\x20HH:mm:ss');_0x4adf65[_0x2180('0x72')]=_0x1fcbd8[_0x2180('0x72')];_0x4adf65[_0x2180('0x73')]=_0x1fcbd8[_0x2180('0x73')];_0x4adf65[_0x2180('0x44')]=_0x1fcbd8['uniqueid'];_0x4adf65[_0x2180('0x74')]=this[_0x2180('0x12')][_0x1fcbd8['uniqueid']][_0x2180('0x74')];logger[_0x2180('0x67')]('[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s',_0x4adf65[_0x2180('0x47')],_0x4adf65[_0x2180('0x50')]);_[_0x2180('0x75')](_0x4adf65,_['pick'](_0x1fcbd8,_[_0x2180('0x76')](_0x4adf65)));this['queueReports'][_0x1fcbd8['uniqueid']][_0x2180('0x77')](_0x4adf65);this[_0x2180('0x12')][_0x1fcbd8[_0x2180('0x44')]]=_0x4adf65;this[_0x2180('0x40')](_0x4adf65,_0x2180('0x1b'));}}catch(_0x11401b){logger['error'](_0x2180('0x78'),_0x1fcbd8['uniqueid'],util[_0x2180('0x45')](_0x11401b,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2180('0xb')]['syncQueueCallerAbandon']=function(_0x51a823){try{if(this[_0x2180('0x5f')](_0x51a823)){logger[_0x2180('0x41')]('[%s][voiceQueueReport][queuecallerabandon]',_0x51a823[_0x2180('0x44')],util[_0x2180('0x45')](_0x51a823,{'showHidden':![],'depth':null}));if(this[_0x2180('0x10')][_0x51a823['uniqueid']]){var _0x5e9c5b=_['last'](this[_0x2180('0x10')][_0x51a823[_0x2180('0x44')]]);_0x5e9c5b['queuecallercomplete']=![];_0x5e9c5b[_0x2180('0x79')]=null;_0x5e9c5b[_0x2180('0x7a')]=_0x51a823[_0x2180('0x7a')];_0x5e9c5b[_0x2180('0x7b')]=_0x51a823[_0x2180('0x7b')];_0x5e9c5b[_0x2180('0x1c')]=!![];_0x5e9c5b['queuecallerabandonAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x5e9c5b[_0x2180('0x4a')]=_0x2180('0x7c');_0x5e9c5b['lastAssignedTo']=null;logger[_0x2180('0x67')](_0x2180('0x7d'),_0x5e9c5b['name'],_0x5e9c5b['type']);this[_0x2180('0x12')][_0x51a823[_0x2180('0x44')]]=_0x5e9c5b;this[_0x2180('0x3d')](_0x5e9c5b,'queuecallerabandon');}}}catch(_0x4ecc29){logger['error']('[%s][voiceQueueReport][queuecallerabandon]',_0x51a823['uniqueid'],util['inspect'](_0x4ecc29,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2180('0xb')][_0x2180('0x1f')]=function(_0x1b835d){try{if(this[_0x2180('0x5f')](_0x1b835d)){logger['debug'](_0x2180('0x7e'),_0x1b835d['uniqueid'],util[_0x2180('0x45')](_0x1b835d,{'showHidden':![],'depth':null}));if(this[_0x2180('0x10')][_0x1b835d[_0x2180('0x44')]]){var _0x344719=_[_0x2180('0x7f')](this[_0x2180('0x10')][_0x1b835d[_0x2180('0x44')]]);_0x344719[_0x2180('0x80')]=moment()['format'](_0x2180('0x81'));_0x344719[_0x2180('0x82')]=_0x1b835d[_0x2180('0x82')];_0x344719[_0x2180('0x83')]=_0x1b835d[_0x2180('0x83')];logger[_0x2180('0x67')](_0x2180('0x84'),_0x344719[_0x2180('0x47')],_0x344719[_0x2180('0x50')],_0x1b835d[_0x2180('0x82')],_0x1b835d[_0x2180('0x83')]);this['channels'][_0x1b835d[_0x2180('0x44')]]=_0x344719;this[_0x2180('0x40')](_0x344719,_0x2180('0x1e'));}}}catch(_0x1fbeb1){logger[_0x2180('0x38')]('[%s][voiceQueueReport][queuecallerleave]',_0x1b835d[_0x2180('0x44')],util[_0x2180('0x45')](_0x1fbeb1,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2180('0xb')][_0x2180('0x23')]=function(_0x15dfd7){try{if(this[_0x2180('0x5f')](_0x15dfd7)){logger['debug'](_0x2180('0x85'),_0x15dfd7[_0x2180('0x44')],util['inspect'](_0x15dfd7,{'showHidden':![],'depth':null}));if(this[_0x2180('0x10')][_0x15dfd7[_0x2180('0x44')]]){var _0x5cc737=_['last'](this[_0x2180('0x10')][_0x15dfd7[_0x2180('0x44')]]);_0x5cc737['queuecallercomplete']=!![];_0x5cc737[_0x2180('0x4a')]=_0x2180('0x86');logger[_0x2180('0x67')]('[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT',_0x5cc737[_0x2180('0x47')],_0x5cc737[_0x2180('0x50')]);}}}catch(_0x367d8e){logger['error'](_0x2180('0x85'),_0x15dfd7[_0x2180('0x44')],util[_0x2180('0x45')](_0x367d8e,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncAgentComplete']=function(_0x38080c){try{if(this[_0x2180('0x5f')](_0x38080c)){logger[_0x2180('0x41')](_0x2180('0x87'),_0x38080c[_0x2180('0x44')],util[_0x2180('0x45')](_0x38080c,{'showHidden':![],'depth':null}));if(this[_0x2180('0x10')][_0x38080c['uniqueid']]){var _0x613e7b=_[_0x2180('0x7f')](this[_0x2180('0x10')][_0x38080c[_0x2180('0x44')]]);_0x613e7b[_0x2180('0x1c')]=![];_0x613e7b[_0x2180('0x88')]=null;_0x613e7b[_0x2180('0x89')]=!![];_0x613e7b['lastAssignedTo']=_0x38080c[_0x2180('0x8a')];_0x613e7b['holdtime']=_0x38080c['holdtime'];_0x613e7b[_0x2180('0x8b')]=!![];_0x613e7b[_0x2180('0x8c')]=![];_0x613e7b[_0x2180('0x8d')]=null;if(!_0x613e7b[_0x2180('0x8e')]){if(_0x38080c[_0x2180('0x8f')]=='transfer'){_0x613e7b[_0x2180('0x4a')]=_0x2180('0x90');logger['info'](_0x2180('0x91'),_0x613e7b['name'],_0x613e7b[_0x2180('0x50')]);}else{if(_['startsWith'](_0x38080c[_0x2180('0x36')]['toLowerCase'](),_0x2180('0x92'))){if(this[_0x2180('0x10')][_0x38080c['linkedid']]){var _0x56da01=_[_0x2180('0x7f')](this['queueReports'][_0x38080c[_0x2180('0x93')]]);_0x56da01['queuecallercomplete']=![];_0x56da01[_0x2180('0x8c')]=!![];_0x56da01['queuecallerexitAt']=moment(_0x613e7b[_0x2180('0x71')])[_0x2180('0x94')](_0x38080c[_0x2180('0x7a')],'seconds')[_0x2180('0x46')]('YYYY-MM-DD\x20HH:mm:ss');_0x56da01['queuecallerexitreason']=_0x2180('0x95');_0x56da01[_0x2180('0x8e')]=!![];_0x56da01['transfertype']=_0x2180('0x96');_0x56da01['transferexten']=_0x38080c['destexten'];_0x56da01[_0x2180('0x97')]=_0x38080c['uniqueid'];logger[_0x2180('0x67')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER',_0x56da01[_0x2180('0x47')],_0x56da01[_0x2180('0x50')]);var _0x17f925=this[_0x2180('0x10')][_0x38080c[_0x2180('0x93')]];this[_0x2180('0x10')][_0x38080c[_0x2180('0x93')]]=this[_0x2180('0x10')][_0x38080c[_0x2180('0x44')]];this['queueReports'][_0x38080c[_0x2180('0x44')]]=_0x17f925;}}else{_0x613e7b[_0x2180('0x4a')]='COMPLETEDBY'+_0x38080c[_0x2180('0x8f')][_0x2180('0x98')]();logger[_0x2180('0x67')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s',_0x613e7b[_0x2180('0x47')],_0x613e7b['type'],_0x613e7b[_0x2180('0x4a')]);}}}this[_0x2180('0x12')][_0x38080c['uniqueid']]=_0x613e7b;this[_0x2180('0x3d')](_0x613e7b,_0x2180('0x20'));}}}catch(_0x513cfa){logger[_0x2180('0x38')](_0x2180('0x87'),_0x38080c['uniqueid'],util[_0x2180('0x45')](_0x513cfa,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2180('0xb')][_0x2180('0x25')]=function(_0x55a86c){try{if(this[_0x2180('0x5f')](_0x55a86c)){logger[_0x2180('0x41')](_0x2180('0x99'),_0x55a86c[_0x2180('0x44')],util[_0x2180('0x45')](_0x55a86c,{'showHidden':![],'depth':null}));this['addVariable'](_0x55a86c[_0x2180('0x44')],_[_0x2180('0x76')](_0x55a86c[_0x2180('0x9a')])[0x0],_0x55a86c['value']);if(this[_0x2180('0x10')][_0x55a86c[_0x2180('0x44')]]){var _0x270508=_['last'](this['queueReports'][_0x55a86c[_0x2180('0x44')]]);if(_0x270508){if(this['isNotNull'](_0x55a86c['variable'])&&this['isNotNull'](_0x55a86c[_0x2180('0x9a')][_0x2180('0x9b')])){switch(_0x55a86c[_0x2180('0x9c')]){case _0x2180('0x9d'):_0x270508[_0x2180('0x8c')]=![];_0x270508[_0x2180('0x8d')]=null;break;case _0x2180('0x9e'):_0x270508['lastevent']=_0x2180('0x9f');_0x270508[_0x2180('0x8c')]=!![];_0x270508[_0x2180('0x8d')]=moment()['format'](_0x2180('0x81'));_0x270508['queuecallerleaveAt']=moment()[_0x2180('0x46')](_0x2180('0x81'));logger[_0x2180('0x41')]('[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:',_0x55a86c[_0x2180('0x44')],util['inspect'](_0x270508,{'showHidden':![],'depth':null}));ami['emit'](_0x2180('0xa0'),_0x270508);break;default:_0x270508['queuecallerexit']=!![];_0x270508['queuecallerexitAt']=moment()[_0x2180('0x46')](_0x2180('0x81'));_0x270508[_0x2180('0x80')]=moment()['format'](_0x2180('0x81'));}_0x270508[_0x2180('0x1c')]=![];_0x270508[_0x2180('0x88')]=null;_0x270508[_0x2180('0x4a')]=_0x55a86c[_0x2180('0x9c')];this[_0x2180('0x12')][_0x55a86c['uniqueid']]=_0x270508;this[_0x2180('0x3d')](_0x270508,_0x2180('0x24'));}else if(this['isNotNull'](_0x55a86c[_0x2180('0x9a')])&&this[_0x2180('0x5f')](_0x55a86c['variable'][_0x2180('0xa1')])){if(!_0x270508[_0x2180('0x1c')]){_0x270508['queuecallerexit']=!![];_0x270508['queuecallerexitAt']=moment()[_0x2180('0x46')](_0x2180('0x81'));_0x270508['queuecallerexitreason']='EXITWITHKEY';_0x270508['queuecallerleaveAt']=moment()[_0x2180('0x46')](_0x2180('0x81'));this[_0x2180('0x12')][_0x55a86c[_0x2180('0x44')]]=_0x270508;}}logger[_0x2180('0x67')]('[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s',_0x55a86c['uniqueid'],_0x270508[_0x2180('0x47')],_0x270508[_0x2180('0x50')],_[_0x2180('0x76')](_0x55a86c[_0x2180('0x9a')])[0x0],_0x55a86c[_0x2180('0x9c')]);_0x270508['variables']=this[_0x2180('0xa2')][_0x55a86c[_0x2180('0x44')]];}}}}catch(_0x54cb63){logger[_0x2180('0x38')](_0x2180('0x99'),_0x55a86c[_0x2180('0x44')],util[_0x2180('0x45')](_0x54cb63,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2180('0xb')][_0x2180('0xa3')]=function(_0x558b93,_0x58352c,_0x3e0368){var _0x3517ca=[_0x2180('0xa4'),_0x2180('0xa5'),_0x2180('0xa6'),'rtpaudioqosjitterbridged',_0x2180('0xa7'),_0x2180('0xa8'),_0x2180('0xa9'),_0x2180('0xaa'),_0x2180('0xab'),_0x2180('0xac'),_0x2180('0xad'),'bridgepvtcallid','membercalls',_0x2180('0xae'),_0x2180('0xaf'),_0x2180('0xb0'),'membername',_0x2180('0xb1'),_0x2180('0xb2')];if(!_[_0x2180('0x34')](_0x58352c)&&!_[_0x2180('0xb3')](_0x3517ca,_0x58352c)){if(_[_0x2180('0x70')](this[_0x2180('0xa2')][_0x558b93])){this[_0x2180('0xa2')][_0x558b93]={};}this[_0x2180('0xa2')][_0x558b93][_0x58352c]=_0x3e0368;}};VoiceQueueReport[_0x2180('0xb')][_0x2180('0xb4')]=function(_0x1128cb){try{if(this[_0x2180('0x5f')](_0x1128cb)){logger['debug'](_0x2180('0xb5'),_0x1128cb['uniqueid'],util[_0x2180('0x45')](_0x1128cb,{'showHidden':![],'depth':null}));if(this[_0x2180('0x10')][_0x1128cb[_0x2180('0x44')]]){for(var _0x4e4c60=0x0,_0x277695={};_0x4e4c60<this[_0x2180('0x10')][_0x1128cb['uniqueid']][_0x2180('0xb6')];_0x4e4c60+=0x1){_0x277695=this['queueReports'][_0x1128cb[_0x2180('0x44')]][_0x4e4c60];if(this['voiceQueues'][_0x277695['queue']]){if(_0x277695['queuecallerexit']&&_0x277695[_0x2180('0x8e')]!=!![]){this['voiceQueues'][_0x277695['queue']][_0x2180('0x56')]+=0x1;}if(_0x277695[_0x2180('0x1c')]){this[_0x2180('0x14')][_0x277695['queue']][_0x2180('0x57')]+=0x1;}this[_0x2180('0x14')][_0x277695['queue']][_0x2180('0xb7')]+=moment(_0x277695[_0x2180('0x80')])[_0x2180('0xb8')](_0x277695[_0x2180('0x71')],_0x2180('0xb9'))||0x0;if(_0x4e4c60===this[_0x2180('0x10')][_0x1128cb['uniqueid']][_0x2180('0xb6')]-0x1){this[_0x2180('0x14')][_0x277695['queue']][_0x2180('0x55')]+=moment()['milliseconds'](0x0)[_0x2180('0xb8')](_0x277695['queuecallerjoinAt'],_0x2180('0xb9'));this['voiceQueues'][_0x277695[_0x2180('0x65')]][_0x2180('0xba')]+=0x1;if(_0x277695[_0x2180('0x8b')]){this[_0x2180('0x14')][_0x277695[_0x2180('0x65')]][_0x2180('0xbb')]+=0x1;this[_0x2180('0x14')][_0x277695[_0x2180('0x65')]][_0x2180('0xbc')]+=moment()['milliseconds'](0x0)[_0x2180('0xb8')](_0x277695[_0x2180('0x80')],_0x2180('0xb9'));_0x277695[_0x2180('0x79')]=moment()['format'](_0x2180('0x81'));_0x277695['queuecallerexit']=![];_0x277695['queuecallerexitAt']=null;}if(_0x277695['queuecallerexit']&&_0x277695[_0x2180('0x8e')]!=!![]){_0x277695['lastevent']='unmanaged';logger[_0x2180('0x41')](_0x2180('0xbd'),_0x1128cb[_0x2180('0x44')],util[_0x2180('0x45')](_0x277695,{'showHidden':![],'depth':null}));ami[_0x2180('0x3f')](_0x2180('0xbe'),_0x277695);}if(_0x277695[_0x2180('0x1c')]){_0x277695[_0x2180('0xbf')]=_0x2180('0x57');logger[_0x2180('0x41')](_0x2180('0xc0'),_0x1128cb[_0x2180('0x44')],util[_0x2180('0x45')](_0x277695,{'showHidden':![],'depth':null}));ami[_0x2180('0x3f')]('custom:queuecallerabandon',_0x277695);}}else{this[_0x2180('0x14')][_0x277695['queue']][_0x2180('0x55')]+=this[_0x2180('0x14')][_0x277695[_0x2180('0x65')]][_0x2180('0xb7')];}logger[_0x2180('0x67')](_0x2180('0xc1'),_0x1128cb['uniqueid'],_0x277695[_0x2180('0x47')],_0x277695['type'],_0x1128cb['cause-txt']);this['channels'][_0x1128cb[_0x2180('0x44')]]=_0x277695;this[_0x2180('0x3d')](_0x277695,_0x2180('0x26'));this[_0x2180('0x4f')](this[_0x2180('0x14')][_0x277695['queue']],_0x2180('0x26'));}}logger[_0x2180('0x41')](_0x2180('0xc2'),_0x1128cb[_0x2180('0x44')],util['inspect'](this[_0x2180('0x10')][_0x1128cb['uniqueid']],{'showHidden':![],'depth':null}));ami['emit'](_0x2180('0xc3'),this['queueReports'][_0x1128cb[_0x2180('0x44')]]);if(_0x277695[_0x2180('0x4a')]===_0x2180('0x4b'))return;delete this[_0x2180('0x10')][_0x1128cb['uniqueid']];delete this[_0x2180('0x12')][_0x1128cb[_0x2180('0x44')]];}if(this[_0x2180('0xa2')][_0x1128cb[_0x2180('0x44')]]){delete this['variables'][_0x1128cb['uniqueid']];}}}catch(_0x157ec4){logger['error'](_0x2180('0xb5'),_0x1128cb['uniqueid'],util[_0x2180('0x45')](_0x157ec4,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2180('0xb')]['syncAttendedTransfer']=function(_0xde1b54){try{if(this[_0x2180('0x5f')](_0xde1b54)){logger[_0x2180('0x41')](_0x2180('0xc4'),_0xde1b54[_0x2180('0x44')],util[_0x2180('0x45')](_0xde1b54,{'showHidden':![],'depth':null}));var _0x25e645;var _0x4cbc0c;var _0x27891d;if(this[_0x2180('0x10')][_0xde1b54[_0x2180('0xc5')]]){_0x25e645=_['last'](this[_0x2180('0x10')][_0xde1b54['transfereeuniqueid']]);_0x25e645['transferexten']=_0xde1b54['secondtransfererexten'];_0x25e645[_0x2180('0x97')]=_0xde1b54[_0x2180('0xc6')];_0x25e645[_0x2180('0x4a')]=_0x2180('0x4b');_0x25e645['transfer']=!![];_0x25e645['transfertype']=_0x2180('0xc7');if(this[_0x2180('0x10')][_0xde1b54[_0x2180('0xc6')]]){_0x27891d=this[_0x2180('0x10')][_0xde1b54[_0x2180('0xc6')]];this[_0x2180('0x10')][_0xde1b54[_0x2180('0xc6')]]=this[_0x2180('0x10')][_0xde1b54[_0x2180('0xc5')]];this['queueReports'][_0xde1b54[_0x2180('0xc5')]]=_0x27891d;_0x4cbc0c=_['last'](this[_0x2180('0x10')][_0xde1b54[_0x2180('0xc5')]]);_0x4cbc0c[_0x2180('0x33')]=!![];}logger[_0x2180('0x67')](_0x2180('0xc8'),_0xde1b54[_0x2180('0x44')],_0x25e645['name'],_0x25e645[_0x2180('0x50')],_0x25e645[_0x2180('0xc9')],_0x25e645[_0x2180('0x97')]);}else if(this['queueReports'][_0xde1b54['transfertargetuniqueid']]){_0x25e645=_[_0x2180('0x7f')](this[_0x2180('0x10')][_0xde1b54[_0x2180('0xca')]]);_0x25e645[_0x2180('0xc9')]=_0xde1b54['origtransfererexten'];_0x25e645['transferuniqueid']=_0xde1b54[_0x2180('0xcb')];_0x25e645[_0x2180('0x4a')]=_0x2180('0x4b');_0x25e645['transfer']=!![];_0x25e645[_0x2180('0xcc')]=_0x2180('0xc7');if(this[_0x2180('0x10')][_0xde1b54[_0x2180('0xcb')]]){_0x27891d=this[_0x2180('0x10')][_0xde1b54['origtransfereruniqueid']];this[_0x2180('0x10')][_0xde1b54['origtransfereruniqueid']]=this['queueReports'][_0xde1b54[_0x2180('0xca')]];this[_0x2180('0x10')][_0xde1b54['transfertargetuniqueid']]=_0x27891d;_0x4cbc0c=_[_0x2180('0x7f')](this[_0x2180('0x10')][_0xde1b54[_0x2180('0xca')]]);_0x4cbc0c[_0x2180('0x33')]=!![];}logger['info']('[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s',_0xde1b54[_0x2180('0x44')],_0x25e645[_0x2180('0x47')],_0x25e645[_0x2180('0x50')],_0x25e645[_0x2180('0xc9')],_0x25e645['transferuniqueid']);}else if(this[_0x2180('0x10')][_0xde1b54[_0x2180('0xcb')]]){_0x25e645=_[_0x2180('0x7f')](this[_0x2180('0x10')][_0xde1b54['origtransfereruniqueid']]);_0x25e645[_0x2180('0xc9')]=_0xde1b54['origtransfererexten'];_0x25e645[_0x2180('0x97')]=_0xde1b54[_0x2180('0xcb')];_0x25e645[_0x2180('0x4a')]=_0x2180('0x4b');_0x25e645[_0x2180('0x8e')]=!![];_0x25e645[_0x2180('0xcc')]=_0x2180('0xc7');}else if(this[_0x2180('0x10')][_0xde1b54[_0x2180('0xc6')]]){_0x25e645=_[_0x2180('0x7f')](this[_0x2180('0x10')][_0xde1b54[_0x2180('0xc6')]]);_0x25e645['transferexten']=_0xde1b54['secondtransfererexten'];_0x25e645[_0x2180('0x97')]=_0xde1b54[_0x2180('0xc6')];_0x25e645['queuecallerexitreason']=_0x2180('0x4b');_0x25e645[_0x2180('0x8e')]=!![];_0x25e645[_0x2180('0xcc')]=_0x2180('0xc7');}}}catch(_0x4c9a25){logger[_0x2180('0x38')](_0x2180('0xc4'),_0xde1b54['uniqueid'],util[_0x2180('0x45')](_0x4c9a25,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x2180('0x2c')]=function(_0x1f2e34){try{if(this[_0x2180('0x5f')](_0x1f2e34)){logger[_0x2180('0x41')]('[%s][voiceQueueReport][blindtransfer]',_0x1f2e34[_0x2180('0x44')],util[_0x2180('0x45')](_0x1f2e34,{'showHidden':![],'depth':null}));if(this[_0x2180('0x10')][_0x1f2e34[_0x2180('0xc5')]]){var _0x195a5e=_[_0x2180('0x7f')](this[_0x2180('0x10')][_0x1f2e34['transfereeuniqueid']]);_0x195a5e[_0x2180('0x4a')]=_0x2180('0xcd');_0x195a5e[_0x2180('0x8e')]=!![];_0x195a5e[_0x2180('0xcc')]='BLIND';_0x195a5e[_0x2180('0xc9')]=_0x1f2e34[_0x2180('0xce')];_0x195a5e[_0x2180('0x97')]=_0x1f2e34[_0x2180('0xc5')];logger[_0x2180('0x67')](_0x2180('0xcf'),_0x1f2e34[_0x2180('0x44')],_0x195a5e[_0x2180('0x47')],_0x195a5e[_0x2180('0x50')],_0x195a5e['transferexten'],_0x195a5e[_0x2180('0x97')]);this['syncHangup']({'event':_0x2180('0xd0'),'uniqueid':_0x1f2e34[_0x2180('0xc5')],'context':_0x1f2e34['context'],'channel':_0x1f2e34[_0x2180('0xd1')]});}}}catch(_0x4a6d25){logger['error'](_0x2180('0xd2'),_0x1f2e34[_0x2180('0x44')],util[_0x2180('0x45')](_0x4a6d25,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncMusicOnHoldStart']=function(_0x21c173){try{if(this['isNotNull'](_0x21c173)){logger[_0x2180('0x41')]('[%s][voiceQueueReport][musiconholdstart]',_0x21c173[_0x2180('0x44')],util[_0x2180('0x45')](_0x21c173,{'showHidden':![],'depth':null}));if(this[_0x2180('0x10')][_0x21c173[_0x2180('0x44')]]){var _0x21144f=_['last'](this[_0x2180('0x10')][_0x21c173[_0x2180('0x44')]]);if(!_[_0x2180('0x34')](_0x21144f['queuecallerleaveAt'])){_0x21144f[_0x2180('0xd3')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');logger[_0x2180('0x67')]('[%s][voiceQueueReport][musiconholdstart]\x20mohstarttime:%s',_0x21c173[_0x2180('0x44')],_0x21144f['mohstarttime']);}}}}catch(_0x55cee2){logger[_0x2180('0x38')]('[%s][voiceQueueReport][musiconholdstart]',_0x21c173['uniqueid'],util['inspect'](_0x55cee2,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2180('0xb')][_0x2180('0xd4')]=function(_0x5b3894){try{if(this[_0x2180('0x5f')](_0x5b3894)){logger[_0x2180('0x41')]('[%s][voiceQueueReport][musiconholdstop]',_0x5b3894[_0x2180('0x44')],util[_0x2180('0x45')](_0x5b3894,{'showHidden':![],'depth':null}));if(this[_0x2180('0x10')][_0x5b3894[_0x2180('0x44')]]){var _0x59af43=_['last'](this[_0x2180('0x10')][_0x5b3894[_0x2180('0x44')]]);if(!_[_0x2180('0x34')](_0x59af43[_0x2180('0xd3')])){_0x59af43['mohtime']+=moment()[_0x2180('0xd5')](0x0)[_0x2180('0xb8')](_0x59af43[_0x2180('0xd3')],'seconds');logger[_0x2180('0x67')]('[%s][voiceQueueReport][musiconholdstop]\x20mohtime:%s',_0x5b3894[_0x2180('0x44')],_0x59af43[_0x2180('0xd6')]);delete _0x59af43[_0x2180('0xd3')];}}}}catch(_0x55aa2){logger[_0x2180('0x38')](_0x2180('0xd7'),_0x5b3894[_0x2180('0x44')],util[_0x2180('0x45')](_0x55aa2,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2180('0xb')][_0x2180('0xd8')]=function(_0x5eba08){try{if(this[_0x2180('0x5f')](_0x5eba08)){logger[_0x2180('0x41')](_0x2180('0xd9'),_0x5eba08['uniqueid'],util['inspect'](_0x5eba08,{'showHidden':![],'depth':null}));if(_0x5eba08['application'][_0x2180('0xda')]()===_0x2180('0xdb')){_0x5eba08['applicationdata']=_0x5eba08[_0x2180('0xdc')]&&_0x5eba08[_0x2180('0xdc')][_0x2180('0xdd')](_0x2180('0xde'))?_0x5eba08['appdata']:(_0x5eba08[_0x2180('0xdc')]||_0x5eba08['applicationdata'])['toLowerCase']();if(_[_0x2180('0xdd')](_0x5eba08[_0x2180('0xdf')]['toLowerCase'](),_0x2180('0xe0'))){logger[_0x2180('0x67')](_0x2180('0xe1'),_0x5eba08[_0x2180('0x44')],_0x5eba08['application'],_0x5eba08[_0x2180('0xdf')]);if(_[_0x2180('0x70')](this[_0x2180('0x12')][_0x5eba08['uniqueid']]))this[_0x2180('0x12')][_0x5eba08[_0x2180('0x44')]]={};var _0x52da37=_0x5eba08[_0x2180('0xdf')][_0x2180('0xe2')]('=');var _0x37858d=_0x52da37[0x0][_0x2180('0xda')]()[_0x2180('0xe3')](/cdr\((.*)\)/);if(_0x37858d)this[_0x2180('0x12')][_0x5eba08[_0x2180('0x44')]][_0x37858d[0x1]]=_0x52da37[0x1];}}}}catch(_0x2b89d4){logger[_0x2180('0x38')](_0x2180('0xe4'),_0x5eba08[_0x2180('0x44')],util[_0x2180('0x45')](_0x2b89d4,{'showHidden':![],'depth':null}));}};module[_0x2180('0xe5')]=VoiceQueueReport;
\ No newline at end of file
+var _0x6a24=['callerid','Interval','isNotNull','isUndefined','[voiceQueueReport][queues]','[voiceQueueReport][queuesummary]','queue','[voiceQueueReport][queuesummary]\x20event:','info','[voiceQueueReport][queuesummary]\x20name:%s','countBy','callers','loggedin','toNumber','[voiceQueueReport][queuesummary]\x20sending\x20queuesummary\x20event:','custom:queuesummary','syncQueueSummaryComplete','[voiceQueueReport][queuesummarycomplete]\x20event:','[%s][voiceQueueReport][queuecallerjoin]','queuecallerjoinAt','position','count','routealias','[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s','merge','pick','keys','push','[%s][voiceQueueReport][queuecallerabandon]','last','queuecallercompleteAt','holdtime','originalposition','queuecallerabandon','queuecallerabandonAt','YYYY-MM-DD\x20HH:mm:ss','ABANDONED','[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s','connectedlinenum','connectedlinename','[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s','queuecallerleave','[%s][voiceQueueReport][agentconnect]','queuecallercomplete','[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT','syncAgentComplete','assigned','lastAssignedTo','membername','transfer','COMPLETED','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED','startsWith','channel','local/','linkedid','queuecallerexit','queuecallerexitAt','add','seconds','FORWARDTRANSFER','transferexten','destexten','reason','toUpperCase','[%s][voiceQueueReport][agentcomplete]','addVariable','variable','value','CONTINUE','TIMEOUT','timeout','queuecallerleaveAt','[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:','queueposition','EXITWITHKEY','[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s','[%s][voiceQueueReport][varset]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberpenalty','memberrealtime','includes','syncHangup','[%s][voiceQueueReport][hangup]','length','milliseconds','diff','lastevent','custom:queuecallerunmanaged','custom:queuecallerabandon','[%s][voiceQueueReport][hangup]\x20name:%s\x20type:%s\x20reason:%s','[%s][voiceQueueReport][hangup]\x20sending\x20voiceQueueReport\x20event:','custom:voiceQueueReport','[%s][voiceQueueReport][attendedtransfer]','transfereeuniqueid','secondtransfererexten','transferuniqueid','secondtransfereruniqueid','[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','transfertargetuniqueid','origtransfererexten','transfertype','origtransfereruniqueid','ATTENDED','[%s][voiceQueueReport][blindtransfer]','BLINDTRANSFER','BLIND','extension','[%s][voiceQueueReport][blindTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','BlindTransfer','context','mohstarttime','[%s][voiceQueueReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceQueueReport][musiconholdstart]','[%s][voiceQueueReport][musiconholdstop]','mohtime','[%s][voiceQueueReport][musiconholdstop]\x20mohtime:%s','syncNewExten','[%s][voiceQueueReport][newexten]\x20event:','set','applicationdata','appdata','CDR(routeAlias)','toLowerCase','cdr(','[%s][voiceQueueReport][newexten]\x20application:%s\x20appdata:%s','application','split','match','[%s][voiceQueueReport][newexten]','exports','lodash','moment','util','ioredis','../../../config/logger','ami','../ami','../model/queueReport','redis','defaults','localhost','socket.io-emitter','prototype','enqueue','tail','sequence','queueReports','agents','channels','queueChannels','voiceQueues','flagQueueSummary','campaigns','variables','queuesummary','syncQueueSummary','bind','queuesummarycomplete','queuecallerjoin','syncQueueCallerJoin','syncQueueCallerAbandon','syncQueueCallerLeave','agentcomplete','syncAgentConnect','varset','syncVarSet','hangup','fullybooted','syncFullyBooted','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','blindtransfer','syncBlindTransfer','loopQueueSummary','loopQueueShow','isEmpty','hasOwnProperty','originated','talking','waiting','queueStatusComplete','unlockRR','clearZombieChannels','switch','isNil','Action','status','catch','No\x20such\x20channel','error','inspect','[%s][voiceQueueReport][checkVariables]','[FullyBooted]\x20clear\x20realtime','emitVoiceQueueChannelRemove','clearqueuereport','emit','emitVoiceQueueChannelSave','debug','[%s][voiceQueueReport][',']\x20sending\x20voice_queue_channel:save\x20event:','format','name','voice_queue_channel:save',']\x20sending\x20voice_queue_channel:remove\x20event:','uniqueid','queuecallerexitreason','ATTENDEDTRANSFER','voice:queue:%s','emitVoiceQueueSummary','type','inbound','answered','available','loggedIn','pTalking','sumBillable','sumDuration','unmanaged','abandoned','Trunk','active'];(function(_0x134bca,_0x19fc26){var _0x5a1754=function(_0x3ecec1){while(--_0x3ecec1){_0x134bca['push'](_0x134bca['shift']());}};_0x5a1754(++_0x19fc26);}(_0x6a24,0x17c));var _0x46a2=function(_0xbe5a49,_0xc00e95){_0xbe5a49=_0xbe5a49-0x0;var _0x1e8e57=_0x6a24[_0xbe5a49];return _0x1e8e57;};'use strict';var _=require(_0x46a2('0x0'));var moment=require(_0x46a2('0x1'));var util=require(_0x46a2('0x2'));var md5=require('md5');var Redis=require(_0x46a2('0x3'));var config=require('../../../config/environment');var logger=require(_0x46a2('0x4'))(_0x46a2('0x5'));var ami=require(_0x46a2('0x6'));var QueueReport=require(_0x46a2('0x7'));config[_0x46a2('0x8')]=_[_0x46a2('0x9')](config[_0x46a2('0x8')],{'host':_0x46a2('0xa'),'port':0x18eb});var io=require(_0x46a2('0xb'))(new Redis(config['redis']));var Sequence=function(){};Sequence[_0x46a2('0xc')][_0x46a2('0xd')]=function(_0x2be36a){this['tail']=this[_0x46a2('0xe')]?this['tail']['finally'](_0x2be36a):_0x2be36a();};function VoiceQueueReport(_0x39e786){this[_0x46a2('0xf')]=new Sequence();this[_0x46a2('0x10')]={};this[_0x46a2('0x11')]=_0x39e786[_0x46a2('0x11')];this[_0x46a2('0x12')]=_0x39e786[_0x46a2('0x13')];this[_0x46a2('0x14')]=_0x39e786['voiceQueues'];this[_0x46a2('0x15')]=!![];this[_0x46a2('0x16')]=_0x39e786[_0x46a2('0x16')];this[_0x46a2('0x17')]={};ami['on'](_0x46a2('0x18'),this[_0x46a2('0x19')][_0x46a2('0x1a')](this));ami['on'](_0x46a2('0x1b'),this['syncQueueSummaryComplete'][_0x46a2('0x1a')](this));ami['on'](_0x46a2('0x1c'),this[_0x46a2('0x1d')][_0x46a2('0x1a')](this));ami['on']('queuecallerabandon',this[_0x46a2('0x1e')][_0x46a2('0x1a')](this));ami['on']('queuecallerleave',this[_0x46a2('0x1f')]['bind'](this));ami['on'](_0x46a2('0x20'),this['syncAgentComplete'][_0x46a2('0x1a')](this));ami['on']('agentconnect',this[_0x46a2('0x21')][_0x46a2('0x1a')](this));ami['on'](_0x46a2('0x22'),this[_0x46a2('0x23')][_0x46a2('0x1a')](this));ami['on'](_0x46a2('0x24'),this['syncHangup'][_0x46a2('0x1a')](this));ami['on'](_0x46a2('0x25'),this[_0x46a2('0x26')][_0x46a2('0x1a')](this));ami['on']('musiconholdstart',this['syncMusicOnHoldStart'][_0x46a2('0x1a')](this));ami['on'](_0x46a2('0x27'),this[_0x46a2('0x28')][_0x46a2('0x1a')](this));ami['on'](_0x46a2('0x29'),this['syncAttendedTransfer'][_0x46a2('0x1a')](this));ami['on'](_0x46a2('0x2a'),this[_0x46a2('0x2b')][_0x46a2('0x1a')](this));this[_0x46a2('0x2c')]();this[_0x46a2('0x2d')]();}function clearChannels(_0xf01471){if(!_[_0x46a2('0x2e')](_0xf01471)){for(var _0x38650b in _0xf01471){if(_0xf01471[_0x46a2('0x2f')](_0x38650b)){delete _0xf01471[_0x38650b];}}}}function clearCampaigns(_0x52d045){if(!_[_0x46a2('0x2e')](_0x52d045)){for(var _0x2168e3 in _0x52d045){if(_0x52d045['hasOwnProperty'](_0x2168e3)){_0x52d045[_0x2168e3][_0x46a2('0x30')]=0x0;}}}}function clearVoiceQueues(_0x17853a){if(!_[_0x46a2('0x2e')](_0x17853a)){for(var _0x27d403 in _0x17853a){if(_0x17853a['hasOwnProperty'](_0x27d403)){_0x17853a[_0x27d403][_0x46a2('0x30')]=0x0;_0x17853a[_0x27d403][_0x46a2('0x31')]=0x0;_0x17853a[_0x27d403]['pTalking']=0x0;_0x17853a[_0x27d403][_0x46a2('0x32')]=0x0;_0x17853a[_0x27d403][_0x46a2('0x33')]=!![];}}}}function clearAgentBooked(_0x19e628){if(!_[_0x46a2('0x2e')](_0x19e628)){for(var _0x5452d3 in _0x19e628){if(_0x19e628[_0x46a2('0x2f')](_0x5452d3)){_0x19e628[_0x5452d3][_0x46a2('0x34')]=!![];}}}}VoiceQueueReport[_0x46a2('0xc')][_0x46a2('0x35')]=function(){var _0x14606f=this;for(var _0x195b35 in this[_0x46a2('0x12')]){if(this[_0x46a2('0x12')][_0x46a2('0x2f')](_0x195b35)&&!this['channels'][_0x195b35][_0x46a2('0x36')]){this[_0x46a2('0xf')]['enqueue'](function(){if(!_[_0x46a2('0x37')](_0x14606f['channels'][_0x195b35])){return ami[_0x46a2('0x38')]({'action':_0x46a2('0x39'),'channel':_0x14606f[_0x46a2('0x12')][_0x195b35]['channel']})[_0x46a2('0x3a')](function(_0x20522b){if(_0x20522b['message']===_0x46a2('0x3b')){setTimeout(function(){if(_0x14606f[_0x46a2('0x12')][_0x195b35]){delete _0x14606f[_0x46a2('0x12')][_0x195b35];logger[_0x46a2('0x3c')]('[%s][voiceQueueReport][checkChannel]',_0x195b35,util['inspect'](_0x20522b,{'showHidden':![],'depth':null}));}if(_0x14606f['queueReports'][_0x195b35]){delete _0x14606f[_0x46a2('0x10')][_0x195b35];logger['error']('[%s][voiceQueueReport][checkQueueReport]',_0x195b35,util[_0x46a2('0x3d')](_0x20522b,{'showHidden':![],'depth':null}));}if(_0x14606f[_0x46a2('0x17')][_0x195b35]){delete _0x14606f[_0x46a2('0x17')][_0x195b35];logger[_0x46a2('0x3c')](_0x46a2('0x3e'),_0x195b35,util['inspect'](_0x20522b,{'showHidden':![],'depth':null}));}},0x1f40);}});}});}}};VoiceQueueReport['prototype']['syncFullyBooted']=function(){logger[_0x46a2('0x3c')](_0x46a2('0x3f'));clearChannels(this['channels']);this['clearQueueReport'](this[_0x46a2('0x10')]);clearAgentBooked(this[_0x46a2('0x11')]);clearVoiceQueues(this[_0x46a2('0x14')]);clearCampaigns(this[_0x46a2('0x16')]);};VoiceQueueReport[_0x46a2('0xc')]['clearQueueReport']=function(_0x291f5d){var _0x5151d3=this;if(!_[_0x46a2('0x2e')](_0x291f5d)){for(var _0x15b458 in _0x291f5d){if(_0x291f5d[_0x46a2('0x2f')](_0x15b458)){_0x5151d3[_0x46a2('0x40')](_0x291f5d[_0x15b458],_0x46a2('0x41'));delete _0x291f5d[_0x15b458];}}}};VoiceQueueReport['prototype'][_0x46a2('0x42')]=function(_0xe806fd,_0xb94a21,_0x2286cd){io['to'](_0xe806fd)[_0x46a2('0x42')](_0xb94a21,_0x2286cd);};VoiceQueueReport['prototype'][_0x46a2('0x43')]=function(_0x4cf17d,_0x14b7a6){logger[_0x46a2('0x44')](_0x46a2('0x45')+_0x14b7a6+_0x46a2('0x46'),_0x4cf17d['uniqueid'],util['inspect'](_0x4cf17d,{'showHidden':![],'depth':null}));this[_0x46a2('0x42')](util[_0x46a2('0x47')]('voice:queue:%s',_0x4cf17d[_0x46a2('0x48')]),_0x46a2('0x49'),_0x4cf17d);io[_0x46a2('0x42')]('voice_queue_presence:save',_0x4cf17d);};VoiceQueueReport['prototype'][_0x46a2('0x40')]=function(_0x17a329,_0x5119b9){logger['debug'](_0x46a2('0x45')+_0x5119b9+_0x46a2('0x4a'),_0x17a329[_0x46a2('0x4b')],util[_0x46a2('0x3d')](_0x17a329,{'showHidden':![],'depth':null}));if(_0x17a329[_0x46a2('0x4c')]===_0x46a2('0x4d'))return;this[_0x46a2('0x42')](util[_0x46a2('0x47')](_0x46a2('0x4e'),_0x17a329[_0x46a2('0x48')]),'voice_queue_channel:remove',_0x17a329);io[_0x46a2('0x42')]('voice_queue_presence:remove',_0x17a329);};VoiceQueueReport[_0x46a2('0xc')][_0x46a2('0x4f')]=function(_0x5acd77,_0x515d30){if(_0x5acd77[_0x46a2('0x50')]===_0x46a2('0x51')){var _0x38504b={'id':_0x5acd77['id'],'name':_0x5acd77[_0x46a2('0x48')],'strategy':_0x5acd77['strategy'],'answered':_0x5acd77[_0x46a2('0x52')],'available':_0x5acd77[_0x46a2('0x53')],'loggedIn':_0x5acd77[_0x46a2('0x54')],'pTalking':_0x5acd77[_0x46a2('0x55')],'sumBillable':_0x5acd77[_0x46a2('0x56')],'sumDuration':_0x5acd77[_0x46a2('0x57')],'sumHoldTime':_0x5acd77['sumHoldTime']||0x0,'talking':_0x5acd77['talking'],'total':_0x5acd77['total'],'type':_0x5acd77[_0x46a2('0x50')],'unmanaged':_0x5acd77[_0x46a2('0x58')],'abandoned':_0x5acd77[_0x46a2('0x59')],'waiting':_0x5acd77['waiting']};if(_0x5acd77[_0x46a2('0x5a')]){_0x38504b['Trunk']={'id':_0x5acd77[_0x46a2('0x5a')]['id'],'name':_0x5acd77[_0x46a2('0x5a')][_0x46a2('0x48')],'active':_0x5acd77['Trunk'][_0x46a2('0x5b')],'callerid':_0x5acd77[_0x46a2('0x5a')][_0x46a2('0x5c')]};}if(_0x5acd77[_0x46a2('0x5d')]){_0x38504b[_0x46a2('0x5d')]={'id':_0x5acd77['Interval']['id'],'name':_0x5acd77['Interval']['name']};}var _0x129618=md5(JSON['stringify'](_0x38504b));if(_0x5acd77['md5']!==_0x129618){_0x5acd77['md5']=_0x129618;logger['debug']('[voiceQueueReport]['+_0x515d30+']\x20sending\x20voice_queue:save\x20event:',util['inspect'](_0x38504b,{'showHidden':![],'depth':null}));this[_0x46a2('0x42')](util[_0x46a2('0x47')](_0x46a2('0x4e'),_0x38504b['name']),'voice_queue:save',_0x38504b);}}};VoiceQueueReport[_0x46a2('0xc')][_0x46a2('0x5e')]=function(_0x371fc9){return _0x371fc9!==null&&!_[_0x46a2('0x5f')](_0x371fc9);};VoiceQueueReport[_0x46a2('0xc')][_0x46a2('0x2d')]=function(){var _0x933b83=this;setInterval(function(){_0x933b83[_0x46a2('0x35')]();ami['Action']({'action':'queues'})[_0x46a2('0x3a')](function(_0x1dac4c){logger[_0x46a2('0x3c')](_0x46a2('0x60'),util[_0x46a2('0x3d')](_0x1dac4c,{'showHidden':![],'depth':null}));});},0x2710);};VoiceQueueReport[_0x46a2('0xc')]['loopQueueSummary']=function(){var _0x204a05=this;setInterval(function(){if(_0x204a05[_0x46a2('0x15')]){return ami[_0x46a2('0x38')]({'action':_0x46a2('0x18')})['then'](function(){_0x204a05[_0x46a2('0x15')]=![];})[_0x46a2('0x3a')](function(_0x3ea933){logger[_0x46a2('0x3c')](_0x46a2('0x61'),util[_0x46a2('0x3d')](_0x3ea933,{'showHidden':![],'depth':null}));});}},0x3e8);};VoiceQueueReport[_0x46a2('0xc')][_0x46a2('0x19')]=function(_0x16e7ba){try{if(this[_0x46a2('0x5e')](_0x16e7ba)&&this['isNotNull'](_0x16e7ba[_0x46a2('0x62')])){logger[_0x46a2('0x44')](_0x46a2('0x63'),util['inspect'](_0x16e7ba,{'showHidden':![],'depth':null}));if(this['voiceQueues'][_0x16e7ba[_0x46a2('0x62')]]){logger[_0x46a2('0x64')](_0x46a2('0x65'),_0x16e7ba[_0x46a2('0x62')]);var _0x313db0=_[_0x46a2('0x66')](this['channels'],_0x46a2('0x62'))[_0x16e7ba['queue']]||0x0;var _0x5c99e7=_0x313db0-_0x16e7ba[_0x46a2('0x67')];if(this[_0x46a2('0x14')][_0x16e7ba[_0x46a2('0x62')]][_0x46a2('0x32')]!==_['toNumber'](_0x16e7ba['callers'])||this['voiceQueues'][_0x16e7ba[_0x46a2('0x62')]][_0x46a2('0x54')]!==_['toNumber'](_0x16e7ba[_0x46a2('0x68')])||this[_0x46a2('0x14')][_0x16e7ba[_0x46a2('0x62')]][_0x46a2('0x53')]!==_[_0x46a2('0x69')](_0x16e7ba['available'])||this['voiceQueues'][_0x16e7ba[_0x46a2('0x62')]][_0x46a2('0x31')]!==_0x5c99e7){this[_0x46a2('0x14')][_0x16e7ba['queue']]['waiting']=_[_0x46a2('0x69')](_0x16e7ba['callers']);this[_0x46a2('0x14')][_0x16e7ba[_0x46a2('0x62')]][_0x46a2('0x54')]=_[_0x46a2('0x69')](_0x16e7ba[_0x46a2('0x68')]);this[_0x46a2('0x14')][_0x16e7ba[_0x46a2('0x62')]][_0x46a2('0x53')]=_[_0x46a2('0x69')](_0x16e7ba[_0x46a2('0x53')]);this['voiceQueues'][_0x16e7ba[_0x46a2('0x62')]][_0x46a2('0x31')]=_0x5c99e7>0x0?_0x5c99e7:0x0;this[_0x46a2('0x14')][_0x16e7ba['queue']]['talking']=this[_0x46a2('0x14')][_0x16e7ba[_0x46a2('0x62')]][_0x46a2('0x31')]>_[_0x46a2('0x69')](_0x16e7ba[_0x46a2('0x68')])?_[_0x46a2('0x69')](_0x16e7ba[_0x46a2('0x68')]):this[_0x46a2('0x14')][_0x16e7ba[_0x46a2('0x62')]][_0x46a2('0x31')];this[_0x46a2('0x4f')](this[_0x46a2('0x14')][_0x16e7ba['queue']],_0x46a2('0x18'));}logger[_0x46a2('0x44')](_0x46a2('0x6a'),util[_0x46a2('0x3d')](this[_0x46a2('0x14')][_0x16e7ba['queue']],{'showHidden':![],'depth':null}));ami['emit'](_0x46a2('0x6b'),this[_0x46a2('0x14')][_0x16e7ba[_0x46a2('0x62')]]);}}}catch(_0x1bfac4){logger[_0x46a2('0x3c')]('[voiceQueueReport][queuesummary]',util['inspect'](_0x1bfac4,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x46a2('0x6c')]=function(_0x49bfdf){logger[_0x46a2('0x44')](_0x46a2('0x6d'),util[_0x46a2('0x3d')](_0x49bfdf,{'showHidden':![],'depth':null}));this['flagQueueSummary']=!![];};VoiceQueueReport[_0x46a2('0xc')][_0x46a2('0x1d')]=function(_0x34c729){try{if(this[_0x46a2('0x5e')](_0x34c729)){logger['debug'](_0x46a2('0x6e'),_0x34c729[_0x46a2('0x4b')],util[_0x46a2('0x3d')](_0x34c729,{'showHidden':![],'depth':null}));if(_[_0x46a2('0x5f')](this['queueReports'][_0x34c729[_0x46a2('0x4b')]]))this[_0x46a2('0x10')][_0x34c729[_0x46a2('0x4b')]]=[];if(_[_0x46a2('0x5f')](this[_0x46a2('0x12')][_0x34c729[_0x46a2('0x4b')]]))this['channels'][_0x34c729[_0x46a2('0x4b')]]={};var _0x5345eb=new QueueReport();_0x5345eb[_0x46a2('0x48')]=_0x34c729[_0x46a2('0x62')];_0x5345eb[_0x46a2('0x50')]=this[_0x46a2('0x14')][_0x5345eb[_0x46a2('0x48')]]&&this[_0x46a2('0x14')][_0x5345eb[_0x46a2('0x48')]][_0x46a2('0x50')]?this[_0x46a2('0x14')][_0x5345eb['name']][_0x46a2('0x50')]||'inbound':_0x46a2('0x51');_0x5345eb[_0x46a2('0x62')]=_0x34c729['queue'];_0x5345eb[_0x46a2('0x6f')]=moment()[_0x46a2('0x47')]('YYYY-MM-DD\x20HH:mm:ss');_0x5345eb[_0x46a2('0x70')]=_0x34c729['position'];_0x5345eb[_0x46a2('0x71')]=_0x34c729[_0x46a2('0x71')];_0x5345eb['uniqueid']=_0x34c729['uniqueid'];_0x5345eb['routealias']=this[_0x46a2('0x12')][_0x34c729[_0x46a2('0x4b')]][_0x46a2('0x72')];logger['info'](_0x46a2('0x73'),_0x5345eb[_0x46a2('0x48')],_0x5345eb['type']);_[_0x46a2('0x74')](_0x5345eb,_[_0x46a2('0x75')](_0x34c729,_[_0x46a2('0x76')](_0x5345eb)));this[_0x46a2('0x10')][_0x34c729[_0x46a2('0x4b')]][_0x46a2('0x77')](_0x5345eb);this['channels'][_0x34c729[_0x46a2('0x4b')]]=_0x5345eb;this[_0x46a2('0x43')](_0x5345eb,_0x46a2('0x1c'));}}catch(_0x21f316){logger[_0x46a2('0x3c')](_0x46a2('0x6e'),_0x34c729[_0x46a2('0x4b')],util[_0x46a2('0x3d')](_0x21f316,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x46a2('0xc')]['syncQueueCallerAbandon']=function(_0xb1fee3){try{if(this[_0x46a2('0x5e')](_0xb1fee3)){logger[_0x46a2('0x44')](_0x46a2('0x78'),_0xb1fee3['uniqueid'],util[_0x46a2('0x3d')](_0xb1fee3,{'showHidden':![],'depth':null}));if(this[_0x46a2('0x10')][_0xb1fee3[_0x46a2('0x4b')]]){var _0x2c75f1=_[_0x46a2('0x79')](this[_0x46a2('0x10')][_0xb1fee3[_0x46a2('0x4b')]]);_0x2c75f1['queuecallercomplete']=![];_0x2c75f1[_0x46a2('0x7a')]=null;_0x2c75f1[_0x46a2('0x7b')]=_0xb1fee3['holdtime'];_0x2c75f1[_0x46a2('0x7c')]=_0xb1fee3[_0x46a2('0x7c')];_0x2c75f1[_0x46a2('0x7d')]=!![];_0x2c75f1[_0x46a2('0x7e')]=moment()[_0x46a2('0x47')](_0x46a2('0x7f'));_0x2c75f1['queuecallerexitreason']=_0x46a2('0x80');_0x2c75f1['lastAssignedTo']=null;logger[_0x46a2('0x64')](_0x46a2('0x81'),_0x2c75f1[_0x46a2('0x48')],_0x2c75f1['type']);this[_0x46a2('0x12')][_0xb1fee3[_0x46a2('0x4b')]]=_0x2c75f1;this[_0x46a2('0x40')](_0x2c75f1,_0x46a2('0x7d'));}}}catch(_0x5eda5d){logger[_0x46a2('0x3c')]('[%s][voiceQueueReport][queuecallerabandon]',_0xb1fee3[_0x46a2('0x4b')],util[_0x46a2('0x3d')](_0x5eda5d,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x46a2('0x1f')]=function(_0x3d3b46){try{if(this['isNotNull'](_0x3d3b46)){logger[_0x46a2('0x44')]('[%s][voiceQueueReport][queuecallerleave]',_0x3d3b46[_0x46a2('0x4b')],util[_0x46a2('0x3d')](_0x3d3b46,{'showHidden':![],'depth':null}));if(this[_0x46a2('0x10')][_0x3d3b46[_0x46a2('0x4b')]]){var _0x162517=_[_0x46a2('0x79')](this['queueReports'][_0x3d3b46[_0x46a2('0x4b')]]);_0x162517['queuecallerleaveAt']=moment()[_0x46a2('0x47')](_0x46a2('0x7f'));_0x162517['connectedlinenum']=_0x3d3b46[_0x46a2('0x82')];_0x162517[_0x46a2('0x83')]=_0x3d3b46[_0x46a2('0x83')];logger[_0x46a2('0x64')](_0x46a2('0x84'),_0x162517['name'],_0x162517[_0x46a2('0x50')],_0x3d3b46['connectedlinenum'],_0x3d3b46['connectedlinename']);this['channels'][_0x3d3b46['uniqueid']]=_0x162517;this[_0x46a2('0x43')](_0x162517,_0x46a2('0x85'));}}}catch(_0x35702c){logger[_0x46a2('0x3c')]('[%s][voiceQueueReport][queuecallerleave]',_0x3d3b46[_0x46a2('0x4b')],util[_0x46a2('0x3d')](_0x35702c,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x46a2('0xc')]['syncAgentConnect']=function(_0x1adf0f){try{if(this['isNotNull'](_0x1adf0f)){logger[_0x46a2('0x44')](_0x46a2('0x86'),_0x1adf0f[_0x46a2('0x4b')],util[_0x46a2('0x3d')](_0x1adf0f,{'showHidden':![],'depth':null}));if(this[_0x46a2('0x10')][_0x1adf0f['uniqueid']]){var _0x498bf4=_['last'](this[_0x46a2('0x10')][_0x1adf0f[_0x46a2('0x4b')]]);_0x498bf4[_0x46a2('0x87')]=!![];_0x498bf4[_0x46a2('0x4c')]='COMPLETEDBYAGENT';logger['info'](_0x46a2('0x88'),_0x498bf4['name'],_0x498bf4[_0x46a2('0x50')]);}}}catch(_0xd56037){logger[_0x46a2('0x3c')](_0x46a2('0x86'),_0x1adf0f[_0x46a2('0x4b')],util[_0x46a2('0x3d')](_0xd56037,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x46a2('0x89')]=function(_0x3380f6){try{if(this['isNotNull'](_0x3380f6)){logger['debug']('[%s][voiceQueueReport][agentcomplete]',_0x3380f6[_0x46a2('0x4b')],util[_0x46a2('0x3d')](_0x3380f6,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x3380f6[_0x46a2('0x4b')]]){var _0x234548=_[_0x46a2('0x79')](this[_0x46a2('0x10')][_0x3380f6[_0x46a2('0x4b')]]);_0x234548[_0x46a2('0x7d')]=![];_0x234548[_0x46a2('0x7e')]=null;_0x234548[_0x46a2('0x8a')]=!![];_0x234548[_0x46a2('0x8b')]=_0x3380f6[_0x46a2('0x8c')];_0x234548[_0x46a2('0x7b')]=_0x3380f6[_0x46a2('0x7b')];_0x234548['queuecallercomplete']=!![];_0x234548['queuecallerexit']=![];_0x234548['queuecallerexitAt']=null;if(!_0x234548[_0x46a2('0x8d')]){if(_0x3380f6['reason']==_0x46a2('0x8d')){_0x234548[_0x46a2('0x4c')]=_0x46a2('0x8e');logger['info'](_0x46a2('0x8f'),_0x234548[_0x46a2('0x48')],_0x234548[_0x46a2('0x50')]);}else{if(_[_0x46a2('0x90')](_0x3380f6[_0x46a2('0x91')]['toLowerCase'](),_0x46a2('0x92'))){if(this[_0x46a2('0x10')][_0x3380f6['linkedid']]){var _0x33a96a=_['last'](this[_0x46a2('0x10')][_0x3380f6[_0x46a2('0x93')]]);_0x33a96a['queuecallercomplete']=![];_0x33a96a[_0x46a2('0x94')]=!![];_0x33a96a[_0x46a2('0x95')]=moment(_0x234548[_0x46a2('0x6f')])[_0x46a2('0x96')](_0x3380f6[_0x46a2('0x7b')],_0x46a2('0x97'))[_0x46a2('0x47')](_0x46a2('0x7f'));_0x33a96a[_0x46a2('0x4c')]=_0x46a2('0x98');_0x33a96a[_0x46a2('0x8d')]=!![];_0x33a96a['transfertype']='FORWARD';_0x33a96a[_0x46a2('0x99')]=_0x3380f6[_0x46a2('0x9a')];_0x33a96a['transferuniqueid']=_0x3380f6[_0x46a2('0x4b')];logger[_0x46a2('0x64')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER',_0x33a96a[_0x46a2('0x48')],_0x33a96a[_0x46a2('0x50')]);var _0x1f7160=this[_0x46a2('0x10')][_0x3380f6[_0x46a2('0x93')]];this[_0x46a2('0x10')][_0x3380f6[_0x46a2('0x93')]]=this[_0x46a2('0x10')][_0x3380f6[_0x46a2('0x4b')]];this[_0x46a2('0x10')][_0x3380f6[_0x46a2('0x4b')]]=_0x1f7160;}}else{_0x234548['queuecallerexitreason']='COMPLETEDBY'+_0x3380f6[_0x46a2('0x9b')][_0x46a2('0x9c')]();logger['info']('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s',_0x234548[_0x46a2('0x48')],_0x234548['type'],_0x234548[_0x46a2('0x4c')]);}}}this[_0x46a2('0x12')][_0x3380f6[_0x46a2('0x4b')]]=_0x234548;this[_0x46a2('0x40')](_0x234548,_0x46a2('0x20'));}}}catch(_0x4ab6ac){logger['error'](_0x46a2('0x9d'),_0x3380f6[_0x46a2('0x4b')],util[_0x46a2('0x3d')](_0x4ab6ac,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x46a2('0xc')][_0x46a2('0x23')]=function(_0x396831){try{if(this[_0x46a2('0x5e')](_0x396831)){logger[_0x46a2('0x44')]('[%s][voiceQueueReport][varset]',_0x396831[_0x46a2('0x4b')],util['inspect'](_0x396831,{'showHidden':![],'depth':null}));this[_0x46a2('0x9e')](_0x396831['uniqueid'],_['keys'](_0x396831[_0x46a2('0x9f')])[0x0],_0x396831[_0x46a2('0xa0')]);if(this['queueReports'][_0x396831[_0x46a2('0x4b')]]){var _0x1d4c7d=_['last'](this[_0x46a2('0x10')][_0x396831[_0x46a2('0x4b')]]);if(_0x1d4c7d){if(this[_0x46a2('0x5e')](_0x396831['variable'])&&this[_0x46a2('0x5e')](_0x396831[_0x46a2('0x9f')]['queuestatus'])){switch(_0x396831[_0x46a2('0xa0')]){case _0x46a2('0xa1'):_0x1d4c7d[_0x46a2('0x94')]=![];_0x1d4c7d[_0x46a2('0x95')]=null;break;case _0x46a2('0xa2'):_0x1d4c7d['lastevent']=_0x46a2('0xa3');_0x1d4c7d['queuecallerexit']=!![];_0x1d4c7d[_0x46a2('0x95')]=moment()[_0x46a2('0x47')](_0x46a2('0x7f'));_0x1d4c7d[_0x46a2('0xa4')]=moment()[_0x46a2('0x47')](_0x46a2('0x7f'));logger[_0x46a2('0x44')](_0x46a2('0xa5'),_0x396831[_0x46a2('0x4b')],util['inspect'](_0x1d4c7d,{'showHidden':![],'depth':null}));ami[_0x46a2('0x42')]('custom:timeout',_0x1d4c7d);break;default:_0x1d4c7d[_0x46a2('0x94')]=!![];_0x1d4c7d[_0x46a2('0x95')]=moment()[_0x46a2('0x47')](_0x46a2('0x7f'));_0x1d4c7d[_0x46a2('0xa4')]=moment()['format'](_0x46a2('0x7f'));}_0x1d4c7d[_0x46a2('0x7d')]=![];_0x1d4c7d['queuecallerabandonAt']=null;_0x1d4c7d[_0x46a2('0x4c')]=_0x396831[_0x46a2('0xa0')];this['channels'][_0x396831[_0x46a2('0x4b')]]=_0x1d4c7d;this['emitVoiceQueueChannelRemove'](_0x1d4c7d,'varset');}else if(this['isNotNull'](_0x396831[_0x46a2('0x9f')])&&this[_0x46a2('0x5e')](_0x396831[_0x46a2('0x9f')][_0x46a2('0xa6')])){if(!_0x1d4c7d[_0x46a2('0x7d')]){_0x1d4c7d[_0x46a2('0x94')]=!![];_0x1d4c7d['queuecallerexitAt']=moment()['format'](_0x46a2('0x7f'));_0x1d4c7d['queuecallerexitreason']=_0x46a2('0xa7');_0x1d4c7d['queuecallerleaveAt']=moment()[_0x46a2('0x47')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x46a2('0x12')][_0x396831[_0x46a2('0x4b')]]=_0x1d4c7d;}}logger[_0x46a2('0x64')](_0x46a2('0xa8'),_0x396831['uniqueid'],_0x1d4c7d[_0x46a2('0x48')],_0x1d4c7d[_0x46a2('0x50')],_[_0x46a2('0x76')](_0x396831[_0x46a2('0x9f')])[0x0],_0x396831[_0x46a2('0xa0')]);_0x1d4c7d[_0x46a2('0x17')]=this['variables'][_0x396831[_0x46a2('0x4b')]];}}}}catch(_0x25e9c0){logger[_0x46a2('0x3c')](_0x46a2('0xa9'),_0x396831[_0x46a2('0x4b')],util[_0x46a2('0x3d')](_0x25e9c0,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x46a2('0x9e')]=function(_0x249265,_0x318448,_0x1dbfb0){var _0x1e7a23=[_0x46a2('0xaa'),_0x46a2('0xab'),'rtpaudioqosjitter',_0x46a2('0xac'),_0x46a2('0xad'),_0x46a2('0xae'),_0x46a2('0xaf'),_0x46a2('0xb0'),_0x46a2('0xb1'),_0x46a2('0xb2'),_0x46a2('0xb3'),_0x46a2('0xb4'),_0x46a2('0xb5'),_0x46a2('0xb6'),_0x46a2('0xb7'),'memberlastcall',_0x46a2('0x8c'),_0x46a2('0xb8'),_0x46a2('0xb9')];if(!_[_0x46a2('0x37')](_0x318448)&&!_[_0x46a2('0xba')](_0x1e7a23,_0x318448)){if(_['isUndefined'](this[_0x46a2('0x17')][_0x249265])){this[_0x46a2('0x17')][_0x249265]={};}this[_0x46a2('0x17')][_0x249265][_0x318448]=_0x1dbfb0;}};VoiceQueueReport[_0x46a2('0xc')][_0x46a2('0xbb')]=function(_0x589d47){try{if(this[_0x46a2('0x5e')](_0x589d47)){logger[_0x46a2('0x44')](_0x46a2('0xbc'),_0x589d47[_0x46a2('0x4b')],util[_0x46a2('0x3d')](_0x589d47,{'showHidden':![],'depth':null}));if(this[_0x46a2('0x10')][_0x589d47[_0x46a2('0x4b')]]){for(var _0x2ad8a0=0x0,_0x4520aa={};_0x2ad8a0<this['queueReports'][_0x589d47[_0x46a2('0x4b')]][_0x46a2('0xbd')];_0x2ad8a0+=0x1){_0x4520aa=this['queueReports'][_0x589d47[_0x46a2('0x4b')]][_0x2ad8a0];if(this[_0x46a2('0x14')][_0x4520aa[_0x46a2('0x62')]]){if(_0x4520aa[_0x46a2('0x94')]&&_0x4520aa[_0x46a2('0x8d')]!=!![]){this['voiceQueues'][_0x4520aa['queue']][_0x46a2('0x58')]+=0x1;}if(_0x4520aa[_0x46a2('0x7d')]){this[_0x46a2('0x14')][_0x4520aa[_0x46a2('0x62')]]['abandoned']+=0x1;}this[_0x46a2('0x14')][_0x4520aa[_0x46a2('0x62')]]['sumHoldTime']+=moment(_0x4520aa[_0x46a2('0xa4')])['diff'](_0x4520aa[_0x46a2('0x6f')],_0x46a2('0x97'))||0x0;if(_0x2ad8a0===this[_0x46a2('0x10')][_0x589d47[_0x46a2('0x4b')]]['length']-0x1){this[_0x46a2('0x14')][_0x4520aa['queue']][_0x46a2('0x57')]+=moment()[_0x46a2('0xbe')](0x0)['diff'](_0x4520aa[_0x46a2('0x6f')],_0x46a2('0x97'));this[_0x46a2('0x14')][_0x4520aa[_0x46a2('0x62')]]['total']+=0x1;if(_0x4520aa[_0x46a2('0x87')]){this[_0x46a2('0x14')][_0x4520aa[_0x46a2('0x62')]][_0x46a2('0x52')]+=0x1;this[_0x46a2('0x14')][_0x4520aa['queue']]['sumBillable']+=moment()[_0x46a2('0xbe')](0x0)[_0x46a2('0xbf')](_0x4520aa['queuecallerleaveAt'],'seconds');_0x4520aa['queuecallercompleteAt']=moment()['format'](_0x46a2('0x7f'));_0x4520aa['queuecallerexit']=![];_0x4520aa[_0x46a2('0x95')]=null;}if(_0x4520aa[_0x46a2('0x94')]&&_0x4520aa[_0x46a2('0x8d')]!=!![]){_0x4520aa[_0x46a2('0xc0')]='unmanaged';logger[_0x46a2('0x44')]('[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerunmanaged\x20event:',_0x589d47[_0x46a2('0x4b')],util['inspect'](_0x4520aa,{'showHidden':![],'depth':null}));ami['emit'](_0x46a2('0xc1'),_0x4520aa);}if(_0x4520aa[_0x46a2('0x7d')]){_0x4520aa[_0x46a2('0xc0')]='abandoned';logger[_0x46a2('0x44')]('[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerabandon\x20event:',_0x589d47[_0x46a2('0x4b')],util[_0x46a2('0x3d')](_0x4520aa,{'showHidden':![],'depth':null}));ami[_0x46a2('0x42')](_0x46a2('0xc2'),_0x4520aa);}}else{this[_0x46a2('0x14')][_0x4520aa[_0x46a2('0x62')]][_0x46a2('0x57')]+=this[_0x46a2('0x14')][_0x4520aa['queue']]['sumHoldTime'];}logger[_0x46a2('0x64')](_0x46a2('0xc3'),_0x589d47['uniqueid'],_0x4520aa[_0x46a2('0x48')],_0x4520aa['type'],_0x589d47['cause-txt']);this['channels'][_0x589d47['uniqueid']]=_0x4520aa;this['emitVoiceQueueChannelRemove'](_0x4520aa,_0x46a2('0x24'));this[_0x46a2('0x4f')](this[_0x46a2('0x14')][_0x4520aa['queue']],_0x46a2('0x24'));}}logger[_0x46a2('0x44')](_0x46a2('0xc4'),_0x589d47[_0x46a2('0x4b')],util[_0x46a2('0x3d')](this[_0x46a2('0x10')][_0x589d47[_0x46a2('0x4b')]],{'showHidden':![],'depth':null}));ami['emit'](_0x46a2('0xc5'),this[_0x46a2('0x10')][_0x589d47[_0x46a2('0x4b')]]);if(_0x4520aa[_0x46a2('0x4c')]===_0x46a2('0x4d'))return;delete this[_0x46a2('0x10')][_0x589d47['uniqueid']];delete this[_0x46a2('0x12')][_0x589d47[_0x46a2('0x4b')]];}if(this['variables'][_0x589d47[_0x46a2('0x4b')]]){delete this[_0x46a2('0x17')][_0x589d47[_0x46a2('0x4b')]];}}}catch(_0x3e35f9){logger[_0x46a2('0x3c')](_0x46a2('0xbc'),_0x589d47[_0x46a2('0x4b')],util[_0x46a2('0x3d')](_0x3e35f9,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncAttendedTransfer']=function(_0x4c4341){try{if(this[_0x46a2('0x5e')](_0x4c4341)){logger[_0x46a2('0x44')](_0x46a2('0xc6'),_0x4c4341[_0x46a2('0x4b')],util['inspect'](_0x4c4341,{'showHidden':![],'depth':null}));var _0x378fd4;var _0x589ed1;var _0x51e5f9;if(this[_0x46a2('0x10')][_0x4c4341[_0x46a2('0xc7')]]){_0x378fd4=_[_0x46a2('0x79')](this[_0x46a2('0x10')][_0x4c4341[_0x46a2('0xc7')]]);_0x378fd4[_0x46a2('0x99')]=_0x4c4341[_0x46a2('0xc8')];_0x378fd4[_0x46a2('0xc9')]=_0x4c4341['secondtransfereruniqueid'];_0x378fd4[_0x46a2('0x4c')]=_0x46a2('0x4d');_0x378fd4[_0x46a2('0x8d')]=!![];_0x378fd4['transfertype']='ATTENDED';if(this[_0x46a2('0x10')][_0x4c4341['secondtransfereruniqueid']]){_0x51e5f9=this[_0x46a2('0x10')][_0x4c4341[_0x46a2('0xca')]];this[_0x46a2('0x10')][_0x4c4341[_0x46a2('0xca')]]=this[_0x46a2('0x10')][_0x4c4341[_0x46a2('0xc7')]];this[_0x46a2('0x10')][_0x4c4341[_0x46a2('0xc7')]]=_0x51e5f9;_0x589ed1=_[_0x46a2('0x79')](this['queueReports'][_0x4c4341[_0x46a2('0xc7')]]);_0x589ed1[_0x46a2('0x36')]=!![];}logger[_0x46a2('0x64')](_0x46a2('0xcb'),_0x4c4341[_0x46a2('0x4b')],_0x378fd4[_0x46a2('0x48')],_0x378fd4['type'],_0x378fd4[_0x46a2('0x99')],_0x378fd4[_0x46a2('0xc9')]);}else if(this[_0x46a2('0x10')][_0x4c4341[_0x46a2('0xcc')]]){_0x378fd4=_['last'](this[_0x46a2('0x10')][_0x4c4341['transfertargetuniqueid']]);_0x378fd4[_0x46a2('0x99')]=_0x4c4341[_0x46a2('0xcd')];_0x378fd4[_0x46a2('0xc9')]=_0x4c4341['origtransfereruniqueid'];_0x378fd4[_0x46a2('0x4c')]=_0x46a2('0x4d');_0x378fd4[_0x46a2('0x8d')]=!![];_0x378fd4[_0x46a2('0xce')]='ATTENDED';if(this['queueReports'][_0x4c4341[_0x46a2('0xcf')]]){_0x51e5f9=this[_0x46a2('0x10')][_0x4c4341['origtransfereruniqueid']];this[_0x46a2('0x10')][_0x4c4341[_0x46a2('0xcf')]]=this[_0x46a2('0x10')][_0x4c4341['transfertargetuniqueid']];this[_0x46a2('0x10')][_0x4c4341[_0x46a2('0xcc')]]=_0x51e5f9;_0x589ed1=_[_0x46a2('0x79')](this['queueReports'][_0x4c4341[_0x46a2('0xcc')]]);_0x589ed1[_0x46a2('0x36')]=!![];}logger[_0x46a2('0x64')](_0x46a2('0xcb'),_0x4c4341[_0x46a2('0x4b')],_0x378fd4[_0x46a2('0x48')],_0x378fd4['type'],_0x378fd4['transferexten'],_0x378fd4[_0x46a2('0xc9')]);}else if(this[_0x46a2('0x10')][_0x4c4341[_0x46a2('0xcf')]]){_0x378fd4=_[_0x46a2('0x79')](this[_0x46a2('0x10')][_0x4c4341[_0x46a2('0xcf')]]);_0x378fd4[_0x46a2('0x99')]=_0x4c4341[_0x46a2('0xcd')];_0x378fd4[_0x46a2('0xc9')]=_0x4c4341[_0x46a2('0xcf')];_0x378fd4[_0x46a2('0x4c')]='ATTENDEDTRANSFER';_0x378fd4[_0x46a2('0x8d')]=!![];_0x378fd4[_0x46a2('0xce')]=_0x46a2('0xd0');}else if(this[_0x46a2('0x10')][_0x4c4341[_0x46a2('0xca')]]){_0x378fd4=_[_0x46a2('0x79')](this[_0x46a2('0x10')][_0x4c4341['secondtransfereruniqueid']]);_0x378fd4[_0x46a2('0x99')]=_0x4c4341[_0x46a2('0xc8')];_0x378fd4['transferuniqueid']=_0x4c4341[_0x46a2('0xca')];_0x378fd4[_0x46a2('0x4c')]='ATTENDEDTRANSFER';_0x378fd4[_0x46a2('0x8d')]=!![];_0x378fd4[_0x46a2('0xce')]=_0x46a2('0xd0');}}}catch(_0x11d4a5){logger[_0x46a2('0x3c')](_0x46a2('0xc6'),_0x4c4341[_0x46a2('0x4b')],util['inspect'](_0x11d4a5,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x46a2('0xc')]['syncBlindTransfer']=function(_0x30aa56){try{if(this[_0x46a2('0x5e')](_0x30aa56)){logger[_0x46a2('0x44')](_0x46a2('0xd1'),_0x30aa56[_0x46a2('0x4b')],util[_0x46a2('0x3d')](_0x30aa56,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x30aa56['transfereeuniqueid']]){var _0x4ff4c9=_[_0x46a2('0x79')](this[_0x46a2('0x10')][_0x30aa56['transfereeuniqueid']]);_0x4ff4c9[_0x46a2('0x4c')]=_0x46a2('0xd2');_0x4ff4c9[_0x46a2('0x8d')]=!![];_0x4ff4c9[_0x46a2('0xce')]=_0x46a2('0xd3');_0x4ff4c9[_0x46a2('0x99')]=_0x30aa56[_0x46a2('0xd4')];_0x4ff4c9[_0x46a2('0xc9')]=_0x30aa56[_0x46a2('0xc7')];logger[_0x46a2('0x64')](_0x46a2('0xd5'),_0x30aa56['uniqueid'],_0x4ff4c9['name'],_0x4ff4c9[_0x46a2('0x50')],_0x4ff4c9[_0x46a2('0x99')],_0x4ff4c9[_0x46a2('0xc9')]);this[_0x46a2('0xbb')]({'event':_0x46a2('0xd6'),'uniqueid':_0x30aa56[_0x46a2('0xc7')],'context':_0x30aa56[_0x46a2('0xd7')],'channel':_0x30aa56['transfererchannel']});}}}catch(_0xb47dca){logger[_0x46a2('0x3c')](_0x46a2('0xd1'),_0x30aa56['uniqueid'],util[_0x46a2('0x3d')](_0xb47dca,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x46a2('0xc')]['syncMusicOnHoldStart']=function(_0x3884d5){try{if(this['isNotNull'](_0x3884d5)){logger['debug']('[%s][voiceQueueReport][musiconholdstart]',_0x3884d5['uniqueid'],util[_0x46a2('0x3d')](_0x3884d5,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x3884d5[_0x46a2('0x4b')]]){var _0x3bcf1e=_[_0x46a2('0x79')](this[_0x46a2('0x10')][_0x3884d5[_0x46a2('0x4b')]]);if(!_[_0x46a2('0x37')](_0x3bcf1e[_0x46a2('0xa4')])){_0x3bcf1e[_0x46a2('0xd8')]=moment()[_0x46a2('0x47')](_0x46a2('0x7f'));logger[_0x46a2('0x64')](_0x46a2('0xd9'),_0x3884d5[_0x46a2('0x4b')],_0x3bcf1e[_0x46a2('0xd8')]);}}}}catch(_0x5689c2){logger[_0x46a2('0x3c')](_0x46a2('0xda'),_0x3884d5[_0x46a2('0x4b')],util['inspect'](_0x5689c2,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x46a2('0xc')][_0x46a2('0x28')]=function(_0x1b812f){try{if(this[_0x46a2('0x5e')](_0x1b812f)){logger[_0x46a2('0x44')](_0x46a2('0xdb'),_0x1b812f[_0x46a2('0x4b')],util[_0x46a2('0x3d')](_0x1b812f,{'showHidden':![],'depth':null}));if(this[_0x46a2('0x10')][_0x1b812f[_0x46a2('0x4b')]]){var _0x5e85ca=_[_0x46a2('0x79')](this[_0x46a2('0x10')][_0x1b812f[_0x46a2('0x4b')]]);if(!_[_0x46a2('0x37')](_0x5e85ca[_0x46a2('0xd8')])){_0x5e85ca[_0x46a2('0xdc')]+=moment()[_0x46a2('0xbe')](0x0)['diff'](_0x5e85ca[_0x46a2('0xd8')],_0x46a2('0x97'));logger['info'](_0x46a2('0xdd'),_0x1b812f[_0x46a2('0x4b')],_0x5e85ca[_0x46a2('0xdc')]);delete _0x5e85ca['mohstarttime'];}}}}catch(_0x2f5b17){logger[_0x46a2('0x3c')](_0x46a2('0xdb'),_0x1b812f[_0x46a2('0x4b')],util[_0x46a2('0x3d')](_0x2f5b17,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x46a2('0xc')][_0x46a2('0xde')]=function(_0x286905){try{if(this['isNotNull'](_0x286905)){logger[_0x46a2('0x44')](_0x46a2('0xdf'),_0x286905['uniqueid'],util[_0x46a2('0x3d')](_0x286905,{'showHidden':![],'depth':null}));if(_0x286905['application']['toLowerCase']()===_0x46a2('0xe0')){_0x286905[_0x46a2('0xe1')]=_0x286905['appdata']&&_0x286905[_0x46a2('0xe2')]['startsWith'](_0x46a2('0xe3'))?_0x286905[_0x46a2('0xe2')]:(_0x286905[_0x46a2('0xe2')]||_0x286905[_0x46a2('0xe1')])[_0x46a2('0xe4')]();if(_[_0x46a2('0x90')](_0x286905[_0x46a2('0xe1')][_0x46a2('0xe4')](),_0x46a2('0xe5'))){logger[_0x46a2('0x64')](_0x46a2('0xe6'),_0x286905[_0x46a2('0x4b')],_0x286905[_0x46a2('0xe7')],_0x286905[_0x46a2('0xe1')]);if(_[_0x46a2('0x5f')](this[_0x46a2('0x12')][_0x286905[_0x46a2('0x4b')]]))this[_0x46a2('0x12')][_0x286905['uniqueid']]={};var _0x46141c=_0x286905[_0x46a2('0xe1')][_0x46a2('0xe8')]('=');var _0x459591=_0x46141c[0x0][_0x46a2('0xe4')]()[_0x46a2('0xe9')](/cdr\((.*)\)/);if(_0x459591)this[_0x46a2('0x12')][_0x286905[_0x46a2('0x4b')]][_0x459591[0x1]]=_0x46141c[0x1];}}}}catch(_0x26deb8){logger['error'](_0x46a2('0xea'),_0x286905['uniqueid'],util[_0x46a2('0x3d')](_0x26deb8,{'showHidden':![],'depth':null}));}};module[_0x46a2('0xeb')]=VoiceQueueReport;
\ No newline at end of file
index c3cbf5d..adbf38a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x68d7=['CreateReportAgentPreview','../client','createHistory','campaign','Request'];(function(_0x5d66aa,_0x5bc7d8){var _0x17b2e6=function(_0x2409b6){while(--_0x2409b6){_0x5d66aa['push'](_0x5d66aa['shift']());}};_0x17b2e6(++_0x5bc7d8);}(_0x68d7,0x114));var _0x768d=function(_0x2e9f63,_0x2223a9){_0x2e9f63=_0x2e9f63-0x0;var _0x1128f8=_0x68d7[_0x2e9f63];return _0x1128f8;};'use strict';var client=require(_0x768d('0x0'));exports[_0x768d('0x1')]=function(_0x5bc0ee){return function(){_0x5bc0ee[_0x768d('0x2')]=_0x5bc0ee['queue'];return client[_0x768d('0x3')](_0x768d('0x4'),{'body':_0x5bc0ee,'log':_0x768d('0x4')});};};
\ No newline at end of file
+var _0x30e8=['CreateReportAgentPreview','../client','campaign','queue'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0x30e8,0xd5));var _0x830e=function(_0x405936,_0x43db19){_0x405936=_0x405936-0x0;var _0x1c0de6=_0x30e8[_0x405936];return _0x1c0de6;};'use strict';var client=require(_0x830e('0x0'));exports['createHistory']=function(_0x4c621c){return function(){_0x4c621c[_0x830e('0x1')]=_0x4c621c[_0x830e('0x2')];return client['Request']('CreateReportAgentPreview',{'body':_0x4c621c,'log':_0x830e('0x3')});};};
\ No newline at end of file
index c59a224..ab53cc5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbb7c=['create','CreateAttachment','../client'];(function(_0x342108,_0x2780ca){var _0x47c107=function(_0x54d0c2){while(--_0x54d0c2){_0x342108['push'](_0x342108['shift']());}};_0x47c107(++_0x2780ca);}(_0xbb7c,0xe0));var _0xcbb7=function(_0x37a17a,_0x17c131){_0x37a17a=_0x37a17a-0x0;var _0x2b85ca=_0xbb7c[_0x37a17a];return _0x2b85ca;};'use strict';var client=require(_0xcbb7('0x0'));exports[_0xcbb7('0x1')]=function(_0x630142){return client['Request'](_0xcbb7('0x2'),{'body':_0x630142,'log':_0xcbb7('0x2')});};
\ No newline at end of file
+var _0x02f7=['create','CreateAttachment','../client'];(function(_0x4f32de,_0x5bd4a){var _0x149821=function(_0x205885){while(--_0x205885){_0x4f32de['push'](_0x4f32de['shift']());}};_0x149821(++_0x5bd4a);}(_0x02f7,0x1d3));var _0x702f=function(_0x1d1cac,_0x2a142c){_0x1d1cac=_0x1d1cac-0x0;var _0x4557a0=_0x02f7[_0x1d1cac];return _0x4557a0;};'use strict';var client=require(_0x702f('0x0'));exports[_0x702f('0x1')]=function(_0x3d5aba){return client['Request'](_0x702f('0x2'),{'body':_0x3d5aba,'log':_0x702f('0x2')});};
\ No newline at end of file
index bf83714..6a11806 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2ef3=['dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialTimezone','dialGlobalInterval','dialAMDInitialSilence','dialAMDAfterGreetingSilence','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumWordLength','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','Trunk','active','TrunkBackup','Interval','Intervals','interval','SquareProject','getCampaign','../client','getCampaigns','Request','GetCampaign','name','type','limitCalls','dialOriginateCallerIdName','dialOriginateTimeout','dialCongestionMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry'];(function(_0x587ba2,_0x42eb40){var _0x50ec73=function(_0x2f32e3){while(--_0x2f32e3){_0x587ba2['push'](_0x587ba2['shift']());}};_0x50ec73(++_0x42eb40);}(_0x2ef3,0xba));var _0x32ef=function(_0x58001e,_0x4db206){_0x58001e=_0x58001e-0x0;var _0x128bea=_0x2ef3[_0x58001e];return _0x128bea;};'use strict';var client=require(_0x32ef('0x0'));exports[_0x32ef('0x1')]=function(){return function(){return client[_0x32ef('0x2')](_0x32ef('0x3'),{'options':{'raw':![],'attributes':['id',_0x32ef('0x4'),_0x32ef('0x5'),'active',_0x32ef('0x6'),_0x32ef('0x7'),'dialOriginateCallerIdNumber',_0x32ef('0x8'),_0x32ef('0x9'),'dialCongestionRetryFrequency','dialBusyMaxRetry',_0x32ef('0xa'),_0x32ef('0xb'),_0x32ef('0xc'),_0x32ef('0xd'),_0x32ef('0xe'),_0x32ef('0xf'),_0x32ef('0x10'),_0x32ef('0x11'),_0x32ef('0x12'),_0x32ef('0x13'),'dialMachineMaxRetry','dialMachineRetryFrequency',_0x32ef('0x14'),_0x32ef('0x15'),_0x32ef('0x16'),_0x32ef('0x17'),'dialAMDActive',_0x32ef('0x18'),'dialAMDGreeting',_0x32ef('0x19'),'dialAMDTotalAnalysisTime',_0x32ef('0x1a'),_0x32ef('0x1b'),'dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold',_0x32ef('0x1c'),'dialOrderByScheduledAt',_0x32ef('0x1d'),_0x32ef('0x1e'),_0x32ef('0x1f')],'include':[{'model':_0x32ef('0x20'),'as':'Trunk','attributes':['id','name','callerid',_0x32ef('0x21')]},{'model':_0x32ef('0x20'),'as':_0x32ef('0x22'),'attributes':['id','name','callerid',_0x32ef('0x21')]},{'model':_0x32ef('0x23'),'as':_0x32ef('0x23'),'attributes':['id','name'],'include':[{'model':_0x32ef('0x23'),'as':_0x32ef('0x24'),'attributes':['id','name',_0x32ef('0x25')]}]},{'model':_0x32ef('0x26'),'as':_0x32ef('0x26'),'attributes':['id',_0x32ef('0x4')]}]},'log':_0x32ef('0x27')});};};
\ No newline at end of file
+var _0x326f=['dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectRetryFrequency','dialGlobalInterval','dialAMDInitialSilence','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','dialPrefix','Trunk','callerid','TrunkBackup','Interval','Intervals','SquareProject','../client','GetCampaign','name','type','active','limitCalls','dialOriginateCallerIdName'];(function(_0x2e4865,_0xec1664){var _0x5c1f20=function(_0x3ea92b){while(--_0x3ea92b){_0x2e4865['push'](_0x2e4865['shift']());}};_0x5c1f20(++_0xec1664);}(_0x326f,0xd1));var _0xf326=function(_0x877d5b,_0x50bf4f){_0x877d5b=_0x877d5b-0x0;var _0x2ab88e=_0x326f[_0x877d5b];return _0x2ab88e;};'use strict';var client=require(_0xf326('0x0'));exports['getCampaigns']=function(){return function(){return client['Request'](_0xf326('0x1'),{'options':{'raw':![],'attributes':['id',_0xf326('0x2'),_0xf326('0x3'),_0xf326('0x4'),_0xf326('0x5'),_0xf326('0x6'),_0xf326('0x7'),_0xf326('0x8'),_0xf326('0x9'),_0xf326('0xa'),'dialBusyMaxRetry',_0xf326('0xb'),_0xf326('0xc'),_0xf326('0xd'),_0xf326('0xe'),'dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry',_0xf326('0xf'),_0xf326('0x10'),_0xf326('0x11'),_0xf326('0x12'),_0xf326('0x13'),'dialAgentRejectMaxRetry',_0xf326('0x14'),'dialTimezone',_0xf326('0x15'),'dialAMDActive',_0xf326('0x16'),'dialAMDGreeting',_0xf326('0x17'),_0xf326('0x18'),'dialAMDMinWordLength',_0xf326('0x19'),_0xf326('0x1a'),_0xf326('0x1b'),_0xf326('0x1c'),'dialOrderByScheduledAt',_0xf326('0x1d'),'dialRandomLastDigitCallerIdNumber','dialCutDigit'],'include':[{'model':_0xf326('0x1e'),'as':_0xf326('0x1e'),'attributes':['id',_0xf326('0x2'),_0xf326('0x1f'),_0xf326('0x4')]},{'model':_0xf326('0x1e'),'as':_0xf326('0x20'),'attributes':['id',_0xf326('0x2'),'callerid',_0xf326('0x4')]},{'model':_0xf326('0x21'),'as':_0xf326('0x21'),'attributes':['id',_0xf326('0x2')],'include':[{'model':_0xf326('0x21'),'as':_0xf326('0x22'),'attributes':['id','name','interval']}]},{'model':'SquareProject','as':_0xf326('0x23'),'attributes':['id',_0xf326('0x2')]}]},'log':'getCampaign'});};};
\ No newline at end of file
index 3206673..ca26172 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3bf5=['getContacts','Request','GetCmContact','createContact','CreateCmContact'];(function(_0x2a774a,_0x2ca22c){var _0x20fcd7=function(_0x23b084){while(--_0x23b084){_0x2a774a['push'](_0x2a774a['shift']());}};_0x20fcd7(++_0x2ca22c);}(_0x3bf5,0x80));var _0x53bf=function(_0x2431d6,_0x25189a){_0x2431d6=_0x2431d6-0x0;var _0x4d0f9b=_0x3bf5[_0x2431d6];return _0x4d0f9b;};'use strict';var client=require('../client');exports[_0x53bf('0x0')]=function(_0x106224){return function(){return client['Request'](_0x53bf('0x1'),{'body':_0x106224,'log':'CreateCmContact'});};};exports[_0x53bf('0x2')]=function(_0x13257c){return function(){return client[_0x53bf('0x3')](_0x53bf('0x4'),{'options':_0x13257c,'log':_0x53bf('0x4')});};};
\ No newline at end of file
+var _0xabeb=['GetCmContact','../client','createContact','Request'];(function(_0x397751,_0x3954d3){var _0x1e6997=function(_0x158036){while(--_0x158036){_0x397751['push'](_0x397751['shift']());}};_0x1e6997(++_0x3954d3);}(_0xabeb,0x165));var _0xbabe=function(_0x5fd828,_0xa7ede9){_0x5fd828=_0x5fd828-0x0;var _0x3c1eaa=_0xabeb[_0x5fd828];return _0x3c1eaa;};'use strict';var client=require(_0xbabe('0x0'));exports[_0xbabe('0x1')]=function(_0x5dfc54){return function(){return client[_0xbabe('0x2')]('CreateCmContact',{'body':_0x5dfc54,'log':'CreateCmContact'});};};exports['getContacts']=function(_0x4a77ed){return function(){return client[_0xbabe('0x2')](_0xbabe('0x3'),{'options':_0x4a77ed,'log':_0xbabe('0x3')});};};
\ No newline at end of file
index e48a5d4..562f5bf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xddd6=['UpdateCmHopper','ContactId','VoiceQueueId','rescheduleContact','destroyContact','GetContactDialer','priority','DESC','ASC','getContactDialerIvr','scheduledat','GetContactDialerIvr','moveContactManagedDialer','campaign','MoveContactManagedDialer','ListId','CampaignId','countReScheduled','GetCmHopperPreview','User','name','Queue','GetContactRecallMe','format','Agent','voicePause','resetActiveCalls','handlePreviewRecallNotifications','CmHopperHandlePreviewRecallNotifications','../client','moment','lodash','getContacts','CmContact','Contact','getCmHopper','updateContacts','Request'];(function(_0x1661dd,_0x4ff222){var _0x24a446=function(_0x2768d1){while(--_0x2768d1){_0x1661dd['push'](_0x1661dd['shift']());}};_0x24a446(++_0x4ff222);}(_0xddd6,0x69));var _0x6ddd=function(_0x5b7825,_0xbe8218){_0x5b7825=_0x5b7825-0x0;var _0x4fd743=_0xddd6[_0x5b7825];return _0x4fd743;};'use strict';var client=require(_0x6ddd('0x0'));var moment=require(_0x6ddd('0x1'));var _=require(_0x6ddd('0x2'));exports[_0x6ddd('0x3')]=function(_0x4d4598,_0x15bb70){return function(){return client['Request']('GetCmHopper',{'options':{'where':{'VoiceQueueId':_0x4d4598},'include':[{'model':_0x6ddd('0x4'),'as':_0x6ddd('0x5')}],'limit':_0x15bb70,'raw':![]},'log':_0x6ddd('0x6')});};};exports[_0x6ddd('0x7')]=function(_0x3f9e22,_0x4f0981,_0x441698){return function(){return client[_0x6ddd('0x8')](_0x6ddd('0x9'),{'body':_0x3f9e22,'options':{'where':{'VoiceQueueId':_0x4f0981,'scheduledat':{'$lte':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')}},'limit':_0x441698},'log':_0x6ddd('0x9')});};};exports['rescheduleContact']=function(_0x1e48db){return function(){return client[_0x6ddd('0x8')](_0x6ddd('0x9'),{'body':_0x1e48db,'options':{'where':{'ContactId':_0x1e48db[_0x6ddd('0xa')],'ListId':_0x1e48db['ListId'],'VoiceQueueId':_0x1e48db[_0x6ddd('0xb')],'CampaignId':_0x1e48db['CampaignId']}},'log':_0x6ddd('0xc')});};};exports[_0x6ddd('0xd')]=function(_0x16207a,_0x2ae4bb,_0x250b81){return function(){return client['Request']('DestroyCmHopper',{'options':{'where':{'VoiceQueueId':_0x16207a,'ListId':_0x2ae4bb,'ContactId':_0x250b81}},'log':'DestroyCmHopper'});};};exports['getContactDialer']=function(_0x269a3f,_0x4b5dce,_0x38344b,_0x51150d){return function(){return client[_0x6ddd('0x8')](_0x6ddd('0xe'),{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x269a3f,'active':![],'scheduledat':{'$lte':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},'$or':[{'UserId':null},{'UserId':{'$in':_0x4b5dce}}]},'order':[[_0x6ddd('0xf'),_0x6ddd('0x10')],['scheduledat',_0x51150d],['id',_0x6ddd('0x11')]],'raw':!![],'limit':_0x38344b},'log':_0x6ddd('0xe')});};};exports[_0x6ddd('0x12')]=function(_0x3aaa31,_0xc11400,_0x1f323a){return function(){return client['Request'](_0x6ddd('0xe'),{'body':{'active':!![]},'options':{'where':{'CampaignId':_0x3aaa31,'active':![],'scheduledat':{'$lte':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')}},'include':[{'model':'CmContact','as':_0x6ddd('0x5')}],'order':[[_0x6ddd('0xf'),_0x6ddd('0x10')],[_0x6ddd('0x13'),_0x1f323a],['id',_0x6ddd('0x11')]],'raw':!![],'limit':_0xc11400},'log':_0x6ddd('0x14')});};};exports[_0x6ddd('0x15')]=function(_0x2ce0a2,_0x3bb9a5){return function(){_0x2ce0a2[_0x6ddd('0x16')]=_0x2ce0a2['queue'];return client[_0x6ddd('0x8')](_0x6ddd('0x17'),{'body':_0x2ce0a2,'options':{'where':{'ContactId':_0x2ce0a2[_0x6ddd('0xa')],'ListId':_0x2ce0a2[_0x6ddd('0x18')],'VoiceQueueId':_0x2ce0a2[_0x6ddd('0xb')],'CampaignId':_0x2ce0a2[_0x6ddd('0x19')],'active':_0x3bb9a5?undefined:!![]}},'log':_0x6ddd('0x17')});};};exports[_0x6ddd('0x1a')]=function(_0x831933){return function(){return client[_0x6ddd('0x8')]('CountReScheduled',{'options':{'where':{'VoiceQueueId':_0x831933['id']?_0x831933['id']||null:null}},'log':_0x6ddd('0x1a')});};};exports['getContactPreview']=function(_0x211acb){return function(){return client[_0x6ddd('0x8')](_0x6ddd('0x1b'),{'options':{'where':{'id':_0x211acb},'include':[{'model':_0x6ddd('0x4'),'as':_0x6ddd('0x5')},{'model':_0x6ddd('0x1c'),'as':'Agent','attributes':['id',_0x6ddd('0x1d')]},{'model':'VoiceQueue','as':_0x6ddd('0x1e'),'attributes':['id',_0x6ddd('0x1d')]}],'raw':!![]},'log':_0x6ddd('0x6')});};};exports['unlockContact']=function(_0x1c372d,_0x33e5ab,_0x4d8d6a){return function(){return client[_0x6ddd('0x8')](_0x6ddd('0x9'),{'body':_0x1c372d,'options':{'where':{'id':_0x33e5ab},'limit':_0x4d8d6a},'log':'UpdateCmHopper'});};};exports['getContactRecallMe']=function(_0x439056,_0x3dba98){return function(){return client[_0x6ddd('0x8')](_0x6ddd('0x1f'),{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x439056,'active':![],'recallme':!![],'scheduledat':{'$lte':moment()[_0x6ddd('0x20')]('YYYY-MM-DD\x20HH:mm:ss')},'UserId':{'$in':_0x3dba98}},'order':[[_0x6ddd('0xf'),_0x6ddd('0x10')],[_0x6ddd('0x13'),'DESC'],['id',_0x6ddd('0x11')]],'include':[{'model':_0x6ddd('0x4'),'as':'Contact'},{'model':'User','as':_0x6ddd('0x21'),'attributes':['id',_0x6ddd('0x1d'),_0x6ddd('0x22')]}],'group':'db.CmHopper.UserId','raw':!![]},'log':'GetContactDialer'});};};exports[_0x6ddd('0x23')]=function(_0x3d96cb){return function(){return client[_0x6ddd('0x8')]('ResetActiveCalls',{'body':_0x3d96cb,'options':{},'log':'ResetActiveCalls'});};};exports[_0x6ddd('0x24')]=function(_0x46fce8,_0xd87e10){return function(){return client[_0x6ddd('0x8')](_0x6ddd('0x25'),{'body':{'where':{'voiceQueueId':_0x46fce8,'interval':_0xd87e10}},'log':'handlePreviewRecallNotifications'});};};
\ No newline at end of file
+var _0x0b97=['priority','ASC','GetContactDialerIvr','moveContactManagedDialer','campaign','MoveContactManagedDialer','ListId','VoiceQueueId','CountReScheduled','countReScheduled','GetCmHopperPreview','User','Agent','name','VoiceQueue','Queue','getContactRecallMe','GetContactRecallMe','voicePause','ResetActiveCalls','handlePreviewRecallNotifications','CmHopperHandlePreviewRecallNotifications','../client','moment','lodash','getContacts','Request','GetCmHopper','Contact','getCmHopper','updateContacts','UpdateCmHopper','format','YYYY-MM-DD\x20HH:mm:ss','rescheduleContact','ContactId','CampaignId','destroyContact','DestroyCmHopper','DESC','scheduledat','GetContactDialer','getContactDialerIvr','CmContact'];(function(_0xfa9cc,_0x25cbed){var _0x42e3bb=function(_0x196392){while(--_0x196392){_0xfa9cc['push'](_0xfa9cc['shift']());}};_0x42e3bb(++_0x25cbed);}(_0x0b97,0x9a));var _0x70b9=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x0b97[_0x19e35c];return _0x3e1fe8;};'use strict';var client=require(_0x70b9('0x0'));var moment=require(_0x70b9('0x1'));var _=require(_0x70b9('0x2'));exports[_0x70b9('0x3')]=function(_0x6623e7,_0x326c24){return function(){return client[_0x70b9('0x4')](_0x70b9('0x5'),{'options':{'where':{'VoiceQueueId':_0x6623e7},'include':[{'model':'CmContact','as':_0x70b9('0x6')}],'limit':_0x326c24,'raw':![]},'log':_0x70b9('0x7')});};};exports[_0x70b9('0x8')]=function(_0x11a87b,_0x15d7df,_0x469d2e){return function(){return client[_0x70b9('0x4')](_0x70b9('0x9'),{'body':_0x11a87b,'options':{'where':{'VoiceQueueId':_0x15d7df,'scheduledat':{'$lte':moment()[_0x70b9('0xa')](_0x70b9('0xb'))}},'limit':_0x469d2e},'log':_0x70b9('0x9')});};};exports[_0x70b9('0xc')]=function(_0x15afb2){return function(){return client['Request']('UpdateCmHopper',{'body':_0x15afb2,'options':{'where':{'ContactId':_0x15afb2[_0x70b9('0xd')],'ListId':_0x15afb2['ListId'],'VoiceQueueId':_0x15afb2['VoiceQueueId'],'CampaignId':_0x15afb2[_0x70b9('0xe')]}},'log':_0x70b9('0xc')});};};exports[_0x70b9('0xf')]=function(_0x2dcd9f,_0x2095da,_0xa8b736){return function(){return client['Request'](_0x70b9('0x10'),{'options':{'where':{'VoiceQueueId':_0x2dcd9f,'ListId':_0x2095da,'ContactId':_0xa8b736}},'log':_0x70b9('0x10')});};};exports['getContactDialer']=function(_0x141ee5,_0xe8e9,_0x43c429,_0x3f2eae){return function(){return client[_0x70b9('0x4')]('GetContactDialer',{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x141ee5,'active':![],'scheduledat':{'$lte':moment()['format'](_0x70b9('0xb'))},'$or':[{'UserId':null},{'UserId':{'$in':_0xe8e9}}]},'order':[['priority',_0x70b9('0x11')],[_0x70b9('0x12'),_0x3f2eae],['id','ASC']],'raw':!![],'limit':_0x43c429},'log':_0x70b9('0x13')});};};exports[_0x70b9('0x14')]=function(_0x326501,_0x3c07fd,_0x2bcd5e){return function(){return client[_0x70b9('0x4')]('GetContactDialer',{'body':{'active':!![]},'options':{'where':{'CampaignId':_0x326501,'active':![],'scheduledat':{'$lte':moment()[_0x70b9('0xa')](_0x70b9('0xb'))}},'include':[{'model':_0x70b9('0x15'),'as':'Contact'}],'order':[[_0x70b9('0x16'),_0x70b9('0x11')],[_0x70b9('0x12'),_0x2bcd5e],['id',_0x70b9('0x17')]],'raw':!![],'limit':_0x3c07fd},'log':_0x70b9('0x18')});};};exports[_0x70b9('0x19')]=function(_0x147240,_0x27df87){return function(){_0x147240[_0x70b9('0x1a')]=_0x147240['queue'];return client['Request'](_0x70b9('0x1b'),{'body':_0x147240,'options':{'where':{'ContactId':_0x147240['ContactId'],'ListId':_0x147240[_0x70b9('0x1c')],'VoiceQueueId':_0x147240[_0x70b9('0x1d')],'CampaignId':_0x147240[_0x70b9('0xe')],'active':_0x27df87?undefined:!![]}},'log':'MoveContactManagedDialer'});};};exports['countReScheduled']=function(_0x1ed7c4){return function(){return client[_0x70b9('0x4')](_0x70b9('0x1e'),{'options':{'where':{'VoiceQueueId':_0x1ed7c4['id']?_0x1ed7c4['id']||null:null}},'log':_0x70b9('0x1f')});};};exports['getContactPreview']=function(_0x3773e6){return function(){return client[_0x70b9('0x4')](_0x70b9('0x20'),{'options':{'where':{'id':_0x3773e6},'include':[{'model':_0x70b9('0x15'),'as':_0x70b9('0x6')},{'model':_0x70b9('0x21'),'as':_0x70b9('0x22'),'attributes':['id',_0x70b9('0x23')]},{'model':_0x70b9('0x24'),'as':_0x70b9('0x25'),'attributes':['id',_0x70b9('0x23')]}],'raw':!![]},'log':_0x70b9('0x7')});};};exports['unlockContact']=function(_0xca23df,_0x1ea243,_0x4a51ca){return function(){return client[_0x70b9('0x4')](_0x70b9('0x9'),{'body':_0xca23df,'options':{'where':{'id':_0x1ea243},'limit':_0x4a51ca},'log':_0x70b9('0x9')});};};exports[_0x70b9('0x26')]=function(_0xccd520,_0x50df42){return function(){return client[_0x70b9('0x4')](_0x70b9('0x27'),{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0xccd520,'active':![],'recallme':!![],'scheduledat':{'$lte':moment()[_0x70b9('0xa')](_0x70b9('0xb'))},'UserId':{'$in':_0x50df42}},'order':[[_0x70b9('0x16'),_0x70b9('0x11')],[_0x70b9('0x12'),_0x70b9('0x11')],['id',_0x70b9('0x17')]],'include':[{'model':'CmContact','as':'Contact'},{'model':_0x70b9('0x21'),'as':_0x70b9('0x22'),'attributes':['id',_0x70b9('0x23'),_0x70b9('0x28')]}],'group':'db.CmHopper.UserId','raw':!![]},'log':_0x70b9('0x13')});};};exports['resetActiveCalls']=function(_0xcd2fd2){return function(){return client[_0x70b9('0x4')](_0x70b9('0x29'),{'body':_0xcd2fd2,'options':{},'log':_0x70b9('0x29')});};};exports[_0x70b9('0x2a')]=function(_0x4df5ae,_0x2e066d){return function(){return client[_0x70b9('0x4')](_0x70b9('0x2b'),{'body':{'where':{'voiceQueueId':_0x4df5ae,'interval':_0x2e066d}},'log':_0x70b9('0x2a')});};};
\ No newline at end of file
index 7bdb2b1..3c79477 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeb8b=['IncrementPreviewCounters','../client','moment','VerifyAdditionalPhones','swapAdditionalPhones','SwapAdditionalPhones','incrementPreviewCounters','Request'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0xeb8b,0x181));var _0xbeb8=function(_0x814f85,_0x20ee00){_0x814f85=_0x814f85-0x0;var _0x27cf92=_0xeb8b[_0x814f85];return _0x27cf92;};'use strict';var client=require(_0xbeb8('0x0'));var moment=require(_0xbeb8('0x1'));exports['verifyAdditionalPhones']=function(_0xace695,_0x36a0c1,_0x38f4d6){return function(){return client['Request'](_0xbeb8('0x2'),{'body':_0xace695,'reason':_0x36a0c1,'entity':_0x38f4d6,'log':_0xbeb8('0x2')});};};exports[_0xbeb8('0x3')]=function(_0x92e22d,_0x4d532f,_0x199aa3){return function(){return client['Request'](_0xbeb8('0x4'),{'body':_0x92e22d,'duration':_0x4d532f,'waitTime':_0x199aa3,'log':_0xbeb8('0x4')});};};exports[_0xbeb8('0x5')]=function(_0x28b2fb){return function(){return client[_0xbeb8('0x6')](_0xbeb8('0x7'),{'body':_0x28b2fb,'log':_0xbeb8('0x7')});};};
\ No newline at end of file
+var _0x248b=['moment','Request','VerifyAdditionalPhones','swapAdditionalPhones','SwapAdditionalPhones','IncrementPreviewCounters','../client'];(function(_0x560448,_0x2c1082){var _0x550276=function(_0x37e949){while(--_0x37e949){_0x560448['push'](_0x560448['shift']());}};_0x550276(++_0x2c1082);}(_0x248b,0xb5));var _0xb248=function(_0x4890d2,_0x38619a){_0x4890d2=_0x4890d2-0x0;var _0x3cab77=_0x248b[_0x4890d2];return _0x3cab77;};'use strict';var client=require(_0xb248('0x0'));var moment=require(_0xb248('0x1'));exports['verifyAdditionalPhones']=function(_0x557044,_0x479836,_0x4a46cb){return function(){return client[_0xb248('0x2')](_0xb248('0x3'),{'body':_0x557044,'reason':_0x479836,'entity':_0x4a46cb,'log':_0xb248('0x3')});};};exports[_0xb248('0x4')]=function(_0x351070,_0x542870,_0x3f8ccd){return function(){return client['Request'](_0xb248('0x5'),{'body':_0x351070,'duration':_0x542870,'waitTime':_0x3f8ccd,'log':'SwapAdditionalPhones'});};};exports['incrementPreviewCounters']=function(_0xee80be){return function(){return client[_0xb248('0x2')](_0xb248('0x6'),{'body':_0xee80be,'log':_0xb248('0x6')});};};
\ No newline at end of file
index 0d0cba8..832df9d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x06fe=['CampaignId','GetCmHopperBlackIvr','Request','GetCmHopperBlack','phone','checkIsBlackListIvr'];(function(_0x52a2b4,_0x5a7655){var _0x3b198c=function(_0x3b15a6){while(--_0x3b15a6){_0x52a2b4['push'](_0x52a2b4['shift']());}};_0x3b198c(++_0x5a7655);}(_0x06fe,0x18e));var _0xe06f=function(_0x53199f,_0x1dac3a){_0x53199f=_0x53199f-0x0;var _0x1f9609=_0x06fe[_0x53199f];return _0x1f9609;};'use strict';var client=require('../client');exports['checkIsBlackList']=function(_0xc50b49){return function(){return client[_0xe06f('0x0')](_0xe06f('0x1'),{'options':{'where':{'VoiceQueueId':_0xc50b49['VoiceQueueId'],'phone':_0xc50b49[_0xe06f('0x2')]},'raw':![]},'log':_0xe06f('0x1')});};};exports[_0xe06f('0x3')]=function(_0x3b344e){return function(){return client[_0xe06f('0x0')](_0xe06f('0x1'),{'options':{'where':{'CampaignId':_0x3b344e[_0xe06f('0x4')],'phone':_0x3b344e[_0xe06f('0x2')]},'raw':![]},'log':_0xe06f('0x5')});};};
\ No newline at end of file
+var _0xcf23=['GetCmHopperBlack','VoiceQueueId','phone','../client','checkIsBlackList','Request'];(function(_0x56f935,_0xbb3e13){var _0x25ff2f=function(_0x3d0fad){while(--_0x3d0fad){_0x56f935['push'](_0x56f935['shift']());}};_0x25ff2f(++_0xbb3e13);}(_0xcf23,0x171));var _0x3cf2=function(_0x5e1398,_0xd76106){_0x5e1398=_0x5e1398-0x0;var _0xcde9f=_0xcf23[_0x5e1398];return _0xcde9f;};'use strict';var client=require(_0x3cf2('0x0'));exports[_0x3cf2('0x1')]=function(_0xf40c7c){return function(){return client[_0x3cf2('0x2')](_0x3cf2('0x3'),{'options':{'where':{'VoiceQueueId':_0xf40c7c[_0x3cf2('0x4')],'phone':_0xf40c7c[_0x3cf2('0x5')]},'raw':![]},'log':_0x3cf2('0x3')});};};exports['checkIsBlackListIvr']=function(_0x55d419){return function(){return client[_0x3cf2('0x2')](_0x3cf2('0x3'),{'options':{'where':{'CampaignId':_0x55d419['CampaignId'],'phone':_0x55d419['phone']},'raw':![]},'log':'GetCmHopperBlackIvr'});};};
\ No newline at end of file
index 57c266f..5a9fb40 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf47c=['queue','Request','CreateCmHopperFinal','../client','createContact','campaign'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf47c,0xdb));var _0xcf47=function(_0x4d9a52,_0x425149){_0x4d9a52=_0x4d9a52-0x0;var _0x365e25=_0xf47c[_0x4d9a52];return _0x365e25;};'use strict';var client=require(_0xcf47('0x0'));exports[_0xcf47('0x1')]=function(_0x30ed40){return function(){_0x30ed40[_0xcf47('0x2')]=_0x30ed40[_0xcf47('0x3')];return client[_0xcf47('0x4')](_0xcf47('0x5'),{'body':_0x30ed40,'log':_0xcf47('0x5')});};};
\ No newline at end of file
+var _0x58d3=['Request','CreateCmHopperFinal','campaign','queue'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x58d3,0x16e));var _0x358d=function(_0x1693aa,_0x2a069f){_0x1693aa=_0x1693aa-0x0;var _0x5bf1a8=_0x58d3[_0x1693aa];return _0x5bf1a8;};'use strict';var client=require('../client');exports['createContact']=function(_0x2cf583){return function(){_0x2cf583[_0x358d('0x0')]=_0x2cf583[_0x358d('0x1')];return client[_0x358d('0x2')](_0x358d('0x3'),{'body':_0x2cf583,'log':_0x358d('0x3')});};};
\ No newline at end of file
index 5c618e8..8a7d9dc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb7eb=['campaign','queue','Request','CreateCmHopperHistory','avgHandleTime','AvgHandleTime','minutes','format','YYYY-MM-DD\x20HH:mm:ss','getVoiceQueueHopperHistory','GetVoiceQueueHopperHistory','day','endOf','getCampaignHopperHistory','GetCampaignHopperHistory','startOf','ivr','../client','moment','createHistory'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0xb7eb,0x18d));var _0xbb7e=function(_0x31d71e,_0x336ef1){_0x31d71e=_0x31d71e-0x0;var _0x1fde7a=_0xb7eb[_0x31d71e];return _0x1fde7a;};'use strict';var client=require(_0xbb7e('0x0'));var moment=require(_0xbb7e('0x1'));exports[_0xbb7e('0x2')]=function(_0x27c769){return function(){_0x27c769[_0xbb7e('0x3')]=_0x27c769[_0xbb7e('0x4')];return client[_0xbb7e('0x5')](_0xbb7e('0x6'),{'body':_0x27c769,'log':_0xbb7e('0x6')});};};exports[_0xbb7e('0x7')]=function(_0x493afc){return function(){return client['Request'](_0xbb7e('0x8'),{'options':{'where':{'endtime':{'$between':[moment()['subtract'](_0x493afc,_0xbb7e('0x9'))['format']('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0xbb7e('0xa')](_0xbb7e('0xb'))]}},'raw':![]},'log':'GetCmHopperHistory'});};};exports[_0xbb7e('0xc')]=function(_0x266447){return function(){return client[_0xbb7e('0x5')](_0xbb7e('0xd'),{'options':{'where':{'createdAt':{'$between':[moment()['startOf'](_0xbb7e('0xe'))[_0xbb7e('0xa')](_0xbb7e('0xb')),moment()[_0xbb7e('0xf')](_0xbb7e('0xe'))[_0xbb7e('0xa')]('YYYY-MM-DD\x20HH:mm:ss')]},'campaigntype':'queue'},'raw':![]},'log':_0xbb7e('0xd')});};};exports[_0xbb7e('0x10')]=function(_0x24604f){return function(){return client['Request'](_0xbb7e('0x11'),{'options':{'where':{'createdAt':{'$between':[moment()[_0xbb7e('0x12')](_0xbb7e('0xe'))['format'](_0xbb7e('0xb')),moment()['endOf'](_0xbb7e('0xe'))[_0xbb7e('0xa')](_0xbb7e('0xb'))]},'campaigntype':_0xbb7e('0x13')},'raw':![]},'log':_0xbb7e('0x11')});};};
\ No newline at end of file
+var _0x2faf=['format','YYYY-MM-DD\x20HH:mm:ss','getVoiceQueueHopperHistory','GetVoiceQueueHopperHistory','day','getCampaignHopperHistory','GetCampaignHopperHistory','startOf','endOf','ivr','../client','moment','createHistory','campaign','queue','Request','CreateCmHopperHistory','avgHandleTime','subtract'];(function(_0x208b51,_0x2b8c81){var _0x32395d=function(_0x5d7013){while(--_0x5d7013){_0x208b51['push'](_0x208b51['shift']());}};_0x32395d(++_0x2b8c81);}(_0x2faf,0x7c));var _0xf2fa=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x2faf[_0xa464c9];return _0x3d73c4;};'use strict';var client=require(_0xf2fa('0x0'));var moment=require(_0xf2fa('0x1'));exports[_0xf2fa('0x2')]=function(_0x116a7c){return function(){_0x116a7c[_0xf2fa('0x3')]=_0x116a7c[_0xf2fa('0x4')];return client[_0xf2fa('0x5')]('CreateCmHopperHistory',{'body':_0x116a7c,'log':_0xf2fa('0x6')});};};exports[_0xf2fa('0x7')]=function(_0x5ceaf4){return function(){return client[_0xf2fa('0x5')]('AvgHandleTime',{'options':{'where':{'endtime':{'$between':[moment()[_0xf2fa('0x8')](_0x5ceaf4,'minutes')[_0xf2fa('0x9')](_0xf2fa('0xa')),moment()[_0xf2fa('0x9')]('YYYY-MM-DD\x20HH:mm:ss')]}},'raw':![]},'log':'GetCmHopperHistory'});};};exports[_0xf2fa('0xb')]=function(_0x97526b){return function(){return client[_0xf2fa('0x5')](_0xf2fa('0xc'),{'options':{'where':{'createdAt':{'$between':[moment()['startOf']('day')[_0xf2fa('0x9')](_0xf2fa('0xa')),moment()['endOf'](_0xf2fa('0xd'))[_0xf2fa('0x9')](_0xf2fa('0xa'))]},'campaigntype':_0xf2fa('0x4')},'raw':![]},'log':_0xf2fa('0xc')});};};exports[_0xf2fa('0xe')]=function(_0x484a05){return function(){return client['Request'](_0xf2fa('0xf'),{'options':{'where':{'createdAt':{'$between':[moment()[_0xf2fa('0x10')](_0xf2fa('0xd'))[_0xf2fa('0x9')]('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0xf2fa('0x11')](_0xf2fa('0xd'))['format']('YYYY-MM-DD\x20HH:mm:ss')]},'campaigntype':_0xf2fa('0x12')},'raw':![]},'log':'GetCampaignHopperHistory'});};};
\ No newline at end of file
index 07db592..b07f7da 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcd6f=['TrunkId','ListId','Trunk','notify','NotifyFaxAccount','../client','getFaxAccounts','Request','GetFaxAccount','name','description','headerinfo','localstationid','minrate','maxrate','gateway','t38timeout'];(function(_0xc40b9f,_0x17ec1f){var _0x535b9c=function(_0x591b19){while(--_0x591b19){_0xc40b9f['push'](_0xc40b9f['shift']());}};_0x535b9c(++_0x17ec1f);}(_0xcd6f,0x17b));var _0xfcd6=function(_0x342700,_0x885ed8){_0x342700=_0x342700-0x0;var _0x5c3cdb=_0xcd6f[_0x342700];return _0x5c3cdb;};'use strict';var client=require(_0xfcd6('0x0'));exports[_0xfcd6('0x1')]=function(){return function(){return client[_0xfcd6('0x2')](_0xfcd6('0x3'),{'options':{'raw':![],'attributes':['id',_0xfcd6('0x4'),_0xfcd6('0x5'),'ecm',_0xfcd6('0x6'),_0xfcd6('0x7'),_0xfcd6('0x8'),_0xfcd6('0x9'),'modem',_0xfcd6('0xa'),'faxdetect',_0xfcd6('0xb'),'tech',_0xfcd6('0xc'),_0xfcd6('0xd'),'key'],'include':[{'model':_0xfcd6('0xe'),'as':'Trunk','attributes':['id',_0xfcd6('0x4'),'callerid','active']}]},'log':'getFaxAccount'});};};exports[_0xfcd6('0xf')]=function(_0x550f2b,_0x519cd5){return client[_0xfcd6('0x2')](_0xfcd6('0x10'),{'account':{'id':_0x550f2b},'body':_0x519cd5,'log':'NotifyFaxAccount'});};
\ No newline at end of file
+var _0x235b=['tech','TrunkId','ListId','key','callerid','active','getFaxAccount','notify','Request','NotifyFaxAccount','../client','GetFaxAccount','name','description','ecm','headerinfo','localstationid','maxrate','modem','gateway','t38timeout'];(function(_0x369209,_0x2f7ab7){var _0x3c3ff9=function(_0x3f3314){while(--_0x3f3314){_0x369209['push'](_0x369209['shift']());}};_0x3c3ff9(++_0x2f7ab7);}(_0x235b,0x1ed));var _0xb235=function(_0x1024cc,_0x3c2798){_0x1024cc=_0x1024cc-0x0;var _0x26c30f=_0x235b[_0x1024cc];return _0x26c30f;};'use strict';var client=require(_0xb235('0x0'));exports['getFaxAccounts']=function(){return function(){return client['Request'](_0xb235('0x1'),{'options':{'raw':![],'attributes':['id',_0xb235('0x2'),_0xb235('0x3'),_0xb235('0x4'),_0xb235('0x5'),_0xb235('0x6'),'minrate',_0xb235('0x7'),_0xb235('0x8'),_0xb235('0x9'),'faxdetect',_0xb235('0xa'),_0xb235('0xb'),_0xb235('0xc'),_0xb235('0xd'),_0xb235('0xe')],'include':[{'model':'Trunk','as':'Trunk','attributes':['id',_0xb235('0x2'),_0xb235('0xf'),_0xb235('0x10')]}]},'log':_0xb235('0x11')});};};exports[_0xb235('0x12')]=function(_0x2aded4,_0x369bf6){return client[_0xb235('0x13')]('NotifyFaxAccount',{'account':{'id':_0x2aded4},'body':_0x369bf6,'log':_0xb235('0x14')});};
\ No newline at end of file
index 1efc81e..637928e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0e02=['update','Request','UpdateFaxMessage'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x0e02,0x1c8));var _0x20e0=function(_0x147a4b,_0x4ca8c8){_0x147a4b=_0x147a4b-0x0;var _0x5196e7=_0x0e02[_0x147a4b];return _0x5196e7;};'use strict';var client=require('../client');exports[_0x20e0('0x0')]=function(_0x3fc877,_0xdd5ca4){return client[_0x20e0('0x1')](_0x20e0('0x2'),{'body':_0xdd5ca4,'options':{'where':{'AttachmentId':_0x3fc877}},'log':'UpdateFaxMessage'});};
\ No newline at end of file
+var _0x300c=['update','UpdateFaxMessage','../client'];(function(_0x3fa6cf,_0x1ecbb2){var _0x5d49b3=function(_0x51b2a1){while(--_0x51b2a1){_0x3fa6cf['push'](_0x3fa6cf['shift']());}};_0x5d49b3(++_0x1ecbb2);}(_0x300c,0xc5));var _0xc300=function(_0x412fe3,_0x4332c8){_0x412fe3=_0x412fe3-0x0;var _0x2d8200=_0x300c[_0x412fe3];return _0x2d8200;};'use strict';var client=require(_0xc300('0x0'));exports[_0xc300('0x1')]=function(_0x2f1b96,_0x4511e5){return client['Request'](_0xc300('0x2'),{'body':_0x4511e5,'options':{'where':{'AttachmentId':_0x2f1b96}},'log':_0xc300('0x2')});};
\ No newline at end of file
index 34870de..f351aa1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe59d=['serverUrl','DeskConfiguration','Configurations','DeskField','Subjects','content','variableName','Variable','Descriptions','keyContent','Fields','idField','nameField','customField','Tag','Tags','Request','GetDeskAccount','name','description','username','password','authType','type'];(function(_0x2842d1,_0x48ce41){var _0xdeb21b=function(_0x1a8b5b){while(--_0x1a8b5b){_0x2842d1['push'](_0x2842d1['shift']());}};_0xdeb21b(++_0x48ce41);}(_0xe59d,0x160));var _0xde59=function(_0x3ae38e,_0x3aaa14){_0x3ae38e=_0x3ae38e-0x0;var _0x483595=_0xe59d[_0x3ae38e];return _0x483595;};'use strict';var client=require('../../client');exports['getDeskAccounts']=function(){return function(_0x2cd9b5){return client[_0xde59('0x0')](_0xde59('0x1'),{'options':{'raw':![],'attributes':['id',_0xde59('0x2'),_0xde59('0x3'),_0xde59('0x4'),_0xde59('0x5'),'remoteUri',_0xde59('0x6'),_0xde59('0x7'),_0xde59('0x8')],'include':[{'model':_0xde59('0x9'),'as':_0xde59('0xa'),'attributes':['id',_0xde59('0x2')],'include':[{'model':_0xde59('0xb'),'as':_0xde59('0xc'),'attributes':['id',_0xde59('0x7'),_0xde59('0xd'),_0xde59('0xe')],'include':[{'model':_0xde59('0xf'),'as':_0xde59('0xf'),'attributes':['id',_0xde59('0x2')]}]},{'model':_0xde59('0xb'),'as':_0xde59('0x10'),'attributes':['id',_0xde59('0x7'),'content','key','keyType',_0xde59('0x11'),'variableName'],'include':[{'model':_0xde59('0xf'),'as':_0xde59('0xf'),'attributes':['id',_0xde59('0x2')]}]},{'model':'DeskField','as':_0xde59('0x12'),'attributes':['id',_0xde59('0x7'),'content',_0xde59('0x13'),_0xde59('0x14'),_0xde59('0x15'),_0xde59('0xe')],'include':[{'model':_0xde59('0xf'),'as':'Variable','attributes':['id',_0xde59('0x2')]}]},{'model':_0xde59('0x16'),'as':_0xde59('0x17'),'attributes':['id',_0xde59('0x2')]}]}]},'log':_0xde59('0x1')});};};
\ No newline at end of file
+var _0x4211=['username','password','remoteUri','serverUrl','DeskConfiguration','Configurations','Subjects','type','content','variableName','Variable','DeskField','Descriptions','key','keyContent','Fields','idField','nameField','customField','GetDeskAccount','../../client','Request','name','description'];(function(_0x33e7b4,_0x1bc3ae){var _0x448530=function(_0x3c1fe1){while(--_0x3c1fe1){_0x33e7b4['push'](_0x33e7b4['shift']());}};_0x448530(++_0x1bc3ae);}(_0x4211,0x14c));var _0x1421=function(_0x46da77,_0x492996){_0x46da77=_0x46da77-0x0;var _0x51eb47=_0x4211[_0x46da77];return _0x51eb47;};'use strict';var client=require(_0x1421('0x0'));exports['getDeskAccounts']=function(){return function(_0x38670f){return client[_0x1421('0x1')]('GetDeskAccount',{'options':{'raw':![],'attributes':['id',_0x1421('0x2'),_0x1421('0x3'),_0x1421('0x4'),_0x1421('0x5'),_0x1421('0x6'),'authType','type',_0x1421('0x7')],'include':[{'model':_0x1421('0x8'),'as':_0x1421('0x9'),'attributes':['id',_0x1421('0x2')],'include':[{'model':'DeskField','as':_0x1421('0xa'),'attributes':['id',_0x1421('0xb'),_0x1421('0xc'),_0x1421('0xd')],'include':[{'model':_0x1421('0xe'),'as':_0x1421('0xe'),'attributes':['id',_0x1421('0x2')]}]},{'model':_0x1421('0xf'),'as':_0x1421('0x10'),'attributes':['id','type',_0x1421('0xc'),_0x1421('0x11'),'keyType',_0x1421('0x12'),_0x1421('0xd')],'include':[{'model':_0x1421('0xe'),'as':_0x1421('0xe'),'attributes':['id',_0x1421('0x2')]}]},{'model':'DeskField','as':_0x1421('0x13'),'attributes':['id',_0x1421('0xb'),_0x1421('0xc'),_0x1421('0x14'),_0x1421('0x15'),_0x1421('0x16'),_0x1421('0xd')],'include':[{'model':_0x1421('0xe'),'as':_0x1421('0xe'),'attributes':['id',_0x1421('0x2')]}]},{'model':'Tag','as':'Tags','attributes':['id','name']}]}]},'log':_0x1421('0x17')});};};
\ No newline at end of file
index 05abf06..0a0f097 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb9a9=['key','keyType','keyContent','Fields','idField','nameField','customField','CloudProvider','data2','data5','GetDynamics365Account','../../client','getDynamics365Accounts','name','username','password','remoteUri','tenantId','clientSecret','serverUrl','description','Configurations','moduleCreate','additionalSearchContact','Dynamics365Field','Subjects','variableName','Variable','Descriptions','content'];(function(_0x182ec0,_0x42cee8){var _0x3246b3=function(_0x2357d4){while(--_0x2357d4){_0x182ec0['push'](_0x182ec0['shift']());}};_0x3246b3(++_0x42cee8);}(_0xb9a9,0x83));var _0x9b9a=function(_0x218a26,_0x5d0caa){_0x218a26=_0x218a26-0x0;var _0x445f7d=_0xb9a9[_0x218a26];return _0x445f7d;};'use strict';var client=require(_0x9b9a('0x0'));exports[_0x9b9a('0x1')]=function(){return function(_0x1383c2){return client['Request']('GetDynamics365Account',{'options':{'raw':![],'attributes':['id',_0x9b9a('0x2'),_0x9b9a('0x3'),_0x9b9a('0x4'),_0x9b9a('0x5'),_0x9b9a('0x6'),'clientId',_0x9b9a('0x7'),_0x9b9a('0x8'),_0x9b9a('0x9'),'modernAuthentication'],'include':[{'model':'Dynamics365Configuration','as':_0x9b9a('0xa'),'attributes':['id',_0x9b9a('0x2'),'ticketType',_0x9b9a('0xb'),_0x9b9a('0xc')],'include':[{'model':_0x9b9a('0xd'),'as':_0x9b9a('0xe'),'attributes':['id','type','content',_0x9b9a('0xf')],'include':[{'model':_0x9b9a('0x10'),'as':_0x9b9a('0x10'),'attributes':['id','name']}]},{'model':_0x9b9a('0xd'),'as':_0x9b9a('0x11'),'attributes':['id','type',_0x9b9a('0x12'),_0x9b9a('0x13'),_0x9b9a('0x14'),_0x9b9a('0x15'),_0x9b9a('0xf')],'include':[{'model':_0x9b9a('0x10'),'as':_0x9b9a('0x10'),'attributes':['id',_0x9b9a('0x2')]}]},{'model':_0x9b9a('0xd'),'as':_0x9b9a('0x16'),'attributes':['id','type',_0x9b9a('0x12'),_0x9b9a('0x17'),_0x9b9a('0x18'),_0x9b9a('0x19'),_0x9b9a('0xf')],'include':[{'model':_0x9b9a('0x10'),'as':_0x9b9a('0x10'),'attributes':['id',_0x9b9a('0x2')]}]}]},{'model':_0x9b9a('0x1a'),'as':'CloudProvider','attributes':['id',_0x9b9a('0x1b'),_0x9b9a('0x1c'),'data7']}]},'log':_0x9b9a('0x1d')});};};
\ No newline at end of file
+var _0x5021=['Dynamics365Field','Subjects','content','Variable','Descriptions','type','key','keyType','keyContent','variableName','idField','nameField','customField','CloudProvider','data2','data5','data7','../../client','getDynamics365Accounts','name','username','password','remoteUri','tenantId','clientSecret','description','modernAuthentication','Dynamics365Configuration','Configurations','ticketType','additionalSearchContact'];(function(_0x379b05,_0x56ad15){var _0x1eb0c7=function(_0x48da1c){while(--_0x48da1c){_0x379b05['push'](_0x379b05['shift']());}};_0x1eb0c7(++_0x56ad15);}(_0x5021,0x147));var _0x1502=function(_0x380c75,_0x5c8868){_0x380c75=_0x380c75-0x0;var _0x1dee11=_0x5021[_0x380c75];return _0x1dee11;};'use strict';var client=require(_0x1502('0x0'));exports[_0x1502('0x1')]=function(){return function(_0x406e7b){return client['Request']('GetDynamics365Account',{'options':{'raw':![],'attributes':['id',_0x1502('0x2'),_0x1502('0x3'),_0x1502('0x4'),_0x1502('0x5'),_0x1502('0x6'),'clientId',_0x1502('0x7'),'serverUrl',_0x1502('0x8'),_0x1502('0x9')],'include':[{'model':_0x1502('0xa'),'as':_0x1502('0xb'),'attributes':['id',_0x1502('0x2'),_0x1502('0xc'),'moduleCreate',_0x1502('0xd')],'include':[{'model':_0x1502('0xe'),'as':_0x1502('0xf'),'attributes':['id','type',_0x1502('0x10'),'variableName'],'include':[{'model':_0x1502('0x11'),'as':_0x1502('0x11'),'attributes':['id',_0x1502('0x2')]}]},{'model':_0x1502('0xe'),'as':_0x1502('0x12'),'attributes':['id',_0x1502('0x13'),_0x1502('0x10'),_0x1502('0x14'),_0x1502('0x15'),_0x1502('0x16'),_0x1502('0x17')],'include':[{'model':_0x1502('0x11'),'as':_0x1502('0x11'),'attributes':['id',_0x1502('0x2')]}]},{'model':_0x1502('0xe'),'as':'Fields','attributes':['id',_0x1502('0x13'),_0x1502('0x10'),_0x1502('0x18'),_0x1502('0x19'),_0x1502('0x1a'),_0x1502('0x17')],'include':[{'model':_0x1502('0x11'),'as':'Variable','attributes':['id','name']}]}]},{'model':'CloudProvider','as':_0x1502('0x1b'),'attributes':['id',_0x1502('0x1c'),_0x1502('0x1d'),_0x1502('0x1e')]}]},'log':'GetDynamics365Account'});};};
\ No newline at end of file
index 7884b88..082f306 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x98b7=['Configurations','Tag','FreshdeskField','Subjects','type','content','variableName','Variable','key','idField','nameField','customField','name','../../client','getFreshdeskAccounts','Request','apiKey','remoteUri','serverUrl','FreshdeskConfiguration'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0x98b7,0xc1));var _0x798b=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x98b7[_0x2c91e9];return _0x13f0ff;};'use strict';var client=require(_0x798b('0x0'));exports[_0x798b('0x1')]=function(){return function(_0x622719){return client[_0x798b('0x2')]('GetFreshdeskAccount',{'options':{'raw':![],'attributes':['id','name','username',_0x798b('0x3'),_0x798b('0x4'),_0x798b('0x5')],'include':[{'model':_0x798b('0x6'),'as':_0x798b('0x7'),'attributes':['id','name'],'include':[{'model':_0x798b('0x8'),'attributes':['id','name']},{'model':_0x798b('0x9'),'as':_0x798b('0xa'),'attributes':['id',_0x798b('0xb'),_0x798b('0xc'),_0x798b('0xd')],'include':[{'model':'Variable','as':_0x798b('0xe'),'attributes':['id','name']}]},{'model':_0x798b('0x9'),'as':'Descriptions','attributes':['id',_0x798b('0xb'),_0x798b('0xc'),_0x798b('0xf'),'keyType','keyContent',_0x798b('0xd')],'include':[{'model':_0x798b('0xe'),'as':_0x798b('0xe'),'attributes':['id','name']}]},{'model':_0x798b('0x9'),'as':'Fields','attributes':['id',_0x798b('0xb'),'content',_0x798b('0x10'),_0x798b('0x11'),_0x798b('0x12'),_0x798b('0xd')],'include':[{'model':_0x798b('0xe'),'as':_0x798b('0xe'),'attributes':['id',_0x798b('0x13')]}]}]}]},'log':'GetFreshdeskAccount'});};};
\ No newline at end of file
+var _0x9db7=['variableName','Variable','Descriptions','key','keyType','keyContent','Fields','nameField','customField','GetFreshdeskAccount','../../client','getFreshdeskAccounts','Request','name','apiKey','remoteUri','FreshdeskConfiguration','Configurations','Tag','FreshdeskField','Subjects','type','content'];(function(_0x4347b2,_0x138cd3){var _0x44722f=function(_0x3146a4){while(--_0x3146a4){_0x4347b2['push'](_0x4347b2['shift']());}};_0x44722f(++_0x138cd3);}(_0x9db7,0x1bf));var _0x79db=function(_0x443cfc,_0xeb23fb){_0x443cfc=_0x443cfc-0x0;var _0x18b338=_0x9db7[_0x443cfc];return _0x18b338;};'use strict';var client=require(_0x79db('0x0'));exports[_0x79db('0x1')]=function(){return function(_0x435fde){return client[_0x79db('0x2')]('GetFreshdeskAccount',{'options':{'raw':![],'attributes':['id',_0x79db('0x3'),'username',_0x79db('0x4'),_0x79db('0x5'),'serverUrl'],'include':[{'model':_0x79db('0x6'),'as':_0x79db('0x7'),'attributes':['id',_0x79db('0x3')],'include':[{'model':_0x79db('0x8'),'attributes':['id',_0x79db('0x3')]},{'model':_0x79db('0x9'),'as':_0x79db('0xa'),'attributes':['id',_0x79db('0xb'),_0x79db('0xc'),_0x79db('0xd')],'include':[{'model':_0x79db('0xe'),'as':_0x79db('0xe'),'attributes':['id','name']}]},{'model':_0x79db('0x9'),'as':_0x79db('0xf'),'attributes':['id',_0x79db('0xb'),_0x79db('0xc'),_0x79db('0x10'),_0x79db('0x11'),_0x79db('0x12'),_0x79db('0xd')],'include':[{'model':_0x79db('0xe'),'as':'Variable','attributes':['id','name']}]},{'model':'FreshdeskField','as':_0x79db('0x13'),'attributes':['id','type',_0x79db('0xc'),'idField',_0x79db('0x14'),_0x79db('0x15'),_0x79db('0xd')],'include':[{'model':_0x79db('0xe'),'as':_0x79db('0xe'),'attributes':['id',_0x79db('0x3')]}]}]}]},'log':_0x79db('0x16')});};};
\ No newline at end of file
index f4ddf26..97afbc8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcf98=['variableName','Variable','key','keyType','keyContent','getFreshsalesAccounts','Request','GetFreshsalesAccount','name','remoteUri','serverUrl','FreshsalesConfiguration','Configurations','FreshsalesField','Subjects','type','content'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0xcf98,0x8d));var _0x8cf9=function(_0x5f4d8e,_0x56283b){_0x5f4d8e=_0x5f4d8e-0x0;var _0x2d7f2b=_0xcf98[_0x5f4d8e];return _0x2d7f2b;};'use strict';var client=require('../../client');exports[_0x8cf9('0x0')]=function(){return function(_0x2565de){return client[_0x8cf9('0x1')](_0x8cf9('0x2'),{'options':{'raw':![],'attributes':['id',_0x8cf9('0x3'),'username','apiKey',_0x8cf9('0x4'),_0x8cf9('0x5')],'include':[{'model':_0x8cf9('0x6'),'as':_0x8cf9('0x7'),'attributes':['id',_0x8cf9('0x3')],'include':[{'model':_0x8cf9('0x8'),'as':_0x8cf9('0x9'),'attributes':['id',_0x8cf9('0xa'),_0x8cf9('0xb'),_0x8cf9('0xc')],'include':[{'model':_0x8cf9('0xd'),'as':'Variable','attributes':['id',_0x8cf9('0x3')]}]},{'model':_0x8cf9('0x8'),'as':'Descriptions','attributes':['id',_0x8cf9('0xa'),'content',_0x8cf9('0xe'),_0x8cf9('0xf'),_0x8cf9('0x10'),_0x8cf9('0xc')],'include':[{'model':_0x8cf9('0xd'),'as':_0x8cf9('0xd'),'attributes':['id',_0x8cf9('0x3')]}]}]}]},'log':'GetFreshsalesccount'});};};
\ No newline at end of file
+var _0x6363=['Request','GetFreshsalesAccount','name','username','apiKey','remoteUri','serverUrl','FreshsalesConfiguration','Configurations','FreshsalesField','Subjects','type','variableName','Variable','Descriptions','content','key','keyType','keyContent','GetFreshsalesccount','../../client'];(function(_0x4fdc10,_0x39d425){var _0xd60296=function(_0x439d28){while(--_0x439d28){_0x4fdc10['push'](_0x4fdc10['shift']());}};_0xd60296(++_0x39d425);}(_0x6363,0x13a));var _0x3636=function(_0x1a0a55,_0x52f87b){_0x1a0a55=_0x1a0a55-0x0;var _0x585e12=_0x6363[_0x1a0a55];return _0x585e12;};'use strict';var client=require(_0x3636('0x0'));exports['getFreshsalesAccounts']=function(){return function(_0x225b8a){return client[_0x3636('0x1')](_0x3636('0x2'),{'options':{'raw':![],'attributes':['id',_0x3636('0x3'),_0x3636('0x4'),_0x3636('0x5'),_0x3636('0x6'),_0x3636('0x7')],'include':[{'model':_0x3636('0x8'),'as':_0x3636('0x9'),'attributes':['id',_0x3636('0x3')],'include':[{'model':_0x3636('0xa'),'as':_0x3636('0xb'),'attributes':['id',_0x3636('0xc'),'content',_0x3636('0xd')],'include':[{'model':'Variable','as':_0x3636('0xe'),'attributes':['id',_0x3636('0x3')]}]},{'model':_0x3636('0xa'),'as':_0x3636('0xf'),'attributes':['id',_0x3636('0xc'),_0x3636('0x10'),_0x3636('0x11'),_0x3636('0x12'),_0x3636('0x13'),'variableName'],'include':[{'model':'Variable','as':_0x3636('0xe'),'attributes':['id','name']}]}]}]},'log':_0x3636('0x14')});};};
\ No newline at end of file
index e96373c..a95f180 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe4c0=['securityToken','serverUrl','type','SalesforceConfiguration','Configurations','name','moduleSearch','moduleCreate','ticketType','leadId','additionalSearchAccount','additionalSearchContact','additionalSearchLead','SalesforceField','Subjects','Variable','Descriptions','Fields','../../client','getSalesforceAccounts','Request','GetSalesforceAccount','username','remoteUri','clientSecret'];(function(_0x4bb8fc,_0x57f55d){var _0x5f2eab=function(_0x8395bc){while(--_0x8395bc){_0x4bb8fc['push'](_0x4bb8fc['shift']());}};_0x5f2eab(++_0x57f55d);}(_0xe4c0,0x10c));var _0x0e4c=function(_0x21d532,_0x4552a4){_0x21d532=_0x21d532-0x0;var _0x37bda1=_0xe4c0[_0x21d532];return _0x37bda1;};'use strict';var client=require(_0x0e4c('0x0'));exports[_0x0e4c('0x1')]=function(){return function(_0x2a413e){return client[_0x0e4c('0x2')](_0x0e4c('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x0e4c('0x4'),'password',_0x0e4c('0x5'),'clientId',_0x0e4c('0x6'),_0x0e4c('0x7'),_0x0e4c('0x8'),_0x0e4c('0x9')],'include':[{'model':_0x0e4c('0xa'),'as':_0x0e4c('0xb'),'attributes':['id',_0x0e4c('0xc'),_0x0e4c('0xd'),_0x0e4c('0xe'),_0x0e4c('0xf'),_0x0e4c('0x10'),_0x0e4c('0x11'),_0x0e4c('0x12'),_0x0e4c('0x13')],'include':[{'model':_0x0e4c('0x14'),'as':_0x0e4c('0x15'),'include':[{'model':'Variable','as':_0x0e4c('0x16'),'attributes':['id',_0x0e4c('0xc')]}]},{'model':_0x0e4c('0x14'),'as':_0x0e4c('0x17'),'include':[{'model':'Variable','as':'Variable','attributes':['id',_0x0e4c('0xc')]}]},{'model':_0x0e4c('0x14'),'as':_0x0e4c('0x18'),'include':[{'model':'Variable','as':_0x0e4c('0x16'),'attributes':['id','name']}]}]}]},'log':_0x0e4c('0x3')});};};
\ No newline at end of file
+var _0x00f4=['moduleCreate','ticketType','additionalSearchAccount','additionalSearchContact','additionalSearchLead','SalesforceField','Variable','../../client','Request','GetSalesforceAccount','name','username','password','remoteUri','securityToken','type','SalesforceConfiguration','Configurations','moduleSearch'];(function(_0x47cc3b,_0x1b849f){var _0x144adc=function(_0x4ef01b){while(--_0x4ef01b){_0x47cc3b['push'](_0x47cc3b['shift']());}};_0x144adc(++_0x1b849f);}(_0x00f4,0x137));var _0x400f=function(_0x46f877,_0x595cf0){_0x46f877=_0x46f877-0x0;var _0x478249=_0x00f4[_0x46f877];return _0x478249;};'use strict';var client=require(_0x400f('0x0'));exports['getSalesforceAccounts']=function(){return function(_0x1e178c){return client[_0x400f('0x1')](_0x400f('0x2'),{'options':{'raw':![],'attributes':['id',_0x400f('0x3'),_0x400f('0x4'),_0x400f('0x5'),_0x400f('0x6'),'clientId','clientSecret',_0x400f('0x7'),'serverUrl',_0x400f('0x8')],'include':[{'model':_0x400f('0x9'),'as':_0x400f('0xa'),'attributes':['id',_0x400f('0x3'),_0x400f('0xb'),_0x400f('0xc'),_0x400f('0xd'),'leadId',_0x400f('0xe'),_0x400f('0xf'),_0x400f('0x10')],'include':[{'model':_0x400f('0x11'),'as':'Subjects','include':[{'model':_0x400f('0x12'),'as':_0x400f('0x12'),'attributes':['id','name']}]},{'model':_0x400f('0x11'),'as':'Descriptions','include':[{'model':_0x400f('0x12'),'as':_0x400f('0x12'),'attributes':['id',_0x400f('0x3')]}]},{'model':_0x400f('0x11'),'as':'Fields','include':[{'model':'Variable','as':'Variable','attributes':['id',_0x400f('0x3')]}]}]}]},'log':_0x400f('0x2')});};};
\ No newline at end of file
index 74dc9c9..f9cd4e1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x187d=['../../client','Request','GetServicenowAccount','name','description','username','email','remoteUri','ServicenowConfiguration','Configurations','ServicenowField','Subjects','type','content','variableName','Variable','Descriptions','keyType','keyContent','idField','nameField'];(function(_0x1beef3,_0x57c4b8){var _0x5af964=function(_0x36f463){while(--_0x36f463){_0x1beef3['push'](_0x1beef3['shift']());}};_0x5af964(++_0x57c4b8);}(_0x187d,0x93));var _0xd187=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0x187d[_0xea8947];return _0x2455e9;};'use strict';var client=require(_0xd187('0x0'));exports['getServicenowAccounts']=function(){return function(_0x3b9b6d){return client[_0xd187('0x1')](_0xd187('0x2'),{'options':{'raw':![],'attributes':['id',_0xd187('0x3'),_0xd187('0x4'),_0xd187('0x5'),'password',_0xd187('0x6'),_0xd187('0x7'),'serverUrl'],'include':[{'model':_0xd187('0x8'),'as':_0xd187('0x9'),'attributes':['id',_0xd187('0x3')],'include':[{'model':_0xd187('0xa'),'as':_0xd187('0xb'),'attributes':['id',_0xd187('0xc'),_0xd187('0xd'),_0xd187('0xe')],'include':[{'model':'Variable','as':_0xd187('0xf'),'attributes':['id',_0xd187('0x3')]}]},{'model':_0xd187('0xa'),'as':_0xd187('0x10'),'attributes':['id',_0xd187('0xc'),_0xd187('0xd'),'key',_0xd187('0x11'),_0xd187('0x12'),_0xd187('0xe')],'include':[{'model':'Variable','as':_0xd187('0xf'),'attributes':['id',_0xd187('0x3')]}]},{'model':_0xd187('0xa'),'as':'Fields','attributes':['id',_0xd187('0xc'),_0xd187('0xd'),_0xd187('0x13'),_0xd187('0x14'),'customField',_0xd187('0xe')],'include':[{'model':_0xd187('0xf'),'as':_0xd187('0xf'),'attributes':['id',_0xd187('0x3')]}]}]}]},'log':'GetServicenowkAccount'});};};
\ No newline at end of file
+var _0x187d=['../../client','Request','GetServicenowAccount','name','description','username','email','remoteUri','ServicenowConfiguration','Configurations','ServicenowField','Subjects','type','content','variableName','Variable','Descriptions','keyType','keyContent','idField','nameField'];(function(_0x1477ef,_0x54a5d6){var _0x164acd=function(_0x139149){while(--_0x139149){_0x1477ef['push'](_0x1477ef['shift']());}};_0x164acd(++_0x54a5d6);}(_0x187d,0x93));var _0xd187=function(_0x1e7b16,_0x4607a1){_0x1e7b16=_0x1e7b16-0x0;var _0x37fadc=_0x187d[_0x1e7b16];return _0x37fadc;};'use strict';var client=require(_0xd187('0x0'));exports['getServicenowAccounts']=function(){return function(_0x3b9b6d){return client[_0xd187('0x1')](_0xd187('0x2'),{'options':{'raw':![],'attributes':['id',_0xd187('0x3'),_0xd187('0x4'),_0xd187('0x5'),'password',_0xd187('0x6'),_0xd187('0x7'),'serverUrl'],'include':[{'model':_0xd187('0x8'),'as':_0xd187('0x9'),'attributes':['id',_0xd187('0x3')],'include':[{'model':_0xd187('0xa'),'as':_0xd187('0xb'),'attributes':['id',_0xd187('0xc'),_0xd187('0xd'),_0xd187('0xe')],'include':[{'model':'Variable','as':_0xd187('0xf'),'attributes':['id',_0xd187('0x3')]}]},{'model':_0xd187('0xa'),'as':_0xd187('0x10'),'attributes':['id',_0xd187('0xc'),_0xd187('0xd'),'key',_0xd187('0x11'),_0xd187('0x12'),_0xd187('0xe')],'include':[{'model':'Variable','as':_0xd187('0xf'),'attributes':['id',_0xd187('0x3')]}]},{'model':_0xd187('0xa'),'as':'Fields','attributes':['id',_0xd187('0xc'),_0xd187('0xd'),_0xd187('0x13'),_0xd187('0x14'),'customField',_0xd187('0xe')],'include':[{'model':_0xd187('0xf'),'as':_0xd187('0xf'),'attributes':['id',_0xd187('0x3')]}]}]}]},'log':'GetServicenowkAccount'});};};
\ No newline at end of file
index 2ebb544..324d72b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f2f=['username','password','SugarcrmConfiguration','Configurations','SugarcrmField','Subjects','type','variableName','Variable','Descriptions','key','Fields','content','idField','customField','../../client','getSugarcrmAccounts','Request','GetSugarcrmAccount','name'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x5f2f,0x73));var _0xf5f2=function(_0x3650d0,_0x55ed89){_0x3650d0=_0x3650d0-0x0;var _0x3ac943=_0x5f2f[_0x3650d0];return _0x3ac943;};'use strict';var client=require(_0xf5f2('0x0'));exports[_0xf5f2('0x1')]=function(){return function(_0x2dcf60){return client[_0xf5f2('0x2')](_0xf5f2('0x3'),{'options':{'raw':![],'attributes':['id',_0xf5f2('0x4'),_0xf5f2('0x5'),_0xf5f2('0x6'),'remoteUri','serverUrl'],'include':[{'model':_0xf5f2('0x7'),'as':_0xf5f2('0x8'),'attributes':['id',_0xf5f2('0x4')],'include':[{'model':_0xf5f2('0x9'),'as':_0xf5f2('0xa'),'attributes':['id',_0xf5f2('0xb'),'content',_0xf5f2('0xc')],'include':[{'model':_0xf5f2('0xd'),'as':_0xf5f2('0xd'),'attributes':['id','name']}]},{'model':_0xf5f2('0x9'),'as':_0xf5f2('0xe'),'attributes':['id',_0xf5f2('0xb'),'content',_0xf5f2('0xf'),'keyType','keyContent',_0xf5f2('0xc')],'include':[{'model':_0xf5f2('0xd'),'as':'Variable','attributes':['id',_0xf5f2('0x4')]}]},{'model':_0xf5f2('0x9'),'as':_0xf5f2('0x10'),'attributes':['id',_0xf5f2('0xb'),_0xf5f2('0x11'),_0xf5f2('0x12'),'nameField',_0xf5f2('0x13'),_0xf5f2('0xc')],'include':[{'model':_0xf5f2('0xd'),'as':_0xf5f2('0xd'),'attributes':['id',_0xf5f2('0x4')]}]}]}]},'log':'GetSugarcrmAccount'});};};
\ No newline at end of file
+var _0xda2d=['Subjects','type','content','variableName','Variable','key','keyType','keyContent','idField','nameField','customField','getSugarcrmAccounts','Request','GetSugarcrmAccount','name','serverUrl','SugarcrmConfiguration','Configurations','SugarcrmField'];(function(_0x380b8f,_0x32271d){var _0x646c69=function(_0x57c77f){while(--_0x57c77f){_0x380b8f['push'](_0x380b8f['shift']());}};_0x646c69(++_0x32271d);}(_0xda2d,0x102));var _0xdda2=function(_0x134c80,_0x101fde){_0x134c80=_0x134c80-0x0;var _0x44c98e=_0xda2d[_0x134c80];return _0x44c98e;};'use strict';var client=require('../../client');exports[_0xdda2('0x0')]=function(){return function(_0x35f029){return client[_0xdda2('0x1')](_0xdda2('0x2'),{'options':{'raw':![],'attributes':['id',_0xdda2('0x3'),'username','password','remoteUri',_0xdda2('0x4')],'include':[{'model':_0xdda2('0x5'),'as':_0xdda2('0x6'),'attributes':['id',_0xdda2('0x3')],'include':[{'model':_0xdda2('0x7'),'as':_0xdda2('0x8'),'attributes':['id',_0xdda2('0x9'),_0xdda2('0xa'),_0xdda2('0xb')],'include':[{'model':_0xdda2('0xc'),'as':'Variable','attributes':['id',_0xdda2('0x3')]}]},{'model':_0xdda2('0x7'),'as':'Descriptions','attributes':['id',_0xdda2('0x9'),_0xdda2('0xa'),_0xdda2('0xd'),_0xdda2('0xe'),_0xdda2('0xf'),_0xdda2('0xb')],'include':[{'model':_0xdda2('0xc'),'as':_0xdda2('0xc'),'attributes':['id','name']}]},{'model':'SugarcrmField','as':'Fields','attributes':['id',_0xdda2('0x9'),_0xdda2('0xa'),_0xdda2('0x10'),_0xdda2('0x11'),_0xdda2('0x12'),_0xdda2('0xb')],'include':[{'model':_0xdda2('0xc'),'as':'Variable','attributes':['id',_0xdda2('0x3')]}]}]}]},'log':'GetSugarcrmAccount'});};};
\ No newline at end of file
index c492ce1..94c3a87 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb84d=['type','variableName','Variable','VtigerField','content','key','keyType','keyContent','nameField','customField','getVtigerAccounts','GetVtigerAccount','name','description','username','accessKey','remoteUri','Configurations','Subjects'];(function(_0x217779,_0x33aceb){var _0x4f0bf3=function(_0x4814dd){while(--_0x4814dd){_0x217779['push'](_0x217779['shift']());}};_0x4f0bf3(++_0x33aceb);}(_0xb84d,0x173));var _0xdb84=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xb84d[_0x433a86];return _0x23000c;};'use strict';var client=require('../../client');exports[_0xdb84('0x0')]=function(){return function(_0x107bab){return client['Request'](_0xdb84('0x1'),{'options':{'raw':![],'attributes':['id',_0xdb84('0x2'),_0xdb84('0x3'),_0xdb84('0x4'),_0xdb84('0x5'),_0xdb84('0x6'),'serverUrl'],'include':[{'model':'VtigerConfiguration','as':_0xdb84('0x7'),'attributes':['id',_0xdb84('0x2')],'include':[{'model':'VtigerField','as':_0xdb84('0x8'),'attributes':['id',_0xdb84('0x9'),'content',_0xdb84('0xa')],'include':[{'model':_0xdb84('0xb'),'as':_0xdb84('0xb'),'attributes':['id',_0xdb84('0x2')]}]},{'model':_0xdb84('0xc'),'as':'Descriptions','attributes':['id',_0xdb84('0x9'),_0xdb84('0xd'),_0xdb84('0xe'),_0xdb84('0xf'),_0xdb84('0x10'),'variableName'],'include':[{'model':_0xdb84('0xb'),'as':_0xdb84('0xb'),'attributes':['id',_0xdb84('0x2')]}]},{'model':_0xdb84('0xc'),'as':'Fields','attributes':['id','type',_0xdb84('0xd'),'idField',_0xdb84('0x11'),_0xdb84('0x12'),_0xdb84('0xa')],'include':[{'model':_0xdb84('0xb'),'as':_0xdb84('0xb'),'attributes':['id',_0xdb84('0x2')]}]}]}]},'log':_0xdb84('0x1')});};};
\ No newline at end of file
+var _0x5425=['accessKey','remoteUri','serverUrl','VtigerConfiguration','Configurations','VtigerField','Subjects','content','variableName','Variable','Descriptions','type','key','keyType','keyContent','Fields','idField','nameField','customField','GetVtigerAccount','name','username'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0x5425,0xc3));var _0x5542=function(_0x19d93c,_0x4b0fda){_0x19d93c=_0x19d93c-0x0;var _0x2f9f2a=_0x5425[_0x19d93c];return _0x2f9f2a;};'use strict';var client=require('../../client');exports['getVtigerAccounts']=function(){return function(_0x388c8c){return client['Request'](_0x5542('0x0'),{'options':{'raw':![],'attributes':['id',_0x5542('0x1'),'description',_0x5542('0x2'),_0x5542('0x3'),_0x5542('0x4'),_0x5542('0x5')],'include':[{'model':_0x5542('0x6'),'as':_0x5542('0x7'),'attributes':['id',_0x5542('0x1')],'include':[{'model':_0x5542('0x8'),'as':_0x5542('0x9'),'attributes':['id','type',_0x5542('0xa'),_0x5542('0xb')],'include':[{'model':'Variable','as':_0x5542('0xc'),'attributes':['id','name']}]},{'model':'VtigerField','as':_0x5542('0xd'),'attributes':['id',_0x5542('0xe'),_0x5542('0xa'),_0x5542('0xf'),_0x5542('0x10'),_0x5542('0x11'),_0x5542('0xb')],'include':[{'model':_0x5542('0xc'),'as':_0x5542('0xc'),'attributes':['id',_0x5542('0x1')]}]},{'model':'VtigerField','as':_0x5542('0x12'),'attributes':['id',_0x5542('0xe'),_0x5542('0xa'),_0x5542('0x13'),_0x5542('0x14'),_0x5542('0x15'),'variableName'],'include':[{'model':'Variable','as':_0x5542('0xc'),'attributes':['id',_0x5542('0x1')]}]}]}]},'log':_0x5542('0x0')});};};
\ No newline at end of file
index dc8b0ac..0790afa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfbc6=['Descriptions','keyType','keyContent','Fields','nameField','customField','../../client','getZendeskAccounts','Request','GetZendeskAccount','name','username','token','remoteUri','authType','serverUrl','ZendeskConfiguration','Configurations','Tag','ZendeskField','Subjects','type','content','variableName','Variable'];(function(_0x4a04de,_0x2e342c){var _0xbbe018=function(_0x39639c){while(--_0x39639c){_0x4a04de['push'](_0x4a04de['shift']());}};_0xbbe018(++_0x2e342c);}(_0xfbc6,0x1e1));var _0x6fbc=function(_0x2af504,_0x46a924){_0x2af504=_0x2af504-0x0;var _0x2abb2e=_0xfbc6[_0x2af504];return _0x2abb2e;};'use strict';var client=require(_0x6fbc('0x0'));exports[_0x6fbc('0x1')]=function(){return function(_0x4f738f){return client[_0x6fbc('0x2')](_0x6fbc('0x3'),{'options':{'raw':![],'attributes':['id',_0x6fbc('0x4'),_0x6fbc('0x5'),'password',_0x6fbc('0x6'),_0x6fbc('0x7'),_0x6fbc('0x8'),_0x6fbc('0x9'),'type'],'include':[{'model':_0x6fbc('0xa'),'as':_0x6fbc('0xb'),'attributes':['id',_0x6fbc('0x4')],'include':[{'model':_0x6fbc('0xc'),'attributes':['id',_0x6fbc('0x4')]},{'model':_0x6fbc('0xd'),'as':_0x6fbc('0xe'),'attributes':['id',_0x6fbc('0xf'),_0x6fbc('0x10'),_0x6fbc('0x11')],'include':[{'model':'Variable','as':_0x6fbc('0x12'),'attributes':['id',_0x6fbc('0x4')]}]},{'model':'ZendeskField','as':_0x6fbc('0x13'),'attributes':['id',_0x6fbc('0xf'),_0x6fbc('0x10'),'key',_0x6fbc('0x14'),_0x6fbc('0x15'),_0x6fbc('0x11')],'include':[{'model':_0x6fbc('0x12'),'as':_0x6fbc('0x12'),'attributes':['id',_0x6fbc('0x4')]}]},{'model':'ZendeskField','as':_0x6fbc('0x16'),'attributes':['id',_0x6fbc('0xf'),_0x6fbc('0x10'),'idField',_0x6fbc('0x17'),_0x6fbc('0x18'),_0x6fbc('0x11')],'include':[{'model':'Variable','as':_0x6fbc('0x12'),'attributes':['id',_0x6fbc('0x4')]}]}]}]},'log':_0x6fbc('0x3')});};};
\ No newline at end of file
+var _0x7d36=['Descriptions','content','key','keyType','keyContent','nameField','../../client','getZendeskAccounts','Request','GetZendeskAccount','password','authType','serverUrl','ZendeskConfiguration','Configurations','name','ZendeskField','Subjects','type','variableName','Variable'];(function(_0x3f3a40,_0x2db148){var _0x1c3619=function(_0x5d691b){while(--_0x5d691b){_0x3f3a40['push'](_0x3f3a40['shift']());}};_0x1c3619(++_0x2db148);}(_0x7d36,0xed));var _0x67d3=function(_0x16169a,_0x2247b8){_0x16169a=_0x16169a-0x0;var _0xfb2908=_0x7d36[_0x16169a];return _0xfb2908;};'use strict';var client=require(_0x67d3('0x0'));exports[_0x67d3('0x1')]=function(){return function(_0x50d673){return client[_0x67d3('0x2')](_0x67d3('0x3'),{'options':{'raw':![],'attributes':['id','name','username',_0x67d3('0x4'),'token','remoteUri',_0x67d3('0x5'),_0x67d3('0x6'),'type'],'include':[{'model':_0x67d3('0x7'),'as':_0x67d3('0x8'),'attributes':['id',_0x67d3('0x9')],'include':[{'model':'Tag','attributes':['id',_0x67d3('0x9')]},{'model':_0x67d3('0xa'),'as':_0x67d3('0xb'),'attributes':['id',_0x67d3('0xc'),'content',_0x67d3('0xd')],'include':[{'model':_0x67d3('0xe'),'as':_0x67d3('0xe'),'attributes':['id','name']}]},{'model':_0x67d3('0xa'),'as':_0x67d3('0xf'),'attributes':['id','type',_0x67d3('0x10'),_0x67d3('0x11'),_0x67d3('0x12'),_0x67d3('0x13'),_0x67d3('0xd')],'include':[{'model':_0x67d3('0xe'),'as':_0x67d3('0xe'),'attributes':['id',_0x67d3('0x9')]}]},{'model':_0x67d3('0xa'),'as':'Fields','attributes':['id',_0x67d3('0xc'),_0x67d3('0x10'),'idField',_0x67d3('0x14'),'customField',_0x67d3('0xd')],'include':[{'model':_0x67d3('0xe'),'as':_0x67d3('0xe'),'attributes':['id',_0x67d3('0x9')]}]}]}]},'log':_0x67d3('0x3')});};};
\ No newline at end of file
index ce8d9a2..dd4f0d7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1199=['GetZohoAccount','name','description','host','zone','clientId','serverUrl','code','ZohoConfiguration','Configurations','Subjects','type','content','variableName','Variable','ZohoField','Descriptions','keyType','keyContent','nameField','customField','../../client','getZohoAccounts','Request'];(function(_0x534080,_0xac74c6){var _0x1585ed=function(_0x2c5fa1){while(--_0x2c5fa1){_0x534080['push'](_0x534080['shift']());}};_0x1585ed(++_0xac74c6);}(_0x1199,0x1dd));var _0x9119=function(_0x1e2372,_0x2ea876){_0x1e2372=_0x1e2372-0x0;var _0x4cd59b=_0x1199[_0x1e2372];return _0x4cd59b;};'use strict';var client=require(_0x9119('0x0'));exports[_0x9119('0x1')]=function(){return function(_0x336f81){return client[_0x9119('0x2')](_0x9119('0x3'),{'options':{'raw':![],'attributes':['id',_0x9119('0x4'),_0x9119('0x5'),_0x9119('0x6'),_0x9119('0x7'),_0x9119('0x8'),'clientSecret',_0x9119('0x9'),_0x9119('0xa'),'refreshToken'],'include':[{'model':_0x9119('0xb'),'as':_0x9119('0xc'),'attributes':['id',_0x9119('0x4'),'moduleCreate','moduleSearch',_0x9119('0x5')],'include':[{'model':'ZohoField','as':_0x9119('0xd'),'attributes':['id',_0x9119('0xe'),_0x9119('0xf'),_0x9119('0x10')],'include':[{'model':_0x9119('0x11'),'as':_0x9119('0x11'),'attributes':['id',_0x9119('0x4')]}]},{'model':_0x9119('0x12'),'as':_0x9119('0x13'),'attributes':['id',_0x9119('0xe'),'content','key',_0x9119('0x14'),_0x9119('0x15'),_0x9119('0x10')],'include':[{'model':_0x9119('0x11'),'as':_0x9119('0x11'),'attributes':['id',_0x9119('0x4')]}]},{'model':'ZohoField','as':'Fields','attributes':['id',_0x9119('0xe'),_0x9119('0xf'),'idField',_0x9119('0x16'),_0x9119('0x17'),_0x9119('0x10')],'include':[{'model':_0x9119('0x11'),'as':_0x9119('0x11'),'attributes':['id',_0x9119('0x4')]}]}]}]},'log':_0x9119('0x3')});};};
\ No newline at end of file
+var _0xae16=['Subjects','variableName','Variable','ZohoField','type','content','keyContent','customField','../../client','getZohoAccounts','Request','GetZohoAccount','name','clientId','clientSecret','serverUrl','code','refreshToken','ZohoConfiguration','Configurations','moduleCreate','description'];(function(_0x5841c1,_0x575a6f){var _0x41ad9c=function(_0x28b5fe){while(--_0x28b5fe){_0x5841c1['push'](_0x5841c1['shift']());}};_0x41ad9c(++_0x575a6f);}(_0xae16,0x152));var _0x6ae1=function(_0x367d44,_0x34b4a6){_0x367d44=_0x367d44-0x0;var _0x467a89=_0xae16[_0x367d44];return _0x467a89;};'use strict';var client=require(_0x6ae1('0x0'));exports[_0x6ae1('0x1')]=function(){return function(_0x5ecb9f){return client[_0x6ae1('0x2')](_0x6ae1('0x3'),{'options':{'raw':![],'attributes':['id',_0x6ae1('0x4'),'description','host','zone',_0x6ae1('0x5'),_0x6ae1('0x6'),_0x6ae1('0x7'),_0x6ae1('0x8'),_0x6ae1('0x9')],'include':[{'model':_0x6ae1('0xa'),'as':_0x6ae1('0xb'),'attributes':['id','name',_0x6ae1('0xc'),'moduleSearch',_0x6ae1('0xd')],'include':[{'model':'ZohoField','as':_0x6ae1('0xe'),'attributes':['id','type','content',_0x6ae1('0xf')],'include':[{'model':'Variable','as':_0x6ae1('0x10'),'attributes':['id',_0x6ae1('0x4')]}]},{'model':_0x6ae1('0x11'),'as':'Descriptions','attributes':['id',_0x6ae1('0x12'),_0x6ae1('0x13'),'key','keyType',_0x6ae1('0x14'),_0x6ae1('0xf')],'include':[{'model':'Variable','as':_0x6ae1('0x10'),'attributes':['id','name']}]},{'model':_0x6ae1('0x11'),'as':'Fields','attributes':['id',_0x6ae1('0x12'),_0x6ae1('0x13'),'idField','nameField',_0x6ae1('0x15'),'variableName'],'include':[{'model':'Variable','as':_0x6ae1('0x10'),'attributes':['id',_0x6ae1('0x4')]}]}]}]},'log':_0x6ae1('0x3')});};};
\ No newline at end of file
index f5681cd..af99d5f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5075=['uniqueid','voiceDialReport','membername','TALKING','starttime','endtime','outbound','agent','toNumber','moment','util','../client','queuecallercompleteAt','Request','CreateMemberReport','voice','lastAssignedTo','isNil','interface','SIP/%s','diff','queuecallerleaveAt','seconds','inbound','calleridnum','exten','queue','accountcode'];(function(_0x42bdad,_0x12836c){var _0x122626=function(_0x2eb29c){while(--_0x2eb29c){_0x42bdad['push'](_0x42bdad['shift']());}};_0x122626(++_0x12836c);}(_0x5075,0x1c9));var _0x5507=function(_0x2fb356,_0x567092){_0x2fb356=_0x2fb356-0x0;var _0x27fb4b=_0x5075[_0x2fb356];return _0x27fb4b;};'use strict';var moment=require(_0x5507('0x0'));var _=require('lodash');var util=require(_0x5507('0x1'));var client=require(_0x5507('0x2'));exports['voiceQueueReport']=function(_0x1140e2){var _0x3af92d=_0x1140e2[_0x5507('0x3')]||_0x1140e2['queuecallerexitAt'];return client[_0x5507('0x4')](_0x5507('0x5'),{'body':{'channel':_0x5507('0x6'),'membername':_0x1140e2[_0x5507('0x7')],'interface':_[_0x5507('0x8')](_0x1140e2[_0x5507('0x9')])?util['format'](_0x5507('0xa'),_0x1140e2[_0x5507('0x7')]):_0x1140e2[_0x5507('0x9')],'type':'TALKING','enterAt':_0x1140e2['queuecallerleaveAt'],'exitAt':_0x3af92d,'duration':moment(_0x3af92d)[_0x5507('0xb')](_0x1140e2[_0x5507('0xc')],_0x5507('0xd')),'data1':_0x5507('0xe'),'data2':_0x1140e2[_0x5507('0xf')],'data3':_0x1140e2[_0x5507('0x10')],'data4':null,'data5':_0x1140e2[_0x5507('0x11')],'role':'agent','internal':_0x1140e2['accountcode']?_['toNumber'](_0x1140e2[_0x5507('0x12')]):undefined,'uniqueid':_0x1140e2[_0x5507('0x13')]},'log':_0x5507('0x5')});};exports[_0x5507('0x14')]=function(_0x4957ed){return client[_0x5507('0x4')](_0x5507('0x5'),{'body':{'channel':_0x5507('0x6'),'membername':_0x4957ed[_0x5507('0x15')],'interface':_0x4957ed[_0x5507('0x9')],'type':_0x5507('0x16'),'enterAt':_0x4957ed[_0x5507('0x17')],'exitAt':_0x4957ed[_0x5507('0x18')],'duration':moment(_0x4957ed[_0x5507('0x18')])[_0x5507('0xb')](_0x4957ed[_0x5507('0x17')],'seconds')>=0x0?moment(_0x4957ed['endtime'])[_0x5507('0xb')](_0x4957ed[_0x5507('0x17')],_0x5507('0xd')):null,'data1':_0x5507('0x19'),'data2':_0x4957ed[_0x5507('0x12')],'data3':_0x4957ed[_0x5507('0x10')],'data4':_0x4957ed['dialstring']||null,'role':_0x5507('0x1a'),'internal':_0x4957ed[_0x5507('0x12')]?_[_0x5507('0x1b')](_0x4957ed[_0x5507('0x12')]):undefined,'uniqueid':_0x4957ed[_0x5507('0x13')]},'log':'CreateMemberReport'});};
\ No newline at end of file
+var _0x8e1e=['starttime','endtime','seconds','outbound','dialstring','agent','moment','lodash','util','queuecallercompleteAt','queuecallerexitAt','Request','CreateMemberReport','lastAssignedTo','isNil','interface','format','queuecallerleaveAt','diff','inbound','queue','accountcode','toNumber','uniqueid','voiceDialReport','voice','membername'];(function(_0x4118d6,_0xdae079){var _0x36d3a1=function(_0x297451){while(--_0x297451){_0x4118d6['push'](_0x4118d6['shift']());}};_0x36d3a1(++_0xdae079);}(_0x8e1e,0xf9));var _0xe8e1=function(_0x5a3cf0,_0x160a68){_0x5a3cf0=_0x5a3cf0-0x0;var _0x5a64ee=_0x8e1e[_0x5a3cf0];return _0x5a64ee;};'use strict';var moment=require(_0xe8e1('0x0'));var _=require(_0xe8e1('0x1'));var util=require(_0xe8e1('0x2'));var client=require('../client');exports['voiceQueueReport']=function(_0x1eda8e){var _0x2d854b=_0x1eda8e[_0xe8e1('0x3')]||_0x1eda8e[_0xe8e1('0x4')];return client[_0xe8e1('0x5')](_0xe8e1('0x6'),{'body':{'channel':'voice','membername':_0x1eda8e[_0xe8e1('0x7')],'interface':_[_0xe8e1('0x8')](_0x1eda8e[_0xe8e1('0x9')])?util[_0xe8e1('0xa')]('SIP/%s',_0x1eda8e[_0xe8e1('0x7')]):_0x1eda8e['interface'],'type':'TALKING','enterAt':_0x1eda8e[_0xe8e1('0xb')],'exitAt':_0x2d854b,'duration':moment(_0x2d854b)[_0xe8e1('0xc')](_0x1eda8e[_0xe8e1('0xb')],'seconds'),'data1':_0xe8e1('0xd'),'data2':_0x1eda8e['calleridnum'],'data3':_0x1eda8e['exten'],'data4':null,'data5':_0x1eda8e[_0xe8e1('0xe')],'role':'agent','internal':_0x1eda8e[_0xe8e1('0xf')]?_[_0xe8e1('0x10')](_0x1eda8e['accountcode']):undefined,'uniqueid':_0x1eda8e[_0xe8e1('0x11')]},'log':_0xe8e1('0x6')});};exports[_0xe8e1('0x12')]=function(_0x2e6f27){return client['Request']('CreateMemberReport',{'body':{'channel':_0xe8e1('0x13'),'membername':_0x2e6f27[_0xe8e1('0x14')],'interface':_0x2e6f27[_0xe8e1('0x9')],'type':'TALKING','enterAt':_0x2e6f27[_0xe8e1('0x15')],'exitAt':_0x2e6f27[_0xe8e1('0x16')],'duration':moment(_0x2e6f27[_0xe8e1('0x16')])['diff'](_0x2e6f27[_0xe8e1('0x15')],_0xe8e1('0x17'))>=0x0?moment(_0x2e6f27[_0xe8e1('0x16')])[_0xe8e1('0xc')](_0x2e6f27[_0xe8e1('0x15')],_0xe8e1('0x17')):null,'data1':_0xe8e1('0x18'),'data2':_0x2e6f27[_0xe8e1('0xf')],'data3':_0x2e6f27['exten'],'data4':_0x2e6f27[_0xe8e1('0x19')]||null,'role':_0xe8e1('0x1a'),'internal':_0x2e6f27[_0xe8e1('0xf')]?_[_0xe8e1('0x10')](_0x2e6f27['accountcode']):undefined,'uniqueid':_0x2e6f27[_0xe8e1('0x11')]},'log':_0xe8e1('0x6')});};
\ No newline at end of file
index 73e30f3..d135834 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9ea8=['stopRecordingOnTransfer','previewRecallmeReminderInterval','getSettings','Request','ShowSetting'];(function(_0x41b4a9,_0x11eb93){var _0x272e47=function(_0x497238){while(--_0x497238){_0x41b4a9['push'](_0x41b4a9['shift']());}};_0x272e47(++_0x11eb93);}(_0x9ea8,0x147));var _0x89ea=function(_0x42ab43,_0xb38833){_0x42ab43=_0x42ab43-0x0;var _0xf1ca33=_0x9ea8[_0x42ab43];return _0xf1ca33;};'use strict';var client=require('../client');exports[_0x89ea('0x0')]=function(){return client[_0x89ea('0x1')](_0x89ea('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x89ea('0x3'),_0x89ea('0x4')]},'log':'GetSettings'});};
\ No newline at end of file
+var _0x2837=['getSettings','Request','stopRecordingOnTransfer','previewRecallmeReminderInterval','../client'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2837,0x12b));var _0x7283=function(_0x44355f,_0x2e1c97){_0x44355f=_0x44355f-0x0;var _0x58f132=_0x2837[_0x44355f];return _0x58f132;};'use strict';var client=require(_0x7283('0x0'));exports[_0x7283('0x1')]=function(){return client[_0x7283('0x2')]('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x7283('0x3'),_0x7283('0x4')]},'log':'GetSettings'});};
\ No newline at end of file
index f684bc5..9f5161a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdd94=['getTemplates','Request','GetTemplate','name','html','../client'];(function(_0x3aa544,_0xa75b6a){var _0x250036=function(_0x316e65){while(--_0x316e65){_0x3aa544['push'](_0x3aa544['shift']());}};_0x250036(++_0xa75b6a);}(_0xdd94,0x18b));var _0x4dd9=function(_0x3d5898,_0x4206bd){_0x3d5898=_0x3d5898-0x0;var _0x5cc107=_0xdd94[_0x3d5898];return _0x5cc107;};'use strict';var client=require(_0x4dd9('0x0'));exports[_0x4dd9('0x1')]=function(_0x245c28){return function(_0x4b5f62){return client[_0x4dd9('0x2')](_0x4dd9('0x3'),{'options':{'raw':!![],'attributes':['id',_0x4dd9('0x4'),_0x4dd9('0x5')]},'log':_0x4dd9('0x3')});};};
\ No newline at end of file
+var _0x01bb=['getTemplates','Request','name','GetTemplate','../client'];(function(_0x298ed3,_0x4ab5e1){var _0x5aad28=function(_0x168687){while(--_0x168687){_0x298ed3['push'](_0x298ed3['shift']());}};_0x5aad28(++_0x4ab5e1);}(_0x01bb,0x171));var _0xb01b=function(_0xf9e15a,_0x69b956){_0xf9e15a=_0xf9e15a-0x0;var _0x1809e1=_0x01bb[_0xf9e15a];return _0x1809e1;};'use strict';var client=require(_0xb01b('0x0'));exports[_0xb01b('0x1')]=function(_0x3980b1){return function(_0x183d89){return client[_0xb01b('0x2')]('GetTemplate',{'options':{'raw':!![],'attributes':['id',_0xb01b('0x3'),'html']},'log':_0xb01b('0x4')});};};
\ No newline at end of file
index 5b29556..21333b5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x71c0=['Action','data1','data2','../client','getTriggers','Request','GetTrigger','name','channel','status','Condition','AllConditions','field','operator','value','AnyConditions'];(function(_0x44a9c8,_0x19facb){var _0x3a3d70=function(_0x133828){while(--_0x133828){_0x44a9c8['push'](_0x44a9c8['shift']());}};_0x3a3d70(++_0x19facb);}(_0x71c0,0xe3));var _0x071c=function(_0x11c69f,_0x116175){_0x11c69f=_0x11c69f-0x0;var _0xba70ab=_0x71c0[_0x11c69f];return _0xba70ab;};'use strict';var client=require(_0x071c('0x0'));exports[_0x071c('0x1')]=function(_0x535529){return function(_0x17bbf4){return client[_0x071c('0x2')](_0x071c('0x3'),{'options':{'raw':![],'attributes':['id',_0x071c('0x4'),_0x071c('0x5'),_0x071c('0x6')],'include':[{'model':_0x071c('0x7'),'as':_0x071c('0x8'),'attributes':['id',_0x071c('0x9'),_0x071c('0xa'),_0x071c('0xb')]},{'model':'Condition','as':_0x071c('0xc'),'attributes':['id',_0x071c('0x9'),_0x071c('0xa'),_0x071c('0xb')]},{'model':_0x071c('0xd'),'as':'Actions','attributes':['id','action',_0x071c('0xe'),_0x071c('0xf'),'data3','data4','data5','data6','data7']}]},'log':_0x071c('0x3')});};};
\ No newline at end of file
+var _0x4103=['data6','data7','GetTrigger','../client','Request','name','channel','status','AllConditions','field','value','Condition','Action','Actions','action','data1','data2','data3','data4','data5'];(function(_0x508c88,_0xe1b600){var _0x20a485=function(_0x916edb){while(--_0x916edb){_0x508c88['push'](_0x508c88['shift']());}};_0x20a485(++_0xe1b600);}(_0x4103,0xb7));var _0x3410=function(_0x1fec10,_0x4da311){_0x1fec10=_0x1fec10-0x0;var _0x55c66b=_0x4103[_0x1fec10];return _0x55c66b;};'use strict';var client=require(_0x3410('0x0'));exports['getTriggers']=function(_0x22acae){return function(_0xba9bd1){return client[_0x3410('0x1')]('GetTrigger',{'options':{'raw':![],'attributes':['id',_0x3410('0x2'),_0x3410('0x3'),_0x3410('0x4')],'include':[{'model':'Condition','as':_0x3410('0x5'),'attributes':['id',_0x3410('0x6'),'operator',_0x3410('0x7')]},{'model':_0x3410('0x8'),'as':'AnyConditions','attributes':['id',_0x3410('0x6'),'operator','value']},{'model':_0x3410('0x9'),'as':_0x3410('0xa'),'attributes':['id',_0x3410('0xb'),_0x3410('0xc'),_0x3410('0xd'),_0x3410('0xe'),_0x3410('0xf'),_0x3410('0x10'),_0x3410('0x11'),_0x3410('0x12')]}]},'log':_0x3410('0x13')});};};
\ No newline at end of file
index 98ac99f..22e0777 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc5c7=['GetTrunk','name','defaultuser','getTrunks','Request'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xc5c7,0x1cf));var _0x7c5c=function(_0x2a16a2,_0x3ed2e9){_0x2a16a2=_0x2a16a2-0x0;var _0x8f772f=_0xc5c7[_0x2a16a2];return _0x8f772f;};'use strict';var client=require('../client');exports[_0x7c5c('0x0')]=function(_0x28e1a9){return function(_0x2e1b3a){return client[_0x7c5c('0x1')](_0x7c5c('0x2'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x7c5c('0x3'),'registry',_0x7c5c('0x4')]},'log':_0x7c5c('0x2')});};};
\ No newline at end of file
+var _0xc452=['GetTrunk','name','registry','defaultuser','getTrunks','Request'];(function(_0x2ca76e,_0x1b68d0){var _0x5b7ce6=function(_0x1736d2){while(--_0x1736d2){_0x2ca76e['push'](_0x2ca76e['shift']());}};_0x5b7ce6(++_0x1b68d0);}(_0xc452,0x154));var _0x2c45=function(_0x429801,_0x1f0475){_0x429801=_0x429801-0x0;var _0x278236=_0xc452[_0x429801];return _0x278236;};'use strict';var client=require('../client');exports[_0x2c45('0x0')]=function(_0x5c28c5){return function(_0x1220e9){return client[_0x2c45('0x1')](_0x2c45('0x2'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x2c45('0x3'),_0x2c45('0x4'),_0x2c45('0x5')]},'log':_0x2c45('0x2')});};};
\ No newline at end of file
index cde3fda..774e5a5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c44=['online','pauseType','Request','GetUser','agent','name','email','accountcode','lastLoginAt','lastPauseAt','voicePause','phone','mobile','interface','getTelephones','telephone','internal','PauseUser','savePause','getAgent','ShowUser','fullname'];(function(_0x76af77,_0x449a43){var _0x2289b8=function(_0x117b85){while(--_0x117b85){_0x76af77['push'](_0x76af77['shift']());}};_0x2289b8(++_0x449a43);}(_0x9c44,0x178));var _0x49c4=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x9c44[_0x4b369d];return _0x571a98;};'use strict';var client=require('../client');exports['getAgents']=function(){return function(){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'options':{'raw':![],'where':{'role':_0x49c4('0x2')},'attributes':['id',_0x49c4('0x3'),_0x49c4('0x4'),_0x49c4('0x5'),'fullname','online',_0x49c4('0x6'),'pauseType',_0x49c4('0x7'),_0x49c4('0x8'),_0x49c4('0x9'),_0x49c4('0xa'),_0x49c4('0xb')]},'log':'getAgents'});};};exports[_0x49c4('0xc')]=function(){return function(){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'options':{'raw':!![],'where':{'role':_0x49c4('0xd')},'attributes':['id','name','accountcode',_0x49c4('0xe')]},'log':_0x49c4('0xc')});};};exports['savePause']=function(_0xb611a1,_0x459d09,_0x4adb3c){return client['Request'](_0x49c4('0xf'),{'body':{'type':_0x459d09,'uniqueid':_0x4adb3c},'options':{'where':{'id':_0xb611a1['id']}},'log':_0x49c4('0x10')});};exports['saveUnpause']=function(_0x7df3a9){return client[_0x49c4('0x0')]('UnpauseUser',{'body':{},'options':{'where':{'id':_0x7df3a9['id']}},'log':_0x49c4('0x10')});};exports[_0x49c4('0x11')]=function(_0x21f15a){return client[_0x49c4('0x0')](_0x49c4('0x12'),{'options':{'raw':![],'where':{'role':_0x49c4('0x2'),'id':_0x21f15a},'attributes':['id',_0x49c4('0x3'),_0x49c4('0x4'),'accountcode',_0x49c4('0x13'),_0x49c4('0x14'),_0x49c4('0x6'),_0x49c4('0x15'),_0x49c4('0x7'),'voicePause',_0x49c4('0xb')]},'log':_0x49c4('0x11')});};
\ No newline at end of file
+var _0x70e0=['getAgents','Request','name','email','accountcode','fullname','lastLoginAt','lastPauseAt','interface','getTelephones','GetUser','telephone','savePause','PauseUser','saveUnpause','getAgent','agent','online','pauseType','../client'];(function(_0x111dc7,_0x311f74){var _0x346fe7=function(_0x4228fa){while(--_0x4228fa){_0x111dc7['push'](_0x111dc7['shift']());}};_0x346fe7(++_0x311f74);}(_0x70e0,0x17b));var _0x070e=function(_0x2b04b4,_0x6a674b){_0x2b04b4=_0x2b04b4-0x0;var _0x24e8be=_0x70e0[_0x2b04b4];return _0x24e8be;};'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
index 522037e..5ae809e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9e6d=['create','CreateVoiceAgentReport','Request','UpdateVoiceAgentReport'];(function(_0x19e166,_0x4cc641){var _0x5e6bed=function(_0xb7fce7){while(--_0xb7fce7){_0x19e166['push'](_0x19e166['shift']());}};_0x5e6bed(++_0x4cc641);}(_0x9e6d,0xc0));var _0xd9e6=function(_0x4697ba,_0x1c1b80){_0x4697ba=_0x4697ba-0x0;var _0x2e073e=_0x9e6d[_0x4697ba];return _0x2e073e;};'use strict';var client=require('../client');exports[_0xd9e6('0x0')]=function(_0x494d16){return client['Request'](_0xd9e6('0x1'),{'body':_0x494d16,'log':_0xd9e6('0x1')});};exports['update']=function(_0x5ee65d,_0x4e99d5,_0x449149){return client[_0xd9e6('0x2')](_0xd9e6('0x3'),{'body':_0x5ee65d,'options':{'where':{'uniqueid':_0x4e99d5,'interface':_0x449149,'agentcomplete':!![]}},'log':'UpdateVoiceAgentReport'});};
\ No newline at end of file
+var _0x3f41=['../client','Request','CreateVoiceAgentReport','update','UpdateVoiceAgentReport'];(function(_0x3cd780,_0x27f724){var _0x3855aa=function(_0x342a37){while(--_0x342a37){_0x3cd780['push'](_0x3cd780['shift']());}};_0x3855aa(++_0x27f724);}(_0x3f41,0x1c7));var _0x13f4=function(_0x5e4563,_0x3ff918){_0x5e4563=_0x5e4563-0x0;var _0x8d1bf5=_0x3f41[_0x5e4563];return _0x8d1bf5;};'use strict';var client=require(_0x13f4('0x0'));exports['create']=function(_0x2874d6){return client[_0x13f4('0x1')](_0x13f4('0x2'),{'body':_0x2874d6,'log':_0x13f4('0x2')});};exports[_0x13f4('0x3')]=function(_0x1491c1,_0x1500fd,_0x7ebf28){return client[_0x13f4('0x1')](_0x13f4('0x4'),{'body':_0x1491c1,'options':{'where':{'uniqueid':_0x1500fd,'interface':_0x7ebf28,'agentcomplete':!![]}},'log':_0x13f4('0x4')});};
\ No newline at end of file
index 824eff2..e70f020 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x53fe=['endOf','day','format','type','disposition','duration','billableseconds','GetVoiceCallReports','moment','util','lodash','Request','CreateVoiceCallReport','merge','calleridnum','callerid','DOCUMENTATION','getVoiceCallReports','GetVoiceCallReport','outbound','startOf','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x3d7a1e,_0x50fce0){var _0x274494=function(_0x140b32){while(--_0x140b32){_0x3d7a1e['push'](_0x3d7a1e['shift']());}};_0x274494(++_0x50fce0);}(_0x53fe,0x194));var _0xe53f=function(_0x1ec948,_0x43fea1){_0x1ec948=_0x1ec948-0x0;var _0x36b828=_0x53fe[_0x1ec948];return _0x36b828;};'use strict';var moment=require(_0xe53f('0x0'));var util=require(_0xe53f('0x1'));var _=require(_0xe53f('0x2'));var client=require('../client');exports['create']=function(_0x51c86e){return client[_0xe53f('0x3')](_0xe53f('0x4'),{'body':_[_0xe53f('0x5')](_0x51c86e,{'source':_0x51c86e[_0xe53f('0x6')],'destinationcontext':_0x51c86e['context'],'callerid':_0x51c86e[_0xe53f('0x7')],'amaflags':_0xe53f('0x8')}),'log':_0xe53f('0x4')});};exports[_0xe53f('0x9')]=function(){return function(){return client[_0xe53f('0x3')](_0xe53f('0xa'),{'options':{'where':{'type':[_0xe53f('0xb')],'createdAt':{'$between':[moment()[_0xe53f('0xc')]('day')['format'](_0xe53f('0xd')),moment()[_0xe53f('0xe')](_0xe53f('0xf'))[_0xe53f('0x10')]('YYYY-MM-DD\x20HH:mm:ss')]}},'attributes':[_0xe53f('0x11'),_0xe53f('0x12'),_0xe53f('0x13'),_0xe53f('0x14')]},'log':_0xe53f('0x15')});};};
\ No newline at end of file
+var _0x00d0=['Request','CreateVoiceCallReport','calleridnum','context','callerid','DOCUMENTATION','getVoiceCallReports','GetVoiceCallReport','outbound','day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','disposition','duration','billableseconds','GetVoiceCallReports','create'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x00d0,0x179));var _0x000d=function(_0x467acf,_0x4eac3b){_0x467acf=_0x467acf-0x0;var _0x3075b2=_0x00d0[_0x467acf];return _0x3075b2;};'use strict';var moment=require('moment');var util=require('util');var _=require('lodash');var client=require('../client');exports[_0x000d('0x0')]=function(_0x568b13){return client[_0x000d('0x1')](_0x000d('0x2'),{'body':_['merge'](_0x568b13,{'source':_0x568b13[_0x000d('0x3')],'destinationcontext':_0x568b13[_0x000d('0x4')],'callerid':_0x568b13[_0x000d('0x5')],'amaflags':_0x000d('0x6')}),'log':_0x000d('0x2')});};exports[_0x000d('0x7')]=function(){return function(){return client[_0x000d('0x1')](_0x000d('0x8'),{'options':{'where':{'type':[_0x000d('0x9')],'createdAt':{'$between':[moment()['startOf'](_0x000d('0xa'))[_0x000d('0xb')](_0x000d('0xc')),moment()[_0x000d('0xd')]('day')[_0x000d('0xb')](_0x000d('0xc'))]}},'attributes':['type',_0x000d('0xe'),_0x000d('0xf'),_0x000d('0x10')]},'log':_0x000d('0x11')});};};
\ No newline at end of file
index e55baba..34642ca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2b87=['CreateVoiceDialReport','../client'];(function(_0x1f7120,_0x53456a){var _0x512142=function(_0xae9761){while(--_0xae9761){_0x1f7120['push'](_0x1f7120['shift']());}};_0x512142(++_0x53456a);}(_0x2b87,0x93));var _0x72b8=function(_0x272f88,_0x409499){_0x272f88=_0x272f88-0x0;var _0x5892fc=_0x2b87[_0x272f88];return _0x5892fc;};'use strict';var client=require(_0x72b8('0x0'));exports['create']=function(_0x537201){return client['Request'](_0x72b8('0x1'),{'body':_0x537201,'log':_0x72b8('0x1')});};
\ No newline at end of file
+var _0x627b=['CreateVoiceDialReport'];(function(_0xab2a11,_0x1b34fb){var _0x5421cc=function(_0x179064){while(--_0x179064){_0xab2a11['push'](_0xab2a11['shift']());}};_0x5421cc(++_0x1b34fb);}(_0x627b,0xde));var _0xb627=function(_0x40bffc,_0x3a45d7){_0x40bffc=_0x40bffc-0x0;var _0x3007e9=_0x627b[_0x40bffc];return _0x3007e9;};'use strict';var client=require('../client');exports['create']=function(_0x3b1e5c){return client['Request'](_0xb627('0x0'),{'body':_0x3b1e5c,'log':'CreateVoiceDialReport'});};
\ No newline at end of file
index c181bd6..fc2b189 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0624=['exten','recordingFormat','getVoiceExtensions'];(function(_0x264faa,_0x5c1bd0){var _0x5121c0=function(_0x788c56){while(--_0x788c56){_0x264faa['push'](_0x264faa['shift']());}};_0x5121c0(++_0x5c1bd0);}(_0x0624,0x132));var _0x4062=function(_0x24e531,_0x5bab74){_0x24e531=_0x24e531-0x0;var _0x114f48=_0x0624[_0x24e531];return _0x114f48;};'use strict';var client=require('../client');exports['getVoiceExtensions']=function(){return function(){return client['Request']('GetVoiceExtension',{'options':{'raw':!![],'attributes':['id',_0x4062('0x0'),_0x4062('0x1')],'where':{'VoiceExtensionId':null}},'log':_0x4062('0x2')});};};
\ No newline at end of file
+var _0xe43c=['../client','getVoiceExtensions','Request','GetVoiceExtension','exten','recordingFormat'];(function(_0x23f8d2,_0x301fec){var _0x5d174b=function(_0x2c3c9e){while(--_0x2c3c9e){_0x23f8d2['push'](_0x23f8d2['shift']());}};_0x5d174b(++_0x301fec);}(_0xe43c,0x180));var _0xce43=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0xe43c[_0xa148b7];return _0x51efd3;};'use strict';var client=require(_0xce43('0x0'));exports[_0xce43('0x1')]=function(){return function(){return client[_0xce43('0x2')](_0xce43('0x3'),{'options':{'raw':!![],'attributes':['id',_0xce43('0x4'),_0xce43('0x5')],'where':{'VoiceExtensionId':null}},'log':'getVoiceExtensions'});};};
\ No newline at end of file
index 18df369..d9d94e6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd8d5=['getVoiceQueues','../client','Request','GetVoiceQueue','name','acw','acwTimeout','autopause','type','dialActive','dialLimitChannel','dialPowerLevel','dialPredictiveOptimizationPercentage','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialPrefix','dialCheckDuplicateType','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','strategy','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','Trunk','callerid','active','Pause','mandatoryDispositionPause','Interval','Intervals','interval'];(function(_0x13b02f,_0x462a53){var _0x12e9a6=function(_0x187d57){while(--_0x187d57){_0x13b02f['push'](_0x13b02f['shift']());}};_0x12e9a6(++_0x462a53);}(_0xd8d5,0x123));var _0x5d8d=function(_0x3f36ca,_0x44930d){_0x3f36ca=_0x3f36ca-0x0;var _0x21c3e8=_0xd8d5[_0x3f36ca];return _0x21c3e8;};'use strict';var client=require(_0x5d8d('0x0'));exports['getVoiceQueues']=function(){return function(){return client[_0x5d8d('0x1')](_0x5d8d('0x2'),{'options':{'raw':![],'attributes':['id',_0x5d8d('0x3'),_0x5d8d('0x4'),_0x5d8d('0x5'),_0x5d8d('0x6'),'monitor_format',_0x5d8d('0x7'),_0x5d8d('0x8'),'dialMethod',_0x5d8d('0x9'),'dialLimitQueue',_0x5d8d('0xa'),'dialPredictiveOptimization',_0x5d8d('0xb'),'dialPredictiveInterval',_0x5d8d('0xc'),_0x5d8d('0xd'),_0x5d8d('0xe'),_0x5d8d('0xf'),_0x5d8d('0x10'),_0x5d8d('0x11'),_0x5d8d('0x12'),_0x5d8d('0x13'),_0x5d8d('0x14'),'dialBusyRetryFrequency',_0x5d8d('0x15'),_0x5d8d('0x16'),'dialGlobalMaxRetry','dialTimezone','dialGlobalInterval',_0x5d8d('0x17'),_0x5d8d('0x18'),'dialAMDActive',_0x5d8d('0x19'),_0x5d8d('0x1a'),_0x5d8d('0x1b'),_0x5d8d('0x1c'),_0x5d8d('0x1d'),_0x5d8d('0x1e'),_0x5d8d('0x1f'),_0x5d8d('0x20'),_0x5d8d('0x21'),_0x5d8d('0x22'),_0x5d8d('0x23'),'dialRecallInQueue',_0x5d8d('0x24'),_0x5d8d('0x25'),_0x5d8d('0x26'),'dialQueueProject2','monitor_format',_0x5d8d('0x27'),'dialRandomLastDigitCallerIdNumber','dialCutDigit',_0x5d8d('0x28'),_0x5d8d('0x29'),_0x5d8d('0x2a'),'dialDropRetryFrequency',_0x5d8d('0x2b'),_0x5d8d('0x2c'),'dialMachineMaxRetry',_0x5d8d('0x2d'),_0x5d8d('0x2e'),_0x5d8d('0x2f'),'mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder',_0x5d8d('0x30')],'include':[{'model':_0x5d8d('0x31'),'as':_0x5d8d('0x31'),'attributes':['id','name',_0x5d8d('0x32'),_0x5d8d('0x33')]},{'model':_0x5d8d('0x34'),'as':_0x5d8d('0x35'),'attributes':['id','name']},{'model':'Trunk','as':'TrunkBackup','attributes':['id',_0x5d8d('0x3'),_0x5d8d('0x32'),'active']},{'model':_0x5d8d('0x36'),'as':'Interval','attributes':['id',_0x5d8d('0x3')],'include':[{'model':_0x5d8d('0x36'),'as':_0x5d8d('0x37'),'attributes':['id',_0x5d8d('0x3'),_0x5d8d('0x38')]}]}]},'log':_0x5d8d('0x39')});};};
\ No newline at end of file
+var _0xfdf6=['dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDInitialSilence','dialAMDAfterGreetingSilence','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialRandomLastDigitCallerIdNumber','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialMachineRetryFrequency','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','Trunk','name','active','Pause','mandatoryDispositionPause','TrunkBackup','Interval','Intervals','interval','getVoiceQueues','Request','acwTimeout','autopause','monitor_format','type','dialPowerLevel','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency'];(function(_0x1d11c9,_0x4c4656){var _0x1860bc=function(_0x2bb993){while(--_0x2bb993){_0x1d11c9['push'](_0x1d11c9['shift']());}};_0x1860bc(++_0x4c4656);}(_0xfdf6,0x1ac));var _0x6fdf=function(_0x9ff7f6,_0x2a90c1){_0x9ff7f6=_0x9ff7f6-0x0;var _0x18a39c=_0xfdf6[_0x9ff7f6];return _0x18a39c;};'use strict';var client=require('../client');exports[_0x6fdf('0x0')]=function(){return function(){return client[_0x6fdf('0x1')]('GetVoiceQueue',{'options':{'raw':![],'attributes':['id','name','acw',_0x6fdf('0x2'),_0x6fdf('0x3'),_0x6fdf('0x4'),_0x6fdf('0x5'),'dialActive','dialMethod','dialLimitChannel','dialLimitQueue',_0x6fdf('0x6'),'dialPredictiveOptimization',_0x6fdf('0x7'),_0x6fdf('0x8'),_0x6fdf('0x9'),_0x6fdf('0xa'),_0x6fdf('0xb'),'dialQueueOptions',_0x6fdf('0xc'),_0x6fdf('0xd'),_0x6fdf('0xe'),_0x6fdf('0xf'),_0x6fdf('0x10'),_0x6fdf('0x11'),_0x6fdf('0x12'),_0x6fdf('0x13'),'dialGlobalMaxRetry','dialTimezone',_0x6fdf('0x14'),_0x6fdf('0x15'),_0x6fdf('0x16'),'dialAMDActive',_0x6fdf('0x17'),'dialAMDGreeting',_0x6fdf('0x18'),'dialAMDTotalAnalysisTime',_0x6fdf('0x19'),_0x6fdf('0x1a'),_0x6fdf('0x1b'),_0x6fdf('0x1c'),_0x6fdf('0x1d'),_0x6fdf('0x1e'),_0x6fdf('0x1f'),_0x6fdf('0x20'),_0x6fdf('0x21'),_0x6fdf('0x22'),'dialAgiAfterHangupClient','dialQueueProject2',_0x6fdf('0x4'),'strategy',_0x6fdf('0x23'),'dialCutDigit',_0x6fdf('0x24'),_0x6fdf('0x25'),_0x6fdf('0x26'),_0x6fdf('0x27'),'dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry',_0x6fdf('0x28'),'dialAgentRejectMaxRetry',_0x6fdf('0x29'),_0x6fdf('0x2a'),_0x6fdf('0x2b'),_0x6fdf('0x2c'),_0x6fdf('0x2d'),_0x6fdf('0x2e'),'callAdditionalPhoneAfterMin'],'include':[{'model':_0x6fdf('0x2f'),'as':_0x6fdf('0x2f'),'attributes':['id',_0x6fdf('0x30'),'callerid',_0x6fdf('0x31')]},{'model':_0x6fdf('0x32'),'as':_0x6fdf('0x33'),'attributes':['id',_0x6fdf('0x30')]},{'model':_0x6fdf('0x2f'),'as':_0x6fdf('0x34'),'attributes':['id','name','callerid',_0x6fdf('0x31')]},{'model':_0x6fdf('0x35'),'as':'Interval','attributes':['id',_0x6fdf('0x30')],'include':[{'model':_0x6fdf('0x35'),'as':_0x6fdf('0x36'),'attributes':['id',_0x6fdf('0x30'),_0x6fdf('0x37')]}]}]},'log':_0x6fdf('0x0')});};};
\ No newline at end of file
index 695fb51..f97a1d1 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(_0x20ef91,_0x2d66bb){var _0x149b50=function(_0x2e967b){while(--_0x2e967b){_0x20ef91['push'](_0x20ef91['shift']());}};_0x149b50(++_0x2d66bb);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0xa9e0[_0x34bf97];return _0x292719;};'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(_0x47ab73,_0x2df85f){var _0xc14991=function(_0x294803){while(--_0x294803){_0x47ab73['push'](_0x47ab73['shift']());}};_0xc14991(++_0x2df85f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xa9e0[_0x484e36];return _0xafc85d;};'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 b8ac35a..b140975 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x02cb=['getVoiceQueueRtPauses'];(function(_0x41c88c,_0x381f8d){var _0x2c97ea=function(_0x35fd44){while(--_0x35fd44){_0x41c88c['push'](_0x41c88c['shift']());}};_0x2c97ea(++_0x381f8d);}(_0x02cb,0x1aa));var _0xb02c=function(_0x4ec4e1,_0x29b81b){_0x4ec4e1=_0x4ec4e1-0x0;var _0x436715=_0x02cb[_0x4ec4e1];return _0x436715;};'use strict';var client=require('../client');exports['getVoiceQueueRtPauses']=function(_0x5976de){return function(){return client['Request']('GetVoiceQueueRtPauses',{'options':{'where':{'VoiceQueueId':_0x5976de,'paused':!![]},'raw':!![]},'log':_0xb02c('0x0')});};};
\ No newline at end of file
+var _0x3970=['Request'];(function(_0x47257e,_0x37e385){var _0x10b3c5=function(_0xe42c14){while(--_0xe42c14){_0x47257e['push'](_0x47257e['shift']());}};_0x10b3c5(++_0x37e385);}(_0x3970,0xac));var _0x0397=function(_0x1a8bbc,_0x17a086){_0x1a8bbc=_0x1a8bbc-0x0;var _0x212fc2=_0x3970[_0x1a8bbc];return _0x212fc2;};'use strict';var client=require('../client');exports['getVoiceQueueRtPauses']=function(_0x836537){return function(){return client[_0x0397('0x0')]('GetVoiceQueueRtPauses',{'options':{'where':{'VoiceQueueId':_0x836537,'paused':!![]},'raw':!![]},'log':'getVoiceQueueRtPauses'});};};
\ No newline at end of file
index 18e1528..71d0e98 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['create','Request','CreateVoiceRecording','monitorFilename','lodash','../client'];(function(_0x289c2f,_0x351fce){var _0x25e0bb=function(_0x5828a8){while(--_0x5828a8){_0x289c2f['push'](_0x289c2f['shift']());}};_0x25e0bb(++_0x351fce);}(_0x7a54,0x106));var _0x47a5=function(_0x585300,_0x33aac0){_0x585300=_0x585300-0x0;var _0x354b1f=_0x7a54[_0x585300];return _0x354b1f;};'use strict';var _=require(_0x47a5('0x0'));var client=require(_0x47a5('0x1'));exports[_0x47a5('0x2')]=function(_0x58157c){return client[_0x47a5('0x3')](_0x47a5('0x4'),{'body':_['merge'](_0x58157c,{'value':_0x58157c[_0x47a5('0x5')]}),'log':_0x47a5('0x4')});};
\ No newline at end of file
+var _0x9957=['CreateVoiceRecording','merge','monitorFilename','lodash','../client','create'];(function(_0x45f96b,_0x227c54){var _0x1b285c=function(_0x2caee3){while(--_0x2caee3){_0x45f96b['push'](_0x45f96b['shift']());}};_0x1b285c(++_0x227c54);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x7995('0x0'));var client=require(_0x7995('0x1'));exports[_0x7995('0x2')]=function(_0x10a05d){return client['Request'](_0x7995('0x3'),{'body':_[_0x7995('0x4')](_0x10a05d,{'value':_0x10a05d[_0x7995('0x5')]}),'log':_0x7995('0x3')});};
\ No newline at end of file
index 09f0d6d..782023f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2730=['origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','isexternal','origtransferercontext','origtransfererexten','attended','../client','transfers','Request','CreateVoiceTransferReport','result','transfererchannel','transferercalleridnum','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transferercontext','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridname','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereeexten','transfereelinkedid','context','extension','blind','attendedTransfer'];(function(_0x1ef4ee,_0xd87a11){var _0xabf86f=function(_0x20a11a){while(--_0x20a11a){_0x1ef4ee['push'](_0x1ef4ee['shift']());}};_0xabf86f(++_0xd87a11);}(_0x2730,0x1b6));var _0x0273=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x2730[_0x4565bf];return _0x5610ba;};'use strict';var client=require(_0x0273('0x0'));exports[_0x0273('0x1')]={};exports['blindTransfer']=function(_0x3091cf){return client[_0x0273('0x2')](_0x0273('0x3'),{'body':{'result':_0x3091cf[_0x0273('0x4')],'transfererchannel':_0x3091cf[_0x0273('0x5')],'transferercalleridnum':_0x3091cf[_0x0273('0x6')],'transferercalleridname':_0x3091cf['transferercalleridname'],'transfererconnectedlinenum':_0x3091cf[_0x0273('0x7')],'transfererconnectedlinename':_0x3091cf[_0x0273('0x8')],'transfereraccountcode':_0x3091cf[_0x0273('0x9')],'transferercontext':_0x3091cf[_0x0273('0xa')],'transfererexten':_0x3091cf[_0x0273('0xb')],'transfererlinkedid':_0x3091cf[_0x0273('0xc')],'transfereechannel':_0x3091cf[_0x0273('0xd')],'transfereecalleridnum':_0x3091cf['transfereecalleridnum'],'transfereecalleridname':_0x3091cf[_0x0273('0xe')],'transfereeconnectedlinenum':_0x3091cf['transfereeconnectedlinenum'],'transfereeconnectedlinename':_0x3091cf[_0x0273('0xf')],'transfereeaccountcode':_0x3091cf[_0x0273('0x10')],'transfereecontext':_0x3091cf[_0x0273('0x11')],'transfereeexten':_0x3091cf[_0x0273('0x12')],'transfereelinkedid':_0x3091cf[_0x0273('0x13')],'isexternal':_0x3091cf['isexternal'],'context':_0x3091cf[_0x0273('0x14')],'extension':_0x3091cf[_0x0273('0x15')],'type':_0x0273('0x16')},'log':_0x0273('0x3')});};exports[_0x0273('0x17')]=function(_0x2e1bb8){return client[_0x0273('0x2')](_0x0273('0x3'),{'body':{'result':_0x2e1bb8[_0x0273('0x4')],'transfererchannel':_0x2e1bb8[_0x0273('0x18')],'transferercalleridnum':_0x2e1bb8[_0x0273('0x19')],'transferercalleridname':_0x2e1bb8[_0x0273('0x1a')],'transfererconnectedlinenum':_0x2e1bb8[_0x0273('0x1b')],'transfererconnectedlinename':_0x2e1bb8[_0x0273('0x1c')],'transfereraccountcode':_0x2e1bb8[_0x0273('0x1d')],'transferercontext':_0x2e1bb8[_0x0273('0x1e')],'transfererexten':_0x2e1bb8[_0x0273('0x1f')],'transfererlinkedid':_0x2e1bb8[_0x0273('0x20')],'transfereechannel':_0x2e1bb8[_0x0273('0x21')],'transfereecalleridnum':_0x2e1bb8[_0x0273('0x22')],'transfereecalleridname':_0x2e1bb8['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x2e1bb8[_0x0273('0x23')],'transfereeconnectedlinename':_0x2e1bb8[_0x0273('0x24')],'transfereeaccountcode':_0x2e1bb8[_0x0273('0x25')],'transfereecontext':_0x2e1bb8['transfertargetcontext'],'transfereeexten':_0x2e1bb8['transfertargetexten'],'transfereelinkedid':_0x2e1bb8['transfertargetlinkedid'],'isexternal':_0x2e1bb8[_0x0273('0x26')],'context':_0x2e1bb8[_0x0273('0x27')],'extension':_0x2e1bb8[_0x0273('0x28')],'type':_0x0273('0x29')},'log':_0x0273('0x3')});};
\ No newline at end of file
+var _0x1af8=['blind','attendedTransfer','origtransfererchannel','origtransferercalleridnum','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetlinkedid','origtransfererexten','attended','../client','transfers','blindTransfer','Request','CreateVoiceTransferReport','result','transfererchannel','transferercalleridnum','transfererconnectedlinenum','transfererconnectedlinename','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeaccountcode','transfereecontext','transfereeexten','transfereelinkedid','isexternal','context','extension'];(function(_0x3f06da,_0x2767c3){var _0x338c5a=function(_0x373513){while(--_0x373513){_0x3f06da['push'](_0x3f06da['shift']());}};_0x338c5a(++_0x2767c3);}(_0x1af8,0xbb));var _0x81af=function(_0x231d95,_0xeb8764){_0x231d95=_0x231d95-0x0;var _0x3da43a=_0x1af8[_0x231d95];return _0x3da43a;};'use strict';var client=require(_0x81af('0x0'));exports[_0x81af('0x1')]={};exports[_0x81af('0x2')]=function(_0x583d08){return client[_0x81af('0x3')](_0x81af('0x4'),{'body':{'result':_0x583d08[_0x81af('0x5')],'transfererchannel':_0x583d08[_0x81af('0x6')],'transferercalleridnum':_0x583d08[_0x81af('0x7')],'transferercalleridname':_0x583d08['transferercalleridname'],'transfererconnectedlinenum':_0x583d08[_0x81af('0x8')],'transfererconnectedlinename':_0x583d08[_0x81af('0x9')],'transfereraccountcode':_0x583d08['transfereraccountcode'],'transferercontext':_0x583d08['transferercontext'],'transfererexten':_0x583d08[_0x81af('0xa')],'transfererlinkedid':_0x583d08[_0x81af('0xb')],'transfereechannel':_0x583d08[_0x81af('0xc')],'transfereecalleridnum':_0x583d08[_0x81af('0xd')],'transfereecalleridname':_0x583d08[_0x81af('0xe')],'transfereeconnectedlinenum':_0x583d08[_0x81af('0xf')],'transfereeconnectedlinename':_0x583d08['transfereeconnectedlinename'],'transfereeaccountcode':_0x583d08[_0x81af('0x10')],'transfereecontext':_0x583d08[_0x81af('0x11')],'transfereeexten':_0x583d08[_0x81af('0x12')],'transfereelinkedid':_0x583d08[_0x81af('0x13')],'isexternal':_0x583d08[_0x81af('0x14')],'context':_0x583d08[_0x81af('0x15')],'extension':_0x583d08[_0x81af('0x16')],'type':_0x81af('0x17')},'log':_0x81af('0x4')});};exports[_0x81af('0x18')]=function(_0x28dae1){return client['Request'](_0x81af('0x4'),{'body':{'result':_0x28dae1[_0x81af('0x5')],'transfererchannel':_0x28dae1[_0x81af('0x19')],'transferercalleridnum':_0x28dae1[_0x81af('0x1a')],'transferercalleridname':_0x28dae1['origtransferercalleridname'],'transfererconnectedlinenum':_0x28dae1[_0x81af('0x1b')],'transfererconnectedlinename':_0x28dae1[_0x81af('0x1c')],'transfereraccountcode':_0x28dae1[_0x81af('0x1d')],'transferercontext':_0x28dae1[_0x81af('0x1e')],'transfererexten':_0x28dae1[_0x81af('0x1f')],'transfererlinkedid':_0x28dae1['origtransfererlinkedid'],'transfereechannel':_0x28dae1[_0x81af('0x20')],'transfereecalleridnum':_0x28dae1[_0x81af('0x21')],'transfereecalleridname':_0x28dae1[_0x81af('0x22')],'transfereeconnectedlinenum':_0x28dae1[_0x81af('0x23')],'transfereeconnectedlinename':_0x28dae1[_0x81af('0x24')],'transfereeaccountcode':_0x28dae1[_0x81af('0x25')],'transfereecontext':_0x28dae1[_0x81af('0x26')],'transfereeexten':_0x28dae1['transfertargetexten'],'transfereelinkedid':_0x28dae1[_0x81af('0x27')],'isexternal':_0x28dae1['isexternal'],'context':_0x28dae1['origtransferercontext'],'extension':_0x28dae1[_0x81af('0x28')],'type':_0x81af('0x29')},'log':_0x81af('0x4')});};
\ No newline at end of file
index babd4ad..1ed54e9 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(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x0af5,0x158));var _0x50af=function(_0x3c6c40,_0x2df098){_0x3c6c40=_0x3c6c40-0x0;var _0x56cbae=_0x0af5[_0x3c6c40];return _0x56cbae;};'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 _0xfc17=['uniqueid','channel','%s.%s','wav','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','toLowerCase','isNil','mixmonitorid','status','rec','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','channels','resolve','StopMixMonitor','destinationchannel','filename','StopMixMonitor\x20Success','values','queueChannels','voicequeuechannel','voicequeuechannelhangup','voicequeuechannelredirect','exten','context','outboundChannels','campaigns','run','event','Event\x20name\x20mandatory','faxAccounts','server','http','127.0.0.1','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','lodash','util','jayson/promise','validate','moment','../../../config/environment','../properties','../ami','listen','format','%s/%s','SIP','timers','timer','updateAcw','agents','updateStatusRealtime','pause','QueuePause','asterisk','username','ami\x20disconnected','join','pick','keys','module','action','Reload','then','message','catch','error','isConnected','Action','content','voiceQueues','hasOwnProperty','name','strategy','answered','loggedIn','sumBillable','sumDuration','sumHoldTime','talking','total','unmanaged','loggedInDb','type','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalPauses','predictiveIntervalAvailable','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','Interval','push','omit','undefined','voicechannel','length','map','find'];(function(_0x13d5bc,_0x3fce3c){var _0x4b8a40=function(_0xe3ef3a){while(--_0xe3ef3a){_0x13d5bc['push'](_0x13d5bc['shift']());}};_0x4b8a40(++_0x3fce3c);}(_0xfc17,0x1b4));var _0x7fc1=function(_0x2604b9,_0xbb6ea5){_0x2604b9=_0x2604b9-0x0;var _0x51433b=_0xfc17[_0x2604b9];return _0x51433b;};'use strict';var _=require(_0x7fc1('0x0'));var util=require(_0x7fc1('0x1'));var jayson=require(_0x7fc1('0x2'));var schema=require(_0x7fc1('0x3'));var BPromise=require('bluebird');var moment=require(_0x7fc1('0x4'));var config=require(_0x7fc1('0x5'));var properties=require(_0x7fc1('0x6'));var ami=require(_0x7fc1('0x7'));exports[_0x7fc1('0x8')]=function(_0x4100a9,_0x5de7fa,_0x30f5f8){return new BPromise(function(_0x1867ea,_0x2267ea){var _0xf0d3fa={'QueuePause':function(_0x24c678){return new Promise(function(_0x1b7106,_0x3b631b){var _0x53a3ba=util[_0x7fc1('0x9')](_0x7fc1('0xa'),_0x7fc1('0xb'),_0x24c678['name']);if(_0x4100a9[_0x7fc1('0xc')]&&_0x4100a9['timers'][_0x53a3ba]&&_0x4100a9['timers'][_0x53a3ba][_0x7fc1('0xd')]){_0x4100a9[_0x7fc1('0xc')][_0x53a3ba][_0x7fc1('0xe')]();}if(_0x4100a9[_0x7fc1('0xf')][_0x53a3ba]){_0x4100a9[_0x7fc1('0xf')][_0x53a3ba][_0x7fc1('0x10')]({'statePause':_0x24c678[_0x7fc1('0x11')]?!![]:![]});}_0x1b7106({'code':0xc8,'message':_0x7fc1('0x12')});});},'Reload':function(_0x902325){var _0x3e4fea=this;return new Promise(function(_0x12ddce,_0x3c328c){if(ami['isConnected']()==![]){return _0x3c328c(_0x3e4fea['error'](0x1f4,[config[_0x7fc1('0x13')]['ip'],config[_0x7fc1('0x13')][_0x7fc1('0x14')],_0x7fc1('0x15')][_0x7fc1('0x16')]('\x20')));}_0x902325=_[_0x7fc1('0x17')](_0x902325,_[_0x7fc1('0x18')](properties[_0x7fc1('0x19')]));_0x902325[_0x7fc1('0x1a')]=_0x7fc1('0x1b');return ami['Action'](_0x902325)[_0x7fc1('0x1c')](function(_0x5e89b1){_0x12ddce({'code':0xc8,'message':_0x5e89b1[_0x7fc1('0x1d')]});})[_0x7fc1('0x1e')](function(_0x535ae1){_0x3c328c(_0x3e4fea[_0x7fc1('0x1f')](0x1f5,_0x535ae1[_0x7fc1('0x1d')]));});});},'Command':function(_0x58c20a){var _0x25d384=this;return new Promise(function(_0x23f3cd,_0x1158f0){if(ami[_0x7fc1('0x20')]()==![]){return _0x1158f0(_0x25d384[_0x7fc1('0x1f')](0x1f4,[config[_0x7fc1('0x13')]['ip'],config[_0x7fc1('0x13')][_0x7fc1('0x14')],_0x7fc1('0x15')][_0x7fc1('0x16')]('\x20')));}_0x58c20a=_['pick'](_0x58c20a,'command');_0x58c20a[_0x7fc1('0x1a')]='Command';return ami[_0x7fc1('0x21')](_0x58c20a)[_0x7fc1('0x1c')](function(_0x253ae9){_0x23f3cd({'code':0xc8,'message':_0x253ae9[_0x7fc1('0x22')]});})['catch'](function(_0x38b5b5){_0x1158f0(_0x25d384[_0x7fc1('0x1f')](0x1f5,_0x38b5b5[_0x7fc1('0x1d')]));});});},'VoiceQueues':function(_0x4d6c46){return new Promise(function(_0x190204,_0x252b18){var _0x5ddc11=[];for(var _0x4b24d6 in _0x4100a9[_0x7fc1('0x23')]){if(_0x4100a9[_0x7fc1('0x23')][_0x7fc1('0x24')](_0x4b24d6)){var _0x2ae7db=_0x4100a9['voiceQueues'][_0x4b24d6];var _0x1d7b77={'id':_0x2ae7db['id'],'name':_0x2ae7db[_0x7fc1('0x25')],'strategy':_0x2ae7db[_0x7fc1('0x26')],'answered':_0x2ae7db[_0x7fc1('0x27')],'available':_0x2ae7db['available'],'loggedIn':_0x2ae7db[_0x7fc1('0x28')],'pTalking':_0x2ae7db['pTalking'],'sumBillable':_0x2ae7db[_0x7fc1('0x29')],'sumDuration':_0x2ae7db[_0x7fc1('0x2a')],'sumHoldTime':_0x2ae7db[_0x7fc1('0x2b')]||0x0,'talking':_0x2ae7db[_0x7fc1('0x2c')],'total':_0x2ae7db[_0x7fc1('0x2d')],'type':_0x2ae7db['type'],'unmanaged':_0x2ae7db[_0x7fc1('0x2e')],'abandoned':_0x2ae7db['abandoned'],'waiting':_0x2ae7db['waiting'],'loggedInDb':_0x2ae7db[_0x7fc1('0x2f')]};if(_0x2ae7db[_0x7fc1('0x30')]===_0x7fc1('0x31')){_0x1d7b77[_0x7fc1('0x32')]=_0x2ae7db[_0x7fc1('0x32')];_0x1d7b77[_0x7fc1('0x33')]=_0x2ae7db[_0x7fc1('0x33')];_0x1d7b77[_0x7fc1('0x34')]=_0x2ae7db[_0x7fc1('0x34')];_0x1d7b77[_0x7fc1('0x35')]=_0x2ae7db[_0x7fc1('0x35')];_0x1d7b77[_0x7fc1('0x36')]=_0x2ae7db[_0x7fc1('0x36')];_0x1d7b77[_0x7fc1('0x37')]=_0x2ae7db[_0x7fc1('0x37')];_0x1d7b77[_0x7fc1('0x38')]=_0x2ae7db['temp'];_0x1d7b77[_0x7fc1('0x39')]=_0x2ae7db[_0x7fc1('0x39')];_0x1d7b77[_0x7fc1('0x3a')]=_0x2ae7db[_0x7fc1('0x3a')];_0x1d7b77[_0x7fc1('0x3b')]=_0x2ae7db[_0x7fc1('0x3b')];_0x1d7b77['outboundBusyCallsDay']=_0x2ae7db[_0x7fc1('0x3c')];_0x1d7b77[_0x7fc1('0x3d')]=_0x2ae7db['outboundCongestionCallsDay'];_0x1d7b77[_0x7fc1('0x3e')]=_0x2ae7db[_0x7fc1('0x3e')];_0x1d7b77[_0x7fc1('0x3f')]=_0x2ae7db[_0x7fc1('0x3f')];_0x1d7b77[_0x7fc1('0x40')]=_0x2ae7db['outboundDropCallsDayTimeout'];_0x1d7b77['outboundNoAnswerCallsDay']=_0x2ae7db[_0x7fc1('0x41')];_0x1d7b77[_0x7fc1('0x42')]=_0x2ae7db[_0x7fc1('0x42')];_0x1d7b77[_0x7fc1('0x43')]=_0x2ae7db[_0x7fc1('0x43')];_0x1d7b77[_0x7fc1('0x44')]=_0x2ae7db[_0x7fc1('0x44')];_0x1d7b77[_0x7fc1('0x45')]=_0x2ae7db['outboundRejectCallsDay'];_0x1d7b77[_0x7fc1('0x46')]=_0x2ae7db[_0x7fc1('0x46')];_0x1d7b77['predictiveIntervalAnsweredCalls']=_0x2ae7db[_0x7fc1('0x47')];_0x1d7b77[_0x7fc1('0x48')]=_0x2ae7db[_0x7fc1('0x48')];_0x1d7b77['predictiveIntervalAvgTalktime']=_0x2ae7db['predictiveIntervalAvgTalktime'];_0x1d7b77[_0x7fc1('0x49')]=_0x2ae7db[_0x7fc1('0x49')];_0x1d7b77[_0x7fc1('0x4a')]=_0x2ae7db['predictiveIntervalDroppedCallsTimeout'];_0x1d7b77['predictiveIntervalErlangCalls']=_0x2ae7db['predictiveIntervalErlangCalls'];_0x1d7b77[_0x7fc1('0x4b')]=_0x2ae7db[_0x7fc1('0x4b')];_0x1d7b77[_0x7fc1('0x4c')]=_0x2ae7db[_0x7fc1('0x4c')];_0x1d7b77['predictiveIntervalMultiplicativeFactor']=_0x2ae7db['predictiveIntervalMultiplicativeFactor'];_0x1d7b77[_0x7fc1('0x4d')]=_0x2ae7db[_0x7fc1('0x4d')];_0x1d7b77[_0x7fc1('0x4e')]=_0x2ae7db['predictiveIntervalAvailable'];_0x1d7b77['predictiveIntervalTotalCalls']=_0x2ae7db['predictiveIntervalTotalCalls'];_0x1d7b77['message']=_0x2ae7db['message'];_0x1d7b77[_0x7fc1('0x4f')]=_0x2ae7db['originated'];_0x1d7b77[_0x7fc1('0x50')]=_0x2ae7db[_0x7fc1('0x50')];_0x1d7b77['erlangCallToSecond']=_0x2ae7db[_0x7fc1('0x51')];_0x1d7b77[_0x7fc1('0x52')]=_0x2ae7db[_0x7fc1('0x52')];_0x1d7b77[_0x7fc1('0x53')]=_0x2ae7db['erlangBusyFactor'];_0x1d7b77[_0x7fc1('0x54')]=_0x2ae7db['startPredictive'];_0x1d7b77[_0x7fc1('0x55')]=_0x2ae7db[_0x7fc1('0x55')];}if(_0x2ae7db[_0x7fc1('0x56')]){_0x1d7b77[_0x7fc1('0x56')]={'id':_0x2ae7db['Trunk']['id'],'name':_0x2ae7db[_0x7fc1('0x56')][_0x7fc1('0x25')],'active':_0x2ae7db['Trunk'][_0x7fc1('0x57')],'callerid':_0x2ae7db[_0x7fc1('0x56')]['callerid']};}if(_0x2ae7db[_0x7fc1('0x58')]){_0x1d7b77[_0x7fc1('0x58')]={'id':_0x2ae7db['Interval']['id'],'name':_0x2ae7db[_0x7fc1('0x58')][_0x7fc1('0x25')]};}_0x5ddc11[_0x7fc1('0x59')](_0x1d7b77);}}_0x190204({'count':_0x5ddc11['length'],'rows':_0x5ddc11});});},'UpdateVoiceQueue':function(_0x3ae3b5){return new Promise(function(_0x750284,_0x419f95){var _0x431d84=_['find'](_0x4100a9['voiceQueues'],{'id':parseInt(_0x3ae3b5['id'])});var _0x15edd4=_[_0x7fc1('0x5a')](_0x3ae3b5,['id']);if(_0x431d84){for(var _0x158181 in _0x15edd4){if(typeof _0x15edd4[_0x158181]!==_0x7fc1('0x5b')&&typeof _0x431d84[_0x158181]!==_0x7fc1('0x5b')){_0x431d84[_0x158181]=_0x15edd4[_0x158181];}}_0x750284(_0x431d84);}else{_0x419f95();}});},'VoiceChannels':function(_0x27b1b7){return new Promise(function(_0x3e936d,_0x40b356){var _0x419ea1=_['values'](_0x4100a9['channels']);_0x3e936d({'count':_0x419ea1['length'],'rows':_0x419ea1});});},'VoiceChannelMixMonitor':function(_0xb0541a){var _0x3bfa32=this;return new Promise(function(_0x45e61a,_0x8d1c10){if(ami['isConnected']()==![]){return _0x8d1c10(_0x3bfa32[_0x7fc1('0x1f')](0x1f4,[config[_0x7fc1('0x13')]['ip'],config[_0x7fc1('0x13')][_0x7fc1('0x14')],'ami\x20disconnected'][_0x7fc1('0x16')]('\x20')));}var _0x5ef33=schema(properties[_0x7fc1('0x5c')])[_0x7fc1('0x3')](_0xb0541a);if(_0x5ef33[_0x7fc1('0x5d')]>0x0){return _0x8d1c10(_0x3bfa32[_0x7fc1('0x1f')](0x1f4,_[_0x7fc1('0x5e')](_0x5ef33,'message')[_0x7fc1('0x16')](',\x20')));}var _0x4daad0=_[_0x7fc1('0x5f')](_0x4100a9['channels'],{'uniqueid':_0xb0541a[_0x7fc1('0x60')]});if(_0x4daad0&&_0x4daad0[_0x7fc1('0x61')]){var _0x4dbd61=util[_0x7fc1('0x9')](_0x7fc1('0x62'),_0xb0541a['filename']||_0xb0541a[_0x7fc1('0x60')],_0xb0541a[_0x7fc1('0x9')]||_0x7fc1('0x63'));return ami[_0x7fc1('0x21')]({'action':'MixMonitor','channel':_0x4daad0['channel'],'file':_0x4dbd61,'options':_0x7fc1('0x64')})['then'](function(_0x802d83){var _0x25258d=_[_0x7fc1('0x5f')](_0x4daad0[_0x7fc1('0x65')],{'filename':_0x7fc1('0x66')+_0x4dbd61[_0x7fc1('0x67')]()});if(_[_0x7fc1('0x68')](_0x25258d)){_0x4daad0[_0x7fc1('0x65')][_0x7fc1('0x59')]({'filename':'/var/spool/asterisk/monitor/'+_0x4dbd61['toLowerCase'](),'createdAt':moment()[_0x7fc1('0x9')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x802d83[_0x7fc1('0x69')],'status':'rec'});}else{_0x25258d[_0x7fc1('0x69')]=_0x802d83[_0x7fc1('0x69')];_0x25258d[_0x7fc1('0x6a')]=_0x7fc1('0x6b');}_0x45e61a({'code':0xc8,'message':[_0xb0541a[_0x7fc1('0x60')],_0x7fc1('0x6c'),_0x802d83[_0x7fc1('0x69')]][_0x7fc1('0x16')]('\x20'),'mixmonitorid':_0x802d83['mixmonitorid']});})[_0x7fc1('0x1e')](function(_0x5987af){_0x8d1c10(_0x3bfa32[_0x7fc1('0x1f')](0x1f5,[_0xb0541a['uniqueid'],_0x5987af[_0x7fc1('0x1d')]['toLowerCase']()][_0x7fc1('0x16')]('\x20')));});}else{return _0x8d1c10(_0x3bfa32[_0x7fc1('0x1f')](0x1f5,_0x7fc1('0x6d')));}});},'VoiceChannelStopMixMonitor':function(_0x1d471f){var _0x559171=this;return new Promise(function(_0x2c6934,_0x58a174){if(ami[_0x7fc1('0x20')]()==![]){return _0x58a174(_0x559171[_0x7fc1('0x1f')](0x1f4,[config[_0x7fc1('0x13')]['ip'],config[_0x7fc1('0x13')][_0x7fc1('0x14')],_0x7fc1('0x15')]['join']('\x20')));}var _0x4e9b22=schema(properties['voicechannel'])[_0x7fc1('0x3')](_0x1d471f);if(_0x4e9b22[_0x7fc1('0x5d')]>0x0){return _0x58a174(_0x559171[_0x7fc1('0x1f')](0x1f4,_[_0x7fc1('0x5e')](_0x4e9b22,_0x7fc1('0x1d'))[_0x7fc1('0x16')](',\x20')));}var _0x1d2659=_[_0x7fc1('0x5f')](_0x4100a9[_0x7fc1('0x6e')],{'uniqueid':_0x1d471f['uniqueid']});if(_0x1d2659){return BPromise[_0x7fc1('0x6f')]()[_0x7fc1('0x1c')](function(){if(_0x1d2659[_0x7fc1('0x61')]){return ami[_0x7fc1('0x21')]({'action':_0x7fc1('0x70'),'channel':_0x1d2659['channel'],'mixmonitorid':_0x1d471f['mixmonitorid']})[_0x7fc1('0x1e')](function(_0x3eccd4){});}})[_0x7fc1('0x1c')](function(){if(_0x1d2659[_0x7fc1('0x71')]){return ami[_0x7fc1('0x21')]({'action':_0x7fc1('0x70'),'channel':_0x1d2659['destinationchannel'],'mixmonitorid':_0x1d471f[_0x7fc1('0x69')]})[_0x7fc1('0x1e')](function(_0x1df318){});}})[_0x7fc1('0x1c')](function(_0x3d070f){var _0x15e8ae=_[_0x7fc1('0x5f')](_0x1d2659[_0x7fc1('0x65')],{'mixmonitorid':_0x1d471f['mixmonitorid']});if(_0x15e8ae){_0x15e8ae[_0x7fc1('0x6a')]='stop';}})[_0x7fc1('0x1c')](function(){var _0x3314f9=util[_0x7fc1('0x9')](_0x7fc1('0x62'),_0x1d471f[_0x7fc1('0x72')]||_0x1d471f['uniqueid'],_0x1d471f[_0x7fc1('0x9')]||_0x7fc1('0x63'));var _0xf7f369=_['find'](_0x1d2659[_0x7fc1('0x65')],{'filename':'/var/spool/asterisk/monitor/'+_0x3314f9[_0x7fc1('0x67')]()});if(_0xf7f369){_0xf7f369[_0x7fc1('0x6a')]='stop';}})[_0x7fc1('0x1c')](function(){_0x2c6934({'code':0xc8,'message':[_0x1d471f[_0x7fc1('0x60')],_0x7fc1('0x73')][_0x7fc1('0x16')]('\x20')});})['catch'](function(_0x136aa8){_0x58a174(_0x559171[_0x7fc1('0x1f')](0x1f5,[_0x1d471f[_0x7fc1('0x60')],_0x136aa8[_0x7fc1('0x1d')][_0x7fc1('0x67')]()][_0x7fc1('0x16')]('\x20')));});}else{return _0x58a174(_0x559171[_0x7fc1('0x1f')](0x1f5,_0x7fc1('0x6d')));}});},'VoiceQueuesChannels':function(_0x27e174){return new Promise(function(_0x237b75,_0xc7629c){var _0x135662=_[_0x7fc1('0x74')](_0x4100a9[_0x7fc1('0x75')]);_0x237b75({'count':_0x135662[_0x7fc1('0x5d')],'rows':_0x135662});});},'VoiceQueuesChannel':function(_0x4a8c11){var _0x19e649=this;return new Promise(function(_0x85e5fc,_0x43d0a2){var _0x12ac89=schema(properties[_0x7fc1('0x76')])[_0x7fc1('0x3')](_0x4a8c11);if(_0x12ac89['length']>0x0){return _0x43d0a2(_0x19e649['error'](0x1f4,_[_0x7fc1('0x5e')](_0x12ac89,_0x7fc1('0x1d'))[_0x7fc1('0x16')](',\x20')));}var _0x3eacc0=_[_0x7fc1('0x5f')](_0x4100a9[_0x7fc1('0x75')],{'uniqueid':_0x4a8c11['uniqueid']});if(_0x3eacc0){_0x85e5fc(_0x3eacc0);}else{return _0x43d0a2(_0x19e649[_0x7fc1('0x1f')](0x1f5,_0x7fc1('0x6d')));}});},'VoiceQueuesChannelHangup':function(_0x4ebff7){var _0x13e001=this;return new Promise(function(_0x4be325,_0x17b925){if(ami[_0x7fc1('0x20')]()==![]){return _0x17b925(_0x13e001['error'](0x1f4,[config['asterisk']['ip'],config[_0x7fc1('0x13')][_0x7fc1('0x14')],_0x7fc1('0x15')][_0x7fc1('0x16')]('\x20')));}var _0x3da92d=schema(properties[_0x7fc1('0x77')])[_0x7fc1('0x3')](_0x4ebff7);if(_0x3da92d['length']>0x0){return _0x17b925(_0x13e001[_0x7fc1('0x1f')](0x1f4,_[_0x7fc1('0x5e')](_0x3da92d,_0x7fc1('0x1d'))[_0x7fc1('0x16')](',\x20')));}var _0x151cba=_[_0x7fc1('0x5f')](_0x4100a9['queueChannels'],{'uniqueid':_0x4ebff7[_0x7fc1('0x60')]});if(_0x151cba&&_0x151cba[_0x7fc1('0x61')]){return ami[_0x7fc1('0x21')]({'action':'Hangup','channel':_0x151cba[_0x7fc1('0x61')]})['then'](function(_0x520045){_0x4be325({'code':0xc8,'message':[_0x4ebff7['uniqueid'],_0x520045[_0x7fc1('0x1d')][_0x7fc1('0x67')]()][_0x7fc1('0x16')]('\x20')});})[_0x7fc1('0x1e')](function(_0x1a33b9){_0x17b925(_0x13e001[_0x7fc1('0x1f')](0x1f5,[_0x4ebff7['uniqueid'],_0x1a33b9[_0x7fc1('0x1d')]['toLowerCase']()]['join']('\x20')));});}else{return _0x17b925(_0x13e001['error'](0x1f5,_0x7fc1('0x6d')));}});},'VoiceQueuesChannelRedirect':function(_0xfb6ebd){var _0x3c0c0c=this;return new Promise(function(_0x51cd66,_0x128c77){if(ami[_0x7fc1('0x20')]()==![]){return _0x128c77(_0x3c0c0c[_0x7fc1('0x1f')](0x1f4,[config[_0x7fc1('0x13')]['ip'],config[_0x7fc1('0x13')][_0x7fc1('0x14')],'ami\x20disconnected'][_0x7fc1('0x16')]('\x20')));}var _0x196b1d=schema(properties[_0x7fc1('0x78')])[_0x7fc1('0x3')](_0xfb6ebd);if(_0x196b1d['length']>0x0){return _0x128c77(_0x3c0c0c['error'](0x1f4,_['map'](_0x196b1d,_0x7fc1('0x1d'))[_0x7fc1('0x16')](',\x20')));}var _0x270626=_[_0x7fc1('0x5f')](_0x4100a9['queueChannels'],{'uniqueid':_0xfb6ebd[_0x7fc1('0x60')]});if(_0x270626&&_0x270626[_0x7fc1('0x61')]){return ami['Action']({'action':'Redirect','channel':_0x270626[_0x7fc1('0x61')],'exten':_0xfb6ebd[_0x7fc1('0x79')],'context':_0xfb6ebd['context']||_0x270626[_0x7fc1('0x7a')],'priority':0x1})[_0x7fc1('0x1c')](function(_0x4ab4b5){_0x51cd66({'code':0xc8,'message':[_0xfb6ebd[_0x7fc1('0x60')],_0x4ab4b5[_0x7fc1('0x1d')][_0x7fc1('0x67')]()]['join']('\x20')});})[_0x7fc1('0x1e')](function(_0x357bf1){_0x128c77(_0x3c0c0c[_0x7fc1('0x1f')](0x1f5,[_0xfb6ebd[_0x7fc1('0x60')],_0x357bf1['message']['toLowerCase']()]['join']('\x20')));});}else{return _0x128c77(_0x3c0c0c[_0x7fc1('0x1f')](0x1f5,_0x7fc1('0x6d')));}});},'Agents':function(_0x47e984){return new Promise(function(_0x474256,_0x245578){var _0x2c8a53=_[_0x7fc1('0x74')](_0x4100a9[_0x7fc1('0xf')]);_0x474256({'count':_0x2c8a53[_0x7fc1('0x5d')],'rows':_0x2c8a53});});},'Telephones':function(_0x152fad){return new Promise(function(_0x3df96d,_0x46f399){var _0x38abee=_[_0x7fc1('0x74')](_0x4100a9['telephones']);_0x3df96d({'count':_0x38abee[_0x7fc1('0x5d')],'rows':_0x38abee});});},'Trunks':function(_0x388817){return new Promise(function(_0x512a31,_0x4140ef){var _0x1a8ae4=_['values'](_0x4100a9['trunks']);_0x512a31({'count':_0x1a8ae4[_0x7fc1('0x5d')],'rows':_0x1a8ae4});});},'OutboundChannels':function(_0x6b25e5){return new Promise(function(_0x42f448,_0x53a799){var _0x31caae=_[_0x7fc1('0x74')](_0x4100a9[_0x7fc1('0x7b')]);_0x42f448({'count':_0x31caae[_0x7fc1('0x5d')],'rows':_0x31caae});});},'Outbound':function(_0x3eedfc){return new Promise(function(_0x550c1a,_0x5baff2){_0x550c1a(_0x4100a9[_0x7fc1('0x31')]);});},'Campaigns':function(_0x9f0378){return new Promise(function(_0x208478,_0xf75821){var _0x3e9b82=_['values'](_0x4100a9[_0x7fc1('0x7c')]);_0x208478({'count':_0x3e9b82['length'],'rows':_0x3e9b82});});},'VoiceQueuesPreview':function(_0x1ff21a){var _0x895bfb=this;return new Promise(function(_0x152c4a,_0x5b8d10){_0x5de7fa[_0x7fc1('0x7d')](_0x1ff21a['id'])[_0x7fc1('0x1c')](function(_0x5b0536){_0x152c4a({'code':0xc8,'message':_0x5b0536[_0x7fc1('0x1d')]});})['catch'](function(_0x520467){_0x5b8d10(_0x895bfb[_0x7fc1('0x1f')](0x1f4,_0x520467['message']));});});},'EventManager':function(_0x4fd1e2){var _0x83a77d=this;return new Promise(function(_0x2a15db,_0x4aacb7){if(!_0x4fd1e2[_0x7fc1('0x7e')]){return _0x4aacb7(_0x83a77d[_0x7fc1('0x1f')](0x1f4,_0x7fc1('0x7f')));}ami['emit']('custom:'+_0x4fd1e2[_0x7fc1('0x7e')],_0x4fd1e2[_0x7fc1('0x1d')]);_0x2a15db({'code':0xc8,'message':_0x4fd1e2});});},'FaxAccounts':function(_0x4b430c){return new Promise(function(_0x577caa,_0x2d52ee){var _0x270b45=_[_0x7fc1('0x74')](_0x4100a9[_0x7fc1('0x80')]);_0x577caa({'count':_0x270b45[_0x7fc1('0x5d')],'rows':_0x270b45});});},'SendFax':function(_0x4adfb2){var _0x128a5f=this;return new Promise(function(_0x3808d8,_0x115282){_0x30f5f8['send'](_0x4adfb2)['then'](function(_0x350011){_0x3808d8({'code':0xc8,'message':_0x350011['message']});})[_0x7fc1('0x1e')](function(_0x50f097){_0x115282(_0x128a5f[_0x7fc1('0x1f')](0x1f4,_0x50f097[_0x7fc1('0x1d')]));});});},'CheckAfterSend':function(_0x5dad34){var _0x449bb1=this;return new Promise(function(_0x155022,_0x4b0a13){_0x30f5f8['checkAfterSend'](_0x5dad34)[_0x7fc1('0x1c')](function(_0x521dac){_0x155022({'code':0xc8,'message':_0x521dac[_0x7fc1('0x1d')]});})[_0x7fc1('0x1e')](function(_0x3c3f7a){_0x4b0a13(_0x449bb1[_0x7fc1('0x1f')](0x1f4,_0x3c3f7a[_0x7fc1('0x1d')]));});});}};var _0x192d8a=jayson[_0x7fc1('0x81')](_0xf0d3fa)[_0x7fc1('0x82')]();_0x192d8a['on']('error',function(_0x524d5d){return _0x2267ea(_0x524d5d);});_0x192d8a[_0x7fc1('0x8')](0x232a,_0x7fc1('0x83'),function(){console['log'](_0x7fc1('0x84'),0x232a);return _0x1867ea('RPC\x20listening\x20on\x20port:'+0x232a);});});};
\ No newline at end of file
index 6753f40..31d2c2a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6c4a=['../../rpc/cmContact','defaults','redis','localhost','info','[CM][%s][%s]','stringify','exec','data1','data2','isNil','data5','xmd-contactid','ListId','data3','split','phone','$or','map','routeId','destcalleridnum','calleridnum','lastName','createdAt','scheduledAt','updatedAt','union','then','getContacts','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','firstName','calleridname','Unknown','destcalleridname','createContact','push','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','<unknown>','name','format','trigger:%s','action','toLowerCase','merge','lodash','bluebird','ioredis','util','../../../../config/environment','../../../../config/logger','trigger'];(function(_0x1f18c7,_0x30a72a){var _0x1b7c72=function(_0x202ad0){while(--_0x202ad0){_0x1f18c7['push'](_0x1f18c7['shift']());}};_0x1b7c72(++_0x30a72a);}(_0x6c4a,0x14f));var _0xa6c4=function(_0x295de6,_0xc8b6e0){_0x295de6=_0x295de6-0x0;var _0x179dcf=_0x6c4a[_0x295de6];return _0x179dcf;};'use strict';var _=require(_0xa6c4('0x0'));var BPromise=require(_0xa6c4('0x1'));var Redis=require(_0xa6c4('0x2'));var util=require(_0xa6c4('0x3'));var config=require(_0xa6c4('0x4'));var logger=require(_0xa6c4('0x5'))(_0xa6c4('0x6'));var cmContactRpc=require(_0xa6c4('0x7'));config['redis']=_[_0xa6c4('0x8')](config[_0xa6c4('0x9')],{'host':_0xa6c4('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function emit(_0x273a12,_0x527063,_0x45f8d1,_0x442829,_0x11af84){logger[_0xa6c4('0xb')](_0xa6c4('0xc'),_0x273a12,_0x527063['id'],_0x45f8d1,_0x442829,JSON[_0xa6c4('0xd')](_0x11af84));io['to'](_0x45f8d1)['emit'](_0x442829,_0x11af84);}exports[_0xa6c4('0xe')]=function(_0x28e6a8,_0x656d5d,_0x4725d3,_0x404fcc){var _0xca354b,_0x184435;var _0x1b1e84={};var _0x293fb4;var _0x4f2763=Number(_0x4725d3[_0xa6c4('0xf')]);var _0x1c05ee=_0x4725d3[_0xa6c4('0x10')]?Boolean(Number(_0x4725d3['data2'])):![];var _0x483774;var _0x1ae4f8=![];if(!_[_0xa6c4('0x11')](_0x4725d3[_0xa6c4('0x12')])){if(_0x4725d3[_0xa6c4('0x12')]=='1')_0x1ae4f8=!![];}if(!_0x1ae4f8){if(_0x404fcc['xmd-contactid']){_0x1b1e84['id']=_0x404fcc[_0xa6c4('0x13')];}}if(!_0x1b1e84['id']){_0x1b1e84[_0xa6c4('0x14')]=_0x4f2763;_0x483774=_0x4725d3[_0xa6c4('0x15')]&&_0x4725d3['data3']!=='0'?_0x4725d3['data3'][_0xa6c4('0x16')](','):[_0xa6c4('0x17')];_0x1b1e84[_0xa6c4('0x18')]=_[_0xa6c4('0x19')](_0x483774,function(_0x51e7a0){var _0x3d703a={};_0x3d703a[_0x51e7a0]=_0x404fcc[_0xa6c4('0x1a')]?_0x404fcc[_0xa6c4('0x1b')]:_0x404fcc[_0xa6c4('0x1c')];return _0x3d703a;});_0x293fb4=_0x404fcc['routeId']?_0x404fcc[_0xa6c4('0x1b')]:_0x404fcc['calleridnum'];}var _0x13453c=['id','firstName',_0xa6c4('0x1d'),_0xa6c4('0x17'),'mobile','fax','ListId',_0xa6c4('0x1e'),_0xa6c4('0x1f'),_0xa6c4('0x20')];var _0x58e38b=_[_0xa6c4('0x21')](_0x13453c,_0x483774);BPromise['resolve']()[_0xa6c4('0x22')](cmContactRpc[_0xa6c4('0x23')]({'attributes':_0x58e38b,'where':_0x1b1e84,'phone':_0x293fb4}))[_0xa6c4('0x22')](function(_0x1bb1ec){_0x184435=_0x1bb1ec;if(!_['isEmpty'](_0x184435)){if(_0x184435['length']===0x1){_0xca354b=_0x184435[0x0];logger[_0xa6c4('0xb')](_0xa6c4('0x24'),_0x404fcc[_0xa6c4('0x25')],_0x656d5d['id'],_0xca354b['id']);}else{logger[_0xa6c4('0xb')](_0xa6c4('0x26'),_0x404fcc[_0xa6c4('0x25')],_0x656d5d['id'],_[_0xa6c4('0x19')](_0x184435,'id')[_0xa6c4('0x27')](','));}return;}else{logger[_0xa6c4('0xb')](_0xa6c4('0x28'),_0x404fcc[_0xa6c4('0x25')],_0x656d5d['id']);var _0x3e8787={'ListId':_0x4f2763};var _0x810b9c=_0x4725d3[_0xa6c4('0x29')]&&_0x4725d3[_0xa6c4('0x29')]!=='0'?_0x4725d3[_0xa6c4('0x29')]:_0xa6c4('0x17');if(_0x1c05ee){logger[_0xa6c4('0xb')]('[CM][%s][%s]\x20Autocreate\x20enabled',_0x404fcc[_0xa6c4('0x25')],_0x656d5d['id']);_0x3e8787[_0x810b9c]=_['isNil'](_0x404fcc[_0xa6c4('0x1a')])?_0x404fcc[_0xa6c4('0x1c')]:_0x404fcc['destcalleridnum'];if(_[_0xa6c4('0x11')](_0x404fcc[_0xa6c4('0x1a')])){_0x3e8787[_0xa6c4('0x2a')]=_0x404fcc[_0xa6c4('0x2b')]&&_0x404fcc['calleridname']!=='<unknown>'?_0x404fcc[_0xa6c4('0x2b')]:_0xa6c4('0x2c');}else{_0x3e8787[_0xa6c4('0x2a')]=_0x404fcc['destcalleridname']&&_0x404fcc[_0xa6c4('0x2d')]!=='<unknown>'?_0x404fcc['destcalleridname']:_0xa6c4('0x2c');}return BPromise['resolve']()['then'](cmContactRpc[_0xa6c4('0x2e')](_0x3e8787))[_0xa6c4('0x22')](function(_0x19b55f){_0xca354b=_0x19b55f;_0x184435[_0xa6c4('0x2f')](_0x19b55f);if(_0xca354b){logger[_0xa6c4('0xb')](_0xa6c4('0x30'),_0x404fcc[_0xa6c4('0x25')],_0x656d5d['id'],_0xca354b['id']);}return;});}else{logger[_0xa6c4('0xb')](_0xa6c4('0x31'),_0x404fcc[_0xa6c4('0x25')],_0x656d5d['id']);_0x3e8787[_0x810b9c]=_[_0xa6c4('0x11')](_0x404fcc['routeId'])?_0x404fcc[_0xa6c4('0x1c')]:_0x404fcc['destcalleridnum'];if(_['isNil'](_0x404fcc[_0xa6c4('0x1a')])){_0x3e8787['firstName']=_0x404fcc[_0xa6c4('0x2b')]&&_0x404fcc[_0xa6c4('0x2b')]!==_0xa6c4('0x32')?_0x404fcc[_0xa6c4('0x2b')]:'Unknown';}else{_0x3e8787[_0xa6c4('0x2a')]=_0x404fcc['destcalleridname']&&_0x404fcc[_0xa6c4('0x2d')]!=='<unknown>'?_0x404fcc['destcalleridname']:_0xa6c4('0x2c');}_0xca354b=_0x3e8787;_0x184435[_0xa6c4('0x2f')](_0x3e8787);return;}}})[_0xa6c4('0x22')](function(){if(_0x28e6a8){emit(_0x404fcc[_0xa6c4('0x25')],_0x656d5d,util['format']('user:%s',_0x28e6a8[_0xa6c4('0x33')]),util[_0xa6c4('0x34')](_0xa6c4('0x35'),_0x4725d3[_0xa6c4('0x36')][_0xa6c4('0x37')]()),{'evt':_[_0xa6c4('0x38')](_0x404fcc,{'autoCreate':_0x1c05ee}),'contact':_0xca354b===undefined?{}:_0xca354b,'contacts':_0x184435['length']===0x0?undefined:_0x184435});}});};
\ No newline at end of file
+var _0x943a=['Unknown','destcalleridname','<unknown>','createContact','push','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','format','user:%s','name','trigger:%s','action','toLowerCase','merge','lodash','bluebird','../../../../config/environment','../../../../config/logger','trigger','defaults','redis','localhost','socket.io-emitter','info','[CM][%s][%s]','stringify','emit','exec','data2','isNil','data5','xmd-contactid','ListId','data3','split','phone','$or','map','destcalleridnum','calleridnum','lastName','mobile','fax','createdAt','scheduledAt','union','resolve','then','getContacts','isEmpty','length','uniqueid','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','routeId','firstName','calleridname'];(function(_0xc0cbf,_0x22f493){var _0x24a0ac=function(_0x33e3c9){while(--_0x33e3c9){_0xc0cbf['push'](_0xc0cbf['shift']());}};_0x24a0ac(++_0x22f493);}(_0x943a,0x84));var _0xa943=function(_0x49985f,_0x54a141){_0x49985f=_0x49985f-0x0;var _0x270118=_0x943a[_0x49985f];return _0x270118;};'use strict';var _=require(_0xa943('0x0'));var BPromise=require(_0xa943('0x1'));var Redis=require('ioredis');var util=require('util');var config=require(_0xa943('0x2'));var logger=require(_0xa943('0x3'))(_0xa943('0x4'));var cmContactRpc=require('../../rpc/cmContact');config['redis']=_[_0xa943('0x5')](config[_0xa943('0x6')],{'host':_0xa943('0x7'),'port':0x18eb});var io=require(_0xa943('0x8'))(new Redis(config[_0xa943('0x6')]));function emit(_0x484bd2,_0x1c6850,_0x4b948d,_0x545842,_0x526407){logger[_0xa943('0x9')](_0xa943('0xa'),_0x484bd2,_0x1c6850['id'],_0x4b948d,_0x545842,JSON[_0xa943('0xb')](_0x526407));io['to'](_0x4b948d)[_0xa943('0xc')](_0x545842,_0x526407);}exports[_0xa943('0xd')]=function(_0x46f569,_0x3a0e55,_0x245e67,_0x3240e3){var _0x2ef292,_0x3b56da;var _0x4ee6a4={};var _0x28cd9c;var _0x105042=Number(_0x245e67['data1']);var _0x6b798b=_0x245e67[_0xa943('0xe')]?Boolean(Number(_0x245e67[_0xa943('0xe')])):![];var _0x2bf476;var _0x1c12a2=![];if(!_[_0xa943('0xf')](_0x245e67[_0xa943('0x10')])){if(_0x245e67[_0xa943('0x10')]=='1')_0x1c12a2=!![];}if(!_0x1c12a2){if(_0x3240e3[_0xa943('0x11')]){_0x4ee6a4['id']=_0x3240e3[_0xa943('0x11')];}}if(!_0x4ee6a4['id']){_0x4ee6a4[_0xa943('0x12')]=_0x105042;_0x2bf476=_0x245e67[_0xa943('0x13')]&&_0x245e67[_0xa943('0x13')]!=='0'?_0x245e67[_0xa943('0x13')][_0xa943('0x14')](','):[_0xa943('0x15')];_0x4ee6a4[_0xa943('0x16')]=_[_0xa943('0x17')](_0x2bf476,function(_0xb3927d){var _0x28d6af={};_0x28d6af[_0xb3927d]=_0x3240e3['routeId']?_0x3240e3[_0xa943('0x18')]:_0x3240e3[_0xa943('0x19')];return _0x28d6af;});_0x28cd9c=_0x3240e3['routeId']?_0x3240e3[_0xa943('0x18')]:_0x3240e3[_0xa943('0x19')];}var _0x5a73c0=['id','firstName',_0xa943('0x1a'),_0xa943('0x15'),_0xa943('0x1b'),_0xa943('0x1c'),'ListId',_0xa943('0x1d'),_0xa943('0x1e'),'updatedAt'];var _0x262ce3=_[_0xa943('0x1f')](_0x5a73c0,_0x2bf476);BPromise[_0xa943('0x20')]()[_0xa943('0x21')](cmContactRpc[_0xa943('0x22')]({'attributes':_0x262ce3,'where':_0x4ee6a4,'phone':_0x28cd9c}))[_0xa943('0x21')](function(_0x2ad2f1){_0x3b56da=_0x2ad2f1;if(!_[_0xa943('0x23')](_0x3b56da)){if(_0x3b56da[_0xa943('0x24')]===0x1){_0x2ef292=_0x3b56da[0x0];logger[_0xa943('0x9')]('[CM][%s][%s]\x20Contact\x20found:%s',_0x3240e3[_0xa943('0x25')],_0x3a0e55['id'],_0x2ef292['id']);}else{logger[_0xa943('0x9')]('[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]',_0x3240e3[_0xa943('0x25')],_0x3a0e55['id'],_['map'](_0x3b56da,'id')[_0xa943('0x26')](','));}return;}else{logger[_0xa943('0x9')](_0xa943('0x27'),_0x3240e3['uniqueid'],_0x3a0e55['id']);var _0x398174={'ListId':_0x105042};var _0x3fc538=_0x245e67[_0xa943('0x28')]&&_0x245e67['data4']!=='0'?_0x245e67[_0xa943('0x28')]:_0xa943('0x15');if(_0x6b798b){logger[_0xa943('0x9')](_0xa943('0x29'),_0x3240e3[_0xa943('0x25')],_0x3a0e55['id']);_0x398174[_0x3fc538]=_[_0xa943('0xf')](_0x3240e3[_0xa943('0x2a')])?_0x3240e3['calleridnum']:_0x3240e3[_0xa943('0x18')];if(_[_0xa943('0xf')](_0x3240e3[_0xa943('0x2a')])){_0x398174[_0xa943('0x2b')]=_0x3240e3[_0xa943('0x2c')]&&_0x3240e3[_0xa943('0x2c')]!=='<unknown>'?_0x3240e3[_0xa943('0x2c')]:_0xa943('0x2d');}else{_0x398174['firstName']=_0x3240e3[_0xa943('0x2e')]&&_0x3240e3[_0xa943('0x2e')]!==_0xa943('0x2f')?_0x3240e3[_0xa943('0x2e')]:'Unknown';}return BPromise[_0xa943('0x20')]()[_0xa943('0x21')](cmContactRpc[_0xa943('0x30')](_0x398174))[_0xa943('0x21')](function(_0x4af2bb){_0x2ef292=_0x4af2bb;_0x3b56da[_0xa943('0x31')](_0x4af2bb);if(_0x2ef292){logger[_0xa943('0x9')](_0xa943('0x32'),_0x3240e3[_0xa943('0x25')],_0x3a0e55['id'],_0x2ef292['id']);}return;});}else{logger[_0xa943('0x9')](_0xa943('0x33'),_0x3240e3['uniqueid'],_0x3a0e55['id']);_0x398174[_0x3fc538]=_['isNil'](_0x3240e3[_0xa943('0x2a')])?_0x3240e3[_0xa943('0x19')]:_0x3240e3['destcalleridnum'];if(_[_0xa943('0xf')](_0x3240e3[_0xa943('0x2a')])){_0x398174['firstName']=_0x3240e3[_0xa943('0x2c')]&&_0x3240e3['calleridname']!==_0xa943('0x2f')?_0x3240e3['calleridname']:_0xa943('0x2d');}else{_0x398174[_0xa943('0x2b')]=_0x3240e3['destcalleridname']&&_0x3240e3[_0xa943('0x2e')]!=='<unknown>'?_0x3240e3['destcalleridname']:_0xa943('0x2d');}_0x2ef292=_0x398174;_0x3b56da['push'](_0x398174);return;}}})[_0xa943('0x21')](function(){if(_0x46f569){emit(_0x3240e3['uniqueid'],_0x3a0e55,util[_0xa943('0x34')](_0xa943('0x35'),_0x46f569[_0xa943('0x36')]),util[_0xa943('0x34')](_0xa943('0x37'),_0x245e67[_0xa943('0x38')][_0xa943('0x39')]()),{'evt':_[_0xa943('0x3a')](_0x3240e3,{'autoCreate':_0x6b798b}),'contact':_0x2ef292===undefined?{}:_0x2ef292,'contacts':_0x3b56da[_0xa943('0x24')]===0x0?undefined:_0x3b56da});}});};
\ No newline at end of file
index d379dac..69de666 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0736=['isNil','data3','data4','location','windowWidth','data5','windowHeight','data6','600','winApplication','winArguments','format','user:%s','name','trigger:%s:%s','action','trigger:%s','toLowerCase','exec','integration','accounts','queue','routeId','urlforward','script','parse','query','search','replace','channel','AllConditions','every','checkConditions','AnyConditions','some','field','account','chat','ChatWebsiteId','operator','value','upperFirst','message','event','agent','membername','lastevent','mailSubstatus','substatus','created','equals','exports','util','lodash','mustache','ioredis','./urlforward','./integration','./cmContact','./script','../../../config/environment','../../../config/logger','trigger','../ami','redis','defaults','localhost','socket.io-emitter','popup','url','winapp','triggers','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','custom:agentcalled','custom:agentconnect','syncCustomEvent','bind','custom:agentcomplete','custom:agentnosuchnumber','custom:agentbusy','custom:agentcongestion','custom:agentreject','custom:queuecallerabandon','custom:timeout','custom:dialbegin','syncAgentDial','custom:dialend','custom:closedinteraction','custom:incomingmessage','custom:outgoingmessage','custom:rejectmessage','custom:offlineMessage','prototype','emit','info','stringify','motionChannel','undefined','voice','checkTriggers','agents','interface','hasOwnProperty','status','checkTrigger','merge','variables','Actions','length','contactmanager','motionbar','browser','data1','TemplateId','data2','html','render','template\x20not\x20found','uri','buildUri'];(function(_0x266e4c,_0x310f2c){var _0x368e63=function(_0x24dbac){while(--_0x24dbac){_0x266e4c['push'](_0x266e4c['shift']());}};_0x368e63(++_0x310f2c);}(_0x0736,0x1c0));var _0x6073=function(_0x1ce22d,_0x1c214a){_0x1ce22d=_0x1ce22d-0x0;var _0x4903e0=_0x0736[_0x1ce22d];return _0x4903e0;};'use strict';var util=require(_0x6073('0x0'));var _=require(_0x6073('0x1'));var url=require('url');var Mustache=require(_0x6073('0x2'));var Redis=require(_0x6073('0x3'));var urlforward=require(_0x6073('0x4'));var integration=require(_0x6073('0x5'));var cmContact=require(_0x6073('0x6'));var script=require(_0x6073('0x7'));var config=require(_0x6073('0x8'));var logger=require(_0x6073('0x9'))(_0x6073('0xa'));var ami=require(_0x6073('0xb'));config[_0x6073('0xc')]=_[_0x6073('0xd')](config[_0x6073('0xc')],{'host':_0x6073('0xe'),'port':0x18eb});var io=require(_0x6073('0xf'))(new Redis(config[_0x6073('0xc')]));var operators={'equals':function(_0x36a0dd,_0x57c418){return _0x36a0dd==_0x57c418;},'not_equals':function(_0x594df9,_0x665634){return _0x594df9!=_0x665634;}};var barAndWebActions=[_0x6073('0x10'),_0x6073('0x11'),_0x6073('0x12')];function Trigger(_0x431797){this[_0x6073('0x13')]=_0x431797['triggers'];this['agents']=_0x431797['agents'];this['voiceQueues']=_0x431797[_0x6073('0x14')];this[_0x6073('0x15')]=_0x431797['templates'];this[_0x6073('0x16')]=_0x431797[_0x6073('0x16')];this[_0x6073('0x17')]=_0x431797[_0x6073('0x17')];this[_0x6073('0x18')]=_0x431797[_0x6073('0x18')];this[_0x6073('0x19')]=_0x431797[_0x6073('0x19')];this[_0x6073('0x1a')]=_0x431797[_0x6073('0x1a')];this[_0x6073('0x1b')]=_0x431797[_0x6073('0x1b')];this[_0x6073('0x1c')]=_0x431797['deskAccounts'];this[_0x6073('0x1d')]=_0x431797[_0x6073('0x1d')];this[_0x6073('0x1e')]=_0x431797['servicenowAccounts'];this[_0x6073('0x1f')]=_0x431797[_0x6073('0x1f')];this[_0x6073('0x20')]=_0x431797[_0x6073('0x20')];this['accounts']={'zendesk':this['zendeskAccounts'],'salesforce':this[_0x6073('0x19')],'freshdesk':this['freshdeskAccounts'],'sugarcrm':this['sugarcrmAccounts'],'zoho':this[_0x6073('0x1b')],'desk':this[_0x6073('0x1c')],'vtiger':this[_0x6073('0x1d')],'dynamics365':this[_0x6073('0x1f')],'freshsales':this[_0x6073('0x20')],'servicenow':this['servicenowAccounts']};ami['on'](_0x6073('0x21'),this['syncCustomEvent']['bind'](this));ami['on'](_0x6073('0x22'),this[_0x6073('0x23')][_0x6073('0x24')](this));ami['on']('custom:agentringnoanswer',this[_0x6073('0x23')][_0x6073('0x24')](this));ami['on'](_0x6073('0x25'),this[_0x6073('0x23')][_0x6073('0x24')](this));ami['on'](_0x6073('0x26'),this['syncCustomEvent'][_0x6073('0x24')](this));ami['on']('custom:agentnoanswer',this[_0x6073('0x23')][_0x6073('0x24')](this));ami['on'](_0x6073('0x27'),this[_0x6073('0x23')][_0x6073('0x24')](this));ami['on'](_0x6073('0x28'),this[_0x6073('0x23')][_0x6073('0x24')](this));ami['on'](_0x6073('0x29'),this['syncCustomEvent'][_0x6073('0x24')](this));ami['on']('custom:amd',this['syncCustomEvent'][_0x6073('0x24')](this));ami['on'](_0x6073('0x2a'),this[_0x6073('0x23')][_0x6073('0x24')](this));ami['on'](_0x6073('0x2b'),this[_0x6073('0x23')][_0x6073('0x24')](this));ami['on'](_0x6073('0x2c'),this[_0x6073('0x2d')]['bind'](this));ami['on']('custom:dialconnect',this[_0x6073('0x2d')][_0x6073('0x24')](this));ami['on'](_0x6073('0x2e'),this[_0x6073('0x2d')][_0x6073('0x24')](this));ami['on']('custom:newinteraction',this[_0x6073('0x23')][_0x6073('0x24')](this));ami['on'](_0x6073('0x2f'),this[_0x6073('0x23')][_0x6073('0x24')](this));ami['on']('custom:substatus',this[_0x6073('0x23')][_0x6073('0x24')](this));ami['on'](_0x6073('0x30'),this[_0x6073('0x23')][_0x6073('0x24')](this));ami['on'](_0x6073('0x31'),this['syncCustomEvent']['bind'](this));ami['on']('custom:acceptmessage',this[_0x6073('0x23')][_0x6073('0x24')](this));ami['on'](_0x6073('0x32'),this['syncCustomEvent']['bind'](this));ami['on'](_0x6073('0x33'),this['syncCustomEvent']['bind'](this));}Trigger[_0x6073('0x34')][_0x6073('0x35')]=function(_0x323db9,_0x54e70d,_0x4459ee){logger[_0x6073('0x36')](_0x323db9,_0x54e70d,JSON[_0x6073('0x37')](_0x4459ee));io['to'](_0x323db9)[_0x6073('0x35')](_0x54e70d,_0x4459ee);};Trigger[_0x6073('0x34')]['syncCustomEvent']=function(_0x352bcd){var _0x54d804=_['clone'](_0x352bcd);if(typeof _0x54d804[_0x6073('0x38')]===_0x6073('0x39')){_0x54d804[_0x6073('0x38')]=_0x6073('0x3a');}this[_0x6073('0x3b')](_0x54d804);};Trigger['prototype']['syncAgentDial']=function(_0x364730){if(this[_0x6073('0x3c')][_0x364730[_0x6073('0x3d')]]){this[_0x6073('0x23')](_0x364730);}};Trigger[_0x6073('0x34')]['checkTriggers']=function(_0x9ac862){var _0x36a56f;for(var _0x3b064f in this[_0x6073('0x13')]){if(this[_0x6073('0x13')][_0x6073('0x3e')](_0x3b064f)){if(this['triggers'][_0x3b064f][_0x6073('0x3f')]){_0x36a56f=this[_0x6073('0x40')](this[_0x6073('0x13')][_0x3b064f],_0x9ac862);if(_0x36a56f){_[_0x6073('0x41')](_0x9ac862,_0x9ac862[_0x6073('0x42')]);for(var _0x3b38ee=0x0,_0x28d12f,_0x887cde,_0xbd3b2b;_0x3b38ee<this[_0x6073('0x13')][_0x3b064f][_0x6073('0x43')][_0x6073('0x44')];_0x3b38ee+=0x1){_0x28d12f=this[_0x6073('0x13')][_0x3b064f][_0x6073('0x43')][_0x3b38ee];if(this[_0x6073('0x3c')][_0x9ac862[_0x6073('0x3d')]]){switch(_0x28d12f['action']['toLowerCase']()){case _0x6073('0x45'):break;case _0x6073('0x46'):case _0x6073('0x47'):var _0x540823={};switch(barAndWebActions[_0x28d12f[_0x6073('0x48')]]){case'popup':_0x540823[_0x6073('0x49')]=_0x28d12f[_0x6073('0x4a')];_0x540823[_0x6073('0x4b')]=this['templates'][_0x28d12f[_0x6073('0x4a')]]?Mustache[_0x6073('0x4c')](this[_0x6073('0x15')][_0x28d12f[_0x6073('0x4a')]][_0x6073('0x4b')],_0x9ac862):_0x6073('0x4d');break;case'url':_0x540823[_0x6073('0x4e')]=this[_0x6073('0x4f')](_0x28d12f[_0x6073('0x4a')],_0x9ac862,_[_0x6073('0x50')](_0x28d12f[_0x6073('0x51')])?!![]:parseInt(_0x28d12f[_0x6073('0x51')],0xa));if(_['isNil'](_0x28d12f[_0x6073('0x52')])){_0x540823[_0x6073('0x53')]='0';}else{_0x540823['uriLocation']=_0x28d12f[_0x6073('0x52')];_0x540823[_0x6073('0x54')]=_[_0x6073('0x50')](_0x28d12f[_0x6073('0x55')])?'800':_0x28d12f[_0x6073('0x55')];_0x540823[_0x6073('0x56')]=_[_0x6073('0x50')](_0x28d12f[_0x6073('0x57')])?_0x6073('0x58'):_0x28d12f[_0x6073('0x57')];}break;case'winapp':_0x540823[_0x6073('0x59')]=_0x28d12f['data2']?Mustache[_0x6073('0x4c')](_0x28d12f[_0x6073('0x4a')],_0x9ac862):'';_0x540823[_0x6073('0x5a')]=_0x28d12f['data3']?Mustache[_0x6073('0x4c')](_0x28d12f[_0x6073('0x51')],_0x9ac862):'';break;}this[_0x6073('0x35')](util[_0x6073('0x5b')](_0x6073('0x5c'),this[_0x6073('0x3c')][_0x9ac862[_0x6073('0x3d')]][_0x6073('0x5d')]),util['format'](_0x6073('0x5e'),_0x28d12f[_0x6073('0x5f')]['toLowerCase'](),barAndWebActions[_0x28d12f[_0x6073('0x48')]]),_[_0x6073('0x41')](_0x540823,_0x9ac862));break;case'jscripty':this[_0x6073('0x35')](util['format']('user:%s',this[_0x6073('0x3c')][_0x9ac862[_0x6073('0x3d')]][_0x6073('0x5d')]),util[_0x6073('0x5b')](_0x6073('0x60'),_0x28d12f[_0x6073('0x5f')][_0x6073('0x61')]()),_[_0x6073('0x41')]({'ProjectId':parseInt(_0x28d12f[_0x6073('0x48')],0xa)},_0x9ac862));break;default:this['emit'](util[_0x6073('0x5b')](_0x6073('0x5c'),this[_0x6073('0x3c')][_0x9ac862['interface']][_0x6073('0x5d')]),util['format'](_0x6073('0x60'),_0x28d12f[_0x6073('0x5f')]['toLowerCase']()),_[_0x6073('0x41')]({},_0x28d12f,_0x9ac862));}}switch(_0x28d12f[_0x6073('0x5f')][_0x6073('0x61')]()){case'contactmanager':cmContact[_0x6073('0x62')](this['agents'][_0x9ac862[_0x6073('0x3d')]],this[_0x6073('0x13')][_0x3b064f],_0x28d12f,_0x9ac862);break;case _0x6073('0x63'):integration[_0x6073('0x62')](_0x28d12f,_0x9ac862,this[_0x6073('0x64')],this[_0x6073('0x3c')][_0x9ac862[_0x6073('0x3d')]],this['voiceQueues'][_0x9ac862[_0x6073('0x65')]],this[_0x6073('0x16')][_0x9ac862[_0x6073('0x66')]]);break;case _0x6073('0x67'):urlforward['exec'](_0x28d12f,_0x9ac862);break;case _0x6073('0x68'):script[_0x6073('0x62')](_0x28d12f,_0x9ac862);break;}}}}}}};Trigger[_0x6073('0x34')]['buildUri']=function(_0x132146,_0x28c28e,_0x5f0d14){var _0x904dd8=url[_0x6073('0x69')](Mustache[_0x6073('0x4c')](_0x132146,_0x28c28e),!![]);if(_0x5f0d14){_[_0x6073('0x41')](_0x904dd8[_0x6073('0x6a')],_0x28c28e);}delete _0x904dd8[_0x6073('0x6b')];var _0x47bb58=url['format'](_0x904dd8);_0x47bb58=_0x47bb58[_0x6073('0x6c')](/\/\?/g,'?');return _0x47bb58;};Trigger[_0x6073('0x34')][_0x6073('0x40')]=function(_0x5694a8,_0x43103a){var _0x89e16d=!![];var _0x14a087=!![];var _0x3d9438=![];if(_0x5694a8[_0x6073('0x6d')]===_0x43103a[_0x6073('0x38')]){_0x3d9438=!![];}if(_0x5694a8[_0x6073('0x6e')][_0x6073('0x44')]){_0x89e16d=_[_0x6073('0x6f')](_0x5694a8['AllConditions'],this[_0x6073('0x70')](_0x43103a,_0x5694a8[_0x6073('0x6d')]));}if(_0x5694a8[_0x6073('0x71')][_0x6073('0x44')]){_0x14a087=_[_0x6073('0x72')](_0x5694a8[_0x6073('0x71')],this[_0x6073('0x70')](_0x43103a,_0x5694a8[_0x6073('0x6d')]));}return _0x3d9438&&_0x89e16d&&_0x14a087;};Trigger[_0x6073('0x34')][_0x6073('0x70')]=function(_0x3387ec,_0x2d1f1f){return function(_0x451fbf){switch(_0x451fbf[_0x6073('0x73')]){case _0x6073('0x74'):if(_0x3387ec[_0x6073('0x6d')]===_0x2d1f1f){if(_0x2d1f1f===_0x6073('0x75')){return _0x3387ec[_0x6073('0x76')]?operators[_0x451fbf[_0x6073('0x77')]](Number(_0x451fbf[_0x6073('0x78')]),_0x3387ec[_0x6073('0x76')]):![];}else{return _0x3387ec[_[_0x6073('0x79')](_0x2d1f1f)+'AccountId']?operators[_0x451fbf[_0x6073('0x77')]](Number(_0x451fbf[_0x6073('0x78')]),_0x3387ec[_['upperFirst'](_0x2d1f1f)+'AccountId']):![];}}break;case'interaction':case _0x6073('0x7a'):if(_0x3387ec[_0x6073('0x6d')]===_0x2d1f1f){return _0x3387ec['event']?operators[_0x451fbf[_0x6073('0x77')]](_0x451fbf[_0x6073('0x78')],_0x3387ec[_0x6073('0x7b')]):![];}break;case _0x6073('0x65'):return _0x3387ec[_0x6073('0x65')]?operators[_0x451fbf[_0x6073('0x77')]](_0x451fbf[_0x6073('0x78')],_0x3387ec[_0x6073('0x65')]):![];case _0x6073('0x7c'):return _0x3387ec['membername']?operators[_0x451fbf[_0x6073('0x77')]](_0x451fbf[_0x6073('0x78')],_0x3387ec[_0x6073('0x7d')]):![];case'lastevent':return _0x3387ec[_0x6073('0x7e')]?operators[_0x451fbf[_0x6073('0x77')]](_0x451fbf['value'],_0x3387ec[_0x6073('0x7e')]):![];case _0x6073('0x66'):return _0x3387ec[_0x6073('0x66')]?operators[_0x451fbf['operator']](_0x451fbf[_0x6073('0x78')],_0x3387ec[_0x6073('0x66')]):![];case _0x6073('0x7f'):if(_0x451fbf['value']==='null')_0x451fbf[_0x6073('0x78')]=null;return typeof _0x3387ec['substatus']!==_0x6073('0x39')?operators[_0x451fbf[_0x6073('0x77')]](_0x451fbf[_0x6073('0x78')],_0x3387ec[_0x6073('0x80')]):![];case'offlineMessage':if(_0x3387ec['channel']===_0x2d1f1f){return _0x451fbf[_0x6073('0x78')]===_0x6073('0x81')&&_0x451fbf[_0x6073('0x77')]===_0x6073('0x82')?!![]:![];}break;}return![];};};module[_0x6073('0x83')]=Trigger;
\ No newline at end of file
+var _0xe353=['deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','custom:agentcalled','bind','syncCustomEvent','custom:agentcomplete','custom:agentnosuchnumber','custom:agentnoanswer','custom:agentbusy','custom:agentcongestion','custom:agentreject','custom:amd','custom:queuecallerabandon','custom:timeout','custom:dialbegin','custom:dialconnect','syncAgentDial','custom:dialend','custom:newinteraction','custom:incomingmessage','custom:outgoingmessage','custom:acceptmessage','custom:rejectmessage','custom:offlineMessage','info','emit','clone','undefined','checkTriggers','prototype','interface','status','checkTrigger','merge','variables','Actions','length','action','toLowerCase','motionbar','browser','data1','TemplateId','data2','html','render','template\x20not\x20found','uri','buildUri','isNil','data3','data4','uriLocation','windowWidth','windowHeight','data6','600','winApplication','winArguments','format','user:%s','name','trigger:%s:%s','jscripty','trigger:%s','contactmanager','exec','integration','script','query','search','every','AllConditions','channel','AnyConditions','checkConditions','account','ChatWebsiteId','operator','value','upperFirst','interaction','event','queue','membername','lastevent','routeId','null','substatus','offlineMessage','created','equals','exports','lodash','url','mustache','ioredis','./urlforward','./integration','./cmContact','./script','../../../config/environment','../../../config/logger','trigger','redis','defaults','socket.io-emitter','popup','winapp','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts'];(function(_0x18e6f7,_0x29738f){var _0x9e3ab0=function(_0x5ed513){while(--_0x5ed513){_0x18e6f7['push'](_0x18e6f7['shift']());}};_0x9e3ab0(++_0x29738f);}(_0xe353,0xdc));var _0x3e35=function(_0x4d8ed9,_0x2ae284){_0x4d8ed9=_0x4d8ed9-0x0;var _0x1e2140=_0xe353[_0x4d8ed9];return _0x1e2140;};'use strict';var util=require('util');var _=require(_0x3e35('0x0'));var url=require(_0x3e35('0x1'));var Mustache=require(_0x3e35('0x2'));var Redis=require(_0x3e35('0x3'));var urlforward=require(_0x3e35('0x4'));var integration=require(_0x3e35('0x5'));var cmContact=require(_0x3e35('0x6'));var script=require(_0x3e35('0x7'));var config=require(_0x3e35('0x8'));var logger=require(_0x3e35('0x9'))(_0x3e35('0xa'));var ami=require('../ami');config[_0x3e35('0xb')]=_[_0x3e35('0xc')](config[_0x3e35('0xb')],{'host':'localhost','port':0x18eb});var io=require(_0x3e35('0xd'))(new Redis(config['redis']));var operators={'equals':function(_0xe156a,_0x183d1f){return _0xe156a==_0x183d1f;},'not_equals':function(_0x37dbac,_0x260262){return _0x37dbac!=_0x260262;}};var barAndWebActions=[_0x3e35('0xe'),_0x3e35('0x1'),_0x3e35('0xf')];function Trigger(_0x1f8ae2){this[_0x3e35('0x10')]=_0x1f8ae2['triggers'];this[_0x3e35('0x11')]=_0x1f8ae2[_0x3e35('0x11')];this[_0x3e35('0x12')]=_0x1f8ae2[_0x3e35('0x12')];this['templates']=_0x1f8ae2[_0x3e35('0x13')];this[_0x3e35('0x14')]=_0x1f8ae2['voiceExtensions'];this['zendeskAccounts']=_0x1f8ae2[_0x3e35('0x15')];this[_0x3e35('0x16')]=_0x1f8ae2[_0x3e35('0x16')];this[_0x3e35('0x17')]=_0x1f8ae2[_0x3e35('0x17')];this[_0x3e35('0x18')]=_0x1f8ae2['sugarcrmAccounts'];this[_0x3e35('0x19')]=_0x1f8ae2[_0x3e35('0x19')];this[_0x3e35('0x1a')]=_0x1f8ae2['deskAccounts'];this[_0x3e35('0x1b')]=_0x1f8ae2[_0x3e35('0x1b')];this[_0x3e35('0x1c')]=_0x1f8ae2[_0x3e35('0x1c')];this[_0x3e35('0x1d')]=_0x1f8ae2['dynamics365Accounts'];this[_0x3e35('0x1e')]=_0x1f8ae2[_0x3e35('0x1e')];this[_0x3e35('0x1f')]={'zendesk':this[_0x3e35('0x15')],'salesforce':this['salesforceAccounts'],'freshdesk':this[_0x3e35('0x16')],'sugarcrm':this['sugarcrmAccounts'],'zoho':this[_0x3e35('0x19')],'desk':this[_0x3e35('0x1a')],'vtiger':this[_0x3e35('0x1b')],'dynamics365':this[_0x3e35('0x1d')],'freshsales':this['freshsalesAccounts'],'servicenow':this[_0x3e35('0x1c')]};ami['on'](_0x3e35('0x20'),this['syncCustomEvent'][_0x3e35('0x21')](this));ami['on']('custom:agentconnect',this[_0x3e35('0x22')]['bind'](this));ami['on']('custom:agentringnoanswer',this[_0x3e35('0x22')][_0x3e35('0x21')](this));ami['on'](_0x3e35('0x23'),this[_0x3e35('0x22')]['bind'](this));ami['on'](_0x3e35('0x24'),this['syncCustomEvent'][_0x3e35('0x21')](this));ami['on'](_0x3e35('0x25'),this[_0x3e35('0x22')][_0x3e35('0x21')](this));ami['on'](_0x3e35('0x26'),this[_0x3e35('0x22')][_0x3e35('0x21')](this));ami['on'](_0x3e35('0x27'),this[_0x3e35('0x22')]['bind'](this));ami['on'](_0x3e35('0x28'),this[_0x3e35('0x22')][_0x3e35('0x21')](this));ami['on'](_0x3e35('0x29'),this[_0x3e35('0x22')]['bind'](this));ami['on'](_0x3e35('0x2a'),this[_0x3e35('0x22')][_0x3e35('0x21')](this));ami['on'](_0x3e35('0x2b'),this[_0x3e35('0x22')][_0x3e35('0x21')](this));ami['on'](_0x3e35('0x2c'),this['syncAgentDial'][_0x3e35('0x21')](this));ami['on'](_0x3e35('0x2d'),this[_0x3e35('0x2e')]['bind'](this));ami['on'](_0x3e35('0x2f'),this[_0x3e35('0x2e')]['bind'](this));ami['on'](_0x3e35('0x30'),this[_0x3e35('0x22')]['bind'](this));ami['on']('custom:closedinteraction',this['syncCustomEvent'][_0x3e35('0x21')](this));ami['on']('custom:substatus',this[_0x3e35('0x22')][_0x3e35('0x21')](this));ami['on'](_0x3e35('0x31'),this[_0x3e35('0x22')][_0x3e35('0x21')](this));ami['on'](_0x3e35('0x32'),this[_0x3e35('0x22')][_0x3e35('0x21')](this));ami['on'](_0x3e35('0x33'),this[_0x3e35('0x22')]['bind'](this));ami['on'](_0x3e35('0x34'),this[_0x3e35('0x22')][_0x3e35('0x21')](this));ami['on'](_0x3e35('0x35'),this[_0x3e35('0x22')][_0x3e35('0x21')](this));}Trigger['prototype']['emit']=function(_0x1c974c,_0x3edf59,_0x3ce113){logger[_0x3e35('0x36')](_0x1c974c,_0x3edf59,JSON['stringify'](_0x3ce113));io['to'](_0x1c974c)[_0x3e35('0x37')](_0x3edf59,_0x3ce113);};Trigger['prototype'][_0x3e35('0x22')]=function(_0x261160){var _0x2babe5=_[_0x3e35('0x38')](_0x261160);if(typeof _0x2babe5['motionChannel']===_0x3e35('0x39')){_0x2babe5['motionChannel']='voice';}this[_0x3e35('0x3a')](_0x2babe5);};Trigger[_0x3e35('0x3b')]['syncAgentDial']=function(_0x23a19e){if(this[_0x3e35('0x11')][_0x23a19e[_0x3e35('0x3c')]]){this[_0x3e35('0x22')](_0x23a19e);}};Trigger[_0x3e35('0x3b')]['checkTriggers']=function(_0x18c02a){var _0xb2d0ca;for(var _0x19191d in this['triggers']){if(this[_0x3e35('0x10')]['hasOwnProperty'](_0x19191d)){if(this[_0x3e35('0x10')][_0x19191d][_0x3e35('0x3d')]){_0xb2d0ca=this[_0x3e35('0x3e')](this['triggers'][_0x19191d],_0x18c02a);if(_0xb2d0ca){_[_0x3e35('0x3f')](_0x18c02a,_0x18c02a[_0x3e35('0x40')]);for(var _0x54a1ef=0x0,_0x5aa054,_0x1dcff7,_0x3ccc66;_0x54a1ef<this['triggers'][_0x19191d][_0x3e35('0x41')][_0x3e35('0x42')];_0x54a1ef+=0x1){_0x5aa054=this['triggers'][_0x19191d][_0x3e35('0x41')][_0x54a1ef];if(this['agents'][_0x18c02a[_0x3e35('0x3c')]]){switch(_0x5aa054[_0x3e35('0x43')][_0x3e35('0x44')]()){case'contactmanager':break;case _0x3e35('0x45'):case _0x3e35('0x46'):var _0xeed488={};switch(barAndWebActions[_0x5aa054[_0x3e35('0x47')]]){case _0x3e35('0xe'):_0xeed488[_0x3e35('0x48')]=_0x5aa054[_0x3e35('0x49')];_0xeed488[_0x3e35('0x4a')]=this[_0x3e35('0x13')][_0x5aa054[_0x3e35('0x49')]]?Mustache[_0x3e35('0x4b')](this['templates'][_0x5aa054['data2']][_0x3e35('0x4a')],_0x18c02a):_0x3e35('0x4c');break;case'url':_0xeed488[_0x3e35('0x4d')]=this[_0x3e35('0x4e')](_0x5aa054['data2'],_0x18c02a,_[_0x3e35('0x4f')](_0x5aa054[_0x3e35('0x50')])?!![]:parseInt(_0x5aa054['data3'],0xa));if(_[_0x3e35('0x4f')](_0x5aa054[_0x3e35('0x51')])){_0xeed488['location']='0';}else{_0xeed488[_0x3e35('0x52')]=_0x5aa054[_0x3e35('0x51')];_0xeed488[_0x3e35('0x53')]=_[_0x3e35('0x4f')](_0x5aa054['data5'])?'800':_0x5aa054['data5'];_0xeed488[_0x3e35('0x54')]=_[_0x3e35('0x4f')](_0x5aa054[_0x3e35('0x55')])?_0x3e35('0x56'):_0x5aa054[_0x3e35('0x55')];}break;case _0x3e35('0xf'):_0xeed488[_0x3e35('0x57')]=_0x5aa054[_0x3e35('0x49')]?Mustache[_0x3e35('0x4b')](_0x5aa054[_0x3e35('0x49')],_0x18c02a):'';_0xeed488[_0x3e35('0x58')]=_0x5aa054['data3']?Mustache[_0x3e35('0x4b')](_0x5aa054[_0x3e35('0x50')],_0x18c02a):'';break;}this[_0x3e35('0x37')](util[_0x3e35('0x59')](_0x3e35('0x5a'),this[_0x3e35('0x11')][_0x18c02a['interface']][_0x3e35('0x5b')]),util[_0x3e35('0x59')](_0x3e35('0x5c'),_0x5aa054[_0x3e35('0x43')][_0x3e35('0x44')](),barAndWebActions[_0x5aa054[_0x3e35('0x47')]]),_[_0x3e35('0x3f')](_0xeed488,_0x18c02a));break;case _0x3e35('0x5d'):this[_0x3e35('0x37')](util[_0x3e35('0x59')](_0x3e35('0x5a'),this[_0x3e35('0x11')][_0x18c02a[_0x3e35('0x3c')]][_0x3e35('0x5b')]),util[_0x3e35('0x59')](_0x3e35('0x5e'),_0x5aa054['action'][_0x3e35('0x44')]()),_[_0x3e35('0x3f')]({'ProjectId':parseInt(_0x5aa054[_0x3e35('0x47')],0xa)},_0x18c02a));break;default:this[_0x3e35('0x37')](util['format'](_0x3e35('0x5a'),this[_0x3e35('0x11')][_0x18c02a['interface']][_0x3e35('0x5b')]),util[_0x3e35('0x59')](_0x3e35('0x5e'),_0x5aa054[_0x3e35('0x43')][_0x3e35('0x44')]()),_[_0x3e35('0x3f')]({},_0x5aa054,_0x18c02a));}}switch(_0x5aa054[_0x3e35('0x43')][_0x3e35('0x44')]()){case _0x3e35('0x5f'):cmContact[_0x3e35('0x60')](this[_0x3e35('0x11')][_0x18c02a[_0x3e35('0x3c')]],this['triggers'][_0x19191d],_0x5aa054,_0x18c02a);break;case _0x3e35('0x61'):integration[_0x3e35('0x60')](_0x5aa054,_0x18c02a,this[_0x3e35('0x1f')],this[_0x3e35('0x11')][_0x18c02a[_0x3e35('0x3c')]],this[_0x3e35('0x12')][_0x18c02a['queue']],this[_0x3e35('0x14')][_0x18c02a['routeId']]);break;case'urlforward':urlforward[_0x3e35('0x60')](_0x5aa054,_0x18c02a);break;case _0x3e35('0x62'):script['exec'](_0x5aa054,_0x18c02a);break;}}}}}}};Trigger['prototype'][_0x3e35('0x4e')]=function(_0x2f2d07,_0x4e39c1,_0xc91bae){var _0x56d72b=url['parse'](Mustache[_0x3e35('0x4b')](_0x2f2d07,_0x4e39c1),!![]);if(_0xc91bae){_[_0x3e35('0x3f')](_0x56d72b[_0x3e35('0x63')],_0x4e39c1);}delete _0x56d72b[_0x3e35('0x64')];var _0x4036dc=url[_0x3e35('0x59')](_0x56d72b);_0x4036dc=_0x4036dc['replace'](/\/\?/g,'?');return _0x4036dc;};Trigger['prototype'][_0x3e35('0x3e')]=function(_0x116c21,_0x570813){var _0x442eab=!![];var _0x50e0ec=!![];var _0x344388=![];if(_0x116c21['channel']===_0x570813['motionChannel']){_0x344388=!![];}if(_0x116c21['AllConditions'][_0x3e35('0x42')]){_0x442eab=_[_0x3e35('0x65')](_0x116c21[_0x3e35('0x66')],this['checkConditions'](_0x570813,_0x116c21[_0x3e35('0x67')]));}if(_0x116c21['AnyConditions'][_0x3e35('0x42')]){_0x50e0ec=_['some'](_0x116c21[_0x3e35('0x68')],this[_0x3e35('0x69')](_0x570813,_0x116c21[_0x3e35('0x67')]));}return _0x344388&&_0x442eab&&_0x50e0ec;};Trigger[_0x3e35('0x3b')][_0x3e35('0x69')]=function(_0x1698e5,_0xbb60d8){return function(_0x56c848){switch(_0x56c848['field']){case _0x3e35('0x6a'):if(_0x1698e5[_0x3e35('0x67')]===_0xbb60d8){if(_0xbb60d8==='chat'){return _0x1698e5[_0x3e35('0x6b')]?operators[_0x56c848[_0x3e35('0x6c')]](Number(_0x56c848[_0x3e35('0x6d')]),_0x1698e5[_0x3e35('0x6b')]):![];}else{return _0x1698e5[_[_0x3e35('0x6e')](_0xbb60d8)+'AccountId']?operators[_0x56c848[_0x3e35('0x6c')]](Number(_0x56c848[_0x3e35('0x6d')]),_0x1698e5[_[_0x3e35('0x6e')](_0xbb60d8)+'AccountId']):![];}}break;case _0x3e35('0x6f'):case'message':if(_0x1698e5[_0x3e35('0x67')]===_0xbb60d8){return _0x1698e5[_0x3e35('0x70')]?operators[_0x56c848['operator']](_0x56c848[_0x3e35('0x6d')],_0x1698e5['event']):![];}break;case _0x3e35('0x71'):return _0x1698e5['queue']?operators[_0x56c848['operator']](_0x56c848[_0x3e35('0x6d')],_0x1698e5[_0x3e35('0x71')]):![];case'agent':return _0x1698e5[_0x3e35('0x72')]?operators[_0x56c848[_0x3e35('0x6c')]](_0x56c848[_0x3e35('0x6d')],_0x1698e5[_0x3e35('0x72')]):![];case _0x3e35('0x73'):return _0x1698e5['lastevent']?operators[_0x56c848['operator']](_0x56c848[_0x3e35('0x6d')],_0x1698e5[_0x3e35('0x73')]):![];case _0x3e35('0x74'):return _0x1698e5[_0x3e35('0x74')]?operators[_0x56c848[_0x3e35('0x6c')]](_0x56c848['value'],_0x1698e5[_0x3e35('0x74')]):![];case'mailSubstatus':if(_0x56c848[_0x3e35('0x6d')]===_0x3e35('0x75'))_0x56c848['value']=null;return typeof _0x1698e5[_0x3e35('0x76')]!==_0x3e35('0x39')?operators[_0x56c848['operator']](_0x56c848[_0x3e35('0x6d')],_0x1698e5['substatus']):![];case _0x3e35('0x77'):if(_0x1698e5[_0x3e35('0x67')]===_0xbb60d8){return _0x56c848[_0x3e35('0x6d')]===_0x3e35('0x78')&&_0x56c848[_0x3e35('0x6c')]===_0x3e35('0x79')?!![]:![];}break;}return![];};};module[_0x3e35('0x7a')]=Trigger;
\ No newline at end of file
index b36ce5d..21d656d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x814b=['calleridname','toUpperCase','lodash','request-promise','md5','util','ioredis','./util','../../../../config/logger','desk','redis','defaults','localhost','emit','application/json','validateEmail','info','Getting\x20agent\x20with\x20email','format','%s/users','then','total_entries','find','_embedded','entries','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me','remoteUri','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','debug','[HTTP]','%s:%s','authType','token','username','Basic\x20%s','toString','base64','Searching\x20enduser\x20with\x20phone','%s/customers/search','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/customers','POST','work','map','length','string','nameField','toLowerCase','content','picklist','idField','customField','custom_fields','type','variableName','customVariable','Variable','name','priority','merge','getString','Subjects','xCALLY','CTI','concat','Tags','Descriptions','/api/v2/users/%d','user','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','Authorization','email','The\x20User\x20ID\x20is:','calleridnum','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','integrationTab','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','catch','error','stringify','recordingFormat','none','[OUTBOUND]','destcalleridnum','Displaying\x20ticket\x20to\x20agent...','unmanaged','lastevent'];(function(_0xc9a359,_0x8649a7){var _0x5e3dc9=function(_0x2a8be7){while(--_0x2a8be7){_0xc9a359['push'](_0xc9a359['shift']());}};_0x5e3dc9(++_0x8649a7);}(_0x814b,0x1a2));var _0xb814=function(_0xe84805,_0x2702d9){_0xe84805=_0xe84805-0x0;var _0x398efd=_0x814b[_0xe84805];return _0x398efd;};'use strict';var _=require(_0xb814('0x0'));var rp=require(_0xb814('0x1'));var md5=require(_0xb814('0x2'));var util=require(_0xb814('0x3'));var Redis=require(_0xb814('0x4'));var intUtil=require(_0xb814('0x5'));var config=require('../../../../config/environment');var logger=require(_0xb814('0x6'))(_0xb814('0x7'));config[_0xb814('0x8')]=_[_0xb814('0x9')](config[_0xb814('0x8')],{'host':_0xb814('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xb814('0x8')]));function emit(_0x2e6272,_0x5c8539,_0x271af9){io['to'](_0x2e6272)[_0xb814('0xb')](_0x5c8539,_0x271af9);}var headers={'Content-Type':_0xb814('0xc'),'Accept':_0xb814('0xc')};function getUser(_0x1fea33,_0x21d4a5){if(intUtil[_0xb814('0xd')](_0x21d4a5)===!![]){logger[_0xb814('0xe')](_0xb814('0xf'),_0x21d4a5);return request({'uri':util[_0xb814('0x10')](_0xb814('0x11'),_0x1fea33['remoteUri'])})[_0xb814('0x12')](function(_0x56278f){if(_0x56278f[_0xb814('0x13')]){return _[_0xb814('0x14')](_0x56278f[_0xb814('0x15')][_0xb814('0x16')],{'email':_0x21d4a5});}})[_0xb814('0x12')](function(_0x3bde14){if(_0x3bde14){logger[_0xb814('0xe')](_0xb814('0x17'));return _0x3bde14;}else{logger[_0xb814('0xe')](_0xb814('0x18'));return request({'uri':util[_0xb814('0x10')](_0xb814('0x19'),_0x1fea33[_0xb814('0x1a')])});}});}else{logger[_0xb814('0xe')](_0xb814('0x1b'));return request({'uri':util[_0xb814('0x10')](_0xb814('0x19'),_0x1fea33[_0xb814('0x1a')])});}}function request(_0x125ce2){logger[_0xb814('0x1c')](_0xb814('0x1d'),JSON['stringify'](_0x125ce2));return rp(_[_0xb814('0x9')](_0x125ce2,{'method':'GET','headers':headers,'json':!![]}));}function getAuth(_0x270598){var _0xfac75b;if(_0x270598['authType']==='basic'){_0xfac75b=util['format'](_0xb814('0x1e'),_0x270598['username'],_0x270598['password']);}else if(_0x270598[_0xb814('0x1f')]===_0xb814('0x20')){_0xfac75b=util[_0xb814('0x10')]('%s/token:%s',_0x270598[_0xb814('0x21')],_0x270598['token']);}return util[_0xb814('0x10')](_0xb814('0x22'),new Buffer(_0xfac75b)[_0xb814('0x23')](_0xb814('0x24')));}function getEndUser(_0x27352e,_0x2bd039,_0x1f5d40){logger['info'](_0xb814('0x25'),_0x1f5d40);return request({'uri':util['format'](_0xb814('0x26'),_0x27352e[_0xb814('0x1a')]),'qs':{'phone':_0x1f5d40}})[_0xb814('0x12')](function(_0x208927){if(_0x208927[_0xb814('0x13')]){logger[_0xb814('0xe')](_0xb814('0x27'));return _0x208927['_embedded'][_0xb814('0x16')][0x0];}else{logger[_0xb814('0xe')](_0xb814('0x28'));return request({'uri':util[_0xb814('0x10')](_0xb814('0x29'),_0x27352e[_0xb814('0x1a')]),'method':_0xb814('0x2a'),'body':{'first_name':_0x2bd039,'title':_0x2bd039,'phone_numbers':[{'type':_0xb814('0x2b'),'value':_0x1f5d40}]}});}});}function getTags(_0x5a6291,_0x271aa8){var _0x328a08=[];if(_0x5a6291&&_0x5a6291['length']>0x0){_0x328a08=_[_0xb814('0x2c')](_0x5a6291,_0x271aa8);}return _0x328a08;}function getCustomFields(_0x37d24d,_0x530744){var _0x499f22=[];var _0x20577b={'custom_fields':{}};if(_0x37d24d[_0xb814('0x2d')]>0x0){_['forEach'](_0x37d24d,function(_0x338a28){if(_['includes']([_0xb814('0x2e'),'picklist'],_0x338a28['type'])&&_0x338a28[_0xb814('0x2f')]&&!_0x338a28['customField']){_0x20577b[_0x338a28[_0xb814('0x2f')][_0xb814('0x30')]()]=_0x338a28[_0xb814('0x31')]['toString']();}else if(_['includes']([_0xb814('0x2e'),_0xb814('0x32')],_0x338a28['type'])&&_0x338a28[_0xb814('0x33')]&&_0x338a28[_0xb814('0x34')]){_0x20577b[_0xb814('0x35')][_0x338a28[_0xb814('0x33')]]=_0x338a28[_0xb814('0x31')][_0xb814('0x23')]();}else if(_0x338a28[_0xb814('0x36')]==='variable'&&_0x338a28[_0xb814('0x37')]&&_0x338a28[_0xb814('0x33')]&&_0x338a28[_0xb814('0x34')]){_0x530744[_0x338a28[_0xb814('0x37')]]&&(_0x20577b[_0xb814('0x35')][_0x338a28['idField']]=_0x530744[_0x338a28[_0xb814('0x37')]]['toString']());}else if(_0x338a28[_0xb814('0x36')]===_0xb814('0x38')&&_0x338a28[_0xb814('0x39')]&&_0x338a28['Variable'][_0xb814('0x3a')]&&_0x338a28[_0xb814('0x33')]&&_0x338a28['customField']){_0x530744[_0x338a28[_0xb814('0x39')][_0xb814('0x3a')][_0xb814('0x30')]()]&&(_0x20577b[_0xb814('0x35')][_0x338a28[_0xb814('0x33')]]=_0x530744[_0x338a28[_0xb814('0x39')]['name'][_0xb814('0x30')]()]['toString']());}});}if(_0x20577b[_0xb814('0x3b')]){_0x20577b['priority']=Number(_0x20577b[_0xb814('0x3b')]);}return _0x20577b;}function getTicket(_0x4b9233,_0x2f8a2e,_0x26675a,_0x54a7fb,_0x4d308a){logger['info']('Creating\x20new\x20ticket...');var _0x17549e=_[_0xb814('0x3c')]({'subject':intUtil[_0xb814('0x3d')](_0x54a7fb[_0xb814('0x3e')],_0x4d308a,'\x20'),'type':'phone','status':'new','labels':[_0xb814('0x3f'),'Motion',_0xb814('0x40')][_0xb814('0x41')](getTags(_0x54a7fb[_0xb814('0x42')],_0xb814('0x3a'))),'description':intUtil[_0xb814('0x3d')](_0x54a7fb[_0xb814('0x43')],_0x4d308a,'\x0a'),'_links':{'assigned_user':{'href':util[_0xb814('0x10')](_0xb814('0x44'),_0x2f8a2e['id']),'class':_0xb814('0x45')}},'message':{'direction':'in','body':intUtil['getString'](_0x54a7fb['Descriptions'],_0x4d308a,'\x0a')}},getCustomFields(_0x54a7fb['Fields'],_0x4d308a));return request({'uri':util[_0xb814('0x10')]('%s/customers/%d/cases',_0x4b9233[_0xb814('0x1a')],_0x26675a['id']),'method':'POST','body':_0x17549e});}exports[_0xb814('0x46')]=function(_0x44ff56,_0x9ef639,_0x2e97cc,_0x4fae23,_0x30fc57,_0x15f01a){var _0x2b23c7,_0x22cf27;_0x15f01a[_0xb814('0x1a')]=intUtil[_0xb814('0x47')](_0x15f01a['remoteUri']);_0x15f01a[_0xb814('0x48')]=intUtil[_0xb814('0x47')](_0x15f01a[_0xb814('0x48')]);if(_0x30fc57&&_0x30fc57[_0xb814('0x49')]){logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x4b'));_0x9ef639['recordingURL']=util['format'](_0xb814('0x4c'),_0x15f01a[_0xb814('0x48')],_0x9ef639[_0xb814('0x4d')],md5(_0x9ef639[_0xb814('0x4d')]));}else{_0x9ef639[_0xb814('0x4e')]='';}headers[_0xb814('0x4f')]=getAuth(_0x15f01a);return getUser(_0x15f01a,_0x4fae23[_0xb814('0x50')])[_0xb814('0x12')](function(_0x2eb9b6){_0x2b23c7=_0x2eb9b6;logger[_0xb814('0xe')](_0xb814('0x51'),_0x2b23c7['id']);return getEndUser(_0x15f01a,_0x9ef639['calleridname'],_0x9ef639[_0xb814('0x52')]);})[_0xb814('0x12')](function(_0x4a76bb){_0x22cf27=_0x4a76bb;logger[_0xb814('0xe')]('The\x20Enduser\x20ID\x20is:',_0x22cf27['id']);return getTicket(_0x15f01a,_0x2b23c7,_0x22cf27,_0x2e97cc,_0x9ef639);})[_0xb814('0x12')](function(_0x37866f){if(_0x37866f){logger[_0xb814('0xe')](_0xb814('0x53'));logger[_0xb814('0xe')](_0xb814('0x54'),_0x37866f['id']);switch(_0x15f01a[_0xb814('0x36')]){case _0xb814('0x55'):logger[_0xb814('0xe')](_0xb814('0x4a'),'Displaying\x20ticket\x20to\x20agent...');emit(util['format'](_0xb814('0x56'),_0x4fae23[_0xb814('0x3a')]),_0xb814('0x57'),{'recordId':_0x37866f['id']});break;case _0xb814('0x58'):logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x59'));emit(util['format'](_0xb814('0x56'),_0x4fae23[_0xb814('0x3a')]),_0xb814('0x5a'),{'uri':util['format'](_0xb814('0x5b'),_0x37866f['id'])});break;default:logger['error'](_0xb814('0x4a'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0xb814('0x5c')](function(_0x3cf8f8){console['error'](_0x3cf8f8);logger[_0xb814('0x5d')](_0xb814('0x4a'),JSON[_0xb814('0x5e')](_0x3cf8f8));});};exports['outbound']=function(_0x3da050,_0x5f0e58,_0x13bdcf,_0x158893,_0x4aed78,_0x39952d,_0x4a3f84){var _0x539be7,_0x3b9709;_0x39952d[_0xb814('0x1a')]=intUtil[_0xb814('0x47')](_0x39952d['remoteUri']);_0x39952d[_0xb814('0x48')]=intUtil['stripTrailingSlash'](_0x39952d[_0xb814('0x48')]);if(_0x4a3f84&&_0x4a3f84[_0xb814('0x5f')]&&_0x4a3f84['recordingFormat']!==_0xb814('0x60')){logger['info'](_0xb814('0x61'),_0xb814('0x4b'));_0x5f0e58[_0xb814('0x4e')]=util[_0xb814('0x10')](_0xb814('0x4c'),_0x39952d[_0xb814('0x48')],_0x5f0e58[_0xb814('0x4d')],md5(_0x5f0e58[_0xb814('0x4d')]));}headers['Authorization']=getAuth(_0x39952d);return getUser(_0x39952d,_0x158893[_0xb814('0x50')])[_0xb814('0x12')](function(_0x5d71d5){_0x539be7=_0x5d71d5;logger[_0xb814('0xe')](_0xb814('0x51'),_0x539be7['id']);return getEndUser(_0x39952d,_0x5f0e58['destcalleridname'],_0x5f0e58[_0xb814('0x62')]);})['then'](function(_0x48362c){_0x3b9709=_0x48362c;logger[_0xb814('0xe')]('The\x20Enduser\x20ID\x20is:',_0x3b9709['id']);return getTicket(_0x39952d,_0x539be7,_0x3b9709,_0x13bdcf,_0x5f0e58);})[_0xb814('0x12')](function(_0xd1cd8b){if(_0xd1cd8b){logger[_0xb814('0xe')]('Ticket\x20created!');logger[_0xb814('0xe')]('The\x20Ticket\x20ID\x20is:',_0xd1cd8b['id']);switch(_0x39952d[_0xb814('0x36')]){case _0xb814('0x55'):logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x63'));emit(util[_0xb814('0x10')](_0xb814('0x56'),_0x158893[_0xb814('0x3a')]),_0xb814('0x57'),{'recordId':_0xd1cd8b['id']});break;case'newTab':logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x59'));emit(util[_0xb814('0x10')](_0xb814('0x56'),_0x158893[_0xb814('0x3a')]),'trigger:browser:url',{'uri':util[_0xb814('0x10')]('%s/agent/tickets/%s',_0x39952d[_0xb814('0x1a')],_0xd1cd8b['id'])});break;default:logger[_0xb814('0x5d')](_0xb814('0x61'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0xb814('0x5c')](function(_0x579351){logger[_0xb814('0x5d')]('[OUTBOUND]',JSON[_0xb814('0x5e')](_0x579351));});};exports[_0xb814('0x64')]=function(_0xa03cd2,_0x1b024f,_0x3377d4,_0x167d82,_0x143518,_0x4d44e3){var _0x44088d,_0x51ca51;_0x4d44e3[_0xb814('0x1a')]=intUtil[_0xb814('0x47')](_0x4d44e3[_0xb814('0x1a')]);_0x4d44e3[_0xb814('0x48')]=intUtil[_0xb814('0x47')](_0x4d44e3[_0xb814('0x48')]);if(_0x143518&&_0x143518['monitor_format']){logger[_0xb814('0xe')]('['+_0x1b024f[_0xb814('0x65')]['toUpperCase']()+']',_0xb814('0x4b'));_0x1b024f[_0xb814('0x4e')]=util[_0xb814('0x10')](_0xb814('0x4c'),_0x4d44e3[_0xb814('0x48')],_0x1b024f['uniqueid'],md5(_0x1b024f[_0xb814('0x4d')]));}else{_0x1b024f['recordingURL']='';}headers[_0xb814('0x4f')]=getAuth(_0x4d44e3);return getUser(_0x4d44e3)[_0xb814('0x12')](function(_0x2645f6){_0x44088d=_0x2645f6;logger[_0xb814('0xe')](_0xb814('0x51'),_0x44088d['id']);return getEndUser(_0x4d44e3,_0x1b024f[_0xb814('0x66')],_0x1b024f['calleridnum']);})['then'](function(_0x5d064b){_0x51ca51=_0x5d064b;logger[_0xb814('0xe')]('The\x20Enduser\x20ID\x20is:',_0x51ca51['id']);return getTicket(_0x4d44e3,_0x44088d,_0x51ca51,_0x3377d4,_0x1b024f);})[_0xb814('0x12')](function(_0x1d3954){if(_0x1d3954){logger[_0xb814('0xe')]('Ticket\x20created!');logger[_0xb814('0xe')](_0xb814('0x54'),_0x1d3954['id']);}})[_0xb814('0x5c')](function(_0x5aabbe){logger[_0xb814('0x5d')]('['+_0x1b024f[_0xb814('0x65')][_0xb814('0x67')]()+']',JSON[_0xb814('0x5e')](_0x5aabbe));});};
\ No newline at end of file
+var _0x55ca=['debug','[HTTP]','stringify','GET','authType','basic','%s:%s','username','token','%s/token:%s','toString','base64','Searching\x20enduser\x20with\x20phone','Enduser\x20found!','_embedded','entries','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/customers','POST','length','forEach','includes','picklist','type','nameField','customField','toLowerCase','content','string','idField','custom_fields','variable','variableName','customVariable','Variable','name','priority','merge','xCALLY','Motion','CTI','concat','Tags','getString','Descriptions','/api/v2/users/%d','user','Fields','stripTrailingSlash','serverUrl','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','calleridname','calleridnum','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','integrationTab','user:%s','trigger:desk:display','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','error','Desk\x20account\x20type\x20not\x20recognized','outbound','recordingFormat','none','[OUTBOUND]','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent...','%s/agent/tickets/%s','catch','unmanaged','monitor_format','lastevent','toUpperCase','Recording\x20is\x20enabled!','lodash','request-promise','./util','../../../../config/environment','desk','redis','defaults','localhost','socket.io-emitter','application/json','validateEmail','info','Getting\x20agent\x20with\x20email','format','%s/users','remoteUri','then','total_entries','find','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me'];(function(_0x5c576b,_0x5e6fd4){var _0x359250=function(_0x44cbb6){while(--_0x44cbb6){_0x5c576b['push'](_0x5c576b['shift']());}};_0x359250(++_0x5e6fd4);}(_0x55ca,0x126));var _0xa55c=function(_0x2bbd2d,_0x37c3c4){_0x2bbd2d=_0x2bbd2d-0x0;var _0x257dc9=_0x55ca[_0x2bbd2d];return _0x257dc9;};'use strict';var _=require(_0xa55c('0x0'));var rp=require(_0xa55c('0x1'));var md5=require('md5');var util=require('util');var Redis=require('ioredis');var intUtil=require(_0xa55c('0x2'));var config=require(_0xa55c('0x3'));var logger=require('../../../../config/logger')(_0xa55c('0x4'));config[_0xa55c('0x5')]=_[_0xa55c('0x6')](config[_0xa55c('0x5')],{'host':_0xa55c('0x7'),'port':0x18eb});var io=require(_0xa55c('0x8'))(new Redis(config[_0xa55c('0x5')]));function emit(_0x4d0624,_0x2121fd,_0x2537f0){io['to'](_0x4d0624)['emit'](_0x2121fd,_0x2537f0);}var headers={'Content-Type':_0xa55c('0x9'),'Accept':_0xa55c('0x9')};function getUser(_0x52a3bc,_0x5849ad){if(intUtil[_0xa55c('0xa')](_0x5849ad)===!![]){logger[_0xa55c('0xb')](_0xa55c('0xc'),_0x5849ad);return request({'uri':util[_0xa55c('0xd')](_0xa55c('0xe'),_0x52a3bc[_0xa55c('0xf')])})[_0xa55c('0x10')](function(_0x70c2de){if(_0x70c2de[_0xa55c('0x11')]){return _[_0xa55c('0x12')](_0x70c2de['_embedded']['entries'],{'email':_0x5849ad});}})[_0xa55c('0x10')](function(_0x576044){if(_0x576044){logger['info']('Agent\x20found!');return _0x576044;}else{logger[_0xa55c('0xb')](_0xa55c('0x13'));return request({'uri':util[_0xa55c('0xd')](_0xa55c('0x14'),_0x52a3bc[_0xa55c('0xf')])});}});}else{logger[_0xa55c('0xb')]('Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xa55c('0xd')](_0xa55c('0x14'),_0x52a3bc[_0xa55c('0xf')])});}}function request(_0x31e10d){logger[_0xa55c('0x15')](_0xa55c('0x16'),JSON[_0xa55c('0x17')](_0x31e10d));return rp(_[_0xa55c('0x6')](_0x31e10d,{'method':_0xa55c('0x18'),'headers':headers,'json':!![]}));}function getAuth(_0x4cee3c){var _0x3d4c9e;if(_0x4cee3c[_0xa55c('0x19')]===_0xa55c('0x1a')){_0x3d4c9e=util[_0xa55c('0xd')](_0xa55c('0x1b'),_0x4cee3c[_0xa55c('0x1c')],_0x4cee3c['password']);}else if(_0x4cee3c['authType']===_0xa55c('0x1d')){_0x3d4c9e=util[_0xa55c('0xd')](_0xa55c('0x1e'),_0x4cee3c['username'],_0x4cee3c[_0xa55c('0x1d')]);}return util[_0xa55c('0xd')]('Basic\x20%s',new Buffer(_0x3d4c9e)[_0xa55c('0x1f')](_0xa55c('0x20')));}function getEndUser(_0x940f28,_0x1965f1,_0x234372){logger['info'](_0xa55c('0x21'),_0x234372);return request({'uri':util['format']('%s/customers/search',_0x940f28['remoteUri']),'qs':{'phone':_0x234372}})[_0xa55c('0x10')](function(_0x54b038){if(_0x54b038[_0xa55c('0x11')]){logger[_0xa55c('0xb')](_0xa55c('0x22'));return _0x54b038[_0xa55c('0x23')][_0xa55c('0x24')][0x0];}else{logger[_0xa55c('0xb')](_0xa55c('0x25'));return request({'uri':util[_0xa55c('0xd')](_0xa55c('0x26'),_0x940f28[_0xa55c('0xf')]),'method':_0xa55c('0x27'),'body':{'first_name':_0x1965f1,'title':_0x1965f1,'phone_numbers':[{'type':'work','value':_0x234372}]}});}});}function getTags(_0x430d55,_0x28814f){var _0x1c9f6b=[];if(_0x430d55&&_0x430d55[_0xa55c('0x28')]>0x0){_0x1c9f6b=_['map'](_0x430d55,_0x28814f);}return _0x1c9f6b;}function getCustomFields(_0x1377b0,_0x22f6b6){var _0x1b8388=[];var _0x201941={'custom_fields':{}};if(_0x1377b0[_0xa55c('0x28')]>0x0){_[_0xa55c('0x29')](_0x1377b0,function(_0x52d37f){if(_[_0xa55c('0x2a')](['string',_0xa55c('0x2b')],_0x52d37f[_0xa55c('0x2c')])&&_0x52d37f[_0xa55c('0x2d')]&&!_0x52d37f[_0xa55c('0x2e')]){_0x201941[_0x52d37f['nameField'][_0xa55c('0x2f')]()]=_0x52d37f[_0xa55c('0x30')][_0xa55c('0x1f')]();}else if(_[_0xa55c('0x2a')]([_0xa55c('0x31'),_0xa55c('0x2b')],_0x52d37f[_0xa55c('0x2c')])&&_0x52d37f[_0xa55c('0x32')]&&_0x52d37f[_0xa55c('0x2e')]){_0x201941[_0xa55c('0x33')][_0x52d37f[_0xa55c('0x32')]]=_0x52d37f['content']['toString']();}else if(_0x52d37f[_0xa55c('0x2c')]===_0xa55c('0x34')&&_0x52d37f['variableName']&&_0x52d37f[_0xa55c('0x32')]&&_0x52d37f[_0xa55c('0x2e')]){_0x22f6b6[_0x52d37f[_0xa55c('0x35')]]&&(_0x201941[_0xa55c('0x33')][_0x52d37f[_0xa55c('0x32')]]=_0x22f6b6[_0x52d37f[_0xa55c('0x35')]][_0xa55c('0x1f')]());}else if(_0x52d37f[_0xa55c('0x2c')]===_0xa55c('0x36')&&_0x52d37f['Variable']&&_0x52d37f['Variable']['name']&&_0x52d37f[_0xa55c('0x32')]&&_0x52d37f[_0xa55c('0x2e')]){_0x22f6b6[_0x52d37f[_0xa55c('0x37')]['name'][_0xa55c('0x2f')]()]&&(_0x201941['custom_fields'][_0x52d37f[_0xa55c('0x32')]]=_0x22f6b6[_0x52d37f['Variable'][_0xa55c('0x38')][_0xa55c('0x2f')]()][_0xa55c('0x1f')]());}});}if(_0x201941['priority']){_0x201941[_0xa55c('0x39')]=Number(_0x201941[_0xa55c('0x39')]);}return _0x201941;}function getTicket(_0x47e93c,_0x6f9c4c,_0x194e78,_0x4d9083,_0x529ff8){logger[_0xa55c('0xb')]('Creating\x20new\x20ticket...');var _0x1e75dc=_[_0xa55c('0x3a')]({'subject':intUtil['getString'](_0x4d9083['Subjects'],_0x529ff8,'\x20'),'type':'phone','status':'new','labels':[_0xa55c('0x3b'),_0xa55c('0x3c'),_0xa55c('0x3d')][_0xa55c('0x3e')](getTags(_0x4d9083[_0xa55c('0x3f')],'name')),'description':intUtil[_0xa55c('0x40')](_0x4d9083[_0xa55c('0x41')],_0x529ff8,'\x0a'),'_links':{'assigned_user':{'href':util[_0xa55c('0xd')](_0xa55c('0x42'),_0x6f9c4c['id']),'class':_0xa55c('0x43')}},'message':{'direction':'in','body':intUtil[_0xa55c('0x40')](_0x4d9083['Descriptions'],_0x529ff8,'\x0a')}},getCustomFields(_0x4d9083[_0xa55c('0x44')],_0x529ff8));return request({'uri':util['format']('%s/customers/%d/cases',_0x47e93c[_0xa55c('0xf')],_0x194e78['id']),'method':_0xa55c('0x27'),'body':_0x1e75dc});}exports['queue']=function(_0x2bd98b,_0x508bd3,_0x5f25f7,_0x2f8449,_0x3fea03,_0x1630ac){var _0x540337,_0x1b2708;_0x1630ac[_0xa55c('0xf')]=intUtil['stripTrailingSlash'](_0x1630ac[_0xa55c('0xf')]);_0x1630ac['serverUrl']=intUtil[_0xa55c('0x45')](_0x1630ac[_0xa55c('0x46')]);if(_0x3fea03&&_0x3fea03['monitor_format']){logger[_0xa55c('0xb')](_0xa55c('0x47'),'Recording\x20is\x20enabled!');_0x508bd3[_0xa55c('0x48')]=util[_0xa55c('0xd')](_0xa55c('0x49'),_0x1630ac['serverUrl'],_0x508bd3[_0xa55c('0x4a')],md5(_0x508bd3['uniqueid']));}else{_0x508bd3[_0xa55c('0x48')]='';}headers[_0xa55c('0x4b')]=getAuth(_0x1630ac);return getUser(_0x1630ac,_0x2f8449[_0xa55c('0x4c')])['then'](function(_0x41eab1){_0x540337=_0x41eab1;logger[_0xa55c('0xb')]('The\x20User\x20ID\x20is:',_0x540337['id']);return getEndUser(_0x1630ac,_0x508bd3[_0xa55c('0x4d')],_0x508bd3[_0xa55c('0x4e')]);})['then'](function(_0x11ff1d){_0x1b2708=_0x11ff1d;logger[_0xa55c('0xb')]('The\x20Enduser\x20ID\x20is:',_0x1b2708['id']);return getTicket(_0x1630ac,_0x540337,_0x1b2708,_0x5f25f7,_0x508bd3);})[_0xa55c('0x10')](function(_0x81cee8){if(_0x81cee8){logger[_0xa55c('0xb')](_0xa55c('0x4f'));logger['info'](_0xa55c('0x50'),_0x81cee8['id']);switch(_0x1630ac['type']){case _0xa55c('0x51'):logger[_0xa55c('0xb')](_0xa55c('0x47'),'Displaying\x20ticket\x20to\x20agent...');emit(util[_0xa55c('0xd')](_0xa55c('0x52'),_0x2f8449['name']),_0xa55c('0x53'),{'recordId':_0x81cee8['id']});break;case _0xa55c('0x54'):logger[_0xa55c('0xb')](_0xa55c('0x47'),_0xa55c('0x55'));emit(util[_0xa55c('0xd')](_0xa55c('0x52'),_0x2f8449[_0xa55c('0x38')]),_0xa55c('0x56'),{'uri':util[_0xa55c('0xd')]('https://xcally.desk.com/web/agent/case/%d',_0x81cee8['id'])});break;default:logger[_0xa55c('0x57')](_0xa55c('0x47'),_0xa55c('0x58'));}}})['catch'](function(_0x4c3095){console[_0xa55c('0x57')](_0x4c3095);logger['error'](_0xa55c('0x47'),JSON['stringify'](_0x4c3095));});};exports[_0xa55c('0x59')]=function(_0x228df4,_0x181802,_0x3f9313,_0x2ecf79,_0x5b1cf3,_0x44b7c1,_0x4607ca){var _0x4b85cc,_0x3929a6;_0x44b7c1[_0xa55c('0xf')]=intUtil[_0xa55c('0x45')](_0x44b7c1[_0xa55c('0xf')]);_0x44b7c1['serverUrl']=intUtil['stripTrailingSlash'](_0x44b7c1[_0xa55c('0x46')]);if(_0x4607ca&&_0x4607ca[_0xa55c('0x5a')]&&_0x4607ca[_0xa55c('0x5a')]!==_0xa55c('0x5b')){logger['info'](_0xa55c('0x5c'),'Recording\x20is\x20enabled!');_0x181802[_0xa55c('0x48')]=util[_0xa55c('0xd')](_0xa55c('0x49'),_0x44b7c1[_0xa55c('0x46')],_0x181802[_0xa55c('0x4a')],md5(_0x181802['uniqueid']));}headers[_0xa55c('0x4b')]=getAuth(_0x44b7c1);return getUser(_0x44b7c1,_0x2ecf79['email'])[_0xa55c('0x10')](function(_0x157afe){_0x4b85cc=_0x157afe;logger[_0xa55c('0xb')](_0xa55c('0x5d'),_0x4b85cc['id']);return getEndUser(_0x44b7c1,_0x181802[_0xa55c('0x5e')],_0x181802[_0xa55c('0x5f')]);})[_0xa55c('0x10')](function(_0x53e2be){_0x3929a6=_0x53e2be;logger[_0xa55c('0xb')](_0xa55c('0x60'),_0x3929a6['id']);return getTicket(_0x44b7c1,_0x4b85cc,_0x3929a6,_0x3f9313,_0x181802);})[_0xa55c('0x10')](function(_0x23a30e){if(_0x23a30e){logger[_0xa55c('0xb')]('Ticket\x20created!');logger[_0xa55c('0xb')](_0xa55c('0x50'),_0x23a30e['id']);switch(_0x44b7c1[_0xa55c('0x2c')]){case _0xa55c('0x51'):logger[_0xa55c('0xb')]('[QUEUE]',_0xa55c('0x61'));emit(util[_0xa55c('0xd')](_0xa55c('0x52'),_0x2ecf79[_0xa55c('0x38')]),_0xa55c('0x53'),{'recordId':_0x23a30e['id']});break;case'newTab':logger[_0xa55c('0xb')]('[QUEUE]',_0xa55c('0x55'));emit(util['format'](_0xa55c('0x52'),_0x2ecf79['name']),_0xa55c('0x56'),{'uri':util[_0xa55c('0xd')](_0xa55c('0x62'),_0x44b7c1[_0xa55c('0xf')],_0x23a30e['id'])});break;default:logger[_0xa55c('0x57')](_0xa55c('0x5c'),_0xa55c('0x58'));}}})[_0xa55c('0x63')](function(_0x14b515){logger[_0xa55c('0x57')]('[OUTBOUND]',JSON[_0xa55c('0x17')](_0x14b515));});};exports[_0xa55c('0x64')]=function(_0x4ef914,_0x18b928,_0x2b8b88,_0x3e3b4b,_0x9fe234,_0x1b8b06){var _0xa38271,_0x3cef1f;_0x1b8b06[_0xa55c('0xf')]=intUtil['stripTrailingSlash'](_0x1b8b06[_0xa55c('0xf')]);_0x1b8b06[_0xa55c('0x46')]=intUtil[_0xa55c('0x45')](_0x1b8b06[_0xa55c('0x46')]);if(_0x9fe234&&_0x9fe234[_0xa55c('0x65')]){logger[_0xa55c('0xb')]('['+_0x18b928[_0xa55c('0x66')][_0xa55c('0x67')]()+']',_0xa55c('0x68'));_0x18b928['recordingURL']=util[_0xa55c('0xd')](_0xa55c('0x49'),_0x1b8b06[_0xa55c('0x46')],_0x18b928[_0xa55c('0x4a')],md5(_0x18b928[_0xa55c('0x4a')]));}else{_0x18b928[_0xa55c('0x48')]='';}headers[_0xa55c('0x4b')]=getAuth(_0x1b8b06);return getUser(_0x1b8b06)[_0xa55c('0x10')](function(_0x2e4cf7){_0xa38271=_0x2e4cf7;logger[_0xa55c('0xb')](_0xa55c('0x5d'),_0xa38271['id']);return getEndUser(_0x1b8b06,_0x18b928['calleridname'],_0x18b928[_0xa55c('0x4e')]);})['then'](function(_0x1228a4){_0x3cef1f=_0x1228a4;logger[_0xa55c('0xb')](_0xa55c('0x60'),_0x3cef1f['id']);return getTicket(_0x1b8b06,_0xa38271,_0x3cef1f,_0x2b8b88,_0x18b928);})['then'](function(_0x4d9722){if(_0x4d9722){logger[_0xa55c('0xb')](_0xa55c('0x4f'));logger[_0xa55c('0xb')](_0xa55c('0x50'),_0x4d9722['id']);}})['catch'](function(_0x149cb9){logger[_0xa55c('0x57')]('['+_0x18b928[_0xa55c('0x66')][_0xa55c('0x67')]()+']',JSON[_0xa55c('0x17')](_0x149cb9));});};
\ No newline at end of file
index ffbea39..a8c7c62 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x108a=['substring','lastIndexOf','enduserId','destcalleridnum','contacts?$select=','&$filter=','\x20eq\x20\x27','%2b','contactid','nothing',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing',']\x20Enduser\x20created!','forEach','includes','picklist','nameField','customField','idField','ticketType','incident','incidents','Subjects','Descriptions','/contacts(','Fields','callDirection','queue','phonecalls','assign','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','trigger:browser:url','data7','stripTrailingSlash','serverUrl','unmanaged','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:','moduleCreate',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s','ticketId',']\x20Call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20Dynamics365\x20integration','request-promise','util','ioredis','../../../../config/logger','dynamics365','redis','defaults','socket.io-emitter','modernAuthentication','remoteUri','CloudProvider','tenantId','data2','POST','username','password','clientSecret','then','access_token','catch','error','toUpperCase',']\x20Wrong\x20credentials!','message','GET','Bearer\x20','4.0','value','isNil','validateEmail','email','userEmail','length','info',']\x20Agent\x20found\x20','systemuserid','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','internalemailaddress','toLowerCase','outbound','calleridnum','contacts','/systemusers(','headers','odata-entityid'];(function(_0x1dfda7,_0x4bde5c){var _0x5b38c4=function(_0x143c38){while(--_0x143c38){_0x1dfda7['push'](_0x1dfda7['shift']());}};_0x5b38c4(++_0x4bde5c);}(_0x108a,0x172));var _0xa108=function(_0x5645f2,_0x38bbee){_0x5645f2=_0x5645f2-0x0;var _0x163f6c=_0x108a[_0x5645f2];return _0x163f6c;};'use strict';var _=require('lodash');var rp=require(_0xa108('0x0'));var util=require(_0xa108('0x1'));var intUtil=require('./util');var md5=require('md5');var Redis=require(_0xa108('0x2'));var logger=require(_0xa108('0x3'))(_0xa108('0x4'));var config=require('../../../../config/environment');config[_0xa108('0x5')]=_[_0xa108('0x6')](config[_0xa108('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0xa108('0x7'))(new Redis(config[_0xa108('0x5')]));function getAuthToken(_0xe6d22b,_0x4066ae,_0x3e11d7){if(_0xe6d22b[_0xa108('0x8')]){_0xe6d22b[_0xa108('0x9')]=_0xe6d22b[_0xa108('0xa')]['data7'];_0xe6d22b[_0xa108('0xb')]=_0xe6d22b[_0xa108('0xa')][_0xa108('0xc')];return Promise['resolve'](_0xe6d22b[_0xa108('0xa')]['data5']);}var _0x3a4779={'method':_0xa108('0xd'),'uri':_0x4066ae,'form':{'client_id':_0xe6d22b['clientId'],'resource':_0xe6d22b[_0xa108('0x9')],'username':_0xe6d22b[_0xa108('0xe')],'password':_0xe6d22b[_0xa108('0xf')],'grant_type':_0xa108('0xf'),'client_secret':_0xe6d22b[_0xa108('0x10')]},'json':!![]};return rp(_0x3a4779)[_0xa108('0x11')](function(_0x397982){return _0x397982[_0xa108('0x12')];})[_0xa108('0x13')](function(_0x2f34a1){logger[_0xa108('0x14')]('['+[_0x3e11d7[_0xa108('0x15')]()]+_0xa108('0x16'));return _0x2f34a1[_0xa108('0x17')];});}function getUser(_0x34ccc7,_0x450471,_0x1fd43c,_0x46f9e6,_0x186fdb,_0x63bfb2){return new Promise(function(_0x191d89,_0x2232e9){return getAuthToken(_0x450471,_0x46f9e6,_0x63bfb2)[_0xa108('0x11')](function(_0x153aef){var _0x5c4f2d={'method':_0xa108('0x18'),'uri':_0x186fdb+'systemusers?$select=internalemailaddress,isdisabled,systemuserid','headers':{'Authorization':_0xa108('0x19')+_0x153aef,'OData-Version':_0xa108('0x1a')},'json':!![]};return rp(_0x5c4f2d);})['then'](function(_0x51654e){var _0x3e28a5=_0x51654e[_0xa108('0x1b')];var _0x5b90c0=![];var _0x53426c=null;if(!_[_0xa108('0x1c')](_0x1fd43c)){if(intUtil[_0xa108('0x1d')](_0x1fd43c[_0xa108('0x1e')])){_0x34ccc7[_0xa108('0x1f')]=_0x1fd43c['email'];for(_0x53426c=0x0;_0x53426c<_0x3e28a5[_0xa108('0x20')];_0x53426c++){if(_0x3e28a5[_0x53426c]['internalemailaddress']===_0x1fd43c[_0xa108('0x1e')]&&!_0x3e28a5[_0x53426c]['isdisabled']){_0x5b90c0=!![];logger[_0xa108('0x21')]('['+[_0x63bfb2[_0xa108('0x15')]()]+_0xa108('0x22')+_0x3e28a5[_0x53426c][_0xa108('0x23')]+'!');_0x34ccc7[_0xa108('0x24')]=_0x3e28a5[_0x53426c][_0xa108('0x23')];}}}}if(!_0x5b90c0){logger[_0xa108('0x21')]('['+[_0x63bfb2['toUpperCase']()]+_0xa108('0x25'));_0x34ccc7[_0xa108('0x1f')]=_0x450471[_0xa108('0xe')];for(_0x53426c=0x0;_0x53426c<_0x3e28a5[_0xa108('0x20')];_0x53426c++){if(_0x3e28a5[_0x53426c][_0xa108('0x26')]===_0x450471[_0xa108('0xe')]){_0x34ccc7['userId']=_0x3e28a5[_0x53426c]['systemuserid'];}}}_0x191d89(_0x34ccc7);})['catch'](function(_0x4c5fa4){_0x2232e9(_0x4c5fa4[_0xa108('0x17')]);});});}function createEndUser(_0x2dd857,_0xd48be4,_0xbee7e0,_0x2dfa83,_0x47f66a,_0x36a665){return new Promise(function(_0x457be7,_0x21dbc3){return getAuthToken(_0xd48be4,_0xbee7e0,_0x36a665)['then'](function(_0xc216a4){var _0x10cef6=_0x36a665[_0xa108('0x27')]()===_0xa108('0x28')?_0x47f66a['destcalleridnum']:_0x47f66a[_0xa108('0x29')];var _0xec579b={'method':_0xa108('0xd'),'uri':_0x2dfa83+_0xa108('0x2a'),'body':{'telephone1':_0x10cef6,'fullname':_0x10cef6,'firstname':_0x10cef6,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0xa108('0x2b')+_0x2dd857[_0xa108('0x24')]+')'},'headers':{'Authorization':_0xa108('0x19')+_0xc216a4,'OData-Version':_0xa108('0x1a')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0xec579b);})['then'](function(_0x5936f6){var _0x1e4299=_0x5936f6[_0xa108('0x2c')][_0xa108('0x2d')];var _0x4fc8fd=_0x1e4299[_0xa108('0x2e')](_0x1e4299[_0xa108('0x2f')]('(')+0x1,_0x1e4299[_0xa108('0x2f')](')'));_0x2dd857[_0xa108('0x30')]=_0x4fc8fd;_0x457be7(_0x2dd857);})[_0xa108('0x13')](function(_0x4043ec){_0x21dbc3(_0x4043ec[_0xa108('0x17')]);});});}function getEndUser(_0x23ae3f,_0x43facd,_0x150316,_0x23dd74,_0x47e723,_0x58a187,_0x395216,_0x1b35af){var _0x5350fe=_0x58a187[_0xa108('0x27')]()===_0xa108('0x28')?_0x47e723[_0xa108('0x31')]:_0x47e723[_0xa108('0x29')];return getAuthToken(_0x43facd,_0x150316,_0x58a187)[_0xa108('0x11')](function(_0x42fdee){var _0x5cbf3e={'method':'GET','uri':_0x23dd74+_0xa108('0x32')+_0x1b35af+_0xa108('0x33')+_0x1b35af+_0xa108('0x34')+_0x5350fe['replace']('+',_0xa108('0x35'))+'\x27','headers':{'Authorization':_0xa108('0x19')+_0x42fdee,'If-None-Match':null,'OData-Version':_0xa108('0x1a')},'json':!![]};return rp(_0x5cbf3e);})[_0xa108('0x11')](function(_0x5c3bfe){var _0x38c9b8=![];if(!_0x5c3bfe)return _0x38c9b8;var _0x24c696=_0x5c3bfe['value'];for(var _0x243ae1=0x0;_0x243ae1<_0x24c696[_0xa108('0x20')];_0x243ae1++){if(_0x24c696[_0x243ae1]['additionalSearchContact']===_0x5350fe){_0x38c9b8=!![];_0x23ae3f['enduserId']=_0x24c696[_0x243ae1][_0xa108('0x36')];}}return _0x38c9b8;})[_0xa108('0x11')](function(_0xfe7a2d){if(_0xfe7a2d)return _0x23ae3f;if(_0x395216===_0xa108('0x37')){logger[_0xa108('0x21')]('['+[_0x58a187[_0xa108('0x15')]()]+_0xa108('0x38'));return _0x23ae3f;}return createEndUser(_0x23ae3f,_0x43facd,_0x150316,_0x23dd74,_0x47e723,_0x58a187)[_0xa108('0x11')](function(_0x59bb40){logger[_0xa108('0x21')]('['+[_0x58a187[_0xa108('0x15')]()]+_0xa108('0x39'),_0x59bb40[_0xa108('0x30')]);return _0x59bb40;});});}function getCustomFields(_0x469feb,_0x1241eb,_0x46cd66){var _0x5b7385={};if(_0x469feb['length']>0x0){_[_0xa108('0x3a')](_0x469feb,function(_0x46f608){if(_[_0xa108('0x3b')](['string',_0xa108('0x3c')],_0x46f608['type'])&&_0x46f608[_0xa108('0x3d')]&&!_0x46f608[_0xa108('0x3e')]){var _0x5f257b=_0x46f608[_0xa108('0x3f')][_0xa108('0x27')]();var _0x329c2d=_0x5f257b['substring'](0x0,_0x5f257b['indexOf']('_'));var _0x4f4d21=_0x5f257b['substring'](_0x5f257b['indexOf']('_')+0x1);if(_0x329c2d===_0x46cd66){_0x5b7385[_0x4f4d21]=_0x46f608['content'];}}});}return _0x5b7385;}function getTicket(_0x540a60,_0x23cf8e,_0x52b924,_0x2b5487,_0x4fb116,_0x36175f,_0x36e56b){return new Promise(function(_0x3e812a,_0x5ed473){var _0x12ac4c;return getAuthToken(_0x23cf8e,_0x52b924,_0x36e56b)[_0xa108('0x11')](function(_0x357b2b){if(_0x36175f[_0xa108('0x40')]===_0xa108('0x41')){_0x12ac4c={'method':_0xa108('0xd'),'uri':_0x2b5487+_0xa108('0x42'),'body':Object['assign']({},{'title':intUtil['getString'](_0x36175f[_0xa108('0x43')],_0x4fb116,'\x20'),'description':intUtil['getString'](_0x36175f[_0xa108('0x44')],_0x4fb116,'\x0a'),'customerid_contact@odata.bind':_0x540a60[_0xa108('0x30')]?_0xa108('0x45')+_0x540a60[_0xa108('0x30')]+')':undefined,'ownerid@odata.bind':_0xa108('0x2b')+_0x540a60[_0xa108('0x24')]+')','caseorigincode':'1'},getCustomFields(_0x36175f[_0xa108('0x46')],_0x4fb116,_0x36175f[_0xa108('0x40')])),'headers':{'Authorization':'Bearer\x20'+_0x357b2b,'OData-Version':_0xa108('0x1a')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x36175f[_0xa108('0x40')]==='phonecall'){var _0x3f9023=_0x540a60[_0xa108('0x30')]?[{'partyid_systemuser@odata.bind':_0xa108('0x2b')+_0x540a60[_0xa108('0x24')]+')','participationtypemask':_0x540a60[_0xa108('0x47')]==='queue'?0x2:0x1},{'partyid_contact@odata.bind':_0xa108('0x45')+_0x540a60[_0xa108('0x30')]+')','participationtypemask':_0x540a60[_0xa108('0x47')]===_0xa108('0x48')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0xa108('0x2b')+_0x540a60[_0xa108('0x24')]+')','participationtypemask':_0x540a60[_0xa108('0x47')]===_0xa108('0x48')?0x2:0x1}];_0x12ac4c={'method':_0xa108('0xd'),'uri':_0x2b5487+_0xa108('0x49'),'body':Object[_0xa108('0x4a')]({},{'subject':intUtil['getString'](_0x36175f[_0xa108('0x43')],_0x4fb116,'\x20'),'phonenumber':String(_0x4fb116[_0xa108('0x29')]),'description':intUtil['getString'](_0x36175f['Descriptions'],_0x4fb116,'\x0a'),'regardingobjectid_contact@odata.bind':_0x540a60[_0xa108('0x30')]?'/contacts('+_0x540a60[_0xa108('0x30')]+')':undefined,'ownerid@odata.bind':_0xa108('0x2b')+_0x540a60['userId']+')','directioncode':_0x540a60[_0xa108('0x47')]===_0xa108('0x48')?![]:!![],'phonecall_activity_parties':_0x3f9023},getCustomFields(_0x36175f[_0xa108('0x46')],_0x4fb116,_0x36175f[_0xa108('0x40')])),'headers':{'Authorization':'Bearer\x20'+_0x357b2b,'OData-Version':_0xa108('0x1a')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x12ac4c);})[_0xa108('0x11')](function(_0x48a162){var _0x2b857f=_0x48a162['headers'][_0xa108('0x2d')];var _0x2ce7ec=_0x2b857f['substring'](_0x2b857f[_0xa108('0x2f')]('(')+0x1,_0x2b857f[_0xa108('0x2f')](')'));_0x540a60['ticketId']=_0x2ce7ec;_0x3e812a(_0x540a60);})[_0xa108('0x13')](function(_0x399356){_0x5ed473(_0x399356[_0xa108('0x17')]);});});}function emit(_0x3546b0,_0x1765fd,_0x446c03,_0x1f2cf2){var _0x172259={'uri':util[_0xa108('0x4b')](_0xa108('0x4c'),_0x3546b0,_0x446c03,_0x1f2cf2)};io['to'](util['format'](_0xa108('0x4d'),_0x1765fd))['emit'](_0xa108('0x4e'),_0x172259);}exports['cs']=function(_0x4c613f,_0x457469,_0x5a7459,_0x50b751,_0x5ad858,_0x2f5557,_0xbf5f55,_0xc27397){var _0x267b52={};_0x2f5557['remoteUri']=_0x2f5557[_0xa108('0x8')]?intUtil['stripTrailingSlash'](_0x2f5557['CloudProvider'][_0xa108('0x4f')]):intUtil['stripTrailingSlash'](_0x2f5557[_0xa108('0x9')]);_0x2f5557['serverUrl']=intUtil[_0xa108('0x50')](_0x2f5557[_0xa108('0x51')]);_0x267b52[_0xa108('0x47')]=_0xc27397===_0xa108('0x48')||_0xc27397===_0xa108('0x52')?'queue':_0xa108('0x28');var _0x48c438=_0x2f5557[_0xa108('0x8')]?util[_0xa108('0x4b')](_0xa108('0x53'),_0x2f5557[_0xa108('0xa')]['data7']):util[_0xa108('0x4b')]('%s/api/data/v9.0/',_0x2f5557['remoteUri']);var _0x5bf1c8=util[_0xa108('0x4b')](_0xa108('0x54'),_0x2f5557[_0xa108('0xb')]);var _0x5ba042=util[_0xa108('0x4b')](_0xa108('0x55'),_0x2f5557[_0xa108('0x51')],_0x457469[_0xa108('0x56')],md5(_0x457469[_0xa108('0x56')]));if(_0x5ad858&&_0x5ad858[_0xa108('0x57')]){logger[_0xa108('0x21')](_0xa108('0x58'),_0xa108('0x59'));_0x457469[_0xa108('0x5a')]=_0x5ba042;}else if(_0xbf5f55&&_0xbf5f55[_0xa108('0x5b')]&&_0xbf5f55[_0xa108('0x5b')]!==_0xa108('0x5c')){logger[_0xa108('0x21')](_0xa108('0x5d'),_0xa108('0x59'));_0x457469[_0xa108('0x5a')]=_0x5ba042;}else{_0x457469[_0xa108('0x5a')]='';}return getUser(_0x267b52,_0x2f5557,_0x50b751,_0x5bf1c8,_0x48c438,_0xc27397)[_0xa108('0x11')](function(_0x3a4261){logger[_0xa108('0x21')]('['+_0xc27397[_0xa108('0x15')]()+_0xa108('0x5e'),_0x3a4261[_0xa108('0x24')]);logger[_0xa108('0x21')]('['+_0xc27397['toUpperCase']()+_0xa108('0x5f'),_0x3a4261['userEmail']);return getEndUser(_0x3a4261,_0x2f5557,_0x5bf1c8,_0x48c438,_0x457469,_0xc27397,_0x5a7459[_0xa108('0x60')],_0x5a7459['additionalSearchContact']);})[_0xa108('0x11')](function(_0x27f166){logger[_0xa108('0x21')]('['+_0xc27397[_0xa108('0x15')]()+_0xa108('0x61'),_0x27f166[_0xa108('0x30')]);logger[_0xa108('0x21')]('['+_0xc27397[_0xa108('0x15')]()+_0xa108('0x62'),_0x457469[_0xa108('0x29')]);return getTicket(_0x27f166,_0x2f5557,_0x5bf1c8,_0x48c438,_0x457469,_0x5a7459,_0xc27397);})[_0xa108('0x11')](function(_0x6b08e6){logger[_0xa108('0x21')](util[_0xa108('0x4b')]('['+_0xc27397[_0xa108('0x15')]()+_0xa108('0x63'),_0x5a7459[_0xa108('0x40')],_0x6b08e6[_0xa108('0x64')]));logger[_0xa108('0x21')](util['format']('['+_0xc27397['toUpperCase']()+_0xa108('0x65'),_0xc27397));if(_0xc27397!=='unmanaged'){logger[_0xa108('0x21')]('['+_0xc27397[_0xa108('0x15')]()+']',_0xa108('0x66'));emit(_0x2f5557['remoteUri'],_0x50b751['name'],_0x5a7459['ticketType'],_0x6b08e6[_0xa108('0x64')]);}})[_0xa108('0x13')](function(_0x51dd72){logger[_0xa108('0x14')]('['+_0xc27397[_0xa108('0x15')]()+_0xa108('0x67'),_0x51dd72['message']);});};
\ No newline at end of file
+var _0x691c=['incident','incidents','assign','Subjects','getString','Descriptions','Fields','phonecall','callDirection','queue','phonecalls','ticketType','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','emit','stripTrailingSlash','serverUrl','unmanaged','outbound','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','name','lodash','util','md5','ioredis','../../../../config/logger','dynamics365','redis','defaults','localhost','socket.io-emitter','modernAuthentication','remoteUri','CloudProvider','data7','tenantId','data5','POST','clientId','password','then','access_token','catch','error','toUpperCase',']\x20Wrong\x20credentials!','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','4.0','value','isNil','validateEmail','userEmail','email','isdisabled','info',']\x20Agent\x20found\x20','systemuserid','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','username','length','internalemailaddress','toLowerCase','destcalleridnum','contacts','/systemusers(','headers','odata-entityid','substring','lastIndexOf','enduserId','calleridnum','telephone1','%2b','Bearer\x20','nothing',']\x20Enduser\x20created!','forEach','includes','string','type','nameField','indexOf','content'];(function(_0x1677e3,_0x5eb8b1){var _0x1bb8e6=function(_0x5dee9e){while(--_0x5dee9e){_0x1677e3['push'](_0x1677e3['shift']());}};_0x1bb8e6(++_0x5eb8b1);}(_0x691c,0x14b));var _0xc691=function(_0x180890,_0x4bc2cd){_0x180890=_0x180890-0x0;var _0x4f4d0f=_0x691c[_0x180890];return _0x4f4d0f;};'use strict';var _=require(_0xc691('0x0'));var rp=require('request-promise');var util=require(_0xc691('0x1'));var intUtil=require('./util');var md5=require(_0xc691('0x2'));var Redis=require(_0xc691('0x3'));var logger=require(_0xc691('0x4'))(_0xc691('0x5'));var config=require('../../../../config/environment');config[_0xc691('0x6')]=_[_0xc691('0x7')](config[_0xc691('0x6')],{'host':_0xc691('0x8'),'port':0x18eb});var io=require(_0xc691('0x9'))(new Redis(config[_0xc691('0x6')]));function getAuthToken(_0x1f79ed,_0x4daa83,_0x514c23){if(_0x1f79ed[_0xc691('0xa')]){_0x1f79ed[_0xc691('0xb')]=_0x1f79ed[_0xc691('0xc')][_0xc691('0xd')];_0x1f79ed[_0xc691('0xe')]=_0x1f79ed[_0xc691('0xc')]['data2'];return Promise['resolve'](_0x1f79ed[_0xc691('0xc')][_0xc691('0xf')]);}var _0x344378={'method':_0xc691('0x10'),'uri':_0x4daa83,'form':{'client_id':_0x1f79ed[_0xc691('0x11')],'resource':_0x1f79ed[_0xc691('0xb')],'username':_0x1f79ed['username'],'password':_0x1f79ed[_0xc691('0x12')],'grant_type':_0xc691('0x12'),'client_secret':_0x1f79ed['clientSecret']},'json':!![]};return rp(_0x344378)[_0xc691('0x13')](function(_0x4810f8){return _0x4810f8[_0xc691('0x14')];})[_0xc691('0x15')](function(_0x116534){logger[_0xc691('0x16')]('['+[_0x514c23[_0xc691('0x17')]()]+_0xc691('0x18'));return _0x116534[_0xc691('0x19')];});}function getUser(_0x518bc0,_0x41bf73,_0x33f2db,_0x496eac,_0x5b1cdd,_0x22f0c9){return new Promise(function(_0x225a6b,_0x29d1a7){return getAuthToken(_0x41bf73,_0x496eac,_0x22f0c9)[_0xc691('0x13')](function(_0x6c749a){var _0x2e99af={'method':_0xc691('0x1a'),'uri':_0x5b1cdd+_0xc691('0x1b'),'headers':{'Authorization':'Bearer\x20'+_0x6c749a,'OData-Version':_0xc691('0x1c')},'json':!![]};return rp(_0x2e99af);})[_0xc691('0x13')](function(_0x29e616){var _0x2da4ab=_0x29e616[_0xc691('0x1d')];var _0x39d394=![];var _0x32eadb=null;if(!_[_0xc691('0x1e')](_0x33f2db)){if(intUtil[_0xc691('0x1f')](_0x33f2db['email'])){_0x518bc0[_0xc691('0x20')]=_0x33f2db[_0xc691('0x21')];for(_0x32eadb=0x0;_0x32eadb<_0x2da4ab['length'];_0x32eadb++){if(_0x2da4ab[_0x32eadb]['internalemailaddress']===_0x33f2db[_0xc691('0x21')]&&!_0x2da4ab[_0x32eadb][_0xc691('0x22')]){_0x39d394=!![];logger[_0xc691('0x23')]('['+[_0x22f0c9['toUpperCase']()]+_0xc691('0x24')+_0x2da4ab[_0x32eadb][_0xc691('0x25')]+'!');_0x518bc0[_0xc691('0x26')]=_0x2da4ab[_0x32eadb][_0xc691('0x25')];}}}}if(!_0x39d394){logger[_0xc691('0x23')]('['+[_0x22f0c9[_0xc691('0x17')]()]+_0xc691('0x27'));_0x518bc0[_0xc691('0x20')]=_0x41bf73[_0xc691('0x28')];for(_0x32eadb=0x0;_0x32eadb<_0x2da4ab[_0xc691('0x29')];_0x32eadb++){if(_0x2da4ab[_0x32eadb][_0xc691('0x2a')]===_0x41bf73[_0xc691('0x28')]){_0x518bc0[_0xc691('0x26')]=_0x2da4ab[_0x32eadb][_0xc691('0x25')];}}}_0x225a6b(_0x518bc0);})['catch'](function(_0x47fa89){_0x29d1a7(_0x47fa89[_0xc691('0x19')]);});});}function createEndUser(_0x3a0901,_0x13c2e5,_0x3b5dc2,_0x5511b9,_0x3d213d,_0x1e7650){return new Promise(function(_0x247672,_0x45812b){return getAuthToken(_0x13c2e5,_0x3b5dc2,_0x1e7650)['then'](function(_0x3ae558){var _0x517bc7=_0x1e7650[_0xc691('0x2b')]()==='outbound'?_0x3d213d[_0xc691('0x2c')]:_0x3d213d['calleridnum'];var _0x5d08e2={'method':_0xc691('0x10'),'uri':_0x5511b9+_0xc691('0x2d'),'body':{'telephone1':_0x517bc7,'fullname':_0x517bc7,'firstname':_0x517bc7,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0xc691('0x2e')+_0x3a0901['userId']+')'},'headers':{'Authorization':'Bearer\x20'+_0x3ae558,'OData-Version':_0xc691('0x1c')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x5d08e2);})[_0xc691('0x13')](function(_0x3daa49){var _0x516fc1=_0x3daa49[_0xc691('0x2f')][_0xc691('0x30')];var _0xb2614f=_0x516fc1[_0xc691('0x31')](_0x516fc1[_0xc691('0x32')]('(')+0x1,_0x516fc1['lastIndexOf'](')'));_0x3a0901[_0xc691('0x33')]=_0xb2614f;_0x247672(_0x3a0901);})['catch'](function(_0x3bfa5e){_0x45812b(_0x3bfa5e[_0xc691('0x19')]);});});}function getEndUser(_0x165b83,_0x170094,_0x2d3c09,_0x55613b,_0x403b84,_0x12f2ff,_0x3cc189,_0x1e9901){var _0x4724a8=_0x12f2ff[_0xc691('0x2b')]()==='outbound'?_0x403b84['destcalleridnum']:_0x403b84[_0xc691('0x34')];return getAuthToken(_0x170094,_0x2d3c09,_0x12f2ff)[_0xc691('0x13')](function(_0x1ca680){_0x1e9901=_0x1e9901?_0x1e9901:_0xc691('0x35');var _0x2afb55={'method':_0xc691('0x1a'),'uri':_0x55613b+'contacts?$select='+_0x1e9901+'&$filter='+_0x1e9901+'\x20eq\x20\x27'+_0x4724a8['replace']('+',_0xc691('0x36'))+'\x27','headers':{'Authorization':_0xc691('0x37')+_0x1ca680,'If-None-Match':null,'OData-Version':_0xc691('0x1c')},'json':!![]};return rp(_0x2afb55);})[_0xc691('0x13')](function(_0xdcdee0){var _0x1f239d=![];if(!_0xdcdee0)return _0x1f239d;var _0x5e2dba=_0xdcdee0[_0xc691('0x1d')];for(var _0x25c83d=0x0;_0x25c83d<_0x5e2dba[_0xc691('0x29')];_0x25c83d++){if(_0x5e2dba[_0x25c83d]['additionalSearchContact']===_0x4724a8){_0x1f239d=!![];_0x165b83[_0xc691('0x33')]=_0x5e2dba[_0x25c83d]['contactid'];}}return _0x1f239d;})[_0xc691('0x13')](function(_0x541f43){if(_0x541f43)return _0x165b83;if(_0x3cc189===_0xc691('0x38')){logger['info']('['+[_0x12f2ff['toUpperCase']()]+']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing');return _0x165b83;}return createEndUser(_0x165b83,_0x170094,_0x2d3c09,_0x55613b,_0x403b84,_0x12f2ff)[_0xc691('0x13')](function(_0x357d5b){logger[_0xc691('0x23')]('['+[_0x12f2ff[_0xc691('0x17')]()]+_0xc691('0x39'),_0x357d5b[_0xc691('0x33')]);return _0x357d5b;});});}function getCustomFields(_0x45164f,_0x18ac59,_0x272c85){var _0x4bbc6e={};if(_0x45164f[_0xc691('0x29')]>0x0){_[_0xc691('0x3a')](_0x45164f,function(_0x281b6d){if(_[_0xc691('0x3b')]([_0xc691('0x3c'),'picklist'],_0x281b6d[_0xc691('0x3d')])&&_0x281b6d[_0xc691('0x3e')]&&!_0x281b6d['customField']){var _0x8bf003=_0x281b6d['idField'][_0xc691('0x2b')]();var _0x19ec31=_0x8bf003[_0xc691('0x31')](0x0,_0x8bf003['indexOf']('_'));var _0x56c0c3=_0x8bf003[_0xc691('0x31')](_0x8bf003[_0xc691('0x3f')]('_')+0x1);if(_0x19ec31===_0x272c85){_0x4bbc6e[_0x56c0c3]=_0x281b6d[_0xc691('0x40')];}}});}return _0x4bbc6e;}function getTicket(_0xacfcb2,_0x3b9354,_0x20e390,_0xea05ee,_0x29ccb3,_0x1af436,_0x195657){return new Promise(function(_0x41818f,_0xdd3ed3){var _0x5e1268;return getAuthToken(_0x3b9354,_0x20e390,_0x195657)[_0xc691('0x13')](function(_0x21be00){if(_0x1af436['ticketType']===_0xc691('0x41')){_0x5e1268={'method':'POST','uri':_0xea05ee+_0xc691('0x42'),'body':Object[_0xc691('0x43')]({},{'title':intUtil['getString'](_0x1af436[_0xc691('0x44')],_0x29ccb3,'\x20'),'description':intUtil[_0xc691('0x45')](_0x1af436[_0xc691('0x46')],_0x29ccb3,'\x0a'),'customerid_contact@odata.bind':_0xacfcb2['enduserId']?'/contacts('+_0xacfcb2[_0xc691('0x33')]+')':undefined,'ownerid@odata.bind':_0xc691('0x2e')+_0xacfcb2[_0xc691('0x26')]+')','caseorigincode':'1'},getCustomFields(_0x1af436[_0xc691('0x47')],_0x29ccb3,_0x1af436['ticketType'])),'headers':{'Authorization':'Bearer\x20'+_0x21be00,'OData-Version':_0xc691('0x1c')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x1af436['ticketType']===_0xc691('0x48')){var _0x3a6a8d=_0xacfcb2['enduserId']?[{'partyid_systemuser@odata.bind':_0xc691('0x2e')+_0xacfcb2['userId']+')','participationtypemask':_0xacfcb2[_0xc691('0x49')]===_0xc691('0x4a')?0x2:0x1},{'partyid_contact@odata.bind':'/contacts('+_0xacfcb2[_0xc691('0x33')]+')','participationtypemask':_0xacfcb2['callDirection']===_0xc691('0x4a')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':'/systemusers('+_0xacfcb2['userId']+')','participationtypemask':_0xacfcb2[_0xc691('0x49')]===_0xc691('0x4a')?0x2:0x1}];_0x5e1268={'method':_0xc691('0x10'),'uri':_0xea05ee+_0xc691('0x4b'),'body':Object[_0xc691('0x43')]({},{'subject':intUtil[_0xc691('0x45')](_0x1af436[_0xc691('0x44')],_0x29ccb3,'\x20'),'phonenumber':String(_0x29ccb3[_0xc691('0x34')]),'description':intUtil[_0xc691('0x45')](_0x1af436[_0xc691('0x46')],_0x29ccb3,'\x0a'),'regardingobjectid_contact@odata.bind':_0xacfcb2[_0xc691('0x33')]?'/contacts('+_0xacfcb2[_0xc691('0x33')]+')':undefined,'ownerid@odata.bind':_0xc691('0x2e')+_0xacfcb2[_0xc691('0x26')]+')','directioncode':_0xacfcb2['callDirection']===_0xc691('0x4a')?![]:!![],'phonecall_activity_parties':_0x3a6a8d},getCustomFields(_0x1af436[_0xc691('0x47')],_0x29ccb3,_0x1af436[_0xc691('0x4c')])),'headers':{'Authorization':_0xc691('0x37')+_0x21be00,'OData-Version':_0xc691('0x1c')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x5e1268);})[_0xc691('0x13')](function(_0x78ae){var _0x182426=_0x78ae[_0xc691('0x2f')]['odata-entityid'];var _0x3322a5=_0x182426[_0xc691('0x31')](_0x182426[_0xc691('0x32')]('(')+0x1,_0x182426['lastIndexOf'](')'));_0xacfcb2[_0xc691('0x4d')]=_0x3322a5;_0x41818f(_0xacfcb2);})['catch'](function(_0xeda0a6){_0xdd3ed3(_0xeda0a6['message']);});});}function emit(_0x40d7d4,_0x351913,_0x3942b2,_0x2072af){var _0x16160f={'uri':util[_0xc691('0x4e')](_0xc691('0x4f'),_0x40d7d4,_0x3942b2,_0x2072af)};io['to'](util[_0xc691('0x4e')]('user:%s',_0x351913))[_0xc691('0x50')]('trigger:browser:url',_0x16160f);}exports['cs']=function(_0x5d82dc,_0x3c7bc7,_0x3fa158,_0xd8095,_0x137e0c,_0x1ac493,_0x130be0,_0x3c393f){var _0x26f840={};_0x1ac493[_0xc691('0xb')]=_0x1ac493[_0xc691('0xa')]?intUtil[_0xc691('0x51')](_0x1ac493[_0xc691('0xc')][_0xc691('0xd')]):intUtil[_0xc691('0x51')](_0x1ac493[_0xc691('0xb')]);_0x1ac493[_0xc691('0x52')]=intUtil[_0xc691('0x51')](_0x1ac493[_0xc691('0x52')]);_0x26f840[_0xc691('0x49')]=_0x3c393f==='queue'||_0x3c393f===_0xc691('0x53')?'queue':_0xc691('0x54');var _0x94bc42=_0x1ac493[_0xc691('0xa')]?util['format'](_0xc691('0x55'),_0x1ac493['CloudProvider'][_0xc691('0xd')]):util[_0xc691('0x4e')]('%s/api/data/v9.0/',_0x1ac493['remoteUri']);var _0x3de3c3=util[_0xc691('0x4e')](_0xc691('0x56'),_0x1ac493[_0xc691('0xe')]);var _0x5b7ba3=util[_0xc691('0x4e')](_0xc691('0x57'),_0x1ac493[_0xc691('0x52')],_0x3c7bc7[_0xc691('0x58')],md5(_0x3c7bc7[_0xc691('0x58')]));if(_0x137e0c&&_0x137e0c[_0xc691('0x59')]){logger[_0xc691('0x23')](_0xc691('0x5a'),_0xc691('0x5b'));_0x3c7bc7[_0xc691('0x5c')]=_0x5b7ba3;}else if(_0x130be0&&_0x130be0[_0xc691('0x5d')]&&_0x130be0['recordingFormat']!==_0xc691('0x5e')){logger[_0xc691('0x23')](_0xc691('0x5f'),_0xc691('0x5b'));_0x3c7bc7['recordingURL']=_0x5b7ba3;}else{_0x3c7bc7[_0xc691('0x5c')]='';}return getUser(_0x26f840,_0x1ac493,_0xd8095,_0x3de3c3,_0x94bc42,_0x3c393f)[_0xc691('0x13')](function(_0x528417){logger['info']('['+_0x3c393f[_0xc691('0x17')]()+']\x20The\x20User\x20ID\x20is:',_0x528417[_0xc691('0x26')]);logger[_0xc691('0x23')]('['+_0x3c393f[_0xc691('0x17')]()+']\x20The\x20User\x20email\x20is:',_0x528417[_0xc691('0x20')]);return getEndUser(_0x528417,_0x1ac493,_0x3de3c3,_0x94bc42,_0x3c7bc7,_0x3c393f,_0x3fa158['moduleCreate'],_0x3fa158['additionalSearchContact']);})[_0xc691('0x13')](function(_0x313376){logger[_0xc691('0x23')]('['+_0x3c393f['toUpperCase']()+']\x20The\x20Enduser\x20ID\x20is:',_0x313376[_0xc691('0x33')]);logger[_0xc691('0x23')]('['+_0x3c393f[_0xc691('0x17')]()+']\x20The\x20Enduser\x20phone\x20is:',_0x3c7bc7[_0xc691('0x34')]);return getTicket(_0x313376,_0x1ac493,_0x3de3c3,_0x94bc42,_0x3c7bc7,_0x3fa158,_0x3c393f);})[_0xc691('0x13')](function(_0x523ed1){logger[_0xc691('0x23')](util[_0xc691('0x4e')]('['+_0x3c393f[_0xc691('0x17')]()+_0xc691('0x60'),_0x3fa158['ticketType'],_0x523ed1[_0xc691('0x4d')]));logger['info'](util[_0xc691('0x4e')]('['+_0x3c393f[_0xc691('0x17')]()+_0xc691('0x61'),_0x3c393f));if(_0x3c393f!==_0xc691('0x53')){logger[_0xc691('0x23')]('['+_0x3c393f[_0xc691('0x17')]()+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x1ac493[_0xc691('0xb')],_0xd8095[_0xc691('0x62')],_0x3fa158['ticketType'],_0x523ed1['ticketId']);}})[_0xc691('0x15')](function(_0x31ad86){logger['error']('['+_0x3c393f[_0xc691('0x17')]()+']\x20Error\x20running\x20Dynamics365\x20integration',_0x31ad86[_0xc691('0x19')]);});};
\ No newline at end of file
index 2e0a694..1c4a23b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9af2=['queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','calleridnum','The\x20Enduser\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','catch','error','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','Authorization','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','unmanaged','lastevent','toUpperCase','lodash','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','localhost','socket.io-emitter','redis','application/json','info','Creating\x20new\x20ticket...','merge','format','Caller\x20-\x20%s','calleridname','getString','Descriptions','<br>','Tags','name','custom_fields','mapValues','keyBy','value','%s/api/v2/tickets','remoteUri','POST','then','Ticket\x20created!','validateEmail','length','Agent\x20found!','contact','email','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Enduser\x20found!','find','%s/api/v2/contacts','Enduser\x20created.','Basic\x20%s','apiKey','toString','base64','debug','stringify','defaults','map','forEach','includes','string','picklist','type','customField','nameField','toLowerCase','content','idField','push','variable','variableName','customVariable','Variable'];(function(_0x365bf7,_0xa084b4){var _0x213add=function(_0x3aeac0){while(--_0x3aeac0){_0x365bf7['push'](_0x365bf7['shift']());}};_0x213add(++_0xa084b4);}(_0x9af2,0xd8));var _0x29af=function(_0x29badb,_0x52bb91){_0x29badb=_0x29badb-0x0;var _0x4978e0=_0x9af2[_0x29badb];return _0x4978e0;};'use strict';var _=require(_0x29af('0x0'));var rp=require('request-promise');var md5=require(_0x29af('0x1'));var util=require(_0x29af('0x2'));var Redis=require(_0x29af('0x3'));var intUtil=require(_0x29af('0x4'));var config=require(_0x29af('0x5'));var logger=require(_0x29af('0x6'))('freshdesk');config['redis']=_['defaults'](config['redis'],{'host':_0x29af('0x7'),'port':0x18eb});var io=require(_0x29af('0x8'))(new Redis(config[_0x29af('0x9')]));var headers={'Content-Type':_0x29af('0xa'),'Accept':'application/json'};function emit(_0x1c325b,_0x11180b,_0x207a79){io['to'](_0x1c325b)['emit'](_0x11180b,_0x207a79);}function getTicket(_0x359a66,_0x55ee7c,_0x3bf295,_0x317391,_0x5c4080){logger[_0x29af('0xb')](_0x29af('0xc'));var _0x22bfce=_[_0x29af('0xd')]({'responder_id':_0x55ee7c['id'],'requester_id':_0x3bf295['id'],'name':util[_0x29af('0xe')](_0x29af('0xf'),_0x5c4080[_0x29af('0x10')]),'phone':_0x5c4080['calleridnum'],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil['getString'](_0x317391['Subjects'],_0x5c4080,'\x20'),'description':intUtil[_0x29af('0x11')](_0x317391[_0x29af('0x12')],_0x5c4080,_0x29af('0x13')),'tags':getTags(_0x317391[_0x29af('0x14')],_0x29af('0x15'))},getCustomFields(_0x317391['Fields'],_0x5c4080));_0x22bfce[_0x29af('0x16')]=_[_0x29af('0x17')](_[_0x29af('0x18')](_0x22bfce[_0x29af('0x16')],'id'),_0x29af('0x19'));return request({'uri':util[_0x29af('0xe')](_0x29af('0x1a'),_0x359a66[_0x29af('0x1b')]),'method':_0x29af('0x1c'),'body':_0x22bfce})[_0x29af('0x1d')](function(_0x209b07){logger[_0x29af('0xb')](_0x29af('0x1e'));return _0x209b07;});}function getUser(_0x217ba9,_0x212951){if(intUtil[_0x29af('0x1f')](_0x212951)){return request({'uri':util['format']('%s/api/v2/agents',_0x217ba9[_0x29af('0x1b')]),'qs':{'email':_0x212951}})['then'](function(_0x105c43){if(_0x105c43[_0x29af('0x20')]){logger[_0x29af('0xb')](_0x29af('0x21'));return _['find'](_0x105c43,function(_0x219203){return _0x219203[_0x29af('0x22')][_0x29af('0x23')]===_0x212951;});}else{logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x29af('0xe')](_0x29af('0x24'),_0x217ba9[_0x29af('0x1b')])})[_0x29af('0x1d')](function(_0x170180){logger[_0x29af('0xb')](_0x29af('0x25'));return _0x170180;});}});}else{logger['info'](_0x29af('0x26'));return request({'uri':util[_0x29af('0xe')]('%s/api/v2/agents/me',_0x217ba9[_0x29af('0x1b')])})['then'](function(_0x459696){logger[_0x29af('0xb')]('Admin\x20account\x20selected.');return _0x459696;});}}function getEndUser(_0x120a4c,_0x15b477,_0x8bcbe9){logger[_0x29af('0xb')]('Searching\x20enduser\x20with\x20phone',_0x8bcbe9);return request({'uri':util[_0x29af('0xe')]('%s/api/v2/contacts',_0x120a4c[_0x29af('0x1b')]),'qs':{'phone':_0x8bcbe9}})[_0x29af('0x1d')](function(_0x885249){if(_0x885249[_0x29af('0x20')]){logger[_0x29af('0xb')](_0x29af('0x27'));return _[_0x29af('0x28')](_0x885249,{'phone':_0x8bcbe9});}else{logger['info']('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0x29af('0xe')](_0x29af('0x29'),_0x120a4c['remoteUri']),'method':_0x29af('0x1c'),'body':{'name':_0x15b477,'phone':_0x8bcbe9}})[_0x29af('0x1d')](function(_0x260baf){logger[_0x29af('0xb')](_0x29af('0x2a'));return _0x260baf;});}});}function getAuth(_0x5c1915){return util[_0x29af('0xe')](_0x29af('0x2b'),new Buffer(_0x5c1915[_0x29af('0x2c')]+':X')[_0x29af('0x2d')](_0x29af('0x2e')));}function request(_0x300fc6){logger[_0x29af('0x2f')]('[HTTP]',JSON[_0x29af('0x30')](_0x300fc6));return rp(_[_0x29af('0x31')](_0x300fc6,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x25fb23,_0x1034c9){var _0x48ef37=[];if(_0x25fb23&&_0x25fb23['length']>0x0){_0x48ef37=_[_0x29af('0x32')](_0x25fb23,_0x1034c9);}return _0x48ef37;}function getCustomFields(_0x5a8e6e,_0x51d5eb){var _0xa55b1b=[];var _0x271a52={'custom_fields':[]};if(_0x5a8e6e[_0x29af('0x20')]>0x0){_[_0x29af('0x33')](_0x5a8e6e,function(_0x46e13b){if(_[_0x29af('0x34')]([_0x29af('0x35'),_0x29af('0x36')],_0x46e13b[_0x29af('0x37')])&&_0x46e13b['nameField']&&!_0x46e13b[_0x29af('0x38')]){_0x271a52[_0x46e13b[_0x29af('0x39')][_0x29af('0x3a')]()]=_0x46e13b[_0x29af('0x3b')][_0x29af('0x2d')]();}else if(_[_0x29af('0x34')]([_0x29af('0x35'),_0x29af('0x36')],_0x46e13b['type'])&&_0x46e13b[_0x29af('0x3c')]&&_0x46e13b[_0x29af('0x38')]){_0x271a52[_0x29af('0x16')][_0x29af('0x3d')]({'id':_0x46e13b[_0x29af('0x3c')],'value':_0x46e13b[_0x29af('0x3b')][_0x29af('0x2d')]()});}else if(_0x46e13b[_0x29af('0x37')]===_0x29af('0x3e')&&_0x46e13b[_0x29af('0x3f')]&&_0x46e13b['idField']&&_0x46e13b[_0x29af('0x38')]){_0x51d5eb[_0x46e13b[_0x29af('0x3f')]]&&_0x271a52['custom_fields'][_0x29af('0x3d')]({'id':_0x46e13b[_0x29af('0x3c')],'value':_0x51d5eb[_0x46e13b[_0x29af('0x3f')]][_0x29af('0x2d')]()});}else if(_0x46e13b[_0x29af('0x37')]===_0x29af('0x40')&&_0x46e13b[_0x29af('0x41')]&&_0x46e13b[_0x29af('0x41')][_0x29af('0x15')]&&_0x46e13b[_0x29af('0x3c')]&&_0x46e13b['customField']){_0x51d5eb[_0x46e13b[_0x29af('0x41')][_0x29af('0x15')][_0x29af('0x3a')]()]&&_0x271a52[_0x29af('0x16')]['push']({'id':_0x46e13b[_0x29af('0x3c')],'value':_0x51d5eb[_0x46e13b[_0x29af('0x41')]['name'][_0x29af('0x3a')]()][_0x29af('0x2d')]()});}});}return _0x271a52;}exports[_0x29af('0x42')]=function(_0x438ed8,_0xd41359,_0x8e3789,_0x2a3dc4,_0x59b8a9,_0x35f6e2){var _0x55bb4f,_0x3bcad5;_0x35f6e2[_0x29af('0x1b')]=intUtil[_0x29af('0x43')](_0x35f6e2['remoteUri']);_0x35f6e2[_0x29af('0x44')]=intUtil[_0x29af('0x43')](_0x35f6e2[_0x29af('0x44')]);if(_0x59b8a9&&_0x59b8a9[_0x29af('0x45')]){logger[_0x29af('0xb')](_0x29af('0x46'),_0x29af('0x47'));_0xd41359[_0x29af('0x48')]=util[_0x29af('0xe')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x35f6e2[_0x29af('0x44')],_0xd41359[_0x29af('0x49')],md5(_0xd41359[_0x29af('0x49')]));}else{_0xd41359['recordingURL']='';}headers['Authorization']=getAuth(_0x35f6e2);return getUser(_0x35f6e2,_0x2a3dc4[_0x29af('0x23')])['then'](function(_0x260588){_0x55bb4f=_0x260588;logger[_0x29af('0xb')]('The\x20User\x20ID\x20is:',_0x55bb4f['id']);return getEndUser(_0x35f6e2,_0xd41359[_0x29af('0x10')],_0xd41359[_0x29af('0x4a')]);})[_0x29af('0x1d')](function(_0x330108){_0x3bcad5=_0x330108;logger[_0x29af('0xb')](_0x29af('0x4b'),_0x3bcad5['id']);return getTicket(_0x35f6e2,_0x55bb4f,_0x3bcad5,_0x8e3789,_0xd41359);})[_0x29af('0x1d')](function(_0x470c82){if(_0x470c82&&_0x470c82['id']){logger[_0x29af('0xb')]('Ticket\x20created!');logger[_0x29af('0xb')]('The\x20Ticket\x20ID\x20is:',_0x470c82['id']);logger[_0x29af('0xb')](_0x29af('0x46'),_0x29af('0x4c'));emit(util[_0x29af('0xe')](_0x29af('0x4d'),_0x2a3dc4[_0x29af('0x15')]),_0x29af('0x4e'),{'uri':util['format'](_0x29af('0x4f'),_0x35f6e2[_0x29af('0x1b')],_0x470c82['id'])});}})[_0x29af('0x50')](function(_0x299110){logger[_0x29af('0x51')](_0x29af('0x46'),JSON[_0x29af('0x30')](_0x299110));});};exports['outbound']=function(_0x128507,_0x4cb9c8,_0x5ebd73,_0x1bf262,_0x453c47,_0x38ed79,_0x422ff5){var _0x39b2ff,_0x1cdd92;_0x38ed79[_0x29af('0x1b')]=intUtil[_0x29af('0x43')](_0x38ed79[_0x29af('0x1b')]);_0x38ed79['serverUrl']=intUtil['stripTrailingSlash'](_0x38ed79[_0x29af('0x44')]);if(_0x422ff5&&_0x422ff5[_0x29af('0x52')]&&_0x422ff5[_0x29af('0x52')]!==_0x29af('0x53')){logger[_0x29af('0xb')](_0x29af('0x54'),'Recording\x20is\x20enabled!');_0x4cb9c8[_0x29af('0x48')]=util[_0x29af('0xe')](_0x29af('0x55'),_0x38ed79[_0x29af('0x44')],_0x4cb9c8[_0x29af('0x49')],md5(_0x4cb9c8['uniqueid']));}headers[_0x29af('0x56')]=getAuth(_0x38ed79);return getUser(_0x38ed79,_0x1bf262['email'])[_0x29af('0x1d')](function(_0x8e45bf){_0x39b2ff=_0x8e45bf;logger[_0x29af('0xb')](_0x29af('0x57'),_0x39b2ff['id']);return getEndUser(_0x38ed79,_0x4cb9c8[_0x29af('0x58')],_0x4cb9c8[_0x29af('0x59')]);})['then'](function(_0x1e6fa0){_0x1cdd92=_0x1e6fa0;logger['info'](_0x29af('0x4b'),_0x1cdd92['id']);return getTicket(_0x38ed79,_0x39b2ff,_0x1cdd92,_0x5ebd73,_0x4cb9c8);})[_0x29af('0x1d')](function(_0xbbeb3f){if(_0xbbeb3f&&_0xbbeb3f['id']){logger[_0x29af('0xb')](_0x29af('0x1e'));logger[_0x29af('0xb')](_0x29af('0x5a'),_0xbbeb3f['id']);logger[_0x29af('0xb')]('[OUTBOUND]',_0x29af('0x4c'));emit(util[_0x29af('0xe')]('user:%s',_0x1bf262[_0x29af('0x15')]),_0x29af('0x4e'),{'uri':util['format'](_0x29af('0x4f'),_0x38ed79['remoteUri'],_0xbbeb3f['id'])});}})[_0x29af('0x50')](function(_0x128f0a){logger['error'](_0x29af('0x54'),JSON['stringify'](_0x128f0a));});};exports[_0x29af('0x5b')]=function(_0xff500c,_0xfea807,_0xaccb6d,_0x3e151b,_0x200a49,_0x3ba986){var _0x285949,_0x5a7c2d;_0x3ba986[_0x29af('0x1b')]=intUtil[_0x29af('0x43')](_0x3ba986[_0x29af('0x1b')]);_0x3ba986['serverUrl']=intUtil[_0x29af('0x43')](_0x3ba986[_0x29af('0x44')]);if(_0x200a49&&_0x200a49[_0x29af('0x45')]){logger[_0x29af('0xb')]('['+_0xfea807[_0x29af('0x5c')][_0x29af('0x5d')]()+']','Recording\x20is\x20enabled!');_0xfea807[_0x29af('0x48')]=util[_0x29af('0xe')](_0x29af('0x55'),_0x3ba986[_0x29af('0x44')],_0xfea807[_0x29af('0x49')],md5(_0xfea807['uniqueid']));}else{_0xfea807[_0x29af('0x48')]='';}headers[_0x29af('0x56')]=getAuth(_0x3ba986);return getUser(_0x3ba986,'')['then'](function(_0x1d2560){_0x285949=_0x1d2560;logger[_0x29af('0xb')](_0x29af('0x57'),_0x285949['id']);return getEndUser(_0x3ba986,_0xfea807['calleridname'],_0xfea807[_0x29af('0x4a')]);})[_0x29af('0x1d')](function(_0x3c4286){_0x5a7c2d=_0x3c4286;logger[_0x29af('0xb')](_0x29af('0x4b'),_0x5a7c2d['id']);return getTicket(_0x3ba986,_0x285949,_0x5a7c2d,_0xaccb6d,_0xfea807);})['then'](function(_0x56682d){if(_0x56682d){logger[_0x29af('0xb')](_0x29af('0x1e'));logger[_0x29af('0xb')](_0x29af('0x5a'),_0x56682d['id']);}})[_0x29af('0x50')](function(_0x560582){logger[_0x29af('0x51')]('['+_0xfea807[_0x29af('0x5c')][_0x29af('0x5d')]()+']',JSON[_0x29af('0x30')](_0x560582));});};
\ No newline at end of file
+var _0x294f=['Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','unmanaged','lastevent','toUpperCase','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','calleridname','request-promise','util','ioredis','./util','../../../../config/environment','../../../../config/logger','freshdesk','redis','defaults','localhost','socket.io-emitter','Creating\x20new\x20ticket...','format','calleridnum','getString','Descriptions','<br>','Tags','mapValues','keyBy','custom_fields','value','%s/api/v2/tickets','POST','then','info','validateEmail','%s/api/v2/agents','remoteUri','length','Agent\x20found!','find','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','Basic\x20%s','apiKey','toString','debug','[HTTP]','stringify','GET','forEach','includes','string','picklist','type','nameField','customField','toLowerCase','idField','push','content','variable','variableName','customVariable','Variable','name','queue','stripTrailingSlash','serverUrl','monitor_format','Recording\x20is\x20enabled!','recordingURL','uniqueid','Authorization','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','[QUEUE]','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','catch','error','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:'];(function(_0x103206,_0x1fae01){var _0x2e2f53=function(_0x34f7ca){while(--_0x34f7ca){_0x103206['push'](_0x103206['shift']());}};_0x2e2f53(++_0x1fae01);}(_0x294f,0x186));var _0xf294=function(_0x22bdd3,_0x552e50){_0x22bdd3=_0x22bdd3-0x0;var _0x44d9d9=_0x294f[_0x22bdd3];return _0x44d9d9;};'use strict';var _=require('lodash');var rp=require(_0xf294('0x0'));var md5=require('md5');var util=require(_0xf294('0x1'));var Redis=require(_0xf294('0x2'));var intUtil=require(_0xf294('0x3'));var config=require(_0xf294('0x4'));var logger=require(_0xf294('0x5'))(_0xf294('0x6'));config[_0xf294('0x7')]=_[_0xf294('0x8')](config[_0xf294('0x7')],{'host':_0xf294('0x9'),'port':0x18eb});var io=require(_0xf294('0xa'))(new Redis(config[_0xf294('0x7')]));var headers={'Content-Type':'application/json','Accept':'application/json'};function emit(_0x3fd33e,_0x200e5f,_0x4aa5b1){io['to'](_0x3fd33e)['emit'](_0x200e5f,_0x4aa5b1);}function getTicket(_0x1162fb,_0x120acc,_0x5dd18f,_0x253857,_0x5c2e0d){logger['info'](_0xf294('0xb'));var _0x477743=_['merge']({'responder_id':_0x120acc['id'],'requester_id':_0x5dd18f['id'],'name':util[_0xf294('0xc')]('Caller\x20-\x20%s',_0x5c2e0d['calleridname']),'phone':_0x5c2e0d[_0xf294('0xd')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0xf294('0xe')](_0x253857['Subjects'],_0x5c2e0d,'\x20'),'description':intUtil[_0xf294('0xe')](_0x253857[_0xf294('0xf')],_0x5c2e0d,_0xf294('0x10')),'tags':getTags(_0x253857[_0xf294('0x11')],'name')},getCustomFields(_0x253857['Fields'],_0x5c2e0d));_0x477743['custom_fields']=_[_0xf294('0x12')](_[_0xf294('0x13')](_0x477743[_0xf294('0x14')],'id'),_0xf294('0x15'));return request({'uri':util[_0xf294('0xc')](_0xf294('0x16'),_0x1162fb['remoteUri']),'method':_0xf294('0x17'),'body':_0x477743})[_0xf294('0x18')](function(_0x37982a){logger[_0xf294('0x19')]('Ticket\x20created!');return _0x37982a;});}function getUser(_0x1659d3,_0x23d286){if(intUtil[_0xf294('0x1a')](_0x23d286)){return request({'uri':util[_0xf294('0xc')](_0xf294('0x1b'),_0x1659d3[_0xf294('0x1c')]),'qs':{'email':_0x23d286}})[_0xf294('0x18')](function(_0x667d7e){if(_0x667d7e[_0xf294('0x1d')]){logger[_0xf294('0x19')](_0xf294('0x1e'));return _[_0xf294('0x1f')](_0x667d7e,function(_0x591609){return _0x591609[_0xf294('0x20')][_0xf294('0x21')]===_0x23d286;});}else{logger[_0xf294('0x19')](_0xf294('0x22'));return request({'uri':util[_0xf294('0xc')](_0xf294('0x23'),_0x1659d3[_0xf294('0x1c')])})['then'](function(_0x5104a9){logger[_0xf294('0x19')](_0xf294('0x24'));return _0x5104a9;});}});}else{logger[_0xf294('0x19')](_0xf294('0x25'));return request({'uri':util['format'](_0xf294('0x23'),_0x1659d3[_0xf294('0x1c')])})['then'](function(_0x525b91){logger[_0xf294('0x19')](_0xf294('0x24'));return _0x525b91;});}}function getEndUser(_0xe0544,_0x5a24e2,_0x522961){logger['info'](_0xf294('0x26'),_0x522961);return request({'uri':util[_0xf294('0xc')](_0xf294('0x27'),_0xe0544['remoteUri']),'qs':{'phone':_0x522961}})[_0xf294('0x18')](function(_0x45683f){if(_0x45683f[_0xf294('0x1d')]){logger['info'](_0xf294('0x28'));return _[_0xf294('0x1f')](_0x45683f,{'phone':_0x522961});}else{logger['info'](_0xf294('0x29'));return request({'uri':util[_0xf294('0xc')]('%s/api/v2/contacts',_0xe0544[_0xf294('0x1c')]),'method':'POST','body':{'name':_0x5a24e2,'phone':_0x522961}})[_0xf294('0x18')](function(_0x2f8b79){logger['info'](_0xf294('0x2a'));return _0x2f8b79;});}});}function getAuth(_0x5b4417){return util[_0xf294('0xc')](_0xf294('0x2b'),new Buffer(_0x5b4417[_0xf294('0x2c')]+':X')[_0xf294('0x2d')]('base64'));}function request(_0x3f6738){logger[_0xf294('0x2e')](_0xf294('0x2f'),JSON[_0xf294('0x30')](_0x3f6738));return rp(_[_0xf294('0x8')](_0x3f6738,{'method':_0xf294('0x31'),'headers':headers,'json':!![]}));}function getTags(_0x1fbd18,_0x1f192a){var _0x39ccea=[];if(_0x1fbd18&&_0x1fbd18[_0xf294('0x1d')]>0x0){_0x39ccea=_['map'](_0x1fbd18,_0x1f192a);}return _0x39ccea;}function getCustomFields(_0x27edd0,_0x56f5c0){var _0x56ea81=[];var _0x1275e6={'custom_fields':[]};if(_0x27edd0[_0xf294('0x1d')]>0x0){_[_0xf294('0x32')](_0x27edd0,function(_0x327a5b){if(_[_0xf294('0x33')]([_0xf294('0x34'),_0xf294('0x35')],_0x327a5b[_0xf294('0x36')])&&_0x327a5b[_0xf294('0x37')]&&!_0x327a5b[_0xf294('0x38')]){_0x1275e6[_0x327a5b[_0xf294('0x37')][_0xf294('0x39')]()]=_0x327a5b['content'][_0xf294('0x2d')]();}else if(_[_0xf294('0x33')]([_0xf294('0x34'),'picklist'],_0x327a5b[_0xf294('0x36')])&&_0x327a5b[_0xf294('0x3a')]&&_0x327a5b[_0xf294('0x38')]){_0x1275e6[_0xf294('0x14')][_0xf294('0x3b')]({'id':_0x327a5b[_0xf294('0x3a')],'value':_0x327a5b[_0xf294('0x3c')][_0xf294('0x2d')]()});}else if(_0x327a5b[_0xf294('0x36')]===_0xf294('0x3d')&&_0x327a5b['variableName']&&_0x327a5b[_0xf294('0x3a')]&&_0x327a5b[_0xf294('0x38')]){_0x56f5c0[_0x327a5b[_0xf294('0x3e')]]&&_0x1275e6['custom_fields'][_0xf294('0x3b')]({'id':_0x327a5b[_0xf294('0x3a')],'value':_0x56f5c0[_0x327a5b[_0xf294('0x3e')]]['toString']()});}else if(_0x327a5b[_0xf294('0x36')]===_0xf294('0x3f')&&_0x327a5b['Variable']&&_0x327a5b[_0xf294('0x40')][_0xf294('0x41')]&&_0x327a5b['idField']&&_0x327a5b[_0xf294('0x38')]){_0x56f5c0[_0x327a5b[_0xf294('0x40')]['name'][_0xf294('0x39')]()]&&_0x1275e6[_0xf294('0x14')][_0xf294('0x3b')]({'id':_0x327a5b['idField'],'value':_0x56f5c0[_0x327a5b[_0xf294('0x40')][_0xf294('0x41')][_0xf294('0x39')]()][_0xf294('0x2d')]()});}});}return _0x1275e6;}exports[_0xf294('0x42')]=function(_0x2e0b27,_0x220c0c,_0x1b12a3,_0x4cb2be,_0x15eae1,_0x581bea){var _0x5ba9f3,_0x152595;_0x581bea['remoteUri']=intUtil[_0xf294('0x43')](_0x581bea[_0xf294('0x1c')]);_0x581bea[_0xf294('0x44')]=intUtil[_0xf294('0x43')](_0x581bea[_0xf294('0x44')]);if(_0x15eae1&&_0x15eae1[_0xf294('0x45')]){logger[_0xf294('0x19')]('[QUEUE]',_0xf294('0x46'));_0x220c0c[_0xf294('0x47')]=util[_0xf294('0xc')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x581bea['serverUrl'],_0x220c0c[_0xf294('0x48')],md5(_0x220c0c['uniqueid']));}else{_0x220c0c[_0xf294('0x47')]='';}headers[_0xf294('0x49')]=getAuth(_0x581bea);return getUser(_0x581bea,_0x4cb2be[_0xf294('0x21')])['then'](function(_0x137b03){_0x5ba9f3=_0x137b03;logger[_0xf294('0x19')](_0xf294('0x4a'),_0x5ba9f3['id']);return getEndUser(_0x581bea,_0x220c0c['calleridname'],_0x220c0c[_0xf294('0xd')]);})[_0xf294('0x18')](function(_0x1bd632){_0x152595=_0x1bd632;logger[_0xf294('0x19')](_0xf294('0x4b'),_0x152595['id']);return getTicket(_0x581bea,_0x5ba9f3,_0x152595,_0x1b12a3,_0x220c0c);})[_0xf294('0x18')](function(_0x190b73){if(_0x190b73&&_0x190b73['id']){logger[_0xf294('0x19')](_0xf294('0x4c'));logger[_0xf294('0x19')]('The\x20Ticket\x20ID\x20is:',_0x190b73['id']);logger[_0xf294('0x19')](_0xf294('0x4d'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xf294('0xc')](_0xf294('0x4e'),_0x4cb2be[_0xf294('0x41')]),_0xf294('0x4f'),{'uri':util[_0xf294('0xc')](_0xf294('0x50'),_0x581bea[_0xf294('0x1c')],_0x190b73['id'])});}})[_0xf294('0x51')](function(_0x15f54d){logger[_0xf294('0x52')](_0xf294('0x4d'),JSON[_0xf294('0x30')](_0x15f54d));});};exports[_0xf294('0x53')]=function(_0x920449,_0x9595a3,_0x2a9d54,_0x54218e,_0x5650cd,_0x46389c,_0x54b0dc){var _0x4191c4,_0x3d1d22;_0x46389c[_0xf294('0x1c')]=intUtil[_0xf294('0x43')](_0x46389c[_0xf294('0x1c')]);_0x46389c[_0xf294('0x44')]=intUtil[_0xf294('0x43')](_0x46389c[_0xf294('0x44')]);if(_0x54b0dc&&_0x54b0dc[_0xf294('0x54')]&&_0x54b0dc[_0xf294('0x54')]!==_0xf294('0x55')){logger[_0xf294('0x19')](_0xf294('0x56'),'Recording\x20is\x20enabled!');_0x9595a3[_0xf294('0x47')]=util[_0xf294('0xc')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x46389c['serverUrl'],_0x9595a3['uniqueid'],md5(_0x9595a3[_0xf294('0x48')]));}headers['Authorization']=getAuth(_0x46389c);return getUser(_0x46389c,_0x54218e['email'])[_0xf294('0x18')](function(_0x589cc3){_0x4191c4=_0x589cc3;logger[_0xf294('0x19')](_0xf294('0x4a'),_0x4191c4['id']);return getEndUser(_0x46389c,_0x9595a3[_0xf294('0x57')],_0x9595a3[_0xf294('0x58')]);})[_0xf294('0x18')](function(_0xf6eff8){_0x3d1d22=_0xf6eff8;logger['info']('The\x20Enduser\x20ID\x20is:',_0x3d1d22['id']);return getTicket(_0x46389c,_0x4191c4,_0x3d1d22,_0x2a9d54,_0x9595a3);})['then'](function(_0x1ea57a){if(_0x1ea57a&&_0x1ea57a['id']){logger[_0xf294('0x19')](_0xf294('0x4c'));logger[_0xf294('0x19')](_0xf294('0x59'),_0x1ea57a['id']);logger[_0xf294('0x19')]('[OUTBOUND]',_0xf294('0x5a'));emit(util[_0xf294('0xc')](_0xf294('0x4e'),_0x54218e['name']),'trigger:browser:url',{'uri':util[_0xf294('0xc')]('%s/helpdesk/tickets/%d',_0x46389c['remoteUri'],_0x1ea57a['id'])});}})[_0xf294('0x51')](function(_0x198f21){logger[_0xf294('0x52')](_0xf294('0x56'),JSON[_0xf294('0x30')](_0x198f21));});};exports[_0xf294('0x5b')]=function(_0x21c0ac,_0x2d8362,_0x6440b3,_0x315c86,_0x561741,_0x53ee56){var _0x121460,_0x4c8a01;_0x53ee56[_0xf294('0x1c')]=intUtil[_0xf294('0x43')](_0x53ee56[_0xf294('0x1c')]);_0x53ee56[_0xf294('0x44')]=intUtil[_0xf294('0x43')](_0x53ee56[_0xf294('0x44')]);if(_0x561741&&_0x561741[_0xf294('0x45')]){logger[_0xf294('0x19')]('['+_0x2d8362[_0xf294('0x5c')][_0xf294('0x5d')]()+']',_0xf294('0x46'));_0x2d8362[_0xf294('0x47')]=util[_0xf294('0xc')](_0xf294('0x5e'),_0x53ee56['serverUrl'],_0x2d8362['uniqueid'],md5(_0x2d8362[_0xf294('0x48')]));}else{_0x2d8362[_0xf294('0x47')]='';}headers[_0xf294('0x49')]=getAuth(_0x53ee56);return getUser(_0x53ee56,'')[_0xf294('0x18')](function(_0x4accf1){_0x121460=_0x4accf1;logger[_0xf294('0x19')](_0xf294('0x4a'),_0x121460['id']);return getEndUser(_0x53ee56,_0x2d8362[_0xf294('0x5f')],_0x2d8362['calleridnum']);})[_0xf294('0x18')](function(_0x553def){_0x4c8a01=_0x553def;logger[_0xf294('0x19')](_0xf294('0x4b'),_0x4c8a01['id']);return getTicket(_0x53ee56,_0x121460,_0x4c8a01,_0x6440b3,_0x2d8362);})[_0xf294('0x18')](function(_0x205776){if(_0x205776){logger[_0xf294('0x19')](_0xf294('0x4c'));logger[_0xf294('0x19')](_0xf294('0x59'),_0x205776['id']);}})[_0xf294('0x51')](function(_0x4c761c){logger['error']('['+_0x2d8362['lastevent']['toUpperCase']()+']',JSON[_0xf294('0x30')](_0x4c761c));});};
\ No newline at end of file
index 9856e03..666ce89 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdaee=['monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','unmanaged','Displaying\x20task\x20in\x20a\x20new\x20tab...','name','inspect','lodash','request-promise','md5','moment','bluebird','./util','../../../../config/environment','freshsales','redis','defaults','localhost','GET','/api/selector/owners','info','Getting\x20admin\x20information','then','users','length','adminEmail','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','error','toUpperCase','message','headers','Getting\x20user\x20list','Getting\x20user\x20with\x20email','agentEmail','userEmail','User\x20found:','userId','Admin\x20selected','&f=','&entities=contact','find','contacts','format','contactNumber','mobile_number','endUserId','work_number','Contact\x20found\x20work_number:','POST','Creating\x20new\x20task','getString','Subjects','YYYY-MM-DDTHH:mm:ss','add','ticketId','task','/contacts/','user:%s','emit','trigger:browser:url','remoteUri','serverUrl','stripTrailingSlash','username','toLowerCase','outbound','destcalleridnum','calleridnum','callDirection','queue','email','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid'];(function(_0x28f667,_0x36e398){var _0x4d5b46=function(_0x3d5e46){while(--_0x3d5e46){_0x28f667['push'](_0x28f667['shift']());}};_0x4d5b46(++_0x36e398);}(_0xdaee,0xa8));var _0xedae=function(_0x4a90e0,_0x1dbd94){_0x4a90e0=_0x4a90e0-0x0;var _0x5b8b3f=_0xdaee[_0x4a90e0];return _0x5b8b3f;};'use strict';var _=require(_0xedae('0x0'));var rp=require(_0xedae('0x1'));var md5=require(_0xedae('0x2'));var util=require('util');var moment=require(_0xedae('0x3'));var Promise=require(_0xedae('0x4'));var Redis=require('ioredis');var intUtil=require(_0xedae('0x5'));var config=require(_0xedae('0x6'));var logger=require('../../../../config/logger')(_0xedae('0x7'));config[_0xedae('0x8')]=_[_0xedae('0x9')](config['redis'],{'host':_0xedae('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xedae('0x8')]));function getAdminId(_0x40e060,_0x237114,_0x593d9c,_0x2d2f4c){return new Promise(function(_0x1e8c17,_0x4abbc5){var _0x99866c=![];var _0x11e327={'method':_0xedae('0xb'),'uri':_0x2d2f4c+_0xedae('0xc'),'json':!![]};_0x11e327['headers']=_0x593d9c;logger[_0xedae('0xd')](_0xedae('0xe'));return rp(_0x11e327)[_0xedae('0xf')](function(_0x5a3707){if(_0x5a3707){var _0x52b9e6=_0x5a3707[_0xedae('0x10')];var _0x1ae82c=null;for(_0x1ae82c=0x0;_0x1ae82c<_0x52b9e6[_0xedae('0x11')];_0x1ae82c++){if(_0x52b9e6[_0x1ae82c]['email']===_0x40e060[_0xedae('0x12')]){_0x40e060[_0xedae('0x13')]=_0x52b9e6[_0x1ae82c]['id'];_0x99866c=!![];}}if(_0x99866c){logger['info'](_0xedae('0x14'),_0x40e060[_0xedae('0x13')]);_0x1e8c17(_0x40e060);}else{_0x4abbc5({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x4abbc5({'statusCode':0x194,'message':_0xedae('0x15')});}})[_0xedae('0x16')](function(_0x7397da){logger[_0xedae('0x17')]('['+[_0x237114[_0xedae('0x18')]()]+']',_0x7397da[_0xedae('0x19')]);_0x4abbc5(_0x7397da);});});}function getUser(_0x349332,_0x1784b4,_0x281278){return function(_0x3290df){return new Promise(function(_0x51b111,_0x3d1476){var _0xabd9f3={'method':'GET','uri':_0x281278+_0xedae('0xc'),'json':!![]};_0xabd9f3[_0xedae('0x1a')]=_0x1784b4;logger[_0xedae('0xd')](_0xedae('0x1b'));return rp(_0xabd9f3)[_0xedae('0xf')](function(_0x1ad2b5){if(_0x1ad2b5){var _0x370220=_0x1ad2b5[_0xedae('0x10')];var _0x25f459=![];var _0x34485f=null;if(_0x3290df['agentEmail']!==null){logger[_0xedae('0xd')](_0xedae('0x1c'),_0x3290df[_0xedae('0x1d')]);_0x3290df[_0xedae('0x1e')]=_0x3290df[_0xedae('0x1d')];for(_0x34485f=0x0;_0x34485f<_0x370220[_0xedae('0x11')];_0x34485f++){if(_0x370220[_0x34485f]['email']===_0x3290df['agentEmail']){_0x25f459=!![];_0x3290df['userId']=_0x370220[_0x34485f]['id'];logger[_0xedae('0xd')](_0xedae('0x1f'),_0x3290df[_0xedae('0x20')]);}}}if(!_0x25f459){logger[_0xedae('0xd')](_0xedae('0x21'));_0x3290df['userEmail']=_0x3290df[_0xedae('0x12')];_0x3290df[_0xedae('0x20')]=_0x3290df['adminId'];_0x25f459=!![];}if(_0x25f459){_0x51b111(_0x3290df);}else{_0x3d1476({'statusCode':0x194,'message':_0xedae('0x15')});}}else{_0x3d1476({'statusCode':0x194,'message':_0xedae('0x15')});}})[_0xedae('0x16')](function(_0x44f1cc){logger[_0xedae('0x17')]('['+[_0x349332[_0xedae('0x18')]()]+']',_0x44f1cc['message']);_0x3d1476(_0x44f1cc);});});};}function searchContact(_0x5f2d4f,_0x2aaa15,_0x157111,_0x18051f){return new Promise(function(_0x2dd71d,_0x12ee75){var _0x31ab9e={'method':_0xedae('0xb'),'headers':_0x2aaa15,'uri':_0x5f2d4f+'/api/lookup?q='+_0x18051f+_0xedae('0x22')+_0x157111+_0xedae('0x23'),'json':!![]};rp(_0x31ab9e)['then'](function(_0x57acac){var _0x1ce810=_[_0xedae('0x24')](_0x57acac[_0xedae('0x25')][_0xedae('0x25')],[_0x157111,_0x18051f]);_0x2dd71d(_0x1ce810);})[_0xedae('0x16')](function(_0x2fd098){_0x12ee75(_0x2fd098);});});}function getEndUser(_0x4cfc08,_0x33e01f,_0x5e9f11){return function(_0x284076){return new Promise(function(_0x2c53bb,_0x350744){logger[_0xedae('0xd')](util[_0xedae('0x26')]('Searching\x20contact\x20with\x20phone\x20%s',_0x284076[_0xedae('0x27')]));searchContact(_0x5e9f11,_0x33e01f,_0xedae('0x28'),_0x284076[_0xedae('0x27')])[_0xedae('0xf')](function(_0x279239){if(_0x279239){_0x284076[_0xedae('0x29')]=_0x279239['id'];logger[_0xedae('0xd')]('Contact\x20found\x20mobile_number:',_0x284076[_0xedae('0x29')]);return _0x2c53bb(_0x284076);}searchContact(_0x5e9f11,_0x33e01f,_0xedae('0x2a'),_0x284076[_0xedae('0x27')])['then'](function(_0x224d9f){if(_0x224d9f){_0x284076[_0xedae('0x29')]=_0x224d9f['id'];logger[_0xedae('0xd')](_0xedae('0x2b'),_0x284076[_0xedae('0x29')]);return _0x2c53bb(_0x284076);}createEndUser(_0x284076,_0x4cfc08,_0x33e01f,_0x5e9f11)[_0xedae('0xf')](function(_0x4c9a2f){logger[_0xedae('0xd')]('Contact\x20created:',_0x4c9a2f[_0xedae('0x29')]);return _0x2c53bb(_0x4c9a2f);});});})[_0xedae('0x16')](function(_0x5b0c76){_0x350744(_0x5b0c76);});});};}function createEndUser(_0x437120,_0x5694b4,_0x83df22,_0x2abb6f){return new Promise(function(_0xea1a,_0x2815b7){var _0x4dc5a6=moment();var _0x43549f={'method':_0xedae('0x2c'),'uri':_0x2abb6f+'/api/contacts','body':{'contact':{'last_name':_0x437120[_0xedae('0x27')],'work_number':_0x437120[_0xedae('0x27')],'mobile_number':_0x437120[_0xedae('0x27')],'owner_id':_0x437120[_0xedae('0x20')],'created_at':_0x4dc5a6[_0xedae('0x26')]('YYYY-MM-DDTHH:mm:ss')}},'json':!![]};_0x43549f['headers']=_0x83df22;logger[_0xedae('0xd')]('Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact');return rp(_0x43549f)[_0xedae('0xf')](function(_0xe74d7c){_0x437120[_0xedae('0x29')]=_0xe74d7c['contact']['id'];_0xea1a(_0x437120);})['catch'](function(_0x327042){logger[_0xedae('0x17')]('['+[_0x5694b4[_0xedae('0x18')]()]+']',_0x327042[_0xedae('0x19')]);_0x2815b7(_0x327042[_0xedae('0x19')]);});});}function getTicket(_0x19d5ba,_0x45fea5,_0x4e8492,_0x285e81,_0x48eb0e){return function(_0x3ab6c9){logger[_0xedae('0xd')](_0xedae('0x2d'));return new Promise(function(_0x27f82a,_0x5b1293){var _0x38f516=moment();var _0x3422a8={'method':_0xedae('0x2c'),'uri':_0x4e8492+'/api/tasks','body':{'title':intUtil[_0xedae('0x2e')](_0x285e81[_0xedae('0x2f')],_0x48eb0e,'\x20'),'description':intUtil[_0xedae('0x2e')](_0x285e81['Descriptions'],_0x48eb0e,'\x0a'),'owner_id':_0x3ab6c9[_0xedae('0x20')],'creater_id':_0x3ab6c9['adminId'],'targetable_id':_0x3ab6c9[_0xedae('0x29')],'targetable_type':'Contact','created_at':_0x38f516[_0xedae('0x26')](_0xedae('0x30')),'due_date':_0x38f516[_0xedae('0x31')](0x1e,'m')['format']('YYYY-MM-DDTHH:mm:ss')},'json':!![]};_0x3422a8[_0xedae('0x1a')]=_0x45fea5;return rp(_0x3422a8)['then'](function(_0x4e3399){_0x3ab6c9[_0xedae('0x32')]=_0x4e3399[_0xedae('0x33')]['id'];logger[_0xedae('0xd')]('Task\x20created:',_0x3ab6c9['ticketId']);_0x27f82a(_0x3ab6c9);})[_0xedae('0x16')](function(_0x36e40f){logger[_0xedae('0x17')]('['+[_0x19d5ba[_0xedae('0x18')]()]+']',_0x36e40f[_0xedae('0x19')]);_0x5b1293(_0x36e40f[_0xedae('0x19')]);});});};}function emit(_0x3564a8,_0x2c0811,_0x57b98a){var _0x17179a={'uri':_0x3564a8+_0xedae('0x34')+_0x57b98a};io['to'](util[_0xedae('0x26')](_0xedae('0x35'),_0x2c0811))[_0xedae('0x36')](_0xedae('0x37'),_0x17179a);}exports['cs']=function(_0x39669a,_0x120452,_0x2096e1,_0x1659cd,_0x54686d,_0x16bc28,_0xcdce16,_0x2ac527){var _0x3f0ed2={};var _0x2796e7={'Authorization':'Token\x20token='+_0x16bc28['apiKey']};_0x16bc28[_0xedae('0x38')]=intUtil['stripTrailingSlash'](_0x16bc28[_0xedae('0x38')]);_0x16bc28[_0xedae('0x39')]=intUtil[_0xedae('0x3a')](_0x16bc28[_0xedae('0x39')]);var _0x7774a6=_0x16bc28[_0xedae('0x38')];_0x3f0ed2[_0xedae('0x12')]=_0x16bc28[_0xedae('0x3b')];_0x3f0ed2[_0xedae('0x27')]=_0x2ac527[_0xedae('0x3c')]()===_0xedae('0x3d')?_0x120452[_0xedae('0x3e')]:_0x120452[_0xedae('0x3f')];_0x3f0ed2[_0xedae('0x40')]=_0x2ac527===_0xedae('0x41')||_0x2ac527==='unmanaged'?'queue':_0xedae('0x3d');if(_0x1659cd){_0x3f0ed2['agentEmail']=_0x1659cd[_0xedae('0x42')];}var _0x3ce2a1=util[_0xedae('0x26')](_0xedae('0x43'),_0x16bc28[_0xedae('0x39')],_0x120452['uniqueid'],md5(_0x120452[_0xedae('0x44')]));if(_0x54686d&&_0x54686d[_0xedae('0x45')]){logger[_0xedae('0xd')](_0xedae('0x46'),_0xedae('0x47'));_0x120452[_0xedae('0x48')]=_0x3ce2a1;}else if(_0xcdce16&&_0xcdce16['recordingFormat']&&_0xcdce16[_0xedae('0x49')]!==_0xedae('0x4a')){logger[_0xedae('0xd')]('[OUTBOUND]',_0xedae('0x47'));_0x120452['recordingURL']=_0x3ce2a1;}else{_0x120452[_0xedae('0x48')]='';}return getAdminId(_0x3f0ed2,_0x2ac527,_0x2796e7,_0x7774a6)[_0xedae('0xf')](getUser(_0x2ac527,_0x2796e7,_0x7774a6))[_0xedae('0xf')](getEndUser(_0x2ac527,_0x2796e7,_0x7774a6))['then'](getTicket(_0x2ac527,_0x2796e7,_0x7774a6,_0x2096e1,_0x120452))[_0xedae('0xf')](function(_0x5dbe19){logger[_0xedae('0xd')](util[_0xedae('0x26')]('The\x20ticket\x20ID\x20is:\x20%s',_0x5dbe19[_0xedae('0x32')]));if(_0x2ac527!==_0xedae('0x4b')){logger[_0xedae('0xd')]('['+[_0x2ac527[_0xedae('0x18')]()]+']',_0xedae('0x4c'));emit(_0x7774a6,_0x1659cd[_0xedae('0x4d')],_0x5dbe19[_0xedae('0x29')]);}})[_0xedae('0x16')](function(_0x3663b9){logger['error']('['+[_0x2ac527[_0xedae('0x18')]()]+']\x20Error\x20running\x20Freshsales\x20integration',util[_0xedae('0x4e')](_0x3663b9,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
+var _0x9cad=['recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','recordingURL','Displaying\x20task\x20in\x20a\x20new\x20tab...','name','inspect','request-promise','md5','bluebird','ioredis','./util','../../../../config/logger','freshsales','redis','defaults','localhost','socket.io-emitter','GET','/api/selector/owners','info','Getting\x20admin\x20information','then','users','length','email','adminEmail','adminId','Requested\x20Resource\x20not\x20Found','catch','error','toUpperCase','message','headers','Getting\x20user\x20list','agentEmail','Getting\x20user\x20with\x20email','userEmail','User\x20found:','userId','Admin\x20selected','/api/lookup?q=','&entities=contact','find','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','endUserId','work_number','Contact\x20found\x20work_number:','POST','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','/api/tasks','getString','Subjects','Descriptions','Contact','add','ticketId','task','Task\x20created:','/contacts/','emit','Token\x20token=','remoteUri','serverUrl','stripTrailingSlash','destcalleridnum','calleridnum','callDirection','queue','unmanaged','outbound','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]'];(function(_0x541a15,_0xdbe83e){var _0x5dc464=function(_0x4b0061){while(--_0x4b0061){_0x541a15['push'](_0x541a15['shift']());}};_0x5dc464(++_0xdbe83e);}(_0x9cad,0x1f4));var _0xd9ca=function(_0x52a857,_0xc99fa1){_0x52a857=_0x52a857-0x0;var _0x4e2aae=_0x9cad[_0x52a857];return _0x4e2aae;};'use strict';var _=require('lodash');var rp=require(_0xd9ca('0x0'));var md5=require(_0xd9ca('0x1'));var util=require('util');var moment=require('moment');var Promise=require(_0xd9ca('0x2'));var Redis=require(_0xd9ca('0x3'));var intUtil=require(_0xd9ca('0x4'));var config=require('../../../../config/environment');var logger=require(_0xd9ca('0x5'))(_0xd9ca('0x6'));config[_0xd9ca('0x7')]=_[_0xd9ca('0x8')](config[_0xd9ca('0x7')],{'host':_0xd9ca('0x9'),'port':0x18eb});var io=require(_0xd9ca('0xa'))(new Redis(config['redis']));function getAdminId(_0x349258,_0x1f83a7,_0x8627d7,_0x2b5948){return new Promise(function(_0x18918d,_0x22a619){var _0x4f1c06=![];var _0x4ef0a6={'method':_0xd9ca('0xb'),'uri':_0x2b5948+_0xd9ca('0xc'),'json':!![]};_0x4ef0a6['headers']=_0x8627d7;logger[_0xd9ca('0xd')](_0xd9ca('0xe'));return rp(_0x4ef0a6)[_0xd9ca('0xf')](function(_0x46b23e){if(_0x46b23e){var _0x34f898=_0x46b23e[_0xd9ca('0x10')];var _0x4cfb1a=null;for(_0x4cfb1a=0x0;_0x4cfb1a<_0x34f898[_0xd9ca('0x11')];_0x4cfb1a++){if(_0x34f898[_0x4cfb1a][_0xd9ca('0x12')]===_0x349258[_0xd9ca('0x13')]){_0x349258[_0xd9ca('0x14')]=_0x34f898[_0x4cfb1a]['id'];_0x4f1c06=!![];}}if(_0x4f1c06){logger[_0xd9ca('0xd')]('Admin\x20found:',_0x349258[_0xd9ca('0x14')]);_0x18918d(_0x349258);}else{_0x22a619({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x22a619({'statusCode':0x194,'message':_0xd9ca('0x15')});}})[_0xd9ca('0x16')](function(_0x280a61){logger[_0xd9ca('0x17')]('['+[_0x1f83a7[_0xd9ca('0x18')]()]+']',_0x280a61[_0xd9ca('0x19')]);_0x22a619(_0x280a61);});});}function getUser(_0x300029,_0x540c61,_0x15e65e){return function(_0x4d93c1){return new Promise(function(_0x14a57e,_0x49bb9a){var _0x103666={'method':'GET','uri':_0x15e65e+_0xd9ca('0xc'),'json':!![]};_0x103666[_0xd9ca('0x1a')]=_0x540c61;logger[_0xd9ca('0xd')](_0xd9ca('0x1b'));return rp(_0x103666)[_0xd9ca('0xf')](function(_0x16097c){if(_0x16097c){var _0x1d5b0c=_0x16097c['users'];var _0x55d321=![];var _0x39ef03=null;if(_0x4d93c1[_0xd9ca('0x1c')]!==null){logger[_0xd9ca('0xd')](_0xd9ca('0x1d'),_0x4d93c1[_0xd9ca('0x1c')]);_0x4d93c1[_0xd9ca('0x1e')]=_0x4d93c1[_0xd9ca('0x1c')];for(_0x39ef03=0x0;_0x39ef03<_0x1d5b0c[_0xd9ca('0x11')];_0x39ef03++){if(_0x1d5b0c[_0x39ef03][_0xd9ca('0x12')]===_0x4d93c1[_0xd9ca('0x1c')]){_0x55d321=!![];_0x4d93c1['userId']=_0x1d5b0c[_0x39ef03]['id'];logger['info'](_0xd9ca('0x1f'),_0x4d93c1[_0xd9ca('0x20')]);}}}if(!_0x55d321){logger['info'](_0xd9ca('0x21'));_0x4d93c1[_0xd9ca('0x1e')]=_0x4d93c1[_0xd9ca('0x13')];_0x4d93c1[_0xd9ca('0x20')]=_0x4d93c1['adminId'];_0x55d321=!![];}if(_0x55d321){_0x14a57e(_0x4d93c1);}else{_0x49bb9a({'statusCode':0x194,'message':_0xd9ca('0x15')});}}else{_0x49bb9a({'statusCode':0x194,'message':_0xd9ca('0x15')});}})['catch'](function(_0x444902){logger[_0xd9ca('0x17')]('['+[_0x300029[_0xd9ca('0x18')]()]+']',_0x444902[_0xd9ca('0x19')]);_0x49bb9a(_0x444902);});});};}function searchContact(_0x3a2c0f,_0x35ec44,_0x5ca396,_0x3bdad4){return new Promise(function(_0x52ffc7,_0x50ad5c){var _0x35d7b7={'method':_0xd9ca('0xb'),'headers':_0x35ec44,'uri':_0x3a2c0f+_0xd9ca('0x22')+_0x3bdad4+'&f='+_0x5ca396+_0xd9ca('0x23'),'json':!![]};rp(_0x35d7b7)[_0xd9ca('0xf')](function(_0x51b4df){var _0x3943bc=_[_0xd9ca('0x24')](_0x51b4df[_0xd9ca('0x25')][_0xd9ca('0x25')],[_0x5ca396,_0x3bdad4]);_0x52ffc7(_0x3943bc);})[_0xd9ca('0x16')](function(_0x2ec93a){_0x50ad5c(_0x2ec93a);});});}function getEndUser(_0x48e509,_0x107d9a,_0x14dfbd){return function(_0x54eb9c){return new Promise(function(_0x54dc94,_0x22d5d3){logger[_0xd9ca('0xd')](util[_0xd9ca('0x26')](_0xd9ca('0x27'),_0x54eb9c[_0xd9ca('0x28')]));searchContact(_0x14dfbd,_0x107d9a,'mobile_number',_0x54eb9c[_0xd9ca('0x28')])['then'](function(_0x5838a3){if(_0x5838a3){_0x54eb9c[_0xd9ca('0x29')]=_0x5838a3['id'];logger[_0xd9ca('0xd')]('Contact\x20found\x20mobile_number:',_0x54eb9c[_0xd9ca('0x29')]);return _0x54dc94(_0x54eb9c);}searchContact(_0x14dfbd,_0x107d9a,_0xd9ca('0x2a'),_0x54eb9c['contactNumber'])[_0xd9ca('0xf')](function(_0xb429c4){if(_0xb429c4){_0x54eb9c[_0xd9ca('0x29')]=_0xb429c4['id'];logger[_0xd9ca('0xd')](_0xd9ca('0x2b'),_0x54eb9c['endUserId']);return _0x54dc94(_0x54eb9c);}createEndUser(_0x54eb9c,_0x48e509,_0x107d9a,_0x14dfbd)[_0xd9ca('0xf')](function(_0x602440){logger['info']('Contact\x20created:',_0x602440[_0xd9ca('0x29')]);return _0x54dc94(_0x602440);});});})[_0xd9ca('0x16')](function(_0x3e2340){_0x22d5d3(_0x3e2340);});});};}function createEndUser(_0x2208d5,_0x3f94c1,_0x6e339,_0x4954cb){return new Promise(function(_0x479bf9,_0x1c0b81){var _0x295b37=moment();var _0x39aee1={'method':_0xd9ca('0x2c'),'uri':_0x4954cb+'/api/contacts','body':{'contact':{'last_name':_0x2208d5[_0xd9ca('0x28')],'work_number':_0x2208d5['contactNumber'],'mobile_number':_0x2208d5[_0xd9ca('0x28')],'owner_id':_0x2208d5[_0xd9ca('0x20')],'created_at':_0x295b37['format'](_0xd9ca('0x2d'))}},'json':!![]};_0x39aee1[_0xd9ca('0x1a')]=_0x6e339;logger[_0xd9ca('0xd')](_0xd9ca('0x2e'));return rp(_0x39aee1)[_0xd9ca('0xf')](function(_0x187251){_0x2208d5[_0xd9ca('0x29')]=_0x187251[_0xd9ca('0x2f')]['id'];_0x479bf9(_0x2208d5);})[_0xd9ca('0x16')](function(_0x2e3539){logger[_0xd9ca('0x17')]('['+[_0x3f94c1[_0xd9ca('0x18')]()]+']',_0x2e3539['message']);_0x1c0b81(_0x2e3539['message']);});});}function getTicket(_0x272669,_0x24add8,_0x267ffc,_0x44ad44,_0xd4b6f){return function(_0x1524e8){logger[_0xd9ca('0xd')](_0xd9ca('0x30'));return new Promise(function(_0x1b3826,_0x3735df){var _0x1d7ccd=moment();var _0x49e179={'method':_0xd9ca('0x2c'),'uri':_0x267ffc+_0xd9ca('0x31'),'body':{'title':intUtil[_0xd9ca('0x32')](_0x44ad44[_0xd9ca('0x33')],_0xd4b6f,'\x20'),'description':intUtil['getString'](_0x44ad44[_0xd9ca('0x34')],_0xd4b6f,'\x0a'),'owner_id':_0x1524e8[_0xd9ca('0x20')],'creater_id':_0x1524e8[_0xd9ca('0x14')],'targetable_id':_0x1524e8['endUserId'],'targetable_type':_0xd9ca('0x35'),'created_at':_0x1d7ccd[_0xd9ca('0x26')](_0xd9ca('0x2d')),'due_date':_0x1d7ccd[_0xd9ca('0x36')](0x1e,'m')[_0xd9ca('0x26')](_0xd9ca('0x2d'))},'json':!![]};_0x49e179[_0xd9ca('0x1a')]=_0x24add8;return rp(_0x49e179)[_0xd9ca('0xf')](function(_0x1f6e62){_0x1524e8[_0xd9ca('0x37')]=_0x1f6e62[_0xd9ca('0x38')]['id'];logger[_0xd9ca('0xd')](_0xd9ca('0x39'),_0x1524e8[_0xd9ca('0x37')]);_0x1b3826(_0x1524e8);})[_0xd9ca('0x16')](function(_0x916884){logger[_0xd9ca('0x17')]('['+[_0x272669[_0xd9ca('0x18')]()]+']',_0x916884['message']);_0x3735df(_0x916884['message']);});});};}function emit(_0x6e7f3c,_0x345428,_0x205841){var _0xdde6d1={'uri':_0x6e7f3c+_0xd9ca('0x3a')+_0x205841};io['to'](util[_0xd9ca('0x26')]('user:%s',_0x345428))[_0xd9ca('0x3b')]('trigger:browser:url',_0xdde6d1);}exports['cs']=function(_0x339abc,_0x2a9721,_0x3cb8da,_0x1caad9,_0x108a10,_0x459550,_0x1c05bc,_0x3956eb){var _0xa020e9={};var _0x278a39={'Authorization':_0xd9ca('0x3c')+_0x459550['apiKey']};_0x459550[_0xd9ca('0x3d')]=intUtil['stripTrailingSlash'](_0x459550[_0xd9ca('0x3d')]);_0x459550[_0xd9ca('0x3e')]=intUtil[_0xd9ca('0x3f')](_0x459550[_0xd9ca('0x3e')]);var _0x5d24eb=_0x459550[_0xd9ca('0x3d')];_0xa020e9[_0xd9ca('0x13')]=_0x459550['username'];_0xa020e9[_0xd9ca('0x28')]=_0x3956eb['toLowerCase']()==='outbound'?_0x2a9721[_0xd9ca('0x40')]:_0x2a9721[_0xd9ca('0x41')];_0xa020e9[_0xd9ca('0x42')]=_0x3956eb===_0xd9ca('0x43')||_0x3956eb===_0xd9ca('0x44')?_0xd9ca('0x43'):_0xd9ca('0x45');if(_0x1caad9){_0xa020e9[_0xd9ca('0x1c')]=_0x1caad9[_0xd9ca('0x12')];}var _0x242ead=util[_0xd9ca('0x26')](_0xd9ca('0x46'),_0x459550[_0xd9ca('0x3e')],_0x2a9721[_0xd9ca('0x47')],md5(_0x2a9721[_0xd9ca('0x47')]));if(_0x108a10&&_0x108a10[_0xd9ca('0x48')]){logger[_0xd9ca('0xd')](_0xd9ca('0x49'),'Recording\x20is\x20enabled!');_0x2a9721['recordingURL']=_0x242ead;}else if(_0x1c05bc&&_0x1c05bc['recordingFormat']&&_0x1c05bc[_0xd9ca('0x4a')]!==_0xd9ca('0x4b')){logger[_0xd9ca('0xd')](_0xd9ca('0x4c'),_0xd9ca('0x4d'));_0x2a9721['recordingURL']=_0x242ead;}else{_0x2a9721[_0xd9ca('0x4e')]='';}return getAdminId(_0xa020e9,_0x3956eb,_0x278a39,_0x5d24eb)['then'](getUser(_0x3956eb,_0x278a39,_0x5d24eb))[_0xd9ca('0xf')](getEndUser(_0x3956eb,_0x278a39,_0x5d24eb))[_0xd9ca('0xf')](getTicket(_0x3956eb,_0x278a39,_0x5d24eb,_0x3cb8da,_0x2a9721))[_0xd9ca('0xf')](function(_0x434ed3){logger[_0xd9ca('0xd')](util[_0xd9ca('0x26')]('The\x20ticket\x20ID\x20is:\x20%s',_0x434ed3['ticketId']));if(_0x3956eb!==_0xd9ca('0x44')){logger[_0xd9ca('0xd')]('['+[_0x3956eb[_0xd9ca('0x18')]()]+']',_0xd9ca('0x4f'));emit(_0x5d24eb,_0x1caad9[_0xd9ca('0x50')],_0x434ed3[_0xd9ca('0x29')]);}})['catch'](function(_0x25fc96){logger['error']('['+[_0x3956eb[_0xd9ca('0x18')]()]+']\x20Error\x20running\x20Freshsales\x20integration',util[_0xd9ca('0x51')](_0x25fc96,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
index b656fa8..9d4cf47 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcfd0=['./freshsales','salesforce','desk','vtiger','dynamics365','freshsales','exec','includes','data1','find','Configurations','queue','routeId','outbound','log','EVENT\x20UNKNOWN','unmanaged','toLowerCase','zendesk','sugarcrm','zoho','servicenow','unknown\x20integration','../../../../config/logger','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','data3','error','%s\x20account\x20#%s\x20not\x20found','data2','util','./zendesk','./salesforce','./freshdesk','./zoho','./vtiger','./servicenow','./dynamics365'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xcfd0,0x130));var _0x0cfd=function(_0x55d266,_0x50b721){_0x55d266=_0x55d266-0x0;var _0x48b4a2=_0xcfd0[_0x55d266];return _0x48b4a2;};'use strict';var _=require('lodash');var util=require(_0x0cfd('0x0'));var zendesk=require(_0x0cfd('0x1'));var salesforce=require(_0x0cfd('0x2'));var sugarcrm=require('./sugarcrm');var freshdesk=require(_0x0cfd('0x3'));var zoho=require(_0x0cfd('0x4'));var desk=require('./desk');var vtiger=require(_0x0cfd('0x5'));var servicenow=require(_0x0cfd('0x6'));var dynamics365=require(_0x0cfd('0x7'));var freshsales=require(_0x0cfd('0x8'));var integrations=['zendesk',_0x0cfd('0x9'),'sugarcrm','freshdesk','zoho',_0x0cfd('0xa'),_0x0cfd('0xb'),_0x0cfd('0xc'),_0x0cfd('0xd'),'servicenow'];exports[_0x0cfd('0xe')]=function(_0xf2bced,_0x13b44e,_0x2d7739,_0x4dcae1,_0x1b686c,_0x4dc12a){if(_0x2d7739){if(_[_0x0cfd('0xf')](integrations,_0xf2bced[_0x0cfd('0x10')]['toLowerCase']())){try{var _0x1f7ad8=null;var _0x2e6bee='';var _0x31f374=_0x2d7739[_0xf2bced[_0x0cfd('0x10')]['toLowerCase']()];if(_0x31f374){var _0x94a29=_0x31f374[_0xf2bced['data2']];if(_0x94a29){var _0x555654=_[_0x0cfd('0x11')](_0x94a29[_0x0cfd('0x12')],{'id':parseInt(_0xf2bced['data3'],0xa)});if(_0x555654){if(_0x4dcae1){if(_0x1b686c&&_0x13b44e[_0x0cfd('0x13')]){_0x2e6bee='queue';}else if(_0x13b44e[_0x0cfd('0x14')]){_0x2e6bee=_0x0cfd('0x15');}else{console[_0x0cfd('0x16')](_0x0cfd('0x17'),_0x13b44e);}}else{_0x2e6bee=_0x0cfd('0x18');}switch(_0xf2bced[_0x0cfd('0x10')][_0x0cfd('0x19')]()){case _0x0cfd('0x1a'):zendesk[_0x2e6bee](_0xf2bced,_0x13b44e,_0x555654,_0x4dcae1,_0x1b686c,_0x94a29,_0x4dc12a);break;case _0x0cfd('0x9'):salesforce[_0x2e6bee](_0xf2bced,_0x13b44e,_0x555654,_0x4dcae1,_0x1b686c,_0x94a29,_0x4dc12a);break;case _0x0cfd('0x1b'):sugarcrm[_0x2e6bee](_0xf2bced,_0x13b44e,_0x555654,_0x4dcae1,_0x1b686c,_0x94a29,_0x4dc12a);break;case'freshdesk':freshdesk[_0x2e6bee](_0xf2bced,_0x13b44e,_0x555654,_0x4dcae1,_0x1b686c,_0x94a29,_0x4dc12a);break;case _0x0cfd('0x1c'):zoho[_0x2e6bee](_0xf2bced,_0x13b44e,_0x555654,_0x4dcae1,_0x1b686c,_0x94a29,_0x4dc12a);break;case _0x0cfd('0xa'):desk[_0x2e6bee](_0xf2bced,_0x13b44e,_0x555654,_0x4dcae1,_0x1b686c,_0x94a29,_0x4dc12a);break;case _0x0cfd('0xb'):vtiger[_0x2e6bee](_0xf2bced,_0x13b44e,_0x555654,_0x4dcae1,_0x1b686c,_0x94a29,_0x4dc12a);break;case _0x0cfd('0xd'):freshsales['cs'](_0xf2bced,_0x13b44e,_0x555654,_0x4dcae1,_0x1b686c,_0x94a29,_0x4dc12a,_0x2e6bee);break;case _0x0cfd('0x1d'):servicenow['cs'](_0xf2bced,_0x13b44e,_0x555654,_0x4dcae1,_0x1b686c,_0x94a29,_0x4dc12a,_0x2e6bee);break;case _0x0cfd('0xc'):dynamics365['cs'](_0xf2bced,_0x13b44e,_0x555654,_0x4dcae1,_0x1b686c,_0x94a29,_0x4dc12a,_0x2e6bee);break;default:console[_0x0cfd('0x16')](_0x0cfd('0x1e'));}}else{_0x1f7ad8=require(_0x0cfd('0x1f'))(_0xf2bced[_0x0cfd('0x10')]['toLowerCase']());_0x1f7ad8['error'](_0x0cfd('0x20'),util[_0x0cfd('0x21')](_0x0cfd('0x22'),_0xf2bced[_0x0cfd('0x10')][_0x0cfd('0x19')](),_0xf2bced[_0x0cfd('0x23')]));}}else{_0x1f7ad8=require('../../../../config/logger')(_0xf2bced[_0x0cfd('0x10')][_0x0cfd('0x19')]());_0x1f7ad8[_0x0cfd('0x24')](_0x0cfd('0x20'),util[_0x0cfd('0x21')](_0x0cfd('0x25'),_0xf2bced[_0x0cfd('0x10')]['toLowerCase'](),_0xf2bced[_0x0cfd('0x26')]));}}else{}}catch(_0x2b13ad){console[_0x0cfd('0x24')](_0x2b13ad);}}}};
\ No newline at end of file
+var _0x4665=['includes','toLowerCase','data1','data2','find','Configurations','data3','queue','routeId','outbound','EVENT\x20UNKNOWN','unmanaged','log','unknown\x20integration','../../../../config/logger','error','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','lodash','util','./zendesk','./sugarcrm','./freshdesk','./vtiger','./servicenow','./dynamics365','./freshsales','zendesk','salesforce','sugarcrm','freshdesk','zoho','desk','vtiger','dynamics365','freshsales','servicenow','exec'];(function(_0x1479ee,_0x2a999f){var _0x5b11fe=function(_0x316f16){while(--_0x316f16){_0x1479ee['push'](_0x1479ee['shift']());}};_0x5b11fe(++_0x2a999f);}(_0x4665,0x1e7));var _0x5466=function(_0x133368,_0x1f8d8e){_0x133368=_0x133368-0x0;var _0x4c01a9=_0x4665[_0x133368];return _0x4c01a9;};'use strict';var _=require(_0x5466('0x0'));var util=require(_0x5466('0x1'));var zendesk=require(_0x5466('0x2'));var salesforce=require('./salesforce');var sugarcrm=require(_0x5466('0x3'));var freshdesk=require(_0x5466('0x4'));var zoho=require('./zoho');var desk=require('./desk');var vtiger=require(_0x5466('0x5'));var servicenow=require(_0x5466('0x6'));var dynamics365=require(_0x5466('0x7'));var freshsales=require(_0x5466('0x8'));var integrations=[_0x5466('0x9'),_0x5466('0xa'),_0x5466('0xb'),_0x5466('0xc'),_0x5466('0xd'),_0x5466('0xe'),_0x5466('0xf'),_0x5466('0x10'),_0x5466('0x11'),_0x5466('0x12')];exports[_0x5466('0x13')]=function(_0x259eae,_0xde5be6,_0x5fb49e,_0x43fbe6,_0x4583d5,_0x429b8b){if(_0x5fb49e){if(_[_0x5466('0x14')](integrations,_0x259eae['data1'][_0x5466('0x15')]())){try{var _0x1b2964=null;var _0x2b12b5='';var _0x5d1e3c=_0x5fb49e[_0x259eae[_0x5466('0x16')]['toLowerCase']()];if(_0x5d1e3c){var _0x1e5200=_0x5d1e3c[_0x259eae[_0x5466('0x17')]];if(_0x1e5200){var _0x371820=_[_0x5466('0x18')](_0x1e5200[_0x5466('0x19')],{'id':parseInt(_0x259eae[_0x5466('0x1a')],0xa)});if(_0x371820){if(_0x43fbe6){if(_0x4583d5&&_0xde5be6[_0x5466('0x1b')]){_0x2b12b5=_0x5466('0x1b');}else if(_0xde5be6[_0x5466('0x1c')]){_0x2b12b5=_0x5466('0x1d');}else{console['log'](_0x5466('0x1e'),_0xde5be6);}}else{_0x2b12b5=_0x5466('0x1f');}switch(_0x259eae[_0x5466('0x16')]['toLowerCase']()){case'zendesk':zendesk[_0x2b12b5](_0x259eae,_0xde5be6,_0x371820,_0x43fbe6,_0x4583d5,_0x1e5200,_0x429b8b);break;case _0x5466('0xa'):salesforce[_0x2b12b5](_0x259eae,_0xde5be6,_0x371820,_0x43fbe6,_0x4583d5,_0x1e5200,_0x429b8b);break;case _0x5466('0xb'):sugarcrm[_0x2b12b5](_0x259eae,_0xde5be6,_0x371820,_0x43fbe6,_0x4583d5,_0x1e5200,_0x429b8b);break;case _0x5466('0xc'):freshdesk[_0x2b12b5](_0x259eae,_0xde5be6,_0x371820,_0x43fbe6,_0x4583d5,_0x1e5200,_0x429b8b);break;case _0x5466('0xd'):zoho[_0x2b12b5](_0x259eae,_0xde5be6,_0x371820,_0x43fbe6,_0x4583d5,_0x1e5200,_0x429b8b);break;case _0x5466('0xe'):desk[_0x2b12b5](_0x259eae,_0xde5be6,_0x371820,_0x43fbe6,_0x4583d5,_0x1e5200,_0x429b8b);break;case'vtiger':vtiger[_0x2b12b5](_0x259eae,_0xde5be6,_0x371820,_0x43fbe6,_0x4583d5,_0x1e5200,_0x429b8b);break;case _0x5466('0x11'):freshsales['cs'](_0x259eae,_0xde5be6,_0x371820,_0x43fbe6,_0x4583d5,_0x1e5200,_0x429b8b,_0x2b12b5);break;case'servicenow':servicenow['cs'](_0x259eae,_0xde5be6,_0x371820,_0x43fbe6,_0x4583d5,_0x1e5200,_0x429b8b,_0x2b12b5);break;case _0x5466('0x10'):dynamics365['cs'](_0x259eae,_0xde5be6,_0x371820,_0x43fbe6,_0x4583d5,_0x1e5200,_0x429b8b,_0x2b12b5);break;default:console[_0x5466('0x20')](_0x5466('0x21'));}}else{_0x1b2964=require(_0x5466('0x22'))(_0x259eae[_0x5466('0x16')][_0x5466('0x15')]());_0x1b2964[_0x5466('0x23')](_0x5466('0x24'),util[_0x5466('0x25')](_0x5466('0x26'),_0x259eae[_0x5466('0x16')]['toLowerCase'](),_0x259eae[_0x5466('0x1a')]));}}else{_0x1b2964=require(_0x5466('0x22'))(_0x259eae[_0x5466('0x16')][_0x5466('0x15')]());_0x1b2964['error']('[EXEC]',util[_0x5466('0x25')]('%s\x20account\x20#%s\x20not\x20found',_0x259eae[_0x5466('0x16')][_0x5466('0x15')](),_0x259eae[_0x5466('0x17')]));}}else{}}catch(_0x283e80){console[_0x5466('0x23')](_0x283e80);}}}};
\ No newline at end of file
index ad3f424..8887a1c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x73f9=['socket.io-emitter','emit','assign','getString','Descriptions','ticketType','Task','ActivityDate','IsReminderSet','endUserType','contact','lead','WhoId','account','WhatId','Case','ContactId','AccountId','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','create','isNil','validateEmail','User','find','execute','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','additionalSearchContact','$or','Contact','cloneDeep','additionalSearchLead','merge','Lead','account_contact_lead','Account','additionalSearchAccount','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.','<unknown>','format','Caller\x20-\x20%s','LastName','Company','No\x20Company','includes','string','picklist','idField','content','variable','variableName','toString','customVariable','Variable','name','password','concat','Connection','remoteUri','https://login.salesforce.com','clientSecret','login','Connection\x20established.','queue','stripTrailingSlash','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridname','calleridnum','Fields','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','user:%s','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','outbound','recordingFormat','none','destcalleridname','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','integrationTab','newTab','trigger:browser:url','%s/%s/e','[OUTBOUND]','Salesforce\x20account\x20type\x20not\x20recognized','catch','unmanaged','monitor_format','lastevent','toUpperCase',']\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','moment','bluebird','md5','jsforce','util','ioredis','./util','../../../../config/environment','redis','localhost'];(function(_0x3f52ee,_0x468aab){var _0x4f7924=function(_0x405846){while(--_0x405846){_0x3f52ee['push'](_0x3f52ee['shift']());}};_0x4f7924(++_0x468aab);}(_0x73f9,0xfe));var _0x973f=function(_0xac3197,_0x28c002){_0xac3197=_0xac3197-0x0;var _0x319cc0=_0x73f9[_0xac3197];return _0x319cc0;};'use strict';var _=require(_0x973f('0x0'));var rp=require(_0x973f('0x1'));var moment=require(_0x973f('0x2'));var BPromise=require(_0x973f('0x3'));var md5=require(_0x973f('0x4'));var jsforce=require(_0x973f('0x5'));var util=require(_0x973f('0x6'));var Redis=require(_0x973f('0x7'));var intUtil=require(_0x973f('0x8'));var config=require(_0x973f('0x9'));var logger=require('../../../../config/logger')('salesforce');config[_0x973f('0xa')]=_['defaults'](config[_0x973f('0xa')],{'host':_0x973f('0xb'),'port':0x18eb});var io=require(_0x973f('0xc'))(new Redis(config['redis']));function emit(_0x10f0b9,_0x4802e8,_0x595528){io['to'](_0x10f0b9)[_0x973f('0xd')](_0x4802e8,_0x595528);}function getTicket(_0x197bad,_0x265f55,_0x596214,_0x1e5319,_0x145e16,_0xbac30b,_0x547830,_0x175e01){var _0xb1790a=Object[_0x973f('0xe')]({},{'OwnerId':_0x265f55['id'],'Subject':intUtil[_0x973f('0xf')](_0x1e5319['Subjects'],_0x145e16,'\x20'),'Description':intUtil[_0x973f('0xf')](_0x1e5319[_0x973f('0x10')],_0x145e16,'\x0a')},getCustomFields(_0xbac30b,_0x145e16));if(_0x596214){if(_0x1e5319[_0x973f('0x11')]===_0x973f('0x12')){_0xb1790a[_0x973f('0x13')]=moment['utc']();_0xb1790a[_0x973f('0x14')]=![];_0xb1790a['IsRecurrence']=![];if(_0x596214[_0x973f('0x15')]===_0x973f('0x16')||_0x596214['endUserType']===_0x973f('0x17')){_0xb1790a[_0x973f('0x18')]=_0x596214['id'];}else if(_0x596214['endUserType']===_0x973f('0x19')){_0xb1790a[_0x973f('0x1a')]=_0x596214['id'];}}else if(_0x1e5319[_0x973f('0x11')]===_0x973f('0x1b')){if(_0x596214[_0x973f('0x15')]===_0x973f('0x16')){_0xb1790a[_0x973f('0x1c')]=_0x596214['id'];}else if(_0x596214[_0x973f('0x15')]===_0x973f('0x19')){_0xb1790a[_0x973f('0x1d')]=_0x596214['id'];}else if(_0x596214['endUserType']===_0x973f('0x17')&&_0x1e5319[_0x973f('0x1e')]){_0xb1790a[_0x1e5319[_0x973f('0x1e')]]=_0x596214['id'];}else{logger[_0x973f('0x1f')](_0x973f('0x20'));}}}return _0x547830[_0x973f('0x21')](_0x1e5319[_0x973f('0x11')])[_0x973f('0x22')](_0xb1790a);}function getUser(_0x1e1c17,_0x4a08fd,_0x4a5a16){if(!_[_0x973f('0x23')](_0x4a08fd)&&intUtil[_0x973f('0x24')](_0x4a08fd)){var _0x304566={'Email':_0x4a08fd};var _0x212f3a={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x4a5a16[_0x973f('0x21')](_0x973f('0x25'))[_0x973f('0x26')](_0x304566,_0x212f3a)[_0x973f('0x27')]()[_0x973f('0x28')](function(_0x42fc28){if(_0x42fc28[_0x973f('0x29')]){var _0x28c43e=_[_0x973f('0x26')](_0x42fc28,function(_0x27825e){return _0x27825e[_0x973f('0x2a')]===_0x4a08fd;});if(_0x28c43e){logger['info'](_0x973f('0x2b'),_0x4a08fd);return BPromise[_0x973f('0x2c')]({'id':_0x28c43e['Id'],'name':_0x28c43e[_0x973f('0x2d')]});}}else{logger['info']('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x4a08fd);return _0x4a5a16[_0x973f('0x2e')]()[_0x973f('0x28')](function(_0x4acbeb){return BPromise[_0x973f('0x2c')]({'id':_0x4acbeb[_0x973f('0x2f')],'name':_0x4acbeb[_0x973f('0x30')]});});}});}else{logger['info'](_0x973f('0x31'),_0x4a08fd);return _0x4a5a16[_0x973f('0x2e')]()[_0x973f('0x28')](function(_0x253f18){return BPromise[_0x973f('0x2c')]({'id':_0x253f18['user_id'],'name':_0x253f18[_0x973f('0x30')]});});}}function getEndUser(_0x2b8c55,_0x4f565a,_0x58dd14,_0x57651e,_0x56f49e){var _0x32d996={'$or':{'Phone':_0x57651e}};var _0x1ad023={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x973f('0x2c')]()['then'](function(){logger[_0x973f('0x1f')](_0x973f('0x32'),_0x57651e,_0x4f565a[_0x973f('0x33')]);switch(_0x4f565a['moduleSearch']){case _0x973f('0x34'):var _0x3d5d18=_['cloneDeep'](_0x32d996);if(_0x4f565a['additionalSearchContact']){var _0x1ecbe5={};_0x1ecbe5[_0x4f565a[_0x973f('0x35')]]=_0x57651e;_['merge'](_0x3d5d18[_0x973f('0x36')],_0x1ecbe5);}return _0x56f49e[_0x973f('0x21')](_0x973f('0x37'))[_0x973f('0x26')](_0x3d5d18,_0x1ad023)['execute']()[_0x973f('0x28')](function(_0x1598b6){if(_0x1598b6&&_0x1598b6['length']){return _0x1598b6;}else{var _0x16997d=_[_0x973f('0x38')](_0x32d996);if(_0x4f565a[_0x973f('0x39')]){var _0x49fdb4={};_0x49fdb4[_0x4f565a['additionalSearchLead']]=_0x57651e;_[_0x973f('0x3a')](_0x16997d['$or'],_0x49fdb4);}return _0x56f49e[_0x973f('0x21')](_0x973f('0x3b'))['find'](_0x16997d,_0x1ad023);}});case _0x973f('0x3c'):var _0x39b527=_[_0x973f('0x38')](_0x32d996);if(_0x4f565a['additionalSearchAccount']){var _0x1ecbe5={};_0x1ecbe5[_0x4f565a['additionalSearchAccount']]=_0x57651e;_[_0x973f('0x3a')](_0x39b527['$or'],_0x1ecbe5);}return _0x56f49e[_0x973f('0x21')](_0x973f('0x3d'))[_0x973f('0x26')](_0x39b527,_0x1ad023)['execute']()['then'](function(_0x23b2e0){if(_0x23b2e0&&_0x23b2e0[_0x973f('0x29')]){return _0x23b2e0;}else{var _0x489088=_[_0x973f('0x38')](_0x32d996);if(_0x4f565a[_0x973f('0x35')]){var _0x5c0570={};_0x5c0570[_0x4f565a[_0x973f('0x35')]]=_0x57651e;_[_0x973f('0x3a')](_0x489088[_0x973f('0x36')],_0x5c0570);}return _0x56f49e[_0x973f('0x21')](_0x973f('0x37'))['find'](_0x489088,_0x1ad023)[_0x973f('0x28')](function(_0x1a4b65){if(_0x1a4b65&&_0x1a4b65[_0x973f('0x29')]){return _0x1a4b65;}else{var _0x1c661a=_['cloneDeep'](_0x32d996);if(_0x4f565a[_0x973f('0x39')]){var _0x4fdc39={};_0x4fdc39[_0x4f565a[_0x973f('0x39')]]=_0x57651e;_['merge'](_0x1c661a['$or'],_0x4fdc39);}return _0x56f49e[_0x973f('0x21')]('Lead')['find'](_0x1c661a,_0x1ad023);}});}});case'contact':var _0x3d5d18=_[_0x973f('0x38')](_0x32d996);if(_0x4f565a[_0x973f('0x35')]){var _0x1ecbe5={};_0x1ecbe5[_0x4f565a[_0x973f('0x35')]]=_0x57651e;_[_0x973f('0x3a')](_0x3d5d18[_0x973f('0x36')],_0x1ecbe5);}return _0x56f49e['sobject'](_0x973f('0x37'))['find'](_0x3d5d18,_0x1ad023)[_0x973f('0x27')]();case'lead':var _0x5691a3=_[_0x973f('0x38')](_0x32d996);if(_0x4f565a['additionalSearchLead']){var _0x1ecbe5={};_0x1ecbe5[_0x4f565a[_0x973f('0x39')]]=_0x57651e;_[_0x973f('0x3a')](_0x5691a3['$or'],_0x1ecbe5);}return _0x56f49e['sobject'](_0x973f('0x3b'))[_0x973f('0x26')](_0x5691a3,_0x1ad023);case _0x973f('0x19'):var _0x39b527=_[_0x973f('0x38')](_0x32d996);if(_0x4f565a[_0x973f('0x3e')]){var _0x1ecbe5={};_0x1ecbe5[_0x4f565a[_0x973f('0x3e')]]=_0x57651e;_[_0x973f('0x3a')](_0x39b527[_0x973f('0x36')],_0x1ecbe5);}return _0x56f49e['sobject'](_0x973f('0x3d'))['find'](_0x39b527,_0x1ad023);default:return null;}})[_0x973f('0x28')](function(_0x59688c){if(_0x59688c&&_0x59688c['length']){var _0x205322=_[_0x973f('0x3f')](_0x59688c);if(_0x205322){return BPromise['resolve']({'id':_0x205322['Id'],'name':_0x205322[_0x973f('0x2d')],'phone':_0x205322[_0x973f('0x40')],'endUserType':_0x205322[_0x973f('0x41')][_0x973f('0x42')][_0x973f('0x43')]()});}}})['then'](function(_0x168040){if(_0x168040){logger['info'](_0x973f('0x44'),_0x168040[_0x973f('0x15')],_0x57651e);return BPromise['resolve'](_0x168040);}else{logger[_0x973f('0x1f')](_0x973f('0x45'),_0x57651e);var _0x42eace={'Phone':_0x57651e};if(_0x4f565a[_0x973f('0x46')]){if(_0x4f565a['moduleCreate']===_0x973f('0x16')){logger[_0x973f('0x1f')](_0x973f('0x47'),_0x57651e,_0x4f565a[_0x973f('0x46')]);_0x42eace['LastName']=_0x58dd14!==_0x973f('0x48')?_0x58dd14:util[_0x973f('0x49')](_0x973f('0x4a'),_0x57651e);}else if(_0x4f565a[_0x973f('0x46')]===_0x973f('0x17')){logger[_0x973f('0x1f')](_0x973f('0x47'),_0x57651e,_0x4f565a[_0x973f('0x46')]);_0x42eace[_0x973f('0x4b')]=_0x58dd14!==_0x973f('0x48')?_0x58dd14:util[_0x973f('0x49')](_0x973f('0x4a'),_0x57651e);_0x42eace[_0x973f('0x4c')]=_0x973f('0x4d');}else if(_0x4f565a['moduleCreate']===_0x973f('0x19')){logger[_0x973f('0x1f')](_0x973f('0x47'),_0x57651e,_0x4f565a[_0x973f('0x46')]);_0x42eace[_0x973f('0x2d')]=_0x58dd14!==_0x973f('0x48')?_0x58dd14:util[_0x973f('0x49')](_0x973f('0x4a'),_0x57651e);}else{return null;}}return _0x56f49e['sobject'](_['upperFirst'](_0x4f565a[_0x973f('0x46')]))[_0x973f('0x22')](_0x42eace)[_0x973f('0x28')](function(_0x4c439e){return BPromise[_0x973f('0x2c')]({'id':_0x4c439e['id'],'endUserType':_0x4f565a[_0x973f('0x46')]});});}});}function getCustomFields(_0x32767e,_0x17753c){var _0x1ffd38={};if(_0x32767e['length']>0x0){_['forEach'](_0x32767e,function(_0xc594b1){if(_[_0x973f('0x4e')]([_0x973f('0x4f'),_0x973f('0x50')],_0xc594b1[_0x973f('0x42')])&&_0xc594b1['idField']){_0x1ffd38[_0xc594b1[_0x973f('0x51')]]=_0xc594b1[_0x973f('0x52')]['toString']();}else if(_0xc594b1[_0x973f('0x42')]===_0x973f('0x53')&&_0xc594b1[_0x973f('0x54')]&&_0xc594b1[_0x973f('0x51')]){_0x17753c[_0xc594b1['variableName']]&&(_0x1ffd38[_0xc594b1[_0x973f('0x51')]]=_0x17753c[_0xc594b1['variableName']][_0x973f('0x55')]());}else if(_0xc594b1[_0x973f('0x42')]===_0x973f('0x56')&&_0xc594b1[_0x973f('0x57')]&&_0xc594b1[_0x973f('0x57')][_0x973f('0x58')]&&_0xc594b1[_0x973f('0x51')]){_0x17753c[_0xc594b1['Variable']['name']['toLowerCase']()]&&(_0x1ffd38[_0xc594b1['idField']]=_0x17753c[_0xc594b1[_0x973f('0x57')][_0x973f('0x58')]['toLowerCase']()][_0x973f('0x55')]());}});}return _0x1ffd38;}function getConnection(_0x547a7d){var _0x3ca510=_0x547a7d[_0x973f('0x59')][_0x973f('0x5a')](_0x547a7d['securityToken']);var _0x402f5f=new jsforce[(_0x973f('0x5b'))]({'oauth2':{'loginUrl':_0x547a7d[_0x973f('0x5c')]||_0x973f('0x5d'),'clientId':_0x547a7d['clientId'],'clientSecret':_0x547a7d[_0x973f('0x5e')]}});return _0x402f5f[_0x973f('0x5f')](_0x547a7d['username'],_0x3ca510)['then'](function(){logger['info'](_0x973f('0x60'));return _0x402f5f;});}exports[_0x973f('0x61')]=function(_0x1ed5d3,_0x55b741,_0x4786af,_0x531ed6,_0x547581,_0x537187){var _0x274789,_0x22d8d7,_0x5c7ee4,_0x1aecb0;_0x537187['serverUrl']=intUtil[_0x973f('0x62')](_0x537187[_0x973f('0x63')]);_0x537187[_0x973f('0x5c')]=intUtil[_0x973f('0x62')](_0x537187['remoteUri']);if(_0x547581&&_0x547581['monitor_format']){logger[_0x973f('0x1f')](_0x973f('0x64'),_0x973f('0x65'));_0x55b741[_0x973f('0x66')]=util[_0x973f('0x49')](_0x973f('0x67'),_0x537187['serverUrl'],_0x55b741[_0x973f('0x68')],md5(_0x55b741[_0x973f('0x68')]));}else{_0x55b741[_0x973f('0x66')]='';}return getConnection(_0x537187)[_0x973f('0x28')](function(_0x2e6b2d){_0x1aecb0=_0x2e6b2d;return getUser(_0x537187,_0x531ed6[_0x973f('0x69')],_0x1aecb0);})['then'](function(_0x5a52eb){_0x274789=_0x5a52eb;return getEndUser(_0x537187,_0x4786af,_0x55b741[_0x973f('0x6a')],_0x55b741[_0x973f('0x6b')],_0x1aecb0);})[_0x973f('0x28')](function(_0xd3e4ac){_0x22d8d7=_0xd3e4ac;return getTicket(_0x537187,_0x274789,_0x22d8d7,_0x4786af,_0x55b741,_0x4786af[_0x973f('0x6c')],_0x1aecb0,'queue');})[_0x973f('0x28')](function(_0x31e881){_0x5c7ee4=_0x31e881;logger[_0x973f('0x1f')](_0x973f('0x6d'),_0x5c7ee4['id']);logger[_0x973f('0x1f')](_0x973f('0x6e'),_0x5c7ee4['id'],_0x531ed6[_0x973f('0x58')],_0x537187[_0x973f('0x42')]);switch(_0x537187[_0x973f('0x42')]){case'integrationTab':emit(util[_0x973f('0x49')](_0x973f('0x6f'),_0x531ed6[_0x973f('0x58')]),'trigger:salesforce:display',{'recordId':_0x5c7ee4['id']});break;case'newTab':emit(util[_0x973f('0x49')]('user:%s',_0x531ed6['name']),'trigger:browser:url',{'uri':util[_0x973f('0x49')]('%s/%s/e',_0x1aecb0[_0x973f('0x70')],_0x5c7ee4['id'])});break;default:logger[_0x973f('0x71')](_0x973f('0x72'));}})['catch'](function(_0x5461cd){logger[_0x973f('0x71')](_0x973f('0x64'),_0x5461cd);});};exports[_0x973f('0x73')]=function(_0x1b27ee,_0x1206ce,_0x28f920,_0x4ffc77,_0x3b7173,_0x503879,_0x255c17){var _0xf5093e,_0x4b0595,_0x1cf40f,_0x55a81d;_0x503879[_0x973f('0x63')]=intUtil['stripTrailingSlash'](_0x503879[_0x973f('0x63')]);_0x503879[_0x973f('0x5c')]=intUtil[_0x973f('0x62')](_0x503879[_0x973f('0x5c')]);if(_0x255c17&&_0x255c17[_0x973f('0x74')]&&_0x255c17[_0x973f('0x74')]!==_0x973f('0x75')){logger[_0x973f('0x1f')]('[OUTBOUND]',_0x973f('0x65'));_0x1206ce['recordingURL']=util[_0x973f('0x49')](_0x973f('0x67'),_0x503879[_0x973f('0x63')],_0x1206ce[_0x973f('0x68')],md5(_0x1206ce[_0x973f('0x68')]));}return getConnection(_0x503879)[_0x973f('0x28')](function(_0x26d435){_0x55a81d=_0x26d435;return getUser(_0x503879,_0x4ffc77['email'],_0x55a81d);})[_0x973f('0x28')](function(_0x958c02){_0xf5093e=_0x958c02;return getEndUser(_0x503879,_0x28f920,_0x1206ce[_0x973f('0x76')],_0x1206ce[_0x973f('0x77')],_0x55a81d);})['then'](function(_0x1c22fc){_0x4b0595=_0x1c22fc;return getTicket(_0x503879,_0xf5093e,_0x4b0595,_0x28f920,_0x1206ce,_0x28f920['Fields'],_0x55a81d,'outbound');})[_0x973f('0x28')](function(_0x54e5c9){_0x1cf40f=_0x54e5c9;logger[_0x973f('0x1f')](_0x973f('0x78'),_0x1cf40f['id']);logger[_0x973f('0x1f')]('[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x1cf40f['id'],_0x4ffc77[_0x973f('0x58')],_0x503879[_0x973f('0x42')]);switch(_0x503879[_0x973f('0x42')]){case _0x973f('0x79'):emit(util['format'](_0x973f('0x6f'),_0x4ffc77[_0x973f('0x58')]),'trigger:salesforce:display',{'recordId':_0x1cf40f['id']});break;case _0x973f('0x7a'):emit(util[_0x973f('0x49')]('user:%s',_0x4ffc77['name']),_0x973f('0x7b'),{'uri':util['format'](_0x973f('0x7c'),_0x55a81d[_0x973f('0x70')],_0x1cf40f['id'])});break;default:logger[_0x973f('0x71')](_0x973f('0x7d'),_0x973f('0x7e'));}})[_0x973f('0x7f')](function(_0x195a66){logger[_0x973f('0x71')](_0x973f('0x7d'),_0x195a66);});};exports[_0x973f('0x80')]=function(_0x36ff93,_0x24d373,_0x21d9e9,_0x8dc418,_0x1869ad,_0x5ed182){var _0x1276fa,_0x3725a4,_0x95be6d,_0xf35a2a;_0x5ed182[_0x973f('0x63')]=intUtil[_0x973f('0x62')](_0x5ed182[_0x973f('0x63')]);_0x5ed182[_0x973f('0x5c')]=intUtil[_0x973f('0x62')](_0x5ed182[_0x973f('0x5c')]);if(_0x1869ad&&_0x1869ad[_0x973f('0x81')]){logger['info']('['+_0x24d373[_0x973f('0x82')]['toUpperCase']()+']',_0x973f('0x65'));_0x24d373[_0x973f('0x66')]=util[_0x973f('0x49')](_0x973f('0x67'),_0x5ed182[_0x973f('0x63')],_0x24d373['uniqueid'],md5(_0x24d373[_0x973f('0x68')]));}else{_0x24d373[_0x973f('0x66')]='';}return getConnection(_0x5ed182)[_0x973f('0x28')](function(_0x2ea793){_0xf35a2a=_0x2ea793;if(!_[_0x973f('0x23')](_0x8dc418)){return getUser(_0x5ed182,_0x8dc418[_0x973f('0x58')],_0xf35a2a);}else{return getUser(_0x5ed182,null,_0xf35a2a);}})[_0x973f('0x28')](function(_0x3b4d66){_0x1276fa=_0x3b4d66;return getEndUser(_0x5ed182,_0x21d9e9,_0x24d373['calleridname'],_0x24d373[_0x973f('0x6b')],_0xf35a2a);})[_0x973f('0x28')](function(_0x58648d){_0x3725a4=_0x58648d;return getTicket(_0x5ed182,_0x1276fa,_0x3725a4,_0x21d9e9,_0x24d373,_0x21d9e9['Fields'],_0xf35a2a);})[_0x973f('0x28')](function(_0x44bbce){_0x95be6d=_0x44bbce;logger[_0x973f('0x1f')]('['+_0x24d373[_0x973f('0x82')]['toUpperCase']()+']\x20Ticket\x20%s\x20created.',_0x95be6d['id']);logger[_0x973f('0x1f')]('['+_0x24d373[_0x973f('0x82')][_0x973f('0x83')]()+_0x973f('0x84'),_0x5ed182[_0x973f('0x42')]);})[_0x973f('0x7f')](function(_0x7aff85){logger[_0x973f('0x71')]('['+_0x24d373[_0x973f('0x82')]['toUpperCase']()+']',_0x7aff85);});};
\ No newline at end of file
+var _0xd779=['Variable','name','password','concat','Connection','remoteUri','https://login.salesforce.com','clientSecret','login','username','Connection\x20established.','queue','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','calleridname','calleridnum','Fields','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','newTab','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','outbound','stripTrailingSlash','recordingFormat','none','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','integrationTab','user:%s','trigger:browser:url','[OUTBOUND]','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','toUpperCase','lastevent','lodash','request-promise','bluebird','jsforce','salesforce','redis','socket.io-emitter','emit','assign','getString','Subjects','Task','utc','IsReminderSet','IsRecurrence','endUserType','lead','WhoId','account','WhatId','ticketType','Case','ContactId','AccountId','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','isNil','validateEmail','User','find','execute','then','length','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','user_id','display_name','identity','contact_lead','cloneDeep','additionalSearchContact','$or','sobject','additionalSearchLead','merge','Lead','account_contact_lead','additionalSearchAccount','Account','Contact','first','Phone','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','LastName','Caller\x20-\x20%s','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','Company','No\x20Company','<unknown>','format','upperFirst','create','includes','string','type','idField','content','toString','variable','variableName'];(function(_0x12bcf7,_0xc11103){var _0x2825a=function(_0x4452ba){while(--_0x4452ba){_0x12bcf7['push'](_0x12bcf7['shift']());}};_0x2825a(++_0xc11103);}(_0xd779,0xa3));var _0x9d77=function(_0x2b1288,_0x3b2c86){_0x2b1288=_0x2b1288-0x0;var _0xd8974f=_0xd779[_0x2b1288];return _0xd8974f;};'use strict';var _=require(_0x9d77('0x0'));var rp=require(_0x9d77('0x1'));var moment=require('moment');var BPromise=require(_0x9d77('0x2'));var md5=require('md5');var jsforce=require(_0x9d77('0x3'));var util=require('util');var Redis=require('ioredis');var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0x9d77('0x4'));config[_0x9d77('0x5')]=_['defaults'](config[_0x9d77('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x9d77('0x6'))(new Redis(config[_0x9d77('0x5')]));function emit(_0x517a79,_0x79b513,_0x453597){io['to'](_0x517a79)[_0x9d77('0x7')](_0x79b513,_0x453597);}function getTicket(_0x4b439c,_0x4ef712,_0x44d90c,_0x16b19d,_0x13e8be,_0x8d1c0f,_0x40b8b,_0x28e887){var _0xb7f2d=Object[_0x9d77('0x8')]({},{'OwnerId':_0x4ef712['id'],'Subject':intUtil[_0x9d77('0x9')](_0x16b19d[_0x9d77('0xa')],_0x13e8be,'\x20'),'Description':intUtil['getString'](_0x16b19d['Descriptions'],_0x13e8be,'\x0a')},getCustomFields(_0x8d1c0f,_0x13e8be));if(_0x44d90c){if(_0x16b19d['ticketType']===_0x9d77('0xb')){_0xb7f2d['ActivityDate']=moment[_0x9d77('0xc')]();_0xb7f2d[_0x9d77('0xd')]=![];_0xb7f2d[_0x9d77('0xe')]=![];if(_0x44d90c[_0x9d77('0xf')]==='contact'||_0x44d90c['endUserType']===_0x9d77('0x10')){_0xb7f2d[_0x9d77('0x11')]=_0x44d90c['id'];}else if(_0x44d90c[_0x9d77('0xf')]===_0x9d77('0x12')){_0xb7f2d[_0x9d77('0x13')]=_0x44d90c['id'];}}else if(_0x16b19d[_0x9d77('0x14')]===_0x9d77('0x15')){if(_0x44d90c[_0x9d77('0xf')]==='contact'){_0xb7f2d[_0x9d77('0x16')]=_0x44d90c['id'];}else if(_0x44d90c[_0x9d77('0xf')]==='account'){_0xb7f2d[_0x9d77('0x17')]=_0x44d90c['id'];}else if(_0x44d90c[_0x9d77('0xf')]==='lead'&&_0x16b19d[_0x9d77('0x18')]){_0xb7f2d[_0x16b19d[_0x9d77('0x18')]]=_0x44d90c['id'];}else{logger[_0x9d77('0x19')](_0x9d77('0x1a'));}}}return _0x40b8b['sobject'](_0x16b19d[_0x9d77('0x14')])['create'](_0xb7f2d);}function getUser(_0x1e1e87,_0xb7937f,_0x27b574){if(!_[_0x9d77('0x1b')](_0xb7937f)&&intUtil[_0x9d77('0x1c')](_0xb7937f)){var _0x1d6091={'Email':_0xb7937f};var _0x4365f9={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x27b574['sobject'](_0x9d77('0x1d'))[_0x9d77('0x1e')](_0x1d6091,_0x4365f9)[_0x9d77('0x1f')]()[_0x9d77('0x20')](function(_0x2b613d){if(_0x2b613d[_0x9d77('0x21')]){var _0x30c0dd=_[_0x9d77('0x1e')](_0x2b613d,function(_0x26363f){return _0x26363f['Email']===_0xb7937f;});if(_0x30c0dd){logger[_0x9d77('0x19')]('Agent\x20%s\x20found.',_0xb7937f);return BPromise[_0x9d77('0x22')]({'id':_0x30c0dd['Id'],'name':_0x30c0dd[_0x9d77('0x23')]});}}else{logger[_0x9d77('0x19')](_0x9d77('0x24'),_0xb7937f);return _0x27b574['identity']()[_0x9d77('0x20')](function(_0x10827e){return BPromise[_0x9d77('0x22')]({'id':_0x10827e[_0x9d77('0x25')],'name':_0x10827e[_0x9d77('0x26')]});});}});}else{logger['info'](_0x9d77('0x24'),_0xb7937f);return _0x27b574[_0x9d77('0x27')]()[_0x9d77('0x20')](function(_0x11a9f3){return BPromise[_0x9d77('0x22')]({'id':_0x11a9f3[_0x9d77('0x25')],'name':_0x11a9f3[_0x9d77('0x26')]});});}}function getEndUser(_0x304ea5,_0xa801b6,_0x3e109e,_0xe16819,_0x2f9c2c){var _0x536fdc={'$or':{'Phone':_0xe16819}};var _0x2b16e6={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x9d77('0x22')]()[_0x9d77('0x20')](function(){logger[_0x9d77('0x19')]('Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.',_0xe16819,_0xa801b6['moduleSearch']);switch(_0xa801b6['moduleSearch']){case _0x9d77('0x28'):var _0x336fa2=_[_0x9d77('0x29')](_0x536fdc);if(_0xa801b6['additionalSearchContact']){var _0x41cde0={};_0x41cde0[_0xa801b6[_0x9d77('0x2a')]]=_0xe16819;_['merge'](_0x336fa2[_0x9d77('0x2b')],_0x41cde0);}return _0x2f9c2c[_0x9d77('0x2c')]('Contact')['find'](_0x336fa2,_0x2b16e6)['execute']()[_0x9d77('0x20')](function(_0x3b4fd2){if(_0x3b4fd2&&_0x3b4fd2[_0x9d77('0x21')]){return _0x3b4fd2;}else{var _0xf741f2=_[_0x9d77('0x29')](_0x536fdc);if(_0xa801b6['additionalSearchLead']){var _0x36dcc7={};_0x36dcc7[_0xa801b6[_0x9d77('0x2d')]]=_0xe16819;_[_0x9d77('0x2e')](_0xf741f2[_0x9d77('0x2b')],_0x36dcc7);}return _0x2f9c2c[_0x9d77('0x2c')](_0x9d77('0x2f'))[_0x9d77('0x1e')](_0xf741f2,_0x2b16e6);}});case _0x9d77('0x30'):var _0x2da102=_[_0x9d77('0x29')](_0x536fdc);if(_0xa801b6[_0x9d77('0x31')]){var _0x41cde0={};_0x41cde0[_0xa801b6[_0x9d77('0x31')]]=_0xe16819;_[_0x9d77('0x2e')](_0x2da102[_0x9d77('0x2b')],_0x41cde0);}return _0x2f9c2c['sobject'](_0x9d77('0x32'))['find'](_0x2da102,_0x2b16e6)['execute']()[_0x9d77('0x20')](function(_0x507411){if(_0x507411&&_0x507411['length']){return _0x507411;}else{var _0x456e88=_[_0x9d77('0x29')](_0x536fdc);if(_0xa801b6['additionalSearchContact']){var _0x1e0086={};_0x1e0086[_0xa801b6[_0x9d77('0x2a')]]=_0xe16819;_['merge'](_0x456e88[_0x9d77('0x2b')],_0x1e0086);}return _0x2f9c2c[_0x9d77('0x2c')](_0x9d77('0x33'))[_0x9d77('0x1e')](_0x456e88,_0x2b16e6)['then'](function(_0x13bff4){if(_0x13bff4&&_0x13bff4[_0x9d77('0x21')]){return _0x13bff4;}else{var _0x14adee=_[_0x9d77('0x29')](_0x536fdc);if(_0xa801b6[_0x9d77('0x2d')]){var _0x540d2e={};_0x540d2e[_0xa801b6['additionalSearchLead']]=_0xe16819;_[_0x9d77('0x2e')](_0x14adee[_0x9d77('0x2b')],_0x540d2e);}return _0x2f9c2c[_0x9d77('0x2c')](_0x9d77('0x2f'))['find'](_0x14adee,_0x2b16e6);}});}});case'contact':var _0x336fa2=_[_0x9d77('0x29')](_0x536fdc);if(_0xa801b6['additionalSearchContact']){var _0x41cde0={};_0x41cde0[_0xa801b6['additionalSearchContact']]=_0xe16819;_[_0x9d77('0x2e')](_0x336fa2[_0x9d77('0x2b')],_0x41cde0);}return _0x2f9c2c[_0x9d77('0x2c')]('Contact')[_0x9d77('0x1e')](_0x336fa2,_0x2b16e6)[_0x9d77('0x1f')]();case _0x9d77('0x10'):var _0x20eca7=_['cloneDeep'](_0x536fdc);if(_0xa801b6['additionalSearchLead']){var _0x41cde0={};_0x41cde0[_0xa801b6[_0x9d77('0x2d')]]=_0xe16819;_['merge'](_0x20eca7[_0x9d77('0x2b')],_0x41cde0);}return _0x2f9c2c[_0x9d77('0x2c')](_0x9d77('0x2f'))[_0x9d77('0x1e')](_0x20eca7,_0x2b16e6);case _0x9d77('0x12'):var _0x2da102=_[_0x9d77('0x29')](_0x536fdc);if(_0xa801b6[_0x9d77('0x31')]){var _0x41cde0={};_0x41cde0[_0xa801b6[_0x9d77('0x31')]]=_0xe16819;_[_0x9d77('0x2e')](_0x2da102['$or'],_0x41cde0);}return _0x2f9c2c[_0x9d77('0x2c')](_0x9d77('0x32'))[_0x9d77('0x1e')](_0x2da102,_0x2b16e6);default:return null;}})[_0x9d77('0x20')](function(_0x508556){if(_0x508556&&_0x508556['length']){var _0x356fdd=_[_0x9d77('0x34')](_0x508556);if(_0x356fdd){return BPromise[_0x9d77('0x22')]({'id':_0x356fdd['Id'],'name':_0x356fdd['Name'],'phone':_0x356fdd[_0x9d77('0x35')],'endUserType':_0x356fdd['attributes']['type'][_0x9d77('0x36')]()});}}})['then'](function(_0x3cba88){if(_0x3cba88){logger[_0x9d77('0x19')](_0x9d77('0x37'),_0x3cba88[_0x9d77('0xf')],_0xe16819);return BPromise[_0x9d77('0x22')](_0x3cba88);}else{logger['info'](_0x9d77('0x38'),_0xe16819);var _0x3cbc14={'Phone':_0xe16819};if(_0xa801b6['moduleCreate']){if(_0xa801b6[_0x9d77('0x39')]==='contact'){logger[_0x9d77('0x19')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0xe16819,_0xa801b6['moduleCreate']);_0x3cbc14[_0x9d77('0x3a')]=_0x3e109e!=='<unknown>'?_0x3e109e:util['format'](_0x9d77('0x3b'),_0xe16819);}else if(_0xa801b6[_0x9d77('0x39')]==='lead'){logger[_0x9d77('0x19')](_0x9d77('0x3c'),_0xe16819,_0xa801b6['moduleCreate']);_0x3cbc14[_0x9d77('0x3a')]=_0x3e109e!=='<unknown>'?_0x3e109e:util['format'](_0x9d77('0x3b'),_0xe16819);_0x3cbc14[_0x9d77('0x3d')]=_0x9d77('0x3e');}else if(_0xa801b6[_0x9d77('0x39')]===_0x9d77('0x12')){logger[_0x9d77('0x19')](_0x9d77('0x3c'),_0xe16819,_0xa801b6[_0x9d77('0x39')]);_0x3cbc14[_0x9d77('0x23')]=_0x3e109e!==_0x9d77('0x3f')?_0x3e109e:util[_0x9d77('0x40')](_0x9d77('0x3b'),_0xe16819);}else{return null;}}return _0x2f9c2c[_0x9d77('0x2c')](_[_0x9d77('0x41')](_0xa801b6[_0x9d77('0x39')]))[_0x9d77('0x42')](_0x3cbc14)['then'](function(_0x13dad8){return BPromise[_0x9d77('0x22')]({'id':_0x13dad8['id'],'endUserType':_0xa801b6[_0x9d77('0x39')]});});}});}function getCustomFields(_0x91cacb,_0x5c59ce){var _0x2a9cca={};if(_0x91cacb[_0x9d77('0x21')]>0x0){_['forEach'](_0x91cacb,function(_0x579bb1){if(_[_0x9d77('0x43')]([_0x9d77('0x44'),'picklist'],_0x579bb1[_0x9d77('0x45')])&&_0x579bb1[_0x9d77('0x46')]){_0x2a9cca[_0x579bb1[_0x9d77('0x46')]]=_0x579bb1[_0x9d77('0x47')][_0x9d77('0x48')]();}else if(_0x579bb1[_0x9d77('0x45')]===_0x9d77('0x49')&&_0x579bb1[_0x9d77('0x4a')]&&_0x579bb1[_0x9d77('0x46')]){_0x5c59ce[_0x579bb1[_0x9d77('0x4a')]]&&(_0x2a9cca[_0x579bb1[_0x9d77('0x46')]]=_0x5c59ce[_0x579bb1[_0x9d77('0x4a')]][_0x9d77('0x48')]());}else if(_0x579bb1['type']==='customVariable'&&_0x579bb1[_0x9d77('0x4b')]&&_0x579bb1[_0x9d77('0x4b')][_0x9d77('0x4c')]&&_0x579bb1[_0x9d77('0x46')]){_0x5c59ce[_0x579bb1[_0x9d77('0x4b')][_0x9d77('0x4c')][_0x9d77('0x36')]()]&&(_0x2a9cca[_0x579bb1['idField']]=_0x5c59ce[_0x579bb1[_0x9d77('0x4b')][_0x9d77('0x4c')][_0x9d77('0x36')]()][_0x9d77('0x48')]());}});}return _0x2a9cca;}function getConnection(_0x3cb6c0){var _0x16e2f0=_0x3cb6c0[_0x9d77('0x4d')][_0x9d77('0x4e')](_0x3cb6c0['securityToken']);var _0x483b6e=new jsforce[(_0x9d77('0x4f'))]({'oauth2':{'loginUrl':_0x3cb6c0[_0x9d77('0x50')]||_0x9d77('0x51'),'clientId':_0x3cb6c0['clientId'],'clientSecret':_0x3cb6c0[_0x9d77('0x52')]}});return _0x483b6e[_0x9d77('0x53')](_0x3cb6c0[_0x9d77('0x54')],_0x16e2f0)[_0x9d77('0x20')](function(){logger[_0x9d77('0x19')](_0x9d77('0x55'));return _0x483b6e;});}exports[_0x9d77('0x56')]=function(_0x3d439f,_0x24f78b,_0x5023fd,_0x107773,_0x283f3d,_0x3661cd){var _0x2a2095,_0x223e51,_0x11dafc,_0x5c1ac0;_0x3661cd[_0x9d77('0x57')]=intUtil['stripTrailingSlash'](_0x3661cd[_0x9d77('0x57')]);_0x3661cd[_0x9d77('0x50')]=intUtil['stripTrailingSlash'](_0x3661cd[_0x9d77('0x50')]);if(_0x283f3d&&_0x283f3d[_0x9d77('0x58')]){logger[_0x9d77('0x19')](_0x9d77('0x59'),_0x9d77('0x5a'));_0x24f78b['recordingURL']=util[_0x9d77('0x40')](_0x9d77('0x5b'),_0x3661cd[_0x9d77('0x57')],_0x24f78b[_0x9d77('0x5c')],md5(_0x24f78b[_0x9d77('0x5c')]));}else{_0x24f78b[_0x9d77('0x5d')]='';}return getConnection(_0x3661cd)['then'](function(_0x58c22f){_0x5c1ac0=_0x58c22f;return getUser(_0x3661cd,_0x107773['email'],_0x5c1ac0);})[_0x9d77('0x20')](function(_0x5aa65a){_0x2a2095=_0x5aa65a;return getEndUser(_0x3661cd,_0x5023fd,_0x24f78b[_0x9d77('0x5e')],_0x24f78b[_0x9d77('0x5f')],_0x5c1ac0);})['then'](function(_0x127f43){_0x223e51=_0x127f43;return getTicket(_0x3661cd,_0x2a2095,_0x223e51,_0x5023fd,_0x24f78b,_0x5023fd[_0x9d77('0x60')],_0x5c1ac0,_0x9d77('0x56'));})[_0x9d77('0x20')](function(_0xafa1f8){_0x11dafc=_0xafa1f8;logger['info'](_0x9d77('0x61'),_0x11dafc['id']);logger[_0x9d77('0x19')](_0x9d77('0x62'),_0x11dafc['id'],_0x107773[_0x9d77('0x4c')],_0x3661cd['type']);switch(_0x3661cd[_0x9d77('0x45')]){case'integrationTab':emit(util[_0x9d77('0x40')]('user:%s',_0x107773['name']),'trigger:salesforce:display',{'recordId':_0x11dafc['id']});break;case _0x9d77('0x63'):emit(util['format']('user:%s',_0x107773['name']),'trigger:browser:url',{'uri':util[_0x9d77('0x40')](_0x9d77('0x64'),_0x5c1ac0[_0x9d77('0x65')],_0x11dafc['id'])});break;default:logger[_0x9d77('0x66')](_0x9d77('0x67'));}})[_0x9d77('0x68')](function(_0x146742){logger[_0x9d77('0x66')]('[QUEUE]',_0x146742);});};exports[_0x9d77('0x69')]=function(_0x35e6ea,_0x49e273,_0x131bb0,_0x4d8827,_0x2d4dc0,_0x460b37,_0x2b7b7b){var _0x17bd2e,_0x526237,_0x35a77f,_0x3f06ca;_0x460b37['serverUrl']=intUtil[_0x9d77('0x6a')](_0x460b37['serverUrl']);_0x460b37['remoteUri']=intUtil['stripTrailingSlash'](_0x460b37[_0x9d77('0x50')]);if(_0x2b7b7b&&_0x2b7b7b[_0x9d77('0x6b')]&&_0x2b7b7b['recordingFormat']!==_0x9d77('0x6c')){logger['info']('[OUTBOUND]',_0x9d77('0x5a'));_0x49e273[_0x9d77('0x5d')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x460b37['serverUrl'],_0x49e273[_0x9d77('0x5c')],md5(_0x49e273[_0x9d77('0x5c')]));}return getConnection(_0x460b37)[_0x9d77('0x20')](function(_0x4e2de2){_0x3f06ca=_0x4e2de2;return getUser(_0x460b37,_0x4d8827['email'],_0x3f06ca);})[_0x9d77('0x20')](function(_0x34589f){_0x17bd2e=_0x34589f;return getEndUser(_0x460b37,_0x131bb0,_0x49e273['destcalleridname'],_0x49e273[_0x9d77('0x6d')],_0x3f06ca);})['then'](function(_0x44ee64){_0x526237=_0x44ee64;return getTicket(_0x460b37,_0x17bd2e,_0x526237,_0x131bb0,_0x49e273,_0x131bb0[_0x9d77('0x60')],_0x3f06ca,_0x9d77('0x69'));})[_0x9d77('0x20')](function(_0x49edde){_0x35a77f=_0x49edde;logger['info'](_0x9d77('0x6e'),_0x35a77f['id']);logger[_0x9d77('0x19')]('[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x35a77f['id'],_0x4d8827['name'],_0x460b37[_0x9d77('0x45')]);switch(_0x460b37[_0x9d77('0x45')]){case _0x9d77('0x6f'):emit(util[_0x9d77('0x40')](_0x9d77('0x70'),_0x4d8827['name']),'trigger:salesforce:display',{'recordId':_0x35a77f['id']});break;case _0x9d77('0x63'):emit(util[_0x9d77('0x40')]('user:%s',_0x4d8827['name']),_0x9d77('0x71'),{'uri':util[_0x9d77('0x40')](_0x9d77('0x64'),_0x3f06ca[_0x9d77('0x65')],_0x35a77f['id'])});break;default:logger[_0x9d77('0x66')](_0x9d77('0x72'),_0x9d77('0x73'));}})[_0x9d77('0x68')](function(_0x595df0){logger[_0x9d77('0x66')](_0x9d77('0x72'),_0x595df0);});};exports[_0x9d77('0x74')]=function(_0x17803f,_0x4e0da7,_0x3e3c25,_0xba7284,_0x196d67,_0x23d50){var _0x23db12,_0x467bd9,_0x13ca9d,_0x462a21;_0x23d50[_0x9d77('0x57')]=intUtil[_0x9d77('0x6a')](_0x23d50['serverUrl']);_0x23d50[_0x9d77('0x50')]=intUtil['stripTrailingSlash'](_0x23d50[_0x9d77('0x50')]);if(_0x196d67&&_0x196d67['monitor_format']){logger[_0x9d77('0x19')]('['+_0x4e0da7['lastevent'][_0x9d77('0x75')]()+']','Recording\x20is\x20enabled!');_0x4e0da7['recordingURL']=util['format'](_0x9d77('0x5b'),_0x23d50[_0x9d77('0x57')],_0x4e0da7[_0x9d77('0x5c')],md5(_0x4e0da7['uniqueid']));}else{_0x4e0da7[_0x9d77('0x5d')]='';}return getConnection(_0x23d50)['then'](function(_0x1dc6b3){_0x462a21=_0x1dc6b3;if(!_[_0x9d77('0x1b')](_0xba7284)){return getUser(_0x23d50,_0xba7284['name'],_0x462a21);}else{return getUser(_0x23d50,null,_0x462a21);}})[_0x9d77('0x20')](function(_0x23d730){_0x23db12=_0x23d730;return getEndUser(_0x23d50,_0x3e3c25,_0x4e0da7['calleridname'],_0x4e0da7[_0x9d77('0x5f')],_0x462a21);})[_0x9d77('0x20')](function(_0x1f35ed){_0x467bd9=_0x1f35ed;return getTicket(_0x23d50,_0x23db12,_0x467bd9,_0x3e3c25,_0x4e0da7,_0x3e3c25[_0x9d77('0x60')],_0x462a21);})['then'](function(_0x5868a6){_0x13ca9d=_0x5868a6;logger[_0x9d77('0x19')]('['+_0x4e0da7[_0x9d77('0x76')]['toUpperCase']()+']\x20Ticket\x20%s\x20created.',_0x13ca9d['id']);logger[_0x9d77('0x19')]('['+_0x4e0da7[_0x9d77('0x76')][_0x9d77('0x75')]()+']\x20Integration\x20account\x20type\x20%s.',_0x23d50['type']);})[_0x9d77('0x68')](function(_0x3a9a96){logger[_0x9d77('0x66')]('['+_0x4e0da7[_0x9d77('0x76')]['toUpperCase']()+']',_0x3a9a96);});};
\ No newline at end of file
index 7e7adbe..7ceefb0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5a4a=['ticketNumber','number',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','label_entry','Incident','forEach','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','trigger:browser:url','password','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','isNil','email','calleridnum','callDirection','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','unmanaged','Displaying\x20call\x20in\x20a\x20new\x20tab...','inspect','request-promise','util','md5','ioredis','../../../../config/environment','../../../../config/logger','servicenow','redis','defaults','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','then','result','sys_id','toUpperCase','],\x20getAdminUser\x20crm','catch','error','message','info','],\x20getUser\x20input\x20crm','validateEmail','userEmail','sys_user?sysparm_query=email%3D','length','active','true','userId','adminId','adminEmail','],\x20getUser\x20crm',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','POST','sys_user?','user','endUserNumber','System','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','includes','string','type','nameField','customField','toLowerCase','picklist','idField','toString','variable','variableName','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','outbound','incident','getString','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId'];(function(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0x5a4a,0x1f2));var _0xa5a4=function(_0xd72b72,_0x4784c7){_0xd72b72=_0xd72b72-0x0;var _0x4823ac=_0x5a4a[_0xd72b72];return _0x4823ac;};'use strict';var _=require('lodash');var Promise=require('bluebird');var rp=require(_0xa5a4('0x0'));var util=require(_0xa5a4('0x1'));var md5=require(_0xa5a4('0x2'));var Redis=require(_0xa5a4('0x3'));var intUtil=require('./util');var config=require(_0xa5a4('0x4'));var logger=require(_0xa5a4('0x5'))(_0xa5a4('0x6'));config[_0xa5a4('0x7')]=_[_0xa5a4('0x8')](config[_0xa5a4('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0xa5a4('0x9'))(new Redis(config[_0xa5a4('0x7')]));function getAdminUser(_0x3eb046,_0x47c6a1,_0x37d484,_0x489a8e,_0x2afcd1,_0xa7530a){return new Promise(function(_0x515929,_0x2094aa){var _0x582c02={'method':_0xa5a4('0xa'),'uri':_0x489a8e+_0xa5a4('0xb')+'&'+_0x2afcd1+'&'+_0xa7530a,'auth':_0x47c6a1,'json':!![]};return rp(_0x582c02)[_0xa5a4('0xc')](function(_0xe57e87){if(_0xe57e87[_0xa5a4('0xd')]['length']>0x0){_0x37d484['adminId']=_0xe57e87[_0xa5a4('0xd')][0x0][_0xa5a4('0xe')];}logger['info']('['+[_0x3eb046[_0xa5a4('0xf')]()]+_0xa5a4('0x10'),_0x37d484);_0x515929(_0x37d484);})[_0xa5a4('0x11')](function(_0x2356ba){logger[_0xa5a4('0x12')]('['+[_0x3eb046[_0xa5a4('0xf')]()]+']',_0x2356ba[_0xa5a4('0x13')]);_0x2094aa(_0x2356ba[_0xa5a4('0x13')]);});});}function getUser(_0x101340,_0x439972,_0x236638,_0x50129a,_0x206f59){return function(_0x24dc5d){logger[_0xa5a4('0x14')]('['+[_0x101340[_0xa5a4('0xf')]()]+_0xa5a4('0x15'),_0x24dc5d);return new Promise(function(_0x3c4204,_0x4cea1e){if(intUtil[_0xa5a4('0x16')](_0x24dc5d[_0xa5a4('0x17')])){var _0x3c703c={'method':_0xa5a4('0xa'),'uri':_0x236638+_0xa5a4('0x18')+_0x24dc5d[_0xa5a4('0x17')]+'&'+_0x50129a+'&'+_0x206f59,'auth':_0x439972,'json':!![]};logger[_0xa5a4('0x14')]('['+[_0x101340[_0xa5a4('0xf')]()]+'],\x20getUser\x20rp\x20obj',_0x3c703c);return rp(_0x3c703c)['then'](function(_0x4d3c00){logger[_0xa5a4('0x14')]('['+[_0x101340['toUpperCase']()]+'],\x20getUser\x20entity',_0x4d3c00);if(_0x4d3c00[_0xa5a4('0xd')][_0xa5a4('0x19')]>0x0&&String(_0x4d3c00['result'][0x0][_0xa5a4('0x1a')])===_0xa5a4('0x1b')){_0x24dc5d[_0xa5a4('0x1c')]=_0x4d3c00[_0xa5a4('0xd')][0x0][_0xa5a4('0xe')];}else{_0x24dc5d[_0xa5a4('0x1c')]=_0x24dc5d[_0xa5a4('0x1d')];_0x24dc5d['userEmail']=_0x24dc5d[_0xa5a4('0x1e')];}logger[_0xa5a4('0x14')]('['+[_0x101340['toUpperCase']()]+_0xa5a4('0x1f'),_0x24dc5d);_0x3c4204(_0x24dc5d);})[_0xa5a4('0x11')](function(_0x49dca1){logger[_0xa5a4('0x12')]('['+[_0x101340[_0xa5a4('0xf')]()]+']',_0x49dca1[_0xa5a4('0x13')]);_0x4cea1e(_0x49dca1[_0xa5a4('0x13')]);});}else{logger[_0xa5a4('0x14')]('['+[_0x101340[_0xa5a4('0xf')]()]+_0xa5a4('0x20'));_0x24dc5d['userId']=_0x24dc5d['adminId'];_0x24dc5d['userEmail']=_0x24dc5d[_0xa5a4('0x1e')];_0x3c4204(_0x24dc5d);}});};}function createEndUser(_0x13b9f3,_0x163b75,_0x4ab631,_0x3a8daa,_0x43f283){logger[_0xa5a4('0x14')]('['+[_0x13b9f3[_0xa5a4('0xf')]()]+_0xa5a4('0x21'),_0x4ab631);return new Promise(function(_0x430131,_0x39f7a9){var _0x342eeb={'method':_0xa5a4('0x22'),'uri':_0x3a8daa+_0xa5a4('0x23')+_0x43f283,'body':{'user_name':_0x4ab631['endUserNumber'],'roles':_0xa5a4('0x24'),'first_name':_0x4ab631[_0xa5a4('0x25')],'active':_0xa5a4('0x1b'),'date_format':_0xa5a4('0x26'),'phone':_0x4ab631[_0xa5a4('0x25')]},'auth':_0x163b75,'json':!![]};return rp(_0x342eeb)['then'](function(_0x5d0efa){logger['info']('['+[_0x13b9f3[_0xa5a4('0xf')]()]+_0xa5a4('0x27'),_0x5d0efa[_0xa5a4('0xd')]);_0x4ab631[_0xa5a4('0x28')]=_0x5d0efa[_0xa5a4('0xd')][_0xa5a4('0xe')];_0x430131(_0x4ab631);})['catch'](function(_0x2615da){logger['error']('['+[_0x13b9f3['toUpperCase']()]+']',_0x2615da[_0xa5a4('0x13')]);_0x39f7a9(_0x2615da[_0xa5a4('0x13')]);});});}function getEndUser(_0x5ec671,_0x284097,_0xd8f1be,_0x1483b5,_0x512e37){return function(_0x38715a){logger[_0xa5a4('0x14')]('['+[_0x5ec671['toUpperCase']()]+_0xa5a4('0x29'),_0x38715a);return new Promise(function(_0xfbe78f,_0x22b1ae){var _0x43a854={'method':'GET','uri':_0xd8f1be+_0xa5a4('0x2a')+_0x38715a[_0xa5a4('0x25')]+'&'+_0x1483b5+'&'+_0x512e37,'auth':_0x284097,'json':!![]};return rp(_0x43a854)[_0xa5a4('0xc')](function(_0x2354eb){if(_0x2354eb[_0xa5a4('0xd')][_0xa5a4('0x19')]>0x0){_0x38715a[_0xa5a4('0x28')]=_0x2354eb[_0xa5a4('0xd')][0x0][_0xa5a4('0xe')];logger[_0xa5a4('0x14')]('['+[_0x5ec671[_0xa5a4('0xf')]()]+_0xa5a4('0x2b'),_0x38715a);_0xfbe78f(_0x38715a);}else{return createEndUser(_0x5ec671,_0x284097,_0x38715a,_0xd8f1be,_0x1483b5)[_0xa5a4('0xc')](function(_0x338f49){logger['info']('['+[_0x5ec671[_0xa5a4('0xf')]()]+_0xa5a4('0x2c'),_0x338f49);_0xfbe78f(_0x338f49);});}})[_0xa5a4('0x11')](function(_0x2c396c){logger[_0xa5a4('0x12')]('['+[_0x5ec671['toUpperCase']()]+']',_0x2c396c[_0xa5a4('0x13')]);_0x22b1ae(_0x2c396c['message']);});});};}function getCustomFields(_0x207411,_0xeb6106){var _0x236672={};if(_0x207411[_0xa5a4('0x19')]>0x0){_['forEach'](_0x207411,function(_0x57f3eb){if(_[_0xa5a4('0x2d')]([_0xa5a4('0x2e'),'picklist'],_0x57f3eb[_0xa5a4('0x2f')])&&_0x57f3eb[_0xa5a4('0x30')]&&!_0x57f3eb[_0xa5a4('0x31')]){_0x236672[_0x57f3eb[_0xa5a4('0x30')][_0xa5a4('0x32')]()]=_0x57f3eb['content']['toString']();}else if(_[_0xa5a4('0x2d')](['string',_0xa5a4('0x33')],_0x57f3eb['type'])&&_0x57f3eb[_0xa5a4('0x34')]&&_0x57f3eb[_0xa5a4('0x31')]){_0x236672[_0x57f3eb['idField']['toLowerCase']()]=_0x57f3eb['content'][_0xa5a4('0x35')]();}else if(_0x57f3eb[_0xa5a4('0x2f')]===_0xa5a4('0x36')&&_0x57f3eb[_0xa5a4('0x37')]&&_0x57f3eb[_0xa5a4('0x34')]&&_0x57f3eb[_0xa5a4('0x31')]){_0x236672[_0x57f3eb[_0xa5a4('0x34')]['toLowerCase']()]=_0xeb6106[_0x57f3eb['variableName']][_0xa5a4('0x35')]();}else if(_0x57f3eb['type']===_0xa5a4('0x38')&&_0x57f3eb[_0xa5a4('0x39')]&&_0x57f3eb[_0xa5a4('0x39')]['name']&&_0x57f3eb[_0xa5a4('0x34')]&&_0x57f3eb[_0xa5a4('0x31')]){_0x236672[_0x57f3eb[_0xa5a4('0x34')][_0xa5a4('0x32')]()]=_0xeb6106[_0x57f3eb['Variable'][_0xa5a4('0x3a')]['toLowerCase']()]['toString']();}});}return _0x236672;}function getTicket(_0x233eb5,_0x128936,_0x58b37d,_0xbd9f10,_0x359b86,_0xba2623){return function(_0x4c23bb){logger['info']('['+[_0x233eb5['toUpperCase']()]+_0xa5a4('0x3b'),_0x4c23bb);return new Promise(function(_0x48ab6e,_0x3ad404){var _0xe73eff=_0x233eb5[_0xa5a4('0x32')]()===_0xa5a4('0x3c')?_0x4c23bb[_0xa5a4('0x1c')]:_0x4c23bb['endUserId'];var _0x58bf8c={'method':'POST','uri':_0x58b37d+_0xa5a4('0x3d')+'?'+_0xba2623,'body':Object['assign']({},{'active':_0xa5a4('0x1b'),'caller_id':_0xe73eff,'assigned_to':_0x4c23bb[_0xa5a4('0x1c')],'short_description':intUtil[_0xa5a4('0x3e')](_0xbd9f10['Subjects'],_0x359b86,'\x20'),'description':intUtil[_0xa5a4('0x3e')](_0xbd9f10[_0xa5a4('0x3f')],_0x359b86,'\x0a')},getCustomFields(_0xbd9f10[_0xa5a4('0x40')],_0x359b86)),'auth':_0x128936,'json':!![]};return rp(_0x58bf8c)['then'](function(_0xfbadd9){logger['info']('['+[_0x233eb5[_0xa5a4('0xf')]()]+_0xa5a4('0x41'),_0xfbadd9[_0xa5a4('0xd')]);_0x4c23bb[_0xa5a4('0x42')]=_0xfbadd9[_0xa5a4('0xd')][_0xa5a4('0xe')];_0x4c23bb[_0xa5a4('0x43')]=_0xfbadd9[_0xa5a4('0xd')][_0xa5a4('0x44')];logger[_0xa5a4('0x14')]('['+[_0x233eb5['toUpperCase']()]+_0xa5a4('0x45'),_0x4c23bb);_0x48ab6e(_0x4c23bb);})[_0xa5a4('0x11')](function(_0x3cb354){logger[_0xa5a4('0x12')]('['+[_0x233eb5[_0xa5a4('0xf')]()]+']',_0x3cb354['message']);_0x3ad404(_0x3cb354[_0xa5a4('0x13')]);});});};}function createRemoteTag(_0x2f86ef,_0x2441d6,_0x59e447,_0x337ce3){return new Promise(function(_0x165fa4,_0x57dc18){var _0x3dd900={'method':'POST','uri':_0x59e447+_0xa5a4('0x46')+'?'+_0x337ce3,'body':{'short_description':_0x2f86ef,'global':!![],'active':!![],'name':_0x2f86ef},'auth':_0x2441d6,'json':!![]};return rp(_0x3dd900)[_0xa5a4('0xc')](function(_0x482d70){var _0x566377=_0x482d70['result'][_0xa5a4('0xe')];_0x165fa4(_0x566377);});});}function getRemoteTag(_0x4edbbb,_0x561e65,_0x218ad3,_0x3f0d69,_0x1a6e83){return new Promise(function(_0x456711,_0x18163b){var _0x81f285={'method':_0xa5a4('0xa'),'uri':_0x218ad3+'label'+_0xa5a4('0x47')+_0x4edbbb+'&'+_0x3f0d69,'auth':_0x561e65,'json':!![]};return rp(_0x81f285)[_0xa5a4('0xc')](function(_0x18d0bf){if(_0x18d0bf[_0xa5a4('0xd')][_0xa5a4('0x19')]>0x0){var _0xb02156=_0x18d0bf['result'][0x0]['sys_id'];_0x456711(_0xb02156);}else{return createRemoteTag(_0x4edbbb,_0x561e65,_0x218ad3,_0x3f0d69)['then'](function(_0xf23173){_0x456711(_0xf23173);});}});});}function assignTagToIncident(_0x3bddb6,_0x32f84c,_0xcacfe0,_0x5457e6,_0x148c0f){return new Promise(function(_0x372339,_0x37531d){var _0x4b3123={'method':_0xa5a4('0x22'),'uri':_0xcacfe0+_0xa5a4('0x48')+'?'+_0x148c0f,'body':{'label':_0x3bddb6,'table':_0xa5a4('0x3d'),'id_type':_0xa5a4('0x49'),'table_key':_0x5457e6[_0xa5a4('0x42')],'title':'Incident\x20-\x20'+_0x5457e6[_0xa5a4('0x43')],'id_display':_0x5457e6[_0xa5a4('0x43')]},'auth':_0x32f84c,'json':!![]};return rp(_0x4b3123)[_0xa5a4('0xc')](function(_0x134dda){_0x372339();})['catch'](function(){_0x372339();});});}function manageTags(_0x4b617e,_0x15c652,_0x18e252,_0x49d0e9,_0x4c3d40,_0x397ecb,_0x5c5f6b){return new Promise(function(_0x1b546b,_0x5d2ff4){var _0x10f20d=[];_0x15c652[_0xa5a4('0x4a')](function(_0x3628bd){_0x10f20d[_0xa5a4('0x4b')](getRemoteTag(_0x3628bd,_0x18e252,_0x49d0e9,_0x397ecb,_0x5c5f6b));});return Promise[_0xa5a4('0x4c')](_0x10f20d)[_0xa5a4('0xc')](function(_0x16978a){if(_0x16978a[_0xa5a4('0x19')]){logger[_0xa5a4('0x14')]('['+[_0x4b617e[_0xa5a4('0xf')]()]+_0xa5a4('0x4d'),_0x16978a);var _0x41129f=[];_0x16978a['forEach'](function(_0x186c43){_0x41129f['push'](assignTagToIncident(_0x186c43,_0x18e252,_0x49d0e9,_0x4c3d40,_0x397ecb));});return Promise['all'](_0x41129f)['then'](function(){_0x1b546b();})[_0xa5a4('0x11')](function(){_0x1b546b();});}else{_0x1b546b();}});});}function getTags(_0x14b958,_0x56c90a,_0x382256,_0x12bd4d,_0x46d245,_0x9ba065){return function(_0x4d9c71){return new Promise(function(_0x109b50,_0x4ad5b0){var _0x30db88=[];var _0x4dbe5c=_0x12bd4d[_0xa5a4('0x4e')];if(_0x4dbe5c&&_0x4dbe5c[_0xa5a4('0x19')]>0x0){_0x30db88=_[_0xa5a4('0x4f')](_0x4dbe5c,'name');}if(_0x30db88['length']>0x0){return manageTags(_0x14b958,_0x30db88,_0x56c90a,_0x382256,_0x4d9c71,_0x46d245,_0x9ba065)[_0xa5a4('0xc')](function(){_0x109b50(_0x4d9c71);});}else{_0x109b50(_0x4d9c71);}});};}function emit(_0x591eaa,_0x5a1ac9,_0x142353){var _0x29ff52=_0xa5a4('0x50')+_0xa5a4('0x51')+_0xa5a4('0x52')+_0xa5a4('0x53');var _0x3c34cc={'uri':_0x591eaa+_0xa5a4('0x54')+_0x142353+_0x29ff52};io['to'](util[_0xa5a4('0x55')](_0xa5a4('0x56'),_0x5a1ac9))['emit'](_0xa5a4('0x57'),_0x3c34cc);}exports['cs']=function(_0x2e1732,_0x277293,_0x4ff24b,_0x4145cb,_0x157c60,_0x59e469,_0x5ea18a,_0x1a8d78){var _0x4a8d7a={};var _0x55b11a={'user':_0x59e469['username'],'pass':_0x59e469[_0xa5a4('0x58')]};var _0x3c0b4f='sysparm_limit=1';var _0x14d362=_0xa5a4('0x59');_0x59e469[_0xa5a4('0x5a')]=intUtil[_0xa5a4('0x5b')](_0x59e469[_0xa5a4('0x5a')]);_0x59e469[_0xa5a4('0x5c')]=intUtil[_0xa5a4('0x5b')](_0x59e469[_0xa5a4('0x5c')]);var _0xa3fc59=util['format'](_0xa5a4('0x5d'),_0x59e469[_0xa5a4('0x5a')]);_0x4a8d7a['userEmail']=!_[_0xa5a4('0x5e')](_0x4145cb)?_0x4145cb[_0xa5a4('0x5f')]:null;_0x4a8d7a[_0xa5a4('0x1e')]=_0x59e469[_0xa5a4('0x5f')];_0x4a8d7a[_0xa5a4('0x25')]=_0x1a8d78[_0xa5a4('0x32')]()===_0xa5a4('0x3c')?_0x277293['destcalleridnum']:_0x277293[_0xa5a4('0x60')];_0x4a8d7a[_0xa5a4('0x61')]=_0x1a8d78===_0xa5a4('0x62')||_0x1a8d78==='unmanaged'?_0xa5a4('0x62'):_0xa5a4('0x3c');var _0xed0fb0=util[_0xa5a4('0x55')](_0xa5a4('0x63'),_0x59e469[_0xa5a4('0x5c')],_0x277293[_0xa5a4('0x64')],md5(_0x277293[_0xa5a4('0x64')]));if(_0x157c60&&_0x157c60[_0xa5a4('0x65')]){logger[_0xa5a4('0x14')](_0xa5a4('0x66'),_0xa5a4('0x67'));_0x277293[_0xa5a4('0x68')]=_0xed0fb0;}else if(_0x5ea18a&&_0x5ea18a[_0xa5a4('0x69')]&&_0x5ea18a['recordingFormat']!==_0xa5a4('0x6a')){logger[_0xa5a4('0x14')](_0xa5a4('0x6b'),_0xa5a4('0x67'));_0x277293[_0xa5a4('0x68')]=_0xed0fb0;}else{_0x277293['recordingURL']='';}return getAdminUser(_0x1a8d78,_0x55b11a,_0x4a8d7a,_0xa3fc59,_0x14d362,_0x3c0b4f)[_0xa5a4('0xc')](getUser(_0x1a8d78,_0x55b11a,_0xa3fc59,_0x14d362,_0x3c0b4f))['then'](getEndUser(_0x1a8d78,_0x55b11a,_0xa3fc59,_0x14d362,_0x3c0b4f))[_0xa5a4('0xc')](getTicket(_0x1a8d78,_0x55b11a,_0xa3fc59,_0x4ff24b,_0x277293,_0x14d362))[_0xa5a4('0xc')](function(_0x174fe8){logger['info'](util[_0xa5a4('0x55')](_0xa5a4('0x6c'),_0x174fe8[_0xa5a4('0x42')]));logger[_0xa5a4('0x14')](util[_0xa5a4('0x55')](_0xa5a4('0x6d'),_0x1a8d78));if(_0x1a8d78!==_0xa5a4('0x6e')){logger[_0xa5a4('0x14')]('['+[_0x1a8d78[_0xa5a4('0xf')]()]+']',_0xa5a4('0x6f'));emit(_0x59e469[_0xa5a4('0x5a')],_0x4145cb['name'],_0x174fe8[_0xa5a4('0x42')]);}})[_0xa5a4('0x11')](function(_0x15a59b){logger[_0xa5a4('0x12')]('['+[_0x1a8d78[_0xa5a4('0xf')]()]+']\x20Error\x20running\x20ServiceNow\x20integration',util[_0xa5a4('0x70')](_0x15a59b,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
+var _0xb0fd=['uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','ticketId',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','bluebird','request-promise','util','./util','../../../../config/environment','../../../../config/logger','redis','localhost','GET','sys_user?sysparm_query=user_name%3Dadmin','result','length','adminId','toUpperCase','],\x20getAdminUser\x20crm','message','info','],\x20getUser\x20input\x20crm','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','active','true','userId','adminEmail','catch','error','],\x20createEndUser\x20input\x20crm','POST','endUserNumber','user','System','then','],\x20EndUser\x20schema','endUserId','sys_id','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','includes','picklist','type','nameField','toLowerCase','content','toString','string','idField','customField','variableName','Variable','name',']\x20getTicket\x20input\x20crm','assign','getString','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','number',']\x20getTicket\x20crm','label','incident','Incident','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','map','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','emit','trigger:browser:url','username','password','sysparm_limit=1','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','isNil','email','outbound','destcalleridnum','calleridnum','callDirection','queue','unmanaged'];(function(_0x2c643a,_0x3bfe37){var _0x40cbe1=function(_0x40d0bb){while(--_0x40d0bb){_0x2c643a['push'](_0x2c643a['shift']());}};_0x40cbe1(++_0x3bfe37);}(_0xb0fd,0xdb));var _0xdb0f=function(_0x3bf925,_0x4dd8e4){_0x3bf925=_0x3bf925-0x0;var _0x2128a1=_0xb0fd[_0x3bf925];return _0x2128a1;};'use strict';var _=require(_0xdb0f('0x0'));var Promise=require(_0xdb0f('0x1'));var rp=require(_0xdb0f('0x2'));var util=require(_0xdb0f('0x3'));var md5=require('md5');var Redis=require('ioredis');var intUtil=require(_0xdb0f('0x4'));var config=require(_0xdb0f('0x5'));var logger=require(_0xdb0f('0x6'))('servicenow');config[_0xdb0f('0x7')]=_['defaults'](config['redis'],{'host':_0xdb0f('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xdb0f('0x7')]));function getAdminUser(_0x4a2946,_0x588977,_0x1b0eb8,_0x2effad,_0x454809,_0xdf95e2){return new Promise(function(_0x2f5ba5,_0x194ef2){var _0xcc6ddb={'method':_0xdb0f('0x9'),'uri':_0x2effad+_0xdb0f('0xa')+'&'+_0x454809+'&'+_0xdf95e2,'auth':_0x588977,'json':!![]};return rp(_0xcc6ddb)['then'](function(_0x463daa){if(_0x463daa[_0xdb0f('0xb')][_0xdb0f('0xc')]>0x0){_0x1b0eb8[_0xdb0f('0xd')]=_0x463daa[_0xdb0f('0xb')][0x0]['sys_id'];}logger['info']('['+[_0x4a2946[_0xdb0f('0xe')]()]+_0xdb0f('0xf'),_0x1b0eb8);_0x2f5ba5(_0x1b0eb8);})['catch'](function(_0x3f4ea1){logger['error']('['+[_0x4a2946[_0xdb0f('0xe')]()]+']',_0x3f4ea1[_0xdb0f('0x10')]);_0x194ef2(_0x3f4ea1[_0xdb0f('0x10')]);});});}function getUser(_0x376880,_0x2a0b72,_0x1acd79,_0x34011a,_0x4dee83){return function(_0x220d3e){logger[_0xdb0f('0x11')]('['+[_0x376880['toUpperCase']()]+_0xdb0f('0x12'),_0x220d3e);return new Promise(function(_0x228c6f,_0x527d47){if(intUtil['validateEmail'](_0x220d3e[_0xdb0f('0x13')])){var _0x5dbeb4={'method':'GET','uri':_0x1acd79+_0xdb0f('0x14')+_0x220d3e['userEmail']+'&'+_0x34011a+'&'+_0x4dee83,'auth':_0x2a0b72,'json':!![]};logger[_0xdb0f('0x11')]('['+[_0x376880[_0xdb0f('0xe')]()]+_0xdb0f('0x15'),_0x5dbeb4);return rp(_0x5dbeb4)['then'](function(_0x3d340c){logger['info']('['+[_0x376880[_0xdb0f('0xe')]()]+_0xdb0f('0x16'),_0x3d340c);if(_0x3d340c['result']['length']>0x0&&String(_0x3d340c['result'][0x0][_0xdb0f('0x17')])===_0xdb0f('0x18')){_0x220d3e[_0xdb0f('0x19')]=_0x3d340c['result'][0x0]['sys_id'];}else{_0x220d3e['userId']=_0x220d3e[_0xdb0f('0xd')];_0x220d3e[_0xdb0f('0x13')]=_0x220d3e[_0xdb0f('0x1a')];}logger[_0xdb0f('0x11')]('['+[_0x376880[_0xdb0f('0xe')]()]+'],\x20getUser\x20crm',_0x220d3e);_0x228c6f(_0x220d3e);})[_0xdb0f('0x1b')](function(_0xed8c71){logger[_0xdb0f('0x1c')]('['+[_0x376880['toUpperCase']()]+']',_0xed8c71[_0xdb0f('0x10')]);_0x527d47(_0xed8c71[_0xdb0f('0x10')]);});}else{logger['info']('['+[_0x376880['toUpperCase']()]+']\x20using\x20admin\x20profile');_0x220d3e[_0xdb0f('0x19')]=_0x220d3e['adminId'];_0x220d3e[_0xdb0f('0x13')]=_0x220d3e[_0xdb0f('0x1a')];_0x228c6f(_0x220d3e);}});};}function createEndUser(_0x499c2d,_0x42d82d,_0x411db6,_0x1d7003,_0x8f6124){logger[_0xdb0f('0x11')]('['+[_0x499c2d['toUpperCase']()]+_0xdb0f('0x1d'),_0x411db6);return new Promise(function(_0x3d7710,_0x5eb706){var _0x350fd8={'method':_0xdb0f('0x1e'),'uri':_0x1d7003+'sys_user?'+_0x8f6124,'body':{'user_name':_0x411db6[_0xdb0f('0x1f')],'roles':_0xdb0f('0x20'),'first_name':_0x411db6['endUserNumber'],'active':_0xdb0f('0x18'),'date_format':_0xdb0f('0x21'),'phone':_0x411db6[_0xdb0f('0x1f')]},'auth':_0x42d82d,'json':!![]};return rp(_0x350fd8)[_0xdb0f('0x22')](function(_0x3341e3){logger['info']('['+[_0x499c2d[_0xdb0f('0xe')]()]+_0xdb0f('0x23'),_0x3341e3[_0xdb0f('0xb')]);_0x411db6[_0xdb0f('0x24')]=_0x3341e3['result'][_0xdb0f('0x25')];_0x3d7710(_0x411db6);})[_0xdb0f('0x1b')](function(_0x527d3e){logger[_0xdb0f('0x1c')]('['+[_0x499c2d['toUpperCase']()]+']',_0x527d3e[_0xdb0f('0x10')]);_0x5eb706(_0x527d3e[_0xdb0f('0x10')]);});});}function getEndUser(_0x6fd98c,_0x3ac6fd,_0x5c0a24,_0x528d97,_0x35eb0d){return function(_0x3fb838){logger[_0xdb0f('0x11')]('['+[_0x6fd98c[_0xdb0f('0xe')]()]+_0xdb0f('0x26'),_0x3fb838);return new Promise(function(_0x4ab893,_0x555d5c){var _0x5a975a={'method':_0xdb0f('0x9'),'uri':_0x5c0a24+_0xdb0f('0x27')+_0x3fb838[_0xdb0f('0x1f')]+'&'+_0x528d97+'&'+_0x35eb0d,'auth':_0x3ac6fd,'json':!![]};return rp(_0x5a975a)[_0xdb0f('0x22')](function(_0x545e0b){if(_0x545e0b[_0xdb0f('0xb')]['length']>0x0){_0x3fb838[_0xdb0f('0x24')]=_0x545e0b[_0xdb0f('0xb')][0x0][_0xdb0f('0x25')];logger['info']('['+[_0x6fd98c[_0xdb0f('0xe')]()]+_0xdb0f('0x28'),_0x3fb838);_0x4ab893(_0x3fb838);}else{return createEndUser(_0x6fd98c,_0x3ac6fd,_0x3fb838,_0x5c0a24,_0x528d97)[_0xdb0f('0x22')](function(_0x232af5){logger[_0xdb0f('0x11')]('['+[_0x6fd98c['toUpperCase']()]+_0xdb0f('0x29'),_0x232af5);_0x4ab893(_0x232af5);});}})[_0xdb0f('0x1b')](function(_0x1aae54){logger[_0xdb0f('0x1c')]('['+[_0x6fd98c[_0xdb0f('0xe')]()]+']',_0x1aae54[_0xdb0f('0x10')]);_0x555d5c(_0x1aae54[_0xdb0f('0x10')]);});});};}function getCustomFields(_0x591b07,_0x2049b6){var _0x43f04f={};if(_0x591b07[_0xdb0f('0xc')]>0x0){_[_0xdb0f('0x2a')](_0x591b07,function(_0x383dfc){if(_[_0xdb0f('0x2b')](['string',_0xdb0f('0x2c')],_0x383dfc[_0xdb0f('0x2d')])&&_0x383dfc[_0xdb0f('0x2e')]&&!_0x383dfc['customField']){_0x43f04f[_0x383dfc['nameField'][_0xdb0f('0x2f')]()]=_0x383dfc[_0xdb0f('0x30')][_0xdb0f('0x31')]();}else if(_[_0xdb0f('0x2b')]([_0xdb0f('0x32'),_0xdb0f('0x2c')],_0x383dfc['type'])&&_0x383dfc[_0xdb0f('0x33')]&&_0x383dfc[_0xdb0f('0x34')]){_0x43f04f[_0x383dfc[_0xdb0f('0x33')][_0xdb0f('0x2f')]()]=_0x383dfc[_0xdb0f('0x30')][_0xdb0f('0x31')]();}else if(_0x383dfc[_0xdb0f('0x2d')]==='variable'&&_0x383dfc[_0xdb0f('0x35')]&&_0x383dfc[_0xdb0f('0x33')]&&_0x383dfc[_0xdb0f('0x34')]){_0x43f04f[_0x383dfc[_0xdb0f('0x33')][_0xdb0f('0x2f')]()]=_0x2049b6[_0x383dfc[_0xdb0f('0x35')]]['toString']();}else if(_0x383dfc[_0xdb0f('0x2d')]==='customVariable'&&_0x383dfc[_0xdb0f('0x36')]&&_0x383dfc[_0xdb0f('0x36')][_0xdb0f('0x37')]&&_0x383dfc['idField']&&_0x383dfc['customField']){_0x43f04f[_0x383dfc['idField'][_0xdb0f('0x2f')]()]=_0x2049b6[_0x383dfc['Variable']['name'][_0xdb0f('0x2f')]()][_0xdb0f('0x31')]();}});}return _0x43f04f;}function getTicket(_0x1d236f,_0x1bd474,_0x24fcd2,_0x280f06,_0x1b4991,_0x53727a){return function(_0x2d9e27){logger[_0xdb0f('0x11')]('['+[_0x1d236f[_0xdb0f('0xe')]()]+_0xdb0f('0x38'),_0x2d9e27);return new Promise(function(_0xa9bc4f,_0xf893fc){var _0x4cfc5e=_0x1d236f[_0xdb0f('0x2f')]()==='outbound'?_0x2d9e27['userId']:_0x2d9e27['endUserId'];var _0x55f82f={'method':'POST','uri':_0x24fcd2+'incident'+'?'+_0x53727a,'body':Object[_0xdb0f('0x39')]({},{'active':_0xdb0f('0x18'),'caller_id':_0x4cfc5e,'assigned_to':_0x2d9e27[_0xdb0f('0x19')],'short_description':intUtil[_0xdb0f('0x3a')](_0x280f06['Subjects'],_0x1b4991,'\x20'),'description':intUtil[_0xdb0f('0x3a')](_0x280f06[_0xdb0f('0x3b')],_0x1b4991,'\x0a')},getCustomFields(_0x280f06[_0xdb0f('0x3c')],_0x1b4991)),'auth':_0x1bd474,'json':!![]};return rp(_0x55f82f)[_0xdb0f('0x22')](function(_0x51f9f4){logger[_0xdb0f('0x11')]('['+[_0x1d236f[_0xdb0f('0xe')]()]+_0xdb0f('0x3d'),_0x51f9f4['result']);_0x2d9e27['ticketId']=_0x51f9f4[_0xdb0f('0xb')][_0xdb0f('0x25')];_0x2d9e27['ticketNumber']=_0x51f9f4['result'][_0xdb0f('0x3e')];logger['info']('['+[_0x1d236f[_0xdb0f('0xe')]()]+_0xdb0f('0x3f'),_0x2d9e27);_0xa9bc4f(_0x2d9e27);})[_0xdb0f('0x1b')](function(_0x265f2c){logger['error']('['+[_0x1d236f[_0xdb0f('0xe')]()]+']',_0x265f2c[_0xdb0f('0x10')]);_0xf893fc(_0x265f2c[_0xdb0f('0x10')]);});});};}function createRemoteTag(_0x2c3107,_0x1daeeb,_0xe24ee0,_0x41fd4d){return new Promise(function(_0x1a38b9,_0x21d5dc){var _0x20e357={'method':_0xdb0f('0x1e'),'uri':_0xe24ee0+_0xdb0f('0x40')+'?'+_0x41fd4d,'body':{'short_description':_0x2c3107,'global':!![],'active':!![],'name':_0x2c3107},'auth':_0x1daeeb,'json':!![]};return rp(_0x20e357)['then'](function(_0x4d16a5){var _0x70892d=_0x4d16a5[_0xdb0f('0xb')][_0xdb0f('0x25')];_0x1a38b9(_0x70892d);});});}function getRemoteTag(_0x4b56a8,_0x3cc057,_0x16dab1,_0x1fec7c,_0x2c92dd){return new Promise(function(_0x2ed4a1,_0x12ab4f){var _0x4fd218={'method':_0xdb0f('0x9'),'uri':_0x16dab1+_0xdb0f('0x40')+'?sysparm_query=name%3D'+_0x4b56a8+'&'+_0x1fec7c,'auth':_0x3cc057,'json':!![]};return rp(_0x4fd218)['then'](function(_0x5517ad){if(_0x5517ad[_0xdb0f('0xb')]['length']>0x0){var _0x432dae=_0x5517ad[_0xdb0f('0xb')][0x0][_0xdb0f('0x25')];_0x2ed4a1(_0x432dae);}else{return createRemoteTag(_0x4b56a8,_0x3cc057,_0x16dab1,_0x1fec7c)['then'](function(_0x4bb125){_0x2ed4a1(_0x4bb125);});}});});}function assignTagToIncident(_0x45e8c0,_0x587987,_0x51fc06,_0x38512d,_0x35f9a0){return new Promise(function(_0x4a76c0,_0x5a3196){var _0x50e234={'method':_0xdb0f('0x1e'),'uri':_0x51fc06+'label_entry'+'?'+_0x35f9a0,'body':{'label':_0x45e8c0,'table':_0xdb0f('0x41'),'id_type':_0xdb0f('0x42'),'table_key':_0x38512d['ticketId'],'title':'Incident\x20-\x20'+_0x38512d['ticketNumber'],'id_display':_0x38512d['ticketNumber']},'auth':_0x587987,'json':!![]};return rp(_0x50e234)[_0xdb0f('0x22')](function(_0x16490d){_0x4a76c0();})[_0xdb0f('0x1b')](function(){_0x4a76c0();});});}function manageTags(_0x2f6d9d,_0x58ca58,_0x431645,_0x12d014,_0x5446ce,_0x38bd5c,_0x337d01){return new Promise(function(_0x175ac5,_0x707d0a){var _0x38231e=[];_0x58ca58[_0xdb0f('0x2a')](function(_0x2621e2){_0x38231e[_0xdb0f('0x43')](getRemoteTag(_0x2621e2,_0x431645,_0x12d014,_0x38bd5c,_0x337d01));});return Promise[_0xdb0f('0x44')](_0x38231e)[_0xdb0f('0x22')](function(_0x1dc6d8){if(_0x1dc6d8['length']){logger[_0xdb0f('0x11')]('['+[_0x2f6d9d[_0xdb0f('0xe')]()]+_0xdb0f('0x45'),_0x1dc6d8);var _0x46ceac=[];_0x1dc6d8[_0xdb0f('0x2a')](function(_0x1e50ce){_0x46ceac[_0xdb0f('0x43')](assignTagToIncident(_0x1e50ce,_0x431645,_0x12d014,_0x5446ce,_0x38bd5c));});return Promise['all'](_0x46ceac)[_0xdb0f('0x22')](function(){_0x175ac5();})['catch'](function(){_0x175ac5();});}else{_0x175ac5();}});});}function getTags(_0x952fc1,_0x2f7525,_0x5154b5,_0x6e6706,_0x1542d3,_0x2fe382){return function(_0x3a34b4){return new Promise(function(_0x6feec2,_0x53eaa0){var _0x2ac498=[];var _0x202545=_0x6e6706[_0xdb0f('0x46')];if(_0x202545&&_0x202545[_0xdb0f('0xc')]>0x0){_0x2ac498=_[_0xdb0f('0x47')](_0x202545,'name');}if(_0x2ac498['length']>0x0){return manageTags(_0x952fc1,_0x2ac498,_0x2f7525,_0x5154b5,_0x3a34b4,_0x1542d3,_0x2fe382)[_0xdb0f('0x22')](function(){_0x6feec2(_0x3a34b4);});}else{_0x6feec2(_0x3a34b4);}});};}function emit(_0x3425cb,_0x269fa2,_0x4df9f4){var _0x57de54='%26sysparm_record_target%3Dincident'+_0xdb0f('0x48')+_0xdb0f('0x49')+_0xdb0f('0x4a');var _0x25780f={'uri':_0x3425cb+_0xdb0f('0x4b')+_0x4df9f4+_0x57de54};io['to'](util[_0xdb0f('0x4c')](_0xdb0f('0x4d'),_0x269fa2))[_0xdb0f('0x4e')](_0xdb0f('0x4f'),_0x25780f);}exports['cs']=function(_0x4d227a,_0x2602c8,_0x1678a6,_0x3bcbf6,_0x141752,_0x39f387,_0x3ca0a3,_0x1a878e){var _0xa5fdac={};var _0x320122={'user':_0x39f387[_0xdb0f('0x50')],'pass':_0x39f387[_0xdb0f('0x51')]};var _0x547adf=_0xdb0f('0x52');var _0x3aaf0c=_0xdb0f('0x53');_0x39f387[_0xdb0f('0x54')]=intUtil[_0xdb0f('0x55')](_0x39f387['remoteUri']);_0x39f387[_0xdb0f('0x56')]=intUtil[_0xdb0f('0x55')](_0x39f387['serverUrl']);var _0x1996bc=util['format'](_0xdb0f('0x57'),_0x39f387['remoteUri']);_0xa5fdac[_0xdb0f('0x13')]=!_[_0xdb0f('0x58')](_0x3bcbf6)?_0x3bcbf6[_0xdb0f('0x59')]:null;_0xa5fdac['adminEmail']=_0x39f387[_0xdb0f('0x59')];_0xa5fdac[_0xdb0f('0x1f')]=_0x1a878e[_0xdb0f('0x2f')]()===_0xdb0f('0x5a')?_0x2602c8[_0xdb0f('0x5b')]:_0x2602c8[_0xdb0f('0x5c')];_0xa5fdac[_0xdb0f('0x5d')]=_0x1a878e===_0xdb0f('0x5e')||_0x1a878e===_0xdb0f('0x5f')?_0xdb0f('0x5e'):_0xdb0f('0x5a');var _0x1e4862=util[_0xdb0f('0x4c')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x39f387[_0xdb0f('0x56')],_0x2602c8[_0xdb0f('0x60')],md5(_0x2602c8[_0xdb0f('0x60')]));if(_0x141752&&_0x141752[_0xdb0f('0x61')]){logger[_0xdb0f('0x11')]('[QUEUE]',_0xdb0f('0x62'));_0x2602c8[_0xdb0f('0x63')]=_0x1e4862;}else if(_0x3ca0a3&&_0x3ca0a3[_0xdb0f('0x64')]&&_0x3ca0a3['recordingFormat']!==_0xdb0f('0x65')){logger[_0xdb0f('0x11')]('[OUTBOUND]',_0xdb0f('0x62'));_0x2602c8[_0xdb0f('0x63')]=_0x1e4862;}else{_0x2602c8[_0xdb0f('0x63')]='';}return getAdminUser(_0x1a878e,_0x320122,_0xa5fdac,_0x1996bc,_0x3aaf0c,_0x547adf)[_0xdb0f('0x22')](getUser(_0x1a878e,_0x320122,_0x1996bc,_0x3aaf0c,_0x547adf))[_0xdb0f('0x22')](getEndUser(_0x1a878e,_0x320122,_0x1996bc,_0x3aaf0c,_0x547adf))['then'](getTicket(_0x1a878e,_0x320122,_0x1996bc,_0x1678a6,_0x2602c8,_0x3aaf0c))['then'](function(_0x365061){logger[_0xdb0f('0x11')](util[_0xdb0f('0x4c')]('The\x20ticket\x20ID\x20is:\x20%s',_0x365061[_0xdb0f('0x66')]));logger['info'](util[_0xdb0f('0x4c')]('call\x20direction:\x20%s',_0x1a878e));if(_0x1a878e!==_0xdb0f('0x5f')){logger[_0xdb0f('0x11')]('['+[_0x1a878e[_0xdb0f('0xe')]()]+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x39f387[_0xdb0f('0x54')],_0x3bcbf6[_0xdb0f('0x37')],_0x365061[_0xdb0f('0x66')]);}})[_0xdb0f('0x1b')](function(_0x5683dc){logger[_0xdb0f('0x1c')]('['+[_0x1a878e['toUpperCase']()]+_0xdb0f('0x67'),util[_0xdb0f('0x68')](_0x5683dc,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
index dd5242d..fa3ea8b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x388c=['%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','error','uri','none','[OUTBOUND]','destcalleridnum','The\x20Enduser\x20ID\x20is:','Fields','Outbound','Ticket\x20created!','version','catch','unmanaged','monitor_format','lastevent','toUpperCase','lodash','request-promise','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','sugarcrm','defaults','redis','localhost','socket.io-emitter','POST','emit','info','Creating\x20new\x20ticket...','name','getString','Subjects','assigned_user_id','created_by','Descriptions','date_start','duration_hours','duration_minutes','parent_id','parent_name','direction','length','forEach','variableName','idField','set_entry','JSON','stringify','Calls','format','Basic\x20%s','base64','isNil','Getting\x20agent\x20with\x20name','get_entry_list','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','entry_list','find','name_value_list','value','Agent\x20found!','resolve','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','Contacts','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','<unknown>','Caller\x20-\x20%s','Enduser\x20created.','first_name','debug','[HTTP]','map','type','string','customField','nameField','toLowerCase','content','toString','custom_fields','push','customVariable','Variable','login','username','password','PLAIN','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','remoteUri','serverUrl','stripTrailingSlash','%s/service/v4_1/rest.php','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridnum','Inbound','The\x20Ticket\x20ID\x20is:','users','contacts'];(function(_0x9df060,_0x253d33){var _0x338dfe=function(_0x17d9a5){while(--_0x17d9a5){_0x9df060['push'](_0x9df060['shift']());}};_0x338dfe(++_0x253d33);}(_0x388c,0x103));var _0xc388=function(_0x5cbe8b,_0x62e4af){_0x5cbe8b=_0x5cbe8b-0x0;var _0x3a5fa9=_0x388c[_0x5cbe8b];return _0x3a5fa9;};'use strict';var _=require(_0xc388('0x0'));var rp=require(_0xc388('0x1'));var BPromise=require('bluebird');var md5=require(_0xc388('0x2'));var util=require(_0xc388('0x3'));var Redis=require(_0xc388('0x4'));var intUtil=require(_0xc388('0x5'));var config=require(_0xc388('0x6'));var logger=require(_0xc388('0x7'))(_0xc388('0x8'));config['redis']=_[_0xc388('0x9')](config[_0xc388('0xa')],{'host':_0xc388('0xb'),'port':0x18eb});var io=require(_0xc388('0xc'))(new Redis(config['redis']));var def={'method':_0xc388('0xd'),'json':!![]};function emit(_0x4ac9d7,_0x233004,_0xf14a75){io['to'](_0x4ac9d7)[_0xc388('0xe')](_0x233004,_0xf14a75);}function getTicket(_0x5ec17f,_0x47fe9d,_0xf3d134,_0x5cb3d1,_0x3cecac,_0x505846,_0x16c7bb,_0x4b61df){logger[_0xc388('0xf')](_0xc388('0x10'));var _0x31db23=new Date();var _0x16d7bc=[{'name':_0xc388('0x11'),'value':intUtil[_0xc388('0x12')](_0x5cb3d1[_0xc388('0x13')],_0x3cecac,'\x20')},{'name':_0xc388('0x14'),'value':_0x47fe9d['id']},{'name':_0xc388('0x15'),'value':_0x47fe9d['id']},{'name':'description','value':intUtil[_0xc388('0x12')](_0x5cb3d1[_0xc388('0x16')],_0x3cecac,'\x0a')},{'name':_0xc388('0x17'),'value':_0x31db23['toISOString']()['slice'](0x0,0x13)['replace']('T','\x20')},{'name':_0xc388('0x18'),'value':'0'},{'name':_0xc388('0x19'),'value':'15'},{'name':_0xc388('0x1a'),'value':_0xf3d134['id']},{'name':'parent_type','value':'Contacts'},{'name':_0xc388('0x1b'),'value':_0xf3d134[_0xc388('0x11')]},{'name':_0xc388('0x1c'),'value':_0x4b61df}];if(_0x505846[_0xc388('0x1d')]){_[_0xc388('0x1e')](_0x505846,function(_0x46ecf2){if(_0x3cecac[_0x46ecf2[_0xc388('0x1f')]]){_0x16d7bc['push']({'name':_0x46ecf2[_0xc388('0x20')],'value':_0x3cecac[_0x46ecf2[_0xc388('0x1f')]]});}});}return request({'form':{'method':_0xc388('0x21'),'input_type':_0xc388('0x22'),'response_type':_0xc388('0x22'),'rest_data':JSON[_0xc388('0x23')]({'session':_0x16c7bb['id'],'module_name':_0xc388('0x24'),'name_value_list':_0x16d7bc})}});}function getAuth(_0x5b3ade){return util[_0xc388('0x25')](_0xc388('0x26'),new Buffer(_0x5b3ade['apiKey']+':X')['toString'](_0xc388('0x27')));}function getServerInfo(_0x545819){return request({'form':{'method':'get_server_info','input_type':'JSON','response_type':_0xc388('0x22'),'rest_data':JSON[_0xc388('0x23')]({'session':_0x545819['id']})}});}function getUser(_0x27ee88,_0x387da1,_0x446e2d){if(!_[_0xc388('0x28')](_0x387da1)){logger[_0xc388('0xf')](_0xc388('0x29'),_0x387da1);return request({'form':{'method':_0xc388('0x2a'),'input_type':'JSON','response_type':_0xc388('0x22'),'rest_data':JSON[_0xc388('0x23')]({'session':_0x446e2d['id'],'module_name':_0xc388('0x2b'),'query':util[_0xc388('0x25')](_0xc388('0x2c'),_0x387da1),'order_by':'','offset':'0','select_fields':['id',_0xc388('0x11'),_0xc388('0x2d')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xc388('0x2e')](function(_0x267f6d){if(_0x267f6d[_0xc388('0x2f')][_0xc388('0x1d')]){var _0x716073=_[_0xc388('0x30')](_0x267f6d['entry_list'],function(_0x104c8b){return _0x104c8b[_0xc388('0x31')][_0xc388('0x2d')][_0xc388('0x32')]===_0x387da1;});if(_0x716073){logger[_0xc388('0xf')](_0xc388('0x33'));return BPromise[_0xc388('0x34')]({'id':_0x716073[_0xc388('0x31')]['id']['value'],'name':_0x716073[_0xc388('0x31')][_0xc388('0x11')]['value']});}}logger[_0xc388('0xf')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0xc388('0x34')]({'id':_0x446e2d['name_value_list']['user_id'][_0xc388('0x32')],'name':_0x446e2d[_0xc388('0x31')][_0xc388('0x2d')][_0xc388('0x32')]});});}else{logger['info'](_0xc388('0x35'));return BPromise[_0xc388('0x34')]({'id':_0x446e2d[_0xc388('0x31')]['user_id'][_0xc388('0x32')],'name':_0x446e2d[_0xc388('0x31')][_0xc388('0x2d')][_0xc388('0x32')]});}}function getEndUser(_0x3f1142,_0x4ab504,_0x272d9d,_0x3c8c1c){logger['info'](_0xc388('0x36'),_0x272d9d);return request({'form':{'method':_0xc388('0x2a'),'input_type':_0xc388('0x22'),'response_type':_0xc388('0x22'),'rest_data':JSON[_0xc388('0x23')]({'session':_0x3c8c1c['id'],'module_name':_0xc388('0x37'),'query':util['format'](_0xc388('0x38'),_0x272d9d),'order_by':'','offset':'0','select_fields':['id',_0xc388('0x11'),_0xc388('0x39')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xc388('0x2e')](function(_0x2496d7){if(_0x2496d7['entry_list'][_0xc388('0x1d')]){var _0x10380d=_['find'](_0x2496d7['entry_list'],function(_0x2eebb3){return _0x2eebb3[_0xc388('0x31')][_0xc388('0x39')][_0xc388('0x32')]===_0x272d9d;});if(_0x10380d){logger[_0xc388('0xf')]('Enduser\x20found!');return BPromise['resolve']({'id':_0x10380d['name_value_list']['id'][_0xc388('0x32')],'name':_0x10380d[_0xc388('0x31')][_0xc388('0x11')][_0xc388('0x32')],'phone':_0x10380d[_0xc388('0x31')][_0xc388('0x39')][_0xc388('0x32')]});}}else{logger[_0xc388('0xf')](_0xc388('0x3a'));return request({'form':{'method':'set_entry','input_type':_0xc388('0x22'),'response_type':_0xc388('0x22'),'rest_data':JSON[_0xc388('0x23')]({'session':_0x3c8c1c['id'],'module_name':_0xc388('0x37'),'name_value_list':[{'name':'first_name','value':_0x4ab504!==_0xc388('0x3b')?_0x4ab504:util[_0xc388('0x25')](_0xc388('0x3c'),_0x272d9d)},{'name':_0xc388('0x39'),'value':_0x272d9d}]})}})[_0xc388('0x2e')](function(_0x257a03){logger[_0xc388('0xf')](_0xc388('0x3d'));return BPromise[_0xc388('0x34')]({'id':_0x257a03['id'],'name':_0x257a03[_0xc388('0x2f')][_0xc388('0x3e')][_0xc388('0x32')],'phone':_0x257a03[_0xc388('0x2f')][_0xc388('0x39')][_0xc388('0x32')]});});}});}function request(_0x18b11e){logger[_0xc388('0x3f')](_0xc388('0x40'),JSON[_0xc388('0x23')](_0x18b11e));return rp(_['merge'](def,_0x18b11e));}function getTags(_0x390594,_0x2695d4){var _0x185081=[];if(_0x390594&&_0x390594['length']>0x0){_0x185081=_[_0xc388('0x41')](_0x390594,_0x2695d4);}return _0x185081;}function getCustomFields(_0x4e97c9,_0x4123e8){var _0x3a3377=[];var _0x53c2a1={'custom_fields':[]};if(_0x4e97c9['length']>0x0){_[_0xc388('0x1e')](_0x4e97c9,function(_0x36f255){if(_0x36f255[_0xc388('0x42')]===_0xc388('0x43')&&_0x36f255['nameField']&&!_0x36f255[_0xc388('0x44')]){_0x53c2a1[_0x36f255[_0xc388('0x45')][_0xc388('0x46')]()]=_0x36f255[_0xc388('0x47')][_0xc388('0x48')]();}else if(_0x36f255[_0xc388('0x42')]==='string'&&_0x36f255[_0xc388('0x20')]&&_0x36f255['customField']){_0x53c2a1[_0xc388('0x49')][_0xc388('0x4a')]({'id':_0x36f255[_0xc388('0x20')],'value':_0x36f255[_0xc388('0x47')][_0xc388('0x48')]()});}else if(_0x36f255[_0xc388('0x42')]==='variable'&&_0x36f255[_0xc388('0x1f')]&&_0x36f255['idField']&&_0x36f255[_0xc388('0x44')]){_0x4123e8[_0x36f255['variableName']]&&_0x53c2a1[_0xc388('0x49')][_0xc388('0x4a')]({'id':_0x36f255[_0xc388('0x20')],'value':_0x4123e8[_0x36f255[_0xc388('0x1f')]][_0xc388('0x48')]()});}else if(_0x36f255[_0xc388('0x42')]===_0xc388('0x4b')&&_0x36f255[_0xc388('0x4c')]&&_0x36f255['Variable']['name']&&_0x36f255[_0xc388('0x20')]&&_0x36f255[_0xc388('0x44')]){_0x4123e8[_0x36f255['Variable'][_0xc388('0x11')][_0xc388('0x46')]()]&&_0x53c2a1[_0xc388('0x49')]['push']({'id':_0x36f255[_0xc388('0x20')],'value':_0x4123e8[_0x36f255['Variable'][_0xc388('0x11')][_0xc388('0x46')]()]['toString']()});}});}return _0x53c2a1;}function getConnection(_0x4f922b){return request({'method':_0xc388('0xd'),'form':{'method':_0xc388('0x4d'),'input_type':_0xc388('0x22'),'response_type':_0xc388('0x22'),'rest_data':JSON[_0xc388('0x23')]({'user_auth':{'user_name':_0x4f922b[_0xc388('0x4e')],'password':_0x4f922b[_0xc388('0x4f')],'encryption':_0xc388('0x50')},'application':'xCALLY\x20Motion\x20integration'})}})[_0xc388('0x2e')](function(_0x14214e){var _0x227fb0=_0x14214e;if(_0x227fb0['id']){def[_0xc388('0x51')]=_0x227fb0['id'];return BPromise[_0xc388('0x34')](_0x227fb0);}else{throw new Error(util[_0xc388('0x25')](_0xc388('0x52'),_0x4f922b['id']));}});}function setRelationship(_0x54085b,_0x2153ae,_0x149db2,_0x466444){return request({'form':{'method':_0xc388('0x53'),'input_type':_0xc388('0x22'),'response_type':_0xc388('0x22'),'rest_data':JSON[_0xc388('0x23')]({'session':_0x54085b['id'],'module_name':'Calls','module_id':_0x149db2['id'],'link_field_name':_0x466444,'related_ids':[_0x2153ae['id']],'name_value_list':[],'delete':0x0})}});}exports['queue']=function(_0x523d85,_0x1ed1ce,_0x5d39b4,_0x4a3bc0,_0x551949,_0x5649fe){var _0x3a22e8,_0x3389ed,_0x3e3a44,_0x132dea;_0x5649fe['remoteUri']=intUtil['stripTrailingSlash'](_0x5649fe[_0xc388('0x54')]);_0x5649fe[_0xc388('0x55')]=intUtil[_0xc388('0x56')](_0x5649fe[_0xc388('0x55')]);def['uri']=util[_0xc388('0x25')](_0xc388('0x57'),_0x5649fe['remoteUri']);if(_0x551949&&_0x551949['monitor_format']){logger[_0xc388('0xf')]('[QUEUE]',_0xc388('0x58'));_0x1ed1ce[_0xc388('0x59')]=util[_0xc388('0x25')](_0xc388('0x5a'),_0x5649fe[_0xc388('0x55')],_0x1ed1ce[_0xc388('0x5b')],md5(_0x1ed1ce[_0xc388('0x5b')]));}else{_0x1ed1ce[_0xc388('0x59')]='';}return getConnection(_0x5649fe)[_0xc388('0x2e')](function(_0x41816d){_0x132dea=_0x41816d;return getUser(_0x5649fe,_0x4a3bc0[_0xc388('0x11')],_0x132dea);})[_0xc388('0x2e')](function(_0x1f2c64){_0x3a22e8=_0x1f2c64;logger[_0xc388('0xf')](_0xc388('0x5c'),_0x3a22e8['id']);return getEndUser(_0x5649fe,_0x1ed1ce['calleridname'],_0x1ed1ce[_0xc388('0x5d')],_0x132dea);})[_0xc388('0x2e')](function(_0x4ff8d5){_0x3389ed=_0x4ff8d5;logger[_0xc388('0xf')]('The\x20Enduser\x20ID\x20is:',_0x3389ed['id']);return getTicket(_0x5649fe,_0x3a22e8,_0x3389ed,_0x5d39b4,_0x1ed1ce,_0x5d39b4['Fields'],_0x132dea,_0xc388('0x5e'));})[_0xc388('0x2e')](function(_0x17ac14){_0x3e3a44=_0x17ac14;logger[_0xc388('0xf')]('Ticket\x20created!');logger[_0xc388('0xf')](_0xc388('0x5f'),_0x3e3a44['id']);return setRelationship(_0x132dea,_0x3a22e8,_0x3e3a44,_0xc388('0x60'));})[_0xc388('0x2e')](function(){return setRelationship(_0x132dea,_0x3389ed,_0x3e3a44,_0xc388('0x61'));})[_0xc388('0x2e')](function(){return getServerInfo(_0x132dea);})[_0xc388('0x2e')](function(_0x22c711){var _0x34c414=parseInt(_0x22c711['version']['charAt'](0x0));var _0x2adede=util['format'](_0xc388('0x62'),_0x5649fe['remoteUri'],_0x3e3a44['id']);if(_0x34c414>0x6){_0x2adede=util[_0xc388('0x25')](_0xc388('0x63'),_0x5649fe[_0xc388('0x54')],_0x3e3a44['id']);}logger['info'](_0xc388('0x64'),_0xc388('0x65'));emit(util[_0xc388('0x25')](_0xc388('0x66'),_0x4a3bc0[_0xc388('0x11')]),_0xc388('0x67'),{'uri':_0x2adede});})['catch'](function(_0x285012){logger[_0xc388('0x68')](_0xc388('0x64'),JSON['stringify'](_0x285012));});};exports['outbound']=function(_0x538381,_0x1ce262,_0x15e433,_0x3f68bd,_0x55d022,_0x3541db,_0x4b937d){var _0x401612,_0x8be3cc,_0x4a405e,_0x32c957;_0x3541db['remoteUri']=intUtil['stripTrailingSlash'](_0x3541db[_0xc388('0x54')]);_0x3541db['serverUrl']=intUtil[_0xc388('0x56')](_0x3541db['serverUrl']);def[_0xc388('0x69')]=util['format'](_0xc388('0x57'),_0x3541db[_0xc388('0x54')]);if(_0x4b937d&&_0x4b937d['recordingFormat']&&_0x4b937d['recordingFormat']!==_0xc388('0x6a')){logger[_0xc388('0xf')](_0xc388('0x6b'),_0xc388('0x58'));_0x1ce262[_0xc388('0x59')]=util[_0xc388('0x25')](_0xc388('0x5a'),_0x3541db[_0xc388('0x55')],_0x1ce262[_0xc388('0x5b')],md5(_0x1ce262[_0xc388('0x5b')]));}return getConnection(_0x3541db)[_0xc388('0x2e')](function(_0x4bf205){_0x32c957=_0x4bf205;return getUser(_0x3541db,_0x3f68bd[_0xc388('0x11')],_0x32c957);})['then'](function(_0x3be495){_0x401612=_0x3be495;logger[_0xc388('0xf')](_0xc388('0x5c'),_0x401612['id']);return getEndUser(_0x3541db,_0x1ce262['destcalleridname'],_0x1ce262[_0xc388('0x6c')],_0x32c957);})[_0xc388('0x2e')](function(_0x1f1e7e){_0x8be3cc=_0x1f1e7e;logger[_0xc388('0xf')](_0xc388('0x6d'),_0x8be3cc['id']);return getTicket(_0x3541db,_0x401612,_0x8be3cc,_0x15e433,_0x1ce262,_0x15e433[_0xc388('0x6e')],_0x32c957,_0xc388('0x6f'));})[_0xc388('0x2e')](function(_0x4b9b54){_0x4a405e=_0x4b9b54;logger[_0xc388('0xf')](_0xc388('0x70'));logger[_0xc388('0xf')](_0xc388('0x5f'),_0x4a405e['id']);return setRelationship(_0x32c957,_0x401612,_0x4a405e,_0xc388('0x60'));})[_0xc388('0x2e')](function(){return setRelationship(_0x32c957,_0x8be3cc,_0x4a405e,_0xc388('0x61'));})[_0xc388('0x2e')](function(){return getServerInfo(_0x32c957);})[_0xc388('0x2e')](function(_0x2bd632){var _0x20ea03=parseInt(_0x2bd632[_0xc388('0x71')]['charAt'](0x0));var _0x590deb=util[_0xc388('0x25')]('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x3541db[_0xc388('0x54')],_0x4a405e['id']);if(_0x20ea03>0x6){_0x590deb=util[_0xc388('0x25')](_0xc388('0x63'),_0x3541db['remoteUri'],_0x4a405e['id']);}logger[_0xc388('0xf')](_0xc388('0x6b'),_0xc388('0x65'));emit(util[_0xc388('0x25')](_0xc388('0x66'),_0x3f68bd[_0xc388('0x11')]),_0xc388('0x67'),{'uri':_0x590deb});})[_0xc388('0x72')](function(_0x1b94f1){logger[_0xc388('0x68')](_0xc388('0x6b'),JSON[_0xc388('0x23')](_0x1b94f1));});};exports[_0xc388('0x73')]=function(_0x44ac5a,_0x1783d6,_0x4827fa,_0x506533,_0x9d52e9,_0x56d66f){var _0x150197,_0x2a4174,_0x13503a,_0x17be0e;_0x56d66f[_0xc388('0x54')]=intUtil['stripTrailingSlash'](_0x56d66f[_0xc388('0x54')]);_0x56d66f['serverUrl']=intUtil['stripTrailingSlash'](_0x56d66f[_0xc388('0x55')]);def[_0xc388('0x69')]=util[_0xc388('0x25')](_0xc388('0x57'),_0x56d66f[_0xc388('0x54')]);if(_0x9d52e9&&_0x9d52e9[_0xc388('0x74')]){logger[_0xc388('0xf')]('['+_0x1783d6[_0xc388('0x75')]['toUpperCase']()+']',_0xc388('0x58'));_0x1783d6[_0xc388('0x59')]=util[_0xc388('0x25')](_0xc388('0x5a'),_0x56d66f[_0xc388('0x55')],_0x1783d6[_0xc388('0x5b')],md5(_0x1783d6[_0xc388('0x5b')]));}else{_0x1783d6[_0xc388('0x59')]='';}return getConnection(_0x56d66f)[_0xc388('0x2e')](function(_0x14076a){_0x17be0e=_0x14076a;if(!_[_0xc388('0x28')](_0x506533)){return getUser(_0x56d66f,_0x506533[_0xc388('0x11')],_0x17be0e);}else{return getUser(_0x56d66f,null,_0x17be0e);}})[_0xc388('0x2e')](function(_0x1c105a){_0x150197=_0x1c105a;logger[_0xc388('0xf')]('The\x20User\x20ID\x20is:',_0x150197['id']);return getEndUser(_0x56d66f,_0x1783d6['calleridname'],_0x1783d6[_0xc388('0x5d')],_0x17be0e);})[_0xc388('0x2e')](function(_0x2feca0){_0x2a4174=_0x2feca0;logger[_0xc388('0xf')](_0xc388('0x6d'),_0x2a4174['id']);return getTicket(_0x56d66f,_0x150197,_0x2a4174,_0x4827fa,_0x1783d6,_0x4827fa[_0xc388('0x6e')],_0x17be0e,'Inbound');})[_0xc388('0x2e')](function(_0x1f2336){_0x13503a=_0x1f2336;logger[_0xc388('0xf')](_0xc388('0x70'));logger[_0xc388('0xf')](_0xc388('0x5f'),_0x13503a['id']);return setRelationship(_0x17be0e,_0x150197,_0x13503a,_0xc388('0x60'));})[_0xc388('0x2e')](function(){return setRelationship(_0x17be0e,_0x2a4174,_0x13503a,_0xc388('0x61'));})[_0xc388('0x2e')](function(){return getServerInfo(_0x17be0e);})[_0xc388('0x72')](function(_0x14f598){logger[_0xc388('0x68')]('['+_0x1783d6[_0xc388('0x75')][_0xc388('0x76')]()+']',JSON[_0xc388('0x23')](_0x14f598));});};
\ No newline at end of file
+var _0x2acc=['none','[OUTBOUND]','destcalleridname','Fields','Outbound','Ticket\x20created!','contacts','trigger:browser:url','unmanaged','monitor_format','lastevent','toUpperCase','Inbound','lodash','request-promise','bluebird','md5','util','ioredis','./util','redis','localhost','socket.io-emitter','emit','info','name','getString','Subjects','assigned_user_id','created_by','description','toISOString','replace','duration_hours','duration_minutes','parent_id','parent_type','Contacts','parent_name','direction','length','forEach','push','idField','set_entry','JSON','stringify','Basic\x20%s','toString','base64','get_server_info','isNil','get_entry_list','format','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','then','entry_list','find','name_value_list','user_name','value','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','resolve','user_id','Searching\x20enduser\x20with\x20phone','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','<unknown>','Caller\x20-\x20%s','Enduser\x20created.','first_name','debug','[HTTP]','merge','map','type','string','customField','toLowerCase','content','variableName','custom_fields','Variable','POST','login','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','Calls','queue','remoteUri','stripTrailingSlash','serverUrl','uri','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','users','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','catch','error','outbound','%s/service/v4_1/rest.php','recordingFormat'];(function(_0x40a73b,_0x34fbe2){var _0x24082b=function(_0x1141bd){while(--_0x1141bd){_0x40a73b['push'](_0x40a73b['shift']());}};_0x24082b(++_0x34fbe2);}(_0x2acc,0x175));var _0xc2ac=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x2acc[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xc2ac('0x0'));var rp=require(_0xc2ac('0x1'));var BPromise=require(_0xc2ac('0x2'));var md5=require(_0xc2ac('0x3'));var util=require(_0xc2ac('0x4'));var Redis=require(_0xc2ac('0x5'));var intUtil=require(_0xc2ac('0x6'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')('sugarcrm');config[_0xc2ac('0x7')]=_['defaults'](config['redis'],{'host':_0xc2ac('0x8'),'port':0x18eb});var io=require(_0xc2ac('0x9'))(new Redis(config[_0xc2ac('0x7')]));var def={'method':'POST','json':!![]};function emit(_0x53760b,_0x349bf7,_0x409e5a){io['to'](_0x53760b)[_0xc2ac('0xa')](_0x349bf7,_0x409e5a);}function getTicket(_0x4e3419,_0x429ed0,_0x2e0f92,_0x3d891e,_0x499188,_0x4be76e,_0x114883,_0x2e36fa){logger[_0xc2ac('0xb')]('Creating\x20new\x20ticket...');var _0x403492=new Date();var _0x81dc3c=[{'name':_0xc2ac('0xc'),'value':intUtil[_0xc2ac('0xd')](_0x3d891e[_0xc2ac('0xe')],_0x499188,'\x20')},{'name':_0xc2ac('0xf'),'value':_0x429ed0['id']},{'name':_0xc2ac('0x10'),'value':_0x429ed0['id']},{'name':_0xc2ac('0x11'),'value':intUtil[_0xc2ac('0xd')](_0x3d891e['Descriptions'],_0x499188,'\x0a')},{'name':'date_start','value':_0x403492[_0xc2ac('0x12')]()['slice'](0x0,0x13)[_0xc2ac('0x13')]('T','\x20')},{'name':_0xc2ac('0x14'),'value':'0'},{'name':_0xc2ac('0x15'),'value':'15'},{'name':_0xc2ac('0x16'),'value':_0x2e0f92['id']},{'name':_0xc2ac('0x17'),'value':_0xc2ac('0x18')},{'name':_0xc2ac('0x19'),'value':_0x2e0f92[_0xc2ac('0xc')]},{'name':_0xc2ac('0x1a'),'value':_0x2e36fa}];if(_0x4be76e[_0xc2ac('0x1b')]){_[_0xc2ac('0x1c')](_0x4be76e,function(_0x5bb629){if(_0x499188[_0x5bb629['variableName']]){_0x81dc3c[_0xc2ac('0x1d')]({'name':_0x5bb629[_0xc2ac('0x1e')],'value':_0x499188[_0x5bb629['variableName']]});}});}return request({'form':{'method':_0xc2ac('0x1f'),'input_type':_0xc2ac('0x20'),'response_type':_0xc2ac('0x20'),'rest_data':JSON[_0xc2ac('0x21')]({'session':_0x114883['id'],'module_name':'Calls','name_value_list':_0x81dc3c})}});}function getAuth(_0x382026){return util['format'](_0xc2ac('0x22'),new Buffer(_0x382026['apiKey']+':X')[_0xc2ac('0x23')](_0xc2ac('0x24')));}function getServerInfo(_0x1edbdd){return request({'form':{'method':_0xc2ac('0x25'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0xc2ac('0x21')]({'session':_0x1edbdd['id']})}});}function getUser(_0x4484c1,_0x4dd589,_0x4c093c){if(!_[_0xc2ac('0x26')](_0x4dd589)){logger['info']('Getting\x20agent\x20with\x20name',_0x4dd589);return request({'form':{'method':_0xc2ac('0x27'),'input_type':_0xc2ac('0x20'),'response_type':_0xc2ac('0x20'),'rest_data':JSON[_0xc2ac('0x21')]({'session':_0x4c093c['id'],'module_name':'Employees','query':util[_0xc2ac('0x28')](_0xc2ac('0x29'),_0x4dd589),'order_by':'','offset':'0','select_fields':['id',_0xc2ac('0xc'),'user_name'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xc2ac('0x2a')](function(_0x170fe5){if(_0x170fe5[_0xc2ac('0x2b')][_0xc2ac('0x1b')]){var _0x4bd23b=_[_0xc2ac('0x2c')](_0x170fe5[_0xc2ac('0x2b')],function(_0x44f4b7){return _0x44f4b7[_0xc2ac('0x2d')][_0xc2ac('0x2e')][_0xc2ac('0x2f')]===_0x4dd589;});if(_0x4bd23b){logger[_0xc2ac('0xb')]('Agent\x20found!');return BPromise['resolve']({'id':_0x4bd23b[_0xc2ac('0x2d')]['id'][_0xc2ac('0x2f')],'name':_0x4bd23b['name_value_list'][_0xc2ac('0xc')]['value']});}}logger[_0xc2ac('0xb')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise['resolve']({'id':_0x4c093c[_0xc2ac('0x2d')]['user_id'][_0xc2ac('0x2f')],'name':_0x4c093c[_0xc2ac('0x2d')][_0xc2ac('0x2e')][_0xc2ac('0x2f')]});});}else{logger[_0xc2ac('0xb')](_0xc2ac('0x30'));return BPromise[_0xc2ac('0x31')]({'id':_0x4c093c[_0xc2ac('0x2d')][_0xc2ac('0x32')][_0xc2ac('0x2f')],'name':_0x4c093c[_0xc2ac('0x2d')]['user_name'][_0xc2ac('0x2f')]});}}function getEndUser(_0x1572d4,_0x205690,_0x4dd4f5,_0x1b8353){logger['info'](_0xc2ac('0x33'),_0x4dd4f5);return request({'form':{'method':_0xc2ac('0x27'),'input_type':_0xc2ac('0x20'),'response_type':_0xc2ac('0x20'),'rest_data':JSON['stringify']({'session':_0x1b8353['id'],'module_name':_0xc2ac('0x18'),'query':util[_0xc2ac('0x28')](_0xc2ac('0x34'),_0x4dd4f5),'order_by':'','offset':'0','select_fields':['id',_0xc2ac('0xc'),_0xc2ac('0x35')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xc2ac('0x2a')](function(_0x28d7cf){if(_0x28d7cf[_0xc2ac('0x2b')][_0xc2ac('0x1b')]){var _0x5f5ca8=_['find'](_0x28d7cf['entry_list'],function(_0x3033c3){return _0x3033c3[_0xc2ac('0x2d')][_0xc2ac('0x35')][_0xc2ac('0x2f')]===_0x4dd4f5;});if(_0x5f5ca8){logger[_0xc2ac('0xb')](_0xc2ac('0x36'));return BPromise[_0xc2ac('0x31')]({'id':_0x5f5ca8['name_value_list']['id'][_0xc2ac('0x2f')],'name':_0x5f5ca8[_0xc2ac('0x2d')][_0xc2ac('0xc')][_0xc2ac('0x2f')],'phone':_0x5f5ca8[_0xc2ac('0x2d')]['phone_home'][_0xc2ac('0x2f')]});}}else{logger[_0xc2ac('0xb')](_0xc2ac('0x37'));return request({'form':{'method':_0xc2ac('0x1f'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0xc2ac('0x21')]({'session':_0x1b8353['id'],'module_name':_0xc2ac('0x18'),'name_value_list':[{'name':'first_name','value':_0x205690!==_0xc2ac('0x38')?_0x205690:util['format'](_0xc2ac('0x39'),_0x4dd4f5)},{'name':_0xc2ac('0x35'),'value':_0x4dd4f5}]})}})[_0xc2ac('0x2a')](function(_0x1afb4b){logger[_0xc2ac('0xb')](_0xc2ac('0x3a'));return BPromise['resolve']({'id':_0x1afb4b['id'],'name':_0x1afb4b[_0xc2ac('0x2b')][_0xc2ac('0x3b')][_0xc2ac('0x2f')],'phone':_0x1afb4b['entry_list'][_0xc2ac('0x35')][_0xc2ac('0x2f')]});});}});}function request(_0x39a314){logger[_0xc2ac('0x3c')](_0xc2ac('0x3d'),JSON[_0xc2ac('0x21')](_0x39a314));return rp(_[_0xc2ac('0x3e')](def,_0x39a314));}function getTags(_0x2c1b10,_0x2f4fe2){var _0x24be41=[];if(_0x2c1b10&&_0x2c1b10[_0xc2ac('0x1b')]>0x0){_0x24be41=_[_0xc2ac('0x3f')](_0x2c1b10,_0x2f4fe2);}return _0x24be41;}function getCustomFields(_0x5ef939,_0x461a2b){var _0x251803=[];var _0x255bde={'custom_fields':[]};if(_0x5ef939[_0xc2ac('0x1b')]>0x0){_[_0xc2ac('0x1c')](_0x5ef939,function(_0x52e78f){if(_0x52e78f[_0xc2ac('0x40')]===_0xc2ac('0x41')&&_0x52e78f['nameField']&&!_0x52e78f[_0xc2ac('0x42')]){_0x255bde[_0x52e78f['nameField'][_0xc2ac('0x43')]()]=_0x52e78f[_0xc2ac('0x44')][_0xc2ac('0x23')]();}else if(_0x52e78f[_0xc2ac('0x40')]==='string'&&_0x52e78f[_0xc2ac('0x1e')]&&_0x52e78f['customField']){_0x255bde['custom_fields'][_0xc2ac('0x1d')]({'id':_0x52e78f[_0xc2ac('0x1e')],'value':_0x52e78f[_0xc2ac('0x44')][_0xc2ac('0x23')]()});}else if(_0x52e78f['type']==='variable'&&_0x52e78f[_0xc2ac('0x45')]&&_0x52e78f['idField']&&_0x52e78f[_0xc2ac('0x42')]){_0x461a2b[_0x52e78f[_0xc2ac('0x45')]]&&_0x255bde[_0xc2ac('0x46')][_0xc2ac('0x1d')]({'id':_0x52e78f[_0xc2ac('0x1e')],'value':_0x461a2b[_0x52e78f[_0xc2ac('0x45')]]['toString']()});}else if(_0x52e78f['type']==='customVariable'&&_0x52e78f[_0xc2ac('0x47')]&&_0x52e78f[_0xc2ac('0x47')][_0xc2ac('0xc')]&&_0x52e78f[_0xc2ac('0x1e')]&&_0x52e78f[_0xc2ac('0x42')]){_0x461a2b[_0x52e78f[_0xc2ac('0x47')][_0xc2ac('0xc')]['toLowerCase']()]&&_0x255bde[_0xc2ac('0x46')][_0xc2ac('0x1d')]({'id':_0x52e78f[_0xc2ac('0x1e')],'value':_0x461a2b[_0x52e78f[_0xc2ac('0x47')]['name']['toLowerCase']()][_0xc2ac('0x23')]()});}});}return _0x255bde;}function getConnection(_0x47160b){return request({'method':_0xc2ac('0x48'),'form':{'method':_0xc2ac('0x49'),'input_type':_0xc2ac('0x20'),'response_type':_0xc2ac('0x20'),'rest_data':JSON[_0xc2ac('0x21')]({'user_auth':{'user_name':_0x47160b['username'],'password':_0x47160b[_0xc2ac('0x4a')],'encryption':_0xc2ac('0x4b')},'application':_0xc2ac('0x4c')})}})[_0xc2ac('0x2a')](function(_0x49c687){var _0x5801a0=_0x49c687;if(_0x5801a0['id']){def[_0xc2ac('0x4d')]=_0x5801a0['id'];return BPromise[_0xc2ac('0x31')](_0x5801a0);}else{throw new Error(util[_0xc2ac('0x28')](_0xc2ac('0x4e'),_0x47160b['id']));}});}function setRelationship(_0x9e8db1,_0x1a46e5,_0x3a13bd,_0x4917a6){return request({'form':{'method':_0xc2ac('0x4f'),'input_type':_0xc2ac('0x20'),'response_type':_0xc2ac('0x20'),'rest_data':JSON[_0xc2ac('0x21')]({'session':_0x9e8db1['id'],'module_name':_0xc2ac('0x50'),'module_id':_0x3a13bd['id'],'link_field_name':_0x4917a6,'related_ids':[_0x1a46e5['id']],'name_value_list':[],'delete':0x0})}});}exports[_0xc2ac('0x51')]=function(_0x2747c3,_0x1c4110,_0x47d1fe,_0x40b18b,_0x248396,_0x5a54e3){var _0x2910ec,_0x18bb63,_0x34817e,_0x27be39;_0x5a54e3[_0xc2ac('0x52')]=intUtil[_0xc2ac('0x53')](_0x5a54e3[_0xc2ac('0x52')]);_0x5a54e3['serverUrl']=intUtil[_0xc2ac('0x53')](_0x5a54e3[_0xc2ac('0x54')]);def[_0xc2ac('0x55')]=util[_0xc2ac('0x28')]('%s/service/v4_1/rest.php',_0x5a54e3[_0xc2ac('0x52')]);if(_0x248396&&_0x248396['monitor_format']){logger[_0xc2ac('0xb')]('[QUEUE]',_0xc2ac('0x56'));_0x1c4110[_0xc2ac('0x57')]=util['format'](_0xc2ac('0x58'),_0x5a54e3[_0xc2ac('0x54')],_0x1c4110[_0xc2ac('0x59')],md5(_0x1c4110[_0xc2ac('0x59')]));}else{_0x1c4110[_0xc2ac('0x57')]='';}return getConnection(_0x5a54e3)[_0xc2ac('0x2a')](function(_0x257f50){_0x27be39=_0x257f50;return getUser(_0x5a54e3,_0x40b18b['name'],_0x27be39);})['then'](function(_0x1c947a){_0x2910ec=_0x1c947a;logger[_0xc2ac('0xb')](_0xc2ac('0x5a'),_0x2910ec['id']);return getEndUser(_0x5a54e3,_0x1c4110[_0xc2ac('0x5b')],_0x1c4110[_0xc2ac('0x5c')],_0x27be39);})['then'](function(_0x438042){_0x18bb63=_0x438042;logger['info'](_0xc2ac('0x5d'),_0x18bb63['id']);return getTicket(_0x5a54e3,_0x2910ec,_0x18bb63,_0x47d1fe,_0x1c4110,_0x47d1fe['Fields'],_0x27be39,'Inbound');})[_0xc2ac('0x2a')](function(_0x4f2f95){_0x34817e=_0x4f2f95;logger['info']('Ticket\x20created!');logger['info'](_0xc2ac('0x5e'),_0x34817e['id']);return setRelationship(_0x27be39,_0x2910ec,_0x34817e,_0xc2ac('0x5f'));})['then'](function(){return setRelationship(_0x27be39,_0x18bb63,_0x34817e,'contacts');})['then'](function(){return getServerInfo(_0x27be39);})[_0xc2ac('0x2a')](function(_0x5e69de){var _0x29f908=parseInt(_0x5e69de[_0xc2ac('0x60')][_0xc2ac('0x61')](0x0));var _0x21c2cb=util['format'](_0xc2ac('0x62'),_0x5a54e3[_0xc2ac('0x52')],_0x34817e['id']);if(_0x29f908>0x6){_0x21c2cb=util[_0xc2ac('0x28')](_0xc2ac('0x63'),_0x5a54e3[_0xc2ac('0x52')],_0x34817e['id']);}logger['info']('[QUEUE]',_0xc2ac('0x64'));emit(util['format'](_0xc2ac('0x65'),_0x40b18b[_0xc2ac('0xc')]),'trigger:browser:url',{'uri':_0x21c2cb});})[_0xc2ac('0x66')](function(_0x4f4f0d){logger[_0xc2ac('0x67')]('[QUEUE]',JSON[_0xc2ac('0x21')](_0x4f4f0d));});};exports[_0xc2ac('0x68')]=function(_0x3dccb5,_0x60b6b5,_0x4a6297,_0x2983cc,_0x26f216,_0x19dd0f,_0x58ab26){var _0x386b67,_0x555baa,_0x904700,_0x1ddda8;_0x19dd0f[_0xc2ac('0x52')]=intUtil[_0xc2ac('0x53')](_0x19dd0f['remoteUri']);_0x19dd0f['serverUrl']=intUtil[_0xc2ac('0x53')](_0x19dd0f['serverUrl']);def[_0xc2ac('0x55')]=util[_0xc2ac('0x28')](_0xc2ac('0x69'),_0x19dd0f['remoteUri']);if(_0x58ab26&&_0x58ab26[_0xc2ac('0x6a')]&&_0x58ab26[_0xc2ac('0x6a')]!==_0xc2ac('0x6b')){logger[_0xc2ac('0xb')](_0xc2ac('0x6c'),'Recording\x20is\x20enabled!');_0x60b6b5[_0xc2ac('0x57')]=util[_0xc2ac('0x28')](_0xc2ac('0x58'),_0x19dd0f[_0xc2ac('0x54')],_0x60b6b5[_0xc2ac('0x59')],md5(_0x60b6b5[_0xc2ac('0x59')]));}return getConnection(_0x19dd0f)[_0xc2ac('0x2a')](function(_0x255c08){_0x1ddda8=_0x255c08;return getUser(_0x19dd0f,_0x2983cc[_0xc2ac('0xc')],_0x1ddda8);})[_0xc2ac('0x2a')](function(_0x480f36){_0x386b67=_0x480f36;logger[_0xc2ac('0xb')](_0xc2ac('0x5a'),_0x386b67['id']);return getEndUser(_0x19dd0f,_0x60b6b5[_0xc2ac('0x6d')],_0x60b6b5['destcalleridnum'],_0x1ddda8);})[_0xc2ac('0x2a')](function(_0x2fd849){_0x555baa=_0x2fd849;logger[_0xc2ac('0xb')]('The\x20Enduser\x20ID\x20is:',_0x555baa['id']);return getTicket(_0x19dd0f,_0x386b67,_0x555baa,_0x4a6297,_0x60b6b5,_0x4a6297[_0xc2ac('0x6e')],_0x1ddda8,_0xc2ac('0x6f'));})[_0xc2ac('0x2a')](function(_0x3a4f27){_0x904700=_0x3a4f27;logger[_0xc2ac('0xb')](_0xc2ac('0x70'));logger[_0xc2ac('0xb')](_0xc2ac('0x5e'),_0x904700['id']);return setRelationship(_0x1ddda8,_0x386b67,_0x904700,'users');})[_0xc2ac('0x2a')](function(){return setRelationship(_0x1ddda8,_0x555baa,_0x904700,_0xc2ac('0x71'));})[_0xc2ac('0x2a')](function(){return getServerInfo(_0x1ddda8);})[_0xc2ac('0x2a')](function(_0x324054){var _0x1dd998=parseInt(_0x324054[_0xc2ac('0x60')][_0xc2ac('0x61')](0x0));var _0x103e4b=util[_0xc2ac('0x28')]('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x19dd0f['remoteUri'],_0x904700['id']);if(_0x1dd998>0x6){_0x103e4b=util[_0xc2ac('0x28')](_0xc2ac('0x63'),_0x19dd0f[_0xc2ac('0x52')],_0x904700['id']);}logger[_0xc2ac('0xb')](_0xc2ac('0x6c'),_0xc2ac('0x64'));emit(util[_0xc2ac('0x28')]('user:%s',_0x2983cc[_0xc2ac('0xc')]),_0xc2ac('0x72'),{'uri':_0x103e4b});})[_0xc2ac('0x66')](function(_0x965e13){logger['error'](_0xc2ac('0x6c'),JSON[_0xc2ac('0x21')](_0x965e13));});};exports[_0xc2ac('0x73')]=function(_0x435d7a,_0x291199,_0x416f11,_0x2cee47,_0x290c71,_0x2918d5){var _0x412cbc,_0xcdf4a1,_0x41a10a,_0x417f72;_0x2918d5[_0xc2ac('0x52')]=intUtil[_0xc2ac('0x53')](_0x2918d5[_0xc2ac('0x52')]);_0x2918d5[_0xc2ac('0x54')]=intUtil[_0xc2ac('0x53')](_0x2918d5[_0xc2ac('0x54')]);def['uri']=util[_0xc2ac('0x28')](_0xc2ac('0x69'),_0x2918d5[_0xc2ac('0x52')]);if(_0x290c71&&_0x290c71[_0xc2ac('0x74')]){logger[_0xc2ac('0xb')]('['+_0x291199[_0xc2ac('0x75')][_0xc2ac('0x76')]()+']',_0xc2ac('0x56'));_0x291199['recordingURL']=util[_0xc2ac('0x28')](_0xc2ac('0x58'),_0x2918d5[_0xc2ac('0x54')],_0x291199[_0xc2ac('0x59')],md5(_0x291199['uniqueid']));}else{_0x291199['recordingURL']='';}return getConnection(_0x2918d5)['then'](function(_0x327a2a){_0x417f72=_0x327a2a;if(!_['isNil'](_0x2cee47)){return getUser(_0x2918d5,_0x2cee47['name'],_0x417f72);}else{return getUser(_0x2918d5,null,_0x417f72);}})[_0xc2ac('0x2a')](function(_0x3ede83){_0x412cbc=_0x3ede83;logger[_0xc2ac('0xb')](_0xc2ac('0x5a'),_0x412cbc['id']);return getEndUser(_0x2918d5,_0x291199[_0xc2ac('0x5b')],_0x291199[_0xc2ac('0x5c')],_0x417f72);})['then'](function(_0x5617b0){_0xcdf4a1=_0x5617b0;logger[_0xc2ac('0xb')](_0xc2ac('0x5d'),_0xcdf4a1['id']);return getTicket(_0x2918d5,_0x412cbc,_0xcdf4a1,_0x416f11,_0x291199,_0x416f11[_0xc2ac('0x6e')],_0x417f72,_0xc2ac('0x77'));})[_0xc2ac('0x2a')](function(_0x4e1173){_0x41a10a=_0x4e1173;logger['info'](_0xc2ac('0x70'));logger[_0xc2ac('0xb')]('The\x20Ticket\x20ID\x20is:',_0x41a10a['id']);return setRelationship(_0x417f72,_0x412cbc,_0x41a10a,_0xc2ac('0x5f'));})[_0xc2ac('0x2a')](function(){return setRelationship(_0x417f72,_0xcdf4a1,_0x41a10a,_0xc2ac('0x71'));})['then'](function(){return getServerInfo(_0x417f72);})[_0xc2ac('0x66')](function(_0x863f81){logger[_0xc2ac('0x67')]('['+_0x291199['lastevent'][_0xc2ac('0x76')]()+']',JSON[_0xc2ac('0x21')](_0x863f81));});};
\ No newline at end of file
index 083e314..0458a02 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa3e1=['content','type','variableName','toString','Variable','name','toLowerCase','keyType','key','format','%s:\x20%s','variable','customVariable','join','stripTrailingSlash','slice','substring','lastIndexOf','validateEmail','isNil','test','lodash','util','getString','sortBy','length','string','push'];(function(_0x2b49bc,_0x47b636){var _0x43cc65=function(_0x236ec3){while(--_0x236ec3){_0x2b49bc['push'](_0x2b49bc['shift']());}};_0x43cc65(++_0x47b636);}(_0xa3e1,0x1b9));var _0x1a3e=function(_0x423e15,_0x12b2b2){_0x423e15=_0x423e15-0x0;var _0x184279=_0xa3e1[_0x423e15];return _0x184279;};'use strict';var _=require(_0x1a3e('0x0'));var util=require(_0x1a3e('0x1'));exports[_0x1a3e('0x2')]=function(_0x57d1d4,_0x32c74b,_0x57eae3){var _0x458987=[];if(_0x57d1d4['length']>0x0){var _0x620167=_[_0x1a3e('0x3')](_0x57d1d4,['id']);for(var _0x184a07=0x0;_0x184a07<_0x620167[_0x1a3e('0x4')];_0x184a07++){var _0x1e4bc9=_0x620167[_0x184a07];if(_0x1e4bc9['type']===_0x1a3e('0x5')){_0x458987[_0x1a3e('0x6')](_0x1e4bc9[_0x1a3e('0x7')]);}else if(_0x1e4bc9[_0x1a3e('0x8')]==='variable'&&_0x1e4bc9['variableName']){_0x32c74b[_0x1e4bc9[_0x1a3e('0x9')]]&&_0x458987['push'](_0x32c74b[_0x1e4bc9[_0x1a3e('0x9')]][_0x1a3e('0xa')]());}else if(_0x1e4bc9[_0x1a3e('0x8')]==='customVariable'&&_0x1e4bc9[_0x1a3e('0xb')]&&_0x1e4bc9['Variable'][_0x1a3e('0xc')]){_0x32c74b[_0x1e4bc9[_0x1a3e('0xb')][_0x1a3e('0xc')][_0x1a3e('0xd')]()]&&_0x458987[_0x1a3e('0x6')](_0x32c74b[_0x1e4bc9[_0x1a3e('0xb')][_0x1a3e('0xc')]['toLowerCase']()][_0x1a3e('0xa')]());}else if(_0x1e4bc9[_0x1a3e('0x8')]==='keyValue'){if(_0x1e4bc9[_0x1a3e('0xe')]===_0x1a3e('0x5')&&_0x1e4bc9[_0x1a3e('0xf')]){_0x458987[_0x1a3e('0x6')](util[_0x1a3e('0x10')](_0x1a3e('0x11'),_0x1e4bc9[_0x1a3e('0xf')],_0x1e4bc9['keyContent']));}else if(_0x1e4bc9[_0x1a3e('0xe')]===_0x1a3e('0x12')&&_0x1e4bc9['variableName']&&_0x1e4bc9[_0x1a3e('0xf')]){_0x32c74b[_0x1e4bc9[_0x1a3e('0x9')]]&&_0x458987[_0x1a3e('0x6')](util[_0x1a3e('0x10')](_0x1a3e('0x11'),_0x1e4bc9[_0x1a3e('0xf')],_0x32c74b[_0x1e4bc9[_0x1a3e('0x9')]]));}else if(_0x1e4bc9[_0x1a3e('0xe')]===_0x1a3e('0x13')&&_0x1e4bc9[_0x1a3e('0xb')]&&_0x1e4bc9['Variable'][_0x1a3e('0xc')]&&_0x1e4bc9[_0x1a3e('0xf')]){_0x32c74b[_0x1e4bc9[_0x1a3e('0xb')][_0x1a3e('0xc')]['toLowerCase']()]&&_0x458987[_0x1a3e('0x6')](util[_0x1a3e('0x10')](_0x1a3e('0x11'),_0x1e4bc9['key'],_0x32c74b[_0x1e4bc9['Variable'][_0x1a3e('0xc')][_0x1a3e('0xd')]()]));}}}}return _0x458987[_0x1a3e('0x14')](_0x57eae3);};exports[_0x1a3e('0x15')]=function(_0x51726f){var _0x58f85f=_0x51726f[_0x1a3e('0x16')](-0x1);if(_0x58f85f==='/'){_0x51726f=_0x51726f[_0x1a3e('0x17')](0x0,_0x51726f[_0x1a3e('0x18')](_0x58f85f));}return _0x51726f;};exports[_0x1a3e('0x19')]=function(_0x1c106d){if(!_[_0x1a3e('0x1a')](_0x1c106d)&&_0x1c106d!==''){var _0x4dafa2=/^(([^<>()\[\]\\.,;:\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 _0x4dafa2[_0x1a3e('0x1b')](String(_0x1c106d)['toLowerCase']());}else{return![];}};
\ No newline at end of file
+var _0xc129=['%s:\x20%s','join','stripTrailingSlash','slice','substring','lastIndexOf','validateEmail','isNil','test','lodash','util','getString','length','sortBy','string','push','content','type','variable','variableName','customVariable','Variable','name','toLowerCase','toString','keyValue','keyType','key','format','keyContent'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xc129,0xf9));var _0x9c12=function(_0x2d3134,_0x477c10){_0x2d3134=_0x2d3134-0x0;var _0x2dd03e=_0xc129[_0x2d3134];return _0x2dd03e;};'use strict';var _=require(_0x9c12('0x0'));var util=require(_0x9c12('0x1'));exports[_0x9c12('0x2')]=function(_0x158ccf,_0x6b82c4,_0x271705){var _0x1233b3=[];if(_0x158ccf[_0x9c12('0x3')]>0x0){var _0x1d2d72=_[_0x9c12('0x4')](_0x158ccf,['id']);for(var _0x541999=0x0;_0x541999<_0x1d2d72[_0x9c12('0x3')];_0x541999++){var _0x1446d0=_0x1d2d72[_0x541999];if(_0x1446d0['type']===_0x9c12('0x5')){_0x1233b3[_0x9c12('0x6')](_0x1446d0[_0x9c12('0x7')]);}else if(_0x1446d0[_0x9c12('0x8')]===_0x9c12('0x9')&&_0x1446d0[_0x9c12('0xa')]){_0x6b82c4[_0x1446d0['variableName']]&&_0x1233b3[_0x9c12('0x6')](_0x6b82c4[_0x1446d0['variableName']]['toString']());}else if(_0x1446d0[_0x9c12('0x8')]===_0x9c12('0xb')&&_0x1446d0['Variable']&&_0x1446d0[_0x9c12('0xc')][_0x9c12('0xd')]){_0x6b82c4[_0x1446d0[_0x9c12('0xc')][_0x9c12('0xd')][_0x9c12('0xe')]()]&&_0x1233b3[_0x9c12('0x6')](_0x6b82c4[_0x1446d0[_0x9c12('0xc')][_0x9c12('0xd')]['toLowerCase']()][_0x9c12('0xf')]());}else if(_0x1446d0[_0x9c12('0x8')]===_0x9c12('0x10')){if(_0x1446d0[_0x9c12('0x11')]===_0x9c12('0x5')&&_0x1446d0[_0x9c12('0x12')]){_0x1233b3['push'](util[_0x9c12('0x13')]('%s:\x20%s',_0x1446d0['key'],_0x1446d0[_0x9c12('0x14')]));}else if(_0x1446d0[_0x9c12('0x11')]===_0x9c12('0x9')&&_0x1446d0[_0x9c12('0xa')]&&_0x1446d0[_0x9c12('0x12')]){_0x6b82c4[_0x1446d0[_0x9c12('0xa')]]&&_0x1233b3[_0x9c12('0x6')](util['format']('%s:\x20%s',_0x1446d0[_0x9c12('0x12')],_0x6b82c4[_0x1446d0['variableName']]));}else if(_0x1446d0['keyType']==='customVariable'&&_0x1446d0[_0x9c12('0xc')]&&_0x1446d0[_0x9c12('0xc')][_0x9c12('0xd')]&&_0x1446d0[_0x9c12('0x12')]){_0x6b82c4[_0x1446d0[_0x9c12('0xc')][_0x9c12('0xd')][_0x9c12('0xe')]()]&&_0x1233b3[_0x9c12('0x6')](util[_0x9c12('0x13')](_0x9c12('0x15'),_0x1446d0[_0x9c12('0x12')],_0x6b82c4[_0x1446d0[_0x9c12('0xc')][_0x9c12('0xd')][_0x9c12('0xe')]()]));}}}}return _0x1233b3[_0x9c12('0x16')](_0x271705);};exports[_0x9c12('0x17')]=function(_0x12e949){var _0x4a570f=_0x12e949[_0x9c12('0x18')](-0x1);if(_0x4a570f==='/'){_0x12e949=_0x12e949[_0x9c12('0x19')](0x0,_0x12e949[_0x9c12('0x1a')](_0x4a570f));}return _0x12e949;};exports[_0x9c12('0x1b')]=function(_0x382fe9){if(!_[_0x9c12('0x1c')](_0x382fe9)&&_0x382fe9!==''){var _0x55f521=/^(([^<>()\[\]\\.,;:\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 _0x55f521[_0x9c12('0x1d')](String(_0x382fe9)[_0x9c12('0xe')]());}else{return![];}};
\ No newline at end of file
index fd55457..ff44c0a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd8b0=['info','Creating\x20new\x20ticket...','merge','Normal','Subjects','POST','format','%s/webservice.php','remoteUri','create','username','sessionName','HelpDesk','stringify','success','result','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','error','statusCode','[vTiger],\x20%s,\x20%s,\x20%s','validateEmail','Getting\x20agent\x20with\x20email','then','Agent\x20found!','resolve','email1','first_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','admin','catch','userId','getUser','Searching\x20end\x20user\x20with\x20phone','GET','query','Enduser\x20found!','firstname','Enduser\x20created.','lastname','phone','accessKey','getchallenge','login','token','getConnection','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','recordingURL','email','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Ticket\x20created!','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','outbound','recordingFormat','none','[OUTBOUND]','uniqueid','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','user:%s','lastevent','toUpperCase','lodash','request-promise','ioredis','./util','../../../../config/environment','../../../../config/logger','vTiger','redis','localhost','socket.io-emitter','emit','length','forEach','includes','picklist','idField','content','toString','type','variable','variableName','customVariable','Variable','name','toLowerCase'];(function(_0x12b8ec,_0x1655be){var _0x21af77=function(_0xe59f){while(--_0xe59f){_0x12b8ec['push'](_0x12b8ec['shift']());}};_0x21af77(++_0x1655be);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x0d8b('0x0'));var rp=require(_0x0d8b('0x1'));var BPromise=require('bluebird');var md5=require('md5');var util=require('util');var Redis=require(_0x0d8b('0x2'));var intUtil=require(_0x0d8b('0x3'));var config=require(_0x0d8b('0x4'));var logger=require(_0x0d8b('0x5'))(_0x0d8b('0x6'));config['redis']=_['defaults'](config[_0x0d8b('0x7')],{'host':_0x0d8b('0x8'),'port':0x18eb});var io=require(_0x0d8b('0x9'))(new Redis(config['redis']));function emit(_0x413284,_0x284169,_0x58e4e2){io['to'](_0x413284)[_0x0d8b('0xa')](_0x284169,_0x58e4e2);}function getCustomFields(_0x348e65,_0x3b027f){var _0x1f4800={};if(_0x348e65[_0x0d8b('0xb')]>0x0){_[_0x0d8b('0xc')](_0x348e65,function(_0x2c5e9e){if(_[_0x0d8b('0xd')](['string',_0x0d8b('0xe')],_0x2c5e9e['type'])&&_0x2c5e9e[_0x0d8b('0xf')]){_0x1f4800[_0x2c5e9e[_0x0d8b('0xf')]]=_0x2c5e9e[_0x0d8b('0x10')][_0x0d8b('0x11')]();}else if(_0x2c5e9e[_0x0d8b('0x12')]===_0x0d8b('0x13')&&_0x2c5e9e[_0x0d8b('0x14')]&&_0x2c5e9e[_0x0d8b('0xf')]&&_0x3b027f[_0x2c5e9e[_0x0d8b('0x14')]]){_0x1f4800[_0x2c5e9e[_0x0d8b('0xf')]]=_0x3b027f[_0x2c5e9e[_0x0d8b('0x14')]][_0x0d8b('0x11')]();}else if(_0x2c5e9e[_0x0d8b('0x12')]===_0x0d8b('0x15')&&_0x2c5e9e['Variable']&&_0x2c5e9e[_0x0d8b('0x16')][_0x0d8b('0x17')]&&_0x2c5e9e[_0x0d8b('0xf')]&&_0x3b027f[_0x2c5e9e[_0x0d8b('0x16')][_0x0d8b('0x17')]['toLowerCase']()]){_0x1f4800[_0x2c5e9e[_0x0d8b('0xf')]]=_0x3b027f[_0x2c5e9e[_0x0d8b('0x16')][_0x0d8b('0x17')][_0x0d8b('0x18')]()][_0x0d8b('0x11')]();}});}return _0x1f4800;}function createTicket(_0x18dd2d,_0x264b39,_0xa3612a,_0x4a15bf,_0x27512e,_0x23d58f,_0x196c0a){logger[_0x0d8b('0x19')](_0x0d8b('0x1a'));var _0x5b709c=_[_0x0d8b('0x1b')]({'parent_id':'','assigned_user_id':_0x264b39['id'],'ticketpriorities':_0x0d8b('0x1c'),'ticketstatus':'Open','ticket_title':intUtil['getString'](_0x4a15bf[_0x0d8b('0x1d')],_0x27512e,'\x20'),'description':intUtil['getString'](_0x4a15bf['Descriptions'],_0x27512e,'\x0a'),'contact_id':_0xa3612a['id']},getCustomFields(_0x23d58f,_0x27512e));var _0x5527d8={'method':_0x0d8b('0x1e'),'uri':util[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x18dd2d[_0x0d8b('0x21')]),'form':{'operation':_0x0d8b('0x22'),'username':_0x18dd2d[_0x0d8b('0x23')],'sessionName':_0x196c0a[_0x0d8b('0x24')],'elementType':_0x0d8b('0x25'),'element':JSON[_0x0d8b('0x26')](_0x5b709c)},'json':!![]};return request(_0x5527d8)['then'](function(_0xe8bbee){if(_0xe8bbee[_0x0d8b('0x27')]){return BPromise['resolve']({'id':_0xe8bbee[_0x0d8b('0x28')]['id']});}else{throw new Error(util['format'](_0x0d8b('0x29'),JSON[_0x0d8b('0x26')](_0xe8bbee[_0x0d8b('0x2a')])));}})['catch'](function(_0x59a905){var _0x28f639=_0x59a905[_0x0d8b('0x2b')]||0x1f4;logger['error'](_0x0d8b('0x2c'),'createTicket',_0x28f639,JSON[_0x0d8b('0x26')](_0x59a905));});}function getUser(_0x4b59e5,_0x97050a,_0x48f24f){if(intUtil[_0x0d8b('0x2d')](_0x97050a)){logger['info'](_0x0d8b('0x2e'),_0x97050a);return request({'method':'GET','uri':util[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x4b59e5[_0x0d8b('0x21')]),'qs':{'operation':'query','username':_0x4b59e5['username'],'sessionName':_0x48f24f['sessionName'],'query':util[_0x0d8b('0x1f')]('SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;',_0x97050a)},'json':!![]})[_0x0d8b('0x2f')](function(_0x54f6f3){if(_0x54f6f3['success']&&_0x54f6f3[_0x0d8b('0x28')][_0x0d8b('0xb')]){logger[_0x0d8b('0x19')](_0x0d8b('0x30'));return BPromise[_0x0d8b('0x31')]({'id':_0x54f6f3[_0x0d8b('0x28')][0x0]['id'],'email':_0x54f6f3[_0x0d8b('0x28')][0x0][_0x0d8b('0x32')],'name':_0x54f6f3['result'][0x0][_0x0d8b('0x33')]+'\x20'+_0x54f6f3[_0x0d8b('0x28')]['last_name']});}else{logger[_0x0d8b('0x19')](_0x0d8b('0x34'));return BPromise[_0x0d8b('0x31')]({'id':_0x48f24f['userId'],'email':_0x4b59e5[_0x0d8b('0x23')],'name':_0x0d8b('0x35')});}})[_0x0d8b('0x36')](function(_0x31ceba){var _0x933e01=_0x31ceba['statusCode']||0x1f4;logger[_0x0d8b('0x2a')](_0x0d8b('0x2c'),'getUser',_0x933e01,JSON[_0x0d8b('0x26')](_0x31ceba));});}else{logger[_0x0d8b('0x19')](_0x0d8b('0x34'));return BPromise[_0x0d8b('0x31')]({'id':_0x48f24f[_0x0d8b('0x37')],'email':_0x4b59e5['username'],'name':'admin'})[_0x0d8b('0x36')](function(_0x5c2c04){var _0x531c55=_0x5c2c04[_0x0d8b('0x2b')]||0x1f4;logger[_0x0d8b('0x2a')](_0x0d8b('0x2c'),_0x0d8b('0x38'),_0x531c55,JSON[_0x0d8b('0x26')](_0x5c2c04));});}}function getEndUser(_0x24c789,_0x579324,_0x6e5bab,_0x6a02ad){logger[_0x0d8b('0x19')](_0x0d8b('0x39'),_0x6e5bab);return request({'method':_0x0d8b('0x3a'),'uri':util[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x24c789['remoteUri']),'qs':{'operation':_0x0d8b('0x3b'),'username':_0x24c789[_0x0d8b('0x23')],'sessionName':_0x6a02ad[_0x0d8b('0x24')],'query':util[_0x0d8b('0x1f')]('SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;',_0x6e5bab,_0x6e5bab,_0x6e5bab,_0x6e5bab,_0x6e5bab)},'json':!![]})[_0x0d8b('0x2f')](function(_0x4b4bde){if(_0x4b4bde[_0x0d8b('0x27')]&&_0x4b4bde[_0x0d8b('0x28')][_0x0d8b('0xb')]){logger[_0x0d8b('0x19')](_0x0d8b('0x3c'));return BPromise[_0x0d8b('0x31')]({'id':_0x4b4bde[_0x0d8b('0x28')][0x0]['id'],'name':_0x4b4bde[_0x0d8b('0x28')][0x0][_0x0d8b('0x3d')]+'\x20'+_0x4b4bde[_0x0d8b('0x28')][0x0]['lastname'],'phone':_0x6e5bab});}else{logger['info']('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'method':'POST','uri':util['format'](_0x0d8b('0x20'),_0x24c789[_0x0d8b('0x21')]),'form':{'operation':_0x0d8b('0x22'),'sessionName':_0x6a02ad['sessionName'],'elementType':'Contacts','element':JSON[_0x0d8b('0x26')]({'lastname':_0x579324,'phone':_0x6e5bab,'assigned_user_id':'\x20'})},'json':!![]})[_0x0d8b('0x2f')](function(_0x344278){logger['info'](_0x0d8b('0x3e'));return BPromise[_0x0d8b('0x31')]({'id':_0x344278['result']['id'],'name':_0x344278['result'][_0x0d8b('0x3f')],'phone':_0x344278['result'][_0x0d8b('0x40')]});})['catch'](function(_0x53f643){var _0x30ccee=_0x53f643[_0x0d8b('0x2b')]||0x1f4;logger['error']('[vTiger],\x20%s,\x20%s,\x20%s','getEndUser',_0x30ccee,JSON['stringify'](_0x53f643));});}});}function getConnection(_0x374d40){var _0x1e0498=_0x374d40[_0x0d8b('0x23')];var _0x490eda=_0x374d40[_0x0d8b('0x41')];return request({'method':_0x0d8b('0x3a'),'uri':util[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x374d40[_0x0d8b('0x21')]),'qs':{'operation':_0x0d8b('0x42'),'username':_0x1e0498},'json':!![]})[_0x0d8b('0x2f')](function(_0x1d5067){if(_0x1d5067[_0x0d8b('0x27')]){return request({'method':_0x0d8b('0x1e'),'uri':util[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x374d40[_0x0d8b('0x21')]),'form':{'operation':_0x0d8b('0x43'),'username':_0x1e0498,'accessKey':md5(_0x1d5067[_0x0d8b('0x28')][_0x0d8b('0x44')]+_0x490eda)},'json':!![]});}})[_0x0d8b('0x2f')](function(_0x1e162c){if(_0x1e162c[_0x0d8b('0x27')]){return BPromise['resolve'](_0x1e162c[_0x0d8b('0x28')]);}else{throw new Error(util['format']('Account\x20%d\x20is\x20not\x20valid',_0x374d40['id']));}})[_0x0d8b('0x36')](function(_0x113fb7){var _0x3f943a=_0x113fb7[_0x0d8b('0x2b')]||0x1f4;logger['error'](_0x0d8b('0x2c'),_0x0d8b('0x45'),_0x3f943a,JSON[_0x0d8b('0x26')](_0x113fb7));});}function request(_0x241587){logger[_0x0d8b('0x19')]('[HTTP]',JSON['stringify'](_0x241587));return rp(_0x241587);}exports['queue']=function(_0x573f4f,_0x368ede,_0xf22c3c,_0x5e3bb4,_0x4950a8,_0x44c5c1){var _0x3d3cb6,_0x5c5bd7,_0x5ef6c3,_0x900906;_0x44c5c1[_0x0d8b('0x21')]=intUtil[_0x0d8b('0x46')](_0x44c5c1[_0x0d8b('0x21')]);if(_0x4950a8&&_0x4950a8[_0x0d8b('0x47')]){logger['info'](_0x0d8b('0x48'),_0x0d8b('0x49'));_0x368ede['recordingURL']=util['format'](_0x0d8b('0x4a'),_0x44c5c1[_0x0d8b('0x4b')],_0x368ede['uniqueid'],md5(_0x368ede['uniqueid']));}else{_0x368ede[_0x0d8b('0x4c')]='';}return getConnection(_0x44c5c1)[_0x0d8b('0x2f')](function(_0x377027){_0x900906=_0x377027;return getUser(_0x44c5c1,_0x5e3bb4[_0x0d8b('0x4d')],_0x900906);})['then'](function(_0x356b3d){_0x3d3cb6=_0x356b3d;logger['info']('The\x20User\x20ID\x20is:',_0x3d3cb6['id']);return getEndUser(_0x44c5c1,_0x368ede[_0x0d8b('0x4e')],_0x368ede[_0x0d8b('0x4f')],_0x900906);})['then'](function(_0x4a8f33){_0x5c5bd7=_0x4a8f33;logger[_0x0d8b('0x19')](_0x0d8b('0x50'),_0x5c5bd7['id']);return createTicket(_0x44c5c1,_0x3d3cb6,_0x5c5bd7,_0xf22c3c,_0x368ede,_0xf22c3c[_0x0d8b('0x51')],_0x900906);})[_0x0d8b('0x2f')](function(_0x3afc3a){_0x5ef6c3=_0x3afc3a;logger[_0x0d8b('0x19')](_0x0d8b('0x52'));logger[_0x0d8b('0x19')]('The\x20Ticket\x20ID\x20is:',_0x5ef6c3['id']);var _0x24a859=util[_0x0d8b('0x1f')](_0x0d8b('0x53'),_0x44c5c1[_0x0d8b('0x21')],_[_0x0d8b('0x54')](_0x5ef6c3['id'],'x')[0x1]);logger[_0x0d8b('0x19')](_0x0d8b('0x48'),_0x0d8b('0x55'));emit(util[_0x0d8b('0x1f')]('user:%s',_0x5e3bb4[_0x0d8b('0x17')]),_0x0d8b('0x56'),{'uri':_0x24a859});})[_0x0d8b('0x36')](function(_0x23de9e){logger[_0x0d8b('0x2a')]('[QUEUE]',JSON[_0x0d8b('0x26')](_0x23de9e));});};exports[_0x0d8b('0x57')]=function(_0x181d49,_0x17a87f,_0x1d6cd4,_0x59ada2,_0x4d0e7c,_0x3b1166,_0x291b83){var _0x3e4a41,_0xbbb520,_0x5a70bd,_0x199122;_0x3b1166[_0x0d8b('0x21')]=intUtil[_0x0d8b('0x46')](_0x3b1166['remoteUri']);_0x3b1166[_0x0d8b('0x4b')]=intUtil['stripTrailingSlash'](_0x3b1166[_0x0d8b('0x4b')]);if(_0x291b83&&_0x291b83[_0x0d8b('0x58')]&&_0x291b83[_0x0d8b('0x58')]!==_0x0d8b('0x59')){logger[_0x0d8b('0x19')](_0x0d8b('0x5a'),'Recording\x20is\x20enabled!');_0x17a87f[_0x0d8b('0x4c')]=util['format'](_0x0d8b('0x4a'),_0x3b1166[_0x0d8b('0x4b')],_0x17a87f[_0x0d8b('0x5b')],md5(_0x17a87f[_0x0d8b('0x5b')]));}return getConnection(_0x3b1166)['then'](function(_0x19e097){_0x199122=_0x19e097;return getUser(_0x3b1166,_0x59ada2[_0x0d8b('0x4d')],_0x199122);})[_0x0d8b('0x2f')](function(_0x2332fc){_0x3e4a41=_0x2332fc;logger[_0x0d8b('0x19')](_0x0d8b('0x5c'),_0x3e4a41['id']);return getEndUser(_0x3b1166,_0x17a87f[_0x0d8b('0x5d')],_0x17a87f[_0x0d8b('0x5e')],_0x199122);})[_0x0d8b('0x2f')](function(_0x34affb){_0xbbb520=_0x34affb;logger['info']('The\x20Enduser\x20ID\x20is:',_0xbbb520['id']);return createTicket(_0x3b1166,_0x3e4a41,_0xbbb520,_0x1d6cd4,_0x17a87f,_0x1d6cd4[_0x0d8b('0x51')],_0x199122);})[_0x0d8b('0x2f')](function(_0x53e399){_0x5a70bd=_0x53e399;logger[_0x0d8b('0x19')]('Ticket\x20created!');logger['info'](_0x0d8b('0x5f'),_0x5a70bd['id']);var _0x1c4e96=util['format']('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x3b1166[_0x0d8b('0x21')],_[_0x0d8b('0x54')](_0x5a70bd['id'],'x')[0x1]);logger[_0x0d8b('0x19')](_0x0d8b('0x5a'),_0x0d8b('0x55'));emit(util[_0x0d8b('0x1f')](_0x0d8b('0x60'),_0x59ada2['name']),_0x0d8b('0x56'),{'uri':_0x1c4e96});})['catch'](function(_0x1a203e){logger[_0x0d8b('0x2a')](_0x0d8b('0x5a'),JSON[_0x0d8b('0x26')](_0x1a203e));});};exports['unmanaged']=function(_0x3fe47d,_0x4a1c4a,_0x3a356b,_0x2c6c5f,_0x1c5fe2,_0x2ebea3){var _0xc5c35f,_0x2b44e5,_0x3e927c,_0x91aa89;_0x2ebea3[_0x0d8b('0x21')]=intUtil[_0x0d8b('0x46')](_0x2ebea3['remoteUri']);_0x2ebea3[_0x0d8b('0x4b')]=intUtil['stripTrailingSlash'](_0x2ebea3[_0x0d8b('0x4b')]);if(_0x1c5fe2&&_0x1c5fe2[_0x0d8b('0x47')]){logger['info']('['+_0x4a1c4a[_0x0d8b('0x61')]['toUpperCase']()+']',_0x0d8b('0x49'));_0x4a1c4a[_0x0d8b('0x4c')]=util[_0x0d8b('0x1f')](_0x0d8b('0x4a'),_0x2ebea3[_0x0d8b('0x4b')],_0x4a1c4a[_0x0d8b('0x5b')],md5(_0x4a1c4a[_0x0d8b('0x5b')]));}else{_0x4a1c4a[_0x0d8b('0x4c')]='';}return getConnection(_0x2ebea3)['then'](function(_0x10eca6){_0x91aa89=_0x10eca6;return getUser(_0x2ebea3,'',_0x91aa89);})[_0x0d8b('0x2f')](function(_0x5b2916){_0xc5c35f=_0x5b2916;logger[_0x0d8b('0x19')](_0x0d8b('0x5c'),_0xc5c35f['id']);return getEndUser(_0x2ebea3,_0x4a1c4a[_0x0d8b('0x4e')],_0x4a1c4a[_0x0d8b('0x4f')],_0x91aa89);})[_0x0d8b('0x2f')](function(_0x9e44b4){_0x2b44e5=_0x9e44b4;logger[_0x0d8b('0x19')](_0x0d8b('0x50'),_0x2b44e5['id']);return createTicket(_0x2ebea3,_0xc5c35f,_0x2b44e5,_0x3a356b,_0x4a1c4a,_0x3a356b[_0x0d8b('0x51')],_0x91aa89);})[_0x0d8b('0x2f')](function(_0xe35028){_0x3e927c=_0xe35028;logger[_0x0d8b('0x19')]('Ticket\x20created!');logger[_0x0d8b('0x19')](_0x0d8b('0x5f'),_0x3e927c['id']);})[_0x0d8b('0x36')](function(_0x58525c){logger['error']('['+_0x4a1c4a[_0x0d8b('0x61')][_0x0d8b('0x62')]()+']',JSON[_0x0d8b('0x26')](_0x58525c));});};
\ No newline at end of file
+var _0x9c44=['stringify','validateEmail','Getting\x20agent\x20with\x20email','GET','%s/webservice.php','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','success','length','Agent\x20found!','email1','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','getUser','admin','Searching\x20end\x20user\x20with\x20phone','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','phone','getEndUser','accessKey','login','Account\x20%d\x20is\x20not\x20valid','getConnection','[HTTP]','queue','stripTrailingSlash','[QUEUE]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','recordingURL','email','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','Fields','The\x20Ticket\x20ID\x20is:','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','Ticket\x20created!','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','trigger:browser:url','unmanaged','monitor_format','toUpperCase','calleridnum','lastevent','bluebird','md5','util','ioredis','./util','../../../../config/environment','redis','localhost','socket.io-emitter','emit','forEach','string','picklist','idField','content','type','variable','variableName','toString','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','Open','getString','Subjects','POST','remoteUri','create','username','sessionName','then','resolve','result','format','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','catch','statusCode','error','[vTiger],\x20%s,\x20%s,\x20%s'];(function(_0x55dfbb,_0x1b6d6b){var _0x569ad9=function(_0x17e98f){while(--_0x17e98f){_0x55dfbb['push'](_0x55dfbb['shift']());}};_0x569ad9(++_0x1b6d6b);}(_0x9c44,0x178));var _0x49c4=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0x9c44[_0xb0f7c3];return _0x28ea68;};'use strict';var _=require('lodash');var rp=require('request-promise');var BPromise=require(_0x49c4('0x0'));var md5=require(_0x49c4('0x1'));var util=require(_0x49c4('0x2'));var Redis=require(_0x49c4('0x3'));var intUtil=require(_0x49c4('0x4'));var config=require(_0x49c4('0x5'));var logger=require('../../../../config/logger')('vTiger');config[_0x49c4('0x6')]=_['defaults'](config[_0x49c4('0x6')],{'host':_0x49c4('0x7'),'port':0x18eb});var io=require(_0x49c4('0x8'))(new Redis(config[_0x49c4('0x6')]));function emit(_0x436234,_0x511d53,_0x11c586){io['to'](_0x436234)[_0x49c4('0x9')](_0x511d53,_0x11c586);}function getCustomFields(_0x1d13fb,_0x4487ca){var _0x4c7d3a={};if(_0x1d13fb['length']>0x0){_[_0x49c4('0xa')](_0x1d13fb,function(_0x313e73){if(_['includes']([_0x49c4('0xb'),_0x49c4('0xc')],_0x313e73['type'])&&_0x313e73['idField']){_0x4c7d3a[_0x313e73[_0x49c4('0xd')]]=_0x313e73[_0x49c4('0xe')]['toString']();}else if(_0x313e73[_0x49c4('0xf')]===_0x49c4('0x10')&&_0x313e73['variableName']&&_0x313e73[_0x49c4('0xd')]&&_0x4487ca[_0x313e73[_0x49c4('0x11')]]){_0x4c7d3a[_0x313e73[_0x49c4('0xd')]]=_0x4487ca[_0x313e73[_0x49c4('0x11')]][_0x49c4('0x12')]();}else if(_0x313e73[_0x49c4('0xf')]===_0x49c4('0x13')&&_0x313e73[_0x49c4('0x14')]&&_0x313e73['Variable'][_0x49c4('0x15')]&&_0x313e73[_0x49c4('0xd')]&&_0x4487ca[_0x313e73[_0x49c4('0x14')][_0x49c4('0x15')][_0x49c4('0x16')]()]){_0x4c7d3a[_0x313e73['idField']]=_0x4487ca[_0x313e73[_0x49c4('0x14')][_0x49c4('0x15')]['toLowerCase']()]['toString']();}});}return _0x4c7d3a;}function createTicket(_0x3c782d,_0x2f82d5,_0x3addb2,_0x59f29b,_0x24856d,_0x50b151,_0x2cbd50){logger[_0x49c4('0x17')](_0x49c4('0x18'));var _0x291526=_[_0x49c4('0x19')]({'parent_id':'','assigned_user_id':_0x2f82d5['id'],'ticketpriorities':_0x49c4('0x1a'),'ticketstatus':_0x49c4('0x1b'),'ticket_title':intUtil[_0x49c4('0x1c')](_0x59f29b[_0x49c4('0x1d')],_0x24856d,'\x20'),'description':intUtil['getString'](_0x59f29b['Descriptions'],_0x24856d,'\x0a'),'contact_id':_0x3addb2['id']},getCustomFields(_0x50b151,_0x24856d));var _0x57f502={'method':_0x49c4('0x1e'),'uri':util['format']('%s/webservice.php',_0x3c782d[_0x49c4('0x1f')]),'form':{'operation':_0x49c4('0x20'),'username':_0x3c782d[_0x49c4('0x21')],'sessionName':_0x2cbd50[_0x49c4('0x22')],'elementType':'HelpDesk','element':JSON['stringify'](_0x291526)},'json':!![]};return request(_0x57f502)[_0x49c4('0x23')](function(_0x9cb797){if(_0x9cb797['success']){return BPromise[_0x49c4('0x24')]({'id':_0x9cb797[_0x49c4('0x25')]['id']});}else{throw new Error(util[_0x49c4('0x26')](_0x49c4('0x27'),JSON['stringify'](_0x9cb797['error'])));}})[_0x49c4('0x28')](function(_0x53c199){var _0x3800b7=_0x53c199[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),'createTicket',_0x3800b7,JSON[_0x49c4('0x2c')](_0x53c199));});}function getUser(_0x2b2793,_0x46e04d,_0x4f28a2){if(intUtil[_0x49c4('0x2d')](_0x46e04d)){logger[_0x49c4('0x17')](_0x49c4('0x2e'),_0x46e04d);return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2b2793[_0x49c4('0x1f')]),'qs':{'operation':'query','username':_0x2b2793['username'],'sessionName':_0x4f28a2['sessionName'],'query':util[_0x49c4('0x26')](_0x49c4('0x31'),_0x46e04d)},'json':!![]})[_0x49c4('0x23')](function(_0x27e467){if(_0x27e467[_0x49c4('0x32')]&&_0x27e467['result'][_0x49c4('0x33')]){logger[_0x49c4('0x17')](_0x49c4('0x34'));return BPromise[_0x49c4('0x24')]({'id':_0x27e467['result'][0x0]['id'],'email':_0x27e467['result'][0x0][_0x49c4('0x35')],'name':_0x27e467[_0x49c4('0x25')][0x0][_0x49c4('0x36')]+'\x20'+_0x27e467[_0x49c4('0x25')][_0x49c4('0x37')]});}else{logger['info'](_0x49c4('0x38'));return BPromise[_0x49c4('0x24')]({'id':_0x4f28a2[_0x49c4('0x39')],'email':_0x2b2793['username'],'name':'admin'});}})[_0x49c4('0x28')](function(_0x1991e9){var _0x3bec0a=_0x1991e9[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x3a'),_0x3bec0a,JSON[_0x49c4('0x2c')](_0x1991e9));});}else{logger[_0x49c4('0x17')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x49c4('0x24')]({'id':_0x4f28a2['userId'],'email':_0x2b2793[_0x49c4('0x21')],'name':_0x49c4('0x3b')})[_0x49c4('0x28')](function(_0x1c2830){var _0x4ed4f8=_0x1c2830[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),'getUser',_0x4ed4f8,JSON[_0x49c4('0x2c')](_0x1c2830));});}}function getEndUser(_0x21d8c7,_0x178987,_0x5e5366,_0x1ba7a0){logger[_0x49c4('0x17')](_0x49c4('0x3c'),_0x5e5366);return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x21d8c7[_0x49c4('0x1f')]),'qs':{'operation':'query','username':_0x21d8c7[_0x49c4('0x21')],'sessionName':_0x1ba7a0[_0x49c4('0x22')],'query':util[_0x49c4('0x26')](_0x49c4('0x3d'),_0x5e5366,_0x5e5366,_0x5e5366,_0x5e5366,_0x5e5366)},'json':!![]})[_0x49c4('0x23')](function(_0x29dd5d){if(_0x29dd5d[_0x49c4('0x32')]&&_0x29dd5d[_0x49c4('0x25')][_0x49c4('0x33')]){logger[_0x49c4('0x17')](_0x49c4('0x3e'));return BPromise[_0x49c4('0x24')]({'id':_0x29dd5d[_0x49c4('0x25')][0x0]['id'],'name':_0x29dd5d['result'][0x0][_0x49c4('0x3f')]+'\x20'+_0x29dd5d['result'][0x0][_0x49c4('0x40')],'phone':_0x5e5366});}else{logger[_0x49c4('0x17')](_0x49c4('0x41'));return request({'method':_0x49c4('0x1e'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x21d8c7['remoteUri']),'form':{'operation':'create','sessionName':_0x1ba7a0[_0x49c4('0x22')],'elementType':_0x49c4('0x42'),'element':JSON[_0x49c4('0x2c')]({'lastname':_0x178987,'phone':_0x5e5366,'assigned_user_id':'\x20'})},'json':!![]})[_0x49c4('0x23')](function(_0x490823){logger[_0x49c4('0x17')](_0x49c4('0x43'));return BPromise[_0x49c4('0x24')]({'id':_0x490823[_0x49c4('0x25')]['id'],'name':_0x490823[_0x49c4('0x25')][_0x49c4('0x40')],'phone':_0x490823[_0x49c4('0x25')][_0x49c4('0x44')]});})[_0x49c4('0x28')](function(_0x5640d3){var _0x2ad771=_0x5640d3['statusCode']||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x45'),_0x2ad771,JSON[_0x49c4('0x2c')](_0x5640d3));});}});}function getConnection(_0x2d93d8){var _0x5b296d=_0x2d93d8[_0x49c4('0x21')];var _0x15b674=_0x2d93d8[_0x49c4('0x46')];return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2d93d8[_0x49c4('0x1f')]),'qs':{'operation':'getchallenge','username':_0x5b296d},'json':!![]})[_0x49c4('0x23')](function(_0x5cfff9){if(_0x5cfff9[_0x49c4('0x32')]){return request({'method':_0x49c4('0x1e'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2d93d8[_0x49c4('0x1f')]),'form':{'operation':_0x49c4('0x47'),'username':_0x5b296d,'accessKey':md5(_0x5cfff9[_0x49c4('0x25')]['token']+_0x15b674)},'json':!![]});}})[_0x49c4('0x23')](function(_0x3feaf0){if(_0x3feaf0['success']){return BPromise[_0x49c4('0x24')](_0x3feaf0[_0x49c4('0x25')]);}else{throw new Error(util[_0x49c4('0x26')](_0x49c4('0x48'),_0x2d93d8['id']));}})['catch'](function(_0x5d8bf0){var _0x144fd2=_0x5d8bf0['statusCode']||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x49'),_0x144fd2,JSON[_0x49c4('0x2c')](_0x5d8bf0));});}function request(_0x240c20){logger[_0x49c4('0x17')](_0x49c4('0x4a'),JSON['stringify'](_0x240c20));return rp(_0x240c20);}exports[_0x49c4('0x4b')]=function(_0x1550ce,_0x3936d3,_0x3d944c,_0x17ef75,_0x2644c0,_0x156748){var _0x25d174,_0x1e0b4f,_0x1856be,_0x5b822f;_0x156748['remoteUri']=intUtil[_0x49c4('0x4c')](_0x156748[_0x49c4('0x1f')]);if(_0x2644c0&&_0x2644c0['monitor_format']){logger['info'](_0x49c4('0x4d'),'Recording\x20is\x20enabled!');_0x3936d3['recordingURL']=util[_0x49c4('0x26')](_0x49c4('0x4e'),_0x156748[_0x49c4('0x4f')],_0x3936d3[_0x49c4('0x50')],md5(_0x3936d3[_0x49c4('0x50')]));}else{_0x3936d3[_0x49c4('0x51')]='';}return getConnection(_0x156748)[_0x49c4('0x23')](function(_0x50798e){_0x5b822f=_0x50798e;return getUser(_0x156748,_0x17ef75[_0x49c4('0x52')],_0x5b822f);})[_0x49c4('0x23')](function(_0x207572){_0x25d174=_0x207572;logger[_0x49c4('0x17')](_0x49c4('0x53'),_0x25d174['id']);return getEndUser(_0x156748,_0x3936d3[_0x49c4('0x54')],_0x3936d3['calleridnum'],_0x5b822f);})['then'](function(_0x1ef0c1){_0x1e0b4f=_0x1ef0c1;logger[_0x49c4('0x17')](_0x49c4('0x55'),_0x1e0b4f['id']);return createTicket(_0x156748,_0x25d174,_0x1e0b4f,_0x3d944c,_0x3936d3,_0x3d944c[_0x49c4('0x56')],_0x5b822f);})[_0x49c4('0x23')](function(_0x6b2592){_0x1856be=_0x6b2592;logger[_0x49c4('0x17')]('Ticket\x20created!');logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x1856be['id']);var _0x4ba4eb=util[_0x49c4('0x26')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x156748[_0x49c4('0x1f')],_[_0x49c4('0x58')](_0x1856be['id'],'x')[0x1]);logger[_0x49c4('0x17')](_0x49c4('0x4d'),_0x49c4('0x59'));emit(util[_0x49c4('0x26')](_0x49c4('0x5a'),_0x17ef75[_0x49c4('0x15')]),'trigger:browser:url',{'uri':_0x4ba4eb});})[_0x49c4('0x28')](function(_0x27b9c2){logger['error'](_0x49c4('0x4d'),JSON[_0x49c4('0x2c')](_0x27b9c2));});};exports['outbound']=function(_0x39c455,_0x42e0e6,_0x4f50bf,_0x4dc54d,_0x589484,_0x513879,_0xc43386){var _0x54947d,_0xb20a5d,_0x32f344,_0x515240;_0x513879[_0x49c4('0x1f')]=intUtil[_0x49c4('0x4c')](_0x513879['remoteUri']);_0x513879[_0x49c4('0x4f')]=intUtil[_0x49c4('0x4c')](_0x513879[_0x49c4('0x4f')]);if(_0xc43386&&_0xc43386[_0x49c4('0x5b')]&&_0xc43386['recordingFormat']!==_0x49c4('0x5c')){logger[_0x49c4('0x17')](_0x49c4('0x5d'),_0x49c4('0x5e'));_0x42e0e6['recordingURL']=util[_0x49c4('0x26')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x513879['serverUrl'],_0x42e0e6['uniqueid'],md5(_0x42e0e6['uniqueid']));}return getConnection(_0x513879)[_0x49c4('0x23')](function(_0x32eaef){_0x515240=_0x32eaef;return getUser(_0x513879,_0x4dc54d[_0x49c4('0x52')],_0x515240);})[_0x49c4('0x23')](function(_0x5b056e){_0x54947d=_0x5b056e;logger['info'](_0x49c4('0x53'),_0x54947d['id']);return getEndUser(_0x513879,_0x42e0e6[_0x49c4('0x5f')],_0x42e0e6[_0x49c4('0x60')],_0x515240);})[_0x49c4('0x23')](function(_0x102c15){_0xb20a5d=_0x102c15;logger[_0x49c4('0x17')](_0x49c4('0x55'),_0xb20a5d['id']);return createTicket(_0x513879,_0x54947d,_0xb20a5d,_0x4f50bf,_0x42e0e6,_0x4f50bf[_0x49c4('0x56')],_0x515240);})['then'](function(_0x2276db){_0x32f344=_0x2276db;logger['info'](_0x49c4('0x61'));logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x32f344['id']);var _0x1ea1b4=util[_0x49c4('0x26')](_0x49c4('0x62'),_0x513879[_0x49c4('0x1f')],_[_0x49c4('0x58')](_0x32f344['id'],'x')[0x1]);logger[_0x49c4('0x17')](_0x49c4('0x5d'),_0x49c4('0x59'));emit(util[_0x49c4('0x26')](_0x49c4('0x5a'),_0x4dc54d[_0x49c4('0x15')]),_0x49c4('0x63'),{'uri':_0x1ea1b4});})[_0x49c4('0x28')](function(_0x371e49){logger[_0x49c4('0x2a')]('[OUTBOUND]',JSON['stringify'](_0x371e49));});};exports[_0x49c4('0x64')]=function(_0x16b3e8,_0x4af680,_0x1a15f3,_0x38ad50,_0x2939fd,_0x16e7b1){var _0x4d6aaa,_0x5a14a5,_0x4a85d4,_0x2e90d8;_0x16e7b1[_0x49c4('0x1f')]=intUtil[_0x49c4('0x4c')](_0x16e7b1[_0x49c4('0x1f')]);_0x16e7b1[_0x49c4('0x4f')]=intUtil[_0x49c4('0x4c')](_0x16e7b1[_0x49c4('0x4f')]);if(_0x2939fd&&_0x2939fd[_0x49c4('0x65')]){logger[_0x49c4('0x17')]('['+_0x4af680['lastevent'][_0x49c4('0x66')]()+']',_0x49c4('0x5e'));_0x4af680[_0x49c4('0x51')]=util['format'](_0x49c4('0x4e'),_0x16e7b1[_0x49c4('0x4f')],_0x4af680[_0x49c4('0x50')],md5(_0x4af680[_0x49c4('0x50')]));}else{_0x4af680[_0x49c4('0x51')]='';}return getConnection(_0x16e7b1)[_0x49c4('0x23')](function(_0x35fa39){_0x2e90d8=_0x35fa39;return getUser(_0x16e7b1,'',_0x2e90d8);})[_0x49c4('0x23')](function(_0x4ba198){_0x4d6aaa=_0x4ba198;logger[_0x49c4('0x17')](_0x49c4('0x53'),_0x4d6aaa['id']);return getEndUser(_0x16e7b1,_0x4af680[_0x49c4('0x54')],_0x4af680[_0x49c4('0x67')],_0x2e90d8);})[_0x49c4('0x23')](function(_0x4a204d){_0x5a14a5=_0x4a204d;logger['info'](_0x49c4('0x55'),_0x5a14a5['id']);return createTicket(_0x16e7b1,_0x4d6aaa,_0x5a14a5,_0x1a15f3,_0x4af680,_0x1a15f3['Fields'],_0x2e90d8);})[_0x49c4('0x23')](function(_0x558880){_0x4a85d4=_0x558880;logger[_0x49c4('0x17')](_0x49c4('0x61'));logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x4a85d4['id']);})['catch'](function(_0x123060){logger[_0x49c4('0x2a')]('['+_0x4af680[_0x49c4('0x68')][_0x49c4('0x66')]()+']',JSON[_0x49c4('0x2c')](_0x123060));});};
\ No newline at end of file
index ac27e8a..6162168 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8cf5=['toString','picklist','idField','customField','custom_fields','push','content','variable','variableName','customVariable','Variable','toLowerCase','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','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','%s/channels/voice/agents/%d/tickets/%d/display.json','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/agent/tickets/%s','replace','/api/v2','error','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','Displaying\x20ticket\x20to\x20agent...','newTab','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','lastevent','\x20Error\x20running\x20Zendesk\x20integration','lodash','md5','util','ioredis','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','emit','application/json','info','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','Agent\x20found!','find','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','user','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','filter','end-user','length','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Caller\x20-\x20%s','Enduser\x20created.','password','username','authType','token','%s/token:%s','Basic\x20%s','base64','debug','[HTTP]','stringify','GET','map','forEach','includes','string','type','nameField'];(function(_0xb62f3d,_0x190dd7){var _0x394dc6=function(_0x364bc){while(--_0x364bc){_0xb62f3d['push'](_0xb62f3d['shift']());}};_0x394dc6(++_0x190dd7);}(_0x8cf5,0xa7));var _0x58cf=function(_0x5472bf,_0x59e100){_0x5472bf=_0x5472bf-0x0;var _0x2bc46c=_0x8cf5[_0x5472bf];return _0x2bc46c;};'use strict';var _=require(_0x58cf('0x0'));var rp=require('request-promise');var md5=require(_0x58cf('0x1'));var util=require(_0x58cf('0x2'));var Redis=require(_0x58cf('0x3'));var intUtil=require('./util');var config=require(_0x58cf('0x4'));var logger=require('../../../../config/logger')('zendesk');config[_0x58cf('0x5')]=_[_0x58cf('0x6')](config[_0x58cf('0x5')],{'host':_0x58cf('0x7'),'port':0x18eb});var io=require(_0x58cf('0x8'))(new Redis(config['redis']));function emit(_0x4cef07,_0x5f3227,_0x1916bc){io['to'](_0x4cef07)[_0x58cf('0x9')](_0x5f3227,_0x1916bc);}var headers={'Content-Type':'application/json','Accept':_0x58cf('0xa')};function getTicket(_0x4f74e0,_0x59a99f,_0x572756,_0xe3bfcb,_0x58574d){logger[_0x58cf('0xb')]('Creating\x20new\x20ticket...');return request({'uri':util[_0x58cf('0xc')](_0x58cf('0xd'),_0x4f74e0[_0x58cf('0xe')]),'method':_0x58cf('0xf'),'body':{'ticket':_[_0x58cf('0x10')]({'requester_id':_0x572756['id'],'submitter_id':_0x59a99f?_0x59a99f['id']:undefined,'assignee_id':_0x59a99f?_0x59a99f['id']:undefined,'tags':getTags(_0xe3bfcb[_0x58cf('0x11')],_0x58cf('0x12')),'subject':intUtil[_0x58cf('0x13')](_0xe3bfcb[_0x58cf('0x14')],_0x58574d,'\x20'),'description':intUtil['getString'](_0xe3bfcb[_0x58cf('0x15')],_0x58574d,'\x0a'),'comment':{'public':![],'body':intUtil[_0x58cf('0x13')](_0xe3bfcb['Descriptions'],_0x58574d,'\x0a')}},getCustomFields(_0xe3bfcb[_0x58cf('0x16')],_0x58574d))}})['then'](function(_0x5d4d8f){logger['info'](_0x58cf('0x17'));return _0x5d4d8f[_0x58cf('0x18')];});}function getUser(_0x4eb13a,_0x55cdd7){if(intUtil[_0x58cf('0x19')](_0x55cdd7)){logger[_0x58cf('0xb')](_0x58cf('0x1a'),_0x55cdd7);return request({'uri':util['format'](_0x58cf('0x1b'),_0x4eb13a[_0x58cf('0xe')]),'qs':{'query':util[_0x58cf('0xc')](_0x58cf('0x1c'),_0x55cdd7)}})[_0x58cf('0x1d')](function(_0x1bbd3e){if(_0x1bbd3e['count']){logger[_0x58cf('0xb')](_0x58cf('0x1e'));return _[_0x58cf('0x1f')](_0x1bbd3e[_0x58cf('0x20')],{'email':_0x55cdd7,'role':_0x58cf('0x21')});}else{logger['info'](_0x58cf('0x22'));return request({'uri':util['format'](_0x58cf('0x23'),_0x4eb13a[_0x58cf('0xe')])})[_0x58cf('0x1d')](function(_0x5681ba){logger[_0x58cf('0xb')](_0x58cf('0x24'));return _0x5681ba[_0x58cf('0x25')];});}});}else{logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x58cf('0xc')](_0x58cf('0x23'),_0x4eb13a[_0x58cf('0xe')])})['then'](function(_0x9af099){logger[_0x58cf('0xb')]('Admin\x20account\x20selected.');return _0x9af099['user'];});}}function getEndUser(_0x2b6d81,_0x54b068,_0x303967){logger[_0x58cf('0xb')](_0x58cf('0x26'),_0x303967);return request({'uri':util[_0x58cf('0xc')](_0x58cf('0x1b'),_0x2b6d81[_0x58cf('0xe')]),'qs':{'query':util[_0x58cf('0xc')](_0x58cf('0x27'),_0x303967)}})['then'](function(_0x1db702){var _0x48a3ac;if(_0x1db702[_0x58cf('0x20')]['length']){_0x1db702[_0x58cf('0x20')]=_[_0x58cf('0x28')](_0x1db702[_0x58cf('0x20')],{'suspended':![],'role':_0x58cf('0x29')});if(_0x1db702[_0x58cf('0x20')][_0x58cf('0x2a')]){_0x48a3ac=_[_0x58cf('0x2b')](_0x1db702[_0x58cf('0x20')]);}}if(_0x48a3ac){logger['info'](_0x58cf('0x2c'));return _0x48a3ac;}else{logger[_0x58cf('0xb')](_0x58cf('0x2d'));return request({'uri':util[_0x58cf('0xc')]('%s/users.json',_0x2b6d81[_0x58cf('0xe')]),'method':_0x58cf('0xf'),'body':{'user':{'role':_0x58cf('0x29'),'name':util[_0x58cf('0xc')](_0x58cf('0x2e'),_0x54b068||_0x303967),'phone':_0x303967}}})[_0x58cf('0x1d')](function(_0x2cf089){logger['info'](_0x58cf('0x2f'));return _0x2cf089['user'];});}});}function getAuth(_0x44b7b4){var _0x1c7567;if(_0x44b7b4['authType']===_0x58cf('0x30')){_0x1c7567=util[_0x58cf('0xc')]('%s:%s',_0x44b7b4[_0x58cf('0x31')],_0x44b7b4[_0x58cf('0x30')]);}else if(_0x44b7b4[_0x58cf('0x32')]===_0x58cf('0x33')){_0x1c7567=util[_0x58cf('0xc')](_0x58cf('0x34'),_0x44b7b4[_0x58cf('0x31')],_0x44b7b4[_0x58cf('0x33')]);}return util[_0x58cf('0xc')](_0x58cf('0x35'),new Buffer(_0x1c7567)['toString'](_0x58cf('0x36')));}function request(_0x1008e8){logger[_0x58cf('0x37')](_0x58cf('0x38'),JSON[_0x58cf('0x39')](_0x1008e8));return rp(_[_0x58cf('0x6')](_0x1008e8,{'method':_0x58cf('0x3a'),'headers':headers,'json':!![]}));}function getTags(_0x1140d5,_0x43a1ca){var _0x13d6c2=[];if(_0x1140d5&&_0x1140d5[_0x58cf('0x2a')]>0x0){_0x13d6c2=_[_0x58cf('0x3b')](_0x1140d5,_0x43a1ca);}return _0x13d6c2;}function getCustomFields(_0x403c65,_0x7cf3c3){var _0x12cbe2=[];var _0x39d215={'custom_fields':[]};if(_0x403c65[_0x58cf('0x2a')]>0x0){_[_0x58cf('0x3c')](_0x403c65,function(_0x35627c){if(_[_0x58cf('0x3d')]([_0x58cf('0x3e'),'picklist'],_0x35627c[_0x58cf('0x3f')])&&_0x35627c[_0x58cf('0x40')]&&!_0x35627c['customField']){_0x39d215[_0x35627c[_0x58cf('0x40')]['toLowerCase']()]=_0x35627c['content'][_0x58cf('0x41')]();}else if(_[_0x58cf('0x3d')]([_0x58cf('0x3e'),_0x58cf('0x42')],_0x35627c[_0x58cf('0x3f')])&&_0x35627c[_0x58cf('0x43')]&&_0x35627c[_0x58cf('0x44')]){_0x39d215[_0x58cf('0x45')][_0x58cf('0x46')]({'id':_0x35627c['idField'],'value':_0x35627c[_0x58cf('0x47')][_0x58cf('0x41')]()});}else if(_0x35627c['type']===_0x58cf('0x48')&&_0x35627c[_0x58cf('0x49')]&&_0x35627c[_0x58cf('0x43')]&&_0x35627c[_0x58cf('0x44')]){_0x7cf3c3[_0x35627c[_0x58cf('0x49')]]&&_0x39d215['custom_fields'][_0x58cf('0x46')]({'id':_0x35627c[_0x58cf('0x43')],'value':_0x7cf3c3[_0x35627c[_0x58cf('0x49')]][_0x58cf('0x41')]()});}else if(_0x35627c[_0x58cf('0x3f')]===_0x58cf('0x4a')&&_0x35627c[_0x58cf('0x4b')]&&_0x35627c[_0x58cf('0x4b')][_0x58cf('0x12')]&&_0x35627c[_0x58cf('0x43')]&&_0x35627c[_0x58cf('0x44')]){_0x7cf3c3[_0x35627c[_0x58cf('0x4b')][_0x58cf('0x12')][_0x58cf('0x4c')]()]&&_0x39d215[_0x58cf('0x45')]['push']({'id':_0x35627c[_0x58cf('0x43')],'value':_0x7cf3c3[_0x35627c[_0x58cf('0x4b')]['name'][_0x58cf('0x4c')]()][_0x58cf('0x41')]()});}});}return _0x39d215;}exports[_0x58cf('0x4d')]=function(_0x20a077,_0x40d377,_0x57a7d4,_0x5b2e8a,_0x5341d7,_0x300482){var _0x46818c,_0xd55427;_0x300482[_0x58cf('0xe')]=intUtil['stripTrailingSlash'](_0x300482['remoteUri']);_0x300482[_0x58cf('0x4e')]=intUtil[_0x58cf('0x4f')](_0x300482['serverUrl']);if(_0x5341d7&&_0x5341d7[_0x58cf('0x50')]){logger[_0x58cf('0xb')](_0x58cf('0x51'),_0x58cf('0x52'));_0x40d377[_0x58cf('0x53')]=util[_0x58cf('0xc')](_0x58cf('0x54'),_0x300482[_0x58cf('0x4e')],_0x40d377[_0x58cf('0x55')],md5(_0x40d377[_0x58cf('0x55')]));}else{_0x40d377[_0x58cf('0x53')]='';}headers[_0x58cf('0x56')]=getAuth(_0x300482);return getUser(_0x300482,_0x5b2e8a[_0x58cf('0x57')])[_0x58cf('0x1d')](function(_0x2d3717){_0x46818c=_0x2d3717;logger[_0x58cf('0xb')](_0x58cf('0x58'),_0x46818c['id']);return getEndUser(_0x300482,_0x40d377['calleridname'],_0x40d377[_0x58cf('0x59')]);})[_0x58cf('0x1d')](function(_0x335e5b){_0xd55427=_0x335e5b;logger[_0x58cf('0xb')](_0x58cf('0x5a'),_0xd55427['id']);return getTicket(_0x300482,_0x46818c,_0xd55427,_0x57a7d4,_0x40d377);})[_0x58cf('0x1d')](function(_0x21a01d){if(_0x21a01d){logger[_0x58cf('0xb')](_0x58cf('0x5b'),_0x21a01d['id']);switch(_0x300482[_0x58cf('0x3f')]){case _0x58cf('0x5c'):logger['info'](_0x58cf('0x51'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0x58cf('0xc')](_0x58cf('0x5d'),_0x300482[_0x58cf('0xe')],_0x46818c['id'],_0x21a01d['id']),'method':'POST'});case'newTab':logger[_0x58cf('0xb')]('[QUEUE]',_0x58cf('0x5e'));emit(util[_0x58cf('0xc')](_0x58cf('0x5f'),_0x5b2e8a['name']),_0x58cf('0x60'),{'uri':util[_0x58cf('0xc')](_0x58cf('0x61'),_0x300482['remoteUri'][_0x58cf('0x62')](_0x58cf('0x63'),''),_0x21a01d['id'])});break;default:logger[_0x58cf('0x64')](_0x58cf('0x51'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0x58cf('0x65')](function(_0x5b7892){logger[_0x58cf('0x64')](_0x58cf('0x66'),util[_0x58cf('0x67')](_0x5b7892,{'showHidden':!![],'depth':null}));});};exports[_0x58cf('0x68')]=function(_0x15f24a,_0x326b41,_0x36653f,_0x4da9bf,_0xb82716,_0x4bb28c,_0x127aad){var _0x3e4019,_0x18c38d;_0x4bb28c[_0x58cf('0xe')]=intUtil['stripTrailingSlash'](_0x4bb28c[_0x58cf('0xe')]);_0x4bb28c[_0x58cf('0x4e')]=intUtil[_0x58cf('0x4f')](_0x4bb28c[_0x58cf('0x4e')]);if(_0x127aad&&_0x127aad['recordingFormat']&&_0x127aad[_0x58cf('0x69')]!==_0x58cf('0x6a')){logger['info'](_0x58cf('0x6b'),_0x58cf('0x52'));_0x326b41[_0x58cf('0x53')]=util[_0x58cf('0xc')](_0x58cf('0x54'),_0x4bb28c[_0x58cf('0x4e')],_0x326b41[_0x58cf('0x55')],md5(_0x326b41[_0x58cf('0x55')]));}headers[_0x58cf('0x56')]=getAuth(_0x4bb28c);return getUser(_0x4bb28c,_0x4da9bf[_0x58cf('0x57')])[_0x58cf('0x1d')](function(_0x2de092){_0x3e4019=_0x2de092;logger['info'](_0x58cf('0x58'),_0x3e4019['id']);return getEndUser(_0x4bb28c,_0x326b41[_0x58cf('0x6c')],_0x326b41[_0x58cf('0x6d')]);})[_0x58cf('0x1d')](function(_0x15680f){_0x18c38d=_0x15680f;logger[_0x58cf('0xb')]('The\x20Enduser\x20ID\x20is:',_0x18c38d['id']);return getTicket(_0x4bb28c,_0x3e4019,_0x18c38d,_0x36653f,_0x326b41);})[_0x58cf('0x1d')](function(_0x376dea){if(_0x376dea){logger[_0x58cf('0xb')]('The\x20Ticket\x20ID\x20is:',_0x376dea['id']);switch(_0x4bb28c[_0x58cf('0x3f')]){case _0x58cf('0x5c'):logger[_0x58cf('0xb')](_0x58cf('0x6b'),_0x58cf('0x6e'));return request({'uri':util['format'](_0x58cf('0x5d'),_0x4bb28c[_0x58cf('0xe')],_0x3e4019['id'],_0x376dea['id']),'method':_0x58cf('0xf')});case _0x58cf('0x6f'):logger[_0x58cf('0xb')](_0x58cf('0x6b'),_0x58cf('0x5e'));emit(util['format'](_0x58cf('0x5f'),_0x4da9bf['name']),_0x58cf('0x60'),{'uri':util[_0x58cf('0xc')](_0x58cf('0x61'),_0x4bb28c[_0x58cf('0xe')][_0x58cf('0x62')](_0x58cf('0x63'),''),_0x376dea['id'])});break;default:logger[_0x58cf('0x64')](_0x58cf('0x6b'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0x58cf('0x65')](function(_0x550857){logger[_0x58cf('0x64')](_0x58cf('0x70'),util['inspect'](_0x550857,{'showHidden':!![],'depth':null}));});};exports[_0x58cf('0x71')]=function(_0x49c025,_0x6e5bd6,_0x182fc2,_0x1dcbc4,_0x211d57,_0x23a6ad){var _0x2737ba,_0x166b09;_0x23a6ad[_0x58cf('0xe')]=intUtil[_0x58cf('0x4f')](_0x23a6ad['remoteUri']);_0x23a6ad[_0x58cf('0x4e')]=intUtil[_0x58cf('0x4f')](_0x23a6ad['serverUrl']);if(_0x211d57&&_0x211d57[_0x58cf('0x50')]){logger[_0x58cf('0xb')]('['+_0x6e5bd6[_0x58cf('0x72')]['toUpperCase']()+']',_0x58cf('0x52'));_0x6e5bd6[_0x58cf('0x53')]=util[_0x58cf('0xc')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x23a6ad[_0x58cf('0x4e')],_0x6e5bd6[_0x58cf('0x55')],md5(_0x6e5bd6[_0x58cf('0x55')]));}else{_0x6e5bd6['recordingURL']='';}headers[_0x58cf('0x56')]=getAuth(_0x23a6ad);return getUser(_0x23a6ad)[_0x58cf('0x1d')](function(_0x334250){_0x2737ba=_0x334250;logger[_0x58cf('0xb')](_0x58cf('0x58'),_0x2737ba['id']);return getEndUser(_0x23a6ad,_0x6e5bd6['calleridname'],_0x6e5bd6[_0x58cf('0x59')]);})[_0x58cf('0x1d')](function(_0x3dd70a){_0x166b09=_0x3dd70a;logger[_0x58cf('0xb')](_0x58cf('0x5a'),_0x166b09['id']);return getTicket(_0x23a6ad,_0x2737ba,_0x166b09,_0x182fc2,_0x6e5bd6);})[_0x58cf('0x1d')](function(_0x1bce68){if(_0x1bce68){logger['info'](_0x58cf('0x5b'),_0x1bce68['id']);}})[_0x58cf('0x65')](function(_0xe30c6b){logger[_0x58cf('0x64')]('['+_0x6e5bd6['lastevent']['toUpperCase']()+']'+_0x58cf('0x73'),util[_0x58cf('0x67')](_0xe30c6b,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
+var _0x8132=['map','string','nameField','customField','toLowerCase','content','includes','picklist','type','idField','custom_fields','push','variable','variableName','Variable','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','uniqueid','recordingURL','Authorization','email','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','user:%s','trigger:browser:url','replace','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','inspect','outbound','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','%s/agent/tickets/%s','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','calleridname','toUpperCase','\x20Error\x20running\x20Zendesk\x20integration','lodash','md5','util','./util','../../../../config/environment','../../../../config/logger','zendesk','redis','defaults','localhost','socket.io-emitter','emit','application/json','info','Creating\x20new\x20ticket...','format','POST','merge','Tags','name','Subjects','getString','Descriptions','then','Ticket\x20created!','ticket','validateEmail','%s/search.json','remoteUri','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','results','%s/users/me.json','Admin\x20account\x20selected.','user','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','filter','end-user','length','first','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','Caller\x20-\x20%s','Enduser\x20created.','%s:%s','password','token','%s/token:%s','username','Basic\x20%s','toString','base64','debug','stringify'];(function(_0x3a758e,_0x32e62b){var _0x134079=function(_0x455534){while(--_0x455534){_0x3a758e['push'](_0x3a758e['shift']());}};_0x134079(++_0x32e62b);}(_0x8132,0x187));var _0x2813=function(_0x4869d6,_0x55952b){_0x4869d6=_0x4869d6-0x0;var _0x25da94=_0x8132[_0x4869d6];return _0x25da94;};'use strict';var _=require(_0x2813('0x0'));var rp=require('request-promise');var md5=require(_0x2813('0x1'));var util=require(_0x2813('0x2'));var Redis=require('ioredis');var intUtil=require(_0x2813('0x3'));var config=require(_0x2813('0x4'));var logger=require(_0x2813('0x5'))(_0x2813('0x6'));config[_0x2813('0x7')]=_[_0x2813('0x8')](config['redis'],{'host':_0x2813('0x9'),'port':0x18eb});var io=require(_0x2813('0xa'))(new Redis(config['redis']));function emit(_0x3be3c1,_0x4d3f87,_0x7e122){io['to'](_0x3be3c1)[_0x2813('0xb')](_0x4d3f87,_0x7e122);}var headers={'Content-Type':_0x2813('0xc'),'Accept':_0x2813('0xc')};function getTicket(_0xad6e43,_0x38e737,_0x53bfc5,_0x434559,_0x98cd39){logger[_0x2813('0xd')](_0x2813('0xe'));return request({'uri':util[_0x2813('0xf')]('%s/tickets.json',_0xad6e43['remoteUri']),'method':_0x2813('0x10'),'body':{'ticket':_[_0x2813('0x11')]({'requester_id':_0x53bfc5['id'],'submitter_id':_0x38e737?_0x38e737['id']:undefined,'assignee_id':_0x38e737?_0x38e737['id']:undefined,'tags':getTags(_0x434559[_0x2813('0x12')],_0x2813('0x13')),'subject':intUtil['getString'](_0x434559[_0x2813('0x14')],_0x98cd39,'\x20'),'description':intUtil[_0x2813('0x15')](_0x434559[_0x2813('0x16')],_0x98cd39,'\x0a'),'comment':{'public':![],'body':intUtil[_0x2813('0x15')](_0x434559[_0x2813('0x16')],_0x98cd39,'\x0a')}},getCustomFields(_0x434559['Fields'],_0x98cd39))}})[_0x2813('0x17')](function(_0x39fef9){logger['info'](_0x2813('0x18'));return _0x39fef9[_0x2813('0x19')];});}function getUser(_0x151a83,_0x597c51){if(intUtil[_0x2813('0x1a')](_0x597c51)){logger[_0x2813('0xd')]('Getting\x20agent\x20with\x20email',_0x597c51);return request({'uri':util[_0x2813('0xf')](_0x2813('0x1b'),_0x151a83[_0x2813('0x1c')]),'qs':{'query':util['format'](_0x2813('0x1d'),_0x597c51)}})[_0x2813('0x17')](function(_0x3dd52c){if(_0x3dd52c[_0x2813('0x1e')]){logger[_0x2813('0xd')](_0x2813('0x1f'));return _['find'](_0x3dd52c[_0x2813('0x20')],{'email':_0x597c51,'role':'agent'});}else{logger[_0x2813('0xd')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x2813('0xf')](_0x2813('0x21'),_0x151a83[_0x2813('0x1c')])})['then'](function(_0x142058){logger[_0x2813('0xd')](_0x2813('0x22'));return _0x142058[_0x2813('0x23')];});}});}else{logger['info'](_0x2813('0x24'));return request({'uri':util[_0x2813('0xf')](_0x2813('0x21'),_0x151a83[_0x2813('0x1c')])})[_0x2813('0x17')](function(_0x302b19){logger[_0x2813('0xd')](_0x2813('0x22'));return _0x302b19['user'];});}}function getEndUser(_0x380fe2,_0x559d7d,_0x3e108d){logger[_0x2813('0xd')](_0x2813('0x25'),_0x3e108d);return request({'uri':util['format']('%s/search.json',_0x380fe2[_0x2813('0x1c')]),'qs':{'query':util['format'](_0x2813('0x26'),_0x3e108d)}})[_0x2813('0x17')](function(_0xb60b17){var _0x646902;if(_0xb60b17[_0x2813('0x20')]['length']){_0xb60b17[_0x2813('0x20')]=_[_0x2813('0x27')](_0xb60b17[_0x2813('0x20')],{'suspended':![],'role':_0x2813('0x28')});if(_0xb60b17[_0x2813('0x20')][_0x2813('0x29')]){_0x646902=_[_0x2813('0x2a')](_0xb60b17['results']);}}if(_0x646902){logger['info']('Enduser\x20found!');return _0x646902;}else{logger[_0x2813('0xd')](_0x2813('0x2b'));return request({'uri':util[_0x2813('0xf')](_0x2813('0x2c'),_0x380fe2[_0x2813('0x1c')]),'method':'POST','body':{'user':{'role':'end-user','name':util['format'](_0x2813('0x2d'),_0x559d7d||_0x3e108d),'phone':_0x3e108d}}})[_0x2813('0x17')](function(_0x50760f){logger['info'](_0x2813('0x2e'));return _0x50760f[_0x2813('0x23')];});}});}function getAuth(_0x5ab3a1){var _0x57ce3d;if(_0x5ab3a1['authType']==='password'){_0x57ce3d=util[_0x2813('0xf')](_0x2813('0x2f'),_0x5ab3a1['username'],_0x5ab3a1[_0x2813('0x30')]);}else if(_0x5ab3a1['authType']===_0x2813('0x31')){_0x57ce3d=util['format'](_0x2813('0x32'),_0x5ab3a1[_0x2813('0x33')],_0x5ab3a1[_0x2813('0x31')]);}return util[_0x2813('0xf')](_0x2813('0x34'),new Buffer(_0x57ce3d)[_0x2813('0x35')](_0x2813('0x36')));}function request(_0x2de0d2){logger[_0x2813('0x37')]('[HTTP]',JSON[_0x2813('0x38')](_0x2de0d2));return rp(_[_0x2813('0x8')](_0x2de0d2,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x5997a9,_0x3219dc){var _0x411c48=[];if(_0x5997a9&&_0x5997a9[_0x2813('0x29')]>0x0){_0x411c48=_[_0x2813('0x39')](_0x5997a9,_0x3219dc);}return _0x411c48;}function getCustomFields(_0x5055b6,_0x135e93){var _0x3df437=[];var _0x3e576b={'custom_fields':[]};if(_0x5055b6[_0x2813('0x29')]>0x0){_['forEach'](_0x5055b6,function(_0x2e26fe){if(_['includes']([_0x2813('0x3a'),'picklist'],_0x2e26fe['type'])&&_0x2e26fe[_0x2813('0x3b')]&&!_0x2e26fe[_0x2813('0x3c')]){_0x3e576b[_0x2e26fe[_0x2813('0x3b')][_0x2813('0x3d')]()]=_0x2e26fe[_0x2813('0x3e')]['toString']();}else if(_[_0x2813('0x3f')]([_0x2813('0x3a'),_0x2813('0x40')],_0x2e26fe[_0x2813('0x41')])&&_0x2e26fe[_0x2813('0x42')]&&_0x2e26fe[_0x2813('0x3c')]){_0x3e576b[_0x2813('0x43')][_0x2813('0x44')]({'id':_0x2e26fe[_0x2813('0x42')],'value':_0x2e26fe[_0x2813('0x3e')][_0x2813('0x35')]()});}else if(_0x2e26fe['type']===_0x2813('0x45')&&_0x2e26fe[_0x2813('0x46')]&&_0x2e26fe[_0x2813('0x42')]&&_0x2e26fe['customField']){_0x135e93[_0x2e26fe[_0x2813('0x46')]]&&_0x3e576b[_0x2813('0x43')][_0x2813('0x44')]({'id':_0x2e26fe['idField'],'value':_0x135e93[_0x2e26fe[_0x2813('0x46')]]['toString']()});}else if(_0x2e26fe[_0x2813('0x41')]==='customVariable'&&_0x2e26fe[_0x2813('0x47')]&&_0x2e26fe['Variable'][_0x2813('0x13')]&&_0x2e26fe[_0x2813('0x42')]&&_0x2e26fe[_0x2813('0x3c')]){_0x135e93[_0x2e26fe['Variable']['name']['toLowerCase']()]&&_0x3e576b['custom_fields']['push']({'id':_0x2e26fe['idField'],'value':_0x135e93[_0x2e26fe[_0x2813('0x47')][_0x2813('0x13')][_0x2813('0x3d')]()]['toString']()});}});}return _0x3e576b;}exports[_0x2813('0x48')]=function(_0x318a71,_0x3fee1e,_0x761cde,_0x5112c5,_0x587c45,_0x427a99){var _0x1b375d,_0x1bc040;_0x427a99[_0x2813('0x1c')]=intUtil['stripTrailingSlash'](_0x427a99[_0x2813('0x1c')]);_0x427a99[_0x2813('0x49')]=intUtil[_0x2813('0x4a')](_0x427a99[_0x2813('0x49')]);if(_0x587c45&&_0x587c45[_0x2813('0x4b')]){logger['info'](_0x2813('0x4c'),_0x2813('0x4d'));_0x3fee1e['recordingURL']=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x427a99['serverUrl'],_0x3fee1e[_0x2813('0x4e')],md5(_0x3fee1e[_0x2813('0x4e')]));}else{_0x3fee1e[_0x2813('0x4f')]='';}headers[_0x2813('0x50')]=getAuth(_0x427a99);return getUser(_0x427a99,_0x5112c5[_0x2813('0x51')])[_0x2813('0x17')](function(_0x40c566){_0x1b375d=_0x40c566;logger[_0x2813('0xd')]('The\x20User\x20ID\x20is:',_0x1b375d['id']);return getEndUser(_0x427a99,_0x3fee1e['calleridname'],_0x3fee1e[_0x2813('0x52')]);})[_0x2813('0x17')](function(_0x4d0196){_0x1bc040=_0x4d0196;logger[_0x2813('0xd')](_0x2813('0x53'),_0x1bc040['id']);return getTicket(_0x427a99,_0x1b375d,_0x1bc040,_0x761cde,_0x3fee1e);})[_0x2813('0x17')](function(_0xeeb711){if(_0xeeb711){logger[_0x2813('0xd')](_0x2813('0x54'),_0xeeb711['id']);switch(_0x427a99[_0x2813('0x41')]){case _0x2813('0x55'):logger[_0x2813('0xd')](_0x2813('0x4c'),_0x2813('0x56'));return request({'uri':util[_0x2813('0xf')](_0x2813('0x57'),_0x427a99[_0x2813('0x1c')],_0x1b375d['id'],_0xeeb711['id']),'method':_0x2813('0x10')});case _0x2813('0x58'):logger[_0x2813('0xd')](_0x2813('0x4c'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0x2813('0x59'),_0x5112c5['name']),_0x2813('0x5a'),{'uri':util[_0x2813('0xf')]('%s/agent/tickets/%s',_0x427a99[_0x2813('0x1c')][_0x2813('0x5b')](_0x2813('0x5c'),''),_0xeeb711['id'])});break;default:logger[_0x2813('0x5d')](_0x2813('0x4c'),_0x2813('0x5e'));}}})[_0x2813('0x5f')](function(_0x370205){logger[_0x2813('0x5d')]('[QUEUE]\x20Error\x20running\x20Zendesk\x20integration',util[_0x2813('0x60')](_0x370205,{'showHidden':!![],'depth':null}));});};exports[_0x2813('0x61')]=function(_0x2b49f3,_0x52580f,_0x1e7528,_0x3d6c6c,_0xc48ac6,_0x5bd419,_0x3c3d21){var _0x328f79,_0xe773ef;_0x5bd419[_0x2813('0x1c')]=intUtil['stripTrailingSlash'](_0x5bd419['remoteUri']);_0x5bd419[_0x2813('0x49')]=intUtil[_0x2813('0x4a')](_0x5bd419['serverUrl']);if(_0x3c3d21&&_0x3c3d21['recordingFormat']&&_0x3c3d21[_0x2813('0x62')]!==_0x2813('0x63')){logger[_0x2813('0xd')](_0x2813('0x64'),'Recording\x20is\x20enabled!');_0x52580f[_0x2813('0x4f')]=util[_0x2813('0xf')](_0x2813('0x65'),_0x5bd419['serverUrl'],_0x52580f[_0x2813('0x4e')],md5(_0x52580f[_0x2813('0x4e')]));}headers[_0x2813('0x50')]=getAuth(_0x5bd419);return getUser(_0x5bd419,_0x3d6c6c['email'])[_0x2813('0x17')](function(_0x3a0340){_0x328f79=_0x3a0340;logger['info'](_0x2813('0x66'),_0x328f79['id']);return getEndUser(_0x5bd419,_0x52580f[_0x2813('0x67')],_0x52580f[_0x2813('0x68')]);})[_0x2813('0x17')](function(_0x6cf284){_0xe773ef=_0x6cf284;logger['info']('The\x20Enduser\x20ID\x20is:',_0xe773ef['id']);return getTicket(_0x5bd419,_0x328f79,_0xe773ef,_0x1e7528,_0x52580f);})[_0x2813('0x17')](function(_0x1eea68){if(_0x1eea68){logger['info'](_0x2813('0x54'),_0x1eea68['id']);switch(_0x5bd419[_0x2813('0x41')]){case _0x2813('0x55'):logger[_0x2813('0xd')]('[OUTBOUND]','Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0x2813('0xf')](_0x2813('0x57'),_0x5bd419[_0x2813('0x1c')],_0x328f79['id'],_0x1eea68['id']),'method':_0x2813('0x10')});case _0x2813('0x58'):logger[_0x2813('0xd')](_0x2813('0x64'),_0x2813('0x69'));emit(util[_0x2813('0xf')](_0x2813('0x59'),_0x3d6c6c[_0x2813('0x13')]),_0x2813('0x5a'),{'uri':util[_0x2813('0xf')](_0x2813('0x6a'),_0x5bd419[_0x2813('0x1c')][_0x2813('0x5b')]('/api/v2',''),_0x1eea68['id'])});break;default:logger[_0x2813('0x5d')](_0x2813('0x64'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0x2813('0x5f')](function(_0x4b4e4d){logger['error'](_0x2813('0x6b'),util[_0x2813('0x60')](_0x4b4e4d,{'showHidden':!![],'depth':null}));});};exports[_0x2813('0x6c')]=function(_0x48d92a,_0x559542,_0x1313c5,_0x1b75ad,_0x16c6fd,_0x403f96){var _0xb433c1,_0x37b90e;_0x403f96[_0x2813('0x1c')]=intUtil[_0x2813('0x4a')](_0x403f96[_0x2813('0x1c')]);_0x403f96[_0x2813('0x49')]=intUtil[_0x2813('0x4a')](_0x403f96[_0x2813('0x49')]);if(_0x16c6fd&&_0x16c6fd['monitor_format']){logger[_0x2813('0xd')]('['+_0x559542['lastevent']['toUpperCase']()+']',_0x2813('0x4d'));_0x559542[_0x2813('0x4f')]=util['format'](_0x2813('0x65'),_0x403f96['serverUrl'],_0x559542[_0x2813('0x4e')],md5(_0x559542['uniqueid']));}else{_0x559542['recordingURL']='';}headers['Authorization']=getAuth(_0x403f96);return getUser(_0x403f96)[_0x2813('0x17')](function(_0x398355){_0xb433c1=_0x398355;logger[_0x2813('0xd')]('The\x20User\x20ID\x20is:',_0xb433c1['id']);return getEndUser(_0x403f96,_0x559542[_0x2813('0x6d')],_0x559542[_0x2813('0x52')]);})[_0x2813('0x17')](function(_0x38651d){_0x37b90e=_0x38651d;logger[_0x2813('0xd')](_0x2813('0x53'),_0x37b90e['id']);return getTicket(_0x403f96,_0xb433c1,_0x37b90e,_0x1313c5,_0x559542);})[_0x2813('0x17')](function(_0x177f5d){if(_0x177f5d){logger[_0x2813('0xd')](_0x2813('0x54'),_0x177f5d['id']);}})['catch'](function(_0x2c9ff1){logger[_0x2813('0x5d')]('['+_0x559542['lastevent'][_0x2813('0x6e')]()+']'+_0x2813('0x6f'),util['inspect'](_0x2c9ff1,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
index 2c3466b..fa05c97 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x18e6=['[QUEUE]','recordingURL','uniqueid','com','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','none','[OUTBOUND]','Recording\x20is\x20enabled!','/api/voice/recordings/','/downloads?type=uniqueid&token=','zoho.eu','destcalleridname','destcalleridnum','Outbound','The\x20Call\x20ID\x20is:','unmanaged','monitor_format','toUpperCase','lodash','md5','util','./util','moment','ioredis','../../../../config/logger','zoho','redis','socket.io-emitter','emit','[HTTP]','stringify','forEach','includes','string','picklist','type','idField','content','toString','variable','variableName','customVariable','Variable','name','toLowerCase','indexOf','split','isNil','expires_in','zone','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','/oauth/v2/token','clientId','clientSecret','refresh_token','access_token','add','seconds','catch','error','Failing\x20creating\x20the\x20access_token','stack','ActiveUsers','Zoho-oauthtoken\x20','then','isArrayLikeObject','users','findIndex','info','Agent\x20found!','Using\x20the\x20admin\x20account!','profile','user','Administrator','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','POST','https://www.zohoapis.','/crm/v2/','startCase','role','first_name','last_name','data','code','SUCCESS','details','enduserType','moduleCreate','Error:\x20','log','CREATE\x20ERROR','GET','moduleSearch','contact_lead','Contacts','uri','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','/crm/v2/Contacts/search?criteria=((Phone:equals:','lead','Owner','administrator','getString','Subjects','Description','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','What_Id','$se_module','talktime','format','mm:ss','answertime','endtime','Call_Duration','utc','YYYY-MM-DDTHH:mm:ss','starttime','lastevent','called','complete','connect','Call_Result','rejected','abandoned','Timeout','Call_Start_Time','outbound','agentcalledAt','Call_Type','Inbound','Fields','/crm/v2/Calls','Call\x20created!','err','host','stripTrailingSlash','serverUrl'];(function(_0x36de10,_0xfe25e8){var _0x58100f=function(_0x1fee3f){while(--_0x1fee3f){_0x36de10['push'](_0x36de10['shift']());}};_0x58100f(++_0xfe25e8);}(_0x18e6,0x14c));var _0x618e=function(_0x4fe7ee,_0x5c3588){_0x4fe7ee=_0x4fe7ee-0x0;var _0x4e1200=_0x18e6[_0x4fe7ee];return _0x4e1200;};'use strict';var _=require(_0x618e('0x0'));var rp=require('request-promise');var md5=require(_0x618e('0x1'));var util=require(_0x618e('0x2'));var intUtil=require(_0x618e('0x3'));var moment=require(_0x618e('0x4'));var Redis=require(_0x618e('0x5'));var BPromise=require('bluebird');var config=require('../../../../config/environment');var logger=require(_0x618e('0x6'))(_0x618e('0x7'));config[_0x618e('0x8')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x618e('0x9'))(new Redis(config[_0x618e('0x8')]));function emit(_0x504062,_0x51885c,_0x2853c0){io['to'](_0x504062)[_0x618e('0xa')](_0x51885c,_0x2853c0);}function request(_0x1f909f){logger['debug'](_0x618e('0xb'),JSON[_0x618e('0xc')](_0x1f909f));return rp(_0x1f909f);}function getCustomFields(_0x5dfdba,_0x145d66){var _0x525519={};if(_0x5dfdba['length']>0x0){_[_0x618e('0xd')](_0x5dfdba,function(_0x460482){if(_[_0x618e('0xe')]([_0x618e('0xf'),_0x618e('0x10')],_0x460482[_0x618e('0x11')])&&_0x460482[_0x618e('0x12')]){_0x525519[_0x460482[_0x618e('0x12')]]=_0x460482[_0x618e('0x13')][_0x618e('0x14')]();}else if(_0x460482['type']===_0x618e('0x15')&&_0x460482[_0x618e('0x16')]&&_0x460482['idField']&&_0x145d66[_0x460482[_0x618e('0x16')]]){_0x525519[_0x460482['idField']]=_0x145d66[_0x460482[_0x618e('0x16')]]['toString']();}else if(_0x460482[_0x618e('0x11')]===_0x618e('0x17')&&_0x460482[_0x618e('0x18')]&&_0x460482[_0x618e('0x18')][_0x618e('0x19')]&&_0x460482['idField']&&_0x145d66[_0x460482['Variable'][_0x618e('0x19')]['toLowerCase']()]){_0x525519[_0x460482[_0x618e('0x12')]]=_0x145d66[_0x460482[_0x618e('0x18')][_0x618e('0x19')][_0x618e('0x1a')]()][_0x618e('0x14')]();}});}return _0x525519;}function getName(_0xa7e884){if(_0xa7e884[_0x618e('0x1b')]('\x20')>0x0){var _0x2ca721=_0xa7e884[_0x618e('0x1c')](/ (.+)/);if(_0x2ca721[0x1]){return _0x2ca721;}}return[_0xa7e884,_0xa7e884];}var accountsTokens={};function getAccessToken(_0x51572f){return new Promise(function(_0x3c4974,_0x4e1bb4){if(!_[_0x618e('0x1d')](accountsTokens[_0x51572f['id']])&&!_['isNil'](accountsTokens[_0x51572f['id']]['access_token'])){if(moment()['isBefore'](accountsTokens[_0x51572f['id']][_0x618e('0x1e')])){_0x3c4974(accountsTokens[_0x51572f['id']]['access_token']);}}var _0x44ee72;switch(_0x51572f[_0x618e('0x1f')]){case'US':_0x44ee72='https://accounts.zoho.com';break;case'AU':_0x44ee72='https://accounts.zoho.com.au';break;case'EU':_0x44ee72=_0x618e('0x20');break;case'IN':_0x44ee72=_0x618e('0x21');break;case'CN':_0x44ee72=_0x618e('0x22');break;default:_0x44ee72='https://accounts.zoho.eu';break;}var _0x1ed95c={'method':'POST','uri':_0x44ee72+_0x618e('0x23'),'qs':{'refresh_token':_0x51572f['refreshToken'],'client_id':_0x51572f[_0x618e('0x24')],'client_secret':_0x51572f[_0x618e('0x25')],'grant_type':_0x618e('0x26')},'json':!![]};return rp(_0x1ed95c)['then'](function(_0x484ccd){accountsTokens[_0x51572f['id']]={'access_token':_0x484ccd[_0x618e('0x27')],'expires_in':moment()[_0x618e('0x28')](_0x484ccd['expires_in'],_0x618e('0x29'))};_0x3c4974(_0x484ccd[_0x618e('0x27')]);})[_0x618e('0x2a')](function(_0x5671b6){logger[_0x618e('0x2b')](_0x618e('0x2c'),_0x5671b6[_0x618e('0x2d')]);_0x4e1bb4(_0x5671b6);});});}function getUser(_0x2ecaca,_0x2719b3,_0x4dbd77,_0x3bcabe){logger['info']('Search\x20user');return request({'method':'GET','uri':util['format']('https://www.zohoapis.%s/crm/v2/users',_0x2719b3),'qs':{'type':_0x618e('0x2e')},'headers':{'Authorization':_0x618e('0x2f')+_0x2ecaca},'json':!![]})[_0x618e('0x30')](function(_0xe18e26){if(_0xe18e26['users']){var _0x15887d=-0x1;if(_[_0x618e('0x31')](_0xe18e26[_0x618e('0x32')])){if(!_[_0x618e('0x1d')](_0x3bcabe)){_0x15887d=_[_0x618e('0x33')](_0xe18e26[_0x618e('0x32')],function(_0x1c53f5){return _0x1c53f5['email']===_0x3bcabe;});}if(_0x15887d>=0x0){logger[_0x618e('0x34')](_0x618e('0x35'));}else{logger[_0x618e('0x34')](_0x618e('0x36'));_0x15887d=_[_0x618e('0x33')](_0xe18e26[_0x618e('0x32')],function(_0x2260e3){return _0x2260e3[_0x618e('0x37')]['name']==='Administrator';});}return _0xe18e26[_0x618e('0x32')][_0x15887d];}else{if(_0xe18e26[_0x618e('0x38')]['profile'][_0x618e('0x19')]===_0x618e('0x39')){logger[_0x618e('0x34')](_0x618e('0x36'));user=_0xe18e26['user'];return user;}else{logger[_0x618e('0x2b')](_0x618e('0x3a'),JSON[_0x618e('0xc')](_0xe18e26));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0x618e('0xc')](_0xe18e26));}}}else{logger[_0x618e('0x2b')](_0x618e('0x3a'),JSON[_0x618e('0xc')](_0xe18e26));throw new Error(_0x618e('0x3b')+JSON[_0x618e('0xc')](_0xe18e26));}})[_0x618e('0x2a')](function(_0x3b155c){console[_0x618e('0x2b')](_0x3b155c);});}function getZohoUser(_0x4feca3,_0x11d3c3){return new BPromise(function(_0x11343c,_0x117f50){request(_0x4feca3)[_0x618e('0x30')](function(_0x19dab6){var _0x566f27=null;if(_0x19dab6){_0x566f27=_0x19dab6['data'][0x0];_0x566f27['enduserType']=_0x11d3c3;}_0x11343c(_0x566f27);})['catch'](function(_0x19a849){_0x117f50(_0x19a849);});});}function createEndUser(_0x393ee2,_0x56975f,_0x14645b,_0x16a367,_0x980007,_0xf16e44){var _0x14645b=getName(_0x14645b);return request({'method':_0x618e('0x3c'),'uri':_0x618e('0x3d')+_0x56975f+_0x618e('0x3e')+_[_0x618e('0x3f')](_0xf16e44['moduleCreate'])+'s','body':{'data':[{'Last_Name':_0x14645b[0x1],'First_Name':_0x14645b[0x0],'Phone':_0x16a367,'Owner':{'name':!_[_0x618e('0x1d')](_0x980007[_0x618e('0x40')][_0x618e('0x19')])?_0x980007['role'][_0x618e('0x19')]:!_[_0x618e('0x1d')](_0x980007[_0x618e('0x41')])?_0x980007[_0x618e('0x41')]+'\x20'+_0x980007[_0x618e('0x42')]:_0x980007['last_name'],'id':_0x980007['id']}}]},'headers':{'Authorization':_0x618e('0x2f')+_0x393ee2},'json':!![]})[_0x618e('0x30')](function(_0x4936f7){if(_0x4936f7&&_0x4936f7[_0x618e('0x43')][0x0][_0x618e('0x44')]===_0x618e('0x45')){var _0x32b829=_0x4936f7[_0x618e('0x43')][0x0][_0x618e('0x46')];_0x32b829[_0x618e('0x47')]=_[_0x618e('0x3f')](_0xf16e44[_0x618e('0x48')])+'s';return _0x32b829;}logger['error'](_0x618e('0x3a'),JSON[_0x618e('0xc')](data));throw new Error(_0x618e('0x49')+JSON[_0x618e('0xc')](data));})[_0x618e('0x2a')](function(_0x4c52b2){console[_0x618e('0x4a')](_0x618e('0x4b'),_0x4c52b2);});}function getEndUser(_0x25ea8c,_0x1807b3,_0x5a1287,_0x2bdca8,_0x3bd3e6,_0x2792fe,_0x410b0f){var _0x5ebc48={'method':_0x618e('0x4c'),'uri':'','headers':{'Authorization':_0x618e('0x2f')+_0x25ea8c},'json':!![]};switch(_0x410b0f[_0x618e('0x4d')]){case _0x618e('0x4e'):_0x5ebc48['uri']=_0x618e('0x3d')+_0x1807b3+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x3bd3e6+'))';return getZohoUser(_0x5ebc48,_0x618e('0x4f'))[_0x618e('0x30')](function(_0x3d039c){if(_0x3d039c)return _0x3d039c;_0x5ebc48[_0x618e('0x50')]='https://www.zohoapis.'+_0x1807b3+_0x618e('0x51')+_0x3bd3e6+'))';return getZohoUser(_0x5ebc48,_0x618e('0x52'))[_0x618e('0x30')](function(_0x440792){if(_0x440792)return _0x440792;if(_0x410b0f[_0x618e('0x48')]!=_0x618e('0x53')){return createEndUser(_0x25ea8c,_0x1807b3,_0x2bdca8,_0x3bd3e6,_0x2792fe,_0x410b0f);}else{return{};}});});break;case'contact':_0x5ebc48[_0x618e('0x50')]=_0x618e('0x3d')+_0x1807b3+_0x618e('0x54')+_0x3bd3e6+'))';return getZohoUser(_0x5ebc48,'Contacts')[_0x618e('0x30')](function(_0xf7dfde){if(_0xf7dfde)return _0xf7dfde;if(_0x410b0f['moduleCreate']!='nothing'){return createEndUser(_0x25ea8c,_0x1807b3,_0x2bdca8,_0x3bd3e6,_0x2792fe,_0x410b0f);}else{return{};}});break;case _0x618e('0x55'):_0x5ebc48['uri']=_0x618e('0x3d')+_0x1807b3+_0x618e('0x51')+_0x3bd3e6+'))';return getZohoUser(_0x5ebc48,'Leads')[_0x618e('0x30')](function(_0x278a4c){if(_0x278a4c)return _0x278a4c;if(_0x410b0f[_0x618e('0x48')]!=_0x618e('0x53')){return createEndUser(_0x25ea8c,_0x1807b3,_0x2bdca8,_0x3bd3e6,_0x2792fe,_0x410b0f);}else{return{};}});break;}}function getCall(_0xb461,_0x2436c7,_0x36d7e7,_0x5e89f6,_0x359bd5,_0x6f3891,_0x40771a,_0x23f49e){logger['info']('Creating\x20new\x20call...');var _0x4a0338={};_0x4a0338[_0x618e('0x56')]={'name':!_[_0x618e('0x1d')](_0x5e89f6[_0x618e('0x40')]['name'])&&!_[_0x618e('0x1d')](_0x5e89f6[_0x618e('0x37')][_0x618e('0x19')])&&_0x5e89f6[_0x618e('0x37')][_0x618e('0x19')]===_0x618e('0x57')?_0x5e89f6[_0x618e('0x40')][_0x618e('0x19')]:!_['isNil'](_0x5e89f6[_0x618e('0x41')])?_0x5e89f6[_0x618e('0x41')]+'\x20'+_0x5e89f6[_0x618e('0x42')]:_0x5e89f6[_0x618e('0x42')],'id':_0x5e89f6['id']};_0x4a0338['Subject']=intUtil[_0x618e('0x58')](_0x6f3891[_0x618e('0x59')],_0x40771a,'\x20');_0x4a0338[_0x618e('0x5a')]=intUtil[_0x618e('0x58')](_0x6f3891[_0x618e('0x5b')],_0x40771a,'\x0a');if(_0x359bd5['enduserType']===_0x618e('0x4f')){_0x4a0338[_0x618e('0x5c')]={'name':!_['isNil'](_0x359bd5['Full_Name'])?_0x359bd5[_0x618e('0x5d')]:!_[_0x618e('0x1d')](_0x359bd5[_0x618e('0x5e')])?_0x359bd5[_0x618e('0x5e')]+'\x20'+_0x359bd5[_0x618e('0x5f')]:_0x359bd5[_0x618e('0x5f')],'id':_0x359bd5['id']};}if(_0x359bd5[_0x618e('0x47')]==='Leads'){_0x4a0338[_0x618e('0x60')]={'name':!_[_0x618e('0x1d')](_0x359bd5[_0x618e('0x5d')])?_0x359bd5['Full_Name']:!_['isNil'](_0x359bd5[_0x618e('0x5e')])?_0x359bd5[_0x618e('0x5e')]+'\x20'+_0x359bd5['Last_Name']:_0x359bd5['Last_Name'],'id':_0x359bd5['id']};_0x4a0338[_0x618e('0x61')]=_[_0x618e('0x3f')](_0x359bd5[_0x618e('0x47')]);}if(_0x40771a['talktime']){_0x4a0338['Call_Duration']=moment['utc'](parseInt(_0x40771a[_0x618e('0x62')])*0x3e8)[_0x618e('0x63')](_0x618e('0x64'));}else if(_0x40771a[_0x618e('0x65')]&&_0x40771a[_0x618e('0x66')]){_0x4a0338[_0x618e('0x67')]=moment[_0x618e('0x68')](moment(_0x40771a['endtime'],_0x618e('0x69'))['diff'](moment(_0x40771a[_0x618e('0x6a')],_0x618e('0x69'))))['format'](_0x618e('0x64'));}switch(_0x40771a[_0x618e('0x6b')]){case _0x618e('0x6c'):_0x4a0338['Call_Result']='Called';break;case _0x618e('0x6d'):case _0x618e('0x6e'):_0x4a0338[_0x618e('0x6f')]='Answered';break;case _0x618e('0x70'):_0x4a0338['Call_Result']='Rejected';break;case _0x618e('0x71'):_0x4a0338[_0x618e('0x6f')]='Abandoned';break;case'timeout':_0x4a0338[_0x618e('0x6f')]=_0x618e('0x72');default:}_0x4a0338[_0x618e('0x73')]=(_0x23f49e===_0x618e('0x74')?moment(_0x40771a['starttime'])['format']('YYYY-MM-DDTHH:mm:ss'):moment(_0x40771a[_0x618e('0x75')])[_0x618e('0x63')](_0x618e('0x69')))||moment()['format'](_0x618e('0x69'));_0x4a0338[_0x618e('0x76')]=_0x23f49e||_0x618e('0x77');_0x4a0338=_['merge'](_0x4a0338,getCustomFields(_0x6f3891[_0x618e('0x78')],_0x40771a));return request({'method':_0x618e('0x3c'),'uri':_0x618e('0x3d')+_0x2436c7+_0x618e('0x79'),'headers':{'Authorization':_0x618e('0x2f')+_0xb461},'body':{'data':[_0x4a0338]},'json':!![]})['then'](function(_0x349ba1){if(_0x349ba1&&_0x349ba1[_0x618e('0x43')][0x0][_0x618e('0x44')]==='SUCCESS'){logger[_0x618e('0x34')](_0x618e('0x7a'));return{'id':_0x349ba1[_0x618e('0x43')][0x0][_0x618e('0x46')]['id']};}})[_0x618e('0x2a')](function(_0x5d203a){logger[_0x618e('0x34')](_0x618e('0x7b'),_0x5d203a[_0x618e('0x2d')]);console[_0x618e('0x4a')](_0x618e('0x7b'),_0x5d203a);});}exports['queue']=function(_0x137309,_0x4c9888,_0x58933a,_0x4fa421,_0x26429b,_0x4d88b6){var _0x771290,_0x4d9b3b,_0x486a34;_0x4d88b6[_0x618e('0x7c')]=intUtil[_0x618e('0x7d')](_0x4d88b6[_0x618e('0x7c')]);_0x4d88b6[_0x618e('0x7e')]=intUtil[_0x618e('0x7d')](_0x4d88b6[_0x618e('0x7e')]);if(_0x26429b&&_0x26429b['monitor_format']){logger[_0x618e('0x34')](_0x618e('0x7f'),'Recording\x20is\x20enabled!');_0x4c9888[_0x618e('0x80')]=_0x4d88b6[_0x618e('0x7e')]+'/api/voice/recordings/'+_0x4c9888['uniqueid']+'/downloads?type=uniqueid&token='+md5(_0x4c9888[_0x618e('0x81')]);}else{_0x4c9888['recordingURL']='';}var _0x37bcb7=_0x4d88b6['host']==='zoho.eu'?'eu':_0x618e('0x82');return getAccessToken(_0x4d88b6)['then'](function(_0x40d749){_0x486a34=_0x40d749;return getUser(_0x486a34,_0x37bcb7,_0x4d88b6,_0x4fa421[_0x618e('0x83')]);})[_0x618e('0x30')](function(_0x412799){_0x771290=_0x412799;logger[_0x618e('0x34')](_0x618e('0x84'),_0x771290['id']);return getEndUser(_0x486a34,_0x37bcb7,_0x4d88b6,_0x4c9888[_0x618e('0x85')],_0x4c9888[_0x618e('0x86')],_0x771290,_0x58933a);})[_0x618e('0x30')](function(_0x3301cb){_0x4d9b3b=_0x3301cb;return getCall(_0x486a34,_0x37bcb7,_0x4d88b6,_0x771290,_0x4d9b3b,_0x58933a,_0x4c9888,_0x618e('0x77'));})[_0x618e('0x30')](function(_0x19e15c){if(_0x19e15c){logger[_0x618e('0x34')]('The\x20Call\x20ID\x20is:',_0x19e15c['id']);logger[_0x618e('0x34')](_0x618e('0x7f'),_0x618e('0x87'));emit(util[_0x618e('0x63')](_0x618e('0x88'),_0x4fa421['name']),_0x618e('0x89'),{'uri':_0x618e('0x8a')+_0x4d88b6[_0x618e('0x7c')]+_0x618e('0x8b')+_0x19e15c['id']});}})['catch'](function(_0x4e084c){logger[_0x618e('0x2b')]('[QUEUE]',JSON[_0x618e('0xc')](_0x4e084c));});};exports[_0x618e('0x74')]=function(_0x3b5b40,_0x2e83a3,_0x5c3612,_0x54605b,_0x35bc63,_0x24ab28,_0x3a7901){var _0x382331,_0x5a7cb4,_0x2340ae;_0x24ab28[_0x618e('0x7c')]=intUtil[_0x618e('0x7d')](_0x24ab28[_0x618e('0x7c')]);_0x24ab28[_0x618e('0x7e')]=intUtil[_0x618e('0x7d')](_0x24ab28[_0x618e('0x7e')]);if(_0x3a7901&&_0x3a7901['recordingFormat']&&_0x3a7901['recordingFormat']!==_0x618e('0x8c')){logger['info'](_0x618e('0x8d'),_0x618e('0x8e'));_0x2e83a3[_0x618e('0x80')]=_0x24ab28[_0x618e('0x7e')]+_0x618e('0x8f')+_0x2e83a3['uniqueid']+_0x618e('0x90')+md5(_0x2e83a3[_0x618e('0x81')]);}var _0x4b6aa7=_0x24ab28[_0x618e('0x7c')]===_0x618e('0x91')?'eu':'com';return getAccessToken(_0x24ab28)[_0x618e('0x30')](function(_0x3cad05){_0x2340ae=_0x3cad05;return getUser(_0x2340ae,_0x4b6aa7,_0x24ab28,_0x54605b[_0x618e('0x83')]);})[_0x618e('0x30')](function(_0x11442e){_0x382331=_0x11442e;logger[_0x618e('0x34')](_0x618e('0x84'),_0x382331['id']);return getEndUser(_0x2340ae,_0x4b6aa7,_0x24ab28,_0x2e83a3[_0x618e('0x92')],_0x2e83a3[_0x618e('0x93')],_0x382331,_0x5c3612);})[_0x618e('0x30')](function(_0x22a1d0){_0x5a7cb4=_0x22a1d0;return getCall(_0x2340ae,_0x4b6aa7,_0x24ab28,_0x382331,_0x5a7cb4,_0x5c3612,_0x2e83a3,_0x618e('0x94'));})[_0x618e('0x30')](function(_0x1e1f56){if(_0x1e1f56){logger['info'](_0x618e('0x95'),_0x1e1f56['id']);logger[_0x618e('0x34')](_0x618e('0x8d'),_0x618e('0x87'));emit(util[_0x618e('0x63')](_0x618e('0x88'),_0x54605b['name']),_0x618e('0x89'),{'uri':_0x618e('0x8a')+_0x24ab28[_0x618e('0x7c')]+'/crm/EntityInfo.do?module=Calls&id='+_0x1e1f56['id']});}})['catch'](function(_0xc98da7){logger[_0x618e('0x2b')]('[OUTBOUND]',JSON['stringify'](_0xc98da7));});};exports[_0x618e('0x96')]=function(_0x3e9d97,_0x342778,_0x2acc37,_0x14d3fe,_0xeffbe9,_0x225519){var _0x315c3a,_0x2b3452,_0xcb6376;_0x225519[_0x618e('0x7c')]=intUtil[_0x618e('0x7d')](_0x225519[_0x618e('0x7c')]);_0x225519['serverUrl']=intUtil[_0x618e('0x7d')](_0x225519['serverUrl']);if(_0xeffbe9&&_0xeffbe9[_0x618e('0x97')]){logger[_0x618e('0x34')]('['+_0x342778['lastevent'][_0x618e('0x98')]()+']',_0x618e('0x8e'));_0x342778[_0x618e('0x80')]=_0x225519[_0x618e('0x7e')]+_0x618e('0x8f')+_0x342778[_0x618e('0x81')]+'/downloads?type=uniqueid&token='+md5(_0x342778[_0x618e('0x81')]);}else{_0x342778['recordingURL']='';}var _0x55bf09=_0x225519[_0x618e('0x7c')]===_0x618e('0x91')?'eu':'com';return getAccessToken(_0x225519)['then'](function(_0x5a6011){_0xcb6376=_0x5a6011;return getUser(_0xcb6376,_0x55bf09,_0x225519);})[_0x618e('0x30')](function(_0x4e3654){_0x315c3a=_0x4e3654;logger[_0x618e('0x34')]('The\x20User\x20ID\x20is:',_0x315c3a['id']);return getEndUser(_0xcb6376,_0x55bf09,_0x225519,_0x342778['calleridname'],_0x342778[_0x618e('0x86')],_0x315c3a,_0x2acc37);})[_0x618e('0x30')](function(_0x1b1749){_0x2b3452=_0x1b1749;return getCall(_0xcb6376,_0x55bf09,_0x225519,_0x315c3a,_0x2b3452,_0x2acc37,_0x342778,_0x618e('0x77'));})[_0x618e('0x30')](function(_0x2c4a13){if(_0x2c4a13){logger[_0x618e('0x34')](_0x618e('0x95'),_0x2c4a13['id']);}})['catch'](function(_0x342327){logger['error']('['+_0x342778[_0x618e('0x6b')][_0x618e('0x98')]()+']',JSON[_0x618e('0xc')](_0x342327));});};
\ No newline at end of file
+var _0x476e=['clientSecret','refresh_token','then','add','expires_in','error','Failing\x20creating\x20the\x20access_token','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','users','isArrayLikeObject','findIndex','email','Agent\x20found!','Using\x20the\x20admin\x20account!','profile','Administrator','info','user','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','catch','/crm/v2/','startCase','moduleCreate','role','first_name','last_name','data','code','details','Error:\x20','log','CREATE\x20ERROR','GET','moduleSearch','contact_lead','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','https://www.zohoapis.','/crm/v2/Leads/search?criteria=((Phone:equals:','contact','lead','Leads','nothing','Creating\x20new\x20call...','Owner','getString','Subjects','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','enduserType','What_Id','$se_module','Call_Duration','utc','format','endtime','YYYY-MM-DDTHH:mm:ss','diff','starttime','mm:ss','lastevent','called','Call_Result','Called','complete','connect','Answered','rejected','Rejected','abandoned','agentcalledAt','Call_Type','Inbound','merge','/crm/v2/Calls','SUCCESS','Call\x20created!','queue','stripTrailingSlash','host','monitor_format','recordingURL','serverUrl','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','com','calleridname','calleridnum','The\x20Call\x20ID\x20is:','[QUEUE]','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','zoho.eu','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','Outbound','user:%s','unmanaged','toUpperCase','lodash','request-promise','md5','util','./util','moment','bluebird','../../../../config/environment','../../../../config/logger','zoho','defaults','redis','localhost','socket.io-emitter','emit','debug','stringify','forEach','includes','string','picklist','type','idField','toString','variable','variableName','customVariable','Variable','name','toLowerCase','indexOf','split','isNil','access_token','zone','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','clientId'];(function(_0x3a703a,_0x1e2aff){var _0x206083=function(_0x3562f5){while(--_0x3562f5){_0x3a703a['push'](_0x3a703a['shift']());}};_0x206083(++_0x1e2aff);}(_0x476e,0x73));var _0xe476=function(_0x3924af,_0x2516f0){_0x3924af=_0x3924af-0x0;var _0x77d4e0=_0x476e[_0x3924af];return _0x77d4e0;};'use strict';var _=require(_0xe476('0x0'));var rp=require(_0xe476('0x1'));var md5=require(_0xe476('0x2'));var util=require(_0xe476('0x3'));var intUtil=require(_0xe476('0x4'));var moment=require(_0xe476('0x5'));var Redis=require('ioredis');var BPromise=require(_0xe476('0x6'));var config=require(_0xe476('0x7'));var logger=require(_0xe476('0x8'))(_0xe476('0x9'));config['redis']=_[_0xe476('0xa')](config[_0xe476('0xb')],{'host':_0xe476('0xc'),'port':0x18eb});var io=require(_0xe476('0xd'))(new Redis(config[_0xe476('0xb')]));function emit(_0x2eaa12,_0x573c71,_0x16f519){io['to'](_0x2eaa12)[_0xe476('0xe')](_0x573c71,_0x16f519);}function request(_0x37a603){logger[_0xe476('0xf')]('[HTTP]',JSON[_0xe476('0x10')](_0x37a603));return rp(_0x37a603);}function getCustomFields(_0x9cbe57,_0x47da68){var _0x1172ea={};if(_0x9cbe57['length']>0x0){_[_0xe476('0x11')](_0x9cbe57,function(_0x1fd21e){if(_[_0xe476('0x12')]([_0xe476('0x13'),_0xe476('0x14')],_0x1fd21e[_0xe476('0x15')])&&_0x1fd21e[_0xe476('0x16')]){_0x1172ea[_0x1fd21e[_0xe476('0x16')]]=_0x1fd21e['content'][_0xe476('0x17')]();}else if(_0x1fd21e[_0xe476('0x15')]===_0xe476('0x18')&&_0x1fd21e[_0xe476('0x19')]&&_0x1fd21e[_0xe476('0x16')]&&_0x47da68[_0x1fd21e[_0xe476('0x19')]]){_0x1172ea[_0x1fd21e[_0xe476('0x16')]]=_0x47da68[_0x1fd21e[_0xe476('0x19')]]['toString']();}else if(_0x1fd21e['type']===_0xe476('0x1a')&&_0x1fd21e[_0xe476('0x1b')]&&_0x1fd21e[_0xe476('0x1b')][_0xe476('0x1c')]&&_0x1fd21e[_0xe476('0x16')]&&_0x47da68[_0x1fd21e[_0xe476('0x1b')][_0xe476('0x1c')][_0xe476('0x1d')]()]){_0x1172ea[_0x1fd21e[_0xe476('0x16')]]=_0x47da68[_0x1fd21e[_0xe476('0x1b')][_0xe476('0x1c')][_0xe476('0x1d')]()]['toString']();}});}return _0x1172ea;}function getName(_0x564e19){if(_0x564e19[_0xe476('0x1e')]('\x20')>0x0){var _0x39aa3b=_0x564e19[_0xe476('0x1f')](/ (.+)/);if(_0x39aa3b[0x1]){return _0x39aa3b;}}return[_0x564e19,_0x564e19];}var accountsTokens={};function getAccessToken(_0x5d4d97){return new Promise(function(_0x5ad51b,_0x1e5428){if(!_['isNil'](accountsTokens[_0x5d4d97['id']])&&!_[_0xe476('0x20')](accountsTokens[_0x5d4d97['id']][_0xe476('0x21')])){if(moment()['isBefore'](accountsTokens[_0x5d4d97['id']]['expires_in'])){_0x5ad51b(accountsTokens[_0x5d4d97['id']][_0xe476('0x21')]);}}var _0x1723b1;switch(_0x5d4d97[_0xe476('0x22')]){case'US':_0x1723b1='https://accounts.zoho.com';break;case'AU':_0x1723b1=_0xe476('0x23');break;case'EU':_0x1723b1=_0xe476('0x24');break;case'IN':_0x1723b1=_0xe476('0x25');break;case'CN':_0x1723b1=_0xe476('0x26');break;default:_0x1723b1=_0xe476('0x24');break;}var _0x1df2d8={'method':_0xe476('0x27'),'uri':_0x1723b1+_0xe476('0x28'),'qs':{'refresh_token':_0x5d4d97['refreshToken'],'client_id':_0x5d4d97[_0xe476('0x29')],'client_secret':_0x5d4d97[_0xe476('0x2a')],'grant_type':_0xe476('0x2b')},'json':!![]};return rp(_0x1df2d8)[_0xe476('0x2c')](function(_0x3ce0e0){accountsTokens[_0x5d4d97['id']]={'access_token':_0x3ce0e0[_0xe476('0x21')],'expires_in':moment()[_0xe476('0x2d')](_0x3ce0e0[_0xe476('0x2e')],'seconds')};_0x5ad51b(_0x3ce0e0[_0xe476('0x21')]);})['catch'](function(_0xb229da){logger[_0xe476('0x2f')](_0xe476('0x30'),_0xb229da['stack']);_0x1e5428(_0xb229da);});});}function getUser(_0x4ca365,_0x5a86aa,_0x329de6,_0x2c9c0b){logger['info']('Search\x20user');return request({'method':'GET','uri':util['format'](_0xe476('0x31'),_0x5a86aa),'qs':{'type':_0xe476('0x32')},'headers':{'Authorization':_0xe476('0x33')+_0x4ca365},'json':!![]})[_0xe476('0x2c')](function(_0x538761){if(_0x538761[_0xe476('0x34')]){var _0x4e3224=-0x1;if(_[_0xe476('0x35')](_0x538761[_0xe476('0x34')])){if(!_[_0xe476('0x20')](_0x2c9c0b)){_0x4e3224=_[_0xe476('0x36')](_0x538761['users'],function(_0x1e4c0f){return _0x1e4c0f[_0xe476('0x37')]===_0x2c9c0b;});}if(_0x4e3224>=0x0){logger['info'](_0xe476('0x38'));}else{logger['info'](_0xe476('0x39'));_0x4e3224=_[_0xe476('0x36')](_0x538761[_0xe476('0x34')],function(_0xecde7a){return _0xecde7a[_0xe476('0x3a')][_0xe476('0x1c')]==='Administrator';});}return _0x538761['users'][_0x4e3224];}else{if(_0x538761['user'][_0xe476('0x3a')]['name']===_0xe476('0x3b')){logger[_0xe476('0x3c')]('Using\x20the\x20admin\x20account!');user=_0x538761[_0xe476('0x3d')];return user;}else{logger['error'](_0xe476('0x3e'),JSON[_0xe476('0x10')](_0x538761));throw new Error(_0xe476('0x3f')+JSON['stringify'](_0x538761));}}}else{logger[_0xe476('0x2f')](_0xe476('0x3e'),JSON[_0xe476('0x10')](_0x538761));throw new Error(_0xe476('0x3f')+JSON[_0xe476('0x10')](_0x538761));}})[_0xe476('0x40')](function(_0x93c6c1){console['error'](_0x93c6c1);});}function getZohoUser(_0x247c5d,_0x1a06bb){return new BPromise(function(_0x25bf5a,_0x313cd9){request(_0x247c5d)[_0xe476('0x2c')](function(_0x1df1f4){var _0x4a30c6=null;if(_0x1df1f4){_0x4a30c6=_0x1df1f4['data'][0x0];_0x4a30c6['enduserType']=_0x1a06bb;}_0x25bf5a(_0x4a30c6);})[_0xe476('0x40')](function(_0x49bc9d){_0x313cd9(_0x49bc9d);});});}function createEndUser(_0x4d12c9,_0x570108,_0x37ed8a,_0x552f31,_0x2518e5,_0x37c55e){var _0x37ed8a=getName(_0x37ed8a);return request({'method':_0xe476('0x27'),'uri':'https://www.zohoapis.'+_0x570108+_0xe476('0x41')+_[_0xe476('0x42')](_0x37c55e[_0xe476('0x43')])+'s','body':{'data':[{'Last_Name':_0x37ed8a[0x1],'First_Name':_0x37ed8a[0x0],'Phone':_0x552f31,'Owner':{'name':!_[_0xe476('0x20')](_0x2518e5[_0xe476('0x44')][_0xe476('0x1c')])?_0x2518e5[_0xe476('0x44')][_0xe476('0x1c')]:!_[_0xe476('0x20')](_0x2518e5[_0xe476('0x45')])?_0x2518e5[_0xe476('0x45')]+'\x20'+_0x2518e5[_0xe476('0x46')]:_0x2518e5[_0xe476('0x46')],'id':_0x2518e5['id']}}]},'headers':{'Authorization':_0xe476('0x33')+_0x4d12c9},'json':!![]})['then'](function(_0x3ab1c5){if(_0x3ab1c5&&_0x3ab1c5[_0xe476('0x47')][0x0][_0xe476('0x48')]==='SUCCESS'){var _0x796913=_0x3ab1c5[_0xe476('0x47')][0x0][_0xe476('0x49')];_0x796913['enduserType']=_[_0xe476('0x42')](_0x37c55e['moduleCreate'])+'s';return _0x796913;}logger['error'](_0xe476('0x3e'),JSON[_0xe476('0x10')](data));throw new Error(_0xe476('0x4a')+JSON['stringify'](data));})[_0xe476('0x40')](function(_0x20209f){console[_0xe476('0x4b')](_0xe476('0x4c'),_0x20209f);});}function getEndUser(_0x1edb48,_0x3e8e60,_0x538c0d,_0x5479b6,_0x18d7e7,_0x3221c6,_0x39a7d4){var _0x142404={'method':_0xe476('0x4d'),'uri':'','headers':{'Authorization':_0xe476('0x33')+_0x1edb48},'json':!![]};switch(_0x39a7d4[_0xe476('0x4e')]){case _0xe476('0x4f'):_0x142404[_0xe476('0x50')]='https://www.zohoapis.'+_0x3e8e60+_0xe476('0x51')+_0x18d7e7+'))';return getZohoUser(_0x142404,_0xe476('0x52'))[_0xe476('0x2c')](function(_0x161aed){if(_0x161aed)return _0x161aed;_0x142404['uri']=_0xe476('0x53')+_0x3e8e60+_0xe476('0x54')+_0x18d7e7+'))';return getZohoUser(_0x142404,'Leads')[_0xe476('0x2c')](function(_0x149287){if(_0x149287)return _0x149287;if(_0x39a7d4[_0xe476('0x43')]!='nothing'){return createEndUser(_0x1edb48,_0x3e8e60,_0x5479b6,_0x18d7e7,_0x3221c6,_0x39a7d4);}else{return{};}});});break;case _0xe476('0x55'):_0x142404[_0xe476('0x50')]='https://www.zohoapis.'+_0x3e8e60+_0xe476('0x51')+_0x18d7e7+'))';return getZohoUser(_0x142404,_0xe476('0x52'))['then'](function(_0x3eedc4){if(_0x3eedc4)return _0x3eedc4;if(_0x39a7d4[_0xe476('0x43')]!='nothing'){return createEndUser(_0x1edb48,_0x3e8e60,_0x5479b6,_0x18d7e7,_0x3221c6,_0x39a7d4);}else{return{};}});break;case _0xe476('0x56'):_0x142404[_0xe476('0x50')]=_0xe476('0x53')+_0x3e8e60+_0xe476('0x54')+_0x18d7e7+'))';return getZohoUser(_0x142404,_0xe476('0x57'))[_0xe476('0x2c')](function(_0x330528){if(_0x330528)return _0x330528;if(_0x39a7d4['moduleCreate']!=_0xe476('0x58')){return createEndUser(_0x1edb48,_0x3e8e60,_0x5479b6,_0x18d7e7,_0x3221c6,_0x39a7d4);}else{return{};}});break;}}function getCall(_0x5d8a70,_0xe7b8cb,_0x457737,_0x2d03d8,_0x16d64d,_0x135cab,_0x559e8f,_0x6bd73a){logger[_0xe476('0x3c')](_0xe476('0x59'));var _0x1986b7={};_0x1986b7[_0xe476('0x5a')]={'name':!_[_0xe476('0x20')](_0x2d03d8[_0xe476('0x44')]['name'])&&!_[_0xe476('0x20')](_0x2d03d8[_0xe476('0x3a')][_0xe476('0x1c')])&&_0x2d03d8[_0xe476('0x3a')][_0xe476('0x1c')]==='administrator'?_0x2d03d8[_0xe476('0x44')][_0xe476('0x1c')]:!_[_0xe476('0x20')](_0x2d03d8[_0xe476('0x45')])?_0x2d03d8[_0xe476('0x45')]+'\x20'+_0x2d03d8[_0xe476('0x46')]:_0x2d03d8[_0xe476('0x46')],'id':_0x2d03d8['id']};_0x1986b7['Subject']=intUtil[_0xe476('0x5b')](_0x135cab[_0xe476('0x5c')],_0x559e8f,'\x20');_0x1986b7['Description']=intUtil['getString'](_0x135cab[_0xe476('0x5d')],_0x559e8f,'\x0a');if(_0x16d64d['enduserType']==='Contacts'){_0x1986b7[_0xe476('0x5e')]={'name':!_[_0xe476('0x20')](_0x16d64d['Full_Name'])?_0x16d64d[_0xe476('0x5f')]:!_[_0xe476('0x20')](_0x16d64d[_0xe476('0x60')])?_0x16d64d[_0xe476('0x60')]+'\x20'+_0x16d64d[_0xe476('0x61')]:_0x16d64d['Last_Name'],'id':_0x16d64d['id']};}if(_0x16d64d[_0xe476('0x62')]===_0xe476('0x57')){_0x1986b7[_0xe476('0x63')]={'name':!_['isNil'](_0x16d64d[_0xe476('0x5f')])?_0x16d64d[_0xe476('0x5f')]:!_['isNil'](_0x16d64d[_0xe476('0x60')])?_0x16d64d[_0xe476('0x60')]+'\x20'+_0x16d64d['Last_Name']:_0x16d64d[_0xe476('0x61')],'id':_0x16d64d['id']};_0x1986b7[_0xe476('0x64')]=_[_0xe476('0x42')](_0x16d64d['enduserType']);}if(_0x559e8f['talktime']){_0x1986b7[_0xe476('0x65')]=moment[_0xe476('0x66')](parseInt(_0x559e8f['talktime'])*0x3e8)[_0xe476('0x67')]('mm:ss');}else if(_0x559e8f['answertime']&&_0x559e8f[_0xe476('0x68')]){_0x1986b7['Call_Duration']=moment[_0xe476('0x66')](moment(_0x559e8f[_0xe476('0x68')],_0xe476('0x69'))[_0xe476('0x6a')](moment(_0x559e8f[_0xe476('0x6b')],_0xe476('0x69'))))[_0xe476('0x67')](_0xe476('0x6c'));}switch(_0x559e8f[_0xe476('0x6d')]){case _0xe476('0x6e'):_0x1986b7[_0xe476('0x6f')]=_0xe476('0x70');break;case _0xe476('0x71'):case _0xe476('0x72'):_0x1986b7[_0xe476('0x6f')]=_0xe476('0x73');break;case _0xe476('0x74'):_0x1986b7[_0xe476('0x6f')]=_0xe476('0x75');break;case _0xe476('0x76'):_0x1986b7[_0xe476('0x6f')]='Abandoned';break;case'timeout':_0x1986b7[_0xe476('0x6f')]='Timeout';default:}_0x1986b7['Call_Start_Time']=(_0x6bd73a==='outbound'?moment(_0x559e8f['starttime'])[_0xe476('0x67')](_0xe476('0x69')):moment(_0x559e8f[_0xe476('0x77')])['format'](_0xe476('0x69')))||moment()[_0xe476('0x67')](_0xe476('0x69'));_0x1986b7[_0xe476('0x78')]=_0x6bd73a||_0xe476('0x79');_0x1986b7=_[_0xe476('0x7a')](_0x1986b7,getCustomFields(_0x135cab['Fields'],_0x559e8f));return request({'method':_0xe476('0x27'),'uri':_0xe476('0x53')+_0xe7b8cb+_0xe476('0x7b'),'headers':{'Authorization':_0xe476('0x33')+_0x5d8a70},'body':{'data':[_0x1986b7]},'json':!![]})[_0xe476('0x2c')](function(_0x51c9f1){if(_0x51c9f1&&_0x51c9f1['data'][0x0][_0xe476('0x48')]===_0xe476('0x7c')){logger[_0xe476('0x3c')](_0xe476('0x7d'));return{'id':_0x51c9f1['data'][0x0][_0xe476('0x49')]['id']};}})['catch'](function(_0x2292e0){logger[_0xe476('0x3c')]('err',_0x2292e0['stack']);console[_0xe476('0x4b')]('err',_0x2292e0);});}exports[_0xe476('0x7e')]=function(_0x19b7f2,_0x12c089,_0x1a7cdb,_0x5d4205,_0x2b5918,_0x32ac51){var _0x21f2dd,_0x4dd5e4,_0x391138;_0x32ac51['host']=intUtil[_0xe476('0x7f')](_0x32ac51[_0xe476('0x80')]);_0x32ac51['serverUrl']=intUtil[_0xe476('0x7f')](_0x32ac51['serverUrl']);if(_0x2b5918&&_0x2b5918[_0xe476('0x81')]){logger[_0xe476('0x3c')]('[QUEUE]','Recording\x20is\x20enabled!');_0x12c089[_0xe476('0x82')]=_0x32ac51[_0xe476('0x83')]+_0xe476('0x84')+_0x12c089[_0xe476('0x85')]+_0xe476('0x86')+md5(_0x12c089['uniqueid']);}else{_0x12c089[_0xe476('0x82')]='';}var _0x95dfe9=_0x32ac51[_0xe476('0x80')]==='zoho.eu'?'eu':_0xe476('0x87');return getAccessToken(_0x32ac51)[_0xe476('0x2c')](function(_0x23ad68){_0x391138=_0x23ad68;return getUser(_0x391138,_0x95dfe9,_0x32ac51,_0x5d4205[_0xe476('0x37')]);})[_0xe476('0x2c')](function(_0x3bc492){_0x21f2dd=_0x3bc492;logger[_0xe476('0x3c')]('The\x20User\x20ID\x20is:',_0x21f2dd['id']);return getEndUser(_0x391138,_0x95dfe9,_0x32ac51,_0x12c089[_0xe476('0x88')],_0x12c089[_0xe476('0x89')],_0x21f2dd,_0x1a7cdb);})[_0xe476('0x2c')](function(_0x1c6efb){_0x4dd5e4=_0x1c6efb;return getCall(_0x391138,_0x95dfe9,_0x32ac51,_0x21f2dd,_0x4dd5e4,_0x1a7cdb,_0x12c089,_0xe476('0x79'));})[_0xe476('0x2c')](function(_0x3bac19){if(_0x3bac19){logger[_0xe476('0x3c')](_0xe476('0x8a'),_0x3bac19['id']);logger[_0xe476('0x3c')](_0xe476('0x8b'),_0xe476('0x8c'));emit(util[_0xe476('0x67')]('user:%s',_0x5d4205[_0xe476('0x1c')]),_0xe476('0x8d'),{'uri':_0xe476('0x8e')+_0x32ac51[_0xe476('0x80')]+_0xe476('0x8f')+_0x3bac19['id']});}})[_0xe476('0x40')](function(_0x5a0960){logger[_0xe476('0x2f')](_0xe476('0x8b'),JSON[_0xe476('0x10')](_0x5a0960));});};exports[_0xe476('0x90')]=function(_0x6a31ef,_0x4b5c93,_0x12fa67,_0x331e77,_0x54b78a,_0x12a9b1,_0x53a42a){var _0x5d70cd,_0x1290b8,_0x469b33;_0x12a9b1[_0xe476('0x80')]=intUtil[_0xe476('0x7f')](_0x12a9b1['host']);_0x12a9b1[_0xe476('0x83')]=intUtil[_0xe476('0x7f')](_0x12a9b1['serverUrl']);if(_0x53a42a&&_0x53a42a[_0xe476('0x91')]&&_0x53a42a[_0xe476('0x91')]!==_0xe476('0x92')){logger[_0xe476('0x3c')](_0xe476('0x93'),_0xe476('0x94'));_0x4b5c93[_0xe476('0x82')]=_0x12a9b1[_0xe476('0x83')]+_0xe476('0x84')+_0x4b5c93[_0xe476('0x85')]+'/downloads?type=uniqueid&token='+md5(_0x4b5c93[_0xe476('0x85')]);}var _0x23a662=_0x12a9b1[_0xe476('0x80')]===_0xe476('0x95')?'eu':_0xe476('0x87');return getAccessToken(_0x12a9b1)[_0xe476('0x2c')](function(_0x549140){_0x469b33=_0x549140;return getUser(_0x469b33,_0x23a662,_0x12a9b1,_0x331e77[_0xe476('0x37')]);})[_0xe476('0x2c')](function(_0x49989f){_0x5d70cd=_0x49989f;logger['info'](_0xe476('0x96'),_0x5d70cd['id']);return getEndUser(_0x469b33,_0x23a662,_0x12a9b1,_0x4b5c93[_0xe476('0x97')],_0x4b5c93[_0xe476('0x98')],_0x5d70cd,_0x12fa67);})[_0xe476('0x2c')](function(_0x30f75b){_0x1290b8=_0x30f75b;return getCall(_0x469b33,_0x23a662,_0x12a9b1,_0x5d70cd,_0x1290b8,_0x12fa67,_0x4b5c93,_0xe476('0x99'));})[_0xe476('0x2c')](function(_0x55bc18){if(_0x55bc18){logger[_0xe476('0x3c')]('The\x20Call\x20ID\x20is:',_0x55bc18['id']);logger[_0xe476('0x3c')](_0xe476('0x93'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xe476('0x67')](_0xe476('0x9a'),_0x331e77[_0xe476('0x1c')]),_0xe476('0x8d'),{'uri':_0xe476('0x8e')+_0x12a9b1[_0xe476('0x80')]+_0xe476('0x8f')+_0x55bc18['id']});}})[_0xe476('0x40')](function(_0x4c15bd){logger[_0xe476('0x2f')](_0xe476('0x93'),JSON['stringify'](_0x4c15bd));});};exports[_0xe476('0x9b')]=function(_0x4384ef,_0x506264,_0x422283,_0x2903c3,_0x143842,_0x227480){var _0x16e32d,_0x3bbea9,_0x3ed69e;_0x227480[_0xe476('0x80')]=intUtil[_0xe476('0x7f')](_0x227480[_0xe476('0x80')]);_0x227480[_0xe476('0x83')]=intUtil[_0xe476('0x7f')](_0x227480[_0xe476('0x83')]);if(_0x143842&&_0x143842['monitor_format']){logger[_0xe476('0x3c')]('['+_0x506264['lastevent'][_0xe476('0x9c')]()+']',_0xe476('0x94'));_0x506264[_0xe476('0x82')]=_0x227480[_0xe476('0x83')]+_0xe476('0x84')+_0x506264['uniqueid']+_0xe476('0x86')+md5(_0x506264[_0xe476('0x85')]);}else{_0x506264['recordingURL']='';}var _0x768e59=_0x227480[_0xe476('0x80')]===_0xe476('0x95')?'eu':_0xe476('0x87');return getAccessToken(_0x227480)['then'](function(_0xea349f){_0x3ed69e=_0xea349f;return getUser(_0x3ed69e,_0x768e59,_0x227480);})[_0xe476('0x2c')](function(_0x154a91){_0x16e32d=_0x154a91;logger[_0xe476('0x3c')](_0xe476('0x96'),_0x16e32d['id']);return getEndUser(_0x3ed69e,_0x768e59,_0x227480,_0x506264[_0xe476('0x88')],_0x506264[_0xe476('0x89')],_0x16e32d,_0x422283);})[_0xe476('0x2c')](function(_0x3ea84){_0x3bbea9=_0x3ea84;return getCall(_0x3ed69e,_0x768e59,_0x227480,_0x16e32d,_0x3bbea9,_0x422283,_0x506264,_0xe476('0x79'));})[_0xe476('0x2c')](function(_0x3d36c3){if(_0x3d36c3){logger[_0xe476('0x3c')]('The\x20Call\x20ID\x20is:',_0x3d36c3['id']);}})[_0xe476('0x40')](function(_0x55daec){logger[_0xe476('0x2f')]('['+_0x506264[_0xe476('0x6d')][_0xe476('0x9c')]()+']',JSON[_0xe476('0x10')](_0x55daec));});};
\ No newline at end of file
index fddfad2..92bbaa9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbf49=['data3','render','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','mustache','../../../../config/logger','trigger','data2'];(function(_0x4eec6d,_0x57e8ff){var _0x29116b=function(_0xf1927a){while(--_0xf1927a){_0x4eec6d['push'](_0x4eec6d['shift']());}};_0x29116b(++_0x57e8ff);}(_0xbf49,0x195));var _0x9bf4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbf49[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0x9bf4('0x0'));var sh=require('shelljs');var Mustache=require(_0x9bf4('0x1'));var logger=require(_0x9bf4('0x2'))(_0x9bf4('0x3'));exports['exec']=function(_0x587af0,_0x234650){var _0x3a16cd=_0x587af0[_0x9bf4('0x4')]?_0x587af0[_0x9bf4('0x4')]:'Script';var _0x5b58b0=_0x587af0[_0x9bf4('0x5')]?Mustache[_0x9bf4('0x6')](_0x587af0['data3'],_0x234650):_0x234650;sh['exec'](_0x5b58b0,function(_0x21e70b,_0x1d2be9,_0x165831){if(_0x21e70b!==0x0){logger['error'](util[_0x9bf4('0x7')](_0x9bf4('0x8'),_0x3a16cd,_0x5b58b0,_0x21e70b,_0x165831));}else{logger['info'](util[_0x9bf4('0x7')](_0x9bf4('0x9'),_0x3a16cd,_0x5b58b0,_0x1d2be9));}});};
\ No newline at end of file
+var _0xa0e5=['shelljs','exec','data2','Script','data3','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','format','util'];(function(_0x263a2f,_0x1e81e3){var _0x8020e8=function(_0x39f91a){while(--_0x39f91a){_0x263a2f['push'](_0x263a2f['shift']());}};_0x8020e8(++_0x1e81e3);}(_0xa0e5,0x86));var _0x5a0e=function(_0x211821,_0x274635){_0x211821=_0x211821-0x0;var _0x23f587=_0xa0e5[_0x211821];return _0x23f587;};'use strict';var util=require(_0x5a0e('0x0'));var sh=require(_0x5a0e('0x1'));var Mustache=require('mustache');var logger=require('../../../../config/logger')('trigger');exports[_0x5a0e('0x2')]=function(_0x2d3f3e,_0x39d042){var _0x399c49=_0x2d3f3e[_0x5a0e('0x3')]?_0x2d3f3e['data2']:_0x5a0e('0x4');var _0x3145c2=_0x2d3f3e[_0x5a0e('0x5')]?Mustache['render'](_0x2d3f3e[_0x5a0e('0x5')],_0x39d042):_0x39d042;sh['exec'](_0x3145c2,function(_0x50452d,_0x315d5d,_0x42c0e5){if(_0x50452d!==0x0){logger['error'](util['format'](_0x5a0e('0x6'),_0x399c49,_0x3145c2,_0x50452d,_0x42c0e5));}else{logger[_0x5a0e('0x7')](util[_0x5a0e('0x8')]('%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s',_0x399c49,_0x3145c2,_0x315d5d));}});};
\ No newline at end of file
index 5a03c54..59fc090 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd554=['trigger','data1','toUpperCase','render','data2','data5','number','headers','data6','parse','error','stack','GET','DELETE','POST','PUT','data7','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','body','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','then',',\x20request\x20body:\x20','object','info','format','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','message','util','lodash','../../../../config/logger'];(function(_0x55ac1c,_0x1e927e){var _0xedbfa=function(_0x40dc54){while(--_0x40dc54){_0x55ac1c['push'](_0x55ac1c['shift']());}};_0xedbfa(++_0x1e927e);}(_0xd554,0x1a1));var _0x4d55=function(_0x2377ac,_0x2a2c1c){_0x2377ac=_0x2377ac-0x0;var _0x51082b=_0xd554[_0x2377ac];return _0x51082b;};'use strict';var rp=require('request-promise');var util=require(_0x4d55('0x0'));var _=require(_0x4d55('0x1'));var Mustache=require('mustache');var logger=require(_0x4d55('0x2'))(_0x4d55('0x3'));exports['exec']=function(_0x4026eb,_0x540f23){var _0x35970e,_0x214471;var _0x573d21={'method':_0x4026eb[_0x4d55('0x4')][_0x4d55('0x5')](),'uri':Mustache[_0x4d55('0x6')](_0x4026eb[_0x4d55('0x7')],_0x540f23),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x4026eb[_0x4d55('0x8')])===_0x4d55('0x9')&&parseInt(_0x4026eb[_0x4d55('0x8')])>=0x1&&parseInt(_0x4026eb['data5'])<=0xa?parseInt(_0x4026eb[_0x4d55('0x8')])*0x3e8:0x5*0x3e8};try{_0x573d21[_0x4d55('0xa')]=_0x4026eb[_0x4d55('0xb')]?JSON[_0x4d55('0xc')](Mustache[_0x4d55('0x6')](_0x4026eb[_0x4d55('0xb')],_0x540f23)):{};}catch(_0xace3d9){logger[_0x4d55('0xd')](_0xace3d9[_0x4d55('0xe')]);}switch(_0x4026eb[_0x4d55('0x4')][_0x4d55('0x5')]()){case _0x4d55('0xf'):case _0x4d55('0x10'):_0x35970e=null;_0x573d21['qs']=_0x540f23;break;case _0x4d55('0x11'):case _0x4d55('0x12'):if(_0x4026eb[_0x4d55('0x13')]){try{_0x35970e=JSON[_0x4d55('0xc')](Mustache[_0x4d55('0x6')](_0x4026eb[_0x4d55('0x13')],_0x540f23));_0x573d21['body']=_0x35970e;}catch(_0x1bd25f){logger[_0x4d55('0xd')](_0x1bd25f[_0x4d55('0xe')]);logger[_0x4d55('0xd')](_0x4d55('0x14'));}}else{_0x35970e=_0x540f23;_0x573d21[_0x4d55('0x15')]=_0x35970e;}break;}logger['info'](util['format'](_0x4d55('0x16'),_0x4026eb[_0x4d55('0x4')],_0x4026eb['data2'],JSON[_0x4d55('0x17')](_0x573d21)));rp(_0x573d21)[_0x4d55('0x18')](function(_0x49f450){_0x35970e=!_['isNil'](_0x35970e)?_0x4d55('0x19')+_0x35970e:'';_0x214471=typeof _0x49f450['body']===_0x4d55('0x1a')?JSON[_0x4d55('0x17')](_0x49f450[_0x4d55('0x15')]):_0x49f450[_0x4d55('0x15')];logger[_0x4d55('0x1b')](util[_0x4d55('0x1c')](_0x4d55('0x1d'),_0x4026eb[_0x4d55('0x4')],_0x4026eb['data2'],_0x49f450[_0x4d55('0x1e')],_0x214471));})[_0x4d55('0x1f')](function(_0x20f1c6){logger['error'](util[_0x4d55('0x1c')](_0x4d55('0x20'),_0x4026eb[_0x4d55('0x4')],_0x4026eb[_0x4d55('0x7')],_0x20f1c6['statusCode'],_0x20f1c6[_0x4d55('0x21')],_0x20f1c6[_0x4d55('0x22')]));});};
\ No newline at end of file
+var _0x8d7e=['isNil',',\x20request\x20body:\x20','stringify','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','data2','statusCode','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','request-promise','util','lodash','mustache','../../../../config/logger','trigger','exec','data1','toUpperCase','render','number','data5','headers','data6','parse','stack','GET','POST','PUT','data7','body','error','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','then'];(function(_0x28014d,_0x383e2f){var _0x2572cc=function(_0x17aabd){while(--_0x17aabd){_0x28014d['push'](_0x28014d['shift']());}};_0x2572cc(++_0x383e2f);}(_0x8d7e,0x1a7));var _0xe8d7=function(_0x19360a,_0x31c467){_0x19360a=_0x19360a-0x0;var _0x2681c6=_0x8d7e[_0x19360a];return _0x2681c6;};'use strict';var rp=require(_0xe8d7('0x0'));var util=require(_0xe8d7('0x1'));var _=require(_0xe8d7('0x2'));var Mustache=require(_0xe8d7('0x3'));var logger=require(_0xe8d7('0x4'))(_0xe8d7('0x5'));exports[_0xe8d7('0x6')]=function(_0x3c3263,_0x5158ca){var _0x51274a,_0x30e862;var _0x59722e={'method':_0x3c3263[_0xe8d7('0x7')][_0xe8d7('0x8')](),'uri':Mustache[_0xe8d7('0x9')](_0x3c3263['data2'],_0x5158ca),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x3c3263['data5'])===_0xe8d7('0xa')&&parseInt(_0x3c3263[_0xe8d7('0xb')])>=0x1&&parseInt(_0x3c3263['data5'])<=0xa?parseInt(_0x3c3263['data5'])*0x3e8:0x5*0x3e8};try{_0x59722e[_0xe8d7('0xc')]=_0x3c3263[_0xe8d7('0xd')]?JSON[_0xe8d7('0xe')](Mustache[_0xe8d7('0x9')](_0x3c3263[_0xe8d7('0xd')],_0x5158ca)):{};}catch(_0x3f0e91){logger['error'](_0x3f0e91[_0xe8d7('0xf')]);}switch(_0x3c3263[_0xe8d7('0x7')][_0xe8d7('0x8')]()){case _0xe8d7('0x10'):case'DELETE':_0x51274a=null;_0x59722e['qs']=_0x5158ca;break;case _0xe8d7('0x11'):case _0xe8d7('0x12'):if(_0x3c3263[_0xe8d7('0x13')]){try{_0x51274a=JSON['parse'](Mustache[_0xe8d7('0x9')](_0x3c3263[_0xe8d7('0x13')],_0x5158ca));_0x59722e[_0xe8d7('0x14')]=_0x51274a;}catch(_0x1a088c){logger[_0xe8d7('0x15')](_0x1a088c[_0xe8d7('0xf')]);logger[_0xe8d7('0x15')]('body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format');}}else{_0x51274a=_0x5158ca;_0x59722e['body']=_0x51274a;}break;}logger['info'](util[_0xe8d7('0x16')](_0xe8d7('0x17'),_0x3c3263[_0xe8d7('0x7')],_0x3c3263['data2'],JSON['stringify'](_0x59722e)));rp(_0x59722e)[_0xe8d7('0x18')](function(_0x2ca49e){_0x51274a=!_[_0xe8d7('0x19')](_0x51274a)?_0xe8d7('0x1a')+_0x51274a:'';_0x30e862=typeof _0x2ca49e[_0xe8d7('0x14')]==='object'?JSON[_0xe8d7('0x1b')](_0x2ca49e[_0xe8d7('0x14')]):_0x2ca49e['body'];logger['info'](util[_0xe8d7('0x16')](_0xe8d7('0x1c'),_0x3c3263[_0xe8d7('0x7')],_0x3c3263[_0xe8d7('0x1d')],_0x2ca49e[_0xe8d7('0x1e')],_0x30e862));})['catch'](function(_0x150dd0){logger['error'](util[_0xe8d7('0x16')](_0xe8d7('0x1f'),_0x3c3263['data1'],_0x3c3263['data2'],_0x150dd0[_0xe8d7('0x1e')],_0x150dd0['name'],_0x150dd0['message']));});};
\ No newline at end of file
index d3d47e8..78bd1b7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3493=['error','routing','message','result','catch','bluebird','http','Request','debug'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3493,0x101));var _0x3349=function(_0x4626ad,_0x43f817){_0x4626ad=_0x4626ad-0x0;var _0x2b8b0d=_0x3493[_0x4626ad];return _0x2b8b0d;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0x3349('0x0'));var logger=require('../../config/logger')('routing');var client=jayson['client'][_0x3349('0x1')]({'port':0x2329});client[_0x3349('0x2')]=function(_0x250ebd,_0x127e14){return new BPromise(function(_0x533995,_0x5b7905){return client['request'](_0x250ebd,_0x127e14)['then'](function(_0x441d3a){logger[_0x3349('0x3')]('rpc','routing',_0x250ebd,_0x127e14,_0x441d3a);if(_0x441d3a[_0x3349('0x4')]){logger[_0x3349('0x4')]('rpc',_0x3349('0x5'),_0x250ebd,_0x441d3a[_0x3349('0x4')][_0x3349('0x6')],_0x127e14);return _0x5b7905(_0x441d3a[_0x3349('0x4')][_0x3349('0x6')]);}else{return _0x533995(_0x441d3a[_0x3349('0x7')]);}})[_0x3349('0x8')](function(_0x9f64c4){logger['error']('rpc',_0x3349('0x5'),_0x250ebd,_0x9f64c4,_0x127e14);return _0x5b7905(_0x9f64c4);});});};module['exports']=client;
\ No newline at end of file
+var _0x49b1=['debug','rpc','error','message','result','catch','jayson/promise','../../config/logger','routing','client','request','then'];(function(_0x30cd7e,_0x4db10a){var _0x462a02=function(_0x157d81){while(--_0x157d81){_0x30cd7e['push'](_0x30cd7e['shift']());}};_0x462a02(++_0x4db10a);}(_0x49b1,0x1da));var _0x149b=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x49b1[_0x5b644e];return _0x49c6bf;};'use strict';var jayson=require(_0x149b('0x0'));var BPromise=require('bluebird');var logger=require(_0x149b('0x1'))(_0x149b('0x2'));var client=jayson[_0x149b('0x3')]['http']({'port':0x2329});client['Request']=function(_0x83e8f0,_0x17b871){return new BPromise(function(_0x1d2020,_0xae10d2){return client[_0x149b('0x4')](_0x83e8f0,_0x17b871)[_0x149b('0x5')](function(_0x4eb534){logger[_0x149b('0x6')](_0x149b('0x7'),_0x149b('0x2'),_0x83e8f0,_0x17b871,_0x4eb534);if(_0x4eb534[_0x149b('0x8')]){logger[_0x149b('0x8')]('rpc','routing',_0x83e8f0,_0x4eb534[_0x149b('0x8')][_0x149b('0x9')],_0x17b871);return _0xae10d2(_0x4eb534['error']['message']);}else{return _0x1d2020(_0x4eb534[_0x149b('0xa')]);}})[_0x149b('0xb')](function(_0x3f0cf7){logger[_0x149b('0x8')](_0x149b('0x7'),_0x149b('0x2'),_0x83e8f0,_0x3f0cf7,_0x17b871);return _0xae10d2(_0x3f0cf7);});});};module['exports']=client;
\ No newline at end of file
index 06a9588..3a5bbfb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x67e4=['getSettings','loginMailFrequency','Email\x20service\x20initialization','./server','./realtime','./lib/email','./rpc/setting','../../config/logger','email','resolve','then','getMailAccounts','mailAccounts','listen'];(function(_0x13d813,_0x269f1f){var _0xe3bb26=function(_0x264a4f){while(--_0x264a4f){_0x13d813['push'](_0x13d813['shift']());}};_0xe3bb26(++_0x269f1f);}(_0x67e4,0x1ed));var _0x467e=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0x67e4[_0x1969a7];return _0x3d665f;};'use strict';var server=require(_0x467e('0x0'));var Realtime=require(_0x467e('0x1'));var EmailChannel=require(_0x467e('0x2'));var mailAccount=require('./rpc/mailAccount');var setting=require(_0x467e('0x3'));var logger=require(_0x467e('0x4'))(_0x467e('0x5'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0x467e('0x6')]()[_0x467e('0x7')](mailAccount[_0x467e('0x8')]())['then'](realtime['initMailAccounts']())[_0x467e('0x7')](function(){email['refresh'](realtime[_0x467e('0x9')]);return realtime;});}function main(){return server[_0x467e('0xa')](realtime,email)[_0x467e('0x7')](function(){return initRealtime();})[_0x467e('0x7')](function(){return setting[_0x467e('0xb')]();})['then'](function(_0x1a69e0){return setInterval(initRealtime,_0x1a69e0[_0x467e('0xc')]*0x3e8);})['catch'](function(_0x791e32){logger['error'](_0x467e('0xd'),_0x791e32);});}main();
\ No newline at end of file
+var _0x862b=['../../config/logger','resolve','getMailAccounts','initMailAccounts','then','refresh','mailAccounts','listen','getSettings','catch','error','./server','./lib/email','./rpc/mailAccount','./rpc/setting'];(function(_0x4b3154,_0x3079ec){var _0xf575a1=function(_0x3a1a83){while(--_0x3a1a83){_0x4b3154['push'](_0x4b3154['shift']());}};_0xf575a1(++_0x3079ec);}(_0x862b,0x173));var _0xb862=function(_0x21cd90,_0x263396){_0x21cd90=_0x21cd90-0x0;var _0x360dd9=_0x862b[_0x21cd90];return _0x360dd9;};'use strict';var server=require(_0xb862('0x0'));var Realtime=require('./realtime');var EmailChannel=require(_0xb862('0x1'));var mailAccount=require(_0xb862('0x2'));var setting=require(_0xb862('0x3'));var logger=require(_0xb862('0x4'))('email');var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0xb862('0x5')]()['then'](mailAccount[_0xb862('0x6')]())['then'](realtime[_0xb862('0x7')]())[_0xb862('0x8')](function(){email[_0xb862('0x9')](realtime[_0xb862('0xa')]);return realtime;});}function main(){return server[_0xb862('0xb')](realtime,email)[_0xb862('0x8')](function(){return initRealtime();})[_0xb862('0x8')](function(){return setting[_0xb862('0xc')]();})[_0xb862('0x8')](function(_0x567b18){return setInterval(initRealtime,_0x567b18['loginMailFrequency']*0x3e8);})[_0xb862('0xd')](function(_0x2ab7b0){logger[_0xb862('0xe')]('Email\x20service\x20initialization',_0x2ab7b0);});}main();
\ No newline at end of file
index f1ecff6..951b046 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5144=['ioredis','../../../config/environment','../../../config/logger','redis','defaults','socket.io-emitter','./imap','./smtp','../rpc/mailAccount','mailAccounts','imapAccounts','prototype','emit','name','active','Imap','status','messageStatus','total','isNil','stringify','mailAccount:update','refresh','hasOwnProperty','service','provider','email','box','handleImapEmail','bind','end','error','handleImapError','handleImapBox','connected','messages','info','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','from','notify','then','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','handleImapEnd','lastSync','send','verifySmtp','Smtp','smtp','verified','verify','lodash','moment','bluebird','md5'];(function(_0x13adbf,_0x5d2886){var _0x821a3c=function(_0x57827c){while(--_0x57827c){_0x13adbf['push'](_0x13adbf['shift']());}};_0x821a3c(++_0x5d2886);}(_0x5144,0x6e));var _0x4514=function(_0xa1db1a,_0x259e00){_0xa1db1a=_0xa1db1a-0x0;var _0x11201e=_0x5144[_0xa1db1a];return _0x11201e;};'use strict';var _=require(_0x4514('0x0'));var moment=require(_0x4514('0x1'));var BPromise=require(_0x4514('0x2'));var md5=require(_0x4514('0x3'));var Redis=require(_0x4514('0x4'));var config=require(_0x4514('0x5'));var logger=require(_0x4514('0x6'))('email');config[_0x4514('0x7')]=_[_0x4514('0x8')](config[_0x4514('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x4514('0x9'))(new Redis(config[_0x4514('0x7')]));var EmailImap=require(_0x4514('0xa'));var EmailSmtp=require(_0x4514('0xb'));var mailAccount=require(_0x4514('0xc'));var md5Accounts={};function EmailChannel(_0x3fe814){logger['info']('start\x20email\x20channel');this['mailAccounts']=_0x3fe814[_0x4514('0xd')];this[_0x4514('0xe')]={};this['smtp']=new EmailSmtp();}EmailChannel[_0x4514('0xf')][_0x4514('0x10')]=function(_0x835492){var _0x1fe12a=this['mailAccounts'][_0x835492];var _0x417eec={'id':_0x1fe12a['id'],'name':_0x1fe12a[_0x4514('0x11')],'key':_0x1fe12a['key'],'active':_0x1fe12a[_0x4514('0x12')],'Imap':{'status':_0x1fe12a[_0x4514('0x13')][_0x4514('0x14')],'messageStatus':_0x1fe12a[_0x4514('0x13')][_0x4514('0x15')],'total':_0x1fe12a[_0x4514('0x13')][_0x4514('0x16')]}};if(_[_0x4514('0x17')](md5Accounts[_0x835492])){md5Accounts[_0x835492]={};}var _0x348c35=md5(JSON[_0x4514('0x18')](_0x417eec));if(md5Accounts[_0x835492]['md5']!==_0x348c35){md5Accounts[_0x835492][_0x4514('0x3')]=_0x348c35;io[_0x4514('0x10')](_0x4514('0x19'),_0x417eec);}};EmailChannel['prototype'][_0x4514('0x1a')]=function(_0x480b81){for(var _0x1782e4 in _0x480b81){if(_0x480b81[_0x4514('0x1b')](_0x1782e4)){if(_0x480b81[_0x1782e4][_0x4514('0x13')]&&_0x480b81[_0x1782e4][_0x4514('0x12')]){var _0x36a3af=_0x480b81[_0x1782e4]['Imap'];if(!_0x36a3af[_0x4514('0x1c')]&&_0x480b81[_0x1782e4][_0x4514('0x1d')]!=='custom')_0x36a3af[_0x4514('0x1c')]=_0x480b81[_0x1782e4][_0x4514('0x1d')];if(!this[_0x4514('0xe')]['hasOwnProperty'](_0x36a3af['id'])){this[_0x4514('0xe')][_0x36a3af['id']]=new EmailImap(_0x36a3af,_0x480b81[_0x1782e4][_0x4514('0x1e')]);this[_0x4514('0xe')][_0x36a3af['id']]['on'](_0x4514('0x1f'),this['handleImapBox']['bind'](this,_0x1782e4));this['imapAccounts'][_0x36a3af['id']]['on'](_0x4514('0x1e'),this[_0x4514('0x20')][_0x4514('0x21')](this,_0x1782e4));this[_0x4514('0xe')][_0x36a3af['id']]['on'](_0x4514('0x22'),this['handleImapEnd']['bind'](this,_0x1782e4));this['imapAccounts'][_0x36a3af['id']]['on'](_0x4514('0x23'),this[_0x4514('0x24')][_0x4514('0x21')](this,_0x1782e4));}}else{if(_['isNil'](this[_0x4514('0xd')][_0x1782e4][_0x4514('0x13')])){this[_0x4514('0xd')][_0x1782e4][_0x4514('0x13')]={};}this[_0x4514('0xd')][_0x1782e4]['Imap'][_0x4514('0x14')]='disabled';this[_0x4514('0xd')][_0x1782e4]['Imap']['messageStatus']='';this['emit'](_0x1782e4);}}}};EmailChannel[_0x4514('0xf')][_0x4514('0x25')]=function(_0x1cd727,_0x27059b){if(this[_0x4514('0xd')][_0x1cd727]){this[_0x4514('0xd')][_0x1cd727][_0x4514('0x13')][_0x4514('0x14')]=_0x4514('0x26');this['mailAccounts'][_0x1cd727][_0x4514('0x13')]['messageStatus']=_0x27059b[_0x4514('0x11')];if(_0x27059b[_0x4514('0x27')]){this[_0x4514('0xd')][_0x1cd727][_0x4514('0x13')][_0x4514('0x16')]=_0x27059b[_0x4514('0x27')][_0x4514('0x16')];}return this[_0x4514('0x10')](_0x1cd727);}};EmailChannel[_0x4514('0xf')][_0x4514('0x20')]=function(_0x4903c3,_0x28a5bc){logger[_0x4514('0x28')](_0x4514('0x29'),_0x28a5bc[_0x4514('0x2a')],_0x28a5bc['lastName'],_0x28a5bc[_0x4514('0x2b')],_0x4903c3);if(this['mailAccounts'][_0x4903c3]){return mailAccount[_0x4514('0x2c')](_0x4903c3,_0x28a5bc)[_0x4514('0x2d')](function(_0x3de05a){if(_0x3de05a){logger[_0x4514('0x28')](_0x4514('0x2e'));}})[_0x4514('0x2f')](function(_0x5f61d){logger[_0x4514('0x23')](_0x4514('0x30'),JSON[_0x4514('0x18')](_0x5f61d));});}};EmailChannel['prototype'][_0x4514('0x31')]=function(_0x4bdec4){if(this[_0x4514('0xd')][_0x4bdec4]&&this['mailAccounts'][_0x4bdec4][_0x4514('0x13')]){if(this[_0x4514('0xe')][this[_0x4514('0xd')][_0x4bdec4][_0x4514('0x13')]['id']]){delete this[_0x4514('0xe')][this[_0x4514('0xd')][_0x4bdec4]['Imap']['id']];}this[_0x4514('0xd')][_0x4bdec4][_0x4514('0x13')][_0x4514('0x32')]=moment();this[_0x4514('0x10')](_0x4bdec4);}};EmailChannel[_0x4514('0xf')]['handleImapError']=function(_0x263d8d,_0x1dae01){if(this[_0x4514('0xd')][_0x263d8d]){this[_0x4514('0xd')][_0x263d8d]['Imap'][_0x4514('0x14')]=_0x4514('0x23');this[_0x4514('0xd')][_0x263d8d][_0x4514('0x13')]['messageStatus']=_0x1dae01;return this[_0x4514('0x10')](_0x263d8d);}};EmailChannel[_0x4514('0xf')]['sendMail']=function(_0x5e27f7,_0x48db35){return this['smtp'][_0x4514('0x33')](_0x5e27f7,_0x48db35);};EmailChannel[_0x4514('0xf')][_0x4514('0x34')]=function(_0x3a094a){var _0x349ab8=this;if(this[_0x4514('0xd')][_0x3a094a['id']]){if(_[_0x4514('0x17')](this['mailAccounts'][_0x3a094a['id']][_0x4514('0x35')])){this[_0x4514('0xd')][_0x3a094a['id']]['Smtp']={};}this[_0x4514('0xd')][_0x3a094a['id']]['Smtp'][_0x4514('0x32')]=moment();return new BPromise(function(_0x351a45,_0x67f5a2){return _0x349ab8[_0x4514('0x36')]['verify'](_0x3a094a)['then'](function(_0x4e2513){_0x349ab8[_0x4514('0xd')][_0x3a094a['id']][_0x4514('0x35')][_0x4514('0x14')]=_0x4514('0x37');_0x349ab8[_0x4514('0xd')][_0x3a094a['id']][_0x4514('0x35')][_0x4514('0x15')]='';_0x349ab8[_0x4514('0x10')](_0x3a094a['id']);_0x351a45(_0x4e2513);})['catch'](function(_0x3ddb20){_0x349ab8[_0x4514('0xd')][_0x3a094a['id']]['Smtp'][_0x4514('0x14')]='error';_0x349ab8[_0x4514('0xd')][_0x3a094a['id']][_0x4514('0x35')][_0x4514('0x15')]=_0x3ddb20;_0x349ab8['emit'](_0x3a094a['id']);_0x67f5a2(_0x3ddb20);});});}return this[_0x4514('0x36')][_0x4514('0x38')](_0x3a094a);};module['exports']=EmailChannel;
\ No newline at end of file
+var _0x7b28=['handleImapEnd','error','handleImapError','disabled','connected','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','lastName','from','notify','then','catch','lastSync','sendMail','send','verifySmtp','Smtp','verify','exports','md5','../../../config/environment','../../../config/logger','redis','defaults','localhost','./imap','./smtp','../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','emit','name','key','active','Imap','status','messageStatus','total','isNil','stringify','mailAccount:update','prototype','refresh','service','provider','custom','hasOwnProperty','handleImapBox','bind','email','handleImapEmail','end'];(function(_0x4e11e7,_0x42d0b6){var _0x1d7d39=function(_0x416030){while(--_0x416030){_0x4e11e7['push'](_0x4e11e7['shift']());}};_0x1d7d39(++_0x42d0b6);}(_0x7b28,0x126));var _0x87b2=function(_0x172b8e,_0x54140c){_0x172b8e=_0x172b8e-0x0;var _0x41012b=_0x7b28[_0x172b8e];return _0x41012b;};'use strict';var _=require('lodash');var moment=require('moment');var BPromise=require('bluebird');var md5=require(_0x87b2('0x0'));var Redis=require('ioredis');var config=require(_0x87b2('0x1'));var logger=require(_0x87b2('0x2'))('email');config[_0x87b2('0x3')]=_[_0x87b2('0x4')](config[_0x87b2('0x3')],{'host':_0x87b2('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x87b2('0x3')]));var EmailImap=require(_0x87b2('0x6'));var EmailSmtp=require(_0x87b2('0x7'));var mailAccount=require(_0x87b2('0x8'));var md5Accounts={};function EmailChannel(_0x32dfe3){logger[_0x87b2('0x9')](_0x87b2('0xa'));this[_0x87b2('0xb')]=_0x32dfe3[_0x87b2('0xb')];this[_0x87b2('0xc')]={};this[_0x87b2('0xd')]=new EmailSmtp();}EmailChannel['prototype'][_0x87b2('0xe')]=function(_0x355626){var _0x305691=this[_0x87b2('0xb')][_0x355626];var _0x69a47b={'id':_0x305691['id'],'name':_0x305691[_0x87b2('0xf')],'key':_0x305691[_0x87b2('0x10')],'active':_0x305691[_0x87b2('0x11')],'Imap':{'status':_0x305691[_0x87b2('0x12')][_0x87b2('0x13')],'messageStatus':_0x305691[_0x87b2('0x12')][_0x87b2('0x14')],'total':_0x305691[_0x87b2('0x12')][_0x87b2('0x15')]}};if(_[_0x87b2('0x16')](md5Accounts[_0x355626])){md5Accounts[_0x355626]={};}var _0x2334a0=md5(JSON[_0x87b2('0x17')](_0x69a47b));if(md5Accounts[_0x355626][_0x87b2('0x0')]!==_0x2334a0){md5Accounts[_0x355626][_0x87b2('0x0')]=_0x2334a0;io['emit'](_0x87b2('0x18'),_0x69a47b);}};EmailChannel[_0x87b2('0x19')][_0x87b2('0x1a')]=function(_0x16904a){for(var _0x1e138a in _0x16904a){if(_0x16904a['hasOwnProperty'](_0x1e138a)){if(_0x16904a[_0x1e138a]['Imap']&&_0x16904a[_0x1e138a][_0x87b2('0x11')]){var _0x3727eb=_0x16904a[_0x1e138a][_0x87b2('0x12')];if(!_0x3727eb[_0x87b2('0x1b')]&&_0x16904a[_0x1e138a][_0x87b2('0x1c')]!==_0x87b2('0x1d'))_0x3727eb['service']=_0x16904a[_0x1e138a]['provider'];if(!this[_0x87b2('0xc')][_0x87b2('0x1e')](_0x3727eb['id'])){this[_0x87b2('0xc')][_0x3727eb['id']]=new EmailImap(_0x3727eb,_0x16904a[_0x1e138a]['email']);this['imapAccounts'][_0x3727eb['id']]['on']('box',this[_0x87b2('0x1f')][_0x87b2('0x20')](this,_0x1e138a));this[_0x87b2('0xc')][_0x3727eb['id']]['on'](_0x87b2('0x21'),this[_0x87b2('0x22')][_0x87b2('0x20')](this,_0x1e138a));this[_0x87b2('0xc')][_0x3727eb['id']]['on'](_0x87b2('0x23'),this[_0x87b2('0x24')][_0x87b2('0x20')](this,_0x1e138a));this[_0x87b2('0xc')][_0x3727eb['id']]['on'](_0x87b2('0x25'),this[_0x87b2('0x26')][_0x87b2('0x20')](this,_0x1e138a));}}else{if(_[_0x87b2('0x16')](this[_0x87b2('0xb')][_0x1e138a][_0x87b2('0x12')])){this[_0x87b2('0xb')][_0x1e138a][_0x87b2('0x12')]={};}this[_0x87b2('0xb')][_0x1e138a][_0x87b2('0x12')][_0x87b2('0x13')]=_0x87b2('0x27');this['mailAccounts'][_0x1e138a][_0x87b2('0x12')][_0x87b2('0x14')]='';this[_0x87b2('0xe')](_0x1e138a);}}}};EmailChannel[_0x87b2('0x19')][_0x87b2('0x1f')]=function(_0x520cb7,_0x41cdb1){if(this['mailAccounts'][_0x520cb7]){this[_0x87b2('0xb')][_0x520cb7][_0x87b2('0x12')][_0x87b2('0x13')]=_0x87b2('0x28');this[_0x87b2('0xb')][_0x520cb7][_0x87b2('0x12')][_0x87b2('0x14')]=_0x41cdb1[_0x87b2('0xf')];if(_0x41cdb1[_0x87b2('0x29')]){this[_0x87b2('0xb')][_0x520cb7][_0x87b2('0x12')][_0x87b2('0x15')]=_0x41cdb1[_0x87b2('0x29')][_0x87b2('0x15')];}return this[_0x87b2('0xe')](_0x520cb7);}};EmailChannel[_0x87b2('0x19')][_0x87b2('0x22')]=function(_0x16cf80,_0x18d0a7){logger[_0x87b2('0x9')](_0x87b2('0x2a'),_0x18d0a7['firstName'],_0x18d0a7[_0x87b2('0x2b')],_0x18d0a7[_0x87b2('0x2c')],_0x16cf80);if(this[_0x87b2('0xb')][_0x16cf80]){return mailAccount[_0x87b2('0x2d')](_0x16cf80,_0x18d0a7)[_0x87b2('0x2e')](function(_0xf59802){if(_0xf59802){logger[_0x87b2('0x9')]('Mail\x20accepted\x20from\x20routing');}})[_0x87b2('0x2f')](function(_0x2cd5e7){logger[_0x87b2('0x25')]('Mail\x20not\x20accepted\x20from\x20routing\x20%s',JSON[_0x87b2('0x17')](_0x2cd5e7));});}};EmailChannel[_0x87b2('0x19')][_0x87b2('0x24')]=function(_0x271536){if(this['mailAccounts'][_0x271536]&&this['mailAccounts'][_0x271536]['Imap']){if(this[_0x87b2('0xc')][this[_0x87b2('0xb')][_0x271536]['Imap']['id']]){delete this[_0x87b2('0xc')][this['mailAccounts'][_0x271536]['Imap']['id']];}this[_0x87b2('0xb')][_0x271536]['Imap'][_0x87b2('0x30')]=moment();this[_0x87b2('0xe')](_0x271536);}};EmailChannel[_0x87b2('0x19')][_0x87b2('0x26')]=function(_0x4dd3c3,_0x1c8c78){if(this['mailAccounts'][_0x4dd3c3]){this['mailAccounts'][_0x4dd3c3][_0x87b2('0x12')]['status']=_0x87b2('0x25');this[_0x87b2('0xb')][_0x4dd3c3]['Imap']['messageStatus']=_0x1c8c78;return this[_0x87b2('0xe')](_0x4dd3c3);}};EmailChannel[_0x87b2('0x19')][_0x87b2('0x31')]=function(_0x27c467,_0x5afdfb){return this[_0x87b2('0xd')][_0x87b2('0x32')](_0x27c467,_0x5afdfb);};EmailChannel[_0x87b2('0x19')][_0x87b2('0x33')]=function(_0x583197){var _0x4817c7=this;if(this[_0x87b2('0xb')][_0x583197['id']]){if(_['isNil'](this[_0x87b2('0xb')][_0x583197['id']][_0x87b2('0x34')])){this['mailAccounts'][_0x583197['id']][_0x87b2('0x34')]={};}this[_0x87b2('0xb')][_0x583197['id']][_0x87b2('0x34')][_0x87b2('0x30')]=moment();return new BPromise(function(_0x273abf,_0xe0e209){return _0x4817c7[_0x87b2('0xd')][_0x87b2('0x35')](_0x583197)[_0x87b2('0x2e')](function(_0x25369d){_0x4817c7[_0x87b2('0xb')][_0x583197['id']][_0x87b2('0x34')]['status']='verified';_0x4817c7[_0x87b2('0xb')][_0x583197['id']][_0x87b2('0x34')][_0x87b2('0x14')]='';_0x4817c7[_0x87b2('0xe')](_0x583197['id']);_0x273abf(_0x25369d);})['catch'](function(_0x4ceee0){_0x4817c7[_0x87b2('0xb')][_0x583197['id']][_0x87b2('0x34')][_0x87b2('0x13')]=_0x87b2('0x25');_0x4817c7[_0x87b2('0xb')][_0x583197['id']][_0x87b2('0x34')][_0x87b2('0x14')]=_0x4ceee0;_0x4817c7[_0x87b2('0xe')](_0x583197['id']);_0xe0e209(_0x4ceee0);});});}return this['smtp']['verify'](_0x583197);};module[_0x87b2('0x36')]=EmailChannel;
\ No newline at end of file
index dff3a5b..7d51c41 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6050=['generateXOAuth2Token','CloudProvider','data5','password','authentication','host','port','tls','required','openBox','mailbox','handleOpenBox','emit','readUnseen','search','handleReadUnseen','length','fetch','message','handleFetchMessage','handleFetchError','handleFetchEnd','closeBox','handleCloseBox','body','handleMessageBody','attributes','handleMessageEnd','handleSimpleParser','handleMessageAttributes','parser','stringify','upperFirst','exports','lodash','util','imap','mailparser','simpleParser','iconv','events','EventEmitter','./utils','getAccount','account','once','handleReady','bind','end','handleEnd','error','handleError','connect','inherits','prototype','connTimeout','authTimeout','user','email','anonymous@xcally.com','modernAuthentication','xoauth2'];(function(_0x3dfbbc,_0x489f54){var _0x3be110=function(_0xf90bf0){while(--_0xf90bf0){_0x3dfbbc['push'](_0x3dfbbc['shift']());}};_0x3be110(++_0x489f54);}(_0x6050,0x196));var _0x0605=function(_0x5e404c,_0x48d309){_0x5e404c=_0x5e404c-0x0;var _0x2155c7=_0x6050[_0x5e404c];return _0x2155c7;};'use strict';var _=require(_0x0605('0x0'));var util=require(_0x0605('0x1'));var Imap=require(_0x0605('0x2'));var simpleParser=require(_0x0605('0x3'))[_0x0605('0x4')];var Iconv=require(_0x0605('0x5'))['Iconv'];var EventEmitter=require(_0x0605('0x6'))[_0x0605('0x7')];var utils=require(_0x0605('0x8'));var logger=require('../../../config/logger')('email');function EmailImap(_0x4aca21,_0xd78d96){this['mailbox']='INBOX';this['account']=this[_0x0605('0x9')](_0x4aca21,_0xd78d96);this[_0x0605('0x2')]=new Imap(this[_0x0605('0xa')]);this[_0x0605('0x2')][_0x0605('0xb')]('ready',this[_0x0605('0xc')][_0x0605('0xd')](this));this[_0x0605('0x2')][_0x0605('0xb')](_0x0605('0xe'),this[_0x0605('0xf')][_0x0605('0xd')](this));this[_0x0605('0x2')]['on'](_0x0605('0x10'),this[_0x0605('0x11')][_0x0605('0xd')](this));this[_0x0605('0x2')][_0x0605('0x12')]();}util[_0x0605('0x13')](EmailImap,EventEmitter);EmailImap[_0x0605('0x14')][_0x0605('0x9')]=function(_0x169a70,_0x65a20b){var _0x1b944f={'connTimeout':_0x169a70['connTimeout']?_0x169a70[_0x0605('0x15')]*0x3e8:0x2710,'authTimeout':_0x169a70[_0x0605('0x16')]?_0x169a70[_0x0605('0x16')]*0x3e8:0x1388};if(_0x169a70['service']){_0x1b944f['user']=_0x169a70[_0x0605('0x17')];_0x1b944f[_0x0605('0x18')]=_0x65a20b||_0x169a70[_0x0605('0x17')]||_0x0605('0x19');if(_0x169a70[_0x0605('0x1a')]){_0x1b944f[_0x0605('0x1b')]=utils[_0x0605('0x1c')](_0x169a70[_0x0605('0x1d')][_0x0605('0x1e')],_0x169a70[_0x0605('0x17')]);}else{_0x1b944f[_0x0605('0x1f')]=_0x169a70[_0x0605('0x1f')];}}else{if(_0x169a70[_0x0605('0x20')]){_0x1b944f[_0x0605('0x17')]=_0x169a70['user'];_0x1b944f[_0x0605('0x1f')]=_0x169a70[_0x0605('0x1f')];}}_0x1b944f[_0x0605('0x21')]=_0x169a70[_0x0605('0x21')];_0x1b944f[_0x0605('0x22')]=_0x169a70[_0x0605('0x22')]||0x3e1;if(_0x169a70[_0x0605('0x23')]){_0x1b944f[_0x0605('0x23')]=!![];}else{_0x1b944f[_0x0605('0x23')]=![];_0x1b944f['autotls']=_0x0605('0x24');}return _0x1b944f;};EmailImap['prototype'][_0x0605('0xc')]=function(){this[_0x0605('0x2')][_0x0605('0x25')](this[_0x0605('0x26')],![],this[_0x0605('0x27')][_0x0605('0xd')](this));};EmailImap[_0x0605('0x14')][_0x0605('0x27')]=function(_0x234231,_0x2896d7){if(_0x234231){this[_0x0605('0x11')](_0x234231,!![]);}else{this[_0x0605('0x28')]('box',_0x2896d7);this[_0x0605('0x29')]();}};EmailImap[_0x0605('0x14')]['handleCloseBox']=function(_0x4d9a31){if(_0x4d9a31){this['handleError'](_0x4d9a31,!![]);}else{this[_0x0605('0x2')][_0x0605('0xe')]();}};EmailImap[_0x0605('0x14')][_0x0605('0x29')]=function(){this[_0x0605('0x2')][_0x0605('0x2a')](['UNSEEN'],this[_0x0605('0x2b')]['bind'](this));};EmailImap[_0x0605('0x14')][_0x0605('0x2b')]=function(_0x421c26,_0x9f2980){if(_0x421c26){this[_0x0605('0x11')](_0x421c26,!![]);}else{if(_0x9f2980[_0x0605('0x2c')]){try{var _0x56dd1a=this[_0x0605('0x2')][_0x0605('0x2d')](_0x9f2980,{'bodies':'','markSeen':!![]});_0x56dd1a['on'](_0x0605('0x2e'),this[_0x0605('0x2f')][_0x0605('0xd')](this));_0x56dd1a[_0x0605('0xb')](_0x0605('0x10'),this[_0x0605('0x30')][_0x0605('0xd')](this));_0x56dd1a[_0x0605('0xb')](_0x0605('0xe'),this[_0x0605('0x31')][_0x0605('0xd')](this));}catch(_0x992e4f){logger[_0x0605('0x10')](_0x992e4f);}}else{this[_0x0605('0x2')][_0x0605('0x32')](!![],this[_0x0605('0x33')][_0x0605('0xd')](this));}}};EmailImap[_0x0605('0x14')][_0x0605('0x2f')]=function(_0x1fbd2c){_0x1fbd2c['on'](_0x0605('0x34'),this[_0x0605('0x35')][_0x0605('0xd')](this));_0x1fbd2c[_0x0605('0xb')](_0x0605('0x36'),this['handleMessageAttributes'][_0x0605('0xd')](this));_0x1fbd2c[_0x0605('0xb')]('end',this[_0x0605('0x37')][_0x0605('0xd')](this));};EmailImap['prototype'][_0x0605('0x35')]=function(_0x4743b4){simpleParser(_0x4743b4,{'Iconv':Iconv},this[_0x0605('0x38')][_0x0605('0xd')](this));};EmailImap[_0x0605('0x14')][_0x0605('0x39')]=function(){};EmailImap['prototype']['handleMessageEnd']=function(){};EmailImap[_0x0605('0x14')][_0x0605('0x38')]=function(_0x3fd7eb,_0x500497){if(_0x3fd7eb){logger[_0x0605('0x10')](_0x3fd7eb);}else{var _0x4d8f39=this;utils[_0x0605('0x3a')](this[_0x0605('0xa')],_0x500497,function(_0x42b96b){_0x4d8f39[_0x0605('0x28')](_0x0605('0x18'),_0x42b96b);});}};EmailImap[_0x0605('0x14')][_0x0605('0x31')]=function(){this[_0x0605('0x2')][_0x0605('0x32')](!![],this[_0x0605('0x33')]['bind'](this));};EmailImap[_0x0605('0x14')]['handleFetchError']=function(_0x45e90c){this[_0x0605('0x11')](_0x45e90c);this[_0x0605('0x2')]['closeBox'](!![],this['handleCloseBox'][_0x0605('0xd')](this));};EmailImap['prototype'][_0x0605('0xf')]=function(){this[_0x0605('0x28')](_0x0605('0xe'));};EmailImap[_0x0605('0x14')][_0x0605('0x11')]=function(_0x3099b4,_0x279404){logger[_0x0605('0x10')](_0x0605('0x11'),this[_0x0605('0xa')][_0x0605('0x18')],JSON[_0x0605('0x3b')](_0x3099b4));var _0x44d912='';if(_0x3099b4){if(_0x3099b4['textCode']){_0x44d912=_0x3099b4['textCode'];}else{for(var _0x403ad6 in _0x3099b4){if(_0x3099b4['hasOwnProperty'](_0x403ad6)){_0x44d912+=_[_0x0605('0x3c')](_0x403ad6)+':\x20'+_0x3099b4[_0x403ad6]+'\x0a';}}}}if(_0x279404){this[_0x0605('0x2')]['end']();}else{this[_0x0605('0x28')](_0x0605('0x10'),_0x44d912);this['emit'](_0x0605('0xe'));}};module[_0x0605('0x3d')]=EmailImap;
\ No newline at end of file
+var _0x83d0=['mailparser','simpleParser','iconv','events','../../../config/logger','email','mailbox','getAccount','account','once','ready','handleReady','bind','handleEnd','error','handleError','connect','prototype','connTimeout','authTimeout','service','user','anonymous@xcally.com','modernAuthentication','xoauth2','generateXOAuth2Token','CloudProvider','data5','password','authentication','host','port','tls','required','openBox','emit','box','readUnseen','handleCloseBox','end','search','UNSEEN','handleReadUnseen','length','fetch','message','handleFetchError','handleFetchEnd','closeBox','handleFetchMessage','handleMessageBody','attributes','handleMessageEnd','handleSimpleParser','stringify','textCode','hasOwnProperty','upperFirst','exports','lodash','util','imap'];(function(_0x99e08b,_0x55bb81){var _0x4f7bb9=function(_0x360659){while(--_0x360659){_0x99e08b['push'](_0x99e08b['shift']());}};_0x4f7bb9(++_0x55bb81);}(_0x83d0,0xb7));var _0x083d=function(_0x1874d2,_0x22e634){_0x1874d2=_0x1874d2-0x0;var _0x4986cf=_0x83d0[_0x1874d2];return _0x4986cf;};'use strict';var _=require(_0x083d('0x0'));var util=require(_0x083d('0x1'));var Imap=require(_0x083d('0x2'));var simpleParser=require(_0x083d('0x3'))[_0x083d('0x4')];var Iconv=require(_0x083d('0x5'))['Iconv'];var EventEmitter=require(_0x083d('0x6'))['EventEmitter'];var utils=require('./utils');var logger=require(_0x083d('0x7'))(_0x083d('0x8'));function EmailImap(_0x3c4b8c,_0x2e75e8){this[_0x083d('0x9')]='INBOX';this['account']=this[_0x083d('0xa')](_0x3c4b8c,_0x2e75e8);this[_0x083d('0x2')]=new Imap(this[_0x083d('0xb')]);this['imap'][_0x083d('0xc')](_0x083d('0xd'),this[_0x083d('0xe')][_0x083d('0xf')](this));this['imap'][_0x083d('0xc')]('end',this[_0x083d('0x10')][_0x083d('0xf')](this));this['imap']['on'](_0x083d('0x11'),this[_0x083d('0x12')][_0x083d('0xf')](this));this[_0x083d('0x2')][_0x083d('0x13')]();}util['inherits'](EmailImap,EventEmitter);EmailImap[_0x083d('0x14')][_0x083d('0xa')]=function(_0x4ee93c,_0x11c03f){var _0x525a36={'connTimeout':_0x4ee93c['connTimeout']?_0x4ee93c[_0x083d('0x15')]*0x3e8:0x2710,'authTimeout':_0x4ee93c[_0x083d('0x16')]?_0x4ee93c[_0x083d('0x16')]*0x3e8:0x1388};if(_0x4ee93c[_0x083d('0x17')]){_0x525a36[_0x083d('0x18')]=_0x4ee93c['user'];_0x525a36[_0x083d('0x8')]=_0x11c03f||_0x4ee93c['user']||_0x083d('0x19');if(_0x4ee93c[_0x083d('0x1a')]){_0x525a36[_0x083d('0x1b')]=utils[_0x083d('0x1c')](_0x4ee93c[_0x083d('0x1d')][_0x083d('0x1e')],_0x4ee93c[_0x083d('0x18')]);}else{_0x525a36[_0x083d('0x1f')]=_0x4ee93c[_0x083d('0x1f')];}}else{if(_0x4ee93c[_0x083d('0x20')]){_0x525a36[_0x083d('0x18')]=_0x4ee93c[_0x083d('0x18')];_0x525a36['password']=_0x4ee93c[_0x083d('0x1f')];}}_0x525a36['host']=_0x4ee93c[_0x083d('0x21')];_0x525a36[_0x083d('0x22')]=_0x4ee93c['port']||0x3e1;if(_0x4ee93c[_0x083d('0x23')]){_0x525a36['tls']=!![];}else{_0x525a36['tls']=![];_0x525a36['autotls']=_0x083d('0x24');}return _0x525a36;};EmailImap[_0x083d('0x14')][_0x083d('0xe')]=function(){this[_0x083d('0x2')][_0x083d('0x25')](this[_0x083d('0x9')],![],this['handleOpenBox'][_0x083d('0xf')](this));};EmailImap[_0x083d('0x14')]['handleOpenBox']=function(_0x3a0ce2,_0x38ca23){if(_0x3a0ce2){this[_0x083d('0x12')](_0x3a0ce2,!![]);}else{this[_0x083d('0x26')](_0x083d('0x27'),_0x38ca23);this[_0x083d('0x28')]();}};EmailImap[_0x083d('0x14')][_0x083d('0x29')]=function(_0x552bc9){if(_0x552bc9){this[_0x083d('0x12')](_0x552bc9,!![]);}else{this['imap'][_0x083d('0x2a')]();}};EmailImap[_0x083d('0x14')][_0x083d('0x28')]=function(){this[_0x083d('0x2')][_0x083d('0x2b')]([_0x083d('0x2c')],this[_0x083d('0x2d')][_0x083d('0xf')](this));};EmailImap[_0x083d('0x14')][_0x083d('0x2d')]=function(_0x2d9202,_0x24c32c){if(_0x2d9202){this[_0x083d('0x12')](_0x2d9202,!![]);}else{if(_0x24c32c[_0x083d('0x2e')]){try{var _0x28b90e=this['imap'][_0x083d('0x2f')](_0x24c32c,{'bodies':'','markSeen':!![]});_0x28b90e['on'](_0x083d('0x30'),this['handleFetchMessage']['bind'](this));_0x28b90e[_0x083d('0xc')]('error',this[_0x083d('0x31')]['bind'](this));_0x28b90e[_0x083d('0xc')]('end',this[_0x083d('0x32')][_0x083d('0xf')](this));}catch(_0x3ab8cd){logger['error'](_0x3ab8cd);}}else{this['imap'][_0x083d('0x33')](!![],this['handleCloseBox'][_0x083d('0xf')](this));}}};EmailImap[_0x083d('0x14')][_0x083d('0x34')]=function(_0x3065c7){_0x3065c7['on']('body',this[_0x083d('0x35')][_0x083d('0xf')](this));_0x3065c7[_0x083d('0xc')](_0x083d('0x36'),this['handleMessageAttributes'][_0x083d('0xf')](this));_0x3065c7[_0x083d('0xc')](_0x083d('0x2a'),this[_0x083d('0x37')]['bind'](this));};EmailImap['prototype'][_0x083d('0x35')]=function(_0x7ae2c4){simpleParser(_0x7ae2c4,{'Iconv':Iconv},this[_0x083d('0x38')][_0x083d('0xf')](this));};EmailImap[_0x083d('0x14')]['handleMessageAttributes']=function(){};EmailImap[_0x083d('0x14')][_0x083d('0x37')]=function(){};EmailImap['prototype'][_0x083d('0x38')]=function(_0x5d00dc,_0x58c1a0){if(_0x5d00dc){logger[_0x083d('0x11')](_0x5d00dc);}else{var _0x3645f3=this;utils['parser'](this[_0x083d('0xb')],_0x58c1a0,function(_0x1b282f){_0x3645f3[_0x083d('0x26')]('email',_0x1b282f);});}};EmailImap['prototype']['handleFetchEnd']=function(){this['imap'][_0x083d('0x33')](!![],this[_0x083d('0x29')][_0x083d('0xf')](this));};EmailImap[_0x083d('0x14')]['handleFetchError']=function(_0x5ad9f2){this[_0x083d('0x12')](_0x5ad9f2);this['imap'][_0x083d('0x33')](!![],this[_0x083d('0x29')][_0x083d('0xf')](this));};EmailImap[_0x083d('0x14')][_0x083d('0x10')]=function(){this[_0x083d('0x26')](_0x083d('0x2a'));};EmailImap[_0x083d('0x14')]['handleError']=function(_0x38de47,_0x3e6604){logger[_0x083d('0x11')](_0x083d('0x12'),this[_0x083d('0xb')][_0x083d('0x8')],JSON[_0x083d('0x39')](_0x38de47));var _0x56fb85='';if(_0x38de47){if(_0x38de47[_0x083d('0x3a')]){_0x56fb85=_0x38de47[_0x083d('0x3a')];}else{for(var _0x5656ea in _0x38de47){if(_0x38de47[_0x083d('0x3b')](_0x5656ea)){_0x56fb85+=_[_0x083d('0x3c')](_0x5656ea)+':\x20'+_0x38de47[_0x5656ea]+'\x0a';}}}}if(_0x3e6604){this[_0x083d('0x2')][_0x083d('0x2a')]();}else{this[_0x083d('0x26')]('error',_0x56fb85);this[_0x083d('0x26')](_0x083d('0x2a'));}};module[_0x083d('0x3d')]=EmailImap;
\ No newline at end of file
index 5c378c0..72a1d82 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3133=['prototype','send','createTransport','use','sendMail','verify','Not\x20verifired','exports','nodemailer','nodemailer-plugin-inline-base64'];(function(_0x45531b,_0x1d0d9a){var _0x1c8f24=function(_0x45f16d){while(--_0x45f16d){_0x45531b['push'](_0x45531b['shift']());}};_0x1c8f24(++_0x1d0d9a);}(_0x3133,0x120));var _0x3313=function(_0x2e9b5f,_0x42c059){_0x2e9b5f=_0x2e9b5f-0x0;var _0x5173b6=_0x3133[_0x2e9b5f];return _0x5173b6;};'use strict';var nodemailer=require(_0x3313('0x0'));var inlineBase64=require(_0x3313('0x1'));function EmailSmtp(){}EmailSmtp[_0x3313('0x2')][_0x3313('0x3')]=function(_0x1641af,_0xb34451){return new Promise(function(_0x2e74c2,_0x1706a7){var _0x5d0a33=nodemailer[_0x3313('0x4')](_0x1641af);_0x5d0a33[_0x3313('0x5')]('compile',inlineBase64());_0x5d0a33[_0x3313('0x6')](_0xb34451,function(_0x371a1a,_0x2c48e8){if(_0x371a1a){_0x1706a7(_0x371a1a['toString']());}else{_0x2e74c2(_0x2c48e8);}});});};EmailSmtp[_0x3313('0x2')]['verify']=function(_0x5d41e8){return new Promise(function(_0x5e1848,_0xb3692a){var _0x10248a=nodemailer[_0x3313('0x4')](_0x5d41e8);_0x10248a[_0x3313('0x7')](function(_0x57a982,_0x35d1ca){if(_0x57a982){_0xb3692a(_0x57a982['toString']());}else{if(_0x35d1ca){_0x5e1848(_0x35d1ca);}else{_0xb3692a(_0x3313('0x8'));}}});});};module[_0x3313('0x9')]=EmailSmtp;
\ No newline at end of file
+var _0x407e=['nodemailer','send','createTransport','use','compile','sendMail','prototype','verify','toString','exports'];(function(_0x4c1680,_0x43f1da){var _0x3291c9=function(_0x1f281d){while(--_0x1f281d){_0x4c1680['push'](_0x4c1680['shift']());}};_0x3291c9(++_0x43f1da);}(_0x407e,0x1f4));var _0xe407=function(_0x114bdf,_0x119ada){_0x114bdf=_0x114bdf-0x0;var _0x5658f6=_0x407e[_0x114bdf];return _0x5658f6;};'use strict';var nodemailer=require(_0xe407('0x0'));var inlineBase64=require('nodemailer-plugin-inline-base64');function EmailSmtp(){}EmailSmtp['prototype'][_0xe407('0x1')]=function(_0x4225c7,_0x2aa6d2){return new Promise(function(_0xc7fdbd,_0x4b705f){var _0x2236eb=nodemailer[_0xe407('0x2')](_0x4225c7);_0x2236eb[_0xe407('0x3')](_0xe407('0x4'),inlineBase64());_0x2236eb[_0xe407('0x5')](_0x2aa6d2,function(_0x593ccd,_0x4ae659){if(_0x593ccd){_0x4b705f(_0x593ccd['toString']());}else{_0xc7fdbd(_0x4ae659);}});});};EmailSmtp[_0xe407('0x6')][_0xe407('0x7')]=function(_0x4ffbc7){return new Promise(function(_0x2d5ea1,_0x2af540){var _0x36a72a=nodemailer[_0xe407('0x2')](_0x4ffbc7);_0x36a72a[_0xe407('0x7')](function(_0x1cfd53,_0x987820){if(_0x1cfd53){_0x2af540(_0x1cfd53[_0xe407('0x8')]());}else{if(_0x987820){_0x2d5ea1(_0x987820);}else{_0x2af540('Not\x20verifired');}}});});};module[_0xe407('0x9')]=EmailSmtp;
\ No newline at end of file
index c78aa81..9e5285c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9726=['substring','split','length','slice','join','Anonymous','pop','anonymous','html','test','<img','attachments','forEach','push','filename','replace','_SRC','_IMG','<span\x20style=font-weight:bold>\x20[Attachment:\x20','\x20]</span>','body','textAsHtml','<a\x20target=\x22_blank\x22\x20','originTo','message','originCc','isEmpty','includes','bcc','attachment','attachment-','format','%s-%s','now','root','server/files/attachments/','writeFileSync','contentType','headerLines','X-Auto-Response-Suppress:\x20All','indexOf','line','parser','from','subject','messageId','inReplyTo','filter','application/ms-tnef','info','parseBuffer','first','content','<p>Empty\x20message</p>','Attachments','Title','Data','auth=Bearer\x20','utf-8','toString','base64','lodash','path','util','email','head','value','address','generate','@xcally.com','name'];(function(_0x5e1ced,_0x1ca067){var _0x36ea9d=function(_0x57e1c7){while(--_0x57e1c7){_0x5e1ced['push'](_0x5e1ced['shift']());}};_0x36ea9d(++_0x1ca067);}(_0x9726,0x1a0));var _0x6972=function(_0x44a85f,_0x1ee66a){_0x44a85f=_0x44a85f-0x0;var _0xa4a6e8=_0x9726[_0x44a85f];return _0xa4a6e8;};'use strict';var _=require(_0x6972('0x0'));var moment=require('moment');var random=require('randomstring');var fs=require('fs');var path=require(_0x6972('0x1'));var util=require(_0x6972('0x2'));var tnef=require('node-tnef');var logger=require('../../../config/logger')(_0x6972('0x3'));var config=require('../../../config/environment');function getAddress(_0x19fff0){var _0x29318a=_[_0x6972('0x4')](_0x19fff0[_0x6972('0x5')]);return _0x29318a&&_0x29318a[_0x6972('0x6')]?_0x29318a[_0x6972('0x6')]:'anonymous'+random[_0x6972('0x7')](0x6)+_0x6972('0x8');}function getFirstName(_0x5a83bf){var _0x208c2a=_[_0x6972('0x4')](_0x5a83bf[_0x6972('0x5')]);if(_0x208c2a&&_0x208c2a['name']){if(_0x208c2a[_0x6972('0x9')]==_0x208c2a['address']){return _0x208c2a[_0x6972('0x9')][_0x6972('0xa')](0x0,_0x208c2a[_0x6972('0x9')]['indexOf']('@'));}var _0x119c91=_0x208c2a[_0x6972('0x9')][_0x6972('0xb')](/\s+/);return _0x119c91[_0x6972('0xc')]>0x1?_0x119c91[_0x6972('0xd')](0x0,-0x1)[_0x6972('0xe')]('\x20'):_0x208c2a[_0x6972('0x9')];}return _0x6972('0xf');}function getLastName(_0x3882fd){var _0x333d4d=_[_0x6972('0x4')](_0x3882fd[_0x6972('0x5')]);if(_0x333d4d&&_0x333d4d[_0x6972('0x9')]){var _0x32cf51=_0x333d4d[_0x6972('0x9')][_0x6972('0xb')](/\s+/);return _0x32cf51[_0x6972('0xc')]>0x1?_0x32cf51[_0x6972('0x10')]():'';}return'';}function getMails(_0x3e154a,_0x5e41e8){var _0x83cd3e='';for(var _0x38ea03=0x0;_0x38ea03<_0x5e41e8[_0x6972('0x5')]['length'];_0x38ea03+=0x1){if(_0x5e41e8[_0x6972('0x5')][_0x38ea03][_0x6972('0x6')]!==_0x3e154a){if(!_['isEmpty'](_0x83cd3e)){_0x83cd3e+=',';}_0x83cd3e+=_0x5e41e8[_0x6972('0x5')][_0x38ea03][_0x6972('0x9')]||_0x5e41e8[_0x6972('0x5')][_0x38ea03][_0x6972('0x6')]||'';_0x83cd3e+='\x20<';_0x83cd3e+=_0x5e41e8[_0x6972('0x5')][_0x38ea03][_0x6972('0x6')]?_0x5e41e8[_0x6972('0x5')][_0x38ea03]['address']:_0x6972('0x11')+random[_0x6972('0x7')](0x6)+_0x6972('0x8');_0x83cd3e+='>';}}return _0x83cd3e;}function parseEmail(_0x369a15,_0x3abb6d,_0x1905a5){if(_0x3abb6d[_0x6972('0x12')]){var _0x5a0af3=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi;while(_0x5a0af3[_0x6972('0x13')](_0x3abb6d[_0x6972('0x12')])){_0x3abb6d[_0x6972('0x12')]=_0x3abb6d['html']['replace'](_0x5a0af3,'');}if(_0x3abb6d[_0x6972('0x12')]['includes'](_0x6972('0x14'))){var _0x92936b=[];_0x3abb6d[_0x6972('0x15')][_0x6972('0x16')](_0x184930=>{_0x92936b[_0x6972('0x17')](_0x184930[_0x6972('0x18')]);});var _0x418fa4=/<img.*? _SRC(.*?)[^>]+>/g;var _0x93eb9f=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x47432b=_0x3abb6d[_0x6972('0x12')][_0x6972('0x19')](_0x93eb9f,_0x6972('0x1a'));var _0x556368=_0x47432b[_0x6972('0x19')](_0x418fa4,_0x6972('0x1b'));for(let _0x2cd1e2=0x0;_0x2cd1e2<_0x92936b[_0x6972('0xc')];_0x2cd1e2++){var _0x1eb0ac=_0x556368[_0x6972('0x19')](_0x6972('0x1b'),_0x6972('0x1c')+_0x92936b[_0x2cd1e2]+_0x6972('0x1d'));_0x556368=_0x1eb0ac;}_0x3abb6d[_0x6972('0x12')]=_0x556368;}_0x1905a5[_0x6972('0x1e')]=_0x3abb6d[_0x6972('0x12')];}else{_0x1905a5[_0x6972('0x1e')]=_0x3abb6d[_0x6972('0x1f')];}if(_0x1905a5[_0x6972('0x1e')]){_0x1905a5[_0x6972('0x1e')]=_0x1905a5[_0x6972('0x1e')]['replace'](/<a\s+/gi,_0x6972('0x20'));}if(_0x3abb6d['to']){_0x1905a5['message'][_0x6972('0x21')]=getMails(null,_0x3abb6d['to']);var _0xd5b2e9=getMails(_0x369a15[_0x6972('0x3')],_0x3abb6d['to']);if(!_['isEmpty'](_0xd5b2e9)){_0x1905a5[_0x6972('0x22')]['cc']+=_0xd5b2e9;}}if(_0x3abb6d['cc']){_0x1905a5[_0x6972('0x22')][_0x6972('0x23')]=getMails(null,_0x3abb6d['cc']);var _0x5bc45c=getMails(_0x369a15[_0x6972('0x3')],_0x3abb6d['cc']);if(!_[_0x6972('0x24')](_0x5bc45c)){if(!_['isEmpty'](_0x1905a5[_0x6972('0x22')]['cc'])){_0x1905a5['message']['cc']+=',';}_0x1905a5[_0x6972('0x22')]['cc']+=_0x5bc45c;}}if(!_[_0x6972('0x25')](_0x1905a5[_0x6972('0x22')][_0x6972('0x21')],_0x369a15[_0x6972('0x3')])&&!_[_0x6972('0x25')](_0x1905a5[_0x6972('0x22')][_0x6972('0x23')],_0x369a15[_0x6972('0x3')])){_0x1905a5['message'][_0x6972('0x26')]=_0x369a15[_0x6972('0x3')];}if(_0x3abb6d['attachments']&&_0x3abb6d[_0x6972('0x15')][_0x6972('0xc')]){_0x1905a5[_0x6972('0x22')]['attach']=_0x3abb6d[_0x6972('0x15')][_0x6972('0xc')];for(var _0x9b3e93=0x0,_0x10b8ae,_0x455d8e,_0x11db64;_0x9b3e93<_0x3abb6d['attachments'][_0x6972('0xc')];_0x9b3e93+=0x1){if(_0x3abb6d['attachments'][_0x9b3e93]['type']===_0x6972('0x27')){_0x11db64=_0x3abb6d[_0x6972('0x15')][_0x9b3e93][_0x6972('0x18')]||_0x6972('0x28')+_0x9b3e93;_0x10b8ae=util[_0x6972('0x29')](_0x6972('0x2a'),Date[_0x6972('0x2b')](),_0x11db64);_0x455d8e=path['join'](config[_0x6972('0x2c')],_0x6972('0x2d'),_0x10b8ae);fs[_0x6972('0x2e')](_0x455d8e,_0x3abb6d['attachments'][_0x9b3e93]['content']);_0x1905a5[_0x6972('0x22')][_0x6972('0x15')]['push']({'name':_0x11db64,'basename':_0x10b8ae,'type':_0x3abb6d[_0x6972('0x15')][_0x9b3e93][_0x6972('0x2f')],'filepath':_0x455d8e});}}}if(_0x3abb6d[_0x6972('0x30')]&&_0x3abb6d[_0x6972('0x30')][_0x6972('0xc')]>0x0){var _0x473e85=['Auto-Submitted:\x20auto-replied',_0x6972('0x31'),'Precedence:\x20auto_reply'];for(var _0x41db8d=0x0;_0x41db8d<_0x3abb6d['headerLines']['length'];_0x41db8d++){var _0xa9828b=_[_0x6972('0x32')](_0x473e85,_0x3abb6d[_0x6972('0x30')][_0x41db8d][_0x6972('0x33')]);if(_0xa9828b>=0x0){_0x1905a5['isAutoreply']=!![];}}}return _0x1905a5;}exports[_0x6972('0x34')]=function(_0x40acbd,_0x2a7134,_0xd29b21){var _0x3ef319={'from':getAddress(_0x2a7134['from']),'firstName':getFirstName(_0x2a7134[_0x6972('0x35')]),'lastName':getLastName(_0x2a7134[_0x6972('0x35')]),'mapKey':_0x6972('0x3'),'message':{'from':getMails(_0x40acbd[_0x6972('0x3')],_0x2a7134[_0x6972('0x35')]),'to':_0x40acbd['email'],'cc':'','subject':_0x2a7134[_0x6972('0x36')]||'','messageId':_0x2a7134[_0x6972('0x37')],'inReplyTo':_0x2a7134[_0x6972('0x38')],'sentAt':moment(_0x2a7134['date'])[_0x6972('0x29')]('YYYY-MM-DD\x20HH:mm:ss'),'attach':![],'attachments':[]}};if(!_0x2a7134[_0x6972('0x12')]&&!_0x2a7134[_0x6972('0x1f')]){var _0x2303c1=_[_0x6972('0x39')](_0x2a7134[_0x6972('0x15')],{'contentType':_0x6972('0x3a')});if(_0x2303c1['length']){logger[_0x6972('0x3b')](util['format']('Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system',_0x2a7134[_0x6972('0x37')]));tnef[_0x6972('0x3c')](_[_0x6972('0x3d')](_0x2303c1)[_0x6972('0x3e')],function(_0x4757dc,_0x20c1ff){if(_0x20c1ff){_0x2a7134[_0x6972('0x12')]=_0x20c1ff['BodyHTML']||_0x6972('0x3f');if(_0x20c1ff[_0x6972('0x40')]){for(var _0x266e48=0x0;_0x266e48<_0x20c1ff[_0x6972('0x40')][_0x6972('0xc')];_0x266e48++){var _0x15e5e0=_0x20c1ff[_0x6972('0x40')][_0x266e48];_0x3ef319[_0x6972('0x22')][_0x6972('0x15')][_0x6972('0x17')]({'filename':_0x15e5e0[_0x6972('0x41')],'content':Buffer[_0x6972('0x35')](_0x15e5e0[_0x6972('0x42')])});}}}_0xd29b21(parseEmail(_0x40acbd,_0x2a7134,_0x3ef319));});}else{_0x2a7134[_0x6972('0x12')]=_0x6972('0x3f');_0xd29b21(parseEmail(_0x40acbd,_0x2a7134,_0x3ef319));}}else{_0xd29b21(parseEmail(_0x40acbd,_0x2a7134,_0x3ef319));}};exports['generateXOAuth2Token']=function(_0x4dd65a,_0x2ee059){var _0x352400=['user='+(_0x2ee059||''),_0x6972('0x43')+_0x4dd65a,'',''];return Buffer[_0x6972('0x35')](_0x352400[_0x6972('0xe')]('\ 1'),_0x6972('0x44'))[_0x6972('0x45')](_0x6972('0x46'));};
\ No newline at end of file
+var _0x27d3=['content','headerLines','Auto-Submitted:\x20auto-replied','line','isAutoreply','parser','from','subject','inReplyTo','date','YYYY-MM-DD\x20HH:mm:ss','application/ms-tnef','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','BodyHTML','<p>Empty\x20message</p>','Attachments','Title','Data','generateXOAuth2Token','user=','auth=Bearer\x20','utf-8','toString','base64','lodash','moment','randomstring','path','util','node-tnef','../../../config/logger','email','../../../config/environment','head','value','address','generate','name','substring','indexOf','split','join','length','pop','@xcally.com','html','replace','includes','<img','attachments','forEach','push','filename','_SRC','_IMG','<span\x20style=font-weight:bold>\x20[Attachment:\x20','\x20]</span>','body','textAsHtml','<a\x20target=\x22_blank\x22\x20','message','originTo','isEmpty','originCc','attach','attachment','attachment-','format','%s-%s','server/files/attachments/','writeFileSync'];(function(_0x243b2f,_0x30aa15){var _0xcb3c2d=function(_0x213bb2){while(--_0x213bb2){_0x243b2f['push'](_0x243b2f['shift']());}};_0xcb3c2d(++_0x30aa15);}(_0x27d3,0x17b));var _0x327d=function(_0x42bc91,_0x41f40a){_0x42bc91=_0x42bc91-0x0;var _0x3f5507=_0x27d3[_0x42bc91];return _0x3f5507;};'use strict';var _=require(_0x327d('0x0'));var moment=require(_0x327d('0x1'));var random=require(_0x327d('0x2'));var fs=require('fs');var path=require(_0x327d('0x3'));var util=require(_0x327d('0x4'));var tnef=require(_0x327d('0x5'));var logger=require(_0x327d('0x6'))(_0x327d('0x7'));var config=require(_0x327d('0x8'));function getAddress(_0x436f97){var _0x30f595=_[_0x327d('0x9')](_0x436f97[_0x327d('0xa')]);return _0x30f595&&_0x30f595['address']?_0x30f595[_0x327d('0xb')]:'anonymous'+random[_0x327d('0xc')](0x6)+'@xcally.com';}function getFirstName(_0x1ac622){var _0x2a68dc=_[_0x327d('0x9')](_0x1ac622['value']);if(_0x2a68dc&&_0x2a68dc[_0x327d('0xd')]){if(_0x2a68dc['name']==_0x2a68dc['address']){return _0x2a68dc['name'][_0x327d('0xe')](0x0,_0x2a68dc['name'][_0x327d('0xf')]('@'));}var _0x4eac97=_0x2a68dc['name'][_0x327d('0x10')](/\s+/);return _0x4eac97['length']>0x1?_0x4eac97['slice'](0x0,-0x1)[_0x327d('0x11')]('\x20'):_0x2a68dc[_0x327d('0xd')];}return'Anonymous';}function getLastName(_0x42db2f){var _0x4ca372=_[_0x327d('0x9')](_0x42db2f[_0x327d('0xa')]);if(_0x4ca372&&_0x4ca372[_0x327d('0xd')]){var _0x48913e=_0x4ca372['name'][_0x327d('0x10')](/\s+/);return _0x48913e[_0x327d('0x12')]>0x1?_0x48913e[_0x327d('0x13')]():'';}return'';}function getMails(_0x4d80c7,_0x1b788a){var _0x183f49='';for(var _0x1a0328=0x0;_0x1a0328<_0x1b788a[_0x327d('0xa')]['length'];_0x1a0328+=0x1){if(_0x1b788a[_0x327d('0xa')][_0x1a0328][_0x327d('0xb')]!==_0x4d80c7){if(!_['isEmpty'](_0x183f49)){_0x183f49+=',';}_0x183f49+=_0x1b788a[_0x327d('0xa')][_0x1a0328][_0x327d('0xd')]||_0x1b788a[_0x327d('0xa')][_0x1a0328][_0x327d('0xb')]||'';_0x183f49+='\x20<';_0x183f49+=_0x1b788a['value'][_0x1a0328]['address']?_0x1b788a['value'][_0x1a0328][_0x327d('0xb')]:'anonymous'+random[_0x327d('0xc')](0x6)+_0x327d('0x14');_0x183f49+='>';}}return _0x183f49;}function parseEmail(_0x3a05c7,_0x16dbf8,_0x16761){if(_0x16dbf8[_0x327d('0x15')]){var _0x12ad72=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi;while(_0x12ad72['test'](_0x16dbf8[_0x327d('0x15')])){_0x16dbf8[_0x327d('0x15')]=_0x16dbf8[_0x327d('0x15')][_0x327d('0x16')](_0x12ad72,'');}if(_0x16dbf8[_0x327d('0x15')][_0x327d('0x17')](_0x327d('0x18'))){var _0x369c85=[];_0x16dbf8[_0x327d('0x19')][_0x327d('0x1a')](_0x2e4688=>{_0x369c85[_0x327d('0x1b')](_0x2e4688[_0x327d('0x1c')]);});var _0x3c1d41=/<img.*? _SRC(.*?)[^>]+>/g;var _0xcb9a23=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x2286f3=_0x16dbf8['html'][_0x327d('0x16')](_0xcb9a23,_0x327d('0x1d'));var _0x426ad=_0x2286f3['replace'](_0x3c1d41,_0x327d('0x1e'));for(let _0x37049b=0x0;_0x37049b<_0x369c85[_0x327d('0x12')];_0x37049b++){var _0x5da08d=_0x426ad[_0x327d('0x16')]('_IMG',_0x327d('0x1f')+_0x369c85[_0x37049b]+_0x327d('0x20'));_0x426ad=_0x5da08d;}_0x16dbf8['html']=_0x426ad;}_0x16761[_0x327d('0x21')]=_0x16dbf8[_0x327d('0x15')];}else{_0x16761[_0x327d('0x21')]=_0x16dbf8[_0x327d('0x22')];}if(_0x16761[_0x327d('0x21')]){_0x16761[_0x327d('0x21')]=_0x16761[_0x327d('0x21')][_0x327d('0x16')](/<a\s+/gi,_0x327d('0x23'));}if(_0x16dbf8['to']){_0x16761[_0x327d('0x24')][_0x327d('0x25')]=getMails(null,_0x16dbf8['to']);var _0x21c5de=getMails(_0x3a05c7[_0x327d('0x7')],_0x16dbf8['to']);if(!_[_0x327d('0x26')](_0x21c5de)){_0x16761['message']['cc']+=_0x21c5de;}}if(_0x16dbf8['cc']){_0x16761['message'][_0x327d('0x27')]=getMails(null,_0x16dbf8['cc']);var _0x2e06b9=getMails(_0x3a05c7['email'],_0x16dbf8['cc']);if(!_[_0x327d('0x26')](_0x2e06b9)){if(!_[_0x327d('0x26')](_0x16761['message']['cc'])){_0x16761[_0x327d('0x24')]['cc']+=',';}_0x16761[_0x327d('0x24')]['cc']+=_0x2e06b9;}}if(!_[_0x327d('0x17')](_0x16761[_0x327d('0x24')][_0x327d('0x25')],_0x3a05c7['email'])&&!_['includes'](_0x16761[_0x327d('0x24')][_0x327d('0x27')],_0x3a05c7[_0x327d('0x7')])){_0x16761[_0x327d('0x24')]['bcc']=_0x3a05c7[_0x327d('0x7')];}if(_0x16dbf8[_0x327d('0x19')]&&_0x16dbf8[_0x327d('0x19')][_0x327d('0x12')]){_0x16761['message'][_0x327d('0x28')]=_0x16dbf8[_0x327d('0x19')][_0x327d('0x12')];for(var _0x36fe37=0x0,_0x228b9d,_0x2c5cff,_0x3c7609;_0x36fe37<_0x16dbf8[_0x327d('0x19')][_0x327d('0x12')];_0x36fe37+=0x1){if(_0x16dbf8[_0x327d('0x19')][_0x36fe37]['type']===_0x327d('0x29')){_0x3c7609=_0x16dbf8[_0x327d('0x19')][_0x36fe37][_0x327d('0x1c')]||_0x327d('0x2a')+_0x36fe37;_0x228b9d=util[_0x327d('0x2b')](_0x327d('0x2c'),Date['now'](),_0x3c7609);_0x2c5cff=path[_0x327d('0x11')](config['root'],_0x327d('0x2d'),_0x228b9d);fs[_0x327d('0x2e')](_0x2c5cff,_0x16dbf8[_0x327d('0x19')][_0x36fe37][_0x327d('0x2f')]);_0x16761[_0x327d('0x24')][_0x327d('0x19')][_0x327d('0x1b')]({'name':_0x3c7609,'basename':_0x228b9d,'type':_0x16dbf8[_0x327d('0x19')][_0x36fe37]['contentType'],'filepath':_0x2c5cff});}}}if(_0x16dbf8['headerLines']&&_0x16dbf8[_0x327d('0x30')][_0x327d('0x12')]>0x0){var _0x711a8e=[_0x327d('0x31'),'X-Auto-Response-Suppress:\x20All','Precedence:\x20auto_reply'];for(var _0x468b3c=0x0;_0x468b3c<_0x16dbf8[_0x327d('0x30')][_0x327d('0x12')];_0x468b3c++){var _0x2294b0=_[_0x327d('0xf')](_0x711a8e,_0x16dbf8[_0x327d('0x30')][_0x468b3c][_0x327d('0x32')]);if(_0x2294b0>=0x0){_0x16761[_0x327d('0x33')]=!![];}}}return _0x16761;}exports[_0x327d('0x34')]=function(_0xc0ec29,_0x29a27e,_0x1f3543){var _0x1d72bd={'from':getAddress(_0x29a27e[_0x327d('0x35')]),'firstName':getFirstName(_0x29a27e['from']),'lastName':getLastName(_0x29a27e['from']),'mapKey':_0x327d('0x7'),'message':{'from':getMails(_0xc0ec29[_0x327d('0x7')],_0x29a27e[_0x327d('0x35')]),'to':_0xc0ec29[_0x327d('0x7')],'cc':'','subject':_0x29a27e[_0x327d('0x36')]||'','messageId':_0x29a27e['messageId'],'inReplyTo':_0x29a27e[_0x327d('0x37')],'sentAt':moment(_0x29a27e[_0x327d('0x38')])[_0x327d('0x2b')](_0x327d('0x39')),'attach':![],'attachments':[]}};if(!_0x29a27e[_0x327d('0x15')]&&!_0x29a27e[_0x327d('0x22')]){var _0x14a3f3=_['filter'](_0x29a27e[_0x327d('0x19')],{'contentType':_0x327d('0x3a')});if(_0x14a3f3[_0x327d('0x12')]){logger['info'](util[_0x327d('0x2b')](_0x327d('0x3b'),_0x29a27e['messageId']));tnef['parseBuffer'](_['first'](_0x14a3f3)['content'],function(_0x3d8296,_0x14668d){if(_0x14668d){_0x29a27e[_0x327d('0x15')]=_0x14668d[_0x327d('0x3c')]||_0x327d('0x3d');if(_0x14668d[_0x327d('0x3e')]){for(var _0x45f5e1=0x0;_0x45f5e1<_0x14668d['Attachments']['length'];_0x45f5e1++){var _0x9125d1=_0x14668d[_0x327d('0x3e')][_0x45f5e1];_0x1d72bd[_0x327d('0x24')][_0x327d('0x19')][_0x327d('0x1b')]({'filename':_0x9125d1[_0x327d('0x3f')],'content':Buffer[_0x327d('0x35')](_0x9125d1[_0x327d('0x40')])});}}}_0x1f3543(parseEmail(_0xc0ec29,_0x29a27e,_0x1d72bd));});}else{_0x29a27e[_0x327d('0x15')]=_0x327d('0x3d');_0x1f3543(parseEmail(_0xc0ec29,_0x29a27e,_0x1d72bd));}}else{_0x1f3543(parseEmail(_0xc0ec29,_0x29a27e,_0x1d72bd));}};exports[_0x327d('0x41')]=function(_0x555170,_0x54d63e){var _0x238c66=[_0x327d('0x42')+(_0x54d63e||''),_0x327d('0x43')+_0x555170,'',''];return Buffer[_0x327d('0x35')](_0x238c66[_0x327d('0x11')]('\ 1'),_0x327d('0x44'))[_0x327d('0x45')](_0x327d('0x46'));};
\ No newline at end of file
index 980a3c3..5b68ed4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2388=['Smtp','exports','lodash','name','Service','key','SERV','active','Imap'];(function(_0x179b74,_0x5dc97d){var _0x268f76=function(_0x19c8c2){while(--_0x19c8c2){_0x179b74['push'](_0x179b74['shift']());}};_0x268f76(++_0x5dc97d);}(_0x2388,0xd1));var _0x8238=function(_0x5b5689,_0x51f75c){_0x5b5689=_0x5b5689-0x0;var _0x3c287e=_0x2388[_0x5b5689];return _0x3c287e;};'use strict';var _=require(_0x8238('0x0'));function MailAccount(_0x5eaff1){this['id']=_0x5eaff1['id']||0x0;this[_0x8238('0x1')]=_0x5eaff1[_0x8238('0x1')]||_0x8238('0x2');this['key']=_0x5eaff1[_0x8238('0x3')]||_0x8238('0x4');this[_0x8238('0x5')]=_0x5eaff1[_0x8238('0x5')]||![];this[_0x8238('0x6')]=_0x5eaff1[_0x8238('0x6')]||[];this[_0x8238('0x7')]=_0x5eaff1[_0x8238('0x7')]||[];}module[_0x8238('0x8')]=MailAccount;
\ No newline at end of file
+var _0x81bf=['key','SERV','Imap','Smtp','exports','lodash','name'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x81bf,0xc9));var _0xf81b=function(_0x479f15,_0x544345){_0x479f15=_0x479f15-0x0;var _0x3455f1=_0x81bf[_0x479f15];return _0x3455f1;};'use strict';var _=require(_0xf81b('0x0'));function MailAccount(_0x42c210){this['id']=_0x42c210['id']||0x0;this[_0xf81b('0x1')]=_0x42c210[_0xf81b('0x1')]||'Service';this[_0xf81b('0x2')]=_0x42c210[_0xf81b('0x2')]||_0xf81b('0x3');this['active']=_0x42c210['active']||![];this[_0xf81b('0x4')]=_0x42c210[_0xf81b('0x4')]||[];this[_0xf81b('0x5')]=_0x42c210[_0xf81b('0x5')]||[];}module[_0xf81b('0x6')]=MailAccount;
\ No newline at end of file
index 02290d0..dd2e113 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe610=['initMailAccounts','merge','exports','../model/mailAccount','mailAccounts','hasOwnProperty','prototype','mergeFromDatabase'];(function(_0xaf5c8f,_0x6f472c){var _0x417460=function(_0x28eb2e){while(--_0x28eb2e){_0xaf5c8f['push'](_0xaf5c8f['shift']());}};_0x417460(++_0x6f472c);}(_0xe610,0x1f3));var _0x0e61=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xe610[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require('lodash');var MailAccount=require(_0x0e61('0x0'));var Realtime=function(){this[_0x0e61('0x1')]={};};function freeIsNotKey(_0x13b591,_0x259f66,_0x26c071){var _0x46c0c5=_['mapKeys'](_0x13b591,function(_0x4d83d0,_0x9079b5){return _0x4d83d0[_0x26c071];});for(var _0x4bc4a9 in _0x259f66){if(_0x259f66[_0x0e61('0x2')](_0x4bc4a9)){if(!_0x46c0c5[_0x4bc4a9]){delete _0x259f66[_0x4bc4a9];}}}}Realtime[_0x0e61('0x3')][_0x0e61('0x4')]=function(_0xe1bf01,_0x40c9c7){for(var _0x249da0 in _0x40c9c7){if(_0xe1bf01[_0x0e61('0x2')](_0x249da0)){_0xe1bf01[_0x249da0]=_0x40c9c7[_0x249da0];}}};Realtime[_0x0e61('0x3')][_0x0e61('0x5')]=function(){var _0xac4dde=this;return function(_0x5bc0aa){if(_0x5bc0aa){freeIsNotKey(_0x5bc0aa,_0xac4dde[_0x0e61('0x1')],'id');for(var _0x312ca8=0x0,_0x48e9b9={},_0x5456ed={};_0x312ca8<_0x5bc0aa['length'];_0x312ca8+=0x1){_0x48e9b9=_0x5bc0aa[_0x312ca8];if(_['isUndefined'](_0xac4dde[_0x0e61('0x1')][_0x48e9b9['id']])){_0xac4dde[_0x0e61('0x1')][_0x48e9b9['id']]=new MailAccount(_0x48e9b9);}else{_[_0x0e61('0x6')](_0xac4dde[_0x0e61('0x1')][_0x48e9b9['id']],_0x48e9b9);}}}return _0xac4dde['mailAccounts'];};};module[_0x0e61('0x7')]=Realtime;
\ No newline at end of file
+var _0xbdbf=['exports','lodash','../model/mailAccount','mailAccounts','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initMailAccounts','length','merge'];(function(_0x5756f8,_0x22b6d5){var _0x3bb749=function(_0x332204){while(--_0x332204){_0x5756f8['push'](_0x5756f8['shift']());}};_0x3bb749(++_0x22b6d5);}(_0xbdbf,0x177));var _0xfbdb=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0xbdbf[_0x4e676e];return _0x336a3c;};'use strict';var _=require(_0xfbdb('0x0'));var MailAccount=require(_0xfbdb('0x1'));var Realtime=function(){this[_0xfbdb('0x2')]={};};function freeIsNotKey(_0x2a5133,_0x4cd02f,_0x6582c7){var _0x34d686=_[_0xfbdb('0x3')](_0x2a5133,function(_0x1625f8,_0x1ac3d4){return _0x1625f8[_0x6582c7];});for(var _0x1d7034 in _0x4cd02f){if(_0x4cd02f[_0xfbdb('0x4')](_0x1d7034)){if(!_0x34d686[_0x1d7034]){delete _0x4cd02f[_0x1d7034];}}}}Realtime[_0xfbdb('0x5')][_0xfbdb('0x6')]=function(_0x2c1bc2,_0x507890){for(var _0x418739 in _0x507890){if(_0x2c1bc2[_0xfbdb('0x4')](_0x418739)){_0x2c1bc2[_0x418739]=_0x507890[_0x418739];}}};Realtime[_0xfbdb('0x5')][_0xfbdb('0x7')]=function(){var _0x2efa83=this;return function(_0x1438c1){if(_0x1438c1){freeIsNotKey(_0x1438c1,_0x2efa83['mailAccounts'],'id');for(var _0x4fbba0=0x0,_0x2f4d87={},_0x5cce2c={};_0x4fbba0<_0x1438c1[_0xfbdb('0x8')];_0x4fbba0+=0x1){_0x2f4d87=_0x1438c1[_0x4fbba0];if(_['isUndefined'](_0x2efa83[_0xfbdb('0x2')][_0x2f4d87['id']])){_0x2efa83[_0xfbdb('0x2')][_0x2f4d87['id']]=new MailAccount(_0x2f4d87);}else{_[_0xfbdb('0x9')](_0x2efa83[_0xfbdb('0x2')][_0x2f4d87['id']],_0x2f4d87);}}}return _0x2efa83[_0xfbdb('0x2')];};};module[_0xfbdb('0xa')]=Realtime;
\ No newline at end of file
index 6be0c3c..371fb16 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3d4b=['TemplateId','MailServerIn','Imap','CloudProvider','service','type','data5','Smtp','getMailAccount','notify','Request','NotifyMailAccount','../client','getMailAccounts','GetMailAccount','name','provider','email','active','key','ListId'];(function(_0x79d22d,_0x4062b7){var _0x15d41d=function(_0x2f5007){while(--_0x2f5007){_0x79d22d['push'](_0x79d22d['shift']());}};_0x15d41d(++_0x4062b7);}(_0x3d4b,0xf3));var _0xb3d4=function(_0x58916b,_0x43fc5d){_0x58916b=_0x58916b-0x0;var _0x238322=_0x3d4b[_0x58916b];return _0x238322;};'use strict';var client=require(_0xb3d4('0x0'));exports[_0xb3d4('0x1')]=function(){return function(){return client['Request'](_0xb3d4('0x2'),{'options':{'attributes':['id',_0xb3d4('0x3'),_0xb3d4('0x4'),'service',_0xb3d4('0x5'),_0xb3d4('0x6'),_0xb3d4('0x7'),_0xb3d4('0x8'),_0xb3d4('0x9')],'raw':![],'include':[{'model':_0xb3d4('0xa'),'as':_0xb3d4('0xb'),'include':[{'model':_0xb3d4('0xc'),'attributes':['id',_0xb3d4('0x3'),_0xb3d4('0xd'),_0xb3d4('0xe'),_0xb3d4('0xf')],'as':'CloudProvider'}]},{'model':'MailServerOut','as':_0xb3d4('0x10'),'include':[{'model':_0xb3d4('0xc'),'attributes':['id',_0xb3d4('0x3'),_0xb3d4('0xd'),'type',_0xb3d4('0xf')],'as':_0xb3d4('0xc')}]}]},'log':_0xb3d4('0x11')});};};exports[_0xb3d4('0x12')]=function(_0x2fd962,_0x1e65fd){return client[_0xb3d4('0x13')](_0xb3d4('0x14'),{'account':{'id':_0x2fd962},'body':_0x1e65fd,'log':_0xb3d4('0x14')});};
\ No newline at end of file
+var _0x5fab=['name','provider','service','email','active','key','ListId','TemplateId','MailServerIn','type','CloudProvider','MailServerOut','Smtp','data5','getMailAccount','notify','Request','NotifyMailAccount','../client','getMailAccounts','GetMailAccount'];(function(_0x574266,_0x52a8fb){var _0x24d5d7=function(_0x537e62){while(--_0x537e62){_0x574266['push'](_0x574266['shift']());}};_0x24d5d7(++_0x52a8fb);}(_0x5fab,0x177));var _0xb5fa=function(_0xd0255a,_0x5ba91a){_0xd0255a=_0xd0255a-0x0;var _0x265f2d=_0x5fab[_0xd0255a];return _0x265f2d;};'use strict';var client=require(_0xb5fa('0x0'));exports[_0xb5fa('0x1')]=function(){return function(){return client['Request'](_0xb5fa('0x2'),{'options':{'attributes':['id',_0xb5fa('0x3'),_0xb5fa('0x4'),_0xb5fa('0x5'),_0xb5fa('0x6'),_0xb5fa('0x7'),_0xb5fa('0x8'),_0xb5fa('0x9'),_0xb5fa('0xa')],'raw':![],'include':[{'model':_0xb5fa('0xb'),'as':'Imap','include':[{'model':'CloudProvider','attributes':['id',_0xb5fa('0x3'),_0xb5fa('0x5'),_0xb5fa('0xc'),'data5'],'as':_0xb5fa('0xd')}]},{'model':_0xb5fa('0xe'),'as':_0xb5fa('0xf'),'include':[{'model':'CloudProvider','attributes':['id','name',_0xb5fa('0x5'),_0xb5fa('0xc'),_0xb5fa('0x10')],'as':_0xb5fa('0xd')}]}]},'log':_0xb5fa('0x11')});};};exports[_0xb5fa('0x12')]=function(_0x65c6b6,_0x46da66){return client[_0xb5fa('0x13')]('NotifyMailAccount',{'account':{'id':_0x65c6b6},'body':_0x46da66,'log':_0xb5fa('0x14')});};
\ No newline at end of file
index 39e3982..7eadb09 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe926=['ShowSetting','loginMailFrequency','GetSettings','getSettings','Request'];(function(_0x4869c0,_0x35eb52){var _0x1c0b59=function(_0x19f1ec){while(--_0x19f1ec){_0x4869c0['push'](_0x4869c0['shift']());}};_0x1c0b59(++_0x35eb52);}(_0xe926,0x15c));var _0x6e92=function(_0x710815,_0x520da8){_0x710815=_0x710815-0x0;var _0x5b3b89=_0xe926[_0x710815];return _0x5b3b89;};'use strict';var client=require('../client');exports[_0x6e92('0x0')]=function(){return client[_0x6e92('0x1')](_0x6e92('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x6e92('0x3')]},'log':_0x6e92('0x4')});};
\ No newline at end of file
+var _0x3eb4=['loginMailFrequency','GetSettings','ShowSetting'];(function(_0x51def7,_0x6341b3){var _0x2550b3=function(_0x127e76){while(--_0x127e76){_0x51def7['push'](_0x51def7['shift']());}};_0x2550b3(++_0x6341b3);}(_0x3eb4,0x68));var _0x43eb=function(_0x54f674,_0x362707){_0x54f674=_0x54f674-0x0;var _0x4bd806=_0x3eb4[_0x54f674];return _0x4bd806;};'use strict';var client=require('../client');exports['getSettings']=function(){return client['Request'](_0x43eb('0x0'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x43eb('0x1')]},'log':_0x43eb('0x2')});};
\ No newline at end of file
index d8e59e6..24d5375 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['catch','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','listen','sendMail','then','error','Verified'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xa9e0,0x123));var _0x0a9e=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xa9e0[_0x110c3d];return _0x226d67;};'use strict';var jayson=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var logger=require('../../../config/logger')('email');exports[_0x0a9e('0x3')]=function(_0x4ce2f1,_0x333808){return new BPromise(function(_0x432180,_0x2ab90b){var _0x991246={'SendMail':function(_0x981158){var _0x57b080=this;return new Promise(function(_0x219af0,_0x441e3a){_0x333808[_0x0a9e('0x4')](_0x981158['account'],_0x981158['message'])[_0x0a9e('0x5')](function(_0x56465b){_0x219af0({'code':0xc8,'message':_0x56465b});})['catch'](function(_0x39753a){_0x441e3a(_0x57b080[_0x0a9e('0x6')](0x1f4,_0x39753a));});});},'VerifySmtp':function(_0x307b3e){var _0x3ab53f=this;return new Promise(function(_0xfeb75b,_0xbd1168){_0x333808['verifySmtp'](_0x307b3e['account'])['then'](function(_0x4cfe67){_0xfeb75b({'code':0xc8,'message':_0x0a9e('0x7')});})[_0x0a9e('0x8')](function(_0xd5b662){_0xbd1168(_0x3ab53f[_0x0a9e('0x6')](0x1f4,_0xd5b662));});});},'MailAccounts':function(_0x32d742){return new Promise(function(_0x69aeb7,_0x5db4b0){var _0x4283ce=_[_0x0a9e('0x9')](_0x4ce2f1[_0x0a9e('0xa')]);for(var _0x281129=0x0;_0x281129<_0x4283ce[_0x0a9e('0xb')];_0x281129+=0x1){if(_0x4283ce[_0x281129][_0x0a9e('0xc')]&&_0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')]){delete _0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')];}if(_0x4283ce[_0x281129]['Smtp']&&_0x4283ce[_0x281129][_0x0a9e('0xe')][_0x0a9e('0xf')]){delete _0x4283ce[_0x281129]['Smtp'][_0x0a9e('0xf')];}}_0x69aeb7({'count':_0x4283ce['length'],'rows':_0x4283ce});});}};var _0x459eb1=jayson[_0x0a9e('0x10')](_0x991246)[_0x0a9e('0x11')]();_0x459eb1['on'](_0x0a9e('0x6'),function(_0x31b1ca){logger[_0x0a9e('0x6')](JSON[_0x0a9e('0x12')](_0x31b1ca));return _0x2ab90b(_0x31b1ca);});_0x459eb1[_0x0a9e('0x3')](0x232b,_0x0a9e('0x13'),function(){console[_0x0a9e('0x14')](_0x0a9e('0x15'),0x232b);return _0x432180(_0x0a9e('0x16')+0x232b);});});};
\ No newline at end of file
+var _0xa9e0=['catch','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','listen','sendMail','then','error','Verified'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0xa9e0[_0x5783f4];return _0x28e380;};'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 58a2737..b7bf857 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7081=['listening','log','exports','lodash','sticky-session','ioredis','../../config/environment','createServer','listen','port','socket.io','polling','defaults','localhost','adapter','redis','../../config/triggers','default','../../config/socketio','../../routes','once'];(function(_0xcfe8cc,_0xb83aeb){var _0x55ac53=function(_0x4067d4){while(--_0x4067d4){_0xcfe8cc['push'](_0xcfe8cc['shift']());}};_0x55ac53(++_0xb83aeb);}(_0x7081,0x192));var _0x1708=function(_0x987fe6,_0x24ac32){_0x987fe6=_0x987fe6-0x0;var _0x4fb549=_0x7081[_0x987fe6];return _0x4fb549;};'use strict';var _=require(_0x1708('0x0'));var http=require('http');var express=require('express');var sticky=require(_0x1708('0x1'));var Redis=require(_0x1708('0x2'));var config=require(_0x1708('0x3'));var app=express();var server=http[_0x1708('0x4')](app);server['timeout']=0xdbba0;if(sticky[_0x1708('0x5')](server,config[_0x1708('0x6')])){var socketio=require(_0x1708('0x7'))(server,{'transports':['websocket',_0x1708('0x8')]});config['redis']=_[_0x1708('0x9')](config['redis'],{'host':_0x1708('0xa'),'port':0x18eb});socketio[_0x1708('0xb')](require('socket.io-redis')({'pubClient':new Redis(config[_0x1708('0xc')]),'subClient':new Redis(config[_0x1708('0xc')])}));require(_0x1708('0xd'))[_0x1708('0xe')]();require(_0x1708('0xf'))[_0x1708('0xe')](socketio);require('../../config/express')[_0x1708('0xe')](app);require(_0x1708('0x10'))[_0x1708('0xe')](app);}else{server[_0x1708('0x11')](_0x1708('0x12'),function(){console[_0x1708('0x13')]('Express\x20server\x20listening\x20on\x20port\x20%d!',config['port']);});}exports=module[_0x1708('0x14')]=app;
\ No newline at end of file
+var _0xd113=['lodash','express','sticky-session','ioredis','../../config/environment','createServer','listen','port','socket.io','websocket','polling','localhost','adapter','socket.io-redis','redis','../../config/triggers','default','../../config/socketio','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','exports'];(function(_0x33ea48,_0x3ec008){var _0x4100c7=function(_0x7cd8af){while(--_0x7cd8af){_0x33ea48['push'](_0x33ea48['shift']());}};_0x4100c7(++_0x3ec008);}(_0xd113,0xc6));var _0x3d11=function(_0x2e22a5,_0x5dc3b8){_0x2e22a5=_0x2e22a5-0x0;var _0x124c76=_0xd113[_0x2e22a5];return _0x124c76;};'use strict';var _=require(_0x3d11('0x0'));var http=require('http');var express=require(_0x3d11('0x1'));var sticky=require(_0x3d11('0x2'));var Redis=require(_0x3d11('0x3'));var config=require(_0x3d11('0x4'));var app=express();var server=http[_0x3d11('0x5')](app);server['timeout']=0xdbba0;if(sticky[_0x3d11('0x6')](server,config[_0x3d11('0x7')])){var socketio=require(_0x3d11('0x8'))(server,{'transports':[_0x3d11('0x9'),_0x3d11('0xa')]});config['redis']=_['defaults'](config['redis'],{'host':_0x3d11('0xb'),'port':0x18eb});socketio[_0x3d11('0xc')](require(_0x3d11('0xd'))({'pubClient':new Redis(config[_0x3d11('0xe')]),'subClient':new Redis(config[_0x3d11('0xe')])}));require(_0x3d11('0xf'))[_0x3d11('0x10')]();require(_0x3d11('0x11'))[_0x3d11('0x10')](socketio);require('../../config/express')['default'](app);require('../../routes')[_0x3d11('0x10')](app);}else{server['once'](_0x3d11('0x12'),function(){console[_0x3d11('0x13')](_0x3d11('0x14'),config[_0x3d11('0x7')]);});}exports=module[_0x3d11('0x15')]=app;
\ No newline at end of file
index aac0aae..2713a6f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x74ab=['exports','jayson/promise','../../config/logger','routing','http','Request','request','rpc','error','message','result','catch'];(function(_0x57da1c,_0x48f8e2){var _0x2ac1bd=function(_0x263962){while(--_0x263962){_0x57da1c['push'](_0x57da1c['shift']());}};_0x2ac1bd(++_0x48f8e2);}(_0x74ab,0xa9));var _0xb74a=function(_0x5bd86b,_0x504b7b){_0x5bd86b=_0x5bd86b-0x0;var _0x74090a=_0x74ab[_0x5bd86b];return _0x74090a;};'use strict';var jayson=require(_0xb74a('0x0'));var BPromise=require('bluebird');var logger=require(_0xb74a('0x1'))(_0xb74a('0x2'));var client=jayson['client'][_0xb74a('0x3')]({'port':0x2329});client[_0xb74a('0x4')]=function(_0x5772b9,_0x2c7529){return new BPromise(function(_0xe64c52,_0x30235f){return client[_0xb74a('0x5')](_0x5772b9,_0x2c7529)['then'](function(_0x18f12e){logger['debug'](_0xb74a('0x6'),_0xb74a('0x2'),_0x5772b9,_0x2c7529,_0x18f12e);if(_0x18f12e[_0xb74a('0x7')]){logger[_0xb74a('0x7')]('rpc',_0xb74a('0x2'),_0x5772b9,_0x18f12e[_0xb74a('0x7')][_0xb74a('0x8')],_0x2c7529);return _0x30235f(_0x18f12e[_0xb74a('0x7')][_0xb74a('0x8')]);}else{return _0xe64c52(_0x18f12e[_0xb74a('0x9')]);}})[_0xb74a('0xa')](function(_0x3602b5){logger[_0xb74a('0x7')](_0xb74a('0x6'),_0xb74a('0x2'),_0x5772b9,_0x3602b5,_0x2c7529);return _0x30235f(_0x3602b5);});});};module[_0xb74a('0xb')]=client;
\ No newline at end of file
+var _0x494e=['bluebird','../../config/logger','routing','Request','then','rpc','error','message','result','catch','exports','jayson/promise'];(function(_0x380803,_0x338b4b){var _0xfa7dd2=function(_0x3910f7){while(--_0x3910f7){_0x380803['push'](_0x380803['shift']());}};_0xfa7dd2(++_0x338b4b);}(_0x494e,0xcb));var _0xe494=function(_0x22fc02,_0x3f3fea){_0x22fc02=_0x22fc02-0x0;var _0x26806b=_0x494e[_0x22fc02];return _0x26806b;};'use strict';var jayson=require(_0xe494('0x0'));var BPromise=require(_0xe494('0x1'));var logger=require(_0xe494('0x2'))(_0xe494('0x3'));var client=jayson['client']['http']({'port':0x2329});client[_0xe494('0x4')]=function(_0x6050b7,_0x357a72){return new BPromise(function(_0xe2c97f,_0x48c4d7){return client['request'](_0x6050b7,_0x357a72)[_0xe494('0x5')](function(_0x344dc4){logger['debug'](_0xe494('0x6'),_0xe494('0x3'),_0x6050b7,_0x357a72,_0x344dc4);if(_0x344dc4[_0xe494('0x7')]){logger[_0xe494('0x7')](_0xe494('0x6'),_0xe494('0x3'),_0x6050b7,_0x344dc4[_0xe494('0x7')][_0xe494('0x8')],_0x357a72);return _0x48c4d7(_0x344dc4[_0xe494('0x7')][_0xe494('0x8')]);}else{return _0xe2c97f(_0x344dc4[_0xe494('0x9')]);}})[_0xe494('0xa')](function(_0x550366){logger[_0xe494('0x7')](_0xe494('0x6'),_0xe494('0x3'),_0x6050b7,_0x550366,_0x357a72);return _0x48c4d7(_0x550366);});});};module[_0xe494('0xb')]=client;
\ No newline at end of file
index 01a2186..93eca79 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1a0a=['./rpc/faxQueue','./rpc/whatsappQueue','resolve','then','getIntervals','initIntervals','getChatQueues','initChatQueues','getSmsQueues','initSmsQueues','getMailQueues','initMailQueues','getFaxQueues','initFaxQueues','getWhatsappQueues','log','bluebird','./server','./rpc/user','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue'];(function(_0x5ac84c,_0x287781){var _0x3c53d2=function(_0x40cde0){while(--_0x40cde0){_0x5ac84c['push'](_0x5ac84c['shift']());}};_0x3c53d2(++_0x287781);}(_0x1a0a,0x180));var _0xa1a0=function(_0x3186ae,_0x5d615c){_0x3186ae=_0x3186ae-0x0;var _0x247818=_0x1a0a[_0x3186ae];return _0x247818;};'use strict';var BPromise=require(_0xa1a0('0x0'));var server=require(_0xa1a0('0x1'));var Realtime=require('./realtime');var user=require(_0xa1a0('0x2'));var interval=require('./rpc/interval');var openchannelQueue=require(_0xa1a0('0x3'));var chatQueue=require(_0xa1a0('0x4'));var smsQueue=require(_0xa1a0('0x5'));var mailQueue=require(_0xa1a0('0x6'));var faxQueue=require(_0xa1a0('0x7'));var whatsappQueue=require(_0xa1a0('0x8'));var realtime=new Realtime();function initRealtime(){return BPromise[_0xa1a0('0x9')]()['then'](user['getAgents']())[_0xa1a0('0xa')](realtime['initAgents']())[_0xa1a0('0xa')](interval[_0xa1a0('0xb')]())[_0xa1a0('0xa')](realtime[_0xa1a0('0xc')]())['then'](openchannelQueue['getOpenchannelQueues']())[_0xa1a0('0xa')](realtime['initOpenchannelQueues']())[_0xa1a0('0xa')](chatQueue[_0xa1a0('0xd')]())[_0xa1a0('0xa')](realtime[_0xa1a0('0xe')]())[_0xa1a0('0xa')](smsQueue[_0xa1a0('0xf')]())['then'](realtime[_0xa1a0('0x10')]())[_0xa1a0('0xa')](mailQueue[_0xa1a0('0x11')]())[_0xa1a0('0xa')](realtime[_0xa1a0('0x12')]())[_0xa1a0('0xa')](faxQueue[_0xa1a0('0x13')]())[_0xa1a0('0xa')](realtime[_0xa1a0('0x14')]())[_0xa1a0('0xa')](whatsappQueue[_0xa1a0('0x15')]())[_0xa1a0('0xa')](realtime['initWhatsappQueues']())[_0xa1a0('0xa')](function(){return realtime;});}function main(){return server['listen'](realtime)[_0xa1a0('0xa')](function(_0x3d7abb){return initRealtime();})[_0xa1a0('0xa')](function(_0x367ee7){return setInterval(initRealtime,0x1388);})['catch'](function(_0x7ef0b8){console[_0xa1a0('0x16')](_0x7ef0b8);});}main();
\ No newline at end of file
+var _0xfb4c=['./rpc/faxQueue','./rpc/whatsappQueue','resolve','then','getAgents','initAgents','getIntervals','initIntervals','getOpenchannelQueues','initOpenchannelQueues','getChatQueues','initChatQueues','getSmsQueues','initSmsQueues','getMailQueues','getFaxQueues','initFaxQueues','getWhatsappQueues','initWhatsappQueues','listen','catch','log','bluebird','./server','./realtime','./rpc/interval','./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue'];(function(_0x317778,_0x5342a3){var _0x13bff8=function(_0x50b19f){while(--_0x50b19f){_0x317778['push'](_0x317778['shift']());}};_0x13bff8(++_0x5342a3);}(_0xfb4c,0x138));var _0xcfb4=function(_0x5e9691,_0x251156){_0x5e9691=_0x5e9691-0x0;var _0x6348f9=_0xfb4c[_0x5e9691];return _0x6348f9;};'use strict';var BPromise=require(_0xcfb4('0x0'));var server=require(_0xcfb4('0x1'));var Realtime=require(_0xcfb4('0x2'));var user=require('./rpc/user');var interval=require(_0xcfb4('0x3'));var openchannelQueue=require('./rpc/openchannelQueue');var chatQueue=require(_0xcfb4('0x4'));var smsQueue=require(_0xcfb4('0x5'));var mailQueue=require(_0xcfb4('0x6'));var faxQueue=require(_0xcfb4('0x7'));var whatsappQueue=require(_0xcfb4('0x8'));var realtime=new Realtime();function initRealtime(){return BPromise[_0xcfb4('0x9')]()[_0xcfb4('0xa')](user[_0xcfb4('0xb')]())[_0xcfb4('0xa')](realtime[_0xcfb4('0xc')]())['then'](interval[_0xcfb4('0xd')]())[_0xcfb4('0xa')](realtime[_0xcfb4('0xe')]())[_0xcfb4('0xa')](openchannelQueue[_0xcfb4('0xf')]())['then'](realtime[_0xcfb4('0x10')]())['then'](chatQueue[_0xcfb4('0x11')]())['then'](realtime[_0xcfb4('0x12')]())[_0xcfb4('0xa')](smsQueue[_0xcfb4('0x13')]())[_0xcfb4('0xa')](realtime[_0xcfb4('0x14')]())[_0xcfb4('0xa')](mailQueue[_0xcfb4('0x15')]())[_0xcfb4('0xa')](realtime['initMailQueues']())[_0xcfb4('0xa')](faxQueue[_0xcfb4('0x16')]())['then'](realtime[_0xcfb4('0x17')]())[_0xcfb4('0xa')](whatsappQueue[_0xcfb4('0x18')]())['then'](realtime[_0xcfb4('0x19')]())[_0xcfb4('0xa')](function(){return realtime;});}function main(){return server[_0xcfb4('0x1a')](realtime)[_0xcfb4('0xa')](function(_0xf672b){return initRealtime();})[_0xcfb4('0xa')](function(_0x3ecc9f){return setInterval(initRealtime,0x1388);})[_0xcfb4('0x1b')](function(_0x4254ff){console[_0xcfb4('0x1c')](_0x4254ff);});}main();
\ No newline at end of file
index afc25b1..7ad8046 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x814b=['init','parse','map','object','lodash','util','events','EventEmitter','isNil','register','ignoreFactChanges','inherits','prototype','rules','isArray','concat','isObject','push','sync','filter','activeRules','orderBy','asc','execute','result','clone','name','ruleRef','call','next','isEqual','nextTick','restart','length','condition','matchPath','noop','findRules','matches','turn','prioritize','priority','toJSON','toString','consequence','fromJSON'];(function(_0x7c9fba,_0x10b015){var _0x5cceed=function(_0x4ae29a){while(--_0x4ae29a){_0x7c9fba['push'](_0x7c9fba['shift']());}};_0x5cceed(++_0x10b015);}(_0x814b,0x1a2));var _0xb814=function(_0x3e1829,_0xc8ccda){_0x3e1829=_0x3e1829-0x0;var _0x129345=_0x814b[_0x3e1829];return _0x129345;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var EventEmitter=require(_0xb814('0x2'))[_0xb814('0x3')];function RuleEngine(_0xfbb64b,_0x477725){this['init']();if(!_[_0xb814('0x4')](_0xfbb64b)){this[_0xb814('0x5')](_0xfbb64b);}if(_0x477725){this[_0xb814('0x6')]=_0x477725[_0xb814('0x6')];}return this;}util[_0xb814('0x7')](RuleEngine,EventEmitter);RuleEngine[_0xb814('0x8')]['init']=function(_0x3b0829){this[_0xb814('0x9')]=[];this['activeRules']=[];};RuleEngine[_0xb814('0x8')][_0xb814('0x5')]=function(_0x186d5a){if(Array[_0xb814('0xa')](_0x186d5a)){this[_0xb814('0x9')]=this[_0xb814('0x9')][_0xb814('0xb')](_0x186d5a);}else if(_0x186d5a!==null&&_[_0xb814('0xc')](_0x186d5a)){this[_0xb814('0x9')][_0xb814('0xd')](_0x186d5a);}this[_0xb814('0xe')]();};RuleEngine['prototype'][_0xb814('0xe')]=function(){this['activeRules']=this[_0xb814('0x9')][_0xb814('0xf')](function(_0x35b10d){if(_[_0xb814('0x4')](_0x35b10d['on'])){_0x35b10d['on']=!![];}if(_0x35b10d['on']===!![]){return _0x35b10d;}});this[_0xb814('0x10')]=_[_0xb814('0x11')](this[_0xb814('0x10')],['p'],[_0xb814('0x12')]);};RuleEngine[_0xb814('0x8')][_0xb814('0x13')]=function(_0x3f4881,_0x44fb96){var _0x17f5bd=![];_0x3f4881[_0xb814('0x14')]=!![];var _0x303aca=_[_0xb814('0x15')](_0x3f4881);var _0x45e0d0=_[_0xb814('0x15')](_0x3f4881);var _0x125ce2=this[_0xb814('0x10')];var _0x7a21ef=[];var _0x48c9df=this[_0xb814('0x6')];(function FnRuleLoop(_0x55ba16){var _0x270598={'rules':function(){return _0x125ce2;},'rule':function(){return _0x125ce2[_0x55ba16];},'when':function(_0xfac75b){if(_0xfac75b){var _0x4c3007=_0x125ce2[_0x55ba16]['consequence'];_0x4c3007['ruleRef']=_0x125ce2[_0x55ba16]['id']||_0x125ce2[_0x55ba16][_0xb814('0x16')]||'index_'+_0x55ba16;process['nextTick'](function(){_0x7a21ef[_0xb814('0xd')](_0x4c3007[_0xb814('0x17')]);_0x4c3007[_0xb814('0x18')](_0x303aca,_0x270598);});}else{process['nextTick'](function(){_0x270598[_0xb814('0x19')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x17f5bd=!![];return FnRuleLoop(0x0);},'next':function(_0x531032){if(!_0x48c9df&&!_[_0xb814('0x1a')](_0x45e0d0,_0x303aca)){_0x45e0d0=_[_0xb814('0x15')](_0x303aca);process[_0xb814('0x1b')](function(){_0x270598[_0xb814('0x1c')]();});}else{process[_0xb814('0x1b')](function(){if(_[_0xb814('0x4')](_0x531032)){return FnRuleLoop(_0x55ba16+0x1);}else{return FnRuleLoop(_0x531032);}});}}};if(_0x55ba16<_0x125ce2[_0xb814('0x1d')]&&_0x17f5bd===![]){var _0x594470=_0x125ce2[_0x55ba16][_0xb814('0x1e')];_0x594470['call'](_0x303aca,_0x270598);}else{process[_0xb814('0x1b')](function(){_0x303aca[_0xb814('0x1f')]=_0x7a21ef;return _0x44fb96?_0x44fb96(_0x303aca):_[_0xb814('0x20')]();});}}(0x0));};RuleEngine[_0xb814('0x8')][_0xb814('0x21')]=function(_0xb9e57d){if(_[_0xb814('0x4')](_0xb9e57d)){return this['rules'];}else{var _0x392222=_[_0xb814('0x22')](_0xb9e57d);return _[_0xb814('0xf')](this[_0xb814('0x9')],_0x392222);}};RuleEngine[_0xb814('0x8')][_0xb814('0x23')]=function(_0x3f0150,_0x1e4e89){var _0x5a6291=_0x3f0150==='on'||_0x3f0150==='ON'?!![]:![];var _0x271aa8=this[_0xb814('0x21')](_0x1e4e89);for(var _0x52ed64=0x0,_0x9008b2=_0x271aa8[_0xb814('0x1d')];_0x52ed64<_0x9008b2;_0x52ed64+=0x1){_0x271aa8[_0x52ed64]['on']=_0x5a6291;}this[_0xb814('0xe')]();};RuleEngine['prototype'][_0xb814('0x24')]=function(_0x2051d0,_0x58c3ca){_0x2051d0=parseInt(_0x2051d0,0xa);var _0x338a28=this['findRules'](_0x58c3ca);for(var _0x6efe9a=0x0,_0x5f3e9b=_0x338a28['length'];_0x6efe9a<_0x5f3e9b;_0x6efe9a+=0x1){_0x338a28[_0x6efe9a][_0xb814('0x25')]=_0x2051d0;}this['sync']();};RuleEngine[_0xb814('0x8')][_0xb814('0x26')]=function(){var _0x2b91bd=this['rules'];if(_0x2b91bd instanceof Array){_0x2b91bd=_0x2b91bd['map'](function(_0x26d3a9){_0x26d3a9[_0xb814('0x1e')]=_0x26d3a9['condition'][_0xb814('0x27')]();_0x26d3a9[_0xb814('0x28')]=_0x26d3a9[_0xb814('0x28')][_0xb814('0x27')]();return _0x26d3a9;});}else if(!_[_0xb814('0x4')](_0x2b91bd)){_0x2b91bd[_0xb814('0x1e')]=_0x2b91bd[_0xb814('0x1e')]['toString']();_0x2b91bd[_0xb814('0x28')]=_0x2b91bd[_0xb814('0x28')][_0xb814('0x27')]();}return _0x2b91bd;};RuleEngine[_0xb814('0x8')][_0xb814('0x29')]=function(_0x4ff31a){this[_0xb814('0x2a')]();if(_['isString'](_0x4ff31a)){_0x4ff31a=JSON[_0xb814('0x2b')](_0x4ff31a);}if(_0x4ff31a instanceof Array){_0x4ff31a=_0x4ff31a[_0xb814('0x2c')](function(_0xe0f509){_0xe0f509['condition']=eval('('+_0xe0f509[_0xb814('0x1e')]+')');_0xe0f509[_0xb814('0x28')]=eval('('+_0xe0f509['consequence']+')');return _0xe0f509;});}else if(_0x4ff31a!==null&&typeof _0x4ff31a==_0xb814('0x2d')){_0x4ff31a[_0xb814('0x1e')]=eval('('+_0x4ff31a[_0xb814('0x1e')]+')');_0x4ff31a[_0xb814('0x28')]=eval('('+_0x4ff31a[_0xb814('0x28')]+')');}this[_0xb814('0x5')](_0x4ff31a);};module['exports']=RuleEngine;
\ No newline at end of file
+var _0x7a54=['turn','prioritize','priority','toJSON','map','toString','fromJSON','isString','object','exports','lodash','util','events','isNil','register','ignoreFactChanges','inherits','init','rules','activeRules','concat','prototype','sync','filter','orderBy','asc','execute','clone','consequence','ruleRef','name','index_','nextTick','push','call','isEqual','restart','length','condition','matchPath','noop','findRules'];(function(_0x3feff9,_0x4f636e){var _0x582e61=function(_0x12a182){while(--_0x12a182){_0x3feff9['push'](_0x3feff9['shift']());}};_0x582e61(++_0x4f636e);}(_0x7a54,0x106));var _0x47a5=function(_0x542559,_0x370e78){_0x542559=_0x542559-0x0;var _0x4923a8=_0x7a54[_0x542559];return _0x4923a8;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var EventEmitter=require(_0x47a5('0x2'))['EventEmitter'];function RuleEngine(_0x1d33e,_0x4086cd){this['init']();if(!_[_0x47a5('0x3')](_0x1d33e)){this[_0x47a5('0x4')](_0x1d33e);}if(_0x4086cd){this[_0x47a5('0x5')]=_0x4086cd[_0x47a5('0x5')];}return this;}util[_0x47a5('0x6')](RuleEngine,EventEmitter);RuleEngine['prototype'][_0x47a5('0x7')]=function(_0x59199c){this[_0x47a5('0x8')]=[];this[_0x47a5('0x9')]=[];};RuleEngine['prototype'][_0x47a5('0x4')]=function(_0x5077f3){if(Array['isArray'](_0x5077f3)){this['rules']=this[_0x47a5('0x8')][_0x47a5('0xa')](_0x5077f3);}else if(_0x5077f3!==null&&_['isObject'](_0x5077f3)){this[_0x47a5('0x8')]['push'](_0x5077f3);}this['sync']();};RuleEngine[_0x47a5('0xb')][_0x47a5('0xc')]=function(){this[_0x47a5('0x9')]=this[_0x47a5('0x8')][_0x47a5('0xd')](function(_0xd308b8){if(_[_0x47a5('0x3')](_0xd308b8['on'])){_0xd308b8['on']=!![];}if(_0xd308b8['on']===!![]){return _0xd308b8;}});this['activeRules']=_[_0x47a5('0xe')](this[_0x47a5('0x9')],['p'],[_0x47a5('0xf')]);};RuleEngine[_0x47a5('0xb')][_0x47a5('0x10')]=function(_0x620ee9,_0x3c6c46){var _0x190faa=![];_0x620ee9['result']=!![];var _0x362359=_[_0x47a5('0x11')](_0x620ee9);var _0x3b001e=_[_0x47a5('0x11')](_0x620ee9);var _0x1ef44c=this['activeRules'];var _0x549de3=[];var _0x138bc0=this['ignoreFactChanges'];(function FnRuleLoop(_0x5247fd){var _0x423a81={'rules':function(){return _0x1ef44c;},'rule':function(){return _0x1ef44c[_0x5247fd];},'when':function(_0xaf70a6){if(_0xaf70a6){var _0x2ce454=_0x1ef44c[_0x5247fd][_0x47a5('0x12')];_0x2ce454[_0x47a5('0x13')]=_0x1ef44c[_0x5247fd]['id']||_0x1ef44c[_0x5247fd][_0x47a5('0x14')]||_0x47a5('0x15')+_0x5247fd;process[_0x47a5('0x16')](function(){_0x549de3[_0x47a5('0x17')](_0x2ce454['ruleRef']);_0x2ce454[_0x47a5('0x18')](_0x362359,_0x423a81);});}else{process[_0x47a5('0x16')](function(){_0x423a81['next']();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x190faa=!![];return FnRuleLoop(0x0);},'next':function(_0x2b0360){if(!_0x138bc0&&!_[_0x47a5('0x19')](_0x3b001e,_0x362359)){_0x3b001e=_[_0x47a5('0x11')](_0x362359);process['nextTick'](function(){_0x423a81[_0x47a5('0x1a')]();});}else{process[_0x47a5('0x16')](function(){if(_[_0x47a5('0x3')](_0x2b0360)){return FnRuleLoop(_0x5247fd+0x1);}else{return FnRuleLoop(_0x2b0360);}});}}};if(_0x5247fd<_0x1ef44c[_0x47a5('0x1b')]&&_0x190faa===![]){var _0x5ef1b1=_0x1ef44c[_0x5247fd][_0x47a5('0x1c')];_0x5ef1b1[_0x47a5('0x18')](_0x362359,_0x423a81);}else{process['nextTick'](function(){_0x362359[_0x47a5('0x1d')]=_0x549de3;return _0x3c6c46?_0x3c6c46(_0x362359):_[_0x47a5('0x1e')]();});}}(0x0));};RuleEngine[_0x47a5('0xb')][_0x47a5('0x1f')]=function(_0x3abd6a){if(_['isNil'](_0x3abd6a)){return this['rules'];}else{var _0x136745=_['matches'](_0x3abd6a);return _[_0x47a5('0xd')](this['rules'],_0x136745);}};RuleEngine[_0x47a5('0xb')][_0x47a5('0x20')]=function(_0x36ad34,_0x1dac65){var _0x21f296=_0x36ad34==='on'||_0x36ad34==='ON'?!![]:![];var _0x3ba0b7=this[_0x47a5('0x1f')](_0x1dac65);for(var _0x136b14=0x0,_0x16631f=_0x3ba0b7[_0x47a5('0x1b')];_0x136b14<_0x16631f;_0x136b14+=0x1){_0x3ba0b7[_0x136b14]['on']=_0x21f296;}this[_0x47a5('0xc')]();};RuleEngine[_0x47a5('0xb')][_0x47a5('0x21')]=function(_0x528582,_0x243210){_0x528582=parseInt(_0x528582,0xa);var _0x51833b=this[_0x47a5('0x1f')](_0x243210);for(var _0x9ac908=0x0,_0x16901f=_0x51833b['length'];_0x9ac908<_0x16901f;_0x9ac908+=0x1){_0x51833b[_0x9ac908][_0x47a5('0x22')]=_0x528582;}this[_0x47a5('0xc')]();};RuleEngine[_0x47a5('0xb')][_0x47a5('0x23')]=function(){var _0x51cc81=this['rules'];if(_0x51cc81 instanceof Array){_0x51cc81=_0x51cc81[_0x47a5('0x24')](function(_0xfb5ddb){_0xfb5ddb['condition']=_0xfb5ddb['condition'][_0x47a5('0x25')]();_0xfb5ddb[_0x47a5('0x12')]=_0xfb5ddb['consequence'][_0x47a5('0x25')]();return _0xfb5ddb;});}else if(!_['isNil'](_0x51cc81)){_0x51cc81[_0x47a5('0x1c')]=_0x51cc81[_0x47a5('0x1c')]['toString']();_0x51cc81['consequence']=_0x51cc81[_0x47a5('0x12')]['toString']();}return _0x51cc81;};RuleEngine[_0x47a5('0xb')][_0x47a5('0x26')]=function(_0xf269a8){this['init']();if(_[_0x47a5('0x27')](_0xf269a8)){_0xf269a8=JSON['parse'](_0xf269a8);}if(_0xf269a8 instanceof Array){_0xf269a8=_0xf269a8['map'](function(_0x65542e){_0x65542e['condition']=eval('('+_0x65542e[_0x47a5('0x1c')]+')');_0x65542e['consequence']=eval('('+_0x65542e[_0x47a5('0x12')]+')');return _0x65542e;});}else if(_0xf269a8!==null&&typeof _0xf269a8==_0x47a5('0x28')){_0xf269a8[_0x47a5('0x1c')]=eval('('+_0xf269a8[_0x47a5('0x1c')]+')');_0xf269a8[_0x47a5('0x12')]=eval('('+_0xf269a8[_0x47a5('0x12')]+')');}this[_0x47a5('0x4')](_0xf269a8);};module[_0x47a5('0x29')]=RuleEngine;
\ No newline at end of file
index c698e44..c0b0184 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd467=['request','error','result','catch','sendMailMessage','SendMail','client','http'];(function(_0x36698b,_0x1236bd){var _0x1029eb=function(_0x5db2c6){while(--_0x5db2c6){_0x36698b['push'](_0x36698b['shift']());}};_0x1029eb(++_0x1236bd);}(_0xd467,0x7e));var _0x7d46=function(_0x28704b,_0x1190af){_0x28704b=_0x28704b-0x0;var _0x1baaf1=_0xd467[_0x28704b];return _0x1baaf1;};'use strict';var BPromise=require('bluebird');var jayson=require('jayson/promise');var client=jayson[_0x7d46('0x0')][_0x7d46('0x1')]({'port':0x232b});function request(_0x4febde,_0x2ab360){return new BPromise(function(_0x363f97,_0x498189){return client[_0x7d46('0x2')](_0x4febde,_0x2ab360)['then'](function(_0x5861c2){if(_0x5861c2[_0x7d46('0x3')]){return _0x498189(_0x5861c2[_0x7d46('0x3')]['message']);}else{return _0x363f97(_0x5861c2[_0x7d46('0x4')]);}})[_0x7d46('0x5')](function(_0x3e3701){return _0x498189(_0x3e3701);});});}exports[_0x7d46('0x6')]=function(_0x522fa3,_0x112d18){return request(_0x7d46('0x7'),{'account':_0x522fa3,'message':_0x112d18});};
\ No newline at end of file
+var _0x5bd9=['result','catch','sendMailMessage','bluebird','jayson/promise','client','http','then','error','message'];(function(_0x544df4,_0x25edf9){var _0x58e935=function(_0x439212){while(--_0x439212){_0x544df4['push'](_0x544df4['shift']());}};_0x58e935(++_0x25edf9);}(_0x5bd9,0x175));var _0x95bd=function(_0x58215e,_0x377e22){_0x58215e=_0x58215e-0x0;var _0x5637a9=_0x5bd9[_0x58215e];return _0x5637a9;};'use strict';var BPromise=require(_0x95bd('0x0'));var jayson=require(_0x95bd('0x1'));var client=jayson[_0x95bd('0x2')][_0x95bd('0x3')]({'port':0x232b});function request(_0x358ca1,_0x21047c){return new BPromise(function(_0xe6db59,_0x102ca2){return client['request'](_0x358ca1,_0x21047c)[_0x95bd('0x4')](function(_0x5ccaf3){if(_0x5ccaf3[_0x95bd('0x5')]){return _0x102ca2(_0x5ccaf3[_0x95bd('0x5')][_0x95bd('0x6')]);}else{return _0xe6db59(_0x5ccaf3[_0x95bd('0x7')]);}})[_0x95bd('0x8')](function(_0x16d67d){return _0x102ca2(_0x16d67d);});});}exports[_0x95bd('0x9')]=function(_0x3486aa,_0x542b2c){return request('SendMail',{'account':_0x3486aa,'message':_0x542b2c});};
\ No newline at end of file
index 576326e..fd8b8c5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd76b=['whatsappStatus','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelCapacity','openchannelCurrentCapacity','busyQueue','updateRealtime','prototype','Capacity','maxcapacity','working','idle','mail','chat','fax','sms','whatsapp','length','getChannelStatus','Status','StatusTime','toNumber','format','chatStatus','faxStatusTime','smsStatusTime','busy','stringify','md5','emit','user:save','exports','lodash','moment','ioredis','../../../config/environment','defaults','redis','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','unknown','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxCapacity','faxCurrentCapacity','smsStatus','smsCapacity','smsCurrentCapacity'];(function(_0x13c130,_0x14dd19){var _0x140506=function(_0xd4eddd){while(--_0xd4eddd){_0x13c130['push'](_0x13c130['shift']());}};_0x140506(++_0x14dd19);}(_0xd76b,0x11a));var _0xbd76=function(_0x342baa,_0x4a110f){_0x342baa=_0x342baa-0x0;var _0x1208f3=_0xd76b[_0x342baa];return _0x1208f3;};'use strict';var _=require(_0xbd76('0x0'));var moment=require(_0xbd76('0x1'));var md5=require('md5');var Redis=require(_0xbd76('0x2'));var config=require(_0xbd76('0x3'));config['redis']=_[_0xbd76('0x4')](config[_0xbd76('0x5')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function Agent(_0x13e6b8){this['id']=_0x13e6b8['id']||0x0;this['name']=_0x13e6b8[_0xbd76('0x6')]||'';this[_0xbd76('0x7')]=_0x13e6b8[_0xbd76('0x7')]||!![];this[_0xbd76('0x8')]=_0x13e6b8[_0xbd76('0x8')]||![];this['chatPause']=_0x13e6b8[_0xbd76('0x9')]||![];this[_0xbd76('0xa')]=_0x13e6b8[_0xbd76('0xa')]||![];this['faxPause']=_0x13e6b8[_0xbd76('0xb')]||![];this[_0xbd76('0xc')]=_0x13e6b8[_0xbd76('0xc')]||![];this[_0xbd76('0xd')]=_0x13e6b8[_0xbd76('0xd')]||![];this['chatStatus']=_0xbd76('0xe');this[_0xbd76('0xf')]=0x0;this['chatCapacity']=_0x13e6b8[_0xbd76('0x10')]||0x0;this[_0xbd76('0x11')]=0x0;this[_0xbd76('0x12')]=_0xbd76('0xe');this[_0xbd76('0x13')]=0x0;this[_0xbd76('0x14')]=_0x13e6b8[_0xbd76('0x14')]||0x0;this[_0xbd76('0x15')]=0x0;this[_0xbd76('0x16')]=_0xbd76('0xe');this['faxStatusTime']=0x0;this[_0xbd76('0x17')]=_0x13e6b8[_0xbd76('0x17')]||0x0;this[_0xbd76('0x18')]=0x0;this[_0xbd76('0x19')]=_0xbd76('0xe');this['smsStatusTime']=0x0;this[_0xbd76('0x1a')]=_0x13e6b8[_0xbd76('0x1a')]||0x0;this[_0xbd76('0x1b')]=0x0;this[_0xbd76('0x1c')]=_0xbd76('0xe');this[_0xbd76('0x1d')]=0x0;this[_0xbd76('0x1e')]=_0x13e6b8[_0xbd76('0x1e')]||0x0;this[_0xbd76('0x1f')]=0x0;this[_0xbd76('0x20')]='unknown';this['openchannelStatusTime']=0x0;this[_0xbd76('0x21')]=_0x13e6b8[_0xbd76('0x21')]||0x0;this[_0xbd76('0x22')]=0x0;this['busy']=![];this[_0xbd76('0x23')]=undefined;this['md5']='';this[_0xbd76('0x24')]();}Agent[_0xbd76('0x25')]['getChannelStatus']=function(_0x20af63){if(this[_0x20af63+'CurrentCapacity']>0x0){if(this[_0x20af63+_0xbd76('0x26')]>0x0&&this[_0x20af63+'CurrentCapacity']>=this[_0x20af63+_0xbd76('0x26')]){return _0xbd76('0x27');}else{return _0xbd76('0x28');}}else{return _0xbd76('0x29');}};Agent['prototype'][_0xbd76('0x24')]=function(){var _0x519dbd=[_0xbd76('0x2a'),_0xbd76('0x2b'),'openchannel',_0xbd76('0x2c'),_0xbd76('0x2d'),_0xbd76('0x2e')];for(var _0x5a8219=0x0;_0x5a8219<_0x519dbd[_0xbd76('0x2f')];_0x5a8219+=0x1){var _0x130422=this[_0xbd76('0x30')](_0x519dbd[_0x5a8219]);if(this[_0x519dbd[_0x5a8219]+_0xbd76('0x31')]!==_0x130422){this[_0x519dbd[_0x5a8219]+_0xbd76('0x32')]=_[_0xbd76('0x33')](moment()[_0xbd76('0x34')]('x'));}this[_0x519dbd[_0x5a8219]+_0xbd76('0x31')]=_0x130422;}var _0x582d3b={'id':this['id'],'name':this[_0xbd76('0x6')],'online':this[_0xbd76('0x7')],'voicePause':this[_0xbd76('0x8')],'chatPause':this['chatPause'],'mailPause':this[_0xbd76('0xa')],'smsPause':this[_0xbd76('0xc')],'faxPause':this[_0xbd76('0xb')],'openchannelPause':this[_0xbd76('0xd')],'chatStatus':this[_0xbd76('0x35')],'chatStatusTime':this['chatStatusTime'],'chatCapacity':this['chatCapacity'],'chatCurrentCapacity':this[_0xbd76('0x11')],'mailStatus':this['mailStatus'],'mailStatusTime':this[_0xbd76('0x13')],'mailCapacity':this['mailCapacity'],'mailCurrentCapacity':this['mailCurrentCapacity'],'faxStatus':this[_0xbd76('0x16')],'faxStatusTime':this[_0xbd76('0x36')],'faxCapacity':this[_0xbd76('0x17')],'faxCurrentCapacity':this['faxCurrentCapacity'],'smsStatus':this[_0xbd76('0x19')],'smsStatusTime':this[_0xbd76('0x37')],'smsCapacity':this['smsCapacity'],'smsCurrentCapacity':this[_0xbd76('0x1b')],'whatsappStatus':this[_0xbd76('0x1c')],'whatsappStatusTime':this['whatsappStatusTime'],'whatsappCapacity':this[_0xbd76('0x1e')],'whatsappCurrentCapacity':this[_0xbd76('0x1f')],'openchannelStatus':this[_0xbd76('0x20')],'openchannelStatusTime':this['openchannelStatusTime'],'openchannelCapacity':this[_0xbd76('0x21')],'openchannelCurrentCapacity':this[_0xbd76('0x22')],'busy':this[_0xbd76('0x38')],'busyQueue':this[_0xbd76('0x23')]};var _0x13a9b6=md5(JSON[_0xbd76('0x39')](_0x582d3b));if(this[_0xbd76('0x3a')]!==_0x13a9b6){this[_0xbd76('0x3a')]=_0x13a9b6;io[_0xbd76('0x3b')](_0xbd76('0x3c'),_0x582d3b);}};module[_0xbd76('0x3d')]=Agent;
\ No newline at end of file
+var _0xcbda=['smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','md5','updateRealtime','getChannelStatus','CurrentCapacity','Capacity','maxcapacity','working','prototype','mail','openchannel','sms','whatsapp','length','Status','StatusTime','toNumber','format','chatCurrentCapacity','mailCurrentCapacity','openchannelStatus','busy','busyQueue','stringify','emit','user:save','exports','lodash','moment','../../../config/environment','redis','localhost','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','chatStatusTime','chatCapacity','mailStatus','unknown','mailStatusTime','mailCapacity','faxStatusTime','faxCapacity','smsStatus','smsStatusTime'];(function(_0x3c2b2e,_0x3e6e53){var _0x27a338=function(_0x40d29d){while(--_0x40d29d){_0x3c2b2e['push'](_0x3c2b2e['shift']());}};_0x27a338(++_0x3e6e53);}(_0xcbda,0x10e));var _0xacbd=function(_0x5b9284,_0x433376){_0x5b9284=_0x5b9284-0x0;var _0xf8dadb=_0xcbda[_0x5b9284];return _0xf8dadb;};'use strict';var _=require(_0xacbd('0x0'));var moment=require(_0xacbd('0x1'));var md5=require('md5');var Redis=require('ioredis');var config=require(_0xacbd('0x2'));config[_0xacbd('0x3')]=_['defaults'](config[_0xacbd('0x3')],{'host':_0xacbd('0x4'),'port':0x18eb});var io=require(_0xacbd('0x5'))(new Redis(config['redis']));function Agent(_0x12b5a5){this['id']=_0x12b5a5['id']||0x0;this[_0xacbd('0x6')]=_0x12b5a5[_0xacbd('0x6')]||'';this[_0xacbd('0x7')]=_0x12b5a5[_0xacbd('0x7')]||!![];this[_0xacbd('0x8')]=_0x12b5a5['voicePause']||![];this['chatPause']=_0x12b5a5[_0xacbd('0x9')]||![];this[_0xacbd('0xa')]=_0x12b5a5[_0xacbd('0xa')]||![];this[_0xacbd('0xb')]=_0x12b5a5[_0xacbd('0xb')]||![];this['smsPause']=_0x12b5a5[_0xacbd('0xc')]||![];this['openchannelPause']=_0x12b5a5[_0xacbd('0xd')]||![];this[_0xacbd('0xe')]='unknown';this[_0xacbd('0xf')]=0x0;this[_0xacbd('0x10')]=_0x12b5a5[_0xacbd('0x10')]||0x0;this['chatCurrentCapacity']=0x0;this[_0xacbd('0x11')]=_0xacbd('0x12');this[_0xacbd('0x13')]=0x0;this[_0xacbd('0x14')]=_0x12b5a5[_0xacbd('0x14')]||0x0;this['mailCurrentCapacity']=0x0;this['faxStatus']='unknown';this[_0xacbd('0x15')]=0x0;this[_0xacbd('0x16')]=_0x12b5a5['faxCapacity']||0x0;this['faxCurrentCapacity']=0x0;this[_0xacbd('0x17')]=_0xacbd('0x12');this[_0xacbd('0x18')]=0x0;this[_0xacbd('0x19')]=_0x12b5a5[_0xacbd('0x19')]||0x0;this[_0xacbd('0x1a')]=0x0;this[_0xacbd('0x1b')]=_0xacbd('0x12');this[_0xacbd('0x1c')]=0x0;this[_0xacbd('0x1d')]=_0x12b5a5[_0xacbd('0x1d')]||0x0;this['whatsappCurrentCapacity']=0x0;this['openchannelStatus']=_0xacbd('0x12');this[_0xacbd('0x1e')]=0x0;this[_0xacbd('0x1f')]=_0x12b5a5[_0xacbd('0x1f')]||0x0;this[_0xacbd('0x20')]=0x0;this['busy']=![];this['busyQueue']=undefined;this[_0xacbd('0x21')]='';this[_0xacbd('0x22')]();}Agent['prototype'][_0xacbd('0x23')]=function(_0x303172){if(this[_0x303172+_0xacbd('0x24')]>0x0){if(this[_0x303172+_0xacbd('0x25')]>0x0&&this[_0x303172+_0xacbd('0x24')]>=this[_0x303172+_0xacbd('0x25')]){return _0xacbd('0x26');}else{return _0xacbd('0x27');}}else{return'idle';}};Agent[_0xacbd('0x28')][_0xacbd('0x22')]=function(){var _0x4e65ec=[_0xacbd('0x29'),'chat',_0xacbd('0x2a'),'fax',_0xacbd('0x2b'),_0xacbd('0x2c')];for(var _0x4a9df1=0x0;_0x4a9df1<_0x4e65ec[_0xacbd('0x2d')];_0x4a9df1+=0x1){var _0x2324c0=this[_0xacbd('0x23')](_0x4e65ec[_0x4a9df1]);if(this[_0x4e65ec[_0x4a9df1]+_0xacbd('0x2e')]!==_0x2324c0){this[_0x4e65ec[_0x4a9df1]+_0xacbd('0x2f')]=_[_0xacbd('0x30')](moment()[_0xacbd('0x31')]('x'));}this[_0x4e65ec[_0x4a9df1]+_0xacbd('0x2e')]=_0x2324c0;}var _0x57d1ea={'id':this['id'],'name':this[_0xacbd('0x6')],'online':this['online'],'voicePause':this[_0xacbd('0x8')],'chatPause':this[_0xacbd('0x9')],'mailPause':this[_0xacbd('0xa')],'smsPause':this[_0xacbd('0xc')],'faxPause':this['faxPause'],'openchannelPause':this[_0xacbd('0xd')],'chatStatus':this['chatStatus'],'chatStatusTime':this[_0xacbd('0xf')],'chatCapacity':this['chatCapacity'],'chatCurrentCapacity':this[_0xacbd('0x32')],'mailStatus':this['mailStatus'],'mailStatusTime':this[_0xacbd('0x13')],'mailCapacity':this[_0xacbd('0x14')],'mailCurrentCapacity':this[_0xacbd('0x33')],'faxStatus':this['faxStatus'],'faxStatusTime':this[_0xacbd('0x15')],'faxCapacity':this[_0xacbd('0x16')],'faxCurrentCapacity':this['faxCurrentCapacity'],'smsStatus':this[_0xacbd('0x17')],'smsStatusTime':this[_0xacbd('0x18')],'smsCapacity':this['smsCapacity'],'smsCurrentCapacity':this[_0xacbd('0x1a')],'whatsappStatus':this[_0xacbd('0x1b')],'whatsappStatusTime':this[_0xacbd('0x1c')],'whatsappCapacity':this['whatsappCapacity'],'whatsappCurrentCapacity':this['whatsappCurrentCapacity'],'openchannelStatus':this[_0xacbd('0x34')],'openchannelStatusTime':this['openchannelStatusTime'],'openchannelCapacity':this['openchannelCapacity'],'openchannelCurrentCapacity':this[_0xacbd('0x20')],'busy':this[_0xacbd('0x35')],'busyQueue':this[_0xacbd('0x36')]};var _0x59cfb7=md5(JSON[_0xacbd('0x37')](_0x57d1ea));if(this[_0xacbd('0x21')]!==_0x59cfb7){this['md5']=_0x59cfb7;io[_0xacbd('0x38')](_0xacbd('0x39'),_0x57d1ea);}};module[_0xacbd('0x3a')]=Agent;
\ No newline at end of file
index c126ca7..63b154c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa924=['_rr','Agents','prototype','loggedIn','paused','length','online','chatPause','available','stringify','format','emit','chat_queue:save','lodash','md5','util','ioredis','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','mapAgentsId','waiting','updateRouting','updateRealtime'];(function(_0x3e4dac,_0x168c36){var _0x592f8c=function(_0x1cdd39){while(--_0x1cdd39){_0x3e4dac['push'](_0x3e4dac['shift']());}};_0x592f8c(++_0x168c36);}(_0xa924,0x81));var _0x4a92=function(_0x5f309e,_0x66e31){_0x5f309e=_0x5f309e-0x0;var _0x487b5e=_0xa924[_0x5f309e];return _0x487b5e;};'use strict';var _=require(_0x4a92('0x0'));var md5=require(_0x4a92('0x1'));var util=require(_0x4a92('0x2'));var Redis=require(_0x4a92('0x3'));var config=require('../../../config/environment');config[_0x4a92('0x4')]=_[_0x4a92('0x5')](config['redis'],{'host':_0x4a92('0x6'),'port':0x18eb});var io=require(_0x4a92('0x7'))(new Redis(config[_0x4a92('0x4')]));function ChatQueue(_0x1519fa){this['id']=_0x1519fa['id']||0x0;this[_0x4a92('0x8')]=_0x1519fa[_0x4a92('0x8')]||'';this[_0x4a92('0x9')]=_0x1519fa[_0x4a92('0x9')]||0xa;this[_0x4a92('0xa')]=_0x1519fa[_0x4a92('0xa')]||_0x4a92('0xb');this['Agents']=_0x1519fa['Agents'];this[_0x4a92('0xc')]={};this[_0x4a92('0xd')]=0x0;this[_0x4a92('0x1')]='';this[_0x4a92('0xe')]();this[_0x4a92('0xf')]();}ChatQueue['prototype'][_0x4a92('0xe')]=function(){var _0x4fa341=this[_0x4a92('0xc')][_0x4a92('0x10')];this[_0x4a92('0xc')]=_['map'](this[_0x4a92('0x11')],'id');this[_0x4a92('0xc')][_0x4a92('0x10')]=_0x4fa341;};ChatQueue[_0x4a92('0x12')][_0x4a92('0xf')]=function(){this[_0x4a92('0x13')]=0x0;this[_0x4a92('0x14')]=0x0;for(var _0x152b79=0x0;_0x152b79<this[_0x4a92('0x11')][_0x4a92('0x15')];_0x152b79+=0x1){if(this[_0x4a92('0x11')][_0x152b79][_0x4a92('0x16')]){this['loggedIn']+=0x1;}if(this[_0x4a92('0x11')][_0x152b79][_0x4a92('0x17')]){this[_0x4a92('0x14')]+=0x1;}}this[_0x4a92('0x18')]=this['loggedIn']-this[_0x4a92('0x14')];this[_0x4a92('0x18')]=this[_0x4a92('0x18')]>=0x0?this[_0x4a92('0x18')]:0x0;var _0x37eca9={'id':this['id'],'available':this[_0x4a92('0x18')],'loggedIn':this[_0x4a92('0x13')],'name':this[_0x4a92('0x8')],'paused':this[_0x4a92('0x14')],'waiting':this['waiting']};var _0x50d460=md5(JSON[_0x4a92('0x19')](_0x37eca9));if(this[_0x4a92('0x1')]!==_0x50d460){this[_0x4a92('0x1')]=_0x50d460;io['to'](util[_0x4a92('0x1a')]('chat:queue:%s',_0x37eca9['name']))[_0x4a92('0x1b')](_0x4a92('0x1c'),_0x37eca9);}};module['exports']=ChatQueue;
\ No newline at end of file
+var _0x1027=['map','loggedIn','paused','length','online','available','stringify','chat:queue:%s','emit','exports','lodash','ioredis','../../../config/environment','redis','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','md5','updateRealtime','prototype','updateRouting','_rr'];(function(_0x5d675d,_0x7ff323){var _0xa6ad63=function(_0x2d8b88){while(--_0x2d8b88){_0x5d675d['push'](_0x5d675d['shift']());}};_0xa6ad63(++_0x7ff323);}(_0x1027,0xac));var _0x7102=function(_0x1ff2ec,_0x386e86){_0x1ff2ec=_0x1ff2ec-0x0;var _0x405683=_0x1027[_0x1ff2ec];return _0x405683;};'use strict';var _=require(_0x7102('0x0'));var md5=require('md5');var util=require('util');var Redis=require(_0x7102('0x1'));var config=require(_0x7102('0x2'));config[_0x7102('0x3')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x7102('0x4'))(new Redis(config[_0x7102('0x3')]));function ChatQueue(_0x5b5787){this['id']=_0x5b5787['id']||0x0;this['name']=_0x5b5787[_0x7102('0x5')]||'';this[_0x7102('0x6')]=_0x5b5787[_0x7102('0x6')]||0xa;this[_0x7102('0x7')]=_0x5b5787['strategy']||_0x7102('0x8');this[_0x7102('0x9')]=_0x5b5787[_0x7102('0x9')];this[_0x7102('0xa')]={};this[_0x7102('0xb')]=0x0;this[_0x7102('0xc')]='';this['updateRouting']();this[_0x7102('0xd')]();}ChatQueue[_0x7102('0xe')][_0x7102('0xf')]=function(){var _0x468249=this[_0x7102('0xa')][_0x7102('0x10')];this['mapAgentsId']=_[_0x7102('0x11')](this[_0x7102('0x9')],'id');this[_0x7102('0xa')]['_rr']=_0x468249;};ChatQueue[_0x7102('0xe')]['updateRealtime']=function(){this[_0x7102('0x12')]=0x0;this[_0x7102('0x13')]=0x0;for(var _0x112bf9=0x0;_0x112bf9<this['Agents'][_0x7102('0x14')];_0x112bf9+=0x1){if(this[_0x7102('0x9')][_0x112bf9][_0x7102('0x15')]){this['loggedIn']+=0x1;}if(this[_0x7102('0x9')][_0x112bf9]['chatPause']){this[_0x7102('0x13')]+=0x1;}}this[_0x7102('0x16')]=this[_0x7102('0x12')]-this[_0x7102('0x13')];this['available']=this[_0x7102('0x16')]>=0x0?this['available']:0x0;var _0x950656={'id':this['id'],'available':this[_0x7102('0x16')],'loggedIn':this[_0x7102('0x12')],'name':this[_0x7102('0x5')],'paused':this[_0x7102('0x13')],'waiting':this[_0x7102('0xb')]};var _0x543010=md5(JSON[_0x7102('0x17')](_0x950656));if(this['md5']!==_0x543010){this[_0x7102('0xc')]=_0x543010;io['to'](util['format'](_0x7102('0x18'),_0x950656[_0x7102('0x5')]))[_0x7102('0x19')]('chat_queue:save',_0x950656);}};module[_0x7102('0x1a')]=ChatQueue;
\ No newline at end of file
index 2dd8c4e..ab32f29 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5c68=['format','fax_queue:save','exports','md5','util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','online','faxPause','available','waiting','stringify'];(function(_0x7a1a50,_0x13593){var _0xe6587d=function(_0x36f8a8){while(--_0x36f8a8){_0x7a1a50['push'](_0x7a1a50['shift']());}};_0xe6587d(++_0x13593);}(_0x5c68,0x11b));var _0x85c6=function(_0x5f3a3c,_0x5915b2){_0x5f3a3c=_0x5f3a3c-0x0;var _0x4c3980=_0x5c68[_0x5f3a3c];return _0x4c3980;};'use strict';var _=require('lodash');var md5=require(_0x85c6('0x0'));var util=require(_0x85c6('0x1'));var Redis=require(_0x85c6('0x2'));var config=require(_0x85c6('0x3'));config['redis']=_['defaults'](config[_0x85c6('0x4')],{'host':_0x85c6('0x5'),'port':0x18eb});var io=require(_0x85c6('0x6'))(new Redis(config[_0x85c6('0x4')]));function FaxQueue(_0x5a45b3){this['id']=_0x5a45b3['id']||0x0;this[_0x85c6('0x7')]=_0x5a45b3[_0x85c6('0x7')]||'';this[_0x85c6('0x8')]=_0x5a45b3[_0x85c6('0x8')]||0xa;this[_0x85c6('0x9')]=_0x5a45b3[_0x85c6('0x9')]||_0x85c6('0xa');this[_0x85c6('0xb')]=_0x5a45b3[_0x85c6('0xb')];this[_0x85c6('0xc')]={};this['waiting']=0x0;this[_0x85c6('0x0')]='';this[_0x85c6('0xd')]();this[_0x85c6('0xe')]();}FaxQueue[_0x85c6('0xf')][_0x85c6('0xd')]=function(){var _0x124d77=this[_0x85c6('0xc')][_0x85c6('0x10')];this['mapAgentsId']=_[_0x85c6('0x11')](this[_0x85c6('0xb')],'id');this[_0x85c6('0xc')][_0x85c6('0x10')]=_0x124d77;};FaxQueue[_0x85c6('0xf')][_0x85c6('0xe')]=function(){this[_0x85c6('0x12')]=0x0;this[_0x85c6('0x13')]=0x0;for(var _0x28042d=0x0;_0x28042d<this[_0x85c6('0xb')]['length'];_0x28042d+=0x1){if(this[_0x85c6('0xb')][_0x28042d][_0x85c6('0x14')]){this[_0x85c6('0x12')]+=0x1;}if(this[_0x85c6('0xb')][_0x28042d][_0x85c6('0x15')]){this[_0x85c6('0x13')]+=0x1;}}this[_0x85c6('0x16')]=this[_0x85c6('0x12')]-this[_0x85c6('0x13')];this['available']=this[_0x85c6('0x16')]>=0x0?this['available']:0x0;var _0x3740ec={'id':this['id'],'available':this[_0x85c6('0x16')],'loggedIn':this['loggedIn'],'name':this[_0x85c6('0x7')],'paused':this[_0x85c6('0x13')],'waiting':this[_0x85c6('0x17')]};var _0x7a4bd9=md5(JSON[_0x85c6('0x18')](_0x3740ec));if(this[_0x85c6('0x0')]!==_0x7a4bd9){this[_0x85c6('0x0')]=_0x7a4bd9;io['to'](util[_0x85c6('0x19')]('fax:queue:%s',_0x3740ec[_0x85c6('0x7')]))['emit'](_0x85c6('0x1a'),_0x3740ec);}};module[_0x85c6('0x1b')]=FaxQueue;
\ No newline at end of file
+var _0x428d=['defaults','localhost','name','timeout','strategy','Agents','mapAgentsId','waiting','updateRouting','_rr','map','prototype','updateRealtime','loggedIn','paused','length','online','available','stringify','format','fax:queue:%s','emit','exports','md5','util','ioredis','../../../config/environment','redis'];(function(_0x3f813b,_0x5884ab){var _0x566d6f=function(_0x5ebaee){while(--_0x5ebaee){_0x3f813b['push'](_0x3f813b['shift']());}};_0x566d6f(++_0x5884ab);}(_0x428d,0xf7));var _0xd428=function(_0x1c2cff,_0x5dab9a){_0x1c2cff=_0x1c2cff-0x0;var _0x24ae75=_0x428d[_0x1c2cff];return _0x24ae75;};'use strict';var _=require('lodash');var md5=require(_0xd428('0x0'));var util=require(_0xd428('0x1'));var Redis=require(_0xd428('0x2'));var config=require(_0xd428('0x3'));config[_0xd428('0x4')]=_[_0xd428('0x5')](config['redis'],{'host':_0xd428('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xd428('0x4')]));function FaxQueue(_0x192c64){this['id']=_0x192c64['id']||0x0;this['name']=_0x192c64[_0xd428('0x7')]||'';this[_0xd428('0x8')]=_0x192c64[_0xd428('0x8')]||0xa;this[_0xd428('0x9')]=_0x192c64[_0xd428('0x9')]||'beepall';this['Agents']=_0x192c64[_0xd428('0xa')];this[_0xd428('0xb')]={};this[_0xd428('0xc')]=0x0;this[_0xd428('0x0')]='';this['updateRouting']();this['updateRealtime']();}FaxQueue['prototype'][_0xd428('0xd')]=function(){var _0x496fac=this[_0xd428('0xb')][_0xd428('0xe')];this[_0xd428('0xb')]=_[_0xd428('0xf')](this[_0xd428('0xa')],'id');this[_0xd428('0xb')][_0xd428('0xe')]=_0x496fac;};FaxQueue[_0xd428('0x10')][_0xd428('0x11')]=function(){this[_0xd428('0x12')]=0x0;this[_0xd428('0x13')]=0x0;for(var _0x19e342=0x0;_0x19e342<this['Agents'][_0xd428('0x14')];_0x19e342+=0x1){if(this['Agents'][_0x19e342][_0xd428('0x15')]){this[_0xd428('0x12')]+=0x1;}if(this[_0xd428('0xa')][_0x19e342]['faxPause']){this[_0xd428('0x13')]+=0x1;}}this['available']=this[_0xd428('0x12')]-this[_0xd428('0x13')];this[_0xd428('0x16')]=this['available']>=0x0?this['available']:0x0;var _0x1c6c9b={'id':this['id'],'available':this[_0xd428('0x16')],'loggedIn':this[_0xd428('0x12')],'name':this['name'],'paused':this[_0xd428('0x13')],'waiting':this['waiting']};var _0x4907a5=md5(JSON[_0xd428('0x17')](_0x1c6c9b));if(this[_0xd428('0x0')]!==_0x4907a5){this[_0xd428('0x0')]=_0x4907a5;io['to'](util[_0xd428('0x18')](_0xd428('0x19'),_0x1c6c9b['name']))[_0xd428('0x1a')]('fax_queue:save',_0x1c6c9b);}};module[_0xd428('0x1b')]=FaxQueue;
\ No newline at end of file
index e57408a..41e6985 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2c91=['name','Intervals','exports'];(function(_0x189937,_0x247ec6){var _0x538962=function(_0x475b41){while(--_0x475b41){_0x189937['push'](_0x189937['shift']());}};_0x538962(++_0x247ec6);}(_0x2c91,0x1dd));var _0x12c9=function(_0x3199dc,_0x2ed322){_0x3199dc=_0x3199dc-0x0;var _0x46e343=_0x2c91[_0x3199dc];return _0x46e343;};'use strict';function Interval(_0x1654af){this['id']=_0x1654af['id']||0x0;this[_0x12c9('0x0')]=_0x1654af[_0x12c9('0x0')]||'';this[_0x12c9('0x1')]=_0x1654af[_0x12c9('0x1')]||{};}module[_0x12c9('0x2')]=Interval;
\ No newline at end of file
+var _0xf3f5=['name','Intervals','exports'];(function(_0x5246b2,_0xf99187){var _0x395c0e=function(_0x4980e0){while(--_0x4980e0){_0x5246b2['push'](_0x5246b2['shift']());}};_0x395c0e(++_0xf99187);}(_0xf3f5,0x153));var _0x5f3f=function(_0x48588d,_0x5bf1e3){_0x48588d=_0x48588d-0x0;var _0x8981c1=_0xf3f5[_0x48588d];return _0x8981c1;};'use strict';function Interval(_0x442602){this['id']=_0x442602['id']||0x0;this[_0x5f3f('0x0')]=_0x442602['name']||'';this[_0x5f3f('0x1')]=_0x442602['Intervals']||{};}module[_0x5f3f('0x2')]=Interval;
\ No newline at end of file
index 2e805f5..6883356 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc343=['length','available','stringify','mail:queue:%s','emit','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','name','timeout','strategy','beepall','Agents','waiting','updateRouting','updateRealtime','prototype','mapAgentsId','_rr','map','loggedIn','paused'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc343,0xae));var _0x3c34=function(_0x34fb19,_0x3e71b5){_0x34fb19=_0x34fb19-0x0;var _0x535898=_0xc343[_0x34fb19];return _0x535898;};'use strict';var _=require(_0x3c34('0x0'));var md5=require(_0x3c34('0x1'));var util=require(_0x3c34('0x2'));var Redis=require(_0x3c34('0x3'));var config=require(_0x3c34('0x4'));config[_0x3c34('0x5')]=_[_0x3c34('0x6')](config[_0x3c34('0x5')],{'host':_0x3c34('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x3c34('0x5')]));function MailQueue(_0x48520e){this['id']=_0x48520e['id']||0x0;this[_0x3c34('0x8')]=_0x48520e['name']||'';this[_0x3c34('0x9')]=_0x48520e['timeout']||0xa;this[_0x3c34('0xa')]=_0x48520e['strategy']||_0x3c34('0xb');this[_0x3c34('0xc')]=_0x48520e[_0x3c34('0xc')];this['mapAgentsId']={};this[_0x3c34('0xd')]=0x0;this['md5']='';this[_0x3c34('0xe')]();this[_0x3c34('0xf')]();}MailQueue[_0x3c34('0x10')]['updateRouting']=function(){var _0x56b7f7=this[_0x3c34('0x11')][_0x3c34('0x12')];this[_0x3c34('0x11')]=_[_0x3c34('0x13')](this[_0x3c34('0xc')],'id');this[_0x3c34('0x11')][_0x3c34('0x12')]=_0x56b7f7;};MailQueue[_0x3c34('0x10')][_0x3c34('0xf')]=function(){this[_0x3c34('0x14')]=0x0;this[_0x3c34('0x15')]=0x0;for(var _0x5c6c70=0x0;_0x5c6c70<this[_0x3c34('0xc')][_0x3c34('0x16')];_0x5c6c70+=0x1){if(this[_0x3c34('0xc')][_0x5c6c70]['online']){this[_0x3c34('0x14')]+=0x1;}if(this['Agents'][_0x5c6c70]['mailPause']){this[_0x3c34('0x15')]+=0x1;}}this[_0x3c34('0x17')]=this[_0x3c34('0x14')]-this['paused'];this[_0x3c34('0x17')]=this['available']>=0x0?this['available']:0x0;var _0x31c273={'id':this['id'],'available':this['available'],'loggedIn':this[_0x3c34('0x14')],'name':this[_0x3c34('0x8')],'paused':this[_0x3c34('0x15')],'waiting':this[_0x3c34('0xd')]};var _0x241113=md5(JSON[_0x3c34('0x18')](_0x31c273));if(this['md5']!==_0x241113){this[_0x3c34('0x1')]=_0x241113;io['to'](util['format'](_0x3c34('0x19'),_0x31c273[_0x3c34('0x8')]))[_0x3c34('0x1a')]('mail_queue:save',_0x31c273);}};module[_0x3c34('0x1b')]=MailQueue;
\ No newline at end of file
+var _0x0ede=['../../../config/environment','redis','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','prototype','_rr','map','updateRealtime','loggedIn','length','online','paused','available','waiting','format','mail:queue:%s','mail_queue:save','exports','md5','util','ioredis'];(function(_0xb9c540,_0x434470){var _0x8d4bde=function(_0x590978){while(--_0x590978){_0xb9c540['push'](_0xb9c540['shift']());}};_0x8d4bde(++_0x434470);}(_0x0ede,0x192));var _0xe0ed=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x0ede[_0x2dafbe];return _0x58a45a;};'use strict';var _=require('lodash');var md5=require(_0xe0ed('0x0'));var util=require(_0xe0ed('0x1'));var Redis=require(_0xe0ed('0x2'));var config=require(_0xe0ed('0x3'));config[_0xe0ed('0x4')]=_['defaults'](config[_0xe0ed('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0xe0ed('0x5'))(new Redis(config[_0xe0ed('0x4')]));function MailQueue(_0x33efce){this['id']=_0x33efce['id']||0x0;this['name']=_0x33efce[_0xe0ed('0x6')]||'';this[_0xe0ed('0x7')]=_0x33efce[_0xe0ed('0x7')]||0xa;this['strategy']=_0x33efce[_0xe0ed('0x8')]||_0xe0ed('0x9');this[_0xe0ed('0xa')]=_0x33efce['Agents'];this[_0xe0ed('0xb')]={};this['waiting']=0x0;this[_0xe0ed('0x0')]='';this[_0xe0ed('0xc')]();this['updateRealtime']();}MailQueue[_0xe0ed('0xd')][_0xe0ed('0xc')]=function(){var _0x322042=this[_0xe0ed('0xb')][_0xe0ed('0xe')];this['mapAgentsId']=_[_0xe0ed('0xf')](this['Agents'],'id');this[_0xe0ed('0xb')][_0xe0ed('0xe')]=_0x322042;};MailQueue[_0xe0ed('0xd')][_0xe0ed('0x10')]=function(){this[_0xe0ed('0x11')]=0x0;this['paused']=0x0;for(var _0x57cae7=0x0;_0x57cae7<this[_0xe0ed('0xa')][_0xe0ed('0x12')];_0x57cae7+=0x1){if(this[_0xe0ed('0xa')][_0x57cae7][_0xe0ed('0x13')]){this[_0xe0ed('0x11')]+=0x1;}if(this[_0xe0ed('0xa')][_0x57cae7]['mailPause']){this[_0xe0ed('0x14')]+=0x1;}}this[_0xe0ed('0x15')]=this[_0xe0ed('0x11')]-this[_0xe0ed('0x14')];this[_0xe0ed('0x15')]=this[_0xe0ed('0x15')]>=0x0?this[_0xe0ed('0x15')]:0x0;var _0xdbd1e7={'id':this['id'],'available':this[_0xe0ed('0x15')],'loggedIn':this[_0xe0ed('0x11')],'name':this[_0xe0ed('0x6')],'paused':this['paused'],'waiting':this[_0xe0ed('0x16')]};var _0x5ac94c=md5(JSON['stringify'](_0xdbd1e7));if(this[_0xe0ed('0x0')]!==_0x5ac94c){this['md5']=_0x5ac94c;io['to'](util[_0xe0ed('0x17')](_0xe0ed('0x18'),_0xdbd1e7[_0xe0ed('0x6')]))['emit'](_0xe0ed('0x19'),_0xdbd1e7);}};module[_0xe0ed('0x1a')]=MailQueue;
\ No newline at end of file
index 3c39eea..e4973bb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x326f=['exports','lodash','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','mapAgentsId','waiting','md5','updateRouting','updateRealtime','Agents','prototype','loggedIn','paused','online','openchannelPause','available','stringify','openchannel:queue:%s','openchannel_queue:save'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0x326f,0xd1));var _0xf326=function(_0x437a1d,_0x529965){_0x437a1d=_0x437a1d-0x0;var _0x232ed5=_0x326f[_0x437a1d];return _0x232ed5;};'use strict';var _=require(_0xf326('0x0'));var md5=require('md5');var util=require('util');var Redis=require(_0xf326('0x1'));var config=require(_0xf326('0x2'));config[_0xf326('0x3')]=_[_0xf326('0x4')](config[_0xf326('0x3')],{'host':_0xf326('0x5'),'port':0x18eb});var io=require(_0xf326('0x6'))(new Redis(config[_0xf326('0x3')]));function OpenchannelQueue(_0x1b5a56){this['id']=_0x1b5a56['id']||0x0;this[_0xf326('0x7')]=_0x1b5a56['name']||'';this[_0xf326('0x8')]=_0x1b5a56[_0xf326('0x8')]||0xa;this[_0xf326('0x9')]=_0x1b5a56[_0xf326('0x9')]||'beepall';this['Agents']=_0x1b5a56['Agents'];this[_0xf326('0xa')]={};this[_0xf326('0xb')]=0x0;this[_0xf326('0xc')]='';this[_0xf326('0xd')]();this[_0xf326('0xe')]();}OpenchannelQueue['prototype'][_0xf326('0xd')]=function(){var _0x53cbcd=this[_0xf326('0xa')]['_rr'];this[_0xf326('0xa')]=_['map'](this[_0xf326('0xf')],'id');this[_0xf326('0xa')]['_rr']=_0x53cbcd;};OpenchannelQueue[_0xf326('0x10')][_0xf326('0xe')]=function(){this[_0xf326('0x11')]=0x0;this[_0xf326('0x12')]=0x0;for(var _0x5c8483=0x0;_0x5c8483<this[_0xf326('0xf')]['length'];_0x5c8483+=0x1){if(this['Agents'][_0x5c8483][_0xf326('0x13')]){this[_0xf326('0x11')]+=0x1;}if(this[_0xf326('0xf')][_0x5c8483][_0xf326('0x14')]){this[_0xf326('0x12')]+=0x1;}}this[_0xf326('0x15')]=this[_0xf326('0x11')]-this[_0xf326('0x12')];this['available']=this[_0xf326('0x15')]>=0x0?this[_0xf326('0x15')]:0x0;var _0x18bee3={'id':this['id'],'available':this[_0xf326('0x15')],'loggedIn':this[_0xf326('0x11')],'name':this[_0xf326('0x7')],'paused':this['paused'],'waiting':this['waiting']};var _0x56ad41=md5(JSON[_0xf326('0x16')](_0x18bee3));if(this[_0xf326('0xc')]!==_0x56ad41){this['md5']=_0x56ad41;io['to'](util['format'](_0xf326('0x17'),_0x18bee3['name']))['emit'](_0xf326('0x18'),_0x18bee3);}};module[_0xf326('0x19')]=OpenchannelQueue;
\ No newline at end of file
+var _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(_0xfb845c,_0x1945ff){var _0x3ca188=function(_0x28fbc6){while(--_0x28fbc6){_0xfb845c['push'](_0xfb845c['shift']());}};_0x3ca188(++_0x1945ff);}(_0x5fc3,0xa8));var _0x35fc=function(_0x254abd,_0x1ab7f0){_0x254abd=_0x254abd-0x0;var _0x31bf1b=_0x5fc3[_0x254abd];return _0x31bf1b;};'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 a821f43..ce36a6f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8a55=['updateRouting','updateRealtime','prototype','_rr','map','loggedIn','length','online','smsPause','paused','available','stringify','format','sms:queue:%s','emit','sms_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','waiting'];(function(_0x521599,_0x38dcf0){var _0x4441c1=function(_0x1dfd0f){while(--_0x1dfd0f){_0x521599['push'](_0x521599['shift']());}};_0x4441c1(++_0x38dcf0);}(_0x8a55,0x185));var _0x58a5=function(_0x127da2,_0x1d09f3){_0x127da2=_0x127da2-0x0;var _0xcabd75=_0x8a55[_0x127da2];return _0xcabd75;};'use strict';var _=require(_0x58a5('0x0'));var md5=require(_0x58a5('0x1'));var util=require(_0x58a5('0x2'));var Redis=require(_0x58a5('0x3'));var config=require(_0x58a5('0x4'));config[_0x58a5('0x5')]=_[_0x58a5('0x6')](config[_0x58a5('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x58a5('0x7'))(new Redis(config[_0x58a5('0x5')]));function SmsQueue(_0x4e2752){this['id']=_0x4e2752['id']||0x0;this[_0x58a5('0x8')]=_0x4e2752[_0x58a5('0x8')]||'';this[_0x58a5('0x9')]=_0x4e2752[_0x58a5('0x9')]||0xa;this[_0x58a5('0xa')]=_0x4e2752[_0x58a5('0xa')]||'beepall';this[_0x58a5('0xb')]=_0x4e2752[_0x58a5('0xb')];this[_0x58a5('0xc')]={};this[_0x58a5('0xd')]=0x0;this[_0x58a5('0x1')]='';this[_0x58a5('0xe')]();this[_0x58a5('0xf')]();}SmsQueue[_0x58a5('0x10')][_0x58a5('0xe')]=function(){var _0x2f6bd9=this[_0x58a5('0xc')][_0x58a5('0x11')];this[_0x58a5('0xc')]=_[_0x58a5('0x12')](this['Agents'],'id');this[_0x58a5('0xc')][_0x58a5('0x11')]=_0x2f6bd9;};SmsQueue[_0x58a5('0x10')][_0x58a5('0xf')]=function(){this[_0x58a5('0x13')]=0x0;this['paused']=0x0;for(var _0x504295=0x0;_0x504295<this[_0x58a5('0xb')][_0x58a5('0x14')];_0x504295+=0x1){if(this[_0x58a5('0xb')][_0x504295][_0x58a5('0x15')]){this[_0x58a5('0x13')]+=0x1;}if(this['Agents'][_0x504295][_0x58a5('0x16')]){this[_0x58a5('0x17')]+=0x1;}}this['available']=this[_0x58a5('0x13')]-this[_0x58a5('0x17')];this['available']=this[_0x58a5('0x18')]>=0x0?this[_0x58a5('0x18')]:0x0;var _0x59c170={'id':this['id'],'available':this['available'],'loggedIn':this[_0x58a5('0x13')],'name':this['name'],'paused':this['paused'],'waiting':this['waiting']};var _0x12abb2=md5(JSON[_0x58a5('0x19')](_0x59c170));if(this['md5']!==_0x12abb2){this[_0x58a5('0x1')]=_0x12abb2;io['to'](util[_0x58a5('0x1a')](_0x58a5('0x1b'),_0x59c170['name']))[_0x58a5('0x1c')](_0x58a5('0x1d'),_0x59c170);}};module[_0x58a5('0x1e')]=SmsQueue;
\ No newline at end of file
+var _0xb2ff=['smsPause','available','sms:queue:%s','sms_queue:save','exports','lodash','md5','ioredis','redis','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','updateRouting','prototype','mapAgentsId','_rr','map','updateRealtime','loggedIn','paused','length','online'];(function(_0x435d6c,_0x4871fa){var _0xe93e42=function(_0x20d6ba){while(--_0x20d6ba){_0x435d6c['push'](_0x435d6c['shift']());}};_0xe93e42(++_0x4871fa);}(_0xb2ff,0x123));var _0xfb2f=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xb2ff[_0xfae23b];return _0x200640;};'use strict';var _=require(_0xfb2f('0x0'));var md5=require(_0xfb2f('0x1'));var util=require('util');var Redis=require(_0xfb2f('0x2'));var config=require('../../../config/environment');config['redis']=_['defaults'](config[_0xfb2f('0x3')],{'host':'localhost','port':0x18eb});var io=require(_0xfb2f('0x4'))(new Redis(config[_0xfb2f('0x3')]));function SmsQueue(_0x3c5835){this['id']=_0x3c5835['id']||0x0;this[_0xfb2f('0x5')]=_0x3c5835['name']||'';this['timeout']=_0x3c5835[_0xfb2f('0x6')]||0xa;this['strategy']=_0x3c5835[_0xfb2f('0x7')]||_0xfb2f('0x8');this[_0xfb2f('0x9')]=_0x3c5835[_0xfb2f('0x9')];this['mapAgentsId']={};this[_0xfb2f('0xa')]=0x0;this['md5']='';this[_0xfb2f('0xb')]();this['updateRealtime']();}SmsQueue[_0xfb2f('0xc')][_0xfb2f('0xb')]=function(){var _0x31ffea=this[_0xfb2f('0xd')][_0xfb2f('0xe')];this['mapAgentsId']=_[_0xfb2f('0xf')](this[_0xfb2f('0x9')],'id');this[_0xfb2f('0xd')][_0xfb2f('0xe')]=_0x31ffea;};SmsQueue[_0xfb2f('0xc')][_0xfb2f('0x10')]=function(){this[_0xfb2f('0x11')]=0x0;this[_0xfb2f('0x12')]=0x0;for(var _0x5f3893=0x0;_0x5f3893<this[_0xfb2f('0x9')][_0xfb2f('0x13')];_0x5f3893+=0x1){if(this[_0xfb2f('0x9')][_0x5f3893][_0xfb2f('0x14')]){this[_0xfb2f('0x11')]+=0x1;}if(this['Agents'][_0x5f3893][_0xfb2f('0x15')]){this[_0xfb2f('0x12')]+=0x1;}}this[_0xfb2f('0x16')]=this[_0xfb2f('0x11')]-this[_0xfb2f('0x12')];this[_0xfb2f('0x16')]=this['available']>=0x0?this[_0xfb2f('0x16')]:0x0;var _0x239a88={'id':this['id'],'available':this['available'],'loggedIn':this[_0xfb2f('0x11')],'name':this[_0xfb2f('0x5')],'paused':this[_0xfb2f('0x12')],'waiting':this[_0xfb2f('0xa')]};var _0x448216=md5(JSON['stringify'](_0x239a88));if(this['md5']!==_0x448216){this[_0xfb2f('0x1')]=_0x448216;io['to'](util['format'](_0xfb2f('0x17'),_0x239a88['name']))['emit'](_0xfb2f('0x18'),_0x239a88);}};module[_0xfb2f('0x19')]=SmsQueue;
\ No newline at end of file
index 3d95545..8eeada6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7117=['md5','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','Agents','loggedIn','paused','online','whatsappPause','available','stringify','format','whatsapp:queue:%s','emit','whatsapp_queue:save','exports'];(function(_0x565c49,_0x54acd0){var _0x20ca34=function(_0x42f7e1){while(--_0x42f7e1){_0x565c49['push'](_0x565c49['shift']());}};_0x20ca34(++_0x54acd0);}(_0x7117,0x1b0));var _0x7711=function(_0x3d6bcc,_0x26e0e3){_0x3d6bcc=_0x3d6bcc-0x0;var _0x3d947c=_0x7117[_0x3d6bcc];return _0x3d947c;};'use strict';var _=require('lodash');var md5=require(_0x7711('0x0'));var util=require('util');var Redis=require('ioredis');var config=require(_0x7711('0x1'));config[_0x7711('0x2')]=_['defaults'](config[_0x7711('0x2')],{'host':_0x7711('0x3'),'port':0x18eb});var io=require(_0x7711('0x4'))(new Redis(config[_0x7711('0x2')]));function WhatsappQueue(_0x2a8c7){this['id']=_0x2a8c7['id']||0x0;this[_0x7711('0x5')]=_0x2a8c7[_0x7711('0x5')]||'';this[_0x7711('0x6')]=_0x2a8c7[_0x7711('0x6')]||0xa;this[_0x7711('0x7')]=_0x2a8c7[_0x7711('0x7')]||'beepall';this['Agents']=_0x2a8c7['Agents'];this[_0x7711('0x8')]={};this[_0x7711('0x9')]=0x0;this[_0x7711('0x0')]='';this[_0x7711('0xa')]();this[_0x7711('0xb')]();}WhatsappQueue[_0x7711('0xc')][_0x7711('0xa')]=function(){var _0x3b7eff=this[_0x7711('0x8')][_0x7711('0xd')];this['mapAgentsId']=_[_0x7711('0xe')](this[_0x7711('0xf')],'id');this[_0x7711('0x8')][_0x7711('0xd')]=_0x3b7eff;};WhatsappQueue[_0x7711('0xc')][_0x7711('0xb')]=function(){this[_0x7711('0x10')]=0x0;this[_0x7711('0x11')]=0x0;for(var _0x4a0912=0x0;_0x4a0912<this[_0x7711('0xf')]['length'];_0x4a0912+=0x1){if(this[_0x7711('0xf')][_0x4a0912][_0x7711('0x12')]){this[_0x7711('0x10')]+=0x1;}if(this['Agents'][_0x4a0912][_0x7711('0x13')]){this['paused']+=0x1;}}this['available']=this[_0x7711('0x10')]-this['paused'];this[_0x7711('0x14')]=this[_0x7711('0x14')]>=0x0?this[_0x7711('0x14')]:0x0;var _0x13815a={'id':this['id'],'available':this[_0x7711('0x14')],'loggedIn':this[_0x7711('0x10')],'name':this[_0x7711('0x5')],'paused':this[_0x7711('0x11')],'waiting':this['waiting']};var _0x228620=md5(JSON[_0x7711('0x15')](_0x13815a));if(this['md5']!==_0x228620){this[_0x7711('0x0')]=_0x228620;io['to'](util[_0x7711('0x16')](_0x7711('0x17'),_0x13815a[_0x7711('0x5')]))[_0x7711('0x18')](_0x7711('0x19'),_0x13815a);}};module[_0x7711('0x1a')]=WhatsappQueue;
\ No newline at end of file
+var _0x2579=['localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','_rr','map','prototype','loggedIn','paused','length','online','available','stringify','format','whatsapp:queue:%s','emit','whatsapp_queue:save','exports','lodash','md5','util','../../../config/environment','redis','defaults'];(function(_0x1790dc,_0x15fa5a){var _0x20ac30=function(_0x503b24){while(--_0x503b24){_0x1790dc['push'](_0x1790dc['shift']());}};_0x20ac30(++_0x15fa5a);}(_0x2579,0x130));var _0x9257=function(_0x1c3310,_0xfea273){_0x1c3310=_0x1c3310-0x0;var _0x4f77b2=_0x2579[_0x1c3310];return _0x4f77b2;};'use strict';var _=require(_0x9257('0x0'));var md5=require(_0x9257('0x1'));var util=require(_0x9257('0x2'));var Redis=require('ioredis');var config=require(_0x9257('0x3'));config[_0x9257('0x4')]=_[_0x9257('0x5')](config[_0x9257('0x4')],{'host':_0x9257('0x6'),'port':0x18eb});var io=require(_0x9257('0x7'))(new Redis(config['redis']));function WhatsappQueue(_0x3b514d){this['id']=_0x3b514d['id']||0x0;this['name']=_0x3b514d[_0x9257('0x8')]||'';this[_0x9257('0x9')]=_0x3b514d['timeout']||0xa;this['strategy']=_0x3b514d[_0x9257('0xa')]||_0x9257('0xb');this[_0x9257('0xc')]=_0x3b514d[_0x9257('0xc')];this[_0x9257('0xd')]={};this[_0x9257('0xe')]=0x0;this['md5']='';this[_0x9257('0xf')]();this[_0x9257('0x10')]();}WhatsappQueue['prototype'][_0x9257('0xf')]=function(){var _0x107864=this[_0x9257('0xd')][_0x9257('0x11')];this['mapAgentsId']=_[_0x9257('0x12')](this[_0x9257('0xc')],'id');this[_0x9257('0xd')][_0x9257('0x11')]=_0x107864;};WhatsappQueue[_0x9257('0x13')]['updateRealtime']=function(){this[_0x9257('0x14')]=0x0;this[_0x9257('0x15')]=0x0;for(var _0x2fb138=0x0;_0x2fb138<this['Agents'][_0x9257('0x16')];_0x2fb138+=0x1){if(this['Agents'][_0x2fb138][_0x9257('0x17')]){this[_0x9257('0x14')]+=0x1;}if(this[_0x9257('0xc')][_0x2fb138]['whatsappPause']){this[_0x9257('0x15')]+=0x1;}}this[_0x9257('0x18')]=this['loggedIn']-this[_0x9257('0x15')];this[_0x9257('0x18')]=this[_0x9257('0x18')]>=0x0?this[_0x9257('0x18')]:0x0;var _0x2b99ef={'id':this['id'],'available':this[_0x9257('0x18')],'loggedIn':this[_0x9257('0x14')],'name':this[_0x9257('0x8')],'paused':this[_0x9257('0x15')],'waiting':this[_0x9257('0xe')]};var _0xd1dc37=md5(JSON[_0x9257('0x19')](_0x2b99ef));if(this[_0x9257('0x1')]!==_0xd1dc37){this[_0x9257('0x1')]=_0xd1dc37;io['to'](util[_0x9257('0x1a')](_0x9257('0x1b'),_0x2b99ef[_0x9257('0x8')]))[_0x9257('0x1c')](_0x9257('0x1d'),_0x2b99ef);}};module[_0x9257('0x1e')]=WhatsappQueue;
\ No newline at end of file
index c286f80..d5b6376 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb10b=['faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','isUndefined','initIntervals','length','initOpenchannelQueues','updateRealtime','initChatQueues','chatQueues','initSmsQueues','updateRouting','initMailQueues','initFaxQueues','initWhatsappQueues','exports','bluebird','lodash','moment','../model/agent','../model/openchannelQueue','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','smsQueues','mailQueues'];(function(_0x31c96c,_0x389cd5){var _0x1757ac=function(_0x7e8026){while(--_0x7e8026){_0x31c96c['push'](_0x31c96c['shift']());}};_0x1757ac(++_0x389cd5);}(_0xb10b,0x12a));var _0xbb10=function(_0xc6379f,_0x5d0315){_0xc6379f=_0xc6379f-0x0;var _0x437fe8=_0xb10b[_0xc6379f];return _0x437fe8;};'use strict';var BPromise=require(_0xbb10('0x0'));var util=require('util');var _=require(_0xbb10('0x1'));var moment=require(_0xbb10('0x2'));var Agent=require(_0xbb10('0x3'));var Interval=require('../model/interval');var OpenchannelQueue=require(_0xbb10('0x4'));var ChatQueue=require(_0xbb10('0x5'));var SmsQueue=require(_0xbb10('0x6'));var MailQueue=require(_0xbb10('0x7'));var FaxQueue=require(_0xbb10('0x8'));var WhatsappQueue=require(_0xbb10('0x9'));var Realtime=function(){this['agents']={};this[_0xbb10('0xa')]={};this[_0xbb10('0xb')]={};this['chatQueues']={};this[_0xbb10('0xc')]={};this[_0xbb10('0xd')]={};this[_0xbb10('0xe')]={};this[_0xbb10('0xf')]={};this[_0xbb10('0x10')]={};this[_0xbb10('0x11')]={};this[_0xbb10('0x12')]={};this[_0xbb10('0x13')]={};this['faxQueuesWaitingInteractions']={};this['whatsappQueuesWaitingInteractions']={};};function freeIsNotKey(_0x20bd61,_0x118a74,_0xce64f3){var _0x5e136d=_[_0xbb10('0x14')](_0x20bd61,function(_0x5be7e0,_0x44fb19){return _0x5be7e0[_0xce64f3];});for(var _0x916a32 in _0x118a74){if(_0x118a74[_0xbb10('0x15')](_0x916a32)){if(!_0x5e136d[_0x916a32]){delete _0x118a74[_0x916a32];}}}}Realtime[_0xbb10('0x16')][_0xbb10('0x17')]=function(_0x147230,_0x58a612){for(var _0x26e021 in _0x58a612){if(_0x147230[_0xbb10('0x15')](_0x26e021)){_0x147230[_0x26e021]=_0x58a612[_0x26e021];}}};Realtime[_0xbb10('0x16')][_0xbb10('0x18')]=function(){var _0x3df17b=this;return function(_0x2f2ebf){if(_0x2f2ebf){freeIsNotKey(_0x2f2ebf,_0x3df17b[_0xbb10('0x19')],'id');for(var _0x36b5e8=0x0,_0x3e26f4={},_0x2b184e={};_0x36b5e8<_0x2f2ebf['length'];_0x36b5e8+=0x1){_0x3e26f4=_0x2f2ebf[_0x36b5e8];if(_[_0xbb10('0x1a')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']])){_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']]=new Agent(_0x3e26f4);}else{_0x3df17b[_0xbb10('0x17')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']],_0x3e26f4);}}}return _0x3df17b[_0xbb10('0x19')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x1b')]=function(){var _0xbf2906=this;return function(_0xe1c665){if(_0xe1c665){freeIsNotKey(_0xe1c665,_0xbf2906['intervals'],'id');for(var _0x5ff0cf=0x0,_0x19f48d={},_0x388fab={};_0x5ff0cf<_0xe1c665[_0xbb10('0x1c')];_0x5ff0cf+=0x1){_0x19f48d=_0xe1c665[_0x5ff0cf];if(_[_0xbb10('0x1a')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']])){_0xbf2906['intervals'][_0x19f48d['id']]=new Interval(_0x19f48d);}else{_0xbf2906[_0xbb10('0x17')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']],_0x19f48d);}}}return _0xbf2906['intervals'];};};Realtime['prototype'][_0xbb10('0x1d')]=function(){var _0x311abe=this;return function(_0x2e911d){if(_0x2e911d){freeIsNotKey(_0x2e911d,_0x311abe[_0xbb10('0xb')],'id');for(var _0x445761=0x0,_0x1824b7={},_0x407cb4={};_0x445761<_0x2e911d[_0xbb10('0x1c')];_0x445761+=0x1){_0x1824b7=_0x2e911d[_0x445761];if(_[_0xbb10('0x1a')](_0x311abe[_0xbb10('0xb')][_0x1824b7['id']])){_0x311abe[_0xbb10('0xb')][_0x1824b7['id']]=new OpenchannelQueue(_0x1824b7);}else{_0x311abe[_0xbb10('0x17')](_0x311abe['openchannelQueues'][_0x1824b7['id']],_0x1824b7);}_0x311abe['openchannelQueues'][_0x1824b7['id']]['updateRouting']();_0x311abe[_0xbb10('0xb')][_0x1824b7['id']][_0xbb10('0x1e')]();}}return _0x311abe[_0xbb10('0xb')];};};Realtime['prototype'][_0xbb10('0x1f')]=function(){var _0x24d586=this;return function(_0x6ed43b){if(_0x6ed43b){freeIsNotKey(_0x6ed43b,_0x24d586[_0xbb10('0x20')],'id');for(var _0x1acce9=0x0,_0x20d946={},_0x2a0e8b={};_0x1acce9<_0x6ed43b['length'];_0x1acce9+=0x1){_0x20d946=_0x6ed43b[_0x1acce9];if(_[_0xbb10('0x1a')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']])){_0x24d586[_0xbb10('0x20')][_0x20d946['id']]=new ChatQueue(_0x20d946);}else{_0x24d586[_0xbb10('0x17')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']],_0x20d946);}_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRouting']();_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRealtime']();}}return _0x24d586[_0xbb10('0x20')];};};Realtime['prototype'][_0xbb10('0x21')]=function(){var _0x1dcc9c=this;return function(_0x1b59f9){if(_0x1b59f9){freeIsNotKey(_0x1b59f9,_0x1dcc9c['smsQueues'],'id');for(var _0x518d47=0x0,_0x4c3744={},_0x34f65e={};_0x518d47<_0x1b59f9['length'];_0x518d47+=0x1){_0x4c3744=_0x1b59f9[_0x518d47];if(_[_0xbb10('0x1a')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']])){_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']]=new SmsQueue(_0x4c3744);}else{_0x1dcc9c[_0xbb10('0x17')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']],_0x4c3744);}_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']][_0xbb10('0x22')]();_0x1dcc9c['smsQueues'][_0x4c3744['id']][_0xbb10('0x1e')]();}}return _0x1dcc9c[_0xbb10('0xc')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x23')]=function(){var _0xfb2c5e=this;return function(_0x9de708){if(_0x9de708){freeIsNotKey(_0x9de708,_0xfb2c5e[_0xbb10('0xd')],'id');for(var _0x10202c=0x0,_0x3c8d7d={},_0x56943c={};_0x10202c<_0x9de708[_0xbb10('0x1c')];_0x10202c+=0x1){_0x3c8d7d=_0x9de708[_0x10202c];if(_[_0xbb10('0x1a')](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']])){_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']]=new MailQueue(_0x3c8d7d);}else{_0xfb2c5e['mergeFromDatabase'](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']],_0x3c8d7d);}_0xfb2c5e['mailQueues'][_0x3c8d7d['id']]['updateRouting']();_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']][_0xbb10('0x1e')]();}}return _0xfb2c5e[_0xbb10('0xd')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x24')]=function(){var _0x29d11a=this;return function(_0x547062){if(_0x547062){freeIsNotKey(_0x547062,_0x29d11a[_0xbb10('0xe')],'id');for(var _0x25d72f=0x0,_0x52de31={},_0x5e3fbd={};_0x25d72f<_0x547062['length'];_0x25d72f+=0x1){_0x52de31=_0x547062[_0x25d72f];if(_[_0xbb10('0x1a')](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']])){_0x29d11a[_0xbb10('0xe')][_0x52de31['id']]=new FaxQueue(_0x52de31);}else{_0x29d11a['mergeFromDatabase'](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']],_0x52de31);}_0x29d11a[_0xbb10('0xe')][_0x52de31['id']][_0xbb10('0x22')]();_0x29d11a['faxQueues'][_0x52de31['id']][_0xbb10('0x1e')]();}}return _0x29d11a[_0xbb10('0xe')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x25')]=function(){var _0x4f1cdd=this;return function(_0xd238e9){if(_0xd238e9){freeIsNotKey(_0xd238e9,_0x4f1cdd[_0xbb10('0xf')],'id');for(var _0x5835fd=0x0,_0xe2040f={},_0x2e3214={};_0x5835fd<_0xd238e9[_0xbb10('0x1c')];_0x5835fd+=0x1){_0xe2040f=_0xd238e9[_0x5835fd];if(_[_0xbb10('0x1a')](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']])){_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]=new WhatsappQueue(_0xe2040f);}else{_0x4f1cdd['mergeFromDatabase'](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']],_0xe2040f);}_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']][_0xbb10('0x22')]();_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]['updateRealtime']();}}return _0x4f1cdd[_0xbb10('0xf')];};};module[_0xbb10('0x26')]=Realtime;
\ No newline at end of file
+var _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(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0xa9e0[_0x3899d1];return _0xeb4a7d;};'use strict';var BPromise=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var moment=require('moment');var Agent=require('../model/agent');var Interval=require(_0x0a9e('0x3'));var OpenchannelQueue=require('../model/openchannelQueue');var ChatQueue=require(_0x0a9e('0x4'));var SmsQueue=require(_0x0a9e('0x5'));var MailQueue=require(_0x0a9e('0x6'));var FaxQueue=require(_0x0a9e('0x7'));var WhatsappQueue=require(_0x0a9e('0x8'));var Realtime=function(){this['agents']={};this[_0x0a9e('0x9')]={};this[_0x0a9e('0xa')]={};this[_0x0a9e('0xb')]={};this['smsQueues']={};this['mailQueues']={};this[_0x0a9e('0xc')]={};this['whatsappQueues']={};this['chatQueuesWaitingInteractions']={};this[_0x0a9e('0xd')]={};this[_0x0a9e('0xe')]={};this[_0x0a9e('0xf')]={};this[_0x0a9e('0x10')]={};this[_0x0a9e('0x11')]={};};function freeIsNotKey(_0xbd1168,_0x4a4c56,_0x50dfb2){var _0x527cdd=_['mapKeys'](_0xbd1168,function(_0x273d4d,_0x36471c){return _0x273d4d[_0x50dfb2];});for(var _0xd5b662 in _0x4a4c56){if(_0x4a4c56[_0x0a9e('0x12')](_0xd5b662)){if(!_0x527cdd[_0xd5b662]){delete _0x4a4c56[_0xd5b662];}}}}Realtime[_0x0a9e('0x13')][_0x0a9e('0x14')]=function(_0x5db4b0,_0x4283ce){for(var _0x239b12 in _0x4283ce){if(_0x5db4b0[_0x0a9e('0x12')](_0x239b12)){_0x5db4b0[_0x239b12]=_0x4283ce[_0x239b12];}}};Realtime[_0x0a9e('0x13')][_0x0a9e('0x15')]=function(){var _0x4d5611=this;return function(_0x52a03d){if(_0x52a03d){freeIsNotKey(_0x52a03d,_0x4d5611[_0x0a9e('0x16')],'id');for(var _0x5d0880=0x0,_0x1985b6={},_0x519dfd={};_0x5d0880<_0x52a03d[_0x0a9e('0x17')];_0x5d0880+=0x1){_0x1985b6=_0x52a03d[_0x5d0880];if(_[_0x0a9e('0x18')](_0x4d5611['agents'][_0x1985b6['id']])){_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']]=new Agent(_0x1985b6);}else{_0x4d5611['mergeFromDatabase'](_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']],_0x1985b6);}}}return _0x4d5611[_0x0a9e('0x16')];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x19')]=function(){var _0x31b1ca=this;return function(_0x2eb11f){if(_0x2eb11f){freeIsNotKey(_0x2eb11f,_0x31b1ca[_0x0a9e('0x9')],'id');for(var _0x20559e=0x0,_0x1314ae={},_0x112016={};_0x20559e<_0x2eb11f[_0x0a9e('0x17')];_0x20559e+=0x1){_0x1314ae=_0x2eb11f[_0x20559e];if(_[_0x0a9e('0x18')](_0x31b1ca['intervals'][_0x1314ae['id']])){_0x31b1ca[_0x0a9e('0x9')][_0x1314ae['id']]=new Interval(_0x1314ae);}else{_0x31b1ca[_0x0a9e('0x14')](_0x31b1ca['intervals'][_0x1314ae['id']],_0x1314ae);}}}return _0x31b1ca[_0x0a9e('0x9')];};};Realtime['prototype']['initOpenchannelQueues']=function(){var _0x3a02e1=this;return function(_0x432e56){if(_0x432e56){freeIsNotKey(_0x432e56,_0x3a02e1[_0x0a9e('0xa')],'id');for(var _0x30bae6=0x0,_0x4abc77={},_0xfb6e48={};_0x30bae6<_0x432e56[_0x0a9e('0x17')];_0x30bae6+=0x1){_0x4abc77=_0x432e56[_0x30bae6];if(_[_0x0a9e('0x18')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']])){_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']]=new OpenchannelQueue(_0x4abc77);}else{_0x3a02e1[_0x0a9e('0x14')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']],_0x4abc77);}_0x3a02e1['openchannelQueues'][_0x4abc77['id']]['updateRouting']();_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']][_0x0a9e('0x1a')]();}}return _0x3a02e1[_0x0a9e('0xa')];};};Realtime[_0x0a9e('0x13')]['initChatQueues']=function(){var _0x384319=this;return function(_0x479bc4){if(_0x479bc4){freeIsNotKey(_0x479bc4,_0x384319[_0x0a9e('0xb')],'id');for(var _0x5bfb33=0x0,_0x1dc186={},_0x34dc65={};_0x5bfb33<_0x479bc4[_0x0a9e('0x17')];_0x5bfb33+=0x1){_0x1dc186=_0x479bc4[_0x5bfb33];if(_[_0x0a9e('0x18')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']])){_0x384319[_0x0a9e('0xb')][_0x1dc186['id']]=new ChatQueue(_0x1dc186);}else{_0x384319[_0x0a9e('0x14')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']],_0x1dc186);}_0x384319['chatQueues'][_0x1dc186['id']][_0x0a9e('0x1b')]();_0x384319[_0x0a9e('0xb')][_0x1dc186['id']][_0x0a9e('0x1a')]();}}return _0x384319[_0x0a9e('0xb')];};};Realtime['prototype'][_0x0a9e('0x1c')]=function(){var _0x40e7a3=this;return function(_0x1843b2){if(_0x1843b2){freeIsNotKey(_0x1843b2,_0x40e7a3[_0x0a9e('0x1d')],'id');for(var _0x58b06f=0x0,_0x563b45={},_0x296f41={};_0x58b06f<_0x1843b2[_0x0a9e('0x17')];_0x58b06f+=0x1){_0x563b45=_0x1843b2[_0x58b06f];if(_[_0x0a9e('0x18')](_0x40e7a3['smsQueues'][_0x563b45['id']])){_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']]=new SmsQueue(_0x563b45);}else{_0x40e7a3['mergeFromDatabase'](_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']],_0x563b45);}_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1b')]();_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1a')]();}}return _0x40e7a3['smsQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x1e')]=function(){var _0x40cb85=this;return function(_0x2da5c0){if(_0x2da5c0){freeIsNotKey(_0x2da5c0,_0x40cb85[_0x0a9e('0x1f')],'id');for(var _0x409319=0x0,_0x332d35={},_0x39e565={};_0x409319<_0x2da5c0['length'];_0x409319+=0x1){_0x332d35=_0x2da5c0[_0x409319];if(_[_0x0a9e('0x18')](_0x40cb85['mailQueues'][_0x332d35['id']])){_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]=new MailQueue(_0x332d35);}else{_0x40cb85[_0x0a9e('0x14')](_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']],_0x332d35);}_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]['updateRouting']();_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']][_0x0a9e('0x1a')]();}}return _0x40cb85[_0x0a9e('0x1f')];};};Realtime[_0x0a9e('0x13')]['initFaxQueues']=function(){var _0x54135e=this;return function(_0x1e8694){if(_0x1e8694){freeIsNotKey(_0x1e8694,_0x54135e['faxQueues'],'id');for(var _0x24936a=0x0,_0x3d9717={},_0x381c37={};_0x24936a<_0x1e8694[_0x0a9e('0x17')];_0x24936a+=0x1){_0x3d9717=_0x1e8694[_0x24936a];if(_['isUndefined'](_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']])){_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]=new FaxQueue(_0x3d9717);}else{_0x54135e[_0x0a9e('0x14')](_0x54135e['faxQueues'][_0x3d9717['id']],_0x3d9717);}_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']][_0x0a9e('0x1b')]();_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]['updateRealtime']();}}return _0x54135e['faxQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x20')]=function(){var _0x5adda1=this;return function(_0x2b814e){if(_0x2b814e){freeIsNotKey(_0x2b814e,_0x5adda1[_0x0a9e('0x21')],'id');for(var _0x2e1b3a=0x0,_0x148f55={},_0x4b38d9={};_0x2e1b3a<_0x2b814e['length'];_0x2e1b3a+=0x1){_0x148f55=_0x2b814e[_0x2e1b3a];if(_[_0x0a9e('0x18')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']])){_0x5adda1['whatsappQueues'][_0x148f55['id']]=new WhatsappQueue(_0x148f55);}else{_0x5adda1[_0x0a9e('0x14')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']],_0x148f55);}_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']]['updateRouting']();_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']][_0x0a9e('0x1a')]();}}return _0x5adda1[_0x0a9e('0x21')];};};module[_0x0a9e('0x22')]=Realtime;
\ No newline at end of file
index 71f2d79..bf0b2c9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x726a=['Request','AddTagsToChatInteraction','addTagsToChatInteraction','UpdateChatInteraction','updateChatInteraction','addTags'];(function(_0xe2e6f1,_0x5d363f){var _0x18c4ea=function(_0x1542b7){while(--_0x1542b7){_0xe2e6f1['push'](_0xe2e6f1['shift']());}};_0x18c4ea(++_0x5d363f);}(_0x726a,0x13b));var _0xa726=function(_0x3218e9,_0x81ed6f){_0x3218e9=_0x3218e9-0x0;var _0x3a363c=_0x726a[_0x3218e9];return _0x3a363c;};'use strict';var client=require('../client');exports['update']=function(_0x2ff05f,_0x55ee82){return client['Request'](_0xa726('0x0'),{'body':_0x55ee82,'options':{'where':{'id':_0x2ff05f}},'log':_0xa726('0x1')});};exports[_0xa726('0x2')]=function(_0x4ebf43,_0x2a8c91){return client[_0xa726('0x3')](_0xa726('0x4'),{'body':_0x2a8c91,'options':{'where':{'id':_0x4ebf43}},'log':_0xa726('0x5')});};
\ No newline at end of file
+var _0xf522=['addTagsToChatInteraction','../client','update','Request','UpdateChatInteraction','AddTagsToChatInteraction'];(function(_0x4f0ec4,_0x145416){var _0x3f1e36=function(_0x3b5a53){while(--_0x3b5a53){_0x4f0ec4['push'](_0x4f0ec4['shift']());}};_0x3f1e36(++_0x145416);}(_0xf522,0xf1));var _0x2f52=function(_0xeb7b0f,_0x472f9d){_0xeb7b0f=_0xeb7b0f-0x0;var _0x525c66=_0xf522[_0xeb7b0f];return _0x525c66;};'use strict';var client=require(_0x2f52('0x0'));exports[_0x2f52('0x1')]=function(_0x5bd2cb,_0x7580b7){return client[_0x2f52('0x2')](_0x2f52('0x3'),{'body':_0x7580b7,'options':{'where':{'id':_0x5bd2cb}},'log':'updateChatInteraction'});};exports['addTags']=function(_0x346404,_0x6923d7){return client[_0x2f52('0x2')](_0x2f52('0x4'),{'body':_0x6923d7,'options':{'where':{'id':_0x346404}},'log':_0x2f52('0x5')});};
\ No newline at end of file
index c90c18e..a28da28 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a34=['create','Request','CreateChatMessage','createChatMessage','../client'];(function(_0x1af05b,_0x5134b5){var _0x5be7cc=function(_0x2d4ac0){while(--_0x2d4ac0){_0x1af05b['push'](_0x1af05b['shift']());}};_0x5be7cc(++_0x5134b5);}(_0x7a34,0x1e4));var _0x47a3=function(_0x4e6e1b,_0x5c2d28){_0x4e6e1b=_0x4e6e1b-0x0;var _0x41f832=_0x7a34[_0x4e6e1b];return _0x41f832;};'use strict';var client=require(_0x47a3('0x0'));exports[_0x47a3('0x1')]=function(_0x5277ab){return client[_0x47a3('0x2')](_0x47a3('0x3'),{'body':_0x5277ab,'log':_0x47a3('0x4')});};
\ No newline at end of file
+var _0x1986=['../client','create','Request','CreateChatMessage','createChatMessage'];(function(_0x1405e3,_0x1ff52d){var _0x5a240e=function(_0x405b9b){while(--_0x405b9b){_0x1405e3['push'](_0x1405e3['shift']());}};_0x5a240e(++_0x1ff52d);}(_0x1986,0x1ea));var _0x6198=function(_0x591d76,_0x3bbdb0){_0x591d76=_0x591d76-0x0;var _0x597835=_0x1986[_0x591d76];return _0x597835;};'use strict';var client=require(_0x6198('0x0'));exports[_0x6198('0x1')]=function(_0x460634){return client[_0x6198('0x2')](_0x6198('0x3'),{'body':_0x460634,'log':_0x6198('0x4')});};
\ No newline at end of file
index 4de82cf..6fd6cb6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x08d9=['chatPause','getChatQueues','../client','Request','name','timeout','strategy','online'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x08d9,0xc2));var _0x908d=function(_0x2b71c4,_0x455e0d){_0x2b71c4=_0x2b71c4-0x0;var _0xe6bfc9=_0x08d9[_0x2b71c4];return _0xe6bfc9;};'use strict';var client=require(_0x908d('0x0'));exports['getChatQueues']=function(){return function(){return client[_0x908d('0x1')]('GetChatQueue',{'options':{'raw':![],'attributes':['id',_0x908d('0x2'),_0x908d('0x3'),_0x908d('0x4')],'include':[{'model':'User','as':'Agents','attributes':['id',_0x908d('0x2'),_0x908d('0x5'),_0x908d('0x6')]}]},'log':_0x908d('0x7')});};};
\ No newline at end of file
+var _0x7c1f=['User','Agents','online','chatPause','../client','getChatQueues','Request','GetChatQueue','name','strategy'];(function(_0x174002,_0x56b6a1){var _0x7c2308=function(_0x52baf8){while(--_0x52baf8){_0x174002['push'](_0x174002['shift']());}};_0x7c2308(++_0x56b6a1);}(_0x7c1f,0x194));var _0xf7c1=function(_0x4a9ad4,_0x3d8e06){_0x4a9ad4=_0x4a9ad4-0x0;var _0x28efbe=_0x7c1f[_0x4a9ad4];return _0x28efbe;};'use strict';var client=require(_0xf7c1('0x0'));exports[_0xf7c1('0x1')]=function(){return function(){return client[_0xf7c1('0x2')](_0xf7c1('0x3'),{'options':{'raw':![],'attributes':['id',_0xf7c1('0x4'),'timeout',_0xf7c1('0x5')],'include':[{'model':_0xf7c1('0x6'),'as':_0xf7c1('0x7'),'attributes':['id','name',_0xf7c1('0x8'),_0xf7c1('0x9')]}]},'log':_0xf7c1('0x1')});};};
\ No newline at end of file
index 4d0bf84..24cdf87 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdab2=['update','UpdateChatQueueReport','DESC','../client','create','Request','CreateChatQueueReport'];(function(_0x23aff3,_0x28d084){var _0x1b7bfe=function(_0x12de84){while(--_0x12de84){_0x23aff3['push'](_0x23aff3['shift']());}};_0x1b7bfe(++_0x28d084);}(_0xdab2,0x130));var _0x2dab=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdab2[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x2dab('0x0'));exports[_0x2dab('0x1')]=function(_0x50addb){return client[_0x2dab('0x2')](_0x2dab('0x3'),{'body':_0x50addb,'log':_0x2dab('0x3')});};exports[_0x2dab('0x4')]=function(_0x56a9cc,_0x2078be){return client[_0x2dab('0x2')](_0x2dab('0x5'),{'body':_0x2078be,'options':{'where':{'uniqueid':_0x56a9cc},'order':[['id',_0x2dab('0x6')]],'limit':0x1},'log':_0x2dab('0x5')});};
\ No newline at end of file
+var _0x8f37=['CreateChatQueueReport','update','Request','DESC','../client','create'];(function(_0x1d4180,_0x27e84f){var _0x5ba9d2=function(_0xf3c6b4){while(--_0xf3c6b4){_0x1d4180['push'](_0x1d4180['shift']());}};_0x5ba9d2(++_0x27e84f);}(_0x8f37,0x190));var _0x78f3=function(_0x3cd0b7,_0x365f5d){_0x3cd0b7=_0x3cd0b7-0x0;var _0x16f72b=_0x8f37[_0x3cd0b7];return _0x16f72b;};'use strict';var client=require(_0x78f3('0x0'));exports[_0x78f3('0x1')]=function(_0x351c4f){return client['Request']('CreateChatQueueReport',{'body':_0x351c4f,'log':_0x78f3('0x2')});};exports[_0x78f3('0x3')]=function(_0x3b0667,_0x539794){return client[_0x78f3('0x4')]('UpdateChatQueueReport',{'body':_0x539794,'options':{'where':{'uniqueid':_0x3b0667},'order':[['id',_0x78f3('0x5')]],'limit':0x1},'log':'UpdateChatQueueReport'});};
\ No newline at end of file
index 9f57c5d..6448226 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['Request','AddTagsToFaxInteraction','addTagsToFaxInteraction','../client','update','UpdateFaxInteraction','updateFaxInteraction','addTags'];(function(_0x1d43cb,_0x4aac5d){var _0x39010d=function(_0x1bbdd3){while(--_0x1bbdd3){_0x1d43cb['push'](_0x1d43cb['shift']());}};_0x39010d(++_0x4aac5d);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var client=require(_0x7995('0x0'));exports[_0x7995('0x1')]=function(_0x2722a3,_0x10a05d){return client['Request'](_0x7995('0x2'),{'body':_0x10a05d,'options':{'where':{'id':_0x2722a3}},'log':_0x7995('0x3')});};exports[_0x7995('0x4')]=function(_0x462a03,_0x576d89){return client[_0x7995('0x5')](_0x7995('0x6'),{'body':_0x576d89,'options':{'where':{'id':_0x462a03}},'log':_0x7995('0x7')});};
\ No newline at end of file
+var _0x9957=['Request','AddTagsToFaxInteraction','addTagsToFaxInteraction','../client','update','UpdateFaxInteraction','updateFaxInteraction','addTags'];(function(_0x11527f,_0x26bfda){var _0x40df18=function(_0x2eaba9){while(--_0x2eaba9){_0x11527f['push'](_0x11527f['shift']());}};_0x40df18(++_0x26bfda);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var client=require(_0x7995('0x0'));exports[_0x7995('0x1')]=function(_0x2722a3,_0x10a05d){return client['Request'](_0x7995('0x2'),{'body':_0x10a05d,'options':{'where':{'id':_0x2722a3}},'log':_0x7995('0x3')});};exports[_0x7995('0x4')]=function(_0x462a03,_0x576d89){return client[_0x7995('0x5')](_0x7995('0x6'),{'body':_0x576d89,'options':{'where':{'id':_0x462a03}},'log':_0x7995('0x7')});};
\ No newline at end of file
index 5285221..903cd54 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xff06=['createFaxMessage','../client','create','CreateFaxMessage'];(function(_0x2a6944,_0x31a566){var _0x54c508=function(_0x5064ae){while(--_0x5064ae){_0x2a6944['push'](_0x2a6944['shift']());}};_0x54c508(++_0x31a566);}(_0xff06,0x69));var _0x6ff0=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0xff06[_0x4e676e];return _0x336a3c;};'use strict';var client=require(_0x6ff0('0x0'));exports[_0x6ff0('0x1')]=function(_0x44c322){return client['Request'](_0x6ff0('0x2'),{'body':_0x44c322,'log':_0x6ff0('0x3')});};
\ No newline at end of file
+var _0x0147=['create','Request','createFaxMessage','../client'];(function(_0x421759,_0x483b78){var _0x50f1d2=function(_0x5936e0){while(--_0x5936e0){_0x421759['push'](_0x421759['shift']());}};_0x50f1d2(++_0x483b78);}(_0x0147,0x1ef));var _0x7014=function(_0x53524f,_0x16d8ba){_0x53524f=_0x53524f-0x0;var _0x47b996=_0x0147[_0x53524f];return _0x47b996;};'use strict';var client=require(_0x7014('0x0'));exports[_0x7014('0x1')]=function(_0x26c775){return client[_0x7014('0x2')]('CreateFaxMessage',{'body':_0x26c775,'log':_0x7014('0x3')});};
\ No newline at end of file
index bc9dbc5..44be2ce 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf8f9=['Request','GetFaxQueue','name','timeout','strategy','User','Agents','getFaxQueues','../client'];(function(_0x1ca591,_0x560105){var _0x17fd55=function(_0x3ae92b){while(--_0x3ae92b){_0x1ca591['push'](_0x1ca591['shift']());}};_0x17fd55(++_0x560105);}(_0xf8f9,0xb3));var _0x9f8f=function(_0x222680,_0x24370a){_0x222680=_0x222680-0x0;var _0x9b7ed9=_0xf8f9[_0x222680];return _0x9b7ed9;};'use strict';var client=require(_0x9f8f('0x0'));exports['getFaxQueues']=function(){return function(){return client[_0x9f8f('0x1')](_0x9f8f('0x2'),{'options':{'raw':![],'attributes':['id',_0x9f8f('0x3'),_0x9f8f('0x4'),_0x9f8f('0x5')],'include':[{'model':_0x9f8f('0x6'),'as':_0x9f8f('0x7'),'attributes':['id',_0x9f8f('0x3'),'online','faxPause']}]},'log':_0x9f8f('0x8')});};};
\ No newline at end of file
+var _0x9337=['Request','GetFaxQueue','name','timeout','strategy','Agents','online','faxPause','getFaxQueues'];(function(_0x3181cc,_0x28447f){var _0x547a4a=function(_0x3ede80){while(--_0x3ede80){_0x3181cc['push'](_0x3181cc['shift']());}};_0x547a4a(++_0x28447f);}(_0x9337,0x104));var _0x7933=function(_0x4ccd94,_0x159861){_0x4ccd94=_0x4ccd94-0x0;var _0xf9ed98=_0x9337[_0x4ccd94];return _0xf9ed98;};'use strict';var client=require('../client');exports[_0x7933('0x0')]=function(){return function(){return client[_0x7933('0x1')](_0x7933('0x2'),{'options':{'raw':![],'attributes':['id',_0x7933('0x3'),_0x7933('0x4'),_0x7933('0x5')],'include':[{'model':'User','as':_0x7933('0x6'),'attributes':['id','name',_0x7933('0x7'),_0x7933('0x8')]}]},'log':_0x7933('0x0')});};};
\ No newline at end of file
index 239adc9..0d5de32 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5ca8=['create','Request','CreateFaxQueueReport','update','UpdateFaxQueueReport','../client'];(function(_0x7e0db2,_0x50d641){var _0x22495c=function(_0x4a199e){while(--_0x4a199e){_0x7e0db2['push'](_0x7e0db2['shift']());}};_0x22495c(++_0x50d641);}(_0x5ca8,0x71));var _0x85ca=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x5ca8[_0x59ee6f];return _0x4c0979;};'use strict';var client=require(_0x85ca('0x0'));exports[_0x85ca('0x1')]=function(_0x476bfe){return client[_0x85ca('0x2')](_0x85ca('0x3'),{'body':_0x476bfe,'log':_0x85ca('0x3')});};exports[_0x85ca('0x4')]=function(_0x5efcdc,_0x28f2d3){return client[_0x85ca('0x2')](_0x85ca('0x5'),{'body':_0x28f2d3,'options':{'where':{'uniqueid':_0x5efcdc},'order':[['id','DESC']],'limit':0x1},'log':_0x85ca('0x5')});};
\ No newline at end of file
+var _0x7337=['../client','Request','CreateFaxQueueReport','update','UpdateFaxQueueReport'];(function(_0x8db570,_0x2a2c15){var _0x3b604d=function(_0x13427b){while(--_0x13427b){_0x8db570['push'](_0x8db570['shift']());}};_0x3b604d(++_0x2a2c15);}(_0x7337,0x7d));var _0x7733=function(_0xe1b3c8,_0x3be066){_0xe1b3c8=_0xe1b3c8-0x0;var _0x3d3884=_0x7337[_0xe1b3c8];return _0x3d3884;};'use strict';var client=require(_0x7733('0x0'));exports['create']=function(_0x132a11){return client[_0x7733('0x1')]('CreateFaxQueueReport',{'body':_0x132a11,'log':_0x7733('0x2')});};exports[_0x7733('0x3')]=function(_0x119628,_0x5baa2d){return client[_0x7733('0x1')](_0x7733('0x4'),{'body':_0x5baa2d,'options':{'where':{'uniqueid':_0x119628},'order':[['id','DESC']],'limit':0x1},'log':'UpdateFaxQueueReport'});};
\ No newline at end of file
index 01e1c5d..05d4f20 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc654=['../client','name','Interval','interval'];(function(_0x26a0a6,_0x8e3617){var _0x46a0e3=function(_0x552489){while(--_0x552489){_0x26a0a6['push'](_0x26a0a6['shift']());}};_0x46a0e3(++_0x8e3617);}(_0xc654,0x70));var _0x4c65=function(_0x55cf7a,_0x3e6bc5){_0x55cf7a=_0x55cf7a-0x0;var _0x3b79f2=_0xc654[_0x55cf7a];return _0x3b79f2;};'use strict';var client=require(_0x4c65('0x0'));exports['getIntervals']=function(){return function(){return client['Request']('GetInterval',{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x4c65('0x1')],'include':[{'model':_0x4c65('0x2'),'as':'Intervals','attributes':['id',_0x4c65('0x1'),_0x4c65('0x3')]}]},'log':'getIntervals'});};};
\ No newline at end of file
+var _0x2712=['Request','GetInterval','name','Interval','interval','getIntervals','../client'];(function(_0x29b609,_0x19d388){var _0x54c952=function(_0xb3c38d){while(--_0xb3c38d){_0x29b609['push'](_0x29b609['shift']());}};_0x54c952(++_0x19d388);}(_0x2712,0x1cd));var _0x2271=function(_0x4c466d,_0x5cbd58){_0x4c466d=_0x4c466d-0x0;var _0x312024=_0x2712[_0x4c466d];return _0x312024;};'use strict';var client=require(_0x2271('0x0'));exports['getIntervals']=function(){return function(){return client[_0x2271('0x1')](_0x2271('0x2'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x2271('0x3')],'include':[{'model':_0x2271('0x4'),'as':'Intervals','attributes':['id',_0x2271('0x3'),_0x2271('0x5')]}]},'log':_0x2271('0x6')});};};
\ No newline at end of file
index 2caa91d..ff578a7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1c7c=['update','UpdateMailInteraction','addTags','Request','AddTagsToMailInteraction','addTagsToChatInteraction','../client'];(function(_0x4a095e,_0x381cd5){var _0x10ef73=function(_0x1f6964){while(--_0x1f6964){_0x4a095e['push'](_0x4a095e['shift']());}};_0x10ef73(++_0x381cd5);}(_0x1c7c,0x164));var _0xc1c7=function(_0x4ea43e,_0x3cb21f){_0x4ea43e=_0x4ea43e-0x0;var _0x38b1df=_0x1c7c[_0x4ea43e];return _0x38b1df;};'use strict';var client=require(_0xc1c7('0x0'));exports[_0xc1c7('0x1')]=function(_0x38fc99,_0x3a93f0){return client['Request'](_0xc1c7('0x2'),{'body':_0x3a93f0,'options':{'where':{'id':_0x38fc99}},'log':'updateMailInteraction'});};exports[_0xc1c7('0x3')]=function(_0x20dad3,_0xbb9da0){return client[_0xc1c7('0x4')](_0xc1c7('0x5'),{'body':_0xbb9da0,'options':{'where':{'id':_0x20dad3}},'log':_0xc1c7('0x6')});};
\ No newline at end of file
+var _0x3de3=['../client','UpdateMailInteraction','updateMailInteraction','addTags','Request','AddTagsToMailInteraction'];(function(_0x269eba,_0x38828c){var _0x25f3d6=function(_0x1e20ae){while(--_0x1e20ae){_0x269eba['push'](_0x269eba['shift']());}};_0x25f3d6(++_0x38828c);}(_0x3de3,0x1ce));var _0x33de=function(_0x325e24,_0x7a8eff){_0x325e24=_0x325e24-0x0;var _0x20afa2=_0x3de3[_0x325e24];return _0x20afa2;};'use strict';var client=require(_0x33de('0x0'));exports['update']=function(_0x19d1ba,_0x100783){return client['Request'](_0x33de('0x1'),{'body':_0x100783,'options':{'where':{'id':_0x19d1ba}},'log':_0x33de('0x2')});};exports[_0x33de('0x3')]=function(_0xbdd404,_0x56b413){return client[_0x33de('0x4')](_0x33de('0x5'),{'body':_0x56b413,'options':{'where':{'id':_0xbdd404}},'log':'addTagsToChatInteraction'});};
\ No newline at end of file
index 5c8e732..e705bc5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1c4b=['createMailMessage','create','CreateMailMessage'];(function(_0x4bf565,_0x420d33){var _0x30e15f=function(_0x91a47f){while(--_0x91a47f){_0x4bf565['push'](_0x4bf565['shift']());}};_0x30e15f(++_0x420d33);}(_0x1c4b,0x1ea));var _0xb1c4=function(_0x5ae536,_0x5a662f){_0x5ae536=_0x5ae536-0x0;var _0x24fc2e=_0x1c4b[_0x5ae536];return _0x24fc2e;};'use strict';var client=require('../client');exports[_0xb1c4('0x0')]=function(_0x26227f){return client['Request'](_0xb1c4('0x1'),{'body':_0x26227f,'log':_0xb1c4('0x2')});};
\ No newline at end of file
+var _0xfb54=['../client','create','CreateMailMessage','createMailMessage'];(function(_0x1eb822,_0x80c6a6){var _0x495499=function(_0xfb4653){while(--_0xfb4653){_0x1eb822['push'](_0x1eb822['shift']());}};_0x495499(++_0x80c6a6);}(_0xfb54,0x1e8));var _0x4fb5=function(_0x75595f,_0x477cfb){_0x75595f=_0x75595f-0x0;var _0x4d71fd=_0xfb54[_0x75595f];return _0x4d71fd;};'use strict';var client=require(_0x4fb5('0x0'));exports[_0x4fb5('0x1')]=function(_0x43890a){return client['Request'](_0x4fb5('0x2'),{'body':_0x43890a,'log':_0x4fb5('0x3')});};
\ No newline at end of file
index 34fe1f7..293308e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5a5d=['name','User','Agents','mailPause','../client','getMailQueues','Request'];(function(_0x303064,_0x12f0c2){var _0x5a1d3d=function(_0x5b9d81){while(--_0x5b9d81){_0x303064['push'](_0x303064['shift']());}};_0x5a1d3d(++_0x12f0c2);}(_0x5a5d,0x131));var _0xd5a5=function(_0x543084,_0x4337f5){_0x543084=_0x543084-0x0;var _0x306a57=_0x5a5d[_0x543084];return _0x306a57;};'use strict';var client=require(_0xd5a5('0x0'));exports[_0xd5a5('0x1')]=function(){return function(){return client[_0xd5a5('0x2')]('GetMailQueue',{'options':{'raw':![],'attributes':['id',_0xd5a5('0x3'),'timeout','strategy'],'include':[{'model':_0xd5a5('0x4'),'as':_0xd5a5('0x5'),'attributes':['id',_0xd5a5('0x3'),'online',_0xd5a5('0x6')]}]},'log':_0xd5a5('0x1')});};};
\ No newline at end of file
+var _0x38d5=['Agents','online','mailPause','../client','Request','GetMailQueue','name','timeout','strategy'];(function(_0x3ef45e,_0xe84f33){var _0x69e7c=function(_0x43ba11){while(--_0x43ba11){_0x3ef45e['push'](_0x3ef45e['shift']());}};_0x69e7c(++_0xe84f33);}(_0x38d5,0x66));var _0x538d=function(_0x48a847,_0x2e9451){_0x48a847=_0x48a847-0x0;var _0xa6a5c2=_0x38d5[_0x48a847];return _0xa6a5c2;};'use strict';var client=require(_0x538d('0x0'));exports['getMailQueues']=function(){return function(){return client[_0x538d('0x1')](_0x538d('0x2'),{'options':{'raw':![],'attributes':['id',_0x538d('0x3'),_0x538d('0x4'),_0x538d('0x5')],'include':[{'model':'User','as':_0x538d('0x6'),'attributes':['id',_0x538d('0x3'),_0x538d('0x7'),_0x538d('0x8')]}]},'log':'getMailQueues'});};};
\ No newline at end of file
index 2d11442..c13d567 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc765=['update','UpdateMailQueueReport','../client','create','Request','CreateMailQueueReport'];(function(_0x50f112,_0xd38e53){var _0x4ecf28=function(_0x62b75){while(--_0x62b75){_0x50f112['push'](_0x50f112['shift']());}};_0x4ecf28(++_0xd38e53);}(_0xc765,0x14c));var _0x5c76=function(_0x1db022,_0x4fa04f){_0x1db022=_0x1db022-0x0;var _0x540b0c=_0xc765[_0x1db022];return _0x540b0c;};'use strict';var client=require(_0x5c76('0x0'));exports[_0x5c76('0x1')]=function(_0x5d8c6f){return client[_0x5c76('0x2')]('CreateMailQueueReport',{'body':_0x5d8c6f,'log':_0x5c76('0x3')});};exports[_0x5c76('0x4')]=function(_0x24ea19,_0xb96f7a){return client[_0x5c76('0x2')](_0x5c76('0x5'),{'body':_0xb96f7a,'options':{'where':{'uniqueid':_0x24ea19},'order':[['id','DESC']],'limit':0x1},'log':'UpdateMailQueueReport'});};
\ No newline at end of file
+var _0x227e=['update','UpdateMailQueueReport','DESC','../client','create','CreateMailQueueReport'];(function(_0x56d5d4,_0x229572){var _0x1a7819=function(_0x45ee47){while(--_0x45ee47){_0x56d5d4['push'](_0x56d5d4['shift']());}};_0x1a7819(++_0x229572);}(_0x227e,0x195));var _0xe227=function(_0xf5aaa4,_0x14b73a){_0xf5aaa4=_0xf5aaa4-0x0;var _0x5ed623=_0x227e[_0xf5aaa4];return _0x5ed623;};'use strict';var client=require(_0xe227('0x0'));exports[_0xe227('0x1')]=function(_0x3a363a){return client['Request'](_0xe227('0x2'),{'body':_0x3a363a,'log':'CreateMailQueueReport'});};exports[_0xe227('0x3')]=function(_0x438946,_0x34a638){return client['Request'](_0xe227('0x4'),{'body':_0x34a638,'options':{'where':{'uniqueid':_0x438946},'order':[['id',_0xe227('0x5')]],'limit':0x1},'log':'UpdateMailQueueReport'});};
\ No newline at end of file
index 7be68d8..270420f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x15e2=['addTagsToChatInteraction','../client','update','Request','UpdateOpenchannelInteraction','addTags'];(function(_0x2006b9,_0x4ea047){var _0x105b8e=function(_0x1b84ee){while(--_0x1b84ee){_0x2006b9['push'](_0x2006b9['shift']());}};_0x105b8e(++_0x4ea047);}(_0x15e2,0x109));var _0x215e=function(_0x166d93,_0x301f09){_0x166d93=_0x166d93-0x0;var _0xba708=_0x15e2[_0x166d93];return _0xba708;};'use strict';var client=require(_0x215e('0x0'));exports[_0x215e('0x1')]=function(_0x4d2a52,_0x2a4a8f){return client[_0x215e('0x2')](_0x215e('0x3'),{'body':_0x2a4a8f,'options':{'where':{'id':_0x4d2a52}},'log':'updateOpenchannelInteraction'});};exports[_0x215e('0x4')]=function(_0x345ea2,_0x12dff3){return client['Request']('AddTagsToOpenchannelInteraction',{'body':_0x12dff3,'options':{'where':{'id':_0x345ea2}},'log':_0x215e('0x5')});};
\ No newline at end of file
+var _0x8b6e=['Request','UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTags','AddTagsToOpenchannelInteraction','addTagsToChatInteraction','../client','update'];(function(_0x286a34,_0x1e7d2d){var _0x7059e4=function(_0x32c04f){while(--_0x32c04f){_0x286a34['push'](_0x286a34['shift']());}};_0x7059e4(++_0x1e7d2d);}(_0x8b6e,0x9e));var _0xe8b6=function(_0x173ad3,_0x21c676){_0x173ad3=_0x173ad3-0x0;var _0x4becc3=_0x8b6e[_0x173ad3];return _0x4becc3;};'use strict';var client=require(_0xe8b6('0x0'));exports[_0xe8b6('0x1')]=function(_0x57995a,_0x340515){return client[_0xe8b6('0x2')](_0xe8b6('0x3'),{'body':_0x340515,'options':{'where':{'id':_0x57995a}},'log':_0xe8b6('0x4')});};exports[_0xe8b6('0x5')]=function(_0x148fd3,_0x4a0e38){return client[_0xe8b6('0x2')](_0xe8b6('0x6'),{'body':_0x4a0e38,'options':{'where':{'id':_0x148fd3}},'log':_0xe8b6('0x7')});};
\ No newline at end of file
index e4cfba7..08ca87b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x33bb=['../client','create','Request','CreateOpenchannelMessage','createOpenchannelMessage'];(function(_0x4b34ed,_0x541cb2){var _0x241aaa=function(_0x355907){while(--_0x355907){_0x4b34ed['push'](_0x4b34ed['shift']());}};_0x241aaa(++_0x541cb2);}(_0x33bb,0xeb));var _0xb33b=function(_0x320872,_0x2e67a9){_0x320872=_0x320872-0x0;var _0x213a37=_0x33bb[_0x320872];return _0x213a37;};'use strict';var client=require(_0xb33b('0x0'));exports[_0xb33b('0x1')]=function(_0x560b06){return client[_0xb33b('0x2')](_0xb33b('0x3'),{'body':_0x560b06,'log':_0xb33b('0x4')});};
\ No newline at end of file
+var _0x50bc=['createOpenchannelMessage','Request','CreateOpenchannelMessage'];(function(_0x2efb90,_0x1a90e1){var _0x236993=function(_0x5af529){while(--_0x5af529){_0x2efb90['push'](_0x2efb90['shift']());}};_0x236993(++_0x1a90e1);}(_0x50bc,0x1a5));var _0xc50b=function(_0x3a313c,_0x488409){_0x3a313c=_0x3a313c-0x0;var _0x44dcb0=_0x50bc[_0x3a313c];return _0x44dcb0;};'use strict';var client=require('../client');exports['create']=function(_0x167697){return client[_0xc50b('0x0')](_0xc50b('0x1'),{'body':_0x167697,'log':_0xc50b('0x2')});};
\ No newline at end of file
index b6e4fbe..3c9f322 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7990=['timeout','User','online','../client','getOpenchannelQueues','Request','GetOpenchannelQueue','name'];(function(_0x4ece46,_0x4b7ea7){var _0x260cac=function(_0x2f7895){while(--_0x2f7895){_0x4ece46['push'](_0x4ece46['shift']());}};_0x260cac(++_0x4b7ea7);}(_0x7990,0xe3));var _0x0799=function(_0x479168,_0x51facb){_0x479168=_0x479168-0x0;var _0x33d297=_0x7990[_0x479168];return _0x33d297;};'use strict';var client=require(_0x0799('0x0'));exports[_0x0799('0x1')]=function(){return function(){return client[_0x0799('0x2')](_0x0799('0x3'),{'options':{'raw':![],'attributes':['id',_0x0799('0x4'),_0x0799('0x5'),'strategy'],'include':[{'model':_0x0799('0x6'),'as':'Agents','attributes':['id',_0x0799('0x4'),_0x0799('0x7'),'openchannelPause']}]},'log':_0x0799('0x1')});};};
\ No newline at end of file
+var _0x02d9=['openchannelPause','../client','getOpenchannelQueues','Request','GetOpenchannelQueue','name','timeout','User','Agents','online'];(function(_0x1dbf62,_0x3986d4){var _0x64ad0d=function(_0x58d092){while(--_0x58d092){_0x1dbf62['push'](_0x1dbf62['shift']());}};_0x64ad0d(++_0x3986d4);}(_0x02d9,0x97));var _0x902d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x02d9[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x902d('0x0'));exports[_0x902d('0x1')]=function(){return function(){return client[_0x902d('0x2')](_0x902d('0x3'),{'options':{'raw':![],'attributes':['id',_0x902d('0x4'),_0x902d('0x5'),'strategy'],'include':[{'model':_0x902d('0x6'),'as':_0x902d('0x7'),'attributes':['id',_0x902d('0x4'),_0x902d('0x8'),_0x902d('0x9')]}]},'log':_0x902d('0x1')});};};
\ No newline at end of file
index d01da7e..084da0e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xafbf=['Request','CreateOpenchannelQueueReport','update','UpdateOpenchannelQueueReport','../client'];(function(_0x1203f,_0x554bbc){var _0x365f0a=function(_0x3531d0){while(--_0x3531d0){_0x1203f['push'](_0x1203f['shift']());}};_0x365f0a(++_0x554bbc);}(_0xafbf,0x130));var _0xfafb=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xafbf[_0x2dafbe];return _0x58a45a;};'use strict';var client=require(_0xfafb('0x0'));exports['create']=function(_0x2037a6){return client[_0xfafb('0x1')](_0xfafb('0x2'),{'body':_0x2037a6,'log':_0xfafb('0x2')});};exports[_0xfafb('0x3')]=function(_0x5fd4ad,_0x35161a){return client[_0xfafb('0x1')]('UpdateOpenchannelQueueReport',{'body':_0x35161a,'options':{'where':{'uniqueid':_0x5fd4ad},'order':[['id','DESC']],'limit':0x1},'log':_0xfafb('0x4')});};
\ No newline at end of file
+var _0xe78b=['UpdateOpenchannelQueueReport','DESC','../client','create','Request','CreateOpenchannelQueueReport','update'];(function(_0x2edfb5,_0x459de1){var _0x4dd84c=function(_0x5c1a0f){while(--_0x5c1a0f){_0x2edfb5['push'](_0x2edfb5['shift']());}};_0x4dd84c(++_0x459de1);}(_0xe78b,0x1c2));var _0xbe78=function(_0xbf7f20,_0x3f856e){_0xbf7f20=_0xbf7f20-0x0;var _0x5dc25d=_0xe78b[_0xbf7f20];return _0x5dc25d;};'use strict';var client=require(_0xbe78('0x0'));exports[_0xbe78('0x1')]=function(_0x52c04e){return client[_0xbe78('0x2')](_0xbe78('0x3'),{'body':_0x52c04e,'log':_0xbe78('0x3')});};exports[_0xbe78('0x4')]=function(_0x1f540e,_0x30500f){return client[_0xbe78('0x2')](_0xbe78('0x5'),{'body':_0x30500f,'options':{'where':{'uniqueid':_0x1f540e},'order':[['id',_0xbe78('0x6')]],'limit':0x1},'log':_0xbe78('0x5')});};
\ No newline at end of file
index 0ae537f..1c3d63d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4250=['UpdateSmsInteraction','updateSmsInteraction','addTags','Request','AddTagsToSmsInteraction','addTagsToSmsInteraction','../client','update'];(function(_0x515e2e,_0x2b4c5c){var _0x12a9e0=function(_0x41e282){while(--_0x41e282){_0x515e2e['push'](_0x515e2e['shift']());}};_0x12a9e0(++_0x2b4c5c);}(_0x4250,0x146));var _0x0425=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x4250[_0x4cf98e];return _0x1623ac;};'use strict';var client=require(_0x0425('0x0'));exports[_0x0425('0x1')]=function(_0x2867a3,_0x330d15){return client['Request'](_0x0425('0x2'),{'body':_0x330d15,'options':{'where':{'id':_0x2867a3}},'log':_0x0425('0x3')});};exports[_0x0425('0x4')]=function(_0x5abe75,_0x1dd2ed){return client[_0x0425('0x5')](_0x0425('0x6'),{'body':_0x1dd2ed,'options':{'where':{'id':_0x5abe75}},'log':_0x0425('0x7')});};
\ No newline at end of file
+var _0xc5c7=['addTagsToSmsInteraction','update','Request','UpdateSmsInteraction','updateSmsInteraction','AddTagsToSmsInteraction'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xc5c7,0x1cf));var _0x7c5c=function(_0x5d69a3,_0x14346c){_0x5d69a3=_0x5d69a3-0x0;var _0x428b83=_0xc5c7[_0x5d69a3];return _0x428b83;};'use strict';var client=require('../client');exports[_0x7c5c('0x0')]=function(_0x28e1a9,_0x2e1b3a){return client[_0x7c5c('0x1')](_0x7c5c('0x2'),{'body':_0x2e1b3a,'options':{'where':{'id':_0x28e1a9}},'log':_0x7c5c('0x3')});};exports['addTags']=function(_0xff325e,_0x2b4355){return client[_0x7c5c('0x1')](_0x7c5c('0x4'),{'body':_0x2b4355,'options':{'where':{'id':_0xff325e}},'log':_0x7c5c('0x5')});};
\ No newline at end of file
index 61f990c..97f40b0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x245b=['create','Request','CreateSmsMessage','../client'];(function(_0x55ed6c,_0x5695e6){var _0xeb5128=function(_0xec06b2){while(--_0xec06b2){_0x55ed6c['push'](_0x55ed6c['shift']());}};_0xeb5128(++_0x5695e6);}(_0x245b,0xb3));var _0xb245=function(_0x5dd504,_0x2c4b38){_0x5dd504=_0x5dd504-0x0;var _0x11cd5a=_0x245b[_0x5dd504];return _0x11cd5a;};'use strict';var client=require(_0xb245('0x0'));exports[_0xb245('0x1')]=function(_0x49d920){return client[_0xb245('0x2')](_0xb245('0x3'),{'body':_0x49d920,'log':'createSmsMessage'});};
\ No newline at end of file
+var _0x27a0=['Request','createSmsMessage','../client','create'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x27a0,0x1c6));var _0x027a=function(_0x45dac7,_0x520d27){_0x45dac7=_0x45dac7-0x0;var _0xa1d7d6=_0x27a0[_0x45dac7];return _0xa1d7d6;};'use strict';var client=require(_0x027a('0x0'));exports[_0x027a('0x1')]=function(_0x549cc8){return client[_0x027a('0x2')]('CreateSmsMessage',{'body':_0x549cc8,'log':_0x027a('0x3')});};
\ No newline at end of file
index a5cd750..bbd58b5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcb91=['smsPause','Request','GetSmsQueue','name','timeout','User','Agents','online'];(function(_0x3e9968,_0x10d6c5){var _0xdd9520=function(_0x4c73fa){while(--_0x4c73fa){_0x3e9968['push'](_0x3e9968['shift']());}};_0xdd9520(++_0x10d6c5);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x29e3ec,_0x138a18){_0x29e3ec=_0x29e3ec-0x0;var _0x25727e=_0xcb91[_0x29e3ec];return _0x25727e;};'use strict';var client=require('../client');exports['getSmsQueues']=function(){return function(){return client[_0x1cb9('0x0')](_0x1cb9('0x1'),{'options':{'raw':![],'attributes':['id',_0x1cb9('0x2'),_0x1cb9('0x3'),'strategy'],'include':[{'model':_0x1cb9('0x4'),'as':_0x1cb9('0x5'),'attributes':['id','name',_0x1cb9('0x6'),_0x1cb9('0x7')]}]},'log':'getSmsQueues'});};};
\ No newline at end of file
+var _0x0713=['getSmsQueues','Request','GetSmsQueue','name','timeout','strategy','Agents','online','smsPause'];(function(_0x482214,_0x2550ff){var _0x38d0cb=function(_0x2ba281){while(--_0x2ba281){_0x482214['push'](_0x482214['shift']());}};_0x38d0cb(++_0x2550ff);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports['getSmsQueues']=function(){return function(){return client[_0x3071('0x0')](_0x3071('0x1'),{'options':{'raw':![],'attributes':['id',_0x3071('0x2'),_0x3071('0x3'),_0x3071('0x4')],'include':[{'model':'User','as':_0x3071('0x5'),'attributes':['id',_0x3071('0x2'),_0x3071('0x6'),_0x3071('0x7')]}]},'log':_0x3071('0x8')});};};
\ No newline at end of file
index a2d3197..e680dfa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x34e8=['create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC','../client'];(function(_0x24edc0,_0x418368){var _0x454b7a=function(_0xcb9832){while(--_0xcb9832){_0x24edc0['push'](_0x24edc0['shift']());}};_0x454b7a(++_0x418368);}(_0x34e8,0x12c));var _0x834e=function(_0x1b793f,_0xfbe061){_0x1b793f=_0x1b793f-0x0;var _0x200687=_0x34e8[_0x1b793f];return _0x200687;};'use strict';var client=require(_0x834e('0x0'));exports[_0x834e('0x1')]=function(_0x8b339){return client[_0x834e('0x2')]('CreateSmsQueueReport',{'body':_0x8b339,'log':_0x834e('0x3')});};exports[_0x834e('0x4')]=function(_0x472111,_0x31bf20){return client[_0x834e('0x2')](_0x834e('0x5'),{'body':_0x31bf20,'options':{'where':{'uniqueid':_0x472111},'order':[['id',_0x834e('0x6')]],'limit':0x1},'log':'UpdateSmsQueueReport'});};
\ No newline at end of file
+var _0x70e0=['create','CreateSmsQueueReport','update','UpdateSmsQueueReport','../client'];(function(_0x4cbe6a,_0x593aae){var _0x5273fa=function(_0x2332c3){while(--_0x2332c3){_0x4cbe6a['push'](_0x4cbe6a['shift']());}};_0x5273fa(++_0x593aae);}(_0x70e0,0x17b));var _0x070e=function(_0x4c42c7,_0x79b5f7){_0x4c42c7=_0x4c42c7-0x0;var _0x786b4e=_0x70e0[_0x4c42c7];return _0x786b4e;};'use strict';var client=require(_0x070e('0x0'));exports[_0x070e('0x1')]=function(_0x198c2e){return client['Request']('CreateSmsQueueReport',{'body':_0x198c2e,'log':_0x070e('0x2')});};exports[_0x070e('0x3')]=function(_0x277d32,_0x2593e5){return client['Request'](_0x070e('0x4'),{'body':_0x2593e5,'options':{'where':{'uniqueid':_0x277d32},'order':[['id','DESC']],'limit':0x1},'log':_0x070e('0x4')});};
\ No newline at end of file
index 95ab6c8..94fc3f7 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(_0x3bf194,_0x342216){var _0x105954=function(_0x40732d){while(--_0x40732d){_0x3bf194['push'](_0x3bf194['shift']());}};_0x105954(++_0x342216);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0xa9e0[_0x5037ab];return _0x512adb;};'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(_0x48ac6f,_0x3afacb){var _0x4d01b8=function(_0x4fc24a){while(--_0x4fc24a){_0x48ac6f['push'](_0x48ac6f['shift']());}};_0x4d01b8(++_0x3afacb);}(_0xa9e0,0x123));var _0x0a9e=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xa9e0[_0x297fd3];return _0x2af381;};'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 9002aae..5ce088e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6d19=['Request','UpdateWhatsappInteraction','updateWhatsappInteraction','AddTagsToWhatsappInteraction','../client','update'];(function(_0x3f3aab,_0x1c12c2){var _0x568d54=function(_0x4b4ff7){while(--_0x4b4ff7){_0x3f3aab['push'](_0x3f3aab['shift']());}};_0x568d54(++_0x1c12c2);}(_0x6d19,0x160));var _0x96d1=function(_0x31991b,_0xaf75d2){_0x31991b=_0x31991b-0x0;var _0x307304=_0x6d19[_0x31991b];return _0x307304;};'use strict';var client=require(_0x96d1('0x0'));exports[_0x96d1('0x1')]=function(_0x110679,_0x36570a){return client[_0x96d1('0x2')](_0x96d1('0x3'),{'body':_0x36570a,'options':{'where':{'id':_0x110679}},'log':_0x96d1('0x4')});};exports['addTags']=function(_0x186315,_0x394a34){return client[_0x96d1('0x2')](_0x96d1('0x5'),{'body':_0x394a34,'options':{'where':{'id':_0x186315}},'log':'addTagsToWhatsappInteraction'});};
\ No newline at end of file
+var _0x7bd0=['addTagsToWhatsappInteraction','../client','update','Request','UpdateWhatsappInteraction','updateWhatsappInteraction','addTags','AddTagsToWhatsappInteraction'];(function(_0x46f50d,_0x10c27a){var _0x4e8839=function(_0x4145ce){while(--_0x4145ce){_0x46f50d['push'](_0x46f50d['shift']());}};_0x4e8839(++_0x10c27a);}(_0x7bd0,0x111));var _0x07bd=function(_0x592e40,_0x2ed011){_0x592e40=_0x592e40-0x0;var _0x5d4288=_0x7bd0[_0x592e40];return _0x5d4288;};'use strict';var client=require(_0x07bd('0x0'));exports[_0x07bd('0x1')]=function(_0x20836d,_0x3b79f2){return client[_0x07bd('0x2')](_0x07bd('0x3'),{'body':_0x3b79f2,'options':{'where':{'id':_0x20836d}},'log':_0x07bd('0x4')});};exports[_0x07bd('0x5')]=function(_0x5beba7,_0x2d7245){return client[_0x07bd('0x2')](_0x07bd('0x6'),{'body':_0x2d7245,'options':{'where':{'id':_0x5beba7}},'log':_0x07bd('0x7')});};
\ No newline at end of file
index 26c553c..3735300 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xed0e=['Request','createWhatsappMessage','create'];(function(_0x55d9ca,_0x28f676){var _0x1f06a9=function(_0x1b6955){while(--_0x1b6955){_0x55d9ca['push'](_0x55d9ca['shift']());}};_0x1f06a9(++_0x28f676);}(_0xed0e,0x18e));var _0xeed0=function(_0x474bc0,_0x26989c){_0x474bc0=_0x474bc0-0x0;var _0x4b24cf=_0xed0e[_0x474bc0];return _0x4b24cf;};'use strict';var client=require('../client');exports[_0xeed0('0x0')]=function(_0x319478){return client[_0xeed0('0x1')]('CreateWhatsappMessage',{'body':_0x319478,'log':_0xeed0('0x2')});};
\ No newline at end of file
+var _0x5625=['create','CreateWhatsappMessage'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x5625,0x88));var _0x5562=function(_0x530511,_0x445e74){_0x530511=_0x530511-0x0;var _0x5d8902=_0x5625[_0x530511];return _0x5d8902;};'use strict';var client=require('../client');exports[_0x5562('0x0')]=function(_0x2960cb){return client['Request'](_0x5562('0x1'),{'body':_0x2960cb,'log':'createWhatsappMessage'});};
\ No newline at end of file
index c53c781..301b987 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3fb4=['GetWhatsappQueue','name','timeout','strategy','User','Agents','online','whatsappPause','../client','getWhatsappQueues','Request'];(function(_0x121886,_0x8cd8e5){var _0x20ca01=function(_0x15e144){while(--_0x15e144){_0x121886['push'](_0x121886['shift']());}};_0x20ca01(++_0x8cd8e5);}(_0x3fb4,0x19f));var _0x43fb=function(_0x58e469,_0x95ee3e){_0x58e469=_0x58e469-0x0;var _0x4c01c5=_0x3fb4[_0x58e469];return _0x4c01c5;};'use strict';var client=require(_0x43fb('0x0'));exports[_0x43fb('0x1')]=function(){return function(){return client[_0x43fb('0x2')](_0x43fb('0x3'),{'options':{'raw':![],'attributes':['id',_0x43fb('0x4'),_0x43fb('0x5'),_0x43fb('0x6')],'include':[{'model':_0x43fb('0x7'),'as':_0x43fb('0x8'),'attributes':['id','name',_0x43fb('0x9'),_0x43fb('0xa')]}]},'log':'getWhatsappQueues'});};};
\ No newline at end of file
+var _0xa704=['Agents','whatsappPause','../client','getWhatsappQueues','Request','GetWhatsappQueue','name','timeout','User'];(function(_0xc27749,_0x188efd){var _0x566bde=function(_0x3bbf56){while(--_0x3bbf56){_0xc27749['push'](_0xc27749['shift']());}};_0x566bde(++_0x188efd);}(_0xa704,0xa4));var _0x4a70=function(_0x3be577,_0x33c662){_0x3be577=_0x3be577-0x0;var _0x10bbd8=_0xa704[_0x3be577];return _0x10bbd8;};'use strict';var client=require(_0x4a70('0x0'));exports[_0x4a70('0x1')]=function(){return function(){return client[_0x4a70('0x2')](_0x4a70('0x3'),{'options':{'raw':![],'attributes':['id',_0x4a70('0x4'),_0x4a70('0x5'),'strategy'],'include':[{'model':_0x4a70('0x6'),'as':_0x4a70('0x7'),'attributes':['id','name','online',_0x4a70('0x8')]}]},'log':_0x4a70('0x1')});};};
\ No newline at end of file
index 19007c6..0a41b1f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7bb0=['update','DESC','UpdateWhatsappQueueReport','create','Request','CreateWhatsappQueueReport'];(function(_0x5e5c74,_0xf3c7a0){var _0x5958b4=function(_0x293fc9){while(--_0x293fc9){_0x5e5c74['push'](_0x5e5c74['shift']());}};_0x5958b4(++_0xf3c7a0);}(_0x7bb0,0xf3));var _0x07bb=function(_0x1700c,_0x371c5a){_0x1700c=_0x1700c-0x0;var _0x48fb02=_0x7bb0[_0x1700c];return _0x48fb02;};'use strict';var client=require('../client');exports[_0x07bb('0x0')]=function(_0x18a9b5){return client[_0x07bb('0x1')](_0x07bb('0x2'),{'body':_0x18a9b5,'log':_0x07bb('0x2')});};exports[_0x07bb('0x3')]=function(_0x4d4230,_0x36695f){return client[_0x07bb('0x1')]('UpdateWhatsappQueueReport',{'body':_0x36695f,'options':{'where':{'uniqueid':_0x4d4230},'order':[['id',_0x07bb('0x4')]],'limit':0x1},'log':_0x07bb('0x5')});};
\ No newline at end of file
+var _0x373e=['Request','CreateWhatsappQueueReport','update','UpdateWhatsappQueueReport','DESC','../client','create'];(function(_0x39b331,_0xf46c66){var _0x517aae=function(_0x26b1d7){while(--_0x26b1d7){_0x39b331['push'](_0x39b331['shift']());}};_0x517aae(++_0xf46c66);}(_0x373e,0x132));var _0xe373=function(_0x523bbf,_0x328a09){_0x523bbf=_0x523bbf-0x0;var _0x512159=_0x373e[_0x523bbf];return _0x512159;};'use strict';var client=require(_0xe373('0x0'));exports[_0xe373('0x1')]=function(_0xb0293f){return client[_0xe373('0x2')](_0xe373('0x3'),{'body':_0xb0293f,'log':_0xe373('0x3')});};exports[_0xe373('0x4')]=function(_0x237286,_0x1f3988){return client[_0xe373('0x2')](_0xe373('0x5'),{'body':_0x1f3988,'options':{'where':{'uniqueid':_0x237286},'order':[['id',_0xe373('0x6')]],'limit':0x1},'log':_0xe373('0x5')});};
\ No newline at end of file
index 40816ca..d070638 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9fdc=['timeout','atimeout','channel','START:%s','info','[%s][AGENT]\x20ROUTING\x20STOPPED','rules','complete','[%s][AGENT]\x20ROUTING\x20END','close','next','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','stack','validate','lodash','util','../../../../config/logger','routing','./strategy','timeout\x20is\x20a\x20number','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','error','[%s][AGENT]\x20%s','map','message','join','stop','find'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9fdc,0x19b));var _0xc9fd=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0x9fdc[_0x209941];return _0x1e8729;};'use strict';var schema=require(_0xc9fd('0x0'));var _=require(_0xc9fd('0x1'));var util=require(_0xc9fd('0x2'));var seqqueue=require('seq-queue');var logger=require(_0xc9fd('0x3'))(_0xc9fd('0x4'));var strategy=require(_0xc9fd('0x5'));var queue=schema({'name':{'type':'string','required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':'number','message':_0xc9fd('0x6')}});function writeLog(_0x4c0408,_0x18c0a6,_0x2dd36c){return logger['info'](util[_0xc9fd('0x7')](_0xc9fd('0x8'),_0x4c0408,_0x18c0a6[_0xc9fd('0x9')],_0x2dd36c));}function handleFindAgent(_0x391aed){return function(_0x17e6aa){return _0x17e6aa[_0xc9fd('0x9')][_0xc9fd('0xa')]()===_0x391aed[_0xc9fd('0xa')]();};}exports['consequence']=function(_0x54d341,_0xcf1ef3,_0x4c2967,_0x4447ff){return function(_0x16fca3){try{var _0x2c7c65={'name':_0xcf1ef3[0x0],'timeout':_0xcf1ef3[0x1]};var _0x592245=queue[_0xc9fd('0x0')](_0x2c7c65,{'typecast':!![]});if(_0x592245['length']){logger[_0xc9fd('0xb')](_0xc9fd('0xc'),_0x54d341,_[_0xc9fd('0xd')](_0x592245,_0xc9fd('0xe'))[_0xc9fd('0xf')](',\x20'));_0x16fca3[_0xc9fd('0x10')]();}else{var _0x21b7c1=_[_0xc9fd('0x11')](_0x4c2967['agents'],handleFindAgent(_0x2c7c65[_0xc9fd('0x9')]));if(_0x21b7c1){var _0x152cb5=(_0x2c7c65[_0xc9fd('0x12')]||0xa)*0x3e8;var _0x3ef8f9,_0x1a9e8f;var _0x552a7c=seqqueue['createQueue'](_0x152cb5);_0x552a7c['id']=_0x54d341;_0x552a7c[_0xc9fd('0x13')]=_0x152cb5;_0x552a7c['channel']=_0x4447ff[_0xc9fd('0x14')];writeLog(_0x54d341,_0x21b7c1,util['format'](_0xc9fd('0x15'),_0x152cb5));_0x4c2967['rules'][_0x54d341]['on']('end',function(){logger[_0xc9fd('0x16')](_0xc9fd('0x17'),_0x54d341);clearTimeout(_0x1a9e8f);_0x1a9e8f=undefined;_0x552a7c['close']();if(_0x4c2967[_0xc9fd('0x18')][_0x54d341]){delete _0x4c2967['rules'][_0x54d341];}_0x16fca3[_0xc9fd('0x10')]();});_0x4c2967[_0xc9fd('0x18')][_0x54d341]['on'](_0xc9fd('0x19'),function(){if(_0x4c2967[_0xc9fd('0x18')][_0x54d341]){delete _0x4c2967[_0xc9fd('0x18')][_0x54d341];}});_0x1a9e8f=setTimeout(function(){logger[_0xc9fd('0x16')](_0xc9fd('0x1a'),_0x54d341);clearTimeout(_0x1a9e8f);_0x552a7c[_0xc9fd('0x1b')]();_0x16fca3[_0xc9fd('0x1c')]();},_0x152cb5);strategy['agent'](_0x552a7c,_0x21b7c1,_0x4c2967,_0x4447ff);}else{logger['error'](_0xc9fd('0x1d'),_0x54d341,_0x2c7c65[_0xc9fd('0x9')]);_0x16fca3[_0xc9fd('0x10')]();}}}catch(_0x50cbc3){console[_0xc9fd('0x1e')](_0x50cbc3);logger[_0xc9fd('0xb')](_0xc9fd('0x1f'),_0x54d341,_0x50cbc3[_0xc9fd('0x20')]);_0x16fca3['stop']();}};};
\ No newline at end of file
+var _0xed2c=['consequence','validate','[%s][AGENT]\x20%s','message','join','stop','agents','timeout','createQueue','atimeout','channel','format','START:%s','rules','end','[%s][AGENT]\x20ROUTING\x20STOPPED','[%s][AGENT]\x20ROUTING\x20END','agent','error','log','[%s][QUEUE]\x20%s','stack','seq-queue','../../../../config/logger','routing','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','info','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase'];(function(_0x472f34,_0x2b395c){var _0x2db343=function(_0xde3401){while(--_0xde3401){_0x472f34['push'](_0x472f34['shift']());}};_0x2db343(++_0x2b395c);}(_0xed2c,0x16a));var _0xced2=function(_0x49e454,_0x22328f){_0x49e454=_0x49e454-0x0;var _0x21d045=_0xed2c[_0x49e454];return _0x21d045;};'use strict';var schema=require('validate');var _=require('lodash');var util=require('util');var seqqueue=require(_0xced2('0x0'));var logger=require(_0xced2('0x1'))(_0xced2('0x2'));var strategy=require(_0xced2('0x3'));var queue=schema({'name':{'type':_0xced2('0x4'),'required':!![],'message':_0xced2('0x5')},'timeout':{'type':_0xced2('0x6'),'message':_0xced2('0x7')}});function writeLog(_0x1c1160,_0x149ac9,_0x21ce08){return logger[_0xced2('0x8')](util['format'](_0xced2('0x9'),_0x1c1160,_0x149ac9[_0xced2('0xa')],_0x21ce08));}function handleFindAgent(_0x264a30){return function(_0x31ee2b){return _0x31ee2b[_0xced2('0xa')][_0xced2('0xb')]()===_0x264a30['toLowerCase']();};}exports[_0xced2('0xc')]=function(_0x27f12e,_0x22ea99,_0x276b21,_0x486fd7){return function(_0x293361){try{var _0x4cfa4d={'name':_0x22ea99[0x0],'timeout':_0x22ea99[0x1]};var _0x16eecb=queue[_0xced2('0xd')](_0x4cfa4d,{'typecast':!![]});if(_0x16eecb['length']){logger['error'](_0xced2('0xe'),_0x27f12e,_['map'](_0x16eecb,_0xced2('0xf'))[_0xced2('0x10')](',\x20'));_0x293361[_0xced2('0x11')]();}else{var _0x74358e=_['find'](_0x276b21[_0xced2('0x12')],handleFindAgent(_0x4cfa4d['name']));if(_0x74358e){var _0x530b7c=(_0x4cfa4d[_0xced2('0x13')]||0xa)*0x3e8;var _0x21685c,_0xa6b38c;var _0x44a704=seqqueue[_0xced2('0x14')](_0x530b7c);_0x44a704['id']=_0x27f12e;_0x44a704[_0xced2('0x15')]=_0x530b7c;_0x44a704[_0xced2('0x16')]=_0x486fd7[_0xced2('0x16')];writeLog(_0x27f12e,_0x74358e,util[_0xced2('0x17')](_0xced2('0x18'),_0x530b7c));_0x276b21[_0xced2('0x19')][_0x27f12e]['on'](_0xced2('0x1a'),function(){logger[_0xced2('0x8')](_0xced2('0x1b'),_0x27f12e);clearTimeout(_0xa6b38c);_0xa6b38c=undefined;_0x44a704['close']();if(_0x276b21[_0xced2('0x19')][_0x27f12e]){delete _0x276b21['rules'][_0x27f12e];}_0x293361[_0xced2('0x11')]();});_0x276b21[_0xced2('0x19')][_0x27f12e]['on']('complete',function(){if(_0x276b21[_0xced2('0x19')][_0x27f12e]){delete _0x276b21[_0xced2('0x19')][_0x27f12e];}});_0xa6b38c=setTimeout(function(){logger['info'](_0xced2('0x1c'),_0x27f12e);clearTimeout(_0xa6b38c);_0x44a704['close']();_0x293361['next']();},_0x530b7c);strategy[_0xced2('0x1d')](_0x44a704,_0x74358e,_0x276b21,_0x486fd7);}else{logger[_0xced2('0x1e')]('[%s][AGENT]\x20agent\x20not\x20found\x20%s',_0x27f12e,_0x4cfa4d[_0xced2('0xa')]);_0x293361[_0xced2('0x11')]();}}}catch(_0x49693f){console[_0xced2('0x1f')](_0x49693f);logger['error'](_0xced2('0x20'),_0x27f12e,_0x49693f[_0xced2('0x21')]);_0x293361[_0xced2('0x11')]();}};};
\ No newline at end of file
index a88800c..13ab8bf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x85a7=['../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','UserId','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','contact','format','channel','whatsapp','phone','chat','ChatWebsiteId','upperFirst','AccountId','account','InteractionId','created','getMustacheRender','Message','create','info','body','catch','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','stop','message','toString','postText','error','next','providerName','amazonlex','dialogState','lodash','moment','./utils','../../../../config/logger','routing','../../rpc/chatMessage'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x85a7,0x1c6));var _0x785a=function(_0x5780f8,_0x3c181c){_0x5780f8=_0x5780f8-0x0;var _0x12f9cc=_0x85a7[_0x5780f8];return _0x12f9cc;};'use strict';var _=require(_0x785a('0x0'));var moment=require(_0x785a('0x1'));var AWS=require('aws-sdk');var utils=require(_0x785a('0x2'));var logger=require(_0x785a('0x3'))(_0x785a('0x4'));var rpc={'chatMessage':require(_0x785a('0x5')),'openchannelMessage':require(_0x785a('0x6')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x785a('0x7')),'faxMessage':require(_0x785a('0x8')),'whatsappMessage':require(_0x785a('0x9'))};exports[_0x785a('0xa')]=function(_0x3564f3,_0x5a86c1){return function(_0x193a10){try{if(!_[_0x785a('0xb')](this[_0x785a('0xc')][_0x785a('0xd')])){logger['info'](_0x785a('0xe'),_0x3564f3,_0x785a('0xf'));return _0x193a10['next']();}var _0x24c098={'ContactId':this[_0x785a('0x10')]['id'],'sentAt':moment()[_0x785a('0x11')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':'out'};if(this[_0x785a('0x12')]==='sms'||this[_0x785a('0x12')]===_0x785a('0x13')){_0x24c098[_0x785a('0x14')]=this[_0x785a('0xc')][_0x785a('0x14')];}var _0xe924e1=this[_0x785a('0x12')];if(_0xe924e1===_0x785a('0x15')){_0x24c098[_0x785a('0x16')]=this['account']['id'];}else{_0x24c098[_[_0x785a('0x17')](_0xe924e1)+_0x785a('0x18')]=this[_0x785a('0x19')]['id'];}_0x24c098[_[_0x785a('0x17')](_0xe924e1)+_0x785a('0x1a')]=this[_0x785a('0xc')]['id'];if(this[_0x785a('0xc')][_0x785a('0x1b')]){var _0x17a207=_0x5a86c1[0x4];if(!_['isEmpty'](_0x17a207)){_0x24c098['body']=utils[_0x785a('0x1c')](_0x17a207,this);return rpc[_0xe924e1+_0x785a('0x1d')][_0x785a('0x1e')](_0x24c098)['then'](function(_0x136e94){logger[_0x785a('0x1f')](_0x785a('0xe'),_0x3564f3,_0x24c098[_0x785a('0x20')]);})[_0x785a('0x21')](function(_0x515397){logger['error'](_0x785a('0xe'),_0x3564f3,JSON[_0x785a('0x22')](_0x515397));})[_0x785a('0x23')](function(){logger[_0x785a('0x1f')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x3564f3);_0x193a10['stop']();});}else{logger['info'](_0x785a('0x24'),_0x3564f3);_0x193a10[_0x785a('0x25')]();}}else{var _0x4cfcb5=this;var _0x393b7a=new AWS['LexRuntime']({'accessKeyId':_0x5a86c1[0x0],'secretAccessKey':_0x5a86c1[0x1],'region':_0x5a86c1[0x2]});var _0x4cb913={'botAlias':'$LATEST','botName':_0x5a86c1[0x3],'inputText':this[_0x785a('0x26')][_0x785a('0x20')],'userId':this[_0x785a('0x12')]+':'+this[_0x785a('0xc')]['id'][_0x785a('0x27')]()};_0x393b7a[_0x785a('0x28')](_0x4cb913,function(_0x1069e8,_0x3ffced){if(_0x1069e8){logger[_0x785a('0x29')]('[%s][AMAZONLEX]\x20%s',_0x3564f3,_0x1069e8[_0x785a('0x26')]);_0x193a10[_0x785a('0x2a')]();}else if(_0x3ffced&&_0x3ffced[_0x785a('0x26')]){_0x4cfcb5[_0x785a('0x20')]['amazonlex']=_0x3ffced;_0x24c098['body']=_0x3ffced[_0x785a('0x26')];_0x24c098[_0x785a('0x2b')]=_0x785a('0x2c');_0x24c098['providerResponse']=JSON[_0x785a('0x22')](_0x3ffced);return rpc[_0xe924e1+_0x785a('0x1d')][_0x785a('0x1e')](_0x24c098)['then'](function(_0x573253){logger[_0x785a('0x1f')](_0x785a('0xe'),_0x3564f3,_0x24c098[_0x785a('0x20')]);if(_0x3ffced[_0x785a('0x2d')]=='Failed'){_0x193a10[_0x785a('0x2a')]();}else{_0x193a10[_0x785a('0x25')]();}})[_0x785a('0x21')](function(_0x34bbd5){logger['error']('[%s][AMAZONLEX]\x20%s',_0x3564f3,JSON['stringify'](_0x34bbd5));_0x193a10['next']();});}else{_0x193a10[_0x785a('0x2a')]();}});}}catch(_0x4a8896){logger[_0x785a('0x29')]('[%s][AMAZONLEX]\x20%s',_0x3564f3,JSON[_0x785a('0x22')](_0x4a8896));_0x193a10['stop']();}};};
\ No newline at end of file
+var _0x5f11=['catch','error','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','stop','LexRuntime','message','toString','postText','amazonlex','providerName','providerResponse','dialogState','Failed','lodash','moment','aws-sdk','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','info','[%s][AMAZONLEX]\x20%s','next','contact','format','channel','whatsapp','phone','interaction','chat','ChatWebsiteId','account','AccountId','upperFirst','InteractionId','created','getMustacheRender','Message','create','then','body'];(function(_0x4dab14,_0x164ea0){var _0xf41aa=function(_0x305d50){while(--_0x305d50){_0x4dab14['push'](_0x4dab14['shift']());}};_0xf41aa(++_0x164ea0);}(_0x5f11,0x18f));var _0x15f1=function(_0x283cf7,_0x48bdfb){_0x283cf7=_0x283cf7-0x0;var _0x1c37ae=_0x5f11[_0x283cf7];return _0x1c37ae;};'use strict';var _=require(_0x15f1('0x0'));var moment=require(_0x15f1('0x1'));var AWS=require(_0x15f1('0x2'));var utils=require('./utils');var logger=require(_0x15f1('0x3'))(_0x15f1('0x4'));var rpc={'chatMessage':require(_0x15f1('0x5')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x15f1('0x6')),'smsMessage':require(_0x15f1('0x7')),'faxMessage':require(_0x15f1('0x8')),'whatsappMessage':require(_0x15f1('0x9'))};exports[_0x15f1('0xa')]=function(_0x1a618f,_0xa78dc7){return function(_0x54a908){try{if(!_[_0x15f1('0xb')](this['interaction']['UserId'])){logger[_0x15f1('0xc')](_0x15f1('0xd'),_0x1a618f,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x54a908[_0x15f1('0xe')]();}var _0x3486f6={'ContactId':this[_0x15f1('0xf')]['id'],'sentAt':moment()[_0x15f1('0x10')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':'out'};if(this[_0x15f1('0x11')]==='sms'||this[_0x15f1('0x11')]===_0x15f1('0x12')){_0x3486f6[_0x15f1('0x13')]=this[_0x15f1('0x14')]['phone'];}var _0x590628=this[_0x15f1('0x11')];if(_0x590628===_0x15f1('0x15')){_0x3486f6[_0x15f1('0x16')]=this[_0x15f1('0x17')]['id'];}else{_0x3486f6[_['upperFirst'](_0x590628)+_0x15f1('0x18')]=this['account']['id'];}_0x3486f6[_[_0x15f1('0x19')](_0x590628)+_0x15f1('0x1a')]=this[_0x15f1('0x14')]['id'];if(this[_0x15f1('0x14')][_0x15f1('0x1b')]){var _0x584d6b=_0xa78dc7[0x4];if(!_['isEmpty'](_0x584d6b)){_0x3486f6['body']=utils[_0x15f1('0x1c')](_0x584d6b,this);return rpc[_0x590628+_0x15f1('0x1d')][_0x15f1('0x1e')](_0x3486f6)[_0x15f1('0x1f')](function(_0x4ca650){logger['info'](_0x15f1('0xd'),_0x1a618f,_0x3486f6[_0x15f1('0x20')]);})[_0x15f1('0x21')](function(_0x5848c7){logger[_0x15f1('0x22')](_0x15f1('0xd'),_0x1a618f,JSON[_0x15f1('0x23')](_0x5848c7));})[_0x15f1('0x24')](function(){logger[_0x15f1('0xc')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x1a618f);_0x54a908['stop']();});}else{logger[_0x15f1('0xc')](_0x15f1('0x25'),_0x1a618f);_0x54a908[_0x15f1('0x26')]();}}else{var _0x2d3737=this;var _0x10c076=new AWS[(_0x15f1('0x27'))]({'accessKeyId':_0xa78dc7[0x0],'secretAccessKey':_0xa78dc7[0x1],'region':_0xa78dc7[0x2]});var _0x551930={'botAlias':'$LATEST','botName':_0xa78dc7[0x3],'inputText':this[_0x15f1('0x28')][_0x15f1('0x20')],'userId':this[_0x15f1('0x11')]+':'+this['interaction']['id'][_0x15f1('0x29')]()};_0x10c076[_0x15f1('0x2a')](_0x551930,function(_0x9932cf,_0x4518f8){if(_0x9932cf){logger[_0x15f1('0x22')](_0x15f1('0xd'),_0x1a618f,_0x9932cf[_0x15f1('0x28')]);_0x54a908[_0x15f1('0xe')]();}else if(_0x4518f8&&_0x4518f8['message']){_0x2d3737['body'][_0x15f1('0x2b')]=_0x4518f8;_0x3486f6[_0x15f1('0x20')]=_0x4518f8['message'];_0x3486f6[_0x15f1('0x2c')]='amazonlex';_0x3486f6[_0x15f1('0x2d')]=JSON[_0x15f1('0x23')](_0x4518f8);return rpc[_0x590628+_0x15f1('0x1d')][_0x15f1('0x1e')](_0x3486f6)[_0x15f1('0x1f')](function(_0x59fabd){logger[_0x15f1('0xc')]('[%s][AMAZONLEX]\x20%s',_0x1a618f,_0x3486f6['body']);if(_0x4518f8[_0x15f1('0x2e')]==_0x15f1('0x2f')){_0x54a908['next']();}else{_0x54a908[_0x15f1('0x26')]();}})[_0x15f1('0x21')](function(_0x4cbb8f){logger[_0x15f1('0x22')]('[%s][AMAZONLEX]\x20%s',_0x1a618f,JSON[_0x15f1('0x23')](_0x4cbb8f));_0x54a908['next']();});}else{_0x54a908[_0x15f1('0xe')]();}});}}catch(_0x4c67f3){logger['error'](_0x15f1('0xd'),_0x1a618f,JSON['stringify'](_0x4c67f3));_0x54a908[_0x15f1('0x26')]();}};};
\ No newline at end of file
index 743754c..af05410 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd777=['moment','../../../../config/logger','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../mailRpc','channel','mail','info','[%s][AUTOREPLY]\x20%s','next','isNil','interaction','created','Autoreply\x20already\x20sent','autoreplyExecuted','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','contact','format','YYYY-MM-DD\x20HH:mm:ss','body','getMustacheRender','message','from','phone','read','subject','Re:','Re:\x20','account','upperFirst','InteractionId','Message','inReplyTo','messageId','html','<div\x20id=\x22xm-mail-content\x22>','replace','<div\x20id=\x22xm-mail-content\x22','<div','</div>','headers','All','auto_reply','sendMailMessage','create','then','stringify','catch','[RPC][%s][AUTOREPLY]\x20%s','finally','resolve','Interaction','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','error','stop','lodash'];(function(_0x433a86,_0x175b5c){var _0x23000c=function(_0x4b1fa0){while(--_0x4b1fa0){_0x433a86['push'](_0x433a86['shift']());}};_0x23000c(++_0x175b5c);}(_0xd777,0x1b8));var _0x7d77=function(_0x4c060b,_0x4c5e75){_0x4c060b=_0x4c060b-0x0;var _0x5b9790=_0xd777[_0x4c060b];return _0x5b9790;};'use strict';var _=require(_0x7d77('0x0'));var moment=require(_0x7d77('0x1'));var utils=require('./utils');var logger=require(_0x7d77('0x2'))('routing');var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x7d77('0x3')),'mailMessage':require(_0x7d77('0x4')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x7d77('0x5')),'whatsappMessage':require(_0x7d77('0x6')),'chatInteraction':require(_0x7d77('0x7')),'openchannelInteraction':require(_0x7d77('0x8')),'mailInteraction':require(_0x7d77('0x9')),'smsInteraction':require(_0x7d77('0xa')),'faxInteraction':require(_0x7d77('0xb')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var mailRpc=require(_0x7d77('0xc'));exports['consequence']=function(_0x236aa3,_0x1483e9,_0x5c1c92,_0x5daeec){return function(_0x3f8455){try{var _0x20ff56=this[_0x7d77('0xd')];if(_0x20ff56===_0x7d77('0xe')&&_0x5daeec['body']['isAutoreply']){logger[_0x7d77('0xf')](_0x7d77('0x10'),_0x236aa3,'Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)');return _0x3f8455[_0x7d77('0x11')]();}if(_0x1483e9[0x0]==='1'&&(_[_0x7d77('0x12')](this[_0x7d77('0x13')]['created'])||!this[_0x7d77('0x13')][_0x7d77('0x14')])){logger['info'](_0x7d77('0x10'),_0x236aa3,_0x7d77('0x15'));return _0x3f8455[_0x7d77('0x11')]();}if(_0x1483e9[0x0]==='2'&&this['interaction'][_0x7d77('0x16')]){logger[_0x7d77('0xf')](_0x7d77('0x17'),_0x236aa3,'One\x20Time\x20already\x20sent');return _0x3f8455[_0x7d77('0x11')]();}var _0x4a6773={'ContactId':this[_0x7d77('0x18')]['id'],'sentAt':moment()[_0x7d77('0x19')](_0x7d77('0x1a')),'direction':'out'};if(this[_0x7d77('0xd')]===_0x7d77('0xe')){_0x4a6773[_0x7d77('0x1b')]=utils['getMustacheRender'](_0x1483e9[0x2],this);}else{_0x4a6773['body']=utils[_0x7d77('0x1c')](_0x1483e9[0x1],this);}if(this[_0x7d77('0x1d')]){_0x4a6773['to']=this[_0x7d77('0x1d')][_0x7d77('0x1e')]||'';if(this[_0x7d77('0xd')]===_0x7d77('0xe')&&_0x1483e9[0x1]==='1'){_0x4a6773['cc']=this[_0x7d77('0x1d')]['cc']||'';}_0x4a6773['from']=this[_0x7d77('0x1d')]['to']||'';_0x4a6773[_0x7d77('0x1f')]=this['message'][_0x7d77('0x1f')]||'';_0x4a6773[_0x7d77('0x20')]=!![];if(this[_0x7d77('0x1d')]['subject']){_0x4a6773[_0x7d77('0x21')]='';_0x4a6773['subject']+=_['startsWith'](this['message'][_0x7d77('0x21')],_0x7d77('0x22'))?'':_0x7d77('0x23');_0x4a6773['subject']+=this['message']['subject'];}}if(this[_0x7d77('0xd')]==='chat'){_0x4a6773['ChatWebsiteId']=this[_0x7d77('0x24')]['id'];}else{_0x4a6773[_[_0x7d77('0x25')](this[_0x7d77('0xd')])+'AccountId']=this['account']['id'];}_0x4a6773[_['upperFirst'](this[_0x7d77('0xd')])+_0x7d77('0x26')]=this['interaction']['id'];var _0x174490=this[_0x7d77('0x13')];if(rpc[this[_0x7d77('0xd')]+_0x7d77('0x27')]){if(this['channel']===_0x7d77('0xe')){_0x4a6773[_0x7d77('0x28')]=this[_0x7d77('0x1d')][_0x7d77('0x29')];_0x4a6773[_0x7d77('0x2a')]=_0x7d77('0x2b')+_[_0x7d77('0x2c')](_0x4a6773[_0x7d77('0x1b')],_0x7d77('0x2d'),_0x7d77('0x2e'))+_0x7d77('0x2f');_0x4a6773[_0x7d77('0x30')]={'Auto-Submitted':'auto-replied','X-Auto-Response-Suppress':_0x7d77('0x31'),'Precedence':_0x7d77('0x32')};return mailRpc[_0x7d77('0x33')](this[_0x7d77('0x24')]['smtpOptions'],_0x4a6773)['then'](function(_0x232a3f){logger['info']('[%s][AUTOREPLY]\x20SMTP\x20SENT',_0x236aa3);_0x4a6773['messageId']=_0x232a3f[_0x7d77('0x1d')][_0x7d77('0x29')];return rpc[_0x20ff56+_0x7d77('0x27')][_0x7d77('0x34')](_0x4a6773);})[_0x7d77('0x35')](function(_0x2376e3){logger[_0x7d77('0xf')](_0x7d77('0x10'),_0x236aa3,JSON[_0x7d77('0x36')](_0x2376e3));})[_0x7d77('0x37')](function(_0x50998f){logger['error'](_0x7d77('0x38'),_0x236aa3,JSON[_0x7d77('0x36')](_0x50998f));})[_0x7d77('0x39')](function(){Promise[_0x7d77('0x3a')]()[_0x7d77('0x35')](function(){if(_0x1483e9[0x0]!=='2'||_0x174490[_0x7d77('0x16')])return;return rpc[_0x20ff56+_0x7d77('0x3b')]['update'](_0x174490['id'],{'autoreplyExecuted':!![]})['then'](function(_0x265faa){logger[_0x7d77('0xf')](_0x7d77('0x17'),_0x236aa3,JSON[_0x7d77('0x36')](_0x265faa));})[_0x7d77('0x37')](function(_0x43eec8){logger['error'](_0x7d77('0x3c'),_0x236aa3,JSON['stringify'](_0x43eec8));});})[_0x7d77('0x35')](function(){_0x3f8455[_0x7d77('0x11')]();});});}else{return rpc[this[_0x7d77('0xd')]+_0x7d77('0x27')][_0x7d77('0x34')](_0x4a6773)[_0x7d77('0x35')](function(){logger[_0x7d77('0xf')](_0x7d77('0x10'),_0x236aa3,_0x4a6773[_0x7d77('0x1b')]);})['catch'](function(_0x1406f7){logger[_0x7d77('0x3d')](_0x7d77('0x10'),_0x236aa3,JSON[_0x7d77('0x36')](_0x1406f7));})[_0x7d77('0x39')](function(){Promise[_0x7d77('0x3a')]()[_0x7d77('0x35')](function(){if(_0x1483e9[0x0]!=='2'||_0x174490[_0x7d77('0x16')])return;return rpc[_0x20ff56+_0x7d77('0x3b')]['update'](_0x174490['id'],{'autoreplyExecuted':!![]})[_0x7d77('0x35')](function(_0x3c2583){logger[_0x7d77('0xf')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x236aa3,JSON[_0x7d77('0x36')](_0x3c2583));})[_0x7d77('0x37')](function(_0x12a255){logger[_0x7d77('0x3d')](_0x7d77('0x3c'),_0x236aa3,JSON[_0x7d77('0x36')](_0x12a255));});})[_0x7d77('0x35')](function(){_0x3f8455[_0x7d77('0x11')]();});});}}}catch(_0x4a13b2){logger[_0x7d77('0x3d')](_0x7d77('0x10'),_0x236aa3,JSON[_0x7d77('0x36')](_0x4a13b2));_0x3f8455[_0x7d77('0x3e')]();}};};
\ No newline at end of file
+var _0x7cef=['headers','auto-replied','All','sendMailMessage','smtpOptions','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','create','catch','error','[RPC][%s][AUTOREPLY]\x20%s','stringify','resolve','Interaction','update','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','finally','lodash','./utils','../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../mailRpc','consequence','channel','mail','body','isAutoreply','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','isNil','interaction','created','Autoreply\x20already\x20sent','autoreplyExecuted','One\x20Time\x20already\x20sent','contact','YYYY-MM-DD\x20HH:mm:ss','out','getMustacheRender','message','from','phone','read','subject','startsWith','Re:','ChatWebsiteId','account','AccountId','upperFirst','InteractionId','Message','messageId','html','replace','<div\x20id=\x22xm-mail-content\x22','<div','</div>'];(function(_0x19a029,_0xe42735){var _0x2997ed=function(_0x38d789){while(--_0x38d789){_0x19a029['push'](_0x19a029['shift']());}};_0x2997ed(++_0xe42735);}(_0x7cef,0xde));var _0xf7ce=function(_0x5a0448,_0x34db12){_0x5a0448=_0x5a0448-0x0;var _0x133b6f=_0x7cef[_0x5a0448];return _0x133b6f;};'use strict';var _=require(_0xf7ce('0x0'));var moment=require('moment');var utils=require(_0xf7ce('0x1'));var logger=require(_0xf7ce('0x2'))(_0xf7ce('0x3'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0xf7ce('0x4')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0xf7ce('0x5')),'faxMessage':require(_0xf7ce('0x6')),'whatsappMessage':require(_0xf7ce('0x7')),'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'mailInteraction':require('../../rpc/mailInteraction'),'smsInteraction':require(_0xf7ce('0x8')),'faxInteraction':require(_0xf7ce('0x9')),'whatsappInteraction':require(_0xf7ce('0xa'))};var mailRpc=require(_0xf7ce('0xb'));exports[_0xf7ce('0xc')]=function(_0x541d62,_0x28aa6d,_0x3731e3,_0x17226d){return function(_0x500fc7){try{var _0x3ad145=this[_0xf7ce('0xd')];if(_0x3ad145===_0xf7ce('0xe')&&_0x17226d[_0xf7ce('0xf')][_0xf7ce('0x10')]){logger[_0xf7ce('0x11')](_0xf7ce('0x12'),_0x541d62,_0xf7ce('0x13'));return _0x500fc7[_0xf7ce('0x14')]();}if(_0x28aa6d[0x0]==='1'&&(_[_0xf7ce('0x15')](this[_0xf7ce('0x16')]['created'])||!this[_0xf7ce('0x16')][_0xf7ce('0x17')])){logger[_0xf7ce('0x11')](_0xf7ce('0x12'),_0x541d62,_0xf7ce('0x18'));return _0x500fc7[_0xf7ce('0x14')]();}if(_0x28aa6d[0x0]==='2'&&this[_0xf7ce('0x16')][_0xf7ce('0x19')]){logger[_0xf7ce('0x11')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x541d62,_0xf7ce('0x1a'));return _0x500fc7[_0xf7ce('0x14')]();}var _0x3d234a={'ContactId':this[_0xf7ce('0x1b')]['id'],'sentAt':moment()['format'](_0xf7ce('0x1c')),'direction':_0xf7ce('0x1d')};if(this[_0xf7ce('0xd')]===_0xf7ce('0xe')){_0x3d234a[_0xf7ce('0xf')]=utils['getMustacheRender'](_0x28aa6d[0x2],this);}else{_0x3d234a[_0xf7ce('0xf')]=utils[_0xf7ce('0x1e')](_0x28aa6d[0x1],this);}if(this[_0xf7ce('0x1f')]){_0x3d234a['to']=this[_0xf7ce('0x1f')][_0xf7ce('0x20')]||'';if(this[_0xf7ce('0xd')]===_0xf7ce('0xe')&&_0x28aa6d[0x1]==='1'){_0x3d234a['cc']=this['message']['cc']||'';}_0x3d234a['from']=this[_0xf7ce('0x1f')]['to']||'';_0x3d234a[_0xf7ce('0x21')]=this[_0xf7ce('0x1f')][_0xf7ce('0x21')]||'';_0x3d234a[_0xf7ce('0x22')]=!![];if(this['message'][_0xf7ce('0x23')]){_0x3d234a['subject']='';_0x3d234a[_0xf7ce('0x23')]+=_[_0xf7ce('0x24')](this[_0xf7ce('0x1f')][_0xf7ce('0x23')],_0xf7ce('0x25'))?'':'Re:\x20';_0x3d234a['subject']+=this[_0xf7ce('0x1f')]['subject'];}}if(this[_0xf7ce('0xd')]==='chat'){_0x3d234a[_0xf7ce('0x26')]=this[_0xf7ce('0x27')]['id'];}else{_0x3d234a[_['upperFirst'](this[_0xf7ce('0xd')])+_0xf7ce('0x28')]=this[_0xf7ce('0x27')]['id'];}_0x3d234a[_[_0xf7ce('0x29')](this[_0xf7ce('0xd')])+_0xf7ce('0x2a')]=this[_0xf7ce('0x16')]['id'];var _0x7aacac=this['interaction'];if(rpc[this[_0xf7ce('0xd')]+_0xf7ce('0x2b')]){if(this['channel']===_0xf7ce('0xe')){_0x3d234a['inReplyTo']=this[_0xf7ce('0x1f')][_0xf7ce('0x2c')];_0x3d234a[_0xf7ce('0x2d')]='<div\x20id=\x22xm-mail-content\x22>'+_[_0xf7ce('0x2e')](_0x3d234a['body'],_0xf7ce('0x2f'),_0xf7ce('0x30'))+_0xf7ce('0x31');_0x3d234a[_0xf7ce('0x32')]={'Auto-Submitted':_0xf7ce('0x33'),'X-Auto-Response-Suppress':_0xf7ce('0x34'),'Precedence':'auto_reply'};return mailRpc[_0xf7ce('0x35')](this[_0xf7ce('0x27')][_0xf7ce('0x36')],_0x3d234a)[_0xf7ce('0x37')](function(_0x437f8e){logger['info'](_0xf7ce('0x38'),_0x541d62);_0x3d234a[_0xf7ce('0x2c')]=_0x437f8e[_0xf7ce('0x1f')]['messageId'];return rpc[_0x3ad145+_0xf7ce('0x2b')][_0xf7ce('0x39')](_0x3d234a);})['then'](function(_0x3cec8f){logger[_0xf7ce('0x11')]('[%s][AUTOREPLY]\x20%s',_0x541d62,JSON['stringify'](_0x3cec8f));})[_0xf7ce('0x3a')](function(_0x26b0ca){logger[_0xf7ce('0x3b')](_0xf7ce('0x3c'),_0x541d62,JSON[_0xf7ce('0x3d')](_0x26b0ca));})['finally'](function(){Promise[_0xf7ce('0x3e')]()[_0xf7ce('0x37')](function(){if(_0x28aa6d[0x0]!=='2'||_0x7aacac[_0xf7ce('0x19')])return;return rpc[_0x3ad145+_0xf7ce('0x3f')][_0xf7ce('0x40')](_0x7aacac['id'],{'autoreplyExecuted':!![]})[_0xf7ce('0x37')](function(_0xe3583f){logger[_0xf7ce('0x11')](_0xf7ce('0x41'),_0x541d62,JSON['stringify'](_0xe3583f));})[_0xf7ce('0x3a')](function(_0x352182){logger[_0xf7ce('0x3b')](_0xf7ce('0x42'),_0x541d62,JSON[_0xf7ce('0x3d')](_0x352182));});})[_0xf7ce('0x37')](function(){_0x500fc7[_0xf7ce('0x14')]();});});}else{return rpc[this[_0xf7ce('0xd')]+_0xf7ce('0x2b')][_0xf7ce('0x39')](_0x3d234a)[_0xf7ce('0x37')](function(){logger[_0xf7ce('0x11')](_0xf7ce('0x12'),_0x541d62,_0x3d234a[_0xf7ce('0xf')]);})[_0xf7ce('0x3a')](function(_0x20e3d2){logger[_0xf7ce('0x3b')](_0xf7ce('0x12'),_0x541d62,JSON[_0xf7ce('0x3d')](_0x20e3d2));})[_0xf7ce('0x43')](function(){Promise['resolve']()[_0xf7ce('0x37')](function(){if(_0x28aa6d[0x0]!=='2'||_0x7aacac[_0xf7ce('0x19')])return;return rpc[_0x3ad145+_0xf7ce('0x3f')]['update'](_0x7aacac['id'],{'autoreplyExecuted':!![]})['then'](function(_0x3c589a){logger[_0xf7ce('0x11')](_0xf7ce('0x41'),_0x541d62,JSON[_0xf7ce('0x3d')](_0x3c589a));})[_0xf7ce('0x3a')](function(_0xa940e9){logger[_0xf7ce('0x3b')](_0xf7ce('0x42'),_0x541d62,JSON['stringify'](_0xa940e9));});})[_0xf7ce('0x37')](function(){_0x500fc7[_0xf7ce('0x14')]();});});}}}catch(_0x14ad80){logger[_0xf7ce('0x3b')](_0xf7ce('0x12'),_0x541d62,JSON[_0xf7ce('0x3d')](_0x14ad80));_0x500fc7['stop']();}};};
\ No newline at end of file
index ef5f559..5afba30 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x65d1=['../../../../config/logger','routing','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','consequence','info','[%s][CLOSE]\x20reason\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','system','channel','Interaction','update','interaction','then','catch','error','[%s][CLOSE]\x20%s','stringify','finally','stop','moment'];(function(_0x3c3943,_0x53585a){var _0x302599=function(_0x46738e){while(--_0x46738e){_0x3c3943['push'](_0x3c3943['shift']());}};_0x302599(++_0x53585a);}(_0x65d1,0x7c));var _0x165d=function(_0x2d9535,_0x4bc592){_0x2d9535=_0x2d9535-0x0;var _0xb4e710=_0x65d1[_0x2d9535];return _0xb4e710;};'use strict';var moment=require(_0x165d('0x0'));var logger=require(_0x165d('0x1'))(_0x165d('0x2'));var rpc={'chatInteraction':require(_0x165d('0x3')),'openchannelInteraction':require(_0x165d('0x4')),'smsInteraction':require(_0x165d('0x5')),'mailInteraction':require(_0x165d('0x6')),'faxInteraction':require(_0x165d('0x7')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};exports[_0x165d('0x8')]=function(_0x44bb8d,_0x2ca7ee,_0x4d8912,_0x5cb206){return function(_0x361e7b){try{logger[_0x165d('0x9')](_0x165d('0xa'),_0x44bb8d,_0x2ca7ee[0x0]);var _0x83beab={'closed':0x1,'closedAt':moment()[_0x165d('0xb')](_0x165d('0xc')),'closeReason':_0x165d('0xd'),'disposition':_0x2ca7ee[0x0]};if(rpc[_0x5cb206[_0x165d('0xe')]+_0x165d('0xf')]){rpc[_0x5cb206[_0x165d('0xe')]+'Interaction'][_0x165d('0x10')](_0x5cb206[_0x165d('0x11')]['id'],_0x83beab)[_0x165d('0x12')](function(_0x43f77c){logger[_0x165d('0x9')]('[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!',_0x44bb8d,_0x5cb206[_0x165d('0x11')]['id']);})[_0x165d('0x13')](function(_0x1b4319){logger[_0x165d('0x14')](_0x165d('0x15'),_0x44bb8d,JSON[_0x165d('0x16')](_0x1b4319));})[_0x165d('0x17')](function(){_0x361e7b['stop']();});}}catch(_0x45f8fb){logger[_0x165d('0x14')]('[%s][CLOSE]\x20%s',_0x44bb8d,JSON[_0x165d('0x16')](_0x45f8fb));_0x361e7b[_0x165d('0x18')]();}};};
\ No newline at end of file
+var _0x796c=['[%s][CLOSE]\x20%s','stringify','stop','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','[%s][CLOSE]\x20reason\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','channel','Interaction','update','interaction','then','catch','error'];(function(_0x51976d,_0x1da87c){var _0x4268c5=function(_0x2bb422){while(--_0x2bb422){_0x51976d['push'](_0x51976d['shift']());}};_0x4268c5(++_0x1da87c);}(_0x796c,0xed));var _0xc796=function(_0x2aec52,_0x59d962){_0x2aec52=_0x2aec52-0x0;var _0x3b8835=_0x796c[_0x2aec52];return _0x3b8835;};'use strict';var moment=require('moment');var logger=require('../../../../config/logger')('routing');var rpc={'chatInteraction':require(_0xc796('0x0')),'openchannelInteraction':require(_0xc796('0x1')),'smsInteraction':require(_0xc796('0x2')),'mailInteraction':require(_0xc796('0x3')),'faxInteraction':require(_0xc796('0x4')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};exports['consequence']=function(_0xa8b4ad,_0x26c5cf,_0xf1990f,_0x32280d){return function(_0x351f89){try{logger['info'](_0xc796('0x5'),_0xa8b4ad,_0x26c5cf[0x0]);var _0x4bde9d={'closed':0x1,'closedAt':moment()[_0xc796('0x6')](_0xc796('0x7')),'closeReason':'system','disposition':_0x26c5cf[0x0]};if(rpc[_0x32280d[_0xc796('0x8')]+'Interaction']){rpc[_0x32280d[_0xc796('0x8')]+_0xc796('0x9')][_0xc796('0xa')](_0x32280d[_0xc796('0xb')]['id'],_0x4bde9d)[_0xc796('0xc')](function(_0x5a3476){logger['info']('[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!',_0xa8b4ad,_0x32280d[_0xc796('0xb')]['id']);})[_0xc796('0xd')](function(_0x230582){logger[_0xc796('0xe')](_0xc796('0xf'),_0xa8b4ad,JSON[_0xc796('0x10')](_0x230582));})['finally'](function(){_0x351f89[_0xc796('0x11')]();});}}catch(_0x1cc569){logger[_0xc796('0xe')]('[%s][CLOSE]\x20%s',_0xa8b4ad,JSON[_0xc796('0x10')](_0x1cc569));_0x351f89[_0xc796('0x11')]();}};};
\ No newline at end of file
index 0273471..b9962f8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfb65=['contact','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','phone','interaction','chat','ChatWebsiteId','account','upperFirst','created','isEmpty','body','getMustacheRender','Message','create','then','error','stringify','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','stop','textRequest','message','dialogflow','result','providerName','providerResponse','metadata','endConversation','catch','next','moment','apiai-promise','./utils','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','isNil','UserId','info','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.'];(function(_0x4e358c,_0x5ead7e){var _0x4522fd=function(_0x3fb9ab){while(--_0x3fb9ab){_0x4e358c['push'](_0x4e358c['shift']());}};_0x4522fd(++_0x5ead7e);}(_0xfb65,0x82));var _0x5fb6=function(_0x229f0b,_0x343580){_0x229f0b=_0x229f0b-0x0;var _0xdc8e14=_0xfb65[_0x229f0b];return _0xdc8e14;};'use strict';var _=require('lodash');var moment=require(_0x5fb6('0x0'));var apiai=require(_0x5fb6('0x1'));var md5=require('md5');var utils=require(_0x5fb6('0x2'));var logger=require('../../../../config/logger')(_0x5fb6('0x3'));var rpc={'chatMessage':require(_0x5fb6('0x4')),'openchannelMessage':require(_0x5fb6('0x5')),'mailMessage':require(_0x5fb6('0x6')),'smsMessage':require(_0x5fb6('0x7')),'faxMessage':require(_0x5fb6('0x8')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports['consequence']=function(_0x238914,_0x1b586b){return function(_0x1f99b8){try{if(!_[_0x5fb6('0x9')](this['interaction'][_0x5fb6('0xa')])){logger[_0x5fb6('0xb')](_0x5fb6('0xc'),_0x238914,_0x5fb6('0xd'));return _0x1f99b8['next']();}var _0x2b63fd={'ContactId':this[_0x5fb6('0xe')]['id'],'sentAt':moment()['format'](_0x5fb6('0xf')),'direction':_0x5fb6('0x10')};if(this[_0x5fb6('0x11')]===_0x5fb6('0x12')||this[_0x5fb6('0x11')]==='whatsapp'){_0x2b63fd[_0x5fb6('0x13')]=this[_0x5fb6('0x14')][_0x5fb6('0x13')];}var _0x41d503=this[_0x5fb6('0x11')];if(_0x41d503===_0x5fb6('0x15')){_0x2b63fd[_0x5fb6('0x16')]=this[_0x5fb6('0x17')]['id'];}else{_0x2b63fd[_['upperFirst'](_0x41d503)+'AccountId']=this[_0x5fb6('0x17')]['id'];}_0x2b63fd[_[_0x5fb6('0x18')](_0x41d503)+'InteractionId']=this[_0x5fb6('0x14')]['id'];if(this[_0x5fb6('0x14')][_0x5fb6('0x19')]){var _0x5d71c0=_0x1b586b[0x2];if(!_[_0x5fb6('0x1a')](_0x5d71c0)){_0x2b63fd[_0x5fb6('0x1b')]=utils[_0x5fb6('0x1c')](_0x5d71c0,this);return rpc[_0x41d503+_0x5fb6('0x1d')][_0x5fb6('0x1e')](_0x2b63fd)[_0x5fb6('0x1f')](function(_0x50bca8){logger[_0x5fb6('0xb')]('[%s][DIALOGFLOW]\x20%s',_0x238914,_0x2b63fd[_0x5fb6('0x1b')]);})['catch'](function(_0x43a252){logger[_0x5fb6('0x20')](_0x5fb6('0xc'),_0x238914,JSON[_0x5fb6('0x21')](_0x43a252));})[_0x5fb6('0x22')](function(){logger[_0x5fb6('0xb')](_0x5fb6('0x23'),_0x238914);_0x1f99b8['stop']();});}else{logger['info'](_0x5fb6('0x24'),_0x238914);_0x1f99b8[_0x5fb6('0x25')]();}}else{var _0x48a70e=this;var _0xdf1794=apiai(_0x1b586b[0x0],{'language':_0x1b586b[0x1]||'en'});return _0xdf1794[_0x5fb6('0x26')](this[_0x5fb6('0x27')][_0x5fb6('0x1b')],{'sessionId':md5(this['interaction']['id'])})[_0x5fb6('0x1f')](function(_0x44aebe){_0x48a70e[_0x5fb6('0x1b')][_0x5fb6('0x28')]=_0x44aebe;_0x2b63fd[_0x5fb6('0x1b')]=_0x44aebe[_0x5fb6('0x29')]['fulfillment']['speech'];_0x2b63fd[_0x5fb6('0x2a')]=_0x5fb6('0x28');_0x2b63fd[_0x5fb6('0x2b')]=JSON[_0x5fb6('0x21')](_0x44aebe);return rpc[_0x41d503+_0x5fb6('0x1d')][_0x5fb6('0x1e')](_0x2b63fd)[_0x5fb6('0x1f')](function(_0x4d6e01){logger[_0x5fb6('0xb')](_0x5fb6('0xc'),_0x238914,_0x2b63fd[_0x5fb6('0x1b')]);if(_0x44aebe['result'][_0x5fb6('0x2c')][_0x5fb6('0x2d')]){_0x1f99b8['next']();}else{_0x1f99b8[_0x5fb6('0x25')]();}})[_0x5fb6('0x2e')](function(_0x52afd7){logger[_0x5fb6('0x20')]('[%s][DIALOGFLOW]\x20%s',_0x238914,JSON[_0x5fb6('0x21')](_0x52afd7));_0x1f99b8['next']();});})['catch'](function(_0x159971){logger[_0x5fb6('0x20')](_0x5fb6('0xc'),_0x238914,_0x159971[_0x5fb6('0x27')]);_0x1f99b8[_0x5fb6('0x2f')]();});}}catch(_0x294157){logger['error'](_0x5fb6('0xc'),_0x238914,JSON[_0x5fb6('0x21')](_0x294157));_0x1f99b8[_0x5fb6('0x25')]();}};};
\ No newline at end of file
+var _0xae30=['../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','UserId','info','[%s][DIALOGFLOW]\x20%s','next','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','phone','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','isEmpty','body','getMustacheRender','Message','create','then','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','result','speech','providerName','dialogflow','stringify','metadata','endConversation','catch','error','lodash','moment','apiai-promise','./utils'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xae30,0x10a));var _0x0ae3=function(_0x122fe6,_0x4ac758){_0x122fe6=_0x122fe6-0x0;var _0x36b7d2=_0xae30[_0x122fe6];return _0x36b7d2;};'use strict';var _=require(_0x0ae3('0x0'));var moment=require(_0x0ae3('0x1'));var apiai=require(_0x0ae3('0x2'));var md5=require('md5');var utils=require(_0x0ae3('0x3'));var logger=require(_0x0ae3('0x4'))(_0x0ae3('0x5'));var rpc={'chatMessage':require(_0x0ae3('0x6')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x0ae3('0x7')),'smsMessage':require(_0x0ae3('0x8')),'faxMessage':require(_0x0ae3('0x9')),'whatsappMessage':require(_0x0ae3('0xa'))};exports[_0x0ae3('0xb')]=function(_0xda3853,_0x2b81f4){return function(_0x15b7e2){try{if(!_[_0x0ae3('0xc')](this[_0x0ae3('0xd')][_0x0ae3('0xe')])){logger[_0x0ae3('0xf')](_0x0ae3('0x10'),_0xda3853,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x15b7e2[_0x0ae3('0x11')]();}var _0xee8a4c={'ContactId':this['contact']['id'],'sentAt':moment()['format'](_0x0ae3('0x12')),'direction':_0x0ae3('0x13')};if(this[_0x0ae3('0x14')]===_0x0ae3('0x15')||this['channel']==='whatsapp'){_0xee8a4c[_0x0ae3('0x16')]=this[_0x0ae3('0xd')]['phone'];}var _0x588a65=this[_0x0ae3('0x14')];if(_0x588a65==='chat'){_0xee8a4c[_0x0ae3('0x17')]=this[_0x0ae3('0x18')]['id'];}else{_0xee8a4c[_[_0x0ae3('0x19')](_0x588a65)+_0x0ae3('0x1a')]=this[_0x0ae3('0x18')]['id'];}_0xee8a4c[_[_0x0ae3('0x19')](_0x588a65)+_0x0ae3('0x1b')]=this['interaction']['id'];if(this[_0x0ae3('0xd')]['created']){var _0x402949=_0x2b81f4[0x2];if(!_[_0x0ae3('0x1c')](_0x402949)){_0xee8a4c[_0x0ae3('0x1d')]=utils[_0x0ae3('0x1e')](_0x402949,this);return rpc[_0x588a65+_0x0ae3('0x1f')][_0x0ae3('0x20')](_0xee8a4c)[_0x0ae3('0x21')](function(_0x1bf406){logger[_0x0ae3('0xf')]('[%s][DIALOGFLOW]\x20%s',_0xda3853,_0xee8a4c[_0x0ae3('0x1d')]);})['catch'](function(_0x49d4b7){logger['error']('[%s][DIALOGFLOW]\x20%s',_0xda3853,JSON['stringify'](_0x49d4b7));})['finally'](function(){logger['info'](_0x0ae3('0x22'),_0xda3853);_0x15b7e2[_0x0ae3('0x23')]();});}else{logger[_0x0ae3('0xf')]('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0xda3853);_0x15b7e2[_0x0ae3('0x23')]();}}else{var _0x5ecc45=this;var _0xfcf4a8=apiai(_0x2b81f4[0x0],{'language':_0x2b81f4[0x1]||'en'});return _0xfcf4a8['textRequest'](this['message']['body'],{'sessionId':md5(this[_0x0ae3('0xd')]['id'])})[_0x0ae3('0x21')](function(_0x51e7d1){_0x5ecc45['body']['dialogflow']=_0x51e7d1;_0xee8a4c[_0x0ae3('0x1d')]=_0x51e7d1[_0x0ae3('0x24')]['fulfillment'][_0x0ae3('0x25')];_0xee8a4c[_0x0ae3('0x26')]=_0x0ae3('0x27');_0xee8a4c['providerResponse']=JSON[_0x0ae3('0x28')](_0x51e7d1);return rpc[_0x588a65+_0x0ae3('0x1f')][_0x0ae3('0x20')](_0xee8a4c)['then'](function(_0x293e40){logger[_0x0ae3('0xf')](_0x0ae3('0x10'),_0xda3853,_0xee8a4c['body']);if(_0x51e7d1[_0x0ae3('0x24')][_0x0ae3('0x29')][_0x0ae3('0x2a')]){_0x15b7e2[_0x0ae3('0x11')]();}else{_0x15b7e2[_0x0ae3('0x23')]();}})[_0x0ae3('0x2b')](function(_0x5e8979){logger[_0x0ae3('0x2c')](_0x0ae3('0x10'),_0xda3853,JSON[_0x0ae3('0x28')](_0x5e8979));_0x15b7e2[_0x0ae3('0x11')]();});})[_0x0ae3('0x2b')](function(_0x23f213){logger[_0x0ae3('0x2c')](_0x0ae3('0x10'),_0xda3853,_0x23f213['message']);_0x15b7e2[_0x0ae3('0x11')]();});}}catch(_0x25ec0d){logger[_0x0ae3('0x2c')](_0x0ae3('0x10'),_0xda3853,JSON['stringify'](_0x25ec0d));_0x15b7e2[_0x0ae3('0x23')]();}};};
\ No newline at end of file
index 9c23de8..ca7b73a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe314=['sms','channel','whatsapp','phone','chat','ChatWebsiteId','AccountId','account','upperFirst','InteractionId','created','isEmpty','getMustacheRender','create','finally','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','replace','SessionsClient','sessionPath','message','detectIntent','length','dialogflowV2','queryResult','diagnosticInfo','fields','boolValue','DIALOGFLOWV2_ACTION','action','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','DIALOGFLOWV2_INTENTNAME','name','DIALOGFLOWV2_INTENTDISPLAYNAME','displayName','DIALOGFLOWV2_ISFALLBACKINTENT','intent','isFallback','DIALOGFLOWV2_LANGUAGECODE','languageCode','DIALOGFLOWV2_QUERYTEXT','queryText','DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerResponse','push','all','dialogflow','md5','moment','bluebird','../../../../config/logger','routing','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/whatsappMessage','clone','body','Message','then','info','[%s][DIALOGFLOWV2]\x20%s','catch','error','stringify','consequence','isNil','interaction','UserId','next','format','YYYY-MM-DD\x20HH:mm:ss','out'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xe314,0x7c));var _0x4e31=function(_0x55966b,_0x49eb7f){_0x55966b=_0x55966b-0x0;var _0x14b9d8=_0xe314[_0x55966b];return _0x14b9d8;};'use strict';var _=require('lodash');var dialogflow=require(_0x4e31('0x0'));var md5=require(_0x4e31('0x1'));var moment=require(_0x4e31('0x2'));var Promise=require(_0x4e31('0x3'));var logger=require(_0x4e31('0x4'))(_0x4e31('0x5'));var utils=require(_0x4e31('0x6'));var rpc={'chatMessage':require(_0x4e31('0x7')),'openchannelMessage':require(_0x4e31('0x8')),'mailMessage':require(_0x4e31('0x9')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x4e31('0xa'))};function createMessage(_0x29d63d,_0x608c4d,_0x311a10,_0x430fb9){return new Promise(function(_0x11e865,_0x4b4c25){var _0x2bc015=_[_0x4e31('0xb')](_0x311a10);_0x2bc015[_0x4e31('0xc')]=_0x430fb9;return rpc[_0x608c4d+_0x4e31('0xd')]['create'](_0x2bc015)[_0x4e31('0xe')](function(){logger[_0x4e31('0xf')](_0x4e31('0x10'),_0x29d63d,_0x2bc015[_0x4e31('0xc')]);_0x11e865();})[_0x4e31('0x11')](function(_0x3459ba){logger[_0x4e31('0x12')](_0x4e31('0x10'),_0x29d63d,JSON[_0x4e31('0x13')](_0x3459ba));_0x4b4c25(_0x3459ba);});});}exports[_0x4e31('0x14')]=function(_0x41abc8,_0x2033df){return function(_0x44fbd5){try{if(!_[_0x4e31('0x15')](this[_0x4e31('0x16')][_0x4e31('0x17')])){logger[_0x4e31('0xf')](_0x4e31('0x10'),_0x41abc8,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x44fbd5[_0x4e31('0x18')]();}var _0x2e8651={'ContactId':this['contact']['id'],'sentAt':moment()[_0x4e31('0x19')](_0x4e31('0x1a')),'direction':_0x4e31('0x1b')};if(this['channel']===_0x4e31('0x1c')||this[_0x4e31('0x1d')]===_0x4e31('0x1e')){_0x2e8651['phone']=this[_0x4e31('0x16')][_0x4e31('0x1f')];}var _0x2cbafa=this['channel'];if(_0x2cbafa===_0x4e31('0x20')){_0x2e8651[_0x4e31('0x21')]=this['account']['id'];}else{_0x2e8651[_['upperFirst'](_0x2cbafa)+_0x4e31('0x22')]=this[_0x4e31('0x23')]['id'];}_0x2e8651[_[_0x4e31('0x24')](_0x2cbafa)+_0x4e31('0x25')]=this[_0x4e31('0x16')]['id'];if(this[_0x4e31('0x16')][_0x4e31('0x26')]){var _0x5ea84e=_0x2033df[0x4];if(!_[_0x4e31('0x27')](_0x5ea84e)){_0x2e8651[_0x4e31('0xc')]=utils[_0x4e31('0x28')](_0x5ea84e,this);return rpc[_0x2cbafa+'Message'][_0x4e31('0x29')](_0x2e8651)[_0x4e31('0xe')](function(_0x171a42){logger[_0x4e31('0xf')](_0x4e31('0x10'),_0x41abc8,_0x2e8651['body']);})[_0x4e31('0x11')](function(_0x269469){logger[_0x4e31('0x12')]('[%s][DIALOGFLOWV2]\x20%s',_0x41abc8,JSON[_0x4e31('0x13')](_0x269469));})[_0x4e31('0x2a')](function(){logger[_0x4e31('0xf')](_0x4e31('0x2b'),_0x41abc8);_0x44fbd5[_0x4e31('0x2c')]();});}else{logger[_0x4e31('0xf')](_0x4e31('0x2d'),_0x41abc8);_0x44fbd5[_0x4e31('0x2c')]();}}else{var _0x24b4e5=this;var _0x856589=_0x2033df[0x2][_0x4e31('0x2e')](/\\n/g,'\x0a');var _0x558c17={'credentials':{'private_key':_0x856589,'client_email':_0x2033df[0x1]}};var _0x17fd13=new dialogflow[(_0x4e31('0x2f'))](_0x558c17);var _0x55cb05=_0x17fd13[_0x4e31('0x30')](_0x2033df[0x0],md5(_0x24b4e5[_0x4e31('0x16')]['id']));var _0x522374={'session':_0x55cb05,'queryInput':{'text':{'text':_0x24b4e5[_0x4e31('0x31')]['body'],'languageCode':_0x2033df[0x3]||'en'}}};return _0x17fd13[_0x4e31('0x32')](_0x522374)[_0x4e31('0xe')](function(_0x50a23d){if(_0x50a23d&&_0x50a23d[_0x4e31('0x33')]){_0x24b4e5[_0x4e31('0xc')][_0x4e31('0x34')]=_0x50a23d;var _0x1e9371=_0x50a23d[0x0];var _0x340a1e=_0x1e9371[_0x4e31('0x35')][_0x4e31('0x36')]&&_0x1e9371[_0x4e31('0x35')][_0x4e31('0x36')][_0x4e31('0x37')]?_0x1e9371['queryResult'][_0x4e31('0x36')][_0x4e31('0x37')]['end_conversation'][_0x4e31('0x38')]:![];_0x24b4e5[_0x4e31('0xc')][_0x4e31('0x39')]=_0x1e9371['queryResult'][_0x4e31('0x3a')];_0x24b4e5[_0x4e31('0xc')][_0x4e31('0x3b')]=_0x1e9371[_0x4e31('0x35')]['allRequiredParamsPresent'];_0x24b4e5[_0x4e31('0xc')]['DIALOGFLOWV2_ENDCONVERSATION']=_0x1e9371['queryResult'][_0x4e31('0x36')]&&_0x1e9371[_0x4e31('0x35')]['diagnosticInfo']['fields']?_0x1e9371[_0x4e31('0x35')][_0x4e31('0x36')]['fields']['end_conversation'][_0x4e31('0x38')]:![];_0x24b4e5[_0x4e31('0xc')][_0x4e31('0x3c')]=_0x1e9371[_0x4e31('0x35')]['intent'][_0x4e31('0x3d')];_0x24b4e5[_0x4e31('0xc')][_0x4e31('0x3e')]=_0x1e9371['queryResult']['intent'][_0x4e31('0x3f')];_0x24b4e5[_0x4e31('0xc')][_0x4e31('0x40')]=_0x1e9371[_0x4e31('0x35')][_0x4e31('0x41')][_0x4e31('0x42')];_0x24b4e5[_0x4e31('0xc')][_0x4e31('0x43')]=_0x1e9371[_0x4e31('0x35')][_0x4e31('0x44')];_0x24b4e5[_0x4e31('0xc')][_0x4e31('0x45')]=_0x1e9371['queryResult'][_0x4e31('0x46')];_0x24b4e5['body'][_0x4e31('0x47')]=_0x1e9371[_0x4e31('0x35')][_0x4e31('0x48')];_0x2e8651['providerName']=_0x4e31('0x34');_0x2e8651[_0x4e31('0x49')]=JSON[_0x4e31('0x13')](_0x50a23d);var _0xe9ad2e=[];for(var _0x457183=0x0;_0x457183<_0x50a23d['length'];_0x457183++){var _0x41e4ac=_0x50a23d[_0x457183];if(_0x41e4ac&&_0x41e4ac[_0x4e31('0x35')]&&_0x41e4ac[_0x4e31('0x35')]['fulfillmentText']){_0xe9ad2e[_0x4e31('0x4a')](createMessage(_0x41abc8,_0x2cbafa,_0x2e8651,_0x41e4ac[_0x4e31('0x35')]['fulfillmentText']));}}return Promise[_0x4e31('0x4b')](_0xe9ad2e)[_0x4e31('0xe')](function(){if(_0x340a1e){_0x44fbd5['next']();}else{_0x44fbd5['stop']();}})[_0x4e31('0x11')](function(_0x4af4a0){logger['error'](_0x4e31('0x10'),_0x41abc8,JSON[_0x4e31('0x13')](_0x4af4a0));_0x44fbd5[_0x4e31('0x18')]();});}})[_0x4e31('0x11')](function(_0x57794d){logger[_0x4e31('0x12')]('[%s][DIALOGFLOWV2]\x20%s',_0x41abc8,_0x57794d[_0x4e31('0x31')]);_0x44fbd5[_0x4e31('0x18')]();});}}catch(_0x3d4dfc){logger['error'](_0x4e31('0x10'),_0x41abc8,JSON['stringify'](_0x3d4dfc));_0x44fbd5[_0x4e31('0x2c')]();}};};
\ No newline at end of file
+var _0x6981=['intent','name','DIALOGFLOWV2_INTENTDISPLAYNAME','DIALOGFLOWV2_ISFALLBACKINTENT','isFallback','DIALOGFLOWV2_LANGUAGECODE','languageCode','DIALOGFLOWV2_QUERYTEXT','queryText','DIALOGFLOWV2_SCORE','providerName','providerResponse','fulfillmentText','push','next','stop','message','lodash','dialogflow','md5','moment','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','clone','body','Message','create','then','info','catch','error','[%s][DIALOGFLOWV2]\x20%s','stringify','consequence','isNil','interaction','UserId','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','sms','channel','phone','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created','isEmpty','getMustacheRender','finally','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','replace','SessionsClient','sessionPath','detectIntent','length','dialogflowV2','diagnosticInfo','queryResult','fields','end_conversation','boolValue','DIALOGFLOWV2_ACTION','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','allRequiredParamsPresent','DIALOGFLOWV2_ENDCONVERSATION','DIALOGFLOWV2_INTENTNAME'];(function(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0x6981,0x14d));var _0x1698=function(_0x46ae23,_0x52b5c6){_0x46ae23=_0x46ae23-0x0;var _0x1db06b=_0x6981[_0x46ae23];return _0x1db06b;};'use strict';var _=require(_0x1698('0x0'));var dialogflow=require(_0x1698('0x1'));var md5=require(_0x1698('0x2'));var moment=require(_0x1698('0x3'));var Promise=require('bluebird');var logger=require(_0x1698('0x4'))(_0x1698('0x5'));var utils=require('./utils');var rpc={'chatMessage':require(_0x1698('0x6')),'openchannelMessage':require(_0x1698('0x7')),'mailMessage':require(_0x1698('0x8')),'smsMessage':require(_0x1698('0x9')),'faxMessage':require(_0x1698('0xa')),'whatsappMessage':require(_0x1698('0xb'))};function createMessage(_0x40591a,_0x4827e8,_0x3e9643,_0x2af7c5){return new Promise(function(_0x1689d6,_0x2a2517){var _0x24a102=_[_0x1698('0xc')](_0x3e9643);_0x24a102[_0x1698('0xd')]=_0x2af7c5;return rpc[_0x4827e8+_0x1698('0xe')][_0x1698('0xf')](_0x24a102)[_0x1698('0x10')](function(){logger[_0x1698('0x11')]('[%s][DIALOGFLOWV2]\x20%s',_0x40591a,_0x24a102[_0x1698('0xd')]);_0x1689d6();})[_0x1698('0x12')](function(_0x4c737d){logger[_0x1698('0x13')](_0x1698('0x14'),_0x40591a,JSON[_0x1698('0x15')](_0x4c737d));_0x2a2517(_0x4c737d);});});}exports[_0x1698('0x16')]=function(_0x5a9488,_0x1893c1){return function(_0x34ae04){try{if(!_[_0x1698('0x17')](this[_0x1698('0x18')][_0x1698('0x19')])){logger[_0x1698('0x11')](_0x1698('0x14'),_0x5a9488,_0x1698('0x1a'));return _0x34ae04['next']();}var _0x676d77={'ContactId':this[_0x1698('0x1b')]['id'],'sentAt':moment()[_0x1698('0x1c')](_0x1698('0x1d')),'direction':_0x1698('0x1e')};if(this['channel']===_0x1698('0x1f')||this[_0x1698('0x20')]==='whatsapp'){_0x676d77[_0x1698('0x21')]=this['interaction']['phone'];}var _0x59f933=this['channel'];if(_0x59f933===_0x1698('0x22')){_0x676d77[_0x1698('0x23')]=this[_0x1698('0x24')]['id'];}else{_0x676d77[_[_0x1698('0x25')](_0x59f933)+_0x1698('0x26')]=this[_0x1698('0x24')]['id'];}_0x676d77[_['upperFirst'](_0x59f933)+_0x1698('0x27')]=this[_0x1698('0x18')]['id'];if(this[_0x1698('0x18')][_0x1698('0x28')]){var _0x67a70a=_0x1893c1[0x4];if(!_[_0x1698('0x29')](_0x67a70a)){_0x676d77[_0x1698('0xd')]=utils[_0x1698('0x2a')](_0x67a70a,this);return rpc[_0x59f933+_0x1698('0xe')][_0x1698('0xf')](_0x676d77)[_0x1698('0x10')](function(_0x1cf8c6){logger[_0x1698('0x11')](_0x1698('0x14'),_0x5a9488,_0x676d77[_0x1698('0xd')]);})[_0x1698('0x12')](function(_0x3973a9){logger['error'](_0x1698('0x14'),_0x5a9488,JSON[_0x1698('0x15')](_0x3973a9));})[_0x1698('0x2b')](function(){logger[_0x1698('0x11')](_0x1698('0x2c'),_0x5a9488);_0x34ae04['stop']();});}else{logger[_0x1698('0x11')](_0x1698('0x2d'),_0x5a9488);_0x34ae04['stop']();}}else{var _0x1176c9=this;var _0x2370ba=_0x1893c1[0x2][_0x1698('0x2e')](/\\n/g,'\x0a');var _0x1bee8b={'credentials':{'private_key':_0x2370ba,'client_email':_0x1893c1[0x1]}};var _0x39cca8=new dialogflow[(_0x1698('0x2f'))](_0x1bee8b);var _0x373d59=_0x39cca8[_0x1698('0x30')](_0x1893c1[0x0],md5(_0x1176c9[_0x1698('0x18')]['id']));var _0x266376={'session':_0x373d59,'queryInput':{'text':{'text':_0x1176c9['message'][_0x1698('0xd')],'languageCode':_0x1893c1[0x3]||'en'}}};return _0x39cca8[_0x1698('0x31')](_0x266376)[_0x1698('0x10')](function(_0x5ee4dd){if(_0x5ee4dd&&_0x5ee4dd[_0x1698('0x32')]){_0x1176c9[_0x1698('0xd')][_0x1698('0x33')]=_0x5ee4dd;var _0xc30892=_0x5ee4dd[0x0];var _0x1688e4=_0xc30892['queryResult'][_0x1698('0x34')]&&_0xc30892[_0x1698('0x35')]['diagnosticInfo'][_0x1698('0x36')]?_0xc30892[_0x1698('0x35')][_0x1698('0x34')][_0x1698('0x36')][_0x1698('0x37')][_0x1698('0x38')]:![];_0x1176c9[_0x1698('0xd')][_0x1698('0x39')]=_0xc30892['queryResult']['action'];_0x1176c9[_0x1698('0xd')][_0x1698('0x3a')]=_0xc30892['queryResult'][_0x1698('0x3b')];_0x1176c9[_0x1698('0xd')][_0x1698('0x3c')]=_0xc30892['queryResult']['diagnosticInfo']&&_0xc30892['queryResult'][_0x1698('0x34')]['fields']?_0xc30892[_0x1698('0x35')][_0x1698('0x34')]['fields'][_0x1698('0x37')][_0x1698('0x38')]:![];_0x1176c9['body'][_0x1698('0x3d')]=_0xc30892[_0x1698('0x35')][_0x1698('0x3e')][_0x1698('0x3f')];_0x1176c9[_0x1698('0xd')][_0x1698('0x40')]=_0xc30892[_0x1698('0x35')][_0x1698('0x3e')]['displayName'];_0x1176c9[_0x1698('0xd')][_0x1698('0x41')]=_0xc30892['queryResult'][_0x1698('0x3e')][_0x1698('0x42')];_0x1176c9[_0x1698('0xd')][_0x1698('0x43')]=_0xc30892[_0x1698('0x35')][_0x1698('0x44')];_0x1176c9[_0x1698('0xd')][_0x1698('0x45')]=_0xc30892[_0x1698('0x35')][_0x1698('0x46')];_0x1176c9['body'][_0x1698('0x47')]=_0xc30892[_0x1698('0x35')]['intentDetectionConfidence'];_0x676d77[_0x1698('0x48')]='dialogflowV2';_0x676d77[_0x1698('0x49')]=JSON[_0x1698('0x15')](_0x5ee4dd);var _0x14ee3f=[];for(var _0x585316=0x0;_0x585316<_0x5ee4dd['length'];_0x585316++){var _0x1e9911=_0x5ee4dd[_0x585316];if(_0x1e9911&&_0x1e9911[_0x1698('0x35')]&&_0x1e9911[_0x1698('0x35')][_0x1698('0x4a')]){_0x14ee3f[_0x1698('0x4b')](createMessage(_0x5a9488,_0x59f933,_0x676d77,_0x1e9911[_0x1698('0x35')][_0x1698('0x4a')]));}}return Promise['all'](_0x14ee3f)[_0x1698('0x10')](function(){if(_0x1688e4){_0x34ae04[_0x1698('0x4c')]();}else{_0x34ae04[_0x1698('0x4d')]();}})['catch'](function(_0x2e3830){logger[_0x1698('0x13')](_0x1698('0x14'),_0x5a9488,JSON['stringify'](_0x2e3830));_0x34ae04[_0x1698('0x4c')]();});}})[_0x1698('0x12')](function(_0x38ae8e){logger[_0x1698('0x13')](_0x1698('0x14'),_0x5a9488,_0x38ae8e[_0x1698('0x4e')]);_0x34ae04[_0x1698('0x4c')]();});}}catch(_0x494019){logger[_0x1698('0x13')]('[%s][DIALOGFLOWV2]\x20%s',_0x5a9488,JSON[_0x1698('0x15')](_0x494019));_0x34ae04[_0x1698('0x4d')]();}};};
\ No newline at end of file
index 37abaa7..35c9569 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2d09=['condition','priorityTrue','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','findIndex','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','[%s][GOTOIF]\x20eval\x20error:\x20%s','message','stringify','validate','lodash','./utils','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','priority\x20true\x20is\x20a\x20number','number','consequence','fromString','getMustacheRender','replace','length','error','[%s][GOTOIF]\x20%s','join','stop'];(function(_0x5e4563,_0x3ff918){var _0x8d1bf5=function(_0x3bf7a9){while(--_0x3bf7a9){_0x5e4563['push'](_0x5e4563['shift']());}};_0x8d1bf5(++_0x3ff918);}(_0x2d09,0xba));var _0x92d0=function(_0x13f03a,_0x43a1bc){_0x13f03a=_0x13f03a-0x0;var _0x55b8ed=_0x2d09[_0x13f03a];return _0x55b8ed;};'use strict';var schema=require(_0x92d0('0x0'));var _=require(_0x92d0('0x1'));var htmlToText=require('html-to-text');var utils=require(_0x92d0('0x2'));var logger=require('../../../../config/logger')(_0x92d0('0x3'));var gotoif=schema({'condition':{'type':_0x92d0('0x4'),'required':!![],'message':_0x92d0('0x5')},'priorityTrue':{'type':'number','message':_0x92d0('0x6')},'priorityFalse':{'type':_0x92d0('0x7'),'message':'priority\x20false\x20is\x20a\x20number'}});exports[_0x92d0('0x8')]=function(_0x1f2b92,_0x1ffa65){return function(_0x417e7b){try{var _0x556bf6={'condition':htmlToText[_0x92d0('0x9')](utils[_0x92d0('0xa')](_0x1ffa65[0x0],this),{'wordwrap':![]})[_0x92d0('0xb')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x1ffa65[0x1],'priorityFalse':_0x1ffa65[0x2]};var _0x41737e=gotoif[_0x92d0('0x0')](_0x556bf6,{'typecast':!![]});if(_0x41737e[_0x92d0('0xc')]){logger[_0x92d0('0xd')](_0x92d0('0xe'),_0x1f2b92,_['map'](_0x41737e,'message')[_0x92d0('0xf')](',\x20'));_0x417e7b[_0x92d0('0x10')]();}else{try{var _0x12ce2a=eval('('+_0x556bf6[_0x92d0('0x11')]+')');var _0x303c7b=_0x12ce2a?_0x556bf6[_0x92d0('0x12')]:_0x556bf6['priorityFalse'];logger[_0x92d0('0x13')](_0x92d0('0x14'),_0x1f2b92,_0x556bf6[_0x92d0('0x11')],_0x12ce2a,_0x303c7b||_0x92d0('0x15'));if(_0x303c7b){var _0x21bd60=_[_0x92d0('0x16')](_0x417e7b[_0x92d0('0x17')](),{'p':_0x303c7b});if(_0x21bd60>=0x0){logger[_0x92d0('0x13')](_0x92d0('0x18'),_0x1f2b92,_0x303c7b||'next',_0x21bd60);_0x417e7b[_0x92d0('0x15')](_0x21bd60);}else{logger[_0x92d0('0x13')](_0x92d0('0x19'),_0x1f2b92,_0x303c7b||_0x92d0('0x15'));_0x417e7b[_0x92d0('0x10')]();}}else{_0x417e7b['next']();}}catch(_0x668400){logger['error'](_0x92d0('0x1a'),_0x1f2b92,_0x668400[_0x92d0('0x1b')]);_0x417e7b['stop']();}}}catch(_0x917cdb){logger[_0x92d0('0xd')]('[%s][GOTOIF]\x20%s',_0x1f2b92,JSON[_0x92d0('0x1c')](_0x917cdb));_0x417e7b[_0x92d0('0x10')]();}};};
\ No newline at end of file
+var _0x0caa=['info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','findIndex','rules','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','stringify','validate','lodash','../../../../config/logger','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','consequence','replace','length','error','[%s][GOTOIF]\x20%s','map','message','join','stop','condition','priorityTrue'];(function(_0xe6b674,_0x267db9){var _0x2a6236=function(_0x4b6f69){while(--_0x4b6f69){_0xe6b674['push'](_0xe6b674['shift']());}};_0x2a6236(++_0x267db9);}(_0x0caa,0x127));var _0xa0ca=function(_0x55157b,_0x19406b){_0x55157b=_0x55157b-0x0;var _0x2a2f2c=_0x0caa[_0x55157b];return _0x2a2f2c;};'use strict';var schema=require(_0xa0ca('0x0'));var _=require(_0xa0ca('0x1'));var htmlToText=require('html-to-text');var utils=require('./utils');var logger=require(_0xa0ca('0x2'))('routing');var gotoif=schema({'condition':{'type':_0xa0ca('0x3'),'required':!![],'message':_0xa0ca('0x4')},'priorityTrue':{'type':_0xa0ca('0x5'),'message':'priority\x20true\x20is\x20a\x20number'},'priorityFalse':{'type':_0xa0ca('0x5'),'message':'priority\x20false\x20is\x20a\x20number'}});exports[_0xa0ca('0x6')]=function(_0x46f42f,_0x3de8c4){return function(_0x3843a9){try{var _0x465d63={'condition':htmlToText['fromString'](utils['getMustacheRender'](_0x3de8c4[0x0],this),{'wordwrap':![]})[_0xa0ca('0x7')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x3de8c4[0x1],'priorityFalse':_0x3de8c4[0x2]};var _0x104ca5=gotoif[_0xa0ca('0x0')](_0x465d63,{'typecast':!![]});if(_0x104ca5[_0xa0ca('0x8')]){logger[_0xa0ca('0x9')](_0xa0ca('0xa'),_0x46f42f,_[_0xa0ca('0xb')](_0x104ca5,_0xa0ca('0xc'))[_0xa0ca('0xd')](',\x20'));_0x3843a9[_0xa0ca('0xe')]();}else{try{var _0x5a3b0b=eval('('+_0x465d63[_0xa0ca('0xf')]+')');var _0x35a5de=_0x5a3b0b?_0x465d63[_0xa0ca('0x10')]:_0x465d63['priorityFalse'];logger[_0xa0ca('0x11')](_0xa0ca('0x12'),_0x46f42f,_0x465d63[_0xa0ca('0xf')],_0x5a3b0b,_0x35a5de||_0xa0ca('0x13'));if(_0x35a5de){var _0x214d87=_[_0xa0ca('0x14')](_0x3843a9[_0xa0ca('0x15')](),{'p':_0x35a5de});if(_0x214d87>=0x0){logger['info']('[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x46f42f,_0x35a5de||_0xa0ca('0x13'),_0x214d87);_0x3843a9[_0xa0ca('0x13')](_0x214d87);}else{logger[_0xa0ca('0x11')](_0xa0ca('0x16'),_0x46f42f,_0x35a5de||_0xa0ca('0x13'));_0x3843a9['stop']();}}else{_0x3843a9[_0xa0ca('0x13')]();}}catch(_0x2379ca){logger[_0xa0ca('0x9')]('[%s][GOTOIF]\x20eval\x20error:\x20%s',_0x46f42f,_0x2379ca[_0xa0ca('0xc')]);_0x3843a9['stop']();}}}catch(_0xb8ef6a){logger[_0xa0ca('0x9')](_0xa0ca('0xa'),_0x46f42f,JSON[_0xa0ca('0x17')](_0xb8ef6a));_0x3843a9['stop']();}};};
\ No newline at end of file
index b657167..55a15ba 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5664=['error','[%s][GOTOP]\x20%s','message','info','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','stop','stringify','validate','lodash','../../../../config/logger','routing','length'];(function(_0x4273ac,_0x6ded70){var _0x17cfa7=function(_0x29a229){while(--_0x29a229){_0x4273ac['push'](_0x4273ac['shift']());}};_0x17cfa7(++_0x6ded70);}(_0x5664,0xfb));var _0x4566=function(_0x836465,_0x5442ae){_0x836465=_0x836465-0x0;var _0x2150ea=_0x5664[_0x836465];return _0x2150ea;};'use strict';var schema=require(_0x4566('0x0'));var _=require(_0x4566('0x1'));var logger=require(_0x4566('0x2'))(_0x4566('0x3'));var gotop=schema({'priority':{'type':'number','required':!![],'message':'priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required'}});exports['consequence']=function(_0x5b68e2,_0x148592){return function(_0x1e6105){try{var _0x5cc8c8={'priority':_0x148592[0x0]};var _0x50494a=gotop[_0x4566('0x0')](_0x5cc8c8,{'typecast':!![]});if(_0x50494a[_0x4566('0x4')]){logger[_0x4566('0x5')](_0x4566('0x6'),_0x5b68e2,_['map'](_0x50494a,_0x4566('0x7'))['join'](',\x20'));_0x1e6105['stop']();}else{logger[_0x4566('0x8')](_0x4566('0x9'),_0x5b68e2,_0x5cc8c8[_0x4566('0xa')]);if(_0x5cc8c8[_0x4566('0xa')]){var _0x29e0a8=_[_0x4566('0xb')](_0x1e6105['rules'](),{'p':_0x5cc8c8[_0x4566('0xa')]});if(_0x29e0a8>=0x0){logger[_0x4566('0x8')](_0x4566('0xc'),_0x5b68e2,_0x5cc8c8[_0x4566('0xa')]||_0x4566('0xd'),_0x29e0a8);_0x1e6105[_0x4566('0xd')](_0x29e0a8);}else{logger['info']('[%s][GOTOP]\x20priority\x20%s\x20not\x20found',_0x5b68e2,_0x5cc8c8[_0x4566('0xa')]||_0x4566('0xd'));_0x1e6105[_0x4566('0xe')]();}}else{_0x1e6105[_0x4566('0xd')]();}}}catch(_0x11b6fa){logger['error'](_0x4566('0x6'),_0x5b68e2,JSON[_0x4566('0xf')](_0x11b6fa));_0x1e6105[_0x4566('0xe')]();}};};
\ No newline at end of file
+var _0x9eff=['map','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','stringify','lodash','../../../../config/logger','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','length','error','[%s][GOTOP]\x20%s'];(function(_0x2d2e31,_0x305e39){var _0x50a02a=function(_0x308203){while(--_0x308203){_0x2d2e31['push'](_0x2d2e31['shift']());}};_0x50a02a(++_0x305e39);}(_0x9eff,0x1d7));var _0xf9ef=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x9eff[_0x199572];return _0x13cfa3;};'use strict';var schema=require('validate');var _=require(_0xf9ef('0x0'));var logger=require(_0xf9ef('0x1'))(_0xf9ef('0x2'));var gotop=schema({'priority':{'type':_0xf9ef('0x3'),'required':!![],'message':_0xf9ef('0x4')}});exports[_0xf9ef('0x5')]=function(_0x32ef21,_0x460e9f){return function(_0x1be431){try{var _0x33cc49={'priority':_0x460e9f[0x0]};var _0x323c1c=gotop['validate'](_0x33cc49,{'typecast':!![]});if(_0x323c1c[_0xf9ef('0x6')]){logger[_0xf9ef('0x7')](_0xf9ef('0x8'),_0x32ef21,_[_0xf9ef('0x9')](_0x323c1c,'message')['join'](',\x20'));_0x1be431[_0xf9ef('0xa')]();}else{logger[_0xf9ef('0xb')](_0xf9ef('0xc'),_0x32ef21,_0x33cc49[_0xf9ef('0xd')]);if(_0x33cc49['priority']){var _0x3f8fd5=_[_0xf9ef('0xe')](_0x1be431[_0xf9ef('0xf')](),{'p':_0x33cc49['priority']});if(_0x3f8fd5>=0x0){logger[_0xf9ef('0xb')](_0xf9ef('0x10'),_0x32ef21,_0x33cc49[_0xf9ef('0xd')]||_0xf9ef('0x11'),_0x3f8fd5);_0x1be431[_0xf9ef('0x11')](_0x3f8fd5);}else{logger[_0xf9ef('0xb')](_0xf9ef('0x12'),_0x32ef21,_0x33cc49[_0xf9ef('0xd')]||_0xf9ef('0x11'));_0x1be431[_0xf9ef('0xa')]();}}else{_0x1be431[_0xf9ef('0x11')]();}}}catch(_0x45eeaf){logger[_0xf9ef('0x7')](_0xf9ef('0x8'),_0x32ef21,JSON[_0xf9ef('0x13')](_0x45eeaf));_0x1be431[_0xf9ef('0xa')]();}};};
\ No newline at end of file
index b0fdae1..081886f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6de9=['../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','consequence','getMustacheRender','channel','chat','ChatWebsiteId','upperFirst','AccountId','InteractionId','Message','create','then','info','next','catch','error','[%s][MESSAGE]\x20%s','stop','stringify','lodash','./utils','../../../../config/logger','routing'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6de9,0xe6));var _0x96de=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6de9[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x96de('0x0'));var utils=require(_0x96de('0x1'));var logger=require(_0x96de('0x2'))(_0x96de('0x3'));var rpc={'chatMessage':require(_0x96de('0x4')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x96de('0x5')),'smsMessage':require(_0x96de('0x6')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x96de('0x7'))};exports[_0x96de('0x8')]=function(_0x4b61bc,_0x84f9b0){return function(_0x24da4e){try{var _0x20ed57={'body':utils[_0x96de('0x9')](_0x84f9b0[0x0],this),'ContactId':this['contact']['id']};if(this[_0x96de('0xa')]===_0x96de('0xb')){_0x20ed57[_0x96de('0xc')]=this['account']['id'];}else{_0x20ed57[_[_0x96de('0xd')](this[_0x96de('0xa')])+_0x96de('0xe')]=this['account']['id'];}_0x20ed57[_['upperFirst'](this[_0x96de('0xa')])+_0x96de('0xf')]=this['interaction']['id'];if(rpc[this[_0x96de('0xa')]+_0x96de('0x10')]){return rpc[this['channel']+'Message'][_0x96de('0x11')](_0x20ed57)[_0x96de('0x12')](function(_0x54d1bf){logger[_0x96de('0x13')]('[%s][MESSAGE]\x20%s',_0x4b61bc,_0x20ed57['body']);_0x24da4e[_0x96de('0x14')]();})[_0x96de('0x15')](function(_0x1a8935){logger[_0x96de('0x16')](_0x96de('0x17'),_0x4b61bc,JSON['stringify'](_0x1a8935));_0x24da4e[_0x96de('0x18')]();});}}catch(_0x3d9409){logger[_0x96de('0x16')](_0x96de('0x17'),_0x4b61bc,JSON[_0x96de('0x19')](_0x3d9409));_0x24da4e[_0x96de('0x18')]();}};};
\ No newline at end of file
+var _0x10a5=['info','body','next','[%s][MESSAGE]\x20%s','stringify','stop','error','lodash','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','contact','channel','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','Message','create','then'];(function(_0x2518e4,_0x486c2e){var _0xcc3d41=function(_0x6b9976){while(--_0x6b9976){_0x2518e4['push'](_0x2518e4['shift']());}};_0xcc3d41(++_0x486c2e);}(_0x10a5,0x163));var _0x510a=function(_0x29e2af,_0x15e2b1){_0x29e2af=_0x29e2af-0x0;var _0x1ea06a=_0x10a5[_0x29e2af];return _0x1ea06a;};'use strict';var _=require(_0x510a('0x0'));var utils=require(_0x510a('0x1'));var logger=require(_0x510a('0x2'))(_0x510a('0x3'));var rpc={'chatMessage':require(_0x510a('0x4')),'openchannelMessage':require(_0x510a('0x5')),'mailMessage':require(_0x510a('0x6')),'smsMessage':require(_0x510a('0x7')),'faxMessage':require(_0x510a('0x8')),'whatsappMessage':require(_0x510a('0x9'))};exports[_0x510a('0xa')]=function(_0x4081a9,_0x190ed8){return function(_0x457b21){try{var _0x4bdf71={'body':utils['getMustacheRender'](_0x190ed8[0x0],this),'ContactId':this[_0x510a('0xb')]['id']};if(this[_0x510a('0xc')]===_0x510a('0xd')){_0x4bdf71[_0x510a('0xe')]=this[_0x510a('0xf')]['id'];}else{_0x4bdf71[_[_0x510a('0x10')](this[_0x510a('0xc')])+_0x510a('0x11')]=this[_0x510a('0xf')]['id'];}_0x4bdf71[_['upperFirst'](this[_0x510a('0xc')])+_0x510a('0x12')]=this['interaction']['id'];if(rpc[this[_0x510a('0xc')]+_0x510a('0x13')]){return rpc[this[_0x510a('0xc')]+_0x510a('0x13')][_0x510a('0x14')](_0x4bdf71)[_0x510a('0x15')](function(_0x25facc){logger[_0x510a('0x16')]('[%s][MESSAGE]\x20%s',_0x4081a9,_0x4bdf71[_0x510a('0x17')]);_0x457b21[_0x510a('0x18')]();})['catch'](function(_0x494b03){logger['error'](_0x510a('0x19'),_0x4081a9,JSON[_0x510a('0x1a')](_0x494b03));_0x457b21[_0x510a('0x1b')]();});}}catch(_0x117e1b){logger[_0x510a('0x1c')](_0x510a('0x19'),_0x4081a9,JSON['stringify'](_0x117e1b));_0x457b21[_0x510a('0x1b')]();}};};
\ No newline at end of file
index b5738d4..986a888 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1957=['getMustacheRender','next','error','stop','./utils','routing','consequence','info','[%s][NOOP]\x20%s'];(function(_0x257642,_0x270a80){var _0x3d813b=function(_0x2a1c8a){while(--_0x2a1c8a){_0x257642['push'](_0x257642['shift']());}};_0x3d813b(++_0x270a80);}(_0x1957,0xd3));var _0x7195=function(_0x70a8a5,_0x35a384){_0x70a8a5=_0x70a8a5-0x0;var _0x2b563b=_0x1957[_0x70a8a5];return _0x2b563b;};'use strict';var utils=require(_0x7195('0x0'));var logger=require('../../../../config/logger')(_0x7195('0x1'));exports[_0x7195('0x2')]=function(_0x341e25,_0x5cbb34){return function(_0x4c8335){try{logger[_0x7195('0x3')](_0x7195('0x4'),_0x341e25,utils[_0x7195('0x5')](_0x5cbb34[0x0],this));_0x4c8335[_0x7195('0x6')]();}catch(_0x2fbef2){logger[_0x7195('0x7')](_0x7195('0x4'),_0x341e25,JSON['stringify'](_0x2fbef2));_0x4c8335[_0x7195('0x8')]();}};};
\ No newline at end of file
+var _0xe9e7=['stringify','./utils','../../../../config/logger','routing','info','[%s][NOOP]\x20%s','getMustacheRender','next','error'];(function(_0x3877c1,_0x238c29){var _0x59056a=function(_0x3567cd){while(--_0x3567cd){_0x3877c1['push'](_0x3877c1['shift']());}};_0x59056a(++_0x238c29);}(_0xe9e7,0x1f0));var _0x7e9e=function(_0x871c66,_0x5478a3){_0x871c66=_0x871c66-0x0;var _0x2985c5=_0xe9e7[_0x871c66];return _0x2985c5;};'use strict';var utils=require(_0x7e9e('0x0'));var logger=require(_0x7e9e('0x1'))(_0x7e9e('0x2'));exports['consequence']=function(_0x1fd5fc,_0x99030){return function(_0x108c11){try{logger[_0x7e9e('0x3')](_0x7e9e('0x4'),_0x1fd5fc,utils[_0x7e9e('0x5')](_0x99030[0x0],this));_0x108c11[_0x7e9e('0x6')]();}catch(_0x5f29ff){logger[_0x7e9e('0x7')](_0x7e9e('0x4'),_0x1fd5fc,JSON[_0x7e9e('0x8')](_0x5f29ff));_0x108c11['stop']();}};};
\ No newline at end of file
index 799a416..7ebbc12 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8fa7=['QueueReport','catch','create\x20queue\x20report','accepted','update','update\x20queue\x20report','[%s][END:QUEUE][NAME:%s]','error','toLowerCase','consequence','validate','length','[%s][QUEUE]\x20%s','map','join','stop','find','timeout','createQueue','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','rules','complete','strategy','rrmemory','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','lodash','seq-queue','moment','ioredis','../../../../config/environment','../../../../config/logger','routing','./strategy','redis','localhost','queue_id','account','from','joinAt','emit','clone','queue','format','pick','%s_queue_waiting_interaction:%s','save','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/smsQueueReport','../../rpc/whatsappQueueReport','string','number','timeout\x20is\x20a\x20number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','channel','QueueId','interaction','MessageId','message','AccountId','info','[%s][START:QUEUE][NAME:%s]','name'];(function(_0x43cf67,_0xe3d5ef){var _0x2eb0a8=function(_0x10f81e){while(--_0x10f81e){_0x43cf67['push'](_0x43cf67['shift']());}};_0x2eb0a8(++_0xe3d5ef);}(_0x8fa7,0x13c));var _0x78fa=function(_0x56740a,_0x568894){_0x56740a=_0x56740a-0x0;var _0x257144=_0x8fa7[_0x56740a];return _0x257144;};'use strict';var schema=require('validate');var _=require(_0x78fa('0x0'));var util=require('util');var seqqueue=require(_0x78fa('0x1'));var moment=require(_0x78fa('0x2'));var Redis=require(_0x78fa('0x3'));var config=require(_0x78fa('0x4'));var logger=require(_0x78fa('0x5'))(_0x78fa('0x6'));var strategy=require(_0x78fa('0x7'));config[_0x78fa('0x8')]=_['defaults'](config[_0x78fa('0x8')],{'host':_0x78fa('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x78fa('0x8')]));var attributes=['id',_0x78fa('0xa'),_0x78fa('0xb'),'queue',_0x78fa('0xc'),_0x78fa('0xd')];function emit(_0x57c372,_0x5a8a9f,_0xcf080d){io['to'](_0x57c372)[_0x78fa('0xe')](_0x5a8a9f,_0xcf080d);}function emitChannelQueueInteraction(_0x301125,_0x2296e1,_0x5a4e16,_0x15c65b,_0x162815,_0x10c632,_0x424617,_0x38dd78){var _0x59e89c=_[_0x78fa('0xf')](_0x5a4e16);_0x59e89c[_0x78fa('0xa')]=_0x38dd78;_0x59e89c[_0x78fa('0x10')]=_0x2296e1;_0x59e89c[_0x78fa('0xb')]=_0x15c65b;_0x59e89c['id']=_0x162815;if(_0x10c632){_0x424617[util[_0x78fa('0x11')]('%sQueuesWaitingInteractions',_0x301125)][_0x162815]=_[_0x78fa('0x12')](_0x59e89c,attributes);}else{delete _0x424617[util[_0x78fa('0x11')]('%sQueuesWaitingInteractions',_0x301125)][_0x162815];}emit(util[_0x78fa('0x11')]('%s:queue:%s',_0x301125,_0x2296e1),util[_0x78fa('0x11')](_0x78fa('0x13'),_0x301125,_0x10c632?_0x78fa('0x14'):_0x78fa('0x15')),_[_0x78fa('0x12')](_0x59e89c,attributes));}var rpc={'openchannelQueueReport':require(_0x78fa('0x16')),'mailQueueReport':require(_0x78fa('0x17')),'chatQueueReport':require('../../rpc/chatQueueReport'),'smsQueueReport':require(_0x78fa('0x18')),'faxQueueReport':require('../../rpc/faxQueueReport'),'whatsappQueueReport':require(_0x78fa('0x19'))};var queue=schema({'name':{'type':_0x78fa('0x1a'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0x78fa('0x1b'),'message':_0x78fa('0x1c')}});function startRouting(_0x31304b,_0xeb1595,_0x3e63c4,_0x4bf598){if(_0x31304b&&_0xeb1595&&_0x3e63c4){_0xeb1595[_0x78fa('0x1d')]+=0x1;var _0x49f110={'uniqueid':_0x31304b,'from':_0x3e63c4[_0x78fa('0x1e')]?_0x3e63c4[_0x78fa('0x1e')][_0x78fa('0xc')]:'','joinAt':moment()[_0x78fa('0x11')](_0x78fa('0x1f')),'ContactId':_0x3e63c4[_0x78fa('0x20')]?_0x3e63c4['contact']['id']:null,'ListId':_0x3e63c4[_0x78fa('0x21')]?_0x3e63c4[_0x78fa('0x21')]['id']:null};_0x49f110[_[_0x78fa('0x22')](_0x3e63c4[_0x78fa('0x23')])+_0x78fa('0x24')]=_0xeb1595['id']||null;_0x49f110[_[_0x78fa('0x22')](_0x3e63c4[_0x78fa('0x23')])+'InteractionId']=_0x3e63c4[_0x78fa('0x25')]?_0x3e63c4[_0x78fa('0x25')]['id']:null;_0x49f110[_[_0x78fa('0x22')](_0x3e63c4[_0x78fa('0x23')])+_0x78fa('0x26')]=_0x3e63c4['message']?_0x3e63c4[_0x78fa('0x27')]['id']:null;_0x49f110[_[_0x78fa('0x22')](_0x3e63c4[_0x78fa('0x23')])+(_0x3e63c4['channel']!=='chat'?_0x78fa('0x28'):'WebsiteId')]=_0x3e63c4['account']?_0x3e63c4['account']['id']:null;logger[_0x78fa('0x29')](util[_0x78fa('0x11')](_0x78fa('0x2a'),_0x31304b,_0xeb1595['name']));emitChannelQueueInteraction(_0x3e63c4[_0x78fa('0x23')],_0xeb1595[_0x78fa('0x2b')],_0x49f110,_0x3e63c4[_0x78fa('0xb')][_0x78fa('0x2b')],_0x3e63c4['message']['id'],!![],_0x4bf598,_0xeb1595['id']);if(rpc[_0x3e63c4[_0x78fa('0x23')]+_0x78fa('0x2c')]){return rpc[_0x3e63c4['channel']+_0x78fa('0x2c')]['create'](_0x49f110)[_0x78fa('0x2d')](function(_0x385a40){logger['error'](_0x78fa('0x2e'));});}}}function stopRouting(_0x10430c,_0xf0be3a,_0x30c67d,_0x3ee3f2){if(_0x10430c&&_0xf0be3a){_0xf0be3a['waiting']-=0x1;var _0x18bca7={'leaveAt':moment()[_0x78fa('0x11')](_0x78fa('0x1f')),'acceptAt':moment()[_0x78fa('0x11')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0x78fa('0x2f')};logger[_0x78fa('0x29')](util[_0x78fa('0x11')]('[%s][STOP:QUEUE][NAME:%s]',_0x10430c,_0xf0be3a[_0x78fa('0x2b')]));emitChannelQueueInteraction(_0x30c67d[_0x78fa('0x23')],_0xf0be3a['name'],_0x30c67d['body'],_0x30c67d[_0x78fa('0xb')]['name'],_0x30c67d[_0x78fa('0x27')]['id'],![],_0x3ee3f2,_0xf0be3a['id']);if(rpc[_0x30c67d[_0x78fa('0x23')]+'QueueReport']){return rpc[_0x30c67d[_0x78fa('0x23')]+'QueueReport'][_0x78fa('0x30')](_0x10430c,_0x18bca7)[_0x78fa('0x2d')](function(_0x156dd0){logger['error'](_0x78fa('0x31'));});}}}function endRouting(_0x51431e,_0x1ec4ae,_0x5ed6eb,_0x571d12){if(_0x51431e&&_0x1ec4ae){_0x1ec4ae[_0x78fa('0x1d')]-=0x1;var _0x5e2cd2={'leaveAt':moment()['format'](_0x78fa('0x1f')),'exitAt':moment()[_0x78fa('0x11')](_0x78fa('0x1f')),'reason':'timeout'};logger[_0x78fa('0x29')](util[_0x78fa('0x11')](_0x78fa('0x32'),_0x51431e,_0x1ec4ae[_0x78fa('0x2b')]));emitChannelQueueInteraction(_0x5ed6eb[_0x78fa('0x23')],_0x1ec4ae[_0x78fa('0x2b')],_0x5ed6eb[_0x78fa('0x1e')],_0x5ed6eb[_0x78fa('0xb')][_0x78fa('0x2b')],_0x5ed6eb[_0x78fa('0x27')]['id'],![],_0x571d12);if(rpc[_0x5ed6eb[_0x78fa('0x23')]+_0x78fa('0x2c')]){return rpc[_0x5ed6eb[_0x78fa('0x23')]+_0x78fa('0x2c')][_0x78fa('0x30')](_0x51431e,_0x5e2cd2)['catch'](function(_0x9ff957){logger[_0x78fa('0x33')](_0x78fa('0x31'));});}}}function handleFindQueue(_0x2add1d){return function(_0x306299){return _0x306299['name'][_0x78fa('0x34')]()===_0x2add1d[_0x78fa('0x34')]();};}exports[_0x78fa('0x35')]=function(_0x99520f,_0x3448ef,_0x1812a8,_0x15b241){return function(_0x290948){try{var _0x893c27={'name':_0x3448ef[0x0],'timeout':_0x3448ef[0x1]};var _0x107181=queue[_0x78fa('0x36')](_0x893c27,{'typecast':!![]});if(_0x107181[_0x78fa('0x37')]){logger[_0x78fa('0x33')](_0x78fa('0x38'),_0x99520f,_[_0x78fa('0x39')](_0x107181,_0x78fa('0x27'))[_0x78fa('0x3a')](',\x20'));_0x290948[_0x78fa('0x3b')]();}else{var _0x20fe38=_[_0x78fa('0x3c')](_0x1812a8[_0x15b241[_0x78fa('0x23')]+'Queues'],handleFindQueue(_0x893c27[_0x78fa('0x2b')]));if(_0x20fe38){startRouting(_0x99520f,_0x20fe38,_0x15b241,_0x1812a8);var _0x144b72=(_0x20fe38['timeout']||0xa)*0x3e8;var _0x18feec=(_0x893c27[_0x78fa('0x3d')]||0x14)*0x3e8;var _0x240d29,_0x46c7b3;if(_0x144b72>_0x18feec){_0x18feec=_0x144b72;}var _0x2fd33e=seqqueue[_0x78fa('0x3e')](_0x144b72);_0x2fd33e['id']=_0x99520f;_0x2fd33e['atimeout']=_0x144b72;_0x2fd33e['qtimeout']=_0x18feec;_0x2fd33e[_0x78fa('0x23')]=_0x15b241[_0x78fa('0x23')];_0x1812a8['rules'][_0x99520f]['on'](_0x78fa('0x3f'),function(){logger[_0x78fa('0x29')](_0x78fa('0x40'),_0x99520f);stopRouting(_0x99520f,_0x20fe38,_0x15b241,_0x1812a8);clearTimeout(_0x240d29);_0x240d29=undefined;_0x2fd33e[_0x78fa('0x41')](!![]);if(_0x1812a8[_0x78fa('0x42')][_0x99520f]){delete _0x1812a8[_0x78fa('0x42')][_0x99520f];}_0x290948[_0x78fa('0x3b')]();});_0x1812a8['rules'][_0x99520f]['on'](_0x78fa('0x43'),function(){if(_0x1812a8[_0x78fa('0x42')][_0x99520f]){delete _0x1812a8[_0x78fa('0x42')][_0x99520f];}});_0x240d29=setTimeout(function(){logger[_0x78fa('0x29')]('[%s][QUEUE]\x20APPLICATION\x20END',_0x99520f);endRouting(_0x99520f,_0x20fe38,_0x15b241,_0x1812a8);clearTimeout(_0x240d29);_0x2fd33e['close'](!![]);_0x290948['next']();},_0x18feec);switch(_0x20fe38[_0x78fa('0x44')]){case _0x78fa('0x45'):strategy[_0x78fa('0x45')](_0x2fd33e,_0x20fe38,_0x1812a8,_0x15b241);break;default:strategy['beepall'](_0x2fd33e,_0x20fe38,_0x1812a8,_0x15b241);}}else{logger[_0x78fa('0x33')](_0x78fa('0x46'),_0x99520f,_0x893c27[_0x78fa('0x2b')]);_0x290948[_0x78fa('0x3b')]();}}}catch(_0x1f2249){console[_0x78fa('0x47')](_0x1f2249);logger[_0x78fa('0x33')]('[%s][QUEUE]\x20%s',_0x99520f,_0x1f2249['stack']);_0x290948['stop']();}};};
\ No newline at end of file
+var _0x459c=['localhost','queue_id','account','queue','from','joinAt','emit','clone','format','pick','%sQueuesWaitingInteractions','save','../../rpc/openchannelQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','timeout\x20is\x20a\x20number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','channel','QueueId','upperFirst','InteractionId','interaction','MessageId','message','chat','AccountId','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','error','create\x20queue\x20report','accepted','[%s][STOP:QUEUE][NAME:%s]','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','update','toLowerCase','consequence','validate','[%s][QUEUE]\x20%s','stop','Queues','createQueue','atimeout','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','complete','[%s][QUEUE]\x20APPLICATION\x20END','close','next','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','stack','lodash','seq-queue','moment','ioredis','../../../../config/environment','../../../../config/logger','routing','./strategy','redis'];(function(_0x4b9118,_0x1ecf2f){var _0x516c27=function(_0x289d62){while(--_0x289d62){_0x4b9118['push'](_0x4b9118['shift']());}};_0x516c27(++_0x1ecf2f);}(_0x459c,0x12b));var _0xc459=function(_0x3b85db,_0x37836e){_0x3b85db=_0x3b85db-0x0;var _0x19610c=_0x459c[_0x3b85db];return _0x19610c;};'use strict';var schema=require('validate');var _=require(_0xc459('0x0'));var util=require('util');var seqqueue=require(_0xc459('0x1'));var moment=require(_0xc459('0x2'));var Redis=require(_0xc459('0x3'));var config=require(_0xc459('0x4'));var logger=require(_0xc459('0x5'))(_0xc459('0x6'));var strategy=require(_0xc459('0x7'));config[_0xc459('0x8')]=_['defaults'](config[_0xc459('0x8')],{'host':_0xc459('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var attributes=['id',_0xc459('0xa'),_0xc459('0xb'),_0xc459('0xc'),_0xc459('0xd'),_0xc459('0xe')];function emit(_0x40857f,_0x3b54e7,_0x4883a3){io['to'](_0x40857f)[_0xc459('0xf')](_0x3b54e7,_0x4883a3);}function emitChannelQueueInteraction(_0x4312b5,_0x1e7a29,_0x58d53a,_0x46ee95,_0x5e765f,_0x21868d,_0x5c6966,_0xc4cd91){var _0x3cc33b=_[_0xc459('0x10')](_0x58d53a);_0x3cc33b['queue_id']=_0xc4cd91;_0x3cc33b[_0xc459('0xc')]=_0x1e7a29;_0x3cc33b['account']=_0x46ee95;_0x3cc33b['id']=_0x5e765f;if(_0x21868d){_0x5c6966[util[_0xc459('0x11')]('%sQueuesWaitingInteractions',_0x4312b5)][_0x5e765f]=_[_0xc459('0x12')](_0x3cc33b,attributes);}else{delete _0x5c6966[util[_0xc459('0x11')](_0xc459('0x13'),_0x4312b5)][_0x5e765f];}emit(util[_0xc459('0x11')]('%s:queue:%s',_0x4312b5,_0x1e7a29),util[_0xc459('0x11')]('%s_queue_waiting_interaction:%s',_0x4312b5,_0x21868d?_0xc459('0x14'):'remove'),_[_0xc459('0x12')](_0x3cc33b,attributes));}var rpc={'openchannelQueueReport':require(_0xc459('0x15')),'mailQueueReport':require('../../rpc/mailQueueReport'),'chatQueueReport':require(_0xc459('0x16')),'smsQueueReport':require(_0xc459('0x17')),'faxQueueReport':require(_0xc459('0x18')),'whatsappQueueReport':require('../../rpc/whatsappQueueReport')};var queue=schema({'name':{'type':'string','required':!![],'message':_0xc459('0x19')},'timeout':{'type':'number','message':_0xc459('0x1a')}});function startRouting(_0x6bb6f3,_0x47af3f,_0x55e2f0,_0x63848b){if(_0x6bb6f3&&_0x47af3f&&_0x55e2f0){_0x47af3f[_0xc459('0x1b')]+=0x1;var _0xa7752e={'uniqueid':_0x6bb6f3,'from':_0x55e2f0['body']?_0x55e2f0[_0xc459('0x1c')][_0xc459('0xd')]:'','joinAt':moment()[_0xc459('0x11')](_0xc459('0x1d')),'ContactId':_0x55e2f0['contact']?_0x55e2f0[_0xc459('0x1e')]['id']:null,'ListId':_0x55e2f0[_0xc459('0x1f')]?_0x55e2f0[_0xc459('0x1f')]['id']:null};_0xa7752e[_['upperFirst'](_0x55e2f0[_0xc459('0x20')])+_0xc459('0x21')]=_0x47af3f['id']||null;_0xa7752e[_[_0xc459('0x22')](_0x55e2f0[_0xc459('0x20')])+_0xc459('0x23')]=_0x55e2f0['interaction']?_0x55e2f0[_0xc459('0x24')]['id']:null;_0xa7752e[_['upperFirst'](_0x55e2f0['channel'])+_0xc459('0x25')]=_0x55e2f0[_0xc459('0x26')]?_0x55e2f0[_0xc459('0x26')]['id']:null;_0xa7752e[_['upperFirst'](_0x55e2f0['channel'])+(_0x55e2f0[_0xc459('0x20')]!==_0xc459('0x27')?_0xc459('0x28'):_0xc459('0x29'))]=_0x55e2f0['account']?_0x55e2f0[_0xc459('0xb')]['id']:null;logger[_0xc459('0x2a')](util[_0xc459('0x11')](_0xc459('0x2b'),_0x6bb6f3,_0x47af3f[_0xc459('0x2c')]));emitChannelQueueInteraction(_0x55e2f0[_0xc459('0x20')],_0x47af3f['name'],_0xa7752e,_0x55e2f0['account'][_0xc459('0x2c')],_0x55e2f0['message']['id'],!![],_0x63848b,_0x47af3f['id']);if(rpc[_0x55e2f0[_0xc459('0x20')]+'QueueReport']){return rpc[_0x55e2f0[_0xc459('0x20')]+_0xc459('0x2d')][_0xc459('0x2e')](_0xa7752e)[_0xc459('0x2f')](function(_0x273a67){logger[_0xc459('0x30')](_0xc459('0x31'));});}}}function stopRouting(_0x1d4028,_0x307cb8,_0x43e88a,_0x15e127){if(_0x1d4028&&_0x307cb8){_0x307cb8[_0xc459('0x1b')]-=0x1;var _0x573eda={'leaveAt':moment()[_0xc459('0x11')](_0xc459('0x1d')),'acceptAt':moment()[_0xc459('0x11')](_0xc459('0x1d')),'reason':_0xc459('0x32')};logger['info'](util[_0xc459('0x11')](_0xc459('0x33'),_0x1d4028,_0x307cb8['name']));emitChannelQueueInteraction(_0x43e88a[_0xc459('0x20')],_0x307cb8[_0xc459('0x2c')],_0x43e88a[_0xc459('0x1c')],_0x43e88a[_0xc459('0xb')][_0xc459('0x2c')],_0x43e88a[_0xc459('0x26')]['id'],![],_0x15e127,_0x307cb8['id']);if(rpc[_0x43e88a[_0xc459('0x20')]+'QueueReport']){return rpc[_0x43e88a['channel']+_0xc459('0x2d')]['update'](_0x1d4028,_0x573eda)[_0xc459('0x2f')](function(_0x14181b){logger['error'](_0xc459('0x34'));});}}}function endRouting(_0x3083cc,_0x4fd9c1,_0x3dd8ee,_0x48c7da){if(_0x3083cc&&_0x4fd9c1){_0x4fd9c1['waiting']-=0x1;var _0x4a4213={'leaveAt':moment()['format'](_0xc459('0x1d')),'exitAt':moment()[_0xc459('0x11')](_0xc459('0x1d')),'reason':_0xc459('0x35')};logger[_0xc459('0x2a')](util['format'](_0xc459('0x36'),_0x3083cc,_0x4fd9c1['name']));emitChannelQueueInteraction(_0x3dd8ee[_0xc459('0x20')],_0x4fd9c1[_0xc459('0x2c')],_0x3dd8ee[_0xc459('0x1c')],_0x3dd8ee[_0xc459('0xb')][_0xc459('0x2c')],_0x3dd8ee['message']['id'],![],_0x48c7da);if(rpc[_0x3dd8ee[_0xc459('0x20')]+_0xc459('0x2d')]){return rpc[_0x3dd8ee[_0xc459('0x20')]+_0xc459('0x2d')][_0xc459('0x37')](_0x3083cc,_0x4a4213)[_0xc459('0x2f')](function(_0x47f567){logger['error'](_0xc459('0x34'));});}}}function handleFindQueue(_0x3d716d){return function(_0x5ebe6c){return _0x5ebe6c[_0xc459('0x2c')][_0xc459('0x38')]()===_0x3d716d[_0xc459('0x38')]();};}exports[_0xc459('0x39')]=function(_0x470a53,_0x144b8a,_0x289997,_0x15fc68){return function(_0x325b0b){try{var _0x1505b6={'name':_0x144b8a[0x0],'timeout':_0x144b8a[0x1]};var _0x2ff66f=queue[_0xc459('0x3a')](_0x1505b6,{'typecast':!![]});if(_0x2ff66f['length']){logger[_0xc459('0x30')](_0xc459('0x3b'),_0x470a53,_['map'](_0x2ff66f,_0xc459('0x26'))['join'](',\x20'));_0x325b0b[_0xc459('0x3c')]();}else{var _0x2a1dfe=_['find'](_0x289997[_0x15fc68[_0xc459('0x20')]+_0xc459('0x3d')],handleFindQueue(_0x1505b6['name']));if(_0x2a1dfe){startRouting(_0x470a53,_0x2a1dfe,_0x15fc68,_0x289997);var _0x5f37b4=(_0x2a1dfe[_0xc459('0x35')]||0xa)*0x3e8;var _0x3a9d32=(_0x1505b6[_0xc459('0x35')]||0x14)*0x3e8;var _0x43a550,_0x2adf90;if(_0x5f37b4>_0x3a9d32){_0x3a9d32=_0x5f37b4;}var _0x128cf5=seqqueue[_0xc459('0x3e')](_0x5f37b4);_0x128cf5['id']=_0x470a53;_0x128cf5[_0xc459('0x3f')]=_0x5f37b4;_0x128cf5['qtimeout']=_0x3a9d32;_0x128cf5['channel']=_0x15fc68[_0xc459('0x20')];_0x289997[_0xc459('0x40')][_0x470a53]['on'](_0xc459('0x41'),function(){logger['info'](_0xc459('0x42'),_0x470a53);stopRouting(_0x470a53,_0x2a1dfe,_0x15fc68,_0x289997);clearTimeout(_0x43a550);_0x43a550=undefined;_0x128cf5['close'](!![]);if(_0x289997['rules'][_0x470a53]){delete _0x289997[_0xc459('0x40')][_0x470a53];}_0x325b0b[_0xc459('0x3c')]();});_0x289997['rules'][_0x470a53]['on'](_0xc459('0x43'),function(){if(_0x289997[_0xc459('0x40')][_0x470a53]){delete _0x289997[_0xc459('0x40')][_0x470a53];}});_0x43a550=setTimeout(function(){logger['info'](_0xc459('0x44'),_0x470a53);endRouting(_0x470a53,_0x2a1dfe,_0x15fc68,_0x289997);clearTimeout(_0x43a550);_0x128cf5[_0xc459('0x45')](!![]);_0x325b0b[_0xc459('0x46')]();},_0x3a9d32);switch(_0x2a1dfe[_0xc459('0x47')]){case _0xc459('0x48'):strategy[_0xc459('0x48')](_0x128cf5,_0x2a1dfe,_0x289997,_0x15fc68);break;default:strategy[_0xc459('0x49')](_0x128cf5,_0x2a1dfe,_0x289997,_0x15fc68);}}else{logger['error'](_0xc459('0x4a'),_0x470a53,_0x1505b6[_0xc459('0x2c')]);_0x325b0b[_0xc459('0x3c')]();}}}catch(_0x966c6b){console[_0xc459('0x4b')](_0x966c6b);logger['error']('[%s][QUEUE]\x20%s',_0x470a53,_0x966c6b[_0xc459('0x4c')]);_0x325b0b[_0xc459('0x3c')]();}};};
\ No newline at end of file
index e46ddaf..dc40530 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9785=['hideNotification','busy','TIMEOUT','lodash','uuid','./util','squeue','agent','realtime','push','bind','timeout','handleTimeout','drained','handleDrained','prototype','info','[%s][AGENT]\x20try\x20with\x20%s','isNil','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','channel','busyQueue','showNotification','notificationId','routing','writeLog','RINGING','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s'];(function(_0x4b53ee,_0x1ff18d){var _0x657e46=function(_0x1cfde9){while(--_0x1cfde9){_0x4b53ee['push'](_0x4b53ee['shift']());}};_0x657e46(++_0x1ff18d);}(_0x9785,0xe3));var _0x5978=function(_0x1cbcf1,_0x3f9fd9){_0x1cbcf1=_0x1cbcf1-0x0;var _0x3a06f0=_0x9785[_0x1cbcf1];return _0x3a06f0;};'use strict';var _=require(_0x5978('0x0'));var uuid=require(_0x5978('0x1'));var util=require(_0x5978('0x2'));var logger=require('../../../../../config/logger')('routing');var Agent=function(_0x19c2bd,_0x116ded,_0x4f1c48,_0x2cf565){this['notificationId']=uuid['v4']();this[_0x5978('0x3')]=_0x19c2bd;this[_0x5978('0x4')]=_0x116ded;this[_0x5978('0x5')]=_0x4f1c48;this['routing']=_0x2cf565;this[_0x5978('0x3')][_0x5978('0x6')](this['handleRun']['bind'](this),this['handleTimeout'][_0x5978('0x7')](this));this[_0x5978('0x3')]['on'](_0x5978('0x8'),this[_0x5978('0x9')]['bind'](this));this[_0x5978('0x3')]['on'](_0x5978('0xa'),this[_0x5978('0xb')][_0x5978('0x7')](this));};Agent[_0x5978('0xc')]['push']=function(){this['squeue'][_0x5978('0x6')](this['handleRun'][_0x5978('0x7')](this),this['handleTimeout'][_0x5978('0x7')](this));};Agent[_0x5978('0xc')][_0x5978('0xb')]=function(){this['handleTimeout'](!![]);};Agent['prototype']['handleRun']=function(_0x23d5e5){logger[_0x5978('0xd')](_0x5978('0xe'),this[_0x5978('0x3')]['id'],this[_0x5978('0x4')]['id']);if(_[_0x5978('0xf')](this['realtime'][_0x5978('0x10')][this[_0x5978('0x4')]['id']])){logger[_0x5978('0xd')](_0x5978('0x11'),this['squeue']['id'],this[_0x5978('0x4')]['id']);setTimeout(this[_0x5978('0x6')][_0x5978('0x7')](this),0x3e8);}else{if(this['routing'][_0x5978('0x12')]||util[_0x5978('0x13')](this[_0x5978('0x3')]['id'],this['realtime'][_0x5978('0x10')][this[_0x5978('0x4')]['id']],this[_0x5978('0x3')][_0x5978('0x14')],![])){this[_0x5978('0x5')][_0x5978('0x10')][this[_0x5978('0x4')]['id']]['busy']=!![];this[_0x5978('0x5')][_0x5978('0x10')][this['agent']['id']][_0x5978('0x15')]=undefined;util[_0x5978('0x16')](this[_0x5978('0x17')],this['squeue']['id'],this[_0x5978('0x5')][_0x5978('0x10')][this[_0x5978('0x4')]['id']],null,this[_0x5978('0x18')]);util[_0x5978('0x19')](this[_0x5978('0x3')]['id'],this[_0x5978('0x5')][_0x5978('0x10')][this[_0x5978('0x4')]['id']],_0x5978('0x1a')+(this[_0x5978('0x18')]['forcedOwnership']?':FORCED':''));}else{logger[_0x5978('0xd')](_0x5978('0x1b'),this['squeue']['id'],this[_0x5978('0x4')]['id']);setTimeout(this['push']['bind'](this),0x3e8);}}};Agent[_0x5978('0xc')][_0x5978('0x9')]=function(_0xe2af54){if(_[_0x5978('0xf')](this[_0x5978('0x5')][_0x5978('0x10')][this[_0x5978('0x4')]['id']])){return logger['info'](_0x5978('0x11'),this[_0x5978('0x3')]['id'],this['agent']['id']);}else{logger[_0x5978('0xd')](_0x5978('0x1c'),this[_0x5978('0x3')]['id'],this[_0x5978('0x4')]['id']);util[_0x5978('0x1d')](this[_0x5978('0x17')],this[_0x5978('0x3')]['id'],this[_0x5978('0x5')]['agents'][this['agent']['id']],null,this[_0x5978('0x18')]);this['realtime'][_0x5978('0x10')][this[_0x5978('0x4')]['id']][_0x5978('0x1e')]=![];this[_0x5978('0x5')]['agents'][this['agent']['id']][_0x5978('0x15')]=undefined;util[_0x5978('0x19')](this[_0x5978('0x3')]['id'],this['realtime'][_0x5978('0x10')][this[_0x5978('0x4')]['id']],_0xe2af54?'STOP':_0x5978('0x1f'));}if(!_0xe2af54){setTimeout(this['push'][_0x5978('0x7')](this),0x3e8);}};function agent(_0x32ff28,_0xf33cae,_0x4f0656,_0x329ae9){return new Agent(_0x32ff28,_0xf33cae,_0x4f0656,_0x329ae9);}module['exports']=agent;
\ No newline at end of file
+var _0x94b7=['RINGING','info','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','hideNotification','STOP','exports','uuid','../../../../../config/logger','routing','notificationId','squeue','agent','realtime','push','handleRun','bind','timeout','handleTimeout','drained','handleDrained','prototype','[%s][AGENT]\x20try\x20with\x20%s','isNil','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','channel','busy','busyQueue','showNotification','writeLog'];(function(_0xbec948,_0x3ba630){var _0x182646=function(_0x29957a){while(--_0x29957a){_0xbec948['push'](_0xbec948['shift']());}};_0x182646(++_0x3ba630);}(_0x94b7,0x126));var _0x794b=function(_0x180bc0,_0x1cd2e1){_0x180bc0=_0x180bc0-0x0;var _0x2ec58e=_0x94b7[_0x180bc0];return _0x2ec58e;};'use strict';var _=require('lodash');var uuid=require(_0x794b('0x0'));var util=require('./util');var logger=require(_0x794b('0x1'))(_0x794b('0x2'));var Agent=function(_0x4da2ef,_0x274056,_0x34eff5,_0x18449f){this[_0x794b('0x3')]=uuid['v4']();this[_0x794b('0x4')]=_0x4da2ef;this[_0x794b('0x5')]=_0x274056;this[_0x794b('0x6')]=_0x34eff5;this[_0x794b('0x2')]=_0x18449f;this[_0x794b('0x4')][_0x794b('0x7')](this[_0x794b('0x8')][_0x794b('0x9')](this),this['handleTimeout']['bind'](this));this[_0x794b('0x4')]['on'](_0x794b('0xa'),this[_0x794b('0xb')][_0x794b('0x9')](this));this[_0x794b('0x4')]['on'](_0x794b('0xc'),this[_0x794b('0xd')][_0x794b('0x9')](this));};Agent['prototype'][_0x794b('0x7')]=function(){this[_0x794b('0x4')][_0x794b('0x7')](this['handleRun'][_0x794b('0x9')](this),this[_0x794b('0xb')][_0x794b('0x9')](this));};Agent[_0x794b('0xe')][_0x794b('0xd')]=function(){this[_0x794b('0xb')](!![]);};Agent['prototype'][_0x794b('0x8')]=function(_0x3b28d1){logger['info'](_0x794b('0xf'),this[_0x794b('0x4')]['id'],this[_0x794b('0x5')]['id']);if(_[_0x794b('0x10')](this['realtime'][_0x794b('0x11')][this['agent']['id']])){logger['info'](_0x794b('0x12'),this[_0x794b('0x4')]['id'],this[_0x794b('0x5')]['id']);setTimeout(this[_0x794b('0x7')][_0x794b('0x9')](this),0x3e8);}else{if(this[_0x794b('0x2')][_0x794b('0x13')]||util[_0x794b('0x14')](this[_0x794b('0x4')]['id'],this[_0x794b('0x6')][_0x794b('0x11')][this['agent']['id']],this[_0x794b('0x4')][_0x794b('0x15')],![])){this['realtime']['agents'][this['agent']['id']][_0x794b('0x16')]=!![];this['realtime']['agents'][this[_0x794b('0x5')]['id']][_0x794b('0x17')]=undefined;util[_0x794b('0x18')](this[_0x794b('0x3')],this[_0x794b('0x4')]['id'],this[_0x794b('0x6')][_0x794b('0x11')][this['agent']['id']],null,this[_0x794b('0x2')]);util[_0x794b('0x19')](this[_0x794b('0x4')]['id'],this[_0x794b('0x6')]['agents'][this['agent']['id']],_0x794b('0x1a')+(this[_0x794b('0x2')][_0x794b('0x13')]?':FORCED':''));}else{logger[_0x794b('0x1b')](_0x794b('0x1c'),this[_0x794b('0x4')]['id'],this[_0x794b('0x5')]['id']);setTimeout(this[_0x794b('0x7')]['bind'](this),0x3e8);}}};Agent[_0x794b('0xe')][_0x794b('0xb')]=function(_0x47154d){if(_['isNil'](this[_0x794b('0x6')][_0x794b('0x11')][this[_0x794b('0x5')]['id']])){return logger[_0x794b('0x1b')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this['squeue']['id'],this[_0x794b('0x5')]['id']);}else{logger[_0x794b('0x1b')]('[%s][AGENT]\x20timeout\x20with\x20%s',this[_0x794b('0x4')]['id'],this[_0x794b('0x5')]['id']);util[_0x794b('0x1d')](this['notificationId'],this['squeue']['id'],this['realtime'][_0x794b('0x11')][this[_0x794b('0x5')]['id']],null,this[_0x794b('0x2')]);this[_0x794b('0x6')][_0x794b('0x11')][this[_0x794b('0x5')]['id']][_0x794b('0x16')]=![];this[_0x794b('0x6')][_0x794b('0x11')][this[_0x794b('0x5')]['id']][_0x794b('0x17')]=undefined;util[_0x794b('0x19')](this['squeue']['id'],this[_0x794b('0x6')]['agents'][this['agent']['id']],_0x47154d?_0x794b('0x1e'):'TIMEOUT');}if(!_0x47154d){setTimeout(this['push'][_0x794b('0x9')](this),0x3e8);}};function agent(_0x304b1a,_0x2ee28a,_0x2b54d8,_0x2b957a){return new Agent(_0x304b1a,_0x2ee28a,_0x2b54d8,_0x2b957a);}module[_0x794b('0x1f')]=agent;
\ No newline at end of file
index a3f0066..c5844bf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xed5f=['[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','channel','RINGING','busy','name','showNotification','info','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','[%s][QUEUE]\x20EMPTY','hideNotification','notificationId','routing','writeLog','STOP','TIMEOUT','busyQueue','exports','uuid','./util','../../../../../config/logger','squeue','queue','realtime','push','bind','handleTimeout','timeout','drained','handleDrained','prototype','handleRun','isNil','Agents','length','agents'];(function(_0x33d260,_0x110004){var _0xddb342=function(_0x13e8ec){while(--_0x13e8ec){_0x33d260['push'](_0x33d260['shift']());}};_0xddb342(++_0x110004);}(_0xed5f,0x1e6));var _0xfed5=function(_0x494ef5,_0x34c8e6){_0x494ef5=_0x494ef5-0x0;var _0x28136c=_0xed5f[_0x494ef5];return _0x28136c;};'use strict';var _=require('lodash');var uuid=require(_0xfed5('0x0'));var util=require(_0xfed5('0x1'));var logger=require(_0xfed5('0x2'))('routing');var Beepall=function(_0x1b17f4,_0x2ebed0,_0x387c6e,_0x1e5aae){this['notificationId']=uuid['v4']();this[_0xfed5('0x3')]=_0x1b17f4;this[_0xfed5('0x4')]=_0x2ebed0;this[_0xfed5('0x5')]=_0x387c6e;this['routing']=_0x1e5aae;this[_0xfed5('0x3')][_0xfed5('0x6')](this['handleRun'][_0xfed5('0x7')](this),this[_0xfed5('0x8')][_0xfed5('0x7')](this));this[_0xfed5('0x3')]['on'](_0xfed5('0x9'),this[_0xfed5('0x8')][_0xfed5('0x7')](this));this[_0xfed5('0x3')]['on'](_0xfed5('0xa'),this[_0xfed5('0xb')][_0xfed5('0x7')](this));};Beepall[_0xfed5('0xc')]['push']=function(){this[_0xfed5('0x3')][_0xfed5('0x6')](this[_0xfed5('0xd')][_0xfed5('0x7')](this),this['handleTimeout'][_0xfed5('0x7')](this));};Beepall[_0xfed5('0xc')]['handleDrained']=function(_0x2bb618){this[_0xfed5('0x8')](!![]);};Beepall[_0xfed5('0xc')][_0xfed5('0xd')]=function(_0x3eda9e){var _0x5e90e7=!![];if(!_[_0xfed5('0xe')](this['queue'])&&!_[_0xfed5('0xe')](this['queue'][_0xfed5('0xf')])&&this[_0xfed5('0x4')][_0xfed5('0xf')][_0xfed5('0x10')]>0x0){for(var _0x3a0656=0x0,_0x1264cb;_0x3a0656<this[_0xfed5('0x4')][_0xfed5('0xf')][_0xfed5('0x10')];_0x3a0656+=0x1){_0x1264cb=this[_0xfed5('0x4')][_0xfed5('0xf')][_0x3a0656]['id'];if(_[_0xfed5('0xe')](this[_0xfed5('0x5')][_0xfed5('0x11')][_0x1264cb])){logger['info'](_0xfed5('0x12'),this['squeue']['id'],_0x1264cb);}else{if(util[_0xfed5('0x13')](this[_0xfed5('0x3')]['id'],this[_0xfed5('0x5')][_0xfed5('0x11')][_0x1264cb],this[_0xfed5('0x3')][_0xfed5('0x14')],!![])){_0x5e90e7=![];util['writeLog'](this[_0xfed5('0x3')]['id'],this['realtime']['agents'][_0x1264cb],_0xfed5('0x15'));this['realtime']['agents'][_0x1264cb][_0xfed5('0x16')]=!![];this[_0xfed5('0x5')][_0xfed5('0x11')][_0x1264cb]['busyQueue']=this[_0xfed5('0x4')][_0xfed5('0x17')];util[_0xfed5('0x18')](this['notificationId'],this[_0xfed5('0x3')]['id'],this[_0xfed5('0x5')]['agents'][_0x1264cb],this[_0xfed5('0x4')],this['routing']);}}}if(_0x5e90e7){logger[_0xfed5('0x19')](_0xfed5('0x1a'),this[_0xfed5('0x3')]['id']);setTimeout(this[_0xfed5('0x6')]['bind'](this),0x3e8);}}else{logger[_0xfed5('0x19')](_0xfed5('0x1b'),this['squeue']['id']);setTimeout(this[_0xfed5('0x6')][_0xfed5('0x7')](this),0x3e8);}};Beepall[_0xfed5('0xc')][_0xfed5('0x8')]=function(_0xeae39c){if(!_[_0xfed5('0xe')](this[_0xfed5('0x4')])&&!_[_0xfed5('0xe')](this['queue']['Agents'])){for(var _0x18e019=0x0,_0x3b4844;_0x18e019<this['queue'][_0xfed5('0xf')][_0xfed5('0x10')];_0x18e019+=0x1){_0x3b4844=this[_0xfed5('0x4')][_0xfed5('0xf')][_0x18e019]['id'];if(_['isNil'](this[_0xfed5('0x5')][_0xfed5('0x11')][_0x3b4844])){logger['info'](_0xfed5('0x12'),this['squeue']['id'],_0x3b4844);}else{util[_0xfed5('0x1c')](this[_0xfed5('0x1d')],this[_0xfed5('0x3')]['id'],this[_0xfed5('0x5')][_0xfed5('0x11')][_0x3b4844],this[_0xfed5('0x4')],this[_0xfed5('0x1e')]);util[_0xfed5('0x1f')](this[_0xfed5('0x3')]['id'],this[_0xfed5('0x5')]['agents'][_0x3b4844],_0xeae39c?_0xfed5('0x20'):_0xfed5('0x21'));this[_0xfed5('0x5')][_0xfed5('0x11')][_0x3b4844]['busy']=![];this[_0xfed5('0x5')][_0xfed5('0x11')][_0x3b4844][_0xfed5('0x22')]=undefined;}}}if(!_0xeae39c){setTimeout(this[_0xfed5('0x6')][_0xfed5('0x7')](this),0x3e8);}};function beepall(_0xd5b418,_0x1f870d,_0x3a9418,_0xd8b9f0){return new Beepall(_0xd5b418,_0x1f870d,_0x3a9418,_0xd8b9f0);}module[_0xfed5('0x23')]=beepall;
\ No newline at end of file
+var _0x8958=['bind','timeout','drained','handleDrained','prototype','isNil','queue','Agents','length','agents','isAgentAvailable','channel','writeLog','RINGING','busy','busyQueue','name','showNotification','info','[%s][QUEUE]\x20EMPTY','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','STOP','TIMEOUT','uuid','notificationId','squeue','realtime','routing','push','handleRun','handleTimeout'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8958,0x93));var _0x8895=function(_0x8031f3,_0x356086){_0x8031f3=_0x8031f3-0x0;var _0x39a15a=_0x8958[_0x8031f3];return _0x39a15a;};'use strict';var _=require('lodash');var uuid=require(_0x8895('0x0'));var util=require('./util');var logger=require('../../../../../config/logger')('routing');var Beepall=function(_0x4cea64,_0x418b66,_0x56e738,_0x38d5d7){this[_0x8895('0x1')]=uuid['v4']();this[_0x8895('0x2')]=_0x4cea64;this['queue']=_0x418b66;this[_0x8895('0x3')]=_0x56e738;this[_0x8895('0x4')]=_0x38d5d7;this[_0x8895('0x2')][_0x8895('0x5')](this[_0x8895('0x6')]['bind'](this),this[_0x8895('0x7')][_0x8895('0x8')](this));this[_0x8895('0x2')]['on'](_0x8895('0x9'),this[_0x8895('0x7')][_0x8895('0x8')](this));this[_0x8895('0x2')]['on'](_0x8895('0xa'),this[_0x8895('0xb')][_0x8895('0x8')](this));};Beepall['prototype'][_0x8895('0x5')]=function(){this[_0x8895('0x2')][_0x8895('0x5')](this[_0x8895('0x6')][_0x8895('0x8')](this),this[_0x8895('0x7')]['bind'](this));};Beepall[_0x8895('0xc')][_0x8895('0xb')]=function(_0x56c18e){this['handleTimeout'](!![]);};Beepall['prototype'][_0x8895('0x6')]=function(_0x4e8f53){var _0x4156f5=!![];if(!_[_0x8895('0xd')](this[_0x8895('0xe')])&&!_[_0x8895('0xd')](this[_0x8895('0xe')]['Agents'])&&this[_0x8895('0xe')][_0x8895('0xf')][_0x8895('0x10')]>0x0){for(var _0xcdd661=0x0,_0x2848b7;_0xcdd661<this[_0x8895('0xe')][_0x8895('0xf')][_0x8895('0x10')];_0xcdd661+=0x1){_0x2848b7=this[_0x8895('0xe')][_0x8895('0xf')][_0xcdd661]['id'];if(_[_0x8895('0xd')](this[_0x8895('0x3')][_0x8895('0x11')][_0x2848b7])){logger['info']('[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this['squeue']['id'],_0x2848b7);}else{if(util[_0x8895('0x12')](this[_0x8895('0x2')]['id'],this[_0x8895('0x3')][_0x8895('0x11')][_0x2848b7],this[_0x8895('0x2')][_0x8895('0x13')],!![])){_0x4156f5=![];util[_0x8895('0x14')](this[_0x8895('0x2')]['id'],this['realtime'][_0x8895('0x11')][_0x2848b7],_0x8895('0x15'));this[_0x8895('0x3')][_0x8895('0x11')][_0x2848b7][_0x8895('0x16')]=!![];this['realtime']['agents'][_0x2848b7][_0x8895('0x17')]=this[_0x8895('0xe')][_0x8895('0x18')];util[_0x8895('0x19')](this['notificationId'],this[_0x8895('0x2')]['id'],this[_0x8895('0x3')][_0x8895('0x11')][_0x2848b7],this['queue'],this['routing']);}}}if(_0x4156f5){logger[_0x8895('0x1a')]('[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY',this[_0x8895('0x2')]['id']);setTimeout(this[_0x8895('0x5')][_0x8895('0x8')](this),0x3e8);}}else{logger[_0x8895('0x1a')](_0x8895('0x1b'),this['squeue']['id']);setTimeout(this['push'][_0x8895('0x8')](this),0x3e8);}};Beepall[_0x8895('0xc')][_0x8895('0x7')]=function(_0x16b65b){if(!_[_0x8895('0xd')](this['queue'])&&!_['isNil'](this[_0x8895('0xe')][_0x8895('0xf')])){for(var _0x1c16f6=0x0,_0x29f565;_0x1c16f6<this[_0x8895('0xe')]['Agents'][_0x8895('0x10')];_0x1c16f6+=0x1){_0x29f565=this['queue'][_0x8895('0xf')][_0x1c16f6]['id'];if(_['isNil'](this[_0x8895('0x3')][_0x8895('0x11')][_0x29f565])){logger[_0x8895('0x1a')](_0x8895('0x1c'),this[_0x8895('0x2')]['id'],_0x29f565);}else{util['hideNotification'](this[_0x8895('0x1')],this[_0x8895('0x2')]['id'],this[_0x8895('0x3')][_0x8895('0x11')][_0x29f565],this[_0x8895('0xe')],this['routing']);util[_0x8895('0x14')](this['squeue']['id'],this[_0x8895('0x3')]['agents'][_0x29f565],_0x16b65b?_0x8895('0x1d'):_0x8895('0x1e'));this[_0x8895('0x3')][_0x8895('0x11')][_0x29f565][_0x8895('0x16')]=![];this['realtime'][_0x8895('0x11')][_0x29f565]['busyQueue']=undefined;}}}if(!_0x16b65b){setTimeout(this[_0x8895('0x5')][_0x8895('0x8')](this),0x3e8);}};function beepall(_0x36e13b,_0x9297ea,_0x25fa39,_0x16e110){return new Beepall(_0x36e13b,_0x9297ea,_0x25fa39,_0x16e110);}module['exports']=beepall;
\ No newline at end of file
index eb55693..e0dc742 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd3e8=['./beepall','./agent','exports'];(function(_0x56ddc8,_0xcc52f3){var _0x1c29d5=function(_0x51e287){while(--_0x51e287){_0x56ddc8['push'](_0x56ddc8['shift']());}};_0x1c29d5(++_0xcc52f3);}(_0xd3e8,0x9e));var _0x8d3e=function(_0x1b3e90,_0xe94b8c){_0x1b3e90=_0x1b3e90-0x0;var _0x40e06d=_0xd3e8[_0x1b3e90];return _0x40e06d;};'use strict';module[_0x8d3e('0x0')]={'rrmemory':require('./rrmemory'),'beepall':require(_0x8d3e('0x1')),'agent':require(_0x8d3e('0x2'))};
\ No newline at end of file
+var _0x9f2e=['exports','./rrmemory'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9f2e,0xa0));var _0xe9f2=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0x9f2e[_0x1969a7];return _0x3d665f;};'use strict';module[_0xe9f2('0x0')]={'rrmemory':require(_0xe9f2('0x1')),'beepall':require('./beepall'),'agent':require('./agent')};
\ No newline at end of file
index e486420..b34e174 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa3b1=['realtime','intervals','push','handleRun','bind','handleTimeout','timeout','handleDrained','prototype','handleCheckReject','isAgentAvailable','agents','agentId','channel','info','[%s][QUEUE]\x20available\x20again\x20%s','done','queue','mapAgentsId','[%s][QUEUE]\x20try\x20with\x20%s','isNil','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','name','showNotification','[%s][QUEUE]\x20agent\x20skipped,\x20not\x20available\x20id\x20%s','hideNotification','writeLog','TIMEOUT','busy','exports','lodash','uuid','./util','../../../../../config/logger','routing','notificationId','squeue'];(function(_0x103b9c,_0x26594a){var _0x56e37e=function(_0x52f981){while(--_0x52f981){_0x103b9c['push'](_0x103b9c['shift']());}};_0x56e37e(++_0x26594a);}(_0xa3b1,0xb2));var _0x1a3b=function(_0x3dfe4b,_0x2bcfa9){_0x3dfe4b=_0x3dfe4b-0x0;var _0x579aff=_0xa3b1[_0x3dfe4b];return _0x579aff;};'use strict';var rr=require('rr');var _=require(_0x1a3b('0x0'));var uuid=require(_0x1a3b('0x1'));var util=require(_0x1a3b('0x2'));var logger=require(_0x1a3b('0x3'))(_0x1a3b('0x4'));var RRMemory=function(_0x26d1e6,_0x829032,_0x148c99,_0x31d033){this[_0x1a3b('0x5')]=uuid['v4']();this[_0x1a3b('0x6')]=_0x26d1e6;this['queue']=_0x829032;this[_0x1a3b('0x7')]=_0x148c99;this[_0x1a3b('0x4')]=_0x31d033;this[_0x1a3b('0x8')]={};this[_0x1a3b('0x6')][_0x1a3b('0x9')](this[_0x1a3b('0xa')][_0x1a3b('0xb')](this),this[_0x1a3b('0xc')][_0x1a3b('0xb')](this),this['module']);this[_0x1a3b('0x6')]['on'](_0x1a3b('0xd'),this['handleTimeout'][_0x1a3b('0xb')](this));this[_0x1a3b('0x6')]['on']('drained',this[_0x1a3b('0xe')][_0x1a3b('0xb')](this));};RRMemory[_0x1a3b('0xf')][_0x1a3b('0x9')]=function(){this[_0x1a3b('0x6')]['push'](this[_0x1a3b('0xa')][_0x1a3b('0xb')](this),this[_0x1a3b('0xc')][_0x1a3b('0xb')](this));};RRMemory[_0x1a3b('0xf')][_0x1a3b('0xe')]=function(_0x9a6d9a){this[_0x1a3b('0xc')](!![]);};RRMemory['prototype'][_0x1a3b('0x10')]=function(_0x4c9aef){if(util[_0x1a3b('0x11')](this['squeue']['id'],this[_0x1a3b('0x7')][_0x1a3b('0x12')][this[_0x1a3b('0x13')]],this[_0x1a3b('0x6')][_0x1a3b('0x14')],!![])){logger[_0x1a3b('0x15')](_0x1a3b('0x16'),this['squeue']['id'],this[_0x1a3b('0x13')]);clearInterval(this[_0x1a3b('0x8')][this[_0x1a3b('0x13')]]);_0x4c9aef[_0x1a3b('0x17')]();setTimeout(this[_0x1a3b('0x9')]['bind'](this),0x3e8);}};RRMemory['prototype'][_0x1a3b('0xa')]=function(_0x14e657){this[_0x1a3b('0x13')]=rr(this[_0x1a3b('0x18')][_0x1a3b('0x19')]);logger[_0x1a3b('0x15')](_0x1a3b('0x1a'),this[_0x1a3b('0x6')]['id'],this['agentId']);if(_[_0x1a3b('0x1b')](this[_0x1a3b('0x7')][_0x1a3b('0x12')][this[_0x1a3b('0x13')]])){logger[_0x1a3b('0x15')](_0x1a3b('0x1c'),this['squeue']['id'],this[_0x1a3b('0x13')]);_0x14e657['done']();setTimeout(this[_0x1a3b('0x9')][_0x1a3b('0xb')](this),0x3e8);}else{if(util[_0x1a3b('0x11')](this['squeue']['id'],this[_0x1a3b('0x7')][_0x1a3b('0x12')][this[_0x1a3b('0x13')]],this['squeue']['channel'],!![])){this[_0x1a3b('0x7')][_0x1a3b('0x12')][this[_0x1a3b('0x13')]]['busy']=!![];this[_0x1a3b('0x7')]['agents'][this[_0x1a3b('0x13')]]['busyQueue']=this[_0x1a3b('0x18')][_0x1a3b('0x1d')];util[_0x1a3b('0x1e')](this[_0x1a3b('0x5')],this[_0x1a3b('0x6')]['id'],this[_0x1a3b('0x7')][_0x1a3b('0x12')][this['agentId']],this[_0x1a3b('0x18')],this['routing']);util['writeLog'](this[_0x1a3b('0x6')]['id'],this['realtime'][_0x1a3b('0x12')][this[_0x1a3b('0x13')]],'RINGING');this['intervals'][this[_0x1a3b('0x13')]]=setInterval(this[_0x1a3b('0x10')]['bind'](this,_0x14e657),0x3e8);}else{logger[_0x1a3b('0x15')](_0x1a3b('0x1f'),this['squeue']['id'],this[_0x1a3b('0x13')]);_0x14e657[_0x1a3b('0x17')]();setTimeout(this[_0x1a3b('0x9')][_0x1a3b('0xb')](this),0x3e8);}}};RRMemory['prototype']['handleTimeout']=function(_0x1d7141){logger[_0x1a3b('0x15')]('[%s][QUEUE]\x20timeout\x20with\x20%s',this['squeue']['id'],this['agentId']);if(_[_0x1a3b('0x1b')](this['realtime'][_0x1a3b('0x12')][this[_0x1a3b('0x13')]])){logger[_0x1a3b('0x15')]('[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0x1a3b('0x6')]['id'],this[_0x1a3b('0x13')]);}else{clearInterval(this['intervals'][this[_0x1a3b('0x13')]]);util[_0x1a3b('0x20')](this['notificationId'],this[_0x1a3b('0x6')]['id'],this[_0x1a3b('0x7')][_0x1a3b('0x12')][this['agentId']],this[_0x1a3b('0x18')],this['routing']);util[_0x1a3b('0x21')](this['squeue']['id'],this[_0x1a3b('0x7')][_0x1a3b('0x12')][this['agentId']],_0x1a3b('0x22'));this[_0x1a3b('0x7')][_0x1a3b('0x12')][this['agentId']][_0x1a3b('0x23')]=![];this['realtime'][_0x1a3b('0x12')][this['agentId']]['busyQueue']=undefined;}if(!_0x1d7141){setTimeout(this[_0x1a3b('0x9')]['bind'](this),0x3e8);}};function rrmemory(_0x4c2b7d,_0xfd877f,_0x3b2693,_0x3a26c9){return new RRMemory(_0x4c2b7d,_0xfd877f,_0x3b2693,_0x3a26c9);}module[_0x1a3b('0x24')]=rrmemory;
\ No newline at end of file
+var _0x0853=['intervals','bind','handleTimeout','module','timeout','push','handleRun','prototype','handleCheckReject','isAgentAvailable','agents','info','[%s][QUEUE]\x20available\x20again\x20%s','agentId','done','mapAgentsId','[%s][QUEUE]\x20try\x20with\x20%s','isNil','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','realtime','channel','busy','busyQueue','name','routing','writeLog','RINGING','[%s][QUEUE]\x20agent\x20skipped,\x20not\x20available\x20id\x20%s','[%s][QUEUE]\x20timeout\x20with\x20%s','hideNotification','lodash','./util','../../../../../config/logger','notificationId','squeue','queue'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x0853,0x13e));var _0x3085=function(_0x58048c,_0x160ef6){_0x58048c=_0x58048c-0x0;var _0x48b254=_0x0853[_0x58048c];return _0x48b254;};'use strict';var rr=require('rr');var _=require(_0x3085('0x0'));var uuid=require('uuid');var util=require(_0x3085('0x1'));var logger=require(_0x3085('0x2'))('routing');var RRMemory=function(_0x349a4e,_0x394999,_0x308388,_0x5ada41){this[_0x3085('0x3')]=uuid['v4']();this[_0x3085('0x4')]=_0x349a4e;this[_0x3085('0x5')]=_0x394999;this['realtime']=_0x308388;this['routing']=_0x5ada41;this[_0x3085('0x6')]={};this[_0x3085('0x4')]['push'](this['handleRun'][_0x3085('0x7')](this),this[_0x3085('0x8')][_0x3085('0x7')](this),this[_0x3085('0x9')]);this[_0x3085('0x4')]['on'](_0x3085('0xa'),this[_0x3085('0x8')][_0x3085('0x7')](this));this[_0x3085('0x4')]['on']('drained',this['handleDrained'][_0x3085('0x7')](this));};RRMemory['prototype'][_0x3085('0xb')]=function(){this[_0x3085('0x4')][_0x3085('0xb')](this[_0x3085('0xc')]['bind'](this),this[_0x3085('0x8')]['bind'](this));};RRMemory[_0x3085('0xd')]['handleDrained']=function(_0x26a2a9){this[_0x3085('0x8')](!![]);};RRMemory[_0x3085('0xd')][_0x3085('0xe')]=function(_0x216fbf){if(util[_0x3085('0xf')](this[_0x3085('0x4')]['id'],this['realtime'][_0x3085('0x10')][this['agentId']],this[_0x3085('0x4')]['channel'],!![])){logger[_0x3085('0x11')](_0x3085('0x12'),this['squeue']['id'],this[_0x3085('0x13')]);clearInterval(this['intervals'][this[_0x3085('0x13')]]);_0x216fbf[_0x3085('0x14')]();setTimeout(this[_0x3085('0xb')][_0x3085('0x7')](this),0x3e8);}};RRMemory[_0x3085('0xd')][_0x3085('0xc')]=function(_0x3c7e32){this[_0x3085('0x13')]=rr(this['queue'][_0x3085('0x15')]);logger[_0x3085('0x11')](_0x3085('0x16'),this[_0x3085('0x4')]['id'],this['agentId']);if(_[_0x3085('0x17')](this['realtime'][_0x3085('0x10')][this[_0x3085('0x13')]])){logger[_0x3085('0x11')](_0x3085('0x18'),this[_0x3085('0x4')]['id'],this[_0x3085('0x13')]);_0x3c7e32['done']();setTimeout(this[_0x3085('0xb')][_0x3085('0x7')](this),0x3e8);}else{if(util[_0x3085('0xf')](this[_0x3085('0x4')]['id'],this[_0x3085('0x19')][_0x3085('0x10')][this[_0x3085('0x13')]],this[_0x3085('0x4')][_0x3085('0x1a')],!![])){this[_0x3085('0x19')][_0x3085('0x10')][this[_0x3085('0x13')]][_0x3085('0x1b')]=!![];this['realtime']['agents'][this[_0x3085('0x13')]][_0x3085('0x1c')]=this[_0x3085('0x5')][_0x3085('0x1d')];util['showNotification'](this[_0x3085('0x3')],this[_0x3085('0x4')]['id'],this[_0x3085('0x19')][_0x3085('0x10')][this['agentId']],this[_0x3085('0x5')],this[_0x3085('0x1e')]);util[_0x3085('0x1f')](this['squeue']['id'],this[_0x3085('0x19')][_0x3085('0x10')][this[_0x3085('0x13')]],_0x3085('0x20'));this[_0x3085('0x6')][this[_0x3085('0x13')]]=setInterval(this[_0x3085('0xe')]['bind'](this,_0x3c7e32),0x3e8);}else{logger[_0x3085('0x11')](_0x3085('0x21'),this[_0x3085('0x4')]['id'],this[_0x3085('0x13')]);_0x3c7e32[_0x3085('0x14')]();setTimeout(this['push'][_0x3085('0x7')](this),0x3e8);}}};RRMemory[_0x3085('0xd')][_0x3085('0x8')]=function(_0x6e295f){logger[_0x3085('0x11')](_0x3085('0x22'),this['squeue']['id'],this[_0x3085('0x13')]);if(_[_0x3085('0x17')](this[_0x3085('0x19')][_0x3085('0x10')][this['agentId']])){logger[_0x3085('0x11')](_0x3085('0x18'),this[_0x3085('0x4')]['id'],this[_0x3085('0x13')]);}else{clearInterval(this['intervals'][this['agentId']]);util[_0x3085('0x23')](this[_0x3085('0x3')],this['squeue']['id'],this[_0x3085('0x19')][_0x3085('0x10')][this[_0x3085('0x13')]],this[_0x3085('0x5')],this['routing']);util[_0x3085('0x1f')](this[_0x3085('0x4')]['id'],this[_0x3085('0x19')][_0x3085('0x10')][this[_0x3085('0x13')]],'TIMEOUT');this[_0x3085('0x19')][_0x3085('0x10')][this[_0x3085('0x13')]]['busy']=![];this[_0x3085('0x19')]['agents'][this[_0x3085('0x13')]][_0x3085('0x1c')]=undefined;}if(!_0x6e295f){setTimeout(this['push'][_0x3085('0x7')](this),0x3e8);}};function rrmemory(_0x1e9225,_0x53f8d8,_0x34b087,_0x19443b){return new RRMemory(_0x1e9225,_0x53f8d8,_0x34b087,_0x19443b);}module['exports']=rrmemory;
\ No newline at end of file
index 4bcde86..1d0162a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7c09=['[%s][QUEUE]\x20%s','message','user:%s','notification:%s','[%s][QUEUE][AGENT:%s][STATUS:%s]','isAgentAvailable','busy','BUSY','online','OFFLINE','PAUSE','hasOwnProperty','CurrentCapacity','Capacity','\x20MAXCAPACITY','showNotification','hideNotification','writeLog','util','../utils','ioredis','../../../../../config/environment','../../../../../config/logger','routing','redis','defaults','emit','name','user:save','split','\x20interaction','account','notificationSound','notificationShake','body','queue','msg','getMustacheRender','error','format'];(function(_0x508ea4,_0x3ec7d7){var _0x2d857d=function(_0x182355){while(--_0x182355){_0x508ea4['push'](_0x508ea4['shift']());}};_0x2d857d(++_0x3ec7d7);}(_0x7c09,0x102));var _0x97c0=function(_0x1c659d,_0x4f3ce6){_0x1c659d=_0x1c659d-0x0;var _0x36d171=_0x7c09[_0x1c659d];return _0x36d171;};'use strict';var _=require('lodash');var util=require(_0x97c0('0x0'));var utils=require(_0x97c0('0x1'));var Mustache=require('mustache');var Redis=require(_0x97c0('0x2'));var config=require(_0x97c0('0x3'));var logger=require(_0x97c0('0x4'))(_0x97c0('0x5'));config[_0x97c0('0x6')]=_[_0x97c0('0x7')](config[_0x97c0('0x6')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function emit(_0x46fdd9,_0x42c6c7,_0x2c19fa){io['to'](_0x46fdd9)[_0x97c0('0x8')](_0x42c6c7,_0x2c19fa);}function sendNotification(_0x293785,_0x57661a,_0x205520,_0x4ac5f1,_0x2d5507,_0x28cac4){io['to'](util['format']('user:%s',_0x4ac5f1[_0x97c0('0x9')]))[_0x97c0('0x8')](_0x97c0('0xa'),_0x4ac5f1);var _0x238ed9=_0x28cac4||{};var _0x346e34=_0x205520[_0x97c0('0xb')]('.');var _0x7fc93={'uniqueid':_0x57661a,'channel':_0x346e34[0x0],'id':_0x346e34[0x1],'title':_0x346e34[0x0]+_0x97c0('0xc'),'interactionId':_0x346e34[0x2],'queue':_0x2d5507?_0x2d5507[_0x97c0('0x9')]:null,'sound':_0x238ed9[_0x97c0('0xd')][_0x97c0('0xe')],'shake':_0x238ed9[_0x97c0('0xd')][_0x97c0('0xf')]};try{if(!_0x238ed9['body']){_0x238ed9[_0x97c0('0x10')]={};}if(_0x2d5507){_0x238ed9[_0x97c0('0x10')][_0x97c0('0x11')]=_0x2d5507;}else if(_0x238ed9['body'][_0x97c0('0x11')]){delete _0x238ed9[_0x97c0('0x10')][_0x97c0('0x11')];}_0x7fc93[_0x97c0('0x12')]=utils[_0x97c0('0x13')](_0x238ed9[_0x97c0('0xd')]['notificationTemplate'],_0x238ed9);}catch(_0x16fea6){_0x7fc93[_0x97c0('0x12')]='I\x20can\x27t\x20render\x20your\x20template';logger[_0x97c0('0x14')](util[_0x97c0('0x15')](_0x97c0('0x16'),_0x57661a,_0x16fea6[_0x97c0('0x17')]));}io['to'](util[_0x97c0('0x15')](_0x97c0('0x18'),_0x4ac5f1[_0x97c0('0x9')]))[_0x97c0('0x8')](util[_0x97c0('0x15')](_0x97c0('0x19'),_0x293785?'save':'remove'),_0x7fc93);}function writeLog(_0x2b74a2,_0xa3f59d,_0x169f19){return logger['info'](util[_0x97c0('0x15')](_0x97c0('0x1a'),_0x2b74a2,_0xa3f59d[_0x97c0('0x9')],_0x169f19));}exports[_0x97c0('0x1b')]=function(_0x30fba2,_0x3a0bfb,_0x9dff60,_0x5ac457){if(_0x3a0bfb[_0x97c0('0x1c')]){writeLog(_0x30fba2,_0x3a0bfb,_0x97c0('0x1d'));return![];}if(!_0x3a0bfb[_0x97c0('0x1e')]){writeLog(_0x30fba2,_0x3a0bfb,_0x97c0('0x1f'));return![];}if(_0x3a0bfb[_0x9dff60+'Pause']){writeLog(_0x30fba2,_0x3a0bfb,_0x97c0('0x20'));return![];}if(_0x5ac457&&_0x3a0bfb[_0x97c0('0x21')](_0x9dff60+'Capacity')&&_0x3a0bfb[_0x97c0('0x21')](_0x9dff60+_0x97c0('0x22'))){if(_0x3a0bfb[_0x9dff60+_0x97c0('0x23')]>0x0&&_0x3a0bfb[_0x9dff60+'CurrentCapacity']>=_0x3a0bfb[_0x9dff60+'Capacity']){writeLog(_0x30fba2,_0x3a0bfb,_0x9dff60['toUpperCase']()+_0x97c0('0x24'));return![];}}return!![];};exports[_0x97c0('0x25')]=function(_0x3a744c,_0x225e43,_0x26939e,_0x153b14,_0x4a3645){return sendNotification(!![],_0x3a744c,_0x225e43,_0x26939e,_0x153b14,_0x4a3645);};exports[_0x97c0('0x26')]=function(_0x1c183f,_0x325090,_0x4ad645,_0x14617c,_0x148e95){return sendNotification(![],_0x1c183f,_0x325090,_0x4ad645,_0x14617c,_0x148e95);};exports[_0x97c0('0x27')]=writeLog;
\ No newline at end of file
+var _0x11e5=['\x20interaction','account','notificationSound','body','queue','msg','getMustacheRender','notificationTemplate','error','[%s][QUEUE]\x20%s','notification:%s','save','remove','[%s][QUEUE][AGENT:%s][STATUS:%s]','isAgentAvailable','busy','BUSY','Pause','hasOwnProperty','CurrentCapacity','Capacity','toUpperCase','\x20MAXCAPACITY','showNotification','hideNotification','lodash','../utils','mustache','../../../../../config/environment','../../../../../config/logger','routing','defaults','socket.io-emitter','redis','emit','format','user:%s','name'];(function(_0x4b8041,_0xab5ba){var _0x4dd335=function(_0xaf6bc5){while(--_0xaf6bc5){_0x4b8041['push'](_0x4b8041['shift']());}};_0x4dd335(++_0xab5ba);}(_0x11e5,0x8b));var _0x511e=function(_0x34951f,_0x277327){_0x34951f=_0x34951f-0x0;var _0x487db1=_0x11e5[_0x34951f];return _0x487db1;};'use strict';var _=require(_0x511e('0x0'));var util=require('util');var utils=require(_0x511e('0x1'));var Mustache=require(_0x511e('0x2'));var Redis=require('ioredis');var config=require(_0x511e('0x3'));var logger=require(_0x511e('0x4'))(_0x511e('0x5'));config['redis']=_[_0x511e('0x6')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x511e('0x7'))(new Redis(config[_0x511e('0x8')]));function emit(_0x466dec,_0x57cac3,_0x47cf56){io['to'](_0x466dec)[_0x511e('0x9')](_0x57cac3,_0x47cf56);}function sendNotification(_0xf0ba86,_0x25deeb,_0x306694,_0x4449c4,_0x30269e,_0x1596b3){io['to'](util[_0x511e('0xa')](_0x511e('0xb'),_0x4449c4[_0x511e('0xc')]))[_0x511e('0x9')]('user:save',_0x4449c4);var _0x7e50db=_0x1596b3||{};var _0x5dd510=_0x306694['split']('.');var _0x3deecc={'uniqueid':_0x25deeb,'channel':_0x5dd510[0x0],'id':_0x5dd510[0x1],'title':_0x5dd510[0x0]+_0x511e('0xd'),'interactionId':_0x5dd510[0x2],'queue':_0x30269e?_0x30269e[_0x511e('0xc')]:null,'sound':_0x7e50db[_0x511e('0xe')][_0x511e('0xf')],'shake':_0x7e50db[_0x511e('0xe')]['notificationShake']};try{if(!_0x7e50db[_0x511e('0x10')]){_0x7e50db[_0x511e('0x10')]={};}if(_0x30269e){_0x7e50db['body'][_0x511e('0x11')]=_0x30269e;}else if(_0x7e50db[_0x511e('0x10')]['queue']){delete _0x7e50db[_0x511e('0x10')][_0x511e('0x11')];}_0x3deecc[_0x511e('0x12')]=utils[_0x511e('0x13')](_0x7e50db['account'][_0x511e('0x14')],_0x7e50db);}catch(_0x2dd346){_0x3deecc[_0x511e('0x12')]='I\x20can\x27t\x20render\x20your\x20template';logger[_0x511e('0x15')](util['format'](_0x511e('0x16'),_0x25deeb,_0x2dd346['message']));}io['to'](util['format'](_0x511e('0xb'),_0x4449c4['name']))[_0x511e('0x9')](util[_0x511e('0xa')](_0x511e('0x17'),_0xf0ba86?_0x511e('0x18'):_0x511e('0x19')),_0x3deecc);}function writeLog(_0x3d3f46,_0x3723ff,_0x452f20){return logger['info'](util[_0x511e('0xa')](_0x511e('0x1a'),_0x3d3f46,_0x3723ff[_0x511e('0xc')],_0x452f20));}exports[_0x511e('0x1b')]=function(_0xaea29d,_0x18807b,_0x886b6,_0x2f28fc){if(_0x18807b[_0x511e('0x1c')]){writeLog(_0xaea29d,_0x18807b,_0x511e('0x1d'));return![];}if(!_0x18807b['online']){writeLog(_0xaea29d,_0x18807b,'OFFLINE');return![];}if(_0x18807b[_0x886b6+_0x511e('0x1e')]){writeLog(_0xaea29d,_0x18807b,'PAUSE');return![];}if(_0x2f28fc&&_0x18807b[_0x511e('0x1f')](_0x886b6+'Capacity')&&_0x18807b[_0x511e('0x1f')](_0x886b6+_0x511e('0x20'))){if(_0x18807b[_0x886b6+_0x511e('0x21')]>0x0&&_0x18807b[_0x886b6+_0x511e('0x20')]>=_0x18807b[_0x886b6+_0x511e('0x21')]){writeLog(_0xaea29d,_0x18807b,_0x886b6[_0x511e('0x22')]()+_0x511e('0x23'));return![];}}return!![];};exports[_0x511e('0x24')]=function(_0x309695,_0x2451c2,_0x5b72fe,_0x2930b2,_0x1d754d){return sendNotification(!![],_0x309695,_0x2451c2,_0x5b72fe,_0x2930b2,_0x1d754d);};exports[_0x511e('0x25')]=function(_0x1aaac1,_0x369be6,_0x50305a,_0x431b75,_0x4e157f){return sendNotification(![],_0x1aaac1,_0x369be6,_0x50305a,_0x431b75,_0x4e157f);};exports['writeLog']=writeLog;
\ No newline at end of file
index ae4a8a1..e61c76f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a37=['exec','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','isObject','validate','shelljs','lodash','./utils','../../../../config/logger','string','length','error','[%s][SYSTEM]\x20%s','map','message','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s'];(function(_0x19aead,_0x2d7f49){var _0x57d122=function(_0x34da41){while(--_0x34da41){_0x19aead['push'](_0x19aead['shift']());}};_0x57d122(++_0x2d7f49);}(_0x7a37,0xdf));var _0x77a3=function(_0x4896cd,_0x5d5055){_0x4896cd=_0x4896cd-0x0;var _0x339b5c=_0x7a37[_0x4896cd];return _0x339b5c;};'use strict';var schema=require(_0x77a3('0x0'));var sh=require(_0x77a3('0x1'));var _=require(_0x77a3('0x2'));var utils=require(_0x77a3('0x3'));var logger=require(_0x77a3('0x4'))('routing');var system=schema({'command':{'type':_0x77a3('0x5'),'required':!![],'message':'command\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports['consequence']=function(_0x4028ad,_0x3d74f3){return function(_0x208a03){try{var _0x33b1e2={'command':_0x3d74f3[0x0]};var _0x48a5ae=system[_0x77a3('0x0')](_0x33b1e2,{'typecast':!![]});if(_0x48a5ae[_0x77a3('0x6')]){logger[_0x77a3('0x7')](_0x77a3('0x8'),_0x4028ad,_[_0x77a3('0x9')](_0x48a5ae,_0x77a3('0xa'))[_0x77a3('0xb')](',\x20'));logger[_0x77a3('0xc')](_0x77a3('0xd'),_0x4028ad);_0x208a03[_0x77a3('0xe')]();}else{var _0x2b6890=this;var _0x28797e=utils[_0x77a3('0xf')](_0x3d74f3[0x0],this);logger[_0x77a3('0xc')](_0x77a3('0x10'),_0x4028ad,_0x28797e);sh[_0x77a3('0x11')](_['trim'](_0x28797e),function(_0x5535dd,_0x5f2c68){logger[_0x77a3('0xc')](_0x77a3('0x12'),_0x4028ad,_0x5535dd);if(_0x5535dd==0x0){var _0x58f171=_0x5f2c68[_0x77a3('0x13')](/(\r\n|\n|\r)/gm,'');if(_['isNil'](_0x3d74f3[0x1])||_[_0x77a3('0x14')](_0x3d74f3[0x1])){logger[_0x77a3('0xc')](_0x77a3('0x15'),_0x4028ad);_0x2b6890[_0x77a3('0x16')][_0x3d74f3[0x1]]=_0x58f171;}else{logger['info']('[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s',_0x4028ad,_0x3d74f3[0x1],_0x58f171);_0x2b6890[_0x77a3('0x16')][_0x3d74f3[0x1]]=_0x58f171;}}_0x208a03[_0x77a3('0xe')]();});}}catch(_0x1e3092){logger[_0x77a3('0x7')]('[%s][SYSTEM]\x20%s',_0x4028ad,_[_0x77a3('0x17')](_0x1e3092)?JSON['stringify'](_0x1e3092):_0x1e3092);logger[_0x77a3('0xc')](_0x77a3('0xd'),_0x4028ad);_0x208a03[_0x77a3('0xe')]();}};};
\ No newline at end of file
+var _0x4f82=['body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','isObject','stringify','validate','shelljs','./utils','routing','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','length','error','[%s][SYSTEM]\x20%s','map','message','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','trim','replace','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable'];(function(_0x213b0b,_0x5d6410){var _0x5cee71=function(_0x1d477){while(--_0x1d477){_0x213b0b['push'](_0x213b0b['shift']());}};_0x5cee71(++_0x5d6410);}(_0x4f82,0xbc));var _0x24f8=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x4f82[_0x2d7f0e];return _0x110b07;};'use strict';var schema=require(_0x24f8('0x0'));var sh=require(_0x24f8('0x1'));var _=require('lodash');var utils=require(_0x24f8('0x2'));var logger=require('../../../../config/logger')(_0x24f8('0x3'));var system=schema({'command':{'type':'string','required':!![],'message':_0x24f8('0x4')}});exports['consequence']=function(_0x39b5e0,_0x4093e2){return function(_0x708002){try{var _0x3fc5d4={'command':_0x4093e2[0x0]};var _0x53e9fb=system[_0x24f8('0x0')](_0x3fc5d4,{'typecast':!![]});if(_0x53e9fb[_0x24f8('0x5')]){logger[_0x24f8('0x6')](_0x24f8('0x7'),_0x39b5e0,_[_0x24f8('0x8')](_0x53e9fb,_0x24f8('0x9'))['join'](',\x20'));logger[_0x24f8('0xa')](_0x24f8('0xb'),_0x39b5e0);_0x708002[_0x24f8('0xc')]();}else{var _0x302c5a=this;var _0x4eba51=utils[_0x24f8('0xd')](_0x4093e2[0x0],this);logger['info']('[%s][SYSTEM]\x20commnad:\x20%s',_0x39b5e0,_0x4eba51);sh['exec'](_[_0x24f8('0xe')](_0x4eba51),function(_0x4cf97a,_0x290b2e){logger['info']('[%s][SYSTEM]\x20result\x20code:\x20%s',_0x39b5e0,_0x4cf97a);if(_0x4cf97a==0x0){var _0x1f73ec=_0x290b2e[_0x24f8('0xf')](/(\r\n|\n|\r)/gm,'');if(_[_0x24f8('0x10')](_0x4093e2[0x1])||_[_0x24f8('0x11')](_0x4093e2[0x1])){logger[_0x24f8('0xa')](_0x24f8('0x12'),_0x39b5e0);_0x302c5a[_0x24f8('0x13')][_0x4093e2[0x1]]=_0x1f73ec;}else{logger[_0x24f8('0xa')](_0x24f8('0x14'),_0x39b5e0,_0x4093e2[0x1],_0x1f73ec);_0x302c5a[_0x24f8('0x13')][_0x4093e2[0x1]]=_0x1f73ec;}}_0x708002[_0x24f8('0xc')]();});}}catch(_0x57d554){logger[_0x24f8('0x6')](_0x24f8('0x7'),_0x39b5e0,_[_0x24f8('0x15')](_0x57d554)?JSON[_0x24f8('0x16')](_0x57d554):_0x57d554);logger[_0x24f8('0xa')](_0x24f8('0xb'),_0x39b5e0);_0x708002[_0x24f8('0xc')]();}};};
\ No newline at end of file
index afe5045..9b5e18f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe492=['Interaction','addTags','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','interaction','catch','isObject','stringify','validate','lodash','../../rpc/mailInteraction','../../rpc/whatsappInteraction','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','error','[%s][TAG]\x20%s','message','join','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel'];(function(_0x35885a,_0x42fed7){var _0xe86249=function(_0x98edb3){while(--_0x98edb3){_0x35885a['push'](_0x35885a['shift']());}};_0xe86249(++_0x42fed7);}(_0xe492,0xa1));var _0x2e49=function(_0x3747c3,_0x4e17bd){_0x3747c3=_0x3747c3-0x0;var _0x879b56=_0xe492[_0x3747c3];return _0x879b56;};'use strict';var schema=require(_0x2e49('0x0'));var _=require(_0x2e49('0x1'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0x2e49('0x2')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0x2e49('0x3'))};var logger=require('../../../../config/logger')(_0x2e49('0x4'));var tag=schema({'tag':{'type':_0x2e49('0x5'),'required':!![],'message':_0x2e49('0x6')}});exports['consequence']=function(_0x1e3151,_0x804e9b,_0xd2f8c8,_0x271dc0){return function(_0x479e86){try{var _0x274d1b={'tag':_0x804e9b[0x0]};var _0x4e0c49=tag[_0x2e49('0x0')](_0x274d1b,{'typecast':!![]});if(_0x4e0c49['length']){logger[_0x2e49('0x7')](_0x2e49('0x8'),_0x1e3151,_['map'](_0x4e0c49,_0x2e49('0x9'))[_0x2e49('0xa')](',\x20'));logger[_0x2e49('0xb')](_0x2e49('0xc'),_0x1e3151);_0x479e86[_0x2e49('0xd')]();}else{var _0x3ba55a={'ids':[_0x804e9b[0x0]]};if(rpc[_0x271dc0[_0x2e49('0xe')]+_0x2e49('0xf')]){rpc[_0x271dc0[_0x2e49('0xe')]+_0x2e49('0xf')][_0x2e49('0x10')](_0x271dc0['interaction']['id'],_0x3ba55a)['then'](function(_0xd2b5a1){logger[_0x2e49('0xb')](_0x2e49('0x11'),_0x1e3151,_0x804e9b[0x1],_0x271dc0[_0x2e49('0xe')],_0x271dc0[_0x2e49('0x12')]['id']);})[_0x2e49('0x13')](function(_0x2eb07a){logger['error'](_0x2e49('0x8'),_0x1e3151,JSON['stringify'](_0x2eb07a));logger[_0x2e49('0xb')](_0x2e49('0xc'),_0x1e3151);})['finally'](function(){_0x479e86[_0x2e49('0xd')]();});}}}catch(_0x3b7082){logger['error'](_0x2e49('0x8'),_0x1e3151,_[_0x2e49('0x14')](_0x3b7082)?JSON[_0x2e49('0x15')](_0x3b7082):_0x3b7082);logger[_0x2e49('0xb')](_0x2e49('0xc'),_0x1e3151);_0x479e86['next']();}};};
\ No newline at end of file
+var _0x19bd=['../../../../config/logger','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','error','[%s][TAG]\x20%s','map','message','join','info','next','channel','Interaction','addTags','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','interaction','catch','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','finally','isObject','stringify','validate','lodash','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction'];(function(_0x7b25ff,_0x4d69f1){var _0x1bf5a0=function(_0x5023cb){while(--_0x5023cb){_0x7b25ff['push'](_0x7b25ff['shift']());}};_0x1bf5a0(++_0x4d69f1);}(_0x19bd,0x1a9));var _0xd19b=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x19bd[_0x2dafbe];return _0x58a45a;};'use strict';var schema=require(_0xd19b('0x0'));var _=require(_0xd19b('0x1'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0xd19b('0x2')),'smsInteraction':require(_0xd19b('0x3')),'mailInteraction':require(_0xd19b('0x4')),'faxInteraction':require(_0xd19b('0x5')),'whatsappInteraction':require(_0xd19b('0x6'))};var logger=require(_0xd19b('0x7'))('routing');var tag=schema({'tag':{'type':_0xd19b('0x8'),'required':!![],'message':_0xd19b('0x9')}});exports['consequence']=function(_0x15f304,_0x5a4aeb,_0x5e0bdf,_0x314165){return function(_0x5bc1ab){try{var _0x2860ae={'tag':_0x5a4aeb[0x0]};var _0x27c2f8=tag['validate'](_0x2860ae,{'typecast':!![]});if(_0x27c2f8['length']){logger[_0xd19b('0xa')](_0xd19b('0xb'),_0x15f304,_[_0xd19b('0xc')](_0x27c2f8,_0xd19b('0xd'))[_0xd19b('0xe')](',\x20'));logger[_0xd19b('0xf')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x15f304);_0x5bc1ab[_0xd19b('0x10')]();}else{var _0x2e689c={'ids':[_0x5a4aeb[0x0]]};if(rpc[_0x314165['channel']+'Interaction']){rpc[_0x314165[_0xd19b('0x11')]+_0xd19b('0x12')][_0xd19b('0x13')](_0x314165['interaction']['id'],_0x2e689c)['then'](function(_0x1342e3){logger[_0xd19b('0xf')](_0xd19b('0x14'),_0x15f304,_0x5a4aeb[0x1],_0x314165[_0xd19b('0x11')],_0x314165[_0xd19b('0x15')]['id']);})[_0xd19b('0x16')](function(_0x2ecae9){logger[_0xd19b('0xa')](_0xd19b('0xb'),_0x15f304,JSON['stringify'](_0x2ecae9));logger['info'](_0xd19b('0x17'),_0x15f304);})[_0xd19b('0x18')](function(){_0x5bc1ab[_0xd19b('0x10')]();});}}}catch(_0x425d01){logger[_0xd19b('0xa')](_0xd19b('0xb'),_0x15f304,_[_0xd19b('0x19')](_0x425d01)?JSON[_0xd19b('0x1a')](_0x425d01):_0x425d01);logger[_0xd19b('0xf')](_0xd19b('0x17'),_0x15f304);_0x5bc1ab[_0xd19b('0x10')]();}};};
\ No newline at end of file
index 948795d..2f74f13 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaf05=['lodash','replace','\x20-\x20','urlOnAnswer','?params=','urlOnRing','jsonrpc','2.0','method','push','params','stringify','utf8','application/json-rpc','parse','logged','Unable\x20to\x20login\x20with\x20TVox\x20application','channelId=','&data=','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','stop','catch','error','[%s][TVOX]\x20%s','isObject','info','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','next','request-promise','../../../../config/logger'];(function(_0x59162a,_0x10e547){var _0x35e50d=function(_0x578425){while(--_0x578425){_0x59162a['push'](_0x59162a['shift']());}};_0x35e50d(++_0x10e547);}(_0xaf05,0x76));var _0x5af0=function(_0x351f40,_0x2dc6ec){_0x351f40=_0x351f40-0x0;var _0x5222d8=_0xaf05[_0x351f40];return _0x5222d8;};'use strict';var rp=require(_0x5af0('0x0'));var logger=require(_0x5af0('0x1'))('routing');var _=require(_0x5af0('0x2'));var arr=[];exports['consequence']=function(_0x1b6a65,_0x3e77dd){return function(_0x5a3ee8){var _0x80c5da=_0x3e77dd[0xa];var _0x3c81a9=_0x3e77dd[0xb];var _0x5df8ff=_0x3e77dd[0xc];var _0x4a0f47=_0x3e77dd[0xd];var _0x30372e=_0x3e77dd[0xe];var _0x1e76d6=_0x3e77dd[0xf][_0x5af0('0x3')](/\n/g,_0x5af0('0x4'));var _0x223b33=_0x3e77dd[0x10][_0x5af0('0x3')](/\n/g,'\x20');if(!arr['includes'](_0x3c81a9)){arr['push'](_0x3c81a9);var _0x5de8f0=_0x3e77dd[0x3];var _0x21a530=_0x3e77dd[0x4];var _0x38474f=_0x3e77dd[0x1];var _0x4bb6a2=_0x3e77dd[0x0];var _0x17cac4={};_0x17cac4[_0x5af0('0x5')]=_0x3e77dd[0x8]+_0x5af0('0x6')+_0x5df8ff+'|'+_0x80c5da+'|'+_0x4a0f47+'|'+_0x3c81a9+'|'+_0x30372e;_0x17cac4[_0x5af0('0x7')]=_0x3e77dd[0x7]+_0x5af0('0x6')+_0x5df8ff+'|'+_0x80c5da+'|'+_0x4a0f47+'|'+_0x3c81a9+'|'+_0x30372e+'|'+_0x1e76d6+'|'+_0x223b33;_0x17cac4['title']=_0x3e77dd[0x9];var _0x33a09b={};_0x33a09b[_0x5af0('0x8')]=_0x5af0('0x9');_0x33a09b[_0x5af0('0xa')]='login';var _0x545a19=[];_0x545a19[_0x5af0('0xb')](_0x3e77dd[0x2]);_0x545a19[_0x5af0('0xb')](_0x3e77dd[0x5]);_0x545a19['push'](_0x3e77dd[0x6]);_0x33a09b[_0x5af0('0xc')]=_0x545a19;_0x33a09b['id']=0x1;var _0x54d8dc=JSON[_0x5af0('0xd')](_0x33a09b);var _0x34a5a2={'encoding':_0x5af0('0xe'),'method':'POST','timeout':0x2710,'url':_0x5de8f0,'headers':{'Content-Type':_0x5af0('0xf')},'body':_0x54d8dc};return rp(_0x34a5a2)['then'](function(_0x13f19e){const _0x468031=JSON[_0x5af0('0x10')](_0x13f19e);if(!_0x468031['result'][_0x5af0('0x11')]){throw new Error(_0x5af0('0x12'));}var _0x553cea=_0x3c81a9;var _0x1c374e=_0x5af0('0x13')+_0x38474f+'&serviceId='+_0x4bb6a2+'&sessionId='+_0x553cea+_0x5af0('0x14')+JSON['stringify'](_0x17cac4);var _0x4f8036=_0x21a530+'?'+_0x1c374e;return rp(_0x4f8036);})['then'](function(_0x3276a9){logger['info'](_0x5af0('0x15'),_0x1b6a65,_0x3276a9);_0x5a3ee8[_0x5af0('0x16')]();})[_0x5af0('0x17')](function(_0x388712){logger[_0x5af0('0x18')](_0x5af0('0x19'),_0x1b6a65,_[_0x5af0('0x1a')](_0x388712)?JSON[_0x5af0('0xd')](_0x388712):_0x388712);_0x5a3ee8[_0x5af0('0x16')]();});}else{logger[_0x5af0('0x1b')](_0x5af0('0x1c'),_0x1b6a65);_0x5a3ee8[_0x5af0('0x1d')]();}};};
\ No newline at end of file
+var _0xc943=['isObject','stop','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','next','request-promise','routing','lodash','consequence','replace','\x20-\x20','push','?params=','urlOnRing','title','jsonrpc','2.0','stringify','utf8','application/json-rpc','then','parse','result','Unable\x20to\x20login\x20with\x20TVox\x20application','channelId=','&serviceId=','&sessionId=','&data=','info','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','catch','error','[%s][TVOX]\x20%s'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xc943,0xc4));var _0x3c94=function(_0x4f3c9b,_0x28e078){_0x4f3c9b=_0x4f3c9b-0x0;var _0x84e58a=_0xc943[_0x4f3c9b];return _0x84e58a;};'use strict';var rp=require(_0x3c94('0x0'));var logger=require('../../../../config/logger')(_0x3c94('0x1'));var _=require(_0x3c94('0x2'));var arr=[];exports[_0x3c94('0x3')]=function(_0x21e985,_0x426639){return function(_0x3e6eb7){var _0x1a263f=_0x426639[0xa];var _0x14996a=_0x426639[0xb];var _0x2936f9=_0x426639[0xc];var _0x16cbf0=_0x426639[0xd];var _0x68b94f=_0x426639[0xe];var _0x582c22=_0x426639[0xf][_0x3c94('0x4')](/\n/g,_0x3c94('0x5'));var _0x31af6d=_0x426639[0x10]['replace'](/\n/g,'\x20');if(!arr['includes'](_0x14996a)){arr[_0x3c94('0x6')](_0x14996a);var _0x2d51c2=_0x426639[0x3];var _0x31bad8=_0x426639[0x4];var _0x2cfe06=_0x426639[0x1];var _0x5446ea=_0x426639[0x0];var _0x38c507={};_0x38c507['urlOnAnswer']=_0x426639[0x8]+_0x3c94('0x7')+_0x2936f9+'|'+_0x1a263f+'|'+_0x16cbf0+'|'+_0x14996a+'|'+_0x68b94f;_0x38c507[_0x3c94('0x8')]=_0x426639[0x7]+'?params='+_0x2936f9+'|'+_0x1a263f+'|'+_0x16cbf0+'|'+_0x14996a+'|'+_0x68b94f+'|'+_0x582c22+'|'+_0x31af6d;_0x38c507[_0x3c94('0x9')]=_0x426639[0x9];var _0x27c354={};_0x27c354[_0x3c94('0xa')]=_0x3c94('0xb');_0x27c354['method']='login';var _0xc3d3ab=[];_0xc3d3ab[_0x3c94('0x6')](_0x426639[0x2]);_0xc3d3ab[_0x3c94('0x6')](_0x426639[0x5]);_0xc3d3ab['push'](_0x426639[0x6]);_0x27c354['params']=_0xc3d3ab;_0x27c354['id']=0x1;var _0x50154e=JSON[_0x3c94('0xc')](_0x27c354);var _0x49e5da={'encoding':_0x3c94('0xd'),'method':'POST','timeout':0x2710,'url':_0x2d51c2,'headers':{'Content-Type':_0x3c94('0xe')},'body':_0x50154e};return rp(_0x49e5da)[_0x3c94('0xf')](function(_0x51c025){const _0x4d8ed8=JSON[_0x3c94('0x10')](_0x51c025);if(!_0x4d8ed8[_0x3c94('0x11')]['logged']){throw new Error(_0x3c94('0x12'));}var _0x3457f7=_0x14996a;var _0x509f92=_0x3c94('0x13')+_0x2cfe06+_0x3c94('0x14')+_0x5446ea+_0x3c94('0x15')+_0x3457f7+_0x3c94('0x16')+JSON[_0x3c94('0xc')](_0x38c507);var _0x4a0496=_0x31bad8+'?'+_0x509f92;return rp(_0x4a0496);})[_0x3c94('0xf')](function(_0x2ffca3){logger[_0x3c94('0x17')](_0x3c94('0x18'),_0x21e985,_0x2ffca3);_0x3e6eb7['stop']();})[_0x3c94('0x19')](function(_0x33415e){logger[_0x3c94('0x1a')](_0x3c94('0x1b'),_0x21e985,_[_0x3c94('0x1c')](_0x33415e)?JSON[_0x3c94('0xc')](_0x33415e):_0x33415e);_0x3e6eb7[_0x3c94('0x1d')]();});}else{logger['info'](_0x3c94('0x1e'),_0x21e985);_0x3e6eb7[_0x3c94('0x1f')]();}};};
\ No newline at end of file
index 0c6a58c..9a1a2cc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd8b0=['merge','body','contact','message','list','mustache','lodash','render'];(function(_0x538b95,_0x3aaf08){var _0x31b40f=function(_0x3f293b){while(--_0x3f293b){_0x538b95['push'](_0x538b95['shift']());}};_0x31b40f(++_0x3aaf08);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Mustache=require(_0x0d8b('0x0'));var _=require(_0x0d8b('0x1'));module['exports']={'getMustacheRender':function(_0x585166,_0x4b72b0){return Mustache[_0x0d8b('0x2')](_0x585166,_[_0x0d8b('0x3')](_0x4b72b0[_0x0d8b('0x4')],{'contact':_0x4b72b0[_0x0d8b('0x5')],'message':_0x4b72b0[_0x0d8b('0x6')],'account':_0x4b72b0['account'],'interaction':_0x4b72b0['interaction'],'list':_0x4b72b0[_0x0d8b('0x7')]}))||'';}};
\ No newline at end of file
+var _0xd8b0=['merge','body','contact','message','list','mustache','lodash','render'];(function(_0x473bdb,_0x161510){var _0x44c246=function(_0x93148b){while(--_0x93148b){_0x473bdb['push'](_0x473bdb['shift']());}};_0x44c246(++_0x161510);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Mustache=require(_0x0d8b('0x0'));var _=require(_0x0d8b('0x1'));module['exports']={'getMustacheRender':function(_0x585166,_0x4b72b0){return Mustache[_0x0d8b('0x2')](_0x585166,_[_0x0d8b('0x3')](_0x4b72b0[_0x0d8b('0x4')],{'contact':_0x4b72b0[_0x0d8b('0x5')],'message':_0x4b72b0[_0x0d8b('0x6')],'account':_0x4b72b0['account'],'interaction':_0x4b72b0['interaction'],'list':_0x4b72b0[_0x0d8b('0x7')]}))||'';}};
\ No newline at end of file
index 2a6b64e..9ebcd9b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x34ab=['account','notificationTemplate','ChatWebsiteId','./interval','condition','./applications/','consequence','priority','info','Push\x20new\x20rule','on\x20interval','intervals','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','emit','complete','No\x20applications\x20to\x20execute','stack','agent','agents','busy','busyQueue','end','QueueReport','update','UserId','catch','message\x20is\x20empty','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','chatQueues','available','loggedIn','name','paused','mailQueues','openchannelQueues','waiting','smsQueues','faxQueues','whatsappQueues','values','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','http','listen','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','path','jayson/promise','bluebird','uuid','./applications/utils','../../../config/environment','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','rules','channel','message','interaction','applications','length','existsSync','join','app','.js','toLowerCase','autoreply','appdata','split','mail','push','slice','dialogflow','dialogflowv2','amazonlex','tvox','getMustacheRender'];(function(_0x425717,_0x361014){var _0x463688=function(_0x162993){while(--_0x162993){_0x425717['push'](_0x425717['shift']());}};_0x463688(++_0x361014);}(_0x34ab,0x169));var _0xb34a=function(_0x556bb1,_0x34830d){_0x556bb1=_0x556bb1-0x0;var _0x45455f=_0x34ab[_0x556bb1];return _0x45455f;};'use strict';var _=require(_0xb34a('0x0'));var util=require(_0xb34a('0x1'));var path=require(_0xb34a('0x2'));var fs=require('fs');var jayson=require(_0xb34a('0x3'));var BPromise=require(_0xb34a('0x4'));var uuid=require(_0xb34a('0x5'));var utils=require(_0xb34a('0x6'));var config=require(_0xb34a('0x7'));var logger=require('../../../config/logger')('routing');var rpc={'openchannelQueueReport':require(_0xb34a('0x8')),'mailQueueReport':require(_0xb34a('0x9')),'chatQueueReport':require(_0xb34a('0xa')),'smsQueueReport':require('../rpc/smsQueueReport'),'faxQueueReport':require(_0xb34a('0xb')),'whatsappQueueReport':require(_0xb34a('0xc'))};var RuleEngine=require(_0xb34a('0xd'));function getId(_0xb915fb,_0x3afc6d,_0x388c12){return util[_0xb34a('0xe')](_0xb34a('0xf'),_0xb915fb,_0x3afc6d||0x0,_0x388c12||0x0);}function getIntervals(_0x4bd83e,_0x5bc783){var _0xe67822=[];if(!_[_0xb34a('0x10')](_0x5bc783[_0xb34a('0x11')])&&!_['isNil'](_0x4bd83e[_0x5bc783[_0xb34a('0x11')]])&&!_[_0xb34a('0x10')](_0x4bd83e[_0x5bc783[_0xb34a('0x11')]][_0xb34a('0x12')])){_0xe67822=_[_0xb34a('0x13')](_0x4bd83e[_0x5bc783[_0xb34a('0x11')]]['Intervals'],'interval');}else if(!_['isNil'](_0x5bc783['interval'])){_0xe67822=[_0x5bc783[_0xb34a('0x14')]];}return _0xe67822;}exports['listen']=function(_0x503b1a){_0x503b1a[_0xb34a('0x15')]={};return new BPromise(function(_0x270582,_0x442d44){var _0x54ad68={'Start':function(_0x1483f1){var _0x24c0b9=this;return new Promise(function(_0x1381dc,_0x5373aa){if(_0x1483f1){try{var _0xd2eb2b=[];var _0x4f4abe=getId(_0x1483f1[_0xb34a('0x16')],_0x1483f1[_0xb34a('0x17')]?_0x1483f1[_0xb34a('0x17')]['id']:0x0,_0x1483f1[_0xb34a('0x18')]?_0x1483f1[_0xb34a('0x18')]['id']:0x0);if(_0x1483f1[_0xb34a('0x19')]&&_['isArray'](_0x1483f1[_0xb34a('0x19')])&&_0x1483f1[_0xb34a('0x19')][_0xb34a('0x1a')]){for(var _0x252976=0x0;_0x252976<_0x1483f1['applications'][_0xb34a('0x1a')];_0x252976+=0x1){var _0x3bfa4c=_0x1483f1[_0xb34a('0x19')][_0x252976];if(fs[_0xb34a('0x1b')](path[_0xb34a('0x1c')](__dirname,_0xb34a('0x19'),_0x3bfa4c[_0xb34a('0x1d')]+_0xb34a('0x1e')))){var _0x12ed5b=[];switch(_0x3bfa4c['app'][_0xb34a('0x1f')]()){case _0xb34a('0x20'):var _0x4ab5c9=_0x3bfa4c[_0xb34a('0x21')][_0xb34a('0x22')](',');if(_0x1483f1['channel']===_0xb34a('0x23')){_0x12ed5b[_0xb34a('0x24')](_0x4ab5c9[0x0]);_0x12ed5b[_0xb34a('0x24')](_0x4ab5c9[0x1]);_0x12ed5b[_0xb34a('0x24')](_0x4ab5c9[_0xb34a('0x25')](0x2,_0x4ab5c9[_0xb34a('0x1a')])[_0xb34a('0x1c')](','));}else{_0x12ed5b[_0xb34a('0x24')](_0x4ab5c9[0x0]);_0x12ed5b[_0xb34a('0x24')](_0x4ab5c9[_0xb34a('0x25')](0x1,_0x4ab5c9[_0xb34a('0x1a')])[_0xb34a('0x1c')](','));}break;case _0xb34a('0x26'):var _0x55b142=_0x3bfa4c['appdata'][_0xb34a('0x22')](',');_0x12ed5b[_0xb34a('0x24')](_0x55b142[0x0]);_0x12ed5b[_0xb34a('0x24')](_0x55b142[0x1]);_0x12ed5b[_0xb34a('0x24')](_0x55b142['slice'](0x2,_0x55b142['length'])['join'](','));break;case _0xb34a('0x27'):var _0x337e40=_0x3bfa4c[_0xb34a('0x21')][_0xb34a('0x22')](',');_0x12ed5b[_0xb34a('0x24')](_0x337e40[0x0]);_0x12ed5b[_0xb34a('0x24')](_0x337e40[0x1]);_0x12ed5b[_0xb34a('0x24')](_0x337e40[0x2]);_0x12ed5b['push'](_0x337e40[0x3]);_0x12ed5b[_0xb34a('0x24')](_0x337e40[_0xb34a('0x25')](0x4,_0x337e40[_0xb34a('0x1a')])[_0xb34a('0x1c')](','));break;case _0xb34a('0x28'):var _0x71b424=_0x3bfa4c['appdata']['split'](',');_0x12ed5b['push'](_0x71b424[0x0]);_0x12ed5b[_0xb34a('0x24')](_0x71b424[0x1]);_0x12ed5b['push'](_0x71b424[0x2]);_0x12ed5b[_0xb34a('0x24')](_0x71b424[0x3]);_0x12ed5b[_0xb34a('0x24')](_0x71b424[_0xb34a('0x25')](0x4,_0x71b424['length'])[_0xb34a('0x1c')](','));break;case _0xb34a('0x17'):_0x12ed5b[_0xb34a('0x24')](_0x3bfa4c[_0xb34a('0x21')]);break;case'tag':_0x12ed5b['push'](_0x3bfa4c['TagId']);_0x12ed5b[_0xb34a('0x24')](_0x3bfa4c[_0xb34a('0x21')]);break;case _0xb34a('0x29'):var _0x5379df=utils[_0xb34a('0x2a')](_0x1483f1[_0xb34a('0x2b')][_0xb34a('0x2c')],_0x1483f1);var _0x212924=_0x3bfa4c['appdata'][_0xb34a('0x22')](',');_0x12ed5b[_0xb34a('0x24')](_0x212924[0x0]);_0x12ed5b[_0xb34a('0x24')](_0x212924[0x1]);_0x12ed5b[_0xb34a('0x24')](_0x212924[0x2]);_0x12ed5b[_0xb34a('0x24')](_0x212924[0x3]);_0x12ed5b[_0xb34a('0x24')](_0x212924[0x4]);_0x12ed5b['push'](_0x212924[0x5]);_0x12ed5b[_0xb34a('0x24')](_0x212924[0x6]);_0x12ed5b['push'](_0x212924[0x7]);_0x12ed5b[_0xb34a('0x24')](_0x212924[0x8]);_0x12ed5b[_0xb34a('0x24')](_0x212924[0x9]);_0x12ed5b['push'](_0x212924[0xa]);_0x12ed5b['push'](_0x1483f1[_0xb34a('0x18')]['id']);_0x12ed5b['push'](_0x1483f1[_0xb34a('0x17')]['id']);_0x12ed5b[_0xb34a('0x24')](_0x3bfa4c[_0xb34a('0x2d')]);_0x12ed5b['push'](_0x1483f1[_0xb34a('0x18')]['ContactId']);_0x12ed5b[_0xb34a('0x24')](_0x1483f1['body']['body']);_0x12ed5b[_0xb34a('0x24')](_0x5379df);break;default:_0x12ed5b=_['isNil'](_0x3bfa4c['appdata'])?[]:_0x3bfa4c['appdata']['split'](',');}var _0x476934={'id':util[_0xb34a('0xe')]('%s:%s:%s',_0x4f4abe,_0x3bfa4c['id'],_0x3bfa4c['app']),'condition':require(_0xb34a('0x2e'))[_0xb34a('0x2f')](_0x4f4abe,getIntervals(_0x503b1a['intervals'],_0x3bfa4c),_0x503b1a),'consequence':require(_0xb34a('0x30')+_0x3bfa4c[_0xb34a('0x1d')])[_0xb34a('0x31')](_0x4f4abe,_0x12ed5b,_0x503b1a,_0x1483f1),'p':_0x3bfa4c[_0xb34a('0x32')]||0x0};logger[_0xb34a('0x33')](_0xb34a('0x34'),_0x476934['id'],_0xb34a('0x35'),getIntervals(_0x503b1a[_0xb34a('0x36')],_0x3bfa4c)['join'](_0xb34a('0x37')));_0xd2eb2b['push'](_0x476934);}else{logger[_0xb34a('0x38')](_0xb34a('0x39'),path[_0xb34a('0x1c')](__dirname,'applications',_0x3bfa4c[_0xb34a('0x1d')]+_0xb34a('0x1e')));}}_0x503b1a['rules'][_0x4f4abe]=new RuleEngine(_0xd2eb2b);_0x503b1a[_0xb34a('0x15')][_0x4f4abe]['execute'](_0x1483f1,function(_0x112ca8){logger[_0xb34a('0x33')]('Applications\x20executed',JSON['stringify'](_0x112ca8['matchPath']));if(_0x503b1a[_0xb34a('0x15')][_0x4f4abe]){_0x503b1a[_0xb34a('0x15')][_0x4f4abe][_0xb34a('0x3a')](_0xb34a('0x3b'));}});return _0x1381dc({'code':0xc8,'message':_0x1483f1});}else{logger[_0xb34a('0x33')](_0xb34a('0x3c'));return _0x1381dc({'code':0xc8,'message':_0x1483f1});}}catch(_0x1d6b5b){logger[_0xb34a('0x38')](_0x1d6b5b[_0xb34a('0x3d')]);return _0x5373aa(_0x24c0b9[_0xb34a('0x38')](0x1f4,_0x1d6b5b));}}return _0x5373aa('routing\x20is\x20empty');});},'AcceptMessage':function(_0x5956fc){var _0x121973=this;return new Promise(function(_0x5ee933,_0x1f81ed){if(_0x5956fc[_0xb34a('0x3e')]&&_0x5956fc['agent']['id']){if(_0x503b1a[_0xb34a('0x3f')][_0x5956fc[_0xb34a('0x3e')]['id']]){_0x503b1a[_0xb34a('0x3f')][_0x5956fc[_0xb34a('0x3e')]['id']][_0xb34a('0x40')]=![];_0x503b1a[_0xb34a('0x3f')][_0x5956fc[_0xb34a('0x3e')]['id']][_0xb34a('0x41')]=undefined;}}if(_0x5956fc['message']&&_0x5956fc[_0xb34a('0x17')]['id']){try{var _0x7b907d=getId(_0x5956fc[_0xb34a('0x16')],_0x5956fc[_0xb34a('0x17')]?_0x5956fc[_0xb34a('0x17')]['id']:0x0,_0x5956fc[_0xb34a('0x18')]?_0x5956fc['interaction']['id']:0x0);if(_0x503b1a['rules'][_0x7b907d]){_0x503b1a[_0xb34a('0x15')][_0x7b907d]['emit'](_0xb34a('0x42'));if(rpc[_0x5956fc[_0xb34a('0x16')]+_0xb34a('0x43')]){rpc[_0x5956fc[_0xb34a('0x16')]+_0xb34a('0x43')][_0xb34a('0x44')](_0x7b907d,{'UserId':_0x5956fc[_0xb34a('0x17')][_0xb34a('0x45')]})[_0xb34a('0x46')](function(_0x2502d8){logger[_0xb34a('0x38')]('error\x20update\x20queue\x20report');});}}return _0x5ee933({'code':0xc8,'message':_0x5956fc});}catch(_0x5d382b){logger[_0xb34a('0x38')](_0x5d382b['stack']);return _0x1f81ed(_0x121973[_0xb34a('0x38')](0x1f4,_0x5d382b));}}logger[_0xb34a('0x38')](_0xb34a('0x47'));return _0x1f81ed(_0x121973[_0xb34a('0x38')](0x1f4,'message\x20is\x20empty'));});},'RejectMessage':function(_0x5463cd){var _0x4fabfb=this;return new Promise(function(_0x540ad6,_0xb52644){if(_0x5463cd[_0xb34a('0x3e')]&&_0x5463cd[_0xb34a('0x3e')]['id']){try{if(_0x503b1a[_0xb34a('0x3f')][_0x5463cd[_0xb34a('0x3e')]['id']]){_0x503b1a[_0xb34a('0x3f')][_0x5463cd[_0xb34a('0x3e')]['id']][_0xb34a('0x40')]=![];_0x503b1a[_0xb34a('0x3f')][_0x5463cd[_0xb34a('0x3e')]['id']][_0xb34a('0x41')]=undefined;}return _0x540ad6({'code':0xc8,'message':_0x5463cd});}catch(_0x22c7f5){logger[_0xb34a('0x38')](_0x22c7f5['stack']);return _0xb52644(_0x4fabfb['error'](0x1f4,_0x22c7f5));}}logger[_0xb34a('0x38')](_0xb34a('0x47'));return _0xb52644(_0x4fabfb[_0xb34a('0x38')](0x1f4,'message\x20is\x20empty'));});},'AbandonInteraction':function(_0x2a8e07){var _0x4a538b=this;return new Promise(function(_0xffdaa,_0x7d3ce2){if(_0x2a8e07[_0xb34a('0x16')]&&_0x2a8e07['interaction']&&_0x2a8e07['interaction']['id']){try{var _0x570ca0=getId(_0x2a8e07[_0xb34a('0x16')],_0x2a8e07[_0xb34a('0x17')]?_0x2a8e07['message']['id']:0x0,_0x2a8e07[_0xb34a('0x18')]?_0x2a8e07[_0xb34a('0x18')]['id']:0x0);if(_0x503b1a[_0xb34a('0x15')][_0x570ca0]){_0x503b1a[_0xb34a('0x15')][_0x570ca0][_0xb34a('0x3a')](_0xb34a('0x42'));}return _0xffdaa({'code':0xc8,'message':_0x2a8e07});}catch(_0x3ebe9c){logger[_0xb34a('0x38')](_0x3ebe9c[_0xb34a('0x3d')]);return _0x7d3ce2(_0x4a538b['error'](0x1f4,_0x3ebe9c));}}logger[_0xb34a('0x38')]('message\x20is\x20empty');return _0x7d3ce2(_0x4a538b[_0xb34a('0x38')](0x1f4,_0xb34a('0x47')));});},'AgentCapacity':function(_0x138e68){var _0x1b0bbe=this;return new Promise(function(_0x20718f,_0x5c51ee){if(_0x503b1a[_0xb34a('0x3f')][_0xb34a('0x48')](_0x138e68['id'])){for(var _0xfb4ba7 in _0x138e68[_0xb34a('0x49')]){if(_0x138e68[_0xb34a('0x49')][_0xb34a('0x48')](_0xfb4ba7)){if(_0x503b1a['agents'][_0x138e68['id']][_0xb34a('0x48')](_0xfb4ba7+_0xb34a('0x4a'))){_0x503b1a[_0xb34a('0x3f')][_0x138e68['id']][_0xfb4ba7+'CurrentCapacity']=parseInt(_0x138e68[_0xb34a('0x49')][_0xfb4ba7],0xa);}}}_0x503b1a[_0xb34a('0x3f')][_0x138e68['id']][_0xb34a('0x4b')]();return _0x20718f({'code':0xc8,'message':_0x503b1a[_0xb34a('0x3f')][_0x138e68['id']]});}else{return _0x5c51ee(_0x1b0bbe[_0xb34a('0x38')](0x1f4,_0xb34a('0x4c')));}});},'Agents':function(_0x4cc742){return new Promise(function(_0x15b423,_0x52ce0b){var _0x1055af=_['values'](_0x503b1a[_0xb34a('0x3f')]);_0x15b423({'count':_0x1055af[_0xb34a('0x1a')],'rows':_0x1055af});});},'ChatQueues':function(_0x5e3393){return new Promise(function(_0x5aa2b7,_0x53231a){var _0x44595f=[];for(var _0xfb912d in _0x503b1a[_0xb34a('0x4d')]){if(_0x503b1a[_0xb34a('0x4d')][_0xb34a('0x48')](_0xfb912d)){var _0x5debc5=_0x503b1a[_0xb34a('0x4d')][_0xfb912d];var _0x2995b={'id':_0x5debc5['id'],'available':_0x5debc5[_0xb34a('0x4e')],'loggedIn':_0x5debc5[_0xb34a('0x4f')],'name':_0x5debc5[_0xb34a('0x50')],'paused':_0x5debc5[_0xb34a('0x51')],'waiting':_0x5debc5['waiting']};_0x44595f[_0xb34a('0x24')](_0x2995b);}}_0x5aa2b7({'count':_0x44595f['length'],'rows':_0x44595f});});},'MailQueues':function(_0x53c4ce){return new Promise(function(_0x57ba7c,_0x127553){var _0x587664=[];for(var _0x412ab4 in _0x503b1a[_0xb34a('0x52')]){if(_0x503b1a[_0xb34a('0x52')][_0xb34a('0x48')](_0x412ab4)){var _0x4f1b7d=_0x503b1a[_0xb34a('0x52')][_0x412ab4];var _0x5dbe0f={'id':_0x4f1b7d['id'],'available':_0x4f1b7d[_0xb34a('0x4e')],'loggedIn':_0x4f1b7d[_0xb34a('0x4f')],'name':_0x4f1b7d[_0xb34a('0x50')],'paused':_0x4f1b7d['paused'],'waiting':_0x4f1b7d['waiting']};_0x587664[_0xb34a('0x24')](_0x5dbe0f);}}_0x57ba7c({'count':_0x587664[_0xb34a('0x1a')],'rows':_0x587664});});},'OpenchannelQueues':function(_0x2d5125){return new Promise(function(_0x470198,_0x31876b){var _0x2da606=[];for(var _0x4b5337 in _0x503b1a[_0xb34a('0x53')]){if(_0x503b1a['openchannelQueues'][_0xb34a('0x48')](_0x4b5337)){var _0x4919fe=_0x503b1a[_0xb34a('0x53')][_0x4b5337];var _0x39aaba={'id':_0x4919fe['id'],'available':_0x4919fe[_0xb34a('0x4e')],'loggedIn':_0x4919fe[_0xb34a('0x4f')],'name':_0x4919fe[_0xb34a('0x50')],'paused':_0x4919fe['paused'],'waiting':_0x4919fe[_0xb34a('0x54')]};_0x2da606[_0xb34a('0x24')](_0x39aaba);}}_0x470198({'count':_0x2da606[_0xb34a('0x1a')],'rows':_0x2da606});});},'SmsQueues':function(_0xeb679b){return new Promise(function(_0x45a5e6,_0x5d9b34){var _0x42216f=[];for(var _0x26f5cf in _0x503b1a['smsQueues']){if(_0x503b1a['smsQueues'][_0xb34a('0x48')](_0x26f5cf)){var _0x4552b1=_0x503b1a[_0xb34a('0x55')][_0x26f5cf];var _0x5bb58f={'id':_0x4552b1['id'],'available':_0x4552b1[_0xb34a('0x4e')],'loggedIn':_0x4552b1[_0xb34a('0x4f')],'name':_0x4552b1[_0xb34a('0x50')],'paused':_0x4552b1[_0xb34a('0x51')],'waiting':_0x4552b1[_0xb34a('0x54')]};_0x42216f[_0xb34a('0x24')](_0x5bb58f);}}_0x45a5e6({'count':_0x42216f[_0xb34a('0x1a')],'rows':_0x42216f});});},'FaxQueues':function(_0xd4636c){return new Promise(function(_0x27c3a2,_0xaae815){var _0x24ffd3=[];for(var _0x22c634 in _0x503b1a[_0xb34a('0x56')]){if(_0x503b1a[_0xb34a('0x56')][_0xb34a('0x48')](_0x22c634)){var _0x515266=_0x503b1a[_0xb34a('0x56')][_0x22c634];var _0x578e1d={'id':_0x515266['id'],'available':_0x515266[_0xb34a('0x4e')],'loggedIn':_0x515266[_0xb34a('0x4f')],'name':_0x515266[_0xb34a('0x50')],'paused':_0x515266['paused'],'waiting':_0x515266[_0xb34a('0x54')]};_0x24ffd3['push'](_0x578e1d);}}_0x27c3a2({'count':_0x24ffd3[_0xb34a('0x1a')],'rows':_0x24ffd3});});},'WhatsappQueues':function(_0x2e9e89){return new Promise(function(_0x175261,_0x59c2af){var _0x4f450b=[];for(var _0x11abaf in _0x503b1a[_0xb34a('0x57')]){if(_0x503b1a[_0xb34a('0x57')][_0xb34a('0x48')](_0x11abaf)){var _0x1ab4d0=_0x503b1a['whatsappQueues'][_0x11abaf];var _0x2fbccf={'id':_0x1ab4d0['id'],'available':_0x1ab4d0[_0xb34a('0x4e')],'loggedIn':_0x1ab4d0[_0xb34a('0x4f')],'name':_0x1ab4d0[_0xb34a('0x50')],'paused':_0x1ab4d0[_0xb34a('0x51')],'waiting':_0x1ab4d0[_0xb34a('0x54')]};_0x4f450b['push'](_0x2fbccf);}}_0x175261({'count':_0x4f450b[_0xb34a('0x1a')],'rows':_0x4f450b});});},'ChatQueuesWaitingInteractions':function(_0x5acad7){return new Promise(function(_0x30c58c,_0x545431){var _0x49e8e2=_[_0xb34a('0x58')](_0x503b1a[_0xb34a('0x59')]);_0x30c58c({'count':_0x49e8e2[_0xb34a('0x1a')],'rows':_0x49e8e2});});},'MailQueuesWaitingInteractions':function(_0x52c49d){return new Promise(function(_0x4acb00,_0x1e886c){var _0x2be08d=_['values'](_0x503b1a[_0xb34a('0x5a')]);_0x4acb00({'count':_0x2be08d['length'],'rows':_0x2be08d});});},'OpenchannelQueuesWaitingInteractions':function(_0x47ba93){return new Promise(function(_0xcbf23b,_0x5d1de5){var _0x32e491=_[_0xb34a('0x58')](_0x503b1a[_0xb34a('0x5b')]);_0xcbf23b({'count':_0x32e491['length'],'rows':_0x32e491});});},'SmsQueuesWaitingInteractions':function(_0x5458c8){return new Promise(function(_0x580876,_0x178988){var _0x165e6b=_['values'](_0x503b1a[_0xb34a('0x5c')]);_0x580876({'count':_0x165e6b[_0xb34a('0x1a')],'rows':_0x165e6b});});},'FaxQueuesWaitingInteractions':function(_0x493ea1){return new Promise(function(_0x4cb84a,_0x24d81f){var _0x29f97c=_[_0xb34a('0x58')](_0x503b1a['faxQueuesWaitingInteractions']);_0x4cb84a({'count':_0x29f97c[_0xb34a('0x1a')],'rows':_0x29f97c});});},'WhatsappQueuesWaitingInteractions':function(_0x32dc19){return new Promise(function(_0x34eae2,_0x5618b0){var _0x321145=_[_0xb34a('0x58')](_0x503b1a[_0xb34a('0x5d')]);_0x34eae2({'count':_0x321145[_0xb34a('0x1a')],'rows':_0x321145});});}};var _0x232fc7=jayson[_0xb34a('0x5e')](_0x54ad68)[_0xb34a('0x5f')]();_0x232fc7['on'](_0xb34a('0x38'),function(_0x2ee5f4){logger['error'](JSON['stringify'](_0x2ee5f4));return _0x442d44(_0x2ee5f4);});_0x232fc7[_0xb34a('0x60')](0x232c,_0xb34a('0x61'),function(){console[_0xb34a('0x62')](_0xb34a('0x63'),0x232c);return _0x270582(_0xb34a('0x64')+0x232c);});});};
\ No newline at end of file
+var _0xd110=['../rpc/whatsappQueueReport','format','IntervalId','isNil','Intervals','map','interval','listen','rules','channel','message','interaction','applications','length','existsSync','join','app','.js','autoreply','appdata','mail','push','slice','split','dialogflowv2','amazonlex','tag','TagId','tvox','notificationTemplate','ChatWebsiteId','body','%s:%s:%s','./interval','intervals','./applications/','consequence','info','Push\x20new\x20rule','on\x20interval','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','execute','Applications\x20executed','stringify','matchPath','emit','No\x20applications\x20to\x20execute','stack','routing\x20is\x20empty','agent','agents','end','QueueReport','update','UserId','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','busy','busyQueue','hasOwnProperty','capacity','CurrentCapacity','agent\x20not\x20found','values','chatQueues','available','loggedIn','name','paused','waiting','mailQueues','openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','http','127.0.0.1','log','RPC\x20listening\x20on\x20port:','lodash','util','path','bluebird','uuid','./applications/utils','../../../config/environment','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/smsQueueReport'];(function(_0x570b91,_0x232b46){var _0x47e3ba=function(_0x389327){while(--_0x389327){_0x570b91['push'](_0x570b91['shift']());}};_0x47e3ba(++_0x232b46);}(_0xd110,0x1e8));var _0x0d11=function(_0x39fb5d,_0x59798b){_0x39fb5d=_0x39fb5d-0x0;var _0x22f743=_0xd110[_0x39fb5d];return _0x22f743;};'use strict';var _=require(_0x0d11('0x0'));var util=require(_0x0d11('0x1'));var path=require(_0x0d11('0x2'));var fs=require('fs');var jayson=require('jayson/promise');var BPromise=require(_0x0d11('0x3'));var uuid=require(_0x0d11('0x4'));var utils=require(_0x0d11('0x5'));var config=require(_0x0d11('0x6'));var logger=require(_0x0d11('0x7'))(_0x0d11('0x8'));var rpc={'openchannelQueueReport':require(_0x0d11('0x9')),'mailQueueReport':require(_0x0d11('0xa')),'chatQueueReport':require('../rpc/chatQueueReport'),'smsQueueReport':require(_0x0d11('0xb')),'faxQueueReport':require('../rpc/faxQueueReport'),'whatsappQueueReport':require(_0x0d11('0xc'))};var RuleEngine=require('../lib/rule-engine');function getId(_0x47a493,_0x3f9f5a,_0x1be5b8){return util[_0x0d11('0xd')]('%s.%s.%s',_0x47a493,_0x3f9f5a||0x0,_0x1be5b8||0x0);}function getIntervals(_0x40823e,_0x4deda3){var _0x1fc1d3=[];if(!_['isNil'](_0x4deda3[_0x0d11('0xe')])&&!_[_0x0d11('0xf')](_0x40823e[_0x4deda3[_0x0d11('0xe')]])&&!_[_0x0d11('0xf')](_0x40823e[_0x4deda3['IntervalId']][_0x0d11('0x10')])){_0x1fc1d3=_[_0x0d11('0x11')](_0x40823e[_0x4deda3['IntervalId']][_0x0d11('0x10')],_0x0d11('0x12'));}else if(!_[_0x0d11('0xf')](_0x4deda3['interval'])){_0x1fc1d3=[_0x4deda3[_0x0d11('0x12')]];}return _0x1fc1d3;}exports[_0x0d11('0x13')]=function(_0x5bea18){_0x5bea18[_0x0d11('0x14')]={};return new BPromise(function(_0x3c88e6,_0x266f0f){var _0x3005f2={'Start':function(_0x2bc04b){var _0x5b85a7=this;return new Promise(function(_0x5a0de9,_0x280d81){if(_0x2bc04b){try{var _0x47c872=[];var _0x46aa4f=getId(_0x2bc04b[_0x0d11('0x15')],_0x2bc04b['message']?_0x2bc04b[_0x0d11('0x16')]['id']:0x0,_0x2bc04b['interaction']?_0x2bc04b[_0x0d11('0x17')]['id']:0x0);if(_0x2bc04b[_0x0d11('0x18')]&&_['isArray'](_0x2bc04b['applications'])&&_0x2bc04b[_0x0d11('0x18')][_0x0d11('0x19')]){for(var _0x362c14=0x0;_0x362c14<_0x2bc04b[_0x0d11('0x18')][_0x0d11('0x19')];_0x362c14+=0x1){var _0x3b4be3=_0x2bc04b['applications'][_0x362c14];if(fs[_0x0d11('0x1a')](path[_0x0d11('0x1b')](__dirname,_0x0d11('0x18'),_0x3b4be3[_0x0d11('0x1c')]+_0x0d11('0x1d')))){var _0x551e16=[];switch(_0x3b4be3[_0x0d11('0x1c')]['toLowerCase']()){case _0x0d11('0x1e'):var _0x424255=_0x3b4be3[_0x0d11('0x1f')]['split'](',');if(_0x2bc04b[_0x0d11('0x15')]===_0x0d11('0x20')){_0x551e16['push'](_0x424255[0x0]);_0x551e16[_0x0d11('0x21')](_0x424255[0x1]);_0x551e16['push'](_0x424255[_0x0d11('0x22')](0x2,_0x424255['length'])['join'](','));}else{_0x551e16[_0x0d11('0x21')](_0x424255[0x0]);_0x551e16[_0x0d11('0x21')](_0x424255[_0x0d11('0x22')](0x1,_0x424255[_0x0d11('0x19')])[_0x0d11('0x1b')](','));}break;case'dialogflow':var _0x21fac5=_0x3b4be3['appdata'][_0x0d11('0x23')](',');_0x551e16['push'](_0x21fac5[0x0]);_0x551e16[_0x0d11('0x21')](_0x21fac5[0x1]);_0x551e16[_0x0d11('0x21')](_0x21fac5[_0x0d11('0x22')](0x2,_0x21fac5[_0x0d11('0x19')])[_0x0d11('0x1b')](','));break;case _0x0d11('0x24'):var _0x144e93=_0x3b4be3[_0x0d11('0x1f')][_0x0d11('0x23')](',');_0x551e16[_0x0d11('0x21')](_0x144e93[0x0]);_0x551e16[_0x0d11('0x21')](_0x144e93[0x1]);_0x551e16[_0x0d11('0x21')](_0x144e93[0x2]);_0x551e16['push'](_0x144e93[0x3]);_0x551e16[_0x0d11('0x21')](_0x144e93[_0x0d11('0x22')](0x4,_0x144e93['length'])[_0x0d11('0x1b')](','));break;case _0x0d11('0x25'):var _0x577f01=_0x3b4be3[_0x0d11('0x1f')][_0x0d11('0x23')](',');_0x551e16[_0x0d11('0x21')](_0x577f01[0x0]);_0x551e16[_0x0d11('0x21')](_0x577f01[0x1]);_0x551e16[_0x0d11('0x21')](_0x577f01[0x2]);_0x551e16[_0x0d11('0x21')](_0x577f01[0x3]);_0x551e16[_0x0d11('0x21')](_0x577f01[_0x0d11('0x22')](0x4,_0x577f01['length'])[_0x0d11('0x1b')](','));break;case _0x0d11('0x16'):_0x551e16[_0x0d11('0x21')](_0x3b4be3[_0x0d11('0x1f')]);break;case _0x0d11('0x26'):_0x551e16[_0x0d11('0x21')](_0x3b4be3[_0x0d11('0x27')]);_0x551e16[_0x0d11('0x21')](_0x3b4be3[_0x0d11('0x1f')]);break;case _0x0d11('0x28'):var _0x3c6c4b=utils['getMustacheRender'](_0x2bc04b['account'][_0x0d11('0x29')],_0x2bc04b);var _0x18c268=_0x3b4be3[_0x0d11('0x1f')][_0x0d11('0x23')](',');_0x551e16['push'](_0x18c268[0x0]);_0x551e16[_0x0d11('0x21')](_0x18c268[0x1]);_0x551e16[_0x0d11('0x21')](_0x18c268[0x2]);_0x551e16['push'](_0x18c268[0x3]);_0x551e16[_0x0d11('0x21')](_0x18c268[0x4]);_0x551e16[_0x0d11('0x21')](_0x18c268[0x5]);_0x551e16[_0x0d11('0x21')](_0x18c268[0x6]);_0x551e16[_0x0d11('0x21')](_0x18c268[0x7]);_0x551e16[_0x0d11('0x21')](_0x18c268[0x8]);_0x551e16[_0x0d11('0x21')](_0x18c268[0x9]);_0x551e16[_0x0d11('0x21')](_0x18c268[0xa]);_0x551e16[_0x0d11('0x21')](_0x2bc04b[_0x0d11('0x17')]['id']);_0x551e16[_0x0d11('0x21')](_0x2bc04b[_0x0d11('0x16')]['id']);_0x551e16[_0x0d11('0x21')](_0x3b4be3[_0x0d11('0x2a')]);_0x551e16[_0x0d11('0x21')](_0x2bc04b[_0x0d11('0x17')]['ContactId']);_0x551e16[_0x0d11('0x21')](_0x2bc04b['body'][_0x0d11('0x2b')]);_0x551e16[_0x0d11('0x21')](_0x3c6c4b);break;default:_0x551e16=_[_0x0d11('0xf')](_0x3b4be3[_0x0d11('0x1f')])?[]:_0x3b4be3['appdata'][_0x0d11('0x23')](',');}var _0x1448f5={'id':util[_0x0d11('0xd')](_0x0d11('0x2c'),_0x46aa4f,_0x3b4be3['id'],_0x3b4be3['app']),'condition':require(_0x0d11('0x2d'))['condition'](_0x46aa4f,getIntervals(_0x5bea18[_0x0d11('0x2e')],_0x3b4be3),_0x5bea18),'consequence':require(_0x0d11('0x2f')+_0x3b4be3[_0x0d11('0x1c')])[_0x0d11('0x30')](_0x46aa4f,_0x551e16,_0x5bea18,_0x2bc04b),'p':_0x3b4be3['priority']||0x0};logger[_0x0d11('0x31')](_0x0d11('0x32'),_0x1448f5['id'],_0x0d11('0x33'),getIntervals(_0x5bea18['intervals'],_0x3b4be3)[_0x0d11('0x1b')](_0x0d11('0x34')));_0x47c872[_0x0d11('0x21')](_0x1448f5);}else{logger[_0x0d11('0x35')](_0x0d11('0x36'),path[_0x0d11('0x1b')](__dirname,'applications',_0x3b4be3[_0x0d11('0x1c')]+_0x0d11('0x1d')));}}_0x5bea18[_0x0d11('0x14')][_0x46aa4f]=new RuleEngine(_0x47c872);_0x5bea18[_0x0d11('0x14')][_0x46aa4f][_0x0d11('0x37')](_0x2bc04b,function(_0x163ca8){logger[_0x0d11('0x31')](_0x0d11('0x38'),JSON[_0x0d11('0x39')](_0x163ca8[_0x0d11('0x3a')]));if(_0x5bea18[_0x0d11('0x14')][_0x46aa4f]){_0x5bea18['rules'][_0x46aa4f][_0x0d11('0x3b')]('complete');}});return _0x5a0de9({'code':0xc8,'message':_0x2bc04b});}else{logger['info'](_0x0d11('0x3c'));return _0x5a0de9({'code':0xc8,'message':_0x2bc04b});}}catch(_0x525509){logger['error'](_0x525509[_0x0d11('0x3d')]);return _0x280d81(_0x5b85a7[_0x0d11('0x35')](0x1f4,_0x525509));}}return _0x280d81(_0x0d11('0x3e'));});},'AcceptMessage':function(_0x1ebc1d){var _0x4fcf02=this;return new Promise(function(_0x169a31,_0x4d9e67){if(_0x1ebc1d['agent']&&_0x1ebc1d[_0x0d11('0x3f')]['id']){if(_0x5bea18[_0x0d11('0x40')][_0x1ebc1d[_0x0d11('0x3f')]['id']]){_0x5bea18[_0x0d11('0x40')][_0x1ebc1d[_0x0d11('0x3f')]['id']]['busy']=![];_0x5bea18[_0x0d11('0x40')][_0x1ebc1d[_0x0d11('0x3f')]['id']]['busyQueue']=undefined;}}if(_0x1ebc1d['message']&&_0x1ebc1d['message']['id']){try{var _0x4bcfaa=getId(_0x1ebc1d[_0x0d11('0x15')],_0x1ebc1d[_0x0d11('0x16')]?_0x1ebc1d[_0x0d11('0x16')]['id']:0x0,_0x1ebc1d['interaction']?_0x1ebc1d['interaction']['id']:0x0);if(_0x5bea18[_0x0d11('0x14')][_0x4bcfaa]){_0x5bea18[_0x0d11('0x14')][_0x4bcfaa][_0x0d11('0x3b')](_0x0d11('0x41'));if(rpc[_0x1ebc1d[_0x0d11('0x15')]+'QueueReport']){rpc[_0x1ebc1d[_0x0d11('0x15')]+_0x0d11('0x42')][_0x0d11('0x43')](_0x4bcfaa,{'UserId':_0x1ebc1d[_0x0d11('0x16')][_0x0d11('0x44')]})[_0x0d11('0x45')](function(_0x37916a){logger[_0x0d11('0x35')](_0x0d11('0x46'));});}}return _0x169a31({'code':0xc8,'message':_0x1ebc1d});}catch(_0x406eab){logger[_0x0d11('0x35')](_0x406eab[_0x0d11('0x3d')]);return _0x4d9e67(_0x4fcf02[_0x0d11('0x35')](0x1f4,_0x406eab));}}logger[_0x0d11('0x35')](_0x0d11('0x47'));return _0x4d9e67(_0x4fcf02[_0x0d11('0x35')](0x1f4,_0x0d11('0x47')));});},'RejectMessage':function(_0x1f07f1){var _0x17f3a0=this;return new Promise(function(_0x2927a0,_0x5b28ce){if(_0x1f07f1[_0x0d11('0x3f')]&&_0x1f07f1['agent']['id']){try{if(_0x5bea18[_0x0d11('0x40')][_0x1f07f1['agent']['id']]){_0x5bea18['agents'][_0x1f07f1[_0x0d11('0x3f')]['id']][_0x0d11('0x48')]=![];_0x5bea18[_0x0d11('0x40')][_0x1f07f1[_0x0d11('0x3f')]['id']][_0x0d11('0x49')]=undefined;}return _0x2927a0({'code':0xc8,'message':_0x1f07f1});}catch(_0x1e5510){logger[_0x0d11('0x35')](_0x1e5510[_0x0d11('0x3d')]);return _0x5b28ce(_0x17f3a0['error'](0x1f4,_0x1e5510));}}logger['error']('message\x20is\x20empty');return _0x5b28ce(_0x17f3a0[_0x0d11('0x35')](0x1f4,_0x0d11('0x47')));});},'AbandonInteraction':function(_0x420f8e){var _0x131d40=this;return new Promise(function(_0x258fd3,_0x38ba59){if(_0x420f8e[_0x0d11('0x15')]&&_0x420f8e['interaction']&&_0x420f8e[_0x0d11('0x17')]['id']){try{var _0x34a825=getId(_0x420f8e[_0x0d11('0x15')],_0x420f8e['message']?_0x420f8e['message']['id']:0x0,_0x420f8e[_0x0d11('0x17')]?_0x420f8e['interaction']['id']:0x0);if(_0x5bea18[_0x0d11('0x14')][_0x34a825]){_0x5bea18[_0x0d11('0x14')][_0x34a825][_0x0d11('0x3b')](_0x0d11('0x41'));}return _0x258fd3({'code':0xc8,'message':_0x420f8e});}catch(_0xce2e39){logger[_0x0d11('0x35')](_0xce2e39[_0x0d11('0x3d')]);return _0x38ba59(_0x131d40[_0x0d11('0x35')](0x1f4,_0xce2e39));}}logger[_0x0d11('0x35')](_0x0d11('0x47'));return _0x38ba59(_0x131d40[_0x0d11('0x35')](0x1f4,_0x0d11('0x47')));});},'AgentCapacity':function(_0x546b98){var _0x1d5c84=this;return new Promise(function(_0x142437,_0x26be02){if(_0x5bea18[_0x0d11('0x40')][_0x0d11('0x4a')](_0x546b98['id'])){for(var _0x505562 in _0x546b98[_0x0d11('0x4b')]){if(_0x546b98[_0x0d11('0x4b')][_0x0d11('0x4a')](_0x505562)){if(_0x5bea18[_0x0d11('0x40')][_0x546b98['id']][_0x0d11('0x4a')](_0x505562+_0x0d11('0x4c'))){_0x5bea18[_0x0d11('0x40')][_0x546b98['id']][_0x505562+_0x0d11('0x4c')]=parseInt(_0x546b98['capacity'][_0x505562],0xa);}}}_0x5bea18[_0x0d11('0x40')][_0x546b98['id']]['updateRealtime']();return _0x142437({'code':0xc8,'message':_0x5bea18[_0x0d11('0x40')][_0x546b98['id']]});}else{return _0x26be02(_0x1d5c84[_0x0d11('0x35')](0x1f4,_0x0d11('0x4d')));}});},'Agents':function(_0x4380a9){return new Promise(function(_0x3ba939,_0x5e0e5b){var _0x17f47b=_[_0x0d11('0x4e')](_0x5bea18[_0x0d11('0x40')]);_0x3ba939({'count':_0x17f47b[_0x0d11('0x19')],'rows':_0x17f47b});});},'ChatQueues':function(_0x237224){return new Promise(function(_0x32d692,_0x2a6b03){var _0x323678=[];for(var _0x1df6e0 in _0x5bea18['chatQueues']){if(_0x5bea18[_0x0d11('0x4f')][_0x0d11('0x4a')](_0x1df6e0)){var _0x26aace=_0x5bea18[_0x0d11('0x4f')][_0x1df6e0];var _0x130278={'id':_0x26aace['id'],'available':_0x26aace[_0x0d11('0x50')],'loggedIn':_0x26aace[_0x0d11('0x51')],'name':_0x26aace[_0x0d11('0x52')],'paused':_0x26aace[_0x0d11('0x53')],'waiting':_0x26aace[_0x0d11('0x54')]};_0x323678[_0x0d11('0x21')](_0x130278);}}_0x32d692({'count':_0x323678[_0x0d11('0x19')],'rows':_0x323678});});},'MailQueues':function(_0x1719a8){return new Promise(function(_0x312e5a,_0x1cf80e){var _0x50c040=[];for(var _0x44f6fe in _0x5bea18[_0x0d11('0x55')]){if(_0x5bea18[_0x0d11('0x55')]['hasOwnProperty'](_0x44f6fe)){var _0x59d633=_0x5bea18['mailQueues'][_0x44f6fe];var _0x32179e={'id':_0x59d633['id'],'available':_0x59d633[_0x0d11('0x50')],'loggedIn':_0x59d633['loggedIn'],'name':_0x59d633[_0x0d11('0x52')],'paused':_0x59d633['paused'],'waiting':_0x59d633[_0x0d11('0x54')]};_0x50c040[_0x0d11('0x21')](_0x32179e);}}_0x312e5a({'count':_0x50c040[_0x0d11('0x19')],'rows':_0x50c040});});},'OpenchannelQueues':function(_0x6d3f9d){return new Promise(function(_0x20c1fd,_0x42b607){var _0x2c1405=[];for(var _0xae4f5e in _0x5bea18[_0x0d11('0x56')]){if(_0x5bea18[_0x0d11('0x56')][_0x0d11('0x4a')](_0xae4f5e)){var _0x3397ad=_0x5bea18[_0x0d11('0x56')][_0xae4f5e];var _0x527cd8={'id':_0x3397ad['id'],'available':_0x3397ad[_0x0d11('0x50')],'loggedIn':_0x3397ad[_0x0d11('0x51')],'name':_0x3397ad[_0x0d11('0x52')],'paused':_0x3397ad[_0x0d11('0x53')],'waiting':_0x3397ad[_0x0d11('0x54')]};_0x2c1405[_0x0d11('0x21')](_0x527cd8);}}_0x20c1fd({'count':_0x2c1405[_0x0d11('0x19')],'rows':_0x2c1405});});},'SmsQueues':function(_0x5eff2c){return new Promise(function(_0x2b5802,_0x30e7c8){var _0x363aa4=[];for(var _0xf7f940 in _0x5bea18[_0x0d11('0x57')]){if(_0x5bea18['smsQueues'][_0x0d11('0x4a')](_0xf7f940)){var _0x5889f4=_0x5bea18[_0x0d11('0x57')][_0xf7f940];var _0x3a2480={'id':_0x5889f4['id'],'available':_0x5889f4['available'],'loggedIn':_0x5889f4[_0x0d11('0x51')],'name':_0x5889f4[_0x0d11('0x52')],'paused':_0x5889f4[_0x0d11('0x53')],'waiting':_0x5889f4[_0x0d11('0x54')]};_0x363aa4[_0x0d11('0x21')](_0x3a2480);}}_0x2b5802({'count':_0x363aa4[_0x0d11('0x19')],'rows':_0x363aa4});});},'FaxQueues':function(_0x583bd9){return new Promise(function(_0x24dc5a,_0x2da184){var _0x2b0208=[];for(var _0x919193 in _0x5bea18['faxQueues']){if(_0x5bea18[_0x0d11('0x58')][_0x0d11('0x4a')](_0x919193)){var _0x3c5f72=_0x5bea18[_0x0d11('0x58')][_0x919193];var _0x4462ed={'id':_0x3c5f72['id'],'available':_0x3c5f72[_0x0d11('0x50')],'loggedIn':_0x3c5f72[_0x0d11('0x51')],'name':_0x3c5f72[_0x0d11('0x52')],'paused':_0x3c5f72[_0x0d11('0x53')],'waiting':_0x3c5f72[_0x0d11('0x54')]};_0x2b0208[_0x0d11('0x21')](_0x4462ed);}}_0x24dc5a({'count':_0x2b0208[_0x0d11('0x19')],'rows':_0x2b0208});});},'WhatsappQueues':function(_0x38e17d){return new Promise(function(_0x365604,_0x15903b){var _0x1fd444=[];for(var _0x37f8d3 in _0x5bea18[_0x0d11('0x59')]){if(_0x5bea18[_0x0d11('0x59')]['hasOwnProperty'](_0x37f8d3)){var _0x1c26ff=_0x5bea18[_0x0d11('0x59')][_0x37f8d3];var _0x2c2e6a={'id':_0x1c26ff['id'],'available':_0x1c26ff[_0x0d11('0x50')],'loggedIn':_0x1c26ff[_0x0d11('0x51')],'name':_0x1c26ff['name'],'paused':_0x1c26ff[_0x0d11('0x53')],'waiting':_0x1c26ff[_0x0d11('0x54')]};_0x1fd444[_0x0d11('0x21')](_0x2c2e6a);}}_0x365604({'count':_0x1fd444[_0x0d11('0x19')],'rows':_0x1fd444});});},'ChatQueuesWaitingInteractions':function(_0x432f5b){return new Promise(function(_0x4a1c12,_0x19d4c1){var _0x2f1600=_[_0x0d11('0x4e')](_0x5bea18[_0x0d11('0x5a')]);_0x4a1c12({'count':_0x2f1600[_0x0d11('0x19')],'rows':_0x2f1600});});},'MailQueuesWaitingInteractions':function(_0x5de3f6){return new Promise(function(_0x98df5f,_0x55c46f){var _0x14a7a8=_[_0x0d11('0x4e')](_0x5bea18[_0x0d11('0x5b')]);_0x98df5f({'count':_0x14a7a8['length'],'rows':_0x14a7a8});});},'OpenchannelQueuesWaitingInteractions':function(_0x43ab92){return new Promise(function(_0x167edc,_0x3c1e63){var _0x297d47=_['values'](_0x5bea18[_0x0d11('0x5c')]);_0x167edc({'count':_0x297d47[_0x0d11('0x19')],'rows':_0x297d47});});},'SmsQueuesWaitingInteractions':function(_0x329660){return new Promise(function(_0x1b0f25,_0x412dbe){var _0x2c9a99=_[_0x0d11('0x4e')](_0x5bea18[_0x0d11('0x5d')]);_0x1b0f25({'count':_0x2c9a99[_0x0d11('0x19')],'rows':_0x2c9a99});});},'FaxQueuesWaitingInteractions':function(_0xe86d33){return new Promise(function(_0x2ddaab,_0x43e472){var _0x105f93=_[_0x0d11('0x4e')](_0x5bea18['faxQueuesWaitingInteractions']);_0x2ddaab({'count':_0x105f93[_0x0d11('0x19')],'rows':_0x105f93});});},'WhatsappQueuesWaitingInteractions':function(_0x43b65c){return new Promise(function(_0x8331d5,_0x1f8d62){var _0x3c4928=_['values'](_0x5bea18[_0x0d11('0x5e')]);_0x8331d5({'count':_0x3c4928[_0x0d11('0x19')],'rows':_0x3c4928});});}};var _0xb8e0d2=jayson[_0x0d11('0x5f')](_0x3005f2)[_0x0d11('0x60')]();_0xb8e0d2['on'](_0x0d11('0x35'),function(_0x347c98){logger['error'](JSON[_0x0d11('0x39')](_0x347c98));return _0x266f0f(_0x347c98);});_0xb8e0d2[_0x0d11('0x13')](0x232c,_0x0d11('0x61'),function(){console[_0x0d11('0x62')]('Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232c);return _0x3c88e6(_0x0d11('0x63')+0x232c);});});};
\ No newline at end of file
index ad1a05e..663cc85 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd588=['client','request','then','error','message','result','condition','rules','length','push','Command','format','iftime\x20%s','indexOf','true','[%s][INTERVAL]\x20%s','all','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','when','catch','log','stack','util','bluebird','jayson/promise','lodash','../../../config/logger','routing'];(function(_0x2fd71a,_0x3b7db6){var _0x497a1f=function(_0x4b7808){while(--_0x4b7808){_0x2fd71a['push'](_0x2fd71a['shift']());}};_0x497a1f(++_0x3b7db6);}(_0xd588,0xea));var _0x8d58=function(_0x2e21df,_0x184e76){_0x2e21df=_0x2e21df-0x0;var _0x36930c=_0xd588[_0x2e21df];return _0x36930c;};'use strict';var util=require(_0x8d58('0x0'));var BPromise=require(_0x8d58('0x1'));var jayson=require(_0x8d58('0x2'));var _=require(_0x8d58('0x3'));var logger=require(_0x8d58('0x4'))(_0x8d58('0x5'));var client=jayson[_0x8d58('0x6')]['http']({'port':0x232a});function request(_0x264c05,_0x65b94d){return new BPromise(function(_0x2d5ca2,_0x14e3aa){return client[_0x8d58('0x7')](_0x264c05,_0x65b94d)[_0x8d58('0x8')](function(_0x15ddcb){if(_0x15ddcb[_0x8d58('0x9')]){return _0x14e3aa(_0x15ddcb[_0x8d58('0x9')][_0x8d58('0xa')]);}else{return _0x2d5ca2(_0x15ddcb[_0x8d58('0xb')]);}})['catch'](function(_0x1d344d){return _0x14e3aa(_0x1d344d);});});}exports[_0x8d58('0xc')]=function(_0x46498e,_0x277700,_0x2b707d){return function(_0x450aa1){if(_0x2b707d[_0x8d58('0xd')]&&!_0x2b707d[_0x8d58('0xd')][_0x46498e]){logger['info']('[%s][INTERVAL]\x20ROUTING\x20STOPPED',_0x46498e);return _0x450aa1['stop']();}var _0x51ae98=[];for(var _0x398611=0x0;_0x398611<_0x277700[_0x8d58('0xe')];_0x398611+=0x1){_0x51ae98[_0x8d58('0xf')](request(_0x8d58('0x10'),{'command':util[_0x8d58('0x11')](_0x8d58('0x12'),_0x277700[_0x398611])})['then'](function(_0x38e024){return _0x38e024&&_0x38e024[_0x8d58('0xa')]&&_0x38e024['message'][_0x8d58('0x13')](_0x8d58('0x14'))>=0x0?!![]:![];})['catch'](function(_0x1f6db2){logger[_0x8d58('0x9')](_0x8d58('0x15'),_0x46498e,_0x277700[_0x398611]);}));}BPromise[_0x8d58('0x16')](_0x51ae98)[_0x8d58('0x8')](function(_0xe2f8df){var _0x5bb00b=_['some'](_0xe2f8df);logger['info'](_0x8d58('0x17'),_0x46498e,_0x277700[_0x8d58('0x18')](_0x8d58('0x19')),_0x5bb00b);_0x450aa1[_0x8d58('0x1a')](_0x5bb00b);})[_0x8d58('0x1b')](function(_0x515200){console[_0x8d58('0x1c')](_0x515200);logger['error'](_0x8d58('0x17'),_0x46498e,_0x277700[_0x8d58('0x18')](_0x8d58('0x19')),_0x515200[_0x8d58('0x1d')]);_0x450aa1['stop']();});};};
\ No newline at end of file
+var _0xecf3=['result','condition','rules','stop','length','push','Command','iftime\x20%s','then','true','catch','[%s][INTERVAL]\x20%s','some','[%s][INTERVAL]\x20%s\x20%s','join','when','\x20|\x20','stack','jayson/promise','lodash','../../../config/logger','routing','request','error','message'];(function(_0x522c6d,_0x4d250d){var _0x26300d=function(_0x3ab228){while(--_0x3ab228){_0x522c6d['push'](_0x522c6d['shift']());}};_0x26300d(++_0x4d250d);}(_0xecf3,0xa8));var _0x3ecf=function(_0x3ac050,_0x37324b){_0x3ac050=_0x3ac050-0x0;var _0x8b98bd=_0xecf3[_0x3ac050];return _0x8b98bd;};'use strict';var util=require('util');var BPromise=require('bluebird');var jayson=require(_0x3ecf('0x0'));var _=require(_0x3ecf('0x1'));var logger=require(_0x3ecf('0x2'))(_0x3ecf('0x3'));var client=jayson['client']['http']({'port':0x232a});function request(_0x47c5b8,_0x1e563d){return new BPromise(function(_0x4f915d,_0x4739ab){return client[_0x3ecf('0x4')](_0x47c5b8,_0x1e563d)['then'](function(_0x25599e){if(_0x25599e[_0x3ecf('0x5')]){return _0x4739ab(_0x25599e[_0x3ecf('0x5')][_0x3ecf('0x6')]);}else{return _0x4f915d(_0x25599e[_0x3ecf('0x7')]);}})['catch'](function(_0x27328d){return _0x4739ab(_0x27328d);});});}exports[_0x3ecf('0x8')]=function(_0x3860cb,_0x28f776,_0x2717c6){return function(_0x455565){if(_0x2717c6[_0x3ecf('0x9')]&&!_0x2717c6[_0x3ecf('0x9')][_0x3860cb]){logger['info']('[%s][INTERVAL]\x20ROUTING\x20STOPPED',_0x3860cb);return _0x455565[_0x3ecf('0xa')]();}var _0x55c1c9=[];for(var _0x834dc1=0x0;_0x834dc1<_0x28f776[_0x3ecf('0xb')];_0x834dc1+=0x1){_0x55c1c9[_0x3ecf('0xc')](request(_0x3ecf('0xd'),{'command':util['format'](_0x3ecf('0xe'),_0x28f776[_0x834dc1])})[_0x3ecf('0xf')](function(_0xd0e252){return _0xd0e252&&_0xd0e252['message']&&_0xd0e252[_0x3ecf('0x6')]['indexOf'](_0x3ecf('0x10'))>=0x0?!![]:![];})[_0x3ecf('0x11')](function(_0x30b66c){logger[_0x3ecf('0x5')](_0x3ecf('0x12'),_0x3860cb,_0x28f776[_0x834dc1]);}));}BPromise['all'](_0x55c1c9)['then'](function(_0x30bc63){var _0x24037c=_[_0x3ecf('0x13')](_0x30bc63);logger['info'](_0x3ecf('0x14'),_0x3860cb,_0x28f776[_0x3ecf('0x15')]('\x20|\x20'),_0x24037c);_0x455565[_0x3ecf('0x16')](_0x24037c);})[_0x3ecf('0x11')](function(_0xda8b87){console['log'](_0xda8b87);logger['error'](_0x3ecf('0x14'),_0x3860cb,_0x28f776['join'](_0x3ecf('0x17')),_0xda8b87[_0x3ecf('0x18')]);_0x455565[_0x3ecf('0xa')]();});};};
\ No newline at end of file
index 89e9310..7058a08 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1339=['talktime','push','[%s][agents][agentringnoanswer]','queuecallerabandon','forIn','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','error','agentconnect','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','ringtime','connect','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','complete','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfer','transfertype','extension','transferuniqueid','attendedtransfer','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','ATTENDED','transferexten','origtransfererexten','transfereeuniqueid','agententerreason','calleridname','secondtransfererlinkedid','[%s][agents][attendedtransfer]\x20agent:%s','transfertargetuniqueid','clone','[%s][agents][hangup]','cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','diffTime','agent','./utils','info','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','membername','interface','calleridnum','lastevent','queue','getVoiceQueueByName','then','type','agentacw','agentcomplete','acwtime','acwTimeout','request','CreateVoiceAgentReport','destuniqueid','debug','[%s][agents][agentcalled]','agentcalledAt','now','called','connectedlinenum','connectedlinename','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','isNil','agentringnoanswer','agentringnoanswerAt','timeout','reason','holdtime'];(function(_0x188d31,_0x576e87){var _0x30ed33=function(_0x15f9a5){while(--_0x15f9a5){_0x188d31['push'](_0x188d31['shift']());}};_0x30ed33(++_0x576e87);}(_0x1339,0x1ed));var _0x9133=function(_0x545f41,_0x826859){_0x545f41=_0x545f41-0x0;var _0x18e2ab=_0x1339[_0x545f41];return _0x18e2ab;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0x9133('0x0'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x2a91b2,_0x4611be){utils[_0x9133('0x1')](util[_0x9133('0x2')](_0x9133('0x3'),_0x2a91b2[_0x9133('0x4')],_0x2a91b2[_0x9133('0x5')],_0x2a91b2['queue'],_0x2a91b2[_0x9133('0x6')],_0x2a91b2[_0x9133('0x7')],_0x2a91b2[_0x9133('0x8')],_0x2a91b2['connectedlinenum'],_0x2a91b2[_0x9133('0x9')]));if(_0x2a91b2[_0x9133('0xa')]){utils[_0x9133('0xb')](_0x2a91b2[_0x9133('0xa')])[_0x9133('0xc')](function(_0x3a7a80){if(_0x3a7a80){_0x2a91b2[_0x9133('0xd')]=_0x3a7a80[_0x9133('0xd')];_0x2a91b2[_0x9133('0xe')]=_0x2a91b2[_0x9133('0xf')]?_0x3a7a80['acw']:![];_0x2a91b2[_0x9133('0x10')]=_0x2a91b2[_0x9133('0xe')]?_0x3a7a80[_0x9133('0x11')]:0x0;}utils[_0x9133('0x12')](_0x9133('0x13'),_0x2a91b2);});}else{utils[_0x9133('0x12')]('CreateVoiceAgentReport',_0x2a91b2);}if(_0x4611be){delete transfers[_0x2a91b2[_0x9133('0x4')]];}else{delete agents[_0x2a91b2[_0x9133('0x14')]];}}exports['agentcalled']=function(_0x5283a3){try{utils[_0x9133('0x15')](util['format'](_0x9133('0x16'),_0x5283a3[_0x9133('0x4')]),_0x5283a3);agents[_0x5283a3[_0x9133('0x14')]]=_0x5283a3;agents[_0x5283a3[_0x9133('0x14')]][_0x9133('0x17')]=utils[_0x9133('0x18')]();agents[_0x5283a3['destuniqueid']][_0x9133('0x9')]=_0x9133('0x19');agents[_0x5283a3['destuniqueid']][_0x9133('0x1a')]=null;agents[_0x5283a3[_0x9133('0x14')]][_0x9133('0x1b')]=null;utils[_0x9133('0x1')](util['format'](_0x9133('0x1c'),_0x5283a3['uniqueid'],agents[_0x5283a3[_0x9133('0x14')]]['membername'],_0x5283a3[_0x9133('0x14')]));}catch(_0x1d6d0b){utils['error'](util[_0x9133('0x2')]('[%s][agents][agentcalled]',_0x5283a3[_0x9133('0x4')]),_0x1d6d0b);}};exports['agentringnoanswer']=function(_0x5e4f0c){try{if(!_[_0x9133('0x1d')](agents[_0x5e4f0c['destuniqueid']])){utils[_0x9133('0x15')](util['format']('[%s][agents][agentringnoanswer]',_0x5e4f0c['uniqueid']),_0x5e4f0c);utils[_0x9133('0x1')](util[_0x9133('0x2')]('[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout',_0x5e4f0c[_0x9133('0x4')],agents[_0x5e4f0c[_0x9133('0x14')]][_0x9133('0x6')],_0x5e4f0c[_0x9133('0x14')]));agents[_0x5e4f0c['destuniqueid']][_0x9133('0x1e')]=!![];agents[_0x5e4f0c['destuniqueid']][_0x9133('0x1f')]=utils[_0x9133('0x18')]();agents[_0x5e4f0c[_0x9133('0x14')]][_0x9133('0x9')]=_0x9133('0x20');agents[_0x5e4f0c[_0x9133('0x14')]][_0x9133('0x21')]=_0x9133('0x20');agents[_0x5e4f0c[_0x9133('0x14')]][_0x9133('0x22')]=_0x5e4f0c['ringtime']?parseInt(_0x5e4f0c['ringtime'])/0x3e8:0x0;agents[_0x5e4f0c[_0x9133('0x14')]][_0x9133('0x23')]=0x0;unanswered[_0x9133('0x24')](_0x5e4f0c[_0x9133('0x14')]);}}catch(_0x4de894){utils['error'](util[_0x9133('0x2')](_0x9133('0x25'),_0x5e4f0c[_0x9133('0x4')]),_0x4de894);}};exports[_0x9133('0x26')]=function(_0x390f50){try{_[_0x9133('0x27')](agents,function(_0x48c713,_0x58afe0){if(_0x48c713['uniqueid']==_0x390f50[_0x9133('0x4')]&&!_['includes'](unanswered,_0x48c713[_0x9133('0x14')])){utils[_0x9133('0x15')](util['format'](_0x9133('0x28'),_0x390f50['uniqueid']),_0x390f50);utils[_0x9133('0x1')](util[_0x9133('0x2')](_0x9133('0x29'),_0x390f50['uniqueid'],_0x48c713[_0x9133('0x6')],_0x48c713[_0x9133('0x14')]));_0x48c713[_0x9133('0x1e')]=!![];_0x48c713['agentringnoanswerAt']=utils[_0x9133('0x18')]();_0x48c713[_0x9133('0x9')]=_0x9133('0x2a');_0x48c713['reason']=_0x9133('0x2a');_0x48c713[_0x9133('0x22')]=_0x390f50[_0x9133('0x22')];_0x48c713[_0x9133('0x23')]=0x0;writeDB(_0x48c713);}});}catch(_0x5e4d5e){utils[_0x9133('0x2b')](util[_0x9133('0x2')]('[%s][agents][queuecallerabandon]',_0x390f50[_0x9133('0x4')]),_0x5e4d5e);}};exports[_0x9133('0x2c')]=function(_0x593fbe){try{if(agents[_0x593fbe[_0x9133('0x14')]]){utils[_0x9133('0x15')](util[_0x9133('0x2')](_0x9133('0x2d'),_0x593fbe[_0x9133('0x4')]),_0x593fbe);utils[_0x9133('0x1')](util[_0x9133('0x2')](_0x9133('0x2e'),_0x593fbe['uniqueid'],agents[_0x593fbe[_0x9133('0x14')]][_0x9133('0x6')],_0x593fbe['destuniqueid']));agents[_0x593fbe[_0x9133('0x14')]][_0x9133('0x2f')]=utils[_0x9133('0x18')]();agents[_0x593fbe[_0x9133('0x14')]][_0x9133('0x1a')]=_0x593fbe[_0x9133('0x1a')];agents[_0x593fbe['destuniqueid']]['connectedlinename']=_0x593fbe[_0x9133('0x1b')];agents[_0x593fbe[_0x9133('0x14')]][_0x9133('0x22')]=_0x593fbe[_0x9133('0x30')];agents[_0x593fbe[_0x9133('0x14')]][_0x9133('0x9')]=_0x9133('0x31');_[_0x9133('0x27')](agents,function(_0x720048,_0x5a3f73){if(_0x720048[_0x9133('0x14')]!=_0x593fbe[_0x9133('0x14')]&&_0x720048[_0x9133('0x4')]==_0x593fbe[_0x9133('0x4')]){_0x720048[_0x9133('0x23')]=0x0;_0x720048['holdtime']=_0x593fbe[_0x9133('0x30')];_0x720048[_0x9133('0x1e')]=!![];_0x720048[_0x9133('0x1f')]=utils[_0x9133('0x18')]();_0x720048['lastevent']=_0x9133('0x32');_0x720048[_0x9133('0x21')]=_0x9133('0x32');_0x720048[_0x9133('0x33')]=_0x593fbe[_0x9133('0x14')];_0x720048[_0x9133('0x34')]=_0x593fbe[_0x9133('0x6')];writeDB(_0x720048);}});}}catch(_0x4ca1a3){utils[_0x9133('0x2b')](util['format']('[%s][agents][agentconnect]',_0x593fbe[_0x9133('0x4')]),_0x4ca1a3);}};exports[_0x9133('0xf')]=function(_0x46156d){try{if(!_[_0x9133('0x1d')](agents[_0x46156d[_0x9133('0x14')]])){utils[_0x9133('0x15')](util[_0x9133('0x2')](_0x9133('0x35'),_0x46156d[_0x9133('0x4')]),_0x46156d);utils['info'](util[_0x9133('0x2')](_0x9133('0x36'),_0x46156d[_0x9133('0x4')],agents[_0x46156d['destuniqueid']]['membername'],_0x46156d[_0x9133('0x14')]));agents[_0x46156d[_0x9133('0x14')]]['agentcomplete']=!![];agents[_0x46156d[_0x9133('0x14')]][_0x9133('0x37')]=utils[_0x9133('0x18')]();agents[_0x46156d[_0x9133('0x14')]][_0x9133('0x23')]=utils['diffTime'](agents[_0x46156d[_0x9133('0x14')]][_0x9133('0x37')],agents[_0x46156d[_0x9133('0x14')]]['agentconnectAt']);agents[_0x46156d[_0x9133('0x14')]][_0x9133('0x21')]=_0x46156d['reason'];agents[_0x46156d['destuniqueid']][_0x9133('0x9')]=_0x9133('0x38');writeDB(agents[_0x46156d[_0x9133('0x14')]]);}}catch(_0x41fea9){utils[_0x9133('0x2b')](util[_0x9133('0x2')](_0x9133('0x35'),_0x46156d[_0x9133('0x4')]),_0x41fea9);}};exports[_0x9133('0x39')]=function(_0xf07fbb){try{if(!_[_0x9133('0x1d')](agents[_0xf07fbb[_0x9133('0x3a')]])){utils['debug'](util['format'](_0x9133('0x3b'),_0xf07fbb['uniqueid']),_0xf07fbb);utils[_0x9133('0x1')](util[_0x9133('0x2')](_0x9133('0x3c'),_0xf07fbb[_0x9133('0x4')],agents[_0xf07fbb['transfereruniqueid']][_0x9133('0x6')],agents[_0xf07fbb[_0x9133('0x3a')]][_0x9133('0x4')]));agents[_0xf07fbb['transfereruniqueid']][_0x9133('0x3d')]=!![];agents[_0xf07fbb[_0x9133('0x3a')]][_0x9133('0x3e')]='blind';agents[_0xf07fbb[_0x9133('0x3a')]]['transferexten']=_0xf07fbb[_0x9133('0x3f')];agents[_0xf07fbb[_0x9133('0x3a')]][_0x9133('0x40')]=agents[_0xf07fbb[_0x9133('0x3a')]]['uniqueid'];}}catch(_0x4a346c){utils[_0x9133('0x2b')](util[_0x9133('0x2')](_0x9133('0x3b'),_0xf07fbb[_0x9133('0x4')]),_0x4a346c);}};exports[_0x9133('0x41')]=function(_0x565920){try{utils['debug'](util[_0x9133('0x2')](_0x9133('0x42'),_0x565920['origtransfereruniqueid']),_0x565920);if(_0x565920[_0x9133('0x43')]==_0x565920[_0x9133('0x44')]){if(!_['isNil'](agents[_0x565920['secondtransfereruniqueid']])){utils['info'](util[_0x9133('0x2')]('[%s][agents][attendedtransfer]\x20agent:%s',_0x565920[_0x9133('0x43')],agents[_0x565920[_0x9133('0x45')]][_0x9133('0x6')]));agents[_0x565920[_0x9133('0x45')]]['transfer']=!![];agents[_0x565920[_0x9133('0x45')]]['transfertype']=_0x9133('0x46');agents[_0x565920[_0x9133('0x45')]][_0x9133('0x47')]=_0x565920[_0x9133('0x48')];agents[_0x565920[_0x9133('0x45')]][_0x9133('0x40')]=_0x565920['origtransfereruniqueid'];}if(_0x565920['transfereeuniqueid']&&agents[_0x565920['transfereeuniqueid']]){agents[_0x565920[_0x9133('0x49')]][_0x9133('0x4a')]=0x1;transfers[_0x565920[_0x9133('0x49')]]=_['clone'](agents[_0x565920[_0x9133('0x49')]]);transfers[_0x565920[_0x9133('0x49')]][_0x9133('0x8')]=agents[_0x565920[_0x9133('0x45')]][_0x9133('0x8')];transfers[_0x565920[_0x9133('0x49')]][_0x9133('0x4b')]=agents[_0x565920[_0x9133('0x45')]]['calleridname'];transfers[_0x565920[_0x9133('0x49')]]['agentcalledAt']=utils[_0x9133('0x18')]();transfers[_0x565920['transfereeuniqueid']][_0x9133('0x2f')]=utils[_0x9133('0x18')]();transfers[_0x565920['transfereeuniqueid']]['holdtime']=0x0;transfers[_0x565920[_0x9133('0x49')]][_0x9133('0x4a')]=0x2;}}else if(_0x565920[_0x9133('0x45')]==_0x565920[_0x9133('0x4c')]){if(!_[_0x9133('0x1d')](agents[_0x565920[_0x9133('0x43')]])){utils[_0x9133('0x1')](util[_0x9133('0x2')](_0x9133('0x4d'),_0x565920[_0x9133('0x43')],agents[_0x565920[_0x9133('0x43')]]['membername']));agents[_0x565920[_0x9133('0x43')]]['transfer']=!![];agents[_0x565920[_0x9133('0x43')]][_0x9133('0x3e')]=_0x9133('0x46');agents[_0x565920[_0x9133('0x43')]][_0x9133('0x47')]=_0x565920['secondtransfererexten'];agents[_0x565920[_0x9133('0x43')]][_0x9133('0x40')]=_0x565920[_0x9133('0x45')];}if(_0x565920[_0x9133('0x4e')]&&agents[_0x565920['transfertargetuniqueid']]){agents[_0x565920[_0x9133('0x4e')]][_0x9133('0x4a')]=0x1;transfers[_0x565920[_0x9133('0x4e')]]=_[_0x9133('0x4f')](agents[_0x565920['transfertargetuniqueid']]);transfers[_0x565920['transfertargetuniqueid']][_0x9133('0x8')]=agents[_0x565920[_0x9133('0x43')]][_0x9133('0x8')];transfers[_0x565920[_0x9133('0x4e')]][_0x9133('0x4b')]=agents[_0x565920[_0x9133('0x43')]]['calleridname'];transfers[_0x565920[_0x9133('0x4e')]][_0x9133('0x17')]=utils[_0x9133('0x18')]();transfers[_0x565920[_0x9133('0x4e')]]['agentconnectAt']=utils[_0x9133('0x18')]();transfers[_0x565920['transfertargetuniqueid']][_0x9133('0x22')]=0x0;transfers[_0x565920[_0x9133('0x4e')]][_0x9133('0x4a')]=0x2;}}}catch(_0x39b46d){utils[_0x9133('0x2b')](util[_0x9133('0x2')](_0x9133('0x42'),_0x565920[_0x9133('0x43')]),_0x39b46d);}};exports['hangup']=function(_0x23bd83){try{utils[_0x9133('0x15')](util[_0x9133('0x2')](_0x9133('0x50'),_0x23bd83[_0x9133('0x4')]),_0x23bd83);if(agents[_0x23bd83['uniqueid']]&&agents[_0x23bd83['uniqueid']]['reason']===_0x9133('0x20')){if(_0x23bd83[_0x9133('0x51')]==='21'){agents[_0x23bd83[_0x9133('0x4')]]['reason']=_0x9133('0x52');agents[_0x23bd83[_0x9133('0x4')]][_0x9133('0x9')]=_0x9133('0x52');}utils[_0x9133('0x1')](util[_0x9133('0x2')](_0x9133('0x53'),_0x23bd83[_0x9133('0x4')],agents[_0x23bd83['uniqueid']][_0x9133('0x6')],agents[_0x23bd83[_0x9133('0x4')]]['reason'],agents[_0x23bd83[_0x9133('0x4')]]['lastevent']));writeDB(agents[_0x23bd83[_0x9133('0x4')]]);var _0x439352=unanswered[_0x9133('0x54')](_0x23bd83[_0x9133('0x4')]);if(_0x439352>-0x1){unanswered[_0x9133('0x55')](_0x439352,0x1);}}if(transfers[_0x23bd83['uniqueid']]){transfers[_0x23bd83[_0x9133('0x4')]][_0x9133('0xf')]=!![];transfers[_0x23bd83[_0x9133('0x4')]][_0x9133('0x37')]=utils['now']();transfers[_0x23bd83[_0x9133('0x4')]][_0x9133('0x23')]=utils[_0x9133('0x56')](transfers[_0x23bd83[_0x9133('0x4')]][_0x9133('0x37')],transfers[_0x23bd83[_0x9133('0x4')]][_0x9133('0x2f')]);transfers[_0x23bd83[_0x9133('0x4')]][_0x9133('0x21')]=_0x9133('0x57');transfers[_0x23bd83[_0x9133('0x4')]]['lastevent']=_0x9133('0x38');utils[_0x9133('0x1')](util[_0x9133('0x2')](_0x9133('0x53'),_0x23bd83['uniqueid'],transfers[_0x23bd83[_0x9133('0x4')]]['membername'],transfers[_0x23bd83[_0x9133('0x4')]][_0x9133('0x21')],transfers[_0x23bd83[_0x9133('0x4')]]['lastevent']));writeDB(transfers[_0x23bd83[_0x9133('0x4')]],!![]);}if(agents[_0x23bd83[_0x9133('0x4')]]&&agents[_0x23bd83[_0x9133('0x4')]]['agentconnectAt']){agents[_0x23bd83[_0x9133('0x4')]][_0x9133('0xf')]=!![];agents[_0x23bd83['uniqueid']][_0x9133('0x37')]=utils[_0x9133('0x18')]();agents[_0x23bd83[_0x9133('0x4')]]['talktime']=utils[_0x9133('0x56')](agents[_0x23bd83['uniqueid']][_0x9133('0x37')],agents[_0x23bd83[_0x9133('0x4')]][_0x9133('0x2f')]);agents[_0x23bd83['uniqueid']][_0x9133('0x21')]=agents[_0x23bd83['uniqueid']][_0x9133('0x3d')]?_0x9133('0x3d'):_0x9133('0x57');agents[_0x23bd83[_0x9133('0x4')]][_0x9133('0x9')]=_0x9133('0x38');utils[_0x9133('0x1')](util[_0x9133('0x2')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x23bd83[_0x9133('0x4')],agents[_0x23bd83[_0x9133('0x4')]][_0x9133('0x6')],agents[_0x23bd83[_0x9133('0x4')]][_0x9133('0x21')],agents[_0x23bd83['uniqueid']][_0x9133('0x9')]));writeDB(agents[_0x23bd83[_0x9133('0x4')]]);}}catch(_0x1b66d0){utils[_0x9133('0x2b')](util['format'](_0x9133('0x50'),_0x23bd83['uniqueid']),_0x1b66d0);}};
\ No newline at end of file
+var _0x0bb5=['called','connectedlinename','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','isNil','[%s][agents][agentringnoanswer]','agentringnoanswer','agentringnoanswerAt','now','ringtime','talktime','push','queuecallerabandon','forIn','includes','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','reason','holdtime','agentconnect','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connect','answered_elsewhere','answeredelsewheremembername','agentcomplete','[%s][agents][agentcomplete]','agentcompleteAt','diffTime','complete','blindtransfer','[%s][agents][blindtransfer]','transfereruniqueid','transfer','transfertype','blind','transferexten','extension','transferuniqueid','attendedtransfer','origtransfereruniqueid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','ATTENDED','origtransfererexten','transfereeuniqueid','agententerreason','clone','calleridnum','calleridname','secondtransfererlinkedid','secondtransfererexten','transfertargetuniqueid','[%s][agents][attendedtransfer]','hangup','[%s][agents][hangup]','timeout','cause','rejected','indexOf','splice','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','lodash','util','info','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','queue','membername','connectedlinenum','lastevent','getVoiceQueueByName','type','agentacw','acw','acwtime','acwTimeout','request','CreateVoiceAgentReport','agentcalled','debug','[%s][agents][agentcalled]','destuniqueid','agentcalledAt'];(function(_0x29c6fc,_0x462633){var _0x1406ab=function(_0x2ab3d8){while(--_0x2ab3d8){_0x29c6fc['push'](_0x29c6fc['shift']());}};_0x1406ab(++_0x462633);}(_0x0bb5,0x148));var _0x50bb=function(_0x3f893c,_0x460125){_0x3f893c=_0x3f893c-0x0;var _0x492443=_0x0bb5[_0x3f893c];return _0x492443;};'use strict';var _=require(_0x50bb('0x0'));var util=require(_0x50bb('0x1'));var utils=require('./utils');var agents={};var transfers={};var unanswered=[];function writeDB(_0x5a12b6,_0x348380){utils[_0x50bb('0x2')](util[_0x50bb('0x3')](_0x50bb('0x4'),_0x5a12b6[_0x50bb('0x5')],_0x5a12b6[_0x50bb('0x6')],_0x5a12b6[_0x50bb('0x7')],_0x5a12b6[_0x50bb('0x8')],_0x5a12b6['interface'],_0x5a12b6['calleridnum'],_0x5a12b6[_0x50bb('0x9')],_0x5a12b6[_0x50bb('0xa')]));if(_0x5a12b6[_0x50bb('0x7')]){utils[_0x50bb('0xb')](_0x5a12b6['queue'])['then'](function(_0x2bede8){if(_0x2bede8){_0x5a12b6[_0x50bb('0xc')]=_0x2bede8[_0x50bb('0xc')];_0x5a12b6[_0x50bb('0xd')]=_0x5a12b6['agentcomplete']?_0x2bede8[_0x50bb('0xe')]:![];_0x5a12b6[_0x50bb('0xf')]=_0x5a12b6[_0x50bb('0xd')]?_0x2bede8[_0x50bb('0x10')]:0x0;}utils[_0x50bb('0x11')](_0x50bb('0x12'),_0x5a12b6);});}else{utils[_0x50bb('0x11')]('CreateVoiceAgentReport',_0x5a12b6);}if(_0x348380){delete transfers[_0x5a12b6[_0x50bb('0x5')]];}else{delete agents[_0x5a12b6['destuniqueid']];}}exports[_0x50bb('0x13')]=function(_0xd8ab27){try{utils[_0x50bb('0x14')](util['format'](_0x50bb('0x15'),_0xd8ab27[_0x50bb('0x5')]),_0xd8ab27);agents[_0xd8ab27[_0x50bb('0x16')]]=_0xd8ab27;agents[_0xd8ab27['destuniqueid']][_0x50bb('0x17')]=utils['now']();agents[_0xd8ab27[_0x50bb('0x16')]][_0x50bb('0xa')]=_0x50bb('0x18');agents[_0xd8ab27[_0x50bb('0x16')]][_0x50bb('0x9')]=null;agents[_0xd8ab27['destuniqueid']][_0x50bb('0x19')]=null;utils[_0x50bb('0x2')](util['format'](_0x50bb('0x1a'),_0xd8ab27['uniqueid'],agents[_0xd8ab27[_0x50bb('0x16')]][_0x50bb('0x8')],_0xd8ab27['destuniqueid']));}catch(_0x4f1c0a){utils[_0x50bb('0x1b')](util[_0x50bb('0x3')](_0x50bb('0x15'),_0xd8ab27[_0x50bb('0x5')]),_0x4f1c0a);}};exports['agentringnoanswer']=function(_0x19dc5d){try{if(!_[_0x50bb('0x1c')](agents[_0x19dc5d[_0x50bb('0x16')]])){utils['debug'](util[_0x50bb('0x3')](_0x50bb('0x1d'),_0x19dc5d[_0x50bb('0x5')]),_0x19dc5d);utils['info'](util[_0x50bb('0x3')]('[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout',_0x19dc5d[_0x50bb('0x5')],agents[_0x19dc5d[_0x50bb('0x16')]][_0x50bb('0x8')],_0x19dc5d[_0x50bb('0x16')]));agents[_0x19dc5d[_0x50bb('0x16')]][_0x50bb('0x1e')]=!![];agents[_0x19dc5d['destuniqueid']][_0x50bb('0x1f')]=utils[_0x50bb('0x20')]();agents[_0x19dc5d[_0x50bb('0x16')]][_0x50bb('0xa')]='timeout';agents[_0x19dc5d[_0x50bb('0x16')]]['reason']='timeout';agents[_0x19dc5d[_0x50bb('0x16')]]['holdtime']=_0x19dc5d['ringtime']?parseInt(_0x19dc5d[_0x50bb('0x21')])/0x3e8:0x0;agents[_0x19dc5d[_0x50bb('0x16')]][_0x50bb('0x22')]=0x0;unanswered[_0x50bb('0x23')](_0x19dc5d[_0x50bb('0x16')]);}}catch(_0x269479){utils[_0x50bb('0x1b')](util[_0x50bb('0x3')]('[%s][agents][agentringnoanswer]',_0x19dc5d[_0x50bb('0x5')]),_0x269479);}};exports[_0x50bb('0x24')]=function(_0x15ee2e){try{_[_0x50bb('0x25')](agents,function(_0x560b07,_0x13dc3c){if(_0x560b07[_0x50bb('0x5')]==_0x15ee2e[_0x50bb('0x5')]&&!_[_0x50bb('0x26')](unanswered,_0x560b07[_0x50bb('0x16')])){utils[_0x50bb('0x14')](util[_0x50bb('0x3')](_0x50bb('0x27'),_0x15ee2e[_0x50bb('0x5')]),_0x15ee2e);utils[_0x50bb('0x2')](util[_0x50bb('0x3')](_0x50bb('0x28'),_0x15ee2e['uniqueid'],_0x560b07[_0x50bb('0x8')],_0x560b07[_0x50bb('0x16')]));_0x560b07[_0x50bb('0x1e')]=!![];_0x560b07[_0x50bb('0x1f')]=utils[_0x50bb('0x20')]();_0x560b07[_0x50bb('0xa')]=_0x50bb('0x29');_0x560b07[_0x50bb('0x2a')]=_0x50bb('0x29');_0x560b07[_0x50bb('0x2b')]=_0x15ee2e[_0x50bb('0x2b')];_0x560b07['talktime']=0x0;writeDB(_0x560b07);}});}catch(_0x364ea0){utils[_0x50bb('0x1b')](util[_0x50bb('0x3')](_0x50bb('0x27'),_0x15ee2e[_0x50bb('0x5')]),_0x364ea0);}};exports[_0x50bb('0x2c')]=function(_0x53600a){try{if(agents[_0x53600a['destuniqueid']]){utils[_0x50bb('0x14')](util['format'](_0x50bb('0x2d'),_0x53600a[_0x50bb('0x5')]),_0x53600a);utils[_0x50bb('0x2')](util[_0x50bb('0x3')](_0x50bb('0x2e'),_0x53600a['uniqueid'],agents[_0x53600a[_0x50bb('0x16')]]['membername'],_0x53600a[_0x50bb('0x16')]));agents[_0x53600a[_0x50bb('0x16')]][_0x50bb('0x2f')]=utils['now']();agents[_0x53600a['destuniqueid']][_0x50bb('0x9')]=_0x53600a[_0x50bb('0x9')];agents[_0x53600a[_0x50bb('0x16')]][_0x50bb('0x19')]=_0x53600a['connectedlinename'];agents[_0x53600a[_0x50bb('0x16')]]['holdtime']=_0x53600a['ringtime'];agents[_0x53600a[_0x50bb('0x16')]]['lastevent']=_0x50bb('0x30');_[_0x50bb('0x25')](agents,function(_0x1ef231,_0x1f156e){if(_0x1ef231[_0x50bb('0x16')]!=_0x53600a[_0x50bb('0x16')]&&_0x1ef231[_0x50bb('0x5')]==_0x53600a[_0x50bb('0x5')]){_0x1ef231[_0x50bb('0x22')]=0x0;_0x1ef231[_0x50bb('0x2b')]=_0x53600a['ringtime'];_0x1ef231['agentringnoanswer']=!![];_0x1ef231[_0x50bb('0x1f')]=utils[_0x50bb('0x20')]();_0x1ef231[_0x50bb('0xa')]=_0x50bb('0x31');_0x1ef231['reason']=_0x50bb('0x31');_0x1ef231['answeredelsewheredestinationuniqueid']=_0x53600a[_0x50bb('0x16')];_0x1ef231[_0x50bb('0x32')]=_0x53600a[_0x50bb('0x8')];writeDB(_0x1ef231);}});}}catch(_0x40748d){utils[_0x50bb('0x1b')](util[_0x50bb('0x3')](_0x50bb('0x2d'),_0x53600a[_0x50bb('0x5')]),_0x40748d);}};exports[_0x50bb('0x33')]=function(_0x46c1c3){try{if(!_[_0x50bb('0x1c')](agents[_0x46c1c3[_0x50bb('0x16')]])){utils[_0x50bb('0x14')](util[_0x50bb('0x3')](_0x50bb('0x34'),_0x46c1c3[_0x50bb('0x5')]),_0x46c1c3);utils['info'](util[_0x50bb('0x3')]('[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x46c1c3[_0x50bb('0x5')],agents[_0x46c1c3[_0x50bb('0x16')]][_0x50bb('0x8')],_0x46c1c3[_0x50bb('0x16')]));agents[_0x46c1c3[_0x50bb('0x16')]][_0x50bb('0x33')]=!![];agents[_0x46c1c3[_0x50bb('0x16')]][_0x50bb('0x35')]=utils[_0x50bb('0x20')]();agents[_0x46c1c3[_0x50bb('0x16')]][_0x50bb('0x22')]=utils[_0x50bb('0x36')](agents[_0x46c1c3[_0x50bb('0x16')]][_0x50bb('0x35')],agents[_0x46c1c3['destuniqueid']][_0x50bb('0x2f')]);agents[_0x46c1c3['destuniqueid']][_0x50bb('0x2a')]=_0x46c1c3[_0x50bb('0x2a')];agents[_0x46c1c3[_0x50bb('0x16')]][_0x50bb('0xa')]=_0x50bb('0x37');writeDB(agents[_0x46c1c3[_0x50bb('0x16')]]);}}catch(_0x133dd9){utils[_0x50bb('0x1b')](util['format'](_0x50bb('0x34'),_0x46c1c3[_0x50bb('0x5')]),_0x133dd9);}};exports[_0x50bb('0x38')]=function(_0x13afe2){try{if(!_[_0x50bb('0x1c')](agents[_0x13afe2['transfereruniqueid']])){utils[_0x50bb('0x14')](util[_0x50bb('0x3')](_0x50bb('0x39'),_0x13afe2[_0x50bb('0x5')]),_0x13afe2);utils[_0x50bb('0x2')](util['format']('[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s',_0x13afe2[_0x50bb('0x5')],agents[_0x13afe2['transfereruniqueid']][_0x50bb('0x8')],agents[_0x13afe2['transfereruniqueid']][_0x50bb('0x5')]));agents[_0x13afe2[_0x50bb('0x3a')]][_0x50bb('0x3b')]=!![];agents[_0x13afe2['transfereruniqueid']][_0x50bb('0x3c')]=_0x50bb('0x3d');agents[_0x13afe2['transfereruniqueid']][_0x50bb('0x3e')]=_0x13afe2[_0x50bb('0x3f')];agents[_0x13afe2[_0x50bb('0x3a')]][_0x50bb('0x40')]=agents[_0x13afe2['transfereruniqueid']][_0x50bb('0x5')];}}catch(_0x46b51e){utils[_0x50bb('0x1b')](util[_0x50bb('0x3')](_0x50bb('0x39'),_0x13afe2['uniqueid']),_0x46b51e);}};exports[_0x50bb('0x41')]=function(_0x50943a){try{utils[_0x50bb('0x14')](util['format']('[%s][agents][attendedtransfer]',_0x50943a[_0x50bb('0x42')]),_0x50943a);if(_0x50943a['origtransfereruniqueid']==_0x50943a['origtransfererlinkedid']){if(!_[_0x50bb('0x1c')](agents[_0x50943a[_0x50bb('0x43')]])){utils[_0x50bb('0x2')](util[_0x50bb('0x3')](_0x50bb('0x44'),_0x50943a[_0x50bb('0x42')],agents[_0x50943a[_0x50bb('0x43')]][_0x50bb('0x8')]));agents[_0x50943a['secondtransfereruniqueid']]['transfer']=!![];agents[_0x50943a[_0x50bb('0x43')]][_0x50bb('0x3c')]=_0x50bb('0x45');agents[_0x50943a[_0x50bb('0x43')]][_0x50bb('0x3e')]=_0x50943a[_0x50bb('0x46')];agents[_0x50943a[_0x50bb('0x43')]]['transferuniqueid']=_0x50943a[_0x50bb('0x42')];}if(_0x50943a[_0x50bb('0x47')]&&agents[_0x50943a[_0x50bb('0x47')]]){agents[_0x50943a[_0x50bb('0x47')]][_0x50bb('0x48')]=0x1;transfers[_0x50943a['transfereeuniqueid']]=_[_0x50bb('0x49')](agents[_0x50943a[_0x50bb('0x47')]]);transfers[_0x50943a[_0x50bb('0x47')]][_0x50bb('0x4a')]=agents[_0x50943a[_0x50bb('0x43')]]['calleridnum'];transfers[_0x50943a[_0x50bb('0x47')]]['calleridname']=agents[_0x50943a['secondtransfereruniqueid']][_0x50bb('0x4b')];transfers[_0x50943a[_0x50bb('0x47')]][_0x50bb('0x17')]=utils[_0x50bb('0x20')]();transfers[_0x50943a[_0x50bb('0x47')]][_0x50bb('0x2f')]=utils[_0x50bb('0x20')]();transfers[_0x50943a[_0x50bb('0x47')]][_0x50bb('0x2b')]=0x0;transfers[_0x50943a[_0x50bb('0x47')]][_0x50bb('0x48')]=0x2;}}else if(_0x50943a['secondtransfereruniqueid']==_0x50943a[_0x50bb('0x4c')]){if(!_['isNil'](agents[_0x50943a[_0x50bb('0x42')]])){utils[_0x50bb('0x2')](util['format'](_0x50bb('0x44'),_0x50943a[_0x50bb('0x42')],agents[_0x50943a[_0x50bb('0x42')]][_0x50bb('0x8')]));agents[_0x50943a[_0x50bb('0x42')]][_0x50bb('0x3b')]=!![];agents[_0x50943a[_0x50bb('0x42')]][_0x50bb('0x3c')]='ATTENDED';agents[_0x50943a[_0x50bb('0x42')]][_0x50bb('0x3e')]=_0x50943a[_0x50bb('0x4d')];agents[_0x50943a['origtransfereruniqueid']][_0x50bb('0x40')]=_0x50943a[_0x50bb('0x43')];}if(_0x50943a[_0x50bb('0x4e')]&&agents[_0x50943a[_0x50bb('0x4e')]]){agents[_0x50943a[_0x50bb('0x4e')]][_0x50bb('0x48')]=0x1;transfers[_0x50943a['transfertargetuniqueid']]=_[_0x50bb('0x49')](agents[_0x50943a[_0x50bb('0x4e')]]);transfers[_0x50943a[_0x50bb('0x4e')]][_0x50bb('0x4a')]=agents[_0x50943a[_0x50bb('0x42')]][_0x50bb('0x4a')];transfers[_0x50943a['transfertargetuniqueid']][_0x50bb('0x4b')]=agents[_0x50943a[_0x50bb('0x42')]][_0x50bb('0x4b')];transfers[_0x50943a[_0x50bb('0x4e')]][_0x50bb('0x17')]=utils[_0x50bb('0x20')]();transfers[_0x50943a[_0x50bb('0x4e')]][_0x50bb('0x2f')]=utils[_0x50bb('0x20')]();transfers[_0x50943a['transfertargetuniqueid']][_0x50bb('0x2b')]=0x0;transfers[_0x50943a[_0x50bb('0x4e')]][_0x50bb('0x48')]=0x2;}}}catch(_0x2d2463){utils[_0x50bb('0x1b')](util[_0x50bb('0x3')](_0x50bb('0x4f'),_0x50943a[_0x50bb('0x42')]),_0x2d2463);}};exports[_0x50bb('0x50')]=function(_0x578ff3){try{utils['debug'](util['format'](_0x50bb('0x51'),_0x578ff3['uniqueid']),_0x578ff3);if(agents[_0x578ff3['uniqueid']]&&agents[_0x578ff3[_0x50bb('0x5')]][_0x50bb('0x2a')]===_0x50bb('0x52')){if(_0x578ff3[_0x50bb('0x53')]==='21'){agents[_0x578ff3['uniqueid']][_0x50bb('0x2a')]=_0x50bb('0x54');agents[_0x578ff3['uniqueid']][_0x50bb('0xa')]='rejected';}utils[_0x50bb('0x2')](util[_0x50bb('0x3')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x578ff3[_0x50bb('0x5')],agents[_0x578ff3['uniqueid']][_0x50bb('0x8')],agents[_0x578ff3[_0x50bb('0x5')]]['reason'],agents[_0x578ff3[_0x50bb('0x5')]][_0x50bb('0xa')]));writeDB(agents[_0x578ff3[_0x50bb('0x5')]]);var _0x51142c=unanswered[_0x50bb('0x55')](_0x578ff3[_0x50bb('0x5')]);if(_0x51142c>-0x1){unanswered[_0x50bb('0x56')](_0x51142c,0x1);}}if(transfers[_0x578ff3[_0x50bb('0x5')]]){transfers[_0x578ff3['uniqueid']][_0x50bb('0x33')]=!![];transfers[_0x578ff3[_0x50bb('0x5')]]['agentcompleteAt']=utils['now']();transfers[_0x578ff3[_0x50bb('0x5')]][_0x50bb('0x22')]=utils['diffTime'](transfers[_0x578ff3[_0x50bb('0x5')]][_0x50bb('0x35')],transfers[_0x578ff3[_0x50bb('0x5')]][_0x50bb('0x2f')]);transfers[_0x578ff3[_0x50bb('0x5')]]['reason']='agent';transfers[_0x578ff3[_0x50bb('0x5')]][_0x50bb('0xa')]=_0x50bb('0x37');utils[_0x50bb('0x2')](util['format'](_0x50bb('0x57'),_0x578ff3['uniqueid'],transfers[_0x578ff3[_0x50bb('0x5')]][_0x50bb('0x8')],transfers[_0x578ff3[_0x50bb('0x5')]][_0x50bb('0x2a')],transfers[_0x578ff3[_0x50bb('0x5')]][_0x50bb('0xa')]));writeDB(transfers[_0x578ff3[_0x50bb('0x5')]],!![]);}if(agents[_0x578ff3['uniqueid']]&&agents[_0x578ff3[_0x50bb('0x5')]][_0x50bb('0x2f')]){agents[_0x578ff3[_0x50bb('0x5')]][_0x50bb('0x33')]=!![];agents[_0x578ff3[_0x50bb('0x5')]][_0x50bb('0x35')]=utils[_0x50bb('0x20')]();agents[_0x578ff3['uniqueid']][_0x50bb('0x22')]=utils[_0x50bb('0x36')](agents[_0x578ff3[_0x50bb('0x5')]][_0x50bb('0x35')],agents[_0x578ff3[_0x50bb('0x5')]]['agentconnectAt']);agents[_0x578ff3['uniqueid']][_0x50bb('0x2a')]=agents[_0x578ff3['uniqueid']][_0x50bb('0x3b')]?_0x50bb('0x3b'):'agent';agents[_0x578ff3['uniqueid']][_0x50bb('0xa')]=_0x50bb('0x37');utils[_0x50bb('0x2')](util['format'](_0x50bb('0x57'),_0x578ff3[_0x50bb('0x5')],agents[_0x578ff3[_0x50bb('0x5')]][_0x50bb('0x8')],agents[_0x578ff3[_0x50bb('0x5')]][_0x50bb('0x2a')],agents[_0x578ff3[_0x50bb('0x5')]]['lastevent']));writeDB(agents[_0x578ff3['uniqueid']]);}}catch(_0x28c99d){utils[_0x50bb('0x1b')](util[_0x50bb('0x3')](_0x50bb('0x51'),_0x578ff3[_0x50bb('0x5')]),_0x28c99d);}};
\ No newline at end of file
index baabb6c..2c8e54e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x672a=['disposition','hangup','[%s][calls][hangup]','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','endtime','duration','diffTime','starttime','billableseconds','attendedtransfer','[%s][calls][attendedtransfer]','origtransfereruniqueid','localtwolinkedid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','_attended','destinationchannel','origtransfererchannel','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstop','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','[%s][calls][musiconholdstop]','[%s][calls][varset]','xmd-originatecalleridnum','value','source','variable','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','\x22\x20<','xmd-callerid-preview','xmd-callerid','callerid','xmd-queue','xmcs-queue','[%s][calls][varset]\x20variable:%s\x20value:%s','lastapplication','lastdata','queue','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','cdr','split','lastIndexOf','includes','execif','gotoif','lodash','util','./utils','./transfers.controller','NO\x20ANSWER','FAILED','ANSWERED','blinds','uniqueid','transfereeuniqueid','info','format','channel','membername','interface','calleridnum','connectedlinenum','lastevent','accountcode','getUserByInternal','then','UserId','request','CreateVoiceCallReport','recording','debug','[%s][calls][newchannel]','linkedid','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','now','DOCUMENTATION','error','newstate','[%s][calls][newstate]','isNil','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','channelstate','transfer','answertime'];(function(_0x13b02f,_0x462a53){var _0x12e9a6=function(_0x187d57){while(--_0x187d57){_0x13b02f['push'](_0x13b02f['shift']());}};_0x12e9a6(++_0x462a53);}(_0x672a,0x122));var _0xa672=function(_0x489243,_0x256a8a){_0x489243=_0x489243-0x0;var _0x70acca=_0x672a[_0x489243];return _0x70acca;};'use strict';var _=require(_0xa672('0x0'));var util=require(_0xa672('0x1'));var utils=require(_0xa672('0x2'));var transfers=require(_0xa672('0x3'));var dispositions=[_0xa672('0x4'),_0xa672('0x5'),_0xa672('0x5'),_0xa672('0x4'),_0xa672('0x4'),_0xa672('0x4'),_0xa672('0x6'),'BUSY',_0xa672('0x5'),_0xa672('0x5'),_0xa672('0x5')];var channels={};function writeDB(_0x33dd0c){var _0x13402c;if(transfers[_0xa672('0x7')][_0x33dd0c[_0xa672('0x8')]]){_0x13402c=_0x33dd0c[_0xa672('0x8')];_0x33dd0c[_0xa672('0x8')]=transfers[_0xa672('0x7')][_0x33dd0c[_0xa672('0x8')]][_0xa672('0x9')];}utils[_0xa672('0xa')](util[_0xa672('0xb')]('[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x33dd0c[_0xa672('0x8')],_0x33dd0c[_0xa672('0xc')],_0x33dd0c['queue'],_0x33dd0c[_0xa672('0xd')],_0x33dd0c[_0xa672('0xe')],_0x33dd0c[_0xa672('0xf')],_0x33dd0c[_0xa672('0x10')],_0x33dd0c[_0xa672('0x11')]));if(_0x33dd0c[_0xa672('0x12')]){utils[_0xa672('0x13')](_0x33dd0c[_0xa672('0x12')])[_0xa672('0x14')](function(_0x540a20){if(_0x540a20){_0x33dd0c[_0xa672('0x15')]=_0x540a20['id'];}utils[_0xa672('0x16')]('CreateVoiceCallReport',_0x33dd0c);});}else{utils['request'](_0xa672('0x17'),_0x33dd0c);}if(channels[_0x33dd0c['uniqueid']]){delete channels[_0x33dd0c['uniqueid']];}else if(_0x13402c&&channels[_0x13402c]){if(!transfers['blinds'][_0x13402c][_0xa672('0x18')])delete transfers['blinds'][_0x13402c];delete channels[_0x13402c];}}exports['newchannel']=function(_0x1c6763){try{utils[_0xa672('0x19')](util[_0xa672('0xb')](_0xa672('0x1a'),_0x1c6763[_0xa672('0x8')]),_0x1c6763);if(_0x1c6763[_0xa672('0x8')]==_0x1c6763[_0xa672('0x1b')]&&_0x1c6763[_0xa672('0xc')]!=_0xa672('0x1c')){utils[_0xa672('0xa')](util['format'](_0xa672('0x1d'),_0x1c6763[_0xa672('0x8')],_0x1c6763[_0xa672('0x1e')],_0x1c6763[_0xa672('0x1f')]));channels[_0x1c6763[_0xa672('0x8')]]={'uniqueid':_0x1c6763[_0xa672('0x8')],'accountcode':_0x1c6763['accountcode'],'source':_0x1c6763[_0xa672('0xf')],'destination':_0x1c6763[_0xa672('0x1f')],'destinationcontext':_0x1c6763[_0xa672('0x1e')],'channel':_0x1c6763[_0xa672('0xc')],'starttime':utils[_0xa672('0x20')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':'NO\x20ANSWER','amaflags':_0xa672('0x21')};}}catch(_0x140537){utils[_0xa672('0x22')](util[_0xa672('0xb')]('[%s][calls][newchannel]',_0x1c6763['uniqueid']),_0x140537);}};exports[_0xa672('0x23')]=function(_0x5afae9){try{utils[_0xa672('0x19')](util[_0xa672('0xb')](_0xa672('0x24'),_0x5afae9[_0xa672('0x8')]),_0x5afae9);if(!_[_0xa672('0x25')](channels[_0x5afae9[_0xa672('0x8')]])&&_0x5afae9['channelstate']==0x6){utils['info'](util[_0xa672('0xb')](_0xa672('0x26'),_0x5afae9[_0xa672('0x8')],_0x5afae9['context'],_0x5afae9[_0xa672('0xc')]));if(_[_0xa672('0x25')](channels[_0x5afae9['uniqueid']][_0xa672('0x27')])){channels[_0x5afae9[_0xa672('0x8')]]['systemanswertime']=utils[_0xa672('0x20')]();}}else if(!_[_0xa672('0x25')](channels[_0x5afae9[_0xa672('0x1b')]])&&_0x5afae9[_0xa672('0x28')]==0x6&&_0x5afae9[_0xa672('0x1e')]!=_0xa672('0x29')){utils[_0xa672('0xa')](util[_0xa672('0xb')]('[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x5afae9[_0xa672('0x8')],_0x5afae9[_0xa672('0x1b')],_0x5afae9[_0xa672('0x1e')],_0x5afae9[_0xa672('0xc')]));channels[_0x5afae9[_0xa672('0x1b')]][_0xa672('0x12')]=_0x5afae9['accountcode'];channels[_0x5afae9[_0xa672('0x1b')]]['destinationchannel']=_0x5afae9[_0xa672('0xc')];if(_[_0xa672('0x25')](channels[_0x5afae9[_0xa672('0x1b')]][_0xa672('0x2a')])){channels[_0x5afae9[_0xa672('0x1b')]]['answertime']=utils['now']();}channels[_0x5afae9['linkedid']][_0xa672('0x2b')]=dispositions[_['toNumber'](_0x5afae9[_0xa672('0x28')])]||_0xa672('0x6');}}catch(_0x400ff6){utils[_0xa672('0x22')](util['format'](_0xa672('0x24'),_0x5afae9[_0xa672('0x8')]),_0x400ff6);}};exports[_0xa672('0x2c')]=function(_0x30857a){try{if(!_['isNil'](channels[_0x30857a['uniqueid']])){utils[_0xa672('0x19')](util[_0xa672('0xb')](_0xa672('0x2d'),_0x30857a[_0xa672('0x8')]),_0x30857a);if(_[_0xa672('0x25')](channels[_0x30857a[_0xa672('0x8')]]['callerid'])){channels[_0x30857a[_0xa672('0x8')]]['callerid']=_0x30857a[_0xa672('0x2e')]+'\x20<'+_0x30857a[_0xa672('0xf')]+'>';}utils[_0xa672('0xa')](util[_0xa672('0xb')](_0xa672('0x2f'),_0x30857a[_0xa672('0x8')],channels[_0x30857a['uniqueid']]['callerid'],_0x30857a[_0xa672('0x30')]));channels[_0x30857a[_0xa672('0x8')]][_0xa672('0x31')]=utils[_0xa672('0x20')]();channels[_0x30857a[_0xa672('0x8')]][_0xa672('0x32')]=utils[_0xa672('0x33')](channels[_0x30857a[_0xa672('0x8')]][_0xa672('0x31')],channels[_0x30857a[_0xa672('0x8')]][_0xa672('0x34')]);channels[_0x30857a[_0xa672('0x8')]][_0xa672('0x35')]=channels[_0x30857a['uniqueid']][_0xa672('0x2a')]?utils['diffTime'](channels[_0x30857a[_0xa672('0x8')]][_0xa672('0x31')],channels[_0x30857a[_0xa672('0x8')]]['answertime']):0x0;writeDB(channels[_0x30857a[_0xa672('0x8')]]);}}catch(_0x554428){utils[_0xa672('0x22')](util[_0xa672('0xb')](_0xa672('0x2d'),_0x30857a[_0xa672('0x8')]),_0x554428);}};exports[_0xa672('0x36')]=function(_0x40ffff){try{if(!_[_0xa672('0x25')](channels[_0x40ffff['localtwolinkedid']])){utils[_0xa672('0x19')](util[_0xa672('0xb')](_0xa672('0x37'),_0x40ffff[_0xa672('0x38')]),_0x40ffff);if(channels[_0x40ffff[_0xa672('0x39')]][_0xa672('0xc')]==_0x40ffff[_0xa672('0x3a')]){utils[_0xa672('0xa')](util['format'](_0xa672('0x3b'),_0x40ffff[_0xa672('0x38')],_0x40ffff['localtwolinkedid'],_0x40ffff[_0xa672('0x3c')]));channels[_0x40ffff[_0xa672('0x39')]]['destinationchannel']=_0x40ffff[_0xa672('0x3c')];channels[_0x40ffff[_0xa672('0x39')]]['userfield']=_0xa672('0x3d');}else if(channels[_0x40ffff['localtwolinkedid']][_0xa672('0xc')]=_0x40ffff['transfertargetchannel']){utils[_0xa672('0xa')](util[_0xa672('0xb')](_0xa672('0x3b'),_0x40ffff[_0xa672('0x38')],_0x40ffff['localtwolinkedid'],_0x40ffff['origtransfererchannel']));channels[_0x40ffff[_0xa672('0x39')]][_0xa672('0x3e')]=_0x40ffff[_0xa672('0x3f')];channels[_0x40ffff[_0xa672('0x39')]]['userfield']=_0xa672('0x3d');}}}catch(_0xbf7cf1){utils['error'](util['format']('[%s][calls][attendedtransfer]',_0x40ffff[_0xa672('0x38')]),_0xbf7cf1);}};exports[_0xa672('0x40')]=function(_0x36ee4c){try{if(!_['isNil'](channels[_0x36ee4c[_0xa672('0x8')]])){utils[_0xa672('0x19')](util['format'](_0xa672('0x41'),_0x36ee4c['uniqueid']),_0x36ee4c);channels[_0x36ee4c['uniqueid']][_0xa672('0x42')]=utils[_0xa672('0x20')]();utils[_0xa672('0xa')](util[_0xa672('0xb')](_0xa672('0x43'),_0x36ee4c[_0xa672('0x8')],channels[_0x36ee4c[_0xa672('0x8')]][_0xa672('0x42')]));}}catch(_0x5ca3c2){utils[_0xa672('0x22')](util['format']('[%s][calls][musiconholdstart]',_0x36ee4c[_0xa672('0x8')]),_0x5ca3c2);}};exports[_0xa672('0x44')]=function(_0x2ae502){try{if(!_[_0xa672('0x25')](channels[_0x2ae502[_0xa672('0x8')]])){utils[_0xa672('0x19')](util['format']('[%s][calls][musiconholdstop]',_0x2ae502[_0xa672('0x8')]),_0x2ae502);if(!_[_0xa672('0x25')](channels[_0x2ae502[_0xa672('0x8')]][_0xa672('0x42')])){channels[_0x2ae502[_0xa672('0x8')]][_0xa672('0x45')]+=utils[_0xa672('0x33')](utils[_0xa672('0x20')](),channels[_0x2ae502[_0xa672('0x8')]][_0xa672('0x42')]);utils[_0xa672('0xa')](util[_0xa672('0xb')](_0xa672('0x46'),_0x2ae502[_0xa672('0x8')],channels[_0x2ae502[_0xa672('0x8')]][_0xa672('0x45')]));delete channels[_0x2ae502[_0xa672('0x8')]][_0xa672('0x42')];}}}catch(_0x5d115b){utils[_0xa672('0x22')](util['format'](_0xa672('0x47'),_0x2ae502['uniqueid']),_0x5d115b);}};exports['varset']=function(_0x77f195){try{if(!_[_0xa672('0x25')](channels[_0x77f195['uniqueid']])){utils[_0xa672('0x19')](util['format'](_0xa672('0x48'),_0x77f195[_0xa672('0x8')]),_0x77f195);if(!_['isNil'](_0x77f195['variable'][_0xa672('0x49')])){utils['info'](util[_0xa672('0xb')]('[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s',_0x77f195[_0xa672('0x8')],_0x77f195[_0xa672('0x4a')]));channels[_0x77f195['uniqueid']][_0xa672('0x4b')]=_0x77f195[_0xa672('0x4a')];}if(!_[_0xa672('0x25')](_0x77f195[_0xa672('0x4c')][_0xa672('0x4d')])){utils['info'](util[_0xa672('0xb')](_0xa672('0x4e'),_0x77f195[_0xa672('0x8')],_0x77f195['value']));channels[_0x77f195[_0xa672('0x8')]][_0xa672('0x4f')]=_0x77f195[_0xa672('0x4a')];channels[_0x77f195['uniqueid']]['callerid']='\x22'+_0x77f195[_0xa672('0x4a')]+_0xa672('0x50')+_0x77f195['value']+'>';}if(!_[_0xa672('0x25')](_0x77f195[_0xa672('0x4c')][_0xa672('0x51')])||!_[_0xa672('0x25')](_0x77f195[_0xa672('0x4c')]['xmd-callerid'])){utils[_0xa672('0xa')](util['format']('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x77f195[_0xa672('0x8')],!_[_0xa672('0x25')](_0x77f195[_0xa672('0x4c')][_0xa672('0x51')])?_0xa672('0x51'):_0xa672('0x52'),_0x77f195[_0xa672('0x4a')]));channels[_0x77f195['uniqueid']][_0xa672('0x53')]=_0x77f195[_0xa672('0x4a')];}if(!_[_0xa672('0x25')](_0x77f195[_0xa672('0x4c')][_0xa672('0x54')])||!_['isNil'](_0x77f195['variable'][_0xa672('0x55')])){utils[_0xa672('0xa')](util['format'](_0xa672('0x56'),_0x77f195[_0xa672('0x8')],!_[_0xa672('0x25')](_0x77f195['variable'][_0xa672('0x54')])?'xmd-queue':_0xa672('0x55'),_0x77f195[_0xa672('0x4a')]));channels[_0x77f195[_0xa672('0x8')]][_0xa672('0x57')]='Queue';channels[_0x77f195['uniqueid']][_0xa672('0x58')]=_0x77f195[_0xa672('0x4a')];channels[_0x77f195[_0xa672('0x8')]][_0xa672('0x59')]=!![];}if(!_[_0xa672('0x25')](_0x77f195['variable']['xmd-contactid'])){utils[_0xa672('0xa')](util['format'](_0xa672('0x5a'),_0x77f195[_0xa672('0x8')],_0x77f195[_0xa672('0x4a')]));channels[_0x77f195[_0xa672('0x8')]][_0xa672('0x5b')]=_0x77f195[_0xa672('0x4a')];}if(!_[_0xa672('0x25')](_0x77f195['variable'][_0xa672('0x5c')])){utils[_0xa672('0xa')](util[_0xa672('0xb')](_0xa672('0x5d'),_0x77f195['uniqueid'],_0x77f195[_0xa672('0x4a')]));channels[_0x77f195[_0xa672('0x8')]]['type']=_0x77f195[_0xa672('0x4a')];}if(!_[_0xa672('0x25')](_0x77f195[_0xa672('0x4c')][_0xa672('0x5e')])){utils['info'](util['format'](_0xa672('0x5f'),_0x77f195[_0xa672('0x8')],_0x77f195[_0xa672('0x4a')]));channels[_0x77f195[_0xa672('0x8')]][_0xa672('0x60')]=_0x77f195['value'];}if(!_[_0xa672('0x25')](_0x77f195['variable'][_0xa672('0x61')])){utils[_0xa672('0xa')](util[_0xa672('0xb')](_0xa672('0x62'),_0x77f195[_0xa672('0x8')],_0x77f195['value']));channels[_0x77f195[_0xa672('0x8')]][_0xa672('0x61')]=_0x77f195[_0xa672('0x4a')];}}}catch(_0x4e0ae3){utils[_0xa672('0x22')](util[_0xa672('0xb')]('[%s][calls][varset]',_0x77f195[_0xa672('0x8')]),_0x4e0ae3);}};exports['newexten']=function(_0x2b6e26){try{if(!_[_0xa672('0x25')](channels[_0x2b6e26[_0xa672('0x8')]])){utils[_0xa672('0x19')](util['format'](_0xa672('0x63'),_0x2b6e26['uniqueid']),_0x2b6e26);utils[_0xa672('0xa')](util['format'](_0xa672('0x64'),_0x2b6e26['uniqueid'],_0x2b6e26[_0xa672('0x65')],_0x2b6e26[_0xa672('0x66')]));if(_0x2b6e26[_0xa672('0x65')][_0xa672('0x67')]()==_0xa672('0x68')&&_['startsWith'](_0x2b6e26[_0xa672('0x66')][_0xa672('0x67')](),_0xa672('0x69'))){var _0x3737d0=_0x2b6e26[_0xa672('0x66')][_0xa672('0x6a')]('=');var _0x1b9283=_0x3737d0[0x0]['substring'](_0x3737d0[0x0][_0xa672('0x6b')]('(')+0x1,_0x3737d0[0x0]['lastIndexOf'](')'));var _0x1713d4=_0x3737d0[0x1];channels[_0x2b6e26[_0xa672('0x8')]][_0x1b9283]=_0x1713d4;}if(!_[_0xa672('0x6c')]([_0xa672('0x2c'),'noop',_0xa672('0x6d'),_0xa672('0x68'),_0xa672('0x6e')],_0x2b6e26['application'][_0xa672('0x67')]())){channels[_0x2b6e26['uniqueid']]['lastapplication']=_0x2b6e26[_0xa672('0x65')];channels[_0x2b6e26[_0xa672('0x8')]][_0xa672('0x58')]=_0x2b6e26[_0xa672('0x66')];}}}catch(_0x53ad38){utils['error'](util[_0xa672('0xb')]('[%s][calls][newexten]',_0x2b6e26['uniqueid']),_0x53ad38);}};
\ No newline at end of file
+var _0xbd5d=['[%s][calls][hangup]\x20callerid:%s\x20reason:%s','endtime','duration','diffTime','starttime','attendedtransfer','localtwolinkedid','debug','[%s][calls][attendedtransfer]','origtransfereruniqueid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','userfield','_attended','transfertargetchannel','origtransfererchannel','musiconholdstart','[%s][calls][musiconholdstart]','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstop','[%s][calls][musiconholdstop]','musiconholdstartAt','[%s][calls][musiconholdstop]\x20mohtime:%s','varset','variable','xmd-originatecalleridnum','value','source','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','\x22\x20<','xmd-callerid-preview','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-queue','xmcs-queue','lastapplication','lastdata','queue','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','type','outboundrouteid','routeid','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','[%s][calls][varset]','newexten','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','appdata','set','cdr','split','substring','lastIndexOf','execif','gotoif','toLowerCase','application','lodash','util','./transfers.controller','FAILED','NO\x20ANSWER','ANSWERED','BUSY','blinds','uniqueid','transfereeuniqueid','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','membername','calleridnum','connectedlinenum','lastevent','accountcode','then','UserId','request','CreateVoiceCallReport','recording','newchannel','[%s][calls][newchannel]','linkedid','channel','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','exten','now','DOCUMENTATION','error','[%s][calls][newstate]\x20context:%s\x20channel:%s','context','isNil','systemanswertime','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','toNumber','channelstate','hangup','[%s][calls][hangup]','callerid','calleridname'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xbd5d,0x118));var _0xdbd5=function(_0x7aed10,_0x4b40d7){_0x7aed10=_0x7aed10-0x0;var _0x3e224e=_0xbd5d[_0x7aed10];return _0x3e224e;};'use strict';var _=require(_0xdbd5('0x0'));var util=require(_0xdbd5('0x1'));var utils=require('./utils');var transfers=require(_0xdbd5('0x2'));var dispositions=['NO\x20ANSWER','FAILED',_0xdbd5('0x3'),_0xdbd5('0x4'),_0xdbd5('0x4'),_0xdbd5('0x4'),_0xdbd5('0x5'),_0xdbd5('0x6'),_0xdbd5('0x3'),_0xdbd5('0x3'),_0xdbd5('0x3')];var channels={};function writeDB(_0xc2b019){var _0x26ef60;if(transfers[_0xdbd5('0x7')][_0xc2b019[_0xdbd5('0x8')]]){_0x26ef60=_0xc2b019[_0xdbd5('0x8')];_0xc2b019[_0xdbd5('0x8')]=transfers[_0xdbd5('0x7')][_0xc2b019['uniqueid']][_0xdbd5('0x9')];}utils[_0xdbd5('0xa')](util[_0xdbd5('0xb')](_0xdbd5('0xc'),_0xc2b019[_0xdbd5('0x8')],_0xc2b019['channel'],_0xc2b019['queue'],_0xc2b019[_0xdbd5('0xd')],_0xc2b019['interface'],_0xc2b019[_0xdbd5('0xe')],_0xc2b019[_0xdbd5('0xf')],_0xc2b019[_0xdbd5('0x10')]));if(_0xc2b019[_0xdbd5('0x11')]){utils['getUserByInternal'](_0xc2b019['accountcode'])[_0xdbd5('0x12')](function(_0x5cca87){if(_0x5cca87){_0xc2b019[_0xdbd5('0x13')]=_0x5cca87['id'];}utils[_0xdbd5('0x14')](_0xdbd5('0x15'),_0xc2b019);});}else{utils[_0xdbd5('0x14')](_0xdbd5('0x15'),_0xc2b019);}if(channels[_0xc2b019['uniqueid']]){delete channels[_0xc2b019['uniqueid']];}else if(_0x26ef60&&channels[_0x26ef60]){if(!transfers[_0xdbd5('0x7')][_0x26ef60][_0xdbd5('0x16')])delete transfers['blinds'][_0x26ef60];delete channels[_0x26ef60];}}exports[_0xdbd5('0x17')]=function(_0x13b367){try{utils['debug'](util[_0xdbd5('0xb')](_0xdbd5('0x18'),_0x13b367[_0xdbd5('0x8')]),_0x13b367);if(_0x13b367[_0xdbd5('0x8')]==_0x13b367[_0xdbd5('0x19')]&&_0x13b367[_0xdbd5('0x1a')]!=_0xdbd5('0x1b')){utils['info'](util[_0xdbd5('0xb')](_0xdbd5('0x1c'),_0x13b367[_0xdbd5('0x8')],_0x13b367['context'],_0x13b367[_0xdbd5('0x1d')]));channels[_0x13b367['uniqueid']]={'uniqueid':_0x13b367[_0xdbd5('0x8')],'accountcode':_0x13b367[_0xdbd5('0x11')],'source':_0x13b367[_0xdbd5('0xe')],'destination':_0x13b367[_0xdbd5('0x1d')],'destinationcontext':_0x13b367['context'],'channel':_0x13b367[_0xdbd5('0x1a')],'starttime':utils[_0xdbd5('0x1e')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':'NO\x20ANSWER','amaflags':_0xdbd5('0x1f')};}}catch(_0x2d1b37){utils[_0xdbd5('0x20')](util[_0xdbd5('0xb')]('[%s][calls][newchannel]',_0x13b367['uniqueid']),_0x2d1b37);}};exports['newstate']=function(_0x1cc80e){try{utils['debug'](util[_0xdbd5('0xb')]('[%s][calls][newstate]',_0x1cc80e[_0xdbd5('0x8')]),_0x1cc80e);if(!_['isNil'](channels[_0x1cc80e[_0xdbd5('0x8')]])&&_0x1cc80e['channelstate']==0x6){utils[_0xdbd5('0xa')](util[_0xdbd5('0xb')](_0xdbd5('0x21'),_0x1cc80e[_0xdbd5('0x8')],_0x1cc80e[_0xdbd5('0x22')],_0x1cc80e[_0xdbd5('0x1a')]));if(_[_0xdbd5('0x23')](channels[_0x1cc80e[_0xdbd5('0x8')]][_0xdbd5('0x24')])){channels[_0x1cc80e[_0xdbd5('0x8')]][_0xdbd5('0x24')]=utils[_0xdbd5('0x1e')]();}}else if(!_[_0xdbd5('0x23')](channels[_0x1cc80e[_0xdbd5('0x19')]])&&_0x1cc80e['channelstate']==0x6&&_0x1cc80e['context']!=_0xdbd5('0x25')){utils[_0xdbd5('0xa')](util[_0xdbd5('0xb')](_0xdbd5('0x26'),_0x1cc80e[_0xdbd5('0x8')],_0x1cc80e[_0xdbd5('0x19')],_0x1cc80e[_0xdbd5('0x22')],_0x1cc80e[_0xdbd5('0x1a')]));channels[_0x1cc80e[_0xdbd5('0x19')]][_0xdbd5('0x11')]=_0x1cc80e[_0xdbd5('0x11')];channels[_0x1cc80e[_0xdbd5('0x19')]][_0xdbd5('0x27')]=_0x1cc80e['channel'];if(_['isNil'](channels[_0x1cc80e[_0xdbd5('0x19')]][_0xdbd5('0x28')])){channels[_0x1cc80e['linkedid']]['answertime']=utils[_0xdbd5('0x1e')]();}channels[_0x1cc80e[_0xdbd5('0x19')]]['disposition']=dispositions[_[_0xdbd5('0x29')](_0x1cc80e[_0xdbd5('0x2a')])]||'ANSWERED';}}catch(_0x12436c){utils[_0xdbd5('0x20')](util[_0xdbd5('0xb')]('[%s][calls][newstate]',_0x1cc80e[_0xdbd5('0x8')]),_0x12436c);}};exports[_0xdbd5('0x2b')]=function(_0x5bdb13){try{if(!_[_0xdbd5('0x23')](channels[_0x5bdb13[_0xdbd5('0x8')]])){utils['debug'](util['format'](_0xdbd5('0x2c'),_0x5bdb13['uniqueid']),_0x5bdb13);if(_[_0xdbd5('0x23')](channels[_0x5bdb13[_0xdbd5('0x8')]][_0xdbd5('0x2d')])){channels[_0x5bdb13[_0xdbd5('0x8')]]['callerid']=_0x5bdb13[_0xdbd5('0x2e')]+'\x20<'+_0x5bdb13['calleridnum']+'>';}utils['info'](util[_0xdbd5('0xb')](_0xdbd5('0x2f'),_0x5bdb13['uniqueid'],channels[_0x5bdb13[_0xdbd5('0x8')]][_0xdbd5('0x2d')],_0x5bdb13['cause-txt']));channels[_0x5bdb13[_0xdbd5('0x8')]][_0xdbd5('0x30')]=utils[_0xdbd5('0x1e')]();channels[_0x5bdb13[_0xdbd5('0x8')]][_0xdbd5('0x31')]=utils[_0xdbd5('0x32')](channels[_0x5bdb13[_0xdbd5('0x8')]][_0xdbd5('0x30')],channels[_0x5bdb13[_0xdbd5('0x8')]][_0xdbd5('0x33')]);channels[_0x5bdb13[_0xdbd5('0x8')]]['billableseconds']=channels[_0x5bdb13['uniqueid']]['answertime']?utils[_0xdbd5('0x32')](channels[_0x5bdb13[_0xdbd5('0x8')]][_0xdbd5('0x30')],channels[_0x5bdb13[_0xdbd5('0x8')]]['answertime']):0x0;writeDB(channels[_0x5bdb13['uniqueid']]);}}catch(_0x516ce0){utils[_0xdbd5('0x20')](util['format']('[%s][calls][hangup]',_0x5bdb13[_0xdbd5('0x8')]),_0x516ce0);}};exports[_0xdbd5('0x34')]=function(_0x4f8745){try{if(!_['isNil'](channels[_0x4f8745[_0xdbd5('0x35')]])){utils[_0xdbd5('0x36')](util[_0xdbd5('0xb')](_0xdbd5('0x37'),_0x4f8745[_0xdbd5('0x38')]),_0x4f8745);if(channels[_0x4f8745['localtwolinkedid']][_0xdbd5('0x1a')]==_0x4f8745[_0xdbd5('0x39')]){utils[_0xdbd5('0xa')](util[_0xdbd5('0xb')](_0xdbd5('0x3a'),_0x4f8745[_0xdbd5('0x38')],_0x4f8745['localtwolinkedid'],_0x4f8745[_0xdbd5('0x3b')]));channels[_0x4f8745[_0xdbd5('0x35')]]['destinationchannel']=_0x4f8745[_0xdbd5('0x3b')];channels[_0x4f8745[_0xdbd5('0x35')]][_0xdbd5('0x3c')]=_0xdbd5('0x3d');}else if(channels[_0x4f8745[_0xdbd5('0x35')]]['channel']=_0x4f8745[_0xdbd5('0x3e')]){utils[_0xdbd5('0xa')](util[_0xdbd5('0xb')](_0xdbd5('0x3a'),_0x4f8745[_0xdbd5('0x38')],_0x4f8745[_0xdbd5('0x35')],_0x4f8745[_0xdbd5('0x3f')]));channels[_0x4f8745[_0xdbd5('0x35')]][_0xdbd5('0x27')]=_0x4f8745[_0xdbd5('0x3f')];channels[_0x4f8745[_0xdbd5('0x35')]][_0xdbd5('0x3c')]=_0xdbd5('0x3d');}}}catch(_0x4aac7f){utils[_0xdbd5('0x20')](util['format'](_0xdbd5('0x37'),_0x4f8745[_0xdbd5('0x38')]),_0x4aac7f);}};exports[_0xdbd5('0x40')]=function(_0xd296c4){try{if(!_[_0xdbd5('0x23')](channels[_0xd296c4['uniqueid']])){utils[_0xdbd5('0x36')](util['format'](_0xdbd5('0x41'),_0xd296c4[_0xdbd5('0x8')]),_0xd296c4);channels[_0xd296c4['uniqueid']]['musiconholdstartAt']=utils['now']();utils[_0xdbd5('0xa')](util[_0xdbd5('0xb')](_0xdbd5('0x42'),_0xd296c4['uniqueid'],channels[_0xd296c4[_0xdbd5('0x8')]]['musiconholdstartAt']));}}catch(_0x2202b6){utils[_0xdbd5('0x20')](util[_0xdbd5('0xb')]('[%s][calls][musiconholdstart]',_0xd296c4[_0xdbd5('0x8')]),_0x2202b6);}};exports[_0xdbd5('0x43')]=function(_0x4d80bb){try{if(!_[_0xdbd5('0x23')](channels[_0x4d80bb[_0xdbd5('0x8')]])){utils[_0xdbd5('0x36')](util['format'](_0xdbd5('0x44'),_0x4d80bb[_0xdbd5('0x8')]),_0x4d80bb);if(!_[_0xdbd5('0x23')](channels[_0x4d80bb[_0xdbd5('0x8')]]['musiconholdstartAt'])){channels[_0x4d80bb[_0xdbd5('0x8')]]['mohtime']+=utils[_0xdbd5('0x32')](utils['now'](),channels[_0x4d80bb[_0xdbd5('0x8')]][_0xdbd5('0x45')]);utils[_0xdbd5('0xa')](util[_0xdbd5('0xb')](_0xdbd5('0x46'),_0x4d80bb[_0xdbd5('0x8')],channels[_0x4d80bb[_0xdbd5('0x8')]]['mohtime']));delete channels[_0x4d80bb[_0xdbd5('0x8')]][_0xdbd5('0x45')];}}}catch(_0x48bba8){utils[_0xdbd5('0x20')](util[_0xdbd5('0xb')](_0xdbd5('0x44'),_0x4d80bb[_0xdbd5('0x8')]),_0x48bba8);}};exports[_0xdbd5('0x47')]=function(_0x44caf6){try{if(!_['isNil'](channels[_0x44caf6[_0xdbd5('0x8')]])){utils['debug'](util[_0xdbd5('0xb')]('[%s][calls][varset]',_0x44caf6[_0xdbd5('0x8')]),_0x44caf6);if(!_[_0xdbd5('0x23')](_0x44caf6[_0xdbd5('0x48')][_0xdbd5('0x49')])){utils['info'](util[_0xdbd5('0xb')]('[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s',_0x44caf6[_0xdbd5('0x8')],_0x44caf6[_0xdbd5('0x4a')]));channels[_0x44caf6['uniqueid']][_0xdbd5('0x4b')]=_0x44caf6[_0xdbd5('0x4a')];}if(!_['isNil'](_0x44caf6[_0xdbd5('0x48')][_0xdbd5('0x4c')])){utils[_0xdbd5('0xa')](util[_0xdbd5('0xb')](_0xdbd5('0x4d'),_0x44caf6[_0xdbd5('0x8')],_0x44caf6[_0xdbd5('0x4a')]));channels[_0x44caf6['uniqueid']][_0xdbd5('0x4e')]=_0x44caf6[_0xdbd5('0x4a')];channels[_0x44caf6[_0xdbd5('0x8')]][_0xdbd5('0x2d')]='\x22'+_0x44caf6[_0xdbd5('0x4a')]+_0xdbd5('0x4f')+_0x44caf6[_0xdbd5('0x4a')]+'>';}if(!_[_0xdbd5('0x23')](_0x44caf6[_0xdbd5('0x48')][_0xdbd5('0x50')])||!_[_0xdbd5('0x23')](_0x44caf6[_0xdbd5('0x48')][_0xdbd5('0x51')])){utils['info'](util[_0xdbd5('0xb')](_0xdbd5('0x52'),_0x44caf6[_0xdbd5('0x8')],!_[_0xdbd5('0x23')](_0x44caf6['variable'][_0xdbd5('0x50')])?_0xdbd5('0x50'):_0xdbd5('0x51'),_0x44caf6['value']));channels[_0x44caf6[_0xdbd5('0x8')]][_0xdbd5('0x2d')]=_0x44caf6[_0xdbd5('0x4a')];}if(!_['isNil'](_0x44caf6[_0xdbd5('0x48')][_0xdbd5('0x53')])||!_[_0xdbd5('0x23')](_0x44caf6['variable'][_0xdbd5('0x54')])){utils['info'](util['format']('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x44caf6[_0xdbd5('0x8')],!_[_0xdbd5('0x23')](_0x44caf6['variable']['xmd-queue'])?_0xdbd5('0x53'):_0xdbd5('0x54'),_0x44caf6[_0xdbd5('0x4a')]));channels[_0x44caf6[_0xdbd5('0x8')]][_0xdbd5('0x55')]='Queue';channels[_0x44caf6[_0xdbd5('0x8')]][_0xdbd5('0x56')]=_0x44caf6[_0xdbd5('0x4a')];channels[_0x44caf6[_0xdbd5('0x8')]][_0xdbd5('0x57')]=!![];}if(!_[_0xdbd5('0x23')](_0x44caf6[_0xdbd5('0x48')][_0xdbd5('0x58')])){utils[_0xdbd5('0xa')](util[_0xdbd5('0xb')](_0xdbd5('0x59'),_0x44caf6[_0xdbd5('0x8')],_0x44caf6[_0xdbd5('0x4a')]));channels[_0x44caf6['uniqueid']]['ContactId']=_0x44caf6['value'];}if(!_[_0xdbd5('0x23')](_0x44caf6[_0xdbd5('0x48')]['xmd-cdrtype'])){utils[_0xdbd5('0xa')](util[_0xdbd5('0xb')]('[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s',_0x44caf6['uniqueid'],_0x44caf6[_0xdbd5('0x4a')]));channels[_0x44caf6['uniqueid']][_0xdbd5('0x5a')]=_0x44caf6['value'];}if(!_[_0xdbd5('0x23')](_0x44caf6[_0xdbd5('0x48')][_0xdbd5('0x5b')])){utils[_0xdbd5('0xa')](util[_0xdbd5('0xb')]('[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s',_0x44caf6[_0xdbd5('0x8')],_0x44caf6[_0xdbd5('0x4a')]));channels[_0x44caf6['uniqueid']][_0xdbd5('0x5c')]=_0x44caf6[_0xdbd5('0x4a')];}if(!_[_0xdbd5('0x23')](_0x44caf6['variable'][_0xdbd5('0x5d')])){utils['info'](util[_0xdbd5('0xb')](_0xdbd5('0x5e'),_0x44caf6[_0xdbd5('0x8')],_0x44caf6[_0xdbd5('0x4a')]));channels[_0x44caf6[_0xdbd5('0x8')]]['sipcallid']=_0x44caf6[_0xdbd5('0x4a')];}}}catch(_0xbe83ed){utils['error'](util['format'](_0xdbd5('0x5f'),_0x44caf6[_0xdbd5('0x8')]),_0xbe83ed);}};exports[_0xdbd5('0x60')]=function(_0x59c49d){try{if(!_[_0xdbd5('0x23')](channels[_0x59c49d[_0xdbd5('0x8')]])){utils[_0xdbd5('0x36')](util[_0xdbd5('0xb')](_0xdbd5('0x61'),_0x59c49d[_0xdbd5('0x8')]),_0x59c49d);utils[_0xdbd5('0xa')](util[_0xdbd5('0xb')](_0xdbd5('0x62'),_0x59c49d[_0xdbd5('0x8')],_0x59c49d['application'],_0x59c49d[_0xdbd5('0x63')]));if(_0x59c49d['application']['toLowerCase']()==_0xdbd5('0x64')&&_['startsWith'](_0x59c49d[_0xdbd5('0x63')]['toLowerCase'](),_0xdbd5('0x65'))){var _0x34d8da=_0x59c49d[_0xdbd5('0x63')][_0xdbd5('0x66')]('=');var _0x19a820=_0x34d8da[0x0][_0xdbd5('0x67')](_0x34d8da[0x0][_0xdbd5('0x68')]('(')+0x1,_0x34d8da[0x0]['lastIndexOf'](')'));var _0x414a02=_0x34d8da[0x1];channels[_0x59c49d[_0xdbd5('0x8')]][_0x19a820]=_0x414a02;}if(!_['includes']([_0xdbd5('0x2b'),'noop',_0xdbd5('0x69'),'set',_0xdbd5('0x6a')],_0x59c49d['application'][_0xdbd5('0x6b')]())){channels[_0x59c49d[_0xdbd5('0x8')]][_0xdbd5('0x55')]=_0x59c49d[_0xdbd5('0x6c')];channels[_0x59c49d[_0xdbd5('0x8')]][_0xdbd5('0x56')]=_0x59c49d[_0xdbd5('0x63')];}}}catch(_0x5d589e){utils[_0xdbd5('0x20')](util[_0xdbd5('0xb')]('[%s][calls][newexten]',_0x59c49d[_0xdbd5('0x8')]),_0x5d589e);}};
\ No newline at end of file
index f44d1ea..1ea1a48 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9b4d=['./utils','connect','info','[core]\x20connected','[core]\x20shutdown','fullybooted','[core]\x20fullybooted','error','[core]\x20error'];(function(_0x385f47,_0xd228e){var _0x2e0d90=function(_0x4f6b9b){while(--_0x4f6b9b){_0x385f47['push'](_0x385f47['shift']());}};_0x2e0d90(++_0xd228e);}(_0x9b4d,0x18c));var _0xd9b4=function(_0x46a563,_0x586712){_0x46a563=_0x46a563-0x0;var _0x10aa22=_0x9b4d[_0x46a563];return _0x10aa22;};'use strict';var utils=require(_0xd9b4('0x0'));exports[_0xd9b4('0x1')]=function(){utils[_0xd9b4('0x2')](_0xd9b4('0x3'));};exports['shutdown']=function(){utils[_0xd9b4('0x2')](_0xd9b4('0x4'));};exports[_0xd9b4('0x5')]=function(){utils[_0xd9b4('0x2')](_0xd9b4('0x6'));};exports[_0xd9b4('0x7')]=function(_0x4094ea){utils[_0xd9b4('0x7')](_0xd9b4('0x8'),_0x4094ea);};exports['close']=function(){utils[_0xd9b4('0x2')]('[core]\x20close');};exports['managerevent']=function(_0x2bbb7e){};
\ No newline at end of file
+var _0xadd6=['[core]\x20close','./utils','connect','info','[core]\x20connected','shutdown','[core]\x20shutdown','fullybooted','[core]\x20fullybooted','error','[core]\x20error','close'];(function(_0x35da42,_0x5c2610){var _0x370035=function(_0x546db5){while(--_0x546db5){_0x35da42['push'](_0x35da42['shift']());}};_0x370035(++_0x5c2610);}(_0xadd6,0xfd));var _0x6add=function(_0x52980f,_0x47b3b0){_0x52980f=_0x52980f-0x0;var _0x1f52a1=_0xadd6[_0x52980f];return _0x1f52a1;};'use strict';var utils=require(_0x6add('0x0'));exports[_0x6add('0x1')]=function(){utils[_0x6add('0x2')](_0x6add('0x3'));};exports[_0x6add('0x4')]=function(){utils[_0x6add('0x2')](_0x6add('0x5'));};exports[_0x6add('0x6')]=function(){utils[_0x6add('0x2')](_0x6add('0x7'));};exports[_0x6add('0x8')]=function(_0x3abb1c){utils[_0x6add('0x8')](_0x6add('0x9'),_0x3abb1c);};exports[_0x6add('0xa')]=function(){utils[_0x6add('0x2')](_0x6add('0xb'));};exports['managerevent']=function(_0x31b6a8){};
\ No newline at end of file
index 97ab432..38445d7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf699=['debug','isNil','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','dialbegin','[%s][dials][dialbegin]','assign','starttime','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','dialend','[%s][dials][dialend]','ANSWER','answertime','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','hangup','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','now','complete','diffTime','endtime','util','./utils','info','format','uniqueid','channel','dialstring','calleridnum','connectedlinenum','dialstatus','CreateVoiceDialReport','[%s][dials][newexten]','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','split','error','varset'];(function(_0xcec18a,_0x663b4f){var _0x52d111=function(_0x23a999){while(--_0x23a999){_0xcec18a['push'](_0xcec18a['shift']());}};_0x52d111(++_0x663b4f);}(_0xf699,0x1e6));var _0x9f69=function(_0x3f150d,_0x134b4e){_0x3f150d=_0x3f150d-0x0;var _0x4c49f3=_0xf699[_0x3f150d];return _0x4c49f3;};'use strict';var _=require('lodash');var util=require(_0x9f69('0x0'));var utils=require(_0x9f69('0x1'));var dials={};function writeDB(_0xc730e2){utils[_0x9f69('0x2')](util[_0x9f69('0x3')]('[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s',_0xc730e2[_0x9f69('0x4')],_0xc730e2[_0x9f69('0x5')],_0xc730e2[_0x9f69('0x6')],_0xc730e2[_0x9f69('0x7')],_0xc730e2[_0x9f69('0x8')],_0xc730e2[_0x9f69('0x9')]));utils['request'](_0x9f69('0xa'),_0xc730e2);delete dials[_0xc730e2['uniqueid']];}exports['newexten']=function(_0x711622){try{utils['debug'](util[_0x9f69('0x3')](_0x9f69('0xb'),_0x711622['uniqueid']),_0x711622);utils[_0x9f69('0x2')](util[_0x9f69('0x3')](_0x9f69('0xc'),_0x711622[_0x9f69('0x4')],_0x711622[_0x9f69('0xd')],_0x711622[_0x9f69('0xe')]));if(_0x711622[_0x9f69('0xd')][_0x9f69('0xf')]()==_0x9f69('0x10')&&_['startsWith'](_0x711622[_0x9f69('0xe')]['toLowerCase'](),'cdr(routeid)')){var _0x196fc4=_0x711622[_0x9f69('0xe')][_0x9f69('0x11')]('=');dials[_0x711622[_0x9f69('0x4')]]={'routeId':_0x196fc4[0x1]};}}catch(_0x23e073){utils[_0x9f69('0x12')](util[_0x9f69('0x3')](_0x9f69('0xb'),_0x711622['uniqueid']),_0x23e073);}};exports[_0x9f69('0x13')]=function(_0x572fe0){try{utils[_0x9f69('0x14')](util[_0x9f69('0x3')]('[%s][dials][varset]',_0x572fe0[_0x9f69('0x4')]),_0x572fe0);if(!_[_0x9f69('0x15')](_0x572fe0[_0x9f69('0x16')][_0x9f69('0x17')])){utils[_0x9f69('0x2')](util[_0x9f69('0x3')](_0x9f69('0x18'),_0x572fe0[_0x9f69('0x4')],_0x572fe0['value']));dials[_0x572fe0[_0x9f69('0x4')]]={'routeId':_0x572fe0['value']};}}catch(_0x35cb54){utils[_0x9f69('0x12')](util[_0x9f69('0x3')]('[%s][dials][varset]',_0x572fe0[_0x9f69('0x4')]),_0x35cb54);}};exports[_0x9f69('0x19')]=function(_0x2d9f0f){try{if(!_['isNil'](dials[_0x2d9f0f[_0x9f69('0x4')]])){utils[_0x9f69('0x14')](util[_0x9f69('0x3')](_0x9f69('0x1a'),_0x2d9f0f[_0x9f69('0x4')]),_0x2d9f0f);dials[_0x2d9f0f[_0x9f69('0x4')]]=_[_0x9f69('0x1b')](dials[_0x2d9f0f[_0x9f69('0x4')]],_0x2d9f0f);dials[_0x2d9f0f[_0x9f69('0x4')]][_0x9f69('0x1c')]=utils['now']();dials[_0x2d9f0f[_0x9f69('0x4')]][_0x9f69('0x1d')]=_0x9f69('0x1e');utils[_0x9f69('0x2')](util[_0x9f69('0x3')](_0x9f69('0x1f'),_0x2d9f0f['uniqueid'],dials[_0x2d9f0f[_0x9f69('0x4')]][_0x9f69('0x1c')]));}}catch(_0x19c615){utils['error'](util['format'](_0x9f69('0x1a'),_0x2d9f0f[_0x9f69('0x4')]),_0x19c615);}};exports[_0x9f69('0x20')]=function(_0x16bdc6){try{if(!_[_0x9f69('0x15')](dials[_0x16bdc6[_0x9f69('0x4')]])){utils['debug'](util[_0x9f69('0x3')](_0x9f69('0x21'),_0x16bdc6[_0x9f69('0x4')]),_0x16bdc6);dials[_0x16bdc6[_0x9f69('0x4')]]['dialstatus']=_0x16bdc6[_0x9f69('0x9')];if(_0x16bdc6[_0x9f69('0x9')]==_0x9f69('0x22')){dials[_0x16bdc6[_0x9f69('0x4')]]=_[_0x9f69('0x1b')](dials[_0x16bdc6[_0x9f69('0x4')]],_0x16bdc6);dials[_0x16bdc6[_0x9f69('0x4')]][_0x9f69('0x23')]=utils['now']();dials[_0x16bdc6[_0x9f69('0x4')]][_0x9f69('0x1d')]=_0x9f69('0x24');utils[_0x9f69('0x2')](util[_0x9f69('0x3')](_0x9f69('0x25'),_0x16bdc6['uniqueid'],_0x16bdc6[_0x9f69('0x9')],dials[_0x16bdc6[_0x9f69('0x4')]][_0x9f69('0x23')]));}else{utils['info'](util['format'](_0x9f69('0x26'),_0x16bdc6[_0x9f69('0x4')],_0x16bdc6[_0x9f69('0x9')]));}}}catch(_0x4eb8e2){utils[_0x9f69('0x12')](util[_0x9f69('0x3')](_0x9f69('0x21'),_0x16bdc6['uniqueid']),_0x4eb8e2);}};exports[_0x9f69('0x27')]=function(_0x10b00b){try{if(!_['isNil'](dials[_0x10b00b[_0x9f69('0x4')]])){utils[_0x9f69('0x14')](util[_0x9f69('0x3')]('[%s][dials][hangup]',_0x10b00b['uniqueid']),_0x10b00b);utils[_0x9f69('0x2')](util[_0x9f69('0x3')](_0x9f69('0x28'),_0x10b00b[_0x9f69('0x4')],_0x10b00b['calleridnum'],_0x10b00b[_0x9f69('0x29')],_0x10b00b['cause-txt']));dials[_0x10b00b[_0x9f69('0x4')]]=_[_0x9f69('0x1b')](dials[_0x10b00b[_0x9f69('0x4')]],{'endtime':utils[_0x9f69('0x2a')](),'lastevent':_0x9f69('0x2b')});dials[_0x10b00b[_0x9f69('0x4')]]['duration']=utils[_0x9f69('0x2c')](dials[_0x10b00b[_0x9f69('0x4')]]['endtime'],dials[_0x10b00b[_0x9f69('0x4')]][_0x9f69('0x1c')]);dials[_0x10b00b[_0x9f69('0x4')]]['holdtime']=utils['diffTime'](dials[_0x10b00b['uniqueid']]['answertime']||dials[_0x10b00b[_0x9f69('0x4')]][_0x9f69('0x2d')],dials[_0x10b00b[_0x9f69('0x4')]][_0x9f69('0x1c')]);dials[_0x10b00b[_0x9f69('0x4')]]['billableseconds']=dials[_0x10b00b['uniqueid']][_0x9f69('0x23')]?utils['diffTime'](dials[_0x10b00b[_0x9f69('0x4')]][_0x9f69('0x2d')],dials[_0x10b00b[_0x9f69('0x4')]][_0x9f69('0x23')]):0x0;writeDB(dials[_0x10b00b[_0x9f69('0x4')]]);}}catch(_0x23853b){utils['error'](util[_0x9f69('0x3')]('[%s][dials][hangup]',_0x10b00b[_0x9f69('0x4')]),_0x23853b);}};
\ No newline at end of file
+var _0x6dd5=['assign','starttime','now','called','[%s][dials][dialend]','lastevent','answertime','[%s][dials][dialend]\x20dialstatus:%s','error','hangup','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','cause-txt','duration','diffTime','endtime','holdtime','util','./utils','info','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','channel','dialstring','calleridnum','connectedlinenum','dialstatus','request','CreateVoiceDialReport','newexten','debug','[%s][dials][newexten]','[%s][dials][newexten]\x20application:%s\x20appdata:%s','appdata','application','toLowerCase','startsWith','cdr(routeid)','varset','[%s][dials][varset]','isNil','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','[%s][dials][dialbegin]'];(function(_0x53c46f,_0x27fb75){var _0x550fc6=function(_0x854aa6){while(--_0x854aa6){_0x53c46f['push'](_0x53c46f['shift']());}};_0x550fc6(++_0x27fb75);}(_0x6dd5,0xa2));var _0x56dd=function(_0x56ea7a,_0x528105){_0x56ea7a=_0x56ea7a-0x0;var _0x459646=_0x6dd5[_0x56ea7a];return _0x459646;};'use strict';var _=require('lodash');var util=require(_0x56dd('0x0'));var utils=require(_0x56dd('0x1'));var dials={};function writeDB(_0x4f4f67){utils[_0x56dd('0x2')](util[_0x56dd('0x3')](_0x56dd('0x4'),_0x4f4f67[_0x56dd('0x5')],_0x4f4f67[_0x56dd('0x6')],_0x4f4f67[_0x56dd('0x7')],_0x4f4f67[_0x56dd('0x8')],_0x4f4f67[_0x56dd('0x9')],_0x4f4f67[_0x56dd('0xa')]));utils[_0x56dd('0xb')](_0x56dd('0xc'),_0x4f4f67);delete dials[_0x4f4f67['uniqueid']];}exports[_0x56dd('0xd')]=function(_0x3d86a3){try{utils[_0x56dd('0xe')](util['format'](_0x56dd('0xf'),_0x3d86a3[_0x56dd('0x5')]),_0x3d86a3);utils['info'](util[_0x56dd('0x3')](_0x56dd('0x10'),_0x3d86a3[_0x56dd('0x5')],_0x3d86a3['application'],_0x3d86a3[_0x56dd('0x11')]));if(_0x3d86a3[_0x56dd('0x12')][_0x56dd('0x13')]()=='set'&&_[_0x56dd('0x14')](_0x3d86a3[_0x56dd('0x11')]['toLowerCase'](),_0x56dd('0x15'))){var _0x17f987=_0x3d86a3[_0x56dd('0x11')]['split']('=');dials[_0x3d86a3[_0x56dd('0x5')]]={'routeId':_0x17f987[0x1]};}}catch(_0x5cbe53){utils['error'](util[_0x56dd('0x3')](_0x56dd('0xf'),_0x3d86a3['uniqueid']),_0x5cbe53);}};exports[_0x56dd('0x16')]=function(_0xb4bf40){try{utils['debug'](util[_0x56dd('0x3')](_0x56dd('0x17'),_0xb4bf40[_0x56dd('0x5')]),_0xb4bf40);if(!_[_0x56dd('0x18')](_0xb4bf40[_0x56dd('0x19')][_0x56dd('0x1a')])){utils['info'](util['format'](_0x56dd('0x1b'),_0xb4bf40[_0x56dd('0x5')],_0xb4bf40[_0x56dd('0x1c')]));dials[_0xb4bf40[_0x56dd('0x5')]]={'routeId':_0xb4bf40['value']};}}catch(_0xd17043){utils['error'](util[_0x56dd('0x3')](_0x56dd('0x17'),_0xb4bf40[_0x56dd('0x5')]),_0xd17043);}};exports['dialbegin']=function(_0x36fa46){try{if(!_[_0x56dd('0x18')](dials[_0x36fa46[_0x56dd('0x5')]])){utils[_0x56dd('0xe')](util[_0x56dd('0x3')](_0x56dd('0x1d'),_0x36fa46[_0x56dd('0x5')]),_0x36fa46);dials[_0x36fa46[_0x56dd('0x5')]]=_[_0x56dd('0x1e')](dials[_0x36fa46['uniqueid']],_0x36fa46);dials[_0x36fa46[_0x56dd('0x5')]][_0x56dd('0x1f')]=utils[_0x56dd('0x20')]();dials[_0x36fa46[_0x56dd('0x5')]]['lastevent']=_0x56dd('0x21');utils['info'](util[_0x56dd('0x3')]('[%s][dials][hangup]\x20starttime:%s\x20lastevent:called',_0x36fa46[_0x56dd('0x5')],dials[_0x36fa46[_0x56dd('0x5')]][_0x56dd('0x1f')]));}}catch(_0xa2747c){utils['error'](util[_0x56dd('0x3')]('[%s][dials][dialbegin]',_0x36fa46[_0x56dd('0x5')]),_0xa2747c);}};exports['dialend']=function(_0x3f88ba){try{if(!_[_0x56dd('0x18')](dials[_0x3f88ba['uniqueid']])){utils[_0x56dd('0xe')](util[_0x56dd('0x3')](_0x56dd('0x22'),_0x3f88ba[_0x56dd('0x5')]),_0x3f88ba);dials[_0x3f88ba[_0x56dd('0x5')]]['dialstatus']=_0x3f88ba[_0x56dd('0xa')];if(_0x3f88ba[_0x56dd('0xa')]=='ANSWER'){dials[_0x3f88ba['uniqueid']]=_[_0x56dd('0x1e')](dials[_0x3f88ba[_0x56dd('0x5')]],_0x3f88ba);dials[_0x3f88ba[_0x56dd('0x5')]]['answertime']=utils[_0x56dd('0x20')]();dials[_0x3f88ba[_0x56dd('0x5')]][_0x56dd('0x23')]='connect';utils[_0x56dd('0x2')](util[_0x56dd('0x3')]('[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect',_0x3f88ba['uniqueid'],_0x3f88ba[_0x56dd('0xa')],dials[_0x3f88ba[_0x56dd('0x5')]][_0x56dd('0x24')]));}else{utils['info'](util[_0x56dd('0x3')](_0x56dd('0x25'),_0x3f88ba['uniqueid'],_0x3f88ba[_0x56dd('0xa')]));}}}catch(_0x3a766e){utils[_0x56dd('0x26')](util[_0x56dd('0x3')](_0x56dd('0x22'),_0x3f88ba[_0x56dd('0x5')]),_0x3a766e);}};exports[_0x56dd('0x27')]=function(_0x3cc784){try{if(!_[_0x56dd('0x18')](dials[_0x3cc784[_0x56dd('0x5')]])){utils[_0x56dd('0xe')](util[_0x56dd('0x3')](_0x56dd('0x28'),_0x3cc784[_0x56dd('0x5')]),_0x3cc784);utils[_0x56dd('0x2')](util[_0x56dd('0x3')](_0x56dd('0x29'),_0x3cc784['uniqueid'],_0x3cc784[_0x56dd('0x8')],_0x3cc784[_0x56dd('0x2a')],_0x3cc784[_0x56dd('0x2b')]));dials[_0x3cc784[_0x56dd('0x5')]]=_[_0x56dd('0x1e')](dials[_0x3cc784[_0x56dd('0x5')]],{'endtime':utils[_0x56dd('0x20')](),'lastevent':'complete'});dials[_0x3cc784[_0x56dd('0x5')]][_0x56dd('0x2c')]=utils[_0x56dd('0x2d')](dials[_0x3cc784[_0x56dd('0x5')]][_0x56dd('0x2e')],dials[_0x3cc784[_0x56dd('0x5')]]['starttime']);dials[_0x3cc784[_0x56dd('0x5')]][_0x56dd('0x2f')]=utils['diffTime'](dials[_0x3cc784[_0x56dd('0x5')]]['answertime']||dials[_0x3cc784[_0x56dd('0x5')]][_0x56dd('0x2e')],dials[_0x3cc784[_0x56dd('0x5')]][_0x56dd('0x1f')]);dials[_0x3cc784[_0x56dd('0x5')]]['billableseconds']=dials[_0x3cc784[_0x56dd('0x5')]][_0x56dd('0x24')]?utils['diffTime'](dials[_0x3cc784[_0x56dd('0x5')]][_0x56dd('0x2e')],dials[_0x3cc784['uniqueid']][_0x56dd('0x24')]):0x0;writeDB(dials[_0x3cc784[_0x56dd('0x5')]]);}}catch(_0x941ef){utils[_0x56dd('0x26')](util[_0x56dd('0x3')](_0x56dd('0x28'),_0x3cc784['uniqueid']),_0x941ef);}};
\ No newline at end of file
index 1ff6f6b..bf8f524 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1da8=['[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','[%s][index][queuecallerjoin]','queuecallerjoin','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','[%s][index][cdr]','cdr','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','[%s][index][varset]','[%s][index][newexten]','newexten','[%s][index][newchannel]','newchannel','dialbegin','[%s][index][dialbegin]','[%s]dialbegin','dialend','asterisk-manager','../../config/environment','env','production','xdr','local','asterisk','port','password','keepConnected','info','XDR\x20DISABLED','Asterisk\x20disabled\x20on\x20localhost','./agents.controller','./calls.controller','./recordings.controller','./members.controller','./dials.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','debug','[%s][index][devicestatechange]','format','device','agentcalled','[%s][index][agentcalled]','uniqueid','[%s][index][agentringnoanswer]','agentringnoanswer','agentconnect','[%s][index][agentconnect]','agentcomplete'];(function(_0x10909f,_0x2efbe2){var _0x3762d1=function(_0x2787c4){while(--_0x2787c4){_0x10909f['push'](_0x10909f['shift']());}};_0x3762d1(++_0x2efbe2);}(_0x1da8,0xf5));var _0x81da=function(_0x427a1d,_0x35495b){_0x427a1d=_0x427a1d-0x0;var _0x30dffc=_0x1da8[_0x427a1d];return _0x30dffc;};var AsteriskManager=require(_0x81da('0x0'));var config=require(_0x81da('0x1'));var utils=require('./utils');var util=require('util');var isXDREnabled=config['xdr']&&config['xdr']['disabled']?!config['xdr']['disabled']:!![];var isProduction=config[_0x81da('0x2')]===_0x81da('0x3')||![];var isLocalAsterisk=config[_0x81da('0x4')]&&config[_0x81da('0x4')][_0x81da('0x5')]===!![]||![];var ami=new AsteriskManager(config[_0x81da('0x6')][_0x81da('0x7')],config[_0x81da('0x6')]['ip'],config[_0x81da('0x6')]['username'],config[_0x81da('0x6')][_0x81da('0x8')],!![]);ami[_0x81da('0x9')]();if(!isXDREnabled){utils[_0x81da('0xa')](_0x81da('0xb'));}else if(!isProduction&&!isLocalAsterisk){utils[_0x81da('0xa')](_0x81da('0xc'));}else{var agents=require(_0x81da('0xd'));var calls=require(_0x81da('0xe'));var queues=require('./queues.controller');var recordings=require(_0x81da('0xf'));var members=require(_0x81da('0x10'));var dials=require(_0x81da('0x11'));var transfers=require(_0x81da('0x12'));var core=require(_0x81da('0x13'));ami['on']('connect',core[_0x81da('0x14')]);ami['on'](_0x81da('0x15'),core[_0x81da('0x15')]);ami['on'](_0x81da('0x16'),core[_0x81da('0x16')]);ami['on'](_0x81da('0x17'),core['error']);ami['on'](_0x81da('0x18'),core['close']);ami['on'](_0x81da('0x19'),core[_0x81da('0x19')]);ami['on'](_0x81da('0x1a'),function(_0x423fc9){try{utils[_0x81da('0x1b')](util['format'](_0x81da('0x1c'),_0x423fc9['device']),_0x423fc9);members[_0x81da('0x1a')](_0x423fc9);}catch(_0x4e9fcd){utils[_0x81da('0x17')](util[_0x81da('0x1d')](_0x81da('0x1c'),_0x423fc9[_0x81da('0x1e')]),_0x4e9fcd);}});ami['on'](_0x81da('0x1f'),function(_0x18f9d6){try{utils[_0x81da('0x1b')](util[_0x81da('0x1d')](_0x81da('0x20'),_0x18f9d6[_0x81da('0x21')]),_0x18f9d6);agents[_0x81da('0x1f')](_0x18f9d6);}catch(_0x1c45d0){utils[_0x81da('0x17')](util[_0x81da('0x1d')]('[%s][index][agentcalled]',_0x18f9d6[_0x81da('0x21')]),_0x1c45d0);}});ami['on']('agentringnoanswer',function(_0x242828){try{utils[_0x81da('0x1b')](util[_0x81da('0x1d')](_0x81da('0x22'),_0x242828[_0x81da('0x21')]),_0x242828);agents[_0x81da('0x23')](_0x242828);}catch(_0x408acd){utils['error'](util['format'](_0x81da('0x22'),_0x242828[_0x81da('0x21')]),_0x408acd);}});ami['on'](_0x81da('0x24'),function(_0x23f373){try{utils[_0x81da('0x1b')](util['format'](_0x81da('0x25'),_0x23f373[_0x81da('0x21')]),_0x23f373);agents['agentconnect'](_0x23f373);queues[_0x81da('0x24')](_0x23f373);}catch(_0x1be9f8){utils['error'](util[_0x81da('0x1d')](_0x81da('0x25'),_0x23f373[_0x81da('0x21')]),_0x1be9f8);}});ami['on'](_0x81da('0x26'),function(_0x2e3480){try{utils['debug'](util[_0x81da('0x1d')](_0x81da('0x27'),_0x2e3480[_0x81da('0x21')]),_0x2e3480);agents[_0x81da('0x26')](_0x2e3480);queues[_0x81da('0x26')](_0x2e3480);members[_0x81da('0x26')](_0x2e3480);}catch(_0x35d604){utils[_0x81da('0x17')](util[_0x81da('0x1d')](_0x81da('0x27'),_0x2e3480[_0x81da('0x21')]),_0x35d604);}});ami['on'](_0x81da('0x28'),function(_0x163331){try{utils[_0x81da('0x1b')](util[_0x81da('0x1d')](_0x81da('0x29'),_0x163331[_0x81da('0x21')]),_0x163331);agents[_0x81da('0x28')](_0x163331);queues[_0x81da('0x28')](_0x163331);}catch(_0x651037){utils[_0x81da('0x17')](util['format']('[%s][index][queuecallerabandon]',_0x163331['uniqueid']),_0x651037);}});ami['on']('queuecallerjoin',function(_0xb739ae){try{utils[_0x81da('0x1b')](util[_0x81da('0x1d')](_0x81da('0x2a'),_0xb739ae[_0x81da('0x21')]),_0xb739ae);queues['queuecallerjoin'](_0xb739ae);recordings[_0x81da('0x2b')](_0xb739ae);}catch(_0xc6f1c7){utils[_0x81da('0x17')](util[_0x81da('0x1d')](_0x81da('0x2a'),_0xb739ae[_0x81da('0x21')]),_0xc6f1c7);}});ami['on']('queuecallerleave',function(_0x548f2c){try{utils['debug'](util[_0x81da('0x1d')]('[%s][index][queuecallerleave]',_0x548f2c[_0x81da('0x21')]),_0x548f2c);queues[_0x81da('0x2c')](_0x548f2c);}catch(_0x11732a){utils[_0x81da('0x17')](util[_0x81da('0x1d')](_0x81da('0x2d'),_0x548f2c[_0x81da('0x21')]),_0x11732a);}});ami['on']('musiconholdstart',function(_0x49a4dc){try{utils[_0x81da('0x1b')](util[_0x81da('0x1d')]('[%s][index][musiconholdstart]',_0x49a4dc[_0x81da('0x21')]),_0x49a4dc);queues[_0x81da('0x2e')](_0x49a4dc);calls[_0x81da('0x2e')](_0x49a4dc);}catch(_0x1c3c06){utils[_0x81da('0x17')](util['format'](_0x81da('0x2f'),_0x49a4dc[_0x81da('0x21')]),_0x1c3c06);}});ami['on'](_0x81da('0x30'),function(_0x547983){try{utils[_0x81da('0x1b')](util[_0x81da('0x1d')](_0x81da('0x31'),_0x547983['uniqueid']),_0x547983);queues[_0x81da('0x30')](_0x547983);calls[_0x81da('0x30')](_0x547983);}catch(_0x5372e6){utils['error'](util['format'](_0x81da('0x31'),_0x547983[_0x81da('0x21')]),_0x5372e6);}});ami['on'](_0x81da('0x32'),function(_0x4c28bf){try{utils[_0x81da('0x1b')](util[_0x81da('0x1d')](_0x81da('0x33'),_0x4c28bf[_0x81da('0x21')]),_0x4c28bf);calls[_0x81da('0x32')](_0x4c28bf);recordings[_0x81da('0x32')](_0x4c28bf);}catch(_0x2a4a51){utils[_0x81da('0x17')](util[_0x81da('0x1d')](_0x81da('0x33'),_0x4c28bf[_0x81da('0x21')]),_0x2a4a51);}});ami['on']('hangup',function(_0x2511b9){try{utils[_0x81da('0x1b')](util[_0x81da('0x1d')]('[%s][index][hangup]',_0x2511b9['uniqueid']),_0x2511b9);calls[_0x81da('0x34')](_0x2511b9);recordings[_0x81da('0x34')](_0x2511b9);dials[_0x81da('0x34')](_0x2511b9);agents[_0x81da('0x34')](_0x2511b9);queues[_0x81da('0x34')](_0x2511b9);}catch(_0x580d64){utils[_0x81da('0x17')](util[_0x81da('0x1d')](_0x81da('0x35'),_0x2511b9[_0x81da('0x21')]),_0x580d64);}});ami['on']('cdr',function(_0x5495c2){try{utils[_0x81da('0x1b')](util[_0x81da('0x1d')](_0x81da('0x36'),_0x5495c2[_0x81da('0x21')]),_0x5495c2);members[_0x81da('0x37')](_0x5495c2);}catch(_0x186211){utils[_0x81da('0x17')](util[_0x81da('0x1d')](_0x81da('0x36'),_0x5495c2[_0x81da('0x21')]),_0x186211);}});ami['on'](_0x81da('0x38'),function(_0x3352f3){try{utils[_0x81da('0x1b')](util['format'](_0x81da('0x39'),_0x3352f3[_0x81da('0x21')]),_0x3352f3);queues[_0x81da('0x38')](_0x3352f3);agents[_0x81da('0x38')](_0x3352f3);transfers['blindtransfer'](_0x3352f3);recordings['blindtransfer'](_0x3352f3);}catch(_0xe380ff){utils['error'](util['format'](_0x81da('0x39'),_0x3352f3[_0x81da('0x21')]),_0xe380ff);}});ami['on'](_0x81da('0x3a'),function(_0x46b3ef){try{utils['debug'](util[_0x81da('0x1d')](_0x81da('0x3b'),_0x46b3ef[_0x81da('0x3c')]),_0x46b3ef);queues[_0x81da('0x3a')](_0x46b3ef);transfers['attendedtransfer'](_0x46b3ef);agents[_0x81da('0x3a')](_0x46b3ef);calls[_0x81da('0x3a')](_0x46b3ef);}catch(_0x5ab6af){utils[_0x81da('0x17')](util[_0x81da('0x1d')](_0x81da('0x3b'),_0x46b3ef[_0x81da('0x3c')]),_0x5ab6af);}});ami['on'](_0x81da('0x3d'),function(_0x53b67d){try{utils[_0x81da('0x1b')](util[_0x81da('0x1d')]('[%s][index][varset]',_0x53b67d[_0x81da('0x21')]),_0x53b67d);queues[_0x81da('0x3d')](_0x53b67d);recordings[_0x81da('0x3d')](_0x53b67d);calls[_0x81da('0x3d')](_0x53b67d);dials[_0x81da('0x3d')](_0x53b67d);}catch(_0x4756db){utils['error'](util['format'](_0x81da('0x3e'),_0x53b67d['uniqueid']),_0x4756db);}});ami['on']('newexten',function(_0x59ae6b){try{utils[_0x81da('0x1b')](util[_0x81da('0x1d')](_0x81da('0x3f'),_0x59ae6b[_0x81da('0x21')]),_0x59ae6b);calls[_0x81da('0x40')](_0x59ae6b);recordings['newexten'](_0x59ae6b);dials[_0x81da('0x40')](_0x59ae6b);}catch(_0x1d953f){utils[_0x81da('0x17')](util[_0x81da('0x1d')](_0x81da('0x3f'),_0x59ae6b[_0x81da('0x21')]),_0x1d953f);}});ami['on']('newchannel',function(_0x4e87b8){try{utils[_0x81da('0x1b')](util[_0x81da('0x1d')](_0x81da('0x41'),_0x4e87b8[_0x81da('0x21')]),_0x4e87b8);calls[_0x81da('0x42')](_0x4e87b8);recordings[_0x81da('0x42')](_0x4e87b8);}catch(_0x4ab029){utils[_0x81da('0x17')](util[_0x81da('0x1d')](_0x81da('0x41'),_0x4e87b8[_0x81da('0x21')]),_0x4ab029);}});ami['on'](_0x81da('0x43'),function(_0x2852e2){try{utils[_0x81da('0x1b')](util[_0x81da('0x1d')](_0x81da('0x44'),_0x2852e2[_0x81da('0x21')]),_0x2852e2);dials[_0x81da('0x43')](_0x2852e2);}catch(_0x520c29){utils[_0x81da('0x17')](util[_0x81da('0x1d')](_0x81da('0x45'),_0x2852e2[_0x81da('0x21')]),_0x520c29);}});ami['on']('dialend',function(_0x238f20){try{utils[_0x81da('0x1b')](util[_0x81da('0x1d')]('[%s][index][dialend]',_0x238f20['uniqueid']),_0x238f20);dials[_0x81da('0x46')](_0x238f20);}catch(_0x15541e){utils[_0x81da('0x17')](util['format']('[%s][index][dialend]',_0x238f20[_0x81da('0x21')]),_0x15541e);}});}
\ No newline at end of file
+var _0x5ad4=['agentcomplete','[%s][index][agentcomplete]','[%s][index][queuecallerabandon]','queuecallerabandon','queuecallerjoin','[%s][index][queuecallerjoin]','[%s][index][queuecallerleave]','queuecallerleave','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','origtransfereruniqueid','[%s][index][attendedtransfer]','varset','[%s][index][varset]','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','dialbegin','dialend','[%s][index][dialend]','asterisk-manager','../../config/environment','./utils','xdr','env','production','local','asterisk','username','keepConnected','info','./agents.controller','./calls.controller','./queues.controller','./recordings.controller','./members.controller','./dials.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','debug','format','[%s][index][devicestatechange]','device','agentcalled','[%s][index][agentcalled]','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]'];(function(_0x5e8d2b,_0x4f89fe){var _0x23ff8a=function(_0x1e2843){while(--_0x1e2843){_0x5e8d2b['push'](_0x5e8d2b['shift']());}};_0x23ff8a(++_0x4f89fe);}(_0x5ad4,0x64));var _0x45ad=function(_0xc47d67,_0x5c720f){_0xc47d67=_0xc47d67-0x0;var _0x207119=_0x5ad4[_0xc47d67];return _0x207119;};var AsteriskManager=require(_0x45ad('0x0'));var config=require(_0x45ad('0x1'));var utils=require(_0x45ad('0x2'));var util=require('util');var isXDREnabled=config[_0x45ad('0x3')]&&config[_0x45ad('0x3')]['disabled']?!config['xdr']['disabled']:!![];var isProduction=config[_0x45ad('0x4')]===_0x45ad('0x5')||![];var isLocalAsterisk=config[_0x45ad('0x3')]&&config['xdr'][_0x45ad('0x6')]===!![]||![];var ami=new AsteriskManager(config['asterisk']['port'],config[_0x45ad('0x7')]['ip'],config[_0x45ad('0x7')][_0x45ad('0x8')],config[_0x45ad('0x7')]['password'],!![]);ami[_0x45ad('0x9')]();if(!isXDREnabled){utils['info']('XDR\x20DISABLED');}else if(!isProduction&&!isLocalAsterisk){utils[_0x45ad('0xa')]('Asterisk\x20disabled\x20on\x20localhost');}else{var agents=require(_0x45ad('0xb'));var calls=require(_0x45ad('0xc'));var queues=require(_0x45ad('0xd'));var recordings=require(_0x45ad('0xe'));var members=require(_0x45ad('0xf'));var dials=require(_0x45ad('0x10'));var transfers=require('./transfers.controller');var core=require(_0x45ad('0x11'));ami['on']('connect',core[_0x45ad('0x12')]);ami['on']('shutdown',core[_0x45ad('0x13')]);ami['on'](_0x45ad('0x14'),core[_0x45ad('0x14')]);ami['on'](_0x45ad('0x15'),core[_0x45ad('0x15')]);ami['on'](_0x45ad('0x16'),core['close']);ami['on'](_0x45ad('0x17'),core[_0x45ad('0x17')]);ami['on'](_0x45ad('0x18'),function(_0x40541f){try{utils[_0x45ad('0x19')](util[_0x45ad('0x1a')](_0x45ad('0x1b'),_0x40541f[_0x45ad('0x1c')]),_0x40541f);members[_0x45ad('0x18')](_0x40541f);}catch(_0x52a2c9){utils[_0x45ad('0x15')](util[_0x45ad('0x1a')](_0x45ad('0x1b'),_0x40541f[_0x45ad('0x1c')]),_0x52a2c9);}});ami['on'](_0x45ad('0x1d'),function(_0x183870){try{utils[_0x45ad('0x19')](util[_0x45ad('0x1a')](_0x45ad('0x1e'),_0x183870[_0x45ad('0x1f')]),_0x183870);agents[_0x45ad('0x1d')](_0x183870);}catch(_0x4a904c){utils[_0x45ad('0x15')](util['format'](_0x45ad('0x1e'),_0x183870[_0x45ad('0x1f')]),_0x4a904c);}});ami['on'](_0x45ad('0x20'),function(_0x271931){try{utils[_0x45ad('0x19')](util[_0x45ad('0x1a')](_0x45ad('0x21'),_0x271931[_0x45ad('0x1f')]),_0x271931);agents[_0x45ad('0x20')](_0x271931);}catch(_0x5d8f60){utils[_0x45ad('0x15')](util['format'](_0x45ad('0x21'),_0x271931[_0x45ad('0x1f')]),_0x5d8f60);}});ami['on'](_0x45ad('0x22'),function(_0x5488c5){try{utils['debug'](util[_0x45ad('0x1a')](_0x45ad('0x23'),_0x5488c5[_0x45ad('0x1f')]),_0x5488c5);agents[_0x45ad('0x22')](_0x5488c5);queues[_0x45ad('0x22')](_0x5488c5);}catch(_0x246662){utils[_0x45ad('0x15')](util[_0x45ad('0x1a')](_0x45ad('0x23'),_0x5488c5['uniqueid']),_0x246662);}});ami['on'](_0x45ad('0x24'),function(_0x4a419e){try{utils[_0x45ad('0x19')](util['format'](_0x45ad('0x25'),_0x4a419e[_0x45ad('0x1f')]),_0x4a419e);agents['agentcomplete'](_0x4a419e);queues[_0x45ad('0x24')](_0x4a419e);members[_0x45ad('0x24')](_0x4a419e);}catch(_0x1ceb20){utils[_0x45ad('0x15')](util[_0x45ad('0x1a')](_0x45ad('0x25'),_0x4a419e[_0x45ad('0x1f')]),_0x1ceb20);}});ami['on']('queuecallerabandon',function(_0x3bca35){try{utils['debug'](util['format'](_0x45ad('0x26'),_0x3bca35[_0x45ad('0x1f')]),_0x3bca35);agents[_0x45ad('0x27')](_0x3bca35);queues[_0x45ad('0x27')](_0x3bca35);}catch(_0x21d40a){utils[_0x45ad('0x15')](util[_0x45ad('0x1a')](_0x45ad('0x26'),_0x3bca35[_0x45ad('0x1f')]),_0x21d40a);}});ami['on'](_0x45ad('0x28'),function(_0x31d929){try{utils[_0x45ad('0x19')](util[_0x45ad('0x1a')](_0x45ad('0x29'),_0x31d929[_0x45ad('0x1f')]),_0x31d929);queues['queuecallerjoin'](_0x31d929);recordings[_0x45ad('0x28')](_0x31d929);}catch(_0x31b18f){utils[_0x45ad('0x15')](util[_0x45ad('0x1a')]('[%s][index][queuecallerjoin]',_0x31d929['uniqueid']),_0x31b18f);}});ami['on']('queuecallerleave',function(_0xc2e8e1){try{utils[_0x45ad('0x19')](util['format'](_0x45ad('0x2a'),_0xc2e8e1[_0x45ad('0x1f')]),_0xc2e8e1);queues[_0x45ad('0x2b')](_0xc2e8e1);}catch(_0x4fac1a){utils[_0x45ad('0x15')](util[_0x45ad('0x1a')](_0x45ad('0x2a'),_0xc2e8e1[_0x45ad('0x1f')]),_0x4fac1a);}});ami['on'](_0x45ad('0x2c'),function(_0x587ce9){try{utils[_0x45ad('0x19')](util['format'](_0x45ad('0x2d'),_0x587ce9[_0x45ad('0x1f')]),_0x587ce9);queues[_0x45ad('0x2c')](_0x587ce9);calls['musiconholdstart'](_0x587ce9);}catch(_0x38f6e3){utils['error'](util[_0x45ad('0x1a')]('[%s][index][musiconholdstart]',_0x587ce9[_0x45ad('0x1f')]),_0x38f6e3);}});ami['on'](_0x45ad('0x2e'),function(_0x25569b){try{utils['debug'](util[_0x45ad('0x1a')](_0x45ad('0x2f'),_0x25569b[_0x45ad('0x1f')]),_0x25569b);queues[_0x45ad('0x2e')](_0x25569b);calls[_0x45ad('0x2e')](_0x25569b);}catch(_0x5a9316){utils[_0x45ad('0x15')](util[_0x45ad('0x1a')](_0x45ad('0x2f'),_0x25569b[_0x45ad('0x1f')]),_0x5a9316);}});ami['on'](_0x45ad('0x30'),function(_0x4cb8c8){try{utils[_0x45ad('0x19')](util[_0x45ad('0x1a')]('[%s][index][newstate]',_0x4cb8c8[_0x45ad('0x1f')]),_0x4cb8c8);calls['newstate'](_0x4cb8c8);recordings[_0x45ad('0x30')](_0x4cb8c8);}catch(_0x333651){utils[_0x45ad('0x15')](util['format'](_0x45ad('0x31'),_0x4cb8c8[_0x45ad('0x1f')]),_0x333651);}});ami['on'](_0x45ad('0x32'),function(_0x1ae5bc){try{utils[_0x45ad('0x19')](util[_0x45ad('0x1a')](_0x45ad('0x33'),_0x1ae5bc['uniqueid']),_0x1ae5bc);calls[_0x45ad('0x32')](_0x1ae5bc);recordings[_0x45ad('0x32')](_0x1ae5bc);dials[_0x45ad('0x32')](_0x1ae5bc);agents[_0x45ad('0x32')](_0x1ae5bc);queues[_0x45ad('0x32')](_0x1ae5bc);}catch(_0x27b673){utils[_0x45ad('0x15')](util[_0x45ad('0x1a')]('[%s][index][hangup]',_0x1ae5bc[_0x45ad('0x1f')]),_0x27b673);}});ami['on'](_0x45ad('0x34'),function(_0x58bcb8){try{utils['debug'](util[_0x45ad('0x1a')]('[%s][index][cdr]',_0x58bcb8[_0x45ad('0x1f')]),_0x58bcb8);members[_0x45ad('0x34')](_0x58bcb8);}catch(_0xc2ddd){utils[_0x45ad('0x15')](util[_0x45ad('0x1a')](_0x45ad('0x35'),_0x58bcb8[_0x45ad('0x1f')]),_0xc2ddd);}});ami['on'](_0x45ad('0x36'),function(_0xfe6dad){try{utils['debug'](util['format']('[%s][index][blindtransfer]',_0xfe6dad['uniqueid']),_0xfe6dad);queues[_0x45ad('0x36')](_0xfe6dad);agents[_0x45ad('0x36')](_0xfe6dad);transfers[_0x45ad('0x36')](_0xfe6dad);recordings[_0x45ad('0x36')](_0xfe6dad);}catch(_0x25e625){utils[_0x45ad('0x15')](util[_0x45ad('0x1a')](_0x45ad('0x37'),_0xfe6dad[_0x45ad('0x1f')]),_0x25e625);}});ami['on'](_0x45ad('0x38'),function(_0x4e661b){try{utils[_0x45ad('0x19')](util[_0x45ad('0x1a')]('[%s][index][attendedtransfer]',_0x4e661b[_0x45ad('0x39')]),_0x4e661b);queues['attendedtransfer'](_0x4e661b);transfers['attendedtransfer'](_0x4e661b);agents[_0x45ad('0x38')](_0x4e661b);calls[_0x45ad('0x38')](_0x4e661b);}catch(_0x10b9db){utils[_0x45ad('0x15')](util['format'](_0x45ad('0x3a'),_0x4e661b[_0x45ad('0x39')]),_0x10b9db);}});ami['on'](_0x45ad('0x3b'),function(_0x46d1a4){try{utils[_0x45ad('0x19')](util['format'](_0x45ad('0x3c'),_0x46d1a4[_0x45ad('0x1f')]),_0x46d1a4);queues[_0x45ad('0x3b')](_0x46d1a4);recordings[_0x45ad('0x3b')](_0x46d1a4);calls[_0x45ad('0x3b')](_0x46d1a4);dials[_0x45ad('0x3b')](_0x46d1a4);}catch(_0x582bdb){utils[_0x45ad('0x15')](util['format'](_0x45ad('0x3c'),_0x46d1a4[_0x45ad('0x1f')]),_0x582bdb);}});ami['on'](_0x45ad('0x3d'),function(_0x1a413c){try{utils[_0x45ad('0x19')](util[_0x45ad('0x1a')]('[%s][index][newexten]',_0x1a413c[_0x45ad('0x1f')]),_0x1a413c);calls[_0x45ad('0x3d')](_0x1a413c);recordings[_0x45ad('0x3d')](_0x1a413c);dials[_0x45ad('0x3d')](_0x1a413c);}catch(_0xd799b6){utils['error'](util[_0x45ad('0x1a')](_0x45ad('0x3e'),_0x1a413c[_0x45ad('0x1f')]),_0xd799b6);}});ami['on'](_0x45ad('0x3f'),function(_0x54ee1a){try{utils[_0x45ad('0x19')](util[_0x45ad('0x1a')]('[%s][index][newchannel]',_0x54ee1a[_0x45ad('0x1f')]),_0x54ee1a);calls['newchannel'](_0x54ee1a);recordings['newchannel'](_0x54ee1a);}catch(_0x44d583){utils[_0x45ad('0x15')](util[_0x45ad('0x1a')](_0x45ad('0x40'),_0x54ee1a[_0x45ad('0x1f')]),_0x44d583);}});ami['on'](_0x45ad('0x41'),function(_0x5b7707){try{utils[_0x45ad('0x19')](util[_0x45ad('0x1a')]('[%s][index][dialbegin]',_0x5b7707['uniqueid']),_0x5b7707);dials[_0x45ad('0x41')](_0x5b7707);}catch(_0x31e563){utils['error'](util[_0x45ad('0x1a')]('[%s]dialbegin',_0x5b7707[_0x45ad('0x1f')]),_0x31e563);}});ami['on'](_0x45ad('0x42'),function(_0x422542){try{utils[_0x45ad('0x19')](util['format'](_0x45ad('0x43'),_0x422542[_0x45ad('0x1f')]),_0x422542);dials['dialend'](_0x422542);}catch(_0x27f51a){utils[_0x45ad('0x15')](util[_0x45ad('0x1a')]('[%s][index][dialend]',_0x422542[_0x45ad('0x1f')]),_0x27f51a);}});}
\ No newline at end of file
index a960f9b..f7905de 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5d87=['device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','BUSY','now','isNil','exitAt','duration','diffTime','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','assign','cdr','debug','[%s][members][cdr]','channel','data1','source','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destinationchannel','lodash','util','Local/_attended@transfer','Queue:','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','data2','membername','type','getUserByInterface','interface','name','internal','CreateMemberReport','getUserByName','split','then','catch','error','[%s][members][writeDB]','startsWith','devicestatechange','[%s][members][devicestatechange]'];(function(_0x5acd3b,_0x4ec8a5){var _0x280e11=function(_0x1bb337){while(--_0x1bb337){_0x5acd3b['push'](_0x5acd3b['shift']());}};_0x280e11(++_0x4ec8a5);}(_0x5d87,0xdc));var _0x75d8=function(_0x4fc6dd,_0x4a4450){_0x4fc6dd=_0x4fc6dd-0x0;var _0x53ff3f=_0x5d87[_0x4fc6dd];return _0x53ff3f;};'use strict';var _=require(_0x75d8('0x0'));var util=require(_0x75d8('0x1'));var utils=require('./utils');var members={};var exclude=[_0x75d8('0x2'),_0x75d8('0x3')];function writeDB(_0x37babb){utils[_0x75d8('0x4')](util[_0x75d8('0x5')](_0x75d8('0x6'),_0x37babb[_0x75d8('0x7')],_0x37babb['interface'],_0x37babb['channel'],_0x37babb[_0x75d8('0x8')],_0x37babb[_0x75d8('0x9')],_0x37babb[_0x75d8('0xa')]));if(_0x37babb['interface']){utils[_0x75d8('0xb')](_0x37babb[_0x75d8('0xc')])['then'](function(_0x37466b){if(_0x37466b){_0x37babb['membername']=_0x37466b[_0x75d8('0xd')];_0x37babb[_0x75d8('0xe')]=_0x37466b[_0x75d8('0xe')];utils['request'](_0x75d8('0xf'),_0x37babb);}else{utils[_0x75d8('0x10')](_0x37babb[_0x75d8('0xc')][_0x75d8('0x11')]('/')[0x1])[_0x75d8('0x12')](function(_0x21ec18){if(_0x21ec18){_0x37babb[_0x75d8('0x9')]=_0x21ec18['name'];_0x37babb[_0x75d8('0xe')]=_0x21ec18[_0x75d8('0xe')];utils['request']('CreateMemberReport',_0x37babb);}});}})[_0x75d8('0x13')](function(_0xa3fda7){utils[_0x75d8('0x14')](util[_0x75d8('0x5')](_0x75d8('0x15'),_0x37babb['uniqueid']),_0xa3fda7);});}delete members[_0x37babb[_0x75d8('0xc')]];}function startsWith(_0x5f0676,_0x58446b){return _['some'](_0x5f0676,function(_0x2f1532){return _[_0x75d8('0x16')](_0x58446b,_0x2f1532);});}exports[_0x75d8('0x17')]=function(_0x53fc52){try{utils['debug'](util[_0x75d8('0x5')](_0x75d8('0x18'),members[_0x53fc52['device']]?members[_0x53fc52[_0x75d8('0x19')]]['uniqueid']:_0x53fc52[_0x75d8('0x19')]),_0x53fc52);utils['info'](util[_0x75d8('0x5')](_0x75d8('0x1a'),members[_0x53fc52[_0x75d8('0x19')]]?members[_0x53fc52['device']][_0x75d8('0x7')]:_0x53fc52[_0x75d8('0x19')],_0x53fc52[_0x75d8('0x1b')],_0x53fc52['device']));switch(_0x53fc52[_0x75d8('0x1b')]){case _0x75d8('0x1c'):case _0x75d8('0x1d'):if(!startsWith(exclude,_0x53fc52['device'])){members[_0x53fc52['device']]={'channel':'voice','interface':_0x53fc52['device'],'type':'TALKING','enterAt':utils[_0x75d8('0x1e')](),'role':'agent'};}break;case'NOT_INUSE':if(!_[_0x75d8('0x1f')](members[_0x53fc52[_0x75d8('0x19')]])){members[_0x53fc52['device']][_0x75d8('0x20')]=utils[_0x75d8('0x1e')]();members[_0x53fc52['device']][_0x75d8('0x21')]=utils[_0x75d8('0x22')](members[_0x53fc52[_0x75d8('0x19')]]['exitAt'],members[_0x53fc52[_0x75d8('0x19')]]['enterAt']);if(members[_0x53fc52[_0x75d8('0x19')]][_0x75d8('0x7')]){writeDB(members[_0x53fc52[_0x75d8('0x19')]]);}}break;default:break;}}catch(_0x5e4407){utils[_0x75d8('0x14')](util[_0x75d8('0x5')]('[%s][members][devicestatechange]',members[_0x53fc52[_0x75d8('0x19')]]?members[_0x53fc52[_0x75d8('0x19')]]['uniqueid']:_0x53fc52[_0x75d8('0x19')]),_0x5e4407);}};exports['agentcomplete']=function(_0x1c403f){try{if(!_[_0x75d8('0x1f')](members[_0x1c403f[_0x75d8('0xc')]])){utils['debug'](util['format'](_0x75d8('0x23'),_0x1c403f[_0x75d8('0x7')]),_0x1c403f);utils['info'](util['format'](_0x75d8('0x24'),_0x1c403f[_0x75d8('0x7')],_0x1c403f[_0x75d8('0xc')],_0x1c403f[_0x75d8('0x25')]));members[_0x1c403f[_0x75d8('0xc')]]=_[_0x75d8('0x26')](members[_0x1c403f[_0x75d8('0xc')]],{'data4':_0x1c403f[_0x75d8('0x25')],'uniqueid':_0x1c403f[_0x75d8('0x7')]});}}catch(_0x1fca0f){utils[_0x75d8('0x14')](util[_0x75d8('0x5')](_0x75d8('0x23'),_0x1c403f[_0x75d8('0x7')]),_0x1fca0f);}};exports[_0x75d8('0x27')]=function(_0x35c095){try{utils[_0x75d8('0x28')](util[_0x75d8('0x5')](_0x75d8('0x29'),_0x35c095[_0x75d8('0x7')]),_0x35c095);if(_0x35c095[_0x75d8('0x2a')]){var _0x1d822f=_0x35c095['channel'][_0x75d8('0x11')]('-')[0x0];if(!_['isNil'](members[_0x1d822f])){members[_0x1d822f]=_[_0x75d8('0x26')](members[_0x1d822f],{'data1':members[_0x1d822f][_0x75d8('0x2b')]||_0x35c095[_0x75d8('0xa')],'data2':members[_0x1d822f][_0x75d8('0x8')]||_0x35c095[_0x75d8('0x2c')],'data3':members[_0x1d822f][_0x75d8('0x2d')]||_0x35c095[_0x75d8('0x2e')],'uniqueid':members[_0x1d822f][_0x75d8('0x7')]||_0x35c095[_0x75d8('0x7')]});utils[_0x75d8('0x4')](util[_0x75d8('0x5')](_0x75d8('0x2f'),_0x35c095[_0x75d8('0x7')],members[_0x1d822f]['data1'],members[_0x1d822f][_0x75d8('0x8')],members[_0x1d822f][_0x75d8('0x2d')]));if(members[_0x1d822f]['exitAt']){writeDB(members[_0x1d822f]);}}}if(_0x35c095[_0x75d8('0x30')]){var _0x8fe776=_0x35c095[_0x75d8('0x30')][_0x75d8('0x11')]('-')[0x0];if(!_[_0x75d8('0x1f')](members[_0x8fe776])){members[_0x8fe776]=_['assign'](members[_0x8fe776],{'data1':members[_0x8fe776][_0x75d8('0x2b')]||_0x35c095[_0x75d8('0xa')],'data2':members[_0x8fe776][_0x75d8('0x8')]||_0x35c095[_0x75d8('0x2c')],'data3':members[_0x8fe776][_0x75d8('0x2d')]||_0x35c095[_0x75d8('0x2e')],'uniqueid':members[_0x8fe776][_0x75d8('0x7')]||_0x35c095[_0x75d8('0x7')]});utils[_0x75d8('0x4')](util['format'](_0x75d8('0x2f'),_0x35c095[_0x75d8('0x7')],members[_0x8fe776][_0x75d8('0x2b')],members[_0x8fe776][_0x75d8('0x8')],members[_0x8fe776][_0x75d8('0x2d')]));if(members[_0x8fe776]['exitAt']){writeDB(members[_0x8fe776]);}}}}catch(_0x3fa0e1){utils['error'](util[_0x75d8('0x5')]('[%s][members][cdr]',_0x35c095[_0x75d8('0x7')]),_0x3fa0e1);}};
\ No newline at end of file
+var _0x6aff=['enterAt','error','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','assign','cdr','[%s][members][cdr]','data1','source','data3','destination','destinationchannel','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','util','./utils','Local/_attended@transfer','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','channel','data2','membername','type','interface','getUserByInterface','name','internal','CreateMemberReport','split','then','request','[%s][members][writeDB]','devicestatechange','debug','[%s][members][devicestatechange]','uniqueid','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','TALKING','agent','NOT_INUSE','isNil','exitAt','now','diffTime'];(function(_0x5a51c1,_0x394c67){var _0x38f5fb=function(_0xa5d3d0){while(--_0xa5d3d0){_0x5a51c1['push'](_0x5a51c1['shift']());}};_0x38f5fb(++_0x394c67);}(_0x6aff,0x15e));var _0xf6af=function(_0x12507f,_0xb7322e){_0x12507f=_0x12507f-0x0;var _0x4467ed=_0x6aff[_0x12507f];return _0x4467ed;};'use strict';var _=require('lodash');var util=require(_0xf6af('0x0'));var utils=require(_0xf6af('0x1'));var members={};var exclude=[_0xf6af('0x2'),'Queue:'];function writeDB(_0x26279){utils[_0xf6af('0x3')](util[_0xf6af('0x4')](_0xf6af('0x5'),_0x26279['uniqueid'],_0x26279['interface'],_0x26279[_0xf6af('0x6')],_0x26279[_0xf6af('0x7')],_0x26279[_0xf6af('0x8')],_0x26279[_0xf6af('0x9')]));if(_0x26279[_0xf6af('0xa')]){utils[_0xf6af('0xb')](_0x26279[_0xf6af('0xa')])['then'](function(_0xc8676f){if(_0xc8676f){_0x26279[_0xf6af('0x8')]=_0xc8676f[_0xf6af('0xc')];_0x26279[_0xf6af('0xd')]=_0xc8676f['internal'];utils['request'](_0xf6af('0xe'),_0x26279);}else{utils['getUserByName'](_0x26279['interface'][_0xf6af('0xf')]('/')[0x1])[_0xf6af('0x10')](function(_0x5c47e4){if(_0x5c47e4){_0x26279[_0xf6af('0x8')]=_0x5c47e4['name'];_0x26279[_0xf6af('0xd')]=_0x5c47e4[_0xf6af('0xd')];utils[_0xf6af('0x11')]('CreateMemberReport',_0x26279);}});}})['catch'](function(_0xe0af59){utils['error'](util[_0xf6af('0x4')](_0xf6af('0x12'),_0x26279['uniqueid']),_0xe0af59);});}delete members[_0x26279[_0xf6af('0xa')]];}function startsWith(_0x35b0fc,_0x5b3a49){return _['some'](_0x35b0fc,function(_0x2cd6fb){return _['startsWith'](_0x5b3a49,_0x2cd6fb);});}exports[_0xf6af('0x13')]=function(_0x482972){try{utils[_0xf6af('0x14')](util[_0xf6af('0x4')](_0xf6af('0x15'),members[_0x482972['device']]?members[_0x482972['device']][_0xf6af('0x16')]:_0x482972[_0xf6af('0x17')]),_0x482972);utils[_0xf6af('0x3')](util[_0xf6af('0x4')](_0xf6af('0x18'),members[_0x482972['device']]?members[_0x482972['device']]['uniqueid']:_0x482972[_0xf6af('0x17')],_0x482972[_0xf6af('0x19')],_0x482972[_0xf6af('0x17')]));switch(_0x482972['state']){case _0xf6af('0x1a'):case'BUSY':if(!startsWith(exclude,_0x482972[_0xf6af('0x17')])){members[_0x482972[_0xf6af('0x17')]]={'channel':'voice','interface':_0x482972[_0xf6af('0x17')],'type':_0xf6af('0x1b'),'enterAt':utils['now'](),'role':_0xf6af('0x1c')};}break;case _0xf6af('0x1d'):if(!_[_0xf6af('0x1e')](members[_0x482972['device']])){members[_0x482972[_0xf6af('0x17')]][_0xf6af('0x1f')]=utils[_0xf6af('0x20')]();members[_0x482972[_0xf6af('0x17')]]['duration']=utils[_0xf6af('0x21')](members[_0x482972[_0xf6af('0x17')]][_0xf6af('0x1f')],members[_0x482972['device']][_0xf6af('0x22')]);if(members[_0x482972[_0xf6af('0x17')]][_0xf6af('0x16')]){writeDB(members[_0x482972[_0xf6af('0x17')]]);}}break;default:break;}}catch(_0x5d44dc){utils[_0xf6af('0x23')](util[_0xf6af('0x4')](_0xf6af('0x15'),members[_0x482972[_0xf6af('0x17')]]?members[_0x482972[_0xf6af('0x17')]]['uniqueid']:_0x482972[_0xf6af('0x17')]),_0x5d44dc);}};exports['agentcomplete']=function(_0x2f39de){try{if(!_[_0xf6af('0x1e')](members[_0x2f39de['interface']])){utils[_0xf6af('0x14')](util[_0xf6af('0x4')](_0xf6af('0x24'),_0x2f39de[_0xf6af('0x16')]),_0x2f39de);utils[_0xf6af('0x3')](util['format'](_0xf6af('0x25'),_0x2f39de[_0xf6af('0x16')],_0x2f39de[_0xf6af('0xa')],_0x2f39de[_0xf6af('0x26')]));members[_0x2f39de[_0xf6af('0xa')]]=_[_0xf6af('0x27')](members[_0x2f39de[_0xf6af('0xa')]],{'data4':_0x2f39de[_0xf6af('0x26')],'uniqueid':_0x2f39de[_0xf6af('0x16')]});}}catch(_0x259fe1){utils['error'](util[_0xf6af('0x4')]('[%s][members][agentcomplete]',_0x2f39de[_0xf6af('0x16')]),_0x259fe1);}};exports[_0xf6af('0x28')]=function(_0x16a1ae){try{utils[_0xf6af('0x14')](util[_0xf6af('0x4')](_0xf6af('0x29'),_0x16a1ae[_0xf6af('0x16')]),_0x16a1ae);if(_0x16a1ae[_0xf6af('0x6')]){var _0x8639d5=_0x16a1ae[_0xf6af('0x6')][_0xf6af('0xf')]('-')[0x0];if(!_['isNil'](members[_0x8639d5])){members[_0x8639d5]=_[_0xf6af('0x27')](members[_0x8639d5],{'data1':members[_0x8639d5][_0xf6af('0x2a')]||_0x16a1ae[_0xf6af('0x9')],'data2':members[_0x8639d5][_0xf6af('0x7')]||_0x16a1ae[_0xf6af('0x2b')],'data3':members[_0x8639d5][_0xf6af('0x2c')]||_0x16a1ae[_0xf6af('0x2d')],'uniqueid':members[_0x8639d5]['uniqueid']||_0x16a1ae[_0xf6af('0x16')]});utils['info'](util[_0xf6af('0x4')]('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x16a1ae[_0xf6af('0x16')],members[_0x8639d5][_0xf6af('0x2a')],members[_0x8639d5]['data2'],members[_0x8639d5][_0xf6af('0x2c')]));if(members[_0x8639d5][_0xf6af('0x1f')]){writeDB(members[_0x8639d5]);}}}if(_0x16a1ae['destinationchannel']){var _0x363a6f=_0x16a1ae[_0xf6af('0x2e')][_0xf6af('0xf')]('-')[0x0];if(!_[_0xf6af('0x1e')](members[_0x363a6f])){members[_0x363a6f]=_['assign'](members[_0x363a6f],{'data1':members[_0x363a6f][_0xf6af('0x2a')]||_0x16a1ae[_0xf6af('0x9')],'data2':members[_0x363a6f][_0xf6af('0x7')]||_0x16a1ae[_0xf6af('0x2b')],'data3':members[_0x363a6f][_0xf6af('0x2c')]||_0x16a1ae[_0xf6af('0x2d')],'uniqueid':members[_0x363a6f][_0xf6af('0x16')]||_0x16a1ae[_0xf6af('0x16')]});utils[_0xf6af('0x3')](util[_0xf6af('0x4')](_0xf6af('0x2f'),_0x16a1ae['uniqueid'],members[_0x363a6f]['data1'],members[_0x363a6f][_0xf6af('0x7')],members[_0x363a6f][_0xf6af('0x2c')]));if(members[_0x363a6f][_0xf6af('0x1f')]){writeDB(members[_0x363a6f]);}}}}catch(_0x20fcd6){utils[_0xf6af('0x23')](util[_0xf6af('0x4')](_0xf6af('0x29'),_0x16a1ae[_0xf6af('0x16')]),_0x20fcd6);}};
\ No newline at end of file
index 6fa5913..cb7a77b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf853=['secondtransfererlinkedid','origtransfererexten','ATTENDED','ATTENDEDTRANSFER','origtransfererlinkedid','transfereelinkedid','transfertargetuniqueid','calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','transfertargetlinkedid','clone','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','musiconholdstart','musiconholdstartAt','[%s][queues][musiconholdstart]','musiconholdstop','[%s][queues][musiconholdstop]','lodash','util','./utils','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','queue','calleridnum','accountcode','queuecallerexitreason','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','debug','format','info','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign','now','error','[%s][queues][queuecallerjoin]','hangup','isNil','[%s][queues][hangup]','queuecallerleaveAt','queuecallerabandon','queuecallercomplete','queuecallercompleteAt','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','varset','[%s][queues][varset]','queuestatus','value','toUpperCase','CONTINUE','queuecallerabandonAt','queuecallerexit','queuecallerexitAt','variable','queueposition','[%s][queues][queuecallerabandon]','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','connectedlinename','holdtime','queuecallerjoinAt','count','agentconnect','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','assigned','lastAssignedTo','agentcomplete','[%s][queues][agentcomplete]','reason','transfer','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','blindtransfer','transfereeuniqueid','[%s][queues][blindtransfer]','transfertype','BLIND','transferexten','extension','transferuniqueid','BLINDTRANSFER','[%s][queues][attendedtransfer]','origtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf853,0xe6));var _0x3f85=function(_0x3a6e4b,_0x118cd9){_0x3a6e4b=_0x3a6e4b-0x0;var _0x36572d=_0xf853[_0x3a6e4b];return _0x36572d;};'use strict';var _=require(_0x3f85('0x0'));var util=require(_0x3f85('0x1'));var utils=require(_0x3f85('0x2'));var queues={};function writeDB(_0x169a83){utils['info'](util['format'](_0x3f85('0x3'),_0x169a83[_0x3f85('0x4')],_0x169a83[_0x3f85('0x5')],_0x169a83[_0x3f85('0x6')],_0x169a83['lastAssignedTo'],_0x169a83[_0x3f85('0x7')],_0x169a83[_0x3f85('0x8')],_0x169a83[_0x3f85('0x9')]));if(_0x169a83[_0x3f85('0x6')]){utils[_0x3f85('0xa')](_0x169a83[_0x3f85('0x6')])[_0x3f85('0xb')](function(_0x451391){if(_0x451391){_0x169a83[_0x3f85('0xc')]=_0x451391[_0x3f85('0xc')];}utils[_0x3f85('0xd')](_0x3f85('0xe'),_0x169a83);});}else{utils[_0x3f85('0xd')]('CreateVoiceQueueReport',_0x169a83);}if(_0x169a83[_0x3f85('0xf')]){delete queues[_0x169a83[_0x3f85('0xf')]];}else{delete queues[_0x169a83[_0x3f85('0x4')]];}}exports[_0x3f85('0x10')]=function(_0x4aa9e9){try{utils[_0x3f85('0x11')](util[_0x3f85('0x12')]('[%s][queues][queuecallerjoin]',_0x4aa9e9[_0x3f85('0x4')]),_0x4aa9e9);utils[_0x3f85('0x13')](util[_0x3f85('0x12')](_0x3f85('0x14'),_0x4aa9e9[_0x3f85('0x4')],_0x4aa9e9[_0x3f85('0x6')],_0x4aa9e9[_0x3f85('0x15')]));queues[_0x4aa9e9['uniqueid']]=_[_0x3f85('0x16')](_0x4aa9e9,{'originalposition':_0x4aa9e9[_0x3f85('0x15')],'queuecallerjoinAt':utils[_0x3f85('0x17')](),'mohtime':0x0});}catch(_0x3e18ae){utils[_0x3f85('0x18')](util[_0x3f85('0x12')](_0x3f85('0x19'),_0x4aa9e9['uniqueid']),_0x3e18ae);}};exports[_0x3f85('0x1a')]=function(_0x2717a1){try{if(!_[_0x3f85('0x1b')](queues[_0x2717a1['uniqueid']])){utils[_0x3f85('0x11')](util['format'](_0x3f85('0x1c'),_0x2717a1[_0x3f85('0x4')]),_0x2717a1);if(queues[_0x2717a1[_0x3f85('0x4')]][_0x3f85('0x1d')]){if(!queues[_0x2717a1['uniqueid']][_0x3f85('0x1e')]&&!queues[_0x2717a1[_0x3f85('0x4')]]['queuecallerexit']){queues[_0x2717a1['uniqueid']][_0x3f85('0x1f')]=!![];queues[_0x2717a1[_0x3f85('0x4')]][_0x3f85('0x20')]=utils[_0x3f85('0x17')]();queues[_0x2717a1[_0x3f85('0x4')]]['queuecallerexitreason']='COMPLETEDBYAGENT';}utils['info'](util[_0x3f85('0x12')](_0x3f85('0x21'),_0x2717a1['uniqueid'],queues[_0x2717a1['uniqueid']][_0x3f85('0x22')],queues[_0x2717a1[_0x3f85('0x4')]][_0x3f85('0x9')]));writeDB(queues[_0x2717a1[_0x3f85('0x4')]]);}else if(queues[_0x2717a1['uniqueid']][_0x3f85('0xf')]){utils[_0x3f85('0x13')](util[_0x3f85('0x12')](_0x3f85('0x23'),_0x2717a1[_0x3f85('0x4')],queues[_0x2717a1[_0x3f85('0x4')]][_0x3f85('0x22')],queues[_0x2717a1['uniqueid']][_0x3f85('0xf')]));queues[queues[_0x2717a1[_0x3f85('0x4')]][_0x3f85('0xf')]]=queues[_0x2717a1[_0x3f85('0x4')]];queues[queues[_0x2717a1[_0x3f85('0x4')]][_0x3f85('0xf')]][_0x3f85('0x24')]=0x2;delete queues[_0x2717a1[_0x3f85('0x4')]];}}}catch(_0x1b8cda){utils['error'](util[_0x3f85('0x12')](_0x3f85('0x1c'),_0x2717a1[_0x3f85('0x4')]),_0x1b8cda);}};exports[_0x3f85('0x25')]=function(_0x243e8f){try{utils[_0x3f85('0x11')](util['format'](_0x3f85('0x26'),_0x243e8f[_0x3f85('0x4')]),_0x243e8f);if(!_[_0x3f85('0x1b')](_0x243e8f['variable'][_0x3f85('0x27')])&&_0x243e8f[_0x3f85('0x28')][_0x3f85('0x29')]()!==_0x3f85('0x2a')){if(!_[_0x3f85('0x1b')](queues[_0x243e8f[_0x3f85('0x4')]])){queues[_0x243e8f[_0x3f85('0x4')]][_0x3f85('0x1e')]=![];queues[_0x243e8f[_0x3f85('0x4')]][_0x3f85('0x2b')]=null;queues[_0x243e8f[_0x3f85('0x4')]][_0x3f85('0x2c')]=!![];queues[_0x243e8f[_0x3f85('0x4')]][_0x3f85('0x2d')]=utils[_0x3f85('0x17')]();queues[_0x243e8f[_0x3f85('0x4')]]['queuecallerexitreason']=_0x243e8f[_0x3f85('0x28')]['toUpperCase']();utils[_0x3f85('0x13')](util[_0x3f85('0x12')]('[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s',_0x243e8f[_0x3f85('0x4')],queues[_0x243e8f[_0x3f85('0x4')]][_0x3f85('0x22')],_0x243e8f['value'],queues[_0x243e8f[_0x3f85('0x4')]][_0x3f85('0x9')]));writeDB(queues[_0x243e8f[_0x3f85('0x4')]]);}}else if(!_[_0x3f85('0x1b')](_0x243e8f[_0x3f85('0x2e')][_0x3f85('0x2f')])){if(!_['isNil'](queues[_0x243e8f['uniqueid']])&&!queues[_0x243e8f[_0x3f85('0x4')]][_0x3f85('0x1e')]){queues[_0x243e8f['uniqueid']][_0x3f85('0x1e')]=![];queues[_0x243e8f['uniqueid']]['queuecallerabandonAt']=null;queues[_0x243e8f[_0x3f85('0x4')]]['queuecallerexit']=!![];queues[_0x243e8f[_0x3f85('0x4')]]['queuecallerexitAt']=utils['now']();queues[_0x243e8f['uniqueid']][_0x3f85('0x9')]='EXITWITHKEY';utils['info'](util['format']('[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s',_0x243e8f['uniqueid'],queues[_0x243e8f[_0x3f85('0x4')]]['name'],_0x243e8f[_0x3f85('0x28')],queues[_0x243e8f[_0x3f85('0x4')]][_0x3f85('0x9')]));}}}catch(_0x59167c){utils[_0x3f85('0x18')](util['format'](_0x3f85('0x26'),_0x243e8f[_0x3f85('0x4')]),_0x59167c);}};exports[_0x3f85('0x1e')]=function(_0x768d73){try{if(!_['isNil'](queues[_0x768d73[_0x3f85('0x4')]])){utils['debug'](util['format'](_0x3f85('0x30'),_0x768d73[_0x3f85('0x4')]),_0x768d73);queues[_0x768d73[_0x3f85('0x4')]][_0x3f85('0x2c')]=![];queues[_0x768d73[_0x3f85('0x4')]][_0x3f85('0x2d')]=null;queues[_0x768d73[_0x3f85('0x4')]][_0x3f85('0x1e')]=!![];queues[_0x768d73[_0x3f85('0x4')]][_0x3f85('0x2b')]=utils[_0x3f85('0x17')]();queues[_0x768d73[_0x3f85('0x4')]][_0x3f85('0x9')]=_0x3f85('0x31');utils[_0x3f85('0x13')](util[_0x3f85('0x12')](_0x3f85('0x32'),_0x768d73[_0x3f85('0x4')],queues[_0x768d73[_0x3f85('0x4')]][_0x3f85('0x22')],queues[_0x768d73['uniqueid']][_0x3f85('0x9')]));}}catch(_0x314e71){utils['error'](util[_0x3f85('0x12')]('[%s][queues][queuecallerabandon]',_0x768d73[_0x3f85('0x4')]),_0x314e71);}};exports['queuecallerleave']=function(_0x4019b8){try{if(!_[_0x3f85('0x1b')](queues[_0x4019b8[_0x3f85('0x4')]])){utils[_0x3f85('0x11')](util[_0x3f85('0x12')](_0x3f85('0x33'),_0x4019b8[_0x3f85('0x4')]),_0x4019b8);utils[_0x3f85('0x13')](util[_0x3f85('0x12')](_0x3f85('0x34'),_0x4019b8[_0x3f85('0x4')],queues[_0x4019b8[_0x3f85('0x4')]][_0x3f85('0x22')],_0x4019b8[_0x3f85('0x35')],_0x4019b8[_0x3f85('0x36')]));queues[_0x4019b8[_0x3f85('0x4')]]['queuecallerleave']=!![];queues[_0x4019b8[_0x3f85('0x4')]][_0x3f85('0x1d')]=utils[_0x3f85('0x17')]();queues[_0x4019b8[_0x3f85('0x4')]][_0x3f85('0x37')]=utils['diffTime'](queues[_0x4019b8[_0x3f85('0x4')]][_0x3f85('0x1d')],queues[_0x4019b8[_0x3f85('0x4')]][_0x3f85('0x38')]);queues[_0x4019b8[_0x3f85('0x4')]]['position']=_0x4019b8[_0x3f85('0x15')];queues[_0x4019b8['uniqueid']][_0x3f85('0x39')]=_0x4019b8[_0x3f85('0x39')];queues[_0x4019b8[_0x3f85('0x4')]][_0x3f85('0x35')]=_0x4019b8[_0x3f85('0x35')];queues[_0x4019b8[_0x3f85('0x4')]][_0x3f85('0x36')]=_0x4019b8[_0x3f85('0x36')];}}catch(_0x385346){utils['error'](util['format'](_0x3f85('0x33'),_0x4019b8[_0x3f85('0x4')]),_0x385346);}};exports[_0x3f85('0x3a')]=function(_0x35ae85){try{if(!_['isNil'](queues[_0x35ae85['uniqueid']])){utils[_0x3f85('0x11')](util['format'](_0x3f85('0x3b'),_0x35ae85[_0x3f85('0x4')]),_0x35ae85);utils[_0x3f85('0x13')](util[_0x3f85('0x12')](_0x3f85('0x3c'),_0x35ae85[_0x3f85('0x4')],queues[_0x35ae85[_0x3f85('0x4')]]['name'],_0x35ae85[_0x3f85('0x3d')],_0x35ae85[_0x3f85('0x3e')]));queues[_0x35ae85[_0x3f85('0x4')]][_0x3f85('0x1e')]=![];queues[_0x35ae85['uniqueid']][_0x3f85('0x1e')]=![];queues[_0x35ae85[_0x3f85('0x4')]]['queuecallerabandonAt']=null;queues[_0x35ae85['uniqueid']][_0x3f85('0x2c')]=![];queues[_0x35ae85[_0x3f85('0x4')]][_0x3f85('0x9')]=null;queues[_0x35ae85[_0x3f85('0x4')]]['queuecallerexitAt']=null;queues[_0x35ae85[_0x3f85('0x4')]][_0x3f85('0x3f')]=!![];queues[_0x35ae85['uniqueid']][_0x3f85('0x8')]=_0x35ae85[_0x3f85('0x3e')];queues[_0x35ae85[_0x3f85('0x4')]][_0x3f85('0x40')]=_0x35ae85[_0x3f85('0x3d')];}}catch(_0x4802d7){utils['error'](util[_0x3f85('0x12')](_0x3f85('0x3b'),_0x35ae85[_0x3f85('0x4')]),_0x4802d7);}};exports[_0x3f85('0x41')]=function(_0x34eac8){try{if(!_['isNil'](queues[_0x34eac8[_0x3f85('0x4')]])){if(queues[_0x34eac8[_0x3f85('0x4')]][_0x3f85('0x1d')]){utils[_0x3f85('0x11')](util[_0x3f85('0x12')](_0x3f85('0x42'),_0x34eac8['uniqueid']),_0x34eac8);queues[_0x34eac8[_0x3f85('0x4')]][_0x3f85('0x1e')]=![];queues[_0x34eac8['uniqueid']]['queuecallerabandon']=![];queues[_0x34eac8[_0x3f85('0x4')]]['queuecallerabandonAt']=null;queues[_0x34eac8[_0x3f85('0x4')]]['queuecallerexit']=![];queues[_0x34eac8['uniqueid']][_0x3f85('0x2d')]=null;queues[_0x34eac8[_0x3f85('0x4')]]['assigned']=!![];queues[_0x34eac8['uniqueid']]['lastAssignedTo']=_0x34eac8[_0x3f85('0x3d')];queues[_0x34eac8[_0x3f85('0x4')]][_0x3f85('0x1f')]=!![];queues[_0x34eac8[_0x3f85('0x4')]]['queuecallercompleteAt']=utils[_0x3f85('0x17')]();if(_0x34eac8[_0x3f85('0x43')]==_0x3f85('0x44')){if(!queues[_0x34eac8[_0x3f85('0x4')]][_0x3f85('0x44')]){queues[_0x34eac8['uniqueid']]['queuecallerexitreason']='TRANSFER';}}else{queues[_0x34eac8[_0x3f85('0x4')]][_0x3f85('0x9')]='COMPLETEDBY'+_0x34eac8[_0x3f85('0x43')][_0x3f85('0x29')]();}utils['info'](util[_0x3f85('0x12')](_0x3f85('0x45'),_0x34eac8[_0x3f85('0x4')],queues[_0x34eac8['uniqueid']][_0x3f85('0x22')],_0x34eac8[_0x3f85('0x3d')],queues[_0x34eac8[_0x3f85('0x4')]][_0x3f85('0x9')]));writeDB(queues[_0x34eac8['uniqueid']]);}}}catch(_0x2cff4b){utils['error'](util['format'](_0x3f85('0x42'),_0x34eac8[_0x3f85('0x4')]),_0x2cff4b);}};exports[_0x3f85('0x46')]=function(_0x24c4bb){try{if(!_[_0x3f85('0x1b')](queues[_0x24c4bb[_0x3f85('0x47')]])){utils[_0x3f85('0x11')](util[_0x3f85('0x12')](_0x3f85('0x48'),_0x24c4bb[_0x3f85('0x4')]),_0x24c4bb);queues[_0x24c4bb[_0x3f85('0x47')]]['transfer']=!![];queues[_0x24c4bb[_0x3f85('0x47')]][_0x3f85('0x49')]=_0x3f85('0x4a');queues[_0x24c4bb[_0x3f85('0x47')]][_0x3f85('0x4b')]=_0x24c4bb[_0x3f85('0x4c')];queues[_0x24c4bb[_0x3f85('0x47')]][_0x3f85('0x4d')]=_0x24c4bb[_0x3f85('0x47')];queues[_0x24c4bb[_0x3f85('0x47')]][_0x3f85('0x9')]=_0x3f85('0x4e');utils[_0x3f85('0x13')](util[_0x3f85('0x12')]('[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER',_0x24c4bb[_0x3f85('0x4')],queues[_0x24c4bb[_0x3f85('0x47')]]['name'],_0x24c4bb[_0x3f85('0x47')],_0x24c4bb['extension']));}}catch(_0x3da805){utils['error'](util[_0x3f85('0x12')](_0x3f85('0x48'),_0x24c4bb[_0x3f85('0x4')]),_0x3da805);}};exports['attendedtransfer']=function(_0xed3d7f){try{utils[_0x3f85('0x11')](util[_0x3f85('0x12')](_0x3f85('0x4f'),_0xed3d7f[_0x3f85('0x50')]),_0xed3d7f);if(_0xed3d7f[_0x3f85('0x50')]==_0xed3d7f['origtransfererlinkedid']){if(!_[_0x3f85('0x1b')](queues[_0xed3d7f['secondtransfererlinkedid']])){utils[_0x3f85('0x13')](util[_0x3f85('0x12')](_0x3f85('0x51'),_0xed3d7f[_0x3f85('0x50')],queues[_0xed3d7f[_0x3f85('0x52')]]['name'],_0xed3d7f[_0x3f85('0x53')]));queues[_0xed3d7f[_0x3f85('0x52')]]['transfer']=!![];queues[_0xed3d7f['secondtransfererlinkedid']][_0x3f85('0x49')]=_0x3f85('0x54');queues[_0xed3d7f[_0x3f85('0x52')]]['transferexten']=_0xed3d7f[_0x3f85('0x53')];queues[_0xed3d7f[_0x3f85('0x52')]][_0x3f85('0x4d')]=_0xed3d7f[_0x3f85('0x50')];queues[_0xed3d7f[_0x3f85('0x52')]][_0x3f85('0x9')]=_0x3f85('0x55');}if(!_[_0x3f85('0x1b')](queues[_0xed3d7f[_0x3f85('0x56')]])){if(_0xed3d7f['transfereelinkedid']&&queues[_0xed3d7f[_0x3f85('0x57')]]){queues[_0xed3d7f[_0x3f85('0x57')]]['queuecallerenterreason']=0x1;queues[_0xed3d7f[_0x3f85('0x47')]]=_['clone'](queues[_0xed3d7f[_0x3f85('0x57')]]);queues[_0xed3d7f[_0x3f85('0x47')]][_0x3f85('0xf')]=_0xed3d7f[_0x3f85('0x58')];queues[_0xed3d7f['transfereeuniqueid']][_0x3f85('0x24')]=0x2;queues[_0xed3d7f[_0x3f85('0x47')]][_0x3f85('0x7')]=queues[_0xed3d7f[_0x3f85('0x52')]]['calleridnum'];queues[_0xed3d7f['transfereeuniqueid']][_0x3f85('0x59')]=queues[_0xed3d7f[_0x3f85('0x52')]][_0x3f85('0x59')];queues[_0xed3d7f[_0x3f85('0x47')]][_0x3f85('0x38')]=utils[_0x3f85('0x17')]();queues[_0xed3d7f[_0x3f85('0x47')]][_0x3f85('0x1d')]=utils[_0x3f85('0x17')]();queues[_0xed3d7f[_0x3f85('0x47')]][_0x3f85('0x37')]=0x0;queues[_0xed3d7f['transfereeuniqueid']][_0x3f85('0x5a')]=0x0;utils[_0x3f85('0x13')](util[_0x3f85('0x12')](_0x3f85('0x5b'),_0xed3d7f[_0x3f85('0x50')],queues[_0xed3d7f[_0x3f85('0x47')]][_0x3f85('0x22')],queues[_0xed3d7f[_0x3f85('0x47')]]['calleridnum'],queues[_0xed3d7f[_0x3f85('0x47')]]['calleridname']));}else{utils['info'](util[_0x3f85('0x12')](_0x3f85('0x5c'),_0xed3d7f[_0x3f85('0x50')],queues[_0xed3d7f[_0x3f85('0x56')]][_0x3f85('0x22')],_0xed3d7f[_0x3f85('0x52')]));queues[_0xed3d7f[_0x3f85('0x56')]][_0x3f85('0xf')]=_0xed3d7f[_0x3f85('0x52')];}}}else if(_0xed3d7f[_0x3f85('0x5d')]==_0xed3d7f['secondtransfererlinkedid']){if(!_[_0x3f85('0x1b')](queues[_0xed3d7f[_0x3f85('0x56')]])){utils[_0x3f85('0x13')](util[_0x3f85('0x12')](_0x3f85('0x5e'),_0xed3d7f['origtransfereruniqueid'],queues[_0xed3d7f[_0x3f85('0x56')]][_0x3f85('0x22')],_0xed3d7f[_0x3f85('0x5d')],_0xed3d7f[_0x3f85('0x5f')]));queues[_0xed3d7f[_0x3f85('0x56')]][_0x3f85('0x44')]=!![];queues[_0xed3d7f[_0x3f85('0x56')]][_0x3f85('0x49')]=_0x3f85('0x54');queues[_0xed3d7f[_0x3f85('0x56')]][_0x3f85('0x4b')]=_0xed3d7f['secondtransfererexten'];queues[_0xed3d7f[_0x3f85('0x56')]][_0x3f85('0x4d')]=_0xed3d7f[_0x3f85('0x5d')];queues[_0xed3d7f[_0x3f85('0x56')]][_0x3f85('0x9')]='ATTENDEDTRANSFER';}if(!_[_0x3f85('0x1b')](queues[_0xed3d7f[_0x3f85('0x52')]])){if(_0xed3d7f[_0x3f85('0x60')]&&queues[_0xed3d7f['transfertargetlinkedid']]){queues[_0xed3d7f[_0x3f85('0x60')]][_0x3f85('0x24')]=0x1;queues[_0xed3d7f['transfertargetuniqueid']]=_[_0x3f85('0x61')](queues[_0xed3d7f[_0x3f85('0x60')]]);queues[_0xed3d7f[_0x3f85('0x58')]][_0x3f85('0xf')]=_0xed3d7f['transfertargetuniqueid'];queues[_0xed3d7f[_0x3f85('0x58')]][_0x3f85('0x24')]=0x2;queues[_0xed3d7f[_0x3f85('0x58')]][_0x3f85('0x7')]=queues[_0xed3d7f[_0x3f85('0x56')]]['calleridnum'];queues[_0xed3d7f[_0x3f85('0x58')]]['calleridname']=queues[_0xed3d7f['origtransfererlinkedid']]['calleridname'];queues[_0xed3d7f[_0x3f85('0x58')]][_0x3f85('0x38')]=utils['now']();queues[_0xed3d7f['transfertargetuniqueid']][_0x3f85('0x1d')]=utils['now']();queues[_0xed3d7f['transfertargetuniqueid']][_0x3f85('0x37')]=0x0;queues[_0xed3d7f['transfertargetuniqueid']][_0x3f85('0x5a')]=0x0;utils[_0x3f85('0x13')](util[_0x3f85('0x12')](_0x3f85('0x62'),_0xed3d7f[_0x3f85('0x50')],queues[_0xed3d7f[_0x3f85('0x58')]][_0x3f85('0x22')],queues[_0xed3d7f[_0x3f85('0x58')]][_0x3f85('0xf')],queues[_0xed3d7f[_0x3f85('0x58')]][_0x3f85('0x7')],queues[_0xed3d7f['transfertargetuniqueid']][_0x3f85('0x59')]));}else{utils[_0x3f85('0x13')](util[_0x3f85('0x12')](_0x3f85('0x5c'),_0xed3d7f[_0x3f85('0x50')],queues[_0xed3d7f[_0x3f85('0x52')]][_0x3f85('0x22')],_0xed3d7f[_0x3f85('0x56')]));queues[_0xed3d7f[_0x3f85('0x52')]]['transfereduniqueid']=_0xed3d7f[_0x3f85('0x56')];}}}}catch(_0x4371a7){utils[_0x3f85('0x18')](util[_0x3f85('0x12')](_0x3f85('0x4f'),_0xed3d7f[_0x3f85('0x50')]),_0x4371a7);}};exports[_0x3f85('0x63')]=function(_0x14c6eb){try{if(!_[_0x3f85('0x1b')](queues[_0x14c6eb[_0x3f85('0x4')]])){utils['debug'](util[_0x3f85('0x12')]('[%s][queues][musiconholdstart]',_0x14c6eb[_0x3f85('0x4')]),_0x14c6eb);queues[_0x14c6eb[_0x3f85('0x4')]]['musiconholdstartAt']=utils['now']();utils[_0x3f85('0x13')](util[_0x3f85('0x12')]('[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s',_0x14c6eb['uniqueid'],queues[_0x14c6eb[_0x3f85('0x4')]][_0x3f85('0x22')],queues[_0x14c6eb['uniqueid']][_0x3f85('0x64')]));}}catch(_0x65241e){utils[_0x3f85('0x18')](util[_0x3f85('0x12')](_0x3f85('0x65'),_0x14c6eb[_0x3f85('0x4')]),_0x65241e);}};exports[_0x3f85('0x66')]=function(_0x2f95d4){try{if(!_['isNil'](queues[_0x2f95d4[_0x3f85('0x4')]])){if(!_[_0x3f85('0x1b')](queues[_0x2f95d4[_0x3f85('0x4')]][_0x3f85('0x64')])){utils['debug'](util[_0x3f85('0x12')](_0x3f85('0x67'),_0x2f95d4['uniqueid']),_0x2f95d4);queues[_0x2f95d4[_0x3f85('0x4')]][_0x3f85('0x5a')]+=utils['diffTime'](utils[_0x3f85('0x17')](),queues[_0x2f95d4[_0x3f85('0x4')]]['musiconholdstartAt']);utils[_0x3f85('0x13')](util[_0x3f85('0x12')]('[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s',_0x2f95d4[_0x3f85('0x4')],queues[_0x2f95d4['uniqueid']][_0x3f85('0x22')],queues[_0x2f95d4[_0x3f85('0x4')]][_0x3f85('0x5a')]));delete queues[_0x2f95d4[_0x3f85('0x4')]][_0x3f85('0x64')];}}}catch(_0x7b551b){utils[_0x3f85('0x18')](util[_0x3f85('0x12')](_0x3f85('0x67'),_0x2f95d4[_0x3f85('0x4')]),_0x7b551b);}};
\ No newline at end of file
+var _0xfd8f=['connectedlinename','holdtime','diffTime','queuecallerjoinAt','count','agentconnect','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','assigned','agentcomplete','[%s][queues][agentcomplete]','reason','transfer','COMPLETEDBY','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','transfereeuniqueid','[%s][queues][blindtransfer]','transfertype','BLIND','transferexten','extension','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','ATTENDEDTRANSFER','transfereelinkedid','transfertargetuniqueid','calleridname','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','origtransfererlinkedid','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','ATTENDED','transfertargetlinkedid','clone','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]','mohtime','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','util','./utils','info','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','queue','lastAssignedTo','calleridnum','accountcode','queuecallerexitreason','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','[%s][queues][queuecallerjoin]','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign','now','error','hangup','isNil','debug','[%s][queues][hangup]','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercompleteAt','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','queuecallerenterreason','variable','toUpperCase','CONTINUE','queuecallerabandonAt','queuecallerexitAt','value','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queueposition','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][varset]','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','queuecallerleave','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum'];(function(_0x4fb5b1,_0x5931ed){var _0x3e6b53=function(_0x19c9cc){while(--_0x19c9cc){_0x4fb5b1['push'](_0x4fb5b1['shift']());}};_0x3e6b53(++_0x5931ed);}(_0xfd8f,0x10a));var _0xffd8=function(_0x348739,_0x195d3d){_0x348739=_0x348739-0x0;var _0x5bcfc6=_0xfd8f[_0x348739];return _0x5bcfc6;};'use strict';var _=require(_0xffd8('0x0'));var util=require(_0xffd8('0x1'));var utils=require(_0xffd8('0x2'));var queues={};function writeDB(_0x28de72){utils[_0xffd8('0x3')](util[_0xffd8('0x4')](_0xffd8('0x5'),_0x28de72[_0xffd8('0x6')],_0x28de72[_0xffd8('0x7')],_0x28de72[_0xffd8('0x8')],_0x28de72[_0xffd8('0x9')],_0x28de72[_0xffd8('0xa')],_0x28de72[_0xffd8('0xb')],_0x28de72[_0xffd8('0xc')]));if(_0x28de72[_0xffd8('0x8')]){utils[_0xffd8('0xd')](_0x28de72[_0xffd8('0x8')])[_0xffd8('0xe')](function(_0x16014a){if(_0x16014a){_0x28de72[_0xffd8('0xf')]=_0x16014a[_0xffd8('0xf')];}utils[_0xffd8('0x10')](_0xffd8('0x11'),_0x28de72);});}else{utils[_0xffd8('0x10')]('CreateVoiceQueueReport',_0x28de72);}if(_0x28de72[_0xffd8('0x12')]){delete queues[_0x28de72[_0xffd8('0x12')]];}else{delete queues[_0x28de72[_0xffd8('0x6')]];}}exports[_0xffd8('0x13')]=function(_0x369e37){try{utils['debug'](util['format'](_0xffd8('0x14'),_0x369e37[_0xffd8('0x6')]),_0x369e37);utils[_0xffd8('0x3')](util[_0xffd8('0x4')](_0xffd8('0x15'),_0x369e37['uniqueid'],_0x369e37[_0xffd8('0x8')],_0x369e37[_0xffd8('0x16')]));queues[_0x369e37[_0xffd8('0x6')]]=_[_0xffd8('0x17')](_0x369e37,{'originalposition':_0x369e37[_0xffd8('0x16')],'queuecallerjoinAt':utils[_0xffd8('0x18')](),'mohtime':0x0});}catch(_0xf05c8b){utils[_0xffd8('0x19')](util[_0xffd8('0x4')]('[%s][queues][queuecallerjoin]',_0x369e37['uniqueid']),_0xf05c8b);}};exports[_0xffd8('0x1a')]=function(_0x42ee7b){try{if(!_[_0xffd8('0x1b')](queues[_0x42ee7b[_0xffd8('0x6')]])){utils[_0xffd8('0x1c')](util['format'](_0xffd8('0x1d'),_0x42ee7b[_0xffd8('0x6')]),_0x42ee7b);if(queues[_0x42ee7b[_0xffd8('0x6')]][_0xffd8('0x1e')]){if(!queues[_0x42ee7b[_0xffd8('0x6')]][_0xffd8('0x1f')]&&!queues[_0x42ee7b[_0xffd8('0x6')]][_0xffd8('0x20')]){queues[_0x42ee7b[_0xffd8('0x6')]]['queuecallercomplete']=!![];queues[_0x42ee7b[_0xffd8('0x6')]][_0xffd8('0x21')]=utils[_0xffd8('0x18')]();queues[_0x42ee7b[_0xffd8('0x6')]]['queuecallerexitreason']='COMPLETEDBYAGENT';}utils[_0xffd8('0x3')](util['format'](_0xffd8('0x22'),_0x42ee7b[_0xffd8('0x6')],queues[_0x42ee7b['uniqueid']][_0xffd8('0x23')],queues[_0x42ee7b['uniqueid']][_0xffd8('0xc')]));writeDB(queues[_0x42ee7b[_0xffd8('0x6')]]);}else if(queues[_0x42ee7b[_0xffd8('0x6')]]['transfereduniqueid']){utils[_0xffd8('0x3')](util[_0xffd8('0x4')]('[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s',_0x42ee7b[_0xffd8('0x6')],queues[_0x42ee7b['uniqueid']][_0xffd8('0x23')],queues[_0x42ee7b[_0xffd8('0x6')]][_0xffd8('0x12')]));queues[queues[_0x42ee7b[_0xffd8('0x6')]][_0xffd8('0x12')]]=queues[_0x42ee7b[_0xffd8('0x6')]];queues[queues[_0x42ee7b[_0xffd8('0x6')]][_0xffd8('0x12')]][_0xffd8('0x24')]=0x2;delete queues[_0x42ee7b[_0xffd8('0x6')]];}}}catch(_0x17fff7){utils[_0xffd8('0x19')](util['format'](_0xffd8('0x1d'),_0x42ee7b[_0xffd8('0x6')]),_0x17fff7);}};exports['varset']=function(_0xba42b5){try{utils[_0xffd8('0x1c')](util[_0xffd8('0x4')]('[%s][queues][varset]',_0xba42b5[_0xffd8('0x6')]),_0xba42b5);if(!_[_0xffd8('0x1b')](_0xba42b5[_0xffd8('0x25')]['queuestatus'])&&_0xba42b5['value'][_0xffd8('0x26')]()!==_0xffd8('0x27')){if(!_[_0xffd8('0x1b')](queues[_0xba42b5[_0xffd8('0x6')]])){queues[_0xba42b5['uniqueid']][_0xffd8('0x1f')]=![];queues[_0xba42b5[_0xffd8('0x6')]][_0xffd8('0x28')]=null;queues[_0xba42b5[_0xffd8('0x6')]][_0xffd8('0x20')]=!![];queues[_0xba42b5[_0xffd8('0x6')]][_0xffd8('0x29')]=utils[_0xffd8('0x18')]();queues[_0xba42b5[_0xffd8('0x6')]][_0xffd8('0xc')]=_0xba42b5[_0xffd8('0x2a')][_0xffd8('0x26')]();utils['info'](util['format'](_0xffd8('0x2b'),_0xba42b5['uniqueid'],queues[_0xba42b5[_0xffd8('0x6')]][_0xffd8('0x23')],_0xba42b5['value'],queues[_0xba42b5[_0xffd8('0x6')]]['queuecallerexitreason']));writeDB(queues[_0xba42b5['uniqueid']]);}}else if(!_[_0xffd8('0x1b')](_0xba42b5[_0xffd8('0x25')][_0xffd8('0x2c')])){if(!_[_0xffd8('0x1b')](queues[_0xba42b5[_0xffd8('0x6')]])&&!queues[_0xba42b5[_0xffd8('0x6')]]['queuecallerabandon']){queues[_0xba42b5[_0xffd8('0x6')]][_0xffd8('0x1f')]=![];queues[_0xba42b5[_0xffd8('0x6')]][_0xffd8('0x28')]=null;queues[_0xba42b5['uniqueid']][_0xffd8('0x20')]=!![];queues[_0xba42b5[_0xffd8('0x6')]]['queuecallerexitAt']=utils[_0xffd8('0x18')]();queues[_0xba42b5[_0xffd8('0x6')]][_0xffd8('0xc')]=_0xffd8('0x2d');utils[_0xffd8('0x3')](util['format'](_0xffd8('0x2e'),_0xba42b5[_0xffd8('0x6')],queues[_0xba42b5['uniqueid']]['name'],_0xba42b5[_0xffd8('0x2a')],queues[_0xba42b5['uniqueid']][_0xffd8('0xc')]));}}}catch(_0x3061c6){utils[_0xffd8('0x19')](util['format'](_0xffd8('0x2f'),_0xba42b5[_0xffd8('0x6')]),_0x3061c6);}};exports[_0xffd8('0x1f')]=function(_0x401307){try{if(!_[_0xffd8('0x1b')](queues[_0x401307['uniqueid']])){utils[_0xffd8('0x1c')](util[_0xffd8('0x4')]('[%s][queues][queuecallerabandon]',_0x401307[_0xffd8('0x6')]),_0x401307);queues[_0x401307[_0xffd8('0x6')]][_0xffd8('0x20')]=![];queues[_0x401307[_0xffd8('0x6')]][_0xffd8('0x29')]=null;queues[_0x401307[_0xffd8('0x6')]][_0xffd8('0x1f')]=!![];queues[_0x401307[_0xffd8('0x6')]][_0xffd8('0x28')]=utils['now']();queues[_0x401307['uniqueid']]['queuecallerexitreason']=_0xffd8('0x30');utils[_0xffd8('0x3')](util[_0xffd8('0x4')](_0xffd8('0x31'),_0x401307[_0xffd8('0x6')],queues[_0x401307[_0xffd8('0x6')]]['name'],queues[_0x401307['uniqueid']][_0xffd8('0xc')]));}}catch(_0xe90776){utils[_0xffd8('0x19')](util[_0xffd8('0x4')](_0xffd8('0x32'),_0x401307[_0xffd8('0x6')]),_0xe90776);}};exports[_0xffd8('0x33')]=function(_0x2fa44b){try{if(!_[_0xffd8('0x1b')](queues[_0x2fa44b[_0xffd8('0x6')]])){utils[_0xffd8('0x1c')](util[_0xffd8('0x4')](_0xffd8('0x34'),_0x2fa44b['uniqueid']),_0x2fa44b);utils['info'](util[_0xffd8('0x4')](_0xffd8('0x35'),_0x2fa44b['uniqueid'],queues[_0x2fa44b[_0xffd8('0x6')]][_0xffd8('0x23')],_0x2fa44b[_0xffd8('0x36')],_0x2fa44b[_0xffd8('0x37')]));queues[_0x2fa44b[_0xffd8('0x6')]][_0xffd8('0x33')]=!![];queues[_0x2fa44b['uniqueid']][_0xffd8('0x1e')]=utils[_0xffd8('0x18')]();queues[_0x2fa44b[_0xffd8('0x6')]][_0xffd8('0x38')]=utils[_0xffd8('0x39')](queues[_0x2fa44b[_0xffd8('0x6')]][_0xffd8('0x1e')],queues[_0x2fa44b[_0xffd8('0x6')]][_0xffd8('0x3a')]);queues[_0x2fa44b[_0xffd8('0x6')]][_0xffd8('0x16')]=_0x2fa44b[_0xffd8('0x16')];queues[_0x2fa44b[_0xffd8('0x6')]][_0xffd8('0x3b')]=_0x2fa44b[_0xffd8('0x3b')];queues[_0x2fa44b[_0xffd8('0x6')]]['connectedlinenum']=_0x2fa44b[_0xffd8('0x36')];queues[_0x2fa44b['uniqueid']][_0xffd8('0x37')]=_0x2fa44b[_0xffd8('0x37')];}}catch(_0x568062){utils[_0xffd8('0x19')](util[_0xffd8('0x4')](_0xffd8('0x34'),_0x2fa44b[_0xffd8('0x6')]),_0x568062);}};exports[_0xffd8('0x3c')]=function(_0xec4987){try{if(!_[_0xffd8('0x1b')](queues[_0xec4987[_0xffd8('0x6')]])){utils[_0xffd8('0x1c')](util[_0xffd8('0x4')](_0xffd8('0x3d'),_0xec4987[_0xffd8('0x6')]),_0xec4987);utils[_0xffd8('0x3')](util[_0xffd8('0x4')](_0xffd8('0x3e'),_0xec4987[_0xffd8('0x6')],queues[_0xec4987[_0xffd8('0x6')]]['name'],_0xec4987[_0xffd8('0x3f')],_0xec4987[_0xffd8('0x40')]));queues[_0xec4987['uniqueid']][_0xffd8('0x1f')]=![];queues[_0xec4987[_0xffd8('0x6')]][_0xffd8('0x1f')]=![];queues[_0xec4987[_0xffd8('0x6')]]['queuecallerabandonAt']=null;queues[_0xec4987[_0xffd8('0x6')]][_0xffd8('0x20')]=![];queues[_0xec4987[_0xffd8('0x6')]][_0xffd8('0xc')]=null;queues[_0xec4987[_0xffd8('0x6')]][_0xffd8('0x29')]=null;queues[_0xec4987[_0xffd8('0x6')]][_0xffd8('0x41')]=!![];queues[_0xec4987[_0xffd8('0x6')]][_0xffd8('0xb')]=_0xec4987[_0xffd8('0x40')];queues[_0xec4987[_0xffd8('0x6')]][_0xffd8('0x9')]=_0xec4987[_0xffd8('0x3f')];}}catch(_0x13c082){utils['error'](util['format'](_0xffd8('0x3d'),_0xec4987[_0xffd8('0x6')]),_0x13c082);}};exports[_0xffd8('0x42')]=function(_0x252f0d){try{if(!_['isNil'](queues[_0x252f0d[_0xffd8('0x6')]])){if(queues[_0x252f0d[_0xffd8('0x6')]][_0xffd8('0x1e')]){utils[_0xffd8('0x1c')](util['format'](_0xffd8('0x43'),_0x252f0d[_0xffd8('0x6')]),_0x252f0d);queues[_0x252f0d[_0xffd8('0x6')]][_0xffd8('0x1f')]=![];queues[_0x252f0d['uniqueid']][_0xffd8('0x1f')]=![];queues[_0x252f0d['uniqueid']][_0xffd8('0x28')]=null;queues[_0x252f0d['uniqueid']][_0xffd8('0x20')]=![];queues[_0x252f0d[_0xffd8('0x6')]]['queuecallerexitAt']=null;queues[_0x252f0d[_0xffd8('0x6')]]['assigned']=!![];queues[_0x252f0d[_0xffd8('0x6')]]['lastAssignedTo']=_0x252f0d[_0xffd8('0x3f')];queues[_0x252f0d['uniqueid']]['queuecallercomplete']=!![];queues[_0x252f0d[_0xffd8('0x6')]][_0xffd8('0x21')]=utils[_0xffd8('0x18')]();if(_0x252f0d[_0xffd8('0x44')]=='transfer'){if(!queues[_0x252f0d[_0xffd8('0x6')]][_0xffd8('0x45')]){queues[_0x252f0d['uniqueid']]['queuecallerexitreason']='TRANSFER';}}else{queues[_0x252f0d[_0xffd8('0x6')]][_0xffd8('0xc')]=_0xffd8('0x46')+_0x252f0d[_0xffd8('0x44')]['toUpperCase']();}utils[_0xffd8('0x3')](util['format'](_0xffd8('0x47'),_0x252f0d[_0xffd8('0x6')],queues[_0x252f0d[_0xffd8('0x6')]][_0xffd8('0x23')],_0x252f0d[_0xffd8('0x3f')],queues[_0x252f0d[_0xffd8('0x6')]][_0xffd8('0xc')]));writeDB(queues[_0x252f0d[_0xffd8('0x6')]]);}}}catch(_0x283bba){utils[_0xffd8('0x19')](util[_0xffd8('0x4')]('[%s][queues][agentcomplete]',_0x252f0d[_0xffd8('0x6')]),_0x283bba);}};exports['blindtransfer']=function(_0x57b689){try{if(!_[_0xffd8('0x1b')](queues[_0x57b689[_0xffd8('0x48')]])){utils[_0xffd8('0x1c')](util[_0xffd8('0x4')](_0xffd8('0x49'),_0x57b689[_0xffd8('0x6')]),_0x57b689);queues[_0x57b689[_0xffd8('0x48')]][_0xffd8('0x45')]=!![];queues[_0x57b689[_0xffd8('0x48')]][_0xffd8('0x4a')]=_0xffd8('0x4b');queues[_0x57b689[_0xffd8('0x48')]][_0xffd8('0x4c')]=_0x57b689[_0xffd8('0x4d')];queues[_0x57b689['transfereeuniqueid']][_0xffd8('0x4e')]=_0x57b689[_0xffd8('0x48')];queues[_0x57b689[_0xffd8('0x48')]][_0xffd8('0xc')]=_0xffd8('0x4f');utils['info'](util[_0xffd8('0x4')](_0xffd8('0x50'),_0x57b689[_0xffd8('0x6')],queues[_0x57b689['transfereeuniqueid']][_0xffd8('0x23')],_0x57b689[_0xffd8('0x48')],_0x57b689[_0xffd8('0x4d')]));}}catch(_0x5b7e74){utils[_0xffd8('0x19')](util[_0xffd8('0x4')](_0xffd8('0x49'),_0x57b689[_0xffd8('0x6')]),_0x5b7e74);}};exports[_0xffd8('0x51')]=function(_0x120f79){try{utils[_0xffd8('0x1c')](util['format'](_0xffd8('0x52'),_0x120f79[_0xffd8('0x53')]),_0x120f79);if(_0x120f79[_0xffd8('0x53')]==_0x120f79['origtransfererlinkedid']){if(!_[_0xffd8('0x1b')](queues[_0x120f79[_0xffd8('0x54')]])){utils['info'](util[_0xffd8('0x4')](_0xffd8('0x55'),_0x120f79['origtransfereruniqueid'],queues[_0x120f79['secondtransfererlinkedid']][_0xffd8('0x23')],_0x120f79[_0xffd8('0x56')]));queues[_0x120f79[_0xffd8('0x54')]][_0xffd8('0x45')]=!![];queues[_0x120f79[_0xffd8('0x54')]]['transfertype']='ATTENDED';queues[_0x120f79[_0xffd8('0x54')]][_0xffd8('0x4c')]=_0x120f79[_0xffd8('0x56')];queues[_0x120f79[_0xffd8('0x54')]][_0xffd8('0x4e')]=_0x120f79[_0xffd8('0x53')];queues[_0x120f79[_0xffd8('0x54')]]['queuecallerexitreason']=_0xffd8('0x57');}if(!_[_0xffd8('0x1b')](queues[_0x120f79['origtransfererlinkedid']])){if(_0x120f79[_0xffd8('0x58')]&&queues[_0x120f79[_0xffd8('0x58')]]){queues[_0x120f79[_0xffd8('0x58')]][_0xffd8('0x24')]=0x1;queues[_0x120f79['transfereeuniqueid']]=_['clone'](queues[_0x120f79[_0xffd8('0x58')]]);queues[_0x120f79[_0xffd8('0x48')]][_0xffd8('0x12')]=_0x120f79[_0xffd8('0x59')];queues[_0x120f79['transfereeuniqueid']][_0xffd8('0x24')]=0x2;queues[_0x120f79['transfereeuniqueid']][_0xffd8('0xa')]=queues[_0x120f79[_0xffd8('0x54')]][_0xffd8('0xa')];queues[_0x120f79[_0xffd8('0x48')]]['calleridname']=queues[_0x120f79[_0xffd8('0x54')]][_0xffd8('0x5a')];queues[_0x120f79['transfereeuniqueid']][_0xffd8('0x3a')]=utils[_0xffd8('0x18')]();queues[_0x120f79[_0xffd8('0x48')]]['queuecallerleaveAt']=utils[_0xffd8('0x18')]();queues[_0x120f79[_0xffd8('0x48')]][_0xffd8('0x38')]=0x0;queues[_0x120f79[_0xffd8('0x48')]]['mohtime']=0x0;utils[_0xffd8('0x3')](util[_0xffd8('0x4')](_0xffd8('0x5b'),_0x120f79['origtransfereruniqueid'],queues[_0x120f79[_0xffd8('0x48')]]['name'],queues[_0x120f79['transfereeuniqueid']][_0xffd8('0xa')],queues[_0x120f79[_0xffd8('0x48')]][_0xffd8('0x5a')]));}else{utils[_0xffd8('0x3')](util[_0xffd8('0x4')](_0xffd8('0x5c'),_0x120f79[_0xffd8('0x53')],queues[_0x120f79['origtransfererlinkedid']][_0xffd8('0x23')],_0x120f79[_0xffd8('0x54')]));queues[_0x120f79[_0xffd8('0x5d')]][_0xffd8('0x12')]=_0x120f79[_0xffd8('0x54')];}}}else if(_0x120f79[_0xffd8('0x5e')]==_0x120f79[_0xffd8('0x54')]){if(!_[_0xffd8('0x1b')](queues[_0x120f79[_0xffd8('0x5d')]])){utils[_0xffd8('0x3')](util[_0xffd8('0x4')](_0xffd8('0x5f'),_0x120f79[_0xffd8('0x53')],queues[_0x120f79['origtransfererlinkedid']][_0xffd8('0x23')],_0x120f79[_0xffd8('0x5e')],_0x120f79[_0xffd8('0x60')]));queues[_0x120f79[_0xffd8('0x5d')]]['transfer']=!![];queues[_0x120f79['origtransfererlinkedid']][_0xffd8('0x4a')]=_0xffd8('0x61');queues[_0x120f79[_0xffd8('0x5d')]][_0xffd8('0x4c')]=_0x120f79[_0xffd8('0x60')];queues[_0x120f79[_0xffd8('0x5d')]][_0xffd8('0x4e')]=_0x120f79[_0xffd8('0x5e')];queues[_0x120f79[_0xffd8('0x5d')]][_0xffd8('0xc')]=_0xffd8('0x57');}if(!_[_0xffd8('0x1b')](queues[_0x120f79[_0xffd8('0x54')]])){if(_0x120f79[_0xffd8('0x62')]&&queues[_0x120f79['transfertargetlinkedid']]){queues[_0x120f79[_0xffd8('0x62')]][_0xffd8('0x24')]=0x1;queues[_0x120f79[_0xffd8('0x59')]]=_[_0xffd8('0x63')](queues[_0x120f79['transfertargetlinkedid']]);queues[_0x120f79[_0xffd8('0x59')]]['transfereduniqueid']=_0x120f79['transfertargetuniqueid'];queues[_0x120f79[_0xffd8('0x59')]][_0xffd8('0x24')]=0x2;queues[_0x120f79[_0xffd8('0x59')]][_0xffd8('0xa')]=queues[_0x120f79[_0xffd8('0x5d')]][_0xffd8('0xa')];queues[_0x120f79[_0xffd8('0x59')]][_0xffd8('0x5a')]=queues[_0x120f79[_0xffd8('0x5d')]]['calleridname'];queues[_0x120f79[_0xffd8('0x59')]][_0xffd8('0x3a')]=utils[_0xffd8('0x18')]();queues[_0x120f79[_0xffd8('0x59')]][_0xffd8('0x1e')]=utils['now']();queues[_0x120f79['transfertargetuniqueid']][_0xffd8('0x38')]=0x0;queues[_0x120f79[_0xffd8('0x59')]]['mohtime']=0x0;utils[_0xffd8('0x3')](util[_0xffd8('0x4')](_0xffd8('0x64'),_0x120f79[_0xffd8('0x53')],queues[_0x120f79[_0xffd8('0x59')]][_0xffd8('0x23')],queues[_0x120f79[_0xffd8('0x59')]][_0xffd8('0x12')],queues[_0x120f79['transfertargetuniqueid']][_0xffd8('0xa')],queues[_0x120f79[_0xffd8('0x59')]][_0xffd8('0x5a')]));}else{utils[_0xffd8('0x3')](util[_0xffd8('0x4')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x120f79[_0xffd8('0x53')],queues[_0x120f79['secondtransfererlinkedid']][_0xffd8('0x23')],_0x120f79[_0xffd8('0x5d')]));queues[_0x120f79[_0xffd8('0x54')]][_0xffd8('0x12')]=_0x120f79[_0xffd8('0x5d')];}}}}catch(_0x503eb2){utils[_0xffd8('0x19')](util[_0xffd8('0x4')](_0xffd8('0x52'),_0x120f79[_0xffd8('0x53')]),_0x503eb2);}};exports[_0xffd8('0x65')]=function(_0x1f2f26){try{if(!_[_0xffd8('0x1b')](queues[_0x1f2f26[_0xffd8('0x6')]])){utils['debug'](util[_0xffd8('0x4')](_0xffd8('0x66'),_0x1f2f26['uniqueid']),_0x1f2f26);queues[_0x1f2f26['uniqueid']][_0xffd8('0x67')]=utils['now']();utils[_0xffd8('0x3')](util[_0xffd8('0x4')]('[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s',_0x1f2f26[_0xffd8('0x6')],queues[_0x1f2f26[_0xffd8('0x6')]][_0xffd8('0x23')],queues[_0x1f2f26['uniqueid']][_0xffd8('0x67')]));}}catch(_0x2ac7b6){utils[_0xffd8('0x19')](util[_0xffd8('0x4')](_0xffd8('0x66'),_0x1f2f26[_0xffd8('0x6')]),_0x2ac7b6);}};exports['musiconholdstop']=function(_0x471bc6){try{if(!_[_0xffd8('0x1b')](queues[_0x471bc6['uniqueid']])){if(!_['isNil'](queues[_0x471bc6[_0xffd8('0x6')]][_0xffd8('0x67')])){utils[_0xffd8('0x1c')](util[_0xffd8('0x4')](_0xffd8('0x68'),_0x471bc6['uniqueid']),_0x471bc6);queues[_0x471bc6[_0xffd8('0x6')]][_0xffd8('0x69')]+=utils[_0xffd8('0x39')](utils['now'](),queues[_0x471bc6[_0xffd8('0x6')]][_0xffd8('0x67')]);utils['info'](util[_0xffd8('0x4')](_0xffd8('0x6a'),_0x471bc6['uniqueid'],queues[_0x471bc6[_0xffd8('0x6')]][_0xffd8('0x23')],queues[_0x471bc6[_0xffd8('0x6')]][_0xffd8('0x69')]));delete queues[_0x471bc6[_0xffd8('0x6')]][_0xffd8('0x67')];}}}catch(_0x2d7df9){utils['error'](util[_0xffd8('0x4')]('[%s][queues][musiconholdstop]',_0x471bc6[_0xffd8('0x6')]),_0x2d7df9);}};
\ No newline at end of file
index e05294f..d243210 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0017=['blinds','accountcode','then','membername','name','UserId','request','debug','[%s][recordings][newchannel]','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','newstate','[%s][recordings][newstate]','isNil','[%s][recordings][newstate]\x20context:%s\x20channel:%s','channel','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','linkedid','error','variable','mixmonitor_filename','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','endsWith','.wav49','replace','.WAV','monitors','push','[%s][recordings][varset]','hangup','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridname','cause-txt','calleridnum','connectedlinenum','connectedlinename','type','outbound','newexten','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','cdr','lastIndexOf','queuecallerjoin','queue','blindtransfer','[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereecalleridname','transfereruniqueid','recording','[%s][recordings][blindtransfer]','lodash','util','./utils','./transfers.controller','info','format','uniqueid'];(function(_0x52cc30,_0x4ecef6){var _0x1d92a1=function(_0x516945){while(--_0x516945){_0x52cc30['push'](_0x52cc30['shift']());}};_0x1d92a1(++_0x4ecef6);}(_0x0017,0x152));var _0x7001=function(_0xc0921a,_0x1f107f){_0xc0921a=_0xc0921a-0x0;var _0x3f6189=_0x0017[_0xc0921a];return _0x3f6189;};'use strict';var _=require(_0x7001('0x0'));var util=require(_0x7001('0x1'));var utils=require(_0x7001('0x2'));var transfers=require(_0x7001('0x3'));var recordings={};function writeDB(_0x25b5b4){var _0x10b15a;utils[_0x7001('0x4')](util[_0x7001('0x5')]('[%s][recordings][writeDB]',_0x25b5b4[_0x7001('0x6')]));if(transfers['blinds'][_0x25b5b4['uniqueid']]){_0x10b15a=_0x25b5b4['uniqueid'];_0x25b5b4[_0x7001('0x6')]=transfers[_0x7001('0x7')][_0x25b5b4[_0x7001('0x6')]]['transfereeuniqueid'];}if(_0x25b5b4[_0x7001('0x8')]){utils['getUserByInternal'](_0x25b5b4[_0x7001('0x8')])[_0x7001('0x9')](function(_0x35af5a){if(_0x35af5a){_0x25b5b4[_0x7001('0xa')]=_0x35af5a[_0x7001('0xb')];_0x25b5b4[_0x7001('0xc')]=_0x35af5a['id'];}utils[_0x7001('0xd')]('CreateVoiceRecording',_0x25b5b4);});}else{utils[_0x7001('0xd')]('CreateVoiceRecording',_0x25b5b4);}if(_0x10b15a)delete transfers[_0x7001('0x7')][_0x10b15a];}exports['newchannel']=function(_0xc350f8){try{utils[_0x7001('0xe')](util[_0x7001('0x5')](_0x7001('0xf'),_0xc350f8[_0x7001('0x6')]),_0xc350f8);if(_0xc350f8[_0x7001('0x6')]==_0xc350f8['linkedid']){utils[_0x7001('0x4')](util[_0x7001('0x5')](_0x7001('0x10'),_0xc350f8['uniqueid'],_0xc350f8[_0x7001('0x11')],_0xc350f8[_0x7001('0x12')]));recordings[_0xc350f8[_0x7001('0x6')]]={'uniqueid':_0xc350f8[_0x7001('0x6')],'accountcode':_0xc350f8[_0x7001('0x8')],'exten':_0xc350f8[_0x7001('0x12')],'context':_0xc350f8['context'],'channel':_0xc350f8['channel'],'monitors':[]};}}catch(_0x519647){utils['error'](util[_0x7001('0x5')](_0x7001('0xf'),_0xc350f8[_0x7001('0x6')]),_0x519647);}};exports[_0x7001('0x13')]=function(_0x11e533){try{utils[_0x7001('0xe')](util['format'](_0x7001('0x14'),_0x11e533[_0x7001('0x6')]),_0x11e533);if(!_[_0x7001('0x15')](recordings[_0x11e533['uniqueid']])&&_0x11e533['channelstate']==0x6){utils[_0x7001('0x4')](util[_0x7001('0x5')](_0x7001('0x16'),_0x11e533[_0x7001('0x6')],_0x11e533['context'],_0x11e533[_0x7001('0x17')]));}else if(!_['isNil'](recordings[_0x11e533['linkedid']])&&_0x11e533['channelstate']==0x6&&_0x11e533[_0x7001('0x11')]!='transfer'){utils[_0x7001('0x4')](util['format'](_0x7001('0x18'),_0x11e533['uniqueid'],_0x11e533[_0x7001('0x19')],_0x11e533[_0x7001('0x11')],_0x11e533['channel']));recordings[_0x11e533[_0x7001('0x19')]][_0x7001('0x8')]=_0x11e533[_0x7001('0x8')];}}catch(_0x3bf152){utils[_0x7001('0x1a')](util['format'](_0x7001('0x14'),_0x11e533[_0x7001('0x6')]),_0x3bf152);}};exports['varset']=function(_0x238c14){try{if(!_[_0x7001('0x15')](_0x238c14[_0x7001('0x1b')])&&!_[_0x7001('0x15')](_0x238c14[_0x7001('0x1b')][_0x7001('0x1c')])){utils[_0x7001('0xe')](util[_0x7001('0x5')]('[%s][recordings][varset]',_0x238c14['uniqueid']),_0x238c14);utils[_0x7001('0x4')](util[_0x7001('0x5')](_0x7001('0x1d'),_0x238c14[_0x7001('0x6')],_0x238c14[_0x7001('0x1b')],_0x238c14[_0x7001('0x1e')]));if(_[_0x7001('0x1f')](_0x238c14[_0x7001('0x1e')],_0x7001('0x20'))){_0x238c14[_0x7001('0x1e')]=_0x238c14[_0x7001('0x1e')][_0x7001('0x21')](_0x7001('0x20'),_0x7001('0x22'));}if(recordings[_0x238c14['linkedid']]){var _0x449d13=_['find'](recordings[_0x238c14[_0x7001('0x19')]][_0x7001('0x23')],{'value':_0x238c14[_0x7001('0x1e')]});if(_['isNil'](_0x449d13)){recordings[_0x238c14['linkedid']][_0x7001('0x23')][_0x7001('0x24')]({'value':_0x238c14[_0x7001('0x1e')]});}}}}catch(_0x178036){utils[_0x7001('0x1a')](util[_0x7001('0x5')](_0x7001('0x25'),_0x238c14[_0x7001('0x6')]),_0x178036);}};exports[_0x7001('0x26')]=function(_0x2841e3){try{if(!_[_0x7001('0x15')](recordings[_0x2841e3[_0x7001('0x6')]])){utils[_0x7001('0xe')](util[_0x7001('0x5')](_0x7001('0x27'),_0x2841e3[_0x7001('0x6')]),_0x2841e3);utils[_0x7001('0x4')](util[_0x7001('0x5')](_0x7001('0x28'),_0x2841e3[_0x7001('0x6')],_0x2841e3['calleridnum'],_0x2841e3[_0x7001('0x29')],_0x2841e3[_0x7001('0x2a')]));recordings[_0x2841e3[_0x7001('0x6')]][_0x7001('0x2b')]=_0x2841e3[_0x7001('0x2b')];recordings[_0x2841e3[_0x7001('0x6')]][_0x7001('0x29')]=_0x2841e3[_0x7001('0x29')];recordings[_0x2841e3['uniqueid']]['connectedlinenum']=_0x2841e3[_0x7001('0x2c')];recordings[_0x2841e3[_0x7001('0x6')]][_0x7001('0x2d')]=_0x2841e3[_0x7001('0x2d')];if(recordings[_0x2841e3['uniqueid']][_0x7001('0x2e')]==_0x7001('0x2f')&&recordings[_0x2841e3[_0x7001('0x6')]][_0x7001('0x8')]){recordings[_0x2841e3[_0x7001('0x6')]][_0x7001('0x2c')]=recordings[_0x2841e3[_0x7001('0x6')]]['accountcode'];recordings[_0x2841e3[_0x7001('0x6')]][_0x7001('0x2d')]='';}recordings[_0x2841e3['uniqueid']][_0x7001('0x23')]['forEach'](function(_0x266ea6){var _0x5c41e1=_['clone'](recordings[_0x2841e3[_0x7001('0x6')]]);_0x5c41e1[_0x7001('0x1e')]=_0x266ea6[_0x7001('0x1e')];writeDB(_0x5c41e1);});delete recordings[_0x2841e3[_0x7001('0x6')]];}}catch(_0x4282cb){utils[_0x7001('0x1a')](util[_0x7001('0x5')](_0x7001('0x27'),_0x2841e3['uniqueid']),_0x4282cb);}};exports[_0x7001('0x30')]=function(_0xc38410){try{if(!_[_0x7001('0x15')](recordings[_0xc38410[_0x7001('0x6')]])){utils[_0x7001('0xe')](util[_0x7001('0x5')](_0x7001('0x31'),_0xc38410[_0x7001('0x6')]),_0xc38410);utils[_0x7001('0x4')](util[_0x7001('0x5')](_0x7001('0x32'),_0xc38410[_0x7001('0x6')],_0xc38410[_0x7001('0x33')],_0xc38410[_0x7001('0x34')]));if(_0xc38410[_0x7001('0x33')][_0x7001('0x35')]()==_0x7001('0x36')&&_[_0x7001('0x37')](_0xc38410[_0x7001('0x34')][_0x7001('0x35')](),_0x7001('0x38'))){var _0x504ba2=_0xc38410[_0x7001('0x34')]['split']('=');var _0x19720d=_0x504ba2[0x0]['substring'](_0x504ba2[0x0][_0x7001('0x39')]('(')+0x1,_0x504ba2[0x0][_0x7001('0x39')](')'));var _0x2ca068=_0x504ba2[0x1];recordings[_0xc38410[_0x7001('0x6')]][_0x19720d]=_0x2ca068;}}}catch(_0x456672){utils['error'](util['format']('[%s][recordings][newexten]',_0xc38410['uniqueid']),_0x456672);}};exports[_0x7001('0x3a')]=function(_0x59bc42){try{if(!_[_0x7001('0x15')](recordings[_0x59bc42['uniqueid']])){utils[_0x7001('0xe')](util[_0x7001('0x5')]('[%s][recordings][queuecallerjoin]',_0x59bc42[_0x7001('0x6')]),_0x59bc42);utils[_0x7001('0x4')](util[_0x7001('0x5')]('[%s][recordings][queuecallerjoin]\x20queue:%s',_0x59bc42[_0x7001('0x6')],_0x59bc42[_0x7001('0x3b')]));recordings[_0x59bc42[_0x7001('0x6')]][_0x7001('0x3b')]=_0x59bc42['queue'];}}catch(_0x5844e0){utils['error'](util[_0x7001('0x5')]('[%s][recordings][queuecallerjoin]',_0x59bc42[_0x7001('0x6')]),_0x5844e0);}};exports[_0x7001('0x3c')]=function(_0x26faeb){try{utils[_0x7001('0xe')](util['format']('[%s][recordings][blindtransfer]',_0x26faeb['uniqueid']),_0x26faeb);utils[_0x7001('0x4')](util[_0x7001('0x5')](_0x7001('0x3d'),_0x26faeb[_0x7001('0x6')],_0x26faeb[_0x7001('0x3e')],_0x26faeb[_0x7001('0x3f')],_0x26faeb[_0x7001('0x40')],_0x26faeb[_0x7001('0x41')]));if(recordings[_0x26faeb[_0x7001('0x42')]]&&transfers[_0x7001('0x7')][_0x26faeb[_0x7001('0x42')]]){transfers[_0x7001('0x7')][_0x26faeb['transfereruniqueid']][_0x7001('0x43')]=!![];}}catch(_0x335465){utils['error'](util[_0x7001('0x5')](_0x7001('0x44'),_0x26faeb[_0x7001('0x6')]),_0x335465);}};
\ No newline at end of file
+var _0x87da=['[%s][recordings][writeDB]','uniqueid','blinds','transfereeuniqueid','accountcode','getUserByInternal','then','membername','name','UserId','request','CreateVoiceRecording','newchannel','debug','[%s][recordings][newchannel]','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','exten','context','channel','isNil','[%s][recordings][newstate]\x20context:%s\x20channel:%s','channelstate','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','[%s][recordings][newstate]','varset','mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','variable','value','endsWith','.wav49','replace','monitors','push','error','hangup','[%s][recordings][hangup]','calleridname','cause-txt','calleridnum','connectedlinenum','connectedlinename','type','outbound','newexten','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','appdata','application','toLowerCase','set','startsWith','cdr','split','substring','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','[%s][recordings][queuecallerjoin]','blindtransfer','[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transfereecalleridname','transfereruniqueid','[%s][recordings][blindtransfer]','lodash','util','info','format'];(function(_0x12a145,_0x24483c){var _0x238fe7=function(_0x1277c0){while(--_0x1277c0){_0x12a145['push'](_0x12a145['shift']());}};_0x238fe7(++_0x24483c);}(_0x87da,0x169));var _0xa87d=function(_0x18027d,_0x5bd67e){_0x18027d=_0x18027d-0x0;var _0x2d6f7c=_0x87da[_0x18027d];return _0x2d6f7c;};'use strict';var _=require(_0xa87d('0x0'));var util=require(_0xa87d('0x1'));var utils=require('./utils');var transfers=require('./transfers.controller');var recordings={};function writeDB(_0x53be28){var _0xfd7f0;utils[_0xa87d('0x2')](util[_0xa87d('0x3')](_0xa87d('0x4'),_0x53be28[_0xa87d('0x5')]));if(transfers[_0xa87d('0x6')][_0x53be28['uniqueid']]){_0xfd7f0=_0x53be28['uniqueid'];_0x53be28['uniqueid']=transfers[_0xa87d('0x6')][_0x53be28['uniqueid']][_0xa87d('0x7')];}if(_0x53be28[_0xa87d('0x8')]){utils[_0xa87d('0x9')](_0x53be28['accountcode'])[_0xa87d('0xa')](function(_0x296a1f){if(_0x296a1f){_0x53be28[_0xa87d('0xb')]=_0x296a1f[_0xa87d('0xc')];_0x53be28[_0xa87d('0xd')]=_0x296a1f['id'];}utils[_0xa87d('0xe')]('CreateVoiceRecording',_0x53be28);});}else{utils[_0xa87d('0xe')](_0xa87d('0xf'),_0x53be28);}if(_0xfd7f0)delete transfers[_0xa87d('0x6')][_0xfd7f0];}exports[_0xa87d('0x10')]=function(_0x28c080){try{utils[_0xa87d('0x11')](util[_0xa87d('0x3')](_0xa87d('0x12'),_0x28c080[_0xa87d('0x5')]),_0x28c080);if(_0x28c080[_0xa87d('0x5')]==_0x28c080[_0xa87d('0x13')]){utils[_0xa87d('0x2')](util[_0xa87d('0x3')](_0xa87d('0x14'),_0x28c080['uniqueid'],_0x28c080['context'],_0x28c080[_0xa87d('0x15')]));recordings[_0x28c080['uniqueid']]={'uniqueid':_0x28c080['uniqueid'],'accountcode':_0x28c080[_0xa87d('0x8')],'exten':_0x28c080[_0xa87d('0x15')],'context':_0x28c080[_0xa87d('0x16')],'channel':_0x28c080[_0xa87d('0x17')],'monitors':[]};}}catch(_0x5b8498){utils['error'](util[_0xa87d('0x3')](_0xa87d('0x12'),_0x28c080['uniqueid']),_0x5b8498);}};exports['newstate']=function(_0x5df9c0){try{utils[_0xa87d('0x11')](util[_0xa87d('0x3')]('[%s][recordings][newstate]',_0x5df9c0['uniqueid']),_0x5df9c0);if(!_[_0xa87d('0x18')](recordings[_0x5df9c0[_0xa87d('0x5')]])&&_0x5df9c0['channelstate']==0x6){utils[_0xa87d('0x2')](util['format'](_0xa87d('0x19'),_0x5df9c0[_0xa87d('0x5')],_0x5df9c0[_0xa87d('0x16')],_0x5df9c0[_0xa87d('0x17')]));}else if(!_[_0xa87d('0x18')](recordings[_0x5df9c0['linkedid']])&&_0x5df9c0[_0xa87d('0x1a')]==0x6&&_0x5df9c0[_0xa87d('0x16')]!=_0xa87d('0x1b')){utils[_0xa87d('0x2')](util[_0xa87d('0x3')](_0xa87d('0x1c'),_0x5df9c0['uniqueid'],_0x5df9c0[_0xa87d('0x13')],_0x5df9c0[_0xa87d('0x16')],_0x5df9c0['channel']));recordings[_0x5df9c0[_0xa87d('0x13')]][_0xa87d('0x8')]=_0x5df9c0[_0xa87d('0x8')];}}catch(_0xcb5f2d){utils['error'](util['format'](_0xa87d('0x1d'),_0x5df9c0['uniqueid']),_0xcb5f2d);}};exports[_0xa87d('0x1e')]=function(_0x536a25){try{if(!_[_0xa87d('0x18')](_0x536a25['variable'])&&!_[_0xa87d('0x18')](_0x536a25['variable'][_0xa87d('0x1f')])){utils[_0xa87d('0x11')](util[_0xa87d('0x3')](_0xa87d('0x20'),_0x536a25[_0xa87d('0x5')]),_0x536a25);utils['info'](util['format'](_0xa87d('0x21'),_0x536a25[_0xa87d('0x5')],_0x536a25[_0xa87d('0x22')],_0x536a25[_0xa87d('0x23')]));if(_[_0xa87d('0x24')](_0x536a25['value'],_0xa87d('0x25'))){_0x536a25[_0xa87d('0x23')]=_0x536a25[_0xa87d('0x23')][_0xa87d('0x26')](_0xa87d('0x25'),'.WAV');}if(recordings[_0x536a25[_0xa87d('0x13')]]){var _0x6dbfff=_['find'](recordings[_0x536a25['linkedid']][_0xa87d('0x27')],{'value':_0x536a25[_0xa87d('0x23')]});if(_['isNil'](_0x6dbfff)){recordings[_0x536a25[_0xa87d('0x13')]]['monitors'][_0xa87d('0x28')]({'value':_0x536a25['value']});}}}}catch(_0x1fc6e7){utils[_0xa87d('0x29')](util['format'](_0xa87d('0x20'),_0x536a25[_0xa87d('0x5')]),_0x1fc6e7);}};exports[_0xa87d('0x2a')]=function(_0x4c08a3){try{if(!_[_0xa87d('0x18')](recordings[_0x4c08a3[_0xa87d('0x5')]])){utils[_0xa87d('0x11')](util[_0xa87d('0x3')](_0xa87d('0x2b'),_0x4c08a3['uniqueid']),_0x4c08a3);utils['info'](util[_0xa87d('0x3')]('[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s',_0x4c08a3[_0xa87d('0x5')],_0x4c08a3['calleridnum'],_0x4c08a3[_0xa87d('0x2c')],_0x4c08a3[_0xa87d('0x2d')]));recordings[_0x4c08a3[_0xa87d('0x5')]][_0xa87d('0x2e')]=_0x4c08a3[_0xa87d('0x2e')];recordings[_0x4c08a3['uniqueid']][_0xa87d('0x2c')]=_0x4c08a3['calleridname'];recordings[_0x4c08a3[_0xa87d('0x5')]][_0xa87d('0x2f')]=_0x4c08a3[_0xa87d('0x2f')];recordings[_0x4c08a3[_0xa87d('0x5')]][_0xa87d('0x30')]=_0x4c08a3[_0xa87d('0x30')];if(recordings[_0x4c08a3[_0xa87d('0x5')]][_0xa87d('0x31')]==_0xa87d('0x32')&&recordings[_0x4c08a3[_0xa87d('0x5')]][_0xa87d('0x8')]){recordings[_0x4c08a3['uniqueid']][_0xa87d('0x2f')]=recordings[_0x4c08a3['uniqueid']][_0xa87d('0x8')];recordings[_0x4c08a3[_0xa87d('0x5')]]['connectedlinename']='';}recordings[_0x4c08a3['uniqueid']][_0xa87d('0x27')]['forEach'](function(_0x15c68a){var _0x2b7812=_['clone'](recordings[_0x4c08a3[_0xa87d('0x5')]]);_0x2b7812[_0xa87d('0x23')]=_0x15c68a[_0xa87d('0x23')];writeDB(_0x2b7812);});delete recordings[_0x4c08a3['uniqueid']];}}catch(_0x307047){utils[_0xa87d('0x29')](util['format'](_0xa87d('0x2b'),_0x4c08a3[_0xa87d('0x5')]),_0x307047);}};exports[_0xa87d('0x33')]=function(_0x5604f4){try{if(!_['isNil'](recordings[_0x5604f4[_0xa87d('0x5')]])){utils['debug'](util['format'](_0xa87d('0x34'),_0x5604f4['uniqueid']),_0x5604f4);utils['info'](util[_0xa87d('0x3')](_0xa87d('0x35'),_0x5604f4[_0xa87d('0x5')],_0x5604f4['application'],_0x5604f4[_0xa87d('0x36')]));if(_0x5604f4[_0xa87d('0x37')][_0xa87d('0x38')]()==_0xa87d('0x39')&&_[_0xa87d('0x3a')](_0x5604f4['appdata'][_0xa87d('0x38')](),_0xa87d('0x3b'))){var _0x1a0597=_0x5604f4[_0xa87d('0x36')][_0xa87d('0x3c')]('=');var _0x3b975d=_0x1a0597[0x0][_0xa87d('0x3d')](_0x1a0597[0x0][_0xa87d('0x3e')]('(')+0x1,_0x1a0597[0x0]['lastIndexOf'](')'));var _0x22ea8b=_0x1a0597[0x1];recordings[_0x5604f4[_0xa87d('0x5')]][_0x3b975d]=_0x22ea8b;}}}catch(_0x401d6e){utils['error'](util[_0xa87d('0x3')]('[%s][recordings][newexten]',_0x5604f4['uniqueid']),_0x401d6e);}};exports[_0xa87d('0x3f')]=function(_0x441e07){try{if(!_[_0xa87d('0x18')](recordings[_0x441e07[_0xa87d('0x5')]])){utils[_0xa87d('0x11')](util[_0xa87d('0x3')]('[%s][recordings][queuecallerjoin]',_0x441e07['uniqueid']),_0x441e07);utils[_0xa87d('0x2')](util[_0xa87d('0x3')](_0xa87d('0x40'),_0x441e07['uniqueid'],_0x441e07['queue']));recordings[_0x441e07[_0xa87d('0x5')]][_0xa87d('0x41')]=_0x441e07[_0xa87d('0x41')];}}catch(_0x1994ea){utils[_0xa87d('0x29')](util[_0xa87d('0x3')](_0xa87d('0x42'),_0x441e07[_0xa87d('0x5')]),_0x1994ea);}};exports[_0xa87d('0x43')]=function(_0x7156ec){try{utils[_0xa87d('0x11')](util[_0xa87d('0x3')]('[%s][recordings][blindtransfer]',_0x7156ec[_0xa87d('0x5')]),_0x7156ec);utils[_0xa87d('0x2')](util[_0xa87d('0x3')](_0xa87d('0x44'),_0x7156ec[_0xa87d('0x5')],_0x7156ec[_0xa87d('0x45')],_0x7156ec['transferercalleridname'],_0x7156ec['transfereecalleridnum'],_0x7156ec[_0xa87d('0x46')]));if(recordings[_0x7156ec[_0xa87d('0x47')]]&&transfers[_0xa87d('0x6')][_0x7156ec[_0xa87d('0x47')]]){transfers[_0xa87d('0x6')][_0x7156ec['transfereruniqueid']]['recording']=!![];}}catch(_0x4930d5){utils[_0xa87d('0x29')](util[_0xa87d('0x3')](_0xa87d('0x48'),_0x7156ec[_0xa87d('0x5')]),_0x4930d5);}};
\ No newline at end of file
index 5f16224..b2d11bf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8407=['origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridname','assign','origtransfererchannel','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','origtransfererexten','transfereechannel','transfertargetcalleridnum','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetcontext','transfertargetexten','transfertargetlinkedid','lodash','util','info','format','type','attended','origtransfereruniqueid','CreateVoiceTransferReport','blinds','blindtransfer','debug','uniqueid','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereecalleridname','blind','transfereruniqueid','error','[%s][transfers][blindtransfer]','attendedtransfer','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s'];(function(_0x52850c,_0x249dc8){var _0x113595=function(_0x4a6be5){while(--_0x4a6be5){_0x52850c['push'](_0x52850c['shift']());}};_0x113595(++_0x249dc8);}(_0x8407,0x1bd));var _0x7840=function(_0x44dda2,_0x3ebda3){_0x44dda2=_0x44dda2-0x0;var _0x14235a=_0x8407[_0x44dda2];return _0x14235a;};'use strict';var _=require(_0x7840('0x0'));var util=require(_0x7840('0x1'));var utils=require('./utils');function writeDB(_0x48e751){utils[_0x7840('0x2')](util[_0x7840('0x3')]('[%s][transfers][writeDB]\x20type:%s',_0x48e751[_0x7840('0x4')]===_0x7840('0x5')?_0x48e751[_0x7840('0x6')]:_0x48e751['uniqueid'],_0x48e751[_0x7840('0x4')]));utils['request'](_0x7840('0x7'),_0x48e751);}exports[_0x7840('0x8')]={};exports[_0x7840('0x9')]=function(_0x11b92e){try{utils[_0x7840('0xa')](util[_0x7840('0x3')]('[%s][transfers][blindtransfer]',_0x11b92e[_0x7840('0xb')]),_0x11b92e);utils[_0x7840('0x2')](util[_0x7840('0x3')](_0x7840('0xc'),_0x11b92e[_0x7840('0xb')],_0x11b92e[_0x7840('0xd')],_0x11b92e[_0x7840('0xe')],_0x11b92e[_0x7840('0xf')],_0x11b92e[_0x7840('0x10')]));_0x11b92e['type']=_0x7840('0x11');exports['blinds'][_0x11b92e[_0x7840('0x12')]]=_0x11b92e;writeDB(_0x11b92e);}catch(_0x981da0){utils[_0x7840('0x13')](util[_0x7840('0x3')](_0x7840('0x14'),_0x11b92e[_0x7840('0xb')]),_0x981da0);}};exports[_0x7840('0x15')]=function(_0x36ca5e){try{utils[_0x7840('0xa')](util[_0x7840('0x3')]('[%s][transfers][attendedtransfer]',_0x36ca5e[_0x7840('0x6')]),_0x36ca5e);utils[_0x7840('0x2')](util['format'](_0x7840('0x16'),_0x36ca5e[_0x7840('0x6')],_0x36ca5e[_0x7840('0x17')],_0x36ca5e[_0x7840('0x18')],_0x36ca5e['transfertargetcalleridnum'],_0x36ca5e[_0x7840('0x19')]));_0x36ca5e=_[_0x7840('0x1a')](_0x36ca5e,{'transfererchannel':_0x36ca5e[_0x7840('0x1b')],'transferercalleridnum':_0x36ca5e['origtransferercalleridnum'],'transferercalleridname':_0x36ca5e[_0x7840('0x18')],'transfererconnectedlinenum':_0x36ca5e[_0x7840('0x1c')],'transfererconnectedlinename':_0x36ca5e[_0x7840('0x1d')],'transfereraccountcode':_0x36ca5e[_0x7840('0x1e')],'transferercontext':_0x36ca5e['secondtransferercontext'],'transfererexten':_0x36ca5e['secondtransfererexten'],'transfererlinkedid':_0x36ca5e['origtransfererlinkedid'],'context':_0x36ca5e['origtransferercontext'],'extension':_0x36ca5e[_0x7840('0x1f')],'type':_0x7840('0x5')});if(_['isNil'](_0x36ca5e[_0x7840('0x20')])){_0x36ca5e=_[_0x7840('0x1a')](_0x36ca5e,{'transfereechannel':_0x36ca5e['transfertargetchannel'],'transfereecalleridnum':_0x36ca5e[_0x7840('0x21')],'transfereecalleridname':_0x36ca5e[_0x7840('0x19')],'transfereeconnectedlinenum':_0x36ca5e[_0x7840('0x22')],'transfereeconnectedlinename':_0x36ca5e[_0x7840('0x23')],'transfereeaccountcode':_0x36ca5e['transfertargetaccountcode'],'transfereecontext':_0x36ca5e[_0x7840('0x24')],'transfereeexten':_0x36ca5e[_0x7840('0x25')],'transfereelinkedid':_0x36ca5e[_0x7840('0x26')]});}writeDB(_0x36ca5e);}catch(_0x25286c){utils[_0x7840('0x13')](util[_0x7840('0x3')]('[%s][transfers][attendedtransfer]',_0x36ca5e[_0x7840('0x6')]),_0x25286c);}};
\ No newline at end of file
+var _0x2238=['uniqueid','CreateVoiceTransferReport','blinds','blindtransfer','format','[%s][transfers][blindtransfer]','info','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridnum','blind','transfereruniqueid','error','attendedtransfer','debug','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','transfertargetcalleridname','assign','origtransfererchannel','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','secondtransferercontext','secondtransfererexten','origtransferercontext','isNil','transfereechannel','transfertargetchannel','transfertargetexten','lodash','util','./utils','type','attended','origtransfereruniqueid'];(function(_0x5a5b6f,_0x561c3d){var _0x54c5a6=function(_0x2d7f8f){while(--_0x2d7f8f){_0x5a5b6f['push'](_0x5a5b6f['shift']());}};_0x54c5a6(++_0x561c3d);}(_0x2238,0x132));var _0x8223=function(_0x198014,_0x186508){_0x198014=_0x198014-0x0;var _0x3ef088=_0x2238[_0x198014];return _0x3ef088;};'use strict';var _=require(_0x8223('0x0'));var util=require(_0x8223('0x1'));var utils=require(_0x8223('0x2'));function writeDB(_0x27e8f4){utils['info'](util['format']('[%s][transfers][writeDB]\x20type:%s',_0x27e8f4[_0x8223('0x3')]===_0x8223('0x4')?_0x27e8f4[_0x8223('0x5')]:_0x27e8f4[_0x8223('0x6')],_0x27e8f4[_0x8223('0x3')]));utils['request'](_0x8223('0x7'),_0x27e8f4);}exports[_0x8223('0x8')]={};exports[_0x8223('0x9')]=function(_0x57878b){try{utils['debug'](util[_0x8223('0xa')](_0x8223('0xb'),_0x57878b[_0x8223('0x6')]),_0x57878b);utils[_0x8223('0xc')](util['format'](_0x8223('0xd'),_0x57878b[_0x8223('0x6')],_0x57878b[_0x8223('0xe')],_0x57878b[_0x8223('0xf')],_0x57878b[_0x8223('0x10')],_0x57878b['transfereecalleridname']));_0x57878b[_0x8223('0x3')]=_0x8223('0x11');exports[_0x8223('0x8')][_0x57878b[_0x8223('0x12')]]=_0x57878b;writeDB(_0x57878b);}catch(_0x9760bb){utils[_0x8223('0x13')](util[_0x8223('0xa')](_0x8223('0xb'),_0x57878b['uniqueid']),_0x9760bb);}};exports[_0x8223('0x14')]=function(_0x50ee14){try{utils[_0x8223('0x15')](util[_0x8223('0xa')](_0x8223('0x16'),_0x50ee14[_0x8223('0x5')]),_0x50ee14);utils[_0x8223('0xc')](util[_0x8223('0xa')](_0x8223('0x17'),_0x50ee14['origtransfereruniqueid'],_0x50ee14[_0x8223('0x18')],_0x50ee14[_0x8223('0x19')],_0x50ee14[_0x8223('0x1a')],_0x50ee14[_0x8223('0x1b')]));_0x50ee14=_[_0x8223('0x1c')](_0x50ee14,{'transfererchannel':_0x50ee14[_0x8223('0x1d')],'transferercalleridnum':_0x50ee14['origtransferercalleridnum'],'transferercalleridname':_0x50ee14['origtransferercalleridname'],'transfererconnectedlinenum':_0x50ee14[_0x8223('0x1e')],'transfererconnectedlinename':_0x50ee14[_0x8223('0x1f')],'transfereraccountcode':_0x50ee14['origtransfereraccountcode'],'transferercontext':_0x50ee14[_0x8223('0x20')],'transfererexten':_0x50ee14[_0x8223('0x21')],'transfererlinkedid':_0x50ee14['origtransfererlinkedid'],'context':_0x50ee14[_0x8223('0x22')],'extension':_0x50ee14['origtransfererexten'],'type':_0x8223('0x4')});if(_[_0x8223('0x23')](_0x50ee14[_0x8223('0x24')])){_0x50ee14=_[_0x8223('0x1c')](_0x50ee14,{'transfereechannel':_0x50ee14[_0x8223('0x25')],'transfereecalleridnum':_0x50ee14['transfertargetcalleridnum'],'transfereecalleridname':_0x50ee14[_0x8223('0x1b')],'transfereeconnectedlinenum':_0x50ee14['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x50ee14['transfertargetconnectedlinename'],'transfereeaccountcode':_0x50ee14['transfertargetaccountcode'],'transfereecontext':_0x50ee14['transfertargetcontext'],'transfereeexten':_0x50ee14[_0x8223('0x26')],'transfereelinkedid':_0x50ee14['transfertargetlinkedid']});}writeDB(_0x50ee14);}catch(_0x2d2ece){utils['error'](util['format'](_0x8223('0x16'),_0x50ee14[_0x8223('0x5')]),_0x2d2ece);}};
\ No newline at end of file
index 70d211b..a288f86 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x75dd=['YYYY-MM-DD\x20HH:mm:ss','subtract','diffTime','sumTime','now','isAfter','isBefore','bluebird','jayson/promise','moment','util','client','http','xdr','info','inspect','debug','error','request','then','[utils][request]\x20name:%s','internal','name','interface','result','length','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','catch','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','GetVoiceQueue','type','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s\x20%s','[utils][getVoiceQueueByName]','addTime','add','seconds','format'];(function(_0x580647,_0x43d2c3){var _0x5f0792=function(_0x386cef){while(--_0x386cef){_0x580647['push'](_0x580647['shift']());}};_0x5f0792(++_0x43d2c3);}(_0x75dd,0x1c9));var _0xd75d=function(_0x1e69e5,_0x438edd){_0x1e69e5=_0x1e69e5-0x0;var _0x51806d=_0x75dd[_0x1e69e5];return _0x51806d;};'use strict';var BPromise=require(_0xd75d('0x0'));var jayson=require(_0xd75d('0x1'));var moment=require(_0xd75d('0x2'));var util=require(_0xd75d('0x3'));var client=jayson[_0xd75d('0x4')][_0xd75d('0x5')]({'port':0x2329});var logger=require('../../config/logger')(_0xd75d('0x6'));exports[_0xd75d('0x7')]=function(_0x468082,_0xcb99e){logger[_0xd75d('0x7')](_0x468082,_0xcb99e?util[_0xd75d('0x8')](_0xcb99e,{'showHidden':![],'depth':null}):'');};exports[_0xd75d('0x9')]=function(_0x3594fc,_0x48cce5){logger[_0xd75d('0x9')](_0x3594fc,_0x48cce5?util[_0xd75d('0x8')](_0x48cce5,{'showHidden':![],'depth':null}):'');};exports[_0xd75d('0xa')]=function(_0xd24f6b,_0x51ff92){logger[_0xd75d('0xa')](_0xd24f6b,_0x51ff92?util[_0xd75d('0x8')](_0x51ff92,{'showHidden':![],'depth':null}):'');};exports[_0xd75d('0xb')]=function(_0x216f91,_0x79e229){return client[_0xd75d('0xb')](_0x216f91,{'body':_0x79e229})[_0xd75d('0xc')](function(_0x3fa590){logger['debug'](_0xd75d('0xd'),_0x216f91,_0x3fa590?util[_0xd75d('0x8')](_0x3fa590,{'showHidden':![],'depth':null}):'');})['catch'](function(_0x2cd327){logger[_0xd75d('0xa')]('[utils][request]\x20name:%s',_0x216f91,_0x2cd327?util[_0xd75d('0x8')](_0x2cd327,{'showHidden':![],'depth':null}):'');});};function getUser(_0x44164){return client['request']('GetUser',{'options':{'raw':!![],'attributes':['id',_0xd75d('0xe'),_0xd75d('0xf'),_0xd75d('0x10')],'where':_0x44164,'limit':0x1}})['then'](function(_0x20f203){logger['debug']('[utils][getUser]\x20where:%s',JSON['stringify'](_0x44164),_0x20f203?util[_0xd75d('0x8')](_0x20f203,{'showHidden':![],'depth':null}):'');return _0x20f203[_0xd75d('0x11')][_0xd75d('0x12')]?_0x20f203['result'][0x0]:null;});}exports[_0xd75d('0x13')]=function(_0x3d4d89){return new BPromise(function(_0xb86bbf,_0x53d05b){if(_0x3d4d89){return getUser({'internal':_0x3d4d89})[_0xd75d('0xc')](function(_0x5537c2){logger[_0xd75d('0x7')](_0xd75d('0x14'),_0x3d4d89,_0x5537c2?_0xd75d('0x15'):_0xd75d('0x16'));return _0xb86bbf(_0x5537c2);})[_0xd75d('0x17')](function(_0x28892f){logger['error'](_0xd75d('0x18'),_0x28892f?util[_0xd75d('0x8')](_0x28892f,{'showHidden':![],'depth':null}):'');return _0xb86bbf(null);});}return _0xb86bbf(null);});};exports[_0xd75d('0x19')]=function(_0x42a68e){return new BPromise(function(_0x2cc214,_0x13ec15){if(_0x42a68e){return getUser({'interface':_0x42a68e})[_0xd75d('0xc')](function(_0x5e1e36){logger[_0xd75d('0x7')](_0xd75d('0x1a'),_0x42a68e,_0x5e1e36?'found':_0xd75d('0x16'));return _0x2cc214(_0x5e1e36);})[_0xd75d('0x17')](function(_0x96e5b4){logger[_0xd75d('0xa')]('[utils][getUserByInterface]',_0x96e5b4?util['inspect'](_0x96e5b4,{'showHidden':![],'depth':null}):'');return _0x2cc214(null);});}return _0x2cc214(null);});};exports[_0xd75d('0x1b')]=function(_0xbc4bd4){return new BPromise(function(_0x3db450,_0x5c0f97){if(_0xbc4bd4){return getUser({'name':_0xbc4bd4})[_0xd75d('0xc')](function(_0x4619a){logger[_0xd75d('0x7')](_0xd75d('0x1c'),_0xbc4bd4,_0x4619a?_0xd75d('0x15'):_0xd75d('0x16'));return _0x3db450(_0x4619a);})[_0xd75d('0x17')](function(_0x59387f){logger[_0xd75d('0xa')]('[utils][getUserByName]',_0x59387f?util[_0xd75d('0x8')](_0x59387f,{'showHidden':![],'depth':null}):'');return _0x3db450(null);});}return _0x3db450(null);});};exports['getVoiceQueueByName']=function(_0x5db546){return new BPromise(function(_0x151cb1,_0x4baa60){if(_0x5db546){return client['request'](_0xd75d('0x1d'),{'options':{'raw':!![],'attributes':['id',_0xd75d('0xf'),_0xd75d('0x1e'),'acw',_0xd75d('0x1f')],'where':{'name':_0x5db546},'limit':0x1}})[_0xd75d('0xc')](function(_0x39d434){logger[_0xd75d('0x9')]('[utils][getVoiceQueueByName]\x20name:%s',_0x5db546,_0x39d434?util[_0xd75d('0x8')](_0x39d434,{'showHidden':![],'depth':null}):'');logger[_0xd75d('0x7')](_0xd75d('0x20'),_0x5db546,_0x39d434?'found':_0xd75d('0x16'));return _0x151cb1(_0x39d434['result'][_0xd75d('0x12')]?_0x39d434[_0xd75d('0x11')][0x0]:null);})[_0xd75d('0x17')](function(_0xe760ba){logger[_0xd75d('0xa')](_0xd75d('0x21'),_0xe760ba?util[_0xd75d('0x8')](_0xe760ba,{'showHidden':![],'depth':null}):'');return _0x151cb1(null);});}return _0x151cb1(null);});};exports[_0xd75d('0x22')]=function(_0x57e0a1,_0x448ae0){return moment(_0x57e0a1)[_0xd75d('0x23')](_0x448ae0,_0xd75d('0x24'))[_0xd75d('0x25')](_0xd75d('0x26'));};exports['subtractTime']=function(_0x39d408,_0x30a195){return moment(_0x39d408)[_0xd75d('0x27')](_0x30a195,_0xd75d('0x24'))['format'](_0xd75d('0x26'));};exports[_0xd75d('0x28')]=function(_0x20ab46,_0x21bc4b){return moment(_0x20ab46)['diff'](moment(_0x21bc4b),_0xd75d('0x24'));};exports[_0xd75d('0x29')]=function(_0x4930c1,_0x55615c){return parseInt(_0x4930c1,0xa)+parseInt(_0x55615c,0xa);};exports[_0xd75d('0x2a')]=function(){return moment()['format'](_0xd75d('0x26'));};exports[_0xd75d('0x2b')]=function(_0x127b9f,_0x3b99be){if(_0x3b99be){return moment(_0x127b9f)[_0xd75d('0x2b')](_0x3b99be);}return!![];};exports[_0xd75d('0x2c')]=function(_0x22bf73,_0x469df2){if(_0x469df2){return moment(_0x22bf73)['isBefore'](_0x469df2);}else if(_0x22bf73){return!![];}return![];};
\ No newline at end of file
+var _0x39dc=['[utils][getVoiceQueueByName]','addTime','add','seconds','YYYY-MM-DD\x20HH:mm:ss','subtractTime','format','diffTime','sumTime','now','isAfter','isBefore','bluebird','jayson/promise','moment','util','http','xdr','info','inspect','debug','error','request','then','[utils][request]\x20name:%s','catch','GetUser','internal','name','stringify','result','length','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','[utils][getUserByInternal]','[utils][getUserByInterface]\x20interface:%s\x20%s','[utils][getUserByInterface]','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','getVoiceQueueByName','GetVoiceQueue','type','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s'];(function(_0x405474,_0x2e32b9){var _0x2a336f=function(_0x39eff4){while(--_0x39eff4){_0x405474['push'](_0x405474['shift']());}};_0x2a336f(++_0x2e32b9);}(_0x39dc,0x1bc));var _0xc39d=function(_0x568cf0,_0x1a44cb){_0x568cf0=_0x568cf0-0x0;var _0x360f81=_0x39dc[_0x568cf0];return _0x360f81;};'use strict';var BPromise=require(_0xc39d('0x0'));var jayson=require(_0xc39d('0x1'));var moment=require(_0xc39d('0x2'));var util=require(_0xc39d('0x3'));var client=jayson['client'][_0xc39d('0x4')]({'port':0x2329});var logger=require('../../config/logger')(_0xc39d('0x5'));exports[_0xc39d('0x6')]=function(_0x1d16cb,_0x39eb94){logger[_0xc39d('0x6')](_0x1d16cb,_0x39eb94?util[_0xc39d('0x7')](_0x39eb94,{'showHidden':![],'depth':null}):'');};exports[_0xc39d('0x8')]=function(_0x22c1bc,_0x23fc96){logger['debug'](_0x22c1bc,_0x23fc96?util[_0xc39d('0x7')](_0x23fc96,{'showHidden':![],'depth':null}):'');};exports[_0xc39d('0x9')]=function(_0x4169e9,_0x3463f6){logger[_0xc39d('0x9')](_0x4169e9,_0x3463f6?util[_0xc39d('0x7')](_0x3463f6,{'showHidden':![],'depth':null}):'');};exports[_0xc39d('0xa')]=function(_0x1beeb3,_0x20870d){return client[_0xc39d('0xa')](_0x1beeb3,{'body':_0x20870d})[_0xc39d('0xb')](function(_0x558893){logger['debug'](_0xc39d('0xc'),_0x1beeb3,_0x558893?util[_0xc39d('0x7')](_0x558893,{'showHidden':![],'depth':null}):'');})[_0xc39d('0xd')](function(_0xd44acc){logger['error']('[utils][request]\x20name:%s',_0x1beeb3,_0xd44acc?util[_0xc39d('0x7')](_0xd44acc,{'showHidden':![],'depth':null}):'');});};function getUser(_0x578d4d){return client[_0xc39d('0xa')](_0xc39d('0xe'),{'options':{'raw':!![],'attributes':['id',_0xc39d('0xf'),_0xc39d('0x10'),'interface'],'where':_0x578d4d,'limit':0x1}})[_0xc39d('0xb')](function(_0x5386ce){logger[_0xc39d('0x8')]('[utils][getUser]\x20where:%s',JSON[_0xc39d('0x11')](_0x578d4d),_0x5386ce?util['inspect'](_0x5386ce,{'showHidden':![],'depth':null}):'');return _0x5386ce[_0xc39d('0x12')][_0xc39d('0x13')]?_0x5386ce['result'][0x0]:null;});}exports[_0xc39d('0x14')]=function(_0x1948aa){return new BPromise(function(_0x5b51f4,_0x31bc79){if(_0x1948aa){return getUser({'internal':_0x1948aa})[_0xc39d('0xb')](function(_0x20d46e){logger['info'](_0xc39d('0x15'),_0x1948aa,_0x20d46e?_0xc39d('0x16'):_0xc39d('0x17'));return _0x5b51f4(_0x20d46e);})[_0xc39d('0xd')](function(_0x15d728){logger[_0xc39d('0x9')](_0xc39d('0x18'),_0x15d728?util[_0xc39d('0x7')](_0x15d728,{'showHidden':![],'depth':null}):'');return _0x5b51f4(null);});}return _0x5b51f4(null);});};exports['getUserByInterface']=function(_0x3f66a7){return new BPromise(function(_0x3bedea,_0x1f5732){if(_0x3f66a7){return getUser({'interface':_0x3f66a7})['then'](function(_0x23d659){logger['info'](_0xc39d('0x19'),_0x3f66a7,_0x23d659?_0xc39d('0x16'):_0xc39d('0x17'));return _0x3bedea(_0x23d659);})[_0xc39d('0xd')](function(_0x429030){logger[_0xc39d('0x9')](_0xc39d('0x1a'),_0x429030?util[_0xc39d('0x7')](_0x429030,{'showHidden':![],'depth':null}):'');return _0x3bedea(null);});}return _0x3bedea(null);});};exports['getUserByName']=function(_0x19bf0d){return new BPromise(function(_0x45711f,_0x52dac3){if(_0x19bf0d){return getUser({'name':_0x19bf0d})[_0xc39d('0xb')](function(_0x5a85c3){logger[_0xc39d('0x6')](_0xc39d('0x1b'),_0x19bf0d,_0x5a85c3?'found':'notfound');return _0x45711f(_0x5a85c3);})['catch'](function(_0x1ff06f){logger[_0xc39d('0x9')](_0xc39d('0x1c'),_0x1ff06f?util[_0xc39d('0x7')](_0x1ff06f,{'showHidden':![],'depth':null}):'');return _0x45711f(null);});}return _0x45711f(null);});};exports[_0xc39d('0x1d')]=function(_0x22b526){return new BPromise(function(_0x1e385f,_0x142ccd){if(_0x22b526){return client['request'](_0xc39d('0x1e'),{'options':{'raw':!![],'attributes':['id','name',_0xc39d('0x1f'),_0xc39d('0x20'),_0xc39d('0x21')],'where':{'name':_0x22b526},'limit':0x1}})[_0xc39d('0xb')](function(_0x53020d){logger[_0xc39d('0x8')](_0xc39d('0x22'),_0x22b526,_0x53020d?util['inspect'](_0x53020d,{'showHidden':![],'depth':null}):'');logger['info'](_0xc39d('0x23'),_0x22b526,_0x53020d?_0xc39d('0x16'):_0xc39d('0x17'));return _0x1e385f(_0x53020d[_0xc39d('0x12')][_0xc39d('0x13')]?_0x53020d[_0xc39d('0x12')][0x0]:null);})[_0xc39d('0xd')](function(_0x57fc61){logger[_0xc39d('0x9')](_0xc39d('0x24'),_0x57fc61?util['inspect'](_0x57fc61,{'showHidden':![],'depth':null}):'');return _0x1e385f(null);});}return _0x1e385f(null);});};exports[_0xc39d('0x25')]=function(_0x2cfa53,_0x57781a){return moment(_0x2cfa53)[_0xc39d('0x26')](_0x57781a,_0xc39d('0x27'))['format'](_0xc39d('0x28'));};exports[_0xc39d('0x29')]=function(_0x49e7ca,_0x197c59){return moment(_0x49e7ca)['subtract'](_0x197c59,_0xc39d('0x27'))[_0xc39d('0x2a')](_0xc39d('0x28'));};exports[_0xc39d('0x2b')]=function(_0x45d411,_0x1ead3a){return moment(_0x45d411)['diff'](moment(_0x1ead3a),_0xc39d('0x27'));};exports[_0xc39d('0x2c')]=function(_0x5add1f,_0x1d8857){return parseInt(_0x5add1f,0xa)+parseInt(_0x1d8857,0xa);};exports[_0xc39d('0x2d')]=function(){return moment()[_0xc39d('0x2a')](_0xc39d('0x28'));};exports[_0xc39d('0x2e')]=function(_0x32b324,_0xd61cc9){if(_0xd61cc9){return moment(_0x32b324)['isAfter'](_0xd61cc9);}return!![];};exports[_0xc39d('0x2f')]=function(_0x5c1556,_0x558234){if(_0x558234){return moment(_0x5c1556)[_0xc39d('0x2f')](_0x558234);}else if(_0x5c1556){return!![];}return![];};
\ No newline at end of file
index ece8450..15fa1b9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeb7d=['device','agent_id','connection','url','name','other','agent_name','test','lodash','express-winston','path','./loggers','fileLogger','./safe-template','./mask-sensitive-data','maskSensitiveData','join','/var','log','client','ensureDir','then','user','catch','api','client-side-logger','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','body','\x20body=%s','headers','x-forwarded-for','remoteAddress','responseTime','role','inspect'];(function(_0x56108f,_0x57f8af){var _0x5a6f53=function(_0x1e5cc5){while(--_0x1e5cc5){_0x56108f['push'](_0x56108f['shift']());}};_0x5a6f53(++_0x57f8af);}(_0xeb7d,0x1e9));var _0xdeb7=function(_0x2095d0,_0x7f3f86){_0x2095d0=_0x2095d0-0x0;var _0x4c8775=_0xeb7d[_0x2095d0];return _0x4c8775;};var fs=require('fs-extra');var _=require(_0xdeb7('0x0'));var ewinston=require(_0xdeb7('0x1'));var path=require(_0xdeb7('0x2'));var util=require('util');var fileLogger=require(_0xdeb7('0x3'))[_0xdeb7('0x4')];var safeTemplate=require(_0xdeb7('0x5'))['safeTemplate'];var maskSensitiveData=require(_0xdeb7('0x6'))[_0xdeb7('0x7')];function ClientSideLogger(){function _0x3ae7e9(_0x349842){var _0x3dc5bb=path[_0xdeb7('0x8')](_0xdeb7('0x9'),_0xdeb7('0xa'),'xcally');var _0x30b898=path[_0xdeb7('0x8')](_0xdeb7('0xb'),_0x349842['role']+'-'+_0x349842['name']);return fs[_0xdeb7('0xc')](path[_0xdeb7('0x8')](_0x3dc5bb,_0x30b898))[_0xdeb7('0xd')](function(){var _0x4add64=fileLogger(_0xdeb7('0xb'),path['join'](_0x3dc5bb,_0x30b898));return _0x4add64;})['catch'](function(_0xb84a33){throw _0xb84a33;});}this[_0xdeb7('0xa')]=function(_0x2f36bd,_0x1c4fb6,_0xa0928c,_0x17c605){return _0x3ae7e9(_0x2f36bd[_0xdeb7('0xe')])['then'](function(_0x141892){var _0x236b9c=_0x141892[_0x1c4fb6];return _0x236b9c;})[_0xdeb7('0xd')](function(_0x1d8166){var _0x5b763f=_0x2f36bd[_0xdeb7('0xe')]?_0x2f36bd[_0xdeb7('0xe')]['id']:'no-user';var _0x6b39af=_0x17c605['data'];var _0x515604=_0x17c605['timestamp'];var _0x2e91ff=new Date(Number(_0x515604));return _0x1d8166(_0x5b763f,_0x2e91ff,_0xa0928c,_0x6b39af);})[_0xdeb7('0xf')](function(_0x4be71c){fileLogger(_0xdeb7('0xb'))['error'](_0x4be71c);});};}function setupLoggers(_0xe0d5de){return new Promise(function(_0x5aa75e){var _0x10732f=new ClientSideLogger();var _0x4edc0c=fileLogger(_0xdeb7('0x10'));var _0x21b479=fileLogger('auth');_0xe0d5de['set'](_0xdeb7('0x11'),_0x10732f);_0xe0d5de[_0xdeb7('0x12')](ewinston[_0xdeb7('0x13')]({'winstonInstance':_0x4edc0c,'meta':![],'statusLevels':!![],'msg':function(_0x53b29e,_0x11a57c){var _0x189d72=_0xdeb7('0x14');if(!_['isEmpty'](_0x53b29e[_0xdeb7('0x15')])){_0x189d72+=_0xdeb7('0x16');var _0x1c712c=_0x53b29e[_0xdeb7('0x15')];maskSensitiveData(_0x1c712c);}return safeTemplate(util['format'](_0x189d72,_0x53b29e['method'],_0x53b29e[_0xdeb7('0x17')]['x-forwarded-for']?_0x53b29e[_0xdeb7('0x17')][_0xdeb7('0x18')]:_0x53b29e['connection'][_0xdeb7('0x19')]||_0x53b29e['ip'],_0x53b29e['url'],_0x11a57c['statusCode'],_0x11a57c[_0xdeb7('0x1a')],_0x53b29e['user']?_0x53b29e[_0xdeb7('0xe')]['id']:null,_0x53b29e['user']?_0x53b29e['user']['name']:null,_0x53b29e['user']?_0x53b29e[_0xdeb7('0xe')][_0xdeb7('0x1b')]:null,_0x1c712c?util[_0xdeb7('0x1c')](_0x1c712c,![],null):''));}}));_0xe0d5de[_0xdeb7('0x12')](ewinston[_0xdeb7('0x13')]({'winstonInstance':_0x21b479,'meta':![],'statusLevels':!![],'msg':function(_0xaaf690,_0x506fce){var _0x439a61='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s';if(_0xaaf690['body']&&_0xaaf690[_0xdeb7('0x15')][_0xdeb7('0x1d')]&&_0xaaf690['body'][_0xdeb7('0x1e')]){_0x439a61='%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'](_0x439a61,_0xaaf690['method'],_0xaaf690['headers'][_0xdeb7('0x18')]?_0xaaf690[_0xdeb7('0x17')][_0xdeb7('0x18')]:_0xaaf690[_0xdeb7('0x1f')][_0xdeb7('0x19')]||_0xaaf690['ip'],_0xaaf690[_0xdeb7('0x20')],_0x506fce['statusCode'],_0x506fce[_0xdeb7('0x1a')],_0xaaf690['user']?_0xaaf690[_0xdeb7('0xe')]['id']:null,_0xaaf690[_0xdeb7('0xe')]?_0xaaf690['user'][_0xdeb7('0x21')]:null,_0xaaf690['user']?_0xaaf690[_0xdeb7('0xe')][_0xdeb7('0x1b')]:null,_0xaaf690[_0xdeb7('0x15')]&&_0xaaf690[_0xdeb7('0x15')][_0xdeb7('0x1d')]?_0xaaf690['body'][_0xdeb7('0x1d')]:_0xdeb7('0x22'),_0xaaf690[_0xdeb7('0x15')]&&_0xaaf690['body'][_0xdeb7('0x1e')]?_0xaaf690[_0xdeb7('0x15')][_0xdeb7('0x1e')]:'',_0xaaf690['body']&&_0xaaf690[_0xdeb7('0x15')][_0xdeb7('0x23')]?_0xaaf690['body'][_0xdeb7('0x23')]:'');},'ignoreRoute':function(_0x790672){var _0x290072=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x290072[_0xdeb7('0x24')](_0x790672['url']);}}));return _0x5aa75e();});}exports['setupLoggers']=setupLoggers;
\ No newline at end of file
+var _0xd4be=['xcally','client','role','name','ensureDir','then','catch','user','no-user','data','timestamp','error','api','auth','use','logger','\x20body=%s','body','format','method','headers','x-forwarded-for','connection','url','statusCode','inspect','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','agent_id','remoteAddress','responseTime','other','agent_name','test','setupLoggers','fs-extra','express-winston','util','./loggers','./safe-template','./mask-sensitive-data','join','/var','log'];(function(_0x22789a,_0x4a1c8c){var _0xede88=function(_0x49243f){while(--_0x49243f){_0x22789a['push'](_0x22789a['shift']());}};_0xede88(++_0x4a1c8c);}(_0xd4be,0x1db));var _0xed4b=function(_0x42ecd0,_0x1f29a7){_0x42ecd0=_0x42ecd0-0x0;var _0x1ba69f=_0xd4be[_0x42ecd0];return _0x1ba69f;};var fs=require(_0xed4b('0x0'));var _=require('lodash');var ewinston=require(_0xed4b('0x1'));var path=require('path');var util=require(_0xed4b('0x2'));var fileLogger=require(_0xed4b('0x3'))['fileLogger'];var safeTemplate=require(_0xed4b('0x4'))['safeTemplate'];var maskSensitiveData=require(_0xed4b('0x5'))['maskSensitiveData'];function ClientSideLogger(){function _0x587163(_0x16405b){var _0x18e10d=path[_0xed4b('0x6')](_0xed4b('0x7'),_0xed4b('0x8'),_0xed4b('0x9'));var _0x114990=path['join'](_0xed4b('0xa'),_0x16405b[_0xed4b('0xb')]+'-'+_0x16405b[_0xed4b('0xc')]);return fs[_0xed4b('0xd')](path['join'](_0x18e10d,_0x114990))[_0xed4b('0xe')](function(){var _0x138d43=fileLogger(_0xed4b('0xa'),path[_0xed4b('0x6')](_0x18e10d,_0x114990));return _0x138d43;})[_0xed4b('0xf')](function(_0x203e9e){throw _0x203e9e;});}this['log']=function(_0x497eb0,_0x43b623,_0x47da48,_0x8fde09){return _0x587163(_0x497eb0['user'])[_0xed4b('0xe')](function(_0x1a5628){var _0x3dea27=_0x1a5628[_0x43b623];return _0x3dea27;})[_0xed4b('0xe')](function(_0xa08619){var _0xa0fed3=_0x497eb0[_0xed4b('0x10')]?_0x497eb0[_0xed4b('0x10')]['id']:_0xed4b('0x11');var _0x37c737=_0x8fde09[_0xed4b('0x12')];var _0x462b09=_0x8fde09[_0xed4b('0x13')];var _0x3cd51a=new Date(Number(_0x462b09));return _0xa08619(_0xa0fed3,_0x3cd51a,_0x47da48,_0x37c737);})[_0xed4b('0xf')](function(_0x16c177){fileLogger(_0xed4b('0xa'))[_0xed4b('0x14')](_0x16c177);});};}function setupLoggers(_0x33ff40){return new Promise(function(_0xc019ee){var _0x4f0e43=new ClientSideLogger();var _0x212046=fileLogger(_0xed4b('0x15'));var _0xecc942=fileLogger(_0xed4b('0x16'));_0x33ff40['set']('client-side-logger',_0x4f0e43);_0x33ff40[_0xed4b('0x17')](ewinston[_0xed4b('0x18')]({'winstonInstance':_0x212046,'meta':![],'statusLevels':!![],'msg':function(_0x190432,_0x1210e1){var _0x80a518='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s';if(!_['isEmpty'](_0x190432['body'])){_0x80a518+=_0xed4b('0x19');var _0xdaa97b=_0x190432[_0xed4b('0x1a')];maskSensitiveData(_0xdaa97b);}return safeTemplate(util[_0xed4b('0x1b')](_0x80a518,_0x190432[_0xed4b('0x1c')],_0x190432[_0xed4b('0x1d')][_0xed4b('0x1e')]?_0x190432[_0xed4b('0x1d')][_0xed4b('0x1e')]:_0x190432[_0xed4b('0x1f')]['remoteAddress']||_0x190432['ip'],_0x190432[_0xed4b('0x20')],_0x1210e1[_0xed4b('0x21')],_0x1210e1['responseTime'],_0x190432[_0xed4b('0x10')]?_0x190432['user']['id']:null,_0x190432[_0xed4b('0x10')]?_0x190432[_0xed4b('0x10')][_0xed4b('0xc')]:null,_0x190432[_0xed4b('0x10')]?_0x190432[_0xed4b('0x10')][_0xed4b('0xb')]:null,_0xdaa97b?util[_0xed4b('0x22')](_0xdaa97b,![],null):''));}}));_0x33ff40[_0xed4b('0x17')](ewinston[_0xed4b('0x18')]({'winstonInstance':_0xecc942,'meta':![],'statusLevels':!![],'msg':function(_0x455072,_0x49364f){var _0x3ee3f=_0xed4b('0x23');if(_0x455072[_0xed4b('0x1a')]&&_0x455072[_0xed4b('0x1a')][_0xed4b('0x24')]&&_0x455072['body'][_0xed4b('0x25')]){_0x3ee3f='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)';}return util[_0xed4b('0x1b')](_0x3ee3f,_0x455072[_0xed4b('0x1c')],_0x455072[_0xed4b('0x1d')][_0xed4b('0x1e')]?_0x455072[_0xed4b('0x1d')][_0xed4b('0x1e')]:_0x455072['connection'][_0xed4b('0x26')]||_0x455072['ip'],_0x455072[_0xed4b('0x20')],_0x49364f[_0xed4b('0x21')],_0x49364f[_0xed4b('0x27')],_0x455072[_0xed4b('0x10')]?_0x455072[_0xed4b('0x10')]['id']:null,_0x455072['user']?_0x455072[_0xed4b('0x10')][_0xed4b('0xc')]:null,_0x455072['user']?_0x455072[_0xed4b('0x10')][_0xed4b('0xb')]:null,_0x455072[_0xed4b('0x1a')]&&_0x455072[_0xed4b('0x1a')][_0xed4b('0x24')]?_0x455072[_0xed4b('0x1a')][_0xed4b('0x24')]:_0xed4b('0x28'),_0x455072['body']&&_0x455072[_0xed4b('0x1a')][_0xed4b('0x25')]?_0x455072['body'][_0xed4b('0x25')]:'',_0x455072[_0xed4b('0x1a')]&&_0x455072[_0xed4b('0x1a')]['agent_name']?_0x455072[_0xed4b('0x1a')][_0xed4b('0x29')]:'');},'ignoreRoute':function(_0x5c9859){var _0x2c8869=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x2c8869[_0xed4b('0x2a')](_0x5c9859[_0xed4b('0x20')]);}}));return _0xc019ee();});}exports[_0xed4b('0x2b')]=setupLoggers;
\ No newline at end of file
index 5189017..40ddf23 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa791=['winston','../config/environment','toLowerCase','redBG\x20white','red','bold\x20yellow','bold\x20white','gray','bold\x20blue','bold\x20cyan','format','%s-%s.log','message','replace','{{{','}}}','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','meta','length','stringify','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','toUpperCase','Logger','transports','Console','warn','File','%s-%s','error','consoleLogger','fileLogger','path','moment'];(function(_0x22789a,_0x4a1c8c){var _0xede88=function(_0x49243f){while(--_0x49243f){_0x22789a['push'](_0x22789a['shift']());}};_0xede88(++_0x4a1c8c);}(_0xa791,0x17f));var _0x1a79=function(_0x3c669b,_0x41beb6){_0x3c669b=_0x3c669b-0x0;var _0x11a0ef=_0xa791[_0x3c669b];return _0x11a0ef;};'use strict';var path=require(_0x1a79('0x0'));var util=require('util');var moment=require(_0x1a79('0x1'));var winston=require(_0x1a79('0x2'));var config=require(_0x1a79('0x3'));var debugLevel=config['debugLevel']?config['debugLevel'][_0x1a79('0x4')]():'info';var XC_LOG_LEVELS={'fatal':0x0,'error':0x0,'warn':0x1,'info':0x2,'print':0x2,'success':0x2,'http':0x3,'verbose':0x4,'debug':0x5,'silly':0x6};var XC_LOG_COLORS={'fatal':_0x1a79('0x5'),'error':_0x1a79('0x6'),'warn':_0x1a79('0x7'),'info':'white','print':_0x1a79('0x8'),'success':'bold\x20green','http':_0x1a79('0x9'),'verbose':'bold\x20magenta','debug':_0x1a79('0xa'),'silly':_0x1a79('0xb')};winston['addColors'](XC_LOG_COLORS);function getLogFileName(_0x2b387b,_0x108280,_0x1ed4cb){var _0x3f0592=_0x2b387b||'/var/log/xcally';return path['join'](_0x3f0592,util[_0x1a79('0xc')](_0x1a79('0xd'),_0x108280,_0x1ed4cb));}function formatter(_0x541572,_0x3db783){_0x3db783[_0x1a79('0xe')]=_0x3db783['message'][_0x1a79('0xf')](/@@{/g,_0x1a79('0x10'))[_0x1a79('0xf')](/}@@/g,_0x1a79('0x11'))['replace'](/@{/g,'{{')[_0x1a79('0xf')](/}@/g,'}}');return util['format'](_0x1a79('0x12'),moment()[_0x1a79('0xc')](_0x1a79('0x13')),_0x3db783[_0x1a79('0x14')]['toUpperCase'](),_0x541572,_0x3db783[_0x1a79('0xe')]);}function fileFormat(_0x16b4a9,_0x5f1738){_0x5f1738[_0x1a79('0xe')]=_0x5f1738[_0x1a79('0xe')]['replace'](/@@{/g,_0x1a79('0x10'))[_0x1a79('0xf')](/}@@/g,_0x1a79('0x11'))['replace'](/@{/g,'{{')['replace'](/}@/g,'}}');var _0x259e5b=_0x5f1738[_0x1a79('0x15')]&&Object['keys'](_0x5f1738[_0x1a79('0x15')])[_0x1a79('0x16')]?'\x0a\x09'+JSON[_0x1a79('0x17')](_0x5f1738[_0x1a79('0x15')]):'';return util[_0x1a79('0xc')](_0x1a79('0x18'),moment()[_0x1a79('0xc')](_0x1a79('0x13')),_0x5f1738[_0x1a79('0x14')][_0x1a79('0x19')](),_0x16b4a9,_0x5f1738[_0x1a79('0xe')],_0x259e5b);}function consoleLogger(){var _0x23e87e=new winston[(_0x1a79('0x1a'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x1a79('0x1b'))][(_0x1a79('0x1c'))]({'level':_0x1a79('0x1d'),'json':![],'formatter':function(_0x54322c){return formatter('',_0x54322c);}})]});return _0x23e87e;}function fileLogger(_0x5c7c91,_0x2e6ba6){var _0x288348=new winston[(_0x1a79('0x1a'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x1a79('0x1b'))][(_0x1a79('0x1e'))]({'name':util[_0x1a79('0xc')](_0x1a79('0x1f'),_0x5c7c91,_0x1a79('0x20')),'filename':getLogFileName(_0x2e6ba6,_0x5c7c91,_0x1a79('0x20')),'level':_0x1a79('0x20'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x10c5ed){return fileFormat(_0x5c7c91,_0x10c5ed);}}),new winston[(_0x1a79('0x1b'))]['File']({'name':util['format'](_0x1a79('0x1f'),_0x5c7c91,debugLevel),'filename':getLogFileName(_0x2e6ba6,_0x5c7c91,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x542747){return fileFormat(_0x5c7c91,_0x542747);}}),new winston[(_0x1a79('0x1b'))][(_0x1a79('0x1c'))]({'level':_0x1a79('0x1d'),'json':![],'formatter':function(_0x47a750){return fileFormat(_0x5c7c91,_0x47a750);}})]});return _0x288348;}exports[_0x1a79('0x21')]=consoleLogger;exports[_0x1a79('0x22')]=fileLogger;
\ No newline at end of file
+var _0xee51=['error','%s-%s','consoleLogger','fileLogger','util','moment','winston','debugLevel','toLowerCase','info','bold\x20yellow','white','bold\x20white','bold\x20green','gray','bold\x20magenta','bold\x20blue','addColors','/var/log/xcally','join','format','%s-%s.log','message','{{{','}}}','replace','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','meta','length','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','Logger','transports','Console','warn','File'];(function(_0x25d7c9,_0x883a78){var _0x343fe4=function(_0x14eb1e){while(--_0x14eb1e){_0x25d7c9['push'](_0x25d7c9['shift']());}};_0x343fe4(++_0x883a78);}(_0xee51,0x1a6));var _0x1ee5=function(_0x362ff7,_0xc3af7e){_0x362ff7=_0x362ff7-0x0;var _0xda4a22=_0xee51[_0x362ff7];return _0xda4a22;};'use strict';var path=require('path');var util=require(_0x1ee5('0x0'));var moment=require(_0x1ee5('0x1'));var winston=require(_0x1ee5('0x2'));var config=require('../config/environment');var debugLevel=config[_0x1ee5('0x3')]?config['debugLevel'][_0x1ee5('0x4')]():_0x1ee5('0x5');var XC_LOG_LEVELS={'fatal':0x0,'error':0x0,'warn':0x1,'info':0x2,'print':0x2,'success':0x2,'http':0x3,'verbose':0x4,'debug':0x5,'silly':0x6};var XC_LOG_COLORS={'fatal':'redBG\x20white','error':'red','warn':_0x1ee5('0x6'),'info':_0x1ee5('0x7'),'print':_0x1ee5('0x8'),'success':_0x1ee5('0x9'),'http':_0x1ee5('0xa'),'verbose':_0x1ee5('0xb'),'debug':_0x1ee5('0xc'),'silly':'bold\x20cyan'};winston[_0x1ee5('0xd')](XC_LOG_COLORS);function getLogFileName(_0x10ef6c,_0x3aacf8,_0x2bc34a){var _0xfab72=_0x10ef6c||_0x1ee5('0xe');return path[_0x1ee5('0xf')](_0xfab72,util[_0x1ee5('0x10')](_0x1ee5('0x11'),_0x3aacf8,_0x2bc34a));}function formatter(_0x32dbef,_0x4d5b0e){_0x4d5b0e[_0x1ee5('0x12')]=_0x4d5b0e[_0x1ee5('0x12')]['replace'](/@@{/g,_0x1ee5('0x13'))['replace'](/}@@/g,_0x1ee5('0x14'))['replace'](/@{/g,'{{')[_0x1ee5('0x15')](/}@/g,'}}');return util[_0x1ee5('0x10')](_0x1ee5('0x16'),moment()['format'](_0x1ee5('0x17')),_0x4d5b0e[_0x1ee5('0x18')][_0x1ee5('0x19')](),_0x32dbef,_0x4d5b0e['message']);}function fileFormat(_0x164484,_0x462036){_0x462036[_0x1ee5('0x12')]=_0x462036[_0x1ee5('0x12')][_0x1ee5('0x15')](/@@{/g,_0x1ee5('0x13'))[_0x1ee5('0x15')](/}@@/g,_0x1ee5('0x14'))[_0x1ee5('0x15')](/@{/g,'{{')[_0x1ee5('0x15')](/}@/g,'}}');var _0x3b4645=_0x462036[_0x1ee5('0x1a')]&&Object['keys'](_0x462036['meta'])[_0x1ee5('0x1b')]?'\x0a\x09'+JSON['stringify'](_0x462036[_0x1ee5('0x1a')]):'';return util[_0x1ee5('0x10')](_0x1ee5('0x1c'),moment()['format'](_0x1ee5('0x17')),_0x462036[_0x1ee5('0x18')][_0x1ee5('0x19')](),_0x164484,_0x462036[_0x1ee5('0x12')],_0x3b4645);}function consoleLogger(){var _0x5b4c0f=new winston[(_0x1ee5('0x1d'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x1ee5('0x1e'))][(_0x1ee5('0x1f'))]({'level':_0x1ee5('0x20'),'json':![],'formatter':function(_0x4956aa){return formatter('',_0x4956aa);}})]});return _0x5b4c0f;}function fileLogger(_0x457233,_0x2dc907){var _0x148b9a=new winston[(_0x1ee5('0x1d'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x1ee5('0x1e'))][(_0x1ee5('0x21'))]({'name':util['format']('%s-%s',_0x457233,_0x1ee5('0x22')),'filename':getLogFileName(_0x2dc907,_0x457233,_0x1ee5('0x22')),'level':_0x1ee5('0x22'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0xe98786){return fileFormat(_0x457233,_0xe98786);}}),new winston[(_0x1ee5('0x1e'))]['File']({'name':util[_0x1ee5('0x10')](_0x1ee5('0x23'),_0x457233,debugLevel),'filename':getLogFileName(_0x2dc907,_0x457233,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x58d7f1){return fileFormat(_0x457233,_0x58d7f1);}}),new winston['transports'][(_0x1ee5('0x1f'))]({'level':_0x1ee5('0x20'),'json':![],'formatter':function(_0x63578c){return fileFormat(_0x457233,_0x63578c);}})]});return _0x148b9a;}exports[_0x1ee5('0x24')]=consoleLogger;exports[_0x1ee5('0x25')]=fileLogger;
\ No newline at end of file
index d1779c4..21cb43e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f66=['consumerSecret','membername','calleridname','exten','privateKey','secretaccesskey','user','pass','accountSid','localstationid','dsn','secret','registry','oldPassword','length','isPlainObject','isString','replace','@@{','}@@','username','newPassword','apiKey','firstName','lastName','street','mobile','email','clientId','code','accessKey','tenantId','token','channelSecret','accessToken','consumerKey'];(function(_0x1db009,_0xcbaa56){var _0x256eac=function(_0x18316e){while(--_0x18316e){_0x1db009['push'](_0x1db009['shift']());}};_0x256eac(++_0xcbaa56);}(_0x5f66,0x1a0));var _0x65f6=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0x5f66[_0x5f0089];return _0x193892;};var _=require('lodash');var sensitiveFields=[_0x65f6('0x0'),'password',_0x65f6('0x1'),_0x65f6('0x2'),_0x65f6('0x3'),_0x65f6('0x4'),_0x65f6('0x5'),'phone',_0x65f6('0x6'),'fax',_0x65f6('0x7'),_0x65f6('0x8'),'clientSecret','securityToken',_0x65f6('0x9'),_0x65f6('0xa'),_0x65f6('0xb'),_0x65f6('0xc'),_0x65f6('0xd'),_0x65f6('0xe'),'accessTokenSecret','authToken',_0x65f6('0xf'),_0x65f6('0x10'),_0x65f6('0x11'),_0x65f6('0x12'),'calleridnum',_0x65f6('0x13'),'vidaooApiKey','clientEmail',_0x65f6('0x14'),'accesskeyid',_0x65f6('0x15'),'key',_0x65f6('0x16'),_0x65f6('0x17'),_0x65f6('0x18'),_0x65f6('0x19'),_0x65f6('0x1a'),_0x65f6('0x1b'),_0x65f6('0x1c'),_0x65f6('0x1d')];function maskSensitiveData(_0x46dbc6){const _0x3440af=/(?!^)[\s\S](?!$)/g;if(_['isPlainObject'](_0x46dbc6)){for(const _0x19b9ff in _0x46dbc6){if(_['isArray'](_0x46dbc6[_0x19b9ff])){for(let _0x5dd324=0x0;_0x5dd324<_0x46dbc6[_0x19b9ff][_0x65f6('0x1e')];_0x5dd324++){maskSensitiveData(_0x46dbc6[_0x19b9ff][_0x5dd324]);}}else if(_[_0x65f6('0x1f')](_0x46dbc6[_0x19b9ff])){maskSensitiveData(_0x46dbc6[_0x19b9ff]);}else if(_[_0x65f6('0x20')](_0x46dbc6[_0x19b9ff])){_0x46dbc6[_0x19b9ff]=_0x46dbc6[_0x19b9ff][_0x65f6('0x21')](/{{{/g,_0x65f6('0x22'))[_0x65f6('0x21')](/}}}/g,_0x65f6('0x23'))[_0x65f6('0x21')](/{{/g,'@{')['replace'](/}}/g,'}@');if(_['includes'](sensitiveFields,_0x19b9ff)){_0x46dbc6[_0x19b9ff]=_0x46dbc6[_0x19b9ff][_0x65f6('0x21')](_0x3440af,'*');}}}}}module['exports']['maskSensitiveData']=maskSensitiveData;
\ No newline at end of file
+var _0xadb5=['exten','vidaooApiKey','privateKey','secretaccesskey','user','pass','accountSid','dsn','secret','registry','isPlainObject','isArray','length','isString','replace','@@{','}@@','username','newPassword','apiKey','firstName','street','phone','mobile','email','clientId','clientSecret','securityToken','code','accessKey','tenantId','token','channelSecret','accessToken','accessTokenSecret','authToken','consumerKey','consumerSecret','calleridnum'];(function(_0x7f6f81,_0x14118d){var _0x339fcb=function(_0x53b10f){while(--_0x53b10f){_0x7f6f81['push'](_0x7f6f81['shift']());}};_0x339fcb(++_0x14118d);}(_0xadb5,0xad));var _0x5adb=function(_0x291b58,_0x551ead){_0x291b58=_0x291b58-0x0;var _0x310762=_0xadb5[_0x291b58];return _0x310762;};var _=require('lodash');var sensitiveFields=[_0x5adb('0x0'),'password',_0x5adb('0x1'),_0x5adb('0x2'),_0x5adb('0x3'),'lastName',_0x5adb('0x4'),_0x5adb('0x5'),_0x5adb('0x6'),'fax',_0x5adb('0x7'),_0x5adb('0x8'),_0x5adb('0x9'),_0x5adb('0xa'),_0x5adb('0xb'),_0x5adb('0xc'),_0x5adb('0xd'),_0x5adb('0xe'),_0x5adb('0xf'),_0x5adb('0x10'),_0x5adb('0x11'),_0x5adb('0x12'),_0x5adb('0x13'),_0x5adb('0x14'),'membername','calleridname',_0x5adb('0x15'),_0x5adb('0x16'),_0x5adb('0x17'),'clientEmail',_0x5adb('0x18'),'accesskeyid',_0x5adb('0x19'),'key',_0x5adb('0x1a'),_0x5adb('0x1b'),_0x5adb('0x1c'),'localstationid',_0x5adb('0x1d'),_0x5adb('0x1e'),_0x5adb('0x1f'),'oldPassword'];function maskSensitiveData(_0x2312de){const _0x518823=/(?!^)[\s\S](?!$)/g;if(_[_0x5adb('0x20')](_0x2312de)){for(const _0x42a482 in _0x2312de){if(_[_0x5adb('0x21')](_0x2312de[_0x42a482])){for(let _0x304784=0x0;_0x304784<_0x2312de[_0x42a482][_0x5adb('0x22')];_0x304784++){maskSensitiveData(_0x2312de[_0x42a482][_0x304784]);}}else if(_[_0x5adb('0x20')](_0x2312de[_0x42a482])){maskSensitiveData(_0x2312de[_0x42a482]);}else if(_[_0x5adb('0x23')](_0x2312de[_0x42a482])){_0x2312de[_0x42a482]=_0x2312de[_0x42a482][_0x5adb('0x24')](/{{{/g,_0x5adb('0x25'))['replace'](/}}}/g,_0x5adb('0x26'))['replace'](/{{/g,'@{')[_0x5adb('0x24')](/}}/g,'}@');if(_['includes'](sensitiveFields,_0x42a482)){_0x2312de[_0x42a482]=_0x2312de[_0x42a482][_0x5adb('0x24')](_0x518823,'*');}}}}}module['exports']['maskSensitiveData']=maskSensitiveData;
\ No newline at end of file
index 0b524f8..92c5b42 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xda2d=['exports','safeTemplate','{\x20{\x20','\x20}\x20}','map','isPlainObject','keys','reduce'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xda2d,0x102));var _0xdda2=function(_0x187173,_0x2b0f4d){_0x187173=_0x187173-0x0;var _0x35ccf3=_0xda2d[_0x187173];return _0x35ccf3;};var _=require('lodash');var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x14e970){return _0x14e970==='{{'?_0xdda2('0x0'):_0xdda2('0x1');}function safeTemplate(_0x1f1fcc){var _0x329c5e=_0x1f1fcc;if(typeof _0x1f1fcc==='string'){_0x329c5e=_0x1f1fcc['replace'](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array['isArray'](_0x1f1fcc)){_0x329c5e=_0x1f1fcc[_0xdda2('0x2')](function(_0x319129){return safeTemplate(_0x319129);});}else if(_[_0xdda2('0x3')](_0x1f1fcc)){_0x329c5e=Object[_0xdda2('0x4')](_0x1f1fcc)[_0xdda2('0x5')](function(_0xf38e58,_0x2f55dc){_0xf38e58[_0x2f55dc]=safeTemplate(_0x1f1fcc[_0x2f55dc]);return _0xf38e58;},{});}return _0x329c5e;}module[_0xdda2('0x6')][_0xdda2('0x7')]=safeTemplate;
\ No newline at end of file
+var _0xda2d=['exports','safeTemplate','{\x20{\x20','\x20}\x20}','map','isPlainObject','keys','reduce'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0xda2d,0x102));var _0xdda2=function(_0x4298ad,_0x578eac){_0x4298ad=_0x4298ad-0x0;var _0x34b121=_0xda2d[_0x4298ad];return _0x34b121;};var _=require('lodash');var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x14e970){return _0x14e970==='{{'?_0xdda2('0x0'):_0xdda2('0x1');}function safeTemplate(_0x1f1fcc){var _0x329c5e=_0x1f1fcc;if(typeof _0x1f1fcc==='string'){_0x329c5e=_0x1f1fcc['replace'](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array['isArray'](_0x1f1fcc)){_0x329c5e=_0x1f1fcc[_0xdda2('0x2')](function(_0x319129){return safeTemplate(_0x319129);});}else if(_[_0xdda2('0x3')](_0x1f1fcc)){_0x329c5e=Object[_0xdda2('0x4')](_0x1f1fcc)[_0xdda2('0x5')](function(_0xf38e58,_0x2f55dc){_0xf38e58[_0x2f55dc]=safeTemplate(_0x1f1fcc[_0x2f55dc]);return _0xf38e58;},{});}return _0x329c5e;}module[_0xdda2('0x6')][_0xdda2('0x7')]=safeTemplate;
\ No newline at end of file